From: support Date: Tue, 15 Nov 2022 09:42:36 +0000 (+0000) Subject: Built motion from commit 57b9429b.|2.6.20 X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css/%22javascript:;//%22%7B%7Blicense.chat?a=commitdiff_plain;h=325de9342f7aa86f3dacc435010d0a525fca5f5c;p=motion2.git Built motion from commit 57b9429b.|2.6.20 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 8067c71..e49d24b 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -1,6 +1,6 @@ define({ "name": "xCALLY Motion API", - "version": "2.6.19", + "version": "2.6.20", "description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.", "title": "xCALLY MOTION API", "header": { @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-11-15T09:18:58.678Z", + "time": "2022-11-15T09:33:27.365Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 7a26cf5..75bfca4 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -1,6 +1,6 @@ { "name": "xCALLY Motion API", - "version": "2.6.19", + "version": "2.6.20", "description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.", "title": "xCALLY MOTION API", "header": { @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-11-15T09:18:58.678Z", + "time": "2022-11-15T09:33:27.365Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 0549b25..1ceedbc 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "motion", - "version": "2.6.19", + "version": "2.6.20", "dependencies": { "@babel/code-frame": { "version": "7.18.6", diff --git a/package.json b/package.json index f66562f..79e37a8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "motion", - "version": "2.6.19", + "version": "2.6.20", "description": "xCALLY Motion is the new Realtime asynchronous solution for your multichannel contact center over Asterisk.", "main": "server/app.js", "engines": { diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js index 21087b0..8f57521 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 _0x8015=['urlForward','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','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]','urlForward[body]','sequelize','VIRTUAL','getDataValue','action','STRING','integration','jscripty'];(function(_0x58bc0d,_0x33c72a){var _0x2ebf4a=function(_0x8b6841){while(--_0x8b6841){_0x58bc0d['push'](_0x58bc0d['shift']());}};_0x2ebf4a(++_0x33c72a);}(_0x8015,0x1c9));var _0x5801=function(_0xb0fee0,_0x862292){_0xb0fee0=_0xb0fee0-0x0;var _0x3ab619=_0x8015[_0xb0fee0];return _0x3ab619;};'use strict';var Sequelize=require(_0x5801('0x0'));module['exports']={'name':{'type':Sequelize[_0x5801('0x1')],'get':function(_0x1d70af){return this[_0x5801('0x2')](_0x5801('0x3'));}},'action':{'type':Sequelize[_0x5801('0x4')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0x5801('0x5'),'motionbar',_0x5801('0x6'),_0x5801('0x7'),'browser',_0x5801('0x8'),_0x5801('0x9')]],'msg':_0x5801('0xa')}},'comment':_0x5801('0xa')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x5801('0xb')},'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[_0x5801('0x4')](0x1000),'comment':_0x5801('0xc')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0x5801('0xd')},'data5':{'type':Sequelize[_0x5801('0x4')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0x5801('0x4')],'comments':_0x5801('0xe')},'data7':{'type':Sequelize['TEXT'],'comments':_0x5801('0xf')}}; \ No newline at end of file +var _0x71cb=['urlForward','browser','bot','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','action','integration','motionbar','jscripty'];(function(_0xe51964,_0x433b90){var _0x2c2366=function(_0x1bc95c){while(--_0x1bc95c){_0xe51964['push'](_0xe51964['shift']());}};_0x2c2366(++_0x433b90);}(_0x71cb,0x1ad));var _0xb71c=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0x71cb[_0x2f3848];return _0x102668;};'use strict';var Sequelize=require(_0xb71c('0x0'));module[_0xb71c('0x1')]={'name':{'type':Sequelize[_0xb71c('0x2')],'get':function(_0x5f0230){return this[_0xb71c('0x3')](_0xb71c('0x4'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0xb71c('0x5'),_0xb71c('0x6'),_0xb71c('0x7'),_0xb71c('0x8'),_0xb71c('0x9'),_0xb71c('0xa'),'script']],'msg':_0xb71c('0xb')}},'comment':_0xb71c('0xb')},'data1':{'type':Sequelize[_0xb71c('0xc')](0x1000),'comment':_0xb71c('0xd')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0xb71c('0xe')},'data4':{'type':Sequelize[_0xb71c('0xc')](0x1000),'comments':_0xb71c('0xf')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0xb71c('0x10')},'data6':{'type':Sequelize[_0xb71c('0xc')],'comments':_0xb71c('0x11')},'data7':{'type':Sequelize['TEXT'],'comments':_0xb71c('0x12')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index a991bcb..e9c8ead 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 _0x1ec6=['undefined','limit','count','Content-Range','save','update','then','destroy','name','body','find','params','catch','Action','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1ec6,0x110));var _0x61ec=function(_0x58e1d8,_0x376aa8){_0x58e1d8=_0x58e1d8-0x0;var _0x566728=_0x1ec6[_0x58e1d8];return _0x566728;};'use strict';var emlformat=require(_0x61ec('0x0'));var rimraf=require(_0x61ec('0x1'));var zipdir=require(_0x61ec('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x61ec('0x3'));var moment=require(_0x61ec('0x4'));var BPromise=require(_0x61ec('0x5'));var Mustache=require(_0x61ec('0x6'));var util=require('util');var path=require(_0x61ec('0x7'));var sox=require(_0x61ec('0x8'));var csv=require(_0x61ec('0x9'));var ejs=require(_0x61ec('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x61ec('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x61ec('0xc'));var deskjs=require(_0x61ec('0xd'));var toCsv=require(_0x61ec('0x9'));var querystring=require(_0x61ec('0xe'));var Papa=require('papaparse');var Redis=require(_0x61ec('0xf'));var authService=require(_0x61ec('0x10'));var qs=require(_0x61ec('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x61ec('0x12'));var logger=require(_0x61ec('0x13'))(_0x61ec('0x14'));var utils=require(_0x61ec('0x15'));var config=require(_0x61ec('0x16'));var licenseUtil=require(_0x61ec('0x17'));var db=require(_0x61ec('0x18'))['db'];function respondWithStatusCode(_0x2dc463,_0xaf0c03){_0xaf0c03=_0xaf0c03||0xcc;return function(_0x106bcf){if(_0x106bcf){return _0x2dc463[_0x61ec('0x19')](_0xaf0c03);}return _0x2dc463[_0x61ec('0x1a')](_0xaf0c03)['end']();};}function respondWithResult(_0x29bf24,_0x5e9d49){_0x5e9d49=_0x5e9d49||0xc8;return function(_0x3d5415){if(_0x3d5415){return _0x29bf24[_0x61ec('0x1a')](_0x5e9d49)[_0x61ec('0x1b')](_0x3d5415);}};}function respondWithFilteredResult(_0x1c3a53,_0x9c75a5){return function(_0x1be619){if(_0x1be619){var _0xb09db0=typeof _0x9c75a5[_0x61ec('0x1c')]===_0x61ec('0x1d')&&typeof _0x9c75a5[_0x61ec('0x1e')]===_0x61ec('0x1d');var _0x19edcf=_0x1be619[_0x61ec('0x1f')];var _0x2ab11c=_0xb09db0?0x0:_0x9c75a5[_0x61ec('0x1c')];var _0x4eb783=_0xb09db0?_0x1be619['count']:_0x9c75a5[_0x61ec('0x1c')]+_0x9c75a5[_0x61ec('0x1e')];var _0x4d8bf5;if(_0x4eb783>=_0x19edcf){_0x4eb783=_0x19edcf;_0x4d8bf5=0xc8;}else{_0x4d8bf5=0xce;}_0x1c3a53['status'](_0x4d8bf5);return _0x1c3a53['set'](_0x61ec('0x20'),_0x2ab11c+'-'+_0x4eb783+'/'+_0x19edcf)['json'](_0x1be619);}return null;};}function patchUpdates(_0x41c3de){return function(_0x392323){try{jsonpatch['apply'](_0x392323,_0x41c3de,!![]);}catch(_0x1275e1){return BPromise['reject'](_0x1275e1);}return _0x392323[_0x61ec('0x21')]();};}function saveUpdates(_0x3e5227,_0x452c97){return function(_0x5a8812){if(_0x5a8812){return _0x5a8812[_0x61ec('0x22')](_0x3e5227)[_0x61ec('0x23')](function(_0x41439d){return _0x41439d;});}return null;};}function removeEntity(_0x3df01d,_0x411415){return function(_0x5b0794){if(_0x5b0794){return _0x5b0794[_0x61ec('0x24')]()[_0x61ec('0x23')](function(){_0x3df01d[_0x61ec('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x35be32,_0x7b7a7f){return function(_0x28146d){if(!_0x28146d){_0x35be32[_0x61ec('0x19')](0x194);}return _0x28146d;};}function handleError(_0x184472,_0x3f289e){_0x3f289e=_0x3f289e||0x1f4;return function(_0x4a4bd7){logger['error'](_0x4a4bd7['stack']);if(_0x4a4bd7[_0x61ec('0x25')]){delete _0x4a4bd7['name'];}_0x184472[_0x61ec('0x1a')](_0x3f289e)['send'](_0x4a4bd7);};}exports[_0x61ec('0x22')]=function(_0x858c74,_0x3f0580){if(_0x858c74['body']['id']){delete _0x858c74[_0x61ec('0x26')]['id'];}return db['Action'][_0x61ec('0x27')]({'where':{'id':_0x858c74[_0x61ec('0x28')]['id']}})[_0x61ec('0x23')](handleEntityNotFound(_0x3f0580,null))[_0x61ec('0x23')](saveUpdates(_0x858c74[_0x61ec('0x26')],null))[_0x61ec('0x23')](respondWithResult(_0x3f0580,null))[_0x61ec('0x29')](handleError(_0x3f0580,null));};exports[_0x61ec('0x24')]=function(_0x30f09f,_0x800ac9){return db[_0x61ec('0x2a')][_0x61ec('0x27')]({'where':{'id':_0x30f09f[_0x61ec('0x28')]['id']}})['then'](handleEntityNotFound(_0x800ac9,null))[_0x61ec('0x23')](removeEntity(_0x800ac9,null))[_0x61ec('0x29')](handleError(_0x800ac9,null));}; \ No newline at end of file +var _0xa55b=['reject','save','update','destroy','then','end','sendStatus','name','send','body','Action','find','catch','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','fs-extra','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply'];(function(_0x36d1af,_0xd5b07f){var _0x4db072=function(_0x12cbe7){while(--_0x12cbe7){_0x36d1af['push'](_0x36d1af['shift']());}};_0x4db072(++_0xd5b07f);}(_0xa55b,0x12d));var _0xba55=function(_0x10b20e,_0x3749a3){_0x10b20e=_0x10b20e-0x0;var _0x316ab3=_0xa55b[_0x10b20e];return _0x316ab3;};'use strict';var emlformat=require(_0xba55('0x0'));var rimraf=require(_0xba55('0x1'));var zipdir=require(_0xba55('0x2'));var jsonpatch=require(_0xba55('0x3'));var rp=require('request-promise');var moment=require(_0xba55('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xba55('0x5'));var util=require('util');var path=require(_0xba55('0x6'));var sox=require(_0xba55('0x7'));var csv=require(_0xba55('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xba55('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xba55('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xba55('0x8'));var querystring=require(_0xba55('0xb'));var Papa=require(_0xba55('0xc'));var Redis=require(_0xba55('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xba55('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xba55('0xf'))(_0xba55('0x10'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xba55('0x11'))['db'];function respondWithStatusCode(_0x3eda7a,_0x548826){_0x548826=_0x548826||0xcc;return function(_0x1ed503){if(_0x1ed503){return _0x3eda7a['sendStatus'](_0x548826);}return _0x3eda7a[_0xba55('0x12')](_0x548826)['end']();};}function respondWithResult(_0x2eea84,_0x2366ad){_0x2366ad=_0x2366ad||0xc8;return function(_0x1ef7c6){if(_0x1ef7c6){return _0x2eea84[_0xba55('0x12')](_0x2366ad)[_0xba55('0x13')](_0x1ef7c6);}};}function respondWithFilteredResult(_0x3c7206,_0x4b3dd4){return function(_0x293674){if(_0x293674){var _0x3c72e8=typeof _0x4b3dd4[_0xba55('0x14')]===_0xba55('0x15')&&typeof _0x4b3dd4[_0xba55('0x16')]===_0xba55('0x15');var _0x367744=_0x293674[_0xba55('0x17')];var _0x38a3b2=_0x3c72e8?0x0:_0x4b3dd4['offset'];var _0x4e283a=_0x3c72e8?_0x293674[_0xba55('0x17')]:_0x4b3dd4[_0xba55('0x14')]+_0x4b3dd4[_0xba55('0x16')];var _0x12ef9b;if(_0x4e283a>=_0x367744){_0x4e283a=_0x367744;_0x12ef9b=0xc8;}else{_0x12ef9b=0xce;}_0x3c7206['status'](_0x12ef9b);return _0x3c7206[_0xba55('0x18')](_0xba55('0x19'),_0x38a3b2+'-'+_0x4e283a+'/'+_0x367744)['json'](_0x293674);}return null;};}function patchUpdates(_0xde57b2){return function(_0x292f06){try{jsonpatch[_0xba55('0x1a')](_0x292f06,_0xde57b2,!![]);}catch(_0x1faea0){return BPromise[_0xba55('0x1b')](_0x1faea0);}return _0x292f06[_0xba55('0x1c')]();};}function saveUpdates(_0x20e6f3,_0x4370e9){return function(_0x47a340){if(_0x47a340){return _0x47a340[_0xba55('0x1d')](_0x20e6f3)['then'](function(_0x1f7db3){return _0x1f7db3;});}return null;};}function removeEntity(_0x514c77,_0x43f311){return function(_0x330018){if(_0x330018){return _0x330018[_0xba55('0x1e')]()[_0xba55('0x1f')](function(){_0x514c77['status'](0xcc)[_0xba55('0x20')]();});}};}function handleEntityNotFound(_0x40e4a4,_0x440ddc){return function(_0x5d88f6){if(!_0x5d88f6){_0x40e4a4[_0xba55('0x21')](0x194);}return _0x5d88f6;};}function handleError(_0x1361bb,_0x303a30){_0x303a30=_0x303a30||0x1f4;return function(_0x5cfa8b){logger['error'](_0x5cfa8b['stack']);if(_0x5cfa8b[_0xba55('0x22')]){delete _0x5cfa8b['name'];}_0x1361bb[_0xba55('0x12')](_0x303a30)[_0xba55('0x23')](_0x5cfa8b);};}exports[_0xba55('0x1d')]=function(_0x1daa5a,_0x199ce4){if(_0x1daa5a[_0xba55('0x24')]['id']){delete _0x1daa5a[_0xba55('0x24')]['id'];}return db[_0xba55('0x25')][_0xba55('0x26')]({'where':{'id':_0x1daa5a['params']['id']}})['then'](handleEntityNotFound(_0x199ce4,null))[_0xba55('0x1f')](saveUpdates(_0x1daa5a['body'],null))[_0xba55('0x1f')](respondWithResult(_0x199ce4,null))[_0xba55('0x27')](handleError(_0x199ce4,null));};exports[_0xba55('0x1e')]=function(_0x3d0c68,_0x4c1265){return db['Action'][_0xba55('0x26')]({'where':{'id':_0x3d0c68[_0xba55('0x28')]['id']}})[_0xba55('0x1f')](handleEntityNotFound(_0x4c1265,null))[_0xba55('0x1f')](removeEntity(_0x4c1265,null))[_0xba55('0x27')](handleError(_0x4c1265,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 8bd57c4..3ecaf47 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 _0x9e07=['exports','Action','lodash','util','moment','request-promise','rimraf','../../config/environment','./action.attributes'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9e07,0x1a0));var _0x79e0=function(_0x6fd6a5,_0x4df3ce){_0x6fd6a5=_0x6fd6a5-0x0;var _0x53036f=_0x9e07[_0x6fd6a5];return _0x53036f;};'use strict';var _=require(_0x79e0('0x0'));var util=require(_0x79e0('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x79e0('0x2'));var BPromise=require('bluebird');var rp=require(_0x79e0('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x79e0('0x4'));var config=require(_0x79e0('0x5'));var attributes=require(_0x79e0('0x6'));module[_0x79e0('0x7')]=function(_0x194d54,_0x211e6c){return _0x194d54['define'](_0x79e0('0x8'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0706=['tools_actions','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./action.attributes','define','Action'];(function(_0x50d4b5,_0x183b95){var _0x29f3a2=function(_0x3298d6){while(--_0x3298d6){_0x50d4b5['push'](_0x50d4b5['shift']());}};_0x29f3a2(++_0x183b95);}(_0x0706,0x91));var _0x6070=function(_0x240c42,_0x33f5c1){_0x240c42=_0x240c42-0x0;var _0x53d6e2=_0x0706[_0x240c42];return _0x53d6e2;};'use strict';var _=require(_0x6070('0x0'));var util=require('util');var logger=require(_0x6070('0x1'))(_0x6070('0x2'));var moment=require(_0x6070('0x3'));var BPromise=require('bluebird');var rp=require(_0x6070('0x4'));var fs=require('fs');var path=require(_0x6070('0x5'));var rimraf=require(_0x6070('0x6'));var config=require(_0x6070('0x7'));var attributes=require(_0x6070('0x8'));module['exports']=function(_0x57f651,_0x35b3b2){return _0x57f651[_0x6070('0x9')](_0x6070('0xa'),attributes,{'tableName':_0x6070('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 5469366..383964a 100644 --- a/server/api/action/action.rpc.js +++ b/server/api/action/action.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fc3=['../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','stringify','error','code','message','Action,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x51a98d,_0x1d2e28){var _0x3ffd96=function(_0x4c27d9){while(--_0x4c27d9){_0x51a98d['push'](_0x51a98d['shift']());}};_0x3ffd96(++_0x1d2e28);}(_0x5fc3,0xa8));var _0x35fc=function(_0x303c30,_0x16edcb){_0x303c30=_0x303c30-0x0;var _0x43161b=_0x5fc3[_0x303c30];return _0x43161b;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var moment=require('moment');var BPromise=require(_0x35fc('0x2'));var rs=require(_0x35fc('0x3'));var fs=require('fs');var Redis=require(_0x35fc('0x4'));var db=require(_0x35fc('0x5'))['db'];var utils=require(_0x35fc('0x6'));var logger=require('../../config/logger')(_0x35fc('0x7'));var config=require(_0x35fc('0x8'));var jayson=require(_0x35fc('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19a0d1,_0x508b32,_0x16e153){return new BPromise(function(_0x27524f,_0xc72d93){return client[_0x35fc('0xa')](_0x19a0d1,_0x16e153)[_0x35fc('0xb')](function(_0xf9d3a6){logger[_0x35fc('0xc')]('Action,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'));logger[_0x35fc('0xe')]('Action,\x20%s,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'),JSON[_0x35fc('0xf')](_0xf9d3a6));if(_0xf9d3a6['error']){if(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x11')]===0x1f4){logger['error']('Action,\x20%s,\x20%s',_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0xc72d93(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x12')]);}logger[_0x35fc('0x10')](_0x35fc('0x13'),_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0x27524f(_0xf9d3a6['error']['message']);}else{logger['info'](_0x35fc('0x13'),_0x508b32,_0x35fc('0xd'));_0x27524f(_0xf9d3a6[_0x35fc('0x14')][_0x35fc('0x12')]);}})[_0x35fc('0x15')](function(_0x1121fa){logger['error'](_0x35fc('0x13'),_0x508b32,_0x1121fa);_0xc72d93(_0x1121fa);});});} \ No newline at end of file +var _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(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x1cb9,0x14e));var _0x91cb=function(_0x1c7537,_0x430bef){_0x1c7537=_0x1c7537-0x0;var _0x3ec507=_0x1cb9[_0x1c7537];return _0x3ec507;};'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 ef03399..b92a3af 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 _0x3403=['exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','delete'];(function(_0x329adf,_0x430dea){var _0x480b67=function(_0x5d8728){while(--_0x5d8728){_0x329adf['push'](_0x329adf['shift']());}};_0x480b67(++_0x430dea);}(_0x3403,0x169));var _0x3340=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x3403[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require(_0x3340('0x0'));var util=require(_0x3340('0x1'));var path=require(_0x3340('0x2'));var timeout=require('connect-timeout');var express=require(_0x3340('0x3'));var router=express[_0x3340('0x4')]();var fs_extra=require(_0x3340('0x5'));var auth=require(_0x3340('0x6'));var interaction=require(_0x3340('0x7'));var config=require(_0x3340('0x8'));var controller=require(_0x3340('0x9'));router[_0x3340('0xa')](_0x3340('0xb'),auth[_0x3340('0xc')](),controller['update']);router[_0x3340('0xd')]('/:id',auth[_0x3340('0xc')](),controller['destroy']);module[_0x3340('0xe')]=router; \ No newline at end of file +var _0xbe9f=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','/:id','delete','isAuthenticated','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x4640f3,_0x2637a4){var _0x4e1a6c=function(_0x42e872){while(--_0x42e872){_0x4640f3['push'](_0x4640f3['shift']());}};_0x4e1a6c(++_0x2637a4);}(_0xbe9f,0x8a));var _0xfbe9=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xbe9f[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0xfbe9('0x0'));var util=require(_0xfbe9('0x1'));var path=require(_0xfbe9('0x2'));var timeout=require(_0xfbe9('0x3'));var express=require(_0xfbe9('0x4'));var router=express[_0xfbe9('0x5')]();var fs_extra=require(_0xfbe9('0x6'));var auth=require(_0xfbe9('0x7'));var interaction=require(_0xfbe9('0x8'));var config=require(_0xfbe9('0x9'));var controller=require(_0xfbe9('0xa'));router['put'](_0xfbe9('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xfbe9('0xc')](_0xfbe9('0xb'),auth[_0xfbe9('0xd')](),controller[_0xfbe9('0xe')]);module[_0xfbe9('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 7b5531b..c3def4a 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 _0xeff8=['STRING','TEXT','sequelize','exports'];(function(_0x58a4ca,_0x339bea){var _0x188c2a=function(_0x57713c){while(--_0x57713c){_0x58a4ca['push'](_0x58a4ca['shift']());}};_0x188c2a(++_0x339bea);}(_0xeff8,0x186));var _0x8eff=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xeff8[_0x3e5086];return _0xfeb102;};'use strict';var Sequelize=require(_0x8eff('0x0'));module[_0x8eff('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x8eff('0x2')]},'parent':{'type':Sequelize[_0x8eff('0x2')]},'table':{'type':Sequelize[_0x8eff('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x8eff('0x3')]}}; \ No newline at end of file +var _0xee14=['STRING','TEXT'];(function(_0x2c732c,_0x3ad39a){var _0x2ccda3=function(_0x33ffb2){while(--_0x33ffb2){_0x2c732c['push'](_0x2c732c['shift']());}};_0x2ccda3(++_0x3ad39a);}(_0xee14,0x13a));var _0x4ee1=function(_0x44f657,_0x48083a){_0x44f657=_0x44f657-0x0;var _0x222d57=_0xee14[_0x44f657];return _0x222d57;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4ee1('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0x4ee1('0x0')]},'parent':{'type':Sequelize[_0x4ee1('0x0')]},'table':{'type':Sequelize[_0x4ee1('0x0')]},'conditions':{'type':Sequelize[_0x4ee1('0x1')]},'joins':{'type':Sequelize[_0x4ee1('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 5cfc2a8..c53f702 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 _0xf819=['crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','get','CustomReports','UserProfileResource','error','stack','name','send','index','map','AnalyticCustomReport','fieldName','type','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','where','merge','options','includeAll','include','rows','show','params','rawAttributes','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','group','condition','value','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','findAll','keyBy','select','from','table','MetricId','metric','field','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20EMPTY','operator','find','web','fullPath','%s-%s.%s','randomstring','generate','output','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','run','runReport','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel'];(function(_0x110b95,_0x46a106){var _0x5b78d2=function(_0x503f58){while(--_0x503f58){_0x110b95['push'](_0x110b95['shift']());}};_0x5b78d2(++_0x46a106);}(_0xf819,0x9d));var _0x9f81=function(_0x1f6e37,_0x560390){_0x1f6e37=_0x1f6e37-0x0;var _0x3d17ad=_0xf819[_0x1f6e37];return _0x3d17ad;};'use strict';var emlformat=require(_0x9f81('0x0'));var rimraf=require(_0x9f81('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9f81('0x2'));var rp=require(_0x9f81('0x3'));var moment=require(_0x9f81('0x4'));var BPromise=require(_0x9f81('0x5'));var Mustache=require(_0x9f81('0x6'));var util=require('util');var path=require(_0x9f81('0x7'));var sox=require('sox');var csv=require(_0x9f81('0x8'));var ejs=require(_0x9f81('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9f81('0xa'));var squel=require(_0x9f81('0xb'));var crypto=require(_0x9f81('0xc'));var jsforce=require(_0x9f81('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x9f81('0x8'));var querystring=require(_0x9f81('0xe'));var Papa=require(_0x9f81('0xf'));var Redis=require('ioredis');var authService=require(_0x9f81('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x9f81('0x11'));var hardwareService=require(_0x9f81('0x12'));var logger=require('../../config/logger')(_0x9f81('0x13'));var utils=require('../../config/utils');var config=require(_0x9f81('0x14'));var licenseUtil=require(_0x9f81('0x15'));var db=require(_0x9f81('0x16'))['db'];var dbH=require(_0x9f81('0x16'))[_0x9f81('0x17')];function respondWithStatusCode(_0x196840,_0x3c1f6c){_0x3c1f6c=_0x3c1f6c||0xcc;return function(_0x24683f){if(_0x24683f){return _0x196840[_0x9f81('0x18')](_0x3c1f6c);}return _0x196840[_0x9f81('0x19')](_0x3c1f6c)[_0x9f81('0x1a')]();};}function respondWithResult(_0x578404,_0x1b9410){_0x1b9410=_0x1b9410||0xc8;return function(_0x65d21d){if(_0x65d21d){return _0x578404['status'](_0x1b9410)[_0x9f81('0x1b')](_0x65d21d);}};}function respondWithFilteredResult(_0x3fd3aa,_0xa282){return function(_0x10155b){if(_0x10155b){var _0x216a93=typeof _0xa282['offset']===_0x9f81('0x1c')&&typeof _0xa282[_0x9f81('0x1d')]===_0x9f81('0x1c');var _0x4d0c97=_0x10155b[_0x9f81('0x1e')];var _0x53925b=_0x216a93?0x0:_0xa282[_0x9f81('0x1f')];var _0x2a1851=_0x216a93?_0x10155b[_0x9f81('0x1e')]:_0xa282[_0x9f81('0x1f')]+_0xa282[_0x9f81('0x1d')];var _0x4e5200;if(_0x2a1851>=_0x4d0c97){_0x2a1851=_0x4d0c97;_0x4e5200=0xc8;}else{_0x4e5200=0xce;}_0x3fd3aa['status'](_0x4e5200);return _0x3fd3aa['set'](_0x9f81('0x20'),_0x53925b+'-'+_0x2a1851+'/'+_0x4d0c97)[_0x9f81('0x1b')](_0x10155b);}return null;};}function patchUpdates(_0x30f809){return function(_0x15a88c){try{jsonpatch[_0x9f81('0x21')](_0x15a88c,_0x30f809,!![]);}catch(_0x538e17){return BPromise[_0x9f81('0x22')](_0x538e17);}return _0x15a88c[_0x9f81('0x23')]();};}function saveUpdates(_0x4604d5,_0x6799ad){return function(_0x210200){if(_0x210200){return _0x210200[_0x9f81('0x24')](_0x4604d5)[_0x9f81('0x25')](function(_0x1abb9f){return _0x1abb9f;});}return null;};}function removeEntity(_0x4e0c03,_0x3f1a82){return function(_0x298ea7){if(_0x298ea7){return _0x298ea7[_0x9f81('0x26')]()[_0x9f81('0x25')](function(){var _0x3a4d7a=_0x298ea7[_0x9f81('0x27')]({'plain':!![]});var _0x3f8509=_0x9f81('0x28');return db[_0x9f81('0x29')]['destroy']({'where':{'type':_0x3f8509,'resourceId':_0x3a4d7a['id']}})[_0x9f81('0x25')](function(){return _0x298ea7;});})['then'](function(){_0x4e0c03[_0x9f81('0x19')](0xcc)[_0x9f81('0x1a')]();});}};}function handleEntityNotFound(_0x3dd520,_0x270c5f){return function(_0xaba8c4){if(!_0xaba8c4){_0x3dd520[_0x9f81('0x18')](0x194);}return _0xaba8c4;};}function handleError(_0x25f745,_0x53b61d){_0x53b61d=_0x53b61d||0x1f4;return function(_0x3545ab){logger[_0x9f81('0x2a')](_0x3545ab[_0x9f81('0x2b')]);if(_0x3545ab[_0x9f81('0x2c')]){delete _0x3545ab['name'];}_0x25f745[_0x9f81('0x19')](_0x53b61d)[_0x9f81('0x2d')](_0x3545ab);};}exports[_0x9f81('0x2e')]=function(_0x1129e3,_0x476755){var _0x3a90a9={},_0x1e89f6={},_0x107372={'count':0x0,'rows':[]};var _0x973142=_[_0x9f81('0x2f')](db[_0x9f81('0x30')]['rawAttributes'],function(_0x872a0e){return{'name':_0x872a0e[_0x9f81('0x31')],'type':_0x872a0e[_0x9f81('0x32')][_0x9f81('0x33')]};});_0x1e89f6['model']=_[_0x9f81('0x2f')](_0x973142,'name');_0x1e89f6[_0x9f81('0x34')]=_[_0x9f81('0x35')](_0x1129e3[_0x9f81('0x34')]);_0x1e89f6['filters']=_[_0x9f81('0x36')](_0x1e89f6[_0x9f81('0x37')],_0x1e89f6[_0x9f81('0x34')]);_0x3a90a9['attributes']=_[_0x9f81('0x36')](_0x1e89f6[_0x9f81('0x37')],qs[_0x9f81('0x38')](_0x1129e3[_0x9f81('0x34')][_0x9f81('0x38')]));_0x3a90a9[_0x9f81('0x39')]=_0x3a90a9['attributes'][_0x9f81('0x3a')]?_0x3a90a9[_0x9f81('0x39')]:_0x1e89f6[_0x9f81('0x37')];if(!_0x1129e3[_0x9f81('0x34')][_0x9f81('0x3b')](_0x9f81('0x3c'))){_0x3a90a9[_0x9f81('0x1d')]=qs[_0x9f81('0x1d')](_0x1129e3[_0x9f81('0x34')][_0x9f81('0x1d')]);_0x3a90a9[_0x9f81('0x1f')]=qs[_0x9f81('0x1f')](_0x1129e3[_0x9f81('0x34')][_0x9f81('0x1f')]);}_0x3a90a9[_0x9f81('0x3d')]=qs[_0x9f81('0x3e')](_0x1129e3[_0x9f81('0x34')][_0x9f81('0x3e')]);_0x3a90a9['where']=qs[_0x9f81('0x3f')](_['pick'](_0x1129e3['query'],_0x1e89f6[_0x9f81('0x3f')]),_0x973142);if(_0x1129e3['query']['filter']){_0x3a90a9[_0x9f81('0x40')]=_[_0x9f81('0x41')](_0x3a90a9[_0x9f81('0x40')],{'$or':_[_0x9f81('0x2f')](_0x973142,function(_0x40acdc){if(_0x40acdc[_0x9f81('0x32')]!=='VIRTUAL'){var _0x340597={};_0x340597[_0x40acdc[_0x9f81('0x2c')]]={'$like':'%'+_0x1129e3[_0x9f81('0x34')]['filter']+'%'};return _0x340597;}})});}_0x3a90a9=_['merge']({},_0x3a90a9,_0x1129e3[_0x9f81('0x42')]);var _0x318fcd={'where':_0x3a90a9[_0x9f81('0x40')]};return db['AnalyticCustomReport'][_0x9f81('0x1e')](_0x318fcd)[_0x9f81('0x25')](function(_0x4dcff5){_0x107372[_0x9f81('0x1e')]=_0x4dcff5;if(_0x1129e3[_0x9f81('0x34')][_0x9f81('0x43')]){_0x3a90a9[_0x9f81('0x44')]=[{'all':!![]}];}return db[_0x9f81('0x30')]['findAll'](_0x3a90a9);})[_0x9f81('0x25')](function(_0x4175f2){_0x107372[_0x9f81('0x45')]=_0x4175f2;return _0x107372;})[_0x9f81('0x25')](respondWithFilteredResult(_0x476755,_0x3a90a9))['catch'](handleError(_0x476755,null));};exports[_0x9f81('0x46')]=function(_0x400265,_0x431a0b){var _0x3cc132={'raw':![],'where':{'id':_0x400265[_0x9f81('0x47')]['id']}},_0xdeca88={};_0xdeca88[_0x9f81('0x37')]=_[_0x9f81('0x35')](db['AnalyticCustomReport'][_0x9f81('0x48')]);_0xdeca88['query']=_[_0x9f81('0x35')](_0x400265[_0x9f81('0x34')]);_0xdeca88[_0x9f81('0x3f')]=_[_0x9f81('0x36')](_0xdeca88[_0x9f81('0x37')],_0xdeca88[_0x9f81('0x34')]);_0x3cc132[_0x9f81('0x39')]=_['intersection'](_0xdeca88[_0x9f81('0x37')],qs[_0x9f81('0x38')](_0x400265[_0x9f81('0x34')]['fields']));_0x3cc132[_0x9f81('0x39')]=_0x3cc132[_0x9f81('0x39')][_0x9f81('0x3a')]?_0x3cc132[_0x9f81('0x39')]:_0xdeca88[_0x9f81('0x37')];if(_0x400265[_0x9f81('0x34')][_0x9f81('0x43')]){_0x3cc132[_0x9f81('0x44')]=[{'all':!![]}];}_0x3cc132=_[_0x9f81('0x41')]({},_0x3cc132,_0x400265[_0x9f81('0x42')]);return db['AnalyticCustomReport']['find'](_0x3cc132)['then'](handleEntityNotFound(_0x431a0b,null))[_0x9f81('0x25')](respondWithResult(_0x431a0b,null))[_0x9f81('0x49')](handleError(_0x431a0b,null));};exports[_0x9f81('0x4a')]=function(_0x3a65fb,_0x30aa26){return db[_0x9f81('0x30')]['create'](_0x3a65fb[_0x9f81('0x4b')],{})[_0x9f81('0x25')](function(_0x324a00){var _0x3cda85=_0x3a65fb['user'][_0x9f81('0x27')]({'plain':!![]});if(!_0x3cda85)throw new Error(_0x9f81('0x4c'));if(_0x3cda85[_0x9f81('0x4d')]===_0x9f81('0x4e')){var _0xe679f9=_0x324a00[_0x9f81('0x27')]({'plain':!![]});var _0x4f57fa=_0x9f81('0x4f');return db[_0x9f81('0x50')]['find']({'where':{'name':_0x4f57fa,'userProfileId':_0x3cda85[_0x9f81('0x51')]},'raw':!![]})[_0x9f81('0x25')](function(_0x177496){if(_0x177496&&_0x177496[_0x9f81('0x52')]===0x0){return db[_0x9f81('0x29')][_0x9f81('0x4a')]({'name':_0xe679f9[_0x9f81('0x2c')],'resourceId':_0xe679f9['id'],'type':_0x9f81('0x28'),'sectionId':_0x177496['id']},{})[_0x9f81('0x25')](function(){return _0x324a00;});}else{return _0x324a00;}})[_0x9f81('0x49')](function(_0x2e55fa){logger[_0x9f81('0x2a')](_0x9f81('0x53'),_0x2e55fa);throw _0x2e55fa;});}return _0x324a00;})[_0x9f81('0x25')](respondWithResult(_0x30aa26,0xc9))[_0x9f81('0x49')](handleError(_0x30aa26,null));};exports['update']=function(_0x3d9ea3,_0x1e5006){if(_0x3d9ea3[_0x9f81('0x4b')]['id']){delete _0x3d9ea3[_0x9f81('0x4b')]['id'];}return db[_0x9f81('0x30')]['find']({'where':{'id':_0x3d9ea3['params']['id']}})[_0x9f81('0x25')](handleEntityNotFound(_0x1e5006,null))[_0x9f81('0x25')](saveUpdates(_0x3d9ea3[_0x9f81('0x4b')],null))[_0x9f81('0x25')](respondWithResult(_0x1e5006,null))[_0x9f81('0x49')](handleError(_0x1e5006,null));};exports[_0x9f81('0x26')]=function(_0x252026,_0xbafe0f){return db[_0x9f81('0x30')]['find']({'where':{'id':_0x252026['params']['id']}})[_0x9f81('0x25')](handleEntityNotFound(_0xbafe0f,null))['then'](removeEntity(_0xbafe0f,null))['catch'](handleError(_0xbafe0f,null));};exports[_0x9f81('0x54')]=function(_0x38908a,_0x292b43){var _0x301d58=0xa;var _0x3bcafb=[_0x9f81('0x55'),_0x9f81('0x56'),_0x9f81('0x57'),_0x9f81('0x58')];var _0x223c20={'SUM':_0x9f81('0x59'),'COUNT':_0x9f81('0x5a'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x9f81('0x5b'),'MIN':_0x9f81('0x5c'),'AVG':_0x9f81('0x5d'),'GROUP_CONCAT':_0x9f81('0x5e'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x9f81('0x5f')};var _0x2f4dd8={'SEC_TO_TIME':_0x9f81('0x60'),'DATE':_0x9f81('0x61'),'HOUR':_0x9f81('0x62'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x444358=function(_0x189348){return!_[_0x9f81('0x63')]([_0x9f81('0x64'),_0x9f81('0x65'),_0x9f81('0x66'),'IS\x20NOT\x20EMPTY'],_0x189348);};var _0x2741a5=function(_0x3d0ff9){if(!_0x3d0ff9||!_0x3d0ff9['rules'][_0x9f81('0x3a')]){return'';}for(var _0x1c8f15='(',_0x40fd3b=0x0;_0x40fd3b<_0x3d0ff9[_0x9f81('0x67')][_0x9f81('0x3a')];_0x40fd3b+=0x1){_0x40fd3b>0x0&&(_0x1c8f15+='\x20'+_0x3d0ff9['operator']+'\x20');_0x1c8f15+=_0x3d0ff9[_0x9f81('0x67')][_0x40fd3b][_0x9f81('0x68')]?_0x2741a5(_0x3d0ff9[_0x9f81('0x67')][_0x40fd3b][_0x9f81('0x68')]):_0x3d0ff9[_0x9f81('0x67')][_0x40fd3b]['field']+'\x20'+_0x3d0ff9[_0x9f81('0x67')][_0x40fd3b][_0x9f81('0x69')]+(_0x444358(_0x3d0ff9[_0x9f81('0x67')][_0x40fd3b][_0x9f81('0x69')])?'\x20'+_0x3d0ff9['rules'][_0x40fd3b][_0x9f81('0x6a')]:'');}return _0x1c8f15+')';};var _0x3a1cb7={'where':{'id':_0x38908a[_0x9f81('0x47')]['id']}},_0x57823c,_0xaf49a2,_0x512ac3,_0x1fd796,_0x1f0d86;_0x3a1cb7=_[_0x9f81('0x41')]({},_0x3a1cb7,_0x38908a[_0x9f81('0x42')]);return db[_0x9f81('0x30')]['find'](_0x3a1cb7)['then'](function(_0x25d666){if(_0x25d666){_0x57823c=_0x25d666;return _0x25d666[_0x9f81('0x6b')]();}return null;})[_0x9f81('0x25')](function(_0x5a25e3){if(_0x5a25e3){if(!_0x5a25e3[_0x9f81('0x3a')]){throw new db[(_0x9f81('0x6c'))][(_0x9f81('0x6d'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xaf49a2=_0x5a25e3;return db[_0x9f81('0x6e')][_0x9f81('0x6f')]({'raw':!![]});}return null;})[_0x9f81('0x25')](function(_0x9383ad){if(_0x9383ad){_0x512ac3=_[_0x9f81('0x70')](_0x9383ad,'id');var _0x1e8e86;var _0x45a316=squel[_0x9f81('0x71')]();_0x45a316[_0x9f81('0x72')](_0x57823c[_0x9f81('0x73')]);for(var _0x27d8c0=0x0;_0x27d8c0<_0xaf49a2[_0x9f81('0x3a')];_0x27d8c0+=0x1){_0x1e8e86=_0xaf49a2[_0x27d8c0]['MetricId']?_0x512ac3[_0xaf49a2[_0x27d8c0][_0x9f81('0x74')]][_0x9f81('0x75')]:_0xaf49a2[_0x27d8c0][_0x9f81('0x76')];_0x1e8e86=_0xaf49a2[_0x27d8c0][_0x9f81('0x77')]?_[_0x9f81('0x78')](_0x223c20[_0xaf49a2[_0x27d8c0][_0x9f81('0x77')]],'%s',_0x1e8e86):_0x1e8e86;_0x1e8e86=_0xaf49a2[_0x27d8c0][_0x9f81('0x79')]?_[_0x9f81('0x78')](_0x2f4dd8[_0xaf49a2[_0x27d8c0]['format']],'%s',_0x1e8e86):_0x1e8e86;if(_0xaf49a2[_0x27d8c0][_0x9f81('0x7a')]){_0x45a316[_0x9f81('0x68')](_0x1e8e86);}_0xaf49a2[_0x27d8c0][_0x9f81('0x7b')]&&_0x45a316['order'](_0x1e8e86,_0xaf49a2[_0x27d8c0][_0x9f81('0x7b')]===_0x9f81('0x7c')?![]:!![]);_0x45a316[_0x9f81('0x76')](_0x1e8e86,_0xaf49a2[_0x27d8c0][_0x9f81('0x7d')]||_0x1e8e86);}if(_0x57823c[_0x9f81('0x7e')]){_0x57823c[_0x9f81('0x7e')]=JSON[_0x9f81('0x7f')](_0x57823c[_0x9f81('0x7e')]);for(var _0x50a81a=0x0;_0x50a81a<_0x57823c['joins'][_0x9f81('0x3a')];_0x50a81a+=0x1){if(_0x57823c[_0x9f81('0x7e')][_0x50a81a][_0x9f81('0x32')]&&_['includes'](_0x3bcafb,_0x57823c[_0x9f81('0x7e')][_0x50a81a][_0x9f81('0x32')])&&_0x57823c[_0x9f81('0x7e')][_0x50a81a][_0x9f81('0x80')]&&_0x57823c[_0x9f81('0x7e')][_0x50a81a]['foreignTable']&&_0x57823c[_0x9f81('0x7e')][_0x50a81a][_0x9f81('0x81')]){_0x45a316[_0x57823c['joins'][_0x50a81a][_0x9f81('0x32')]](_0x57823c[_0x9f81('0x7e')][_0x50a81a][_0x9f81('0x82')],null,util[_0x9f81('0x79')](_0x9f81('0x83'),_0x57823c[_0x9f81('0x73')],_0x57823c[_0x9f81('0x7e')][_0x50a81a][_0x9f81('0x80')],_0x57823c[_0x9f81('0x7e')][_0x50a81a][_0x9f81('0x82')],_0x57823c[_0x9f81('0x7e')][_0x50a81a]['foreignKey']));}}}if(_0x57823c['conditions']){_0x57823c[_0x9f81('0x84')]=JSON['parse'](_0x57823c['conditions']);_0x45a316[_0x9f81('0x40')](_0x2741a5(_0x57823c[_0x9f81('0x84')]['group']));}_0x1f0d86=_0x45a316[_0x9f81('0x85')]();_0x45a316[_0x9f81('0x1d')](_0x301d58);_0x45a316['offset'](0x0);logger[_0x9f81('0x86')](_0x9f81('0x87'),_0x45a316['toString']());return dbH['sequelize'][_0x9f81('0x34')](_0x45a316[_0x9f81('0x88')](),{'type':dbH[_0x9f81('0x89')][_0x9f81('0x8a')][_0x9f81('0x8b')]});}})[_0x9f81('0x25')](respondWithResult(_0x292b43,null))[_0x9f81('0x49')](handleError(_0x292b43,null));};function runReport(_0x378e61,_0xd44535,_0x5b99e8){var _0x37a59b=_0xd44535['name'];var _0x24ffd6=0xa;var _0x18ab7b=[_0x9f81('0x55'),_0x9f81('0x56'),_0x9f81('0x57'),'cross_join'];var _0x351010={'SUM':'SUM(%s)','COUNT':_0x9f81('0x5a'),'COUNT DISTINCT':_0x9f81('0x8c'),'MAX':_0x9f81('0x5b'),'MIN':'MIN(%s)','AVG':_0x9f81('0x5d'),'GROUP_CONCAT':_0x9f81('0x5e'),'GROUP_CONCAT ASC':_0x9f81('0x8d'),'GROUP_CONCAT DESC':_0x9f81('0x5f')};var _0x23cafb={'SEC_TO_TIME':_0x9f81('0x60'),'DATE':_0x9f81('0x61'),'HOUR':_0x9f81('0x62'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x9f81('0x8e')};var _0x693d17=function(_0x1fd9f8){return!_['includes']([_0x9f81('0x64'),_0x9f81('0x65'),_0x9f81('0x66'),_0x9f81('0x8f')],_0x1fd9f8);};var _0xf3ae3b=function(_0x577c7f){if(!_0x577c7f||!_0x577c7f[_0x9f81('0x67')][_0x9f81('0x3a')]){return'';}for(var _0xa6fbc4='(',_0x12e33a=0x0;_0x12e33a<_0x577c7f[_0x9f81('0x67')][_0x9f81('0x3a')];_0x12e33a+=0x1){_0x12e33a>0x0&&(_0xa6fbc4+='\x20'+_0x577c7f[_0x9f81('0x90')]+'\x20');_0xa6fbc4+=_0x577c7f[_0x9f81('0x67')][_0x12e33a][_0x9f81('0x68')]?_0xf3ae3b(_0x577c7f[_0x9f81('0x67')][_0x12e33a]['group']):_0x577c7f[_0x9f81('0x67')][_0x12e33a][_0x9f81('0x76')]+'\x20'+_0x577c7f[_0x9f81('0x67')][_0x12e33a][_0x9f81('0x69')]+(_0x693d17(_0x577c7f[_0x9f81('0x67')][_0x12e33a]['condition'])?'\x20'+_0x577c7f[_0x9f81('0x67')][_0x12e33a][_0x9f81('0x6a')]:'');}return _0xa6fbc4+')';};var _0xe02cad={'where':{'id':_0x378e61['id']}},_0x34baf3,_0x462f0c,_0x14fb9b,_0x49f01f,_0x4649f0;_0xe02cad=_[_0x9f81('0x41')]({},_0xe02cad,_0x5b99e8);return db[_0x9f81('0x30')][_0x9f81('0x91')](_0xe02cad)[_0x9f81('0x25')](function(_0x10417d){if(_0x10417d){_0x34baf3=_0x10417d;return _0x10417d[_0x9f81('0x6b')]();}return null;})[_0x9f81('0x25')](function(_0x5edc25){if(_0x5edc25){if(!_0x5edc25[_0x9f81('0x3a')]){throw new db[(_0x9f81('0x6c'))][(_0x9f81('0x6d'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x462f0c=_0x5edc25;return db['AnalyticMetric'][_0x9f81('0x6f')]({'raw':!![]});}return null;})[_0x9f81('0x25')](function(_0x195d0f){if(_0x195d0f){_0x14fb9b=_['keyBy'](_0x195d0f,'id');var _0x143478;var _0x40aea1=squel[_0x9f81('0x71')]();_0x40aea1[_0x9f81('0x72')](_0x34baf3[_0x9f81('0x73')]);for(var _0x1fd322=0x0;_0x1fd322<_0x462f0c[_0x9f81('0x3a')];_0x1fd322+=0x1){_0x143478=_0x462f0c[_0x1fd322][_0x9f81('0x74')]?_0x14fb9b[_0x462f0c[_0x1fd322][_0x9f81('0x74')]][_0x9f81('0x75')]:_0x462f0c[_0x1fd322]['field'];_0x143478=_0x462f0c[_0x1fd322]['function']?_[_0x9f81('0x78')](_0x351010[_0x462f0c[_0x1fd322][_0x9f81('0x77')]],'%s',_0x143478):_0x143478;_0x143478=_0x462f0c[_0x1fd322]['format']?_[_0x9f81('0x78')](_0x23cafb[_0x462f0c[_0x1fd322]['format']],'%s',_0x143478):_0x143478;if(_0x462f0c[_0x1fd322]['groupBy']){_0x40aea1[_0x9f81('0x68')](_0x143478);}_0x462f0c[_0x1fd322][_0x9f81('0x7b')]&&_0x40aea1[_0x9f81('0x3d')](_0x143478,_0x462f0c[_0x1fd322][_0x9f81('0x7b')]===_0x9f81('0x7c')?![]:!![]);_0x40aea1[_0x9f81('0x76')](_0x143478,_0x462f0c[_0x1fd322][_0x9f81('0x7d')]||_0x143478);}if(_0x34baf3[_0x9f81('0x7e')]){_0x34baf3[_0x9f81('0x7e')]=JSON[_0x9f81('0x7f')](_0x34baf3[_0x9f81('0x7e')]);for(var _0x35108=0x0;_0x35108<_0x34baf3[_0x9f81('0x7e')][_0x9f81('0x3a')];_0x35108+=0x1){if(_0x34baf3['joins'][_0x35108][_0x9f81('0x32')]&&_[_0x9f81('0x63')](_0x18ab7b,_0x34baf3[_0x9f81('0x7e')][_0x35108][_0x9f81('0x32')])&&_0x34baf3[_0x9f81('0x7e')][_0x35108][_0x9f81('0x80')]&&_0x34baf3[_0x9f81('0x7e')][_0x35108][_0x9f81('0x82')]&&_0x34baf3[_0x9f81('0x7e')][_0x35108][_0x9f81('0x81')]){_0x40aea1[_0x34baf3['joins'][_0x35108][_0x9f81('0x32')]](_0x34baf3[_0x9f81('0x7e')][_0x35108][_0x9f81('0x82')],null,util[_0x9f81('0x79')](_0x9f81('0x83'),_0x34baf3[_0x9f81('0x73')],_0x34baf3['joins'][_0x35108][_0x9f81('0x80')],_0x34baf3[_0x9f81('0x7e')][_0x35108][_0x9f81('0x82')],_0x34baf3['joins'][_0x35108][_0x9f81('0x81')]));}}}if(_0x34baf3[_0x9f81('0x84')]){_0x34baf3[_0x9f81('0x84')]=JSON[_0x9f81('0x7f')](_0x34baf3['conditions']);_0x40aea1['where'](_0xf3ae3b(_0x34baf3[_0x9f81('0x84')][_0x9f81('0x68')]));}_0x4649f0=_0x40aea1[_0x9f81('0x85')]();_0x40aea1[_0x9f81('0x1d')](_0x24ffd6);_0x40aea1[_0x9f81('0x1f')](0x0);return;}})[_0x9f81('0x25')](function(){if(_0xd44535['output']===_0x9f81('0x92')){return null;}var _0x20316e=_['merge'](_0xd44535,{'name':_0xd44535[_0x9f81('0x93')]||_0xd44535['name']||_0x34baf3[_0x9f81('0x2c')],'basename':_0x37a59b,'savename':util[_0x9f81('0x79')](_0x9f81('0x94'),_0xd44535['name']||_0x34baf3['name'],require(_0x9f81('0x95'))[_0x9f81('0x96')](0x4),_0xd44535[_0x9f81('0x97')]||_0x9f81('0x98')),'reportId':_0x34baf3['id'],'reportType':'custom'});return db[_0x9f81('0x99')][_0x9f81('0x4a')](_0x20316e,{'raw':!![]});})[_0x9f81('0x25')](function(_0xdcb871){if(_0x34baf3[_0x9f81('0x73')]===_0x9f81('0x9a')){_0x4649f0[_0x9f81('0x40')](_0x34baf3[_0x9f81('0x73')]+_0x9f81('0x9b'),_0xd44535['startDate'],_0xd44535['endDate']);}else{_0x4649f0['where'](_0x34baf3['table']+_0x9f81('0x9c'),_0xd44535[_0x9f81('0x9d')],_0xd44535[_0x9f81('0x9e')]);}if(_0xdcb871){logger[_0x9f81('0x9f')](_0x9f81('0xa0'),_0x4649f0[_0x9f81('0x88')]());require(_0x9f81('0xa1'))[_0x9f81('0xa2')](path['join'](__dirname,_0x9f81('0xa3'),_0xdcb871[_0x9f81('0x97')]),[_0xdcb871['id'],_0x4649f0['toString'](),path['join'](__dirname,_0x9f81('0xa4'),_0xdcb871[_0x9f81('0xa5')]),_0x37a59b]);return _0xdcb871;}else{var _0x4f04e3=squel[_0x9f81('0x71')]();_0x4f04e3[_0x9f81('0x72')]('('+_0x4649f0[_0x9f81('0x88')]()+')',_0x9f81('0xa6'));_0x4f04e3[_0x9f81('0x76')]('COUNT(*)',_0x9f81('0x1e'));_0x4649f0[_0x9f81('0x1d')](_0xd44535['limit']||_0x24ffd6);_0x4649f0[_0x9f81('0x1f')](_0xd44535[_0x9f81('0x1f')]||0x0);return dbH['sequelize']['query'](_0x4f04e3[_0x9f81('0x88')](),{'type':dbH['sequelize'][_0x9f81('0x8a')][_0x9f81('0x8b')]})['then'](function(_0x9577c7){if(!_0x9577c7[_0x9f81('0x3a')]){_0x49f01f=0x0;}else{_0x49f01f=_0x9577c7[0x0][_0x9f81('0x1e')]||0x0;}return dbH[_0x9f81('0x89')]['query'](_0x4649f0['toString'](),{'type':dbH[_0x9f81('0x89')][_0x9f81('0x8a')][_0x9f81('0x8b')]});})['then'](function(_0x53ae59){return{'rows':_0x53ae59||[],'count':_0x49f01f};});}});}exports[_0x9f81('0xa7')]=function(_0x14e8a7,_0x2fb6c3){return runReport(_0x14e8a7[_0x9f81('0x47')],_0x14e8a7[_0x9f81('0x34')],_0x14e8a7[_0x9f81('0x42')])[_0x9f81('0x25')](respondWithResult(_0x2fb6c3,null))[_0x9f81('0x49')](handleError(_0x2fb6c3,null));};exports[_0x9f81('0xa8')]=runReport;exports['query']=function(_0x3a505d,_0x65855b){var _0x3af989=0xa;var _0x57f6a8=[_0x9f81('0x55'),_0x9f81('0x56'),'right_join','cross_join'];var _0x239dd3={'SUM':_0x9f81('0x59'),'COUNT':_0x9f81('0x5a'),'COUNT DISTINCT':_0x9f81('0x8c'),'MAX':_0x9f81('0x5b'),'MIN':_0x9f81('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x9f81('0x5e'),'GROUP_CONCAT ASC':_0x9f81('0x8d'),'GROUP_CONCAT DESC':_0x9f81('0x5f')};var _0x2361ff={'SEC_TO_TIME':_0x9f81('0x60'),'DATE':'DATE(%s)','HOUR':_0x9f81('0x62'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x9f81('0x8e')};var _0x5b34d1=function(_0x351b8c){return!_[_0x9f81('0x63')](['IS\x20NULL',_0x9f81('0x65'),_0x9f81('0x66'),'IS\x20NOT\x20EMPTY'],_0x351b8c);};var _0x2f0086=function(_0x25af5c){if(!_0x25af5c||!_0x25af5c['rules'][_0x9f81('0x3a')]){return'';}for(var _0x33b085='(',_0xe9a9c6=0x0;_0xe9a9c6<_0x25af5c[_0x9f81('0x67')][_0x9f81('0x3a')];_0xe9a9c6+=0x1){_0xe9a9c6>0x0&&(_0x33b085+='\x20'+_0x25af5c['operator']+'\x20');_0x33b085+=_0x25af5c[_0x9f81('0x67')][_0xe9a9c6][_0x9f81('0x68')]?_0x2f0086(_0x25af5c['rules'][_0xe9a9c6][_0x9f81('0x68')]):_0x25af5c['rules'][_0xe9a9c6]['field']+'\x20'+_0x25af5c[_0x9f81('0x67')][_0xe9a9c6]['condition']+(_0x5b34d1(_0x25af5c['rules'][_0xe9a9c6][_0x9f81('0x69')])?'\x20'+_0x25af5c['rules'][_0xe9a9c6][_0x9f81('0x6a')]:'');}return _0x33b085+')';};var _0x7830f1={'where':{'id':_0x3a505d['params']['id']}},_0x58d1d6,_0x1bd746,_0x4ee575,_0x8232e4,_0x2c2e95;_0x7830f1=_['merge']({},_0x7830f1,_0x3a505d[_0x9f81('0x42')]);return db[_0x9f81('0x30')][_0x9f81('0x91')](_0x7830f1)[_0x9f81('0x25')](function(_0x25fdfb){if(_0x25fdfb){_0x58d1d6=_0x25fdfb;return _0x25fdfb[_0x9f81('0x6b')]();}return null;})[_0x9f81('0x25')](function(_0x43dbd4){if(_0x43dbd4){if(!_0x43dbd4[_0x9f81('0x3a')]){throw new db[(_0x9f81('0x6c'))][(_0x9f81('0x6d'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x1bd746=_0x43dbd4;return db['AnalyticMetric'][_0x9f81('0x6f')]({'raw':!![]});}return null;})[_0x9f81('0x25')](function(_0x4579e3){if(_0x4579e3){_0x4ee575=_[_0x9f81('0x70')](_0x4579e3,'id');var _0x1f79f9;var _0x35a466=squel[_0x9f81('0x71')]();_0x35a466[_0x9f81('0x72')](_0x58d1d6[_0x9f81('0x73')]);for(var _0x5c39ed=0x0;_0x5c39ed<_0x1bd746[_0x9f81('0x3a')];_0x5c39ed+=0x1){_0x1f79f9=_0x1bd746[_0x5c39ed]['MetricId']?_0x4ee575[_0x1bd746[_0x5c39ed]['MetricId']]['metric']:_0x1bd746[_0x5c39ed][_0x9f81('0x76')];_0x1f79f9=_0x1bd746[_0x5c39ed][_0x9f81('0x77')]?_[_0x9f81('0x78')](_0x239dd3[_0x1bd746[_0x5c39ed][_0x9f81('0x77')]],'%s',_0x1f79f9):_0x1f79f9;_0x1f79f9=_0x1bd746[_0x5c39ed][_0x9f81('0x79')]?_['replace'](_0x2361ff[_0x1bd746[_0x5c39ed][_0x9f81('0x79')]],'%s',_0x1f79f9):_0x1f79f9;if(_0x1bd746[_0x5c39ed]['groupBy']){_0x35a466[_0x9f81('0x68')](_0x1f79f9);}_0x1bd746[_0x5c39ed][_0x9f81('0x7b')]&&_0x35a466[_0x9f81('0x3d')](_0x1f79f9,_0x1bd746[_0x5c39ed]['orderBy']===_0x9f81('0x7c')?![]:!![]);_0x35a466[_0x9f81('0x76')](_0x1f79f9,_0x1bd746[_0x5c39ed][_0x9f81('0x7d')]||_0x1f79f9);}if(_0x58d1d6[_0x9f81('0x7e')]){_0x58d1d6['joins']=JSON[_0x9f81('0x7f')](_0x58d1d6[_0x9f81('0x7e')]);for(var _0x249b03=0x0;_0x249b03<_0x58d1d6[_0x9f81('0x7e')]['length'];_0x249b03+=0x1){if(_0x58d1d6[_0x9f81('0x7e')][_0x249b03][_0x9f81('0x32')]&&_[_0x9f81('0x63')](_0x57f6a8,_0x58d1d6[_0x9f81('0x7e')][_0x249b03][_0x9f81('0x32')])&&_0x58d1d6['joins'][_0x249b03]['parentKey']&&_0x58d1d6[_0x9f81('0x7e')][_0x249b03][_0x9f81('0x82')]&&_0x58d1d6[_0x9f81('0x7e')][_0x249b03][_0x9f81('0x81')]){_0x35a466[_0x58d1d6['joins'][_0x249b03][_0x9f81('0x32')]](_0x58d1d6['joins'][_0x249b03][_0x9f81('0x82')],null,util[_0x9f81('0x79')](_0x9f81('0x83'),_0x58d1d6['table'],_0x58d1d6[_0x9f81('0x7e')][_0x249b03]['parentKey'],_0x58d1d6[_0x9f81('0x7e')][_0x249b03][_0x9f81('0x82')],_0x58d1d6['joins'][_0x249b03]['foreignKey']));}}}if(_0x58d1d6[_0x9f81('0x84')]){_0x58d1d6[_0x9f81('0x84')]=JSON[_0x9f81('0x7f')](_0x58d1d6[_0x9f81('0x84')]);_0x35a466[_0x9f81('0x40')](_0x2f0086(_0x58d1d6[_0x9f81('0x84')][_0x9f81('0x68')]));}_0x2c2e95=_0x35a466['clone']();_0x35a466['limit'](_0x3af989);_0x35a466[_0x9f81('0x1f')](0x0);logger['debug'](_0x9f81('0x87'),_0x35a466['toString']());return dbH[_0x9f81('0x89')][_0x9f81('0x34')](_0x35a466[_0x9f81('0x88')](),{'type':dbH[_0x9f81('0x89')][_0x9f81('0x8a')]['SELECT']});}})[_0x9f81('0x25')](function(){return{'sql':_0x2c2e95['toString']()};})[_0x9f81('0x25')](respondWithResult(_0x65855b,null))['catch'](handleError(_0x65855b,null));}; \ No newline at end of file +var _0x62ba=['limit','count','status','set','Content-Range','update','then','destroy','get','UserProfileResource','sendStatus','error','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','length','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','fields','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Reports','UserProfileSection','userProfileId','autoAssociation','CustomReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','params','join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%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)','HOUR(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','select','from','table','MetricId','metric','function','format','replace','groupBy','orderBy','joins','includes','parentKey','foreignKey','foreignTable','parse','clone','debug','sequelize','toString','QueryTypes','MIN(%s)','AVG(%s)','IS\x20NOT\x20EMPTY','operator','AnalyticMetric','DESC','alias','%s.%s\x20=\x20%s.%s','conditions','web','%s-%s.%s','randomstring','output','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','fork','../../components/export/','../../files/reports','countTable','COUNT(*)','SELECT','run','runReport','left_join','ROUND(%s)','keyBy','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','json','offset','undefined'];(function(_0x5eb593,_0x43c687){var _0x237928=function(_0x2816fc){while(--_0x2816fc){_0x5eb593['push'](_0x5eb593['shift']());}};_0x237928(++_0x43c687);}(_0x62ba,0x1cd));var _0xa62b=function(_0x4767b2,_0x58d23f){_0x4767b2=_0x4767b2-0x0;var _0x485ba0=_0x62ba[_0x4767b2];return _0x485ba0;};'use strict';var emlformat=require(_0xa62b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa62b('0x1'));var jsonpatch=require(_0xa62b('0x2'));var rp=require(_0xa62b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa62b('0x4'));var util=require(_0xa62b('0x5'));var path=require('path');var sox=require(_0xa62b('0x6'));var csv=require(_0xa62b('0x7'));var ejs=require(_0xa62b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa62b('0x9'));var squel=require(_0xa62b('0xa'));var crypto=require(_0xa62b('0xb'));var jsforce=require(_0xa62b('0xc'));var deskjs=require(_0xa62b('0xd'));var toCsv=require(_0xa62b('0x7'));var querystring=require(_0xa62b('0xe'));var Papa=require('papaparse');var Redis=require(_0xa62b('0xf'));var authService=require(_0xa62b('0x10'));var qs=require(_0xa62b('0x11'));var as=require(_0xa62b('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa62b('0x13'))('api');var utils=require(_0xa62b('0x14'));var config=require(_0xa62b('0x15'));var licenseUtil=require(_0xa62b('0x16'));var db=require('../../mysqldb')['db'];var dbH=require(_0xa62b('0x17'))['dbH'];function respondWithStatusCode(_0x16b16f,_0x5efe6c){_0x5efe6c=_0x5efe6c||0xcc;return function(_0x1e0f3a){if(_0x1e0f3a){return _0x16b16f['sendStatus'](_0x5efe6c);}return _0x16b16f['status'](_0x5efe6c)[_0xa62b('0x18')]();};}function respondWithResult(_0x580c87,_0x57ea7f){_0x57ea7f=_0x57ea7f||0xc8;return function(_0x3c61b5){if(_0x3c61b5){return _0x580c87['status'](_0x57ea7f)[_0xa62b('0x19')](_0x3c61b5);}};}function respondWithFilteredResult(_0x50e164,_0x5e2c98){return function(_0x40adcf){if(_0x40adcf){var _0x529405=typeof _0x5e2c98[_0xa62b('0x1a')]===_0xa62b('0x1b')&&typeof _0x5e2c98[_0xa62b('0x1c')]==='undefined';var _0xe01f06=_0x40adcf[_0xa62b('0x1d')];var _0x30a267=_0x529405?0x0:_0x5e2c98[_0xa62b('0x1a')];var _0x18b769=_0x529405?_0x40adcf[_0xa62b('0x1d')]:_0x5e2c98[_0xa62b('0x1a')]+_0x5e2c98[_0xa62b('0x1c')];var _0x5cc198;if(_0x18b769>=_0xe01f06){_0x18b769=_0xe01f06;_0x5cc198=0xc8;}else{_0x5cc198=0xce;}_0x50e164[_0xa62b('0x1e')](_0x5cc198);return _0x50e164[_0xa62b('0x1f')](_0xa62b('0x20'),_0x30a267+'-'+_0x18b769+'/'+_0xe01f06)['json'](_0x40adcf);}return null;};}function patchUpdates(_0x1c4e1f){return function(_0x5c47c9){try{jsonpatch['apply'](_0x5c47c9,_0x1c4e1f,!![]);}catch(_0x37dc69){return BPromise['reject'](_0x37dc69);}return _0x5c47c9['save']();};}function saveUpdates(_0x327851,_0x169ca3){return function(_0x238487){if(_0x238487){return _0x238487[_0xa62b('0x21')](_0x327851)[_0xa62b('0x22')](function(_0xb48827){return _0xb48827;});}return null;};}function removeEntity(_0x6aa24a,_0x42a4b4){return function(_0x3e263b){if(_0x3e263b){return _0x3e263b[_0xa62b('0x23')]()['then'](function(){var _0x4d57a5=_0x3e263b[_0xa62b('0x24')]({'plain':!![]});var _0x20a323='CustomReports';return db[_0xa62b('0x25')]['destroy']({'where':{'type':_0x20a323,'resourceId':_0x4d57a5['id']}})[_0xa62b('0x22')](function(){return _0x3e263b;});})[_0xa62b('0x22')](function(){_0x6aa24a[_0xa62b('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d86a0,_0x25f2f5){return function(_0x133857){if(!_0x133857){_0x3d86a0[_0xa62b('0x26')](0x194);}return _0x133857;};}function handleError(_0x5c6b2c,_0x571304){_0x571304=_0x571304||0x1f4;return function(_0x2c1915){logger[_0xa62b('0x27')](_0x2c1915['stack']);if(_0x2c1915[_0xa62b('0x28')]){delete _0x2c1915[_0xa62b('0x28')];}_0x5c6b2c[_0xa62b('0x1e')](_0x571304)[_0xa62b('0x29')](_0x2c1915);};}exports[_0xa62b('0x2a')]=function(_0x1622de,_0x1b5753){var _0x5dfc33={},_0x14de0e={},_0x1a14d3={'count':0x0,'rows':[]};var _0x4f01cf=_[_0xa62b('0x2b')](db[_0xa62b('0x2c')][_0xa62b('0x2d')],function(_0x39ee64){return{'name':_0x39ee64[_0xa62b('0x2e')],'type':_0x39ee64[_0xa62b('0x2f')][_0xa62b('0x30')]};});_0x14de0e[_0xa62b('0x31')]=_[_0xa62b('0x2b')](_0x4f01cf,'name');_0x14de0e['query']=_[_0xa62b('0x32')](_0x1622de['query']);_0x14de0e[_0xa62b('0x33')]=_[_0xa62b('0x34')](_0x14de0e[_0xa62b('0x31')],_0x14de0e[_0xa62b('0x35')]);_0x5dfc33[_0xa62b('0x36')]=_[_0xa62b('0x34')](_0x14de0e[_0xa62b('0x31')],qs['fields'](_0x1622de[_0xa62b('0x35')]['fields']));_0x5dfc33[_0xa62b('0x36')]=_0x5dfc33['attributes'][_0xa62b('0x37')]?_0x5dfc33[_0xa62b('0x36')]:_0x14de0e[_0xa62b('0x31')];if(!_0x1622de[_0xa62b('0x35')]['hasOwnProperty'](_0xa62b('0x38'))){_0x5dfc33['limit']=qs[_0xa62b('0x1c')](_0x1622de[_0xa62b('0x35')]['limit']);_0x5dfc33[_0xa62b('0x1a')]=qs[_0xa62b('0x1a')](_0x1622de[_0xa62b('0x35')][_0xa62b('0x1a')]);}_0x5dfc33[_0xa62b('0x39')]=qs[_0xa62b('0x3a')](_0x1622de[_0xa62b('0x35')]['sort']);_0x5dfc33['where']=qs[_0xa62b('0x33')](_[_0xa62b('0x3b')](_0x1622de[_0xa62b('0x35')],_0x14de0e[_0xa62b('0x33')]),_0x4f01cf);if(_0x1622de[_0xa62b('0x35')]['filter']){_0x5dfc33[_0xa62b('0x3c')]=_[_0xa62b('0x3d')](_0x5dfc33[_0xa62b('0x3c')],{'$or':_[_0xa62b('0x2b')](_0x4f01cf,function(_0x5d3af9){if(_0x5d3af9[_0xa62b('0x2f')]!==_0xa62b('0x3e')){var _0x181120={};_0x181120[_0x5d3af9[_0xa62b('0x28')]]={'$like':'%'+_0x1622de[_0xa62b('0x35')][_0xa62b('0x3f')]+'%'};return _0x181120;}})});}_0x5dfc33=_[_0xa62b('0x3d')]({},_0x5dfc33,_0x1622de[_0xa62b('0x40')]);var _0x23b99f={'where':_0x5dfc33[_0xa62b('0x3c')]};return db['AnalyticCustomReport'][_0xa62b('0x1d')](_0x23b99f)[_0xa62b('0x22')](function(_0x1b7ce1){_0x1a14d3['count']=_0x1b7ce1;if(_0x1622de[_0xa62b('0x35')][_0xa62b('0x41')]){_0x5dfc33[_0xa62b('0x42')]=[{'all':!![]}];}return db[_0xa62b('0x2c')][_0xa62b('0x43')](_0x5dfc33);})[_0xa62b('0x22')](function(_0x45ddc2){_0x1a14d3[_0xa62b('0x44')]=_0x45ddc2;return _0x1a14d3;})[_0xa62b('0x22')](respondWithFilteredResult(_0x1b5753,_0x5dfc33))['catch'](handleError(_0x1b5753,null));};exports['show']=function(_0x28b95d,_0x32ddd6){var _0x2fdac2={'raw':![],'where':{'id':_0x28b95d['params']['id']}},_0x21d184={};_0x21d184[_0xa62b('0x31')]=_[_0xa62b('0x32')](db[_0xa62b('0x2c')][_0xa62b('0x2d')]);_0x21d184['query']=_[_0xa62b('0x32')](_0x28b95d[_0xa62b('0x35')]);_0x21d184[_0xa62b('0x33')]=_[_0xa62b('0x34')](_0x21d184[_0xa62b('0x31')],_0x21d184['query']);_0x2fdac2[_0xa62b('0x36')]=_[_0xa62b('0x34')](_0x21d184['model'],qs[_0xa62b('0x45')](_0x28b95d[_0xa62b('0x35')][_0xa62b('0x45')]));_0x2fdac2[_0xa62b('0x36')]=_0x2fdac2[_0xa62b('0x36')]['length']?_0x2fdac2[_0xa62b('0x36')]:_0x21d184['model'];if(_0x28b95d[_0xa62b('0x35')]['includeAll']){_0x2fdac2[_0xa62b('0x42')]=[{'all':!![]}];}_0x2fdac2=_['merge']({},_0x2fdac2,_0x28b95d[_0xa62b('0x40')]);return db[_0xa62b('0x2c')]['find'](_0x2fdac2)['then'](handleEntityNotFound(_0x32ddd6,null))['then'](respondWithResult(_0x32ddd6,null))[_0xa62b('0x46')](handleError(_0x32ddd6,null));};exports[_0xa62b('0x47')]=function(_0x1f8ad1,_0x20f05f){return db[_0xa62b('0x2c')][_0xa62b('0x47')](_0x1f8ad1['body'],{})[_0xa62b('0x22')](function(_0x27e8e0){var _0xfe364f=_0x1f8ad1['user'][_0xa62b('0x24')]({'plain':!![]});if(!_0xfe364f)throw new Error(_0xa62b('0x48'));if(_0xfe364f['role']===_0xa62b('0x49')){var _0x40942e=_0x27e8e0[_0xa62b('0x24')]({'plain':!![]});var _0x1d1481=_0xa62b('0x4a');return db[_0xa62b('0x4b')]['find']({'where':{'name':_0x1d1481,'userProfileId':_0xfe364f[_0xa62b('0x4c')]},'raw':!![]})[_0xa62b('0x22')](function(_0x3084be){if(_0x3084be&&_0x3084be[_0xa62b('0x4d')]===0x0){return db[_0xa62b('0x25')][_0xa62b('0x47')]({'name':_0x40942e[_0xa62b('0x28')],'resourceId':_0x40942e['id'],'type':_0xa62b('0x4e'),'sectionId':_0x3084be['id']},{})[_0xa62b('0x22')](function(){return _0x27e8e0;});}else{return _0x27e8e0;}})[_0xa62b('0x46')](function(_0x2e4bd5){logger['error'](_0xa62b('0x4f'),_0x2e4bd5);throw _0x2e4bd5;});}return _0x27e8e0;})[_0xa62b('0x22')](respondWithResult(_0x20f05f,0xc9))[_0xa62b('0x46')](handleError(_0x20f05f,null));};exports['update']=function(_0x547916,_0x521e86){if(_0x547916[_0xa62b('0x50')]['id']){delete _0x547916[_0xa62b('0x50')]['id'];}return db[_0xa62b('0x2c')][_0xa62b('0x51')]({'where':{'id':_0x547916[_0xa62b('0x52')]['id']}})[_0xa62b('0x22')](handleEntityNotFound(_0x521e86,null))['then'](saveUpdates(_0x547916[_0xa62b('0x50')],null))[_0xa62b('0x22')](respondWithResult(_0x521e86,null))[_0xa62b('0x46')](handleError(_0x521e86,null));};exports[_0xa62b('0x23')]=function(_0x2f993b,_0x3df75c){return db[_0xa62b('0x2c')][_0xa62b('0x51')]({'where':{'id':_0x2f993b['params']['id']}})[_0xa62b('0x22')](handleEntityNotFound(_0x3df75c,null))[_0xa62b('0x22')](removeEntity(_0x3df75c,null))[_0xa62b('0x46')](handleError(_0x3df75c,null));};exports['preview']=function(_0x2be91f,_0x40407c){var _0x38545d=0xa;var _0x58fd69=[_0xa62b('0x53'),'left_join',_0xa62b('0x54'),_0xa62b('0x55')];var _0x38dbda={'SUM':_0xa62b('0x56'),'COUNT':_0xa62b('0x57'),'COUNT DISTINCT':_0xa62b('0x58'),'MAX':_0xa62b('0x59'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xa62b('0x5a'),'GROUP_CONCAT ASC':_0xa62b('0x5b'),'GROUP_CONCAT DESC':_0xa62b('0x5c')};var _0xf1531c={'SEC_TO_TIME':_0xa62b('0x5d'),'DATE':_0xa62b('0x5e'),'HOUR':_0xa62b('0x5f'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xa62b('0x60')};var _0xa347ea=function(_0x33a181){return!_['includes']([_0xa62b('0x61'),_0xa62b('0x62'),_0xa62b('0x63'),'IS\x20NOT\x20EMPTY'],_0x33a181);};var _0x142f86=function(_0x5c401e){if(!_0x5c401e||!_0x5c401e['rules'][_0xa62b('0x37')]){return'';}for(var _0x31f14c='(',_0x4c1658=0x0;_0x4c1658<_0x5c401e[_0xa62b('0x64')][_0xa62b('0x37')];_0x4c1658+=0x1){_0x4c1658>0x0&&(_0x31f14c+='\x20'+_0x5c401e['operator']+'\x20');_0x31f14c+=_0x5c401e[_0xa62b('0x64')][_0x4c1658][_0xa62b('0x65')]?_0x142f86(_0x5c401e[_0xa62b('0x64')][_0x4c1658]['group']):_0x5c401e[_0xa62b('0x64')][_0x4c1658][_0xa62b('0x66')]+'\x20'+_0x5c401e[_0xa62b('0x64')][_0x4c1658][_0xa62b('0x67')]+(_0xa347ea(_0x5c401e[_0xa62b('0x64')][_0x4c1658][_0xa62b('0x67')])?'\x20'+_0x5c401e[_0xa62b('0x64')][_0x4c1658][_0xa62b('0x68')]:'');}return _0x31f14c+')';};var _0x13fc8b={'where':{'id':_0x2be91f[_0xa62b('0x52')]['id']}},_0x59555d,_0x1cc9fe,_0x558717,_0x43a1ae,_0x208037;_0x13fc8b=_[_0xa62b('0x3d')]({},_0x13fc8b,_0x2be91f[_0xa62b('0x40')]);return db['AnalyticCustomReport'][_0xa62b('0x51')](_0x13fc8b)[_0xa62b('0x22')](function(_0x3e02dd){if(_0x3e02dd){_0x59555d=_0x3e02dd;return _0x3e02dd[_0xa62b('0x69')]();}return null;})[_0xa62b('0x22')](function(_0x357fc2){if(_0x357fc2){if(!_0x357fc2['length']){throw new db[(_0xa62b('0x6a'))][(_0xa62b('0x6b'))](_0xa62b('0x6c'),0x193);}_0x1cc9fe=_0x357fc2;return db['AnalyticMetric'][_0xa62b('0x43')]({'raw':!![]});}return null;})[_0xa62b('0x22')](function(_0x282934){if(_0x282934){_0x558717=_['keyBy'](_0x282934,'id');var _0x266c79;var _0x4f360d=squel[_0xa62b('0x6d')]();_0x4f360d[_0xa62b('0x6e')](_0x59555d[_0xa62b('0x6f')]);for(var _0x2c60af=0x0;_0x2c60af<_0x1cc9fe[_0xa62b('0x37')];_0x2c60af+=0x1){_0x266c79=_0x1cc9fe[_0x2c60af]['MetricId']?_0x558717[_0x1cc9fe[_0x2c60af][_0xa62b('0x70')]][_0xa62b('0x71')]:_0x1cc9fe[_0x2c60af]['field'];_0x266c79=_0x1cc9fe[_0x2c60af]['function']?_['replace'](_0x38dbda[_0x1cc9fe[_0x2c60af][_0xa62b('0x72')]],'%s',_0x266c79):_0x266c79;_0x266c79=_0x1cc9fe[_0x2c60af][_0xa62b('0x73')]?_[_0xa62b('0x74')](_0xf1531c[_0x1cc9fe[_0x2c60af]['format']],'%s',_0x266c79):_0x266c79;if(_0x1cc9fe[_0x2c60af][_0xa62b('0x75')]){_0x4f360d[_0xa62b('0x65')](_0x266c79);}_0x1cc9fe[_0x2c60af][_0xa62b('0x76')]&&_0x4f360d[_0xa62b('0x39')](_0x266c79,_0x1cc9fe[_0x2c60af][_0xa62b('0x76')]==='DESC'?![]:!![]);_0x4f360d[_0xa62b('0x66')](_0x266c79,_0x1cc9fe[_0x2c60af]['alias']||_0x266c79);}if(_0x59555d['joins']){_0x59555d[_0xa62b('0x77')]=JSON['parse'](_0x59555d['joins']);for(var _0x43d1db=0x0;_0x43d1db<_0x59555d[_0xa62b('0x77')][_0xa62b('0x37')];_0x43d1db+=0x1){if(_0x59555d[_0xa62b('0x77')][_0x43d1db]['type']&&_[_0xa62b('0x78')](_0x58fd69,_0x59555d['joins'][_0x43d1db]['type'])&&_0x59555d[_0xa62b('0x77')][_0x43d1db][_0xa62b('0x79')]&&_0x59555d[_0xa62b('0x77')][_0x43d1db]['foreignTable']&&_0x59555d[_0xa62b('0x77')][_0x43d1db][_0xa62b('0x7a')]){_0x4f360d[_0x59555d[_0xa62b('0x77')][_0x43d1db][_0xa62b('0x2f')]](_0x59555d[_0xa62b('0x77')][_0x43d1db][_0xa62b('0x7b')],null,util[_0xa62b('0x73')]('%s.%s\x20=\x20%s.%s',_0x59555d[_0xa62b('0x6f')],_0x59555d[_0xa62b('0x77')][_0x43d1db][_0xa62b('0x79')],_0x59555d[_0xa62b('0x77')][_0x43d1db]['foreignTable'],_0x59555d[_0xa62b('0x77')][_0x43d1db]['foreignKey']));}}}if(_0x59555d['conditions']){_0x59555d['conditions']=JSON[_0xa62b('0x7c')](_0x59555d['conditions']);_0x4f360d[_0xa62b('0x3c')](_0x142f86(_0x59555d['conditions'][_0xa62b('0x65')]));}_0x208037=_0x4f360d[_0xa62b('0x7d')]();_0x4f360d['limit'](_0x38545d);_0x4f360d['offset'](0x0);logger[_0xa62b('0x7e')]('Limited\x20Query:',_0x4f360d['toString']());return dbH[_0xa62b('0x7f')][_0xa62b('0x35')](_0x4f360d[_0xa62b('0x80')](),{'type':dbH[_0xa62b('0x7f')][_0xa62b('0x81')]['SELECT']});}})['then'](respondWithResult(_0x40407c,null))[_0xa62b('0x46')](handleError(_0x40407c,null));};function runReport(_0x53f0a8,_0xc2cc45,_0x4ba1dd){var _0x26435b=_0xc2cc45[_0xa62b('0x28')];var _0x4765fa=0xa;var _0x56eb1b=[_0xa62b('0x53'),'left_join',_0xa62b('0x54'),'cross_join'];var _0x4764f5={'SUM':'SUM(%s)','COUNT':_0xa62b('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xa62b('0x59'),'MIN':_0xa62b('0x82'),'AVG':_0xa62b('0x83'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xa62b('0x5c')};var _0x162d31={'SEC_TO_TIME':_0xa62b('0x5d'),'DATE':_0xa62b('0x5e'),'HOUR':_0xa62b('0x5f'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x51fef1=function(_0x501a3e){return!_[_0xa62b('0x78')]([_0xa62b('0x61'),_0xa62b('0x62'),'IS\x20EMPTY',_0xa62b('0x84')],_0x501a3e);};var _0x4c78ac=function(_0x57ede7){if(!_0x57ede7||!_0x57ede7[_0xa62b('0x64')][_0xa62b('0x37')]){return'';}for(var _0xb3855f='(',_0x4b9e0e=0x0;_0x4b9e0e<_0x57ede7[_0xa62b('0x64')][_0xa62b('0x37')];_0x4b9e0e+=0x1){_0x4b9e0e>0x0&&(_0xb3855f+='\x20'+_0x57ede7[_0xa62b('0x85')]+'\x20');_0xb3855f+=_0x57ede7[_0xa62b('0x64')][_0x4b9e0e][_0xa62b('0x65')]?_0x4c78ac(_0x57ede7['rules'][_0x4b9e0e][_0xa62b('0x65')]):_0x57ede7[_0xa62b('0x64')][_0x4b9e0e]['field']+'\x20'+_0x57ede7[_0xa62b('0x64')][_0x4b9e0e]['condition']+(_0x51fef1(_0x57ede7[_0xa62b('0x64')][_0x4b9e0e][_0xa62b('0x67')])?'\x20'+_0x57ede7['rules'][_0x4b9e0e][_0xa62b('0x68')]:'');}return _0xb3855f+')';};var _0x3fc3f7={'where':{'id':_0x53f0a8['id']}},_0x31e997,_0x265ab2,_0x57a229,_0x17a620,_0x125fca;_0x3fc3f7=_[_0xa62b('0x3d')]({},_0x3fc3f7,_0x4ba1dd);return db[_0xa62b('0x2c')][_0xa62b('0x51')](_0x3fc3f7)[_0xa62b('0x22')](function(_0x5e1fac){if(_0x5e1fac){_0x31e997=_0x5e1fac;return _0x5e1fac[_0xa62b('0x69')]();}return null;})[_0xa62b('0x22')](function(_0x570291){if(_0x570291){if(!_0x570291['length']){throw new db[(_0xa62b('0x6a'))][(_0xa62b('0x6b'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x265ab2=_0x570291;return db[_0xa62b('0x86')][_0xa62b('0x43')]({'raw':!![]});}return null;})['then'](function(_0x61f3ee){if(_0x61f3ee){_0x57a229=_['keyBy'](_0x61f3ee,'id');var _0x28cb75;var _0x5650b0=squel[_0xa62b('0x6d')]();_0x5650b0[_0xa62b('0x6e')](_0x31e997[_0xa62b('0x6f')]);for(var _0x2db5f5=0x0;_0x2db5f5<_0x265ab2[_0xa62b('0x37')];_0x2db5f5+=0x1){_0x28cb75=_0x265ab2[_0x2db5f5][_0xa62b('0x70')]?_0x57a229[_0x265ab2[_0x2db5f5][_0xa62b('0x70')]][_0xa62b('0x71')]:_0x265ab2[_0x2db5f5]['field'];_0x28cb75=_0x265ab2[_0x2db5f5][_0xa62b('0x72')]?_[_0xa62b('0x74')](_0x4764f5[_0x265ab2[_0x2db5f5]['function']],'%s',_0x28cb75):_0x28cb75;_0x28cb75=_0x265ab2[_0x2db5f5][_0xa62b('0x73')]?_[_0xa62b('0x74')](_0x162d31[_0x265ab2[_0x2db5f5][_0xa62b('0x73')]],'%s',_0x28cb75):_0x28cb75;if(_0x265ab2[_0x2db5f5][_0xa62b('0x75')]){_0x5650b0[_0xa62b('0x65')](_0x28cb75);}_0x265ab2[_0x2db5f5][_0xa62b('0x76')]&&_0x5650b0[_0xa62b('0x39')](_0x28cb75,_0x265ab2[_0x2db5f5][_0xa62b('0x76')]===_0xa62b('0x87')?![]:!![]);_0x5650b0[_0xa62b('0x66')](_0x28cb75,_0x265ab2[_0x2db5f5][_0xa62b('0x88')]||_0x28cb75);}if(_0x31e997['joins']){_0x31e997[_0xa62b('0x77')]=JSON['parse'](_0x31e997[_0xa62b('0x77')]);for(var _0x1e46d0=0x0;_0x1e46d0<_0x31e997[_0xa62b('0x77')][_0xa62b('0x37')];_0x1e46d0+=0x1){if(_0x31e997['joins'][_0x1e46d0][_0xa62b('0x2f')]&&_[_0xa62b('0x78')](_0x56eb1b,_0x31e997[_0xa62b('0x77')][_0x1e46d0][_0xa62b('0x2f')])&&_0x31e997[_0xa62b('0x77')][_0x1e46d0][_0xa62b('0x79')]&&_0x31e997[_0xa62b('0x77')][_0x1e46d0][_0xa62b('0x7b')]&&_0x31e997[_0xa62b('0x77')][_0x1e46d0][_0xa62b('0x7a')]){_0x5650b0[_0x31e997[_0xa62b('0x77')][_0x1e46d0][_0xa62b('0x2f')]](_0x31e997[_0xa62b('0x77')][_0x1e46d0][_0xa62b('0x7b')],null,util['format'](_0xa62b('0x89'),_0x31e997[_0xa62b('0x6f')],_0x31e997[_0xa62b('0x77')][_0x1e46d0][_0xa62b('0x79')],_0x31e997[_0xa62b('0x77')][_0x1e46d0][_0xa62b('0x7b')],_0x31e997['joins'][_0x1e46d0][_0xa62b('0x7a')]));}}}if(_0x31e997[_0xa62b('0x8a')]){_0x31e997[_0xa62b('0x8a')]=JSON[_0xa62b('0x7c')](_0x31e997[_0xa62b('0x8a')]);_0x5650b0[_0xa62b('0x3c')](_0x4c78ac(_0x31e997[_0xa62b('0x8a')][_0xa62b('0x65')]));}_0x125fca=_0x5650b0[_0xa62b('0x7d')]();_0x5650b0[_0xa62b('0x1c')](_0x4765fa);_0x5650b0['offset'](0x0);return;}})['then'](function(){if(_0xc2cc45['output']===_0xa62b('0x8b')){return null;}var _0x4e4d88=_[_0xa62b('0x3d')](_0xc2cc45,{'name':_0xc2cc45['fullPath']||_0xc2cc45[_0xa62b('0x28')]||_0x31e997[_0xa62b('0x28')],'basename':_0x26435b,'savename':util['format'](_0xa62b('0x8c'),_0xc2cc45[_0xa62b('0x28')]||_0x31e997[_0xa62b('0x28')],require(_0xa62b('0x8d'))['generate'](0x4),_0xc2cc45[_0xa62b('0x8e')]||_0xa62b('0x8f')),'reportId':_0x31e997['id'],'reportType':'custom'});return db[_0xa62b('0x90')]['create'](_0x4e4d88,{'raw':!![]});})[_0xa62b('0x22')](function(_0x586acc){if(_0x31e997[_0xa62b('0x6f')]===_0xa62b('0x91')){_0x125fca[_0xa62b('0x3c')](_0x31e997[_0xa62b('0x6f')]+_0xa62b('0x92'),_0xc2cc45[_0xa62b('0x93')],_0xc2cc45[_0xa62b('0x94')]);}else{_0x125fca[_0xa62b('0x3c')](_0x31e997[_0xa62b('0x6f')]+_0xa62b('0x95'),_0xc2cc45[_0xa62b('0x93')],_0xc2cc45[_0xa62b('0x94')]);}if(_0x586acc){logger[_0xa62b('0x96')](_0xa62b('0x97'),_0x125fca['toString']());require('child_process')[_0xa62b('0x98')](path[_0xa62b('0x53')](__dirname,_0xa62b('0x99'),_0x586acc[_0xa62b('0x8e')]),[_0x586acc['id'],_0x125fca[_0xa62b('0x80')](),path['join'](__dirname,_0xa62b('0x9a'),_0x586acc['savename']),_0x26435b]);return _0x586acc;}else{var _0x2cd77b=squel['select']();_0x2cd77b['from']('('+_0x125fca[_0xa62b('0x80')]()+')',_0xa62b('0x9b'));_0x2cd77b[_0xa62b('0x66')](_0xa62b('0x9c'),_0xa62b('0x1d'));_0x125fca[_0xa62b('0x1c')](_0xc2cc45[_0xa62b('0x1c')]||_0x4765fa);_0x125fca['offset'](_0xc2cc45[_0xa62b('0x1a')]||0x0);return dbH[_0xa62b('0x7f')][_0xa62b('0x35')](_0x2cd77b[_0xa62b('0x80')](),{'type':dbH[_0xa62b('0x7f')]['QueryTypes']['SELECT']})['then'](function(_0x354bd2){if(!_0x354bd2[_0xa62b('0x37')]){_0x17a620=0x0;}else{_0x17a620=_0x354bd2[0x0][_0xa62b('0x1d')]||0x0;}return dbH['sequelize']['query'](_0x125fca[_0xa62b('0x80')](),{'type':dbH[_0xa62b('0x7f')][_0xa62b('0x81')][_0xa62b('0x9d')]});})[_0xa62b('0x22')](function(_0x148d95){return{'rows':_0x148d95||[],'count':_0x17a620};});}});}exports[_0xa62b('0x9e')]=function(_0x117647,_0x42af89){return runReport(_0x117647[_0xa62b('0x52')],_0x117647['query'],_0x117647['options'])[_0xa62b('0x22')](respondWithResult(_0x42af89,null))['catch'](handleError(_0x42af89,null));};exports[_0xa62b('0x9f')]=runReport;exports[_0xa62b('0x35')]=function(_0x2e01d7,_0x22feb4){var _0x247045=0xa;var _0x32d9ac=[_0xa62b('0x53'),_0xa62b('0xa0'),_0xa62b('0x54'),_0xa62b('0x55')];var _0x35d1d0={'SUM':_0xa62b('0x56'),'COUNT':_0xa62b('0x57'),'COUNT DISTINCT':_0xa62b('0x58'),'MAX':_0xa62b('0x59'),'MIN':_0xa62b('0x82'),'AVG':_0xa62b('0x83'),'GROUP_CONCAT':_0xa62b('0x5a'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xa62b('0x5c')};var _0x226c56={'SEC_TO_TIME':_0xa62b('0x5d'),'DATE':_0xa62b('0x5e'),'HOUR':_0xa62b('0x5f'),'ROUND':_0xa62b('0xa1'),'UNIX_TIMESTAMP':_0xa62b('0x60')};var _0x54cfc2=function(_0x17f834){return!_['includes']([_0xa62b('0x61'),_0xa62b('0x62'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x17f834);};var _0x12385b=function(_0x4037e5){if(!_0x4037e5||!_0x4037e5[_0xa62b('0x64')][_0xa62b('0x37')]){return'';}for(var _0x5680d6='(',_0x4f7c61=0x0;_0x4f7c61<_0x4037e5[_0xa62b('0x64')][_0xa62b('0x37')];_0x4f7c61+=0x1){_0x4f7c61>0x0&&(_0x5680d6+='\x20'+_0x4037e5['operator']+'\x20');_0x5680d6+=_0x4037e5['rules'][_0x4f7c61][_0xa62b('0x65')]?_0x12385b(_0x4037e5[_0xa62b('0x64')][_0x4f7c61][_0xa62b('0x65')]):_0x4037e5[_0xa62b('0x64')][_0x4f7c61][_0xa62b('0x66')]+'\x20'+_0x4037e5[_0xa62b('0x64')][_0x4f7c61]['condition']+(_0x54cfc2(_0x4037e5[_0xa62b('0x64')][_0x4f7c61][_0xa62b('0x67')])?'\x20'+_0x4037e5[_0xa62b('0x64')][_0x4f7c61]['value']:'');}return _0x5680d6+')';};var _0x4b3294={'where':{'id':_0x2e01d7[_0xa62b('0x52')]['id']}},_0x580779,_0x4d2911,_0x145443,_0xc5abea,_0x3db3b3;_0x4b3294=_['merge']({},_0x4b3294,_0x2e01d7['options']);return db[_0xa62b('0x2c')][_0xa62b('0x51')](_0x4b3294)[_0xa62b('0x22')](function(_0x4a9118){if(_0x4a9118){_0x580779=_0x4a9118;return _0x4a9118[_0xa62b('0x69')]();}return null;})['then'](function(_0x12fae){if(_0x12fae){if(!_0x12fae[_0xa62b('0x37')]){throw new db[(_0xa62b('0x6a'))]['ValidationErrorItem'](_0xa62b('0x6c'),0x193);}_0x4d2911=_0x12fae;return db[_0xa62b('0x86')][_0xa62b('0x43')]({'raw':!![]});}return null;})['then'](function(_0x126859){if(_0x126859){_0x145443=_[_0xa62b('0xa2')](_0x126859,'id');var _0x12873d;var _0xb4f985=squel[_0xa62b('0x6d')]();_0xb4f985[_0xa62b('0x6e')](_0x580779[_0xa62b('0x6f')]);for(var _0x28e0dd=0x0;_0x28e0dd<_0x4d2911[_0xa62b('0x37')];_0x28e0dd+=0x1){_0x12873d=_0x4d2911[_0x28e0dd][_0xa62b('0x70')]?_0x145443[_0x4d2911[_0x28e0dd][_0xa62b('0x70')]][_0xa62b('0x71')]:_0x4d2911[_0x28e0dd][_0xa62b('0x66')];_0x12873d=_0x4d2911[_0x28e0dd][_0xa62b('0x72')]?_[_0xa62b('0x74')](_0x35d1d0[_0x4d2911[_0x28e0dd][_0xa62b('0x72')]],'%s',_0x12873d):_0x12873d;_0x12873d=_0x4d2911[_0x28e0dd][_0xa62b('0x73')]?_[_0xa62b('0x74')](_0x226c56[_0x4d2911[_0x28e0dd][_0xa62b('0x73')]],'%s',_0x12873d):_0x12873d;if(_0x4d2911[_0x28e0dd][_0xa62b('0x75')]){_0xb4f985[_0xa62b('0x65')](_0x12873d);}_0x4d2911[_0x28e0dd][_0xa62b('0x76')]&&_0xb4f985[_0xa62b('0x39')](_0x12873d,_0x4d2911[_0x28e0dd]['orderBy']===_0xa62b('0x87')?![]:!![]);_0xb4f985[_0xa62b('0x66')](_0x12873d,_0x4d2911[_0x28e0dd][_0xa62b('0x88')]||_0x12873d);}if(_0x580779['joins']){_0x580779['joins']=JSON[_0xa62b('0x7c')](_0x580779[_0xa62b('0x77')]);for(var _0x4b87b3=0x0;_0x4b87b3<_0x580779['joins'][_0xa62b('0x37')];_0x4b87b3+=0x1){if(_0x580779[_0xa62b('0x77')][_0x4b87b3]['type']&&_['includes'](_0x32d9ac,_0x580779[_0xa62b('0x77')][_0x4b87b3][_0xa62b('0x2f')])&&_0x580779['joins'][_0x4b87b3]['parentKey']&&_0x580779['joins'][_0x4b87b3][_0xa62b('0x7b')]&&_0x580779['joins'][_0x4b87b3][_0xa62b('0x7a')]){_0xb4f985[_0x580779['joins'][_0x4b87b3][_0xa62b('0x2f')]](_0x580779[_0xa62b('0x77')][_0x4b87b3][_0xa62b('0x7b')],null,util[_0xa62b('0x73')](_0xa62b('0x89'),_0x580779[_0xa62b('0x6f')],_0x580779['joins'][_0x4b87b3][_0xa62b('0x79')],_0x580779[_0xa62b('0x77')][_0x4b87b3]['foreignTable'],_0x580779['joins'][_0x4b87b3][_0xa62b('0x7a')]));}}}if(_0x580779['conditions']){_0x580779['conditions']=JSON[_0xa62b('0x7c')](_0x580779[_0xa62b('0x8a')]);_0xb4f985['where'](_0x12385b(_0x580779[_0xa62b('0x8a')][_0xa62b('0x65')]));}_0x3db3b3=_0xb4f985[_0xa62b('0x7d')]();_0xb4f985['limit'](_0x247045);_0xb4f985[_0xa62b('0x1a')](0x0);logger[_0xa62b('0x7e')]('Limited\x20Query:',_0xb4f985[_0xa62b('0x80')]());return dbH[_0xa62b('0x7f')][_0xa62b('0x35')](_0xb4f985['toString'](),{'type':dbH[_0xa62b('0x7f')][_0xa62b('0x81')][_0xa62b('0x9d')]});}})[_0xa62b('0x22')](function(){return{'sql':_0x3db3b3['toString']()};})[_0xa62b('0x22')](respondWithResult(_0x22feb4,null))[_0xa62b('0x46')](handleError(_0x22feb4,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index aae7242..93c1bb9 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 _0xaaab=['rimraf','../../config/environment','exports','define','AnalyticCustomReport','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x30ed3b,_0x4b2d6e){var _0x3a1347=function(_0x27ade3){while(--_0x27ade3){_0x30ed3b['push'](_0x30ed3b['shift']());}};_0x3a1347(++_0x4b2d6e);}(_0xaaab,0x171));var _0xbaaa=function(_0x1f44a3,_0x5c0c99){_0x1f44a3=_0x1f44a3-0x0;var _0x4e653e=_0xaaab[_0x1f44a3];return _0x4e653e;};'use strict';var _=require(_0xbaaa('0x0'));var util=require(_0xbaaa('0x1'));var logger=require(_0xbaaa('0x2'))(_0xbaaa('0x3'));var moment=require(_0xbaaa('0x4'));var BPromise=require(_0xbaaa('0x5'));var rp=require(_0xbaaa('0x6'));var fs=require('fs');var path=require(_0xbaaa('0x7'));var rimraf=require(_0xbaaa('0x8'));var config=require(_0xbaaa('0x9'));var attributes=require('./analyticCustomReport.attributes');module[_0xbaaa('0xa')]=function(_0x3a96c0,_0x431c50){return _0x3a96c0[_0xbaaa('0xb')](_0xbaaa('0xc'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3029=['path','rimraf','./analyticCustomReport.attributes','define','AnalyticCustomReport','lodash','util','../../config/logger','api','moment'];(function(_0x5431b1,_0x2ab234){var _0x5c1570=function(_0x1d6962){while(--_0x1d6962){_0x5431b1['push'](_0x5431b1['shift']());}};_0x5c1570(++_0x2ab234);}(_0x3029,0x13b));var _0x9302=function(_0x5dfee3,_0x5e3bbe){_0x5dfee3=_0x5dfee3-0x0;var _0x1e1785=_0x3029[_0x5dfee3];return _0x1e1785;};'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('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9302('0x5'));var rimraf=require(_0x9302('0x6'));var config=require('../../config/environment');var attributes=require(_0x9302('0x7'));module['exports']=function(_0x4b6726,_0x347f2b){return _0x4b6726[_0x9302('0x8')](_0x9302('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 d77b1b1..4003f9d 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 _0xf5bf=['http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client'];(function(_0x10a2ea,_0x487cf2){var _0x347b66=function(_0x592edb){while(--_0x592edb){_0x10a2ea['push'](_0x10a2ea['shift']());}};_0x347b66(++_0x487cf2);}(_0xf5bf,0x1db));var _0xff5b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf5bf[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xff5b('0x0'));var BPromise=require(_0xff5b('0x1'));var rs=require(_0xff5b('0x2'));var fs=require('fs');var Redis=require(_0xff5b('0x3'));var db=require(_0xff5b('0x4'))['db'];var utils=require(_0xff5b('0x5'));var logger=require('../../config/logger')(_0xff5b('0x6'));var config=require(_0xff5b('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xff5b('0x8')][_0xff5b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x162077,_0x1ff16f,_0x48fce3){return new BPromise(function(_0x13adf4,_0x3529ca){return client[_0xff5b('0xa')](_0x162077,_0x48fce3)[_0xff5b('0xb')](function(_0x5d3d4b){logger[_0xff5b('0xc')](_0xff5b('0xd'),_0x1ff16f,_0xff5b('0xe'));logger[_0xff5b('0xf')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x1ff16f,_0xff5b('0xe'),JSON[_0xff5b('0x10')](_0x5d3d4b));if(_0x5d3d4b[_0xff5b('0x11')]){if(_0x5d3d4b[_0xff5b('0x11')][_0xff5b('0x12')]===0x1f4){logger[_0xff5b('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x1ff16f,_0x5d3d4b[_0xff5b('0x11')][_0xff5b('0x13')]);return _0x3529ca(_0x5d3d4b[_0xff5b('0x11')]['message']);}logger[_0xff5b('0x11')](_0xff5b('0xd'),_0x1ff16f,_0x5d3d4b['error'][_0xff5b('0x13')]);return _0x13adf4(_0x5d3d4b['error'][_0xff5b('0x13')]);}else{logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x1ff16f,_0xff5b('0xe'));_0x13adf4(_0x5d3d4b[_0xff5b('0x14')][_0xff5b('0x13')]);}})[_0xff5b('0x15')](function(_0x182272){logger[_0xff5b('0x11')](_0xff5b('0xd'),_0x1ff16f,_0x182272);_0x3529ca(_0x182272);});});} \ No newline at end of file +var _0x9526=['AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','info'];(function(_0x343609,_0x452635){var _0x1c5221=function(_0x4fb227){while(--_0x4fb227){_0x343609['push'](_0x343609['shift']());}};_0x1c5221(++_0x452635);}(_0x9526,0x127));var _0x6952=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9526[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x6952('0x0'));var util=require(_0x6952('0x1'));var moment=require(_0x6952('0x2'));var BPromise=require('bluebird');var rs=require(_0x6952('0x3'));var fs=require('fs');var Redis=require(_0x6952('0x4'));var db=require(_0x6952('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6952('0x6'))(_0x6952('0x7'));var config=require(_0x6952('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6952('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x503551,_0x44fc27,_0x4327c7){return new BPromise(function(_0x4f4719,_0x58eb2a){return client[_0x6952('0xa')](_0x503551,_0x4327c7)[_0x6952('0xb')](function(_0xc0cdc8){logger[_0x6952('0xc')](_0x6952('0xd'),_0x44fc27,_0x6952('0xe'));logger[_0x6952('0xf')](_0x6952('0x10'),_0x44fc27,'request\x20sent',JSON[_0x6952('0x11')](_0xc0cdc8));if(_0xc0cdc8[_0x6952('0x12')]){if(_0xc0cdc8[_0x6952('0x12')][_0x6952('0x13')]===0x1f4){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x44fc27,_0xc0cdc8[_0x6952('0x12')][_0x6952('0x14')]);return _0x58eb2a(_0xc0cdc8[_0x6952('0x12')][_0x6952('0x14')]);}logger[_0x6952('0x12')](_0x6952('0xd'),_0x44fc27,_0xc0cdc8['error']['message']);return _0x4f4719(_0xc0cdc8[_0x6952('0x12')][_0x6952('0x14')]);}else{logger[_0x6952('0xc')](_0x6952('0xd'),_0x44fc27,_0x6952('0xe'));_0x4f4719(_0xc0cdc8[_0x6952('0x15')]['message']);}})['catch'](function(_0x564bdd){logger[_0x6952('0x12')](_0x6952('0xd'),_0x44fc27,_0x564bdd);_0x58eb2a(_0x564bdd);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index b85ef8b..440a8c5 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 _0x4ace=['../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','run','query','post','create','put','update','delete','destroy','multer','util','connect-timeout','express','Router'];(function(_0x363b63,_0x2b4dbc){var _0x145809=function(_0x10ed37){while(--_0x10ed37){_0x363b63['push'](_0x363b63['shift']());}};_0x145809(++_0x2b4dbc);}(_0x4ace,0x1a4));var _0xe4ac=function(_0xef9fc3,_0x1e461b){_0xef9fc3=_0xef9fc3-0x0;var _0x300391=_0x4ace[_0xef9fc3];return _0x300391;};'use strict';var multer=require(_0xe4ac('0x0'));var util=require(_0xe4ac('0x1'));var path=require('path');var timeout=require(_0xe4ac('0x2'));var express=require(_0xe4ac('0x3'));var router=express[_0xe4ac('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe4ac('0x5'));var interaction=require(_0xe4ac('0x6'));var config=require(_0xe4ac('0x7'));var controller=require(_0xe4ac('0x8'));router[_0xe4ac('0x9')]('/',auth[_0xe4ac('0xa')](),controller[_0xe4ac('0xb')]);router[_0xe4ac('0x9')](_0xe4ac('0xc'),auth[_0xe4ac('0xa')](),controller[_0xe4ac('0xd')]);router[_0xe4ac('0x9')](_0xe4ac('0xe'),auth[_0xe4ac('0xa')](),controller[_0xe4ac('0xf')]);router[_0xe4ac('0x9')](_0xe4ac('0x10'),auth[_0xe4ac('0xa')](),controller[_0xe4ac('0x11')]);router['get']('/:id/query',auth[_0xe4ac('0xa')](),controller[_0xe4ac('0x12')]);router[_0xe4ac('0x13')]('/',auth['isAuthenticated'](),controller[_0xe4ac('0x14')]);router[_0xe4ac('0x15')](_0xe4ac('0xc'),auth[_0xe4ac('0xa')](),controller[_0xe4ac('0x16')]);router[_0xe4ac('0x17')](_0xe4ac('0xc'),auth['isAuthenticated'](),controller[_0xe4ac('0x18')]);module['exports']=router; \ No newline at end of file +var _0x29ec=['../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x2ab48e,_0x5154f5){var _0x57db24=function(_0x454100){while(--_0x454100){_0x2ab48e['push'](_0x2ab48e['shift']());}};_0x57db24(++_0x5154f5);}(_0x29ec,0x1b4));var _0xc29e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x29ec[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xc29e('0x0'));var path=require(_0xc29e('0x1'));var timeout=require(_0xc29e('0x2'));var express=require(_0xc29e('0x3'));var router=express[_0xc29e('0x4')]();var fs_extra=require(_0xc29e('0x5'));var auth=require(_0xc29e('0x6'));var interaction=require(_0xc29e('0x7'));var config=require(_0xc29e('0x8'));var controller=require(_0xc29e('0x9'));router[_0xc29e('0xa')]('/',auth[_0xc29e('0xb')](),controller['index']);router[_0xc29e('0xa')]('/:id',auth[_0xc29e('0xb')](),controller[_0xc29e('0xc')]);router['get'](_0xc29e('0xd'),auth[_0xc29e('0xb')](),controller[_0xc29e('0xe')]);router['get'](_0xc29e('0xf'),auth[_0xc29e('0xb')](),controller[_0xc29e('0x10')]);router['get'](_0xc29e('0x11'),auth[_0xc29e('0xb')](),controller[_0xc29e('0x12')]);router[_0xc29e('0x13')]('/',auth[_0xc29e('0xb')](),controller[_0xc29e('0x14')]);router[_0xc29e('0x15')](_0xc29e('0x16'),auth[_0xc29e('0xb')](),controller[_0xc29e('0x17')]);router[_0xc29e('0x18')](_0xc29e('0x16'),auth[_0xc29e('0xb')](),controller['destroy']);module[_0xc29e('0x19')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index f2e4b31..7ca0142 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 _0xee14=['STRING','TEXT'];(function(_0x17fbde,_0x3ab873){var _0x455516=function(_0x3ace41){while(--_0x3ace41){_0x17fbde['push'](_0x17fbde['shift']());}};_0x455516(++_0x3ab873);}(_0xee14,0x13a));var _0x4ee1=function(_0x36eb56,_0xb61cc9){_0x36eb56=_0x36eb56-0x0;var _0x26bd7e=_0xee14[_0x36eb56];return _0x26bd7e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4ee1('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0x4ee1('0x0')]},'parent':{'type':Sequelize[_0x4ee1('0x0')]},'table':{'type':Sequelize[_0x4ee1('0x0')]},'conditions':{'type':Sequelize[_0x4ee1('0x1')]},'joins':{'type':Sequelize[_0x4ee1('0x1')]}}; \ No newline at end of file +var _0x2eb2=['TEXT','exports','STRING'];(function(_0x4186fa,_0x26a01c){var _0x136990=function(_0x13324f){while(--_0x13324f){_0x4186fa['push'](_0x4186fa['shift']());}};_0x136990(++_0x26a01c);}(_0x2eb2,0x19f));var _0x22eb=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0x2eb2[_0x5b78e8];return _0xf2c321;};'use strict';var Sequelize=require('sequelize');module[_0x22eb('0x0')]={'name':{'type':Sequelize[_0x22eb('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x22eb('0x1')]},'parent':{'type':Sequelize[_0x22eb('0x1')]},'table':{'type':Sequelize[_0x22eb('0x1')]},'conditions':{'type':Sequelize[_0x22eb('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 37965f5..dce2d97 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 _0x1261=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','offset','limit','undefined','set','json','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','error','name','index','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','count','include','findAll','rows','show','length','includeAll','options','find','catch','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','params','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignTable','foreignKey','conditions','parse','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','AVG(%s)','DATE(%s)','value','keyBy','select','order','%s.%s\x20=\x20%s.%s','clone','web','fullPath','randomstring','generate','output','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','Run\x20Query:','../../components/export/','savename','COUNT(*)','run','runReport','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','Sequelize','debug'];(function(_0x109468,_0x1a47a2){var _0x2dc299=function(_0x126e29){while(--_0x126e29){_0x109468['push'](_0x109468['shift']());}};_0x2dc299(++_0x1a47a2);}(_0x1261,0x144));var _0x1126=function(_0x3f52ee,_0x468aab){_0x3f52ee=_0x3f52ee-0x0;var _0x4f7924=_0x1261[_0x3f52ee];return _0x4f7924;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1126('0x0'));var zipdir=require(_0x1126('0x1'));var jsonpatch=require(_0x1126('0x2'));var rp=require(_0x1126('0x3'));var moment=require(_0x1126('0x4'));var BPromise=require(_0x1126('0x5'));var Mustache=require(_0x1126('0x6'));var util=require(_0x1126('0x7'));var path=require(_0x1126('0x8'));var sox=require(_0x1126('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1126('0xa'));var _=require(_0x1126('0xb'));var squel=require('squel');var crypto=require(_0x1126('0xc'));var jsforce=require(_0x1126('0xd'));var deskjs=require(_0x1126('0xe'));var toCsv=require(_0x1126('0xf'));var querystring=require(_0x1126('0x10'));var Papa=require('papaparse');var Redis=require(_0x1126('0x11'));var authService=require(_0x1126('0x12'));var qs=require(_0x1126('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1126('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x1126('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x1126('0x16'));var db=require(_0x1126('0x17'))['db'];var dbH=require(_0x1126('0x17'))[_0x1126('0x18')];function respondWithStatusCode(_0xca0355,_0x3f10e9){_0x3f10e9=_0x3f10e9||0xcc;return function(_0xd8ca42){if(_0xd8ca42){return _0xca0355[_0x1126('0x19')](_0x3f10e9);}return _0xca0355[_0x1126('0x1a')](_0x3f10e9)['end']();};}function respondWithResult(_0x5de9a7,_0x1af673){_0x1af673=_0x1af673||0xc8;return function(_0x154e20){if(_0x154e20){return _0x5de9a7[_0x1126('0x1a')](_0x1af673)['json'](_0x154e20);}};}function respondWithFilteredResult(_0x45149c,_0x4794a7){return function(_0x35fe9f){if(_0x35fe9f){var _0x42f379=typeof _0x4794a7[_0x1126('0x1b')]==='undefined'&&typeof _0x4794a7[_0x1126('0x1c')]===_0x1126('0x1d');var _0x4a7b49=_0x35fe9f['count'];var _0x22ae0b=_0x42f379?0x0:_0x4794a7[_0x1126('0x1b')];var _0x58d11a=_0x42f379?_0x35fe9f['count']:_0x4794a7[_0x1126('0x1b')]+_0x4794a7['limit'];var _0x22ed37;if(_0x58d11a>=_0x4a7b49){_0x58d11a=_0x4a7b49;_0x22ed37=0xc8;}else{_0x22ed37=0xce;}_0x45149c[_0x1126('0x1a')](_0x22ed37);return _0x45149c[_0x1126('0x1e')]('Content-Range',_0x22ae0b+'-'+_0x58d11a+'/'+_0x4a7b49)[_0x1126('0x1f')](_0x35fe9f);}return null;};}function patchUpdates(_0x49d209){return function(_0x56efeb){try{jsonpatch[_0x1126('0x20')](_0x56efeb,_0x49d209,!![]);}catch(_0x3a9bed){return BPromise[_0x1126('0x21')](_0x3a9bed);}return _0x56efeb[_0x1126('0x22')]();};}function saveUpdates(_0x526ca1,_0x29ab60){return function(_0x477e6a){if(_0x477e6a){return _0x477e6a['update'](_0x526ca1)[_0x1126('0x23')](function(_0x59cd8e){return _0x59cd8e;});}return null;};}function removeEntity(_0x529dd9,_0x4b57ab){return function(_0x2199d9){if(_0x2199d9){return _0x2199d9[_0x1126('0x24')]()[_0x1126('0x23')](function(){var _0x34bcf1=_0x2199d9[_0x1126('0x25')]({'plain':!![]});var _0x1b07a7=_0x1126('0x26');return db[_0x1126('0x27')]['destroy']({'where':{'type':_0x1b07a7,'resourceId':_0x34bcf1['id']}})[_0x1126('0x23')](function(){return _0x2199d9;});})[_0x1126('0x23')](function(){_0x529dd9[_0x1126('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x541bc9,_0xeb7d89){return function(_0x39bf0e){if(!_0x39bf0e){_0x541bc9['sendStatus'](0x194);}return _0x39bf0e;};}function handleError(_0x2fb797,_0x23d2bc){_0x23d2bc=_0x23d2bc||0x1f4;return function(_0x4a334a){logger[_0x1126('0x28')](_0x4a334a['stack']);if(_0x4a334a[_0x1126('0x29')]){delete _0x4a334a['name'];}_0x2fb797[_0x1126('0x1a')](_0x23d2bc)['send'](_0x4a334a);};}exports[_0x1126('0x2a')]=function(_0x5f2611,_0x5252e0){var _0x4a53ab={},_0x17646e={},_0xa8906d={'count':0x0,'rows':[]};var _0x1cef48=_['map'](db[_0x1126('0x2b')][_0x1126('0x2c')],function(_0x56f7f8){return{'name':_0x56f7f8[_0x1126('0x2d')],'type':_0x56f7f8[_0x1126('0x2e')][_0x1126('0x2f')]};});_0x17646e[_0x1126('0x30')]=_['map'](_0x1cef48,'name');_0x17646e[_0x1126('0x31')]=_[_0x1126('0x32')](_0x5f2611[_0x1126('0x31')]);_0x17646e[_0x1126('0x33')]=_['intersection'](_0x17646e[_0x1126('0x30')],_0x17646e[_0x1126('0x31')]);_0x4a53ab[_0x1126('0x34')]=_[_0x1126('0x35')](_0x17646e[_0x1126('0x30')],qs['fields'](_0x5f2611[_0x1126('0x31')][_0x1126('0x36')]));_0x4a53ab[_0x1126('0x34')]=_0x4a53ab[_0x1126('0x34')]['length']?_0x4a53ab['attributes']:_0x17646e[_0x1126('0x30')];if(!_0x5f2611[_0x1126('0x31')]['hasOwnProperty'](_0x1126('0x37'))){_0x4a53ab[_0x1126('0x1c')]=qs[_0x1126('0x1c')](_0x5f2611['query']['limit']);_0x4a53ab[_0x1126('0x1b')]=qs[_0x1126('0x1b')](_0x5f2611[_0x1126('0x31')][_0x1126('0x1b')]);}_0x4a53ab['order']=qs[_0x1126('0x38')](_0x5f2611['query'][_0x1126('0x38')]);_0x4a53ab[_0x1126('0x39')]=qs[_0x1126('0x33')](_[_0x1126('0x3a')](_0x5f2611[_0x1126('0x31')],_0x17646e['filters']),_0x1cef48);if(_0x5f2611[_0x1126('0x31')][_0x1126('0x3b')]){_0x4a53ab[_0x1126('0x39')]=_[_0x1126('0x3c')](_0x4a53ab[_0x1126('0x39')],{'$or':_[_0x1126('0x3d')](_0x1cef48,function(_0x3052f9){if(_0x3052f9['type']!==_0x1126('0x3e')){var _0x154c28={};_0x154c28[_0x3052f9[_0x1126('0x29')]]={'$like':'%'+_0x5f2611[_0x1126('0x31')][_0x1126('0x3b')]+'%'};return _0x154c28;}})});}_0x4a53ab=_['merge']({},_0x4a53ab,_0x5f2611['options']);var _0x1c4f06={'where':_0x4a53ab[_0x1126('0x39')]};return db[_0x1126('0x2b')][_0x1126('0x3f')](_0x1c4f06)[_0x1126('0x23')](function(_0x276fd5){_0xa8906d['count']=_0x276fd5;if(_0x5f2611['query']['includeAll']){_0x4a53ab[_0x1126('0x40')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x1126('0x41')](_0x4a53ab);})[_0x1126('0x23')](function(_0x3584a3){_0xa8906d[_0x1126('0x42')]=_0x3584a3;return _0xa8906d;})['then'](respondWithFilteredResult(_0x5252e0,_0x4a53ab))['catch'](handleError(_0x5252e0,null));};exports[_0x1126('0x43')]=function(_0xa93167,_0x1d63b9){var _0x5f5d3a={'raw':!![],'where':{'id':_0xa93167['params']['id']}},_0x2f8551={};_0x2f8551[_0x1126('0x30')]=_['keys'](db[_0x1126('0x2b')][_0x1126('0x2c')]);_0x2f8551[_0x1126('0x31')]=_['keys'](_0xa93167[_0x1126('0x31')]);_0x2f8551[_0x1126('0x33')]=_[_0x1126('0x35')](_0x2f8551['model'],_0x2f8551['query']);_0x5f5d3a['attributes']=_[_0x1126('0x35')](_0x2f8551['model'],qs[_0x1126('0x36')](_0xa93167['query'][_0x1126('0x36')]));_0x5f5d3a[_0x1126('0x34')]=_0x5f5d3a[_0x1126('0x34')][_0x1126('0x44')]?_0x5f5d3a[_0x1126('0x34')]:_0x2f8551['model'];if(_0xa93167[_0x1126('0x31')][_0x1126('0x45')]){_0x5f5d3a['include']=[{'all':!![]}];}_0x5f5d3a=_[_0x1126('0x3c')]({},_0x5f5d3a,_0xa93167[_0x1126('0x46')]);return db['AnalyticDefaultReport'][_0x1126('0x47')](_0x5f5d3a)[_0x1126('0x23')](handleEntityNotFound(_0x1d63b9,null))['then'](respondWithResult(_0x1d63b9,null))[_0x1126('0x48')](handleError(_0x1d63b9,null));};exports[_0x1126('0x49')]=function(_0x213a76,_0x59656d){return db[_0x1126('0x2b')][_0x1126('0x49')](_0x213a76[_0x1126('0x4a')],{})[_0x1126('0x23')](function(_0x224456){var _0x2081f2=_0x213a76[_0x1126('0x4b')][_0x1126('0x25')]({'plain':!![]});if(!_0x2081f2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2081f2[_0x1126('0x4c')]==='user'){var _0x40168e=_0x224456[_0x1126('0x25')]({'plain':!![]});var _0x4a1831='Reports';return db[_0x1126('0x4d')][_0x1126('0x47')]({'where':{'name':_0x4a1831,'userProfileId':_0x2081f2[_0x1126('0x4e')]},'raw':!![]})['then'](function(_0x3cb44c){if(_0x3cb44c&&_0x3cb44c[_0x1126('0x4f')]===0x0){return db[_0x1126('0x27')][_0x1126('0x49')]({'name':_0x40168e['name'],'resourceId':_0x40168e['id'],'type':_0x1126('0x26'),'sectionId':_0x3cb44c['id']},{})[_0x1126('0x23')](function(){return _0x224456;});}else{return _0x224456;}})['catch'](function(_0x4bcc08){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4bcc08);throw _0x4bcc08;});}return _0x224456;})[_0x1126('0x23')](respondWithResult(_0x59656d,0xc9))[_0x1126('0x48')](handleError(_0x59656d,null));};exports['update']=function(_0x16552b,_0x1c7a2b){if(_0x16552b[_0x1126('0x4a')]['id']){delete _0x16552b[_0x1126('0x4a')]['id'];}return db[_0x1126('0x2b')]['find']({'where':{'id':_0x16552b[_0x1126('0x50')]['id']}})[_0x1126('0x23')](handleEntityNotFound(_0x1c7a2b,null))['then'](saveUpdates(_0x16552b[_0x1126('0x4a')],null))[_0x1126('0x23')](respondWithResult(_0x1c7a2b,null))[_0x1126('0x48')](handleError(_0x1c7a2b,null));};exports[_0x1126('0x24')]=function(_0xc8a0f,_0x59c3d0){return db[_0x1126('0x2b')]['find']({'where':{'id':_0xc8a0f[_0x1126('0x50')]['id']}})[_0x1126('0x23')](handleEntityNotFound(_0x59c3d0,null))[_0x1126('0x23')](removeEntity(_0x59c3d0,null))['catch'](handleError(_0x59c3d0,null));};exports[_0x1126('0x51')]=function(_0x2340f8,_0x5763b4){var _0x30812d=0xa;var _0x25038f=[_0x1126('0x52'),'left_join',_0x1126('0x53'),_0x1126('0x54')];var _0x22ab18={'SUM':_0x1126('0x55'),'COUNT':_0x1126('0x56'),'COUNT DISTINCT':_0x1126('0x57'),'MAX':_0x1126('0x58'),'MIN':_0x1126('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x1126('0x5a'),'GROUP_CONCAT ASC':_0x1126('0x5b'),'GROUP_CONCAT DESC':_0x1126('0x5c')};var _0x2a5422={'SEC_TO_TIME':_0x1126('0x5d'),'DATE':'DATE(%s)','HOUR':_0x1126('0x5e'),'ROUND':_0x1126('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x3767e4=function(_0x5246aa){return!_[_0x1126('0x60')]([_0x1126('0x61'),'IS\x20NOT\x20NULL',_0x1126('0x62'),_0x1126('0x63')],_0x5246aa);};var _0x375b76=function(_0x592960){if(!_0x592960||!_0x592960[_0x1126('0x64')]['length']){return'';}for(var _0x558b6e='(',_0xbdc58=0x0;_0xbdc58<_0x592960[_0x1126('0x64')][_0x1126('0x44')];_0xbdc58+=0x1){_0xbdc58>0x0&&(_0x558b6e+='\x20'+_0x592960[_0x1126('0x65')]+'\x20');_0x558b6e+=_0x592960[_0x1126('0x64')][_0xbdc58][_0x1126('0x66')]?_0x375b76(_0x592960[_0x1126('0x64')][_0xbdc58]['group']):_0x592960[_0x1126('0x64')][_0xbdc58][_0x1126('0x67')]+'\x20'+_0x592960[_0x1126('0x64')][_0xbdc58][_0x1126('0x68')]+(_0x3767e4(_0x592960[_0x1126('0x64')][_0xbdc58][_0x1126('0x68')])?'\x20'+_0x592960['rules'][_0xbdc58]['value']:'');}return _0x558b6e+')';};var _0x16a343={'where':{'id':_0x2340f8[_0x1126('0x50')]['id']}},_0x3921c2,_0x4bf2b3,_0x5ee130,_0x5e9260,_0x51a28d;_0x16a343=_[_0x1126('0x3c')]({},_0x16a343,_0x2340f8[_0x1126('0x46')]);return db['AnalyticDefaultReport'][_0x1126('0x47')](_0x16a343)[_0x1126('0x23')](function(_0x170bf0){if(_0x170bf0){_0x3921c2=_0x170bf0;return _0x170bf0[_0x1126('0x69')]();}return null;})[_0x1126('0x23')](function(_0x3f007b){if(_0x3f007b){if(!_0x3f007b[_0x1126('0x44')]){throw new db['Sequelize'][(_0x1126('0x6a'))](_0x1126('0x6b'),0x193);}_0x4bf2b3=_0x3f007b;return db[_0x1126('0x6c')][_0x1126('0x41')]({'raw':!![]});}return null;})[_0x1126('0x23')](function(_0x56c003){if(_0x56c003){_0x5ee130=_['keyBy'](_0x56c003,'id');var _0x15cf3d;var _0x2643d7=squel['select']();_0x2643d7[_0x1126('0x6d')](_0x3921c2[_0x1126('0x6e')]);for(var _0x366675=0x0;_0x366675<_0x4bf2b3[_0x1126('0x44')];_0x366675+=0x1){_0x15cf3d=_0x4bf2b3[_0x366675][_0x1126('0x6f')]?_0x5ee130[_0x4bf2b3[_0x366675][_0x1126('0x6f')]][_0x1126('0x70')]:_0x4bf2b3[_0x366675][_0x1126('0x67')];_0x15cf3d=_0x4bf2b3[_0x366675][_0x1126('0x71')]?_[_0x1126('0x72')](_0x22ab18[_0x4bf2b3[_0x366675][_0x1126('0x71')]],'%s',_0x15cf3d):_0x15cf3d;_0x15cf3d=_0x4bf2b3[_0x366675][_0x1126('0x73')]?_[_0x1126('0x72')](_0x2a5422[_0x4bf2b3[_0x366675]['format']],'%s',_0x15cf3d):_0x15cf3d;if(_0x4bf2b3[_0x366675][_0x1126('0x74')]){_0x2643d7[_0x1126('0x66')](_0x15cf3d);}_0x4bf2b3[_0x366675][_0x1126('0x75')]&&_0x2643d7['order'](_0x15cf3d,_0x4bf2b3[_0x366675]['orderBy']===_0x1126('0x76')?![]:!![]);_0x2643d7[_0x1126('0x67')](_0x15cf3d,_0x4bf2b3[_0x366675][_0x1126('0x77')]||_0x15cf3d);}if(_0x3921c2[_0x1126('0x78')]){_0x3921c2['joins']=JSON['parse'](_0x3921c2['joins']);for(var _0x79afca=0x0;_0x79afca<_0x3921c2[_0x1126('0x78')][_0x1126('0x44')];_0x79afca+=0x1){if(_0x3921c2[_0x1126('0x78')][_0x79afca]['type']&&_[_0x1126('0x60')](_0x25038f,_0x3921c2['joins'][_0x79afca][_0x1126('0x2e')])&&_0x3921c2[_0x1126('0x78')][_0x79afca][_0x1126('0x79')]&&_0x3921c2[_0x1126('0x78')][_0x79afca][_0x1126('0x7a')]&&_0x3921c2[_0x1126('0x78')][_0x79afca][_0x1126('0x7b')]){_0x2643d7[_0x3921c2['joins'][_0x79afca][_0x1126('0x2e')]](_0x3921c2['joins'][_0x79afca][_0x1126('0x7a')],null,util[_0x1126('0x73')]('%s.%s\x20=\x20%s.%s',_0x3921c2[_0x1126('0x6e')],_0x3921c2[_0x1126('0x78')][_0x79afca]['parentKey'],_0x3921c2[_0x1126('0x78')][_0x79afca][_0x1126('0x7a')],_0x3921c2['joins'][_0x79afca]['foreignKey']));}}}if(_0x3921c2[_0x1126('0x7c')]){_0x3921c2[_0x1126('0x7c')]=JSON[_0x1126('0x7d')](_0x3921c2['conditions']);_0x2643d7['where'](_0x375b76(_0x3921c2['conditions'][_0x1126('0x66')]));}_0x51a28d=_0x2643d7['clone']();_0x2643d7['limit'](_0x30812d);_0x2643d7[_0x1126('0x1b')](0x0);logger['debug'](_0x1126('0x7e'),_0x2643d7[_0x1126('0x7f')]());return dbH['sequelize'][_0x1126('0x31')](_0x2643d7[_0x1126('0x7f')](),{'type':dbH[_0x1126('0x80')][_0x1126('0x81')][_0x1126('0x82')]});}})['then'](respondWithResult(_0x5763b4,null))[_0x1126('0x48')](handleError(_0x5763b4,null));};function runReport(_0x426faa,_0x5679ec,_0xd182b1){var _0x2d6fcf=_0x5679ec[_0x1126('0x29')];var _0x2af2d0=0xa;var _0x2598a7=[_0x1126('0x52'),_0x1126('0x83'),_0x1126('0x53'),_0x1126('0x54')];var _0x9a2af0={'SUM':_0x1126('0x55'),'COUNT':_0x1126('0x56'),'COUNT DISTINCT':_0x1126('0x57'),'MAX':_0x1126('0x58'),'MIN':_0x1126('0x59'),'AVG':_0x1126('0x84'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x1126('0x5b'),'GROUP_CONCAT DESC':_0x1126('0x5c')};var _0x33cccf={'SEC_TO_TIME':_0x1126('0x5d'),'DATE':_0x1126('0x85'),'HOUR':'HOUR(%s)','ROUND':_0x1126('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5bdb30=function(_0xb1199b){return!_[_0x1126('0x60')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x1126('0x62'),_0x1126('0x63')],_0xb1199b);};var _0x228552=function(_0x1ee970){if(!_0x1ee970||!_0x1ee970[_0x1126('0x64')][_0x1126('0x44')]){return'';}for(var _0x2d7150='(',_0x35a9a4=0x0;_0x35a9a4<_0x1ee970[_0x1126('0x64')]['length'];_0x35a9a4+=0x1){_0x35a9a4>0x0&&(_0x2d7150+='\x20'+_0x1ee970[_0x1126('0x65')]+'\x20');_0x2d7150+=_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x66')]?_0x228552(_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x66')]):_0x1ee970[_0x1126('0x64')][_0x35a9a4]['field']+'\x20'+_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x68')]+(_0x5bdb30(_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x68')])?'\x20'+_0x1ee970[_0x1126('0x64')][_0x35a9a4][_0x1126('0x86')]:'');}return _0x2d7150+')';};var _0x2418ca={'where':{'id':_0x426faa['id']}},_0x2d2dfc,_0x38eac6,_0xc3503b,_0x5d6edb,_0x50238d;_0x2418ca=_[_0x1126('0x3c')]({},_0x2418ca,_0xd182b1);return db['AnalyticDefaultReport'][_0x1126('0x47')](_0x2418ca)['then'](function(_0x4461ae){if(_0x4461ae){_0x2d2dfc=_0x4461ae;return _0x4461ae['getFields']();}return null;})[_0x1126('0x23')](function(_0x4fbd44){if(_0x4fbd44){if(!_0x4fbd44['length']){throw new db['Sequelize'][(_0x1126('0x6a'))](_0x1126('0x6b'),0x193);}_0x38eac6=_0x4fbd44;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x1126('0x23')](function(_0xe2f82d){if(_0xe2f82d){_0xc3503b=_[_0x1126('0x87')](_0xe2f82d,'id');var _0x5dfb8f;var _0x48f914=squel[_0x1126('0x88')]();_0x48f914['from'](_0x2d2dfc[_0x1126('0x6e')]);for(var _0x39d9a0=0x0;_0x39d9a0<_0x38eac6[_0x1126('0x44')];_0x39d9a0+=0x1){_0x5dfb8f=_0x38eac6[_0x39d9a0][_0x1126('0x6f')]?_0xc3503b[_0x38eac6[_0x39d9a0][_0x1126('0x6f')]]['metric']:_0x38eac6[_0x39d9a0]['field'];_0x5dfb8f=_0x38eac6[_0x39d9a0][_0x1126('0x71')]?_[_0x1126('0x72')](_0x9a2af0[_0x38eac6[_0x39d9a0][_0x1126('0x71')]],'%s',_0x5dfb8f):_0x5dfb8f;_0x5dfb8f=_0x38eac6[_0x39d9a0][_0x1126('0x73')]?_[_0x1126('0x72')](_0x33cccf[_0x38eac6[_0x39d9a0][_0x1126('0x73')]],'%s',_0x5dfb8f):_0x5dfb8f;if(_0x38eac6[_0x39d9a0][_0x1126('0x74')]){_0x48f914[_0x1126('0x66')](_0x5dfb8f);}_0x38eac6[_0x39d9a0][_0x1126('0x75')]&&_0x48f914[_0x1126('0x89')](_0x5dfb8f,_0x38eac6[_0x39d9a0][_0x1126('0x75')]==='DESC'?![]:!![]);_0x48f914[_0x1126('0x67')](_0x5dfb8f,_0x38eac6[_0x39d9a0]['alias']||_0x5dfb8f);}if(_0x2d2dfc[_0x1126('0x78')]){_0x2d2dfc['joins']=JSON[_0x1126('0x7d')](_0x2d2dfc[_0x1126('0x78')]);for(var _0x215d4d=0x0;_0x215d4d<_0x2d2dfc[_0x1126('0x78')]['length'];_0x215d4d+=0x1){if(_0x2d2dfc[_0x1126('0x78')][_0x215d4d][_0x1126('0x2e')]&&_['includes'](_0x2598a7,_0x2d2dfc['joins'][_0x215d4d][_0x1126('0x2e')])&&_0x2d2dfc[_0x1126('0x78')][_0x215d4d][_0x1126('0x79')]&&_0x2d2dfc['joins'][_0x215d4d][_0x1126('0x7a')]&&_0x2d2dfc['joins'][_0x215d4d][_0x1126('0x7b')]){_0x48f914[_0x2d2dfc[_0x1126('0x78')][_0x215d4d]['type']](_0x2d2dfc[_0x1126('0x78')][_0x215d4d][_0x1126('0x7a')],null,util[_0x1126('0x73')](_0x1126('0x8a'),_0x2d2dfc[_0x1126('0x6e')],_0x2d2dfc['joins'][_0x215d4d][_0x1126('0x79')],_0x2d2dfc[_0x1126('0x78')][_0x215d4d][_0x1126('0x7a')],_0x2d2dfc['joins'][_0x215d4d]['foreignKey']));}}}if(_0x2d2dfc['conditions']){_0x2d2dfc[_0x1126('0x7c')]=JSON[_0x1126('0x7d')](_0x2d2dfc[_0x1126('0x7c')]);_0x48f914[_0x1126('0x39')](_0x228552(_0x2d2dfc['conditions'][_0x1126('0x66')]));}_0x50238d=_0x48f914[_0x1126('0x8b')]();_0x48f914[_0x1126('0x1c')](_0x2af2d0);_0x48f914[_0x1126('0x1b')](0x0);return;}})[_0x1126('0x23')](function(){if(_0x5679ec['output']===_0x1126('0x8c')){return null;}var _0x21c487=_['merge'](_0x5679ec,{'name':_0x5679ec[_0x1126('0x8d')]||_0x5679ec['name']||_0x2d2dfc['name'],'basename':_0x2d6fcf,'savename':util[_0x1126('0x73')]('%s-%s.%s',_0x5679ec[_0x1126('0x29')]||_0x2d2dfc[_0x1126('0x29')],require(_0x1126('0x8e'))[_0x1126('0x8f')](0x4),_0x5679ec[_0x1126('0x90')]||_0x1126('0x91')),'reportId':_0x2d2dfc['id'],'reportType':_0x1126('0x92')});return db[_0x1126('0x93')][_0x1126('0x49')](_0x21c487,{'raw':!![]});})['then'](function(_0x2577f5){if(_0x2d2dfc[_0x1126('0x6e')]===_0x1126('0x94')){_0x50238d[_0x1126('0x39')](_0x2d2dfc['table']+_0x1126('0x95'),_0x5679ec[_0x1126('0x96')],_0x5679ec[_0x1126('0x97')]);}else{_0x50238d[_0x1126('0x39')](_0x2d2dfc['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5679ec['startDate'],_0x5679ec[_0x1126('0x97')]);}if(_0x2577f5){logger['info'](_0x1126('0x98'),_0x50238d[_0x1126('0x7f')]());require('child_process')['fork'](path[_0x1126('0x52')](__dirname,_0x1126('0x99'),_0x2577f5['output']),[_0x2577f5['id'],_0x50238d[_0x1126('0x7f')](),path[_0x1126('0x52')](__dirname,'../../files/reports',_0x2577f5[_0x1126('0x9a')]),_0x2d6fcf]);return _0x2577f5;}else{var _0x4a9941=squel[_0x1126('0x88')]();_0x4a9941[_0x1126('0x6d')]('('+_0x50238d[_0x1126('0x7f')]()+')','countTable');_0x4a9941[_0x1126('0x67')](_0x1126('0x9b'),_0x1126('0x3f'));_0x50238d[_0x1126('0x1c')](_0x5679ec[_0x1126('0x1c')]||_0x2af2d0);_0x50238d[_0x1126('0x1b')](_0x5679ec[_0x1126('0x1b')]||0x0);return dbH[_0x1126('0x80')][_0x1126('0x31')](_0x4a9941[_0x1126('0x7f')](),{'type':dbH[_0x1126('0x80')][_0x1126('0x81')][_0x1126('0x82')]})[_0x1126('0x23')](function(_0x12ffa5){if(!_0x12ffa5[_0x1126('0x44')]){_0x5d6edb=0x0;}else{_0x5d6edb=_0x12ffa5[0x0][_0x1126('0x3f')]||0x0;}return dbH['sequelize'][_0x1126('0x31')](_0x50238d[_0x1126('0x7f')](),{'type':dbH['sequelize']['QueryTypes'][_0x1126('0x82')]});})[_0x1126('0x23')](function(_0x35065c){return{'rows':_0x35065c||[],'count':_0x5d6edb};});}});}exports[_0x1126('0x9c')]=function(_0x5c0215,_0x444f94){return runReport(_0x5c0215[_0x1126('0x50')],_0x5c0215['query'],_0x5c0215[_0x1126('0x46')])['then'](respondWithResult(_0x444f94,null))[_0x1126('0x48')](handleError(_0x444f94,null));};exports[_0x1126('0x9d')]=runReport;exports['query']=function(_0x4d43ad,_0xa02d9e){var _0x548f9e=0xa;var _0x5edb83=[_0x1126('0x52'),_0x1126('0x83'),_0x1126('0x53'),_0x1126('0x54')];var _0x4f29ce={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x1126('0x57'),'MAX':_0x1126('0x58'),'MIN':'MIN(%s)','AVG':_0x1126('0x84'),'GROUP_CONCAT':_0x1126('0x5a'),'GROUP_CONCAT ASC':_0x1126('0x5b'),'GROUP_CONCAT DESC':_0x1126('0x5c')};var _0x17b25d={'SEC_TO_TIME':_0x1126('0x5d'),'DATE':_0x1126('0x85'),'HOUR':_0x1126('0x5e'),'ROUND':_0x1126('0x5f'),'UNIX_TIMESTAMP':_0x1126('0x9e')};var _0x3a4a91=function(_0x55145f){return!_[_0x1126('0x60')](['IS\x20NULL',_0x1126('0x9f'),_0x1126('0x62'),_0x1126('0x63')],_0x55145f);};var _0x4c7dc7=function(_0x33a27b){if(!_0x33a27b||!_0x33a27b[_0x1126('0x64')][_0x1126('0x44')]){return'';}for(var _0x578c1b='(',_0x1562b2=0x0;_0x1562b2<_0x33a27b[_0x1126('0x64')][_0x1126('0x44')];_0x1562b2+=0x1){_0x1562b2>0x0&&(_0x578c1b+='\x20'+_0x33a27b[_0x1126('0x65')]+'\x20');_0x578c1b+=_0x33a27b[_0x1126('0x64')][_0x1562b2]['group']?_0x4c7dc7(_0x33a27b['rules'][_0x1562b2][_0x1126('0x66')]):_0x33a27b[_0x1126('0x64')][_0x1562b2][_0x1126('0x67')]+'\x20'+_0x33a27b[_0x1126('0x64')][_0x1562b2][_0x1126('0x68')]+(_0x3a4a91(_0x33a27b[_0x1126('0x64')][_0x1562b2][_0x1126('0x68')])?'\x20'+_0x33a27b[_0x1126('0x64')][_0x1562b2][_0x1126('0x86')]:'');}return _0x578c1b+')';};var _0x2fb228={'where':{'id':_0x4d43ad[_0x1126('0x50')]['id']}},_0x2c95b6,_0x4a4b43,_0x588f4f,_0x5ac4d6,_0x1168a5;_0x2fb228=_['merge']({},_0x2fb228,_0x4d43ad['options']);return db[_0x1126('0x2b')][_0x1126('0x47')](_0x2fb228)[_0x1126('0x23')](function(_0x48b088){if(_0x48b088){_0x2c95b6=_0x48b088;return _0x48b088[_0x1126('0x69')]();}return null;})[_0x1126('0x23')](function(_0x5a28f9){if(_0x5a28f9){if(!_0x5a28f9[_0x1126('0x44')]){throw new db[(_0x1126('0xa0'))][(_0x1126('0x6a'))](_0x1126('0x6b'),0x193);}_0x4a4b43=_0x5a28f9;return db[_0x1126('0x6c')]['findAll']({'raw':!![]});}return null;})[_0x1126('0x23')](function(_0x1140ec){if(_0x1140ec){_0x588f4f=_['keyBy'](_0x1140ec,'id');var _0x578f5c;var _0x559dae=squel[_0x1126('0x88')]();_0x559dae[_0x1126('0x6d')](_0x2c95b6[_0x1126('0x6e')]);for(var _0x9d7819=0x0;_0x9d7819<_0x4a4b43[_0x1126('0x44')];_0x9d7819+=0x1){_0x578f5c=_0x4a4b43[_0x9d7819]['MetricId']?_0x588f4f[_0x4a4b43[_0x9d7819][_0x1126('0x6f')]]['metric']:_0x4a4b43[_0x9d7819][_0x1126('0x67')];_0x578f5c=_0x4a4b43[_0x9d7819][_0x1126('0x71')]?_['replace'](_0x4f29ce[_0x4a4b43[_0x9d7819]['function']],'%s',_0x578f5c):_0x578f5c;_0x578f5c=_0x4a4b43[_0x9d7819][_0x1126('0x73')]?_[_0x1126('0x72')](_0x17b25d[_0x4a4b43[_0x9d7819]['format']],'%s',_0x578f5c):_0x578f5c;if(_0x4a4b43[_0x9d7819]['groupBy']){_0x559dae[_0x1126('0x66')](_0x578f5c);}_0x4a4b43[_0x9d7819][_0x1126('0x75')]&&_0x559dae[_0x1126('0x89')](_0x578f5c,_0x4a4b43[_0x9d7819][_0x1126('0x75')]===_0x1126('0x76')?![]:!![]);_0x559dae[_0x1126('0x67')](_0x578f5c,_0x4a4b43[_0x9d7819][_0x1126('0x77')]||_0x578f5c);}if(_0x2c95b6[_0x1126('0x78')]){_0x2c95b6[_0x1126('0x78')]=JSON[_0x1126('0x7d')](_0x2c95b6['joins']);for(var _0x4d6528=0x0;_0x4d6528<_0x2c95b6[_0x1126('0x78')][_0x1126('0x44')];_0x4d6528+=0x1){if(_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x2e')]&&_[_0x1126('0x60')](_0x5edb83,_0x2c95b6[_0x1126('0x78')][_0x4d6528]['type'])&&_0x2c95b6['joins'][_0x4d6528][_0x1126('0x79')]&&_0x2c95b6['joins'][_0x4d6528]['foreignTable']&&_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x7b')]){_0x559dae[_0x2c95b6['joins'][_0x4d6528][_0x1126('0x2e')]](_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x7a')],null,util[_0x1126('0x73')]('%s.%s\x20=\x20%s.%s',_0x2c95b6[_0x1126('0x6e')],_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x79')],_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x7a')],_0x2c95b6[_0x1126('0x78')][_0x4d6528][_0x1126('0x7b')]));}}}if(_0x2c95b6['conditions']){_0x2c95b6[_0x1126('0x7c')]=JSON[_0x1126('0x7d')](_0x2c95b6[_0x1126('0x7c')]);_0x559dae[_0x1126('0x39')](_0x4c7dc7(_0x2c95b6['conditions'][_0x1126('0x66')]));}_0x1168a5=_0x559dae[_0x1126('0x8b')]();_0x559dae['limit'](_0x548f9e);_0x559dae[_0x1126('0x1b')](0x0);logger[_0x1126('0xa1')](_0x1126('0x7e'),_0x559dae['toString']());return dbH[_0x1126('0x80')][_0x1126('0x31')](_0x559dae[_0x1126('0x7f')](),{'type':dbH[_0x1126('0x80')][_0x1126('0x81')][_0x1126('0x82')]});}})['then'](function(){return{'sql':_0x1168a5[_0x1126('0x7f')]()};})[_0x1126('0x23')](respondWithResult(_0xa02d9e,null))['catch'](handleError(_0xa02d9e,null));}; \ No newline at end of file +var _0xf494=['name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','includeAll','find','create','body','user','Reports','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','join','left_join','cross_join','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','group','field','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','DESC','alias','joins','parse','foreignTable','%s.%s\x20=\x20%s.%s','parentKey','foreignKey','conditions','debug','Limited\x20Query:','sequelize','toString','QueryTypes','right_join','SUM(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','ROUND(%s)','IS\x20NULL','operator','condition','getFields','groupBy','clone','output','fullPath','%s-%s.%s','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','SELECT','run','runReport','IS\x20NOT\x20EMPTY','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','get','DefaultReports','error','stack'];(function(_0x3db2db,_0x577bc0){var _0x5905a4=function(_0x4a7385){while(--_0x4a7385){_0x3db2db['push'](_0x3db2db['shift']());}};_0x5905a4(++_0x577bc0);}(_0xf494,0x1c6));var _0x4f49=function(_0x50388b,_0x276225){_0x50388b=_0x50388b-0x0;var _0x6037b=_0xf494[_0x50388b];return _0x6037b;};'use strict';var emlformat=require(_0x4f49('0x0'));var rimraf=require(_0x4f49('0x1'));var zipdir=require(_0x4f49('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4f49('0x3'));var moment=require(_0x4f49('0x4'));var BPromise=require(_0x4f49('0x5'));var Mustache=require(_0x4f49('0x6'));var util=require(_0x4f49('0x7'));var path=require(_0x4f49('0x8'));var sox=require(_0x4f49('0x9'));var csv=require(_0x4f49('0xa'));var ejs=require(_0x4f49('0xb'));var fs=require('fs');var fs_extra=require(_0x4f49('0xc'));var _=require(_0x4f49('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4f49('0xe'));var deskjs=require(_0x4f49('0xf'));var toCsv=require(_0x4f49('0xa'));var querystring=require(_0x4f49('0x10'));var Papa=require(_0x4f49('0x11'));var Redis=require(_0x4f49('0x12'));var authService=require(_0x4f49('0x13'));var qs=require(_0x4f49('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4f49('0x15'));var logger=require(_0x4f49('0x16'))('api');var utils=require(_0x4f49('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4f49('0x18'))['db'];var dbH=require(_0x4f49('0x18'))['dbH'];function respondWithStatusCode(_0x1e1c37,_0x111a8b){_0x111a8b=_0x111a8b||0xcc;return function(_0x1b9145){if(_0x1b9145){return _0x1e1c37[_0x4f49('0x19')](_0x111a8b);}return _0x1e1c37[_0x4f49('0x1a')](_0x111a8b)[_0x4f49('0x1b')]();};}function respondWithResult(_0xfdb477,_0x5c373e){_0x5c373e=_0x5c373e||0xc8;return function(_0x515ace){if(_0x515ace){return _0xfdb477[_0x4f49('0x1a')](_0x5c373e)[_0x4f49('0x1c')](_0x515ace);}};}function respondWithFilteredResult(_0x5878f4,_0x5bdfaf){return function(_0x2f0a0d){if(_0x2f0a0d){var _0x2ecaaa=typeof _0x5bdfaf[_0x4f49('0x1d')]==='undefined'&&typeof _0x5bdfaf[_0x4f49('0x1e')]===_0x4f49('0x1f');var _0x4e85df=_0x2f0a0d['count'];var _0x5bb23b=_0x2ecaaa?0x0:_0x5bdfaf['offset'];var _0x47f1e8=_0x2ecaaa?_0x2f0a0d[_0x4f49('0x20')]:_0x5bdfaf[_0x4f49('0x1d')]+_0x5bdfaf[_0x4f49('0x1e')];var _0x407042;if(_0x47f1e8>=_0x4e85df){_0x47f1e8=_0x4e85df;_0x407042=0xc8;}else{_0x407042=0xce;}_0x5878f4['status'](_0x407042);return _0x5878f4[_0x4f49('0x21')](_0x4f49('0x22'),_0x5bb23b+'-'+_0x47f1e8+'/'+_0x4e85df)[_0x4f49('0x1c')](_0x2f0a0d);}return null;};}function patchUpdates(_0xaab5e7){return function(_0xea82f8){try{jsonpatch['apply'](_0xea82f8,_0xaab5e7,!![]);}catch(_0x3e7e28){return BPromise[_0x4f49('0x23')](_0x3e7e28);}return _0xea82f8[_0x4f49('0x24')]();};}function saveUpdates(_0x53b57d,_0x40755e){return function(_0x1d70a7){if(_0x1d70a7){return _0x1d70a7[_0x4f49('0x25')](_0x53b57d)[_0x4f49('0x26')](function(_0x9d30aa){return _0x9d30aa;});}return null;};}function removeEntity(_0x36187b,_0x559d98){return function(_0x4e9041){if(_0x4e9041){return _0x4e9041[_0x4f49('0x27')]()[_0x4f49('0x26')](function(){var _0x4fedbb=_0x4e9041[_0x4f49('0x28')]({'plain':!![]});var _0x2c1519=_0x4f49('0x29');return db['UserProfileResource'][_0x4f49('0x27')]({'where':{'type':_0x2c1519,'resourceId':_0x4fedbb['id']}})[_0x4f49('0x26')](function(){return _0x4e9041;});})[_0x4f49('0x26')](function(){_0x36187b[_0x4f49('0x1a')](0xcc)[_0x4f49('0x1b')]();});}};}function handleEntityNotFound(_0x122404,_0x4915af){return function(_0x50c571){if(!_0x50c571){_0x122404[_0x4f49('0x19')](0x194);}return _0x50c571;};}function handleError(_0x2c00ee,_0x605c91){_0x605c91=_0x605c91||0x1f4;return function(_0x560050){logger[_0x4f49('0x2a')](_0x560050[_0x4f49('0x2b')]);if(_0x560050[_0x4f49('0x2c')]){delete _0x560050['name'];}_0x2c00ee['status'](_0x605c91)[_0x4f49('0x2d')](_0x560050);};}exports[_0x4f49('0x2e')]=function(_0x7a6ea0,_0x5e7076){var _0x1eaac6={},_0x35aa33={},_0x173657={'count':0x0,'rows':[]};var _0x2ceda4=_[_0x4f49('0x2f')](db[_0x4f49('0x30')][_0x4f49('0x31')],function(_0x45ae19){return{'name':_0x45ae19[_0x4f49('0x32')],'type':_0x45ae19[_0x4f49('0x33')][_0x4f49('0x34')]};});_0x35aa33[_0x4f49('0x35')]=_[_0x4f49('0x2f')](_0x2ceda4,_0x4f49('0x2c'));_0x35aa33[_0x4f49('0x36')]=_[_0x4f49('0x37')](_0x7a6ea0[_0x4f49('0x36')]);_0x35aa33[_0x4f49('0x38')]=_[_0x4f49('0x39')](_0x35aa33['model'],_0x35aa33[_0x4f49('0x36')]);_0x1eaac6[_0x4f49('0x3a')]=_[_0x4f49('0x39')](_0x35aa33[_0x4f49('0x35')],qs[_0x4f49('0x3b')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x3b')]));_0x1eaac6[_0x4f49('0x3a')]=_0x1eaac6[_0x4f49('0x3a')][_0x4f49('0x3c')]?_0x1eaac6[_0x4f49('0x3a')]:_0x35aa33[_0x4f49('0x35')];if(!_0x7a6ea0[_0x4f49('0x36')]['hasOwnProperty'](_0x4f49('0x3d'))){_0x1eaac6[_0x4f49('0x1e')]=qs[_0x4f49('0x1e')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x1e')]);_0x1eaac6[_0x4f49('0x1d')]=qs[_0x4f49('0x1d')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x1d')]);}_0x1eaac6[_0x4f49('0x3e')]=qs[_0x4f49('0x3f')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x3f')]);_0x1eaac6[_0x4f49('0x40')]=qs['filters'](_[_0x4f49('0x41')](_0x7a6ea0[_0x4f49('0x36')],_0x35aa33['filters']),_0x2ceda4);if(_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x42')]){_0x1eaac6['where']=_[_0x4f49('0x43')](_0x1eaac6[_0x4f49('0x40')],{'$or':_[_0x4f49('0x2f')](_0x2ceda4,function(_0x200b1d){if(_0x200b1d[_0x4f49('0x33')]!==_0x4f49('0x44')){var _0x29e910={};_0x29e910[_0x200b1d['name']]={'$like':'%'+_0x7a6ea0['query']['filter']+'%'};return _0x29e910;}})});}_0x1eaac6=_[_0x4f49('0x43')]({},_0x1eaac6,_0x7a6ea0[_0x4f49('0x45')]);var _0x2e4355={'where':_0x1eaac6[_0x4f49('0x40')]};return db[_0x4f49('0x30')][_0x4f49('0x20')](_0x2e4355)[_0x4f49('0x26')](function(_0x23720a){_0x173657[_0x4f49('0x20')]=_0x23720a;if(_0x7a6ea0['query']['includeAll']){_0x1eaac6[_0x4f49('0x46')]=[{'all':!![]}];}return db[_0x4f49('0x30')][_0x4f49('0x47')](_0x1eaac6);})['then'](function(_0x2d6b56){_0x173657['rows']=_0x2d6b56;return _0x173657;})['then'](respondWithFilteredResult(_0x5e7076,_0x1eaac6))[_0x4f49('0x48')](handleError(_0x5e7076,null));};exports[_0x4f49('0x49')]=function(_0x40eadc,_0x497cb8){var _0x287781={'raw':!![],'where':{'id':_0x40eadc['params']['id']}},_0x11b4df={};_0x11b4df[_0x4f49('0x35')]=_['keys'](db[_0x4f49('0x30')][_0x4f49('0x31')]);_0x11b4df[_0x4f49('0x36')]=_['keys'](_0x40eadc[_0x4f49('0x36')]);_0x11b4df[_0x4f49('0x38')]=_[_0x4f49('0x39')](_0x11b4df[_0x4f49('0x35')],_0x11b4df[_0x4f49('0x36')]);_0x287781[_0x4f49('0x3a')]=_[_0x4f49('0x39')](_0x11b4df[_0x4f49('0x35')],qs[_0x4f49('0x3b')](_0x40eadc[_0x4f49('0x36')]['fields']));_0x287781[_0x4f49('0x3a')]=_0x287781[_0x4f49('0x3a')]['length']?_0x287781[_0x4f49('0x3a')]:_0x11b4df['model'];if(_0x40eadc[_0x4f49('0x36')][_0x4f49('0x4a')]){_0x287781[_0x4f49('0x46')]=[{'all':!![]}];}_0x287781=_[_0x4f49('0x43')]({},_0x287781,_0x40eadc['options']);return db[_0x4f49('0x30')][_0x4f49('0x4b')](_0x287781)[_0x4f49('0x26')](handleEntityNotFound(_0x497cb8,null))[_0x4f49('0x26')](respondWithResult(_0x497cb8,null))[_0x4f49('0x48')](handleError(_0x497cb8,null));};exports[_0x4f49('0x4c')]=function(_0x37fdb7,_0xd282c){return db[_0x4f49('0x30')][_0x4f49('0x4c')](_0x37fdb7[_0x4f49('0x4d')],{})[_0x4f49('0x26')](function(_0x148031){var _0x2104d0=_0x37fdb7[_0x4f49('0x4e')][_0x4f49('0x28')]({'plain':!![]});if(!_0x2104d0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2104d0['role']===_0x4f49('0x4e')){var _0x197670=_0x148031[_0x4f49('0x28')]({'plain':!![]});var _0xe46c90=_0x4f49('0x4f');return db[_0x4f49('0x50')][_0x4f49('0x4b')]({'where':{'name':_0xe46c90,'userProfileId':_0x2104d0['userProfileId']},'raw':!![]})[_0x4f49('0x26')](function(_0x4ff0a2){if(_0x4ff0a2&&_0x4ff0a2[_0x4f49('0x51')]===0x0){return db[_0x4f49('0x52')][_0x4f49('0x4c')]({'name':_0x197670[_0x4f49('0x2c')],'resourceId':_0x197670['id'],'type':'DefaultReports','sectionId':_0x4ff0a2['id']},{})[_0x4f49('0x26')](function(){return _0x148031;});}else{return _0x148031;}})['catch'](function(_0x52d18c){logger[_0x4f49('0x2a')](_0x4f49('0x53'),_0x52d18c);throw _0x52d18c;});}return _0x148031;})[_0x4f49('0x26')](respondWithResult(_0xd282c,0xc9))[_0x4f49('0x48')](handleError(_0xd282c,null));};exports['update']=function(_0x599c51,_0xd7f47b){if(_0x599c51[_0x4f49('0x4d')]['id']){delete _0x599c51['body']['id'];}return db[_0x4f49('0x30')]['find']({'where':{'id':_0x599c51['params']['id']}})[_0x4f49('0x26')](handleEntityNotFound(_0xd7f47b,null))['then'](saveUpdates(_0x599c51[_0x4f49('0x4d')],null))['then'](respondWithResult(_0xd7f47b,null))[_0x4f49('0x48')](handleError(_0xd7f47b,null));};exports[_0x4f49('0x27')]=function(_0x2472c9,_0x883408){return db[_0x4f49('0x30')][_0x4f49('0x4b')]({'where':{'id':_0x2472c9[_0x4f49('0x54')]['id']}})[_0x4f49('0x26')](handleEntityNotFound(_0x883408,null))['then'](removeEntity(_0x883408,null))[_0x4f49('0x48')](handleError(_0x883408,null));};exports['preview']=function(_0x213608,_0x1f640d){var _0xc4fc6b=0xa;var _0x467f12=[_0x4f49('0x55'),_0x4f49('0x56'),'right_join',_0x4f49('0x57')];var _0xd3689c={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4f49('0x58'),'MAX':_0x4f49('0x59'),'MIN':_0x4f49('0x5a'),'AVG':_0x4f49('0x5b'),'GROUP_CONCAT':_0x4f49('0x5c'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4f49('0x5d')};var _0x564bf5={'SEC_TO_TIME':_0x4f49('0x5e'),'DATE':_0x4f49('0x5f'),'HOUR':_0x4f49('0x60'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x4f49('0x61')};var _0x21807e=function(_0x265988){return!_[_0x4f49('0x62')](['IS\x20NULL',_0x4f49('0x63'),_0x4f49('0x64'),'IS\x20NOT\x20EMPTY'],_0x265988);};var _0x293839=function(_0x17b15){if(!_0x17b15||!_0x17b15[_0x4f49('0x65')][_0x4f49('0x3c')]){return'';}for(var _0x28ea73='(',_0x1b80f2=0x0;_0x1b80f2<_0x17b15[_0x4f49('0x65')][_0x4f49('0x3c')];_0x1b80f2+=0x1){_0x1b80f2>0x0&&(_0x28ea73+='\x20'+_0x17b15['operator']+'\x20');_0x28ea73+=_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x66')]?_0x293839(_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x66')]):_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x67')]+'\x20'+_0x17b15[_0x4f49('0x65')][_0x1b80f2]['condition']+(_0x21807e(_0x17b15[_0x4f49('0x65')][_0x1b80f2]['condition'])?'\x20'+_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x68')]:'');}return _0x28ea73+')';};var _0x4714c7={'where':{'id':_0x213608[_0x4f49('0x54')]['id']}},_0xf29378,_0xc7743e,_0x3f2f3f,_0x61a565,_0x297698;_0x4714c7=_[_0x4f49('0x43')]({},_0x4714c7,_0x213608['options']);return db[_0x4f49('0x30')][_0x4f49('0x4b')](_0x4714c7)[_0x4f49('0x26')](function(_0x2cdaa4){if(_0x2cdaa4){_0xf29378=_0x2cdaa4;return _0x2cdaa4['getFields']();}return null;})['then'](function(_0x28e8ae){if(_0x28e8ae){if(!_0x28e8ae['length']){throw new db[(_0x4f49('0x69'))][(_0x4f49('0x6a'))](_0x4f49('0x6b'),0x193);}_0xc7743e=_0x28e8ae;return db[_0x4f49('0x6c')][_0x4f49('0x47')]({'raw':!![]});}return null;})[_0x4f49('0x26')](function(_0x179431){if(_0x179431){_0x3f2f3f=_[_0x4f49('0x6d')](_0x179431,'id');var _0x3823f0;var _0x3e9b47=squel[_0x4f49('0x6e')]();_0x3e9b47[_0x4f49('0x6f')](_0xf29378[_0x4f49('0x70')]);for(var _0xd53de8=0x0;_0xd53de8<_0xc7743e[_0x4f49('0x3c')];_0xd53de8+=0x1){_0x3823f0=_0xc7743e[_0xd53de8][_0x4f49('0x71')]?_0x3f2f3f[_0xc7743e[_0xd53de8][_0x4f49('0x71')]][_0x4f49('0x72')]:_0xc7743e[_0xd53de8][_0x4f49('0x67')];_0x3823f0=_0xc7743e[_0xd53de8][_0x4f49('0x73')]?_[_0x4f49('0x74')](_0xd3689c[_0xc7743e[_0xd53de8][_0x4f49('0x73')]],'%s',_0x3823f0):_0x3823f0;_0x3823f0=_0xc7743e[_0xd53de8][_0x4f49('0x75')]?_[_0x4f49('0x74')](_0x564bf5[_0xc7743e[_0xd53de8][_0x4f49('0x75')]],'%s',_0x3823f0):_0x3823f0;if(_0xc7743e[_0xd53de8]['groupBy']){_0x3e9b47[_0x4f49('0x66')](_0x3823f0);}_0xc7743e[_0xd53de8]['orderBy']&&_0x3e9b47[_0x4f49('0x3e')](_0x3823f0,_0xc7743e[_0xd53de8][_0x4f49('0x76')]===_0x4f49('0x77')?![]:!![]);_0x3e9b47[_0x4f49('0x67')](_0x3823f0,_0xc7743e[_0xd53de8][_0x4f49('0x78')]||_0x3823f0);}if(_0xf29378[_0x4f49('0x79')]){_0xf29378[_0x4f49('0x79')]=JSON[_0x4f49('0x7a')](_0xf29378[_0x4f49('0x79')]);for(var _0x541ac6=0x0;_0x541ac6<_0xf29378['joins'][_0x4f49('0x3c')];_0x541ac6+=0x1){if(_0xf29378['joins'][_0x541ac6][_0x4f49('0x33')]&&_[_0x4f49('0x62')](_0x467f12,_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x33')])&&_0xf29378[_0x4f49('0x79')][_0x541ac6]['parentKey']&&_0xf29378['joins'][_0x541ac6][_0x4f49('0x7b')]&&_0xf29378[_0x4f49('0x79')][_0x541ac6]['foreignKey']){_0x3e9b47[_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x33')]](_0xf29378['joins'][_0x541ac6][_0x4f49('0x7b')],null,util['format'](_0x4f49('0x7c'),_0xf29378[_0x4f49('0x70')],_0xf29378['joins'][_0x541ac6][_0x4f49('0x7d')],_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x7b')],_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x7e')]));}}}if(_0xf29378[_0x4f49('0x7f')]){_0xf29378['conditions']=JSON[_0x4f49('0x7a')](_0xf29378['conditions']);_0x3e9b47[_0x4f49('0x40')](_0x293839(_0xf29378['conditions'][_0x4f49('0x66')]));}_0x297698=_0x3e9b47['clone']();_0x3e9b47[_0x4f49('0x1e')](_0xc4fc6b);_0x3e9b47[_0x4f49('0x1d')](0x0);logger[_0x4f49('0x80')](_0x4f49('0x81'),_0x3e9b47['toString']());return dbH[_0x4f49('0x82')]['query'](_0x3e9b47[_0x4f49('0x83')](),{'type':dbH['sequelize'][_0x4f49('0x84')]['SELECT']});}})['then'](respondWithResult(_0x1f640d,null))[_0x4f49('0x48')](handleError(_0x1f640d,null));};function runReport(_0x20b2be,_0x16cb4d,_0x4c0e7a){var _0x289810=_0x16cb4d[_0x4f49('0x2c')];var _0x5c33c9=0xa;var _0x5d52ae=['join',_0x4f49('0x56'),_0x4f49('0x85'),_0x4f49('0x57')];var _0x87439={'SUM':_0x4f49('0x86'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4f49('0x58'),'MAX':_0x4f49('0x59'),'MIN':_0x4f49('0x5a'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4f49('0x5c'),'GROUP_CONCAT ASC':_0x4f49('0x87'),'GROUP_CONCAT DESC':_0x4f49('0x5d')};var _0x2902a1={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x4f49('0x5f'),'HOUR':_0x4f49('0x60'),'ROUND':_0x4f49('0x88'),'UNIX_TIMESTAMP':_0x4f49('0x61')};var _0x389679=function(_0x5304c3){return!_[_0x4f49('0x62')]([_0x4f49('0x89'),'IS\x20NOT\x20NULL',_0x4f49('0x64'),'IS\x20NOT\x20EMPTY'],_0x5304c3);};var _0x351a33=function(_0x4d72a0){if(!_0x4d72a0||!_0x4d72a0[_0x4f49('0x65')][_0x4f49('0x3c')]){return'';}for(var _0x2ef19e='(',_0x6ad599=0x0;_0x6ad599<_0x4d72a0[_0x4f49('0x65')]['length'];_0x6ad599+=0x1){_0x6ad599>0x0&&(_0x2ef19e+='\x20'+_0x4d72a0[_0x4f49('0x8a')]+'\x20');_0x2ef19e+=_0x4d72a0[_0x4f49('0x65')][_0x6ad599][_0x4f49('0x66')]?_0x351a33(_0x4d72a0[_0x4f49('0x65')][_0x6ad599]['group']):_0x4d72a0[_0x4f49('0x65')][_0x6ad599]['field']+'\x20'+_0x4d72a0[_0x4f49('0x65')][_0x6ad599]['condition']+(_0x389679(_0x4d72a0[_0x4f49('0x65')][_0x6ad599][_0x4f49('0x8b')])?'\x20'+_0x4d72a0[_0x4f49('0x65')][_0x6ad599][_0x4f49('0x68')]:'');}return _0x2ef19e+')';};var _0x111e90={'where':{'id':_0x20b2be['id']}},_0xd253ed,_0x323a3a,_0xe0adc3,_0x3a26ff,_0x64f0ee;_0x111e90=_['merge']({},_0x111e90,_0x4c0e7a);return db[_0x4f49('0x30')][_0x4f49('0x4b')](_0x111e90)[_0x4f49('0x26')](function(_0x299849){if(_0x299849){_0xd253ed=_0x299849;return _0x299849[_0x4f49('0x8c')]();}return null;})[_0x4f49('0x26')](function(_0x55b28b){if(_0x55b28b){if(!_0x55b28b[_0x4f49('0x3c')]){throw new db[(_0x4f49('0x69'))][(_0x4f49('0x6a'))](_0x4f49('0x6b'),0x193);}_0x323a3a=_0x55b28b;return db['AnalyticMetric'][_0x4f49('0x47')]({'raw':!![]});}return null;})['then'](function(_0x3c4e88){if(_0x3c4e88){_0xe0adc3=_[_0x4f49('0x6d')](_0x3c4e88,'id');var _0x5c5d2;var _0xa880a2=squel['select']();_0xa880a2[_0x4f49('0x6f')](_0xd253ed[_0x4f49('0x70')]);for(var _0x11c0a0=0x0;_0x11c0a0<_0x323a3a[_0x4f49('0x3c')];_0x11c0a0+=0x1){_0x5c5d2=_0x323a3a[_0x11c0a0][_0x4f49('0x71')]?_0xe0adc3[_0x323a3a[_0x11c0a0][_0x4f49('0x71')]][_0x4f49('0x72')]:_0x323a3a[_0x11c0a0][_0x4f49('0x67')];_0x5c5d2=_0x323a3a[_0x11c0a0][_0x4f49('0x73')]?_[_0x4f49('0x74')](_0x87439[_0x323a3a[_0x11c0a0][_0x4f49('0x73')]],'%s',_0x5c5d2):_0x5c5d2;_0x5c5d2=_0x323a3a[_0x11c0a0][_0x4f49('0x75')]?_[_0x4f49('0x74')](_0x2902a1[_0x323a3a[_0x11c0a0][_0x4f49('0x75')]],'%s',_0x5c5d2):_0x5c5d2;if(_0x323a3a[_0x11c0a0][_0x4f49('0x8d')]){_0xa880a2[_0x4f49('0x66')](_0x5c5d2);}_0x323a3a[_0x11c0a0][_0x4f49('0x76')]&&_0xa880a2[_0x4f49('0x3e')](_0x5c5d2,_0x323a3a[_0x11c0a0]['orderBy']===_0x4f49('0x77')?![]:!![]);_0xa880a2[_0x4f49('0x67')](_0x5c5d2,_0x323a3a[_0x11c0a0][_0x4f49('0x78')]||_0x5c5d2);}if(_0xd253ed[_0x4f49('0x79')]){_0xd253ed['joins']=JSON[_0x4f49('0x7a')](_0xd253ed[_0x4f49('0x79')]);for(var _0x594460=0x0;_0x594460<_0xd253ed[_0x4f49('0x79')]['length'];_0x594460+=0x1){if(_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x33')]&&_[_0x4f49('0x62')](_0x5d52ae,_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x33')])&&_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x7d')]&&_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x7b')]&&_0xd253ed[_0x4f49('0x79')][_0x594460]['foreignKey']){_0xa880a2[_0xd253ed['joins'][_0x594460][_0x4f49('0x33')]](_0xd253ed['joins'][_0x594460][_0x4f49('0x7b')],null,util[_0x4f49('0x75')]('%s.%s\x20=\x20%s.%s',_0xd253ed['table'],_0xd253ed[_0x4f49('0x79')][_0x594460]['parentKey'],_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x7b')],_0xd253ed[_0x4f49('0x79')][_0x594460]['foreignKey']));}}}if(_0xd253ed[_0x4f49('0x7f')]){_0xd253ed['conditions']=JSON[_0x4f49('0x7a')](_0xd253ed[_0x4f49('0x7f')]);_0xa880a2[_0x4f49('0x40')](_0x351a33(_0xd253ed['conditions'][_0x4f49('0x66')]));}_0x64f0ee=_0xa880a2[_0x4f49('0x8e')]();_0xa880a2[_0x4f49('0x1e')](_0x5c33c9);_0xa880a2['offset'](0x0);return;}})['then'](function(){if(_0x16cb4d[_0x4f49('0x8f')]==='web'){return null;}var _0x2bc9df=_[_0x4f49('0x43')](_0x16cb4d,{'name':_0x16cb4d[_0x4f49('0x90')]||_0x16cb4d['name']||_0xd253ed[_0x4f49('0x2c')],'basename':_0x289810,'savename':util['format'](_0x4f49('0x91'),_0x16cb4d[_0x4f49('0x2c')]||_0xd253ed[_0x4f49('0x2c')],require('randomstring')[_0x4f49('0x92')](0x4),_0x16cb4d[_0x4f49('0x8f')]||_0x4f49('0x93')),'reportId':_0xd253ed['id'],'reportType':_0x4f49('0x94')});return db[_0x4f49('0x95')][_0x4f49('0x4c')](_0x2bc9df,{'raw':!![]});})['then'](function(_0x5b6ac7){if(_0xd253ed[_0x4f49('0x70')]===_0x4f49('0x96')){_0x64f0ee[_0x4f49('0x40')](_0xd253ed[_0x4f49('0x70')]+_0x4f49('0x97'),_0x16cb4d[_0x4f49('0x98')],_0x16cb4d[_0x4f49('0x99')]);}else{_0x64f0ee[_0x4f49('0x40')](_0xd253ed[_0x4f49('0x70')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x16cb4d[_0x4f49('0x98')],_0x16cb4d[_0x4f49('0x99')]);}if(_0x5b6ac7){logger[_0x4f49('0x9a')]('Run\x20Query:',_0x64f0ee[_0x4f49('0x83')]());require(_0x4f49('0x9b'))[_0x4f49('0x9c')](path['join'](__dirname,_0x4f49('0x9d'),_0x5b6ac7[_0x4f49('0x8f')]),[_0x5b6ac7['id'],_0x64f0ee[_0x4f49('0x83')](),path['join'](__dirname,_0x4f49('0x9e'),_0x5b6ac7[_0x4f49('0x9f')]),_0x289810]);return _0x5b6ac7;}else{var _0x5efb11=squel['select']();_0x5efb11[_0x4f49('0x6f')]('('+_0x64f0ee[_0x4f49('0x83')]()+')',_0x4f49('0xa0'));_0x5efb11[_0x4f49('0x67')](_0x4f49('0xa1'),_0x4f49('0x20'));_0x64f0ee['limit'](_0x16cb4d['limit']||_0x5c33c9);_0x64f0ee['offset'](_0x16cb4d[_0x4f49('0x1d')]||0x0);return dbH[_0x4f49('0x82')]['query'](_0x5efb11[_0x4f49('0x83')](),{'type':dbH[_0x4f49('0x82')][_0x4f49('0x84')]['SELECT']})['then'](function(_0x3633b5){if(!_0x3633b5['length']){_0x3a26ff=0x0;}else{_0x3a26ff=_0x3633b5[0x0][_0x4f49('0x20')]||0x0;}return dbH[_0x4f49('0x82')][_0x4f49('0x36')](_0x64f0ee[_0x4f49('0x83')](),{'type':dbH[_0x4f49('0x82')]['QueryTypes'][_0x4f49('0xa2')]});})[_0x4f49('0x26')](function(_0x45c938){return{'rows':_0x45c938||[],'count':_0x3a26ff};});}});}exports[_0x4f49('0xa3')]=function(_0x4a4d75,_0x93e85d){return runReport(_0x4a4d75[_0x4f49('0x54')],_0x4a4d75['query'],_0x4a4d75[_0x4f49('0x45')])[_0x4f49('0x26')](respondWithResult(_0x93e85d,null))[_0x4f49('0x48')](handleError(_0x93e85d,null));};exports[_0x4f49('0xa4')]=runReport;exports[_0x4f49('0x36')]=function(_0x40991b,_0x56290f){var _0x4994b6=0xa;var _0x1c7d87=[_0x4f49('0x55'),_0x4f49('0x56'),_0x4f49('0x85'),_0x4f49('0x57')];var _0x5cd00a={'SUM':_0x4f49('0x86'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4f49('0x58'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x4f49('0x5b'),'GROUP_CONCAT':_0x4f49('0x5c'),'GROUP_CONCAT ASC':_0x4f49('0x87'),'GROUP_CONCAT DESC':_0x4f49('0x5d')};var _0xd876f1={'SEC_TO_TIME':_0x4f49('0x5e'),'DATE':_0x4f49('0x5f'),'HOUR':'HOUR(%s)','ROUND':_0x4f49('0x88'),'UNIX_TIMESTAMP':_0x4f49('0x61')};var _0x1ae2c9=function(_0x566634){return!_[_0x4f49('0x62')]([_0x4f49('0x89'),_0x4f49('0x63'),'IS\x20EMPTY',_0x4f49('0xa5')],_0x566634);};var _0x541dc2=function(_0x4061bf){if(!_0x4061bf||!_0x4061bf[_0x4f49('0x65')][_0x4f49('0x3c')]){return'';}for(var _0x1bc18d='(',_0x5e6103=0x0;_0x5e6103<_0x4061bf[_0x4f49('0x65')][_0x4f49('0x3c')];_0x5e6103+=0x1){_0x5e6103>0x0&&(_0x1bc18d+='\x20'+_0x4061bf[_0x4f49('0x8a')]+'\x20');_0x1bc18d+=_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x66')]?_0x541dc2(_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x66')]):_0x4061bf[_0x4f49('0x65')][_0x5e6103]['field']+'\x20'+_0x4061bf['rules'][_0x5e6103][_0x4f49('0x8b')]+(_0x1ae2c9(_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x8b')])?'\x20'+_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x68')]:'');}return _0x1bc18d+')';};var _0x29dbab={'where':{'id':_0x40991b[_0x4f49('0x54')]['id']}},_0x5f459b,_0x1d090f,_0x37d2f4,_0x5bcb36,_0x3f04fa;_0x29dbab=_[_0x4f49('0x43')]({},_0x29dbab,_0x40991b['options']);return db['AnalyticDefaultReport'][_0x4f49('0x4b')](_0x29dbab)[_0x4f49('0x26')](function(_0x200848){if(_0x200848){_0x5f459b=_0x200848;return _0x200848['getFields']();}return null;})[_0x4f49('0x26')](function(_0x48f4bc){if(_0x48f4bc){if(!_0x48f4bc[_0x4f49('0x3c')]){throw new db['Sequelize'][(_0x4f49('0x6a'))](_0x4f49('0x6b'),0x193);}_0x1d090f=_0x48f4bc;return db['AnalyticMetric'][_0x4f49('0x47')]({'raw':!![]});}return null;})[_0x4f49('0x26')](function(_0x513bc9){if(_0x513bc9){_0x37d2f4=_[_0x4f49('0x6d')](_0x513bc9,'id');var _0x47567c;var _0x5f1538=squel[_0x4f49('0x6e')]();_0x5f1538[_0x4f49('0x6f')](_0x5f459b[_0x4f49('0x70')]);for(var _0xd91e48=0x0;_0xd91e48<_0x1d090f[_0x4f49('0x3c')];_0xd91e48+=0x1){_0x47567c=_0x1d090f[_0xd91e48][_0x4f49('0x71')]?_0x37d2f4[_0x1d090f[_0xd91e48]['MetricId']][_0x4f49('0x72')]:_0x1d090f[_0xd91e48][_0x4f49('0x67')];_0x47567c=_0x1d090f[_0xd91e48][_0x4f49('0x73')]?_['replace'](_0x5cd00a[_0x1d090f[_0xd91e48][_0x4f49('0x73')]],'%s',_0x47567c):_0x47567c;_0x47567c=_0x1d090f[_0xd91e48][_0x4f49('0x75')]?_[_0x4f49('0x74')](_0xd876f1[_0x1d090f[_0xd91e48][_0x4f49('0x75')]],'%s',_0x47567c):_0x47567c;if(_0x1d090f[_0xd91e48][_0x4f49('0x8d')]){_0x5f1538[_0x4f49('0x66')](_0x47567c);}_0x1d090f[_0xd91e48][_0x4f49('0x76')]&&_0x5f1538['order'](_0x47567c,_0x1d090f[_0xd91e48][_0x4f49('0x76')]==='DESC'?![]:!![]);_0x5f1538['field'](_0x47567c,_0x1d090f[_0xd91e48][_0x4f49('0x78')]||_0x47567c);}if(_0x5f459b['joins']){_0x5f459b[_0x4f49('0x79')]=JSON[_0x4f49('0x7a')](_0x5f459b[_0x4f49('0x79')]);for(var _0x85eb3f=0x0;_0x85eb3f<_0x5f459b[_0x4f49('0x79')][_0x4f49('0x3c')];_0x85eb3f+=0x1){if(_0x5f459b['joins'][_0x85eb3f][_0x4f49('0x33')]&&_[_0x4f49('0x62')](_0x1c7d87,_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x33')])&&_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7d')]&&_0x5f459b[_0x4f49('0x79')][_0x85eb3f]['foreignTable']&&_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7e')]){_0x5f1538[_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x33')]](_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7b')],null,util[_0x4f49('0x75')](_0x4f49('0x7c'),_0x5f459b[_0x4f49('0x70')],_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7d')],_0x5f459b[_0x4f49('0x79')][_0x85eb3f]['foreignTable'],_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7e')]));}}}if(_0x5f459b['conditions']){_0x5f459b[_0x4f49('0x7f')]=JSON[_0x4f49('0x7a')](_0x5f459b[_0x4f49('0x7f')]);_0x5f1538[_0x4f49('0x40')](_0x541dc2(_0x5f459b[_0x4f49('0x7f')][_0x4f49('0x66')]));}_0x3f04fa=_0x5f1538['clone']();_0x5f1538['limit'](_0x4994b6);_0x5f1538['offset'](0x0);logger['debug'](_0x4f49('0x81'),_0x5f1538['toString']());return dbH[_0x4f49('0x82')][_0x4f49('0x36')](_0x5f1538[_0x4f49('0x83')](),{'type':dbH[_0x4f49('0x82')][_0x4f49('0x84')][_0x4f49('0xa2')]});}})['then'](function(){return{'sql':_0x3f04fa[_0x4f49('0x83')]()};})['then'](respondWithResult(_0x56290f,null))[_0x4f49('0x48')](handleError(_0x56290f,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index edc17d2..90cd398 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 _0xb79b=['./analyticDefaultReport.attributes','exports','AnalyticDefaultReport','analytics_default_reports','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x142504,_0x351032){var _0x1bc24a=function(_0x3ff32f){while(--_0x3ff32f){_0x142504['push'](_0x142504['shift']());}};_0x1bc24a(++_0x351032);}(_0xb79b,0x88));var _0xbb79=function(_0x97c5fa,_0x32aa7c){_0x97c5fa=_0x97c5fa-0x0;var _0x1e9d94=_0xb79b[_0x97c5fa];return _0x1e9d94;};'use strict';var _=require('lodash');var util=require(_0xbb79('0x0'));var logger=require(_0xbb79('0x1'))(_0xbb79('0x2'));var moment=require(_0xbb79('0x3'));var BPromise=require(_0xbb79('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbb79('0x5'));var rimraf=require(_0xbb79('0x6'));var config=require(_0xbb79('0x7'));var attributes=require(_0xbb79('0x8'));module[_0xbb79('0x9')]=function(_0x2010b5,_0x161b77){return _0x2010b5['define'](_0xbb79('0xa'),attributes,{'tableName':_0xbb79('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4e39=['request-promise','path','rimraf','../../config/environment','define','AnalyticDefaultReport','analytics_default_reports','util','api','moment','bluebird'];(function(_0x236d24,_0x29e80a){var _0x1574cf=function(_0x5d1dad){while(--_0x5d1dad){_0x236d24['push'](_0x236d24['shift']());}};_0x1574cf(++_0x29e80a);}(_0x4e39,0xf9));var _0x94e3=function(_0x5b3b9b,_0x1c71b0){_0x5b3b9b=_0x5b3b9b-0x0;var _0x47c1d7=_0x4e39[_0x5b3b9b];return _0x47c1d7;};'use strict';var _=require('lodash');var util=require(_0x94e3('0x0'));var logger=require('../../config/logger')(_0x94e3('0x1'));var moment=require(_0x94e3('0x2'));var BPromise=require(_0x94e3('0x3'));var rp=require(_0x94e3('0x4'));var fs=require('fs');var path=require(_0x94e3('0x5'));var rimraf=require(_0x94e3('0x6'));var config=require(_0x94e3('0x7'));var attributes=require('./analyticDefaultReport.attributes');module['exports']=function(_0x5e7da8,_0x2a7bf1){return _0x5e7da8[_0x94e3('0x8')](_0x94e3('0x9'),attributes,{'tableName':_0x94e3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index ceec864..f311d52 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 _0x709e=['then','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','code','error','message','info','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x1443ad,_0x353e8e){var _0x4ab7e6=function(_0x139525){while(--_0x139525){_0x1443ad['push'](_0x1443ad['shift']());}};_0x4ab7e6(++_0x353e8e);}(_0x709e,0x16b));var _0xe709=function(_0x2dd30f,_0x458a88){_0x2dd30f=_0x2dd30f-0x0;var _0x4d5d48=_0x709e[_0x2dd30f];return _0x4d5d48;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe709('0x0'));var BPromise=require(_0xe709('0x1'));var rs=require(_0xe709('0x2'));var fs=require('fs');var Redis=require(_0xe709('0x3'));var db=require(_0xe709('0x4'))['db'];var utils=require(_0xe709('0x5'));var logger=require(_0xe709('0x6'))(_0xe709('0x7'));var config=require(_0xe709('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe709('0x9')][_0xe709('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e878c,_0x57d87a,_0x17ffba){return new BPromise(function(_0x221047,_0x5124bf){return client['request'](_0x1e878c,_0x17ffba)[_0xe709('0xb')](function(_0x22ea67){logger['info'](_0xe709('0xc'),_0x57d87a,_0xe709('0xd'));logger[_0xe709('0xe')](_0xe709('0xf'),_0x57d87a,_0xe709('0xd'),JSON['stringify'](_0x22ea67));if(_0x22ea67['error']){if(_0x22ea67['error'][_0xe709('0x10')]===0x1f4){logger[_0xe709('0x11')](_0xe709('0xc'),_0x57d87a,_0x22ea67[_0xe709('0x11')][_0xe709('0x12')]);return _0x5124bf(_0x22ea67['error'][_0xe709('0x12')]);}logger[_0xe709('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x57d87a,_0x22ea67[_0xe709('0x11')]['message']);return _0x221047(_0x22ea67[_0xe709('0x11')][_0xe709('0x12')]);}else{logger[_0xe709('0x13')](_0xe709('0xc'),_0x57d87a,_0xe709('0xd'));_0x221047(_0x22ea67[_0xe709('0x14')][_0xe709('0x12')]);}})[_0xe709('0x15')](function(_0x3d7cc2){logger[_0xe709('0x11')](_0xe709('0xc'),_0x57d87a,_0x3d7cc2);_0x5124bf(_0x3d7cc2);});});} \ No newline at end of file +var _0x1733=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','lodash','util','moment'];(function(_0x256c8c,_0xe780c7){var _0x5f3bb=function(_0x170d04){while(--_0x170d04){_0x256c8c['push'](_0x256c8c['shift']());}};_0x5f3bb(++_0xe780c7);}(_0x1733,0x110));var _0x3173=function(_0x3b2534,_0x4d55a5){_0x3b2534=_0x3b2534-0x0;var _0x3cbe9a=_0x1733[_0x3b2534];return _0x3cbe9a;};'use strict';var _=require(_0x3173('0x0'));var util=require(_0x3173('0x1'));var moment=require(_0x3173('0x2'));var BPromise=require(_0x3173('0x3'));var rs=require(_0x3173('0x4'));var fs=require('fs');var Redis=require(_0x3173('0x5'));var db=require(_0x3173('0x6'))['db'];var utils=require(_0x3173('0x7'));var logger=require(_0x3173('0x8'))(_0x3173('0x9'));var config=require(_0x3173('0xa'));var jayson=require(_0x3173('0xb'));var client=jayson[_0x3173('0xc')][_0x3173('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x542be6,_0x2c6aa1,_0x4b6033){return new BPromise(function(_0x5e2bba,_0x16465e){return client[_0x3173('0xe')](_0x542be6,_0x4b6033)[_0x3173('0xf')](function(_0x36b279){logger['info'](_0x3173('0x10'),_0x2c6aa1,_0x3173('0x11'));logger[_0x3173('0x12')](_0x3173('0x13'),_0x2c6aa1,_0x3173('0x11'),JSON[_0x3173('0x14')](_0x36b279));if(_0x36b279[_0x3173('0x15')]){if(_0x36b279['error'][_0x3173('0x16')]===0x1f4){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x2c6aa1,_0x36b279[_0x3173('0x15')][_0x3173('0x17')]);return _0x16465e(_0x36b279[_0x3173('0x15')][_0x3173('0x17')]);}logger[_0x3173('0x15')](_0x3173('0x10'),_0x2c6aa1,_0x36b279['error'][_0x3173('0x17')]);return _0x5e2bba(_0x36b279[_0x3173('0x15')][_0x3173('0x17')]);}else{logger[_0x3173('0x18')](_0x3173('0x10'),_0x2c6aa1,'request\x20sent');_0x5e2bba(_0x36b279['result'][_0x3173('0x17')]);}})['catch'](function(_0x2e5920){logger[_0x3173('0x15')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x2c6aa1,_0x2e5920);_0x16465e(_0x2e5920);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 872789b..e11a02b 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 _0x0bfd=['fs-extra','../../components/auth/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','/:id/run','run','/:id/query','query','post','create','put','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0x0bfd,0x10f));var _0xd0bf=function(_0x4f906e,_0x2f3c6b){_0x4f906e=_0x4f906e-0x0;var _0x4d68e5=_0x0bfd[_0x4f906e];return _0x4d68e5;};'use strict';var multer=require(_0xd0bf('0x0'));var util=require(_0xd0bf('0x1'));var path=require('path');var timeout=require(_0xd0bf('0x2'));var express=require(_0xd0bf('0x3'));var router=express[_0xd0bf('0x4')]();var fs_extra=require(_0xd0bf('0x5'));var auth=require(_0xd0bf('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd0bf('0x7'));var controller=require(_0xd0bf('0x8'));router[_0xd0bf('0x9')]('/',auth[_0xd0bf('0xa')](),controller[_0xd0bf('0xb')]);router['get'](_0xd0bf('0xc'),auth['isAuthenticated'](),controller[_0xd0bf('0xd')]);router['get']('/:id/preview',auth['isAuthenticated'](),controller['preview']);router[_0xd0bf('0x9')](_0xd0bf('0xe'),auth['isAuthenticated'](),controller[_0xd0bf('0xf')]);router[_0xd0bf('0x9')](_0xd0bf('0x10'),auth[_0xd0bf('0xa')](),controller[_0xd0bf('0x11')]);router[_0xd0bf('0x12')]('/',auth['isAuthenticated'](),controller[_0xd0bf('0x13')]);router[_0xd0bf('0x14')](_0xd0bf('0xc'),auth[_0xd0bf('0xa')](),controller['update']);router['delete'](_0xd0bf('0xc'),auth[_0xd0bf('0xa')](),controller[_0xd0bf('0x15')]);module[_0xd0bf('0x16')]=router; \ No newline at end of file +var _0xf59d=['preview','/:id/run','isAuthenticated','/:id/query','query','post','create','put','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','/:id','/:id/preview'];(function(_0x212bf5,_0x165cbd){var _0xfcad21=function(_0x4a4e6e){while(--_0x4a4e6e){_0x212bf5['push'](_0x212bf5['shift']());}};_0xfcad21(++_0x165cbd);}(_0xf59d,0x13f));var _0xdf59=function(_0x5a69ab,_0x610049){_0x5a69ab=_0x5a69ab-0x0;var _0x27f2f7=_0xf59d[_0x5a69ab];return _0x27f2f7;};'use strict';var multer=require(_0xdf59('0x0'));var util=require('util');var path=require(_0xdf59('0x1'));var timeout=require(_0xdf59('0x2'));var express=require(_0xdf59('0x3'));var router=express[_0xdf59('0x4')]();var fs_extra=require(_0xdf59('0x5'));var auth=require(_0xdf59('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xdf59('0x7'));var controller=require('./analyticDefaultReport.controller');router[_0xdf59('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xdf59('0x8')](_0xdf59('0x9'),auth['isAuthenticated'](),controller['show']);router[_0xdf59('0x8')](_0xdf59('0xa'),auth['isAuthenticated'](),controller[_0xdf59('0xb')]);router[_0xdf59('0x8')](_0xdf59('0xc'),auth[_0xdf59('0xd')](),controller['run']);router['get'](_0xdf59('0xe'),auth['isAuthenticated'](),controller[_0xdf59('0xf')]);router[_0xdf59('0x10')]('/',auth[_0xdf59('0xd')](),controller[_0xdf59('0x11')]);router[_0xdf59('0x12')](_0xdf59('0x9'),auth['isAuthenticated'](),controller[_0xdf59('0x13')]);router[_0xdf59('0x14')](_0xdf59('0x9'),auth[_0xdf59('0xd')](),controller['destroy']);module[_0xdf59('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index eb3a148..65f7e48 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 _0x4578=['Loading','ENUM','manual','UNSIGNED','sequelize','exports','STRING','csv','pdf','xlsx','DATE'];(function(_0xf7e53b,_0x203bf2){var _0x15734b=function(_0x5b9153){while(--_0x5b9153){_0xf7e53b['push'](_0xf7e53b['shift']());}};_0x15734b(++_0x203bf2);}(_0x4578,0x1f3));var _0x8457=function(_0x43cd9f,_0x57d758){_0x43cd9f=_0x43cd9f-0x0;var _0x5cf244=_0x4578[_0x43cd9f];return _0x5cf244;};'use strict';var Sequelize=require(_0x8457('0x0'));var moment=require('moment');module[_0x8457('0x1')]={'name':{'type':Sequelize[_0x8457('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x8457('0x2')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x8457('0x3'),_0x8457('0x4'),_0x8457('0x5')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x8457('0x2')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x8457('0x6')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0x8457('0x7')},'type':{'type':Sequelize[_0x8457('0x8')]('manual','scheduled'),'allowNull':![],'defaultValue':_0x8457('0x9')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x8457('0xa')]},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb4b9=['manual','scheduled','INTEGER','exports','ENUM','csv','xlsx','STRING'];(function(_0x5a6881,_0x2ee48b){var _0x530c8c=function(_0x102b10){while(--_0x102b10){_0x5a6881['push'](_0x5a6881['shift']());}};_0x530c8c(++_0x2ee48b);}(_0xb4b9,0xe3));var _0x9b4b=function(_0x2f0444,_0x591d1c){_0x2f0444=_0x2f0444-0x0;var _0x2f2bc5=_0xb4b9[_0x2f0444];return _0x2f2bc5;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x9b4b('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x9b4b('0x1')](_0x9b4b('0x2'),'pdf',_0x9b4b('0x3')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x9b4b('0x4')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x9b4b('0x4')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x9b4b('0x1')](_0x9b4b('0x5'),_0x9b4b('0x6')),'allowNull':![],'defaultValue':_0x9b4b('0x5')},'reportId':{'type':Sequelize[_0x9b4b('0x7')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x9b4b('0x4')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 09c2bb9..8fc7ddf 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 _0x257e=['nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','catch','show','params','includeAll','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','ExtractedReports','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','download','basename','savename','existsSync','join','root','server/files/reports','Sequelize','ValidationError','%s.%s','output','toLowerCase','eml-format','rimraf','request-promise','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','update','then','get','UserProfileResource','destroy','error','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','fields','length','hasOwnProperty'];(function(_0x48051b,_0x339115){var _0x2a4f6e=function(_0x5b7756){while(--_0x5b7756){_0x48051b['push'](_0x48051b['shift']());}};_0x2a4f6e(++_0x339115);}(_0x257e,0x1e5));var _0xe257=function(_0x39c734,_0x2f3e06){_0x39c734=_0x39c734-0x0;var _0xb2a2f9=_0x257e[_0x39c734];return _0xb2a2f9;};'use strict';var emlformat=require(_0xe257('0x0'));var rimraf=require(_0xe257('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe257('0x2'));var moment=require('moment');var BPromise=require(_0xe257('0x3'));var Mustache=require('mustache');var util=require(_0xe257('0x4'));var path=require(_0xe257('0x5'));var sox=require(_0xe257('0x6'));var csv=require(_0xe257('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe257('0x8'));var _=require(_0xe257('0x9'));var squel=require(_0xe257('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe257('0x7'));var querystring=require(_0xe257('0xb'));var Papa=require(_0xe257('0xc'));var Redis=require(_0xe257('0xd'));var authService=require(_0xe257('0xe'));var qs=require(_0xe257('0xf'));var as=require(_0xe257('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe257('0x11'))(_0xe257('0x12'));var utils=require(_0xe257('0x13'));var config=require(_0xe257('0x14'));var licenseUtil=require(_0xe257('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x39ca75,_0x4692c5){_0x4692c5=_0x4692c5||0xcc;return function(_0x2e0bb9){if(_0x2e0bb9){return _0x39ca75[_0xe257('0x16')](_0x4692c5);}return _0x39ca75[_0xe257('0x17')](_0x4692c5)[_0xe257('0x18')]();};}function respondWithResult(_0x2f1fb9,_0x3c2402){_0x3c2402=_0x3c2402||0xc8;return function(_0x3eef32){if(_0x3eef32){return _0x2f1fb9['status'](_0x3c2402)[_0xe257('0x19')](_0x3eef32);}};}function respondWithFilteredResult(_0x3298d9,_0x27c490){return function(_0x2baaf0){if(_0x2baaf0){var _0x59c15f=typeof _0x27c490[_0xe257('0x1a')]===_0xe257('0x1b')&&typeof _0x27c490[_0xe257('0x1c')]===_0xe257('0x1b');var _0x32d1bf=_0x2baaf0['count'];var _0x10d90f=_0x59c15f?0x0:_0x27c490[_0xe257('0x1a')];var _0x1bc084=_0x59c15f?_0x2baaf0[_0xe257('0x1d')]:_0x27c490[_0xe257('0x1a')]+_0x27c490[_0xe257('0x1c')];var _0x3aac92;if(_0x1bc084>=_0x32d1bf){_0x1bc084=_0x32d1bf;_0x3aac92=0xc8;}else{_0x3aac92=0xce;}_0x3298d9['status'](_0x3aac92);return _0x3298d9['set']('Content-Range',_0x10d90f+'-'+_0x1bc084+'/'+_0x32d1bf)[_0xe257('0x19')](_0x2baaf0);}return null;};}function patchUpdates(_0x3601f5){return function(_0x2fe0b0){try{jsonpatch[_0xe257('0x1e')](_0x2fe0b0,_0x3601f5,!![]);}catch(_0x519109){return BPromise[_0xe257('0x1f')](_0x519109);}return _0x2fe0b0['save']();};}function saveUpdates(_0x2f6f8b,_0x39526e){return function(_0x5d498e){if(_0x5d498e){return _0x5d498e[_0xe257('0x20')](_0x2f6f8b)['then'](function(_0x2f87ac){return _0x2f87ac;});}return null;};}function removeEntity(_0x20708b,_0x5de55b){return function(_0x2e5f6e){if(_0x2e5f6e){return _0x2e5f6e['destroy']()[_0xe257('0x21')](function(){var _0x2101ac=_0x2e5f6e[_0xe257('0x22')]({'plain':!![]});var _0x4e99ef='ExtractedReports';return db[_0xe257('0x23')][_0xe257('0x24')]({'where':{'type':_0x4e99ef,'resourceId':_0x2101ac['id']}})[_0xe257('0x21')](function(){return _0x2e5f6e;});})['then'](function(){_0x20708b[_0xe257('0x17')](0xcc)[_0xe257('0x18')]();});}};}function handleEntityNotFound(_0x557f13,_0x49a67c){return function(_0x4c5b21){if(!_0x4c5b21){_0x557f13[_0xe257('0x16')](0x194);}return _0x4c5b21;};}function handleError(_0x2f18f3,_0x103935){_0x103935=_0x103935||0x1f4;return function(_0x418405){logger[_0xe257('0x25')](_0x418405['stack']);if(_0x418405[_0xe257('0x26')]){delete _0x418405[_0xe257('0x26')];}_0x2f18f3[_0xe257('0x17')](_0x103935)[_0xe257('0x27')](_0x418405);};}exports[_0xe257('0x28')]=function(_0x6bc037,_0x54978b){var _0x1ff781={},_0x3264b4={},_0x167e6c={'count':0x0,'rows':[]};var _0xa20955=_[_0xe257('0x29')](db[_0xe257('0x2a')][_0xe257('0x2b')],function(_0x24bb91){return{'name':_0x24bb91[_0xe257('0x2c')],'type':_0x24bb91[_0xe257('0x2d')][_0xe257('0x2e')]};});_0x3264b4[_0xe257('0x2f')]=_['map'](_0xa20955,_0xe257('0x26'));_0x3264b4['query']=_[_0xe257('0x30')](_0x6bc037[_0xe257('0x31')]);_0x3264b4[_0xe257('0x32')]=_['intersection'](_0x3264b4[_0xe257('0x2f')],_0x3264b4['query']);_0x1ff781[_0xe257('0x33')]=_['intersection'](_0x3264b4[_0xe257('0x2f')],qs['fields'](_0x6bc037[_0xe257('0x31')][_0xe257('0x34')]));_0x1ff781[_0xe257('0x33')]=_0x1ff781[_0xe257('0x33')][_0xe257('0x35')]?_0x1ff781[_0xe257('0x33')]:_0x3264b4[_0xe257('0x2f')];if(!_0x6bc037['query'][_0xe257('0x36')](_0xe257('0x37'))){_0x1ff781[_0xe257('0x1c')]=qs[_0xe257('0x1c')](_0x6bc037['query'][_0xe257('0x1c')]);_0x1ff781[_0xe257('0x1a')]=qs[_0xe257('0x1a')](_0x6bc037[_0xe257('0x31')][_0xe257('0x1a')]);}_0x1ff781[_0xe257('0x38')]=qs[_0xe257('0x39')](_0x6bc037[_0xe257('0x31')]['sort']);_0x1ff781[_0xe257('0x3a')]=qs[_0xe257('0x32')](_['pick'](_0x6bc037['query'],_0x3264b4[_0xe257('0x32')]),_0xa20955);if(_0x6bc037[_0xe257('0x31')][_0xe257('0x3b')]){_0x1ff781['where']=_[_0xe257('0x3c')](_0x1ff781[_0xe257('0x3a')],{'$or':_['map'](_0xa20955,function(_0x679863){if(_0x679863[_0xe257('0x2d')]!==_0xe257('0x3d')){var _0x35a352={};_0x35a352[_0x679863['name']]={'$like':'%'+_0x6bc037[_0xe257('0x31')][_0xe257('0x3b')]+'%'};return _0x35a352;}})});}_0x1ff781=_[_0xe257('0x3c')]({},_0x1ff781,_0x6bc037[_0xe257('0x3e')]);var _0x2b4317={'where':_0x1ff781[_0xe257('0x3a')]};return db[_0xe257('0x2a')][_0xe257('0x1d')](_0x2b4317)[_0xe257('0x21')](function(_0x32c707){_0x167e6c[_0xe257('0x1d')]=_0x32c707;if(_0x6bc037[_0xe257('0x31')]['includeAll']){_0x1ff781[_0xe257('0x3f')]=[{'all':!![]}];}return db[_0xe257('0x2a')]['findAll'](_0x1ff781);})[_0xe257('0x21')](function(_0x10f611){_0x167e6c['rows']=_0x10f611;return _0x167e6c;})[_0xe257('0x21')](respondWithFilteredResult(_0x54978b,_0x1ff781))[_0xe257('0x40')](handleError(_0x54978b,null));};exports[_0xe257('0x41')]=function(_0x37d7dd,_0x58e5f5){var _0x2122a8={'raw':!![],'where':{'id':_0x37d7dd[_0xe257('0x42')]['id']}},_0x103dbf={};_0x103dbf[_0xe257('0x2f')]=_[_0xe257('0x30')](db[_0xe257('0x2a')][_0xe257('0x2b')]);_0x103dbf['query']=_[_0xe257('0x30')](_0x37d7dd[_0xe257('0x31')]);_0x103dbf[_0xe257('0x32')]=_['intersection'](_0x103dbf[_0xe257('0x2f')],_0x103dbf[_0xe257('0x31')]);_0x2122a8[_0xe257('0x33')]=_['intersection'](_0x103dbf[_0xe257('0x2f')],qs[_0xe257('0x34')](_0x37d7dd[_0xe257('0x31')][_0xe257('0x34')]));_0x2122a8[_0xe257('0x33')]=_0x2122a8[_0xe257('0x33')][_0xe257('0x35')]?_0x2122a8[_0xe257('0x33')]:_0x103dbf[_0xe257('0x2f')];if(_0x37d7dd[_0xe257('0x31')][_0xe257('0x43')]){_0x2122a8[_0xe257('0x3f')]=[{'all':!![]}];}_0x2122a8=_[_0xe257('0x3c')]({},_0x2122a8,_0x37d7dd[_0xe257('0x3e')]);return db[_0xe257('0x2a')]['find'](_0x2122a8)[_0xe257('0x21')](handleEntityNotFound(_0x58e5f5,null))['then'](respondWithResult(_0x58e5f5,null))['catch'](handleError(_0x58e5f5,null));};exports[_0xe257('0x44')]=function(_0x301e53,_0x5d8c0e){return db['AnalyticExtractedReport'][_0xe257('0x44')](_0x301e53[_0xe257('0x45')],{})[_0xe257('0x21')](function(_0x587292){var _0x2ae1fe=_0x301e53['user'][_0xe257('0x22')]({'plain':!![]});if(!_0x2ae1fe)throw new Error(_0xe257('0x46'));if(_0x2ae1fe[_0xe257('0x47')]===_0xe257('0x48')){var _0x511b8c=_0x587292[_0xe257('0x22')]({'plain':!![]});var _0x57dfce=_0xe257('0x49');return db[_0xe257('0x4a')]['find']({'where':{'name':_0x57dfce,'userProfileId':_0x2ae1fe['userProfileId']},'raw':!![]})[_0xe257('0x21')](function(_0x56f2ab){if(_0x56f2ab&&_0x56f2ab[_0xe257('0x4b')]===0x0){return db['UserProfileResource'][_0xe257('0x44')]({'name':_0x511b8c[_0xe257('0x26')],'resourceId':_0x511b8c['id'],'type':_0x56f2ab[_0xe257('0x26')],'sectionId':_0x56f2ab['id']},{})[_0xe257('0x21')](function(){return _0x587292;});}else{return _0x587292;}})['catch'](function(_0x3d96c8){logger[_0xe257('0x25')](_0xe257('0x4c'),_0x3d96c8);throw _0x3d96c8;});}return _0x587292;})['then'](respondWithResult(_0x5d8c0e,0xc9))['catch'](handleError(_0x5d8c0e,null));};exports['update']=function(_0x4a94aa,_0x5d0b31){if(_0x4a94aa[_0xe257('0x45')]['id']){delete _0x4a94aa[_0xe257('0x45')]['id'];}return db[_0xe257('0x2a')][_0xe257('0x4d')]({'where':{'id':_0x4a94aa[_0xe257('0x42')]['id']}})[_0xe257('0x21')](handleEntityNotFound(_0x5d0b31,null))['then'](saveUpdates(_0x4a94aa[_0xe257('0x45')],null))[_0xe257('0x21')](respondWithResult(_0x5d0b31,null))['catch'](handleError(_0x5d0b31,null));};exports['destroy']=function(_0x37a9b0,_0x572a78){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x37a9b0[_0xe257('0x42')]['id']}})[_0xe257('0x21')](handleEntityNotFound(_0x572a78,null))[_0xe257('0x21')](removeEntity(_0x572a78,null))['catch'](handleError(_0x572a78,null));};exports[_0xe257('0x4e')]=function(_0x347456,_0x4aa567,_0x2b8572){return db[_0xe257('0x2a')][_0xe257('0x4d')]({'where':{'id':_0x347456['params']['id']},'attributes':['name',_0xe257('0x4f'),_0xe257('0x50'),'output'],'raw':!![]})[_0xe257('0x21')](handleEntityNotFound(_0x4aa567,null))[_0xe257('0x21')](function(_0x29d263){if(_0x29d263){if(!fs[_0xe257('0x51')](path[_0xe257('0x52')](config[_0xe257('0x53')],_0xe257('0x54'),_0x29d263['savename']))){throw new db[(_0xe257('0x55'))][(_0xe257('0x56'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x347456[_0xe257('0x31')]['exists']){return _0x4aa567['sendStatus'](0xc8);}return _0x4aa567['download'](path[_0xe257('0x52')](config[_0xe257('0x53')],_0xe257('0x54'),_0x29d263['savename']),util['format'](_0xe257('0x57'),_0x29d263[_0xe257('0x4f')]||_0x29d263['name'],_0x29d263[_0xe257('0x58')][_0xe257('0x59')]()));}})[_0xe257('0x40')](handleError(_0x4aa567,null));}; \ No newline at end of file +var _0xbb24=['to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','ExtractedReports','UserProfileResource','end','sendStatus','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','output','existsSync','join','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','savename','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox'];(function(_0x5c84a5,_0x50392b){var _0xf8b167=function(_0x4328b6){while(--_0x4328b6){_0x5c84a5['push'](_0x5c84a5['shift']());}};_0xf8b167(++_0x50392b);}(_0xbb24,0xc3));var _0x4bb2=function(_0x33318f,_0xbead0){_0x33318f=_0x33318f-0x0;var _0x4348d0=_0xbb24[_0x33318f];return _0x4348d0;};'use strict';var emlformat=require(_0x4bb2('0x0'));var rimraf=require(_0x4bb2('0x1'));var zipdir=require(_0x4bb2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4bb2('0x3'));var moment=require(_0x4bb2('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4bb2('0x5'));var util=require(_0x4bb2('0x6'));var path=require(_0x4bb2('0x7'));var sox=require(_0x4bb2('0x8'));var csv=require(_0x4bb2('0x9'));var ejs=require(_0x4bb2('0xa'));var fs=require('fs');var fs_extra=require(_0x4bb2('0xb'));var _=require(_0x4bb2('0xc'));var squel=require(_0x4bb2('0xd'));var crypto=require(_0x4bb2('0xe'));var jsforce=require(_0x4bb2('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4bb2('0x10'));var Papa=require(_0x4bb2('0x11'));var Redis=require(_0x4bb2('0x12'));var authService=require(_0x4bb2('0x13'));var qs=require(_0x4bb2('0x14'));var as=require(_0x4bb2('0x15'));var hardwareService=require(_0x4bb2('0x16'));var logger=require('../../config/logger')(_0x4bb2('0x17'));var utils=require(_0x4bb2('0x18'));var config=require(_0x4bb2('0x19'));var licenseUtil=require(_0x4bb2('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x514d89,_0x19ca0a){_0x19ca0a=_0x19ca0a||0xcc;return function(_0x879038){if(_0x879038){return _0x514d89['sendStatus'](_0x19ca0a);}return _0x514d89[_0x4bb2('0x1b')](_0x19ca0a)['end']();};}function respondWithResult(_0x467a97,_0x54f67b){_0x54f67b=_0x54f67b||0xc8;return function(_0x4e3ac4){if(_0x4e3ac4){return _0x467a97[_0x4bb2('0x1b')](_0x54f67b)[_0x4bb2('0x1c')](_0x4e3ac4);}};}function respondWithFilteredResult(_0x371f5e,_0xee36a5){return function(_0x2d472e){if(_0x2d472e){var _0x1d825e=typeof _0xee36a5[_0x4bb2('0x1d')]===_0x4bb2('0x1e')&&typeof _0xee36a5[_0x4bb2('0x1f')]==='undefined';var _0x154ed3=_0x2d472e[_0x4bb2('0x20')];var _0x5b6f3b=_0x1d825e?0x0:_0xee36a5['offset'];var _0x1153f0=_0x1d825e?_0x2d472e[_0x4bb2('0x20')]:_0xee36a5[_0x4bb2('0x1d')]+_0xee36a5[_0x4bb2('0x1f')];var _0xf96f13;if(_0x1153f0>=_0x154ed3){_0x1153f0=_0x154ed3;_0xf96f13=0xc8;}else{_0xf96f13=0xce;}_0x371f5e['status'](_0xf96f13);return _0x371f5e[_0x4bb2('0x21')](_0x4bb2('0x22'),_0x5b6f3b+'-'+_0x1153f0+'/'+_0x154ed3)[_0x4bb2('0x1c')](_0x2d472e);}return null;};}function patchUpdates(_0x44e173){return function(_0x5b8548){try{jsonpatch[_0x4bb2('0x23')](_0x5b8548,_0x44e173,!![]);}catch(_0x45c918){return BPromise[_0x4bb2('0x24')](_0x45c918);}return _0x5b8548[_0x4bb2('0x25')]();};}function saveUpdates(_0x1c440f,_0x1cd421){return function(_0x5ce308){if(_0x5ce308){return _0x5ce308[_0x4bb2('0x26')](_0x1c440f)[_0x4bb2('0x27')](function(_0x1fe082){return _0x1fe082;});}return null;};}function removeEntity(_0x54697e,_0x2a5150){return function(_0x3b0a2d){if(_0x3b0a2d){return _0x3b0a2d[_0x4bb2('0x28')]()['then'](function(){var _0x13cff9=_0x3b0a2d[_0x4bb2('0x29')]({'plain':!![]});var _0x4225fc=_0x4bb2('0x2a');return db[_0x4bb2('0x2b')][_0x4bb2('0x28')]({'where':{'type':_0x4225fc,'resourceId':_0x13cff9['id']}})[_0x4bb2('0x27')](function(){return _0x3b0a2d;});})[_0x4bb2('0x27')](function(){_0x54697e[_0x4bb2('0x1b')](0xcc)[_0x4bb2('0x2c')]();});}};}function handleEntityNotFound(_0x1c5133,_0x36bc6e){return function(_0xad2ea7){if(!_0xad2ea7){_0x1c5133[_0x4bb2('0x2d')](0x194);}return _0xad2ea7;};}function handleError(_0x3aceca,_0x5cb612){_0x5cb612=_0x5cb612||0x1f4;return function(_0x3cb75b){logger[_0x4bb2('0x2e')](_0x3cb75b[_0x4bb2('0x2f')]);if(_0x3cb75b[_0x4bb2('0x30')]){delete _0x3cb75b['name'];}_0x3aceca[_0x4bb2('0x1b')](_0x5cb612)[_0x4bb2('0x31')](_0x3cb75b);};}exports[_0x4bb2('0x32')]=function(_0x23bfd1,_0x2780ef){var _0x440c84={},_0x560219={},_0x4f9943={'count':0x0,'rows':[]};var _0x4c1f9a=_[_0x4bb2('0x33')](db[_0x4bb2('0x34')][_0x4bb2('0x35')],function(_0x377d2c){return{'name':_0x377d2c[_0x4bb2('0x36')],'type':_0x377d2c[_0x4bb2('0x37')][_0x4bb2('0x38')]};});_0x560219[_0x4bb2('0x39')]=_[_0x4bb2('0x33')](_0x4c1f9a,'name');_0x560219['query']=_[_0x4bb2('0x3a')](_0x23bfd1['query']);_0x560219[_0x4bb2('0x3b')]=_['intersection'](_0x560219[_0x4bb2('0x39')],_0x560219[_0x4bb2('0x3c')]);_0x440c84[_0x4bb2('0x3d')]=_[_0x4bb2('0x3e')](_0x560219[_0x4bb2('0x39')],qs[_0x4bb2('0x3f')](_0x23bfd1[_0x4bb2('0x3c')][_0x4bb2('0x3f')]));_0x440c84[_0x4bb2('0x3d')]=_0x440c84[_0x4bb2('0x3d')][_0x4bb2('0x40')]?_0x440c84[_0x4bb2('0x3d')]:_0x560219['model'];if(!_0x23bfd1['query'][_0x4bb2('0x41')](_0x4bb2('0x42'))){_0x440c84[_0x4bb2('0x1f')]=qs[_0x4bb2('0x1f')](_0x23bfd1[_0x4bb2('0x3c')][_0x4bb2('0x1f')]);_0x440c84[_0x4bb2('0x1d')]=qs[_0x4bb2('0x1d')](_0x23bfd1[_0x4bb2('0x3c')][_0x4bb2('0x1d')]);}_0x440c84['order']=qs[_0x4bb2('0x43')](_0x23bfd1[_0x4bb2('0x3c')][_0x4bb2('0x43')]);_0x440c84[_0x4bb2('0x44')]=qs[_0x4bb2('0x3b')](_[_0x4bb2('0x45')](_0x23bfd1[_0x4bb2('0x3c')],_0x560219[_0x4bb2('0x3b')]),_0x4c1f9a);if(_0x23bfd1[_0x4bb2('0x3c')][_0x4bb2('0x46')]){_0x440c84[_0x4bb2('0x44')]=_[_0x4bb2('0x47')](_0x440c84[_0x4bb2('0x44')],{'$or':_[_0x4bb2('0x33')](_0x4c1f9a,function(_0x664866){if(_0x664866[_0x4bb2('0x37')]!==_0x4bb2('0x48')){var _0x12a4d1={};_0x12a4d1[_0x664866[_0x4bb2('0x30')]]={'$like':'%'+_0x23bfd1[_0x4bb2('0x3c')][_0x4bb2('0x46')]+'%'};return _0x12a4d1;}})});}_0x440c84=_['merge']({},_0x440c84,_0x23bfd1[_0x4bb2('0x49')]);var _0x494fb8={'where':_0x440c84[_0x4bb2('0x44')]};return db[_0x4bb2('0x34')]['count'](_0x494fb8)['then'](function(_0x594d01){_0x4f9943[_0x4bb2('0x20')]=_0x594d01;if(_0x23bfd1['query']['includeAll']){_0x440c84[_0x4bb2('0x4a')]=[{'all':!![]}];}return db[_0x4bb2('0x34')][_0x4bb2('0x4b')](_0x440c84);})[_0x4bb2('0x27')](function(_0x28cef3){_0x4f9943[_0x4bb2('0x4c')]=_0x28cef3;return _0x4f9943;})[_0x4bb2('0x27')](respondWithFilteredResult(_0x2780ef,_0x440c84))[_0x4bb2('0x4d')](handleError(_0x2780ef,null));};exports[_0x4bb2('0x4e')]=function(_0x53ad20,_0x160dc8){var _0x387e08={'raw':!![],'where':{'id':_0x53ad20[_0x4bb2('0x4f')]['id']}},_0x13baf6={};_0x13baf6[_0x4bb2('0x39')]=_[_0x4bb2('0x3a')](db[_0x4bb2('0x34')][_0x4bb2('0x35')]);_0x13baf6[_0x4bb2('0x3c')]=_[_0x4bb2('0x3a')](_0x53ad20['query']);_0x13baf6['filters']=_['intersection'](_0x13baf6[_0x4bb2('0x39')],_0x13baf6[_0x4bb2('0x3c')]);_0x387e08[_0x4bb2('0x3d')]=_['intersection'](_0x13baf6[_0x4bb2('0x39')],qs['fields'](_0x53ad20[_0x4bb2('0x3c')][_0x4bb2('0x3f')]));_0x387e08[_0x4bb2('0x3d')]=_0x387e08['attributes'][_0x4bb2('0x40')]?_0x387e08[_0x4bb2('0x3d')]:_0x13baf6[_0x4bb2('0x39')];if(_0x53ad20['query'][_0x4bb2('0x50')]){_0x387e08[_0x4bb2('0x4a')]=[{'all':!![]}];}_0x387e08=_['merge']({},_0x387e08,_0x53ad20[_0x4bb2('0x49')]);return db[_0x4bb2('0x34')][_0x4bb2('0x51')](_0x387e08)[_0x4bb2('0x27')](handleEntityNotFound(_0x160dc8,null))[_0x4bb2('0x27')](respondWithResult(_0x160dc8,null))['catch'](handleError(_0x160dc8,null));};exports[_0x4bb2('0x52')]=function(_0x1461bc,_0x2a2ba2){return db[_0x4bb2('0x34')][_0x4bb2('0x52')](_0x1461bc[_0x4bb2('0x53')],{})[_0x4bb2('0x27')](function(_0xc93ba1){var _0x447179=_0x1461bc['user'][_0x4bb2('0x29')]({'plain':!![]});if(!_0x447179)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x447179[_0x4bb2('0x54')]===_0x4bb2('0x55')){var _0x597511=_0xc93ba1[_0x4bb2('0x29')]({'plain':!![]});var _0xf55cc9=_0x4bb2('0x2a');return db[_0x4bb2('0x56')]['find']({'where':{'name':_0xf55cc9,'userProfileId':_0x447179['userProfileId']},'raw':!![]})[_0x4bb2('0x27')](function(_0x2bd24b){if(_0x2bd24b&&_0x2bd24b[_0x4bb2('0x57')]===0x0){return db[_0x4bb2('0x2b')]['create']({'name':_0x597511['name'],'resourceId':_0x597511['id'],'type':_0x2bd24b[_0x4bb2('0x30')],'sectionId':_0x2bd24b['id']},{})[_0x4bb2('0x27')](function(){return _0xc93ba1;});}else{return _0xc93ba1;}})[_0x4bb2('0x4d')](function(_0x5577c4){logger[_0x4bb2('0x2e')](_0x4bb2('0x58'),_0x5577c4);throw _0x5577c4;});}return _0xc93ba1;})[_0x4bb2('0x27')](respondWithResult(_0x2a2ba2,0xc9))[_0x4bb2('0x4d')](handleError(_0x2a2ba2,null));};exports[_0x4bb2('0x26')]=function(_0x37b7d9,_0x4adc1c){if(_0x37b7d9[_0x4bb2('0x53')]['id']){delete _0x37b7d9[_0x4bb2('0x53')]['id'];}return db[_0x4bb2('0x34')][_0x4bb2('0x51')]({'where':{'id':_0x37b7d9[_0x4bb2('0x4f')]['id']}})[_0x4bb2('0x27')](handleEntityNotFound(_0x4adc1c,null))[_0x4bb2('0x27')](saveUpdates(_0x37b7d9[_0x4bb2('0x53')],null))['then'](respondWithResult(_0x4adc1c,null))[_0x4bb2('0x4d')](handleError(_0x4adc1c,null));};exports[_0x4bb2('0x28')]=function(_0x535f8d,_0x5475cd){return db[_0x4bb2('0x34')]['find']({'where':{'id':_0x535f8d[_0x4bb2('0x4f')]['id']}})[_0x4bb2('0x27')](handleEntityNotFound(_0x5475cd,null))[_0x4bb2('0x27')](removeEntity(_0x5475cd,null))['catch'](handleError(_0x5475cd,null));};exports[_0x4bb2('0x59')]=function(_0x2155eb,_0x4d94fe,_0x157433){return db[_0x4bb2('0x34')]['find']({'where':{'id':_0x2155eb[_0x4bb2('0x4f')]['id']},'attributes':['name','basename','savename',_0x4bb2('0x5a')],'raw':!![]})[_0x4bb2('0x27')](handleEntityNotFound(_0x4d94fe,null))['then'](function(_0x390ddf){if(_0x390ddf){if(!fs[_0x4bb2('0x5b')](path[_0x4bb2('0x5c')](config['root'],_0x4bb2('0x5d'),_0x390ddf['savename']))){throw new db[(_0x4bb2('0x5e'))][(_0x4bb2('0x5f'))](_0x4bb2('0x60'));}if(_0x2155eb[_0x4bb2('0x3c')][_0x4bb2('0x61')]){return _0x4d94fe['sendStatus'](0xc8);}return _0x4d94fe[_0x4bb2('0x59')](path[_0x4bb2('0x5c')](config['root'],_0x4bb2('0x5d'),_0x390ddf[_0x4bb2('0x62')]),util[_0x4bb2('0x63')](_0x4bb2('0x64'),_0x390ddf['basename']||_0x390ddf[_0x4bb2('0x30')],_0x390ddf['output'][_0x4bb2('0x65')]()));}})[_0x4bb2('0x4d')](handleError(_0x4d94fe,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 51c26aa..d2dfd27 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 _0x0959=['api','moment','bluebird','request-promise','path','rimraf','exports','define','analytics_extracted_reports','util','../../config/logger'];(function(_0x11f78f,_0xbe78fb){var _0x5cd7a7=function(_0x1c87a6){while(--_0x1c87a6){_0x11f78f['push'](_0x11f78f['shift']());}};_0x5cd7a7(++_0xbe78fb);}(_0x0959,0x11c));var _0x9095=function(_0x2c0a62,_0x45d0b9){_0x2c0a62=_0x2c0a62-0x0;var _0x1d6922=_0x0959[_0x2c0a62];return _0x1d6922;};'use strict';var _=require('lodash');var util=require(_0x9095('0x0'));var logger=require(_0x9095('0x1'))(_0x9095('0x2'));var moment=require(_0x9095('0x3'));var BPromise=require(_0x9095('0x4'));var rp=require(_0x9095('0x5'));var fs=require('fs');var path=require(_0x9095('0x6'));var rimraf=require(_0x9095('0x7'));var config=require('../../config/environment');var attributes=require('./analyticExtractedReport.attributes');module[_0x9095('0x8')]=function(_0x362bd3,_0x4a7708){return _0x362bd3[_0x9095('0x9')]('AnalyticExtractedReport',attributes,{'tableName':_0x9095('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xad06=['api','moment','bluebird','path','rimraf','./analyticExtractedReport.attributes','AnalyticExtractedReport','analytics_extracted_reports','../../config/logger'];(function(_0x362046,_0x5cf93f){var _0x419ffe=function(_0x18cb42){while(--_0x18cb42){_0x362046['push'](_0x362046['shift']());}};_0x419ffe(++_0x5cf93f);}(_0xad06,0x155));var _0x6ad0=function(_0x42b72f,_0x326cc9){_0x42b72f=_0x42b72f-0x0;var _0x2fd490=_0xad06[_0x42b72f];return _0x2fd490;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6ad0('0x0'))(_0x6ad0('0x1'));var moment=require(_0x6ad0('0x2'));var BPromise=require(_0x6ad0('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6ad0('0x4'));var rimraf=require(_0x6ad0('0x5'));var config=require('../../config/environment');var attributes=require(_0x6ad0('0x6'));module['exports']=function(_0x22fb63,_0x2144b8){return _0x22fb63['define'](_0x6ad0('0x7'),attributes,{'tableName':_0x6ad0('0x8'),'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 bdd8e7b..fffefeb 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 _0x0176=['jayson/promise','client','http','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','moment','randomstring','../../mysqldb','../../config/environment'];(function(_0x4d934b,_0x52f8e9){var _0xc0338b=function(_0x1a356c){while(--_0x1a356c){_0x4d934b['push'](_0x4d934b['shift']());}};_0xc0338b(++_0x52f8e9);}(_0x0176,0x14f));var _0x6017=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0176[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x6017('0x0'));var util=require('util');var moment=require(_0x6017('0x1'));var BPromise=require('bluebird');var rs=require(_0x6017('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6017('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x6017('0x4'));var jayson=require(_0x6017('0x5'));var client=jayson[_0x6017('0x6')][_0x6017('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4e0e12,_0x26f6e7,_0x311051){return new BPromise(function(_0x47bd7d,_0x5935df){return client['request'](_0x4e0e12,_0x311051)[_0x6017('0x8')](function(_0x155a89){logger[_0x6017('0x9')](_0x6017('0xa'),_0x26f6e7,_0x6017('0xb'));logger['debug']('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x26f6e7,_0x6017('0xb'),JSON[_0x6017('0xc')](_0x155a89));if(_0x155a89[_0x6017('0xd')]){if(_0x155a89[_0x6017('0xd')][_0x6017('0xe')]===0x1f4){logger['error'](_0x6017('0xa'),_0x26f6e7,_0x155a89[_0x6017('0xd')][_0x6017('0xf')]);return _0x5935df(_0x155a89[_0x6017('0xd')][_0x6017('0xf')]);}logger['error'](_0x6017('0xa'),_0x26f6e7,_0x155a89['error'][_0x6017('0xf')]);return _0x47bd7d(_0x155a89[_0x6017('0xd')][_0x6017('0xf')]);}else{logger[_0x6017('0x9')](_0x6017('0xa'),_0x26f6e7,_0x6017('0xb'));_0x47bd7d(_0x155a89[_0x6017('0x10')][_0x6017('0xf')]);}})['catch'](function(_0x147ee9){logger[_0x6017('0xd')](_0x6017('0xa'),_0x26f6e7,_0x147ee9);_0x5935df(_0x147ee9);});});} \ No newline at end of file +var _0x0ac0=['ioredis','../../mysqldb','../../config/utils','../../config/logger','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','result','lodash','util','moment','randomstring'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x0ac0,0x130));var _0x00ac=function(_0x650e11,_0x284f86){_0x650e11=_0x650e11-0x0;var _0x1a9b47=_0x0ac0[_0x650e11];return _0x1a9b47;};'use strict';var _=require(_0x00ac('0x0'));var util=require(_0x00ac('0x1'));var moment=require(_0x00ac('0x2'));var BPromise=require('bluebird');var rs=require(_0x00ac('0x3'));var fs=require('fs');var Redis=require(_0x00ac('0x4'));var db=require(_0x00ac('0x5'))['db'];var utils=require(_0x00ac('0x6'));var logger=require(_0x00ac('0x7'))(_0x00ac('0x8'));var config=require(_0x00ac('0x9'));var jayson=require(_0x00ac('0xa'));var client=jayson['client'][_0x00ac('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xa2a17e,_0x3546f0,_0x282faa){return new BPromise(function(_0x4427de,_0x121a9e){return client[_0x00ac('0xc')](_0xa2a17e,_0x282faa)['then'](function(_0x48c47e){logger[_0x00ac('0xd')](_0x00ac('0xe'),_0x3546f0,_0x00ac('0xf'));logger[_0x00ac('0x10')](_0x00ac('0x11'),_0x3546f0,'request\x20sent',JSON[_0x00ac('0x12')](_0x48c47e));if(_0x48c47e['error']){if(_0x48c47e[_0x00ac('0x13')]['code']===0x1f4){logger[_0x00ac('0x13')](_0x00ac('0xe'),_0x3546f0,_0x48c47e[_0x00ac('0x13')][_0x00ac('0x14')]);return _0x121a9e(_0x48c47e['error']['message']);}logger[_0x00ac('0x13')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x3546f0,_0x48c47e['error'][_0x00ac('0x14')]);return _0x4427de(_0x48c47e[_0x00ac('0x13')]['message']);}else{logger[_0x00ac('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x3546f0,'request\x20sent');_0x4427de(_0x48c47e[_0x00ac('0x15')][_0x00ac('0x14')]);}})['catch'](function(_0x66e4ba){logger[_0x00ac('0x13')](_0x00ac('0xe'),_0x3546f0,_0x66e4ba);_0x121a9e(_0x66e4ba);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index e2bd430..06e931e 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 _0x87a2=['util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','isAuthenticated','index','get','/:id','/:id/download','download','post','update','delete','destroy','exports'];(function(_0x5001b4,_0x362ed5){var _0x44ffa7=function(_0x3a0a8e){while(--_0x3a0a8e){_0x5001b4['push'](_0x5001b4['shift']());}};_0x44ffa7(++_0x362ed5);}(_0x87a2,0xea));var _0x287a=function(_0x183256,_0x1a596d){_0x183256=_0x183256-0x0;var _0x5394a2=_0x87a2[_0x183256];return _0x5394a2;};'use strict';var multer=require('multer');var util=require(_0x287a('0x0'));var path=require('path');var timeout=require(_0x287a('0x1'));var express=require(_0x287a('0x2'));var router=express['Router']();var fs_extra=require(_0x287a('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x287a('0x4'));var config=require(_0x287a('0x5'));var controller=require(_0x287a('0x6'));router['get']('/',auth[_0x287a('0x7')](),controller[_0x287a('0x8')]);router[_0x287a('0x9')](_0x287a('0xa'),auth[_0x287a('0x7')](),controller['show']);router[_0x287a('0x9')](_0x287a('0xb'),auth[_0x287a('0x7')](),controller[_0x287a('0xc')]);router[_0x287a('0xd')]('/',auth[_0x287a('0x7')](),controller['create']);router['put'](_0x287a('0xa'),auth[_0x287a('0x7')](),controller[_0x287a('0xe')]);router[_0x287a('0xf')](_0x287a('0xa'),auth['isAuthenticated'](),controller[_0x287a('0x10')]);module[_0x287a('0x11')]=router; \ No newline at end of file +var _0x9959=['put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','/:id/download','download','post'];(function(_0x5a14f3,_0x303051){var _0x57de5d=function(_0xfcb8c5){while(--_0xfcb8c5){_0x5a14f3['push'](_0x5a14f3['shift']());}};_0x57de5d(++_0x303051);}(_0x9959,0x108));var _0x9995=function(_0x1a2603,_0x43182e){_0x1a2603=_0x1a2603-0x0;var _0x10f23a=_0x9959[_0x1a2603];return _0x10f23a;};'use strict';var multer=require(_0x9995('0x0'));var util=require(_0x9995('0x1'));var path=require(_0x9995('0x2'));var timeout=require(_0x9995('0x3'));var express=require(_0x9995('0x4'));var router=express[_0x9995('0x5')]();var fs_extra=require(_0x9995('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x9995('0x7'));var config=require('../../config/environment');var controller=require(_0x9995('0x8'));router[_0x9995('0x9')]('/',auth[_0x9995('0xa')](),controller[_0x9995('0xb')]);router[_0x9995('0x9')](_0x9995('0xc'),auth[_0x9995('0xa')](),controller['show']);router['get'](_0x9995('0xd'),auth[_0x9995('0xa')](),controller[_0x9995('0xe')]);router[_0x9995('0xf')]('/',auth[_0x9995('0xa')](),controller['create']);router[_0x9995('0x10')](_0x9995('0xc'),auth[_0x9995('0xa')](),controller[_0x9995('0x11')]);router[_0x9995('0x12')](_0x9995('0xc'),auth[_0x9995('0xa')](),controller['destroy']);module[_0x9995('0x13')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 6ddd46d..0884119 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 _0x8741=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0x294cf1,_0x5d6a40){var _0x334402=function(_0x5b07f0){while(--_0x5b07f0){_0x294cf1['push'](_0x294cf1['shift']());}};_0x334402(++_0x5d6a40);}(_0x8741,0x145));var _0x1874=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8741[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x1874('0x0'));module[_0x1874('0x1')]={'field':{'type':Sequelize[_0x1874('0x2')]},'alias':{'type':Sequelize[_0x1874('0x3')]},'function':{'type':Sequelize[_0x1874('0x3')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0x1874('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x1874('0x3')]},'custom':{'type':Sequelize[_0x1874('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0xa3cf=['TEXT','STRING','BOOLEAN'];(function(_0x3978e9,_0x202fbf){var _0x4c6581=function(_0x5016d1){while(--_0x5016d1){_0x3978e9['push'](_0x3978e9['shift']());}};_0x4c6581(++_0x202fbf);}(_0xa3cf,0xab));var _0xfa3c=function(_0x412163,_0x26445b){_0x412163=_0x412163-0x0;var _0x25cee9=_0xa3cf[_0x412163];return _0x25cee9;};'use strict';var Sequelize=require('sequelize');module['exports']={'field':{'type':Sequelize[_0xfa3c('0x0')]},'alias':{'type':Sequelize[_0xfa3c('0x1')]},'function':{'type':Sequelize[_0xfa3c('0x1')]},'format':{'type':Sequelize[_0xfa3c('0x1')]},'groupBy':{'type':Sequelize[_0xfa3c('0x2')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xfa3c('0x1')]},'custom':{'type':Sequelize[_0xfa3c('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index de2a043..743c875 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 _0x8b86=['bulkDestroy','destroy','ids','addFields','AnalyticCustomReport','sequelize','transaction','CustomReportId','eml-format','zip-dir','request-promise','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','status','end','json','limit','undefined','count','offset','Content-Range','apply','save','update','then','sendStatus','error','stack','name','send','AnalyticFieldReport','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','bulkCreate'];(function(_0x2daa0f,_0x55d9a7){var _0x54c30a=function(_0x4c29f7){while(--_0x4c29f7){_0x2daa0f['push'](_0x2daa0f['shift']());}};_0x54c30a(++_0x55d9a7);}(_0x8b86,0x140));var _0x68b8=function(_0x515f8e,_0x4aef2c){_0x515f8e=_0x515f8e-0x0;var _0x5553cd=_0x8b86[_0x515f8e];return _0x5553cd;};'use strict';var emlformat=require(_0x68b8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x68b8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x68b8('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x68b8('0x3'));var util=require(_0x68b8('0x4'));var path=require(_0x68b8('0x5'));var sox=require(_0x68b8('0x6'));var csv=require('to-csv');var ejs=require(_0x68b8('0x7'));var fs=require('fs');var fs_extra=require(_0x68b8('0x8'));var _=require(_0x68b8('0x9'));var squel=require(_0x68b8('0xa'));var crypto=require(_0x68b8('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x68b8('0xc'));var querystring=require(_0x68b8('0xd'));var Papa=require(_0x68b8('0xe'));var Redis=require('ioredis');var authService=require(_0x68b8('0xf'));var qs=require(_0x68b8('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x68b8('0x11'));var logger=require('../../config/logger')(_0x68b8('0x12'));var utils=require('../../config/utils');var config=require(_0x68b8('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2674b3,_0x316138){_0x316138=_0x316138||0xcc;return function(_0x22e25b){if(_0x22e25b){return _0x2674b3['sendStatus'](_0x316138);}return _0x2674b3[_0x68b8('0x14')](_0x316138)[_0x68b8('0x15')]();};}function respondWithResult(_0x4ae1cb,_0x29b876){_0x29b876=_0x29b876||0xc8;return function(_0x348adc){if(_0x348adc){return _0x4ae1cb['status'](_0x29b876)[_0x68b8('0x16')](_0x348adc);}};}function respondWithFilteredResult(_0x228545,_0xb53a03){return function(_0x2a5171){if(_0x2a5171){var _0x54433e=typeof _0xb53a03['offset']==='undefined'&&typeof _0xb53a03[_0x68b8('0x17')]===_0x68b8('0x18');var _0x49fd9d=_0x2a5171[_0x68b8('0x19')];var _0x3abc13=_0x54433e?0x0:_0xb53a03[_0x68b8('0x1a')];var _0x3ff8e0=_0x54433e?_0x2a5171['count']:_0xb53a03[_0x68b8('0x1a')]+_0xb53a03[_0x68b8('0x17')];var _0xca00b1;if(_0x3ff8e0>=_0x49fd9d){_0x3ff8e0=_0x49fd9d;_0xca00b1=0xc8;}else{_0xca00b1=0xce;}_0x228545[_0x68b8('0x14')](_0xca00b1);return _0x228545['set'](_0x68b8('0x1b'),_0x3abc13+'-'+_0x3ff8e0+'/'+_0x49fd9d)[_0x68b8('0x16')](_0x2a5171);}return null;};}function patchUpdates(_0x1583ea){return function(_0x270727){try{jsonpatch[_0x68b8('0x1c')](_0x270727,_0x1583ea,!![]);}catch(_0x4c6a0e){return BPromise['reject'](_0x4c6a0e);}return _0x270727[_0x68b8('0x1d')]();};}function saveUpdates(_0x49977a,_0x4a162b){return function(_0x317c65){if(_0x317c65){return _0x317c65[_0x68b8('0x1e')](_0x49977a)[_0x68b8('0x1f')](function(_0x131905){return _0x131905;});}return null;};}function removeEntity(_0xcba36e,_0x1e4802){return function(_0x1f4291){if(_0x1f4291){return _0x1f4291['destroy']()[_0x68b8('0x1f')](function(){_0xcba36e[_0x68b8('0x14')](0xcc)[_0x68b8('0x15')]();});}};}function handleEntityNotFound(_0x8d41d2,_0x23e7de){return function(_0x1e9498){if(!_0x1e9498){_0x8d41d2[_0x68b8('0x20')](0x194);}return _0x1e9498;};}function handleError(_0x32fe5f,_0x25f41d){_0x25f41d=_0x25f41d||0x1f4;return function(_0x4d0f93){logger[_0x68b8('0x21')](_0x4d0f93[_0x68b8('0x22')]);if(_0x4d0f93[_0x68b8('0x23')]){delete _0x4d0f93[_0x68b8('0x23')];}_0x32fe5f[_0x68b8('0x14')](_0x25f41d)[_0x68b8('0x24')](_0x4d0f93);};}exports['index']=function(_0x316441,_0x8c71f9){var _0x2bb59c={},_0x256fee={},_0x332ac6={'count':0x0,'rows':[]};var _0x6b779a=_['map'](db[_0x68b8('0x25')]['rawAttributes'],function(_0x1b7855){return{'name':_0x1b7855[_0x68b8('0x26')],'type':_0x1b7855[_0x68b8('0x27')][_0x68b8('0x28')]};});_0x256fee['model']=_[_0x68b8('0x29')](_0x6b779a,_0x68b8('0x23'));_0x256fee[_0x68b8('0x2a')]=_[_0x68b8('0x2b')](_0x316441['query']);_0x256fee[_0x68b8('0x2c')]=_[_0x68b8('0x2d')](_0x256fee[_0x68b8('0x2e')],_0x256fee[_0x68b8('0x2a')]);_0x2bb59c[_0x68b8('0x2f')]=_[_0x68b8('0x2d')](_0x256fee['model'],qs[_0x68b8('0x30')](_0x316441['query'][_0x68b8('0x30')]));_0x2bb59c[_0x68b8('0x2f')]=_0x2bb59c[_0x68b8('0x2f')][_0x68b8('0x31')]?_0x2bb59c[_0x68b8('0x2f')]:_0x256fee[_0x68b8('0x2e')];if(!_0x316441[_0x68b8('0x2a')][_0x68b8('0x32')](_0x68b8('0x33'))){_0x2bb59c['limit']=qs['limit'](_0x316441[_0x68b8('0x2a')][_0x68b8('0x17')]);_0x2bb59c[_0x68b8('0x1a')]=qs[_0x68b8('0x1a')](_0x316441['query'][_0x68b8('0x1a')]);}_0x2bb59c[_0x68b8('0x34')]=qs[_0x68b8('0x35')](_0x316441[_0x68b8('0x2a')][_0x68b8('0x35')]);_0x2bb59c[_0x68b8('0x36')]=qs[_0x68b8('0x2c')](_[_0x68b8('0x37')](_0x316441[_0x68b8('0x2a')],_0x256fee[_0x68b8('0x2c')]),_0x6b779a);if(_0x316441[_0x68b8('0x2a')]['filter']){_0x2bb59c[_0x68b8('0x36')]=_[_0x68b8('0x38')](_0x2bb59c[_0x68b8('0x36')],{'$or':_[_0x68b8('0x29')](_0x6b779a,function(_0xbee65e){if(_0xbee65e['type']!==_0x68b8('0x39')){var _0x34409e={};_0x34409e[_0xbee65e['name']]={'$like':'%'+_0x316441[_0x68b8('0x2a')]['filter']+'%'};return _0x34409e;}})});}_0x2bb59c=_[_0x68b8('0x38')]({},_0x2bb59c,_0x316441[_0x68b8('0x3a')]);var _0x1c5b9c={'where':_0x2bb59c[_0x68b8('0x36')]};return db[_0x68b8('0x25')]['count'](_0x1c5b9c)['then'](function(_0x29fefc){_0x332ac6[_0x68b8('0x19')]=_0x29fefc;if(_0x316441['query'][_0x68b8('0x3b')]){_0x2bb59c[_0x68b8('0x3c')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x68b8('0x3d')](_0x2bb59c);})['then'](function(_0x40698c){_0x332ac6[_0x68b8('0x3e')]=_0x40698c;return _0x332ac6;})['then'](respondWithFilteredResult(_0x8c71f9,_0x2bb59c))[_0x68b8('0x3f')](handleError(_0x8c71f9,null));};exports[_0x68b8('0x40')]=function(_0xe80897,_0x1aac17){var _0x5f4252={'raw':![],'where':{'id':_0xe80897[_0x68b8('0x41')]['id']}},_0xe27123={};_0xe27123['model']=_[_0x68b8('0x2b')](db[_0x68b8('0x25')]['rawAttributes']);_0xe27123[_0x68b8('0x2a')]=_[_0x68b8('0x2b')](_0xe80897[_0x68b8('0x2a')]);_0xe27123[_0x68b8('0x2c')]=_[_0x68b8('0x2d')](_0xe27123[_0x68b8('0x2e')],_0xe27123[_0x68b8('0x2a')]);_0x5f4252[_0x68b8('0x2f')]=_[_0x68b8('0x2d')](_0xe27123[_0x68b8('0x2e')],qs[_0x68b8('0x30')](_0xe80897[_0x68b8('0x2a')][_0x68b8('0x30')]));_0x5f4252[_0x68b8('0x2f')]=_0x5f4252['attributes'][_0x68b8('0x31')]?_0x5f4252[_0x68b8('0x2f')]:_0xe27123[_0x68b8('0x2e')];if(_0xe80897[_0x68b8('0x2a')]['includeAll']){_0x5f4252[_0x68b8('0x3c')]=[{'all':!![]}];}_0x5f4252=_[_0x68b8('0x38')]({},_0x5f4252,_0xe80897['options']);return db[_0x68b8('0x25')][_0x68b8('0x42')](_0x5f4252)[_0x68b8('0x1f')](handleEntityNotFound(_0x1aac17,null))[_0x68b8('0x1f')](respondWithResult(_0x1aac17,null))[_0x68b8('0x3f')](handleError(_0x1aac17,null));};exports[_0x68b8('0x43')]=function(_0x25d1d8,_0x36b66b){return db[_0x68b8('0x25')][_0x68b8('0x43')](_0x25d1d8[_0x68b8('0x44')],{})[_0x68b8('0x1f')](respondWithResult(_0x36b66b,0xc9))[_0x68b8('0x3f')](handleError(_0x36b66b,null));};exports[_0x68b8('0x45')]=function(_0x277315,_0x4ec60f){return db[_0x68b8('0x25')][_0x68b8('0x45')](_0x277315[_0x68b8('0x44')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x4ec60f,0xc9))[_0x68b8('0x3f')](handleError(_0x4ec60f,null));};exports['update']=function(_0x5e9644,_0xaa81b6){if(_0x5e9644['body']['id']){delete _0x5e9644[_0x68b8('0x44')]['id'];}return db['AnalyticFieldReport'][_0x68b8('0x42')]({'where':{'id':_0x5e9644['params']['id']}})[_0x68b8('0x1f')](handleEntityNotFound(_0xaa81b6,null))[_0x68b8('0x1f')](saveUpdates(_0x5e9644[_0x68b8('0x44')],null))[_0x68b8('0x1f')](respondWithResult(_0xaa81b6,null))[_0x68b8('0x3f')](handleError(_0xaa81b6,null));};exports['destroy']=function(_0x205135,_0xba471d){return db[_0x68b8('0x25')][_0x68b8('0x42')]({'where':{'id':_0x205135['params']['id']}})[_0x68b8('0x1f')](handleEntityNotFound(_0xba471d,null))[_0x68b8('0x1f')](removeEntity(_0xba471d,null))[_0x68b8('0x3f')](handleError(_0xba471d,null));};exports[_0x68b8('0x46')]=function(_0xb98765,_0x3498ce){return db[_0x68b8('0x25')][_0x68b8('0x47')]({'where':{'id':_0xb98765['query'][_0x68b8('0x48')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x3498ce,0xcc))[_0x68b8('0x3f')](handleError(_0x3498ce,null));};exports[_0x68b8('0x49')]=function(_0x3e95a5,_0xd42b22,_0x1f289a){return db[_0x68b8('0x4a')]['findOne']({'where':{'id':_0x3e95a5[_0x68b8('0x41')]['id']}})[_0x68b8('0x1f')](handleEntityNotFound(_0xd42b22,null))['then'](function(_0x55917d){if(_0x55917d){return db[_0x68b8('0x4b')][_0x68b8('0x4c')](function(_0x53e40b){return db['AnalyticFieldReport']['destroy']({'where':{'CustomReportId':_0x3e95a5[_0x68b8('0x41')]['id']},'transaction':_0x53e40b})[_0x68b8('0x1f')](function(_0xd54b89){var _0x61a72d=_[_0x68b8('0x29')](_0x3e95a5[_0x68b8('0x44')],function(_0x5c8674){delete _0x5c8674['id'];_0x5c8674[_0x68b8('0x4d')]=_0x3e95a5[_0x68b8('0x41')]['id'];return _0x5c8674;});return db[_0x68b8('0x25')][_0x68b8('0x45')](_0x61a72d,{'transaction':_0x53e40b});});})[_0x68b8('0x1f')](function(){return db[_0x68b8('0x25')]['findAll']({'where':{'CustomReportId':_0x3e95a5[_0x68b8('0x41')]['id']}});});}})[_0x68b8('0x1f')](respondWithResult(_0xd42b22,null))[_0x68b8('0x3f')](handleError(_0xd42b22,null));}; \ No newline at end of file +var _0x577d=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','reject','then','error','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','bulkCreate','update','bulkDestroy','destroy','AnalyticCustomReport','findOne','sequelize','transaction','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x485201,_0x3c533a){var _0x9ca98a=function(_0x418ef0){while(--_0x418ef0){_0x485201['push'](_0x485201['shift']());}};_0x9ca98a(++_0x3c533a);}(_0x577d,0xe1));var _0xd577=function(_0x3c7f07,_0x1e7d35){_0x3c7f07=_0x3c7f07-0x0;var _0x3788dc=_0x577d[_0x3c7f07];return _0x3788dc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd577('0x0'));var zipdir=require(_0xd577('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd577('0x2'));var moment=require(_0xd577('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xd577('0x4'));var util=require(_0xd577('0x5'));var path=require(_0xd577('0x6'));var sox=require(_0xd577('0x7'));var csv=require(_0xd577('0x8'));var ejs=require(_0xd577('0x9'));var fs=require('fs');var fs_extra=require(_0xd577('0xa'));var _=require(_0xd577('0xb'));var squel=require(_0xd577('0xc'));var crypto=require('crypto');var jsforce=require(_0xd577('0xd'));var deskjs=require(_0xd577('0xe'));var toCsv=require(_0xd577('0x8'));var querystring=require(_0xd577('0xf'));var Papa=require(_0xd577('0x10'));var Redis=require(_0xd577('0x11'));var authService=require(_0xd577('0x12'));var qs=require(_0xd577('0x13'));var as=require(_0xd577('0x14'));var hardwareService=require(_0xd577('0x15'));var logger=require('../../config/logger')(_0xd577('0x16'));var utils=require(_0xd577('0x17'));var config=require(_0xd577('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xd577('0x19'))['db'];function respondWithStatusCode(_0x5972a8,_0x5c602b){_0x5c602b=_0x5c602b||0xcc;return function(_0x46466){if(_0x46466){return _0x5972a8[_0xd577('0x1a')](_0x5c602b);}return _0x5972a8['status'](_0x5c602b)[_0xd577('0x1b')]();};}function respondWithResult(_0x4d6920,_0x16bbbe){_0x16bbbe=_0x16bbbe||0xc8;return function(_0x27812b){if(_0x27812b){return _0x4d6920[_0xd577('0x1c')](_0x16bbbe)[_0xd577('0x1d')](_0x27812b);}};}function respondWithFilteredResult(_0x117a45,_0x5c3175){return function(_0x514246){if(_0x514246){var _0x432210=typeof _0x5c3175[_0xd577('0x1e')]===_0xd577('0x1f')&&typeof _0x5c3175[_0xd577('0x20')]==='undefined';var _0x3d6b12=_0x514246['count'];var _0x3f588c=_0x432210?0x0:_0x5c3175[_0xd577('0x1e')];var _0x4ce98f=_0x432210?_0x514246[_0xd577('0x21')]:_0x5c3175['offset']+_0x5c3175[_0xd577('0x20')];var _0x43e37f;if(_0x4ce98f>=_0x3d6b12){_0x4ce98f=_0x3d6b12;_0x43e37f=0xc8;}else{_0x43e37f=0xce;}_0x117a45[_0xd577('0x1c')](_0x43e37f);return _0x117a45['set']('Content-Range',_0x3f588c+'-'+_0x4ce98f+'/'+_0x3d6b12)[_0xd577('0x1d')](_0x514246);}return null;};}function patchUpdates(_0x3b1595){return function(_0x4c329a){try{jsonpatch['apply'](_0x4c329a,_0x3b1595,!![]);}catch(_0x2a16c2){return BPromise[_0xd577('0x22')](_0x2a16c2);}return _0x4c329a['save']();};}function saveUpdates(_0x38fb31,_0x1c86b2){return function(_0x2bad8e){if(_0x2bad8e){return _0x2bad8e['update'](_0x38fb31)[_0xd577('0x23')](function(_0x309b68){return _0x309b68;});}return null;};}function removeEntity(_0x52bc84,_0x3a5a90){return function(_0x344455){if(_0x344455){return _0x344455['destroy']()[_0xd577('0x23')](function(){_0x52bc84['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f92a2,_0xe87406){return function(_0xddbb){if(!_0xddbb){_0x3f92a2['sendStatus'](0x194);}return _0xddbb;};}function handleError(_0x2c7a75,_0x4539f1){_0x4539f1=_0x4539f1||0x1f4;return function(_0x1e2cad){logger[_0xd577('0x24')](_0x1e2cad[_0xd577('0x25')]);if(_0x1e2cad[_0xd577('0x26')]){delete _0x1e2cad[_0xd577('0x26')];}_0x2c7a75[_0xd577('0x1c')](_0x4539f1)[_0xd577('0x27')](_0x1e2cad);};}exports[_0xd577('0x28')]=function(_0x23cc73,_0x2be5c7){var _0x1f67c4={},_0x5c972c={},_0x3cd0d5={'count':0x0,'rows':[]};var _0x330d27=_[_0xd577('0x29')](db[_0xd577('0x2a')][_0xd577('0x2b')],function(_0xfe5635){return{'name':_0xfe5635[_0xd577('0x2c')],'type':_0xfe5635[_0xd577('0x2d')]['key']};});_0x5c972c['model']=_['map'](_0x330d27,_0xd577('0x26'));_0x5c972c[_0xd577('0x2e')]=_[_0xd577('0x2f')](_0x23cc73[_0xd577('0x2e')]);_0x5c972c[_0xd577('0x30')]=_[_0xd577('0x31')](_0x5c972c['model'],_0x5c972c[_0xd577('0x2e')]);_0x1f67c4[_0xd577('0x32')]=_['intersection'](_0x5c972c[_0xd577('0x33')],qs[_0xd577('0x34')](_0x23cc73['query'][_0xd577('0x34')]));_0x1f67c4[_0xd577('0x32')]=_0x1f67c4[_0xd577('0x32')][_0xd577('0x35')]?_0x1f67c4[_0xd577('0x32')]:_0x5c972c[_0xd577('0x33')];if(!_0x23cc73[_0xd577('0x2e')][_0xd577('0x36')](_0xd577('0x37'))){_0x1f67c4[_0xd577('0x20')]=qs['limit'](_0x23cc73['query']['limit']);_0x1f67c4[_0xd577('0x1e')]=qs[_0xd577('0x1e')](_0x23cc73[_0xd577('0x2e')][_0xd577('0x1e')]);}_0x1f67c4[_0xd577('0x38')]=qs['sort'](_0x23cc73[_0xd577('0x2e')][_0xd577('0x39')]);_0x1f67c4[_0xd577('0x3a')]=qs[_0xd577('0x30')](_['pick'](_0x23cc73[_0xd577('0x2e')],_0x5c972c['filters']),_0x330d27);if(_0x23cc73[_0xd577('0x2e')]['filter']){_0x1f67c4[_0xd577('0x3a')]=_[_0xd577('0x3b')](_0x1f67c4[_0xd577('0x3a')],{'$or':_[_0xd577('0x29')](_0x330d27,function(_0x20e44f){if(_0x20e44f['type']!==_0xd577('0x3c')){var _0x5a46ab={};_0x5a46ab[_0x20e44f['name']]={'$like':'%'+_0x23cc73[_0xd577('0x2e')][_0xd577('0x3d')]+'%'};return _0x5a46ab;}})});}_0x1f67c4=_['merge']({},_0x1f67c4,_0x23cc73[_0xd577('0x3e')]);var _0x75a60a={'where':_0x1f67c4[_0xd577('0x3a')]};return db[_0xd577('0x2a')]['count'](_0x75a60a)[_0xd577('0x23')](function(_0x30b979){_0x3cd0d5[_0xd577('0x21')]=_0x30b979;if(_0x23cc73[_0xd577('0x2e')][_0xd577('0x3f')]){_0x1f67c4[_0xd577('0x40')]=[{'all':!![]}];}return db[_0xd577('0x2a')][_0xd577('0x41')](_0x1f67c4);})['then'](function(_0x5f1bdc){_0x3cd0d5[_0xd577('0x42')]=_0x5f1bdc;return _0x3cd0d5;})[_0xd577('0x23')](respondWithFilteredResult(_0x2be5c7,_0x1f67c4))[_0xd577('0x43')](handleError(_0x2be5c7,null));};exports[_0xd577('0x44')]=function(_0x4e8839,_0x490ed4){var _0x3cbda2={'raw':![],'where':{'id':_0x4e8839[_0xd577('0x45')]['id']}},_0x22ea7d={};_0x22ea7d[_0xd577('0x33')]=_[_0xd577('0x2f')](db[_0xd577('0x2a')]['rawAttributes']);_0x22ea7d[_0xd577('0x2e')]=_[_0xd577('0x2f')](_0x4e8839[_0xd577('0x2e')]);_0x22ea7d[_0xd577('0x30')]=_['intersection'](_0x22ea7d[_0xd577('0x33')],_0x22ea7d[_0xd577('0x2e')]);_0x3cbda2[_0xd577('0x32')]=_['intersection'](_0x22ea7d[_0xd577('0x33')],qs[_0xd577('0x34')](_0x4e8839[_0xd577('0x2e')]['fields']));_0x3cbda2['attributes']=_0x3cbda2[_0xd577('0x32')][_0xd577('0x35')]?_0x3cbda2[_0xd577('0x32')]:_0x22ea7d[_0xd577('0x33')];if(_0x4e8839['query']['includeAll']){_0x3cbda2[_0xd577('0x40')]=[{'all':!![]}];}_0x3cbda2=_['merge']({},_0x3cbda2,_0x4e8839[_0xd577('0x3e')]);return db[_0xd577('0x2a')][_0xd577('0x46')](_0x3cbda2)[_0xd577('0x23')](handleEntityNotFound(_0x490ed4,null))['then'](respondWithResult(_0x490ed4,null))['catch'](handleError(_0x490ed4,null));};exports[_0xd577('0x47')]=function(_0x21d6ba,_0x2c17dd){return db['AnalyticFieldReport']['create'](_0x21d6ba[_0xd577('0x48')],{})['then'](respondWithResult(_0x2c17dd,0xc9))['catch'](handleError(_0x2c17dd,null));};exports[_0xd577('0x49')]=function(_0x5bf5f7,_0x467aa4){return db[_0xd577('0x2a')][_0xd577('0x49')](_0x5bf5f7[_0xd577('0x48')],{'raw':![],'individualHooks':!![]})[_0xd577('0x23')](respondWithResult(_0x467aa4,0xc9))[_0xd577('0x43')](handleError(_0x467aa4,null));};exports[_0xd577('0x4a')]=function(_0x4d0689,_0x3b4ed2){if(_0x4d0689[_0xd577('0x48')]['id']){delete _0x4d0689['body']['id'];}return db[_0xd577('0x2a')][_0xd577('0x46')]({'where':{'id':_0x4d0689[_0xd577('0x45')]['id']}})[_0xd577('0x23')](handleEntityNotFound(_0x3b4ed2,null))[_0xd577('0x23')](saveUpdates(_0x4d0689['body'],null))['then'](respondWithResult(_0x3b4ed2,null))[_0xd577('0x43')](handleError(_0x3b4ed2,null));};exports['destroy']=function(_0x2ec923,_0x12e7fd){return db['AnalyticFieldReport']['find']({'where':{'id':_0x2ec923[_0xd577('0x45')]['id']}})[_0xd577('0x23')](handleEntityNotFound(_0x12e7fd,null))[_0xd577('0x23')](removeEntity(_0x12e7fd,null))[_0xd577('0x43')](handleError(_0x12e7fd,null));};exports[_0xd577('0x4b')]=function(_0x2d8ba1,_0x577bf1){return db['AnalyticFieldReport'][_0xd577('0x4c')]({'where':{'id':_0x2d8ba1['query']['ids']||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x577bf1,0xcc))[_0xd577('0x43')](handleError(_0x577bf1,null));};exports['addFields']=function(_0x5e1475,_0x878715,_0x41dec2){return db[_0xd577('0x4d')][_0xd577('0x4e')]({'where':{'id':_0x5e1475[_0xd577('0x45')]['id']}})['then'](handleEntityNotFound(_0x878715,null))['then'](function(_0x403324){if(_0x403324){return db[_0xd577('0x4f')][_0xd577('0x50')](function(_0x42fe39){return db[_0xd577('0x2a')]['destroy']({'where':{'CustomReportId':_0x5e1475['params']['id']},'transaction':_0x42fe39})[_0xd577('0x23')](function(_0x42d3db){var _0x23baa1=_['map'](_0x5e1475[_0xd577('0x48')],function(_0x8f0d3e){delete _0x8f0d3e['id'];_0x8f0d3e['CustomReportId']=_0x5e1475[_0xd577('0x45')]['id'];return _0x8f0d3e;});return db[_0xd577('0x2a')][_0xd577('0x49')](_0x23baa1,{'transaction':_0x42fe39});});})[_0xd577('0x23')](function(){return db[_0xd577('0x2a')][_0xd577('0x41')]({'where':{'CustomReportId':_0x5e1475[_0xd577('0x45')]['id']}});});}})['then'](respondWithResult(_0x878715,null))['catch'](handleError(_0x878715,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index da27a11..dbd0bab 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 _0xf76c=['api','moment','bluebird','path','rimraf','./analyticFieldReport.attributes','define','AnalyticFieldReport','analytics_report_fields','util','../../config/logger'];(function(_0x255036,_0xf94145){var _0x3c4c56=function(_0x50a35c){while(--_0x50a35c){_0x255036['push'](_0x255036['shift']());}};_0x3c4c56(++_0xf94145);}(_0xf76c,0x1d7));var _0xcf76=function(_0x159f8e,_0x258d08){_0x159f8e=_0x159f8e-0x0;var _0x458e17=_0xf76c[_0x159f8e];return _0x458e17;};'use strict';var _=require('lodash');var util=require(_0xcf76('0x0'));var logger=require(_0xcf76('0x1'))(_0xcf76('0x2'));var moment=require(_0xcf76('0x3'));var BPromise=require(_0xcf76('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcf76('0x5'));var rimraf=require(_0xcf76('0x6'));var config=require('../../config/environment');var attributes=require(_0xcf76('0x7'));module['exports']=function(_0x4f70f7,_0x3e34dd){return _0x4f70f7[_0xcf76('0x8')](_0xcf76('0x9'),attributes,{'tableName':_0xcf76('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7835=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','define','lodash','util','../../config/logger','api'];(function(_0x3d4518,_0x34ecbc){var _0x199aaf=function(_0x7e4f73){while(--_0x7e4f73){_0x3d4518['push'](_0x3d4518['shift']());}};_0x199aaf(++_0x34ecbc);}(_0x7835,0x128));var _0x5783=function(_0x4bf140,_0x254476){_0x4bf140=_0x4bf140-0x0;var _0x3ce70c=_0x7835[_0x4bf140];return _0x3ce70c;};'use strict';var _=require(_0x5783('0x0'));var util=require(_0x5783('0x1'));var logger=require(_0x5783('0x2'))(_0x5783('0x3'));var moment=require(_0x5783('0x4'));var BPromise=require(_0x5783('0x5'));var rp=require(_0x5783('0x6'));var fs=require('fs');var path=require(_0x5783('0x7'));var rimraf=require(_0x5783('0x8'));var config=require(_0x5783('0x9'));var attributes=require(_0x5783('0xa'));module['exports']=function(_0x1685e9,_0x2cd0e3){return _0x1685e9[_0x5783('0xb')]('AnalyticFieldReport',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 92c2d10..69894b8 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 _0x9192=['AnalyticFieldReport,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','info','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x26b5ff,_0x92009a){var _0x58603e=function(_0x4454ff){while(--_0x4454ff){_0x26b5ff['push'](_0x26b5ff['shift']());}};_0x58603e(++_0x92009a);}(_0x9192,0x1a7));var _0x2919=function(_0x5a4c93,_0x283aa8){_0x5a4c93=_0x5a4c93-0x0;var _0x421ff4=_0x9192[_0x5a4c93];return _0x421ff4;};'use strict';var _=require(_0x2919('0x0'));var util=require(_0x2919('0x1'));var moment=require(_0x2919('0x2'));var BPromise=require(_0x2919('0x3'));var rs=require(_0x2919('0x4'));var fs=require('fs');var Redis=require(_0x2919('0x5'));var db=require(_0x2919('0x6'))['db'];var utils=require(_0x2919('0x7'));var logger=require('../../config/logger')(_0x2919('0x8'));var config=require('../../config/environment');var jayson=require(_0x2919('0x9'));var client=jayson[_0x2919('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3f964a,_0x44a748,_0x157585){return new BPromise(function(_0x1e44c7,_0x160fb8){return client[_0x2919('0xb')](_0x3f964a,_0x157585)['then'](function(_0x30c549){logger[_0x2919('0xc')]('AnalyticFieldReport,\x20%s,\x20%s',_0x44a748,_0x2919('0xd'));logger['debug'](_0x2919('0xe'),_0x44a748,'request\x20sent',JSON[_0x2919('0xf')](_0x30c549));if(_0x30c549[_0x2919('0x10')]){if(_0x30c549[_0x2919('0x10')]['code']===0x1f4){logger[_0x2919('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x44a748,_0x30c549['error'][_0x2919('0x11')]);return _0x160fb8(_0x30c549[_0x2919('0x10')][_0x2919('0x11')]);}logger[_0x2919('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x44a748,_0x30c549[_0x2919('0x10')][_0x2919('0x11')]);return _0x1e44c7(_0x30c549[_0x2919('0x10')][_0x2919('0x11')]);}else{logger[_0x2919('0xc')](_0x2919('0x12'),_0x44a748,_0x2919('0xd'));_0x1e44c7(_0x30c549[_0x2919('0x13')][_0x2919('0x11')]);}})[_0x2919('0x14')](function(_0x10438d){logger[_0x2919('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x44a748,_0x10438d);_0x160fb8(_0x10438d);});});} \ No newline at end of file +var _0x8139=['then','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0xac8470,_0x3e40e6){var _0x41696d=function(_0x435645){while(--_0x435645){_0xac8470['push'](_0xac8470['shift']());}};_0x41696d(++_0x3e40e6);}(_0x8139,0x113));var _0x9813=function(_0x12b8fc,_0x4deb28){_0x12b8fc=_0x12b8fc-0x0;var _0xa6c4c4=_0x8139[_0x12b8fc];return _0xa6c4c4;};'use strict';var _=require(_0x9813('0x0'));var util=require(_0x9813('0x1'));var moment=require(_0x9813('0x2'));var BPromise=require(_0x9813('0x3'));var rs=require(_0x9813('0x4'));var fs=require('fs');var Redis=require(_0x9813('0x5'));var db=require(_0x9813('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9813('0x7'))(_0x9813('0x8'));var config=require(_0x9813('0x9'));var jayson=require(_0x9813('0xa'));var client=jayson['client'][_0x9813('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x122c32,_0x36bb3d,_0x57747f){return new BPromise(function(_0x37481b,_0x445bd7){return client[_0x9813('0xc')](_0x122c32,_0x57747f)[_0x9813('0xd')](function(_0x7c23e3){logger['info'](_0x9813('0xe'),_0x36bb3d,_0x9813('0xf'));logger['debug'](_0x9813('0x10'),_0x36bb3d,_0x9813('0xf'),JSON[_0x9813('0x11')](_0x7c23e3));if(_0x7c23e3[_0x9813('0x12')]){if(_0x7c23e3[_0x9813('0x12')][_0x9813('0x13')]===0x1f4){logger[_0x9813('0x12')](_0x9813('0xe'),_0x36bb3d,_0x7c23e3[_0x9813('0x12')]['message']);return _0x445bd7(_0x7c23e3[_0x9813('0x12')]['message']);}logger[_0x9813('0x12')](_0x9813('0xe'),_0x36bb3d,_0x7c23e3[_0x9813('0x12')][_0x9813('0x14')]);return _0x37481b(_0x7c23e3[_0x9813('0x12')][_0x9813('0x14')]);}else{logger[_0x9813('0x15')](_0x9813('0xe'),_0x36bb3d,_0x9813('0xf'));_0x37481b(_0x7c23e3[_0x9813('0x16')][_0x9813('0x14')]);}})[_0x9813('0x17')](function(_0x189c39){logger['error'](_0x9813('0xe'),_0x36bb3d,_0x189c39);_0x445bd7(_0x189c39);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index ade5e7e..9b91dcd 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(_0x782825,_0x586c89){var _0x3630e2=function(_0x567f92){while(--_0x567f92){_0x782825['push'](_0x782825['shift']());}};_0x3630e2(++_0x586c89);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('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(_0x2918fb,_0x1ac725){var _0xef01f8=function(_0xd97c6){while(--_0xd97c6){_0x2918fb['push'](_0x2918fb['shift']());}};_0xef01f8(++_0x1ac725);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js index 4f40ca7..4093ed9 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 _0xee5b=['sequelize','STRING','name','TEXT'];(function(_0x18e333,_0x1caf42){var _0x41c26e=function(_0x3e3606){while(--_0x3e3606){_0x18e333['push'](_0x18e333['shift']());}};_0x41c26e(++_0x1caf42);}(_0xee5b,0x1f4));var _0xbee5=function(_0x3830df,_0x4c4f05){_0x3830df=_0x3830df-0x0;var _0x451da5=_0xee5b[_0x3830df];return _0x451da5;};'use strict';var Sequelize=require(_0xbee5('0x0'));module['exports']={'name':{'type':Sequelize[_0xbee5('0x1')],'allowNull':![],'unique':_0xbee5('0x2')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0xbee5('0x3')]},'description':{'type':Sequelize[_0xbee5('0x1')]}}; \ No newline at end of file +var _0xd624=['name','sequelize','exports'];(function(_0x48f79a,_0x3d329c){var _0x45bbd4=function(_0x25091e){while(--_0x25091e){_0x48f79a['push'](_0x48f79a['shift']());}};_0x45bbd4(++_0x3d329c);}(_0xd624,0x124));var _0x4d62=function(_0x127e58,_0x535a4d){_0x127e58=_0x127e58-0x0;var _0x5bd654=_0xd624[_0x127e58];return _0x5bd654;};'use strict';var Sequelize=require(_0x4d62('0x0'));module[_0x4d62('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x4d62('0x2')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 0e1866a..0dd3126 100644 --- a/server/api/analyticMetric/analyticMetric.controller.js +++ b/server/api/analyticMetric/analyticMetric.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x46ed=['where','pick','filter','merge','map','type','options','count','includeAll','include','findAll','rows','params','keys','find','catch','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','limit','undefined','set','Content-Range','json','apply','reject','update','then','Metrics','UserProfileResource','destroy','error','stack','name','send','index','AnalyticMetric','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort'];(function(_0x3730ef,_0x15fdc6){var _0x151173=function(_0x499aa5){while(--_0x499aa5){_0x3730ef['push'](_0x3730ef['shift']());}};_0x151173(++_0x15fdc6);}(_0x46ed,0x168));var _0xd46e=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0x46ed[_0x29d94e];return _0x106237;};'use strict';var emlformat=require(_0xd46e('0x0'));var rimraf=require(_0xd46e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd46e('0x2'));var rp=require(_0xd46e('0x3'));var moment=require(_0xd46e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd46e('0x5'));var util=require(_0xd46e('0x6'));var path=require('path');var sox=require(_0xd46e('0x7'));var csv=require(_0xd46e('0x8'));var ejs=require(_0xd46e('0x9'));var fs=require('fs');var fs_extra=require(_0xd46e('0xa'));var _=require(_0xd46e('0xb'));var squel=require(_0xd46e('0xc'));var crypto=require(_0xd46e('0xd'));var jsforce=require(_0xd46e('0xe'));var deskjs=require(_0xd46e('0xf'));var toCsv=require(_0xd46e('0x8'));var querystring=require(_0xd46e('0x10'));var Papa=require('papaparse');var Redis=require(_0xd46e('0x11'));var authService=require(_0xd46e('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd46e('0x13'));var hardwareService=require(_0xd46e('0x14'));var logger=require(_0xd46e('0x15'))(_0xd46e('0x16'));var utils=require(_0xd46e('0x17'));var config=require(_0xd46e('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xd46e('0x19'))['db'];function respondWithStatusCode(_0x5bc1da,_0x48550b){_0x48550b=_0x48550b||0xcc;return function(_0xf3048c){if(_0xf3048c){return _0x5bc1da[_0xd46e('0x1a')](_0x48550b);}return _0x5bc1da['status'](_0x48550b)['end']();};}function respondWithResult(_0xacd799,_0x4688ae){_0x4688ae=_0x4688ae||0xc8;return function(_0x1e9aae){if(_0x1e9aae){return _0xacd799[_0xd46e('0x1b')](_0x4688ae)['json'](_0x1e9aae);}};}function respondWithFilteredResult(_0x3b6d25,_0x44a620){return function(_0x417402){if(_0x417402){var _0x3d72ce=typeof _0x44a620[_0xd46e('0x1c')]==='undefined'&&typeof _0x44a620[_0xd46e('0x1d')]===_0xd46e('0x1e');var _0x3583a5=_0x417402['count'];var _0x5ddd04=_0x3d72ce?0x0:_0x44a620[_0xd46e('0x1c')];var _0x1bd574=_0x3d72ce?_0x417402['count']:_0x44a620['offset']+_0x44a620[_0xd46e('0x1d')];var _0x2f2571;if(_0x1bd574>=_0x3583a5){_0x1bd574=_0x3583a5;_0x2f2571=0xc8;}else{_0x2f2571=0xce;}_0x3b6d25[_0xd46e('0x1b')](_0x2f2571);return _0x3b6d25[_0xd46e('0x1f')](_0xd46e('0x20'),_0x5ddd04+'-'+_0x1bd574+'/'+_0x3583a5)[_0xd46e('0x21')](_0x417402);}return null;};}function patchUpdates(_0x3b5fa4){return function(_0x327b7e){try{jsonpatch[_0xd46e('0x22')](_0x327b7e,_0x3b5fa4,!![]);}catch(_0x3c7e91){return BPromise[_0xd46e('0x23')](_0x3c7e91);}return _0x327b7e['save']();};}function saveUpdates(_0x259072,_0x1c83fa){return function(_0x79aa51){if(_0x79aa51){return _0x79aa51[_0xd46e('0x24')](_0x259072)[_0xd46e('0x25')](function(_0xc1af7f){return _0xc1af7f;});}return null;};}function removeEntity(_0x33c2e0,_0x8a1be){return function(_0x62dea5){if(_0x62dea5){return _0x62dea5['destroy']()[_0xd46e('0x25')](function(){var _0x5424e5=_0x62dea5['get']({'plain':!![]});var _0x371054=_0xd46e('0x26');return db[_0xd46e('0x27')][_0xd46e('0x28')]({'where':{'type':_0x371054,'resourceId':_0x5424e5['id']}})[_0xd46e('0x25')](function(){return _0x62dea5;});})[_0xd46e('0x25')](function(){_0x33c2e0[_0xd46e('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45d789,_0x3c301a){return function(_0xddbce9){if(!_0xddbce9){_0x45d789[_0xd46e('0x1a')](0x194);}return _0xddbce9;};}function handleError(_0x96f15c,_0x16e941){_0x16e941=_0x16e941||0x1f4;return function(_0x58aeef){logger[_0xd46e('0x29')](_0x58aeef[_0xd46e('0x2a')]);if(_0x58aeef[_0xd46e('0x2b')]){delete _0x58aeef[_0xd46e('0x2b')];}_0x96f15c[_0xd46e('0x1b')](_0x16e941)[_0xd46e('0x2c')](_0x58aeef);};}exports[_0xd46e('0x2d')]=function(_0x2c5ec7,_0x18f060){var _0x45ea47={},_0x2ff785={},_0x504324={'count':0x0,'rows':[]};var _0x2f4a1b=_['map'](db[_0xd46e('0x2e')][_0xd46e('0x2f')],function(_0x4f5718){return{'name':_0x4f5718[_0xd46e('0x30')],'type':_0x4f5718['type'][_0xd46e('0x31')]};});_0x2ff785[_0xd46e('0x32')]=_['map'](_0x2f4a1b,_0xd46e('0x2b'));_0x2ff785[_0xd46e('0x33')]=_['keys'](_0x2c5ec7[_0xd46e('0x33')]);_0x2ff785[_0xd46e('0x34')]=_[_0xd46e('0x35')](_0x2ff785['model'],_0x2ff785['query']);_0x45ea47[_0xd46e('0x36')]=_[_0xd46e('0x35')](_0x2ff785[_0xd46e('0x32')],qs[_0xd46e('0x37')](_0x2c5ec7[_0xd46e('0x33')][_0xd46e('0x37')]));_0x45ea47[_0xd46e('0x36')]=_0x45ea47[_0xd46e('0x36')]['length']?_0x45ea47[_0xd46e('0x36')]:_0x2ff785[_0xd46e('0x32')];if(!_0x2c5ec7[_0xd46e('0x33')][_0xd46e('0x38')](_0xd46e('0x39'))){_0x45ea47[_0xd46e('0x1d')]=qs[_0xd46e('0x1d')](_0x2c5ec7['query'][_0xd46e('0x1d')]);_0x45ea47[_0xd46e('0x1c')]=qs['offset'](_0x2c5ec7[_0xd46e('0x33')][_0xd46e('0x1c')]);}_0x45ea47[_0xd46e('0x3a')]=qs[_0xd46e('0x3b')](_0x2c5ec7['query'][_0xd46e('0x3b')]);_0x45ea47[_0xd46e('0x3c')]=qs[_0xd46e('0x34')](_[_0xd46e('0x3d')](_0x2c5ec7[_0xd46e('0x33')],_0x2ff785[_0xd46e('0x34')]),_0x2f4a1b);if(_0x2c5ec7[_0xd46e('0x33')][_0xd46e('0x3e')]){_0x45ea47['where']=_[_0xd46e('0x3f')](_0x45ea47[_0xd46e('0x3c')],{'$or':_[_0xd46e('0x40')](_0x2f4a1b,function(_0x25657a){if(_0x25657a[_0xd46e('0x41')]!=='VIRTUAL'){var _0x964c66={};_0x964c66[_0x25657a['name']]={'$like':'%'+_0x2c5ec7['query']['filter']+'%'};return _0x964c66;}})});}_0x45ea47=_['merge']({},_0x45ea47,_0x2c5ec7[_0xd46e('0x42')]);var _0x54949f={'where':_0x45ea47[_0xd46e('0x3c')]};return db[_0xd46e('0x2e')]['count'](_0x54949f)[_0xd46e('0x25')](function(_0x4114e6){_0x504324[_0xd46e('0x43')]=_0x4114e6;if(_0x2c5ec7[_0xd46e('0x33')][_0xd46e('0x44')]){_0x45ea47[_0xd46e('0x45')]=[{'all':!![]}];}return db[_0xd46e('0x2e')][_0xd46e('0x46')](_0x45ea47);})[_0xd46e('0x25')](function(_0xec367d){_0x504324[_0xd46e('0x47')]=_0xec367d;return _0x504324;})['then'](respondWithFilteredResult(_0x18f060,_0x45ea47))['catch'](handleError(_0x18f060,null));};exports['show']=function(_0x2b4a5a,_0x4e1d94){var _0x168d35={'raw':!![],'where':{'id':_0x2b4a5a[_0xd46e('0x48')]['id']}},_0x272f5f={};_0x272f5f[_0xd46e('0x32')]=_[_0xd46e('0x49')](db[_0xd46e('0x2e')][_0xd46e('0x2f')]);_0x272f5f[_0xd46e('0x33')]=_['keys'](_0x2b4a5a[_0xd46e('0x33')]);_0x272f5f['filters']=_[_0xd46e('0x35')](_0x272f5f[_0xd46e('0x32')],_0x272f5f[_0xd46e('0x33')]);_0x168d35[_0xd46e('0x36')]=_[_0xd46e('0x35')](_0x272f5f['model'],qs[_0xd46e('0x37')](_0x2b4a5a[_0xd46e('0x33')][_0xd46e('0x37')]));_0x168d35[_0xd46e('0x36')]=_0x168d35[_0xd46e('0x36')]['length']?_0x168d35[_0xd46e('0x36')]:_0x272f5f[_0xd46e('0x32')];if(_0x2b4a5a[_0xd46e('0x33')][_0xd46e('0x44')]){_0x168d35[_0xd46e('0x45')]=[{'all':!![]}];}_0x168d35=_['merge']({},_0x168d35,_0x2b4a5a[_0xd46e('0x42')]);return db[_0xd46e('0x2e')][_0xd46e('0x4a')](_0x168d35)[_0xd46e('0x25')](handleEntityNotFound(_0x4e1d94,null))[_0xd46e('0x25')](respondWithResult(_0x4e1d94,null))[_0xd46e('0x4b')](handleError(_0x4e1d94,null));};exports[_0xd46e('0x4c')]=function(_0x440dcc,_0x5188f6){return db[_0xd46e('0x2e')][_0xd46e('0x4c')](_0x440dcc[_0xd46e('0x4d')],{})[_0xd46e('0x25')](function(_0x1f1941){var _0x4e84c8=_0x440dcc['user'][_0xd46e('0x4e')]({'plain':!![]});if(!_0x4e84c8)throw new Error(_0xd46e('0x4f'));if(_0x4e84c8[_0xd46e('0x50')]==='user'){var _0x479711=_0x1f1941[_0xd46e('0x4e')]({'plain':!![]});var _0x9d8638='Metrics';return db[_0xd46e('0x51')][_0xd46e('0x4a')]({'where':{'name':_0x9d8638,'userProfileId':_0x4e84c8[_0xd46e('0x52')]},'raw':!![]})[_0xd46e('0x25')](function(_0x1bd8a5){if(_0x1bd8a5&&_0x1bd8a5[_0xd46e('0x53')]===0x0){return db[_0xd46e('0x27')][_0xd46e('0x4c')]({'name':_0x479711['name'],'resourceId':_0x479711['id'],'type':_0x1bd8a5[_0xd46e('0x2b')],'sectionId':_0x1bd8a5['id']},{})[_0xd46e('0x25')](function(){return _0x1f1941;});}else{return _0x1f1941;}})[_0xd46e('0x4b')](function(_0x63ee74){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x63ee74);throw _0x63ee74;});}return _0x1f1941;})[_0xd46e('0x25')](respondWithResult(_0x5188f6,0xc9))['catch'](handleError(_0x5188f6,null));};exports[_0xd46e('0x24')]=function(_0x2af20b,_0x393cb9){if(_0x2af20b[_0xd46e('0x4d')]['id']){delete _0x2af20b[_0xd46e('0x4d')]['id'];}return db[_0xd46e('0x2e')]['find']({'where':{'id':_0x2af20b[_0xd46e('0x48')]['id']}})[_0xd46e('0x25')](handleEntityNotFound(_0x393cb9,null))[_0xd46e('0x25')](saveUpdates(_0x2af20b['body'],null))[_0xd46e('0x25')](respondWithResult(_0x393cb9,null))[_0xd46e('0x4b')](handleError(_0x393cb9,null));};exports[_0xd46e('0x28')]=function(_0x2042d4,_0x1886e6){return db[_0xd46e('0x2e')][_0xd46e('0x4a')]({'where':{'id':_0x2042d4[_0xd46e('0x48')]['id']}})[_0xd46e('0x25')](handleEntityNotFound(_0x1886e6,null))[_0xd46e('0x25')](removeEntity(_0x1886e6,null))[_0xd46e('0x4b')](handleError(_0x1886e6,null));}; \ No newline at end of file +var _0x008c=['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','destroy','get','stack','name','index','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','include','findAll','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util'];(function(_0x9cda45,_0xb96ab0){var _0x45a8e5=function(_0x20e621){while(--_0x20e621){_0x9cda45['push'](_0x9cda45['shift']());}};_0x45a8e5(++_0xb96ab0);}(_0x008c,0x188));var _0xc008=function(_0x4d7f3f,_0x4d2803){_0x4d7f3f=_0x4d7f3f-0x0;var _0x5d67cc=_0x008c[_0x4d7f3f];return _0x5d67cc;};'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(){var _0x2e3cfb=_0x58a6ea[_0xc008('0x23')]({'plain':!![]});var _0x5410f5='Metrics';return db['UserProfileResource'][_0xc008('0x22')]({'where':{'type':_0x5410f5,'resourceId':_0x2e3cfb['id']}})[_0xc008('0x21')](function(){return _0x58a6ea;});})[_0xc008('0x21')](function(){_0x459fd9[_0xc008('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e2aca,_0x4fce9c){return function(_0x4adbab){if(!_0x4adbab){_0x5e2aca['sendStatus'](0x194);}return _0x4adbab;};}function handleError(_0x3865c0,_0x29ba43){_0x29ba43=_0x29ba43||0x1f4;return function(_0x25eae4){logger['error'](_0x25eae4[_0xc008('0x24')]);if(_0x25eae4[_0xc008('0x25')]){delete _0x25eae4[_0xc008('0x25')];}_0x3865c0[_0xc008('0x19')](_0x29ba43)['send'](_0x25eae4);};}exports[_0xc008('0x26')]=function(_0x2e0b4e,_0x53ed35){var _0x58db82={},_0x539766={},_0x1032b2={'count':0x0,'rows':[]};var _0x267abd=_[_0xc008('0x27')](db[_0xc008('0x28')][_0xc008('0x29')],function(_0xceebc3){return{'name':_0xceebc3[_0xc008('0x2a')],'type':_0xceebc3[_0xc008('0x2b')][_0xc008('0x2c')]};});_0x539766[_0xc008('0x2d')]=_[_0xc008('0x27')](_0x267abd,_0xc008('0x25'));_0x539766['query']=_[_0xc008('0x2e')](_0x2e0b4e[_0xc008('0x2f')]);_0x539766['filters']=_[_0xc008('0x30')](_0x539766[_0xc008('0x2d')],_0x539766[_0xc008('0x2f')]);_0x58db82[_0xc008('0x31')]=_[_0xc008('0x30')](_0x539766[_0xc008('0x2d')],qs[_0xc008('0x32')](_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x32')]));_0x58db82['attributes']=_0x58db82[_0xc008('0x31')][_0xc008('0x33')]?_0x58db82[_0xc008('0x31')]:_0x539766[_0xc008('0x2d')];if(!_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x34')](_0xc008('0x35'))){_0x58db82['limit']=qs[_0xc008('0x1d')](_0x2e0b4e[_0xc008('0x2f')]['limit']);_0x58db82[_0xc008('0x1b')]=qs[_0xc008('0x1b')](_0x2e0b4e['query'][_0xc008('0x1b')]);}_0x58db82[_0xc008('0x36')]=qs[_0xc008('0x37')](_0x2e0b4e['query']['sort']);_0x58db82['where']=qs[_0xc008('0x38')](_['pick'](_0x2e0b4e[_0xc008('0x2f')],_0x539766[_0xc008('0x38')]),_0x267abd);if(_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x39')]){_0x58db82[_0xc008('0x3a')]=_[_0xc008('0x3b')](_0x58db82[_0xc008('0x3a')],{'$or':_[_0xc008('0x27')](_0x267abd,function(_0xffd2b3){if(_0xffd2b3[_0xc008('0x2b')]!==_0xc008('0x3c')){var _0xdfca2e={};_0xdfca2e[_0xffd2b3[_0xc008('0x25')]]={'$like':'%'+_0x2e0b4e[_0xc008('0x2f')]['filter']+'%'};return _0xdfca2e;}})});}_0x58db82=_[_0xc008('0x3b')]({},_0x58db82,_0x2e0b4e[_0xc008('0x3d')]);var _0x30b7df={'where':_0x58db82[_0xc008('0x3a')]};return db['AnalyticMetric'][_0xc008('0x1e')](_0x30b7df)[_0xc008('0x21')](function(_0xc8cb91){_0x1032b2[_0xc008('0x1e')]=_0xc8cb91;if(_0x2e0b4e[_0xc008('0x2f')]['includeAll']){_0x58db82[_0xc008('0x3e')]=[{'all':!![]}];}return db[_0xc008('0x28')][_0xc008('0x3f')](_0x58db82);})[_0xc008('0x21')](function(_0x7279e8){_0x1032b2['rows']=_0x7279e8;return _0x1032b2;})[_0xc008('0x21')](respondWithFilteredResult(_0x53ed35,_0x58db82))[_0xc008('0x40')](handleError(_0x53ed35,null));};exports[_0xc008('0x41')]=function(_0x408192,_0x4b80f3){var _0x26cd05={'raw':!![],'where':{'id':_0x408192[_0xc008('0x42')]['id']}},_0xe37446={};_0xe37446['model']=_[_0xc008('0x2e')](db['AnalyticMetric'][_0xc008('0x29')]);_0xe37446['query']=_[_0xc008('0x2e')](_0x408192[_0xc008('0x2f')]);_0xe37446['filters']=_[_0xc008('0x30')](_0xe37446[_0xc008('0x2d')],_0xe37446[_0xc008('0x2f')]);_0x26cd05['attributes']=_[_0xc008('0x30')](_0xe37446[_0xc008('0x2d')],qs[_0xc008('0x32')](_0x408192[_0xc008('0x2f')][_0xc008('0x32')]));_0x26cd05[_0xc008('0x31')]=_0x26cd05['attributes']['length']?_0x26cd05['attributes']:_0xe37446[_0xc008('0x2d')];if(_0x408192[_0xc008('0x2f')][_0xc008('0x43')]){_0x26cd05[_0xc008('0x3e')]=[{'all':!![]}];}_0x26cd05=_[_0xc008('0x3b')]({},_0x26cd05,_0x408192[_0xc008('0x3d')]);return db[_0xc008('0x28')][_0xc008('0x44')](_0x26cd05)['then'](handleEntityNotFound(_0x4b80f3,null))['then'](respondWithResult(_0x4b80f3,null))['catch'](handleError(_0x4b80f3,null));};exports[_0xc008('0x45')]=function(_0x2651cf,_0x158eae){return db['AnalyticMetric'][_0xc008('0x45')](_0x2651cf[_0xc008('0x46')],{})[_0xc008('0x21')](function(_0x1c2c50){var _0x4981b4=_0x2651cf[_0xc008('0x47')][_0xc008('0x23')]({'plain':!![]});if(!_0x4981b4)throw new Error(_0xc008('0x48'));if(_0x4981b4[_0xc008('0x49')]===_0xc008('0x47')){var _0x52c444=_0x1c2c50['get']({'plain':!![]});var _0x223056='Metrics';return db[_0xc008('0x4a')][_0xc008('0x44')]({'where':{'name':_0x223056,'userProfileId':_0x4981b4[_0xc008('0x4b')]},'raw':!![]})['then'](function(_0x144ab2){if(_0x144ab2&&_0x144ab2[_0xc008('0x4c')]===0x0){return db[_0xc008('0x4d')][_0xc008('0x45')]({'name':_0x52c444[_0xc008('0x25')],'resourceId':_0x52c444['id'],'type':_0x144ab2['name'],'sectionId':_0x144ab2['id']},{})[_0xc008('0x21')](function(){return _0x1c2c50;});}else{return _0x1c2c50;}})[_0xc008('0x40')](function(_0x4b4c6d){logger[_0xc008('0x4e')](_0xc008('0x4f'),_0x4b4c6d);throw _0x4b4c6d;});}return _0x1c2c50;})['then'](respondWithResult(_0x158eae,0xc9))['catch'](handleError(_0x158eae,null));};exports[_0xc008('0x20')]=function(_0xd47b74,_0x20947b){if(_0xd47b74[_0xc008('0x46')]['id']){delete _0xd47b74[_0xc008('0x46')]['id'];}return db['AnalyticMetric']['find']({'where':{'id':_0xd47b74[_0xc008('0x42')]['id']}})['then'](handleEntityNotFound(_0x20947b,null))[_0xc008('0x21')](saveUpdates(_0xd47b74[_0xc008('0x46')],null))[_0xc008('0x21')](respondWithResult(_0x20947b,null))[_0xc008('0x40')](handleError(_0x20947b,null));};exports[_0xc008('0x22')]=function(_0x27a167,_0x49d8b0){return db[_0xc008('0x28')][_0xc008('0x44')]({'where':{'id':_0x27a167[_0xc008('0x42')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x49d8b0,null))[_0xc008('0x21')](removeEntity(_0x49d8b0,null))['catch'](handleError(_0x49d8b0,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 511967d..a069d56 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 _0x81d4=['util','../../config/logger','moment','bluebird','request-promise','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics'];(function(_0xf1603b,_0x257c11){var _0x298fab=function(_0x5a96fd){while(--_0x5a96fd){_0xf1603b['push'](_0xf1603b['shift']());}};_0x298fab(++_0x257c11);}(_0x81d4,0x197));var _0x481d=function(_0x50af94,_0x2af691){_0x50af94=_0x50af94-0x0;var _0x2c54a0=_0x81d4[_0x50af94];return _0x2c54a0;};'use strict';var _=require('lodash');var util=require(_0x481d('0x0'));var logger=require(_0x481d('0x1'))('api');var moment=require(_0x481d('0x2'));var BPromise=require(_0x481d('0x3'));var rp=require(_0x481d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x481d('0x5'));var attributes=require(_0x481d('0x6'));module[_0x481d('0x7')]=function(_0x5c0761,_0x1ef8ca){return _0x5c0761[_0x481d('0x8')](_0x481d('0x9'),attributes,{'tableName':_0x481d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3eea=['exports','AnalyticMetric','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes'];(function(_0x3cb722,_0x186d29){var _0xd7b020=function(_0xc87738){while(--_0xc87738){_0x3cb722['push'](_0x3cb722['shift']());}};_0xd7b020(++_0x186d29);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x302130,_0x16db6b){_0x302130=_0x302130-0x0;var _0x2a1bd2=_0x3eea[_0x302130];return _0x2a1bd2;};'use strict';var _=require(_0xa3ee('0x0'));var util=require('util');var logger=require(_0xa3ee('0x1'))(_0xa3ee('0x2'));var moment=require(_0xa3ee('0x3'));var BPromise=require(_0xa3ee('0x4'));var rp=require(_0xa3ee('0x5'));var fs=require('fs');var path=require(_0xa3ee('0x6'));var rimraf=require(_0xa3ee('0x7'));var config=require(_0xa3ee('0x8'));var attributes=require(_0xa3ee('0x9'));module[_0xa3ee('0xa')]=function(_0xb93cdb,_0x5776bb){return _0xb93cdb['define'](_0xa3ee('0xb'),attributes,{'tableName':'analytics_metrics','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 b294cf4..c237584 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 _0x5f4f=['message','info','result','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x425355,_0x53d26b){var _0x4a3d30=function(_0x51b9a7){while(--_0x51b9a7){_0x425355['push'](_0x425355['shift']());}};_0x4a3d30(++_0x53d26b);}(_0x5f4f,0xc9));var _0xf5f4=function(_0x342700,_0x569f75){_0x342700=_0x342700-0x0;var _0x53406f=_0x5f4f[_0x342700];return _0x53406f;};'use strict';var _=require('lodash');var util=require(_0xf5f4('0x0'));var moment=require('moment');var BPromise=require(_0xf5f4('0x1'));var rs=require(_0xf5f4('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf5f4('0x3'))['db'];var utils=require(_0xf5f4('0x4'));var logger=require(_0xf5f4('0x5'))(_0xf5f4('0x6'));var config=require(_0xf5f4('0x7'));var jayson=require(_0xf5f4('0x8'));var client=jayson[_0xf5f4('0x9')][_0xf5f4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x36d4b1,_0x2acd7e,_0x2ac63c){return new BPromise(function(_0x3236a8,_0x4da1bf){return client[_0xf5f4('0xb')](_0x36d4b1,_0x2ac63c)[_0xf5f4('0xc')](function(_0xa212c4){logger['info'](_0xf5f4('0xd'),_0x2acd7e,_0xf5f4('0xe'));logger[_0xf5f4('0xf')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x2acd7e,'request\x20sent',JSON[_0xf5f4('0x10')](_0xa212c4));if(_0xa212c4['error']){if(_0xa212c4[_0xf5f4('0x11')][_0xf5f4('0x12')]===0x1f4){logger['error'](_0xf5f4('0xd'),_0x2acd7e,_0xa212c4['error']['message']);return _0x4da1bf(_0xa212c4[_0xf5f4('0x11')][_0xf5f4('0x13')]);}logger['error'](_0xf5f4('0xd'),_0x2acd7e,_0xa212c4[_0xf5f4('0x11')][_0xf5f4('0x13')]);return _0x3236a8(_0xa212c4[_0xf5f4('0x11')]['message']);}else{logger[_0xf5f4('0x14')](_0xf5f4('0xd'),_0x2acd7e,_0xf5f4('0xe'));_0x3236a8(_0xa212c4[_0xf5f4('0x15')]['message']);}})['catch'](function(_0x35ac00){logger[_0xf5f4('0x11')](_0xf5f4('0xd'),_0x2acd7e,_0x35ac00);_0x4da1bf(_0x35ac00);});});} \ No newline at end of file +var _0x589e=['message','info','result','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x181e4e,_0x3f7d88){var _0x1bfc24=function(_0x52e430){while(--_0x52e430){_0x181e4e['push'](_0x181e4e['shift']());}};_0x1bfc24(++_0x3f7d88);}(_0x589e,0x10c));var _0xe589=function(_0x416875,_0x1e3125){_0x416875=_0x416875-0x0;var _0x360d6b=_0x589e[_0x416875];return _0x360d6b;};'use strict';var _=require(_0xe589('0x0'));var util=require(_0xe589('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe589('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe589('0x3'))['db'];var utils=require(_0xe589('0x4'));var logger=require(_0xe589('0x5'))(_0xe589('0x6'));var config=require('../../config/environment');var jayson=require(_0xe589('0x7'));var client=jayson[_0xe589('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x230f44,_0x2d5759,_0x26e18a){return new BPromise(function(_0x42992c,_0xafbd58){return client[_0xe589('0x9')](_0x230f44,_0x26e18a)[_0xe589('0xa')](function(_0x5bb373){logger['info'](_0xe589('0xb'),_0x2d5759,_0xe589('0xc'));logger[_0xe589('0xd')](_0xe589('0xe'),_0x2d5759,_0xe589('0xc'),JSON[_0xe589('0xf')](_0x5bb373));if(_0x5bb373[_0xe589('0x10')]){if(_0x5bb373[_0xe589('0x10')][_0xe589('0x11')]===0x1f4){logger[_0xe589('0x10')](_0xe589('0xb'),_0x2d5759,_0x5bb373[_0xe589('0x10')][_0xe589('0x12')]);return _0xafbd58(_0x5bb373[_0xe589('0x10')]['message']);}logger['error'](_0xe589('0xb'),_0x2d5759,_0x5bb373['error'][_0xe589('0x12')]);return _0x42992c(_0x5bb373['error']['message']);}else{logger[_0xe589('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0x2d5759,_0xe589('0xc'));_0x42992c(_0x5bb373[_0xe589('0x14')][_0xe589('0x12')]);}})[_0xe589('0x15')](function(_0x54fd5){logger[_0xe589('0x10')](_0xe589('0xb'),_0x2d5759,_0x54fd5);_0xafbd58(_0x54fd5);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 234ae3d..3970d17 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 _0x004c=['../../components/interaction/service','./analyticMetric.controller','isAuthenticated','index','get','show','post','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x350539,_0x12db43){var _0xabd4ad=function(_0x33436f){while(--_0x33436f){_0x350539['push'](_0x350539['shift']());}};_0xabd4ad(++_0x12db43);}(_0x004c,0x85));var _0xc004=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x004c[_0x178e48];return _0x440d7e;};'use strict';var multer=require(_0xc004('0x0'));var util=require(_0xc004('0x1'));var path=require(_0xc004('0x2'));var timeout=require(_0xc004('0x3'));var express=require('express');var router=express[_0xc004('0x4')]();var fs_extra=require(_0xc004('0x5'));var auth=require(_0xc004('0x6'));var interaction=require(_0xc004('0x7'));var config=require('../../config/environment');var controller=require(_0xc004('0x8'));router['get']('/',auth[_0xc004('0x9')](),controller[_0xc004('0xa')]);router[_0xc004('0xb')]('/:id',auth[_0xc004('0x9')](),controller[_0xc004('0xc')]);router[_0xc004('0xd')]('/',auth[_0xc004('0x9')](),controller['create']);router[_0xc004('0xe')](_0xc004('0xf'),auth[_0xc004('0x9')](),controller[_0xc004('0x10')]);router[_0xc004('0x11')](_0xc004('0xf'),auth[_0xc004('0x9')](),controller[_0xc004('0x12')]);module[_0xc004('0x13')]=router; \ No newline at end of file +var _0x00e0=['put','update','delete','multer','util','path','express','fs-extra','get','isAuthenticated','/:id','show'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x00e0,0x1e3));var _0x000e=function(_0x4ce36d,_0x477757){_0x4ce36d=_0x4ce36d-0x0;var _0x46c13b=_0x00e0[_0x4ce36d];return _0x46c13b;};'use strict';var multer=require(_0x000e('0x0'));var util=require(_0x000e('0x1'));var path=require(_0x000e('0x2'));var timeout=require('connect-timeout');var express=require(_0x000e('0x3'));var router=express['Router']();var fs_extra=require(_0x000e('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./analyticMetric.controller');router[_0x000e('0x5')]('/',auth[_0x000e('0x6')](),controller['index']);router[_0x000e('0x5')](_0x000e('0x7'),auth[_0x000e('0x6')](),controller[_0x000e('0x8')]);router['post']('/',auth[_0x000e('0x6')](),controller['create']);router[_0x000e('0x9')](_0x000e('0x7'),auth[_0x000e('0x6')](),controller[_0x000e('0xa')]);router[_0x000e('0xb')](_0x000e('0x7'),auth[_0x000e('0x6')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index c661a3c..fbf1569 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 _0x13be=['sequelize','TEXT'];(function(_0x534f8f,_0x9471f8){var _0x2c9ba2=function(_0x57bbf4){while(--_0x57bbf4){_0x534f8f['push'](_0x534f8f['shift']());}};_0x2c9ba2(++_0x9471f8);}(_0x13be,0xae));var _0xe13b=function(_0xb08995,_0x2ca3fd){_0xb08995=_0xb08995-0x0;var _0x4af313=_0x13be[_0xb08995];return _0x4af313;};'use strict';var Sequelize=require(_0xe13b('0x0'));module['exports']={'tree':{'type':Sequelize[_0xe13b('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xf25a=['sequelize','exports','TEXT'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf25a,0x195));var _0xaf25=function(_0x15a828,_0x447b10){_0x15a828=_0x15a828-0x0;var _0x1b009b=_0xf25a[_0x15a828];return _0x1b009b;};'use strict';var Sequelize=require(_0xaf25('0x0'));module[_0xaf25('0x1')]={'tree':{'type':Sequelize[_0xaf25('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index e1d8b94..9ecdf93 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 _0x9741=['merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','catch','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','apply','save','update','then','destroy','error','name','send','index','AnalyticTreeReport','type','map','query','keys','filters','intersection','attributes','model','fields','length','order','pick','filter','where'];(function(_0x3b4dfd,_0x1f5e49){var _0x4cf56a=function(_0x27e3f0){while(--_0x27e3f0){_0x3b4dfd['push'](_0x3b4dfd['shift']());}};_0x4cf56a(++_0x1f5e49);}(_0x9741,0xd4));var _0x1974=function(_0x2990b8,_0x298c4c){_0x2990b8=_0x2990b8-0x0;var _0x1afa08=_0x9741[_0x2990b8];return _0x1afa08;};'use strict';var emlformat=require(_0x1974('0x0'));var rimraf=require(_0x1974('0x1'));var zipdir=require(_0x1974('0x2'));var jsonpatch=require(_0x1974('0x3'));var rp=require('request-promise');var moment=require(_0x1974('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1974('0x5'));var util=require(_0x1974('0x6'));var path=require(_0x1974('0x7'));var sox=require(_0x1974('0x8'));var csv=require(_0x1974('0x9'));var ejs=require(_0x1974('0xa'));var fs=require('fs');var fs_extra=require(_0x1974('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x1974('0xc'));var jsforce=require(_0x1974('0xd'));var deskjs=require(_0x1974('0xe'));var toCsv=require(_0x1974('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1974('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1974('0x10'));var logger=require(_0x1974('0x11'))('api');var utils=require(_0x1974('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x1974('0x13'));var db=require(_0x1974('0x14'))['db'];function respondWithStatusCode(_0x47960e,_0x248ed1){_0x248ed1=_0x248ed1||0xcc;return function(_0x19f167){if(_0x19f167){return _0x47960e['sendStatus'](_0x248ed1);}return _0x47960e[_0x1974('0x15')](_0x248ed1)[_0x1974('0x16')]();};}function respondWithResult(_0x4415f9,_0x35437c){_0x35437c=_0x35437c||0xc8;return function(_0x175249){if(_0x175249){return _0x4415f9['status'](_0x35437c)[_0x1974('0x17')](_0x175249);}};}function respondWithFilteredResult(_0x223c4f,_0x5d975d){return function(_0x542a41){if(_0x542a41){var _0x4c94e5=typeof _0x5d975d[_0x1974('0x18')]===_0x1974('0x19')&&typeof _0x5d975d[_0x1974('0x1a')]===_0x1974('0x19');var _0x319827=_0x542a41['count'];var _0x36b546=_0x4c94e5?0x0:_0x5d975d[_0x1974('0x18')];var _0x1e478c=_0x4c94e5?_0x542a41[_0x1974('0x1b')]:_0x5d975d[_0x1974('0x18')]+_0x5d975d[_0x1974('0x1a')];var _0xa2e67b;if(_0x1e478c>=_0x319827){_0x1e478c=_0x319827;_0xa2e67b=0xc8;}else{_0xa2e67b=0xce;}_0x223c4f[_0x1974('0x15')](_0xa2e67b);return _0x223c4f['set']('Content-Range',_0x36b546+'-'+_0x1e478c+'/'+_0x319827)[_0x1974('0x17')](_0x542a41);}return null;};}function patchUpdates(_0x33f245){return function(_0x4ac8e7){try{jsonpatch[_0x1974('0x1c')](_0x4ac8e7,_0x33f245,!![]);}catch(_0x4728d1){return BPromise['reject'](_0x4728d1);}return _0x4ac8e7[_0x1974('0x1d')]();};}function saveUpdates(_0x24799e,_0x42068a){return function(_0x5e25dd){if(_0x5e25dd){return _0x5e25dd[_0x1974('0x1e')](_0x24799e)[_0x1974('0x1f')](function(_0x76fa36){return _0x76fa36;});}return null;};}function removeEntity(_0x3e506e,_0x3d25cc){return function(_0x30aacd){if(_0x30aacd){return _0x30aacd[_0x1974('0x20')]()[_0x1974('0x1f')](function(){_0x3e506e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x232001,_0x3b6286){return function(_0x59e016){if(!_0x59e016){_0x232001['sendStatus'](0x194);}return _0x59e016;};}function handleError(_0xc4a0d6,_0x49e005){_0x49e005=_0x49e005||0x1f4;return function(_0x3940e3){logger[_0x1974('0x21')](_0x3940e3['stack']);if(_0x3940e3[_0x1974('0x22')]){delete _0x3940e3[_0x1974('0x22')];}_0xc4a0d6['status'](_0x49e005)[_0x1974('0x23')](_0x3940e3);};}exports[_0x1974('0x24')]=function(_0x83e424,_0x477ce8){var _0x3b556a={},_0x44b403={},_0x5d7944={'count':0x0,'rows':[]};var _0x5c5eb3=_['map'](db[_0x1974('0x25')]['rawAttributes'],function(_0x3716d7){return{'name':_0x3716d7['fieldName'],'type':_0x3716d7[_0x1974('0x26')]['key']};});_0x44b403['model']=_[_0x1974('0x27')](_0x5c5eb3,'name');_0x44b403[_0x1974('0x28')]=_[_0x1974('0x29')](_0x83e424[_0x1974('0x28')]);_0x44b403[_0x1974('0x2a')]=_[_0x1974('0x2b')](_0x44b403['model'],_0x44b403['query']);_0x3b556a[_0x1974('0x2c')]=_[_0x1974('0x2b')](_0x44b403[_0x1974('0x2d')],qs['fields'](_0x83e424[_0x1974('0x28')][_0x1974('0x2e')]));_0x3b556a[_0x1974('0x2c')]=_0x3b556a[_0x1974('0x2c')][_0x1974('0x2f')]?_0x3b556a[_0x1974('0x2c')]:_0x44b403[_0x1974('0x2d')];if(!_0x83e424[_0x1974('0x28')]['hasOwnProperty']('nolimit')){_0x3b556a[_0x1974('0x1a')]=qs[_0x1974('0x1a')](_0x83e424['query'][_0x1974('0x1a')]);_0x3b556a[_0x1974('0x18')]=qs['offset'](_0x83e424['query'][_0x1974('0x18')]);}_0x3b556a[_0x1974('0x30')]=qs['sort'](_0x83e424['query']['sort']);_0x3b556a['where']=qs['filters'](_[_0x1974('0x31')](_0x83e424['query'],_0x44b403[_0x1974('0x2a')]),_0x5c5eb3);if(_0x83e424['query'][_0x1974('0x32')]){_0x3b556a[_0x1974('0x33')]=_[_0x1974('0x34')](_0x3b556a[_0x1974('0x33')],{'$or':_[_0x1974('0x27')](_0x5c5eb3,function(_0x33998d){if(_0x33998d['type']!==_0x1974('0x35')){var _0x366d60={};_0x366d60[_0x33998d[_0x1974('0x22')]]={'$like':'%'+_0x83e424[_0x1974('0x28')][_0x1974('0x32')]+'%'};return _0x366d60;}})});}_0x3b556a=_['merge']({},_0x3b556a,_0x83e424[_0x1974('0x36')]);var _0x2d458e={'where':_0x3b556a[_0x1974('0x33')]};return db['AnalyticTreeReport']['count'](_0x2d458e)[_0x1974('0x1f')](function(_0x46457e){_0x5d7944['count']=_0x46457e;if(_0x83e424[_0x1974('0x28')][_0x1974('0x37')]){_0x3b556a[_0x1974('0x38')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x1974('0x39')](_0x3b556a);})[_0x1974('0x1f')](function(_0x59a847){_0x5d7944[_0x1974('0x3a')]=_0x59a847;return _0x5d7944;})[_0x1974('0x1f')](respondWithFilteredResult(_0x477ce8,_0x3b556a))['catch'](handleError(_0x477ce8,null));};exports[_0x1974('0x3b')]=function(_0x518896,_0x4abd63){var _0x17faba={'raw':!![],'where':{'id':_0x518896[_0x1974('0x3c')]['id']}},_0x31ee39={};_0x31ee39[_0x1974('0x2d')]=_[_0x1974('0x29')](db[_0x1974('0x25')][_0x1974('0x3d')]);_0x31ee39[_0x1974('0x28')]=_[_0x1974('0x29')](_0x518896[_0x1974('0x28')]);_0x31ee39[_0x1974('0x2a')]=_['intersection'](_0x31ee39['model'],_0x31ee39[_0x1974('0x28')]);_0x17faba[_0x1974('0x2c')]=_['intersection'](_0x31ee39[_0x1974('0x2d')],qs[_0x1974('0x2e')](_0x518896[_0x1974('0x28')][_0x1974('0x2e')]));_0x17faba['attributes']=_0x17faba[_0x1974('0x2c')][_0x1974('0x2f')]?_0x17faba[_0x1974('0x2c')]:_0x31ee39['model'];if(_0x518896[_0x1974('0x28')][_0x1974('0x37')]){_0x17faba[_0x1974('0x38')]=[{'all':!![]}];}_0x17faba=_['merge']({},_0x17faba,_0x518896[_0x1974('0x36')]);return db[_0x1974('0x25')]['find'](_0x17faba)[_0x1974('0x1f')](handleEntityNotFound(_0x4abd63,null))[_0x1974('0x1f')](respondWithResult(_0x4abd63,null))[_0x1974('0x3e')](handleError(_0x4abd63,null));};exports[_0x1974('0x3f')]=function(_0x518721,_0xc7cd3a){return db['AnalyticTreeReport'][_0x1974('0x3f')](_0x518721['body'],{})[_0x1974('0x1f')](respondWithResult(_0xc7cd3a,0xc9))[_0x1974('0x3e')](handleError(_0xc7cd3a,null));};exports[_0x1974('0x1e')]=function(_0x3d670d,_0x443fb6){if(_0x3d670d['body']['id']){delete _0x3d670d[_0x1974('0x40')]['id'];}return db[_0x1974('0x25')][_0x1974('0x41')]({'where':{'id':_0x3d670d[_0x1974('0x3c')]['id']}})[_0x1974('0x1f')](handleEntityNotFound(_0x443fb6,null))['then'](saveUpdates(_0x3d670d[_0x1974('0x40')],null))[_0x1974('0x1f')](respondWithResult(_0x443fb6,null))[_0x1974('0x3e')](handleError(_0x443fb6,null));};exports['destroy']=function(_0x2ea7ea,_0xa24757){return db[_0x1974('0x25')][_0x1974('0x41')]({'where':{'id':_0x2ea7ea[_0x1974('0x3c')]['id']}})[_0x1974('0x1f')](handleEntityNotFound(_0xa24757,null))[_0x1974('0x1f')](removeEntity(_0xa24757,null))[_0x1974('0x3e')](handleError(_0xa24757,null));}; \ No newline at end of file +var _0x73aa=['sort','where','pick','filters','filter','includeAll','include','findAll','merge','find','catch','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','order'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x73aa,0xf2));var _0xa73a=function(_0x291f8b,_0x3b5591){_0x291f8b=_0x291f8b-0x0;var _0x275171=_0x73aa[_0x291f8b];return _0x275171;};'use strict';var emlformat=require(_0xa73a('0x0'));var rimraf=require(_0xa73a('0x1'));var zipdir=require(_0xa73a('0x2'));var jsonpatch=require(_0xa73a('0x3'));var rp=require('request-promise');var moment=require(_0xa73a('0x4'));var BPromise=require(_0xa73a('0x5'));var Mustache=require(_0xa73a('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa73a('0x7'));var fs=require('fs');var fs_extra=require(_0xa73a('0x8'));var _=require(_0xa73a('0x9'));var squel=require(_0xa73a('0xa'));var crypto=require(_0xa73a('0xb'));var jsforce=require(_0xa73a('0xc'));var deskjs=require(_0xa73a('0xd'));var toCsv=require(_0xa73a('0xe'));var querystring=require(_0xa73a('0xf'));var Papa=require(_0xa73a('0x10'));var Redis=require(_0xa73a('0x11'));var authService=require(_0xa73a('0x12'));var qs=require(_0xa73a('0x13'));var as=require(_0xa73a('0x14'));var hardwareService=require(_0xa73a('0x15'));var logger=require(_0xa73a('0x16'))('api');var utils=require(_0xa73a('0x17'));var config=require(_0xa73a('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xa73a('0x19'))['db'];function respondWithStatusCode(_0x24aada,_0xa00ca4){_0xa00ca4=_0xa00ca4||0xcc;return function(_0x3b46a6){if(_0x3b46a6){return _0x24aada[_0xa73a('0x1a')](_0xa00ca4);}return _0x24aada[_0xa73a('0x1b')](_0xa00ca4)[_0xa73a('0x1c')]();};}function respondWithResult(_0x56f211,_0x33e342){_0x33e342=_0x33e342||0xc8;return function(_0x3d7083){if(_0x3d7083){return _0x56f211[_0xa73a('0x1b')](_0x33e342)['json'](_0x3d7083);}};}function respondWithFilteredResult(_0x30e772,_0x392b9f){return function(_0x49b59d){if(_0x49b59d){var _0x3701af=typeof _0x392b9f[_0xa73a('0x1d')]===_0xa73a('0x1e')&&typeof _0x392b9f[_0xa73a('0x1f')]===_0xa73a('0x1e');var _0x431e96=_0x49b59d['count'];var _0x1a1166=_0x3701af?0x0:_0x392b9f[_0xa73a('0x1d')];var _0x793f4b=_0x3701af?_0x49b59d[_0xa73a('0x20')]:_0x392b9f[_0xa73a('0x1d')]+_0x392b9f[_0xa73a('0x1f')];var _0x48cacd;if(_0x793f4b>=_0x431e96){_0x793f4b=_0x431e96;_0x48cacd=0xc8;}else{_0x48cacd=0xce;}_0x30e772['status'](_0x48cacd);return _0x30e772[_0xa73a('0x21')](_0xa73a('0x22'),_0x1a1166+'-'+_0x793f4b+'/'+_0x431e96)[_0xa73a('0x23')](_0x49b59d);}return null;};}function patchUpdates(_0x35a38d){return function(_0x117310){try{jsonpatch[_0xa73a('0x24')](_0x117310,_0x35a38d,!![]);}catch(_0x1a34f3){return BPromise[_0xa73a('0x25')](_0x1a34f3);}return _0x117310[_0xa73a('0x26')]();};}function saveUpdates(_0x13cb3f,_0x48bc8c){return function(_0xc6cc68){if(_0xc6cc68){return _0xc6cc68[_0xa73a('0x27')](_0x13cb3f)[_0xa73a('0x28')](function(_0x51edbb){return _0x51edbb;});}return null;};}function removeEntity(_0x1208df,_0x5b14d2){return function(_0x13af7e){if(_0x13af7e){return _0x13af7e[_0xa73a('0x29')]()[_0xa73a('0x28')](function(){_0x1208df[_0xa73a('0x1b')](0xcc)[_0xa73a('0x1c')]();});}};}function handleEntityNotFound(_0x4c7718,_0x57f935){return function(_0x3e0b99){if(!_0x3e0b99){_0x4c7718[_0xa73a('0x1a')](0x194);}return _0x3e0b99;};}function handleError(_0x38c755,_0x4141ac){_0x4141ac=_0x4141ac||0x1f4;return function(_0x3a9723){logger[_0xa73a('0x2a')](_0x3a9723[_0xa73a('0x2b')]);if(_0x3a9723[_0xa73a('0x2c')]){delete _0x3a9723['name'];}_0x38c755[_0xa73a('0x1b')](_0x4141ac)[_0xa73a('0x2d')](_0x3a9723);};}exports[_0xa73a('0x2e')]=function(_0x18bb8f,_0x1fde4a){var _0x524d16={},_0x5c0f6e={},_0x504825={'count':0x0,'rows':[]};var _0x40a266=_[_0xa73a('0x2f')](db[_0xa73a('0x30')][_0xa73a('0x31')],function(_0x46e3b5){return{'name':_0x46e3b5[_0xa73a('0x32')],'type':_0x46e3b5[_0xa73a('0x33')][_0xa73a('0x34')]};});_0x5c0f6e[_0xa73a('0x35')]=_[_0xa73a('0x2f')](_0x40a266,_0xa73a('0x2c'));_0x5c0f6e[_0xa73a('0x36')]=_[_0xa73a('0x37')](_0x18bb8f[_0xa73a('0x36')]);_0x5c0f6e['filters']=_['intersection'](_0x5c0f6e[_0xa73a('0x35')],_0x5c0f6e[_0xa73a('0x36')]);_0x524d16[_0xa73a('0x38')]=_[_0xa73a('0x39')](_0x5c0f6e[_0xa73a('0x35')],qs['fields'](_0x18bb8f[_0xa73a('0x36')][_0xa73a('0x3a')]));_0x524d16[_0xa73a('0x38')]=_0x524d16[_0xa73a('0x38')][_0xa73a('0x3b')]?_0x524d16['attributes']:_0x5c0f6e[_0xa73a('0x35')];if(!_0x18bb8f[_0xa73a('0x36')][_0xa73a('0x3c')]('nolimit')){_0x524d16[_0xa73a('0x1f')]=qs['limit'](_0x18bb8f[_0xa73a('0x36')][_0xa73a('0x1f')]);_0x524d16['offset']=qs[_0xa73a('0x1d')](_0x18bb8f['query']['offset']);}_0x524d16[_0xa73a('0x3d')]=qs['sort'](_0x18bb8f['query'][_0xa73a('0x3e')]);_0x524d16[_0xa73a('0x3f')]=qs['filters'](_[_0xa73a('0x40')](_0x18bb8f['query'],_0x5c0f6e[_0xa73a('0x41')]),_0x40a266);if(_0x18bb8f[_0xa73a('0x36')][_0xa73a('0x42')]){_0x524d16[_0xa73a('0x3f')]=_['merge'](_0x524d16[_0xa73a('0x3f')],{'$or':_[_0xa73a('0x2f')](_0x40a266,function(_0x3c9c2a){if(_0x3c9c2a[_0xa73a('0x33')]!=='VIRTUAL'){var _0x2818b9={};_0x2818b9[_0x3c9c2a[_0xa73a('0x2c')]]={'$like':'%'+_0x18bb8f[_0xa73a('0x36')][_0xa73a('0x42')]+'%'};return _0x2818b9;}})});}_0x524d16=_['merge']({},_0x524d16,_0x18bb8f['options']);var _0x43f655={'where':_0x524d16['where']};return db[_0xa73a('0x30')][_0xa73a('0x20')](_0x43f655)[_0xa73a('0x28')](function(_0x1d453b){_0x504825[_0xa73a('0x20')]=_0x1d453b;if(_0x18bb8f[_0xa73a('0x36')][_0xa73a('0x43')]){_0x524d16[_0xa73a('0x44')]=[{'all':!![]}];}return db[_0xa73a('0x30')][_0xa73a('0x45')](_0x524d16);})['then'](function(_0x38b0bd){_0x504825['rows']=_0x38b0bd;return _0x504825;})[_0xa73a('0x28')](respondWithFilteredResult(_0x1fde4a,_0x524d16))['catch'](handleError(_0x1fde4a,null));};exports['show']=function(_0x7bade1,_0x4e6fa6){var _0x375039={'raw':!![],'where':{'id':_0x7bade1['params']['id']}},_0x557323={};_0x557323[_0xa73a('0x35')]=_[_0xa73a('0x37')](db['AnalyticTreeReport'][_0xa73a('0x31')]);_0x557323[_0xa73a('0x36')]=_['keys'](_0x7bade1['query']);_0x557323[_0xa73a('0x41')]=_['intersection'](_0x557323[_0xa73a('0x35')],_0x557323[_0xa73a('0x36')]);_0x375039[_0xa73a('0x38')]=_[_0xa73a('0x39')](_0x557323['model'],qs[_0xa73a('0x3a')](_0x7bade1['query']['fields']));_0x375039[_0xa73a('0x38')]=_0x375039['attributes'][_0xa73a('0x3b')]?_0x375039[_0xa73a('0x38')]:_0x557323[_0xa73a('0x35')];if(_0x7bade1[_0xa73a('0x36')][_0xa73a('0x43')]){_0x375039[_0xa73a('0x44')]=[{'all':!![]}];}_0x375039=_[_0xa73a('0x46')]({},_0x375039,_0x7bade1['options']);return db['AnalyticTreeReport'][_0xa73a('0x47')](_0x375039)[_0xa73a('0x28')](handleEntityNotFound(_0x4e6fa6,null))[_0xa73a('0x28')](respondWithResult(_0x4e6fa6,null))[_0xa73a('0x48')](handleError(_0x4e6fa6,null));};exports[_0xa73a('0x49')]=function(_0x339adc,_0x30754d){return db[_0xa73a('0x30')][_0xa73a('0x49')](_0x339adc[_0xa73a('0x4a')],{})[_0xa73a('0x28')](respondWithResult(_0x30754d,0xc9))['catch'](handleError(_0x30754d,null));};exports[_0xa73a('0x27')]=function(_0xc2584,_0x4989c9){if(_0xc2584['body']['id']){delete _0xc2584[_0xa73a('0x4a')]['id'];}return db[_0xa73a('0x30')]['find']({'where':{'id':_0xc2584[_0xa73a('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4989c9,null))[_0xa73a('0x28')](saveUpdates(_0xc2584[_0xa73a('0x4a')],null))[_0xa73a('0x28')](respondWithResult(_0x4989c9,null))[_0xa73a('0x48')](handleError(_0x4989c9,null));};exports[_0xa73a('0x29')]=function(_0x48033e,_0x17ce82){return db[_0xa73a('0x30')][_0xa73a('0x47')]({'where':{'id':_0x48033e[_0xa73a('0x4b')]['id']}})[_0xa73a('0x28')](handleEntityNotFound(_0x17ce82,null))['then'](removeEntity(_0x17ce82,null))[_0xa73a('0x48')](handleError(_0x17ce82,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 391c7bd..f9c8ae0 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 _0xb35e=['util','../../config/logger','bluebird','../../config/environment','./analyticTreeReport.attributes','define','AnalyticTreeReport','analytics_report_trees','lodash'];(function(_0x442dbc,_0x27fe32){var _0x175985=function(_0x34a0e7){while(--_0x34a0e7){_0x442dbc['push'](_0x442dbc['shift']());}};_0x175985(++_0x27fe32);}(_0xb35e,0x86));var _0xeb35=function(_0x587f34,_0x2721b5){_0x587f34=_0x587f34-0x0;var _0x157d40=_0xb35e[_0x587f34];return _0x157d40;};'use strict';var _=require(_0xeb35('0x0'));var util=require(_0xeb35('0x1'));var logger=require(_0xeb35('0x2'))('api');var moment=require('moment');var BPromise=require(_0xeb35('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xeb35('0x4'));var attributes=require(_0xeb35('0x5'));module['exports']=function(_0x2f2813,_0x458e9a){return _0x2f2813[_0xeb35('0x6')](_0xeb35('0x7'),attributes,{'tableName':_0xeb35('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe3a3=['api','moment','bluebird','request-promise','path','rimraf','exports','define','AnalyticTreeReport','../../config/logger'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe3a3,0xe5));var _0x3e3a=function(_0x183ef6,_0x402099){_0x183ef6=_0x183ef6-0x0;var _0x26a7fb=_0xe3a3[_0x183ef6];return _0x26a7fb;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3e3a('0x0'))(_0x3e3a('0x1'));var moment=require(_0x3e3a('0x2'));var BPromise=require(_0x3e3a('0x3'));var rp=require(_0x3e3a('0x4'));var fs=require('fs');var path=require(_0x3e3a('0x5'));var rimraf=require(_0x3e3a('0x6'));var config=require('../../config/environment');var attributes=require('./analyticTreeReport.attributes');module[_0x3e3a('0x7')]=function(_0x43d1be,_0x1e23b5){return _0x43d1be[_0x3e3a('0x8')](_0x3e3a('0x9'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js index 03ec32e..38c2f66 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 _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x3a480c,_0x1b345b){var _0x22a120=function(_0x3bcd69){while(--_0x3bcd69){_0x3a480c['push'](_0x3a480c['shift']());}};_0x22a120(++_0x1b345b);}(_0x5f2f,0x73));var _0xf5f2=function(_0xb81b30,_0x3c5427){_0xb81b30=_0xb81b30-0x0;var _0x48cd70=_0x5f2f[_0xb81b30];return _0x48cd70;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});} \ No newline at end of file +var _0x7a54=['info','AnalyticTreeReport,\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(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x7a54,0x106));var _0x47a5=function(_0x3ff8a7,_0x1f3d77){_0x3ff8a7=_0x3ff8a7-0x0;var _0x112ef5=_0x7a54[_0x3ff8a7];return _0x112ef5;};'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')]('AnalyticTreeReport,\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/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 29afcf7..dc8253e 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 _0x2f18=['delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','index','get','/:id','isAuthenticated','show','post','put'];(function(_0x231a47,_0x46a963){var _0x48d7c9=function(_0x1e69b1){while(--_0x1e69b1){_0x231a47['push'](_0x231a47['shift']());}};_0x48d7c9(++_0x46a963);}(_0x2f18,0x191));var _0x82f1=function(_0x2a00a7,_0x1fdf20){_0x2a00a7=_0x2a00a7-0x0;var _0x4674ae=_0x2f18[_0x2a00a7];return _0x4674ae;};'use strict';var multer=require('multer');var util=require(_0x82f1('0x0'));var path=require(_0x82f1('0x1'));var timeout=require(_0x82f1('0x2'));var express=require(_0x82f1('0x3'));var router=express[_0x82f1('0x4')]();var fs_extra=require(_0x82f1('0x5'));var auth=require(_0x82f1('0x6'));var interaction=require(_0x82f1('0x7'));var config=require(_0x82f1('0x8'));var controller=require(_0x82f1('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x82f1('0xa')]);router[_0x82f1('0xb')](_0x82f1('0xc'),auth[_0x82f1('0xd')](),controller[_0x82f1('0xe')]);router[_0x82f1('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x82f1('0x10')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x82f1('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x82f1('0x12')]=router; \ No newline at end of file +var _0xab63=['connect-timeout','express','Router','fs-extra','../../components/auth/service','get','index','isAuthenticated','show','post','create','put','update','/:id','destroy','exports','multer','util','path'];(function(_0x23302f,_0x132d22){var _0x2e61a7=function(_0x42a952){while(--_0x42a952){_0x23302f['push'](_0x23302f['shift']());}};_0x2e61a7(++_0x132d22);}(_0xab63,0x95));var _0x3ab6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xab63[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x3ab6('0x0'));var util=require(_0x3ab6('0x1'));var path=require(_0x3ab6('0x2'));var timeout=require(_0x3ab6('0x3'));var express=require(_0x3ab6('0x4'));var router=express[_0x3ab6('0x5')]();var fs_extra=require(_0x3ab6('0x6'));var auth=require(_0x3ab6('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./analyticTreeReport.controller');router[_0x3ab6('0x8')]('/',auth['isAuthenticated'](),controller[_0x3ab6('0x9')]);router[_0x3ab6('0x8')]('/:id',auth[_0x3ab6('0xa')](),controller[_0x3ab6('0xb')]);router[_0x3ab6('0xc')]('/',auth[_0x3ab6('0xa')](),controller[_0x3ab6('0xd')]);router[_0x3ab6('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x3ab6('0xf')]);router['delete'](_0x3ab6('0x10'),auth['isAuthenticated'](),controller[_0x3ab6('0x11')]);module[_0x3ab6('0x12')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index bc13882..1ebe295 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 _0xc43c=['exports','STRING','sequelize'];(function(_0x269fcd,_0x33c0a2){var _0x1831c1=function(_0x35b5c1){while(--_0x35b5c1){_0x269fcd['push'](_0x269fcd['shift']());}};_0x1831c1(++_0x33c0a2);}(_0xc43c,0x152));var _0xcc43=function(_0x398bdc,_0x12dd6a){_0x398bdc=_0x398bdc-0x0;var _0x3fe3b7=_0xc43c[_0x398bdc];return _0x3fe3b7;};'use strict';var Sequelize=require(_0xcc43('0x0'));module[_0xcc43('0x1')]={'name':{'type':Sequelize[_0xcc43('0x2')]},'basename':{'type':Sequelize[_0xcc43('0x2')]},'type':{'type':Sequelize[_0xcc43('0x2')]}}; \ No newline at end of file +var _0x4ab0=['STRING','exports'];(function(_0x2c0be1,_0x1e88f2){var _0x3d4bd2=function(_0x2b5497){while(--_0x2b5497){_0x2c0be1['push'](_0x2c0be1['shift']());}};_0x3d4bd2(++_0x1e88f2);}(_0x4ab0,0xd5));var _0x04ab=function(_0xc3f462,_0x4fdbee){_0xc3f462=_0xc3f462-0x0;var _0x3470fc=_0x4ab0[_0xc3f462];return _0x3470fc;};'use strict';var Sequelize=require('sequelize');module[_0x04ab('0x0')]={'name':{'type':Sequelize[_0x04ab('0x1')]},'basename':{'type':Sequelize[_0x04ab('0x1')]},'type':{'type':Sequelize[_0x04ab('0x1')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 16fa609..4ad20fe 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 _0x325a=['options','Attachment','includeAll','findAll','rows','catch','show','params','include','clone','omit','updatedAt','body','createdAt','update','find','file','basename','create','download','root','server/files/attachments/','join','offline-chat/','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','json','apply','reject','save','then','sendStatus','error','name','send','index','rawAttributes','fieldName','type','key','map','query','keys','intersection','model','fields','attributes','length','nolimit','order','sort','where','filters','pick','VIRTUAL','filter','merge'];(function(_0x217661,_0x1fbc3f){var _0x4ae813=function(_0x11173b){while(--_0x11173b){_0x217661['push'](_0x217661['shift']());}};_0x4ae813(++_0x1fbc3f);}(_0x325a,0x11d));var _0xa325=function(_0x466943,_0x310f20){_0x466943=_0x466943-0x0;var _0x573a01=_0x325a[_0x466943];return _0x573a01;};'use strict';var emlformat=require(_0xa325('0x0'));var rimraf=require(_0xa325('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa325('0x2'));var rp=require(_0xa325('0x3'));var moment=require(_0xa325('0x4'));var BPromise=require(_0xa325('0x5'));var Mustache=require(_0xa325('0x6'));var util=require(_0xa325('0x7'));var path=require(_0xa325('0x8'));var sox=require(_0xa325('0x9'));var csv=require(_0xa325('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa325('0xb'));var _=require(_0xa325('0xc'));var squel=require(_0xa325('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa325('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa325('0xf'));var Papa=require(_0xa325('0x10'));var Redis=require(_0xa325('0x11'));var authService=require(_0xa325('0x12'));var qs=require(_0xa325('0x13'));var as=require(_0xa325('0x14'));var hardwareService=require(_0xa325('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xa325('0x16'));var licenseUtil=require(_0xa325('0x17'));var db=require(_0xa325('0x18'))['db'];function respondWithStatusCode(_0xf4645b,_0x173975){_0x173975=_0x173975||0xcc;return function(_0x443a39){if(_0x443a39){return _0xf4645b['sendStatus'](_0x173975);}return _0xf4645b[_0xa325('0x19')](_0x173975)[_0xa325('0x1a')]();};}function respondWithResult(_0x3da9ff,_0x48b970){_0x48b970=_0x48b970||0xc8;return function(_0x1714e8){if(_0x1714e8){return _0x3da9ff['status'](_0x48b970)['json'](_0x1714e8);}};}function respondWithFilteredResult(_0x54cc20,_0xd86b91){return function(_0x46e8f0){if(_0x46e8f0){var _0x9d0a92=typeof _0xd86b91[_0xa325('0x1b')]===_0xa325('0x1c')&&typeof _0xd86b91[_0xa325('0x1d')]===_0xa325('0x1c');var _0x59873b=_0x46e8f0['count'];var _0x20af51=_0x9d0a92?0x0:_0xd86b91['offset'];var _0x18118e=_0x9d0a92?_0x46e8f0[_0xa325('0x1e')]:_0xd86b91[_0xa325('0x1b')]+_0xd86b91[_0xa325('0x1d')];var _0x31f335;if(_0x18118e>=_0x59873b){_0x18118e=_0x59873b;_0x31f335=0xc8;}else{_0x31f335=0xce;}_0x54cc20[_0xa325('0x19')](_0x31f335);return _0x54cc20[_0xa325('0x1f')]('Content-Range',_0x20af51+'-'+_0x18118e+'/'+_0x59873b)[_0xa325('0x20')](_0x46e8f0);}return null;};}function patchUpdates(_0x1f46ce){return function(_0x2fefd3){try{jsonpatch[_0xa325('0x21')](_0x2fefd3,_0x1f46ce,!![]);}catch(_0x5b182f){return BPromise[_0xa325('0x22')](_0x5b182f);}return _0x2fefd3[_0xa325('0x23')]();};}function saveUpdates(_0x37def8,_0x3ecd06){return function(_0x55e6f8){if(_0x55e6f8){return _0x55e6f8['update'](_0x37def8)[_0xa325('0x24')](function(_0x437057){return _0x437057;});}return null;};}function removeEntity(_0x1e13ed,_0x2254d3){return function(_0x1cf570){if(_0x1cf570){return _0x1cf570['destroy']()[_0xa325('0x24')](function(){_0x1e13ed[_0xa325('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x339e33,_0x551a49){return function(_0x19a3fa){if(!_0x19a3fa){_0x339e33[_0xa325('0x25')](0x194);}return _0x19a3fa;};}function handleError(_0x39eb6d,_0x4ac7dd){_0x4ac7dd=_0x4ac7dd||0x1f4;return function(_0x5dc3d0){logger[_0xa325('0x26')](_0x5dc3d0['stack']);if(_0x5dc3d0[_0xa325('0x27')]){delete _0x5dc3d0['name'];}_0x39eb6d[_0xa325('0x19')](_0x4ac7dd)[_0xa325('0x28')](_0x5dc3d0);};}exports[_0xa325('0x29')]=function(_0x5dd5cc,_0x5f2506){var _0x26882e={},_0xa9b2e2={},_0x26331e={'count':0x0,'rows':[]};var _0x56deff=_['map'](db['Attachment'][_0xa325('0x2a')],function(_0x3745bc){return{'name':_0x3745bc[_0xa325('0x2b')],'type':_0x3745bc[_0xa325('0x2c')][_0xa325('0x2d')]};});_0xa9b2e2['model']=_[_0xa325('0x2e')](_0x56deff,'name');_0xa9b2e2[_0xa325('0x2f')]=_[_0xa325('0x30')](_0x5dd5cc[_0xa325('0x2f')]);_0xa9b2e2['filters']=_[_0xa325('0x31')](_0xa9b2e2[_0xa325('0x32')],_0xa9b2e2['query']);_0x26882e['attributes']=_['intersection'](_0xa9b2e2[_0xa325('0x32')],qs[_0xa325('0x33')](_0x5dd5cc['query'][_0xa325('0x33')]));_0x26882e[_0xa325('0x34')]=_0x26882e['attributes'][_0xa325('0x35')]?_0x26882e[_0xa325('0x34')]:_0xa9b2e2[_0xa325('0x32')];if(!_0x5dd5cc['query']['hasOwnProperty'](_0xa325('0x36'))){_0x26882e[_0xa325('0x1d')]=qs['limit'](_0x5dd5cc[_0xa325('0x2f')][_0xa325('0x1d')]);_0x26882e[_0xa325('0x1b')]=qs[_0xa325('0x1b')](_0x5dd5cc[_0xa325('0x2f')]['offset']);}_0x26882e[_0xa325('0x37')]=qs[_0xa325('0x38')](_0x5dd5cc['query'][_0xa325('0x38')]);_0x26882e[_0xa325('0x39')]=qs[_0xa325('0x3a')](_[_0xa325('0x3b')](_0x5dd5cc[_0xa325('0x2f')],_0xa9b2e2[_0xa325('0x3a')]),_0x56deff);if(_0x5dd5cc[_0xa325('0x2f')]['filter']){_0x26882e[_0xa325('0x39')]=_['merge'](_0x26882e[_0xa325('0x39')],{'$or':_['map'](_0x56deff,function(_0x1b8cfc){if(_0x1b8cfc[_0xa325('0x2c')]!==_0xa325('0x3c')){var _0x21c4f7={};_0x21c4f7[_0x1b8cfc[_0xa325('0x27')]]={'$like':'%'+_0x5dd5cc[_0xa325('0x2f')][_0xa325('0x3d')]+'%'};return _0x21c4f7;}})});}_0x26882e=_[_0xa325('0x3e')]({},_0x26882e,_0x5dd5cc[_0xa325('0x3f')]);var _0x27c8ab={'where':_0x26882e[_0xa325('0x39')]};return db[_0xa325('0x40')][_0xa325('0x1e')](_0x27c8ab)[_0xa325('0x24')](function(_0x29c728){_0x26331e[_0xa325('0x1e')]=_0x29c728;if(_0x5dd5cc['query'][_0xa325('0x41')]){_0x26882e['include']=[{'all':!![]}];}return db[_0xa325('0x40')][_0xa325('0x42')](_0x26882e);})[_0xa325('0x24')](function(_0x44d382){_0x26331e[_0xa325('0x43')]=_0x44d382;return _0x26331e;})[_0xa325('0x24')](respondWithFilteredResult(_0x5f2506,_0x26882e))[_0xa325('0x44')](handleError(_0x5f2506,null));};exports[_0xa325('0x45')]=function(_0x27bf9c,_0x361786){var _0x5d8e99={'raw':!![],'where':{'id':_0x27bf9c[_0xa325('0x46')]['id']}},_0x5ce503={};_0x5ce503[_0xa325('0x32')]=_[_0xa325('0x30')](db[_0xa325('0x40')][_0xa325('0x2a')]);_0x5ce503[_0xa325('0x2f')]=_['keys'](_0x27bf9c[_0xa325('0x2f')]);_0x5ce503['filters']=_['intersection'](_0x5ce503[_0xa325('0x32')],_0x5ce503['query']);_0x5d8e99[_0xa325('0x34')]=_[_0xa325('0x31')](_0x5ce503['model'],qs[_0xa325('0x33')](_0x27bf9c[_0xa325('0x2f')][_0xa325('0x33')]));_0x5d8e99[_0xa325('0x34')]=_0x5d8e99[_0xa325('0x34')][_0xa325('0x35')]?_0x5d8e99[_0xa325('0x34')]:_0x5ce503[_0xa325('0x32')];if(_0x27bf9c[_0xa325('0x2f')][_0xa325('0x41')]){_0x5d8e99[_0xa325('0x47')]=[{'all':!![]}];}_0x5d8e99=_[_0xa325('0x3e')]({},_0x5d8e99,_0x27bf9c[_0xa325('0x3f')]);return db[_0xa325('0x40')]['find'](_0x5d8e99)['then'](handleEntityNotFound(_0x361786,null))[_0xa325('0x24')](respondWithResult(_0x361786,null))['catch'](handleError(_0x361786,null));};exports[_0xa325('0x48')]=function(_0x15736e,_0x4821ec){var _0x401e95={'where':{'id':_0x15736e['params']['id']}},_0x60d3a2={};_0x60d3a2[_0xa325('0x32')]=_[_0xa325('0x30')](db['Attachment'][_0xa325('0x2a')]);_0x401e95[_0xa325('0x34')]=_['intersection'](_0x60d3a2[_0xa325('0x32')],qs[_0xa325('0x33')](_0x15736e[_0xa325('0x2f')][_0xa325('0x33')]));_0x401e95[_0xa325('0x34')]=_0x401e95['attributes'][_0xa325('0x35')]?_0x401e95[_0xa325('0x34')]:_0x60d3a2[_0xa325('0x32')];if(_0x15736e[_0xa325('0x2f')]['includeAll']){_0x401e95['include']=[{'all':!![]}];}_0x401e95=_[_0xa325('0x3e')]({},_0x401e95,_0x15736e[_0xa325('0x3f')]);return db['Attachment']['find'](_0x401e95)[_0xa325('0x24')](handleEntityNotFound(_0x4821ec,null))[_0xa325('0x24')](function(_0x5779fb){if(_0x5779fb){var _0x169108=_0x5779fb['get']({'plain':!![]});_0x169108=qs[_0xa325('0x49')](_0x169108,['id','createdAt',_0xa325('0x4a')]);_0x15736e[_0xa325('0x4b')]=_[_0xa325('0x49')](_0x15736e['body'],['id',_0xa325('0x4c'),_0xa325('0x4a')]);return db['Attachment']['create'](_['merge'](_0x169108,_0x15736e[_0xa325('0x4b')]),{'include':_0x15736e['query']['includeAll']?[{'all':!![]}]:undefined});}})[_0xa325('0x24')](respondWithResult(_0x4821ec,0xc9))[_0xa325('0x44')](handleError(_0x4821ec,null));};exports[_0xa325('0x4d')]=function(_0x4663a3,_0x53ad7f){if(_0x4663a3[_0xa325('0x4b')]['id']){delete _0x4663a3[_0xa325('0x4b')]['id'];}return db['Attachment'][_0xa325('0x4e')]({'where':{'id':_0x4663a3[_0xa325('0x46')]['id']}})['then'](handleEntityNotFound(_0x53ad7f,null))[_0xa325('0x24')](saveUpdates(_0x4663a3[_0xa325('0x4b')],null))[_0xa325('0x24')](respondWithResult(_0x53ad7f,null))[_0xa325('0x44')](handleError(_0x53ad7f,null));};exports['destroy']=function(_0x4785d9,_0x2ac7a1){return db['Attachment'][_0xa325('0x4e')]({'where':{'id':_0x4785d9[_0xa325('0x46')]['id']}})[_0xa325('0x24')](handleEntityNotFound(_0x2ac7a1,null))[_0xa325('0x24')](removeEntity(_0x2ac7a1,null))[_0xa325('0x44')](handleError(_0x2ac7a1,null));};exports['create']=function(_0x162478,_0x2a4222,_0x362f92){_0x162478[_0xa325('0x4b')][_0xa325('0x27')]=_0x162478[_0xa325('0x4f')]['originalname'];_0x162478[_0xa325('0x4b')][_0xa325('0x50')]=_0x162478[_0xa325('0x4f')]['filename'];_0x162478[_0xa325('0x4b')][_0xa325('0x2c')]=_0x162478[_0xa325('0x4f')]['mimetype'];return db['Attachment'][_0xa325('0x51')](_0x162478[_0xa325('0x4b')])[_0xa325('0x24')](respondWithResult(_0x2a4222,0xc9))[_0xa325('0x44')](handleError(_0x2a4222,null));};exports[_0xa325('0x52')]=function(_0x36234e,_0x223a44,_0x476d1c){return db[_0xa325('0x40')]['findOne']({'where':{'id':_0x36234e[_0xa325('0x46')]['id']},'raw':!![]})[_0xa325('0x24')](handleEntityNotFound(_0x223a44,null))[_0xa325('0x24')](function(_0x1630ab){if(_0x1630ab){var _0xfc2d11=_0x1630ab['ChatOfflineMessageId']!==null;var _0x428c05=path['join'](config[_0xa325('0x53')],_0xa325('0x54'));if(_0xfc2d11){_0x428c05=path[_0xa325('0x55')](_0x428c05,_0xa325('0x56'));}var _0x3f9050=path[_0xa325('0x55')](_0x428c05,_0x1630ab['basename']);return _0x223a44[_0xa325('0x52')](_0x3f9050);}})[_0xa325('0x44')](handleError(_0x223a44,null));}; \ No newline at end of file +var _0x0c5e=['Attachment','includeAll','include','findAll','show','params','rawAttributes','intersection','find','catch','clone','merge','get','omit','createdAt','updatedAt','body','create','file','originalname','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','fieldName','type','key','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','options'];(function(_0x34752d,_0x3e18e1){var _0x3d5b99=function(_0x452ab6){while(--_0x452ab6){_0x34752d['push'](_0x34752d['shift']());}};_0x3d5b99(++_0x3e18e1);}(_0x0c5e,0x1f0));var _0xe0c5=function(_0x1c66f1,_0x53c85c){_0x1c66f1=_0x1c66f1-0x0;var _0x682d89=_0x0c5e[_0x1c66f1];return _0x682d89;};'use strict';var emlformat=require(_0xe0c5('0x0'));var rimraf=require(_0xe0c5('0x1'));var zipdir=require(_0xe0c5('0x2'));var jsonpatch=require(_0xe0c5('0x3'));var rp=require('request-promise');var moment=require(_0xe0c5('0x4'));var BPromise=require(_0xe0c5('0x5'));var Mustache=require(_0xe0c5('0x6'));var util=require(_0xe0c5('0x7'));var path=require(_0xe0c5('0x8'));var sox=require(_0xe0c5('0x9'));var csv=require(_0xe0c5('0xa'));var ejs=require(_0xe0c5('0xb'));var fs=require('fs');var fs_extra=require(_0xe0c5('0xc'));var _=require(_0xe0c5('0xd'));var squel=require('squel');var crypto=require(_0xe0c5('0xe'));var jsforce=require(_0xe0c5('0xf'));var deskjs=require(_0xe0c5('0x10'));var toCsv=require('to-csv');var querystring=require(_0xe0c5('0x11'));var Papa=require(_0xe0c5('0x12'));var Redis=require(_0xe0c5('0x13'));var authService=require(_0xe0c5('0x14'));var qs=require(_0xe0c5('0x15'));var as=require(_0xe0c5('0x16'));var hardwareService=require(_0xe0c5('0x17'));var logger=require(_0xe0c5('0x18'))(_0xe0c5('0x19'));var utils=require(_0xe0c5('0x1a'));var config=require(_0xe0c5('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0xe0c5('0x1c'))['db'];function respondWithStatusCode(_0x372423,_0x1a591d){_0x1a591d=_0x1a591d||0xcc;return function(_0x47a361){if(_0x47a361){return _0x372423[_0xe0c5('0x1d')](_0x1a591d);}return _0x372423[_0xe0c5('0x1e')](_0x1a591d)[_0xe0c5('0x1f')]();};}function respondWithResult(_0x52a896,_0xa69806){_0xa69806=_0xa69806||0xc8;return function(_0x2fc07f){if(_0x2fc07f){return _0x52a896[_0xe0c5('0x1e')](_0xa69806)[_0xe0c5('0x20')](_0x2fc07f);}};}function respondWithFilteredResult(_0xb68d5f,_0x5e9ab0){return function(_0x278f07){if(_0x278f07){var _0x13347f=typeof _0x5e9ab0[_0xe0c5('0x21')]==='undefined'&&typeof _0x5e9ab0['limit']===_0xe0c5('0x22');var _0x4cf76b=_0x278f07[_0xe0c5('0x23')];var _0x5b5b7d=_0x13347f?0x0:_0x5e9ab0[_0xe0c5('0x21')];var _0x18bf26=_0x13347f?_0x278f07['count']:_0x5e9ab0[_0xe0c5('0x21')]+_0x5e9ab0['limit'];var _0x2cd058;if(_0x18bf26>=_0x4cf76b){_0x18bf26=_0x4cf76b;_0x2cd058=0xc8;}else{_0x2cd058=0xce;}_0xb68d5f[_0xe0c5('0x1e')](_0x2cd058);return _0xb68d5f[_0xe0c5('0x24')](_0xe0c5('0x25'),_0x5b5b7d+'-'+_0x18bf26+'/'+_0x4cf76b)[_0xe0c5('0x20')](_0x278f07);}return null;};}function patchUpdates(_0x4803cc){return function(_0x5470d0){try{jsonpatch[_0xe0c5('0x26')](_0x5470d0,_0x4803cc,!![]);}catch(_0xf574ac){return BPromise[_0xe0c5('0x27')](_0xf574ac);}return _0x5470d0[_0xe0c5('0x28')]();};}function saveUpdates(_0x4d5f2c,_0x17bdfb){return function(_0x22e999){if(_0x22e999){return _0x22e999[_0xe0c5('0x29')](_0x4d5f2c)[_0xe0c5('0x2a')](function(_0x25d129){return _0x25d129;});}return null;};}function removeEntity(_0x4fe8bf,_0x145663){return function(_0x3b1d2e){if(_0x3b1d2e){return _0x3b1d2e[_0xe0c5('0x2b')]()[_0xe0c5('0x2a')](function(){_0x4fe8bf[_0xe0c5('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d9845,_0x3f2259){return function(_0x4bc390){if(!_0x4bc390){_0x3d9845[_0xe0c5('0x1d')](0x194);}return _0x4bc390;};}function handleError(_0x16bd3b,_0x1298ca){_0x1298ca=_0x1298ca||0x1f4;return function(_0x3bf03b){logger[_0xe0c5('0x2c')](_0x3bf03b[_0xe0c5('0x2d')]);if(_0x3bf03b[_0xe0c5('0x2e')]){delete _0x3bf03b[_0xe0c5('0x2e')];}_0x16bd3b[_0xe0c5('0x1e')](_0x1298ca)[_0xe0c5('0x2f')](_0x3bf03b);};}exports['index']=function(_0x4a8bbc,_0x12453f){var _0x5c7f41={},_0x18883e={},_0x1b6df8={'count':0x0,'rows':[]};var _0x4bdbba=_[_0xe0c5('0x30')](db['Attachment']['rawAttributes'],function(_0x1c77b2){return{'name':_0x1c77b2[_0xe0c5('0x31')],'type':_0x1c77b2[_0xe0c5('0x32')][_0xe0c5('0x33')]};});_0x18883e[_0xe0c5('0x34')]=_[_0xe0c5('0x30')](_0x4bdbba,'name');_0x18883e['query']=_[_0xe0c5('0x35')](_0x4a8bbc[_0xe0c5('0x36')]);_0x18883e[_0xe0c5('0x37')]=_['intersection'](_0x18883e['model'],_0x18883e[_0xe0c5('0x36')]);_0x5c7f41[_0xe0c5('0x38')]=_['intersection'](_0x18883e['model'],qs[_0xe0c5('0x39')](_0x4a8bbc[_0xe0c5('0x36')]['fields']));_0x5c7f41['attributes']=_0x5c7f41[_0xe0c5('0x38')][_0xe0c5('0x3a')]?_0x5c7f41[_0xe0c5('0x38')]:_0x18883e[_0xe0c5('0x34')];if(!_0x4a8bbc['query'][_0xe0c5('0x3b')](_0xe0c5('0x3c'))){_0x5c7f41[_0xe0c5('0x3d')]=qs[_0xe0c5('0x3d')](_0x4a8bbc[_0xe0c5('0x36')][_0xe0c5('0x3d')]);_0x5c7f41[_0xe0c5('0x21')]=qs[_0xe0c5('0x21')](_0x4a8bbc[_0xe0c5('0x36')][_0xe0c5('0x21')]);}_0x5c7f41[_0xe0c5('0x3e')]=qs[_0xe0c5('0x3f')](_0x4a8bbc['query'][_0xe0c5('0x3f')]);_0x5c7f41[_0xe0c5('0x40')]=qs[_0xe0c5('0x37')](_[_0xe0c5('0x41')](_0x4a8bbc[_0xe0c5('0x36')],_0x18883e[_0xe0c5('0x37')]),_0x4bdbba);if(_0x4a8bbc[_0xe0c5('0x36')][_0xe0c5('0x42')]){_0x5c7f41[_0xe0c5('0x40')]=_['merge'](_0x5c7f41[_0xe0c5('0x40')],{'$or':_[_0xe0c5('0x30')](_0x4bdbba,function(_0x4771dc){if(_0x4771dc[_0xe0c5('0x32')]!=='VIRTUAL'){var _0x540fb9={};_0x540fb9[_0x4771dc[_0xe0c5('0x2e')]]={'$like':'%'+_0x4a8bbc['query'][_0xe0c5('0x42')]+'%'};return _0x540fb9;}})});}_0x5c7f41=_['merge']({},_0x5c7f41,_0x4a8bbc[_0xe0c5('0x43')]);var _0x2c3219={'where':_0x5c7f41[_0xe0c5('0x40')]};return db[_0xe0c5('0x44')][_0xe0c5('0x23')](_0x2c3219)[_0xe0c5('0x2a')](function(_0x542d22){_0x1b6df8[_0xe0c5('0x23')]=_0x542d22;if(_0x4a8bbc['query'][_0xe0c5('0x45')]){_0x5c7f41[_0xe0c5('0x46')]=[{'all':!![]}];}return db[_0xe0c5('0x44')][_0xe0c5('0x47')](_0x5c7f41);})['then'](function(_0x4e9636){_0x1b6df8['rows']=_0x4e9636;return _0x1b6df8;})['then'](respondWithFilteredResult(_0x12453f,_0x5c7f41))['catch'](handleError(_0x12453f,null));};exports[_0xe0c5('0x48')]=function(_0x4920ab,_0x5c7166){var _0x5610e9={'raw':!![],'where':{'id':_0x4920ab[_0xe0c5('0x49')]['id']}},_0x2adb08={};_0x2adb08[_0xe0c5('0x34')]=_[_0xe0c5('0x35')](db[_0xe0c5('0x44')][_0xe0c5('0x4a')]);_0x2adb08[_0xe0c5('0x36')]=_[_0xe0c5('0x35')](_0x4920ab[_0xe0c5('0x36')]);_0x2adb08[_0xe0c5('0x37')]=_[_0xe0c5('0x4b')](_0x2adb08[_0xe0c5('0x34')],_0x2adb08[_0xe0c5('0x36')]);_0x5610e9['attributes']=_[_0xe0c5('0x4b')](_0x2adb08[_0xe0c5('0x34')],qs[_0xe0c5('0x39')](_0x4920ab['query'][_0xe0c5('0x39')]));_0x5610e9['attributes']=_0x5610e9[_0xe0c5('0x38')][_0xe0c5('0x3a')]?_0x5610e9[_0xe0c5('0x38')]:_0x2adb08[_0xe0c5('0x34')];if(_0x4920ab[_0xe0c5('0x36')][_0xe0c5('0x45')]){_0x5610e9['include']=[{'all':!![]}];}_0x5610e9=_['merge']({},_0x5610e9,_0x4920ab['options']);return db[_0xe0c5('0x44')][_0xe0c5('0x4c')](_0x5610e9)[_0xe0c5('0x2a')](handleEntityNotFound(_0x5c7166,null))[_0xe0c5('0x2a')](respondWithResult(_0x5c7166,null))[_0xe0c5('0x4d')](handleError(_0x5c7166,null));};exports[_0xe0c5('0x4e')]=function(_0x57e433,_0x5aa38e){var _0x3228bd={'where':{'id':_0x57e433[_0xe0c5('0x49')]['id']}},_0x17af23={};_0x17af23[_0xe0c5('0x34')]=_['keys'](db[_0xe0c5('0x44')][_0xe0c5('0x4a')]);_0x3228bd[_0xe0c5('0x38')]=_[_0xe0c5('0x4b')](_0x17af23['model'],qs[_0xe0c5('0x39')](_0x57e433[_0xe0c5('0x36')][_0xe0c5('0x39')]));_0x3228bd[_0xe0c5('0x38')]=_0x3228bd[_0xe0c5('0x38')]['length']?_0x3228bd[_0xe0c5('0x38')]:_0x17af23[_0xe0c5('0x34')];if(_0x57e433[_0xe0c5('0x36')][_0xe0c5('0x45')]){_0x3228bd[_0xe0c5('0x46')]=[{'all':!![]}];}_0x3228bd=_[_0xe0c5('0x4f')]({},_0x3228bd,_0x57e433[_0xe0c5('0x43')]);return db[_0xe0c5('0x44')][_0xe0c5('0x4c')](_0x3228bd)[_0xe0c5('0x2a')](handleEntityNotFound(_0x5aa38e,null))[_0xe0c5('0x2a')](function(_0x1e42fe){if(_0x1e42fe){var _0xcc2c62=_0x1e42fe[_0xe0c5('0x50')]({'plain':!![]});_0xcc2c62=qs[_0xe0c5('0x51')](_0xcc2c62,['id',_0xe0c5('0x52'),_0xe0c5('0x53')]);_0x57e433['body']=_[_0xe0c5('0x51')](_0x57e433[_0xe0c5('0x54')],['id',_0xe0c5('0x52'),'updatedAt']);return db[_0xe0c5('0x44')][_0xe0c5('0x55')](_['merge'](_0xcc2c62,_0x57e433[_0xe0c5('0x54')]),{'include':_0x57e433[_0xe0c5('0x36')][_0xe0c5('0x45')]?[{'all':!![]}]:undefined});}})[_0xe0c5('0x2a')](respondWithResult(_0x5aa38e,0xc9))[_0xe0c5('0x4d')](handleError(_0x5aa38e,null));};exports[_0xe0c5('0x29')]=function(_0x1cfeff,_0x510f0d){if(_0x1cfeff['body']['id']){delete _0x1cfeff[_0xe0c5('0x54')]['id'];}return db[_0xe0c5('0x44')][_0xe0c5('0x4c')]({'where':{'id':_0x1cfeff[_0xe0c5('0x49')]['id']}})[_0xe0c5('0x2a')](handleEntityNotFound(_0x510f0d,null))[_0xe0c5('0x2a')](saveUpdates(_0x1cfeff[_0xe0c5('0x54')],null))[_0xe0c5('0x2a')](respondWithResult(_0x510f0d,null))[_0xe0c5('0x4d')](handleError(_0x510f0d,null));};exports['destroy']=function(_0xde88ba,_0x4f1387){return db['Attachment']['find']({'where':{'id':_0xde88ba[_0xe0c5('0x49')]['id']}})[_0xe0c5('0x2a')](handleEntityNotFound(_0x4f1387,null))[_0xe0c5('0x2a')](removeEntity(_0x4f1387,null))[_0xe0c5('0x4d')](handleError(_0x4f1387,null));};exports[_0xe0c5('0x55')]=function(_0x1ae708,_0x38b504,_0x2bf540){_0x1ae708[_0xe0c5('0x54')][_0xe0c5('0x2e')]=_0x1ae708[_0xe0c5('0x56')][_0xe0c5('0x57')];_0x1ae708[_0xe0c5('0x54')]['basename']=_0x1ae708[_0xe0c5('0x56')]['filename'];_0x1ae708[_0xe0c5('0x54')][_0xe0c5('0x32')]=_0x1ae708['file']['mimetype'];return db[_0xe0c5('0x44')][_0xe0c5('0x55')](_0x1ae708[_0xe0c5('0x54')])[_0xe0c5('0x2a')](respondWithResult(_0x38b504,0xc9))['catch'](handleError(_0x38b504,null));};exports['download']=function(_0x74c4db,_0x4925cb,_0x3be766){return db[_0xe0c5('0x44')]['findOne']({'where':{'id':_0x74c4db[_0xe0c5('0x49')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x4925cb,null))['then'](function(_0x4f4045){if(_0x4f4045){var _0x4b9147=_0x4f4045[_0xe0c5('0x58')]!==null;var _0x859515=path[_0xe0c5('0x59')](config[_0xe0c5('0x5a')],_0xe0c5('0x5b'));if(_0x4b9147){_0x859515=path[_0xe0c5('0x59')](_0x859515,_0xe0c5('0x5c'));}var _0x40e6b1=path[_0xe0c5('0x59')](_0x859515,_0x4f4045['basename']);return _0x4925cb[_0xe0c5('0x5d')](_0x40e6b1);}})[_0xe0c5('0x4d')](handleError(_0x4925cb,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 83955f0..e23dd2a 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 _0xe352=['../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./attachment.attributes','exports','lodash'];(function(_0x38ce4c,_0xfdbe8c){var _0x5d4544=function(_0x503537){while(--_0x503537){_0x38ce4c['push'](_0x38ce4c['shift']());}};_0x5d4544(++_0xfdbe8c);}(_0xe352,0x1ca));var _0x2e35=function(_0x1ec679,_0x242cbb){_0x1ec679=_0x1ec679-0x0;var _0x410733=_0xe352[_0x1ec679];return _0x410733;};'use strict';var _=require(_0x2e35('0x0'));var util=require('util');var logger=require(_0x2e35('0x1'))('api');var moment=require(_0x2e35('0x2'));var BPromise=require('bluebird');var rp=require(_0x2e35('0x3'));var fs=require('fs');var path=require(_0x2e35('0x4'));var rimraf=require(_0x2e35('0x5'));var config=require(_0x2e35('0x6'));var attributes=require(_0x2e35('0x7'));module[_0x2e35('0x8')]=function(_0x1217a2,_0x465af3){return _0x1217a2['define']('Attachment',attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7169=['lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes','exports','Attachment'];(function(_0x1b0fc9,_0x1282b9){var _0x314cc3=function(_0x4f5c4c){while(--_0x4f5c4c){_0x1b0fc9['push'](_0x1b0fc9['shift']());}};_0x314cc3(++_0x1282b9);}(_0x7169,0x197));var _0x9716=function(_0x58afd5,_0x534a48){_0x58afd5=_0x58afd5-0x0;var _0x3e503b=_0x7169[_0x58afd5];return _0x3e503b;};'use strict';var _=require(_0x9716('0x0'));var util=require(_0x9716('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x9716('0x2'));var BPromise=require(_0x9716('0x3'));var rp=require(_0x9716('0x4'));var fs=require('fs');var path=require(_0x9716('0x5'));var rimraf=require(_0x9716('0x6'));var config=require(_0x9716('0x7'));var attributes=require(_0x9716('0x8'));module[_0x9716('0x9')]=function(_0x33ae38,_0x2e83df){return _0x33ae38['define'](_0x9716('0xa'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js index 5c3f03b..f62b775 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 _0xe13a=['request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CreateAttachment','Attachment','body','options','raw','debug','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s'];(function(_0x639772,_0x19d681){var _0x54da9f=function(_0x1ef32b){while(--_0x1ef32b){_0x639772['push'](_0x639772['shift']());}};_0x54da9f(++_0x19d681);}(_0xe13a,0x178));var _0xae13=function(_0x1e604e,_0x3384af){_0x1e604e=_0x1e604e-0x0;var _0x1383ce=_0xe13a[_0x1e604e];return _0x1383ce;};'use strict';var _=require('lodash');var util=require(_0xae13('0x0'));var moment=require(_0xae13('0x1'));var BPromise=require(_0xae13('0x2'));var rs=require(_0xae13('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xae13('0x4'))['db'];var utils=require(_0xae13('0x5'));var logger=require(_0xae13('0x6'))(_0xae13('0x7'));var config=require(_0xae13('0x8'));var jayson=require(_0xae13('0x9'));var client=jayson[_0xae13('0xa')][_0xae13('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x341ba4,_0x4ae51f,_0x2f6d10){return new BPromise(function(_0x2b2e1f,_0x27fefd){return client[_0xae13('0xc')](_0x341ba4,_0x2f6d10)[_0xae13('0xd')](function(_0x41bf44){logger[_0xae13('0xe')](_0xae13('0xf'),_0x4ae51f,_0xae13('0x10'));logger['debug'](_0xae13('0x11'),_0x4ae51f,_0xae13('0x10'),JSON[_0xae13('0x12')](_0x41bf44));if(_0x41bf44[_0xae13('0x13')]){if(_0x41bf44[_0xae13('0x13')][_0xae13('0x14')]===0x1f4){logger[_0xae13('0x13')]('Attachment,\x20%s,\x20%s',_0x4ae51f,_0x41bf44[_0xae13('0x13')][_0xae13('0x15')]);return _0x27fefd(_0x41bf44['error']['message']);}logger['error']('Attachment,\x20%s,\x20%s',_0x4ae51f,_0x41bf44['error'][_0xae13('0x15')]);return _0x2b2e1f(_0x41bf44[_0xae13('0x13')][_0xae13('0x15')]);}else{logger[_0xae13('0xe')](_0xae13('0xf'),_0x4ae51f,_0xae13('0x10'));_0x2b2e1f(_0x41bf44['result'][_0xae13('0x15')]);}})['catch'](function(_0xe10aab){logger[_0xae13('0x13')](_0xae13('0xf'),_0x4ae51f,_0xe10aab);_0x27fefd(_0xe10aab);});});}exports[_0xae13('0x16')]=function(_0x1a9c07){var _0x1b33b7=this;return new Promise(function(_0x32dcbe,_0x326471){return db[_0xae13('0x17')]['create'](_0x1a9c07[_0xae13('0x18')],{'raw':_0x1a9c07['options']?_0x1a9c07[_0xae13('0x19')][_0xae13('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x25a195){logger[_0xae13('0xe')](_0xae13('0x16'),_0x1a9c07);logger[_0xae13('0x1b')](_0xae13('0x16'),_0x1a9c07,JSON[_0xae13('0x12')](_0x25a195));_0x32dcbe(_0x25a195);})['catch'](function(_0x520692){logger[_0xae13('0x13')](_0xae13('0x16'),_0x520692['message'],_0x1a9c07);_0x326471(_0x1b33b7[_0xae13('0x13')](0x1f4,_0x520692['message']));});});}; \ No newline at end of file +var _0x9221=['jayson/promise','client','http','request','info','Attachment,\x20%s,\x20%s','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','Attachment','options','raw','then','CreateAttachment','catch','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x1ae663,_0x17c8d2){var _0x2e576b=function(_0x4ec93a){while(--_0x4ec93a){_0x1ae663['push'](_0x1ae663['shift']());}};_0x2e576b(++_0x17c8d2);}(_0x9221,0x64));var _0x1922=function(_0x9fce47,_0x38c3e6){_0x9fce47=_0x9fce47-0x0;var _0x29e671=_0x9221[_0x9fce47];return _0x29e671;};'use strict';var _=require('lodash');var util=require(_0x1922('0x0'));var moment=require(_0x1922('0x1'));var BPromise=require('bluebird');var rs=require(_0x1922('0x2'));var fs=require('fs');var Redis=require(_0x1922('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1922('0x4'));var logger=require(_0x1922('0x5'))(_0x1922('0x6'));var config=require(_0x1922('0x7'));var jayson=require(_0x1922('0x8'));var client=jayson[_0x1922('0x9')][_0x1922('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5aa05c,_0x116227,_0x3cfd98){return new BPromise(function(_0x195fa4,_0x47c225){return client[_0x1922('0xb')](_0x5aa05c,_0x3cfd98)['then'](function(_0x2b6c51){logger[_0x1922('0xc')](_0x1922('0xd'),_0x116227,'request\x20sent');logger[_0x1922('0xe')](_0x1922('0xf'),_0x116227,'request\x20sent',JSON[_0x1922('0x10')](_0x2b6c51));if(_0x2b6c51['error']){if(_0x2b6c51[_0x1922('0x11')]['code']===0x1f4){logger[_0x1922('0x11')](_0x1922('0xd'),_0x116227,_0x2b6c51[_0x1922('0x11')]['message']);return _0x47c225(_0x2b6c51['error'][_0x1922('0x12')]);}logger[_0x1922('0x11')](_0x1922('0xd'),_0x116227,_0x2b6c51[_0x1922('0x11')][_0x1922('0x12')]);return _0x195fa4(_0x2b6c51['error'][_0x1922('0x12')]);}else{logger['info'](_0x1922('0xd'),_0x116227,_0x1922('0x13'));_0x195fa4(_0x2b6c51[_0x1922('0x14')][_0x1922('0x12')]);}})['catch'](function(_0x459511){logger[_0x1922('0x11')](_0x1922('0xd'),_0x116227,_0x459511);_0x47c225(_0x459511);});});}exports['CreateAttachment']=function(_0x482f68){var _0x372875=this;return new Promise(function(_0x51acda,_0x3c6f9a){return db[_0x1922('0x15')]['create'](_0x482f68['body'],{'raw':_0x482f68[_0x1922('0x16')]?_0x482f68['options'][_0x1922('0x17')]===undefined?!![]:![]:!![]})[_0x1922('0x18')](function(_0x1fb6a4){logger[_0x1922('0xc')]('CreateAttachment',_0x482f68);logger[_0x1922('0xe')](_0x1922('0x19'),_0x482f68,JSON[_0x1922('0x10')](_0x1fb6a4));_0x51acda(_0x1fb6a4);})[_0x1922('0x1a')](function(_0x554f8b){logger[_0x1922('0x11')](_0x1922('0x19'),_0x554f8b[_0x1922('0x12')],_0x482f68);_0x3c6f9a(_0x372875['error'](0x1f4,_0x554f8b[_0x1922('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 9bd8853..3c9c686 100644 --- a/server/api/attachment/index.js +++ b/server/api/attachment/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0x1f7294,_0x1f5fe6){var _0x557fbd=function(_0x547403){while(--_0x547403){_0x1f7294['push'](_0x1f7294['shift']());}};_0x557fbd(++_0x1f5fe6);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4962ca,_0x48d6b8){_0x4962ca=_0x4962ca-0x0;var _0x40bd29=_0x5f2f[_0x4962ca];return _0x40bd29;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('0x1f')]=router; \ No newline at end of file +var _0x5f66=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','/:id/clone','clone','diskStorage','root','format','%s-%s','now','originalname','replace','post','single','file','create','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x376db5,_0x2b8874){var _0x304c17=function(_0x2dd9ba){while(--_0x2dd9ba){_0x376db5['push'](_0x376db5['shift']());}};_0x304c17(++_0x2b8874);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x5f66[_0x4243a3];return _0x1b2a33;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./attachment.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['download']);router['post'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);var upload=multer({'storage':multer[_0x65f6('0xe')]({'destination':function(_0x50d26d,_0x41a7fd,_0x571436){_0x571436(null,path['join'](config[_0x65f6('0xf')],'server/files/attachments/'));},'filename':function(_0x419819,_0x4862a5,_0x2f964a){_0x2f964a(null,util[_0x65f6('0x10')](_0x65f6('0x11'),Date[_0x65f6('0x12')](),_0x4862a5[_0x65f6('0x13')][_0x65f6('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x65f6('0x15')]('/',upload[_0x65f6('0x16')](_0x65f6('0x17')),controller[_0x65f6('0x18')]);router['put'](_0x65f6('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x65f6('0x19')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x1a')]);module[_0x65f6('0x1b')]=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index d4fa508..5c47f7a 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 _0xac4e=['online','admin','user','add','minutes','getLicense','catch','status','send','message','authenticate','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','use','passport','passport-local','Strategy','moment','bluebird','util','../../components/auth/service','../../config/environment','api','activedirectory','undefined','url','domain','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','error','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','blockDuration','then','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','role','disabled','blocked','blockedAt'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xac4e,0x19a));var _0xeac4=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xac4e[_0x501510];return _0x1e6ee5;};'use strict';var passport=require(_0xeac4('0x0'));var LocalStrategy=require(_0xeac4('0x1'))[_0xeac4('0x2')];var moment=require(_0xeac4('0x3'));var ActiveDirectory=require('activedirectory2');var BPromise=require(_0xeac4('0x4'));var util=require(_0xeac4('0x5'));var db=require('../../mysqldb')['db'];var authService=require(_0xeac4('0x6'));var utils=require('../../config/utils');var config=require(_0xeac4('0x7'));var logger=require('../../config/logger')(_0xeac4('0x8'));function isActiveDirectoryConfigured(_0x47f5dc){var _0xdef2ab=![];if(typeof _0x47f5dc[_0xeac4('0x9')]!==_0xeac4('0xa')){_0xdef2ab=_0x47f5dc[_0xeac4('0x9')]['baseDN']&&_0x47f5dc['activedirectory'][_0xeac4('0xb')]&&_0x47f5dc[_0xeac4('0x9')][_0xeac4('0xc')];}return _0xdef2ab;}function adAuthenticate(_0x155082,_0xbe5ebf,_0x25a4c6){return new BPromise(function(_0x5a8a84,_0x52ac02){try{var _0x34d87d=new ActiveDirectory(_0x155082);_0x34d87d['authenticate'](_0xbe5ebf,_0x25a4c6,function(_0x16a868,_0x11b95a){if(_0x16a868){logger['error'](_0xeac4('0xd'),_0xbe5ebf,util[_0xeac4('0xe')](_0x16a868,{'showHidden':![],'depth':null}));_0x52ac02(_0xeac4('0xf'));}else if(!_0x11b95a){logger['error']('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0xbe5ebf);_0x52ac02('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x5a8a84(_0x11b95a);}});}catch(_0x2900f7){_0x52ac02(_0x2900f7);}});}function ActiveDirectoryAuthenticate(_0x6b3769,_0x5ed1d0,_0x11d7d7,_0x39ade2){var _0x13b59a,_0xa5a5e7;if(!isActiveDirectoryConfigured(config)){logger[_0xeac4('0x10')](_0xeac4('0x11'),_0x5ed1d0);return _0x39ade2(null,![],{'message':_0xeac4('0xf')});}return db[_0xeac4('0x12')][_0xeac4('0x13')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0xeac4('0x14')],'raw':!![]})[_0xeac4('0x15')](function(_0x38af0e){_0x13b59a=_0x38af0e;if(!_0x13b59a[_0xeac4('0x16')]){logger['error'](_0xeac4('0x17'),_0x5ed1d0);throw new Error(_0xeac4('0xf'));}return _0x6b3769[_0xeac4('0x13')]({'attributes':['id',_0xeac4('0x18'),_0xeac4('0x19'),'salt',_0xeac4('0x1a'),_0xeac4('0x1b'),_0xeac4('0x1c'),_0xeac4('0x1d'),_0xeac4('0x1e')],'where':{'name':_0x5ed1d0,'role':{'$or':[_0xeac4('0x1f'),_0xeac4('0x20'),'agent']},'adSsoEnabled':!![]}});})[_0xeac4('0x15')](function(_0x91fed7){if(!_0x91fed7||_0x91fed7&&_0x91fed7[_0xeac4('0x18')]!==_0x5ed1d0){throw new Error(_0xeac4('0xf'));}_0xa5a5e7=_0x91fed7;var _0x256298=_0xa5a5e7[_0xeac4('0x18')]+'@'+config[_0xeac4('0x9')]['domain'];return adAuthenticate(config[_0xeac4('0x9')],_0x256298,_0x11d7d7);})[_0xeac4('0x15')](function(_0x5f5c10){if(_0xa5a5e7[_0xeac4('0x1b')]){throw new Error(_0xeac4('0xf'));}if(_0x13b59a['blockDuration']>0x0){if(_0xa5a5e7[_0xeac4('0x1c')]){if(moment(_0xa5a5e7['blockedAt'])[_0xeac4('0x21')](_0x13b59a[_0xeac4('0x14')],_0xeac4('0x22'))>moment()){throw new Error(_0xeac4('0xf'));}return utils['clearBlockUser'](_0xa5a5e7,0x0,![],null)['then'](function(){return utils['getLicense'](_0xa5a5e7);})[_0xeac4('0x15')](function(){return _0x39ade2(null,_0xa5a5e7);});}else{return utils[_0xeac4('0x23')](_0xa5a5e7)[_0xeac4('0x15')](function(){return _0x39ade2(null,_0xa5a5e7);});}}else{return utils[_0xeac4('0x23')](_0xa5a5e7)['then'](function(){return _0x39ade2(null,_0xa5a5e7);});}})[_0xeac4('0x24')](function(_0x5c6a09){return _0x39ade2(null,![],_0x5c6a09);});}function handleError(_0x119f3f,_0x102930,_0xcd25ee){return _0x119f3f[_0xeac4('0x25')](_0x102930||0x1f4)[_0xeac4('0x26')]({'message':_0xcd25ee?_0xcd25ee[_0xeac4('0x27')]||_0xcd25ee:''});}exports['login']=function(_0x53d2ef,_0x14f533,_0x1831a8){passport[_0xeac4('0x28')](_0xeac4('0x29'),function(_0x1d81f3,_0x4c62e1,_0x524c2d){var _0x439c77=_0x1d81f3||_0x524c2d;if(_0x439c77){return handleError(_0x14f533,0x191,_0x439c77);}if(!_0x4c62e1){return handleError(_0x14f533,0x194,{'message':_0xeac4('0x2a')});}else{var _0x51d9c9={'payload':{'id':_0x4c62e1['id'],'role':_0x4c62e1['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x51d9c9)[_0xeac4('0x15')](function(_0x4f051a){_0x14f533['json']({'id':_0x4c62e1['id'],'token':_0x4f051a,'statusCall':'','isAlreadyLogged':_0x4c62e1[_0xeac4('0x1e')]});});}})(_0x53d2ef,_0x14f533,_0x1831a8);};passport[_0xeac4('0x2b')](_0xeac4('0x29'),new LocalStrategy({'usernameField':_0xeac4('0x18'),'passwordField':'password'},function(_0x3128fc,_0x552bb0,_0x2f978){return ActiveDirectoryAuthenticate(db['User'],_0x3128fc,_0x552bb0,_0x2f978);})); \ No newline at end of file +var _0xa391=['bluebird','../../mysqldb','../../components/auth/service','../../config/utils','activedirectory','baseDN','url','domain','error','Error\x20authenticate\x20%s:\x20%s','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','findOne','password','salt','disabled','blocked','blockedAt','online','admin','user','agent','name','add','minutes','clearBlockUser','getLicense','catch','status','login','authenticate','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','json','ad-login','User','passport-local','moment','activedirectory2'];(function(_0x5d6046,_0x12e649){var _0x5de9d5=function(_0x1a6045){while(--_0x1a6045){_0x5d6046['push'](_0x5d6046['shift']());}};_0x5de9d5(++_0x12e649);}(_0xa391,0x138));var _0x1a39=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xa391[_0x1d1779];return _0x2377e9;};'use strict';var passport=require('passport');var LocalStrategy=require(_0x1a39('0x0'))['Strategy'];var moment=require(_0x1a39('0x1'));var ActiveDirectory=require(_0x1a39('0x2'));var BPromise=require(_0x1a39('0x3'));var util=require('util');var db=require(_0x1a39('0x4'))['db'];var authService=require(_0x1a39('0x5'));var utils=require(_0x1a39('0x6'));var config=require('../../config/environment');var logger=require('../../config/logger')('api');function isActiveDirectoryConfigured(_0x177375){var _0x4240ce=![];if(typeof _0x177375[_0x1a39('0x7')]!=='undefined'){_0x4240ce=_0x177375[_0x1a39('0x7')][_0x1a39('0x8')]&&_0x177375[_0x1a39('0x7')][_0x1a39('0x9')]&&_0x177375[_0x1a39('0x7')][_0x1a39('0xa')];}return _0x4240ce;}function adAuthenticate(_0x1cb66f,_0x30d2d5,_0x411e36){return new BPromise(function(_0x301673,_0xedd5fe){try{var _0x4d8b99=new ActiveDirectory(_0x1cb66f);_0x4d8b99['authenticate'](_0x30d2d5,_0x411e36,function(_0xf8a776,_0x3910b2){if(_0xf8a776){logger[_0x1a39('0xb')](_0x1a39('0xc'),_0x30d2d5,util['inspect'](_0xf8a776,{'showHidden':![],'depth':null}));_0xedd5fe('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x3910b2){logger[_0x1a39('0xb')](_0x1a39('0xd'),_0x30d2d5);_0xedd5fe(_0x1a39('0xe'));}else{_0x301673(_0x3910b2);}});}catch(_0x4abc8c){_0xedd5fe(_0x4abc8c);}});}function ActiveDirectoryAuthenticate(_0x15e573,_0x1f7641,_0x5a7858,_0x4c33e2){var _0x37c323,_0x538343;if(!isActiveDirectoryConfigured(config)){logger[_0x1a39('0xb')](_0x1a39('0xf'),_0x1f7641);return _0x4c33e2(null,![],{'message':_0x1a39('0xe')});}return db[_0x1a39('0x10')]['findOne']({'where':{'id':0x1},'attributes':[_0x1a39('0x11'),_0x1a39('0x12')],'raw':!![]})[_0x1a39('0x13')](function(_0x16703c){_0x37c323=_0x16703c;if(!_0x37c323[_0x1a39('0x11')]){logger[_0x1a39('0xb')](_0x1a39('0x14'),_0x1f7641);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x15e573[_0x1a39('0x15')]({'attributes':['id','name',_0x1a39('0x16'),_0x1a39('0x17'),'role',_0x1a39('0x18'),_0x1a39('0x19'),_0x1a39('0x1a'),_0x1a39('0x1b')],'where':{'name':_0x1f7641,'role':{'$or':[_0x1a39('0x1c'),_0x1a39('0x1d'),_0x1a39('0x1e')]},'adSsoEnabled':!![]}});})[_0x1a39('0x13')](function(_0x3a0d9b){if(!_0x3a0d9b||_0x3a0d9b&&_0x3a0d9b[_0x1a39('0x1f')]!==_0x1f7641){throw new Error(_0x1a39('0xe'));}_0x538343=_0x3a0d9b;var _0x54802d=_0x538343[_0x1a39('0x1f')]+'@'+config[_0x1a39('0x7')][_0x1a39('0xa')];return adAuthenticate(config[_0x1a39('0x7')],_0x54802d,_0x5a7858);})[_0x1a39('0x13')](function(_0x49d5f7){if(_0x538343['disabled']){throw new Error(_0x1a39('0xe'));}if(_0x37c323[_0x1a39('0x12')]>0x0){if(_0x538343[_0x1a39('0x19')]){if(moment(_0x538343[_0x1a39('0x1a')])[_0x1a39('0x20')](_0x37c323[_0x1a39('0x12')],_0x1a39('0x21'))>moment()){throw new Error(_0x1a39('0xe'));}return utils[_0x1a39('0x22')](_0x538343,0x0,![],null)[_0x1a39('0x13')](function(){return utils[_0x1a39('0x23')](_0x538343);})[_0x1a39('0x13')](function(){return _0x4c33e2(null,_0x538343);});}else{return utils[_0x1a39('0x23')](_0x538343)[_0x1a39('0x13')](function(){return _0x4c33e2(null,_0x538343);});}}else{return utils[_0x1a39('0x23')](_0x538343)[_0x1a39('0x13')](function(){return _0x4c33e2(null,_0x538343);});}})[_0x1a39('0x24')](function(_0x4c7ec7){return _0x4c33e2(null,![],_0x4c7ec7);});}function handleError(_0x3ef016,_0xc05151,_0x23fed5){return _0x3ef016[_0x1a39('0x25')](_0xc05151||0x1f4)['send']({'message':_0x23fed5?_0x23fed5['message']||_0x23fed5:''});}exports[_0x1a39('0x26')]=function(_0x5f549c,_0x5ddc8d,_0x34b345){passport[_0x1a39('0x27')]('ad-login',function(_0x134b36,_0xc0bee5,_0x2f67ec){var _0x423fd7=_0x134b36||_0x2f67ec;if(_0x423fd7){return handleError(_0x5ddc8d,0x191,_0x423fd7);}if(!_0xc0bee5){return handleError(_0x5ddc8d,0x194,{'message':_0x1a39('0x28')});}else{var _0x5c909a={'payload':{'id':_0xc0bee5['id'],'role':_0xc0bee5[_0x1a39('0x29')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x5c909a)[_0x1a39('0x13')](function(_0x100947){_0x5ddc8d[_0x1a39('0x2a')]({'id':_0xc0bee5['id'],'token':_0x100947,'statusCall':'','isAlreadyLogged':_0xc0bee5[_0x1a39('0x1b')]});});}})(_0x5f549c,_0x5ddc8d,_0x34b345);};passport['use'](_0x1a39('0x2b'),new LocalStrategy({'usernameField':_0x1a39('0x1f'),'passwordField':_0x1a39('0x16')},function(_0x167245,_0x5dc0ea,_0x1fafe4){return ActiveDirectoryAuthenticate(db[_0x1a39('0x2c')],_0x167245,_0x5dc0ea,_0x1fafe4);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index 85306c3..6dad782 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 _0xeb0c=['express','Router','./authActiveDirectory.controller','post','login','exports'];(function(_0x3be081,_0x1a0666){var _0x2ff0d8=function(_0x7572e6){while(--_0x7572e6){_0x3be081['push'](_0x3be081['shift']());}};_0x2ff0d8(++_0x1a0666);}(_0xeb0c,0x1ec));var _0xceb0=function(_0x43a6cd,_0x503d1a){_0x43a6cd=_0x43a6cd-0x0;var _0x5acb36=_0xeb0c[_0x43a6cd];return _0x5acb36;};'use strict';var express=require(_0xceb0('0x0'));var router=express[_0xceb0('0x1')]();var controller=require(_0xceb0('0x2'));router[_0xceb0('0x3')]('/',controller[_0xceb0('0x4')]);module[_0xceb0('0x5')]=router; \ No newline at end of file +var _0x38c3=['Router','./authActiveDirectory.controller','post','exports'];(function(_0x53dbbb,_0x302838){var _0x6c293c=function(_0x37e675){while(--_0x37e675){_0x53dbbb['push'](_0x53dbbb['shift']());}};_0x6c293c(++_0x302838);}(_0x38c3,0x94));var _0x338c=function(_0x39d518,_0x32b600){_0x39d518=_0x39d518-0x0;var _0x2feade=_0x38c3[_0x39d518];return _0x2feade;};'use strict';var express=require('express');var router=express[_0x338c('0x0')]();var controller=require(_0x338c('0x1'));router[_0x338c('0x2')]('/',controller['login']);module[_0x338c('0x3')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 1f8d946..4c1cc06 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(_0x1b725c,_0x150300){var _0x24e08c=function(_0x3688dd){while(--_0x3688dd){_0x1b725c['push'](_0x1b725c['shift']());}};_0x24e08c(++_0x150300);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});})); \ No newline at end of file +var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x7a54,0x106));var _0x47a5=function(_0x3f5cc6,_0x499845){_0x3f5cc6=_0x3f5cc6-0x0;var _0x4a2052=_0x7a54[_0x3f5cc6];return _0x4a2052;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 6a2d127..bbdfd63 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 _0x2d05=['Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','isMiddleware','setTokenCookie','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2d05,0x144));var _0x52d0=function(_0x1286c7,_0x443a6b){_0x1286c7=_0x1286c7-0x0;var _0x9331ca=_0x2d05[_0x1286c7];return _0x9331ca;};'use strict';var express=require('express');var passport=require('passport');var router=express[_0x52d0('0x0')]();var controller=require(_0x52d0('0x1'));var userController=require(_0x52d0('0x2'));var authService=require(_0x52d0('0x3'));router[_0x52d0('0x4')]('/',controller[_0x52d0('0x5')]);router[_0x52d0('0x4')]('/callback',controller['callback'],authService[_0x52d0('0x6')],userController[_0x52d0('0x5')],authService[_0x52d0('0x7')]);module[_0x52d0('0x8')]=router; \ No newline at end of file +var _0x96b7=['../../components/auth/service','login','get','callback','exports','express','passport','Router','./authGoogle.controller'];(function(_0x166e96,_0x55191d){var _0x553d73=function(_0x586142){while(--_0x586142){_0x166e96['push'](_0x166e96['shift']());}};_0x553d73(++_0x55191d);}(_0x96b7,0x149));var _0x796b=function(_0x3984a6,_0x4adaba){_0x3984a6=_0x3984a6-0x0;var _0x2cc75f=_0x96b7[_0x3984a6];return _0x2cc75f;};'use strict';var express=require(_0x796b('0x0'));var passport=require(_0x796b('0x1'));var router=express[_0x796b('0x2')]();var controller=require(_0x796b('0x3'));var userController=require('../user/user.controller.js');var authService=require(_0x796b('0x4'));router['get']('/',controller[_0x796b('0x5')]);router[_0x796b('0x6')]('/callback',controller[_0x796b('0x7')],authService['isMiddleware'],userController['login'],authService['setTokenCookie']);module[_0x796b('0x8')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index b07c854..5ee4e20 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 _0xeaa3=['previousPasswords','validatePasswordHistory','Password\x20reset!','use','passport','passport-local','Strategy','jayson/promise','lodash','moment','../../mysqldb','../../components/auth/service','client','findOne','allowedLoginAttempts','blockDuration','then','salt','role','blocked','blockedAt','admin','user','agent','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','loginAttempts','disabled','add','minutes','clearBlockUser','getLicense','catch','find','email','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','merge','format','\x22%s\x22\x20<%s>','Smtp','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify','status','send','message','login','local-login','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','trim','toLowerCase','Setting','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\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','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','params','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','password'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xeaa3,0x1a8));var _0x3eaa=function(_0x4da56f,_0x2be505){_0x4da56f=_0x4da56f-0x0;var _0x2fd5ab=_0xeaa3[_0x4da56f];return _0x2fd5ab;};'use strict';var util=require('util');var passport=require(_0x3eaa('0x0'));var LocalStrategy=require(_0x3eaa('0x1'))[_0x3eaa('0x2')];var jayson=require(_0x3eaa('0x3'));var _=require(_0x3eaa('0x4'));var rs=require('randomstring');var moment=require(_0x3eaa('0x5'));var db=require(_0x3eaa('0x6'))['db'];var authService=require(_0x3eaa('0x7'));var utils=require('../../config/utils');var client=jayson[_0x3eaa('0x8')]['http']({'port':0x232b});function localAuthenticate(_0x2a52b6,_0x1740ec,_0x5a10e9,_0x34d36d){var _0x9e0ba0,_0x35dc07;return db['Setting'][_0x3eaa('0x9')]({'where':{'id':0x1},'attributes':[_0x3eaa('0xa'),_0x3eaa('0xb')],'raw':!![]})[_0x3eaa('0xc')](function(_0x2e7130){_0x9e0ba0=_0x2e7130;return _0x2a52b6[_0x3eaa('0x9')]({'attributes':['id','name','password',_0x3eaa('0xd'),_0x3eaa('0xe'),'disabled',_0x3eaa('0xf'),_0x3eaa('0x10'),'loginAttempts'],'where':{'name':_0x1740ec,'role':{'$or':[_0x3eaa('0x11'),_0x3eaa('0x12'),_0x3eaa('0x13')]}}});})[_0x3eaa('0xc')](function(_0x3b5b8c){if(!_0x3b5b8c||_0x3b5b8c&&_0x3b5b8c[_0x3eaa('0x14')]!==_0x1740ec){throw new Error(_0x3eaa('0x15'));}else{_0x35dc07=_0x3b5b8c;return _0x35dc07;}})[_0x3eaa('0xc')](function(){_0x35dc07[_0x3eaa('0x16')](_0x5a10e9,function(_0x51db2c,_0x1e1614){var _0x5d0700=_0x35dc07[_0x3eaa('0x17')]+0x1;if(_0x51db2c){return _0x34d36d(_0x51db2c);}else if(!_0x1e1614){if(_0x35dc07[_0x3eaa('0x18')]){return _0x34d36d(null,![],{'message':_0x3eaa('0x15')});}else if(_0x9e0ba0['allowedLoginAttempts']>0x0){if(_0x35dc07['blocked']){if(_0x9e0ba0[_0x3eaa('0xb')]>0x0){if(moment(_0x35dc07[_0x3eaa('0x10')])[_0x3eaa('0x19')](_0x9e0ba0['blockDuration'],_0x3eaa('0x1a'))>moment()){return _0x34d36d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x3eaa('0x1b')](_0x35dc07,_0x5d0700,![],null)['then'](function(){return _0x34d36d(null,![],{'message':_0x3eaa('0x15')});});}}else{return _0x34d36d(null,![],{'message':_0x3eaa('0x15')});}}else{if(_0x5d0700>=_0x9e0ba0[_0x3eaa('0xa')]){return utils['clearBlockUser'](_0x35dc07,0x0,!![],moment())[_0x3eaa('0xc')](function(){return _0x34d36d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils['clearBlockUser'](_0x35dc07,_0x5d0700,![],null)[_0x3eaa('0xc')](function(){return _0x34d36d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x34d36d(null,![],{'message':_0x3eaa('0x15')});}}else{if(_0x35dc07[_0x3eaa('0x18')]){return _0x34d36d(null,![],{'message':_0x3eaa('0x15')});}else if(_0x9e0ba0[_0x3eaa('0xa')]>0x0){if(_0x35dc07[_0x3eaa('0xf')]){if(_0x9e0ba0[_0x3eaa('0xb')]>0x0){if(moment(_0x35dc07[_0x3eaa('0x10')])[_0x3eaa('0x19')](_0x9e0ba0[_0x3eaa('0xb')],_0x3eaa('0x1a'))>moment()){return _0x34d36d(null,![],{'message':_0x3eaa('0x15')});}else{return utils[_0x3eaa('0x1b')](_0x35dc07,0x0,![],null)[_0x3eaa('0xc')](function(){return utils[_0x3eaa('0x1c')](_0x35dc07);})[_0x3eaa('0xc')](function(){return _0x34d36d(null,_0x35dc07);});}}else{return _0x34d36d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x3eaa('0x1b')](_0x35dc07,0x0,![],null)[_0x3eaa('0xc')](function(){return utils['getLicense'](_0x35dc07);})[_0x3eaa('0xc')](function(){return _0x34d36d(null,_0x35dc07);})['catch'](function(_0x52217a){return _0x34d36d(null,![],_0x52217a);});}}else{if(_0x35dc07[_0x3eaa('0xf')]){return _0x34d36d(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['getLicense'](_0x35dc07)[_0x3eaa('0xc')](function(){return _0x34d36d(null,_0x35dc07);});}}}});})[_0x3eaa('0x1d')](function(_0x597e23){return _0x34d36d(null,![],_0x597e23);});}function sendServiceMail(_0x341fab){return db['MailAccount'][_0x3eaa('0x1e')]({'where':{'service':!![]},'attributes':['id',_0x3eaa('0x14'),_0x3eaa('0x1f')],'include':[{'model':db['MailServerOut'],'as':'Smtp','include':[{'model':db[_0x3eaa('0x20')],'as':'CloudProvider'}]}]})[_0x3eaa('0xc')](function(_0x3b7b16){if(!_0x3b7b16){throw new Error(_0x3eaa('0x21'));}var _0x10acac=_0x3b7b16['getSmtpOptions']();var _0xa4359a={'account':_0x10acac,'message':_[_0x3eaa('0x22')]({'from':util[_0x3eaa('0x23')](_0x3eaa('0x24'),_0x3b7b16[_0x3eaa('0x14')],_0x3b7b16[_0x3eaa('0x1f')]||_0x3b7b16[_0x3eaa('0x25')][_0x3eaa('0x12')])},_0x341fab)};return client[_0x3eaa('0x26')](_0x3eaa('0x27'),_0xa4359a);})[_0x3eaa('0xc')](function(_0x1905df){if(_0x1905df[_0x3eaa('0x28')]){throw new Error(util[_0x3eaa('0x23')](_0x3eaa('0x29'),_0x1905df[_0x3eaa('0x28')]['message']||JSON[_0x3eaa('0x2a')](_0x1905df[_0x3eaa('0x28')])));}return!![];});}function handleError(_0x2afaed,_0x4d5048,_0x2f351c){return _0x2afaed[_0x3eaa('0x2b')](_0x4d5048||0x1f4)[_0x3eaa('0x2c')]({'message':_0x2f351c?_0x2f351c[_0x3eaa('0x2d')]||_0x2f351c:''});}exports[_0x3eaa('0x2e')]=function(_0x43f7ec,_0x468346,_0x5da94e){passport[_0x3eaa('0x16')](_0x3eaa('0x2f'),function(_0x496a2c,_0x3ae08b,_0x3ba143){var _0x33526a=_0x496a2c||_0x3ba143;if(_0x33526a){return handleError(_0x468346,0x191,_0x33526a);}if(!_0x3ae08b){return handleError(_0x468346,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0xad6629={'payload':{'id':_0x3ae08b['id'],'role':_0x3ae08b[_0x3eaa('0xe')]},'options':{'expiresIn':0x15180}};return authService[_0x3eaa('0x30')](_0xad6629)[_0x3eaa('0xc')](function(_0x2f61a2){_0x468346[_0x3eaa('0x31')]({'id':_0x3ae08b['id'],'token':_0x2f61a2,'statusCall':'','isAlreadyLogged':_0x3ae08b[_0x3eaa('0x32')]});});}})(_0x43f7ec,_0x468346,_0x5da94e);};exports[_0x3eaa('0x33')]=function(_0x447049,_0x4af8ea){if(!_0x447049[_0x3eaa('0x34')]['email']){return handleError(_0x4af8ea,0x1f4,{'message':_0x3eaa('0x35')});}var _0x3e901c=rs['generate']();_0x447049[_0x3eaa('0x34')]['email']=_0x447049[_0x3eaa('0x34')][_0x3eaa('0x1f')][_0x3eaa('0x36')]()[_0x3eaa('0x37')]();var _0x55ab35;return db[_0x3eaa('0x38')][_0x3eaa('0x9')]({'where':{'id':0x1},'attributes':[_0x3eaa('0xa'),_0x3eaa('0xb')],'raw':!![]})['then'](function(_0x2f8c04){_0x55ab35=_0x2f8c04;return db[_0x3eaa('0x39')][_0x3eaa('0x1e')]({'where':{'email':_0x447049[_0x3eaa('0x34')]['email']}});})[_0x3eaa('0xc')](function(_0x1ad1c8){if(!_0x1ad1c8){throw new Error(_0x3eaa('0x3a'));}if(_0x1ad1c8[_0x3eaa('0x18')]){throw new Error(_0x3eaa('0x3b'));}if(_0x1ad1c8[_0x3eaa('0xf')]){if(moment(_0x1ad1c8['blockedAt'])[_0x3eaa('0x19')](_0x55ab35[_0x3eaa('0xb')],_0x3eaa('0x1a'))>moment()){throw new Error(_0x3eaa('0x3c'));}else{_0x1ad1c8[_0x3eaa('0xf')]=![];_0x1ad1c8[_0x3eaa('0x10')]=null;}}_0x1ad1c8[_0x3eaa('0x3d')]=_0x3e901c;_0x1ad1c8[_0x3eaa('0x3e')]=Date['now']()+0x36ee80;return _0x1ad1c8[_0x3eaa('0x3f')]();})[_0x3eaa('0xc')](function(){return sendServiceMail({'to':_0x447049[_0x3eaa('0x34')][_0x3eaa('0x1f')],'subject':_0x3eaa('0x40'),'text':_0x3eaa('0x41')+_0x3eaa('0x42')+_0x3eaa('0x43')+_0x447049[_0x3eaa('0x44')][_0x3eaa('0x45')]+_0x3eaa('0x46')+_0x3e901c+'\x0a\x0a'+_0x3eaa('0x47')});})[_0x3eaa('0xc')](function(){_0x4af8ea[_0x3eaa('0x2b')](0xc8)['send']({'message':_0x3eaa('0x48')});})['catch'](function(_0xeacc28){return handleError(_0x4af8ea,0x1f4,_0xeacc28);});};exports['reset']=function(_0x182c7c,_0x1ce15e){return db['User'][_0x3eaa('0x1e')]({'where':{'resetPasswordToken':_0x182c7c[_0x3eaa('0x49')]['token'],'resetPasswordExpires':{'$gt':Date[_0x3eaa('0x4a')]()}}})['then'](function(_0x239bf6){if(!_0x239bf6){throw new Error(_0x3eaa('0x4b'));}return db['Setting']['findOne']({'attributes':['id',_0x3eaa('0x4c'),_0x3eaa('0x4d'),_0x3eaa('0x4e')]})[_0x3eaa('0xc')](function(_0x38fd01){if(_0x38fd01[_0x3eaa('0x4c')])authService['validatePasswordPattern'](_0x182c7c[_0x3eaa('0x34')][_0x3eaa('0x4f')]);if(!_0x38fd01[_0x3eaa('0x4d')]||!_0x239bf6[_0x3eaa('0x50')])return _0x239bf6;authService[_0x3eaa('0x51')](_0x182c7c[_0x3eaa('0x34')][_0x3eaa('0x4f')],_0x239bf6[_0x3eaa('0x50')],_0x38fd01['passwordHistoryLimit']);return _0x239bf6;})[_0x3eaa('0xc')](function(){_0x239bf6[_0x3eaa('0x4f')]=_0x182c7c[_0x3eaa('0x34')][_0x3eaa('0x4f')];_0x239bf6['resetPasswordToken']=null;_0x239bf6['resetPasswordExpires']=null;return _0x239bf6[_0x3eaa('0x3f')]();});})[_0x3eaa('0xc')](function(){_0x1ce15e['status'](0xc8)[_0x3eaa('0x2c')]({'message':_0x3eaa('0x52')});})[_0x3eaa('0x1d')](function(_0x33deba){return handleError(_0x1ce15e,0x1f4,_0x33deba);});};passport[_0x3eaa('0x53')](_0x3eaa('0x2f'),new LocalStrategy({'usernameField':_0x3eaa('0x14'),'passwordField':'password'},function(_0x70f250,_0x310062,_0x15aac4){return localAuthenticate(db['User'],_0x70f250,_0x310062,_0x15aac4);})); \ No newline at end of file +var _0xffc2=['MailAccount','find','MailServerOut','Smtp','CloudProvider','getSmtpOptions','merge','format','email','user','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','message','stringify','send','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','forgot','body','Email\x20parameter\x20is\x20missing','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','https://','headers','host','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','Reset\x20Email\x20sent!','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','passwordHistoryLimit','securePassword','previousPasswords','validatePasswordHistory','Password\x20reset!','util','passport','passport-local','Strategy','jayson/promise','lodash','moment','../../mysqldb','../../config/utils','http','Setting','findOne','blockDuration','then','name','password','salt','role','disabled','blocked','blockedAt','admin','agent','authenticate','loginAttempts','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','allowedLoginAttempts','add','minutes','clearBlockUser','getLicense','catch'];(function(_0x27bcf5,_0x236765){var _0x4ce4cf=function(_0x4864ea){while(--_0x4864ea){_0x27bcf5['push'](_0x27bcf5['shift']());}};_0x4ce4cf(++_0x236765);}(_0xffc2,0x7e));var _0x2ffc=function(_0xc9cd47,_0x35a546){_0xc9cd47=_0xc9cd47-0x0;var _0x26827e=_0xffc2[_0xc9cd47];return _0x26827e;};'use strict';var util=require(_0x2ffc('0x0'));var passport=require(_0x2ffc('0x1'));var LocalStrategy=require(_0x2ffc('0x2'))[_0x2ffc('0x3')];var jayson=require(_0x2ffc('0x4'));var _=require(_0x2ffc('0x5'));var rs=require('randomstring');var moment=require(_0x2ffc('0x6'));var db=require(_0x2ffc('0x7'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x2ffc('0x8'));var client=jayson['client'][_0x2ffc('0x9')]({'port':0x232b});function localAuthenticate(_0x5c5117,_0x397b9f,_0x3bce48,_0x4c9028){var _0x4939d5,_0xde2b5f;return db[_0x2ffc('0xa')][_0x2ffc('0xb')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x2ffc('0xc')],'raw':!![]})[_0x2ffc('0xd')](function(_0x465458){_0x4939d5=_0x465458;return _0x5c5117[_0x2ffc('0xb')]({'attributes':['id',_0x2ffc('0xe'),_0x2ffc('0xf'),_0x2ffc('0x10'),_0x2ffc('0x11'),_0x2ffc('0x12'),_0x2ffc('0x13'),_0x2ffc('0x14'),'loginAttempts'],'where':{'name':_0x397b9f,'role':{'$or':[_0x2ffc('0x15'),'user',_0x2ffc('0x16')]}}});})['then'](function(_0xefa6a3){if(!_0xefa6a3||_0xefa6a3&&_0xefa6a3[_0x2ffc('0xe')]!==_0x397b9f){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0xde2b5f=_0xefa6a3;return _0xde2b5f;}})['then'](function(){_0xde2b5f[_0x2ffc('0x17')](_0x3bce48,function(_0x3f65da,_0x447f5d){var _0x3bce4c=_0xde2b5f[_0x2ffc('0x18')]+0x1;if(_0x3f65da){return _0x4c9028(_0x3f65da);}else if(!_0x447f5d){if(_0xde2b5f[_0x2ffc('0x12')]){return _0x4c9028(null,![],{'message':_0x2ffc('0x19')});}else if(_0x4939d5[_0x2ffc('0x1a')]>0x0){if(_0xde2b5f[_0x2ffc('0x13')]){if(_0x4939d5[_0x2ffc('0xc')]>0x0){if(moment(_0xde2b5f[_0x2ffc('0x14')])[_0x2ffc('0x1b')](_0x4939d5['blockDuration'],_0x2ffc('0x1c'))>moment()){return _0x4c9028(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x2ffc('0x1d')](_0xde2b5f,_0x3bce4c,![],null)[_0x2ffc('0xd')](function(){return _0x4c9028(null,![],{'message':_0x2ffc('0x19')});});}}else{return _0x4c9028(null,![],{'message':_0x2ffc('0x19')});}}else{if(_0x3bce4c>=_0x4939d5[_0x2ffc('0x1a')]){return utils[_0x2ffc('0x1d')](_0xde2b5f,0x0,!![],moment())[_0x2ffc('0xd')](function(){return _0x4c9028(null,![],{'message':_0x2ffc('0x19')});});}else{return utils[_0x2ffc('0x1d')](_0xde2b5f,_0x3bce4c,![],null)[_0x2ffc('0xd')](function(){return _0x4c9028(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x4c9028(null,![],{'message':_0x2ffc('0x19')});}}else{if(_0xde2b5f['disabled']){return _0x4c9028(null,![],{'message':_0x2ffc('0x19')});}else if(_0x4939d5[_0x2ffc('0x1a')]>0x0){if(_0xde2b5f[_0x2ffc('0x13')]){if(_0x4939d5['blockDuration']>0x0){if(moment(_0xde2b5f[_0x2ffc('0x14')])['add'](_0x4939d5[_0x2ffc('0xc')],_0x2ffc('0x1c'))>moment()){return _0x4c9028(null,![],{'message':_0x2ffc('0x19')});}else{return utils[_0x2ffc('0x1d')](_0xde2b5f,0x0,![],null)[_0x2ffc('0xd')](function(){return utils[_0x2ffc('0x1e')](_0xde2b5f);})['then'](function(){return _0x4c9028(null,_0xde2b5f);});}}else{return _0x4c9028(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils['clearBlockUser'](_0xde2b5f,0x0,![],null)[_0x2ffc('0xd')](function(){return utils[_0x2ffc('0x1e')](_0xde2b5f);})[_0x2ffc('0xd')](function(){return _0x4c9028(null,_0xde2b5f);})[_0x2ffc('0x1f')](function(_0x2ee724){return _0x4c9028(null,![],_0x2ee724);});}}else{if(_0xde2b5f[_0x2ffc('0x13')]){return _0x4c9028(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x2ffc('0x1e')](_0xde2b5f)[_0x2ffc('0xd')](function(){return _0x4c9028(null,_0xde2b5f);});}}}});})[_0x2ffc('0x1f')](function(_0x92c1ee){return _0x4c9028(null,![],_0x92c1ee);});}function sendServiceMail(_0x580a3f){return db[_0x2ffc('0x20')][_0x2ffc('0x21')]({'where':{'service':!![]},'attributes':['id','name','email'],'include':[{'model':db[_0x2ffc('0x22')],'as':_0x2ffc('0x23'),'include':[{'model':db[_0x2ffc('0x24')],'as':'CloudProvider'}]}]})['then'](function(_0x56652e){if(!_0x56652e){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x556abb=_0x56652e[_0x2ffc('0x25')]();var _0x56da0c={'account':_0x556abb,'message':_[_0x2ffc('0x26')]({'from':util[_0x2ffc('0x27')]('\x22%s\x22\x20<%s>',_0x56652e[_0x2ffc('0xe')],_0x56652e[_0x2ffc('0x28')]||_0x56652e['Smtp'][_0x2ffc('0x29')])},_0x580a3f)};return client['request']('SendMail',_0x56da0c);})['then'](function(_0x17b49a){if(_0x17b49a['error']){throw new Error(util[_0x2ffc('0x27')](_0x2ffc('0x2a'),_0x17b49a[_0x2ffc('0x2b')][_0x2ffc('0x2c')]||JSON[_0x2ffc('0x2d')](_0x17b49a[_0x2ffc('0x2b')])));}return!![];});}function handleError(_0x4824ba,_0x57c74d,_0x11f591){return _0x4824ba['status'](_0x57c74d||0x1f4)[_0x2ffc('0x2e')]({'message':_0x11f591?_0x11f591[_0x2ffc('0x2c')]||_0x11f591:''});}exports[_0x2ffc('0x2f')]=function(_0x1f7c09,_0x4659cd,_0x1df542){passport[_0x2ffc('0x17')]('local-login',function(_0x4d89a0,_0x5f56a6,_0x138bf7){var _0x45fa59=_0x4d89a0||_0x138bf7;if(_0x45fa59){return handleError(_0x4659cd,0x191,_0x45fa59);}if(!_0x5f56a6){return handleError(_0x4659cd,0x194,{'message':_0x2ffc('0x30')});}else{var _0x16ed3f={'payload':{'id':_0x5f56a6['id'],'role':_0x5f56a6[_0x2ffc('0x11')]},'options':{'expiresIn':0x15180}};return authService[_0x2ffc('0x31')](_0x16ed3f)[_0x2ffc('0xd')](function(_0x4e48b7){_0x4659cd['json']({'id':_0x5f56a6['id'],'token':_0x4e48b7,'statusCall':'','isAlreadyLogged':_0x5f56a6['online']});});}})(_0x1f7c09,_0x4659cd,_0x1df542);};exports[_0x2ffc('0x32')]=function(_0x438b9c,_0x4b861a){if(!_0x438b9c[_0x2ffc('0x33')]['email']){return handleError(_0x4b861a,0x1f4,{'message':_0x2ffc('0x34')});}var _0x2fcc0e=rs['generate']();_0x438b9c[_0x2ffc('0x33')][_0x2ffc('0x28')]=_0x438b9c[_0x2ffc('0x33')][_0x2ffc('0x28')][_0x2ffc('0x35')]()[_0x2ffc('0x36')]();var _0x32a03e;return db[_0x2ffc('0xa')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x2ffc('0xc')],'raw':!![]})[_0x2ffc('0xd')](function(_0x59daf4){_0x32a03e=_0x59daf4;return db[_0x2ffc('0x37')][_0x2ffc('0x21')]({'where':{'email':_0x438b9c['body'][_0x2ffc('0x28')]}});})['then'](function(_0x43907c){if(!_0x43907c){throw new Error(_0x2ffc('0x38'));}if(_0x43907c['disabled']){throw new Error(_0x2ffc('0x39'));}if(_0x43907c['blocked']){if(moment(_0x43907c[_0x2ffc('0x14')])[_0x2ffc('0x1b')](_0x32a03e[_0x2ffc('0xc')],_0x2ffc('0x1c'))>moment()){throw new Error(_0x2ffc('0x3a'));}else{_0x43907c[_0x2ffc('0x13')]=![];_0x43907c[_0x2ffc('0x14')]=null;}}_0x43907c[_0x2ffc('0x3b')]=_0x2fcc0e;_0x43907c[_0x2ffc('0x3c')]=Date[_0x2ffc('0x3d')]()+0x36ee80;return _0x43907c[_0x2ffc('0x3e')]();})[_0x2ffc('0xd')](function(){return sendServiceMail({'to':_0x438b9c[_0x2ffc('0x33')][_0x2ffc('0x28')],'subject':_0x2ffc('0x3f'),'text':_0x2ffc('0x40')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0x2ffc('0x41')+_0x438b9c[_0x2ffc('0x42')][_0x2ffc('0x43')]+'/reset/'+_0x2fcc0e+'\x0a\x0a'+_0x2ffc('0x44')});})['then'](function(){_0x4b861a[_0x2ffc('0x45')](0xc8)[_0x2ffc('0x2e')]({'message':_0x2ffc('0x46')});})['catch'](function(_0x83f082){return handleError(_0x4b861a,0x1f4,_0x83f082);});};exports['reset']=function(_0x11c3c6,_0x30eb01){return db[_0x2ffc('0x37')][_0x2ffc('0x21')]({'where':{'resetPasswordToken':_0x11c3c6['params'][_0x2ffc('0x47')],'resetPasswordExpires':{'$gt':Date['now']()}}})['then'](function(_0x31c55b){if(!_0x31c55b){throw new Error(_0x2ffc('0x48'));}return db[_0x2ffc('0xa')][_0x2ffc('0xb')]({'attributes':['id','securePassword',_0x2ffc('0x49'),_0x2ffc('0x4a')]})[_0x2ffc('0xd')](function(_0x101f13){if(_0x101f13[_0x2ffc('0x4b')])authService['validatePasswordPattern'](_0x11c3c6[_0x2ffc('0x33')][_0x2ffc('0xf')]);if(!_0x101f13['enforcePasswordHistory']||!_0x31c55b[_0x2ffc('0x4c')])return _0x31c55b;authService[_0x2ffc('0x4d')](_0x11c3c6['body']['password'],_0x31c55b[_0x2ffc('0x4c')],_0x101f13[_0x2ffc('0x4a')]);return _0x31c55b;})[_0x2ffc('0xd')](function(){_0x31c55b[_0x2ffc('0xf')]=_0x11c3c6[_0x2ffc('0x33')][_0x2ffc('0xf')];_0x31c55b[_0x2ffc('0x3b')]=null;_0x31c55b[_0x2ffc('0x3c')]=null;return _0x31c55b[_0x2ffc('0x3e')]();});})['then'](function(){_0x30eb01[_0x2ffc('0x45')](0xc8)[_0x2ffc('0x2e')]({'message':_0x2ffc('0x4e')});})[_0x2ffc('0x1f')](function(_0xa3bff3){return handleError(_0x30eb01,0x1f4,_0xa3bff3);});};passport['use']('local-login',new LocalStrategy({'usernameField':_0x2ffc('0xe'),'passwordField':_0x2ffc('0xf')},function(_0x4bca2f,_0x1991e6,_0x3c8743){return localAuthenticate(db[_0x2ffc('0x37')],_0x4bca2f,_0x1991e6,_0x3c8743);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index f86d4c1..3624618 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 _0xdd5a=['Router','./authLocal.controller','post','login','/forgot','forgot','/reset/:token','reset','exports'];(function(_0x4a5570,_0x4895b6){var _0x2ae198=function(_0x4d34ab){while(--_0x4d34ab){_0x4a5570['push'](_0x4a5570['shift']());}};_0x2ae198(++_0x4895b6);}(_0xdd5a,0x1c2));var _0xadd5=function(_0x2b7bd8,_0x27eaf4){_0x2b7bd8=_0x2b7bd8-0x0;var _0x1ca608=_0xdd5a[_0x2b7bd8];return _0x1ca608;};'use strict';var express=require('express');var router=express[_0xadd5('0x0')]();var controller=require(_0xadd5('0x1'));router[_0xadd5('0x2')]('/',controller[_0xadd5('0x3')]);router[_0xadd5('0x2')](_0xadd5('0x4'),controller[_0xadd5('0x5')]);router[_0xadd5('0x2')](_0xadd5('0x6'),controller[_0xadd5('0x7')]);module[_0xadd5('0x8')]=router; \ No newline at end of file +var _0xf398=['Router','./authLocal.controller','login','post','/forgot','/reset/:token','reset','exports','express'];(function(_0x543c51,_0xff0084){var _0x360555=function(_0x2a0801){while(--_0x2a0801){_0x543c51['push'](_0x543c51['shift']());}};_0x360555(++_0xff0084);}(_0xf398,0x170));var _0x8f39=function(_0x56e6f3,_0x21a3c3){_0x56e6f3=_0x56e6f3-0x0;var _0x551fca=_0xf398[_0x56e6f3];return _0x551fca;};'use strict';var express=require(_0x8f39('0x0'));var router=express[_0x8f39('0x1')]();var controller=require(_0x8f39('0x2'));router['post']('/',controller[_0x8f39('0x3')]);router[_0x8f39('0x4')](_0x8f39('0x5'),controller['forgot']);router['post'](_0x8f39('0x6'),controller[_0x8f39('0x7')]);module[_0x8f39('0x8')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 8f72c73..9bf1b41 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 _0x686b=['STRING','BOOLEAN','INTEGER','sequelize','exports'];(function(_0x20d7a4,_0x140fc3){var _0x56cdc8=function(_0x178f82){while(--_0x178f82){_0x20d7a4['push'](_0x20d7a4['shift']());}};_0x56cdc8(++_0x140fc3);}(_0x686b,0xf3));var _0xb686=function(_0x18a846,_0x1261f1){_0x18a846=_0x18a846-0x0;var _0x374e2b=_0x686b[_0x18a846];return _0x374e2b;};'use strict';var Sequelize=require(_0xb686('0x0'));module[_0xb686('0x1')]={'name':{'type':Sequelize[_0xb686('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xb686('0x2')]},'description':{'type':Sequelize[_0xb686('0x2')]},'status':{'type':Sequelize[_0xb686('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xb686('0x4')],'defaultValue':0xa}}; \ No newline at end of file +var _0x37bf=['STRING','BOOLEAN','INTEGER','exports'];(function(_0x3281b3,_0x52a344){var _0x3adae8=function(_0x3de81b){while(--_0x3de81b){_0x3281b3['push'](_0x3281b3['shift']());}};_0x3adae8(++_0x52a344);}(_0x37bf,0x1c7));var _0xf37b=function(_0x293c3d,_0x201198){_0x293c3d=_0x293c3d-0x0;var _0x1a1ffd=_0x37bf[_0x293c3d];return _0x1a1ffd;};'use strict';var Sequelize=require('sequelize');module[_0xf37b('0x0')]={'name':{'type':Sequelize[_0xf37b('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0xf37b('0x1')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0xf37b('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xf37b('0x3')],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index a0ca286..d7d39e6 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 _0x1127=['update','body','find','destroy','addConditions','ids','omit','findOne','getConditions','addActions','Action','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','error','stack','name','send','index','map','Automation','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','include','findAll','rows','show','params','includeAll','merge','catch','create'];(function(_0x3b63d9,_0x581a7d){var _0x4b7ad4=function(_0x515c16){while(--_0x515c16){_0x3b63d9['push'](_0x3b63d9['shift']());}};_0x4b7ad4(++_0x581a7d);}(_0x1127,0x110));var _0x7112=function(_0x304320,_0x232a69){_0x304320=_0x304320-0x0;var _0xe607da=_0x1127[_0x304320];return _0xe607da;};'use strict';var emlformat=require(_0x7112('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7112('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7112('0x2'));var moment=require(_0x7112('0x3'));var BPromise=require(_0x7112('0x4'));var Mustache=require('mustache');var util=require(_0x7112('0x5'));var path=require(_0x7112('0x6'));var sox=require(_0x7112('0x7'));var csv=require(_0x7112('0x8'));var ejs=require(_0x7112('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7112('0xa'));var squel=require(_0x7112('0xb'));var crypto=require(_0x7112('0xc'));var jsforce=require(_0x7112('0xd'));var deskjs=require(_0x7112('0xe'));var toCsv=require(_0x7112('0x8'));var querystring=require(_0x7112('0xf'));var Papa=require(_0x7112('0x10'));var Redis=require('ioredis');var authService=require(_0x7112('0x11'));var qs=require(_0x7112('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7112('0x13'));var logger=require(_0x7112('0x14'))(_0x7112('0x15'));var utils=require(_0x7112('0x16'));var config=require(_0x7112('0x17'));var licenseUtil=require(_0x7112('0x18'));var db=require(_0x7112('0x19'))['db'];function respondWithStatusCode(_0x1fcf4f,_0x276129){_0x276129=_0x276129||0xcc;return function(_0x4847ea){if(_0x4847ea){return _0x1fcf4f[_0x7112('0x1a')](_0x276129);}return _0x1fcf4f[_0x7112('0x1b')](_0x276129)[_0x7112('0x1c')]();};}function respondWithResult(_0x5a1fc7,_0x29e072){_0x29e072=_0x29e072||0xc8;return function(_0x1caafb){if(_0x1caafb){return _0x5a1fc7[_0x7112('0x1b')](_0x29e072)[_0x7112('0x1d')](_0x1caafb);}};}function respondWithFilteredResult(_0x16f65e,_0x29cde4){return function(_0x4bd0c6){if(_0x4bd0c6){var _0x5f0ae5=typeof _0x29cde4[_0x7112('0x1e')]===_0x7112('0x1f')&&typeof _0x29cde4[_0x7112('0x20')]===_0x7112('0x1f');var _0x3d815a=_0x4bd0c6[_0x7112('0x21')];var _0x244c0b=_0x5f0ae5?0x0:_0x29cde4['offset'];var _0x5f0d0d=_0x5f0ae5?_0x4bd0c6['count']:_0x29cde4[_0x7112('0x1e')]+_0x29cde4[_0x7112('0x20')];var _0x134a26;if(_0x5f0d0d>=_0x3d815a){_0x5f0d0d=_0x3d815a;_0x134a26=0xc8;}else{_0x134a26=0xce;}_0x16f65e[_0x7112('0x1b')](_0x134a26);return _0x16f65e[_0x7112('0x22')](_0x7112('0x23'),_0x244c0b+'-'+_0x5f0d0d+'/'+_0x3d815a)[_0x7112('0x1d')](_0x4bd0c6);}return null;};}function patchUpdates(_0x38c6f5){return function(_0x1f9828){try{jsonpatch[_0x7112('0x24')](_0x1f9828,_0x38c6f5,!![]);}catch(_0x4896e3){return BPromise['reject'](_0x4896e3);}return _0x1f9828[_0x7112('0x25')]();};}function saveUpdates(_0x55efb3,_0x448dc0){return function(_0x4cdd8b){if(_0x4cdd8b){return _0x4cdd8b['update'](_0x55efb3)[_0x7112('0x26')](function(_0x648a6f){return _0x648a6f;});}return null;};}function removeEntity(_0x418148,_0x1f7cf1){return function(_0x39e062){if(_0x39e062){return _0x39e062['destroy']()['then'](function(){_0x418148['status'](0xcc)[_0x7112('0x1c')]();});}};}function handleEntityNotFound(_0x7f0be0,_0x23c56d){return function(_0x4d2830){if(!_0x4d2830){_0x7f0be0[_0x7112('0x1a')](0x194);}return _0x4d2830;};}function handleError(_0xcc1e9b,_0x32b494){_0x32b494=_0x32b494||0x1f4;return function(_0x2a5bfe){logger[_0x7112('0x27')](_0x2a5bfe[_0x7112('0x28')]);if(_0x2a5bfe['name']){delete _0x2a5bfe[_0x7112('0x29')];}_0xcc1e9b[_0x7112('0x1b')](_0x32b494)[_0x7112('0x2a')](_0x2a5bfe);};}exports[_0x7112('0x2b')]=function(_0xd16d36,_0x3c33b2){var _0x38b622={},_0x5e1610={},_0x26f387={'count':0x0,'rows':[]};var _0x314960=_[_0x7112('0x2c')](db[_0x7112('0x2d')][_0x7112('0x2e')],function(_0x3a720c){return{'name':_0x3a720c[_0x7112('0x2f')],'type':_0x3a720c[_0x7112('0x30')][_0x7112('0x31')]};});_0x5e1610[_0x7112('0x32')]=_[_0x7112('0x2c')](_0x314960,_0x7112('0x29'));_0x5e1610['query']=_[_0x7112('0x33')](_0xd16d36[_0x7112('0x34')]);_0x5e1610[_0x7112('0x35')]=_[_0x7112('0x36')](_0x5e1610['model'],_0x5e1610[_0x7112('0x34')]);_0x38b622[_0x7112('0x37')]=_[_0x7112('0x36')](_0x5e1610[_0x7112('0x32')],qs[_0x7112('0x38')](_0xd16d36[_0x7112('0x34')][_0x7112('0x38')]));_0x38b622[_0x7112('0x37')]=_0x38b622[_0x7112('0x37')][_0x7112('0x39')]?_0x38b622[_0x7112('0x37')]:_0x5e1610[_0x7112('0x32')];if(!_0xd16d36[_0x7112('0x34')][_0x7112('0x3a')](_0x7112('0x3b'))){_0x38b622[_0x7112('0x20')]=qs[_0x7112('0x20')](_0xd16d36['query']['limit']);_0x38b622['offset']=qs[_0x7112('0x1e')](_0xd16d36[_0x7112('0x34')][_0x7112('0x1e')]);}_0x38b622[_0x7112('0x3c')]=qs[_0x7112('0x3d')](_0xd16d36[_0x7112('0x34')][_0x7112('0x3d')]);_0x38b622[_0x7112('0x3e')]=qs[_0x7112('0x35')](_[_0x7112('0x3f')](_0xd16d36[_0x7112('0x34')],_0x5e1610[_0x7112('0x35')]),_0x314960);if(_0xd16d36[_0x7112('0x34')][_0x7112('0x40')]){_0x38b622[_0x7112('0x3e')]=_['merge'](_0x38b622['where'],{'$or':_[_0x7112('0x2c')](_0x314960,function(_0x24aa77){if(_0x24aa77[_0x7112('0x30')]!==_0x7112('0x41')){var _0x5445d1={};_0x5445d1[_0x24aa77[_0x7112('0x29')]]={'$like':'%'+_0xd16d36[_0x7112('0x34')]['filter']+'%'};return _0x5445d1;}})});}_0x38b622=_['merge']({},_0x38b622,_0xd16d36[_0x7112('0x42')]);var _0x51c04d={'where':_0x38b622[_0x7112('0x3e')]};return db[_0x7112('0x2d')][_0x7112('0x21')](_0x51c04d)[_0x7112('0x26')](function(_0x4baa67){_0x26f387[_0x7112('0x21')]=_0x4baa67;if(_0xd16d36[_0x7112('0x34')]['includeAll']){_0x38b622[_0x7112('0x43')]=[{'all':!![]}];}return db[_0x7112('0x2d')][_0x7112('0x44')](_0x38b622);})['then'](function(_0x22de1a){_0x26f387[_0x7112('0x45')]=_0x22de1a;return _0x26f387;})['then'](respondWithFilteredResult(_0x3c33b2,_0x38b622))['catch'](handleError(_0x3c33b2,null));};exports[_0x7112('0x46')]=function(_0x459489,_0x3b9922){var _0x283964={'raw':![],'where':{'id':_0x459489[_0x7112('0x47')]['id']}},_0x17f4a7={};_0x17f4a7[_0x7112('0x32')]=_[_0x7112('0x33')](db[_0x7112('0x2d')][_0x7112('0x2e')]);_0x17f4a7[_0x7112('0x34')]=_[_0x7112('0x33')](_0x459489[_0x7112('0x34')]);_0x17f4a7[_0x7112('0x35')]=_[_0x7112('0x36')](_0x17f4a7[_0x7112('0x32')],_0x17f4a7[_0x7112('0x34')]);_0x283964[_0x7112('0x37')]=_[_0x7112('0x36')](_0x17f4a7[_0x7112('0x32')],qs[_0x7112('0x38')](_0x459489[_0x7112('0x34')]['fields']));_0x283964['attributes']=_0x283964[_0x7112('0x37')][_0x7112('0x39')]?_0x283964[_0x7112('0x37')]:_0x17f4a7[_0x7112('0x32')];if(_0x459489['query'][_0x7112('0x48')]){_0x283964[_0x7112('0x43')]=[{'all':!![]}];}_0x283964=_[_0x7112('0x49')]({},_0x283964,_0x459489[_0x7112('0x42')]);return db[_0x7112('0x2d')]['find'](_0x283964)[_0x7112('0x26')](handleEntityNotFound(_0x3b9922,null))['then'](respondWithResult(_0x3b9922,null))[_0x7112('0x4a')](handleError(_0x3b9922,null));};exports['create']=function(_0x574a34,_0x56567a){return db['Automation'][_0x7112('0x4b')](_0x574a34['body'],{})['then'](respondWithResult(_0x56567a,0xc9))[_0x7112('0x4a')](handleError(_0x56567a,null));};exports[_0x7112('0x4c')]=function(_0x52a85a,_0x48b27a){if(_0x52a85a['body']['id']){delete _0x52a85a[_0x7112('0x4d')]['id'];}return db[_0x7112('0x2d')][_0x7112('0x4e')]({'where':{'id':_0x52a85a['params']['id']}})[_0x7112('0x26')](handleEntityNotFound(_0x48b27a,null))[_0x7112('0x26')](saveUpdates(_0x52a85a['body'],null))[_0x7112('0x26')](respondWithResult(_0x48b27a,null))[_0x7112('0x4a')](handleError(_0x48b27a,null));};exports[_0x7112('0x4f')]=function(_0x4f5e85,_0x5c28cc){return db[_0x7112('0x2d')][_0x7112('0x4e')]({'where':{'id':_0x4f5e85[_0x7112('0x47')]['id']}})[_0x7112('0x26')](handleEntityNotFound(_0x5c28cc,null))[_0x7112('0x26')](removeEntity(_0x5c28cc,null))[_0x7112('0x4a')](handleError(_0x5c28cc,null));};exports[_0x7112('0x50')]=function(_0x44789a,_0x154401,_0xdb130b){return db['Condition'][_0x7112('0x4e')]({'where':{'id':_0x44789a[_0x7112('0x47')]['id']}})['then'](handleEntityNotFound(_0x154401,null))[_0x7112('0x26')](function(_0xe71a07){if(_0xe71a07){return _0xe71a07[_0x7112('0x50')](_0x44789a[_0x7112('0x4d')][_0x7112('0x51')],_[_0x7112('0x52')](_0x44789a[_0x7112('0x4d')],[_0x7112('0x51'),'id'])||{});}})[_0x7112('0x26')](respondWithResult(_0x154401,null))[_0x7112('0x4a')](handleError(_0x154401,null));};exports['getConditions']=function(_0x4f532b,_0x4a3fee,_0x12f42b){var _0x2ca0a9={};var _0x32ff19={};var _0x2c4e00;var _0x575648;return db[_0x7112('0x2d')][_0x7112('0x53')]({'where':{'id':_0x4f532b[_0x7112('0x47')]['id']}})['then'](handleEntityNotFound(_0x4a3fee,null))[_0x7112('0x26')](function(_0x3eb84b){if(_0x3eb84b){_0x2c4e00=_0x3eb84b;_0x32ff19[_0x7112('0x32')]=_[_0x7112('0x33')](db['Condition'][_0x7112('0x2e')]);_0x32ff19['query']=_[_0x7112('0x33')](_0x4f532b['query']);_0x32ff19[_0x7112('0x35')]=_[_0x7112('0x36')](_0x32ff19['model'],_0x32ff19[_0x7112('0x34')]);_0x2ca0a9[_0x7112('0x37')]=_[_0x7112('0x36')](_0x32ff19[_0x7112('0x32')],qs[_0x7112('0x38')](_0x4f532b[_0x7112('0x34')][_0x7112('0x38')]));_0x2ca0a9[_0x7112('0x37')]=_0x2ca0a9[_0x7112('0x37')][_0x7112('0x39')]?_0x2ca0a9[_0x7112('0x37')]:_0x32ff19[_0x7112('0x32')];_0x2ca0a9[_0x7112('0x3c')]=qs['sort'](_0x4f532b[_0x7112('0x34')]['sort']);_0x2ca0a9[_0x7112('0x3e')]=qs[_0x7112('0x35')](_[_0x7112('0x3f')](_0x4f532b[_0x7112('0x34')],_0x32ff19[_0x7112('0x35')]));if(_0x4f532b[_0x7112('0x34')]['filter']){_0x2ca0a9['where']=_[_0x7112('0x49')](_0x2ca0a9[_0x7112('0x3e')],{'$or':_['map'](_0x2ca0a9['attributes'],function(_0x423c0d){var _0x1bf3fc={};_0x1bf3fc[_0x423c0d]={'$like':'%'+_0x4f532b[_0x7112('0x34')][_0x7112('0x40')]+'%'};return _0x1bf3fc;})});}_0x2ca0a9=_[_0x7112('0x49')]({},_0x2ca0a9,_0x4f532b['options']);return _0x2c4e00[_0x7112('0x54')](_0x2ca0a9);}})[_0x7112('0x26')](function(_0x43b4fa){if(_0x43b4fa){_0x575648=_0x43b4fa[_0x7112('0x39')];if(!_0x4f532b[_0x7112('0x34')][_0x7112('0x3a')](_0x7112('0x3b'))){_0x2ca0a9[_0x7112('0x20')]=qs['limit'](_0x4f532b[_0x7112('0x34')][_0x7112('0x20')]);_0x2ca0a9[_0x7112('0x1e')]=qs[_0x7112('0x1e')](_0x4f532b[_0x7112('0x34')][_0x7112('0x1e')]);}return _0x2c4e00[_0x7112('0x54')](_0x2ca0a9);}})[_0x7112('0x26')](function(_0x378a2f){if(_0x378a2f){return _0x378a2f?{'count':_0x575648,'rows':_0x378a2f}:null;}})[_0x7112('0x26')](respondWithResult(_0x4a3fee,null))[_0x7112('0x4a')](handleError(_0x4a3fee,null));};exports[_0x7112('0x55')]=function(_0x50bedc,_0x541b91,_0x351db4){return db[_0x7112('0x56')]['find']({'where':{'id':_0x50bedc[_0x7112('0x47')]['id']}})['then'](handleEntityNotFound(_0x541b91,null))[_0x7112('0x26')](function(_0xd65300){if(_0xd65300){return _0xd65300['addActions'](_0x50bedc[_0x7112('0x4d')][_0x7112('0x51')],_[_0x7112('0x52')](_0x50bedc[_0x7112('0x4d')],[_0x7112('0x51'),'id'])||{});}})['then'](respondWithResult(_0x541b91,null))[_0x7112('0x4a')](handleError(_0x541b91,null));};exports['getActions']=function(_0x1bcc08,_0x2c4ab8,_0xf51850){var _0x5c5e72={};var _0x3062b9={};var _0x9c68a4;var _0x1130c2;return db[_0x7112('0x2d')][_0x7112('0x53')]({'where':{'id':_0x1bcc08[_0x7112('0x47')]['id']}})['then'](handleEntityNotFound(_0x2c4ab8,null))[_0x7112('0x26')](function(_0x213c1f){if(_0x213c1f){_0x9c68a4=_0x213c1f;_0x3062b9['model']=_[_0x7112('0x33')](db[_0x7112('0x56')][_0x7112('0x2e')]);_0x3062b9[_0x7112('0x34')]=_[_0x7112('0x33')](_0x1bcc08[_0x7112('0x34')]);_0x3062b9[_0x7112('0x35')]=_[_0x7112('0x36')](_0x3062b9[_0x7112('0x32')],_0x3062b9[_0x7112('0x34')]);_0x5c5e72[_0x7112('0x37')]=_[_0x7112('0x36')](_0x3062b9['model'],qs[_0x7112('0x38')](_0x1bcc08[_0x7112('0x34')][_0x7112('0x38')]));_0x5c5e72['attributes']=_0x5c5e72[_0x7112('0x37')]['length']?_0x5c5e72['attributes']:_0x3062b9['model'];_0x5c5e72[_0x7112('0x3c')]=qs['sort'](_0x1bcc08['query'][_0x7112('0x3d')]);_0x5c5e72[_0x7112('0x3e')]=qs[_0x7112('0x35')](_[_0x7112('0x3f')](_0x1bcc08[_0x7112('0x34')],_0x3062b9[_0x7112('0x35')]));if(_0x1bcc08[_0x7112('0x34')][_0x7112('0x40')]){_0x5c5e72[_0x7112('0x3e')]=_[_0x7112('0x49')](_0x5c5e72[_0x7112('0x3e')],{'$or':_[_0x7112('0x2c')](_0x5c5e72['attributes'],function(_0x470aae){var _0x52af95={};_0x52af95[_0x470aae]={'$like':'%'+_0x1bcc08[_0x7112('0x34')]['filter']+'%'};return _0x52af95;})});}_0x5c5e72=_['merge']({},_0x5c5e72,_0x1bcc08[_0x7112('0x42')]);return _0x9c68a4['getActions'](_0x5c5e72);}})[_0x7112('0x26')](function(_0x493719){if(_0x493719){_0x1130c2=_0x493719[_0x7112('0x39')];if(!_0x1bcc08['query'][_0x7112('0x3a')](_0x7112('0x3b'))){_0x5c5e72['limit']=qs[_0x7112('0x20')](_0x1bcc08['query']['limit']);_0x5c5e72[_0x7112('0x1e')]=qs[_0x7112('0x1e')](_0x1bcc08[_0x7112('0x34')]['offset']);}return _0x9c68a4['getActions'](_0x5c5e72);}})[_0x7112('0x26')](function(_0x6b7664){if(_0x6b7664){return _0x6b7664?{'count':_0x1130c2,'rows':_0x6b7664}:null;}})[_0x7112('0x26')](respondWithResult(_0x2c4ab8,null))[_0x7112('0x4a')](handleError(_0x2c4ab8,null));}; \ No newline at end of file +var _0x6984=['moment','mustache','util','sox','to-csv','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','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','update','then','destroy','sendStatus','error','stack','send','map','Automation','rawAttributes','type','key','model','name','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','params','length','find','create','body','Condition','omit','ids','getConditions','keys','sort','addActions','findOne','Action','getActions','rimraf','fast-json-patch','request-promise'];(function(_0x55d332,_0x549069){var _0x584ba6=function(_0x367e6b){while(--_0x367e6b){_0x55d332['push'](_0x55d332['shift']());}};_0x584ba6(++_0x549069);}(_0x6984,0x9d));var _0x4698=function(_0xfc514d,_0x54c4db){_0xfc514d=_0xfc514d-0x0;var _0x306239=_0x6984[_0xfc514d];return _0x306239;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4698('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4698('0x1'));var rp=require(_0x4698('0x2'));var moment=require(_0x4698('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4698('0x4'));var util=require(_0x4698('0x5'));var path=require('path');var sox=require(_0x4698('0x6'));var csv=require(_0x4698('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4698('0x8'));var _=require(_0x4698('0x9'));var squel=require(_0x4698('0xa'));var crypto=require(_0x4698('0xb'));var jsforce=require(_0x4698('0xc'));var deskjs=require(_0x4698('0xd'));var toCsv=require(_0x4698('0x7'));var querystring=require(_0x4698('0xe'));var Papa=require('papaparse');var Redis=require(_0x4698('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x4698('0x10'));var as=require(_0x4698('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4698('0x12'))(_0x4698('0x13'));var utils=require(_0x4698('0x14'));var config=require(_0x4698('0x15'));var licenseUtil=require(_0x4698('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1b8f39,_0x1e6d42){_0x1e6d42=_0x1e6d42||0xcc;return function(_0x516400){if(_0x516400){return _0x1b8f39['sendStatus'](_0x1e6d42);}return _0x1b8f39[_0x4698('0x17')](_0x1e6d42)[_0x4698('0x18')]();};}function respondWithResult(_0x4e1de9,_0x405440){_0x405440=_0x405440||0xc8;return function(_0x1a9561){if(_0x1a9561){return _0x4e1de9[_0x4698('0x17')](_0x405440)[_0x4698('0x19')](_0x1a9561);}};}function respondWithFilteredResult(_0x381c9e,_0x7230ae){return function(_0x5181cd){if(_0x5181cd){var _0x360342=typeof _0x7230ae['offset']===_0x4698('0x1a')&&typeof _0x7230ae[_0x4698('0x1b')]===_0x4698('0x1a');var _0x3f85ab=_0x5181cd[_0x4698('0x1c')];var _0x5c7aae=_0x360342?0x0:_0x7230ae[_0x4698('0x1d')];var _0x1d3aa5=_0x360342?_0x5181cd[_0x4698('0x1c')]:_0x7230ae[_0x4698('0x1d')]+_0x7230ae['limit'];var _0x4596b0;if(_0x1d3aa5>=_0x3f85ab){_0x1d3aa5=_0x3f85ab;_0x4596b0=0xc8;}else{_0x4596b0=0xce;}_0x381c9e[_0x4698('0x17')](_0x4596b0);return _0x381c9e[_0x4698('0x1e')](_0x4698('0x1f'),_0x5c7aae+'-'+_0x1d3aa5+'/'+_0x3f85ab)[_0x4698('0x19')](_0x5181cd);}return null;};}function patchUpdates(_0x19f9df){return function(_0x101695){try{jsonpatch['apply'](_0x101695,_0x19f9df,!![]);}catch(_0x38b51a){return BPromise[_0x4698('0x20')](_0x38b51a);}return _0x101695['save']();};}function saveUpdates(_0xd5db26,_0x3b5616){return function(_0x532af6){if(_0x532af6){return _0x532af6[_0x4698('0x21')](_0xd5db26)[_0x4698('0x22')](function(_0x203859){return _0x203859;});}return null;};}function removeEntity(_0x24378a,_0x41935b){return function(_0x1a573f){if(_0x1a573f){return _0x1a573f[_0x4698('0x23')]()[_0x4698('0x22')](function(){_0x24378a[_0x4698('0x17')](0xcc)[_0x4698('0x18')]();});}};}function handleEntityNotFound(_0x157211,_0x105184){return function(_0x1ee308){if(!_0x1ee308){_0x157211[_0x4698('0x24')](0x194);}return _0x1ee308;};}function handleError(_0x4c9d7a,_0x474114){_0x474114=_0x474114||0x1f4;return function(_0x398469){logger[_0x4698('0x25')](_0x398469[_0x4698('0x26')]);if(_0x398469['name']){delete _0x398469['name'];}_0x4c9d7a['status'](_0x474114)[_0x4698('0x27')](_0x398469);};}exports['index']=function(_0x5f4592,_0x4648aa){var _0x44081b={},_0x6791f1={},_0x88a115={'count':0x0,'rows':[]};var _0x2b3ba7=_[_0x4698('0x28')](db[_0x4698('0x29')][_0x4698('0x2a')],function(_0x233abd){return{'name':_0x233abd['fieldName'],'type':_0x233abd[_0x4698('0x2b')][_0x4698('0x2c')]};});_0x6791f1[_0x4698('0x2d')]=_[_0x4698('0x28')](_0x2b3ba7,_0x4698('0x2e'));_0x6791f1[_0x4698('0x2f')]=_['keys'](_0x5f4592[_0x4698('0x2f')]);_0x6791f1['filters']=_[_0x4698('0x30')](_0x6791f1[_0x4698('0x2d')],_0x6791f1[_0x4698('0x2f')]);_0x44081b[_0x4698('0x31')]=_[_0x4698('0x30')](_0x6791f1[_0x4698('0x2d')],qs['fields'](_0x5f4592[_0x4698('0x2f')][_0x4698('0x32')]));_0x44081b[_0x4698('0x31')]=_0x44081b[_0x4698('0x31')]['length']?_0x44081b[_0x4698('0x31')]:_0x6791f1[_0x4698('0x2d')];if(!_0x5f4592[_0x4698('0x2f')][_0x4698('0x33')](_0x4698('0x34'))){_0x44081b[_0x4698('0x1b')]=qs[_0x4698('0x1b')](_0x5f4592[_0x4698('0x2f')]['limit']);_0x44081b['offset']=qs[_0x4698('0x1d')](_0x5f4592['query'][_0x4698('0x1d')]);}_0x44081b[_0x4698('0x35')]=qs['sort'](_0x5f4592['query']['sort']);_0x44081b[_0x4698('0x36')]=qs[_0x4698('0x37')](_[_0x4698('0x38')](_0x5f4592[_0x4698('0x2f')],_0x6791f1[_0x4698('0x37')]),_0x2b3ba7);if(_0x5f4592[_0x4698('0x2f')][_0x4698('0x39')]){_0x44081b[_0x4698('0x36')]=_[_0x4698('0x3a')](_0x44081b['where'],{'$or':_[_0x4698('0x28')](_0x2b3ba7,function(_0x246fa2){if(_0x246fa2[_0x4698('0x2b')]!==_0x4698('0x3b')){var _0x22c972={};_0x22c972[_0x246fa2[_0x4698('0x2e')]]={'$like':'%'+_0x5f4592[_0x4698('0x2f')]['filter']+'%'};return _0x22c972;}})});}_0x44081b=_[_0x4698('0x3a')]({},_0x44081b,_0x5f4592[_0x4698('0x3c')]);var _0x53f9d7={'where':_0x44081b[_0x4698('0x36')]};return db['Automation']['count'](_0x53f9d7)[_0x4698('0x22')](function(_0x19bb7a){_0x88a115[_0x4698('0x1c')]=_0x19bb7a;if(_0x5f4592['query']['includeAll']){_0x44081b[_0x4698('0x3d')]=[{'all':!![]}];}return db[_0x4698('0x29')][_0x4698('0x3e')](_0x44081b);})[_0x4698('0x22')](function(_0x1cd21e){_0x88a115['rows']=_0x1cd21e;return _0x88a115;})['then'](respondWithFilteredResult(_0x4648aa,_0x44081b))[_0x4698('0x3f')](handleError(_0x4648aa,null));};exports[_0x4698('0x40')]=function(_0x240e9a,_0x506c04){var _0x11d718={'raw':![],'where':{'id':_0x240e9a[_0x4698('0x41')]['id']}},_0x5c7fbd={};_0x5c7fbd['model']=_['keys'](db[_0x4698('0x29')][_0x4698('0x2a')]);_0x5c7fbd[_0x4698('0x2f')]=_['keys'](_0x240e9a[_0x4698('0x2f')]);_0x5c7fbd[_0x4698('0x37')]=_[_0x4698('0x30')](_0x5c7fbd[_0x4698('0x2d')],_0x5c7fbd[_0x4698('0x2f')]);_0x11d718['attributes']=_[_0x4698('0x30')](_0x5c7fbd[_0x4698('0x2d')],qs['fields'](_0x240e9a[_0x4698('0x2f')]['fields']));_0x11d718[_0x4698('0x31')]=_0x11d718[_0x4698('0x31')][_0x4698('0x42')]?_0x11d718[_0x4698('0x31')]:_0x5c7fbd[_0x4698('0x2d')];if(_0x240e9a[_0x4698('0x2f')]['includeAll']){_0x11d718[_0x4698('0x3d')]=[{'all':!![]}];}_0x11d718=_[_0x4698('0x3a')]({},_0x11d718,_0x240e9a[_0x4698('0x3c')]);return db['Automation'][_0x4698('0x43')](_0x11d718)[_0x4698('0x22')](handleEntityNotFound(_0x506c04,null))[_0x4698('0x22')](respondWithResult(_0x506c04,null))[_0x4698('0x3f')](handleError(_0x506c04,null));};exports[_0x4698('0x44')]=function(_0x2f773c,_0x1bf35e){return db['Automation'][_0x4698('0x44')](_0x2f773c[_0x4698('0x45')],{})[_0x4698('0x22')](respondWithResult(_0x1bf35e,0xc9))[_0x4698('0x3f')](handleError(_0x1bf35e,null));};exports[_0x4698('0x21')]=function(_0xd761f5,_0x526883){if(_0xd761f5[_0x4698('0x45')]['id']){delete _0xd761f5[_0x4698('0x45')]['id'];}return db[_0x4698('0x29')][_0x4698('0x43')]({'where':{'id':_0xd761f5[_0x4698('0x41')]['id']}})[_0x4698('0x22')](handleEntityNotFound(_0x526883,null))['then'](saveUpdates(_0xd761f5[_0x4698('0x45')],null))[_0x4698('0x22')](respondWithResult(_0x526883,null))['catch'](handleError(_0x526883,null));};exports['destroy']=function(_0x124051,_0x1a286e){return db['Automation'][_0x4698('0x43')]({'where':{'id':_0x124051[_0x4698('0x41')]['id']}})['then'](handleEntityNotFound(_0x1a286e,null))[_0x4698('0x22')](removeEntity(_0x1a286e,null))[_0x4698('0x3f')](handleError(_0x1a286e,null));};exports['addConditions']=function(_0xc9bbcd,_0x5efcb5,_0x130917){return db[_0x4698('0x46')][_0x4698('0x43')]({'where':{'id':_0xc9bbcd['params']['id']}})[_0x4698('0x22')](handleEntityNotFound(_0x5efcb5,null))[_0x4698('0x22')](function(_0xc07ec0){if(_0xc07ec0){return _0xc07ec0['addConditions'](_0xc9bbcd['body']['ids'],_[_0x4698('0x47')](_0xc9bbcd['body'],[_0x4698('0x48'),'id'])||{});}})[_0x4698('0x22')](respondWithResult(_0x5efcb5,null))[_0x4698('0x3f')](handleError(_0x5efcb5,null));};exports[_0x4698('0x49')]=function(_0x90da86,_0x29c41e,_0x64c73c){var _0x4b7354={};var _0x50c732={};var _0x3b0d8b;var _0x1953e9;return db[_0x4698('0x29')]['findOne']({'where':{'id':_0x90da86['params']['id']}})[_0x4698('0x22')](handleEntityNotFound(_0x29c41e,null))['then'](function(_0x25c73f){if(_0x25c73f){_0x3b0d8b=_0x25c73f;_0x50c732['model']=_[_0x4698('0x4a')](db[_0x4698('0x46')][_0x4698('0x2a')]);_0x50c732[_0x4698('0x2f')]=_['keys'](_0x90da86[_0x4698('0x2f')]);_0x50c732[_0x4698('0x37')]=_[_0x4698('0x30')](_0x50c732[_0x4698('0x2d')],_0x50c732[_0x4698('0x2f')]);_0x4b7354['attributes']=_[_0x4698('0x30')](_0x50c732[_0x4698('0x2d')],qs[_0x4698('0x32')](_0x90da86[_0x4698('0x2f')]['fields']));_0x4b7354['attributes']=_0x4b7354[_0x4698('0x31')][_0x4698('0x42')]?_0x4b7354[_0x4698('0x31')]:_0x50c732[_0x4698('0x2d')];_0x4b7354['order']=qs['sort'](_0x90da86['query'][_0x4698('0x4b')]);_0x4b7354['where']=qs[_0x4698('0x37')](_['pick'](_0x90da86['query'],_0x50c732[_0x4698('0x37')]));if(_0x90da86[_0x4698('0x2f')]['filter']){_0x4b7354[_0x4698('0x36')]=_[_0x4698('0x3a')](_0x4b7354[_0x4698('0x36')],{'$or':_[_0x4698('0x28')](_0x4b7354['attributes'],function(_0x34972d){var _0x2a1883={};_0x2a1883[_0x34972d]={'$like':'%'+_0x90da86[_0x4698('0x2f')][_0x4698('0x39')]+'%'};return _0x2a1883;})});}_0x4b7354=_[_0x4698('0x3a')]({},_0x4b7354,_0x90da86[_0x4698('0x3c')]);return _0x3b0d8b[_0x4698('0x49')](_0x4b7354);}})[_0x4698('0x22')](function(_0x4f2e9a){if(_0x4f2e9a){_0x1953e9=_0x4f2e9a['length'];if(!_0x90da86[_0x4698('0x2f')]['hasOwnProperty']('nolimit')){_0x4b7354[_0x4698('0x1b')]=qs['limit'](_0x90da86[_0x4698('0x2f')][_0x4698('0x1b')]);_0x4b7354[_0x4698('0x1d')]=qs[_0x4698('0x1d')](_0x90da86[_0x4698('0x2f')][_0x4698('0x1d')]);}return _0x3b0d8b[_0x4698('0x49')](_0x4b7354);}})[_0x4698('0x22')](function(_0x49140a){if(_0x49140a){return _0x49140a?{'count':_0x1953e9,'rows':_0x49140a}:null;}})[_0x4698('0x22')](respondWithResult(_0x29c41e,null))[_0x4698('0x3f')](handleError(_0x29c41e,null));};exports[_0x4698('0x4c')]=function(_0x591a08,_0x49310d,_0x3d7503){return db['Action'][_0x4698('0x43')]({'where':{'id':_0x591a08['params']['id']}})['then'](handleEntityNotFound(_0x49310d,null))['then'](function(_0x3e7707){if(_0x3e7707){return _0x3e7707[_0x4698('0x4c')](_0x591a08['body'][_0x4698('0x48')],_['omit'](_0x591a08['body'],['ids','id'])||{});}})[_0x4698('0x22')](respondWithResult(_0x49310d,null))[_0x4698('0x3f')](handleError(_0x49310d,null));};exports['getActions']=function(_0x2099c0,_0x3a7137,_0x2f9fdf){var _0x38faa0={};var _0x33a2ab={};var _0x79f6a7;var _0x2d7851;return db[_0x4698('0x29')][_0x4698('0x4d')]({'where':{'id':_0x2099c0[_0x4698('0x41')]['id']}})[_0x4698('0x22')](handleEntityNotFound(_0x3a7137,null))[_0x4698('0x22')](function(_0x104162){if(_0x104162){_0x79f6a7=_0x104162;_0x33a2ab[_0x4698('0x2d')]=_[_0x4698('0x4a')](db[_0x4698('0x4e')][_0x4698('0x2a')]);_0x33a2ab[_0x4698('0x2f')]=_[_0x4698('0x4a')](_0x2099c0['query']);_0x33a2ab['filters']=_[_0x4698('0x30')](_0x33a2ab[_0x4698('0x2d')],_0x33a2ab[_0x4698('0x2f')]);_0x38faa0[_0x4698('0x31')]=_[_0x4698('0x30')](_0x33a2ab[_0x4698('0x2d')],qs[_0x4698('0x32')](_0x2099c0[_0x4698('0x2f')][_0x4698('0x32')]));_0x38faa0['attributes']=_0x38faa0['attributes'][_0x4698('0x42')]?_0x38faa0[_0x4698('0x31')]:_0x33a2ab[_0x4698('0x2d')];_0x38faa0[_0x4698('0x35')]=qs[_0x4698('0x4b')](_0x2099c0[_0x4698('0x2f')]['sort']);_0x38faa0['where']=qs[_0x4698('0x37')](_[_0x4698('0x38')](_0x2099c0['query'],_0x33a2ab['filters']));if(_0x2099c0[_0x4698('0x2f')][_0x4698('0x39')]){_0x38faa0[_0x4698('0x36')]=_[_0x4698('0x3a')](_0x38faa0[_0x4698('0x36')],{'$or':_['map'](_0x38faa0[_0x4698('0x31')],function(_0x2c1534){var _0x2365f7={};_0x2365f7[_0x2c1534]={'$like':'%'+_0x2099c0[_0x4698('0x2f')][_0x4698('0x39')]+'%'};return _0x2365f7;})});}_0x38faa0=_[_0x4698('0x3a')]({},_0x38faa0,_0x2099c0[_0x4698('0x3c')]);return _0x79f6a7['getActions'](_0x38faa0);}})[_0x4698('0x22')](function(_0x5407e5){if(_0x5407e5){_0x2d7851=_0x5407e5['length'];if(!_0x2099c0[_0x4698('0x2f')]['hasOwnProperty'](_0x4698('0x34'))){_0x38faa0['limit']=qs[_0x4698('0x1b')](_0x2099c0[_0x4698('0x2f')][_0x4698('0x1b')]);_0x38faa0['offset']=qs[_0x4698('0x1d')](_0x2099c0[_0x4698('0x2f')][_0x4698('0x1d')]);}return _0x79f6a7[_0x4698('0x4f')](_0x38faa0);}})[_0x4698('0x22')](function(_0x24d0a3){if(_0x24d0a3){return _0x24d0a3?{'count':_0x2d7851,'rows':_0x24d0a3}:null;}})[_0x4698('0x22')](respondWithResult(_0x3a7137,null))[_0x4698('0x3f')](handleError(_0x3a7137,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index c41ac01..2a66f6b 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 _0x7731=['path','rimraf','../../config/environment','./automation.attributes','exports','tools_automations','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2db6fa,_0x4ac467){var _0xd2b1=function(_0x278694){while(--_0x278694){_0x2db6fa['push'](_0x2db6fa['shift']());}};_0xd2b1(++_0x4ac467);}(_0x7731,0x1d4));var _0x1773=function(_0x27aa38,_0x2b4490){_0x27aa38=_0x27aa38-0x0;var _0x3e1199=_0x7731[_0x27aa38];return _0x3e1199;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1773('0x0'))(_0x1773('0x1'));var moment=require(_0x1773('0x2'));var BPromise=require(_0x1773('0x3'));var rp=require(_0x1773('0x4'));var fs=require('fs');var path=require(_0x1773('0x5'));var rimraf=require(_0x1773('0x6'));var config=require(_0x1773('0x7'));var attributes=require(_0x1773('0x8'));module[_0x1773('0x9')]=function(_0x12a59d,_0x4977cf){return _0x12a59d['define']('Automation',attributes,{'tableName':_0x1773('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1b46=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./automation.attributes','exports','define','Automation','tools_automations','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1b46,0x137));var _0x61b4=function(_0x89f63,_0x4d8c95){_0x89f63=_0x89f63-0x0;var _0x2adbf8=_0x1b46[_0x89f63];return _0x2adbf8;};'use strict';var _=require('lodash');var util=require(_0x61b4('0x0'));var logger=require(_0x61b4('0x1'))('api');var moment=require(_0x61b4('0x2'));var BPromise=require(_0x61b4('0x3'));var rp=require(_0x61b4('0x4'));var fs=require('fs');var path=require(_0x61b4('0x5'));var rimraf=require(_0x61b4('0x6'));var config=require(_0x61b4('0x7'));var attributes=require(_0x61b4('0x8'));module[_0x61b4('0x9')]=function(_0x51da86,_0x14c5de){return _0x51da86[_0x61b4('0xa')](_0x61b4('0xb'),attributes,{'tableName':_0x61b4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js index 4d7223f..1da9619 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 _0xe0dd=['../../config/utils','../../config/logger','jayson/promise','client','then','info','Automation,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0xe0dd,0x163));var _0xde0d=function(_0x7c0074,_0x1ffdcf){_0x7c0074=_0x7c0074-0x0;var _0x13e95b=_0xe0dd[_0x7c0074];return _0x13e95b;};'use strict';var _=require(_0xde0d('0x0'));var util=require(_0xde0d('0x1'));var moment=require('moment');var BPromise=require(_0xde0d('0x2'));var rs=require(_0xde0d('0x3'));var fs=require('fs');var Redis=require(_0xde0d('0x4'));var db=require(_0xde0d('0x5'))['db'];var utils=require(_0xde0d('0x6'));var logger=require(_0xde0d('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xde0d('0x8'));var client=jayson[_0xde0d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x323200,_0x3ce23c,_0x33a644){return new BPromise(function(_0x570b78,_0x25f0fe){return client['request'](_0x323200,_0x33a644)[_0xde0d('0xa')](function(_0x5e6588){logger[_0xde0d('0xb')](_0xde0d('0xc'),_0x3ce23c,_0xde0d('0xd'));logger['debug']('Automation,\x20%s,\x20%s,\x20%s',_0x3ce23c,'request\x20sent',JSON[_0xde0d('0xe')](_0x5e6588));if(_0x5e6588[_0xde0d('0xf')]){if(_0x5e6588[_0xde0d('0xf')]['code']===0x1f4){logger[_0xde0d('0xf')](_0xde0d('0xc'),_0x3ce23c,_0x5e6588['error'][_0xde0d('0x10')]);return _0x25f0fe(_0x5e6588[_0xde0d('0xf')][_0xde0d('0x10')]);}logger[_0xde0d('0xf')](_0xde0d('0xc'),_0x3ce23c,_0x5e6588['error'][_0xde0d('0x10')]);return _0x570b78(_0x5e6588['error'][_0xde0d('0x10')]);}else{logger['info'](_0xde0d('0xc'),_0x3ce23c,'request\x20sent');_0x570b78(_0x5e6588[_0xde0d('0x11')][_0xde0d('0x10')]);}})[_0xde0d('0x12')](function(_0x228666){logger[_0xde0d('0xf')](_0xde0d('0xc'),_0x3ce23c,_0x228666);_0x25f0fe(_0x228666);});});} \ No newline at end of file +var _0xa32b=['message','info','result','catch','lodash','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','debug','request\x20sent','error','Automation,\x20%s,\x20%s'];(function(_0x4a5cce,_0x34265f){var _0x347252=function(_0x7d6755){while(--_0x7d6755){_0x4a5cce['push'](_0x4a5cce['shift']());}};_0x347252(++_0x34265f);}(_0xa32b,0x68));var _0xba32=function(_0x1992f1,_0x5c61f0){_0x1992f1=_0x1992f1-0x0;var _0x413dfe=_0xa32b[_0x1992f1];return _0x413dfe;};'use strict';var _=require(_0xba32('0x0'));var util=require('util');var moment=require(_0xba32('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xba32('0x2'));var db=require(_0xba32('0x3'))['db'];var utils=require(_0xba32('0x4'));var logger=require('../../config/logger')(_0xba32('0x5'));var config=require(_0xba32('0x6'));var jayson=require(_0xba32('0x7'));var client=jayson[_0xba32('0x8')][_0xba32('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5c5a59,_0x1b1332,_0x4edbc6){return new BPromise(function(_0xcdcc5b,_0x13395b){return client[_0xba32('0xa')](_0x5c5a59,_0x4edbc6)[_0xba32('0xb')](function(_0x5d8f64){logger['info']('Automation,\x20%s,\x20%s',_0x1b1332,'request\x20sent');logger[_0xba32('0xc')]('Automation,\x20%s,\x20%s,\x20%s',_0x1b1332,_0xba32('0xd'),JSON['stringify'](_0x5d8f64));if(_0x5d8f64[_0xba32('0xe')]){if(_0x5d8f64['error']['code']===0x1f4){logger[_0xba32('0xe')](_0xba32('0xf'),_0x1b1332,_0x5d8f64[_0xba32('0xe')][_0xba32('0x10')]);return _0x13395b(_0x5d8f64[_0xba32('0xe')]['message']);}logger[_0xba32('0xe')](_0xba32('0xf'),_0x1b1332,_0x5d8f64[_0xba32('0xe')][_0xba32('0x10')]);return _0xcdcc5b(_0x5d8f64[_0xba32('0xe')][_0xba32('0x10')]);}else{logger[_0xba32('0x11')]('Automation,\x20%s,\x20%s',_0x1b1332,_0xba32('0xd'));_0xcdcc5b(_0x5d8f64[_0xba32('0x12')][_0xba32('0x10')]);}})[_0xba32('0x13')](function(_0x310dee){logger['error']('Automation,\x20%s,\x20%s',_0x1b1332,_0x310dee);_0x13395b(_0x310dee);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 2576b9d..d4336ea 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 _0x20ce=['../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','post','addConditions','addActions','update','destroy','exports','multer','util','path','express','Router','fs-extra'];(function(_0x4d7379,_0x4b4e63){var _0x46d7cf=function(_0x53f5f0){while(--_0x53f5f0){_0x4d7379['push'](_0x4d7379['shift']());}};_0x46d7cf(++_0x4b4e63);}(_0x20ce,0x10d));var _0xe20c=function(_0x2472ce,_0x22d9b3){_0x2472ce=_0x2472ce-0x0;var _0x373ed8=_0x20ce[_0x2472ce];return _0x373ed8;};'use strict';var multer=require(_0xe20c('0x0'));var util=require(_0xe20c('0x1'));var path=require(_0xe20c('0x2'));var timeout=require('connect-timeout');var express=require(_0xe20c('0x3'));var router=express[_0xe20c('0x4')]();var fs_extra=require(_0xe20c('0x5'));var auth=require(_0xe20c('0x6'));var interaction=require(_0xe20c('0x7'));var config=require(_0xe20c('0x8'));var controller=require(_0xe20c('0x9'));router[_0xe20c('0xa')]('/',auth[_0xe20c('0xb')](),controller[_0xe20c('0xc')]);router[_0xe20c('0xa')](_0xe20c('0xd'),auth[_0xe20c('0xb')](),controller[_0xe20c('0xe')]);router[_0xe20c('0xa')](_0xe20c('0xf'),auth[_0xe20c('0xb')](),controller[_0xe20c('0x10')]);router[_0xe20c('0xa')](_0xe20c('0x11'),auth[_0xe20c('0xb')](),controller[_0xe20c('0x12')]);router[_0xe20c('0x13')]('/',auth[_0xe20c('0xb')](),controller['create']);router[_0xe20c('0x13')](_0xe20c('0xf'),auth[_0xe20c('0xb')](),controller[_0xe20c('0x14')]);router[_0xe20c('0x13')]('/:id/actions',auth[_0xe20c('0xb')](),controller[_0xe20c('0x15')]);router['put'](_0xe20c('0xd'),auth[_0xe20c('0xb')](),controller[_0xe20c('0x16')]);router['delete'](_0xe20c('0xd'),auth[_0xe20c('0xb')](),controller[_0xe20c('0x17')]);module[_0xe20c('0x18')]=router; \ No newline at end of file +var _0x117d=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./automation.controller','get','isAuthenticated','index','show','/:id/conditions','getConditions','/:id/actions','getActions','post','create','addConditions','put','update','delete','destroy','exports','multer','util','path'];(function(_0x4af95c,_0x40708f){var _0x28c01f=function(_0x3fae4e){while(--_0x3fae4e){_0x4af95c['push'](_0x4af95c['shift']());}};_0x28c01f(++_0x40708f);}(_0x117d,0xac));var _0xd117=function(_0x47568e,_0x5ccdaf){_0x47568e=_0x47568e-0x0;var _0x33815b=_0x117d[_0x47568e];return _0x33815b;};'use strict';var multer=require(_0xd117('0x0'));var util=require(_0xd117('0x1'));var path=require(_0xd117('0x2'));var timeout=require('connect-timeout');var express=require(_0xd117('0x3'));var router=express[_0xd117('0x4')]();var fs_extra=require(_0xd117('0x5'));var auth=require(_0xd117('0x6'));var interaction=require(_0xd117('0x7'));var config=require('../../config/environment');var controller=require(_0xd117('0x8'));router[_0xd117('0x9')]('/',auth[_0xd117('0xa')](),controller[_0xd117('0xb')]);router['get']('/:id',auth[_0xd117('0xa')](),controller[_0xd117('0xc')]);router[_0xd117('0x9')](_0xd117('0xd'),auth[_0xd117('0xa')](),controller[_0xd117('0xe')]);router[_0xd117('0x9')](_0xd117('0xf'),auth[_0xd117('0xa')](),controller[_0xd117('0x10')]);router[_0xd117('0x11')]('/',auth[_0xd117('0xa')](),controller[_0xd117('0x12')]);router['post'](_0xd117('0xd'),auth[_0xd117('0xa')](),controller[_0xd117('0x13')]);router[_0xd117('0x11')](_0xd117('0xf'),auth['isAuthenticated'](),controller['addActions']);router[_0xd117('0x14')]('/:id',auth[_0xd117('0xa')](),controller[_0xd117('0x15')]);router[_0xd117('0x16')]('/:id',auth[_0xd117('0xa')](),controller[_0xd117('0x17')]);module[_0xd117('0x18')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index b887200..215bbe0 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 _0xc576=['ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','name','ENUM','ivr','STRING','BOOLEAN','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\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','never','always','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC'];(function(_0x22b2ba,_0x5733c7){var _0x2d159a=function(_0x37b177){while(--_0x37b177){_0x22b2ba['push'](_0x22b2ba['shift']());}};_0x2d159a(++_0x5733c7);}(_0xc576,0xf9));var _0x6c57=function(_0x3fb5eb,_0x5947a6){_0x3fb5eb=_0x3fb5eb-0x0;var _0x481291=_0xc576[_0x3fb5eb];return _0x481291;};'use strict';var Sequelize=require(_0x6c57('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x6c57('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x6c57('0x2')](_0x6c57('0x3')),'allowNull':![],'defaultValue':_0x6c57('0x3')},'description':{'type':Sequelize[_0x6c57('0x4')]},'active':{'type':Sequelize[_0x6c57('0x5')],'defaultValue':0x0,'comment':_0x6c57('0x6')},'limitCalls':{'type':Sequelize[_0x6c57('0x7')](0x4)[_0x6c57('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x6c57('0x4')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x6c57('0x4')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x6c57('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6c57('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x6c57('0x7')](0x3)[_0x6c57('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6c57('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x6c57('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6c57('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0x6c57('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6c57('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0x6c57('0x7')](0x5)[_0x6c57('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x6c57('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x6c57('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x6c57('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x6c57('0x7')](0x3)[_0x6c57('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x6c57('0x4')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x6c57('0x4')],'defaultValue':_0x6c57('0xe')},'dialCheckDuplicateType':{'type':Sequelize[_0x6c57('0x2')]('always',_0x6c57('0xf'),'onlyIfOpen'),'defaultValue':_0x6c57('0x10')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x6c57('0x7')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x6c57('0x11')},'dialAMDGreeting':{'type':Sequelize[_0x6c57('0x7')](0x9)[_0x6c57('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x6c57('0x7')](0x9)[_0x6c57('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x6c57('0x12')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x6c57('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x6c57('0x7')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x6c57('0x13')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x6c57('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x6c57('0x7')](0x9)[_0x6c57('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x6c57('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x6c57('0x14')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x6c57('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x6c57('0x15')},'dialOrderByScheduledAt':{'type':Sequelize[_0x6c57('0x2')](_0x6c57('0x16'),_0x6c57('0x17')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x6c57('0x4')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x6c57('0x7')](0x3)[_0x6c57('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x6c57('0x18')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x6c57('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x6c57('0x19')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x6c57('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x6c57('0x7')](0x3)[_0x6c57('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6c57('0x1a')},'dialDropRetryFrequency':{'type':Sequelize[_0x6c57('0x7')](0x5)[_0x6c57('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6c57('0x1b')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x6c57('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6c57('0x1c')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6c57('0x1d')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6c57('0x1e')},'dialMachineRetryFrequency':{'type':Sequelize[_0x6c57('0x7')](0x5)[_0x6c57('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6c57('0x1f')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x6c57('0x7')](0x3)[_0x6c57('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6c57('0x20')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x6c57('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6c57('0x21')}}; \ No newline at end of file +var _0x99de=['onlyIfOpen','always','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','STRING','name','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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','ENUM','never'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x99de,0x194));var _0xe99d=function(_0xe30e17,_0xce02be){_0xe30e17=_0xe30e17-0x0;var _0x2342c9=_0x99de[_0xe30e17];return _0x2342c9;};'use strict';var Sequelize=require(_0xe99d('0x0'));module['exports']={'name':{'type':Sequelize[_0xe99d('0x1')],'unique':_0xe99d('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM']('ivr'),'allowNull':![],'defaultValue':_0xe99d('0x3')},'description':{'type':Sequelize[_0xe99d('0x1')]},'active':{'type':Sequelize[_0xe99d('0x4')],'defaultValue':0x0,'comment':_0xe99d('0x5')},'limitCalls':{'type':Sequelize[_0xe99d('0x6')](0x4)[_0xe99d('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0xe99d('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xe99d('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0xe99d('0x6')](0x3)[_0xe99d('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe99d('0x8')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xe99d('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe99d('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xe99d('0x6')](0x5)[_0xe99d('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe99d('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0xe99d('0x6')](0x3)[_0xe99d('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xe99d('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe99d('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xe99d('0x6')](0x3)[_0xe99d('0x7')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xe99d('0x6')](0x5)[_0xe99d('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xe99d('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xe99d('0xc')},'dialTimezone':{'type':Sequelize[_0xe99d('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0xe99d('0xd')},'dialCheckDuplicateType':{'type':Sequelize[_0xe99d('0xe')]('always',_0xe99d('0xf'),_0xe99d('0x10')),'defaultValue':_0xe99d('0x11')},'dialAMDActive':{'type':Sequelize[_0xe99d('0x4')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xe99d('0x6')](0x9)[_0xe99d('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xe99d('0x12')},'dialAMDGreeting':{'type':Sequelize[_0xe99d('0x6')](0x9)[_0xe99d('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xe99d('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xe99d('0x6')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xe99d('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xe99d('0x6')](0x9)[_0xe99d('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xe99d('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0xe99d('0x6')](0x9)[_0xe99d('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xe99d('0x6')](0x9)[_0xe99d('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xe99d('0x16')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xe99d('0x6')](0x9)[_0xe99d('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xe99d('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0xe99d('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xe99d('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xe99d('0x6')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xe99d('0x19')},'dialOrderByScheduledAt':{'type':Sequelize[_0xe99d('0xe')]('DESC',_0xe99d('0x1a')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0xe99d('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xe99d('0x6')](0x3)[_0xe99d('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xe99d('0x1b')},'dialCutDigit':{'type':Sequelize[_0xe99d('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xe99d('0x1c')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xe99d('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe99d('0x1d')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xe99d('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe99d('0x1e')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xe99d('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe99d('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xe99d('0x6')](0x3)[_0xe99d('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xe99d('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0xe99d('0x6')](0x3)[_0xe99d('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe99d('0x20')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xe99d('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xe99d('0x6')](0x3)[_0xe99d('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe99d('0x21')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xe99d('0x6')](0x5)[_0xe99d('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe99d('0x22')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 1d3f74a..825faee 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 _0xbc5e=['../../config/utils','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','save','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','Campaign','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','hasOwnProperty','nolimit','offset','order','sort','where','filters','pick','filter','options','includeAll','findAll','rows','catch','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','IvrCampaigns','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','length','include','merge','updatedAt','omit','createdAt','update','getHoppers','CmHopper','getHopperHistories','findOne','CmHopperHistory','CampaignId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','ids','dialCheckDuplicateType','into','cm_hopper','fromQuery','phone','scheduledAt','ListId','select','field','ContactId','CmListId','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','from','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','NOW()','phone\x20NOT\x20IN\x20(?)','cm_hopper_additional_phones','OrderBy','h.id','ci.item','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','format','YYYY-MM-DD\x20HH:mm:ss','spread','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api'];(function(_0xa277de,_0x2ad712){var _0x27c2da=function(_0x349646){while(--_0x349646){_0xa277de['push'](_0xa277de['shift']());}};_0x27c2da(++_0x2ad712);}(_0xbc5e,0x7d));var _0xebc5=function(_0xd84fcd,_0x317f0f){_0xd84fcd=_0xd84fcd-0x0;var _0x20eb2b=_0xbc5e[_0xd84fcd];return _0x20eb2b;};'use strict';var emlformat=require(_0xebc5('0x0'));var rimraf=require(_0xebc5('0x1'));var zipdir=require(_0xebc5('0x2'));var jsonpatch=require(_0xebc5('0x3'));var rp=require(_0xebc5('0x4'));var moment=require(_0xebc5('0x5'));var BPromise=require(_0xebc5('0x6'));var Mustache=require(_0xebc5('0x7'));var util=require(_0xebc5('0x8'));var path=require('path');var sox=require(_0xebc5('0x9'));var csv=require(_0xebc5('0xa'));var ejs=require(_0xebc5('0xb'));var fs=require('fs');var fs_extra=require(_0xebc5('0xc'));var _=require(_0xebc5('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xebc5('0xe'));var deskjs=require(_0xebc5('0xf'));var toCsv=require(_0xebc5('0xa'));var querystring=require(_0xebc5('0x10'));var Papa=require('papaparse');var Redis=require(_0xebc5('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xebc5('0x12'));var as=require(_0xebc5('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xebc5('0x14'))(_0xebc5('0x15'));var utils=require(_0xebc5('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x564553,_0x477bc4){_0x477bc4=_0x477bc4||0xcc;return function(_0x30e6f4){if(_0x30e6f4){return _0x564553[_0xebc5('0x17')](_0x477bc4);}return _0x564553[_0xebc5('0x18')](_0x477bc4)[_0xebc5('0x19')]();};}function respondWithResult(_0x23805a,_0x5ba6c1){_0x5ba6c1=_0x5ba6c1||0xc8;return function(_0x375e29){if(_0x375e29){return _0x23805a['status'](_0x5ba6c1)[_0xebc5('0x1a')](_0x375e29);}};}function respondWithFilteredResult(_0x5eff85,_0x4ae3c6){return function(_0x3e903f){if(_0x3e903f){var _0x5489e9=typeof _0x4ae3c6['offset']===_0xebc5('0x1b')&&typeof _0x4ae3c6[_0xebc5('0x1c')]===_0xebc5('0x1b');var _0x21cbdf=_0x3e903f[_0xebc5('0x1d')];var _0x38d629=_0x5489e9?0x0:_0x4ae3c6['offset'];var _0x1aeef3=_0x5489e9?_0x3e903f[_0xebc5('0x1d')]:_0x4ae3c6['offset']+_0x4ae3c6[_0xebc5('0x1c')];var _0x1b1584;if(_0x1aeef3>=_0x21cbdf){_0x1aeef3=_0x21cbdf;_0x1b1584=0xc8;}else{_0x1b1584=0xce;}_0x5eff85['status'](_0x1b1584);return _0x5eff85[_0xebc5('0x1e')](_0xebc5('0x1f'),_0x38d629+'-'+_0x1aeef3+'/'+_0x21cbdf)[_0xebc5('0x1a')](_0x3e903f);}return null;};}function patchUpdates(_0x2170b6){return function(_0x3aff8d){try{jsonpatch['apply'](_0x3aff8d,_0x2170b6,!![]);}catch(_0x4f0a7f){return BPromise['reject'](_0x4f0a7f);}return _0x3aff8d[_0xebc5('0x20')]();};}function saveUpdates(_0x4af3d1,_0x257754){return function(_0x37ac8d){if(_0x37ac8d){return _0x37ac8d['update'](_0x4af3d1)[_0xebc5('0x21')](function(_0x1b247f){return _0x1b247f;});}return null;};}function removeEntity(_0x582541,_0x2be067){return function(_0x3ce69b){if(_0x3ce69b){return _0x3ce69b[_0xebc5('0x22')]()[_0xebc5('0x21')](function(){var _0x46394c=_0x3ce69b[_0xebc5('0x23')]({'plain':!![]});var _0x33bf29='IvrCampaigns';return db[_0xebc5('0x24')]['destroy']({'where':{'type':_0x33bf29,'resourceId':_0x46394c['id']}})[_0xebc5('0x21')](function(){return _0x3ce69b;});})[_0xebc5('0x21')](function(){_0x582541[_0xebc5('0x18')](0xcc)[_0xebc5('0x19')]();});}};}function handleEntityNotFound(_0x5b6127,_0x193cfe){return function(_0x5dfe9f){if(!_0x5dfe9f){_0x5b6127[_0xebc5('0x17')](0x194);}return _0x5dfe9f;};}function handleError(_0x255b72,_0x36faa3){_0x36faa3=_0x36faa3||0x1f4;return function(_0x46a04e){logger[_0xebc5('0x25')](_0x46a04e[_0xebc5('0x26')]);if(_0x46a04e[_0xebc5('0x27')]){delete _0x46a04e[_0xebc5('0x27')];}_0x255b72[_0xebc5('0x18')](_0x36faa3)[_0xebc5('0x28')](_0x46a04e);};}exports[_0xebc5('0x29')]=function(_0x3e53d0,_0x2acf91){var _0x204113={},_0x531ec2={},_0x120574={'count':0x0,'rows':[]};var _0x55579d=_[_0xebc5('0x2a')](db[_0xebc5('0x2b')][_0xebc5('0x2c')],function(_0x9e791f){return{'name':_0x9e791f[_0xebc5('0x2d')],'type':_0x9e791f[_0xebc5('0x2e')][_0xebc5('0x2f')]};});_0x531ec2[_0xebc5('0x30')]=_[_0xebc5('0x2a')](_0x55579d,'name');_0x531ec2['query']=_['keys'](_0x3e53d0[_0xebc5('0x31')]);_0x531ec2['filters']=_[_0xebc5('0x32')](_0x531ec2[_0xebc5('0x30')],_0x531ec2['query']);_0x204113['attributes']=_['intersection'](_0x531ec2[_0xebc5('0x30')],qs[_0xebc5('0x33')](_0x3e53d0[_0xebc5('0x31')][_0xebc5('0x33')]));_0x204113['attributes']=_0x204113[_0xebc5('0x34')]['length']?_0x204113[_0xebc5('0x34')]:_0x531ec2[_0xebc5('0x30')];if(!_0x3e53d0[_0xebc5('0x31')][_0xebc5('0x35')](_0xebc5('0x36'))){_0x204113[_0xebc5('0x1c')]=qs[_0xebc5('0x1c')](_0x3e53d0[_0xebc5('0x31')]['limit']);_0x204113[_0xebc5('0x37')]=qs[_0xebc5('0x37')](_0x3e53d0[_0xebc5('0x31')][_0xebc5('0x37')]);}_0x204113[_0xebc5('0x38')]=qs['sort'](_0x3e53d0[_0xebc5('0x31')][_0xebc5('0x39')]);_0x204113[_0xebc5('0x3a')]=qs[_0xebc5('0x3b')](_[_0xebc5('0x3c')](_0x3e53d0[_0xebc5('0x31')],_0x531ec2[_0xebc5('0x3b')]),_0x55579d);if(_0x3e53d0[_0xebc5('0x31')][_0xebc5('0x3d')]){_0x204113['where']=_['merge'](_0x204113[_0xebc5('0x3a')],{'$or':_[_0xebc5('0x2a')](_0x55579d,function(_0x191f1){if(_0x191f1['type']!=='VIRTUAL'){var _0x509adc={};_0x509adc[_0x191f1['name']]={'$like':'%'+_0x3e53d0[_0xebc5('0x31')]['filter']+'%'};return _0x509adc;}})});}_0x204113=_['merge']({},_0x204113,_0x3e53d0[_0xebc5('0x3e')]);var _0x25201a={'where':_0x204113[_0xebc5('0x3a')]};return db[_0xebc5('0x2b')][_0xebc5('0x1d')](_0x25201a)['then'](function(_0x529d35){_0x120574['count']=_0x529d35;if(_0x3e53d0[_0xebc5('0x31')][_0xebc5('0x3f')]){_0x204113['include']=[{'all':!![]}];}return db[_0xebc5('0x2b')][_0xebc5('0x40')](_0x204113);})[_0xebc5('0x21')](function(_0x1135b9){_0x120574[_0xebc5('0x41')]=_0x1135b9;return _0x120574;})['then'](respondWithFilteredResult(_0x2acf91,_0x204113))[_0xebc5('0x42')](handleError(_0x2acf91,null));};exports[_0xebc5('0x43')]=function(_0x13640e,_0x476200){var _0x3c4801={'raw':![],'where':{'id':_0x13640e[_0xebc5('0x44')]['id']}},_0x4d802b={};_0x4d802b[_0xebc5('0x30')]=_[_0xebc5('0x45')](db[_0xebc5('0x2b')][_0xebc5('0x2c')]);_0x4d802b[_0xebc5('0x31')]=_[_0xebc5('0x45')](_0x13640e[_0xebc5('0x31')]);_0x4d802b[_0xebc5('0x3b')]=_[_0xebc5('0x32')](_0x4d802b[_0xebc5('0x30')],_0x4d802b[_0xebc5('0x31')]);_0x3c4801[_0xebc5('0x34')]=_['intersection'](_0x4d802b[_0xebc5('0x30')],qs[_0xebc5('0x33')](_0x13640e['query'][_0xebc5('0x33')]));_0x3c4801[_0xebc5('0x34')]=_0x3c4801[_0xebc5('0x34')]['length']?_0x3c4801['attributes']:_0x4d802b['model'];if(_0x13640e[_0xebc5('0x31')][_0xebc5('0x3f')]){_0x3c4801['include']=[{'all':!![]}];}_0x3c4801=_['merge']({},_0x3c4801,_0x13640e[_0xebc5('0x3e')]);return db['Campaign'][_0xebc5('0x46')](_0x3c4801)[_0xebc5('0x21')](handleEntityNotFound(_0x476200,null))[_0xebc5('0x21')](respondWithResult(_0x476200,null))[_0xebc5('0x42')](handleError(_0x476200,null));};exports[_0xebc5('0x47')]=function(_0x2fb8b2,_0x5eff33){return db[_0xebc5('0x2b')][_0xebc5('0x47')](_0x2fb8b2[_0xebc5('0x48')],{})[_0xebc5('0x21')](function(_0x340c3e){var _0x3f9054=_0x2fb8b2[_0xebc5('0x49')][_0xebc5('0x23')]({'plain':!![]});if(!_0x3f9054)throw new Error(_0xebc5('0x4a'));if(_0x3f9054[_0xebc5('0x4b')]===_0xebc5('0x49')){var _0x57bbc9=_0x340c3e[_0xebc5('0x23')]({'plain':!![]});var _0x30242a=_0xebc5('0x4c');return db[_0xebc5('0x4d')][_0xebc5('0x46')]({'where':{'name':_0x30242a,'userProfileId':_0x3f9054[_0xebc5('0x4e')]},'raw':!![]})[_0xebc5('0x21')](function(_0x278810){if(_0x278810&&_0x278810[_0xebc5('0x4f')]===0x0){return db['UserProfileResource'][_0xebc5('0x47')]({'name':_0x57bbc9['name'],'resourceId':_0x57bbc9['id'],'type':_0x278810['name'],'sectionId':_0x278810['id']},{})[_0xebc5('0x21')](function(){return _0x340c3e;});}else{return _0x340c3e;}})[_0xebc5('0x42')](function(_0x456c82){logger[_0xebc5('0x25')](_0xebc5('0x50'),_0x456c82);throw _0x456c82;});}return _0x340c3e;})[_0xebc5('0x21')](respondWithResult(_0x5eff33,0xc9))[_0xebc5('0x42')](handleError(_0x5eff33,null));};exports[_0xebc5('0x51')]=function(_0x2d5eb0,_0x2f9d7e){var _0x160ba6={'where':{'id':_0x2d5eb0[_0xebc5('0x44')]['id']}},_0x3e68a9={};_0x3e68a9[_0xebc5('0x30')]=_[_0xebc5('0x45')](db[_0xebc5('0x2b')]['rawAttributes']);_0x160ba6[_0xebc5('0x34')]=_[_0xebc5('0x32')](_0x3e68a9[_0xebc5('0x30')],qs[_0xebc5('0x33')](_0x2d5eb0[_0xebc5('0x31')][_0xebc5('0x33')]));_0x160ba6[_0xebc5('0x34')]=_0x160ba6[_0xebc5('0x34')][_0xebc5('0x52')]?_0x160ba6[_0xebc5('0x34')]:_0x3e68a9[_0xebc5('0x30')];if(_0x2d5eb0[_0xebc5('0x31')][_0xebc5('0x3f')]){_0x160ba6[_0xebc5('0x53')]=[{'all':!![]}];}_0x160ba6=_[_0xebc5('0x54')]({},_0x160ba6,_0x2d5eb0[_0xebc5('0x3e')]);return db[_0xebc5('0x2b')][_0xebc5('0x46')](_0x160ba6)[_0xebc5('0x21')](handleEntityNotFound(_0x2f9d7e,null))[_0xebc5('0x21')](function(_0x423615){if(_0x423615){var _0x1c49e2=_0x423615[_0xebc5('0x23')]({'plain':!![]});_0x1c49e2=qs['omit'](_0x1c49e2,['id','createdAt',_0xebc5('0x55')]);_0x2d5eb0[_0xebc5('0x48')]=_[_0xebc5('0x56')](_0x2d5eb0['body'],['id',_0xebc5('0x57'),_0xebc5('0x55')]);return db[_0xebc5('0x2b')][_0xebc5('0x47')](_[_0xebc5('0x54')](_0x1c49e2,_0x2d5eb0[_0xebc5('0x48')]),{'include':_0x2d5eb0[_0xebc5('0x31')][_0xebc5('0x3f')]?[{'all':!![]}]:undefined})[_0xebc5('0x21')](function(_0x37c1f5){var _0x467ace=_0x2d5eb0[_0xebc5('0x49')][_0xebc5('0x23')]({'plain':!![]});if(!_0x467ace)throw new Error(_0xebc5('0x4a'));if(_0x467ace[_0xebc5('0x4b')]==='user'){var _0x369fad=_0x37c1f5[_0xebc5('0x23')]({'plain':!![]});var _0x1d0cdd=_0xebc5('0x4c');return db[_0xebc5('0x4d')][_0xebc5('0x46')]({'where':{'name':_0x1d0cdd,'userProfileId':_0x467ace[_0xebc5('0x4e')]},'raw':!![]})[_0xebc5('0x21')](function(_0x2400bc){if(_0x2400bc&&_0x2400bc['autoAssociation']===0x0){return db['UserProfileResource'][_0xebc5('0x47')]({'name':_0x369fad[_0xebc5('0x27')],'resourceId':_0x369fad['id'],'type':_0x2400bc[_0xebc5('0x27')],'sectionId':_0x2400bc['id']},{})[_0xebc5('0x21')](function(){return _0x37c1f5;});}else{return _0x37c1f5;}})[_0xebc5('0x42')](function(_0x257c4f){logger[_0xebc5('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x257c4f);throw _0x257c4f;});}return _0x37c1f5;});}})[_0xebc5('0x21')](respondWithResult(_0x2f9d7e,0xc9))['catch'](handleError(_0x2f9d7e,null));};exports[_0xebc5('0x58')]=function(_0x5b9b89,_0x455776){if(_0x5b9b89[_0xebc5('0x48')]['id']){delete _0x5b9b89[_0xebc5('0x48')]['id'];}return db[_0xebc5('0x2b')][_0xebc5('0x46')]({'where':{'id':_0x5b9b89[_0xebc5('0x44')]['id']}})[_0xebc5('0x21')](handleEntityNotFound(_0x455776,null))['then'](saveUpdates(_0x5b9b89[_0xebc5('0x48')],null))['then'](respondWithResult(_0x455776,null))['catch'](handleError(_0x455776,null));};exports[_0xebc5('0x22')]=function(_0x3fde32,_0x16ed66){return db[_0xebc5('0x2b')]['find']({'where':{'id':_0x3fde32[_0xebc5('0x44')]['id']}})['then'](handleEntityNotFound(_0x16ed66,null))[_0xebc5('0x21')](removeEntity(_0x16ed66,null))[_0xebc5('0x42')](handleError(_0x16ed66,null));};exports[_0xebc5('0x59')]=function(_0x1045ed,_0xaa81fe,_0x24b593){var _0x5ad9ca={'raw':!![],'where':{}};var _0x5bd876={};var _0x446431={'count':0x0,'rows':[]};return db[_0xebc5('0x2b')]['findOne']({'where':{'id':_0x1045ed[_0xebc5('0x44')]['id']}})[_0xebc5('0x21')](handleEntityNotFound(_0xaa81fe,null))[_0xebc5('0x21')](function(_0x539777){if(_0x539777){_0x5bd876[_0xebc5('0x30')]=_[_0xebc5('0x45')](db[_0xebc5('0x5a')][_0xebc5('0x2c')]);_0x5bd876['query']=_[_0xebc5('0x45')](_0x1045ed[_0xebc5('0x31')]);_0x5bd876[_0xebc5('0x3b')]=_[_0xebc5('0x32')](_0x5bd876['model'],_0x5bd876[_0xebc5('0x31')]);_0x5ad9ca[_0xebc5('0x34')]=_[_0xebc5('0x32')](_0x5bd876[_0xebc5('0x30')],qs[_0xebc5('0x33')](_0x1045ed['query']['fields']));_0x5ad9ca[_0xebc5('0x34')]=_0x5ad9ca[_0xebc5('0x34')][_0xebc5('0x52')]?_0x5ad9ca['attributes']:_0x5bd876[_0xebc5('0x30')];if(!_0x1045ed[_0xebc5('0x31')][_0xebc5('0x35')](_0xebc5('0x36'))){_0x5ad9ca[_0xebc5('0x1c')]=qs[_0xebc5('0x1c')](_0x1045ed[_0xebc5('0x31')][_0xebc5('0x1c')]);_0x5ad9ca[_0xebc5('0x37')]=qs[_0xebc5('0x37')](_0x1045ed[_0xebc5('0x31')][_0xebc5('0x37')]);}_0x5ad9ca[_0xebc5('0x38')]=qs[_0xebc5('0x39')](_0x1045ed[_0xebc5('0x31')][_0xebc5('0x39')]);_0x5ad9ca[_0xebc5('0x3a')]=qs[_0xebc5('0x3b')](_[_0xebc5('0x3c')](_0x1045ed[_0xebc5('0x31')],_0x5bd876['filters']));_0x5ad9ca[_0xebc5('0x3a')]['CampaignId']=_0x539777['id'];if(_0x1045ed[_0xebc5('0x31')]['filter']){_0x5ad9ca[_0xebc5('0x3a')]=_[_0xebc5('0x54')](_0x5ad9ca[_0xebc5('0x3a')],{'$or':_['map'](_0x5ad9ca[_0xebc5('0x34')],function(_0x22c5b1){var _0xd9d7cd={};_0xd9d7cd[_0x22c5b1]={'$like':'%'+_0x1045ed[_0xebc5('0x31')][_0xebc5('0x3d')]+'%'};return _0xd9d7cd;})});}_0x5ad9ca=_[_0xebc5('0x54')]({},_0x5ad9ca,_0x1045ed[_0xebc5('0x3e')]);return db[_0xebc5('0x5a')]['count']({'where':_0x5ad9ca['where']})[_0xebc5('0x21')](function(_0x312e74){_0x446431[_0xebc5('0x1d')]=_0x312e74;if(_0x1045ed[_0xebc5('0x31')][_0xebc5('0x3f')]){_0x5ad9ca[_0xebc5('0x53')]=[{'all':!![]}];}return db['CmHopper'][_0xebc5('0x40')](_0x5ad9ca);})['then'](function(_0x210c2e){_0x446431['rows']=_0x210c2e;return _0x446431;});}})[_0xebc5('0x21')](respondWithFilteredResult(_0xaa81fe,_0x5ad9ca))[_0xebc5('0x42')](handleError(_0xaa81fe,null));};exports[_0xebc5('0x5b')]=function(_0x489c71,_0x35cb37,_0x3f12a5){var _0x191376={'raw':!![],'where':{}};var _0x40cbd4={};var _0x44bbd6={'count':0x0,'rows':[]};return db[_0xebc5('0x2b')][_0xebc5('0x5c')]({'where':{'id':_0x489c71[_0xebc5('0x44')]['id']}})[_0xebc5('0x21')](handleEntityNotFound(_0x35cb37,null))['then'](function(_0x340692){if(_0x340692){_0x40cbd4[_0xebc5('0x30')]=_[_0xebc5('0x45')](db[_0xebc5('0x5d')][_0xebc5('0x2c')]);_0x40cbd4['query']=_[_0xebc5('0x45')](_0x489c71[_0xebc5('0x31')]);_0x40cbd4[_0xebc5('0x3b')]=_[_0xebc5('0x32')](_0x40cbd4[_0xebc5('0x30')],_0x40cbd4[_0xebc5('0x31')]);_0x191376[_0xebc5('0x34')]=_[_0xebc5('0x32')](_0x40cbd4[_0xebc5('0x30')],qs[_0xebc5('0x33')](_0x489c71[_0xebc5('0x31')][_0xebc5('0x33')]));_0x191376[_0xebc5('0x34')]=_0x191376['attributes']['length']?_0x191376[_0xebc5('0x34')]:_0x40cbd4['model'];if(!_0x489c71['query'][_0xebc5('0x35')](_0xebc5('0x36'))){_0x191376[_0xebc5('0x1c')]=qs['limit'](_0x489c71[_0xebc5('0x31')][_0xebc5('0x1c')]);_0x191376[_0xebc5('0x37')]=qs[_0xebc5('0x37')](_0x489c71[_0xebc5('0x31')][_0xebc5('0x37')]);}_0x191376[_0xebc5('0x38')]=qs[_0xebc5('0x39')](_0x489c71['query'][_0xebc5('0x39')]);_0x191376[_0xebc5('0x3a')]=qs['filters'](_[_0xebc5('0x3c')](_0x489c71['query'],_0x40cbd4[_0xebc5('0x3b')]));_0x191376[_0xebc5('0x3a')][_0xebc5('0x5e')]=_0x340692['id'];if(_0x489c71[_0xebc5('0x31')][_0xebc5('0x3d')]){_0x191376[_0xebc5('0x3a')]=_[_0xebc5('0x54')](_0x191376[_0xebc5('0x3a')],{'$or':_[_0xebc5('0x2a')](_0x191376[_0xebc5('0x34')],function(_0x2ba010){var _0x125536={};_0x125536[_0x2ba010]={'$like':'%'+_0x489c71[_0xebc5('0x31')][_0xebc5('0x3d')]+'%'};return _0x125536;})});}_0x191376=_[_0xebc5('0x54')]({},_0x191376,_0x489c71['options']);return db['CmHopperHistory'][_0xebc5('0x1d')]({'where':_0x191376[_0xebc5('0x3a')]})[_0xebc5('0x21')](function(_0x1b8346){_0x44bbd6[_0xebc5('0x1d')]=_0x1b8346;if(_0x489c71['query'][_0xebc5('0x3f')]){_0x191376['include']=[{'all':!![]}];}return db[_0xebc5('0x5d')]['findAll'](_0x191376);})['then'](function(_0x1f10f5){_0x44bbd6[_0xebc5('0x41')]=_0x1f10f5;return _0x44bbd6;});}})[_0xebc5('0x21')](respondWithFilteredResult(_0x35cb37,_0x191376))[_0xebc5('0x42')](handleError(_0x35cb37,null));};exports[_0xebc5('0x5f')]=function(_0x520d0a,_0x58c769,_0x2755c0){var _0x15dc05={'raw':!![],'where':{}};var _0x19cdf0={};var _0x3dabd3={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x520d0a[_0xebc5('0x44')]['id']}})[_0xebc5('0x21')](handleEntityNotFound(_0x58c769,null))[_0xebc5('0x21')](function(_0x32b7f7){if(_0x32b7f7){_0x19cdf0[_0xebc5('0x30')]=_[_0xebc5('0x45')](db[_0xebc5('0x60')][_0xebc5('0x2c')]);_0x19cdf0['query']=_[_0xebc5('0x45')](_0x520d0a[_0xebc5('0x31')]);_0x19cdf0[_0xebc5('0x3b')]=_['intersection'](_0x19cdf0[_0xebc5('0x30')],_0x19cdf0[_0xebc5('0x31')]);_0x15dc05[_0xebc5('0x34')]=_['intersection'](_0x19cdf0[_0xebc5('0x30')],qs[_0xebc5('0x33')](_0x520d0a[_0xebc5('0x31')]['fields']));_0x15dc05[_0xebc5('0x34')]=_0x15dc05[_0xebc5('0x34')][_0xebc5('0x52')]?_0x15dc05[_0xebc5('0x34')]:_0x19cdf0['model'];if(!_0x520d0a[_0xebc5('0x31')][_0xebc5('0x35')](_0xebc5('0x36'))){_0x15dc05[_0xebc5('0x1c')]=qs[_0xebc5('0x1c')](_0x520d0a[_0xebc5('0x31')][_0xebc5('0x1c')]);_0x15dc05[_0xebc5('0x37')]=qs['offset'](_0x520d0a[_0xebc5('0x31')]['offset']);}_0x15dc05['order']=qs[_0xebc5('0x39')](_0x520d0a[_0xebc5('0x31')]['sort']);_0x15dc05[_0xebc5('0x3a')]=qs[_0xebc5('0x3b')](_[_0xebc5('0x3c')](_0x520d0a[_0xebc5('0x31')],_0x19cdf0[_0xebc5('0x3b')]));_0x15dc05[_0xebc5('0x3a')][_0xebc5('0x5e')]=_0x32b7f7['id'];if(_0x520d0a['query'][_0xebc5('0x3d')]){_0x15dc05[_0xebc5('0x3a')]=_['merge'](_0x15dc05[_0xebc5('0x3a')],{'$or':_['map'](_0x15dc05[_0xebc5('0x34')],function(_0xaf8aaa){var _0xd7840c={};_0xd7840c[_0xaf8aaa]={'$like':'%'+_0x520d0a[_0xebc5('0x31')][_0xebc5('0x3d')]+'%'};return _0xd7840c;})});}_0x15dc05=_['merge']({},_0x15dc05,_0x520d0a[_0xebc5('0x3e')]);return db['CmHopperFinal'][_0xebc5('0x1d')]({'where':_0x15dc05[_0xebc5('0x3a')]})[_0xebc5('0x21')](function(_0x124749){_0x3dabd3[_0xebc5('0x1d')]=_0x124749;if(_0x520d0a[_0xebc5('0x31')][_0xebc5('0x3f')]){_0x15dc05[_0xebc5('0x53')]=[{'all':!![]}];}return db[_0xebc5('0x60')][_0xebc5('0x40')](_0x15dc05);})[_0xebc5('0x21')](function(_0x4f74c4){_0x3dabd3[_0xebc5('0x41')]=_0x4f74c4;return _0x3dabd3;});}})[_0xebc5('0x21')](respondWithFilteredResult(_0x58c769,_0x15dc05))[_0xebc5('0x42')](handleError(_0x58c769,null));};exports[_0xebc5('0x61')]=function(_0xb158c5,_0x461354,_0xe6b6f2){var _0x47f258={'raw':!![],'where':{}};var _0xbf1bca={};var _0x404401={'count':0x0,'rows':[]};return db[_0xebc5('0x2b')][_0xebc5('0x5c')]({'where':{'id':_0xb158c5[_0xebc5('0x44')]['id']}})[_0xebc5('0x21')](handleEntityNotFound(_0x461354,null))['then'](function(_0x2aa8bd){if(_0x2aa8bd){_0xbf1bca[_0xebc5('0x30')]=_[_0xebc5('0x45')](db[_0xebc5('0x62')][_0xebc5('0x2c')]);_0xbf1bca['query']=_[_0xebc5('0x45')](_0xb158c5['query']);_0xbf1bca[_0xebc5('0x3b')]=_['intersection'](_0xbf1bca[_0xebc5('0x30')],_0xbf1bca[_0xebc5('0x31')]);_0x47f258[_0xebc5('0x34')]=_[_0xebc5('0x32')](_0xbf1bca[_0xebc5('0x30')],qs[_0xebc5('0x33')](_0xb158c5['query'][_0xebc5('0x33')]));_0x47f258[_0xebc5('0x34')]=_0x47f258[_0xebc5('0x34')][_0xebc5('0x52')]?_0x47f258['attributes']:_0xbf1bca[_0xebc5('0x30')];if(!_0xb158c5[_0xebc5('0x31')][_0xebc5('0x35')](_0xebc5('0x36'))){_0x47f258[_0xebc5('0x1c')]=qs[_0xebc5('0x1c')](_0xb158c5['query'][_0xebc5('0x1c')]);_0x47f258[_0xebc5('0x37')]=qs[_0xebc5('0x37')](_0xb158c5[_0xebc5('0x31')][_0xebc5('0x37')]);}_0x47f258['order']=qs[_0xebc5('0x39')](_0xb158c5[_0xebc5('0x31')][_0xebc5('0x39')]);_0x47f258[_0xebc5('0x3a')]=qs[_0xebc5('0x3b')](_[_0xebc5('0x3c')](_0xb158c5[_0xebc5('0x31')],_0xbf1bca[_0xebc5('0x3b')]));_0x47f258['where'][_0xebc5('0x5e')]=_0x2aa8bd['id'];if(_0xb158c5[_0xebc5('0x31')][_0xebc5('0x3d')]){_0x47f258[_0xebc5('0x3a')]=_['merge'](_0x47f258[_0xebc5('0x3a')],{'$or':_['map'](_0x47f258[_0xebc5('0x34')],function(_0x140882){var _0x21d567={};_0x21d567[_0x140882]={'$like':'%'+_0xb158c5[_0xebc5('0x31')][_0xebc5('0x3d')]+'%'};return _0x21d567;})});}_0x47f258=_[_0xebc5('0x54')]({},_0x47f258,_0xb158c5[_0xebc5('0x3e')]);return db[_0xebc5('0x62')][_0xebc5('0x1d')]({'where':_0x47f258[_0xebc5('0x3a')]})[_0xebc5('0x21')](function(_0xddda9e){_0x404401[_0xebc5('0x1d')]=_0xddda9e;if(_0xb158c5['query'][_0xebc5('0x3f')]){_0x47f258[_0xebc5('0x53')]=[{'all':!![]}];}return db[_0xebc5('0x62')][_0xebc5('0x40')](_0x47f258);})[_0xebc5('0x21')](function(_0x406f51){_0x404401[_0xebc5('0x41')]=_0x406f51;return _0x404401;});}})[_0xebc5('0x21')](respondWithFilteredResult(_0x461354,_0x47f258))[_0xebc5('0x42')](handleError(_0x461354,null));};exports[_0xebc5('0x63')]=function(_0x4eca5f,_0x7d7580,_0x5c4438){var _0x4e61e8={};var _0xea1b61={};var _0x1bafa8;var _0x27e7d2;return db['Campaign'][_0xebc5('0x5c')]({'where':{'id':_0x4eca5f[_0xebc5('0x44')]['id']}})[_0xebc5('0x21')](handleEntityNotFound(_0x7d7580,null))[_0xebc5('0x21')](function(_0x987003){if(_0x987003){_0x1bafa8=_0x987003;_0xea1b61[_0xebc5('0x30')]=_[_0xebc5('0x45')](db['CmList'][_0xebc5('0x2c')]);_0xea1b61[_0xebc5('0x31')]=_['keys'](_0x4eca5f[_0xebc5('0x31')]);_0xea1b61['filters']=_[_0xebc5('0x32')](_0xea1b61['model'],_0xea1b61[_0xebc5('0x31')]);_0x4e61e8['attributes']=_[_0xebc5('0x32')](_0xea1b61[_0xebc5('0x30')],qs['fields'](_0x4eca5f[_0xebc5('0x31')][_0xebc5('0x33')]));_0x4e61e8[_0xebc5('0x34')]=_0x4e61e8[_0xebc5('0x34')]['length']?_0x4e61e8['attributes']:_0xea1b61[_0xebc5('0x30')];_0x4e61e8[_0xebc5('0x38')]=qs[_0xebc5('0x39')](_0x4eca5f['query'][_0xebc5('0x39')]);_0x4e61e8[_0xebc5('0x3a')]=qs['filters'](_[_0xebc5('0x3c')](_0x4eca5f['query'],_0xea1b61[_0xebc5('0x3b')]));if(_0x4eca5f[_0xebc5('0x31')][_0xebc5('0x3d')]){_0x4e61e8[_0xebc5('0x3a')]=_[_0xebc5('0x54')](_0x4e61e8[_0xebc5('0x3a')],{'$or':_[_0xebc5('0x2a')](_0x4e61e8[_0xebc5('0x34')],function(_0x89c32e){var _0x2b763a={};_0x2b763a[_0x89c32e]={'$like':'%'+_0x4eca5f[_0xebc5('0x31')]['filter']+'%'};return _0x2b763a;})});}_0x4e61e8=_[_0xebc5('0x54')]({},_0x4e61e8,_0x4eca5f['options']);return _0x1bafa8[_0xebc5('0x63')](_0x4e61e8);}})['then'](function(_0x51f7d9){if(_0x51f7d9){_0x27e7d2=_0x51f7d9['length'];if(!_0x4eca5f[_0xebc5('0x31')]['hasOwnProperty'](_0xebc5('0x36'))){_0x4e61e8[_0xebc5('0x1c')]=qs[_0xebc5('0x1c')](_0x4eca5f[_0xebc5('0x31')][_0xebc5('0x1c')]);_0x4e61e8['offset']=qs['offset'](_0x4eca5f[_0xebc5('0x31')]['offset']);}return _0x1bafa8['getLists'](_0x4e61e8);}})[_0xebc5('0x21')](function(_0x2ef453){if(_0x2ef453){return _0x2ef453?{'count':_0x27e7d2,'rows':_0x2ef453}:null;}})[_0xebc5('0x21')](respondWithResult(_0x7d7580,null))[_0xebc5('0x42')](handleError(_0x7d7580,null));};exports[_0xebc5('0x64')]=function(_0x25e1f6,_0x11faa5,_0x162861){var _0x3d20a8,_0x190ae7;var _0x4c0071=[];var _0x3a7c0d=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');return db[_0xebc5('0x2b')][_0xebc5('0x46')]({'where':{'id':_0x25e1f6[_0xebc5('0x44')]['id']}})['then'](handleEntityNotFound(_0x11faa5,null))['then'](function(_0x518b9d){if(_0x518b9d){_0x190ae7=_0x518b9d;return _0x518b9d[_0xebc5('0x64')](_0x25e1f6[_0xebc5('0x48')][_0xebc5('0x65')],_[_0xebc5('0x56')](_0x25e1f6['body'],[_0xebc5('0x65'),'id'])||{});}return null;})['spread'](function(_0x5f555e){var _0x5b0cb3;var _0x37af1a;_0x3d20a8=_0x5f555e||[];var _0xdd9934=[];if(_0x5f555e){for(var _0x23a30b=0x0;_0x23a30b<_0x5f555e[_0xebc5('0x52')];_0x23a30b+=0x1){var _0x4ebbbe=_0x5f555e[_0x23a30b]['get']({'plain':!![]});_0x190ae7[_0xebc5('0x66')]=_0x25e1f6[_0xebc5('0x48')][_0xebc5('0x66')]?_0x25e1f6[_0xebc5('0x48')]['dialCheckDuplicateType']:_0x190ae7['dialCheckDuplicateType'];switch(_0x190ae7[_0xebc5('0x66')]){case'always':_0x5b0cb3=squel['insert']()[_0xebc5('0x67')](_0xebc5('0x68'))[_0xebc5('0x69')]([_0xebc5('0x6a'),_0xebc5('0x6b'),'ContactId',_0xebc5('0x6c'),'CampaignId',_0xebc5('0x57'),_0xebc5('0x55')],squel[_0xebc5('0x6d')]()['field'](_0xebc5('0x6a'),'phone')['field']('NOW()',_0xebc5('0x6b'))[_0xebc5('0x6e')]('id',_0xebc5('0x6f'))[_0xebc5('0x6e')](_0x4ebbbe[_0xebc5('0x70')][_0xebc5('0x71')](),_0xebc5('0x6c'))[_0xebc5('0x6e')](_0x25e1f6[_0xebc5('0x44')]['id'][_0xebc5('0x71')](),_0xebc5('0x5e'))[_0xebc5('0x6e')]('\x27'+_0x3a7c0d+'\x27',_0xebc5('0x57'))[_0xebc5('0x6e')]('\x27'+_0x3a7c0d+'\x27',_0xebc5('0x55'))['from'](_0xebc5('0x72'))[_0xebc5('0x3a')](_0xebc5('0x73'))['where'](_0xebc5('0x74'),_0x4ebbbe['CmListId']['toString']())[_0xebc5('0x3a')](_0xebc5('0x75'))[_0xebc5('0x3a')]('phone\x20NOT\x20IN\x20(?)',squel[_0xebc5('0x6d')]()['field'](_0xebc5('0x76'))[_0xebc5('0x77')](_0xebc5('0x78'))[_0xebc5('0x3a')](_0xebc5('0x79'),_0x25e1f6[_0xebc5('0x44')]['id']['toString']()))[_0xebc5('0x3a')]('phone\x20NOT\x20IN\x20(?)',squel[_0xebc5('0x6d')]()[_0xebc5('0x6e')](_0xebc5('0x7a'))['from']('cm_hopper')[_0xebc5('0x3a')]('CampaignId\x20=\x20?',_0x25e1f6[_0xebc5('0x44')]['id'][_0xebc5('0x71')]())))[_0xebc5('0x71')]();break;case _0xebc5('0x7b'):_0x5b0cb3=squel[_0xebc5('0x7c')]()[_0xebc5('0x67')]('cm_hopper')[_0xebc5('0x69')]([_0xebc5('0x6a'),_0xebc5('0x6b'),'ContactId',_0xebc5('0x6c'),_0xebc5('0x5e'),'createdAt',_0xebc5('0x55')],squel['select']()[_0xebc5('0x6e')](_0xebc5('0x6a'),'phone')[_0xebc5('0x6e')](_0xebc5('0x7d'),_0xebc5('0x6b'))[_0xebc5('0x6e')]('id',_0xebc5('0x6f'))[_0xebc5('0x6e')](_0x4ebbbe[_0xebc5('0x70')]['toString'](),_0xebc5('0x6c'))[_0xebc5('0x6e')](_0x25e1f6[_0xebc5('0x44')]['id'][_0xebc5('0x71')](),_0xebc5('0x5e'))[_0xebc5('0x6e')]('\x27'+_0x3a7c0d+'\x27',_0xebc5('0x57'))[_0xebc5('0x6e')]('\x27'+_0x3a7c0d+'\x27',_0xebc5('0x55'))[_0xebc5('0x77')]('cm_contacts')[_0xebc5('0x3a')](_0xebc5('0x73'))[_0xebc5('0x3a')](_0xebc5('0x74'),_0x4ebbbe['CmListId'][_0xebc5('0x71')]())[_0xebc5('0x3a')](_0xebc5('0x75'))[_0xebc5('0x3a')](_0xebc5('0x7e'),squel[_0xebc5('0x6d')]()[_0xebc5('0x6e')]('COALESCE(phone,\x27\x27)')[_0xebc5('0x77')](_0xebc5('0x68'))['where'](_0xebc5('0x79'),_0x25e1f6['params']['id'][_0xebc5('0x71')]())))[_0xebc5('0x71')]();break;default:_0x5b0cb3=squel[_0xebc5('0x7c')]()[_0xebc5('0x67')](_0xebc5('0x68'))[_0xebc5('0x69')]([_0xebc5('0x6a'),_0xebc5('0x6b'),_0xebc5('0x6f'),_0xebc5('0x6c'),_0xebc5('0x5e'),_0xebc5('0x57'),_0xebc5('0x55')],squel[_0xebc5('0x6d')]()[_0xebc5('0x6e')](_0xebc5('0x6a'),_0xebc5('0x6a'))[_0xebc5('0x6e')]('NOW()',_0xebc5('0x6b'))['field']('id','ContactId')[_0xebc5('0x6e')](_0x4ebbbe['CmListId']['toString'](),'ListId')[_0xebc5('0x6e')](_0x25e1f6[_0xebc5('0x44')]['id'][_0xebc5('0x71')](),'CampaignId')[_0xebc5('0x6e')]('\x27'+_0x3a7c0d+'\x27','createdAt')['field']('\x27'+_0x3a7c0d+'\x27',_0xebc5('0x55'))['from'](_0xebc5('0x72'))['where'](_0xebc5('0x73'))[_0xebc5('0x3a')](_0xebc5('0x74'),_0x4ebbbe[_0xebc5('0x70')][_0xebc5('0x71')]())[_0xebc5('0x3a')](_0xebc5('0x75')))['toString']();}_0x37af1a=squel['insert']()[_0xebc5('0x67')](_0xebc5('0x7f'))[_0xebc5('0x69')](['cmHopperId',_0xebc5('0x6b'),_0xebc5('0x6a'),_0xebc5('0x80'),'createdAt',_0xebc5('0x55')],squel[_0xebc5('0x6d')]()[_0xebc5('0x6e')](_0xebc5('0x81'),'id')['field'](_0xebc5('0x7d'),_0xebc5('0x6b'))['field'](_0xebc5('0x82'),_0xebc5('0x6a'))[_0xebc5('0x6e')]('ci.OrderBY',_0xebc5('0x80'))['field']('\x27'+_0x3a7c0d+'\x27',_0xebc5('0x57'))[_0xebc5('0x6e')]('\x27'+_0x3a7c0d+'\x27','updatedAt')[_0xebc5('0x77')]('cm_contact_has_items','ci')[_0xebc5('0x83')](_0xebc5('0x68'),'h',_0xebc5('0x84'))[_0xebc5('0x3a')](_0xebc5('0x85'),_0x4ebbbe[_0xebc5('0x70')]['toString']())[_0xebc5('0x3a')](_0xebc5('0x86'),_0x25e1f6[_0xebc5('0x44')]['id'][_0xebc5('0x71')]())['where'](_0xebc5('0x87'),_0x3a7c0d))[_0xebc5('0x71')]();_0xdd9934[_0xebc5('0x88')](db[_0xebc5('0x89')][_0xebc5('0x31')](_0x5b0cb3));_0x4c0071[_0xebc5('0x88')](db['sequelize'][_0xebc5('0x31')](_0x37af1a));}return BPromise[_0xebc5('0x8a')](_0xdd9934);}})[_0xebc5('0x21')](function(){return BPromise['all'](_0x4c0071);})[_0xebc5('0x21')](function(){return _0x3d20a8;})[_0xebc5('0x21')](respondWithResult(_0x11faa5,null))[_0xebc5('0x42')](handleError(_0x11faa5,null));};exports[_0xebc5('0x8b')]=function(_0x261921,_0x576ede,_0x3f32ec){return db[_0xebc5('0x2b')][_0xebc5('0x46')]({'where':{'id':_0x261921['params']['id']}})[_0xebc5('0x21')](handleEntityNotFound(_0x576ede,null))['then'](function(_0x5be550){if(_0x5be550){return _0x5be550[_0xebc5('0x8b')](_0x261921[_0xebc5('0x31')][_0xebc5('0x65')]);}})['then'](function(_0x508c87){if(_0x508c87){return db[_0xebc5('0x5a')][_0xebc5('0x22')]({'where':{'ListId':_0x261921[_0xebc5('0x31')][_0xebc5('0x65')],'CampaignId':_0x261921['params']['id']}})['then'](function(){return _0x508c87;});}})['then'](respondWithStatusCode(_0x576ede,null))[_0xebc5('0x42')](handleError(_0x576ede,null));};exports[_0xebc5('0x8c')]=function(_0x2d5050,_0x3bef86,_0x10d8a4){var _0x3f9d3b={};var _0x265d87={};var _0x35754a;var _0x4e4566;return db[_0xebc5('0x2b')][_0xebc5('0x5c')]({'where':{'id':_0x2d5050[_0xebc5('0x44')]['id']}})[_0xebc5('0x21')](handleEntityNotFound(_0x3bef86,null))[_0xebc5('0x21')](function(_0x16833d){if(_0x16833d){_0x35754a=_0x16833d;_0x265d87[_0xebc5('0x30')]=_['keys'](db['CmList'][_0xebc5('0x2c')]);_0x265d87[_0xebc5('0x31')]=_['keys'](_0x2d5050[_0xebc5('0x31')]);_0x265d87[_0xebc5('0x3b')]=_[_0xebc5('0x32')](_0x265d87[_0xebc5('0x30')],_0x265d87[_0xebc5('0x31')]);_0x3f9d3b[_0xebc5('0x34')]=_[_0xebc5('0x32')](_0x265d87[_0xebc5('0x30')],qs[_0xebc5('0x33')](_0x2d5050[_0xebc5('0x31')][_0xebc5('0x33')]));_0x3f9d3b[_0xebc5('0x34')]=_0x3f9d3b[_0xebc5('0x34')][_0xebc5('0x52')]?_0x3f9d3b[_0xebc5('0x34')]:_0x265d87[_0xebc5('0x30')];_0x3f9d3b[_0xebc5('0x38')]=qs[_0xebc5('0x39')](_0x2d5050[_0xebc5('0x31')]['sort']);_0x3f9d3b['where']=qs[_0xebc5('0x3b')](_['pick'](_0x2d5050[_0xebc5('0x31')],_0x265d87[_0xebc5('0x3b')]));if(_0x2d5050[_0xebc5('0x31')][_0xebc5('0x3d')]){_0x3f9d3b[_0xebc5('0x3a')]=_[_0xebc5('0x54')](_0x3f9d3b[_0xebc5('0x3a')],{'$or':_['map'](_0x3f9d3b[_0xebc5('0x34')],function(_0x279afe){var _0x3a0e72={};_0x3a0e72[_0x279afe]={'$like':'%'+_0x2d5050[_0xebc5('0x31')]['filter']+'%'};return _0x3a0e72;})});}_0x3f9d3b=_[_0xebc5('0x54')]({},_0x3f9d3b,_0x2d5050['options']);return _0x35754a[_0xebc5('0x8c')](_0x3f9d3b);}})[_0xebc5('0x21')](function(_0x30d0a4){if(_0x30d0a4){_0x4e4566=_0x30d0a4[_0xebc5('0x52')];if(!_0x2d5050[_0xebc5('0x31')]['hasOwnProperty']('nolimit')){_0x3f9d3b[_0xebc5('0x1c')]=qs[_0xebc5('0x1c')](_0x2d5050[_0xebc5('0x31')]['limit']);_0x3f9d3b[_0xebc5('0x37')]=qs['offset'](_0x2d5050[_0xebc5('0x31')][_0xebc5('0x37')]);}return _0x35754a[_0xebc5('0x8c')](_0x3f9d3b);}})[_0xebc5('0x21')](function(_0x239824){if(_0x239824){return _0x239824?{'count':_0x4e4566,'rows':_0x239824}:null;}})[_0xebc5('0x21')](respondWithResult(_0x3bef86,null))[_0xebc5('0x42')](handleError(_0x3bef86,null));};exports[_0xebc5('0x8d')]=function(_0x5c3ea2,_0x449e52,_0x2ec2e8){var _0x27cb8d,_0x3a24cf;var _0x5db25d=[];var _0x4791f3=moment()[_0xebc5('0x8e')](_0xebc5('0x8f'));return db[_0xebc5('0x2b')]['find']({'where':{'id':_0x5c3ea2[_0xebc5('0x44')]['id']}})[_0xebc5('0x21')](handleEntityNotFound(_0x449e52,null))[_0xebc5('0x21')](function(_0x331f10){if(_0x331f10){_0x3a24cf=_0x331f10;return _0x331f10['addBlackLists'](_0x5c3ea2['body']['ids'],_[_0xebc5('0x56')](_0x5c3ea2['body'],[_0xebc5('0x65'),'id'])||{});}return null;})[_0xebc5('0x90')](function(_0x2d93b7){var _0x41a87e;var _0x556f16;_0x27cb8d=_0x2d93b7||[];var _0x2e5278=[];if(_0x2d93b7){for(var _0x24bb90=0x0;_0x24bb90<_0x2d93b7[_0xebc5('0x52')];_0x24bb90+=0x1){var _0x5c7c05=_0x2d93b7[_0x24bb90][_0xebc5('0x23')]({'plain':!![]});_0x41a87e=squel['insert']()[_0xebc5('0x67')](_0xebc5('0x91'))['fromQuery']([_0xebc5('0x6a'),_0xebc5('0x6f'),_0xebc5('0x6c'),'CampaignId',_0xebc5('0x57'),_0xebc5('0x55')],squel[_0xebc5('0x6d')]()[_0xebc5('0x6e')](_0xebc5('0x6a'),'phone')[_0xebc5('0x6e')]('id',_0xebc5('0x6f'))[_0xebc5('0x6e')](_0x5c7c05[_0xebc5('0x70')][_0xebc5('0x71')](),_0xebc5('0x6c'))['field'](_0x5c3ea2[_0xebc5('0x44')]['id'][_0xebc5('0x71')](),'CampaignId')[_0xebc5('0x6e')]('NOW()',_0xebc5('0x57'))['field']('NOW()',_0xebc5('0x55'))['from']('cm_contacts')['where'](_0xebc5('0x73'))[_0xebc5('0x3a')](_0xebc5('0x74'),_0x5c7c05[_0xebc5('0x70')]['toString']())[_0xebc5('0x3a')](_0xebc5('0x75')))[_0xebc5('0x71')]();_0x2e5278['push'](db[_0xebc5('0x89')][_0xebc5('0x31')](_0x41a87e));}return BPromise[_0xebc5('0x8a')](_0x2e5278);}})[_0xebc5('0x21')](function(){return _0x27cb8d;})['then'](respondWithResult(_0x449e52,null))[_0xebc5('0x42')](handleError(_0x449e52,null));};exports['removeBlackLists']=function(_0x4faa15,_0x260fa8,_0x62c7bc){return db[_0xebc5('0x2b')][_0xebc5('0x46')]({'where':{'id':_0x4faa15[_0xebc5('0x44')]['id']}})[_0xebc5('0x21')](handleEntityNotFound(_0x260fa8,null))[_0xebc5('0x21')](function(_0x3d2f8b){if(_0x3d2f8b){return _0x3d2f8b[_0xebc5('0x92')](_0x4faa15[_0xebc5('0x31')][_0xebc5('0x65')]);}})[_0xebc5('0x21')](function(_0x200531){if(_0x200531){return db['CmHopperBlack'][_0xebc5('0x22')]({'where':{'ListId':_0x4faa15[_0xebc5('0x31')][_0xebc5('0x65')],'CampaignId':_0x4faa15[_0xebc5('0x44')]['id']}})[_0xebc5('0x21')](function(){return _0x200531;});}})[_0xebc5('0x21')](respondWithStatusCode(_0x260fa8,null))[_0xebc5('0x42')](handleError(_0x260fa8,null));}; \ No newline at end of file +var _0x1226=['sequelize','all','removeLists','getBlackLists','format','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','UserProfileResource','then','stack','name','send','index','map','Campaign','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','type','filter','merge','options','rows','catch','show','params','include','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','IvrCampaigns','userProfileId','autoAssociation','error','includeAll','omit','createdAt','updatedAt','body','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','CmHopper','CampaignId','findAll','getHopperHistories','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','insert','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','into','cm_hopper_additional_phones','OrderBy','h.id','ci.item','ci.OrderBY','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','push'];(function(_0x78d78d,_0x4e73f0){var _0x14e121=function(_0x1f80a1){while(--_0x1f80a1){_0x78d78d['push'](_0x78d78d['shift']());}};_0x14e121(++_0x4e73f0);}(_0x1226,0x1c1));var _0x6122=function(_0x4ca057,_0x4ef66c){_0x4ca057=_0x4ca057-0x0;var _0x378bb5=_0x1226[_0x4ca057];return _0x378bb5;};'use strict';var emlformat=require(_0x6122('0x0'));var rimraf=require(_0x6122('0x1'));var zipdir=require(_0x6122('0x2'));var jsonpatch=require(_0x6122('0x3'));var rp=require(_0x6122('0x4'));var moment=require(_0x6122('0x5'));var BPromise=require(_0x6122('0x6'));var Mustache=require(_0x6122('0x7'));var util=require(_0x6122('0x8'));var path=require('path');var sox=require(_0x6122('0x9'));var csv=require(_0x6122('0xa'));var ejs=require(_0x6122('0xb'));var fs=require('fs');var fs_extra=require(_0x6122('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x6122('0xd'));var jsforce=require(_0x6122('0xe'));var deskjs=require(_0x6122('0xf'));var toCsv=require(_0x6122('0xa'));var querystring=require(_0x6122('0x10'));var Papa=require(_0x6122('0x11'));var Redis=require(_0x6122('0x12'));var authService=require(_0x6122('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x6122('0x14'));var hardwareService=require(_0x6122('0x15'));var logger=require('../../config/logger')(_0x6122('0x16'));var utils=require(_0x6122('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x6122('0x18'));var db=require(_0x6122('0x19'))['db'];function respondWithStatusCode(_0x3738a4,_0x10eea1){_0x10eea1=_0x10eea1||0xcc;return function(_0x2e0a31){if(_0x2e0a31){return _0x3738a4[_0x6122('0x1a')](_0x10eea1);}return _0x3738a4['status'](_0x10eea1)[_0x6122('0x1b')]();};}function respondWithResult(_0x24116e,_0x9a39cd){_0x9a39cd=_0x9a39cd||0xc8;return function(_0x320b46){if(_0x320b46){return _0x24116e[_0x6122('0x1c')](_0x9a39cd)['json'](_0x320b46);}};}function respondWithFilteredResult(_0x2023d1,_0x4cd8fb){return function(_0x5d9678){if(_0x5d9678){var _0x7dd3fe=typeof _0x4cd8fb[_0x6122('0x1d')]===_0x6122('0x1e')&&typeof _0x4cd8fb[_0x6122('0x1f')]===_0x6122('0x1e');var _0x15f72c=_0x5d9678[_0x6122('0x20')];var _0x15ee1d=_0x7dd3fe?0x0:_0x4cd8fb['offset'];var _0xcfd359=_0x7dd3fe?_0x5d9678[_0x6122('0x20')]:_0x4cd8fb['offset']+_0x4cd8fb[_0x6122('0x1f')];var _0x2a5908;if(_0xcfd359>=_0x15f72c){_0xcfd359=_0x15f72c;_0x2a5908=0xc8;}else{_0x2a5908=0xce;}_0x2023d1[_0x6122('0x1c')](_0x2a5908);return _0x2023d1[_0x6122('0x21')](_0x6122('0x22'),_0x15ee1d+'-'+_0xcfd359+'/'+_0x15f72c)['json'](_0x5d9678);}return null;};}function patchUpdates(_0x3f6cd2){return function(_0x5bd8ff){try{jsonpatch[_0x6122('0x23')](_0x5bd8ff,_0x3f6cd2,!![]);}catch(_0x29de92){return BPromise[_0x6122('0x24')](_0x29de92);}return _0x5bd8ff[_0x6122('0x25')]();};}function saveUpdates(_0x25aff5,_0x194357){return function(_0x2980e8){if(_0x2980e8){return _0x2980e8[_0x6122('0x26')](_0x25aff5)['then'](function(_0x2c9967){return _0x2c9967;});}return null;};}function removeEntity(_0x558bc0,_0x7de029){return function(_0x3a3efa){if(_0x3a3efa){return _0x3a3efa[_0x6122('0x27')]()['then'](function(){var _0x4ea2fb=_0x3a3efa['get']({'plain':!![]});var _0x12df5a='IvrCampaigns';return db[_0x6122('0x28')][_0x6122('0x27')]({'where':{'type':_0x12df5a,'resourceId':_0x4ea2fb['id']}})[_0x6122('0x29')](function(){return _0x3a3efa;});})['then'](function(){_0x558bc0[_0x6122('0x1c')](0xcc)[_0x6122('0x1b')]();});}};}function handleEntityNotFound(_0x472411,_0x5660af){return function(_0x503843){if(!_0x503843){_0x472411[_0x6122('0x1a')](0x194);}return _0x503843;};}function handleError(_0x5ee15a,_0x19487c){_0x19487c=_0x19487c||0x1f4;return function(_0x549c0e){logger['error'](_0x549c0e[_0x6122('0x2a')]);if(_0x549c0e[_0x6122('0x2b')]){delete _0x549c0e[_0x6122('0x2b')];}_0x5ee15a[_0x6122('0x1c')](_0x19487c)[_0x6122('0x2c')](_0x549c0e);};}exports[_0x6122('0x2d')]=function(_0x45b1df,_0x128135){var _0x16fcbd={},_0x540fff={},_0x5ba87e={'count':0x0,'rows':[]};var _0x3cc864=_[_0x6122('0x2e')](db[_0x6122('0x2f')][_0x6122('0x30')],function(_0x341d62){return{'name':_0x341d62['fieldName'],'type':_0x341d62['type'][_0x6122('0x31')]};});_0x540fff[_0x6122('0x32')]=_[_0x6122('0x2e')](_0x3cc864,_0x6122('0x2b'));_0x540fff[_0x6122('0x33')]=_[_0x6122('0x34')](_0x45b1df['query']);_0x540fff[_0x6122('0x35')]=_[_0x6122('0x36')](_0x540fff[_0x6122('0x32')],_0x540fff[_0x6122('0x33')]);_0x16fcbd[_0x6122('0x37')]=_['intersection'](_0x540fff[_0x6122('0x32')],qs[_0x6122('0x38')](_0x45b1df[_0x6122('0x33')][_0x6122('0x38')]));_0x16fcbd[_0x6122('0x37')]=_0x16fcbd['attributes'][_0x6122('0x39')]?_0x16fcbd[_0x6122('0x37')]:_0x540fff[_0x6122('0x32')];if(!_0x45b1df[_0x6122('0x33')][_0x6122('0x3a')](_0x6122('0x3b'))){_0x16fcbd[_0x6122('0x1f')]=qs[_0x6122('0x1f')](_0x45b1df[_0x6122('0x33')]['limit']);_0x16fcbd[_0x6122('0x1d')]=qs[_0x6122('0x1d')](_0x45b1df[_0x6122('0x33')][_0x6122('0x1d')]);}_0x16fcbd[_0x6122('0x3c')]=qs['sort'](_0x45b1df[_0x6122('0x33')][_0x6122('0x3d')]);_0x16fcbd[_0x6122('0x3e')]=qs['filters'](_[_0x6122('0x3f')](_0x45b1df[_0x6122('0x33')],_0x540fff[_0x6122('0x35')]),_0x3cc864);if(_0x45b1df['query']['filter']){_0x16fcbd[_0x6122('0x3e')]=_['merge'](_0x16fcbd[_0x6122('0x3e')],{'$or':_[_0x6122('0x2e')](_0x3cc864,function(_0x52f1ec){if(_0x52f1ec[_0x6122('0x40')]!=='VIRTUAL'){var _0x520753={};_0x520753[_0x52f1ec[_0x6122('0x2b')]]={'$like':'%'+_0x45b1df['query'][_0x6122('0x41')]+'%'};return _0x520753;}})});}_0x16fcbd=_[_0x6122('0x42')]({},_0x16fcbd,_0x45b1df[_0x6122('0x43')]);var _0x5055d8={'where':_0x16fcbd[_0x6122('0x3e')]};return db['Campaign'][_0x6122('0x20')](_0x5055d8)['then'](function(_0x3b2ad3){_0x5ba87e[_0x6122('0x20')]=_0x3b2ad3;if(_0x45b1df[_0x6122('0x33')]['includeAll']){_0x16fcbd['include']=[{'all':!![]}];}return db[_0x6122('0x2f')]['findAll'](_0x16fcbd);})[_0x6122('0x29')](function(_0x5463e4){_0x5ba87e[_0x6122('0x44')]=_0x5463e4;return _0x5ba87e;})[_0x6122('0x29')](respondWithFilteredResult(_0x128135,_0x16fcbd))[_0x6122('0x45')](handleError(_0x128135,null));};exports[_0x6122('0x46')]=function(_0x23422b,_0x39f0b9){var _0x4e3aff={'raw':![],'where':{'id':_0x23422b[_0x6122('0x47')]['id']}},_0x1f2d10={};_0x1f2d10['model']=_[_0x6122('0x34')](db[_0x6122('0x2f')][_0x6122('0x30')]);_0x1f2d10[_0x6122('0x33')]=_['keys'](_0x23422b[_0x6122('0x33')]);_0x1f2d10[_0x6122('0x35')]=_[_0x6122('0x36')](_0x1f2d10['model'],_0x1f2d10[_0x6122('0x33')]);_0x4e3aff['attributes']=_[_0x6122('0x36')](_0x1f2d10['model'],qs[_0x6122('0x38')](_0x23422b['query'][_0x6122('0x38')]));_0x4e3aff[_0x6122('0x37')]=_0x4e3aff[_0x6122('0x37')]['length']?_0x4e3aff[_0x6122('0x37')]:_0x1f2d10[_0x6122('0x32')];if(_0x23422b['query']['includeAll']){_0x4e3aff[_0x6122('0x48')]=[{'all':!![]}];}_0x4e3aff=_[_0x6122('0x42')]({},_0x4e3aff,_0x23422b['options']);return db[_0x6122('0x2f')][_0x6122('0x49')](_0x4e3aff)[_0x6122('0x29')](handleEntityNotFound(_0x39f0b9,null))[_0x6122('0x29')](respondWithResult(_0x39f0b9,null))[_0x6122('0x45')](handleError(_0x39f0b9,null));};exports[_0x6122('0x4a')]=function(_0x46907a,_0x21ae83){return db[_0x6122('0x2f')][_0x6122('0x4a')](_0x46907a['body'],{})[_0x6122('0x29')](function(_0x563da1){var _0x5d773b=_0x46907a[_0x6122('0x4b')][_0x6122('0x4c')]({'plain':!![]});if(!_0x5d773b)throw new Error(_0x6122('0x4d'));if(_0x5d773b['role']===_0x6122('0x4b')){var _0x319675=_0x563da1[_0x6122('0x4c')]({'plain':!![]});var _0x1b5258=_0x6122('0x4e');return db['UserProfileSection'][_0x6122('0x49')]({'where':{'name':_0x1b5258,'userProfileId':_0x5d773b[_0x6122('0x4f')]},'raw':!![]})[_0x6122('0x29')](function(_0x537525){if(_0x537525&&_0x537525[_0x6122('0x50')]===0x0){return db[_0x6122('0x28')][_0x6122('0x4a')]({'name':_0x319675['name'],'resourceId':_0x319675['id'],'type':_0x537525[_0x6122('0x2b')],'sectionId':_0x537525['id']},{})[_0x6122('0x29')](function(){return _0x563da1;});}else{return _0x563da1;}})['catch'](function(_0x371b74){logger[_0x6122('0x51')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x371b74);throw _0x371b74;});}return _0x563da1;})['then'](respondWithResult(_0x21ae83,0xc9))['catch'](handleError(_0x21ae83,null));};exports['clone']=function(_0x366b51,_0x4c99c3){var _0x578ff3={'where':{'id':_0x366b51[_0x6122('0x47')]['id']}},_0x5c7ca6={};_0x5c7ca6[_0x6122('0x32')]=_[_0x6122('0x34')](db[_0x6122('0x2f')][_0x6122('0x30')]);_0x578ff3['attributes']=_['intersection'](_0x5c7ca6[_0x6122('0x32')],qs[_0x6122('0x38')](_0x366b51[_0x6122('0x33')][_0x6122('0x38')]));_0x578ff3[_0x6122('0x37')]=_0x578ff3['attributes'][_0x6122('0x39')]?_0x578ff3['attributes']:_0x5c7ca6['model'];if(_0x366b51['query'][_0x6122('0x52')]){_0x578ff3[_0x6122('0x48')]=[{'all':!![]}];}_0x578ff3=_[_0x6122('0x42')]({},_0x578ff3,_0x366b51[_0x6122('0x43')]);return db[_0x6122('0x2f')][_0x6122('0x49')](_0x578ff3)['then'](handleEntityNotFound(_0x4c99c3,null))['then'](function(_0x112fd4){if(_0x112fd4){var _0x5290be=_0x112fd4[_0x6122('0x4c')]({'plain':!![]});_0x5290be=qs[_0x6122('0x53')](_0x5290be,['id',_0x6122('0x54'),_0x6122('0x55')]);_0x366b51[_0x6122('0x56')]=_[_0x6122('0x53')](_0x366b51[_0x6122('0x56')],['id',_0x6122('0x54'),_0x6122('0x55')]);return db[_0x6122('0x2f')][_0x6122('0x4a')](_[_0x6122('0x42')](_0x5290be,_0x366b51[_0x6122('0x56')]),{'include':_0x366b51[_0x6122('0x33')][_0x6122('0x52')]?[{'all':!![]}]:undefined})[_0x6122('0x29')](function(_0xeffe8d){var _0x5d05f7=_0x366b51[_0x6122('0x4b')][_0x6122('0x4c')]({'plain':!![]});if(!_0x5d05f7)throw new Error(_0x6122('0x4d'));if(_0x5d05f7['role']==='user'){var _0x1bee71=_0xeffe8d[_0x6122('0x4c')]({'plain':!![]});var _0x244168=_0x6122('0x4e');return db[_0x6122('0x57')][_0x6122('0x49')]({'where':{'name':_0x244168,'userProfileId':_0x5d05f7['userProfileId']},'raw':!![]})[_0x6122('0x29')](function(_0x41fb3f){if(_0x41fb3f&&_0x41fb3f[_0x6122('0x50')]===0x0){return db[_0x6122('0x28')][_0x6122('0x4a')]({'name':_0x1bee71[_0x6122('0x2b')],'resourceId':_0x1bee71['id'],'type':_0x41fb3f[_0x6122('0x2b')],'sectionId':_0x41fb3f['id']},{})['then'](function(){return _0xeffe8d;});}else{return _0xeffe8d;}})[_0x6122('0x45')](function(_0x569e4a){logger[_0x6122('0x51')](_0x6122('0x58'),_0x569e4a);throw _0x569e4a;});}return _0xeffe8d;});}})[_0x6122('0x29')](respondWithResult(_0x4c99c3,0xc9))[_0x6122('0x45')](handleError(_0x4c99c3,null));};exports[_0x6122('0x26')]=function(_0x4dd9f8,_0x1c7c13){if(_0x4dd9f8[_0x6122('0x56')]['id']){delete _0x4dd9f8[_0x6122('0x56')]['id'];}return db[_0x6122('0x2f')]['find']({'where':{'id':_0x4dd9f8[_0x6122('0x47')]['id']}})['then'](handleEntityNotFound(_0x1c7c13,null))[_0x6122('0x29')](saveUpdates(_0x4dd9f8[_0x6122('0x56')],null))[_0x6122('0x29')](respondWithResult(_0x1c7c13,null))[_0x6122('0x45')](handleError(_0x1c7c13,null));};exports[_0x6122('0x27')]=function(_0x5a17d6,_0x1a71ea){return db[_0x6122('0x2f')][_0x6122('0x49')]({'where':{'id':_0x5a17d6['params']['id']}})[_0x6122('0x29')](handleEntityNotFound(_0x1a71ea,null))[_0x6122('0x29')](removeEntity(_0x1a71ea,null))[_0x6122('0x45')](handleError(_0x1a71ea,null));};exports['getHoppers']=function(_0x24ffea,_0x71a8f2,_0x45fd5c){var _0x1b5b81={'raw':!![],'where':{}};var _0x459a3b={};var _0x43700d={'count':0x0,'rows':[]};return db[_0x6122('0x2f')]['findOne']({'where':{'id':_0x24ffea['params']['id']}})['then'](handleEntityNotFound(_0x71a8f2,null))[_0x6122('0x29')](function(_0x5e101e){if(_0x5e101e){_0x459a3b[_0x6122('0x32')]=_[_0x6122('0x34')](db[_0x6122('0x59')][_0x6122('0x30')]);_0x459a3b[_0x6122('0x33')]=_[_0x6122('0x34')](_0x24ffea[_0x6122('0x33')]);_0x459a3b[_0x6122('0x35')]=_[_0x6122('0x36')](_0x459a3b[_0x6122('0x32')],_0x459a3b[_0x6122('0x33')]);_0x1b5b81['attributes']=_[_0x6122('0x36')](_0x459a3b['model'],qs[_0x6122('0x38')](_0x24ffea[_0x6122('0x33')][_0x6122('0x38')]));_0x1b5b81[_0x6122('0x37')]=_0x1b5b81['attributes'][_0x6122('0x39')]?_0x1b5b81[_0x6122('0x37')]:_0x459a3b['model'];if(!_0x24ffea[_0x6122('0x33')][_0x6122('0x3a')]('nolimit')){_0x1b5b81[_0x6122('0x1f')]=qs['limit'](_0x24ffea['query'][_0x6122('0x1f')]);_0x1b5b81[_0x6122('0x1d')]=qs['offset'](_0x24ffea['query'][_0x6122('0x1d')]);}_0x1b5b81[_0x6122('0x3c')]=qs[_0x6122('0x3d')](_0x24ffea[_0x6122('0x33')][_0x6122('0x3d')]);_0x1b5b81[_0x6122('0x3e')]=qs[_0x6122('0x35')](_['pick'](_0x24ffea[_0x6122('0x33')],_0x459a3b[_0x6122('0x35')]));_0x1b5b81[_0x6122('0x3e')][_0x6122('0x5a')]=_0x5e101e['id'];if(_0x24ffea['query'][_0x6122('0x41')]){_0x1b5b81[_0x6122('0x3e')]=_[_0x6122('0x42')](_0x1b5b81['where'],{'$or':_[_0x6122('0x2e')](_0x1b5b81[_0x6122('0x37')],function(_0x46b6db){var _0x34e102={};_0x34e102[_0x46b6db]={'$like':'%'+_0x24ffea[_0x6122('0x33')][_0x6122('0x41')]+'%'};return _0x34e102;})});}_0x1b5b81=_[_0x6122('0x42')]({},_0x1b5b81,_0x24ffea[_0x6122('0x43')]);return db[_0x6122('0x59')]['count']({'where':_0x1b5b81[_0x6122('0x3e')]})[_0x6122('0x29')](function(_0x45809b){_0x43700d['count']=_0x45809b;if(_0x24ffea[_0x6122('0x33')][_0x6122('0x52')]){_0x1b5b81[_0x6122('0x48')]=[{'all':!![]}];}return db[_0x6122('0x59')][_0x6122('0x5b')](_0x1b5b81);})[_0x6122('0x29')](function(_0x255221){_0x43700d[_0x6122('0x44')]=_0x255221;return _0x43700d;});}})[_0x6122('0x29')](respondWithFilteredResult(_0x71a8f2,_0x1b5b81))[_0x6122('0x45')](handleError(_0x71a8f2,null));};exports[_0x6122('0x5c')]=function(_0x2cae5f,_0x5e03de,_0x534ece){var _0xf00aee={'raw':!![],'where':{}};var _0x14ce13={};var _0x218d1e={'count':0x0,'rows':[]};return db[_0x6122('0x2f')][_0x6122('0x5d')]({'where':{'id':_0x2cae5f[_0x6122('0x47')]['id']}})[_0x6122('0x29')](handleEntityNotFound(_0x5e03de,null))[_0x6122('0x29')](function(_0x38cfcf){if(_0x38cfcf){_0x14ce13[_0x6122('0x32')]=_[_0x6122('0x34')](db['CmHopperHistory'][_0x6122('0x30')]);_0x14ce13[_0x6122('0x33')]=_[_0x6122('0x34')](_0x2cae5f[_0x6122('0x33')]);_0x14ce13[_0x6122('0x35')]=_[_0x6122('0x36')](_0x14ce13[_0x6122('0x32')],_0x14ce13[_0x6122('0x33')]);_0xf00aee['attributes']=_['intersection'](_0x14ce13[_0x6122('0x32')],qs[_0x6122('0x38')](_0x2cae5f[_0x6122('0x33')]['fields']));_0xf00aee['attributes']=_0xf00aee['attributes'][_0x6122('0x39')]?_0xf00aee[_0x6122('0x37')]:_0x14ce13[_0x6122('0x32')];if(!_0x2cae5f[_0x6122('0x33')][_0x6122('0x3a')](_0x6122('0x3b'))){_0xf00aee['limit']=qs[_0x6122('0x1f')](_0x2cae5f['query'][_0x6122('0x1f')]);_0xf00aee[_0x6122('0x1d')]=qs[_0x6122('0x1d')](_0x2cae5f['query'][_0x6122('0x1d')]);}_0xf00aee[_0x6122('0x3c')]=qs['sort'](_0x2cae5f[_0x6122('0x33')]['sort']);_0xf00aee[_0x6122('0x3e')]=qs[_0x6122('0x35')](_[_0x6122('0x3f')](_0x2cae5f[_0x6122('0x33')],_0x14ce13[_0x6122('0x35')]));_0xf00aee[_0x6122('0x3e')]['CampaignId']=_0x38cfcf['id'];if(_0x2cae5f[_0x6122('0x33')][_0x6122('0x41')]){_0xf00aee[_0x6122('0x3e')]=_[_0x6122('0x42')](_0xf00aee[_0x6122('0x3e')],{'$or':_[_0x6122('0x2e')](_0xf00aee[_0x6122('0x37')],function(_0x35519d){var _0x4a0739={};_0x4a0739[_0x35519d]={'$like':'%'+_0x2cae5f['query'][_0x6122('0x41')]+'%'};return _0x4a0739;})});}_0xf00aee=_[_0x6122('0x42')]({},_0xf00aee,_0x2cae5f[_0x6122('0x43')]);return db[_0x6122('0x5e')][_0x6122('0x20')]({'where':_0xf00aee[_0x6122('0x3e')]})['then'](function(_0x1b15c1){_0x218d1e['count']=_0x1b15c1;if(_0x2cae5f[_0x6122('0x33')]['includeAll']){_0xf00aee[_0x6122('0x48')]=[{'all':!![]}];}return db[_0x6122('0x5e')][_0x6122('0x5b')](_0xf00aee);})[_0x6122('0x29')](function(_0x565841){_0x218d1e[_0x6122('0x44')]=_0x565841;return _0x218d1e;});}})[_0x6122('0x29')](respondWithFilteredResult(_0x5e03de,_0xf00aee))[_0x6122('0x45')](handleError(_0x5e03de,null));};exports[_0x6122('0x5f')]=function(_0x5571ef,_0xc3abed,_0x590104){var _0x114fa4={'raw':!![],'where':{}};var _0x109902={};var _0x19c43c={'count':0x0,'rows':[]};return db[_0x6122('0x2f')][_0x6122('0x5d')]({'where':{'id':_0x5571ef[_0x6122('0x47')]['id']}})['then'](handleEntityNotFound(_0xc3abed,null))[_0x6122('0x29')](function(_0x7092e2){if(_0x7092e2){_0x109902[_0x6122('0x32')]=_[_0x6122('0x34')](db[_0x6122('0x60')][_0x6122('0x30')]);_0x109902[_0x6122('0x33')]=_[_0x6122('0x34')](_0x5571ef[_0x6122('0x33')]);_0x109902['filters']=_[_0x6122('0x36')](_0x109902['model'],_0x109902[_0x6122('0x33')]);_0x114fa4[_0x6122('0x37')]=_[_0x6122('0x36')](_0x109902[_0x6122('0x32')],qs[_0x6122('0x38')](_0x5571ef[_0x6122('0x33')][_0x6122('0x38')]));_0x114fa4[_0x6122('0x37')]=_0x114fa4[_0x6122('0x37')]['length']?_0x114fa4[_0x6122('0x37')]:_0x109902[_0x6122('0x32')];if(!_0x5571ef['query'][_0x6122('0x3a')](_0x6122('0x3b'))){_0x114fa4[_0x6122('0x1f')]=qs[_0x6122('0x1f')](_0x5571ef[_0x6122('0x33')]['limit']);_0x114fa4[_0x6122('0x1d')]=qs[_0x6122('0x1d')](_0x5571ef[_0x6122('0x33')][_0x6122('0x1d')]);}_0x114fa4['order']=qs[_0x6122('0x3d')](_0x5571ef[_0x6122('0x33')][_0x6122('0x3d')]);_0x114fa4[_0x6122('0x3e')]=qs['filters'](_[_0x6122('0x3f')](_0x5571ef[_0x6122('0x33')],_0x109902[_0x6122('0x35')]));_0x114fa4[_0x6122('0x3e')]['CampaignId']=_0x7092e2['id'];if(_0x5571ef['query'][_0x6122('0x41')]){_0x114fa4[_0x6122('0x3e')]=_[_0x6122('0x42')](_0x114fa4[_0x6122('0x3e')],{'$or':_[_0x6122('0x2e')](_0x114fa4[_0x6122('0x37')],function(_0x48bb32){var _0x526a14={};_0x526a14[_0x48bb32]={'$like':'%'+_0x5571ef[_0x6122('0x33')][_0x6122('0x41')]+'%'};return _0x526a14;})});}_0x114fa4=_[_0x6122('0x42')]({},_0x114fa4,_0x5571ef[_0x6122('0x43')]);return db[_0x6122('0x60')][_0x6122('0x20')]({'where':_0x114fa4['where']})[_0x6122('0x29')](function(_0x593d7c){_0x19c43c['count']=_0x593d7c;if(_0x5571ef[_0x6122('0x33')][_0x6122('0x52')]){_0x114fa4[_0x6122('0x48')]=[{'all':!![]}];}return db[_0x6122('0x60')][_0x6122('0x5b')](_0x114fa4);})['then'](function(_0x5dc304){_0x19c43c[_0x6122('0x44')]=_0x5dc304;return _0x19c43c;});}})['then'](respondWithFilteredResult(_0xc3abed,_0x114fa4))[_0x6122('0x45')](handleError(_0xc3abed,null));};exports['getHopperBlacks']=function(_0x29c346,_0x4bd4a5,_0x1f300e){var _0x52f9db={'raw':!![],'where':{}};var _0xa9d4e0={};var _0x3d18d2={'count':0x0,'rows':[]};return db[_0x6122('0x2f')][_0x6122('0x5d')]({'where':{'id':_0x29c346[_0x6122('0x47')]['id']}})['then'](handleEntityNotFound(_0x4bd4a5,null))[_0x6122('0x29')](function(_0x233bc5){if(_0x233bc5){_0xa9d4e0[_0x6122('0x32')]=_[_0x6122('0x34')](db[_0x6122('0x61')][_0x6122('0x30')]);_0xa9d4e0[_0x6122('0x33')]=_['keys'](_0x29c346[_0x6122('0x33')]);_0xa9d4e0[_0x6122('0x35')]=_[_0x6122('0x36')](_0xa9d4e0[_0x6122('0x32')],_0xa9d4e0[_0x6122('0x33')]);_0x52f9db[_0x6122('0x37')]=_[_0x6122('0x36')](_0xa9d4e0[_0x6122('0x32')],qs[_0x6122('0x38')](_0x29c346['query'][_0x6122('0x38')]));_0x52f9db[_0x6122('0x37')]=_0x52f9db[_0x6122('0x37')][_0x6122('0x39')]?_0x52f9db[_0x6122('0x37')]:_0xa9d4e0['model'];if(!_0x29c346[_0x6122('0x33')]['hasOwnProperty'](_0x6122('0x3b'))){_0x52f9db['limit']=qs['limit'](_0x29c346[_0x6122('0x33')][_0x6122('0x1f')]);_0x52f9db[_0x6122('0x1d')]=qs[_0x6122('0x1d')](_0x29c346['query'][_0x6122('0x1d')]);}_0x52f9db[_0x6122('0x3c')]=qs['sort'](_0x29c346['query'][_0x6122('0x3d')]);_0x52f9db[_0x6122('0x3e')]=qs[_0x6122('0x35')](_[_0x6122('0x3f')](_0x29c346[_0x6122('0x33')],_0xa9d4e0[_0x6122('0x35')]));_0x52f9db[_0x6122('0x3e')]['CampaignId']=_0x233bc5['id'];if(_0x29c346[_0x6122('0x33')][_0x6122('0x41')]){_0x52f9db[_0x6122('0x3e')]=_[_0x6122('0x42')](_0x52f9db[_0x6122('0x3e')],{'$or':_[_0x6122('0x2e')](_0x52f9db[_0x6122('0x37')],function(_0x1a800b){var _0x2cf82f={};_0x2cf82f[_0x1a800b]={'$like':'%'+_0x29c346[_0x6122('0x33')][_0x6122('0x41')]+'%'};return _0x2cf82f;})});}_0x52f9db=_['merge']({},_0x52f9db,_0x29c346[_0x6122('0x43')]);return db['CmHopperBlack']['count']({'where':_0x52f9db['where']})[_0x6122('0x29')](function(_0x50ad73){_0x3d18d2[_0x6122('0x20')]=_0x50ad73;if(_0x29c346[_0x6122('0x33')][_0x6122('0x52')]){_0x52f9db[_0x6122('0x48')]=[{'all':!![]}];}return db[_0x6122('0x61')][_0x6122('0x5b')](_0x52f9db);})[_0x6122('0x29')](function(_0x20663b){_0x3d18d2[_0x6122('0x44')]=_0x20663b;return _0x3d18d2;});}})[_0x6122('0x29')](respondWithFilteredResult(_0x4bd4a5,_0x52f9db))[_0x6122('0x45')](handleError(_0x4bd4a5,null));};exports[_0x6122('0x62')]=function(_0x168686,_0x4ca6b1,_0x5e5b6b){var _0x3193ba={};var _0x1d6836={};var _0x421a58;var _0x548499;return db[_0x6122('0x2f')][_0x6122('0x5d')]({'where':{'id':_0x168686[_0x6122('0x47')]['id']}})[_0x6122('0x29')](handleEntityNotFound(_0x4ca6b1,null))[_0x6122('0x29')](function(_0xcc995){if(_0xcc995){_0x421a58=_0xcc995;_0x1d6836['model']=_['keys'](db[_0x6122('0x63')][_0x6122('0x30')]);_0x1d6836['query']=_[_0x6122('0x34')](_0x168686[_0x6122('0x33')]);_0x1d6836[_0x6122('0x35')]=_[_0x6122('0x36')](_0x1d6836[_0x6122('0x32')],_0x1d6836[_0x6122('0x33')]);_0x3193ba[_0x6122('0x37')]=_['intersection'](_0x1d6836[_0x6122('0x32')],qs['fields'](_0x168686[_0x6122('0x33')][_0x6122('0x38')]));_0x3193ba[_0x6122('0x37')]=_0x3193ba[_0x6122('0x37')][_0x6122('0x39')]?_0x3193ba['attributes']:_0x1d6836[_0x6122('0x32')];_0x3193ba[_0x6122('0x3c')]=qs[_0x6122('0x3d')](_0x168686[_0x6122('0x33')][_0x6122('0x3d')]);_0x3193ba['where']=qs[_0x6122('0x35')](_[_0x6122('0x3f')](_0x168686[_0x6122('0x33')],_0x1d6836[_0x6122('0x35')]));if(_0x168686[_0x6122('0x33')][_0x6122('0x41')]){_0x3193ba[_0x6122('0x3e')]=_[_0x6122('0x42')](_0x3193ba[_0x6122('0x3e')],{'$or':_['map'](_0x3193ba['attributes'],function(_0x19116d){var _0x30d4c1={};_0x30d4c1[_0x19116d]={'$like':'%'+_0x168686[_0x6122('0x33')][_0x6122('0x41')]+'%'};return _0x30d4c1;})});}_0x3193ba=_[_0x6122('0x42')]({},_0x3193ba,_0x168686[_0x6122('0x43')]);return _0x421a58[_0x6122('0x62')](_0x3193ba);}})[_0x6122('0x29')](function(_0x4f83e4){if(_0x4f83e4){_0x548499=_0x4f83e4[_0x6122('0x39')];if(!_0x168686[_0x6122('0x33')][_0x6122('0x3a')](_0x6122('0x3b'))){_0x3193ba[_0x6122('0x1f')]=qs[_0x6122('0x1f')](_0x168686[_0x6122('0x33')][_0x6122('0x1f')]);_0x3193ba[_0x6122('0x1d')]=qs[_0x6122('0x1d')](_0x168686[_0x6122('0x33')][_0x6122('0x1d')]);}return _0x421a58[_0x6122('0x62')](_0x3193ba);}})['then'](function(_0x5b330d){if(_0x5b330d){return _0x5b330d?{'count':_0x548499,'rows':_0x5b330d}:null;}})[_0x6122('0x29')](respondWithResult(_0x4ca6b1,null))[_0x6122('0x45')](handleError(_0x4ca6b1,null));};exports[_0x6122('0x64')]=function(_0x5f112d,_0x3d1c66,_0x592f67){var _0x4c26e7,_0x1825bf;var _0x36bae2=[];var _0x9233d1=moment()['format'](_0x6122('0x65'));return db[_0x6122('0x2f')][_0x6122('0x49')]({'where':{'id':_0x5f112d[_0x6122('0x47')]['id']}})[_0x6122('0x29')](handleEntityNotFound(_0x3d1c66,null))[_0x6122('0x29')](function(_0x362796){if(_0x362796){_0x1825bf=_0x362796;return _0x362796[_0x6122('0x64')](_0x5f112d[_0x6122('0x56')][_0x6122('0x66')],_[_0x6122('0x53')](_0x5f112d[_0x6122('0x56')],[_0x6122('0x66'),'id'])||{});}return null;})[_0x6122('0x67')](function(_0x15487a){var _0x242fc0;var _0x483638;_0x4c26e7=_0x15487a||[];var _0x2faa3c=[];if(_0x15487a){for(var _0x2404da=0x0;_0x2404da<_0x15487a[_0x6122('0x39')];_0x2404da+=0x1){var _0x45ccef=_0x15487a[_0x2404da][_0x6122('0x4c')]({'plain':!![]});_0x1825bf[_0x6122('0x68')]=_0x5f112d['body'][_0x6122('0x68')]?_0x5f112d[_0x6122('0x56')][_0x6122('0x68')]:_0x1825bf[_0x6122('0x68')];switch(_0x1825bf[_0x6122('0x68')]){case'always':_0x242fc0=squel[_0x6122('0x69')]()['into'](_0x6122('0x6a'))[_0x6122('0x6b')]([_0x6122('0x6c'),_0x6122('0x6d'),_0x6122('0x6e'),_0x6122('0x6f'),_0x6122('0x5a'),_0x6122('0x54'),_0x6122('0x55')],squel[_0x6122('0x70')]()[_0x6122('0x71')]('phone',_0x6122('0x6c'))[_0x6122('0x71')](_0x6122('0x72'),_0x6122('0x6d'))[_0x6122('0x71')]('id','ContactId')['field'](_0x45ccef[_0x6122('0x73')]['toString'](),_0x6122('0x6f'))[_0x6122('0x71')](_0x5f112d[_0x6122('0x47')]['id'][_0x6122('0x74')](),'CampaignId')['field']('\x27'+_0x9233d1+'\x27','createdAt')[_0x6122('0x71')]('\x27'+_0x9233d1+'\x27','updatedAt')[_0x6122('0x75')](_0x6122('0x76'))['where'](_0x6122('0x77'))['where'](_0x6122('0x78'),_0x45ccef[_0x6122('0x73')][_0x6122('0x74')]())['where'](_0x6122('0x79'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x6122('0x70')]()[_0x6122('0x71')](_0x6122('0x7a'))[_0x6122('0x75')](_0x6122('0x7b'))[_0x6122('0x3e')](_0x6122('0x7c'),_0x5f112d['params']['id'][_0x6122('0x74')]()))['where'](_0x6122('0x7d'),squel['select']()[_0x6122('0x71')](_0x6122('0x7e'))[_0x6122('0x75')]('cm_hopper')[_0x6122('0x3e')](_0x6122('0x7c'),_0x5f112d[_0x6122('0x47')]['id'][_0x6122('0x74')]())))['toString']();break;case _0x6122('0x7f'):_0x242fc0=squel[_0x6122('0x69')]()[_0x6122('0x80')](_0x6122('0x6a'))['fromQuery'](['phone',_0x6122('0x6d'),_0x6122('0x6e'),_0x6122('0x6f'),'CampaignId',_0x6122('0x54'),_0x6122('0x55')],squel[_0x6122('0x70')]()[_0x6122('0x71')](_0x6122('0x6c'),_0x6122('0x6c'))['field']('NOW()',_0x6122('0x6d'))[_0x6122('0x71')]('id','ContactId')[_0x6122('0x71')](_0x45ccef['CmListId'][_0x6122('0x74')](),'ListId')['field'](_0x5f112d['params']['id'][_0x6122('0x74')](),'CampaignId')[_0x6122('0x71')]('\x27'+_0x9233d1+'\x27','createdAt')[_0x6122('0x71')]('\x27'+_0x9233d1+'\x27',_0x6122('0x55'))['from'](_0x6122('0x76'))[_0x6122('0x3e')](_0x6122('0x77'))[_0x6122('0x3e')](_0x6122('0x78'),_0x45ccef['CmListId'][_0x6122('0x74')]())['where'](_0x6122('0x79'))[_0x6122('0x3e')]('phone\x20NOT\x20IN\x20(?)',squel[_0x6122('0x70')]()[_0x6122('0x71')]('COALESCE(phone,\x27\x27)')[_0x6122('0x75')]('cm_hopper')[_0x6122('0x3e')](_0x6122('0x7c'),_0x5f112d[_0x6122('0x47')]['id'][_0x6122('0x74')]())))['toString']();break;default:_0x242fc0=squel[_0x6122('0x69')]()['into']('cm_hopper')['fromQuery']([_0x6122('0x6c'),'scheduledAt',_0x6122('0x6e'),_0x6122('0x6f'),_0x6122('0x5a'),_0x6122('0x54'),_0x6122('0x55')],squel['select']()['field'](_0x6122('0x6c'),_0x6122('0x6c'))[_0x6122('0x71')]('NOW()',_0x6122('0x6d'))[_0x6122('0x71')]('id',_0x6122('0x6e'))[_0x6122('0x71')](_0x45ccef[_0x6122('0x73')][_0x6122('0x74')](),_0x6122('0x6f'))[_0x6122('0x71')](_0x5f112d[_0x6122('0x47')]['id'][_0x6122('0x74')](),_0x6122('0x5a'))[_0x6122('0x71')]('\x27'+_0x9233d1+'\x27',_0x6122('0x54'))['field']('\x27'+_0x9233d1+'\x27',_0x6122('0x55'))[_0x6122('0x75')](_0x6122('0x76'))[_0x6122('0x3e')](_0x6122('0x77'))[_0x6122('0x3e')](_0x6122('0x78'),_0x45ccef[_0x6122('0x73')][_0x6122('0x74')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0x6122('0x74')]();}_0x483638=squel['insert']()[_0x6122('0x80')](_0x6122('0x81'))['fromQuery'](['cmHopperId',_0x6122('0x6d'),'phone',_0x6122('0x82'),'createdAt','updatedAt'],squel['select']()[_0x6122('0x71')](_0x6122('0x83'),'id')[_0x6122('0x71')](_0x6122('0x72'),'scheduledAt')[_0x6122('0x71')](_0x6122('0x84'),_0x6122('0x6c'))[_0x6122('0x71')](_0x6122('0x85'),_0x6122('0x82'))[_0x6122('0x71')]('\x27'+_0x9233d1+'\x27',_0x6122('0x54'))[_0x6122('0x71')]('\x27'+_0x9233d1+'\x27','updatedAt')['from'](_0x6122('0x86'),'ci')[_0x6122('0x87')](_0x6122('0x6a'),'h',_0x6122('0x88'))[_0x6122('0x3e')](_0x6122('0x89'),_0x45ccef[_0x6122('0x73')][_0x6122('0x74')]())[_0x6122('0x3e')]('h.CampaignId=?',_0x5f112d['params']['id'][_0x6122('0x74')]())[_0x6122('0x3e')]('h.createdAt\x20=\x20?',_0x9233d1))[_0x6122('0x74')]();_0x2faa3c[_0x6122('0x8a')](db[_0x6122('0x8b')][_0x6122('0x33')](_0x242fc0));_0x36bae2[_0x6122('0x8a')](db[_0x6122('0x8b')]['query'](_0x483638));}return BPromise[_0x6122('0x8c')](_0x2faa3c);}})[_0x6122('0x29')](function(){return BPromise[_0x6122('0x8c')](_0x36bae2);})[_0x6122('0x29')](function(){return _0x4c26e7;})['then'](respondWithResult(_0x3d1c66,null))[_0x6122('0x45')](handleError(_0x3d1c66,null));};exports[_0x6122('0x8d')]=function(_0x5c34e2,_0x220598,_0x124494){return db[_0x6122('0x2f')][_0x6122('0x49')]({'where':{'id':_0x5c34e2['params']['id']}})[_0x6122('0x29')](handleEntityNotFound(_0x220598,null))[_0x6122('0x29')](function(_0x40bf20){if(_0x40bf20){return _0x40bf20[_0x6122('0x8d')](_0x5c34e2[_0x6122('0x33')]['ids']);}})[_0x6122('0x29')](function(_0x586340){if(_0x586340){return db[_0x6122('0x59')][_0x6122('0x27')]({'where':{'ListId':_0x5c34e2['query'][_0x6122('0x66')],'CampaignId':_0x5c34e2[_0x6122('0x47')]['id']}})['then'](function(){return _0x586340;});}})[_0x6122('0x29')](respondWithStatusCode(_0x220598,null))[_0x6122('0x45')](handleError(_0x220598,null));};exports[_0x6122('0x8e')]=function(_0x4e6715,_0x184c5e,_0x4c408a){var _0x29c532={};var _0x54b0a2={};var _0x39a7f7;var _0x5c4646;return db['Campaign'][_0x6122('0x5d')]({'where':{'id':_0x4e6715[_0x6122('0x47')]['id']}})['then'](handleEntityNotFound(_0x184c5e,null))[_0x6122('0x29')](function(_0x32ef98){if(_0x32ef98){_0x39a7f7=_0x32ef98;_0x54b0a2['model']=_[_0x6122('0x34')](db[_0x6122('0x63')][_0x6122('0x30')]);_0x54b0a2[_0x6122('0x33')]=_[_0x6122('0x34')](_0x4e6715['query']);_0x54b0a2[_0x6122('0x35')]=_['intersection'](_0x54b0a2['model'],_0x54b0a2[_0x6122('0x33')]);_0x29c532[_0x6122('0x37')]=_[_0x6122('0x36')](_0x54b0a2[_0x6122('0x32')],qs[_0x6122('0x38')](_0x4e6715[_0x6122('0x33')][_0x6122('0x38')]));_0x29c532['attributes']=_0x29c532['attributes']['length']?_0x29c532['attributes']:_0x54b0a2[_0x6122('0x32')];_0x29c532[_0x6122('0x3c')]=qs['sort'](_0x4e6715[_0x6122('0x33')][_0x6122('0x3d')]);_0x29c532[_0x6122('0x3e')]=qs[_0x6122('0x35')](_[_0x6122('0x3f')](_0x4e6715[_0x6122('0x33')],_0x54b0a2[_0x6122('0x35')]));if(_0x4e6715[_0x6122('0x33')]['filter']){_0x29c532[_0x6122('0x3e')]=_['merge'](_0x29c532[_0x6122('0x3e')],{'$or':_[_0x6122('0x2e')](_0x29c532[_0x6122('0x37')],function(_0x281740){var _0x2f09c3={};_0x2f09c3[_0x281740]={'$like':'%'+_0x4e6715[_0x6122('0x33')]['filter']+'%'};return _0x2f09c3;})});}_0x29c532=_[_0x6122('0x42')]({},_0x29c532,_0x4e6715[_0x6122('0x43')]);return _0x39a7f7[_0x6122('0x8e')](_0x29c532);}})['then'](function(_0x1fccdf){if(_0x1fccdf){_0x5c4646=_0x1fccdf['length'];if(!_0x4e6715[_0x6122('0x33')]['hasOwnProperty']('nolimit')){_0x29c532['limit']=qs['limit'](_0x4e6715[_0x6122('0x33')][_0x6122('0x1f')]);_0x29c532[_0x6122('0x1d')]=qs[_0x6122('0x1d')](_0x4e6715[_0x6122('0x33')][_0x6122('0x1d')]);}return _0x39a7f7[_0x6122('0x8e')](_0x29c532);}})['then'](function(_0x45a3b5){if(_0x45a3b5){return _0x45a3b5?{'count':_0x5c4646,'rows':_0x45a3b5}:null;}})[_0x6122('0x29')](respondWithResult(_0x184c5e,null))[_0x6122('0x45')](handleError(_0x184c5e,null));};exports['addBlackLists']=function(_0x1b0357,_0x451bf7,_0x12cd3a){var _0x58390e,_0xf4ea04;var _0x3be502=[];var _0x4f92c5=moment()[_0x6122('0x8f')](_0x6122('0x65'));return db[_0x6122('0x2f')][_0x6122('0x49')]({'where':{'id':_0x1b0357[_0x6122('0x47')]['id']}})[_0x6122('0x29')](handleEntityNotFound(_0x451bf7,null))['then'](function(_0x127836){if(_0x127836){_0xf4ea04=_0x127836;return _0x127836[_0x6122('0x90')](_0x1b0357[_0x6122('0x56')][_0x6122('0x66')],_[_0x6122('0x53')](_0x1b0357['body'],[_0x6122('0x66'),'id'])||{});}return null;})[_0x6122('0x67')](function(_0x3ddade){var _0x4c8e9c;var _0x45edc7;_0x58390e=_0x3ddade||[];var _0x1d465c=[];if(_0x3ddade){for(var _0x2ef407=0x0;_0x2ef407<_0x3ddade[_0x6122('0x39')];_0x2ef407+=0x1){var _0x5d05bb=_0x3ddade[_0x2ef407][_0x6122('0x4c')]({'plain':!![]});_0x4c8e9c=squel['insert']()['into'](_0x6122('0x91'))['fromQuery']([_0x6122('0x6c'),'ContactId','ListId',_0x6122('0x5a'),_0x6122('0x54'),_0x6122('0x55')],squel[_0x6122('0x70')]()[_0x6122('0x71')]('phone',_0x6122('0x6c'))['field']('id',_0x6122('0x6e'))['field'](_0x5d05bb[_0x6122('0x73')][_0x6122('0x74')](),'ListId')[_0x6122('0x71')](_0x1b0357[_0x6122('0x47')]['id'][_0x6122('0x74')](),_0x6122('0x5a'))[_0x6122('0x71')](_0x6122('0x72'),'createdAt')[_0x6122('0x71')](_0x6122('0x72'),_0x6122('0x55'))[_0x6122('0x75')]('cm_contacts')[_0x6122('0x3e')](_0x6122('0x77'))[_0x6122('0x3e')](_0x6122('0x78'),_0x5d05bb[_0x6122('0x73')][_0x6122('0x74')]())[_0x6122('0x3e')](_0x6122('0x79')))[_0x6122('0x74')]();_0x1d465c['push'](db[_0x6122('0x8b')][_0x6122('0x33')](_0x4c8e9c));}return BPromise[_0x6122('0x8c')](_0x1d465c);}})['then'](function(){return _0x58390e;})[_0x6122('0x29')](respondWithResult(_0x451bf7,null))['catch'](handleError(_0x451bf7,null));};exports[_0x6122('0x92')]=function(_0x1a7cbf,_0x487590,_0x3f5322){return db[_0x6122('0x2f')][_0x6122('0x49')]({'where':{'id':_0x1a7cbf[_0x6122('0x47')]['id']}})[_0x6122('0x29')](handleEntityNotFound(_0x487590,null))[_0x6122('0x29')](function(_0x4beb96){if(_0x4beb96){return _0x4beb96[_0x6122('0x92')](_0x1a7cbf['query'][_0x6122('0x66')]);}})[_0x6122('0x29')](function(_0x156d9b){if(_0x156d9b){return db[_0x6122('0x61')][_0x6122('0x27')]({'where':{'ListId':_0x1a7cbf[_0x6122('0x33')][_0x6122('0x66')],'CampaignId':_0x1a7cbf['params']['id']}})[_0x6122('0x29')](function(){return _0x156d9b;});}})[_0x6122('0x29')](respondWithStatusCode(_0x487590,null))[_0x6122('0x45')](handleError(_0x487590,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index e689345..a458427 100644 --- a/server/api/campaign/campaign.model.js +++ b/server/api/campaign/campaign.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x41229c,_0x32fc89){var _0x1ce6c7=function(_0x9f4b40){while(--_0x9f4b40){_0x41229c['push'](_0x41229c['shift']());}};_0x1ce6c7(++_0x32fc89);}(_0x7a54,0x106));var _0x47a5=function(_0x56c2b6,_0x1b7a71){_0x56c2b6=_0x56c2b6-0x0;var _0x15dfb7=_0x7a54[_0x56c2b6];return _0x15dfb7;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x55eb57,_0x1011e2){var _0x55ca29=function(_0xad5a1d){while(--_0xad5a1d){_0x55eb57['push'](_0x55eb57['shift']());}};_0x55ca29(++_0x1011e2);}(_0x7a54,0x106));var _0x47a5=function(_0x391582,_0x49efa7){_0x391582=_0x391582-0x0;var _0x8f3d97=_0x7a54[_0x391582];return _0x8f3d97;};'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 bd95814..6b4058c 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 _0x2209=['Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetCampaign','findAll','raw','options','where','attributes','limit','include','model','map','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Campaign,\x20%s,\x20%s','request\x20sent'];(function(_0x112ebd,_0x533fea){var _0x27e060=function(_0x578906){while(--_0x578906){_0x112ebd['push'](_0x112ebd['shift']());}};_0x27e060(++_0x533fea);}(_0x2209,0x95));var _0x9220=function(_0x31a819,_0x4e92b0){_0x31a819=_0x31a819-0x0;var _0x1f3a09=_0x2209[_0x31a819];return _0x1f3a09;};'use strict';var _=require(_0x9220('0x0'));var util=require(_0x9220('0x1'));var moment=require(_0x9220('0x2'));var BPromise=require(_0x9220('0x3'));var rs=require(_0x9220('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9220('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9220('0x6'))(_0x9220('0x7'));var config=require(_0x9220('0x8'));var jayson=require(_0x9220('0x9'));var client=jayson[_0x9220('0xa')][_0x9220('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x463d59,_0x243ea6,_0x1081b9){return new BPromise(function(_0x58e7f5,_0x21d055){return client[_0x9220('0xc')](_0x463d59,_0x1081b9)['then'](function(_0x242b73){logger[_0x9220('0xd')](_0x9220('0xe'),_0x243ea6,_0x9220('0xf'));logger['debug'](_0x9220('0x10'),_0x243ea6,_0x9220('0xf'),JSON[_0x9220('0x11')](_0x242b73));if(_0x242b73[_0x9220('0x12')]){if(_0x242b73[_0x9220('0x12')][_0x9220('0x13')]===0x1f4){logger[_0x9220('0x12')](_0x9220('0xe'),_0x243ea6,_0x242b73['error'][_0x9220('0x14')]);return _0x21d055(_0x242b73['error'][_0x9220('0x14')]);}logger['error'](_0x9220('0xe'),_0x243ea6,_0x242b73['error'][_0x9220('0x14')]);return _0x58e7f5(_0x242b73[_0x9220('0x12')][_0x9220('0x14')]);}else{logger[_0x9220('0xd')]('Campaign,\x20%s,\x20%s',_0x243ea6,_0x9220('0xf'));_0x58e7f5(_0x242b73[_0x9220('0x15')]['message']);}})['catch'](function(_0x3c3473){logger['error'](_0x9220('0xe'),_0x243ea6,_0x3c3473);_0x21d055(_0x3c3473);});});}exports[_0x9220('0x16')]=function(_0x44713f){var _0x56e0c8=this;return new Promise(function(_0x4a9507,_0x3dbfeb){return db['Campaign'][_0x9220('0x17')]({'raw':_0x44713f['options']?_0x44713f['options'][_0x9220('0x18')]===undefined?!![]:![]:!![],'where':_0x44713f[_0x9220('0x19')]?_0x44713f[_0x9220('0x19')][_0x9220('0x1a')]||null:null,'attributes':_0x44713f[_0x9220('0x19')]?_0x44713f[_0x9220('0x19')][_0x9220('0x1b')]||null:null,'limit':_0x44713f[_0x9220('0x19')]?_0x44713f[_0x9220('0x19')][_0x9220('0x1c')]||null:null,'include':_0x44713f[_0x9220('0x19')]?_0x44713f[_0x9220('0x19')][_0x9220('0x1d')]?_['map'](_0x44713f[_0x9220('0x19')][_0x9220('0x1d')],function(_0x48ee62){return{'model':db[_0x48ee62[_0x9220('0x1e')]],'as':_0x48ee62['as'],'attributes':_0x48ee62['attributes'],'include':_0x48ee62[_0x9220('0x1d')]?_[_0x9220('0x1f')](_0x48ee62[_0x9220('0x1d')],function(_0x284ed7){return{'model':db[_0x284ed7[_0x9220('0x1e')]],'as':_0x284ed7['as'],'attributes':_0x284ed7[_0x9220('0x1b')],'include':_0x284ed7['include']?_[_0x9220('0x1f')](_0x284ed7[_0x9220('0x1d')],function(_0x41769c){return{'model':db[_0x41769c[_0x9220('0x1e')]],'as':_0x41769c['as'],'attributes':_0x41769c['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x330268){logger[_0x9220('0xd')](_0x9220('0x16'),_0x44713f);logger['debug']('GetCampaign',_0x44713f,JSON[_0x9220('0x11')](_0x330268));_0x4a9507(_0x330268);})[_0x9220('0x20')](function(_0x51cf57){logger[_0x9220('0x12')](_0x9220('0x16'),_0x51cf57[_0x9220('0x14')],_0x44713f);_0x3dbfeb(_0x56e0c8['error'](0x1f4,_0x51cf57[_0x9220('0x14')]));});});}; \ No newline at end of file +var _0x9649=['Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Campaign,\x20%s,\x20%s','message','catch','GetCampaign','findAll','options','raw','where','attributes','limit','map','include','model','then','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','debug'];(function(_0x70a4e2,_0x1b833a){var _0x4d1d1e=function(_0x479208){while(--_0x479208){_0x70a4e2['push'](_0x70a4e2['shift']());}};_0x4d1d1e(++_0x1b833a);}(_0x9649,0x19f));var _0x9964=function(_0x21d821,_0x44aec5){_0x21d821=_0x21d821-0x0;var _0x5ae04f=_0x9649[_0x21d821];return _0x5ae04f;};'use strict';var _=require(_0x9964('0x0'));var util=require(_0x9964('0x1'));var moment=require(_0x9964('0x2'));var BPromise=require(_0x9964('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9964('0x4'));var db=require(_0x9964('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9964('0x6'))('rpc');var config=require(_0x9964('0x7'));var jayson=require(_0x9964('0x8'));var client=jayson[_0x9964('0x9')][_0x9964('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x40c60b,_0x1338e7,_0x3fa639){return new BPromise(function(_0x4bec88,_0x45dda7){return client[_0x9964('0xb')](_0x40c60b,_0x3fa639)['then'](function(_0x10b88b){logger[_0x9964('0xc')]('Campaign,\x20%s,\x20%s',_0x1338e7,'request\x20sent');logger[_0x9964('0xd')](_0x9964('0xe'),_0x1338e7,_0x9964('0xf'),JSON[_0x9964('0x10')](_0x10b88b));if(_0x10b88b[_0x9964('0x11')]){if(_0x10b88b['error'][_0x9964('0x12')]===0x1f4){logger['error'](_0x9964('0x13'),_0x1338e7,_0x10b88b[_0x9964('0x11')]['message']);return _0x45dda7(_0x10b88b[_0x9964('0x11')][_0x9964('0x14')]);}logger['error'](_0x9964('0x13'),_0x1338e7,_0x10b88b[_0x9964('0x11')][_0x9964('0x14')]);return _0x4bec88(_0x10b88b[_0x9964('0x11')][_0x9964('0x14')]);}else{logger['info'](_0x9964('0x13'),_0x1338e7,_0x9964('0xf'));_0x4bec88(_0x10b88b['result'][_0x9964('0x14')]);}})[_0x9964('0x15')](function(_0x57fe55){logger[_0x9964('0x11')](_0x9964('0x13'),_0x1338e7,_0x57fe55);_0x45dda7(_0x57fe55);});});}exports[_0x9964('0x16')]=function(_0x4c18a4){var _0x4f2f68=this;return new Promise(function(_0x40b3dd,_0x931a0f){return db['Campaign'][_0x9964('0x17')]({'raw':_0x4c18a4[_0x9964('0x18')]?_0x4c18a4[_0x9964('0x18')][_0x9964('0x19')]===undefined?!![]:![]:!![],'where':_0x4c18a4[_0x9964('0x18')]?_0x4c18a4[_0x9964('0x18')][_0x9964('0x1a')]||null:null,'attributes':_0x4c18a4[_0x9964('0x18')]?_0x4c18a4[_0x9964('0x18')][_0x9964('0x1b')]||null:null,'limit':_0x4c18a4['options']?_0x4c18a4[_0x9964('0x18')][_0x9964('0x1c')]||null:null,'include':_0x4c18a4['options']?_0x4c18a4[_0x9964('0x18')]['include']?_[_0x9964('0x1d')](_0x4c18a4[_0x9964('0x18')][_0x9964('0x1e')],function(_0x167525){return{'model':db[_0x167525[_0x9964('0x1f')]],'as':_0x167525['as'],'attributes':_0x167525[_0x9964('0x1b')],'include':_0x167525['include']?_[_0x9964('0x1d')](_0x167525[_0x9964('0x1e')],function(_0x5961e9){return{'model':db[_0x5961e9[_0x9964('0x1f')]],'as':_0x5961e9['as'],'attributes':_0x5961e9[_0x9964('0x1b')],'include':_0x5961e9[_0x9964('0x1e')]?_[_0x9964('0x1d')](_0x5961e9[_0x9964('0x1e')],function(_0x5a5793){return{'model':db[_0x5a5793[_0x9964('0x1f')]],'as':_0x5a5793['as'],'attributes':_0x5a5793['attributes']};}):[]};}):[]};}):[]:[]})[_0x9964('0x20')](function(_0x512f6b){logger[_0x9964('0xc')]('GetCampaign',_0x4c18a4);logger[_0x9964('0xd')](_0x9964('0x16'),_0x4c18a4,JSON[_0x9964('0x10')](_0x512f6b));_0x40b3dd(_0x512f6b);})[_0x9964('0x15')](function(_0x11cdce){logger[_0x9964('0x11')](_0x9964('0x16'),_0x11cdce[_0x9964('0x14')],_0x4c18a4);_0x931a0f(_0x4f2f68[_0x9964('0x11')](0x1f4,_0x11cdce['message']));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 972b388..3f27699 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 _0xe526=['util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','isAuthenticated','index','get','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','addBlackLists','put','delete','destroy','removeLists','removeBlackLists','exports'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0xe526,0x6c));var _0x6e52=function(_0x44692d,_0x4b9979){_0x44692d=_0x44692d-0x0;var _0xcf41c5=_0xe526[_0x44692d];return _0xcf41c5;};'use strict';var multer=require('multer');var util=require(_0x6e52('0x0'));var path=require('path');var timeout=require(_0x6e52('0x1'));var express=require('express');var router=express[_0x6e52('0x2')]();var fs_extra=require(_0x6e52('0x3'));var auth=require(_0x6e52('0x4'));var interaction=require(_0x6e52('0x5'));var config=require(_0x6e52('0x6'));var controller=require(_0x6e52('0x7'));router['get']('/',auth[_0x6e52('0x8')](),controller[_0x6e52('0x9')]);router[_0x6e52('0xa')](_0x6e52('0xb'),auth['isAuthenticated'](),controller[_0x6e52('0xc')]);router[_0x6e52('0xa')](_0x6e52('0xd'),auth[_0x6e52('0x8')](),controller[_0x6e52('0xe')]);router[_0x6e52('0xa')](_0x6e52('0xf'),auth[_0x6e52('0x8')](),controller[_0x6e52('0x10')]);router[_0x6e52('0xa')](_0x6e52('0x11'),auth[_0x6e52('0x8')](),controller['getHopperFinals']);router[_0x6e52('0xa')](_0x6e52('0x12'),auth[_0x6e52('0x8')](),controller[_0x6e52('0x13')]);router[_0x6e52('0xa')](_0x6e52('0x14'),auth[_0x6e52('0x8')](),controller[_0x6e52('0x15')]);router[_0x6e52('0xa')](_0x6e52('0x16'),auth[_0x6e52('0x8')](),controller[_0x6e52('0x17')]);router[_0x6e52('0x18')]('/',auth['isAuthenticated'](),controller[_0x6e52('0x19')]);router[_0x6e52('0x18')](_0x6e52('0x1a'),auth[_0x6e52('0x8')](),controller[_0x6e52('0x1b')]);router[_0x6e52('0x18')](_0x6e52('0x14'),auth['isAuthenticated'](),controller[_0x6e52('0x1c')]);router[_0x6e52('0x18')]('/:id/blacklists',auth[_0x6e52('0x8')](),controller[_0x6e52('0x1d')]);router[_0x6e52('0x1e')](_0x6e52('0xb'),auth[_0x6e52('0x8')](),controller['update']);router[_0x6e52('0x1f')](_0x6e52('0xb'),auth[_0x6e52('0x8')](),controller[_0x6e52('0x20')]);router[_0x6e52('0x1f')](_0x6e52('0x14'),auth[_0x6e52('0x8')](),controller[_0x6e52('0x21')]);router[_0x6e52('0x1f')]('/:id/blacklists',auth[_0x6e52('0x8')](),controller[_0x6e52('0x22')]);module[_0x6e52('0x23')]=router; \ No newline at end of file +var _0x0a8d=['index','/:id','/:id/hoppers','getHoppers','getHopperHistories','/:id/hopper_black','getHopperBlacks','getBlackLists','create','/:id/clone','post','/:id/lists','addLists','/:id/blacklists','addBlackLists','put','update','delete','destroy','removeBlackLists','exports','multer','util','connect-timeout','express','../../components/auth/service','../../config/environment','get','isAuthenticated'];(function(_0x51bfb2,_0x273636){var _0x15e037=function(_0x176764){while(--_0x176764){_0x51bfb2['push'](_0x51bfb2['shift']());}};_0x15e037(++_0x273636);}(_0x0a8d,0x89));var _0xd0a8=function(_0x1b2664,_0x197517){_0x1b2664=_0x1b2664-0x0;var _0x1c5397=_0x0a8d[_0x1b2664];return _0x1c5397;};'use strict';var multer=require(_0xd0a8('0x0'));var util=require(_0xd0a8('0x1'));var path=require('path');var timeout=require(_0xd0a8('0x2'));var express=require(_0xd0a8('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd0a8('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xd0a8('0x5'));var controller=require('./campaign.controller');router[_0xd0a8('0x6')]('/',auth[_0xd0a8('0x7')](),controller[_0xd0a8('0x8')]);router['get'](_0xd0a8('0x9'),auth['isAuthenticated'](),controller['show']);router['get'](_0xd0a8('0xa'),auth[_0xd0a8('0x7')](),controller[_0xd0a8('0xb')]);router[_0xd0a8('0x6')]('/:id/hopper_histories',auth['isAuthenticated'](),controller[_0xd0a8('0xc')]);router[_0xd0a8('0x6')]('/:id/hopper_finals',auth[_0xd0a8('0x7')](),controller['getHopperFinals']);router[_0xd0a8('0x6')](_0xd0a8('0xd'),auth[_0xd0a8('0x7')](),controller[_0xd0a8('0xe')]);router[_0xd0a8('0x6')]('/:id/lists',auth[_0xd0a8('0x7')](),controller['getLists']);router[_0xd0a8('0x6')]('/:id/blacklists',auth[_0xd0a8('0x7')](),controller[_0xd0a8('0xf')]);router['post']('/',auth[_0xd0a8('0x7')](),controller[_0xd0a8('0x10')]);router['post'](_0xd0a8('0x11'),auth[_0xd0a8('0x7')](),controller['clone']);router[_0xd0a8('0x12')](_0xd0a8('0x13'),auth[_0xd0a8('0x7')](),controller[_0xd0a8('0x14')]);router[_0xd0a8('0x12')](_0xd0a8('0x15'),auth[_0xd0a8('0x7')](),controller[_0xd0a8('0x16')]);router[_0xd0a8('0x17')](_0xd0a8('0x9'),auth[_0xd0a8('0x7')](),controller[_0xd0a8('0x18')]);router[_0xd0a8('0x19')](_0xd0a8('0x9'),auth[_0xd0a8('0x7')](),controller[_0xd0a8('0x1a')]);router[_0xd0a8('0x19')](_0xd0a8('0x13'),auth[_0xd0a8('0x7')](),controller['removeLists']);router[_0xd0a8('0x19')](_0xd0a8('0x15'),auth[_0xd0a8('0x7')](),controller[_0xd0a8('0x1b')]);module[_0xd0a8('0x1c')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 66a5a9d..54f0e8a 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 _0x9160=['STRING','TEXT','medium','VIRTUAL','getDataValue','key','sequelize','exports'];(function(_0xcce0d2,_0x553582){var _0x18144e=function(_0x1acfd0){while(--_0x1acfd0){_0xcce0d2['push'](_0xcce0d2['shift']());}};_0x18144e(++_0x553582);}(_0x9160,0x106));var _0x0916=function(_0x150ff1,_0x182895){_0x150ff1=_0x150ff1-0x0;var _0x4a3647=_0x9160[_0x150ff1];return _0x4a3647;};'use strict';var Sequelize=require(_0x0916('0x0'));module[_0x0916('0x1')]={'key':{'type':Sequelize[_0x0916('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x0916('0x3')],'length':_0x0916('0x4'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x0916('0x5')],'get':function(){return this[_0x0916('0x6')](_0x0916('0x7'));}}}; \ No newline at end of file +var _0x83a5=['getDataValue','sequelize','exports','STRING','TEXT','medium','VIRTUAL'];(function(_0x46f3f8,_0x12c74b){var _0xbc57cd=function(_0x34df37){while(--_0x34df37){_0x46f3f8['push'](_0x46f3f8['shift']());}};_0xbc57cd(++_0x12c74b);}(_0x83a5,0x8d));var _0x583a=function(_0x532c88,_0x493d7c){_0x532c88=_0x532c88-0x0;var _0x4c6b26=_0x83a5[_0x532c88];return _0x4c6b26;};'use strict';var Sequelize=require(_0x583a('0x0'));module[_0x583a('0x1')]={'key':{'type':Sequelize[_0x583a('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x583a('0x3')],'length':_0x583a('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0x583a('0x2')]},'name':{'type':Sequelize[_0x583a('0x5')],'get':function(){return this[_0x583a('0x6')]('key');}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 4dc5f2f..ac0f823 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 _0x06b0=['findAll','rows','catch','show','params','keys','intersection','length','include','body','find','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','apply','reject','save','update','then','destroy','get','CannedAnswers','UserProfileResource','stack','send','index','map','rawAttributes','type','key','model','name','query','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','merge','filter','options','includeAll','CannedAnswer'];(function(_0x132558,_0x521d93){var _0x34f138=function(_0x3e3541){while(--_0x3e3541){_0x132558['push'](_0x132558['shift']());}};_0x34f138(++_0x521d93);}(_0x06b0,0x178));var _0x006b=function(_0x4e7da7,_0xda1a3b){_0x4e7da7=_0x4e7da7-0x0;var _0xa368ea=_0x06b0[_0x4e7da7];return _0xa368ea;};'use strict';var emlformat=require(_0x006b('0x0'));var rimraf=require(_0x006b('0x1'));var zipdir=require(_0x006b('0x2'));var jsonpatch=require(_0x006b('0x3'));var rp=require(_0x006b('0x4'));var moment=require(_0x006b('0x5'));var BPromise=require(_0x006b('0x6'));var Mustache=require(_0x006b('0x7'));var util=require('util');var path=require(_0x006b('0x8'));var sox=require(_0x006b('0x9'));var csv=require(_0x006b('0xa'));var ejs=require(_0x006b('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x006b('0xc'));var squel=require(_0x006b('0xd'));var crypto=require(_0x006b('0xe'));var jsforce=require(_0x006b('0xf'));var deskjs=require(_0x006b('0x10'));var toCsv=require(_0x006b('0xa'));var querystring=require(_0x006b('0x11'));var Papa=require(_0x006b('0x12'));var Redis=require(_0x006b('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x006b('0x14'));var as=require(_0x006b('0x15'));var hardwareService=require(_0x006b('0x16'));var logger=require('../../config/logger')(_0x006b('0x17'));var utils=require(_0x006b('0x18'));var config=require(_0x006b('0x19'));var licenseUtil=require(_0x006b('0x1a'));var db=require(_0x006b('0x1b'))['db'];function respondWithStatusCode(_0x5882db,_0x49f633){_0x49f633=_0x49f633||0xcc;return function(_0x4910be){if(_0x4910be){return _0x5882db[_0x006b('0x1c')](_0x49f633);}return _0x5882db[_0x006b('0x1d')](_0x49f633)[_0x006b('0x1e')]();};}function respondWithResult(_0x664fb6,_0xf0b1d2){_0xf0b1d2=_0xf0b1d2||0xc8;return function(_0x5638a3){if(_0x5638a3){return _0x664fb6[_0x006b('0x1d')](_0xf0b1d2)[_0x006b('0x1f')](_0x5638a3);}};}function respondWithFilteredResult(_0x422b0b,_0x3f69c4){return function(_0x25cb02){if(_0x25cb02){var _0x2da7ab=typeof _0x3f69c4['offset']===_0x006b('0x20')&&typeof _0x3f69c4[_0x006b('0x21')]===_0x006b('0x20');var _0x4aa4b5=_0x25cb02['count'];var _0x4f3a97=_0x2da7ab?0x0:_0x3f69c4[_0x006b('0x22')];var _0x7ae223=_0x2da7ab?_0x25cb02[_0x006b('0x23')]:_0x3f69c4['offset']+_0x3f69c4[_0x006b('0x21')];var _0x1c0b7d;if(_0x7ae223>=_0x4aa4b5){_0x7ae223=_0x4aa4b5;_0x1c0b7d=0xc8;}else{_0x1c0b7d=0xce;}_0x422b0b[_0x006b('0x1d')](_0x1c0b7d);return _0x422b0b[_0x006b('0x24')]('Content-Range',_0x4f3a97+'-'+_0x7ae223+'/'+_0x4aa4b5)[_0x006b('0x1f')](_0x25cb02);}return null;};}function patchUpdates(_0x49f557){return function(_0x4fa660){try{jsonpatch[_0x006b('0x25')](_0x4fa660,_0x49f557,!![]);}catch(_0x1c4c05){return BPromise[_0x006b('0x26')](_0x1c4c05);}return _0x4fa660[_0x006b('0x27')]();};}function saveUpdates(_0x58d195,_0x1d721d){return function(_0x2a5e28){if(_0x2a5e28){return _0x2a5e28[_0x006b('0x28')](_0x58d195)[_0x006b('0x29')](function(_0x5457f4){return _0x5457f4;});}return null;};}function removeEntity(_0x212523,_0x12bcac){return function(_0x275b20){if(_0x275b20){return _0x275b20[_0x006b('0x2a')]()[_0x006b('0x29')](function(){var _0x5f384a=_0x275b20[_0x006b('0x2b')]({'plain':!![]});var _0x153c64=_0x006b('0x2c');return db[_0x006b('0x2d')][_0x006b('0x2a')]({'where':{'type':_0x153c64,'resourceId':_0x5f384a['id']}})[_0x006b('0x29')](function(){return _0x275b20;});})['then'](function(){_0x212523[_0x006b('0x1d')](0xcc)[_0x006b('0x1e')]();});}};}function handleEntityNotFound(_0x448a25,_0x4804ca){return function(_0x274bc2){if(!_0x274bc2){_0x448a25['sendStatus'](0x194);}return _0x274bc2;};}function handleError(_0x2bde5b,_0x49537f){_0x49537f=_0x49537f||0x1f4;return function(_0x2f83c4){logger['error'](_0x2f83c4[_0x006b('0x2e')]);if(_0x2f83c4['name']){delete _0x2f83c4['name'];}_0x2bde5b[_0x006b('0x1d')](_0x49537f)[_0x006b('0x2f')](_0x2f83c4);};}exports[_0x006b('0x30')]=function(_0x26e1f8,_0x328462){var _0x41d583={},_0x20e268={},_0x4cc101={'count':0x0,'rows':[]};var _0x5e649f=_[_0x006b('0x31')](db['CannedAnswer'][_0x006b('0x32')],function(_0x3a343a){return{'name':_0x3a343a['fieldName'],'type':_0x3a343a[_0x006b('0x33')][_0x006b('0x34')]};});_0x20e268[_0x006b('0x35')]=_[_0x006b('0x31')](_0x5e649f,_0x006b('0x36'));_0x20e268[_0x006b('0x37')]=_['keys'](_0x26e1f8['query']);_0x20e268[_0x006b('0x38')]=_['intersection'](_0x20e268['model'],_0x20e268[_0x006b('0x37')]);_0x41d583[_0x006b('0x39')]=_['intersection'](_0x20e268[_0x006b('0x35')],qs[_0x006b('0x3a')](_0x26e1f8[_0x006b('0x37')][_0x006b('0x3a')]));_0x41d583['attributes']=_0x41d583['attributes']['length']?_0x41d583['attributes']:_0x20e268[_0x006b('0x35')];if(!_0x26e1f8[_0x006b('0x37')][_0x006b('0x3b')](_0x006b('0x3c'))){_0x41d583[_0x006b('0x21')]=qs[_0x006b('0x21')](_0x26e1f8[_0x006b('0x37')]['limit']);_0x41d583[_0x006b('0x22')]=qs[_0x006b('0x22')](_0x26e1f8[_0x006b('0x37')]['offset']);}_0x41d583[_0x006b('0x3d')]=qs['sort'](_0x26e1f8[_0x006b('0x37')][_0x006b('0x3e')]);_0x41d583['where']=qs[_0x006b('0x38')](_[_0x006b('0x3f')](_0x26e1f8['query'],_0x20e268[_0x006b('0x38')]),_0x5e649f);if(_0x26e1f8[_0x006b('0x37')]['filter']){_0x41d583['where']=_[_0x006b('0x40')](_0x41d583['where'],{'$or':[{'key':{'$like':'%'+_0x26e1f8[_0x006b('0x37')][_0x006b('0x41')]+'%'}},{'value':{'$like':'%'+_0x26e1f8['query'][_0x006b('0x41')]+'%'}}]});}_0x41d583=_[_0x006b('0x40')]({},_0x41d583,_0x26e1f8[_0x006b('0x42')]);var _0x251d9f={'where':_0x41d583['where']};return db['CannedAnswer'][_0x006b('0x23')](_0x251d9f)[_0x006b('0x29')](function(_0xb9d918){_0x4cc101[_0x006b('0x23')]=_0xb9d918;if(_0x26e1f8[_0x006b('0x37')][_0x006b('0x43')]){_0x41d583['include']=[{'all':!![]}];}return db[_0x006b('0x44')][_0x006b('0x45')](_0x41d583);})['then'](function(_0x56f85b){_0x4cc101[_0x006b('0x46')]=_0x56f85b;return _0x4cc101;})[_0x006b('0x29')](respondWithFilteredResult(_0x328462,_0x41d583))[_0x006b('0x47')](handleError(_0x328462,null));};exports[_0x006b('0x48')]=function(_0x2c4b31,_0x4b001f){var _0x3470ca={'raw':!![],'where':{'id':_0x2c4b31[_0x006b('0x49')]['id']}},_0x122411={};_0x122411[_0x006b('0x35')]=_[_0x006b('0x4a')](db[_0x006b('0x44')][_0x006b('0x32')]);_0x122411[_0x006b('0x37')]=_[_0x006b('0x4a')](_0x2c4b31[_0x006b('0x37')]);_0x122411[_0x006b('0x38')]=_[_0x006b('0x4b')](_0x122411[_0x006b('0x35')],_0x122411[_0x006b('0x37')]);_0x3470ca[_0x006b('0x39')]=_[_0x006b('0x4b')](_0x122411[_0x006b('0x35')],qs[_0x006b('0x3a')](_0x2c4b31['query']['fields']));_0x3470ca['attributes']=_0x3470ca[_0x006b('0x39')][_0x006b('0x4c')]?_0x3470ca['attributes']:_0x122411['model'];if(_0x2c4b31[_0x006b('0x37')][_0x006b('0x43')]){_0x3470ca[_0x006b('0x4d')]=[{'all':!![]}];}_0x3470ca=_[_0x006b('0x40')]({},_0x3470ca,_0x2c4b31[_0x006b('0x42')]);return db['CannedAnswer']['find'](_0x3470ca)[_0x006b('0x29')](handleEntityNotFound(_0x4b001f,null))['then'](respondWithResult(_0x4b001f,null))[_0x006b('0x47')](handleError(_0x4b001f,null));};exports[_0x006b('0x28')]=function(_0x427948,_0x2d451b){if(_0x427948['body']['id']){delete _0x427948[_0x006b('0x4e')]['id'];}return db[_0x006b('0x44')][_0x006b('0x4f')]({'where':{'id':_0x427948[_0x006b('0x49')]['id']}})[_0x006b('0x29')](handleEntityNotFound(_0x2d451b,null))[_0x006b('0x29')](saveUpdates(_0x427948['body'],null))['then'](respondWithResult(_0x2d451b,null))[_0x006b('0x47')](handleError(_0x2d451b,null));};exports[_0x006b('0x2a')]=function(_0x265c2c,_0x261d07){return db[_0x006b('0x44')][_0x006b('0x4f')]({'where':{'id':_0x265c2c[_0x006b('0x49')]['id']}})[_0x006b('0x29')](handleEntityNotFound(_0x261d07,null))[_0x006b('0x29')](removeEntity(_0x261d07,null))[_0x006b('0x47')](handleError(_0x261d07,null));};exports[_0x006b('0x50')]=function(_0x3807ad,_0x522522){var _0x2dbac5={'key':_0x3807ad[_0x006b('0x4e')][_0x006b('0x34')]};if(_0x3807ad[_0x006b('0x4e')][_0x006b('0x51')]){_0x2dbac5[_0x006b('0x51')]=_0x3807ad[_0x006b('0x4e')][_0x006b('0x51')];}else if(_0x3807ad[_0x006b('0x4e')][_0x006b('0x52')]){_0x2dbac5['SmsAccountId']=_0x3807ad[_0x006b('0x4e')][_0x006b('0x52')];}else if(_0x3807ad['body'][_0x006b('0x53')]){_0x2dbac5[_0x006b('0x53')]=_0x3807ad[_0x006b('0x4e')][_0x006b('0x53')];}else if(_0x3807ad[_0x006b('0x4e')][_0x006b('0x54')]){_0x2dbac5[_0x006b('0x54')]=_0x3807ad[_0x006b('0x4e')][_0x006b('0x54')];}return db[_0x006b('0x44')][_0x006b('0x4f')]({'where':_0x2dbac5})[_0x006b('0x29')](function(_0xce5412){if(_0xce5412){throw new db['Sequelize']['ValidationError']('The\x20inserted\x20key\x20already\x20exists.');}return db[_0x006b('0x44')][_0x006b('0x50')](_0x3807ad[_0x006b('0x4e')]);})[_0x006b('0x29')](function(_0x534d20){var _0x340182=_0x3807ad[_0x006b('0x55')][_0x006b('0x2b')]({'plain':!![]});if(!_0x340182)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x340182['role']===_0x006b('0x55')){var _0xd4beb2=_0x534d20['get']({'plain':!![]});return db[_0x006b('0x56')][_0x006b('0x4f')]({'where':{'name':_0x006b('0x2c'),'userProfileId':_0x340182[_0x006b('0x57')]},'raw':!![]})[_0x006b('0x29')](function(_0x438723){if(_0x438723&&_0x438723['autoAssociation']===0x0){return db[_0x006b('0x2d')][_0x006b('0x50')]({'name':_0xd4beb2[_0x006b('0x36')],'resourceId':_0xd4beb2['id'],'type':_0x438723['name'],'sectionId':_0x438723['id']},{})['then'](function(){return _0x534d20;});}else{return _0x534d20;}})[_0x006b('0x47')](function(_0x4ab036){logger['error'](_0x006b('0x58'),_0x4ab036);throw _0x4ab036;});}return _0x534d20;})['then'](respondWithResult(_0x522522,0xc9))[_0x006b('0x47')](handleError(_0x522522,null));}; \ No newline at end of file +var _0xe52c=['path','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','get','CannedAnswers','UserProfileResource','sendStatus','error','stack','name','send','index','map','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','options','CannedAnswer','includeAll','include','rows','catch','show','merge','find','update','body','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','eml-format','rimraf','fast-json-patch','moment','mustache'];(function(_0x313c96,_0x3cee6e){var _0x522f53=function(_0x8961e){while(--_0x8961e){_0x313c96['push'](_0x313c96['shift']());}};_0x522f53(++_0x3cee6e);}(_0xe52c,0xa7));var _0xce52=function(_0x3e57cc,_0x432089){_0x3e57cc=_0x3e57cc-0x0;var _0x4737a0=_0xe52c[_0x3e57cc];return _0x4737a0;};'use strict';var emlformat=require(_0xce52('0x0'));var rimraf=require(_0xce52('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xce52('0x2'));var rp=require('request-promise');var moment=require(_0xce52('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xce52('0x4'));var util=require('util');var path=require(_0xce52('0x5'));var sox=require(_0xce52('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xce52('0x7'));var _=require(_0xce52('0x8'));var squel=require(_0xce52('0x9'));var crypto=require(_0xce52('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xce52('0xb'));var toCsv=require(_0xce52('0xc'));var querystring=require(_0xce52('0xd'));var Papa=require('papaparse');var Redis=require(_0xce52('0xe'));var authService=require(_0xce52('0xf'));var qs=require(_0xce52('0x10'));var as=require(_0xce52('0x11'));var hardwareService=require(_0xce52('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xce52('0x13'));var config=require(_0xce52('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xce52('0x15'))['db'];function respondWithStatusCode(_0x1d3137,_0x1472ea){_0x1472ea=_0x1472ea||0xcc;return function(_0x135adf){if(_0x135adf){return _0x1d3137['sendStatus'](_0x1472ea);}return _0x1d3137[_0xce52('0x16')](_0x1472ea)[_0xce52('0x17')]();};}function respondWithResult(_0xaacb6,_0x35b5c5){_0x35b5c5=_0x35b5c5||0xc8;return function(_0x3fa8a1){if(_0x3fa8a1){return _0xaacb6[_0xce52('0x16')](_0x35b5c5)[_0xce52('0x18')](_0x3fa8a1);}};}function respondWithFilteredResult(_0x4fc0bc,_0x4bfbb1){return function(_0x483511){if(_0x483511){var _0x7f9ea9=typeof _0x4bfbb1[_0xce52('0x19')]===_0xce52('0x1a')&&typeof _0x4bfbb1[_0xce52('0x1b')]===_0xce52('0x1a');var _0x5c5267=_0x483511[_0xce52('0x1c')];var _0x40be60=_0x7f9ea9?0x0:_0x4bfbb1['offset'];var _0x528c0b=_0x7f9ea9?_0x483511[_0xce52('0x1c')]:_0x4bfbb1[_0xce52('0x19')]+_0x4bfbb1[_0xce52('0x1b')];var _0x343abc;if(_0x528c0b>=_0x5c5267){_0x528c0b=_0x5c5267;_0x343abc=0xc8;}else{_0x343abc=0xce;}_0x4fc0bc['status'](_0x343abc);return _0x4fc0bc[_0xce52('0x1d')]('Content-Range',_0x40be60+'-'+_0x528c0b+'/'+_0x5c5267)[_0xce52('0x18')](_0x483511);}return null;};}function patchUpdates(_0x525a2f){return function(_0x3c3bae){try{jsonpatch[_0xce52('0x1e')](_0x3c3bae,_0x525a2f,!![]);}catch(_0x5e446d){return BPromise[_0xce52('0x1f')](_0x5e446d);}return _0x3c3bae[_0xce52('0x20')]();};}function saveUpdates(_0x520692,_0x27ed10){return function(_0x3d03e5){if(_0x3d03e5){return _0x3d03e5['update'](_0x520692)[_0xce52('0x21')](function(_0x3d4ca4){return _0x3d4ca4;});}return null;};}function removeEntity(_0x5271fc,_0x36d193){return function(_0x3f4686){if(_0x3f4686){return _0x3f4686[_0xce52('0x22')]()['then'](function(){var _0x1e52d6=_0x3f4686[_0xce52('0x23')]({'plain':!![]});var _0x20d557=_0xce52('0x24');return db[_0xce52('0x25')]['destroy']({'where':{'type':_0x20d557,'resourceId':_0x1e52d6['id']}})[_0xce52('0x21')](function(){return _0x3f4686;});})['then'](function(){_0x5271fc['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ad6bb,_0x575788){return function(_0x26caf2){if(!_0x26caf2){_0x3ad6bb[_0xce52('0x26')](0x194);}return _0x26caf2;};}function handleError(_0x16eb0f,_0x38ee66){_0x38ee66=_0x38ee66||0x1f4;return function(_0x6f8e3f){logger[_0xce52('0x27')](_0x6f8e3f[_0xce52('0x28')]);if(_0x6f8e3f[_0xce52('0x29')]){delete _0x6f8e3f[_0xce52('0x29')];}_0x16eb0f[_0xce52('0x16')](_0x38ee66)[_0xce52('0x2a')](_0x6f8e3f);};}exports[_0xce52('0x2b')]=function(_0x43941b,_0x568a9e){var _0x317e33={},_0x458889={},_0x25e08f={'count':0x0,'rows':[]};var _0x30eb82=_[_0xce52('0x2c')](db['CannedAnswer']['rawAttributes'],function(_0x584a3a){return{'name':_0x584a3a['fieldName'],'type':_0x584a3a[_0xce52('0x2d')][_0xce52('0x2e')]};});_0x458889['model']=_['map'](_0x30eb82,_0xce52('0x29'));_0x458889[_0xce52('0x2f')]=_[_0xce52('0x30')](_0x43941b['query']);_0x458889[_0xce52('0x31')]=_[_0xce52('0x32')](_0x458889[_0xce52('0x33')],_0x458889[_0xce52('0x2f')]);_0x317e33[_0xce52('0x34')]=_['intersection'](_0x458889['model'],qs[_0xce52('0x35')](_0x43941b[_0xce52('0x2f')][_0xce52('0x35')]));_0x317e33[_0xce52('0x34')]=_0x317e33[_0xce52('0x34')][_0xce52('0x36')]?_0x317e33[_0xce52('0x34')]:_0x458889[_0xce52('0x33')];if(!_0x43941b[_0xce52('0x2f')][_0xce52('0x37')]('nolimit')){_0x317e33[_0xce52('0x1b')]=qs[_0xce52('0x1b')](_0x43941b[_0xce52('0x2f')]['limit']);_0x317e33[_0xce52('0x19')]=qs[_0xce52('0x19')](_0x43941b[_0xce52('0x2f')]['offset']);}_0x317e33[_0xce52('0x38')]=qs[_0xce52('0x39')](_0x43941b[_0xce52('0x2f')][_0xce52('0x39')]);_0x317e33['where']=qs[_0xce52('0x31')](_[_0xce52('0x3a')](_0x43941b[_0xce52('0x2f')],_0x458889[_0xce52('0x31')]),_0x30eb82);if(_0x43941b[_0xce52('0x2f')][_0xce52('0x3b')]){_0x317e33[_0xce52('0x3c')]=_['merge'](_0x317e33['where'],{'$or':[{'key':{'$like':'%'+_0x43941b[_0xce52('0x2f')][_0xce52('0x3b')]+'%'}},{'value':{'$like':'%'+_0x43941b[_0xce52('0x2f')][_0xce52('0x3b')]+'%'}}]});}_0x317e33=_['merge']({},_0x317e33,_0x43941b[_0xce52('0x3d')]);var _0x18821e={'where':_0x317e33[_0xce52('0x3c')]};return db[_0xce52('0x3e')][_0xce52('0x1c')](_0x18821e)[_0xce52('0x21')](function(_0x1e833d){_0x25e08f['count']=_0x1e833d;if(_0x43941b['query'][_0xce52('0x3f')]){_0x317e33[_0xce52('0x40')]=[{'all':!![]}];}return db[_0xce52('0x3e')]['findAll'](_0x317e33);})[_0xce52('0x21')](function(_0x1097c7){_0x25e08f[_0xce52('0x41')]=_0x1097c7;return _0x25e08f;})[_0xce52('0x21')](respondWithFilteredResult(_0x568a9e,_0x317e33))[_0xce52('0x42')](handleError(_0x568a9e,null));};exports[_0xce52('0x43')]=function(_0x2db2c1,_0x1f8f09){var _0x5f87d4={'raw':!![],'where':{'id':_0x2db2c1['params']['id']}},_0x32b157={};_0x32b157[_0xce52('0x33')]=_[_0xce52('0x30')](db['CannedAnswer']['rawAttributes']);_0x32b157[_0xce52('0x2f')]=_['keys'](_0x2db2c1[_0xce52('0x2f')]);_0x32b157[_0xce52('0x31')]=_['intersection'](_0x32b157['model'],_0x32b157[_0xce52('0x2f')]);_0x5f87d4[_0xce52('0x34')]=_[_0xce52('0x32')](_0x32b157['model'],qs['fields'](_0x2db2c1[_0xce52('0x2f')][_0xce52('0x35')]));_0x5f87d4[_0xce52('0x34')]=_0x5f87d4[_0xce52('0x34')][_0xce52('0x36')]?_0x5f87d4[_0xce52('0x34')]:_0x32b157['model'];if(_0x2db2c1[_0xce52('0x2f')][_0xce52('0x3f')]){_0x5f87d4['include']=[{'all':!![]}];}_0x5f87d4=_[_0xce52('0x44')]({},_0x5f87d4,_0x2db2c1[_0xce52('0x3d')]);return db[_0xce52('0x3e')][_0xce52('0x45')](_0x5f87d4)[_0xce52('0x21')](handleEntityNotFound(_0x1f8f09,null))['then'](respondWithResult(_0x1f8f09,null))[_0xce52('0x42')](handleError(_0x1f8f09,null));};exports[_0xce52('0x46')]=function(_0x324ce8,_0x2c9d5f){if(_0x324ce8['body']['id']){delete _0x324ce8[_0xce52('0x47')]['id'];}return db[_0xce52('0x3e')][_0xce52('0x45')]({'where':{'id':_0x324ce8[_0xce52('0x48')]['id']}})['then'](handleEntityNotFound(_0x2c9d5f,null))['then'](saveUpdates(_0x324ce8[_0xce52('0x47')],null))[_0xce52('0x21')](respondWithResult(_0x2c9d5f,null))[_0xce52('0x42')](handleError(_0x2c9d5f,null));};exports[_0xce52('0x22')]=function(_0x28a172,_0x262f5a){return db[_0xce52('0x3e')][_0xce52('0x45')]({'where':{'id':_0x28a172[_0xce52('0x48')]['id']}})['then'](handleEntityNotFound(_0x262f5a,null))[_0xce52('0x21')](removeEntity(_0x262f5a,null))['catch'](handleError(_0x262f5a,null));};exports[_0xce52('0x49')]=function(_0x2a48fe,_0x428abb){var _0x2153a7={'key':_0x2a48fe[_0xce52('0x47')][_0xce52('0x2e')]};if(_0x2a48fe['body']['MailAccountId']){_0x2153a7[_0xce52('0x4a')]=_0x2a48fe['body']['MailAccountId'];}else if(_0x2a48fe[_0xce52('0x47')][_0xce52('0x4b')]){_0x2153a7['SmsAccountId']=_0x2a48fe[_0xce52('0x47')][_0xce52('0x4b')];}else if(_0x2a48fe['body'][_0xce52('0x4c')]){_0x2153a7['OpenchannelAccountId']=_0x2a48fe[_0xce52('0x47')][_0xce52('0x4c')];}else if(_0x2a48fe[_0xce52('0x47')][_0xce52('0x4d')]){_0x2153a7[_0xce52('0x4d')]=_0x2a48fe[_0xce52('0x47')]['ChatWebsiteId'];}return db['CannedAnswer'][_0xce52('0x45')]({'where':_0x2153a7})[_0xce52('0x21')](function(_0x5d4f61){if(_0x5d4f61){throw new db[(_0xce52('0x4e'))][(_0xce52('0x4f'))](_0xce52('0x50'));}return db[_0xce52('0x3e')]['create'](_0x2a48fe[_0xce52('0x47')]);})[_0xce52('0x21')](function(_0x3f0a0b){var _0x34e23d=_0x2a48fe[_0xce52('0x51')][_0xce52('0x23')]({'plain':!![]});if(!_0x34e23d)throw new Error(_0xce52('0x52'));if(_0x34e23d[_0xce52('0x53')]==='user'){var _0x4b76d1=_0x3f0a0b['get']({'plain':!![]});return db[_0xce52('0x54')]['find']({'where':{'name':_0xce52('0x24'),'userProfileId':_0x34e23d[_0xce52('0x55')]},'raw':!![]})[_0xce52('0x21')](function(_0x1c2799){if(_0x1c2799&&_0x1c2799['autoAssociation']===0x0){return db['UserProfileResource'][_0xce52('0x49')]({'name':_0x4b76d1[_0xce52('0x29')],'resourceId':_0x4b76d1['id'],'type':_0x1c2799[_0xce52('0x29')],'sectionId':_0x1c2799['id']},{})[_0xce52('0x21')](function(){return _0x3f0a0b;});}else{return _0x3f0a0b;}})[_0xce52('0x42')](function(_0x498c81){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x498c81);throw _0x498c81;});}return _0x3f0a0b;})[_0xce52('0x21')](respondWithResult(_0x428abb,0xc9))[_0xce52('0x42')](handleError(_0x428abb,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index bae50af..4c49d7a 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 _0x3ef0=['utf8mb4_unicode_ci','lodash','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','tools_canned_answers'];(function(_0x267a92,_0x144bb1){var _0x41c589=function(_0x4ceae2){while(--_0x4ceae2){_0x267a92['push'](_0x267a92['shift']());}};_0x41c589(++_0x144bb1);}(_0x3ef0,0x141));var _0x03ef=function(_0x4a73ce,_0xa7c114){_0x4a73ce=_0x4a73ce-0x0;var _0x142f7c=_0x3ef0[_0x4a73ce];return _0x142f7c;};'use strict';var _=require(_0x03ef('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x03ef('0x1'));var BPromise=require(_0x03ef('0x2'));var rp=require(_0x03ef('0x3'));var fs=require('fs');var path=require(_0x03ef('0x4'));var rimraf=require(_0x03ef('0x5'));var config=require(_0x03ef('0x6'));var attributes=require('./cannedAnswer.attributes');module['exports']=function(_0x4b2a0d,_0x8158b5){return _0x4b2a0d[_0x03ef('0x7')]('CannedAnswer',attributes,{'tableName':_0x03ef('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x03ef('0x9')});}; \ No newline at end of file +var _0x4552=['bluebird','path','rimraf','../../config/environment','exports','define','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment'];(function(_0xc85fbd,_0x21d671){var _0x64f2d9=function(_0x4eb22d){while(--_0x4eb22d){_0xc85fbd['push'](_0xc85fbd['shift']());}};_0x64f2d9(++_0x21d671);}(_0x4552,0x1eb));var _0x2455=function(_0x9163f3,_0x3952eb){_0x9163f3=_0x9163f3-0x0;var _0x1b3790=_0x4552[_0x9163f3];return _0x1b3790;};'use strict';var _=require(_0x2455('0x0'));var util=require(_0x2455('0x1'));var logger=require(_0x2455('0x2'))('api');var moment=require(_0x2455('0x3'));var BPromise=require(_0x2455('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2455('0x5'));var rimraf=require(_0x2455('0x6'));var config=require(_0x2455('0x7'));var attributes=require('./cannedAnswer.attributes');module[_0x2455('0x8')]=function(_0x436101,_0x2d6b84){return _0x436101[_0x2455('0x9')]('CannedAnswer',attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x2455('0xa')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index d6babb7..8bb8153 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(_0x290b2a,_0x5170e8){var _0x105734=function(_0xd7dbd5){while(--_0xd7dbd5){_0x290b2a['push'](_0x290b2a['shift']());}};_0x105734(++_0x5170e8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'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(_0x24e637,_0x2c67d5){var _0x145d36=function(_0x3c5c69){while(--_0x3c5c69){_0x24e637['push'](_0x24e637['shift']());}};_0x145d36(++_0x2c67d5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'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 3a8ff66..d602ca5 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 _0xe772=['index','/:id','post','create','put','update','delete','destroy','exports','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xe772,0x185));var _0x2e77=function(_0x3124f8,_0x1a8b23){_0x3124f8=_0x3124f8-0x0;var _0x5bab5f=_0xe772[_0x3124f8];return _0x5bab5f;};'use strict';var multer=require(_0x2e77('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2e77('0x1'));var router=express[_0x2e77('0x2')]();var fs_extra=require(_0x2e77('0x3'));var auth=require(_0x2e77('0x4'));var interaction=require(_0x2e77('0x5'));var config=require(_0x2e77('0x6'));var controller=require(_0x2e77('0x7'));router[_0x2e77('0x8')]('/',auth[_0x2e77('0x9')](),controller[_0x2e77('0xa')]);router['get'](_0x2e77('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x2e77('0xc')]('/',auth[_0x2e77('0x9')](),controller[_0x2e77('0xd')]);router[_0x2e77('0xe')]('/:id',auth[_0x2e77('0x9')](),controller[_0x2e77('0xf')]);router[_0x2e77('0x10')]('/:id',auth[_0x2e77('0x9')](),controller[_0x2e77('0x11')]);module[_0x2e77('0x12')]=router; \ No newline at end of file +var _0x2773=['post','create','put','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/:id','show'];(function(_0x20723b,_0x48e22e){var _0x103d08=function(_0x7b211e){while(--_0x7b211e){_0x20723b['push'](_0x20723b['shift']());}};_0x103d08(++_0x48e22e);}(_0x2773,0x65));var _0x3277=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x2773[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x3277('0x0'));var util=require(_0x3277('0x1'));var path=require(_0x3277('0x2'));var timeout=require('connect-timeout');var express=require(_0x3277('0x3'));var router=express[_0x3277('0x4')]();var fs_extra=require(_0x3277('0x5'));var auth=require(_0x3277('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x3277('0x7'));var controller=require('./cannedAnswer.controller');router['get']('/',auth[_0x3277('0x8')](),controller[_0x3277('0x9')]);router[_0x3277('0xa')](_0x3277('0xb'),auth[_0x3277('0x8')](),controller[_0x3277('0xc')]);router[_0x3277('0xd')]('/',auth[_0x3277('0x8')](),controller[_0x3277('0xe')]);router[_0x3277('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x3277('0x10')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x3277('0x11')]);module[_0x3277('0x12')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index b875aca..08e6e22 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 _0xc2d0=['1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports','DATE'];(function(_0x4cee82,_0x208e67){var _0x200c1d=function(_0x372584){while(--_0x372584){_0x4cee82['push'](_0x4cee82['shift']());}};_0x200c1d(++_0x208e67);}(_0xc2d0,0x9f));var _0x0c2d=function(_0x53c506,_0x1c0fe8){_0x53c506=_0x53c506-0x0;var _0x165888=_0xc2d0[_0x53c506];return _0x165888;};'use strict';var Sequelize=require(_0x0c2d('0x0'));module[_0x0c2d('0x1')]={'calldate':{'type':Sequelize[_0x0c2d('0x2')],'allowNull':![],'defaultValue':_0x0c2d('0x3')},'clid':{'type':Sequelize[_0x0c2d('0x4')]},'src':{'type':Sequelize[_0x0c2d('0x4')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x0c2d('0x4')]},'lastapp':{'type':Sequelize[_0x0c2d('0x4')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x0c2d('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x0c2d('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x0c2d('0x4')]},'amaflags':{'type':Sequelize[_0x0c2d('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x0c2d('0x4')]},'userfield':{'type':Sequelize[_0x0c2d('0x4')]},'uniqueid':{'type':Sequelize[_0x0c2d('0x4')]},'linkedid':{'type':Sequelize[_0x0c2d('0x4')]},'sequence':{'type':Sequelize[_0x0c2d('0x4')]},'peeraccount':{'type':Sequelize[_0x0c2d('0x4')]},'type':{'type':Sequelize[_0x0c2d('0x4')]},'tag':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb910=['exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xb910,0x12b));var _0x0b91=function(_0x46d0c9,_0x526bfa){_0x46d0c9=_0x46d0c9-0x0;var _0x174506=_0xb910[_0x46d0c9];return _0x174506;};'use strict';var Sequelize=require(_0x0b91('0x0'));module[_0x0b91('0x1')]={'calldate':{'type':Sequelize[_0x0b91('0x2')],'allowNull':![],'defaultValue':_0x0b91('0x3')},'clid':{'type':Sequelize[_0x0b91('0x4')]},'src':{'type':Sequelize[_0x0b91('0x4')]},'dst':{'type':Sequelize[_0x0b91('0x4')]},'dcontext':{'type':Sequelize[_0x0b91('0x4')]},'channel':{'type':Sequelize[_0x0b91('0x4')]},'dstchannel':{'type':Sequelize[_0x0b91('0x4')]},'lastapp':{'type':Sequelize[_0x0b91('0x4')]},'lastdata':{'type':Sequelize[_0x0b91('0x4')]},'duration':{'type':Sequelize[_0x0b91('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x0b91('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x0b91('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x0b91('0x4')]},'userfield':{'type':Sequelize[_0x0b91('0x4')]},'uniqueid':{'type':Sequelize[_0x0b91('0x4')]},'linkedid':{'type':Sequelize[_0x0b91('0x4')]},'sequence':{'type':Sequelize[_0x0b91('0x4')]},'peeraccount':{'type':Sequelize[_0x0b91('0x4')]},'type':{'type':Sequelize[_0x0b91('0x4')]},'tag':{'type':Sequelize[_0x0b91('0x4')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index bb626b8..44aa8ac 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 _0x723e=['request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','end','sendStatus','error','name','send','index','rawAttributes','fieldName','type','map','query','keys','filters','intersection','model','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','Cdr','findAll','params','find','catch','create','body','describe','rimraf','zip-dir','fast-json-patch'];(function(_0x5ddfc7,_0x3103bd){var _0x4cf397=function(_0x3a7ac3){while(--_0x3a7ac3){_0x5ddfc7['push'](_0x5ddfc7['shift']());}};_0x4cf397(++_0x3103bd);}(_0x723e,0x179));var _0xe723=function(_0x270913,_0xb25fb4){_0x270913=_0x270913-0x0;var _0x1e1dba=_0x723e[_0x270913];return _0x1e1dba;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe723('0x0'));var zipdir=require(_0xe723('0x1'));var jsonpatch=require(_0xe723('0x2'));var rp=require(_0xe723('0x3'));var moment=require(_0xe723('0x4'));var BPromise=require(_0xe723('0x5'));var Mustache=require(_0xe723('0x6'));var util=require(_0xe723('0x7'));var path=require(_0xe723('0x8'));var sox=require(_0xe723('0x9'));var csv=require('to-csv');var ejs=require(_0xe723('0xa'));var fs=require('fs');var fs_extra=require(_0xe723('0xb'));var _=require(_0xe723('0xc'));var squel=require(_0xe723('0xd'));var crypto=require(_0xe723('0xe'));var jsforce=require(_0xe723('0xf'));var deskjs=require(_0xe723('0x10'));var toCsv=require(_0xe723('0x11'));var querystring=require('querystring');var Papa=require(_0xe723('0x12'));var Redis=require(_0xe723('0x13'));var authService=require(_0xe723('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xe723('0x15'));var hardwareService=require(_0xe723('0x16'));var logger=require(_0xe723('0x17'))('api');var utils=require(_0xe723('0x18'));var config=require(_0xe723('0x19'));var licenseUtil=require(_0xe723('0x1a'));var db=require(_0xe723('0x1b'))['db'];function respondWithStatusCode(_0x236b69,_0x5c066c){_0x5c066c=_0x5c066c||0xcc;return function(_0x29a1e){if(_0x29a1e){return _0x236b69['sendStatus'](_0x5c066c);}return _0x236b69['status'](_0x5c066c)['end']();};}function respondWithResult(_0x57bc0e,_0x75c12c){_0x75c12c=_0x75c12c||0xc8;return function(_0x30b2ba){if(_0x30b2ba){return _0x57bc0e[_0xe723('0x1c')](_0x75c12c)[_0xe723('0x1d')](_0x30b2ba);}};}function respondWithFilteredResult(_0xf29a39,_0x5aec97){return function(_0x23d0b2){if(_0x23d0b2){var _0xbf5ca3=typeof _0x5aec97[_0xe723('0x1e')]===_0xe723('0x1f')&&typeof _0x5aec97[_0xe723('0x20')]===_0xe723('0x1f');var _0x2cd7ca=_0x23d0b2[_0xe723('0x21')];var _0x17e2c1=_0xbf5ca3?0x0:_0x5aec97[_0xe723('0x1e')];var _0x2057d7=_0xbf5ca3?_0x23d0b2[_0xe723('0x21')]:_0x5aec97[_0xe723('0x1e')]+_0x5aec97[_0xe723('0x20')];var _0x5e8a90;if(_0x2057d7>=_0x2cd7ca){_0x2057d7=_0x2cd7ca;_0x5e8a90=0xc8;}else{_0x5e8a90=0xce;}_0xf29a39['status'](_0x5e8a90);return _0xf29a39[_0xe723('0x22')](_0xe723('0x23'),_0x17e2c1+'-'+_0x2057d7+'/'+_0x2cd7ca)['json'](_0x23d0b2);}return null;};}function patchUpdates(_0x28caca){return function(_0x2762e2){try{jsonpatch['apply'](_0x2762e2,_0x28caca,!![]);}catch(_0x472502){return BPromise['reject'](_0x472502);}return _0x2762e2[_0xe723('0x24')]();};}function saveUpdates(_0x43ccfc,_0x3b82b2){return function(_0x1fe43d){if(_0x1fe43d){return _0x1fe43d[_0xe723('0x25')](_0x43ccfc)[_0xe723('0x26')](function(_0x25f7d2){return _0x25f7d2;});}return null;};}function removeEntity(_0x15196c,_0x1228f2){return function(_0x19bd0c){if(_0x19bd0c){return _0x19bd0c[_0xe723('0x27')]()[_0xe723('0x26')](function(){_0x15196c['status'](0xcc)[_0xe723('0x28')]();});}};}function handleEntityNotFound(_0x59f095,_0xa258f3){return function(_0x3ffa15){if(!_0x3ffa15){_0x59f095[_0xe723('0x29')](0x194);}return _0x3ffa15;};}function handleError(_0xe7e271,_0x1f81ec){_0x1f81ec=_0x1f81ec||0x1f4;return function(_0x598f15){logger[_0xe723('0x2a')](_0x598f15['stack']);if(_0x598f15['name']){delete _0x598f15[_0xe723('0x2b')];}_0xe7e271['status'](_0x1f81ec)[_0xe723('0x2c')](_0x598f15);};}exports[_0xe723('0x2d')]=function(_0x335c66,_0x4d55cc){var _0x1edbb2={},_0x45e162={},_0x48a97a={'count':0x0,'rows':[]};var _0x3c8c56=_['map'](db['Cdr'][_0xe723('0x2e')],function(_0x2c2240){return{'name':_0x2c2240[_0xe723('0x2f')],'type':_0x2c2240[_0xe723('0x30')]['key']};});_0x45e162['model']=_[_0xe723('0x31')](_0x3c8c56,'name');_0x45e162[_0xe723('0x32')]=_[_0xe723('0x33')](_0x335c66[_0xe723('0x32')]);_0x45e162[_0xe723('0x34')]=_[_0xe723('0x35')](_0x45e162[_0xe723('0x36')],_0x45e162[_0xe723('0x32')]);_0x1edbb2[_0xe723('0x37')]=_[_0xe723('0x35')](_0x45e162[_0xe723('0x36')],qs[_0xe723('0x38')](_0x335c66[_0xe723('0x32')][_0xe723('0x38')]));_0x1edbb2[_0xe723('0x37')]=_0x1edbb2['attributes'][_0xe723('0x39')]?_0x1edbb2['attributes']:_0x45e162[_0xe723('0x36')];if(!_0x335c66[_0xe723('0x32')]['hasOwnProperty']('nolimit')){_0x1edbb2[_0xe723('0x20')]=qs[_0xe723('0x20')](_0x335c66[_0xe723('0x32')][_0xe723('0x20')]);_0x1edbb2[_0xe723('0x1e')]=qs[_0xe723('0x1e')](_0x335c66['query'][_0xe723('0x1e')]);}_0x1edbb2[_0xe723('0x3a')]=qs[_0xe723('0x3b')](_0x335c66[_0xe723('0x32')][_0xe723('0x3b')]);_0x1edbb2[_0xe723('0x3c')]=qs[_0xe723('0x34')](_[_0xe723('0x3d')](_0x335c66[_0xe723('0x32')],_0x45e162[_0xe723('0x34')]),_0x3c8c56);if(_0x335c66[_0xe723('0x32')][_0xe723('0x3e')]){_0x1edbb2[_0xe723('0x3c')]=_[_0xe723('0x3f')](_0x1edbb2[_0xe723('0x3c')],{'$or':_[_0xe723('0x31')](_0x3c8c56,function(_0x5c5027){if(_0x5c5027[_0xe723('0x30')]!==_0xe723('0x40')){var _0x68eda5={};_0x68eda5[_0x5c5027[_0xe723('0x2b')]]={'$like':'%'+_0x335c66['query']['filter']+'%'};return _0x68eda5;}})});}_0x1edbb2=_[_0xe723('0x3f')]({},_0x1edbb2,_0x335c66[_0xe723('0x41')]);var _0xc0c2c7={'where':_0x1edbb2[_0xe723('0x3c')]};return db['Cdr']['count'](_0xc0c2c7)[_0xe723('0x26')](function(_0x2f1618){_0x48a97a[_0xe723('0x21')]=_0x2f1618;if(_0x335c66[_0xe723('0x32')][_0xe723('0x42')]){_0x1edbb2[_0xe723('0x43')]=[{'all':!![]}];}return db[_0xe723('0x44')][_0xe723('0x45')](_0x1edbb2);})[_0xe723('0x26')](function(_0x5b0c89){_0x48a97a['rows']=_0x5b0c89;return _0x48a97a;})[_0xe723('0x26')](respondWithFilteredResult(_0x4d55cc,_0x1edbb2))['catch'](handleError(_0x4d55cc,null));};exports['show']=function(_0x18f4a1,_0x55530b){var _0x36272={'raw':!![],'where':{'id':_0x18f4a1[_0xe723('0x46')]['id']}},_0x42bd2f={};_0x42bd2f[_0xe723('0x36')]=_[_0xe723('0x33')](db[_0xe723('0x44')][_0xe723('0x2e')]);_0x42bd2f['query']=_['keys'](_0x18f4a1[_0xe723('0x32')]);_0x42bd2f['filters']=_[_0xe723('0x35')](_0x42bd2f['model'],_0x42bd2f[_0xe723('0x32')]);_0x36272[_0xe723('0x37')]=_[_0xe723('0x35')](_0x42bd2f[_0xe723('0x36')],qs[_0xe723('0x38')](_0x18f4a1[_0xe723('0x32')][_0xe723('0x38')]));_0x36272[_0xe723('0x37')]=_0x36272[_0xe723('0x37')]['length']?_0x36272['attributes']:_0x42bd2f[_0xe723('0x36')];if(_0x18f4a1[_0xe723('0x32')][_0xe723('0x42')]){_0x36272['include']=[{'all':!![]}];}_0x36272=_['merge']({},_0x36272,_0x18f4a1['options']);return db[_0xe723('0x44')][_0xe723('0x47')](_0x36272)[_0xe723('0x26')](handleEntityNotFound(_0x55530b,null))['then'](respondWithResult(_0x55530b,null))[_0xe723('0x48')](handleError(_0x55530b,null));};exports[_0xe723('0x49')]=function(_0x1cb2b2,_0x38bd1a){return db[_0xe723('0x44')]['create'](_0x1cb2b2[_0xe723('0x4a')],{})['then'](respondWithResult(_0x38bd1a,0xc9))[_0xe723('0x48')](handleError(_0x38bd1a,null));};exports['update']=function(_0x52f42e,_0x1590fe){if(_0x52f42e[_0xe723('0x4a')]['id']){delete _0x52f42e[_0xe723('0x4a')]['id'];}return db['Cdr'][_0xe723('0x47')]({'where':{'id':_0x52f42e['params']['id']}})[_0xe723('0x26')](handleEntityNotFound(_0x1590fe,null))[_0xe723('0x26')](saveUpdates(_0x52f42e[_0xe723('0x4a')],null))[_0xe723('0x26')](respondWithResult(_0x1590fe,null))[_0xe723('0x48')](handleError(_0x1590fe,null));};exports[_0xe723('0x27')]=function(_0x41e1c4,_0x16cb50){return db[_0xe723('0x44')]['find']({'where':{'id':_0x41e1c4[_0xe723('0x46')]['id']}})[_0xe723('0x26')](handleEntityNotFound(_0x16cb50,null))['then'](removeEntity(_0x16cb50,null))[_0xe723('0x48')](handleError(_0x16cb50,null));};exports[_0xe723('0x4b')]=function(_0x56e92a,_0x126ca5){return db['Cdr']['describe']()[_0xe723('0x26')](respondWithResult(_0x126ca5,null))[_0xe723('0x48')](handleError(_0x126ca5,null));}; \ No newline at end of file +var _0x4074=['params','rawAttributes','intersection','include','find','catch','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','Content-Range','apply','save','update','destroy','error','stack','name','index','fieldName','type','key','model','map','query','keys','attributes','fields','length','nolimit','order','sort','filters','filter','merge','where','VIRTUAL','options','Cdr','then','includeAll','findAll','rows','show'];(function(_0x474206,_0x19f660){var _0xd15ae9=function(_0x314cad){while(--_0x314cad){_0x474206['push'](_0x474206['shift']());}};_0xd15ae9(++_0x19f660);}(_0x4074,0xf0));var _0x4407=function(_0x1d5b11,_0x2fd422){_0x1d5b11=_0x1d5b11-0x0;var _0x9ef9c=_0x4074[_0x1d5b11];return _0x9ef9c;};'use strict';var emlformat=require(_0x4407('0x0'));var rimraf=require(_0x4407('0x1'));var zipdir=require(_0x4407('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4407('0x3'));var moment=require(_0x4407('0x4'));var BPromise=require(_0x4407('0x5'));var Mustache=require(_0x4407('0x6'));var util=require(_0x4407('0x7'));var path=require(_0x4407('0x8'));var sox=require(_0x4407('0x9'));var csv=require(_0x4407('0xa'));var ejs=require(_0x4407('0xb'));var fs=require('fs');var fs_extra=require(_0x4407('0xc'));var _=require('lodash');var squel=require(_0x4407('0xd'));var crypto=require('crypto');var jsforce=require(_0x4407('0xe'));var deskjs=require(_0x4407('0xf'));var toCsv=require(_0x4407('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4407('0x10'));var qs=require(_0x4407('0x11'));var as=require(_0x4407('0x12'));var hardwareService=require(_0x4407('0x13'));var logger=require(_0x4407('0x14'))(_0x4407('0x15'));var utils=require(_0x4407('0x16'));var config=require(_0x4407('0x17'));var licenseUtil=require(_0x4407('0x18'));var db=require(_0x4407('0x19'))['db'];function respondWithStatusCode(_0x14f398,_0x5d0c41){_0x5d0c41=_0x5d0c41||0xcc;return function(_0x3f8f23){if(_0x3f8f23){return _0x14f398[_0x4407('0x1a')](_0x5d0c41);}return _0x14f398['status'](_0x5d0c41)[_0x4407('0x1b')]();};}function respondWithResult(_0x4c62b9,_0x1d2ec8){_0x1d2ec8=_0x1d2ec8||0xc8;return function(_0x27724a){if(_0x27724a){return _0x4c62b9[_0x4407('0x1c')](_0x1d2ec8)[_0x4407('0x1d')](_0x27724a);}};}function respondWithFilteredResult(_0x1840dd,_0x417e19){return function(_0x1c5a0c){if(_0x1c5a0c){var _0x2e709f=typeof _0x417e19['offset']===_0x4407('0x1e')&&typeof _0x417e19[_0x4407('0x1f')]===_0x4407('0x1e');var _0x367d55=_0x1c5a0c[_0x4407('0x20')];var _0x5b50b7=_0x2e709f?0x0:_0x417e19[_0x4407('0x21')];var _0x54caa1=_0x2e709f?_0x1c5a0c[_0x4407('0x20')]:_0x417e19[_0x4407('0x21')]+_0x417e19[_0x4407('0x1f')];var _0x2db8b2;if(_0x54caa1>=_0x367d55){_0x54caa1=_0x367d55;_0x2db8b2=0xc8;}else{_0x2db8b2=0xce;}_0x1840dd[_0x4407('0x1c')](_0x2db8b2);return _0x1840dd['set'](_0x4407('0x22'),_0x5b50b7+'-'+_0x54caa1+'/'+_0x367d55)['json'](_0x1c5a0c);}return null;};}function patchUpdates(_0x36a948){return function(_0x28bb2c){try{jsonpatch[_0x4407('0x23')](_0x28bb2c,_0x36a948,!![]);}catch(_0x445fe6){return BPromise['reject'](_0x445fe6);}return _0x28bb2c[_0x4407('0x24')]();};}function saveUpdates(_0x1fa9f1,_0x137f8e){return function(_0x2c880a){if(_0x2c880a){return _0x2c880a[_0x4407('0x25')](_0x1fa9f1)['then'](function(_0xa7265d){return _0xa7265d;});}return null;};}function removeEntity(_0x16272f,_0x5e214c){return function(_0x21b048){if(_0x21b048){return _0x21b048[_0x4407('0x26')]()['then'](function(){_0x16272f[_0x4407('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x309274,_0x5386f4){return function(_0x40fb1e){if(!_0x40fb1e){_0x309274['sendStatus'](0x194);}return _0x40fb1e;};}function handleError(_0x374754,_0x4bf227){_0x4bf227=_0x4bf227||0x1f4;return function(_0x57ba27){logger[_0x4407('0x27')](_0x57ba27[_0x4407('0x28')]);if(_0x57ba27[_0x4407('0x29')]){delete _0x57ba27['name'];}_0x374754['status'](_0x4bf227)['send'](_0x57ba27);};}exports[_0x4407('0x2a')]=function(_0x2feb6b,_0x1f9828){var _0x84a8a={},_0x1d6b3d={},_0x37fba1={'count':0x0,'rows':[]};var _0x182bd9=_['map'](db['Cdr']['rawAttributes'],function(_0x28e99e){return{'name':_0x28e99e[_0x4407('0x2b')],'type':_0x28e99e[_0x4407('0x2c')][_0x4407('0x2d')]};});_0x1d6b3d[_0x4407('0x2e')]=_[_0x4407('0x2f')](_0x182bd9,_0x4407('0x29'));_0x1d6b3d[_0x4407('0x30')]=_[_0x4407('0x31')](_0x2feb6b[_0x4407('0x30')]);_0x1d6b3d['filters']=_['intersection'](_0x1d6b3d[_0x4407('0x2e')],_0x1d6b3d[_0x4407('0x30')]);_0x84a8a[_0x4407('0x32')]=_['intersection'](_0x1d6b3d[_0x4407('0x2e')],qs[_0x4407('0x33')](_0x2feb6b[_0x4407('0x30')][_0x4407('0x33')]));_0x84a8a[_0x4407('0x32')]=_0x84a8a['attributes'][_0x4407('0x34')]?_0x84a8a['attributes']:_0x1d6b3d[_0x4407('0x2e')];if(!_0x2feb6b['query']['hasOwnProperty'](_0x4407('0x35'))){_0x84a8a[_0x4407('0x1f')]=qs[_0x4407('0x1f')](_0x2feb6b[_0x4407('0x30')][_0x4407('0x1f')]);_0x84a8a[_0x4407('0x21')]=qs[_0x4407('0x21')](_0x2feb6b['query'][_0x4407('0x21')]);}_0x84a8a[_0x4407('0x36')]=qs[_0x4407('0x37')](_0x2feb6b[_0x4407('0x30')][_0x4407('0x37')]);_0x84a8a['where']=qs[_0x4407('0x38')](_['pick'](_0x2feb6b[_0x4407('0x30')],_0x1d6b3d[_0x4407('0x38')]),_0x182bd9);if(_0x2feb6b[_0x4407('0x30')][_0x4407('0x39')]){_0x84a8a['where']=_[_0x4407('0x3a')](_0x84a8a[_0x4407('0x3b')],{'$or':_[_0x4407('0x2f')](_0x182bd9,function(_0x1bf4e2){if(_0x1bf4e2[_0x4407('0x2c')]!==_0x4407('0x3c')){var _0x30de66={};_0x30de66[_0x1bf4e2[_0x4407('0x29')]]={'$like':'%'+_0x2feb6b[_0x4407('0x30')]['filter']+'%'};return _0x30de66;}})});}_0x84a8a=_['merge']({},_0x84a8a,_0x2feb6b[_0x4407('0x3d')]);var _0xc47d0e={'where':_0x84a8a[_0x4407('0x3b')]};return db[_0x4407('0x3e')]['count'](_0xc47d0e)[_0x4407('0x3f')](function(_0x2cb65e){_0x37fba1[_0x4407('0x20')]=_0x2cb65e;if(_0x2feb6b['query'][_0x4407('0x40')]){_0x84a8a['include']=[{'all':!![]}];}return db['Cdr'][_0x4407('0x41')](_0x84a8a);})[_0x4407('0x3f')](function(_0x234fa5){_0x37fba1[_0x4407('0x42')]=_0x234fa5;return _0x37fba1;})[_0x4407('0x3f')](respondWithFilteredResult(_0x1f9828,_0x84a8a))['catch'](handleError(_0x1f9828,null));};exports[_0x4407('0x43')]=function(_0xf79768,_0x819b8b){var _0x15ba7b={'raw':!![],'where':{'id':_0xf79768[_0x4407('0x44')]['id']}},_0x5b41cf={};_0x5b41cf[_0x4407('0x2e')]=_[_0x4407('0x31')](db[_0x4407('0x3e')][_0x4407('0x45')]);_0x5b41cf['query']=_[_0x4407('0x31')](_0xf79768['query']);_0x5b41cf['filters']=_[_0x4407('0x46')](_0x5b41cf[_0x4407('0x2e')],_0x5b41cf['query']);_0x15ba7b[_0x4407('0x32')]=_[_0x4407('0x46')](_0x5b41cf[_0x4407('0x2e')],qs[_0x4407('0x33')](_0xf79768['query'][_0x4407('0x33')]));_0x15ba7b[_0x4407('0x32')]=_0x15ba7b[_0x4407('0x32')][_0x4407('0x34')]?_0x15ba7b[_0x4407('0x32')]:_0x5b41cf['model'];if(_0xf79768[_0x4407('0x30')][_0x4407('0x40')]){_0x15ba7b[_0x4407('0x47')]=[{'all':!![]}];}_0x15ba7b=_[_0x4407('0x3a')]({},_0x15ba7b,_0xf79768[_0x4407('0x3d')]);return db['Cdr'][_0x4407('0x48')](_0x15ba7b)[_0x4407('0x3f')](handleEntityNotFound(_0x819b8b,null))[_0x4407('0x3f')](respondWithResult(_0x819b8b,null))[_0x4407('0x49')](handleError(_0x819b8b,null));};exports['create']=function(_0x18ff16,_0x2b18b8){return db['Cdr'][_0x4407('0x4a')](_0x18ff16[_0x4407('0x4b')],{})['then'](respondWithResult(_0x2b18b8,0xc9))[_0x4407('0x49')](handleError(_0x2b18b8,null));};exports[_0x4407('0x25')]=function(_0x5ea36,_0x4fbc1f){if(_0x5ea36[_0x4407('0x4b')]['id']){delete _0x5ea36['body']['id'];}return db['Cdr'][_0x4407('0x48')]({'where':{'id':_0x5ea36[_0x4407('0x44')]['id']}})['then'](handleEntityNotFound(_0x4fbc1f,null))[_0x4407('0x3f')](saveUpdates(_0x5ea36[_0x4407('0x4b')],null))[_0x4407('0x3f')](respondWithResult(_0x4fbc1f,null))[_0x4407('0x49')](handleError(_0x4fbc1f,null));};exports[_0x4407('0x26')]=function(_0x5a2c2b,_0x39865e){return db[_0x4407('0x3e')][_0x4407('0x48')]({'where':{'id':_0x5a2c2b[_0x4407('0x44')]['id']}})[_0x4407('0x3f')](handleEntityNotFound(_0x39865e,null))[_0x4407('0x3f')](removeEntity(_0x39865e,null))[_0x4407('0x49')](handleError(_0x39865e,null));};exports[_0x4407('0x4c')]=function(_0xd1dd66,_0x55f0ef){return db[_0x4407('0x3e')]['describe']()[_0x4407('0x3f')](respondWithResult(_0x55f0ef,null))[_0x4407('0x49')](handleError(_0x55f0ef,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 4af4241..b19fc1f 100644 --- a/server/api/cdr/cdr.model.js +++ b/server/api/cdr/cdr.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x5ba705,_0x4d0557){var _0x4d7501=function(_0x29c5c7){while(--_0x29c5c7){_0x5ba705['push'](_0x5ba705['shift']());}};_0x4d7501(++_0x4d0557);}(_0x7a54,0x106));var _0x47a5=function(_0x440976,_0x46064c){_0x440976=_0x440976-0x0;var _0x2e4117=_0x7a54[_0x440976];return _0x2e4117;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file +var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x407313,_0x2f01e8){var _0x1c2d7c=function(_0x208c7f){while(--_0x208c7f){_0x407313['push'](_0x407313['shift']());}};_0x1c2d7c(++_0x2f01e8);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 12d2a0b..d377d9c 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 _0x61de=['Cdr,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3929c4,_0x36f17c){var _0x473ff9=function(_0x63d4da){while(--_0x63d4da){_0x3929c4['push'](_0x3929c4['shift']());}};_0x473ff9(++_0x36f17c);}(_0x61de,0x1e8));var _0xe61d=function(_0xe66cf2,_0x32ba5f){_0xe66cf2=_0xe66cf2-0x0;var _0x2d84e7=_0x61de[_0xe66cf2];return _0x2d84e7;};'use strict';var _=require(_0xe61d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xe61d('0x1'));var rs=require(_0xe61d('0x2'));var fs=require('fs');var Redis=require(_0xe61d('0x3'));var db=require(_0xe61d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe61d('0x5'))(_0xe61d('0x6'));var config=require(_0xe61d('0x7'));var jayson=require(_0xe61d('0x8'));var client=jayson[_0xe61d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1e8b71,_0x544313,_0x338f96){return new BPromise(function(_0x304ff7,_0x57f0b){return client[_0xe61d('0xa')](_0x1e8b71,_0x338f96)[_0xe61d('0xb')](function(_0x6729cb){logger[_0xe61d('0xc')](_0xe61d('0xd'),_0x544313,_0xe61d('0xe'));logger[_0xe61d('0xf')](_0xe61d('0x10'),_0x544313,_0xe61d('0xe'),JSON['stringify'](_0x6729cb));if(_0x6729cb[_0xe61d('0x11')]){if(_0x6729cb[_0xe61d('0x11')]['code']===0x1f4){logger[_0xe61d('0x11')](_0xe61d('0xd'),_0x544313,_0x6729cb[_0xe61d('0x11')][_0xe61d('0x12')]);return _0x57f0b(_0x6729cb[_0xe61d('0x11')][_0xe61d('0x12')]);}logger['error'](_0xe61d('0xd'),_0x544313,_0x6729cb[_0xe61d('0x11')][_0xe61d('0x12')]);return _0x304ff7(_0x6729cb[_0xe61d('0x11')][_0xe61d('0x12')]);}else{logger[_0xe61d('0xc')](_0xe61d('0xd'),_0x544313,_0xe61d('0xe'));_0x304ff7(_0x6729cb[_0xe61d('0x13')][_0xe61d('0x12')]);}})[_0xe61d('0x14')](function(_0x419d5c){logger['error'](_0xe61d('0xd'),_0x544313,_0x419d5c);_0x57f0b(_0x419d5c);});});} \ No newline at end of file +var _0x7548=['ioredis','../../mysqldb','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','stringify','error','message','lodash','util','bluebird','randomstring'];(function(_0x2899b6,_0x3bce12){var _0x46fb7e=function(_0x28e8a3){while(--_0x28e8a3){_0x2899b6['push'](_0x2899b6['shift']());}};_0x46fb7e(++_0x3bce12);}(_0x7548,0x137));var _0x8754=function(_0x2e5f73,_0x43fa11){_0x2e5f73=_0x2e5f73-0x0;var _0x2daba0=_0x7548[_0x2e5f73];return _0x2daba0;};'use strict';var _=require(_0x8754('0x0'));var util=require(_0x8754('0x1'));var moment=require('moment');var BPromise=require(_0x8754('0x2'));var rs=require(_0x8754('0x3'));var fs=require('fs');var Redis=require(_0x8754('0x4'));var db=require(_0x8754('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8754('0x6'));var config=require(_0x8754('0x7'));var jayson=require(_0x8754('0x8'));var client=jayson[_0x8754('0x9')][_0x8754('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1b7223,_0x348926,_0x2c29ef){return new BPromise(function(_0x112d7d,_0x3d1ceb){return client[_0x8754('0xb')](_0x1b7223,_0x2c29ef)[_0x8754('0xc')](function(_0x409649){logger[_0x8754('0xd')](_0x8754('0xe'),_0x348926,_0x8754('0xf'));logger[_0x8754('0x10')](_0x8754('0x11'),_0x348926,_0x8754('0xf'),JSON[_0x8754('0x12')](_0x409649));if(_0x409649[_0x8754('0x13')]){if(_0x409649[_0x8754('0x13')]['code']===0x1f4){logger[_0x8754('0x13')]('Cdr,\x20%s,\x20%s',_0x348926,_0x409649[_0x8754('0x13')]['message']);return _0x3d1ceb(_0x409649['error'][_0x8754('0x14')]);}logger[_0x8754('0x13')](_0x8754('0xe'),_0x348926,_0x409649['error']['message']);return _0x112d7d(_0x409649[_0x8754('0x13')][_0x8754('0x14')]);}else{logger[_0x8754('0xd')](_0x8754('0xe'),_0x348926,_0x8754('0xf'));_0x112d7d(_0x409649['result'][_0x8754('0x14')]);}})['catch'](function(_0x4f634e){logger[_0x8754('0x13')]('Cdr,\x20%s,\x20%s',_0x348926,_0x4f634e);_0x3d1ceb(_0x4f634e);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index b7d45e7..059e3ef 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(_0x45937f,_0x256a25){var _0x5bf5d1=function(_0x4300bd){while(--_0x4300bd){_0x45937f['push'](_0x45937f['shift']());}};_0x5bf5d1(++_0x256a25);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +var _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(_0x295811,_0x2825f4){var _0x147146=function(_0x939636){while(--_0x939636){_0x295811['push'](_0x295811['shift']());}};_0x147146(++_0x2825f4);}(_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 20097ea..6effafd 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 _0x4c4f=['noop','TEXT','*,*,*,*','sequelize','exports','STRING'];(function(_0x1bc66e,_0x21ade8){var _0x409dd5=function(_0x197d69){while(--_0x197d69){_0x1bc66e['push'](_0x1bc66e['shift']());}};_0x409dd5(++_0x21ade8);}(_0x4c4f,0x1e9));var _0xf4c4=function(_0x2b38d0,_0x425d79){_0x2b38d0=_0x2b38d0-0x0;var _0xcc9c29=_0x4c4f[_0x2b38d0];return _0xcc9c29;};'use strict';var Sequelize=require(_0xf4c4('0x0'));module[_0xf4c4('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xf4c4('0x2')],'allowNull':![],'defaultValue':_0xf4c4('0x3')},'appdata':{'type':Sequelize[_0xf4c4('0x4')]()},'description':{'type':Sequelize[_0xf4c4('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xf4c4('0x5')}}; \ No newline at end of file +var _0xc880=['STRING','noop','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xc880,0x1ee));var _0x0c88=function(_0x5ab0fa,_0x12ee6e){_0x5ab0fa=_0x5ab0fa-0x0;var _0x1db0d9=_0xc880[_0x5ab0fa];return _0x1db0d9;};'use strict';var Sequelize=require(_0x0c88('0x0'));module[_0x0c88('0x1')]={'priority':{'type':Sequelize[_0x0c88('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x0c88('0x3')],'allowNull':![],'defaultValue':_0x0c88('0x4')},'appdata':{'type':Sequelize[_0x0c88('0x5')]()},'description':{'type':Sequelize[_0x0c88('0x3')]},'interval':{'type':Sequelize[_0x0c88('0x3')],'defaultValue':_0x0c88('0x6')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 5bb62ba..a8f0f4c 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 _0x3f8c=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','Content-Range','reject','save','update','then','error','stack','name','send','show','model','ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','length','include','merge','options','find','catch','body','params','destroy','zip-dir','fast-json-patch','request-promise','moment','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x48accc,_0x3142e9){var _0x460cc4=function(_0x4af897){while(--_0x4af897){_0x48accc['push'](_0x48accc['shift']());}};_0x460cc4(++_0x3142e9);}(_0x3f8c,0x104));var _0xc3f8=function(_0x14c72c,_0x4812da){_0x14c72c=_0x14c72c-0x0;var _0xf9dec8=_0x3f8c[_0x14c72c];return _0xf9dec8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc3f8('0x0'));var jsonpatch=require(_0xc3f8('0x1'));var rp=require(_0xc3f8('0x2'));var moment=require(_0xc3f8('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xc3f8('0x4'));var ejs=require(_0xc3f8('0x5'));var fs=require('fs');var fs_extra=require(_0xc3f8('0x6'));var _=require(_0xc3f8('0x7'));var squel=require(_0xc3f8('0x8'));var crypto=require(_0xc3f8('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xc3f8('0xa'));var toCsv=require(_0xc3f8('0x4'));var querystring=require(_0xc3f8('0xb'));var Papa=require(_0xc3f8('0xc'));var Redis=require(_0xc3f8('0xd'));var authService=require(_0xc3f8('0xe'));var qs=require(_0xc3f8('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc3f8('0x10'));var logger=require(_0xc3f8('0x11'))(_0xc3f8('0x12'));var utils=require(_0xc3f8('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xc3f8('0x14'));var db=require(_0xc3f8('0x15'))['db'];function respondWithStatusCode(_0x256e3d,_0x155c80){_0x155c80=_0x155c80||0xcc;return function(_0x511763){if(_0x511763){return _0x256e3d[_0xc3f8('0x16')](_0x155c80);}return _0x256e3d[_0xc3f8('0x17')](_0x155c80)[_0xc3f8('0x18')]();};}function respondWithResult(_0x44632a,_0x6155e9){_0x6155e9=_0x6155e9||0xc8;return function(_0x47754c){if(_0x47754c){return _0x44632a[_0xc3f8('0x17')](_0x6155e9)[_0xc3f8('0x19')](_0x47754c);}};}function respondWithFilteredResult(_0x12b141,_0x2fd8e8){return function(_0x3cb28a){if(_0x3cb28a){var _0x2a9f64=typeof _0x2fd8e8[_0xc3f8('0x1a')]==='undefined'&&typeof _0x2fd8e8[_0xc3f8('0x1b')]==='undefined';var _0x51807b=_0x3cb28a[_0xc3f8('0x1c')];var _0x2e7c0f=_0x2a9f64?0x0:_0x2fd8e8[_0xc3f8('0x1a')];var _0xb4ab67=_0x2a9f64?_0x3cb28a['count']:_0x2fd8e8[_0xc3f8('0x1a')]+_0x2fd8e8[_0xc3f8('0x1b')];var _0x5df6f9;if(_0xb4ab67>=_0x51807b){_0xb4ab67=_0x51807b;_0x5df6f9=0xc8;}else{_0x5df6f9=0xce;}_0x12b141[_0xc3f8('0x17')](_0x5df6f9);return _0x12b141['set'](_0xc3f8('0x1d'),_0x2e7c0f+'-'+_0xb4ab67+'/'+_0x51807b)[_0xc3f8('0x19')](_0x3cb28a);}return null;};}function patchUpdates(_0x3b2e98){return function(_0x53ada5){try{jsonpatch['apply'](_0x53ada5,_0x3b2e98,!![]);}catch(_0x113cd2){return BPromise[_0xc3f8('0x1e')](_0x113cd2);}return _0x53ada5[_0xc3f8('0x1f')]();};}function saveUpdates(_0x25a4c7,_0x6522e9){return function(_0x251bf7){if(_0x251bf7){return _0x251bf7[_0xc3f8('0x20')](_0x25a4c7)[_0xc3f8('0x21')](function(_0x49aeea){return _0x49aeea;});}return null;};}function removeEntity(_0x571f92,_0x4b83f0){return function(_0x2559a4){if(_0x2559a4){return _0x2559a4['destroy']()[_0xc3f8('0x21')](function(){_0x571f92[_0xc3f8('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4569c2,_0x327b2d){return function(_0x2d237e){if(!_0x2d237e){_0x4569c2[_0xc3f8('0x16')](0x194);}return _0x2d237e;};}function handleError(_0x25088f,_0x9d43b4){_0x9d43b4=_0x9d43b4||0x1f4;return function(_0xf1d460){logger[_0xc3f8('0x22')](_0xf1d460[_0xc3f8('0x23')]);if(_0xf1d460[_0xc3f8('0x24')]){delete _0xf1d460[_0xc3f8('0x24')];}_0x25088f[_0xc3f8('0x17')](_0x9d43b4)[_0xc3f8('0x25')](_0xf1d460);};}exports[_0xc3f8('0x26')]=function(_0x59e4dd,_0x58b303){var _0x2909f8={'raw':!![],'where':{'id':_0x59e4dd['params']['id']}},_0x218029={};_0x218029[_0xc3f8('0x27')]=_['keys'](db[_0xc3f8('0x28')][_0xc3f8('0x29')]);_0x218029['query']=_['keys'](_0x59e4dd[_0xc3f8('0x2a')]);_0x218029[_0xc3f8('0x2b')]=_[_0xc3f8('0x2c')](_0x218029[_0xc3f8('0x27')],_0x218029[_0xc3f8('0x2a')]);_0x2909f8[_0xc3f8('0x2d')]=_[_0xc3f8('0x2c')](_0x218029[_0xc3f8('0x27')],qs[_0xc3f8('0x2e')](_0x59e4dd[_0xc3f8('0x2a')]['fields']));_0x2909f8[_0xc3f8('0x2d')]=_0x2909f8[_0xc3f8('0x2d')][_0xc3f8('0x2f')]?_0x2909f8[_0xc3f8('0x2d')]:_0x218029[_0xc3f8('0x27')];if(_0x59e4dd['query']['includeAll']){_0x2909f8[_0xc3f8('0x30')]=[{'all':!![]}];}_0x2909f8=_[_0xc3f8('0x31')]({},_0x2909f8,_0x59e4dd[_0xc3f8('0x32')]);return db[_0xc3f8('0x28')][_0xc3f8('0x33')](_0x2909f8)['then'](handleEntityNotFound(_0x58b303,null))[_0xc3f8('0x21')](respondWithResult(_0x58b303,null))[_0xc3f8('0x34')](handleError(_0x58b303,null));};exports[_0xc3f8('0x20')]=function(_0x5a72c1,_0x213c00){if(_0x5a72c1[_0xc3f8('0x35')]['id']){delete _0x5a72c1[_0xc3f8('0x35')]['id'];}return db['ChatApplication'][_0xc3f8('0x33')]({'where':{'id':_0x5a72c1[_0xc3f8('0x36')]['id']}})['then'](handleEntityNotFound(_0x213c00,null))[_0xc3f8('0x21')](saveUpdates(_0x5a72c1[_0xc3f8('0x35')],null))[_0xc3f8('0x21')](respondWithResult(_0x213c00,null))[_0xc3f8('0x34')](handleError(_0x213c00,null));};exports[_0xc3f8('0x37')]=function(_0x1fddc7,_0x48bc0e){return db[_0xc3f8('0x28')][_0xc3f8('0x33')]({'where':{'id':_0x1fddc7[_0xc3f8('0x36')]['id']}})[_0xc3f8('0x21')](handleEntityNotFound(_0x48bc0e,null))[_0xc3f8('0x21')](removeEntity(_0x48bc0e,null))['catch'](handleError(_0x48bc0e,null));}; \ No newline at end of file +var _0xd3a8=['limit','count','Content-Range','json','apply','save','then','destroy','error','stack','send','show','params','model','keys','rawAttributes','query','filters','attributes','fields','length','includeAll','merge','options','ChatApplication','find','catch','update','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','end','status','offset'];(function(_0x3119b6,_0x4f596e){var _0x12aff0=function(_0x44e446){while(--_0x44e446){_0x3119b6['push'](_0x3119b6['shift']());}};_0x12aff0(++_0x4f596e);}(_0xd3a8,0x135));var _0x8d3a=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xd3a8[_0x465a0c];return _0x1e202e;};'use strict';var emlformat=require(_0x8d3a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8d3a('0x1'));var jsonpatch=require(_0x8d3a('0x2'));var rp=require(_0x8d3a('0x3'));var moment=require(_0x8d3a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8d3a('0x5'));var util=require(_0x8d3a('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8d3a('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8d3a('0x8'));var crypto=require(_0x8d3a('0x9'));var jsforce=require(_0x8d3a('0xa'));var deskjs=require(_0x8d3a('0xb'));var toCsv=require(_0x8d3a('0xc'));var querystring=require(_0x8d3a('0xd'));var Papa=require(_0x8d3a('0xe'));var Redis=require(_0x8d3a('0xf'));var authService=require(_0x8d3a('0x10'));var qs=require(_0x8d3a('0x11'));var as=require(_0x8d3a('0x12'));var hardwareService=require(_0x8d3a('0x13'));var logger=require(_0x8d3a('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x8d3a('0x15'));var db=require(_0x8d3a('0x16'))['db'];function respondWithStatusCode(_0xc834ec,_0x43b1ca){_0x43b1ca=_0x43b1ca||0xcc;return function(_0x4759cd){if(_0x4759cd){return _0xc834ec[_0x8d3a('0x17')](_0x43b1ca);}return _0xc834ec['status'](_0x43b1ca)[_0x8d3a('0x18')]();};}function respondWithResult(_0xb66692,_0x5c6ed1){_0x5c6ed1=_0x5c6ed1||0xc8;return function(_0x4c11b3){if(_0x4c11b3){return _0xb66692[_0x8d3a('0x19')](_0x5c6ed1)['json'](_0x4c11b3);}};}function respondWithFilteredResult(_0x14db8,_0x4225d9){return function(_0x10f582){if(_0x10f582){var _0x4c915d=typeof _0x4225d9[_0x8d3a('0x1a')]==='undefined'&&typeof _0x4225d9[_0x8d3a('0x1b')]==='undefined';var _0x3217a2=_0x10f582[_0x8d3a('0x1c')];var _0xb24d92=_0x4c915d?0x0:_0x4225d9['offset'];var _0x499f25=_0x4c915d?_0x10f582[_0x8d3a('0x1c')]:_0x4225d9[_0x8d3a('0x1a')]+_0x4225d9[_0x8d3a('0x1b')];var _0x3478ee;if(_0x499f25>=_0x3217a2){_0x499f25=_0x3217a2;_0x3478ee=0xc8;}else{_0x3478ee=0xce;}_0x14db8[_0x8d3a('0x19')](_0x3478ee);return _0x14db8['set'](_0x8d3a('0x1d'),_0xb24d92+'-'+_0x499f25+'/'+_0x3217a2)[_0x8d3a('0x1e')](_0x10f582);}return null;};}function patchUpdates(_0x3dc3c1){return function(_0xd390c2){try{jsonpatch[_0x8d3a('0x1f')](_0xd390c2,_0x3dc3c1,!![]);}catch(_0x1b562b){return BPromise['reject'](_0x1b562b);}return _0xd390c2[_0x8d3a('0x20')]();};}function saveUpdates(_0x3ca6a9,_0x46fcf1){return function(_0x412126){if(_0x412126){return _0x412126['update'](_0x3ca6a9)[_0x8d3a('0x21')](function(_0x2187dd){return _0x2187dd;});}return null;};}function removeEntity(_0x246275,_0x53916d){return function(_0x10b997){if(_0x10b997){return _0x10b997[_0x8d3a('0x22')]()[_0x8d3a('0x21')](function(){_0x246275[_0x8d3a('0x19')](0xcc)[_0x8d3a('0x18')]();});}};}function handleEntityNotFound(_0xb9ba91,_0x3bff9e){return function(_0x4f6551){if(!_0x4f6551){_0xb9ba91[_0x8d3a('0x17')](0x194);}return _0x4f6551;};}function handleError(_0x4749d6,_0x2204a7){_0x2204a7=_0x2204a7||0x1f4;return function(_0x45451e){logger[_0x8d3a('0x23')](_0x45451e[_0x8d3a('0x24')]);if(_0x45451e['name']){delete _0x45451e['name'];}_0x4749d6[_0x8d3a('0x19')](_0x2204a7)[_0x8d3a('0x25')](_0x45451e);};}exports[_0x8d3a('0x26')]=function(_0x2ab876,_0x1c6ff6){var _0x24e990={'raw':!![],'where':{'id':_0x2ab876[_0x8d3a('0x27')]['id']}},_0x497328={};_0x497328[_0x8d3a('0x28')]=_[_0x8d3a('0x29')](db['ChatApplication'][_0x8d3a('0x2a')]);_0x497328[_0x8d3a('0x2b')]=_[_0x8d3a('0x29')](_0x2ab876['query']);_0x497328[_0x8d3a('0x2c')]=_['intersection'](_0x497328[_0x8d3a('0x28')],_0x497328[_0x8d3a('0x2b')]);_0x24e990[_0x8d3a('0x2d')]=_['intersection'](_0x497328[_0x8d3a('0x28')],qs['fields'](_0x2ab876['query'][_0x8d3a('0x2e')]));_0x24e990[_0x8d3a('0x2d')]=_0x24e990['attributes'][_0x8d3a('0x2f')]?_0x24e990['attributes']:_0x497328['model'];if(_0x2ab876[_0x8d3a('0x2b')][_0x8d3a('0x30')]){_0x24e990['include']=[{'all':!![]}];}_0x24e990=_[_0x8d3a('0x31')]({},_0x24e990,_0x2ab876[_0x8d3a('0x32')]);return db[_0x8d3a('0x33')][_0x8d3a('0x34')](_0x24e990)[_0x8d3a('0x21')](handleEntityNotFound(_0x1c6ff6,null))[_0x8d3a('0x21')](respondWithResult(_0x1c6ff6,null))[_0x8d3a('0x35')](handleError(_0x1c6ff6,null));};exports[_0x8d3a('0x36')]=function(_0x4569ca,_0x17aa45){if(_0x4569ca['body']['id']){delete _0x4569ca[_0x8d3a('0x37')]['id'];}return db[_0x8d3a('0x33')]['find']({'where':{'id':_0x4569ca['params']['id']}})[_0x8d3a('0x21')](handleEntityNotFound(_0x17aa45,null))[_0x8d3a('0x21')](saveUpdates(_0x4569ca[_0x8d3a('0x37')],null))['then'](respondWithResult(_0x17aa45,null))[_0x8d3a('0x35')](handleError(_0x17aa45,null));};exports[_0x8d3a('0x22')]=function(_0x50d381,_0x3d3250){return db[_0x8d3a('0x33')][_0x8d3a('0x34')]({'where':{'id':_0x50d381[_0x8d3a('0x27')]['id']}})[_0x8d3a('0x21')](handleEntityNotFound(_0x3d3250,null))[_0x8d3a('0x21')](removeEntity(_0x3d3250,null))['catch'](handleError(_0x3d3250,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index bfb95d8..f850727 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 _0x19cf=['define','ChatApplication','chat_applications','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','path','../../config/environment','exports'];(function(_0x4f5b67,_0x3354df){var _0x53ee0a=function(_0x4abb49){while(--_0x4abb49){_0x4f5b67['push'](_0x4f5b67['shift']());}};_0x53ee0a(++_0x3354df);}(_0x19cf,0x124));var _0xf19c=function(_0x299166,_0x5715d8){_0x299166=_0x299166-0x0;var _0x3bbf55=_0x19cf[_0x299166];return _0x3bbf55;};'use strict';var _=require(_0xf19c('0x0'));var util=require('util');var logger=require(_0xf19c('0x1'))(_0xf19c('0x2'));var moment=require(_0xf19c('0x3'));var BPromise=require(_0xf19c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf19c('0x5'));var rimraf=require('rimraf');var config=require(_0xf19c('0x6'));var attributes=require('./chatApplication.attributes');module[_0xf19c('0x7')]=function(_0x550c9e,_0xd508e9){return _0x550c9e[_0xf19c('0x8')](_0xf19c('0x9'),attributes,{'tableName':_0xf19c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xf19c('0xb')});}; \ No newline at end of file +var _0x7be1=['bluebird','path','../../config/environment','./chatApplication.attributes','exports','define','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment'];(function(_0x1a0985,_0x2e7a69){var _0x18fb0d=function(_0x44c77d){while(--_0x44c77d){_0x1a0985['push'](_0x1a0985['shift']());}};_0x18fb0d(++_0x2e7a69);}(_0x7be1,0x98));var _0x17be=function(_0x38f5f8,_0xefe164){_0x38f5f8=_0x38f5f8-0x0;var _0x34e820=_0x7be1[_0x38f5f8];return _0x34e820;};'use strict';var _=require('lodash');var util=require(_0x17be('0x0'));var logger=require(_0x17be('0x1'))(_0x17be('0x2'));var moment=require(_0x17be('0x3'));var BPromise=require(_0x17be('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x17be('0x5'));var rimraf=require('rimraf');var config=require(_0x17be('0x6'));var attributes=require(_0x17be('0x7'));module[_0x17be('0x8')]=function(_0x108618,_0x4a9b31){return _0x108618[_0x17be('0x9')]('ChatApplication',attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x17be('0xa'),'collate':_0x17be('0xb')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index f813e3f..474c5d1 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 _0xce38=['debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','ChatApplication,\x20%s,\x20%s','request\x20sent'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0xce38,0x13c));var _0x8ce3=function(_0x3a081b,_0x516437){_0x3a081b=_0x3a081b-0x0;var _0xb166c4=_0xce38[_0x3a081b];return _0xb166c4;};'use strict';var _=require('lodash');var util=require(_0x8ce3('0x0'));var moment=require(_0x8ce3('0x1'));var BPromise=require(_0x8ce3('0x2'));var rs=require(_0x8ce3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8ce3('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8ce3('0x5'))(_0x8ce3('0x6'));var config=require(_0x8ce3('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8ce3('0x8')][_0x8ce3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x6df552,_0x53088a,_0x2dfbe8){return new BPromise(function(_0x4e569d,_0x18ca2c){return client[_0x8ce3('0xa')](_0x6df552,_0x2dfbe8)[_0x8ce3('0xb')](function(_0x5a0e2f){logger['info'](_0x8ce3('0xc'),_0x53088a,_0x8ce3('0xd'));logger[_0x8ce3('0xe')](_0x8ce3('0xf'),_0x53088a,_0x8ce3('0xd'),JSON[_0x8ce3('0x10')](_0x5a0e2f));if(_0x5a0e2f[_0x8ce3('0x11')]){if(_0x5a0e2f[_0x8ce3('0x11')][_0x8ce3('0x12')]===0x1f4){logger[_0x8ce3('0x11')](_0x8ce3('0xc'),_0x53088a,_0x5a0e2f[_0x8ce3('0x11')][_0x8ce3('0x13')]);return _0x18ca2c(_0x5a0e2f[_0x8ce3('0x11')]['message']);}logger[_0x8ce3('0x11')](_0x8ce3('0xc'),_0x53088a,_0x5a0e2f['error'][_0x8ce3('0x13')]);return _0x4e569d(_0x5a0e2f['error'][_0x8ce3('0x13')]);}else{logger[_0x8ce3('0x14')](_0x8ce3('0xc'),_0x53088a,_0x8ce3('0xd'));_0x4e569d(_0x5a0e2f[_0x8ce3('0x15')][_0x8ce3('0x13')]);}})['catch'](function(_0x27446d){logger[_0x8ce3('0x11')]('ChatApplication,\x20%s,\x20%s',_0x53088a,_0x27446d);_0x18ca2c(_0x27446d);});});} \ No newline at end of file +var _0xef03=['lodash','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatApplication,\x20%s,\x20%s','debug','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch'];(function(_0xa26908,_0x4abfbb){var _0x48b115=function(_0x12db7a){while(--_0x12db7a){_0xa26908['push'](_0xa26908['shift']());}};_0x48b115(++_0x4abfbb);}(_0xef03,0x150));var _0x3ef0=function(_0x288889,_0x208b44){_0x288889=_0x288889-0x0;var _0x18f361=_0xef03[_0x288889];return _0x18f361;};'use strict';var _=require(_0x3ef0('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3ef0('0x1'));var rs=require(_0x3ef0('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3ef0('0x3'))['db'];var utils=require(_0x3ef0('0x4'));var logger=require('../../config/logger')(_0x3ef0('0x5'));var config=require(_0x3ef0('0x6'));var jayson=require(_0x3ef0('0x7'));var client=jayson[_0x3ef0('0x8')][_0x3ef0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x14c08e,_0x29ed13,_0xddd1d0){return new BPromise(function(_0x399980,_0xcfab30){return client[_0x3ef0('0xa')](_0x14c08e,_0xddd1d0)[_0x3ef0('0xb')](function(_0x15ee85){logger[_0x3ef0('0xc')](_0x3ef0('0xd'),_0x29ed13,'request\x20sent');logger[_0x3ef0('0xe')](_0x3ef0('0xf'),_0x29ed13,_0x3ef0('0x10'),JSON[_0x3ef0('0x11')](_0x15ee85));if(_0x15ee85[_0x3ef0('0x12')]){if(_0x15ee85['error']['code']===0x1f4){logger[_0x3ef0('0x12')](_0x3ef0('0xd'),_0x29ed13,_0x15ee85['error']['message']);return _0xcfab30(_0x15ee85[_0x3ef0('0x12')][_0x3ef0('0x13')]);}logger[_0x3ef0('0x12')](_0x3ef0('0xd'),_0x29ed13,_0x15ee85['error'][_0x3ef0('0x13')]);return _0x399980(_0x15ee85['error'][_0x3ef0('0x13')]);}else{logger[_0x3ef0('0xc')](_0x3ef0('0xd'),_0x29ed13,'request\x20sent');_0x399980(_0x15ee85['result'][_0x3ef0('0x13')]);}})[_0x3ef0('0x14')](function(_0x3dda64){logger['error']('ChatApplication,\x20%s,\x20%s',_0x29ed13,_0x3dda64);_0xcfab30(_0x3dda64);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index c8bbf87..9d0cdce 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 _0xbc26=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','/:id','isAuthenticated','show','put','destroy','multer','util'];(function(_0x44bcb0,_0x235aa9){var _0xfaf881=function(_0x25d81d){while(--_0x25d81d){_0x44bcb0['push'](_0x44bcb0['shift']());}};_0xfaf881(++_0x235aa9);}(_0xbc26,0x1b0));var _0x6bc2=function(_0x763a8e,_0x3d0f98){_0x763a8e=_0x763a8e-0x0;var _0x48c2eb=_0xbc26[_0x763a8e];return _0x48c2eb;};'use strict';var multer=require(_0x6bc2('0x0'));var util=require(_0x6bc2('0x1'));var path=require(_0x6bc2('0x2'));var timeout=require(_0x6bc2('0x3'));var express=require(_0x6bc2('0x4'));var router=express['Router']();var fs_extra=require(_0x6bc2('0x5'));var auth=require(_0x6bc2('0x6'));var interaction=require(_0x6bc2('0x7'));var config=require(_0x6bc2('0x8'));var controller=require('./chatApplication.controller');router['get'](_0x6bc2('0x9'),auth[_0x6bc2('0xa')](),controller[_0x6bc2('0xb')]);router[_0x6bc2('0xc')](_0x6bc2('0x9'),auth[_0x6bc2('0xa')](),controller['update']);router['delete'](_0x6bc2('0x9'),auth[_0x6bc2('0xa')](),controller[_0x6bc2('0xd')]);module['exports']=router; \ No newline at end of file +var _0xaa3e=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','/:id','isAuthenticated','put','update'];(function(_0x20e164,_0x24d0ca){var _0x3432b9=function(_0x2654cb){while(--_0x2654cb){_0x20e164['push'](_0x20e164['shift']());}};_0x3432b9(++_0x24d0ca);}(_0xaa3e,0x1bd));var _0xeaa3=function(_0x5a4400,_0xfae3b6){_0x5a4400=_0x5a4400-0x0;var _0xf9b532=_0xaa3e[_0x5a4400];return _0xf9b532;};'use strict';var multer=require(_0xeaa3('0x0'));var util=require(_0xeaa3('0x1'));var path=require(_0xeaa3('0x2'));var timeout=require(_0xeaa3('0x3'));var express=require(_0xeaa3('0x4'));var router=express[_0xeaa3('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xeaa3('0x6'));var interaction=require(_0xeaa3('0x7'));var config=require(_0xeaa3('0x8'));var controller=require(_0xeaa3('0x9'));router['get'](_0xeaa3('0xa'),auth[_0xeaa3('0xb')](),controller['show']);router[_0xeaa3('0xc')](_0xeaa3('0xa'),auth[_0xeaa3('0xb')](),controller[_0xeaa3('0xd')]);router[_0xeaa3('0xe')]('/:id',auth[_0xeaa3('0xb')](),controller[_0xeaa3('0xf')]);module[_0xeaa3('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 544d4d1..702bd03 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 _0xb7a9=['STRING','BOOLEAN','exports'];(function(_0x50588e,_0x405d5d){var _0x10af9d=function(_0x1f3d66){while(--_0x1f3d66){_0x50588e['push'](_0x50588e['shift']());}};_0x10af9d(++_0x405d5d);}(_0xb7a9,0x110));var _0x9b7a=function(_0x49a556,_0x5682d5){_0x49a556=_0x49a556-0x0;var _0x5cd974=_0xb7a9[_0x49a556];return _0x5cd974;};'use strict';var Sequelize=require('sequelize');module[_0x9b7a('0x0')]={'name':{'type':Sequelize[_0x9b7a('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x9b7a('0x1')]},'write':{'type':Sequelize[_0x9b7a('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0x80d3=['STRING'];(function(_0x404c20,_0x1a8fa4){var _0xbf3067=function(_0x233a69){while(--_0x233a69){_0x404c20['push'](_0x404c20['shift']());}};_0xbf3067(++_0x1a8fa4);}(_0x80d3,0x122));var _0x380d=function(_0x4f645a,_0x65a067){_0x4f645a=_0x4f645a-0x0;var _0x12c258=_0x80d3[_0x4f645a];return _0x12c258;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x380d('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0x380d('0x0')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index 44f8da1..d034bcb 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 _0x6462=['sendStatus','error','stack','name','send','map','ChatGroup','rawAttributes','fieldName','type','model','query','filters','intersection','fields','length','attributes','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','catch','params','keys','create','body','find','describe','ChatInternalMessage','user','toInteger','addMembers','ids','getMembers','findOne','User','nolimit','removeMembers','ChatGroupId','$gte','YYYY-MM-DD\x20HH:mm:ss','getMessages','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatGroup.socket','register','end','status','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy'];(function(_0x48f498,_0x3d3d6c){var _0x57e817=function(_0x1753bb){while(--_0x1753bb){_0x48f498['push'](_0x48f498['shift']());}};_0x57e817(++_0x3d3d6c);}(_0x6462,0x195));var _0x2646=function(_0x463304,_0x2a29ae){_0x463304=_0x463304-0x0;var _0x3ee5f6=_0x6462[_0x463304];return _0x3ee5f6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2646('0x0'));var zipdir=require(_0x2646('0x1'));var jsonpatch=require(_0x2646('0x2'));var rp=require(_0x2646('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2646('0x4'));var path=require(_0x2646('0x5'));var sox=require(_0x2646('0x6'));var csv=require(_0x2646('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2646('0x8'));var _=require(_0x2646('0x9'));var squel=require(_0x2646('0xa'));var crypto=require('crypto');var jsforce=require(_0x2646('0xb'));var deskjs=require(_0x2646('0xc'));var toCsv=require(_0x2646('0x7'));var querystring=require(_0x2646('0xd'));var Papa=require('papaparse');var Redis=require(_0x2646('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2646('0xf'))(_0x2646('0x10'));var utils=require(_0x2646('0x11'));var config=require(_0x2646('0x12'));var licenseUtil=require(_0x2646('0x13'));var db=require(_0x2646('0x14'))['db'];config[_0x2646('0x15')]=_[_0x2646('0x16')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x2646('0x17'))(new Redis(config[_0x2646('0x15')]));require(_0x2646('0x18'))[_0x2646('0x19')](socket);function respondWithStatusCode(_0x29ecfd,_0x1949ac){_0x1949ac=_0x1949ac||0xcc;return function(_0x544390){if(_0x544390){return _0x29ecfd['sendStatus'](_0x1949ac);}return _0x29ecfd['status'](_0x1949ac)[_0x2646('0x1a')]();};}function respondWithResult(_0x2e098f,_0x41153e){_0x41153e=_0x41153e||0xc8;return function(_0x2a865a){if(_0x2a865a){return _0x2e098f[_0x2646('0x1b')](_0x41153e)[_0x2646('0x1c')](_0x2a865a);}};}function respondWithFilteredResult(_0x1407b0,_0x5b851b){return function(_0x5532b1){if(_0x5532b1){var _0x4e119d=typeof _0x5b851b['offset']===_0x2646('0x1d')&&typeof _0x5b851b[_0x2646('0x1e')]===_0x2646('0x1d');var _0x4da371=_0x5532b1[_0x2646('0x1f')];var _0x20e649=_0x4e119d?0x0:_0x5b851b['offset'];var _0x1d010f=_0x4e119d?_0x5532b1[_0x2646('0x1f')]:_0x5b851b[_0x2646('0x20')]+_0x5b851b[_0x2646('0x1e')];var _0xbefa4d;if(_0x1d010f>=_0x4da371){_0x1d010f=_0x4da371;_0xbefa4d=0xc8;}else{_0xbefa4d=0xce;}_0x1407b0['status'](_0xbefa4d);return _0x1407b0[_0x2646('0x21')]('Content-Range',_0x20e649+'-'+_0x1d010f+'/'+_0x4da371)['json'](_0x5532b1);}return null;};}function patchUpdates(_0x1d2c63){return function(_0x4133a4){try{jsonpatch[_0x2646('0x22')](_0x4133a4,_0x1d2c63,!![]);}catch(_0x4e8331){return BPromise[_0x2646('0x23')](_0x4e8331);}return _0x4133a4[_0x2646('0x24')]();};}function saveUpdates(_0x248ea9,_0x51fbba){return function(_0x2955e3){if(_0x2955e3){return _0x2955e3[_0x2646('0x25')](_0x248ea9)[_0x2646('0x26')](function(_0x1e0a9c){return _0x1e0a9c;});}return null;};}function removeEntity(_0x33c4a5,_0x5718b4){return function(_0x33c93f){if(_0x33c93f){return _0x33c93f[_0x2646('0x27')]()['then'](function(){_0x33c4a5[_0x2646('0x1b')](0xcc)[_0x2646('0x1a')]();});}};}function handleEntityNotFound(_0x28b1ee,_0x37810e){return function(_0x4aaf21){if(!_0x4aaf21){_0x28b1ee[_0x2646('0x28')](0x194);}return _0x4aaf21;};}function handleError(_0x3c759a,_0x53d84a){_0x53d84a=_0x53d84a||0x1f4;return function(_0xed1e62){logger[_0x2646('0x29')](_0xed1e62[_0x2646('0x2a')]);if(_0xed1e62[_0x2646('0x2b')]){delete _0xed1e62[_0x2646('0x2b')];}_0x3c759a[_0x2646('0x1b')](_0x53d84a)[_0x2646('0x2c')](_0xed1e62);};}exports['index']=function(_0x3d1a2c,_0x1533bc){var _0x5770f3={},_0x13052c={},_0x418f9a={'count':0x0,'rows':[]};var _0x267207=_[_0x2646('0x2d')](db[_0x2646('0x2e')][_0x2646('0x2f')],function(_0x339e38){return{'name':_0x339e38[_0x2646('0x30')],'type':_0x339e38[_0x2646('0x31')]['key']};});_0x13052c[_0x2646('0x32')]=_['map'](_0x267207,'name');_0x13052c[_0x2646('0x33')]=_['keys'](_0x3d1a2c[_0x2646('0x33')]);_0x13052c[_0x2646('0x34')]=_[_0x2646('0x35')](_0x13052c[_0x2646('0x32')],_0x13052c[_0x2646('0x33')]);_0x5770f3['attributes']=_['intersection'](_0x13052c[_0x2646('0x32')],qs[_0x2646('0x36')](_0x3d1a2c[_0x2646('0x33')]['fields']));_0x5770f3['attributes']=_0x5770f3['attributes'][_0x2646('0x37')]?_0x5770f3[_0x2646('0x38')]:_0x13052c['model'];if(!_0x3d1a2c[_0x2646('0x33')][_0x2646('0x39')]('nolimit')){_0x5770f3[_0x2646('0x1e')]=qs[_0x2646('0x1e')](_0x3d1a2c[_0x2646('0x33')][_0x2646('0x1e')]);_0x5770f3['offset']=qs[_0x2646('0x20')](_0x3d1a2c[_0x2646('0x33')]['offset']);}_0x5770f3[_0x2646('0x3a')]=qs[_0x2646('0x3b')](_0x3d1a2c['query']['sort']);_0x5770f3[_0x2646('0x3c')]=qs['filters'](_[_0x2646('0x3d')](_0x3d1a2c[_0x2646('0x33')],_0x13052c[_0x2646('0x34')]),_0x267207);if(_0x3d1a2c['query']['filter']){_0x5770f3[_0x2646('0x3c')]=_[_0x2646('0x3e')](_0x5770f3[_0x2646('0x3c')],{'$or':_[_0x2646('0x2d')](_0x267207,function(_0x16bc85){if(_0x16bc85[_0x2646('0x31')]!==_0x2646('0x3f')){var _0x2d8343={};_0x2d8343[_0x16bc85[_0x2646('0x2b')]]={'$like':'%'+_0x3d1a2c[_0x2646('0x33')][_0x2646('0x40')]+'%'};return _0x2d8343;}})});}_0x5770f3=_[_0x2646('0x3e')]({},_0x5770f3,_0x3d1a2c[_0x2646('0x41')]);var _0x543c27={'where':_0x5770f3['where']};return db[_0x2646('0x2e')][_0x2646('0x1f')](_0x543c27)['then'](function(_0x4662ef){_0x418f9a[_0x2646('0x1f')]=_0x4662ef;if(_0x3d1a2c[_0x2646('0x33')][_0x2646('0x42')]){_0x5770f3[_0x2646('0x43')]=[{'all':!![]}];}return db[_0x2646('0x2e')]['findAll'](_0x5770f3);})[_0x2646('0x26')](function(_0x5dd105){_0x418f9a['rows']=_0x5dd105;return _0x418f9a;})[_0x2646('0x26')](respondWithFilteredResult(_0x1533bc,_0x5770f3))[_0x2646('0x44')](handleError(_0x1533bc,null));};exports['show']=function(_0x463b63,_0x218021){var _0x55c1ac={'raw':!![],'where':{'id':_0x463b63[_0x2646('0x45')]['id']}},_0x492c88={};_0x492c88['model']=_[_0x2646('0x46')](db[_0x2646('0x2e')][_0x2646('0x2f')]);_0x492c88[_0x2646('0x33')]=_[_0x2646('0x46')](_0x463b63[_0x2646('0x33')]);_0x492c88[_0x2646('0x34')]=_['intersection'](_0x492c88[_0x2646('0x32')],_0x492c88[_0x2646('0x33')]);_0x55c1ac[_0x2646('0x38')]=_['intersection'](_0x492c88[_0x2646('0x32')],qs['fields'](_0x463b63[_0x2646('0x33')][_0x2646('0x36')]));_0x55c1ac['attributes']=_0x55c1ac[_0x2646('0x38')][_0x2646('0x37')]?_0x55c1ac[_0x2646('0x38')]:_0x492c88[_0x2646('0x32')];if(_0x463b63['query'][_0x2646('0x42')]){_0x55c1ac[_0x2646('0x43')]=[{'all':!![]}];}_0x55c1ac=_[_0x2646('0x3e')]({},_0x55c1ac,_0x463b63[_0x2646('0x41')]);return db[_0x2646('0x2e')]['find'](_0x55c1ac)['then'](handleEntityNotFound(_0x218021,null))[_0x2646('0x26')](respondWithResult(_0x218021,null))[_0x2646('0x44')](handleError(_0x218021,null));};exports[_0x2646('0x47')]=function(_0x30e603,_0xdf3e45){return db['ChatGroup'][_0x2646('0x47')](_0x30e603[_0x2646('0x48')],{})[_0x2646('0x26')](respondWithResult(_0xdf3e45,0xc9))['catch'](handleError(_0xdf3e45,null));};exports[_0x2646('0x25')]=function(_0x16c792,_0x58efa9){if(_0x16c792['body']['id']){delete _0x16c792[_0x2646('0x48')]['id'];}return db[_0x2646('0x2e')][_0x2646('0x49')]({'where':{'id':_0x16c792[_0x2646('0x45')]['id']}})[_0x2646('0x26')](handleEntityNotFound(_0x58efa9,null))[_0x2646('0x26')](saveUpdates(_0x16c792[_0x2646('0x48')],null))[_0x2646('0x26')](respondWithResult(_0x58efa9,null))[_0x2646('0x44')](handleError(_0x58efa9,null));};exports[_0x2646('0x27')]=function(_0x4f2b39,_0x4864b0){return db[_0x2646('0x2e')][_0x2646('0x49')]({'where':{'id':_0x4f2b39[_0x2646('0x45')]['id']}})[_0x2646('0x26')](handleEntityNotFound(_0x4864b0,null))[_0x2646('0x26')](removeEntity(_0x4864b0,null))[_0x2646('0x44')](handleError(_0x4864b0,null));};exports['describe']=function(_0x285d45,_0x180e9e){return db['ChatGroup'][_0x2646('0x4a')]()[_0x2646('0x26')](respondWithResult(_0x180e9e,null))[_0x2646('0x44')](handleError(_0x180e9e,null));};exports['getUnread']=function(_0x7a88ad,_0x1446eb,_0x3556db){return db[_0x2646('0x4b')][_0x2646('0x1f')]({'where':{'ChatGroupId':_0x7a88ad[_0x2646('0x45')]['id'],'ToId':_0x7a88ad[_0x2646('0x4c')]['id'],'read':![]}})[_0x2646('0x26')](function(_0x12e16a){return{'id':_[_0x2646('0x4d')](_0x7a88ad[_0x2646('0x45')]['id']),'count':_0x12e16a};})[_0x2646('0x26')](respondWithResult(_0x1446eb,null))[_0x2646('0x44')](handleError(_0x1446eb,null));};exports['addMembers']=function(_0x2c82d8,_0x42e3a5,_0x58b55c){return db[_0x2646('0x2e')][_0x2646('0x49')]({'where':{'id':_0x2c82d8['params']['id']}})['then'](handleEntityNotFound(_0x42e3a5,null))[_0x2646('0x26')](function(_0x2acd9d){if(_0x2acd9d){return _0x2acd9d[_0x2646('0x4e')](_0x2c82d8[_0x2646('0x48')][_0x2646('0x4f')],_['omit'](_0x2c82d8['body'],[_0x2646('0x4f'),'id'])||{});}})[_0x2646('0x26')](respondWithResult(_0x42e3a5,null))['catch'](handleError(_0x42e3a5,null));};exports[_0x2646('0x50')]=function(_0x17dbb0,_0x42bb22,_0x398e39){var _0x924f99={};var _0x3dc18f={};var _0x4a6dee;var _0xde56c5;return db[_0x2646('0x2e')][_0x2646('0x51')]({'where':{'id':_0x17dbb0['params']['id']}})[_0x2646('0x26')](handleEntityNotFound(_0x42bb22,null))[_0x2646('0x26')](function(_0x31de10){if(_0x31de10){_0x4a6dee=_0x31de10;_0x3dc18f[_0x2646('0x32')]=_['keys'](db[_0x2646('0x52')][_0x2646('0x2f')]);_0x3dc18f[_0x2646('0x33')]=_[_0x2646('0x46')](_0x17dbb0[_0x2646('0x33')]);_0x3dc18f[_0x2646('0x34')]=_[_0x2646('0x35')](_0x3dc18f[_0x2646('0x32')],_0x3dc18f['query']);_0x924f99[_0x2646('0x38')]=_[_0x2646('0x35')](_0x3dc18f['model'],qs[_0x2646('0x36')](_0x17dbb0[_0x2646('0x33')][_0x2646('0x36')]));_0x924f99[_0x2646('0x38')]=_0x924f99[_0x2646('0x38')]['length']?_0x924f99[_0x2646('0x38')]:_0x3dc18f[_0x2646('0x32')];_0x924f99[_0x2646('0x3a')]=qs[_0x2646('0x3b')](_0x17dbb0[_0x2646('0x33')][_0x2646('0x3b')]);_0x924f99[_0x2646('0x3c')]=qs['filters'](_[_0x2646('0x3d')](_0x17dbb0['query'],_0x3dc18f[_0x2646('0x34')]));if(_0x17dbb0[_0x2646('0x33')][_0x2646('0x40')]){_0x924f99[_0x2646('0x3c')]=_[_0x2646('0x3e')](_0x924f99[_0x2646('0x3c')],{'$or':_[_0x2646('0x2d')](_0x924f99[_0x2646('0x38')],function(_0x5a8a3b){var _0x16a169={};_0x16a169[_0x5a8a3b]={'$like':'%'+_0x17dbb0[_0x2646('0x33')][_0x2646('0x40')]+'%'};return _0x16a169;})});}_0x924f99=_[_0x2646('0x3e')]({},_0x924f99,_0x17dbb0['options']);return _0x4a6dee[_0x2646('0x50')](_0x924f99);}})[_0x2646('0x26')](function(_0x522e3e){if(_0x522e3e){_0xde56c5=_0x522e3e[_0x2646('0x37')];if(!_0x17dbb0[_0x2646('0x33')]['hasOwnProperty'](_0x2646('0x53'))){_0x924f99[_0x2646('0x1e')]=qs[_0x2646('0x1e')](_0x17dbb0['query'][_0x2646('0x1e')]);_0x924f99['offset']=qs[_0x2646('0x20')](_0x17dbb0[_0x2646('0x33')][_0x2646('0x20')]);}return _0x4a6dee[_0x2646('0x50')](_0x924f99);}})[_0x2646('0x26')](function(_0x2e5396){if(_0x2e5396){return _0x2e5396?{'count':_0xde56c5,'rows':_0x2e5396}:null;}})[_0x2646('0x26')](respondWithResult(_0x42bb22,null))[_0x2646('0x44')](handleError(_0x42bb22,null));};exports[_0x2646('0x54')]=function(_0x23af3d,_0x4983ba,_0x5cef5b){return db['ChatGroup'][_0x2646('0x49')]({'where':{'id':_0x23af3d[_0x2646('0x45')]['id']}})[_0x2646('0x26')](handleEntityNotFound(_0x4983ba,null))[_0x2646('0x26')](function(_0x46d53c){if(_0x46d53c){return _0x46d53c['removeMembers'](_0x23af3d[_0x2646('0x33')][_0x2646('0x4f')]);}})[_0x2646('0x26')](respondWithStatusCode(_0x4983ba,null))['catch'](handleError(_0x4983ba,null));};exports['addMessage']=function(_0x2a8007,_0x20d18b,_0x2b1a5c){if(_0x2a8007[_0x2646('0x48')]['id']){delete _0x2a8007['body']['id'];}return db['ChatGroup'][_0x2646('0x49')]({'where':{'id':_0x2a8007[_0x2646('0x45')]['id']}})['then'](handleEntityNotFound(_0x20d18b,null))[_0x2646('0x26')](function(_0x5aa311){if(_0x5aa311){_0x2a8007[_0x2646('0x48')][_0x2646('0x55')]=_0x5aa311['id'];return db[_0x2646('0x4b')][_0x2646('0x47')](_0x2a8007['body']);}})[_0x2646('0x26')](respondWithResult(_0x20d18b,null))[_0x2646('0x44')](handleError(_0x20d18b,null));};exports['getMessages']=function(_0x3a99ce,_0x59a49f,_0x3e843d){var _0x26fac8={};var _0x8dfefd={};var _0x1793d1;var _0x9340ce;return db[_0x2646('0x2e')][_0x2646('0x51')]({'where':{'id':_0x3a99ce[_0x2646('0x45')]['id']}})['then'](handleEntityNotFound(_0x59a49f,null))['then'](function(_0x442883){if(_0x442883){_0x1793d1=_0x442883;_0x8dfefd['model']=_['keys'](db[_0x2646('0x4b')]['rawAttributes']);_0x8dfefd[_0x2646('0x33')]=_[_0x2646('0x46')](_0x3a99ce[_0x2646('0x33')]);_0x8dfefd[_0x2646('0x34')]=_['intersection'](_0x8dfefd[_0x2646('0x32')],_0x8dfefd[_0x2646('0x33')]);_0x26fac8['attributes']=_[_0x2646('0x35')](_0x8dfefd[_0x2646('0x32')],qs[_0x2646('0x36')](_0x3a99ce[_0x2646('0x33')]['fields']));_0x26fac8[_0x2646('0x38')]=_0x26fac8['attributes'][_0x2646('0x37')]?_0x26fac8['attributes']:_0x8dfefd[_0x2646('0x32')];_0x26fac8[_0x2646('0x3a')]=qs[_0x2646('0x3b')](_0x3a99ce[_0x2646('0x33')][_0x2646('0x3b')]);_0x26fac8[_0x2646('0x3c')]=qs[_0x2646('0x34')](_['pick'](_0x3a99ce[_0x2646('0x33')],_0x8dfefd[_0x2646('0x34')]));if(_0x3a99ce[_0x2646('0x33')][_0x2646('0x40')]){_0x26fac8[_0x2646('0x3c')]=_['merge'](_0x26fac8['where'],{'$or':_['map'](_0x26fac8['attributes'],function(_0x571f32){var _0x61294b={};_0x61294b[_0x571f32]={'$like':'%'+_0x3a99ce[_0x2646('0x33')][_0x2646('0x40')]+'%'};return _0x61294b;})});}if(_0x3a99ce['query'][_0x2646('0x56')]){var _0x35dd83=_0x3a99ce[_0x2646('0x33')][_0x2646('0x56')]['split'](',');var _0x3c049b={};_0x3c049b[_0x35dd83[0x0]]={'$gte':moment(_0x35dd83[0x1])['format'](_0x2646('0x57'))};_0x26fac8[_0x2646('0x3c')]=_[_0x2646('0x3e')](_0x26fac8['where'],_0x3c049b);}_0x26fac8=_['merge']({},_0x26fac8,_0x3a99ce['options']);return _0x1793d1[_0x2646('0x58')](_0x26fac8);}})[_0x2646('0x26')](function(_0x5751bc){if(_0x5751bc){_0x9340ce=_0x5751bc['length'];if(!_0x3a99ce['query'][_0x2646('0x39')](_0x2646('0x53'))){_0x26fac8[_0x2646('0x1e')]=qs[_0x2646('0x1e')](_0x3a99ce[_0x2646('0x33')][_0x2646('0x1e')]);_0x26fac8[_0x2646('0x20')]=qs['offset'](_0x3a99ce[_0x2646('0x33')][_0x2646('0x20')]);}return _0x1793d1['getMessages'](_0x26fac8);}})['then'](function(_0x1d8e3b){if(_0x1d8e3b){return _0x1d8e3b?{'count':_0x9340ce,'rows':_0x1d8e3b}:null;}})['then'](respondWithResult(_0x59a49f,null))['catch'](handleError(_0x59a49f,null));}; \ No newline at end of file +var _0x8bd7=['to-csv','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatGroup.socket','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','then','destroy','end','error','stack','name','index','ChatGroup','rawAttributes','fieldName','type','key','model','map','keys','filters','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','create','body','update','catch','describe','getUnread','user','toInteger','ids','omit','User','length','getMembers','removeMembers','addMessage','ChatGroupId','ChatInternalMessage','getMessages','findOne','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox'];(function(_0x44c935,_0x3653f0){var _0x465bee=function(_0x211d20){while(--_0x211d20){_0x44c935['push'](_0x44c935['shift']());}};_0x465bee(++_0x3653f0);}(_0x8bd7,0x11d));var _0x78bd=function(_0xa38167,_0x5d12b6){_0xa38167=_0xa38167-0x0;var _0x409f8d=_0x8bd7[_0xa38167];return _0x409f8d;};'use strict';var emlformat=require(_0x78bd('0x0'));var rimraf=require(_0x78bd('0x1'));var zipdir=require(_0x78bd('0x2'));var jsonpatch=require(_0x78bd('0x3'));var rp=require(_0x78bd('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x78bd('0x5'));var util=require(_0x78bd('0x6'));var path=require(_0x78bd('0x7'));var sox=require(_0x78bd('0x8'));var csv=require(_0x78bd('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x78bd('0xa'));var crypto=require(_0x78bd('0xb'));var jsforce=require(_0x78bd('0xc'));var deskjs=require(_0x78bd('0xd'));var toCsv=require(_0x78bd('0x9'));var querystring=require('querystring');var Papa=require(_0x78bd('0xe'));var Redis=require(_0x78bd('0xf'));var authService=require(_0x78bd('0x10'));var qs=require(_0x78bd('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x78bd('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x78bd('0x13'));var config=require(_0x78bd('0x14'));var licenseUtil=require(_0x78bd('0x15'));var db=require(_0x78bd('0x16'))['db'];config[_0x78bd('0x17')]=_[_0x78bd('0x18')](config[_0x78bd('0x17')],{'host':_0x78bd('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x78bd('0x17')]));require(_0x78bd('0x1a'))['register'](socket);function respondWithStatusCode(_0xb01357,_0xace10f){_0xace10f=_0xace10f||0xcc;return function(_0x56bfb7){if(_0x56bfb7){return _0xb01357[_0x78bd('0x1b')](_0xace10f);}return _0xb01357[_0x78bd('0x1c')](_0xace10f)['end']();};}function respondWithResult(_0x40a8b3,_0x39ee42){_0x39ee42=_0x39ee42||0xc8;return function(_0x2c75ca){if(_0x2c75ca){return _0x40a8b3[_0x78bd('0x1c')](_0x39ee42)['json'](_0x2c75ca);}};}function respondWithFilteredResult(_0x579f89,_0x44e606){return function(_0x212885){if(_0x212885){var _0x5cb613=typeof _0x44e606[_0x78bd('0x1d')]===_0x78bd('0x1e')&&typeof _0x44e606[_0x78bd('0x1f')]===_0x78bd('0x1e');var _0x3b150c=_0x212885[_0x78bd('0x20')];var _0x280837=_0x5cb613?0x0:_0x44e606[_0x78bd('0x1d')];var _0x9fc140=_0x5cb613?_0x212885['count']:_0x44e606[_0x78bd('0x1d')]+_0x44e606['limit'];var _0xe95e28;if(_0x9fc140>=_0x3b150c){_0x9fc140=_0x3b150c;_0xe95e28=0xc8;}else{_0xe95e28=0xce;}_0x579f89['status'](_0xe95e28);return _0x579f89[_0x78bd('0x21')](_0x78bd('0x22'),_0x280837+'-'+_0x9fc140+'/'+_0x3b150c)[_0x78bd('0x23')](_0x212885);}return null;};}function patchUpdates(_0x3cf9dd){return function(_0x358313){try{jsonpatch[_0x78bd('0x24')](_0x358313,_0x3cf9dd,!![]);}catch(_0x8697d1){return BPromise['reject'](_0x8697d1);}return _0x358313[_0x78bd('0x25')]();};}function saveUpdates(_0x222bb2,_0x37b8cc){return function(_0x4765e1){if(_0x4765e1){return _0x4765e1['update'](_0x222bb2)[_0x78bd('0x26')](function(_0x5c5c50){return _0x5c5c50;});}return null;};}function removeEntity(_0x9445b7,_0x2bcd41){return function(_0x81ad20){if(_0x81ad20){return _0x81ad20[_0x78bd('0x27')]()[_0x78bd('0x26')](function(){_0x9445b7[_0x78bd('0x1c')](0xcc)[_0x78bd('0x28')]();});}};}function handleEntityNotFound(_0x58efd7,_0x20ec65){return function(_0x176085){if(!_0x176085){_0x58efd7[_0x78bd('0x1b')](0x194);}return _0x176085;};}function handleError(_0x48376d,_0xa3032c){_0xa3032c=_0xa3032c||0x1f4;return function(_0x4ab3e9){logger[_0x78bd('0x29')](_0x4ab3e9[_0x78bd('0x2a')]);if(_0x4ab3e9['name']){delete _0x4ab3e9[_0x78bd('0x2b')];}_0x48376d[_0x78bd('0x1c')](_0xa3032c)['send'](_0x4ab3e9);};}exports[_0x78bd('0x2c')]=function(_0x5c0578,_0x155b5a){var _0x15994c={},_0x197ff3={},_0x64539a={'count':0x0,'rows':[]};var _0x5a6248=_['map'](db[_0x78bd('0x2d')][_0x78bd('0x2e')],function(_0xbe7f3c){return{'name':_0xbe7f3c[_0x78bd('0x2f')],'type':_0xbe7f3c[_0x78bd('0x30')][_0x78bd('0x31')]};});_0x197ff3[_0x78bd('0x32')]=_[_0x78bd('0x33')](_0x5a6248,_0x78bd('0x2b'));_0x197ff3['query']=_[_0x78bd('0x34')](_0x5c0578['query']);_0x197ff3[_0x78bd('0x35')]=_['intersection'](_0x197ff3[_0x78bd('0x32')],_0x197ff3[_0x78bd('0x36')]);_0x15994c[_0x78bd('0x37')]=_[_0x78bd('0x38')](_0x197ff3['model'],qs[_0x78bd('0x39')](_0x5c0578['query'][_0x78bd('0x39')]));_0x15994c['attributes']=_0x15994c['attributes']['length']?_0x15994c[_0x78bd('0x37')]:_0x197ff3[_0x78bd('0x32')];if(!_0x5c0578[_0x78bd('0x36')][_0x78bd('0x3a')](_0x78bd('0x3b'))){_0x15994c[_0x78bd('0x1f')]=qs[_0x78bd('0x1f')](_0x5c0578[_0x78bd('0x36')][_0x78bd('0x1f')]);_0x15994c[_0x78bd('0x1d')]=qs[_0x78bd('0x1d')](_0x5c0578['query'][_0x78bd('0x1d')]);}_0x15994c[_0x78bd('0x3c')]=qs[_0x78bd('0x3d')](_0x5c0578[_0x78bd('0x36')][_0x78bd('0x3d')]);_0x15994c[_0x78bd('0x3e')]=qs['filters'](_[_0x78bd('0x3f')](_0x5c0578[_0x78bd('0x36')],_0x197ff3['filters']),_0x5a6248);if(_0x5c0578[_0x78bd('0x36')][_0x78bd('0x40')]){_0x15994c[_0x78bd('0x3e')]=_[_0x78bd('0x41')](_0x15994c[_0x78bd('0x3e')],{'$or':_[_0x78bd('0x33')](_0x5a6248,function(_0x21dc98){if(_0x21dc98[_0x78bd('0x30')]!==_0x78bd('0x42')){var _0x97bad5={};_0x97bad5[_0x21dc98['name']]={'$like':'%'+_0x5c0578[_0x78bd('0x36')][_0x78bd('0x40')]+'%'};return _0x97bad5;}})});}_0x15994c=_[_0x78bd('0x41')]({},_0x15994c,_0x5c0578[_0x78bd('0x43')]);var _0x12b653={'where':_0x15994c[_0x78bd('0x3e')]};return db['ChatGroup'][_0x78bd('0x20')](_0x12b653)[_0x78bd('0x26')](function(_0x3dc495){_0x64539a[_0x78bd('0x20')]=_0x3dc495;if(_0x5c0578[_0x78bd('0x36')][_0x78bd('0x44')]){_0x15994c[_0x78bd('0x45')]=[{'all':!![]}];}return db['ChatGroup'][_0x78bd('0x46')](_0x15994c);})[_0x78bd('0x26')](function(_0x2cce23){_0x64539a[_0x78bd('0x47')]=_0x2cce23;return _0x64539a;})['then'](respondWithFilteredResult(_0x155b5a,_0x15994c))['catch'](handleError(_0x155b5a,null));};exports[_0x78bd('0x48')]=function(_0x537b1f,_0x48cfeb){var _0x23c434={'raw':!![],'where':{'id':_0x537b1f[_0x78bd('0x49')]['id']}},_0x328bbe={};_0x328bbe[_0x78bd('0x32')]=_['keys'](db['ChatGroup'][_0x78bd('0x2e')]);_0x328bbe['query']=_[_0x78bd('0x34')](_0x537b1f[_0x78bd('0x36')]);_0x328bbe[_0x78bd('0x35')]=_[_0x78bd('0x38')](_0x328bbe[_0x78bd('0x32')],_0x328bbe[_0x78bd('0x36')]);_0x23c434[_0x78bd('0x37')]=_[_0x78bd('0x38')](_0x328bbe[_0x78bd('0x32')],qs['fields'](_0x537b1f[_0x78bd('0x36')][_0x78bd('0x39')]));_0x23c434[_0x78bd('0x37')]=_0x23c434[_0x78bd('0x37')]['length']?_0x23c434[_0x78bd('0x37')]:_0x328bbe[_0x78bd('0x32')];if(_0x537b1f[_0x78bd('0x36')]['includeAll']){_0x23c434[_0x78bd('0x45')]=[{'all':!![]}];}_0x23c434=_[_0x78bd('0x41')]({},_0x23c434,_0x537b1f[_0x78bd('0x43')]);return db[_0x78bd('0x2d')][_0x78bd('0x4a')](_0x23c434)[_0x78bd('0x26')](handleEntityNotFound(_0x48cfeb,null))[_0x78bd('0x26')](respondWithResult(_0x48cfeb,null))['catch'](handleError(_0x48cfeb,null));};exports[_0x78bd('0x4b')]=function(_0x508edb,_0x1e0fcb){return db[_0x78bd('0x2d')][_0x78bd('0x4b')](_0x508edb[_0x78bd('0x4c')],{})[_0x78bd('0x26')](respondWithResult(_0x1e0fcb,0xc9))['catch'](handleError(_0x1e0fcb,null));};exports[_0x78bd('0x4d')]=function(_0x1304ed,_0x463771){if(_0x1304ed['body']['id']){delete _0x1304ed[_0x78bd('0x4c')]['id'];}return db[_0x78bd('0x2d')]['find']({'where':{'id':_0x1304ed['params']['id']}})[_0x78bd('0x26')](handleEntityNotFound(_0x463771,null))[_0x78bd('0x26')](saveUpdates(_0x1304ed['body'],null))['then'](respondWithResult(_0x463771,null))[_0x78bd('0x4e')](handleError(_0x463771,null));};exports[_0x78bd('0x27')]=function(_0x5a304b,_0x24394f){return db[_0x78bd('0x2d')][_0x78bd('0x4a')]({'where':{'id':_0x5a304b['params']['id']}})[_0x78bd('0x26')](handleEntityNotFound(_0x24394f,null))[_0x78bd('0x26')](removeEntity(_0x24394f,null))[_0x78bd('0x4e')](handleError(_0x24394f,null));};exports['describe']=function(_0x296ee9,_0x416b5a){return db[_0x78bd('0x2d')][_0x78bd('0x4f')]()[_0x78bd('0x26')](respondWithResult(_0x416b5a,null))[_0x78bd('0x4e')](handleError(_0x416b5a,null));};exports[_0x78bd('0x50')]=function(_0x2aeac3,_0x56ed14,_0x56d6cd){return db['ChatInternalMessage'][_0x78bd('0x20')]({'where':{'ChatGroupId':_0x2aeac3[_0x78bd('0x49')]['id'],'ToId':_0x2aeac3[_0x78bd('0x51')]['id'],'read':![]}})[_0x78bd('0x26')](function(_0x3be7c0){return{'id':_[_0x78bd('0x52')](_0x2aeac3['params']['id']),'count':_0x3be7c0};})['then'](respondWithResult(_0x56ed14,null))['catch'](handleError(_0x56ed14,null));};exports['addMembers']=function(_0x5162f0,_0x14eafd,_0x5af770){return db[_0x78bd('0x2d')][_0x78bd('0x4a')]({'where':{'id':_0x5162f0['params']['id']}})['then'](handleEntityNotFound(_0x14eafd,null))['then'](function(_0x48a09a){if(_0x48a09a){return _0x48a09a['addMembers'](_0x5162f0[_0x78bd('0x4c')][_0x78bd('0x53')],_[_0x78bd('0x54')](_0x5162f0[_0x78bd('0x4c')],[_0x78bd('0x53'),'id'])||{});}})[_0x78bd('0x26')](respondWithResult(_0x14eafd,null))[_0x78bd('0x4e')](handleError(_0x14eafd,null));};exports['getMembers']=function(_0x3f2328,_0x1c1671,_0x173318){var _0x3fede0={};var _0x1f47eb={};var _0x48cdd1;var _0x126ce7;return db[_0x78bd('0x2d')]['findOne']({'where':{'id':_0x3f2328['params']['id']}})[_0x78bd('0x26')](handleEntityNotFound(_0x1c1671,null))[_0x78bd('0x26')](function(_0x4e41ae){if(_0x4e41ae){_0x48cdd1=_0x4e41ae;_0x1f47eb[_0x78bd('0x32')]=_['keys'](db[_0x78bd('0x55')][_0x78bd('0x2e')]);_0x1f47eb[_0x78bd('0x36')]=_[_0x78bd('0x34')](_0x3f2328[_0x78bd('0x36')]);_0x1f47eb[_0x78bd('0x35')]=_[_0x78bd('0x38')](_0x1f47eb['model'],_0x1f47eb[_0x78bd('0x36')]);_0x3fede0['attributes']=_[_0x78bd('0x38')](_0x1f47eb[_0x78bd('0x32')],qs[_0x78bd('0x39')](_0x3f2328['query'][_0x78bd('0x39')]));_0x3fede0[_0x78bd('0x37')]=_0x3fede0[_0x78bd('0x37')][_0x78bd('0x56')]?_0x3fede0[_0x78bd('0x37')]:_0x1f47eb['model'];_0x3fede0['order']=qs[_0x78bd('0x3d')](_0x3f2328[_0x78bd('0x36')][_0x78bd('0x3d')]);_0x3fede0[_0x78bd('0x3e')]=qs[_0x78bd('0x35')](_['pick'](_0x3f2328[_0x78bd('0x36')],_0x1f47eb[_0x78bd('0x35')]));if(_0x3f2328[_0x78bd('0x36')]['filter']){_0x3fede0[_0x78bd('0x3e')]=_[_0x78bd('0x41')](_0x3fede0[_0x78bd('0x3e')],{'$or':_[_0x78bd('0x33')](_0x3fede0[_0x78bd('0x37')],function(_0x525dba){var _0x4a8787={};_0x4a8787[_0x525dba]={'$like':'%'+_0x3f2328[_0x78bd('0x36')][_0x78bd('0x40')]+'%'};return _0x4a8787;})});}_0x3fede0=_[_0x78bd('0x41')]({},_0x3fede0,_0x3f2328[_0x78bd('0x43')]);return _0x48cdd1[_0x78bd('0x57')](_0x3fede0);}})[_0x78bd('0x26')](function(_0x5cc56b){if(_0x5cc56b){_0x126ce7=_0x5cc56b[_0x78bd('0x56')];if(!_0x3f2328[_0x78bd('0x36')][_0x78bd('0x3a')]('nolimit')){_0x3fede0[_0x78bd('0x1f')]=qs['limit'](_0x3f2328[_0x78bd('0x36')]['limit']);_0x3fede0[_0x78bd('0x1d')]=qs[_0x78bd('0x1d')](_0x3f2328[_0x78bd('0x36')][_0x78bd('0x1d')]);}return _0x48cdd1[_0x78bd('0x57')](_0x3fede0);}})[_0x78bd('0x26')](function(_0x192f68){if(_0x192f68){return _0x192f68?{'count':_0x126ce7,'rows':_0x192f68}:null;}})['then'](respondWithResult(_0x1c1671,null))[_0x78bd('0x4e')](handleError(_0x1c1671,null));};exports[_0x78bd('0x58')]=function(_0x39758c,_0x5c43be,_0x49bced){return db[_0x78bd('0x2d')]['find']({'where':{'id':_0x39758c[_0x78bd('0x49')]['id']}})[_0x78bd('0x26')](handleEntityNotFound(_0x5c43be,null))[_0x78bd('0x26')](function(_0x6d5b21){if(_0x6d5b21){return _0x6d5b21['removeMembers'](_0x39758c[_0x78bd('0x36')]['ids']);}})['then'](respondWithStatusCode(_0x5c43be,null))[_0x78bd('0x4e')](handleError(_0x5c43be,null));};exports[_0x78bd('0x59')]=function(_0x16ef03,_0xc0bbe5,_0x5e512a){if(_0x16ef03['body']['id']){delete _0x16ef03[_0x78bd('0x4c')]['id'];}return db[_0x78bd('0x2d')][_0x78bd('0x4a')]({'where':{'id':_0x16ef03[_0x78bd('0x49')]['id']}})[_0x78bd('0x26')](handleEntityNotFound(_0xc0bbe5,null))['then'](function(_0x47fc65){if(_0x47fc65){_0x16ef03[_0x78bd('0x4c')][_0x78bd('0x5a')]=_0x47fc65['id'];return db[_0x78bd('0x5b')][_0x78bd('0x4b')](_0x16ef03[_0x78bd('0x4c')]);}})['then'](respondWithResult(_0xc0bbe5,null))['catch'](handleError(_0xc0bbe5,null));};exports[_0x78bd('0x5c')]=function(_0x4c0deb,_0x5ee58a,_0x3bbc21){var _0x29d414={};var _0x4a395b={};var _0x221860;var _0x4b3726;return db[_0x78bd('0x2d')][_0x78bd('0x5d')]({'where':{'id':_0x4c0deb[_0x78bd('0x49')]['id']}})['then'](handleEntityNotFound(_0x5ee58a,null))[_0x78bd('0x26')](function(_0x1c3f3a){if(_0x1c3f3a){_0x221860=_0x1c3f3a;_0x4a395b[_0x78bd('0x32')]=_[_0x78bd('0x34')](db[_0x78bd('0x5b')]['rawAttributes']);_0x4a395b[_0x78bd('0x36')]=_[_0x78bd('0x34')](_0x4c0deb['query']);_0x4a395b[_0x78bd('0x35')]=_[_0x78bd('0x38')](_0x4a395b[_0x78bd('0x32')],_0x4a395b[_0x78bd('0x36')]);_0x29d414[_0x78bd('0x37')]=_['intersection'](_0x4a395b['model'],qs['fields'](_0x4c0deb['query'][_0x78bd('0x39')]));_0x29d414[_0x78bd('0x37')]=_0x29d414[_0x78bd('0x37')][_0x78bd('0x56')]?_0x29d414[_0x78bd('0x37')]:_0x4a395b[_0x78bd('0x32')];_0x29d414[_0x78bd('0x3c')]=qs[_0x78bd('0x3d')](_0x4c0deb[_0x78bd('0x36')]['sort']);_0x29d414[_0x78bd('0x3e')]=qs[_0x78bd('0x35')](_['pick'](_0x4c0deb[_0x78bd('0x36')],_0x4a395b[_0x78bd('0x35')]));if(_0x4c0deb[_0x78bd('0x36')][_0x78bd('0x40')]){_0x29d414[_0x78bd('0x3e')]=_[_0x78bd('0x41')](_0x29d414['where'],{'$or':_['map'](_0x29d414[_0x78bd('0x37')],function(_0x2b540c){var _0xed0026={};_0xed0026[_0x2b540c]={'$like':'%'+_0x4c0deb[_0x78bd('0x36')][_0x78bd('0x40')]+'%'};return _0xed0026;})});}if(_0x4c0deb[_0x78bd('0x36')][_0x78bd('0x5e')]){var _0x23bdf3=_0x4c0deb[_0x78bd('0x36')]['$gte'][_0x78bd('0x5f')](',');var _0x1670cf={};_0x1670cf[_0x23bdf3[0x0]]={'$gte':moment(_0x23bdf3[0x1])[_0x78bd('0x60')](_0x78bd('0x61'))};_0x29d414['where']=_[_0x78bd('0x41')](_0x29d414[_0x78bd('0x3e')],_0x1670cf);}_0x29d414=_[_0x78bd('0x41')]({},_0x29d414,_0x4c0deb[_0x78bd('0x43')]);return _0x221860[_0x78bd('0x5c')](_0x29d414);}})[_0x78bd('0x26')](function(_0x3162ea){if(_0x3162ea){_0x4b3726=_0x3162ea[_0x78bd('0x56')];if(!_0x4c0deb['query'][_0x78bd('0x3a')]('nolimit')){_0x29d414[_0x78bd('0x1f')]=qs[_0x78bd('0x1f')](_0x4c0deb[_0x78bd('0x36')][_0x78bd('0x1f')]);_0x29d414['offset']=qs[_0x78bd('0x1d')](_0x4c0deb[_0x78bd('0x36')][_0x78bd('0x1d')]);}return _0x221860[_0x78bd('0x5c')](_0x29d414);}})[_0x78bd('0x26')](function(_0x4d831f){if(_0x4d831f){return _0x4d831f?{'count':_0x4b3726,'rows':_0x4d831f}:null;}})['then'](respondWithResult(_0x5ee58a,null))[_0x78bd('0x4e')](handleError(_0x5ee58a,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index c32132f..4d8cbc3 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 _0x14a0=['exports','events','../../mysqldb','ChatGroup','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x1d03fb,_0x8a62a1){var _0x39a977=function(_0x58de83){while(--_0x58de83){_0x1d03fb['push'](_0x1d03fb['shift']());}};_0x39a977(++_0x8a62a1);}(_0x14a0,0x109));var _0x014a=function(_0x3339cb,_0x4813c7){_0x3339cb=_0x3339cb-0x0;var _0x15b7c8=_0x14a0[_0x3339cb];return _0x15b7c8;};'use strict';var EventEmitter=require(_0x014a('0x0'));var ChatGroup=require(_0x014a('0x1'))['db'][_0x014a('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x014a('0x3')](0x0);var events={'afterCreate':_0x014a('0x4'),'afterUpdate':_0x014a('0x5'),'afterDestroy':_0x014a('0x6')};function emitEvent(_0x349a0d){return function(_0x1cf6f3,_0x56d55d,_0x3cb762){ChatGroupEvents[_0x014a('0x7')](_0x349a0d+':'+_0x1cf6f3['id'],_0x1cf6f3);ChatGroupEvents['emit'](_0x349a0d,_0x1cf6f3);_0x3cb762(null);};}for(var e in events){if(events[_0x014a('0x8')](e)){var event=events[e];ChatGroup[_0x014a('0x9')](e,emitEvent(event));}}module[_0x014a('0xa')]=ChatGroupEvents; \ No newline at end of file +var _0x2172=['save','hasOwnProperty','hook','exports','../../mysqldb','ChatGroup','setMaxListeners'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x2172,0x15b));var _0x2217=function(_0x4801c0,_0x35d200){_0x4801c0=_0x4801c0-0x0;var _0x8b28e5=_0x2172[_0x4801c0];return _0x8b28e5;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x2217('0x0'))['db'][_0x2217('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x2217('0x2')](0x0);var events={'afterCreate':_0x2217('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x37b96a){return function(_0xd6fb71,_0x40863f,_0x57c819){ChatGroupEvents['emit'](_0x37b96a+':'+_0xd6fb71['id'],_0xd6fb71);ChatGroupEvents['emit'](_0x37b96a,_0xd6fb71);_0x57c819(null);};}for(var e in events){if(events[_0x2217('0x4')](e)){var event=events[e];ChatGroup[_0x2217('0x5')](e,emitEvent(event));}}module[_0x2217('0x6')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 0c13e49..d2e78ab 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 _0xd257=['rimraf','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','util','../../config/logger','api','moment','request-promise','path'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0xd257,0x7c));var _0x7d25=function(_0x5538d5,_0x190032){_0x5538d5=_0x5538d5-0x0;var _0x323b1a=_0xd257[_0x5538d5];return _0x323b1a;};'use strict';var _=require('lodash');var util=require(_0x7d25('0x0'));var logger=require(_0x7d25('0x1'))(_0x7d25('0x2'));var moment=require(_0x7d25('0x3'));var BPromise=require('bluebird');var rp=require(_0x7d25('0x4'));var fs=require('fs');var path=require(_0x7d25('0x5'));var rimraf=require(_0x7d25('0x6'));var config=require(_0x7d25('0x7'));var attributes=require(_0x7d25('0x8'));module[_0x7d25('0x9')]=function(_0x4f2663,_0x456e9e){return _0x4f2663[_0x7d25('0xa')](_0x7d25('0xb'),attributes,{'tableName':_0x7d25('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd7d7=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','lodash'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd7d7,0xd1));var _0x7d7d=function(_0x155d89,_0x24d2e9){_0x155d89=_0x155d89-0x0;var _0x4b0806=_0xd7d7[_0x155d89];return _0x4b0806;};'use strict';var _=require(_0x7d7d('0x0'));var util=require(_0x7d7d('0x1'));var logger=require(_0x7d7d('0x2'))(_0x7d7d('0x3'));var moment=require(_0x7d7d('0x4'));var BPromise=require(_0x7d7d('0x5'));var rp=require(_0x7d7d('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7d7d('0x7'));var config=require(_0x7d7d('0x8'));var attributes=require(_0x7d7d('0x9'));module[_0x7d7d('0xa')]=function(_0x3d7ccc,_0x4bafb8){return _0x3d7ccc[_0x7d7d('0xb')](_0x7d7d('0xc'),attributes,{'tableName':_0x7d7d('0xd'),'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 64d3cd1..e4eade1 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 _0xe799=['jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x4e13b0,_0x1ca561){var _0x5c2a63=function(_0xc1d181){while(--_0xc1d181){_0x4e13b0['push'](_0x4e13b0['shift']());}};_0x5c2a63(++_0x1ca561);}(_0xe799,0x170));var _0x9e79=function(_0x743ca2,_0x3ef14b){_0x743ca2=_0x743ca2-0x0;var _0x1d4b58=_0xe799[_0x743ca2];return _0x1d4b58;};'use strict';var _=require(_0x9e79('0x0'));var util=require('util');var moment=require(_0x9e79('0x1'));var BPromise=require('bluebird');var rs=require(_0x9e79('0x2'));var fs=require('fs');var Redis=require(_0x9e79('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9e79('0x4'));var logger=require(_0x9e79('0x5'))(_0x9e79('0x6'));var config=require('../../config/environment');var jayson=require(_0x9e79('0x7'));var client=jayson['client'][_0x9e79('0x8')]({'port':0x232a});config[_0x9e79('0x9')]=_[_0x9e79('0xa')](config['redis'],{'host':_0x9e79('0xb'),'port':0x18eb});var socket=require(_0x9e79('0xc'))(new Redis(config['redis']));require(_0x9e79('0xd'))[_0x9e79('0xe')](socket);function respondWithRpcPromise(_0xc46eed,_0x6464d6,_0x502f36){return new BPromise(function(_0x43bd7a,_0x15efc4){return client['request'](_0xc46eed,_0x502f36)[_0x9e79('0xf')](function(_0x127c92){logger[_0x9e79('0x10')](_0x9e79('0x11'),_0x6464d6,_0x9e79('0x12'));logger['debug'](_0x9e79('0x13'),_0x6464d6,_0x9e79('0x12'),JSON[_0x9e79('0x14')](_0x127c92));if(_0x127c92[_0x9e79('0x15')]){if(_0x127c92[_0x9e79('0x15')][_0x9e79('0x16')]===0x1f4){logger[_0x9e79('0x15')](_0x9e79('0x11'),_0x6464d6,_0x127c92[_0x9e79('0x15')][_0x9e79('0x17')]);return _0x15efc4(_0x127c92[_0x9e79('0x15')][_0x9e79('0x17')]);}logger['error'](_0x9e79('0x11'),_0x6464d6,_0x127c92['error'][_0x9e79('0x17')]);return _0x43bd7a(_0x127c92[_0x9e79('0x15')]['message']);}else{logger[_0x9e79('0x10')](_0x9e79('0x11'),_0x6464d6,'request\x20sent');_0x43bd7a(_0x127c92['result'][_0x9e79('0x17')]);}})[_0x9e79('0x18')](function(_0x33e7a2){logger[_0x9e79('0x15')](_0x9e79('0x11'),_0x6464d6,_0x33e7a2);_0x15efc4(_0x33e7a2);});});} \ No newline at end of file +var _0x9f60=['request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket','register','then','ChatGroup,\x20%s,\x20%s'];(function(_0x3cae69,_0x233c38){var _0x3128eb=function(_0x21d64e){while(--_0x21d64e){_0x3cae69['push'](_0x3cae69['shift']());}};_0x3128eb(++_0x233c38);}(_0x9f60,0x1ae));var _0x09f6=function(_0x14deb4,_0x32297e){_0x14deb4=_0x14deb4-0x0;var _0x26aa7d=_0x9f60[_0x14deb4];return _0x26aa7d;};'use strict';var _=require(_0x09f6('0x0'));var util=require('util');var moment=require(_0x09f6('0x1'));var BPromise=require(_0x09f6('0x2'));var rs=require(_0x09f6('0x3'));var fs=require('fs');var Redis=require(_0x09f6('0x4'));var db=require(_0x09f6('0x5'))['db'];var utils=require(_0x09f6('0x6'));var logger=require(_0x09f6('0x7'))('rpc');var config=require(_0x09f6('0x8'));var jayson=require(_0x09f6('0x9'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x09f6('0xa')](config[_0x09f6('0xb')],{'host':_0x09f6('0xc'),'port':0x18eb});var socket=require(_0x09f6('0xd'))(new Redis(config[_0x09f6('0xb')]));require(_0x09f6('0xe'))[_0x09f6('0xf')](socket);function respondWithRpcPromise(_0x2e1bb3,_0x5b5038,_0x14d079){return new BPromise(function(_0x978b31,_0x1e10e2){return client['request'](_0x2e1bb3,_0x14d079)[_0x09f6('0x10')](function(_0x3a9988){logger['info'](_0x09f6('0x11'),_0x5b5038,_0x09f6('0x12'));logger[_0x09f6('0x13')](_0x09f6('0x14'),_0x5b5038,_0x09f6('0x12'),JSON[_0x09f6('0x15')](_0x3a9988));if(_0x3a9988[_0x09f6('0x16')]){if(_0x3a9988[_0x09f6('0x16')][_0x09f6('0x17')]===0x1f4){logger[_0x09f6('0x16')]('ChatGroup,\x20%s,\x20%s',_0x5b5038,_0x3a9988[_0x09f6('0x16')][_0x09f6('0x18')]);return _0x1e10e2(_0x3a9988['error'][_0x09f6('0x18')]);}logger['error']('ChatGroup,\x20%s,\x20%s',_0x5b5038,_0x3a9988[_0x09f6('0x16')][_0x09f6('0x18')]);return _0x978b31(_0x3a9988['error'][_0x09f6('0x18')]);}else{logger[_0x09f6('0x19')]('ChatGroup,\x20%s,\x20%s',_0x5b5038,_0x09f6('0x12'));_0x978b31(_0x3a9988[_0x09f6('0x1a')][_0x09f6('0x18')]);}})[_0x09f6('0x1b')](function(_0x1ab9f6){logger['error']('ChatGroup,\x20%s,\x20%s',_0x5b5038,_0x1ab9f6);_0x1e10e2(_0x1ab9f6);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 3bf0304..6946e72 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 _0x8419=['emit','register','length','save','remove','update'];(function(_0x1c578a,_0x4be67d){var _0x447ac8=function(_0x324c69){while(--_0x324c69){_0x1c578a['push'](_0x1c578a['shift']());}};_0x447ac8(++_0x4be67d);}(_0x8419,0x1ef));var _0x9841=function(_0x208a50,_0x53ec1e){_0x208a50=_0x208a50-0x0;var _0xd62dfa=_0x8419[_0x208a50];return _0xd62dfa;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0x9841('0x0'),_0x9841('0x1'),_0x9841('0x2')];function createListener(_0x3b6707,_0x518168){return function(_0x2c3f21){_0x518168[_0x9841('0x3')](_0x3b6707,_0x2c3f21);};}function removeListener(_0x5aff1f,_0x40e5dc){return function(){ChatGroupEvents['removeListener'](_0x5aff1f,_0x40e5dc);};}exports[_0x9841('0x4')]=function(_0x254e5f){for(var _0x1033e7=0x0,_0x2d588a=events[_0x9841('0x5')];_0x1033e7<_0x2d588a;_0x1033e7++){var _0x53365e=events[_0x1033e7];var _0x19a4a9=createListener('chatGroup:'+_0x53365e,_0x254e5f);ChatGroupEvents['on'](_0x53365e,_0x19a4a9);}}; \ No newline at end of file +var _0x430f=['remove','removeListener','register','length','./chatGroup.events','save'];(function(_0x354e4e,_0x74f187){var _0x1ca266=function(_0x5772d3){while(--_0x5772d3){_0x354e4e['push'](_0x354e4e['shift']());}};_0x1ca266(++_0x74f187);}(_0x430f,0xb2));var _0xf430=function(_0x47a8e9,_0x3bddb2){_0x47a8e9=_0x47a8e9-0x0;var _0x2fadb5=_0x430f[_0x47a8e9];return _0x2fadb5;};'use strict';var ChatGroupEvents=require(_0xf430('0x0'));var events=[_0xf430('0x1'),_0xf430('0x2'),'update'];function createListener(_0x1ec010,_0x4fdbcd){return function(_0x53a54c){_0x4fdbcd['emit'](_0x1ec010,_0x53a54c);};}function removeListener(_0x370e7b,_0x5c5c18){return function(){ChatGroupEvents[_0xf430('0x3')](_0x370e7b,_0x5c5c18);};}exports[_0xf430('0x4')]=function(_0x1f7de0){for(var _0x44bcdc=0x0,_0x4dda0e=events[_0xf430('0x5')];_0x44bcdc<_0x4dda0e;_0x44bcdc++){var _0x372dae=events[_0x44bcdc];var _0x54f990=createListener('chatGroup:'+_0x372dae,_0x1f7de0);ChatGroupEvents['on'](_0x372dae,_0x54f990);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 9318259..d008fde 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 _0xd877=['exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','addMessage','put','/:id','update','delete','destroy'];(function(_0x14a9f4,_0x1b86c6){var _0x3700c6=function(_0x6e6eea){while(--_0x6e6eea){_0x14a9f4['push'](_0x14a9f4['shift']());}};_0x3700c6(++_0x1b86c6);}(_0xd877,0x1a5));var _0x7d87=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xd877[_0x30ae5e];return _0x1f2e93;};'use strict';var multer=require(_0x7d87('0x0'));var util=require('util');var path=require(_0x7d87('0x1'));var timeout=require(_0x7d87('0x2'));var express=require(_0x7d87('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x7d87('0x4'));var interaction=require(_0x7d87('0x5'));var config=require(_0x7d87('0x6'));var controller=require(_0x7d87('0x7'));router[_0x7d87('0x8')]('/',auth[_0x7d87('0x9')](),controller[_0x7d87('0xa')]);router[_0x7d87('0x8')](_0x7d87('0xb'),auth[_0x7d87('0x9')](),controller[_0x7d87('0xc')]);router[_0x7d87('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x7d87('0xd')]);router[_0x7d87('0x8')](_0x7d87('0xe'),auth[_0x7d87('0x9')](),controller[_0x7d87('0xf')]);router[_0x7d87('0x8')](_0x7d87('0x10'),auth['isAuthenticated'](),controller[_0x7d87('0x11')]);router[_0x7d87('0x8')](_0x7d87('0x12'),auth[_0x7d87('0x9')](),controller[_0x7d87('0x13')]);router[_0x7d87('0x14')]('/',auth[_0x7d87('0x9')](),controller['create']);router['post'](_0x7d87('0x10'),auth[_0x7d87('0x9')](),controller['addMembers']);router[_0x7d87('0x14')](_0x7d87('0x12'),auth[_0x7d87('0x9')](),controller[_0x7d87('0x15')]);router[_0x7d87('0x16')](_0x7d87('0x17'),auth[_0x7d87('0x9')](),controller[_0x7d87('0x18')]);router[_0x7d87('0x19')](_0x7d87('0x17'),auth[_0x7d87('0x9')](),controller[_0x7d87('0x1a')]);router[_0x7d87('0x19')]('/:id/members',auth[_0x7d87('0x9')](),controller['removeMembers']);module[_0x7d87('0x1b')]=router; \ No newline at end of file +var _0x335f=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMessage','update','delete','exports','multer','util'];(function(_0x95411e,_0x38b4c3){var _0x2c8718=function(_0x35c672){while(--_0x35c672){_0x95411e['push'](_0x95411e['shift']());}};_0x2c8718(++_0x38b4c3);}(_0x335f,0x8a));var _0xf335=function(_0x458c2a,_0x531b2e){_0x458c2a=_0x458c2a-0x0;var _0x1be615=_0x335f[_0x458c2a];return _0x1be615;};'use strict';var multer=require(_0xf335('0x0'));var util=require(_0xf335('0x1'));var path=require(_0xf335('0x2'));var timeout=require('connect-timeout');var express=require(_0xf335('0x3'));var router=express[_0xf335('0x4')]();var fs_extra=require(_0xf335('0x5'));var auth=require(_0xf335('0x6'));var interaction=require(_0xf335('0x7'));var config=require(_0xf335('0x8'));var controller=require(_0xf335('0x9'));router[_0xf335('0xa')]('/',auth[_0xf335('0xb')](),controller[_0xf335('0xc')]);router[_0xf335('0xa')](_0xf335('0xd'),auth[_0xf335('0xb')](),controller[_0xf335('0xe')]);router[_0xf335('0xa')](_0xf335('0xf'),auth[_0xf335('0xb')](),controller[_0xf335('0x10')]);router[_0xf335('0xa')]('/:id/unread',auth[_0xf335('0xb')](),controller[_0xf335('0x11')]);router[_0xf335('0xa')](_0xf335('0x12'),auth[_0xf335('0xb')](),controller[_0xf335('0x13')]);router[_0xf335('0xa')](_0xf335('0x14'),auth[_0xf335('0xb')](),controller[_0xf335('0x15')]);router[_0xf335('0x16')]('/',auth['isAuthenticated'](),controller[_0xf335('0x17')]);router[_0xf335('0x16')](_0xf335('0x12'),auth['isAuthenticated'](),controller['addMembers']);router[_0xf335('0x16')](_0xf335('0x14'),auth[_0xf335('0xb')](),controller[_0xf335('0x18')]);router['put'](_0xf335('0xf'),auth[_0xf335('0xb')](),controller[_0xf335('0x19')]);router[_0xf335('0x1a')](_0xf335('0xf'),auth[_0xf335('0xb')](),controller['destroy']);router[_0xf335('0x1a')](_0xf335('0x12'),auth[_0xf335('0xb')](),controller['removeMembers']);module[_0xf335('0x1b')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index f07f013..d1c5167 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 _0x8871=['thumb','STRING','TEXT','DATE','out','sequelize','exports','INTEGER','ENUM','star'];(function(_0x2db796,_0x3f2e05){var _0x1c2196=function(_0x25ecec){while(--_0x25ecec){_0x2db796['push'](_0x2db796['shift']());}};_0x1c2196(++_0x3f2e05);}(_0x8871,0x109));var _0x1887=function(_0x5945d3,_0x42c4a1){_0x5945d3=_0x5945d3-0x0;var _0xe3819a=_0x8871[_0x5945d3];return _0xe3819a;};'use strict';var Sequelize=require(_0x1887('0x0'));module[_0x1887('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x1887('0x2')]},'ratingType':{'type':Sequelize[_0x1887('0x3')](_0x1887('0x4'),_0x1887('0x5')),'defaultValue':_0x1887('0x4')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x1887('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x1887('0x6')]},'secondDisposition':{'type':Sequelize[_0x1887('0x6')]},'thirdDisposition':{'type':Sequelize[_0x1887('0x6')]},'note':{'type':Sequelize[_0x1887('0x6')]},'browserName':{'type':Sequelize[_0x1887('0x6')]},'browserVersion':{'type':Sequelize[_0x1887('0x6')]},'osName':{'type':Sequelize[_0x1887('0x6')]},'osVersion':{'type':Sequelize[_0x1887('0x6')]},'deviceModel':{'type':Sequelize[_0x1887('0x6')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x1887('0x7')]},'customerIp':{'type':Sequelize[_0x1887('0x6')]},'formData':{'type':Sequelize['TEXT']('long')},'read1stAt':{'type':Sequelize[_0x1887('0x8')]},'lastMsgAt':{'type':Sequelize[_0x1887('0x8')]},'lastMsgDirection':{'type':Sequelize[_0x1887('0x3')]('in',_0x1887('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0x1887('0x7')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xbd3a=['out','INTEGER','sequelize','BOOLEAN','ENUM','star','thumb','TEXT','DATE','STRING','long'];(function(_0xa81ce1,_0x1c5c59){var _0x4cb9fe=function(_0x525e92){while(--_0x525e92){_0xa81ce1['push'](_0xa81ce1['shift']());}};_0x4cb9fe(++_0x1c5c59);}(_0xbd3a,0x10a));var _0xabd3=function(_0x58c043,_0x267d07){_0x58c043=_0x58c043-0x0;var _0x19a4c4=_0xbd3a[_0x58c043];return _0x19a4c4;};'use strict';var Sequelize=require(_0xabd3('0x0'));module['exports']={'closed':{'type':Sequelize[_0xabd3('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0xabd3('0x2')](_0xabd3('0x3'),_0xabd3('0x4')),'defaultValue':_0xabd3('0x3')},'ratingMessage':{'type':Sequelize[_0xabd3('0x5')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xabd3('0x6')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xabd3('0x7')]},'note':{'type':Sequelize[_0xabd3('0x7')]},'browserName':{'type':Sequelize[_0xabd3('0x7')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0xabd3('0x7')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0xabd3('0x5')]},'customerIp':{'type':Sequelize[_0xabd3('0x7')]},'formData':{'type':Sequelize[_0xabd3('0x5')](_0xabd3('0x8'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xabd3('0x2')]('in',_0xabd3('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0xabd3('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0xabd3('0x1')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xabd3('0xa')]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index ad7c632..f3ce2ac 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 _0x46cd=['include','find','create','body','update','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','user','fullname','POST','https://api-vidaoo.xcally.com/api/v1/meetings','email','follow','isNull','parse','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','UserId','closed','disposition','attachmentUpload','file','filename','mimetype','Attachment','Unauthorized','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','basename','download','close','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','ChatMessage','User','Messages','%s%d','System','customer','ContactId','agentIdentifier','website_alias','agentAlias','agent_alias','alias','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','appendFileSync','MailAccount','MailServerOut','CloudProvider','Smtp','getSmtpOptions','SendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','addMessage','ids','omit','hasOwnProperty','nolimit','limit','order','sort','pick','ChatInteractionId','filter','where','map','$gte','YYYY-MM-DD\x20HH:mm:ss','options','getMyMessages','includeAgent','push','rows','addTags','spread','Tag','emit','chatInteractionTags:save','removeTags','server','files','attachments','transcript-%d-%s.zip','firstName','lastName','createdAt','secret','read','Account','Owner','get','mkdirSync','Chat','N.A.','toString','closedAt','browserName','osName','referer','customerPort','existsSync','createReadStream','pipe','createWriteStream','direction','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','err','unlinkSync','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','api','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./chatInteraction.socket','jayson/promise','client','http','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','status','end','json','offset','undefined','count','set','destroy','sendStatus','stack','name','render','merge','contact','agent','interaction','account','ChatInteraction','rawAttributes','getOptions','findAll','chat','query','show','params','keys','filters','intersection','model','attributes','fields','length','includeAll'];(function(_0x107f10,_0x5529f2){var _0x811cab=function(_0xc160ea){while(--_0xc160ea){_0x107f10['push'](_0x107f10['shift']());}};_0x811cab(++_0x5529f2);}(_0x46cd,0x159));var _0xd46c=function(_0xfa634c,_0x414e0e){_0xfa634c=_0xfa634c-0x0;var _0x73e478=_0x46cd[_0xfa634c];return _0x73e478;};'use strict';var rimraf=require(_0xd46c('0x0'));var zipdir=require(_0xd46c('0x1'));var rp=require(_0xd46c('0x2'));var moment=require(_0xd46c('0x3'));var BPromise=require(_0xd46c('0x4'));var Mustache=require(_0xd46c('0x5'));var util=require('util');var path=require(_0xd46c('0x6'));var ejs=require(_0xd46c('0x7'));var fs=require('fs');var _=require(_0xd46c('0x8'));var Redis=require(_0xd46c('0x9'));var interaction=require(_0xd46c('0xa'));var qs=require(_0xd46c('0xb'));var pdf=require('../../components/export/pdf');var logger=require('../../config/logger')(_0xd46c('0xc'));var config=require(_0xd46c('0xd'));var db=require(_0xd46c('0xe'))['db'];config['redis']=_[_0xd46c('0xf')](config[_0xd46c('0x10')],{'host':'localhost','port':0x18eb});var socket=require(_0xd46c('0x11'))(new Redis(config[_0xd46c('0x10')]));require(_0xd46c('0x12'))['register'](socket);var jayson=require(_0xd46c('0x13'));var client=jayson[_0xd46c('0x14')][_0xd46c('0x15')]({'port':0x232b});var client9004=jayson[_0xd46c('0x14')][_0xd46c('0x15')]({'port':0x232c});function respondWithRpcPromise(_0x9b2116,_0x2b59a6,_0x2f6535,_0x4e2b64){return new BPromise(function(_0x53461c,_0x3852d5){var _0x121560=_0x4e2b64||client;return _0x121560['request'](_0x9b2116,_0x2f6535)[_0xd46c('0x16')](function(_0x38dc3c){logger[_0xd46c('0x17')](_0xd46c('0x18'),_0x2b59a6,_0xd46c('0x19'));logger[_0xd46c('0x1a')](_0xd46c('0x1b'),_0x2b59a6,_0xd46c('0x19'),JSON[_0xd46c('0x1c')](_0x38dc3c));if(_0x38dc3c['error']){if(_0x38dc3c[_0xd46c('0x1d')]['code']===0x1f4){logger[_0xd46c('0x1d')]('ChatInteraction,\x20%s,\x20%s',_0x2b59a6,_0x38dc3c['error']['message']);return _0x3852d5(_0x38dc3c[_0xd46c('0x1d')]['message']);}logger[_0xd46c('0x1d')](_0xd46c('0x18'),_0x2b59a6,_0x38dc3c[_0xd46c('0x1d')][_0xd46c('0x1e')]);return _0x53461c(_0x38dc3c[_0xd46c('0x1d')][_0xd46c('0x1e')]);}else{logger['info'](_0xd46c('0x18'),_0x2b59a6,_0xd46c('0x19'));_0x53461c(_0x38dc3c['result']['message']);}})[_0xd46c('0x1f')](function(_0x95a1fe){logger[_0xd46c('0x1d')](_0xd46c('0x18'),_0x2b59a6,_0x95a1fe);_0x3852d5(_0x95a1fe);});});}function respondWithStatusCode(_0x2965d3,_0x5e5833){_0x5e5833=_0x5e5833||0xcc;return function(_0x3a9b10){if(_0x3a9b10){return _0x2965d3['sendStatus'](_0x5e5833);}return _0x2965d3[_0xd46c('0x20')](_0x5e5833)[_0xd46c('0x21')]();};}function respondWithResult(_0x1796b7,_0x41b34a){_0x41b34a=_0x41b34a||0xc8;return function(_0x5a700a){if(_0x5a700a){return _0x1796b7['status'](_0x41b34a)[_0xd46c('0x22')](_0x5a700a);}};}function respondWithFilteredResult(_0x1a4e8f,_0x28a642){return function(_0x30719a){if(_0x30719a){var _0x4c1575=typeof _0x28a642[_0xd46c('0x23')]===_0xd46c('0x24')&&typeof _0x28a642['limit']===_0xd46c('0x24');var _0x256978=_0x30719a[_0xd46c('0x25')];var _0x4c4db5=_0x4c1575?0x0:_0x28a642[_0xd46c('0x23')];var _0x32e7f9=_0x4c1575?_0x30719a[_0xd46c('0x25')]:_0x28a642[_0xd46c('0x23')]+_0x28a642['limit'];var _0x4ac483;if(_0x32e7f9>=_0x256978){_0x32e7f9=_0x256978;_0x4ac483=0xc8;}else{_0x4ac483=0xce;}_0x1a4e8f['status'](_0x4ac483);return _0x1a4e8f[_0xd46c('0x26')]('Content-Range',_0x4c4db5+'-'+_0x32e7f9+'/'+_0x256978)[_0xd46c('0x22')](_0x30719a);}return null;};}function saveUpdates(_0x41d1ac){return function(_0x129f15){if(_0x129f15){return _0x129f15['update'](_0x41d1ac)[_0xd46c('0x16')](function(_0x3b7eb5){return _0x3b7eb5;});}return null;};}function removeEntity(_0x16cb81){return function(_0x5eed71){if(_0x5eed71){return _0x5eed71[_0xd46c('0x27')]()[_0xd46c('0x16')](function(){_0x16cb81[_0xd46c('0x20')](0xcc)[_0xd46c('0x21')]();});}};}function handleEntityNotFound(_0xd317f1){return function(_0x33b722){if(!_0x33b722){_0xd317f1[_0xd46c('0x28')](0x194);}return _0x33b722;};}function handleError(_0xe617a8,_0xb69334){_0xb69334=_0xb69334||0x1f4;return function(_0x276a8d){logger['error'](_0x276a8d[_0xd46c('0x29')]);if(_0x276a8d[_0xd46c('0x2a')]){delete _0x276a8d[_0xd46c('0x2a')];}_0xe617a8[_0xd46c('0x20')](_0xb69334)['send'](_0x276a8d);};}function getMustacheRender(_0x4ac681,_0x142740){return Mustache[_0xd46c('0x2b')](_0x4ac681,_[_0xd46c('0x2c')](_0x142740['body'],{'contact':_0x142740[_0xd46c('0x2d')],'message':_0x142740[_0xd46c('0x1e')],'agent':_0x142740[_0xd46c('0x2e')],'interaction':_0x142740[_0xd46c('0x2f')],'account':_0x142740[_0xd46c('0x30')]}))||'';}exports['index']=function(_0xf34dd6,_0x3a67c8){var _0x488f5a={};var _0x2779db=_['map'](db[_0xd46c('0x31')][_0xd46c('0x32')],function(_0x203a1c){return{'name':_0x203a1c['fieldName'],'type':_0x203a1c['type']['key']};});_0x488f5a=qs[_0xd46c('0x33')](_0x2779db,_0xf34dd6);return interaction[_0xd46c('0x34')](_0xd46c('0x35'),_0xf34dd6[_0xd46c('0x36')],_0xf34dd6['user'],_0x488f5a,_0x2779db)['then'](respondWithFilteredResult(_0x3a67c8,_0x488f5a))[_0xd46c('0x1f')](handleError(_0x3a67c8,null));};exports[_0xd46c('0x37')]=function(_0xa1dc2c,_0x45858b){var _0x2c55df={'raw':![],'where':{'id':_0xa1dc2c[_0xd46c('0x38')]['id']}},_0x1d75fe={};_0x1d75fe['model']=_[_0xd46c('0x39')](db[_0xd46c('0x31')][_0xd46c('0x32')]);_0x1d75fe[_0xd46c('0x36')]=_['keys'](_0xa1dc2c['query']);_0x1d75fe[_0xd46c('0x3a')]=_[_0xd46c('0x3b')](_0x1d75fe[_0xd46c('0x3c')],_0x1d75fe[_0xd46c('0x36')]);_0x2c55df[_0xd46c('0x3d')]=_[_0xd46c('0x3b')](_0x1d75fe[_0xd46c('0x3c')],qs[_0xd46c('0x3e')](_0xa1dc2c[_0xd46c('0x36')][_0xd46c('0x3e')]));_0x2c55df['attributes']=_0x2c55df[_0xd46c('0x3d')][_0xd46c('0x3f')]?_0x2c55df[_0xd46c('0x3d')]:_0x1d75fe['model'];if(_0xa1dc2c['query'][_0xd46c('0x40')]){_0x2c55df[_0xd46c('0x41')]=[{'all':!![]}];}_0x2c55df=_[_0xd46c('0x2c')]({},_0x2c55df,_0xa1dc2c['options']);return db[_0xd46c('0x31')][_0xd46c('0x42')](_0x2c55df)['then'](handleEntityNotFound(_0x45858b,null))[_0xd46c('0x16')](respondWithResult(_0x45858b,null))[_0xd46c('0x1f')](handleError(_0x45858b,null));};exports[_0xd46c('0x43')]=function(_0x6eb1aa,_0x6c4c4c){return db['ChatInteraction'][_0xd46c('0x43')](_0x6eb1aa[_0xd46c('0x44')],{})[_0xd46c('0x16')](respondWithResult(_0x6c4c4c,0xc9))[_0xd46c('0x1f')](handleError(_0x6c4c4c,null));};exports[_0xd46c('0x45')]=function(_0x4c814f,_0x174273){if(_0x4c814f[_0xd46c('0x44')]['id']){delete _0x4c814f['body']['id'];}return db['ChatInteraction'][_0xd46c('0x42')]({'where':{'id':_0x4c814f[_0xd46c('0x38')]['id']}})['then'](handleEntityNotFound(_0x174273,null))[_0xd46c('0x16')](saveUpdates(_0x4c814f[_0xd46c('0x44')],null))['then'](respondWithResult(_0x174273,null))['catch'](handleError(_0x174273,null));};exports[_0xd46c('0x27')]=function(_0x422ce4,_0x446864){return db[_0xd46c('0x31')][_0xd46c('0x42')]({'where':{'id':_0x422ce4['params']['id']}})[_0xd46c('0x16')](handleEntityNotFound(_0x446864,null))[_0xd46c('0x16')](removeEntity(_0x446864,null))[_0xd46c('0x1f')](handleError(_0x446864,null));};exports['describe']=function(_0x29958e,_0x293a0b){return db['ChatInteraction']['describe']()[_0xd46c('0x16')](respondWithResult(_0x293a0b,null))[_0xd46c('0x1f')](handleError(_0x293a0b,null));};exports[_0xd46c('0x46')]=function(_0x9bd5c5,_0x4c1735){var _0x46f791=_0x9bd5c5[_0xd46c('0x38')]['id'];var _0x2adf26;var _0x31bae3;var _0x360eef;return db[_0xd46c('0x31')][_0xd46c('0x47')]({'where':{'id':_0x46f791}})['then'](function(_0xc09054){_0x2adf26=_0xc09054;return db[_0xd46c('0x48')]['findOne']({'where':{'id':_0xc09054[_0xd46c('0x49')]},'attributes':['id',_0xd46c('0x4a'),_0xd46c('0x4b'),_0xd46c('0x4c'),_0xd46c('0x4d'),_0xd46c('0x4e')],'raw':!![]});})['then'](function(_0x42b2ec){if(_0x42b2ec&&_0x42b2ec['vidaooApiKey']&&_0x42b2ec[_0xd46c('0x4b')]){_0x31bae3=_0x42b2ec;var _0x551d9f={'interaction':{'id':_0x46f791},'agent':{'id':_0x9bd5c5[_0xd46c('0x4f')]['id'],'name':_0x9bd5c5[_0xd46c('0x4f')][_0xd46c('0x2a')],'fullname':_0x9bd5c5['user'][_0xd46c('0x50')],'email':_0x9bd5c5[_0xd46c('0x4f')]['email']},'contact':_0x9bd5c5[_0xd46c('0x44')][_0xd46c('0x2d')],'account':_0x9bd5c5[_0xd46c('0x44')][_0xd46c('0x30')]};var _0x59e667={'rejectUnauthorized':![],'method':_0xd46c('0x51'),'url':_0xd46c('0x52'),'headers':{'X-APIKEY':_0x42b2ec[_0xd46c('0x4a')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x9bd5c5['user'][_0xd46c('0x53')]],'buttons':null,'topic':_0x31bae3[_0xd46c('0x4c')],'note':_['isNull'](_0x31bae3[_0xd46c('0x4d')])?null:getMustacheRender(_0x31bae3[_0xd46c('0x4d')],_0x551d9f),'metadata':null},'redirect':_0xd46c('0x54'),'json':!![]};try{if(!_[_0xd46c('0x55')](_0x31bae3[_0xd46c('0x4e')])){var _0xb240b5=getMustacheRender(_0x31bae3['vidaooMetadata'],_0x551d9f);var _0x51f03c=JSON[_0xd46c('0x56')](_0xb240b5);_0x59e667[_0xd46c('0x44')][_0xd46c('0x57')]=_0x51f03c;}}catch(_0x185be9){throw new db[(_0xd46c('0x58'))][(_0xd46c('0x59'))](_0xd46c('0x5a'));}return rp(_0x59e667);}else{throw new db[(_0xd46c('0x58'))][(_0xd46c('0x59'))](_0xd46c('0x5b'));}})[_0xd46c('0x16')](function(_0x31b85b){_0x360eef=_0x31b85b;if(_0x360eef['id']){var _0xe4f86b={'body':_0x360eef[_0xd46c('0x5c')],'ChatWebsiteId':_0x31bae3['id'],'ChatInteractionId':_0x2adf26['id'],'direction':_0xd46c('0x5d'),'UserId':_0x9bd5c5[_0xd46c('0x4f')]['id']};return db['ChatMessage'][_0xd46c('0x43')](_0xe4f86b,{});}else{throw new db[(_0xd46c('0x58'))][(_0xd46c('0x59'))](_0xd46c('0x5e'));}})[_0xd46c('0x16')](function(){return _0x2adf26[_0xd46c('0x5f')]({'vidaooSessionId':_0x360eef['id']});})[_0xd46c('0x16')](respondWithResult(_0x4c1735,null))[_0xd46c('0x1f')](handleError(_0x4c1735,null));};exports['customUpdate']=function(_0x59e87b,_0x441c88){if(_0x59e87b[_0xd46c('0x44')]['id']){delete _0x59e87b['body']['id'];}return db[_0xd46c('0x31')]['find']({'where':{'id':_0x59e87b[_0xd46c('0x38')]['id']},'include':[{'model':db[_0xd46c('0x60')],'as':_0xd46c('0x61')}]})[_0xd46c('0x16')](handleEntityNotFound(_0x441c88,null))[_0xd46c('0x16')](saveUpdates(_0x59e87b['body'],null))[_0xd46c('0x16')](respondWithResult(_0x441c88,null))[_0xd46c('0x1f')](handleError(_0x441c88,null));};exports[_0xd46c('0x62')]=function(_0x240f50,_0x251192){if(_0x240f50['body']['id']){delete _0x240f50[_0xd46c('0x44')]['id'];}return db[_0xd46c('0x31')]['find']({'where':{'id':_0x240f50[_0xd46c('0x38')]['id']}})[_0xd46c('0x16')](function(_0x31d5cf){if(!_0x31d5cf){logger[_0xd46c('0x1d')](_0xd46c('0x63'),_0xd46c('0x62'),0x194,'entity\x20not\x20found');_0x251192[_0xd46c('0x28')](0x194);}else{if(_0x31d5cf[_0xd46c('0x64')]){throw new db[(_0xd46c('0x58'))][(_0xd46c('0x59'))]('Interaction\x20already\x20assigned');}}return _0x31d5cf;})['then'](function(_0x3ab6fd){if(_0x3ab6fd){return _0x3ab6fd[_0xd46c('0x45')]({'closed':_0x240f50[_0xd46c('0x44')][_0xd46c('0x65')],'disposition':_0x240f50[_0xd46c('0x44')][_0xd46c('0x66')]})[_0xd46c('0x16')](function(_0x278f11){return _0x278f11;});}})[_0xd46c('0x16')](function(){return respondWithRpcPromise('AbandonInteraction',_0xd46c('0x62'),_0x240f50['body'],client9004);})[_0xd46c('0x16')](respondWithResult(_0x251192,null))[_0xd46c('0x1f')](handleError(_0x251192,null));};exports[_0xd46c('0x67')]=function(_0x5c5885,_0x13ab5d){_0x5c5885['body'][_0xd46c('0x2a')]=_0x5c5885[_0xd46c('0x68')]['originalname'];_0x5c5885[_0xd46c('0x44')]['basename']=_0x5c5885[_0xd46c('0x68')][_0xd46c('0x69')];_0x5c5885[_0xd46c('0x44')]['type']=_0x5c5885[_0xd46c('0x68')][_0xd46c('0x6a')];return db[_0xd46c('0x6b')][_0xd46c('0x43')](_0x5c5885[_0xd46c('0x44')])[_0xd46c('0x16')](respondWithResult(_0x13ab5d,0xc9))[_0xd46c('0x1f')](handleError(_0x13ab5d,null));};exports['attachmentDownload']=function(_0x5ae616,_0x9e16bd){return db['ChatInteraction'][_0xd46c('0x47')]({'where':{'id':_0x5ae616[_0xd46c('0x38')]['id']},'raw':!![]})[_0xd46c('0x16')](handleEntityNotFound(_0x9e16bd,null))['then'](function(_0xbeeb3f){if(_0xbeeb3f){if(_0xbeeb3f['closed']){return _0x9e16bd['status'](0x193)[_0xd46c('0x22')]({'status':0x193,'message':_0xd46c('0x6c')});}return db[_0xd46c('0x6b')]['findOne']({'where':{'id':_0x5ae616[_0xd46c('0x36')][_0xd46c('0x6d')]},'raw':!![]})[_0xd46c('0x16')](handleEntityNotFound(_0x9e16bd,null));}})[_0xd46c('0x16')](function(_0x1ecc38){if(_0x1ecc38){var _0x36e344=_0x1ecc38[_0xd46c('0x6e')]!==null;var _0x39b29c=path[_0xd46c('0x6f')](config[_0xd46c('0x70')],_0xd46c('0x71'));if(_0x36e344){_0x39b29c=path[_0xd46c('0x6f')](_0x39b29c,'offline-chat/');}var _0x4341d8=path[_0xd46c('0x6f')](_0x39b29c,_0x1ecc38[_0xd46c('0x72')]);return _0x9e16bd[_0xd46c('0x73')](_0x4341d8);}})[_0xd46c('0x1f')](handleError(_0x9e16bd,null));};exports[_0xd46c('0x74')]=function(_0x185745,_0x5ac508){var _0x4225c3=null;var _0x168d74=null;var _0x25de03=null;if(_0x185745['body']['id']){delete _0x185745[_0xd46c('0x44')]['id'];}if(_0x185745[_0xd46c('0x44')]['mailTranscript']){_0x25de03=path[_0xd46c('0x6f')](config[_0xd46c('0x70')],_0xd46c('0x75'),util[_0xd46c('0x76')](_0xd46c('0x77'),Date[_0xd46c('0x78')]()));_0x185745[_0xd46c('0x44')][_0xd46c('0x79')]=_0x25de03;}return db[_0xd46c('0x31')]['find']({'where':{'id':_0x185745[_0xd46c('0x38')]['id']},'include':[{'model':db[_0xd46c('0x7a')],'as':'Messages','include':[{'model':db[_0xd46c('0x7b')],'as':_0xd46c('0x7b')}]}]})['then'](handleEntityNotFound(_0x5ac508,null))[_0xd46c('0x16')](saveUpdates(_0x185745['body'],null))[_0xd46c('0x16')](function(_0x253a95){if(_0x253a95){_0x4225c3=_0x253a95;return db[_0xd46c('0x48')][_0xd46c('0x42')]({'where':{'id':_0x4225c3['ChatWebsiteId']}});}})['then'](function(_0x5dd220){if(_0x5dd220){_0x168d74=_0x5dd220;return db[_0xd46c('0x60')][_0xd46c('0x42')]({'where':{'id':_0x4225c3['ContactId']}});}})[_0xd46c('0x16')](function(_0x26d5e8){if(_0x26d5e8){if(_0x25de03){var _0x1c1805=null;for(var _0x3641ce=0x1;_0x3641ce<_0x4225c3[_0xd46c('0x7c')][_0xd46c('0x3f')];++_0x3641ce){_0x1c1805=_0x4225c3['Messages'][_0x3641ce];var _0x24a7c1=_0x1c1805['UserId']?util[_0xd46c('0x76')](_0xd46c('0x7d'),_0x168d74['agentAlias'],_0x1c1805['UserId']):_0xd46c('0x7e');var _0x2a7da5=_0x185745[_0xd46c('0x44')][_0xd46c('0x7f')]||util[_0xd46c('0x76')](_0xd46c('0x7d'),'Visitor',_0x1c1805[_0xd46c('0x80')]);switch(_0x168d74[_0xd46c('0x81')]){case _0xd46c('0x82'):_0x24a7c1=_0x1c1805['UserId']?util[_0xd46c('0x76')](_0xd46c('0x7d'),_0x168d74[_0xd46c('0x83')],_0x1c1805[_0xd46c('0x64')]):_0xd46c('0x7e');break;case _0xd46c('0x84'):_0x24a7c1=_0x1c1805['UserId']?_0x1c1805['User'][_0xd46c('0x85')]||_0x1c1805['User'][_0xd46c('0x50')]:'System';break;case'agent_fullname':_0x24a7c1=_0x1c1805[_0xd46c('0x64')]?_0x1c1805[_0xd46c('0x7b')]['fullname']:_0xd46c('0x7e');break;default:_0x24a7c1=_0x1c1805['UserId']?util['format'](_0xd46c('0x7d'),_0x168d74[_0xd46c('0x83')],_0x1c1805[_0xd46c('0x64')]):_0xd46c('0x7e');}var _0x190400=util[_0xd46c('0x76')](_0xd46c('0x86'),moment(_0x1c1805['createdAt'])['format'](_0xd46c('0x87')),_0x1c1805['direction']==='in'?_0x2a7da5:_0x24a7c1,_0x1c1805[_0xd46c('0x44')]);if(!_0x1c1805['secret']){fs[_0xd46c('0x88')](_0x25de03,_0x190400);}}return db[_0xd46c('0x89')][_0xd46c('0x47')]({'where':{'service':!![]},'include':[{'model':db[_0xd46c('0x8a')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xd46c('0x8b')],'as':_0xd46c('0x8b'),'raw':!![]}]}]});}}})[_0xd46c('0x16')](function(_0x41bdaf){if(!_0x41bdaf||!_0x41bdaf[_0xd46c('0x8c')]||!_0x185745[_0xd46c('0x44')])return _0x4225c3;var _0x34f02e=_0x41bdaf[_0xd46c('0x8d')]();return respondWithRpcPromise(_0xd46c('0x8e'),'sendMail',{'account':_0x34f02e,'message':{'from':util[_0xd46c('0x76')](_0xd46c('0x8f'),_0x41bdaf[_0xd46c('0x2a')],_0x41bdaf[_0xd46c('0x53')]||_0x41bdaf[_0xd46c('0x8c')][_0xd46c('0x4f')]),'to':_0x185745['body']['mailTranscript'],'subject':_0xd46c('0x90'),'text':util[_0xd46c('0x76')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x185745[_0xd46c('0x44')]['mailTranscript']),'attachments':[{'path':_0x25de03}]}})[_0xd46c('0x16')](function(){return _0x4225c3;})['catch'](function(_0x476609){logger[_0xd46c('0x1d')](_0x476609);});})[_0xd46c('0x16')](respondWithStatusCode(_0x5ac508,0xc8))[_0xd46c('0x1f')](handleError(_0x5ac508,null));};exports[_0xd46c('0x91')]=function(_0x56dab4,_0x21074d){return db[_0xd46c('0x7a')][_0xd46c('0x42')]({'where':{'id':_0x56dab4[_0xd46c('0x38')]['id']}})[_0xd46c('0x16')](handleEntityNotFound(_0x21074d,null))[_0xd46c('0x16')](function(_0x4f625d){if(_0x4f625d){return _0x4f625d[_0xd46c('0x91')](_0x56dab4[_0xd46c('0x44')][_0xd46c('0x92')],_[_0xd46c('0x93')](_0x56dab4[_0xd46c('0x44')],[_0xd46c('0x92'),'id'])||{});}})['then'](respondWithResult(_0x21074d,null))[_0xd46c('0x1f')](handleError(_0x21074d,null));};exports['getMessages']=function(_0x11eddc,_0x5f37d9){var _0x420f4b={'raw':![],'where':{}};var _0x2455d5={};var _0x5d2d22={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xd46c('0x47')]({'where':{'id':_0x11eddc[_0xd46c('0x38')]['id']}})['then'](handleEntityNotFound(_0x5f37d9,null))[_0xd46c('0x16')](function(_0x596b75){if(_0x596b75){_0x2455d5[_0xd46c('0x3c')]=_[_0xd46c('0x39')](db[_0xd46c('0x7a')][_0xd46c('0x32')]);_0x2455d5[_0xd46c('0x36')]=_[_0xd46c('0x39')](_0x11eddc[_0xd46c('0x36')]);_0x2455d5[_0xd46c('0x3a')]=_[_0xd46c('0x3b')](_0x2455d5[_0xd46c('0x3c')],_0x2455d5['query']);_0x420f4b[_0xd46c('0x3d')]=_[_0xd46c('0x3b')](_0x2455d5['model'],qs['fields'](_0x11eddc[_0xd46c('0x36')][_0xd46c('0x3e')]));_0x420f4b[_0xd46c('0x3d')]=_0x420f4b[_0xd46c('0x3d')][_0xd46c('0x3f')]?_0x420f4b[_0xd46c('0x3d')]:_0x2455d5[_0xd46c('0x3c')];if(!_0x11eddc[_0xd46c('0x36')][_0xd46c('0x94')](_0xd46c('0x95'))){_0x420f4b[_0xd46c('0x96')]=qs[_0xd46c('0x96')](_0x11eddc[_0xd46c('0x36')]['limit']);_0x420f4b[_0xd46c('0x23')]=qs['offset'](_0x11eddc['query'][_0xd46c('0x23')]);}_0x420f4b[_0xd46c('0x97')]=qs[_0xd46c('0x98')](_0x11eddc[_0xd46c('0x36')][_0xd46c('0x98')]);_0x420f4b['where']=qs[_0xd46c('0x3a')](_[_0xd46c('0x99')](_0x11eddc[_0xd46c('0x36')],_0x2455d5[_0xd46c('0x3a')]));_0x420f4b['where'][_0xd46c('0x9a')]=_0x596b75['id'];if(_0x11eddc[_0xd46c('0x36')][_0xd46c('0x9b')]){_0x420f4b[_0xd46c('0x9c')]=_['merge'](_0x420f4b[_0xd46c('0x9c')],{'$or':_[_0xd46c('0x9d')](_0x420f4b['attributes'],function(_0x411b58){var _0x16e332={};_0x16e332[_0x411b58]={'$like':'%'+_0x11eddc['query'][_0xd46c('0x9b')]+'%'};return _0x16e332;})});}if(_0x11eddc[_0xd46c('0x36')]['$gte']){var _0x476cf5=_0x11eddc['query'][_0xd46c('0x9e')]['split'](',');var _0x485e8e={};_0x485e8e[_0x476cf5[0x0]]={'$gte':moment(_0x476cf5[0x1])[_0xd46c('0x76')](_0xd46c('0x9f'))};_0x420f4b[_0xd46c('0x9c')]=_[_0xd46c('0x2c')](_0x420f4b[_0xd46c('0x9c')],_0x485e8e);}_0x420f4b=_[_0xd46c('0x2c')]({},_0x420f4b,_0x11eddc[_0xd46c('0xa0')]);return db[_0xd46c('0x7a')][_0xd46c('0x25')]({'where':_0x420f4b[_0xd46c('0x9c')]})[_0xd46c('0x16')](function(_0x3fbc0f){_0x5d2d22[_0xd46c('0x25')]=_0x3fbc0f;if(_0x11eddc['query'][_0xd46c('0x40')]){_0x420f4b[_0xd46c('0x41')]=[{'all':!![]}];}return db['ChatMessage'][_0xd46c('0x34')](_0x420f4b);})[_0xd46c('0x16')](function(_0x367aa8){_0x5d2d22['rows']=_0x367aa8;return _0x5d2d22;});}})[_0xd46c('0x16')](respondWithFilteredResult(_0x5f37d9,_0x420f4b))['catch'](handleError(_0x5f37d9,null));};exports[_0xd46c('0xa1')]=function(_0x156433,_0x23b64a){var _0x148565={'where':{}},_0x554719={},_0x3657a4={'count':0x0,'rows':[]};return db[_0xd46c('0x31')][_0xd46c('0x47')]({'where':{'id':_0x156433[_0xd46c('0x38')]['id']}})[_0xd46c('0x16')](handleEntityNotFound(_0x23b64a,null))[_0xd46c('0x16')](function(_0x574229){if(_0x574229){_0x554719['model']=_[_0xd46c('0x39')](db[_0xd46c('0x7a')][_0xd46c('0x32')]);_0x554719[_0xd46c('0x36')]=_[_0xd46c('0x39')](_0x156433[_0xd46c('0x36')]);_0x554719[_0xd46c('0x3a')]=_['intersection'](_0x554719[_0xd46c('0x3c')],_0x554719[_0xd46c('0x36')]);_0x148565[_0xd46c('0x3d')]=_['intersection'](_0x554719[_0xd46c('0x3c')],qs[_0xd46c('0x3e')](_0x156433['query'][_0xd46c('0x3e')]));_0x148565[_0xd46c('0x3d')]=_0x148565[_0xd46c('0x3d')]['length']?_0x148565['attributes']:_0x554719[_0xd46c('0x3c')];if(!_0x156433['query'][_0xd46c('0x94')](_0xd46c('0x95'))){_0x148565[_0xd46c('0x96')]=qs[_0xd46c('0x96')](_0x156433[_0xd46c('0x36')][_0xd46c('0x96')]);_0x148565['offset']=qs[_0xd46c('0x23')](_0x156433[_0xd46c('0x36')][_0xd46c('0x23')]);}_0x148565['order']=qs[_0xd46c('0x98')](_0x156433[_0xd46c('0x36')][_0xd46c('0x98')]);_0x148565['where']=qs[_0xd46c('0x3a')](_['pick'](_0x156433['query'],_0x554719[_0xd46c('0x3a')]));_0x148565[_0xd46c('0x9c')][_0xd46c('0x9a')]=_0x574229['id'];if(_0x156433[_0xd46c('0x36')][_0xd46c('0x9b')]){_0x148565[_0xd46c('0x9c')]=_['merge'](_0x148565[_0xd46c('0x9c')],{'$or':_[_0xd46c('0x9d')](_0x148565[_0xd46c('0x3d')],function(_0x7231db){var _0x2e9641={};_0x2e9641[_0x7231db]={'$like':'%'+_0x156433[_0xd46c('0x36')]['filter']+'%'};return _0x2e9641;})});}_0x148565['where']['secret']=![];if(_0x156433[_0xd46c('0x36')]['id']){_0x148565[_0xd46c('0x9c')]['id']={'$gt':_0x156433['query']['id']};}_0x148565=_[_0xd46c('0x2c')]({},_0x148565,_0x156433[_0xd46c('0xa0')]);return db[_0xd46c('0x7a')][_0xd46c('0x25')]({'where':_0x148565[_0xd46c('0x9c')]})[_0xd46c('0x16')](function(_0x51ee21){_0x3657a4[_0xd46c('0x25')]=_0x51ee21;_0x148565['include']=[];if(_0x156433[_0xd46c('0x36')][_0xd46c('0xa2')]){_0x148565[_0xd46c('0x41')][_0xd46c('0xa3')]({'model':db['User'],'as':_0xd46c('0x7b'),'attributes':['id','fullname',_0xd46c('0x85')]});}if(_0x156433[_0xd46c('0x36')][_0xd46c('0x40')]){_0x148565['include']=[{'all':!![]}];}return db[_0xd46c('0x7a')][_0xd46c('0x34')](_0x148565);})['then'](function(_0x5b99f1){_0x3657a4[_0xd46c('0xa4')]=_0x5b99f1;return _0x3657a4;});}})[_0xd46c('0x16')](respondWithFilteredResult(_0x23b64a,_0x148565))[_0xd46c('0x1f')](handleError(_0x23b64a,null));};exports[_0xd46c('0xa5')]=function(_0x1842a4,_0x4c2ade){return db[_0xd46c('0x31')]['find']({'where':{'id':_0x1842a4[_0xd46c('0x38')]['id']}})[_0xd46c('0x16')](handleEntityNotFound(_0x4c2ade,null))[_0xd46c('0x16')](function(_0x3a2006){if(_0x3a2006){return _0x3a2006['setTags'](_0x1842a4[_0xd46c('0x44')][_0xd46c('0x92')],_[_0xd46c('0x93')](_0x1842a4[_0xd46c('0x44')],['ids','id'])||{})[_0xd46c('0xa6')](function(){return db[_0xd46c('0xa7')]['findAll']({'attributes':['id',_0xd46c('0x2a'),'color'],'where':{'id':_0x1842a4['body']['ids']}});})[_0xd46c('0x16')](function(_0x50ef21){socket[_0xd46c('0xa8')](_0xd46c('0xa9'),{'id':Number(_0x1842a4[_0xd46c('0x38')]['id']),'tags':_0x50ef21||[]});return{'id':Number(_0x1842a4[_0xd46c('0x38')]['id']),'tags':_0x50ef21||[]};});}})[_0xd46c('0x16')](respondWithResult(_0x4c2ade,null))[_0xd46c('0x1f')](handleError(_0x4c2ade,null));};exports[_0xd46c('0xaa')]=function(_0x3b2391,_0x1d9174){return db['ChatInteraction'][_0xd46c('0x42')]({'where':{'id':_0x3b2391[_0xd46c('0x38')]['id']}})[_0xd46c('0x16')](handleEntityNotFound(_0x1d9174,null))[_0xd46c('0x16')](function(_0x188f39){if(_0x188f39){return _0x188f39[_0xd46c('0xaa')](_0x3b2391[_0xd46c('0x36')][_0xd46c('0x92')]);}})[_0xd46c('0x16')](respondWithStatusCode(_0x1d9174,null))[_0xd46c('0x1f')](handleError(_0x1d9174,null));};exports[_0xd46c('0x73')]=function(_0x3037ef,_0x2a7e65){var _0x3389cd=moment()['unix']()['toString']();var _0x2d22a2=path[_0xd46c('0x6f')](config[_0xd46c('0x70')],_0xd46c('0xab'),'files','tmp');var _0x1aeaf1=path[_0xd46c('0x6f')](config[_0xd46c('0x70')],_0xd46c('0xab'),_0xd46c('0xac'),_0xd46c('0xad'));var _0x472f75=path[_0xd46c('0x6f')](_0x2d22a2,_0x3389cd);var _0x578902=util[_0xd46c('0x76')](_0xd46c('0xae'),_0x3037ef[_0xd46c('0x38')]['id'],_0x3389cd);var _0x435133=path[_0xd46c('0x6f')](_0x2d22a2,_0x578902);var _0x36007f=[];_0x36007f[_0xd46c('0xa3')]({'model':db['User'],'as':_0xd46c('0x7b'),'attributes':['id','fullname'],'raw':!![]});_0x36007f[_0xd46c('0xa3')]({'model':db[_0xd46c('0x60')],'as':_0xd46c('0x61'),'attributes':['id',_0xd46c('0xaf'),_0xd46c('0xb0')],'raw':!![]});if(_0x3037ef[_0xd46c('0x36')][_0xd46c('0xad')]){_0x36007f['push']({'model':db[_0xd46c('0x6b')],'as':_0xd46c('0x6b'),'raw':!![]});}var _0x486e94=[{'model':db[_0xd46c('0x7a')],'as':_0xd46c('0x7c'),'attributes':['id',_0xd46c('0x44'),_0xd46c('0xb1'),'direction',_0xd46c('0xb2'),_0xd46c('0xb3')],'include':_0x36007f}];_0x486e94[_0xd46c('0xa3')]({'model':db[_0xd46c('0x48')],'as':_0xd46c('0xb4'),'attributes':['id',_0xd46c('0x2a')]});_0x486e94[_0xd46c('0xa3')]({'model':db[_0xd46c('0x7b')],'as':_0xd46c('0xb5'),'attributes':['id',_0xd46c('0x50')]});return db[_0xd46c('0x31')][_0xd46c('0x42')]({'where':{'id':_0x3037ef[_0xd46c('0x38')]['id']},'include':_0x486e94})[_0xd46c('0x16')](handleEntityNotFound(_0x2a7e65,null))['then'](function(_0x22acdf){if(_0x22acdf){var _0x20bd4b=_0x22acdf[_0xd46c('0xb6')]({'plain':!![]});fs[_0xd46c('0xb7')](_0x472f75);var _0x4a21d4={'channel':_0xd46c('0xb8'),'account':_0x20bd4b[_0xd46c('0xb4')][_0xd46c('0x2a')],'agent':_0x20bd4b['Owner']?_0x20bd4b['Owner'][_0xd46c('0x50')]:_0xd46c('0xb9'),'createdAt':moment(_0x20bd4b['createdAt'])[_0xd46c('0x76')](_0xd46c('0x9f'))[_0xd46c('0xba')](),'closedAt':_0x20bd4b[_0xd46c('0x65')]?moment(_0x20bd4b[_0xd46c('0xbb')])[_0xd46c('0x76')]('YYYY-MM-DD\x20HH:mm:ss')[_0xd46c('0xba')]():'','disposition':_0x20bd4b[_0xd46c('0x66')],'chatInfo':{'browser':_0x20bd4b[_0xd46c('0xbc')],'os':_0x20bd4b[_0xd46c('0xbd')],'referer':_0x20bd4b[_0xd46c('0xbe')],'customerIp':_0x20bd4b['customerIp'],'customerPort':_0x20bd4b[_0xd46c('0xbf')]?_0x20bd4b['customerPort']:_0xd46c('0xb9')},'messages':_(_0x20bd4b[_0xd46c('0x7c')])['tail']()[_0xd46c('0x9b')]({'secret':![]})[_0xd46c('0x9d')](function(_0x32dc17){if(_0x32dc17[_0xd46c('0x6b')]){var _0x285d4f=path[_0xd46c('0x6f')](_0x1aeaf1,_0x32dc17[_0xd46c('0x6b')][_0xd46c('0x72')]);if(fs[_0xd46c('0xc0')](_0x285d4f)){fs[_0xd46c('0xc1')](_0x285d4f)[_0xd46c('0xc2')](fs[_0xd46c('0xc3')](path[_0xd46c('0x6f')](_0x472f75,_0x32dc17[_0xd46c('0x6b')][_0xd46c('0x72')])));}}return{'date':moment(_0x32dc17[_0xd46c('0xb1')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xd46c('0xba')](),'sender':_0x32dc17[_0xd46c('0xc4')]===_0xd46c('0x5d')?_0x32dc17['User']?_0x32dc17[_0xd46c('0x7b')]['fullname']:_0xd46c('0x7e'):_0x32dc17[_0xd46c('0x61')]['firstName']+(_0x32dc17[_0xd46c('0x61')]['lastName']?'\x20'+_0x32dc17[_0xd46c('0x61')][_0xd46c('0xb0')]:''),'body':_0x32dc17[_0xd46c('0x6b')]?_0x32dc17['Attachment'][_0xd46c('0x72')]:_0x32dc17['body'],'direction':_0x32dc17[_0xd46c('0xc4')]===_0xd46c('0x5d')?'A':'C','secret':_0x32dc17[_0xd46c('0xb2')],'read':_0x32dc17['read'],'attachment':_0x32dc17[_0xd46c('0x6b')]};})[_0xd46c('0xc5')]()};return ejs[_0xd46c('0xc6')](path['join'](config['root'],_0xd46c('0xab'),_0xd46c('0xc7'),_0xd46c('0xc8')),{'interaction':_0x4a21d4})[_0xd46c('0x16')](function(_0x152de0){var _0x434f20=path['join'](_0x472f75,_0xd46c('0xc9')+_0x20bd4b['id']+'-'+_0x3389cd+_0xd46c('0xca'));var _0x293ce8={'path':_0x434f20,'channel':_0xd46c('0xb8'),'interactionId':_0x20bd4b['id']};return pdf['createPdfFromHTML'](_0x152de0,_0x293ce8);})[_0xd46c('0x16')](function(){return new Promise(function(_0x1854e7,_0x1c0d5d){zipdir(_0x472f75,{'saveTo':_0x435133},function(_0xea0465,_0x53028c){if(_0xea0465)return _0x1c0d5d(_0xea0465);return _0x1854e7(_0x53028c);});})[_0xd46c('0x16')](function(){return new BPromise(function(_0x3b6ff9,_0x469e2f){rimraf(_0x472f75,function(_0x3ff754){if(_0x3ff754)_0x469e2f(_0x3ff754);return _0x3b6ff9();});});})[_0xd46c('0x16')](function(){return _0x2a7e65[_0xd46c('0x73')](_0x435133,_0x578902,function(_0x5f054d){if(_0x5f054d){logger[_0xd46c('0x1d')](_0xd46c('0xcb'),_0x5f054d);}else{fs[_0xd46c('0xcc')](_0x435133);}});});});}else{return _0x2a7e65['sendStatus'](0xc8);}})[_0xd46c('0x1f')](handleError(_0x2a7e65,null));}; \ No newline at end of file +var _0xd762=['../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../mysqldb','defaults','socket.io-emitter','./chatInteraction.socket','register','client','http','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','ChatInteraction,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','json','offset','limit','count','set','Content-Range','update','destroy','stack','name','send','render','merge','body','contact','agent','interaction','account','map','rawAttributes','type','key','getOptions','findAll','query','user','show','keys','ChatInteraction','filters','intersection','model','attributes','fields','length','includeAll','include','options','create','find','params','describe','createVidaooSession','findOne','vidaooTopic','vidaooNote','vidaooApiKey','vidaooEscalation','fullname','email','POST','isNull','vidaooMetadata','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','out','ChatMessage','updateAttributes','customUpdate','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','file','originalname','filename','mimetype','Attachment','attachmentDownload','Unauthorized','ChatOfflineMessageId','offline-chat/','join','download','close','mailTranscript','root','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','User','ContactId','%s%d','agentAlias','customer','website_alias','agent_alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','MailAccount','MailServerOut','Smtp','CloudProvider','SendMail','sendMail','Mail\x20Transcript','addMessage','ids','omit','getMessages','hasOwnProperty','nolimit','order','sort','where','pick','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rows','getMyMessages','push','alias','addTags','setTags','spread','color','chatInteractionTags:save','removeTags','toString','server','tmp','attachments','firstName','lastName','read','ChatWebsite','Owner','get','mkdirSync','Account','N.A.','browserName','referer','customerIp','customerPort','tail','basename','existsSync','createReadStream','createWriteStream','System','value','views','downloadInteraction.ejs','transcript-','.pdf','Chat','err','unlinkSync','rimraf','zip-dir','request-promise','moment','bluebird','util','path','ejs','lodash','ioredis'];(function(_0x275745,_0x2df1dd){var _0xb260c1=function(_0x1ccbb8){while(--_0x1ccbb8){_0x275745['push'](_0x275745['shift']());}};_0xb260c1(++_0x2df1dd);}(_0xd762,0xc1));var _0x2d76=function(_0x296079,_0x14e860){_0x296079=_0x296079-0x0;var _0x268dda=_0xd762[_0x296079];return _0x268dda;};'use strict';var rimraf=require(_0x2d76('0x0'));var zipdir=require(_0x2d76('0x1'));var rp=require(_0x2d76('0x2'));var moment=require(_0x2d76('0x3'));var BPromise=require(_0x2d76('0x4'));var Mustache=require('mustache');var util=require(_0x2d76('0x5'));var path=require(_0x2d76('0x6'));var ejs=require(_0x2d76('0x7'));var fs=require('fs');var _=require(_0x2d76('0x8'));var Redis=require(_0x2d76('0x9'));var interaction=require('../../components/interaction/service');var qs=require(_0x2d76('0xa'));var pdf=require(_0x2d76('0xb'));var logger=require(_0x2d76('0xc'))(_0x2d76('0xd'));var config=require('../../config/environment');var db=require(_0x2d76('0xe'))['db'];config['redis']=_[_0x2d76('0xf')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x2d76('0x10'))(new Redis(config['redis']));require(_0x2d76('0x11'))[_0x2d76('0x12')](socket);var jayson=require('jayson/promise');var client=jayson[_0x2d76('0x13')][_0x2d76('0x14')]({'port':0x232b});var client9004=jayson[_0x2d76('0x13')][_0x2d76('0x14')]({'port':0x232c});function respondWithRpcPromise(_0x355d92,_0x321277,_0x2282e2,_0x5976ec){return new BPromise(function(_0x5288df,_0x509f72){var _0x47d865=_0x5976ec||client;return _0x47d865['request'](_0x355d92,_0x2282e2)[_0x2d76('0x15')](function(_0x5d3b73){logger[_0x2d76('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x321277,_0x2d76('0x17'));logger[_0x2d76('0x18')](_0x2d76('0x19'),_0x321277,_0x2d76('0x17'),JSON[_0x2d76('0x1a')](_0x5d3b73));if(_0x5d3b73[_0x2d76('0x1b')]){if(_0x5d3b73[_0x2d76('0x1b')]['code']===0x1f4){logger['error'](_0x2d76('0x1c'),_0x321277,_0x5d3b73[_0x2d76('0x1b')]['message']);return _0x509f72(_0x5d3b73[_0x2d76('0x1b')][_0x2d76('0x1d')]);}logger[_0x2d76('0x1b')]('ChatInteraction,\x20%s,\x20%s',_0x321277,_0x5d3b73[_0x2d76('0x1b')][_0x2d76('0x1d')]);return _0x5288df(_0x5d3b73['error'][_0x2d76('0x1d')]);}else{logger[_0x2d76('0x16')](_0x2d76('0x1c'),_0x321277,_0x2d76('0x17'));_0x5288df(_0x5d3b73[_0x2d76('0x1e')][_0x2d76('0x1d')]);}})[_0x2d76('0x1f')](function(_0x566982){logger['error'](_0x2d76('0x1c'),_0x321277,_0x566982);_0x509f72(_0x566982);});});}function respondWithStatusCode(_0x19a4af,_0x49d666){_0x49d666=_0x49d666||0xcc;return function(_0x86a49f){if(_0x86a49f){return _0x19a4af[_0x2d76('0x20')](_0x49d666);}return _0x19a4af['status'](_0x49d666)[_0x2d76('0x21')]();};}function respondWithResult(_0x3df81c,_0x5cbc46){_0x5cbc46=_0x5cbc46||0xc8;return function(_0x4e2dae){if(_0x4e2dae){return _0x3df81c[_0x2d76('0x22')](_0x5cbc46)[_0x2d76('0x23')](_0x4e2dae);}};}function respondWithFilteredResult(_0x12622a,_0x48c276){return function(_0x2e99ab){if(_0x2e99ab){var _0x34a32c=typeof _0x48c276[_0x2d76('0x24')]==='undefined'&&typeof _0x48c276[_0x2d76('0x25')]==='undefined';var _0x13c81c=_0x2e99ab[_0x2d76('0x26')];var _0xcce04e=_0x34a32c?0x0:_0x48c276['offset'];var _0x1c8482=_0x34a32c?_0x2e99ab['count']:_0x48c276[_0x2d76('0x24')]+_0x48c276[_0x2d76('0x25')];var _0x48d348;if(_0x1c8482>=_0x13c81c){_0x1c8482=_0x13c81c;_0x48d348=0xc8;}else{_0x48d348=0xce;}_0x12622a[_0x2d76('0x22')](_0x48d348);return _0x12622a[_0x2d76('0x27')](_0x2d76('0x28'),_0xcce04e+'-'+_0x1c8482+'/'+_0x13c81c)['json'](_0x2e99ab);}return null;};}function saveUpdates(_0x2dccb2){return function(_0x2be574){if(_0x2be574){return _0x2be574[_0x2d76('0x29')](_0x2dccb2)[_0x2d76('0x15')](function(_0x611f04){return _0x611f04;});}return null;};}function removeEntity(_0x3f46ae){return function(_0x46ef14){if(_0x46ef14){return _0x46ef14[_0x2d76('0x2a')]()[_0x2d76('0x15')](function(){_0x3f46ae[_0x2d76('0x22')](0xcc)[_0x2d76('0x21')]();});}};}function handleEntityNotFound(_0x42a3d7){return function(_0x1db2c3){if(!_0x1db2c3){_0x42a3d7['sendStatus'](0x194);}return _0x1db2c3;};}function handleError(_0x2a13c3,_0xf2910b){_0xf2910b=_0xf2910b||0x1f4;return function(_0xfe895e){logger['error'](_0xfe895e[_0x2d76('0x2b')]);if(_0xfe895e[_0x2d76('0x2c')]){delete _0xfe895e['name'];}_0x2a13c3[_0x2d76('0x22')](_0xf2910b)[_0x2d76('0x2d')](_0xfe895e);};}function getMustacheRender(_0x45c27a,_0x1c6fbc){return Mustache[_0x2d76('0x2e')](_0x45c27a,_[_0x2d76('0x2f')](_0x1c6fbc[_0x2d76('0x30')],{'contact':_0x1c6fbc[_0x2d76('0x31')],'message':_0x1c6fbc[_0x2d76('0x1d')],'agent':_0x1c6fbc[_0x2d76('0x32')],'interaction':_0x1c6fbc[_0x2d76('0x33')],'account':_0x1c6fbc[_0x2d76('0x34')]}))||'';}exports['index']=function(_0x24a55c,_0x445299){var _0xd2202c={};var _0x56c004=_[_0x2d76('0x35')](db['ChatInteraction'][_0x2d76('0x36')],function(_0x25230c){return{'name':_0x25230c['fieldName'],'type':_0x25230c[_0x2d76('0x37')][_0x2d76('0x38')]};});_0xd2202c=qs[_0x2d76('0x39')](_0x56c004,_0x24a55c);return interaction[_0x2d76('0x3a')]('chat',_0x24a55c[_0x2d76('0x3b')],_0x24a55c[_0x2d76('0x3c')],_0xd2202c,_0x56c004)[_0x2d76('0x15')](respondWithFilteredResult(_0x445299,_0xd2202c))['catch'](handleError(_0x445299,null));};exports[_0x2d76('0x3d')]=function(_0x75e966,_0x54220c){var _0x335dca={'raw':![],'where':{'id':_0x75e966['params']['id']}},_0x5bbe9f={};_0x5bbe9f['model']=_[_0x2d76('0x3e')](db[_0x2d76('0x3f')]['rawAttributes']);_0x5bbe9f['query']=_[_0x2d76('0x3e')](_0x75e966[_0x2d76('0x3b')]);_0x5bbe9f[_0x2d76('0x40')]=_[_0x2d76('0x41')](_0x5bbe9f[_0x2d76('0x42')],_0x5bbe9f[_0x2d76('0x3b')]);_0x335dca[_0x2d76('0x43')]=_[_0x2d76('0x41')](_0x5bbe9f[_0x2d76('0x42')],qs[_0x2d76('0x44')](_0x75e966[_0x2d76('0x3b')][_0x2d76('0x44')]));_0x335dca[_0x2d76('0x43')]=_0x335dca[_0x2d76('0x43')][_0x2d76('0x45')]?_0x335dca['attributes']:_0x5bbe9f['model'];if(_0x75e966['query'][_0x2d76('0x46')]){_0x335dca[_0x2d76('0x47')]=[{'all':!![]}];}_0x335dca=_[_0x2d76('0x2f')]({},_0x335dca,_0x75e966[_0x2d76('0x48')]);return db['ChatInteraction']['find'](_0x335dca)[_0x2d76('0x15')](handleEntityNotFound(_0x54220c,null))[_0x2d76('0x15')](respondWithResult(_0x54220c,null))[_0x2d76('0x1f')](handleError(_0x54220c,null));};exports[_0x2d76('0x49')]=function(_0x4bafe1,_0x89e954){return db[_0x2d76('0x3f')][_0x2d76('0x49')](_0x4bafe1['body'],{})[_0x2d76('0x15')](respondWithResult(_0x89e954,0xc9))[_0x2d76('0x1f')](handleError(_0x89e954,null));};exports[_0x2d76('0x29')]=function(_0x22b54e,_0xbaa8cd){if(_0x22b54e[_0x2d76('0x30')]['id']){delete _0x22b54e[_0x2d76('0x30')]['id'];}return db['ChatInteraction'][_0x2d76('0x4a')]({'where':{'id':_0x22b54e[_0x2d76('0x4b')]['id']}})[_0x2d76('0x15')](handleEntityNotFound(_0xbaa8cd,null))[_0x2d76('0x15')](saveUpdates(_0x22b54e[_0x2d76('0x30')],null))[_0x2d76('0x15')](respondWithResult(_0xbaa8cd,null))['catch'](handleError(_0xbaa8cd,null));};exports[_0x2d76('0x2a')]=function(_0x2be3d7,_0x27b0b3){return db[_0x2d76('0x3f')][_0x2d76('0x4a')]({'where':{'id':_0x2be3d7[_0x2d76('0x4b')]['id']}})[_0x2d76('0x15')](handleEntityNotFound(_0x27b0b3,null))[_0x2d76('0x15')](removeEntity(_0x27b0b3,null))[_0x2d76('0x1f')](handleError(_0x27b0b3,null));};exports[_0x2d76('0x4c')]=function(_0x4910a9,_0x498629){return db['ChatInteraction'][_0x2d76('0x4c')]()[_0x2d76('0x15')](respondWithResult(_0x498629,null))[_0x2d76('0x1f')](handleError(_0x498629,null));};exports[_0x2d76('0x4d')]=function(_0x9d7308,_0x169fd9){var _0x2c50d3=_0x9d7308[_0x2d76('0x4b')]['id'];var _0x5e5963;var _0x281ccf;var _0x1ec588;return db[_0x2d76('0x3f')][_0x2d76('0x4e')]({'where':{'id':_0x2c50d3}})[_0x2d76('0x15')](function(_0x9c81e6){_0x5e5963=_0x9c81e6;return db['ChatWebsite']['findOne']({'where':{'id':_0x9c81e6['ChatWebsiteId']},'attributes':['id','vidaooApiKey','vidaooEscalation',_0x2d76('0x4f'),_0x2d76('0x50'),'vidaooMetadata'],'raw':!![]});})['then'](function(_0x3049c2){if(_0x3049c2&&_0x3049c2[_0x2d76('0x51')]&&_0x3049c2[_0x2d76('0x52')]){_0x281ccf=_0x3049c2;var _0x1f76de={'interaction':{'id':_0x2c50d3},'agent':{'id':_0x9d7308[_0x2d76('0x3c')]['id'],'name':_0x9d7308[_0x2d76('0x3c')][_0x2d76('0x2c')],'fullname':_0x9d7308[_0x2d76('0x3c')][_0x2d76('0x53')],'email':_0x9d7308[_0x2d76('0x3c')][_0x2d76('0x54')]},'contact':_0x9d7308['body']['contact'],'account':_0x9d7308['body'][_0x2d76('0x34')]};var _0x1ec0f1={'rejectUnauthorized':![],'method':_0x2d76('0x55'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x3049c2[_0x2d76('0x51')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x9d7308[_0x2d76('0x3c')]['email']],'buttons':null,'topic':_0x281ccf[_0x2d76('0x4f')],'note':_[_0x2d76('0x56')](_0x281ccf[_0x2d76('0x50')])?null:getMustacheRender(_0x281ccf[_0x2d76('0x50')],_0x1f76de),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0x2d76('0x56')](_0x281ccf[_0x2d76('0x57')])){var _0x5c1a38=getMustacheRender(_0x281ccf[_0x2d76('0x57')],_0x1f76de);var _0x1b174f=JSON['parse'](_0x5c1a38);_0x1ec0f1[_0x2d76('0x30')][_0x2d76('0x58')]=_0x1b174f;}}catch(_0x8239e0){throw new db[(_0x2d76('0x59'))][(_0x2d76('0x5a'))](_0x2d76('0x5b'));}return rp(_0x1ec0f1);}else{throw new db[(_0x2d76('0x59'))]['ValidationError']('Error\x20in\x20Vidaoo\x20configuration');}})[_0x2d76('0x15')](function(_0x190267){_0x1ec588=_0x190267;if(_0x1ec588['id']){var _0x278619={'body':_0x1ec588[_0x2d76('0x5c')],'ChatWebsiteId':_0x281ccf['id'],'ChatInteractionId':_0x5e5963['id'],'direction':_0x2d76('0x5d'),'UserId':_0x9d7308['user']['id']};return db[_0x2d76('0x5e')]['create'](_0x278619,{});}else{throw new db[(_0x2d76('0x59'))]['ValidationError']('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x2d76('0x15')](function(){return _0x5e5963[_0x2d76('0x5f')]({'vidaooSessionId':_0x1ec588['id']});})[_0x2d76('0x15')](respondWithResult(_0x169fd9,null))[_0x2d76('0x1f')](handleError(_0x169fd9,null));};exports[_0x2d76('0x60')]=function(_0x55284f,_0x2bc062){if(_0x55284f[_0x2d76('0x30')]['id']){delete _0x55284f[_0x2d76('0x30')]['id'];}return db[_0x2d76('0x3f')]['find']({'where':{'id':_0x55284f[_0x2d76('0x4b')]['id']},'include':[{'model':db[_0x2d76('0x61')],'as':_0x2d76('0x62')}]})[_0x2d76('0x15')](handleEntityNotFound(_0x2bc062,null))[_0x2d76('0x15')](saveUpdates(_0x55284f[_0x2d76('0x30')],null))[_0x2d76('0x15')](respondWithResult(_0x2bc062,null))[_0x2d76('0x1f')](handleError(_0x2bc062,null));};exports[_0x2d76('0x63')]=function(_0x443308,_0x4afbda){if(_0x443308[_0x2d76('0x30')]['id']){delete _0x443308[_0x2d76('0x30')]['id'];}return db[_0x2d76('0x3f')][_0x2d76('0x4a')]({'where':{'id':_0x443308['params']['id']}})[_0x2d76('0x15')](function(_0x1cc6fb){if(!_0x1cc6fb){logger[_0x2d76('0x1b')](_0x2d76('0x64'),_0x2d76('0x63'),0x194,_0x2d76('0x65'));_0x4afbda[_0x2d76('0x20')](0x194);}else{if(_0x1cc6fb[_0x2d76('0x66')]){throw new db[(_0x2d76('0x59'))][(_0x2d76('0x5a'))](_0x2d76('0x67'));}}return _0x1cc6fb;})[_0x2d76('0x15')](function(_0x4d5949){if(_0x4d5949){return _0x4d5949['update']({'closed':_0x443308[_0x2d76('0x30')][_0x2d76('0x68')],'disposition':_0x443308['body'][_0x2d76('0x69')]})[_0x2d76('0x15')](function(_0x418647){return _0x418647;});}})[_0x2d76('0x15')](function(){return respondWithRpcPromise(_0x2d76('0x6a'),'abandon',_0x443308[_0x2d76('0x30')],client9004);})['then'](respondWithResult(_0x4afbda,null))[_0x2d76('0x1f')](handleError(_0x4afbda,null));};exports[_0x2d76('0x6b')]=function(_0xba05af,_0x3d1cc1){_0xba05af[_0x2d76('0x30')][_0x2d76('0x2c')]=_0xba05af[_0x2d76('0x6c')][_0x2d76('0x6d')];_0xba05af['body']['basename']=_0xba05af['file'][_0x2d76('0x6e')];_0xba05af[_0x2d76('0x30')]['type']=_0xba05af['file'][_0x2d76('0x6f')];return db[_0x2d76('0x70')][_0x2d76('0x49')](_0xba05af[_0x2d76('0x30')])[_0x2d76('0x15')](respondWithResult(_0x3d1cc1,0xc9))[_0x2d76('0x1f')](handleError(_0x3d1cc1,null));};exports[_0x2d76('0x71')]=function(_0xf7be3c,_0x1f5019){return db[_0x2d76('0x3f')][_0x2d76('0x4e')]({'where':{'id':_0xf7be3c['params']['id']},'raw':!![]})[_0x2d76('0x15')](handleEntityNotFound(_0x1f5019,null))[_0x2d76('0x15')](function(_0xa03891){if(_0xa03891){if(_0xa03891[_0x2d76('0x68')]){return _0x1f5019[_0x2d76('0x22')](0x193)[_0x2d76('0x23')]({'status':0x193,'message':_0x2d76('0x72')});}return db[_0x2d76('0x70')][_0x2d76('0x4e')]({'where':{'id':_0xf7be3c[_0x2d76('0x3b')]['attachId']},'raw':!![]})[_0x2d76('0x15')](handleEntityNotFound(_0x1f5019,null));}})[_0x2d76('0x15')](function(_0x392a8f){if(_0x392a8f){var _0x3297fb=_0x392a8f[_0x2d76('0x73')]!==null;var _0x5b553e=path['join'](config['root'],'server/files/attachments/');if(_0x3297fb){_0x5b553e=path['join'](_0x5b553e,_0x2d76('0x74'));}var _0x590340=path[_0x2d76('0x75')](_0x5b553e,_0x392a8f['basename']);return _0x1f5019[_0x2d76('0x76')](_0x590340);}})['catch'](handleError(_0x1f5019,null));};exports[_0x2d76('0x77')]=function(_0x13ddac,_0x9ce99){var _0x562c4d=null;var _0x31015f=null;var _0x48103d=null;if(_0x13ddac[_0x2d76('0x30')]['id']){delete _0x13ddac[_0x2d76('0x30')]['id'];}if(_0x13ddac[_0x2d76('0x30')][_0x2d76('0x78')]){_0x48103d=path['join'](config[_0x2d76('0x79')],_0x2d76('0x7a'),util[_0x2d76('0x7b')](_0x2d76('0x7c'),Date[_0x2d76('0x7d')]()));_0x13ddac[_0x2d76('0x30')][_0x2d76('0x7e')]=_0x48103d;}return db[_0x2d76('0x3f')][_0x2d76('0x4a')]({'where':{'id':_0x13ddac[_0x2d76('0x4b')]['id']},'include':[{'model':db[_0x2d76('0x5e')],'as':_0x2d76('0x7f'),'include':[{'model':db[_0x2d76('0x80')],'as':'User'}]}]})[_0x2d76('0x15')](handleEntityNotFound(_0x9ce99,null))['then'](saveUpdates(_0x13ddac[_0x2d76('0x30')],null))['then'](function(_0x3b7b24){if(_0x3b7b24){_0x562c4d=_0x3b7b24;return db['ChatWebsite'][_0x2d76('0x4a')]({'where':{'id':_0x562c4d['ChatWebsiteId']}});}})[_0x2d76('0x15')](function(_0x5c2efb){if(_0x5c2efb){_0x31015f=_0x5c2efb;return db[_0x2d76('0x61')][_0x2d76('0x4a')]({'where':{'id':_0x562c4d[_0x2d76('0x81')]}});}})['then'](function(_0x4cf3bc){if(_0x4cf3bc){if(_0x48103d){var _0x4fa6fd=null;for(var _0x1255dd=0x1;_0x1255dd<_0x562c4d[_0x2d76('0x7f')][_0x2d76('0x45')];++_0x1255dd){_0x4fa6fd=_0x562c4d[_0x2d76('0x7f')][_0x1255dd];var _0x2c6f47=_0x4fa6fd['UserId']?util[_0x2d76('0x7b')](_0x2d76('0x82'),_0x31015f[_0x2d76('0x83')],_0x4fa6fd['UserId']):'System';var _0x4ad94b=_0x13ddac['body'][_0x2d76('0x84')]||util['format'](_0x2d76('0x82'),'Visitor',_0x4fa6fd[_0x2d76('0x81')]);switch(_0x31015f['agentIdentifier']){case _0x2d76('0x85'):_0x2c6f47=_0x4fa6fd['UserId']?util['format'](_0x2d76('0x82'),_0x31015f[_0x2d76('0x83')],_0x4fa6fd['UserId']):'System';break;case _0x2d76('0x86'):_0x2c6f47=_0x4fa6fd['UserId']?_0x4fa6fd[_0x2d76('0x80')]['alias']||_0x4fa6fd[_0x2d76('0x80')][_0x2d76('0x53')]:'System';break;case _0x2d76('0x87'):_0x2c6f47=_0x4fa6fd[_0x2d76('0x66')]?_0x4fa6fd[_0x2d76('0x80')][_0x2d76('0x53')]:'System';break;default:_0x2c6f47=_0x4fa6fd[_0x2d76('0x66')]?util['format'](_0x2d76('0x82'),_0x31015f['agentAlias'],_0x4fa6fd[_0x2d76('0x66')]):'System';}var _0x2bb942=util[_0x2d76('0x7b')](_0x2d76('0x88'),moment(_0x4fa6fd[_0x2d76('0x89')])[_0x2d76('0x7b')](_0x2d76('0x8a')),_0x4fa6fd[_0x2d76('0x8b')]==='in'?_0x4ad94b:_0x2c6f47,_0x4fa6fd[_0x2d76('0x30')]);if(!_0x4fa6fd[_0x2d76('0x8c')]){fs['appendFileSync'](_0x48103d,_0x2bb942);}}return db[_0x2d76('0x8d')][_0x2d76('0x4e')]({'where':{'service':!![]},'include':[{'model':db[_0x2d76('0x8e')],'as':_0x2d76('0x8f'),'raw':!![],'include':[{'model':db[_0x2d76('0x90')],'as':_0x2d76('0x90'),'raw':!![]}]}]});}}})[_0x2d76('0x15')](function(_0x359721){if(!_0x359721||!_0x359721[_0x2d76('0x8f')]||!_0x13ddac[_0x2d76('0x30')])return _0x562c4d;var _0x531e31=_0x359721['getSmtpOptions']();return respondWithRpcPromise(_0x2d76('0x91'),_0x2d76('0x92'),{'account':_0x531e31,'message':{'from':util[_0x2d76('0x7b')]('\x22%s\x22\x20<%s>',_0x359721[_0x2d76('0x2c')],_0x359721[_0x2d76('0x54')]||_0x359721[_0x2d76('0x8f')][_0x2d76('0x3c')]),'to':_0x13ddac[_0x2d76('0x30')][_0x2d76('0x78')],'subject':_0x2d76('0x93'),'text':util[_0x2d76('0x7b')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x13ddac['body']['mailTranscript']),'attachments':[{'path':_0x48103d}]}})[_0x2d76('0x15')](function(){return _0x562c4d;})['catch'](function(_0x56f272){logger['error'](_0x56f272);});})[_0x2d76('0x15')](respondWithStatusCode(_0x9ce99,0xc8))['catch'](handleError(_0x9ce99,null));};exports[_0x2d76('0x94')]=function(_0x577af6,_0x5a864b){return db['ChatMessage'][_0x2d76('0x4a')]({'where':{'id':_0x577af6['params']['id']}})[_0x2d76('0x15')](handleEntityNotFound(_0x5a864b,null))[_0x2d76('0x15')](function(_0x47dc74){if(_0x47dc74){return _0x47dc74[_0x2d76('0x94')](_0x577af6[_0x2d76('0x30')][_0x2d76('0x95')],_[_0x2d76('0x96')](_0x577af6[_0x2d76('0x30')],[_0x2d76('0x95'),'id'])||{});}})[_0x2d76('0x15')](respondWithResult(_0x5a864b,null))[_0x2d76('0x1f')](handleError(_0x5a864b,null));};exports[_0x2d76('0x97')]=function(_0x1c664d,_0xd98011){var _0x456894={'raw':![],'where':{}};var _0x18eb1f={};var _0x987363={'count':0x0,'rows':[]};return db[_0x2d76('0x3f')][_0x2d76('0x4e')]({'where':{'id':_0x1c664d['params']['id']}})[_0x2d76('0x15')](handleEntityNotFound(_0xd98011,null))[_0x2d76('0x15')](function(_0x2dff98){if(_0x2dff98){_0x18eb1f[_0x2d76('0x42')]=_[_0x2d76('0x3e')](db[_0x2d76('0x5e')][_0x2d76('0x36')]);_0x18eb1f['query']=_[_0x2d76('0x3e')](_0x1c664d[_0x2d76('0x3b')]);_0x18eb1f[_0x2d76('0x40')]=_[_0x2d76('0x41')](_0x18eb1f[_0x2d76('0x42')],_0x18eb1f[_0x2d76('0x3b')]);_0x456894[_0x2d76('0x43')]=_[_0x2d76('0x41')](_0x18eb1f[_0x2d76('0x42')],qs[_0x2d76('0x44')](_0x1c664d[_0x2d76('0x3b')]['fields']));_0x456894[_0x2d76('0x43')]=_0x456894['attributes'][_0x2d76('0x45')]?_0x456894['attributes']:_0x18eb1f[_0x2d76('0x42')];if(!_0x1c664d['query'][_0x2d76('0x98')](_0x2d76('0x99'))){_0x456894['limit']=qs[_0x2d76('0x25')](_0x1c664d[_0x2d76('0x3b')]['limit']);_0x456894[_0x2d76('0x24')]=qs['offset'](_0x1c664d[_0x2d76('0x3b')][_0x2d76('0x24')]);}_0x456894[_0x2d76('0x9a')]=qs['sort'](_0x1c664d[_0x2d76('0x3b')][_0x2d76('0x9b')]);_0x456894[_0x2d76('0x9c')]=qs['filters'](_[_0x2d76('0x9d')](_0x1c664d['query'],_0x18eb1f[_0x2d76('0x40')]));_0x456894[_0x2d76('0x9c')]['ChatInteractionId']=_0x2dff98['id'];if(_0x1c664d[_0x2d76('0x3b')][_0x2d76('0x9e')]){_0x456894['where']=_['merge'](_0x456894['where'],{'$or':_[_0x2d76('0x35')](_0x456894[_0x2d76('0x43')],function(_0x18c846){var _0xe1a121={};_0xe1a121[_0x18c846]={'$like':'%'+_0x1c664d[_0x2d76('0x3b')][_0x2d76('0x9e')]+'%'};return _0xe1a121;})});}if(_0x1c664d[_0x2d76('0x3b')][_0x2d76('0x9f')]){var _0x38c5fd=_0x1c664d[_0x2d76('0x3b')][_0x2d76('0x9f')][_0x2d76('0xa0')](',');var _0x216df3={};_0x216df3[_0x38c5fd[0x0]]={'$gte':moment(_0x38c5fd[0x1])[_0x2d76('0x7b')](_0x2d76('0xa1'))};_0x456894[_0x2d76('0x9c')]=_[_0x2d76('0x2f')](_0x456894[_0x2d76('0x9c')],_0x216df3);}_0x456894=_[_0x2d76('0x2f')]({},_0x456894,_0x1c664d[_0x2d76('0x48')]);return db[_0x2d76('0x5e')][_0x2d76('0x26')]({'where':_0x456894[_0x2d76('0x9c')]})[_0x2d76('0x15')](function(_0x1969e5){_0x987363[_0x2d76('0x26')]=_0x1969e5;if(_0x1c664d[_0x2d76('0x3b')][_0x2d76('0x46')]){_0x456894[_0x2d76('0x47')]=[{'all':!![]}];}return db[_0x2d76('0x5e')][_0x2d76('0x3a')](_0x456894);})[_0x2d76('0x15')](function(_0x5d68c8){_0x987363[_0x2d76('0xa2')]=_0x5d68c8;return _0x987363;});}})['then'](respondWithFilteredResult(_0xd98011,_0x456894))['catch'](handleError(_0xd98011,null));};exports[_0x2d76('0xa3')]=function(_0x5582d8,_0x33b431){var _0x32fdd0={'where':{}},_0x34f062={},_0x669b8c={'count':0x0,'rows':[]};return db[_0x2d76('0x3f')][_0x2d76('0x4e')]({'where':{'id':_0x5582d8['params']['id']}})[_0x2d76('0x15')](handleEntityNotFound(_0x33b431,null))[_0x2d76('0x15')](function(_0x5e7bb5){if(_0x5e7bb5){_0x34f062[_0x2d76('0x42')]=_[_0x2d76('0x3e')](db[_0x2d76('0x5e')][_0x2d76('0x36')]);_0x34f062['query']=_['keys'](_0x5582d8[_0x2d76('0x3b')]);_0x34f062[_0x2d76('0x40')]=_[_0x2d76('0x41')](_0x34f062[_0x2d76('0x42')],_0x34f062[_0x2d76('0x3b')]);_0x32fdd0['attributes']=_[_0x2d76('0x41')](_0x34f062[_0x2d76('0x42')],qs[_0x2d76('0x44')](_0x5582d8['query'][_0x2d76('0x44')]));_0x32fdd0[_0x2d76('0x43')]=_0x32fdd0[_0x2d76('0x43')][_0x2d76('0x45')]?_0x32fdd0['attributes']:_0x34f062[_0x2d76('0x42')];if(!_0x5582d8[_0x2d76('0x3b')][_0x2d76('0x98')](_0x2d76('0x99'))){_0x32fdd0[_0x2d76('0x25')]=qs[_0x2d76('0x25')](_0x5582d8[_0x2d76('0x3b')][_0x2d76('0x25')]);_0x32fdd0[_0x2d76('0x24')]=qs[_0x2d76('0x24')](_0x5582d8[_0x2d76('0x3b')]['offset']);}_0x32fdd0['order']=qs['sort'](_0x5582d8[_0x2d76('0x3b')][_0x2d76('0x9b')]);_0x32fdd0['where']=qs[_0x2d76('0x40')](_[_0x2d76('0x9d')](_0x5582d8[_0x2d76('0x3b')],_0x34f062[_0x2d76('0x40')]));_0x32fdd0[_0x2d76('0x9c')]['ChatInteractionId']=_0x5e7bb5['id'];if(_0x5582d8[_0x2d76('0x3b')]['filter']){_0x32fdd0[_0x2d76('0x9c')]=_[_0x2d76('0x2f')](_0x32fdd0[_0x2d76('0x9c')],{'$or':_[_0x2d76('0x35')](_0x32fdd0['attributes'],function(_0x33a1a5){var _0x27e791={};_0x27e791[_0x33a1a5]={'$like':'%'+_0x5582d8[_0x2d76('0x3b')]['filter']+'%'};return _0x27e791;})});}_0x32fdd0[_0x2d76('0x9c')][_0x2d76('0x8c')]=![];if(_0x5582d8[_0x2d76('0x3b')]['id']){_0x32fdd0[_0x2d76('0x9c')]['id']={'$gt':_0x5582d8[_0x2d76('0x3b')]['id']};}_0x32fdd0=_[_0x2d76('0x2f')]({},_0x32fdd0,_0x5582d8[_0x2d76('0x48')]);return db[_0x2d76('0x5e')][_0x2d76('0x26')]({'where':_0x32fdd0[_0x2d76('0x9c')]})['then'](function(_0x82f306){_0x669b8c[_0x2d76('0x26')]=_0x82f306;_0x32fdd0[_0x2d76('0x47')]=[];if(_0x5582d8['query']['includeAgent']){_0x32fdd0[_0x2d76('0x47')][_0x2d76('0xa4')]({'model':db[_0x2d76('0x80')],'as':_0x2d76('0x80'),'attributes':['id',_0x2d76('0x53'),_0x2d76('0xa5')]});}if(_0x5582d8['query']['includeAll']){_0x32fdd0['include']=[{'all':!![]}];}return db[_0x2d76('0x5e')][_0x2d76('0x3a')](_0x32fdd0);})['then'](function(_0x206879){_0x669b8c[_0x2d76('0xa2')]=_0x206879;return _0x669b8c;});}})[_0x2d76('0x15')](respondWithFilteredResult(_0x33b431,_0x32fdd0))[_0x2d76('0x1f')](handleError(_0x33b431,null));};exports[_0x2d76('0xa6')]=function(_0x3dd41c,_0x4e32ee){return db['ChatInteraction'][_0x2d76('0x4a')]({'where':{'id':_0x3dd41c[_0x2d76('0x4b')]['id']}})[_0x2d76('0x15')](handleEntityNotFound(_0x4e32ee,null))[_0x2d76('0x15')](function(_0xa7cb56){if(_0xa7cb56){return _0xa7cb56[_0x2d76('0xa7')](_0x3dd41c[_0x2d76('0x30')][_0x2d76('0x95')],_['omit'](_0x3dd41c[_0x2d76('0x30')],[_0x2d76('0x95'),'id'])||{})[_0x2d76('0xa8')](function(){return db['Tag']['findAll']({'attributes':['id',_0x2d76('0x2c'),_0x2d76('0xa9')],'where':{'id':_0x3dd41c[_0x2d76('0x30')][_0x2d76('0x95')]}});})[_0x2d76('0x15')](function(_0x4019af){socket['emit'](_0x2d76('0xaa'),{'id':Number(_0x3dd41c['params']['id']),'tags':_0x4019af||[]});return{'id':Number(_0x3dd41c[_0x2d76('0x4b')]['id']),'tags':_0x4019af||[]};});}})[_0x2d76('0x15')](respondWithResult(_0x4e32ee,null))[_0x2d76('0x1f')](handleError(_0x4e32ee,null));};exports['removeTags']=function(_0x1b6f1d,_0x2143fb){return db[_0x2d76('0x3f')][_0x2d76('0x4a')]({'where':{'id':_0x1b6f1d[_0x2d76('0x4b')]['id']}})[_0x2d76('0x15')](handleEntityNotFound(_0x2143fb,null))[_0x2d76('0x15')](function(_0x555f9e){if(_0x555f9e){return _0x555f9e[_0x2d76('0xab')](_0x1b6f1d[_0x2d76('0x3b')]['ids']);}})[_0x2d76('0x15')](respondWithStatusCode(_0x2143fb,null))['catch'](handleError(_0x2143fb,null));};exports[_0x2d76('0x76')]=function(_0x1c9f70,_0x22ff76){var _0x1ed890=moment()['unix']()[_0x2d76('0xac')]();var _0x9142d4=path[_0x2d76('0x75')](config['root'],_0x2d76('0xad'),'files',_0x2d76('0xae'));var _0x2439ca=path['join'](config[_0x2d76('0x79')],_0x2d76('0xad'),'files',_0x2d76('0xaf'));var _0x57952=path['join'](_0x9142d4,_0x1ed890);var _0x247fec=util[_0x2d76('0x7b')]('transcript-%d-%s.zip',_0x1c9f70[_0x2d76('0x4b')]['id'],_0x1ed890);var _0x3d35d8=path['join'](_0x9142d4,_0x247fec);var _0x5889ab=[];_0x5889ab[_0x2d76('0xa4')]({'model':db[_0x2d76('0x80')],'as':_0x2d76('0x80'),'attributes':['id',_0x2d76('0x53')],'raw':!![]});_0x5889ab[_0x2d76('0xa4')]({'model':db[_0x2d76('0x61')],'as':_0x2d76('0x62'),'attributes':['id',_0x2d76('0xb0'),_0x2d76('0xb1')],'raw':!![]});if(_0x1c9f70[_0x2d76('0x3b')]['attachments']){_0x5889ab['push']({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x3d2542=[{'model':db[_0x2d76('0x5e')],'as':_0x2d76('0x7f'),'attributes':['id','body',_0x2d76('0x89'),_0x2d76('0x8b'),'secret',_0x2d76('0xb2')],'include':_0x5889ab}];_0x3d2542['push']({'model':db[_0x2d76('0xb3')],'as':'Account','attributes':['id',_0x2d76('0x2c')]});_0x3d2542[_0x2d76('0xa4')]({'model':db[_0x2d76('0x80')],'as':_0x2d76('0xb4'),'attributes':['id','fullname']});return db[_0x2d76('0x3f')][_0x2d76('0x4a')]({'where':{'id':_0x1c9f70[_0x2d76('0x4b')]['id']},'include':_0x3d2542})[_0x2d76('0x15')](handleEntityNotFound(_0x22ff76,null))[_0x2d76('0x15')](function(_0x2f3fab){if(_0x2f3fab){var _0x3af6b=_0x2f3fab[_0x2d76('0xb5')]({'plain':!![]});fs[_0x2d76('0xb6')](_0x57952);var _0x5822f2={'channel':'Chat','account':_0x3af6b[_0x2d76('0xb7')][_0x2d76('0x2c')],'agent':_0x3af6b[_0x2d76('0xb4')]?_0x3af6b[_0x2d76('0xb4')]['fullname']:_0x2d76('0xb8'),'createdAt':moment(_0x3af6b['createdAt'])[_0x2d76('0x7b')](_0x2d76('0xa1'))[_0x2d76('0xac')](),'closedAt':_0x3af6b[_0x2d76('0x68')]?moment(_0x3af6b['closedAt'])[_0x2d76('0x7b')](_0x2d76('0xa1'))[_0x2d76('0xac')]():'','disposition':_0x3af6b[_0x2d76('0x69')],'chatInfo':{'browser':_0x3af6b[_0x2d76('0xb9')],'os':_0x3af6b['osName'],'referer':_0x3af6b[_0x2d76('0xba')],'customerIp':_0x3af6b[_0x2d76('0xbb')],'customerPort':_0x3af6b[_0x2d76('0xbc')]?_0x3af6b['customerPort']:'N.A.'},'messages':_(_0x3af6b[_0x2d76('0x7f')])[_0x2d76('0xbd')]()[_0x2d76('0x9e')]({'secret':![]})['map'](function(_0x5d5c44){if(_0x5d5c44[_0x2d76('0x70')]){var _0x119cd0=path[_0x2d76('0x75')](_0x2439ca,_0x5d5c44['Attachment'][_0x2d76('0xbe')]);if(fs[_0x2d76('0xbf')](_0x119cd0)){fs[_0x2d76('0xc0')](_0x119cd0)['pipe'](fs[_0x2d76('0xc1')](path[_0x2d76('0x75')](_0x57952,_0x5d5c44[_0x2d76('0x70')]['basename'])));}}return{'date':moment(_0x5d5c44[_0x2d76('0x89')])[_0x2d76('0x7b')](_0x2d76('0xa1'))[_0x2d76('0xac')](),'sender':_0x5d5c44[_0x2d76('0x8b')]===_0x2d76('0x5d')?_0x5d5c44[_0x2d76('0x80')]?_0x5d5c44[_0x2d76('0x80')]['fullname']:_0x2d76('0xc2'):_0x5d5c44[_0x2d76('0x62')][_0x2d76('0xb0')]+(_0x5d5c44[_0x2d76('0x62')]['lastName']?'\x20'+_0x5d5c44[_0x2d76('0x62')][_0x2d76('0xb1')]:''),'body':_0x5d5c44[_0x2d76('0x70')]?_0x5d5c44['Attachment']['basename']:_0x5d5c44['body'],'direction':_0x5d5c44[_0x2d76('0x8b')]===_0x2d76('0x5d')?'A':'C','secret':_0x5d5c44[_0x2d76('0x8c')],'read':_0x5d5c44[_0x2d76('0xb2')],'attachment':_0x5d5c44[_0x2d76('0x70')]};})[_0x2d76('0xc3')]()};return ejs['renderFile'](path[_0x2d76('0x75')](config['root'],_0x2d76('0xad'),_0x2d76('0xc4'),_0x2d76('0xc5')),{'interaction':_0x5822f2})[_0x2d76('0x15')](function(_0x4fdfa9){var _0x315e74=path[_0x2d76('0x75')](_0x57952,_0x2d76('0xc6')+_0x3af6b['id']+'-'+_0x1ed890+_0x2d76('0xc7'));var _0x489167={'path':_0x315e74,'channel':_0x2d76('0xc8'),'interactionId':_0x3af6b['id']};return pdf['createPdfFromHTML'](_0x4fdfa9,_0x489167);})[_0x2d76('0x15')](function(){return new Promise(function(_0x6d7cc8,_0x554d68){zipdir(_0x57952,{'saveTo':_0x3d35d8},function(_0x280b57,_0x1e6225){if(_0x280b57)return _0x554d68(_0x280b57);return _0x6d7cc8(_0x1e6225);});})['then'](function(){return new BPromise(function(_0xa3d2d3,_0x467dc7){rimraf(_0x57952,function(_0xfd4f82){if(_0xfd4f82)_0x467dc7(_0xfd4f82);return _0xa3d2d3();});});})[_0x2d76('0x15')](function(){return _0x22ff76[_0x2d76('0x76')](_0x3d35d8,_0x247fec,function(_0x14a75d){if(_0x14a75d){logger[_0x2d76('0x1b')](_0x2d76('0xc9'),_0x14a75d);}else{fs[_0x2d76('0xca')](_0x3d35d8);}});});});}else{return _0x22ff76[_0x2d76('0x20')](0xc8);}})[_0x2d76('0x1f')](handleError(_0x22ff76,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index e347cee..85032f5 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 _0x3a85=['ChatInteraction','save','update','remove','then','setDataValue','Users','map','findAll','length','emit','hook','exports','events','../../mysqldb'];(function(_0x181b23,_0x3ed1a2){var _0x29bd87=function(_0x5a522a){while(--_0x5a522a){_0x181b23['push'](_0x181b23['shift']());}};_0x29bd87(++_0x3ed1a2);}(_0x3a85,0xb2));var _0x53a8=function(_0xb79b1a,_0x87ee78){_0xb79b1a=_0xb79b1a-0x0;var _0x1c28a7=_0x3a85[_0xb79b1a];return _0x1c28a7;};'use strict';var EventEmitter=require(_0x53a8('0x0'));var ChatInteraction=require(_0x53a8('0x1'))['db'][_0x53a8('0x2')];var ChatMessage=require('../../mysqldb')['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x53a8('0x3'),'afterUpdate':_0x53a8('0x4'),'afterDestroy':_0x53a8('0x5')};function emitEvent(_0x5589b3){return function(_0x193d44,_0xb6e903,_0x5e93d8){_0x193d44['getUsers']({'attributes':['id'],'raw':!![]})[_0x53a8('0x6')](function(_0x4bd398){_0x193d44[_0x53a8('0x7')](_0x53a8('0x8'),_0x4bd398[_0x53a8('0x9')](function(_0x2c94eb){return{'id':_0x2c94eb['id']};}));return ChatMessage[_0x53a8('0xa')]({'where':{'ChatInteractionId':_0x193d44['id'],'direction':'in','read':![]},'raw':!![]});})[_0x53a8('0x6')](function(_0x53cdf1){_0x193d44[_0x53a8('0x7')]('unreadMessages',_0x53cdf1[_0x53a8('0xb')]);ChatInteractionEvents[_0x53a8('0xc')](_0x5589b3+':'+_0x193d44['id'],_0x193d44);ChatInteractionEvents[_0x53a8('0xc')](_0x5589b3,_0x193d44);_0x5e93d8(null);})['catch'](_0x5e93d8(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0x53a8('0xd')](e,emitEvent(event));}}module[_0x53a8('0xe')]=ChatInteractionEvents; \ No newline at end of file +var _0xc629=['Users','map','findAll','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','update','remove','getUsers','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc629,0xb6));var _0x9c62=function(_0x63a69b,_0x296888){_0x63a69b=_0x63a69b-0x0;var _0x425fa1=_0xc629[_0x63a69b];return _0x425fa1;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x9c62('0x0'))['db'][_0x9c62('0x1')];var ChatMessage=require(_0x9c62('0x0'))['db'][_0x9c62('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x9c62('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9c62('0x4'),'afterDestroy':_0x9c62('0x5')};function emitEvent(_0x43843b){return function(_0x467a62,_0x4e479f,_0x233cf6){_0x467a62[_0x9c62('0x6')]({'attributes':['id'],'raw':!![]})[_0x9c62('0x7')](function(_0xc5ec41){_0x467a62['setDataValue'](_0x9c62('0x8'),_0xc5ec41[_0x9c62('0x9')](function(_0x30e90b){return{'id':_0x30e90b['id']};}));return ChatMessage[_0x9c62('0xa')]({'where':{'ChatInteractionId':_0x467a62['id'],'direction':'in','read':![]},'raw':!![]});})[_0x9c62('0x7')](function(_0x5d662a){_0x467a62[_0x9c62('0xb')](_0x9c62('0xc'),_0x5d662a[_0x9c62('0xd')]);ChatInteractionEvents[_0x9c62('0xe')](_0x43843b+':'+_0x467a62['id'],_0x467a62);ChatInteractionEvents[_0x9c62('0xe')](_0x43843b,_0x467a62);_0x233cf6(null);})[_0x9c62('0xf')](_0x233cf6(null));};}for(var e in events){if(events[_0x9c62('0x10')](e)){var event=events[e];ChatInteraction[_0x9c62('0x11')](e,emitEvent(event));}}module[_0x9c62('0x12')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 27f0de5..d8e95d8 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 _0xd45c=['exports','define','ChatInteraction','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./chatInteraction.attributes'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0xd45c,0x19a));var _0xcd45=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xd45c[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0xcd45('0x0'));var util=require('util');var logger=require(_0xcd45('0x1'))(_0xcd45('0x2'));var moment=require(_0xcd45('0x3'));var BPromise=require('bluebird');var rp=require(_0xcd45('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcd45('0x5'));var config=require(_0xcd45('0x6'));var attributes=require(_0xcd45('0x7'));module[_0xcd45('0x8')]=function(_0x50ab5c,_0xfe4299){return _0x50ab5c[_0xcd45('0x9')](_0xcd45('0xa'),attributes,{'tableName':_0xcd45('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x176dc6,_0x230051,_0x111c95){if(_0x176dc6[_0xcd45('0xc')](_0xcd45('0xd'))){_0x176dc6[_0xcd45('0xe')]=moment()[_0xcd45('0xf')](_0xcd45('0x10'));}_0x111c95(null,_0x176dc6);}},'charset':_0xcd45('0x11'),'collate':_0xcd45('0x12')});}; \ No newline at end of file +var _0xf9fb=['ChatInteraction','changed','closed','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','lodash','util','api','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf9fb,0x147));var _0xbf9f=function(_0x53934d,_0xaba2c){_0x53934d=_0x53934d-0x0;var _0x169c7d=_0xf9fb[_0x53934d];return _0x169c7d;};'use strict';var _=require(_0xbf9f('0x0'));var util=require(_0xbf9f('0x1'));var logger=require('../../config/logger')(_0xbf9f('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbf9f('0x3'));var rimraf=require(_0xbf9f('0x4'));var config=require(_0xbf9f('0x5'));var attributes=require(_0xbf9f('0x6'));module[_0xbf9f('0x7')]=function(_0x4782ea,_0x212aef){return _0x4782ea[_0xbf9f('0x8')](_0xbf9f('0x9'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x96edc8,_0x487edf,_0x1295b2){if(_0x96edc8[_0xbf9f('0xa')](_0xbf9f('0xb'))){_0x96edc8['closedAt']=moment()['format'](_0xbf9f('0xc'));}_0x1295b2(null,_0x96edc8);}},'charset':'utf8mb4','collate':_0xbf9f('0xd')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 0eab88f..90bd4b3 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 _0x7ae6=['attributes','limit','then','stringify','AddTagsToChatInteraction','find','addTags','body','ids','omit','spread','AddTags','util','moment','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','http','redis','localhost','./chatInteraction.socket','request','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','ChatInteraction,\x20%s,\x20%s','message','info','result','UpdateChatInteraction','ChatInteraction','update','options','where'];(function(_0x2f4897,_0xd541c5){var _0x4221b1=function(_0x535bb0){while(--_0x535bb0){_0x2f4897['push'](_0x2f4897['shift']());}};_0x4221b1(++_0xd541c5);}(_0x7ae6,0x159));var _0x67ae=function(_0xb52dca,_0x4bfc45){_0xb52dca=_0xb52dca-0x0;var _0x494531=_0x7ae6[_0xb52dca];return _0x494531;};'use strict';var _=require('lodash');var util=require(_0x67ae('0x0'));var moment=require(_0x67ae('0x1'));var BPromise=require('bluebird');var rs=require(_0x67ae('0x2'));var fs=require('fs');var Redis=require(_0x67ae('0x3'));var db=require(_0x67ae('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x67ae('0x5'));var jayson=require(_0x67ae('0x6'));var client=jayson['client'][_0x67ae('0x7')]({'port':0x232a});config[_0x67ae('0x8')]=_['defaults'](config[_0x67ae('0x8')],{'host':_0x67ae('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x67ae('0xa'))['register'](socket);function respondWithRpcPromise(_0x5d703b,_0x50476d,_0x1efe71){return new BPromise(function(_0x246d9b,_0x110357){return client[_0x67ae('0xb')](_0x5d703b,_0x1efe71)['then'](function(_0xa2bfb0){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x50476d,_0x67ae('0xc'));logger[_0x67ae('0xd')](_0x67ae('0xe'),_0x50476d,_0x67ae('0xc'),JSON['stringify'](_0xa2bfb0));if(_0xa2bfb0[_0x67ae('0xf')]){if(_0xa2bfb0[_0x67ae('0xf')]['code']===0x1f4){logger[_0x67ae('0xf')](_0x67ae('0x10'),_0x50476d,_0xa2bfb0[_0x67ae('0xf')][_0x67ae('0x11')]);return _0x110357(_0xa2bfb0[_0x67ae('0xf')]['message']);}logger[_0x67ae('0xf')]('ChatInteraction,\x20%s,\x20%s',_0x50476d,_0xa2bfb0[_0x67ae('0xf')][_0x67ae('0x11')]);return _0x246d9b(_0xa2bfb0[_0x67ae('0xf')]['message']);}else{logger[_0x67ae('0x12')](_0x67ae('0x10'),_0x50476d,_0x67ae('0xc'));_0x246d9b(_0xa2bfb0[_0x67ae('0x13')][_0x67ae('0x11')]);}})['catch'](function(_0x30be29){logger[_0x67ae('0xf')](_0x67ae('0x10'),_0x50476d,_0x30be29);_0x110357(_0x30be29);});});}exports[_0x67ae('0x14')]=function(_0x581649){var _0x41914f=this;return new Promise(function(_0xfd3e7f,_0x36977c){return db[_0x67ae('0x15')][_0x67ae('0x16')](_0x581649['body'],{'raw':_0x581649[_0x67ae('0x17')]?_0x581649[_0x67ae('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x581649[_0x67ae('0x17')]?_0x581649['options'][_0x67ae('0x18')]||null:null,'attributes':_0x581649[_0x67ae('0x17')]?_0x581649[_0x67ae('0x17')][_0x67ae('0x19')]||null:null,'limit':_0x581649['options']?_0x581649['options'][_0x67ae('0x1a')]||null:null})[_0x67ae('0x1b')](function(_0x562828){logger[_0x67ae('0x12')]('UpdateChatInteraction',_0x581649);logger['debug'](_0x67ae('0x14'),_0x581649,JSON[_0x67ae('0x1c')](_0x562828));_0xfd3e7f(_0x562828);})['catch'](function(_0xcc18f0){logger[_0x67ae('0xf')]('UpdateChatInteraction',_0xcc18f0['message'],_0x581649);_0x36977c(_0x41914f[_0x67ae('0xf')](0x1f4,_0xcc18f0[_0x67ae('0x11')]));});});};exports[_0x67ae('0x1d')]=function(_0x20c2ac){return new Promise(function(_0x318183,_0x1db719){return db[_0x67ae('0x15')][_0x67ae('0x1e')]({'where':_0x20c2ac[_0x67ae('0x17')]?_0x20c2ac[_0x67ae('0x17')][_0x67ae('0x18')]||null:null})[_0x67ae('0x1b')](function(_0x551593){if(_0x551593){return _0x551593[_0x67ae('0x1f')](_0x20c2ac[_0x67ae('0x20')][_0x67ae('0x21')],_[_0x67ae('0x22')](_0x20c2ac[_0x67ae('0x20')],[_0x67ae('0x21'),'id'])||{});}})[_0x67ae('0x23')](function(_0x49fbfd){logger[_0x67ae('0x12')](_0x67ae('0x24'),_0x20c2ac);logger['debug']('AddTags',_0x20c2ac,JSON[_0x67ae('0x1c')](_0x49fbfd));_0x318183(_0x49fbfd);})['catch'](function(_0x50497e){logger[_0x67ae('0xf')](_0x67ae('0x24'),_0x50497e[_0x67ae('0x11')],_0x20c2ac);_0x1db719(_this[_0x67ae('0xf')](0x1f4,_0x50497e[_0x67ae('0x11')]));});});}; \ No newline at end of file +var _0xc2c6=['../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','ChatInteraction,\x20%s,\x20%s','info','result','message','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','attributes','limit','stringify','AddTagsToChatInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x49cf57,_0x428742){var _0x15eca3=function(_0x3c8468){while(--_0x3c8468){_0x49cf57['push'](_0x49cf57['shift']());}};_0x15eca3(++_0x428742);}(_0xc2c6,0x1b1));var _0x6c2c=function(_0x1601ad,_0x4e4a92){_0x1601ad=_0x1601ad-0x0;var _0x3973aa=_0xc2c6[_0x1601ad];return _0x3973aa;};'use strict';var _=require(_0x6c2c('0x0'));var util=require(_0x6c2c('0x1'));var moment=require(_0x6c2c('0x2'));var BPromise=require(_0x6c2c('0x3'));var rs=require(_0x6c2c('0x4'));var fs=require('fs');var Redis=require(_0x6c2c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6c2c('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x6c2c('0x7'));var jayson=require(_0x6c2c('0x8'));var client=jayson[_0x6c2c('0x9')]['http']({'port':0x232a});config[_0x6c2c('0xa')]=_['defaults'](config[_0x6c2c('0xa')],{'host':_0x6c2c('0xb'),'port':0x18eb});var socket=require(_0x6c2c('0xc'))(new Redis(config['redis']));require(_0x6c2c('0xd'))[_0x6c2c('0xe')](socket);function respondWithRpcPromise(_0x5c28de,_0x482322,_0x241b1e){return new BPromise(function(_0x12a9d5,_0x43ebed){return client[_0x6c2c('0xf')](_0x5c28de,_0x241b1e)[_0x6c2c('0x10')](function(_0x5c8244){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x482322,_0x6c2c('0x11'));logger[_0x6c2c('0x12')](_0x6c2c('0x13'),_0x482322,_0x6c2c('0x11'),JSON['stringify'](_0x5c8244));if(_0x5c8244[_0x6c2c('0x14')]){if(_0x5c8244[_0x6c2c('0x14')][_0x6c2c('0x15')]===0x1f4){logger['error'](_0x6c2c('0x16'),_0x482322,_0x5c8244['error']['message']);return _0x43ebed(_0x5c8244['error']['message']);}logger['error'](_0x6c2c('0x16'),_0x482322,_0x5c8244[_0x6c2c('0x14')]['message']);return _0x12a9d5(_0x5c8244[_0x6c2c('0x14')]['message']);}else{logger[_0x6c2c('0x17')](_0x6c2c('0x16'),_0x482322,'request\x20sent');_0x12a9d5(_0x5c8244[_0x6c2c('0x18')][_0x6c2c('0x19')]);}})[_0x6c2c('0x1a')](function(_0xb704bf){logger[_0x6c2c('0x14')](_0x6c2c('0x16'),_0x482322,_0xb704bf);_0x43ebed(_0xb704bf);});});}exports[_0x6c2c('0x1b')]=function(_0x55cb4a){var _0x25d8ba=this;return new Promise(function(_0x2506da,_0x1573a2){return db[_0x6c2c('0x1c')][_0x6c2c('0x1d')](_0x55cb4a[_0x6c2c('0x1e')],{'raw':_0x55cb4a[_0x6c2c('0x1f')]?_0x55cb4a[_0x6c2c('0x1f')][_0x6c2c('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x55cb4a[_0x6c2c('0x1f')]?_0x55cb4a[_0x6c2c('0x1f')][_0x6c2c('0x21')]||null:null,'attributes':_0x55cb4a[_0x6c2c('0x1f')]?_0x55cb4a[_0x6c2c('0x1f')][_0x6c2c('0x22')]||null:null,'limit':_0x55cb4a['options']?_0x55cb4a['options'][_0x6c2c('0x23')]||null:null})['then'](function(_0xfd9896){logger[_0x6c2c('0x17')](_0x6c2c('0x1b'),_0x55cb4a);logger[_0x6c2c('0x12')](_0x6c2c('0x1b'),_0x55cb4a,JSON[_0x6c2c('0x24')](_0xfd9896));_0x2506da(_0xfd9896);})[_0x6c2c('0x1a')](function(_0x51f8fc){logger[_0x6c2c('0x14')]('UpdateChatInteraction',_0x51f8fc[_0x6c2c('0x19')],_0x55cb4a);_0x1573a2(_0x25d8ba['error'](0x1f4,_0x51f8fc[_0x6c2c('0x19')]));});});};exports[_0x6c2c('0x25')]=function(_0x38119b){return new Promise(function(_0xfca7fc,_0x22b1c0){return db[_0x6c2c('0x1c')][_0x6c2c('0x26')]({'where':_0x38119b[_0x6c2c('0x1f')]?_0x38119b[_0x6c2c('0x1f')][_0x6c2c('0x21')]||null:null})['then'](function(_0x1e343e){if(_0x1e343e){return _0x1e343e[_0x6c2c('0x27')](_0x38119b[_0x6c2c('0x1e')][_0x6c2c('0x28')],_[_0x6c2c('0x29')](_0x38119b[_0x6c2c('0x1e')],[_0x6c2c('0x28'),'id'])||{});}})[_0x6c2c('0x2a')](function(_0x4682b5){logger[_0x6c2c('0x17')](_0x6c2c('0x2b'),_0x38119b);logger['debug'](_0x6c2c('0x2b'),_0x38119b,JSON[_0x6c2c('0x24')](_0x4682b5));_0xfca7fc(_0x4682b5);})[_0x6c2c('0x1a')](function(_0xbfae19){logger[_0x6c2c('0x14')](_0x6c2c('0x2b'),_0xbfae19[_0x6c2c('0x19')],_0x38119b);_0x22b1c0(_this[_0x6c2c('0x14')](0x1f4,_0xbfae19['message']));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index f9a88d2..fc3ec53 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 _0x7da1=['./chatInteraction.events','save','remove','emit','removeListener','register','chatInteraction:'];(function(_0x17e658,_0x64e00){var _0x1250e5=function(_0x193801){while(--_0x193801){_0x17e658['push'](_0x17e658['shift']());}};_0x1250e5(++_0x64e00);}(_0x7da1,0xee));var _0x17da=function(_0x10046a,_0x2a03a4){_0x10046a=_0x10046a-0x0;var _0x106ed4=_0x7da1[_0x10046a];return _0x106ed4;};'use strict';var ChatInteractionEvents=require(_0x17da('0x0'));var events=[_0x17da('0x1'),_0x17da('0x2'),'update'];function createListener(_0x3f0f2f,_0x2950d3){return function(_0x4a25c2){_0x2950d3[_0x17da('0x3')](_0x3f0f2f,_0x4a25c2);};}function removeListener(_0x468374,_0x515366){return function(){ChatInteractionEvents[_0x17da('0x4')](_0x468374,_0x515366);};}exports[_0x17da('0x5')]=function(_0x20e201){for(var _0x1c333d=0x0,_0x354bb8=events['length'];_0x1c333d<_0x354bb8;_0x1c333d++){var _0x5397a7=events[_0x1c333d];var _0x5a41d7=createListener(_0x17da('0x6')+_0x5397a7,_0x20e201);ChatInteractionEvents['on'](_0x5397a7,_0x5a41d7);}}; \ No newline at end of file +var _0xb9c5=['removeListener','chatInteraction:','remove','update','emit'];(function(_0x3b53b0,_0x23dc58){var _0x4eddc6=function(_0x46254f){while(--_0x46254f){_0x3b53b0['push'](_0x3b53b0['shift']());}};_0x4eddc6(++_0x23dc58);}(_0xb9c5,0x14c));var _0x5b9c=function(_0x38b4fe,_0x4f84d){_0x38b4fe=_0x38b4fe-0x0;var _0x1be3a3=_0xb9c5[_0x38b4fe];return _0x1be3a3;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=['save',_0x5b9c('0x0'),_0x5b9c('0x1')];function createListener(_0x219f9e,_0x71a54d){return function(_0x7a8d0e){_0x71a54d[_0x5b9c('0x2')](_0x219f9e,_0x7a8d0e);};}function removeListener(_0x8b9804,_0x1e6874){return function(){ChatInteractionEvents[_0x5b9c('0x3')](_0x8b9804,_0x1e6874);};}exports['register']=function(_0xfeef37){for(var _0x45007d=0x0,_0x3259c2=events['length'];_0x45007d<_0x3259c2;_0x45007d++){var _0x2a9fd6=events[_0x45007d];var _0x3f43b5=createListener(_0x5b9c('0x4')+_0x2a9fd6,_0xfeef37);ChatInteractionEvents['on'](_0x2a9fd6,_0x3f43b5);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 16a6796..c63031b 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 _0x15d2=['download','post','create','createVidaooSession','diskStorage','root','server/files/attachments/','now','originalname','replace','file','attachmentUpload','addMessage','tracked','chat','chatinteraction:addtags','put','chatinteraction:update','customUpdate','abandon','close','delete','chatinteraction:destroy','/:id/tags','removeTags','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages'];(function(_0x4aa162,_0xf301ea){var _0x35b9c6=function(_0x38712a){while(--_0x38712a){_0x4aa162['push'](_0x4aa162['shift']());}};_0x35b9c6(++_0xf301ea);}(_0x15d2,0x134));var _0x215d=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0x15d2[_0x411add];return _0x238242;};'use strict';var multer=require(_0x215d('0x0'));var util=require(_0x215d('0x1'));var path=require('path');var timeout=require(_0x215d('0x2'));var express=require(_0x215d('0x3'));var router=express[_0x215d('0x4')]();var fs_extra=require(_0x215d('0x5'));var auth=require(_0x215d('0x6'));var interaction=require(_0x215d('0x7'));var config=require(_0x215d('0x8'));var controller=require('./chatInteraction.controller');router[_0x215d('0x9')]('/',auth[_0x215d('0xa')](),controller['index']);router[_0x215d('0x9')](_0x215d('0xb'),auth[_0x215d('0xa')](),controller['describe']);router[_0x215d('0x9')](_0x215d('0xc'),auth[_0x215d('0xd')](),controller[_0x215d('0xe')]);router[_0x215d('0x9')](_0x215d('0xf'),auth[_0x215d('0xd')](),controller[_0x215d('0x10')]);router[_0x215d('0x9')](_0x215d('0x11'),auth[_0x215d('0xa')](),controller[_0x215d('0x12')]);router['get'](_0x215d('0x13'),auth[_0x215d('0xd')](),controller[_0x215d('0x14')]);router[_0x215d('0x9')]('/:id/download',auth[_0x215d('0xa')](),controller[_0x215d('0x15')]);router[_0x215d('0x16')]('/',auth['isAuthenticated'](),controller[_0x215d('0x17')]);router[_0x215d('0x16')]('/:id/vidaoo',auth[_0x215d('0xa')](),controller[_0x215d('0x18')]);var upload=multer({'storage':multer[_0x215d('0x19')]({'destination':function(_0x5505d8,_0x2c8a84,_0x28a50b){_0x28a50b(null,path['join'](config[_0x215d('0x1a')],_0x215d('0x1b')));},'filename':function(_0x3f0121,_0x426caa,_0x121126){_0x121126(null,util['format']('%s-%s',Date[_0x215d('0x1c')](),_0x426caa[_0x215d('0x1d')][_0x215d('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post']('/:id/attachment_upload',upload['single'](_0x215d('0x1f')),controller[_0x215d('0x20')]);router[_0x215d('0x16')](_0x215d('0x11'),auth[_0x215d('0xd')](),controller[_0x215d('0x21')]);router[_0x215d('0x16')]('/:id/tags',auth[_0x215d('0xa')](),interaction[_0x215d('0x22')](_0x215d('0x23'),_0x215d('0x24')),controller['addTags']);router[_0x215d('0x25')]('/:id',auth[_0x215d('0xa')](),interaction['tracked'](_0x215d('0x23'),_0x215d('0x26')),controller['update']);router[_0x215d('0x25')]('/:id/custom_update',controller[_0x215d('0x27')]);router[_0x215d('0x25')]('/:id/abandon',auth['isChatInteractionAuthorized'](),controller[_0x215d('0x28')]);router['put']('/:id/close',controller[_0x215d('0x29')]);router[_0x215d('0x2a')](_0x215d('0xc'),auth[_0x215d('0xa')](),interaction['tracked'](_0x215d('0x23'),_0x215d('0x2b')),controller['destroy']);router[_0x215d('0x2a')](_0x215d('0x2c'),auth[_0x215d('0xa')](),controller[_0x215d('0x2d')]);module[_0x215d('0x2e')]=router; \ No newline at end of file +var _0x082c=['attachmentUpload','/:id/messages','/:id/tags','tracked','addTags','put','/:id','customUpdate','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','removeTags','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','getMessages','getMyMessages','/:id/download','download','create','post','/:id/vidaoo','join','root','server/files/attachments/','%s-%s','now','originalname','replace','/:id/attachment_upload','single','file'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x082c,0x13c));var _0xc082=function(_0x12ab97,_0x43a673){_0x12ab97=_0x12ab97-0x0;var _0x338e43=_0x082c[_0x12ab97];return _0x338e43;};'use strict';var multer=require('multer');var util=require(_0xc082('0x0'));var path=require(_0xc082('0x1'));var timeout=require(_0xc082('0x2'));var express=require(_0xc082('0x3'));var router=express[_0xc082('0x4')]();var fs_extra=require(_0xc082('0x5'));var auth=require(_0xc082('0x6'));var interaction=require(_0xc082('0x7'));var config=require(_0xc082('0x8'));var controller=require(_0xc082('0x9'));router[_0xc082('0xa')]('/',auth[_0xc082('0xb')](),controller[_0xc082('0xc')]);router[_0xc082('0xa')]('/describe',auth[_0xc082('0xb')](),controller['describe']);router[_0xc082('0xa')]('/:id',auth[_0xc082('0xd')](),controller[_0xc082('0xe')]);router[_0xc082('0xa')](_0xc082('0xf'),auth['isChatInteractionAuthorized'](),controller[_0xc082('0x10')]);router[_0xc082('0xa')]('/:id/messages',auth['isAuthenticated'](),controller[_0xc082('0x11')]);router['get']('/:id/my_messages',auth['isChatInteractionAuthorized'](),controller[_0xc082('0x12')]);router[_0xc082('0xa')](_0xc082('0x13'),auth[_0xc082('0xb')](),controller[_0xc082('0x14')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc082('0x15')]);router[_0xc082('0x16')](_0xc082('0x17'),auth[_0xc082('0xb')](),controller['createVidaooSession']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x27a6c4,_0x346abc,_0x3b97cb){_0x3b97cb(null,path[_0xc082('0x18')](config[_0xc082('0x19')],_0xc082('0x1a')));},'filename':function(_0x2504d5,_0x9b02e8,_0x4552d2){_0x4552d2(null,util['format'](_0xc082('0x1b'),Date[_0xc082('0x1c')](),_0x9b02e8[_0xc082('0x1d')][_0xc082('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xc082('0x16')](_0xc082('0x1f'),upload[_0xc082('0x20')](_0xc082('0x21')),controller[_0xc082('0x22')]);router[_0xc082('0x16')](_0xc082('0x23'),auth[_0xc082('0xd')](),controller['addMessage']);router['post'](_0xc082('0x24'),auth[_0xc082('0xb')](),interaction[_0xc082('0x25')]('chat','chatinteraction:addtags'),controller[_0xc082('0x26')]);router[_0xc082('0x27')](_0xc082('0x28'),auth[_0xc082('0xb')](),interaction[_0xc082('0x25')]('chat','chatinteraction:update'),controller['update']);router[_0xc082('0x27')]('/:id/custom_update',controller[_0xc082('0x29')]);router[_0xc082('0x27')]('/:id/abandon',auth['isChatInteractionAuthorized'](),controller[_0xc082('0x2a')]);router[_0xc082('0x27')](_0xc082('0x2b'),controller[_0xc082('0x2c')]);router[_0xc082('0x2d')](_0xc082('0x28'),auth['isAuthenticated'](),interaction[_0xc082('0x25')]('chat',_0xc082('0x2e')),controller[_0xc082('0x2f')]);router[_0xc082('0x2d')](_0xc082('0x24'),auth[_0xc082('0xb')](),controller[_0xc082('0x30')]);module[_0xc082('0x31')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index b772308..785abdf 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 _0xa441=['medium','exports','TEXT'];(function(_0x1f4c8f,_0x5633af){var _0x156ab8=function(_0x180334){while(--_0x180334){_0x1f4c8f['push'](_0x1f4c8f['shift']());}};_0x156ab8(++_0x5633af);}(_0xa441,0xe8));var _0x1a44=function(_0x2f672d,_0x5a2171){_0x2f672d=_0x2f672d-0x0;var _0x5953a5=_0xa441[_0x2f672d];return _0x5953a5;};'use strict';var Sequelize=require('sequelize');module[_0x1a44('0x0')]={'body':{'type':Sequelize[_0x1a44('0x1')](_0x1a44('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xe20e=['medium','BOOLEAN','INTEGER','sequelize','exports','TEXT'];(function(_0x2b582c,_0xce9b8b){var _0x13323e=function(_0x403087){while(--_0x403087){_0x2b582c['push'](_0x2b582c['shift']());}};_0x13323e(++_0xce9b8b);}(_0xe20e,0x171));var _0xee20=function(_0x127a60,_0x37f33a){_0x127a60=_0x127a60-0x0;var _0xc1f6a3=_0xe20e[_0x127a60];return _0xc1f6a3;};'use strict';var Sequelize=require(_0xee20('0x0'));module[_0xee20('0x1')]={'body':{'type':Sequelize[_0xee20('0x2')](_0xee20('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xee20('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xee20('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index bef7999..16dd7b0 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 _0x4bef=['ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','order','where','pick','filter','merge','VIRTUAL','options','ChatInternalMessage','includeAll','findAll','rows','find','create','body','catch','update','params','describe','get','messages','lastMessageAt','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','user','fullname','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','sort','VoiceQueues','role','UserProfileSection','Agents','userProfileId','autoAssociation','isEmpty','resourceId','push','FromId','ToId','read','-createdAt','all','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox'];(function(_0xf43a1e,_0x28a2b5){var _0x14da71=function(_0x49cffb){while(--_0x49cffb){_0xf43a1e['push'](_0xf43a1e['shift']());}};_0x14da71(++_0x28a2b5);}(_0x4bef,0xd3));var _0xf4be=function(_0x33bc64,_0x4d1e92){_0x33bc64=_0x33bc64-0x0;var _0x3fdd34=_0x4bef[_0x33bc64];return _0x3fdd34;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf4be('0x0'));var zipdir=require(_0xf4be('0x1'));var jsonpatch=require(_0xf4be('0x2'));var rp=require(_0xf4be('0x3'));var moment=require(_0xf4be('0x4'));var BPromise=require(_0xf4be('0x5'));var Mustache=require(_0xf4be('0x6'));var util=require('util');var path=require(_0xf4be('0x7'));var sox=require(_0xf4be('0x8'));var csv=require('to-csv');var ejs=require(_0xf4be('0x9'));var fs=require('fs');var fs_extra=require(_0xf4be('0xa'));var _=require(_0xf4be('0xb'));var squel=require(_0xf4be('0xc'));var crypto=require(_0xf4be('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xf4be('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf4be('0xf'));var Papa=require(_0xf4be('0x10'));var Redis=require(_0xf4be('0x11'));var authService=require(_0xf4be('0x12'));var qs=require(_0xf4be('0x13'));var as=require(_0xf4be('0x14'));var hardwareService=require(_0xf4be('0x15'));var logger=require(_0xf4be('0x16'))(_0xf4be('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf4be('0x18'))['db'];config['redis']=_[_0xf4be('0x19')](config[_0xf4be('0x1a')],{'host':_0xf4be('0x1b'),'port':0x18eb});var socket=require(_0xf4be('0x1c'))(new Redis(config[_0xf4be('0x1a')]));require(_0xf4be('0x1d'))[_0xf4be('0x1e')](socket);function respondWithStatusCode(_0x26a26b,_0x4f3060){_0x4f3060=_0x4f3060||0xcc;return function(_0x3ed657){if(_0x3ed657){return _0x26a26b[_0xf4be('0x1f')](_0x4f3060);}return _0x26a26b[_0xf4be('0x20')](_0x4f3060)[_0xf4be('0x21')]();};}function respondWithResult(_0x3ac81c,_0x1f1a6a){_0x1f1a6a=_0x1f1a6a||0xc8;return function(_0x541873){if(_0x541873){return _0x3ac81c[_0xf4be('0x20')](_0x1f1a6a)[_0xf4be('0x22')](_0x541873);}};}function respondWithFilteredResult(_0x517a97,_0x2cb07a){return function(_0x121a6c){if(_0x121a6c){var _0x325de9=typeof _0x2cb07a[_0xf4be('0x23')]===_0xf4be('0x24')&&typeof _0x2cb07a[_0xf4be('0x25')]==='undefined';var _0x3063ab=_0x121a6c[_0xf4be('0x26')];var _0x15a882=_0x325de9?0x0:_0x2cb07a[_0xf4be('0x23')];var _0x292ee7=_0x325de9?_0x121a6c['count']:_0x2cb07a[_0xf4be('0x23')]+_0x2cb07a[_0xf4be('0x25')];var _0x3ce2ce;if(_0x292ee7>=_0x3063ab){_0x292ee7=_0x3063ab;_0x3ce2ce=0xc8;}else{_0x3ce2ce=0xce;}_0x517a97[_0xf4be('0x20')](_0x3ce2ce);return _0x517a97['set'](_0xf4be('0x27'),_0x15a882+'-'+_0x292ee7+'/'+_0x3063ab)[_0xf4be('0x22')](_0x121a6c);}return null;};}function patchUpdates(_0x2297cd){return function(_0x4ea5e3){try{jsonpatch[_0xf4be('0x28')](_0x4ea5e3,_0x2297cd,!![]);}catch(_0x3405c6){return BPromise[_0xf4be('0x29')](_0x3405c6);}return _0x4ea5e3['save']();};}function saveUpdates(_0x4ff486,_0x2c5788){return function(_0x23ef0b){if(_0x23ef0b){return _0x23ef0b['update'](_0x4ff486)[_0xf4be('0x2a')](function(_0x531a65){return _0x531a65;});}return null;};}function removeEntity(_0x3e3cee,_0x1de168){return function(_0x3d39f1){if(_0x3d39f1){return _0x3d39f1[_0xf4be('0x2b')]()[_0xf4be('0x2a')](function(){_0x3e3cee['status'](0xcc)[_0xf4be('0x21')]();});}};}function handleEntityNotFound(_0x57e156,_0x95232b){return function(_0x137328){if(!_0x137328){_0x57e156[_0xf4be('0x1f')](0x194);}return _0x137328;};}function handleError(_0x183494,_0x3337fc){_0x3337fc=_0x3337fc||0x1f4;return function(_0x4eedec){logger['error'](_0x4eedec[_0xf4be('0x2c')]);if(_0x4eedec['name']){delete _0x4eedec[_0xf4be('0x2d')];}_0x183494[_0xf4be('0x20')](_0x3337fc)[_0xf4be('0x2e')](_0x4eedec);};}exports[_0xf4be('0x2f')]=function(_0x398b7e,_0x4c928c){var _0x48e6d9={},_0x5db9b9={},_0x251413={'count':0x0,'rows':[]};var _0x50b40f=_[_0xf4be('0x30')](db['ChatInternalMessage'][_0xf4be('0x31')],function(_0x3db85d){return{'name':_0x3db85d[_0xf4be('0x32')],'type':_0x3db85d[_0xf4be('0x33')]['key']};});_0x5db9b9[_0xf4be('0x34')]=_[_0xf4be('0x30')](_0x50b40f,'name');_0x5db9b9[_0xf4be('0x35')]=_[_0xf4be('0x36')](_0x398b7e[_0xf4be('0x35')]);_0x5db9b9[_0xf4be('0x37')]=_['intersection'](_0x5db9b9[_0xf4be('0x34')],_0x5db9b9[_0xf4be('0x35')]);_0x48e6d9[_0xf4be('0x38')]=_[_0xf4be('0x39')](_0x5db9b9[_0xf4be('0x34')],qs[_0xf4be('0x3a')](_0x398b7e[_0xf4be('0x35')][_0xf4be('0x3a')]));_0x48e6d9[_0xf4be('0x38')]=_0x48e6d9[_0xf4be('0x38')][_0xf4be('0x3b')]?_0x48e6d9[_0xf4be('0x38')]:_0x5db9b9['model'];if(!_0x398b7e['query']['hasOwnProperty']('nolimit')){_0x48e6d9['limit']=qs[_0xf4be('0x25')](_0x398b7e[_0xf4be('0x35')][_0xf4be('0x25')]);_0x48e6d9[_0xf4be('0x23')]=qs['offset'](_0x398b7e['query'][_0xf4be('0x23')]);}_0x48e6d9[_0xf4be('0x3c')]=qs['sort'](_0x398b7e[_0xf4be('0x35')]['sort']);_0x48e6d9[_0xf4be('0x3d')]=qs[_0xf4be('0x37')](_[_0xf4be('0x3e')](_0x398b7e[_0xf4be('0x35')],_0x5db9b9[_0xf4be('0x37')]),_0x50b40f);if(_0x398b7e[_0xf4be('0x35')][_0xf4be('0x3f')]){_0x48e6d9[_0xf4be('0x3d')]=_[_0xf4be('0x40')](_0x48e6d9['where'],{'$or':_[_0xf4be('0x30')](_0x50b40f,function(_0x5d5e12){if(_0x5d5e12[_0xf4be('0x33')]!==_0xf4be('0x41')){var _0x419270={};_0x419270[_0x5d5e12[_0xf4be('0x2d')]]={'$like':'%'+_0x398b7e[_0xf4be('0x35')][_0xf4be('0x3f')]+'%'};return _0x419270;}})});}_0x48e6d9=_[_0xf4be('0x40')]({},_0x48e6d9,_0x398b7e[_0xf4be('0x42')]);var _0x26fbd2={'where':_0x48e6d9[_0xf4be('0x3d')]};return db[_0xf4be('0x43')][_0xf4be('0x26')](_0x26fbd2)['then'](function(_0x179c25){_0x251413['count']=_0x179c25;if(_0x398b7e[_0xf4be('0x35')][_0xf4be('0x44')]){_0x48e6d9['include']=[{'all':!![]}];}return db[_0xf4be('0x43')][_0xf4be('0x45')](_0x48e6d9);})[_0xf4be('0x2a')](function(_0x446aa3){_0x251413[_0xf4be('0x46')]=_0x446aa3;return _0x251413;})[_0xf4be('0x2a')](respondWithFilteredResult(_0x4c928c,_0x48e6d9))['catch'](handleError(_0x4c928c,null));};exports['show']=function(_0x530d8f,_0xa1b4f8){var _0x3d0ca9={'raw':!![],'where':{'id':_0x530d8f['params']['id']}},_0x2b103a={};_0x2b103a['model']=_[_0xf4be('0x36')](db[_0xf4be('0x43')][_0xf4be('0x31')]);_0x2b103a[_0xf4be('0x35')]=_[_0xf4be('0x36')](_0x530d8f['query']);_0x2b103a[_0xf4be('0x37')]=_[_0xf4be('0x39')](_0x2b103a['model'],_0x2b103a[_0xf4be('0x35')]);_0x3d0ca9[_0xf4be('0x38')]=_[_0xf4be('0x39')](_0x2b103a[_0xf4be('0x34')],qs['fields'](_0x530d8f[_0xf4be('0x35')][_0xf4be('0x3a')]));_0x3d0ca9[_0xf4be('0x38')]=_0x3d0ca9[_0xf4be('0x38')][_0xf4be('0x3b')]?_0x3d0ca9[_0xf4be('0x38')]:_0x2b103a['model'];if(_0x530d8f[_0xf4be('0x35')][_0xf4be('0x44')]){_0x3d0ca9['include']=[{'all':!![]}];}_0x3d0ca9=_[_0xf4be('0x40')]({},_0x3d0ca9,_0x530d8f[_0xf4be('0x42')]);return db[_0xf4be('0x43')][_0xf4be('0x47')](_0x3d0ca9)[_0xf4be('0x2a')](handleEntityNotFound(_0xa1b4f8,null))[_0xf4be('0x2a')](respondWithResult(_0xa1b4f8,null))['catch'](handleError(_0xa1b4f8,null));};exports[_0xf4be('0x48')]=function(_0x27022b,_0x1f0935){return db[_0xf4be('0x43')][_0xf4be('0x48')](_0x27022b[_0xf4be('0x49')],{})[_0xf4be('0x2a')](respondWithResult(_0x1f0935,0xc9))[_0xf4be('0x4a')](handleError(_0x1f0935,null));};exports[_0xf4be('0x4b')]=function(_0x538a3d,_0x10ea00){if(_0x538a3d[_0xf4be('0x49')]['id']){delete _0x538a3d[_0xf4be('0x49')]['id'];}return db[_0xf4be('0x43')]['find']({'where':{'id':_0x538a3d[_0xf4be('0x4c')]['id']}})[_0xf4be('0x2a')](handleEntityNotFound(_0x10ea00,null))['then'](saveUpdates(_0x538a3d['body'],null))[_0xf4be('0x2a')](respondWithResult(_0x10ea00,null))[_0xf4be('0x4a')](handleError(_0x10ea00,null));};exports[_0xf4be('0x2b')]=function(_0xa1af99,_0x532469){return db[_0xf4be('0x43')][_0xf4be('0x47')]({'where':{'id':_0xa1af99['params']['id']}})[_0xf4be('0x2a')](handleEntityNotFound(_0x532469,null))[_0xf4be('0x2a')](removeEntity(_0x532469,null))['catch'](handleError(_0x532469,null));};exports[_0xf4be('0x4d')]=function(_0x37ab60,_0x244441){return db[_0xf4be('0x43')]['describe']()[_0xf4be('0x2a')](respondWithResult(_0x244441,null))[_0xf4be('0x4a')](handleError(_0x244441,null));};function wrapUser(_0x159e72){return function(_0x434741){var _0x3558a2=_0x159e72[_0xf4be('0x4e')]({'plain':!![]});_0x3558a2[_0xf4be('0x4f')]=[];if(_0x434741){_0x3558a2[_0xf4be('0x50')]=_0x434741[_0xf4be('0x51')];_0x3558a2['lastMessage']=_0x434741;}else{_0x3558a2[_0xf4be('0x50')]=moment(0x0)[_0xf4be('0x52')](_0xf4be('0x53'));_0x3558a2['lastMessage']={};}return _0x3558a2;};}exports[_0xf4be('0x54')]=function(_0x4d4e80,_0x2515d7,_0x4164d3){var _0x10c089=[];return db[_0xf4be('0x55')][_0xf4be('0x45')]({'where':{'role':[_0xf4be('0x56'),'admin',_0xf4be('0x57')]},'attributes':['id',_0xf4be('0x58'),_0xf4be('0x2d'),'role',_0xf4be('0x59'),_0xf4be('0x5a'),_0xf4be('0x5b'),_0xf4be('0x5c'),_0xf4be('0x5d'),_0xf4be('0x5e')],'order':qs[_0xf4be('0x5f')]('-online'),'include':[{'model':db['VoiceQueue'],'as':_0xf4be('0x60'),'attributes':['id',_0xf4be('0x2d'),_0xf4be('0x33')],'through':{'attributes':[]}}]})[_0xf4be('0x2a')](function(_0x179e41){if(_0x179e41){var _0x215d06=_0x4d4e80['user'][_0xf4be('0x4e')]({'plain':!![]});if(!_0x215d06)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x215d06[_0xf4be('0x61')]===_0xf4be('0x57')){return db[_0xf4be('0x62')][_0xf4be('0x47')]({'where':{'name':_0xf4be('0x63'),'userProfileId':_0x215d06[_0xf4be('0x64')]},'raw':!![]})[_0xf4be('0x2a')](function(_0x17071c){if(_0x17071c){if(_0x17071c[_0xf4be('0x65')]===0x0){return db['UserProfileResource'][_0xf4be('0x45')]({'where':{'sectionId':_0x17071c['id']},'raw':!![]})[_0xf4be('0x2a')](function(_0x110cd8){var _0x1fc978=[];if(_[_0xf4be('0x66')](_0x110cd8)){_0x1fc978=_[_0xf4be('0x3f')](_0x179e41,function(_0x24c308){if(_0x24c308[_0xf4be('0x61')]!==_0xf4be('0x56')){return _0x24c308;}});return _0x1fc978;}else{for(var _0x451f18=0x0;_0x451f18<_0x179e41[_0xf4be('0x3b')];_0x451f18++){var _0x1af3df=_0x179e41[_0x451f18];if(_0x1af3df[_0xf4be('0x61')]==='agent'){var _0x5bb545=_[_0xf4be('0x47')](_0x110cd8,function(_0x224d80){return _0x224d80[_0xf4be('0x67')]===_0x1af3df['id'];});if(_0x5bb545)_0x1fc978['push'](_0x1af3df);}else{_0x1fc978[_0xf4be('0x68')](_0x1af3df);}}return _0x1fc978;}});}else{return _0x179e41;}}else{var _0x3497f1=_[_0xf4be('0x3f')](_0x179e41,function(_0x2773e8){if(_0x2773e8['role']!==_0xf4be('0x56')){return _0x2773e8;}});return _0x3497f1;}});}else{return _0x179e41;}}})[_0xf4be('0x2a')](function(_0x677f52){var _0x25e4c8=[];if(_0x677f52){_0x10c089=_0x677f52;for(var _0x723f1e=0x0;_0x723f1e<_0x677f52[_0xf4be('0x3b')];_0x723f1e+=0x1){_0x10c089[_0x723f1e][_0xf4be('0x4f')]=[];_0x25e4c8[_0xf4be('0x68')](db['ChatInternalMessage'][_0xf4be('0x47')]({'where':{'FromId':[_0x4d4e80[_0xf4be('0x57')]['id'],_0x677f52[_0x723f1e]['id']],'ToId':[_0x4d4e80[_0xf4be('0x57')]['id'],_0x677f52[_0x723f1e]['id']],'ChatGroupId':null},'attributes':['id',_0xf4be('0x51'),_0xf4be('0x69'),_0xf4be('0x6a'),_0xf4be('0x6b'),_0xf4be('0x49')],'order':qs[_0xf4be('0x5f')](_0xf4be('0x6c')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xf4be('0x2a')](wrapUser(_0x677f52[_0x723f1e])));}return BPromise[_0xf4be('0x6d')](_0x25e4c8);}return[];})[_0xf4be('0x2a')](function(_0x70ef37){return{'rows':_0x70ef37,'count':_0x70ef37['length']};})[_0xf4be('0x2a')](respondWithResult(_0x2515d7,null))['catch'](handleError(_0x2515d7,null));}; \ No newline at end of file +var _0xbd08=['agent','admin','user','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','messages','push','ToId','read','-createdAt','all','eml-format','zip-dir','fast-json-patch','moment','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','redis','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','end','name','send','index','ChatInternalMessage','rawAttributes','fieldName','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filters','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','update','describe','get','lastMessageAt','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers'];(function(_0x58506e,_0x369f9d){var _0x4cd297=function(_0x3d251f){while(--_0x3d251f){_0x58506e['push'](_0x58506e['shift']());}};_0x4cd297(++_0x369f9d);}(_0xbd08,0x163));var _0x8bd0=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0xbd08[_0x35885a];return _0xe86249;};'use strict';var emlformat=require(_0x8bd0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8bd0('0x1'));var jsonpatch=require(_0x8bd0('0x2'));var rp=require('request-promise');var moment=require(_0x8bd0('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8bd0('0x4'));var path=require(_0x8bd0('0x5'));var sox=require('sox');var csv=require(_0x8bd0('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8bd0('0x7'));var _=require(_0x8bd0('0x8'));var squel=require(_0x8bd0('0x9'));var crypto=require(_0x8bd0('0xa'));var jsforce=require(_0x8bd0('0xb'));var deskjs=require(_0x8bd0('0xc'));var toCsv=require(_0x8bd0('0x6'));var querystring=require(_0x8bd0('0xd'));var Papa=require('papaparse');var Redis=require(_0x8bd0('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x8bd0('0xf'));var as=require(_0x8bd0('0x10'));var hardwareService=require(_0x8bd0('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x8bd0('0x12'));var config=require(_0x8bd0('0x13'));var licenseUtil=require(_0x8bd0('0x14'));var db=require('../../mysqldb')['db'];config[_0x8bd0('0x15')]=_['defaults'](config[_0x8bd0('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x8bd0('0x16'))(new Redis(config[_0x8bd0('0x15')]));require(_0x8bd0('0x17'))[_0x8bd0('0x18')](socket);function respondWithStatusCode(_0x53c763,_0x47a69b){_0x47a69b=_0x47a69b||0xcc;return function(_0x4cef03){if(_0x4cef03){return _0x53c763[_0x8bd0('0x19')](_0x47a69b);}return _0x53c763[_0x8bd0('0x1a')](_0x47a69b)['end']();};}function respondWithResult(_0x1f79e0,_0x47ae26){_0x47ae26=_0x47ae26||0xc8;return function(_0x3875f0){if(_0x3875f0){return _0x1f79e0['status'](_0x47ae26)[_0x8bd0('0x1b')](_0x3875f0);}};}function respondWithFilteredResult(_0x2c19ec,_0x243d06){return function(_0x5ac561){if(_0x5ac561){var _0x56ed9d=typeof _0x243d06[_0x8bd0('0x1c')]===_0x8bd0('0x1d')&&typeof _0x243d06[_0x8bd0('0x1e')]===_0x8bd0('0x1d');var _0x308deb=_0x5ac561[_0x8bd0('0x1f')];var _0x590ed=_0x56ed9d?0x0:_0x243d06['offset'];var _0x1b1a3c=_0x56ed9d?_0x5ac561['count']:_0x243d06['offset']+_0x243d06[_0x8bd0('0x1e')];var _0x5b1c87;if(_0x1b1a3c>=_0x308deb){_0x1b1a3c=_0x308deb;_0x5b1c87=0xc8;}else{_0x5b1c87=0xce;}_0x2c19ec[_0x8bd0('0x1a')](_0x5b1c87);return _0x2c19ec[_0x8bd0('0x20')](_0x8bd0('0x21'),_0x590ed+'-'+_0x1b1a3c+'/'+_0x308deb)[_0x8bd0('0x1b')](_0x5ac561);}return null;};}function patchUpdates(_0x3d3b3d){return function(_0x4331b3){try{jsonpatch[_0x8bd0('0x22')](_0x4331b3,_0x3d3b3d,!![]);}catch(_0x4725ee){return BPromise[_0x8bd0('0x23')](_0x4725ee);}return _0x4331b3[_0x8bd0('0x24')]();};}function saveUpdates(_0x2ec05d,_0x4ce4b1){return function(_0x196115){if(_0x196115){return _0x196115['update'](_0x2ec05d)[_0x8bd0('0x25')](function(_0x53faa6){return _0x53faa6;});}return null;};}function removeEntity(_0x1dde3a,_0x1aa286){return function(_0x23ebbd){if(_0x23ebbd){return _0x23ebbd[_0x8bd0('0x26')]()[_0x8bd0('0x25')](function(){_0x1dde3a[_0x8bd0('0x1a')](0xcc)[_0x8bd0('0x27')]();});}};}function handleEntityNotFound(_0x4a2875,_0x3277fa){return function(_0x15ab81){if(!_0x15ab81){_0x4a2875[_0x8bd0('0x19')](0x194);}return _0x15ab81;};}function handleError(_0x2a4fb3,_0x6910c1){_0x6910c1=_0x6910c1||0x1f4;return function(_0x11fb38){logger['error'](_0x11fb38['stack']);if(_0x11fb38[_0x8bd0('0x28')]){delete _0x11fb38[_0x8bd0('0x28')];}_0x2a4fb3[_0x8bd0('0x1a')](_0x6910c1)[_0x8bd0('0x29')](_0x11fb38);};}exports[_0x8bd0('0x2a')]=function(_0x227bc7,_0x370369){var _0x172f39={},_0x4f74ec={},_0x1545b5={'count':0x0,'rows':[]};var _0x4ff3d4=_['map'](db[_0x8bd0('0x2b')][_0x8bd0('0x2c')],function(_0x23e115){return{'name':_0x23e115[_0x8bd0('0x2d')],'type':_0x23e115['type'][_0x8bd0('0x2e')]};});_0x4f74ec[_0x8bd0('0x2f')]=_[_0x8bd0('0x30')](_0x4ff3d4,_0x8bd0('0x28'));_0x4f74ec[_0x8bd0('0x31')]=_['keys'](_0x227bc7[_0x8bd0('0x31')]);_0x4f74ec['filters']=_[_0x8bd0('0x32')](_0x4f74ec[_0x8bd0('0x2f')],_0x4f74ec[_0x8bd0('0x31')]);_0x172f39[_0x8bd0('0x33')]=_[_0x8bd0('0x32')](_0x4f74ec[_0x8bd0('0x2f')],qs[_0x8bd0('0x34')](_0x227bc7[_0x8bd0('0x31')][_0x8bd0('0x34')]));_0x172f39[_0x8bd0('0x33')]=_0x172f39['attributes'][_0x8bd0('0x35')]?_0x172f39[_0x8bd0('0x33')]:_0x4f74ec['model'];if(!_0x227bc7[_0x8bd0('0x31')][_0x8bd0('0x36')]('nolimit')){_0x172f39[_0x8bd0('0x1e')]=qs[_0x8bd0('0x1e')](_0x227bc7[_0x8bd0('0x31')][_0x8bd0('0x1e')]);_0x172f39[_0x8bd0('0x1c')]=qs[_0x8bd0('0x1c')](_0x227bc7[_0x8bd0('0x31')][_0x8bd0('0x1c')]);}_0x172f39[_0x8bd0('0x37')]=qs[_0x8bd0('0x38')](_0x227bc7[_0x8bd0('0x31')][_0x8bd0('0x38')]);_0x172f39[_0x8bd0('0x39')]=qs['filters'](_[_0x8bd0('0x3a')](_0x227bc7[_0x8bd0('0x31')],_0x4f74ec[_0x8bd0('0x3b')]),_0x4ff3d4);if(_0x227bc7[_0x8bd0('0x31')][_0x8bd0('0x3c')]){_0x172f39['where']=_[_0x8bd0('0x3d')](_0x172f39['where'],{'$or':_['map'](_0x4ff3d4,function(_0x173ec7){if(_0x173ec7[_0x8bd0('0x3e')]!==_0x8bd0('0x3f')){var _0x5e2907={};_0x5e2907[_0x173ec7[_0x8bd0('0x28')]]={'$like':'%'+_0x227bc7['query'][_0x8bd0('0x3c')]+'%'};return _0x5e2907;}})});}_0x172f39=_[_0x8bd0('0x3d')]({},_0x172f39,_0x227bc7[_0x8bd0('0x40')]);var _0xf8c260={'where':_0x172f39['where']};return db['ChatInternalMessage'][_0x8bd0('0x1f')](_0xf8c260)['then'](function(_0x5347c0){_0x1545b5['count']=_0x5347c0;if(_0x227bc7[_0x8bd0('0x31')][_0x8bd0('0x41')]){_0x172f39[_0x8bd0('0x42')]=[{'all':!![]}];}return db[_0x8bd0('0x2b')][_0x8bd0('0x43')](_0x172f39);})['then'](function(_0x4203ed){_0x1545b5[_0x8bd0('0x44')]=_0x4203ed;return _0x1545b5;})[_0x8bd0('0x25')](respondWithFilteredResult(_0x370369,_0x172f39))[_0x8bd0('0x45')](handleError(_0x370369,null));};exports[_0x8bd0('0x46')]=function(_0x5c48d9,_0x1299fc){var _0x109953={'raw':!![],'where':{'id':_0x5c48d9[_0x8bd0('0x47')]['id']}},_0x54f8bf={};_0x54f8bf['model']=_['keys'](db[_0x8bd0('0x2b')][_0x8bd0('0x2c')]);_0x54f8bf['query']=_[_0x8bd0('0x48')](_0x5c48d9[_0x8bd0('0x31')]);_0x54f8bf[_0x8bd0('0x3b')]=_[_0x8bd0('0x32')](_0x54f8bf[_0x8bd0('0x2f')],_0x54f8bf[_0x8bd0('0x31')]);_0x109953[_0x8bd0('0x33')]=_[_0x8bd0('0x32')](_0x54f8bf[_0x8bd0('0x2f')],qs[_0x8bd0('0x34')](_0x5c48d9['query'][_0x8bd0('0x34')]));_0x109953[_0x8bd0('0x33')]=_0x109953[_0x8bd0('0x33')]['length']?_0x109953['attributes']:_0x54f8bf[_0x8bd0('0x2f')];if(_0x5c48d9['query']['includeAll']){_0x109953['include']=[{'all':!![]}];}_0x109953=_[_0x8bd0('0x3d')]({},_0x109953,_0x5c48d9[_0x8bd0('0x40')]);return db[_0x8bd0('0x2b')][_0x8bd0('0x49')](_0x109953)['then'](handleEntityNotFound(_0x1299fc,null))[_0x8bd0('0x25')](respondWithResult(_0x1299fc,null))[_0x8bd0('0x45')](handleError(_0x1299fc,null));};exports[_0x8bd0('0x4a')]=function(_0x1fb3c8,_0x3e35b8){return db[_0x8bd0('0x2b')][_0x8bd0('0x4a')](_0x1fb3c8[_0x8bd0('0x4b')],{})[_0x8bd0('0x25')](respondWithResult(_0x3e35b8,0xc9))[_0x8bd0('0x45')](handleError(_0x3e35b8,null));};exports[_0x8bd0('0x4c')]=function(_0x42f987,_0x322ad9){if(_0x42f987[_0x8bd0('0x4b')]['id']){delete _0x42f987[_0x8bd0('0x4b')]['id'];}return db[_0x8bd0('0x2b')]['find']({'where':{'id':_0x42f987['params']['id']}})[_0x8bd0('0x25')](handleEntityNotFound(_0x322ad9,null))[_0x8bd0('0x25')](saveUpdates(_0x42f987[_0x8bd0('0x4b')],null))[_0x8bd0('0x25')](respondWithResult(_0x322ad9,null))['catch'](handleError(_0x322ad9,null));};exports[_0x8bd0('0x26')]=function(_0x3258aa,_0x2f7f80){return db[_0x8bd0('0x2b')][_0x8bd0('0x49')]({'where':{'id':_0x3258aa[_0x8bd0('0x47')]['id']}})[_0x8bd0('0x25')](handleEntityNotFound(_0x2f7f80,null))[_0x8bd0('0x25')](removeEntity(_0x2f7f80,null))[_0x8bd0('0x45')](handleError(_0x2f7f80,null));};exports[_0x8bd0('0x4d')]=function(_0x50b2a1,_0x26da61){return db[_0x8bd0('0x2b')]['describe']()[_0x8bd0('0x25')](respondWithResult(_0x26da61,null))[_0x8bd0('0x45')](handleError(_0x26da61,null));};function wrapUser(_0x31462a){return function(_0xb07ffd){var _0x59279c=_0x31462a[_0x8bd0('0x4e')]({'plain':!![]});_0x59279c['messages']=[];if(_0xb07ffd){_0x59279c[_0x8bd0('0x4f')]=_0xb07ffd[_0x8bd0('0x50')];_0x59279c['lastMessage']=_0xb07ffd;}else{_0x59279c[_0x8bd0('0x4f')]=moment(0x0)[_0x8bd0('0x51')](_0x8bd0('0x52'));_0x59279c[_0x8bd0('0x53')]={};}return _0x59279c;};}exports[_0x8bd0('0x54')]=function(_0x4b05bf,_0x4cfeff,_0x4f3de3){var _0x4ecf68=[];return db['User'][_0x8bd0('0x43')]({'where':{'role':[_0x8bd0('0x55'),_0x8bd0('0x56'),_0x8bd0('0x57')]},'attributes':['id','fullname',_0x8bd0('0x28'),_0x8bd0('0x58'),_0x8bd0('0x59'),_0x8bd0('0x5a'),_0x8bd0('0x5b'),_0x8bd0('0x5c'),_0x8bd0('0x5d'),_0x8bd0('0x5e')],'order':qs[_0x8bd0('0x38')]('-online'),'include':[{'model':db[_0x8bd0('0x5f')],'as':_0x8bd0('0x60'),'attributes':['id','name',_0x8bd0('0x3e')],'through':{'attributes':[]}}]})['then'](function(_0x5e893d){if(_0x5e893d){var _0x5030de=_0x4b05bf[_0x8bd0('0x57')][_0x8bd0('0x4e')]({'plain':!![]});if(!_0x5030de)throw new Error(_0x8bd0('0x61'));if(_0x5030de[_0x8bd0('0x58')]===_0x8bd0('0x57')){return db[_0x8bd0('0x62')][_0x8bd0('0x49')]({'where':{'name':_0x8bd0('0x63'),'userProfileId':_0x5030de[_0x8bd0('0x64')]},'raw':!![]})['then'](function(_0x11afd4){if(_0x11afd4){if(_0x11afd4[_0x8bd0('0x65')]===0x0){return db[_0x8bd0('0x66')][_0x8bd0('0x43')]({'where':{'sectionId':_0x11afd4['id']},'raw':!![]})['then'](function(_0x91b4eb){var _0x13d2c7=[];if(_[_0x8bd0('0x67')](_0x91b4eb)){_0x13d2c7=_[_0x8bd0('0x3c')](_0x5e893d,function(_0xf1afce){if(_0xf1afce[_0x8bd0('0x58')]!==_0x8bd0('0x55')){return _0xf1afce;}});return _0x13d2c7;}else{for(var _0x7b947a=0x0;_0x7b947a<_0x5e893d[_0x8bd0('0x35')];_0x7b947a++){var _0x6ac35a=_0x5e893d[_0x7b947a];if(_0x6ac35a[_0x8bd0('0x58')]===_0x8bd0('0x55')){var _0x2b52eb=_[_0x8bd0('0x49')](_0x91b4eb,function(_0x53d82f){return _0x53d82f['resourceId']===_0x6ac35a['id'];});if(_0x2b52eb)_0x13d2c7['push'](_0x6ac35a);}else{_0x13d2c7['push'](_0x6ac35a);}}return _0x13d2c7;}});}else{return _0x5e893d;}}else{var _0x5e9906=_[_0x8bd0('0x3c')](_0x5e893d,function(_0x4160a8){if(_0x4160a8[_0x8bd0('0x58')]!==_0x8bd0('0x55')){return _0x4160a8;}});return _0x5e9906;}});}else{return _0x5e893d;}}})[_0x8bd0('0x25')](function(_0x2bab9a){var _0x39b26a=[];if(_0x2bab9a){_0x4ecf68=_0x2bab9a;for(var _0x86bfee=0x0;_0x86bfee<_0x2bab9a[_0x8bd0('0x35')];_0x86bfee+=0x1){_0x4ecf68[_0x86bfee][_0x8bd0('0x68')]=[];_0x39b26a[_0x8bd0('0x69')](db[_0x8bd0('0x2b')][_0x8bd0('0x49')]({'where':{'FromId':[_0x4b05bf[_0x8bd0('0x57')]['id'],_0x2bab9a[_0x86bfee]['id']],'ToId':[_0x4b05bf[_0x8bd0('0x57')]['id'],_0x2bab9a[_0x86bfee]['id']],'ChatGroupId':null},'attributes':['id',_0x8bd0('0x50'),'FromId',_0x8bd0('0x6a'),_0x8bd0('0x6b'),_0x8bd0('0x4b')],'order':qs[_0x8bd0('0x38')](_0x8bd0('0x6c')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x8bd0('0x25')](wrapUser(_0x2bab9a[_0x86bfee])));}return BPromise[_0x8bd0('0x6d')](_0x39b26a);}return[];})[_0x8bd0('0x25')](function(_0x5b41f6){return{'rows':_0x5b41f6,'count':_0x5b41f6[_0x8bd0('0x35')]};})[_0x8bd0('0x25')](respondWithResult(_0x4cfeff,null))[_0x8bd0('0x45')](handleError(_0x4cfeff,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index b3219de..7c5516e 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 _0xb3f0=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','../../mysqldb','ChatInternalMessage'];(function(_0x521929,_0x479be5){var _0x632436=function(_0x288290){while(--_0x288290){_0x521929['push'](_0x521929['shift']());}};_0x632436(++_0x479be5);}(_0xb3f0,0x103));var _0x0b3f=function(_0x39772f,_0x5605cb){_0x39772f=_0x39772f-0x0;var _0xc9edbf=_0xb3f0[_0x39772f];return _0xc9edbf;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x0b3f('0x0'))['db'][_0x0b3f('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x0b3f('0x2')](0x0);var events={'afterCreate':_0x0b3f('0x3'),'afterUpdate':_0x0b3f('0x4'),'afterDestroy':_0x0b3f('0x5')};function emitEvent(_0x33604f){return function(_0x46b6b0,_0x439e99,_0x1b780f){ChatInternalMessageEvents[_0x0b3f('0x6')](_0x33604f+':'+_0x46b6b0['id'],_0x46b6b0);ChatInternalMessageEvents['emit'](_0x33604f,_0x46b6b0);_0x1b780f(null);};}for(var e in events){if(events[_0x0b3f('0x7')](e)){var event=events[e];ChatInternalMessage[_0x0b3f('0x8')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file +var _0x3c9a=['../../mysqldb','ChatInternalMessage','save','emit','hasOwnProperty','events'];(function(_0x595d29,_0x3cab2a){var _0x254cdf=function(_0x2f3b9c){while(--_0x2f3b9c){_0x595d29['push'](_0x595d29['shift']());}};_0x254cdf(++_0x3cab2a);}(_0x3c9a,0x131));var _0xa3c9=function(_0x19ad71,_0x5e9627){_0x19ad71=_0x19ad71-0x0;var _0x1994e6=_0x3c9a[_0x19ad71];return _0x1994e6;};'use strict';var EventEmitter=require(_0xa3c9('0x0'));var ChatInternalMessage=require(_0xa3c9('0x1'))['db'][_0xa3c9('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa3c9('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x7db66d){return function(_0x9cc2f3,_0x4ec896,_0x392856){ChatInternalMessageEvents[_0xa3c9('0x4')](_0x7db66d+':'+_0x9cc2f3['id'],_0x9cc2f3);ChatInternalMessageEvents['emit'](_0x7db66d,_0x9cc2f3);_0x392856(null);};}for(var e in events){if(events[_0xa3c9('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 bc59e10..2cfe1f3 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 _0x43d0=['exports','define','chat_internal_messages','utf8mb4','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','./chatInternalMessage.attributes'];(function(_0x109409,_0x531e67){var _0x841581=function(_0x17f5e0){while(--_0x17f5e0){_0x109409['push'](_0x109409['shift']());}};_0x841581(++_0x531e67);}(_0x43d0,0xc4));var _0x043d=function(_0x25c326,_0x250137){_0x25c326=_0x25c326-0x0;var _0x762452=_0x43d0[_0x25c326];return _0x762452;};'use strict';var _=require(_0x043d('0x0'));var util=require('util');var logger=require(_0x043d('0x1'))(_0x043d('0x2'));var moment=require(_0x043d('0x3'));var BPromise=require(_0x043d('0x4'));var rp=require(_0x043d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x043d('0x6'));var config=require('../../config/environment');var attributes=require(_0x043d('0x7'));module[_0x043d('0x8')]=function(_0x2fc4cc,_0x45e622){return _0x2fc4cc[_0x043d('0x9')]('ChatInternalMessage',attributes,{'tableName':_0x043d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x043d('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xb83d=['bluebird','request-promise','rimraf','../../config/environment','./chatInternalMessage.attributes','define','ChatInternalMessage','utf8mb4_unicode_ci','lodash','util','api','moment'];(function(_0x6c172e,_0x168af6){var _0x1428dd=function(_0x16753d){while(--_0x16753d){_0x6c172e['push'](_0x6c172e['shift']());}};_0x1428dd(++_0x168af6);}(_0xb83d,0x8c));var _0xdb83=function(_0x24c07c,_0x4889c5){_0x24c07c=_0x24c07c-0x0;var _0x413a44=_0xb83d[_0x24c07c];return _0x413a44;};'use strict';var _=require(_0xdb83('0x0'));var util=require(_0xdb83('0x1'));var logger=require('../../config/logger')(_0xdb83('0x2'));var moment=require(_0xdb83('0x3'));var BPromise=require(_0xdb83('0x4'));var rp=require(_0xdb83('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdb83('0x6'));var config=require(_0xdb83('0x7'));var attributes=require(_0xdb83('0x8'));module['exports']=function(_0x3fb8bd,_0x3a3e72){return _0x3fb8bd[_0xdb83('0x9')](_0xdb83('0xa'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xdb83('0xb')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index abd689b..9f19f31 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 _0x0725=['./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x3a72db,_0x4ced16){var _0x5952d6=function(_0x592db5){while(--_0x592db5){_0x3a72db['push'](_0x3a72db['shift']());}};_0x5952d6(++_0x4ced16);}(_0x0725,0x167));var _0x5072=function(_0x43a5c8,_0x4b86b4){_0x43a5c8=_0x43a5c8-0x0;var _0x1d78f2=_0x0725[_0x43a5c8];return _0x1d78f2;};'use strict';var _=require('lodash');var util=require(_0x5072('0x0'));var moment=require('moment');var BPromise=require(_0x5072('0x1'));var rs=require(_0x5072('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5072('0x3'))['db'];var utils=require(_0x5072('0x4'));var logger=require(_0x5072('0x5'))('rpc');var config=require(_0x5072('0x6'));var jayson=require(_0x5072('0x7'));var client=jayson[_0x5072('0x8')]['http']({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x5072('0x9'))[_0x5072('0xa')](socket);function respondWithRpcPromise(_0x52dd41,_0x59bfb1,_0x13f75c){return new BPromise(function(_0x393bf8,_0x8deb0d){return client[_0x5072('0xb')](_0x52dd41,_0x13f75c)[_0x5072('0xc')](function(_0x25f834){logger[_0x5072('0xd')](_0x5072('0xe'),_0x59bfb1,_0x5072('0xf'));logger[_0x5072('0x10')](_0x5072('0x11'),_0x59bfb1,_0x5072('0xf'),JSON['stringify'](_0x25f834));if(_0x25f834['error']){if(_0x25f834[_0x5072('0x12')][_0x5072('0x13')]===0x1f4){logger['error'](_0x5072('0xe'),_0x59bfb1,_0x25f834['error'][_0x5072('0x14')]);return _0x8deb0d(_0x25f834[_0x5072('0x12')][_0x5072('0x14')]);}logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x59bfb1,_0x25f834[_0x5072('0x12')][_0x5072('0x14')]);return _0x393bf8(_0x25f834[_0x5072('0x12')][_0x5072('0x14')]);}else{logger[_0x5072('0xd')](_0x5072('0xe'),_0x59bfb1,_0x5072('0xf'));_0x393bf8(_0x25f834[_0x5072('0x15')]['message']);}})[_0x5072('0x16')](function(_0x3074e3){logger[_0x5072('0x12')]('ChatInternalMessage,\x20%s,\x20%s',_0x59bfb1,_0x3074e3);_0x8deb0d(_0x3074e3);});});} \ No newline at end of file +var _0x5915=['code','message','info','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','client','http','defaults','redis','localhost','socket.io-emitter','register','request','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2c3c23,_0x3609b5){var _0x24e0ee=function(_0x510410){while(--_0x510410){_0x2c3c23['push'](_0x2c3c23['shift']());}};_0x24e0ee(++_0x3609b5);}(_0x5915,0x14a));var _0x5591=function(_0x4c666d,_0x41cb12){_0x4c666d=_0x4c666d-0x0;var _0x1ad479=_0x5915[_0x4c666d];return _0x1ad479;};'use strict';var _=require(_0x5591('0x0'));var util=require(_0x5591('0x1'));var moment=require(_0x5591('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5591('0x3'));var db=require(_0x5591('0x4'))['db'];var utils=require(_0x5591('0x5'));var logger=require('../../config/logger')(_0x5591('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5591('0x7')][_0x5591('0x8')]({'port':0x232a});config['redis']=_[_0x5591('0x9')](config[_0x5591('0xa')],{'host':_0x5591('0xb'),'port':0x18eb});var socket=require(_0x5591('0xc'))(new Redis(config[_0x5591('0xa')]));require('./chatInternalMessage.socket')[_0x5591('0xd')](socket);function respondWithRpcPromise(_0x3ca61c,_0x5a964e,_0xa9a68f){return new BPromise(function(_0x5d8375,_0x1636d3){return client[_0x5591('0xe')](_0x3ca61c,_0xa9a68f)['then'](function(_0x2b97a3){logger['info'](_0x5591('0xf'),_0x5a964e,_0x5591('0x10'));logger['debug'](_0x5591('0x11'),_0x5a964e,_0x5591('0x10'),JSON[_0x5591('0x12')](_0x2b97a3));if(_0x2b97a3[_0x5591('0x13')]){if(_0x2b97a3[_0x5591('0x13')][_0x5591('0x14')]===0x1f4){logger['error'](_0x5591('0xf'),_0x5a964e,_0x2b97a3[_0x5591('0x13')]['message']);return _0x1636d3(_0x2b97a3[_0x5591('0x13')][_0x5591('0x15')]);}logger[_0x5591('0x13')](_0x5591('0xf'),_0x5a964e,_0x2b97a3['error'][_0x5591('0x15')]);return _0x5d8375(_0x2b97a3[_0x5591('0x13')][_0x5591('0x15')]);}else{logger[_0x5591('0x16')](_0x5591('0xf'),_0x5a964e,_0x5591('0x10'));_0x5d8375(_0x2b97a3[_0x5591('0x17')][_0x5591('0x15')]);}})[_0x5591('0x18')](function(_0xf8fd40){logger[_0x5591('0x13')](_0x5591('0xf'),_0x5a964e,_0xf8fd40);_0x1636d3(_0xf8fd40);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 2df5cb8..3d1f0d9 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 _0xc997=['register','length','chatInternalMessage:','./chatInternalMessage.events','remove','update','emit','removeListener'];(function(_0x3a132e,_0xb39c16){var _0x303f27=function(_0xe58afb){while(--_0xe58afb){_0x3a132e['push'](_0x3a132e['shift']());}};_0x303f27(++_0xb39c16);}(_0xc997,0x83));var _0x7c99=function(_0x2b40b3,_0x471270){_0x2b40b3=_0x2b40b3-0x0;var _0x44423f=_0xc997[_0x2b40b3];return _0x44423f;};'use strict';var ChatInternalMessageEvents=require(_0x7c99('0x0'));var events=['save',_0x7c99('0x1'),_0x7c99('0x2')];function createListener(_0xd4db9a,_0x40067f){return function(_0x3f119c){_0x40067f[_0x7c99('0x3')](_0xd4db9a,_0x3f119c);};}function removeListener(_0xaf85bc,_0x5baf61){return function(){ChatInternalMessageEvents[_0x7c99('0x4')](_0xaf85bc,_0x5baf61);};}exports[_0x7c99('0x5')]=function(_0xc085d1){for(var _0x202022=0x0,_0x2e591d=events[_0x7c99('0x6')];_0x202022<_0x2e591d;_0x202022++){var _0x4c6a62=events[_0x202022];var _0x15c37e=createListener(_0x7c99('0x7')+_0x4c6a62,_0xc085d1);ChatInternalMessageEvents['on'](_0x4c6a62,_0x15c37e);}}; \ No newline at end of file +var _0xb98e=['chatInternalMessage:','save','remove','emit','removeListener','length'];(function(_0x437b50,_0x45e934){var _0x28c321=function(_0x333824){while(--_0x333824){_0x437b50['push'](_0x437b50['shift']());}};_0x28c321(++_0x45e934);}(_0xb98e,0x1d5));var _0xeb98=function(_0x3d1254,_0xb758c8){_0x3d1254=_0x3d1254-0x0;var _0x22b82a=_0xb98e[_0x3d1254];return _0x22b82a;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0xeb98('0x0'),_0xeb98('0x1'),'update'];function createListener(_0x4940f6,_0x1fb859){return function(_0x185a70){_0x1fb859[_0xeb98('0x2')](_0x4940f6,_0x185a70);};}function removeListener(_0x27b78e,_0xbb84f8){return function(){ChatInternalMessageEvents[_0xeb98('0x3')](_0x27b78e,_0xbb84f8);};}exports['register']=function(_0x5568bf){for(var _0xabe588=0x0,_0x30f1ab=events[_0xeb98('0x4')];_0xabe588<_0x30f1ab;_0xabe588++){var _0x37bdc7=events[_0xabe588];var _0x75a00a=createListener(_0xeb98('0x5')+_0x37bdc7,_0x5568bf);ChatInternalMessageEvents['on'](_0x37bdc7,_0x75a00a);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 2d1f113..8706d3b 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 _0xbf38=['post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','index','/describe','isAuthenticated','describe','/users','getUsers','/:id','show'];(function(_0x4b7af6,_0x2bb0cd){var _0x4215b5=function(_0x3572cc){while(--_0x3572cc){_0x4b7af6['push'](_0x4b7af6['shift']());}};_0x4215b5(++_0x2bb0cd);}(_0xbf38,0xfa));var _0x8bf3=function(_0x9bd3c1,_0x11dc72){_0x9bd3c1=_0x9bd3c1-0x0;var _0x33aa72=_0xbf38[_0x9bd3c1];return _0x33aa72;};'use strict';var multer=require(_0x8bf3('0x0'));var util=require(_0x8bf3('0x1'));var path=require(_0x8bf3('0x2'));var timeout=require(_0x8bf3('0x3'));var express=require(_0x8bf3('0x4'));var router=express[_0x8bf3('0x5')]();var fs_extra=require(_0x8bf3('0x6'));var auth=require(_0x8bf3('0x7'));var interaction=require(_0x8bf3('0x8'));var config=require(_0x8bf3('0x9'));var controller=require(_0x8bf3('0xa'));router[_0x8bf3('0xb')]('/',auth['isAuthenticated'](),controller[_0x8bf3('0xc')]);router[_0x8bf3('0xb')](_0x8bf3('0xd'),auth[_0x8bf3('0xe')](),controller[_0x8bf3('0xf')]);router['get'](_0x8bf3('0x10'),auth['isAuthenticated'](),controller[_0x8bf3('0x11')]);router[_0x8bf3('0xb')](_0x8bf3('0x12'),auth[_0x8bf3('0xe')](),controller[_0x8bf3('0x13')]);router[_0x8bf3('0x14')]('/',auth[_0x8bf3('0xe')](),controller[_0x8bf3('0x15')]);router[_0x8bf3('0x16')]('/:id',controller[_0x8bf3('0x17')]);router[_0x8bf3('0x18')](_0x8bf3('0x12'),auth[_0x8bf3('0xe')](),controller[_0x8bf3('0x19')]);module[_0x8bf3('0x1a')]=router; \ No newline at end of file +var _0x94f9=['isAuthenticated','index','/describe','describe','/users','getUsers','/:id','show','post','put','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./chatInternalMessage.controller','get'];(function(_0x290638,_0x1fa809){var _0x5d9530=function(_0x4c0214){while(--_0x4c0214){_0x290638['push'](_0x290638['shift']());}};_0x5d9530(++_0x1fa809);}(_0x94f9,0x11d));var _0x994f=function(_0x11e496,_0x550762){_0x11e496=_0x11e496-0x0;var _0x4b2c4b=_0x94f9[_0x11e496];return _0x4b2c4b;};'use strict';var multer=require('multer');var util=require(_0x994f('0x0'));var path=require(_0x994f('0x1'));var timeout=require(_0x994f('0x2'));var express=require(_0x994f('0x3'));var router=express[_0x994f('0x4')]();var fs_extra=require(_0x994f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x994f('0x6'));var config=require('../../config/environment');var controller=require(_0x994f('0x7'));router[_0x994f('0x8')]('/',auth[_0x994f('0x9')](),controller[_0x994f('0xa')]);router[_0x994f('0x8')](_0x994f('0xb'),auth[_0x994f('0x9')](),controller[_0x994f('0xc')]);router[_0x994f('0x8')](_0x994f('0xd'),auth[_0x994f('0x9')](),controller[_0x994f('0xe')]);router[_0x994f('0x8')](_0x994f('0xf'),auth[_0x994f('0x9')](),controller[_0x994f('0x10')]);router[_0x994f('0x11')]('/',auth[_0x994f('0x9')](),controller['create']);router[_0x994f('0x12')]('/:id',controller['update']);router[_0x994f('0x13')]('/:id',auth[_0x994f('0x9')](),controller['destroy']);module[_0x994f('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index a0af48c..d953fbd 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 _0x390a=['STRING','sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out'];(function(_0x4c7d79,_0xa1ebef){var _0x4644ac=function(_0x5af985){while(--_0x5af985){_0x4c7d79['push'](_0x4c7d79['shift']());}};_0x4644ac(++_0xa1ebef);}(_0x390a,0xc9));var _0xa390=function(_0x18dc8b,_0x330b0b){_0x18dc8b=_0x18dc8b-0x0;var _0x5c27a2=_0x390a[_0x18dc8b];return _0x5c27a2;};'use strict';var Sequelize=require(_0xa390('0x0'));module[_0xa390('0x1')]={'body':{'type':Sequelize[_0xa390('0x2')](_0xa390('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0xa390('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xa390('0x5')]('in',_0xa390('0x6')),'defaultValue':_0xa390('0x6'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0xa390('0x7')]},'providerResponse':{'type':Sequelize[_0xa390('0x2')]}}; \ No newline at end of file +var _0x8603=['medium','ENUM','out','STRING','exports','TEXT'];(function(_0xe5b349,_0x5f06e4){var _0x26b0ad=function(_0x1a97f1){while(--_0x1a97f1){_0xe5b349['push'](_0xe5b349['shift']());}};_0x26b0ad(++_0x5f06e4);}(_0x8603,0x190));var _0x3860=function(_0x56ed5d,_0x222353){_0x56ed5d=_0x56ed5d-0x0;var _0x3391a6=_0x8603[_0x56ed5d];return _0x3391a6;};'use strict';var Sequelize=require('sequelize');module[_0x3860('0x0')]={'body':{'type':Sequelize[_0x3860('0x1')](_0x3860('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x3860('0x3')]('in',_0x3860('0x4')),'defaultValue':_0x3860('0x4'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x3860('0x5')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 18e1ed6..23ab3a0 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 _0xb2d5=['ChatMessage','includeAll','include','findAll','rows','show','params','rawAttributes','find','create','body','describe','chat-interactions','chat','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','contact','User','fullname','email','internal','channel','motionChannel','event','accept','EventManager','acceptmessage','parse','formData','ChatInteraction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','Sequelize','SELECT','SIP/%s','rejectmessage','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','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','redis','localhost','./chatMessage.socket','register','jayson/promise','client','http','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','sendStatus','status','json','offset','limit','undefined','count','Content-Range','reject','save','update','destroy','then','end','stack','name','send','index','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','type','VIRTUAL','options'];(function(_0xedc061,_0x35a113){var _0x2eef4e=function(_0x316a81){while(--_0x316a81){_0xedc061['push'](_0xedc061['shift']());}};_0x2eef4e(++_0x35a113);}(_0xb2d5,0x1c2));var _0x5b2d=function(_0x312090,_0x30f8b8){_0x312090=_0x312090-0x0;var _0x426f08=_0xb2d5[_0x312090];return _0x426f08;};'use strict';var emlformat=require(_0x5b2d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5b2d('0x1'));var jsonpatch=require(_0x5b2d('0x2'));var rp=require(_0x5b2d('0x3'));var moment=require(_0x5b2d('0x4'));var BPromise=require(_0x5b2d('0x5'));var Mustache=require('mustache');var util=require(_0x5b2d('0x6'));var path=require(_0x5b2d('0x7'));var sox=require('sox');var csv=require(_0x5b2d('0x8'));var ejs=require(_0x5b2d('0x9'));var fs=require('fs');var fs_extra=require(_0x5b2d('0xa'));var _=require(_0x5b2d('0xb'));var squel=require('squel');var crypto=require(_0x5b2d('0xc'));var jsforce=require(_0x5b2d('0xd'));var deskjs=require(_0x5b2d('0xe'));var toCsv=require(_0x5b2d('0x8'));var querystring=require(_0x5b2d('0xf'));var Papa=require(_0x5b2d('0x10'));var Redis=require('ioredis');var authService=require(_0x5b2d('0x11'));var qs=require(_0x5b2d('0x12'));var as=require(_0x5b2d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5b2d('0x14'))(_0x5b2d('0x15'));var utils=require(_0x5b2d('0x16'));var config=require(_0x5b2d('0x17'));var licenseUtil=require(_0x5b2d('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x5b2d('0x19')],{'host':_0x5b2d('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5b2d('0x19')]));require(_0x5b2d('0x1b'))[_0x5b2d('0x1c')](socket);var jayson=require(_0x5b2d('0x1d'));var client=jayson[_0x5b2d('0x1e')][_0x5b2d('0x1f')]({'port':0x232c});var client9002=jayson[_0x5b2d('0x1e')][_0x5b2d('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x2b50ae,_0x4bc8cc,_0x5aa61e,_0x593442){return new BPromise(function(_0xac220b,_0x3293e1){var _0x16b5e0=_0x593442||client;return _0x16b5e0['request'](_0x2b50ae,_0x5aa61e)['then'](function(_0xdb996a){logger[_0x5b2d('0x20')](_0x5b2d('0x21'),_0x4bc8cc,'request\x20sent');logger[_0x5b2d('0x22')](_0x5b2d('0x23'),_0x4bc8cc,'request\x20sent',JSON[_0x5b2d('0x24')](_0xdb996a));if(_0xdb996a[_0x5b2d('0x25')]){if(_0xdb996a['error'][_0x5b2d('0x26')]===0x1f4){logger[_0x5b2d('0x25')](_0x5b2d('0x21'),_0x4bc8cc,_0xdb996a['error'][_0x5b2d('0x27')]);return _0x3293e1(_0xdb996a['error'][_0x5b2d('0x27')]);}logger[_0x5b2d('0x25')](_0x5b2d('0x21'),_0x4bc8cc,_0xdb996a[_0x5b2d('0x25')]['message']);return _0xac220b(_0xdb996a[_0x5b2d('0x25')][_0x5b2d('0x27')]);}else{logger[_0x5b2d('0x20')](_0x5b2d('0x21'),_0x4bc8cc,_0x5b2d('0x28'));_0xac220b(_0xdb996a[_0x5b2d('0x29')][_0x5b2d('0x27')]);}})[_0x5b2d('0x2a')](function(_0x5ba403){logger[_0x5b2d('0x25')](_0x5b2d('0x21'),_0x4bc8cc,_0x5ba403);_0x3293e1(_0x5ba403);});});}function respondWithStatusCode(_0x385488,_0x567f3e){_0x567f3e=_0x567f3e||0xcc;return function(_0x50c590){if(_0x50c590){return _0x385488[_0x5b2d('0x2b')](_0x567f3e);}return _0x385488[_0x5b2d('0x2c')](_0x567f3e)['end']();};}function respondWithResult(_0xcdab52,_0x215001){_0x215001=_0x215001||0xc8;return function(_0x58c8e0){if(_0x58c8e0){return _0xcdab52[_0x5b2d('0x2c')](_0x215001)[_0x5b2d('0x2d')](_0x58c8e0);}};}function respondWithFilteredResult(_0xda8e38,_0x1632b9){return function(_0x38bfd0){if(_0x38bfd0){var _0x54ea84=typeof _0x1632b9[_0x5b2d('0x2e')]==='undefined'&&typeof _0x1632b9[_0x5b2d('0x2f')]===_0x5b2d('0x30');var _0x5306d7=_0x38bfd0[_0x5b2d('0x31')];var _0x432ae0=_0x54ea84?0x0:_0x1632b9[_0x5b2d('0x2e')];var _0x5793eb=_0x54ea84?_0x38bfd0[_0x5b2d('0x31')]:_0x1632b9[_0x5b2d('0x2e')]+_0x1632b9[_0x5b2d('0x2f')];var _0x3e3c0c;if(_0x5793eb>=_0x5306d7){_0x5793eb=_0x5306d7;_0x3e3c0c=0xc8;}else{_0x3e3c0c=0xce;}_0xda8e38[_0x5b2d('0x2c')](_0x3e3c0c);return _0xda8e38['set'](_0x5b2d('0x32'),_0x432ae0+'-'+_0x5793eb+'/'+_0x5306d7)[_0x5b2d('0x2d')](_0x38bfd0);}return null;};}function patchUpdates(_0x11b3a9){return function(_0x399491){try{jsonpatch['apply'](_0x399491,_0x11b3a9,!![]);}catch(_0x4022eb){return BPromise[_0x5b2d('0x33')](_0x4022eb);}return _0x399491[_0x5b2d('0x34')]();};}function saveUpdates(_0x1d686e,_0x209cf0){return function(_0x3b4384){if(_0x3b4384){return _0x3b4384[_0x5b2d('0x35')](_0x1d686e)['then'](function(_0x52bcf0){return _0x52bcf0;});}return null;};}function removeEntity(_0x50b166,_0x361514){return function(_0x19ad4f){if(_0x19ad4f){return _0x19ad4f[_0x5b2d('0x36')]()[_0x5b2d('0x37')](function(){_0x50b166[_0x5b2d('0x2c')](0xcc)[_0x5b2d('0x38')]();});}};}function handleEntityNotFound(_0x369042,_0xff236){return function(_0x237eb6){if(!_0x237eb6){_0x369042[_0x5b2d('0x2b')](0x194);}return _0x237eb6;};}function handleError(_0x4f1960,_0x3a8824){_0x3a8824=_0x3a8824||0x1f4;return function(_0x2f992a){logger['error'](_0x2f992a[_0x5b2d('0x39')]);if(_0x2f992a['name']){delete _0x2f992a[_0x5b2d('0x3a')];}_0x4f1960['status'](_0x3a8824)[_0x5b2d('0x3b')](_0x2f992a);};}exports[_0x5b2d('0x3c')]=function(_0x22cc8b,_0x31863a){var _0x56ec51={},_0x21698f={},_0x43112c={'count':0x0,'rows':[]};var _0x78ff00=_['map'](db['ChatMessage']['rawAttributes'],function(_0x3505a0){return{'name':_0x3505a0['fieldName'],'type':_0x3505a0['type']['key']};});_0x21698f[_0x5b2d('0x3d')]=_['map'](_0x78ff00,_0x5b2d('0x3a'));_0x21698f[_0x5b2d('0x3e')]=_[_0x5b2d('0x3f')](_0x22cc8b[_0x5b2d('0x3e')]);_0x21698f[_0x5b2d('0x40')]=_[_0x5b2d('0x41')](_0x21698f[_0x5b2d('0x3d')],_0x21698f[_0x5b2d('0x3e')]);_0x56ec51[_0x5b2d('0x42')]=_['intersection'](_0x21698f[_0x5b2d('0x3d')],qs[_0x5b2d('0x43')](_0x22cc8b[_0x5b2d('0x3e')][_0x5b2d('0x43')]));_0x56ec51[_0x5b2d('0x42')]=_0x56ec51['attributes'][_0x5b2d('0x44')]?_0x56ec51[_0x5b2d('0x42')]:_0x21698f[_0x5b2d('0x3d')];if(!_0x22cc8b[_0x5b2d('0x3e')][_0x5b2d('0x45')]('nolimit')){_0x56ec51[_0x5b2d('0x2f')]=qs[_0x5b2d('0x2f')](_0x22cc8b[_0x5b2d('0x3e')][_0x5b2d('0x2f')]);_0x56ec51[_0x5b2d('0x2e')]=qs[_0x5b2d('0x2e')](_0x22cc8b[_0x5b2d('0x3e')]['offset']);}_0x56ec51[_0x5b2d('0x46')]=qs[_0x5b2d('0x47')](_0x22cc8b[_0x5b2d('0x3e')]['sort']);_0x56ec51[_0x5b2d('0x48')]=qs['filters'](_['pick'](_0x22cc8b['query'],_0x21698f[_0x5b2d('0x40')]),_0x78ff00);if(_0x22cc8b[_0x5b2d('0x3e')][_0x5b2d('0x49')]){_0x56ec51[_0x5b2d('0x48')]=_[_0x5b2d('0x4a')](_0x56ec51[_0x5b2d('0x48')],{'$or':_['map'](_0x78ff00,function(_0xeb5ddd){if(_0xeb5ddd[_0x5b2d('0x4b')]!==_0x5b2d('0x4c')){var _0x429f78={};_0x429f78[_0xeb5ddd[_0x5b2d('0x3a')]]={'$like':'%'+_0x22cc8b[_0x5b2d('0x3e')][_0x5b2d('0x49')]+'%'};return _0x429f78;}})});}_0x56ec51=_['merge']({},_0x56ec51,_0x22cc8b[_0x5b2d('0x4d')]);var _0x5d905d={'where':_0x56ec51[_0x5b2d('0x48')]};return db[_0x5b2d('0x4e')]['count'](_0x5d905d)[_0x5b2d('0x37')](function(_0x117e04){_0x43112c[_0x5b2d('0x31')]=_0x117e04;if(_0x22cc8b[_0x5b2d('0x3e')][_0x5b2d('0x4f')]){_0x56ec51[_0x5b2d('0x50')]=[{'all':!![]}];}return db[_0x5b2d('0x4e')][_0x5b2d('0x51')](_0x56ec51);})[_0x5b2d('0x37')](function(_0x32b8f6){_0x43112c[_0x5b2d('0x52')]=_0x32b8f6;return _0x43112c;})[_0x5b2d('0x37')](respondWithFilteredResult(_0x31863a,_0x56ec51))[_0x5b2d('0x2a')](handleError(_0x31863a,null));};exports[_0x5b2d('0x53')]=function(_0x16d958,_0x34f6f5){var _0x440921={'raw':!![],'where':{'id':_0x16d958[_0x5b2d('0x54')]['id']}},_0x1da2e3={};_0x1da2e3['model']=_[_0x5b2d('0x3f')](db[_0x5b2d('0x4e')][_0x5b2d('0x55')]);_0x1da2e3[_0x5b2d('0x3e')]=_[_0x5b2d('0x3f')](_0x16d958[_0x5b2d('0x3e')]);_0x1da2e3[_0x5b2d('0x40')]=_[_0x5b2d('0x41')](_0x1da2e3['model'],_0x1da2e3['query']);_0x440921[_0x5b2d('0x42')]=_['intersection'](_0x1da2e3['model'],qs['fields'](_0x16d958['query']['fields']));_0x440921[_0x5b2d('0x42')]=_0x440921[_0x5b2d('0x42')][_0x5b2d('0x44')]?_0x440921[_0x5b2d('0x42')]:_0x1da2e3['model'];if(_0x16d958['query'][_0x5b2d('0x4f')]){_0x440921[_0x5b2d('0x50')]=[{'all':!![]}];}_0x440921=_[_0x5b2d('0x4a')]({},_0x440921,_0x16d958[_0x5b2d('0x4d')]);return db[_0x5b2d('0x4e')][_0x5b2d('0x56')](_0x440921)[_0x5b2d('0x37')](handleEntityNotFound(_0x34f6f5,null))[_0x5b2d('0x37')](respondWithResult(_0x34f6f5,null))[_0x5b2d('0x2a')](handleError(_0x34f6f5,null));};exports[_0x5b2d('0x57')]=function(_0xa93c7,_0x4f65c0){return db['ChatMessage'][_0x5b2d('0x57')](_0xa93c7[_0x5b2d('0x58')],{})['then'](respondWithResult(_0x4f65c0,0xc9))[_0x5b2d('0x2a')](handleError(_0x4f65c0,null));};exports[_0x5b2d('0x35')]=function(_0x1e1cad,_0x31614d){if(_0x1e1cad[_0x5b2d('0x58')]['id']){delete _0x1e1cad['body']['id'];}return db[_0x5b2d('0x4e')][_0x5b2d('0x56')]({'where':{'id':_0x1e1cad[_0x5b2d('0x54')]['id']}})['then'](handleEntityNotFound(_0x31614d,null))[_0x5b2d('0x37')](saveUpdates(_0x1e1cad[_0x5b2d('0x58')],null))[_0x5b2d('0x37')](respondWithResult(_0x31614d,null))[_0x5b2d('0x2a')](handleError(_0x31614d,null));};exports[_0x5b2d('0x36')]=function(_0x35d0f5,_0x1221b1){return db[_0x5b2d('0x4e')][_0x5b2d('0x56')]({'where':{'id':_0x35d0f5['params']['id']}})['then'](handleEntityNotFound(_0x1221b1,null))[_0x5b2d('0x37')](removeEntity(_0x1221b1,null))[_0x5b2d('0x2a')](handleError(_0x1221b1,null));};exports['describe']=function(_0x52d4c4,_0x370579){return db[_0x5b2d('0x4e')][_0x5b2d('0x59')]()[_0x5b2d('0x37')](respondWithResult(_0x370579,null))[_0x5b2d('0x2a')](handleError(_0x370579,null));};var interaction_log=require('../../config/logger')(_0x5b2d('0x5a'));exports['accept']=function(_0x162714,_0x5c5e4d,_0x3596e1){var _0x5bf68e={'agent':{},'channel':_0x5b2d('0x5b')};if(_0x162714['body']['id']){delete _0x162714[_0x5b2d('0x58')]['id'];}_0x162714[_0x5b2d('0x58')]['read']=!![];_0x162714['body']['readAt']=moment()[_0x5b2d('0x5c')](_0x5b2d('0x5d'));_0x162714[_0x5b2d('0x58')][_0x5b2d('0x5e')]=_0x162714[_0x5b2d('0x58')][_0x5b2d('0x5e')]||_0x162714[_0x5b2d('0x5f')]['id'];_0x5bf68e[_0x5b2d('0x60')]['id']=_0x162714[_0x5b2d('0x58')][_0x5b2d('0x5e')];return db['ChatMessage'][_0x5b2d('0x56')]({'where':{'id':_0x162714[_0x5b2d('0x54')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5c5e4d,null))[_0x5b2d('0x37')](saveUpdates(_0x162714[_0x5b2d('0x58')],null))[_0x5b2d('0x37')](function(_0x572c36){if(_0x572c36){_0x5bf68e[_0x5b2d('0x27')]=_0x572c36[_0x5b2d('0x61')]({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0x572c36[_0x5b2d('0x62')]}});}return null;})[_0x5b2d('0x37')](handleEntityNotFound(_0x5c5e4d,null))[_0x5b2d('0x37')](function(_0x56e19e){if(_0x56e19e){return _0x56e19e[_0x5b2d('0x35')]({'UserId':_0x162714[_0x5b2d('0x58')]['UserId'],'read1stAt':_[_0x5b2d('0x63')](_0x56e19e[_0x5b2d('0x64')])?moment()[_0x5b2d('0x5c')](_0x5b2d('0x5d')):undefined});}return null;})[_0x5b2d('0x37')](function(_0x28ef01){if(_0x28ef01){_0x5bf68e[_0x5b2d('0x65')]=_0x28ef01['get']({'plain':!![]});interaction_log[_0x5b2d('0x20')](_0x5b2d('0x66'),_0x162714[_0x5b2d('0x5f')]['id'],_0x162714[_0x5b2d('0x5f')][_0x5b2d('0x3a')],_0x162714[_0x5b2d('0x5f')][_0x5b2d('0x67')],_0x5bf68e['interaction']['id'],_0x162714[_0x5b2d('0x58')]?JSON[_0x5b2d('0x24')](_0x162714[_0x5b2d('0x58')]):_0x5b2d('0x68'));return respondWithRpcPromise(_0x5b2d('0x69'),_0x5b2d('0x6a'),_0x5bf68e);}return null;})['then'](function(_0x259094){var _0x5dadb0=_0x5b2d('0x6b')+_0x259094[_0x5b2d('0x27')][_0x5b2d('0x6c')];return db[_0x5b2d('0x6d')][_0x5b2d('0x3e')](_0x5dadb0,{'type':db['Sequelize'][_0x5b2d('0x6e')]['SELECT'],'raw':!![]})[_0x5b2d('0x37')](function(_0x4a0efc){return _0x4a0efc;});})[_0x5b2d('0x37')](function(_0x548c7c){if(_0x548c7c){_0x5bf68e['message'][_0x5b2d('0x6f')]=_0x548c7c[0x0];if(!_0x162714[_0x5b2d('0x58')][_0x5b2d('0x5e')])return;return db[_0x5b2d('0x70')]['find']({'where':{'id':_0x162714['body'][_0x5b2d('0x5e')],'role':_0x5b2d('0x60')},'attributes':['id',_0x5b2d('0x3a'),_0x5b2d('0x71'),_0x5b2d('0x72'),_0x5b2d('0x73')],'raw':!![]});}return null;})[_0x5b2d('0x37')](function(_0x2cf682){if(!_0x2cf682)return null;_0x5bf68e[_0x5b2d('0x27')][_0x5b2d('0x60')]=_0x2cf682;return _0x5bf68e;})[_0x5b2d('0x37')](function(_0x302e92){if(_0x302e92){if(_0x162714['body']['manual']){_0x5bf68e[_0x5b2d('0x27')]['interface']=util[_0x5b2d('0x5c')]('SIP/%s',_0x162714[_0x5b2d('0x5f')][_0x5b2d('0x3a')]);_0x5bf68e['message'][_0x5b2d('0x74')]=_0x5bf68e[_0x5b2d('0x74')];_0x5bf68e['message'][_0x5b2d('0x75')]=_0x5bf68e[_0x5b2d('0x74')];_0x5bf68e[_0x5b2d('0x27')][_0x5b2d('0x76')]=_0x5b2d('0x77');return respondWithRpcPromise(_0x5b2d('0x78'),_0x5b2d('0x78'),{'event':_0x5b2d('0x79'),'message':_['merge'](_0x5bf68e['message'],JSON[_0x5b2d('0x7a')](_0x5bf68e[_0x5b2d('0x65')][_0x5b2d('0x7b')]))},client9002)['then'](function(){return _0x5bf68e;});}return _0x5bf68e;}return null;})[_0x5b2d('0x37')](respondWithResult(_0x5c5e4d,null))['catch'](handleError(_0x5c5e4d,null));};var interaction_log=require('../../config/logger')('chat-interactions');exports[_0x5b2d('0x33')]=function(_0x5c070a,_0x3b57b1,_0x201cd4){var _0x5224ee={'agent':{},'channel':_0x5b2d('0x5b')};if(_0x5c070a[_0x5b2d('0x58')]['id']){delete _0x5c070a[_0x5b2d('0x58')]['id'];}_0x5c070a['body'][_0x5b2d('0x5e')]=_0x5c070a[_0x5b2d('0x58')][_0x5b2d('0x5e')]||_0x5c070a[_0x5b2d('0x5f')]['id'];_0x5224ee[_0x5b2d('0x60')]['id']=_0x5c070a[_0x5b2d('0x58')][_0x5b2d('0x5e')];return db[_0x5b2d('0x4e')][_0x5b2d('0x56')]({'where':{'id':_0x5c070a[_0x5b2d('0x54')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3b57b1,null))['then'](function(_0x35ca0d){if(_0x35ca0d){_0x5224ee[_0x5b2d('0x27')]=_0x35ca0d[_0x5b2d('0x61')]({'plain':!![]});return db[_0x5b2d('0x7c')][_0x5b2d('0x56')]({'where':{'id':_0x35ca0d['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x3b57b1,null))['then'](function(_0x2df031){if(_0x2df031){_0x5224ee['interaction']=_0x2df031[_0x5b2d('0x61')]({'plain':!![]});interaction_log['info'](_0x5b2d('0x7d'),_0x5c070a[_0x5b2d('0x5f')]['id'],_0x5c070a[_0x5b2d('0x5f')][_0x5b2d('0x3a')],_0x5c070a[_0x5b2d('0x5f')][_0x5b2d('0x67')],_0x5224ee[_0x5b2d('0x65')]['id'],_0x5c070a[_0x5b2d('0x58')]?JSON['stringify'](_0x5c070a['body']):_0x5b2d('0x68'));return respondWithRpcPromise(_0x5b2d('0x7e'),_0x5b2d('0x7f'),_0x5224ee);}return null;})['then'](function(_0x25bcd4){var _0x46f5c1=_0x5b2d('0x6b')+_0x25bcd4[_0x5b2d('0x27')]['ContactId'];return db[_0x5b2d('0x6d')][_0x5b2d('0x3e')](_0x46f5c1,{'type':db[_0x5b2d('0x80')][_0x5b2d('0x6e')][_0x5b2d('0x81')],'raw':!![]})[_0x5b2d('0x37')](function(_0x446694){return _0x446694;});})['then'](function(_0x1d5ac5){if(_0x1d5ac5){_0x5224ee['message'][_0x5b2d('0x6f')]=_0x1d5ac5[0x0];if(!_0x5c070a[_0x5b2d('0x58')][_0x5b2d('0x5e')])return;return db[_0x5b2d('0x70')][_0x5b2d('0x56')]({'where':{'id':_0x5c070a['body'][_0x5b2d('0x5e')],'role':_0x5b2d('0x60')},'attributes':['id',_0x5b2d('0x3a'),'fullname',_0x5b2d('0x72'),'internal'],'raw':!![]});}return null;})[_0x5b2d('0x37')](function(_0x16bf1d){if(!_0x16bf1d)return null;_0x5224ee[_0x5b2d('0x27')]['agent']=_0x16bf1d;return _0x5224ee;})[_0x5b2d('0x37')](function(_0x549ed1){if(_0x549ed1){_0x549ed1[_0x5b2d('0x27')]['interface']=util[_0x5b2d('0x5c')](_0x5b2d('0x82'),_0x5c070a[_0x5b2d('0x5f')][_0x5b2d('0x3a')]);_0x549ed1[_0x5b2d('0x27')][_0x5b2d('0x74')]=_0x5224ee[_0x5b2d('0x74')];_0x549ed1['message']['motionChannel']=_0x5224ee[_0x5b2d('0x74')];_0x549ed1[_0x5b2d('0x27')][_0x5b2d('0x76')]='reject';respondWithRpcPromise(_0x5b2d('0x78'),'EventManager',{'event':_0x5b2d('0x83'),'message':_[_0x5b2d('0x4a')](_0x5224ee[_0x5b2d('0x27')],JSON[_0x5b2d('0x7a')](_0x5224ee[_0x5b2d('0x65')]['formData']))},client9002);return _0x5224ee;}return null;})[_0x5b2d('0x37')](respondWithResult(_0x3b57b1,null))[_0x5b2d('0x2a')](handleError(_0x3b57b1,null));}; \ No newline at end of file +var _0xa369=['fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','register','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','status','offset','undefined','count','limit','set','json','reject','save','update','destroy','sendStatus','name','send','index','map','ChatMessage','rawAttributes','fieldName','model','query','keys','filters','intersection','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','rows','show','params','fields','find','create','body','describe','../../config/logger','chat-interactions','accept','chat','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteractionId','read1stAt','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','formData','ChatInteraction','role','RejectMessage','rejectMessage','rejectmessage','rimraf'];(function(_0x482790,_0x280ef1){var _0x1ea5c8=function(_0x2925fd){while(--_0x2925fd){_0x482790['push'](_0x482790['shift']());}};_0x1ea5c8(++_0x280ef1);}(_0xa369,0x107));var _0x9a36=function(_0x434b43,_0x2e0a0d){_0x434b43=_0x434b43-0x0;var _0x179ecc=_0xa369[_0x434b43];return _0x179ecc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9a36('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9a36('0x1'));var rp=require(_0x9a36('0x2'));var moment=require(_0x9a36('0x3'));var BPromise=require(_0x9a36('0x4'));var Mustache=require(_0x9a36('0x5'));var util=require(_0x9a36('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9a36('0x7'));var fs=require('fs');var fs_extra=require(_0x9a36('0x8'));var _=require(_0x9a36('0x9'));var squel=require(_0x9a36('0xa'));var crypto=require(_0x9a36('0xb'));var jsforce=require(_0x9a36('0xc'));var deskjs=require(_0x9a36('0xd'));var toCsv=require(_0x9a36('0xe'));var querystring=require(_0x9a36('0xf'));var Papa=require(_0x9a36('0x10'));var Redis=require(_0x9a36('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x9a36('0x12'));var as=require(_0x9a36('0x13'));var hardwareService=require(_0x9a36('0x14'));var logger=require('../../config/logger')(_0x9a36('0x15'));var utils=require('../../config/utils');var config=require(_0x9a36('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x9a36('0x17'))['db'];config[_0x9a36('0x18')]=_[_0x9a36('0x19')](config[_0x9a36('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x9a36('0x1a'))(new Redis(config[_0x9a36('0x18')]));require('./chatMessage.socket')[_0x9a36('0x1b')](socket);var jayson=require(_0x9a36('0x1c'));var client=jayson[_0x9a36('0x1d')][_0x9a36('0x1e')]({'port':0x232c});var client9002=jayson[_0x9a36('0x1d')][_0x9a36('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x5f4b85,_0x350dab,_0x4a1333,_0x398035){return new BPromise(function(_0x2081ec,_0xafa2ec){var _0x4b13cd=_0x398035||client;return _0x4b13cd[_0x9a36('0x1f')](_0x5f4b85,_0x4a1333)[_0x9a36('0x20')](function(_0x1d5499){logger[_0x9a36('0x21')](_0x9a36('0x22'),_0x350dab,_0x9a36('0x23'));logger[_0x9a36('0x24')](_0x9a36('0x25'),_0x350dab,'request\x20sent',JSON[_0x9a36('0x26')](_0x1d5499));if(_0x1d5499[_0x9a36('0x27')]){if(_0x1d5499['error'][_0x9a36('0x28')]===0x1f4){logger[_0x9a36('0x27')](_0x9a36('0x22'),_0x350dab,_0x1d5499[_0x9a36('0x27')][_0x9a36('0x29')]);return _0xafa2ec(_0x1d5499['error'][_0x9a36('0x29')]);}logger[_0x9a36('0x27')]('ChatMessage,\x20%s,\x20%s',_0x350dab,_0x1d5499[_0x9a36('0x27')][_0x9a36('0x29')]);return _0x2081ec(_0x1d5499['error']['message']);}else{logger[_0x9a36('0x21')](_0x9a36('0x22'),_0x350dab,_0x9a36('0x23'));_0x2081ec(_0x1d5499['result']['message']);}})[_0x9a36('0x2a')](function(_0x1a117e){logger[_0x9a36('0x27')]('ChatMessage,\x20%s,\x20%s',_0x350dab,_0x1a117e);_0xafa2ec(_0x1a117e);});});}function respondWithStatusCode(_0x521546,_0x4bcc13){_0x4bcc13=_0x4bcc13||0xcc;return function(_0x11a99d){if(_0x11a99d){return _0x521546['sendStatus'](_0x4bcc13);}return _0x521546[_0x9a36('0x2b')](_0x4bcc13)['end']();};}function respondWithResult(_0x463d8d,_0x417b62){_0x417b62=_0x417b62||0xc8;return function(_0x40196e){if(_0x40196e){return _0x463d8d[_0x9a36('0x2b')](_0x417b62)['json'](_0x40196e);}};}function respondWithFilteredResult(_0x3747f1,_0x45a2d2){return function(_0x2bff7b){if(_0x2bff7b){var _0x1fcf0a=typeof _0x45a2d2[_0x9a36('0x2c')]===_0x9a36('0x2d')&&typeof _0x45a2d2['limit']===_0x9a36('0x2d');var _0x3df796=_0x2bff7b[_0x9a36('0x2e')];var _0x50b1f6=_0x1fcf0a?0x0:_0x45a2d2[_0x9a36('0x2c')];var _0x328b21=_0x1fcf0a?_0x2bff7b[_0x9a36('0x2e')]:_0x45a2d2['offset']+_0x45a2d2[_0x9a36('0x2f')];var _0x156d00;if(_0x328b21>=_0x3df796){_0x328b21=_0x3df796;_0x156d00=0xc8;}else{_0x156d00=0xce;}_0x3747f1['status'](_0x156d00);return _0x3747f1[_0x9a36('0x30')]('Content-Range',_0x50b1f6+'-'+_0x328b21+'/'+_0x3df796)[_0x9a36('0x31')](_0x2bff7b);}return null;};}function patchUpdates(_0x24c62a){return function(_0x1a3407){try{jsonpatch['apply'](_0x1a3407,_0x24c62a,!![]);}catch(_0x20f8db){return BPromise[_0x9a36('0x32')](_0x20f8db);}return _0x1a3407[_0x9a36('0x33')]();};}function saveUpdates(_0x4b4d1d,_0x3fdfc4){return function(_0xda446e){if(_0xda446e){return _0xda446e[_0x9a36('0x34')](_0x4b4d1d)[_0x9a36('0x20')](function(_0x4b59fe){return _0x4b59fe;});}return null;};}function removeEntity(_0x25fa90,_0x38461b){return function(_0x1908c8){if(_0x1908c8){return _0x1908c8[_0x9a36('0x35')]()['then'](function(){_0x25fa90[_0x9a36('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x619848,_0x78336a){return function(_0x4eb519){if(!_0x4eb519){_0x619848[_0x9a36('0x36')](0x194);}return _0x4eb519;};}function handleError(_0x3abee4,_0x29777c){_0x29777c=_0x29777c||0x1f4;return function(_0x48c3eb){logger[_0x9a36('0x27')](_0x48c3eb['stack']);if(_0x48c3eb[_0x9a36('0x37')]){delete _0x48c3eb['name'];}_0x3abee4[_0x9a36('0x2b')](_0x29777c)[_0x9a36('0x38')](_0x48c3eb);};}exports[_0x9a36('0x39')]=function(_0x5f1f72,_0x178b47){var _0x46dc9e={},_0x5c883d={},_0x4e69d0={'count':0x0,'rows':[]};var _0x19a59e=_[_0x9a36('0x3a')](db[_0x9a36('0x3b')][_0x9a36('0x3c')],function(_0x20c67d){return{'name':_0x20c67d[_0x9a36('0x3d')],'type':_0x20c67d['type']['key']};});_0x5c883d[_0x9a36('0x3e')]=_[_0x9a36('0x3a')](_0x19a59e,_0x9a36('0x37'));_0x5c883d[_0x9a36('0x3f')]=_[_0x9a36('0x40')](_0x5f1f72[_0x9a36('0x3f')]);_0x5c883d[_0x9a36('0x41')]=_['intersection'](_0x5c883d[_0x9a36('0x3e')],_0x5c883d[_0x9a36('0x3f')]);_0x46dc9e['attributes']=_[_0x9a36('0x42')](_0x5c883d[_0x9a36('0x3e')],qs['fields'](_0x5f1f72[_0x9a36('0x3f')]['fields']));_0x46dc9e['attributes']=_0x46dc9e['attributes'][_0x9a36('0x43')]?_0x46dc9e[_0x9a36('0x44')]:_0x5c883d[_0x9a36('0x3e')];if(!_0x5f1f72['query'][_0x9a36('0x45')](_0x9a36('0x46'))){_0x46dc9e[_0x9a36('0x2f')]=qs[_0x9a36('0x2f')](_0x5f1f72[_0x9a36('0x3f')][_0x9a36('0x2f')]);_0x46dc9e[_0x9a36('0x2c')]=qs['offset'](_0x5f1f72['query'][_0x9a36('0x2c')]);}_0x46dc9e[_0x9a36('0x47')]=qs[_0x9a36('0x48')](_0x5f1f72['query'][_0x9a36('0x48')]);_0x46dc9e[_0x9a36('0x49')]=qs['filters'](_[_0x9a36('0x4a')](_0x5f1f72['query'],_0x5c883d[_0x9a36('0x41')]),_0x19a59e);if(_0x5f1f72[_0x9a36('0x3f')]['filter']){_0x46dc9e['where']=_[_0x9a36('0x4b')](_0x46dc9e[_0x9a36('0x49')],{'$or':_[_0x9a36('0x3a')](_0x19a59e,function(_0x41d72f){if(_0x41d72f[_0x9a36('0x4c')]!==_0x9a36('0x4d')){var _0x5c282e={};_0x5c282e[_0x41d72f[_0x9a36('0x37')]]={'$like':'%'+_0x5f1f72[_0x9a36('0x3f')][_0x9a36('0x4e')]+'%'};return _0x5c282e;}})});}_0x46dc9e=_['merge']({},_0x46dc9e,_0x5f1f72[_0x9a36('0x4f')]);var _0x3fe872={'where':_0x46dc9e[_0x9a36('0x49')]};return db[_0x9a36('0x3b')]['count'](_0x3fe872)[_0x9a36('0x20')](function(_0x1edbce){_0x4e69d0['count']=_0x1edbce;if(_0x5f1f72[_0x9a36('0x3f')][_0x9a36('0x50')]){_0x46dc9e[_0x9a36('0x51')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x46dc9e);})['then'](function(_0x3b66cd){_0x4e69d0[_0x9a36('0x52')]=_0x3b66cd;return _0x4e69d0;})['then'](respondWithFilteredResult(_0x178b47,_0x46dc9e))[_0x9a36('0x2a')](handleError(_0x178b47,null));};exports[_0x9a36('0x53')]=function(_0x391b1f,_0x2775ce){var _0x164cf3={'raw':!![],'where':{'id':_0x391b1f[_0x9a36('0x54')]['id']}},_0x400074={};_0x400074[_0x9a36('0x3e')]=_['keys'](db['ChatMessage'][_0x9a36('0x3c')]);_0x400074[_0x9a36('0x3f')]=_['keys'](_0x391b1f['query']);_0x400074[_0x9a36('0x41')]=_[_0x9a36('0x42')](_0x400074['model'],_0x400074[_0x9a36('0x3f')]);_0x164cf3['attributes']=_[_0x9a36('0x42')](_0x400074[_0x9a36('0x3e')],qs[_0x9a36('0x55')](_0x391b1f[_0x9a36('0x3f')][_0x9a36('0x55')]));_0x164cf3[_0x9a36('0x44')]=_0x164cf3['attributes'][_0x9a36('0x43')]?_0x164cf3[_0x9a36('0x44')]:_0x400074['model'];if(_0x391b1f[_0x9a36('0x3f')][_0x9a36('0x50')]){_0x164cf3[_0x9a36('0x51')]=[{'all':!![]}];}_0x164cf3=_[_0x9a36('0x4b')]({},_0x164cf3,_0x391b1f[_0x9a36('0x4f')]);return db['ChatMessage'][_0x9a36('0x56')](_0x164cf3)[_0x9a36('0x20')](handleEntityNotFound(_0x2775ce,null))[_0x9a36('0x20')](respondWithResult(_0x2775ce,null))[_0x9a36('0x2a')](handleError(_0x2775ce,null));};exports[_0x9a36('0x57')]=function(_0x38b477,_0x4e7873){return db['ChatMessage']['create'](_0x38b477[_0x9a36('0x58')],{})[_0x9a36('0x20')](respondWithResult(_0x4e7873,0xc9))[_0x9a36('0x2a')](handleError(_0x4e7873,null));};exports[_0x9a36('0x34')]=function(_0x52fd56,_0xe0818a){if(_0x52fd56['body']['id']){delete _0x52fd56[_0x9a36('0x58')]['id'];}return db[_0x9a36('0x3b')][_0x9a36('0x56')]({'where':{'id':_0x52fd56[_0x9a36('0x54')]['id']}})['then'](handleEntityNotFound(_0xe0818a,null))[_0x9a36('0x20')](saveUpdates(_0x52fd56[_0x9a36('0x58')],null))[_0x9a36('0x20')](respondWithResult(_0xe0818a,null))[_0x9a36('0x2a')](handleError(_0xe0818a,null));};exports['destroy']=function(_0x36ce2b,_0x30408a){return db[_0x9a36('0x3b')]['find']({'where':{'id':_0x36ce2b[_0x9a36('0x54')]['id']}})[_0x9a36('0x20')](handleEntityNotFound(_0x30408a,null))[_0x9a36('0x20')](removeEntity(_0x30408a,null))[_0x9a36('0x2a')](handleError(_0x30408a,null));};exports['describe']=function(_0x2ef047,_0x4d6e73){return db[_0x9a36('0x3b')][_0x9a36('0x59')]()[_0x9a36('0x20')](respondWithResult(_0x4d6e73,null))['catch'](handleError(_0x4d6e73,null));};var interaction_log=require(_0x9a36('0x5a'))(_0x9a36('0x5b'));exports[_0x9a36('0x5c')]=function(_0x307079,_0x331345,_0x30d067){var _0x21e3c6={'agent':{},'channel':_0x9a36('0x5d')};if(_0x307079[_0x9a36('0x58')]['id']){delete _0x307079[_0x9a36('0x58')]['id'];}_0x307079[_0x9a36('0x58')]['read']=!![];_0x307079['body'][_0x9a36('0x5e')]=moment()[_0x9a36('0x5f')](_0x9a36('0x60'));_0x307079['body']['UserId']=_0x307079[_0x9a36('0x58')][_0x9a36('0x61')]||_0x307079[_0x9a36('0x62')]['id'];_0x21e3c6[_0x9a36('0x63')]['id']=_0x307079[_0x9a36('0x58')][_0x9a36('0x61')];return db[_0x9a36('0x3b')]['find']({'where':{'id':_0x307079['params']['id'],'UserId':null}})[_0x9a36('0x20')](handleEntityNotFound(_0x331345,null))[_0x9a36('0x20')](saveUpdates(_0x307079[_0x9a36('0x58')],null))['then'](function(_0x49fd0d){if(_0x49fd0d){_0x21e3c6[_0x9a36('0x29')]=_0x49fd0d[_0x9a36('0x64')]({'plain':!![]});return db['ChatInteraction'][_0x9a36('0x56')]({'where':{'id':_0x49fd0d[_0x9a36('0x65')]}});}return null;})['then'](handleEntityNotFound(_0x331345,null))[_0x9a36('0x20')](function(_0x4987d5){if(_0x4987d5){return _0x4987d5[_0x9a36('0x34')]({'UserId':_0x307079[_0x9a36('0x58')]['UserId'],'read1stAt':_['isNil'](_0x4987d5[_0x9a36('0x66')])?moment()['format'](_0x9a36('0x60')):undefined});}return null;})[_0x9a36('0x20')](function(_0x23687c){if(_0x23687c){_0x21e3c6[_0x9a36('0x67')]=_0x23687c[_0x9a36('0x64')]({'plain':!![]});interaction_log[_0x9a36('0x21')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x307079['user']['id'],_0x307079[_0x9a36('0x62')][_0x9a36('0x37')],_0x307079['user']['role'],_0x21e3c6['interaction']['id'],_0x307079[_0x9a36('0x58')]?JSON[_0x9a36('0x26')](_0x307079[_0x9a36('0x58')]):_0x9a36('0x68'));return respondWithRpcPromise(_0x9a36('0x69'),_0x9a36('0x6a'),_0x21e3c6);}return null;})[_0x9a36('0x20')](function(_0x26ecd6){var _0x11a234=_0x9a36('0x6b')+_0x26ecd6[_0x9a36('0x29')][_0x9a36('0x6c')];return db[_0x9a36('0x6d')][_0x9a36('0x3f')](_0x11a234,{'type':db[_0x9a36('0x6e')][_0x9a36('0x6f')][_0x9a36('0x70')],'raw':!![]})[_0x9a36('0x20')](function(_0x31cd7d){return _0x31cd7d;});})['then'](function(_0x189d42){if(_0x189d42){_0x21e3c6[_0x9a36('0x29')][_0x9a36('0x71')]=_0x189d42[0x0];if(!_0x307079[_0x9a36('0x58')][_0x9a36('0x61')])return;return db['User'][_0x9a36('0x56')]({'where':{'id':_0x307079[_0x9a36('0x58')][_0x9a36('0x61')],'role':_0x9a36('0x63')},'attributes':['id',_0x9a36('0x37'),_0x9a36('0x72'),_0x9a36('0x73'),_0x9a36('0x74')],'raw':!![]});}return null;})[_0x9a36('0x20')](function(_0x54cad4){if(!_0x54cad4)return null;_0x21e3c6[_0x9a36('0x29')][_0x9a36('0x63')]=_0x54cad4;return _0x21e3c6;})[_0x9a36('0x20')](function(_0x399492){if(_0x399492){if(_0x307079[_0x9a36('0x58')][_0x9a36('0x75')]){_0x21e3c6[_0x9a36('0x29')][_0x9a36('0x76')]=util[_0x9a36('0x5f')](_0x9a36('0x77'),_0x307079[_0x9a36('0x62')][_0x9a36('0x37')]);_0x21e3c6[_0x9a36('0x29')][_0x9a36('0x78')]=_0x21e3c6['channel'];_0x21e3c6[_0x9a36('0x29')][_0x9a36('0x79')]=_0x21e3c6['channel'];_0x21e3c6[_0x9a36('0x29')][_0x9a36('0x7a')]='accept';return respondWithRpcPromise('EventManager',_0x9a36('0x7b'),{'event':_0x9a36('0x7c'),'message':_[_0x9a36('0x4b')](_0x21e3c6['message'],JSON[_0x9a36('0x7d')](_0x21e3c6['interaction'][_0x9a36('0x7e')]))},client9002)[_0x9a36('0x20')](function(){return _0x21e3c6;});}return _0x21e3c6;}return null;})[_0x9a36('0x20')](respondWithResult(_0x331345,null))[_0x9a36('0x2a')](handleError(_0x331345,null));};var interaction_log=require(_0x9a36('0x5a'))('chat-interactions');exports[_0x9a36('0x32')]=function(_0x55f984,_0x48e637,_0x9ac26e){var _0x1b195a={'agent':{},'channel':'chat'};if(_0x55f984['body']['id']){delete _0x55f984['body']['id'];}_0x55f984[_0x9a36('0x58')][_0x9a36('0x61')]=_0x55f984[_0x9a36('0x58')][_0x9a36('0x61')]||_0x55f984[_0x9a36('0x62')]['id'];_0x1b195a['agent']['id']=_0x55f984[_0x9a36('0x58')]['UserId'];return db[_0x9a36('0x3b')]['find']({'where':{'id':_0x55f984[_0x9a36('0x54')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x48e637,null))['then'](function(_0x40b09a){if(_0x40b09a){_0x1b195a[_0x9a36('0x29')]=_0x40b09a[_0x9a36('0x64')]({'plain':!![]});return db[_0x9a36('0x7f')][_0x9a36('0x56')]({'where':{'id':_0x40b09a[_0x9a36('0x65')]}});}return null;})[_0x9a36('0x20')](handleEntityNotFound(_0x48e637,null))['then'](function(_0x436385){if(_0x436385){_0x1b195a['interaction']=_0x436385[_0x9a36('0x64')]({'plain':!![]});interaction_log[_0x9a36('0x21')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x55f984[_0x9a36('0x62')]['id'],_0x55f984['user'][_0x9a36('0x37')],_0x55f984[_0x9a36('0x62')][_0x9a36('0x80')],_0x1b195a[_0x9a36('0x67')]['id'],_0x55f984[_0x9a36('0x58')]?JSON[_0x9a36('0x26')](_0x55f984['body']):_0x9a36('0x68'));return respondWithRpcPromise(_0x9a36('0x81'),_0x9a36('0x82'),_0x1b195a);}return null;})[_0x9a36('0x20')](function(_0x1e855d){var _0xc7c0c4=_0x9a36('0x6b')+_0x1e855d[_0x9a36('0x29')][_0x9a36('0x6c')];return db[_0x9a36('0x6d')][_0x9a36('0x3f')](_0xc7c0c4,{'type':db[_0x9a36('0x6e')]['QueryTypes']['SELECT'],'raw':!![]})[_0x9a36('0x20')](function(_0x19bbc8){return _0x19bbc8;});})['then'](function(_0x24421c){if(_0x24421c){_0x1b195a[_0x9a36('0x29')]['contact']=_0x24421c[0x0];if(!_0x55f984[_0x9a36('0x58')][_0x9a36('0x61')])return;return db['User'][_0x9a36('0x56')]({'where':{'id':_0x55f984[_0x9a36('0x58')]['UserId'],'role':'agent'},'attributes':['id',_0x9a36('0x37'),_0x9a36('0x72'),_0x9a36('0x73'),'internal'],'raw':!![]});}return null;})['then'](function(_0x325792){if(!_0x325792)return null;_0x1b195a[_0x9a36('0x29')][_0x9a36('0x63')]=_0x325792;return _0x1b195a;})[_0x9a36('0x20')](function(_0x54b5c9){if(_0x54b5c9){_0x54b5c9['message'][_0x9a36('0x76')]=util[_0x9a36('0x5f')](_0x9a36('0x77'),_0x55f984['user'][_0x9a36('0x37')]);_0x54b5c9[_0x9a36('0x29')][_0x9a36('0x78')]=_0x1b195a[_0x9a36('0x78')];_0x54b5c9[_0x9a36('0x29')][_0x9a36('0x79')]=_0x1b195a[_0x9a36('0x78')];_0x54b5c9[_0x9a36('0x29')][_0x9a36('0x7a')]=_0x9a36('0x32');respondWithRpcPromise('EventManager','EventManager',{'event':_0x9a36('0x83'),'message':_[_0x9a36('0x4b')](_0x1b195a[_0x9a36('0x29')],JSON[_0x9a36('0x7d')](_0x1b195a[_0x9a36('0x67')][_0x9a36('0x7e')]))},client9002);return _0x1b195a;}return null;})[_0x9a36('0x20')](respondWithResult(_0x48e637,null))[_0x9a36('0x2a')](handleError(_0x48e637,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 27e1de5..04f5cb0 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 _0x67c4=['ChatMessage','setMaxListeners','save','update','remove','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x5c2871,_0x9f21e6){var _0x4d962d=function(_0x4069dc){while(--_0x4069dc){_0x5c2871['push'](_0x5c2871['shift']());}};_0x4d962d(++_0x9f21e6);}(_0x67c4,0x179));var _0x467c=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x67c4[_0x178e48];return _0x440d7e;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x467c('0x0'))['db'][_0x467c('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x467c('0x2')](0x0);var events={'afterCreate':_0x467c('0x3'),'afterUpdate':_0x467c('0x4'),'afterDestroy':_0x467c('0x5')};function emitEvent(_0x133ee6){return function(_0x280361,_0x1b0f80,_0x785dec){ChatMessageEvents['emit'](_0x133ee6+':'+_0x280361['id'],_0x280361);ChatMessageEvents['emit'](_0x133ee6,_0x280361);_0x785dec(null);};}for(var e in events){if(events[_0x467c('0x6')](e)){var event=events[e];ChatMessage[_0x467c('0x7')](e,emitEvent(event));}}module[_0x467c('0x8')]=ChatMessageEvents; \ No newline at end of file +var _0x4626=['hasOwnProperty','exports','events','../../mysqldb','ChatMessage','setMaxListeners','save','emit'];(function(_0x50d6f7,_0x15a219){var _0x10c70b=function(_0x311e0a){while(--_0x311e0a){_0x50d6f7['push'](_0x50d6f7['shift']());}};_0x10c70b(++_0x15a219);}(_0x4626,0x122));var _0x6462=function(_0x3ab32e,_0x375413){_0x3ab32e=_0x3ab32e-0x0;var _0x3c75ed=_0x4626[_0x3ab32e];return _0x3c75ed;};'use strict';var EventEmitter=require(_0x6462('0x0'));var ChatMessage=require(_0x6462('0x1'))['db'][_0x6462('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x6462('0x3')](0x0);var events={'afterCreate':_0x6462('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x23e7f5){return function(_0x21da51,_0x49afc0,_0x1900ed){ChatMessageEvents[_0x6462('0x5')](_0x23e7f5+':'+_0x21da51['id'],_0x21da51);ChatMessageEvents[_0x6462('0x5')](_0x23e7f5,_0x21da51);_0x1900ed(null);};}for(var e in events){if(events[_0x6462('0x6')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x6462('0x7')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index c486a48..19d6dcb 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 _0xa364=['ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','FULLTEXT','models','get','toLowerCase','direction','out','secret','isNil','UserId'];(function(_0x40fd0b,_0xd176ee){var _0x54cbf6=function(_0x153a66){while(--_0x153a66){_0x40fd0b['push'](_0x40fd0b['shift']());}};_0x54cbf6(++_0xd176ee);}(_0xa364,0x133));var _0x4a36=function(_0x43277c,_0xc46b2f){_0x43277c=_0x43277c-0x0;var _0x690371=_0xa364[_0x43277c];return _0x690371;};'use strict';var _=require(_0x4a36('0x0'));var util=require('util');var logger=require(_0x4a36('0x1'))(_0x4a36('0x2'));var moment=require(_0x4a36('0x3'));var BPromise=require(_0x4a36('0x4'));var rp=require(_0x4a36('0x5'));var fs=require('fs');var path=require(_0x4a36('0x6'));var rimraf=require(_0x4a36('0x7'));var config=require('../../config/environment');var attributes=require(_0x4a36('0x8'));module[_0x4a36('0x9')]=function(_0x38d557,_0x4dcf7d){return _0x38d557[_0x4a36('0xa')](_0x4a36('0xb'),attributes,{'tableName':_0x4a36('0xc'),'paranoid':![],'indexes':[{'name':_0x4a36('0xd'),'fields':['body'],'type':_0x4a36('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x215872,_0x75fd00,_0x5f5251){var _0x38a793=_0x38d557[_0x4a36('0xf')];var _0x49f2cc=_0x215872[_0x4a36('0x10')]({'plain':!![]});if(_0x49f2cc['direction'][_0x4a36('0x11')]()==='in'||_0x49f2cc[_0x4a36('0x12')][_0x4a36('0x11')]()===_0x4a36('0x13')&&!_0x49f2cc[_0x4a36('0x14')]&&!_[_0x4a36('0x15')](_0x49f2cc[_0x4a36('0x16')])){_0x38a793[_0x4a36('0x17')][_0x4a36('0x18')]({'where':{'id':_0x49f2cc[_0x4a36('0x19')]}})[_0x4a36('0x1a')](function(_0x400803){if(_0x400803){_0x400803[_0x4a36('0x1b')]({'lastMsgAt':_0x49f2cc[_0x4a36('0x1c')],'lastMsgDirection':_0x49f2cc['direction'][_0x4a36('0x11')]()});}})[_0x4a36('0x1d')](function(_0x3feab7){console[_0x4a36('0x1e')](_0x3feab7);});}_0x5f5251();}},'charset':_0x4a36('0x1f'),'collate':_0x4a36('0x20')});}; \ No newline at end of file +var _0x3182=['update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','bluebird','request-promise','path','./chatMessage.attributes','exports','define','chat_messages','fti_chat_messages','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction','findOne'];(function(_0x33644b,_0x19371b){var _0x49c65f=function(_0x5e732b){while(--_0x5e732b){_0x33644b['push'](_0x33644b['shift']());}};_0x49c65f(++_0x19371b);}(_0x3182,0x1b6));var _0x2318=function(_0x46e6b3,_0x1f5410){_0x46e6b3=_0x46e6b3-0x0;var _0x3fe8ec=_0x3182[_0x46e6b3];return _0x3fe8ec;};'use strict';var _=require(_0x2318('0x0'));var util=require(_0x2318('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x2318('0x2'));var rp=require(_0x2318('0x3'));var fs=require('fs');var path=require(_0x2318('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2318('0x5'));module[_0x2318('0x6')]=function(_0x25a9d7,_0xbb67af){return _0x25a9d7[_0x2318('0x7')]('ChatMessage',attributes,{'tableName':_0x2318('0x8'),'paranoid':![],'indexes':[{'name':_0x2318('0x9'),'fields':['body'],'type':_0x2318('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1f2bb2,_0x40acc4,_0x4e9b24){var _0x278127=_0x25a9d7[_0x2318('0xb')];var _0x2cac30=_0x1f2bb2[_0x2318('0xc')]({'plain':!![]});if(_0x2cac30[_0x2318('0xd')]['toLowerCase']()==='in'||_0x2cac30[_0x2318('0xd')][_0x2318('0xe')]()===_0x2318('0xf')&&!_0x2cac30[_0x2318('0x10')]&&!_[_0x2318('0x11')](_0x2cac30[_0x2318('0x12')])){_0x278127[_0x2318('0x13')][_0x2318('0x14')]({'where':{'id':_0x2cac30['ChatInteractionId']}})['then'](function(_0x3ef71d){if(_0x3ef71d){_0x3ef71d[_0x2318('0x15')]({'lastMsgAt':_0x2cac30[_0x2318('0x16')],'lastMsgDirection':_0x2cac30[_0x2318('0xd')][_0x2318('0xe')]()});}})[_0x2318('0x17')](function(_0x19edb3){console[_0x2318('0x18')](_0x19edb3);});}_0x4e9b24();}},'charset':_0x2318('0x19'),'collate':_0x2318('0x1a')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index f604856..cfe1d86 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 _0xcb32=['randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','./chatMessage.socket','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','ChatMessage','create','body','options','CreateChatMessage','stringify','util','moment'];(function(_0xed90ba,_0x523f6b){var _0x176fee=function(_0x33c54b){while(--_0x33c54b){_0xed90ba['push'](_0xed90ba['shift']());}};_0x176fee(++_0x523f6b);}(_0xcb32,0x177));var _0x2cb3=function(_0x5220cf,_0x1310e3){_0x5220cf=_0x5220cf-0x0;var _0x3535a1=_0xcb32[_0x5220cf];return _0x3535a1;};'use strict';var _=require('lodash');var util=require(_0x2cb3('0x0'));var moment=require(_0x2cb3('0x1'));var BPromise=require('bluebird');var rs=require(_0x2cb3('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2cb3('0x3'));var logger=require(_0x2cb3('0x4'))(_0x2cb3('0x5'));var config=require('../../config/environment');var jayson=require(_0x2cb3('0x6'));var client=jayson['client'][_0x2cb3('0x7')]({'port':0x232a});config[_0x2cb3('0x8')]=_[_0x2cb3('0x9')](config[_0x2cb3('0x8')],{'host':_0x2cb3('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2cb3('0x8')]));require(_0x2cb3('0xb'))['register'](socket);function respondWithRpcPromise(_0x2ce70a,_0x3f0ecf,_0x166265){return new BPromise(function(_0xb9e38e,_0x1a6fc2){return client[_0x2cb3('0xc')](_0x2ce70a,_0x166265)[_0x2cb3('0xd')](function(_0x95e600){logger[_0x2cb3('0xe')](_0x2cb3('0xf'),_0x3f0ecf,_0x2cb3('0x10'));logger[_0x2cb3('0x11')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x3f0ecf,'request\x20sent',JSON['stringify'](_0x95e600));if(_0x95e600[_0x2cb3('0x12')]){if(_0x95e600[_0x2cb3('0x12')][_0x2cb3('0x13')]===0x1f4){logger[_0x2cb3('0x12')](_0x2cb3('0xf'),_0x3f0ecf,_0x95e600[_0x2cb3('0x12')][_0x2cb3('0x14')]);return _0x1a6fc2(_0x95e600[_0x2cb3('0x12')][_0x2cb3('0x14')]);}logger[_0x2cb3('0x12')](_0x2cb3('0xf'),_0x3f0ecf,_0x95e600[_0x2cb3('0x12')][_0x2cb3('0x14')]);return _0xb9e38e(_0x95e600[_0x2cb3('0x12')]['message']);}else{logger[_0x2cb3('0xe')](_0x2cb3('0xf'),_0x3f0ecf,_0x2cb3('0x10'));_0xb9e38e(_0x95e600[_0x2cb3('0x15')][_0x2cb3('0x14')]);}})[_0x2cb3('0x16')](function(_0x3a20d6){logger['error']('ChatMessage,\x20%s,\x20%s',_0x3f0ecf,_0x3a20d6);_0x1a6fc2(_0x3a20d6);});});}exports['CreateChatMessage']=function(_0x3628c0){var _0xdf680d=this;return new Promise(function(_0x2fc2d3,_0x2e1164){return db[_0x2cb3('0x17')][_0x2cb3('0x18')](_0x3628c0[_0x2cb3('0x19')],{'raw':_0x3628c0[_0x2cb3('0x1a')]?_0x3628c0[_0x2cb3('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x2cb3('0xd')](function(_0x358257){logger['info'](_0x2cb3('0x1b'),_0x3628c0);logger[_0x2cb3('0x11')](_0x2cb3('0x1b'),_0x3628c0,JSON[_0x2cb3('0x1c')](_0x358257));_0x2fc2d3(_0x358257);})['catch'](function(_0x21dd1b){logger[_0x2cb3('0x12')](_0x2cb3('0x1b'),_0x21dd1b[_0x2cb3('0x14')],_0x3628c0);_0x2e1164(_0xdf680d[_0x2cb3('0x12')](0x1f4,_0x21dd1b[_0x2cb3('0x14')]));});});}; \ No newline at end of file +var _0x8c29=['request\x20sent','debug','stringify','error','message','result','catch','CreateChatMessage','ChatMessage','create','options','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s'];(function(_0x4c2b80,_0x2d9078){var _0x21ecf9=function(_0x41b90d){while(--_0x41b90d){_0x4c2b80['push'](_0x4c2b80['shift']());}};_0x21ecf9(++_0x2d9078);}(_0x8c29,0x14c));var _0x98c2=function(_0x4c70a0,_0x22ab1d){_0x4c70a0=_0x4c70a0-0x0;var _0x486e65=_0x8c29[_0x4c70a0];return _0x486e65;};'use strict';var _=require(_0x98c2('0x0'));var util=require(_0x98c2('0x1'));var moment=require(_0x98c2('0x2'));var BPromise=require(_0x98c2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x98c2('0x4'));var db=require(_0x98c2('0x5'))['db'];var utils=require(_0x98c2('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x98c2('0x7'));var jayson=require(_0x98c2('0x8'));var client=jayson[_0x98c2('0x9')][_0x98c2('0xa')]({'port':0x232a});config['redis']=_[_0x98c2('0xb')](config[_0x98c2('0xc')],{'host':_0x98c2('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x98c2('0xc')]));require(_0x98c2('0xe'))[_0x98c2('0xf')](socket);function respondWithRpcPromise(_0x1849e0,_0x3351db,_0x360f5f){return new BPromise(function(_0x279234,_0x1614fc){return client[_0x98c2('0x10')](_0x1849e0,_0x360f5f)[_0x98c2('0x11')](function(_0x4c641e){logger[_0x98c2('0x12')](_0x98c2('0x13'),_0x3351db,_0x98c2('0x14'));logger[_0x98c2('0x15')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x3351db,_0x98c2('0x14'),JSON[_0x98c2('0x16')](_0x4c641e));if(_0x4c641e[_0x98c2('0x17')]){if(_0x4c641e['error']['code']===0x1f4){logger[_0x98c2('0x17')](_0x98c2('0x13'),_0x3351db,_0x4c641e[_0x98c2('0x17')][_0x98c2('0x18')]);return _0x1614fc(_0x4c641e[_0x98c2('0x17')][_0x98c2('0x18')]);}logger[_0x98c2('0x17')](_0x98c2('0x13'),_0x3351db,_0x4c641e[_0x98c2('0x17')][_0x98c2('0x18')]);return _0x279234(_0x4c641e['error'][_0x98c2('0x18')]);}else{logger[_0x98c2('0x12')](_0x98c2('0x13'),_0x3351db,_0x98c2('0x14'));_0x279234(_0x4c641e[_0x98c2('0x19')][_0x98c2('0x18')]);}})[_0x98c2('0x1a')](function(_0x59a008){logger[_0x98c2('0x17')]('ChatMessage,\x20%s,\x20%s',_0x3351db,_0x59a008);_0x1614fc(_0x59a008);});});}exports[_0x98c2('0x1b')]=function(_0x4b0e5f){var _0x5e2e09=this;return new Promise(function(_0x430638,_0x480309){return db[_0x98c2('0x1c')][_0x98c2('0x1d')](_0x4b0e5f['body'],{'raw':_0x4b0e5f['options']?_0x4b0e5f[_0x98c2('0x1e')][_0x98c2('0x1f')]===undefined?!![]:![]:!![]})[_0x98c2('0x11')](function(_0x1a7e63){logger['info'](_0x98c2('0x1b'),_0x4b0e5f);logger[_0x98c2('0x15')](_0x98c2('0x1b'),_0x4b0e5f,JSON[_0x98c2('0x16')](_0x1a7e63));_0x430638(_0x1a7e63);})[_0x98c2('0x1a')](function(_0x394cbc){logger[_0x98c2('0x17')](_0x98c2('0x1b'),_0x394cbc['message'],_0x4b0e5f);_0x480309(_0x5e2e09['error'](0x1f4,_0x394cbc[_0x98c2('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 1d5fd51..51624c3 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 _0xac31=['remove','update','length','chatMessage:','./chatMessage.events','save'];(function(_0x27ccb6,_0x103913){var _0x412043=function(_0x3c1624){while(--_0x3c1624){_0x27ccb6['push'](_0x27ccb6['shift']());}};_0x412043(++_0x103913);}(_0xac31,0xca));var _0x1ac3=function(_0x4ade9b,_0x4ea857){_0x4ade9b=_0x4ade9b-0x0;var _0xbae091=_0xac31[_0x4ade9b];return _0xbae091;};'use strict';var ChatMessageEvents=require(_0x1ac3('0x0'));var events=[_0x1ac3('0x1'),_0x1ac3('0x2'),_0x1ac3('0x3')];function createListener(_0xd6934,_0x11dd6d){return function(_0x95548d){_0x11dd6d['emit'](_0xd6934,_0x95548d);};}function removeListener(_0x33b5ab,_0x434b5e){return function(){ChatMessageEvents['removeListener'](_0x33b5ab,_0x434b5e);};}exports['register']=function(_0xbe22b7){for(var _0x20027f=0x0,_0x2bf9b1=events[_0x1ac3('0x4')];_0x20027f<_0x2bf9b1;_0x20027f++){var _0x157604=events[_0x20027f];var _0x57893c=createListener(_0x1ac3('0x5')+_0x157604,_0xbe22b7);ChatMessageEvents['on'](_0x157604,_0x57893c);}}; \ No newline at end of file +var _0xc949=['chatMessage:','./chatMessage.events','remove','update','emit','removeListener','register','length'];(function(_0x38f411,_0x5864cc){var _0x2a6132=function(_0x206d69){while(--_0x206d69){_0x38f411['push'](_0x38f411['shift']());}};_0x2a6132(++_0x5864cc);}(_0xc949,0x181));var _0x9c94=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xc949[_0x2160a9];return _0xa88cf7;};'use strict';var ChatMessageEvents=require(_0x9c94('0x0'));var events=['save',_0x9c94('0x1'),_0x9c94('0x2')];function createListener(_0x209cd8,_0x27613f){return function(_0x54facf){_0x27613f[_0x9c94('0x3')](_0x209cd8,_0x54facf);};}function removeListener(_0x231762,_0x528a17){return function(){ChatMessageEvents[_0x9c94('0x4')](_0x231762,_0x528a17);};}exports[_0x9c94('0x5')]=function(_0x46d560){for(var _0x1357ac=0x0,_0x57fcd7=events[_0x9c94('0x6')];_0x1357ac<_0x57fcd7;_0x1357ac++){var _0x360e7b=events[_0x1357ac];var _0x25ecd0=createListener(_0x9c94('0x7')+_0x360e7b,_0x46d560);ChatMessageEvents['on'](_0x360e7b,_0x25ecd0);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index c337105..b0cebee 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 _0x24a4=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','chatmessage:create','create','put','update','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x24a4,0xf9));var _0x424a=function(_0x665aa7,_0x1f3e3f){_0x665aa7=_0x665aa7-0x0;var _0x4b5e0b=_0x24a4[_0x665aa7];return _0x4b5e0b;};'use strict';var multer=require(_0x424a('0x0'));var util=require(_0x424a('0x1'));var path=require(_0x424a('0x2'));var timeout=require(_0x424a('0x3'));var express=require('express');var router=express[_0x424a('0x4')]();var fs_extra=require(_0x424a('0x5'));var auth=require(_0x424a('0x6'));var interaction=require(_0x424a('0x7'));var config=require(_0x424a('0x8'));var controller=require(_0x424a('0x9'));router['get']('/',auth[_0x424a('0xa')](),controller[_0x424a('0xb')]);router[_0x424a('0xc')](_0x424a('0xd'),auth[_0x424a('0xa')](),controller[_0x424a('0xe')]);router[_0x424a('0xc')](_0x424a('0xf'),auth[_0x424a('0xa')](),controller[_0x424a('0x10')]);router[_0x424a('0x11')]('/',auth[_0x424a('0xa')](),interaction['tracked']('chat',_0x424a('0x12')),controller[_0x424a('0x13')]);router[_0x424a('0x14')](_0x424a('0xf'),controller[_0x424a('0x15')]);router['put']('/:id/accept',auth['isAuthenticated'](),controller[_0x424a('0x16')]);router['put'](_0x424a('0x17'),auth[_0x424a('0xa')](),controller[_0x424a('0x18')]);router[_0x424a('0x19')]('/:id',auth[_0x424a('0xa')](),controller[_0x424a('0x1a')]);module[_0x424a('0x1b')]=router; \ No newline at end of file +var _0x4327=['show','post','tracked','create','put','accept','/:id/reject','reject','destroy','exports','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x1023b2,_0x4afae8){var _0xd9e85c=function(_0x4c968f){while(--_0x4c968f){_0x1023b2['push'](_0x1023b2['shift']());}};_0xd9e85c(++_0x4afae8);}(_0x4327,0x1d2));var _0x7432=function(_0x2859f2,_0x1e3102){_0x2859f2=_0x2859f2-0x0;var _0x4974cd=_0x4327[_0x2859f2];return _0x4974cd;};'use strict';var multer=require('multer');var util=require(_0x7432('0x0'));var path=require(_0x7432('0x1'));var timeout=require(_0x7432('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x7432('0x3'));var auth=require(_0x7432('0x4'));var interaction=require(_0x7432('0x5'));var config=require(_0x7432('0x6'));var controller=require(_0x7432('0x7'));router[_0x7432('0x8')]('/',auth[_0x7432('0x9')](),controller[_0x7432('0xa')]);router['get'](_0x7432('0xb'),auth['isAuthenticated'](),controller[_0x7432('0xc')]);router[_0x7432('0x8')](_0x7432('0xd'),auth[_0x7432('0x9')](),controller[_0x7432('0xe')]);router[_0x7432('0xf')]('/',auth[_0x7432('0x9')](),interaction[_0x7432('0x10')]('chat','chatmessage:create'),controller[_0x7432('0x11')]);router[_0x7432('0x12')](_0x7432('0xd'),controller['update']);router[_0x7432('0x12')]('/:id/accept',auth['isAuthenticated'](),controller[_0x7432('0x13')]);router[_0x7432('0x12')](_0x7432('0x14'),auth[_0x7432('0x9')](),controller[_0x7432('0x15')]);router['delete']('/:id',auth[_0x7432('0x9')](),controller[_0x7432('0x16')]);module[_0x7432('0x17')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 8a55e9d..9f0e839 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['medium','TEXT','exports'];(function(_0x32ffb1,_0xa1cbe8){var _0x6dfa2d=function(_0x200caa){while(--_0x200caa){_0x32ffb1['push'](_0x32ffb1['shift']());}};_0x6dfa2d(++_0xa1cbe8);}(_0xadb5,0xad));var _0x5adb=function(_0x4afe35,_0x379c2a){_0x4afe35=_0x4afe35-0x0;var _0x3b0b5e=_0xadb5[_0x4afe35];return _0x3b0b5e;};'use strict';var Sequelize=require('sequelize');module[_0x5adb('0x0')]={'body':{'type':Sequelize['TEXT'](_0x5adb('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x5adb('0x2')](_0x5adb('0x1')),'allowNull':![]}}; \ No newline at end of file +var _0xdb28=['TEXT','medium','sequelize','exports'];(function(_0x132477,_0x42d24b){var _0x95b79f=function(_0x291f1c){while(--_0x291f1c){_0x132477['push'](_0x132477['shift']());}};_0x95b79f(++_0x42d24b);}(_0xdb28,0x106));var _0x8db2=function(_0xebf7da,_0x1fc65e){_0xebf7da=_0xebf7da-0x0;var _0x1df326=_0xdb28[_0xebf7da];return _0x1df326;};'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 92b42e0..e1a7996 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(_0x4c7fb5,_0x2548ef){var _0x2e10ac=function(_0xf7e27c){while(--_0xf7e27c){_0x4c7fb5['push'](_0x4c7fb5['shift']());}};_0x2e10ac(++_0x2548ef);}(_0x7a54,0x106));var _0x47a5=function(_0x258368,_0x1bad34){_0x258368=_0x258368-0x0;var _0x1e5f94=_0x7a54[_0x258368];return _0x1e5f94;};'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(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x7a54,0x106));var _0x47a5=function(_0xe98c5f,_0x26267f){_0xe98c5f=_0xe98c5f-0x0;var _0x9e8d98=_0x7a54[_0xe98c5f];return _0x9e8d98;};'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 a12bd1b..9abf282 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 _0xb19a=['events','../../mysqldb','ChatOfflineMessage','setMaxListeners','save','update','remove','emit','hook','exports'];(function(_0x32d8f6,_0x153146){var _0x4d6740=function(_0x5e41a6){while(--_0x5e41a6){_0x32d8f6['push'](_0x32d8f6['shift']());}};_0x4d6740(++_0x153146);}(_0xb19a,0x12c));var _0xab19=function(_0x2bfefd,_0x4b2c0f){_0x2bfefd=_0x2bfefd-0x0;var _0x11e4ef=_0xb19a[_0x2bfefd];return _0x11e4ef;};'use strict';var EventEmitter=require(_0xab19('0x0'));var ChatOfflineMessage=require(_0xab19('0x1'))['db'][_0xab19('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xab19('0x3')](0x0);var events={'afterCreate':_0xab19('0x4'),'afterUpdate':_0xab19('0x5'),'afterDestroy':_0xab19('0x6')};function emitEvent(_0x2e98f4){return function(_0x95bc5a,_0x30a40c,_0x5f5be6){ChatOfflineMessageEvents['emit'](_0x2e98f4+':'+_0x95bc5a['id'],_0x95bc5a);ChatOfflineMessageEvents[_0xab19('0x7')](_0x2e98f4,_0x95bc5a);_0x5f5be6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage[_0xab19('0x8')](e,emitEvent(event));}}module[_0xab19('0x9')]=ChatOfflineMessageEvents; \ No newline at end of file +var _0xfb50=['remove','hasOwnProperty','hook','exports','events','../../mysqldb','save','update'];(function(_0xa475c7,_0x3b1a88){var _0x4d53ed=function(_0x575e25){while(--_0x575e25){_0xa475c7['push'](_0xa475c7['shift']());}};_0x4d53ed(++_0x3b1a88);}(_0xfb50,0x1ec));var _0x0fb5=function(_0x38537f,_0x252124){_0x38537f=_0x38537f-0x0;var _0x141e23=_0xfb50[_0x38537f];return _0x141e23;};'use strict';var EventEmitter=require(_0x0fb5('0x0'));var ChatOfflineMessage=require(_0x0fb5('0x1'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0fb5('0x2'),'afterUpdate':_0x0fb5('0x3'),'afterDestroy':_0x0fb5('0x4')};function emitEvent(_0x4b1ff2){return function(_0x4f13a1,_0x729778,_0x2e10b6){ChatOfflineMessageEvents['emit'](_0x4b1ff2+':'+_0x4f13a1['id'],_0x4f13a1);ChatOfflineMessageEvents['emit'](_0x4b1ff2,_0x4f13a1);_0x2e10b6(null);};}for(var e in events){if(events[_0x0fb5('0x5')](e)){var event=events[e];ChatOfflineMessage[_0x0fb5('0x6')](e,emitEvent(event));}}module[_0x0fb5('0x7')]=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index fcee337..9cf4c81 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 _0x36a0=['utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage'];(function(_0x5ca59d,_0x15831e){var _0x2eb302=function(_0x512519){while(--_0x512519){_0x5ca59d['push'](_0x5ca59d['shift']());}};_0x2eb302(++_0x15831e);}(_0x36a0,0x79));var _0x036a=function(_0x342b98,_0x3768f5){_0x342b98=_0x342b98-0x0;var _0x424d19=_0x36a0[_0x342b98];return _0x424d19;};'use strict';var attributes=require(_0x036a('0x0'));module[_0x036a('0x1')]=function(_0x4fe8f6){return _0x4fe8f6[_0x036a('0x2')](_0x036a('0x3'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x036a('0x4')});}; \ No newline at end of file +var _0x35f2=['define','ChatOfflineMessage','chat_offline_messages','utf8mb4_unicode_ci','exports'];(function(_0x236c65,_0x23b8ee){var _0x5c2b0b=function(_0x556ed1){while(--_0x556ed1){_0x236c65['push'](_0x236c65['shift']());}};_0x5c2b0b(++_0x23b8ee);}(_0x35f2,0x68));var _0x235f=function(_0xd209e7,_0x1224b4){_0xd209e7=_0xd209e7-0x0;var _0x55a4f1=_0x35f2[_0xd209e7];return _0x55a4f1;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module[_0x235f('0x0')]=function(_0x42a76e){return _0x42a76e[_0x235f('0x1')](_0x235f('0x2'),attributes,{'tableName':_0x235f('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x235f('0x4')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 99ad7b0..a0dfc0f 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 _0xabbc=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ChatOfflineMessage,\x20%s,\x20%s','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xabbc,0x1bc));var _0xcabb=function(_0x65e3dc,_0x10fd05){_0x65e3dc=_0x65e3dc-0x0;var _0x5d475b=_0xabbc[_0x65e3dc];return _0x5d475b;};'use strict';var _=require(_0xcabb('0x0'));var util=require(_0xcabb('0x1'));var moment=require('moment');var BPromise=require(_0xcabb('0x2'));var rs=require(_0xcabb('0x3'));var fs=require('fs');var Redis=require(_0xcabb('0x4'));var db=require(_0xcabb('0x5'))['db'];var utils=require(_0xcabb('0x6'));var logger=require(_0xcabb('0x7'))(_0xcabb('0x8'));var config=require(_0xcabb('0x9'));var jayson=require(_0xcabb('0xa'));var client=jayson[_0xcabb('0xb')][_0xcabb('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xe861f7,_0x48a504,_0x59ecbc){return new BPromise(function(_0x5964c0,_0xfddad7){return client[_0xcabb('0xd')](_0xe861f7,_0x59ecbc)[_0xcabb('0xe')](function(_0xfac589){logger['info'](_0xcabb('0xf'),_0x48a504,'request\x20sent');logger[_0xcabb('0x10')](_0xcabb('0x11'),_0x48a504,_0xcabb('0x12'),JSON[_0xcabb('0x13')](_0xfac589));if(_0xfac589['error']){if(_0xfac589[_0xcabb('0x14')][_0xcabb('0x15')]===0x1f4){logger[_0xcabb('0x14')](_0xcabb('0xf'),_0x48a504,_0xfac589['error'][_0xcabb('0x16')]);return _0xfddad7(_0xfac589[_0xcabb('0x14')][_0xcabb('0x16')]);}logger[_0xcabb('0x14')](_0xcabb('0xf'),_0x48a504,_0xfac589[_0xcabb('0x14')]['message']);return _0x5964c0(_0xfac589[_0xcabb('0x14')][_0xcabb('0x16')]);}else{logger[_0xcabb('0x17')]('ChatOfflineMessage,\x20%s,\x20%s',_0x48a504,_0xcabb('0x12'));_0x5964c0(_0xfac589[_0xcabb('0x18')][_0xcabb('0x16')]);}})[_0xcabb('0x19')](function(_0x1b09f0){logger[_0xcabb('0x14')]('ChatOfflineMessage,\x20%s,\x20%s',_0x48a504,_0x1b09f0);_0xfddad7(_0x1b09f0);});});} \ No newline at end of file +var _0x7303=['../../config/utils','rpc','../../config/environment','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x41bf55,_0x5ce76d){var _0x3aa827=function(_0x37639f){while(--_0x37639f){_0x41bf55['push'](_0x41bf55['shift']());}};_0x3aa827(++_0x5ce76d);}(_0x7303,0xa3));var _0x3730=function(_0xb1dcb1,_0x1ca3fe){_0xb1dcb1=_0xb1dcb1-0x0;var _0x36cffb=_0x7303[_0xb1dcb1];return _0x36cffb;};'use strict';var _=require(_0x3730('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3730('0x1'));var rs=require(_0x3730('0x2'));var fs=require('fs');var Redis=require(_0x3730('0x3'));var db=require(_0x3730('0x4'))['db'];var utils=require(_0x3730('0x5'));var logger=require('../../config/logger')(_0x3730('0x6'));var config=require(_0x3730('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3730('0x8')][_0x3730('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x238a0b,_0x228202,_0xa9e149){return new BPromise(function(_0x493b0b,_0x2130d9){return client[_0x3730('0xa')](_0x238a0b,_0xa9e149)[_0x3730('0xb')](function(_0x120db6){logger[_0x3730('0xc')](_0x3730('0xd'),_0x228202,_0x3730('0xe'));logger['debug'](_0x3730('0xf'),_0x228202,'request\x20sent',JSON[_0x3730('0x10')](_0x120db6));if(_0x120db6['error']){if(_0x120db6[_0x3730('0x11')]['code']===0x1f4){logger[_0x3730('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x228202,_0x120db6[_0x3730('0x11')]['message']);return _0x2130d9(_0x120db6[_0x3730('0x11')][_0x3730('0x12')]);}logger[_0x3730('0x11')](_0x3730('0xd'),_0x228202,_0x120db6['error'][_0x3730('0x12')]);return _0x493b0b(_0x120db6[_0x3730('0x11')]['message']);}else{logger[_0x3730('0xc')](_0x3730('0xd'),_0x228202,_0x3730('0xe'));_0x493b0b(_0x120db6[_0x3730('0x13')]['message']);}})[_0x3730('0x14')](function(_0x2a758d){logger['error'](_0x3730('0xd'),_0x228202,_0x2a758d);_0x2130d9(_0x2a758d);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 70ec862..b552876 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 _0x7667=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','index','get','isAuthenticated','describe','show','create','delete','/:id','exports'];(function(_0x43d11d,_0xccff91){var _0x38cd08=function(_0x131ae2){while(--_0x131ae2){_0x43d11d['push'](_0x43d11d['shift']());}};_0x38cd08(++_0xccff91);}(_0x7667,0xd8));var _0x7766=function(_0x3e3aa3,_0x43b147){_0x3e3aa3=_0x3e3aa3-0x0;var _0x32bf2d=_0x7667[_0x3e3aa3];return _0x32bf2d;};'use strict';var multer=require(_0x7766('0x0'));var util=require(_0x7766('0x1'));var path=require(_0x7766('0x2'));var timeout=require(_0x7766('0x3'));var express=require(_0x7766('0x4'));var router=express[_0x7766('0x5')]();var fs_extra=require(_0x7766('0x6'));var auth=require(_0x7766('0x7'));var interaction=require(_0x7766('0x8'));var config=require('../../config/environment');var controller=require('./chatOfflineMessage.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x7766('0x9')]);router[_0x7766('0xa')]('/describe',auth[_0x7766('0xb')](),controller[_0x7766('0xc')]);router[_0x7766('0xa')]('/:id',auth[_0x7766('0xb')](),controller[_0x7766('0xd')]);router['post']('/',auth[_0x7766('0xb')](),controller[_0x7766('0xe')]);router['put']('/:id',auth[_0x7766('0xb')](),controller['update']);router[_0x7766('0xf')](_0x7766('0x10'),auth[_0x7766('0xb')](),controller['destroy']);module[_0x7766('0x11')]=router; \ No newline at end of file +var _0xffc6=['show','post','create','put','delete','/:id','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe'];(function(_0x12b00b,_0x1e11e1){var _0x1748da=function(_0x2a2f46){while(--_0x2a2f46){_0x12b00b['push'](_0x12b00b['shift']());}};_0x1748da(++_0x1e11e1);}(_0xffc6,0x15e));var _0x6ffc=function(_0x2cd9f6,_0x450d32){_0x2cd9f6=_0x2cd9f6-0x0;var _0x35182a=_0xffc6[_0x2cd9f6];return _0x35182a;};'use strict';var multer=require('multer');var util=require(_0x6ffc('0x0'));var path=require(_0x6ffc('0x1'));var timeout=require(_0x6ffc('0x2'));var express=require(_0x6ffc('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6ffc('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6ffc('0x5'));var controller=require('./chatOfflineMessage.controller');router[_0x6ffc('0x6')]('/',auth[_0x6ffc('0x7')](),controller[_0x6ffc('0x8')]);router[_0x6ffc('0x6')](_0x6ffc('0x9'),auth[_0x6ffc('0x7')](),controller[_0x6ffc('0xa')]);router[_0x6ffc('0x6')]('/:id',auth[_0x6ffc('0x7')](),controller[_0x6ffc('0xb')]);router[_0x6ffc('0xc')]('/',auth['isAuthenticated'](),controller[_0x6ffc('0xd')]);router[_0x6ffc('0xe')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x6ffc('0xf')](_0x6ffc('0x10'),auth[_0x6ffc('0x7')](),controller[_0x6ffc('0x11')]);module[_0x6ffc('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 6ccc7ad..df6c522 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 _0xa7a5=['mouseOver','STRING','exports'];(function(_0x24ae03,_0x334660){var _0x38a29e=function(_0x25e64b){while(--_0x25e64b){_0x24ae03['push'](_0x24ae03['shift']());}};_0x38a29e(++_0x334660);}(_0xa7a5,0x8c));var _0x5a7a=function(_0x4612a6,_0x2c9678){_0x4612a6=_0x4612a6-0x0;var _0x4940b8=_0xa7a5[_0x4612a6];return _0x4940b8;};'use strict';var Sequelize=require('sequelize');module[_0x5a7a('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM']('mouseOver','timeout'),'defaultValue':_0x5a7a('0x1')},'selector':{'type':Sequelize[_0x5a7a('0x2')]},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x8abd=['STRING','timeout','mouseOver','INTEGER','exports'];(function(_0x3a213b,_0x2539b1){var _0x48552c=function(_0x26db9d){while(--_0x26db9d){_0x3a213b['push'](_0x3a213b['shift']());}};_0x48552c(++_0x2539b1);}(_0x8abd,0x18a));var _0xd8ab=function(_0x211f55,_0x520aea){_0x211f55=_0x211f55-0x0;var _0x5d7628=_0x8abd[_0x211f55];return _0x5d7628;};'use strict';var Sequelize=require('sequelize');module[_0xd8ab('0x0')]={'name':{'type':Sequelize[_0xd8ab('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('mouseOver',_0xd8ab('0x2')),'defaultValue':_0xd8ab('0x3')},'selector':{'type':Sequelize[_0xd8ab('0x1')]},'timeout':{'type':Sequelize[_0xd8ab('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index cb8b815..c9f06e1 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 _0x9a6b=['find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','apply','reject','update','destroy','error','stack','name','send','params','model','ChatProactiveAction','rawAttributes','query','keys','filters','intersection','attributes','fields','length','includeAll','include','then','create','body','catch'];(function(_0x5d5ad9,_0x9fe65c){var _0x461f64=function(_0x97c064){while(--_0x97c064){_0x5d5ad9['push'](_0x5d5ad9['shift']());}};_0x461f64(++_0x9fe65c);}(_0x9a6b,0x77));var _0xb9a6=function(_0x1f1634,_0x2424e7){_0x1f1634=_0x1f1634-0x0;var _0x72b827=_0x9a6b[_0x1f1634];return _0x72b827;};'use strict';var emlformat=require(_0xb9a6('0x0'));var rimraf=require(_0xb9a6('0x1'));var zipdir=require(_0xb9a6('0x2'));var jsonpatch=require(_0xb9a6('0x3'));var rp=require(_0xb9a6('0x4'));var moment=require(_0xb9a6('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb9a6('0x6'));var util=require('util');var path=require(_0xb9a6('0x7'));var sox=require(_0xb9a6('0x8'));var csv=require(_0xb9a6('0x9'));var ejs=require(_0xb9a6('0xa'));var fs=require('fs');var fs_extra=require(_0xb9a6('0xb'));var _=require(_0xb9a6('0xc'));var squel=require(_0xb9a6('0xd'));var crypto=require(_0xb9a6('0xe'));var jsforce=require(_0xb9a6('0xf'));var deskjs=require(_0xb9a6('0x10'));var toCsv=require('to-csv');var querystring=require(_0xb9a6('0x11'));var Papa=require(_0xb9a6('0x12'));var Redis=require('ioredis');var authService=require(_0xb9a6('0x13'));var qs=require(_0xb9a6('0x14'));var as=require(_0xb9a6('0x15'));var hardwareService=require(_0xb9a6('0x16'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xb9a6('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xb9a6('0x18'))['db'];function respondWithStatusCode(_0x57b620,_0x3f4ce1){_0x3f4ce1=_0x3f4ce1||0xcc;return function(_0x21a637){if(_0x21a637){return _0x57b620[_0xb9a6('0x19')](_0x3f4ce1);}return _0x57b620[_0xb9a6('0x1a')](_0x3f4ce1)[_0xb9a6('0x1b')]();};}function respondWithResult(_0x6cbcc4,_0x3e140e){_0x3e140e=_0x3e140e||0xc8;return function(_0x158d6c){if(_0x158d6c){return _0x6cbcc4[_0xb9a6('0x1a')](_0x3e140e)['json'](_0x158d6c);}};}function respondWithFilteredResult(_0x463f33,_0x136d5d){return function(_0x414f37){if(_0x414f37){var _0x3342d2=typeof _0x136d5d['offset']===_0xb9a6('0x1c')&&typeof _0x136d5d[_0xb9a6('0x1d')]===_0xb9a6('0x1c');var _0x5b3395=_0x414f37[_0xb9a6('0x1e')];var _0x3b9a3b=_0x3342d2?0x0:_0x136d5d[_0xb9a6('0x1f')];var _0x1843e2=_0x3342d2?_0x414f37[_0xb9a6('0x1e')]:_0x136d5d['offset']+_0x136d5d[_0xb9a6('0x1d')];var _0x28e01a;if(_0x1843e2>=_0x5b3395){_0x1843e2=_0x5b3395;_0x28e01a=0xc8;}else{_0x28e01a=0xce;}_0x463f33[_0xb9a6('0x1a')](_0x28e01a);return _0x463f33[_0xb9a6('0x20')]('Content-Range',_0x3b9a3b+'-'+_0x1843e2+'/'+_0x5b3395)['json'](_0x414f37);}return null;};}function patchUpdates(_0x1cb89e){return function(_0x449b39){try{jsonpatch[_0xb9a6('0x21')](_0x449b39,_0x1cb89e,!![]);}catch(_0x49c74b){return BPromise[_0xb9a6('0x22')](_0x49c74b);}return _0x449b39['save']();};}function saveUpdates(_0xc15e48,_0x36c6c1){return function(_0x50d3d4){if(_0x50d3d4){return _0x50d3d4[_0xb9a6('0x23')](_0xc15e48)['then'](function(_0x526721){return _0x526721;});}return null;};}function removeEntity(_0x3bc642,_0x1b838a){return function(_0x73dee3){if(_0x73dee3){return _0x73dee3[_0xb9a6('0x24')]()['then'](function(){_0x3bc642[_0xb9a6('0x1a')](0xcc)[_0xb9a6('0x1b')]();});}};}function handleEntityNotFound(_0x373f62,_0x1d36e3){return function(_0x4b0be8){if(!_0x4b0be8){_0x373f62[_0xb9a6('0x19')](0x194);}return _0x4b0be8;};}function handleError(_0x3896c1,_0x3ebdcd){_0x3ebdcd=_0x3ebdcd||0x1f4;return function(_0x427890){logger[_0xb9a6('0x25')](_0x427890[_0xb9a6('0x26')]);if(_0x427890[_0xb9a6('0x27')]){delete _0x427890['name'];}_0x3896c1[_0xb9a6('0x1a')](_0x3ebdcd)[_0xb9a6('0x28')](_0x427890);};}exports['show']=function(_0x429830,_0x4c2abb){var _0x1fdb38={'raw':!![],'where':{'id':_0x429830[_0xb9a6('0x29')]['id']}},_0x5d75ce={};_0x5d75ce[_0xb9a6('0x2a')]=_['keys'](db[_0xb9a6('0x2b')][_0xb9a6('0x2c')]);_0x5d75ce[_0xb9a6('0x2d')]=_[_0xb9a6('0x2e')](_0x429830[_0xb9a6('0x2d')]);_0x5d75ce[_0xb9a6('0x2f')]=_[_0xb9a6('0x30')](_0x5d75ce['model'],_0x5d75ce[_0xb9a6('0x2d')]);_0x1fdb38[_0xb9a6('0x31')]=_[_0xb9a6('0x30')](_0x5d75ce[_0xb9a6('0x2a')],qs['fields'](_0x429830[_0xb9a6('0x2d')][_0xb9a6('0x32')]));_0x1fdb38['attributes']=_0x1fdb38[_0xb9a6('0x31')][_0xb9a6('0x33')]?_0x1fdb38[_0xb9a6('0x31')]:_0x5d75ce[_0xb9a6('0x2a')];if(_0x429830[_0xb9a6('0x2d')][_0xb9a6('0x34')]){_0x1fdb38[_0xb9a6('0x35')]=[{'all':!![]}];}_0x1fdb38=_['merge']({},_0x1fdb38,_0x429830['options']);return db['ChatProactiveAction']['find'](_0x1fdb38)['then'](handleEntityNotFound(_0x4c2abb,null))[_0xb9a6('0x36')](respondWithResult(_0x4c2abb,null))['catch'](handleError(_0x4c2abb,null));};exports[_0xb9a6('0x37')]=function(_0x56945d,_0x287329){return db[_0xb9a6('0x2b')][_0xb9a6('0x37')](_0x56945d[_0xb9a6('0x38')],{})[_0xb9a6('0x36')](respondWithResult(_0x287329,0xc9))[_0xb9a6('0x39')](handleError(_0x287329,null));};exports[_0xb9a6('0x23')]=function(_0xc96b8,_0x1e2835){if(_0xc96b8[_0xb9a6('0x38')]['id']){delete _0xc96b8[_0xb9a6('0x38')]['id'];}return db[_0xb9a6('0x2b')][_0xb9a6('0x3a')]({'where':{'id':_0xc96b8[_0xb9a6('0x29')]['id']}})[_0xb9a6('0x36')](handleEntityNotFound(_0x1e2835,null))[_0xb9a6('0x36')](saveUpdates(_0xc96b8[_0xb9a6('0x38')],null))['then'](respondWithResult(_0x1e2835,null))[_0xb9a6('0x39')](handleError(_0x1e2835,null));};exports[_0xb9a6('0x24')]=function(_0xdc704f,_0x5a8bf2){return db[_0xb9a6('0x2b')][_0xb9a6('0x3a')]({'where':{'id':_0xdc704f[_0xb9a6('0x29')]['id']}})[_0xb9a6('0x36')](handleEntityNotFound(_0x5a8bf2,null))[_0xb9a6('0x36')](removeEntity(_0x5a8bf2,null))[_0xb9a6('0x39')](handleError(_0x5a8bf2,null));}; \ No newline at end of file +var _0x8255=['Content-Range','reject','save','then','error','stack','name','send','params','model','ChatProactiveAction','keys','filters','query','attributes','intersection','fields','length','include','merge','options','find','catch','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set'];(function(_0x2730eb,_0x231d72){var _0x2678ca=function(_0x530e56){while(--_0x530e56){_0x2730eb['push'](_0x2730eb['shift']());}};_0x2678ca(++_0x231d72);}(_0x8255,0x176));var _0x5825=function(_0x3efe54,_0x27c823){_0x3efe54=_0x3efe54-0x0;var _0x2a4efc=_0x8255[_0x3efe54];return _0x2a4efc;};'use strict';var emlformat=require(_0x5825('0x0'));var rimraf=require(_0x5825('0x1'));var zipdir=require(_0x5825('0x2'));var jsonpatch=require(_0x5825('0x3'));var rp=require(_0x5825('0x4'));var moment=require(_0x5825('0x5'));var BPromise=require(_0x5825('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x5825('0x7'));var csv=require(_0x5825('0x8'));var ejs=require(_0x5825('0x9'));var fs=require('fs');var fs_extra=require(_0x5825('0xa'));var _=require(_0x5825('0xb'));var squel=require(_0x5825('0xc'));var crypto=require(_0x5825('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5825('0x8'));var querystring=require(_0x5825('0xe'));var Papa=require(_0x5825('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5825('0x10'));var as=require(_0x5825('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5825('0x12'))(_0x5825('0x13'));var utils=require('../../config/utils');var config=require(_0x5825('0x14'));var licenseUtil=require(_0x5825('0x15'));var db=require(_0x5825('0x16'))['db'];function respondWithStatusCode(_0x592725,_0x4d948e){_0x4d948e=_0x4d948e||0xcc;return function(_0x325034){if(_0x325034){return _0x592725[_0x5825('0x17')](_0x4d948e);}return _0x592725[_0x5825('0x18')](_0x4d948e)[_0x5825('0x19')]();};}function respondWithResult(_0x5bb480,_0x473eb0){_0x473eb0=_0x473eb0||0xc8;return function(_0x53687f){if(_0x53687f){return _0x5bb480[_0x5825('0x18')](_0x473eb0)[_0x5825('0x1a')](_0x53687f);}};}function respondWithFilteredResult(_0x35a8dd,_0x1e2751){return function(_0xb9fc6c){if(_0xb9fc6c){var _0x5ecffa=typeof _0x1e2751['offset']===_0x5825('0x1b')&&typeof _0x1e2751[_0x5825('0x1c')]===_0x5825('0x1b');var _0x1247b6=_0xb9fc6c['count'];var _0x4c59a1=_0x5ecffa?0x0:_0x1e2751[_0x5825('0x1d')];var _0x1fc690=_0x5ecffa?_0xb9fc6c[_0x5825('0x1e')]:_0x1e2751[_0x5825('0x1d')]+_0x1e2751['limit'];var _0x36bf06;if(_0x1fc690>=_0x1247b6){_0x1fc690=_0x1247b6;_0x36bf06=0xc8;}else{_0x36bf06=0xce;}_0x35a8dd[_0x5825('0x18')](_0x36bf06);return _0x35a8dd[_0x5825('0x1f')](_0x5825('0x20'),_0x4c59a1+'-'+_0x1fc690+'/'+_0x1247b6)[_0x5825('0x1a')](_0xb9fc6c);}return null;};}function patchUpdates(_0x12517c){return function(_0x54ca58){try{jsonpatch['apply'](_0x54ca58,_0x12517c,!![]);}catch(_0x43a216){return BPromise[_0x5825('0x21')](_0x43a216);}return _0x54ca58[_0x5825('0x22')]();};}function saveUpdates(_0x47913e,_0x141c77){return function(_0x310546){if(_0x310546){return _0x310546['update'](_0x47913e)[_0x5825('0x23')](function(_0x2787d5){return _0x2787d5;});}return null;};}function removeEntity(_0x271695,_0x4d0abb){return function(_0x5e0f40){if(_0x5e0f40){return _0x5e0f40['destroy']()['then'](function(){_0x271695[_0x5825('0x18')](0xcc)[_0x5825('0x19')]();});}};}function handleEntityNotFound(_0x6b07dd,_0x23b3ef){return function(_0x3502ce){if(!_0x3502ce){_0x6b07dd[_0x5825('0x17')](0x194);}return _0x3502ce;};}function handleError(_0x5e1f78,_0x1f27fd){_0x1f27fd=_0x1f27fd||0x1f4;return function(_0x3c8dec){logger[_0x5825('0x24')](_0x3c8dec[_0x5825('0x25')]);if(_0x3c8dec[_0x5825('0x26')]){delete _0x3c8dec[_0x5825('0x26')];}_0x5e1f78[_0x5825('0x18')](_0x1f27fd)[_0x5825('0x27')](_0x3c8dec);};}exports['show']=function(_0x589411,_0x3725dc){var _0x45e941={'raw':!![],'where':{'id':_0x589411[_0x5825('0x28')]['id']}},_0x582f12={};_0x582f12[_0x5825('0x29')]=_['keys'](db[_0x5825('0x2a')]['rawAttributes']);_0x582f12['query']=_[_0x5825('0x2b')](_0x589411['query']);_0x582f12[_0x5825('0x2c')]=_['intersection'](_0x582f12['model'],_0x582f12[_0x5825('0x2d')]);_0x45e941[_0x5825('0x2e')]=_[_0x5825('0x2f')](_0x582f12[_0x5825('0x29')],qs[_0x5825('0x30')](_0x589411[_0x5825('0x2d')][_0x5825('0x30')]));_0x45e941[_0x5825('0x2e')]=_0x45e941[_0x5825('0x2e')][_0x5825('0x31')]?_0x45e941[_0x5825('0x2e')]:_0x582f12['model'];if(_0x589411[_0x5825('0x2d')]['includeAll']){_0x45e941[_0x5825('0x32')]=[{'all':!![]}];}_0x45e941=_[_0x5825('0x33')]({},_0x45e941,_0x589411[_0x5825('0x34')]);return db[_0x5825('0x2a')][_0x5825('0x35')](_0x45e941)[_0x5825('0x23')](handleEntityNotFound(_0x3725dc,null))[_0x5825('0x23')](respondWithResult(_0x3725dc,null))[_0x5825('0x36')](handleError(_0x3725dc,null));};exports[_0x5825('0x37')]=function(_0xe8d01b,_0x1fa9a3){return db[_0x5825('0x2a')][_0x5825('0x37')](_0xe8d01b[_0x5825('0x38')],{})[_0x5825('0x23')](respondWithResult(_0x1fa9a3,0xc9))[_0x5825('0x36')](handleError(_0x1fa9a3,null));};exports[_0x5825('0x39')]=function(_0x53a43c,_0x4f4ab9){if(_0x53a43c['body']['id']){delete _0x53a43c[_0x5825('0x38')]['id'];}return db[_0x5825('0x2a')][_0x5825('0x35')]({'where':{'id':_0x53a43c[_0x5825('0x28')]['id']}})[_0x5825('0x23')](handleEntityNotFound(_0x4f4ab9,null))['then'](saveUpdates(_0x53a43c[_0x5825('0x38')],null))[_0x5825('0x23')](respondWithResult(_0x4f4ab9,null))[_0x5825('0x36')](handleError(_0x4f4ab9,null));};exports['destroy']=function(_0x1465c0,_0x56e758){return db[_0x5825('0x2a')][_0x5825('0x35')]({'where':{'id':_0x1465c0[_0x5825('0x28')]['id']}})[_0x5825('0x23')](handleEntityNotFound(_0x56e758,null))[_0x5825('0x23')](removeEntity(_0x56e758,null))[_0x5825('0x36')](handleError(_0x56e758,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index c4d313d..b6f472a 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 _0x206c=['api','bluebird','request-promise','path','rimraf','exports','ChatProactiveAction','lodash','util','../../config/logger'];(function(_0x4965ff,_0xd24226){var _0x763d61=function(_0x2b14e1){while(--_0x2b14e1){_0x4965ff['push'](_0x4965ff['shift']());}};_0x763d61(++_0xd24226);}(_0x206c,0x129));var _0xc206=function(_0x7ca77d,_0x3ad1ed){_0x7ca77d=_0x7ca77d-0x0;var _0x40e85b=_0x206c[_0x7ca77d];return _0x40e85b;};'use strict';var _=require(_0xc206('0x0'));var util=require(_0xc206('0x1'));var logger=require(_0xc206('0x2'))(_0xc206('0x3'));var moment=require('moment');var BPromise=require(_0xc206('0x4'));var rp=require(_0xc206('0x5'));var fs=require('fs');var path=require(_0xc206('0x6'));var rimraf=require(_0xc206('0x7'));var config=require('../../config/environment');var attributes=require('./chatProactiveAction.attributes');module[_0xc206('0x8')]=function(_0x2bdb1f,_0x591e71){return _0x2bdb1f['define'](_0xc206('0x9'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x968f=['request-promise','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','chat_proactive_actions','lodash','util','bluebird'];(function(_0x407064,_0x2be626){var _0x3323d1=function(_0x20ae00){while(--_0x20ae00){_0x407064['push'](_0x407064['shift']());}};_0x3323d1(++_0x2be626);}(_0x968f,0x89));var _0xf968=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x968f[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xf968('0x0'));var util=require(_0xf968('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xf968('0x2'));var rp=require(_0xf968('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf968('0x4'));var config=require(_0xf968('0x5'));var attributes=require(_0xf968('0x6'));module[_0xf968('0x7')]=function(_0x5cad3a,_0x6b446d){return _0x5cad3a[_0xf968('0x8')]('ChatProactiveAction',attributes,{'tableName':_0xf968('0x9'),'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 d866b95..c63b6fa 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 _0xc28c=['client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment'];(function(_0x374228,_0x5e071f){var _0x5b8764=function(_0x45398f){while(--_0x45398f){_0x374228['push'](_0x374228['shift']());}};_0x5b8764(++_0x5e071f);}(_0xc28c,0x133));var _0xcc28=function(_0x2aecb2,_0x343312){_0x2aecb2=_0x2aecb2-0x0;var _0x3ebb80=_0xc28c[_0x2aecb2];return _0x3ebb80;};'use strict';var _=require(_0xcc28('0x0'));var util=require(_0xcc28('0x1'));var moment=require(_0xcc28('0x2'));var BPromise=require('bluebird');var rs=require(_0xcc28('0x3'));var fs=require('fs');var Redis=require(_0xcc28('0x4'));var db=require(_0xcc28('0x5'))['db'];var utils=require(_0xcc28('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xcc28('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xcc28('0x8')][_0xcc28('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x12785a,_0x15e8e3,_0x3088f2){return new BPromise(function(_0x36ac46,_0x5e0f6d){return client[_0xcc28('0xa')](_0x12785a,_0x3088f2)[_0xcc28('0xb')](function(_0x21e31c){logger[_0xcc28('0xc')](_0xcc28('0xd'),_0x15e8e3,_0xcc28('0xe'));logger[_0xcc28('0xf')](_0xcc28('0x10'),_0x15e8e3,_0xcc28('0xe'),JSON[_0xcc28('0x11')](_0x21e31c));if(_0x21e31c['error']){if(_0x21e31c[_0xcc28('0x12')]['code']===0x1f4){logger['error'](_0xcc28('0xd'),_0x15e8e3,_0x21e31c[_0xcc28('0x12')][_0xcc28('0x13')]);return _0x5e0f6d(_0x21e31c['error'][_0xcc28('0x13')]);}logger['error'](_0xcc28('0xd'),_0x15e8e3,_0x21e31c[_0xcc28('0x12')]['message']);return _0x36ac46(_0x21e31c[_0xcc28('0x12')][_0xcc28('0x13')]);}else{logger[_0xcc28('0xc')](_0xcc28('0xd'),_0x15e8e3,_0xcc28('0xe'));_0x36ac46(_0x21e31c[_0xcc28('0x14')]['message']);}})['catch'](function(_0x5d31e6){logger[_0xcc28('0x12')](_0xcc28('0xd'),_0x15e8e3,_0x5d31e6);_0x5e0f6d(_0x5d31e6);});});} \ No newline at end of file +var _0x2a7b=['message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x4f06be,_0x321c80){var _0x1c0a92=function(_0x33a1e5){while(--_0x33a1e5){_0x4f06be['push'](_0x4f06be['shift']());}};_0x1c0a92(++_0x321c80);}(_0x2a7b,0x8d));var _0xb2a7=function(_0x492071,_0x24e16e){_0x492071=_0x492071-0x0;var _0x26ae90=_0x2a7b[_0x492071];return _0x26ae90;};'use strict';var _=require(_0xb2a7('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb2a7('0x1'));var rs=require(_0xb2a7('0x2'));var fs=require('fs');var Redis=require(_0xb2a7('0x3'));var db=require(_0xb2a7('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb2a7('0x5'))(_0xb2a7('0x6'));var config=require(_0xb2a7('0x7'));var jayson=require(_0xb2a7('0x8'));var client=jayson[_0xb2a7('0x9')][_0xb2a7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xd9bc20,_0x44c0d1,_0x1e20d1){return new BPromise(function(_0x36aeef,_0x5119cb){return client[_0xb2a7('0xb')](_0xd9bc20,_0x1e20d1)[_0xb2a7('0xc')](function(_0x9d5e64){logger[_0xb2a7('0xd')](_0xb2a7('0xe'),_0x44c0d1,'request\x20sent');logger[_0xb2a7('0xf')](_0xb2a7('0x10'),_0x44c0d1,_0xb2a7('0x11'),JSON[_0xb2a7('0x12')](_0x9d5e64));if(_0x9d5e64[_0xb2a7('0x13')]){if(_0x9d5e64[_0xb2a7('0x13')]['code']===0x1f4){logger[_0xb2a7('0x13')](_0xb2a7('0xe'),_0x44c0d1,_0x9d5e64[_0xb2a7('0x13')]['message']);return _0x5119cb(_0x9d5e64[_0xb2a7('0x13')][_0xb2a7('0x14')]);}logger[_0xb2a7('0x13')]('ChatProactiveAction,\x20%s,\x20%s',_0x44c0d1,_0x9d5e64[_0xb2a7('0x13')][_0xb2a7('0x14')]);return _0x36aeef(_0x9d5e64[_0xb2a7('0x13')][_0xb2a7('0x14')]);}else{logger[_0xb2a7('0xd')]('ChatProactiveAction,\x20%s,\x20%s',_0x44c0d1,_0xb2a7('0x11'));_0x36aeef(_0x9d5e64[_0xb2a7('0x15')]['message']);}})[_0xb2a7('0x16')](function(_0x4bb5f4){logger[_0xb2a7('0x13')](_0xb2a7('0xe'),_0x44c0d1,_0x4bb5f4);_0x5119cb(_0x4bb5f4);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 2334d60..d48e5cb 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 _0x5fc3=['create','put','/:id','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatProactiveAction.controller','get','show','isAuthenticated'];(function(_0x5153dc,_0x479007){var _0xd13e22=function(_0x58d998){while(--_0x58d998){_0x5153dc['push'](_0x5153dc['shift']());}};_0xd13e22(++_0x479007);}(_0x5fc3,0xa8));var _0x35fc=function(_0x469a3c,_0x5ebc10){_0x469a3c=_0x469a3c-0x0;var _0x968f4=_0x5fc3[_0x469a3c];return _0x968f4;};'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')]('/:id',auth['isAuthenticated'](),controller[_0x35fc('0xa')]);router['post']('/',auth[_0x35fc('0xb')](),controller[_0x35fc('0xc')]);router[_0x35fc('0xd')](_0x35fc('0xe'),auth[_0x35fc('0xb')](),controller[_0x35fc('0xf')]);router[_0x35fc('0x10')]('/:id',auth[_0x35fc('0xb')](),controller[_0x35fc('0x11')]);module['exports']=router; \ No newline at end of file +var _0x2675=['../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','create','put','delete','exports','multer','express','Router'];(function(_0x20d6f0,_0x5bf6b8){var _0x4cdb25=function(_0x2f7773){while(--_0x2f7773){_0x20d6f0['push'](_0x20d6f0['shift']());}};_0x4cdb25(++_0x5bf6b8);}(_0x2675,0x75));var _0x5267=function(_0x4ef8c2,_0x19a834){_0x4ef8c2=_0x4ef8c2-0x0;var _0x38dce9=_0x2675[_0x4ef8c2];return _0x38dce9;};'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')](_0x5267('0x7'),auth[_0x5267('0x8')](),controller[_0x5267('0x9')]);router[_0x5267('0xa')]('/',auth['isAuthenticated'](),controller[_0x5267('0xb')]);router[_0x5267('0xc')]('/:id',auth[_0x5267('0x8')](),controller['update']);router[_0x5267('0xd')](_0x5267('0x7'),auth[_0x5267('0x8')](),controller['destroy']);module[_0x5267('0xe')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index be5f6c6..1751152 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 _0x2aeb=['sequelize','exports','STRING','name','rrmemory','roundrobin'];(function(_0x24bb57,_0x4b43f4){var _0x329956=function(_0x1c1fb3){while(--_0x1c1fb3){_0x24bb57['push'](_0x24bb57['shift']());}};_0x329956(++_0x4b43f4);}(_0x2aeb,0x1f2));var _0xb2ae=function(_0x4a257a,_0x4f2b42){_0x4a257a=_0x4a257a-0x0;var _0x34cd09=_0x2aeb[_0x4a257a];return _0x34cd09;};'use strict';var Sequelize=require(_0xb2ae('0x0'));module[_0xb2ae('0x1')]={'name':{'type':Sequelize[_0xb2ae('0x2')],'unique':_0xb2ae('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xb2ae('0x4'),'beepall',_0xb2ae('0x5'))}}; \ No newline at end of file +var _0x2b56=['name','STRING','INTEGER','ENUM','rrmemory','beepall','sequelize'];(function(_0x490ff6,_0x5e5554){var _0x2ccce5=function(_0x36743d){while(--_0x36743d){_0x490ff6['push'](_0x490ff6['shift']());}};_0x2ccce5(++_0x5e5554);}(_0x2b56,0xa0));var _0x62b5=function(_0x542291,_0x3733d4){_0x542291=_0x542291-0x0;var _0x3a021c=_0x2b56[_0x542291];return _0x3a021c;};'use strict';var Sequelize=require(_0x62b5('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x62b5('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x62b5('0x2')]},'timeout':{'type':Sequelize[_0x62b5('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x62b5('0x4')](_0x62b5('0x5'),_0x62b5('0x6'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 6cfa8ac..c458e5d 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 _0xa029=['omit','spread','getAgents','bluebird','util','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','offset','undefined','limit','count','Content-Range','update','then','destroy','get','ChatQueues','UserProfileResource','error','stack','name','index','map','ChatQueue','fieldName','key','getOptions','where','include','query','findAll','catch','show','params','model','keys','rawAttributes','filters','intersection','attributes','fields','includeAll','merge','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','body','describe','getMembers','findOne','UserChatQueue','length','hasOwnProperty','sort','pick','ChatQueueId','filter','User','findAndCountAll','agent','updatedAt','createdAt','rows','format','%s/%s','chatPause','getTeams','Team','order','nolimit','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','field','tq.TeamId','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','union','compact','value','transaction','isEmpty','removeAgents','userChatQueue:remove','addAgents'];(function(_0x2a7812,_0x1ce83a){var _0x3e1342=function(_0x3ff9fb){while(--_0x3ff9fb){_0x2a7812['push'](_0x2a7812['shift']());}};_0x3e1342(++_0x1ce83a);}(_0xa029,0x7c));var _0x9a02=function(_0x48d36c,_0x501a68){_0x48d36c=_0x48d36c-0x0;var _0x320a53=_0xa029[_0x48d36c];return _0x320a53;};'use strict';var BPromise=require(_0x9a02('0x0'));var util=require(_0x9a02('0x1'));var _=require(_0x9a02('0x2'));var squel=require('squel');var Redis=require(_0x9a02('0x3'));var qs=require(_0x9a02('0x4'));var logger=require(_0x9a02('0x5'))(_0x9a02('0x6'));var config=require(_0x9a02('0x7'));var db=require(_0x9a02('0x8'))['db'];config[_0x9a02('0x9')]=_[_0x9a02('0xa')](config[_0x9a02('0x9')],{'host':_0x9a02('0xb'),'port':0x18eb});var socket=require(_0x9a02('0xc'))(new Redis(config[_0x9a02('0x9')]));require('./chatQueue.socket')['register'](socket);function respondWithStatusCode(_0x2d9dbf,_0x494a23){_0x494a23=_0x494a23||0xcc;return function(_0x966e1b){if(_0x966e1b){return _0x2d9dbf[_0x9a02('0xd')](_0x494a23);}return _0x2d9dbf[_0x9a02('0xe')](_0x494a23)[_0x9a02('0xf')]();};}function respondWithResult(_0x51512a,_0x29b245){_0x29b245=_0x29b245||0xc8;return function(_0x4ed3ef){if(_0x4ed3ef){return _0x51512a['status'](_0x29b245)['json'](_0x4ed3ef);}};}function respondWithFilteredResult(_0xa487c3,_0x186c42){return function(_0x176d36){if(_0x176d36){var _0x7b37d3=typeof _0x186c42[_0x9a02('0x10')]===_0x9a02('0x11')&&typeof _0x186c42[_0x9a02('0x12')]===_0x9a02('0x11');var _0x24ee7e=_0x176d36[_0x9a02('0x13')];var _0x1565b2=_0x7b37d3?0x0:_0x186c42[_0x9a02('0x10')];var _0x44d3aa=_0x7b37d3?_0x176d36[_0x9a02('0x13')]:_0x186c42[_0x9a02('0x10')]+_0x186c42[_0x9a02('0x12')];var _0x789bee;if(_0x44d3aa>=_0x24ee7e){_0x44d3aa=_0x24ee7e;_0x789bee=0xc8;}else{_0x789bee=0xce;}_0xa487c3[_0x9a02('0xe')](_0x789bee);return _0xa487c3['set'](_0x9a02('0x14'),_0x1565b2+'-'+_0x44d3aa+'/'+_0x24ee7e)['json'](_0x176d36);}return null;};}function saveUpdates(_0x40c93f){return function(_0x410759){if(_0x410759){return _0x410759[_0x9a02('0x15')](_0x40c93f)[_0x9a02('0x16')](function(_0x268c6d){return _0x268c6d;});}return null;};}function removeEntity(_0x570889){return function(_0x29cded){if(_0x29cded){return _0x29cded[_0x9a02('0x17')]()['then'](function(){var _0x29b8a6=_0x29cded[_0x9a02('0x18')]({'plain':!![]});var _0x23dd35=_0x9a02('0x19');return db[_0x9a02('0x1a')][_0x9a02('0x17')]({'where':{'type':_0x23dd35,'resourceId':_0x29b8a6['id']}})['then'](function(){return _0x29cded;});})[_0x9a02('0x16')](function(){_0x570889['status'](0xcc)[_0x9a02('0xf')]();});}};}function handleEntityNotFound(_0x58a800){return function(_0x5de3b1){if(!_0x5de3b1){_0x58a800[_0x9a02('0xd')](0x194);}return _0x5de3b1;};}function handleError(_0x1a2e8f,_0x17a4cf){_0x17a4cf=_0x17a4cf||0x1f4;return function(_0x10695c){logger[_0x9a02('0x1b')](_0x10695c[_0x9a02('0x1c')]);if(_0x10695c[_0x9a02('0x1d')]){delete _0x10695c['name'];}_0x1a2e8f[_0x9a02('0xe')](_0x17a4cf)['send'](_0x10695c);};}exports[_0x9a02('0x1e')]=function(_0x5c1e43,_0x342a8a){var _0x4a6e0e={};var _0x515c13={'count':0x0,'rows':[]};var _0xdb142a=_[_0x9a02('0x1f')](db[_0x9a02('0x20')]['rawAttributes'],function(_0x58ca93){return{'name':_0x58ca93[_0x9a02('0x21')],'type':_0x58ca93['type'][_0x9a02('0x22')]};});_0x4a6e0e=qs[_0x9a02('0x23')](_0xdb142a,_0x5c1e43);var _0xa192b9={'where':_0x4a6e0e[_0x9a02('0x24')]};return db[_0x9a02('0x20')][_0x9a02('0x13')](_0xa192b9)[_0x9a02('0x16')](function(_0x12211a){_0x515c13[_0x9a02('0x13')]=_0x12211a;_0x4a6e0e[_0x9a02('0x25')]=qs[_0x9a02('0x25')](_0x5c1e43[_0x9a02('0x26')]);return db['ChatQueue'][_0x9a02('0x27')](_0x4a6e0e);})[_0x9a02('0x16')](function(_0x593531){_0x515c13['rows']=_0x593531;return _0x515c13;})['then'](respondWithFilteredResult(_0x342a8a,_0x4a6e0e))[_0x9a02('0x28')](handleError(_0x342a8a,null));};exports[_0x9a02('0x29')]=function(_0x55892b,_0x451c9c){var _0x5d42a5={'raw':!![],'where':{'id':_0x55892b[_0x9a02('0x2a')]['id']}},_0xea0e42={};_0xea0e42[_0x9a02('0x2b')]=_[_0x9a02('0x2c')](db[_0x9a02('0x20')][_0x9a02('0x2d')]);_0xea0e42[_0x9a02('0x26')]=_[_0x9a02('0x2c')](_0x55892b[_0x9a02('0x26')]);_0xea0e42[_0x9a02('0x2e')]=_[_0x9a02('0x2f')](_0xea0e42['model'],_0xea0e42[_0x9a02('0x26')]);_0x5d42a5[_0x9a02('0x30')]=_[_0x9a02('0x2f')](_0xea0e42[_0x9a02('0x2b')],qs[_0x9a02('0x31')](_0x55892b[_0x9a02('0x26')][_0x9a02('0x31')]));_0x5d42a5[_0x9a02('0x30')]=_0x5d42a5[_0x9a02('0x30')]['length']?_0x5d42a5[_0x9a02('0x30')]:_0xea0e42['model'];if(_0x55892b['query'][_0x9a02('0x32')]){_0x5d42a5['include']=[{'all':!![]}];}_0x5d42a5=_[_0x9a02('0x33')]({},_0x5d42a5,_0x55892b[_0x9a02('0x34')]);return db['ChatQueue'][_0x9a02('0x35')](_0x5d42a5)['then'](handleEntityNotFound(_0x451c9c,null))['then'](respondWithResult(_0x451c9c,null))[_0x9a02('0x28')](handleError(_0x451c9c,null));};exports[_0x9a02('0x36')]=function(_0x1cb5fe,_0x420711){return db[_0x9a02('0x20')][_0x9a02('0x36')](_0x1cb5fe['body'],{})[_0x9a02('0x16')](function(_0x224e12){var _0x55e418=_0x1cb5fe['user'][_0x9a02('0x18')]({'plain':!![]});if(!_0x55e418)throw new Error(_0x9a02('0x37'));if(_0x55e418[_0x9a02('0x38')]===_0x9a02('0x39')){var _0x489c31=_0x224e12[_0x9a02('0x18')]({'plain':!![]});var _0x5a63b5=_0x9a02('0x19');return db[_0x9a02('0x3a')][_0x9a02('0x35')]({'where':{'name':_0x5a63b5,'userProfileId':_0x55e418[_0x9a02('0x3b')]},'raw':!![]})[_0x9a02('0x16')](function(_0x251602){if(_0x251602&&_0x251602['autoAssociation']===0x0){return db[_0x9a02('0x1a')]['create']({'name':_0x489c31['name'],'resourceId':_0x489c31['id'],'type':_0x251602[_0x9a02('0x1d')],'sectionId':_0x251602['id']},{})[_0x9a02('0x16')](function(){return _0x224e12;});}else{return _0x224e12;}})[_0x9a02('0x28')](function(_0x345ca6){logger[_0x9a02('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x345ca6);throw _0x345ca6;});}return _0x224e12;})[_0x9a02('0x16')](respondWithResult(_0x420711,0xc9))[_0x9a02('0x28')](handleError(_0x420711,null));};exports[_0x9a02('0x15')]=function(_0xd2c058,_0x24fe41){if(_0xd2c058['body']['id']){delete _0xd2c058[_0x9a02('0x3c')]['id'];}return db[_0x9a02('0x20')][_0x9a02('0x35')]({'where':{'id':_0xd2c058[_0x9a02('0x2a')]['id']}})['then'](handleEntityNotFound(_0x24fe41,null))[_0x9a02('0x16')](saveUpdates(_0xd2c058[_0x9a02('0x3c')],null))['then'](respondWithResult(_0x24fe41,null))['catch'](handleError(_0x24fe41,null));};exports[_0x9a02('0x17')]=function(_0x4ecf7a,_0x3652ee){return db[_0x9a02('0x20')][_0x9a02('0x35')]({'where':{'id':_0x4ecf7a[_0x9a02('0x2a')]['id']}})[_0x9a02('0x16')](handleEntityNotFound(_0x3652ee,null))[_0x9a02('0x16')](removeEntity(_0x3652ee,null))[_0x9a02('0x28')](handleError(_0x3652ee,null));};exports[_0x9a02('0x3d')]=function(_0x1ca6a7,_0x275d32){return db[_0x9a02('0x20')][_0x9a02('0x3d')]()[_0x9a02('0x16')](respondWithResult(_0x275d32,null))[_0x9a02('0x28')](handleError(_0x275d32,null));};exports[_0x9a02('0x3e')]=function(_0x516ecf,_0x1e8553){var _0x18cf86={'raw':!![],'where':{}},_0x275623={},_0x4a7039;return db[_0x9a02('0x20')][_0x9a02('0x3f')]({'where':{'id':_0x516ecf[_0x9a02('0x2a')]['id']}})['then'](handleEntityNotFound(_0x1e8553,null))[_0x9a02('0x16')](function(_0x378be6){if(_0x378be6){_0x4a7039=_0x378be6[_0x9a02('0x18')]({'plain':!![]});_0x275623[_0x9a02('0x2b')]=_['keys'](db[_0x9a02('0x40')][_0x9a02('0x2d')]);_0x275623[_0x9a02('0x26')]=_['keys'](_0x516ecf[_0x9a02('0x26')]);_0x275623[_0x9a02('0x2e')]=_[_0x9a02('0x2f')](_0x275623[_0x9a02('0x2b')],_0x275623['query']);_0x18cf86['attributes']=_[_0x9a02('0x2f')](_0x275623[_0x9a02('0x2b')],qs[_0x9a02('0x31')](_0x516ecf[_0x9a02('0x26')][_0x9a02('0x31')]));_0x18cf86[_0x9a02('0x30')]=_0x18cf86[_0x9a02('0x30')][_0x9a02('0x41')]?_0x18cf86[_0x9a02('0x30')]:_0x275623[_0x9a02('0x2b')];if(!_0x516ecf[_0x9a02('0x26')][_0x9a02('0x42')]('nolimit')){_0x18cf86[_0x9a02('0x12')]=qs['limit'](_0x516ecf[_0x9a02('0x26')][_0x9a02('0x12')]);_0x18cf86[_0x9a02('0x10')]=qs['offset'](_0x516ecf[_0x9a02('0x26')][_0x9a02('0x10')]);}_0x18cf86['order']=qs[_0x9a02('0x43')](_0x516ecf['query'][_0x9a02('0x43')]);_0x18cf86[_0x9a02('0x24')]=qs['filters'](_[_0x9a02('0x44')](_0x516ecf['query'],_0x275623[_0x9a02('0x2e')]));_0x18cf86['where'][_0x9a02('0x45')]=_0x378be6['id'];if(_0x516ecf[_0x9a02('0x26')][_0x9a02('0x46')]){_0x18cf86['where']=_[_0x9a02('0x33')](_0x18cf86[_0x9a02('0x24')],{'$or':_[_0x9a02('0x1f')](_0x18cf86[_0x9a02('0x30')],function(_0x1dad1c){var _0x136ea3={};_0x136ea3[_0x1dad1c]={'$like':'%'+_0x516ecf[_0x9a02('0x26')][_0x9a02('0x46')]+'%'};return _0x136ea3;})});}_0x18cf86=_['merge']({},_0x18cf86,_0x516ecf[_0x9a02('0x34')]);return db[_0x9a02('0x40')][_0x9a02('0x27')](_0x18cf86);}})[_0x9a02('0x16')](function(_0x4a93c7){if(_0x4a93c7){return db[_0x9a02('0x47')][_0x9a02('0x48')]({'where':{'id':_[_0x9a02('0x1f')](_0x4a93c7,'UserId'),'role':_0x9a02('0x49')},'attributes':['id',_0x9a02('0x1d'),'chatPause',_0x9a02('0x4a'),_0x9a02('0x4b')]});}})[_0x9a02('0x16')](function(_0x4b3a4b){if(_0x4b3a4b){return{'count':_0x4b3a4b[_0x9a02('0x13')],'rows':_[_0x9a02('0x1f')](_0x4b3a4b[_0x9a02('0x4c')],function(_0x34b6b0){return{'membername':_0x34b6b0[_0x9a02('0x1d')],'UserId':_0x34b6b0['id'],'queue_name':_0x4a7039['name'],'ChatQueueId':_0x4a7039['id'],'interface':util[_0x9a02('0x4d')](_0x9a02('0x4e'),'SIP',_0x34b6b0[_0x9a02('0x1d')]),'penalty':0x0,'paused':_0x34b6b0[_0x9a02('0x4f')],'createdAt':_0x34b6b0[_0x9a02('0x4b')],'updatedAt':_0x34b6b0['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x1e8553,_0x18cf86))[_0x9a02('0x28')](handleError(_0x1e8553,null));};exports[_0x9a02('0x50')]=function(_0x5c981d,_0x1d4c48){var _0x2d25ea={};var _0x354391={};var _0x3b2264;var _0x37428c;return db[_0x9a02('0x20')][_0x9a02('0x3f')]({'where':{'id':_0x5c981d[_0x9a02('0x2a')]['id']}})[_0x9a02('0x16')](handleEntityNotFound(_0x1d4c48,null))[_0x9a02('0x16')](function(_0x44406f){if(_0x44406f){_0x3b2264=_0x44406f;_0x354391[_0x9a02('0x2b')]=_[_0x9a02('0x2c')](db[_0x9a02('0x51')][_0x9a02('0x2d')]);_0x354391[_0x9a02('0x26')]=_['keys'](_0x5c981d['query']);_0x354391[_0x9a02('0x2e')]=_['intersection'](_0x354391[_0x9a02('0x2b')],_0x354391['query']);_0x2d25ea[_0x9a02('0x30')]=_['intersection'](_0x354391[_0x9a02('0x2b')],qs[_0x9a02('0x31')](_0x5c981d[_0x9a02('0x26')][_0x9a02('0x31')]));_0x2d25ea[_0x9a02('0x30')]=_0x2d25ea[_0x9a02('0x30')][_0x9a02('0x41')]?_0x2d25ea[_0x9a02('0x30')]:_0x354391['model'];_0x2d25ea[_0x9a02('0x52')]=qs[_0x9a02('0x43')](_0x5c981d['query'][_0x9a02('0x43')]);_0x2d25ea['where']=qs[_0x9a02('0x2e')](_[_0x9a02('0x44')](_0x5c981d[_0x9a02('0x26')],_0x354391[_0x9a02('0x2e')]));if(_0x5c981d[_0x9a02('0x26')]['filter']){_0x2d25ea['where']=_[_0x9a02('0x33')](_0x2d25ea[_0x9a02('0x24')],{'$or':_[_0x9a02('0x1f')](_0x2d25ea['attributes'],function(_0x4961c4){var _0x453f72={};_0x453f72[_0x4961c4]={'$like':'%'+_0x5c981d[_0x9a02('0x26')]['filter']+'%'};return _0x453f72;})});}_0x2d25ea=_[_0x9a02('0x33')]({},_0x2d25ea,_0x5c981d[_0x9a02('0x34')]);return _0x3b2264[_0x9a02('0x50')](_0x2d25ea);}})[_0x9a02('0x16')](function(_0x4aed83){if(_0x4aed83){_0x37428c=_0x4aed83['length'];if(!_0x5c981d[_0x9a02('0x26')][_0x9a02('0x42')](_0x9a02('0x53'))){_0x2d25ea['limit']=qs[_0x9a02('0x12')](_0x5c981d[_0x9a02('0x26')]['limit']);_0x2d25ea['offset']=qs[_0x9a02('0x10')](_0x5c981d[_0x9a02('0x26')][_0x9a02('0x10')]);}return _0x3b2264[_0x9a02('0x50')](_0x2d25ea);}})[_0x9a02('0x16')](function(_0x478f78){if(_0x478f78){return _0x478f78?{'count':_0x37428c,'rows':_0x478f78}:null;}})[_0x9a02('0x16')](respondWithResult(_0x1d4c48,null))[_0x9a02('0x28')](handleError(_0x1d4c48,null));};exports[_0x9a02('0x54')]=function(_0x297e5f,_0x192322){var _0x478b53=_0x297e5f['body'][_0x9a02('0x55')];return db[_0x9a02('0x51')][_0x9a02('0x27')]({'where':{'id':_0x478b53},'attributes':['id'],'include':[{'model':db[_0x9a02('0x47')],'as':_0x9a02('0x56'),'attributes':['id',_0x9a02('0x1d'),_0x9a02('0x57'),_0x9a02('0x58'),_0x9a02('0x59')],'raw':!![]}]})[_0x9a02('0x16')](function(_0x4b4fac){if(_0x4b4fac){var _0x5ae69f=_[_0x9a02('0x5a')](_0x4b4fac,function(_0x43b692){var _0x4b7af0=_0x43b692['get']({'plain':!![]});return _0x4b7af0[_0x9a02('0x56')];});return db[_0x9a02('0x20')][_0x9a02('0x35')]({'where':{'id':_0x297e5f[_0x9a02('0x2a')]['id']}})[_0x9a02('0x16')](function(_0x1e09de){return db[_0x9a02('0x5b')]['transaction'](function(_0x31bc70){return _0x1e09de['addTeams'](_0x478b53,{'transaction':_0x31bc70})[_0x9a02('0x16')](function(){return BPromise[_0x9a02('0x5c')](_0x5ae69f,function(_0x97fd7c){return db[_0x9a02('0x40')][_0x9a02('0x5d')]({'where':{'UserId':_0x97fd7c['id'],'ChatQueueId':_0x297e5f['params']['id']},'transaction':_0x31bc70});});})[_0x9a02('0x16')](function(){_0x5ae69f[_0x9a02('0x5e')](function(_0x43e995){socket[_0x9a02('0x5f')](_0x9a02('0x60'),{'UserId':_0x43e995['id'],'ChatQueueId':_0x1e09de['id']});});});});});}})['then'](respondWithStatusCode(_0x192322,null))[_0x9a02('0x28')](handleError(_0x192322,null));};exports[_0x9a02('0x61')]=function(_0x1a148d,_0x180f3f){return db['Team'][_0x9a02('0x27')]({'where':{'id':_0x1a148d[_0x9a02('0x26')][_0x9a02('0x55')]},'attributes':['id'],'include':[{'model':db[_0x9a02('0x47')],'as':_0x9a02('0x56'),'attributes':['id'],'raw':!![]}]})[_0x9a02('0x16')](handleEntityNotFound(_0x180f3f,null))['then'](function(_0x563a08){var _0x454009=_[_0x9a02('0x1f')](_0x563a08,'id');var _0x5797b6=[];var _0x257b40=[];var _0x26c729=squel['select']();_0x26c729[_0x9a02('0x62')](_0x9a02('0x63'))['from'](_0x9a02('0x64'),'tq')[_0x9a02('0x65')](_0x9a02('0x66'),'ut',_0x9a02('0x67'))[_0x9a02('0x24')]('ChatQueueId\x20=\x20?',_0x1a148d[_0x9a02('0x2a')]['id']);for(var _0x4d071e=0x0;_0x4d071e<_0x563a08['length'];_0x4d071e+=0x1){let _0xa9633c=_0x563a08[_0x4d071e];for(var _0x220ef3=0x0;_0x220ef3<_0xa9633c[_0x9a02('0x56')][_0x9a02('0x41')];_0x220ef3+=0x1){let _0xc0cc50=_0xa9633c['Agents'][_0x220ef3];var _0x1592ea=_0x26c729['clone']();_0x1592ea[_0x9a02('0x24')](_0x9a02('0x68'),_0xc0cc50['id']);_0x257b40[_0x9a02('0x69')](db[_0x9a02('0x5b')][_0x9a02('0x26')](_0x1592ea[_0x9a02('0x6a')](),{'type':db['sequelize']['QueryTypes'][_0x9a02('0x6b')]})['then'](function(_0x35cb1f){if(_0x35cb1f[_0x9a02('0x41')]===0x1){return _0xc0cc50['id'];}else{var _0x2fba86=_[_0x9a02('0x6c')](_['map'](_0x35cb1f,_0x9a02('0x6d')),function(_0x45422c){return _['includes'](_0x454009,_0x45422c);});if(_0x2fba86){return _0xc0cc50['id'];}}}));}}return BPromise['all'](_0x257b40)[_0x9a02('0x16')](function(_0x470cd4){_0x5797b6=_(_0x5797b6)[_0x9a02('0x6e')](_0x470cd4)[_0x9a02('0x6f')]()[_0x9a02('0x70')]();return db[_0x9a02('0x20')][_0x9a02('0x35')]({'where':{'id':_0x1a148d[_0x9a02('0x2a')]['id']}})[_0x9a02('0x16')](function(_0x121e2c){return db[_0x9a02('0x5b')][_0x9a02('0x71')](function(_0x2154d0){return _0x121e2c['removeTeams'](_0x1a148d[_0x9a02('0x26')]['ids'],{'transaction':_0x2154d0})[_0x9a02('0x16')](function(){if(!_[_0x9a02('0x72')](_0x5797b6)){return _0x121e2c[_0x9a02('0x73')](_0x5797b6,{'transaction':_0x2154d0});}})[_0x9a02('0x16')](function(){_0x5797b6[_0x9a02('0x5e')](function(_0x2b88f){socket[_0x9a02('0x5f')](_0x9a02('0x74'),{'UserId':_0x2b88f,'ChatQueueId':_0x121e2c['id']});});});});});});})[_0x9a02('0x16')](respondWithStatusCode(_0x180f3f,null))[_0x9a02('0x28')](handleError(_0x180f3f,null));};exports[_0x9a02('0x75')]=function(_0x5a6637,_0x242315){return db[_0x9a02('0x20')][_0x9a02('0x35')]({'where':{'id':_0x5a6637[_0x9a02('0x2a')]['id']}})[_0x9a02('0x16')](handleEntityNotFound(_0x242315,null))['then'](function(_0x1b3a1f){if(_0x1b3a1f){return _0x1b3a1f[_0x9a02('0x75')](_0x5a6637['body'][_0x9a02('0x55')],_[_0x9a02('0x76')](_0x5a6637['body'],[_0x9a02('0x55'),'id'])||{})[_0x9a02('0x77')](function(_0x33d17b){for(var _0xb55d9f=0x0;_0xb55d9f<_0x5a6637[_0x9a02('0x3c')][_0x9a02('0x55')][_0x9a02('0x41')];_0xb55d9f+=0x1){socket[_0x9a02('0x5f')](_0x9a02('0x60'),{'UserId':Number(_0x5a6637[_0x9a02('0x3c')][_0x9a02('0x55')][_0xb55d9f]),'ChatQueueId':Number(_0x5a6637[_0x9a02('0x2a')]['id'])});}return _0x33d17b;});}})[_0x9a02('0x16')](respondWithResult(_0x242315,null))[_0x9a02('0x28')](handleError(_0x242315,null));};exports[_0x9a02('0x73')]=function(_0x3a028b,_0x2a18e8){return db[_0x9a02('0x20')][_0x9a02('0x35')]({'where':{'id':_0x3a028b[_0x9a02('0x2a')]['id']}})['then'](handleEntityNotFound(_0x2a18e8,null))['then'](function(_0x3b2e4b){if(_0x3b2e4b){return _0x3b2e4b['removeAgents'](_0x3a028b[_0x9a02('0x26')][_0x9a02('0x55')])[_0x9a02('0x16')](function(){if(_['isArray'](_0x3a028b[_0x9a02('0x26')]['ids'])){for(var _0x830527=0x0;_0x830527<_0x3a028b['query']['ids'][_0x9a02('0x41')];_0x830527+=0x1){socket[_0x9a02('0x5f')](_0x9a02('0x74'),{'UserId':Number(_0x3a028b[_0x9a02('0x26')]['ids'][_0x830527]),'ChatQueueId':Number(_0x3a028b['params']['id'])});}}else{socket[_0x9a02('0x5f')](_0x9a02('0x74'),{'UserId':Number(_0x3a028b[_0x9a02('0x26')]['ids']),'ChatQueueId':Number(_0x3a028b[_0x9a02('0x2a')]['id'])});}});}})[_0x9a02('0x16')](respondWithStatusCode(_0x2a18e8,null))[_0x9a02('0x28')](handleError(_0x2a18e8,null));};exports['getAgents']=function(_0xa1f51a,_0x57b75c){var _0x24b2b4={};var _0x4c2886={};var _0x381a03;var _0x2ab13b;return db[_0x9a02('0x20')][_0x9a02('0x3f')]({'where':{'id':_0xa1f51a[_0x9a02('0x2a')]['id']}})[_0x9a02('0x16')](handleEntityNotFound(_0x57b75c,null))[_0x9a02('0x16')](function(_0x3f5889){if(_0x3f5889){_0x381a03=_0x3f5889;_0x4c2886[_0x9a02('0x2b')]=_['keys'](db[_0x9a02('0x47')][_0x9a02('0x2d')]);_0x4c2886[_0x9a02('0x26')]=_[_0x9a02('0x2c')](_0xa1f51a[_0x9a02('0x26')]);_0x4c2886['filters']=_['intersection'](_0x4c2886[_0x9a02('0x2b')],_0x4c2886[_0x9a02('0x26')]);_0x24b2b4['attributes']=_[_0x9a02('0x2f')](_0x4c2886[_0x9a02('0x2b')],qs[_0x9a02('0x31')](_0xa1f51a[_0x9a02('0x26')][_0x9a02('0x31')]));_0x24b2b4[_0x9a02('0x30')]=_0x24b2b4[_0x9a02('0x30')][_0x9a02('0x41')]?_0x24b2b4[_0x9a02('0x30')]:_0x4c2886['model'];_0x24b2b4['order']=qs[_0x9a02('0x43')](_0xa1f51a[_0x9a02('0x26')][_0x9a02('0x43')]);_0x24b2b4[_0x9a02('0x24')]=qs[_0x9a02('0x2e')](_[_0x9a02('0x44')](_0xa1f51a['query'],_0x4c2886[_0x9a02('0x2e')]));if(_0xa1f51a[_0x9a02('0x26')]['filter']){_0x24b2b4[_0x9a02('0x24')]=_['merge'](_0x24b2b4['where'],{'$or':_[_0x9a02('0x1f')](_0x24b2b4[_0x9a02('0x30')],function(_0x3aca43){var _0x4eb7bd={};_0x4eb7bd[_0x3aca43]={'$like':'%'+_0xa1f51a[_0x9a02('0x26')][_0x9a02('0x46')]+'%'};return _0x4eb7bd;})});}_0x24b2b4=_['merge']({},_0x24b2b4,_0xa1f51a['options']);return _0x381a03['getAgents'](_0x24b2b4);}})[_0x9a02('0x16')](function(_0x5b643b){if(_0x5b643b){_0x2ab13b=_0x5b643b['length'];if(!_0xa1f51a['query'][_0x9a02('0x42')](_0x9a02('0x53'))){_0x24b2b4[_0x9a02('0x12')]=qs['limit'](_0xa1f51a[_0x9a02('0x26')][_0x9a02('0x12')]);_0x24b2b4[_0x9a02('0x10')]=qs[_0x9a02('0x10')](_0xa1f51a[_0x9a02('0x26')]['offset']);}return _0x381a03[_0x9a02('0x78')](_0x24b2b4);}})[_0x9a02('0x16')](function(_0x387274){if(_0x387274){return _0x387274?{'count':_0x2ab13b,'rows':_0x387274}:null;}})[_0x9a02('0x16')](respondWithResult(_0x57b75c,null))['catch'](handleError(_0x57b75c,null));}; \ No newline at end of file +var _0xd3ea=['format','%s/%s','createdAt','getTeams','Team','order','ids','online','voicePause','interface','flatMap','Agents','transaction','addTeams','each','findOrCreate','forEach','userChatQueue:save','removeTeams','field','tq.TeamId','from','join','user_has_teams','clone','push','sequelize','toString','QueryTypes','every','TeamId','includes','all','compact','value','isEmpty','removeAgents','emit','userChatQueue:remove','addAgents','spread','isArray','getAgents','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','./chatQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','update','then','destroy','get','ChatQueues','UserProfileResource','name','send','index','map','key','where','include','ChatQueue','findAll','rows','catch','show','params','model','keys','query','filters','attributes','intersection','fields','includeAll','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','UserChatQueue','rawAttributes','length','hasOwnProperty','nolimit','sort','pick','ChatQueueId','filter','merge','User','UserId','chatPause','updatedAt'];(function(_0x1dab5f,_0x10cd21){var _0x40c2f3=function(_0x325a0d){while(--_0x325a0d){_0x1dab5f['push'](_0x1dab5f['shift']());}};_0x40c2f3(++_0x10cd21);}(_0xd3ea,0x117));var _0xad3e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xd3ea[_0x411add];return _0x238242;};'use strict';var BPromise=require('bluebird');var util=require(_0xad3e('0x0'));var _=require(_0xad3e('0x1'));var squel=require(_0xad3e('0x2'));var Redis=require(_0xad3e('0x3'));var qs=require(_0xad3e('0x4'));var logger=require(_0xad3e('0x5'))(_0xad3e('0x6'));var config=require(_0xad3e('0x7'));var db=require(_0xad3e('0x8'))['db'];config[_0xad3e('0x9')]=_['defaults'](config[_0xad3e('0x9')],{'host':_0xad3e('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xad3e('0x9')]));require(_0xad3e('0xb'))[_0xad3e('0xc')](socket);function respondWithStatusCode(_0xd26996,_0x279e65){_0x279e65=_0x279e65||0xcc;return function(_0x17891d){if(_0x17891d){return _0xd26996[_0xad3e('0xd')](_0x279e65);}return _0xd26996[_0xad3e('0xe')](_0x279e65)[_0xad3e('0xf')]();};}function respondWithResult(_0x193929,_0x74f391){_0x74f391=_0x74f391||0xc8;return function(_0x499da7){if(_0x499da7){return _0x193929['status'](_0x74f391)[_0xad3e('0x10')](_0x499da7);}};}function respondWithFilteredResult(_0x412fcb,_0x3e9852){return function(_0x409fa5){if(_0x409fa5){var _0x4dd82c=typeof _0x3e9852[_0xad3e('0x11')]===_0xad3e('0x12')&&typeof _0x3e9852[_0xad3e('0x13')]===_0xad3e('0x12');var _0x1c751d=_0x409fa5[_0xad3e('0x14')];var _0x43183c=_0x4dd82c?0x0:_0x3e9852[_0xad3e('0x11')];var _0x1f220b=_0x4dd82c?_0x409fa5['count']:_0x3e9852[_0xad3e('0x11')]+_0x3e9852[_0xad3e('0x13')];var _0x11aa33;if(_0x1f220b>=_0x1c751d){_0x1f220b=_0x1c751d;_0x11aa33=0xc8;}else{_0x11aa33=0xce;}_0x412fcb[_0xad3e('0xe')](_0x11aa33);return _0x412fcb['set'](_0xad3e('0x15'),_0x43183c+'-'+_0x1f220b+'/'+_0x1c751d)[_0xad3e('0x10')](_0x409fa5);}return null;};}function saveUpdates(_0x54fa7e){return function(_0x1e1223){if(_0x1e1223){return _0x1e1223[_0xad3e('0x16')](_0x54fa7e)[_0xad3e('0x17')](function(_0x20f6b0){return _0x20f6b0;});}return null;};}function removeEntity(_0x5619c1){return function(_0x112770){if(_0x112770){return _0x112770[_0xad3e('0x18')]()[_0xad3e('0x17')](function(){var _0x4aa536=_0x112770[_0xad3e('0x19')]({'plain':!![]});var _0x1bdef3=_0xad3e('0x1a');return db[_0xad3e('0x1b')][_0xad3e('0x18')]({'where':{'type':_0x1bdef3,'resourceId':_0x4aa536['id']}})[_0xad3e('0x17')](function(){return _0x112770;});})[_0xad3e('0x17')](function(){_0x5619c1[_0xad3e('0xe')](0xcc)[_0xad3e('0xf')]();});}};}function handleEntityNotFound(_0x174445){return function(_0xa2dffe){if(!_0xa2dffe){_0x174445['sendStatus'](0x194);}return _0xa2dffe;};}function handleError(_0x29a774,_0xa9bf60){_0xa9bf60=_0xa9bf60||0x1f4;return function(_0x30ee19){logger['error'](_0x30ee19['stack']);if(_0x30ee19[_0xad3e('0x1c')]){delete _0x30ee19['name'];}_0x29a774[_0xad3e('0xe')](_0xa9bf60)[_0xad3e('0x1d')](_0x30ee19);};}exports[_0xad3e('0x1e')]=function(_0xfb6b9a,_0xfdf539){var _0x2842f5={};var _0x34fbb4={'count':0x0,'rows':[]};var _0x48dae4=_[_0xad3e('0x1f')](db['ChatQueue']['rawAttributes'],function(_0x115bf8){return{'name':_0x115bf8['fieldName'],'type':_0x115bf8['type'][_0xad3e('0x20')]};});_0x2842f5=qs['getOptions'](_0x48dae4,_0xfb6b9a);var _0x55361b={'where':_0x2842f5[_0xad3e('0x21')]};return db['ChatQueue']['count'](_0x55361b)[_0xad3e('0x17')](function(_0x441eb3){_0x34fbb4[_0xad3e('0x14')]=_0x441eb3;_0x2842f5[_0xad3e('0x22')]=qs[_0xad3e('0x22')](_0xfb6b9a['query']);return db[_0xad3e('0x23')][_0xad3e('0x24')](_0x2842f5);})[_0xad3e('0x17')](function(_0x22e88b){_0x34fbb4[_0xad3e('0x25')]=_0x22e88b;return _0x34fbb4;})[_0xad3e('0x17')](respondWithFilteredResult(_0xfdf539,_0x2842f5))[_0xad3e('0x26')](handleError(_0xfdf539,null));};exports[_0xad3e('0x27')]=function(_0x5921c5,_0x651b9e){var _0x198e4c={'raw':!![],'where':{'id':_0x5921c5[_0xad3e('0x28')]['id']}},_0x13cf97={};_0x13cf97[_0xad3e('0x29')]=_[_0xad3e('0x2a')](db[_0xad3e('0x23')]['rawAttributes']);_0x13cf97[_0xad3e('0x2b')]=_['keys'](_0x5921c5[_0xad3e('0x2b')]);_0x13cf97[_0xad3e('0x2c')]=_['intersection'](_0x13cf97[_0xad3e('0x29')],_0x13cf97[_0xad3e('0x2b')]);_0x198e4c[_0xad3e('0x2d')]=_[_0xad3e('0x2e')](_0x13cf97['model'],qs['fields'](_0x5921c5['query'][_0xad3e('0x2f')]));_0x198e4c[_0xad3e('0x2d')]=_0x198e4c[_0xad3e('0x2d')]['length']?_0x198e4c['attributes']:_0x13cf97[_0xad3e('0x29')];if(_0x5921c5['query'][_0xad3e('0x30')]){_0x198e4c[_0xad3e('0x22')]=[{'all':!![]}];}_0x198e4c=_['merge']({},_0x198e4c,_0x5921c5[_0xad3e('0x31')]);return db[_0xad3e('0x23')][_0xad3e('0x32')](_0x198e4c)[_0xad3e('0x17')](handleEntityNotFound(_0x651b9e,null))['then'](respondWithResult(_0x651b9e,null))['catch'](handleError(_0x651b9e,null));};exports['create']=function(_0x22c077,_0x58e474){return db['ChatQueue'][_0xad3e('0x33')](_0x22c077[_0xad3e('0x34')],{})[_0xad3e('0x17')](function(_0xfaa1e7){var _0x8d3513=_0x22c077['user'][_0xad3e('0x19')]({'plain':!![]});if(!_0x8d3513)throw new Error(_0xad3e('0x35'));if(_0x8d3513['role']===_0xad3e('0x36')){var _0x3b5feb=_0xfaa1e7['get']({'plain':!![]});var _0x4f5139=_0xad3e('0x1a');return db[_0xad3e('0x37')][_0xad3e('0x32')]({'where':{'name':_0x4f5139,'userProfileId':_0x8d3513['userProfileId']},'raw':!![]})[_0xad3e('0x17')](function(_0xa63950){if(_0xa63950&&_0xa63950[_0xad3e('0x38')]===0x0){return db[_0xad3e('0x1b')][_0xad3e('0x33')]({'name':_0x3b5feb[_0xad3e('0x1c')],'resourceId':_0x3b5feb['id'],'type':_0xa63950[_0xad3e('0x1c')],'sectionId':_0xa63950['id']},{})[_0xad3e('0x17')](function(){return _0xfaa1e7;});}else{return _0xfaa1e7;}})[_0xad3e('0x26')](function(_0x10f52d){logger[_0xad3e('0x39')](_0xad3e('0x3a'),_0x10f52d);throw _0x10f52d;});}return _0xfaa1e7;})[_0xad3e('0x17')](respondWithResult(_0x58e474,0xc9))[_0xad3e('0x26')](handleError(_0x58e474,null));};exports[_0xad3e('0x16')]=function(_0xd440dc,_0x39a6a3){if(_0xd440dc[_0xad3e('0x34')]['id']){delete _0xd440dc['body']['id'];}return db[_0xad3e('0x23')]['find']({'where':{'id':_0xd440dc[_0xad3e('0x28')]['id']}})[_0xad3e('0x17')](handleEntityNotFound(_0x39a6a3,null))['then'](saveUpdates(_0xd440dc[_0xad3e('0x34')],null))['then'](respondWithResult(_0x39a6a3,null))[_0xad3e('0x26')](handleError(_0x39a6a3,null));};exports[_0xad3e('0x18')]=function(_0x43bcf0,_0x3bdda2){return db[_0xad3e('0x23')][_0xad3e('0x32')]({'where':{'id':_0x43bcf0[_0xad3e('0x28')]['id']}})[_0xad3e('0x17')](handleEntityNotFound(_0x3bdda2,null))[_0xad3e('0x17')](removeEntity(_0x3bdda2,null))[_0xad3e('0x26')](handleError(_0x3bdda2,null));};exports[_0xad3e('0x3b')]=function(_0x2f25f8,_0x49181a){return db[_0xad3e('0x23')]['describe']()[_0xad3e('0x17')](respondWithResult(_0x49181a,null))[_0xad3e('0x26')](handleError(_0x49181a,null));};exports['getMembers']=function(_0x478a80,_0x47676e){var _0x11d245={'raw':!![],'where':{}},_0xf456bf={},_0x5668c7;return db[_0xad3e('0x23')][_0xad3e('0x3c')]({'where':{'id':_0x478a80[_0xad3e('0x28')]['id']}})[_0xad3e('0x17')](handleEntityNotFound(_0x47676e,null))[_0xad3e('0x17')](function(_0x346622){if(_0x346622){_0x5668c7=_0x346622[_0xad3e('0x19')]({'plain':!![]});_0xf456bf[_0xad3e('0x29')]=_[_0xad3e('0x2a')](db[_0xad3e('0x3d')][_0xad3e('0x3e')]);_0xf456bf['query']=_['keys'](_0x478a80[_0xad3e('0x2b')]);_0xf456bf[_0xad3e('0x2c')]=_['intersection'](_0xf456bf[_0xad3e('0x29')],_0xf456bf['query']);_0x11d245['attributes']=_[_0xad3e('0x2e')](_0xf456bf['model'],qs[_0xad3e('0x2f')](_0x478a80[_0xad3e('0x2b')]['fields']));_0x11d245[_0xad3e('0x2d')]=_0x11d245[_0xad3e('0x2d')][_0xad3e('0x3f')]?_0x11d245[_0xad3e('0x2d')]:_0xf456bf[_0xad3e('0x29')];if(!_0x478a80['query'][_0xad3e('0x40')](_0xad3e('0x41'))){_0x11d245[_0xad3e('0x13')]=qs[_0xad3e('0x13')](_0x478a80['query'][_0xad3e('0x13')]);_0x11d245[_0xad3e('0x11')]=qs[_0xad3e('0x11')](_0x478a80['query']['offset']);}_0x11d245['order']=qs[_0xad3e('0x42')](_0x478a80[_0xad3e('0x2b')]['sort']);_0x11d245[_0xad3e('0x21')]=qs['filters'](_[_0xad3e('0x43')](_0x478a80[_0xad3e('0x2b')],_0xf456bf[_0xad3e('0x2c')]));_0x11d245['where'][_0xad3e('0x44')]=_0x346622['id'];if(_0x478a80[_0xad3e('0x2b')][_0xad3e('0x45')]){_0x11d245[_0xad3e('0x21')]=_[_0xad3e('0x46')](_0x11d245['where'],{'$or':_[_0xad3e('0x1f')](_0x11d245[_0xad3e('0x2d')],function(_0x2c0532){var _0x2b5d84={};_0x2b5d84[_0x2c0532]={'$like':'%'+_0x478a80['query'][_0xad3e('0x45')]+'%'};return _0x2b5d84;})});}_0x11d245=_[_0xad3e('0x46')]({},_0x11d245,_0x478a80['options']);return db[_0xad3e('0x3d')][_0xad3e('0x24')](_0x11d245);}})['then'](function(_0x276609){if(_0x276609){return db[_0xad3e('0x47')]['findAndCountAll']({'where':{'id':_['map'](_0x276609,_0xad3e('0x48')),'role':'agent'},'attributes':['id',_0xad3e('0x1c'),_0xad3e('0x49'),_0xad3e('0x4a'),'createdAt']});}})['then'](function(_0x2704bb){if(_0x2704bb){return{'count':_0x2704bb[_0xad3e('0x14')],'rows':_[_0xad3e('0x1f')](_0x2704bb[_0xad3e('0x25')],function(_0x3cf1fb){return{'membername':_0x3cf1fb[_0xad3e('0x1c')],'UserId':_0x3cf1fb['id'],'queue_name':_0x5668c7[_0xad3e('0x1c')],'ChatQueueId':_0x5668c7['id'],'interface':util[_0xad3e('0x4b')](_0xad3e('0x4c'),'SIP',_0x3cf1fb[_0xad3e('0x1c')]),'penalty':0x0,'paused':_0x3cf1fb['chatPause'],'createdAt':_0x3cf1fb[_0xad3e('0x4d')],'updatedAt':_0x3cf1fb['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xad3e('0x17')](respondWithFilteredResult(_0x47676e,_0x11d245))['catch'](handleError(_0x47676e,null));};exports[_0xad3e('0x4e')]=function(_0x2e53a8,_0x2584ff){var _0x4fd8c6={};var _0x4431ec={};var _0x4b9c64;var _0x2f31a8;return db[_0xad3e('0x23')][_0xad3e('0x3c')]({'where':{'id':_0x2e53a8['params']['id']}})[_0xad3e('0x17')](handleEntityNotFound(_0x2584ff,null))['then'](function(_0xae5de){if(_0xae5de){_0x4b9c64=_0xae5de;_0x4431ec[_0xad3e('0x29')]=_['keys'](db[_0xad3e('0x4f')]['rawAttributes']);_0x4431ec[_0xad3e('0x2b')]=_[_0xad3e('0x2a')](_0x2e53a8['query']);_0x4431ec[_0xad3e('0x2c')]=_[_0xad3e('0x2e')](_0x4431ec[_0xad3e('0x29')],_0x4431ec[_0xad3e('0x2b')]);_0x4fd8c6[_0xad3e('0x2d')]=_[_0xad3e('0x2e')](_0x4431ec[_0xad3e('0x29')],qs[_0xad3e('0x2f')](_0x2e53a8[_0xad3e('0x2b')][_0xad3e('0x2f')]));_0x4fd8c6[_0xad3e('0x2d')]=_0x4fd8c6['attributes'][_0xad3e('0x3f')]?_0x4fd8c6[_0xad3e('0x2d')]:_0x4431ec[_0xad3e('0x29')];_0x4fd8c6[_0xad3e('0x50')]=qs[_0xad3e('0x42')](_0x2e53a8['query'][_0xad3e('0x42')]);_0x4fd8c6[_0xad3e('0x21')]=qs['filters'](_[_0xad3e('0x43')](_0x2e53a8[_0xad3e('0x2b')],_0x4431ec[_0xad3e('0x2c')]));if(_0x2e53a8['query'][_0xad3e('0x45')]){_0x4fd8c6[_0xad3e('0x21')]=_[_0xad3e('0x46')](_0x4fd8c6['where'],{'$or':_[_0xad3e('0x1f')](_0x4fd8c6['attributes'],function(_0x30f127){var _0x7e9661={};_0x7e9661[_0x30f127]={'$like':'%'+_0x2e53a8[_0xad3e('0x2b')][_0xad3e('0x45')]+'%'};return _0x7e9661;})});}_0x4fd8c6=_[_0xad3e('0x46')]({},_0x4fd8c6,_0x2e53a8[_0xad3e('0x31')]);return _0x4b9c64[_0xad3e('0x4e')](_0x4fd8c6);}})[_0xad3e('0x17')](function(_0x6ca786){if(_0x6ca786){_0x2f31a8=_0x6ca786[_0xad3e('0x3f')];if(!_0x2e53a8[_0xad3e('0x2b')][_0xad3e('0x40')]('nolimit')){_0x4fd8c6[_0xad3e('0x13')]=qs['limit'](_0x2e53a8[_0xad3e('0x2b')][_0xad3e('0x13')]);_0x4fd8c6['offset']=qs['offset'](_0x2e53a8['query'][_0xad3e('0x11')]);}return _0x4b9c64[_0xad3e('0x4e')](_0x4fd8c6);}})[_0xad3e('0x17')](function(_0x34d033){if(_0x34d033){return _0x34d033?{'count':_0x2f31a8,'rows':_0x34d033}:null;}})['then'](respondWithResult(_0x2584ff,null))[_0xad3e('0x26')](handleError(_0x2584ff,null));};exports['addTeams']=function(_0xde52d6,_0x24ca93){var _0x100595=_0xde52d6[_0xad3e('0x34')][_0xad3e('0x51')];return db['Team'][_0xad3e('0x24')]({'where':{'id':_0x100595},'attributes':['id'],'include':[{'model':db[_0xad3e('0x47')],'as':'Agents','attributes':['id',_0xad3e('0x1c'),_0xad3e('0x52'),_0xad3e('0x53'),_0xad3e('0x54')],'raw':!![]}]})[_0xad3e('0x17')](function(_0x283f21){if(_0x283f21){var _0x581106=_[_0xad3e('0x55')](_0x283f21,function(_0x5734ec){var _0x40e69a=_0x5734ec[_0xad3e('0x19')]({'plain':!![]});return _0x40e69a[_0xad3e('0x56')];});return db[_0xad3e('0x23')][_0xad3e('0x32')]({'where':{'id':_0xde52d6[_0xad3e('0x28')]['id']}})[_0xad3e('0x17')](function(_0x5be351){return db['sequelize'][_0xad3e('0x57')](function(_0x2db83f){return _0x5be351[_0xad3e('0x58')](_0x100595,{'transaction':_0x2db83f})[_0xad3e('0x17')](function(){return BPromise[_0xad3e('0x59')](_0x581106,function(_0x8d48a9){return db[_0xad3e('0x3d')][_0xad3e('0x5a')]({'where':{'UserId':_0x8d48a9['id'],'ChatQueueId':_0xde52d6[_0xad3e('0x28')]['id']},'transaction':_0x2db83f});});})[_0xad3e('0x17')](function(){_0x581106[_0xad3e('0x5b')](function(_0x20b767){socket['emit'](_0xad3e('0x5c'),{'UserId':_0x20b767['id'],'ChatQueueId':_0x5be351['id']});});});});});}})[_0xad3e('0x17')](respondWithStatusCode(_0x24ca93,null))[_0xad3e('0x26')](handleError(_0x24ca93,null));};exports[_0xad3e('0x5d')]=function(_0x450aed,_0x12c4cd){return db[_0xad3e('0x4f')][_0xad3e('0x24')]({'where':{'id':_0x450aed[_0xad3e('0x2b')][_0xad3e('0x51')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x12c4cd,null))[_0xad3e('0x17')](function(_0x6c68b7){var _0x407f75=_[_0xad3e('0x1f')](_0x6c68b7,'id');var _0x1e6a32=[];var _0x4d6e5f=[];var _0x277aa8=squel['select']();_0x277aa8[_0xad3e('0x5e')](_0xad3e('0x5f'))[_0xad3e('0x60')]('team_has_chat_queues','tq')[_0xad3e('0x61')](_0xad3e('0x62'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xad3e('0x21')]('ChatQueueId\x20=\x20?',_0x450aed[_0xad3e('0x28')]['id']);for(var _0x27de95=0x0;_0x27de95<_0x6c68b7[_0xad3e('0x3f')];_0x27de95+=0x1){let _0x174da6=_0x6c68b7[_0x27de95];for(var _0x5cb843=0x0;_0x5cb843<_0x174da6['Agents']['length'];_0x5cb843+=0x1){let _0x27a9c4=_0x174da6[_0xad3e('0x56')][_0x5cb843];var _0x19b8e4=_0x277aa8[_0xad3e('0x63')]();_0x19b8e4[_0xad3e('0x21')]('ut.UserId\x20=\x20?',_0x27a9c4['id']);_0x4d6e5f[_0xad3e('0x64')](db[_0xad3e('0x65')][_0xad3e('0x2b')](_0x19b8e4[_0xad3e('0x66')](),{'type':db[_0xad3e('0x65')][_0xad3e('0x67')]['SELECT']})[_0xad3e('0x17')](function(_0x185ff1){if(_0x185ff1[_0xad3e('0x3f')]===0x1){return _0x27a9c4['id'];}else{var _0x46570e=_[_0xad3e('0x68')](_[_0xad3e('0x1f')](_0x185ff1,_0xad3e('0x69')),function(_0x1ca05b){return _[_0xad3e('0x6a')](_0x407f75,_0x1ca05b);});if(_0x46570e){return _0x27a9c4['id'];}}}));}}return BPromise[_0xad3e('0x6b')](_0x4d6e5f)[_0xad3e('0x17')](function(_0x5bae7a){_0x1e6a32=_(_0x1e6a32)['union'](_0x5bae7a)[_0xad3e('0x6c')]()[_0xad3e('0x6d')]();return db['ChatQueue'][_0xad3e('0x32')]({'where':{'id':_0x450aed[_0xad3e('0x28')]['id']}})['then'](function(_0x18b5b0){return db[_0xad3e('0x65')][_0xad3e('0x57')](function(_0x503d7f){return _0x18b5b0[_0xad3e('0x5d')](_0x450aed[_0xad3e('0x2b')][_0xad3e('0x51')],{'transaction':_0x503d7f})[_0xad3e('0x17')](function(){if(!_[_0xad3e('0x6e')](_0x1e6a32)){return _0x18b5b0[_0xad3e('0x6f')](_0x1e6a32,{'transaction':_0x503d7f});}})[_0xad3e('0x17')](function(){_0x1e6a32[_0xad3e('0x5b')](function(_0x40b080){socket[_0xad3e('0x70')](_0xad3e('0x71'),{'UserId':_0x40b080,'ChatQueueId':_0x18b5b0['id']});});});});});});})[_0xad3e('0x17')](respondWithStatusCode(_0x12c4cd,null))[_0xad3e('0x26')](handleError(_0x12c4cd,null));};exports['addAgents']=function(_0x591f63,_0x44e6ce){return db[_0xad3e('0x23')][_0xad3e('0x32')]({'where':{'id':_0x591f63['params']['id']}})[_0xad3e('0x17')](handleEntityNotFound(_0x44e6ce,null))[_0xad3e('0x17')](function(_0x323584){if(_0x323584){return _0x323584[_0xad3e('0x72')](_0x591f63['body'][_0xad3e('0x51')],_['omit'](_0x591f63[_0xad3e('0x34')],['ids','id'])||{})[_0xad3e('0x73')](function(_0x3106cf){for(var _0xcd6372=0x0;_0xcd6372<_0x591f63[_0xad3e('0x34')]['ids'][_0xad3e('0x3f')];_0xcd6372+=0x1){socket[_0xad3e('0x70')](_0xad3e('0x5c'),{'UserId':Number(_0x591f63[_0xad3e('0x34')][_0xad3e('0x51')][_0xcd6372]),'ChatQueueId':Number(_0x591f63[_0xad3e('0x28')]['id'])});}return _0x3106cf;});}})['then'](respondWithResult(_0x44e6ce,null))['catch'](handleError(_0x44e6ce,null));};exports[_0xad3e('0x6f')]=function(_0x381672,_0x5e904a){return db[_0xad3e('0x23')]['find']({'where':{'id':_0x381672[_0xad3e('0x28')]['id']}})[_0xad3e('0x17')](handleEntityNotFound(_0x5e904a,null))[_0xad3e('0x17')](function(_0x37281a){if(_0x37281a){return _0x37281a[_0xad3e('0x6f')](_0x381672['query'][_0xad3e('0x51')])[_0xad3e('0x17')](function(){if(_[_0xad3e('0x74')](_0x381672[_0xad3e('0x2b')][_0xad3e('0x51')])){for(var _0x235131=0x0;_0x235131<_0x381672[_0xad3e('0x2b')][_0xad3e('0x51')][_0xad3e('0x3f')];_0x235131+=0x1){socket['emit']('userChatQueue:remove',{'UserId':Number(_0x381672[_0xad3e('0x2b')][_0xad3e('0x51')][_0x235131]),'ChatQueueId':Number(_0x381672[_0xad3e('0x28')]['id'])});}}else{socket[_0xad3e('0x70')](_0xad3e('0x71'),{'UserId':Number(_0x381672[_0xad3e('0x2b')][_0xad3e('0x51')]),'ChatQueueId':Number(_0x381672[_0xad3e('0x28')]['id'])});}});}})[_0xad3e('0x17')](respondWithStatusCode(_0x5e904a,null))[_0xad3e('0x26')](handleError(_0x5e904a,null));};exports[_0xad3e('0x75')]=function(_0xd0bc74,_0x5ec18f){var _0x541ce6={};var _0x4ff3cb={};var _0x1cabdd;var _0x1c6199;return db[_0xad3e('0x23')][_0xad3e('0x3c')]({'where':{'id':_0xd0bc74['params']['id']}})[_0xad3e('0x17')](handleEntityNotFound(_0x5ec18f,null))[_0xad3e('0x17')](function(_0x4cf5ed){if(_0x4cf5ed){_0x1cabdd=_0x4cf5ed;_0x4ff3cb[_0xad3e('0x29')]=_[_0xad3e('0x2a')](db[_0xad3e('0x47')][_0xad3e('0x3e')]);_0x4ff3cb[_0xad3e('0x2b')]=_[_0xad3e('0x2a')](_0xd0bc74[_0xad3e('0x2b')]);_0x4ff3cb['filters']=_['intersection'](_0x4ff3cb[_0xad3e('0x29')],_0x4ff3cb[_0xad3e('0x2b')]);_0x541ce6[_0xad3e('0x2d')]=_[_0xad3e('0x2e')](_0x4ff3cb[_0xad3e('0x29')],qs[_0xad3e('0x2f')](_0xd0bc74[_0xad3e('0x2b')][_0xad3e('0x2f')]));_0x541ce6[_0xad3e('0x2d')]=_0x541ce6[_0xad3e('0x2d')][_0xad3e('0x3f')]?_0x541ce6[_0xad3e('0x2d')]:_0x4ff3cb[_0xad3e('0x29')];_0x541ce6[_0xad3e('0x50')]=qs[_0xad3e('0x42')](_0xd0bc74[_0xad3e('0x2b')][_0xad3e('0x42')]);_0x541ce6[_0xad3e('0x21')]=qs[_0xad3e('0x2c')](_['pick'](_0xd0bc74[_0xad3e('0x2b')],_0x4ff3cb['filters']));if(_0xd0bc74[_0xad3e('0x2b')][_0xad3e('0x45')]){_0x541ce6[_0xad3e('0x21')]=_['merge'](_0x541ce6['where'],{'$or':_['map'](_0x541ce6['attributes'],function(_0x437481){var _0x2668d2={};_0x2668d2[_0x437481]={'$like':'%'+_0xd0bc74['query'][_0xad3e('0x45')]+'%'};return _0x2668d2;})});}_0x541ce6=_[_0xad3e('0x46')]({},_0x541ce6,_0xd0bc74[_0xad3e('0x31')]);return _0x1cabdd[_0xad3e('0x75')](_0x541ce6);}})[_0xad3e('0x17')](function(_0x21280c){if(_0x21280c){_0x1c6199=_0x21280c['length'];if(!_0xd0bc74[_0xad3e('0x2b')][_0xad3e('0x40')](_0xad3e('0x41'))){_0x541ce6[_0xad3e('0x13')]=qs[_0xad3e('0x13')](_0xd0bc74['query'][_0xad3e('0x13')]);_0x541ce6[_0xad3e('0x11')]=qs[_0xad3e('0x11')](_0xd0bc74[_0xad3e('0x2b')][_0xad3e('0x11')]);}return _0x1cabdd['getAgents'](_0x541ce6);}})['then'](function(_0x16f921){if(_0x16f921){return _0x16f921?{'count':_0x1c6199,'rows':_0x16f921}:null;}})['then'](respondWithResult(_0x5ec18f,null))[_0xad3e('0x26')](handleError(_0x5ec18f,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index d6454c0..027ec62 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 _0x3f32=['exports','events','../../mysqldb','ChatQueue','save','update','emit','hasOwnProperty','hook'];(function(_0x245e64,_0xa8a1a1){var _0x282143=function(_0x126275){while(--_0x126275){_0x245e64['push'](_0x245e64['shift']());}};_0x282143(++_0xa8a1a1);}(_0x3f32,0x160));var _0x23f3=function(_0xa9dc6f,_0x27d8f0){_0xa9dc6f=_0xa9dc6f-0x0;var _0x201588=_0x3f32[_0xa9dc6f];return _0x201588;};'use strict';var EventEmitter=require(_0x23f3('0x0'));var ChatQueue=require(_0x23f3('0x1'))['db'][_0x23f3('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x23f3('0x3'),'afterUpdate':_0x23f3('0x4'),'afterDestroy':'remove'};function emitEvent(_0x22eaa1){return function(_0x2d9d16,_0x13e453,_0x435c8a){ChatQueueEvents[_0x23f3('0x5')](_0x22eaa1+':'+_0x2d9d16['id'],_0x2d9d16);ChatQueueEvents[_0x23f3('0x5')](_0x22eaa1,_0x2d9d16);_0x435c8a(null);};}for(var e in events){if(events[_0x23f3('0x6')](e)){var event=events[e];ChatQueue[_0x23f3('0x7')](e,emitEvent(event));}}module[_0x23f3('0x8')]=ChatQueueEvents; \ No newline at end of file +var _0x0f3c=['exports','events','../../mysqldb','update','remove','emit','hook'];(function(_0x34ca44,_0xc10a82){var _0xcb3f34=function(_0x45f09f){while(--_0x45f09f){_0x34ca44['push'](_0x34ca44['shift']());}};_0xcb3f34(++_0xc10a82);}(_0x0f3c,0x189));var _0xc0f3=function(_0x177405,_0x101922){_0x177405=_0x177405-0x0;var _0x7b025f=_0x0f3c[_0x177405];return _0x7b025f;};'use strict';var EventEmitter=require(_0xc0f3('0x0'));var ChatQueue=require(_0xc0f3('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xc0f3('0x2'),'afterDestroy':_0xc0f3('0x3')};function emitEvent(_0xa6a874){return function(_0x2d1f5d,_0x1be43d,_0x279717){ChatQueueEvents[_0xc0f3('0x4')](_0xa6a874+':'+_0x2d1f5d['id'],_0x2d1f5d);ChatQueueEvents[_0xc0f3('0x4')](_0xa6a874,_0x2d1f5d);_0x279717(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0xc0f3('0x5')](e,emitEvent(event));}}module[_0xc0f3('0x6')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index b8a8b7a..97fad0a 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 _0x3544=['api','bluebird','path','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','util'];(function(_0x2b0c18,_0x5b0e08){var _0xc328b9=function(_0x2667d3){while(--_0x2667d3){_0x2b0c18['push'](_0x2b0c18['shift']());}};_0xc328b9(++_0x5b0e08);}(_0x3544,0x8b));var _0x4354=function(_0x47a349,_0x4699d9){_0x47a349=_0x47a349-0x0;var _0x18ab75=_0x3544[_0x47a349];return _0x18ab75;};'use strict';var _=require('lodash');var util=require(_0x4354('0x0'));var logger=require('../../config/logger')(_0x4354('0x1'));var moment=require('moment');var BPromise=require(_0x4354('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4354('0x3'));var rimraf=require('rimraf');var config=require(_0x4354('0x4'));var attributes=require(_0x4354('0x5'));module[_0x4354('0x6')]=function(_0x5721bf,_0xd71222){return _0x5721bf[_0x4354('0x7')](_0x4354('0x8'),attributes,{'tableName':_0x4354('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2b74=['define','chat_queues','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2b74,0x115));var _0x42b7=function(_0x45eb29,_0x309e77){_0x45eb29=_0x45eb29-0x0;var _0x2339af=_0x2b74[_0x45eb29];return _0x2339af;};'use strict';var _=require('lodash');var util=require(_0x42b7('0x0'));var logger=require(_0x42b7('0x1'))('api');var moment=require('moment');var BPromise=require(_0x42b7('0x2'));var rp=require(_0x42b7('0x3'));var fs=require('fs');var path=require(_0x42b7('0x4'));var rimraf=require(_0x42b7('0x5'));var config=require(_0x42b7('0x6'));var attributes=require(_0x42b7('0x7'));module[_0x42b7('0x8')]=function(_0x38544e,_0x1cc24f){return _0x38544e[_0x42b7('0x9')]('ChatQueue',attributes,{'tableName':_0x42b7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js index 8f36f89..aac6887 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 _0xf5c4=['raw','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetChatQueue','ChatQueue','findAll','options','where','attributes','limit','include','map','model','debug','catch','ShowChatQueue','find'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xf5c4,0x1ae));var _0x4f5c=function(_0x4e1b31,_0x326739){_0x4e1b31=_0x4e1b31-0x0;var _0x3a6df9=_0xf5c4[_0x4e1b31];return _0x3a6df9;};'use strict';var _=require(_0x4f5c('0x0'));var util=require(_0x4f5c('0x1'));var moment=require(_0x4f5c('0x2'));var BPromise=require(_0x4f5c('0x3'));var rs=require(_0x4f5c('0x4'));var fs=require('fs');var Redis=require(_0x4f5c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4f5c('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x4f5c('0x7'));var jayson=require(_0x4f5c('0x8'));var client=jayson[_0x4f5c('0x9')]['http']({'port':0x232a});config[_0x4f5c('0xa')]=_[_0x4f5c('0xb')](config['redis'],{'host':_0x4f5c('0xc'),'port':0x18eb});var socket=require(_0x4f5c('0xd'))(new Redis(config['redis']));require('./chatQueue.socket')[_0x4f5c('0xe')](socket);function respondWithRpcPromise(_0x4164a7,_0x3ff2f6,_0x1cb5b5){return new BPromise(function(_0x497ca3,_0x3dde08){return client['request'](_0x4164a7,_0x1cb5b5)[_0x4f5c('0xf')](function(_0x221386){logger[_0x4f5c('0x10')](_0x4f5c('0x11'),_0x3ff2f6,_0x4f5c('0x12'));logger['debug'](_0x4f5c('0x13'),_0x3ff2f6,'request\x20sent',JSON[_0x4f5c('0x14')](_0x221386));if(_0x221386[_0x4f5c('0x15')]){if(_0x221386['error']['code']===0x1f4){logger[_0x4f5c('0x15')](_0x4f5c('0x11'),_0x3ff2f6,_0x221386[_0x4f5c('0x15')]['message']);return _0x3dde08(_0x221386[_0x4f5c('0x15')][_0x4f5c('0x16')]);}logger['error'](_0x4f5c('0x11'),_0x3ff2f6,_0x221386[_0x4f5c('0x15')][_0x4f5c('0x16')]);return _0x497ca3(_0x221386[_0x4f5c('0x15')][_0x4f5c('0x16')]);}else{logger['info'](_0x4f5c('0x11'),_0x3ff2f6,_0x4f5c('0x12'));_0x497ca3(_0x221386[_0x4f5c('0x17')][_0x4f5c('0x16')]);}})['catch'](function(_0x43b178){logger[_0x4f5c('0x15')]('ChatQueue,\x20%s,\x20%s',_0x3ff2f6,_0x43b178);_0x3dde08(_0x43b178);});});}exports[_0x4f5c('0x18')]=function(_0x3e3c50){var _0x50d99f=this;return new Promise(function(_0x21f318,_0x300410){return db[_0x4f5c('0x19')][_0x4f5c('0x1a')]({'raw':_0x3e3c50[_0x4f5c('0x1b')]?_0x3e3c50[_0x4f5c('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x3e3c50['options']?_0x3e3c50[_0x4f5c('0x1b')][_0x4f5c('0x1c')]||null:null,'attributes':_0x3e3c50[_0x4f5c('0x1b')]?_0x3e3c50[_0x4f5c('0x1b')][_0x4f5c('0x1d')]||null:null,'limit':_0x3e3c50[_0x4f5c('0x1b')]?_0x3e3c50[_0x4f5c('0x1b')][_0x4f5c('0x1e')]||null:null,'include':_0x3e3c50[_0x4f5c('0x1b')]?_0x3e3c50['options'][_0x4f5c('0x1f')]?_[_0x4f5c('0x20')](_0x3e3c50['options'][_0x4f5c('0x1f')],function(_0x93f18){return{'model':db[_0x93f18[_0x4f5c('0x21')]],'as':_0x93f18['as'],'attributes':_0x93f18[_0x4f5c('0x1d')],'include':_0x93f18[_0x4f5c('0x1f')]?_[_0x4f5c('0x20')](_0x93f18[_0x4f5c('0x1f')],function(_0xf4910b){return{'model':db[_0xf4910b[_0x4f5c('0x21')]],'as':_0xf4910b['as'],'attributes':_0xf4910b[_0x4f5c('0x1d')],'include':_0xf4910b[_0x4f5c('0x1f')]?_['map'](_0xf4910b[_0x4f5c('0x1f')],function(_0x208695){return{'model':db[_0x208695[_0x4f5c('0x21')]],'as':_0x208695['as'],'attributes':_0x208695[_0x4f5c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x4f5c('0xf')](function(_0x1fe00f){logger['info'](_0x4f5c('0x18'),_0x3e3c50);logger[_0x4f5c('0x22')](_0x4f5c('0x18'),_0x3e3c50,JSON['stringify'](_0x1fe00f));_0x21f318(_0x1fe00f);})[_0x4f5c('0x23')](function(_0x5ea0b6){logger['error'](_0x4f5c('0x18'),_0x5ea0b6[_0x4f5c('0x16')],_0x3e3c50);_0x300410(_0x50d99f[_0x4f5c('0x15')](0x1f4,_0x5ea0b6['message']));});});};exports[_0x4f5c('0x24')]=function(_0x553b3d){var _0x773f8c=this;return new Promise(function(_0x1600b1,_0x2d1db0){return db[_0x4f5c('0x19')][_0x4f5c('0x25')]({'raw':_0x553b3d[_0x4f5c('0x1b')]?_0x553b3d[_0x4f5c('0x1b')][_0x4f5c('0x26')]===undefined?!![]:![]:!![],'where':_0x553b3d['options']?_0x553b3d[_0x4f5c('0x1b')][_0x4f5c('0x1c')]||null:null,'attributes':_0x553b3d[_0x4f5c('0x1b')]?_0x553b3d[_0x4f5c('0x1b')]['attributes']||null:null,'include':_0x553b3d[_0x4f5c('0x1b')]?_0x553b3d[_0x4f5c('0x1b')][_0x4f5c('0x1f')]?_[_0x4f5c('0x20')](_0x553b3d[_0x4f5c('0x1b')][_0x4f5c('0x1f')],function(_0x3e12c1){return{'model':db[_0x3e12c1[_0x4f5c('0x21')]],'as':_0x3e12c1['as'],'attributes':_0x3e12c1[_0x4f5c('0x1d')],'include':_0x3e12c1['include']?_[_0x4f5c('0x20')](_0x3e12c1[_0x4f5c('0x1f')],function(_0x10aa2f){return{'model':db[_0x10aa2f[_0x4f5c('0x21')]],'as':_0x10aa2f['as'],'attributes':_0x10aa2f['attributes'],'include':_0x10aa2f[_0x4f5c('0x1f')]?_[_0x4f5c('0x20')](_0x10aa2f[_0x4f5c('0x1f')],function(_0x20acde){return{'model':db[_0x20acde['model']],'as':_0x20acde['as'],'attributes':_0x20acde['attributes']};}):[]};}):[]};}):[]:[]})[_0x4f5c('0xf')](function(_0x252842){logger[_0x4f5c('0x10')](_0x4f5c('0x24'),_0x553b3d);logger[_0x4f5c('0x22')]('ShowChatQueue',_0x553b3d,JSON['stringify'](_0x252842));_0x1600b1(_0x252842);})[_0x4f5c('0x23')](function(_0x64746d){logger['error'](_0x4f5c('0x24'),_0x64746d[_0x4f5c('0x16')],_0x553b3d);_0x2d1db0(_0x773f8c[_0x4f5c('0x15')](0x1f4,_0x64746d[_0x4f5c('0x16')]));});});}; \ No newline at end of file +var _0x53aa=['where','attributes','limit','include','map','model','ShowChatQueue','find','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','info','ChatQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','GetChatQueue','ChatQueue','findAll','options'];(function(_0x1a8469,_0x2ffccf){var _0x19c2dd=function(_0x5e18c1){while(--_0x5e18c1){_0x1a8469['push'](_0x1a8469['shift']());}};_0x19c2dd(++_0x2ffccf);}(_0x53aa,0x167));var _0xa53a=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0x53aa[_0x3070dc];return _0x431489;};'use strict';var _=require(_0xa53a('0x0'));var util=require(_0xa53a('0x1'));var moment=require(_0xa53a('0x2'));var BPromise=require(_0xa53a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa53a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa53a('0x5'))(_0xa53a('0x6'));var config=require(_0xa53a('0x7'));var jayson=require(_0xa53a('0x8'));var client=jayson[_0xa53a('0x9')]['http']({'port':0x232a});config[_0xa53a('0xa')]=_[_0xa53a('0xb')](config['redis'],{'host':_0xa53a('0xc'),'port':0x18eb});var socket=require(_0xa53a('0xd'))(new Redis(config[_0xa53a('0xa')]));require('./chatQueue.socket')[_0xa53a('0xe')](socket);function respondWithRpcPromise(_0x5785a9,_0x422fb3,_0x1a79a1){return new BPromise(function(_0x40bd10,_0x5d1e46){return client[_0xa53a('0xf')](_0x5785a9,_0x1a79a1)[_0xa53a('0x10')](function(_0x18eba9){logger[_0xa53a('0x11')](_0xa53a('0x12'),_0x422fb3,'request\x20sent');logger[_0xa53a('0x13')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x422fb3,_0xa53a('0x14'),JSON[_0xa53a('0x15')](_0x18eba9));if(_0x18eba9[_0xa53a('0x16')]){if(_0x18eba9[_0xa53a('0x16')][_0xa53a('0x17')]===0x1f4){logger[_0xa53a('0x16')](_0xa53a('0x12'),_0x422fb3,_0x18eba9[_0xa53a('0x16')][_0xa53a('0x18')]);return _0x5d1e46(_0x18eba9[_0xa53a('0x16')][_0xa53a('0x18')]);}logger[_0xa53a('0x16')]('ChatQueue,\x20%s,\x20%s',_0x422fb3,_0x18eba9[_0xa53a('0x16')][_0xa53a('0x18')]);return _0x40bd10(_0x18eba9['error'][_0xa53a('0x18')]);}else{logger[_0xa53a('0x11')](_0xa53a('0x12'),_0x422fb3,_0xa53a('0x14'));_0x40bd10(_0x18eba9[_0xa53a('0x19')][_0xa53a('0x18')]);}})[_0xa53a('0x1a')](function(_0x344350){logger[_0xa53a('0x16')](_0xa53a('0x12'),_0x422fb3,_0x344350);_0x5d1e46(_0x344350);});});}exports[_0xa53a('0x1b')]=function(_0x1a50bd){var _0x2311ba=this;return new Promise(function(_0xaecd04,_0x584c4e){return db[_0xa53a('0x1c')][_0xa53a('0x1d')]({'raw':_0x1a50bd['options']?_0x1a50bd[_0xa53a('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x1a50bd[_0xa53a('0x1e')]?_0x1a50bd[_0xa53a('0x1e')][_0xa53a('0x1f')]||null:null,'attributes':_0x1a50bd[_0xa53a('0x1e')]?_0x1a50bd[_0xa53a('0x1e')][_0xa53a('0x20')]||null:null,'limit':_0x1a50bd['options']?_0x1a50bd[_0xa53a('0x1e')][_0xa53a('0x21')]||null:null,'include':_0x1a50bd['options']?_0x1a50bd[_0xa53a('0x1e')][_0xa53a('0x22')]?_[_0xa53a('0x23')](_0x1a50bd[_0xa53a('0x1e')][_0xa53a('0x22')],function(_0x401aae){return{'model':db[_0x401aae[_0xa53a('0x24')]],'as':_0x401aae['as'],'attributes':_0x401aae['attributes'],'include':_0x401aae['include']?_[_0xa53a('0x23')](_0x401aae[_0xa53a('0x22')],function(_0x512d96){return{'model':db[_0x512d96[_0xa53a('0x24')]],'as':_0x512d96['as'],'attributes':_0x512d96[_0xa53a('0x20')],'include':_0x512d96[_0xa53a('0x22')]?_[_0xa53a('0x23')](_0x512d96[_0xa53a('0x22')],function(_0x1e796b){return{'model':db[_0x1e796b['model']],'as':_0x1e796b['as'],'attributes':_0x1e796b[_0xa53a('0x20')]};}):[]};}):[]};}):[]:[]})[_0xa53a('0x10')](function(_0xde3502){logger['info']('GetChatQueue',_0x1a50bd);logger[_0xa53a('0x13')](_0xa53a('0x1b'),_0x1a50bd,JSON[_0xa53a('0x15')](_0xde3502));_0xaecd04(_0xde3502);})['catch'](function(_0x2d78eb){logger[_0xa53a('0x16')](_0xa53a('0x1b'),_0x2d78eb[_0xa53a('0x18')],_0x1a50bd);_0x584c4e(_0x2311ba['error'](0x1f4,_0x2d78eb['message']));});});};exports[_0xa53a('0x25')]=function(_0x25d4f3){var _0x22d998=this;return new Promise(function(_0x315dc6,_0x3461ae){return db[_0xa53a('0x1c')][_0xa53a('0x26')]({'raw':_0x25d4f3[_0xa53a('0x1e')]?_0x25d4f3[_0xa53a('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x25d4f3[_0xa53a('0x1e')]?_0x25d4f3['options'][_0xa53a('0x1f')]||null:null,'attributes':_0x25d4f3[_0xa53a('0x1e')]?_0x25d4f3[_0xa53a('0x1e')][_0xa53a('0x20')]||null:null,'include':_0x25d4f3[_0xa53a('0x1e')]?_0x25d4f3[_0xa53a('0x1e')][_0xa53a('0x22')]?_[_0xa53a('0x23')](_0x25d4f3[_0xa53a('0x1e')]['include'],function(_0x351860){return{'model':db[_0x351860['model']],'as':_0x351860['as'],'attributes':_0x351860['attributes'],'include':_0x351860[_0xa53a('0x22')]?_[_0xa53a('0x23')](_0x351860[_0xa53a('0x22')],function(_0x4993df){return{'model':db[_0x4993df[_0xa53a('0x24')]],'as':_0x4993df['as'],'attributes':_0x4993df['attributes'],'include':_0x4993df[_0xa53a('0x22')]?_[_0xa53a('0x23')](_0x4993df['include'],function(_0x295898){return{'model':db[_0x295898[_0xa53a('0x24')]],'as':_0x295898['as'],'attributes':_0x295898[_0xa53a('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x109276){logger[_0xa53a('0x11')]('ShowChatQueue',_0x25d4f3);logger[_0xa53a('0x13')](_0xa53a('0x25'),_0x25d4f3,JSON[_0xa53a('0x15')](_0x109276));_0x315dc6(_0x109276);})[_0xa53a('0x1a')](function(_0x13dc01){logger['error'](_0xa53a('0x25'),_0x13dc01[_0xa53a('0x18')],_0x25d4f3);_0x3461ae(_0x22d998['error'](0x1f4,_0x13dc01[_0xa53a('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 14cc683..4303af0 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 _0xda55=['chatQueue:','./chatQueue.events','save','emit','removeListener','length'];(function(_0x409416,_0x26d390){var _0x5aa3a0=function(_0x3c285c){while(--_0x3c285c){_0x409416['push'](_0x409416['shift']());}};_0x5aa3a0(++_0x26d390);}(_0xda55,0x6d));var _0x5da5=function(_0x5c0b22,_0x56d46a){_0x5c0b22=_0x5c0b22-0x0;var _0x16a8a6=_0xda55[_0x5c0b22];return _0x16a8a6;};'use strict';var ChatQueueEvents=require(_0x5da5('0x0'));var events=[_0x5da5('0x1'),'remove','update'];function createListener(_0x13ecbc,_0x240a49){return function(_0x26a443){_0x240a49[_0x5da5('0x2')](_0x13ecbc,_0x26a443);};}function removeListener(_0x1c3afd,_0x5da254){return function(){ChatQueueEvents[_0x5da5('0x3')](_0x1c3afd,_0x5da254);};}exports['register']=function(_0x356a37){for(var _0x58e7b3=0x0,_0x2fd877=events[_0x5da5('0x4')];_0x58e7b3<_0x2fd877;_0x58e7b3++){var _0x71b187=events[_0x58e7b3];var _0x46290d=createListener(_0x5da5('0x5')+_0x71b187,_0x356a37);ChatQueueEvents['on'](_0x71b187,_0x46290d);}}; \ No newline at end of file +var _0x9bde=['chatQueue:','save','update','emit','removeListener','register','length'];(function(_0x4ef734,_0x5826d){var _0x33a7cb=function(_0x127a2b){while(--_0x127a2b){_0x4ef734['push'](_0x4ef734['shift']());}};_0x33a7cb(++_0x5826d);}(_0x9bde,0xe1));var _0xe9bd=function(_0x53ff2e,_0x4aa0c7){_0x53ff2e=_0x53ff2e-0x0;var _0x1cfc81=_0x9bde[_0x53ff2e];return _0x1cfc81;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0xe9bd('0x0'),'remove',_0xe9bd('0x1')];function createListener(_0x4c63ca,_0x51786f){return function(_0x3005aa){_0x51786f[_0xe9bd('0x2')](_0x4c63ca,_0x3005aa);};}function removeListener(_0x1c1b34,_0x10822d){return function(){ChatQueueEvents[_0xe9bd('0x3')](_0x1c1b34,_0x10822d);};}exports[_0xe9bd('0x4')]=function(_0x4fd7b8){for(var _0x4763e9=0x0,_0x5f18fe=events[_0xe9bd('0x5')];_0x4763e9<_0x5f18fe;_0x4763e9++){var _0xa66ae2=events[_0x4763e9];var _0x2d5c75=createListener(_0xe9bd('0x6')+_0xa66ae2,_0x4fd7b8);ChatQueueEvents['on'](_0xa66ae2,_0x2d5c75);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 874c00e..92345e9 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(_0xf8c661,_0x419a83){var _0x32589b=function(_0x5f3b4f){while(--_0x5f3b4f){_0xf8c661['push'](_0xf8c661['shift']());}};_0x32589b(++_0x419a83);}(_0x008c,0x188));var _0xc008=function(_0x20e5e2,_0x57c3b1){_0x20e5e2=_0x20e5e2-0x0;var _0x803951=_0x008c[_0x20e5e2];return _0x803951;};'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 _0x3e74=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','getAgents','post','addTeams','addAgents','put','delete','removeTeams','/:id/users','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x3e74,0x175));var _0x43e7=function(_0x3e9e57,_0x28a34c){_0x3e9e57=_0x3e9e57-0x0;var _0xf7c9fd=_0x3e74[_0x3e9e57];return _0xf7c9fd;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/members',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x13')]);router['post']('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router[_0x43e7('0x15')](_0x43e7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x43e7('0x16')](_0x43e7('0xc'),auth[_0x43e7('0x8')](),controller['destroy']);router['delete'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x17')]);router[_0x43e7('0x16')](_0x43e7('0x18'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x19')]);module[_0x43e7('0x1a')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 0725f47..3ffde6c 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 _0x9123=['DATE','sequelize','exports','STRING'];(function(_0x4301f5,_0x25b02a){var _0x2fd3d2=function(_0x284afb){while(--_0x284afb){_0x4301f5['push'](_0x4301f5['shift']());}};_0x2fd3d2(++_0x25b02a);}(_0x9123,0x119));var _0x3912=function(_0x56a53a,_0x4f74f1){_0x56a53a=_0x56a53a-0x0;var _0x4ab5ee=_0x9123[_0x56a53a];return _0x4ab5ee;};'use strict';var moment=require('moment');var Sequelize=require(_0x3912('0x0'));module[_0x3912('0x1')]={'uniqueid':{'type':Sequelize[_0x3912('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x3912('0x2')]},'joinAt':{'type':Sequelize[_0x3912('0x3')]},'leaveAt':{'type':Sequelize[_0x3912('0x3')]},'acceptAt':{'type':Sequelize[_0x3912('0x3')]},'exitAt':{'type':Sequelize[_0x3912('0x3')]},'reason':{'type':Sequelize[_0x3912('0x2')]}}; \ No newline at end of file +var _0x02b2=['STRING','DATE','moment','sequelize','exports'];(function(_0x56e311,_0x110a84){var _0x1f6451=function(_0x3f2c8f){while(--_0x3f2c8f){_0x56e311['push'](_0x56e311['shift']());}};_0x1f6451(++_0x110a84);}(_0x02b2,0x1b5));var _0x202b=function(_0x282fc6,_0x255c25){_0x282fc6=_0x282fc6-0x0;var _0x132425=_0x02b2[_0x282fc6];return _0x132425;};'use strict';var moment=require(_0x202b('0x0'));var Sequelize=require(_0x202b('0x1'));module[_0x202b('0x2')]={'uniqueid':{'type':Sequelize[_0x202b('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x202b('0x3')]},'joinAt':{'type':Sequelize[_0x202b('0x4')]},'leaveAt':{'type':Sequelize[_0x202b('0x4')]},'acceptAt':{'type':Sequelize[_0x202b('0x4')]},'exitAt':{'type':Sequelize[_0x202b('0x4')]},'reason':{'type':Sequelize[_0x202b('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 9b3347f..6a06aec 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 _0x4c60=['../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','then','destroy','end','error','stack','name','index','map','ChatQueueReport','rawAttributes','key','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','catch','show','includeAll','find','create','update','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util'];(function(_0x54f6a6,_0xde810f){var _0x37a293=function(_0x3dad2c){while(--_0x3dad2c){_0x54f6a6['push'](_0x54f6a6['shift']());}};_0x37a293(++_0xde810f);}(_0x4c60,0xc1));var _0x04c6=function(_0x4fb6e2,_0x16933b){_0x4fb6e2=_0x4fb6e2-0x0;var _0x52127c=_0x4c60[_0x4fb6e2];return _0x52127c;};'use strict';var emlformat=require(_0x04c6('0x0'));var rimraf=require(_0x04c6('0x1'));var zipdir=require(_0x04c6('0x2'));var jsonpatch=require(_0x04c6('0x3'));var rp=require('request-promise');var moment=require(_0x04c6('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x04c6('0x5'));var csv=require(_0x04c6('0x6'));var ejs=require(_0x04c6('0x7'));var fs=require('fs');var fs_extra=require(_0x04c6('0x8'));var _=require(_0x04c6('0x9'));var squel=require(_0x04c6('0xa'));var crypto=require(_0x04c6('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x04c6('0xc'));var toCsv=require(_0x04c6('0x6'));var querystring=require(_0x04c6('0xd'));var Papa=require(_0x04c6('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x04c6('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x04c6('0x10'))(_0x04c6('0x11'));var utils=require('../../config/utils');var config=require(_0x04c6('0x12'));var licenseUtil=require(_0x04c6('0x13'));var db=require(_0x04c6('0x14'))['db'];function respondWithStatusCode(_0x4e5e6,_0x52cdcf){_0x52cdcf=_0x52cdcf||0xcc;return function(_0x257a0a){if(_0x257a0a){return _0x4e5e6[_0x04c6('0x15')](_0x52cdcf);}return _0x4e5e6[_0x04c6('0x16')](_0x52cdcf)['end']();};}function respondWithResult(_0x12d1c5,_0x15cbe0){_0x15cbe0=_0x15cbe0||0xc8;return function(_0x28632e){if(_0x28632e){return _0x12d1c5[_0x04c6('0x16')](_0x15cbe0)[_0x04c6('0x17')](_0x28632e);}};}function respondWithFilteredResult(_0x19a26f,_0x1cd963){return function(_0x3d46a9){if(_0x3d46a9){var _0x5a5a66=typeof _0x1cd963[_0x04c6('0x18')]===_0x04c6('0x19')&&typeof _0x1cd963[_0x04c6('0x1a')]===_0x04c6('0x19');var _0x43596a=_0x3d46a9[_0x04c6('0x1b')];var _0x21674a=_0x5a5a66?0x0:_0x1cd963[_0x04c6('0x18')];var _0x47f400=_0x5a5a66?_0x3d46a9[_0x04c6('0x1b')]:_0x1cd963[_0x04c6('0x18')]+_0x1cd963[_0x04c6('0x1a')];var _0x558b43;if(_0x47f400>=_0x43596a){_0x47f400=_0x43596a;_0x558b43=0xc8;}else{_0x558b43=0xce;}_0x19a26f['status'](_0x558b43);return _0x19a26f['set'](_0x04c6('0x1c'),_0x21674a+'-'+_0x47f400+'/'+_0x43596a)[_0x04c6('0x17')](_0x3d46a9);}return null;};}function patchUpdates(_0x50dd61){return function(_0x5a5e9e){try{jsonpatch[_0x04c6('0x1d')](_0x5a5e9e,_0x50dd61,!![]);}catch(_0x2eed94){return BPromise[_0x04c6('0x1e')](_0x2eed94);}return _0x5a5e9e['save']();};}function saveUpdates(_0x33a0f7,_0x13f2dc){return function(_0x9d41f8){if(_0x9d41f8){return _0x9d41f8['update'](_0x33a0f7)[_0x04c6('0x1f')](function(_0x41e29f){return _0x41e29f;});}return null;};}function removeEntity(_0x562491,_0x54a8b0){return function(_0x4c8d72){if(_0x4c8d72){return _0x4c8d72[_0x04c6('0x20')]()[_0x04c6('0x1f')](function(){_0x562491[_0x04c6('0x16')](0xcc)[_0x04c6('0x21')]();});}};}function handleEntityNotFound(_0x3e1328,_0x52e5f5){return function(_0x562952){if(!_0x562952){_0x3e1328[_0x04c6('0x15')](0x194);}return _0x562952;};}function handleError(_0x2ab1d2,_0x9acfa){_0x9acfa=_0x9acfa||0x1f4;return function(_0x3233d7){logger[_0x04c6('0x22')](_0x3233d7[_0x04c6('0x23')]);if(_0x3233d7['name']){delete _0x3233d7[_0x04c6('0x24')];}_0x2ab1d2[_0x04c6('0x16')](_0x9acfa)['send'](_0x3233d7);};}exports[_0x04c6('0x25')]=function(_0x1cd16a,_0x5f1331){var _0x5c9003={},_0x115d84={},_0x3a6d92={'count':0x0,'rows':[]};var _0x2a191f=_[_0x04c6('0x26')](db[_0x04c6('0x27')][_0x04c6('0x28')],function(_0x49c4ed){return{'name':_0x49c4ed['fieldName'],'type':_0x49c4ed['type'][_0x04c6('0x29')]};});_0x115d84['model']=_[_0x04c6('0x26')](_0x2a191f,_0x04c6('0x24'));_0x115d84['query']=_[_0x04c6('0x2a')](_0x1cd16a[_0x04c6('0x2b')]);_0x115d84[_0x04c6('0x2c')]=_[_0x04c6('0x2d')](_0x115d84['model'],_0x115d84[_0x04c6('0x2b')]);_0x5c9003[_0x04c6('0x2e')]=_[_0x04c6('0x2d')](_0x115d84[_0x04c6('0x2f')],qs[_0x04c6('0x30')](_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x30')]));_0x5c9003[_0x04c6('0x2e')]=_0x5c9003[_0x04c6('0x2e')][_0x04c6('0x31')]?_0x5c9003[_0x04c6('0x2e')]:_0x115d84[_0x04c6('0x2f')];if(!_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x32')](_0x04c6('0x33'))){_0x5c9003['limit']=qs[_0x04c6('0x1a')](_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x1a')]);_0x5c9003[_0x04c6('0x18')]=qs['offset'](_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x18')]);}_0x5c9003['order']=qs['sort'](_0x1cd16a['query'][_0x04c6('0x34')]);_0x5c9003[_0x04c6('0x35')]=qs['filters'](_[_0x04c6('0x36')](_0x1cd16a['query'],_0x115d84[_0x04c6('0x2c')]),_0x2a191f);if(_0x1cd16a[_0x04c6('0x2b')][_0x04c6('0x37')]){_0x5c9003[_0x04c6('0x35')]=_['merge'](_0x5c9003['where'],{'$or':_[_0x04c6('0x26')](_0x2a191f,function(_0x3a9a3b){if(_0x3a9a3b['type']!==_0x04c6('0x38')){var _0x5ce4b0={};_0x5ce4b0[_0x3a9a3b['name']]={'$like':'%'+_0x1cd16a[_0x04c6('0x2b')]['filter']+'%'};return _0x5ce4b0;}})});}_0x5c9003=_[_0x04c6('0x39')]({},_0x5c9003,_0x1cd16a[_0x04c6('0x3a')]);var _0x59ca18={'where':_0x5c9003[_0x04c6('0x35')]};return db['ChatQueueReport'][_0x04c6('0x1b')](_0x59ca18)[_0x04c6('0x1f')](function(_0x2d83eb){_0x3a6d92[_0x04c6('0x1b')]=_0x2d83eb;if(_0x1cd16a[_0x04c6('0x2b')]['includeAll']){_0x5c9003[_0x04c6('0x3b')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x04c6('0x3c')](_0x5c9003);})['then'](function(_0x1f7ead){_0x3a6d92[_0x04c6('0x3d')]=_0x1f7ead;return _0x3a6d92;})[_0x04c6('0x1f')](respondWithFilteredResult(_0x5f1331,_0x5c9003))[_0x04c6('0x3e')](handleError(_0x5f1331,null));};exports[_0x04c6('0x3f')]=function(_0x2cdf34,_0x40477f){var _0x4a3c45={'raw':!![],'where':{'id':_0x2cdf34['params']['id']}},_0xdfdc34={};_0xdfdc34[_0x04c6('0x2f')]=_['keys'](db['ChatQueueReport'][_0x04c6('0x28')]);_0xdfdc34['query']=_[_0x04c6('0x2a')](_0x2cdf34[_0x04c6('0x2b')]);_0xdfdc34[_0x04c6('0x2c')]=_['intersection'](_0xdfdc34[_0x04c6('0x2f')],_0xdfdc34[_0x04c6('0x2b')]);_0x4a3c45[_0x04c6('0x2e')]=_[_0x04c6('0x2d')](_0xdfdc34[_0x04c6('0x2f')],qs[_0x04c6('0x30')](_0x2cdf34[_0x04c6('0x2b')]['fields']));_0x4a3c45['attributes']=_0x4a3c45[_0x04c6('0x2e')][_0x04c6('0x31')]?_0x4a3c45[_0x04c6('0x2e')]:_0xdfdc34['model'];if(_0x2cdf34[_0x04c6('0x2b')][_0x04c6('0x40')]){_0x4a3c45[_0x04c6('0x3b')]=[{'all':!![]}];}_0x4a3c45=_['merge']({},_0x4a3c45,_0x2cdf34['options']);return db['ChatQueueReport'][_0x04c6('0x41')](_0x4a3c45)[_0x04c6('0x1f')](handleEntityNotFound(_0x40477f,null))['then'](respondWithResult(_0x40477f,null))[_0x04c6('0x3e')](handleError(_0x40477f,null));};exports[_0x04c6('0x42')]=function(_0x2bd045,_0x4ef366){return db[_0x04c6('0x27')][_0x04c6('0x42')](_0x2bd045['body'],{})[_0x04c6('0x1f')](respondWithResult(_0x4ef366,0xc9))[_0x04c6('0x3e')](handleError(_0x4ef366,null));};exports[_0x04c6('0x43')]=function(_0xee2822,_0x4cfde2){if(_0xee2822[_0x04c6('0x44')]['id']){delete _0xee2822[_0x04c6('0x44')]['id'];}return db[_0x04c6('0x27')][_0x04c6('0x41')]({'where':{'id':_0xee2822['params']['id']}})[_0x04c6('0x1f')](handleEntityNotFound(_0x4cfde2,null))[_0x04c6('0x1f')](saveUpdates(_0xee2822[_0x04c6('0x44')],null))[_0x04c6('0x1f')](respondWithResult(_0x4cfde2,null))['catch'](handleError(_0x4cfde2,null));};exports[_0x04c6('0x20')]=function(_0x42273e,_0x15ec61){return db['ChatQueueReport'][_0x04c6('0x41')]({'where':{'id':_0x42273e[_0x04c6('0x45')]['id']}})[_0x04c6('0x1f')](handleEntityNotFound(_0x15ec61,null))[_0x04c6('0x1f')](removeEntity(_0x15ec61,null))[_0x04c6('0x3e')](handleError(_0x15ec61,null));};exports[_0x04c6('0x46')]=function(_0x1b8fa4,_0x160f91){return db[_0x04c6('0x27')][_0x04c6('0x46')]()[_0x04c6('0x1f')](respondWithResult(_0x160f91,null))[_0x04c6('0x3e')](handleError(_0x160f91,null));}; \ No newline at end of file +var _0x0e76=['util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','sendStatus','end','json','limit','count','offset','status','set','Content-Range','reject','update','then','destroy','error','stack','name','send','index','ChatQueueReport','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','order','sort','filter','merge','where','VIRTUAL','options','includeAll','include','catch','show','params','rawAttributes','find','body','describe','eml-format','fast-json-patch','moment','bluebird','mustache'];(function(_0x16f775,_0x45b10f){var _0x17d9e2=function(_0x3d2ccf){while(--_0x3d2ccf){_0x16f775['push'](_0x16f775['shift']());}};_0x17d9e2(++_0x45b10f);}(_0x0e76,0xc4));var _0x60e7=function(_0x4d6624,_0x78b606){_0x4d6624=_0x4d6624-0x0;var _0x5dbb01=_0x0e76[_0x4d6624];return _0x5dbb01;};'use strict';var emlformat=require(_0x60e7('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x60e7('0x1'));var rp=require('request-promise');var moment=require(_0x60e7('0x2'));var BPromise=require(_0x60e7('0x3'));var Mustache=require(_0x60e7('0x4'));var util=require(_0x60e7('0x5'));var path=require(_0x60e7('0x6'));var sox=require('sox');var csv=require(_0x60e7('0x7'));var ejs=require(_0x60e7('0x8'));var fs=require('fs');var fs_extra=require(_0x60e7('0x9'));var _=require(_0x60e7('0xa'));var squel=require(_0x60e7('0xb'));var crypto=require(_0x60e7('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x60e7('0xd'));var toCsv=require(_0x60e7('0x7'));var querystring=require(_0x60e7('0xe'));var Papa=require('papaparse');var Redis=require(_0x60e7('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x60e7('0x10'));var as=require(_0x60e7('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x60e7('0x12'))('api');var utils=require(_0x60e7('0x13'));var config=require(_0x60e7('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d43cd,_0x274959){_0x274959=_0x274959||0xcc;return function(_0x243280){if(_0x243280){return _0x3d43cd[_0x60e7('0x15')](_0x274959);}return _0x3d43cd['status'](_0x274959)[_0x60e7('0x16')]();};}function respondWithResult(_0x4ff2fe,_0x1d4c68){_0x1d4c68=_0x1d4c68||0xc8;return function(_0x1d97a5){if(_0x1d97a5){return _0x4ff2fe['status'](_0x1d4c68)[_0x60e7('0x17')](_0x1d97a5);}};}function respondWithFilteredResult(_0x589b22,_0x25bcd9){return function(_0x388cd8){if(_0x388cd8){var _0xbe8f55=typeof _0x25bcd9['offset']==='undefined'&&typeof _0x25bcd9[_0x60e7('0x18')]==='undefined';var _0x22c978=_0x388cd8[_0x60e7('0x19')];var _0x2a136a=_0xbe8f55?0x0:_0x25bcd9[_0x60e7('0x1a')];var _0x54a701=_0xbe8f55?_0x388cd8[_0x60e7('0x19')]:_0x25bcd9['offset']+_0x25bcd9[_0x60e7('0x18')];var _0x128ef1;if(_0x54a701>=_0x22c978){_0x54a701=_0x22c978;_0x128ef1=0xc8;}else{_0x128ef1=0xce;}_0x589b22[_0x60e7('0x1b')](_0x128ef1);return _0x589b22[_0x60e7('0x1c')](_0x60e7('0x1d'),_0x2a136a+'-'+_0x54a701+'/'+_0x22c978)[_0x60e7('0x17')](_0x388cd8);}return null;};}function patchUpdates(_0x2c602d){return function(_0x878467){try{jsonpatch['apply'](_0x878467,_0x2c602d,!![]);}catch(_0x3dfbce){return BPromise[_0x60e7('0x1e')](_0x3dfbce);}return _0x878467['save']();};}function saveUpdates(_0x3841f2,_0x507a9b){return function(_0x3d8a3b){if(_0x3d8a3b){return _0x3d8a3b[_0x60e7('0x1f')](_0x3841f2)[_0x60e7('0x20')](function(_0x334bd9){return _0x334bd9;});}return null;};}function removeEntity(_0x40c7b0,_0x4258a2){return function(_0x54e17b){if(_0x54e17b){return _0x54e17b[_0x60e7('0x21')]()[_0x60e7('0x20')](function(){_0x40c7b0[_0x60e7('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a0605,_0x3ecb2e){return function(_0x34da5e){if(!_0x34da5e){_0x4a0605[_0x60e7('0x15')](0x194);}return _0x34da5e;};}function handleError(_0xda9aa1,_0x598fb2){_0x598fb2=_0x598fb2||0x1f4;return function(_0x3c8084){logger[_0x60e7('0x22')](_0x3c8084[_0x60e7('0x23')]);if(_0x3c8084[_0x60e7('0x24')]){delete _0x3c8084[_0x60e7('0x24')];}_0xda9aa1['status'](_0x598fb2)[_0x60e7('0x25')](_0x3c8084);};}exports[_0x60e7('0x26')]=function(_0x24896b,_0xebd04c){var _0x9f4c09={},_0x311c17={},_0x532ab2={'count':0x0,'rows':[]};var _0xdc50fe=_['map'](db[_0x60e7('0x27')]['rawAttributes'],function(_0xdd5824){return{'name':_0xdd5824[_0x60e7('0x28')],'type':_0xdd5824[_0x60e7('0x29')][_0x60e7('0x2a')]};});_0x311c17[_0x60e7('0x2b')]=_[_0x60e7('0x2c')](_0xdc50fe,_0x60e7('0x24'));_0x311c17['query']=_[_0x60e7('0x2d')](_0x24896b['query']);_0x311c17[_0x60e7('0x2e')]=_[_0x60e7('0x2f')](_0x311c17[_0x60e7('0x2b')],_0x311c17[_0x60e7('0x30')]);_0x9f4c09[_0x60e7('0x31')]=_[_0x60e7('0x2f')](_0x311c17[_0x60e7('0x2b')],qs[_0x60e7('0x32')](_0x24896b['query'][_0x60e7('0x32')]));_0x9f4c09['attributes']=_0x9f4c09[_0x60e7('0x31')]['length']?_0x9f4c09['attributes']:_0x311c17['model'];if(!_0x24896b['query']['hasOwnProperty']('nolimit')){_0x9f4c09['limit']=qs[_0x60e7('0x18')](_0x24896b['query'][_0x60e7('0x18')]);_0x9f4c09[_0x60e7('0x1a')]=qs[_0x60e7('0x1a')](_0x24896b[_0x60e7('0x30')][_0x60e7('0x1a')]);}_0x9f4c09[_0x60e7('0x33')]=qs[_0x60e7('0x34')](_0x24896b[_0x60e7('0x30')][_0x60e7('0x34')]);_0x9f4c09['where']=qs[_0x60e7('0x2e')](_['pick'](_0x24896b[_0x60e7('0x30')],_0x311c17[_0x60e7('0x2e')]),_0xdc50fe);if(_0x24896b[_0x60e7('0x30')][_0x60e7('0x35')]){_0x9f4c09['where']=_[_0x60e7('0x36')](_0x9f4c09[_0x60e7('0x37')],{'$or':_[_0x60e7('0x2c')](_0xdc50fe,function(_0x1747e3){if(_0x1747e3[_0x60e7('0x29')]!==_0x60e7('0x38')){var _0x4c48f3={};_0x4c48f3[_0x1747e3[_0x60e7('0x24')]]={'$like':'%'+_0x24896b[_0x60e7('0x30')][_0x60e7('0x35')]+'%'};return _0x4c48f3;}})});}_0x9f4c09=_[_0x60e7('0x36')]({},_0x9f4c09,_0x24896b[_0x60e7('0x39')]);var _0x388187={'where':_0x9f4c09[_0x60e7('0x37')]};return db[_0x60e7('0x27')][_0x60e7('0x19')](_0x388187)[_0x60e7('0x20')](function(_0x2b949f){_0x532ab2[_0x60e7('0x19')]=_0x2b949f;if(_0x24896b[_0x60e7('0x30')][_0x60e7('0x3a')]){_0x9f4c09[_0x60e7('0x3b')]=[{'all':!![]}];}return db['ChatQueueReport']['findAll'](_0x9f4c09);})[_0x60e7('0x20')](function(_0x2899c0){_0x532ab2['rows']=_0x2899c0;return _0x532ab2;})[_0x60e7('0x20')](respondWithFilteredResult(_0xebd04c,_0x9f4c09))[_0x60e7('0x3c')](handleError(_0xebd04c,null));};exports[_0x60e7('0x3d')]=function(_0x2ec96e,_0x5dc8ce){var _0x16df05={'raw':!![],'where':{'id':_0x2ec96e[_0x60e7('0x3e')]['id']}},_0x186552={};_0x186552[_0x60e7('0x2b')]=_['keys'](db[_0x60e7('0x27')][_0x60e7('0x3f')]);_0x186552[_0x60e7('0x30')]=_[_0x60e7('0x2d')](_0x2ec96e[_0x60e7('0x30')]);_0x186552[_0x60e7('0x2e')]=_[_0x60e7('0x2f')](_0x186552[_0x60e7('0x2b')],_0x186552['query']);_0x16df05[_0x60e7('0x31')]=_[_0x60e7('0x2f')](_0x186552[_0x60e7('0x2b')],qs['fields'](_0x2ec96e[_0x60e7('0x30')][_0x60e7('0x32')]));_0x16df05['attributes']=_0x16df05[_0x60e7('0x31')]['length']?_0x16df05[_0x60e7('0x31')]:_0x186552['model'];if(_0x2ec96e[_0x60e7('0x30')]['includeAll']){_0x16df05[_0x60e7('0x3b')]=[{'all':!![]}];}_0x16df05=_[_0x60e7('0x36')]({},_0x16df05,_0x2ec96e[_0x60e7('0x39')]);return db[_0x60e7('0x27')][_0x60e7('0x40')](_0x16df05)[_0x60e7('0x20')](handleEntityNotFound(_0x5dc8ce,null))[_0x60e7('0x20')](respondWithResult(_0x5dc8ce,null))[_0x60e7('0x3c')](handleError(_0x5dc8ce,null));};exports['create']=function(_0x16762a,_0x46fe16){return db['ChatQueueReport']['create'](_0x16762a[_0x60e7('0x41')],{})['then'](respondWithResult(_0x46fe16,0xc9))[_0x60e7('0x3c')](handleError(_0x46fe16,null));};exports['update']=function(_0x59fef9,_0x52911b){if(_0x59fef9[_0x60e7('0x41')]['id']){delete _0x59fef9[_0x60e7('0x41')]['id'];}return db['ChatQueueReport']['find']({'where':{'id':_0x59fef9['params']['id']}})[_0x60e7('0x20')](handleEntityNotFound(_0x52911b,null))[_0x60e7('0x20')](saveUpdates(_0x59fef9[_0x60e7('0x41')],null))[_0x60e7('0x20')](respondWithResult(_0x52911b,null))[_0x60e7('0x3c')](handleError(_0x52911b,null));};exports[_0x60e7('0x21')]=function(_0x2c574d,_0x1a334d){return db['ChatQueueReport']['find']({'where':{'id':_0x2c574d[_0x60e7('0x3e')]['id']}})['then'](handleEntityNotFound(_0x1a334d,null))[_0x60e7('0x20')](removeEntity(_0x1a334d,null))[_0x60e7('0x3c')](handleError(_0x1a334d,null));};exports[_0x60e7('0x42')]=function(_0x13e25e,_0x4cd92c){return db['ChatQueueReport']['describe']()['then'](respondWithResult(_0x4cd92c,null))[_0x60e7('0x3c')](handleError(_0x4cd92c,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index a10da8a..deb8c7b 100644 --- a/server/api/chatQueueReport/chatQueueReport.model.js +++ b/server/api/chatQueueReport/chatQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','lodash'];(function(_0x7f3667,_0x30c3f1){var _0x2c4c24=function(_0xf070f3){while(--_0xf070f3){_0x7f3667['push'](_0x7f3667['shift']());}};_0x2c4c24(++_0x30c3f1);}(_0xb10b,0x12a));var _0xbb10=function(_0x5dbc86,_0xcdbb86){_0x5dbc86=_0x5dbc86-0x0;var _0x1f80e3=_0xb10b[_0x5dbc86];return _0x1f80e3;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('ChatQueueReport',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[{'name':_0xbb10('0xc'),'fields':[_0xbb10('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x29173b,_0x31c7f6){var _0xb3f709=function(_0x5f0ce4){while(--_0x5f0ce4){_0x29173b['push'](_0x29173b['shift']());}};_0xb3f709(++_0x31c7f6);}(_0x757a,0xde));var _0xa757=function(_0x29c3e3,_0x5a9636){_0x29c3e3=_0x29c3e3-0x0;var _0x3973b6=_0x757a[_0x29c3e3];return _0x3973b6;};'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 f875cf5..06c8913 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 _0x960f=['request','then','info','ChatQueueReport,\x20%s,\x20%s','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','ChatQueueReport','create','options','raw','CreateChatQueueReport','UpdateChatQueueReport','update','where','attributes','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','client','http'];(function(_0x5c9c66,_0x5b2b0a){var _0x21a30a=function(_0x48b56c){while(--_0x48b56c){_0x5c9c66['push'](_0x5c9c66['shift']());}};_0x21a30a(++_0x5b2b0a);}(_0x960f,0x1a8));var _0xf960=function(_0x52598d,_0x10fb73){_0x52598d=_0x52598d-0x0;var _0x170309=_0x960f[_0x52598d];return _0x170309;};'use strict';var _=require(_0xf960('0x0'));var util=require(_0xf960('0x1'));var moment=require(_0xf960('0x2'));var BPromise=require(_0xf960('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf960('0x4'));var db=require(_0xf960('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf960('0x6'))(_0xf960('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf960('0x8')][_0xf960('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2e776d,_0x50ea12,_0x1b60f4){return new BPromise(function(_0x48d464,_0x45aaaa){return client[_0xf960('0xa')](_0x2e776d,_0x1b60f4)[_0xf960('0xb')](function(_0xb8418){logger[_0xf960('0xc')](_0xf960('0xd'),_0x50ea12,'request\x20sent');logger[_0xf960('0xe')](_0xf960('0xf'),_0x50ea12,_0xf960('0x10'),JSON[_0xf960('0x11')](_0xb8418));if(_0xb8418[_0xf960('0x12')]){if(_0xb8418[_0xf960('0x12')][_0xf960('0x13')]===0x1f4){logger[_0xf960('0x12')](_0xf960('0xd'),_0x50ea12,_0xb8418[_0xf960('0x12')][_0xf960('0x14')]);return _0x45aaaa(_0xb8418[_0xf960('0x12')][_0xf960('0x14')]);}logger[_0xf960('0x12')]('ChatQueueReport,\x20%s,\x20%s',_0x50ea12,_0xb8418['error'][_0xf960('0x14')]);return _0x48d464(_0xb8418[_0xf960('0x12')]['message']);}else{logger[_0xf960('0xc')](_0xf960('0xd'),_0x50ea12,'request\x20sent');_0x48d464(_0xb8418['result'][_0xf960('0x14')]);}})[_0xf960('0x15')](function(_0x357c94){logger[_0xf960('0x12')]('ChatQueueReport,\x20%s,\x20%s',_0x50ea12,_0x357c94);_0x45aaaa(_0x357c94);});});}exports['CreateChatQueueReport']=function(_0x1c923d){var _0x3aff1a=this;return new Promise(function(_0x2f8776,_0x474d94){return db[_0xf960('0x16')][_0xf960('0x17')](_0x1c923d['body'],{'raw':_0x1c923d['options']?_0x1c923d[_0xf960('0x18')][_0xf960('0x19')]===undefined?!![]:![]:!![]})[_0xf960('0xb')](function(_0x372e18){logger[_0xf960('0xc')](_0xf960('0x1a'),_0x1c923d);logger[_0xf960('0xe')](_0xf960('0x1a'),_0x1c923d,JSON[_0xf960('0x11')](_0x372e18));_0x2f8776(_0x372e18);})[_0xf960('0x15')](function(_0x5964f6){logger[_0xf960('0x12')](_0xf960('0x1a'),_0x5964f6[_0xf960('0x14')],_0x1c923d);_0x474d94(_0x3aff1a[_0xf960('0x12')](0x1f4,_0x5964f6[_0xf960('0x14')]));});});};exports[_0xf960('0x1b')]=function(_0x1df44d){var _0x2d78a8=this;return new Promise(function(_0x4e2496,_0x35845f){return db['ChatQueueReport'][_0xf960('0x1c')](_0x1df44d['body'],{'raw':_0x1df44d[_0xf960('0x18')]?_0x1df44d[_0xf960('0x18')][_0xf960('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1df44d['options']?_0x1df44d[_0xf960('0x18')][_0xf960('0x1d')]||null:null,'attributes':_0x1df44d[_0xf960('0x18')]?_0x1df44d['options'][_0xf960('0x1e')]||null:null,'limit':_0x1df44d[_0xf960('0x18')]?_0x1df44d[_0xf960('0x18')]['limit']||null:null})[_0xf960('0xb')](function(_0x51937e){logger['info'](_0xf960('0x1b'),_0x1df44d);logger[_0xf960('0xe')]('UpdateChatQueueReport',_0x1df44d,JSON['stringify'](_0x51937e));_0x4e2496(_0x51937e);})[_0xf960('0x15')](function(_0x3e751f){logger['error'](_0xf960('0x1b'),_0x3e751f[_0xf960('0x14')],_0x1df44d);_0x35845f(_0x2d78a8[_0xf960('0x12')](0x1f4,_0x3e751f[_0xf960('0x14')]));});});}; \ No newline at end of file +var _0x2739=['message','result','catch','CreateChatQueueReport','ChatQueueReport','create','options','then','UpdateChatQueueReport','update','raw','where','attributes','limit','info','lodash','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2739,0x8b));var _0x9273=function(_0x1acbea,_0x52c5b5){_0x1acbea=_0x1acbea-0x0;var _0x5e790a=_0x2739[_0x1acbea];return _0x5e790a;};'use strict';var _=require(_0x9273('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9273('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9273('0x2'));var logger=require(_0x9273('0x3'))('rpc');var config=require(_0x9273('0x4'));var jayson=require(_0x9273('0x5'));var client=jayson[_0x9273('0x6')][_0x9273('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xfe2742,_0x2f56cb,_0x63aa14){return new BPromise(function(_0x5287b2,_0x82109d){return client[_0x9273('0x8')](_0xfe2742,_0x63aa14)['then'](function(_0x538c6f){logger['info'](_0x9273('0x9'),_0x2f56cb,_0x9273('0xa'));logger[_0x9273('0xb')](_0x9273('0xc'),_0x2f56cb,_0x9273('0xa'),JSON[_0x9273('0xd')](_0x538c6f));if(_0x538c6f[_0x9273('0xe')]){if(_0x538c6f[_0x9273('0xe')][_0x9273('0xf')]===0x1f4){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x2f56cb,_0x538c6f[_0x9273('0xe')][_0x9273('0x10')]);return _0x82109d(_0x538c6f[_0x9273('0xe')]['message']);}logger[_0x9273('0xe')]('ChatQueueReport,\x20%s,\x20%s',_0x2f56cb,_0x538c6f['error'][_0x9273('0x10')]);return _0x5287b2(_0x538c6f[_0x9273('0xe')][_0x9273('0x10')]);}else{logger['info'](_0x9273('0x9'),_0x2f56cb,_0x9273('0xa'));_0x5287b2(_0x538c6f[_0x9273('0x11')][_0x9273('0x10')]);}})[_0x9273('0x12')](function(_0x19cfa7){logger[_0x9273('0xe')](_0x9273('0x9'),_0x2f56cb,_0x19cfa7);_0x82109d(_0x19cfa7);});});}exports[_0x9273('0x13')]=function(_0x541da4){var _0x3f555a=this;return new Promise(function(_0x4f33df,_0x399cf4){return db[_0x9273('0x14')][_0x9273('0x15')](_0x541da4['body'],{'raw':_0x541da4['options']?_0x541da4[_0x9273('0x16')]['raw']===undefined?!![]:![]:!![]})[_0x9273('0x17')](function(_0xf612c5){logger['info']('CreateChatQueueReport',_0x541da4);logger[_0x9273('0xb')](_0x9273('0x13'),_0x541da4,JSON[_0x9273('0xd')](_0xf612c5));_0x4f33df(_0xf612c5);})['catch'](function(_0x5cbf21){logger[_0x9273('0xe')](_0x9273('0x13'),_0x5cbf21[_0x9273('0x10')],_0x541da4);_0x399cf4(_0x3f555a[_0x9273('0xe')](0x1f4,_0x5cbf21[_0x9273('0x10')]));});});};exports[_0x9273('0x18')]=function(_0x17b6f4){var _0x2632a5=this;return new Promise(function(_0x28131e,_0x4f42f2){return db[_0x9273('0x14')][_0x9273('0x19')](_0x17b6f4['body'],{'raw':_0x17b6f4[_0x9273('0x16')]?_0x17b6f4[_0x9273('0x16')][_0x9273('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x17b6f4[_0x9273('0x16')]?_0x17b6f4[_0x9273('0x16')][_0x9273('0x1b')]||null:null,'attributes':_0x17b6f4['options']?_0x17b6f4[_0x9273('0x16')][_0x9273('0x1c')]||null:null,'limit':_0x17b6f4[_0x9273('0x16')]?_0x17b6f4['options'][_0x9273('0x1d')]||null:null})[_0x9273('0x17')](function(_0x1dd207){logger[_0x9273('0x1e')](_0x9273('0x18'),_0x17b6f4);logger[_0x9273('0xb')](_0x9273('0x18'),_0x17b6f4,JSON[_0x9273('0xd')](_0x1dd207));_0x28131e(_0x1dd207);})[_0x9273('0x12')](function(_0x255424){logger[_0x9273('0xe')](_0x9273('0x18'),_0x255424[_0x9273('0x10')],_0x17b6f4);_0x4f42f2(_0x2632a5[_0x9273('0xe')](0x1f4,_0x255424[_0x9273('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 5ea5eab..2e3d112 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 _0x9db3=['fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueueReport.controller','get','isAuthenticated','show','create','put','/:id','destroy','exports','express','Router'];(function(_0x5bb818,_0x57780a){var _0xc56b13=function(_0x3de0a8){while(--_0x3de0a8){_0x5bb818['push'](_0x5bb818['shift']());}};_0xc56b13(++_0x57780a);}(_0x9db3,0xd0));var _0x39db=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9db3[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x39db('0x0'));var router=express[_0x39db('0x1')]();var fs_extra=require(_0x39db('0x2'));var auth=require(_0x39db('0x3'));var interaction=require(_0x39db('0x4'));var config=require('../../config/environment');var controller=require(_0x39db('0x5'));router[_0x39db('0x6')]('/',auth[_0x39db('0x7')](),controller['index']);router[_0x39db('0x6')]('/describe',auth[_0x39db('0x7')](),controller['describe']);router['get']('/:id',auth[_0x39db('0x7')](),controller[_0x39db('0x8')]);router['post']('/',auth[_0x39db('0x7')](),controller[_0x39db('0x9')]);router[_0x39db('0xa')](_0x39db('0xb'),auth[_0x39db('0x7')](),controller['update']);router['delete'](_0x39db('0xb'),auth[_0x39db('0x7')](),controller[_0x39db('0xc')]);module[_0x39db('0xd')]=router; \ No newline at end of file +var _0x7f85=['../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','index','/describe','describe','show','isAuthenticated','create','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x47631c,_0x39f5ca){var _0x773db2=function(_0x1dfbbb){while(--_0x1dfbbb){_0x47631c['push'](_0x47631c['shift']());}};_0x773db2(++_0x39f5ca);}(_0x7f85,0x173));var _0x57f8=function(_0x361b7e,_0x2d6399){_0x361b7e=_0x361b7e-0x0;var _0x37448e=_0x7f85[_0x361b7e];return _0x37448e;};'use strict';var multer=require(_0x57f8('0x0'));var util=require(_0x57f8('0x1'));var path=require(_0x57f8('0x2'));var timeout=require(_0x57f8('0x3'));var express=require(_0x57f8('0x4'));var router=express[_0x57f8('0x5')]();var fs_extra=require(_0x57f8('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x57f8('0x7'));var config=require(_0x57f8('0x8'));var controller=require(_0x57f8('0x9'));router[_0x57f8('0xa')]('/',auth['isAuthenticated'](),controller[_0x57f8('0xb')]);router['get'](_0x57f8('0xc'),auth['isAuthenticated'](),controller[_0x57f8('0xd')]);router[_0x57f8('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x57f8('0xe')]);router['post']('/',auth[_0x57f8('0xf')](),controller[_0x57f8('0x10')]);router['put'](_0x57f8('0x11'),auth[_0x57f8('0xf')](),controller[_0x57f8('0x12')]);router[_0x57f8('0x13')](_0x57f8('0x11'),auth[_0x57f8('0xf')](),controller['destroy']);module[_0x57f8('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index e75b43d..b850717 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 _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x5d7754,_0x1e16d4){var _0x2d60c5=function(_0xb09554){while(--_0xb09554){_0x5d7754['push'](_0x5d7754['shift']());}};_0x2d60c5(++_0x1e16d4);}(_0x008c,0x188));var _0xc008=function(_0xa6cb09,_0x39410f){_0xa6cb09=_0xa6cb09-0x0;var _0x12b437=_0x008c[_0xa6cb09];return _0x12b437;};'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 _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x783834,_0x38c810){var _0x22055f=function(_0x6a6998){while(--_0x6a6998){_0x783834['push'](_0x783834['shift']());}};_0x22055f(++_0x38c810);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'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 97b3903..fb5bfe9 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 _0x22fb=['name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack'];(function(_0x13aefe,_0xda72e9){var _0x152b1d=function(_0x58531b){while(--_0x58531b){_0x13aefe['push'](_0x13aefe['shift']());}};_0x152b1d(++_0xda72e9);}(_0x22fb,0x18f));var _0xb22f=function(_0x2eb23f,_0xa28d0f){_0x2eb23f=_0x2eb23f-0x0;var _0x688f42=_0x22fb[_0x2eb23f];return _0x688f42;};'use strict';var emlformat=require(_0xb22f('0x0'));var rimraf=require(_0xb22f('0x1'));var zipdir=require(_0xb22f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb22f('0x3'));var moment=require(_0xb22f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb22f('0x5'));var util=require(_0xb22f('0x6'));var path=require(_0xb22f('0x7'));var sox=require(_0xb22f('0x8'));var csv=require(_0xb22f('0x9'));var ejs=require(_0xb22f('0xa'));var fs=require('fs');var fs_extra=require(_0xb22f('0xb'));var _=require('lodash');var squel=require(_0xb22f('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb22f('0xd'));var toCsv=require(_0xb22f('0x9'));var querystring=require('querystring');var Papa=require(_0xb22f('0xe'));var Redis=require(_0xb22f('0xf'));var authService=require(_0xb22f('0x10'));var qs=require(_0xb22f('0x11'));var as=require(_0xb22f('0x12'));var hardwareService=require(_0xb22f('0x13'));var logger=require(_0xb22f('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb22f('0x15'));var db=require(_0xb22f('0x16'))['db'];function respondWithStatusCode(_0x436000,_0x1fc5fd){_0x1fc5fd=_0x1fc5fd||0xcc;return function(_0x5c475a){if(_0x5c475a){return _0x436000['sendStatus'](_0x1fc5fd);}return _0x436000[_0xb22f('0x17')](_0x1fc5fd)[_0xb22f('0x18')]();};}function respondWithResult(_0x4153ce,_0x2fcaf7){_0x2fcaf7=_0x2fcaf7||0xc8;return function(_0x14c4ef){if(_0x14c4ef){return _0x4153ce['status'](_0x2fcaf7)[_0xb22f('0x19')](_0x14c4ef);}};}function respondWithFilteredResult(_0x4da342,_0x113471){return function(_0x38345d){if(_0x38345d){var _0x34e275=typeof _0x113471[_0xb22f('0x1a')]===_0xb22f('0x1b')&&typeof _0x113471[_0xb22f('0x1c')]===_0xb22f('0x1b');var _0x55f289=_0x38345d[_0xb22f('0x1d')];var _0x4e23fb=_0x34e275?0x0:_0x113471[_0xb22f('0x1a')];var _0x2472a8=_0x34e275?_0x38345d[_0xb22f('0x1d')]:_0x113471[_0xb22f('0x1a')]+_0x113471[_0xb22f('0x1c')];var _0x1d2846;if(_0x2472a8>=_0x55f289){_0x2472a8=_0x55f289;_0x1d2846=0xc8;}else{_0x1d2846=0xce;}_0x4da342['status'](_0x1d2846);return _0x4da342['set'](_0xb22f('0x1e'),_0x4e23fb+'-'+_0x2472a8+'/'+_0x55f289)[_0xb22f('0x19')](_0x38345d);}return null;};}function patchUpdates(_0xf126f2){return function(_0x41115a){try{jsonpatch[_0xb22f('0x1f')](_0x41115a,_0xf126f2,!![]);}catch(_0x2795cc){return BPromise[_0xb22f('0x20')](_0x2795cc);}return _0x41115a[_0xb22f('0x21')]();};}function saveUpdates(_0x9609dd,_0x3b185b){return function(_0xb1e5af){if(_0xb1e5af){return _0xb1e5af[_0xb22f('0x22')](_0x9609dd)[_0xb22f('0x23')](function(_0x3b074e){return _0x3b074e;});}return null;};}function removeEntity(_0x190a0a,_0x219d3b){return function(_0x3fbfeb){if(_0x3fbfeb){return _0x3fbfeb[_0xb22f('0x24')]()[_0xb22f('0x23')](function(){_0x190a0a[_0xb22f('0x17')](0xcc)[_0xb22f('0x18')]();});}};}function handleEntityNotFound(_0x228627,_0x22befe){return function(_0x2084e3){if(!_0x2084e3){_0x228627[_0xb22f('0x25')](0x194);}return _0x2084e3;};}function handleError(_0x47d3f1,_0x53d12f){_0x53d12f=_0x53d12f||0x1f4;return function(_0x4ff759){logger['error'](_0x4ff759[_0xb22f('0x26')]);if(_0x4ff759['name']){delete _0x4ff759[_0xb22f('0x27')];}_0x47d3f1[_0xb22f('0x17')](_0x53d12f)[_0xb22f('0x28')](_0x4ff759);};}exports[_0xb22f('0x29')]=function(_0x143f56,_0x5a5951){var _0x527dc0={},_0x56999e={},_0x22a328={'count':0x0,'rows':[]};var _0xbbf67=_[_0xb22f('0x2a')](db[_0xb22f('0x2b')][_0xb22f('0x2c')],function(_0x37cde7){return{'name':_0x37cde7[_0xb22f('0x2d')],'type':_0x37cde7[_0xb22f('0x2e')][_0xb22f('0x2f')]};});_0x56999e[_0xb22f('0x30')]=_[_0xb22f('0x2a')](_0xbbf67,_0xb22f('0x27'));_0x56999e[_0xb22f('0x31')]=_[_0xb22f('0x32')](_0x143f56[_0xb22f('0x31')]);_0x56999e[_0xb22f('0x33')]=_[_0xb22f('0x34')](_0x56999e[_0xb22f('0x30')],_0x56999e[_0xb22f('0x31')]);_0x527dc0[_0xb22f('0x35')]=_[_0xb22f('0x34')](_0x56999e[_0xb22f('0x30')],qs['fields'](_0x143f56[_0xb22f('0x31')][_0xb22f('0x36')]));_0x527dc0[_0xb22f('0x35')]=_0x527dc0[_0xb22f('0x35')][_0xb22f('0x37')]?_0x527dc0['attributes']:_0x56999e[_0xb22f('0x30')];if(!_0x143f56[_0xb22f('0x31')][_0xb22f('0x38')](_0xb22f('0x39'))){_0x527dc0[_0xb22f('0x1c')]=qs[_0xb22f('0x1c')](_0x143f56[_0xb22f('0x31')][_0xb22f('0x1c')]);_0x527dc0[_0xb22f('0x1a')]=qs[_0xb22f('0x1a')](_0x143f56[_0xb22f('0x31')][_0xb22f('0x1a')]);}_0x527dc0[_0xb22f('0x3a')]=qs[_0xb22f('0x3b')](_0x143f56['query']['sort']);_0x527dc0[_0xb22f('0x3c')]=qs[_0xb22f('0x33')](_[_0xb22f('0x3d')](_0x143f56[_0xb22f('0x31')],_0x56999e[_0xb22f('0x33')]),_0xbbf67);if(_0x143f56[_0xb22f('0x31')][_0xb22f('0x3e')]){_0x527dc0['where']=_['merge'](_0x527dc0[_0xb22f('0x3c')],{'$or':_[_0xb22f('0x2a')](_0xbbf67,function(_0x5644f3){if(_0x5644f3[_0xb22f('0x2e')]!=='VIRTUAL'){var _0x21b777={};_0x21b777[_0x5644f3['name']]={'$like':'%'+_0x143f56[_0xb22f('0x31')][_0xb22f('0x3e')]+'%'};return _0x21b777;}})});}_0x527dc0=_[_0xb22f('0x3f')]({},_0x527dc0,_0x143f56[_0xb22f('0x40')]);var _0x298ac1={'where':_0x527dc0[_0xb22f('0x3c')]};return db[_0xb22f('0x2b')][_0xb22f('0x1d')](_0x298ac1)['then'](function(_0x25a73a){_0x22a328[_0xb22f('0x1d')]=_0x25a73a;if(_0x143f56[_0xb22f('0x31')][_0xb22f('0x41')]){_0x527dc0['include']=[{'all':!![]}];}return db[_0xb22f('0x2b')]['findAll'](_0x527dc0);})[_0xb22f('0x23')](function(_0x1b7416){_0x22a328['rows']=_0x1b7416;return _0x22a328;})[_0xb22f('0x23')](respondWithFilteredResult(_0x5a5951,_0x527dc0))[_0xb22f('0x42')](handleError(_0x5a5951,null));};exports[_0xb22f('0x43')]=function(_0x47e0b1,_0x3af948){var _0x12a6ce={'raw':!![],'where':{'id':_0x47e0b1[_0xb22f('0x44')]['id']}},_0x4d682a={};_0x4d682a[_0xb22f('0x30')]=_[_0xb22f('0x32')](db[_0xb22f('0x2b')][_0xb22f('0x2c')]);_0x4d682a[_0xb22f('0x31')]=_[_0xb22f('0x32')](_0x47e0b1[_0xb22f('0x31')]);_0x4d682a[_0xb22f('0x33')]=_[_0xb22f('0x34')](_0x4d682a['model'],_0x4d682a[_0xb22f('0x31')]);_0x12a6ce[_0xb22f('0x35')]=_[_0xb22f('0x34')](_0x4d682a['model'],qs[_0xb22f('0x36')](_0x47e0b1[_0xb22f('0x31')][_0xb22f('0x36')]));_0x12a6ce[_0xb22f('0x35')]=_0x12a6ce[_0xb22f('0x35')]['length']?_0x12a6ce[_0xb22f('0x35')]:_0x4d682a[_0xb22f('0x30')];if(_0x47e0b1[_0xb22f('0x31')][_0xb22f('0x41')]){_0x12a6ce['include']=[{'all':!![]}];}_0x12a6ce=_[_0xb22f('0x3f')]({},_0x12a6ce,_0x47e0b1[_0xb22f('0x40')]);return db[_0xb22f('0x2b')][_0xb22f('0x45')](_0x12a6ce)[_0xb22f('0x23')](handleEntityNotFound(_0x3af948,null))[_0xb22f('0x23')](respondWithResult(_0x3af948,null))['catch'](handleError(_0x3af948,null));};exports[_0xb22f('0x46')]=function(_0x562c74,_0x34604e){return db['ChatTransferReport']['create'](_0x562c74[_0xb22f('0x47')],{})[_0xb22f('0x23')](respondWithResult(_0x34604e,0xc9))[_0xb22f('0x42')](handleError(_0x34604e,null));};exports['update']=function(_0x392cde,_0x49b5cb){if(_0x392cde[_0xb22f('0x47')]['id']){delete _0x392cde['body']['id'];}return db[_0xb22f('0x2b')][_0xb22f('0x45')]({'where':{'id':_0x392cde['params']['id']}})[_0xb22f('0x23')](handleEntityNotFound(_0x49b5cb,null))[_0xb22f('0x23')](saveUpdates(_0x392cde[_0xb22f('0x47')],null))['then'](respondWithResult(_0x49b5cb,null))[_0xb22f('0x42')](handleError(_0x49b5cb,null));};exports[_0xb22f('0x24')]=function(_0x4dfcd,_0x3c6e6a){return db['ChatTransferReport'][_0xb22f('0x45')]({'where':{'id':_0x4dfcd[_0xb22f('0x44')]['id']}})[_0xb22f('0x23')](handleEntityNotFound(_0x3c6e6a,null))['then'](removeEntity(_0x3c6e6a,null))['catch'](handleError(_0x3c6e6a,null));};exports[_0xb22f('0x48')]=function(_0x4bbeb6,_0x42610f){return db['ChatTransferReport'][_0xb22f('0x48')]()[_0xb22f('0x23')](respondWithResult(_0x42610f,null))[_0xb22f('0x42')](handleError(_0x42610f,null));}; \ No newline at end of file +var _0xad29=['nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','find','catch','body','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','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','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','name','index','map','ChatTransferReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xad29,0xe7));var _0x9ad2=function(_0x552c27,_0x478dc2){_0x552c27=_0x552c27-0x0;var _0x2a0922=_0xad29[_0x552c27];return _0x2a0922;};'use strict';var emlformat=require(_0x9ad2('0x0'));var rimraf=require(_0x9ad2('0x1'));var zipdir=require(_0x9ad2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9ad2('0x3'));var moment=require(_0x9ad2('0x4'));var BPromise=require(_0x9ad2('0x5'));var Mustache=require(_0x9ad2('0x6'));var util=require(_0x9ad2('0x7'));var path=require(_0x9ad2('0x8'));var sox=require(_0x9ad2('0x9'));var csv=require(_0x9ad2('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9ad2('0xb'));var _=require(_0x9ad2('0xc'));var squel=require('squel');var crypto=require(_0x9ad2('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9ad2('0xa'));var querystring=require(_0x9ad2('0xe'));var Papa=require(_0x9ad2('0xf'));var Redis=require(_0x9ad2('0x10'));var authService=require(_0x9ad2('0x11'));var qs=require(_0x9ad2('0x12'));var as=require(_0x9ad2('0x13'));var hardwareService=require(_0x9ad2('0x14'));var logger=require('../../config/logger')(_0x9ad2('0x15'));var utils=require(_0x9ad2('0x16'));var config=require(_0x9ad2('0x17'));var licenseUtil=require(_0x9ad2('0x18'));var db=require(_0x9ad2('0x19'))['db'];function respondWithStatusCode(_0x166857,_0x14abfa){_0x14abfa=_0x14abfa||0xcc;return function(_0xe78ede){if(_0xe78ede){return _0x166857[_0x9ad2('0x1a')](_0x14abfa);}return _0x166857['status'](_0x14abfa)[_0x9ad2('0x1b')]();};}function respondWithResult(_0x3db5a7,_0x3540ad){_0x3540ad=_0x3540ad||0xc8;return function(_0xc135c8){if(_0xc135c8){return _0x3db5a7[_0x9ad2('0x1c')](_0x3540ad)[_0x9ad2('0x1d')](_0xc135c8);}};}function respondWithFilteredResult(_0x3af1a0,_0x741154){return function(_0x2fa845){if(_0x2fa845){var _0x268c5f=typeof _0x741154[_0x9ad2('0x1e')]===_0x9ad2('0x1f')&&typeof _0x741154[_0x9ad2('0x20')]===_0x9ad2('0x1f');var _0x380620=_0x2fa845[_0x9ad2('0x21')];var _0x57b72c=_0x268c5f?0x0:_0x741154[_0x9ad2('0x1e')];var _0x4fc3af=_0x268c5f?_0x2fa845['count']:_0x741154[_0x9ad2('0x1e')]+_0x741154[_0x9ad2('0x20')];var _0x16492b;if(_0x4fc3af>=_0x380620){_0x4fc3af=_0x380620;_0x16492b=0xc8;}else{_0x16492b=0xce;}_0x3af1a0[_0x9ad2('0x1c')](_0x16492b);return _0x3af1a0[_0x9ad2('0x22')](_0x9ad2('0x23'),_0x57b72c+'-'+_0x4fc3af+'/'+_0x380620)[_0x9ad2('0x1d')](_0x2fa845);}return null;};}function patchUpdates(_0x4d5045){return function(_0x471eca){try{jsonpatch['apply'](_0x471eca,_0x4d5045,!![]);}catch(_0x99e30e){return BPromise[_0x9ad2('0x24')](_0x99e30e);}return _0x471eca[_0x9ad2('0x25')]();};}function saveUpdates(_0x54514f,_0x2933a1){return function(_0x425e56){if(_0x425e56){return _0x425e56[_0x9ad2('0x26')](_0x54514f)[_0x9ad2('0x27')](function(_0x591563){return _0x591563;});}return null;};}function removeEntity(_0x3514fe,_0x4a5684){return function(_0x276edc){if(_0x276edc){return _0x276edc[_0x9ad2('0x28')]()[_0x9ad2('0x27')](function(){_0x3514fe[_0x9ad2('0x1c')](0xcc)[_0x9ad2('0x1b')]();});}};}function handleEntityNotFound(_0x31b299,_0x602795){return function(_0x2c030a){if(!_0x2c030a){_0x31b299[_0x9ad2('0x1a')](0x194);}return _0x2c030a;};}function handleError(_0xcbaca6,_0x65b942){_0x65b942=_0x65b942||0x1f4;return function(_0x573aaf){logger['error'](_0x573aaf['stack']);if(_0x573aaf[_0x9ad2('0x29')]){delete _0x573aaf[_0x9ad2('0x29')];}_0xcbaca6[_0x9ad2('0x1c')](_0x65b942)['send'](_0x573aaf);};}exports[_0x9ad2('0x2a')]=function(_0x4131dc,_0x302cce){var _0x58e079={},_0x300e69={},_0x63d608={'count':0x0,'rows':[]};var _0x390ffe=_[_0x9ad2('0x2b')](db[_0x9ad2('0x2c')][_0x9ad2('0x2d')],function(_0x2a93fe){return{'name':_0x2a93fe[_0x9ad2('0x2e')],'type':_0x2a93fe[_0x9ad2('0x2f')]['key']};});_0x300e69[_0x9ad2('0x30')]=_['map'](_0x390ffe,_0x9ad2('0x29'));_0x300e69[_0x9ad2('0x31')]=_[_0x9ad2('0x32')](_0x4131dc[_0x9ad2('0x31')]);_0x300e69[_0x9ad2('0x33')]=_[_0x9ad2('0x34')](_0x300e69[_0x9ad2('0x30')],_0x300e69[_0x9ad2('0x31')]);_0x58e079[_0x9ad2('0x35')]=_['intersection'](_0x300e69[_0x9ad2('0x30')],qs[_0x9ad2('0x36')](_0x4131dc[_0x9ad2('0x31')][_0x9ad2('0x36')]));_0x58e079[_0x9ad2('0x35')]=_0x58e079['attributes'][_0x9ad2('0x37')]?_0x58e079[_0x9ad2('0x35')]:_0x300e69[_0x9ad2('0x30')];if(!_0x4131dc['query'][_0x9ad2('0x38')](_0x9ad2('0x39'))){_0x58e079[_0x9ad2('0x20')]=qs[_0x9ad2('0x20')](_0x4131dc[_0x9ad2('0x31')][_0x9ad2('0x20')]);_0x58e079[_0x9ad2('0x1e')]=qs['offset'](_0x4131dc[_0x9ad2('0x31')][_0x9ad2('0x1e')]);}_0x58e079[_0x9ad2('0x3a')]=qs[_0x9ad2('0x3b')](_0x4131dc[_0x9ad2('0x31')][_0x9ad2('0x3b')]);_0x58e079[_0x9ad2('0x3c')]=qs[_0x9ad2('0x33')](_['pick'](_0x4131dc[_0x9ad2('0x31')],_0x300e69['filters']),_0x390ffe);if(_0x4131dc[_0x9ad2('0x31')][_0x9ad2('0x3d')]){_0x58e079[_0x9ad2('0x3c')]=_[_0x9ad2('0x3e')](_0x58e079[_0x9ad2('0x3c')],{'$or':_[_0x9ad2('0x2b')](_0x390ffe,function(_0x41d941){if(_0x41d941['type']!=='VIRTUAL'){var _0xab1bc3={};_0xab1bc3[_0x41d941[_0x9ad2('0x29')]]={'$like':'%'+_0x4131dc['query']['filter']+'%'};return _0xab1bc3;}})});}_0x58e079=_[_0x9ad2('0x3e')]({},_0x58e079,_0x4131dc[_0x9ad2('0x3f')]);var _0x1bb92f={'where':_0x58e079[_0x9ad2('0x3c')]};return db[_0x9ad2('0x2c')][_0x9ad2('0x21')](_0x1bb92f)['then'](function(_0x446d44){_0x63d608[_0x9ad2('0x21')]=_0x446d44;if(_0x4131dc[_0x9ad2('0x31')][_0x9ad2('0x40')]){_0x58e079[_0x9ad2('0x41')]=[{'all':!![]}];}return db['ChatTransferReport'][_0x9ad2('0x42')](_0x58e079);})[_0x9ad2('0x27')](function(_0x1ff8ba){_0x63d608[_0x9ad2('0x43')]=_0x1ff8ba;return _0x63d608;})['then'](respondWithFilteredResult(_0x302cce,_0x58e079))['catch'](handleError(_0x302cce,null));};exports['show']=function(_0x104535,_0x4518b7){var _0xb1f06b={'raw':!![],'where':{'id':_0x104535['params']['id']}},_0x315328={};_0x315328['model']=_['keys'](db[_0x9ad2('0x2c')][_0x9ad2('0x2d')]);_0x315328[_0x9ad2('0x31')]=_[_0x9ad2('0x32')](_0x104535['query']);_0x315328[_0x9ad2('0x33')]=_['intersection'](_0x315328['model'],_0x315328['query']);_0xb1f06b[_0x9ad2('0x35')]=_['intersection'](_0x315328[_0x9ad2('0x30')],qs[_0x9ad2('0x36')](_0x104535[_0x9ad2('0x31')][_0x9ad2('0x36')]));_0xb1f06b[_0x9ad2('0x35')]=_0xb1f06b['attributes'][_0x9ad2('0x37')]?_0xb1f06b[_0x9ad2('0x35')]:_0x315328[_0x9ad2('0x30')];if(_0x104535[_0x9ad2('0x31')][_0x9ad2('0x40')]){_0xb1f06b['include']=[{'all':!![]}];}_0xb1f06b=_[_0x9ad2('0x3e')]({},_0xb1f06b,_0x104535[_0x9ad2('0x3f')]);return db['ChatTransferReport'][_0x9ad2('0x44')](_0xb1f06b)[_0x9ad2('0x27')](handleEntityNotFound(_0x4518b7,null))[_0x9ad2('0x27')](respondWithResult(_0x4518b7,null))[_0x9ad2('0x45')](handleError(_0x4518b7,null));};exports['create']=function(_0x5c72e8,_0x441577){return db[_0x9ad2('0x2c')]['create'](_0x5c72e8[_0x9ad2('0x46')],{})[_0x9ad2('0x27')](respondWithResult(_0x441577,0xc9))['catch'](handleError(_0x441577,null));};exports[_0x9ad2('0x26')]=function(_0x54370d,_0xddb0d0){if(_0x54370d[_0x9ad2('0x46')]['id']){delete _0x54370d[_0x9ad2('0x46')]['id'];}return db[_0x9ad2('0x2c')][_0x9ad2('0x44')]({'where':{'id':_0x54370d[_0x9ad2('0x47')]['id']}})[_0x9ad2('0x27')](handleEntityNotFound(_0xddb0d0,null))[_0x9ad2('0x27')](saveUpdates(_0x54370d[_0x9ad2('0x46')],null))['then'](respondWithResult(_0xddb0d0,null))['catch'](handleError(_0xddb0d0,null));};exports[_0x9ad2('0x28')]=function(_0x22d2c8,_0x32c68c){return db[_0x9ad2('0x2c')]['find']({'where':{'id':_0x22d2c8[_0x9ad2('0x47')]['id']}})[_0x9ad2('0x27')](handleEntityNotFound(_0x32c68c,null))[_0x9ad2('0x27')](removeEntity(_0x32c68c,null))['catch'](handleError(_0x32c68c,null));};exports['describe']=function(_0x5b0039,_0x3a78e9){return db[_0x9ad2('0x2c')]['describe']()[_0x9ad2('0x27')](respondWithResult(_0x3a78e9,null))[_0x9ad2('0x45')](handleError(_0x3a78e9,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 665b12d..023484d 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 _0x4b5b=['./chatTransferReport.attributes','define','uniqueid','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0xf01961,_0x17c74f){var _0xd983c4=function(_0x62a217){while(--_0x62a217){_0xf01961['push'](_0xf01961['shift']());}};_0xd983c4(++_0x17c74f);}(_0x4b5b,0xb7));var _0xb4b5=function(_0x3368b7,_0x55f847){_0x3368b7=_0x3368b7-0x0;var _0x40fbe8=_0x4b5b[_0x3368b7];return _0x40fbe8;};'use strict';var _=require('lodash');var util=require(_0xb4b5('0x0'));var logger=require(_0xb4b5('0x1'))(_0xb4b5('0x2'));var moment=require('moment');var BPromise=require(_0xb4b5('0x3'));var rp=require(_0xb4b5('0x4'));var fs=require('fs');var path=require(_0xb4b5('0x5'));var rimraf=require(_0xb4b5('0x6'));var config=require('../../config/environment');var attributes=require(_0xb4b5('0x7'));module['exports']=function(_0x506b39,_0x59ca8d){return _0x506b39[_0xb4b5('0x8')]('ChatTransferReport',attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0xb4b5('0x9'),'fields':[_0xb4b5('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xac2a=['request-promise','path','exports','define','uniqueid','lodash','util','../../config/logger','moment','bluebird'];(function(_0x3312a3,_0x3f9cdb){var _0x262560=function(_0x51880a){while(--_0x51880a){_0x3312a3['push'](_0x3312a3['shift']());}};_0x262560(++_0x3f9cdb);}(_0xac2a,0x1b3));var _0xaac2=function(_0x1fb3d2,_0x21c700){_0x1fb3d2=_0x1fb3d2-0x0;var _0x8aef6c=_0xac2a[_0x1fb3d2];return _0x8aef6c;};'use strict';var _=require(_0xaac2('0x0'));var util=require(_0xaac2('0x1'));var logger=require(_0xaac2('0x2'))('api');var moment=require(_0xaac2('0x3'));var BPromise=require(_0xaac2('0x4'));var rp=require(_0xaac2('0x5'));var fs=require('fs');var path=require(_0xaac2('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatTransferReport.attributes');module[_0xaac2('0x7')]=function(_0x441372,_0x1c90d4){return _0x441372[_0xaac2('0x8')]('ChatTransferReport',attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xaac2('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index d5b4fef..27cd6a1 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 _0xd3d1=['then','info','ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x19fc2f,_0x2509a1){var _0x24a68f=function(_0x544062){while(--_0x544062){_0x19fc2f['push'](_0x19fc2f['shift']());}};_0x24a68f(++_0x2509a1);}(_0xd3d1,0x109));var _0x1d3d=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xd3d1[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x1d3d('0x0'));var util=require(_0x1d3d('0x1'));var moment=require(_0x1d3d('0x2'));var BPromise=require('bluebird');var rs=require(_0x1d3d('0x3'));var fs=require('fs');var Redis=require(_0x1d3d('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1d3d('0x5'));var config=require(_0x1d3d('0x6'));var jayson=require(_0x1d3d('0x7'));var client=jayson[_0x1d3d('0x8')][_0x1d3d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x22eab2,_0x3c1b42,_0xb1ea09){return new BPromise(function(_0x104f0f,_0x73453){return client[_0x1d3d('0xa')](_0x22eab2,_0xb1ea09)[_0x1d3d('0xb')](function(_0x509396){logger[_0x1d3d('0xc')](_0x1d3d('0xd'),_0x3c1b42,'request\x20sent');logger[_0x1d3d('0xe')](_0x1d3d('0xf'),_0x3c1b42,_0x1d3d('0x10'),JSON[_0x1d3d('0x11')](_0x509396));if(_0x509396[_0x1d3d('0x12')]){if(_0x509396[_0x1d3d('0x12')][_0x1d3d('0x13')]===0x1f4){logger[_0x1d3d('0x12')](_0x1d3d('0xd'),_0x3c1b42,_0x509396[_0x1d3d('0x12')][_0x1d3d('0x14')]);return _0x73453(_0x509396['error'][_0x1d3d('0x14')]);}logger[_0x1d3d('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0x3c1b42,_0x509396[_0x1d3d('0x12')][_0x1d3d('0x14')]);return _0x104f0f(_0x509396[_0x1d3d('0x12')][_0x1d3d('0x14')]);}else{logger[_0x1d3d('0xc')](_0x1d3d('0xd'),_0x3c1b42,'request\x20sent');_0x104f0f(_0x509396[_0x1d3d('0x15')]['message']);}})[_0x1d3d('0x16')](function(_0x232913){logger[_0x1d3d('0x12')](_0x1d3d('0xd'),_0x3c1b42,_0x232913);_0x73453(_0x232913);});});} \ No newline at end of file +var _0x9b26=['../../config/logger','rpc','../../config/environment','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x51f077,_0x2705f7){var _0x50e2c3=function(_0x17b488){while(--_0x17b488){_0x51f077['push'](_0x51f077['shift']());}};_0x50e2c3(++_0x2705f7);}(_0x9b26,0x6d));var _0x69b2=function(_0x5dc489,_0x1d3f9f){_0x5dc489=_0x5dc489-0x0;var _0x482ba1=_0x9b26[_0x5dc489];return _0x482ba1;};'use strict';var _=require(_0x69b2('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x69b2('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x69b2('0x2'));var db=require(_0x69b2('0x3'))['db'];var utils=require(_0x69b2('0x4'));var logger=require(_0x69b2('0x5'))(_0x69b2('0x6'));var config=require(_0x69b2('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x536e47,_0x149072,_0x4bda45){return new BPromise(function(_0xb8ff13,_0x207a99){return client['request'](_0x536e47,_0x4bda45)['then'](function(_0x17e973){logger[_0x69b2('0x8')](_0x69b2('0x9'),_0x149072,_0x69b2('0xa'));logger[_0x69b2('0xb')](_0x69b2('0xc'),_0x149072,_0x69b2('0xa'),JSON[_0x69b2('0xd')](_0x17e973));if(_0x17e973[_0x69b2('0xe')]){if(_0x17e973[_0x69b2('0xe')][_0x69b2('0xf')]===0x1f4){logger[_0x69b2('0xe')]('ChatTransferReport,\x20%s,\x20%s',_0x149072,_0x17e973['error'][_0x69b2('0x10')]);return _0x207a99(_0x17e973[_0x69b2('0xe')][_0x69b2('0x10')]);}logger[_0x69b2('0xe')](_0x69b2('0x9'),_0x149072,_0x17e973[_0x69b2('0xe')][_0x69b2('0x10')]);return _0xb8ff13(_0x17e973[_0x69b2('0xe')][_0x69b2('0x10')]);}else{logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x149072,_0x69b2('0xa'));_0xb8ff13(_0x17e973[_0x69b2('0x11')][_0x69b2('0x10')]);}})[_0x69b2('0x12')](function(_0x1bd865){logger[_0x69b2('0xe')](_0x69b2('0x9'),_0x149072,_0x1bd865);_0x207a99(_0x1bd865);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 667a09b..60c863a 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 _0x2c2f=['create','put','update','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','index','isAuthenticated','/:id','show','post'];(function(_0x57417c,_0x23441d){var _0xdff4f5=function(_0x4b8756){while(--_0x4b8756){_0x57417c['push'](_0x57417c['shift']());}};_0xdff4f5(++_0x23441d);}(_0x2c2f,0xb9));var _0xf2c2=function(_0x7ecbfc,_0x39da18){_0x7ecbfc=_0x7ecbfc-0x0;var _0x38bde1=_0x2c2f[_0x7ecbfc];return _0x38bde1;};'use strict';var multer=require('multer');var util=require(_0xf2c2('0x0'));var path=require(_0xf2c2('0x1'));var timeout=require('connect-timeout');var express=require(_0xf2c2('0x2'));var router=express[_0xf2c2('0x3')]();var fs_extra=require(_0xf2c2('0x4'));var auth=require(_0xf2c2('0x5'));var interaction=require(_0xf2c2('0x6'));var config=require(_0xf2c2('0x7'));var controller=require(_0xf2c2('0x8'));router[_0xf2c2('0x9')]('/',auth['isAuthenticated'](),controller[_0xf2c2('0xa')]);router[_0xf2c2('0x9')]('/describe',auth[_0xf2c2('0xb')](),controller['describe']);router['get'](_0xf2c2('0xc'),auth[_0xf2c2('0xb')](),controller[_0xf2c2('0xd')]);router[_0xf2c2('0xe')]('/',auth[_0xf2c2('0xb')](),controller[_0xf2c2('0xf')]);router[_0xf2c2('0x10')](_0xf2c2('0xc'),auth[_0xf2c2('0xb')](),controller[_0xf2c2('0x11')]);router['delete'](_0xf2c2('0xc'),auth[_0xf2c2('0xb')](),controller[_0xf2c2('0x12')]);module[_0xf2c2('0x13')]=router; \ No newline at end of file +var _0xf54a=['Router','fs-extra','../../components/auth/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','delete','destroy','exports','multer','util','path'];(function(_0x4a563b,_0x36f42d){var _0x2935ef=function(_0x32593f){while(--_0x32593f){_0x4a563b['push'](_0x4a563b['shift']());}};_0x2935ef(++_0x36f42d);}(_0xf54a,0x75));var _0xaf54=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf54a[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xaf54('0x0'));var util=require(_0xaf54('0x1'));var path=require(_0xaf54('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xaf54('0x3')]();var fs_extra=require(_0xaf54('0x4'));var auth=require(_0xaf54('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xaf54('0x6'));var controller=require(_0xaf54('0x7'));router[_0xaf54('0x8')]('/',auth[_0xaf54('0x9')](),controller[_0xaf54('0xa')]);router[_0xaf54('0x8')](_0xaf54('0xb'),auth[_0xaf54('0x9')](),controller[_0xaf54('0xc')]);router[_0xaf54('0x8')](_0xaf54('0xd'),auth[_0xaf54('0x9')](),controller[_0xaf54('0xe')]);router['post']('/',auth[_0xaf54('0x9')](),controller[_0xaf54('0xf')]);router[_0xaf54('0x10')]('/:id',auth[_0xaf54('0x9')](),controller['update']);router[_0xaf54('0x11')](_0xaf54('0xd'),auth['isAuthenticated'](),controller[_0xaf54('0x12')]);module[_0xaf54('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index d830dd5..a05ed70 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 _0xb746=['We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','stringify','input','name','getDataValue','onlineForm','textarea','Comments','Leave\x20your\x20comments','offlineForm','parse','generate','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','alternate','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded'];(function(_0x1f4f26,_0x16c293){var _0x4e8d43=function(_0x9af0d1){while(--_0x9af0d1){_0x1f4f26['push'](_0x1f4f26['shift']());}};_0x4e8d43(++_0x16c293);}(_0xb746,0x1c8));var _0x6b74=function(_0x4ed64f,_0x681116){_0x4ed64f=_0x4ed64f-0x0;var _0x4536fd=_0xb746[_0x4ed64f];return _0x4536fd;};'use strict';var Sequelize=require(_0x6b74('0x0'));var rs=require(_0x6b74('0x1'));module['exports']={'name':{'type':Sequelize[_0x6b74('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x6b74('0x2')],'allowNull':![],'unique':_0x6b74('0x3')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x6b74('0x2')],'defaultValue':_0x6b74('0x4')},'mapKeyOffline':{'type':Sequelize[_0x6b74('0x2')],'defaultValue':_0x6b74('0x4')},'key':{'type':Sequelize[_0x6b74('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x6b74('0x5')},'customerAlias':{'type':Sequelize[_0x6b74('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x6b74('0x2')],'allowNull':![],'defaultValue':_0x6b74('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x6b74('0x2')],'allowNull':![],'defaultValue':_0x6b74('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x6b74('0x2')],'allowNull':![],'defaultValue':_0x6b74('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x6b74('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x6b74('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x6b74('0x2')]},'animation':{'type':Sequelize[_0x6b74('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x6b74('0xa')](_0x6b74('0xb'),'squared'),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0x6b74('0x2')],'defaultValue':_0x6b74('0xc')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x6b74('0xd')},'offline_chat_button':{'type':Sequelize[_0x6b74('0x2')],'defaultValue':_0x6b74('0xe')},'header_offline':{'type':Sequelize[_0x6b74('0x2')],'defaultValue':_0x6b74('0xf')},'download_transcript':{'type':Sequelize[_0x6b74('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x6b74('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x6b74('0x2')],'defaultValue':_0x6b74('0x10')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x6b74('0x11')]},'closingQuestion':{'type':Sequelize[_0x6b74('0x2')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x6b74('0x2')],'defaultValue':_0x6b74('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0x6b74('0x2')],'defaultValue':_0x6b74('0x13')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0x6b74('0x14')},'placeholderMessage':{'type':Sequelize[_0x6b74('0x2')],'defaultValue':_0x6b74('0x15')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x6b74('0x16')},'closingMessageButton':{'type':Sequelize[_0x6b74('0x2')],'defaultValue':_0x6b74('0xe')},'skipMessageButton':{'type':Sequelize[_0x6b74('0x2')],'defaultValue':_0x6b74('0x17')},'conditionAgreement':{'type':Sequelize[_0x6b74('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x6b74('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x6b74('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x6b74('0x2')],'defaultValue':_0x6b74('0x18')},'ratingType':{'type':Sequelize[_0x6b74('0xa')](_0x6b74('0x19'),_0x6b74('0x1a')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x6b74('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x6b74('0x11')],'defaultValue':function(){return JSON[_0x6b74('0x1b')]({'items':[{'type':_0x6b74('0x1c'),'variable':null,'config':{'placeholder':_0x6b74('0x1d'),'type':'text','required':!![]},'props':{'title':_0x6b74('0x1d'),'helpText':''}},{'type':_0x6b74('0x1c'),'props':{'title':_0x6b74('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x6b74('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x6b74('0x1e')](_0x6b74('0x1f'))?JSON['parse'](this[_0x6b74('0x1e')](_0x6b74('0x1f'))):{};},'set':function(_0x3dbfe8){return this['setDataValue'](_0x6b74('0x1f'),JSON['stringify'](_0x3dbfe8));}},'offlineForm':{'type':Sequelize[_0x6b74('0x11')],'defaultValue':function(){return JSON[_0x6b74('0x1b')]({'items':[{'type':'input','props':{'title':_0x6b74('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x6b74('0x4')},'variable':null},{'type':_0x6b74('0x20'),'config':{'placeholder':_0x6b74('0x21')},'props':{'title':_0x6b74('0x21'),'helpText':_0x6b74('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0x6b74('0x1e')](_0x6b74('0x23'))?JSON[_0x6b74('0x24')](this['getDataValue'](_0x6b74('0x23'))):{};},'set':function(_0x585e57){return this['setDataValue']('offlineForm',JSON[_0x6b74('0x1b')](_0x585e57));}},'token':{'type':Sequelize[_0x6b74('0x2')],'defaultValue':function(){return rs[_0x6b74('0x25')]();}},'autoclose':{'type':Sequelize[_0x6b74('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x6b74('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x6b74('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x6b74('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x6b74('0x2')]},'waitingTitle':{'type':Sequelize[_0x6b74('0x2')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0x6b74('0x2')],'defaultValue':_0x6b74('0x26')},'offlineMessageSubject':{'type':Sequelize[_0x6b74('0x2')],'defaultValue':_0x6b74('0x27')},'offlineMessageBody':{'type':Sequelize[_0x6b74('0x2')],'defaultValue':_0x6b74('0x28')},'enableUnmanagedNote':{'type':Sequelize[_0x6b74('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x6b74('0x2')],'defaultValue':_0x6b74('0x29')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x6b74('0x17')},'sendUnmanaged':{'type':Sequelize[_0x6b74('0x2')],'defaultValue':_0x6b74('0xe')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x6b74('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x6b74('0x11')]},'showAgentAvatar':{'type':Sequelize[_0x6b74('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x6b74('0x11')],'defaultValue':function(){return _0x6b74('0x2a');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x6b74('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x6b74('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x6b74('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize[_0x6b74('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x6b74('0x2')],'defaultValue':_0x6b74('0x2c')},'verticalAlignment':{'type':Sequelize[_0x6b74('0x8')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x6b74('0x2')],'defaultValue':_0x6b74('0x2d')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x6b74('0x2e')},'defaultTitle':{'type':Sequelize[_0x6b74('0x2')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0x6b74('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x6b74('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x6b74('0x2')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x6b74('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x6b74('0x2')],'defaultValue':_0x6b74('0x2f')},'systemAvatar':{'type':Sequelize[_0x6b74('0x11')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6b74('0x8')],'comment':_0x6b74('0x30')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x3b6050){if(!_0x3b6050)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0x6b74('0x31')]('mandatoryDisposition',_0x3b6050);}},'vidaooEscalation':{'type':Sequelize[_0x6b74('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x6b74('0x32')},'vidaooNote':{'type':Sequelize[_0x6b74('0x2')],'defaultValue':function(){return _0x6b74('0x33');}},'vidaooMetadata':{'type':Sequelize[_0x6b74('0x11')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x6b74('0x11')]}}; \ No newline at end of file +var _0xac83=['star','thumb','stringify','input','text','name','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','CHAT','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','#011F6A','#ffffff','INTEGER','BOOLEAN','rounded','squared','We\x20are\x20here!','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Skip','Feedback','ENUM'];(function(_0x4ef677,_0x22beb1){var _0x430cc8=function(_0x2389ab){while(--_0x2389ab){_0x4ef677['push'](_0x4ef677['shift']());}};_0x430cc8(++_0x22beb1);}(_0xac83,0x180));var _0x3ac8=function(_0x494f7f,_0x34a09b){_0x494f7f=_0x494f7f-0x0;var _0x18ebe4=_0xac83[_0x494f7f];return _0x18ebe4;};'use strict';var Sequelize=require(_0x3ac8('0x0'));var rs=require(_0x3ac8('0x1'));module[_0x3ac8('0x2')]={'name':{'type':Sequelize[_0x3ac8('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x3ac8('0x3')],'allowNull':![],'unique':_0x3ac8('0x4')},'description':{'type':Sequelize[_0x3ac8('0x3')]},'mapKey':{'type':Sequelize[_0x3ac8('0x3')],'defaultValue':_0x3ac8('0x5')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x3ac8('0x5')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x3ac8('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x3ac8('0x3')],'allowNull':![],'defaultValue':_0x3ac8('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x3ac8('0x3')],'allowNull':![],'defaultValue':_0x3ac8('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3ac8('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3ac8('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x3ac8('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x3ac8('0x3')]},'animation':{'type':Sequelize[_0x3ac8('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0x3ac8('0xa'),_0x3ac8('0xb')),'defaultValue':'rounded'},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x3ac8('0xc')},'start_chat_button':{'type':Sequelize[_0x3ac8('0x3')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0x3ac8('0x3')],'defaultValue':_0x3ac8('0xd')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x3ac8('0xe')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x3ac8('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x3ac8('0x3')],'defaultValue':_0x3ac8('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0x3ac8('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x3ac8('0x10')]},'closingQuestion':{'type':Sequelize[_0x3ac8('0x3')],'defaultValue':_0x3ac8('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0x3ac8('0x3')],'defaultValue':_0x3ac8('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0x3ac8('0x3')],'defaultValue':_0x3ac8('0x13')},'noteTitle':{'type':Sequelize[_0x3ac8('0x3')],'defaultValue':_0x3ac8('0x14')},'placeholderMessage':{'type':Sequelize[_0x3ac8('0x3')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x3ac8('0x3')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x3ac8('0xd')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x3ac8('0x15')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x3ac8('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x3ac8('0x3')],'defaultValue':_0x3ac8('0x16')},'ratingType':{'type':Sequelize[_0x3ac8('0x17')](_0x3ac8('0x18'),_0x3ac8('0x19')),'defaultValue':_0x3ac8('0x18')},'ratingStarsNumber':{'type':Sequelize[_0x3ac8('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x3ac8('0x10')],'defaultValue':function(){return JSON[_0x3ac8('0x1a')]({'items':[{'type':_0x3ac8('0x1b'),'variable':null,'config':{'placeholder':'name','type':_0x3ac8('0x1c'),'required':!![]},'props':{'title':_0x3ac8('0x1d'),'helpText':''}},{'type':_0x3ac8('0x1b'),'props':{'title':_0x3ac8('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x3ac8('0x5'),'type':_0x3ac8('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x3ac8('0x1e')](_0x3ac8('0x1f'))?JSON[_0x3ac8('0x20')](this['getDataValue'](_0x3ac8('0x1f'))):{};},'set':function(_0x561292){return this[_0x3ac8('0x21')](_0x3ac8('0x1f'),JSON['stringify'](_0x561292));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x3ac8('0x1a')]({'items':[{'type':_0x3ac8('0x1b'),'props':{'title':_0x3ac8('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x3ac8('0x5'),'type':_0x3ac8('0x5')},'variable':null},{'type':_0x3ac8('0x22'),'config':{'placeholder':_0x3ac8('0x23')},'props':{'title':_0x3ac8('0x23'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0x3ac8('0x24'))?JSON['parse'](this[_0x3ac8('0x1e')](_0x3ac8('0x24'))):{};},'set':function(_0x4313a8){return this['setDataValue'](_0x3ac8('0x24'),JSON[_0x3ac8('0x1a')](_0x4313a8));}},'token':{'type':Sequelize[_0x3ac8('0x3')],'defaultValue':function(){return rs[_0x3ac8('0x25')]();}},'autoclose':{'type':Sequelize[_0x3ac8('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x3ac8('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x3ac8('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x3ac8('0x3')]},'forwardOffline':{'type':Sequelize[_0x3ac8('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x3ac8('0x3')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0x3ac8('0x26')},'waitingMessage':{'type':Sequelize[_0x3ac8('0x3')],'defaultValue':_0x3ac8('0x27')},'offlineMessageSubject':{'type':Sequelize[_0x3ac8('0x3')],'defaultValue':_0x3ac8('0x28')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x3ac8('0x29')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x3ac8('0x3')],'defaultValue':_0x3ac8('0x2a')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x3ac8('0x15')},'sendUnmanaged':{'type':Sequelize[_0x3ac8('0x3')],'defaultValue':_0x3ac8('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0x3ac8('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x3ac8('0x10')]},'showAgentAvatar':{'type':Sequelize[_0x3ac8('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x3ac8('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x3ac8('0x2b');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x3ac8('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x3ac8('0x3')],'defaultValue':_0x3ac8('0x2c')},'waitForTheAssignedAgent':{'type':Sequelize[_0x3ac8('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x3ac8('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x3ac8('0x3')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0x3ac8('0x8')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x3ac8('0x3')],'defaultValue':_0x3ac8('0x2d')},'messagesAlignment':{'type':Sequelize[_0x3ac8('0x3')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x3ac8('0x3')]},'customerAvatar':{'type':Sequelize[_0x3ac8('0x10')]},'showCustomerAvatar':{'type':Sequelize[_0x3ac8('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x3ac8('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x3ac8('0x3')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x3ac8('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x3ac8('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x3ac8('0x3')],'defaultValue':_0x3ac8('0x2e')},'systemAvatar':{'type':Sequelize[_0x3ac8('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3ac8('0x8')],'comment':_0x3ac8('0x2f')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x3ac8('0x30'),'set':function(_0x86e165){if(!_0x86e165)this[_0x3ac8('0x21')]('mandatoryDispositionPauseId',null);this[_0x3ac8('0x21')](_0x3ac8('0x31'),_0x86e165);}},'vidaooEscalation':{'type':Sequelize[_0x3ac8('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x3ac8('0x3')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0x3ac8('0x3')],'defaultValue':function(){return _0x3ac8('0x32');}},'vidaooMetadata':{'type':Sequelize[_0x3ac8('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x3ac8('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x3ac8('0x10')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 13ff677..a46314c 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 _0x2376=['VIRTUAL','merge','includeAll','include','findAll','show','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Pause','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','hasOwnProperty','removeAnswers','addLogo','sitepic','filename','addAvatar','addCustomerAvatar','customerAvatar','file','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','getLicense','isNil','existsSync','server/files/images/logos/','server/files/images/avatars/default_avatar.png','agentAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/system_avatar.png','download','notify','chat','CmContact','describe','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','from','ValidationError','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','Contacts','ChatApplication','Applications','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','spread','account','list','applications','orderBy','priority','asc','ListId','threadId','ChatInteraction','externalUrl','interaction','contact','messageId','created','autoclose','unmanaged','ChatMessage','AttachmentId','UserId','User','unshift','agent','forcedOwnership','ChatQueue','*,*,*,*','Start','offline','files','CompanyId','mapKeyOffline','includes','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','transaction','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','sendMail','\x22%s\x22\x20<%s>','email','forwardOfflineAddress','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','NotifyMailAccount','notifyMail','addInteraction','omit','getInteractions','Contact','Owner','Tag','tag','getSnippet','getProactiveActions','../../config/license/util','virtual','custom','server/files/chat/iframe.ejs','address','origin','3.5.0','remote','headers','connection','replace','alignment','verticalAlignment','labelText','textColor','color_button','backgroundColor','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','finally','getApplications','addProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachment','Attachments','addAgents','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','ejs','fs-extra','lodash','querystring','jayson/promise','url','../../components/parsers/qs','../../config/logger','../../config/environment','../../errors/api','APINotFoundError','handleError','../../mysqldb','defaults','redis','socket.io-emitter','./chatWebsite.socket','register','client','http','request','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','result','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','update','destroy','UserProfileResource','stack','name','send','Command','format','iftime\x20%s,%s','interval','timezone','iftime\x20%s','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','catch','map','Interval','Intervals','get','all','user-agent-parser','setUA','getResult','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','model','type','index','mandatoryDispositionPause','ChatWebsite','rawAttributes','fieldName','key','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where'];(function(_0x21e71a,_0xf0b818){var _0x174f46=function(_0x2dd53e){while(--_0x2dd53e){_0x21e71a['push'](_0x21e71a['shift']());}};_0x174f46(++_0xf0b818);}(_0x2376,0x1e3));var _0x6237=function(_0x5347d5,_0x31ed96){_0x5347d5=_0x5347d5-0x0;var _0x3e1da8=_0x2376[_0x5347d5];return _0x3e1da8;};'use strict';var Mustache=require(_0x6237('0x0'));var util=require('util');var path=require('path');var ejs=require(_0x6237('0x1'));var fs=require('fs');var fs_extra=require(_0x6237('0x2'));var _=require(_0x6237('0x3'));var querystring=require(_0x6237('0x4'));var htmlToText=require('html-to-text');var Redis=require('ioredis');var jayson=require(_0x6237('0x5'));var url=require(_0x6237('0x6'));var qs=require(_0x6237('0x7'));var logger=require(_0x6237('0x8'))('api');var config=require(_0x6237('0x9'));var APIOutOfIntervalError=require(_0x6237('0xa'))['APIOutOfIntervalError'];var APINotFoundError=require(_0x6237('0xa'))[_0x6237('0xb')];var APIHandleError=require('../../errors/api')[_0x6237('0xc')];var db=require(_0x6237('0xd'))['db'];config['redis']=_[_0x6237('0xe')](config[_0x6237('0xf')],{'host':'localhost','port':0x18eb});var socket=require(_0x6237('0x10'))(new Redis(config['redis']));require(_0x6237('0x11'))[_0x6237('0x12')](socket);var client=jayson[_0x6237('0x13')]['http']({'port':0x232c});var client9002=jayson[_0x6237('0x13')]['http']({'port':0x232a});var client9003=jayson['client'][_0x6237('0x14')]({'port':0x232b});var client9001=jayson[_0x6237('0x13')][_0x6237('0x14')]({'port':0x2329});function respondWithRpcPromise(_0x330e8d,_0x57ed86,_0x215a7b,_0x202fda){return new Promise(function(_0x1c2bac,_0x41b2d3){var _0x2858a3=_0x202fda||client;return _0x2858a3[_0x6237('0x15')](_0x330e8d,_0x215a7b)[_0x6237('0x16')](function(_0x2a225f){logger[_0x6237('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x57ed86,_0x6237('0x18'));logger[_0x6237('0x19')](_0x6237('0x1a'),_0x57ed86,_0x6237('0x18'),JSON[_0x6237('0x1b')](_0x2a225f));if(_0x2a225f[_0x6237('0x1c')]){if(_0x2a225f[_0x6237('0x1c')][_0x6237('0x1d')]===0x1f4){logger[_0x6237('0x1c')](_0x6237('0x1e'),_0x57ed86,_0x2a225f['error'][_0x6237('0x1f')]);return _0x41b2d3(_0x2a225f[_0x6237('0x1c')][_0x6237('0x1f')]);}logger[_0x6237('0x1c')](_0x6237('0x1e'),_0x57ed86,_0x2a225f[_0x6237('0x1c')][_0x6237('0x1f')]);return _0x1c2bac(_0x2a225f[_0x6237('0x1c')]['message']);}else{logger[_0x6237('0x17')](_0x6237('0x1e'),_0x57ed86,_0x6237('0x18'));_0x1c2bac(_0x2a225f[_0x6237('0x20')][_0x6237('0x1f')]);}})['catch'](function(_0x4dc59b){logger[_0x6237('0x1c')](_0x6237('0x1e'),_0x57ed86,_0x4dc59b);_0x41b2d3(_0x4dc59b);});});}function respondWithStatusCode(_0x5bd6d6,_0x51864c){_0x51864c=_0x51864c||0xcc;return function(_0x176c9d){if(_0x176c9d){return _0x5bd6d6[_0x6237('0x21')](_0x51864c);}return _0x5bd6d6['status'](_0x51864c)[_0x6237('0x22')]();};}function respondWithResult(_0x4eb9d7,_0x8e072c){_0x8e072c=_0x8e072c||0xc8;return function(_0x1b8778){if(_0x1b8778){return _0x4eb9d7[_0x6237('0x23')](_0x8e072c)[_0x6237('0x24')](_0x1b8778);}};}function respondWithFilteredResult(_0x54543e,_0x6c3b78){return function(_0x906872){if(_0x906872){var _0x11b11f=typeof _0x6c3b78[_0x6237('0x25')]==='undefined'&&typeof _0x6c3b78[_0x6237('0x26')]===_0x6237('0x27');var _0x299aa1=_0x906872[_0x6237('0x28')];var _0x1e1b67=_0x11b11f?0x0:_0x6c3b78['offset'];var _0x53884a=_0x11b11f?_0x906872[_0x6237('0x28')]:_0x6c3b78['offset']+_0x6c3b78[_0x6237('0x26')];var _0x2fea19;if(_0x53884a>=_0x299aa1){_0x53884a=_0x299aa1;_0x2fea19=0xc8;}else{_0x2fea19=0xce;}_0x54543e[_0x6237('0x23')](_0x2fea19);return _0x54543e[_0x6237('0x29')](_0x6237('0x2a'),_0x1e1b67+'-'+_0x53884a+'/'+_0x299aa1)[_0x6237('0x24')](_0x906872);}return null;};}function saveUpdates(_0x4bb44){return function(_0xd0e0fb){if(_0xd0e0fb){return _0xd0e0fb[_0x6237('0x2b')](_0x4bb44)[_0x6237('0x16')](function(_0x1b707a){return _0x1b707a;});}return null;};}function removeEntity(_0x4edcf8){return function(_0x2ebaff){if(_0x2ebaff){return _0x2ebaff[_0x6237('0x2c')]()['then'](function(){var _0x47850f=_0x2ebaff['get']({'plain':!![]});var _0x325ecd='ChatWebsites';return db[_0x6237('0x2d')][_0x6237('0x2c')]({'where':{'type':_0x325ecd,'resourceId':_0x47850f['id']}})[_0x6237('0x16')](function(){return _0x2ebaff;});})['then'](function(){_0x4edcf8[_0x6237('0x23')](0xcc)[_0x6237('0x22')]();});}};}function handleEntityNotFound(_0x404e5b){return function(_0x18f133){if(!_0x18f133){_0x404e5b[_0x6237('0x21')](0x194);}return _0x18f133;};}function handleError(_0x445bfa,_0x1b531c){_0x1b531c=_0x1b531c||0x1f4;return function(_0x3ca750){logger['error'](_0x3ca750[_0x6237('0x2e')]);if(_0x3ca750[_0x6237('0x2f')]){delete _0x3ca750[_0x6237('0x2f')];}_0x445bfa[_0x6237('0x23')](_0x1b531c)[_0x6237('0x30')](_0x3ca750);};}function iftimePromise(_0x18b88f,_0x4bc608){return respondWithRpcPromise(_0x6237('0x31'),'getSnippet',{'command':_0x4bc608['timezone']?util[_0x6237('0x32')](_0x6237('0x33'),_0x18b88f[_0x6237('0x34')],_0x4bc608[_0x6237('0x35')]):util[_0x6237('0x32')](_0x6237('0x36'),_0x18b88f[_0x6237('0x34')])},client9002)[_0x6237('0x16')](function(_0x1d4a64){var _0x6abc36=_0x1d4a64&&_0x1d4a64[_0x6237('0x37')]('true')>=0x0?!![]:![];logger[_0x6237('0x17')](_0x6237('0x38'),_0x4bc608['id'],_0x18b88f['id'],_0x18b88f[_0x6237('0x34')],_0x6abc36?_0x6237('0x39'):_0x6237('0x3a'),_0x4bc608[_0x6237('0x35')]?_0x4bc608[_0x6237('0x35')]:_0x6237('0x3b'));return _0x6abc36;})[_0x6237('0x3c')](function(_0x461e4a){logger[_0x6237('0x1c')](_0x6237('0x38'),_0x4bc608['id'],_0x18b88f['id'],_0x18b88f[_0x6237('0x34')],util['inspect'](_0x461e4a,{'showHidden':![],'depth':null}),_0x4bc608[_0x6237('0x35')]?_0x4bc608[_0x6237('0x35')]:_0x6237('0x3b'));return![];});}function checkWebsiteIntervals(_0x581200){var _0x32330e=_[_0x6237('0x3d')](_0x581200[_0x6237('0x3e')][_0x6237('0x3f')],function(_0x38fb7c){var _0x15f778=_0x38fb7c[_0x6237('0x40')]({'plain':!![]});return iftimePromise(_0x15f778,_0x581200);});return Promise[_0x6237('0x41')](_0x32330e)['then'](function(_0x2c92d9){return _['some'](_0x2c92d9);});}function createInteractionObject(_0xb595d5,_0x1d2e4b,_0x403822,_0x86edc4){var _0x55811d=require(_0x6237('0x42'));var _0x377b95=new _0x55811d();var _0x4a19c3=_0x377b95[_0x6237('0x43')](_0x403822['user-agent'])[_0x6237('0x44')]();var _0x1645ab=_0x1d2e4b['customerIp'];if(_0x403822[_0x6237('0x45')]){_0x1645ab=_0x403822[_0x6237('0x45')];}else if(_0x403822[_0x6237('0x46')]){_0x1645ab=_[_0x6237('0x47')](_0x403822[_0x6237('0x46')][_0x6237('0x48')](','));}return{'ContactId':_0x86edc4['id'],'ChatWebsiteId':_0xb595d5,'from':(_0x86edc4[_0x6237('0x49')]||'')+'\x20'+(_0x86edc4[_0x6237('0x4a')]||''),'customerIp':_0x1645ab,'customerPort':_0x403822['x-real-port']?_0x403822[_0x6237('0x4b')]:null,'referer':_0x1d2e4b[_0x6237('0x4c')],'browserName':_0x4a19c3[_0x6237('0x4d')][_0x6237('0x2f')]&&_0x4a19c3['browser'][_0x6237('0x4e')]?util[_0x6237('0x32')](_0x6237('0x4f'),_0x4a19c3[_0x6237('0x4d')][_0x6237('0x2f')],_0x4a19c3[_0x6237('0x4d')]['version']):'unknown','browserVersion':_0x4a19c3[_0x6237('0x4d')][_0x6237('0x4e')]||_0x6237('0x50'),'osName':util['format']('%s\x20%s',_0x4a19c3['os'][_0x6237('0x2f')],_0x4a19c3['os'][_0x6237('0x4e')]),'osVersion':_0x4a19c3['os'][_0x6237('0x4e')],'deviceModel':_0x4a19c3[_0x6237('0x51')]['model']&&_0x4a19c3[_0x6237('0x51')][_0x6237('0x52')]?util[_0x6237('0x32')](_0x6237('0x53'),_0x4a19c3['device'][_0x6237('0x54')],_0x4a19c3[_0x6237('0x51')]['vendor'],_0x4a19c3[_0x6237('0x51')][_0x6237('0x55')]):null,'deviceVendor':_0x4a19c3['device']['vendor'],'deviceType':_0x4a19c3[_0x6237('0x51')]['type'],'formData':JSON[_0x6237('0x1b')](_0x1d2e4b)};}exports[_0x6237('0x56')]=function(_0xb6875a,_0x392ad6){var _0x199744={'include':[{'model':db['Pause'],'as':_0x6237('0x57')}]},_0xe38cfb={},_0x3bdaa2={'count':0x0,'rows':[]};var _0x5422dc=_[_0x6237('0x3d')](db[_0x6237('0x58')][_0x6237('0x59')],function(_0x318351){return{'name':_0x318351[_0x6237('0x5a')],'type':_0x318351['type'][_0x6237('0x5b')]};});_0xe38cfb[_0x6237('0x54')]=_[_0x6237('0x3d')](_0x5422dc,_0x6237('0x2f'));_0xe38cfb[_0x6237('0x5c')]=_[_0x6237('0x5d')](_0xb6875a[_0x6237('0x5c')]);_0xe38cfb[_0x6237('0x5e')]=_[_0x6237('0x5f')](_0xe38cfb[_0x6237('0x54')],_0xe38cfb[_0x6237('0x5c')]);_0x199744[_0x6237('0x60')]=_[_0x6237('0x5f')](_0xe38cfb[_0x6237('0x54')],qs[_0x6237('0x61')](_0xb6875a[_0x6237('0x5c')]['fields']));_0x199744[_0x6237('0x60')]=_0x199744['attributes'][_0x6237('0x62')]?_0x199744['attributes']:_0xe38cfb[_0x6237('0x54')];if(!_0xb6875a[_0x6237('0x5c')]['hasOwnProperty'](_0x6237('0x63'))){_0x199744['limit']=qs['limit'](_0xb6875a[_0x6237('0x5c')][_0x6237('0x26')]);_0x199744['offset']=qs[_0x6237('0x25')](_0xb6875a[_0x6237('0x5c')][_0x6237('0x25')]);}_0x199744[_0x6237('0x64')]=qs[_0x6237('0x65')](_0xb6875a[_0x6237('0x5c')][_0x6237('0x65')]);_0x199744['where']=qs[_0x6237('0x5e')](_[_0x6237('0x66')](_0xb6875a[_0x6237('0x5c')],_0xe38cfb['filters']),_0x5422dc);if(_0xb6875a[_0x6237('0x5c')][_0x6237('0x67')]){_0x199744[_0x6237('0x68')]=_['merge'](_0x199744[_0x6237('0x68')],{'$or':_[_0x6237('0x3d')](_0x5422dc,function(_0x3597a8){if(_0x3597a8[_0x6237('0x55')]!==_0x6237('0x69')){var _0x3e53fa={};_0x3e53fa[_0x3597a8['name']]={'$like':'%'+_0xb6875a[_0x6237('0x5c')][_0x6237('0x67')]+'%'};return _0x3e53fa;}})});}_0x199744=_[_0x6237('0x6a')]({},_0x199744,_0xb6875a['options']);var _0x2de065={'where':_0x199744[_0x6237('0x68')]};return db[_0x6237('0x58')][_0x6237('0x28')](_0x2de065)[_0x6237('0x16')](function(_0x5803e2){_0x3bdaa2[_0x6237('0x28')]=_0x5803e2;if(_0xb6875a[_0x6237('0x5c')][_0x6237('0x6b')]){_0x199744[_0x6237('0x6c')]=[{'all':!![]}];}return db[_0x6237('0x58')][_0x6237('0x6d')](_0x199744);})[_0x6237('0x16')](function(_0x118c46){_0x3bdaa2['rows']=_0x118c46;return _0x3bdaa2;})['then'](respondWithFilteredResult(_0x392ad6,_0x199744))[_0x6237('0x3c')](handleError(_0x392ad6,null));};exports[_0x6237('0x6e')]=function(_0x22e637,_0x35a91f){var _0x259254={'raw':![],'where':{'id':_0x22e637[_0x6237('0x6f')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x2ff92f={};_0x2ff92f[_0x6237('0x54')]=_[_0x6237('0x5d')](db['ChatWebsite'][_0x6237('0x59')]);_0x2ff92f['query']=_[_0x6237('0x5d')](_0x22e637[_0x6237('0x5c')]);_0x2ff92f[_0x6237('0x5e')]=_[_0x6237('0x5f')](_0x2ff92f[_0x6237('0x54')],_0x2ff92f[_0x6237('0x5c')]);_0x259254['attributes']=_[_0x6237('0x5f')](_0x2ff92f[_0x6237('0x54')],qs[_0x6237('0x61')](_0x22e637[_0x6237('0x5c')]['fields']));_0x259254[_0x6237('0x60')]=_0x259254['attributes'][_0x6237('0x62')]?_0x259254[_0x6237('0x60')]:_0x2ff92f[_0x6237('0x54')];if(_0x22e637['query']['includeAll']){_0x259254[_0x6237('0x6c')]=[{'all':!![]}];}_0x259254=_[_0x6237('0x6a')]({},_0x259254,_0x22e637[_0x6237('0x70')]);return db[_0x6237('0x58')][_0x6237('0x71')](_0x259254)[_0x6237('0x16')](handleEntityNotFound(_0x35a91f,null))[_0x6237('0x16')](respondWithResult(_0x35a91f,null))[_0x6237('0x3c')](handleError(_0x35a91f,null));};exports[_0x6237('0x72')]=function(_0x107715,_0x1dd0db){return db[_0x6237('0x58')][_0x6237('0x72')](_0x107715[_0x6237('0x73')],{})[_0x6237('0x16')](function(_0x52c435){var _0x15a89c=_0x107715[_0x6237('0x74')][_0x6237('0x40')]({'plain':!![]});if(!_0x15a89c)throw new Error(_0x6237('0x75'));if(_0x15a89c['role']===_0x6237('0x74')){var _0xc39592=_0x52c435[_0x6237('0x40')]({'plain':!![]});var _0x250817='ChatWebsites';return db[_0x6237('0x76')][_0x6237('0x71')]({'where':{'name':_0x250817,'userProfileId':_0x15a89c[_0x6237('0x77')]},'raw':!![]})[_0x6237('0x16')](function(_0x41a9cf){if(_0x41a9cf&&_0x41a9cf[_0x6237('0x78')]===0x0){return db['UserProfileResource']['create']({'name':_0xc39592['name'],'resourceId':_0xc39592['id'],'type':_0x41a9cf[_0x6237('0x2f')],'sectionId':_0x41a9cf['id']},{})[_0x6237('0x16')](function(){return _0x52c435;});}else{return _0x52c435;}})[_0x6237('0x3c')](function(_0x348a0c){logger[_0x6237('0x1c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x348a0c);throw _0x348a0c;});}return _0x52c435;})[_0x6237('0x16')](respondWithResult(_0x1dd0db,0xc9))[_0x6237('0x3c')](handleError(_0x1dd0db,null));};exports[_0x6237('0x2b')]=function(_0x322008,_0x2777a){if(_0x322008[_0x6237('0x73')]['id']){delete _0x322008[_0x6237('0x73')]['id'];}return db['ChatWebsite'][_0x6237('0x71')]({'where':{'id':_0x322008[_0x6237('0x6f')]['id']},'include':[{'model':db[_0x6237('0x79')],'as':_0x6237('0x57')}]})[_0x6237('0x16')](handleEntityNotFound(_0x2777a,null))['then'](saveUpdates(_0x322008[_0x6237('0x73')],null))[_0x6237('0x16')](respondWithResult(_0x2777a,null))[_0x6237('0x3c')](handleError(_0x2777a,null));};exports[_0x6237('0x2c')]=function(_0x460a7d,_0x4182e4){return db[_0x6237('0x58')][_0x6237('0x71')]({'where':{'id':_0x460a7d[_0x6237('0x6f')]['id']}})[_0x6237('0x16')](handleEntityNotFound(_0x4182e4,null))['then'](removeEntity(_0x4182e4,null))['catch'](handleError(_0x4182e4,null));};exports['describe']=function(_0x11ace7,_0x27fdef){return db[_0x6237('0x58')]['describe']()['then'](respondWithResult(_0x27fdef,null))['catch'](handleError(_0x27fdef,null));};exports[_0x6237('0x7a')]=function(_0x323381,_0x42b071){if(_0x323381['body']['id']){delete _0x323381[_0x6237('0x73')]['id'];}return db[_0x6237('0x58')][_0x6237('0x71')]({'where':{'id':_0x323381[_0x6237('0x6f')]['id']}})['then'](handleEntityNotFound(_0x42b071,null))[_0x6237('0x16')](function(_0x5c789c){if(_0x5c789c){_0x323381['body'][_0x6237('0x7b')]=_0x5c789c['id'];return db[_0x6237('0x7c')][_0x6237('0x72')](_0x323381[_0x6237('0x73')]);}})[_0x6237('0x16')](respondWithResult(_0x42b071,null))[_0x6237('0x3c')](handleError(_0x42b071,null));};exports[_0x6237('0x7d')]=function(_0x466d79,_0x56aeda){var _0x16f99d={'raw':![],'where':{}};var _0x396f82={};var _0x1b7885={'count':0x0,'rows':[]};return db[_0x6237('0x58')][_0x6237('0x7e')]({'where':{'id':_0x466d79[_0x6237('0x6f')]['id']}})['then'](handleEntityNotFound(_0x56aeda,null))['then'](function(_0x1486c5){if(_0x1486c5){_0x396f82['model']=_[_0x6237('0x5d')](db[_0x6237('0x7c')]['rawAttributes']);_0x396f82[_0x6237('0x5c')]=_['keys'](_0x466d79[_0x6237('0x5c')]);_0x396f82[_0x6237('0x5e')]=_['intersection'](_0x396f82[_0x6237('0x54')],_0x396f82[_0x6237('0x5c')]);_0x16f99d[_0x6237('0x60')]=_[_0x6237('0x5f')](_0x396f82['model'],qs[_0x6237('0x61')](_0x466d79['query'][_0x6237('0x61')]));_0x16f99d['attributes']=_0x16f99d[_0x6237('0x60')]['length']?_0x16f99d[_0x6237('0x60')]:_0x396f82[_0x6237('0x54')];if(!_0x466d79[_0x6237('0x5c')]['hasOwnProperty'](_0x6237('0x63'))){_0x16f99d['limit']=qs[_0x6237('0x26')](_0x466d79['query']['limit']);_0x16f99d[_0x6237('0x25')]=qs[_0x6237('0x25')](_0x466d79[_0x6237('0x5c')]['offset']);}_0x16f99d[_0x6237('0x64')]=qs[_0x6237('0x65')](_0x466d79[_0x6237('0x5c')][_0x6237('0x65')]);_0x16f99d['where']=qs[_0x6237('0x5e')](_[_0x6237('0x66')](_0x466d79['query'],_0x396f82['filters']));_0x16f99d['where'][_0x6237('0x7b')]=_0x1486c5['id'];if(_0x466d79[_0x6237('0x5c')][_0x6237('0x67')]){_0x16f99d[_0x6237('0x68')]=_[_0x6237('0x6a')](_0x16f99d['where'],{'$or':_['map'](_0x16f99d[_0x6237('0x60')],function(_0x21a6a6){var _0x28688c={};_0x28688c[_0x21a6a6]={'$like':'%'+_0x466d79[_0x6237('0x5c')]['filter']+'%'};return _0x28688c;})});}_0x16f99d=_['merge']({},_0x16f99d,_0x466d79[_0x6237('0x70')]);return db[_0x6237('0x7c')][_0x6237('0x28')]({'where':_0x16f99d[_0x6237('0x68')]})['then'](function(_0x23a7b5){_0x1b7885[_0x6237('0x28')]=_0x23a7b5;if(_0x466d79[_0x6237('0x5c')][_0x6237('0x6b')]){_0x16f99d[_0x6237('0x6c')]=[{'all':!![]}];}return db[_0x6237('0x7c')][_0x6237('0x6d')](_0x16f99d);})[_0x6237('0x16')](function(_0x337296){_0x1b7885[_0x6237('0x7f')]=_0x337296;return _0x1b7885;});}})[_0x6237('0x16')](respondWithFilteredResult(_0x56aeda,_0x16f99d))[_0x6237('0x3c')](handleError(_0x56aeda,null));};exports[_0x6237('0x80')]=function(_0x1ccded,_0x57f581){return db[_0x6237('0x58')][_0x6237('0x71')]({'where':{'id':_0x1ccded[_0x6237('0x6f')]['id']}})[_0x6237('0x16')](handleEntityNotFound(_0x57f581,null))[_0x6237('0x16')](function(_0x17ed0f){if(_0x17ed0f){return _0x17ed0f[_0x6237('0x80')](_0x1ccded[_0x6237('0x5c')][_0x6237('0x81')]);}})[_0x6237('0x16')](respondWithStatusCode(_0x57f581,null))['catch'](handleError(_0x57f581,null));};exports[_0x6237('0x82')]=function(_0x5c8595,_0x274463){if(_0x5c8595['body']['id']){delete _0x5c8595[_0x6237('0x73')]['id'];}return db['ChatWebsite'][_0x6237('0x71')]({'where':{'id':_0x5c8595[_0x6237('0x6f')]['id']}})[_0x6237('0x16')](handleEntityNotFound(_0x274463,null))['then'](function(_0x122025){if(_0x122025){_0x5c8595[_0x6237('0x73')][_0x6237('0x7b')]=_0x122025['id'];return db[_0x6237('0x83')][_0x6237('0x72')](_0x5c8595[_0x6237('0x73')]);}})[_0x6237('0x16')](respondWithResult(_0x274463,null))[_0x6237('0x3c')](handleError(_0x274463,null));};exports[_0x6237('0x84')]=function(_0x4e14a6,_0x4a53a1){var _0x89480f={'raw':![],'where':{}};var _0x1e6ed4={};var _0x31acda={'count':0x0,'rows':[]};return db[_0x6237('0x58')][_0x6237('0x7e')]({'where':{'id':_0x4e14a6[_0x6237('0x6f')]['id']}})['then'](handleEntityNotFound(_0x4a53a1,null))[_0x6237('0x16')](function(_0x22d7c8){if(_0x22d7c8){_0x1e6ed4[_0x6237('0x54')]=_[_0x6237('0x5d')](db['CannedAnswer']['rawAttributes']);_0x1e6ed4[_0x6237('0x5c')]=_[_0x6237('0x5d')](_0x4e14a6[_0x6237('0x5c')]);_0x1e6ed4[_0x6237('0x5e')]=_[_0x6237('0x5f')](_0x1e6ed4[_0x6237('0x54')],_0x1e6ed4[_0x6237('0x5c')]);_0x89480f[_0x6237('0x60')]=_[_0x6237('0x5f')](_0x1e6ed4[_0x6237('0x54')],qs[_0x6237('0x61')](_0x4e14a6[_0x6237('0x5c')][_0x6237('0x61')]));_0x89480f['attributes']=_0x89480f[_0x6237('0x60')][_0x6237('0x62')]?_0x89480f[_0x6237('0x60')]:_0x1e6ed4[_0x6237('0x54')];if(!_0x4e14a6[_0x6237('0x5c')][_0x6237('0x85')]('nolimit')){_0x89480f[_0x6237('0x26')]=qs[_0x6237('0x26')](_0x4e14a6[_0x6237('0x5c')][_0x6237('0x26')]);_0x89480f[_0x6237('0x25')]=qs[_0x6237('0x25')](_0x4e14a6[_0x6237('0x5c')][_0x6237('0x25')]);}_0x89480f['order']=qs[_0x6237('0x65')](_0x4e14a6[_0x6237('0x5c')][_0x6237('0x65')]);_0x89480f[_0x6237('0x68')]=qs[_0x6237('0x5e')](_[_0x6237('0x66')](_0x4e14a6[_0x6237('0x5c')],_0x1e6ed4[_0x6237('0x5e')]));_0x89480f[_0x6237('0x68')]['ChatWebsiteId']=_0x22d7c8['id'];if(_0x4e14a6[_0x6237('0x5c')][_0x6237('0x67')]){_0x89480f['where']=_[_0x6237('0x6a')](_0x89480f['where'],{'$or':_[_0x6237('0x3d')](_0x89480f[_0x6237('0x60')],function(_0x2aa28a){var _0x4c6c4a={};_0x4c6c4a[_0x2aa28a]={'$like':'%'+_0x4e14a6['query']['filter']+'%'};return _0x4c6c4a;})});}_0x89480f=_[_0x6237('0x6a')]({},_0x89480f,_0x4e14a6[_0x6237('0x70')]);return db[_0x6237('0x83')]['count']({'where':_0x89480f[_0x6237('0x68')]})['then'](function(_0x1c3774){_0x31acda['count']=_0x1c3774;if(_0x4e14a6[_0x6237('0x5c')][_0x6237('0x6b')]){_0x89480f['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x6237('0x6d')](_0x89480f);})['then'](function(_0x22ac7d){_0x31acda[_0x6237('0x7f')]=_0x22ac7d;return _0x31acda;});}})[_0x6237('0x16')](respondWithFilteredResult(_0x4a53a1,_0x89480f))[_0x6237('0x3c')](handleError(_0x4a53a1,null));};exports[_0x6237('0x86')]=function(_0xf6815,_0x45d977){return db[_0x6237('0x58')][_0x6237('0x71')]({'where':{'id':_0xf6815[_0x6237('0x6f')]['id']}})[_0x6237('0x16')](handleEntityNotFound(_0x45d977,null))[_0x6237('0x16')](function(_0x286513){if(_0x286513){return _0x286513[_0x6237('0x86')](_0xf6815[_0x6237('0x5c')][_0x6237('0x81')]);}})['then'](respondWithStatusCode(_0x45d977,null))['catch'](handleError(_0x45d977,null));};exports[_0x6237('0x87')]=function(_0x35f723,_0x3a2dee){_0x35f723['body'][_0x6237('0x88')]=_0x35f723['file'][_0x6237('0x89')];return db['ChatWebsite'][_0x6237('0x71')]({'where':{'id':_0x35f723[_0x6237('0x6f')]['id']}})['then'](handleEntityNotFound(_0x3a2dee,null))['then'](saveUpdates(_0x35f723['body'],null))[_0x6237('0x16')](respondWithResult(_0x3a2dee,null))[_0x6237('0x3c')](handleError(_0x3a2dee,null));};exports[_0x6237('0x8a')]=function(_0x58823a,_0x897cd1){_0x58823a[_0x6237('0x73')]['agentAvatar']=_0x58823a['file']['filename'];return db[_0x6237('0x58')][_0x6237('0x71')]({'where':{'id':_0x58823a[_0x6237('0x6f')]['id']}})['then'](handleEntityNotFound(_0x897cd1,null))['then'](saveUpdates(_0x58823a[_0x6237('0x73')],null))['then'](respondWithResult(_0x897cd1,null))['catch'](handleError(_0x897cd1,null));};exports[_0x6237('0x8b')]=function(_0x2b6549,_0x297609){_0x2b6549['body'][_0x6237('0x8c')]=_0x2b6549[_0x6237('0x8d')][_0x6237('0x89')];return db[_0x6237('0x58')][_0x6237('0x71')]({'where':{'id':_0x2b6549[_0x6237('0x6f')]['id']}})[_0x6237('0x16')](handleEntityNotFound(_0x297609,null))[_0x6237('0x16')](saveUpdates(_0x2b6549[_0x6237('0x73')],null))[_0x6237('0x16')](respondWithResult(_0x297609,null))['catch'](handleError(_0x297609,null));};exports['addSystemAvatar']=function(_0x1fe62a,_0x10e1f3){_0x1fe62a[_0x6237('0x73')][_0x6237('0x8e')]=_0x1fe62a[_0x6237('0x8d')][_0x6237('0x89')];return db[_0x6237('0x58')][_0x6237('0x71')]({'where':{'id':_0x1fe62a[_0x6237('0x6f')]['id']}})['then'](handleEntityNotFound(_0x10e1f3,null))[_0x6237('0x16')](saveUpdates(_0x1fe62a[_0x6237('0x73')],null))[_0x6237('0x16')](respondWithResult(_0x10e1f3,null))[_0x6237('0x3c')](handleError(_0x10e1f3,null));};exports[_0x6237('0x8f')]=function(_0x362fe3,_0x5efcef){var _0x11a5a6=path[_0x6237('0x90')](config[_0x6237('0x91')],_0x6237('0x92'));var _0x3ac902={'where':{'id':_0x362fe3[_0x6237('0x6f')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x1ad886=![];return require('../../config/license/util')[_0x6237('0x93')]()[_0x6237('0x16')](function(_0xc2e95e){if(_0xc2e95e){_0x1ad886=_0xc2e95e['custom'];}})['then'](function(){return db[_0x6237('0x58')]['find'](_0x3ac902);})[_0x6237('0x16')](handleEntityNotFound(_0x5efcef,null))['then'](function(_0x169d28){if(_0x169d28){if(!_[_0x6237('0x94')](_0x169d28['sitepic'])){if(fs[_0x6237('0x95')](path[_0x6237('0x90')](config[_0x6237('0x91')],_0x6237('0x96'),_0x169d28[_0x6237('0x88')]))&&_0x1ad886){_0x11a5a6=path['join'](config[_0x6237('0x91')],_0x6237('0x96'),_0x169d28[_0x6237('0x88')]);}}return _0x5efcef['download'](_0x11a5a6);}})[_0x6237('0x3c')](handleError(_0x5efcef,null));};exports['getAvatar']=function(_0x77fb4e,_0x59fd7e){var _0x3d5097=path[_0x6237('0x90')](config[_0x6237('0x91')],_0x6237('0x97'));var _0x5e585f={'where':{'id':_0x77fb4e[_0x6237('0x6f')]['id']},'attributes':['id',_0x6237('0x98')],'raw':!![]};return db['ChatWebsite'][_0x6237('0x71')](_0x5e585f)[_0x6237('0x16')](handleEntityNotFound(_0x59fd7e,null))[_0x6237('0x16')](function(_0x57a85d){if(_0x57a85d){if(!_['isNil'](_0x57a85d[_0x6237('0x98')])){if(fs[_0x6237('0x95')](path[_0x6237('0x90')](config[_0x6237('0x91')],_0x6237('0x99'),_0x57a85d[_0x6237('0x98')]))){_0x3d5097=path[_0x6237('0x90')](config[_0x6237('0x91')],_0x6237('0x99'),_0x57a85d[_0x6237('0x98')]);}}return _0x59fd7e['download'](_0x3d5097);}})[_0x6237('0x3c')](handleError(_0x59fd7e,null));};exports[_0x6237('0x9a')]=function(_0x5982d0,_0x83567f){var _0x35a167=path[_0x6237('0x90')](config[_0x6237('0x91')],_0x6237('0x9b'));var _0x209ff4={'where':{'id':_0x5982d0['params']['id']},'attributes':['id',_0x6237('0x8c'),_0x6237('0x9c')],'raw':!![]};return db[_0x6237('0x58')][_0x6237('0x71')](_0x209ff4)[_0x6237('0x16')](handleEntityNotFound(_0x83567f,null))[_0x6237('0x16')](function(_0x1e1835){if(_0x1e1835){if(!_[_0x6237('0x94')](_0x1e1835[_0x6237('0x8c')])){if(fs[_0x6237('0x95')](path[_0x6237('0x90')](config[_0x6237('0x91')],_0x6237('0x99'),_0x1e1835[_0x6237('0x8c')]))&&_0x1e1835[_0x6237('0x9c')]){_0x35a167=path[_0x6237('0x90')](config['root'],_0x6237('0x99'),_0x1e1835[_0x6237('0x8c')]);}}return _0x83567f['download'](_0x35a167);}})[_0x6237('0x3c')](handleError(_0x83567f,null));};exports['getSystemAvatar']=function(_0x1520b5,_0x5c71b5){var _0xa62ad4=path['join'](config[_0x6237('0x91')],_0x6237('0x9d'));var _0x3e37b9={'where':{'id':_0x1520b5[_0x6237('0x6f')]['id']},'attributes':['id',_0x6237('0x8e')],'raw':!![]};return db[_0x6237('0x58')][_0x6237('0x71')](_0x3e37b9)[_0x6237('0x16')](handleEntityNotFound(_0x5c71b5,null))['then'](function(_0x1b281f){if(_0x1b281f){if(!_['isNil'](_0x1b281f[_0x6237('0x8e')])){if(fs[_0x6237('0x95')](path[_0x6237('0x90')](config[_0x6237('0x91')],'server/files/images/avatars/',_0x1b281f[_0x6237('0x8e')]))){_0xa62ad4=path[_0x6237('0x90')](config[_0x6237('0x91')],'server/files/images/avatars/',_0x1b281f[_0x6237('0x8e')]);}}return _0x5c71b5[_0x6237('0x9e')](_0xa62ad4);}})[_0x6237('0x3c')](handleError(_0x5c71b5,null));};exports[_0x6237('0x9f')]=function(_0x53ea1b,_0x88623e){var _0x1a4755={'body':_0x53ea1b[_0x6237('0x73')],'channel':_0x6237('0xa0')};var _0x1ab052=[];var _0x5af553=[];var _0x44d3b9={};var _0x1706fa=![];return db[_0x6237('0xa1')][_0x6237('0xa2')]()[_0x6237('0x16')](function(_0x4b2d3a){if(!_0x4b2d3a){throw new db[(_0x6237('0xa3'))]['ValidationError'](_0x6237('0xa4'));}_0x1ab052=_[_0x6237('0xa5')](_['keys'](_0x4b2d3a),[_0x6237('0xa6'),_0x6237('0xa7')]);_0x5af553=_[_0x6237('0xa5')](_['keys'](_0x4b2d3a),[_0x6237('0xa6'),'updatedAt','CompanyId','ListId']);if(_0x53ea1b['body']['id']){delete _0x53ea1b[_0x6237('0x73')]['id'];}if(_[_0x6237('0x94')](_0x53ea1b[_0x6237('0x73')][_0x6237('0xa8')])){throw new db[(_0x6237('0xa3'))][(_0x6237('0xa9'))](_0x6237('0xaa'));}if(_[_0x6237('0x94')](_0x53ea1b[_0x6237('0x73')]['body'])||_0x53ea1b['body']['body']===''){throw new db[(_0x6237('0xa3'))][(_0x6237('0xa9'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x6237('0x94')](_0x53ea1b[_0x6237('0x73')][_0x6237('0xab')])){throw new db[(_0x6237('0xa3'))]['ValidationError'](_0x6237('0xac')+_0x5af553);}if(!_['includes'](_0x5af553,_0x53ea1b[_0x6237('0x73')][_0x6237('0xab')])){throw new db[(_0x6237('0xa3'))][(_0x6237('0xa9'))](_0x6237('0xad')+_0x5af553);}_0x44d3b9[_0x53ea1b[_0x6237('0x73')]['mapKey']]=_0x53ea1b[_0x6237('0x73')][_0x6237('0xa8')];})[_0x6237('0x16')](function(){return db[_0x6237('0x58')][_0x6237('0x71')]({'where':{'id':_0x53ea1b['params']['id']},'include':[{'model':db['CmList'],'as':_0x6237('0xae'),'include':[{'model':db[_0x6237('0xa1')],'as':_0x6237('0xaf'),'where':_0x44d3b9,'limit':0x1,'order':[[_0x6237('0xa7'),'DESC']]}]},{'model':db[_0x6237('0xb0')],'as':_0x6237('0xb1')},{'model':db[_0x6237('0x3e')],'as':'Interval','include':[{'model':db[_0x6237('0x3e')],'as':_0x6237('0x3f'),'attributes':['id',_0x6237('0x34')],'raw':!![]}]}]});})[_0x6237('0x16')](function(_0x3bf0d3){if(!_0x3bf0d3)throw new APINotFoundError(util['format'](_0x6237('0xb2'),_0x53ea1b['params']['id']));if(!_0x3bf0d3[_0x6237('0x3e')]||!_0x3bf0d3[_0x6237('0x3e')]['Intervals'])return[_0x3bf0d3,!![]];return[_0x3bf0d3,checkWebsiteIntervals(_0x3bf0d3)];})[_0x6237('0xb3')](function(_0x545222,_0x307bcf){if(!_0x307bcf)throw new APIOutOfIntervalError();if(!_0x545222[_0x6237('0xae')])return;_0x1a4755[_0x6237('0xb4')]=_0x545222;_0x1a4755[_0x6237('0xb5')]=_0x545222[_0x6237('0xae')];_0x1a4755[_0x6237('0xb6')]=_[_0x6237('0xb7')](_0x545222['Applications'],[_0x6237('0xb8')],[_0x6237('0xb9')]);if(_0x1a4755[_0x6237('0xb4')][_0x6237('0xb1')]){delete _0x1a4755['account']['Applications'];}if(_0x1a4755[_0x6237('0xb4')][_0x6237('0xae')]&&_0x1a4755[_0x6237('0xb4')][_0x6237('0xae')][_0x6237('0xaf')][_0x6237('0x62')]){return _0x1a4755[_0x6237('0xb4')][_0x6237('0xae')][_0x6237('0xaf')][0x0];}var _0x454f29=_[_0x6237('0xe')](_0x53ea1b[_0x6237('0x73')],{'firstName':_0x53ea1b[_0x6237('0x73')]['from'],'ListId':_0x545222[_0x6237('0xba')]});_0x454f29[_0x53ea1b[_0x6237('0x73')]['mapKey']]=_0x53ea1b[_0x6237('0x73')][_0x6237('0xa8')];return db['CmContact'][_0x6237('0x72')](_0x454f29,{'fields':_0x1ab052,'raw':!![]});})[_0x6237('0x16')](function(_0xe4fbf2){_0x1a4755['contact']=_0xe4fbf2;var _0x4d7d8d=createInteractionObject(_0x53ea1b[_0x6237('0x6f')]['id'],_0x53ea1b[_0x6237('0x73')],_0x53ea1b['headers'],_0xe4fbf2);var _0x23f4c0={'ChatWebsiteId':_0x53ea1b['params']['id'],'closed':![]};if(_0x53ea1b[_0x6237('0x73')][_0x6237('0xbb')]){_0x23f4c0[_0x6237('0xbb')]=_0x53ea1b[_0x6237('0x73')]['threadId'];return db[_0x6237('0xbc')][_0x6237('0x71')]({'where':_0x23f4c0})['then'](function(_0x3e25a2){if(_0x3e25a2){_0x1706fa=!![];return _0x3e25a2;}_0x4d7d8d[_0x6237('0xbb')]=_0x53ea1b[_0x6237('0x73')]['threadId'];_0x4d7d8d[_0x6237('0xbd')]=_0x53ea1b[_0x6237('0x73')][_0x6237('0xbd')];return db['ChatInteraction'][_0x6237('0x72')](_0x4d7d8d);});}_0x23f4c0['ContactId']=_0xe4fbf2['id'];if(_0x53ea1b[_0x6237('0x73')][_0x6237('0xbe')]&&_0x53ea1b[_0x6237('0x73')][_0x6237('0xbe')]['id']){_0x23f4c0['id']=_0x53ea1b[_0x6237('0x73')][_0x6237('0xbe')]['id'];return db['ChatInteraction'][_0x6237('0x71')]({'where':_0x23f4c0})[_0x6237('0x16')](function(_0x533a06){if(_0x533a06){_0x1706fa=!![];return _0x533a06;}return db[_0x6237('0xbc')][_0x6237('0x72')](_0x4d7d8d);});}return db[_0x6237('0xbc')][_0x6237('0x72')](_0x4d7d8d);})[_0x6237('0x16')](function(_0x3852ff){if(!_0x1706fa)return _0x3852ff;var _0x377541={'from':(_0x1a4755[_0x6237('0xbf')][_0x6237('0x49')]||'')+'\x20'+(_0x1a4755['contact'][_0x6237('0x4a')]||'')};if(_0x53ea1b['body'][_0x6237('0xbb')]&&_0x53ea1b[_0x6237('0x73')][_0x6237('0xc0')]&&_0x53ea1b[_0x6237('0x73')][_0x6237('0xbb')]!=_0x53ea1b[_0x6237('0x73')][_0x6237('0xc0')]){_0x377541[_0x6237('0xbb')]=_0x53ea1b[_0x6237('0x73')][_0x6237('0xc0')];}return _0x3852ff[_0x6237('0x2b')](_0x377541);})[_0x6237('0x16')](function(_0x1752ef){_0x1a4755['interaction']=_0x1752ef[_0x6237('0x40')]({'plain':!![]});_0x1a4755[_0x6237('0xbe')][_0x6237('0xc1')]=!_0x1706fa;if(_0x1a4755[_0x6237('0xbe')][_0x6237('0xc1')]){if(_0x1a4755[_0x6237('0xb4')][_0x6237('0xc2')]){_0x1a4755[_0x6237('0xb6')]['push']({'id':0x0,'priority':_0x1a4755[_0x6237('0xb6')][_0x6237('0x62')]+0x1,'app':'close','appdata':_0x6237('0xc3'),'interval':'*,*,*,*'});}}return db[_0x6237('0xc4')][_0x6237('0x72')]({'body':_0x53ea1b['body'][_0x6237('0x73')],'ChatWebsiteId':_0x53ea1b[_0x6237('0x6f')]['id'],'ChatInteractionId':_0x1752ef['id'],'direction':'in','ContactId':_0x1a4755[_0x6237('0xbf')]['id'],'AttachmentId':_0x53ea1b[_0x6237('0x73')][_0x6237('0xc5')]});})[_0x6237('0x16')](function(_0xdcdb1){_0x1a4755[_0x6237('0x1f')]=_0xdcdb1;if(!_0x1a4755[_0x6237('0xbe')][_0x6237('0xc6')]){return;}return db[_0x6237('0xc7')]['find']({'attributes':['id',_0x6237('0x2f')],'where':{'id':_0x1a4755[_0x6237('0xbe')]['UserId']}});})[_0x6237('0x16')](function(_0x226cfb){if(_0x226cfb){_0x1a4755[_0x6237('0xb6')][_0x6237('0xc8')]({'id':0x0,'priority':0x0,'app':_0x6237('0xc9'),'appdata':_0x226cfb[_0x6237('0x2f')]+','+(_0x1a4755['account']['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});_0x1a4755[_0x6237('0xca')]=!![];}if(!_0x1a4755['interaction']['queueId']){return;}return db[_0x6237('0xcb')][_0x6237('0x71')]({'attributes':['id',_0x6237('0x2f')],'where':{'id':_0x1a4755[_0x6237('0xbe')]['queueId']}});})[_0x6237('0x16')](function(_0xf148de){if(_0xf148de){_0x1a4755[_0x6237('0xb6')][_0x6237('0xc8')]({'id':0x0,'priority':0x1,'app':'queue','appdata':_0xf148de[_0x6237('0x2f')]+','+(_0x1a4755['account']['waitForTheAssignedQueue']||0x12c),'interval':_0x6237('0xcc')});}return respondWithRpcPromise(_0x6237('0xcd'),'startRouting',_0x1a4755);})['then'](function(_0x536c1f){respondWithRpcPromise('EventManager','EventManager',{'event':_0x6237('0x9f'),'message':_0x536c1f},client9002);return _0x536c1f;})[_0x6237('0x16')](respondWithResult(_0x88623e,null))['catch'](APIHandleError(_0x88623e));};exports[_0x6237('0xce')]=function(_0xee4ac3,_0x4b64d3){var _0x3de1f8,_0x4d13fb,_0x40dbde;var _0x4977c6=[];var _0x4d7ae6={};var _0x3f2b16=_0xee4ac3[_0x6237('0xcf')]||[];var _0xab4c9c=[];var _0x593ebb;return db[_0x6237('0xa1')][_0x6237('0xa2')]()[_0x6237('0x16')](function(_0x385356){if(!_0x385356){throw new db[(_0x6237('0xa3'))]['ValidationError'](_0x6237('0xa4'));}_0x4977c6=_[_0x6237('0xa5')](_[_0x6237('0x5d')](_0x385356),[_0x6237('0xa6'),'updatedAt',_0x6237('0xd0'),_0x6237('0xba')]);if(_0xee4ac3['body']['id']){delete _0xee4ac3[_0x6237('0x73')]['id'];}if(_[_0x6237('0x94')](_0xee4ac3[_0x6237('0x73')][_0x6237('0xa8')])){throw _0x4b64d3[_0x6237('0x23')](0x1f4)['send'](new db[(_0x6237('0xa3'))]['ValidationError']('from\x20is\x20mandatory'));}if(_[_0x6237('0x94')](_0xee4ac3[_0x6237('0x73')][_0x6237('0x73')])||_0xee4ac3['body'][_0x6237('0x73')]===''){throw _0x4b64d3[_0x6237('0x23')](0x1f4)['send'](new db[(_0x6237('0xa3'))][(_0x6237('0xa9'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x6237('0x94')](_0xee4ac3[_0x6237('0x73')][_0x6237('0xd1')])){throw _0x4b64d3[_0x6237('0x23')](0x1f4)[_0x6237('0x30')](new db[(_0x6237('0xa3'))][(_0x6237('0xa9'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4977c6));}if(!_[_0x6237('0xd2')](_0x4977c6,_0xee4ac3['body'][_0x6237('0xd1')])){throw _0x4b64d3[_0x6237('0x23')](0x1f4)['send'](new db[(_0x6237('0xa3'))][(_0x6237('0xa9'))](_0x6237('0xd3')+_0x4977c6));}_0x4d7ae6[_0xee4ac3[_0x6237('0x73')][_0x6237('0xd1')]]=_0xee4ac3['body'][_0x6237('0xa8')];})[_0x6237('0x16')](function(){return db['ChatWebsite'][_0x6237('0x71')]({'where':{'id':_0xee4ac3[_0x6237('0x6f')]['id']},'include':[{'model':db['CmList'],'as':_0x6237('0xae')},{'model':db[_0x6237('0xd4')],'as':_0x6237('0xd4')}]});})[_0x6237('0x16')](handleEntityNotFound(_0x4b64d3,null))[_0x6237('0x16')](function(_0x374dfd){if(_0x374dfd&&_0x374dfd[_0x6237('0xae')]){_0x4d13fb=_0x374dfd;var _0x238c60=_[_0x6237('0xe')](_0xee4ac3['body'],{'firstName':_0xee4ac3[_0x6237('0x73')][_0x6237('0xa8')],'phone':_0xee4ac3[_0x6237('0x73')]['from'],'ListId':_0x374dfd[_0x6237('0xba')]});_0x238c60[_0xee4ac3[_0x6237('0x73')][_0x6237('0xd1')]]=_0xee4ac3[_0x6237('0x73')]['from'];return db[_0x6237('0xa1')]['findOrCreate']({'where':_0x4d7ae6,'defaults':_0x238c60});}})[_0x6237('0xb3')](function(_0xa136e){if(_0xa136e){_0x40dbde=_0xa136e;var _0x20c102=fs['readFileSync'](path[_0x6237('0x90')](config[_0x6237('0x91')],'server/files/templates/chatOfflineMessage.ejs'),_0x6237('0xd5'));var _0xef466d=ejs[_0x6237('0xd6')](_0x20c102,{'body':_[_0x6237('0xd7')](_0xee4ac3['body'][_0x6237('0x73')]),'bodyTitle':_0x4d13fb[_0x6237('0xd8')]});return db[_0x6237('0xd9')][_0x6237('0x72')]({'body':_0xef466d,'plainBody':htmlToText[_0x6237('0xda')](_0xef466d),'ContactId':_0xa136e['id'],'ChatWebsiteId':_0x4d13fb['id']});}})[_0x6237('0x16')](function(_0x305ca9){_0x593ebb=_0x305ca9;if(_0x3f2b16[_0x6237('0x62')]){var _0x188008=_0x3f2b16[_0x6237('0x3d')](function(_0xc69516){return{'name':_0xc69516[_0x6237('0xdb')],'basename':_0xc69516[_0x6237('0x89')],'type':_0xc69516[_0x6237('0xdc')],'ChatOfflineMessageId':_0x305ca9['id']};});_0xab4c9c=_0x188008[_0x6237('0x3d')](_0x3ea4b0=>{var _0x173eba={'filename':_0x3ea4b0[_0x6237('0x2f')],'path':path[_0x6237('0x90')](config[_0x6237('0x91')],_0x6237('0xdd'),_0x6237('0xcf'),_0x6237('0xde'),_0x6237('0xdf'),_0x3ea4b0[_0x6237('0xe0')])};return _0x173eba;});if(!_0x4d13fb[_0x6237('0xe1')]){return db['sequelize'][_0x6237('0xe2')](function(_0x6ec48){return db['Attachment'][_0x6237('0xe3')](_0x188008,{'transaction':_0x6ec48});});}}})[_0x6237('0x16')](function(){if(_0x593ebb){_0x3de1f8=_0x593ebb;return db['MailAccount']['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x6237('0xe4')],'as':_0x6237('0xe5'),'raw':!![],'include':[{'model':db[_0x6237('0xe6')],'as':'CloudProvider','raw':!![]}]}]});}})['then'](function(_0x4e3fe1){if(_0x4e3fe1&&_0x4e3fe1['Smtp']&&_0x4d13fb[_0x6237('0xe7')]&&_0x4d13fb['forwardOfflineAddress']){var _0xb5082a=_0x4e3fe1['getSmtpOptions']();return respondWithRpcPromise('SendMail',_0x6237('0xe8'),{'account':_0xb5082a,'message':{'from':util[_0x6237('0x32')](_0x6237('0xe9'),_0x4e3fe1[_0x6237('0x2f')],_0x4e3fe1[_0x6237('0xea')]||_0x4e3fe1[_0x6237('0xe5')][_0x6237('0x74')]),'to':_0x4d13fb[_0x6237('0xeb')],'subject':_0x4d13fb[_0x6237('0xec')],'html':_0x3de1f8['body'],'attachments':_0xab4c9c}},client9003)['then'](function(){return _0x3de1f8;})[_0x6237('0x3c')](function(_0x59e536){logger[_0x6237('0x1c')](_0x59e536);});}})['then'](function(){if(_0x4d13fb&&_0x4d13fb['openNewInteraction']&&_0x4d13fb[_0x6237('0xed')]){var _0x51817d=[];if(_0x3f2b16[_0x6237('0x62')]){_0x51817d=_0x3f2b16['map'](function(_0x1a4053){return{'name':_0x1a4053['originalname'],'basename':_0x1a4053[_0x6237('0x89')],'type':_0x1a4053[_0x6237('0xdc')],'ChatOfflineMessageId':_0x593ebb['id']};});}var _0x2327e8;if(!_[_0x6237('0x94')](_0x4d13fb[_0x6237('0xee')])){var _0x1291e1=_[_0x6237('0x3d')](_0xee4ac3[_0x6237('0x73')],function(_0x362061){return _0x362061;});var _0x54bdef=_[_0x6237('0xef')](_0x1291e1)[0x0];var _0x3d0511=_['mapValues'](_0x54bdef,function(_0x3084c3){return _0x3084c3;});_0x2327e8=_0x3d0511[0x1][_0x4d13fb[_0x6237('0xee')]];}var _0xdf61da={'from':_0x40dbde['email'],'firstName':_0x40dbde[_0x6237('0x49')],'lastName':_0x40dbde[_0x6237('0x4a')],'mapKey':_0x6237('0xea'),'message':{'from':_0x40dbde[_0x6237('0xea')],'to':_0x4d13fb['MailAccount']['email'],'cc':'','subject':_[_0x6237('0x94')](_0x2327e8)?_0x4d13fb[_0x6237('0xec')]:_0x2327e8,'messageId':'','sentAt':new Date(),'attach':_0x51817d[_0x6237('0x62')],'attachments':_0x51817d,'originChannel':'Chat','ChatWebsiteId':_0x4d13fb['id'],'ChatOfflineMessageId':_0x3de1f8['id'],'originTo':_0x4d13fb[_0x6237('0xd4')][_0x6237('0xea')]},'body':_0x3de1f8[_0x6237('0x73')]};var _0x29f3fa={'account':{'id':_0x4d13fb[_0x6237('0xed')]},'body':_0xdf61da,'log':_0x6237('0xf0')};return respondWithRpcPromise(_0x6237('0xf0'),_0x6237('0xf1'),_0x29f3fa,client9001)[_0x6237('0x16')](function(){return _0x3de1f8;})[_0x6237('0x3c')](function(_0x24fc8a){logger[_0x6237('0x1c')](_0x24fc8a);});}return;})['then'](function(){if(_0x3de1f8){return _0x3de1f8;}})[_0x6237('0x16')](respondWithResult(_0x4b64d3,null))[_0x6237('0x3c')](function(){for(var _0x2cd168 of _0x3f2b16){var _0x42c13b=path[_0x6237('0x90')](config[_0x6237('0x91')],_0x6237('0xdd'),_0x6237('0xcf'),'attachments',_0x6237('0xdf'),_0x2cd168[_0x6237('0x89')]);fs_extra['remove'](_0x42c13b)['catch'](function(_0x31b59c){logger['error']('Could\x20not\x20remove\x20attachment\x20file',_0x42c13b,_0x31b59c);});}});};exports[_0x6237('0xf2')]=function(_0xbef797,_0x2a483e){return db[_0x6237('0xbc')][_0x6237('0x71')]({'where':{'id':_0xbef797[_0x6237('0x6f')]['id']}})['then'](handleEntityNotFound(_0x2a483e,null))['then'](function(_0x2dc6ad){if(_0x2dc6ad){return _0x2dc6ad[_0x6237('0xf2')](_0xbef797['body'][_0x6237('0x81')],_[_0x6237('0xf3')](_0xbef797[_0x6237('0x73')],[_0x6237('0x81'),'id'])||{});}})['then'](respondWithResult(_0x2a483e,null))[_0x6237('0x3c')](handleError(_0x2a483e,null));};exports[_0x6237('0xf4')]=function(_0x344656,_0x59e113){var _0x28d652={'raw':![],'where':{}};var _0xf0fa8e={};var _0x2addfa={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x6237('0x7e')]({'where':{'id':_0x344656[_0x6237('0x6f')]['id']}})[_0x6237('0x16')](handleEntityNotFound(_0x59e113,null))[_0x6237('0x16')](function(_0x588e21){if(_0x588e21){_0xf0fa8e[_0x6237('0x54')]=_[_0x6237('0x5d')](db[_0x6237('0xbc')]['rawAttributes']);_0xf0fa8e[_0x6237('0x5c')]=_[_0x6237('0x5d')](_0x344656[_0x6237('0x5c')]);_0xf0fa8e[_0x6237('0x5e')]=_[_0x6237('0x5f')](_0xf0fa8e[_0x6237('0x54')],_0xf0fa8e[_0x6237('0x5c')]);_0x28d652[_0x6237('0x60')]=_[_0x6237('0x5f')](_0xf0fa8e['model'],qs[_0x6237('0x61')](_0x344656[_0x6237('0x5c')][_0x6237('0x61')]));_0x28d652[_0x6237('0x60')]=_0x28d652['attributes'][_0x6237('0x62')]?_0x28d652['attributes']:_0xf0fa8e['model'];if(!_0x344656[_0x6237('0x5c')][_0x6237('0x85')](_0x6237('0x63'))){_0x28d652[_0x6237('0x26')]=qs[_0x6237('0x26')](_0x344656[_0x6237('0x5c')]['limit']);_0x28d652[_0x6237('0x25')]=qs[_0x6237('0x25')](_0x344656[_0x6237('0x5c')][_0x6237('0x25')]);}_0x28d652[_0x6237('0x64')]=qs[_0x6237('0x65')](_0x344656['query'][_0x6237('0x65')]);_0x28d652['where']=qs[_0x6237('0x5e')](_['pick'](_0x344656[_0x6237('0x5c')],_0xf0fa8e[_0x6237('0x5e')]));_0x28d652[_0x6237('0x68')][_0x6237('0x7b')]=_0x588e21['id'];if(_0x344656[_0x6237('0x5c')][_0x6237('0x67')]){_0x28d652[_0x6237('0x68')]=_['merge'](_0x28d652[_0x6237('0x68')],{'$or':_[_0x6237('0x3d')](_0x28d652['attributes'],function(_0x53583c){var _0x38e222={};_0x38e222[_0x53583c]={'$like':'%'+_0x344656[_0x6237('0x5c')][_0x6237('0x67')]+'%'};return _0x38e222;})});}_0x28d652=_['merge']({},_0x28d652,_0x344656[_0x6237('0x70')]);return db[_0x6237('0xbc')][_0x6237('0x28')]({'where':_0x28d652[_0x6237('0x68')]})[_0x6237('0x16')](function(_0x2e4892){_0x2addfa['count']=_0x2e4892;if(_0x344656[_0x6237('0x5c')][_0x6237('0x6b')]){_0x28d652[_0x6237('0x6c')]=[{'model':db[_0x6237('0xa1')],'as':_0x6237('0xf5'),'required':![]},{'model':db[_0x6237('0xc7')],'as':_0x6237('0xf6'),'attributes':[_0x6237('0x2f'),'fullname','internal'],'required':![]},{'model':db[_0x6237('0xf7')],'as':'Tags','attributes':['id','name','color'],'where':_0x344656[_0x6237('0x5c')][_0x6237('0xf8')]?{'id':_0x344656[_0x6237('0x5c')][_0x6237('0xf8')]}:undefined,'required':_0x344656[_0x6237('0x5c')][_0x6237('0xf8')]?!![]:![]}];}return db['ChatInteraction'][_0x6237('0x6d')](_0x28d652);})[_0x6237('0x16')](function(_0x5046dc){_0x2addfa['rows']=_0x5046dc;return _0x2addfa;});}})[_0x6237('0x16')](respondWithFilteredResult(_0x59e113,_0x28d652))[_0x6237('0x3c')](handleError(_0x59e113,null));};exports[_0x6237('0xf9')]=function(_0x5c280d,_0x3933c0){var _0x91247d=0x0;var _0x2df18b=0x0;var _0xbb0cb6=![];var _0x207f3a;var _0x43a152;return db[_0x6237('0x58')]['find']({'where':{'id':_0x5c280d[_0x6237('0x6f')]['id']},'include':[{'model':db[_0x6237('0x3e')],'as':_0x6237('0x3e'),'include':[{'model':db['Interval'],'as':_0x6237('0x3f'),'attributes':['id',_0x6237('0x34')]}]}]})['then'](handleEntityNotFound(_0x3933c0,null))[_0x6237('0x16')](function(_0x4e11b2){if(_0x4e11b2){_0x207f3a=_0x4e11b2;return _0x4e11b2[_0x6237('0xfa')]({'raw':!![]});}})[_0x6237('0x16')](function(_0x182443){if(_0x207f3a){if(_0x182443){_0x43a152=_0x182443;}}return require(_0x6237('0xfb'))['getLicense']();})[_0x6237('0x16')](function(_0x18afb5){if(_0x18afb5){_0x2df18b=_0x18afb5[_0x6237('0xfc')];_0xbb0cb6=_0x18afb5[_0x6237('0xfd')];}})[_0x6237('0x16')](function(){return db[_0x6237('0xbc')][_0x6237('0x28')]({'where':{'closed':![]}});})['then'](function(_0xeb0cd4){_0x91247d=_0xeb0cd4;if(_0x2df18b&&_0xeb0cd4>_0x2df18b){return db['License'][_0x6237('0x7e')]({'where':{'id':0x1}})['then'](function(_0x5c3e88){if(_0x5c3e88){_0x5c3e88['increment']('chatLicenseExceeded');}});}})[_0x6237('0x16')](function(){if(!_0x207f3a[_0x6237('0x3e')]||!_0x207f3a[_0x6237('0x3e')]['Intervals'])return!![];return checkWebsiteIntervals(_0x207f3a);})[_0x6237('0x16')](function(_0x453e4b){var _0x20ff5c=fs['readFileSync'](path['join'](config['root'],_0x6237('0xfe')),_0x6237('0xd5'));var _0xd9193a=new url['URL'](_0x207f3a[_0x6237('0xff')])[_0x6237('0x100')];var _0x52ad58=_0x6237('0x101');var _0xe3451a=![];var _0x21f023={'chatVersion':_0x52ad58,'chatWebsiteAddressOrigin':_0xd9193a,'remote':_0x207f3a[_0x6237('0x102')],'query':querystring[_0x6237('0x1b')](_[_0x6237('0x6a')](_0x207f3a[_0x6237('0x40')]({'plain':!![]}),{'customerIp':_0x5c280d[_0x6237('0x103')][_0x6237('0x46')]||_0x5c280d[_0x6237('0x103')]['x-real-ip']||_0x5c280d[_0x6237('0x104')]['remoteAddress']||_0x5c280d['ip'],'referer':_0x5c280d[_0x6237('0x103')][_0x6237('0x4c')],'openedInteractions':_0x91247d,'maxInteractions':_0x2df18b,'virtual':_0xbb0cb6[_0x6237('0xfc')],'online':_0x453e4b,'custom':_0xbb0cb6}))[_0x6237('0x105')](/'/g,'\x5c\x27')};_0x3933c0[_0x6237('0x30')](ejs[_0x6237('0xd6')](Mustache['render'](_0x20ff5c,_0x21f023),{'proactiveActions':_0x43a152,'alignment':_0x207f3a[_0x6237('0x106')],'verticalAlignment':_0x207f3a[_0x6237('0x107')],'div_color':_0x207f3a['color'],'labelText':_0x207f3a[_0x6237('0x108')],'text_color':_0x207f3a[_0x6237('0x109')],'text_button_color':_0x207f3a['textButtonColor'],'button_color':_0x207f3a[_0x6237('0x10a')],'background_color':_0x207f3a[_0x6237('0x10b')],'hideWhenOffline':_0x207f3a['hideWhenOffline'],'intervalId':_0x207f3a['IntervalId'],'isDevelopment':_0xe3451a,'chatVersion':_0x52ad58}));})[_0x6237('0x3c')](handleError(_0x3933c0,null));};exports[_0x6237('0x10c')]=function(_0x15748f,_0x3b20f6){var _0x1814e2=_0x15748f[_0x6237('0x6f')]['id'];var _0x5ba9c8=_0x15748f[_0x6237('0x73')];var _0x1e43cf=0xc8;var _0x3cb043=null;return db[_0x6237('0x10d')][_0x6237('0xe2')]({'isolationLevel':db[_0x6237('0x10d')][_0x6237('0x10e')][_0x6237('0x10f')][_0x6237('0x110')]},function(_0x595e10){return db[_0x6237('0x58')][_0x6237('0x7e')]({'where':{'id':_0x1814e2},'transaction':_0x595e10})[_0x6237('0x16')](function(_0x14c7d1){if(_0x14c7d1){return db[_0x6237('0xb0')][_0x6237('0x2c')]({'where':{'ChatWebsiteId':_0x1814e2},'transaction':_0x595e10})[_0x6237('0x16')](function(){var _0x174911=_['map'](_0x5ba9c8,function(_0x7e45d3){_0x7e45d3['ChatWebsiteId']=_0x1814e2;return _0x7e45d3;});return db[_0x6237('0xb0')]['bulkCreate'](_0x174911,{'transaction':_0x595e10});});}else{_0x1e43cf=0x194;_0x3cb043=[];}});})[_0x6237('0x16')](function(){if(_0x1e43cf!==0x194){return db[_0x6237('0xb0')][_0x6237('0x111')]({'where':{'ChatWebsiteId':_0x1814e2},'order':_0x6237('0xb8')})[_0x6237('0x16')](function(_0x2ac63f){_0x3cb043=_0x2ac63f;});}})[_0x6237('0x3c')](function(_0x2811a9){_0x1e43cf=0x1f4;logger['error'](_0x2811a9['stack']);if(_0x2811a9[_0x6237('0x2f')]){delete _0x2811a9[_0x6237('0x2f')];}_0x3cb043=_0x2811a9;})[_0x6237('0x112')](function(){if(_0x3cb043===null){_0x3b20f6[_0x6237('0x21')](_0x1e43cf);}else{if(_0x1e43cf===0x1f4){_0x3b20f6[_0x6237('0x23')](_0x1e43cf)[_0x6237('0x30')](_0x3cb043);}else{_0x3b20f6[_0x6237('0x23')](_0x1e43cf)[_0x6237('0x24')](_0x3cb043);}}});};exports[_0x6237('0x113')]=function(_0x4afa87,_0x31c20c){var _0x4c10e1={};var _0x174e48={};var _0x1df0fe;var _0x5969ce;return db[_0x6237('0x58')]['findOne']({'where':{'id':_0x4afa87[_0x6237('0x6f')]['id']}})['then'](handleEntityNotFound(_0x31c20c,null))['then'](function(_0x154044){if(_0x154044){_0x1df0fe=_0x154044;_0x174e48[_0x6237('0x54')]=_['keys'](db[_0x6237('0xb0')][_0x6237('0x59')]);_0x174e48['query']=_[_0x6237('0x5d')](_0x4afa87[_0x6237('0x5c')]);_0x174e48[_0x6237('0x5e')]=_[_0x6237('0x5f')](_0x174e48[_0x6237('0x54')],_0x174e48[_0x6237('0x5c')]);_0x4c10e1[_0x6237('0x60')]=_[_0x6237('0x5f')](_0x174e48['model'],qs[_0x6237('0x61')](_0x4afa87[_0x6237('0x5c')]['fields']));_0x4c10e1[_0x6237('0x60')]=_0x4c10e1[_0x6237('0x60')][_0x6237('0x62')]?_0x4c10e1[_0x6237('0x60')]:_0x174e48[_0x6237('0x54')];_0x4c10e1['order']=qs[_0x6237('0x65')](_0x4afa87[_0x6237('0x5c')][_0x6237('0x65')]);_0x4c10e1[_0x6237('0x68')]=qs[_0x6237('0x5e')](_['pick'](_0x4afa87[_0x6237('0x5c')],_0x174e48[_0x6237('0x5e')]));if(_0x4afa87[_0x6237('0x5c')]['filter']){_0x4c10e1[_0x6237('0x68')]=_[_0x6237('0x6a')](_0x4c10e1[_0x6237('0x68')],{'$or':_[_0x6237('0x3d')](_0x4c10e1[_0x6237('0x60')],function(_0x3bdba2){var _0x4ab127={};_0x4ab127[_0x3bdba2]={'$like':'%'+_0x4afa87[_0x6237('0x5c')][_0x6237('0x67')]+'%'};return _0x4ab127;})});}_0x4c10e1=_[_0x6237('0x6a')]({},_0x4c10e1,_0x4afa87[_0x6237('0x70')]);return _0x1df0fe[_0x6237('0x113')](_0x4c10e1);}})[_0x6237('0x16')](function(_0x3b2490){if(_0x3b2490){_0x5969ce=_0x3b2490[_0x6237('0x62')];if(!_0x4afa87['query']['hasOwnProperty'](_0x6237('0x63'))){_0x4c10e1[_0x6237('0x26')]=qs[_0x6237('0x26')](_0x4afa87[_0x6237('0x5c')][_0x6237('0x26')]);_0x4c10e1['offset']=qs[_0x6237('0x25')](_0x4afa87[_0x6237('0x5c')][_0x6237('0x25')]);}return _0x1df0fe[_0x6237('0x113')](_0x4c10e1);}})[_0x6237('0x16')](function(_0x5ea748){if(_0x5ea748){return _0x5ea748?{'count':_0x5969ce,'rows':_0x5ea748}:null;}})[_0x6237('0x16')](respondWithResult(_0x31c20c,null))[_0x6237('0x3c')](handleError(_0x31c20c,null));};exports[_0x6237('0x114')]=function(_0x36b554,_0x32c4c9){return db['chatProactiveAction'][_0x6237('0x71')]({'where':{'id':_0x36b554[_0x6237('0x6f')]['id']}})[_0x6237('0x16')](handleEntityNotFound(_0x32c4c9,null))[_0x6237('0x16')](function(_0x316cd5){if(_0x316cd5){return _0x316cd5[_0x6237('0x114')](_0x36b554[_0x6237('0x73')][_0x6237('0x81')],_[_0x6237('0xf3')](_0x36b554[_0x6237('0x73')],[_0x6237('0x81'),'id'])||{});}})[_0x6237('0x16')](respondWithResult(_0x32c4c9,null))[_0x6237('0x3c')](handleError(_0x32c4c9,null));};exports[_0x6237('0xfa')]=function(_0x5bc763,_0x5ddad1){var _0x17f443={};var _0x233995={};var _0x495b2a;var _0x43ccc9;return db[_0x6237('0x58')]['findOne']({'where':{'id':_0x5bc763[_0x6237('0x6f')]['id']}})['then'](handleEntityNotFound(_0x5ddad1,null))['then'](function(_0x22ec5a){if(_0x22ec5a){_0x495b2a=_0x22ec5a;_0x233995[_0x6237('0x54')]=_[_0x6237('0x5d')](db[_0x6237('0x115')][_0x6237('0x59')]);_0x233995['query']=_[_0x6237('0x5d')](_0x5bc763[_0x6237('0x5c')]);_0x233995[_0x6237('0x5e')]=_[_0x6237('0x5f')](_0x233995[_0x6237('0x54')],_0x233995[_0x6237('0x5c')]);_0x17f443['attributes']=_[_0x6237('0x5f')](_0x233995['model'],qs[_0x6237('0x61')](_0x5bc763['query'][_0x6237('0x61')]));_0x17f443[_0x6237('0x60')]=_0x17f443['attributes'][_0x6237('0x62')]?_0x17f443[_0x6237('0x60')]:_0x233995[_0x6237('0x54')];_0x17f443['order']=qs[_0x6237('0x65')](_0x5bc763[_0x6237('0x5c')][_0x6237('0x65')]);_0x17f443[_0x6237('0x68')]=qs[_0x6237('0x5e')](_[_0x6237('0x66')](_0x5bc763['query'],_0x233995['filters']));if(_0x5bc763['query'][_0x6237('0x67')]){_0x17f443[_0x6237('0x68')]=_['merge'](_0x17f443[_0x6237('0x68')],{'$or':_['map'](_0x17f443[_0x6237('0x60')],function(_0x5dacdd){var _0x177d20={};_0x177d20[_0x5dacdd]={'$like':'%'+_0x5bc763[_0x6237('0x5c')][_0x6237('0x67')]+'%'};return _0x177d20;})});}_0x17f443=_['merge']({},_0x17f443,_0x5bc763[_0x6237('0x70')]);return _0x495b2a['getProactiveActions'](_0x17f443);}})[_0x6237('0x16')](function(_0x2385e8){if(_0x2385e8){_0x43ccc9=_0x2385e8[_0x6237('0x62')];if(!_0x5bc763[_0x6237('0x5c')][_0x6237('0x85')](_0x6237('0x63'))){_0x17f443[_0x6237('0x26')]=qs[_0x6237('0x26')](_0x5bc763[_0x6237('0x5c')]['limit']);_0x17f443[_0x6237('0x25')]=qs[_0x6237('0x25')](_0x5bc763[_0x6237('0x5c')][_0x6237('0x25')]);}return _0x495b2a[_0x6237('0xfa')](_0x17f443);}})[_0x6237('0x16')](function(_0x4f6373){if(_0x4f6373){return _0x4f6373?{'count':_0x43ccc9,'rows':_0x4f6373}:null;}})[_0x6237('0x16')](respondWithResult(_0x5ddad1,null))[_0x6237('0x3c')](handleError(_0x5ddad1,null));};exports[_0x6237('0x116')]=function(_0x5ae87a,_0x2f742a){var _0x53bf73=_0x5ae87a[_0x6237('0x5c')][_0x6237('0x117')]===_0x6237('0x118')?_0x6237('0x119'):_0x6237('0x11a');return db[_0x6237('0x58')][_0x6237('0x71')]({'attributes':['id',_0x53bf73],'where':{'id':_0x5ae87a['params']['id']}})['then'](handleEntityNotFound(_0x2f742a,null))[_0x6237('0x16')](function(_0x17f105){if(_0x17f105){var _0x1ad08a=_0x17f105[_0x53bf73];var _0x498c82=_0x1ad08a&&_0x1ad08a[_0x6237('0x11b')]?_0x1ad08a[_0x6237('0x11b')]:[];_0x2f742a['send']({'fromKey':_[_0x6237('0x94')](_0x1ad08a[_0x6237('0x11c')])?undefined:_0x1ad08a[_0x6237('0x11c')],'count':_0x498c82['length'],'rows':_0x498c82});}})['catch'](handleError(_0x2f742a,null));};exports[_0x6237('0x11d')]=function(_0x4aad03,_0x22a266){var _0x1b14bd={'raw':![],'where':{}};var _0x1b78db={};var _0x1d28ba={'count':0x0,'rows':[]};return db[_0x6237('0x58')][_0x6237('0x7e')]({'where':{'id':_0x4aad03[_0x6237('0x6f')]['id']}})[_0x6237('0x16')](handleEntityNotFound(_0x22a266,null))['then'](function(_0x3dab01){if(_0x3dab01){_0x1b78db[_0x6237('0x54')]=_[_0x6237('0x5d')](db[_0x6237('0xd9')]['rawAttributes']);_0x1b78db['query']=_[_0x6237('0x5d')](_0x4aad03[_0x6237('0x5c')]);_0x1b78db['filters']=_[_0x6237('0x5f')](_0x1b78db[_0x6237('0x54')],_0x1b78db[_0x6237('0x5c')]);_0x1b14bd[_0x6237('0x60')]=_[_0x6237('0x5f')](_0x1b78db['model'],qs[_0x6237('0x61')](_0x4aad03['query'][_0x6237('0x61')]));_0x1b14bd[_0x6237('0x60')]=_0x1b14bd[_0x6237('0x60')][_0x6237('0x62')]?_0x1b14bd[_0x6237('0x60')]:_0x1b78db['model'];if(!_0x4aad03[_0x6237('0x5c')]['hasOwnProperty'](_0x6237('0x63'))){_0x1b14bd['limit']=qs['limit'](_0x4aad03[_0x6237('0x5c')]['limit']);_0x1b14bd[_0x6237('0x25')]=qs[_0x6237('0x25')](_0x4aad03['query'][_0x6237('0x25')]);}_0x1b14bd[_0x6237('0x64')]=qs[_0x6237('0x65')](_0x4aad03[_0x6237('0x5c')][_0x6237('0x65')]);_0x1b14bd['where']=qs['filters'](_['pick'](_0x4aad03[_0x6237('0x5c')],_0x1b78db['filters']));_0x1b14bd['where'][_0x6237('0x7b')]=_0x3dab01['id'];if(_0x4aad03[_0x6237('0x5c')][_0x6237('0x67')]){_0x1b14bd[_0x6237('0x68')]=_[_0x6237('0x6a')](_0x1b14bd[_0x6237('0x68')],{'$or':_[_0x6237('0x3d')](_0x1b14bd['attributes'],function(_0x5cf82a){var _0x1f0e63={};_0x1f0e63[_0x5cf82a]={'$like':'%'+_0x4aad03[_0x6237('0x5c')][_0x6237('0x67')]+'%'};return _0x1f0e63;})});}_0x1b14bd=_['merge']({},_0x1b14bd,_0x4aad03[_0x6237('0x70')]);return db[_0x6237('0xd9')]['count']({'where':_0x1b14bd['where']})[_0x6237('0x16')](function(_0x3d8862){_0x1d28ba['count']=_0x3d8862;if(_0x4aad03['query'][_0x6237('0x6b')]){_0x1b14bd['include']=[{'all':!![]}];}else{_0x1b14bd[_0x6237('0x6c')]=[{'model':db[_0x6237('0xa1')],'as':_0x6237('0xf5'),'required':![]},{'model':db[_0x6237('0x11e')],'as':_0x6237('0x11f'),'required':![]}];}return db[_0x6237('0xd9')][_0x6237('0x6d')](_0x1b14bd);})[_0x6237('0x16')](function(_0x5c72b3){_0x1d28ba[_0x6237('0x7f')]=_0x5c72b3;return _0x1d28ba;});}})[_0x6237('0x16')](respondWithFilteredResult(_0x22a266,_0x1b14bd))[_0x6237('0x3c')](handleError(_0x22a266,null));};exports[_0x6237('0x120')]=function(_0x15bc24,_0x9684f8){return db[_0x6237('0x58')][_0x6237('0x71')]({'where':{'id':_0x15bc24['params']['id']}})['then'](handleEntityNotFound(_0x9684f8,null))['then'](function(_0x42955a){if(_0x42955a){return _0x42955a[_0x6237('0x120')](_0x15bc24[_0x6237('0x73')]['ids'],_[_0x6237('0xf3')](_0x15bc24['body'],[_0x6237('0x81'),'id'])||{})[_0x6237('0xb3')](function(_0x1f1ce2){for(var _0x50bfef=0x0;_0x50bfef<_0x15bc24[_0x6237('0x73')][_0x6237('0x81')][_0x6237('0x62')];_0x50bfef+=0x1){socket[_0x6237('0x121')]('userChatWebsite:save',{'UserId':Number(_0x15bc24[_0x6237('0x73')][_0x6237('0x81')][_0x50bfef]),'ChatWebsiteId':Number(_0x15bc24['params']['id'])});}return _0x1f1ce2;});}})[_0x6237('0x16')](respondWithResult(_0x9684f8,null))[_0x6237('0x3c')](handleError(_0x9684f8,null));};exports[_0x6237('0x122')]=function(_0x3317fd,_0x1a59b8){return db[_0x6237('0x58')][_0x6237('0x71')]({'where':{'id':_0x3317fd['params']['id']}})[_0x6237('0x16')](handleEntityNotFound(_0x1a59b8,null))[_0x6237('0x16')](function(_0x676e46){if(_0x676e46){return _0x676e46[_0x6237('0x122')](_0x3317fd[_0x6237('0x5c')][_0x6237('0x81')])[_0x6237('0x16')](function(){if(_[_0x6237('0x123')](_0x3317fd[_0x6237('0x5c')][_0x6237('0x81')])){for(var _0x3b8d0b=0x0;_0x3b8d0b<_0x3317fd[_0x6237('0x5c')]['ids'][_0x6237('0x62')];_0x3b8d0b+=0x1){socket['emit'](_0x6237('0x124'),{'UserId':Number(_0x3317fd[_0x6237('0x5c')]['ids'][_0x3b8d0b]),'ChatWebsiteId':Number(_0x3317fd['params']['id'])});}}else{socket[_0x6237('0x121')]('userChatWebsite:remove',{'UserId':Number(_0x3317fd[_0x6237('0x5c')][_0x6237('0x81')]),'ChatWebsiteId':Number(_0x3317fd[_0x6237('0x6f')]['id'])});}});}})[_0x6237('0x16')](respondWithStatusCode(_0x1a59b8,null))[_0x6237('0x3c')](handleError(_0x1a59b8,null));};exports[_0x6237('0x125')]=function(_0x26c116,_0x279821){var _0x19fe86={};var _0x2ca8a1={};var _0x57e996;var _0x91ac35;return db[_0x6237('0x58')][_0x6237('0x7e')]({'where':{'id':_0x26c116[_0x6237('0x6f')]['id']}})[_0x6237('0x16')](handleEntityNotFound(_0x279821,null))[_0x6237('0x16')](function(_0x5dca8d){if(_0x5dca8d){_0x57e996=_0x5dca8d;_0x2ca8a1[_0x6237('0x54')]=_[_0x6237('0x5d')](db['User'][_0x6237('0x59')]);_0x2ca8a1[_0x6237('0x5c')]=_['keys'](_0x26c116[_0x6237('0x5c')]);_0x2ca8a1[_0x6237('0x5e')]=_['intersection'](_0x2ca8a1[_0x6237('0x54')],_0x2ca8a1[_0x6237('0x5c')]);_0x19fe86[_0x6237('0x60')]=_[_0x6237('0x5f')](_0x2ca8a1[_0x6237('0x54')],qs[_0x6237('0x61')](_0x26c116['query'][_0x6237('0x61')]));_0x19fe86[_0x6237('0x60')]=_0x19fe86[_0x6237('0x60')][_0x6237('0x62')]?_0x19fe86[_0x6237('0x60')]:_0x2ca8a1[_0x6237('0x54')];_0x19fe86[_0x6237('0x64')]=qs['sort'](_0x26c116['query'][_0x6237('0x65')]);_0x19fe86['where']=qs[_0x6237('0x5e')](_['pick'](_0x26c116['query'],_0x2ca8a1[_0x6237('0x5e')]));if(_0x26c116[_0x6237('0x5c')][_0x6237('0x67')]){_0x19fe86[_0x6237('0x68')]=_[_0x6237('0x6a')](_0x19fe86[_0x6237('0x68')],{'$or':_['map'](_0x19fe86[_0x6237('0x60')],function(_0x3a544a){var _0x197780={};_0x197780[_0x3a544a]={'$like':'%'+_0x26c116[_0x6237('0x5c')][_0x6237('0x67')]+'%'};return _0x197780;})});}_0x19fe86=_['merge']({},_0x19fe86,_0x26c116[_0x6237('0x70')]);return _0x57e996[_0x6237('0x125')](_0x19fe86);}})['then'](function(_0x5c2b87){if(_0x5c2b87){_0x91ac35=_0x5c2b87[_0x6237('0x62')];if(!_0x26c116['query'][_0x6237('0x85')](_0x6237('0x63'))){_0x19fe86[_0x6237('0x26')]=qs[_0x6237('0x26')](_0x26c116[_0x6237('0x5c')][_0x6237('0x26')]);_0x19fe86['offset']=qs['offset'](_0x26c116[_0x6237('0x5c')][_0x6237('0x25')]);}return _0x57e996['getAgents'](_0x19fe86);}})[_0x6237('0x16')](function(_0x3b938c){if(_0x3b938c){return _0x3b938c?{'count':_0x91ac35,'rows':_0x3b938c}:null;}})['then'](respondWithResult(_0x279821,null))[_0x6237('0x3c')](handleError(_0x279821,null));}; \ No newline at end of file +var _0xbff2=['message','result','catch','end','json','offset','undefined','limit','count','status','destroy','get','ChatWebsites','UserProfileResource','sendStatus','stack','name','Command','getSnippet','format','timezone','interval','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','inspect','No\x20timezone','map','Interval','Intervals','all','some','user-agent-parser','setUA','user-agent','getResult','customerIp','x-forwarded-for','first','split','lastName','x-real-port','referer','browser','%s\x20%s','version','unknown','device','model','%s\x20%s\x20%s','vendor','type','Pause','ChatWebsite','rawAttributes','key','keys','query','filters','intersection','attributes','fields','length','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','params','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','Disposition','getDispositions','findOne','order','removeDispositions','ChatWebsiteId','CannedAnswer','getAnswers','hasOwnProperty','nolimit','removeAnswers','ids','sitepic','filename','addAvatar','agentAvatar','file','addSystemAvatar','systemAvatar','getLogo','root','server/files/images/logos/default_logo.svg','../../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','customerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','chat','CmContact','Sequelize','ValidationError','difference','updatedAt','CompanyId','ListId','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','Contacts','DESC','Applications','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','spread','account','applications','priority','asc','defaults','contact','headers','threadId','ChatInteraction','externalUrl','ContactId','interaction','firstName','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','AttachmentId','User','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','queueId','ChatQueue','queue','waitForTheAssignedQueue','Start','startRouting','offline','files','no\x20available\x20attributes','createdAt','send','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','sequelize','MailServerOut','CloudProvider','Smtp','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','email','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','notifyMail','remove','addInteraction','omit','Contact','Owner','fullname','internal','Tag','color','tag','virtual','increment','chatLicenseExceeded','URL','address','origin','3.6.0','x-real-ip','connection','remoteAddress','replace','labelText','textColor','textButtonColor','color_button','backgroundColor','hideWhenOffline','IntervalId','transaction','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication','bulkCreate','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','getProactiveActions','ChatProactiveAction','online','false','offlineForm','items','fromKey','ChatOfflineMessage','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','util','path','ejs','fs-extra','lodash','querystring','html-to-text','ioredis','url','../../components/parsers/qs','../../errors/api','APIOutOfIntervalError','APINotFoundError','../../mysqldb','localhost','redis','./chatWebsite.socket','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0xf4b27e,_0x525244){var _0x42166d=function(_0x102790){while(--_0x102790){_0xf4b27e['push'](_0xf4b27e['shift']());}};_0x42166d(++_0x525244);}(_0xbff2,0x10e));var _0x2bff=function(_0x20c764,_0x940bff){_0x20c764=_0x20c764-0x0;var _0xf2c5eb=_0xbff2[_0x20c764];return _0xf2c5eb;};'use strict';var Mustache=require(_0x2bff('0x0'));var util=require(_0x2bff('0x1'));var path=require(_0x2bff('0x2'));var ejs=require(_0x2bff('0x3'));var fs=require('fs');var fs_extra=require(_0x2bff('0x4'));var _=require(_0x2bff('0x5'));var querystring=require(_0x2bff('0x6'));var htmlToText=require(_0x2bff('0x7'));var Redis=require(_0x2bff('0x8'));var jayson=require('jayson/promise');var url=require(_0x2bff('0x9'));var qs=require(_0x2bff('0xa'));var logger=require('../../config/logger')('api');var config=require('../../config/environment');var APIOutOfIntervalError=require(_0x2bff('0xb'))[_0x2bff('0xc')];var APINotFoundError=require('../../errors/api')[_0x2bff('0xd')];var APIHandleError=require('../../errors/api')['handleError'];var db=require(_0x2bff('0xe'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x2bff('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2bff('0x10')]));require(_0x2bff('0x11'))['register'](socket);var client=jayson[_0x2bff('0x12')][_0x2bff('0x13')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});var client9003=jayson[_0x2bff('0x12')][_0x2bff('0x13')]({'port':0x232b});var client9001=jayson['client'][_0x2bff('0x13')]({'port':0x2329});function respondWithRpcPromise(_0x2af98f,_0x48f9f8,_0x3d3e90,_0x3e8399){return new Promise(function(_0x430fd0,_0x46a93c){var _0x5cf3c1=_0x3e8399||client;return _0x5cf3c1[_0x2bff('0x14')](_0x2af98f,_0x3d3e90)[_0x2bff('0x15')](function(_0x25f978){logger[_0x2bff('0x16')](_0x2bff('0x17'),_0x48f9f8,_0x2bff('0x18'));logger['debug'](_0x2bff('0x19'),_0x48f9f8,_0x2bff('0x18'),JSON[_0x2bff('0x1a')](_0x25f978));if(_0x25f978['error']){if(_0x25f978[_0x2bff('0x1b')][_0x2bff('0x1c')]===0x1f4){logger['error'](_0x2bff('0x17'),_0x48f9f8,_0x25f978[_0x2bff('0x1b')][_0x2bff('0x1d')]);return _0x46a93c(_0x25f978['error']['message']);}logger[_0x2bff('0x1b')](_0x2bff('0x17'),_0x48f9f8,_0x25f978['error'][_0x2bff('0x1d')]);return _0x430fd0(_0x25f978['error']['message']);}else{logger[_0x2bff('0x16')](_0x2bff('0x17'),_0x48f9f8,_0x2bff('0x18'));_0x430fd0(_0x25f978[_0x2bff('0x1e')][_0x2bff('0x1d')]);}})[_0x2bff('0x1f')](function(_0x33ab51){logger[_0x2bff('0x1b')](_0x2bff('0x17'),_0x48f9f8,_0x33ab51);_0x46a93c(_0x33ab51);});});}function respondWithStatusCode(_0x42c9c2,_0x3b3a66){_0x3b3a66=_0x3b3a66||0xcc;return function(_0x3ecb73){if(_0x3ecb73){return _0x42c9c2['sendStatus'](_0x3b3a66);}return _0x42c9c2['status'](_0x3b3a66)[_0x2bff('0x20')]();};}function respondWithResult(_0x314717,_0x4c6a91){_0x4c6a91=_0x4c6a91||0xc8;return function(_0x170a8f){if(_0x170a8f){return _0x314717['status'](_0x4c6a91)[_0x2bff('0x21')](_0x170a8f);}};}function respondWithFilteredResult(_0x59147b,_0x23dcd6){return function(_0x235523){if(_0x235523){var _0x551a59=typeof _0x23dcd6[_0x2bff('0x22')]===_0x2bff('0x23')&&typeof _0x23dcd6[_0x2bff('0x24')]===_0x2bff('0x23');var _0x2204ad=_0x235523[_0x2bff('0x25')];var _0x5a93fa=_0x551a59?0x0:_0x23dcd6['offset'];var _0x5e8c69=_0x551a59?_0x235523[_0x2bff('0x25')]:_0x23dcd6[_0x2bff('0x22')]+_0x23dcd6[_0x2bff('0x24')];var _0x35eaf2;if(_0x5e8c69>=_0x2204ad){_0x5e8c69=_0x2204ad;_0x35eaf2=0xc8;}else{_0x35eaf2=0xce;}_0x59147b[_0x2bff('0x26')](_0x35eaf2);return _0x59147b['set']('Content-Range',_0x5a93fa+'-'+_0x5e8c69+'/'+_0x2204ad)['json'](_0x235523);}return null;};}function saveUpdates(_0x180aa6){return function(_0x502efb){if(_0x502efb){return _0x502efb['update'](_0x180aa6)['then'](function(_0x3713ff){return _0x3713ff;});}return null;};}function removeEntity(_0x273acf){return function(_0x339156){if(_0x339156){return _0x339156[_0x2bff('0x27')]()[_0x2bff('0x15')](function(){var _0x2f74c4=_0x339156[_0x2bff('0x28')]({'plain':!![]});var _0x33fa97=_0x2bff('0x29');return db[_0x2bff('0x2a')][_0x2bff('0x27')]({'where':{'type':_0x33fa97,'resourceId':_0x2f74c4['id']}})[_0x2bff('0x15')](function(){return _0x339156;});})[_0x2bff('0x15')](function(){_0x273acf[_0x2bff('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x14df84){return function(_0x17657c){if(!_0x17657c){_0x14df84[_0x2bff('0x2b')](0x194);}return _0x17657c;};}function handleError(_0x4c4fb4,_0x3ec81a){_0x3ec81a=_0x3ec81a||0x1f4;return function(_0x4a5dad){logger[_0x2bff('0x1b')](_0x4a5dad[_0x2bff('0x2c')]);if(_0x4a5dad[_0x2bff('0x2d')]){delete _0x4a5dad[_0x2bff('0x2d')];}_0x4c4fb4[_0x2bff('0x26')](_0x3ec81a)['send'](_0x4a5dad);};}function iftimePromise(_0x1150c4,_0x192c93){return respondWithRpcPromise(_0x2bff('0x2e'),_0x2bff('0x2f'),{'command':_0x192c93['timezone']?util[_0x2bff('0x30')]('iftime\x20%s,%s',_0x1150c4['interval'],_0x192c93[_0x2bff('0x31')]):util['format']('iftime\x20%s',_0x1150c4[_0x2bff('0x32')])},client9002)[_0x2bff('0x15')](function(_0x317958){var _0x25e2cc=_0x317958&&_0x317958['indexOf'](_0x2bff('0x33'))>=0x0?!![]:![];logger[_0x2bff('0x16')](_0x2bff('0x34'),_0x192c93['id'],_0x1150c4['id'],_0x1150c4['interval'],_0x25e2cc?_0x2bff('0x35'):_0x2bff('0x36'),_0x192c93[_0x2bff('0x31')]?_0x192c93[_0x2bff('0x31')]:'No\x20timezone');return _0x25e2cc;})[_0x2bff('0x1f')](function(_0x42a764){logger['error'](_0x2bff('0x34'),_0x192c93['id'],_0x1150c4['id'],_0x1150c4[_0x2bff('0x32')],util[_0x2bff('0x37')](_0x42a764,{'showHidden':![],'depth':null}),_0x192c93[_0x2bff('0x31')]?_0x192c93[_0x2bff('0x31')]:_0x2bff('0x38'));return![];});}function checkWebsiteIntervals(_0x2a2ba0){var _0x30ff26=_[_0x2bff('0x39')](_0x2a2ba0[_0x2bff('0x3a')][_0x2bff('0x3b')],function(_0x24217b){var _0xf4396e=_0x24217b[_0x2bff('0x28')]({'plain':!![]});return iftimePromise(_0xf4396e,_0x2a2ba0);});return Promise[_0x2bff('0x3c')](_0x30ff26)[_0x2bff('0x15')](function(_0x1c53c2){return _[_0x2bff('0x3d')](_0x1c53c2);});}function createInteractionObject(_0x14be36,_0x1369a9,_0x390762,_0x54cd71){var _0x243e55=require(_0x2bff('0x3e'));var _0x1f52c4=new _0x243e55();var _0x1284f8=_0x1f52c4[_0x2bff('0x3f')](_0x390762[_0x2bff('0x40')])[_0x2bff('0x41')]();var _0x396f19=_0x1369a9[_0x2bff('0x42')];if(_0x390762['cf-connecting-ip']){_0x396f19=_0x390762['cf-connecting-ip'];}else if(_0x390762[_0x2bff('0x43')]){_0x396f19=_[_0x2bff('0x44')](_0x390762[_0x2bff('0x43')][_0x2bff('0x45')](','));}return{'ContactId':_0x54cd71['id'],'ChatWebsiteId':_0x14be36,'from':(_0x54cd71['firstName']||'')+'\x20'+(_0x54cd71[_0x2bff('0x46')]||''),'customerIp':_0x396f19,'customerPort':_0x390762[_0x2bff('0x47')]?_0x390762[_0x2bff('0x47')]:null,'referer':_0x1369a9[_0x2bff('0x48')],'browserName':_0x1284f8[_0x2bff('0x49')]['name']&&_0x1284f8[_0x2bff('0x49')]['version']?util[_0x2bff('0x30')](_0x2bff('0x4a'),_0x1284f8[_0x2bff('0x49')][_0x2bff('0x2d')],_0x1284f8['browser']['version']):'unknown','browserVersion':_0x1284f8['browser'][_0x2bff('0x4b')]||_0x2bff('0x4c'),'osName':util[_0x2bff('0x30')]('%s\x20%s',_0x1284f8['os'][_0x2bff('0x2d')],_0x1284f8['os'][_0x2bff('0x4b')]),'osVersion':_0x1284f8['os'][_0x2bff('0x4b')],'deviceModel':_0x1284f8[_0x2bff('0x4d')][_0x2bff('0x4e')]&&_0x1284f8[_0x2bff('0x4d')]['vendor']?util[_0x2bff('0x30')](_0x2bff('0x4f'),_0x1284f8[_0x2bff('0x4d')][_0x2bff('0x4e')],_0x1284f8[_0x2bff('0x4d')][_0x2bff('0x50')],_0x1284f8[_0x2bff('0x4d')]['type']):null,'deviceVendor':_0x1284f8[_0x2bff('0x4d')]['vendor'],'deviceType':_0x1284f8[_0x2bff('0x4d')][_0x2bff('0x51')],'formData':JSON[_0x2bff('0x1a')](_0x1369a9)};}exports['index']=function(_0x9ea4fc,_0x4c82e7){var _0x5d12cc={'include':[{'model':db[_0x2bff('0x52')],'as':'mandatoryDispositionPause'}]},_0x21ec1f={},_0x298308={'count':0x0,'rows':[]};var _0x125c22=_['map'](db[_0x2bff('0x53')][_0x2bff('0x54')],function(_0x5a8dfa){return{'name':_0x5a8dfa['fieldName'],'type':_0x5a8dfa[_0x2bff('0x51')][_0x2bff('0x55')]};});_0x21ec1f[_0x2bff('0x4e')]=_[_0x2bff('0x39')](_0x125c22,_0x2bff('0x2d'));_0x21ec1f['query']=_[_0x2bff('0x56')](_0x9ea4fc[_0x2bff('0x57')]);_0x21ec1f[_0x2bff('0x58')]=_[_0x2bff('0x59')](_0x21ec1f['model'],_0x21ec1f[_0x2bff('0x57')]);_0x5d12cc[_0x2bff('0x5a')]=_[_0x2bff('0x59')](_0x21ec1f['model'],qs[_0x2bff('0x5b')](_0x9ea4fc[_0x2bff('0x57')]['fields']));_0x5d12cc[_0x2bff('0x5a')]=_0x5d12cc[_0x2bff('0x5a')][_0x2bff('0x5c')]?_0x5d12cc['attributes']:_0x21ec1f['model'];if(!_0x9ea4fc[_0x2bff('0x57')]['hasOwnProperty']('nolimit')){_0x5d12cc[_0x2bff('0x24')]=qs[_0x2bff('0x24')](_0x9ea4fc[_0x2bff('0x57')]['limit']);_0x5d12cc[_0x2bff('0x22')]=qs[_0x2bff('0x22')](_0x9ea4fc[_0x2bff('0x57')][_0x2bff('0x22')]);}_0x5d12cc['order']=qs[_0x2bff('0x5d')](_0x9ea4fc[_0x2bff('0x57')][_0x2bff('0x5d')]);_0x5d12cc['where']=qs[_0x2bff('0x58')](_[_0x2bff('0x5e')](_0x9ea4fc[_0x2bff('0x57')],_0x21ec1f['filters']),_0x125c22);if(_0x9ea4fc[_0x2bff('0x57')][_0x2bff('0x5f')]){_0x5d12cc[_0x2bff('0x60')]=_[_0x2bff('0x61')](_0x5d12cc['where'],{'$or':_[_0x2bff('0x39')](_0x125c22,function(_0x564642){if(_0x564642['type']!==_0x2bff('0x62')){var _0x261863={};_0x261863[_0x564642[_0x2bff('0x2d')]]={'$like':'%'+_0x9ea4fc[_0x2bff('0x57')][_0x2bff('0x5f')]+'%'};return _0x261863;}})});}_0x5d12cc=_[_0x2bff('0x61')]({},_0x5d12cc,_0x9ea4fc[_0x2bff('0x63')]);var _0x465a67={'where':_0x5d12cc[_0x2bff('0x60')]};return db['ChatWebsite']['count'](_0x465a67)['then'](function(_0x3e8bc8){_0x298308['count']=_0x3e8bc8;if(_0x9ea4fc[_0x2bff('0x57')]['includeAll']){_0x5d12cc[_0x2bff('0x64')]=[{'all':!![]}];}return db[_0x2bff('0x53')][_0x2bff('0x65')](_0x5d12cc);})[_0x2bff('0x15')](function(_0x428e7a){_0x298308[_0x2bff('0x66')]=_0x428e7a;return _0x298308;})['then'](respondWithFilteredResult(_0x4c82e7,_0x5d12cc))['catch'](handleError(_0x4c82e7,null));};exports['show']=function(_0x39111b,_0x23b383){var _0x4040a6={'raw':![],'where':{'id':_0x39111b[_0x2bff('0x67')]['id']},'include':[{'model':db[_0x2bff('0x52')],'as':'mandatoryDispositionPause'}]},_0x2a29a5={};_0x2a29a5['model']=_['keys'](db['ChatWebsite'][_0x2bff('0x54')]);_0x2a29a5['query']=_['keys'](_0x39111b['query']);_0x2a29a5[_0x2bff('0x58')]=_[_0x2bff('0x59')](_0x2a29a5[_0x2bff('0x4e')],_0x2a29a5[_0x2bff('0x57')]);_0x4040a6[_0x2bff('0x5a')]=_[_0x2bff('0x59')](_0x2a29a5[_0x2bff('0x4e')],qs[_0x2bff('0x5b')](_0x39111b['query']['fields']));_0x4040a6[_0x2bff('0x5a')]=_0x4040a6[_0x2bff('0x5a')][_0x2bff('0x5c')]?_0x4040a6[_0x2bff('0x5a')]:_0x2a29a5[_0x2bff('0x4e')];if(_0x39111b[_0x2bff('0x57')][_0x2bff('0x68')]){_0x4040a6[_0x2bff('0x64')]=[{'all':!![]}];}_0x4040a6=_['merge']({},_0x4040a6,_0x39111b[_0x2bff('0x63')]);return db[_0x2bff('0x53')]['find'](_0x4040a6)[_0x2bff('0x15')](handleEntityNotFound(_0x23b383,null))[_0x2bff('0x15')](respondWithResult(_0x23b383,null))[_0x2bff('0x1f')](handleError(_0x23b383,null));};exports[_0x2bff('0x69')]=function(_0x4ca979,_0x5c2e39){return db[_0x2bff('0x53')][_0x2bff('0x69')](_0x4ca979[_0x2bff('0x6a')],{})[_0x2bff('0x15')](function(_0x11afef){var _0xec052c=_0x4ca979[_0x2bff('0x6b')]['get']({'plain':!![]});if(!_0xec052c)throw new Error(_0x2bff('0x6c'));if(_0xec052c['role']===_0x2bff('0x6b')){var _0x50561e=_0x11afef['get']({'plain':!![]});var _0x34b4e9=_0x2bff('0x29');return db[_0x2bff('0x6d')][_0x2bff('0x6e')]({'where':{'name':_0x34b4e9,'userProfileId':_0xec052c[_0x2bff('0x6f')]},'raw':!![]})[_0x2bff('0x15')](function(_0x25ce6d){if(_0x25ce6d&&_0x25ce6d[_0x2bff('0x70')]===0x0){return db[_0x2bff('0x2a')][_0x2bff('0x69')]({'name':_0x50561e['name'],'resourceId':_0x50561e['id'],'type':_0x25ce6d[_0x2bff('0x2d')],'sectionId':_0x25ce6d['id']},{})[_0x2bff('0x15')](function(){return _0x11afef;});}else{return _0x11afef;}})[_0x2bff('0x1f')](function(_0x47f859){logger[_0x2bff('0x1b')](_0x2bff('0x71'),_0x47f859);throw _0x47f859;});}return _0x11afef;})['then'](respondWithResult(_0x5c2e39,0xc9))[_0x2bff('0x1f')](handleError(_0x5c2e39,null));};exports['update']=function(_0x212a71,_0x3c8dd8){if(_0x212a71['body']['id']){delete _0x212a71[_0x2bff('0x6a')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x212a71[_0x2bff('0x67')]['id']},'include':[{'model':db[_0x2bff('0x52')],'as':'mandatoryDispositionPause'}]})[_0x2bff('0x15')](handleEntityNotFound(_0x3c8dd8,null))[_0x2bff('0x15')](saveUpdates(_0x212a71['body'],null))['then'](respondWithResult(_0x3c8dd8,null))[_0x2bff('0x1f')](handleError(_0x3c8dd8,null));};exports['destroy']=function(_0x5a3fd3,_0x289f40){return db[_0x2bff('0x53')]['find']({'where':{'id':_0x5a3fd3[_0x2bff('0x67')]['id']}})[_0x2bff('0x15')](handleEntityNotFound(_0x289f40,null))[_0x2bff('0x15')](removeEntity(_0x289f40,null))[_0x2bff('0x1f')](handleError(_0x289f40,null));};exports['describe']=function(_0x20c1d3,_0x40c2b3){return db[_0x2bff('0x53')][_0x2bff('0x72')]()[_0x2bff('0x15')](respondWithResult(_0x40c2b3,null))['catch'](handleError(_0x40c2b3,null));};exports['addDisposition']=function(_0x4d9edf,_0x3f2639){if(_0x4d9edf['body']['id']){delete _0x4d9edf[_0x2bff('0x6a')]['id'];}return db[_0x2bff('0x53')]['find']({'where':{'id':_0x4d9edf[_0x2bff('0x67')]['id']}})[_0x2bff('0x15')](handleEntityNotFound(_0x3f2639,null))['then'](function(_0x2751e9){if(_0x2751e9){_0x4d9edf['body']['ChatWebsiteId']=_0x2751e9['id'];return db[_0x2bff('0x73')]['create'](_0x4d9edf['body']);}})[_0x2bff('0x15')](respondWithResult(_0x3f2639,null))[_0x2bff('0x1f')](handleError(_0x3f2639,null));};exports[_0x2bff('0x74')]=function(_0x495113,_0x2dcb75){var _0xd2bdac={'raw':![],'where':{}};var _0x4e1919={};var _0x163e0f={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x2bff('0x75')]({'where':{'id':_0x495113[_0x2bff('0x67')]['id']}})[_0x2bff('0x15')](handleEntityNotFound(_0x2dcb75,null))[_0x2bff('0x15')](function(_0x4d2a26){if(_0x4d2a26){_0x4e1919['model']=_[_0x2bff('0x56')](db[_0x2bff('0x73')][_0x2bff('0x54')]);_0x4e1919[_0x2bff('0x57')]=_[_0x2bff('0x56')](_0x495113[_0x2bff('0x57')]);_0x4e1919[_0x2bff('0x58')]=_['intersection'](_0x4e1919[_0x2bff('0x4e')],_0x4e1919[_0x2bff('0x57')]);_0xd2bdac['attributes']=_[_0x2bff('0x59')](_0x4e1919[_0x2bff('0x4e')],qs[_0x2bff('0x5b')](_0x495113[_0x2bff('0x57')][_0x2bff('0x5b')]));_0xd2bdac[_0x2bff('0x5a')]=_0xd2bdac[_0x2bff('0x5a')][_0x2bff('0x5c')]?_0xd2bdac[_0x2bff('0x5a')]:_0x4e1919['model'];if(!_0x495113[_0x2bff('0x57')]['hasOwnProperty']('nolimit')){_0xd2bdac['limit']=qs[_0x2bff('0x24')](_0x495113['query'][_0x2bff('0x24')]);_0xd2bdac[_0x2bff('0x22')]=qs[_0x2bff('0x22')](_0x495113[_0x2bff('0x57')][_0x2bff('0x22')]);}_0xd2bdac[_0x2bff('0x76')]=qs[_0x2bff('0x5d')](_0x495113[_0x2bff('0x57')][_0x2bff('0x5d')]);_0xd2bdac[_0x2bff('0x60')]=qs[_0x2bff('0x58')](_[_0x2bff('0x5e')](_0x495113[_0x2bff('0x57')],_0x4e1919[_0x2bff('0x58')]));_0xd2bdac[_0x2bff('0x60')]['ChatWebsiteId']=_0x4d2a26['id'];if(_0x495113[_0x2bff('0x57')][_0x2bff('0x5f')]){_0xd2bdac[_0x2bff('0x60')]=_[_0x2bff('0x61')](_0xd2bdac[_0x2bff('0x60')],{'$or':_[_0x2bff('0x39')](_0xd2bdac['attributes'],function(_0x41ac8){var _0x90afd5={};_0x90afd5[_0x41ac8]={'$like':'%'+_0x495113['query'][_0x2bff('0x5f')]+'%'};return _0x90afd5;})});}_0xd2bdac=_[_0x2bff('0x61')]({},_0xd2bdac,_0x495113['options']);return db['Disposition'][_0x2bff('0x25')]({'where':_0xd2bdac[_0x2bff('0x60')]})[_0x2bff('0x15')](function(_0x39b988){_0x163e0f[_0x2bff('0x25')]=_0x39b988;if(_0x495113[_0x2bff('0x57')][_0x2bff('0x68')]){_0xd2bdac[_0x2bff('0x64')]=[{'all':!![]}];}return db[_0x2bff('0x73')]['findAll'](_0xd2bdac);})[_0x2bff('0x15')](function(_0x2da863){_0x163e0f[_0x2bff('0x66')]=_0x2da863;return _0x163e0f;});}})[_0x2bff('0x15')](respondWithFilteredResult(_0x2dcb75,_0xd2bdac))[_0x2bff('0x1f')](handleError(_0x2dcb75,null));};exports[_0x2bff('0x77')]=function(_0x48e44a,_0x2179bf){return db[_0x2bff('0x53')][_0x2bff('0x6e')]({'where':{'id':_0x48e44a[_0x2bff('0x67')]['id']}})[_0x2bff('0x15')](handleEntityNotFound(_0x2179bf,null))[_0x2bff('0x15')](function(_0x1f6e8c){if(_0x1f6e8c){return _0x1f6e8c['removeDispositions'](_0x48e44a[_0x2bff('0x57')]['ids']);}})[_0x2bff('0x15')](respondWithStatusCode(_0x2179bf,null))[_0x2bff('0x1f')](handleError(_0x2179bf,null));};exports['addAnswer']=function(_0x3cb156,_0x1c78b1){if(_0x3cb156[_0x2bff('0x6a')]['id']){delete _0x3cb156[_0x2bff('0x6a')]['id'];}return db[_0x2bff('0x53')][_0x2bff('0x6e')]({'where':{'id':_0x3cb156[_0x2bff('0x67')]['id']}})[_0x2bff('0x15')](handleEntityNotFound(_0x1c78b1,null))[_0x2bff('0x15')](function(_0x10ae75){if(_0x10ae75){_0x3cb156['body'][_0x2bff('0x78')]=_0x10ae75['id'];return db[_0x2bff('0x79')][_0x2bff('0x69')](_0x3cb156[_0x2bff('0x6a')]);}})['then'](respondWithResult(_0x1c78b1,null))[_0x2bff('0x1f')](handleError(_0x1c78b1,null));};exports[_0x2bff('0x7a')]=function(_0x92e93,_0x23d30b){var _0x3f3856={'raw':![],'where':{}};var _0x5920ad={};var _0x4ca62a={'count':0x0,'rows':[]};return db[_0x2bff('0x53')][_0x2bff('0x75')]({'where':{'id':_0x92e93['params']['id']}})[_0x2bff('0x15')](handleEntityNotFound(_0x23d30b,null))[_0x2bff('0x15')](function(_0x17ef3f){if(_0x17ef3f){_0x5920ad[_0x2bff('0x4e')]=_['keys'](db[_0x2bff('0x79')]['rawAttributes']);_0x5920ad['query']=_[_0x2bff('0x56')](_0x92e93[_0x2bff('0x57')]);_0x5920ad['filters']=_[_0x2bff('0x59')](_0x5920ad[_0x2bff('0x4e')],_0x5920ad[_0x2bff('0x57')]);_0x3f3856[_0x2bff('0x5a')]=_[_0x2bff('0x59')](_0x5920ad[_0x2bff('0x4e')],qs[_0x2bff('0x5b')](_0x92e93[_0x2bff('0x57')][_0x2bff('0x5b')]));_0x3f3856[_0x2bff('0x5a')]=_0x3f3856[_0x2bff('0x5a')][_0x2bff('0x5c')]?_0x3f3856[_0x2bff('0x5a')]:_0x5920ad[_0x2bff('0x4e')];if(!_0x92e93[_0x2bff('0x57')][_0x2bff('0x7b')](_0x2bff('0x7c'))){_0x3f3856[_0x2bff('0x24')]=qs['limit'](_0x92e93[_0x2bff('0x57')][_0x2bff('0x24')]);_0x3f3856['offset']=qs[_0x2bff('0x22')](_0x92e93[_0x2bff('0x57')]['offset']);}_0x3f3856[_0x2bff('0x76')]=qs[_0x2bff('0x5d')](_0x92e93['query'][_0x2bff('0x5d')]);_0x3f3856[_0x2bff('0x60')]=qs[_0x2bff('0x58')](_['pick'](_0x92e93[_0x2bff('0x57')],_0x5920ad['filters']));_0x3f3856[_0x2bff('0x60')]['ChatWebsiteId']=_0x17ef3f['id'];if(_0x92e93['query']['filter']){_0x3f3856[_0x2bff('0x60')]=_[_0x2bff('0x61')](_0x3f3856[_0x2bff('0x60')],{'$or':_[_0x2bff('0x39')](_0x3f3856[_0x2bff('0x5a')],function(_0x2db529){var _0x2c31a3={};_0x2c31a3[_0x2db529]={'$like':'%'+_0x92e93[_0x2bff('0x57')]['filter']+'%'};return _0x2c31a3;})});}_0x3f3856=_[_0x2bff('0x61')]({},_0x3f3856,_0x92e93[_0x2bff('0x63')]);return db['CannedAnswer'][_0x2bff('0x25')]({'where':_0x3f3856[_0x2bff('0x60')]})[_0x2bff('0x15')](function(_0x25046a){_0x4ca62a[_0x2bff('0x25')]=_0x25046a;if(_0x92e93[_0x2bff('0x57')][_0x2bff('0x68')]){_0x3f3856[_0x2bff('0x64')]=[{'all':!![]}];}return db[_0x2bff('0x79')][_0x2bff('0x65')](_0x3f3856);})['then'](function(_0x28c337){_0x4ca62a['rows']=_0x28c337;return _0x4ca62a;});}})['then'](respondWithFilteredResult(_0x23d30b,_0x3f3856))[_0x2bff('0x1f')](handleError(_0x23d30b,null));};exports['removeAnswers']=function(_0x1a7fbb,_0x20f82e){return db[_0x2bff('0x53')][_0x2bff('0x6e')]({'where':{'id':_0x1a7fbb[_0x2bff('0x67')]['id']}})[_0x2bff('0x15')](handleEntityNotFound(_0x20f82e,null))['then'](function(_0x628300){if(_0x628300){return _0x628300[_0x2bff('0x7d')](_0x1a7fbb['query'][_0x2bff('0x7e')]);}})['then'](respondWithStatusCode(_0x20f82e,null))['catch'](handleError(_0x20f82e,null));};exports['addLogo']=function(_0x203d0c,_0x1112a0){_0x203d0c[_0x2bff('0x6a')][_0x2bff('0x7f')]=_0x203d0c['file'][_0x2bff('0x80')];return db[_0x2bff('0x53')][_0x2bff('0x6e')]({'where':{'id':_0x203d0c['params']['id']}})[_0x2bff('0x15')](handleEntityNotFound(_0x1112a0,null))[_0x2bff('0x15')](saveUpdates(_0x203d0c[_0x2bff('0x6a')],null))['then'](respondWithResult(_0x1112a0,null))[_0x2bff('0x1f')](handleError(_0x1112a0,null));};exports[_0x2bff('0x81')]=function(_0x37f61e,_0x13a2be){_0x37f61e[_0x2bff('0x6a')][_0x2bff('0x82')]=_0x37f61e[_0x2bff('0x83')][_0x2bff('0x80')];return db[_0x2bff('0x53')][_0x2bff('0x6e')]({'where':{'id':_0x37f61e[_0x2bff('0x67')]['id']}})[_0x2bff('0x15')](handleEntityNotFound(_0x13a2be,null))['then'](saveUpdates(_0x37f61e['body'],null))[_0x2bff('0x15')](respondWithResult(_0x13a2be,null))[_0x2bff('0x1f')](handleError(_0x13a2be,null));};exports['addCustomerAvatar']=function(_0x476152,_0x16d47c){_0x476152[_0x2bff('0x6a')]['customerAvatar']=_0x476152[_0x2bff('0x83')]['filename'];return db['ChatWebsite'][_0x2bff('0x6e')]({'where':{'id':_0x476152[_0x2bff('0x67')]['id']}})[_0x2bff('0x15')](handleEntityNotFound(_0x16d47c,null))[_0x2bff('0x15')](saveUpdates(_0x476152[_0x2bff('0x6a')],null))[_0x2bff('0x15')](respondWithResult(_0x16d47c,null))[_0x2bff('0x1f')](handleError(_0x16d47c,null));};exports[_0x2bff('0x84')]=function(_0x7be39e,_0x286c0d){_0x7be39e[_0x2bff('0x6a')][_0x2bff('0x85')]=_0x7be39e[_0x2bff('0x83')][_0x2bff('0x80')];return db[_0x2bff('0x53')][_0x2bff('0x6e')]({'where':{'id':_0x7be39e[_0x2bff('0x67')]['id']}})['then'](handleEntityNotFound(_0x286c0d,null))[_0x2bff('0x15')](saveUpdates(_0x7be39e[_0x2bff('0x6a')],null))[_0x2bff('0x15')](respondWithResult(_0x286c0d,null))[_0x2bff('0x1f')](handleError(_0x286c0d,null));};exports[_0x2bff('0x86')]=function(_0x5be965,_0x99c3b2){var _0x4cc1b3=path['join'](config[_0x2bff('0x87')],_0x2bff('0x88'));var _0x302c6d={'where':{'id':_0x5be965['params']['id']},'attributes':['id',_0x2bff('0x7f')],'raw':!![]};var _0x1e2d4f=![];return require(_0x2bff('0x89'))[_0x2bff('0x8a')]()['then'](function(_0x5742c5){if(_0x5742c5){_0x1e2d4f=_0x5742c5[_0x2bff('0x8b')];}})[_0x2bff('0x15')](function(){return db[_0x2bff('0x53')][_0x2bff('0x6e')](_0x302c6d);})[_0x2bff('0x15')](handleEntityNotFound(_0x99c3b2,null))[_0x2bff('0x15')](function(_0x1883e4){if(_0x1883e4){if(!_[_0x2bff('0x8c')](_0x1883e4['sitepic'])){if(fs[_0x2bff('0x8d')](path[_0x2bff('0x8e')](config[_0x2bff('0x87')],_0x2bff('0x8f'),_0x1883e4[_0x2bff('0x7f')]))&&_0x1e2d4f){_0x4cc1b3=path[_0x2bff('0x8e')](config['root'],_0x2bff('0x8f'),_0x1883e4[_0x2bff('0x7f')]);}}return _0x99c3b2[_0x2bff('0x90')](_0x4cc1b3);}})[_0x2bff('0x1f')](handleError(_0x99c3b2,null));};exports[_0x2bff('0x91')]=function(_0x6d3362,_0x45c77d){var _0x5c68de=path[_0x2bff('0x8e')](config[_0x2bff('0x87')],_0x2bff('0x92'));var _0xaaf628={'where':{'id':_0x6d3362[_0x2bff('0x67')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x2bff('0x53')][_0x2bff('0x6e')](_0xaaf628)[_0x2bff('0x15')](handleEntityNotFound(_0x45c77d,null))['then'](function(_0x2684eb){if(_0x2684eb){if(!_['isNil'](_0x2684eb[_0x2bff('0x82')])){if(fs[_0x2bff('0x8d')](path[_0x2bff('0x8e')](config[_0x2bff('0x87')],_0x2bff('0x93'),_0x2684eb[_0x2bff('0x82')]))){_0x5c68de=path[_0x2bff('0x8e')](config[_0x2bff('0x87')],_0x2bff('0x93'),_0x2684eb[_0x2bff('0x82')]);}}return _0x45c77d[_0x2bff('0x90')](_0x5c68de);}})[_0x2bff('0x1f')](handleError(_0x45c77d,null));};exports[_0x2bff('0x94')]=function(_0x5b7cb2,_0x28ff35){var _0x22d0f4=path[_0x2bff('0x8e')](config[_0x2bff('0x87')],'server/files/images/avatars/customer_avatar.png');var _0x492eb4={'where':{'id':_0x5b7cb2['params']['id']},'attributes':['id',_0x2bff('0x95'),_0x2bff('0x96')],'raw':!![]};return db[_0x2bff('0x53')][_0x2bff('0x6e')](_0x492eb4)[_0x2bff('0x15')](handleEntityNotFound(_0x28ff35,null))[_0x2bff('0x15')](function(_0xc6967e){if(_0xc6967e){if(!_[_0x2bff('0x8c')](_0xc6967e[_0x2bff('0x95')])){if(fs['existsSync'](path[_0x2bff('0x8e')](config[_0x2bff('0x87')],_0x2bff('0x93'),_0xc6967e['customerAvatar']))&&_0xc6967e[_0x2bff('0x96')]){_0x22d0f4=path[_0x2bff('0x8e')](config[_0x2bff('0x87')],_0x2bff('0x93'),_0xc6967e['customerAvatar']);}}return _0x28ff35[_0x2bff('0x90')](_0x22d0f4);}})[_0x2bff('0x1f')](handleError(_0x28ff35,null));};exports[_0x2bff('0x97')]=function(_0x4b6604,_0x437df5){var _0xb7d8a4=path['join'](config['root'],_0x2bff('0x98'));var _0x229ef7={'where':{'id':_0x4b6604[_0x2bff('0x67')]['id']},'attributes':['id',_0x2bff('0x85')],'raw':!![]};return db[_0x2bff('0x53')][_0x2bff('0x6e')](_0x229ef7)[_0x2bff('0x15')](handleEntityNotFound(_0x437df5,null))['then'](function(_0x1ae266){if(_0x1ae266){if(!_[_0x2bff('0x8c')](_0x1ae266[_0x2bff('0x85')])){if(fs['existsSync'](path[_0x2bff('0x8e')](config['root'],'server/files/images/avatars/',_0x1ae266[_0x2bff('0x85')]))){_0xb7d8a4=path[_0x2bff('0x8e')](config[_0x2bff('0x87')],_0x2bff('0x93'),_0x1ae266[_0x2bff('0x85')]);}}return _0x437df5[_0x2bff('0x90')](_0xb7d8a4);}})[_0x2bff('0x1f')](handleError(_0x437df5,null));};exports[_0x2bff('0x99')]=function(_0x57b296,_0x38bd71){var _0x364aae={'body':_0x57b296['body'],'channel':_0x2bff('0x9a')};var _0x4c28f1=[];var _0x1ca298=[];var _0x10f82f={};var _0x3fe972=![];return db[_0x2bff('0x9b')][_0x2bff('0x72')]()['then'](function(_0x1d339a){if(!_0x1d339a){throw new db[(_0x2bff('0x9c'))][(_0x2bff('0x9d'))]('no\x20available\x20attributes');}_0x4c28f1=_['difference'](_[_0x2bff('0x56')](_0x1d339a),['createdAt','updatedAt']);_0x1ca298=_[_0x2bff('0x9e')](_[_0x2bff('0x56')](_0x1d339a),['createdAt',_0x2bff('0x9f'),_0x2bff('0xa0'),_0x2bff('0xa1')]);if(_0x57b296[_0x2bff('0x6a')]['id']){delete _0x57b296[_0x2bff('0x6a')]['id'];}if(_[_0x2bff('0x8c')](_0x57b296[_0x2bff('0x6a')]['from'])){throw new db['Sequelize'][(_0x2bff('0x9d'))]('from\x20is\x20mandatory');}if(_[_0x2bff('0x8c')](_0x57b296['body'][_0x2bff('0x6a')])||_0x57b296[_0x2bff('0x6a')]['body']===''){throw new db[(_0x2bff('0x9c'))][(_0x2bff('0x9d'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x2bff('0x8c')](_0x57b296[_0x2bff('0x6a')][_0x2bff('0xa2')])){throw new db[(_0x2bff('0x9c'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1ca298);}if(!_[_0x2bff('0xa3')](_0x1ca298,_0x57b296[_0x2bff('0x6a')][_0x2bff('0xa2')])){throw new db['Sequelize'][(_0x2bff('0x9d'))](_0x2bff('0xa4')+_0x1ca298);}_0x10f82f[_0x57b296[_0x2bff('0x6a')][_0x2bff('0xa2')]]=_0x57b296[_0x2bff('0x6a')][_0x2bff('0xa5')];})[_0x2bff('0x15')](function(){return db[_0x2bff('0x53')][_0x2bff('0x6e')]({'where':{'id':_0x57b296[_0x2bff('0x67')]['id']},'include':[{'model':db[_0x2bff('0xa6')],'as':_0x2bff('0xa7'),'include':[{'model':db[_0x2bff('0x9b')],'as':_0x2bff('0xa8'),'where':_0x10f82f,'limit':0x1,'order':[[_0x2bff('0x9f'),_0x2bff('0xa9')]]}]},{'model':db['ChatApplication'],'as':_0x2bff('0xaa')},{'model':db['Interval'],'as':_0x2bff('0x3a'),'include':[{'model':db[_0x2bff('0x3a')],'as':_0x2bff('0x3b'),'attributes':['id','interval'],'raw':!![]}]}]});})[_0x2bff('0x15')](function(_0x33c7b4){if(!_0x33c7b4)throw new APINotFoundError(util[_0x2bff('0x30')](_0x2bff('0xab'),_0x57b296[_0x2bff('0x67')]['id']));if(!_0x33c7b4[_0x2bff('0x3a')]||!_0x33c7b4[_0x2bff('0x3a')][_0x2bff('0x3b')])return[_0x33c7b4,!![]];return[_0x33c7b4,checkWebsiteIntervals(_0x33c7b4)];})[_0x2bff('0xac')](function(_0x90e90f,_0x217740){if(!_0x217740)throw new APIOutOfIntervalError();if(!_0x90e90f['List'])return;_0x364aae[_0x2bff('0xad')]=_0x90e90f;_0x364aae['list']=_0x90e90f[_0x2bff('0xa7')];_0x364aae[_0x2bff('0xae')]=_['orderBy'](_0x90e90f[_0x2bff('0xaa')],[_0x2bff('0xaf')],[_0x2bff('0xb0')]);if(_0x364aae[_0x2bff('0xad')][_0x2bff('0xaa')]){delete _0x364aae[_0x2bff('0xad')]['Applications'];}if(_0x364aae['account']['List']&&_0x364aae['account'][_0x2bff('0xa7')]['Contacts'][_0x2bff('0x5c')]){return _0x364aae[_0x2bff('0xad')][_0x2bff('0xa7')][_0x2bff('0xa8')][0x0];}var _0x4b69d8=_[_0x2bff('0xb1')](_0x57b296[_0x2bff('0x6a')],{'firstName':_0x57b296['body'][_0x2bff('0xa5')],'ListId':_0x90e90f[_0x2bff('0xa1')]});_0x4b69d8[_0x57b296[_0x2bff('0x6a')][_0x2bff('0xa2')]]=_0x57b296[_0x2bff('0x6a')]['from'];return db[_0x2bff('0x9b')]['create'](_0x4b69d8,{'fields':_0x4c28f1,'raw':!![]});})[_0x2bff('0x15')](function(_0x3000c5){_0x364aae[_0x2bff('0xb2')]=_0x3000c5;var _0x3b131d=createInteractionObject(_0x57b296[_0x2bff('0x67')]['id'],_0x57b296[_0x2bff('0x6a')],_0x57b296[_0x2bff('0xb3')],_0x3000c5);var _0x3c5e05={'ChatWebsiteId':_0x57b296['params']['id'],'closed':![]};if(_0x57b296['body'][_0x2bff('0xb4')]){_0x3c5e05[_0x2bff('0xb4')]=_0x57b296['body'][_0x2bff('0xb4')];return db[_0x2bff('0xb5')][_0x2bff('0x6e')]({'where':_0x3c5e05})['then'](function(_0x4b2137){if(_0x4b2137){_0x3fe972=!![];return _0x4b2137;}_0x3b131d[_0x2bff('0xb4')]=_0x57b296[_0x2bff('0x6a')][_0x2bff('0xb4')];_0x3b131d['externalUrl']=_0x57b296[_0x2bff('0x6a')][_0x2bff('0xb6')];return db['ChatInteraction'][_0x2bff('0x69')](_0x3b131d);});}_0x3c5e05[_0x2bff('0xb7')]=_0x3000c5['id'];if(_0x57b296[_0x2bff('0x6a')]['interaction']&&_0x57b296['body'][_0x2bff('0xb8')]['id']){_0x3c5e05['id']=_0x57b296['body'][_0x2bff('0xb8')]['id'];return db[_0x2bff('0xb5')]['find']({'where':_0x3c5e05})[_0x2bff('0x15')](function(_0x8f1149){if(_0x8f1149){_0x3fe972=!![];return _0x8f1149;}return db[_0x2bff('0xb5')][_0x2bff('0x69')](_0x3b131d);});}return db[_0x2bff('0xb5')][_0x2bff('0x69')](_0x3b131d);})[_0x2bff('0x15')](function(_0x5239d0){if(!_0x3fe972)return _0x5239d0;var _0x43c38b={'from':(_0x364aae[_0x2bff('0xb2')][_0x2bff('0xb9')]||'')+'\x20'+(_0x364aae[_0x2bff('0xb2')][_0x2bff('0x46')]||'')};if(_0x57b296[_0x2bff('0x6a')][_0x2bff('0xb4')]&&_0x57b296['body'][_0x2bff('0xba')]&&_0x57b296[_0x2bff('0x6a')][_0x2bff('0xb4')]!=_0x57b296[_0x2bff('0x6a')][_0x2bff('0xba')]){_0x43c38b[_0x2bff('0xb4')]=_0x57b296['body'][_0x2bff('0xba')];}return _0x5239d0['update'](_0x43c38b);})[_0x2bff('0x15')](function(_0x5c4c6a){_0x364aae[_0x2bff('0xb8')]=_0x5c4c6a[_0x2bff('0x28')]({'plain':!![]});_0x364aae[_0x2bff('0xb8')][_0x2bff('0xbb')]=!_0x3fe972;if(_0x364aae[_0x2bff('0xb8')][_0x2bff('0xbb')]){if(_0x364aae['account'][_0x2bff('0xbc')]){_0x364aae[_0x2bff('0xae')][_0x2bff('0xbd')]({'id':0x0,'priority':_0x364aae[_0x2bff('0xae')][_0x2bff('0x5c')]+0x1,'app':_0x2bff('0xbe'),'appdata':_0x2bff('0xbf'),'interval':_0x2bff('0xc0')});}}return db['ChatMessage'][_0x2bff('0x69')]({'body':_0x57b296['body'][_0x2bff('0x6a')],'ChatWebsiteId':_0x57b296[_0x2bff('0x67')]['id'],'ChatInteractionId':_0x5c4c6a['id'],'direction':'in','ContactId':_0x364aae[_0x2bff('0xb2')]['id'],'AttachmentId':_0x57b296['body'][_0x2bff('0xc1')]});})['then'](function(_0x4d7ecf){_0x364aae[_0x2bff('0x1d')]=_0x4d7ecf;if(!_0x364aae[_0x2bff('0xb8')]['UserId']){return;}return db[_0x2bff('0xc2')][_0x2bff('0x6e')]({'attributes':['id',_0x2bff('0x2d')],'where':{'id':_0x364aae[_0x2bff('0xb8')][_0x2bff('0xc3')]}});})[_0x2bff('0x15')](function(_0x9e5373){if(_0x9e5373){_0x364aae[_0x2bff('0xae')][_0x2bff('0xc4')]({'id':0x0,'priority':0x0,'app':_0x2bff('0xc5'),'appdata':_0x9e5373[_0x2bff('0x2d')]+','+(_0x364aae[_0x2bff('0xad')][_0x2bff('0xc6')]||0xa),'interval':_0x2bff('0xc0')});_0x364aae[_0x2bff('0xc7')]=!![];}if(!_0x364aae[_0x2bff('0xb8')][_0x2bff('0xc8')]){return;}return db[_0x2bff('0xc9')][_0x2bff('0x6e')]({'attributes':['id',_0x2bff('0x2d')],'where':{'id':_0x364aae['interaction']['queueId']}});})['then'](function(_0x507153){if(_0x507153){_0x364aae[_0x2bff('0xae')][_0x2bff('0xc4')]({'id':0x0,'priority':0x1,'app':_0x2bff('0xca'),'appdata':_0x507153[_0x2bff('0x2d')]+','+(_0x364aae['account'][_0x2bff('0xcb')]||0x12c),'interval':_0x2bff('0xc0')});}return respondWithRpcPromise(_0x2bff('0xcc'),_0x2bff('0xcd'),_0x364aae);})['then'](function(_0x2f92d8){respondWithRpcPromise('EventManager','EventManager',{'event':_0x2bff('0x99'),'message':_0x2f92d8},client9002);return _0x2f92d8;})[_0x2bff('0x15')](respondWithResult(_0x38bd71,null))[_0x2bff('0x1f')](APIHandleError(_0x38bd71));};exports[_0x2bff('0xce')]=function(_0x245c21,_0x51523e){var _0x4d3c3a,_0x35da45,_0x233f90;var _0x1256bb=[];var _0x547e90={};var _0xe8a7c9=_0x245c21[_0x2bff('0xcf')]||[];var _0xc0a20d=[];var _0x3a984f;return db['CmContact'][_0x2bff('0x72')]()[_0x2bff('0x15')](function(_0x76c09a){if(!_0x76c09a){throw new db[(_0x2bff('0x9c'))][(_0x2bff('0x9d'))](_0x2bff('0xd0'));}_0x1256bb=_[_0x2bff('0x9e')](_[_0x2bff('0x56')](_0x76c09a),[_0x2bff('0xd1'),_0x2bff('0x9f'),_0x2bff('0xa0'),'ListId']);if(_0x245c21[_0x2bff('0x6a')]['id']){delete _0x245c21[_0x2bff('0x6a')]['id'];}if(_[_0x2bff('0x8c')](_0x245c21['body'][_0x2bff('0xa5')])){throw _0x51523e['status'](0x1f4)[_0x2bff('0xd2')](new db['Sequelize'][(_0x2bff('0x9d'))]('from\x20is\x20mandatory'));}if(_['isNil'](_0x245c21[_0x2bff('0x6a')][_0x2bff('0x6a')])||_0x245c21['body']['body']===''){throw _0x51523e[_0x2bff('0x26')](0x1f4)[_0x2bff('0xd2')](new db[(_0x2bff('0x9c'))][(_0x2bff('0x9d'))](_0x2bff('0xd3')));}if(_[_0x2bff('0x8c')](_0x245c21[_0x2bff('0x6a')]['mapKeyOffline'])){throw _0x51523e['status'](0x1f4)[_0x2bff('0xd2')](new db[(_0x2bff('0x9c'))][(_0x2bff('0x9d'))](_0x2bff('0xd4')+_0x1256bb));}if(!_[_0x2bff('0xa3')](_0x1256bb,_0x245c21[_0x2bff('0x6a')][_0x2bff('0xd5')])){throw _0x51523e[_0x2bff('0x26')](0x1f4)[_0x2bff('0xd2')](new db[(_0x2bff('0x9c'))][(_0x2bff('0x9d'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1256bb));}_0x547e90[_0x245c21[_0x2bff('0x6a')][_0x2bff('0xd5')]]=_0x245c21[_0x2bff('0x6a')][_0x2bff('0xa5')];})[_0x2bff('0x15')](function(){return db['ChatWebsite']['find']({'where':{'id':_0x245c21[_0x2bff('0x67')]['id']},'include':[{'model':db[_0x2bff('0xa6')],'as':'List'},{'model':db[_0x2bff('0xd6')],'as':_0x2bff('0xd6')}]});})['then'](handleEntityNotFound(_0x51523e,null))['then'](function(_0x55ea5c){if(_0x55ea5c&&_0x55ea5c[_0x2bff('0xa7')]){_0x35da45=_0x55ea5c;var _0x34b276=_[_0x2bff('0xb1')](_0x245c21[_0x2bff('0x6a')],{'firstName':_0x245c21[_0x2bff('0x6a')][_0x2bff('0xa5')],'phone':_0x245c21[_0x2bff('0x6a')][_0x2bff('0xa5')],'ListId':_0x55ea5c['ListId']});_0x34b276[_0x245c21[_0x2bff('0x6a')][_0x2bff('0xd5')]]=_0x245c21['body'][_0x2bff('0xa5')];return db[_0x2bff('0x9b')][_0x2bff('0xd7')]({'where':_0x547e90,'defaults':_0x34b276});}})[_0x2bff('0xac')](function(_0x840292){if(_0x840292){_0x233f90=_0x840292;var _0xd7a0b4=fs[_0x2bff('0xd8')](path[_0x2bff('0x8e')](config[_0x2bff('0x87')],_0x2bff('0xd9')),_0x2bff('0xda'));var _0x25316e=ejs[_0x2bff('0xdb')](_0xd7a0b4,{'body':_[_0x2bff('0xdc')](_0x245c21[_0x2bff('0x6a')][_0x2bff('0x6a')]),'bodyTitle':_0x35da45[_0x2bff('0xdd')]});return db['ChatOfflineMessage']['create']({'body':_0x25316e,'plainBody':htmlToText['fromString'](_0x25316e),'ContactId':_0x840292['id'],'ChatWebsiteId':_0x35da45['id']});}})[_0x2bff('0x15')](function(_0x30dae9){_0x3a984f=_0x30dae9;if(_0xe8a7c9[_0x2bff('0x5c')]){var _0x99cb66=_0xe8a7c9['map'](function(_0x147810){return{'name':_0x147810[_0x2bff('0xde')],'basename':_0x147810[_0x2bff('0x80')],'type':_0x147810[_0x2bff('0xdf')],'ChatOfflineMessageId':_0x30dae9['id']};});_0xc0a20d=_0x99cb66[_0x2bff('0x39')](_0x106487=>{var _0x8016e={'filename':_0x106487[_0x2bff('0x2d')],'path':path[_0x2bff('0x8e')](config[_0x2bff('0x87')],_0x2bff('0xe0'),_0x2bff('0xcf'),_0x2bff('0xe1'),_0x2bff('0xe2'),_0x106487[_0x2bff('0xe3')])};return _0x8016e;});if(!_0x35da45[_0x2bff('0xe4')]){return db[_0x2bff('0xe5')]['transaction'](function(_0xde922c){return db['Attachment']['bulkCreate'](_0x99cb66,{'transaction':_0xde922c});});}}})['then'](function(){if(_0x3a984f){_0x4d3c3a=_0x3a984f;return db[_0x2bff('0xd6')][_0x2bff('0x75')]({'where':{'service':!![]},'include':[{'model':db[_0x2bff('0xe6')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x2bff('0xe7')],'as':_0x2bff('0xe7'),'raw':!![]}]}]});}})[_0x2bff('0x15')](function(_0x2407fd){if(_0x2407fd&&_0x2407fd[_0x2bff('0xe8')]&&_0x35da45['forwardOffline']&&_0x35da45[_0x2bff('0xe9')]){var _0x32820a=_0x2407fd[_0x2bff('0xea')]();return respondWithRpcPromise(_0x2bff('0xeb'),_0x2bff('0xec'),{'account':_0x32820a,'message':{'from':util[_0x2bff('0x30')]('\x22%s\x22\x20<%s>',_0x2407fd[_0x2bff('0x2d')],_0x2407fd[_0x2bff('0xed')]||_0x2407fd[_0x2bff('0xe8')][_0x2bff('0x6b')]),'to':_0x35da45['forwardOfflineAddress'],'subject':_0x35da45[_0x2bff('0xee')],'html':_0x4d3c3a[_0x2bff('0x6a')],'attachments':_0xc0a20d}},client9003)[_0x2bff('0x15')](function(){return _0x4d3c3a;})[_0x2bff('0x1f')](function(_0x21c3b9){logger[_0x2bff('0x1b')](_0x21c3b9);});}})[_0x2bff('0x15')](function(){if(_0x35da45&&_0x35da45['openNewInteraction']&&_0x35da45[_0x2bff('0xef')]){var _0x5bdb9c=[];if(_0xe8a7c9[_0x2bff('0x5c')]){_0x5bdb9c=_0xe8a7c9[_0x2bff('0x39')](function(_0x481182){return{'name':_0x481182[_0x2bff('0xde')],'basename':_0x481182[_0x2bff('0x80')],'type':_0x481182[_0x2bff('0xdf')],'ChatOfflineMessageId':_0x3a984f['id']};});}var _0x353eb0;if(!_['isNil'](_0x35da45[_0x2bff('0xf0')])){var _0x343928=_['map'](_0x245c21['body'],function(_0x1125d5){return _0x1125d5;});var _0x31cfdd=_[_0x2bff('0xf1')](_0x343928)[0x0];var _0xe56304=_[_0x2bff('0xf2')](_0x31cfdd,function(_0x53c058){return _0x53c058;});_0x353eb0=_0xe56304[0x1][_0x35da45['subjectOffline']];}var _0x317a4f={'from':_0x233f90[_0x2bff('0xed')],'firstName':_0x233f90[_0x2bff('0xb9')],'lastName':_0x233f90[_0x2bff('0x46')],'mapKey':_0x2bff('0xed'),'message':{'from':_0x233f90[_0x2bff('0xed')],'to':_0x35da45[_0x2bff('0xd6')]['email'],'cc':'','subject':_[_0x2bff('0x8c')](_0x353eb0)?_0x35da45[_0x2bff('0xee')]:_0x353eb0,'messageId':'','sentAt':new Date(),'attach':_0x5bdb9c[_0x2bff('0x5c')],'attachments':_0x5bdb9c,'originChannel':_0x2bff('0xf3'),'ChatWebsiteId':_0x35da45['id'],'ChatOfflineMessageId':_0x4d3c3a['id'],'originTo':_0x35da45[_0x2bff('0xd6')][_0x2bff('0xed')]},'body':_0x4d3c3a[_0x2bff('0x6a')]};var _0x120186={'account':{'id':_0x35da45[_0x2bff('0xef')]},'body':_0x317a4f,'log':_0x2bff('0xf4')};return respondWithRpcPromise(_0x2bff('0xf4'),_0x2bff('0xf5'),_0x120186,client9001)[_0x2bff('0x15')](function(){return _0x4d3c3a;})[_0x2bff('0x1f')](function(_0x1dd021){logger[_0x2bff('0x1b')](_0x1dd021);});}return;})[_0x2bff('0x15')](function(){if(_0x4d3c3a){return _0x4d3c3a;}})[_0x2bff('0x15')](respondWithResult(_0x51523e,null))['catch'](function(){for(var _0xd05e0b of _0xe8a7c9){var _0x4be99e=path['join'](config['root'],_0x2bff('0xe0'),_0x2bff('0xcf'),_0x2bff('0xe1'),_0x2bff('0xe2'),_0xd05e0b['filename']);fs_extra[_0x2bff('0xf6')](_0x4be99e)[_0x2bff('0x1f')](function(_0x5b62fc){logger['error']('Could\x20not\x20remove\x20attachment\x20file',_0x4be99e,_0x5b62fc);});}});};exports[_0x2bff('0xf7')]=function(_0x969cdd,_0x5351bc){return db[_0x2bff('0xb5')]['find']({'where':{'id':_0x969cdd[_0x2bff('0x67')]['id']}})['then'](handleEntityNotFound(_0x5351bc,null))[_0x2bff('0x15')](function(_0x4b4e9a){if(_0x4b4e9a){return _0x4b4e9a[_0x2bff('0xf7')](_0x969cdd['body']['ids'],_[_0x2bff('0xf8')](_0x969cdd[_0x2bff('0x6a')],[_0x2bff('0x7e'),'id'])||{});}})[_0x2bff('0x15')](respondWithResult(_0x5351bc,null))[_0x2bff('0x1f')](handleError(_0x5351bc,null));};exports['getInteractions']=function(_0x3c138d,_0x2e6e4b){var _0x2ae31a={'raw':![],'where':{}};var _0x16e837={};var _0x137e70={'count':0x0,'rows':[]};return db[_0x2bff('0x53')][_0x2bff('0x75')]({'where':{'id':_0x3c138d['params']['id']}})['then'](handleEntityNotFound(_0x2e6e4b,null))[_0x2bff('0x15')](function(_0x4ba82e){if(_0x4ba82e){_0x16e837[_0x2bff('0x4e')]=_[_0x2bff('0x56')](db[_0x2bff('0xb5')][_0x2bff('0x54')]);_0x16e837[_0x2bff('0x57')]=_[_0x2bff('0x56')](_0x3c138d[_0x2bff('0x57')]);_0x16e837['filters']=_[_0x2bff('0x59')](_0x16e837[_0x2bff('0x4e')],_0x16e837[_0x2bff('0x57')]);_0x2ae31a['attributes']=_['intersection'](_0x16e837[_0x2bff('0x4e')],qs[_0x2bff('0x5b')](_0x3c138d[_0x2bff('0x57')]['fields']));_0x2ae31a[_0x2bff('0x5a')]=_0x2ae31a['attributes'][_0x2bff('0x5c')]?_0x2ae31a[_0x2bff('0x5a')]:_0x16e837['model'];if(!_0x3c138d[_0x2bff('0x57')][_0x2bff('0x7b')](_0x2bff('0x7c'))){_0x2ae31a[_0x2bff('0x24')]=qs['limit'](_0x3c138d['query'][_0x2bff('0x24')]);_0x2ae31a['offset']=qs[_0x2bff('0x22')](_0x3c138d[_0x2bff('0x57')]['offset']);}_0x2ae31a[_0x2bff('0x76')]=qs[_0x2bff('0x5d')](_0x3c138d[_0x2bff('0x57')][_0x2bff('0x5d')]);_0x2ae31a['where']=qs[_0x2bff('0x58')](_[_0x2bff('0x5e')](_0x3c138d[_0x2bff('0x57')],_0x16e837[_0x2bff('0x58')]));_0x2ae31a[_0x2bff('0x60')]['ChatWebsiteId']=_0x4ba82e['id'];if(_0x3c138d[_0x2bff('0x57')]['filter']){_0x2ae31a[_0x2bff('0x60')]=_['merge'](_0x2ae31a[_0x2bff('0x60')],{'$or':_['map'](_0x2ae31a[_0x2bff('0x5a')],function(_0x50ed9e){var _0xda666f={};_0xda666f[_0x50ed9e]={'$like':'%'+_0x3c138d[_0x2bff('0x57')][_0x2bff('0x5f')]+'%'};return _0xda666f;})});}_0x2ae31a=_[_0x2bff('0x61')]({},_0x2ae31a,_0x3c138d['options']);return db[_0x2bff('0xb5')]['count']({'where':_0x2ae31a['where']})[_0x2bff('0x15')](function(_0x1cb33c){_0x137e70[_0x2bff('0x25')]=_0x1cb33c;if(_0x3c138d[_0x2bff('0x57')][_0x2bff('0x68')]){_0x2ae31a[_0x2bff('0x64')]=[{'model':db[_0x2bff('0x9b')],'as':_0x2bff('0xf9'),'required':![]},{'model':db['User'],'as':_0x2bff('0xfa'),'attributes':[_0x2bff('0x2d'),_0x2bff('0xfb'),_0x2bff('0xfc')],'required':![]},{'model':db[_0x2bff('0xfd')],'as':'Tags','attributes':['id',_0x2bff('0x2d'),_0x2bff('0xfe')],'where':_0x3c138d[_0x2bff('0x57')]['tag']?{'id':_0x3c138d[_0x2bff('0x57')][_0x2bff('0xff')]}:undefined,'required':_0x3c138d[_0x2bff('0x57')][_0x2bff('0xff')]?!![]:![]}];}return db['ChatInteraction'][_0x2bff('0x65')](_0x2ae31a);})[_0x2bff('0x15')](function(_0x33a47c){_0x137e70[_0x2bff('0x66')]=_0x33a47c;return _0x137e70;});}})[_0x2bff('0x15')](respondWithFilteredResult(_0x2e6e4b,_0x2ae31a))[_0x2bff('0x1f')](handleError(_0x2e6e4b,null));};exports[_0x2bff('0x2f')]=function(_0x22a79a,_0x42aaea){var _0x2d6540=0x0;var _0x441712=0x0;var _0x519bac=![];var _0x2f3623;var _0x3e911d;return db[_0x2bff('0x53')][_0x2bff('0x6e')]({'where':{'id':_0x22a79a[_0x2bff('0x67')]['id']},'include':[{'model':db[_0x2bff('0x3a')],'as':_0x2bff('0x3a'),'include':[{'model':db['Interval'],'as':'Intervals','attributes':['id',_0x2bff('0x32')]}]}]})[_0x2bff('0x15')](handleEntityNotFound(_0x42aaea,null))[_0x2bff('0x15')](function(_0x45785d){if(_0x45785d){_0x2f3623=_0x45785d;return _0x45785d['getProactiveActions']({'raw':!![]});}})[_0x2bff('0x15')](function(_0x1f4aa5){if(_0x2f3623){if(_0x1f4aa5){_0x3e911d=_0x1f4aa5;}}return require('../../config/license/util')[_0x2bff('0x8a')]();})['then'](function(_0x514e2f){if(_0x514e2f){_0x441712=_0x514e2f[_0x2bff('0x100')];_0x519bac=_0x514e2f[_0x2bff('0x8b')];}})[_0x2bff('0x15')](function(){return db[_0x2bff('0xb5')][_0x2bff('0x25')]({'where':{'closed':![]}});})[_0x2bff('0x15')](function(_0x1bbe97){_0x2d6540=_0x1bbe97;if(_0x441712&&_0x1bbe97>_0x441712){return db['License']['findOne']({'where':{'id':0x1}})[_0x2bff('0x15')](function(_0x3beac8){if(_0x3beac8){_0x3beac8[_0x2bff('0x101')](_0x2bff('0x102'));}});}})[_0x2bff('0x15')](function(){if(!_0x2f3623[_0x2bff('0x3a')]||!_0x2f3623['Interval'][_0x2bff('0x3b')])return!![];return checkWebsiteIntervals(_0x2f3623);})['then'](function(_0x29b888){var _0x22810e=fs[_0x2bff('0xd8')](path[_0x2bff('0x8e')](config[_0x2bff('0x87')],'server/files/chat/iframe.ejs'),_0x2bff('0xda'));var _0x4aff0c=new url[(_0x2bff('0x103'))](_0x2f3623[_0x2bff('0x104')])[_0x2bff('0x105')];var _0x55aab5=_0x2bff('0x106');var _0x5cdec4=![];var _0x143684={'chatVersion':_0x55aab5,'chatWebsiteAddressOrigin':_0x4aff0c,'remote':_0x2f3623['remote'],'query':querystring[_0x2bff('0x1a')](_[_0x2bff('0x61')](_0x2f3623[_0x2bff('0x28')]({'plain':!![]}),{'customerIp':_0x22a79a['headers'][_0x2bff('0x43')]||_0x22a79a['headers'][_0x2bff('0x107')]||_0x22a79a[_0x2bff('0x108')][_0x2bff('0x109')]||_0x22a79a['ip'],'referer':_0x22a79a[_0x2bff('0xb3')]['referer'],'openedInteractions':_0x2d6540,'maxInteractions':_0x441712,'virtual':_0x519bac['virtual'],'online':_0x29b888,'custom':_0x519bac}))[_0x2bff('0x10a')](/'/g,'\x5c\x27')};_0x42aaea[_0x2bff('0xd2')](ejs[_0x2bff('0xdb')](Mustache[_0x2bff('0xdb')](_0x22810e,_0x143684),{'proactiveActions':_0x3e911d,'alignment':_0x2f3623['alignment'],'verticalAlignment':_0x2f3623['verticalAlignment'],'div_color':_0x2f3623[_0x2bff('0xfe')],'labelText':_0x2f3623[_0x2bff('0x10b')],'text_color':_0x2f3623[_0x2bff('0x10c')],'text_button_color':_0x2f3623[_0x2bff('0x10d')],'button_color':_0x2f3623[_0x2bff('0x10e')],'background_color':_0x2f3623[_0x2bff('0x10f')],'hideWhenOffline':_0x2f3623[_0x2bff('0x110')],'intervalId':_0x2f3623[_0x2bff('0x111')],'isDevelopment':_0x5cdec4,'chatVersion':_0x55aab5}));})['catch'](handleError(_0x42aaea,null));};exports['addApplications']=function(_0x440667,_0x10b6f8){var _0x2da60c=_0x440667[_0x2bff('0x67')]['id'];var _0x28f352=_0x440667['body'];var _0x371dba=0xc8;var _0x184410=null;return db[_0x2bff('0xe5')][_0x2bff('0x112')]({'isolationLevel':db[_0x2bff('0xe5')]['Transaction'][_0x2bff('0x113')][_0x2bff('0x114')]},function(_0x4042f8){return db[_0x2bff('0x53')][_0x2bff('0x75')]({'where':{'id':_0x2da60c},'transaction':_0x4042f8})[_0x2bff('0x15')](function(_0x1259b9){if(_0x1259b9){return db[_0x2bff('0x115')]['destroy']({'where':{'ChatWebsiteId':_0x2da60c},'transaction':_0x4042f8})['then'](function(){var _0x51b87f=_[_0x2bff('0x39')](_0x28f352,function(_0x2a0298){_0x2a0298['ChatWebsiteId']=_0x2da60c;return _0x2a0298;});return db['ChatApplication'][_0x2bff('0x116')](_0x51b87f,{'transaction':_0x4042f8});});}else{_0x371dba=0x194;_0x184410=[];}});})['then'](function(){if(_0x371dba!==0x194){return db[_0x2bff('0x115')][_0x2bff('0x117')]({'where':{'ChatWebsiteId':_0x2da60c},'order':_0x2bff('0xaf')})[_0x2bff('0x15')](function(_0x4ed5fd){_0x184410=_0x4ed5fd;});}})[_0x2bff('0x1f')](function(_0x4b06e6){_0x371dba=0x1f4;logger[_0x2bff('0x1b')](_0x4b06e6[_0x2bff('0x2c')]);if(_0x4b06e6[_0x2bff('0x2d')]){delete _0x4b06e6['name'];}_0x184410=_0x4b06e6;})['finally'](function(){if(_0x184410===null){_0x10b6f8['sendStatus'](_0x371dba);}else{if(_0x371dba===0x1f4){_0x10b6f8[_0x2bff('0x26')](_0x371dba)[_0x2bff('0xd2')](_0x184410);}else{_0x10b6f8[_0x2bff('0x26')](_0x371dba)[_0x2bff('0x21')](_0x184410);}}});};exports[_0x2bff('0x118')]=function(_0x539578,_0x5938b1){var _0x3bf140={};var _0x18b821={};var _0x327090;var _0x25afc8;return db[_0x2bff('0x53')][_0x2bff('0x75')]({'where':{'id':_0x539578[_0x2bff('0x67')]['id']}})[_0x2bff('0x15')](handleEntityNotFound(_0x5938b1,null))[_0x2bff('0x15')](function(_0xd793c2){if(_0xd793c2){_0x327090=_0xd793c2;_0x18b821[_0x2bff('0x4e')]=_[_0x2bff('0x56')](db[_0x2bff('0x115')]['rawAttributes']);_0x18b821['query']=_[_0x2bff('0x56')](_0x539578[_0x2bff('0x57')]);_0x18b821['filters']=_[_0x2bff('0x59')](_0x18b821[_0x2bff('0x4e')],_0x18b821['query']);_0x3bf140[_0x2bff('0x5a')]=_['intersection'](_0x18b821[_0x2bff('0x4e')],qs[_0x2bff('0x5b')](_0x539578[_0x2bff('0x57')][_0x2bff('0x5b')]));_0x3bf140[_0x2bff('0x5a')]=_0x3bf140[_0x2bff('0x5a')][_0x2bff('0x5c')]?_0x3bf140[_0x2bff('0x5a')]:_0x18b821[_0x2bff('0x4e')];_0x3bf140[_0x2bff('0x76')]=qs[_0x2bff('0x5d')](_0x539578[_0x2bff('0x57')]['sort']);_0x3bf140['where']=qs[_0x2bff('0x58')](_[_0x2bff('0x5e')](_0x539578['query'],_0x18b821['filters']));if(_0x539578[_0x2bff('0x57')][_0x2bff('0x5f')]){_0x3bf140[_0x2bff('0x60')]=_[_0x2bff('0x61')](_0x3bf140[_0x2bff('0x60')],{'$or':_['map'](_0x3bf140[_0x2bff('0x5a')],function(_0x2b0c29){var _0x522ad7={};_0x522ad7[_0x2b0c29]={'$like':'%'+_0x539578[_0x2bff('0x57')]['filter']+'%'};return _0x522ad7;})});}_0x3bf140=_[_0x2bff('0x61')]({},_0x3bf140,_0x539578[_0x2bff('0x63')]);return _0x327090[_0x2bff('0x118')](_0x3bf140);}})[_0x2bff('0x15')](function(_0x29c307){if(_0x29c307){_0x25afc8=_0x29c307[_0x2bff('0x5c')];if(!_0x539578[_0x2bff('0x57')][_0x2bff('0x7b')](_0x2bff('0x7c'))){_0x3bf140[_0x2bff('0x24')]=qs[_0x2bff('0x24')](_0x539578['query'][_0x2bff('0x24')]);_0x3bf140[_0x2bff('0x22')]=qs['offset'](_0x539578[_0x2bff('0x57')][_0x2bff('0x22')]);}return _0x327090[_0x2bff('0x118')](_0x3bf140);}})['then'](function(_0x1a2f5a){if(_0x1a2f5a){return _0x1a2f5a?{'count':_0x25afc8,'rows':_0x1a2f5a}:null;}})['then'](respondWithResult(_0x5938b1,null))['catch'](handleError(_0x5938b1,null));};exports[_0x2bff('0x119')]=function(_0x59ec93,_0x4d4748){return db[_0x2bff('0x11a')][_0x2bff('0x6e')]({'where':{'id':_0x59ec93['params']['id']}})[_0x2bff('0x15')](handleEntityNotFound(_0x4d4748,null))['then'](function(_0x8d0a59){if(_0x8d0a59){return _0x8d0a59[_0x2bff('0x119')](_0x59ec93[_0x2bff('0x6a')][_0x2bff('0x7e')],_[_0x2bff('0xf8')](_0x59ec93[_0x2bff('0x6a')],[_0x2bff('0x7e'),'id'])||{});}})[_0x2bff('0x15')](respondWithResult(_0x4d4748,null))[_0x2bff('0x1f')](handleError(_0x4d4748,null));};exports[_0x2bff('0x11b')]=function(_0x38efa4,_0x16182c){var _0x1df7cb={};var _0x2d71cf={};var _0x4a576f;var _0x4932cd;return db[_0x2bff('0x53')][_0x2bff('0x75')]({'where':{'id':_0x38efa4[_0x2bff('0x67')]['id']}})[_0x2bff('0x15')](handleEntityNotFound(_0x16182c,null))[_0x2bff('0x15')](function(_0x25bc13){if(_0x25bc13){_0x4a576f=_0x25bc13;_0x2d71cf[_0x2bff('0x4e')]=_[_0x2bff('0x56')](db[_0x2bff('0x11c')]['rawAttributes']);_0x2d71cf[_0x2bff('0x57')]=_[_0x2bff('0x56')](_0x38efa4[_0x2bff('0x57')]);_0x2d71cf['filters']=_[_0x2bff('0x59')](_0x2d71cf[_0x2bff('0x4e')],_0x2d71cf[_0x2bff('0x57')]);_0x1df7cb[_0x2bff('0x5a')]=_[_0x2bff('0x59')](_0x2d71cf[_0x2bff('0x4e')],qs['fields'](_0x38efa4['query']['fields']));_0x1df7cb[_0x2bff('0x5a')]=_0x1df7cb[_0x2bff('0x5a')][_0x2bff('0x5c')]?_0x1df7cb[_0x2bff('0x5a')]:_0x2d71cf[_0x2bff('0x4e')];_0x1df7cb[_0x2bff('0x76')]=qs[_0x2bff('0x5d')](_0x38efa4['query'][_0x2bff('0x5d')]);_0x1df7cb['where']=qs[_0x2bff('0x58')](_[_0x2bff('0x5e')](_0x38efa4[_0x2bff('0x57')],_0x2d71cf['filters']));if(_0x38efa4[_0x2bff('0x57')]['filter']){_0x1df7cb[_0x2bff('0x60')]=_[_0x2bff('0x61')](_0x1df7cb['where'],{'$or':_['map'](_0x1df7cb[_0x2bff('0x5a')],function(_0x26ba85){var _0x2e7789={};_0x2e7789[_0x26ba85]={'$like':'%'+_0x38efa4['query']['filter']+'%'};return _0x2e7789;})});}_0x1df7cb=_[_0x2bff('0x61')]({},_0x1df7cb,_0x38efa4[_0x2bff('0x63')]);return _0x4a576f['getProactiveActions'](_0x1df7cb);}})['then'](function(_0x31e97b){if(_0x31e97b){_0x4932cd=_0x31e97b[_0x2bff('0x5c')];if(!_0x38efa4[_0x2bff('0x57')]['hasOwnProperty'](_0x2bff('0x7c'))){_0x1df7cb[_0x2bff('0x24')]=qs[_0x2bff('0x24')](_0x38efa4['query']['limit']);_0x1df7cb[_0x2bff('0x22')]=qs['offset'](_0x38efa4[_0x2bff('0x57')]['offset']);}return _0x4a576f['getProactiveActions'](_0x1df7cb);}})[_0x2bff('0x15')](function(_0x150a44){if(_0x150a44){return _0x150a44?{'count':_0x4932cd,'rows':_0x150a44}:null;}})['then'](respondWithResult(_0x16182c,null))['catch'](handleError(_0x16182c,null));};exports['getFields']=function(_0x3bfeda,_0x845aa6){var _0x337c03=_0x3bfeda['query'][_0x2bff('0x11d')]===_0x2bff('0x11e')?_0x2bff('0x11f'):'onlineForm';return db['ChatWebsite']['find']({'attributes':['id',_0x337c03],'where':{'id':_0x3bfeda[_0x2bff('0x67')]['id']}})['then'](handleEntityNotFound(_0x845aa6,null))['then'](function(_0xdfb139){if(_0xdfb139){var _0x8eea5d=_0xdfb139[_0x337c03];var _0x55a0b4=_0x8eea5d&&_0x8eea5d[_0x2bff('0x120')]?_0x8eea5d[_0x2bff('0x120')]:[];_0x845aa6['send']({'fromKey':_[_0x2bff('0x8c')](_0x8eea5d[_0x2bff('0x121')])?undefined:_0x8eea5d['fromKey'],'count':_0x55a0b4[_0x2bff('0x5c')],'rows':_0x55a0b4});}})[_0x2bff('0x1f')](handleError(_0x845aa6,null));};exports['getOfflineMessages']=function(_0x29f677,_0x4ea39f){var _0x40c93c={'raw':![],'where':{}};var _0x246d30={};var _0x1325f0={'count':0x0,'rows':[]};return db[_0x2bff('0x53')][_0x2bff('0x75')]({'where':{'id':_0x29f677[_0x2bff('0x67')]['id']}})[_0x2bff('0x15')](handleEntityNotFound(_0x4ea39f,null))[_0x2bff('0x15')](function(_0x8fb2c8){if(_0x8fb2c8){_0x246d30[_0x2bff('0x4e')]=_['keys'](db[_0x2bff('0x122')]['rawAttributes']);_0x246d30[_0x2bff('0x57')]=_[_0x2bff('0x56')](_0x29f677[_0x2bff('0x57')]);_0x246d30[_0x2bff('0x58')]=_[_0x2bff('0x59')](_0x246d30[_0x2bff('0x4e')],_0x246d30[_0x2bff('0x57')]);_0x40c93c[_0x2bff('0x5a')]=_[_0x2bff('0x59')](_0x246d30['model'],qs[_0x2bff('0x5b')](_0x29f677[_0x2bff('0x57')][_0x2bff('0x5b')]));_0x40c93c['attributes']=_0x40c93c['attributes'][_0x2bff('0x5c')]?_0x40c93c[_0x2bff('0x5a')]:_0x246d30['model'];if(!_0x29f677['query'][_0x2bff('0x7b')](_0x2bff('0x7c'))){_0x40c93c[_0x2bff('0x24')]=qs[_0x2bff('0x24')](_0x29f677[_0x2bff('0x57')][_0x2bff('0x24')]);_0x40c93c['offset']=qs[_0x2bff('0x22')](_0x29f677[_0x2bff('0x57')][_0x2bff('0x22')]);}_0x40c93c[_0x2bff('0x76')]=qs[_0x2bff('0x5d')](_0x29f677[_0x2bff('0x57')][_0x2bff('0x5d')]);_0x40c93c[_0x2bff('0x60')]=qs[_0x2bff('0x58')](_[_0x2bff('0x5e')](_0x29f677[_0x2bff('0x57')],_0x246d30[_0x2bff('0x58')]));_0x40c93c['where'][_0x2bff('0x78')]=_0x8fb2c8['id'];if(_0x29f677['query'][_0x2bff('0x5f')]){_0x40c93c[_0x2bff('0x60')]=_[_0x2bff('0x61')](_0x40c93c[_0x2bff('0x60')],{'$or':_['map'](_0x40c93c[_0x2bff('0x5a')],function(_0x580f80){var _0x18ff45={};_0x18ff45[_0x580f80]={'$like':'%'+_0x29f677[_0x2bff('0x57')]['filter']+'%'};return _0x18ff45;})});}_0x40c93c=_[_0x2bff('0x61')]({},_0x40c93c,_0x29f677[_0x2bff('0x63')]);return db[_0x2bff('0x122')][_0x2bff('0x25')]({'where':_0x40c93c[_0x2bff('0x60')]})['then'](function(_0x587d24){_0x1325f0[_0x2bff('0x25')]=_0x587d24;if(_0x29f677[_0x2bff('0x57')]['includeAll']){_0x40c93c['include']=[{'all':!![]}];}else{_0x40c93c[_0x2bff('0x64')]=[{'model':db[_0x2bff('0x9b')],'as':_0x2bff('0xf9'),'required':![]},{'model':db['Attachment'],'as':_0x2bff('0x123'),'required':![]}];}return db[_0x2bff('0x122')][_0x2bff('0x65')](_0x40c93c);})['then'](function(_0x1dcde5){_0x1325f0[_0x2bff('0x66')]=_0x1dcde5;return _0x1325f0;});}})[_0x2bff('0x15')](respondWithFilteredResult(_0x4ea39f,_0x40c93c))[_0x2bff('0x1f')](handleError(_0x4ea39f,null));};exports['addAgents']=function(_0x2b5442,_0x1c3d2f){return db[_0x2bff('0x53')]['find']({'where':{'id':_0x2b5442[_0x2bff('0x67')]['id']}})[_0x2bff('0x15')](handleEntityNotFound(_0x1c3d2f,null))[_0x2bff('0x15')](function(_0xec859f){if(_0xec859f){return _0xec859f[_0x2bff('0x124')](_0x2b5442['body'][_0x2bff('0x7e')],_[_0x2bff('0xf8')](_0x2b5442[_0x2bff('0x6a')],[_0x2bff('0x7e'),'id'])||{})[_0x2bff('0xac')](function(_0x4e30af){for(var _0x3515fd=0x0;_0x3515fd<_0x2b5442['body'][_0x2bff('0x7e')][_0x2bff('0x5c')];_0x3515fd+=0x1){socket[_0x2bff('0x125')](_0x2bff('0x126'),{'UserId':Number(_0x2b5442[_0x2bff('0x6a')]['ids'][_0x3515fd]),'ChatWebsiteId':Number(_0x2b5442[_0x2bff('0x67')]['id'])});}return _0x4e30af;});}})[_0x2bff('0x15')](respondWithResult(_0x1c3d2f,null))[_0x2bff('0x1f')](handleError(_0x1c3d2f,null));};exports[_0x2bff('0x127')]=function(_0x261ea2,_0x3edfb9){return db[_0x2bff('0x53')][_0x2bff('0x6e')]({'where':{'id':_0x261ea2[_0x2bff('0x67')]['id']}})[_0x2bff('0x15')](handleEntityNotFound(_0x3edfb9,null))[_0x2bff('0x15')](function(_0x466d87){if(_0x466d87){return _0x466d87[_0x2bff('0x127')](_0x261ea2['query']['ids'])[_0x2bff('0x15')](function(){if(_[_0x2bff('0x128')](_0x261ea2[_0x2bff('0x57')][_0x2bff('0x7e')])){for(var _0xd00ccc=0x0;_0xd00ccc<_0x261ea2[_0x2bff('0x57')][_0x2bff('0x7e')][_0x2bff('0x5c')];_0xd00ccc+=0x1){socket[_0x2bff('0x125')]('userChatWebsite:remove',{'UserId':Number(_0x261ea2['query']['ids'][_0xd00ccc]),'ChatWebsiteId':Number(_0x261ea2[_0x2bff('0x67')]['id'])});}}else{socket[_0x2bff('0x125')](_0x2bff('0x129'),{'UserId':Number(_0x261ea2[_0x2bff('0x57')]['ids']),'ChatWebsiteId':Number(_0x261ea2['params']['id'])});}});}})[_0x2bff('0x15')](respondWithStatusCode(_0x3edfb9,null))[_0x2bff('0x1f')](handleError(_0x3edfb9,null));};exports[_0x2bff('0x12a')]=function(_0x54ba2a,_0x252b49){var _0x2c6aad={};var _0x1e710b={};var _0x494710;var _0x3200e2;return db[_0x2bff('0x53')][_0x2bff('0x75')]({'where':{'id':_0x54ba2a[_0x2bff('0x67')]['id']}})[_0x2bff('0x15')](handleEntityNotFound(_0x252b49,null))[_0x2bff('0x15')](function(_0x3bfa5b){if(_0x3bfa5b){_0x494710=_0x3bfa5b;_0x1e710b[_0x2bff('0x4e')]=_[_0x2bff('0x56')](db[_0x2bff('0xc2')][_0x2bff('0x54')]);_0x1e710b[_0x2bff('0x57')]=_[_0x2bff('0x56')](_0x54ba2a[_0x2bff('0x57')]);_0x1e710b[_0x2bff('0x58')]=_[_0x2bff('0x59')](_0x1e710b[_0x2bff('0x4e')],_0x1e710b[_0x2bff('0x57')]);_0x2c6aad['attributes']=_['intersection'](_0x1e710b[_0x2bff('0x4e')],qs['fields'](_0x54ba2a[_0x2bff('0x57')][_0x2bff('0x5b')]));_0x2c6aad[_0x2bff('0x5a')]=_0x2c6aad[_0x2bff('0x5a')][_0x2bff('0x5c')]?_0x2c6aad[_0x2bff('0x5a')]:_0x1e710b['model'];_0x2c6aad['order']=qs[_0x2bff('0x5d')](_0x54ba2a[_0x2bff('0x57')][_0x2bff('0x5d')]);_0x2c6aad[_0x2bff('0x60')]=qs[_0x2bff('0x58')](_[_0x2bff('0x5e')](_0x54ba2a['query'],_0x1e710b['filters']));if(_0x54ba2a[_0x2bff('0x57')][_0x2bff('0x5f')]){_0x2c6aad[_0x2bff('0x60')]=_['merge'](_0x2c6aad['where'],{'$or':_[_0x2bff('0x39')](_0x2c6aad['attributes'],function(_0x2b91c0){var _0x2280af={};_0x2280af[_0x2b91c0]={'$like':'%'+_0x54ba2a[_0x2bff('0x57')][_0x2bff('0x5f')]+'%'};return _0x2280af;})});}_0x2c6aad=_[_0x2bff('0x61')]({},_0x2c6aad,_0x54ba2a[_0x2bff('0x63')]);return _0x494710[_0x2bff('0x12a')](_0x2c6aad);}})['then'](function(_0x312cbb){if(_0x312cbb){_0x3200e2=_0x312cbb[_0x2bff('0x5c')];if(!_0x54ba2a[_0x2bff('0x57')][_0x2bff('0x7b')](_0x2bff('0x7c'))){_0x2c6aad[_0x2bff('0x24')]=qs[_0x2bff('0x24')](_0x54ba2a['query']['limit']);_0x2c6aad[_0x2bff('0x22')]=qs['offset'](_0x54ba2a[_0x2bff('0x57')]['offset']);}return _0x494710[_0x2bff('0x12a')](_0x2c6aad);}})[_0x2bff('0x15')](function(_0x20460d){if(_0x20460d){return _0x20460d?{'count':_0x3200e2,'rows':_0x20460d}:null;}})[_0x2bff('0x15')](respondWithResult(_0x252b49,null))[_0x2bff('0x1f')](handleError(_0x252b49,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index e64e501..97d8b88 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 _0x62da=['hasOwnProperty','hook','exports','events','ChatWebsite','setMaxListeners','save','update','emit'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x62da,0xc0));var _0xa62d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x62da[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0xa62d('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0xa62d('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xa62d('0x2')](0x0);var events={'afterCreate':_0xa62d('0x3'),'afterUpdate':_0xa62d('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3ef284){return function(_0x3911f7,_0x11821d,_0x41182c){ChatWebsiteEvents[_0xa62d('0x5')](_0x3ef284+':'+_0x3911f7['id'],_0x3911f7);ChatWebsiteEvents[_0xa62d('0x5')](_0x3ef284,_0x3911f7);_0x41182c(null);};}for(var e in events){if(events[_0xa62d('0x6')](e)){var event=events[e];ChatWebsite[_0xa62d('0x7')](e,emitEvent(event));}}module[_0xa62d('0x8')]=ChatWebsiteEvents; \ No newline at end of file +var _0x9c5a=['hook','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x4d62ef,_0x48684c){var _0x5bcdd0=function(_0x4e2cbd){while(--_0x4e2cbd){_0x4d62ef['push'](_0x4d62ef['shift']());}};_0x5bcdd0(++_0x48684c);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0xa7181e,_0x40196d){_0xa7181e=_0xa7181e-0x0;var _0xfe038=_0x9c5a[_0xa7181e];return _0xfe038;};'use strict';var EventEmitter=require(_0xa9c5('0x0'));var ChatWebsite=require(_0xa9c5('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xa9c5('0x2')](0x0);var events={'afterCreate':_0xa9c5('0x3'),'afterUpdate':_0xa9c5('0x4'),'afterDestroy':_0xa9c5('0x5')};function emitEvent(_0x4f5552){return function(_0x2acfaf,_0x3051b1,_0x4e9403){ChatWebsiteEvents[_0xa9c5('0x6')](_0x4f5552+':'+_0x2acfaf['id'],_0x2acfaf);ChatWebsiteEvents['emit'](_0x4f5552,_0x2acfaf);_0x4e9403(null);};}for(var e in events){if(events[_0xa9c5('0x7')](e)){var event=events[e];ChatWebsite[_0xa9c5('0x8')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 7459bb1..232eb58 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 _0xaf78=['chat_websites','lodash','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports'];(function(_0x2b7f28,_0x537177){var _0x214ed9=function(_0x504d22){while(--_0x504d22){_0x2b7f28['push'](_0x2b7f28['shift']());}};_0x214ed9(++_0x537177);}(_0xaf78,0x155));var _0x8af7=function(_0xd98838,_0x26da2c){_0xd98838=_0xd98838-0x0;var _0x448911=_0xaf78[_0xd98838];return _0x448911;};'use strict';var _=require(_0x8af7('0x0'));var util=require('util');var logger=require(_0x8af7('0x1'))(_0x8af7('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8af7('0x3'));var fs=require('fs');var path=require(_0x8af7('0x4'));var rimraf=require(_0x8af7('0x5'));var config=require(_0x8af7('0x6'));var attributes=require(_0x8af7('0x7'));module[_0x8af7('0x8')]=function(_0x84070a,_0x4004d4){return _0x84070a['define']('ChatWebsite',attributes,{'tableName':_0x8af7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x954c=['bluebird','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','define','lodash','util','api','moment'];(function(_0x247d68,_0x2bc004){var _0x56f5ce=function(_0x625206){while(--_0x625206){_0x247d68['push'](_0x247d68['shift']());}};_0x56f5ce(++_0x2bc004);}(_0x954c,0xc8));var _0xc954=function(_0x4f3e66,_0x5770b4){_0x4f3e66=_0x4f3e66-0x0;var _0x46aa77=_0x954c[_0x4f3e66];return _0x46aa77;};'use strict';var _=require(_0xc954('0x0'));var util=require(_0xc954('0x1'));var logger=require('../../config/logger')(_0xc954('0x2'));var moment=require(_0xc954('0x3'));var BPromise=require(_0xc954('0x4'));var rp=require(_0xc954('0x5'));var fs=require('fs');var path=require(_0xc954('0x6'));var rimraf=require(_0xc954('0x7'));var config=require(_0xc954('0x8'));var attributes=require(_0xc954('0x9'));module[_0xc954('0xa')]=function(_0x25da4f,_0xc7f72c){return _0x25da4f[_0xc954('0xb')]('ChatWebsite',attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index ae52ee8..ec6d72c 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 _0x18ac=['bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','http','redis','defaults','./chatWebsite.socket','register','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x18ac,0x14f));var _0xc18a=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x18ac[_0x5b644e];return _0x49c6bf;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc18a('0x0'));var BPromise=require(_0xc18a('0x1'));var rs=require(_0xc18a('0x2'));var fs=require('fs');var Redis=require(_0xc18a('0x3'));var db=require(_0xc18a('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xc18a('0x5'));var jayson=require(_0xc18a('0x6'));var client=jayson['client'][_0xc18a('0x7')]({'port':0x232a});config[_0xc18a('0x8')]=_[_0xc18a('0x9')](config[_0xc18a('0x8')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc18a('0x8')]));require(_0xc18a('0xa'))[_0xc18a('0xb')](socket);function respondWithRpcPromise(_0x2fd9ec,_0x978666,_0x45af23){return new BPromise(function(_0x237106,_0x492063){return client['request'](_0x2fd9ec,_0x45af23)['then'](function(_0x4ed86f){logger[_0xc18a('0xc')](_0xc18a('0xd'),_0x978666,'request\x20sent');logger[_0xc18a('0xe')](_0xc18a('0xf'),_0x978666,_0xc18a('0x10'),JSON['stringify'](_0x4ed86f));if(_0x4ed86f['error']){if(_0x4ed86f[_0xc18a('0x11')][_0xc18a('0x12')]===0x1f4){logger[_0xc18a('0x11')]('ChatWebsite,\x20%s,\x20%s',_0x978666,_0x4ed86f['error'][_0xc18a('0x13')]);return _0x492063(_0x4ed86f[_0xc18a('0x11')][_0xc18a('0x13')]);}logger[_0xc18a('0x11')](_0xc18a('0xd'),_0x978666,_0x4ed86f[_0xc18a('0x11')]['message']);return _0x237106(_0x4ed86f[_0xc18a('0x11')][_0xc18a('0x13')]);}else{logger[_0xc18a('0xc')]('ChatWebsite,\x20%s,\x20%s',_0x978666,_0xc18a('0x10'));_0x237106(_0x4ed86f[_0xc18a('0x14')]['message']);}})['catch'](function(_0x4a430c){logger['error'](_0xc18a('0xd'),_0x978666,_0x4a430c);_0x492063(_0x4a430c);});});} \ No newline at end of file +var _0xada8=['../../mysqldb','rpc','../../config/environment','jayson/promise','client','redis','socket.io-emitter','./chatWebsite.socket','request','then','info','request\x20sent','stringify','error','code','message','ChatWebsite,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x467e51,_0x1aeca6){var _0x4b12b8=function(_0x8ae57a){while(--_0x8ae57a){_0x467e51['push'](_0x467e51['shift']());}};_0x4b12b8(++_0x1aeca6);}(_0xada8,0x14b));var _0x8ada=function(_0x41e316,_0x38ebcb){_0x41e316=_0x41e316-0x0;var _0x494aef=_0xada8[_0x41e316];return _0x494aef;};'use strict';var _=require(_0x8ada('0x0'));var util=require(_0x8ada('0x1'));var moment=require('moment');var BPromise=require(_0x8ada('0x2'));var rs=require(_0x8ada('0x3'));var fs=require('fs');var Redis=require(_0x8ada('0x4'));var db=require(_0x8ada('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8ada('0x6'));var config=require(_0x8ada('0x7'));var jayson=require(_0x8ada('0x8'));var client=jayson[_0x8ada('0x9')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x8ada('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x8ada('0xb'))(new Redis(config[_0x8ada('0xa')]));require(_0x8ada('0xc'))['register'](socket);function respondWithRpcPromise(_0x10a066,_0x1e18ab,_0x4f4002){return new BPromise(function(_0x57da7a,_0xbc1059){return client[_0x8ada('0xd')](_0x10a066,_0x4f4002)[_0x8ada('0xe')](function(_0x13a7a0){logger[_0x8ada('0xf')]('ChatWebsite,\x20%s,\x20%s',_0x1e18ab,_0x8ada('0x10'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x1e18ab,'request\x20sent',JSON[_0x8ada('0x11')](_0x13a7a0));if(_0x13a7a0[_0x8ada('0x12')]){if(_0x13a7a0[_0x8ada('0x12')][_0x8ada('0x13')]===0x1f4){logger[_0x8ada('0x12')]('ChatWebsite,\x20%s,\x20%s',_0x1e18ab,_0x13a7a0[_0x8ada('0x12')]['message']);return _0xbc1059(_0x13a7a0[_0x8ada('0x12')][_0x8ada('0x14')]);}logger['error'](_0x8ada('0x15'),_0x1e18ab,_0x13a7a0[_0x8ada('0x12')]['message']);return _0x57da7a(_0x13a7a0['error'][_0x8ada('0x14')]);}else{logger['info'](_0x8ada('0x15'),_0x1e18ab,'request\x20sent');_0x57da7a(_0x13a7a0[_0x8ada('0x16')][_0x8ada('0x14')]);}})[_0x8ada('0x17')](function(_0x31189f){logger[_0x8ada('0x12')]('ChatWebsite,\x20%s,\x20%s',_0x1e18ab,_0x31189f);_0xbc1059(_0x31189f);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index a28fcb2..a887774 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 _0xe639=['update','removeListener','register','length','chatWebsite:','./chatWebsite.events','remove'];(function(_0x468d0b,_0x594101){var _0x36f743=function(_0x57de8d){while(--_0x57de8d){_0x468d0b['push'](_0x468d0b['shift']());}};_0x36f743(++_0x594101);}(_0xe639,0xc2));var _0x9e63=function(_0x15180e,_0x24dacd){_0x15180e=_0x15180e-0x0;var _0x52324b=_0xe639[_0x15180e];return _0x52324b;};'use strict';var ChatWebsiteEvents=require(_0x9e63('0x0'));var events=['save',_0x9e63('0x1'),_0x9e63('0x2')];function createListener(_0xd23159,_0x5e68db){return function(_0x29a333){_0x5e68db['emit'](_0xd23159,_0x29a333);};}function removeListener(_0x44639a,_0x2fd520){return function(){ChatWebsiteEvents[_0x9e63('0x3')](_0x44639a,_0x2fd520);};}exports[_0x9e63('0x4')]=function(_0x8b84c7){for(var _0x5d3e53=0x0,_0x18b12b=events[_0x9e63('0x5')];_0x5d3e53<_0x18b12b;_0x5d3e53++){var _0x5496b2=events[_0x5d3e53];var _0x4423eb=createListener(_0x9e63('0x6')+_0x5496b2,_0x8b84c7);ChatWebsiteEvents['on'](_0x5496b2,_0x4423eb);}}; \ No newline at end of file +var _0xbd80=['save','remove','removeListener','length','./chatWebsite.events'];(function(_0xf1ea4a,_0x371699){var _0x3a2c01=function(_0x503b2d){while(--_0x503b2d){_0xf1ea4a['push'](_0xf1ea4a['shift']());}};_0x3a2c01(++_0x371699);}(_0xbd80,0xf4));var _0x0bd8=function(_0x5eaea6,_0x5dd93b){_0x5eaea6=_0x5eaea6-0x0;var _0x4a0695=_0xbd80[_0x5eaea6];return _0x4a0695;};'use strict';var ChatWebsiteEvents=require(_0x0bd8('0x0'));var events=[_0x0bd8('0x1'),_0x0bd8('0x2'),'update'];function createListener(_0x6b4c2a,_0x1b5fca){return function(_0x21dc22){_0x1b5fca['emit'](_0x6b4c2a,_0x21dc22);};}function removeListener(_0x194913,_0x301d71){return function(){ChatWebsiteEvents[_0x0bd8('0x3')](_0x194913,_0x301d71);};}exports['register']=function(_0x5ba391){for(var _0x43a70c=0x0,_0xa3b6c9=events[_0x0bd8('0x4')];_0x43a70c<_0xa3b6c9;_0x43a70c++){var _0x3c596b=events[_0x43a70c];var _0x758642=createListener('chatWebsite:'+_0x3c596b,_0x5ba391);ChatWebsiteEvents['on'](_0x3c596b,_0x758642);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 67356db..bff0988 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 _0xb55d=['offline','addApplications','addProactiveActions','addAgents','delete','destroy','removeAnswers','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getCustomerAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','getProactiveActions','getFields','getOfflineMessages','/:id/users','create','post','addDisposition','addAnswer','diskStorage','root','now','originalname','file','join','server/files/images/avatars/','%s-%s','single','addAvatar','/:id/customer_avatar','addCustomerAvatar','format','/:id/system_avatar','server/files','attachments','offline-chat','replace','/:id/offline','any'];(function(_0x134589,_0x3908da){var _0x508e05=function(_0x3b1f58){while(--_0x3b1f58){_0x134589['push'](_0x134589['shift']());}};_0x508e05(++_0x3908da);}(_0xb55d,0x10c));var _0xdb55=function(_0x56d626,_0x5ba0a3){_0x56d626=_0x56d626-0x0;var _0x2aab38=_0xb55d[_0x56d626];return _0x2aab38;};'use strict';var multer=require(_0xdb55('0x0'));var util=require(_0xdb55('0x1'));var path=require(_0xdb55('0x2'));var timeout=require('connect-timeout');var express=require(_0xdb55('0x3'));var router=express[_0xdb55('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xdb55('0x5'));var interaction=require(_0xdb55('0x6'));var config=require(_0xdb55('0x7'));var controller=require(_0xdb55('0x8'));router[_0xdb55('0x9')]('/',auth[_0xdb55('0xa')](),controller['index']);router[_0xdb55('0x9')](_0xdb55('0xb'),auth[_0xdb55('0xa')](),controller[_0xdb55('0xc')]);router[_0xdb55('0x9')](_0xdb55('0xd'),auth[_0xdb55('0xa')](),controller[_0xdb55('0xe')]);router['get'](_0xdb55('0xf'),auth[_0xdb55('0xa')](),controller[_0xdb55('0x10')]);router[_0xdb55('0x9')](_0xdb55('0x11'),auth[_0xdb55('0xa')](),controller[_0xdb55('0x12')]);router[_0xdb55('0x9')](_0xdb55('0x13'),controller[_0xdb55('0x14')]);router[_0xdb55('0x9')](_0xdb55('0x15'),controller['getAvatar']);router[_0xdb55('0x9')]('/:id/customer_avatar',controller[_0xdb55('0x16')]);router['get']('/:id/system_avatar',controller['getSystemAvatar']);router[_0xdb55('0x9')](_0xdb55('0x17'),auth[_0xdb55('0xa')](),controller[_0xdb55('0x18')]);router['get'](_0xdb55('0x19'),controller[_0xdb55('0x1a')]);router[_0xdb55('0x9')](_0xdb55('0x1b'),auth['isAuthenticated'](),controller[_0xdb55('0x1c')]);router[_0xdb55('0x9')]('/:id/proactive_actions',auth['isAuthenticated'](),controller[_0xdb55('0x1d')]);router['get']('/:id/fields',controller[_0xdb55('0x1e')]);router[_0xdb55('0x9')]('/:id/offline_messages',auth['isAuthenticated'](),controller[_0xdb55('0x1f')]);router[_0xdb55('0x9')](_0xdb55('0x20'),auth[_0xdb55('0xa')](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller[_0xdb55('0x21')]);router[_0xdb55('0x22')](_0xdb55('0xf'),auth[_0xdb55('0xa')](),controller[_0xdb55('0x23')]);router[_0xdb55('0x22')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xdb55('0x24')]);var upload=multer({'storage':multer[_0xdb55('0x25')]({'destination':function(_0x584bb7,_0x1919a7,_0x3dd261){_0x3dd261(null,path['join'](config[_0xdb55('0x26')],'server/files/images/logos/'));},'filename':function(_0x40c4a4,_0x192ef2,_0x56e8c8){_0x56e8c8(null,util['format']('%s-%s',Date[_0xdb55('0x27')](),_0x192ef2[_0xdb55('0x28')]));}})});router[_0xdb55('0x22')](_0xdb55('0x13'),upload['single'](_0xdb55('0x29')),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3f8c2a,_0x41c67f,_0xf9aa19){_0xf9aa19(null,path[_0xdb55('0x2a')](config[_0xdb55('0x26')],_0xdb55('0x2b')));},'filename':function(_0x17f379,_0xa1b587,_0x9046c5){_0x9046c5(null,util['format'](_0xdb55('0x2c'),Date[_0xdb55('0x27')](),_0xa1b587['originalname']));}})});router[_0xdb55('0x22')](_0xdb55('0x15'),upload[_0xdb55('0x2d')](_0xdb55('0x29')),controller[_0xdb55('0x2e')]);var upload=multer({'storage':multer[_0xdb55('0x25')]({'destination':function(_0x316f73,_0x1c79b7,_0x57780a){_0x57780a(null,path[_0xdb55('0x2a')](config['root'],_0xdb55('0x2b')));},'filename':function(_0x4895cb,_0x27f85e,_0x6468fc){_0x6468fc(null,util['format'](_0xdb55('0x2c'),Date[_0xdb55('0x27')](),_0x27f85e[_0xdb55('0x28')]));}})});router['post'](_0xdb55('0x2f'),upload[_0xdb55('0x2d')]('file'),controller[_0xdb55('0x30')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x34f324,_0x51fc5d,_0x5d67f3){_0x5d67f3(null,path[_0xdb55('0x2a')](config[_0xdb55('0x26')],_0xdb55('0x2b')));},'filename':function(_0x1bd063,_0x1ef1ce,_0x3363c2){_0x3363c2(null,util[_0xdb55('0x31')](_0xdb55('0x2c'),Date['now'](),_0x1ef1ce[_0xdb55('0x28')]));}})});router[_0xdb55('0x22')](_0xdb55('0x32'),upload[_0xdb55('0x2d')](_0xdb55('0x29')),controller['addSystemAvatar']);router[_0xdb55('0x22')]('/:id/notify',controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0xdb55('0x25')]({'destination':function(_0xb36c42,_0x1a463c,_0x148c51){const _0x156be1=path[_0xdb55('0x2a')](config['root'],_0xdb55('0x33'),_0xdb55('0x34'),_0xdb55('0x35'));fs_extra['ensureDir'](_0x156be1,function(){_0x148c51(null,_0x156be1);});},'filename':function(_0x16a13f,_0x2ef0fd,_0x36c114){const _0x1ed3d4=_0x2ef0fd[_0xdb55('0x28')][_0xdb55('0x36')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0xed4989=path['extname'](_0x1ed3d4);const _0x5dc480=Date[_0xdb55('0x27')]()+'-'+_0x1ed3d4[_0xdb55('0x36')](_0xed4989,'')+_0xed4989;_0x36c114(null,_0x5dc480);}})});router['post'](_0xdb55('0x37'),offlineUploadMulter[_0xdb55('0x38')](),controller[_0xdb55('0x39')]);router[_0xdb55('0x22')](_0xdb55('0x17'),auth[_0xdb55('0xa')](),controller['addInteraction']);router['post']('/:id/applications',auth['isAuthenticated'](),controller[_0xdb55('0x3a')]);router[_0xdb55('0x22')]('/:id/proactive_actions',auth[_0xdb55('0xa')](),controller[_0xdb55('0x3b')]);router[_0xdb55('0x22')](_0xdb55('0x20'),auth[_0xdb55('0xa')](),controller[_0xdb55('0x3c')]);router['put'](_0xdb55('0xd'),auth[_0xdb55('0xa')](),controller['update']);router[_0xdb55('0x3d')]('/:id',auth[_0xdb55('0xa')](),controller[_0xdb55('0x3e')]);router[_0xdb55('0x3d')]('/:id/dispositions',auth[_0xdb55('0xa')](),controller['removeDispositions']);router[_0xdb55('0x3d')](_0xdb55('0x11'),auth[_0xdb55('0xa')](),controller[_0xdb55('0x3f')]);router[_0xdb55('0x3d')](_0xdb55('0x20'),auth[_0xdb55('0xa')](),controller['removeAgents']);module[_0xdb55('0x40')]=router; \ No newline at end of file +var _0xf4be=['addApplications','addProactiveActions','/:id/users','put','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','isAuthenticated','index','get','/describe','describe','/:id','/:id/dispositions','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','getSnippet','getApplications','/:id/proactive_actions','getProactiveActions','getOfflineMessages','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','diskStorage','root','format','%s-%s','originalname','single','addLogo','join','server/files/images/avatars/','now','addAvatar','file','addCustomerAvatar','addSystemAvatar','notify','server/files','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','addInteraction','/:id/applications'];(function(_0x1e059f,_0x4d49f9){var _0x352098=function(_0x5325cd){while(--_0x5325cd){_0x1e059f['push'](_0x1e059f['shift']());}};_0x352098(++_0x4d49f9);}(_0xf4be,0xa1));var _0xef4b=function(_0x1932cc,_0x253440){_0x1932cc=_0x1932cc-0x0;var _0x46ee54=_0xf4be[_0x1932cc];return _0x46ee54;};'use strict';var multer=require(_0xef4b('0x0'));var util=require(_0xef4b('0x1'));var path=require(_0xef4b('0x2'));var timeout=require(_0xef4b('0x3'));var express=require(_0xef4b('0x4'));var router=express[_0xef4b('0x5')]();var fs_extra=require(_0xef4b('0x6'));var auth=require(_0xef4b('0x7'));var interaction=require(_0xef4b('0x8'));var config=require(_0xef4b('0x9'));var controller=require(_0xef4b('0xa'));router['get']('/',auth[_0xef4b('0xb')](),controller[_0xef4b('0xc')]);router[_0xef4b('0xd')](_0xef4b('0xe'),auth[_0xef4b('0xb')](),controller[_0xef4b('0xf')]);router[_0xef4b('0xd')](_0xef4b('0x10'),auth[_0xef4b('0xb')](),controller['show']);router[_0xef4b('0xd')](_0xef4b('0x11'),auth['isAuthenticated'](),controller['getDispositions']);router[_0xef4b('0xd')]('/:id/canned_answers',auth[_0xef4b('0xb')](),controller[_0xef4b('0x12')]);router[_0xef4b('0xd')](_0xef4b('0x13'),controller[_0xef4b('0x14')]);router['get'](_0xef4b('0x15'),controller[_0xef4b('0x16')]);router[_0xef4b('0xd')](_0xef4b('0x17'),controller[_0xef4b('0x18')]);router[_0xef4b('0xd')](_0xef4b('0x19'),controller[_0xef4b('0x1a')]);router[_0xef4b('0xd')](_0xef4b('0x1b'),auth[_0xef4b('0xb')](),controller[_0xef4b('0x1c')]);router[_0xef4b('0xd')]('/:id/snippet',controller[_0xef4b('0x1d')]);router[_0xef4b('0xd')]('/:id/applications',auth[_0xef4b('0xb')](),controller[_0xef4b('0x1e')]);router[_0xef4b('0xd')](_0xef4b('0x1f'),auth['isAuthenticated'](),controller[_0xef4b('0x20')]);router['get']('/:id/fields',controller['getFields']);router[_0xef4b('0xd')]('/:id/offline_messages',auth[_0xef4b('0xb')](),controller[_0xef4b('0x21')]);router[_0xef4b('0xd')]('/:id/users',auth[_0xef4b('0xb')](),controller[_0xef4b('0x22')]);router[_0xef4b('0x23')]('/',auth[_0xef4b('0xb')](),controller['create']);router[_0xef4b('0x23')](_0xef4b('0x11'),auth['isAuthenticated'](),controller[_0xef4b('0x24')]);router[_0xef4b('0x23')](_0xef4b('0x25'),auth[_0xef4b('0xb')](),controller[_0xef4b('0x26')]);var upload=multer({'storage':multer[_0xef4b('0x27')]({'destination':function(_0x358529,_0x114894,_0x4b4876){_0x4b4876(null,path['join'](config[_0xef4b('0x28')],'server/files/images/logos/'));},'filename':function(_0x12dde9,_0x2d7a3,_0x24baad){_0x24baad(null,util[_0xef4b('0x29')](_0xef4b('0x2a'),Date['now'](),_0x2d7a3[_0xef4b('0x2b')]));}})});router[_0xef4b('0x23')](_0xef4b('0x13'),upload[_0xef4b('0x2c')]('file'),controller[_0xef4b('0x2d')]);var upload=multer({'storage':multer[_0xef4b('0x27')]({'destination':function(_0x33df43,_0x4a515a,_0x4036ea){_0x4036ea(null,path[_0xef4b('0x2e')](config[_0xef4b('0x28')],_0xef4b('0x2f')));},'filename':function(_0x154740,_0x323c12,_0x458bfa){_0x458bfa(null,util[_0xef4b('0x29')](_0xef4b('0x2a'),Date[_0xef4b('0x30')](),_0x323c12[_0xef4b('0x2b')]));}})});router[_0xef4b('0x23')](_0xef4b('0x15'),upload['single']('file'),controller[_0xef4b('0x31')]);var upload=multer({'storage':multer[_0xef4b('0x27')]({'destination':function(_0x45ec73,_0x55b603,_0x23c4f3){_0x23c4f3(null,path['join'](config['root'],_0xef4b('0x2f')));},'filename':function(_0x167b70,_0x5b6528,_0x5bdf14){_0x5bdf14(null,util[_0xef4b('0x29')]('%s-%s',Date[_0xef4b('0x30')](),_0x5b6528[_0xef4b('0x2b')]));}})});router['post'](_0xef4b('0x17'),upload[_0xef4b('0x2c')](_0xef4b('0x32')),controller[_0xef4b('0x33')]);var upload=multer({'storage':multer[_0xef4b('0x27')]({'destination':function(_0x413ca3,_0x2781f7,_0x277a01){_0x277a01(null,path[_0xef4b('0x2e')](config[_0xef4b('0x28')],_0xef4b('0x2f')));},'filename':function(_0x148957,_0x275b12,_0x1e1150){_0x1e1150(null,util[_0xef4b('0x29')]('%s-%s',Date[_0xef4b('0x30')](),_0x275b12[_0xef4b('0x2b')]));}})});router[_0xef4b('0x23')](_0xef4b('0x19'),upload[_0xef4b('0x2c')]('file'),controller[_0xef4b('0x34')]);router[_0xef4b('0x23')]('/:id/notify',controller[_0xef4b('0x35')]);const offlineUploadMulter=multer({'storage':multer[_0xef4b('0x27')]({'destination':function(_0x4696f5,_0x198ba8,_0xa68faa){const _0x9b6eb2=path[_0xef4b('0x2e')](config['root'],_0xef4b('0x36'),'attachments',_0xef4b('0x37'));fs_extra[_0xef4b('0x38')](_0x9b6eb2,function(){_0xa68faa(null,_0x9b6eb2);});},'filename':function(_0x42708c,_0x2414a9,_0x251db7){const _0x2ff50d=_0x2414a9[_0xef4b('0x2b')][_0xef4b('0x39')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x7052a9=path[_0xef4b('0x3a')](_0x2ff50d);const _0x77493c=Date[_0xef4b('0x30')]()+'-'+_0x2ff50d[_0xef4b('0x39')](_0x7052a9,'')+_0x7052a9;_0x251db7(null,_0x77493c);}})});router['post'](_0xef4b('0x3b'),offlineUploadMulter[_0xef4b('0x3c')](),controller[_0xef4b('0x3d')]);router[_0xef4b('0x23')](_0xef4b('0x1b'),auth[_0xef4b('0xb')](),controller[_0xef4b('0x3e')]);router[_0xef4b('0x23')](_0xef4b('0x3f'),auth[_0xef4b('0xb')](),controller[_0xef4b('0x40')]);router[_0xef4b('0x23')](_0xef4b('0x1f'),auth[_0xef4b('0xb')](),controller[_0xef4b('0x41')]);router[_0xef4b('0x23')](_0xef4b('0x42'),auth[_0xef4b('0xb')](),controller['addAgents']);router[_0xef4b('0x43')](_0xef4b('0x10'),auth[_0xef4b('0xb')](),controller[_0xef4b('0x44')]);router['delete'](_0xef4b('0x10'),auth[_0xef4b('0xb')](),controller[_0xef4b('0x45')]);router[_0xef4b('0x46')](_0xef4b('0x11'),auth[_0xef4b('0xb')](),controller[_0xef4b('0x47')]);router[_0xef4b('0x46')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xef4b('0x48')]);router[_0xef4b('0x46')](_0xef4b('0x42'),auth[_0xef4b('0xb')](),controller[_0xef4b('0x49')]);module[_0xef4b('0x4a')]=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index 8cfc14a..fb79de7 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 _0x871c=['../config/environment','Router','env','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','/client-logs','use','isAuthenticated','exports','beaver-logger/server','express'];(function(_0x36dac2,_0x209df){var _0x1f31b5=function(_0x1b47a6){while(--_0x1b47a6){_0x36dac2['push'](_0x36dac2['shift']());}};_0x1f31b5(++_0x209df);}(_0x871c,0x10f));var _0xc871=function(_0x3db9ed,_0x5ddcc2){_0x3db9ed=_0x3db9ed-0x0;var _0x24f169=_0x871c[_0x3db9ed];return _0x24f169;};var beaverLogger=require(_0xc871('0x0'));var express=require(_0xc871('0x1'));var auth=require('../components/auth/service');var config=require(_0xc871('0x2'));var router=express[_0xc871('0x3')]();var isProduction=config[_0xc871('0x4')]==='production'||![];function clientSideLogs(_0xff187c,_0x1d218f,_0x5370f5){var _0xbf7307=_0xff187c[_0xc871('0x5')][_0xc871('0x6')](_0xc871('0x7'));if(!_0xbf7307){throw new Error(_0xc871('0x8'));}return beaverLogger['expressEndpoint']({'uri':_0xc871('0x9'),'logger':_0xbf7307,'enableCors':!isProduction})(_0xff187c,_0x1d218f,_0x5370f5);}router[_0xc871('0xa')](auth[_0xc871('0xb')](),clientSideLogs);module[_0xc871('0xc')]=router; \ No newline at end of file +var _0x650c=['../config/environment','env','production','app','client-side-logger','expressEndpoint','/client-logs','use','isAuthenticated','exports','beaver-logger/server'];(function(_0x433f08,_0x3d915b){var _0x253741=function(_0x406547){while(--_0x406547){_0x433f08['push'](_0x433f08['shift']());}};_0x253741(++_0x3d915b);}(_0x650c,0xf1));var _0xc650=function(_0x4e7dd7,_0x3e7134){_0x4e7dd7=_0x4e7dd7-0x0;var _0x4f4461=_0x650c[_0x4e7dd7];return _0x4f4461;};var beaverLogger=require(_0xc650('0x0'));var express=require('express');var auth=require('../components/auth/service');var config=require(_0xc650('0x1'));var router=express['Router']();var isProduction=config[_0xc650('0x2')]===_0xc650('0x3')||![];function clientSideLogs(_0x2b4c31,_0x160fd9,_0x29d8c4){var _0x557f4a=_0x2b4c31[_0xc650('0x4')]['get'](_0xc650('0x5'));if(!_0x557f4a){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger[_0xc650('0x6')]({'uri':_0xc650('0x7'),'logger':_0x557f4a,'enableCors':!isProduction})(_0x2b4c31,_0x160fd9,_0x29d8c4);}router[_0xc650('0x8')](auth[_0xc650('0x9')](),clientSideLogs);module[_0xc650('0xa')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index 32a5cef..fa71eda 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 _0xd7fa=['MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','AmazonAWS','MicrosoftAzure','ENUM','STRING','MicrosoftAzure\x20=>\x20client_id'];(function(_0x54393c,_0x5b34bc){var _0x1db30e=function(_0x54321e){while(--_0x54321e){_0x54393c['push'](_0x54393c['shift']());}};_0x1db30e(++_0x5b34bc);}(_0xd7fa,0x17f));var _0xad7f=function(_0x349b8a,_0x35b021){_0x349b8a=_0x349b8a-0x0;var _0x1d5645=_0xd7fa[_0x349b8a];return _0x1d5645;};'use strict';var Sequelize=require(_0xad7f('0x0'));module[_0xad7f('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0xad7f('0x2'),'Google',_0xad7f('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xad7f('0x4')]('Outlook365','Dynamics365')},'data1':{'type':Sequelize[_0xad7f('0x5')],'comment':_0xad7f('0x6')},'data2':{'type':Sequelize[_0xad7f('0x5')],'comment':_0xad7f('0x7')},'data3':{'type':Sequelize[_0xad7f('0x5')],'comment':_0xad7f('0x8')},'data4':{'type':Sequelize[_0xad7f('0x5')],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize[_0xad7f('0x9')],'comment':_0xad7f('0xa')},'data6':{'type':Sequelize[_0xad7f('0x9')],'comment':_0xad7f('0xb')},'data7':{'type':Sequelize[_0xad7f('0x9')],'comment':_0xad7f('0xc')}}; \ No newline at end of file +var _0x098f=['MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20access_token','TEXT','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS','Google','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id'];(function(_0x1a9302,_0x13ce80){var _0x4d79f0=function(_0x104240){while(--_0x104240){_0x1a9302['push'](_0x1a9302['shift']());}};_0x4d79f0(++_0x13ce80);}(_0x098f,0x1c7));var _0xf098=function(_0x1ad188,_0x48b9ab){_0x1ad188=_0x1ad188-0x0;var _0x5742ac=_0x098f[_0x1ad188];return _0x5742ac;};'use strict';var Sequelize=require(_0xf098('0x0'));module[_0xf098('0x1')]={'name':{'type':Sequelize[_0xf098('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xf098('0x3')](_0xf098('0x4'),_0xf098('0x5'),_0xf098('0x6')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xf098('0x3')](_0xf098('0x7'),_0xf098('0x8'))},'data1':{'type':Sequelize[_0xf098('0x2')],'comment':_0xf098('0x9')},'data2':{'type':Sequelize[_0xf098('0x2')],'comment':_0xf098('0xa')},'data3':{'type':Sequelize[_0xf098('0x2')],'comment':_0xf098('0xb')},'data4':{'type':Sequelize[_0xf098('0x2')],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize['TEXT'],'comment':_0xf098('0xc')},'data6':{'type':Sequelize[_0xf098('0xd')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0xf098('0xd')],'comment':_0xf098('0xe')}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index af32a38..5ee0dda 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 _0x6ccb=['del','getOauth2MicrosoftAccessToken','code','refresh_token','data6','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','update','destroy','then','error','stack','name','send','padEnd','slice','index','map','CloudProvider','rawAttributes','fieldName','type','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','findAll','rows','service','decryptString','data3','catch','show','params','include','MicrosoftAzure','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','join','encryptString','find','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','parse','from','base64','toString','isValidIdToken','id_token','oauth2Claims'];(function(_0x287589,_0xdacf0c){var _0x3b4bfe=function(_0x17b296){while(--_0x17b296){_0x287589['push'](_0x287589['shift']());}};_0x3b4bfe(++_0xdacf0c);}(_0x6ccb,0xce));var _0xb6cc=function(_0x19cebb,_0x5d4762){_0x19cebb=_0x19cebb-0x0;var _0x1a046d=_0x6ccb[_0x19cebb];return _0x1a046d;};'use strict';var _=require(_0xb6cc('0x0'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var encryptor=require(_0xb6cc('0x1'));var config=require(_0xb6cc('0x2'));var logger=require(_0xb6cc('0x3'))(_0xb6cc('0x4'));var db=require(_0xb6cc('0x5'))['db'];var oauth=require(_0xb6cc('0x6'));config[_0xb6cc('0x7')]=_[_0xb6cc('0x8')](config[_0xb6cc('0x7')],{'host':_0xb6cc('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));var redis=new Redis(config[_0xb6cc('0x7')]);function respondWithStatusCode(_0xee85c0,_0x1ef446){_0x1ef446=_0x1ef446||0xcc;return function(_0x5b8e05){if(_0x5b8e05){return _0xee85c0[_0xb6cc('0xa')](_0x1ef446);}return _0xee85c0['status'](_0x1ef446)[_0xb6cc('0xb')]();};}function respondWithResult(_0x5c9ea4,_0x216a75){_0x216a75=_0x216a75||0xc8;return function(_0x4dd09d){if(_0x4dd09d){return _0x5c9ea4[_0xb6cc('0xc')](_0x216a75)[_0xb6cc('0xd')](_0x4dd09d);}};}function respondWithFilteredResult(_0x5a1e1f,_0x2f3c1b){return function(_0x2eabab){if(_0x2eabab){var _0x1929c8=typeof _0x2f3c1b[_0xb6cc('0xe')]==='undefined'&&typeof _0x2f3c1b['limit']===_0xb6cc('0xf');var _0x3f81d5=_0x2eabab[_0xb6cc('0x10')];var _0x42a5f8=_0x1929c8?0x0:_0x2f3c1b[_0xb6cc('0xe')];var _0x248dbe=_0x1929c8?_0x2eabab[_0xb6cc('0x10')]:_0x2f3c1b[_0xb6cc('0xe')]+_0x2f3c1b[_0xb6cc('0x11')];var _0xa5f466;if(_0x248dbe>=_0x3f81d5){_0x248dbe=_0x3f81d5;_0xa5f466=0xc8;}else{_0xa5f466=0xce;}_0x5a1e1f[_0xb6cc('0xc')](_0xa5f466);return _0x5a1e1f['set'](_0xb6cc('0x12'),_0x42a5f8+'-'+_0x248dbe+'/'+_0x3f81d5)[_0xb6cc('0xd')](_0x2eabab);}return null;};}function saveUpdates(_0x4b8d0b){return function(_0x1c8aa1){if(_0x1c8aa1){return _0x1c8aa1[_0xb6cc('0x13')](_0x4b8d0b)['then'](function(_0x5bec55){return _0x5bec55;});}return null;};}function removeEntity(_0x54a801){return function(_0x1044e2){if(_0x1044e2){return _0x1044e2[_0xb6cc('0x14')]()[_0xb6cc('0x15')](function(){_0x54a801['status'](0xcc)[_0xb6cc('0xb')]();});}};}function handleEntityNotFound(_0x2b44c8){return function(_0x696c1d){if(!_0x696c1d){_0x2b44c8[_0xb6cc('0xa')](0x194);}return _0x696c1d;};}function handleError(_0x1862bd,_0x14da3d){_0x14da3d=_0x14da3d||0x1f4;return function(_0x24095e){logger[_0xb6cc('0x16')](_0x24095e[_0xb6cc('0x17')]);if(_0x24095e['name']){delete _0x24095e[_0xb6cc('0x18')];}_0x1862bd[_0xb6cc('0xc')](_0x14da3d)[_0xb6cc('0x19')](_0x24095e);};}function maskClientSecret(_0x1f3992){return _[_0xb6cc('0x1a')](_0x1f3992[_0xb6cc('0x1b')](0x0,0x3),0x14,'*');}exports[_0xb6cc('0x1c')]=function(_0x5d3bf6,_0x583811){var _0x1fd8d6={},_0x47cb02={},_0x10d1d4={'count':0x0,'rows':[]};var _0x5da883=_[_0xb6cc('0x1d')](db[_0xb6cc('0x1e')][_0xb6cc('0x1f')],function(_0xe2eee1){return{'name':_0xe2eee1[_0xb6cc('0x20')],'type':_0xe2eee1[_0xb6cc('0x21')]['key']};});_0x47cb02['model']=_['map'](_0x5da883,_0xb6cc('0x18'));_0x47cb02['query']=_[_0xb6cc('0x22')](_0x5d3bf6[_0xb6cc('0x23')]);_0x47cb02[_0xb6cc('0x24')]=_['intersection'](_0x47cb02[_0xb6cc('0x25')],_0x47cb02[_0xb6cc('0x23')]);_0x1fd8d6[_0xb6cc('0x26')]=_[_0xb6cc('0x27')](_0x47cb02[_0xb6cc('0x25')],qs[_0xb6cc('0x28')](_0x5d3bf6[_0xb6cc('0x23')][_0xb6cc('0x28')]));_0x1fd8d6['attributes']=_0x1fd8d6[_0xb6cc('0x26')][_0xb6cc('0x29')]?_0x1fd8d6['attributes']:_0x47cb02[_0xb6cc('0x25')];if(!_0x5d3bf6[_0xb6cc('0x23')][_0xb6cc('0x2a')](_0xb6cc('0x2b'))){_0x1fd8d6[_0xb6cc('0x11')]=qs[_0xb6cc('0x11')](_0x5d3bf6['query'][_0xb6cc('0x11')]);_0x1fd8d6[_0xb6cc('0xe')]=qs['offset'](_0x5d3bf6[_0xb6cc('0x23')]['offset']);}_0x1fd8d6['order']=qs[_0xb6cc('0x2c')](_0x5d3bf6[_0xb6cc('0x23')]['sort']);_0x1fd8d6[_0xb6cc('0x2d')]=qs['filters'](_[_0xb6cc('0x2e')](_0x5d3bf6[_0xb6cc('0x23')],_0x47cb02[_0xb6cc('0x24')]),_0x5da883);if(_0x5d3bf6['query'][_0xb6cc('0x2f')]){_0x1fd8d6[_0xb6cc('0x2d')]=_[_0xb6cc('0x30')](_0x1fd8d6['where'],{'$or':_[_0xb6cc('0x1d')](_0x5da883,function(_0x59fab0){if(_0x59fab0[_0xb6cc('0x21')]!=='VIRTUAL'){var _0x5aa55d={};_0x5aa55d[_0x59fab0[_0xb6cc('0x18')]]={'$like':'%'+_0x5d3bf6[_0xb6cc('0x23')]['filter']+'%'};return _0x5aa55d;}})});}_0x1fd8d6=_[_0xb6cc('0x30')]({},_0x1fd8d6,_0x5d3bf6[_0xb6cc('0x31')]);var _0x17a407={'where':_0x1fd8d6[_0xb6cc('0x2d')]};return db[_0xb6cc('0x1e')][_0xb6cc('0x10')](_0x17a407)[_0xb6cc('0x15')](function(_0x1b36ef){_0x10d1d4[_0xb6cc('0x10')]=_0x1b36ef;if(_0x5d3bf6[_0xb6cc('0x23')][_0xb6cc('0x32')]){_0x1fd8d6['include']=[{'all':!![]}];}return db[_0xb6cc('0x1e')][_0xb6cc('0x33')](_0x1fd8d6);})['then'](function(_0x4cc675){_0x10d1d4[_0xb6cc('0x34')]=_[_0xb6cc('0x1d')](_0x4cc675,function(_0x47e841){if(_0x47e841[_0xb6cc('0x35')]==='MicrosoftAzure'){var _0x2d65ad=encryptor[_0xb6cc('0x36')](_0x47e841[_0xb6cc('0x37')]);_0x47e841[_0xb6cc('0x37')]=maskClientSecret(_0x2d65ad);}return _0x47e841;});return _0x10d1d4;})['then'](respondWithFilteredResult(_0x583811,_0x1fd8d6))[_0xb6cc('0x38')](handleError(_0x583811,null));};exports[_0xb6cc('0x39')]=function(_0x5061a2,_0x24fc83){var _0x312504={'raw':!![],'where':{'id':_0x5061a2[_0xb6cc('0x3a')]['id']}},_0x3e50bd={};_0x3e50bd[_0xb6cc('0x25')]=_[_0xb6cc('0x22')](db['CloudProvider'][_0xb6cc('0x1f')]);_0x3e50bd[_0xb6cc('0x23')]=_[_0xb6cc('0x22')](_0x5061a2[_0xb6cc('0x23')]);_0x3e50bd[_0xb6cc('0x24')]=_['intersection'](_0x3e50bd[_0xb6cc('0x25')],_0x3e50bd['query']);_0x312504[_0xb6cc('0x26')]=_[_0xb6cc('0x27')](_0x3e50bd['model'],qs[_0xb6cc('0x28')](_0x5061a2[_0xb6cc('0x23')]['fields']));_0x312504['attributes']=_0x312504[_0xb6cc('0x26')][_0xb6cc('0x29')]?_0x312504[_0xb6cc('0x26')]:_0x3e50bd[_0xb6cc('0x25')];if(_0x5061a2[_0xb6cc('0x23')]['includeAll']){_0x312504[_0xb6cc('0x3b')]=[{'all':!![]}];}_0x312504=_[_0xb6cc('0x30')]({},_0x312504,_0x5061a2[_0xb6cc('0x31')]);return db[_0xb6cc('0x1e')]['find'](_0x312504)['then'](handleEntityNotFound(_0x24fc83,null))[_0xb6cc('0x15')](function(_0x3370c4){if(_0x3370c4[_0xb6cc('0x35')]===_0xb6cc('0x3c')){var _0xd347cd=encryptor[_0xb6cc('0x36')](_0x3370c4[_0xb6cc('0x37')]);_0x3370c4[_0xb6cc('0x37')]=maskClientSecret(_0xd347cd);}return _0x3370c4;})[_0xb6cc('0x15')](respondWithResult(_0x24fc83,null))[_0xb6cc('0x38')](handleError(_0x24fc83,null));};exports[_0xb6cc('0x3d')]=function(_0x8958e1,_0x2bebd0){if(!_0x8958e1[_0xb6cc('0x3e')][_0xb6cc('0x18')])throw new Error(_0xb6cc('0x3f'));if(!_0x8958e1[_0xb6cc('0x3e')][_0xb6cc('0x35')])throw new Error(_0xb6cc('0x40'));var _0x5b479f=db[_0xb6cc('0x1e')]['rawAttributes'][_0xb6cc('0x35')][_0xb6cc('0x41')];if(!_0x5b479f[_0xb6cc('0x42')](_0x8958e1[_0xb6cc('0x3e')][_0xb6cc('0x35')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x5b479f[_0xb6cc('0x43')](',\x20'));if(_0x8958e1[_0xb6cc('0x3e')][_0xb6cc('0x35')]===_0xb6cc('0x3c')&&_0x8958e1['body'][_0xb6cc('0x37')]){_0x8958e1[_0xb6cc('0x3e')][_0xb6cc('0x37')]=encryptor[_0xb6cc('0x44')](_0x8958e1[_0xb6cc('0x3e')][_0xb6cc('0x37')]);}return db[_0xb6cc('0x1e')][_0xb6cc('0x3d')](_0x8958e1[_0xb6cc('0x3e')],{})[_0xb6cc('0x15')](respondWithResult(_0x2bebd0,0xc9))[_0xb6cc('0x38')](handleError(_0x2bebd0,null));};exports['update']=function(_0x25e97b,_0x51e1fc){if(_0x25e97b[_0xb6cc('0x3e')]['id']){delete _0x25e97b[_0xb6cc('0x3e')]['id'];}return db[_0xb6cc('0x1e')][_0xb6cc('0x45')]({'where':{'id':_0x25e97b['params']['id']}})[_0xb6cc('0x15')](handleEntityNotFound(_0x51e1fc,null))[_0xb6cc('0x15')](function(_0x1aaf1f){if(_0x1aaf1f[_0xb6cc('0x35')]==='MicrosoftAzure'&&_0x25e97b[_0xb6cc('0x3e')][_0xb6cc('0x37')]){_0x25e97b['body'][_0xb6cc('0x37')]=encryptor[_0xb6cc('0x44')](_0x25e97b[_0xb6cc('0x3e')][_0xb6cc('0x37')]);}return _0x1aaf1f;})[_0xb6cc('0x15')](saveUpdates(_0x25e97b[_0xb6cc('0x3e')],null))[_0xb6cc('0x15')](respondWithResult(_0x51e1fc,null))[_0xb6cc('0x38')](handleError(_0x51e1fc,null));};exports[_0xb6cc('0x14')]=function(_0x53e4a2,_0x45f4a2){return db[_0xb6cc('0x1e')][_0xb6cc('0x45')]({'where':{'id':_0x53e4a2[_0xb6cc('0x3a')]['id']}})[_0xb6cc('0x15')](handleEntityNotFound(_0x45f4a2,null))['then'](removeEntity(_0x45f4a2,null))['catch'](handleError(_0x45f4a2,null));};exports[_0xb6cc('0x46')]=function(_0xf0ead2,_0x31376a){return db['CloudProvider'][_0xb6cc('0x47')]({'where':{'id':_0xf0ead2[_0xb6cc('0x3a')]['id']},'raw':!![]})['then'](function(_0xa0bb23){if(!_0xa0bb23)return _0x31376a[_0xb6cc('0xa')](0x194);return{'url':oauth[_0xb6cc('0x48')](_0xa0bb23,_0xf0ead2[_0xb6cc('0x49')]['id'])};})['then'](respondWithResult(_0x31376a,null))[_0xb6cc('0x38')](handleError(_0x31376a,null));};exports[_0xb6cc('0x4a')]=function(_0x5aa51f,_0x48fbca){var _0x59c9d1=_0x5aa51f[_0xb6cc('0x3e')];var _0x26a18f;var _0x40e411;if(_0x59c9d1[_0xb6cc('0x16')])throw _0x59c9d1;redis[_0xb6cc('0x4b')](_0x59c9d1[_0xb6cc('0x4c')])[_0xb6cc('0x15')](function(_0x437617){if(!_0x437617)throw new Error(_0xb6cc('0x4d'));_0x26a18f=JSON[_0xb6cc('0x4e')](_0x437617);var _0x4fe93b=Buffer[_0xb6cc('0x4f')](_0x59c9d1[_0xb6cc('0x4c')],_0xb6cc('0x50'))[_0xb6cc('0x51')]('ascii');_0x40e411=JSON[_0xb6cc('0x4e')](_0x4fe93b);if(!oauth[_0xb6cc('0x52')](_0x59c9d1[_0xb6cc('0x53')],_0x26a18f[_0xb6cc('0x54')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0xb6cc('0x55')](_0x59c9d1[_0xb6cc('0x4c')]);return oauth[_0xb6cc('0x56')](_0x59c9d1[_0xb6cc('0x57')],_0x26a18f);})['then'](function(_0x305308){_0x26a18f['data5']=_0x305308['access_token'];_0x26a18f['data6']=_0x305308[_0xb6cc('0x58')];return db[_0xb6cc('0x1e')][_0xb6cc('0x13')]({'data5':_0x26a18f['data5'],'data6':_0x26a18f[_0xb6cc('0x59')]},{'where':{'id':_0x26a18f['id']}});})[_0xb6cc('0x15')](function(){oauth[_0xb6cc('0x5a')](_0x26a18f);socket[_0xb6cc('0x5b')](_0xb6cc('0x5c'),{'id':_0x40e411['id']});return;})[_0xb6cc('0x15')](respondWithStatusCode(_0x48fbca,null))[_0xb6cc('0x38')](function(_0x23f25c){if(_0x40e411){socket[_0xb6cc('0x5b')](_0xb6cc('0x5d'),{'id':_0x40e411['id']});}if(!_0x26a18f){logger[_0xb6cc('0x16')]('Invalid\x20authentication\x20state\x20parameter',_0x23f25c);return _0x48fbca[_0xb6cc('0xc')](0x1f4)['send'](_0x23f25c[_0xb6cc('0x5e')]);}logger[_0xb6cc('0x16')](_0xb6cc('0x5f'),_0x26a18f['id'],JSON[_0xb6cc('0x60')](_0x23f25c));});}; \ No newline at end of file +var _0xf8b4=['data5','startRefreshInterval','microsoftAuthorization:success','emit','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','stringify','lodash','../../components/parsers/qs','../../components/encryptor','../../config/logger','api','../../mysqldb','redis','localhost','socket.io-emitter','sendStatus','status','json','undefined','limit','count','offset','set','destroy','then','end','error','stack','name','send','padEnd','slice','index','map','CloudProvider','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','nolimit','sort','where','pick','filters','merge','VIRTUAL','options','includeAll','include','findAll','decryptString','data3','show','params','length','find','service','MicrosoftAzure','catch','create','body','Service\x20parameter\x20not\x20specified','join','update','encryptString','oauth2MicrosoftAuthorize','findOne','user','oauth2MicrosoftCallback','get','Invalid\x20state\x20parameter','parse','state','ascii','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','access_token','data6','refresh_token'];(function(_0x80d733,_0x266211){var _0x435868=function(_0x2ae0f0){while(--_0x2ae0f0){_0x80d733['push'](_0x80d733['shift']());}};_0x435868(++_0x266211);}(_0xf8b4,0x1d4));var _0x4f8b=function(_0x398e6f,_0x12af3b){_0x398e6f=_0x398e6f-0x0;var _0xb0b189=_0xf8b4[_0x398e6f];return _0xb0b189;};'use strict';var _=require(_0x4f8b('0x0'));var Redis=require('ioredis');var qs=require(_0x4f8b('0x1'));var encryptor=require(_0x4f8b('0x2'));var config=require('../../config/environment');var logger=require(_0x4f8b('0x3'))(_0x4f8b('0x4'));var db=require(_0x4f8b('0x5'))['db'];var oauth=require('./cloudProvider.oauth');config['redis']=_['defaults'](config[_0x4f8b('0x6')],{'host':_0x4f8b('0x7'),'port':0x18eb});var socket=require(_0x4f8b('0x8'))(new Redis(config['redis']));var redis=new Redis(config[_0x4f8b('0x6')]);function respondWithStatusCode(_0x223c6c,_0x25d13b){_0x25d13b=_0x25d13b||0xcc;return function(_0x97d742){if(_0x97d742){return _0x223c6c[_0x4f8b('0x9')](_0x25d13b);}return _0x223c6c[_0x4f8b('0xa')](_0x25d13b)['end']();};}function respondWithResult(_0x4948a3,_0x12bede){_0x12bede=_0x12bede||0xc8;return function(_0xd6be55){if(_0xd6be55){return _0x4948a3[_0x4f8b('0xa')](_0x12bede)[_0x4f8b('0xb')](_0xd6be55);}};}function respondWithFilteredResult(_0x5e4ba2,_0x337867){return function(_0x3469f8){if(_0x3469f8){var _0x8abeb2=typeof _0x337867['offset']===_0x4f8b('0xc')&&typeof _0x337867[_0x4f8b('0xd')]==='undefined';var _0x48be8d=_0x3469f8[_0x4f8b('0xe')];var _0x58435c=_0x8abeb2?0x0:_0x337867[_0x4f8b('0xf')];var _0x139d11=_0x8abeb2?_0x3469f8[_0x4f8b('0xe')]:_0x337867[_0x4f8b('0xf')]+_0x337867[_0x4f8b('0xd')];var _0x45f1ac;if(_0x139d11>=_0x48be8d){_0x139d11=_0x48be8d;_0x45f1ac=0xc8;}else{_0x45f1ac=0xce;}_0x5e4ba2[_0x4f8b('0xa')](_0x45f1ac);return _0x5e4ba2[_0x4f8b('0x10')]('Content-Range',_0x58435c+'-'+_0x139d11+'/'+_0x48be8d)[_0x4f8b('0xb')](_0x3469f8);}return null;};}function saveUpdates(_0x20b360){return function(_0x1046b2){if(_0x1046b2){return _0x1046b2['update'](_0x20b360)['then'](function(_0x4222c4){return _0x4222c4;});}return null;};}function removeEntity(_0x4b75cb){return function(_0x4d3494){if(_0x4d3494){return _0x4d3494[_0x4f8b('0x11')]()[_0x4f8b('0x12')](function(){_0x4b75cb[_0x4f8b('0xa')](0xcc)[_0x4f8b('0x13')]();});}};}function handleEntityNotFound(_0x21d1da){return function(_0x38f218){if(!_0x38f218){_0x21d1da['sendStatus'](0x194);}return _0x38f218;};}function handleError(_0x51c504,_0x141779){_0x141779=_0x141779||0x1f4;return function(_0x356616){logger[_0x4f8b('0x14')](_0x356616[_0x4f8b('0x15')]);if(_0x356616[_0x4f8b('0x16')]){delete _0x356616['name'];}_0x51c504[_0x4f8b('0xa')](_0x141779)[_0x4f8b('0x17')](_0x356616);};}function maskClientSecret(_0x2da326){return _[_0x4f8b('0x18')](_0x2da326[_0x4f8b('0x19')](0x0,0x3),0x14,'*');}exports[_0x4f8b('0x1a')]=function(_0x2ce973,_0x5d395f){var _0x541912={},_0x16615d={},_0x57fdba={'count':0x0,'rows':[]};var _0x3f0254=_[_0x4f8b('0x1b')](db[_0x4f8b('0x1c')][_0x4f8b('0x1d')],function(_0x57f49f){return{'name':_0x57f49f[_0x4f8b('0x1e')],'type':_0x57f49f[_0x4f8b('0x1f')][_0x4f8b('0x20')]};});_0x16615d[_0x4f8b('0x21')]=_[_0x4f8b('0x1b')](_0x3f0254,'name');_0x16615d['query']=_[_0x4f8b('0x22')](_0x2ce973[_0x4f8b('0x23')]);_0x16615d['filters']=_[_0x4f8b('0x24')](_0x16615d[_0x4f8b('0x21')],_0x16615d['query']);_0x541912[_0x4f8b('0x25')]=_['intersection'](_0x16615d['model'],qs[_0x4f8b('0x26')](_0x2ce973[_0x4f8b('0x23')][_0x4f8b('0x26')]));_0x541912[_0x4f8b('0x25')]=_0x541912[_0x4f8b('0x25')]['length']?_0x541912['attributes']:_0x16615d[_0x4f8b('0x21')];if(!_0x2ce973[_0x4f8b('0x23')]['hasOwnProperty'](_0x4f8b('0x27'))){_0x541912[_0x4f8b('0xd')]=qs['limit'](_0x2ce973['query']['limit']);_0x541912['offset']=qs['offset'](_0x2ce973[_0x4f8b('0x23')]['offset']);}_0x541912['order']=qs[_0x4f8b('0x28')](_0x2ce973[_0x4f8b('0x23')]['sort']);_0x541912[_0x4f8b('0x29')]=qs['filters'](_[_0x4f8b('0x2a')](_0x2ce973[_0x4f8b('0x23')],_0x16615d[_0x4f8b('0x2b')]),_0x3f0254);if(_0x2ce973[_0x4f8b('0x23')]['filter']){_0x541912[_0x4f8b('0x29')]=_[_0x4f8b('0x2c')](_0x541912[_0x4f8b('0x29')],{'$or':_[_0x4f8b('0x1b')](_0x3f0254,function(_0x1e17e1){if(_0x1e17e1[_0x4f8b('0x1f')]!==_0x4f8b('0x2d')){var _0x2b1f9f={};_0x2b1f9f[_0x1e17e1['name']]={'$like':'%'+_0x2ce973[_0x4f8b('0x23')]['filter']+'%'};return _0x2b1f9f;}})});}_0x541912=_[_0x4f8b('0x2c')]({},_0x541912,_0x2ce973[_0x4f8b('0x2e')]);var _0x677581={'where':_0x541912[_0x4f8b('0x29')]};return db[_0x4f8b('0x1c')][_0x4f8b('0xe')](_0x677581)[_0x4f8b('0x12')](function(_0x42d2de){_0x57fdba[_0x4f8b('0xe')]=_0x42d2de;if(_0x2ce973[_0x4f8b('0x23')][_0x4f8b('0x2f')]){_0x541912[_0x4f8b('0x30')]=[{'all':!![]}];}return db[_0x4f8b('0x1c')][_0x4f8b('0x31')](_0x541912);})[_0x4f8b('0x12')](function(_0x33bdba){_0x57fdba['rows']=_[_0x4f8b('0x1b')](_0x33bdba,function(_0x15c3b8){if(_0x15c3b8['service']==='MicrosoftAzure'){var _0x3039e2=encryptor[_0x4f8b('0x32')](_0x15c3b8[_0x4f8b('0x33')]);_0x15c3b8['data3']=maskClientSecret(_0x3039e2);}return _0x15c3b8;});return _0x57fdba;})[_0x4f8b('0x12')](respondWithFilteredResult(_0x5d395f,_0x541912))['catch'](handleError(_0x5d395f,null));};exports[_0x4f8b('0x34')]=function(_0x591603,_0x492b94){var _0x1bc1be={'raw':!![],'where':{'id':_0x591603[_0x4f8b('0x35')]['id']}},_0x254abd={};_0x254abd[_0x4f8b('0x21')]=_['keys'](db[_0x4f8b('0x1c')][_0x4f8b('0x1d')]);_0x254abd['query']=_[_0x4f8b('0x22')](_0x591603[_0x4f8b('0x23')]);_0x254abd[_0x4f8b('0x2b')]=_[_0x4f8b('0x24')](_0x254abd['model'],_0x254abd['query']);_0x1bc1be[_0x4f8b('0x25')]=_[_0x4f8b('0x24')](_0x254abd[_0x4f8b('0x21')],qs[_0x4f8b('0x26')](_0x591603[_0x4f8b('0x23')][_0x4f8b('0x26')]));_0x1bc1be[_0x4f8b('0x25')]=_0x1bc1be['attributes'][_0x4f8b('0x36')]?_0x1bc1be['attributes']:_0x254abd['model'];if(_0x591603[_0x4f8b('0x23')][_0x4f8b('0x2f')]){_0x1bc1be[_0x4f8b('0x30')]=[{'all':!![]}];}_0x1bc1be=_['merge']({},_0x1bc1be,_0x591603[_0x4f8b('0x2e')]);return db[_0x4f8b('0x1c')][_0x4f8b('0x37')](_0x1bc1be)[_0x4f8b('0x12')](handleEntityNotFound(_0x492b94,null))['then'](function(_0x936af6){if(_0x936af6[_0x4f8b('0x38')]===_0x4f8b('0x39')){var _0x53b0dc=encryptor[_0x4f8b('0x32')](_0x936af6[_0x4f8b('0x33')]);_0x936af6['data3']=maskClientSecret(_0x53b0dc);}return _0x936af6;})['then'](respondWithResult(_0x492b94,null))[_0x4f8b('0x3a')](handleError(_0x492b94,null));};exports[_0x4f8b('0x3b')]=function(_0x1d8c69,_0x5a653a){if(!_0x1d8c69[_0x4f8b('0x3c')][_0x4f8b('0x16')])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x1d8c69[_0x4f8b('0x3c')][_0x4f8b('0x38')])throw new Error(_0x4f8b('0x3d'));var _0x266198=db[_0x4f8b('0x1c')]['rawAttributes'][_0x4f8b('0x38')]['values'];if(!_0x266198['includes'](_0x1d8c69[_0x4f8b('0x3c')][_0x4f8b('0x38')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x266198[_0x4f8b('0x3e')](',\x20'));if(_0x1d8c69[_0x4f8b('0x3c')]['service']===_0x4f8b('0x39')&&_0x1d8c69[_0x4f8b('0x3c')][_0x4f8b('0x33')]){_0x1d8c69[_0x4f8b('0x3c')][_0x4f8b('0x33')]=encryptor['encryptString'](_0x1d8c69[_0x4f8b('0x3c')][_0x4f8b('0x33')]);}return db[_0x4f8b('0x1c')][_0x4f8b('0x3b')](_0x1d8c69[_0x4f8b('0x3c')],{})[_0x4f8b('0x12')](respondWithResult(_0x5a653a,0xc9))[_0x4f8b('0x3a')](handleError(_0x5a653a,null));};exports[_0x4f8b('0x3f')]=function(_0x8f2254,_0x13de44){if(_0x8f2254['body']['id']){delete _0x8f2254[_0x4f8b('0x3c')]['id'];}return db[_0x4f8b('0x1c')]['find']({'where':{'id':_0x8f2254[_0x4f8b('0x35')]['id']}})['then'](handleEntityNotFound(_0x13de44,null))[_0x4f8b('0x12')](function(_0x387321){if(_0x387321[_0x4f8b('0x38')]===_0x4f8b('0x39')&&_0x8f2254[_0x4f8b('0x3c')][_0x4f8b('0x33')]){_0x8f2254[_0x4f8b('0x3c')][_0x4f8b('0x33')]=encryptor[_0x4f8b('0x40')](_0x8f2254[_0x4f8b('0x3c')][_0x4f8b('0x33')]);}return _0x387321;})['then'](saveUpdates(_0x8f2254[_0x4f8b('0x3c')],null))[_0x4f8b('0x12')](respondWithResult(_0x13de44,null))[_0x4f8b('0x3a')](handleError(_0x13de44,null));};exports['destroy']=function(_0x72d8b1,_0x2cafdc){return db[_0x4f8b('0x1c')]['find']({'where':{'id':_0x72d8b1[_0x4f8b('0x35')]['id']}})[_0x4f8b('0x12')](handleEntityNotFound(_0x2cafdc,null))[_0x4f8b('0x12')](removeEntity(_0x2cafdc,null))['catch'](handleError(_0x2cafdc,null));};exports[_0x4f8b('0x41')]=function(_0x2df79c,_0x4ad4d8){return db['CloudProvider'][_0x4f8b('0x42')]({'where':{'id':_0x2df79c['params']['id']},'raw':!![]})[_0x4f8b('0x12')](function(_0x4c79f2){if(!_0x4c79f2)return _0x4ad4d8[_0x4f8b('0x9')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x4c79f2,_0x2df79c[_0x4f8b('0x43')]['id'])};})['then'](respondWithResult(_0x4ad4d8,null))[_0x4f8b('0x3a')](handleError(_0x4ad4d8,null));};exports[_0x4f8b('0x44')]=function(_0x17afe1,_0xaa716e){var _0x34e8e9=_0x17afe1[_0x4f8b('0x3c')];var _0x329c1e;var _0xdf989a;if(_0x34e8e9[_0x4f8b('0x14')])throw _0x34e8e9;redis[_0x4f8b('0x45')](_0x34e8e9['state'])[_0x4f8b('0x12')](function(_0x1860fd){if(!_0x1860fd)throw new Error(_0x4f8b('0x46'));_0x329c1e=JSON[_0x4f8b('0x47')](_0x1860fd);var _0x2c00bd=Buffer['from'](_0x34e8e9[_0x4f8b('0x48')],'base64')['toString'](_0x4f8b('0x49'));_0xdf989a=JSON[_0x4f8b('0x47')](_0x2c00bd);if(!oauth[_0x4f8b('0x4a')](_0x34e8e9[_0x4f8b('0x4b')],_0x329c1e[_0x4f8b('0x4c')]))throw new Error(_0x4f8b('0x4d'));redis[_0x4f8b('0x4e')](_0x34e8e9[_0x4f8b('0x48')]);return oauth[_0x4f8b('0x4f')](_0x34e8e9[_0x4f8b('0x50')],_0x329c1e);})[_0x4f8b('0x12')](function(_0x4e556f){_0x329c1e['data5']=_0x4e556f[_0x4f8b('0x51')];_0x329c1e[_0x4f8b('0x52')]=_0x4e556f[_0x4f8b('0x53')];return db['CloudProvider'][_0x4f8b('0x3f')]({'data5':_0x329c1e[_0x4f8b('0x54')],'data6':_0x329c1e[_0x4f8b('0x52')]},{'where':{'id':_0x329c1e['id']}});})[_0x4f8b('0x12')](function(){oauth[_0x4f8b('0x55')](_0x329c1e);socket['emit'](_0x4f8b('0x56'),{'id':_0xdf989a['id']});return;})[_0x4f8b('0x12')](respondWithStatusCode(_0xaa716e,null))[_0x4f8b('0x3a')](function(_0x4e28a0){if(_0xdf989a){socket[_0x4f8b('0x57')](_0x4f8b('0x58'),{'id':_0xdf989a['id']});}if(!_0x329c1e){logger[_0x4f8b('0x14')](_0x4f8b('0x59'),_0x4e28a0);return _0xaa716e[_0x4f8b('0xa')](0x1f4)[_0x4f8b('0x17')](_0x4e28a0[_0x4f8b('0x5a')]);}logger[_0x4f8b('0x14')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x329c1e['id'],JSON[_0x4f8b('0x5b')](_0x4e28a0));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 7460beb..2c20a1b 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 _0xa6b4=['../../config/environment','./cloudProvider.attributes','exports','cloud_providers','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0xb964d0,_0x2c1f84){var _0x429eed=function(_0x4f150f){while(--_0x4f150f){_0xb964d0['push'](_0xb964d0['shift']());}};_0x429eed(++_0x2c1f84);}(_0xa6b4,0x1bc));var _0x4a6b=function(_0x300860,_0x509371){_0x300860=_0x300860-0x0;var _0x2094ad=_0xa6b4[_0x300860];return _0x2094ad;};'use strict';var _=require(_0x4a6b('0x0'));var util=require(_0x4a6b('0x1'));var logger=require(_0x4a6b('0x2'))('api');var moment=require(_0x4a6b('0x3'));var BPromise=require(_0x4a6b('0x4'));var rp=require(_0x4a6b('0x5'));var fs=require('fs');var path=require(_0x4a6b('0x6'));var rimraf=require('rimraf');var config=require(_0x4a6b('0x7'));var attributes=require(_0x4a6b('0x8'));module[_0x4a6b('0x9')]=function(_0x1382f0,_0xa41435){return _0x1382f0['define']('CloudProvider',attributes,{'tableName':_0x4a6b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4b16=['bluebird','path','rimraf','../../config/environment','exports','define','util','../../config/logger','api','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4b16,0x1dc));var _0x64b1=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4b16[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x64b1('0x0'));var logger=require(_0x64b1('0x1'))(_0x64b1('0x2'));var moment=require(_0x64b1('0x3'));var BPromise=require(_0x64b1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x64b1('0x5'));var rimraf=require(_0x64b1('0x6'));var config=require(_0x64b1('0x7'));var attributes=require('./cloudProvider.attributes');module[_0x64b1('0x8')]=function(_0x15479a,_0x5bef82){return _0x15479a[_0x64b1('0x9')]('CloudProvider',attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js index a06169f..3fc7b2f 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 _0x7fcc=['data4','form_post','prompt','map','key','value','oauth2Claims','replace','set','payload','iss','issuer','aud','audience','nonce','isAfter','unix','exp','resolve','data3','CloudProvider','findOne','then','refresh_token','data6','POST','access_token','update','data5','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','decryptString','bind','all','inspect','exports','lodash','crypto','ioredis','util','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','type','Dynamics365','push','data7','join','/.default','{TENANT_ID}','data2','code','id_token','from','stringify','toString','base64','randomBytes','hex','data1','response_type'];(function(_0x2f731a,_0x150958){var _0x297cb5=function(_0x2ae071){while(--_0x2ae071){_0x2f731a['push'](_0x2f731a['shift']());}};_0x297cb5(++_0x150958);}(_0x7fcc,0xc0));var _0xc7fc=function(_0x399469,_0x3618a0){_0x399469=_0x399469-0x0;var _0x1a4cc4=_0x7fcc[_0x399469];return _0x1a4cc4;};'use strict';var _=require(_0xc7fc('0x0'));var crypto=require(_0xc7fc('0x1'));var jwt=require('jsonwebtoken');var moment=require('moment');var Redis=require(_0xc7fc('0x2'));var rp=require('request-promise');var util=require(_0xc7fc('0x3'));var encryptor=require('../../components/encryptor');var config=require('../../config/environment');var logger=require(_0xc7fc('0x4'))(_0xc7fc('0x5'));var schedule=require(_0xc7fc('0x6'));var db=require(_0xc7fc('0x7'))['db'];config[_0xc7fc('0x8')]=_[_0xc7fc('0x9')](config[_0xc7fc('0x8')],{'host':_0xc7fc('0xa'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL=_0xc7fc('0xb');var AZURE_AUTH_SCOPES={'Outlook365':[_0xc7fc('0xc'),_0xc7fc('0xd'),_0xc7fc('0xe'),_0xc7fc('0xf'),_0xc7fc('0x10'),_0xc7fc('0x11'),_0xc7fc('0x12')],'Dynamics365':[_0xc7fc('0xc'),_0xc7fc('0xf')]};var MICROSOFT_AUTH_ENDPOINT=_0xc7fc('0x13');var MICROSOFT_TOKEN_ENDPOINT=_0xc7fc('0x14');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x595435){var _0x35a166=_['map'](AZURE_AUTH_SCOPES[_0x595435['type']]);if(_0x595435[_0xc7fc('0x15')]===_0xc7fc('0x16'))_0x35a166[_0xc7fc('0x17')](_0x595435[_0xc7fc('0x18')]+'/.default');return _0x35a166[_0xc7fc('0x19')]('\x20');}function getAccessTokenScope(_0x30276b){if(_0x30276b[_0xc7fc('0x15')]==='Outlook365')return _0xc7fc('0x10');if(_0x30276b[_0xc7fc('0x15')]==='Dynamics365')return _0x30276b[_0xc7fc('0x18')]+_0xc7fc('0x1a');}function generateMicrosoftAuthorizationUrl(_0x1a78d4,_0x1e2141){var _0x4187fd=MICROSOFT_AUTH_URL['replace'](_0xc7fc('0x1b'),_0x1a78d4[_0xc7fc('0x1c')]);var _0x5d6543=[_0xc7fc('0x1d'),_0xc7fc('0x1e')];var _0x1d8eca=Buffer[_0xc7fc('0x1f')](JSON[_0xc7fc('0x20')]({'id':_0x1e2141}))[_0xc7fc('0x21')](_0xc7fc('0x22'));var _0x1fee47=crypto[_0xc7fc('0x23')](0x10)[_0xc7fc('0x21')](_0xc7fc('0x24'));var _0x533679=getAuthorizationScopes(_0x1a78d4);var _0x54bb17=[{'key':'client_id','value':_0x1a78d4[_0xc7fc('0x25')]},{'key':_0xc7fc('0x26'),'value':encodeURIComponent(_0x5d6543[_0xc7fc('0x19')]('\x20'))},{'key':'redirect_uri','value':_0x1a78d4[_0xc7fc('0x27')]},{'key':'response_mode','value':_0xc7fc('0x28')},{'key':'scope','value':encodeURIComponent(_0x533679)},{'key':'state','value':_0x1d8eca},{'key':'nonce','value':_0x1fee47},{'key':_0xc7fc('0x29'),'value':'login'}];var _0x11e550=_0x4187fd+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xc7fc('0x2a')](_0x54bb17,function(_0x2285f9){return _0x2285f9[_0xc7fc('0x2b')]+'='+_0x2285f9[_0xc7fc('0x2c')];})[_0xc7fc('0x19')]('&');_0x1a78d4[_0xc7fc('0x2d')]={'issuer':_0x4187fd[_0xc7fc('0x2e')]('oauth2/',''),'audience':_0x1a78d4[_0xc7fc('0x25')],'state':_0x1d8eca,'nonce':_0x1fee47};redis[_0xc7fc('0x2f')](_0x1d8eca,JSON[_0xc7fc('0x20')](_0x1a78d4));return _0x11e550;}function isValidIdToken(_0x469bf0,_0x291230){try{var _0x25b5f6=jwt['decode'](_0x469bf0,{'complete':!![]});var _0x39c9b7=_0x25b5f6[_0xc7fc('0x30')];if(_0x39c9b7[_0xc7fc('0x31')]!==_0x291230[_0xc7fc('0x32')])return![];if(_0x39c9b7[_0xc7fc('0x33')]!==_0x291230[_0xc7fc('0x34')])return![];if(_0x39c9b7[_0xc7fc('0x35')]!==_0x291230[_0xc7fc('0x35')])return![];if(moment()[_0xc7fc('0x36')](moment[_0xc7fc('0x37')](_0x39c9b7[_0xc7fc('0x38')])))return![];return!![];}catch(_0x50ae33){throw _0x50ae33;}}function refreshOauth2MicrosoftAccessToken(_0x4d6194){return Promise[_0xc7fc('0x39')]()['then'](function(){if(_0x4d6194[_0xc7fc('0x3a')])return _0x4d6194;return db[_0xc7fc('0x3b')][_0xc7fc('0x3c')]({'where':{'id':_0x4d6194['id']},'raw':!![]});})[_0xc7fc('0x3d')](function(_0x5516db){var _0x24c398={'grant_type':_0xc7fc('0x3e'),'refresh_token':_0x5516db[_0xc7fc('0x3f')],'scope':getAccessTokenScope(_0x5516db),'redirect_uri':_0x5516db['data4'],'client_id':_0x5516db[_0xc7fc('0x25')],'client_secret':encryptor['decryptString'](_0x5516db['data3'])};var _0x1c6fa3={'method':_0xc7fc('0x40'),'uri':MICROSOFT_AUTH_URL[_0xc7fc('0x2e')](_0xc7fc('0x1b'),_0x5516db[_0xc7fc('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x24c398,'json':!![]};return rp(_0x1c6fa3);})[_0xc7fc('0x3d')](function(_0x4ba7ed){_0x4d6194['data5']=_0x4ba7ed[_0xc7fc('0x41')];_0x4d6194[_0xc7fc('0x3f')]=_0x4ba7ed[_0xc7fc('0x3e')];return db['CloudProvider'][_0xc7fc('0x42')]({'data5':_0x4d6194[_0xc7fc('0x43')],'data6':_0x4d6194[_0xc7fc('0x3f')]},{'where':{'id':_0x4d6194['id']}});})['then'](function(){return _0x4d6194;})[_0xc7fc('0x44')](function(_0x51811a){logger[_0xc7fc('0x45')](_0xc7fc('0x46'),_0x4d6194['id'],_0x51811a);});}function getOauth2MicrosoftAccessToken(_0x19b205,_0x12d180){var _0x25b832={'grant_type':_0xc7fc('0x47'),'code':_0x19b205,'scope':getAccessTokenScope(_0x12d180),'redirect_uri':_0x12d180[_0xc7fc('0x27')],'client_id':_0x12d180[_0xc7fc('0x25')],'client_secret':encryptor[_0xc7fc('0x48')](_0x12d180[_0xc7fc('0x3a')])};var _0x4dc316={'method':'POST','uri':MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0x12d180[_0xc7fc('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x25b832,'json':!![]};return rp(_0x4dc316);}function startRefreshInterval(_0x5e207f){var _0x4ed879=schedule['intervals'];if(_0x4ed879[_0x5e207f['id']])clearInterval(_0x4ed879[_0x5e207f['id']]);_0x4ed879[_0x5e207f['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xc7fc('0x49')](this,{'id':_0x5e207f['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x4ed879;}function startAllRefreshIntervals(){return db[_0xc7fc('0x3b')]['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xc7fc('0x3d')](function(_0x3fa01e){var _0x476303=_0x3fa01e['map'](function(_0x21b36b){return refreshOauth2MicrosoftAccessToken(_0x21b36b)[_0xc7fc('0x3d')](function(_0x5c58b5){startRefreshInterval(_0x5c58b5);});});return Promise[_0xc7fc('0x4a')](_0x476303);})[_0xc7fc('0x44')](function(_0x3cbda4){var _0x5d9991=_0x3cbda4?util[_0xc7fc('0x4b')](_0x3cbda4,{'showHidden':![],'depth':null}):'';logger[_0xc7fc('0x45')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x5d9991);});}module[_0xc7fc('0x4c')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0x90b4=['util','../../components/encryptor','../../config/environment','api','../../config/schedule/cloud-provider','../../mysqldb','redis','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','map','type','Dynamics365','push','/.default','join','replace','{TENANT_ID}','data2','code','id_token','stringify','base64','toString','hex','client_id','data1','response_type','redirect_uri','response_mode','scope','nonce','login','key','value','oauth2Claims','set','payload','iss','issuer','aud','audience','unix','resolve','CloudProvider','refresh_token','data6','data4','decryptString','data3','then','data5','catch','authorization_code','POST','intervals','all','inspect','error','exports','lodash','crypto','ioredis','request-promise'];(function(_0x5bf691,_0x5d34c9){var _0x1be7ab=function(_0x4b5d01){while(--_0x4b5d01){_0x5bf691['push'](_0x5bf691['shift']());}};_0x1be7ab(++_0x5d34c9);}(_0x90b4,0xd4));var _0x490b=function(_0x5bd418,_0x3991f8){_0x5bd418=_0x5bd418-0x0;var _0x10f4f0=_0x90b4[_0x5bd418];return _0x10f4f0;};'use strict';var _=require(_0x490b('0x0'));var crypto=require(_0x490b('0x1'));var jwt=require('jsonwebtoken');var moment=require('moment');var Redis=require(_0x490b('0x2'));var rp=require(_0x490b('0x3'));var util=require(_0x490b('0x4'));var encryptor=require(_0x490b('0x5'));var config=require(_0x490b('0x6'));var logger=require('../../config/logger')(_0x490b('0x7'));var schedule=require(_0x490b('0x8'));var db=require(_0x490b('0x9'))['db'];config[_0x490b('0xa')]=_['defaults'](config['redis'],{'host':_0x490b('0xb'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL=_0x490b('0xc');var AZURE_AUTH_SCOPES={'Outlook365':[_0x490b('0xd'),_0x490b('0xe'),_0x490b('0xf'),_0x490b('0x10'),_0x490b('0x11'),_0x490b('0x12'),_0x490b('0x13')],'Dynamics365':[_0x490b('0xd'),_0x490b('0x10')]};var MICROSOFT_AUTH_ENDPOINT=_0x490b('0x14');var MICROSOFT_TOKEN_ENDPOINT=_0x490b('0x15');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x145c42){var _0x13520e=_[_0x490b('0x16')](AZURE_AUTH_SCOPES[_0x145c42[_0x490b('0x17')]]);if(_0x145c42[_0x490b('0x17')]===_0x490b('0x18'))_0x13520e[_0x490b('0x19')](_0x145c42['data7']+_0x490b('0x1a'));return _0x13520e[_0x490b('0x1b')]('\x20');}function getAccessTokenScope(_0x52e55d){if(_0x52e55d[_0x490b('0x17')]==='Outlook365')return _0x490b('0x11');if(_0x52e55d[_0x490b('0x17')]==='Dynamics365')return _0x52e55d['data7']+_0x490b('0x1a');}function generateMicrosoftAuthorizationUrl(_0x1b53b1,_0x1456b2){var _0x22faa6=MICROSOFT_AUTH_URL[_0x490b('0x1c')](_0x490b('0x1d'),_0x1b53b1[_0x490b('0x1e')]);var _0x47d164=[_0x490b('0x1f'),_0x490b('0x20')];var _0x72e73=Buffer['from'](JSON[_0x490b('0x21')]({'id':_0x1456b2}))['toString'](_0x490b('0x22'));var _0x360b28=crypto['randomBytes'](0x10)[_0x490b('0x23')](_0x490b('0x24'));var _0x1b2e83=getAuthorizationScopes(_0x1b53b1);var _0x49c81a=[{'key':_0x490b('0x25'),'value':_0x1b53b1[_0x490b('0x26')]},{'key':_0x490b('0x27'),'value':encodeURIComponent(_0x47d164[_0x490b('0x1b')]('\x20'))},{'key':_0x490b('0x28'),'value':_0x1b53b1['data4']},{'key':_0x490b('0x29'),'value':'form_post'},{'key':_0x490b('0x2a'),'value':encodeURIComponent(_0x1b2e83)},{'key':'state','value':_0x72e73},{'key':_0x490b('0x2b'),'value':_0x360b28},{'key':'prompt','value':_0x490b('0x2c')}];var _0x323a9a=_0x22faa6+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x490b('0x16')](_0x49c81a,function(_0x38477a){return _0x38477a[_0x490b('0x2d')]+'='+_0x38477a[_0x490b('0x2e')];})[_0x490b('0x1b')]('&');_0x1b53b1[_0x490b('0x2f')]={'issuer':_0x22faa6[_0x490b('0x1c')]('oauth2/',''),'audience':_0x1b53b1[_0x490b('0x26')],'state':_0x72e73,'nonce':_0x360b28};redis[_0x490b('0x30')](_0x72e73,JSON[_0x490b('0x21')](_0x1b53b1));return _0x323a9a;}function isValidIdToken(_0x8f10d8,_0x2903e3){try{var _0x19577d=jwt['decode'](_0x8f10d8,{'complete':!![]});var _0x4f3804=_0x19577d[_0x490b('0x31')];if(_0x4f3804[_0x490b('0x32')]!==_0x2903e3[_0x490b('0x33')])return![];if(_0x4f3804[_0x490b('0x34')]!==_0x2903e3[_0x490b('0x35')])return![];if(_0x4f3804['nonce']!==_0x2903e3['nonce'])return![];if(moment()['isAfter'](moment[_0x490b('0x36')](_0x4f3804['exp'])))return![];return!![];}catch(_0x6d2ab2){throw _0x6d2ab2;}}function refreshOauth2MicrosoftAccessToken(_0x578775){return Promise[_0x490b('0x37')]()['then'](function(){if(_0x578775['data3'])return _0x578775;return db[_0x490b('0x38')]['findOne']({'where':{'id':_0x578775['id']},'raw':!![]});})['then'](function(_0xf6e531){var _0x997116={'grant_type':_0x490b('0x39'),'refresh_token':_0xf6e531[_0x490b('0x3a')],'scope':getAccessTokenScope(_0xf6e531),'redirect_uri':_0xf6e531[_0x490b('0x3b')],'client_id':_0xf6e531[_0x490b('0x26')],'client_secret':encryptor[_0x490b('0x3c')](_0xf6e531[_0x490b('0x3d')])};var _0x80124a={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x490b('0x1c')]('{TENANT_ID}',_0xf6e531[_0x490b('0x1e')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x997116,'json':!![]};return rp(_0x80124a);})[_0x490b('0x3e')](function(_0x1be07e){_0x578775[_0x490b('0x3f')]=_0x1be07e['access_token'];_0x578775[_0x490b('0x3a')]=_0x1be07e[_0x490b('0x39')];return db['CloudProvider']['update']({'data5':_0x578775[_0x490b('0x3f')],'data6':_0x578775[_0x490b('0x3a')]},{'where':{'id':_0x578775['id']}});})[_0x490b('0x3e')](function(){return _0x578775;})[_0x490b('0x40')](function(_0x2af881){logger['error']('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0x578775['id'],_0x2af881);});}function getOauth2MicrosoftAccessToken(_0x7d9e52,_0xe74340){var _0x3da2d2={'grant_type':_0x490b('0x41'),'code':_0x7d9e52,'scope':getAccessTokenScope(_0xe74340),'redirect_uri':_0xe74340['data4'],'client_id':_0xe74340[_0x490b('0x26')],'client_secret':encryptor['decryptString'](_0xe74340[_0x490b('0x3d')])};var _0x418b85={'method':_0x490b('0x42'),'uri':MICROSOFT_AUTH_URL['replace'](_0x490b('0x1d'),_0xe74340[_0x490b('0x1e')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x3da2d2,'json':!![]};return rp(_0x418b85);}function startRefreshInterval(_0x436cbe){var _0x31d73b=schedule[_0x490b('0x43')];if(_0x31d73b[_0x436cbe['id']])clearInterval(_0x31d73b[_0x436cbe['id']]);_0x31d73b[_0x436cbe['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x436cbe['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x31d73b;}function startAllRefreshIntervals(){return db['CloudProvider']['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x490b('0x3e')](function(_0x5ce3e0){var _0x4f9b6f=_0x5ce3e0[_0x490b('0x16')](function(_0x31dd00){return refreshOauth2MicrosoftAccessToken(_0x31dd00)['then'](function(_0x171666){startRefreshInterval(_0x171666);});});return Promise[_0x490b('0x44')](_0x4f9b6f);})[_0x490b('0x40')](function(_0x9d2914){var _0x12bba3=_0x9d2914?util[_0x490b('0x45')](_0x9d2914,{'showHidden':![],'depth':null}):'';logger[_0x490b('0x46')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x12bba3);});}module[_0x490b('0x47')]={'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 116e690..47b3fb5 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 _0x419f=['CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent'];(function(_0x26a29d,_0x126177){var _0x30c60d=function(_0x3ddc95){while(--_0x3ddc95){_0x26a29d['push'](_0x26a29d['shift']());}};_0x30c60d(++_0x126177);}(_0x419f,0x176));var _0xf419=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x419f[_0x465a0c];return _0x1e202e;};'use strict';var _=require(_0xf419('0x0'));var util=require(_0xf419('0x1'));var moment=require(_0xf419('0x2'));var BPromise=require(_0xf419('0x3'));var rs=require(_0xf419('0x4'));var fs=require('fs');var Redis=require(_0xf419('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf419('0x6'));var logger=require('../../config/logger')(_0xf419('0x7'));var config=require(_0xf419('0x8'));var jayson=require(_0xf419('0x9'));var client=jayson[_0xf419('0xa')][_0xf419('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2b5526,_0x4082de,_0x2e42a8){return new BPromise(function(_0x3f0c3e,_0x4bb5fd){return client[_0xf419('0xc')](_0x2b5526,_0x2e42a8)[_0xf419('0xd')](function(_0x5ab7d3){logger[_0xf419('0xe')](_0xf419('0xf'),_0x4082de,_0xf419('0x10'));logger['debug'](_0xf419('0x11'),_0x4082de,_0xf419('0x10'),JSON[_0xf419('0x12')](_0x5ab7d3));if(_0x5ab7d3[_0xf419('0x13')]){if(_0x5ab7d3[_0xf419('0x13')]['code']===0x1f4){logger['error'](_0xf419('0xf'),_0x4082de,_0x5ab7d3[_0xf419('0x13')][_0xf419('0x14')]);return _0x4bb5fd(_0x5ab7d3[_0xf419('0x13')][_0xf419('0x14')]);}logger['error'](_0xf419('0xf'),_0x4082de,_0x5ab7d3[_0xf419('0x13')][_0xf419('0x14')]);return _0x3f0c3e(_0x5ab7d3[_0xf419('0x13')][_0xf419('0x14')]);}else{logger[_0xf419('0xe')]('CloudProvider,\x20%s,\x20%s',_0x4082de,_0xf419('0x10'));_0x3f0c3e(_0x5ab7d3[_0xf419('0x15')]['message']);}})[_0xf419('0x16')](function(_0x19660e){logger[_0xf419('0x13')]('CloudProvider,\x20%s,\x20%s',_0x4082de,_0x19660e);_0x4bb5fd(_0x19660e);});});} \ No newline at end of file +var _0xdaa8=['client','request','then','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','../../config/environment','jayson/promise'];(function(_0x1100ec,_0x4c97b1){var _0x9d4dee=function(_0x2bf8a9){while(--_0x2bf8a9){_0x1100ec['push'](_0x1100ec['shift']());}};_0x9d4dee(++_0x4c97b1);}(_0xdaa8,0xe4));var _0x8daa=function(_0x219e3d,_0x5e287e){_0x219e3d=_0x219e3d-0x0;var _0x28474c=_0xdaa8[_0x219e3d];return _0x28474c;};'use strict';var _=require(_0x8daa('0x0'));var util=require(_0x8daa('0x1'));var moment=require(_0x8daa('0x2'));var BPromise=require(_0x8daa('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x8daa('0x4'));var jayson=require(_0x8daa('0x5'));var client=jayson[_0x8daa('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e8116,_0x1f5a97,_0x48bf41){return new BPromise(function(_0x41de3e,_0x2df1a0){return client[_0x8daa('0x7')](_0x4e8116,_0x48bf41)[_0x8daa('0x8')](function(_0x207291){logger['info'](_0x8daa('0x9'),_0x1f5a97,_0x8daa('0xa'));logger[_0x8daa('0xb')](_0x8daa('0xc'),_0x1f5a97,_0x8daa('0xa'),JSON[_0x8daa('0xd')](_0x207291));if(_0x207291[_0x8daa('0xe')]){if(_0x207291[_0x8daa('0xe')][_0x8daa('0xf')]===0x1f4){logger[_0x8daa('0xe')](_0x8daa('0x9'),_0x1f5a97,_0x207291['error'][_0x8daa('0x10')]);return _0x2df1a0(_0x207291[_0x8daa('0xe')][_0x8daa('0x10')]);}logger['error'](_0x8daa('0x9'),_0x1f5a97,_0x207291['error'][_0x8daa('0x10')]);return _0x41de3e(_0x207291[_0x8daa('0xe')][_0x8daa('0x10')]);}else{logger['info'](_0x8daa('0x9'),_0x1f5a97,_0x8daa('0xa'));_0x41de3e(_0x207291['result']['message']);}})[_0x8daa('0x11')](function(_0x2fc822){logger[_0x8daa('0xe')](_0x8daa('0x9'),_0x1f5a97,_0x2fc822);_0x2df1a0(_0x2fc822);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 04c71a6..9606091 100644 --- a/server/api/cloudProvider/index.js +++ b/server/api/cloudProvider/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback'];(function(_0x3f5dca,_0x59472b){var _0x5b833a=function(_0x1cb84b){while(--_0x1cb84b){_0x3f5dca['push'](_0x3f5dca['shift']());}};_0x5b833a(++_0x59472b);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5d17ad,_0x5dab65){_0x5d17ad=_0x5d17ad-0x0;var _0x43aa32=_0x5f2f[_0x5d17ad];return _0x43aa32;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);router[_0xf5f2('0x4')]('/:id',auth['isAuthenticated'](),controller[_0xf5f2('0x7')]);router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x9')]);router[_0xf5f2('0xa')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xc')]);router[_0xf5f2('0xd')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xe')]);router[_0xf5f2('0x4')](_0xf5f2('0xf'),auth['isAuthenticated'](),controller[_0xf5f2('0x10')]);router['post']('/oauth2/microsoft/callback',controller[_0xf5f2('0x11')]);module[_0xf5f2('0x12')]=router; \ No newline at end of file +var _0x5f2f=['exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback'];(function(_0x3f1710,_0x3877a2){var _0x528458=function(_0x4b5d0f){while(--_0x4b5d0f){_0x3f1710['push'](_0x3f1710['shift']());}};_0x528458(++_0x3877a2);}(_0x5f2f,0x73));var _0xf5f2=function(_0x369adf,_0x1e4428){_0x369adf=_0x369adf-0x0;var _0x164b44=_0x5f2f[_0x369adf];return _0x164b44;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);router[_0xf5f2('0x4')]('/:id',auth['isAuthenticated'](),controller[_0xf5f2('0x7')]);router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x9')]);router[_0xf5f2('0xa')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xc')]);router[_0xf5f2('0xd')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xe')]);router[_0xf5f2('0x4')](_0xf5f2('0xf'),auth['isAuthenticated'](),controller[_0xf5f2('0x10')]);router['post']('/oauth2/microsoft/callback',controller[_0xf5f2('0x11')]);module[_0xf5f2('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index fddbbed..542cf9f 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 _0xc015=['name','sequelize','exports','STRING'];(function(_0x1d6d75,_0x31ef4){var _0x1e7cd0=function(_0x786041){while(--_0x786041){_0x1d6d75['push'](_0x1d6d75['shift']());}};_0x1e7cd0(++_0x31ef4);}(_0xc015,0x81));var _0x5c01=function(_0x36d25e,_0x1a047d){_0x36d25e=_0x36d25e-0x0;var _0x4b95b8=_0xc015[_0x36d25e];return _0x4b95b8;};'use strict';var Sequelize=require(_0x5c01('0x0'));module[_0x5c01('0x1')]={'name':{'type':Sequelize[_0x5c01('0x2')],'unique':_0x5c01('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x5c01('0x2')]},'companyId':{'type':Sequelize[_0x5c01('0x2')]},'website':{'type':Sequelize[_0x5c01('0x2')]},'phone':{'type':Sequelize[_0x5c01('0x2')]},'fax':{'type':Sequelize[_0x5c01('0x2')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x5c01('0x2')]},'postalCode':{'type':Sequelize[_0x5c01('0x2')]},'city':{'type':Sequelize[_0x5c01('0x2')]},'country':{'type':Sequelize[_0x5c01('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x5c01('0x2')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x5c01('0x2')]},'sCountry':{'type':Sequelize[_0x5c01('0x2')]},'description':{'type':Sequelize[_0x5c01('0x2')]}}; \ No newline at end of file +var _0xa33b=['sequelize','exports','STRING','name'];(function(_0x423836,_0x2d438d){var _0x1d9500=function(_0x805dd0){while(--_0x805dd0){_0x423836['push'](_0x423836['shift']());}};_0x1d9500(++_0x2d438d);}(_0xa33b,0x68));var _0xba33=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0xa33b[_0x17b6e3];return _0x3906f3;};'use strict';var Sequelize=require(_0xba33('0x0'));module[_0xba33('0x1')]={'name':{'type':Sequelize[_0xba33('0x2')],'unique':_0xba33('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xba33('0x2')]},'companyId':{'type':Sequelize[_0xba33('0x2')]},'website':{'type':Sequelize[_0xba33('0x2')]},'phone':{'type':Sequelize[_0xba33('0x2')]},'fax':{'type':Sequelize[_0xba33('0x2')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xba33('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xba33('0x2')]},'country':{'type':Sequelize[_0xba33('0x2')]},'email':{'type':Sequelize[_0xba33('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xba33('0x2')]},'sStreet':{'type':Sequelize[_0xba33('0x2')]},'sPostalCode':{'type':Sequelize[_0xba33('0x2')]},'sCity':{'type':Sequelize[_0xba33('0x2')]},'sCountry':{'type':Sequelize[_0xba33('0x2')]},'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 9ed42f7..8b74ded 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 _0xbea0=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','save','update','then','destroy','get','Companies','UserProfileResource','error','stack','send','CmCompany','describe','model','keys','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','map','includeAll','findAll','rows','catch','params','intersection','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','ids','omit','getContacts','findOne','rawAttributes','order','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','crypto','desk.js','querystring'];(function(_0x47ea24,_0x763e97){var _0xe5a240=function(_0x2e1f7f){while(--_0x2e1f7f){_0x47ea24['push'](_0x47ea24['shift']());}};_0xe5a240(++_0x763e97);}(_0xbea0,0xec));var _0x0bea=function(_0x23e1a3,_0x1ff0c8){_0x23e1a3=_0x23e1a3-0x0;var _0x2dbba6=_0xbea0[_0x23e1a3];return _0x2dbba6;};'use strict';var emlformat=require(_0x0bea('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0bea('0x1'));var jsonpatch=require(_0x0bea('0x2'));var rp=require(_0x0bea('0x3'));var moment=require('moment');var BPromise=require(_0x0bea('0x4'));var Mustache=require(_0x0bea('0x5'));var util=require(_0x0bea('0x6'));var path=require('path');var sox=require(_0x0bea('0x7'));var csv=require(_0x0bea('0x8'));var ejs=require(_0x0bea('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x0bea('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x0bea('0xb'));var toCsv=require('to-csv');var querystring=require(_0x0bea('0xc'));var Papa=require(_0x0bea('0xd'));var Redis=require(_0x0bea('0xe'));var authService=require(_0x0bea('0xf'));var qs=require(_0x0bea('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0bea('0x11'));var logger=require(_0x0bea('0x12'))(_0x0bea('0x13'));var utils=require(_0x0bea('0x14'));var config=require(_0x0bea('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x0bea('0x16'))['db'];function respondWithStatusCode(_0x4ea548,_0x4c5b42){_0x4c5b42=_0x4c5b42||0xcc;return function(_0x3ea765){if(_0x3ea765){return _0x4ea548[_0x0bea('0x17')](_0x4c5b42);}return _0x4ea548['status'](_0x4c5b42)[_0x0bea('0x18')]();};}function respondWithResult(_0x2486eb,_0x5291ee){_0x5291ee=_0x5291ee||0xc8;return function(_0x18e6e7){if(_0x18e6e7){return _0x2486eb[_0x0bea('0x19')](_0x5291ee)[_0x0bea('0x1a')](_0x18e6e7);}};}function respondWithFilteredResult(_0x10947a,_0x27c99d){return function(_0x4b81e0){if(_0x4b81e0){var _0x282813=typeof _0x27c99d['offset']==='undefined'&&typeof _0x27c99d['limit']==='undefined';var _0x32ebc3=_0x4b81e0[_0x0bea('0x1b')];var _0x20ce44=_0x282813?0x0:_0x27c99d['offset'];var _0x482526=_0x282813?_0x4b81e0[_0x0bea('0x1b')]:_0x27c99d[_0x0bea('0x1c')]+_0x27c99d[_0x0bea('0x1d')];var _0x490a16;if(_0x482526>=_0x32ebc3){_0x482526=_0x32ebc3;_0x490a16=0xc8;}else{_0x490a16=0xce;}_0x10947a[_0x0bea('0x19')](_0x490a16);return _0x10947a[_0x0bea('0x1e')](_0x0bea('0x1f'),_0x20ce44+'-'+_0x482526+'/'+_0x32ebc3)['json'](_0x4b81e0);}return null;};}function patchUpdates(_0x418c9e){return function(_0x2f2833){try{jsonpatch['apply'](_0x2f2833,_0x418c9e,!![]);}catch(_0x76f1d4){return BPromise['reject'](_0x76f1d4);}return _0x2f2833[_0x0bea('0x20')]();};}function saveUpdates(_0x56d8bd,_0x22210b){return function(_0x13c597){if(_0x13c597){return _0x13c597[_0x0bea('0x21')](_0x56d8bd)[_0x0bea('0x22')](function(_0x4fb972){return _0x4fb972;});}return null;};}function removeEntity(_0x22ebe6,_0xf93519){return function(_0x5a0da9){if(_0x5a0da9){return _0x5a0da9[_0x0bea('0x23')]()['then'](function(){var _0x4a202a=_0x5a0da9[_0x0bea('0x24')]({'plain':!![]});var _0x2d9d1f=_0x0bea('0x25');return db[_0x0bea('0x26')][_0x0bea('0x23')]({'where':{'type':_0x2d9d1f,'resourceId':_0x4a202a['id']}})[_0x0bea('0x22')](function(){return _0x5a0da9;});})[_0x0bea('0x22')](function(){_0x22ebe6['status'](0xcc)[_0x0bea('0x18')]();});}};}function handleEntityNotFound(_0x356880,_0x139784){return function(_0x3932e5){if(!_0x3932e5){_0x356880[_0x0bea('0x17')](0x194);}return _0x3932e5;};}function handleError(_0x4a67aa,_0x429008){_0x429008=_0x429008||0x1f4;return function(_0xd4be92){logger[_0x0bea('0x27')](_0xd4be92[_0x0bea('0x28')]);if(_0xd4be92['name']){delete _0xd4be92['name'];}_0x4a67aa[_0x0bea('0x19')](_0x429008)[_0x0bea('0x29')](_0xd4be92);};}exports['index']=function(_0x1c85b3,_0x1b76a4){var _0x11271f={},_0x334954={},_0x17b073={'count':0x0,'rows':[]};return db[_0x0bea('0x2a')][_0x0bea('0x2b')]()[_0x0bea('0x22')](function(_0x2a8382){_0x334954[_0x0bea('0x2c')]=_[_0x0bea('0x2d')](_0x2a8382);_0x334954[_0x0bea('0x2e')]=_[_0x0bea('0x2d')](_0x1c85b3['query']);_0x334954['filters']=_['intersection'](_0x334954[_0x0bea('0x2c')],_0x334954[_0x0bea('0x2e')]);_0x11271f[_0x0bea('0x2f')]=_['intersection'](_0x334954[_0x0bea('0x2c')],qs[_0x0bea('0x30')](_0x1c85b3[_0x0bea('0x2e')][_0x0bea('0x30')]));_0x11271f[_0x0bea('0x2f')]=_0x11271f['attributes'][_0x0bea('0x31')]?_0x11271f[_0x0bea('0x2f')]:_0x334954['model'];if(!_0x1c85b3[_0x0bea('0x2e')][_0x0bea('0x32')](_0x0bea('0x33'))){_0x11271f[_0x0bea('0x1d')]=qs[_0x0bea('0x1d')](_0x1c85b3[_0x0bea('0x2e')][_0x0bea('0x1d')]);_0x11271f[_0x0bea('0x1c')]=qs[_0x0bea('0x1c')](_0x1c85b3[_0x0bea('0x2e')]['offset']);}_0x11271f['order']=qs[_0x0bea('0x34')](_0x1c85b3['query'][_0x0bea('0x34')]);_0x11271f[_0x0bea('0x35')]=qs[_0x0bea('0x36')](_[_0x0bea('0x37')](_0x1c85b3['query'],_0x334954[_0x0bea('0x36')]),_0x2a8382);if(_0x1c85b3[_0x0bea('0x2e')][_0x0bea('0x38')]){_0x11271f[_0x0bea('0x35')]=_[_0x0bea('0x39')](_0x11271f[_0x0bea('0x35')],{'$or':_[_0x0bea('0x3a')](_0x11271f['attributes'],function(_0x5b5350){var _0x11ddc1={};_0x11ddc1[_0x5b5350]={'$like':'%'+_0x1c85b3[_0x0bea('0x2e')][_0x0bea('0x38')]+'%'};return _0x11ddc1;})});}_0x11271f=_[_0x0bea('0x39')]({},_0x11271f,_0x1c85b3['options']);var _0x2b1801={'where':_0x11271f[_0x0bea('0x35')]};return db['CmCompany'][_0x0bea('0x1b')](_0x2b1801)[_0x0bea('0x22')](function(_0x172e66){_0x17b073[_0x0bea('0x1b')]=_0x172e66;if(_0x1c85b3[_0x0bea('0x2e')][_0x0bea('0x3b')]){_0x11271f['include']=[{'all':!![]}];}return db['CmCompany'][_0x0bea('0x3c')](_0x11271f);})[_0x0bea('0x22')](function(_0x3e67d4){_0x17b073[_0x0bea('0x3d')]=_0x3e67d4;return _0x17b073;})[_0x0bea('0x22')](respondWithFilteredResult(_0x1b76a4,_0x11271f))['catch'](handleError(_0x1b76a4,null));})[_0x0bea('0x3e')](handleError(_0x1b76a4,null));};exports['show']=function(_0x4e0dbc,_0x364ab1){var _0x1e7b12={'raw':![],'where':{'id':_0x4e0dbc[_0x0bea('0x3f')]['id']}},_0x6c28f2={};_0x6c28f2[_0x0bea('0x2c')]=_[_0x0bea('0x2d')](db['CmCompany']['rawAttributes']);_0x6c28f2[_0x0bea('0x2e')]=_[_0x0bea('0x2d')](_0x4e0dbc['query']);_0x6c28f2[_0x0bea('0x36')]=_[_0x0bea('0x40')](_0x6c28f2['model'],_0x6c28f2[_0x0bea('0x2e')]);_0x1e7b12['attributes']=_[_0x0bea('0x40')](_0x6c28f2[_0x0bea('0x2c')],qs[_0x0bea('0x30')](_0x4e0dbc[_0x0bea('0x2e')][_0x0bea('0x30')]));_0x1e7b12['attributes']=_0x1e7b12[_0x0bea('0x2f')][_0x0bea('0x31')]?_0x1e7b12[_0x0bea('0x2f')]:_0x6c28f2['model'];if(_0x4e0dbc[_0x0bea('0x2e')]['includeAll']){_0x1e7b12['include']=[{'all':!![]}];}_0x1e7b12=_[_0x0bea('0x39')]({},_0x1e7b12,_0x4e0dbc[_0x0bea('0x41')]);return db[_0x0bea('0x2a')][_0x0bea('0x42')](_0x1e7b12)[_0x0bea('0x22')](handleEntityNotFound(_0x364ab1,null))[_0x0bea('0x22')](respondWithResult(_0x364ab1,null))[_0x0bea('0x3e')](handleError(_0x364ab1,null));};exports['create']=function(_0x529d84,_0x2103b1){return db[_0x0bea('0x2a')][_0x0bea('0x43')](_0x529d84[_0x0bea('0x44')],{})[_0x0bea('0x22')](function(_0x41a840){var _0x491b86=_0x529d84[_0x0bea('0x45')][_0x0bea('0x24')]({'plain':!![]});if(!_0x491b86)throw new Error(_0x0bea('0x46'));if(_0x491b86[_0x0bea('0x47')]==='user'){var _0x3d49de=_0x41a840[_0x0bea('0x24')]({'plain':!![]});var _0x24b868=_0x0bea('0x25');return db['UserProfileSection'][_0x0bea('0x42')]({'where':{'name':_0x24b868,'userProfileId':_0x491b86[_0x0bea('0x48')]},'raw':!![]})[_0x0bea('0x22')](function(_0x5ae2df){if(_0x5ae2df&&_0x5ae2df['autoAssociation']===0x0){return db[_0x0bea('0x26')]['create']({'name':_0x3d49de[_0x0bea('0x49')],'resourceId':_0x3d49de['id'],'type':_0x5ae2df[_0x0bea('0x49')],'sectionId':_0x5ae2df['id']},{})[_0x0bea('0x22')](function(){return _0x41a840;});}else{return _0x41a840;}})[_0x0bea('0x3e')](function(_0x18e0da){logger[_0x0bea('0x27')](_0x0bea('0x4a'),_0x18e0da);throw _0x18e0da;});}return _0x41a840;})[_0x0bea('0x22')](respondWithResult(_0x2103b1,0xc9))['catch'](handleError(_0x2103b1,null));};exports[_0x0bea('0x21')]=function(_0x55443a,_0x5e3936){if(_0x55443a[_0x0bea('0x44')]['id']){delete _0x55443a[_0x0bea('0x44')]['id'];}return db['CmCompany'][_0x0bea('0x42')]({'where':{'id':_0x55443a['params']['id']}})[_0x0bea('0x22')](handleEntityNotFound(_0x5e3936,null))[_0x0bea('0x22')](saveUpdates(_0x55443a[_0x0bea('0x44')],null))[_0x0bea('0x22')](respondWithResult(_0x5e3936,null))['catch'](handleError(_0x5e3936,null));};exports[_0x0bea('0x23')]=function(_0x5be5e1,_0x2fc2d5){return db[_0x0bea('0x2a')][_0x0bea('0x42')]({'where':{'id':_0x5be5e1['params']['id']}})[_0x0bea('0x22')](handleEntityNotFound(_0x2fc2d5,null))[_0x0bea('0x22')](removeEntity(_0x2fc2d5,null))[_0x0bea('0x3e')](handleError(_0x2fc2d5,null));};exports['describe']=function(_0x270b5d,_0x20705d){return db[_0x0bea('0x2a')][_0x0bea('0x2b')]()[_0x0bea('0x22')](respondWithResult(_0x20705d,null))[_0x0bea('0x3e')](handleError(_0x20705d,null));};exports[_0x0bea('0x4b')]=function(_0x2d2403,_0x41e315,_0x403f15){return db[_0x0bea('0x4c')]['find']({'where':{'id':_0x2d2403[_0x0bea('0x3f')]['id']}})['then'](handleEntityNotFound(_0x41e315,null))[_0x0bea('0x22')](function(_0x35e93){if(_0x35e93){return _0x35e93[_0x0bea('0x4b')](_0x2d2403[_0x0bea('0x44')][_0x0bea('0x4d')],_[_0x0bea('0x4e')](_0x2d2403[_0x0bea('0x44')],[_0x0bea('0x4d'),'id'])||{});}})[_0x0bea('0x22')](respondWithResult(_0x41e315,null))['catch'](handleError(_0x41e315,null));};exports[_0x0bea('0x4f')]=function(_0x440aa9,_0x656a95,_0xebbe73){var _0x1d7bb1={};var _0x118899={};var _0x3cb8b5;var _0x5cb606;return db['CmCompany'][_0x0bea('0x50')]({'where':{'id':_0x440aa9[_0x0bea('0x3f')]['id']}})['then'](handleEntityNotFound(_0x656a95,null))[_0x0bea('0x22')](function(_0x2bb853){if(_0x2bb853){_0x3cb8b5=_0x2bb853;_0x118899[_0x0bea('0x2c')]=_[_0x0bea('0x2d')](db[_0x0bea('0x4c')][_0x0bea('0x51')]);_0x118899[_0x0bea('0x2e')]=_[_0x0bea('0x2d')](_0x440aa9[_0x0bea('0x2e')]);_0x118899['filters']=_[_0x0bea('0x40')](_0x118899[_0x0bea('0x2c')],_0x118899[_0x0bea('0x2e')]);_0x1d7bb1[_0x0bea('0x2f')]=_[_0x0bea('0x40')](_0x118899['model'],qs[_0x0bea('0x30')](_0x440aa9['query'][_0x0bea('0x30')]));_0x1d7bb1[_0x0bea('0x2f')]=_0x1d7bb1[_0x0bea('0x2f')][_0x0bea('0x31')]?_0x1d7bb1[_0x0bea('0x2f')]:_0x118899[_0x0bea('0x2c')];_0x1d7bb1[_0x0bea('0x52')]=qs[_0x0bea('0x34')](_0x440aa9[_0x0bea('0x2e')][_0x0bea('0x34')]);_0x1d7bb1[_0x0bea('0x35')]=qs['filters'](_[_0x0bea('0x37')](_0x440aa9[_0x0bea('0x2e')],_0x118899[_0x0bea('0x36')]));if(_0x440aa9['query'][_0x0bea('0x38')]){_0x1d7bb1[_0x0bea('0x35')]=_['merge'](_0x1d7bb1['where'],{'$or':_[_0x0bea('0x3a')](_0x1d7bb1[_0x0bea('0x2f')],function(_0x32a5c2){var _0x288ba4={};_0x288ba4[_0x32a5c2]={'$like':'%'+_0x440aa9[_0x0bea('0x2e')][_0x0bea('0x38')]+'%'};return _0x288ba4;})});}_0x1d7bb1=_[_0x0bea('0x39')]({},_0x1d7bb1,_0x440aa9[_0x0bea('0x41')]);return _0x3cb8b5[_0x0bea('0x4f')](_0x1d7bb1);}})[_0x0bea('0x22')](function(_0x1d68b9){if(_0x1d68b9){_0x5cb606=_0x1d68b9['length'];if(!_0x440aa9[_0x0bea('0x2e')][_0x0bea('0x32')](_0x0bea('0x33'))){_0x1d7bb1[_0x0bea('0x1d')]=qs['limit'](_0x440aa9[_0x0bea('0x2e')][_0x0bea('0x1d')]);_0x1d7bb1['offset']=qs[_0x0bea('0x1c')](_0x440aa9[_0x0bea('0x2e')]['offset']);}return _0x3cb8b5[_0x0bea('0x4f')](_0x1d7bb1);}})[_0x0bea('0x22')](function(_0x20a6f4){if(_0x20a6f4){return _0x20a6f4?{'count':_0x5cb606,'rows':_0x20a6f4}:null;}})[_0x0bea('0x22')](respondWithResult(_0x656a95,null))['catch'](handleError(_0x656a95,null));}; \ No newline at end of file +var _0x9e8d=['merge','map','filter','options','include','CmCompany','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','CmContact','addContacts','ids','getContacts','pick','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','json','apply','reject','save','then','get','Companies','UserProfileResource','destroy','name','send','index','describe','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters'];(function(_0x1fe0b5,_0x2d5ddc){var _0x14ee7c=function(_0x5103cc){while(--_0x5103cc){_0x1fe0b5['push'](_0x1fe0b5['shift']());}};_0x14ee7c(++_0x2d5ddc);}(_0x9e8d,0x11d));var _0xd9e8=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x9e8d[_0x311c35];return _0x5cc50c;};'use strict';var emlformat=require(_0xd9e8('0x0'));var rimraf=require(_0xd9e8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd9e8('0x2'));var rp=require('request-promise');var moment=require(_0xd9e8('0x3'));var BPromise=require(_0xd9e8('0x4'));var Mustache=require(_0xd9e8('0x5'));var util=require(_0xd9e8('0x6'));var path=require(_0xd9e8('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd9e8('0x8'));var _=require(_0xd9e8('0x9'));var squel=require(_0xd9e8('0xa'));var crypto=require('crypto');var jsforce=require(_0xd9e8('0xb'));var deskjs=require(_0xd9e8('0xc'));var toCsv=require(_0xd9e8('0xd'));var querystring=require('querystring');var Papa=require(_0xd9e8('0xe'));var Redis=require(_0xd9e8('0xf'));var authService=require(_0xd9e8('0x10'));var qs=require(_0xd9e8('0x11'));var as=require(_0xd9e8('0x12'));var hardwareService=require(_0xd9e8('0x13'));var logger=require(_0xd9e8('0x14'))(_0xd9e8('0x15'));var utils=require(_0xd9e8('0x16'));var config=require(_0xd9e8('0x17'));var licenseUtil=require(_0xd9e8('0x18'));var db=require(_0xd9e8('0x19'))['db'];function respondWithStatusCode(_0x296e7e,_0x255a84){_0x255a84=_0x255a84||0xcc;return function(_0x5db990){if(_0x5db990){return _0x296e7e[_0xd9e8('0x1a')](_0x255a84);}return _0x296e7e[_0xd9e8('0x1b')](_0x255a84)[_0xd9e8('0x1c')]();};}function respondWithResult(_0x262a62,_0x3e1948){_0x3e1948=_0x3e1948||0xc8;return function(_0x1f8573){if(_0x1f8573){return _0x262a62[_0xd9e8('0x1b')](_0x3e1948)['json'](_0x1f8573);}};}function respondWithFilteredResult(_0x2daea7,_0xf35f7){return function(_0x5fc99a){if(_0x5fc99a){var _0x452df0=typeof _0xf35f7[_0xd9e8('0x1d')]===_0xd9e8('0x1e')&&typeof _0xf35f7['limit']===_0xd9e8('0x1e');var _0x30f90c=_0x5fc99a['count'];var _0x24b160=_0x452df0?0x0:_0xf35f7[_0xd9e8('0x1d')];var _0x25f8e2=_0x452df0?_0x5fc99a[_0xd9e8('0x1f')]:_0xf35f7[_0xd9e8('0x1d')]+_0xf35f7[_0xd9e8('0x20')];var _0x444ea3;if(_0x25f8e2>=_0x30f90c){_0x25f8e2=_0x30f90c;_0x444ea3=0xc8;}else{_0x444ea3=0xce;}_0x2daea7['status'](_0x444ea3);return _0x2daea7['set']('Content-Range',_0x24b160+'-'+_0x25f8e2+'/'+_0x30f90c)[_0xd9e8('0x21')](_0x5fc99a);}return null;};}function patchUpdates(_0x4a8f68){return function(_0x2bbe5e){try{jsonpatch[_0xd9e8('0x22')](_0x2bbe5e,_0x4a8f68,!![]);}catch(_0xae273b){return BPromise[_0xd9e8('0x23')](_0xae273b);}return _0x2bbe5e[_0xd9e8('0x24')]();};}function saveUpdates(_0x4bc41e,_0x56ca9a){return function(_0x404bab){if(_0x404bab){return _0x404bab['update'](_0x4bc41e)[_0xd9e8('0x25')](function(_0x778724){return _0x778724;});}return null;};}function removeEntity(_0x177644,_0x5c84c8){return function(_0x1953c8){if(_0x1953c8){return _0x1953c8['destroy']()[_0xd9e8('0x25')](function(){var _0x41c3e7=_0x1953c8[_0xd9e8('0x26')]({'plain':!![]});var _0x4272bd=_0xd9e8('0x27');return db[_0xd9e8('0x28')][_0xd9e8('0x29')]({'where':{'type':_0x4272bd,'resourceId':_0x41c3e7['id']}})[_0xd9e8('0x25')](function(){return _0x1953c8;});})['then'](function(){_0x177644[_0xd9e8('0x1b')](0xcc)[_0xd9e8('0x1c')]();});}};}function handleEntityNotFound(_0x29dec4,_0x2cd68e){return function(_0x2bfbeb){if(!_0x2bfbeb){_0x29dec4[_0xd9e8('0x1a')](0x194);}return _0x2bfbeb;};}function handleError(_0x10b980,_0x48c939){_0x48c939=_0x48c939||0x1f4;return function(_0x21965e){logger['error'](_0x21965e['stack']);if(_0x21965e[_0xd9e8('0x2a')]){delete _0x21965e['name'];}_0x10b980[_0xd9e8('0x1b')](_0x48c939)[_0xd9e8('0x2b')](_0x21965e);};}exports[_0xd9e8('0x2c')]=function(_0x4fb3fb,_0x421ac3){var _0x3587bf={},_0x1825c4={},_0x3d712d={'count':0x0,'rows':[]};return db['CmCompany'][_0xd9e8('0x2d')]()[_0xd9e8('0x25')](function(_0x983d9d){_0x1825c4[_0xd9e8('0x2e')]=_['keys'](_0x983d9d);_0x1825c4['query']=_[_0xd9e8('0x2f')](_0x4fb3fb[_0xd9e8('0x30')]);_0x1825c4['filters']=_[_0xd9e8('0x31')](_0x1825c4[_0xd9e8('0x2e')],_0x1825c4[_0xd9e8('0x30')]);_0x3587bf[_0xd9e8('0x32')]=_['intersection'](_0x1825c4['model'],qs['fields'](_0x4fb3fb['query'][_0xd9e8('0x33')]));_0x3587bf['attributes']=_0x3587bf[_0xd9e8('0x32')][_0xd9e8('0x34')]?_0x3587bf[_0xd9e8('0x32')]:_0x1825c4[_0xd9e8('0x2e')];if(!_0x4fb3fb[_0xd9e8('0x30')][_0xd9e8('0x35')](_0xd9e8('0x36'))){_0x3587bf[_0xd9e8('0x20')]=qs['limit'](_0x4fb3fb['query'][_0xd9e8('0x20')]);_0x3587bf['offset']=qs[_0xd9e8('0x1d')](_0x4fb3fb[_0xd9e8('0x30')][_0xd9e8('0x1d')]);}_0x3587bf[_0xd9e8('0x37')]=qs[_0xd9e8('0x38')](_0x4fb3fb[_0xd9e8('0x30')][_0xd9e8('0x38')]);_0x3587bf[_0xd9e8('0x39')]=qs[_0xd9e8('0x3a')](_['pick'](_0x4fb3fb['query'],_0x1825c4[_0xd9e8('0x3a')]),_0x983d9d);if(_0x4fb3fb[_0xd9e8('0x30')]['filter']){_0x3587bf['where']=_[_0xd9e8('0x3b')](_0x3587bf[_0xd9e8('0x39')],{'$or':_[_0xd9e8('0x3c')](_0x3587bf[_0xd9e8('0x32')],function(_0x58f3f0){var _0x5e1070={};_0x5e1070[_0x58f3f0]={'$like':'%'+_0x4fb3fb['query'][_0xd9e8('0x3d')]+'%'};return _0x5e1070;})});}_0x3587bf=_[_0xd9e8('0x3b')]({},_0x3587bf,_0x4fb3fb[_0xd9e8('0x3e')]);var _0x54b8be={'where':_0x3587bf['where']};return db['CmCompany'][_0xd9e8('0x1f')](_0x54b8be)[_0xd9e8('0x25')](function(_0x4acf14){_0x3d712d[_0xd9e8('0x1f')]=_0x4acf14;if(_0x4fb3fb[_0xd9e8('0x30')]['includeAll']){_0x3587bf[_0xd9e8('0x3f')]=[{'all':!![]}];}return db[_0xd9e8('0x40')][_0xd9e8('0x41')](_0x3587bf);})['then'](function(_0x5be945){_0x3d712d[_0xd9e8('0x42')]=_0x5be945;return _0x3d712d;})[_0xd9e8('0x25')](respondWithFilteredResult(_0x421ac3,_0x3587bf))[_0xd9e8('0x43')](handleError(_0x421ac3,null));})[_0xd9e8('0x43')](handleError(_0x421ac3,null));};exports[_0xd9e8('0x44')]=function(_0x4c835b,_0x274a06){var _0x5b1e96={'raw':![],'where':{'id':_0x4c835b[_0xd9e8('0x45')]['id']}},_0x26b769={};_0x26b769['model']=_[_0xd9e8('0x2f')](db[_0xd9e8('0x40')][_0xd9e8('0x46')]);_0x26b769[_0xd9e8('0x30')]=_['keys'](_0x4c835b[_0xd9e8('0x30')]);_0x26b769[_0xd9e8('0x3a')]=_['intersection'](_0x26b769[_0xd9e8('0x2e')],_0x26b769[_0xd9e8('0x30')]);_0x5b1e96['attributes']=_['intersection'](_0x26b769[_0xd9e8('0x2e')],qs[_0xd9e8('0x33')](_0x4c835b['query'][_0xd9e8('0x33')]));_0x5b1e96[_0xd9e8('0x32')]=_0x5b1e96[_0xd9e8('0x32')][_0xd9e8('0x34')]?_0x5b1e96[_0xd9e8('0x32')]:_0x26b769[_0xd9e8('0x2e')];if(_0x4c835b['query']['includeAll']){_0x5b1e96[_0xd9e8('0x3f')]=[{'all':!![]}];}_0x5b1e96=_[_0xd9e8('0x3b')]({},_0x5b1e96,_0x4c835b['options']);return db[_0xd9e8('0x40')][_0xd9e8('0x47')](_0x5b1e96)['then'](handleEntityNotFound(_0x274a06,null))[_0xd9e8('0x25')](respondWithResult(_0x274a06,null))['catch'](handleError(_0x274a06,null));};exports['create']=function(_0x5a3fd0,_0x5a4ec5){return db[_0xd9e8('0x40')][_0xd9e8('0x48')](_0x5a3fd0[_0xd9e8('0x49')],{})[_0xd9e8('0x25')](function(_0xeb1bd7){var _0x4c7dd0=_0x5a3fd0[_0xd9e8('0x4a')][_0xd9e8('0x26')]({'plain':!![]});if(!_0x4c7dd0)throw new Error(_0xd9e8('0x4b'));if(_0x4c7dd0['role']===_0xd9e8('0x4a')){var _0x5733ad=_0xeb1bd7[_0xd9e8('0x26')]({'plain':!![]});var _0x5d6a30='Companies';return db[_0xd9e8('0x4c')][_0xd9e8('0x47')]({'where':{'name':_0x5d6a30,'userProfileId':_0x4c7dd0['userProfileId']},'raw':!![]})[_0xd9e8('0x25')](function(_0x38c550){if(_0x38c550&&_0x38c550[_0xd9e8('0x4d')]===0x0){return db['UserProfileResource']['create']({'name':_0x5733ad[_0xd9e8('0x2a')],'resourceId':_0x5733ad['id'],'type':_0x38c550[_0xd9e8('0x2a')],'sectionId':_0x38c550['id']},{})[_0xd9e8('0x25')](function(){return _0xeb1bd7;});}else{return _0xeb1bd7;}})['catch'](function(_0x333ce4){logger[_0xd9e8('0x4e')](_0xd9e8('0x4f'),_0x333ce4);throw _0x333ce4;});}return _0xeb1bd7;})['then'](respondWithResult(_0x5a4ec5,0xc9))[_0xd9e8('0x43')](handleError(_0x5a4ec5,null));};exports[_0xd9e8('0x50')]=function(_0x5d95be,_0x28dc02){if(_0x5d95be[_0xd9e8('0x49')]['id']){delete _0x5d95be[_0xd9e8('0x49')]['id'];}return db[_0xd9e8('0x40')][_0xd9e8('0x47')]({'where':{'id':_0x5d95be[_0xd9e8('0x45')]['id']}})[_0xd9e8('0x25')](handleEntityNotFound(_0x28dc02,null))[_0xd9e8('0x25')](saveUpdates(_0x5d95be[_0xd9e8('0x49')],null))[_0xd9e8('0x25')](respondWithResult(_0x28dc02,null))['catch'](handleError(_0x28dc02,null));};exports['destroy']=function(_0x8abb1c,_0x440d2e){return db[_0xd9e8('0x40')]['find']({'where':{'id':_0x8abb1c[_0xd9e8('0x45')]['id']}})[_0xd9e8('0x25')](handleEntityNotFound(_0x440d2e,null))[_0xd9e8('0x25')](removeEntity(_0x440d2e,null))[_0xd9e8('0x43')](handleError(_0x440d2e,null));};exports[_0xd9e8('0x2d')]=function(_0x5ca157,_0x45ad6d){return db[_0xd9e8('0x40')][_0xd9e8('0x2d')]()[_0xd9e8('0x25')](respondWithResult(_0x45ad6d,null))[_0xd9e8('0x43')](handleError(_0x45ad6d,null));};exports['addContacts']=function(_0x50bd1b,_0x5a5ac3,_0xd08bde){return db[_0xd9e8('0x51')][_0xd9e8('0x47')]({'where':{'id':_0x50bd1b[_0xd9e8('0x45')]['id']}})[_0xd9e8('0x25')](handleEntityNotFound(_0x5a5ac3,null))[_0xd9e8('0x25')](function(_0x5e80c7){if(_0x5e80c7){return _0x5e80c7[_0xd9e8('0x52')](_0x50bd1b['body'][_0xd9e8('0x53')],_['omit'](_0x50bd1b[_0xd9e8('0x49')],[_0xd9e8('0x53'),'id'])||{});}})['then'](respondWithResult(_0x5a5ac3,null))['catch'](handleError(_0x5a5ac3,null));};exports[_0xd9e8('0x54')]=function(_0x2317d2,_0x8a65a6,_0xc87c4b){var _0x3f2291={};var _0x5f3afb={};var _0x2973ce;var _0x44250f;return db[_0xd9e8('0x40')]['findOne']({'where':{'id':_0x2317d2[_0xd9e8('0x45')]['id']}})[_0xd9e8('0x25')](handleEntityNotFound(_0x8a65a6,null))['then'](function(_0x39c03e){if(_0x39c03e){_0x2973ce=_0x39c03e;_0x5f3afb[_0xd9e8('0x2e')]=_[_0xd9e8('0x2f')](db['CmContact'][_0xd9e8('0x46')]);_0x5f3afb['query']=_[_0xd9e8('0x2f')](_0x2317d2[_0xd9e8('0x30')]);_0x5f3afb[_0xd9e8('0x3a')]=_[_0xd9e8('0x31')](_0x5f3afb[_0xd9e8('0x2e')],_0x5f3afb[_0xd9e8('0x30')]);_0x3f2291[_0xd9e8('0x32')]=_[_0xd9e8('0x31')](_0x5f3afb[_0xd9e8('0x2e')],qs['fields'](_0x2317d2[_0xd9e8('0x30')][_0xd9e8('0x33')]));_0x3f2291['attributes']=_0x3f2291[_0xd9e8('0x32')]['length']?_0x3f2291[_0xd9e8('0x32')]:_0x5f3afb[_0xd9e8('0x2e')];_0x3f2291[_0xd9e8('0x37')]=qs[_0xd9e8('0x38')](_0x2317d2['query']['sort']);_0x3f2291[_0xd9e8('0x39')]=qs[_0xd9e8('0x3a')](_[_0xd9e8('0x55')](_0x2317d2[_0xd9e8('0x30')],_0x5f3afb[_0xd9e8('0x3a')]));if(_0x2317d2['query'][_0xd9e8('0x3d')]){_0x3f2291[_0xd9e8('0x39')]=_['merge'](_0x3f2291[_0xd9e8('0x39')],{'$or':_[_0xd9e8('0x3c')](_0x3f2291[_0xd9e8('0x32')],function(_0x4f2877){var _0xf1569a={};_0xf1569a[_0x4f2877]={'$like':'%'+_0x2317d2[_0xd9e8('0x30')][_0xd9e8('0x3d')]+'%'};return _0xf1569a;})});}_0x3f2291=_['merge']({},_0x3f2291,_0x2317d2[_0xd9e8('0x3e')]);return _0x2973ce[_0xd9e8('0x54')](_0x3f2291);}})[_0xd9e8('0x25')](function(_0x81e34c){if(_0x81e34c){_0x44250f=_0x81e34c[_0xd9e8('0x34')];if(!_0x2317d2[_0xd9e8('0x30')]['hasOwnProperty'](_0xd9e8('0x36'))){_0x3f2291['limit']=qs[_0xd9e8('0x20')](_0x2317d2[_0xd9e8('0x30')]['limit']);_0x3f2291[_0xd9e8('0x1d')]=qs[_0xd9e8('0x1d')](_0x2317d2[_0xd9e8('0x30')]['offset']);}return _0x2973ce[_0xd9e8('0x54')](_0x3f2291);}})[_0xd9e8('0x25')](function(_0x210c41){if(_0x210c41){return _0x210c41?{'count':_0x44250f,'rows':_0x210c41}:null;}})[_0xd9e8('0x25')](respondWithResult(_0x8a65a6,null))[_0xd9e8('0x43')](handleError(_0x8a65a6,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 8334f65..629fa40 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 _0xd699=['CmCompany','cm_companies','lodash','util','api','bluebird','path','rimraf','exports','define'];(function(_0x3e3f78,_0x1327e6){var _0x114b74=function(_0x1d0477){while(--_0x1d0477){_0x3e3f78['push'](_0x3e3f78['shift']());}};_0x114b74(++_0x1327e6);}(_0xd699,0xac));var _0x9d69=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0xd699[_0x2235bf];return _0x4c3a64;};'use strict';var _=require(_0x9d69('0x0'));var util=require(_0x9d69('0x1'));var logger=require('../../config/logger')(_0x9d69('0x2'));var moment=require('moment');var BPromise=require(_0x9d69('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9d69('0x4'));var rimraf=require(_0x9d69('0x5'));var config=require('../../config/environment');var attributes=require('./cmCompany.attributes');module[_0x9d69('0x6')]=function(_0x47019c,_0x4e7613){return _0x47019c[_0x9d69('0x7')](_0x9d69('0x8'),attributes,{'tableName':_0x9d69('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfe49=['../../config/logger','api','bluebird','request-promise','path','../../config/environment','exports','define','CmCompany','lodash','util'];(function(_0x1719e2,_0x31d2ab){var _0xe57b79=function(_0x3d6a4e){while(--_0x3d6a4e){_0x1719e2['push'](_0x1719e2['shift']());}};_0xe57b79(++_0x31d2ab);}(_0xfe49,0x1b6));var _0x9fe4=function(_0x332606,_0xb754ed){_0x332606=_0x332606-0x0;var _0x19736e=_0xfe49[_0x332606];return _0x19736e;};'use strict';var _=require(_0x9fe4('0x0'));var util=require(_0x9fe4('0x1'));var logger=require(_0x9fe4('0x2'))(_0x9fe4('0x3'));var moment=require('moment');var BPromise=require(_0x9fe4('0x4'));var rp=require(_0x9fe4('0x5'));var fs=require('fs');var path=require(_0x9fe4('0x6'));var rimraf=require('rimraf');var config=require(_0x9fe4('0x7'));var attributes=require('./cmCompany.attributes');module[_0x9fe4('0x8')]=function(_0x33aa39,_0x33f5c9){return _0x33aa39[_0x9fe4('0x9')](_0x9fe4('0xa'),attributes,{'tableName':'cm_companies','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 ff42c88..759168b 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 _0xeec4=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x56fb02,_0x179d7a){var _0x177f5b=function(_0x47e149){while(--_0x47e149){_0x56fb02['push'](_0x56fb02['shift']());}};_0x177f5b(++_0x179d7a);}(_0xeec4,0x76));var _0x4eec=function(_0x2a18b7,_0x5041c8){_0x2a18b7=_0x2a18b7-0x0;var _0x45e74e=_0xeec4[_0x2a18b7];return _0x45e74e;};'use strict';var _=require(_0x4eec('0x0'));var util=require(_0x4eec('0x1'));var moment=require(_0x4eec('0x2'));var BPromise=require(_0x4eec('0x3'));var rs=require(_0x4eec('0x4'));var fs=require('fs');var Redis=require(_0x4eec('0x5'));var db=require(_0x4eec('0x6'))['db'];var utils=require(_0x4eec('0x7'));var logger=require('../../config/logger')(_0x4eec('0x8'));var config=require(_0x4eec('0x9'));var jayson=require(_0x4eec('0xa'));var client=jayson[_0x4eec('0xb')][_0x4eec('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x547bf6,_0x4d9ab5,_0x5cbdc0){return new BPromise(function(_0x1662e5,_0x3eb6e2){return client[_0x4eec('0xd')](_0x547bf6,_0x5cbdc0)[_0x4eec('0xe')](function(_0x16fc86){logger[_0x4eec('0xf')](_0x4eec('0x10'),_0x4d9ab5,_0x4eec('0x11'));logger['debug'](_0x4eec('0x12'),_0x4d9ab5,'request\x20sent',JSON[_0x4eec('0x13')](_0x16fc86));if(_0x16fc86[_0x4eec('0x14')]){if(_0x16fc86[_0x4eec('0x14')][_0x4eec('0x15')]===0x1f4){logger[_0x4eec('0x14')](_0x4eec('0x10'),_0x4d9ab5,_0x16fc86[_0x4eec('0x14')][_0x4eec('0x16')]);return _0x3eb6e2(_0x16fc86[_0x4eec('0x14')][_0x4eec('0x16')]);}logger[_0x4eec('0x14')]('CmCompany,\x20%s,\x20%s',_0x4d9ab5,_0x16fc86[_0x4eec('0x14')][_0x4eec('0x16')]);return _0x1662e5(_0x16fc86['error']['message']);}else{logger[_0x4eec('0xf')]('CmCompany,\x20%s,\x20%s',_0x4d9ab5,_0x4eec('0x11'));_0x1662e5(_0x16fc86[_0x4eec('0x17')]['message']);}})[_0x4eec('0x18')](function(_0x53fa85){logger['error'](_0x4eec('0x10'),_0x4d9ab5,_0x53fa85);_0x3eb6e2(_0x53fa85);});});} \ No newline at end of file +var _0x71d5=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','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','lodash','util','moment'];(function(_0x15c421,_0x6366f7){var _0x5e5ed5=function(_0x206e66){while(--_0x206e66){_0x15c421['push'](_0x15c421['shift']());}};_0x5e5ed5(++_0x6366f7);}(_0x71d5,0x18d));var _0x571d=function(_0xe86606,_0x2804a3){_0xe86606=_0xe86606-0x0;var _0x7cbd97=_0x71d5[_0xe86606];return _0x7cbd97;};'use strict';var _=require(_0x571d('0x0'));var util=require(_0x571d('0x1'));var moment=require(_0x571d('0x2'));var BPromise=require('bluebird');var rs=require(_0x571d('0x3'));var fs=require('fs');var Redis=require(_0x571d('0x4'));var db=require(_0x571d('0x5'))['db'];var utils=require(_0x571d('0x6'));var logger=require('../../config/logger')(_0x571d('0x7'));var config=require(_0x571d('0x8'));var jayson=require(_0x571d('0x9'));var client=jayson[_0x571d('0xa')][_0x571d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x117a1d,_0x57a47a,_0x474589){return new BPromise(function(_0x401d25,_0x42cf4f){return client[_0x571d('0xc')](_0x117a1d,_0x474589)[_0x571d('0xd')](function(_0x23ded4){logger[_0x571d('0xe')]('CmCompany,\x20%s,\x20%s',_0x57a47a,_0x571d('0xf'));logger[_0x571d('0x10')](_0x571d('0x11'),_0x57a47a,_0x571d('0xf'),JSON[_0x571d('0x12')](_0x23ded4));if(_0x23ded4['error']){if(_0x23ded4[_0x571d('0x13')][_0x571d('0x14')]===0x1f4){logger['error'](_0x571d('0x15'),_0x57a47a,_0x23ded4[_0x571d('0x13')][_0x571d('0x16')]);return _0x42cf4f(_0x23ded4['error'][_0x571d('0x16')]);}logger[_0x571d('0x13')](_0x571d('0x15'),_0x57a47a,_0x23ded4['error']['message']);return _0x401d25(_0x23ded4[_0x571d('0x13')][_0x571d('0x16')]);}else{logger[_0x571d('0xe')]('CmCompany,\x20%s,\x20%s',_0x57a47a,'request\x20sent');_0x401d25(_0x23ded4[_0x571d('0x17')][_0x571d('0x16')]);}})[_0x571d('0x18')](function(_0x12a94a){logger['error']('CmCompany,\x20%s,\x20%s',_0x57a47a,_0x12a94a);_0x42cf4f(_0x12a94a);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index ec3f0f2..aa6a907 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 _0x7896=['fs-extra','../../config/environment','get','isAuthenticated','index','describe','/:id','post','create','/:id/contacts','addContacts','put','update','delete','exports','multer','path','connect-timeout','express','Router'];(function(_0x313945,_0x375b2d){var _0x3cb194=function(_0x4dbf23){while(--_0x4dbf23){_0x313945['push'](_0x313945['shift']());}};_0x3cb194(++_0x375b2d);}(_0x7896,0x127));var _0x6789=function(_0x1f6553,_0x278aa0){_0x1f6553=_0x1f6553-0x0;var _0x5206da=_0x7896[_0x1f6553];return _0x5206da;};'use strict';var multer=require(_0x6789('0x0'));var util=require('util');var path=require(_0x6789('0x1'));var timeout=require(_0x6789('0x2'));var express=require(_0x6789('0x3'));var router=express[_0x6789('0x4')]();var fs_extra=require(_0x6789('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6789('0x6'));var controller=require('./cmCompany.controller');router[_0x6789('0x7')]('/',auth[_0x6789('0x8')](),controller[_0x6789('0x9')]);router[_0x6789('0x7')]('/describe',auth[_0x6789('0x8')](),controller[_0x6789('0xa')]);router['get'](_0x6789('0xb'),auth[_0x6789('0x8')](),controller['show']);router[_0x6789('0x7')]('/:id/contacts',auth[_0x6789('0x8')](),controller['getContacts']);router[_0x6789('0xc')]('/',auth['isAuthenticated'](),controller[_0x6789('0xd')]);router[_0x6789('0xc')](_0x6789('0xe'),auth[_0x6789('0x8')](),controller[_0x6789('0xf')]);router[_0x6789('0x10')](_0x6789('0xb'),auth[_0x6789('0x8')](),controller[_0x6789('0x11')]);router[_0x6789('0x12')](_0x6789('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x6789('0x13')]=router; \ No newline at end of file +var _0x0913=['addContacts','put','update','delete','/:id','destroy','exports','multer','util','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','/:id/contacts','getContacts','post','create'];(function(_0x503817,_0x3e41e6){var _0x3cdb5b=function(_0x18d283){while(--_0x18d283){_0x503817['push'](_0x503817['shift']());}};_0x3cdb5b(++_0x3e41e6);}(_0x0913,0x1a5));var _0x3091=function(_0x3efd26,_0xcdb922){_0x3efd26=_0x3efd26-0x0;var _0x490209=_0x0913[_0x3efd26];return _0x490209;};'use strict';var multer=require(_0x3091('0x0'));var util=require(_0x3091('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x3091('0x2'));var auth=require(_0x3091('0x3'));var interaction=require(_0x3091('0x4'));var config=require(_0x3091('0x5'));var controller=require('./cmCompany.controller');router[_0x3091('0x6')]('/',auth[_0x3091('0x7')](),controller[_0x3091('0x8')]);router[_0x3091('0x6')](_0x3091('0x9'),auth['isAuthenticated'](),controller[_0x3091('0xa')]);router[_0x3091('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x3091('0xb')]);router['get'](_0x3091('0xc'),auth[_0x3091('0x7')](),controller[_0x3091('0xd')]);router[_0x3091('0xe')]('/',auth[_0x3091('0x7')](),controller[_0x3091('0xf')]);router[_0x3091('0xe')]('/:id/contacts',auth['isAuthenticated'](),controller[_0x3091('0x10')]);router[_0x3091('0x11')]('/:id',auth[_0x3091('0x7')](),controller[_0x3091('0x12')]);router[_0x3091('0x13')](_0x3091('0x14'),auth[_0x3091('0x7')](),controller[_0x3091('0x15')]);module[_0x3091('0x16')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 3ac74b5..dcd2b4a 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 _0x09ca=['STRING','INTEGER','UNSIGNED','NOW','lodash'];(function(_0x2d1438,_0x192bf1){var _0x4f5233=function(_0x10bb0f){while(--_0x10bb0f){_0x2d1438['push'](_0x2d1438['shift']());}};_0x4f5233(++_0x192bf1);}(_0x09ca,0x8b));var _0xa09c=function(_0x5a024a,_0x5e682f){_0x5a024a=_0x5a024a-0x0;var _0x5b2b06=_0x09ca[_0x5a024a];return _0x5b2b06;};'use strict';var _=require(_0xa09c('0x0'));var Sequelize=require('sequelize');module['exports']={'firstName':{'type':Sequelize[_0xa09c('0x1')],'allowNull':![]},'lastName':{'type':Sequelize[_0xa09c('0x1')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xa09c('0x1')]},'country':{'type':Sequelize[_0xa09c('0x1')]},'dateOfBirth':{'type':Sequelize[_0xa09c('0x1')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0xa09c('0x1')]},'mobile':{'type':Sequelize[_0xa09c('0x1')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xa09c('0x1')]},'url':{'type':Sequelize[_0xa09c('0x1')]},'facebook':{'type':Sequelize[_0xa09c('0x1')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0xa09c('0x1')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0xa09c('0x1')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0xa09c('0x1')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0xa09c('0x1')]},'UserId':{'type':Sequelize[_0xa09c('0x2')]},'AdditionalPhones':{'type':Sequelize[_0xa09c('0x1')]},'priority':{'type':Sequelize[_0xa09c('0x2')](0x2)[_0xa09c('0x3')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0xa09c('0x4')]},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xc509=['lodash','sequelize','exports','STRING','INTEGER','UNSIGNED','DATE'];(function(_0x5871a3,_0x5e9b24){var _0x52b7a9=function(_0x1fe38c){while(--_0x1fe38c){_0x5871a3['push'](_0x5871a3['shift']());}};_0x52b7a9(++_0x5e9b24);}(_0xc509,0x188));var _0x9c50=function(_0x788728,_0xeb5e4e){_0x788728=_0x788728-0x0;var _0x46bd2b=_0xc509[_0x788728];return _0x46bd2b;};'use strict';var _=require(_0x9c50('0x0'));var Sequelize=require(_0x9c50('0x1'));module[_0x9c50('0x2')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x9c50('0x3')]},'street':{'type':Sequelize[_0x9c50('0x3')]},'postalCode':{'type':Sequelize[_0x9c50('0x3')]},'city':{'type':Sequelize[_0x9c50('0x3')]},'country':{'type':Sequelize[_0x9c50('0x3')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x9c50('0x3')]},'mobile':{'type':Sequelize[_0x9c50('0x3')]},'fax':{'type':Sequelize[_0x9c50('0x3')]},'email':{'type':Sequelize[_0x9c50('0x3')]},'url':{'type':Sequelize[_0x9c50('0x3')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x9c50('0x3')]},'skype':{'type':Sequelize[_0x9c50('0x3')]},'teams':{'type':Sequelize[_0x9c50('0x3')]},'viber':{'type':Sequelize[_0x9c50('0x3')]},'line':{'type':Sequelize[_0x9c50('0x3')]},'wechat':{'type':Sequelize[_0x9c50('0x3')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x9c50('0x4')]},'AdditionalPhones':{'type':Sequelize[_0x9c50('0x3')]},'priority':{'type':Sequelize[_0x9c50('0x4')](0x2)[_0x9c50('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x9c50('0x6')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0x9c50('0x4')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 3a6c922..5257ab5 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 _0xd331=['each','duplicates','$or','push','where','ListId','spread','contact','all','show','Tag','Tags','tag','Phones','ContactItemType','ItemType','sequelize','literal','Phones.OrderBy','isNil','$and','omit','map','format','cf_%d','isEmpty','table','cm_contacts','setFields','id\x20=\x20?','text','values','phone','getTags','findOne','model','rawAttributes','intersection','attributes','fields','order','sort','filters','pick','filter','options','nolimit','limit','setTags','ids','setAdditionalPhones','CmContactHasItem','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','bulkCreate','getAdditionalPhones','PHONE','`ItemType`.OrderBy','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','hopperId','getHoppers','ContactId','includeAll','include','rows','getHopperHistories','getHopperFinals','getJscriptySessions','uploadCsv','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','split','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','pid','send','createReadStream','parse','meta','import','No\x20ListId\x20specified','binding','stringify','message','start\x20child\x20process\x20correctly!','importUpdates','User','agent','../../components/import/cm/csvUpdates','error\x20child\x20process','mail','sms','openchannel','fax','whatsapp','voice','-createdAt','channel','includes','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','uniqueid','type','source','destination','starttime','duration','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','DESC','VoiceCallReport','findAndCountAll','chat','Account','closed','closedAt','note','secondDisposition','thirdDisposition','key','Owner','customerPort','ratingType','ratingValue','referer','substatus','threadId','Interaction','sortBy','reverse','slice','bluebird','path','lodash','papaparse','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/environment/shared','redis','defaults','localhost','socket.io-emitter','register','status','undefined','count','offset','set','Content-Range','json','update','then','destroy','end','stack','name','index','describe','findAll','user','find','params','catch','CmContact','tags','keys','startsWith','cf_','columnName','displayName','query','analytics','CmCustomField','length','alias','custom','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','forEach','hasOwnProperty','merge','body','from','get','mergeWith','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','ChatInteraction','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','ChatQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappQueueReport','create','dialTimezone','timezones','utcOffset','additionalPhones'];(function(_0x30fffc,_0x23cca9){var _0x3ae152=function(_0x1c6b2a){while(--_0x1c6b2a){_0x30fffc['push'](_0x30fffc['shift']());}};_0x3ae152(++_0x23cca9);}(_0xd331,0x19a));var _0x1d33=function(_0x48c787,_0x5cb427){_0x48c787=_0x48c787-0x0;var _0x5b44ad=_0xd331[_0x48c787];return _0x5b44ad;};'use strict';var moment=require('moment');var BPromise=require(_0x1d33('0x0'));var util=require('util');var path=require(_0x1d33('0x1'));var fs=require('fs');var _=require(_0x1d33('0x2'));var squel=require('squel');var Papa=require(_0x1d33('0x3'));var Redis=require('ioredis');var contacts=require(_0x1d33('0x4'));var qs=require(_0x1d33('0x5'));var logger=require(_0x1d33('0x6'))(_0x1d33('0x7'));var config=require(_0x1d33('0x8'));var shared=require(_0x1d33('0x9'));var db=require('../../mysqldb')['db'];config[_0x1d33('0xa')]=_[_0x1d33('0xb')](config[_0x1d33('0xa')],{'host':_0x1d33('0xc'),'port':0x18eb});var socket=require(_0x1d33('0xd'))(new Redis(config['redis']));require('./cmContact.socket')[_0x1d33('0xe')](socket);function respondWithResult(_0x3f236b,_0x4c079d){_0x4c079d=_0x4c079d||0xc8;return function(_0x411d35){if(_0x411d35){return _0x3f236b[_0x1d33('0xf')](_0x4c079d)['json'](_0x411d35);}};}function respondWithFilteredResult(_0x3a3248,_0x34def1){return function(_0x5e18a8){if(_0x5e18a8){var _0x24c8aa=typeof _0x34def1['offset']===_0x1d33('0x10')&&typeof _0x34def1['limit']===_0x1d33('0x10');var _0x378894=_0x5e18a8[_0x1d33('0x11')];var _0x50378b=_0x24c8aa?0x0:_0x34def1[_0x1d33('0x12')];var _0x17025b=_0x24c8aa?_0x5e18a8['count']:_0x34def1['offset']+_0x34def1['limit'];var _0x1b1b37;if(_0x17025b>=_0x378894){_0x17025b=_0x378894;_0x1b1b37=0xc8;}else{_0x1b1b37=0xce;}_0x3a3248[_0x1d33('0xf')](_0x1b1b37);return _0x3a3248[_0x1d33('0x13')](_0x1d33('0x14'),_0x50378b+'-'+_0x17025b+'/'+_0x378894)[_0x1d33('0x15')](_0x5e18a8);}return null;};}function saveUpdates(_0x26a220){return function(_0x51716d){if(_0x51716d){return _0x51716d[_0x1d33('0x16')](_0x26a220)[_0x1d33('0x17')](function(_0x43655e){return _0x43655e;});}return null;};}function removeEntity(_0x4b70bc){return function(_0x1bb91a){if(_0x1bb91a){return _0x1bb91a[_0x1d33('0x18')]()[_0x1d33('0x17')](function(){_0x4b70bc[_0x1d33('0xf')](0xcc)[_0x1d33('0x19')]();});}};}function handleEntityNotFound(_0x2f2db2){return function(_0x2e8dca){if(!_0x2e8dca){_0x2f2db2['sendStatus'](0x194);}return _0x2e8dca;};}function handleError(_0x50e58b,_0x3cc14e){_0x3cc14e=_0x3cc14e||0x1f4;return function(_0x3cdceb){logger['error'](_0x3cdceb[_0x1d33('0x1a')]);if(_0x3cdceb[_0x1d33('0x1b')]){delete _0x3cdceb[_0x1d33('0x1b')];}_0x50e58b[_0x1d33('0xf')](_0x3cc14e)['send'](_0x3cdceb);};}exports[_0x1d33('0x1c')]=function(_0x15d7f1,_0x1423f9){var _0x1634de={};return contacts[_0x1d33('0x1d')]()['then'](function(_0x3b8440){_0x1634de=qs['getOptions'](_0x3b8440,_0x15d7f1);return contacts[_0x1d33('0x1e')](_0x15d7f1['query'],_0x15d7f1[_0x1d33('0x1f')],_0x1634de,_0x3b8440);})[_0x1d33('0x17')](respondWithFilteredResult(_0x1423f9,_0x1634de))['catch'](handleError(_0x1423f9,null));};exports[_0x1d33('0x18')]=function(_0x236da2,_0x17f21e){return db['CmContact'][_0x1d33('0x20')]({'where':{'id':_0x236da2[_0x1d33('0x21')]['id']}})[_0x1d33('0x17')](handleEntityNotFound(_0x17f21e,null))['then'](removeEntity(_0x17f21e,null))[_0x1d33('0x22')](handleError(_0x17f21e,null));};exports[_0x1d33('0x1d')]=function(_0x132278,_0x14aa20){return db[_0x1d33('0x23')][_0x1d33('0x1d')]()[_0x1d33('0x17')](function(_0x22f985){delete _0x22f985[_0x1d33('0x24')];for(var _0x101b6d=0x0;_0x101b6d0x0){return new Promise(function(_0x151638){var _0x2cdc65=[];for(var _0x3a3536=0x0;_0x3a3536<_0x1feddd[_0x1d33('0x2d')];_0x3a3536++){_0x2cdc65['push'](insertAdditionalPhones(_0x1feddd[_0x3a3536][_0x1d33('0x5b')],_0x1feddd[_0x3a3536][_0x1d33('0x53')]));}Promise[_0x1d33('0x5c')](_0x2cdc65)[_0x1d33('0x17')](function(){_0x151638(0x1);});})[_0x1d33('0x17')](function(){return{'success':_0x14a152,'failure':_0xeafb1e,'duplicates':_0x6e05dc};});}else{return{'success':_0x14a152,'failure':_0xeafb1e,'duplicates':_0x6e05dc};}}})[_0x1d33('0x17')](respondWithResult(_0x40ffd0,0xc9))[_0x1d33('0x22')](handleError(_0x40ffd0,null));};exports[_0x1d33('0x5d')]=function(_0x5615c7,_0x524954){var _0x3a7254;return db['CmContact']['describe']()[_0x1d33('0x17')](function(_0xad57ef){return db['CmContact'][_0x1d33('0x20')]({'where':{'id':_0x5615c7[_0x1d33('0x21')]['id']},'include':[{'model':db[_0x1d33('0x5e')],'as':_0x1d33('0x5f'),'attributes':['id','name','color'],'required':_0x5615c7['query'][_0x1d33('0x60')]?!![]:![]},{'model':db['CmContactHasItem'],'as':_0x1d33('0x61'),'where':{'CmContactId':_0x5615c7[_0x1d33('0x21')]['id']},'required':![],'include':[{'model':db[_0x1d33('0x62')],'as':_0x1d33('0x63')}]}],'order':[db[_0x1d33('0x64')][_0x1d33('0x65')](_0x1d33('0x66'))],'attributes':_[_0x1d33('0x25')](_0xad57ef)});})[_0x1d33('0x17')](function(_0x32c554){if(!_[_0x1d33('0x67')](_0x32c554)){_0x3a7254=_0x32c554[_0x1d33('0x36')]({'plain':!![]});var _0x4fb8fb={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x32c554&&_0x32c554[_0x1d33('0x59')]){if(_0x32c554[_0x1d33('0x59')]){_0x4fb8fb[_0x1d33('0x58')][_0x1d33('0x68')]['push']({'ListId':{'$ne':_0x32c554[_0x1d33('0x59')]}});}}return db[_0x1d33('0x2c')][_0x1d33('0x1e')](_0x4fb8fb);}})[_0x1d33('0x17')](function(_0x5b2a33){if(!_[_0x1d33('0x67')](_0x5b2a33)){return _[_0x1d33('0x69')](_0x3a7254,_[_0x1d33('0x6a')](_0x5b2a33,function(_0x199127){return util['format']('cf_%d',_0x199127['id']);}));}})['then'](handleEntityNotFound(_0x524954,null))[_0x1d33('0x17')](respondWithResult(_0x524954,null))['catch'](handleError(_0x524954,null));};exports[_0x1d33('0x16')]=function(_0x4c0455,_0x4e11b8){var _0x236ac7;if(_0x4c0455[_0x1d33('0x34')]['id']){delete _0x4c0455[_0x1d33('0x34')]['id'];}if(!_[_0x1d33('0x67')](_0x4c0455[_0x1d33('0x34')][_0x1d33('0x50')])){var _0x22c36b=_0x4c0455[_0x1d33('0x34')]['dialTimezone'];if(!_[_0x1d33('0x67')](shared[_0x1d33('0x51')][_0x22c36b]))_0x4c0455[_0x1d33('0x34')][_0x1d33('0x52')]=shared['timezones'][_0x22c36b][_0x1d33('0x52')];}return db[_0x1d33('0x23')][_0x1d33('0x20')]({'where':{'id':_0x4c0455[_0x1d33('0x21')]['id']}})[_0x1d33('0x17')](handleEntityNotFound(_0x4e11b8,null))[_0x1d33('0x17')](saveUpdates(_0x4c0455['body'],null))[_0x1d33('0x17')](function(_0x312661){_0x236ac7=_0x312661;var _0x3c5c35={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x312661&&_0x312661[_0x1d33('0x59')]){if(_0x312661['ListId']){_0x3c5c35[_0x1d33('0x58')][_0x1d33('0x68')]['push']({'ListId':{'$ne':_0x312661['ListId']}});}}return db[_0x1d33('0x2c')][_0x1d33('0x1e')](_0x3c5c35);})[_0x1d33('0x17')](function(_0x5511df){if(_0x5511df){return _[_0x1d33('0x69')](_['pickBy'](_0x4c0455[_0x1d33('0x34')],function(_0x3b1988,_0x55c2a7){return _['startsWith'](_0x55c2a7,_0x1d33('0x27'));}),_[_0x1d33('0x6a')](_0x5511df,function(_0x3626a8){return util[_0x1d33('0x6b')](_0x1d33('0x6c'),_0x3626a8['id']);}));}})['then'](function(_0x3e120e){if(_0x3e120e&&!_[_0x1d33('0x6d')](_0x3e120e)){var _0x444039=squel[_0x1d33('0x16')]()[_0x1d33('0x6e')](_0x1d33('0x6f'))[_0x1d33('0x70')](_0x3e120e)[_0x1d33('0x58')](_0x1d33('0x71'),_0x4c0455[_0x1d33('0x21')]['id'])['toParam']();return db[_0x1d33('0x64')]['query'](_0x444039[_0x1d33('0x72')],{'replacements':_0x444039[_0x1d33('0x73')]});}})[_0x1d33('0x17')](function(){if(_0x4c0455[_0x1d33('0x34')][_0x1d33('0x74')]&&_0x236ac7){return db[_0x1d33('0x3c')][_0x1d33('0x16')]({'phone':_0x4c0455[_0x1d33('0x34')][_0x1d33('0x74')],'OrderBy':0x0},{'where':{'ContactId':_0x236ac7['id']}});}})[_0x1d33('0x17')](function(){return _0x236ac7;})[_0x1d33('0x17')](respondWithResult(_0x4e11b8,null))['catch'](handleError(_0x4e11b8,null));};exports[_0x1d33('0x75')]=function(_0x4dd0a7,_0x468e24){var _0x75ba20={};var _0x1b8577={};var _0x42a9af;var _0x3cd1a1;return db[_0x1d33('0x23')][_0x1d33('0x76')]({'where':{'id':_0x4dd0a7[_0x1d33('0x21')]['id']}})[_0x1d33('0x17')](handleEntityNotFound(_0x468e24,null))[_0x1d33('0x17')](function(_0x37dfe6){if(_0x37dfe6){_0x42a9af=_0x37dfe6;_0x1b8577[_0x1d33('0x77')]=_['keys'](db['Tag'][_0x1d33('0x78')]);_0x1b8577['query']=_[_0x1d33('0x25')](_0x4dd0a7[_0x1d33('0x2a')]);_0x1b8577['filters']=_[_0x1d33('0x79')](_0x1b8577['model'],_0x1b8577[_0x1d33('0x2a')]);_0x75ba20[_0x1d33('0x7a')]=_['intersection'](_0x1b8577[_0x1d33('0x77')],qs[_0x1d33('0x7b')](_0x4dd0a7[_0x1d33('0x2a')][_0x1d33('0x7b')]));_0x75ba20['attributes']=_0x75ba20[_0x1d33('0x7a')][_0x1d33('0x2d')]?_0x75ba20['attributes']:_0x1b8577[_0x1d33('0x77')];_0x75ba20[_0x1d33('0x7c')]=qs[_0x1d33('0x7d')](_0x4dd0a7['query']['sort']);_0x75ba20[_0x1d33('0x58')]=qs[_0x1d33('0x7e')](_[_0x1d33('0x7f')](_0x4dd0a7[_0x1d33('0x2a')],_0x1b8577['filters']));if(_0x4dd0a7[_0x1d33('0x2a')][_0x1d33('0x80')]){_0x75ba20['where']=_[_0x1d33('0x33')](_0x75ba20['where'],{'$or':_[_0x1d33('0x6a')](_0x75ba20['attributes'],function(_0x4f06fd){var _0x4610ba={};_0x4610ba[_0x4f06fd]={'$like':'%'+_0x4dd0a7[_0x1d33('0x2a')][_0x1d33('0x80')]+'%'};return _0x4610ba;})});}_0x75ba20=_['merge']({},_0x75ba20,_0x4dd0a7[_0x1d33('0x81')]);return _0x42a9af[_0x1d33('0x75')](_0x75ba20);}})[_0x1d33('0x17')](function(_0x4eb26b){if(_0x4eb26b){_0x3cd1a1=_0x4eb26b['length'];if(!_0x4dd0a7['query'][_0x1d33('0x32')](_0x1d33('0x82'))){_0x75ba20['limit']=qs[_0x1d33('0x83')](_0x4dd0a7[_0x1d33('0x2a')]['limit']);_0x75ba20[_0x1d33('0x12')]=qs['offset'](_0x4dd0a7[_0x1d33('0x2a')]['offset']);}return _0x42a9af[_0x1d33('0x75')](_0x75ba20);}})[_0x1d33('0x17')](function(_0x48816f){if(_0x48816f){return _0x48816f?{'count':_0x3cd1a1,'rows':_0x48816f}:null;}})[_0x1d33('0x17')](respondWithResult(_0x468e24,null))[_0x1d33('0x22')](handleError(_0x468e24,null));};exports[_0x1d33('0x84')]=function(_0x21a972,_0x350aa7){if(_0x21a972[_0x1d33('0x34')]['id']){delete _0x21a972['body']['id'];}return db[_0x1d33('0x23')][_0x1d33('0x76')]({'where':{'id':_0x21a972[_0x1d33('0x21')]['id']}})[_0x1d33('0x17')](handleEntityNotFound(_0x350aa7,null))['then'](function(_0x377ebc){if(_0x377ebc){return _0x377ebc[_0x1d33('0x84')](_0x21a972[_0x1d33('0x34')][_0x1d33('0x85')]||[]);}return null;})['then'](respondWithResult(_0x350aa7,null))['catch'](handleError(_0x350aa7,null));};exports[_0x1d33('0x86')]=function(_0x2afca6,_0x418fbd){var _0x403bdd=[];_0x403bdd[_0x1d33('0x57')](addAdditionalPhones(_0x2afca6[_0x1d33('0x34')]));Promise[_0x1d33('0x5c')](_0x403bdd)[_0x1d33('0x17')](function(){_0x403bdd=[];_0x403bdd['push'](deleteCmHopperPhones(_0x2afca6[_0x1d33('0x34')]['id']));_0x403bdd[_0x1d33('0x57')](addCmHopperPhones(_0x2afca6[_0x1d33('0x34')]['id']));Promise['all'](_0x403bdd)[_0x1d33('0x17')](function(){return[0x1];})['then'](respondWithResult(_0x418fbd,null));});};function addAdditionalPhones(_0x2d71c1){var _0x3c7e41;return new Promise(function(_0x4e0980){return db[_0x1d33('0x87')][_0x1d33('0x18')]({'where':{'CmContactId':_0x2d71c1['id']}})[_0x1d33('0x17')](function(){db[_0x1d33('0x62')]['findAll']({'raw':!![],'attributes':['id',_0x1d33('0x88')]})['then'](function(_0x33645a){var _0x5865fc=[];for(var _0x56ed83=0x0;_0x56ed83<_0x2d71c1[_0x1d33('0x89')][_0x1d33('0x2d')];_0x56ed83++){var _0x153764=_0x2d71c1['item_types']?_['isNil'](_0x2d71c1[_0x1d33('0x8a')][_0x56ed83])?'':_0x2d71c1[_0x1d33('0x8a')][_0x56ed83]:_0x2d71c1[_0x1d33('0x89')][_0x56ed83][_0x1d33('0x8b')]?_0x2d71c1[_0x1d33('0x89')][_0x56ed83][_0x1d33('0x8b')]:'';var _0x578e88=_[_0x1d33('0x67')](_0x2d71c1[_0x1d33('0x89')][_0x56ed83][_0x1d33('0x8c')])?'':_0x2d71c1[_0x1d33('0x89')][_0x56ed83][_0x1d33('0x8c')];var _0x19a716=_0x153764+':'+_0x2d71c1[_0x1d33('0x89')][_0x56ed83][_0x1d33('0x74')]+'§'+_0x578e88;if(_[_0x1d33('0x67')](_0x3c7e41))_0x3c7e41=_0x19a716;else _0x3c7e41+=';'+_0x19a716;var _0x363e72=null;var _0x1706cc=null;if(_0x2d71c1['item_types']){if(!_[_0x1d33('0x67')](_0x2d71c1[_0x1d33('0x8a')][_0x56ed83])){_0x1706cc=_[_0x1d33('0x20')](_0x33645a,function(_0x437485){return _0x437485['id']===_0x2d71c1['item_types'][_0x56ed83];});if(!_[_0x1d33('0x67')](_0x1706cc)){_0x363e72=_0x1706cc[_0x1d33('0x88')];}}}else{if(!_[_0x1d33('0x67')](_0x2d71c1[_0x1d33('0x89')][_0x56ed83])){_0x1706cc=_['find'](_0x33645a,function(_0x2ad596){return _0x2ad596['id']===_0x2d71c1[_0x1d33('0x89')][_0x56ed83][_0x1d33('0x8b')];});if(!_[_0x1d33('0x67')](_0x1706cc)){_0x363e72=_0x56ed83;}}}if(_[_0x1d33('0x67')](_0x363e72)){_0x363e72=0x64;}_0x5865fc[_0x1d33('0x57')](addAdditionalPhone(_0x2d71c1['id'],_0x2d71c1[_0x1d33('0x89')][_0x56ed83][_0x1d33('0x74')],_0x2d71c1[_0x1d33('0x8a')]?_[_0x1d33('0x67')](_0x2d71c1[_0x1d33('0x8a')][_0x56ed83])?null:_0x2d71c1[_0x1d33('0x8a')][_0x56ed83]:_0x2d71c1['items'][_0x56ed83][_0x1d33('0x8b')]?_0x2d71c1[_0x1d33('0x89')][_0x56ed83][_0x1d33('0x8b')]:null,_0x363e72,_0x578e88));}Promise[_0x1d33('0x5c')](_0x5865fc)[_0x1d33('0x17')](function(){db[_0x1d33('0x23')][_0x1d33('0x16')]({'AdditionalPhones':_0x3c7e41},{'where':{'id':_0x2d71c1['id']}})[_0x1d33('0x17')](function(){_0x4e0980(0x1);});});});});});}function addAdditionalPhone(_0x2f8c3d,_0x459fdd,_0x361f2a,_0x31e15a,_0x132ef2){return db['CmContactHasItem']['find']({'where':{'CmContactId':_0x2f8c3d,'item':_0x459fdd}})[_0x1d33('0x17')](function(_0x4b20e8){if(_0x4b20e8)logger['info'](_0x1d33('0x8d'),_0x4b20e8);else{db[_0x1d33('0x87')][_0x1d33('0x4f')]({'CmContactId':_0x2f8c3d,'item':_0x459fdd,'ItemTypeId':_0x361f2a,'OrderBy':_0x31e15a,'ItemClass':'PHONE','description':_0x132ef2});}});}function deleteCmHopperPhones(_0x2843a5){return new Promise(function(_0x2772d7){return db[_0x1d33('0x3c')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x2843a5}})[_0x1d33('0x17')](function(_0x5e2d36){db[_0x1d33('0x8e')][_0x1d33('0x18')]({'where':{'CmHopperId':{'$in':_[_0x1d33('0x6a')](_0x5e2d36,'id')}}});})['then'](function(){_0x2772d7(0x1);});});}function addCmHopperPhones(_0xfad5a1){return new Promise(function(_0x4f06a4){return db['CmHopper']['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0xfad5a1}})[_0x1d33('0x17')](function(_0x49015c){var _0x26a534=[];_[_0x1d33('0x6a')](_0x49015c,function(_0x5419ad){_0x26a534[_0x1d33('0x57')](createCmHopperPhone(_0xfad5a1,_0x5419ad['id']));});Promise[_0x1d33('0x5c')](_0x26a534)[_0x1d33('0x17')](function(){_0x4f06a4(0x1);});});});}function createCmHopperPhone(_0x146f1c,_0x548a7b){return new Promise(function(_0x11943e){db['CmContactHasItem']['findAll']({'raw':!![],'attributes':['item',_0x1d33('0x88')],'where':{'CmContactId':_0x146f1c,'ItemClass':'PHONE'},'include':[{'model':db[_0x1d33('0x62')],'attributes':[_0x1d33('0x88')],'as':'ItemType'}],'order':['OrderBy',db['sequelize'][_0x1d33('0x65')]('`ItemType`.OrderBy')]})[_0x1d33('0x17')](function(_0x1a451c){var _0x4b5eac=0x1;var _0x636b1b=_[_0x1d33('0x6a')](_0x1a451c,function(_0x596463){_0x596463['CmHopperId']=_0x548a7b;_0x596463['phone']=_0x596463[_0x1d33('0x8f')];_0x596463[_0x1d33('0x88')]=_0x4b5eac;delete _0x596463['ItemType.OrderBy'];_0x4b5eac=_0x4b5eac+0x1;return _0x596463;});return db[_0x1d33('0x8e')][_0x1d33('0x90')](_0x636b1b,{});})[_0x1d33('0x17')](function(){_0x11943e(0x1);});});}function insertAdditionalPhones(_0x5e2f25,_0x5a1868){return new Promise(function(_0x49ab0d){var _0x499359=[];for(var _0x149dd2=0x0;_0x149dd2<_0x5a1868['length'];_0x149dd2++){var _0x468cdd=_0x5a1868[_0x149dd2];_0x499359['push'](parseContactItemType(_0x468cdd));}Promise[_0x1d33('0x5c')](_0x499359)[_0x1d33('0x17')](function(){var _0x3eff28={'id':_0x5e2f25['id'],'items':_0x5a1868};return addAdditionalPhones(_0x3eff28)[_0x1d33('0x17')](function(){return addCmHopperPhones(_0x5e2f25['id']);});})['then'](function(){_0x49ab0d(_0x5e2f25);});});}function parseContactItemType(_0x40771b){return new Promise(function(_0x1759e3){if(_0x40771b[_0x1d33('0x32')]('ItemTypeId')){_0x1759e3(_0x40771b);}else{return db[_0x1d33('0x62')][_0x1d33('0x20')]({'where':{'name':_0x40771b['ItemType']}})[_0x1d33('0x17')](function(_0x94d4ea){if(_['isNil'](_0x94d4ea))_0x40771b[_0x1d33('0x8b')]=null;else _0x40771b[_0x1d33('0x8b')]=_0x94d4ea['id'];_0x1759e3(_0x40771b);});}});}exports[_0x1d33('0x91')]=function(_0x55573a,_0x5d924f){return db[_0x1d33('0x87')][_0x1d33('0x1e')]({'raw':!![],'where':{'CmContactId':_0x55573a['params']['id'],'ItemClass':_0x1d33('0x92')},'include':[{'model':db[_0x1d33('0x62')],'as':_0x1d33('0x63')}],'order':[['OrderBy'],[db[_0x1d33('0x64')]['literal'](_0x1d33('0x93'))]]})[_0x1d33('0x17')](function(_0x30f9b5){return _0x30f9b5;})['then'](respondWithResult(_0x5d924f,null))['catch'](handleError(_0x5d924f,null));};exports[_0x1d33('0x94')]=function(_0x33e967,_0x2e4d69){return db[_0x1d33('0x87')][_0x1d33('0x1e')]({'raw':!![],'where':{'CmContactId':_0x33e967[_0x1d33('0x34')][_0x1d33('0x95')]}})[_0x1d33('0x17')](function(_0x2a0a38){var _0x4ed55d=_['map'](_0x2a0a38,function(_0x29332d){_0x29332d[_0x1d33('0x96')]=_0x33e967[_0x1d33('0x34')]['toContactId'];return _0x29332d;});return db[_0x1d33('0x87')][_0x1d33('0x90')](_0x4ed55d,{});})[_0x1d33('0x17')](function(){return addCmHopperPhones(_0x33e967['body'][_0x1d33('0x97')]);})[_0x1d33('0x17')](function(){return['ok'];})['then'](respondWithResult(_0x2e4d69,null))[_0x1d33('0x22')](handleError(_0x2e4d69,null));};exports['rescheduleAdditionalPhones']=function(_0x76f8eb,_0xa838b4){var _0x1b7e3c=[];_0x1b7e3c[_0x1d33('0x57')](createCmHopperPhone(_0x76f8eb[_0x1d33('0x34')]['id'],_0x76f8eb[_0x1d33('0x34')][_0x1d33('0x98')]));Promise[_0x1d33('0x5c')](_0x1b7e3c)['then'](function(){return[0x1];})['then'](respondWithResult(_0xa838b4,null));};exports[_0x1d33('0x99')]=function(_0x28a001,_0x1bc88a){var _0x308745={'raw':![],'where':{}};var _0x5e71ab={};var _0x23186c={'count':0x0,'rows':[]};return db[_0x1d33('0x23')]['findOne']({'where':{'id':_0x28a001[_0x1d33('0x21')]['id']}})[_0x1d33('0x17')](handleEntityNotFound(_0x1bc88a,null))[_0x1d33('0x17')](function(_0x27ede4){if(_0x27ede4){_0x5e71ab[_0x1d33('0x77')]=_[_0x1d33('0x25')](db[_0x1d33('0x3c')][_0x1d33('0x78')]);_0x5e71ab[_0x1d33('0x2a')]=_['keys'](_0x28a001[_0x1d33('0x2a')]);_0x5e71ab[_0x1d33('0x7e')]=_[_0x1d33('0x79')](_0x5e71ab[_0x1d33('0x77')],_0x5e71ab[_0x1d33('0x2a')]);_0x308745[_0x1d33('0x7a')]=_[_0x1d33('0x79')](_0x5e71ab[_0x1d33('0x77')],qs[_0x1d33('0x7b')](_0x28a001['query'][_0x1d33('0x7b')]));_0x308745[_0x1d33('0x7a')]=_0x308745[_0x1d33('0x7a')]['length']?_0x308745[_0x1d33('0x7a')]:_0x5e71ab[_0x1d33('0x77')];if(!_0x28a001['query'][_0x1d33('0x32')](_0x1d33('0x82'))){_0x308745[_0x1d33('0x83')]=qs['limit'](_0x28a001['query'][_0x1d33('0x83')]);_0x308745['offset']=qs['offset'](_0x28a001[_0x1d33('0x2a')][_0x1d33('0x12')]);}_0x308745['order']=qs[_0x1d33('0x7d')](_0x28a001[_0x1d33('0x2a')]['sort']);_0x308745['where']=qs['filters'](_[_0x1d33('0x7f')](_0x28a001[_0x1d33('0x2a')],_0x5e71ab[_0x1d33('0x7e')]));_0x308745[_0x1d33('0x58')][_0x1d33('0x9a')]=_0x27ede4['id'];if(_0x28a001[_0x1d33('0x2a')][_0x1d33('0x80')]){_0x308745[_0x1d33('0x58')]=_['merge'](_0x308745[_0x1d33('0x58')],{'$or':_['map'](_0x308745[_0x1d33('0x7a')],function(_0x35855d){var _0x2b3f16={};_0x2b3f16[_0x35855d]={'$like':'%'+_0x28a001[_0x1d33('0x2a')]['filter']+'%'};return _0x2b3f16;})});}_0x308745=_['merge']({},_0x308745,_0x28a001[_0x1d33('0x81')]);return db[_0x1d33('0x3c')][_0x1d33('0x11')]({'where':_0x308745['where']})[_0x1d33('0x17')](function(_0x2c652e){_0x23186c[_0x1d33('0x11')]=_0x2c652e;if(_0x28a001[_0x1d33('0x2a')][_0x1d33('0x9b')]){_0x308745[_0x1d33('0x9c')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x308745);})['then'](function(_0x5c2554){_0x23186c[_0x1d33('0x9d')]=_0x5c2554;return _0x23186c;});}})['then'](respondWithFilteredResult(_0x1bc88a,_0x308745))[_0x1d33('0x22')](handleError(_0x1bc88a,null));};exports[_0x1d33('0x9e')]=function(_0x3a17f3,_0x525bdb){var _0x2b3731={'raw':!![],'where':{}};var _0x374052={};var _0x4344bc={'count':0x0,'rows':[]};return db[_0x1d33('0x23')][_0x1d33('0x76')]({'where':{'id':_0x3a17f3['params']['id']}})['then'](handleEntityNotFound(_0x525bdb,null))['then'](function(_0x1fb85c){if(_0x1fb85c){_0x374052['model']=_[_0x1d33('0x25')](db[_0x1d33('0x49')]['rawAttributes']);_0x374052['query']=_[_0x1d33('0x25')](_0x3a17f3[_0x1d33('0x2a')]);_0x374052[_0x1d33('0x7e')]=_['intersection'](_0x374052[_0x1d33('0x77')],_0x374052[_0x1d33('0x2a')]);_0x2b3731[_0x1d33('0x7a')]=_[_0x1d33('0x79')](_0x374052['model'],qs[_0x1d33('0x7b')](_0x3a17f3[_0x1d33('0x2a')][_0x1d33('0x7b')]));_0x2b3731[_0x1d33('0x7a')]=_0x2b3731[_0x1d33('0x7a')][_0x1d33('0x2d')]?_0x2b3731[_0x1d33('0x7a')]:_0x374052[_0x1d33('0x77')];if(!_0x3a17f3['query'][_0x1d33('0x32')]('nolimit')){_0x2b3731[_0x1d33('0x83')]=qs[_0x1d33('0x83')](_0x3a17f3[_0x1d33('0x2a')][_0x1d33('0x83')]);_0x2b3731[_0x1d33('0x12')]=qs[_0x1d33('0x12')](_0x3a17f3[_0x1d33('0x2a')][_0x1d33('0x12')]);}_0x2b3731[_0x1d33('0x7c')]=qs[_0x1d33('0x7d')](_0x3a17f3[_0x1d33('0x2a')][_0x1d33('0x7d')]);_0x2b3731['where']=qs[_0x1d33('0x7e')](_['pick'](_0x3a17f3[_0x1d33('0x2a')],_0x374052[_0x1d33('0x7e')]));_0x2b3731[_0x1d33('0x58')]['ContactId']=_0x1fb85c['id'];if(_0x3a17f3[_0x1d33('0x2a')][_0x1d33('0x80')]){_0x2b3731[_0x1d33('0x58')]=_[_0x1d33('0x33')](_0x2b3731[_0x1d33('0x58')],{'$or':_[_0x1d33('0x6a')](_0x2b3731['attributes'],function(_0x286e34){var _0x3d6075={};_0x3d6075[_0x286e34]={'$like':'%'+_0x3a17f3[_0x1d33('0x2a')][_0x1d33('0x80')]+'%'};return _0x3d6075;})});}_0x2b3731=_[_0x1d33('0x33')]({},_0x2b3731,_0x3a17f3[_0x1d33('0x81')]);return db[_0x1d33('0x49')][_0x1d33('0x11')]({'where':_0x2b3731[_0x1d33('0x58')]})['then'](function(_0x3c7d0f){_0x4344bc[_0x1d33('0x11')]=_0x3c7d0f;if(_0x3a17f3[_0x1d33('0x2a')][_0x1d33('0x9b')]){_0x2b3731[_0x1d33('0x9c')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x2b3731);})[_0x1d33('0x17')](function(_0x2d1bcf){_0x4344bc['rows']=_0x2d1bcf;return _0x4344bc;});}})[_0x1d33('0x17')](respondWithFilteredResult(_0x525bdb,_0x2b3731))['catch'](handleError(_0x525bdb,null));};exports[_0x1d33('0x9f')]=function(_0x15a0bb,_0x5f3218){var _0x1a23f4={'raw':!![],'where':{}};var _0x19dbba={};var _0x457bdb={'count':0x0,'rows':[]};return db[_0x1d33('0x23')]['findOne']({'where':{'id':_0x15a0bb[_0x1d33('0x21')]['id']}})[_0x1d33('0x17')](handleEntityNotFound(_0x5f3218,null))[_0x1d33('0x17')](function(_0x51f43a){if(_0x51f43a){_0x19dbba[_0x1d33('0x77')]=_['keys'](db[_0x1d33('0x48')][_0x1d33('0x78')]);_0x19dbba['query']=_['keys'](_0x15a0bb['query']);_0x19dbba[_0x1d33('0x7e')]=_[_0x1d33('0x79')](_0x19dbba[_0x1d33('0x77')],_0x19dbba[_0x1d33('0x2a')]);_0x1a23f4[_0x1d33('0x7a')]=_[_0x1d33('0x79')](_0x19dbba[_0x1d33('0x77')],qs['fields'](_0x15a0bb[_0x1d33('0x2a')][_0x1d33('0x7b')]));_0x1a23f4[_0x1d33('0x7a')]=_0x1a23f4[_0x1d33('0x7a')][_0x1d33('0x2d')]?_0x1a23f4[_0x1d33('0x7a')]:_0x19dbba[_0x1d33('0x77')];if(!_0x15a0bb[_0x1d33('0x2a')][_0x1d33('0x32')](_0x1d33('0x82'))){_0x1a23f4[_0x1d33('0x83')]=qs[_0x1d33('0x83')](_0x15a0bb[_0x1d33('0x2a')][_0x1d33('0x83')]);_0x1a23f4[_0x1d33('0x12')]=qs[_0x1d33('0x12')](_0x15a0bb[_0x1d33('0x2a')][_0x1d33('0x12')]);}_0x1a23f4['order']=qs[_0x1d33('0x7d')](_0x15a0bb[_0x1d33('0x2a')][_0x1d33('0x7d')]);_0x1a23f4[_0x1d33('0x58')]=qs['filters'](_[_0x1d33('0x7f')](_0x15a0bb['query'],_0x19dbba[_0x1d33('0x7e')]));_0x1a23f4[_0x1d33('0x58')][_0x1d33('0x9a')]=_0x51f43a['id'];if(_0x15a0bb[_0x1d33('0x2a')]['filter']){_0x1a23f4[_0x1d33('0x58')]=_['merge'](_0x1a23f4['where'],{'$or':_[_0x1d33('0x6a')](_0x1a23f4[_0x1d33('0x7a')],function(_0x18ce24){var _0x296963={};_0x296963[_0x18ce24]={'$like':'%'+_0x15a0bb[_0x1d33('0x2a')][_0x1d33('0x80')]+'%'};return _0x296963;})});}_0x1a23f4=_[_0x1d33('0x33')]({},_0x1a23f4,_0x15a0bb['options']);return db[_0x1d33('0x48')][_0x1d33('0x11')]({'where':_0x1a23f4[_0x1d33('0x58')]})['then'](function(_0xea7079){_0x457bdb[_0x1d33('0x11')]=_0xea7079;if(_0x15a0bb['query'][_0x1d33('0x9b')]){_0x1a23f4[_0x1d33('0x9c')]=[{'all':!![]}];}return db[_0x1d33('0x48')][_0x1d33('0x1e')](_0x1a23f4);})[_0x1d33('0x17')](function(_0x4fda67){_0x457bdb[_0x1d33('0x9d')]=_0x4fda67;return _0x457bdb;});}})[_0x1d33('0x17')](respondWithFilteredResult(_0x5f3218,_0x1a23f4))[_0x1d33('0x22')](handleError(_0x5f3218,null));};exports[_0x1d33('0xa0')]=function(_0x2ebc88,_0x5d9354){var _0xecf27c={'raw':!![],'where':{}};var _0x16f4e3={};var _0xf06a27={'count':0x0,'rows':[]};return db[_0x1d33('0x23')][_0x1d33('0x76')]({'where':{'id':_0x2ebc88[_0x1d33('0x21')]['id']}})['then'](handleEntityNotFound(_0x5d9354,null))[_0x1d33('0x17')](function(_0xb54984){if(_0xb54984){_0x16f4e3[_0x1d33('0x77')]=_[_0x1d33('0x25')](db[_0x1d33('0x4c')]['rawAttributes']);_0x16f4e3[_0x1d33('0x2a')]=_[_0x1d33('0x25')](_0x2ebc88['query']);_0x16f4e3[_0x1d33('0x7e')]=_['intersection'](_0x16f4e3[_0x1d33('0x77')],_0x16f4e3[_0x1d33('0x2a')]);_0xecf27c[_0x1d33('0x7a')]=_[_0x1d33('0x79')](_0x16f4e3['model'],qs[_0x1d33('0x7b')](_0x2ebc88[_0x1d33('0x2a')][_0x1d33('0x7b')]));_0xecf27c['attributes']=_0xecf27c[_0x1d33('0x7a')][_0x1d33('0x2d')]?_0xecf27c['attributes']:_0x16f4e3[_0x1d33('0x77')];if(!_0x2ebc88['query'][_0x1d33('0x32')](_0x1d33('0x82'))){_0xecf27c['limit']=qs['limit'](_0x2ebc88['query'][_0x1d33('0x83')]);_0xecf27c[_0x1d33('0x12')]=qs[_0x1d33('0x12')](_0x2ebc88[_0x1d33('0x2a')]['offset']);}_0xecf27c[_0x1d33('0x7c')]=qs['sort'](_0x2ebc88[_0x1d33('0x2a')][_0x1d33('0x7d')]);_0xecf27c[_0x1d33('0x58')]=qs[_0x1d33('0x7e')](_[_0x1d33('0x7f')](_0x2ebc88[_0x1d33('0x2a')],_0x16f4e3[_0x1d33('0x7e')]));_0xecf27c[_0x1d33('0x58')][_0x1d33('0x9a')]=_0xb54984['id'];if(_0x2ebc88[_0x1d33('0x2a')][_0x1d33('0x80')]){_0xecf27c[_0x1d33('0x58')]=_[_0x1d33('0x33')](_0xecf27c[_0x1d33('0x58')],{'$or':_['map'](_0xecf27c[_0x1d33('0x7a')],function(_0x565719){var _0x66fa70={};_0x66fa70[_0x565719]={'$like':'%'+_0x2ebc88[_0x1d33('0x2a')]['filter']+'%'};return _0x66fa70;})});}_0xecf27c=_[_0x1d33('0x33')]({},_0xecf27c,_0x2ebc88[_0x1d33('0x81')]);return db['JscriptySessionReport']['count']({'where':_0xecf27c[_0x1d33('0x58')]})[_0x1d33('0x17')](function(_0x1f8527){_0xf06a27['count']=_0x1f8527;if(_0x2ebc88['query'][_0x1d33('0x9b')]){_0xecf27c['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0x1d33('0x1e')](_0xecf27c);})['then'](function(_0xbcdfd0){_0xf06a27[_0x1d33('0x9d')]=_0xbcdfd0;return _0xf06a27;});}})[_0x1d33('0x17')](respondWithFilteredResult(_0x5d9354,_0xecf27c))[_0x1d33('0x22')](handleError(_0x5d9354,null));};exports[_0x1d33('0xa1')]=function(_0x2930be,_0x3bb8e0){try{if(!_0x2930be[_0x1d33('0x34')][_0x1d33('0x59')]){throw new Error('No\x20ListId\x20specified');}if(!_0x2930be[_0x1d33('0x34')][_0x1d33('0xa2')]){throw new Error(_0x1d33('0xa3'));}if(!_0x2930be['body'][_0x1d33('0xa4')]){throw new Error(_0x1d33('0xa5'));}if(!_0x2930be[_0x1d33('0x34')][_0x1d33('0xa6')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x37bdd9=_0x2930be[_0x1d33('0x34')][_0x1d33('0xa2')][_0x1d33('0xa7')](',');var _0x228ae8=_0x2930be[_0x1d33('0x34')]['binding_values']['split'](',');if(!_0x37bdd9[_0x1d33('0x2d')]||!_0x228ae8['length']||_0x37bdd9[_0x1d33('0x2d')]!==_0x228ae8[_0x1d33('0x2d')]){throw new Error('Incorrect\x20binding\x20parameters\x20passed!');}_0x2930be[_0x1d33('0x34')][_0x1d33('0x7b')]=_[_0x1d33('0xa8')](_0x37bdd9,_0x228ae8);if(!_0x2930be[_0x1d33('0x34')][_0x1d33('0x7b')][_0x1d33('0x74')]){throw new Error(_0x1d33('0xa9'));}if(!_0x2930be['body']['fields'][_0x1d33('0xaa')]){throw new Error(_0x1d33('0xab'));}var _0x2ea6d9=path[_0x1d33('0x39')](config[_0x1d33('0xac')],_0x1d33('0xad'),_0x2930be[_0x1d33('0xae')][_0x1d33('0xaf')]);fs[_0x1d33('0xb0')](_0x2ea6d9,parseInt(_0x1d33('0xb1'),0x8));var _0x44b60f=require(_0x1d33('0xb2'))[_0x1d33('0xb3')](path[_0x1d33('0x39')](__dirname,_0x1d33('0xb4')),[_0x2ea6d9,_0x2930be['body']['binding_keys'],_0x2930be['body'][_0x1d33('0xa4')],_0x2930be[_0x1d33('0x34')][_0x1d33('0x59')],_0x2930be['body'][_0x1d33('0xb5')],_0x2930be[_0x1d33('0x34')]['duplicates'],_0x2930be[_0x1d33('0x34')]['socket_timestamp']]);return _0x3bb8e0[_0x1d33('0xf')](0xc8)[_0x1d33('0x15')]({'message':'File\x20uploaded\x20correctly!','pid':_0x44b60f[_0x1d33('0xb6')]});}catch(_0x4aa9dd){return _0x3bb8e0[_0x1d33('0xf')](0x1f4)[_0x1d33('0xb7')](_0x4aa9dd);}};exports['upload']=function(_0x503cd6,_0x4130f8){var _0x431efd=fs[_0x1d33('0xb8')](_0x503cd6[_0x1d33('0xae')][_0x1d33('0x1')]);Papa[_0x1d33('0xb9')](_0x431efd,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x5489ac){return _0x4130f8['status'](0xc8)[_0x1d33('0x15')]({'file':_0x503cd6[_0x1d33('0xae')],'fields':_0x5489ac[_0x1d33('0xba')]['fields']});}});};exports[_0x1d33('0xbb')]=function(_0x148a3b,_0x48620d){return db['User']['findAll']({'raw':!![],'attributes':['id'],'where':{'role':'agent'}})[_0x1d33('0x17')](function(_0x1a7daa){var _0x27009e=![];if(!_0x148a3b[_0x1d33('0x34')][_0x1d33('0x59')]){throw new Error(_0x1d33('0xbc'));}if(!_0x148a3b[_0x1d33('0x34')][_0x1d33('0xbd')][_0x1d33('0x74')]){throw new Error(_0x1d33('0xa9'));}if(!_0x148a3b[_0x1d33('0x34')][_0x1d33('0xbd')][_0x1d33('0xaa')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x148a3b['body'][_0x1d33('0xa6')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x545e7e=require('child_process')[_0x1d33('0xb3')](path['join'](__dirname,'../../components/import/cm/csv2'),[_0x148a3b[_0x1d33('0x21')]['id'],JSON[_0x1d33('0xbe')](_0x148a3b['body']),JSON['stringify'](_0x1a7daa)]);_0x545e7e['on'](_0x1d33('0xbf'),function(){_0x27009e=!![];return _0x48620d[_0x1d33('0xf')](0xc8)[_0x1d33('0x15')]({'message':_0x1d33('0xc0'),'pid':_0x545e7e[_0x1d33('0xb6')]});});_0x545e7e['on']('exit',function(_0x3b4b7d){if(_0x3b4b7d&&!_0x27009e){return _0x48620d[_0x1d33('0xf')](0x1f4)['json']({'message':'error\x20child\x20process','pid':_0x545e7e[_0x1d33('0xb6')]});}});})['catch'](handleError(_0x48620d,null));};exports[_0x1d33('0xc1')]=function(_0xc976d7,_0x48bf96){return db[_0x1d33('0xc2')][_0x1d33('0x1e')]({'raw':!![],'attributes':['id'],'where':{'role':_0x1d33('0xc3')}})[_0x1d33('0x17')](function(_0x260d1d){var _0xb48151=![];if(!_0xc976d7[_0x1d33('0x34')][_0x1d33('0x59')]){throw new Error(_0x1d33('0xbc'));}if(!_0xc976d7[_0x1d33('0x34')][_0x1d33('0xbd')][_0x1d33('0x74')]){throw new Error(_0x1d33('0xa9'));}if(!_0xc976d7['body']['binding'][_0x1d33('0xaa')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0xc976d7[_0x1d33('0x34')][_0x1d33('0xa6')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x381829=require('child_process')['fork'](path[_0x1d33('0x39')](__dirname,_0x1d33('0xc4')),[_0xc976d7[_0x1d33('0x21')]['id'],JSON[_0x1d33('0xbe')](_0xc976d7[_0x1d33('0x34')]),JSON[_0x1d33('0xbe')](_0x260d1d)]);_0x381829['on'](_0x1d33('0xbf'),function(){_0xb48151=!![];return _0x48bf96[_0x1d33('0xf')](0xc8)['json']({'message':_0x1d33('0xc0'),'pid':_0x381829[_0x1d33('0xb6')]});});_0x381829['on']('exit',function(_0x3ab9a9){if(_0x3ab9a9&&!_0xb48151){return _0x48bf96[_0x1d33('0xf')](0x1f4)[_0x1d33('0x15')]({'message':_0x1d33('0xc5'),'pid':_0x381829[_0x1d33('0xb6')]});}});})[_0x1d33('0x22')](handleError(_0x48bf96,null));};exports['getJourney']=function(_0x2b0c01,_0x5b2a4c){var _0x17f3e7=[_0x1d33('0xc6'),'chat',_0x1d33('0xc7'),_0x1d33('0xc8'),_0x1d33('0xc9'),_0x1d33('0xca'),_0x1d33('0xcb')];var _0x53a8b2={'offset':0x0,'order':qs[_0x1d33('0x7d')](_0x1d33('0xcc'))},_0x22f783={'count':0x0,'rows':[]};Promise['resolve']()[_0x1d33('0x17')](function(){if(_0x2b0c01[_0x1d33('0x2a')][_0x1d33('0xcd')]){if(!_[_0x1d33('0xce')](_0x17f3e7,_0x2b0c01[_0x1d33('0x2a')]['channel'][_0x1d33('0xcf')]())){throw new Error(_0x1d33('0xd0'));}_0x17f3e7=[_0x2b0c01[_0x1d33('0x2a')][_0x1d33('0xcd')][_0x1d33('0xcf')]()];}if(_0x2b0c01['query'][_0x1d33('0xd1')]){try{var _0x4290ba=JSON[_0x1d33('0xb9')](_0x2b0c01[_0x1d33('0x2a')]['range']);if(!moment(_0x4290ba['from'])[_0x1d33('0xd2')]()){throw new Error(_0x1d33('0xd3'));}if(!moment(_0x4290ba['to'])[_0x1d33('0xd2')]()){throw new Error(_0x1d33('0xd4'));}}catch(_0x54a2a5){throw new Error('Invalid\x20createdAt\x20filter');}}if(!_0x2b0c01[_0x1d33('0x2a')]['hasOwnProperty'](_0x1d33('0x82'))){_0x53a8b2[_0x1d33('0x83')]=qs[_0x1d33('0x83')](_0x2b0c01[_0x1d33('0x2a')]['limit']||0xa);_0x53a8b2[_0x1d33('0x12')]=qs[_0x1d33('0x12')](_0x2b0c01[_0x1d33('0x2a')][_0x1d33('0x12')]);}var _0x4a03c6=_0x17f3e7['map'](function(_0x15e854){if(_0x15e854==='voice'){var _0x501a00={'attributes':['id',_0x1d33('0xd5'),_0x1d33('0xd6'),_0x1d33('0xd7'),_0x1d33('0xd8'),'callerid',_0x1d33('0xd9'),'endtime',_0x1d33('0xda'),'note',_0x1d33('0xdb'),_0x1d33('0xdc'),_0x1d33('0xdd'),_0x1d33('0xde'),_0x1d33('0xdf')],'where':{'ContactId':_0x2b0c01[_0x1d33('0x21')]['id']},'include':[{'model':db[_0x1d33('0xc2')],'as':_0x1d33('0xc2'),'attributes':['id',_0x1d33('0x1b'),_0x1d33('0xe0'),_0x1d33('0x2e')]}],'order':[['createdAt',_0x1d33('0xe1')]]};if(_0x2b0c01[_0x1d33('0x2a')]['range']){_0x501a00[_0x1d33('0x58')][_0x1d33('0xdb')]={'$gte':_0x4290ba['from'],'$lte':_0x4290ba['to']};}return db[_0x1d33('0xe2')][_0x1d33('0xe3')](_0x501a00)['then'](function(_0x3ffbf1){_0x22f783[_0x1d33('0x11')]+=_0x3ffbf1[_0x1d33('0x11')];return _[_0x1d33('0x6a')](_0x3ffbf1[_0x1d33('0x9d')],function(_0x1c71f3){var _0x5707a0=_0x1c71f3[_0x1d33('0x36')]({'plain':!![]});_0x5707a0[_0x1d33('0xcd')]=_0x15e854;if(_0x5707a0[_0x1d33('0xc2')]){_0x5707a0[_0x1d33('0xc2')]={'id':_0x5707a0[_0x1d33('0xc2')]['id'],'name':_0x5707a0['User'][_0x1d33('0x1b')],'fullname':_0x5707a0[_0x1d33('0xc2')][_0x1d33('0xe0')],'alias':_0x5707a0[_0x1d33('0xc2')][_0x1d33('0x2e')]};}return _0x5707a0;});});}else{var _0x322b9c=_['startCase'](_0x15e854)+(_0x15e854===_0x1d33('0xe4')?'Website':_0x1d33('0xe5'));var _0xa31744={'attributes':['id',_0x1d33('0xe6'),_0x1d33('0xe7'),_0x1d33('0xdb'),_0x1d33('0xe8'),'disposition',_0x1d33('0xe9'),_0x1d33('0xea'),_0x1d33('0xdf'),_0x322b9c+'Id'],'where':{'ContactId':_0x2b0c01['params']['id']},'include':[{'model':db[_0x322b9c],'as':_0x1d33('0xe5'),'attributes':['id',_0x1d33('0x1b'),_0x1d33('0xeb')]},{'model':db[_0x1d33('0xc2')],'as':_0x1d33('0xec'),'attributes':['id',_0x1d33('0x1b'),_0x1d33('0xe0')]},{'model':db[_0x1d33('0x5e')],'as':_0x1d33('0x5f'),'attributes':['id',_0x1d33('0x1b'),'color'],'through':{'attributes':[]}}],'order':[[_0x1d33('0xdb'),_0x1d33('0xe1')]]};if(_0x2b0c01[_0x1d33('0x2a')][_0x1d33('0xd1')]){_0xa31744[_0x1d33('0x58')]['createdAt']={'$gte':_0x4290ba[_0x1d33('0x35')],'$lte':_0x4290ba['to']};}switch(_0x15e854){case _0x1d33('0xe4'):_0xa31744['attributes'][_0x1d33('0x57')]('browserName','customerIp',_0x1d33('0xed'),'deviceModel','osName','ratingMessage',_0x1d33('0xee'),_0x1d33('0xef'),_0x1d33('0xf0'));break;case _0x1d33('0xc6'):_0xa31744[_0x1d33('0x7a')][_0x1d33('0x57')]('subject',_0x1d33('0xf1'));break;case _0x1d33('0xc8'):_0xa31744[_0x1d33('0x7a')][_0x1d33('0x57')]('externalUrl',_0x1d33('0xf2'));break;}return db[_['startCase'](_0x15e854)+_0x1d33('0xf3')][_0x1d33('0xe3')](_0xa31744)['then'](function(_0x3a0707){_0x22f783[_0x1d33('0x11')]+=_0x3a0707[_0x1d33('0x11')];return _[_0x1d33('0x6a')](_0x3a0707[_0x1d33('0x9d')],function(_0x21826f){var _0x56316d=_0x21826f[_0x1d33('0x36')]({'plain':!![]});_0x56316d['channel']=_0x15e854;if(_0x56316d['Owner']){_0x56316d[_0x1d33('0xec')]={'id':_0x56316d['Owner']['id'],'name':_0x56316d['Owner'][_0x1d33('0x1b')],'fullname':_0x56316d[_0x1d33('0xec')][_0x1d33('0xe0')]};}return _0x56316d;});});}});return Promise[_0x1d33('0x5c')](_0x4a03c6);})[_0x1d33('0x17')](function(_0x3b5586){return _(_0x3b5586)['flatten']()[_0x1d33('0xf4')](_0x1d33('0xdb'))[_0x1d33('0xf5')]()['value']();})['then'](function(_0x14df91){_0x22f783[_0x1d33('0x9d')]=_0x53a8b2[_0x1d33('0x83')]?_0x14df91[_0x1d33('0xf6')](_0x53a8b2[_0x1d33('0x12')],_0x53a8b2[_0x1d33('0x12')]+_0x53a8b2['limit']):_0x14df91;return _0x22f783;})[_0x1d33('0x17')](respondWithFilteredResult(_0x5b2a4c,_0x53a8b2))[_0x1d33('0x22')](handleError(_0x5b2a4c,null));}; \ No newline at end of file +var _0x29d9=['VoiceCallReport','ChatQueueReport','FaxQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappQueueReport','join','isNil','dialTimezone','utcOffset','timezones','additionalPhones','bulkCreate','each','duplicates','where','$or','spread','contact','show','color','tag','Phones','ItemType','sequelize','literal','Phones.OrderBy','ListId','push','omit','map','format','cf_%d','$and','isEmpty','table','cm_contacts','setFields','toParam','text','values','phone','getTags','findOne','model','Tag','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','options','nolimit','setTags','ids','all','ContactItemType','OrderBy','items','item_types','ItemTypeId','description','CmContactHasItem','contact\x20phone\x20exists','PHONE','item','`ItemType`.OrderBy','ItemType.OrderBy','CmHopperAdditionalPhone','getAdditionalPhones','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','rescheduleAdditionalPhones','hopperId','getHoppers','merge','includeAll','include','rows','getHopperHistories','ContactId','getHopperFinals','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20values\x20specified!','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','binding_values','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','chmodSync','0777','../../components/import/cm/csv','CompanyId','socket_timestamp','File\x20uploaded\x20correctly!','upload','User','agent','binding','fork','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','pid','exit','error\x20child\x20process','child_process','../../components/import/cm/csvUpdates','getJourney','mail','chat','sms','openchannel','fax','whatsapp','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','source','destination','starttime','endtime','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','DESC','findAndCountAll','startCase','Account','closed','disposition','secondDisposition','Owner','customerIp','customerPort','deviceModel','osName','ratingMessage','ratingType','referer','subject','substatus','externalUrl','threadId','flatten','sortBy','reverse','slice','moment','util','path','papaparse','ioredis','../../config/logger','api','../../config/environment/shared','redis','localhost','./cmContact.socket','register','status','json','offset','limit','undefined','count','set','Content-Range','update','then','end','error','stack','name','send','index','findAll','user','catch','CmContact','find','params','describe','tags','keys','startsWith','cf_','columnName','displayName','query','analytics','CmCustomField','length','alias','custom','type','info','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','hasOwnProperty','body','from','get','isArray','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','destroy','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory'];(function(_0x59da69,_0x4b0c79){var _0x55c515=function(_0x47d83a){while(--_0x47d83a){_0x59da69['push'](_0x59da69['shift']());}};_0x55c515(++_0x4b0c79);}(_0x29d9,0xb2));var _0x929d=function(_0x38c5c6,_0x459b80){_0x38c5c6=_0x38c5c6-0x0;var _0x2e56d2=_0x29d9[_0x38c5c6];return _0x2e56d2;};'use strict';var moment=require(_0x929d('0x0'));var BPromise=require('bluebird');var util=require(_0x929d('0x1'));var path=require(_0x929d('0x2'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var Papa=require(_0x929d('0x3'));var Redis=require(_0x929d('0x4'));var contacts=require('../../components/contacts');var qs=require('../../components/parsers/qs');var logger=require(_0x929d('0x5'))(_0x929d('0x6'));var config=require('../../config/environment');var shared=require(_0x929d('0x7'));var db=require('../../mysqldb')['db'];config[_0x929d('0x8')]=_['defaults'](config[_0x929d('0x8')],{'host':_0x929d('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x929d('0x8')]));require(_0x929d('0xa'))[_0x929d('0xb')](socket);function respondWithResult(_0x11a4de,_0x4f672f){_0x4f672f=_0x4f672f||0xc8;return function(_0x2306ca){if(_0x2306ca){return _0x11a4de[_0x929d('0xc')](_0x4f672f)[_0x929d('0xd')](_0x2306ca);}};}function respondWithFilteredResult(_0x4fd9b9,_0x1497ae){return function(_0x3997c3){if(_0x3997c3){var _0x489a21=typeof _0x1497ae[_0x929d('0xe')]==='undefined'&&typeof _0x1497ae[_0x929d('0xf')]===_0x929d('0x10');var _0x161ce8=_0x3997c3[_0x929d('0x11')];var _0x2cb95c=_0x489a21?0x0:_0x1497ae[_0x929d('0xe')];var _0x4ce15b=_0x489a21?_0x3997c3[_0x929d('0x11')]:_0x1497ae[_0x929d('0xe')]+_0x1497ae['limit'];var _0x210fbd;if(_0x4ce15b>=_0x161ce8){_0x4ce15b=_0x161ce8;_0x210fbd=0xc8;}else{_0x210fbd=0xce;}_0x4fd9b9[_0x929d('0xc')](_0x210fbd);return _0x4fd9b9[_0x929d('0x12')](_0x929d('0x13'),_0x2cb95c+'-'+_0x4ce15b+'/'+_0x161ce8)['json'](_0x3997c3);}return null;};}function saveUpdates(_0xcca929){return function(_0x33d3d9){if(_0x33d3d9){return _0x33d3d9[_0x929d('0x14')](_0xcca929)['then'](function(_0x13fac5){return _0x13fac5;});}return null;};}function removeEntity(_0x1cd900){return function(_0x30cb55){if(_0x30cb55){return _0x30cb55['destroy']()[_0x929d('0x15')](function(){_0x1cd900['status'](0xcc)[_0x929d('0x16')]();});}};}function handleEntityNotFound(_0x4d593e){return function(_0x26095e){if(!_0x26095e){_0x4d593e['sendStatus'](0x194);}return _0x26095e;};}function handleError(_0x486034,_0x56ac4f){_0x56ac4f=_0x56ac4f||0x1f4;return function(_0x317417){logger[_0x929d('0x17')](_0x317417[_0x929d('0x18')]);if(_0x317417['name']){delete _0x317417[_0x929d('0x19')];}_0x486034[_0x929d('0xc')](_0x56ac4f)[_0x929d('0x1a')](_0x317417);};}exports[_0x929d('0x1b')]=function(_0x2bcb7a,_0x175660){var _0x5e10d6={};return contacts['describe']()[_0x929d('0x15')](function(_0x6d1f56){_0x5e10d6=qs['getOptions'](_0x6d1f56,_0x2bcb7a);return contacts[_0x929d('0x1c')](_0x2bcb7a['query'],_0x2bcb7a[_0x929d('0x1d')],_0x5e10d6,_0x6d1f56);})[_0x929d('0x15')](respondWithFilteredResult(_0x175660,_0x5e10d6))[_0x929d('0x1e')](handleError(_0x175660,null));};exports['destroy']=function(_0x5c8908,_0x391a2c){return db[_0x929d('0x1f')][_0x929d('0x20')]({'where':{'id':_0x5c8908[_0x929d('0x21')]['id']}})[_0x929d('0x15')](handleEntityNotFound(_0x391a2c,null))[_0x929d('0x15')](removeEntity(_0x391a2c,null))['catch'](handleError(_0x391a2c,null));};exports[_0x929d('0x22')]=function(_0x3bce7b,_0x2f64f9){return db[_0x929d('0x1f')][_0x929d('0x22')]()[_0x929d('0x15')](function(_0x30883a){delete _0x30883a[_0x929d('0x23')];for(var _0x2b8214=0x0;_0x2b82140x0){return new Promise(function(_0x11a273){var _0x39cf81=[];for(var _0x1961da=0x0;_0x1961da<_0x55a36a[_0x929d('0x2c')];_0x1961da++){_0x39cf81['push'](insertAdditionalPhones(_0x55a36a[_0x1961da][_0x929d('0x5e')],_0x55a36a[_0x1961da][_0x929d('0x57')]));}Promise['all'](_0x39cf81)[_0x929d('0x15')](function(){_0x11a273(0x1);});})[_0x929d('0x15')](function(){return{'success':_0x2bdce5,'failure':_0x51222a,'duplicates':_0x556564};});}else{return{'success':_0x2bdce5,'failure':_0x51222a,'duplicates':_0x556564};}}})[_0x929d('0x15')](respondWithResult(_0x44577f,0xc9))[_0x929d('0x1e')](handleError(_0x44577f,null));};exports[_0x929d('0x5f')]=function(_0x4c9a9,_0x330664){var _0x275be2;return db[_0x929d('0x1f')]['describe']()[_0x929d('0x15')](function(_0x27b1f6){return db['CmContact']['find']({'where':{'id':_0x4c9a9[_0x929d('0x21')]['id']},'include':[{'model':db['Tag'],'as':'Tags','attributes':['id',_0x929d('0x19'),_0x929d('0x60')],'required':_0x4c9a9[_0x929d('0x29')][_0x929d('0x61')]?!![]:![]},{'model':db['CmContactHasItem'],'as':_0x929d('0x62'),'where':{'CmContactId':_0x4c9a9[_0x929d('0x21')]['id']},'required':![],'include':[{'model':db['ContactItemType'],'as':_0x929d('0x63')}]}],'order':[db[_0x929d('0x64')][_0x929d('0x65')](_0x929d('0x66'))],'attributes':_[_0x929d('0x24')](_0x27b1f6)});})[_0x929d('0x15')](function(_0x5b59c6){if(!_[_0x929d('0x53')](_0x5b59c6)){_0x275be2=_0x5b59c6[_0x929d('0x35')]({'plain':!![]});var _0x543d2c={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x5b59c6&&_0x5b59c6[_0x929d('0x67')]){if(_0x5b59c6[_0x929d('0x67')]){_0x543d2c[_0x929d('0x5b')]['$and'][_0x929d('0x68')]({'ListId':{'$ne':_0x5b59c6['ListId']}});}}return db[_0x929d('0x2b')][_0x929d('0x1c')](_0x543d2c);}})[_0x929d('0x15')](function(_0xef21a0){if(!_[_0x929d('0x53')](_0xef21a0)){return _[_0x929d('0x69')](_0x275be2,_[_0x929d('0x6a')](_0xef21a0,function(_0x450804){return util[_0x929d('0x6b')](_0x929d('0x6c'),_0x450804['id']);}));}})[_0x929d('0x15')](handleEntityNotFound(_0x330664,null))[_0x929d('0x15')](respondWithResult(_0x330664,null))[_0x929d('0x1e')](handleError(_0x330664,null));};exports[_0x929d('0x14')]=function(_0x4fa707,_0x444642){var _0x551368;if(_0x4fa707[_0x929d('0x33')]['id']){delete _0x4fa707[_0x929d('0x33')]['id'];}if(!_[_0x929d('0x53')](_0x4fa707[_0x929d('0x33')][_0x929d('0x54')])){var _0x5d1019=_0x4fa707[_0x929d('0x33')][_0x929d('0x54')];if(!_[_0x929d('0x53')](shared[_0x929d('0x56')][_0x5d1019]))_0x4fa707['body']['utcOffset']=shared[_0x929d('0x56')][_0x5d1019][_0x929d('0x55')];}return db[_0x929d('0x1f')][_0x929d('0x20')]({'where':{'id':_0x4fa707['params']['id']}})[_0x929d('0x15')](handleEntityNotFound(_0x444642,null))[_0x929d('0x15')](saveUpdates(_0x4fa707[_0x929d('0x33')],null))[_0x929d('0x15')](function(_0x1a5922){_0x551368=_0x1a5922;var _0x1b8962={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x1a5922&&_0x1a5922[_0x929d('0x67')]){if(_0x1a5922[_0x929d('0x67')]){_0x1b8962['where'][_0x929d('0x6d')][_0x929d('0x68')]({'ListId':{'$ne':_0x1a5922[_0x929d('0x67')]}});}}return db['CmCustomField'][_0x929d('0x1c')](_0x1b8962);})[_0x929d('0x15')](function(_0x22f119){if(_0x22f119){return _[_0x929d('0x69')](_['pickBy'](_0x4fa707['body'],function(_0x430388,_0xffa446){return _[_0x929d('0x25')](_0xffa446,'cf_');}),_['map'](_0x22f119,function(_0x4a495e){return util['format'](_0x929d('0x6c'),_0x4a495e['id']);}));}})[_0x929d('0x15')](function(_0x1a142e){if(_0x1a142e&&!_[_0x929d('0x6e')](_0x1a142e)){var _0x3298dd=squel[_0x929d('0x14')]()[_0x929d('0x6f')](_0x929d('0x70'))[_0x929d('0x71')](_0x1a142e)['where']('id\x20=\x20?',_0x4fa707[_0x929d('0x21')]['id'])[_0x929d('0x72')]();return db['sequelize'][_0x929d('0x29')](_0x3298dd[_0x929d('0x73')],{'replacements':_0x3298dd[_0x929d('0x74')]});}})['then'](function(){if(_0x4fa707['body']['phone']&&_0x551368){return db[_0x929d('0x38')][_0x929d('0x14')]({'phone':_0x4fa707['body'][_0x929d('0x75')],'OrderBy':0x0},{'where':{'ContactId':_0x551368['id']}});}})[_0x929d('0x15')](function(){return _0x551368;})['then'](respondWithResult(_0x444642,null))[_0x929d('0x1e')](handleError(_0x444642,null));};exports[_0x929d('0x76')]=function(_0x34837e,_0x50c09a){var _0x5dde77={};var _0x144bfd={};var _0xd25fe2;var _0xe1ac0e;return db['CmContact'][_0x929d('0x77')]({'where':{'id':_0x34837e[_0x929d('0x21')]['id']}})[_0x929d('0x15')](handleEntityNotFound(_0x50c09a,null))[_0x929d('0x15')](function(_0x691992){if(_0x691992){_0xd25fe2=_0x691992;_0x144bfd[_0x929d('0x78')]=_[_0x929d('0x24')](db[_0x929d('0x79')][_0x929d('0x7a')]);_0x144bfd['query']=_[_0x929d('0x24')](_0x34837e['query']);_0x144bfd[_0x929d('0x7b')]=_[_0x929d('0x7c')](_0x144bfd[_0x929d('0x78')],_0x144bfd['query']);_0x5dde77[_0x929d('0x7d')]=_[_0x929d('0x7c')](_0x144bfd[_0x929d('0x78')],qs['fields'](_0x34837e[_0x929d('0x29')][_0x929d('0x7e')]));_0x5dde77['attributes']=_0x5dde77['attributes']['length']?_0x5dde77['attributes']:_0x144bfd['model'];_0x5dde77[_0x929d('0x7f')]=qs[_0x929d('0x80')](_0x34837e['query'][_0x929d('0x80')]);_0x5dde77[_0x929d('0x5b')]=qs[_0x929d('0x7b')](_[_0x929d('0x81')](_0x34837e[_0x929d('0x29')],_0x144bfd[_0x929d('0x7b')]));if(_0x34837e['query'][_0x929d('0x82')]){_0x5dde77[_0x929d('0x5b')]=_['merge'](_0x5dde77[_0x929d('0x5b')],{'$or':_[_0x929d('0x6a')](_0x5dde77[_0x929d('0x7d')],function(_0x1ec291){var _0x471f60={};_0x471f60[_0x1ec291]={'$like':'%'+_0x34837e[_0x929d('0x29')][_0x929d('0x82')]+'%'};return _0x471f60;})});}_0x5dde77=_['merge']({},_0x5dde77,_0x34837e[_0x929d('0x83')]);return _0xd25fe2[_0x929d('0x76')](_0x5dde77);}})['then'](function(_0x475256){if(_0x475256){_0xe1ac0e=_0x475256[_0x929d('0x2c')];if(!_0x34837e[_0x929d('0x29')]['hasOwnProperty'](_0x929d('0x84'))){_0x5dde77[_0x929d('0xf')]=qs[_0x929d('0xf')](_0x34837e['query'][_0x929d('0xf')]);_0x5dde77[_0x929d('0xe')]=qs[_0x929d('0xe')](_0x34837e[_0x929d('0x29')][_0x929d('0xe')]);}return _0xd25fe2['getTags'](_0x5dde77);}})[_0x929d('0x15')](function(_0x3a6341){if(_0x3a6341){return _0x3a6341?{'count':_0xe1ac0e,'rows':_0x3a6341}:null;}})[_0x929d('0x15')](respondWithResult(_0x50c09a,null))[_0x929d('0x1e')](handleError(_0x50c09a,null));};exports[_0x929d('0x85')]=function(_0x5c625b,_0x4f45ef){if(_0x5c625b[_0x929d('0x33')]['id']){delete _0x5c625b[_0x929d('0x33')]['id'];}return db['CmContact'][_0x929d('0x77')]({'where':{'id':_0x5c625b['params']['id']}})[_0x929d('0x15')](handleEntityNotFound(_0x4f45ef,null))[_0x929d('0x15')](function(_0x559c66){if(_0x559c66){return _0x559c66[_0x929d('0x85')](_0x5c625b[_0x929d('0x33')][_0x929d('0x86')]||[]);}return null;})[_0x929d('0x15')](respondWithResult(_0x4f45ef,null))[_0x929d('0x1e')](handleError(_0x4f45ef,null));};exports['setAdditionalPhones']=function(_0x5d33fb,_0x41ccb5){var _0x5f2248=[];_0x5f2248[_0x929d('0x68')](addAdditionalPhones(_0x5d33fb[_0x929d('0x33')]));Promise[_0x929d('0x87')](_0x5f2248)['then'](function(){_0x5f2248=[];_0x5f2248[_0x929d('0x68')](deleteCmHopperPhones(_0x5d33fb['body']['id']));_0x5f2248[_0x929d('0x68')](addCmHopperPhones(_0x5d33fb['body']['id']));Promise[_0x929d('0x87')](_0x5f2248)[_0x929d('0x15')](function(){return[0x1];})[_0x929d('0x15')](respondWithResult(_0x41ccb5,null));});};function addAdditionalPhones(_0x13ffb9){var _0x481ba4;return new Promise(function(_0x2b3c22){return db['CmContactHasItem'][_0x929d('0x39')]({'where':{'CmContactId':_0x13ffb9['id']}})[_0x929d('0x15')](function(){db[_0x929d('0x88')][_0x929d('0x1c')]({'raw':!![],'attributes':['id',_0x929d('0x89')]})['then'](function(_0x328a4e){var _0x48af51=[];for(var _0x4a2236=0x0;_0x4a2236<_0x13ffb9[_0x929d('0x8a')][_0x929d('0x2c')];_0x4a2236++){var _0x20effa=_0x13ffb9[_0x929d('0x8b')]?_[_0x929d('0x53')](_0x13ffb9[_0x929d('0x8b')][_0x4a2236])?'':_0x13ffb9[_0x929d('0x8b')][_0x4a2236]:_0x13ffb9[_0x929d('0x8a')][_0x4a2236][_0x929d('0x8c')]?_0x13ffb9[_0x929d('0x8a')][_0x4a2236][_0x929d('0x8c')]:'';var _0x32203f=_['isNil'](_0x13ffb9['items'][_0x4a2236][_0x929d('0x8d')])?'':_0x13ffb9[_0x929d('0x8a')][_0x4a2236][_0x929d('0x8d')];var _0x504c81=_0x20effa+':'+_0x13ffb9['items'][_0x4a2236][_0x929d('0x75')]+'§'+_0x32203f;if(_[_0x929d('0x53')](_0x481ba4))_0x481ba4=_0x504c81;else _0x481ba4+=';'+_0x504c81;var _0x2870ec=null;var _0x2ba9ef=null;if(_0x13ffb9[_0x929d('0x8b')]){if(!_[_0x929d('0x53')](_0x13ffb9[_0x929d('0x8b')][_0x4a2236])){_0x2ba9ef=_[_0x929d('0x20')](_0x328a4e,function(_0x56f607){return _0x56f607['id']===_0x13ffb9[_0x929d('0x8b')][_0x4a2236];});if(!_[_0x929d('0x53')](_0x2ba9ef)){_0x2870ec=_0x2ba9ef[_0x929d('0x89')];}}}else{if(!_[_0x929d('0x53')](_0x13ffb9['items'][_0x4a2236])){_0x2ba9ef=_[_0x929d('0x20')](_0x328a4e,function(_0xf16fa9){return _0xf16fa9['id']===_0x13ffb9[_0x929d('0x8a')][_0x4a2236][_0x929d('0x8c')];});if(!_[_0x929d('0x53')](_0x2ba9ef)){_0x2870ec=_0x4a2236;}}}if(_[_0x929d('0x53')](_0x2870ec)){_0x2870ec=0x64;}_0x48af51[_0x929d('0x68')](addAdditionalPhone(_0x13ffb9['id'],_0x13ffb9[_0x929d('0x8a')][_0x4a2236]['phone'],_0x13ffb9[_0x929d('0x8b')]?_[_0x929d('0x53')](_0x13ffb9[_0x929d('0x8b')][_0x4a2236])?null:_0x13ffb9[_0x929d('0x8b')][_0x4a2236]:_0x13ffb9[_0x929d('0x8a')][_0x4a2236][_0x929d('0x8c')]?_0x13ffb9[_0x929d('0x8a')][_0x4a2236][_0x929d('0x8c')]:null,_0x2870ec,_0x32203f));}Promise[_0x929d('0x87')](_0x48af51)[_0x929d('0x15')](function(){db[_0x929d('0x1f')]['update']({'AdditionalPhones':_0x481ba4},{'where':{'id':_0x13ffb9['id']}})[_0x929d('0x15')](function(){_0x2b3c22(0x1);});});});});});}function addAdditionalPhone(_0x46c463,_0x4efa02,_0x15cfed,_0x50e658,_0x60f091){return db[_0x929d('0x8e')][_0x929d('0x20')]({'where':{'CmContactId':_0x46c463,'item':_0x4efa02}})[_0x929d('0x15')](function(_0x13adbd){if(_0x13adbd)logger[_0x929d('0x30')](_0x929d('0x8f'),_0x13adbd);else{db[_0x929d('0x8e')][_0x929d('0x3d')]({'CmContactId':_0x46c463,'item':_0x4efa02,'ItemTypeId':_0x15cfed,'OrderBy':_0x50e658,'ItemClass':_0x929d('0x90'),'description':_0x60f091});}});}function deleteCmHopperPhones(_0xa356c6){return new Promise(function(_0x227ce3){return db['CmHopper'][_0x929d('0x1c')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0xa356c6}})[_0x929d('0x15')](function(_0x3c6140){db['CmHopperAdditionalPhone'][_0x929d('0x39')]({'where':{'CmHopperId':{'$in':_['map'](_0x3c6140,'id')}}});})[_0x929d('0x15')](function(){_0x227ce3(0x1);});});}function addCmHopperPhones(_0x11edb8){return new Promise(function(_0xb1f566){return db[_0x929d('0x38')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x11edb8}})['then'](function(_0x1a19e8){var _0x1ddf2a=[];_[_0x929d('0x6a')](_0x1a19e8,function(_0x30b959){_0x1ddf2a[_0x929d('0x68')](createCmHopperPhone(_0x11edb8,_0x30b959['id']));});Promise[_0x929d('0x87')](_0x1ddf2a)[_0x929d('0x15')](function(){_0xb1f566(0x1);});});});}function createCmHopperPhone(_0x1e5445,_0x1b99cd){return new Promise(function(_0x341702){db[_0x929d('0x8e')][_0x929d('0x1c')]({'raw':!![],'attributes':[_0x929d('0x91'),'OrderBy'],'where':{'CmContactId':_0x1e5445,'ItemClass':_0x929d('0x90')},'include':[{'model':db['ContactItemType'],'attributes':[_0x929d('0x89')],'as':_0x929d('0x63')}],'order':[_0x929d('0x89'),db[_0x929d('0x64')][_0x929d('0x65')](_0x929d('0x92'))]})[_0x929d('0x15')](function(_0xf66e2a){var _0x23eefe=0x1;var _0x2efeec=_[_0x929d('0x6a')](_0xf66e2a,function(_0x4d3160){_0x4d3160['CmHopperId']=_0x1b99cd;_0x4d3160[_0x929d('0x75')]=_0x4d3160['item'];_0x4d3160[_0x929d('0x89')]=_0x23eefe;delete _0x4d3160[_0x929d('0x93')];_0x23eefe=_0x23eefe+0x1;return _0x4d3160;});return db[_0x929d('0x94')][_0x929d('0x58')](_0x2efeec,{});})[_0x929d('0x15')](function(){_0x341702(0x1);});});}function insertAdditionalPhones(_0xf62a40,_0x3a2b2b){return new Promise(function(_0x4967ac){var _0x2e5a30=[];for(var _0x3a623e=0x0;_0x3a623e<_0x3a2b2b['length'];_0x3a623e++){var _0xbe2c7f=_0x3a2b2b[_0x3a623e];_0x2e5a30[_0x929d('0x68')](parseContactItemType(_0xbe2c7f));}Promise[_0x929d('0x87')](_0x2e5a30)[_0x929d('0x15')](function(){var _0x1b5bab={'id':_0xf62a40['id'],'items':_0x3a2b2b};return addAdditionalPhones(_0x1b5bab)[_0x929d('0x15')](function(){return addCmHopperPhones(_0xf62a40['id']);});})[_0x929d('0x15')](function(){_0x4967ac(_0xf62a40);});});}function parseContactItemType(_0x54e152){return new Promise(function(_0x57a307){if(_0x54e152[_0x929d('0x32')](_0x929d('0x8c'))){_0x57a307(_0x54e152);}else{return db[_0x929d('0x88')][_0x929d('0x20')]({'where':{'name':_0x54e152[_0x929d('0x63')]}})[_0x929d('0x15')](function(_0x4c156e){if(_[_0x929d('0x53')](_0x4c156e))_0x54e152[_0x929d('0x8c')]=null;else _0x54e152[_0x929d('0x8c')]=_0x4c156e['id'];_0x57a307(_0x54e152);});}});}exports[_0x929d('0x95')]=function(_0x46fc3a,_0x114983){return db[_0x929d('0x8e')][_0x929d('0x1c')]({'raw':!![],'where':{'CmContactId':_0x46fc3a['params']['id'],'ItemClass':_0x929d('0x90')},'include':[{'model':db[_0x929d('0x88')],'as':_0x929d('0x63')}],'order':[['OrderBy'],[db['sequelize']['literal'](_0x929d('0x92'))]]})['then'](function(_0x54e364){return _0x54e364;})[_0x929d('0x15')](respondWithResult(_0x114983,null))[_0x929d('0x1e')](handleError(_0x114983,null));};exports[_0x929d('0x96')]=function(_0x4561,_0xf02cbc){return db['CmContactHasItem'][_0x929d('0x1c')]({'raw':!![],'where':{'CmContactId':_0x4561[_0x929d('0x33')][_0x929d('0x97')]}})['then'](function(_0x410d99){var _0x308b59=_[_0x929d('0x6a')](_0x410d99,function(_0x2d467c){_0x2d467c[_0x929d('0x98')]=_0x4561['body'][_0x929d('0x99')];return _0x2d467c;});return db['CmContactHasItem']['bulkCreate'](_0x308b59,{});})[_0x929d('0x15')](function(){return addCmHopperPhones(_0x4561[_0x929d('0x33')]['toContactId']);})['then'](function(){return['ok'];})['then'](respondWithResult(_0xf02cbc,null))['catch'](handleError(_0xf02cbc,null));};exports[_0x929d('0x9a')]=function(_0x153fa3,_0x1153d1){var _0xc4d6b4=[];_0xc4d6b4[_0x929d('0x68')](createCmHopperPhone(_0x153fa3['body']['id'],_0x153fa3[_0x929d('0x33')][_0x929d('0x9b')]));Promise[_0x929d('0x87')](_0xc4d6b4)[_0x929d('0x15')](function(){return[0x1];})[_0x929d('0x15')](respondWithResult(_0x1153d1,null));};exports[_0x929d('0x9c')]=function(_0x3f25b5,_0x26acee){var _0x49274c={'raw':![],'where':{}};var _0x5e0776={};var _0x4eea91={'count':0x0,'rows':[]};return db[_0x929d('0x1f')]['findOne']({'where':{'id':_0x3f25b5[_0x929d('0x21')]['id']}})[_0x929d('0x15')](handleEntityNotFound(_0x26acee,null))['then'](function(_0x4a725d){if(_0x4a725d){_0x5e0776[_0x929d('0x78')]=_[_0x929d('0x24')](db[_0x929d('0x38')][_0x929d('0x7a')]);_0x5e0776['query']=_[_0x929d('0x24')](_0x3f25b5[_0x929d('0x29')]);_0x5e0776[_0x929d('0x7b')]=_[_0x929d('0x7c')](_0x5e0776['model'],_0x5e0776[_0x929d('0x29')]);_0x49274c[_0x929d('0x7d')]=_[_0x929d('0x7c')](_0x5e0776[_0x929d('0x78')],qs[_0x929d('0x7e')](_0x3f25b5[_0x929d('0x29')][_0x929d('0x7e')]));_0x49274c['attributes']=_0x49274c[_0x929d('0x7d')][_0x929d('0x2c')]?_0x49274c[_0x929d('0x7d')]:_0x5e0776['model'];if(!_0x3f25b5[_0x929d('0x29')]['hasOwnProperty']('nolimit')){_0x49274c[_0x929d('0xf')]=qs[_0x929d('0xf')](_0x3f25b5[_0x929d('0x29')][_0x929d('0xf')]);_0x49274c[_0x929d('0xe')]=qs[_0x929d('0xe')](_0x3f25b5[_0x929d('0x29')][_0x929d('0xe')]);}_0x49274c['order']=qs[_0x929d('0x80')](_0x3f25b5[_0x929d('0x29')][_0x929d('0x80')]);_0x49274c[_0x929d('0x5b')]=qs[_0x929d('0x7b')](_[_0x929d('0x81')](_0x3f25b5['query'],_0x5e0776[_0x929d('0x7b')]));_0x49274c[_0x929d('0x5b')]['ContactId']=_0x4a725d['id'];if(_0x3f25b5[_0x929d('0x29')][_0x929d('0x82')]){_0x49274c['where']=_[_0x929d('0x9d')](_0x49274c[_0x929d('0x5b')],{'$or':_[_0x929d('0x6a')](_0x49274c['attributes'],function(_0x2678b4){var _0x2bc3ae={};_0x2bc3ae[_0x2678b4]={'$like':'%'+_0x3f25b5[_0x929d('0x29')][_0x929d('0x82')]+'%'};return _0x2bc3ae;})});}_0x49274c=_[_0x929d('0x9d')]({},_0x49274c,_0x3f25b5[_0x929d('0x83')]);return db[_0x929d('0x38')][_0x929d('0x11')]({'where':_0x49274c[_0x929d('0x5b')]})['then'](function(_0x317e9f){_0x4eea91[_0x929d('0x11')]=_0x317e9f;if(_0x3f25b5[_0x929d('0x29')][_0x929d('0x9e')]){_0x49274c[_0x929d('0x9f')]=[{'all':!![]}];}return db['CmHopper'][_0x929d('0x1c')](_0x49274c);})['then'](function(_0x2676af){_0x4eea91[_0x929d('0xa0')]=_0x2676af;return _0x4eea91;});}})['then'](respondWithFilteredResult(_0x26acee,_0x49274c))[_0x929d('0x1e')](handleError(_0x26acee,null));};exports[_0x929d('0xa1')]=function(_0x142eea,_0x3d6127){var _0x59acd2={'raw':!![],'where':{}};var _0x1f91f3={};var _0x80befc={'count':0x0,'rows':[]};return db['CmContact'][_0x929d('0x77')]({'where':{'id':_0x142eea['params']['id']}})[_0x929d('0x15')](handleEntityNotFound(_0x3d6127,null))[_0x929d('0x15')](function(_0x46ee55){if(_0x46ee55){_0x1f91f3[_0x929d('0x78')]=_[_0x929d('0x24')](db['CmHopperHistory']['rawAttributes']);_0x1f91f3['query']=_[_0x929d('0x24')](_0x142eea[_0x929d('0x29')]);_0x1f91f3['filters']=_[_0x929d('0x7c')](_0x1f91f3[_0x929d('0x78')],_0x1f91f3[_0x929d('0x29')]);_0x59acd2[_0x929d('0x7d')]=_[_0x929d('0x7c')](_0x1f91f3[_0x929d('0x78')],qs['fields'](_0x142eea[_0x929d('0x29')][_0x929d('0x7e')]));_0x59acd2[_0x929d('0x7d')]=_0x59acd2['attributes'][_0x929d('0x2c')]?_0x59acd2[_0x929d('0x7d')]:_0x1f91f3[_0x929d('0x78')];if(!_0x142eea[_0x929d('0x29')][_0x929d('0x32')](_0x929d('0x84'))){_0x59acd2[_0x929d('0xf')]=qs[_0x929d('0xf')](_0x142eea[_0x929d('0x29')][_0x929d('0xf')]);_0x59acd2[_0x929d('0xe')]=qs['offset'](_0x142eea[_0x929d('0x29')][_0x929d('0xe')]);}_0x59acd2['order']=qs[_0x929d('0x80')](_0x142eea[_0x929d('0x29')]['sort']);_0x59acd2[_0x929d('0x5b')]=qs[_0x929d('0x7b')](_[_0x929d('0x81')](_0x142eea[_0x929d('0x29')],_0x1f91f3['filters']));_0x59acd2['where'][_0x929d('0xa2')]=_0x46ee55['id'];if(_0x142eea[_0x929d('0x29')][_0x929d('0x82')]){_0x59acd2['where']=_[_0x929d('0x9d')](_0x59acd2['where'],{'$or':_['map'](_0x59acd2[_0x929d('0x7d')],function(_0x3ecf3e){var _0x4145a4={};_0x4145a4[_0x3ecf3e]={'$like':'%'+_0x142eea[_0x929d('0x29')][_0x929d('0x82')]+'%'};return _0x4145a4;})});}_0x59acd2=_[_0x929d('0x9d')]({},_0x59acd2,_0x142eea[_0x929d('0x83')]);return db['CmHopperHistory']['count']({'where':_0x59acd2[_0x929d('0x5b')]})[_0x929d('0x15')](function(_0x52e18e){_0x80befc[_0x929d('0x11')]=_0x52e18e;if(_0x142eea[_0x929d('0x29')][_0x929d('0x9e')]){_0x59acd2[_0x929d('0x9f')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x929d('0x1c')](_0x59acd2);})[_0x929d('0x15')](function(_0x307d88){_0x80befc[_0x929d('0xa0')]=_0x307d88;return _0x80befc;});}})[_0x929d('0x15')](respondWithFilteredResult(_0x3d6127,_0x59acd2))[_0x929d('0x1e')](handleError(_0x3d6127,null));};exports[_0x929d('0xa3')]=function(_0x591d09,_0x435975){var _0x116da5={'raw':!![],'where':{}};var _0x5d7b6a={};var _0x54e621={'count':0x0,'rows':[]};return db[_0x929d('0x1f')][_0x929d('0x77')]({'where':{'id':_0x591d09[_0x929d('0x21')]['id']}})[_0x929d('0x15')](handleEntityNotFound(_0x435975,null))['then'](function(_0x3706e0){if(_0x3706e0){_0x5d7b6a[_0x929d('0x78')]=_[_0x929d('0x24')](db['CmHopperFinal'][_0x929d('0x7a')]);_0x5d7b6a[_0x929d('0x29')]=_[_0x929d('0x24')](_0x591d09[_0x929d('0x29')]);_0x5d7b6a[_0x929d('0x7b')]=_['intersection'](_0x5d7b6a[_0x929d('0x78')],_0x5d7b6a[_0x929d('0x29')]);_0x116da5['attributes']=_[_0x929d('0x7c')](_0x5d7b6a[_0x929d('0x78')],qs[_0x929d('0x7e')](_0x591d09['query']['fields']));_0x116da5[_0x929d('0x7d')]=_0x116da5[_0x929d('0x7d')][_0x929d('0x2c')]?_0x116da5[_0x929d('0x7d')]:_0x5d7b6a[_0x929d('0x78')];if(!_0x591d09['query'][_0x929d('0x32')]('nolimit')){_0x116da5[_0x929d('0xf')]=qs[_0x929d('0xf')](_0x591d09['query'][_0x929d('0xf')]);_0x116da5[_0x929d('0xe')]=qs[_0x929d('0xe')](_0x591d09['query'][_0x929d('0xe')]);}_0x116da5['order']=qs['sort'](_0x591d09[_0x929d('0x29')][_0x929d('0x80')]);_0x116da5[_0x929d('0x5b')]=qs[_0x929d('0x7b')](_['pick'](_0x591d09[_0x929d('0x29')],_0x5d7b6a[_0x929d('0x7b')]));_0x116da5[_0x929d('0x5b')]['ContactId']=_0x3706e0['id'];if(_0x591d09[_0x929d('0x29')]['filter']){_0x116da5[_0x929d('0x5b')]=_[_0x929d('0x9d')](_0x116da5['where'],{'$or':_[_0x929d('0x6a')](_0x116da5[_0x929d('0x7d')],function(_0x591270){var _0x37d03b={};_0x37d03b[_0x591270]={'$like':'%'+_0x591d09[_0x929d('0x29')][_0x929d('0x82')]+'%'};return _0x37d03b;})});}_0x116da5=_['merge']({},_0x116da5,_0x591d09[_0x929d('0x83')]);return db[_0x929d('0x48')][_0x929d('0x11')]({'where':_0x116da5['where']})['then'](function(_0x4544f4){_0x54e621[_0x929d('0x11')]=_0x4544f4;if(_0x591d09[_0x929d('0x29')][_0x929d('0x9e')]){_0x116da5['include']=[{'all':!![]}];}return db[_0x929d('0x48')][_0x929d('0x1c')](_0x116da5);})[_0x929d('0x15')](function(_0x2bda01){_0x54e621[_0x929d('0xa0')]=_0x2bda01;return _0x54e621;});}})[_0x929d('0x15')](respondWithFilteredResult(_0x435975,_0x116da5))[_0x929d('0x1e')](handleError(_0x435975,null));};exports[_0x929d('0xa4')]=function(_0x2df3e0,_0x5c9e06){var _0x4216cc={'raw':!![],'where':{}};var _0x8e88c2={};var _0x40f775={'count':0x0,'rows':[]};return db[_0x929d('0x1f')][_0x929d('0x77')]({'where':{'id':_0x2df3e0[_0x929d('0x21')]['id']}})[_0x929d('0x15')](handleEntityNotFound(_0x5c9e06,null))[_0x929d('0x15')](function(_0x3d492f){if(_0x3d492f){_0x8e88c2[_0x929d('0x78')]=_[_0x929d('0x24')](db[_0x929d('0x4f')][_0x929d('0x7a')]);_0x8e88c2[_0x929d('0x29')]=_[_0x929d('0x24')](_0x2df3e0[_0x929d('0x29')]);_0x8e88c2[_0x929d('0x7b')]=_[_0x929d('0x7c')](_0x8e88c2['model'],_0x8e88c2[_0x929d('0x29')]);_0x4216cc[_0x929d('0x7d')]=_[_0x929d('0x7c')](_0x8e88c2['model'],qs['fields'](_0x2df3e0[_0x929d('0x29')][_0x929d('0x7e')]));_0x4216cc[_0x929d('0x7d')]=_0x4216cc[_0x929d('0x7d')]['length']?_0x4216cc[_0x929d('0x7d')]:_0x8e88c2[_0x929d('0x78')];if(!_0x2df3e0[_0x929d('0x29')][_0x929d('0x32')](_0x929d('0x84'))){_0x4216cc[_0x929d('0xf')]=qs[_0x929d('0xf')](_0x2df3e0[_0x929d('0x29')]['limit']);_0x4216cc[_0x929d('0xe')]=qs[_0x929d('0xe')](_0x2df3e0[_0x929d('0x29')][_0x929d('0xe')]);}_0x4216cc['order']=qs[_0x929d('0x80')](_0x2df3e0[_0x929d('0x29')][_0x929d('0x80')]);_0x4216cc[_0x929d('0x5b')]=qs[_0x929d('0x7b')](_['pick'](_0x2df3e0[_0x929d('0x29')],_0x8e88c2[_0x929d('0x7b')]));_0x4216cc[_0x929d('0x5b')][_0x929d('0xa2')]=_0x3d492f['id'];if(_0x2df3e0['query'][_0x929d('0x82')]){_0x4216cc[_0x929d('0x5b')]=_[_0x929d('0x9d')](_0x4216cc[_0x929d('0x5b')],{'$or':_[_0x929d('0x6a')](_0x4216cc[_0x929d('0x7d')],function(_0x2048c8){var _0x120ef9={};_0x120ef9[_0x2048c8]={'$like':'%'+_0x2df3e0[_0x929d('0x29')][_0x929d('0x82')]+'%'};return _0x120ef9;})});}_0x4216cc=_[_0x929d('0x9d')]({},_0x4216cc,_0x2df3e0[_0x929d('0x83')]);return db[_0x929d('0x4f')]['count']({'where':_0x4216cc[_0x929d('0x5b')]})['then'](function(_0x5f1b44){_0x40f775[_0x929d('0x11')]=_0x5f1b44;if(_0x2df3e0[_0x929d('0x29')][_0x929d('0x9e')]){_0x4216cc[_0x929d('0x9f')]=[{'all':!![]}];}return db[_0x929d('0x4f')][_0x929d('0x1c')](_0x4216cc);})['then'](function(_0x2a1a80){_0x40f775[_0x929d('0xa0')]=_0x2a1a80;return _0x40f775;});}})['then'](respondWithFilteredResult(_0x5c9e06,_0x4216cc))[_0x929d('0x1e')](handleError(_0x5c9e06,null));};exports[_0x929d('0xa5')]=function(_0x3899e3,_0x4cdcf5){try{if(!_0x3899e3[_0x929d('0x33')][_0x929d('0x67')]){throw new Error(_0x929d('0xa6'));}if(!_0x3899e3[_0x929d('0x33')][_0x929d('0xa7')]){throw new Error('No\x20association\x20keys\x20specified!');}if(!_0x3899e3[_0x929d('0x33')]['binding_values']){throw new Error(_0x929d('0xa8'));}if(!_0x3899e3['body']['socket_timestamp']){throw new Error(_0x929d('0xa9'));}var _0xe235cc=_0x3899e3[_0x929d('0x33')][_0x929d('0xa7')][_0x929d('0xaa')](',');var _0x4c9c63=_0x3899e3[_0x929d('0x33')][_0x929d('0xab')]['split'](',');if(!_0xe235cc[_0x929d('0x2c')]||!_0x4c9c63['length']||_0xe235cc[_0x929d('0x2c')]!==_0x4c9c63['length']){throw new Error(_0x929d('0xac'));}_0x3899e3['body'][_0x929d('0x7e')]=_[_0x929d('0xad')](_0xe235cc,_0x4c9c63);if(!_0x3899e3[_0x929d('0x33')]['fields']['phone']){throw new Error(_0x929d('0xae'));}if(!_0x3899e3[_0x929d('0x33')]['fields'][_0x929d('0xaf')]){throw new Error(_0x929d('0xb0'));}var _0x2f1fa9=path[_0x929d('0x52')](config[_0x929d('0xb1')],'server/files/tmp',_0x3899e3[_0x929d('0xb2')]['filename']);fs[_0x929d('0xb3')](_0x2f1fa9,parseInt(_0x929d('0xb4'),0x8));var _0x2731e7=require('child_process')['fork'](path[_0x929d('0x52')](__dirname,_0x929d('0xb5')),[_0x2f1fa9,_0x3899e3[_0x929d('0x33')][_0x929d('0xa7')],_0x3899e3[_0x929d('0x33')][_0x929d('0xab')],_0x3899e3[_0x929d('0x33')][_0x929d('0x67')],_0x3899e3[_0x929d('0x33')][_0x929d('0xb6')],_0x3899e3[_0x929d('0x33')][_0x929d('0x5a')],_0x3899e3[_0x929d('0x33')][_0x929d('0xb7')]]);return _0x4cdcf5['status'](0xc8)[_0x929d('0xd')]({'message':_0x929d('0xb8'),'pid':_0x2731e7['pid']});}catch(_0x54e80e){return _0x4cdcf5[_0x929d('0xc')](0x1f4)[_0x929d('0x1a')](_0x54e80e);}};exports[_0x929d('0xb9')]=function(_0x37d61e,_0x5644ac){var _0x526d48=fs['createReadStream'](_0x37d61e[_0x929d('0xb2')][_0x929d('0x2')]);Papa['parse'](_0x526d48,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x5f3be1){return _0x5644ac[_0x929d('0xc')](0xc8)[_0x929d('0xd')]({'file':_0x37d61e[_0x929d('0xb2')],'fields':_0x5f3be1['meta']['fields']});}});};exports['import']=function(_0x24e3bb,_0x3032cd){return db[_0x929d('0xba')][_0x929d('0x1c')]({'raw':!![],'attributes':['id'],'where':{'role':_0x929d('0xbb')}})[_0x929d('0x15')](function(_0x4dfcec){var _0x1da6fb=![];if(!_0x24e3bb[_0x929d('0x33')][_0x929d('0x67')]){throw new Error(_0x929d('0xa6'));}if(!_0x24e3bb[_0x929d('0x33')]['binding'][_0x929d('0x75')]){throw new Error(_0x929d('0xae'));}if(!_0x24e3bb[_0x929d('0x33')][_0x929d('0xbc')]['firstName']){throw new Error(_0x929d('0xb0'));}if(!_0x24e3bb[_0x929d('0x33')][_0x929d('0xb7')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x3c7626=require('child_process')[_0x929d('0xbd')](path[_0x929d('0x52')](__dirname,_0x929d('0xbe')),[_0x24e3bb[_0x929d('0x21')]['id'],JSON['stringify'](_0x24e3bb[_0x929d('0x33')]),JSON[_0x929d('0xbf')](_0x4dfcec)]);_0x3c7626['on'](_0x929d('0xc0'),function(){_0x1da6fb=!![];return _0x3032cd[_0x929d('0xc')](0xc8)[_0x929d('0xd')]({'message':_0x929d('0xc1'),'pid':_0x3c7626[_0x929d('0xc2')]});});_0x3c7626['on'](_0x929d('0xc3'),function(_0x1c9f14){if(_0x1c9f14&&!_0x1da6fb){return _0x3032cd[_0x929d('0xc')](0x1f4)[_0x929d('0xd')]({'message':_0x929d('0xc4'),'pid':_0x3c7626['pid']});}});})[_0x929d('0x1e')](handleError(_0x3032cd,null));};exports['importUpdates']=function(_0x25436b,_0x43addd){return db[_0x929d('0xba')][_0x929d('0x1c')]({'raw':!![],'attributes':['id'],'where':{'role':'agent'}})[_0x929d('0x15')](function(_0x35cc7b){var _0x1ce1ed=![];if(!_0x25436b[_0x929d('0x33')][_0x929d('0x67')]){throw new Error('No\x20ListId\x20specified');}if(!_0x25436b['body'][_0x929d('0xbc')][_0x929d('0x75')]){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x25436b[_0x929d('0x33')]['binding']['firstName']){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x25436b[_0x929d('0x33')]['socket_timestamp']){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x334524=require(_0x929d('0xc5'))['fork'](path[_0x929d('0x52')](__dirname,_0x929d('0xc6')),[_0x25436b[_0x929d('0x21')]['id'],JSON['stringify'](_0x25436b[_0x929d('0x33')]),JSON[_0x929d('0xbf')](_0x35cc7b)]);_0x334524['on']('message',function(){_0x1ce1ed=!![];return _0x43addd[_0x929d('0xc')](0xc8)[_0x929d('0xd')]({'message':_0x929d('0xc1'),'pid':_0x334524['pid']});});_0x334524['on']('exit',function(_0x2eb1d1){if(_0x2eb1d1&&!_0x1ce1ed){return _0x43addd[_0x929d('0xc')](0x1f4)['json']({'message':_0x929d('0xc4'),'pid':_0x334524[_0x929d('0xc2')]});}});})['catch'](handleError(_0x43addd,null));};exports[_0x929d('0xc7')]=function(_0x5443c4,_0x553f54){var _0x379dc2=[_0x929d('0xc8'),_0x929d('0xc9'),_0x929d('0xca'),_0x929d('0xcb'),_0x929d('0xcc'),_0x929d('0xcd'),'voice'];var _0x3de095={'offset':0x0,'order':qs[_0x929d('0x80')](_0x929d('0xce'))},_0x3fc0a0={'count':0x0,'rows':[]};Promise[_0x929d('0xcf')]()['then'](function(){if(_0x5443c4[_0x929d('0x29')][_0x929d('0xd0')]){if(!_[_0x929d('0xd1')](_0x379dc2,_0x5443c4[_0x929d('0x29')][_0x929d('0xd0')][_0x929d('0xd2')]())){throw new Error(_0x929d('0xd3'));}_0x379dc2=[_0x5443c4[_0x929d('0x29')][_0x929d('0xd0')][_0x929d('0xd2')]()];}if(_0x5443c4[_0x929d('0x29')][_0x929d('0xd4')]){try{var _0x5f305d=JSON[_0x929d('0xd5')](_0x5443c4[_0x929d('0x29')][_0x929d('0xd4')]);if(!moment(_0x5f305d['from'])[_0x929d('0xd6')]()){throw new Error(_0x929d('0xd7'));}if(!moment(_0x5f305d['to'])[_0x929d('0xd6')]()){throw new Error(_0x929d('0xd8'));}}catch(_0x2f51a2){throw new Error(_0x929d('0xd9'));}}if(!_0x5443c4[_0x929d('0x29')]['hasOwnProperty'](_0x929d('0x84'))){_0x3de095[_0x929d('0xf')]=qs[_0x929d('0xf')](_0x5443c4['query'][_0x929d('0xf')]||0xa);_0x3de095[_0x929d('0xe')]=qs[_0x929d('0xe')](_0x5443c4['query']['offset']);}var _0x459dad=_0x379dc2[_0x929d('0x6a')](function(_0x1afeb1){if(_0x1afeb1==='voice'){var _0x94146e={'attributes':['id','uniqueid',_0x929d('0x2f'),_0x929d('0xda'),_0x929d('0xdb'),'callerid',_0x929d('0xdc'),_0x929d('0xdd'),'duration',_0x929d('0xde'),_0x929d('0xdf'),_0x929d('0xe0'),_0x929d('0xe1'),_0x929d('0xe2'),_0x929d('0xe3')],'where':{'ContactId':_0x5443c4[_0x929d('0x21')]['id']},'include':[{'model':db[_0x929d('0xba')],'as':_0x929d('0xba'),'attributes':['id',_0x929d('0x19'),_0x929d('0xe4'),'alias']}],'order':[[_0x929d('0xdf'),_0x929d('0xe5')]]};if(_0x5443c4['query'][_0x929d('0xd4')]){_0x94146e['where'][_0x929d('0xdf')]={'$gte':_0x5f305d[_0x929d('0x34')],'$lte':_0x5f305d['to']};}return db[_0x929d('0x4a')][_0x929d('0xe6')](_0x94146e)[_0x929d('0x15')](function(_0x5d8ec4){_0x3fc0a0[_0x929d('0x11')]+=_0x5d8ec4[_0x929d('0x11')];return _['map'](_0x5d8ec4['rows'],function(_0x3b9d6f){var _0x44a343=_0x3b9d6f[_0x929d('0x35')]({'plain':!![]});_0x44a343[_0x929d('0xd0')]=_0x1afeb1;if(_0x44a343[_0x929d('0xba')]){_0x44a343[_0x929d('0xba')]={'id':_0x44a343[_0x929d('0xba')]['id'],'name':_0x44a343['User'][_0x929d('0x19')],'fullname':_0x44a343[_0x929d('0xba')][_0x929d('0xe4')],'alias':_0x44a343[_0x929d('0xba')][_0x929d('0x2d')]};}return _0x44a343;});});}else{var _0x219b21=_[_0x929d('0xe7')](_0x1afeb1)+(_0x1afeb1===_0x929d('0xc9')?'Website':_0x929d('0xe8'));var _0x4c3a09={'attributes':['id',_0x929d('0xe9'),'closedAt','createdAt',_0x929d('0xde'),_0x929d('0xea'),_0x929d('0xeb'),'thirdDisposition','UserId',_0x219b21+'Id'],'where':{'ContactId':_0x5443c4[_0x929d('0x21')]['id']},'include':[{'model':db[_0x219b21],'as':_0x929d('0xe8'),'attributes':['id','name','key']},{'model':db[_0x929d('0xba')],'as':_0x929d('0xec'),'attributes':['id','name','fullname']},{'model':db[_0x929d('0x79')],'as':'Tags','attributes':['id',_0x929d('0x19'),'color'],'through':{'attributes':[]}}],'order':[[_0x929d('0xdf'),_0x929d('0xe5')]]};if(_0x5443c4[_0x929d('0x29')]['range']){_0x4c3a09[_0x929d('0x5b')][_0x929d('0xdf')]={'$gte':_0x5f305d['from'],'$lte':_0x5f305d['to']};}switch(_0x1afeb1){case _0x929d('0xc9'):_0x4c3a09[_0x929d('0x7d')][_0x929d('0x68')]('browserName',_0x929d('0xed'),_0x929d('0xee'),_0x929d('0xef'),_0x929d('0xf0'),_0x929d('0xf1'),_0x929d('0xf2'),'ratingValue',_0x929d('0xf3'));break;case _0x929d('0xc8'):_0x4c3a09[_0x929d('0x7d')][_0x929d('0x68')](_0x929d('0xf4'),_0x929d('0xf5'));break;case _0x929d('0xcb'):_0x4c3a09[_0x929d('0x7d')][_0x929d('0x68')](_0x929d('0xf6'),_0x929d('0xf7'));break;}return db[_[_0x929d('0xe7')](_0x1afeb1)+'Interaction'][_0x929d('0xe6')](_0x4c3a09)['then'](function(_0xd5e6c4){_0x3fc0a0['count']+=_0xd5e6c4['count'];return _[_0x929d('0x6a')](_0xd5e6c4[_0x929d('0xa0')],function(_0x391cf6){var _0x9452b3=_0x391cf6[_0x929d('0x35')]({'plain':!![]});_0x9452b3[_0x929d('0xd0')]=_0x1afeb1;if(_0x9452b3[_0x929d('0xec')]){_0x9452b3[_0x929d('0xec')]={'id':_0x9452b3[_0x929d('0xec')]['id'],'name':_0x9452b3['Owner'][_0x929d('0x19')],'fullname':_0x9452b3[_0x929d('0xec')]['fullname']};}return _0x9452b3;});});}});return Promise[_0x929d('0x87')](_0x459dad);})[_0x929d('0x15')](function(_0x2a0ca8){return _(_0x2a0ca8)[_0x929d('0xf8')]()[_0x929d('0xf9')]('createdAt')[_0x929d('0xfa')]()['value']();})['then'](function(_0x27da5d){_0x3fc0a0[_0x929d('0xa0')]=_0x3de095['limit']?_0x27da5d[_0x929d('0xfb')](_0x3de095[_0x929d('0xe')],_0x3de095[_0x929d('0xe')]+_0x3de095['limit']):_0x27da5d;return _0x3fc0a0;})[_0x929d('0x15')](respondWithFilteredResult(_0x553f54,_0x3de095))[_0x929d('0x1e')](handleError(_0x553f54,null));}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.events.js b/server/api/cmContact/cmContact.events.js index f57b25f..f450401 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 _0x0bb2=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','CmContact','save','update'];(function(_0x30c5ee,_0x5b84da){var _0x5609e5=function(_0x4b8e66){while(--_0x4b8e66){_0x30c5ee['push'](_0x30c5ee['shift']());}};_0x5609e5(++_0x5b84da);}(_0x0bb2,0x199));var _0x20bb=function(_0x48f406,_0x5ba83f){_0x48f406=_0x48f406-0x0;var _0x5be5ec=_0x0bb2[_0x48f406];return _0x5be5ec;};'use strict';var EventEmitter=require(_0x20bb('0x0'));var CmContact=require(_0x20bb('0x1'))['db'][_0x20bb('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x20bb('0x3'),'afterUpdate':_0x20bb('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2bc4e8){return function(_0x4055d2,_0x43a05d,_0x41f720){CmContactEvents['emit'](_0x2bc4e8+':'+_0x4055d2['id'],_0x4055d2);CmContactEvents[_0x20bb('0x5')](_0x2bc4e8,_0x4055d2);_0x41f720(null);};}for(var e in events){if(events[_0x20bb('0x6')](e)){var event=events[e];CmContact[_0x20bb('0x7')](e,emitEvent(event));}}module[_0x20bb('0x8')]=CmContactEvents; \ No newline at end of file +var _0x7741=['hook','events','../../mysqldb','CmContact','update','emit','hasOwnProperty'];(function(_0x578578,_0x2b5900){var _0x41b0a1=function(_0x5ec182){while(--_0x5ec182){_0x578578['push'](_0x578578['shift']());}};_0x41b0a1(++_0x2b5900);}(_0x7741,0x166));var _0x1774=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0x7741[_0x4b2863];return _0x567d67;};'use strict';var EventEmitter=require(_0x1774('0x0'));var CmContact=require(_0x1774('0x1'))['db'][_0x1774('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x1774('0x3'),'afterDestroy':'remove'};function emitEvent(_0x870b91){return function(_0xb42cf1,_0x557d6d,_0x5a8d19){CmContactEvents[_0x1774('0x4')](_0x870b91+':'+_0xb42cf1['id'],_0xb42cf1);CmContactEvents[_0x1774('0x4')](_0x870b91,_0xb42cf1);_0x5a8d19(null);};}for(var e in events){if(events[_0x1774('0x5')](e)){var event=events[e];CmContact[_0x1774('0x6')](e,emitEvent(event));}}module['exports']=CmContactEvents; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.model.js b/server/api/cmContact/cmContact.model.js index 6a54bb7..bb4b0fd 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 _0x6312=['moment','bluebird','request-promise','path','rimraf','../../config/environment','../../config/environment/shared','exports','define','CmContact','cm_contacts','phone','fti_cm_contacts','firstName','mobile','fax','email','utf8mb4','utf8mb4_unicode_ci','models','get','cmContact','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','VoiceQueue','findOne','then','timezones','utcOffset','CmHopper','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','ListId','priority','callbackUniqueid','catch','ret','CmHopperFinal','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','create','error','afterCreate','inspect','Campaign','add','minutes','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','findAll','outbound','dialCheckDuplicateType','CmList','Lists','length','always','onlyIfOpen','BlackLists','CmHopperBlack','message','cmContact,\x20%s,\x20%s','List\x20not\x20found','isEmpty','ContactId','CampaignId','all','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','util','../../config/logger','api'];(function(_0x454f0e,_0x488e84){var _0x50c5d4=function(_0x16e147){while(--_0x16e147){_0x454f0e['push'](_0x454f0e['shift']());}};_0x50c5d4(++_0x488e84);}(_0x6312,0x1b9));var _0x2631=function(_0x260e1a,_0x1db75b){_0x260e1a=_0x260e1a-0x0;var _0xcd8e1d=_0x6312[_0x260e1a];return _0xcd8e1d;};'use strict';var _=require('lodash');var util=require(_0x2631('0x0'));var logger=require(_0x2631('0x1'))(_0x2631('0x2'));var moment=require(_0x2631('0x3'));var BPromise=require(_0x2631('0x4'));var rp=require(_0x2631('0x5'));var fs=require('fs');var path=require(_0x2631('0x6'));var rimraf=require(_0x2631('0x7'));var config=require(_0x2631('0x8'));var shared=require(_0x2631('0x9'));var attributes=require('./cmContact.attributes');module[_0x2631('0xa')]=function(_0x2260f2,_0xfb1bd0){return _0x2260f2[_0x2631('0xb')](_0x2631('0xc'),attributes,{'tableName':_0x2631('0xd'),'paranoid':!![],'indexes':[{'name':_0x2631('0xe'),'fields':[_0x2631('0xe')]},{'name':_0x2631('0xf'),'fields':[_0x2631('0x10'),'lastName',_0x2631('0xe'),_0x2631('0x11'),_0x2631('0x12'),_0x2631('0x13')],'type':'FULLTEXT'}],'timestamps':!![],'charset':_0x2631('0x14'),'collate':_0x2631('0x15'),'hooks':{'afterCreate':function(_0xa2ad44,_0x2b5669,_0x49f046){var _0x21a3f2=_0x2260f2[_0x2631('0x16')];var _0x147ccc=_0xa2ad44[_0x2631('0x17')]({'plain':!![]});function _0x597a21(){return function(_0x1aa6ed){logger['error'](_0x2631('0x18'),'afterCreate',util['inspect'](_0x1aa6ed,{'showHidden':![],'depth':null}));};}function _0x523631(_0x59e343,_0x33310e){var _0x48b051=_0x33310e[_0x2631('0x19')]?_0x33310e['scheduledat']:moment()[_0x2631('0x1a')](_0x2631('0x1b'));return new BPromise(function(_0xa480c4,_0x2385ce){if(_[_0x2631('0x1c')](_0x33310e[_0x2631('0x1d')])){_0xa480c4({'ret':_0x48b051});}else{_0x21a3f2[_0x2631('0x1e')][_0x2631('0x1f')]({'where':{'id':_0x59e343['id']}})[_0x2631('0x20')](function(_0x116297){if(!_[_0x2631('0x1c')](_0x116297)){var _0x4ce9b3=_0x116297[_0x2631('0x1d')];if(!_['isNil'](_0x4ce9b3)){var _0x5bb88f=shared[_0x2631('0x21')];var _0x4e5446=_0x5bb88f[_0x4ce9b3];var _0x2aec01=_0x5bb88f[_0x33310e[_0x2631('0x1d')]];if(!_[_0x2631('0x1c')](_0x4e5446)&&!_[_0x2631('0x1c')](_0x2aec01)){var _0x54d741=_0x4e5446[_0x2631('0x22')]-_0x2aec01[_0x2631('0x22')];_0x48b051=_0x33310e['scheduledat']?_0x33310e[_0x2631('0x19')]:moment();var _0x5ca67c=moment(_0x48b051)['add'](_0x54d741,'minutes');_0xa480c4({'ret':_0x5ca67c[_0x2631('0x1a')](_0x2631('0x1b'))});}else _0xa480c4({'ret':_0x48b051});}else _0xa480c4({'ret':_0x48b051});}else{_0xa480c4({'ret':_0x48b051});}});}});return 0xa;}var _0x3ff15a=function(_0xb9dc5b){return new BPromise(function(_0x280448,_0x231e6e){_0x523631(_0xb9dc5b,_0x147ccc)['then'](function(_0x1601c6){_0x147ccc[_0x2631('0x19')]=_0x1601c6['ret'];_0x21a3f2[_0x2631('0x23')][_0x2631('0x1f')]({'where':{'phone':_0x147ccc['phone'],'VoiceQueueId':_0xb9dc5b['id']}})[_0x2631('0x20')](function(_0x591cf2){if(!_[_0x2631('0x1c')](_0x591cf2)){throw new Error(_0x2631('0x24')+_0x147ccc[_0x2631('0xe')]+_0x2631('0x25')+_0xb9dc5b['id']);}return _0x21a3f2[_0x2631('0x23')]['create']({'phone':_0x147ccc[_0x2631('0xe')],'ContactId':_0x147ccc['id'],'ListId':_0x147ccc[_0x2631('0x26')],'priority':_0x147ccc[_0x2631('0x27')]?_0x147ccc['priority']:0x2,'scheduledat':_0x147ccc['scheduledat']?_0x147ccc[_0x2631('0x19')]:moment()[_0x2631('0x1a')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x147ccc[_0x2631('0x28')]?!![]:![],'callbackuniqueid':_0x147ccc['callbackUniqueid']?_0x147ccc[_0x2631('0x28')]:undefined,'callbackat':_0x147ccc[_0x2631('0x28')]?moment()[_0x2631('0x1a')](_0x2631('0x1b')):undefined,'VoiceQueueId':_0xb9dc5b['id']});})[_0x2631('0x29')](function(_0x9b80d0){_0x231e6e(_0x9b80d0);});});});};var _0x5d65be=function(_0x3d378b){return new BPromise(function(_0x236f58,_0x4dbe02){_0x523631(_0x3d378b,_0x147ccc)['then'](function(_0x3d9542){_0x147ccc[_0x2631('0x19')]=_0x3d9542[_0x2631('0x2a')];_0x21a3f2[_0x2631('0x23')][_0x2631('0x1f')]({'where':{'phone':_0x147ccc[_0x2631('0xe')],'VoiceQueueId':_0x3d378b['id']}})[_0x2631('0x20')](function(_0x4d0956){if(!_[_0x2631('0x1c')](_0x4d0956)){throw new Error(_0x2631('0x24')+_0x147ccc[_0x2631('0xe')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x3d378b['id']);}return _0x21a3f2[_0x2631('0x2b')][_0x2631('0x1f')]({'where':{'calleridnum':_0x147ccc[_0x2631('0xe')],'VoiceQueueId':_0x3d378b['id']}});})['then'](function(_0x3c03fd){if(!_['isNil'](_0x3c03fd)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x147ccc[_0x2631('0xe')]+_0x2631('0x2c')+_0x3d378b['id']);}return _0x21a3f2[_0x2631('0x23')][_0x2631('0x2d')]({'phone':_0x147ccc[_0x2631('0xe')],'ContactId':_0x147ccc['id'],'ListId':_0x147ccc[_0x2631('0x26')],'priority':_0x147ccc[_0x2631('0x27')]?_0x147ccc[_0x2631('0x27')]:0x2,'scheduledat':_0x147ccc['scheduledat']?_0x147ccc[_0x2631('0x19')]:moment()[_0x2631('0x1a')](_0x2631('0x1b')),'callback':_0x147ccc[_0x2631('0x28')]?!![]:![],'callbackuniqueid':_0x147ccc[_0x2631('0x28')]?_0x147ccc[_0x2631('0x28')]:undefined,'callbackat':_0x147ccc[_0x2631('0x28')]?moment()[_0x2631('0x1a')](_0x2631('0x1b')):undefined,'VoiceQueueId':_0x3d378b['id']});})[_0x2631('0x29')](function(_0x58fd52){_0x4dbe02(_0x58fd52);});});});};function _0x34a222(){return function(_0x92390){logger[_0x2631('0x2e')](_0x2631('0x18'),_0x2631('0x2f'),util[_0x2631('0x30')](_0x92390,{'showHidden':![],'depth':null}));};}function _0x513ce9(_0x3ee7eb,_0x4ea178){var _0x419be9=_0x4ea178[_0x2631('0x19')]?_0x4ea178[_0x2631('0x19')]:moment()[_0x2631('0x1a')](_0x2631('0x1b'));return new BPromise(function(_0x10a9de,_0x7c8e80){if(_[_0x2631('0x1c')](_0x4ea178[_0x2631('0x1d')])){_0x10a9de({'ret':_0x419be9});}else{_0x21a3f2[_0x2631('0x31')]['findOne']({'where':{'id':_0x3ee7eb['id']}})[_0x2631('0x20')](function(_0x1fd0f2){if(!_['isNil'](_0x1fd0f2)){var _0x457cc6=_0x1fd0f2['dialTimezone'];if(!_[_0x2631('0x1c')](_0x457cc6)){var _0x3c238d=shared[_0x2631('0x21')];var _0x50e2b6=_0x3c238d[_0x457cc6];var _0x1fa755=_0x3c238d[_0x4ea178[_0x2631('0x1d')]];if(!_[_0x2631('0x1c')](_0x50e2b6)&&!_[_0x2631('0x1c')](_0x1fa755)){var _0x1d46a6=_0x50e2b6[_0x2631('0x22')]-_0x1fa755[_0x2631('0x22')];_0x419be9=_0x4ea178[_0x2631('0x19')]?_0x4ea178[_0x2631('0x19')]:moment();var _0x2befdb=moment(_0x419be9)[_0x2631('0x32')](_0x1d46a6,_0x2631('0x33'));_0x10a9de({'ret':_0x2befdb[_0x2631('0x1a')](_0x2631('0x1b'))});}else _0x10a9de({'ret':_0x419be9});}else _0x10a9de({'ret':_0x419be9});}else{_0x10a9de({'ret':_0x419be9});}});}});return 0xa;}var _0x2c6b27=function(_0x7e00b2){return new BPromise(function(_0xfaf526,_0x147a80){_0x513ce9(_0x7e00b2,_0x147ccc)[_0x2631('0x20')](function(_0x5deabd){_0x147ccc['scheduledat']=_0x5deabd['ret'];_0x21a3f2['CmHopper'][_0x2631('0x1f')]({'where':{'phone':_0x147ccc['phone'],'CampaignId':_0x7e00b2['id']}})[_0x2631('0x20')](function(_0x107eab){if(!_[_0x2631('0x1c')](_0x107eab)){throw new Error(_0x2631('0x24')+_0x147ccc['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x7e00b2['id']);}return _0x21a3f2['CmHopper'][_0x2631('0x2d')]({'phone':_0x147ccc[_0x2631('0xe')],'ContactId':_0x147ccc['id'],'ListId':_0x147ccc[_0x2631('0x26')],'priority':_0x147ccc[_0x2631('0x27')]?_0x147ccc[_0x2631('0x27')]:0x2,'scheduledat':_0x147ccc[_0x2631('0x19')]?_0x147ccc['scheduledat']:moment()[_0x2631('0x1a')](_0x2631('0x1b')),'callback':_0x147ccc['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x147ccc[_0x2631('0x28')]?_0x147ccc['callbackUniqueid']:undefined,'callbackat':_0x147ccc['callbackUniqueid']?moment()[_0x2631('0x1a')](_0x2631('0x1b')):undefined,'CampaignId':_0x7e00b2['id']});})[_0x2631('0x29')](function(_0x451883){_0x147a80(_0x451883);});});});};var _0x5d1fde=function(_0x17d0f9){return new BPromise(function(_0x21342e,_0x38d412){_0x513ce9(_0x17d0f9,_0x147ccc)[_0x2631('0x20')](function(_0x36af6c){_0x147ccc[_0x2631('0x19')]=_0x36af6c['ret'];_0x21a3f2[_0x2631('0x23')][_0x2631('0x1f')]({'where':{'phone':_0x147ccc[_0x2631('0xe')],'CampaignId':_0x17d0f9['id']}})[_0x2631('0x20')](function(_0x639255){if(!_[_0x2631('0x1c')](_0x639255)){throw new Error(_0x2631('0x24')+_0x147ccc[_0x2631('0xe')]+_0x2631('0x34')+_0x17d0f9['id']);}return _0x21a3f2[_0x2631('0x2b')][_0x2631('0x1f')]({'where':{'calleridnum':_0x147ccc['phone'],'CampaignId':_0x17d0f9['id']}});})[_0x2631('0x20')](function(_0x2bd789){if(!_[_0x2631('0x1c')](_0x2bd789)){throw new Error(_0x2631('0x35')+_0x147ccc[_0x2631('0xe')]+_0x2631('0x36')+_0x17d0f9['id']);}return _0x21a3f2[_0x2631('0x23')][_0x2631('0x2d')]({'phone':_0x147ccc[_0x2631('0xe')],'ContactId':_0x147ccc['id'],'ListId':_0x147ccc['ListId'],'priority':_0x147ccc[_0x2631('0x27')]?_0x147ccc[_0x2631('0x27')]:0x2,'scheduledat':_0x147ccc[_0x2631('0x19')]?_0x147ccc[_0x2631('0x19')]:moment()[_0x2631('0x1a')](_0x2631('0x1b')),'callback':_0x147ccc[_0x2631('0x28')]?!![]:![],'callbackuniqueid':_0x147ccc[_0x2631('0x28')]?_0x147ccc[_0x2631('0x28')]:undefined,'callbackat':_0x147ccc['callbackUniqueid']?moment()[_0x2631('0x1a')](_0x2631('0x1b')):undefined,'CampaignId':_0x17d0f9['id']});})[_0x2631('0x29')](function(_0x2b47f8){_0x38d412(_0x2b47f8);});});});};if(_0x147ccc[_0x2631('0x26')]){_0x21a3f2['VoiceQueue'][_0x2631('0x37')]({'where':{'type':_0x2631('0x38')},'attributes':['id',_0x2631('0x39'),'dialTimezone'],'include':[{'model':_0x21a3f2[_0x2631('0x3a')],'as':_0x2631('0x3b'),'where':{'id':_0x147ccc[_0x2631('0x26')]}}]})[_0x2631('0x20')](function(_0x4bfc5d){if(_0x4bfc5d){var _0x59f328=[];for(var _0x5ba164=0x0,_0x12e723;_0x5ba164<_0x4bfc5d[_0x2631('0x3c')];_0x5ba164+=0x1){_0x12e723=_0x4bfc5d[_0x5ba164][_0x2631('0x17')]({'plain':!![]});switch(_0x12e723['dialCheckDuplicateType']){case _0x2631('0x3d'):_0x5d65be(_0x12e723)[_0x2631('0x29')](_0x597a21());break;case _0x2631('0x3e'):_0x3ff15a(_0x12e723)[_0x2631('0x29')](_0x597a21());break;default:_0x513ce9(_0x12e723,_0x147ccc)[_0x2631('0x20')](function(_0x8b0bce){_0x147ccc['scheduledat']=_0x8b0bce[_0x2631('0x2a')];_0x21a3f2[_0x2631('0x23')][_0x2631('0x2d')]({'phone':_0x147ccc[_0x2631('0xe')],'ContactId':_0x147ccc['id'],'ListId':_0x147ccc[_0x2631('0x26')],'scheduledat':_0x147ccc[_0x2631('0x19')]?_0x147ccc[_0x2631('0x19')]:moment()[_0x2631('0x1a')](_0x2631('0x1b')),'priority':_0x147ccc[_0x2631('0x27')]?_0x147ccc[_0x2631('0x27')]:0x2,'callback':_0x147ccc['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x147ccc[_0x2631('0x28')]?_0x147ccc[_0x2631('0x28')]:undefined,'callbackat':_0x147ccc[_0x2631('0x28')]?moment()[_0x2631('0x1a')](_0x2631('0x1b')):undefined,'VoiceQueueId':_0x12e723['id']})[_0x2631('0x29')](_0x597a21());});}}}})[_0x2631('0x20')](function(){return _0x21a3f2[_0x2631('0x1e')][_0x2631('0x37')]({'where':{'type':_0x2631('0x38')},'attributes':['id'],'include':[{'model':_0x21a3f2['CmList'],'as':_0x2631('0x3f'),'where':{'id':_0x147ccc[_0x2631('0x26')]}}]})[_0x2631('0x20')](function(_0x5d859f){if(_0x5d859f){var _0x971afa=[];for(var _0xb2a817=0x0,_0x26ac65;_0xb2a817<_0x5d859f['length'];_0xb2a817+=0x1){_0x26ac65=_0x5d859f[_0xb2a817][_0x2631('0x17')]({'plain':!![]});_0x21a3f2[_0x2631('0x40')]['create']({'phone':_0x147ccc[_0x2631('0xe')],'ContactId':_0x147ccc['id'],'ListId':_0x147ccc[_0x2631('0x26')],'VoiceQueueId':_0x26ac65['id']})['catch'](function(_0x184e24){logger['error']('cmContact,\x20%s,\x20%s',_0x2631('0x2f'),_0x184e24[_0x2631('0x41')]);});}}});})[_0x2631('0x20')](function(){return _0x21a3f2[_0x2631('0x31')][_0x2631('0x37')]({'attributes':['id','dialCheckDuplicateType','dialTimezone'],'include':[{'model':_0x21a3f2[_0x2631('0x3a')],'as':_0x2631('0x3b'),'where':{'id':_0x147ccc['ListId']}}]})[_0x2631('0x20')](function(_0x3fe49d){if(_0x3fe49d){var _0x5af9c9=[];for(var _0x3874bf=0x0,_0x4fa676;_0x3874bf<_0x3fe49d[_0x2631('0x3c')];_0x3874bf+=0x1){_0x4fa676=_0x3fe49d[_0x3874bf][_0x2631('0x17')]({'plain':!![]});switch(_0x4fa676[_0x2631('0x39')]){case _0x2631('0x3d'):_0x5d1fde(_0x4fa676)['catch'](_0x34a222());break;case'onlyIfOpen':_0x2c6b27(_0x4fa676)['catch'](_0x34a222());break;default:_0x21a3f2[_0x2631('0x23')][_0x2631('0x2d')]({'phone':_0x147ccc[_0x2631('0xe')],'ContactId':_0x147ccc['id'],'ListId':_0x147ccc[_0x2631('0x26')],'scheduledat':_0x147ccc[_0x2631('0x19')]?_0x147ccc[_0x2631('0x19')]:moment()[_0x2631('0x1a')](_0x2631('0x1b')),'priority':_0x147ccc[_0x2631('0x27')]?_0x147ccc[_0x2631('0x27')]:0x2,'callback':_0x147ccc[_0x2631('0x28')]?!![]:![],'callbackuniqueid':_0x147ccc['callbackUniqueid']?_0x147ccc[_0x2631('0x28')]:undefined,'callbackat':_0x147ccc['callbackUniqueid']?moment()[_0x2631('0x1a')](_0x2631('0x1b')):undefined,'CampaignId':_0x4fa676['id']})[_0x2631('0x29')](_0x34a222());}}}});})[_0x2631('0x20')](function(){return _0x21a3f2[_0x2631('0x31')][_0x2631('0x37')]({'attributes':['id'],'include':[{'model':_0x21a3f2['CmList'],'as':_0x2631('0x3f'),'where':{'id':_0x147ccc[_0x2631('0x26')]}}]})[_0x2631('0x20')](function(_0x1ec374){if(_0x1ec374){var _0x516fa5=[];for(var _0x5470e4=0x0,_0x16ff8e;_0x5470e4<_0x1ec374['length'];_0x5470e4+=0x1){_0x16ff8e=_0x1ec374[_0x5470e4]['get']({'plain':!![]});_0x21a3f2[_0x2631('0x40')][_0x2631('0x2d')]({'phone':_0x147ccc[_0x2631('0xe')],'ContactId':_0x147ccc['id'],'ListId':_0x147ccc[_0x2631('0x26')],'CampaignId':_0x16ff8e['id']})[_0x2631('0x29')](function(_0x1fc86e){logger['error']('cmContact,\x20%s,\x20%s','afterCreate',_0x1fc86e[_0x2631('0x41')]);});}}});})[_0x2631('0x20')](function(){_0x49f046();})[_0x2631('0x29')](function(_0x269013){logger[_0x2631('0x2e')](_0x2631('0x42'),_0x2631('0x2f'),_0x269013[_0x2631('0x41')]);_0x49f046(_0x269013);});}else{_0x49f046(new Error(_0x2631('0x43')));}},'afterDestroy':function(_0x56ebcf,_0x5f0a69,_0x2c827a){var _0x474a4b=_0x2260f2['models'];var _0x20c38c=_0x56ebcf[_0x2631('0x17')]({'plain':!![]});return _0x474a4b[_0x2631('0x23')][_0x2631('0x37')]({'raw':!![],'where':{'ListId':_0x20c38c[_0x2631('0x26')],'ContactId':_0x20c38c['id']}})[_0x2631('0x20')](function(_0xabb736){if(!_[_0x2631('0x44')](_0xabb736)){var _0x184c95=[];for(var _0x2e997d=0x0;_0x2e997d<_0xabb736[_0x2631('0x3c')];_0x2e997d+=0x1){var _0x231c85=_0x474a4b[_0x2631('0x23')]['destroy']({'where':{'ListId':_0xabb736[_0x2e997d]['ListId'],'ContactId':_0xabb736[_0x2e997d][_0x2631('0x45')],'VoiceQueueId':_0xabb736[_0x2e997d]['VoiceQueueId'],'CampaignId':_0xabb736[_0x2e997d][_0x2631('0x46')]}});_0x184c95['push'](_0x231c85);}return BPromise[_0x2631('0x47')](_0x184c95);}})['then'](function(_0x36ea13){logger['info'](_0x2631('0x48'),util[_0x2631('0x30')](_0x36ea13,{'showHidden':![],'depth':null}));_0x2c827a();})[_0x2631('0x29')](function(_0x2a4a45){logger[_0x2631('0x2e')](_0x2631('0x49'),util[_0x2631('0x30')](_0x2a4a45,{'showHidden':![],'depth':null}));_0x2c827a(_0x2a4a45);});}}});}; \ No newline at end of file +var _0x6087=['lastName','mobile','email','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','models','error','cmContact','inspect','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','dialTimezone','VoiceQueue','findOne','then','isNil','timezones','utcOffset','add','minutes','ret','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','priority','callbackUniqueid','CmHopper','CmHopperFinal','cmContact,\x20afterCreate,\x20','create','ListId','catch','afterCreate','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','findAll','outbound','dialCheckDuplicateType','CmList','get','always','onlyIfOpen','BlackLists','length','CmHopperBlack','cmContact,\x20%s,\x20%s','Lists','message','List\x20not\x20found','isEmpty','ContactId','CampaignId','all','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','util','api','request-promise','path','rimraf','../../config/environment/shared','exports','define','cm_contacts','phone','fti_cm_contacts','firstName'];(function(_0x4e93a9,_0x413f30){var _0x43013c=function(_0x3a0cf3){while(--_0x3a0cf3){_0x4e93a9['push'](_0x4e93a9['shift']());}};_0x43013c(++_0x413f30);}(_0x6087,0xc6));var _0x7608=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6087[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x7608('0x0'));var logger=require('../../config/logger')(_0x7608('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7608('0x2'));var fs=require('fs');var path=require(_0x7608('0x3'));var rimraf=require(_0x7608('0x4'));var config=require('../../config/environment');var shared=require(_0x7608('0x5'));var attributes=require('./cmContact.attributes');module[_0x7608('0x6')]=function(_0x358c33,_0x12c868){return _0x358c33[_0x7608('0x7')]('CmContact',attributes,{'tableName':_0x7608('0x8'),'paranoid':!![],'indexes':[{'name':_0x7608('0x9'),'fields':['phone']},{'name':_0x7608('0xa'),'fields':[_0x7608('0xb'),_0x7608('0xc'),'phone',_0x7608('0xd'),'fax',_0x7608('0xe')],'type':_0x7608('0xf')}],'timestamps':!![],'charset':_0x7608('0x10'),'collate':_0x7608('0x11'),'hooks':{'afterCreate':function(_0x984252,_0x28c986,_0x343e87){var _0x3fbad3=_0x358c33[_0x7608('0x12')];var _0x231a97=_0x984252['get']({'plain':!![]});function _0x599627(){return function(_0x100f33){logger[_0x7608('0x13')](_0x7608('0x14'),'afterCreate',util[_0x7608('0x15')](_0x100f33,{'showHidden':![],'depth':null}));};}function _0x5c89e7(_0xa92423,_0x22ad3a){var _0xadfc26=_0x22ad3a[_0x7608('0x16')]?_0x22ad3a['scheduledat']:moment()[_0x7608('0x17')](_0x7608('0x18'));return new BPromise(function(_0x57055c,_0x3ee8d2){if(_['isNil'](_0x22ad3a[_0x7608('0x19')])){_0x57055c({'ret':_0xadfc26});}else{_0x3fbad3[_0x7608('0x1a')][_0x7608('0x1b')]({'where':{'id':_0xa92423['id']}})[_0x7608('0x1c')](function(_0x15196d){if(!_[_0x7608('0x1d')](_0x15196d)){var _0x17331c=_0x15196d['dialTimezone'];if(!_[_0x7608('0x1d')](_0x17331c)){var _0x3caeb9=shared[_0x7608('0x1e')];var _0x484429=_0x3caeb9[_0x17331c];var _0x10b3a7=_0x3caeb9[_0x22ad3a[_0x7608('0x19')]];if(!_[_0x7608('0x1d')](_0x484429)&&!_[_0x7608('0x1d')](_0x10b3a7)){var _0xdc0111=_0x484429[_0x7608('0x1f')]-_0x10b3a7[_0x7608('0x1f')];_0xadfc26=_0x22ad3a[_0x7608('0x16')]?_0x22ad3a['scheduledat']:moment();var _0x221b0c=moment(_0xadfc26)[_0x7608('0x20')](_0xdc0111,_0x7608('0x21'));_0x57055c({'ret':_0x221b0c['format']('YYYY-MM-DD\x20HH:mm:ss')});}else _0x57055c({'ret':_0xadfc26});}else _0x57055c({'ret':_0xadfc26});}else{_0x57055c({'ret':_0xadfc26});}});}});return 0xa;}var _0x1cbc43=function(_0x522f0e){return new BPromise(function(_0x6076ea,_0x5799c9){_0x5c89e7(_0x522f0e,_0x231a97)[_0x7608('0x1c')](function(_0x181680){_0x231a97[_0x7608('0x16')]=_0x181680[_0x7608('0x22')];_0x3fbad3['CmHopper']['findOne']({'where':{'phone':_0x231a97['phone'],'VoiceQueueId':_0x522f0e['id']}})[_0x7608('0x1c')](function(_0x11cc1f){if(!_[_0x7608('0x1d')](_0x11cc1f)){throw new Error(_0x7608('0x23')+_0x231a97[_0x7608('0x9')]+_0x7608('0x24')+_0x522f0e['id']);}return _0x3fbad3['CmHopper']['create']({'phone':_0x231a97[_0x7608('0x9')],'ContactId':_0x231a97['id'],'ListId':_0x231a97['ListId'],'priority':_0x231a97['priority']?_0x231a97[_0x7608('0x25')]:0x2,'scheduledat':_0x231a97['scheduledat']?_0x231a97['scheduledat']:moment()[_0x7608('0x17')](_0x7608('0x18')),'callback':_0x231a97['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x231a97[_0x7608('0x26')]?_0x231a97[_0x7608('0x26')]:undefined,'callbackat':_0x231a97['callbackUniqueid']?moment()['format'](_0x7608('0x18')):undefined,'VoiceQueueId':_0x522f0e['id']});})['catch'](function(_0x5154ce){_0x5799c9(_0x5154ce);});});});};var _0x53a412=function(_0x5c0ec0){return new BPromise(function(_0x59af5f,_0x45a70f){_0x5c89e7(_0x5c0ec0,_0x231a97)[_0x7608('0x1c')](function(_0x46696f){_0x231a97['scheduledat']=_0x46696f[_0x7608('0x22')];_0x3fbad3[_0x7608('0x27')][_0x7608('0x1b')]({'where':{'phone':_0x231a97['phone'],'VoiceQueueId':_0x5c0ec0['id']}})[_0x7608('0x1c')](function(_0x2661ef){if(!_[_0x7608('0x1d')](_0x2661ef)){throw new Error(_0x7608('0x23')+_0x231a97[_0x7608('0x9')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x5c0ec0['id']);}return _0x3fbad3[_0x7608('0x28')][_0x7608('0x1b')]({'where':{'calleridnum':_0x231a97['phone'],'VoiceQueueId':_0x5c0ec0['id']}});})['then'](function(_0x442f28){if(!_[_0x7608('0x1d')](_0x442f28)){throw new Error(_0x7608('0x29')+_0x231a97[_0x7608('0x9')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20'+_0x5c0ec0['id']);}return _0x3fbad3[_0x7608('0x27')][_0x7608('0x2a')]({'phone':_0x231a97[_0x7608('0x9')],'ContactId':_0x231a97['id'],'ListId':_0x231a97[_0x7608('0x2b')],'priority':_0x231a97[_0x7608('0x25')]?_0x231a97[_0x7608('0x25')]:0x2,'scheduledat':_0x231a97[_0x7608('0x16')]?_0x231a97[_0x7608('0x16')]:moment()[_0x7608('0x17')](_0x7608('0x18')),'callback':_0x231a97[_0x7608('0x26')]?!![]:![],'callbackuniqueid':_0x231a97[_0x7608('0x26')]?_0x231a97[_0x7608('0x26')]:undefined,'callbackat':_0x231a97[_0x7608('0x26')]?moment()[_0x7608('0x17')](_0x7608('0x18')):undefined,'VoiceQueueId':_0x5c0ec0['id']});})[_0x7608('0x2c')](function(_0x152221){_0x45a70f(_0x152221);});});});};function _0x1f2e5a(){return function(_0x53a739){logger[_0x7608('0x13')](_0x7608('0x14'),_0x7608('0x2d'),util[_0x7608('0x15')](_0x53a739,{'showHidden':![],'depth':null}));};}function _0x27a00a(_0x44cf51,_0x3bc370){var _0xc19213=_0x3bc370['scheduledat']?_0x3bc370[_0x7608('0x16')]:moment()[_0x7608('0x17')]('YYYY-MM-DD\x20HH:mm:ss');return new BPromise(function(_0x1261d9,_0x648654){if(_['isNil'](_0x3bc370['dialTimezone'])){_0x1261d9({'ret':_0xc19213});}else{_0x3fbad3[_0x7608('0x2e')]['findOne']({'where':{'id':_0x44cf51['id']}})[_0x7608('0x1c')](function(_0xe7d9f8){if(!_[_0x7608('0x1d')](_0xe7d9f8)){var _0x2f895e=_0xe7d9f8[_0x7608('0x19')];if(!_[_0x7608('0x1d')](_0x2f895e)){var _0x25e463=shared['timezones'];var _0x1ed5d8=_0x25e463[_0x2f895e];var _0x2d2008=_0x25e463[_0x3bc370[_0x7608('0x19')]];if(!_[_0x7608('0x1d')](_0x1ed5d8)&&!_[_0x7608('0x1d')](_0x2d2008)){var _0x1a6b8c=_0x1ed5d8[_0x7608('0x1f')]-_0x2d2008[_0x7608('0x1f')];_0xc19213=_0x3bc370[_0x7608('0x16')]?_0x3bc370['scheduledat']:moment();var _0x3069ca=moment(_0xc19213)[_0x7608('0x20')](_0x1a6b8c,'minutes');_0x1261d9({'ret':_0x3069ca[_0x7608('0x17')](_0x7608('0x18'))});}else _0x1261d9({'ret':_0xc19213});}else _0x1261d9({'ret':_0xc19213});}else{_0x1261d9({'ret':_0xc19213});}});}});return 0xa;}var _0x315edc=function(_0x50fd23){return new BPromise(function(_0x3da2a8,_0x287ce6){_0x27a00a(_0x50fd23,_0x231a97)[_0x7608('0x1c')](function(_0x5412b8){_0x231a97[_0x7608('0x16')]=_0x5412b8['ret'];_0x3fbad3['CmHopper'][_0x7608('0x1b')]({'where':{'phone':_0x231a97['phone'],'CampaignId':_0x50fd23['id']}})[_0x7608('0x1c')](function(_0x53b640){if(!_[_0x7608('0x1d')](_0x53b640)){throw new Error('cmContact,\x20afterCreate\x20'+_0x231a97[_0x7608('0x9')]+_0x7608('0x2f')+_0x50fd23['id']);}return _0x3fbad3[_0x7608('0x27')][_0x7608('0x2a')]({'phone':_0x231a97[_0x7608('0x9')],'ContactId':_0x231a97['id'],'ListId':_0x231a97[_0x7608('0x2b')],'priority':_0x231a97[_0x7608('0x25')]?_0x231a97[_0x7608('0x25')]:0x2,'scheduledat':_0x231a97[_0x7608('0x16')]?_0x231a97[_0x7608('0x16')]:moment()[_0x7608('0x17')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x231a97[_0x7608('0x26')]?!![]:![],'callbackuniqueid':_0x231a97['callbackUniqueid']?_0x231a97[_0x7608('0x26')]:undefined,'callbackat':_0x231a97[_0x7608('0x26')]?moment()['format'](_0x7608('0x18')):undefined,'CampaignId':_0x50fd23['id']});})[_0x7608('0x2c')](function(_0x39828c){_0x287ce6(_0x39828c);});});});};var _0x176f32=function(_0x228818){return new BPromise(function(_0x315659,_0x4f958d){_0x27a00a(_0x228818,_0x231a97)['then'](function(_0x303fad){_0x231a97[_0x7608('0x16')]=_0x303fad[_0x7608('0x22')];_0x3fbad3[_0x7608('0x27')][_0x7608('0x1b')]({'where':{'phone':_0x231a97[_0x7608('0x9')],'CampaignId':_0x228818['id']}})[_0x7608('0x1c')](function(_0x511715){if(!_['isNil'](_0x511715)){throw new Error('cmContact,\x20afterCreate\x20'+_0x231a97[_0x7608('0x9')]+_0x7608('0x30')+_0x228818['id']);}return _0x3fbad3[_0x7608('0x28')][_0x7608('0x1b')]({'where':{'calleridnum':_0x231a97[_0x7608('0x9')],'CampaignId':_0x228818['id']}});})[_0x7608('0x1c')](function(_0x2a356f){if(!_[_0x7608('0x1d')](_0x2a356f)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x231a97['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20'+_0x228818['id']);}return _0x3fbad3['CmHopper'][_0x7608('0x2a')]({'phone':_0x231a97['phone'],'ContactId':_0x231a97['id'],'ListId':_0x231a97[_0x7608('0x2b')],'priority':_0x231a97['priority']?_0x231a97[_0x7608('0x25')]:0x2,'scheduledat':_0x231a97[_0x7608('0x16')]?_0x231a97[_0x7608('0x16')]:moment()[_0x7608('0x17')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x231a97['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x231a97['callbackUniqueid']?_0x231a97[_0x7608('0x26')]:undefined,'callbackat':_0x231a97[_0x7608('0x26')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x228818['id']});})[_0x7608('0x2c')](function(_0x1458a8){_0x4f958d(_0x1458a8);});});});};if(_0x231a97[_0x7608('0x2b')]){_0x3fbad3[_0x7608('0x1a')][_0x7608('0x31')]({'where':{'type':_0x7608('0x32')},'attributes':['id',_0x7608('0x33'),_0x7608('0x19')],'include':[{'model':_0x3fbad3[_0x7608('0x34')],'as':'Lists','where':{'id':_0x231a97[_0x7608('0x2b')]}}]})['then'](function(_0x1d86e7){if(_0x1d86e7){var _0x437d2e=[];for(var _0x53091b=0x0,_0x4ab06a;_0x53091b<_0x1d86e7['length'];_0x53091b+=0x1){_0x4ab06a=_0x1d86e7[_0x53091b][_0x7608('0x35')]({'plain':!![]});switch(_0x4ab06a[_0x7608('0x33')]){case _0x7608('0x36'):_0x53a412(_0x4ab06a)[_0x7608('0x2c')](_0x599627());break;case _0x7608('0x37'):_0x1cbc43(_0x4ab06a)['catch'](_0x599627());break;default:_0x27a00a(_0x4ab06a,_0x231a97)[_0x7608('0x1c')](function(_0x2c18d9){_0x231a97[_0x7608('0x16')]=_0x2c18d9[_0x7608('0x22')];_0x3fbad3['CmHopper'][_0x7608('0x2a')]({'phone':_0x231a97[_0x7608('0x9')],'ContactId':_0x231a97['id'],'ListId':_0x231a97[_0x7608('0x2b')],'scheduledat':_0x231a97[_0x7608('0x16')]?_0x231a97[_0x7608('0x16')]:moment()[_0x7608('0x17')](_0x7608('0x18')),'priority':_0x231a97[_0x7608('0x25')]?_0x231a97[_0x7608('0x25')]:0x2,'callback':_0x231a97[_0x7608('0x26')]?!![]:![],'callbackuniqueid':_0x231a97[_0x7608('0x26')]?_0x231a97['callbackUniqueid']:undefined,'callbackat':_0x231a97[_0x7608('0x26')]?moment()[_0x7608('0x17')](_0x7608('0x18')):undefined,'VoiceQueueId':_0x4ab06a['id']})['catch'](_0x599627());});}}}})['then'](function(){return _0x3fbad3[_0x7608('0x1a')][_0x7608('0x31')]({'where':{'type':_0x7608('0x32')},'attributes':['id'],'include':[{'model':_0x3fbad3[_0x7608('0x34')],'as':_0x7608('0x38'),'where':{'id':_0x231a97[_0x7608('0x2b')]}}]})['then'](function(_0x32789d){if(_0x32789d){var _0x65a88c=[];for(var _0x5256b8=0x0,_0x9ea7d9;_0x5256b8<_0x32789d[_0x7608('0x39')];_0x5256b8+=0x1){_0x9ea7d9=_0x32789d[_0x5256b8][_0x7608('0x35')]({'plain':!![]});_0x3fbad3[_0x7608('0x3a')][_0x7608('0x2a')]({'phone':_0x231a97['phone'],'ContactId':_0x231a97['id'],'ListId':_0x231a97[_0x7608('0x2b')],'VoiceQueueId':_0x9ea7d9['id']})[_0x7608('0x2c')](function(_0x2266da){logger[_0x7608('0x13')](_0x7608('0x3b'),'afterCreate',_0x2266da['message']);});}}});})[_0x7608('0x1c')](function(){return _0x3fbad3['Campaign'][_0x7608('0x31')]({'attributes':['id','dialCheckDuplicateType',_0x7608('0x19')],'include':[{'model':_0x3fbad3['CmList'],'as':_0x7608('0x3c'),'where':{'id':_0x231a97['ListId']}}]})[_0x7608('0x1c')](function(_0xefade7){if(_0xefade7){var _0x1d180a=[];for(var _0x17bea3=0x0,_0x446dbc;_0x17bea3<_0xefade7['length'];_0x17bea3+=0x1){_0x446dbc=_0xefade7[_0x17bea3]['get']({'plain':!![]});switch(_0x446dbc[_0x7608('0x33')]){case _0x7608('0x36'):_0x176f32(_0x446dbc)[_0x7608('0x2c')](_0x1f2e5a());break;case _0x7608('0x37'):_0x315edc(_0x446dbc)['catch'](_0x1f2e5a());break;default:_0x3fbad3['CmHopper']['create']({'phone':_0x231a97[_0x7608('0x9')],'ContactId':_0x231a97['id'],'ListId':_0x231a97[_0x7608('0x2b')],'scheduledat':_0x231a97[_0x7608('0x16')]?_0x231a97[_0x7608('0x16')]:moment()[_0x7608('0x17')](_0x7608('0x18')),'priority':_0x231a97[_0x7608('0x25')]?_0x231a97[_0x7608('0x25')]:0x2,'callback':_0x231a97['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x231a97[_0x7608('0x26')]?_0x231a97[_0x7608('0x26')]:undefined,'callbackat':_0x231a97[_0x7608('0x26')]?moment()[_0x7608('0x17')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x446dbc['id']})[_0x7608('0x2c')](_0x1f2e5a());}}}});})['then'](function(){return _0x3fbad3[_0x7608('0x2e')]['findAll']({'attributes':['id'],'include':[{'model':_0x3fbad3[_0x7608('0x34')],'as':_0x7608('0x38'),'where':{'id':_0x231a97[_0x7608('0x2b')]}}]})[_0x7608('0x1c')](function(_0x4d9270){if(_0x4d9270){var _0x5c4729=[];for(var _0x2cbe07=0x0,_0x1c3bb4;_0x2cbe07<_0x4d9270[_0x7608('0x39')];_0x2cbe07+=0x1){_0x1c3bb4=_0x4d9270[_0x2cbe07][_0x7608('0x35')]({'plain':!![]});_0x3fbad3['CmHopperBlack'][_0x7608('0x2a')]({'phone':_0x231a97[_0x7608('0x9')],'ContactId':_0x231a97['id'],'ListId':_0x231a97[_0x7608('0x2b')],'CampaignId':_0x1c3bb4['id']})['catch'](function(_0x2e0c2d){logger[_0x7608('0x13')](_0x7608('0x3b'),_0x7608('0x2d'),_0x2e0c2d[_0x7608('0x3d')]);});}}});})[_0x7608('0x1c')](function(){_0x343e87();})[_0x7608('0x2c')](function(_0x2eb9ea){logger[_0x7608('0x13')](_0x7608('0x3b'),_0x7608('0x2d'),_0x2eb9ea[_0x7608('0x3d')]);_0x343e87(_0x2eb9ea);});}else{_0x343e87(new Error(_0x7608('0x3e')));}},'afterDestroy':function(_0x2a5225,_0x448c21,_0x5a2f1f){var _0x37e944=_0x358c33[_0x7608('0x12')];var _0x58d07d=_0x2a5225['get']({'plain':!![]});return _0x37e944[_0x7608('0x27')][_0x7608('0x31')]({'raw':!![],'where':{'ListId':_0x58d07d[_0x7608('0x2b')],'ContactId':_0x58d07d['id']}})[_0x7608('0x1c')](function(_0x1a8976){if(!_[_0x7608('0x3f')](_0x1a8976)){var _0x58dd64=[];for(var _0x2d91f0=0x0;_0x2d91f0<_0x1a8976[_0x7608('0x39')];_0x2d91f0+=0x1){var _0x309735=_0x37e944[_0x7608('0x27')]['destroy']({'where':{'ListId':_0x1a8976[_0x2d91f0][_0x7608('0x2b')],'ContactId':_0x1a8976[_0x2d91f0][_0x7608('0x40')],'VoiceQueueId':_0x1a8976[_0x2d91f0]['VoiceQueueId'],'CampaignId':_0x1a8976[_0x2d91f0][_0x7608('0x41')]}});_0x58dd64['push'](_0x309735);}return BPromise[_0x7608('0x42')](_0x58dd64);}})[_0x7608('0x1c')](function(_0x227ab8){logger[_0x7608('0x43')](_0x7608('0x44'),util[_0x7608('0x15')](_0x227ab8,{'showHidden':![],'depth':null}));_0x5a2f1f();})['catch'](function(_0x43288f){logger[_0x7608('0x13')](_0x7608('0x45'),util['inspect'](_0x43288f,{'showHidden':![],'depth':null}));_0x5a2f1f(_0x43288f);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index 6956a21..44b40b7 100644 --- a/server/api/cmContact/cmContact.rpc.js +++ b/server/api/cmContact/cmContact.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['phone','ListId','Contact','CmContactId','create','body','keys','length','startsWith','update','table','cm_contacts','id\x20=\x20?','sequelize','query','CreateCmContact','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./cmContact.socket','register','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCmContact','CmContact','findAll','options','where','limit','include','map','model','attributes','then','stringify','CmContactHasItem','find'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var squel=require('squel');var db=require(_0x0a9e('0x4'))['db'];var utils=require(_0x0a9e('0x5'));var logger=require(_0x0a9e('0x6'))(_0x0a9e('0x7'));var config=require(_0x0a9e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0a9e('0x9')][_0x0a9e('0xa')]({'port':0x232a});config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithRpcPromise(_0x307b3e,_0x3ab53f,_0xfeb75b){return new BPromise(function(_0xbd1168,_0x4a4c56){return client['request'](_0x307b3e,_0xfeb75b)['then'](function(_0x4cfe67){logger[_0x0a9e('0xf')](_0x0a9e('0x10'),_0x3ab53f,_0x0a9e('0x11'));logger[_0x0a9e('0x12')](_0x0a9e('0x13'),_0x3ab53f,_0x0a9e('0x11'),JSON['stringify'](_0x4cfe67));if(_0x4cfe67[_0x0a9e('0x14')]){if(_0x4cfe67[_0x0a9e('0x14')][_0x0a9e('0x15')]===0x1f4){logger[_0x0a9e('0x14')](_0x0a9e('0x10'),_0x3ab53f,_0x4cfe67[_0x0a9e('0x14')]['message']);return _0x4a4c56(_0x4cfe67[_0x0a9e('0x14')]['message']);}logger[_0x0a9e('0x14')]('CmContact,\x20%s,\x20%s',_0x3ab53f,_0x4cfe67[_0x0a9e('0x14')][_0x0a9e('0x16')]);return _0xbd1168(_0x4cfe67['error'][_0x0a9e('0x16')]);}else{logger['info'](_0x0a9e('0x10'),_0x3ab53f,_0x0a9e('0x11'));_0xbd1168(_0x4cfe67[_0x0a9e('0x17')][_0x0a9e('0x16')]);}})[_0x0a9e('0x18')](function(_0x2eb11f){logger[_0x0a9e('0x14')](_0x0a9e('0x10'),_0x3ab53f,_0x2eb11f);_0x4a4c56(_0x2eb11f);});});}exports[_0x0a9e('0x19')]=function(_0x112016){var _0x1c696a=this;return new Promise(function(_0x105080,_0x4bb1e3){return db[_0x0a9e('0x1a')][_0x0a9e('0x1b')]({'raw':_0x112016['options']?_0x112016[_0x0a9e('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x112016['options']?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1d')]||null:null,'attributes':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')]['attributes']||null:null,'limit':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1e')]||null:null,'include':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x112016['options']['include'],function(_0x197ec0){return{'model':db[_0x197ec0[_0x0a9e('0x21')]],'as':_0x197ec0['as'],'attributes':_0x197ec0[_0x0a9e('0x22')],'include':_0x197ec0[_0x0a9e('0x1f')]?_['map'](_0x197ec0[_0x0a9e('0x1f')],function(_0x479bc4){return{'model':db[_0x479bc4[_0x0a9e('0x21')]],'as':_0x479bc4['as'],'attributes':_0x479bc4['attributes'],'include':_0x479bc4[_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x479bc4[_0x0a9e('0x1f')],function(_0x14433c){return{'model':db[_0x14433c[_0x0a9e('0x21')]],'as':_0x14433c['as'],'attributes':_0x14433c[_0x0a9e('0x22')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x23')](function(_0x14de77){logger['info'](_0x0a9e('0x19'),_0x112016);logger[_0x0a9e('0x12')](_0x0a9e('0x19'),_0x112016,JSON[_0x0a9e('0x24')](_0x14de77));if(_0x14de77['length']==0x0){return db[_0x0a9e('0x25')][_0x0a9e('0x26')]({'raw':!![],'where':{'item':_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x27')]},'include':[{'model':db[_0x0a9e('0x1a')],'where':{'ListId':_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1d')][_0x0a9e('0x28')],'deletedAt':{'$eq':null}},'as':_0x0a9e('0x29')}]})['then'](function(_0x426950){if(_['isNil'](_0x426950)){_0x105080(_0x14de77);}else{var _0x2407f9=_0x426950[_0x0a9e('0x2a')];return db[_0x0a9e('0x1a')][_0x0a9e('0x1b')]({'raw':!![],'where':{'id':_0x2407f9},'attributes':_0x112016[_0x0a9e('0x1c')]?_0x112016['options'][_0x0a9e('0x22')]||null:null})[_0x0a9e('0x23')](function(_0x40cb85){_0x105080(_0x40cb85);});}});}else{_0x105080(_0x14de77);}})[_0x0a9e('0x18')](function(_0x2b45ea){logger[_0x0a9e('0x14')](_0x0a9e('0x19'),_0x2b45ea[_0x0a9e('0x16')],_0x112016);_0x4bb1e3(_0x1c696a['error'](0x1f4,_0x2b45ea[_0x0a9e('0x16')]));});});};exports['CreateCmContact']=function(_0x2cc7a0){var _0x14b13f=this;return new Promise(function(_0x2b7e7f,_0x3f3d41){return db['CmContact'][_0x0a9e('0x2b')](_0x2cc7a0[_0x0a9e('0x2c')],{'raw':_0x2cc7a0[_0x0a9e('0x1c')]?_0x2cc7a0[_0x0a9e('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1e8694){var _0x5640eb;for(var _0x24936a=0x0;_0x24936a{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router; \ No newline at end of file +var _0xa9e0=['basename','extname','now','/csv','single','file','uploadCsv','%s-%s%s','upload','/upload/:id','import','put','/:id','update','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','index','/describe','show','/:id/tags','isAuthenticated','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','getJourney','post','create','/create_many','bulkCreate','setTags','setAdditionalPhones','/:id/duplicateAdditionalPhones','/:id/rescheduleAdditionalPhones','rescheduleAdditionalPhones','join','root','server/files/tmp','originalname','replace','format'];(function(_0x518abc,_0xd00844){var _0x3ad8f3=function(_0x4bceaf){while(--_0x4bceaf){_0x518abc['push'](_0x518abc['shift']());}};_0x3ad8f3(++_0xd00844);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'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 8843dbf..28c6b1a 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 _0x8f7d=['PHONE','sequelize','exports','STRING'];(function(_0x54cc10,_0x3a14d8){var _0x545750=function(_0x5088ec){while(--_0x5088ec){_0x54cc10['push'](_0x54cc10['shift']());}};_0x545750(++_0x3a14d8);}(_0x8f7d,0xf5));var _0xd8f7=function(_0x168b5b,_0x3b6721){_0x168b5b=_0x168b5b-0x0;var _0x4bd097=_0x8f7d[_0x168b5b];return _0x4bd097;};'use strict';var Sequelize=require(_0xd8f7('0x0'));module[_0xd8f7('0x1')]={'CmContactId':{'type':Sequelize['INTEGER'],'primaryKey':!![]},'item':{'type':Sequelize[_0xd8f7('0x2')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize['INTEGER'],'defaultValue':null},'ItemClass':{'type':Sequelize['STRING'],'defaultValue':_0xd8f7('0x3')},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':null},'description':{'type':Sequelize[_0xd8f7('0x2')],'defaultValue':null}}; \ No newline at end of file +var _0x720c=['STRING','sequelize','INTEGER'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x720c,0x154));var _0xc720=function(_0x37ded3,_0x371ebb){_0x37ded3=_0x37ded3-0x0;var _0x51e49e=_0x720c[_0x37ded3];return _0x51e49e;};'use strict';var Sequelize=require(_0xc720('0x0'));module['exports']={'CmContactId':{'type':Sequelize[_0xc720('0x1')],'primaryKey':!![]},'item':{'type':Sequelize[_0xc720('0x2')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0xc720('0x1')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0xc720('0x2')],'defaultValue':'PHONE'},'OrderBy':{'type':Sequelize[_0xc720('0x1')],'defaultValue':null},'description':{'type':Sequelize[_0xc720('0x2')],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.controller.js b/server/api/cmContactHasItem/cmContactHasItem.controller.js index 47dc71f..2fef94a 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 _0xe9ca=['ioredis','../../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','apply','reject','save','update','then','destroy','CmContactHasItems','error','stack','name','send','index','map','CmContactHasItem','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileResource','catch','params','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x29f0d9,_0x2d1172){var _0x1c6106=function(_0x5c8b1c){while(--_0x5c8b1c){_0x29f0d9['push'](_0x29f0d9['shift']());}};_0x1c6106(++_0x2d1172);}(_0xe9ca,0x17e));var _0xae9c=function(_0x3e4adc,_0x2d2cb2){_0x3e4adc=_0x3e4adc-0x0;var _0x9435a=_0xe9ca[_0x3e4adc];return _0x9435a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xae9c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xae9c('0x1'));var BPromise=require(_0xae9c('0x2'));var Mustache=require('mustache');var util=require(_0xae9c('0x3'));var path=require(_0xae9c('0x4'));var sox=require(_0xae9c('0x5'));var csv=require(_0xae9c('0x6'));var ejs=require(_0xae9c('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xae9c('0x8'));var jsforce=require(_0xae9c('0x9'));var deskjs=require(_0xae9c('0xa'));var toCsv=require(_0xae9c('0x6'));var querystring=require(_0xae9c('0xb'));var Papa=require(_0xae9c('0xc'));var Redis=require(_0xae9c('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xae9c('0xe'));var as=require(_0xae9c('0xf'));var hardwareService=require(_0xae9c('0x10'));var logger=require(_0xae9c('0x11'))(_0xae9c('0x12'));var utils=require(_0xae9c('0x13'));var config=require(_0xae9c('0x14'));var licenseUtil=require(_0xae9c('0x15'));var db=require(_0xae9c('0x16'))['db'];function respondWithStatusCode(_0x2e6cec,_0x62f101){_0x62f101=_0x62f101||0xcc;return function(_0x112286){if(_0x112286){return _0x2e6cec[_0xae9c('0x17')](_0x62f101);}return _0x2e6cec['status'](_0x62f101)[_0xae9c('0x18')]();};}function respondWithResult(_0x409092,_0x1d078f){_0x1d078f=_0x1d078f||0xc8;return function(_0x2de455){if(_0x2de455){return _0x409092[_0xae9c('0x19')](_0x1d078f)['json'](_0x2de455);}};}function respondWithFilteredResult(_0x4d2d20,_0x2de9c4){return function(_0x52e1d8){if(_0x52e1d8){var _0x415c24=typeof _0x2de9c4[_0xae9c('0x1a')]===_0xae9c('0x1b')&&typeof _0x2de9c4[_0xae9c('0x1c')]===_0xae9c('0x1b');var _0x4eee0c=_0x52e1d8['count'];var _0x5d1c60=_0x415c24?0x0:_0x2de9c4[_0xae9c('0x1a')];var _0x599db6=_0x415c24?_0x52e1d8[_0xae9c('0x1d')]:_0x2de9c4['offset']+_0x2de9c4[_0xae9c('0x1c')];var _0x27684b;if(_0x599db6>=_0x4eee0c){_0x599db6=_0x4eee0c;_0x27684b=0xc8;}else{_0x27684b=0xce;}_0x4d2d20[_0xae9c('0x19')](_0x27684b);return _0x4d2d20[_0xae9c('0x1e')]('Content-Range',_0x5d1c60+'-'+_0x599db6+'/'+_0x4eee0c)['json'](_0x52e1d8);}return null;};}function patchUpdates(_0x472245){return function(_0x55c505){try{jsonpatch[_0xae9c('0x1f')](_0x55c505,_0x472245,!![]);}catch(_0x516d8e){return BPromise[_0xae9c('0x20')](_0x516d8e);}return _0x55c505[_0xae9c('0x21')]();};}function saveUpdates(_0x552653,_0x3f891d){return function(_0x36df4b){if(_0x36df4b){return _0x36df4b[_0xae9c('0x22')](_0x552653)[_0xae9c('0x23')](function(_0x477291){return _0x477291;});}return null;};}function removeEntity(_0x433305,_0x286394){return function(_0x457d04){if(_0x457d04){return _0x457d04[_0xae9c('0x24')]()[_0xae9c('0x23')](function(){var _0x5a5553=_0x457d04['get']({'plain':!![]});var _0x266e4e=_0xae9c('0x25');return db['UserProfileResource'][_0xae9c('0x24')]({'where':{'type':_0x266e4e,'resourceId':_0x5a5553['id']}})['then'](function(){return _0x457d04;});})[_0xae9c('0x23')](function(){_0x433305['status'](0xcc)[_0xae9c('0x18')]();});}};}function handleEntityNotFound(_0x4238ae,_0x4e1607){return function(_0x2fcf0f){if(!_0x2fcf0f){_0x4238ae[_0xae9c('0x17')](0x194);}return _0x2fcf0f;};}function handleError(_0x1a903e,_0x4392f3){_0x4392f3=_0x4392f3||0x1f4;return function(_0x4a4610){logger[_0xae9c('0x26')](_0x4a4610[_0xae9c('0x27')]);if(_0x4a4610[_0xae9c('0x28')]){delete _0x4a4610[_0xae9c('0x28')];}_0x1a903e[_0xae9c('0x19')](_0x4392f3)[_0xae9c('0x29')](_0x4a4610);};}exports[_0xae9c('0x2a')]=function(_0x1a9fd0,_0x5c306e){var _0x49fd6b={},_0x4861d4={},_0x5f03e9={'count':0x0,'rows':[]};var _0x270b36=_[_0xae9c('0x2b')](db[_0xae9c('0x2c')][_0xae9c('0x2d')],function(_0x11bb89){return{'name':_0x11bb89[_0xae9c('0x2e')],'type':_0x11bb89[_0xae9c('0x2f')][_0xae9c('0x30')]};});_0x4861d4['model']=_[_0xae9c('0x2b')](_0x270b36,_0xae9c('0x28'));_0x4861d4[_0xae9c('0x31')]=_['keys'](_0x1a9fd0['query']);_0x4861d4[_0xae9c('0x32')]=_[_0xae9c('0x33')](_0x4861d4[_0xae9c('0x34')],_0x4861d4['query']);_0x49fd6b['attributes']=_[_0xae9c('0x33')](_0x4861d4['model'],qs[_0xae9c('0x35')](_0x1a9fd0['query']['fields']));_0x49fd6b[_0xae9c('0x36')]=_0x49fd6b[_0xae9c('0x36')][_0xae9c('0x37')]?_0x49fd6b['attributes']:_0x4861d4[_0xae9c('0x34')];if(!_0x1a9fd0[_0xae9c('0x31')]['hasOwnProperty'](_0xae9c('0x38'))){_0x49fd6b[_0xae9c('0x1c')]=qs['limit'](_0x1a9fd0[_0xae9c('0x31')][_0xae9c('0x1c')]);_0x49fd6b['offset']=qs[_0xae9c('0x1a')](_0x1a9fd0['query'][_0xae9c('0x1a')]);}_0x49fd6b['order']=qs[_0xae9c('0x39')](_0x1a9fd0[_0xae9c('0x31')][_0xae9c('0x39')]);_0x49fd6b[_0xae9c('0x3a')]=qs[_0xae9c('0x32')](_[_0xae9c('0x3b')](_0x1a9fd0['query'],_0x4861d4[_0xae9c('0x32')]),_0x270b36);if(_0x1a9fd0[_0xae9c('0x31')][_0xae9c('0x3c')]){_0x49fd6b[_0xae9c('0x3a')]=_[_0xae9c('0x3d')](_0x49fd6b['where'],{'$or':_[_0xae9c('0x2b')](_0x270b36,function(_0x290bbe){if(_0x290bbe['type']!==_0xae9c('0x3e')){var _0x421589={};_0x421589[_0x290bbe[_0xae9c('0x28')]]={'$like':'%'+_0x1a9fd0[_0xae9c('0x31')][_0xae9c('0x3c')]+'%'};return _0x421589;}})});}_0x49fd6b=_[_0xae9c('0x3d')]({},_0x49fd6b,_0x1a9fd0[_0xae9c('0x3f')]);var _0xe12023={'where':_0x49fd6b[_0xae9c('0x3a')]};return db[_0xae9c('0x2c')][_0xae9c('0x1d')](_0xe12023)[_0xae9c('0x23')](function(_0x9bb92d){_0x5f03e9[_0xae9c('0x1d')]=_0x9bb92d;if(_0x1a9fd0['query'][_0xae9c('0x40')]){_0x49fd6b[_0xae9c('0x41')]=[{'all':!![]}];}return db[_0xae9c('0x2c')][_0xae9c('0x42')](_0x49fd6b);})[_0xae9c('0x23')](function(_0x11b861){_0x5f03e9[_0xae9c('0x43')]=_0x11b861;return _0x5f03e9;})[_0xae9c('0x23')](respondWithFilteredResult(_0x5c306e,_0x49fd6b))['catch'](handleError(_0x5c306e,null));};exports[_0xae9c('0x44')]=function(_0x4c3024,_0x190244){var _0x1f168b={'raw':!![],'where':{'id':_0x4c3024['params']['id']}},_0x2a528a={};_0x2a528a[_0xae9c('0x34')]=_[_0xae9c('0x45')](db[_0xae9c('0x2c')]['rawAttributes']);_0x2a528a[_0xae9c('0x31')]=_[_0xae9c('0x45')](_0x4c3024[_0xae9c('0x31')]);_0x2a528a[_0xae9c('0x32')]=_[_0xae9c('0x33')](_0x2a528a[_0xae9c('0x34')],_0x2a528a[_0xae9c('0x31')]);_0x1f168b[_0xae9c('0x36')]=_['intersection'](_0x2a528a[_0xae9c('0x34')],qs[_0xae9c('0x35')](_0x4c3024[_0xae9c('0x31')][_0xae9c('0x35')]));_0x1f168b[_0xae9c('0x36')]=_0x1f168b[_0xae9c('0x36')][_0xae9c('0x37')]?_0x1f168b[_0xae9c('0x36')]:_0x2a528a[_0xae9c('0x34')];if(_0x4c3024[_0xae9c('0x31')][_0xae9c('0x40')]){_0x1f168b['include']=[{'all':!![]}];}_0x1f168b=_[_0xae9c('0x3d')]({},_0x1f168b,_0x4c3024[_0xae9c('0x3f')]);return db[_0xae9c('0x2c')][_0xae9c('0x46')](_0x1f168b)['then'](handleEntityNotFound(_0x190244,null))[_0xae9c('0x23')](respondWithResult(_0x190244,null))['catch'](handleError(_0x190244,null));};exports[_0xae9c('0x47')]=function(_0x2f747b,_0x3b5388){return db[_0xae9c('0x2c')][_0xae9c('0x47')](_0x2f747b[_0xae9c('0x48')],{})['then'](function(_0x47f10b){var _0x34d530=_0x2f747b[_0xae9c('0x49')]['get']({'plain':!![]});if(!_0x34d530)throw new Error(_0xae9c('0x4a'));if(_0x34d530[_0xae9c('0x4b')]==='user'){var _0x1ee5af=_0x47f10b['get']({'plain':!![]});var _0x3484fa='CmContactHasItems';return db['UserProfileSection'][_0xae9c('0x46')]({'where':{'name':_0x3484fa,'userProfileId':_0x34d530['userProfileId']},'raw':!![]})[_0xae9c('0x23')](function(_0x535ed5){if(_0x535ed5&&_0x535ed5['autoAssociation']===0x0){return db[_0xae9c('0x4c')]['create']({'name':_0x1ee5af[_0xae9c('0x28')],'resourceId':_0x1ee5af['id'],'type':_0x535ed5['name'],'sectionId':_0x535ed5['id']},{})[_0xae9c('0x23')](function(){return _0x47f10b;});}else{return _0x47f10b;}})[_0xae9c('0x4d')](function(_0x19e4fd){logger[_0xae9c('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x19e4fd);throw _0x19e4fd;});}return _0x47f10b;})[_0xae9c('0x23')](respondWithResult(_0x3b5388,0xc9))[_0xae9c('0x4d')](handleError(_0x3b5388,null));};exports[_0xae9c('0x22')]=function(_0x2d00d6,_0x2e2e0f){if(_0x2d00d6[_0xae9c('0x48')]['id']){delete _0x2d00d6[_0xae9c('0x48')]['id'];}return db[_0xae9c('0x2c')][_0xae9c('0x46')]({'where':{'id':_0x2d00d6[_0xae9c('0x4e')]['id']}})[_0xae9c('0x23')](handleEntityNotFound(_0x2e2e0f,null))['then'](saveUpdates(_0x2d00d6['body'],null))[_0xae9c('0x23')](respondWithResult(_0x2e2e0f,null))[_0xae9c('0x4d')](handleError(_0x2e2e0f,null));};exports[_0xae9c('0x24')]=function(_0x1be598,_0x257078){return db[_0xae9c('0x2c')][_0xae9c('0x46')]({'where':{'id':_0x1be598[_0xae9c('0x4e')]['id']}})[_0xae9c('0x23')](handleEntityNotFound(_0x257078,null))['then'](removeEntity(_0x257078,null))[_0xae9c('0x4d')](handleError(_0x257078,null));}; \ No newline at end of file +var _0x4578=['nolimit','order','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','rawAttributes','length','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','destroy','get','CmContactHasItems','then','error','name','send','index','map','CmContactHasItem','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields'];(function(_0x2c4188,_0x1eb8ab){var _0x29c464=function(_0x11b7de){while(--_0x11b7de){_0x2c4188['push'](_0x2c4188['shift']());}};_0x29c464(++_0x1eb8ab);}(_0x4578,0x167));var _0x8457=function(_0x2ac5de,_0x2cebca){_0x2ac5de=_0x2ac5de-0x0;var _0x1415b2=_0x4578[_0x2ac5de];return _0x1415b2;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8457('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8457('0x1'));var moment=require(_0x8457('0x2'));var BPromise=require(_0x8457('0x3'));var Mustache=require(_0x8457('0x4'));var util=require('util');var path=require(_0x8457('0x5'));var sox=require(_0x8457('0x6'));var csv=require(_0x8457('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8457('0x8'));var _=require('lodash');var squel=require(_0x8457('0x9'));var crypto=require(_0x8457('0xa'));var jsforce=require(_0x8457('0xb'));var deskjs=require(_0x8457('0xc'));var toCsv=require(_0x8457('0x7'));var querystring=require(_0x8457('0xd'));var Papa=require(_0x8457('0xe'));var Redis=require(_0x8457('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x8457('0x10'));var as=require(_0x8457('0x11'));var hardwareService=require(_0x8457('0x12'));var logger=require(_0x8457('0x13'))(_0x8457('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x8457('0x15'));var db=require(_0x8457('0x16'))['db'];function respondWithStatusCode(_0x1c7d90,_0x23e1d2){_0x23e1d2=_0x23e1d2||0xcc;return function(_0x3165b9){if(_0x3165b9){return _0x1c7d90[_0x8457('0x17')](_0x23e1d2);}return _0x1c7d90[_0x8457('0x18')](_0x23e1d2)[_0x8457('0x19')]();};}function respondWithResult(_0x357930,_0x25f9c4){_0x25f9c4=_0x25f9c4||0xc8;return function(_0x2b0025){if(_0x2b0025){return _0x357930[_0x8457('0x18')](_0x25f9c4)[_0x8457('0x1a')](_0x2b0025);}};}function respondWithFilteredResult(_0x1f511a,_0x531d1f){return function(_0x4a9ef2){if(_0x4a9ef2){var _0x595a8a=typeof _0x531d1f[_0x8457('0x1b')]===_0x8457('0x1c')&&typeof _0x531d1f['limit']===_0x8457('0x1c');var _0x37f55e=_0x4a9ef2['count'];var _0x3aed52=_0x595a8a?0x0:_0x531d1f[_0x8457('0x1b')];var _0x44cee6=_0x595a8a?_0x4a9ef2[_0x8457('0x1d')]:_0x531d1f['offset']+_0x531d1f[_0x8457('0x1e')];var _0x62a90;if(_0x44cee6>=_0x37f55e){_0x44cee6=_0x37f55e;_0x62a90=0xc8;}else{_0x62a90=0xce;}_0x1f511a['status'](_0x62a90);return _0x1f511a[_0x8457('0x1f')]('Content-Range',_0x3aed52+'-'+_0x44cee6+'/'+_0x37f55e)[_0x8457('0x1a')](_0x4a9ef2);}return null;};}function patchUpdates(_0x262e8f){return function(_0x542ac0){try{jsonpatch[_0x8457('0x20')](_0x542ac0,_0x262e8f,!![]);}catch(_0x46bb82){return BPromise[_0x8457('0x21')](_0x46bb82);}return _0x542ac0[_0x8457('0x22')]();};}function saveUpdates(_0x311844,_0xda9f8f){return function(_0x17ede7){if(_0x17ede7){return _0x17ede7[_0x8457('0x23')](_0x311844)['then'](function(_0x443866){return _0x443866;});}return null;};}function removeEntity(_0x215b76,_0x59ba27){return function(_0x419cf5){if(_0x419cf5){return _0x419cf5[_0x8457('0x24')]()['then'](function(){var _0x58f00d=_0x419cf5[_0x8457('0x25')]({'plain':!![]});var _0x53edce=_0x8457('0x26');return db['UserProfileResource'][_0x8457('0x24')]({'where':{'type':_0x53edce,'resourceId':_0x58f00d['id']}})['then'](function(){return _0x419cf5;});})[_0x8457('0x27')](function(){_0x215b76[_0x8457('0x18')](0xcc)[_0x8457('0x19')]();});}};}function handleEntityNotFound(_0x42c6ae,_0x4430db){return function(_0x2f1d35){if(!_0x2f1d35){_0x42c6ae[_0x8457('0x17')](0x194);}return _0x2f1d35;};}function handleError(_0x2b2b6d,_0x237971){_0x237971=_0x237971||0x1f4;return function(_0x10f4c5){logger[_0x8457('0x28')](_0x10f4c5['stack']);if(_0x10f4c5[_0x8457('0x29')]){delete _0x10f4c5['name'];}_0x2b2b6d[_0x8457('0x18')](_0x237971)[_0x8457('0x2a')](_0x10f4c5);};}exports[_0x8457('0x2b')]=function(_0x3cbd24,_0x3e4a21){var _0x396e5a={},_0x22bc7d={},_0x29ad43={'count':0x0,'rows':[]};var _0x174eed=_[_0x8457('0x2c')](db[_0x8457('0x2d')]['rawAttributes'],function(_0x3ada3e){return{'name':_0x3ada3e[_0x8457('0x2e')],'type':_0x3ada3e[_0x8457('0x2f')][_0x8457('0x30')]};});_0x22bc7d['model']=_[_0x8457('0x2c')](_0x174eed,_0x8457('0x29'));_0x22bc7d['query']=_[_0x8457('0x31')](_0x3cbd24[_0x8457('0x32')]);_0x22bc7d[_0x8457('0x33')]=_[_0x8457('0x34')](_0x22bc7d[_0x8457('0x35')],_0x22bc7d[_0x8457('0x32')]);_0x396e5a[_0x8457('0x36')]=_[_0x8457('0x34')](_0x22bc7d[_0x8457('0x35')],qs[_0x8457('0x37')](_0x3cbd24[_0x8457('0x32')][_0x8457('0x37')]));_0x396e5a[_0x8457('0x36')]=_0x396e5a['attributes']['length']?_0x396e5a[_0x8457('0x36')]:_0x22bc7d[_0x8457('0x35')];if(!_0x3cbd24[_0x8457('0x32')]['hasOwnProperty'](_0x8457('0x38'))){_0x396e5a[_0x8457('0x1e')]=qs['limit'](_0x3cbd24['query']['limit']);_0x396e5a[_0x8457('0x1b')]=qs['offset'](_0x3cbd24[_0x8457('0x32')][_0x8457('0x1b')]);}_0x396e5a[_0x8457('0x39')]=qs['sort'](_0x3cbd24[_0x8457('0x32')]['sort']);_0x396e5a[_0x8457('0x3a')]=qs[_0x8457('0x33')](_[_0x8457('0x3b')](_0x3cbd24['query'],_0x22bc7d[_0x8457('0x33')]),_0x174eed);if(_0x3cbd24[_0x8457('0x32')][_0x8457('0x3c')]){_0x396e5a[_0x8457('0x3a')]=_[_0x8457('0x3d')](_0x396e5a['where'],{'$or':_[_0x8457('0x2c')](_0x174eed,function(_0x77a840){if(_0x77a840['type']!==_0x8457('0x3e')){var _0x30604d={};_0x30604d[_0x77a840[_0x8457('0x29')]]={'$like':'%'+_0x3cbd24['query']['filter']+'%'};return _0x30604d;}})});}_0x396e5a=_[_0x8457('0x3d')]({},_0x396e5a,_0x3cbd24[_0x8457('0x3f')]);var _0x2f191e={'where':_0x396e5a[_0x8457('0x3a')]};return db[_0x8457('0x2d')][_0x8457('0x1d')](_0x2f191e)[_0x8457('0x27')](function(_0x281d6d){_0x29ad43[_0x8457('0x1d')]=_0x281d6d;if(_0x3cbd24[_0x8457('0x32')]['includeAll']){_0x396e5a[_0x8457('0x40')]=[{'all':!![]}];}return db['CmContactHasItem'][_0x8457('0x41')](_0x396e5a);})['then'](function(_0x1d1c11){_0x29ad43[_0x8457('0x42')]=_0x1d1c11;return _0x29ad43;})[_0x8457('0x27')](respondWithFilteredResult(_0x3e4a21,_0x396e5a))[_0x8457('0x43')](handleError(_0x3e4a21,null));};exports[_0x8457('0x44')]=function(_0x4f9b9d,_0x4a838b){var _0x392369={'raw':!![],'where':{'id':_0x4f9b9d[_0x8457('0x45')]['id']}},_0xc0672={};_0xc0672[_0x8457('0x35')]=_['keys'](db[_0x8457('0x2d')][_0x8457('0x46')]);_0xc0672[_0x8457('0x32')]=_[_0x8457('0x31')](_0x4f9b9d['query']);_0xc0672[_0x8457('0x33')]=_[_0x8457('0x34')](_0xc0672[_0x8457('0x35')],_0xc0672['query']);_0x392369[_0x8457('0x36')]=_[_0x8457('0x34')](_0xc0672[_0x8457('0x35')],qs['fields'](_0x4f9b9d[_0x8457('0x32')][_0x8457('0x37')]));_0x392369[_0x8457('0x36')]=_0x392369[_0x8457('0x36')][_0x8457('0x47')]?_0x392369['attributes']:_0xc0672[_0x8457('0x35')];if(_0x4f9b9d[_0x8457('0x32')][_0x8457('0x48')]){_0x392369[_0x8457('0x40')]=[{'all':!![]}];}_0x392369=_['merge']({},_0x392369,_0x4f9b9d['options']);return db[_0x8457('0x2d')]['find'](_0x392369)[_0x8457('0x27')](handleEntityNotFound(_0x4a838b,null))[_0x8457('0x27')](respondWithResult(_0x4a838b,null))[_0x8457('0x43')](handleError(_0x4a838b,null));};exports['create']=function(_0x8479da,_0x1d7e7e){return db[_0x8457('0x2d')][_0x8457('0x49')](_0x8479da[_0x8457('0x4a')],{})[_0x8457('0x27')](function(_0x2a3951){var _0x582a1d=_0x8479da[_0x8457('0x4b')][_0x8457('0x25')]({'plain':!![]});if(!_0x582a1d)throw new Error(_0x8457('0x4c'));if(_0x582a1d[_0x8457('0x4d')]===_0x8457('0x4b')){var _0x3ae819=_0x2a3951['get']({'plain':!![]});var _0x2ad748='CmContactHasItems';return db[_0x8457('0x4e')][_0x8457('0x4f')]({'where':{'name':_0x2ad748,'userProfileId':_0x582a1d[_0x8457('0x50')]},'raw':!![]})[_0x8457('0x27')](function(_0x5d6459){if(_0x5d6459&&_0x5d6459['autoAssociation']===0x0){return db[_0x8457('0x51')]['create']({'name':_0x3ae819[_0x8457('0x29')],'resourceId':_0x3ae819['id'],'type':_0x5d6459[_0x8457('0x29')],'sectionId':_0x5d6459['id']},{})[_0x8457('0x27')](function(){return _0x2a3951;});}else{return _0x2a3951;}})[_0x8457('0x43')](function(_0x37aa7d){logger[_0x8457('0x28')](_0x8457('0x52'),_0x37aa7d);throw _0x37aa7d;});}return _0x2a3951;})[_0x8457('0x27')](respondWithResult(_0x1d7e7e,0xc9))[_0x8457('0x43')](handleError(_0x1d7e7e,null));};exports['update']=function(_0x295421,_0x493b46){if(_0x295421['body']['id']){delete _0x295421['body']['id'];}return db['CmContactHasItem'][_0x8457('0x4f')]({'where':{'id':_0x295421[_0x8457('0x45')]['id']}})['then'](handleEntityNotFound(_0x493b46,null))[_0x8457('0x27')](saveUpdates(_0x295421[_0x8457('0x4a')],null))[_0x8457('0x27')](respondWithResult(_0x493b46,null))[_0x8457('0x43')](handleError(_0x493b46,null));};exports[_0x8457('0x24')]=function(_0x421b55,_0x2554de){return db[_0x8457('0x2d')][_0x8457('0x4f')]({'where':{'id':_0x421b55['params']['id']}})[_0x8457('0x27')](handleEntityNotFound(_0x2554de,null))['then'](removeEntity(_0x2554de,null))[_0x8457('0x43')](handleError(_0x2554de,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index 361e785..9eb3ea3 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 _0x6c96=['util','api','moment','bluebird','request-promise','rimraf','./cmContactHasItem.attributes','define','CmContactHasItem','lodash'];(function(_0x42d14c,_0x281d48){var _0x3f2359=function(_0x31effc){while(--_0x31effc){_0x42d14c['push'](_0x42d14c['shift']());}};_0x3f2359(++_0x281d48);}(_0x6c96,0x135));var _0x66c9=function(_0xa00efb,_0x4c4213){_0xa00efb=_0xa00efb-0x0;var _0x5515e2=_0x6c96[_0xa00efb];return _0x5515e2;};'use strict';var _=require(_0x66c9('0x0'));var util=require(_0x66c9('0x1'));var logger=require('../../config/logger')(_0x66c9('0x2'));var moment=require(_0x66c9('0x3'));var BPromise=require(_0x66c9('0x4'));var rp=require(_0x66c9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x66c9('0x6'));var config=require('../../config/environment');var attributes=require(_0x66c9('0x7'));module['exports']=function(_0x562a36,_0x53fa03){return _0x562a36[_0x66c9('0x8')](_0x66c9('0x9'),attributes,{'tableName':'cm_contact_has_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7903=['lodash','util','api','moment','request-promise','rimraf','./cmContactHasItem.attributes','define','CmContactHasItem','cm_contact_has_items'];(function(_0x26f1b2,_0x33d843){var _0x1624a4=function(_0x58dfb7){while(--_0x58dfb7){_0x26f1b2['push'](_0x26f1b2['shift']());}};_0x1624a4(++_0x33d843);}(_0x7903,0xbe));var _0x3790=function(_0x1c9288,_0x140e74){_0x1c9288=_0x1c9288-0x0;var _0x101f57=_0x7903[_0x1c9288];return _0x101f57;};'use strict';var _=require(_0x3790('0x0'));var util=require(_0x3790('0x1'));var logger=require('../../config/logger')(_0x3790('0x2'));var moment=require(_0x3790('0x3'));var BPromise=require('bluebird');var rp=require(_0x3790('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3790('0x5'));var config=require('../../config/environment');var attributes=require(_0x3790('0x6'));module['exports']=function(_0x869207,_0x232aad){return _0x869207[_0x3790('0x7')](_0x3790('0x8'),attributes,{'tableName':_0x3790('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.rpc.js b/server/api/cmContactHasItem/cmContactHasItem.rpc.js index f9139d2..712138a 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 _0x6459=['request\x20sent','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','info','CmContactHasItem,\x20%s,\x20%s'];(function(_0x7ff9e4,_0x19e358){var _0x468415=function(_0x32f8f5){while(--_0x32f8f5){_0x7ff9e4['push'](_0x7ff9e4['shift']());}};_0x468415(++_0x19e358);}(_0x6459,0xb0));var _0x9645=function(_0x23d7eb,_0x29b9b2){_0x23d7eb=_0x23d7eb-0x0;var _0x2d51c4=_0x6459[_0x23d7eb];return _0x2d51c4;};'use strict';var _=require(_0x9645('0x0'));var util=require('util');var moment=require(_0x9645('0x1'));var BPromise=require('bluebird');var rs=require(_0x9645('0x2'));var fs=require('fs');var Redis=require(_0x9645('0x3'));var db=require(_0x9645('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9645('0x5'));var config=require(_0x9645('0x6'));var jayson=require(_0x9645('0x7'));var client=jayson[_0x9645('0x8')][_0x9645('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4afed1,_0x5b7fae,_0xd26c3c){return new BPromise(function(_0x25bea0,_0x57e920){return client[_0x9645('0xa')](_0x4afed1,_0xd26c3c)['then'](function(_0x11febb){logger[_0x9645('0xb')](_0x9645('0xc'),_0x5b7fae,_0x9645('0xd'));logger['debug'](_0x9645('0xe'),_0x5b7fae,_0x9645('0xd'),JSON[_0x9645('0xf')](_0x11febb));if(_0x11febb[_0x9645('0x10')]){if(_0x11febb[_0x9645('0x10')][_0x9645('0x11')]===0x1f4){logger[_0x9645('0x10')](_0x9645('0xc'),_0x5b7fae,_0x11febb['error'][_0x9645('0x12')]);return _0x57e920(_0x11febb[_0x9645('0x10')][_0x9645('0x12')]);}logger[_0x9645('0x10')]('CmContactHasItem,\x20%s,\x20%s',_0x5b7fae,_0x11febb[_0x9645('0x10')][_0x9645('0x12')]);return _0x25bea0(_0x11febb[_0x9645('0x10')]['message']);}else{logger[_0x9645('0xb')](_0x9645('0xc'),_0x5b7fae,'request\x20sent');_0x25bea0(_0x11febb[_0x9645('0x13')][_0x9645('0x12')]);}})[_0x9645('0x14')](function(_0x2a01f6){logger[_0x9645('0x10')](_0x9645('0xc'),_0x5b7fae,_0x2a01f6);_0x57e920(_0x2a01f6);});});} \ No newline at end of file +var _0x241e=['error','CmContactHasItem,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','client','request','then','info','CmContactHasItem,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x3dd567,_0x276ca9){var _0x415024=function(_0x3ae159){while(--_0x3ae159){_0x3dd567['push'](_0x3dd567['shift']());}};_0x415024(++_0x276ca9);}(_0x241e,0x1e0));var _0xe241=function(_0x24f5fd,_0x3b652e){_0x24f5fd=_0x24f5fd-0x0;var _0x1a3fd1=_0x241e[_0x24f5fd];return _0x1a3fd1;};'use strict';var _=require(_0xe241('0x0'));var util=require(_0xe241('0x1'));var moment=require(_0xe241('0x2'));var BPromise=require('bluebird');var rs=require(_0xe241('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe241('0x4'))['db'];var utils=require(_0xe241('0x5'));var logger=require(_0xe241('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe241('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x16393c,_0x56732a,_0x581a67){return new BPromise(function(_0x37a2ec,_0x7b8315){return client[_0xe241('0x8')](_0x16393c,_0x581a67)[_0xe241('0x9')](function(_0x166265){logger[_0xe241('0xa')]('CmContactHasItem,\x20%s,\x20%s',_0x56732a,'request\x20sent');logger['debug'](_0xe241('0xb'),_0x56732a,_0xe241('0xc'),JSON[_0xe241('0xd')](_0x166265));if(_0x166265[_0xe241('0xe')]){if(_0x166265[_0xe241('0xe')]['code']===0x1f4){logger['error'](_0xe241('0xf'),_0x56732a,_0x166265[_0xe241('0xe')][_0xe241('0x10')]);return _0x7b8315(_0x166265['error'][_0xe241('0x10')]);}logger[_0xe241('0xe')](_0xe241('0xf'),_0x56732a,_0x166265['error'][_0xe241('0x10')]);return _0x37a2ec(_0x166265[_0xe241('0xe')][_0xe241('0x10')]);}else{logger[_0xe241('0xa')](_0xe241('0xf'),_0x56732a,_0xe241('0xc'));_0x37a2ec(_0x166265[_0xe241('0x11')][_0xe241('0x10')]);}})[_0xe241('0x12')](function(_0x317050){logger['error']('CmContactHasItem,\x20%s,\x20%s',_0x56732a,_0x317050);_0x7b8315(_0x317050);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index c140ccb..6570e4d 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 _0x48cc=['../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContactHasItem.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','util','connect-timeout','express','Router','fs-extra'];(function(_0x15cef4,_0x448b97){var _0x384430=function(_0x38ebce){while(--_0x38ebce){_0x15cef4['push'](_0x15cef4['shift']());}};_0x384430(++_0x448b97);}(_0x48cc,0x18b));var _0xc48c=function(_0x1a0a1,_0x5e10b8){_0x1a0a1=_0x1a0a1-0x0;var _0x319261=_0x48cc[_0x1a0a1];return _0x319261;};'use strict';var multer=require('multer');var util=require(_0xc48c('0x0'));var path=require('path');var timeout=require(_0xc48c('0x1'));var express=require(_0xc48c('0x2'));var router=express[_0xc48c('0x3')]();var fs_extra=require(_0xc48c('0x4'));var auth=require(_0xc48c('0x5'));var interaction=require(_0xc48c('0x6'));var config=require(_0xc48c('0x7'));var controller=require(_0xc48c('0x8'));router[_0xc48c('0x9')]('/',auth[_0xc48c('0xa')](),controller[_0xc48c('0xb')]);router['get'](_0xc48c('0xc'),auth['isAuthenticated'](),controller[_0xc48c('0xd')]);router[_0xc48c('0xe')]('/',auth['isAuthenticated'](),controller[_0xc48c('0xf')]);router[_0xc48c('0x10')](_0xc48c('0xc'),auth[_0xc48c('0xa')](),controller[_0xc48c('0x11')]);router[_0xc48c('0x12')](_0xc48c('0xc'),auth[_0xc48c('0xa')](),controller[_0xc48c('0x13')]);module['exports']=router; \ No newline at end of file +var _0xb847=['delete','destroy','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/:id','isAuthenticated','show','post','create','put','update'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0xb847,0x17e));var _0x7b84=function(_0x3337b6,_0x42c7f9){_0x3337b6=_0x3337b6-0x0;var _0x568270=_0xb847[_0x3337b6];return _0x568270;};'use strict';var multer=require(_0x7b84('0x0'));var util=require(_0x7b84('0x1'));var path=require('path');var timeout=require(_0x7b84('0x2'));var express=require('express');var router=express[_0x7b84('0x3')]();var fs_extra=require(_0x7b84('0x4'));var auth=require(_0x7b84('0x5'));var interaction=require(_0x7b84('0x6'));var config=require(_0x7b84('0x7'));var controller=require('./cmContactHasItem.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x7b84('0x8')]);router[_0x7b84('0x9')](_0x7b84('0xa'),auth[_0x7b84('0xb')](),controller[_0x7b84('0xc')]);router[_0x7b84('0xd')]('/',auth[_0x7b84('0xb')](),controller[_0x7b84('0xe')]);router[_0x7b84('0xf')]('/:id',auth[_0x7b84('0xb')](),controller[_0x7b84('0x10')]);router[_0x7b84('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x7b84('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 4232530..a328181 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 _0x81f6=['alias','STRING','TEXT','values','setDataValue','stringify','BOOLEAN','voice','sequelize','exports','VIRTUAL','getDataValue'];(function(_0x2254e4,_0x1acc33){var _0x1662da=function(_0x586035){while(--_0x586035){_0x2254e4['push'](_0x2254e4['shift']());}};_0x1662da(++_0x1acc33);}(_0x81f6,0xb0));var _0x681f=function(_0x2c38df,_0x1253ab){_0x2c38df=_0x2c38df-0x0;var _0x41e760=_0x81f6[_0x2c38df];return _0x41e760;};'use strict';var Sequelize=require(_0x681f('0x0'));var _=require('lodash');module[_0x681f('0x1')]={'name':{'type':Sequelize[_0x681f('0x2')],'get':function(_0x56b4e8){return this[_0x681f('0x3')](_0x681f('0x4'));}},'alias':{'type':Sequelize[_0x681f('0x5')],'allowNull':![],'set':function(_0x3efa6f){this['setDataValue'](_0x681f('0x4'),_0x3efa6f?_0x3efa6f:this['getDataValue']('name'));}},'type':{'type':Sequelize[_0x681f('0x5')],'allowNull':![]},'values':{'type':Sequelize[_0x681f('0x6')]('long'),'get':function(){if(this[_0x681f('0x3')]('type')==='select'){return JSON['parse'](this[_0x681f('0x3')]('values'));}else{return this[_0x681f('0x3')](_0x681f('0x7'));}},'set':function(_0x40dd45){if(Array['isArray'](_0x40dd45)){this[_0x681f('0x8')](_0x681f('0x7'),JSON[_0x681f('0x9')](_0x40dd45));}else{this[_0x681f('0x8')](_0x681f('0x7'),_0x40dd45);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x681f('0xa')],'defaultValue':![]},'actionType':{'type':Sequelize['ENUM'](_0x681f('0xb'))}}; \ No newline at end of file +var _0x096d=['BOOLEAN','ENUM','voice','sequelize','lodash','exports','VIRTUAL','getDataValue','alias','STRING','setDataValue','name','TEXT','long','type','values','stringify'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x096d,0x168));var _0xd096=function(_0x22b0cb,_0x5a764a){_0x22b0cb=_0x22b0cb-0x0;var _0x444178=_0x096d[_0x22b0cb];return _0x444178;};'use strict';var Sequelize=require(_0xd096('0x0'));var _=require(_0xd096('0x1'));module[_0xd096('0x2')]={'name':{'type':Sequelize[_0xd096('0x3')],'get':function(_0x3be32b){return this[_0xd096('0x4')](_0xd096('0x5'));}},'alias':{'type':Sequelize[_0xd096('0x6')],'allowNull':![],'set':function(_0x3b4403){this[_0xd096('0x7')](_0xd096('0x5'),_0x3b4403?_0x3b4403:this[_0xd096('0x4')](_0xd096('0x8')));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize[_0xd096('0x9')](_0xd096('0xa')),'get':function(){if(this[_0xd096('0x4')](_0xd096('0xb'))==='select'){return JSON['parse'](this[_0xd096('0x4')](_0xd096('0xc')));}else{return this[_0xd096('0x4')](_0xd096('0xc'));}},'set':function(_0x5c7e67){if(Array['isArray'](_0x5c7e67)){this['setDataValue'](_0xd096('0xc'),JSON[_0xd096('0xd')](_0x5c7e67));}else{this[_0xd096('0x7')]('values',_0x5c7e67);}}},'required':{'type':Sequelize[_0xd096('0xe')],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize[_0xd096('0xf')](_0xd096('0x10'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 5461b66..ebf6b63 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 _0xabc1=['index','CmCustomField','rawAttributes','fieldName','type','key','model','differenceBy','query','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','keys','find','body','params','sequelize','transaction','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','cm_contacts','format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','end','sendStatus','error','stack','name','send'];(function(_0x25042f,_0x1338f0){var _0x307618=function(_0x207d51){while(--_0x207d51){_0x25042f['push'](_0x25042f['shift']());}};_0x307618(++_0x1338f0);}(_0xabc1,0x13e));var _0x1abc=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xabc1[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0x1abc('0x0'));var rimraf=require(_0x1abc('0x1'));var zipdir=require(_0x1abc('0x2'));var jsonpatch=require(_0x1abc('0x3'));var rp=require(_0x1abc('0x4'));var moment=require(_0x1abc('0x5'));var BPromise=require(_0x1abc('0x6'));var Mustache=require(_0x1abc('0x7'));var util=require(_0x1abc('0x8'));var path=require('path');var sox=require(_0x1abc('0x9'));var csv=require(_0x1abc('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1abc('0xb'));var _=require(_0x1abc('0xc'));var squel=require('squel');var crypto=require(_0x1abc('0xd'));var jsforce=require(_0x1abc('0xe'));var deskjs=require(_0x1abc('0xf'));var toCsv=require(_0x1abc('0xa'));var querystring=require(_0x1abc('0x10'));var Papa=require(_0x1abc('0x11'));var Redis=require('ioredis');var authService=require(_0x1abc('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x1abc('0x13'));var hardwareService=require(_0x1abc('0x14'));var logger=require(_0x1abc('0x15'))(_0x1abc('0x16'));var utils=require(_0x1abc('0x17'));var config=require(_0x1abc('0x18'));var licenseUtil=require(_0x1abc('0x19'));var db=require(_0x1abc('0x1a'))['db'];function respondWithStatusCode(_0x394b01,_0x57cfab){_0x57cfab=_0x57cfab||0xcc;return function(_0x325562){if(_0x325562){return _0x394b01['sendStatus'](_0x57cfab);}return _0x394b01[_0x1abc('0x1b')](_0x57cfab)['end']();};}function respondWithResult(_0x859169,_0x155f2a){_0x155f2a=_0x155f2a||0xc8;return function(_0x287c53){if(_0x287c53){return _0x859169[_0x1abc('0x1b')](_0x155f2a)['json'](_0x287c53);}};}function respondWithFilteredResult(_0x200679,_0x1da77e){return function(_0x3cf25d){if(_0x3cf25d){var _0x25ef18=typeof _0x1da77e[_0x1abc('0x1c')]===_0x1abc('0x1d')&&typeof _0x1da77e[_0x1abc('0x1e')]==='undefined';var _0x506904=_0x3cf25d[_0x1abc('0x1f')];var _0x3bec4d=_0x25ef18?0x0:_0x1da77e[_0x1abc('0x1c')];var _0x3b436d=_0x25ef18?_0x3cf25d[_0x1abc('0x1f')]:_0x1da77e['offset']+_0x1da77e[_0x1abc('0x1e')];var _0x22ff83;if(_0x3b436d>=_0x506904){_0x3b436d=_0x506904;_0x22ff83=0xc8;}else{_0x22ff83=0xce;}_0x200679[_0x1abc('0x1b')](_0x22ff83);return _0x200679[_0x1abc('0x20')](_0x1abc('0x21'),_0x3bec4d+'-'+_0x3b436d+'/'+_0x506904)[_0x1abc('0x22')](_0x3cf25d);}return null;};}function patchUpdates(_0x5a1b5a){return function(_0x3e0e19){try{jsonpatch[_0x1abc('0x23')](_0x3e0e19,_0x5a1b5a,!![]);}catch(_0x25746e){return BPromise['reject'](_0x25746e);}return _0x3e0e19[_0x1abc('0x24')]();};}function saveUpdates(_0x4014de,_0x5d6f8c){return function(_0x59999c){if(_0x59999c){return _0x59999c[_0x1abc('0x25')](_0x4014de)[_0x1abc('0x26')](function(_0x1c10cd){return _0x1c10cd;});}return null;};}function removeEntity(_0x2be261,_0x3f8136){return function(_0x2a009c){if(_0x2a009c){return _0x2a009c[_0x1abc('0x27')]()['then'](function(){_0x2be261[_0x1abc('0x1b')](0xcc)[_0x1abc('0x28')]();});}};}function handleEntityNotFound(_0x142fa0,_0x2ab40b){return function(_0x4fe01e){if(!_0x4fe01e){_0x142fa0[_0x1abc('0x29')](0x194);}return _0x4fe01e;};}function handleError(_0x192f6b,_0x5a5c94){_0x5a5c94=_0x5a5c94||0x1f4;return function(_0xca9512){logger[_0x1abc('0x2a')](_0xca9512[_0x1abc('0x2b')]);if(_0xca9512['name']){delete _0xca9512[_0x1abc('0x2c')];}_0x192f6b[_0x1abc('0x1b')](_0x5a5c94)[_0x1abc('0x2d')](_0xca9512);};}exports[_0x1abc('0x2e')]=function(_0x2c0bdd,_0x1a105b){var _0x50e1ac={},_0xa6011d={},_0x172f8a={'count':0x0,'rows':[]};var _0x107e60=_['map'](db[_0x1abc('0x2f')][_0x1abc('0x30')],function(_0x21b495){return{'name':_0x21b495[_0x1abc('0x31')],'type':_0x21b495[_0x1abc('0x32')][_0x1abc('0x33')]};});_0xa6011d[_0x1abc('0x34')]=_[_0x1abc('0x35')](_['map'](_0x107e60,_0x1abc('0x2c')),[_0x1abc('0x2c')]);_0xa6011d[_0x1abc('0x36')]=_['keys'](_0x2c0bdd['query']);_0xa6011d['filters']=_[_0x1abc('0x37')](_0xa6011d['model'],_0xa6011d['query']);_0x50e1ac[_0x1abc('0x38')]=_[_0x1abc('0x37')](_0xa6011d[_0x1abc('0x34')],qs['fields'](_0x2c0bdd['query'][_0x1abc('0x39')]));_0x50e1ac['attributes']=_0x50e1ac[_0x1abc('0x38')]['length']?_0x50e1ac[_0x1abc('0x38')]:_0xa6011d[_0x1abc('0x34')];if(!_0x2c0bdd[_0x1abc('0x36')][_0x1abc('0x3a')]('nolimit')){_0x50e1ac['limit']=qs[_0x1abc('0x1e')](_0x2c0bdd['query'][_0x1abc('0x1e')]);_0x50e1ac[_0x1abc('0x1c')]=qs[_0x1abc('0x1c')](_0x2c0bdd[_0x1abc('0x36')][_0x1abc('0x1c')]);}_0x50e1ac[_0x1abc('0x3b')]=qs[_0x1abc('0x3c')](_0x2c0bdd['query'][_0x1abc('0x3c')]);_0x50e1ac[_0x1abc('0x3d')]=qs[_0x1abc('0x3e')](_[_0x1abc('0x3f')](_0x2c0bdd['query'],_0xa6011d[_0x1abc('0x3e')]),_0x107e60);if(_0x2c0bdd[_0x1abc('0x36')][_0x1abc('0x40')]){_0x50e1ac['where']=_[_0x1abc('0x41')](_0x50e1ac[_0x1abc('0x3d')],{'$or':_[_0x1abc('0x42')](_0x107e60,function(_0x597486){if(_0x597486['type']!==_0x1abc('0x43')){var _0x3a9995={};_0x3a9995[_0x597486['name']]={'$like':'%'+_0x2c0bdd[_0x1abc('0x36')][_0x1abc('0x40')]+'%'};return _0x3a9995;}})});}_0x50e1ac=_['merge']({},_0x50e1ac,_0x2c0bdd[_0x1abc('0x44')]);var _0x31a816={'where':_0x50e1ac[_0x1abc('0x3d')]};return db[_0x1abc('0x2f')][_0x1abc('0x1f')](_0x31a816)[_0x1abc('0x26')](function(_0x3f34d3){_0x172f8a[_0x1abc('0x1f')]=_0x3f34d3;if(_0x2c0bdd[_0x1abc('0x36')][_0x1abc('0x45')]){_0x50e1ac[_0x1abc('0x46')]=[{'all':!![]}];}return db[_0x1abc('0x2f')][_0x1abc('0x47')](_0x50e1ac);})['then'](function(_0x432bef){_0x172f8a[_0x1abc('0x48')]=_0x432bef;return _0x172f8a;})[_0x1abc('0x26')](respondWithFilteredResult(_0x1a105b,_0x50e1ac))[_0x1abc('0x49')](handleError(_0x1a105b,null));};exports['show']=function(_0x17216e,_0x97df45){var _0x5e1dda={'raw':!![],'where':{'id':_0x17216e['params']['id']}},_0x3bbcdd={};_0x3bbcdd[_0x1abc('0x34')]=_[_0x1abc('0x4a')](db[_0x1abc('0x2f')]['rawAttributes']);_0x3bbcdd[_0x1abc('0x36')]=_[_0x1abc('0x4a')](_0x17216e[_0x1abc('0x36')]);_0x3bbcdd['filters']=_[_0x1abc('0x37')](_0x3bbcdd[_0x1abc('0x34')],_0x3bbcdd[_0x1abc('0x36')]);_0x5e1dda[_0x1abc('0x38')]=_['intersection'](_0x3bbcdd[_0x1abc('0x34')],qs[_0x1abc('0x39')](_0x17216e[_0x1abc('0x36')]['fields']));_0x5e1dda[_0x1abc('0x38')]=_0x5e1dda[_0x1abc('0x38')]['length']?_0x5e1dda['attributes']:_0x3bbcdd[_0x1abc('0x34')];if(_0x17216e[_0x1abc('0x36')]['includeAll']){_0x5e1dda[_0x1abc('0x46')]=[{'all':!![]}];}_0x5e1dda=_['merge']({},_0x5e1dda,_0x17216e[_0x1abc('0x44')]);return db['CmCustomField'][_0x1abc('0x4b')](_0x5e1dda)[_0x1abc('0x26')](handleEntityNotFound(_0x97df45,null))[_0x1abc('0x26')](respondWithResult(_0x97df45,null))[_0x1abc('0x49')](handleError(_0x97df45,null));};exports[_0x1abc('0x25')]=function(_0x2aa032,_0x1f00ee){if(_0x2aa032[_0x1abc('0x4c')]['id']){delete _0x2aa032[_0x1abc('0x4c')]['id'];}return db[_0x1abc('0x2f')][_0x1abc('0x4b')]({'where':{'id':_0x2aa032[_0x1abc('0x4d')]['id']}})[_0x1abc('0x26')](handleEntityNotFound(_0x1f00ee,null))[_0x1abc('0x26')](saveUpdates(_0x2aa032[_0x1abc('0x4c')],null))[_0x1abc('0x26')](respondWithResult(_0x1f00ee,null))[_0x1abc('0x49')](handleError(_0x1f00ee,null));};exports['destroy']=function(_0x130352,_0x21f750){return db['CmCustomField']['find']({'where':{'id':_0x130352[_0x1abc('0x4d')]['id']}})['then'](handleEntityNotFound(_0x21f750,null))[_0x1abc('0x26')](removeEntity(_0x21f750,null))[_0x1abc('0x49')](handleError(_0x21f750,null));};exports['create']=function(_0x23e319,_0xff237d){var _0x5394ea;return db[_0x1abc('0x4e')][_0x1abc('0x4f')](function(_0x427279){return db[_0x1abc('0x2f')]['create'](_0x23e319[_0x1abc('0x4c')],{'transaction':_0x427279})[_0x1abc('0x26')](function(_0x1738b3){_0x5394ea=_0x1738b3;var _0x5c9580={'type':db[_0x1abc('0x50')][_0x1abc('0x51')],'transaction':_0x427279};switch(_0x23e319[_0x1abc('0x4c')][_0x1abc('0x32')]){case _0x1abc('0x52'):_0x5c9580[_0x1abc('0x32')]=db[_0x1abc('0x50')][_0x1abc('0x51')];break;case _0x1abc('0x53'):_0x5c9580[_0x1abc('0x32')]=db[_0x1abc('0x50')][_0x1abc('0x54')];break;case _0x1abc('0x55'):_0x5c9580[_0x1abc('0x32')]=db[_0x1abc('0x50')][_0x1abc('0x56')];_0x5c9580[_0x1abc('0x57')]=![];break;default:}return db[_0x1abc('0x4e')][_0x1abc('0x58')]['addColumn'](_0x1abc('0x59'),util[_0x1abc('0x5a')]('cf_%d',_0x5394ea['id']),_0x5c9580);})[_0x1abc('0x26')](function(){return _0x5394ea;});})['then'](respondWithResult(_0xff237d,0xc9))[_0x1abc('0x49')](handleError(_0xff237d,null));}; \ No newline at end of file +var _0xcc7d=['../../config/environment','../../config/license/util','sendStatus','end','status','limit','undefined','count','offset','set','Content-Range','json','reject','save','update','then','destroy','name','index','map','CmCustomField','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','intersection','find','catch','body','create','transaction','Sequelize','TEXT','text','number','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','format','cf_%d','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils'];(function(_0x2b17f9,_0x23f737){var _0x2f13c9=function(_0x400d60){while(--_0x400d60){_0x2b17f9['push'](_0x2b17f9['shift']());}};_0x2f13c9(++_0x23f737);}(_0xcc7d,0x94));var _0xdcc7=function(_0x14657a,_0x578f8d){_0x14657a=_0x14657a-0x0;var _0x29a820=_0xcc7d[_0x14657a];return _0x29a820;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdcc7('0x0'));var zipdir=require(_0xdcc7('0x1'));var jsonpatch=require(_0xdcc7('0x2'));var rp=require(_0xdcc7('0x3'));var moment=require('moment');var BPromise=require(_0xdcc7('0x4'));var Mustache=require(_0xdcc7('0x5'));var util=require('util');var path=require(_0xdcc7('0x6'));var sox=require(_0xdcc7('0x7'));var csv=require(_0xdcc7('0x8'));var ejs=require(_0xdcc7('0x9'));var fs=require('fs');var fs_extra=require(_0xdcc7('0xa'));var _=require('lodash');var squel=require(_0xdcc7('0xb'));var crypto=require(_0xdcc7('0xc'));var jsforce=require(_0xdcc7('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xdcc7('0x8'));var querystring=require(_0xdcc7('0xe'));var Papa=require(_0xdcc7('0xf'));var Redis=require(_0xdcc7('0x10'));var authService=require(_0xdcc7('0x11'));var qs=require(_0xdcc7('0x12'));var as=require(_0xdcc7('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdcc7('0x14'))('api');var utils=require(_0xdcc7('0x15'));var config=require(_0xdcc7('0x16'));var licenseUtil=require(_0xdcc7('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5c79c7,_0x37ee69){_0x37ee69=_0x37ee69||0xcc;return function(_0x493d12){if(_0x493d12){return _0x5c79c7[_0xdcc7('0x18')](_0x37ee69);}return _0x5c79c7['status'](_0x37ee69)[_0xdcc7('0x19')]();};}function respondWithResult(_0x3054fe,_0x3ee630){_0x3ee630=_0x3ee630||0xc8;return function(_0x51ff82){if(_0x51ff82){return _0x3054fe[_0xdcc7('0x1a')](_0x3ee630)['json'](_0x51ff82);}};}function respondWithFilteredResult(_0x311490,_0x594fde){return function(_0x5cf061){if(_0x5cf061){var _0x2283c9=typeof _0x594fde['offset']==='undefined'&&typeof _0x594fde[_0xdcc7('0x1b')]===_0xdcc7('0x1c');var _0x20831a=_0x5cf061[_0xdcc7('0x1d')];var _0x161025=_0x2283c9?0x0:_0x594fde[_0xdcc7('0x1e')];var _0x5ee893=_0x2283c9?_0x5cf061[_0xdcc7('0x1d')]:_0x594fde[_0xdcc7('0x1e')]+_0x594fde['limit'];var _0x7cd544;if(_0x5ee893>=_0x20831a){_0x5ee893=_0x20831a;_0x7cd544=0xc8;}else{_0x7cd544=0xce;}_0x311490[_0xdcc7('0x1a')](_0x7cd544);return _0x311490[_0xdcc7('0x1f')](_0xdcc7('0x20'),_0x161025+'-'+_0x5ee893+'/'+_0x20831a)[_0xdcc7('0x21')](_0x5cf061);}return null;};}function patchUpdates(_0xce0538){return function(_0x3c0e91){try{jsonpatch['apply'](_0x3c0e91,_0xce0538,!![]);}catch(_0x1af40b){return BPromise[_0xdcc7('0x22')](_0x1af40b);}return _0x3c0e91[_0xdcc7('0x23')]();};}function saveUpdates(_0x43a4dc,_0x17c5d8){return function(_0x204fdf){if(_0x204fdf){return _0x204fdf[_0xdcc7('0x24')](_0x43a4dc)[_0xdcc7('0x25')](function(_0x41042b){return _0x41042b;});}return null;};}function removeEntity(_0x5ea120,_0x1dc686){return function(_0xdbc67c){if(_0xdbc67c){return _0xdbc67c[_0xdcc7('0x26')]()[_0xdcc7('0x25')](function(){_0x5ea120[_0xdcc7('0x1a')](0xcc)[_0xdcc7('0x19')]();});}};}function handleEntityNotFound(_0x655c38,_0x11d3bb){return function(_0x41e6a1){if(!_0x41e6a1){_0x655c38['sendStatus'](0x194);}return _0x41e6a1;};}function handleError(_0x1400cc,_0x34f307){_0x34f307=_0x34f307||0x1f4;return function(_0x5cbb11){logger['error'](_0x5cbb11['stack']);if(_0x5cbb11[_0xdcc7('0x27')]){delete _0x5cbb11['name'];}_0x1400cc[_0xdcc7('0x1a')](_0x34f307)['send'](_0x5cbb11);};}exports[_0xdcc7('0x28')]=function(_0x3a8aeb,_0x2a00ee){var _0x17b0dd={},_0x5428b0={},_0x458e62={'count':0x0,'rows':[]};var _0x1e186f=_[_0xdcc7('0x29')](db[_0xdcc7('0x2a')][_0xdcc7('0x2b')],function(_0xce42b5){return{'name':_0xce42b5[_0xdcc7('0x2c')],'type':_0xce42b5[_0xdcc7('0x2d')][_0xdcc7('0x2e')]};});_0x5428b0[_0xdcc7('0x2f')]=_['differenceBy'](_[_0xdcc7('0x29')](_0x1e186f,'name'),[_0xdcc7('0x27')]);_0x5428b0[_0xdcc7('0x30')]=_[_0xdcc7('0x31')](_0x3a8aeb[_0xdcc7('0x30')]);_0x5428b0[_0xdcc7('0x32')]=_['intersection'](_0x5428b0[_0xdcc7('0x2f')],_0x5428b0[_0xdcc7('0x30')]);_0x17b0dd[_0xdcc7('0x33')]=_['intersection'](_0x5428b0[_0xdcc7('0x2f')],qs[_0xdcc7('0x34')](_0x3a8aeb[_0xdcc7('0x30')][_0xdcc7('0x34')]));_0x17b0dd[_0xdcc7('0x33')]=_0x17b0dd[_0xdcc7('0x33')]['length']?_0x17b0dd[_0xdcc7('0x33')]:_0x5428b0[_0xdcc7('0x2f')];if(!_0x3a8aeb['query'][_0xdcc7('0x35')](_0xdcc7('0x36'))){_0x17b0dd['limit']=qs[_0xdcc7('0x1b')](_0x3a8aeb[_0xdcc7('0x30')][_0xdcc7('0x1b')]);_0x17b0dd[_0xdcc7('0x1e')]=qs[_0xdcc7('0x1e')](_0x3a8aeb['query']['offset']);}_0x17b0dd[_0xdcc7('0x37')]=qs['sort'](_0x3a8aeb['query']['sort']);_0x17b0dd[_0xdcc7('0x38')]=qs[_0xdcc7('0x32')](_[_0xdcc7('0x39')](_0x3a8aeb[_0xdcc7('0x30')],_0x5428b0[_0xdcc7('0x32')]),_0x1e186f);if(_0x3a8aeb[_0xdcc7('0x30')][_0xdcc7('0x3a')]){_0x17b0dd['where']=_[_0xdcc7('0x3b')](_0x17b0dd[_0xdcc7('0x38')],{'$or':_[_0xdcc7('0x29')](_0x1e186f,function(_0x297607){if(_0x297607[_0xdcc7('0x2d')]!==_0xdcc7('0x3c')){var _0x409234={};_0x409234[_0x297607['name']]={'$like':'%'+_0x3a8aeb[_0xdcc7('0x30')]['filter']+'%'};return _0x409234;}})});}_0x17b0dd=_['merge']({},_0x17b0dd,_0x3a8aeb['options']);var _0x46e65e={'where':_0x17b0dd['where']};return db['CmCustomField'][_0xdcc7('0x1d')](_0x46e65e)[_0xdcc7('0x25')](function(_0x294ac5){_0x458e62[_0xdcc7('0x1d')]=_0x294ac5;if(_0x3a8aeb[_0xdcc7('0x30')][_0xdcc7('0x3d')]){_0x17b0dd[_0xdcc7('0x3e')]=[{'all':!![]}];}return db['CmCustomField'][_0xdcc7('0x3f')](_0x17b0dd);})[_0xdcc7('0x25')](function(_0xd7c32c){_0x458e62[_0xdcc7('0x40')]=_0xd7c32c;return _0x458e62;})[_0xdcc7('0x25')](respondWithFilteredResult(_0x2a00ee,_0x17b0dd))['catch'](handleError(_0x2a00ee,null));};exports[_0xdcc7('0x41')]=function(_0x253339,_0x21d237){var _0x564e6d={'raw':!![],'where':{'id':_0x253339[_0xdcc7('0x42')]['id']}},_0x286dac={};_0x286dac[_0xdcc7('0x2f')]=_[_0xdcc7('0x31')](db['CmCustomField'][_0xdcc7('0x2b')]);_0x286dac[_0xdcc7('0x30')]=_[_0xdcc7('0x31')](_0x253339['query']);_0x286dac['filters']=_[_0xdcc7('0x43')](_0x286dac[_0xdcc7('0x2f')],_0x286dac[_0xdcc7('0x30')]);_0x564e6d[_0xdcc7('0x33')]=_[_0xdcc7('0x43')](_0x286dac[_0xdcc7('0x2f')],qs[_0xdcc7('0x34')](_0x253339[_0xdcc7('0x30')]['fields']));_0x564e6d[_0xdcc7('0x33')]=_0x564e6d[_0xdcc7('0x33')]['length']?_0x564e6d[_0xdcc7('0x33')]:_0x286dac[_0xdcc7('0x2f')];if(_0x253339[_0xdcc7('0x30')][_0xdcc7('0x3d')]){_0x564e6d[_0xdcc7('0x3e')]=[{'all':!![]}];}_0x564e6d=_[_0xdcc7('0x3b')]({},_0x564e6d,_0x253339['options']);return db[_0xdcc7('0x2a')][_0xdcc7('0x44')](_0x564e6d)[_0xdcc7('0x25')](handleEntityNotFound(_0x21d237,null))[_0xdcc7('0x25')](respondWithResult(_0x21d237,null))[_0xdcc7('0x45')](handleError(_0x21d237,null));};exports[_0xdcc7('0x24')]=function(_0x4883bf,_0xf0066c){if(_0x4883bf['body']['id']){delete _0x4883bf[_0xdcc7('0x46')]['id'];}return db[_0xdcc7('0x2a')][_0xdcc7('0x44')]({'where':{'id':_0x4883bf[_0xdcc7('0x42')]['id']}})[_0xdcc7('0x25')](handleEntityNotFound(_0xf0066c,null))[_0xdcc7('0x25')](saveUpdates(_0x4883bf['body'],null))[_0xdcc7('0x25')](respondWithResult(_0xf0066c,null))[_0xdcc7('0x45')](handleError(_0xf0066c,null));};exports[_0xdcc7('0x26')]=function(_0x206a3f,_0x563fdd){return db['CmCustomField'][_0xdcc7('0x44')]({'where':{'id':_0x206a3f[_0xdcc7('0x42')]['id']}})[_0xdcc7('0x25')](handleEntityNotFound(_0x563fdd,null))['then'](removeEntity(_0x563fdd,null))[_0xdcc7('0x45')](handleError(_0x563fdd,null));};exports[_0xdcc7('0x47')]=function(_0x33ca1f,_0x5e893b){var _0x578d37;return db['sequelize'][_0xdcc7('0x48')](function(_0x900d54){return db[_0xdcc7('0x2a')][_0xdcc7('0x47')](_0x33ca1f[_0xdcc7('0x46')],{'transaction':_0x900d54})['then'](function(_0x5c9383){_0x578d37=_0x5c9383;var _0x67512d={'type':db[_0xdcc7('0x49')][_0xdcc7('0x4a')],'transaction':_0x900d54};switch(_0x33ca1f[_0xdcc7('0x46')]['type']){case _0xdcc7('0x4b'):_0x67512d[_0xdcc7('0x2d')]=db[_0xdcc7('0x49')]['TEXT'];break;case _0xdcc7('0x4c'):_0x67512d[_0xdcc7('0x2d')]=db['Sequelize']['INTEGER'];break;case _0xdcc7('0x4d'):_0x67512d[_0xdcc7('0x2d')]=db[_0xdcc7('0x49')][_0xdcc7('0x4e')];_0x67512d[_0xdcc7('0x4f')]=![];break;default:}return db['sequelize'][_0xdcc7('0x50')][_0xdcc7('0x51')](_0xdcc7('0x52'),util[_0xdcc7('0x53')](_0xdcc7('0x54'),_0x578d37['id']),_0x67512d);})[_0xdcc7('0x25')](function(){return _0x578d37;});})['then'](respondWithResult(_0x5e893b,0xc9))[_0xdcc7('0x45')](handleError(_0x5e893b,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 14f1601..eeb9a82 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 _0xbddc=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','CmCustomField','cm_custom_fields','lodash','util'];(function(_0x102881,_0x58d723){var _0x5c63d0=function(_0x955c59){while(--_0x955c59){_0x102881['push'](_0x102881['shift']());}};_0x5c63d0(++_0x58d723);}(_0xbddc,0x150));var _0xcbdd=function(_0x4d1841,_0x225b64){_0x4d1841=_0x4d1841-0x0;var _0x2f927a=_0xbddc[_0x4d1841];return _0x2f927a;};'use strict';var _=require(_0xcbdd('0x0'));var util=require(_0xcbdd('0x1'));var logger=require(_0xcbdd('0x2'))(_0xcbdd('0x3'));var moment=require(_0xcbdd('0x4'));var BPromise=require(_0xcbdd('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcbdd('0x6'));var rimraf=require(_0xcbdd('0x7'));var config=require(_0xcbdd('0x8'));var attributes=require('./cmCustomField.attributes');module[_0xcbdd('0x9')]=function(_0x2fbd72,_0x1416c2){return _0x2fbd72[_0xcbdd('0xa')](_0xcbdd('0xb'),attributes,{'tableName':_0xcbdd('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd572=['./cmCustomField.attributes','exports','define','CmCustomField','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x1fc323,_0x1ab8a9){var _0x380b84=function(_0x5b0aa7){while(--_0x5b0aa7){_0x1fc323['push'](_0x1fc323['shift']());}};_0x380b84(++_0x1ab8a9);}(_0xd572,0x1c0));var _0x2d57=function(_0x3b5ce6,_0x2870ca){_0x3b5ce6=_0x3b5ce6-0x0;var _0x45b9fd=_0xd572[_0x3b5ce6];return _0x45b9fd;};'use strict';var _=require(_0x2d57('0x0'));var util=require(_0x2d57('0x1'));var logger=require(_0x2d57('0x2'))('api');var moment=require(_0x2d57('0x3'));var BPromise=require(_0x2d57('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2d57('0x5'));var rimraf=require(_0x2d57('0x6'));var config=require(_0x2d57('0x7'));var attributes=require(_0x2d57('0x8'));module[_0x2d57('0x9')]=function(_0x4bd49b,_0x47cc97){return _0x4bd49b[_0x2d57('0xa')](_0x2d57('0xb'),attributes,{'tableName':'cm_custom_fields','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 f53ab30..f8ac1e8 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 _0x6980=['client','http','CmCustomField,\x20%s,\x20%s','CmCustomField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','lodash','util','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x37b1aa,_0x2ad8d9){var _0x2789c2=function(_0x30f50c){while(--_0x30f50c){_0x37b1aa['push'](_0x37b1aa['shift']());}};_0x2789c2(++_0x2ad8d9);}(_0x6980,0xef));var _0x0698=function(_0x3b5ad9,_0x223867){_0x3b5ad9=_0x3b5ad9-0x0;var _0x611ae9=_0x6980[_0x3b5ad9];return _0x611ae9;};'use strict';var _=require(_0x0698('0x0'));var util=require(_0x0698('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0698('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0698('0x3'));var logger=require(_0x0698('0x4'))(_0x0698('0x5'));var config=require(_0x0698('0x6'));var jayson=require(_0x0698('0x7'));var client=jayson[_0x0698('0x8')][_0x0698('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1fb906,_0x45da8f,_0xbd1409){return new BPromise(function(_0x1b6863,_0x3534cd){return client['request'](_0x1fb906,_0xbd1409)['then'](function(_0x2b8951){logger['info'](_0x0698('0xa'),_0x45da8f,'request\x20sent');logger['debug'](_0x0698('0xb'),_0x45da8f,_0x0698('0xc'),JSON[_0x0698('0xd')](_0x2b8951));if(_0x2b8951['error']){if(_0x2b8951[_0x0698('0xe')]['code']===0x1f4){logger[_0x0698('0xe')]('CmCustomField,\x20%s,\x20%s',_0x45da8f,_0x2b8951[_0x0698('0xe')][_0x0698('0xf')]);return _0x3534cd(_0x2b8951[_0x0698('0xe')]['message']);}logger['error'](_0x0698('0xa'),_0x45da8f,_0x2b8951[_0x0698('0xe')][_0x0698('0xf')]);return _0x1b6863(_0x2b8951[_0x0698('0xe')][_0x0698('0xf')]);}else{logger[_0x0698('0x10')]('CmCustomField,\x20%s,\x20%s',_0x45da8f,'request\x20sent');_0x1b6863(_0x2b8951[_0x0698('0x11')][_0x0698('0xf')]);}})[_0x0698('0x12')](function(_0x327e89){logger[_0x0698('0xe')]('CmCustomField,\x20%s,\x20%s',_0x45da8f,_0x327e89);_0x3534cd(_0x327e89);});});} \ No newline at end of file +var _0xbf29=['code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x4c4481,_0xa860e4){var _0x39aa25=function(_0x4b01d8){while(--_0x4b01d8){_0x4c4481['push'](_0x4c4481['shift']());}};_0x39aa25(++_0xa860e4);}(_0xbf29,0x12e));var _0x9bf2=function(_0x503a0e,_0x5d7337){_0x503a0e=_0x503a0e-0x0;var _0x48af32=_0xbf29[_0x503a0e];return _0x48af32;};'use strict';var _=require(_0x9bf2('0x0'));var util=require('util');var moment=require(_0x9bf2('0x1'));var BPromise=require(_0x9bf2('0x2'));var rs=require(_0x9bf2('0x3'));var fs=require('fs');var Redis=require(_0x9bf2('0x4'));var db=require(_0x9bf2('0x5'))['db'];var utils=require(_0x9bf2('0x6'));var logger=require(_0x9bf2('0x7'))(_0x9bf2('0x8'));var config=require(_0x9bf2('0x9'));var jayson=require(_0x9bf2('0xa'));var client=jayson[_0x9bf2('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2d8873,_0xf41fc0,_0x2cceab){return new BPromise(function(_0x4fcb95,_0x3d5719){return client[_0x9bf2('0xc')](_0x2d8873,_0x2cceab)[_0x9bf2('0xd')](function(_0x4b5f16){logger[_0x9bf2('0xe')](_0x9bf2('0xf'),_0xf41fc0,_0x9bf2('0x10'));logger[_0x9bf2('0x11')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0xf41fc0,_0x9bf2('0x10'),JSON[_0x9bf2('0x12')](_0x4b5f16));if(_0x4b5f16[_0x9bf2('0x13')]){if(_0x4b5f16[_0x9bf2('0x13')][_0x9bf2('0x14')]===0x1f4){logger['error'](_0x9bf2('0xf'),_0xf41fc0,_0x4b5f16['error'][_0x9bf2('0x15')]);return _0x3d5719(_0x4b5f16[_0x9bf2('0x13')][_0x9bf2('0x15')]);}logger[_0x9bf2('0x13')](_0x9bf2('0xf'),_0xf41fc0,_0x4b5f16['error'][_0x9bf2('0x15')]);return _0x4fcb95(_0x4b5f16['error'][_0x9bf2('0x15')]);}else{logger[_0x9bf2('0xe')](_0x9bf2('0xf'),_0xf41fc0,_0x9bf2('0x10'));_0x4fcb95(_0x4b5f16[_0x9bf2('0x16')][_0x9bf2('0x15')]);}})['catch'](function(_0x39dded){logger[_0x9bf2('0x13')](_0x9bf2('0xf'),_0xf41fc0,_0x39dded);_0x3d5719(_0x39dded);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index bcad4d6..4ba5298 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 _0xbb91=['create','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','isAuthenticated','index','get','/:id'];(function(_0x479cd5,_0x17e2be){var _0xc1d3d6=function(_0xa15135){while(--_0xa15135){_0x479cd5['push'](_0x479cd5['shift']());}};_0xc1d3d6(++_0x17e2be);}(_0xbb91,0xce));var _0x1bb9=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xbb91[_0x4565bf];return _0x5610ba;};'use strict';var multer=require(_0x1bb9('0x0'));var util=require(_0x1bb9('0x1'));var path=require(_0x1bb9('0x2'));var timeout=require('connect-timeout');var express=require(_0x1bb9('0x3'));var router=express[_0x1bb9('0x4')]();var fs_extra=require(_0x1bb9('0x5'));var auth=require(_0x1bb9('0x6'));var interaction=require(_0x1bb9('0x7'));var config=require(_0x1bb9('0x8'));var controller=require(_0x1bb9('0x9'));router['get']('/',auth[_0x1bb9('0xa')](),controller[_0x1bb9('0xb')]);router[_0x1bb9('0xc')](_0x1bb9('0xd'),auth[_0x1bb9('0xa')](),controller['show']);router['post']('/',auth[_0x1bb9('0xa')](),controller[_0x1bb9('0xe')]);router[_0x1bb9('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x1bb9('0x10')]);router[_0x1bb9('0x11')](_0x1bb9('0xd'),auth[_0x1bb9('0xa')](),controller[_0x1bb9('0x12')]);module[_0x1bb9('0x13')]=router; \ No newline at end of file +var _0x55d2=['../../config/environment','./cmCustomField.controller','get','isAuthenticated','/:id','show','post','update','destroy','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x4c2623,_0x4838bb){var _0x2be431=function(_0x55829d){while(--_0x55829d){_0x4c2623['push'](_0x4c2623['shift']());}};_0x2be431(++_0x4838bb);}(_0x55d2,0x9f));var _0x255d=function(_0x475c37,_0x386f90){_0x475c37=_0x475c37-0x0;var _0x711fdc=_0x55d2[_0x475c37];return _0x711fdc;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x255d('0x0'));var timeout=require(_0x255d('0x1'));var express=require(_0x255d('0x2'));var router=express[_0x255d('0x3')]();var fs_extra=require(_0x255d('0x4'));var auth=require(_0x255d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x255d('0x6'));var controller=require(_0x255d('0x7'));router[_0x255d('0x8')]('/',auth[_0x255d('0x9')](),controller['index']);router['get'](_0x255d('0xa'),auth[_0x255d('0x9')](),controller[_0x255d('0xb')]);router[_0x255d('0xc')]('/',auth[_0x255d('0x9')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x255d('0xd')]);router['delete'](_0x255d('0xa'),auth[_0x255d('0x9')](),controller[_0x255d('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index b1fc0e1..5891acc 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 _0x6b21=['YYYY-MM-DD\x20HH:mm:ss','INTEGER','STRING','UNSIGNED','contactListQueue','moment','sequelize','exports','BOOLEAN','DATE','format'];(function(_0xc8a25b,_0x1586d5){var _0x4b0e3b=function(_0x8d13d4){while(--_0x8d13d4){_0xc8a25b['push'](_0xc8a25b['shift']());}};_0x4b0e3b(++_0x1586d5);}(_0x6b21,0x186));var _0x16b2=function(_0x4fb13a,_0x39b395){_0x4fb13a=_0x4fb13a-0x0;var _0x55791d=_0x6b21[_0x4fb13a];return _0x55791d;};'use strict';var moment=require(_0x16b2('0x0'));var Sequelize=require(_0x16b2('0x1'));module[_0x16b2('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize[_0x16b2('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x16b2('0x4')],'defaultValue':moment()[_0x16b2('0x5')](_0x16b2('0x6'))},'countbusyretry':{'type':Sequelize[_0x16b2('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x16b2('0x7')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x16b2('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x16b2('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x16b2('0x8')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x16b2('0x4')]},'priority':{'type':Sequelize[_0x16b2('0x7')](0x2)[_0x16b2('0x9')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x16b2('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x16b2('0xa')},'ListId':{'type':Sequelize[_0x16b2('0x7')],'unique':_0x16b2('0xa')},'UserId':{'type':Sequelize[_0x16b2('0x7')]},'VoiceQueueId':{'type':Sequelize[_0x16b2('0x7')],'unique':_0x16b2('0xa')},'CampaignId':{'type':Sequelize[_0x16b2('0x7')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x16b2('0x7')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x16b2('0x7')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x16b2('0x7')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x16b2('0x7')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']},'recallmeNotifiedDate':{'type':Sequelize[_0x16b2('0x4')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0x193b=['sequelize','exports','STRING','BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','moment'];(function(_0x11e7f8,_0x1fbc4f){var _0x530dac=function(_0x268135){while(--_0x268135){_0x11e7f8['push'](_0x11e7f8['shift']());}};_0x530dac(++_0x1fbc4f);}(_0x193b,0x1b7));var _0xb193=function(_0x3c54d3,_0x9719e3){_0x3c54d3=_0x3c54d3-0x0;var _0xd67c8f=_0x193b[_0x3c54d3];return _0xd67c8f;};'use strict';var moment=require(_0xb193('0x0'));var Sequelize=require(_0xb193('0x1'));module[_0xb193('0x2')]={'phone':{'type':Sequelize[_0xb193('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0xb193('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xb193('0x5')],'defaultValue':moment()[_0xb193('0x6')](_0xb193('0x7'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xb193('0x8')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xb193('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xb193('0x5')]},'priority':{'type':Sequelize[_0xb193('0x8')](0x2)[_0xb193('0x9')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xb193('0x4')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xb193('0x8')],'unique':_0xb193('0xa')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0xb193('0xa')},'UserId':{'type':Sequelize[_0xb193('0x8')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0xb193('0xa')},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize[_0xb193('0x8')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xb193('0x8')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xb193('0x8')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xb193('0x8')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xb193('0x8')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0xb193('0x8')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']},'recallmeNotifiedDate':{'type':Sequelize[_0xb193('0x5')],'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 6fa4be1..7972094 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 _0x33c5=['$contained','$any','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','find','create','body','describe','destroy','CampaignId','VoiceQueueId','VoiceQueue','Campaign','dataValues','createdAt','updatedAt','statedesc','membername','user','UserId','deleted','format','calleridnum','phone','campaigntype','queue','ivr','CmContact','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','CmHopperAdditionalPhone','end','getPreview','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','transaction','YYYY-MM-DD\x20HH:mm:ss','value','direction','prev','isEmpty','hopperIds','priority','ASC','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','scheduledAt','COALESCE(CmHopper.UserId,\x200)\x20DESC','scheduledat','recallme','LOCK','UPDATE','CmCompany','Company','CmList','List','Queue','getPreviewRecall','findOne','Contact','dialActive','getOpenContacts','CmHopper,\x20%s,\x20%s,\x20%s','sendStatus','getTimezones','timezones','utcOffset','getTimezone','lodash','../../components/parsers/qs','api','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','update','then','error','name','send','index','map','CmHopper','rawAttributes','fieldName','type','key','keys','query','intersection','model','filters','$and','$or','$gt','$gte','$lt','$lte','$ne','$eq','$not','$notBetween','$in','$like','$iLike','$notILike','$overlap','$contains'];(function(_0x585d09,_0x1274bc){var _0x7d9a14=function(_0x343d4e){while(--_0x343d4e){_0x585d09['push'](_0x585d09['shift']());}};_0x7d9a14(++_0x1274bc);}(_0x33c5,0xe6));var _0x533c=function(_0x50e40b,_0x338d17){_0x50e40b=_0x50e40b-0x0;var _0x2608b7=_0x33c5[_0x50e40b];return _0x2608b7;};'use strict';var moment=require('moment');var _=require(_0x533c('0x0'));var qs=require(_0x533c('0x1'));var logger=require('../../config/logger')(_0x533c('0x2'));var shared=require(_0x533c('0x3'));var db=require(_0x533c('0x4'))['db'];function respondWithResult(_0x23a12d,_0x358127){_0x358127=_0x358127||0xc8;return function(_0x49609e){if(_0x49609e){return _0x23a12d[_0x533c('0x5')](_0x358127)[_0x533c('0x6')](_0x49609e);}};}function respondWithFilteredResult(_0x31d912,_0x151732){return function(_0x34ca89){if(_0x34ca89){var _0x1699d5=typeof _0x151732[_0x533c('0x7')]===_0x533c('0x8')&&typeof _0x151732[_0x533c('0x9')]===_0x533c('0x8');var _0x1782eb=_0x34ca89[_0x533c('0xa')];var _0x2c0214=_0x1699d5?0x0:_0x151732[_0x533c('0x7')];var _0x430c51=_0x1699d5?_0x34ca89[_0x533c('0xa')]:_0x151732['offset']+_0x151732[_0x533c('0x9')];var _0x28ffd2;if(_0x430c51>=_0x1782eb){_0x430c51=_0x1782eb;_0x28ffd2=0xc8;}else{_0x28ffd2=0xce;}_0x31d912[_0x533c('0x5')](_0x28ffd2);return _0x31d912[_0x533c('0xb')](_0x533c('0xc'),_0x2c0214+'-'+_0x430c51+'/'+_0x1782eb)[_0x533c('0x6')](_0x34ca89);}return null;};}function saveUpdates(_0x530e10,_0x5c9462){return function(_0xf93007){if(_0xf93007){return _0xf93007[_0x533c('0xd')](_0x530e10)[_0x533c('0xe')](function(_0x2d5bc8){return _0x2d5bc8;});}return null;};}function handleEntityNotFound(_0x1a2a83,_0x8d7c66){return function(_0xa616ca){if(!_0xa616ca){_0x1a2a83['sendStatus'](0x194);}return _0xa616ca;};}function handleError(_0x335f73,_0x7c1d33){_0x7c1d33=_0x7c1d33||0x1f4;return function(_0x3f4a5c){logger[_0x533c('0xf')](_0x3f4a5c['stack']);if(_0x3f4a5c[_0x533c('0x10')]){delete _0x3f4a5c[_0x533c('0x10')];}_0x335f73[_0x533c('0x5')](_0x7c1d33)[_0x533c('0x11')](_0x3f4a5c);};}exports[_0x533c('0x12')]=function(_0x4abaa3,_0x1f0a72){var _0x35bfd3={},_0x1f9f85={},_0x12e126={'count':0x0,'rows':[]};var _0x287b9e=_[_0x533c('0x13')](db[_0x533c('0x14')][_0x533c('0x15')],function(_0x2f21db){return{'name':_0x2f21db[_0x533c('0x16')],'type':_0x2f21db[_0x533c('0x17')][_0x533c('0x18')]};});_0x1f9f85['model']=_[_0x533c('0x13')](_0x287b9e,'name');_0x1f9f85['query']=_[_0x533c('0x19')](_0x4abaa3[_0x533c('0x1a')]);_0x1f9f85['filters']=_[_0x533c('0x1b')](_0x1f9f85[_0x533c('0x1c')],_0x1f9f85[_0x533c('0x1a')]);_0x1f9f85[_0x533c('0x1d')]=_['concat'](_0x1f9f85[_0x533c('0x1d')],[_0x533c('0x1e'),_0x533c('0x1f'),_0x533c('0x20'),_0x533c('0x21'),_0x533c('0x22'),_0x533c('0x23'),_0x533c('0x24'),_0x533c('0x25'),_0x533c('0x26'),'$between',_0x533c('0x27'),_0x533c('0x28'),'$notIn',_0x533c('0x29'),'$notLike',_0x533c('0x2a'),_0x533c('0x2b'),_0x533c('0x29'),_0x533c('0x2c'),_0x533c('0x2d'),_0x533c('0x2e'),_0x533c('0x2f')]);_0x35bfd3[_0x533c('0x30')]=_[_0x533c('0x1b')](_0x1f9f85[_0x533c('0x1c')],qs[_0x533c('0x31')](_0x4abaa3[_0x533c('0x1a')]['fields']));_0x35bfd3[_0x533c('0x30')]=_0x35bfd3['attributes'][_0x533c('0x32')]?_0x35bfd3[_0x533c('0x30')]:_0x1f9f85[_0x533c('0x1c')];if(!_0x4abaa3[_0x533c('0x1a')][_0x533c('0x33')](_0x533c('0x34'))){_0x35bfd3[_0x533c('0x9')]=qs[_0x533c('0x9')](_0x4abaa3[_0x533c('0x1a')][_0x533c('0x9')]);_0x35bfd3[_0x533c('0x7')]=qs[_0x533c('0x7')](_0x4abaa3[_0x533c('0x1a')][_0x533c('0x7')]);}_0x35bfd3[_0x533c('0x35')]=qs['sort'](_0x4abaa3[_0x533c('0x1a')][_0x533c('0x36')]);_0x35bfd3[_0x533c('0x37')]=qs[_0x533c('0x1d')](_['pick'](_0x4abaa3[_0x533c('0x1a')],_0x1f9f85[_0x533c('0x1d')]),_0x287b9e);if(_0x4abaa3[_0x533c('0x1a')][_0x533c('0x38')]){_0x35bfd3[_0x533c('0x37')]=_['merge'](_0x35bfd3['where'],{'$or':_['map'](_0x287b9e,function(_0x56cdfd){if(_0x56cdfd['type']!==_0x533c('0x39')){var _0x4b6c22={};_0x4b6c22[_0x56cdfd[_0x533c('0x10')]]={'$like':'%'+_0x4abaa3['query'][_0x533c('0x38')]+'%'};return _0x4b6c22;}})});}_0x35bfd3=_[_0x533c('0x3a')]({},_0x35bfd3,_0x4abaa3[_0x533c('0x3b')]);var _0x56adcc={'where':_0x35bfd3[_0x533c('0x37')]};return db[_0x533c('0x14')][_0x533c('0xa')](_0x56adcc)['then'](function(_0x160d4b){_0x12e126[_0x533c('0xa')]=_0x160d4b;if(_0x4abaa3[_0x533c('0x1a')]['includeAll']){_0x35bfd3[_0x533c('0x3c')]=[{'all':!![]}];}return db[_0x533c('0x14')][_0x533c('0x3d')](_0x35bfd3);})[_0x533c('0xe')](function(_0x454dbc){_0x12e126[_0x533c('0x3e')]=_0x454dbc;return _0x12e126;})[_0x533c('0xe')](respondWithFilteredResult(_0x1f0a72,_0x35bfd3))[_0x533c('0x3f')](handleError(_0x1f0a72,null));};exports[_0x533c('0x40')]=function(_0x2c03fa,_0x298cea){var _0x55af6e={'raw':!![],'where':{'id':_0x2c03fa[_0x533c('0x41')]['id']}},_0x30d560={};_0x30d560[_0x533c('0x1c')]=_[_0x533c('0x19')](db[_0x533c('0x14')][_0x533c('0x15')]);_0x30d560['query']=_[_0x533c('0x19')](_0x2c03fa[_0x533c('0x1a')]);_0x30d560[_0x533c('0x1d')]=_['intersection'](_0x30d560[_0x533c('0x1c')],_0x30d560[_0x533c('0x1a')]);_0x55af6e[_0x533c('0x30')]=_[_0x533c('0x1b')](_0x30d560['model'],qs[_0x533c('0x31')](_0x2c03fa['query'][_0x533c('0x31')]));_0x55af6e[_0x533c('0x30')]=_0x55af6e['attributes'][_0x533c('0x32')]?_0x55af6e[_0x533c('0x30')]:_0x30d560[_0x533c('0x1c')];if(_0x2c03fa['query']['includeAll']){_0x55af6e['include']=[{'all':!![]}];}_0x55af6e=_['merge']({},_0x55af6e,_0x2c03fa[_0x533c('0x3b')]);return db['CmHopper'][_0x533c('0x42')](_0x55af6e)['then'](handleEntityNotFound(_0x298cea,null))[_0x533c('0xe')](respondWithResult(_0x298cea,null))['catch'](handleError(_0x298cea,null));};exports[_0x533c('0x43')]=function(_0x4a946b,_0x4c17b1){return db[_0x533c('0x14')][_0x533c('0x43')](_0x4a946b[_0x533c('0x44')],{})[_0x533c('0xe')](respondWithResult(_0x4c17b1,0xc9))[_0x533c('0x3f')](handleError(_0x4c17b1,null));};exports['update']=function(_0x47cca7,_0x22dc87){if(_0x47cca7[_0x533c('0x44')]['id']){delete _0x47cca7[_0x533c('0x44')]['id'];}return db['CmHopper'][_0x533c('0x42')]({'where':{'id':_0x47cca7[_0x533c('0x41')]['id']}})['then'](handleEntityNotFound(_0x22dc87,null))['then'](saveUpdates(_0x47cca7[_0x533c('0x44')],null))['then'](respondWithResult(_0x22dc87,null))[_0x533c('0x3f')](handleError(_0x22dc87,null));};exports[_0x533c('0x45')]=function(_0x19878d,_0x471c59){return db[_0x533c('0x14')][_0x533c('0x45')]()[_0x533c('0xe')](respondWithResult(_0x471c59,null))[_0x533c('0x3f')](handleError(_0x471c59,null));};exports['destroy']=function(_0x19ccc0,_0x6b16e1){var _0xaaf682;var _0x57c6c6=_0x19ccc0[_0x533c('0x41')]['id'];return db[_0x533c('0x14')]['find']({'where':{'id':_0x19ccc0[_0x533c('0x41')]['id']}})['then'](handleEntityNotFound(_0x6b16e1,null))[_0x533c('0xe')](function(_0x2d1f93){if(_0x2d1f93){return _0x2d1f93[_0x533c('0x46')]()[_0x533c('0xe')](function(_0x32d110){return _0x32d110;});}})[_0x533c('0xe')](function(_0x1745d5){_0xaaf682=_0x1745d5;if(_0x1745d5){if(_0x1745d5['VoiceQueueId']||_0x1745d5[_0x533c('0x47')]){return db[_0x1745d5[_0x533c('0x48')]?_0x533c('0x49'):_0x533c('0x4a')][_0x533c('0x42')]({'where':{'id':_0x1745d5[_0x533c('0x48')]?_0x1745d5[_0x533c('0x48')]:_0x1745d5['CampaignId']},'attributes':['id','name'],'raw':!![]});}}})['then'](function(_0x4e8c19){var _0xc99f96={};if(_0x4e8c19){_[_0x533c('0x3a')](_0xc99f96,_['omit'](_0xaaf682[_0x533c('0x4b')],[_0x533c('0x4c'),_0x533c('0x4d'),'id']));_0xc99f96['state']=0x15;_0xc99f96[_0x533c('0x4e')]='deleted';_0xc99f96['campaign']=_0x4e8c19[_0x533c('0x10')];_0xc99f96[_0x533c('0x4f')]=_0x19ccc0[_0x533c('0x50')][_0x533c('0x10')];_0xc99f96[_0x533c('0x51')]=_0x19ccc0[_0x533c('0x50')]['id'];_0xc99f96[_0x533c('0x52')]=!![];_0xc99f96['deletedat']=moment()[_0x533c('0x53')]('YYYY-MM-DD\x20HH:mm:ss');_0xc99f96[_0x533c('0x54')]=_0xaaf682[_0x533c('0x55')];_0xc99f96[_0x533c('0x56')]=_0xaaf682[_0x533c('0x48')]?_0x533c('0x57'):_0x533c('0x58');return db[_0x533c('0x59')][_0x533c('0x42')]({'where':{'id':_0xc99f96['ContactId']},'attributes':[_0x533c('0x5a'),_0x533c('0x5b')]})[_0x533c('0xe')](function(_0x94063c){if(!_[_0x533c('0x5c')](_0x6b16e1)&&!_[_0x533c('0x5c')](_0x94063c['firstName'])){_0xc99f96[_0x533c('0x5d')]=_0x94063c['firstName'];if(!_[_0x533c('0x5c')](_0x94063c[_0x533c('0x5b')])){_0xc99f96[_0x533c('0x5d')]+='\x20'+_0x94063c[_0x533c('0x5b')];}}})[_0x533c('0x5e')](function(){return db[_0x533c('0x5f')]['create'](_0xc99f96);});}})['then'](function(_0x1005a6){return db[_0x533c('0x60')][_0x533c('0x46')]({'where':{'CmHopperId':_0x57c6c6}});})[_0x533c('0xe')](function(){return _0x6b16e1['status'](0xcc)[_0x533c('0x61')]();})[_0x533c('0x3f')](handleError(_0x6b16e1,null));};exports[_0x533c('0x62')]=function(_0x352e07,_0x1c4bfa){var _0x2f2863=[];return db[_0x533c('0x59')][_0x533c('0x45')]()[_0x533c('0xe')](function(_0x3aba19){_0x2f2863=_[_0x533c('0x19')](_0x3aba19);return _0x352e07[_0x533c('0x50')][_0x533c('0x63')]({'where':{'type':_0x533c('0x64'),'dialActive':!![],'dialMethod':_0x533c('0x65')},'attributes':['id',_0x533c('0x66'),_0x533c('0x67')],'raw':!![]});})['then'](function(_0x31bba1){if(_0x31bba1&&_0x31bba1['length']){return db['sequelize'][_0x533c('0x68')](function(_0xb23f94){var _0x965b85={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x533c('0x53')](_0x533c('0x69'))},'VoiceQueueId':{'$in':_[_0x533c('0x13')](_0x31bba1,'id')},'$or':[{'UserId':null},{'UserId':_0x352e07[_0x533c('0x50')]['id']}]};var _0x50df3a={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x31bba1)[_0x533c('0x38')]([_0x533c('0x67'),0x0])['map']('id')[_0x533c('0x6a')]()},'$or':[{'UserId':null},{'UserId':_0x352e07[_0x533c('0x50')]['id']}]};var _0x8174d0={'$or':[_0x965b85,_0x50df3a]};var _0x3e3b25=[];if(_0x352e07['body'][_0x533c('0x6b')]&&_0x352e07[_0x533c('0x44')]['direction']===_0x533c('0x6c')){if(!_[_0x533c('0x6d')](_0x352e07['body'][_0x533c('0x6e')])){_0x8174d0['id']={'$in':_0x352e07[_0x533c('0x44')]['hopperIds']};}_0x3e3b25=[[_0x533c('0x6f'),'ASC'],['scheduledAt',_0x31bba1[0x0][_0x533c('0x66')]===_0x533c('0x70')?_0x533c('0x71'):_0x533c('0x70')],db['sequelize'][_0x533c('0x72')](_0x533c('0x73')),['id',_0x533c('0x71')]];}else{if(!_[_0x533c('0x6d')](_0x352e07[_0x533c('0x44')]['hopperIds'])){_0x8174d0['id']={'$notIn':_0x352e07[_0x533c('0x44')]['hopperIds']};}_0x3e3b25=[[_0x533c('0x6f'),'DESC'],[_0x533c('0x74'),_0x31bba1[0x0]['dialOrderByScheduledAt']],db['sequelize']['literal'](_0x533c('0x75')),['id',_0x533c('0x70')]];}return db[_0x533c('0x14')]['findOne']({'attributes':['id',_0x533c('0x76'),_0x533c('0x55'),_0x533c('0x77')],'where':_0x8174d0,'order':_0x3e3b25,'transaction':_0xb23f94,'lock':_0xb23f94[_0x533c('0x78')][_0x533c('0x79')],'include':[{'model':db['CmContact'],'as':'Contact','attributes':_0x2f2863,'include':[{'model':db[_0x533c('0x7a')],'as':_0x533c('0x7b'),'attributes':['id',_0x533c('0x10')]}]},{'model':db[_0x533c('0x7c')],'as':_0x533c('0x7d'),'attributes':['id',_0x533c('0x10')]},{'model':db[_0x533c('0x49')],'as':_0x533c('0x7e'),'attributes':['id',_0x533c('0x10'),'dialActive']}]})[_0x533c('0xe')](function(_0xa4844a){if(_0xa4844a){return _0xa4844a[_0x533c('0xd')]({'UserId':_0x352e07[_0x533c('0x50')]['id']},{'transaction':_0xb23f94});}});});}})[_0x533c('0xe')](handleEntityNotFound(_0x1c4bfa,null))[_0x533c('0xe')](respondWithResult(_0x1c4bfa,null))[_0x533c('0x3f')](handleError(_0x1c4bfa,null));};exports[_0x533c('0x7f')]=function(_0x13b6b7,_0x323481,_0xfd598d){var _0x13ae15=[];var _0x2bf7d6=_0x13b6b7[_0x533c('0x41')]['id'];var _0x61e62f=_0x13b6b7[_0x533c('0x50')]['id'];return db[_0x533c('0x59')]['describe']()[_0x533c('0xe')](function(_0x28592d){_0x13ae15=_['keys'](_0x28592d);return db['sequelize'][_0x533c('0x68')](function(_0x5159af){const _0x1f3646={'id':_0x2bf7d6};return db[_0x533c('0x14')][_0x533c('0x80')]({'attributes':['id',_0x533c('0x76'),_0x533c('0x77')],'where':_0x1f3646,'transaction':_0x5159af,'lock':_0x5159af['LOCK'][_0x533c('0x79')],'include':[{'model':db[_0x533c('0x59')],'as':_0x533c('0x81'),'attributes':_0x13ae15,'include':[{'model':db[_0x533c('0x7a')],'as':_0x533c('0x7b'),'attributes':['id',_0x533c('0x10')]}]},{'model':db[_0x533c('0x7c')],'as':_0x533c('0x7d'),'attributes':['id',_0x533c('0x10')]},{'model':db[_0x533c('0x49')],'as':_0x533c('0x7e'),'attributes':['id',_0x533c('0x10'),_0x533c('0x82')]}]})[_0x533c('0xe')](function(_0x9c8d2){if(_0x9c8d2){return _0x9c8d2[_0x533c('0xd')]({'UserId':_0x61e62f},{'transaction':_0x5159af});}});});})[_0x533c('0xe')](handleEntityNotFound(_0x323481,null))[_0x533c('0xe')](respondWithResult(_0x323481,null))['catch'](handleError(_0x323481,null));};exports[_0x533c('0x83')]=function(_0x15d09a,_0x247915){return _0x15d09a[_0x533c('0x50')]['getVoiceQueues']({'where':{'type':_0x533c('0x64'),'dialActive':!![],'dialMethod':_0x533c('0x65')},'attributes':['id'],'raw':!![]})['then'](function(_0x411f86){if(_0x411f86&&_0x411f86['length']){return db[_0x533c('0x14')]['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x533c('0x53')](_0x533c('0x69'))},'VoiceQueueId':{'$in':_[_0x533c('0x13')](_0x411f86,'id')},'$or':[{'UserId':null},{'UserId':_0x15d09a['user']['id']}]}});}return 0x0;})['then'](function(_0x5c03d8){if(!_[_0x533c('0x5c')](_0x5c03d8)&&_['isNumber'](_0x5c03d8)){return _0x247915[_0x533c('0x5')](0xc8)[_0x533c('0x6')]({'contacts':_0x5c03d8});}else{logger[_0x533c('0xf')](_0x533c('0x84'),'getOpenContacts',0x194,'entity\x20not\x20found');_0x247915[_0x533c('0x85')](0x194);}})['catch'](handleError(_0x247915,null));};exports[_0x533c('0x86')]=function(_0x15451a,_0x348389){var _0x4cfd36=shared[_0x533c('0x87')];var _0x567d7d=[];_[_0x533c('0x13')](_0x4cfd36,function(_0x2a917a){_0x567d7d['push']({'id':_0x2a917a[_0x533c('0x10')],'name':_0x2a917a[_0x533c('0x10')],'utcOffset':_0x2a917a[_0x533c('0x88')]});});return _0x348389[_0x533c('0x5')](0xc8)[_0x533c('0x6')]({'tz':_0x567d7d});};exports[_0x533c('0x89')]=function(_0x51444d,_0x1c9d48){var _0xaf42ce=shared[_0x533c('0x87')];var _0x591ade={};if(!_[_0x533c('0x5c')](_0xaf42ce[_0x51444d['body']['id']]))_0x591ade=_0xaf42ce[_0x51444d['body']['id']];return _0x1c9d48[_0x533c('0x5')](0xc8)[_0x533c('0x6')](_0x591ade);}; \ No newline at end of file +var _0xf9d5=['Company','Queue','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts','entity\x20not\x20found','getTimezones','timezones','push','getTimezone','lodash','../../components/parsers/qs','api','../../config/environment','../../mysqldb','status','undefined','limit','count','set','json','then','sendStatus','error','stack','name','map','rawAttributes','fieldName','type','key','model','query','intersection','concat','$gt','$gte','$lt','$lte','$eq','$not','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contains','$contained','$any','attributes','fields','length','hasOwnProperty','offset','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','CmHopper','findAll','catch','params','keys','includeAll','include','find','create','body','update','describe','destroy','VoiceQueueId','VoiceQueue','Campaign','CampaignId','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','campaign','membername','UserId','user','format','calleridnum','ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname','CmHopperFinal','CmHopperAdditionalPhone','end','getPreview','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','transaction','YYYY-MM-DD\x20HH:mm:ss','value','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','COALESCE(CmHopper.UserId,\x200)\x20ASC','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','phone','recallme','LOCK','UPDATE','Contact','CmCompany','CmList','List','dialActive','getPreviewRecall'];(function(_0x550736,_0x26a6e2){var _0x78f627=function(_0x4cb6cc){while(--_0x4cb6cc){_0x550736['push'](_0x550736['shift']());}};_0x78f627(++_0x26a6e2);}(_0xf9d5,0x122));var _0x5f9d=function(_0x3c8eb3,_0x71f0cf){_0x3c8eb3=_0x3c8eb3-0x0;var _0x4221cd=_0xf9d5[_0x3c8eb3];return _0x4221cd;};'use strict';var moment=require('moment');var _=require(_0x5f9d('0x0'));var qs=require(_0x5f9d('0x1'));var logger=require('../../config/logger')(_0x5f9d('0x2'));var shared=require(_0x5f9d('0x3'));var db=require(_0x5f9d('0x4'))['db'];function respondWithResult(_0x290ef2,_0x25fa8c){_0x25fa8c=_0x25fa8c||0xc8;return function(_0xdd68fd){if(_0xdd68fd){return _0x290ef2[_0x5f9d('0x5')](_0x25fa8c)['json'](_0xdd68fd);}};}function respondWithFilteredResult(_0x1fc74c,_0x59027b){return function(_0x24999e){if(_0x24999e){var _0x38fb6b=typeof _0x59027b['offset']===_0x5f9d('0x6')&&typeof _0x59027b[_0x5f9d('0x7')]===_0x5f9d('0x6');var _0x250f6c=_0x24999e[_0x5f9d('0x8')];var _0x9757ba=_0x38fb6b?0x0:_0x59027b['offset'];var _0x156129=_0x38fb6b?_0x24999e[_0x5f9d('0x8')]:_0x59027b['offset']+_0x59027b['limit'];var _0x26938c;if(_0x156129>=_0x250f6c){_0x156129=_0x250f6c;_0x26938c=0xc8;}else{_0x26938c=0xce;}_0x1fc74c[_0x5f9d('0x5')](_0x26938c);return _0x1fc74c[_0x5f9d('0x9')]('Content-Range',_0x9757ba+'-'+_0x156129+'/'+_0x250f6c)[_0x5f9d('0xa')](_0x24999e);}return null;};}function saveUpdates(_0x10f5b1,_0x257910){return function(_0x23a39f){if(_0x23a39f){return _0x23a39f['update'](_0x10f5b1)[_0x5f9d('0xb')](function(_0x3450a8){return _0x3450a8;});}return null;};}function handleEntityNotFound(_0x234902,_0x5aacdc){return function(_0x8e2381){if(!_0x8e2381){_0x234902[_0x5f9d('0xc')](0x194);}return _0x8e2381;};}function handleError(_0x57cb1a,_0x4fd1cb){_0x4fd1cb=_0x4fd1cb||0x1f4;return function(_0x2f0154){logger[_0x5f9d('0xd')](_0x2f0154[_0x5f9d('0xe')]);if(_0x2f0154[_0x5f9d('0xf')]){delete _0x2f0154[_0x5f9d('0xf')];}_0x57cb1a['status'](_0x4fd1cb)['send'](_0x2f0154);};}exports['index']=function(_0x3d8370,_0x4fb9a5){var _0x432f1a={},_0x48448e={},_0x3cb370={'count':0x0,'rows':[]};var _0x453285=_[_0x5f9d('0x10')](db['CmHopper'][_0x5f9d('0x11')],function(_0x16de94){return{'name':_0x16de94[_0x5f9d('0x12')],'type':_0x16de94[_0x5f9d('0x13')][_0x5f9d('0x14')]};});_0x48448e[_0x5f9d('0x15')]=_[_0x5f9d('0x10')](_0x453285,_0x5f9d('0xf'));_0x48448e[_0x5f9d('0x16')]=_['keys'](_0x3d8370['query']);_0x48448e['filters']=_[_0x5f9d('0x17')](_0x48448e['model'],_0x48448e[_0x5f9d('0x16')]);_0x48448e['filters']=_[_0x5f9d('0x18')](_0x48448e['filters'],['$and','$or',_0x5f9d('0x19'),_0x5f9d('0x1a'),_0x5f9d('0x1b'),_0x5f9d('0x1c'),'$ne',_0x5f9d('0x1d'),_0x5f9d('0x1e'),_0x5f9d('0x1f'),_0x5f9d('0x20'),_0x5f9d('0x21'),_0x5f9d('0x22'),_0x5f9d('0x23'),_0x5f9d('0x24'),_0x5f9d('0x25'),_0x5f9d('0x26'),'$like',_0x5f9d('0x27'),_0x5f9d('0x28'),_0x5f9d('0x29'),_0x5f9d('0x2a')]);_0x432f1a[_0x5f9d('0x2b')]=_[_0x5f9d('0x17')](_0x48448e[_0x5f9d('0x15')],qs[_0x5f9d('0x2c')](_0x3d8370[_0x5f9d('0x16')]['fields']));_0x432f1a['attributes']=_0x432f1a['attributes'][_0x5f9d('0x2d')]?_0x432f1a['attributes']:_0x48448e[_0x5f9d('0x15')];if(!_0x3d8370['query'][_0x5f9d('0x2e')]('nolimit')){_0x432f1a[_0x5f9d('0x7')]=qs[_0x5f9d('0x7')](_0x3d8370[_0x5f9d('0x16')][_0x5f9d('0x7')]);_0x432f1a[_0x5f9d('0x2f')]=qs['offset'](_0x3d8370[_0x5f9d('0x16')]['offset']);}_0x432f1a[_0x5f9d('0x30')]=qs['sort'](_0x3d8370[_0x5f9d('0x16')][_0x5f9d('0x31')]);_0x432f1a['where']=qs[_0x5f9d('0x32')](_[_0x5f9d('0x33')](_0x3d8370[_0x5f9d('0x16')],_0x48448e['filters']),_0x453285);if(_0x3d8370[_0x5f9d('0x16')][_0x5f9d('0x34')]){_0x432f1a[_0x5f9d('0x35')]=_[_0x5f9d('0x36')](_0x432f1a[_0x5f9d('0x35')],{'$or':_['map'](_0x453285,function(_0x3f9687){if(_0x3f9687[_0x5f9d('0x13')]!==_0x5f9d('0x37')){var _0x3db919={};_0x3db919[_0x3f9687[_0x5f9d('0xf')]]={'$like':'%'+_0x3d8370[_0x5f9d('0x16')]['filter']+'%'};return _0x3db919;}})});}_0x432f1a=_[_0x5f9d('0x36')]({},_0x432f1a,_0x3d8370[_0x5f9d('0x38')]);var _0x32ecc1={'where':_0x432f1a['where']};return db['CmHopper'][_0x5f9d('0x8')](_0x32ecc1)[_0x5f9d('0xb')](function(_0x16a667){_0x3cb370[_0x5f9d('0x8')]=_0x16a667;if(_0x3d8370[_0x5f9d('0x16')]['includeAll']){_0x432f1a['include']=[{'all':!![]}];}return db[_0x5f9d('0x39')][_0x5f9d('0x3a')](_0x432f1a);})['then'](function(_0x2e3d95){_0x3cb370['rows']=_0x2e3d95;return _0x3cb370;})[_0x5f9d('0xb')](respondWithFilteredResult(_0x4fb9a5,_0x432f1a))[_0x5f9d('0x3b')](handleError(_0x4fb9a5,null));};exports['show']=function(_0x6fb378,_0x451066){var _0x4d3288={'raw':!![],'where':{'id':_0x6fb378[_0x5f9d('0x3c')]['id']}},_0x4cbce2={};_0x4cbce2[_0x5f9d('0x15')]=_[_0x5f9d('0x3d')](db[_0x5f9d('0x39')][_0x5f9d('0x11')]);_0x4cbce2[_0x5f9d('0x16')]=_[_0x5f9d('0x3d')](_0x6fb378[_0x5f9d('0x16')]);_0x4cbce2[_0x5f9d('0x32')]=_[_0x5f9d('0x17')](_0x4cbce2[_0x5f9d('0x15')],_0x4cbce2[_0x5f9d('0x16')]);_0x4d3288[_0x5f9d('0x2b')]=_[_0x5f9d('0x17')](_0x4cbce2[_0x5f9d('0x15')],qs[_0x5f9d('0x2c')](_0x6fb378[_0x5f9d('0x16')][_0x5f9d('0x2c')]));_0x4d3288[_0x5f9d('0x2b')]=_0x4d3288[_0x5f9d('0x2b')][_0x5f9d('0x2d')]?_0x4d3288[_0x5f9d('0x2b')]:_0x4cbce2[_0x5f9d('0x15')];if(_0x6fb378[_0x5f9d('0x16')][_0x5f9d('0x3e')]){_0x4d3288[_0x5f9d('0x3f')]=[{'all':!![]}];}_0x4d3288=_[_0x5f9d('0x36')]({},_0x4d3288,_0x6fb378[_0x5f9d('0x38')]);return db[_0x5f9d('0x39')][_0x5f9d('0x40')](_0x4d3288)['then'](handleEntityNotFound(_0x451066,null))[_0x5f9d('0xb')](respondWithResult(_0x451066,null))['catch'](handleError(_0x451066,null));};exports[_0x5f9d('0x41')]=function(_0x2af417,_0x1ac617){return db[_0x5f9d('0x39')][_0x5f9d('0x41')](_0x2af417[_0x5f9d('0x42')],{})[_0x5f9d('0xb')](respondWithResult(_0x1ac617,0xc9))['catch'](handleError(_0x1ac617,null));};exports[_0x5f9d('0x43')]=function(_0x565bc6,_0x26123b){if(_0x565bc6['body']['id']){delete _0x565bc6[_0x5f9d('0x42')]['id'];}return db['CmHopper'][_0x5f9d('0x40')]({'where':{'id':_0x565bc6[_0x5f9d('0x3c')]['id']}})[_0x5f9d('0xb')](handleEntityNotFound(_0x26123b,null))['then'](saveUpdates(_0x565bc6['body'],null))[_0x5f9d('0xb')](respondWithResult(_0x26123b,null))[_0x5f9d('0x3b')](handleError(_0x26123b,null));};exports['describe']=function(_0x2a43a3,_0x48d982){return db[_0x5f9d('0x39')][_0x5f9d('0x44')]()[_0x5f9d('0xb')](respondWithResult(_0x48d982,null))[_0x5f9d('0x3b')](handleError(_0x48d982,null));};exports[_0x5f9d('0x45')]=function(_0x16a9fa,_0x3aa63c){var _0xe95792;var _0x2193a4=_0x16a9fa[_0x5f9d('0x3c')]['id'];return db['CmHopper'][_0x5f9d('0x40')]({'where':{'id':_0x16a9fa[_0x5f9d('0x3c')]['id']}})['then'](handleEntityNotFound(_0x3aa63c,null))[_0x5f9d('0xb')](function(_0x7ab341){if(_0x7ab341){return _0x7ab341[_0x5f9d('0x45')]()[_0x5f9d('0xb')](function(_0xc9a152){return _0xc9a152;});}})[_0x5f9d('0xb')](function(_0x44b754){_0xe95792=_0x44b754;if(_0x44b754){if(_0x44b754[_0x5f9d('0x46')]||_0x44b754['CampaignId']){return db[_0x44b754['VoiceQueueId']?_0x5f9d('0x47'):_0x5f9d('0x48')][_0x5f9d('0x40')]({'where':{'id':_0x44b754[_0x5f9d('0x46')]?_0x44b754[_0x5f9d('0x46')]:_0x44b754[_0x5f9d('0x49')]},'attributes':['id',_0x5f9d('0xf')],'raw':!![]});}}})[_0x5f9d('0xb')](function(_0x36ee8e){var _0x53da50={};if(_0x36ee8e){_['merge'](_0x53da50,_[_0x5f9d('0x4a')](_0xe95792[_0x5f9d('0x4b')],[_0x5f9d('0x4c'),_0x5f9d('0x4d'),'id']));_0x53da50[_0x5f9d('0x4e')]=0x15;_0x53da50[_0x5f9d('0x4f')]=_0x5f9d('0x50');_0x53da50[_0x5f9d('0x51')]=_0x36ee8e[_0x5f9d('0xf')];_0x53da50[_0x5f9d('0x52')]=_0x16a9fa['user']['name'];_0x53da50[_0x5f9d('0x53')]=_0x16a9fa[_0x5f9d('0x54')]['id'];_0x53da50[_0x5f9d('0x50')]=!![];_0x53da50['deletedat']=moment()[_0x5f9d('0x55')]('YYYY-MM-DD\x20HH:mm:ss');_0x53da50[_0x5f9d('0x56')]=_0xe95792['phone'];_0x53da50['campaigntype']=_0xe95792[_0x5f9d('0x46')]?'queue':_0x5f9d('0x57');return db[_0x5f9d('0x58')][_0x5f9d('0x40')]({'where':{'id':_0x53da50[_0x5f9d('0x59')]},'attributes':[_0x5f9d('0x5a'),_0x5f9d('0x5b')]})['then'](function(_0x36af2a){if(!_['isNil'](_0x3aa63c)&&!_[_0x5f9d('0x5c')](_0x36af2a['firstName'])){_0x53da50['calleridname']=_0x36af2a[_0x5f9d('0x5a')];if(!_[_0x5f9d('0x5c')](_0x36af2a[_0x5f9d('0x5b')])){_0x53da50[_0x5f9d('0x5d')]+='\x20'+_0x36af2a['lastName'];}}})['finally'](function(){return db[_0x5f9d('0x5e')][_0x5f9d('0x41')](_0x53da50);});}})[_0x5f9d('0xb')](function(_0x62bdf4){return db[_0x5f9d('0x5f')]['destroy']({'where':{'CmHopperId':_0x2193a4}});})[_0x5f9d('0xb')](function(){return _0x3aa63c['status'](0xcc)[_0x5f9d('0x60')]();})[_0x5f9d('0x3b')](handleError(_0x3aa63c,null));};exports[_0x5f9d('0x61')]=function(_0x2d349f,_0x530158){var _0x3a8c4d=[];return db[_0x5f9d('0x58')][_0x5f9d('0x44')]()[_0x5f9d('0xb')](function(_0x5f1c59){_0x3a8c4d=_[_0x5f9d('0x3d')](_0x5f1c59);return _0x2d349f[_0x5f9d('0x54')][_0x5f9d('0x62')]({'where':{'type':_0x5f9d('0x63'),'dialActive':!![],'dialMethod':_0x5f9d('0x64')},'attributes':['id',_0x5f9d('0x65'),_0x5f9d('0x66')],'raw':!![]});})['then'](function(_0x1da2b2){if(_0x1da2b2&&_0x1da2b2[_0x5f9d('0x2d')]){return db[_0x5f9d('0x67')][_0x5f9d('0x68')](function(_0x36aab5){var _0x149666={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x5f9d('0x55')](_0x5f9d('0x69'))},'VoiceQueueId':{'$in':_[_0x5f9d('0x10')](_0x1da2b2,'id')},'$or':[{'UserId':null},{'UserId':_0x2d349f[_0x5f9d('0x54')]['id']}]};var _0x1632ac={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x1da2b2)[_0x5f9d('0x34')](['dialPreviewAutoRecallMe',0x0])[_0x5f9d('0x10')]('id')[_0x5f9d('0x6a')]()},'$or':[{'UserId':null},{'UserId':_0x2d349f[_0x5f9d('0x54')]['id']}]};var _0x1a8e24={'$or':[_0x149666,_0x1632ac]};var _0x147e84=[];if(_0x2d349f['body'][_0x5f9d('0x6b')]&&_0x2d349f[_0x5f9d('0x42')][_0x5f9d('0x6b')]===_0x5f9d('0x6c')){if(!_[_0x5f9d('0x6d')](_0x2d349f['body'][_0x5f9d('0x6e')])){_0x1a8e24['id']={'$in':_0x2d349f[_0x5f9d('0x42')][_0x5f9d('0x6e')]};}_0x147e84=[[_0x5f9d('0x6f'),_0x5f9d('0x70')],[_0x5f9d('0x71'),_0x1da2b2[0x0][_0x5f9d('0x65')]===_0x5f9d('0x70')?'DESC':_0x5f9d('0x70')],db['sequelize']['literal'](_0x5f9d('0x72')),['id',_0x5f9d('0x73')]];}else{if(!_[_0x5f9d('0x6d')](_0x2d349f[_0x5f9d('0x42')][_0x5f9d('0x6e')])){_0x1a8e24['id']={'$notIn':_0x2d349f['body'][_0x5f9d('0x6e')]};}_0x147e84=[[_0x5f9d('0x6f'),_0x5f9d('0x73')],[_0x5f9d('0x71'),_0x1da2b2[0x0][_0x5f9d('0x65')]],db[_0x5f9d('0x67')][_0x5f9d('0x74')](_0x5f9d('0x75')),['id',_0x5f9d('0x70')]];}return db[_0x5f9d('0x39')][_0x5f9d('0x76')]({'attributes':['id',_0x5f9d('0x77'),_0x5f9d('0x78'),_0x5f9d('0x79')],'where':_0x1a8e24,'order':_0x147e84,'transaction':_0x36aab5,'lock':_0x36aab5[_0x5f9d('0x7a')][_0x5f9d('0x7b')],'include':[{'model':db['CmContact'],'as':_0x5f9d('0x7c'),'attributes':_0x3a8c4d,'include':[{'model':db[_0x5f9d('0x7d')],'as':'Company','attributes':['id',_0x5f9d('0xf')]}]},{'model':db[_0x5f9d('0x7e')],'as':_0x5f9d('0x7f'),'attributes':['id',_0x5f9d('0xf')]},{'model':db[_0x5f9d('0x47')],'as':'Queue','attributes':['id',_0x5f9d('0xf'),_0x5f9d('0x80')]}]})[_0x5f9d('0xb')](function(_0x45c309){if(_0x45c309){return _0x45c309['update']({'UserId':_0x2d349f[_0x5f9d('0x54')]['id']},{'transaction':_0x36aab5});}});});}})[_0x5f9d('0xb')](handleEntityNotFound(_0x530158,null))[_0x5f9d('0xb')](respondWithResult(_0x530158,null))[_0x5f9d('0x3b')](handleError(_0x530158,null));};exports[_0x5f9d('0x81')]=function(_0x989e41,_0x438a78,_0x1553e5){var _0x192a77=[];var _0x13d8c3=_0x989e41[_0x5f9d('0x3c')]['id'];var _0x1e5d36=_0x989e41[_0x5f9d('0x54')]['id'];return db[_0x5f9d('0x58')]['describe']()['then'](function(_0x44896e){_0x192a77=_[_0x5f9d('0x3d')](_0x44896e);return db[_0x5f9d('0x67')][_0x5f9d('0x68')](function(_0x2b65aa){const _0x336723={'id':_0x13d8c3};return db[_0x5f9d('0x39')]['findOne']({'attributes':['id','scheduledat',_0x5f9d('0x79')],'where':_0x336723,'transaction':_0x2b65aa,'lock':_0x2b65aa[_0x5f9d('0x7a')][_0x5f9d('0x7b')],'include':[{'model':db[_0x5f9d('0x58')],'as':_0x5f9d('0x7c'),'attributes':_0x192a77,'include':[{'model':db[_0x5f9d('0x7d')],'as':_0x5f9d('0x82'),'attributes':['id',_0x5f9d('0xf')]}]},{'model':db['CmList'],'as':_0x5f9d('0x7f'),'attributes':['id',_0x5f9d('0xf')]},{'model':db[_0x5f9d('0x47')],'as':_0x5f9d('0x83'),'attributes':['id','name',_0x5f9d('0x80')]}]})[_0x5f9d('0xb')](function(_0x595029){if(_0x595029){return _0x595029[_0x5f9d('0x43')]({'UserId':_0x1e5d36},{'transaction':_0x2b65aa});}});});})[_0x5f9d('0xb')](handleEntityNotFound(_0x438a78,null))[_0x5f9d('0xb')](respondWithResult(_0x438a78,null))[_0x5f9d('0x3b')](handleError(_0x438a78,null));};exports['getOpenContacts']=function(_0x44424a,_0x1e0392){return _0x44424a['user'][_0x5f9d('0x62')]({'where':{'type':_0x5f9d('0x63'),'dialActive':!![],'dialMethod':_0x5f9d('0x64')},'attributes':['id'],'raw':!![]})[_0x5f9d('0xb')](function(_0x52e7ea){if(_0x52e7ea&&_0x52e7ea[_0x5f9d('0x2d')]){return db[_0x5f9d('0x39')]['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x5f9d('0x55')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_['map'](_0x52e7ea,'id')},'$or':[{'UserId':null},{'UserId':_0x44424a['user']['id']}]}});}return 0x0;})['then'](function(_0x2db0d7){if(!_['isNil'](_0x2db0d7)&&_[_0x5f9d('0x84')](_0x2db0d7)){return _0x1e0392[_0x5f9d('0x5')](0xc8)['json']({'contacts':_0x2db0d7});}else{logger[_0x5f9d('0xd')](_0x5f9d('0x85'),_0x5f9d('0x86'),0x194,_0x5f9d('0x87'));_0x1e0392['sendStatus'](0x194);}})[_0x5f9d('0x3b')](handleError(_0x1e0392,null));};exports[_0x5f9d('0x88')]=function(_0x45ee37,_0x382969){var _0x541c53=shared[_0x5f9d('0x89')];var _0x4f4b1e=[];_[_0x5f9d('0x10')](_0x541c53,function(_0x4b5ae9){_0x4f4b1e[_0x5f9d('0x8a')]({'id':_0x4b5ae9['name'],'name':_0x4b5ae9['name'],'utcOffset':_0x4b5ae9['utcOffset']});});return _0x382969[_0x5f9d('0x5')](0xc8)[_0x5f9d('0xa')]({'tz':_0x4f4b1e});};exports[_0x5f9d('0x8b')]=function(_0x575ad1,_0x1ecd66){var _0xe2ec0f=shared['timezones'];var _0x52c5fa={};if(!_['isNil'](_0xe2ec0f[_0x575ad1[_0x5f9d('0x42')]['id']]))_0x52c5fa=_0xe2ec0f[_0x575ad1[_0x5f9d('0x42')]['id']];return _0x1ecd66['status'](0xc8)[_0x5f9d('0xa')](_0x52c5fa);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 14fbae9..5fcecdf 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 _0x2bd8=['CmHopper','cm_hopper','scheduledat','phone','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./cmHopper.attributes','exports','define'];(function(_0x238154,_0x83c5c0){var _0x423e04=function(_0xdac7d6){while(--_0xdac7d6){_0x238154['push'](_0x238154['shift']());}};_0x423e04(++_0x83c5c0);}(_0x2bd8,0x130));var _0x82bd=function(_0x1b09f0,_0x4d3e68){_0x1b09f0=_0x1b09f0-0x0;var _0x9b35=_0x2bd8[_0x1b09f0];return _0x9b35;};'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':[{'name':_0x82bd('0xd'),'fields':['scheduledat']},{'name':_0x82bd('0xe'),'fields':['phone']},{'name':'priority','fields':['priority']}],'timestamps':!![]});}; \ No newline at end of file +var _0xacf4=['define','CmHopper','cm_hopper','scheduledat','phone','priority','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./cmHopper.attributes','exports'];(function(_0x495f2c,_0x439b02){var _0x16959e=function(_0x5521a8){while(--_0x5521a8){_0x495f2c['push'](_0x495f2c['shift']());}};_0x16959e(++_0x439b02);}(_0xacf4,0xe7));var _0x4acf=function(_0x2df41c,_0x415709){_0x2df41c=_0x2df41c-0x0;var _0x18796e=_0xacf4[_0x2df41c];return _0x18796e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4acf('0x0'))(_0x4acf('0x1'));var moment=require(_0x4acf('0x2'));var BPromise=require(_0x4acf('0x3'));var rp=require(_0x4acf('0x4'));var fs=require('fs');var path=require(_0x4acf('0x5'));var rimraf=require(_0x4acf('0x6'));var config=require('../../config/environment');var attributes=require(_0x4acf('0x7'));module[_0x4acf('0x8')]=function(_0x4e0c43,_0x24bf24){return _0x4e0c43[_0x4acf('0x9')](_0x4acf('0xa'),attributes,{'tableName':_0x4acf('0xb'),'paranoid':![],'indexes':[{'name':_0x4acf('0xc'),'fields':['scheduledat']},{'name':'phone','fields':[_0x4acf('0xd')]},{'name':'priority','fields':[_0x4acf('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 998f226..725141f 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 _0x2d08=['options','where','attributes','limit','include','map','model','then','info','debug','stringify','error','CmHopper','raw','ShowCmHopper','catch','CreateCmHopper','create','body','UpdateCmHopper','update','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','message','DestroyCmHopper','destroy','GetContactDialer','CmContact','sequelize','transaction','findAll','order','LOCK','keys','User','voicePause','length','push','all','dataValues','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','MoveContactManagedDialer','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','contactsRescheduled','GetContactRecallMe','describe','UserId','UPDATE','GetCmHopperPreview','Contact','phone','dialTimezone','getContactByPhone','ResetActiveCalls','voiceQueueIds','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','NOW()','Agent','name','CmList','List','CmHopperHandlePreviewRecallNotifications','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','GetCmHopper'];(function(_0x2a0e7c,_0x38a160){var _0x29aa55=function(_0x116abb){while(--_0x116abb){_0x2a0e7c['push'](_0x2a0e7c['shift']());}};_0x29aa55(++_0x38a160);}(_0x2d08,0x129));var _0x82d0=function(_0x4555c2,_0x138d83){_0x4555c2=_0x4555c2-0x0;var _0x492d1d=_0x2d08[_0x4555c2];return _0x492d1d;};'use strict';var _=require(_0x82d0('0x0'));var util=require(_0x82d0('0x1'));var moment=require(_0x82d0('0x2'));var BPromise=require(_0x82d0('0x3'));var db=require(_0x82d0('0x4'))['db'];var logger=require(_0x82d0('0x5'))('rpc');exports[_0x82d0('0x6')]=function(_0x276e26){var _0x50751a=this;return new Promise(function(_0x450d90,_0x4e1c30){return db['CmHopper']['findAll']({'raw':_0x276e26[_0x82d0('0x7')]?_0x276e26[_0x82d0('0x7')]['raw']===undefined?!![]:![]:!![],'where':_0x276e26['options']?_0x276e26[_0x82d0('0x7')][_0x82d0('0x8')]||null:null,'attributes':_0x276e26['options']?_0x276e26[_0x82d0('0x7')][_0x82d0('0x9')]||null:null,'limit':_0x276e26[_0x82d0('0x7')]?_0x276e26[_0x82d0('0x7')][_0x82d0('0xa')]||null:null,'include':_0x276e26[_0x82d0('0x7')]?_0x276e26[_0x82d0('0x7')][_0x82d0('0xb')]?_[_0x82d0('0xc')](_0x276e26['options']['include'],function(_0x251a49){return{'model':db[_0x251a49['model']],'as':_0x251a49['as'],'attributes':_0x251a49[_0x82d0('0x9')],'include':_0x251a49['include']?_['map'](_0x251a49[_0x82d0('0xb')],function(_0x44d9b5){return{'model':db[_0x44d9b5[_0x82d0('0xd')]],'as':_0x44d9b5['as'],'attributes':_0x44d9b5[_0x82d0('0x9')],'include':_0x44d9b5['include']?_[_0x82d0('0xc')](_0x44d9b5[_0x82d0('0xb')],function(_0x567bce){return{'model':db[_0x567bce[_0x82d0('0xd')]],'as':_0x567bce['as'],'attributes':_0x567bce[_0x82d0('0x9')]};}):[]};}):[]};}):[]:[]})[_0x82d0('0xe')](function(_0x50c1bf){logger[_0x82d0('0xf')]('GetCmHopper',_0x276e26);logger[_0x82d0('0x10')]('GetCmHopper',_0x276e26,JSON[_0x82d0('0x11')](_0x50c1bf));_0x450d90(_0x50c1bf);})['catch'](function(_0x5b71e5){logger[_0x82d0('0x12')](_0x82d0('0x6'),_0x5b71e5['message'],_0x276e26);_0x4e1c30(_0x50751a[_0x82d0('0x12')](0x1f4,_0x5b71e5['message']));});});};exports['ShowCmHopper']=function(_0x83ceb4){var _0x2feee9=this;return new Promise(function(_0x182531,_0xd8c7c1){return db[_0x82d0('0x13')]['find']({'raw':_0x83ceb4[_0x82d0('0x7')]?_0x83ceb4[_0x82d0('0x7')][_0x82d0('0x14')]===undefined?!![]:![]:!![],'where':_0x83ceb4['options']?_0x83ceb4[_0x82d0('0x7')][_0x82d0('0x8')]||null:null,'attributes':_0x83ceb4[_0x82d0('0x7')]?_0x83ceb4[_0x82d0('0x7')][_0x82d0('0x9')]||null:null,'include':_0x83ceb4[_0x82d0('0x7')]?_0x83ceb4['options']['include']?_['map'](_0x83ceb4['options'][_0x82d0('0xb')],function(_0x2d70a3){return{'model':db[_0x2d70a3[_0x82d0('0xd')]],'as':_0x2d70a3['as'],'attributes':_0x2d70a3[_0x82d0('0x9')],'include':_0x2d70a3[_0x82d0('0xb')]?_[_0x82d0('0xc')](_0x2d70a3[_0x82d0('0xb')],function(_0x3ee141){return{'model':db[_0x3ee141[_0x82d0('0xd')]],'as':_0x3ee141['as'],'attributes':_0x3ee141[_0x82d0('0x9')],'include':_0x3ee141['include']?_['map'](_0x3ee141[_0x82d0('0xb')],function(_0x22008d){return{'model':db[_0x22008d['model']],'as':_0x22008d['as'],'attributes':_0x22008d[_0x82d0('0x9')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x269dea){logger['info'](_0x82d0('0x15'),_0x83ceb4);logger[_0x82d0('0x10')](_0x82d0('0x15'),_0x83ceb4,JSON[_0x82d0('0x11')](_0x269dea));_0x182531(_0x269dea);})[_0x82d0('0x16')](function(_0x259f23){logger['error'](_0x82d0('0x15'),_0x259f23['message'],_0x83ceb4);_0xd8c7c1(_0x2feee9[_0x82d0('0x12')](0x1f4,_0x259f23['message']));});});};exports[_0x82d0('0x17')]=function(_0x5c206e){var _0x1465dc=this;return new Promise(function(_0x33aa8a,_0xa23ac1){return db[_0x82d0('0x13')][_0x82d0('0x18')](_0x5c206e[_0x82d0('0x19')],{'raw':_0x5c206e[_0x82d0('0x7')]?_0x5c206e[_0x82d0('0x7')]['raw']===undefined?!![]:![]:!![]})[_0x82d0('0xe')](function(_0x49ba26){logger[_0x82d0('0xf')](_0x82d0('0x17'),_0x5c206e);logger[_0x82d0('0x10')](_0x82d0('0x17'),_0x5c206e,JSON['stringify'](_0x49ba26));_0x33aa8a(_0x49ba26);})[_0x82d0('0x16')](function(_0x166c5e){logger['error'](_0x82d0('0x17'),_0x166c5e['message'],_0x5c206e);_0xa23ac1(_0x1465dc[_0x82d0('0x12')](0x1f4,_0x166c5e['message']));});});};exports[_0x82d0('0x1a')]=function(_0x588438){var _0x58e660=this;return new Promise(function(_0xf98da3,_0x4574ed){return db[_0x82d0('0x13')][_0x82d0('0x1b')](_0x588438[_0x82d0('0x19')],{'raw':_0x588438['options']?_0x588438[_0x82d0('0x7')][_0x82d0('0x14')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x588438[_0x82d0('0x7')]?_0x588438[_0x82d0('0x7')][_0x82d0('0x8')]||null:null,'attributes':_0x588438[_0x82d0('0x7')]?_0x588438[_0x82d0('0x7')][_0x82d0('0x9')]||null:null,'limit':_0x588438[_0x82d0('0x7')]?_0x588438[_0x82d0('0x7')][_0x82d0('0xa')]||null:null})[_0x82d0('0xe')](function(_0x477ab3){logger[_0x82d0('0xf')](_0x82d0('0x1a'),_0x588438);logger['info'](_0x82d0('0x1c'),JSON['stringify'](_0x588438['options']['where']),_0x588438[_0x82d0('0x19')][_0x82d0('0x1d')]);logger[_0x82d0('0x10')]('UpdateCmHopper',_0x588438,JSON[_0x82d0('0x11')](_0x477ab3));_0xf98da3(_0x477ab3);})[_0x82d0('0x16')](function(_0x133022){logger['error'](_0x82d0('0x1a'),_0x133022[_0x82d0('0x1e')],_0x588438);_0x4574ed(_0x58e660[_0x82d0('0x12')](0x1f4,_0x133022[_0x82d0('0x1e')]));});});};exports[_0x82d0('0x1f')]=function(_0x4faa71){var _0x1a2fc7=this;return new Promise(function(_0x489e58,_0x22e3da){return db['CmHopper'][_0x82d0('0x20')]({'where':_0x4faa71[_0x82d0('0x7')]?_0x4faa71['options']['where']||null:null})[_0x82d0('0xe')](function(_0x2ca5e3){logger[_0x82d0('0xf')](_0x82d0('0x1f'),_0x4faa71);logger[_0x82d0('0x10')]('DestroyCmHopper',_0x4faa71,JSON[_0x82d0('0x11')](_0x2ca5e3));_0x489e58(_0x2ca5e3);})[_0x82d0('0x16')](function(_0x407311){logger[_0x82d0('0x12')](_0x82d0('0x1f'),_0x407311['message'],_0x4faa71);_0x22e3da(_0x1a2fc7[_0x82d0('0x12')](0x1f4,_0x407311[_0x82d0('0x1e')]));});});};exports[_0x82d0('0x21')]=function(_0x5a4215){var _0x2173ef=this;return new Promise(function(_0x3707f5,_0x24ba01){return db[_0x82d0('0x22')]['describe']()['then'](function(_0x496c06){return db[_0x82d0('0x23')][_0x82d0('0x24')](function(_0x3e4265){return db[_0x82d0('0x13')][_0x82d0('0x25')]({'where':_0x5a4215[_0x82d0('0x7')]?_0x5a4215['options']['where']||null:null,'attributes':_0x5a4215[_0x82d0('0x7')]?_0x5a4215['options']['attributes']||null:null,'limit':_0x5a4215['options']?_0x5a4215[_0x82d0('0x7')][_0x82d0('0xa')]||null:null,'order':_0x5a4215['options']?_0x5a4215['options'][_0x82d0('0x26')]||null:null,'transaction':_0x3e4265,'lock':_0x3e4265[_0x82d0('0x27')]['UPDATE'],'include':[{'model':db[_0x82d0('0x22')],'as':'Contact','attributes':_[_0x82d0('0x28')](_0x496c06)},{'model':db[_0x82d0('0x29')],'as':'Agent','attributes':['id','name',_0x82d0('0x2a')]}]})['then'](function(_0x29197e){var _0x565dc2=[];var _0x3e2784=[];for(var _0x3de5c8=0x0;_0x3de5c8<_0x29197e[_0x82d0('0x2b')];_0x3de5c8+=0x1){var _0x4a0ed3=_0x29197e[_0x3de5c8]['UserId'];if(_0x4a0ed3===null){_0x565dc2[_0x82d0('0x2c')](_0x29197e[_0x3de5c8][_0x82d0('0x1b')](_0x5a4215[_0x82d0('0x19')],{'transaction':_0x3e4265}));}else if(!_0x3e2784['includes'](_0x4a0ed3)){_0x3e2784['push'](_0x4a0ed3);_0x565dc2[_0x82d0('0x2c')](_0x29197e[_0x3de5c8]['update'](_0x5a4215['body'],{'transaction':_0x3e4265}));}}return BPromise[_0x82d0('0x2d')](_0x565dc2);});})['then'](function(_0x4747b7){logger[_0x82d0('0xf')](_0x82d0('0x21'),_0x5a4215);if(_0x4747b7[_0x82d0('0x2b')]>0x0){logger[_0x82d0('0xf')]('GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]',_0x4747b7[0x0]['dataValues']['id'],_0x4747b7[0x0][_0x82d0('0x2e')]['ContactId'],_0x4747b7[0x0]['dataValues']['active']);}logger[_0x82d0('0x10')]('GetContactDialer',_0x5a4215,JSON['stringify'](_0x4747b7));_0x3707f5(_0x4747b7);})[_0x82d0('0x16')](function(_0x983b1c){logger[_0x82d0('0x12')](_0x82d0('0x21'),_0x983b1c['message'],_0x5a4215);_0x24ba01(_0x2173ef[_0x82d0('0x12')](0x1f4,_0x983b1c[_0x82d0('0x1e')]));});});});};exports['MoveContactManagedDialer']=function(_0x4c0c29){var _0x106bbb=this;return new Promise(function(_0x52147b,_0xe6811a){return db['sequelize']['transaction'](function(_0x46aad9){return db[_0x82d0('0x2f')][_0x82d0('0x18')](_0x4c0c29[_0x82d0('0x19')],{'raw':_0x4c0c29['options']?_0x4c0c29['options']['raw']===undefined?!![]:![]:!![],'transaction':_0x46aad9})[_0x82d0('0xe')](function(){logger[_0x82d0('0xf')](_0x82d0('0x30'),JSON['stringify'](_0x4c0c29[_0x82d0('0x7')][_0x82d0('0x8')]),_0x4c0c29[_0x82d0('0x7')][_0x82d0('0x8')][_0x82d0('0x1d')]);return db[_0x82d0('0x13')][_0x82d0('0x20')]({'where':_0x4c0c29[_0x82d0('0x7')]?_0x4c0c29[_0x82d0('0x7')][_0x82d0('0x8')]||null:null,'transaction':_0x46aad9});});})[_0x82d0('0xe')](function(_0x43b9e3){logger['info']('MoveContactManagedDialer',_0x4c0c29);logger[_0x82d0('0x10')]('MoveContactManagedDialer',_0x4c0c29,JSON[_0x82d0('0x11')](_0x43b9e3));_0x52147b(_0x43b9e3);})[_0x82d0('0x16')](function(_0xf5dbf6){logger[_0x82d0('0x12')](_0x82d0('0x31'),_0xf5dbf6['message'],_0x4c0c29);_0xe6811a(_0x106bbb[_0x82d0('0x12')](0x1f4,_0xf5dbf6['message']));});});};exports[_0x82d0('0x32')]=function(_0x2a2ac6){var _0x10901c=this;return new Promise(function(_0x44e777,_0xc33de0){return db[_0x82d0('0x13')][_0x82d0('0x25')]({'raw':_0x2a2ac6[_0x82d0('0x7')]?_0x2a2ac6['options']['raw']===undefined?!![]:![]:!![],'where':_0x2a2ac6[_0x82d0('0x7')]?_0x2a2ac6[_0x82d0('0x7')][_0x82d0('0x8')]||null:null,'attributes':[[db[_0x82d0('0x23')]['fn'](_0x82d0('0x33'),db[_0x82d0('0x23')]['fn']('IF',db[_0x82d0('0x23')][_0x82d0('0x34')](_0x82d0('0x35')+util[_0x82d0('0x36')](_0x82d0('0x37'),moment()[_0x82d0('0x36')]('YYYY-MM-DD\x20HH:mm:ss'))+'\x20,\x201,\x20null'))),_0x82d0('0x38')]]})[_0x82d0('0xe')](function(_0x135757){logger[_0x82d0('0xf')](_0x82d0('0x32'),_0x2a2ac6);logger[_0x82d0('0x10')](_0x82d0('0x32'),_0x2a2ac6,JSON[_0x82d0('0x11')](_0x135757));_0x44e777(_0x135757);})[_0x82d0('0x16')](function(_0x5821f4){logger[_0x82d0('0x12')](_0x82d0('0x32'),_0x5821f4[_0x82d0('0x1e')],_0x2a2ac6);_0xc33de0(_0x10901c[_0x82d0('0x12')](0x1f4,_0x5821f4[_0x82d0('0x1e')]));});});};exports[_0x82d0('0x39')]=function(_0x1cfe0a){var _0x51079e=this;return new Promise(function(_0x348dec,_0x483d7f){return db['CmContact'][_0x82d0('0x3a')]()[_0x82d0('0xe')](function(){return db[_0x82d0('0x23')][_0x82d0('0x24')](function(_0x54becb){return db[_0x82d0('0x13')][_0x82d0('0x25')]({'where':_0x1cfe0a[_0x82d0('0x7')]?_0x1cfe0a[_0x82d0('0x7')][_0x82d0('0x8')]||null:null,'attributes':_0x1cfe0a['options']?_0x1cfe0a[_0x82d0('0x7')][_0x82d0('0x9')]||null:null,'limit':0x1,'order':_0x1cfe0a[_0x82d0('0x7')]?_0x1cfe0a['options'][_0x82d0('0x26')]||null:null,'group':db['CmHopper'][_0x82d0('0x3b')],'transaction':_0x54becb,'lock':_0x54becb[_0x82d0('0x27')][_0x82d0('0x3c')],'include':_0x1cfe0a[_0x82d0('0x7')]?_0x1cfe0a[_0x82d0('0x7')][_0x82d0('0xb')]?_['map'](_0x1cfe0a['options'][_0x82d0('0xb')],function(_0x44c6a8){return{'model':db[_0x44c6a8['model']],'as':_0x44c6a8['as'],'attributes':_0x44c6a8[_0x82d0('0x9')],'include':_0x44c6a8[_0x82d0('0xb')]?_[_0x82d0('0xc')](_0x44c6a8[_0x82d0('0xb')],function(_0x487892){return{'model':db[_0x487892[_0x82d0('0xd')]],'as':_0x487892['as'],'attributes':_0x487892[_0x82d0('0x9')],'include':_0x487892[_0x82d0('0xb')]?_['map'](_0x487892['include'],function(_0x48a735){return{'model':db[_0x48a735[_0x82d0('0xd')]],'as':_0x48a735['as'],'attributes':_0x48a735['attributes']};}):[]};}):[]};}):[]:[]})[_0x82d0('0xe')](function(_0x4d855d){var _0x511125=[];for(var _0x5d176a=0x0;_0x5d176a<_0x4d855d['length'];_0x5d176a+=0x1){_0x511125[_0x82d0('0x2c')](_0x4d855d[_0x5d176a][_0x82d0('0x1b')](_0x1cfe0a['body'],{'transaction':_0x54becb}));}return BPromise[_0x82d0('0x2d')](_0x511125);});})['then'](function(_0x350e9c){logger[_0x82d0('0xf')](_0x82d0('0x39'),_0x1cfe0a);logger['debug']('GetContactRecallMe',_0x1cfe0a,JSON[_0x82d0('0x11')](_0x350e9c));_0x348dec(_0x350e9c);})[_0x82d0('0x16')](function(_0x3dc5fb){logger[_0x82d0('0x12')]('GetContactRecallMe',_0x3dc5fb[_0x82d0('0x1e')],_0x1cfe0a);_0x483d7f(_0x51079e[_0x82d0('0x12')](0x1f4,_0x3dc5fb[_0x82d0('0x1e')]));});});});};exports[_0x82d0('0x3d')]=function(_0x25031c){var _0x5919b1=this;return new Promise(function(_0x37b86d,_0xd74f0e){db[_0x82d0('0x22')][_0x82d0('0x3a')]()[_0x82d0('0xe')](function(_0x308c40){return db[_0x82d0('0x13')][_0x82d0('0x25')]({'raw':_0x25031c[_0x82d0('0x7')]?_0x25031c[_0x82d0('0x7')]['raw']===undefined?!![]:![]:!![],'where':_0x25031c[_0x82d0('0x7')]?_0x25031c[_0x82d0('0x7')]['where']||null:null,'attributes':_0x25031c[_0x82d0('0x7')]?_0x25031c[_0x82d0('0x7')][_0x82d0('0x9')]||null:null,'limit':_0x25031c['options']?_0x25031c['options'][_0x82d0('0xa')]||null:null,'include':_0x25031c['options']?_0x25031c[_0x82d0('0x7')]['include']?_[_0x82d0('0xc')](_0x25031c[_0x82d0('0x7')][_0x82d0('0xb')],function(_0x3072b7){return{'model':db[_0x3072b7[_0x82d0('0xd')]],'as':_0x3072b7['as'],'attributes':_0x3072b7['as']===_0x82d0('0x3e')?_[_0x82d0('0x28')](_0x308c40):_0x3072b7['attributes'],'include':_0x3072b7[_0x82d0('0xb')]?_[_0x82d0('0xc')](_0x3072b7[_0x82d0('0xb')],function(_0x46acad){return{'model':db[_0x46acad[_0x82d0('0xd')]],'as':_0x46acad['as'],'attributes':_0x46acad[_0x82d0('0x9')],'include':_0x46acad[_0x82d0('0xb')]?_['map'](_0x46acad[_0x82d0('0xb')],function(_0xce0924){return{'model':db[_0xce0924['model']],'as':_0xce0924['as'],'attributes':_0xce0924[_0x82d0('0x9')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45166c){logger['info'](_0x82d0('0x6'),_0x25031c);logger[_0x82d0('0x10')]('GetCmHopper',_0x25031c,JSON[_0x82d0('0x11')](_0x45166c));_0x37b86d(_0x45166c);})[_0x82d0('0x16')](function(_0x16b0cf){logger[_0x82d0('0x12')](_0x82d0('0x6'),_0x16b0cf[_0x82d0('0x1e')],_0x25031c);_0xd74f0e(_0x5919b1[_0x82d0('0x12')](0x1f4,_0x16b0cf['message']));});});});};exports['GetContactByPhone']=function(_0x1abbd9){var _0x17a431=this;return new Promise(function(_0x433ad1,_0x442ecb){return db[_0x82d0('0x22')]['findOne']({'raw':!![],'where':{'phone':_0x1abbd9[_0x82d0('0x7')]['where'][_0x82d0('0x3f')]},'attributes':['id',_0x82d0('0x40')],'order':[['id','DESC']]})[_0x82d0('0xe')](function(_0x1459d0){logger[_0x82d0('0xf')](_0x82d0('0x41'),_0x1abbd9);logger[_0x82d0('0x10')]('getContactByPhone',_0x1abbd9,JSON[_0x82d0('0x11')](_0x1459d0));_0x433ad1(_0x1459d0);})[_0x82d0('0x16')](function(_0x50a425){logger[_0x82d0('0x12')](_0x82d0('0x41'),_0x50a425['message'],_0x1abbd9);_0x442ecb(_0x17a431[_0x82d0('0x12')](0x1f4,_0x50a425[_0x82d0('0x1e')]));});});};exports['ResetActiveCalls']=function(_0x2e3073){var _0x1b7776=this;return new Promise(function(_0xb277c2,_0x1b683b){return db[_0x82d0('0x23')][_0x82d0('0x24')](function(_0x46dcb3){var _0x503386=_0x2e3073[_0x82d0('0x7')]&&_0x2e3073[_0x82d0('0x7')][_0x82d0('0x8')]?_0x2e3073[_0x82d0('0x7')]['where']:{};return db[_0x82d0('0x13')][_0x82d0('0x1b')](_0x2e3073[_0x82d0('0x19')],{'where':_0x503386,'transaction':_0x46dcb3})[_0x82d0('0xe')](function(_0x544149){logger['info'](_0x82d0('0x42'),_0x2e3073);logger['debug']('ResetActiveCalls',_0x2e3073,JSON['stringify'](_0x544149));_0xb277c2(_0x544149);})[_0x82d0('0x16')](function(_0x3173dc){logger['error'](_0x82d0('0x42'),_0x3173dc[_0x82d0('0x1e')],_0x2e3073);_0x1b683b(_0x1b7776['error'](0x1f4,_0x3173dc[_0x82d0('0x1e')]));});});});};exports['CmHopperHandlePreviewRecallNotifications']=function(_0x5d5732){var _0x1b97e7=this;var _0x3e5d18=_0x5d5732[_0x82d0('0x19')][_0x82d0('0x8')][_0x82d0('0x43')];var _0x1b3617=_0x5d5732[_0x82d0('0x19')]['where']['interval'];var _0x39118a=_0x5d5732[_0x82d0('0x19')][_0x82d0('0x8')][_0x82d0('0x44')];return new Promise(function(_0x32fe2b,_0xfce56a){return db['CmHopper']['findAll']({'where':{'voiceQueueId':{'$in':_0x3e5d18},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db['sequelize'][_0x82d0('0x34')](_0x82d0('0x45')+_0x1b3617+'\x20MINUTE'),'$gt':db[_0x82d0('0x23')][_0x82d0('0x34')](_0x82d0('0x46'))}},'UserId':{'$in':_0x39118a}},'include':[{'model':db[_0x82d0('0x22')],'as':'Contact'},{'model':db[_0x82d0('0x29')],'as':_0x82d0('0x47'),'attributes':['id',_0x82d0('0x48'),'voicePause']},{'model':db[_0x82d0('0x49')],'as':_0x82d0('0x4a')}]})[_0x82d0('0xe')](function(_0x3033f9){if(_0x3033f9[_0x82d0('0x2b')]>0x0){return db[_0x82d0('0x23')][_0x82d0('0x24')](function(_0x583621){return db[_0x82d0('0x13')][_0x82d0('0x1b')]({'recallmeNotifiedDate':db[_0x82d0('0x23')][_0x82d0('0x34')]('NOW()')},{'where':{'id':{'$in':_['map'](_0x3033f9,'id')}},'transaction':_0x583621})[_0x82d0('0xe')](function(){_0x32fe2b(_0x3033f9);})[_0x82d0('0x16')](function(_0xf3e117){logger[_0x82d0('0x12')](_0x82d0('0x4b'),_0xf3e117[_0x82d0('0x1e')],_0x5d5732);_0xfce56a(_0x1b97e7[_0x82d0('0x12')](0x1f4,_0xf3e117[_0x82d0('0x1e')]));});})[_0x82d0('0x16')](function(_0x3faedb){logger['error'](_0x82d0('0x4b'),_0x3faedb['message'],_0x5d5732);_0xfce56a(_0x1b97e7[_0x82d0('0x12')](0x1f4,_0x3faedb[_0x82d0('0x1e')]));});}else{_0x32fe2b(_0x3033f9);}});});}; \ No newline at end of file +var _0xdedd=['CreateCmHopper','UpdateCmHopper','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','transaction','order','LOCK','Contact','keys','User','name','voicePause','length','UserId','update','includes','push','dataValues','ContactId','MoveContactManagedDialer','sequelize','CmHopperFinal','CountReScheduled','findAll','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','UPDATE','all','GetContactByPhone','findOne','phone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','interval','availableAgentsIds','\x20MINUTE','Agent','CmList','List','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','CmHopper','options','where','attributes','limit','include','map','model','then','info','GetCmHopper','debug','catch','error','message','ShowCmHopper','raw','stringify','create','body'];(function(_0x22a451,_0x56160a){var _0x35f039=function(_0x385343){while(--_0x385343){_0x22a451['push'](_0x22a451['shift']());}};_0x35f039(++_0x56160a);}(_0xdedd,0xd3));var _0xdded=function(_0xad81aa,_0x43626d){_0xad81aa=_0xad81aa-0x0;var _0x1bbde6=_0xdedd[_0xad81aa];return _0x1bbde6;};'use strict';var _=require(_0xdded('0x0'));var util=require(_0xdded('0x1'));var moment=require(_0xdded('0x2'));var BPromise=require(_0xdded('0x3'));var db=require(_0xdded('0x4'))['db'];var logger=require(_0xdded('0x5'))('rpc');exports['GetCmHopper']=function(_0x59dfe3){var _0x53a435=this;return new Promise(function(_0x5d9efe,_0x2f28f8){return db[_0xdded('0x6')]['findAll']({'raw':_0x59dfe3[_0xdded('0x7')]?_0x59dfe3[_0xdded('0x7')]['raw']===undefined?!![]:![]:!![],'where':_0x59dfe3[_0xdded('0x7')]?_0x59dfe3[_0xdded('0x7')][_0xdded('0x8')]||null:null,'attributes':_0x59dfe3[_0xdded('0x7')]?_0x59dfe3[_0xdded('0x7')][_0xdded('0x9')]||null:null,'limit':_0x59dfe3[_0xdded('0x7')]?_0x59dfe3[_0xdded('0x7')][_0xdded('0xa')]||null:null,'include':_0x59dfe3[_0xdded('0x7')]?_0x59dfe3[_0xdded('0x7')][_0xdded('0xb')]?_[_0xdded('0xc')](_0x59dfe3[_0xdded('0x7')][_0xdded('0xb')],function(_0x3f2159){return{'model':db[_0x3f2159['model']],'as':_0x3f2159['as'],'attributes':_0x3f2159[_0xdded('0x9')],'include':_0x3f2159[_0xdded('0xb')]?_[_0xdded('0xc')](_0x3f2159[_0xdded('0xb')],function(_0x4abdab){return{'model':db[_0x4abdab[_0xdded('0xd')]],'as':_0x4abdab['as'],'attributes':_0x4abdab[_0xdded('0x9')],'include':_0x4abdab[_0xdded('0xb')]?_['map'](_0x4abdab[_0xdded('0xb')],function(_0x49583e){return{'model':db[_0x49583e[_0xdded('0xd')]],'as':_0x49583e['as'],'attributes':_0x49583e[_0xdded('0x9')]};}):[]};}):[]};}):[]:[]})[_0xdded('0xe')](function(_0x3d3bef){logger[_0xdded('0xf')](_0xdded('0x10'),_0x59dfe3);logger[_0xdded('0x11')](_0xdded('0x10'),_0x59dfe3,JSON['stringify'](_0x3d3bef));_0x5d9efe(_0x3d3bef);})[_0xdded('0x12')](function(_0x33330a){logger[_0xdded('0x13')](_0xdded('0x10'),_0x33330a[_0xdded('0x14')],_0x59dfe3);_0x2f28f8(_0x53a435[_0xdded('0x13')](0x1f4,_0x33330a['message']));});});};exports[_0xdded('0x15')]=function(_0x294290){var _0x447618=this;return new Promise(function(_0x519f3d,_0xdfb3e6){return db['CmHopper']['find']({'raw':_0x294290[_0xdded('0x7')]?_0x294290[_0xdded('0x7')][_0xdded('0x16')]===undefined?!![]:![]:!![],'where':_0x294290['options']?_0x294290['options']['where']||null:null,'attributes':_0x294290[_0xdded('0x7')]?_0x294290[_0xdded('0x7')]['attributes']||null:null,'include':_0x294290[_0xdded('0x7')]?_0x294290[_0xdded('0x7')][_0xdded('0xb')]?_['map'](_0x294290['options'][_0xdded('0xb')],function(_0x4315f7){return{'model':db[_0x4315f7[_0xdded('0xd')]],'as':_0x4315f7['as'],'attributes':_0x4315f7['attributes'],'include':_0x4315f7[_0xdded('0xb')]?_[_0xdded('0xc')](_0x4315f7[_0xdded('0xb')],function(_0x4eb91c){return{'model':db[_0x4eb91c[_0xdded('0xd')]],'as':_0x4eb91c['as'],'attributes':_0x4eb91c['attributes'],'include':_0x4eb91c[_0xdded('0xb')]?_[_0xdded('0xc')](_0x4eb91c[_0xdded('0xb')],function(_0x2f7ef2){return{'model':db[_0x2f7ef2['model']],'as':_0x2f7ef2['as'],'attributes':_0x2f7ef2['attributes']};}):[]};}):[]};}):[]:[]})[_0xdded('0xe')](function(_0x769a92){logger['info'](_0xdded('0x15'),_0x294290);logger[_0xdded('0x11')]('ShowCmHopper',_0x294290,JSON[_0xdded('0x17')](_0x769a92));_0x519f3d(_0x769a92);})[_0xdded('0x12')](function(_0x936fd){logger[_0xdded('0x13')](_0xdded('0x15'),_0x936fd[_0xdded('0x14')],_0x294290);_0xdfb3e6(_0x447618[_0xdded('0x13')](0x1f4,_0x936fd[_0xdded('0x14')]));});});};exports['CreateCmHopper']=function(_0x4ad61f){var _0x95f415=this;return new Promise(function(_0x5945b7,_0x583530){return db[_0xdded('0x6')][_0xdded('0x18')](_0x4ad61f[_0xdded('0x19')],{'raw':_0x4ad61f[_0xdded('0x7')]?_0x4ad61f[_0xdded('0x7')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x41176d){logger[_0xdded('0xf')](_0xdded('0x1a'),_0x4ad61f);logger['debug'](_0xdded('0x1a'),_0x4ad61f,JSON[_0xdded('0x17')](_0x41176d));_0x5945b7(_0x41176d);})[_0xdded('0x12')](function(_0x35a544){logger[_0xdded('0x13')](_0xdded('0x1a'),_0x35a544[_0xdded('0x14')],_0x4ad61f);_0x583530(_0x95f415[_0xdded('0x13')](0x1f4,_0x35a544[_0xdded('0x14')]));});});};exports[_0xdded('0x1b')]=function(_0x519999){var _0x14fd57=this;return new Promise(function(_0x396959,_0x3a5226){return db[_0xdded('0x6')]['update'](_0x519999[_0xdded('0x19')],{'raw':_0x519999[_0xdded('0x7')]?_0x519999['options'][_0xdded('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x519999['options']?_0x519999[_0xdded('0x7')][_0xdded('0x8')]||null:null,'attributes':_0x519999[_0xdded('0x7')]?_0x519999[_0xdded('0x7')]['attributes']||null:null,'limit':_0x519999[_0xdded('0x7')]?_0x519999[_0xdded('0x7')][_0xdded('0xa')]||null:null})[_0xdded('0xe')](function(_0x16a961){logger[_0xdded('0xf')](_0xdded('0x1b'),_0x519999);logger[_0xdded('0xf')](_0xdded('0x1c'),JSON['stringify'](_0x519999['options']['where']),_0x519999[_0xdded('0x19')][_0xdded('0x1d')]);logger['debug'](_0xdded('0x1b'),_0x519999,JSON['stringify'](_0x16a961));_0x396959(_0x16a961);})[_0xdded('0x12')](function(_0x407bc5){logger['error'](_0xdded('0x1b'),_0x407bc5[_0xdded('0x14')],_0x519999);_0x3a5226(_0x14fd57[_0xdded('0x13')](0x1f4,_0x407bc5[_0xdded('0x14')]));});});};exports[_0xdded('0x1e')]=function(_0x3e94a9){var _0x1ccce5=this;return new Promise(function(_0x514f0e,_0x3b6edb){return db['CmHopper'][_0xdded('0x1f')]({'where':_0x3e94a9[_0xdded('0x7')]?_0x3e94a9[_0xdded('0x7')]['where']||null:null})[_0xdded('0xe')](function(_0x2543f6){logger['info']('DestroyCmHopper',_0x3e94a9);logger[_0xdded('0x11')](_0xdded('0x1e'),_0x3e94a9,JSON['stringify'](_0x2543f6));_0x514f0e(_0x2543f6);})[_0xdded('0x12')](function(_0x288f9d){logger[_0xdded('0x13')]('DestroyCmHopper',_0x288f9d[_0xdded('0x14')],_0x3e94a9);_0x3b6edb(_0x1ccce5[_0xdded('0x13')](0x1f4,_0x288f9d['message']));});});};exports[_0xdded('0x20')]=function(_0x28fffc){var _0x36ef68=this;return new Promise(function(_0x4c06f8,_0x1ae330){return db[_0xdded('0x21')][_0xdded('0x22')]()[_0xdded('0xe')](function(_0x238165){return db['sequelize'][_0xdded('0x23')](function(_0x182d04){return db['CmHopper']['findAll']({'where':_0x28fffc['options']?_0x28fffc['options'][_0xdded('0x8')]||null:null,'attributes':_0x28fffc[_0xdded('0x7')]?_0x28fffc[_0xdded('0x7')][_0xdded('0x9')]||null:null,'limit':_0x28fffc[_0xdded('0x7')]?_0x28fffc['options'][_0xdded('0xa')]||null:null,'order':_0x28fffc[_0xdded('0x7')]?_0x28fffc[_0xdded('0x7')][_0xdded('0x24')]||null:null,'transaction':_0x182d04,'lock':_0x182d04[_0xdded('0x25')]['UPDATE'],'include':[{'model':db[_0xdded('0x21')],'as':_0xdded('0x26'),'attributes':_[_0xdded('0x27')](_0x238165)},{'model':db[_0xdded('0x28')],'as':'Agent','attributes':['id',_0xdded('0x29'),_0xdded('0x2a')]}]})['then'](function(_0x442e84){var _0x4561eb=[];var _0x1ed9d9=[];for(var _0x1e2977=0x0;_0x1e2977<_0x442e84[_0xdded('0x2b')];_0x1e2977+=0x1){var _0x3ae8b1=_0x442e84[_0x1e2977][_0xdded('0x2c')];if(_0x3ae8b1===null){_0x4561eb['push'](_0x442e84[_0x1e2977][_0xdded('0x2d')](_0x28fffc[_0xdded('0x19')],{'transaction':_0x182d04}));}else if(!_0x1ed9d9[_0xdded('0x2e')](_0x3ae8b1)){_0x1ed9d9[_0xdded('0x2f')](_0x3ae8b1);_0x4561eb[_0xdded('0x2f')](_0x442e84[_0x1e2977]['update'](_0x28fffc[_0xdded('0x19')],{'transaction':_0x182d04}));}}return BPromise['all'](_0x4561eb);});})[_0xdded('0xe')](function(_0x230305){logger[_0xdded('0xf')](_0xdded('0x20'),_0x28fffc);if(_0x230305[_0xdded('0x2b')]>0x0){logger[_0xdded('0xf')]('GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]',_0x230305[0x0][_0xdded('0x30')]['id'],_0x230305[0x0]['dataValues'][_0xdded('0x31')],_0x230305[0x0][_0xdded('0x30')][_0xdded('0x1d')]);}logger[_0xdded('0x11')](_0xdded('0x20'),_0x28fffc,JSON['stringify'](_0x230305));_0x4c06f8(_0x230305);})['catch'](function(_0x59c803){logger[_0xdded('0x13')](_0xdded('0x20'),_0x59c803[_0xdded('0x14')],_0x28fffc);_0x1ae330(_0x36ef68[_0xdded('0x13')](0x1f4,_0x59c803[_0xdded('0x14')]));});});});};exports[_0xdded('0x32')]=function(_0x449193){var _0x458ffd=this;return new Promise(function(_0x1f596b,_0x4dbb26){return db[_0xdded('0x33')]['transaction'](function(_0xae14c0){return db[_0xdded('0x34')][_0xdded('0x18')](_0x449193[_0xdded('0x19')],{'raw':_0x449193[_0xdded('0x7')]?_0x449193[_0xdded('0x7')]['raw']===undefined?!![]:![]:!![],'transaction':_0xae14c0})['then'](function(){logger[_0xdded('0xf')]('MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0xdded('0x17')](_0x449193[_0xdded('0x7')]['where']),_0x449193[_0xdded('0x7')][_0xdded('0x8')]['active']);return db[_0xdded('0x6')][_0xdded('0x1f')]({'where':_0x449193[_0xdded('0x7')]?_0x449193[_0xdded('0x7')][_0xdded('0x8')]||null:null,'transaction':_0xae14c0});});})[_0xdded('0xe')](function(_0x5038e8){logger[_0xdded('0xf')](_0xdded('0x32'),_0x449193);logger[_0xdded('0x11')](_0xdded('0x32'),_0x449193,JSON['stringify'](_0x5038e8));_0x1f596b(_0x5038e8);})[_0xdded('0x12')](function(_0x5866ac){logger[_0xdded('0x13')]('MoveContactManagedDialer',_0x5866ac[_0xdded('0x14')],_0x449193);_0x4dbb26(_0x458ffd[_0xdded('0x13')](0x1f4,_0x5866ac[_0xdded('0x14')]));});});};exports[_0xdded('0x35')]=function(_0x2bc2ba){var _0x197fc5=this;return new Promise(function(_0x459b57,_0x46a2c4){return db[_0xdded('0x6')][_0xdded('0x36')]({'raw':_0x2bc2ba['options']?_0x2bc2ba[_0xdded('0x7')]['raw']===undefined?!![]:![]:!![],'where':_0x2bc2ba[_0xdded('0x7')]?_0x2bc2ba['options'][_0xdded('0x8')]||null:null,'attributes':[[db[_0xdded('0x33')]['fn']('COUNT',db[_0xdded('0x33')]['fn']('IF',db[_0xdded('0x33')][_0xdded('0x37')](_0xdded('0x38')+util[_0xdded('0x39')](_0xdded('0x3a'),moment()[_0xdded('0x39')](_0xdded('0x3b')))+_0xdded('0x3c')))),_0xdded('0x3d')]]})[_0xdded('0xe')](function(_0x30f21e){logger[_0xdded('0xf')](_0xdded('0x35'),_0x2bc2ba);logger[_0xdded('0x11')]('CountReScheduled',_0x2bc2ba,JSON['stringify'](_0x30f21e));_0x459b57(_0x30f21e);})['catch'](function(_0x59a936){logger[_0xdded('0x13')](_0xdded('0x35'),_0x59a936[_0xdded('0x14')],_0x2bc2ba);_0x46a2c4(_0x197fc5[_0xdded('0x13')](0x1f4,_0x59a936[_0xdded('0x14')]));});});};exports[_0xdded('0x3e')]=function(_0xcd76d8){var _0x3454fa=this;return new Promise(function(_0x36c86e,_0x51953f){return db[_0xdded('0x21')][_0xdded('0x22')]()[_0xdded('0xe')](function(){return db[_0xdded('0x33')][_0xdded('0x23')](function(_0x247e27){return db[_0xdded('0x6')][_0xdded('0x36')]({'where':_0xcd76d8[_0xdded('0x7')]?_0xcd76d8[_0xdded('0x7')][_0xdded('0x8')]||null:null,'attributes':_0xcd76d8[_0xdded('0x7')]?_0xcd76d8['options'][_0xdded('0x9')]||null:null,'limit':0x1,'order':_0xcd76d8[_0xdded('0x7')]?_0xcd76d8[_0xdded('0x7')][_0xdded('0x24')]||null:null,'group':db[_0xdded('0x6')][_0xdded('0x2c')],'transaction':_0x247e27,'lock':_0x247e27[_0xdded('0x25')][_0xdded('0x3f')],'include':_0xcd76d8['options']?_0xcd76d8[_0xdded('0x7')][_0xdded('0xb')]?_[_0xdded('0xc')](_0xcd76d8['options'][_0xdded('0xb')],function(_0x103491){return{'model':db[_0x103491[_0xdded('0xd')]],'as':_0x103491['as'],'attributes':_0x103491[_0xdded('0x9')],'include':_0x103491[_0xdded('0xb')]?_[_0xdded('0xc')](_0x103491[_0xdded('0xb')],function(_0x41bdcc){return{'model':db[_0x41bdcc[_0xdded('0xd')]],'as':_0x41bdcc['as'],'attributes':_0x41bdcc[_0xdded('0x9')],'include':_0x41bdcc[_0xdded('0xb')]?_[_0xdded('0xc')](_0x41bdcc[_0xdded('0xb')],function(_0xa88863){return{'model':db[_0xa88863[_0xdded('0xd')]],'as':_0xa88863['as'],'attributes':_0xa88863[_0xdded('0x9')]};}):[]};}):[]};}):[]:[]})[_0xdded('0xe')](function(_0x22d02b){var _0xa2137e=[];for(var _0x44e77=0x0;_0x44e77<_0x22d02b[_0xdded('0x2b')];_0x44e77+=0x1){_0xa2137e[_0xdded('0x2f')](_0x22d02b[_0x44e77][_0xdded('0x2d')](_0xcd76d8[_0xdded('0x19')],{'transaction':_0x247e27}));}return BPromise[_0xdded('0x40')](_0xa2137e);});})['then'](function(_0x516c1a){logger[_0xdded('0xf')](_0xdded('0x3e'),_0xcd76d8);logger[_0xdded('0x11')]('GetContactRecallMe',_0xcd76d8,JSON[_0xdded('0x17')](_0x516c1a));_0x36c86e(_0x516c1a);})[_0xdded('0x12')](function(_0x12041e){logger[_0xdded('0x13')]('GetContactRecallMe',_0x12041e[_0xdded('0x14')],_0xcd76d8);_0x51953f(_0x3454fa[_0xdded('0x13')](0x1f4,_0x12041e[_0xdded('0x14')]));});});});};exports['GetCmHopperPreview']=function(_0x39316e){var _0x15999f=this;return new Promise(function(_0x26732c,_0xd732f7){db[_0xdded('0x21')][_0xdded('0x22')]()['then'](function(_0x4098db){return db[_0xdded('0x6')][_0xdded('0x36')]({'raw':_0x39316e[_0xdded('0x7')]?_0x39316e[_0xdded('0x7')]['raw']===undefined?!![]:![]:!![],'where':_0x39316e[_0xdded('0x7')]?_0x39316e[_0xdded('0x7')][_0xdded('0x8')]||null:null,'attributes':_0x39316e[_0xdded('0x7')]?_0x39316e[_0xdded('0x7')][_0xdded('0x9')]||null:null,'limit':_0x39316e[_0xdded('0x7')]?_0x39316e[_0xdded('0x7')][_0xdded('0xa')]||null:null,'include':_0x39316e['options']?_0x39316e['options'][_0xdded('0xb')]?_[_0xdded('0xc')](_0x39316e[_0xdded('0x7')][_0xdded('0xb')],function(_0x5a1aa6){return{'model':db[_0x5a1aa6[_0xdded('0xd')]],'as':_0x5a1aa6['as'],'attributes':_0x5a1aa6['as']==='Contact'?_[_0xdded('0x27')](_0x4098db):_0x5a1aa6[_0xdded('0x9')],'include':_0x5a1aa6['include']?_[_0xdded('0xc')](_0x5a1aa6[_0xdded('0xb')],function(_0x866d8f){return{'model':db[_0x866d8f[_0xdded('0xd')]],'as':_0x866d8f['as'],'attributes':_0x866d8f[_0xdded('0x9')],'include':_0x866d8f['include']?_['map'](_0x866d8f[_0xdded('0xb')],function(_0xf86ad4){return{'model':db[_0xf86ad4['model']],'as':_0xf86ad4['as'],'attributes':_0xf86ad4[_0xdded('0x9')]};}):[]};}):[]};}):[]:[]})[_0xdded('0xe')](function(_0x157bcb){logger[_0xdded('0xf')](_0xdded('0x10'),_0x39316e);logger[_0xdded('0x11')](_0xdded('0x10'),_0x39316e,JSON[_0xdded('0x17')](_0x157bcb));_0x26732c(_0x157bcb);})['catch'](function(_0x3f7f17){logger['error'](_0xdded('0x10'),_0x3f7f17[_0xdded('0x14')],_0x39316e);_0xd732f7(_0x15999f[_0xdded('0x13')](0x1f4,_0x3f7f17[_0xdded('0x14')]));});});});};exports[_0xdded('0x41')]=function(_0x307d3f){var _0x535875=this;return new Promise(function(_0x1fab88,_0x30afce){return db['CmContact'][_0xdded('0x42')]({'raw':!![],'where':{'phone':_0x307d3f[_0xdded('0x7')][_0xdded('0x8')][_0xdded('0x43')]},'attributes':['id','dialTimezone'],'order':[['id',_0xdded('0x44')]]})[_0xdded('0xe')](function(_0x449797){logger[_0xdded('0xf')](_0xdded('0x45'),_0x307d3f);logger[_0xdded('0x11')]('getContactByPhone',_0x307d3f,JSON[_0xdded('0x17')](_0x449797));_0x1fab88(_0x449797);})['catch'](function(_0x30082a){logger['error'](_0xdded('0x45'),_0x30082a[_0xdded('0x14')],_0x307d3f);_0x30afce(_0x535875['error'](0x1f4,_0x30082a[_0xdded('0x14')]));});});};exports[_0xdded('0x46')]=function(_0x40fe27){var _0x335e2c=this;return new Promise(function(_0x3ff642,_0x471cc0){return db[_0xdded('0x33')][_0xdded('0x23')](function(_0x171c1d){var _0x340f5c=_0x40fe27[_0xdded('0x7')]&&_0x40fe27[_0xdded('0x7')][_0xdded('0x8')]?_0x40fe27[_0xdded('0x7')][_0xdded('0x8')]:{};return db[_0xdded('0x6')]['update'](_0x40fe27['body'],{'where':_0x340f5c,'transaction':_0x171c1d})[_0xdded('0xe')](function(_0x34b6d3){logger['info'](_0xdded('0x46'),_0x40fe27);logger['debug'](_0xdded('0x46'),_0x40fe27,JSON[_0xdded('0x17')](_0x34b6d3));_0x3ff642(_0x34b6d3);})['catch'](function(_0x25e2db){logger['error'](_0xdded('0x46'),_0x25e2db[_0xdded('0x14')],_0x40fe27);_0x471cc0(_0x335e2c[_0xdded('0x13')](0x1f4,_0x25e2db[_0xdded('0x14')]));});});});};exports[_0xdded('0x47')]=function(_0x30bb8c){var _0x4abe5a=this;var _0x333c8d=_0x30bb8c[_0xdded('0x19')][_0xdded('0x8')][_0xdded('0x48')];var _0x522dcf=_0x30bb8c[_0xdded('0x19')][_0xdded('0x8')][_0xdded('0x49')];var _0x50c700=_0x30bb8c[_0xdded('0x19')][_0xdded('0x8')][_0xdded('0x4a')];return new Promise(function(_0x3cc5f6,_0x51b6b1){return db[_0xdded('0x6')][_0xdded('0x36')]({'where':{'voiceQueueId':{'$in':_0x333c8d},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0xdded('0x33')][_0xdded('0x37')]('NOW()\x20+\x20INTERVAL\x20'+_0x522dcf+_0xdded('0x4b')),'$gt':db['sequelize'][_0xdded('0x37')]('NOW()')}},'UserId':{'$in':_0x50c700}},'include':[{'model':db[_0xdded('0x21')],'as':'Contact'},{'model':db['User'],'as':_0xdded('0x4c'),'attributes':['id',_0xdded('0x29'),_0xdded('0x2a')]},{'model':db[_0xdded('0x4d')],'as':_0xdded('0x4e')}]})['then'](function(_0x48ba94){if(_0x48ba94[_0xdded('0x2b')]>0x0){return db['sequelize'][_0xdded('0x23')](function(_0x4d77de){return db[_0xdded('0x6')][_0xdded('0x2d')]({'recallmeNotifiedDate':db[_0xdded('0x33')][_0xdded('0x37')]('NOW()')},{'where':{'id':{'$in':_[_0xdded('0xc')](_0x48ba94,'id')}},'transaction':_0x4d77de})[_0xdded('0xe')](function(){_0x3cc5f6(_0x48ba94);})[_0xdded('0x12')](function(_0xb771dc){logger[_0xdded('0x13')](_0xdded('0x47'),_0xb771dc['message'],_0x30bb8c);_0x51b6b1(_0x4abe5a[_0xdded('0x13')](0x1f4,_0xb771dc[_0xdded('0x14')]));});})[_0xdded('0x12')](function(_0x3e753b){logger[_0xdded('0x13')](_0xdded('0x47'),_0x3e753b['message'],_0x30bb8c);_0x51b6b1(_0x4abe5a[_0xdded('0x13')](0x1f4,_0x3e753b[_0xdded('0x14')]));});}else{_0x3cc5f6(_0x48ba94);}});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 5540112..2876eb4 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 _0x20b6=['/describe','describe','get','/opencontacts','getOpenContacts','/timezones','getTimezones','/:id','/:id/previewrecall','getPreviewRecall','create','post','/preview','getPreview','/timezone','put','update','destroy','exports','express','./cmHopper.controller','isAuthenticated','index'];(function(_0x4c260a,_0x148241){var _0x17bbdd=function(_0x4f3e9f){while(--_0x4f3e9f){_0x4c260a['push'](_0x4c260a['shift']());}};_0x17bbdd(++_0x148241);}(_0x20b6,0x1df));var _0x620b=function(_0x55fa03,_0xcb96c2){_0x55fa03=_0x55fa03-0x0;var _0x2cd7cd=_0x20b6[_0x55fa03];return _0x2cd7cd;};'use strict';var express=require(_0x620b('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0x620b('0x1'));router['get']('/',auth[_0x620b('0x2')](),controller[_0x620b('0x3')]);router['get'](_0x620b('0x4'),auth[_0x620b('0x2')](),controller[_0x620b('0x5')]);router[_0x620b('0x6')](_0x620b('0x7'),auth[_0x620b('0x2')](),controller[_0x620b('0x8')]);router[_0x620b('0x6')](_0x620b('0x9'),auth[_0x620b('0x2')](),controller[_0x620b('0xa')]);router[_0x620b('0x6')](_0x620b('0xb'),auth[_0x620b('0x2')](),controller['show']);router['get'](_0x620b('0xc'),auth[_0x620b('0x2')](),controller[_0x620b('0xd')]);router['post']('/',auth[_0x620b('0x2')](),controller[_0x620b('0xe')]);router[_0x620b('0xf')](_0x620b('0x10'),auth[_0x620b('0x2')](),controller[_0x620b('0x11')]);router[_0x620b('0xf')](_0x620b('0x12'),auth[_0x620b('0x2')](),controller['getTimezone']);router[_0x620b('0x13')](_0x620b('0xb'),auth[_0x620b('0x2')](),controller[_0x620b('0x14')]);router['delete']('/:id',auth[_0x620b('0x2')](),controller[_0x620b('0x15')]);module[_0x620b('0x16')]=router; \ No newline at end of file +var _0xee9b=['isAuthenticated','describe','get','/opencontacts','getOpenContacts','/timezones','getTimezones','show','/:id/previewrecall','post','create','/preview','getPreview','/timezone','getTimezone','put','/:id','update','delete','destroy','exports','express','../../components/auth/service','./cmHopper.controller','/describe'];(function(_0x2bf040,_0x5db497){var _0x36d10e=function(_0x5e51f7){while(--_0x5e51f7){_0x2bf040['push'](_0x2bf040['shift']());}};_0x36d10e(++_0x5db497);}(_0xee9b,0x173));var _0xbee9=function(_0x5bf51e,_0x18d0a0){_0x5bf51e=_0x5bf51e-0x0;var _0x4fd148=_0xee9b[_0x5bf51e];return _0x4fd148;};'use strict';var express=require(_0xbee9('0x0'));var router=express['Router']();var auth=require(_0xbee9('0x1'));var controller=require(_0xbee9('0x2'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xbee9('0x3'),auth[_0xbee9('0x4')](),controller[_0xbee9('0x5')]);router[_0xbee9('0x6')](_0xbee9('0x7'),auth[_0xbee9('0x4')](),controller[_0xbee9('0x8')]);router[_0xbee9('0x6')](_0xbee9('0x9'),auth[_0xbee9('0x4')](),controller[_0xbee9('0xa')]);router['get']('/:id',auth[_0xbee9('0x4')](),controller[_0xbee9('0xb')]);router[_0xbee9('0x6')](_0xbee9('0xc'),auth['isAuthenticated'](),controller['getPreviewRecall']);router[_0xbee9('0xd')]('/',auth[_0xbee9('0x4')](),controller[_0xbee9('0xe')]);router[_0xbee9('0xd')](_0xbee9('0xf'),auth[_0xbee9('0x4')](),controller[_0xbee9('0x10')]);router[_0xbee9('0xd')](_0xbee9('0x11'),auth[_0xbee9('0x4')](),controller[_0xbee9('0x12')]);router[_0xbee9('0x13')](_0xbee9('0x14'),auth['isAuthenticated'](),controller[_0xbee9('0x15')]);router[_0xbee9('0x16')](_0xbee9('0x14'),auth['isAuthenticated'](),controller[_0xbee9('0x17')]);module[_0xbee9('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 e5c652c..12fa3e1 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 _0x3be8=['YYYY-MM-DD\x20HH:mm:ss','moment','sequelize','INTEGER','STRING','format'];(function(_0x201d87,_0x5b425b){var _0x2d7ba0=function(_0x48b0b4){while(--_0x48b0b4){_0x201d87['push'](_0x201d87['shift']());}};_0x2d7ba0(++_0x5b425b);}(_0x3be8,0xb5));var _0x83be=function(_0x20d08e,_0x4cc575){_0x20d08e=_0x20d08e-0x0;var _0x2cbd12=_0x3be8[_0x20d08e];return _0x2cbd12;};'use strict';var moment=require(_0x83be('0x0'));var Sequelize=require(_0x83be('0x1'));module['exports']={'CmHopperId':{'type':Sequelize[_0x83be('0x2')]},'phone':{'type':Sequelize[_0x83be('0x3')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x83be('0x2')],'defaultValue':0x0},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x83be('0x4')](_0x83be('0x5'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x83be('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x83be('0x2')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x83be('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x83be('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x83be('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x83be('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x83b6=['INTEGER','STRING','YYYY-MM-DD\x20HH:mm:ss','moment','exports'];(function(_0x4a6aec,_0xfb666c){var _0x1b5dd0=function(_0x4805be){while(--_0x4805be){_0x4a6aec['push'](_0x4a6aec['shift']());}};_0x1b5dd0(++_0xfb666c);}(_0x83b6,0x125));var _0x683b=function(_0x707999,_0xf39504){_0x707999=_0x707999-0x0;var _0x5b31fe=_0x83b6[_0x707999];return _0x5b31fe;};'use strict';var moment=require(_0x683b('0x0'));var Sequelize=require('sequelize');module[_0x683b('0x1')]={'CmHopperId':{'type':Sequelize[_0x683b('0x2')]},'phone':{'type':Sequelize[_0x683b('0x3')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x683b('0x2')],'defaultValue':0x0},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()['format'](_0x683b('0x4'))},'countbusyretry':{'type':Sequelize[_0x683b('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x683b('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x683b('0x2')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x683b('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x683b('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x683b('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x683b('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x683b('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js index 88c97b6..c5644c9 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 _0x06dc=['attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','CmHopperAdditionalPhone','includeAll','include','findAll','rows','catch','show','fields','length','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','CmHopperAdditionalPhones','find','userProfileId','autoAssociation','UserProfileResource','create','update','params','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','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','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection'];(function(_0xbf8ebe,_0x3b69a5){var _0x1e25e8=function(_0x40c390){while(--_0x40c390){_0xbf8ebe['push'](_0xbf8ebe['shift']());}};_0x1e25e8(++_0x3b69a5);}(_0x06dc,0x1d4));var _0xc06d=function(_0x495054,_0x304104){_0x495054=_0x495054-0x0;var _0x146d2e=_0x06dc[_0x495054];return _0x146d2e;};'use strict';var emlformat=require(_0xc06d('0x0'));var rimraf=require(_0xc06d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc06d('0x2'));var rp=require(_0xc06d('0x3'));var moment=require('moment');var BPromise=require(_0xc06d('0x4'));var Mustache=require(_0xc06d('0x5'));var util=require(_0xc06d('0x6'));var path=require(_0xc06d('0x7'));var sox=require(_0xc06d('0x8'));var csv=require('to-csv');var ejs=require(_0xc06d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc06d('0xa'));var squel=require(_0xc06d('0xb'));var crypto=require(_0xc06d('0xc'));var jsforce=require(_0xc06d('0xd'));var deskjs=require(_0xc06d('0xe'));var toCsv=require(_0xc06d('0xf'));var querystring=require(_0xc06d('0x10'));var Papa=require(_0xc06d('0x11'));var Redis=require(_0xc06d('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc06d('0x13'));var hardwareService=require(_0xc06d('0x14'));var logger=require(_0xc06d('0x15'))('api');var utils=require(_0xc06d('0x16'));var config=require(_0xc06d('0x17'));var licenseUtil=require(_0xc06d('0x18'));var db=require(_0xc06d('0x19'))['db'];function respondWithStatusCode(_0x3b3644,_0x53107c){_0x53107c=_0x53107c||0xcc;return function(_0x448c78){if(_0x448c78){return _0x3b3644[_0xc06d('0x1a')](_0x53107c);}return _0x3b3644[_0xc06d('0x1b')](_0x53107c)[_0xc06d('0x1c')]();};}function respondWithResult(_0x139004,_0x5aa322){_0x5aa322=_0x5aa322||0xc8;return function(_0x14cd5f){if(_0x14cd5f){return _0x139004[_0xc06d('0x1b')](_0x5aa322)[_0xc06d('0x1d')](_0x14cd5f);}};}function respondWithFilteredResult(_0x3a986b,_0x44c077){return function(_0x11f05c){if(_0x11f05c){var _0x2e7f35=typeof _0x44c077['offset']===_0xc06d('0x1e')&&typeof _0x44c077[_0xc06d('0x1f')]===_0xc06d('0x1e');var _0x54df9c=_0x11f05c[_0xc06d('0x20')];var _0x44c07c=_0x2e7f35?0x0:_0x44c077[_0xc06d('0x21')];var _0x1861d7=_0x2e7f35?_0x11f05c[_0xc06d('0x20')]:_0x44c077['offset']+_0x44c077[_0xc06d('0x1f')];var _0x3df893;if(_0x1861d7>=_0x54df9c){_0x1861d7=_0x54df9c;_0x3df893=0xc8;}else{_0x3df893=0xce;}_0x3a986b[_0xc06d('0x1b')](_0x3df893);return _0x3a986b[_0xc06d('0x22')](_0xc06d('0x23'),_0x44c07c+'-'+_0x1861d7+'/'+_0x54df9c)[_0xc06d('0x1d')](_0x11f05c);}return null;};}function patchUpdates(_0x244a0a){return function(_0x3e1a62){try{jsonpatch[_0xc06d('0x24')](_0x3e1a62,_0x244a0a,!![]);}catch(_0x2fc3b9){return BPromise['reject'](_0x2fc3b9);}return _0x3e1a62[_0xc06d('0x25')]();};}function saveUpdates(_0x3e687c,_0x5699e2){return function(_0x131ee7){if(_0x131ee7){return _0x131ee7['update'](_0x3e687c)[_0xc06d('0x26')](function(_0x130f2f){return _0x130f2f;});}return null;};}function removeEntity(_0x25d1e3,_0x1bb7b1){return function(_0x217ff2){if(_0x217ff2){return _0x217ff2[_0xc06d('0x27')]()[_0xc06d('0x26')](function(){var _0x5eb5b2=_0x217ff2['get']({'plain':!![]});var _0x3af8bd='CmHopperAdditionalPhones';return db['UserProfileResource'][_0xc06d('0x27')]({'where':{'type':_0x3af8bd,'resourceId':_0x5eb5b2['id']}})[_0xc06d('0x26')](function(){return _0x217ff2;});})[_0xc06d('0x26')](function(){_0x25d1e3[_0xc06d('0x1b')](0xcc)[_0xc06d('0x1c')]();});}};}function handleEntityNotFound(_0x13bca4,_0xb60ca1){return function(_0x5582f3){if(!_0x5582f3){_0x13bca4[_0xc06d('0x1a')](0x194);}return _0x5582f3;};}function handleError(_0x4451f9,_0x180047){_0x180047=_0x180047||0x1f4;return function(_0x6180fa){logger[_0xc06d('0x28')](_0x6180fa['stack']);if(_0x6180fa['name']){delete _0x6180fa[_0xc06d('0x29')];}_0x4451f9[_0xc06d('0x1b')](_0x180047)[_0xc06d('0x2a')](_0x6180fa);};}exports[_0xc06d('0x2b')]=function(_0x4d59a3,_0x3383a8){var _0x30baa2={},_0xae01bc={},_0x482864={'count':0x0,'rows':[]};var _0x17b0b4=_[_0xc06d('0x2c')](db['CmHopperAdditionalPhone'][_0xc06d('0x2d')],function(_0x2ce60f){return{'name':_0x2ce60f[_0xc06d('0x2e')],'type':_0x2ce60f[_0xc06d('0x2f')][_0xc06d('0x30')]};});_0xae01bc[_0xc06d('0x31')]=_['map'](_0x17b0b4,'name');_0xae01bc[_0xc06d('0x32')]=_[_0xc06d('0x33')](_0x4d59a3[_0xc06d('0x32')]);_0xae01bc[_0xc06d('0x34')]=_[_0xc06d('0x35')](_0xae01bc[_0xc06d('0x31')],_0xae01bc['query']);_0x30baa2['attributes']=_['intersection'](_0xae01bc[_0xc06d('0x31')],qs['fields'](_0x4d59a3['query']['fields']));_0x30baa2['attributes']=_0x30baa2[_0xc06d('0x36')]['length']?_0x30baa2[_0xc06d('0x36')]:_0xae01bc[_0xc06d('0x31')];if(!_0x4d59a3[_0xc06d('0x32')][_0xc06d('0x37')](_0xc06d('0x38'))){_0x30baa2['limit']=qs[_0xc06d('0x1f')](_0x4d59a3[_0xc06d('0x32')][_0xc06d('0x1f')]);_0x30baa2['offset']=qs[_0xc06d('0x21')](_0x4d59a3['query'][_0xc06d('0x21')]);}_0x30baa2[_0xc06d('0x39')]=qs[_0xc06d('0x3a')](_0x4d59a3[_0xc06d('0x32')][_0xc06d('0x3a')]);_0x30baa2[_0xc06d('0x3b')]=qs[_0xc06d('0x34')](_[_0xc06d('0x3c')](_0x4d59a3['query'],_0xae01bc[_0xc06d('0x34')]),_0x17b0b4);if(_0x4d59a3[_0xc06d('0x32')][_0xc06d('0x3d')]){_0x30baa2[_0xc06d('0x3b')]=_[_0xc06d('0x3e')](_0x30baa2[_0xc06d('0x3b')],{'$or':_[_0xc06d('0x2c')](_0x17b0b4,function(_0x5b4689){if(_0x5b4689[_0xc06d('0x2f')]!==_0xc06d('0x3f')){var _0x1772c9={};_0x1772c9[_0x5b4689[_0xc06d('0x29')]]={'$like':'%'+_0x4d59a3[_0xc06d('0x32')]['filter']+'%'};return _0x1772c9;}})});}_0x30baa2=_['merge']({},_0x30baa2,_0x4d59a3[_0xc06d('0x40')]);var _0x420e54={'where':_0x30baa2['where']};return db[_0xc06d('0x41')]['count'](_0x420e54)['then'](function(_0xbae6b0){_0x482864[_0xc06d('0x20')]=_0xbae6b0;if(_0x4d59a3[_0xc06d('0x32')][_0xc06d('0x42')]){_0x30baa2[_0xc06d('0x43')]=[{'all':!![]}];}return db[_0xc06d('0x41')][_0xc06d('0x44')](_0x30baa2);})['then'](function(_0x27c5c0){_0x482864[_0xc06d('0x45')]=_0x27c5c0;return _0x482864;})[_0xc06d('0x26')](respondWithFilteredResult(_0x3383a8,_0x30baa2))[_0xc06d('0x46')](handleError(_0x3383a8,null));};exports[_0xc06d('0x47')]=function(_0x567e96,_0x4e1305){var _0x536672={'raw':!![],'where':{'id':_0x567e96['params']['id']}},_0x406129={};_0x406129['model']=_[_0xc06d('0x33')](db['CmHopperAdditionalPhone'][_0xc06d('0x2d')]);_0x406129[_0xc06d('0x32')]=_[_0xc06d('0x33')](_0x567e96[_0xc06d('0x32')]);_0x406129['filters']=_[_0xc06d('0x35')](_0x406129[_0xc06d('0x31')],_0x406129[_0xc06d('0x32')]);_0x536672['attributes']=_['intersection'](_0x406129[_0xc06d('0x31')],qs[_0xc06d('0x48')](_0x567e96[_0xc06d('0x32')][_0xc06d('0x48')]));_0x536672[_0xc06d('0x36')]=_0x536672['attributes'][_0xc06d('0x49')]?_0x536672[_0xc06d('0x36')]:_0x406129[_0xc06d('0x31')];if(_0x567e96[_0xc06d('0x32')]['includeAll']){_0x536672[_0xc06d('0x43')]=[{'all':!![]}];}_0x536672=_[_0xc06d('0x3e')]({},_0x536672,_0x567e96['options']);return db[_0xc06d('0x41')]['find'](_0x536672)[_0xc06d('0x26')](handleEntityNotFound(_0x4e1305,null))[_0xc06d('0x26')](respondWithResult(_0x4e1305,null))[_0xc06d('0x46')](handleError(_0x4e1305,null));};exports['create']=function(_0x30e597,_0x14fb49){return db['CmHopperAdditionalPhone']['create'](_0x30e597[_0xc06d('0x4a')],{})['then'](function(_0x4e94cf){var _0x41c6d6=_0x30e597['user'][_0xc06d('0x4b')]({'plain':!![]});if(!_0x41c6d6)throw new Error(_0xc06d('0x4c'));if(_0x41c6d6[_0xc06d('0x4d')]===_0xc06d('0x4e')){var _0x86e694=_0x4e94cf['get']({'plain':!![]});var _0x7c3583=_0xc06d('0x4f');return db['UserProfileSection'][_0xc06d('0x50')]({'where':{'name':_0x7c3583,'userProfileId':_0x41c6d6[_0xc06d('0x51')]},'raw':!![]})[_0xc06d('0x26')](function(_0x4cc4f5){if(_0x4cc4f5&&_0x4cc4f5[_0xc06d('0x52')]===0x0){return db[_0xc06d('0x53')][_0xc06d('0x54')]({'name':_0x86e694[_0xc06d('0x29')],'resourceId':_0x86e694['id'],'type':_0x4cc4f5['name'],'sectionId':_0x4cc4f5['id']},{})[_0xc06d('0x26')](function(){return _0x4e94cf;});}else{return _0x4e94cf;}})['catch'](function(_0x51644d){logger[_0xc06d('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x51644d);throw _0x51644d;});}return _0x4e94cf;})['then'](respondWithResult(_0x14fb49,0xc9))[_0xc06d('0x46')](handleError(_0x14fb49,null));};exports[_0xc06d('0x55')]=function(_0x51b454,_0x4a0002){if(_0x51b454[_0xc06d('0x4a')]['id']){delete _0x51b454[_0xc06d('0x4a')]['id'];}return db[_0xc06d('0x41')][_0xc06d('0x50')]({'where':{'id':_0x51b454[_0xc06d('0x56')]['id']}})[_0xc06d('0x26')](handleEntityNotFound(_0x4a0002,null))[_0xc06d('0x26')](saveUpdates(_0x51b454[_0xc06d('0x4a')],null))['then'](respondWithResult(_0x4a0002,null))['catch'](handleError(_0x4a0002,null));};exports['destroy']=function(_0x9c9505,_0x86a149){return db[_0xc06d('0x41')][_0xc06d('0x50')]({'where':{'id':_0x9c9505[_0xc06d('0x56')]['id']}})[_0xc06d('0x26')](handleEntityNotFound(_0x86a149,null))['then'](removeEntity(_0x86a149,null))['catch'](handleError(_0x86a149,null));}; \ No newline at end of file +var _0x56a3=['type','model','query','keys','filters','intersection','attributes','fields','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','params','length','find','create','body','user','get','role','UserProfileSection','UserProfileResource','catch','update','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','then','destroy','CmHopperAdditionalPhones','error','name','send','index','map','CmHopperAdditionalPhone','rawAttributes','fieldName'];(function(_0x3fbbe3,_0x11ebc2){var _0xdb7986=function(_0x76e8e9){while(--_0x76e8e9){_0x3fbbe3['push'](_0x3fbbe3['shift']());}};_0xdb7986(++_0x11ebc2);}(_0x56a3,0x15b));var _0x356a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x56a3[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x356a('0x0'));var zipdir=require(_0x356a('0x1'));var jsonpatch=require(_0x356a('0x2'));var rp=require(_0x356a('0x3'));var moment=require(_0x356a('0x4'));var BPromise=require(_0x356a('0x5'));var Mustache=require(_0x356a('0x6'));var util=require(_0x356a('0x7'));var path=require(_0x356a('0x8'));var sox=require('sox');var csv=require(_0x356a('0x9'));var ejs=require(_0x356a('0xa'));var fs=require('fs');var fs_extra=require(_0x356a('0xb'));var _=require(_0x356a('0xc'));var squel=require(_0x356a('0xd'));var crypto=require(_0x356a('0xe'));var jsforce=require(_0x356a('0xf'));var deskjs=require(_0x356a('0x10'));var toCsv=require(_0x356a('0x9'));var querystring=require(_0x356a('0x11'));var Papa=require(_0x356a('0x12'));var Redis=require(_0x356a('0x13'));var authService=require(_0x356a('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x356a('0x15'));var hardwareService=require(_0x356a('0x16'));var logger=require(_0x356a('0x17'))('api');var utils=require(_0x356a('0x18'));var config=require(_0x356a('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x356a('0x1a'))['db'];function respondWithStatusCode(_0x4e00b9,_0x161bde){_0x161bde=_0x161bde||0xcc;return function(_0x45ba77){if(_0x45ba77){return _0x4e00b9[_0x356a('0x1b')](_0x161bde);}return _0x4e00b9[_0x356a('0x1c')](_0x161bde)[_0x356a('0x1d')]();};}function respondWithResult(_0x9593b9,_0x14ebfb){_0x14ebfb=_0x14ebfb||0xc8;return function(_0x1f97ec){if(_0x1f97ec){return _0x9593b9['status'](_0x14ebfb)[_0x356a('0x1e')](_0x1f97ec);}};}function respondWithFilteredResult(_0x420232,_0x44096a){return function(_0x5c34eb){if(_0x5c34eb){var _0x439205=typeof _0x44096a[_0x356a('0x1f')]==='undefined'&&typeof _0x44096a[_0x356a('0x20')]===_0x356a('0x21');var _0x3f36fd=_0x5c34eb[_0x356a('0x22')];var _0x14a2cb=_0x439205?0x0:_0x44096a[_0x356a('0x1f')];var _0x168c8a=_0x439205?_0x5c34eb[_0x356a('0x22')]:_0x44096a[_0x356a('0x1f')]+_0x44096a[_0x356a('0x20')];var _0x297b9e;if(_0x168c8a>=_0x3f36fd){_0x168c8a=_0x3f36fd;_0x297b9e=0xc8;}else{_0x297b9e=0xce;}_0x420232[_0x356a('0x1c')](_0x297b9e);return _0x420232['set'](_0x356a('0x23'),_0x14a2cb+'-'+_0x168c8a+'/'+_0x3f36fd)['json'](_0x5c34eb);}return null;};}function patchUpdates(_0x196cd7){return function(_0x26ff06){try{jsonpatch[_0x356a('0x24')](_0x26ff06,_0x196cd7,!![]);}catch(_0x41bc93){return BPromise['reject'](_0x41bc93);}return _0x26ff06['save']();};}function saveUpdates(_0x46ced2,_0xb3f9b3){return function(_0x56d200){if(_0x56d200){return _0x56d200['update'](_0x46ced2)[_0x356a('0x25')](function(_0x15e25b){return _0x15e25b;});}return null;};}function removeEntity(_0x5df6e7,_0x4358e9){return function(_0xe300f5){if(_0xe300f5){return _0xe300f5[_0x356a('0x26')]()[_0x356a('0x25')](function(){var _0x154e87=_0xe300f5['get']({'plain':!![]});var _0x447980=_0x356a('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x447980,'resourceId':_0x154e87['id']}})[_0x356a('0x25')](function(){return _0xe300f5;});})[_0x356a('0x25')](function(){_0x5df6e7[_0x356a('0x1c')](0xcc)[_0x356a('0x1d')]();});}};}function handleEntityNotFound(_0x25b7fc,_0x449873){return function(_0x5363be){if(!_0x5363be){_0x25b7fc[_0x356a('0x1b')](0x194);}return _0x5363be;};}function handleError(_0x3c1a4c,_0x53d114){_0x53d114=_0x53d114||0x1f4;return function(_0x40b3fc){logger[_0x356a('0x28')](_0x40b3fc['stack']);if(_0x40b3fc[_0x356a('0x29')]){delete _0x40b3fc['name'];}_0x3c1a4c[_0x356a('0x1c')](_0x53d114)[_0x356a('0x2a')](_0x40b3fc);};}exports[_0x356a('0x2b')]=function(_0x352f58,_0x3d12f7){var _0x5a9d33={},_0x8d4e28={},_0x16fc10={'count':0x0,'rows':[]};var _0x15a27d=_[_0x356a('0x2c')](db[_0x356a('0x2d')][_0x356a('0x2e')],function(_0x2f1993){return{'name':_0x2f1993[_0x356a('0x2f')],'type':_0x2f1993[_0x356a('0x30')]['key']};});_0x8d4e28[_0x356a('0x31')]=_[_0x356a('0x2c')](_0x15a27d,'name');_0x8d4e28[_0x356a('0x32')]=_[_0x356a('0x33')](_0x352f58[_0x356a('0x32')]);_0x8d4e28[_0x356a('0x34')]=_[_0x356a('0x35')](_0x8d4e28[_0x356a('0x31')],_0x8d4e28['query']);_0x5a9d33[_0x356a('0x36')]=_['intersection'](_0x8d4e28[_0x356a('0x31')],qs[_0x356a('0x37')](_0x352f58[_0x356a('0x32')]['fields']));_0x5a9d33[_0x356a('0x36')]=_0x5a9d33['attributes']['length']?_0x5a9d33[_0x356a('0x36')]:_0x8d4e28[_0x356a('0x31')];if(!_0x352f58[_0x356a('0x32')]['hasOwnProperty']('nolimit')){_0x5a9d33[_0x356a('0x20')]=qs['limit'](_0x352f58[_0x356a('0x32')][_0x356a('0x20')]);_0x5a9d33[_0x356a('0x1f')]=qs['offset'](_0x352f58[_0x356a('0x32')][_0x356a('0x1f')]);}_0x5a9d33['order']=qs[_0x356a('0x38')](_0x352f58[_0x356a('0x32')]['sort']);_0x5a9d33[_0x356a('0x39')]=qs[_0x356a('0x34')](_[_0x356a('0x3a')](_0x352f58[_0x356a('0x32')],_0x8d4e28['filters']),_0x15a27d);if(_0x352f58[_0x356a('0x32')]['filter']){_0x5a9d33[_0x356a('0x39')]=_[_0x356a('0x3b')](_0x5a9d33[_0x356a('0x39')],{'$or':_['map'](_0x15a27d,function(_0x479000){if(_0x479000['type']!==_0x356a('0x3c')){var _0x361301={};_0x361301[_0x479000[_0x356a('0x29')]]={'$like':'%'+_0x352f58[_0x356a('0x32')][_0x356a('0x3d')]+'%'};return _0x361301;}})});}_0x5a9d33=_[_0x356a('0x3b')]({},_0x5a9d33,_0x352f58[_0x356a('0x3e')]);var _0x3ae053={'where':_0x5a9d33[_0x356a('0x39')]};return db[_0x356a('0x2d')][_0x356a('0x22')](_0x3ae053)[_0x356a('0x25')](function(_0x42ff19){_0x16fc10[_0x356a('0x22')]=_0x42ff19;if(_0x352f58['query'][_0x356a('0x3f')]){_0x5a9d33[_0x356a('0x40')]=[{'all':!![]}];}return db[_0x356a('0x2d')][_0x356a('0x41')](_0x5a9d33);})[_0x356a('0x25')](function(_0x172990){_0x16fc10[_0x356a('0x42')]=_0x172990;return _0x16fc10;})['then'](respondWithFilteredResult(_0x3d12f7,_0x5a9d33))['catch'](handleError(_0x3d12f7,null));};exports['show']=function(_0x165ead,_0x505b90){var _0x2f4d67={'raw':!![],'where':{'id':_0x165ead[_0x356a('0x43')]['id']}},_0x58fbf5={};_0x58fbf5['model']=_['keys'](db[_0x356a('0x2d')]['rawAttributes']);_0x58fbf5['query']=_[_0x356a('0x33')](_0x165ead[_0x356a('0x32')]);_0x58fbf5[_0x356a('0x34')]=_['intersection'](_0x58fbf5[_0x356a('0x31')],_0x58fbf5[_0x356a('0x32')]);_0x2f4d67['attributes']=_['intersection'](_0x58fbf5[_0x356a('0x31')],qs[_0x356a('0x37')](_0x165ead[_0x356a('0x32')]['fields']));_0x2f4d67[_0x356a('0x36')]=_0x2f4d67[_0x356a('0x36')][_0x356a('0x44')]?_0x2f4d67[_0x356a('0x36')]:_0x58fbf5['model'];if(_0x165ead['query'][_0x356a('0x3f')]){_0x2f4d67[_0x356a('0x40')]=[{'all':!![]}];}_0x2f4d67=_['merge']({},_0x2f4d67,_0x165ead[_0x356a('0x3e')]);return db[_0x356a('0x2d')][_0x356a('0x45')](_0x2f4d67)[_0x356a('0x25')](handleEntityNotFound(_0x505b90,null))[_0x356a('0x25')](respondWithResult(_0x505b90,null))['catch'](handleError(_0x505b90,null));};exports[_0x356a('0x46')]=function(_0x3b8f50,_0x27ea7d){return db[_0x356a('0x2d')]['create'](_0x3b8f50[_0x356a('0x47')],{})['then'](function(_0x3d755d){var _0xf0450f=_0x3b8f50[_0x356a('0x48')][_0x356a('0x49')]({'plain':!![]});if(!_0xf0450f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xf0450f[_0x356a('0x4a')]===_0x356a('0x48')){var _0x1472c0=_0x3d755d[_0x356a('0x49')]({'plain':!![]});var _0x385ed0='CmHopperAdditionalPhones';return db[_0x356a('0x4b')][_0x356a('0x45')]({'where':{'name':_0x385ed0,'userProfileId':_0xf0450f['userProfileId']},'raw':!![]})['then'](function(_0x3b37bc){if(_0x3b37bc&&_0x3b37bc['autoAssociation']===0x0){return db[_0x356a('0x4c')][_0x356a('0x46')]({'name':_0x1472c0[_0x356a('0x29')],'resourceId':_0x1472c0['id'],'type':_0x3b37bc['name'],'sectionId':_0x3b37bc['id']},{})[_0x356a('0x25')](function(){return _0x3d755d;});}else{return _0x3d755d;}})[_0x356a('0x4d')](function(_0x162a07){logger[_0x356a('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x162a07);throw _0x162a07;});}return _0x3d755d;})[_0x356a('0x25')](respondWithResult(_0x27ea7d,0xc9))['catch'](handleError(_0x27ea7d,null));};exports[_0x356a('0x4e')]=function(_0x187ad5,_0x1d22c3){if(_0x187ad5['body']['id']){delete _0x187ad5[_0x356a('0x47')]['id'];}return db['CmHopperAdditionalPhone'][_0x356a('0x45')]({'where':{'id':_0x187ad5[_0x356a('0x43')]['id']}})[_0x356a('0x25')](handleEntityNotFound(_0x1d22c3,null))['then'](saveUpdates(_0x187ad5[_0x356a('0x47')],null))[_0x356a('0x25')](respondWithResult(_0x1d22c3,null))['catch'](handleError(_0x1d22c3,null));};exports[_0x356a('0x26')]=function(_0x1da7fd,_0x1d2ddc){return db[_0x356a('0x2d')]['find']({'where':{'id':_0x1da7fd[_0x356a('0x43')]['id']}})['then'](handleEntityNotFound(_0x1d2ddc,null))[_0x356a('0x25')](removeEntity(_0x1d2ddc,null))[_0x356a('0x4d')](handleError(_0x1d2ddc,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index 86e7e0a..b19d191 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 _0x2228=['exports','define','CmHopperAdditionalPhone','cm_hopper_additional_phones','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperAdditionalPhone.attributes'];(function(_0x4e7d25,_0x58285f){var _0x526fe6=function(_0x4f0aec){while(--_0x4f0aec){_0x4e7d25['push'](_0x4e7d25['shift']());}};_0x526fe6(++_0x58285f);}(_0x2228,0x118));var _0x8222=function(_0x42a260,_0x49683b){_0x42a260=_0x42a260-0x0;var _0x515242=_0x2228[_0x42a260];return _0x515242;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8222('0x0'))('api');var moment=require(_0x8222('0x1'));var BPromise=require(_0x8222('0x2'));var rp=require(_0x8222('0x3'));var fs=require('fs');var path=require(_0x8222('0x4'));var rimraf=require(_0x8222('0x5'));var config=require(_0x8222('0x6'));var attributes=require(_0x8222('0x7'));module[_0x8222('0x8')]=function(_0x112114,_0x3852ad){return _0x112114[_0x8222('0x9')](_0x8222('0xa'),attributes,{'tableName':_0x8222('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe1fe=['util','../../config/logger','api','moment','request-promise','path','rimraf','exports','CmHopperAdditionalPhone','cm_hopper_additional_phones'];(function(_0x3c35c0,_0x41e7b4){var _0x14134e=function(_0x5d659b){while(--_0x5d659b){_0x3c35c0['push'](_0x3c35c0['shift']());}};_0x14134e(++_0x41e7b4);}(_0xe1fe,0x190));var _0xee1f=function(_0x451a02,_0x235171){_0x451a02=_0x451a02-0x0;var _0x672175=_0xe1fe[_0x451a02];return _0x672175;};'use strict';var _=require('lodash');var util=require(_0xee1f('0x0'));var logger=require(_0xee1f('0x1'))(_0xee1f('0x2'));var moment=require(_0xee1f('0x3'));var BPromise=require('bluebird');var rp=require(_0xee1f('0x4'));var fs=require('fs');var path=require(_0xee1f('0x5'));var rimraf=require(_0xee1f('0x6'));var config=require('../../config/environment');var attributes=require('./cmHopperAdditionalPhone.attributes');module[_0xee1f('0x7')]=function(_0x8f8934,_0x6eae2c){return _0x8f8934['define'](_0xee1f('0x8'),attributes,{'tableName':_0xee1f('0x9'),'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 0f8e8c6..349b03f 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 _0x68fe=['CmHopper','ContactId','body','ListId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','findOne','OrderBy','ASC','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','entity','countbusyretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','SwapAdditionalPhones','waitTime','duration','isNil','scheduledat','add','minutes','countmachineretry','createdAt','updatedAt','sequelize','transaction','update','phone','activateAdditionalPhone','IncrementPreviewCounters','field','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','VerifyAdditionalPhones'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0x68fe,0x155));var _0xe68f=function(_0x2b0a4a,_0x2f5a81){_0x2b0a4a=_0x2b0a4a-0x0;var _0x10442b=_0x68fe[_0x2b0a4a];return _0x10442b;};'use strict';var _=require(_0xe68f('0x0'));var util=require(_0xe68f('0x1'));var moment=require(_0xe68f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe68f('0x3'));var db=require(_0xe68f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe68f('0x5'))(_0xe68f('0x6'));var config=require(_0xe68f('0x7'));var jayson=require(_0xe68f('0x8'));var client=jayson[_0xe68f('0x9')][_0xe68f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3468c3,_0x343480,_0x8262cb){return new BPromise(function(_0x4519c7,_0x3d1ca2){return client[_0xe68f('0xb')](_0x3468c3,_0x8262cb)[_0xe68f('0xc')](function(_0x259d74){logger[_0xe68f('0xd')](_0xe68f('0xe'),_0x343480,_0xe68f('0xf'));logger[_0xe68f('0x10')](_0xe68f('0x11'),_0x343480,_0xe68f('0xf'),JSON[_0xe68f('0x12')](_0x259d74));if(_0x259d74[_0xe68f('0x13')]){if(_0x259d74[_0xe68f('0x13')][_0xe68f('0x14')]===0x1f4){logger['error']('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x343480,_0x259d74[_0xe68f('0x13')][_0xe68f('0x15')]);return _0x3d1ca2(_0x259d74[_0xe68f('0x13')][_0xe68f('0x15')]);}logger[_0xe68f('0x13')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x343480,_0x259d74[_0xe68f('0x13')][_0xe68f('0x15')]);return _0x4519c7(_0x259d74[_0xe68f('0x13')]['message']);}else{logger['info']('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x343480,_0xe68f('0xf'));_0x4519c7(_0x259d74[_0xe68f('0x16')][_0xe68f('0x15')]);}})[_0xe68f('0x17')](function(_0x240141){logger[_0xe68f('0x13')](_0xe68f('0xe'),_0x343480,_0x240141);_0x3d1ca2(_0x240141);});});}exports[_0xe68f('0x18')]=function(_0x457e9b){var _0x339044=this;return new Promise(function(_0x292dd0,_0x465600){return db[_0xe68f('0x19')]['findOne']({'raw':!![],'where':{'ContactId':_0x457e9b['body'][_0xe68f('0x1a')],'ListId':_0x457e9b[_0xe68f('0x1b')][_0xe68f('0x1c')],'VoiceQueueId':_0x457e9b[_0xe68f('0x1b')][_0xe68f('0x1d')]===undefined?null:_0x457e9b[_0xe68f('0x1b')][_0xe68f('0x1d')],'CampaignId':_0x457e9b[_0xe68f('0x1b')][_0xe68f('0x1e')]===undefined?null:_0x457e9b[_0xe68f('0x1b')][_0xe68f('0x1e')]}})[_0xe68f('0xc')](function(_0x32e772){if(_0x32e772!=null){return db[_0xe68f('0x1f')][_0xe68f('0x20')]({'raw':!![],'where':{'CmHopperId':_0x32e772['id'],'OrderBy':{'$gt':_0x32e772['OrderBy']}},'order':[[_0xe68f('0x21'),_0xe68f('0x22')]]})[_0xe68f('0xc')](function(_0x25af4b){var _0x46657b=0x0;if(_0x25af4b){if(_0x25af4b['countbusyretry']+_0x25af4b[_0xe68f('0x23')]+_0x25af4b[_0xe68f('0x24')]+_0x25af4b[_0xe68f('0x25')]+_0x25af4b[_0xe68f('0x26')]+_0x25af4b['countabandonedretry']+_0x25af4b['countmachineretry']+_0x25af4b['countagentrejectretry']<_0x457e9b[_0xe68f('0x27')]['dialGlobalMaxRetry'])_0x46657b=0x1;_0x292dd0({'additional':_0x46657b});}else{return db['CmHopperAdditionalPhone']['findOne']({'raw':!![],'where':{'CmHopperId':_0x32e772['id']},'order':[['OrderBy',_0xe68f('0x22')]]})[_0xe68f('0xc')](function(_0x2a0178){var _0xcceef3=0x0;if(_0x2a0178){if(_0x2a0178[_0xe68f('0x28')]+_0x2a0178[_0xe68f('0x23')]+_0x2a0178[_0xe68f('0x24')]+_0x2a0178[_0xe68f('0x25')]+_0x2a0178[_0xe68f('0x26')]+_0x2a0178[_0xe68f('0x29')]+_0x2a0178['countmachineretry']+_0x2a0178[_0xe68f('0x2a')]<_0x457e9b[_0xe68f('0x27')][_0xe68f('0x2b')])_0xcceef3=0x1;_0x292dd0({'additional':_0xcceef3});}else{_0x292dd0({'additional':0x0});}})[_0xe68f('0x17')](function(_0x58004e){logger[_0xe68f('0x13')](_0xe68f('0x18'),_0x58004e[_0xe68f('0x15')]);_0x465600(_0x339044[_0xe68f('0x13')](0x1f4,_0x58004e[_0xe68f('0x15')]));});}})[_0xe68f('0x17')](function(_0xd82d59){logger['error'](_0xe68f('0x18'),_0xd82d59[_0xe68f('0x15')]);_0x465600(_0x339044['error'](0x1f4,_0xd82d59[_0xe68f('0x15')]));});}else _0x292dd0({'additional':0x0});});});};exports[_0xe68f('0x2c')]=function(_0x24ca5c){var _0x2af82a=this;return new Promise(function(_0xe44811,_0x4f611f){return db['CmHopper'][_0xe68f('0x20')]({'raw':!![],'where':{'ContactId':_0x24ca5c['body'][_0xe68f('0x1a')],'ListId':_0x24ca5c[_0xe68f('0x1b')]['ListId'],'VoiceQueueId':_0x24ca5c[_0xe68f('0x1b')][_0xe68f('0x1d')]===undefined?null:_0x24ca5c[_0xe68f('0x1b')][_0xe68f('0x1d')],'CampaignId':_0x24ca5c[_0xe68f('0x1b')][_0xe68f('0x1e')]===undefined?null:_0x24ca5c[_0xe68f('0x1b')]['CampaignId']}})['then'](function(_0x41d6d4){if(_0x41d6d4!=null){return db['CmHopperAdditionalPhone'][_0xe68f('0x20')]({'raw':!![],'where':{'CmHopperId':_0x41d6d4['id'],'OrderBy':{'$gte':_0x41d6d4['OrderBy']}},'order':[[_0xe68f('0x21'),_0xe68f('0x22')]]})[_0xe68f('0xc')](function(_0xa6385f){if(_0xa6385f)return activateAdditionalPhone(_0x41d6d4,_0x24ca5c['body'],_0xa6385f,_0x24ca5c['duration'],_0x24ca5c[_0xe68f('0x2d')])[_0xe68f('0xc')](function(_0x5e9d25){_0xe44811(_0x5e9d25);});else{return db[_0xe68f('0x1f')][_0xe68f('0x20')]({'raw':!![],'where':{'CmHopperId':_0x41d6d4['id']},'order':[['OrderBy',_0xe68f('0x22')]]})[_0xe68f('0xc')](function(_0x59fbdf){if(_0x59fbdf)return activateAdditionalPhone(_0x41d6d4,_0x24ca5c[_0xe68f('0x1b')],_0x59fbdf,_0x24ca5c[_0xe68f('0x2e')],_0x24ca5c[_0xe68f('0x2d')])[_0xe68f('0xc')](function(_0x44e80c){_0xe44811(_0x44e80c);});else{_0xe44811({'id':_0x41d6d4['id'],'phone':''});}})[_0xe68f('0x17')](function(_0x1d9983){logger['error'](_0xe68f('0x18'),_0x1d9983[_0xe68f('0x15')]);_0x4f611f(_0x2af82a[_0xe68f('0x13')](0x1f4,_0x1d9983[_0xe68f('0x15')]));});}})[_0xe68f('0x17')](function(_0x198ada){logger[_0xe68f('0x13')]('VerifyAdditionalPhones',_0x198ada['message']);_0x4f611f(_0x2af82a['error'](0x1f4,_0x198ada[_0xe68f('0x15')]));});}else _0xe44811(0x1);});});};function activateAdditionalPhone(_0x20c78d,_0x48cd40,_0x27559a,_0x100f0a,_0x2b790d){return new Promise(function(_0x3d179f,_0x108fdd){var _0x4e2be6;if(_[_0xe68f('0x2f')](_0x27559a[_0xe68f('0x30')])){_0x27559a[_0xe68f('0x30')]=moment();}if(moment()>moment(_0x27559a[_0xe68f('0x30')])){_0x4e2be6=moment()[_0xe68f('0x31')](_0x2b790d||0x3,_0xe68f('0x32'));}else{if(_0x27559a['OrderBy']==0x0){_0x4e2be6=moment(_0x27559a[_0xe68f('0x30')]);}else{_0x4e2be6=moment()[_0xe68f('0x31')](_0x2b790d||0x3,'minutes');}}if(_['isNil'](_0x4e2be6)){_0x4e2be6=moment()[_0xe68f('0x31')](_0x2b790d||0x3,'minutes');}var _0x117f53={'phone':_0x20c78d['phone'],'active':0x0,'OrderBy':_[_0xe68f('0x2f')](_0x20c78d[_0xe68f('0x21')])?0x0:_0x20c78d[_0xe68f('0x21')],'scheduledat':moment()[_0xe68f('0x31')](_0x100f0a||0x1,_0xe68f('0x32')),'countbusyretry':_0x48cd40[_0xe68f('0x28')],'countcongestionretry':_0x48cd40[_0xe68f('0x23')],'countnoanswerretry':_0x48cd40[_0xe68f('0x24')],'countnosuchnumberretry':_0x48cd40['countnosuchnumberretry'],'countdropretry':_0x48cd40[_0xe68f('0x26')],'countabandonedretry':_0x48cd40[_0xe68f('0x29')],'countmachineretry':_0x48cd40[_0xe68f('0x33')],'countagentrejectretry':_0x48cd40[_0xe68f('0x2a')],'createdAt':_0x48cd40[_0xe68f('0x34')],'updatedAt':_0x48cd40[_0xe68f('0x35')]};var _0x33e4d5={'CmHopperId':_0x20c78d['id'],'phone':_0x27559a['phone'],'active':0x0,'OrderBy':_[_0xe68f('0x2f')](_0x27559a[_0xe68f('0x21')])?0x0:_0x27559a[_0xe68f('0x21')],'scheduledat':_0x4e2be6,'countbusyretry':_0x27559a[_0xe68f('0x28')],'countcongestionretry':_0x27559a[_0xe68f('0x23')],'countnoanswerretry':_0x27559a[_0xe68f('0x24')],'countnosuchnumberretry':_0x27559a['countnosuchnumberretry'],'countdropretry':_0x27559a['countdropretry'],'countabandonedretry':_0x27559a[_0xe68f('0x29')],'countmachineretry':_0x27559a['countmachineretry'],'countagentrejectretry':_0x27559a['countagentrejectretry'],'createdAt':_0x27559a[_0xe68f('0x34')],'updatedAt':_0x27559a[_0xe68f('0x35')]};return db[_0xe68f('0x36')][_0xe68f('0x37')](function(_0x391f29){return db[_0xe68f('0x1f')][_0xe68f('0x38')](_0x117f53,{'where':{'id':_0x27559a['id']}},{'transaction':_0x391f29})['then'](function(){return db[_0xe68f('0x19')][_0xe68f('0x38')](_0x33e4d5,{'where':{'id':_0x20c78d['id']}},{'transaction':_0x391f29});});})['then'](function(_0x2647cc){_0x3d179f({'id':_0x20c78d['id'],'phone':_0x27559a[_0xe68f('0x39')]});})['catch'](function(_0x1fa9e2){logger[_0xe68f('0x13')](_0xe68f('0x3a'),_0x1fa9e2['message']);_0x108fdd({'error':_0x1fa9e2[_0xe68f('0x15')]});});});}exports[_0xe68f('0x3b')]=function(_0x5b6fb7){var _0x110173=this;return new Promise(function(_0x52d38c,_0x2d8dfc){return db['CmHopper'][_0xe68f('0x38')](_0x5b6fb7[_0xe68f('0x1b')][_0xe68f('0x3c')],{'where':{'id':_0x5b6fb7[_0xe68f('0x1b')]['id']}})[_0xe68f('0xc')](function(_0x5eecba){_0x52d38c(_0x5eecba);})[_0xe68f('0x17')](function(_0x49a85d){logger[_0xe68f('0x13')](_0xe68f('0x3b'),_0x49a85d['message']);_0x2d8dfc(_0x110173[_0xe68f('0x13')](0x1f4,_0x49a85d['message']));});});}; \ No newline at end of file +var _0x3e40=['scheduledat','add','minutes','phone','createdAt','updatedAt','transaction','update','activateAdditionalPhone','IncrementPreviewCounters','field','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','CmHopperAdditionalPhone,\x20%s,\x20%s','message','result','catch','CmHopper','body','ListId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','OrderBy','ASC','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','entity','findOne','countnosuchnumberretry','dialGlobalMaxRetry','VerifyAdditionalPhones','SwapAdditionalPhones','waitTime','duration','isNil'];(function(_0x1da004,_0x3eb503){var _0x1ab396=function(_0x4f2f23){while(--_0x4f2f23){_0x1da004['push'](_0x1da004['shift']());}};_0x1ab396(++_0x3eb503);}(_0x3e40,0xef));var _0x03e4=function(_0x42f009,_0x5e27b1){_0x42f009=_0x42f009-0x0;var _0x22a1e0=_0x3e40[_0x42f009];return _0x22a1e0;};'use strict';var _=require(_0x03e4('0x0'));var util=require('util');var moment=require(_0x03e4('0x1'));var BPromise=require(_0x03e4('0x2'));var rs=require(_0x03e4('0x3'));var fs=require('fs');var Redis=require(_0x03e4('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x03e4('0x5'));var logger=require(_0x03e4('0x6'))('rpc');var config=require(_0x03e4('0x7'));var jayson=require(_0x03e4('0x8'));var client=jayson[_0x03e4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x453eca,_0x167f14,_0x2fc58c){return new BPromise(function(_0xecde64,_0x512ec0){return client[_0x03e4('0xa')](_0x453eca,_0x2fc58c)[_0x03e4('0xb')](function(_0xcdcbd7){logger[_0x03e4('0xc')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x167f14,'request\x20sent');logger[_0x03e4('0xd')](_0x03e4('0xe'),_0x167f14,_0x03e4('0xf'),JSON['stringify'](_0xcdcbd7));if(_0xcdcbd7[_0x03e4('0x10')]){if(_0xcdcbd7[_0x03e4('0x10')][_0x03e4('0x11')]===0x1f4){logger[_0x03e4('0x10')](_0x03e4('0x12'),_0x167f14,_0xcdcbd7[_0x03e4('0x10')][_0x03e4('0x13')]);return _0x512ec0(_0xcdcbd7[_0x03e4('0x10')][_0x03e4('0x13')]);}logger[_0x03e4('0x10')](_0x03e4('0x12'),_0x167f14,_0xcdcbd7[_0x03e4('0x10')]['message']);return _0xecde64(_0xcdcbd7[_0x03e4('0x10')][_0x03e4('0x13')]);}else{logger['info'](_0x03e4('0x12'),_0x167f14,'request\x20sent');_0xecde64(_0xcdcbd7[_0x03e4('0x14')][_0x03e4('0x13')]);}})[_0x03e4('0x15')](function(_0x35ca7c){logger[_0x03e4('0x10')](_0x03e4('0x12'),_0x167f14,_0x35ca7c);_0x512ec0(_0x35ca7c);});});}exports['VerifyAdditionalPhones']=function(_0x4c28ed){var _0x6c4518=this;return new Promise(function(_0x414978,_0x2244e7){return db[_0x03e4('0x16')]['findOne']({'raw':!![],'where':{'ContactId':_0x4c28ed[_0x03e4('0x17')]['ContactId'],'ListId':_0x4c28ed[_0x03e4('0x17')][_0x03e4('0x18')],'VoiceQueueId':_0x4c28ed['body'][_0x03e4('0x19')]===undefined?null:_0x4c28ed[_0x03e4('0x17')][_0x03e4('0x19')],'CampaignId':_0x4c28ed[_0x03e4('0x17')][_0x03e4('0x1a')]===undefined?null:_0x4c28ed[_0x03e4('0x17')][_0x03e4('0x1a')]}})['then'](function(_0x2dd6d7){if(_0x2dd6d7!=null){return db[_0x03e4('0x1b')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x2dd6d7['id'],'OrderBy':{'$gt':_0x2dd6d7[_0x03e4('0x1c')]}},'order':[[_0x03e4('0x1c'),_0x03e4('0x1d')]]})['then'](function(_0x3afe5c){var _0x3e61ce=0x0;if(_0x3afe5c){if(_0x3afe5c[_0x03e4('0x1e')]+_0x3afe5c[_0x03e4('0x1f')]+_0x3afe5c[_0x03e4('0x20')]+_0x3afe5c['countnosuchnumberretry']+_0x3afe5c[_0x03e4('0x21')]+_0x3afe5c[_0x03e4('0x22')]+_0x3afe5c[_0x03e4('0x23')]+_0x3afe5c[_0x03e4('0x24')]<_0x4c28ed[_0x03e4('0x25')]['dialGlobalMaxRetry'])_0x3e61ce=0x1;_0x414978({'additional':_0x3e61ce});}else{return db['CmHopperAdditionalPhone'][_0x03e4('0x26')]({'raw':!![],'where':{'CmHopperId':_0x2dd6d7['id']},'order':[[_0x03e4('0x1c'),'ASC']]})[_0x03e4('0xb')](function(_0x26cf1d){var _0x20c2d0=0x0;if(_0x26cf1d){if(_0x26cf1d['countbusyretry']+_0x26cf1d[_0x03e4('0x1f')]+_0x26cf1d[_0x03e4('0x20')]+_0x26cf1d[_0x03e4('0x27')]+_0x26cf1d[_0x03e4('0x21')]+_0x26cf1d['countabandonedretry']+_0x26cf1d[_0x03e4('0x23')]+_0x26cf1d[_0x03e4('0x24')]<_0x4c28ed[_0x03e4('0x25')][_0x03e4('0x28')])_0x20c2d0=0x1;_0x414978({'additional':_0x20c2d0});}else{_0x414978({'additional':0x0});}})['catch'](function(_0x4d5210){logger[_0x03e4('0x10')](_0x03e4('0x29'),_0x4d5210[_0x03e4('0x13')]);_0x2244e7(_0x6c4518[_0x03e4('0x10')](0x1f4,_0x4d5210[_0x03e4('0x13')]));});}})[_0x03e4('0x15')](function(_0x230d46){logger[_0x03e4('0x10')](_0x03e4('0x29'),_0x230d46[_0x03e4('0x13')]);_0x2244e7(_0x6c4518[_0x03e4('0x10')](0x1f4,_0x230d46[_0x03e4('0x13')]));});}else _0x414978({'additional':0x0});});});};exports[_0x03e4('0x2a')]=function(_0x1d779c){var _0x581067=this;return new Promise(function(_0x272425,_0x471c65){return db['CmHopper']['findOne']({'raw':!![],'where':{'ContactId':_0x1d779c[_0x03e4('0x17')]['ContactId'],'ListId':_0x1d779c[_0x03e4('0x17')][_0x03e4('0x18')],'VoiceQueueId':_0x1d779c[_0x03e4('0x17')][_0x03e4('0x19')]===undefined?null:_0x1d779c['body'][_0x03e4('0x19')],'CampaignId':_0x1d779c[_0x03e4('0x17')][_0x03e4('0x1a')]===undefined?null:_0x1d779c[_0x03e4('0x17')][_0x03e4('0x1a')]}})[_0x03e4('0xb')](function(_0x5c0727){if(_0x5c0727!=null){return db[_0x03e4('0x1b')][_0x03e4('0x26')]({'raw':!![],'where':{'CmHopperId':_0x5c0727['id'],'OrderBy':{'$gte':_0x5c0727[_0x03e4('0x1c')]}},'order':[[_0x03e4('0x1c'),_0x03e4('0x1d')]]})[_0x03e4('0xb')](function(_0x1bf8e1){if(_0x1bf8e1)return activateAdditionalPhone(_0x5c0727,_0x1d779c[_0x03e4('0x17')],_0x1bf8e1,_0x1d779c['duration'],_0x1d779c[_0x03e4('0x2b')])[_0x03e4('0xb')](function(_0x1d3037){_0x272425(_0x1d3037);});else{return db[_0x03e4('0x1b')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x5c0727['id']},'order':[['OrderBy',_0x03e4('0x1d')]]})[_0x03e4('0xb')](function(_0x5a41e8){if(_0x5a41e8)return activateAdditionalPhone(_0x5c0727,_0x1d779c['body'],_0x5a41e8,_0x1d779c[_0x03e4('0x2c')],_0x1d779c[_0x03e4('0x2b')])[_0x03e4('0xb')](function(_0x4a5d31){_0x272425(_0x4a5d31);});else{_0x272425({'id':_0x5c0727['id'],'phone':''});}})[_0x03e4('0x15')](function(_0x45d3e5){logger[_0x03e4('0x10')](_0x03e4('0x29'),_0x45d3e5[_0x03e4('0x13')]);_0x471c65(_0x581067[_0x03e4('0x10')](0x1f4,_0x45d3e5['message']));});}})[_0x03e4('0x15')](function(_0x43bbb0){logger[_0x03e4('0x10')](_0x03e4('0x29'),_0x43bbb0[_0x03e4('0x13')]);_0x471c65(_0x581067['error'](0x1f4,_0x43bbb0['message']));});}else _0x272425(0x1);});});};function activateAdditionalPhone(_0x46fcd2,_0x2788ce,_0x398f12,_0x173390,_0x26e54c){return new Promise(function(_0x5306ec,_0x176ad6){var _0xacdf3a;if(_[_0x03e4('0x2d')](_0x398f12['scheduledat'])){_0x398f12[_0x03e4('0x2e')]=moment();}if(moment()>moment(_0x398f12[_0x03e4('0x2e')])){_0xacdf3a=moment()[_0x03e4('0x2f')](_0x26e54c||0x3,_0x03e4('0x30'));}else{if(_0x398f12[_0x03e4('0x1c')]==0x0){_0xacdf3a=moment(_0x398f12[_0x03e4('0x2e')]);}else{_0xacdf3a=moment()[_0x03e4('0x2f')](_0x26e54c||0x3,'minutes');}}if(_[_0x03e4('0x2d')](_0xacdf3a)){_0xacdf3a=moment()['add'](_0x26e54c||0x3,_0x03e4('0x30'));}var _0x303242={'phone':_0x46fcd2[_0x03e4('0x31')],'active':0x0,'OrderBy':_['isNil'](_0x46fcd2['OrderBy'])?0x0:_0x46fcd2['OrderBy'],'scheduledat':moment()[_0x03e4('0x2f')](_0x173390||0x1,_0x03e4('0x30')),'countbusyretry':_0x2788ce[_0x03e4('0x1e')],'countcongestionretry':_0x2788ce['countcongestionretry'],'countnoanswerretry':_0x2788ce[_0x03e4('0x20')],'countnosuchnumberretry':_0x2788ce[_0x03e4('0x27')],'countdropretry':_0x2788ce['countdropretry'],'countabandonedretry':_0x2788ce[_0x03e4('0x22')],'countmachineretry':_0x2788ce[_0x03e4('0x23')],'countagentrejectretry':_0x2788ce['countagentrejectretry'],'createdAt':_0x2788ce[_0x03e4('0x32')],'updatedAt':_0x2788ce[_0x03e4('0x33')]};var _0x577c47={'CmHopperId':_0x46fcd2['id'],'phone':_0x398f12[_0x03e4('0x31')],'active':0x0,'OrderBy':_[_0x03e4('0x2d')](_0x398f12[_0x03e4('0x1c')])?0x0:_0x398f12[_0x03e4('0x1c')],'scheduledat':_0xacdf3a,'countbusyretry':_0x398f12['countbusyretry'],'countcongestionretry':_0x398f12[_0x03e4('0x1f')],'countnoanswerretry':_0x398f12[_0x03e4('0x20')],'countnosuchnumberretry':_0x398f12[_0x03e4('0x27')],'countdropretry':_0x398f12[_0x03e4('0x21')],'countabandonedretry':_0x398f12[_0x03e4('0x22')],'countmachineretry':_0x398f12[_0x03e4('0x23')],'countagentrejectretry':_0x398f12[_0x03e4('0x24')],'createdAt':_0x398f12[_0x03e4('0x32')],'updatedAt':_0x398f12[_0x03e4('0x33')]};return db['sequelize'][_0x03e4('0x34')](function(_0x51814a){return db[_0x03e4('0x1b')][_0x03e4('0x35')](_0x303242,{'where':{'id':_0x398f12['id']}},{'transaction':_0x51814a})[_0x03e4('0xb')](function(){return db[_0x03e4('0x16')][_0x03e4('0x35')](_0x577c47,{'where':{'id':_0x46fcd2['id']}},{'transaction':_0x51814a});});})['then'](function(_0x2dc294){_0x5306ec({'id':_0x46fcd2['id'],'phone':_0x398f12[_0x03e4('0x31')]});})['catch'](function(_0x5cccbc){logger[_0x03e4('0x10')](_0x03e4('0x36'),_0x5cccbc['message']);_0x176ad6({'error':_0x5cccbc['message']});});});}exports[_0x03e4('0x37')]=function(_0x141e35){var _0x136e30=this;return new Promise(function(_0x4d8e36,_0x54e6b2){return db['CmHopper'][_0x03e4('0x35')](_0x141e35[_0x03e4('0x17')][_0x03e4('0x38')],{'where':{'id':_0x141e35[_0x03e4('0x17')]['id']}})[_0x03e4('0xb')](function(_0x377b1e){_0x4d8e36(_0x377b1e);})[_0x03e4('0x15')](function(_0x473a7e){logger['error'](_0x03e4('0x37'),_0x473a7e[_0x03e4('0x13')]);_0x54e6b2(_0x136e30[_0x03e4('0x10')](0x1f4,_0x473a7e['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index 03b688f..c8cfff2 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 _0x756e=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports','util','connect-timeout'];(function(_0xbd547b,_0x48e7c0){var _0x29c148=function(_0x25d6cc){while(--_0x25d6cc){_0xbd547b['push'](_0xbd547b['shift']());}};_0x29c148(++_0x48e7c0);}(_0x756e,0x18d));var _0xe756=function(_0x174a91,_0x344a08){_0x174a91=_0x174a91-0x0;var _0x2eba28=_0x756e[_0x174a91];return _0x2eba28;};'use strict';var multer=require('multer');var util=require(_0xe756('0x0'));var path=require('path');var timeout=require(_0xe756('0x1'));var express=require(_0xe756('0x2'));var router=express[_0xe756('0x3')]();var fs_extra=require(_0xe756('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe756('0x5'));var config=require(_0xe756('0x6'));var controller=require(_0xe756('0x7'));router[_0xe756('0x8')]('/',auth[_0xe756('0x9')](),controller[_0xe756('0xa')]);router[_0xe756('0x8')](_0xe756('0xb'),auth[_0xe756('0x9')](),controller[_0xe756('0xc')]);router[_0xe756('0xd')]('/',auth[_0xe756('0x9')](),controller['create']);router[_0xe756('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xe756('0xf')]);router[_0xe756('0x10')]('/:id',auth[_0xe756('0x9')](),controller[_0xe756('0x11')]);module[_0xe756('0x12')]=router; \ No newline at end of file +var _0x0f7f=['update','delete','destroy','exports','multer','util','path','express','fs-extra','../../config/environment','isAuthenticated','get','/:id','show','create'];(function(_0x31a371,_0x50828e){var _0x2a5bd6=function(_0x2fb481){while(--_0x2fb481){_0x31a371['push'](_0x31a371['shift']());}};_0x2a5bd6(++_0x50828e);}(_0x0f7f,0x1e4));var _0xf0f7=function(_0x4c9166,_0xc8d901){_0x4c9166=_0x4c9166-0x0;var _0x10daac=_0x0f7f[_0x4c9166];return _0x10daac;};'use strict';var multer=require(_0xf0f7('0x0'));var util=require(_0xf0f7('0x1'));var path=require(_0xf0f7('0x2'));var timeout=require('connect-timeout');var express=require(_0xf0f7('0x3'));var router=express['Router']();var fs_extra=require(_0xf0f7('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf0f7('0x5'));var controller=require('./cmHopperAdditionalPhone.controller');router['get']('/',auth[_0xf0f7('0x6')](),controller['index']);router[_0xf0f7('0x7')](_0xf0f7('0x8'),auth['isAuthenticated'](),controller[_0xf0f7('0x9')]);router['post']('/',auth[_0xf0f7('0x6')](),controller[_0xf0f7('0xa')]);router['put']('/:id',auth[_0xf0f7('0x6')](),controller[_0xf0f7('0xb')]);router[_0xf0f7('0xc')](_0xf0f7('0x8'),auth[_0xf0f7('0x6')](),controller[_0xf0f7('0xd')]);module[_0xf0f7('0xe')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index a972d86..da98c39 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 _0x187d=['INTEGER','contactListQueue','moment','exports','STRING'];(function(_0x18d430,_0x28f45c){var _0x40fe55=function(_0x9fefa){while(--_0x9fefa){_0x18d430['push'](_0x18d430['shift']());}};_0x40fe55(++_0x28f45c);}(_0x187d,0x93));var _0xd187=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0x187d[_0x220dbb];return _0x2b77de;};'use strict';var moment=require(_0xd187('0x0'));var Sequelize=require('sequelize');module[_0xd187('0x1')]={'phone':{'type':Sequelize[_0xd187('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xd187('0x3')],'unique':_0xd187('0x4')},'ListId':{'type':Sequelize[_0xd187('0x3')],'unique':_0xd187('0x4')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0xd187('0x4')}}; \ No newline at end of file +var _0x36c3=['INTEGER','contactListQueue','moment','sequelize','STRING'];(function(_0x23c6e7,_0x18f28d){var _0x1d9176=function(_0x3311c2){while(--_0x3311c2){_0x23c6e7['push'](_0x23c6e7['shift']());}};_0x1d9176(++_0x18f28d);}(_0x36c3,0x1a6));var _0x336c=function(_0x4a6462,_0x61b1b5){_0x4a6462=_0x4a6462-0x0;var _0x122407=_0x36c3[_0x4a6462];return _0x122407;};'use strict';var moment=require(_0x336c('0x0'));var Sequelize=require(_0x336c('0x1'));module['exports']={'phone':{'type':Sequelize[_0x336c('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x336c('0x3')],'unique':_0x336c('0x4')},'ListId':{'type':Sequelize[_0x336c('0x3')],'unique':_0x336c('0x4')},'VoiceQueueId':{'type':Sequelize[_0x336c('0x3')],'unique':_0x336c('0x4')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 70ec7ef..7a305fb 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 _0xbc69=['rows','catch','show','params','rawAttributes','length','includeAll','find','body','describe','eml-format','zip-dir','moment','bluebird','mustache','util','to-csv','ejs','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','save','update','then','destroy','error','stack','name','send','index','CmHopperBlack','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','include','findAll'];(function(_0x2ac5f8,_0x4c3a9f){var _0x3b8229=function(_0x46a3c0){while(--_0x46a3c0){_0x2ac5f8['push'](_0x2ac5f8['shift']());}};_0x3b8229(++_0x4c3a9f);}(_0xbc69,0xe5));var _0x9bc6=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0xbc69[_0x15bc81];return _0x59440e;};'use strict';var emlformat=require(_0x9bc6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9bc6('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9bc6('0x2'));var BPromise=require(_0x9bc6('0x3'));var Mustache=require(_0x9bc6('0x4'));var util=require(_0x9bc6('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x9bc6('0x6'));var ejs=require(_0x9bc6('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9bc6('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9bc6('0x9'));var deskjs=require(_0x9bc6('0xa'));var toCsv=require(_0x9bc6('0x6'));var querystring=require('querystring');var Papa=require(_0x9bc6('0xb'));var Redis=require(_0x9bc6('0xc'));var authService=require(_0x9bc6('0xd'));var qs=require(_0x9bc6('0xe'));var as=require(_0x9bc6('0xf'));var hardwareService=require(_0x9bc6('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x9bc6('0x11'));var config=require(_0x9bc6('0x12'));var licenseUtil=require(_0x9bc6('0x13'));var db=require(_0x9bc6('0x14'))['db'];function respondWithStatusCode(_0x3f84c5,_0x1709bf){_0x1709bf=_0x1709bf||0xcc;return function(_0x28116b){if(_0x28116b){return _0x3f84c5[_0x9bc6('0x15')](_0x1709bf);}return _0x3f84c5[_0x9bc6('0x16')](_0x1709bf)[_0x9bc6('0x17')]();};}function respondWithResult(_0x5392d9,_0x569dbf){_0x569dbf=_0x569dbf||0xc8;return function(_0x44bf20){if(_0x44bf20){return _0x5392d9[_0x9bc6('0x16')](_0x569dbf)[_0x9bc6('0x18')](_0x44bf20);}};}function respondWithFilteredResult(_0x42db60,_0x4284ec){return function(_0x553b80){if(_0x553b80){var _0x3f8623=typeof _0x4284ec[_0x9bc6('0x19')]===_0x9bc6('0x1a')&&typeof _0x4284ec[_0x9bc6('0x1b')]===_0x9bc6('0x1a');var _0x40d05e=_0x553b80['count'];var _0xaf564e=_0x3f8623?0x0:_0x4284ec[_0x9bc6('0x19')];var _0x276062=_0x3f8623?_0x553b80['count']:_0x4284ec['offset']+_0x4284ec[_0x9bc6('0x1b')];var _0x52f135;if(_0x276062>=_0x40d05e){_0x276062=_0x40d05e;_0x52f135=0xc8;}else{_0x52f135=0xce;}_0x42db60['status'](_0x52f135);return _0x42db60[_0x9bc6('0x1c')](_0x9bc6('0x1d'),_0xaf564e+'-'+_0x276062+'/'+_0x40d05e)['json'](_0x553b80);}return null;};}function patchUpdates(_0x51e614){return function(_0x416efc){try{jsonpatch['apply'](_0x416efc,_0x51e614,!![]);}catch(_0x327c1d){return BPromise['reject'](_0x327c1d);}return _0x416efc[_0x9bc6('0x1e')]();};}function saveUpdates(_0x2a9526,_0x4e512a){return function(_0x3960b0){if(_0x3960b0){return _0x3960b0[_0x9bc6('0x1f')](_0x2a9526)[_0x9bc6('0x20')](function(_0x227977){return _0x227977;});}return null;};}function removeEntity(_0x404244,_0x27bec5){return function(_0x47b5a5){if(_0x47b5a5){return _0x47b5a5[_0x9bc6('0x21')]()[_0x9bc6('0x20')](function(){_0x404244[_0x9bc6('0x16')](0xcc)[_0x9bc6('0x17')]();});}};}function handleEntityNotFound(_0x4240a8,_0x14de1d){return function(_0xfb5c9b){if(!_0xfb5c9b){_0x4240a8[_0x9bc6('0x15')](0x194);}return _0xfb5c9b;};}function handleError(_0x253b66,_0x448859){_0x448859=_0x448859||0x1f4;return function(_0xd830bf){logger[_0x9bc6('0x22')](_0xd830bf[_0x9bc6('0x23')]);if(_0xd830bf[_0x9bc6('0x24')]){delete _0xd830bf['name'];}_0x253b66['status'](_0x448859)[_0x9bc6('0x25')](_0xd830bf);};}exports[_0x9bc6('0x26')]=function(_0x1b686a,_0x2915f6){var _0x4c8013={},_0x54fe53={},_0x381770={'count':0x0,'rows':[]};var _0x575033=_['map'](db[_0x9bc6('0x27')]['rawAttributes'],function(_0x216714){return{'name':_0x216714[_0x9bc6('0x28')],'type':_0x216714[_0x9bc6('0x29')]['key']};});_0x54fe53[_0x9bc6('0x2a')]=_[_0x9bc6('0x2b')](_0x575033,'name');_0x54fe53[_0x9bc6('0x2c')]=_[_0x9bc6('0x2d')](_0x1b686a[_0x9bc6('0x2c')]);_0x54fe53[_0x9bc6('0x2e')]=_[_0x9bc6('0x2f')](_0x54fe53['model'],_0x54fe53['query']);_0x4c8013[_0x9bc6('0x30')]=_[_0x9bc6('0x2f')](_0x54fe53[_0x9bc6('0x2a')],qs[_0x9bc6('0x31')](_0x1b686a[_0x9bc6('0x2c')][_0x9bc6('0x31')]));_0x4c8013[_0x9bc6('0x30')]=_0x4c8013[_0x9bc6('0x30')]['length']?_0x4c8013[_0x9bc6('0x30')]:_0x54fe53[_0x9bc6('0x2a')];if(!_0x1b686a['query'][_0x9bc6('0x32')](_0x9bc6('0x33'))){_0x4c8013[_0x9bc6('0x1b')]=qs[_0x9bc6('0x1b')](_0x1b686a[_0x9bc6('0x2c')]['limit']);_0x4c8013[_0x9bc6('0x19')]=qs[_0x9bc6('0x19')](_0x1b686a[_0x9bc6('0x2c')][_0x9bc6('0x19')]);}_0x4c8013[_0x9bc6('0x34')]=qs[_0x9bc6('0x35')](_0x1b686a[_0x9bc6('0x2c')][_0x9bc6('0x35')]);_0x4c8013[_0x9bc6('0x36')]=qs[_0x9bc6('0x2e')](_[_0x9bc6('0x37')](_0x1b686a[_0x9bc6('0x2c')],_0x54fe53[_0x9bc6('0x2e')]),_0x575033);if(_0x1b686a[_0x9bc6('0x2c')][_0x9bc6('0x38')]){_0x4c8013[_0x9bc6('0x36')]=_[_0x9bc6('0x39')](_0x4c8013['where'],{'$or':_[_0x9bc6('0x2b')](_0x575033,function(_0x362539){if(_0x362539['type']!==_0x9bc6('0x3a')){var _0x392680={};_0x392680[_0x362539['name']]={'$like':'%'+_0x1b686a[_0x9bc6('0x2c')][_0x9bc6('0x38')]+'%'};return _0x392680;}})});}_0x4c8013=_[_0x9bc6('0x39')]({},_0x4c8013,_0x1b686a[_0x9bc6('0x3b')]);var _0x2eefb1={'where':_0x4c8013[_0x9bc6('0x36')]};return db[_0x9bc6('0x27')][_0x9bc6('0x3c')](_0x2eefb1)[_0x9bc6('0x20')](function(_0x208ef3){_0x381770[_0x9bc6('0x3c')]=_0x208ef3;if(_0x1b686a[_0x9bc6('0x2c')]['includeAll']){_0x4c8013[_0x9bc6('0x3d')]=[{'all':!![]}];}return db[_0x9bc6('0x27')][_0x9bc6('0x3e')](_0x4c8013);})[_0x9bc6('0x20')](function(_0x5e5143){_0x381770[_0x9bc6('0x3f')]=_0x5e5143;return _0x381770;})[_0x9bc6('0x20')](respondWithFilteredResult(_0x2915f6,_0x4c8013))[_0x9bc6('0x40')](handleError(_0x2915f6,null));};exports[_0x9bc6('0x41')]=function(_0x1f9aba,_0xaa0cbb){var _0x2d4b8a={'raw':!![],'where':{'id':_0x1f9aba[_0x9bc6('0x42')]['id']}},_0x1c8434={};_0x1c8434[_0x9bc6('0x2a')]=_[_0x9bc6('0x2d')](db['CmHopperBlack'][_0x9bc6('0x43')]);_0x1c8434['query']=_[_0x9bc6('0x2d')](_0x1f9aba[_0x9bc6('0x2c')]);_0x1c8434[_0x9bc6('0x2e')]=_[_0x9bc6('0x2f')](_0x1c8434['model'],_0x1c8434[_0x9bc6('0x2c')]);_0x2d4b8a[_0x9bc6('0x30')]=_['intersection'](_0x1c8434['model'],qs[_0x9bc6('0x31')](_0x1f9aba['query'][_0x9bc6('0x31')]));_0x2d4b8a['attributes']=_0x2d4b8a[_0x9bc6('0x30')][_0x9bc6('0x44')]?_0x2d4b8a[_0x9bc6('0x30')]:_0x1c8434[_0x9bc6('0x2a')];if(_0x1f9aba[_0x9bc6('0x2c')][_0x9bc6('0x45')]){_0x2d4b8a[_0x9bc6('0x3d')]=[{'all':!![]}];}_0x2d4b8a=_['merge']({},_0x2d4b8a,_0x1f9aba['options']);return db['CmHopperBlack'][_0x9bc6('0x46')](_0x2d4b8a)[_0x9bc6('0x20')](handleEntityNotFound(_0xaa0cbb,null))[_0x9bc6('0x20')](respondWithResult(_0xaa0cbb,null))[_0x9bc6('0x40')](handleError(_0xaa0cbb,null));};exports[_0x9bc6('0x1f')]=function(_0x39853f,_0x23147a){if(_0x39853f[_0x9bc6('0x47')]['id']){delete _0x39853f['body']['id'];}return db[_0x9bc6('0x27')][_0x9bc6('0x46')]({'where':{'id':_0x39853f[_0x9bc6('0x42')]['id']}})['then'](handleEntityNotFound(_0x23147a,null))[_0x9bc6('0x20')](saveUpdates(_0x39853f[_0x9bc6('0x47')],null))[_0x9bc6('0x20')](respondWithResult(_0x23147a,null))[_0x9bc6('0x40')](handleError(_0x23147a,null));};exports[_0x9bc6('0x21')]=function(_0x8e5464,_0x13e844){return db['CmHopperBlack'][_0x9bc6('0x46')]({'where':{'id':_0x8e5464[_0x9bc6('0x42')]['id']}})[_0x9bc6('0x20')](handleEntityNotFound(_0x13e844,null))[_0x9bc6('0x20')](removeEntity(_0x13e844,null))[_0x9bc6('0x40')](handleError(_0x13e844,null));};exports[_0x9bc6('0x48')]=function(_0x7bba1f,_0x289733){return db['CmHopperBlack']['describe']()['then'](respondWithResult(_0x289733,null))[_0x9bc6('0x40')](handleError(_0x289733,null));}; \ No newline at end of file +var _0xd2e0=['path','sox','to-csv','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','json','offset','undefined','count','limit','status','Content-Range','apply','reject','save','update','destroy','stack','name','send','map','CmHopperBlack','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','then','includeAll','include','findAll','rows','catch','show','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util'];(function(_0x539c28,_0x22ce8a){var _0x476aa8=function(_0x557993){while(--_0x557993){_0x539c28['push'](_0x539c28['shift']());}};_0x476aa8(++_0x22ce8a);}(_0xd2e0,0x174));var _0x0d2e=function(_0x2c8bbc,_0x1bc521){_0x2c8bbc=_0x2c8bbc-0x0;var _0x15dfa3=_0xd2e0[_0x2c8bbc];return _0x15dfa3;};'use strict';var emlformat=require(_0x0d2e('0x0'));var rimraf=require(_0x0d2e('0x1'));var zipdir=require(_0x0d2e('0x2'));var jsonpatch=require(_0x0d2e('0x3'));var rp=require('request-promise');var moment=require(_0x0d2e('0x4'));var BPromise=require(_0x0d2e('0x5'));var Mustache=require(_0x0d2e('0x6'));var util=require(_0x0d2e('0x7'));var path=require(_0x0d2e('0x8'));var sox=require(_0x0d2e('0x9'));var csv=require(_0x0d2e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0d2e('0xb'));var _=require(_0x0d2e('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0d2e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x0d2e('0xa'));var querystring=require(_0x0d2e('0xe'));var Papa=require(_0x0d2e('0xf'));var Redis=require(_0x0d2e('0x10'));var authService=require(_0x0d2e('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x0d2e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0d2e('0x13'))(_0x0d2e('0x14'));var utils=require(_0x0d2e('0x15'));var config=require(_0x0d2e('0x16'));var licenseUtil=require(_0x0d2e('0x17'));var db=require(_0x0d2e('0x18'))['db'];function respondWithStatusCode(_0x416264,_0x179d6f){_0x179d6f=_0x179d6f||0xcc;return function(_0x4535d9){if(_0x4535d9){return _0x416264['sendStatus'](_0x179d6f);}return _0x416264['status'](_0x179d6f)[_0x0d2e('0x19')]();};}function respondWithResult(_0x168fde,_0x5bc375){_0x5bc375=_0x5bc375||0xc8;return function(_0x49a210){if(_0x49a210){return _0x168fde['status'](_0x5bc375)[_0x0d2e('0x1a')](_0x49a210);}};}function respondWithFilteredResult(_0x15f230,_0x16a83a){return function(_0x27d384){if(_0x27d384){var _0x5578e4=typeof _0x16a83a[_0x0d2e('0x1b')]===_0x0d2e('0x1c')&&typeof _0x16a83a['limit']===_0x0d2e('0x1c');var _0x324cfe=_0x27d384[_0x0d2e('0x1d')];var _0x3aa44d=_0x5578e4?0x0:_0x16a83a[_0x0d2e('0x1b')];var _0x15c04a=_0x5578e4?_0x27d384[_0x0d2e('0x1d')]:_0x16a83a[_0x0d2e('0x1b')]+_0x16a83a[_0x0d2e('0x1e')];var _0x190630;if(_0x15c04a>=_0x324cfe){_0x15c04a=_0x324cfe;_0x190630=0xc8;}else{_0x190630=0xce;}_0x15f230[_0x0d2e('0x1f')](_0x190630);return _0x15f230['set'](_0x0d2e('0x20'),_0x3aa44d+'-'+_0x15c04a+'/'+_0x324cfe)[_0x0d2e('0x1a')](_0x27d384);}return null;};}function patchUpdates(_0x4961a3){return function(_0x200d77){try{jsonpatch[_0x0d2e('0x21')](_0x200d77,_0x4961a3,!![]);}catch(_0x15c21d){return BPromise[_0x0d2e('0x22')](_0x15c21d);}return _0x200d77[_0x0d2e('0x23')]();};}function saveUpdates(_0x1f40df,_0x2c1b44){return function(_0x3e9e9d){if(_0x3e9e9d){return _0x3e9e9d[_0x0d2e('0x24')](_0x1f40df)['then'](function(_0x442c61){return _0x442c61;});}return null;};}function removeEntity(_0x21cdce,_0x4147b6){return function(_0x392ba2){if(_0x392ba2){return _0x392ba2[_0x0d2e('0x25')]()['then'](function(){_0x21cdce[_0x0d2e('0x1f')](0xcc)[_0x0d2e('0x19')]();});}};}function handleEntityNotFound(_0x48bced,_0x4d0a89){return function(_0x341673){if(!_0x341673){_0x48bced['sendStatus'](0x194);}return _0x341673;};}function handleError(_0x16426c,_0x545e4f){_0x545e4f=_0x545e4f||0x1f4;return function(_0xadb8be){logger['error'](_0xadb8be[_0x0d2e('0x26')]);if(_0xadb8be[_0x0d2e('0x27')]){delete _0xadb8be[_0x0d2e('0x27')];}_0x16426c[_0x0d2e('0x1f')](_0x545e4f)[_0x0d2e('0x28')](_0xadb8be);};}exports['index']=function(_0x48d827,_0x4479f7){var _0x3611ce={},_0x447a3c={},_0x4d9071={'count':0x0,'rows':[]};var _0x683c60=_[_0x0d2e('0x29')](db[_0x0d2e('0x2a')][_0x0d2e('0x2b')],function(_0x2efbcb){return{'name':_0x2efbcb[_0x0d2e('0x2c')],'type':_0x2efbcb[_0x0d2e('0x2d')][_0x0d2e('0x2e')]};});_0x447a3c[_0x0d2e('0x2f')]=_[_0x0d2e('0x29')](_0x683c60,_0x0d2e('0x27'));_0x447a3c[_0x0d2e('0x30')]=_[_0x0d2e('0x31')](_0x48d827['query']);_0x447a3c['filters']=_[_0x0d2e('0x32')](_0x447a3c[_0x0d2e('0x2f')],_0x447a3c[_0x0d2e('0x30')]);_0x3611ce['attributes']=_[_0x0d2e('0x32')](_0x447a3c['model'],qs[_0x0d2e('0x33')](_0x48d827[_0x0d2e('0x30')][_0x0d2e('0x33')]));_0x3611ce['attributes']=_0x3611ce[_0x0d2e('0x34')][_0x0d2e('0x35')]?_0x3611ce[_0x0d2e('0x34')]:_0x447a3c[_0x0d2e('0x2f')];if(!_0x48d827[_0x0d2e('0x30')][_0x0d2e('0x36')](_0x0d2e('0x37'))){_0x3611ce[_0x0d2e('0x1e')]=qs[_0x0d2e('0x1e')](_0x48d827[_0x0d2e('0x30')][_0x0d2e('0x1e')]);_0x3611ce['offset']=qs[_0x0d2e('0x1b')](_0x48d827[_0x0d2e('0x30')]['offset']);}_0x3611ce[_0x0d2e('0x38')]=qs[_0x0d2e('0x39')](_0x48d827['query'][_0x0d2e('0x39')]);_0x3611ce[_0x0d2e('0x3a')]=qs[_0x0d2e('0x3b')](_[_0x0d2e('0x3c')](_0x48d827[_0x0d2e('0x30')],_0x447a3c['filters']),_0x683c60);if(_0x48d827[_0x0d2e('0x30')][_0x0d2e('0x3d')]){_0x3611ce[_0x0d2e('0x3a')]=_['merge'](_0x3611ce[_0x0d2e('0x3a')],{'$or':_['map'](_0x683c60,function(_0x5af910){if(_0x5af910['type']!==_0x0d2e('0x3e')){var _0x21b79b={};_0x21b79b[_0x5af910[_0x0d2e('0x27')]]={'$like':'%'+_0x48d827[_0x0d2e('0x30')][_0x0d2e('0x3d')]+'%'};return _0x21b79b;}})});}_0x3611ce=_[_0x0d2e('0x3f')]({},_0x3611ce,_0x48d827[_0x0d2e('0x40')]);var _0x265b8d={'where':_0x3611ce[_0x0d2e('0x3a')]};return db[_0x0d2e('0x2a')][_0x0d2e('0x1d')](_0x265b8d)[_0x0d2e('0x41')](function(_0x21eb38){_0x4d9071['count']=_0x21eb38;if(_0x48d827[_0x0d2e('0x30')][_0x0d2e('0x42')]){_0x3611ce[_0x0d2e('0x43')]=[{'all':!![]}];}return db[_0x0d2e('0x2a')][_0x0d2e('0x44')](_0x3611ce);})[_0x0d2e('0x41')](function(_0x2ed5ac){_0x4d9071[_0x0d2e('0x45')]=_0x2ed5ac;return _0x4d9071;})['then'](respondWithFilteredResult(_0x4479f7,_0x3611ce))[_0x0d2e('0x46')](handleError(_0x4479f7,null));};exports[_0x0d2e('0x47')]=function(_0x4a5f78,_0x23f0ac){var _0x1e359f={'raw':!![],'where':{'id':_0x4a5f78['params']['id']}},_0x5ddab4={};_0x5ddab4[_0x0d2e('0x2f')]=_[_0x0d2e('0x31')](db[_0x0d2e('0x2a')]['rawAttributes']);_0x5ddab4[_0x0d2e('0x30')]=_[_0x0d2e('0x31')](_0x4a5f78[_0x0d2e('0x30')]);_0x5ddab4[_0x0d2e('0x3b')]=_[_0x0d2e('0x32')](_0x5ddab4[_0x0d2e('0x2f')],_0x5ddab4['query']);_0x1e359f[_0x0d2e('0x34')]=_[_0x0d2e('0x32')](_0x5ddab4['model'],qs[_0x0d2e('0x33')](_0x4a5f78[_0x0d2e('0x30')]['fields']));_0x1e359f['attributes']=_0x1e359f[_0x0d2e('0x34')][_0x0d2e('0x35')]?_0x1e359f[_0x0d2e('0x34')]:_0x5ddab4['model'];if(_0x4a5f78[_0x0d2e('0x30')][_0x0d2e('0x42')]){_0x1e359f[_0x0d2e('0x43')]=[{'all':!![]}];}_0x1e359f=_[_0x0d2e('0x3f')]({},_0x1e359f,_0x4a5f78[_0x0d2e('0x40')]);return db['CmHopperBlack']['find'](_0x1e359f)[_0x0d2e('0x41')](handleEntityNotFound(_0x23f0ac,null))[_0x0d2e('0x41')](respondWithResult(_0x23f0ac,null))[_0x0d2e('0x46')](handleError(_0x23f0ac,null));};exports[_0x0d2e('0x24')]=function(_0x563615,_0x27e1bc){if(_0x563615[_0x0d2e('0x48')]['id']){delete _0x563615[_0x0d2e('0x48')]['id'];}return db['CmHopperBlack'][_0x0d2e('0x49')]({'where':{'id':_0x563615[_0x0d2e('0x4a')]['id']}})[_0x0d2e('0x41')](handleEntityNotFound(_0x27e1bc,null))[_0x0d2e('0x41')](saveUpdates(_0x563615[_0x0d2e('0x48')],null))[_0x0d2e('0x41')](respondWithResult(_0x27e1bc,null))[_0x0d2e('0x46')](handleError(_0x27e1bc,null));};exports['destroy']=function(_0x116c21,_0x1511a8){return db['CmHopperBlack'][_0x0d2e('0x49')]({'where':{'id':_0x116c21[_0x0d2e('0x4a')]['id']}})[_0x0d2e('0x41')](handleEntityNotFound(_0x1511a8,null))[_0x0d2e('0x41')](removeEntity(_0x1511a8,null))[_0x0d2e('0x46')](handleError(_0x1511a8,null));};exports['describe']=function(_0x3cdacf,_0x1ca731){return db['CmHopperBlack'][_0x0d2e('0x4b')]()[_0x0d2e('0x41')](respondWithResult(_0x1ca731,null))[_0x0d2e('0x46')](handleError(_0x1ca731,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index e5ec936..1d14c81 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 _0x1963=['request-promise','path','rimraf','./cmHopperBlack.attributes','define','cm_hopper_black','lodash','util','../../config/logger','moment','bluebird'];(function(_0x97508f,_0xdaad6a){var _0x2b6f9e=function(_0x55e7dc){while(--_0x55e7dc){_0x97508f['push'](_0x97508f['shift']());}};_0x2b6f9e(++_0xdaad6a);}(_0x1963,0x119));var _0x3196=function(_0x598f32,_0x2540d7){_0x598f32=_0x598f32-0x0;var _0x251fbc=_0x1963[_0x598f32];return _0x251fbc;};'use strict';var _=require(_0x3196('0x0'));var util=require(_0x3196('0x1'));var logger=require(_0x3196('0x2'))('api');var moment=require(_0x3196('0x3'));var BPromise=require(_0x3196('0x4'));var rp=require(_0x3196('0x5'));var fs=require('fs');var path=require(_0x3196('0x6'));var rimraf=require(_0x3196('0x7'));var config=require('../../config/environment');var attributes=require(_0x3196('0x8'));module['exports']=function(_0x47df0d,_0x5c5543){return _0x47df0d[_0x3196('0x9')]('CmHopperBlack',attributes,{'tableName':_0x3196('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc2ae=['define','CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperBlack.attributes','exports'];(function(_0x3645cc,_0x25ba47){var _0x351979=function(_0x5829a0){while(--_0x5829a0){_0x3645cc['push'](_0x3645cc['shift']());}};_0x351979(++_0x25ba47);}(_0xc2ae,0x1b5));var _0xec2a=function(_0x4286b5,_0x119da5){_0x4286b5=_0x4286b5-0x0;var _0x24ddb0=_0xc2ae[_0x4286b5];return _0x24ddb0;};'use strict';var _=require(_0xec2a('0x0'));var util=require(_0xec2a('0x1'));var logger=require(_0xec2a('0x2'))('api');var moment=require(_0xec2a('0x3'));var BPromise=require(_0xec2a('0x4'));var rp=require(_0xec2a('0x5'));var fs=require('fs');var path=require(_0xec2a('0x6'));var rimraf=require(_0xec2a('0x7'));var config=require(_0xec2a('0x8'));var attributes=require(_0xec2a('0x9'));module[_0xec2a('0xa')]=function(_0x364835,_0x296955){return _0x364835[_0xec2a('0xb')](_0xec2a('0xc'),attributes,{'tableName':_0xec2a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index d6e1a03..0208f41 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 _0x53b3=['GetCmHopperBlack','UpdateCmHopperBlack','update','body','DestroyCmHopperBlack','lodash','util','bluebird','randomstring','ioredis','rpc','jayson/promise','client','http','request','info','CmHopperBlack,\x20%s,\x20%s','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CmHopperBlack','findAll','options','raw','where','attributes','limit','include','map','model','then'];(function(_0x4044b3,_0x41f94e){var _0x1a5cc6=function(_0x120bd5){while(--_0x120bd5){_0x4044b3['push'](_0x4044b3['shift']());}};_0x1a5cc6(++_0x41f94e);}(_0x53b3,0xb9));var _0x353b=function(_0x3cc679,_0x35a4d8){_0x3cc679=_0x3cc679-0x0;var _0x36e80f=_0x53b3[_0x3cc679];return _0x36e80f;};'use strict';var _=require(_0x353b('0x0'));var util=require(_0x353b('0x1'));var moment=require('moment');var BPromise=require(_0x353b('0x2'));var rs=require(_0x353b('0x3'));var fs=require('fs');var Redis=require(_0x353b('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x353b('0x5'));var config=require('../../config/environment');var jayson=require(_0x353b('0x6'));var client=jayson[_0x353b('0x7')][_0x353b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3a9939,_0x51def0,_0xb9f5f6){return new BPromise(function(_0x362671,_0x458a2a){return client[_0x353b('0x9')](_0x3a9939,_0xb9f5f6)['then'](function(_0x30964f){logger[_0x353b('0xa')](_0x353b('0xb'),_0x51def0,'request\x20sent');logger[_0x353b('0xc')](_0x353b('0xd'),_0x51def0,'request\x20sent',JSON[_0x353b('0xe')](_0x30964f));if(_0x30964f[_0x353b('0xf')]){if(_0x30964f[_0x353b('0xf')][_0x353b('0x10')]===0x1f4){logger['error'](_0x353b('0xb'),_0x51def0,_0x30964f[_0x353b('0xf')][_0x353b('0x11')]);return _0x458a2a(_0x30964f['error'][_0x353b('0x11')]);}logger[_0x353b('0xf')]('CmHopperBlack,\x20%s,\x20%s',_0x51def0,_0x30964f[_0x353b('0xf')]['message']);return _0x362671(_0x30964f[_0x353b('0xf')]['message']);}else{logger[_0x353b('0xa')]('CmHopperBlack,\x20%s,\x20%s',_0x51def0,'request\x20sent');_0x362671(_0x30964f[_0x353b('0x12')][_0x353b('0x11')]);}})[_0x353b('0x13')](function(_0x2feede){logger[_0x353b('0xf')](_0x353b('0xb'),_0x51def0,_0x2feede);_0x458a2a(_0x2feede);});});}exports['GetCmHopperBlack']=function(_0x27e0e2){var _0x34731e=this;return new Promise(function(_0x20a5c5,_0x4d0af2){return db[_0x353b('0x14')][_0x353b('0x15')]({'raw':_0x27e0e2[_0x353b('0x16')]?_0x27e0e2[_0x353b('0x16')][_0x353b('0x17')]===undefined?!![]:![]:!![],'where':_0x27e0e2[_0x353b('0x16')]?_0x27e0e2[_0x353b('0x16')][_0x353b('0x18')]||null:null,'attributes':_0x27e0e2[_0x353b('0x16')]?_0x27e0e2[_0x353b('0x16')][_0x353b('0x19')]||null:null,'limit':_0x27e0e2[_0x353b('0x16')]?_0x27e0e2[_0x353b('0x16')][_0x353b('0x1a')]||null:null,'include':_0x27e0e2[_0x353b('0x16')]?_0x27e0e2[_0x353b('0x16')][_0x353b('0x1b')]?_[_0x353b('0x1c')](_0x27e0e2['options'][_0x353b('0x1b')],function(_0xe03726){return{'model':db[_0xe03726[_0x353b('0x1d')]],'as':_0xe03726['as'],'attributes':_0xe03726[_0x353b('0x19')],'include':_0xe03726[_0x353b('0x1b')]?_[_0x353b('0x1c')](_0xe03726['include'],function(_0x3a5b3a){return{'model':db[_0x3a5b3a['model']],'as':_0x3a5b3a['as'],'attributes':_0x3a5b3a[_0x353b('0x19')],'include':_0x3a5b3a[_0x353b('0x1b')]?_[_0x353b('0x1c')](_0x3a5b3a[_0x353b('0x1b')],function(_0x40207d){return{'model':db[_0x40207d[_0x353b('0x1d')]],'as':_0x40207d['as'],'attributes':_0x40207d[_0x353b('0x19')]};}):[]};}):[]};}):[]:[]})[_0x353b('0x1e')](function(_0x166316){logger[_0x353b('0xa')](_0x353b('0x1f'),_0x27e0e2);logger[_0x353b('0xc')](_0x353b('0x1f'),_0x27e0e2,JSON['stringify'](_0x166316));_0x20a5c5(_0x166316);})[_0x353b('0x13')](function(_0x1a19f4){logger['error'](_0x353b('0x1f'),_0x1a19f4[_0x353b('0x11')],_0x27e0e2);_0x4d0af2(_0x34731e[_0x353b('0xf')](0x1f4,_0x1a19f4[_0x353b('0x11')]));});});};exports[_0x353b('0x20')]=function(_0x3383b1){var _0x152244=this;return new Promise(function(_0xeee229,_0x52556c){return db['CmHopperBlack'][_0x353b('0x21')](_0x3383b1[_0x353b('0x22')],{'raw':_0x3383b1[_0x353b('0x16')]?_0x3383b1[_0x353b('0x16')][_0x353b('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3383b1['options']?_0x3383b1[_0x353b('0x16')]['where']||null:null,'attributes':_0x3383b1[_0x353b('0x16')]?_0x3383b1['options'][_0x353b('0x19')]||null:null,'limit':_0x3383b1['options']?_0x3383b1['options']['limit']||null:null})[_0x353b('0x1e')](function(_0x1a8b7d){logger['info'](_0x353b('0x20'),_0x3383b1);logger[_0x353b('0xc')]('UpdateCmHopperBlack',_0x3383b1,JSON[_0x353b('0xe')](_0x1a8b7d));_0xeee229(_0x1a8b7d);})[_0x353b('0x13')](function(_0x33fc20){logger['error']('UpdateCmHopperBlack',_0x33fc20[_0x353b('0x11')],_0x3383b1);_0x52556c(_0x152244[_0x353b('0xf')](0x1f4,_0x33fc20['message']));});});};exports['DestroyCmHopperBlack']=function(_0x3e873b){var _0x426ff2=this;return new Promise(function(_0x3b66eb,_0x3a61f3){return db[_0x353b('0x14')]['destroy']({'where':_0x3e873b[_0x353b('0x16')]?_0x3e873b['options'][_0x353b('0x18')]||null:null})['then'](function(_0x3a7bb8){logger[_0x353b('0xa')](_0x353b('0x23'),_0x3e873b);logger['debug'](_0x353b('0x23'),_0x3e873b,JSON['stringify'](_0x3a7bb8));_0x3b66eb(_0x3a7bb8);})[_0x353b('0x13')](function(_0x4eda0d){logger[_0x353b('0xf')](_0x353b('0x23'),_0x4eda0d[_0x353b('0x11')],_0x3e873b);_0x3a61f3(_0x426ff2[_0x353b('0xf')](0x1f4,_0x4eda0d[_0x353b('0x11')]));});});}; \ No newline at end of file +var _0xe4b0=['request\x20sent','debug','stringify','error','message','CmHopperBlack,\x20%s,\x20%s','info','result','GetCmHopperBlack','CmHopperBlack','options','where','attributes','limit','map','include','model','UpdateCmHopperBlack','update','raw','catch','destroy','DestroyCmHopperBlack','lodash','util','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','then'];(function(_0x585531,_0x9ee57b){var _0x483bb1=function(_0xb2be88){while(--_0xb2be88){_0x585531['push'](_0x585531['shift']());}};_0x483bb1(++_0x9ee57b);}(_0xe4b0,0x117));var _0x0e4b=function(_0x3d7add,_0x37bdfe){_0x3d7add=_0x3d7add-0x0;var _0x55e63b=_0xe4b0[_0x3d7add];return _0x55e63b;};'use strict';var _=require(_0x0e4b('0x0'));var util=require(_0x0e4b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0e4b('0x2'));var db=require(_0x0e4b('0x3'))['db'];var utils=require(_0x0e4b('0x4'));var logger=require('../../config/logger')(_0x0e4b('0x5'));var config=require(_0x0e4b('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0e4b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5d9479,_0x4bcf11,_0x5dadd6){return new BPromise(function(_0x5a1635,_0x162bf7){return client['request'](_0x5d9479,_0x5dadd6)[_0x0e4b('0x8')](function(_0x482462){logger['info']('CmHopperBlack,\x20%s,\x20%s',_0x4bcf11,_0x0e4b('0x9'));logger[_0x0e4b('0xa')]('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x4bcf11,_0x0e4b('0x9'),JSON[_0x0e4b('0xb')](_0x482462));if(_0x482462[_0x0e4b('0xc')]){if(_0x482462[_0x0e4b('0xc')]['code']===0x1f4){logger[_0x0e4b('0xc')]('CmHopperBlack,\x20%s,\x20%s',_0x4bcf11,_0x482462[_0x0e4b('0xc')]['message']);return _0x162bf7(_0x482462[_0x0e4b('0xc')][_0x0e4b('0xd')]);}logger['error'](_0x0e4b('0xe'),_0x4bcf11,_0x482462[_0x0e4b('0xc')][_0x0e4b('0xd')]);return _0x5a1635(_0x482462['error'][_0x0e4b('0xd')]);}else{logger[_0x0e4b('0xf')](_0x0e4b('0xe'),_0x4bcf11,'request\x20sent');_0x5a1635(_0x482462[_0x0e4b('0x10')]['message']);}})['catch'](function(_0x54be0d){logger[_0x0e4b('0xc')](_0x0e4b('0xe'),_0x4bcf11,_0x54be0d);_0x162bf7(_0x54be0d);});});}exports[_0x0e4b('0x11')]=function(_0x28499c){var _0x5ad580=this;return new Promise(function(_0xed7da,_0x106a98){return db[_0x0e4b('0x12')]['findAll']({'raw':_0x28499c[_0x0e4b('0x13')]?_0x28499c[_0x0e4b('0x13')]['raw']===undefined?!![]:![]:!![],'where':_0x28499c['options']?_0x28499c['options'][_0x0e4b('0x14')]||null:null,'attributes':_0x28499c[_0x0e4b('0x13')]?_0x28499c[_0x0e4b('0x13')][_0x0e4b('0x15')]||null:null,'limit':_0x28499c[_0x0e4b('0x13')]?_0x28499c['options'][_0x0e4b('0x16')]||null:null,'include':_0x28499c['options']?_0x28499c[_0x0e4b('0x13')]['include']?_[_0x0e4b('0x17')](_0x28499c['options'][_0x0e4b('0x18')],function(_0x317e15){return{'model':db[_0x317e15['model']],'as':_0x317e15['as'],'attributes':_0x317e15[_0x0e4b('0x15')],'include':_0x317e15[_0x0e4b('0x18')]?_[_0x0e4b('0x17')](_0x317e15[_0x0e4b('0x18')],function(_0x490a67){return{'model':db[_0x490a67['model']],'as':_0x490a67['as'],'attributes':_0x490a67[_0x0e4b('0x15')],'include':_0x490a67[_0x0e4b('0x18')]?_['map'](_0x490a67[_0x0e4b('0x18')],function(_0x290790){return{'model':db[_0x290790[_0x0e4b('0x19')]],'as':_0x290790['as'],'attributes':_0x290790['attributes']};}):[]};}):[]};}):[]:[]})[_0x0e4b('0x8')](function(_0x523949){logger[_0x0e4b('0xf')](_0x0e4b('0x11'),_0x28499c);logger[_0x0e4b('0xa')](_0x0e4b('0x11'),_0x28499c,JSON[_0x0e4b('0xb')](_0x523949));_0xed7da(_0x523949);})['catch'](function(_0x32002b){logger[_0x0e4b('0xc')](_0x0e4b('0x11'),_0x32002b[_0x0e4b('0xd')],_0x28499c);_0x106a98(_0x5ad580[_0x0e4b('0xc')](0x1f4,_0x32002b[_0x0e4b('0xd')]));});});};exports[_0x0e4b('0x1a')]=function(_0xf4ff6a){var _0x48962d=this;return new Promise(function(_0x3edf98,_0x223b66){return db['CmHopperBlack'][_0x0e4b('0x1b')](_0xf4ff6a['body'],{'raw':_0xf4ff6a[_0x0e4b('0x13')]?_0xf4ff6a['options'][_0x0e4b('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf4ff6a[_0x0e4b('0x13')]?_0xf4ff6a[_0x0e4b('0x13')]['where']||null:null,'attributes':_0xf4ff6a[_0x0e4b('0x13')]?_0xf4ff6a[_0x0e4b('0x13')][_0x0e4b('0x15')]||null:null,'limit':_0xf4ff6a['options']?_0xf4ff6a[_0x0e4b('0x13')]['limit']||null:null})['then'](function(_0x50e628){logger[_0x0e4b('0xf')](_0x0e4b('0x1a'),_0xf4ff6a);logger[_0x0e4b('0xa')](_0x0e4b('0x1a'),_0xf4ff6a,JSON['stringify'](_0x50e628));_0x3edf98(_0x50e628);})[_0x0e4b('0x1d')](function(_0x48c607){logger[_0x0e4b('0xc')](_0x0e4b('0x1a'),_0x48c607[_0x0e4b('0xd')],_0xf4ff6a);_0x223b66(_0x48962d[_0x0e4b('0xc')](0x1f4,_0x48c607['message']));});});};exports['DestroyCmHopperBlack']=function(_0x2d6101){var _0x4f2ad3=this;return new Promise(function(_0x30cd23,_0x47b16a){return db[_0x0e4b('0x12')][_0x0e4b('0x1e')]({'where':_0x2d6101[_0x0e4b('0x13')]?_0x2d6101[_0x0e4b('0x13')][_0x0e4b('0x14')]||null:null})['then'](function(_0xa86769){logger[_0x0e4b('0xf')](_0x0e4b('0x1f'),_0x2d6101);logger[_0x0e4b('0xa')]('DestroyCmHopperBlack',_0x2d6101,JSON[_0x0e4b('0xb')](_0xa86769));_0x30cd23(_0xa86769);})[_0x0e4b('0x1d')](function(_0x670f3a){logger['error'](_0x0e4b('0x1f'),_0x670f3a[_0x0e4b('0xd')],_0x2d6101);_0x47b16a(_0x4f2ad3[_0x0e4b('0xc')](0x1f4,_0x670f3a[_0x0e4b('0xd')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 5fd009a..1176ddf 100644 --- a/server/api/cmHopperBlack/index.js +++ b/server/api/cmHopperBlack/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2eb2=['/describe','describe','/:id','show','put','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index'];(function(_0x544ecd,_0x2325a6){var _0x203865=function(_0x5655e2){while(--_0x5655e2){_0x544ecd['push'](_0x544ecd['shift']());}};_0x203865(++_0x2325a6);}(_0x2eb2,0x19f));var _0x22eb=function(_0x28d18d,_0x55896b){_0x28d18d=_0x28d18d-0x0;var _0x470640=_0x2eb2[_0x28d18d];return _0x470640;};'use strict';var multer=require('multer');var util=require(_0x22eb('0x0'));var path=require(_0x22eb('0x1'));var timeout=require(_0x22eb('0x2'));var express=require(_0x22eb('0x3'));var router=express[_0x22eb('0x4')]();var fs_extra=require(_0x22eb('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x22eb('0x6'));var config=require('../../config/environment');var controller=require('./cmHopperBlack.controller');router[_0x22eb('0x7')]('/',auth[_0x22eb('0x8')](),controller[_0x22eb('0x9')]);router[_0x22eb('0x7')](_0x22eb('0xa'),auth[_0x22eb('0x8')](),controller[_0x22eb('0xb')]);router[_0x22eb('0x7')](_0x22eb('0xc'),auth[_0x22eb('0x8')](),controller[_0x22eb('0xd')]);router[_0x22eb('0xe')]('/:id',auth[_0x22eb('0x8')](),controller['update']);router['delete'](_0x22eb('0xc'),auth['isAuthenticated'](),controller[_0x22eb('0xf')]);module[_0x22eb('0x10')]=router; \ No newline at end of file +var _0x687b=['isAuthenticated','index','/describe','describe','show','put','/:id','update','delete','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get'];(function(_0x199e76,_0x442c6f){var _0x1a640a=function(_0x1a3337){while(--_0x1a3337){_0x199e76['push'](_0x199e76['shift']());}};_0x1a640a(++_0x442c6f);}(_0x687b,0x14a));var _0xb687=function(_0x2d778d,_0x453b15){_0x2d778d=_0x2d778d-0x0;var _0x41d05b=_0x687b[_0x2d778d];return _0x41d05b;};'use strict';var multer=require(_0xb687('0x0'));var util=require(_0xb687('0x1'));var path=require(_0xb687('0x2'));var timeout=require(_0xb687('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xb687('0x4'));var auth=require(_0xb687('0x5'));var interaction=require(_0xb687('0x6'));var config=require(_0xb687('0x7'));var controller=require(_0xb687('0x8'));router[_0xb687('0x9')]('/',auth[_0xb687('0xa')](),controller[_0xb687('0xb')]);router[_0xb687('0x9')](_0xb687('0xc'),auth['isAuthenticated'](),controller[_0xb687('0xd')]);router[_0xb687('0x9')]('/:id',auth[_0xb687('0xa')](),controller[_0xb687('0xe')]);router[_0xb687('0xf')](_0xb687('0x10'),auth[_0xb687('0xa')](),controller[_0xb687('0x11')]);router[_0xb687('0x12')](_0xb687('0x10'),auth[_0xb687('0xa')](),controller['destroy']);module[_0xb687('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index dc31eb4..5bf5523 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 _0x1c0d=['BOOLEAN','sequelize','moment','DATE','INTEGER','STRING','getDataValue','endtime','setDataValue','followuptime','seconds'];(function(_0x52faa2,_0x22309a){var _0x3763b9=function(_0x25758a){while(--_0x25758a){_0x52faa2['push'](_0x52faa2['shift']());}};_0x3763b9(++_0x22309a);}(_0x1c0d,0x114));var _0xd1c0=function(_0x3fd198,_0x1d9588){_0x3fd198=_0x3fd198-0x0;var _0x408e83=_0x1c0d[_0x3fd198];return _0x408e83;};'use strict';var Sequelize=require(_0xd1c0('0x0'));var moment=require(_0xd1c0('0x1'));module['exports']={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0xd1c0('0x2')]},'countbusyretry':{'type':Sequelize[_0xd1c0('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xd1c0('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xd1c0('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xd1c0('0x4')]},'originatecalleridnum':{'type':Sequelize[_0xd1c0('0x4')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xd1c0('0x4')]},'calleridname':{'type':Sequelize[_0xd1c0('0x4')]},'starttime':{'type':Sequelize[_0xd1c0('0x2')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xd1c0('0x2')]},'droptime':{'type':Sequelize[_0xd1c0('0x2')]},'endtime':{'type':Sequelize[_0xd1c0('0x2')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xd1c0('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xd1c0('0x4')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xd1c0('0x4')]},'membername':{'type':Sequelize[_0xd1c0('0x4')]},'reason':{'type':Sequelize[_0xd1c0('0x4')]},'disposition':{'type':Sequelize[_0xd1c0('0x4')]},'secondDisposition':{'type':Sequelize[_0xd1c0('0x4')]},'thirdDisposition':{'type':Sequelize[_0xd1c0('0x4')]},'dispositionat':{'type':Sequelize[_0xd1c0('0x2')],'set':function(_0x3baafc){var _0x975194=this[_0xd1c0('0x5')](_0xd1c0('0x6'));if(_0x975194&&_0x3baafc){this[_0xd1c0('0x7')](_0xd1c0('0x8'),moment(_0x3baafc)['diff'](moment(_0x975194),_0xd1c0('0x9')));}}},'amd':{'type':Sequelize[_0xd1c0('0xa')],'defaultValue':![]},'fax':{'type':Sequelize[_0xd1c0('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xd1c0('0xa')],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xd1c0('0x2')]},'callback':{'type':Sequelize[_0xd1c0('0xa')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xd1c0('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xd1c0('0x2')]},'deleted':{'type':Sequelize[_0xd1c0('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0xd1c0('0xa')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xd1c0('0x2')]},'countnosuchnumberretry':{'type':Sequelize[_0xd1c0('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xd1c0('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xd1c0('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x0cc4=['diff','seconds','BOOLEAN','sequelize','moment','exports','STRING','DATE','INTEGER','getDataValue','endtime','followuptime'];(function(_0x4604ad,_0x2c516e){var _0x3ed8ef=function(_0x2cb13e){while(--_0x2cb13e){_0x4604ad['push'](_0x4604ad['shift']());}};_0x3ed8ef(++_0x2c516e);}(_0x0cc4,0xdb));var _0x40cc=function(_0x487f22,_0x2cc035){_0x487f22=_0x487f22-0x0;var _0x5b8880=_0x0cc4[_0x487f22];return _0x5b8880;};'use strict';var Sequelize=require(_0x40cc('0x0'));var moment=require(_0x40cc('0x1'));module[_0x40cc('0x2')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x40cc('0x3')]},'scheduledat':{'type':Sequelize[_0x40cc('0x4')]},'countbusyretry':{'type':Sequelize[_0x40cc('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x40cc('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x40cc('0x5')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x40cc('0x3')]},'originatecalleridname':{'type':Sequelize[_0x40cc('0x3')]},'calleridnum':{'type':Sequelize[_0x40cc('0x3')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x40cc('0x4')]},'answertime':{'type':Sequelize[_0x40cc('0x4')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x40cc('0x5')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x40cc('0x5')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x40cc('0x5')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x40cc('0x3')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x40cc('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x40cc('0x3')]},'thirdDisposition':{'type':Sequelize[_0x40cc('0x3')]},'dispositionat':{'type':Sequelize[_0x40cc('0x4')],'set':function(_0x5de154){var _0x118ad3=this[_0x40cc('0x6')](_0x40cc('0x7'));if(_0x118ad3&&_0x5de154){this['setDataValue'](_0x40cc('0x8'),moment(_0x5de154)[_0x40cc('0x9')](moment(_0x118ad3),_0x40cc('0xa')));}}},'amd':{'type':Sequelize[_0x40cc('0xb')],'defaultValue':![]},'fax':{'type':Sequelize[_0x40cc('0xb')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x40cc('0x4')]},'callback':{'type':Sequelize[_0x40cc('0xb')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x40cc('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize[_0x40cc('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x40cc('0x4')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x40cc('0x4')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x40cc('0x5')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x40cc('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x40cc('0x5')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x40cc('0x5')],'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 048f26a..d703339 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 _0x3f8a=['rows','catch','show','params','fields','options','find','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','countContactsIvrCampaignHopperFinal','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2022,\x201,\x20null','VoiceQueue','insert','into','fromQuery','phone','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','select','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ListId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','cm_hopper','calleridnum','state\x20=\x204','group','Campaign','scheduledAt','CampaignId','ANY_VALUE(ContactId)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','checkContactHopper','CmHopper','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','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','limit','count','set','reject','save','update','destroy','then','error','name','send','index','map','CmHopperFinal','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll'];(function(_0x3c59fc,_0x10dbd2){var _0x2b78d4=function(_0x5f161a){while(--_0x5f161a){_0x3c59fc['push'](_0x3c59fc['shift']());}};_0x2b78d4(++_0x10dbd2);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x4781c4,_0xb20c9b){_0x4781c4=_0x4781c4-0x0;var _0x2842fa=_0x3f8a[_0x4781c4];return _0x2842fa;};'use strict';var emlformat=require(_0xa3f8('0x0'));var rimraf=require(_0xa3f8('0x1'));var zipdir=require(_0xa3f8('0x2'));var jsonpatch=require(_0xa3f8('0x3'));var rp=require('request-promise');var moment=require(_0xa3f8('0x4'));var BPromise=require(_0xa3f8('0x5'));var Mustache=require(_0xa3f8('0x6'));var util=require(_0xa3f8('0x7'));var path=require(_0xa3f8('0x8'));var sox=require(_0xa3f8('0x9'));var csv=require(_0xa3f8('0xa'));var ejs=require(_0xa3f8('0xb'));var fs=require('fs');var fs_extra=require(_0xa3f8('0xc'));var _=require(_0xa3f8('0xd'));var squel=require(_0xa3f8('0xe'));var crypto=require(_0xa3f8('0xf'));var jsforce=require(_0xa3f8('0x10'));var deskjs=require(_0xa3f8('0x11'));var toCsv=require(_0xa3f8('0xa'));var querystring=require(_0xa3f8('0x12'));var Papa=require(_0xa3f8('0x13'));var Redis=require('ioredis');var authService=require(_0xa3f8('0x14'));var qs=require(_0xa3f8('0x15'));var as=require(_0xa3f8('0x16'));var hardwareService=require(_0xa3f8('0x17'));var logger=require('../../config/logger')(_0xa3f8('0x18'));var utils=require(_0xa3f8('0x19'));var config=require(_0xa3f8('0x1a'));var licenseUtil=require(_0xa3f8('0x1b'));var db=require(_0xa3f8('0x1c'))['db'];function respondWithStatusCode(_0x2e71a0,_0x1afd01){_0x1afd01=_0x1afd01||0xcc;return function(_0x63de8b){if(_0x63de8b){return _0x2e71a0[_0xa3f8('0x1d')](_0x1afd01);}return _0x2e71a0[_0xa3f8('0x1e')](_0x1afd01)[_0xa3f8('0x1f')]();};}function respondWithResult(_0x2c5e15,_0x5b2c33){_0x5b2c33=_0x5b2c33||0xc8;return function(_0x2d8f74){if(_0x2d8f74){return _0x2c5e15[_0xa3f8('0x1e')](_0x5b2c33)[_0xa3f8('0x20')](_0x2d8f74);}};}function respondWithFilteredResult(_0x21a170,_0x5caebf){return function(_0x39c450){if(_0x39c450){var _0x33b98e=typeof _0x5caebf[_0xa3f8('0x21')]===_0xa3f8('0x22')&&typeof _0x5caebf[_0xa3f8('0x23')]===_0xa3f8('0x22');var _0x2f0659=_0x39c450[_0xa3f8('0x24')];var _0x2cb49f=_0x33b98e?0x0:_0x5caebf[_0xa3f8('0x21')];var _0x54b870=_0x33b98e?_0x39c450[_0xa3f8('0x24')]:_0x5caebf['offset']+_0x5caebf[_0xa3f8('0x23')];var _0x3dc3e5;if(_0x54b870>=_0x2f0659){_0x54b870=_0x2f0659;_0x3dc3e5=0xc8;}else{_0x3dc3e5=0xce;}_0x21a170[_0xa3f8('0x1e')](_0x3dc3e5);return _0x21a170[_0xa3f8('0x25')]('Content-Range',_0x2cb49f+'-'+_0x54b870+'/'+_0x2f0659)[_0xa3f8('0x20')](_0x39c450);}return null;};}function patchUpdates(_0x5b0d57){return function(_0x43c393){try{jsonpatch['apply'](_0x43c393,_0x5b0d57,!![]);}catch(_0x4066bb){return BPromise[_0xa3f8('0x26')](_0x4066bb);}return _0x43c393[_0xa3f8('0x27')]();};}function saveUpdates(_0x474893,_0x3a6a57){return function(_0x1e5f30){if(_0x1e5f30){return _0x1e5f30[_0xa3f8('0x28')](_0x474893)['then'](function(_0xae76ec){return _0xae76ec;});}return null;};}function removeEntity(_0x4d0e72,_0x3ce57b){return function(_0xa5a697){if(_0xa5a697){return _0xa5a697[_0xa3f8('0x29')]()[_0xa3f8('0x2a')](function(){_0x4d0e72[_0xa3f8('0x1e')](0xcc)[_0xa3f8('0x1f')]();});}};}function handleEntityNotFound(_0x6e3cb4,_0x34884d){return function(_0x1e22b8){if(!_0x1e22b8){_0x6e3cb4[_0xa3f8('0x1d')](0x194);}return _0x1e22b8;};}function handleError(_0x545a28,_0x1c3358){_0x1c3358=_0x1c3358||0x1f4;return function(_0x2d29c1){logger[_0xa3f8('0x2b')](_0x2d29c1['stack']);if(_0x2d29c1[_0xa3f8('0x2c')]){delete _0x2d29c1['name'];}_0x545a28[_0xa3f8('0x1e')](_0x1c3358)[_0xa3f8('0x2d')](_0x2d29c1);};}exports[_0xa3f8('0x2e')]=function(_0x4ea213,_0x458824){var _0x5e69e2={},_0x21c57e={},_0x4281ea={'count':0x0,'rows':[]};var _0x226153=_[_0xa3f8('0x2f')](db[_0xa3f8('0x30')][_0xa3f8('0x31')],function(_0x23c854){return{'name':_0x23c854[_0xa3f8('0x32')],'type':_0x23c854[_0xa3f8('0x33')][_0xa3f8('0x34')]};});_0x21c57e[_0xa3f8('0x35')]=_['map'](_0x226153,_0xa3f8('0x2c'));_0x21c57e[_0xa3f8('0x36')]=_[_0xa3f8('0x37')](_0x4ea213[_0xa3f8('0x36')]);_0x21c57e[_0xa3f8('0x38')]=_['intersection'](_0x21c57e[_0xa3f8('0x35')],_0x21c57e[_0xa3f8('0x36')]);_0x5e69e2['attributes']=_[_0xa3f8('0x39')](_0x21c57e[_0xa3f8('0x35')],qs['fields'](_0x4ea213[_0xa3f8('0x36')]['fields']));_0x5e69e2['attributes']=_0x5e69e2[_0xa3f8('0x3a')][_0xa3f8('0x3b')]?_0x5e69e2['attributes']:_0x21c57e[_0xa3f8('0x35')];if(!_0x4ea213['query'][_0xa3f8('0x3c')](_0xa3f8('0x3d'))){_0x5e69e2[_0xa3f8('0x23')]=qs[_0xa3f8('0x23')](_0x4ea213['query'][_0xa3f8('0x23')]);_0x5e69e2['offset']=qs[_0xa3f8('0x21')](_0x4ea213['query'][_0xa3f8('0x21')]);}_0x5e69e2['order']=qs['sort'](_0x4ea213['query'][_0xa3f8('0x3e')]);_0x5e69e2[_0xa3f8('0x3f')]=qs[_0xa3f8('0x38')](_[_0xa3f8('0x40')](_0x4ea213['query'],_0x21c57e[_0xa3f8('0x38')]),_0x226153);if(_0x4ea213[_0xa3f8('0x36')][_0xa3f8('0x41')]){_0x5e69e2[_0xa3f8('0x3f')]=_[_0xa3f8('0x42')](_0x5e69e2[_0xa3f8('0x3f')],{'$or':_['map'](_0x226153,function(_0x14db5b){if(_0x14db5b[_0xa3f8('0x33')]!==_0xa3f8('0x43')){var _0x51de10={};_0x51de10[_0x14db5b[_0xa3f8('0x2c')]]={'$like':'%'+_0x4ea213[_0xa3f8('0x36')]['filter']+'%'};return _0x51de10;}})});}_0x5e69e2=_[_0xa3f8('0x42')]({},_0x5e69e2,_0x4ea213['options']);var _0xbf8209={'where':_0x5e69e2['where']};return db[_0xa3f8('0x30')][_0xa3f8('0x24')](_0xbf8209)[_0xa3f8('0x2a')](function(_0x2a77be){_0x4281ea[_0xa3f8('0x24')]=_0x2a77be;if(_0x4ea213['query'][_0xa3f8('0x44')]){_0x5e69e2[_0xa3f8('0x45')]=[{'all':!![]}];}return db['CmHopperFinal'][_0xa3f8('0x46')](_0x5e69e2);})['then'](function(_0x6ff4d4){_0x4281ea[_0xa3f8('0x47')]=_0x6ff4d4;return _0x4281ea;})[_0xa3f8('0x2a')](respondWithFilteredResult(_0x458824,_0x5e69e2))[_0xa3f8('0x48')](handleError(_0x458824,null));};exports[_0xa3f8('0x49')]=function(_0x4d2b8b,_0x180e87){var _0x2b17ff={'raw':!![],'where':{'id':_0x4d2b8b[_0xa3f8('0x4a')]['id']}},_0x23fe02={};_0x23fe02[_0xa3f8('0x35')]=_['keys'](db[_0xa3f8('0x30')][_0xa3f8('0x31')]);_0x23fe02[_0xa3f8('0x36')]=_[_0xa3f8('0x37')](_0x4d2b8b[_0xa3f8('0x36')]);_0x23fe02[_0xa3f8('0x38')]=_[_0xa3f8('0x39')](_0x23fe02[_0xa3f8('0x35')],_0x23fe02[_0xa3f8('0x36')]);_0x2b17ff[_0xa3f8('0x3a')]=_[_0xa3f8('0x39')](_0x23fe02[_0xa3f8('0x35')],qs[_0xa3f8('0x4b')](_0x4d2b8b['query']['fields']));_0x2b17ff['attributes']=_0x2b17ff[_0xa3f8('0x3a')][_0xa3f8('0x3b')]?_0x2b17ff[_0xa3f8('0x3a')]:_0x23fe02[_0xa3f8('0x35')];if(_0x4d2b8b[_0xa3f8('0x36')][_0xa3f8('0x44')]){_0x2b17ff['include']=[{'all':!![]}];}_0x2b17ff=_[_0xa3f8('0x42')]({},_0x2b17ff,_0x4d2b8b[_0xa3f8('0x4c')]);return db[_0xa3f8('0x30')][_0xa3f8('0x4d')](_0x2b17ff)['then'](handleEntityNotFound(_0x180e87,null))[_0xa3f8('0x2a')](respondWithResult(_0x180e87,null))[_0xa3f8('0x48')](handleError(_0x180e87,null));};exports[_0xa3f8('0x4e')]=function(_0x523b46,_0x5cae9e){return db['CmHopperFinal'][_0xa3f8('0x4e')]()[_0xa3f8('0x2a')](respondWithResult(_0x5cae9e,null))['catch'](handleError(_0x5cae9e,null));};exports[_0xa3f8('0x28')]=function(_0x1f7af7,_0x410de5){if(_0x1f7af7[_0xa3f8('0x4f')][_0xa3f8('0x50')]){delete _0x1f7af7[_0xa3f8('0x4f')][_0xa3f8('0x50')];}return db[_0xa3f8('0x30')][_0xa3f8('0x4d')]({'where':{'uniqueid':_0x1f7af7[_0xa3f8('0x4a')]['id']}})[_0xa3f8('0x2a')](handleEntityNotFound(_0x410de5,null))[_0xa3f8('0x2a')](saveUpdates(_0x1f7af7[_0xa3f8('0x4f')],null))[_0xa3f8('0x2a')](respondWithResult(_0x410de5,null))[_0xa3f8('0x48')](handleError(_0x410de5,null));};exports[_0xa3f8('0x51')]=function(_0x42082d,_0x559ae7,_0x4addd2){return db[_0xa3f8('0x30')][_0xa3f8('0x46')]({'raw':![],'where':{'VoiceQueueId':_0x42082d['params']['id']},'attributes':[[db[_0xa3f8('0x52')]['fn'](_0xa3f8('0x53'),db[_0xa3f8('0x52')]['fn']('IF',db[_0xa3f8('0x52')][_0xa3f8('0x54')](_0xa3f8('0x55')))),_0xa3f8('0x56')],[db[_0xa3f8('0x52')]['fn'](_0xa3f8('0x53'),db[_0xa3f8('0x52')]['fn']('IF',db[_0xa3f8('0x52')][_0xa3f8('0x54')](_0xa3f8('0x57')))),_0xa3f8('0x58')],[db[_0xa3f8('0x52')]['fn'](_0xa3f8('0x53'),db['sequelize']['fn']('IF',db['sequelize'][_0xa3f8('0x54')]('`state`\x20=\x205,\x201,\x20null'))),_0xa3f8('0x59')],[db[_0xa3f8('0x52')]['fn'](_0xa3f8('0x53'),db['sequelize']['fn']('IF',db[_0xa3f8('0x52')][_0xa3f8('0x54')](_0xa3f8('0x5a')))),_0xa3f8('0x5b')],[db['sequelize']['fn'](_0xa3f8('0x53'),db['sequelize']['fn']('IF',db[_0xa3f8('0x52')][_0xa3f8('0x54')](_0xa3f8('0x5c')))),'dropContacts'],[db['sequelize']['fn'](_0xa3f8('0x53'),db[_0xa3f8('0x52')]['fn']('IF',db[_0xa3f8('0x52')][_0xa3f8('0x54')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xa3f8('0x5d')],[db[_0xa3f8('0x52')]['fn'](_0xa3f8('0x53'),db[_0xa3f8('0x52')]['fn']('IF',db[_0xa3f8('0x52')]['literal']('`state`\x20=\x2022,\x201,\x20null'))),_0xa3f8('0x5e')],[db[_0xa3f8('0x52')]['fn'](_0xa3f8('0x53'),db[_0xa3f8('0x52')]['fn']('IF',db[_0xa3f8('0x52')][_0xa3f8('0x54')](_0xa3f8('0x5f')))),'answeringMachine']]})['then'](handleEntityNotFound(_0x559ae7,null))['then'](respondWithResult(_0x559ae7,null))[_0xa3f8('0x48')](handleError(_0x559ae7,null));};exports[_0xa3f8('0x60')]=function(_0x3096d0,_0x398f64,_0x185b38){return db[_0xa3f8('0x30')][_0xa3f8('0x46')]({'raw':![],'where':{'CampaignId':_0x3096d0[_0xa3f8('0x4a')]['id']},'attributes':[[db['sequelize']['fn'](_0xa3f8('0x53'),db[_0xa3f8('0x52')]['fn']('IF',db[_0xa3f8('0x52')][_0xa3f8('0x54')](_0xa3f8('0x55')))),_0xa3f8('0x56')],[db[_0xa3f8('0x52')]['fn']('COUNT',db[_0xa3f8('0x52')]['fn']('IF',db[_0xa3f8('0x52')]['literal'](_0xa3f8('0x57')))),_0xa3f8('0x58')],[db[_0xa3f8('0x52')]['fn'](_0xa3f8('0x53'),db[_0xa3f8('0x52')]['fn']('IF',db[_0xa3f8('0x52')][_0xa3f8('0x54')]('`state`\x20=\x205,\x201,\x20null'))),'busyContacts'],[db[_0xa3f8('0x52')]['fn']('COUNT',db[_0xa3f8('0x52')]['fn']('IF',db[_0xa3f8('0x52')][_0xa3f8('0x54')](_0xa3f8('0x5a')))),_0xa3f8('0x5b')],[db[_0xa3f8('0x52')]['fn'](_0xa3f8('0x53'),db[_0xa3f8('0x52')]['fn']('IF',db[_0xa3f8('0x52')][_0xa3f8('0x54')](_0xa3f8('0x5c')))),_0xa3f8('0x61')],[db[_0xa3f8('0x52')]['fn']('COUNT',db[_0xa3f8('0x52')]['fn']('IF',db[_0xa3f8('0x52')][_0xa3f8('0x54')](_0xa3f8('0x62')))),_0xa3f8('0x5d')],[db[_0xa3f8('0x52')]['fn']('COUNT',db[_0xa3f8('0x52')]['fn']('IF',db[_0xa3f8('0x52')][_0xa3f8('0x54')](_0xa3f8('0x63')))),_0xa3f8('0x5e')],[db[_0xa3f8('0x52')]['fn'](_0xa3f8('0x53'),db[_0xa3f8('0x52')]['fn']('IF',db[_0xa3f8('0x52')][_0xa3f8('0x54')](_0xa3f8('0x5f')))),'answeringMachine']]})[_0xa3f8('0x2a')](handleEntityNotFound(_0x398f64,null))[_0xa3f8('0x2a')](respondWithResult(_0x398f64,null))['catch'](handleError(_0x398f64,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x1955aa,_0x296931,_0x2c0f71){return db[_0xa3f8('0x64')][_0xa3f8('0x4d')]({'where':{'id':_0x1955aa[_0xa3f8('0x4a')]['id']}})[_0xa3f8('0x2a')](handleEntityNotFound(_0x296931,null))[_0xa3f8('0x2a')](function(_0x4f5f62){var _0xf76898;if(_0x4f5f62){_0xf76898=squel[_0xa3f8('0x65')]()[_0xa3f8('0x66')]('cm_hopper')[_0xa3f8('0x67')]([_0xa3f8('0x68'),'scheduledAt',_0xa3f8('0x69'),_0xa3f8('0x6a'),_0xa3f8('0x6b'),_0xa3f8('0x6c'),_0xa3f8('0x6d')],squel[_0xa3f8('0x6e')]()[_0xa3f8('0x6f')](_0xa3f8('0x70'),_0xa3f8('0x68'))['field'](_0xa3f8('0x71'),'scheduledAt')[_0xa3f8('0x6f')]('ANY_VALUE(ContactId)',_0xa3f8('0x69'))[_0xa3f8('0x6f')](_0xa3f8('0x72'),_0xa3f8('0x6a'))[_0xa3f8('0x6f')]('ANY_VALUE(VoiceQueueId)',_0xa3f8('0x6b'))[_0xa3f8('0x6f')]('NOW()',_0xa3f8('0x6c'))[_0xa3f8('0x6f')](_0xa3f8('0x71'),_0xa3f8('0x6d'))[_0xa3f8('0x73')](_0xa3f8('0x74'))['where'](_0xa3f8('0x75'),_0x1955aa[_0xa3f8('0x4a')]['id'][_0xa3f8('0x76')]())['where'](_0xa3f8('0x77'),_0x1955aa['body'][_0xa3f8('0x78')]['toString']())['where'](_0xa3f8('0x79'))['where'](_0xa3f8('0x7a'),squel['select']()[_0xa3f8('0x6f')](_0xa3f8('0x68'))[_0xa3f8('0x73')](_0xa3f8('0x7b'))['where'](_0xa3f8('0x75'),_0x1955aa[_0xa3f8('0x4a')]['id']['toString']()))[_0xa3f8('0x3f')](_0xa3f8('0x7a'),squel[_0xa3f8('0x6e')]()[_0xa3f8('0x6f')](_0xa3f8('0x7c'))[_0xa3f8('0x73')](_0xa3f8('0x74'))[_0xa3f8('0x3f')](_0xa3f8('0x75'),_0x1955aa[_0xa3f8('0x4a')]['id']['toString']())[_0xa3f8('0x3f')](_0xa3f8('0x7d')))[_0xa3f8('0x7e')](_0xa3f8('0x69')))[_0xa3f8('0x76')]();return db[_0xa3f8('0x52')][_0xa3f8('0x36')](_0xf76898);}return[];})[_0xa3f8('0x2a')](respondWithResult(_0x296931,null))[_0xa3f8('0x48')](handleError(_0x296931,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x2e2d99,_0x3da7ee,_0x3f6834){return db[_0xa3f8('0x7f')][_0xa3f8('0x4d')]({'where':{'id':_0x2e2d99[_0xa3f8('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3da7ee,null))[_0xa3f8('0x2a')](function(_0x3175fc){var _0x224199;if(_0x3175fc){_0x224199=squel[_0xa3f8('0x65')]()['into'](_0xa3f8('0x7b'))[_0xa3f8('0x67')]([_0xa3f8('0x68'),_0xa3f8('0x80'),_0xa3f8('0x69'),_0xa3f8('0x6a'),_0xa3f8('0x81'),_0xa3f8('0x6c'),_0xa3f8('0x6d')],squel[_0xa3f8('0x6e')]()[_0xa3f8('0x6f')]('ANY_VALUE(calleridnum)',_0xa3f8('0x68'))['field'](_0xa3f8('0x71'),_0xa3f8('0x80'))[_0xa3f8('0x6f')](_0xa3f8('0x82'),_0xa3f8('0x69'))[_0xa3f8('0x6f')](_0xa3f8('0x72'),_0xa3f8('0x6a'))['field'](_0xa3f8('0x83'),'CampaignId')[_0xa3f8('0x6f')]('NOW()',_0xa3f8('0x6c'))['field'](_0xa3f8('0x71'),_0xa3f8('0x6d'))[_0xa3f8('0x73')](_0xa3f8('0x74'))['where'](_0xa3f8('0x84'),_0x2e2d99[_0xa3f8('0x4a')]['id'][_0xa3f8('0x76')]())[_0xa3f8('0x3f')](_0xa3f8('0x77'),_0x2e2d99[_0xa3f8('0x4f')]['state'][_0xa3f8('0x76')]())[_0xa3f8('0x3f')](_0xa3f8('0x79'))[_0xa3f8('0x3f')](_0xa3f8('0x7a'),squel['select']()[_0xa3f8('0x6f')](_0xa3f8('0x68'))['from'](_0xa3f8('0x7b'))[_0xa3f8('0x3f')](_0xa3f8('0x84'),_0x2e2d99['params']['id'][_0xa3f8('0x76')]()))[_0xa3f8('0x3f')](_0xa3f8('0x7a'),squel[_0xa3f8('0x6e')]()[_0xa3f8('0x6f')](_0xa3f8('0x7c'))[_0xa3f8('0x73')]('cm_hopper_final')[_0xa3f8('0x3f')](_0xa3f8('0x84'),_0x2e2d99['params']['id'][_0xa3f8('0x76')]())[_0xa3f8('0x3f')](_0xa3f8('0x7d')))[_0xa3f8('0x7e')](_0xa3f8('0x69')))[_0xa3f8('0x76')]();return db[_0xa3f8('0x52')]['query'](_0x224199);}return[];})[_0xa3f8('0x2a')](respondWithResult(_0x3da7ee,null))[_0xa3f8('0x48')](handleError(_0x3da7ee,null));};exports[_0xa3f8('0x85')]=function(_0x2eaf1e,_0x39494d,_0x1673ac){return db[_0xa3f8('0x86')]['findOne']({'where':{'VoiceQueueId':_0x2eaf1e[_0xa3f8('0x4f')][_0xa3f8('0x6b')],'CampaignId':_0x2eaf1e[_0xa3f8('0x4f')][_0xa3f8('0x81')],'ContactId':_0x2eaf1e['body']['ContactId']}})[_0xa3f8('0x2a')](handleEntityNotFound(_0x39494d,null))['then'](function(_0x36f6c4){if(_0x36f6c4){return _0x36f6c4;}return null;})[_0xa3f8('0x2a')](respondWithResult(_0x39494d,null))[_0xa3f8('0x48')](handleError(_0x39494d,null));}; \ No newline at end of file +var _0xeff8=['eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','CmHopperFinal','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','length','include','describe','body','uniqueid','find','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','noSuchContacts','noAnswerContacts','`state`\x20=\x2011\x20,\x201,\x20null','VoiceQueue','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','createdAt','updatedAt','select','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(VoiceQueueId)','VoiceQueueId','from','cm_hopper_final','VoiceQueueId\x20=\x20?','state\x20=\x20?','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','toString','group','moveContactsIvrCampaignHopperFinal','CampaignId','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','calleridnum','CmHopper','findOne'];(function(_0x3c0b95,_0x26105c){var _0x3759e0=function(_0x19f11f){while(--_0x19f11f){_0x3c0b95['push'](_0x3c0b95['shift']());}};_0x3759e0(++_0x26105c);}(_0xeff8,0x186));var _0x8eff=function(_0x19b84f,_0x48765e){_0x19b84f=_0x19b84f-0x0;var _0x18067b=_0xeff8[_0x19b84f];return _0x18067b;};'use strict';var emlformat=require(_0x8eff('0x0'));var rimraf=require(_0x8eff('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8eff('0x2'));var rp=require(_0x8eff('0x3'));var moment=require(_0x8eff('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8eff('0x5'));var util=require(_0x8eff('0x6'));var path=require(_0x8eff('0x7'));var sox=require(_0x8eff('0x8'));var csv=require('to-csv');var ejs=require(_0x8eff('0x9'));var fs=require('fs');var fs_extra=require(_0x8eff('0xa'));var _=require(_0x8eff('0xb'));var squel=require(_0x8eff('0xc'));var crypto=require('crypto');var jsforce=require(_0x8eff('0xd'));var deskjs=require(_0x8eff('0xe'));var toCsv=require(_0x8eff('0xf'));var querystring=require(_0x8eff('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8eff('0x11'));var qs=require(_0x8eff('0x12'));var as=require(_0x8eff('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8eff('0x14'))(_0x8eff('0x15'));var utils=require('../../config/utils');var config=require(_0x8eff('0x16'));var licenseUtil=require(_0x8eff('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4a399e,_0x45f280){_0x45f280=_0x45f280||0xcc;return function(_0x43c914){if(_0x43c914){return _0x4a399e[_0x8eff('0x18')](_0x45f280);}return _0x4a399e[_0x8eff('0x19')](_0x45f280)[_0x8eff('0x1a')]();};}function respondWithResult(_0x56efdf,_0x3e7c01){_0x3e7c01=_0x3e7c01||0xc8;return function(_0x212a2e){if(_0x212a2e){return _0x56efdf[_0x8eff('0x19')](_0x3e7c01)[_0x8eff('0x1b')](_0x212a2e);}};}function respondWithFilteredResult(_0x228eb1,_0x4cfc91){return function(_0x16202e){if(_0x16202e){var _0xdbb753=typeof _0x4cfc91[_0x8eff('0x1c')]===_0x8eff('0x1d')&&typeof _0x4cfc91[_0x8eff('0x1e')]==='undefined';var _0x32b791=_0x16202e[_0x8eff('0x1f')];var _0x3cd1dc=_0xdbb753?0x0:_0x4cfc91[_0x8eff('0x1c')];var _0x2cd7c5=_0xdbb753?_0x16202e[_0x8eff('0x1f')]:_0x4cfc91[_0x8eff('0x1c')]+_0x4cfc91[_0x8eff('0x1e')];var _0x1b003c;if(_0x2cd7c5>=_0x32b791){_0x2cd7c5=_0x32b791;_0x1b003c=0xc8;}else{_0x1b003c=0xce;}_0x228eb1[_0x8eff('0x19')](_0x1b003c);return _0x228eb1[_0x8eff('0x20')](_0x8eff('0x21'),_0x3cd1dc+'-'+_0x2cd7c5+'/'+_0x32b791)[_0x8eff('0x1b')](_0x16202e);}return null;};}function patchUpdates(_0x2a7337){return function(_0xdbb7b5){try{jsonpatch[_0x8eff('0x22')](_0xdbb7b5,_0x2a7337,!![]);}catch(_0x5e157c){return BPromise[_0x8eff('0x23')](_0x5e157c);}return _0xdbb7b5[_0x8eff('0x24')]();};}function saveUpdates(_0x5a2492,_0x1c4ad3){return function(_0x5ea31f){if(_0x5ea31f){return _0x5ea31f[_0x8eff('0x25')](_0x5a2492)[_0x8eff('0x26')](function(_0x1ccc79){return _0x1ccc79;});}return null;};}function removeEntity(_0x59cc32,_0x1ee09c){return function(_0x4e891c){if(_0x4e891c){return _0x4e891c[_0x8eff('0x27')]()[_0x8eff('0x26')](function(){_0x59cc32['status'](0xcc)[_0x8eff('0x1a')]();});}};}function handleEntityNotFound(_0x5ec3d7,_0x40404b){return function(_0x3b698b){if(!_0x3b698b){_0x5ec3d7[_0x8eff('0x18')](0x194);}return _0x3b698b;};}function handleError(_0x41324b,_0x6359df){_0x6359df=_0x6359df||0x1f4;return function(_0x2e8067){logger['error'](_0x2e8067[_0x8eff('0x28')]);if(_0x2e8067[_0x8eff('0x29')]){delete _0x2e8067[_0x8eff('0x29')];}_0x41324b[_0x8eff('0x19')](_0x6359df)[_0x8eff('0x2a')](_0x2e8067);};}exports[_0x8eff('0x2b')]=function(_0x4cc146,_0x4ed3b8){var _0x44dcdb={},_0x472b19={},_0x17ff3f={'count':0x0,'rows':[]};var _0x5ce071=_[_0x8eff('0x2c')](db[_0x8eff('0x2d')][_0x8eff('0x2e')],function(_0x1da0fa){return{'name':_0x1da0fa[_0x8eff('0x2f')],'type':_0x1da0fa[_0x8eff('0x30')][_0x8eff('0x31')]};});_0x472b19[_0x8eff('0x32')]=_[_0x8eff('0x2c')](_0x5ce071,_0x8eff('0x29'));_0x472b19[_0x8eff('0x33')]=_[_0x8eff('0x34')](_0x4cc146['query']);_0x472b19[_0x8eff('0x35')]=_[_0x8eff('0x36')](_0x472b19[_0x8eff('0x32')],_0x472b19[_0x8eff('0x33')]);_0x44dcdb['attributes']=_[_0x8eff('0x36')](_0x472b19[_0x8eff('0x32')],qs['fields'](_0x4cc146['query'][_0x8eff('0x37')]));_0x44dcdb[_0x8eff('0x38')]=_0x44dcdb['attributes']['length']?_0x44dcdb['attributes']:_0x472b19[_0x8eff('0x32')];if(!_0x4cc146['query'][_0x8eff('0x39')]('nolimit')){_0x44dcdb[_0x8eff('0x1e')]=qs[_0x8eff('0x1e')](_0x4cc146[_0x8eff('0x33')][_0x8eff('0x1e')]);_0x44dcdb[_0x8eff('0x1c')]=qs[_0x8eff('0x1c')](_0x4cc146['query'][_0x8eff('0x1c')]);}_0x44dcdb['order']=qs[_0x8eff('0x3a')](_0x4cc146['query'][_0x8eff('0x3a')]);_0x44dcdb[_0x8eff('0x3b')]=qs[_0x8eff('0x35')](_[_0x8eff('0x3c')](_0x4cc146['query'],_0x472b19[_0x8eff('0x35')]),_0x5ce071);if(_0x4cc146[_0x8eff('0x33')][_0x8eff('0x3d')]){_0x44dcdb['where']=_[_0x8eff('0x3e')](_0x44dcdb[_0x8eff('0x3b')],{'$or':_[_0x8eff('0x2c')](_0x5ce071,function(_0x345bc7){if(_0x345bc7[_0x8eff('0x30')]!==_0x8eff('0x3f')){var _0x29f68e={};_0x29f68e[_0x345bc7[_0x8eff('0x29')]]={'$like':'%'+_0x4cc146[_0x8eff('0x33')]['filter']+'%'};return _0x29f68e;}})});}_0x44dcdb=_['merge']({},_0x44dcdb,_0x4cc146[_0x8eff('0x40')]);var _0x114f8e={'where':_0x44dcdb[_0x8eff('0x3b')]};return db[_0x8eff('0x2d')][_0x8eff('0x1f')](_0x114f8e)[_0x8eff('0x26')](function(_0x18b132){_0x17ff3f['count']=_0x18b132;if(_0x4cc146[_0x8eff('0x33')][_0x8eff('0x41')]){_0x44dcdb['include']=[{'all':!![]}];}return db[_0x8eff('0x2d')][_0x8eff('0x42')](_0x44dcdb);})[_0x8eff('0x26')](function(_0x18309b){_0x17ff3f[_0x8eff('0x43')]=_0x18309b;return _0x17ff3f;})[_0x8eff('0x26')](respondWithFilteredResult(_0x4ed3b8,_0x44dcdb))[_0x8eff('0x44')](handleError(_0x4ed3b8,null));};exports[_0x8eff('0x45')]=function(_0x6d0568,_0x480c4c){var _0x37f376={'raw':!![],'where':{'id':_0x6d0568[_0x8eff('0x46')]['id']}},_0x27a8c9={};_0x27a8c9[_0x8eff('0x32')]=_[_0x8eff('0x34')](db['CmHopperFinal'][_0x8eff('0x2e')]);_0x27a8c9['query']=_[_0x8eff('0x34')](_0x6d0568[_0x8eff('0x33')]);_0x27a8c9[_0x8eff('0x35')]=_[_0x8eff('0x36')](_0x27a8c9['model'],_0x27a8c9[_0x8eff('0x33')]);_0x37f376[_0x8eff('0x38')]=_[_0x8eff('0x36')](_0x27a8c9['model'],qs['fields'](_0x6d0568[_0x8eff('0x33')][_0x8eff('0x37')]));_0x37f376[_0x8eff('0x38')]=_0x37f376[_0x8eff('0x38')][_0x8eff('0x47')]?_0x37f376['attributes']:_0x27a8c9[_0x8eff('0x32')];if(_0x6d0568['query'][_0x8eff('0x41')]){_0x37f376[_0x8eff('0x48')]=[{'all':!![]}];}_0x37f376=_['merge']({},_0x37f376,_0x6d0568['options']);return db['CmHopperFinal']['find'](_0x37f376)['then'](handleEntityNotFound(_0x480c4c,null))['then'](respondWithResult(_0x480c4c,null))[_0x8eff('0x44')](handleError(_0x480c4c,null));};exports[_0x8eff('0x49')]=function(_0x33aa8d,_0x1b5fda){return db[_0x8eff('0x2d')][_0x8eff('0x49')]()[_0x8eff('0x26')](respondWithResult(_0x1b5fda,null))[_0x8eff('0x44')](handleError(_0x1b5fda,null));};exports[_0x8eff('0x25')]=function(_0x3287d6,_0x4c7013){if(_0x3287d6[_0x8eff('0x4a')]['uniqueid']){delete _0x3287d6[_0x8eff('0x4a')][_0x8eff('0x4b')];}return db[_0x8eff('0x2d')][_0x8eff('0x4c')]({'where':{'uniqueid':_0x3287d6[_0x8eff('0x46')]['id']}})[_0x8eff('0x26')](handleEntityNotFound(_0x4c7013,null))[_0x8eff('0x26')](saveUpdates(_0x3287d6[_0x8eff('0x4a')],null))[_0x8eff('0x26')](respondWithResult(_0x4c7013,null))[_0x8eff('0x44')](handleError(_0x4c7013,null));};exports[_0x8eff('0x4d')]=function(_0x452f7a,_0x47b28d,_0x13ae7c){return db[_0x8eff('0x2d')][_0x8eff('0x42')]({'raw':![],'where':{'VoiceQueueId':_0x452f7a[_0x8eff('0x46')]['id']},'attributes':[[db[_0x8eff('0x4e')]['fn'](_0x8eff('0x4f'),db[_0x8eff('0x4e')]['fn']('IF',db[_0x8eff('0x4e')][_0x8eff('0x50')]('`state`\x20=\x200,\x201,\x20null'))),'noSuchContacts'],[db[_0x8eff('0x4e')]['fn'](_0x8eff('0x4f'),db[_0x8eff('0x4e')]['fn']('IF',db[_0x8eff('0x4e')][_0x8eff('0x50')](_0x8eff('0x51')))),'noAnswerContacts'],[db[_0x8eff('0x4e')]['fn'](_0x8eff('0x4f'),db[_0x8eff('0x4e')]['fn']('IF',db['sequelize'][_0x8eff('0x50')](_0x8eff('0x52')))),_0x8eff('0x53')],[db[_0x8eff('0x4e')]['fn']('COUNT',db[_0x8eff('0x4e')]['fn']('IF',db[_0x8eff('0x4e')][_0x8eff('0x50')](_0x8eff('0x54')))),_0x8eff('0x55')],[db[_0x8eff('0x4e')]['fn'](_0x8eff('0x4f'),db['sequelize']['fn']('IF',db[_0x8eff('0x4e')][_0x8eff('0x50')](_0x8eff('0x56')))),_0x8eff('0x57')],[db[_0x8eff('0x4e')]['fn']('COUNT',db[_0x8eff('0x4e')]['fn']('IF',db[_0x8eff('0x4e')][_0x8eff('0x50')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x8eff('0x58')],[db['sequelize']['fn'](_0x8eff('0x4f'),db[_0x8eff('0x4e')]['fn']('IF',db[_0x8eff('0x4e')][_0x8eff('0x50')](_0x8eff('0x59')))),_0x8eff('0x5a')],[db[_0x8eff('0x4e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x8eff('0x4e')]['literal'](_0x8eff('0x5b')))),_0x8eff('0x5c')]]})[_0x8eff('0x26')](handleEntityNotFound(_0x47b28d,null))[_0x8eff('0x26')](respondWithResult(_0x47b28d,null))[_0x8eff('0x44')](handleError(_0x47b28d,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x4064bd,_0x36afc3,_0x1813df){return db[_0x8eff('0x2d')][_0x8eff('0x42')]({'raw':![],'where':{'CampaignId':_0x4064bd[_0x8eff('0x46')]['id']},'attributes':[[db['sequelize']['fn'](_0x8eff('0x4f'),db['sequelize']['fn']('IF',db[_0x8eff('0x4e')][_0x8eff('0x50')]('`state`\x20=\x200,\x201,\x20null'))),_0x8eff('0x5d')],[db[_0x8eff('0x4e')]['fn'](_0x8eff('0x4f'),db[_0x8eff('0x4e')]['fn']('IF',db[_0x8eff('0x4e')][_0x8eff('0x50')](_0x8eff('0x51')))),_0x8eff('0x5e')],[db['sequelize']['fn'](_0x8eff('0x4f'),db['sequelize']['fn']('IF',db['sequelize'][_0x8eff('0x50')](_0x8eff('0x52')))),'busyContacts'],[db[_0x8eff('0x4e')]['fn'](_0x8eff('0x4f'),db['sequelize']['fn']('IF',db[_0x8eff('0x4e')][_0x8eff('0x50')]('`state`\x20=\x208,\x201,\x20null'))),_0x8eff('0x55')],[db[_0x8eff('0x4e')]['fn'](_0x8eff('0x4f'),db[_0x8eff('0x4e')]['fn']('IF',db[_0x8eff('0x4e')][_0x8eff('0x50')](_0x8eff('0x56')))),'dropContacts'],[db['sequelize']['fn'](_0x8eff('0x4f'),db[_0x8eff('0x4e')]['fn']('IF',db[_0x8eff('0x4e')][_0x8eff('0x50')](_0x8eff('0x5f')))),_0x8eff('0x58')],[db[_0x8eff('0x4e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x8eff('0x4e')]['literal']('`state`\x20=\x2022,\x201,\x20null'))),'reCallContacts'],[db[_0x8eff('0x4e')]['fn'](_0x8eff('0x4f'),db[_0x8eff('0x4e')]['fn']('IF',db[_0x8eff('0x4e')][_0x8eff('0x50')](_0x8eff('0x5b')))),_0x8eff('0x5c')]]})[_0x8eff('0x26')](handleEntityNotFound(_0x36afc3,null))['then'](respondWithResult(_0x36afc3,null))[_0x8eff('0x44')](handleError(_0x36afc3,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x42efc6,_0x35a221,_0x12ebd1){return db[_0x8eff('0x60')][_0x8eff('0x4c')]({'where':{'id':_0x42efc6[_0x8eff('0x46')]['id']}})['then'](handleEntityNotFound(_0x35a221,null))[_0x8eff('0x26')](function(_0x545fcf){var _0x1d8d8f;if(_0x545fcf){_0x1d8d8f=squel[_0x8eff('0x61')]()[_0x8eff('0x62')](_0x8eff('0x63'))[_0x8eff('0x64')]([_0x8eff('0x65'),_0x8eff('0x66'),_0x8eff('0x67'),_0x8eff('0x68'),'VoiceQueueId',_0x8eff('0x69'),_0x8eff('0x6a')],squel[_0x8eff('0x6b')]()[_0x8eff('0x6c')](_0x8eff('0x6d'),_0x8eff('0x65'))[_0x8eff('0x6c')](_0x8eff('0x6e'),_0x8eff('0x66'))[_0x8eff('0x6c')]('ANY_VALUE(ContactId)','ContactId')['field']('ANY_VALUE(ListId)',_0x8eff('0x68'))[_0x8eff('0x6c')](_0x8eff('0x6f'),_0x8eff('0x70'))[_0x8eff('0x6c')](_0x8eff('0x6e'),_0x8eff('0x69'))['field'](_0x8eff('0x6e'),_0x8eff('0x6a'))[_0x8eff('0x71')](_0x8eff('0x72'))['where'](_0x8eff('0x73'),_0x42efc6[_0x8eff('0x46')]['id']['toString']())[_0x8eff('0x3b')](_0x8eff('0x74'),_0x42efc6[_0x8eff('0x4a')]['state']['toString']())['where'](_0x8eff('0x75'))[_0x8eff('0x3b')](_0x8eff('0x76'),squel[_0x8eff('0x6b')]()[_0x8eff('0x6c')](_0x8eff('0x65'))[_0x8eff('0x71')](_0x8eff('0x63'))[_0x8eff('0x3b')](_0x8eff('0x73'),_0x42efc6[_0x8eff('0x46')]['id']['toString']()))[_0x8eff('0x3b')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x8eff('0x6b')]()[_0x8eff('0x6c')]('calleridnum')[_0x8eff('0x71')]('cm_hopper_final')[_0x8eff('0x3b')](_0x8eff('0x73'),_0x42efc6[_0x8eff('0x46')]['id'][_0x8eff('0x77')]())[_0x8eff('0x3b')]('state\x20=\x204'))[_0x8eff('0x78')](_0x8eff('0x67')))[_0x8eff('0x77')]();return db[_0x8eff('0x4e')][_0x8eff('0x33')](_0x1d8d8f);}return[];})[_0x8eff('0x26')](respondWithResult(_0x35a221,null))[_0x8eff('0x44')](handleError(_0x35a221,null));};exports[_0x8eff('0x79')]=function(_0x23a771,_0x452b90,_0x43bbce){return db['Campaign'][_0x8eff('0x4c')]({'where':{'id':_0x23a771[_0x8eff('0x46')]['id']}})[_0x8eff('0x26')](handleEntityNotFound(_0x452b90,null))[_0x8eff('0x26')](function(_0x17f63b){var _0x582478;if(_0x17f63b){_0x582478=squel[_0x8eff('0x61')]()[_0x8eff('0x62')]('cm_hopper')['fromQuery']([_0x8eff('0x65'),_0x8eff('0x66'),_0x8eff('0x67'),_0x8eff('0x68'),_0x8eff('0x7a'),_0x8eff('0x69'),'updatedAt'],squel[_0x8eff('0x6b')]()['field'](_0x8eff('0x6d'),_0x8eff('0x65'))['field'](_0x8eff('0x6e'),'scheduledAt')['field'](_0x8eff('0x7b'),'ContactId')[_0x8eff('0x6c')](_0x8eff('0x7c'),'ListId')[_0x8eff('0x6c')](_0x8eff('0x7d'),'CampaignId')[_0x8eff('0x6c')](_0x8eff('0x6e'),_0x8eff('0x69'))[_0x8eff('0x6c')](_0x8eff('0x6e'),_0x8eff('0x6a'))[_0x8eff('0x71')](_0x8eff('0x72'))[_0x8eff('0x3b')]('CampaignId\x20=\x20?',_0x23a771['params']['id']['toString']())[_0x8eff('0x3b')](_0x8eff('0x74'),_0x23a771[_0x8eff('0x4a')]['state'][_0x8eff('0x77')]())[_0x8eff('0x3b')](_0x8eff('0x75'))[_0x8eff('0x3b')](_0x8eff('0x76'),squel[_0x8eff('0x6b')]()['field'](_0x8eff('0x65'))['from'](_0x8eff('0x63'))[_0x8eff('0x3b')](_0x8eff('0x7e'),_0x23a771[_0x8eff('0x46')]['id'][_0x8eff('0x77')]()))[_0x8eff('0x3b')](_0x8eff('0x76'),squel['select']()[_0x8eff('0x6c')](_0x8eff('0x7f'))[_0x8eff('0x71')](_0x8eff('0x72'))[_0x8eff('0x3b')]('CampaignId\x20=\x20?',_0x23a771[_0x8eff('0x46')]['id'][_0x8eff('0x77')]())[_0x8eff('0x3b')]('state\x20=\x204'))['group'](_0x8eff('0x67')))[_0x8eff('0x77')]();return db[_0x8eff('0x4e')]['query'](_0x582478);}return[];})[_0x8eff('0x26')](respondWithResult(_0x452b90,null))['catch'](handleError(_0x452b90,null));};exports['checkContactHopper']=function(_0x10b9ac,_0x6bc93b,_0x10ade6){return db[_0x8eff('0x80')][_0x8eff('0x81')]({'where':{'VoiceQueueId':_0x10b9ac[_0x8eff('0x4a')][_0x8eff('0x70')],'CampaignId':_0x10b9ac[_0x8eff('0x4a')][_0x8eff('0x7a')],'ContactId':_0x10b9ac[_0x8eff('0x4a')][_0x8eff('0x67')]}})[_0x8eff('0x26')](handleEntityNotFound(_0x6bc93b,null))['then'](function(_0x34a0f7){if(_0x34a0f7){return _0x34a0f7;}return null;})[_0x8eff('0x26')](respondWithResult(_0x6bc93b,null))[_0x8eff('0x44')](handleError(_0x6bc93b,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index deff5e6..85b2e6d 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 _0xdc3a=['../../config/environment','./cmHopperFinal.attributes','exports','define','cm_hopper_final','calleridnum','uniqueid','lodash','util','../../config/logger','moment','request-promise','path','rimraf'];(function(_0x458d4e,_0x370992){var _0x3d5f2b=function(_0x575660){while(--_0x575660){_0x458d4e['push'](_0x458d4e['shift']());}};_0x3d5f2b(++_0x370992);}(_0xdc3a,0x1b9));var _0xadc3=function(_0x6ea517,_0x489f09){_0x6ea517=_0x6ea517-0x0;var _0x33285c=_0xdc3a[_0x6ea517];return _0x33285c;};'use strict';var _=require(_0xadc3('0x0'));var util=require(_0xadc3('0x1'));var logger=require(_0xadc3('0x2'))('api');var moment=require(_0xadc3('0x3'));var BPromise=require('bluebird');var rp=require(_0xadc3('0x4'));var fs=require('fs');var path=require(_0xadc3('0x5'));var rimraf=require(_0xadc3('0x6'));var config=require(_0xadc3('0x7'));var attributes=require(_0xadc3('0x8'));module[_0xadc3('0x9')]=function(_0x23cc44,_0x1266aa){return _0x23cc44[_0xadc3('0xa')]('CmHopperFinal',attributes,{'tableName':_0xadc3('0xb'),'paranoid':![],'indexes':[{'name':_0xadc3('0xc'),'fields':[_0xadc3('0xc')]},{'name':_0xadc3('0xd'),'fields':[_0xadc3('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3b4f=['./cmHopperFinal.attributes','exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x5f1557,_0x4f4935){var _0x21e076=function(_0x1b2e75){while(--_0x1b2e75){_0x5f1557['push'](_0x5f1557['shift']());}};_0x21e076(++_0x4f4935);}(_0x3b4f,0xf7));var _0xf3b4=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x3b4f[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xf3b4('0x0'));var util=require(_0xf3b4('0x1'));var logger=require(_0xf3b4('0x2'))('api');var moment=require(_0xf3b4('0x3'));var BPromise=require('bluebird');var rp=require(_0xf3b4('0x4'));var fs=require('fs');var path=require(_0xf3b4('0x5'));var rimraf=require(_0xf3b4('0x6'));var config=require(_0xf3b4('0x7'));var attributes=require(_0xf3b4('0x8'));module[_0xf3b4('0x9')]=function(_0x3a2b0b,_0x3b7771){return _0x3a2b0b[_0xf3b4('0xa')](_0xf3b4('0xb'),attributes,{'tableName':_0xf3b4('0xc'),'paranoid':![],'indexes':[{'name':_0xf3b4('0xd'),'fields':[_0xf3b4('0xd')]},{'name':_0xf3b4('0xe'),'fields':[_0xf3b4('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 592c7af..f4a24ad 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(_0x599792,_0x1837f9){var _0x314350=function(_0x5b875d){while(--_0x5b875d){_0x599792['push'](_0x599792['shift']());}};_0x314350(++_0x1837f9);}(_0x7a54,0x106));var _0x47a5=function(_0x58afdd,_0x354244){_0x58afdd=_0x58afdd-0x0;var _0x486dac=_0x7a54[_0x58afdd];return _0x486dac;};'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(_0x40860e,_0x2289d8){var _0x342664=function(_0x49e3dd){while(--_0x49e3dd){_0x40860e['push'](_0x40860e['shift']());}};_0x342664(++_0x2289d8);}(_0x7a54,0x106));var _0x47a5=function(_0x44e62f,_0x31c82a){_0x44e62f=_0x44e62f-0x0;var _0x5aae39=_0x7a54[_0x44e62f];return _0x5aae39;};'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 8644454..985012e 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 _0x7969=['/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','update','exports','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','index'];(function(_0x349622,_0x22c38c){var _0x2473e2=function(_0x37b488){while(--_0x37b488){_0x349622['push'](_0x349622['shift']());}};_0x2473e2(++_0x22c38c);}(_0x7969,0x1c2));var _0x9796=function(_0x2dff73,_0x36d657){_0x2dff73=_0x2dff73-0x0;var _0x39ddfd=_0x7969[_0x2dff73];return _0x39ddfd;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9796('0x0'));var timeout=require(_0x9796('0x1'));var express=require(_0x9796('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9796('0x3'));var interaction=require(_0x9796('0x4'));var config=require(_0x9796('0x5'));var controller=require(_0x9796('0x6'));router[_0x9796('0x7')]('/',auth[_0x9796('0x8')](),controller[_0x9796('0x9')]);router[_0x9796('0x7')]('/describe',auth[_0x9796('0x8')](),controller['describe']);router['get'](_0x9796('0xa'),auth['isAuthenticated'](),controller[_0x9796('0xb')]);router['get'](_0x9796('0xc'),auth[_0x9796('0x8')](),controller[_0x9796('0xd')]);router[_0x9796('0x7')](_0x9796('0xe'),auth[_0x9796('0x8')](),controller[_0x9796('0xf')]);router[_0x9796('0x10')]('/voice/queue/moveContacts/:id',auth[_0x9796('0x8')](),controller['moveContactsQueueCampaignHopperFinal']);router[_0x9796('0x10')]('/voice/campaign/moveContacts/:id',auth[_0x9796('0x8')](),controller[_0x9796('0x11')]);router[_0x9796('0x10')](_0x9796('0x12'),auth[_0x9796('0x8')](),controller[_0x9796('0x13')]);router[_0x9796('0x14')](_0x9796('0xa'),auth[_0x9796('0x8')](),controller[_0x9796('0x15')]);module[_0x9796('0x16')]=router; \ No newline at end of file +var _0x80f2=['path','connect-timeout','Router','fs-extra','../../components/auth/service','./cmHopperFinal.controller','isAuthenticated','describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','get','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','/checkContactHopper','checkContactHopper','put','exports','multer','util'];(function(_0x466e7d,_0x1d9d98){var _0x490dd4=function(_0x2ae4d2){while(--_0x2ae4d2){_0x466e7d['push'](_0x466e7d['shift']());}};_0x490dd4(++_0x1d9d98);}(_0x80f2,0xf8));var _0x280f=function(_0x102382,_0x28c7ec){_0x102382=_0x102382-0x0;var _0x2adc79=_0x80f2[_0x102382];return _0x2adc79;};'use strict';var multer=require(_0x280f('0x0'));var util=require(_0x280f('0x1'));var path=require(_0x280f('0x2'));var timeout=require(_0x280f('0x3'));var express=require('express');var router=express[_0x280f('0x4')]();var fs_extra=require(_0x280f('0x5'));var auth=require(_0x280f('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x280f('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth[_0x280f('0x8')](),controller[_0x280f('0x9')]);router['get'](_0x280f('0xa'),auth['isAuthenticated'](),controller[_0x280f('0xb')]);router['get'](_0x280f('0xc'),auth[_0x280f('0x8')](),controller[_0x280f('0xd')]);router[_0x280f('0xe')](_0x280f('0xf'),auth[_0x280f('0x8')](),controller[_0x280f('0x10')]);router[_0x280f('0x11')](_0x280f('0x12'),auth['isAuthenticated'](),controller[_0x280f('0x13')]);router[_0x280f('0x11')](_0x280f('0x14'),auth[_0x280f('0x8')](),controller['moveContactsIvrCampaignHopperFinal']);router[_0x280f('0x11')](_0x280f('0x15'),auth[_0x280f('0x8')](),controller[_0x280f('0x16')]);router[_0x280f('0x17')](_0x280f('0xa'),auth[_0x280f('0x8')](),controller['update']);module[_0x280f('0x18')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 2d2df6c..b7b7e75 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 _0xa9e4=['exports','INTEGER','STRING','DATE','BOOLEAN','sequelize'];(function(_0x1231b3,_0x2a4ef5){var _0x116370=function(_0x30713a){while(--_0x30713a){_0x1231b3['push'](_0x1231b3['shift']());}};_0x116370(++_0x2a4ef5);}(_0xa9e4,0x89));var _0x4a9e=function(_0x52db3e,_0x52ec17){_0x52db3e=_0x52db3e-0x0;var _0x10afae=_0xa9e4[_0x52db3e];return _0x10afae;};'use strict';var Sequelize=require(_0x4a9e('0x0'));module[_0x4a9e('0x1')]={'state':{'type':Sequelize[_0x4a9e('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x4a9e('0x3')]},'scheduledat':{'type':Sequelize[_0x4a9e('0x4')]},'countbusyretry':{'type':Sequelize[_0x4a9e('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x4a9e('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x4a9e('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x4a9e('0x3')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x4a9e('0x3')]},'calleridnum':{'type':Sequelize[_0x4a9e('0x3')]},'calleridname':{'type':Sequelize[_0x4a9e('0x3')]},'starttime':{'type':Sequelize[_0x4a9e('0x4')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x4a9e('0x4')]},'ringtime':{'type':Sequelize[_0x4a9e('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x4a9e('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x4a9e('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x4a9e('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x4a9e('0x3')]},'campaigntype':{'type':Sequelize[_0x4a9e('0x3')]},'membername':{'type':Sequelize[_0x4a9e('0x3')]},'reason':{'type':Sequelize[_0x4a9e('0x3')]},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x4a9e('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x4a9e('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x4a9e('0x4')]},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x4a9e('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x4a9e('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x4a9e('0x2')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x4a9e('0x3')]}}; \ No newline at end of file +var _0x01aa=['INTEGER','DATE','BOOLEAN','sequelize','exports','STRING'];(function(_0x5275b8,_0x51e5dd){var _0x568a9b=function(_0x583a71){while(--_0x583a71){_0x5275b8['push'](_0x5275b8['shift']());}};_0x568a9b(++_0x51e5dd);}(_0x01aa,0x1ef));var _0xa01a=function(_0x4058e6,_0x5522f9){_0x4058e6=_0x4058e6-0x0;var _0x3ecb5b=_0x01aa[_0x4058e6];return _0x3ecb5b;};'use strict';var Sequelize=require(_0xa01a('0x0'));module[_0xa01a('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xa01a('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xa01a('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xa01a('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xa01a('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xa01a('0x2')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0xa01a('0x2')]},'calleridnum':{'type':Sequelize[_0xa01a('0x2')]},'calleridname':{'type':Sequelize[_0xa01a('0x2')]},'starttime':{'type':Sequelize[_0xa01a('0x4')]},'responsetime':{'type':Sequelize[_0xa01a('0x4')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xa01a('0x4')]},'ringtime':{'type':Sequelize[_0xa01a('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xa01a('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xa01a('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xa01a('0x2')]},'campaign':{'type':Sequelize[_0xa01a('0x2')]},'campaigntype':{'type':Sequelize[_0xa01a('0x2')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0xa01a('0x2')]},'amd':{'type':Sequelize[_0xa01a('0x5')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0xa01a('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xa01a('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0xa01a('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xa01a('0x4')]},'edited':{'type':Sequelize[_0xa01a('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xa01a('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xa01a('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xa01a('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xa01a('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index b31c33d..9caa673 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 _0xd498=['fieldName','type','key','model','query','keys','attributes','intersection','fields','nolimit','order','sort','pick','filters','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','length','include','find','create','describe','body','uniqueid','params','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','ejs','fs-extra','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','name','send','index','map','CmHopperHistory','rawAttributes'];(function(_0x54d2fb,_0x31fd9e){var _0x10cb87=function(_0x1a8716){while(--_0x1a8716){_0x54d2fb['push'](_0x54d2fb['shift']());}};_0x10cb87(++_0x31fd9e);}(_0xd498,0xb3));var _0x8d49=function(_0x5c4f6b,_0x2cdfce){_0x5c4f6b=_0x5c4f6b-0x0;var _0x104c4e=_0xd498[_0x5c4f6b];return _0x104c4e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8d49('0x0'));var zipdir=require(_0x8d49('0x1'));var jsonpatch=require(_0x8d49('0x2'));var rp=require('request-promise');var moment=require(_0x8d49('0x3'));var BPromise=require(_0x8d49('0x4'));var Mustache=require(_0x8d49('0x5'));var util=require('util');var path=require('path');var sox=require(_0x8d49('0x6'));var csv=require('to-csv');var ejs=require(_0x8d49('0x7'));var fs=require('fs');var fs_extra=require(_0x8d49('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x8d49('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8d49('0xa'));var querystring=require(_0x8d49('0xb'));var Papa=require(_0x8d49('0xc'));var Redis=require(_0x8d49('0xd'));var authService=require(_0x8d49('0xe'));var qs=require(_0x8d49('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8d49('0x10'));var logger=require(_0x8d49('0x11'))(_0x8d49('0x12'));var utils=require(_0x8d49('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8d49('0x14'))['db'];function respondWithStatusCode(_0x39bd66,_0x431b13){_0x431b13=_0x431b13||0xcc;return function(_0x41675a){if(_0x41675a){return _0x39bd66[_0x8d49('0x15')](_0x431b13);}return _0x39bd66[_0x8d49('0x16')](_0x431b13)[_0x8d49('0x17')]();};}function respondWithResult(_0x4fd4f2,_0x2171c4){_0x2171c4=_0x2171c4||0xc8;return function(_0x2a17bb){if(_0x2a17bb){return _0x4fd4f2[_0x8d49('0x16')](_0x2171c4)[_0x8d49('0x18')](_0x2a17bb);}};}function respondWithFilteredResult(_0x5c823d,_0x992090){return function(_0xe5ed9){if(_0xe5ed9){var _0x56869d=typeof _0x992090['offset']===_0x8d49('0x19')&&typeof _0x992090[_0x8d49('0x1a')]===_0x8d49('0x19');var _0x30058d=_0xe5ed9[_0x8d49('0x1b')];var _0x34927c=_0x56869d?0x0:_0x992090['offset'];var _0x4469b6=_0x56869d?_0xe5ed9['count']:_0x992090[_0x8d49('0x1c')]+_0x992090['limit'];var _0x4b6bf4;if(_0x4469b6>=_0x30058d){_0x4469b6=_0x30058d;_0x4b6bf4=0xc8;}else{_0x4b6bf4=0xce;}_0x5c823d[_0x8d49('0x16')](_0x4b6bf4);return _0x5c823d[_0x8d49('0x1d')](_0x8d49('0x1e'),_0x34927c+'-'+_0x4469b6+'/'+_0x30058d)['json'](_0xe5ed9);}return null;};}function patchUpdates(_0x31d750){return function(_0x3e5fd6){try{jsonpatch[_0x8d49('0x1f')](_0x3e5fd6,_0x31d750,!![]);}catch(_0x5baf26){return BPromise[_0x8d49('0x20')](_0x5baf26);}return _0x3e5fd6[_0x8d49('0x21')]();};}function saveUpdates(_0x1ef0e5,_0x2c1da9){return function(_0x449fca){if(_0x449fca){return _0x449fca[_0x8d49('0x22')](_0x1ef0e5)[_0x8d49('0x23')](function(_0x364827){return _0x364827;});}return null;};}function removeEntity(_0x1737b2,_0x2adf92){return function(_0x3d1fff){if(_0x3d1fff){return _0x3d1fff[_0x8d49('0x24')]()['then'](function(){_0x1737b2[_0x8d49('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ef196,_0x39e44b){return function(_0x1f941e){if(!_0x1f941e){_0x1ef196[_0x8d49('0x15')](0x194);}return _0x1f941e;};}function handleError(_0x568b26,_0x17948){_0x17948=_0x17948||0x1f4;return function(_0x95c7e){logger['error'](_0x95c7e['stack']);if(_0x95c7e[_0x8d49('0x25')]){delete _0x95c7e[_0x8d49('0x25')];}_0x568b26[_0x8d49('0x16')](_0x17948)[_0x8d49('0x26')](_0x95c7e);};}exports[_0x8d49('0x27')]=function(_0x5c7954,_0x5592b2){var _0x3b5e21={},_0x2e1c5c={},_0xbea27a={'count':0x0,'rows':[]};var _0x2cf404=_[_0x8d49('0x28')](db[_0x8d49('0x29')][_0x8d49('0x2a')],function(_0x59efae){return{'name':_0x59efae[_0x8d49('0x2b')],'type':_0x59efae[_0x8d49('0x2c')][_0x8d49('0x2d')]};});_0x2e1c5c[_0x8d49('0x2e')]=_[_0x8d49('0x28')](_0x2cf404,'name');_0x2e1c5c[_0x8d49('0x2f')]=_[_0x8d49('0x30')](_0x5c7954[_0x8d49('0x2f')]);_0x2e1c5c['filters']=_['intersection'](_0x2e1c5c[_0x8d49('0x2e')],_0x2e1c5c[_0x8d49('0x2f')]);_0x3b5e21[_0x8d49('0x31')]=_[_0x8d49('0x32')](_0x2e1c5c[_0x8d49('0x2e')],qs[_0x8d49('0x33')](_0x5c7954[_0x8d49('0x2f')][_0x8d49('0x33')]));_0x3b5e21[_0x8d49('0x31')]=_0x3b5e21['attributes']['length']?_0x3b5e21[_0x8d49('0x31')]:_0x2e1c5c[_0x8d49('0x2e')];if(!_0x5c7954['query']['hasOwnProperty'](_0x8d49('0x34'))){_0x3b5e21['limit']=qs[_0x8d49('0x1a')](_0x5c7954[_0x8d49('0x2f')][_0x8d49('0x1a')]);_0x3b5e21['offset']=qs[_0x8d49('0x1c')](_0x5c7954[_0x8d49('0x2f')][_0x8d49('0x1c')]);}_0x3b5e21[_0x8d49('0x35')]=qs[_0x8d49('0x36')](_0x5c7954[_0x8d49('0x2f')][_0x8d49('0x36')]);_0x3b5e21['where']=qs['filters'](_[_0x8d49('0x37')](_0x5c7954['query'],_0x2e1c5c[_0x8d49('0x38')]),_0x2cf404);if(_0x5c7954[_0x8d49('0x2f')][_0x8d49('0x39')]){_0x3b5e21[_0x8d49('0x3a')]=_[_0x8d49('0x3b')](_0x3b5e21[_0x8d49('0x3a')],{'$or':_[_0x8d49('0x28')](_0x2cf404,function(_0x57c6b2){if(_0x57c6b2['type']!==_0x8d49('0x3c')){var _0x574b5a={};_0x574b5a[_0x57c6b2['name']]={'$like':'%'+_0x5c7954[_0x8d49('0x2f')][_0x8d49('0x39')]+'%'};return _0x574b5a;}})});}_0x3b5e21=_[_0x8d49('0x3b')]({},_0x3b5e21,_0x5c7954[_0x8d49('0x3d')]);var _0x1a83e8={'where':_0x3b5e21['where']};return db[_0x8d49('0x29')][_0x8d49('0x1b')](_0x1a83e8)['then'](function(_0x2f9219){_0xbea27a[_0x8d49('0x1b')]=_0x2f9219;if(_0x5c7954[_0x8d49('0x2f')][_0x8d49('0x3e')]){_0x3b5e21['include']=[{'all':!![]}];}return db[_0x8d49('0x29')][_0x8d49('0x3f')](_0x3b5e21);})[_0x8d49('0x23')](function(_0x4a176f){_0xbea27a[_0x8d49('0x40')]=_0x4a176f;return _0xbea27a;})[_0x8d49('0x23')](respondWithFilteredResult(_0x5592b2,_0x3b5e21))[_0x8d49('0x41')](handleError(_0x5592b2,null));};exports['show']=function(_0x4ed33c,_0x168f2a){var _0x56d1de={'raw':!![],'where':{'id':_0x4ed33c['params']['id']}},_0x10f04e={};_0x10f04e[_0x8d49('0x2e')]=_[_0x8d49('0x30')](db[_0x8d49('0x29')][_0x8d49('0x2a')]);_0x10f04e[_0x8d49('0x2f')]=_['keys'](_0x4ed33c[_0x8d49('0x2f')]);_0x10f04e['filters']=_[_0x8d49('0x32')](_0x10f04e['model'],_0x10f04e[_0x8d49('0x2f')]);_0x56d1de[_0x8d49('0x31')]=_[_0x8d49('0x32')](_0x10f04e[_0x8d49('0x2e')],qs[_0x8d49('0x33')](_0x4ed33c[_0x8d49('0x2f')][_0x8d49('0x33')]));_0x56d1de[_0x8d49('0x31')]=_0x56d1de['attributes'][_0x8d49('0x42')]?_0x56d1de['attributes']:_0x10f04e[_0x8d49('0x2e')];if(_0x4ed33c[_0x8d49('0x2f')][_0x8d49('0x3e')]){_0x56d1de[_0x8d49('0x43')]=[{'all':!![]}];}_0x56d1de=_[_0x8d49('0x3b')]({},_0x56d1de,_0x4ed33c['options']);return db[_0x8d49('0x29')][_0x8d49('0x44')](_0x56d1de)[_0x8d49('0x23')](handleEntityNotFound(_0x168f2a,null))['then'](respondWithResult(_0x168f2a,null))[_0x8d49('0x41')](handleError(_0x168f2a,null));};exports[_0x8d49('0x45')]=function(_0x39e249,_0x3c8d9f){return db['CmHopperHistory'][_0x8d49('0x45')](_0x39e249['body'],{})[_0x8d49('0x23')](respondWithResult(_0x3c8d9f,0xc9))[_0x8d49('0x41')](handleError(_0x3c8d9f,null));};exports[_0x8d49('0x46')]=function(_0x1a482b,_0x168a7f){return db[_0x8d49('0x29')][_0x8d49('0x46')]()[_0x8d49('0x23')](respondWithResult(_0x168a7f,null))[_0x8d49('0x41')](handleError(_0x168a7f,null));};exports[_0x8d49('0x22')]=function(_0x15e4b0,_0x485918){if(_0x15e4b0['body']['uniqueid']){delete _0x15e4b0[_0x8d49('0x47')][_0x8d49('0x48')];}return db[_0x8d49('0x29')][_0x8d49('0x44')]({'where':{'uniqueid':_0x15e4b0[_0x8d49('0x49')]['id']}})[_0x8d49('0x23')](handleEntityNotFound(_0x485918,null))[_0x8d49('0x23')](saveUpdates(_0x15e4b0['body'],null))['then'](respondWithResult(_0x485918,null))[_0x8d49('0x41')](handleError(_0x485918,null));}; \ No newline at end of file +var _0x3490=['../../config/license/util','../../mysqldb','sendStatus','end','status','offset','limit','undefined','count','set','Content-Range','json','apply','save','update','then','error','stack','name','send','index','map','CmHopperHistory','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','filter','where','merge','options','rows','catch','params','rawAttributes','includeAll','include','create','body','describe','uniqueid','find','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','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','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x418e7c,_0x955927){var _0x574fca=function(_0x3c26ce){while(--_0x3c26ce){_0x418e7c['push'](_0x418e7c['shift']());}};_0x574fca(++_0x955927);}(_0x3490,0x11e));var _0x0349=function(_0xdf5e2a,_0x4ec27b){_0xdf5e2a=_0xdf5e2a-0x0;var _0x55ff2d=_0x3490[_0xdf5e2a];return _0x55ff2d;};'use strict';var emlformat=require(_0x0349('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0349('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0349('0x2'));var moment=require('moment');var BPromise=require(_0x0349('0x3'));var Mustache=require(_0x0349('0x4'));var util=require(_0x0349('0x5'));var path=require(_0x0349('0x6'));var sox=require(_0x0349('0x7'));var csv=require('to-csv');var ejs=require(_0x0349('0x8'));var fs=require('fs');var fs_extra=require(_0x0349('0x9'));var _=require(_0x0349('0xa'));var squel=require(_0x0349('0xb'));var crypto=require(_0x0349('0xc'));var jsforce=require(_0x0349('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x0349('0xe'));var querystring=require(_0x0349('0xf'));var Papa=require(_0x0349('0x10'));var Redis=require(_0x0349('0x11'));var authService=require(_0x0349('0x12'));var qs=require(_0x0349('0x13'));var as=require(_0x0349('0x14'));var hardwareService=require(_0x0349('0x15'));var logger=require(_0x0349('0x16'))(_0x0349('0x17'));var utils=require(_0x0349('0x18'));var config=require(_0x0349('0x19'));var licenseUtil=require(_0x0349('0x1a'));var db=require(_0x0349('0x1b'))['db'];function respondWithStatusCode(_0xaea42a,_0x1eca86){_0x1eca86=_0x1eca86||0xcc;return function(_0x5d50b1){if(_0x5d50b1){return _0xaea42a[_0x0349('0x1c')](_0x1eca86);}return _0xaea42a['status'](_0x1eca86)[_0x0349('0x1d')]();};}function respondWithResult(_0x4d9973,_0x1f1f9f){_0x1f1f9f=_0x1f1f9f||0xc8;return function(_0x46f20d){if(_0x46f20d){return _0x4d9973[_0x0349('0x1e')](_0x1f1f9f)['json'](_0x46f20d);}};}function respondWithFilteredResult(_0x34a384,_0x24063a){return function(_0x55fca5){if(_0x55fca5){var _0xc16fd2=typeof _0x24063a[_0x0349('0x1f')]==='undefined'&&typeof _0x24063a[_0x0349('0x20')]===_0x0349('0x21');var _0x41a48f=_0x55fca5[_0x0349('0x22')];var _0x1f2f9a=_0xc16fd2?0x0:_0x24063a[_0x0349('0x1f')];var _0x5eadb6=_0xc16fd2?_0x55fca5[_0x0349('0x22')]:_0x24063a['offset']+_0x24063a['limit'];var _0x10af06;if(_0x5eadb6>=_0x41a48f){_0x5eadb6=_0x41a48f;_0x10af06=0xc8;}else{_0x10af06=0xce;}_0x34a384[_0x0349('0x1e')](_0x10af06);return _0x34a384[_0x0349('0x23')](_0x0349('0x24'),_0x1f2f9a+'-'+_0x5eadb6+'/'+_0x41a48f)[_0x0349('0x25')](_0x55fca5);}return null;};}function patchUpdates(_0x108b9f){return function(_0x1da2c0){try{jsonpatch[_0x0349('0x26')](_0x1da2c0,_0x108b9f,!![]);}catch(_0x17cdfa){return BPromise['reject'](_0x17cdfa);}return _0x1da2c0[_0x0349('0x27')]();};}function saveUpdates(_0x15abbe,_0x2e9439){return function(_0x4cb9df){if(_0x4cb9df){return _0x4cb9df[_0x0349('0x28')](_0x15abbe)[_0x0349('0x29')](function(_0x3725d6){return _0x3725d6;});}return null;};}function removeEntity(_0x57d74d,_0x92289d){return function(_0x456228){if(_0x456228){return _0x456228['destroy']()['then'](function(){_0x57d74d[_0x0349('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16d460,_0x69ff38){return function(_0x145867){if(!_0x145867){_0x16d460[_0x0349('0x1c')](0x194);}return _0x145867;};}function handleError(_0x71f7aa,_0x2539b4){_0x2539b4=_0x2539b4||0x1f4;return function(_0x272156){logger[_0x0349('0x2a')](_0x272156[_0x0349('0x2b')]);if(_0x272156[_0x0349('0x2c')]){delete _0x272156['name'];}_0x71f7aa[_0x0349('0x1e')](_0x2539b4)[_0x0349('0x2d')](_0x272156);};}exports[_0x0349('0x2e')]=function(_0x2428d4,_0x476cef){var _0x143269={},_0x493ed7={},_0x16c233={'count':0x0,'rows':[]};var _0x5a1a71=_[_0x0349('0x2f')](db[_0x0349('0x30')]['rawAttributes'],function(_0x2b97ac){return{'name':_0x2b97ac[_0x0349('0x31')],'type':_0x2b97ac[_0x0349('0x32')][_0x0349('0x33')]};});_0x493ed7[_0x0349('0x34')]=_[_0x0349('0x2f')](_0x5a1a71,_0x0349('0x2c'));_0x493ed7[_0x0349('0x35')]=_[_0x0349('0x36')](_0x2428d4[_0x0349('0x35')]);_0x493ed7[_0x0349('0x37')]=_[_0x0349('0x38')](_0x493ed7['model'],_0x493ed7[_0x0349('0x35')]);_0x143269[_0x0349('0x39')]=_[_0x0349('0x38')](_0x493ed7[_0x0349('0x34')],qs['fields'](_0x2428d4[_0x0349('0x35')][_0x0349('0x3a')]));_0x143269[_0x0349('0x39')]=_0x143269['attributes'][_0x0349('0x3b')]?_0x143269[_0x0349('0x39')]:_0x493ed7[_0x0349('0x34')];if(!_0x2428d4[_0x0349('0x35')][_0x0349('0x3c')]('nolimit')){_0x143269[_0x0349('0x20')]=qs['limit'](_0x2428d4[_0x0349('0x35')]['limit']);_0x143269[_0x0349('0x1f')]=qs[_0x0349('0x1f')](_0x2428d4['query'][_0x0349('0x1f')]);}_0x143269[_0x0349('0x3d')]=qs[_0x0349('0x3e')](_0x2428d4[_0x0349('0x35')][_0x0349('0x3e')]);_0x143269['where']=qs['filters'](_['pick'](_0x2428d4[_0x0349('0x35')],_0x493ed7[_0x0349('0x37')]),_0x5a1a71);if(_0x2428d4[_0x0349('0x35')][_0x0349('0x3f')]){_0x143269[_0x0349('0x40')]=_['merge'](_0x143269[_0x0349('0x40')],{'$or':_[_0x0349('0x2f')](_0x5a1a71,function(_0x12f438){if(_0x12f438[_0x0349('0x32')]!=='VIRTUAL'){var _0x2da5b6={};_0x2da5b6[_0x12f438[_0x0349('0x2c')]]={'$like':'%'+_0x2428d4[_0x0349('0x35')][_0x0349('0x3f')]+'%'};return _0x2da5b6;}})});}_0x143269=_[_0x0349('0x41')]({},_0x143269,_0x2428d4[_0x0349('0x42')]);var _0x3c3ca8={'where':_0x143269['where']};return db[_0x0349('0x30')][_0x0349('0x22')](_0x3c3ca8)[_0x0349('0x29')](function(_0x39ed68){_0x16c233[_0x0349('0x22')]=_0x39ed68;if(_0x2428d4[_0x0349('0x35')]['includeAll']){_0x143269['include']=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x143269);})['then'](function(_0x399b76){_0x16c233[_0x0349('0x43')]=_0x399b76;return _0x16c233;})[_0x0349('0x29')](respondWithFilteredResult(_0x476cef,_0x143269))[_0x0349('0x44')](handleError(_0x476cef,null));};exports['show']=function(_0x226970,_0x15584e){var _0x5d2601={'raw':!![],'where':{'id':_0x226970[_0x0349('0x45')]['id']}},_0x52e375={};_0x52e375['model']=_['keys'](db['CmHopperHistory'][_0x0349('0x46')]);_0x52e375[_0x0349('0x35')]=_['keys'](_0x226970[_0x0349('0x35')]);_0x52e375['filters']=_['intersection'](_0x52e375['model'],_0x52e375[_0x0349('0x35')]);_0x5d2601[_0x0349('0x39')]=_['intersection'](_0x52e375[_0x0349('0x34')],qs[_0x0349('0x3a')](_0x226970[_0x0349('0x35')][_0x0349('0x3a')]));_0x5d2601[_0x0349('0x39')]=_0x5d2601['attributes']['length']?_0x5d2601['attributes']:_0x52e375['model'];if(_0x226970[_0x0349('0x35')][_0x0349('0x47')]){_0x5d2601[_0x0349('0x48')]=[{'all':!![]}];}_0x5d2601=_[_0x0349('0x41')]({},_0x5d2601,_0x226970[_0x0349('0x42')]);return db['CmHopperHistory']['find'](_0x5d2601)[_0x0349('0x29')](handleEntityNotFound(_0x15584e,null))[_0x0349('0x29')](respondWithResult(_0x15584e,null))['catch'](handleError(_0x15584e,null));};exports['create']=function(_0x1e3b96,_0x411dec){return db[_0x0349('0x30')][_0x0349('0x49')](_0x1e3b96[_0x0349('0x4a')],{})[_0x0349('0x29')](respondWithResult(_0x411dec,0xc9))[_0x0349('0x44')](handleError(_0x411dec,null));};exports[_0x0349('0x4b')]=function(_0x5da32c,_0x3e885f){return db[_0x0349('0x30')]['describe']()[_0x0349('0x29')](respondWithResult(_0x3e885f,null))[_0x0349('0x44')](handleError(_0x3e885f,null));};exports[_0x0349('0x28')]=function(_0x1b3f5f,_0x3eb94f){if(_0x1b3f5f[_0x0349('0x4a')][_0x0349('0x4c')]){delete _0x1b3f5f[_0x0349('0x4a')][_0x0349('0x4c')];}return db['CmHopperHistory'][_0x0349('0x4d')]({'where':{'uniqueid':_0x1b3f5f[_0x0349('0x45')]['id']}})[_0x0349('0x29')](handleEntityNotFound(_0x3eb94f,null))[_0x0349('0x29')](saveUpdates(_0x1b3f5f[_0x0349('0x4a')],null))[_0x0349('0x29')](respondWithResult(_0x3eb94f,null))[_0x0349('0x44')](handleError(_0x3eb94f,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 64e06a8..95f5cea 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 _0x1399=['lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperHistory.attributes','define','CmHopperHistory','endtime','uniqueid'];(function(_0x4ed8b6,_0x5bf2a4){var _0x44de3d=function(_0x4cfde2){while(--_0x4cfde2){_0x4ed8b6['push'](_0x4ed8b6['shift']());}};_0x44de3d(++_0x5bf2a4);}(_0x1399,0x16c));var _0x9139=function(_0x562faa,_0x23adc7){_0x562faa=_0x562faa-0x0;var _0xc70f59=_0x1399[_0x562faa];return _0xc70f59;};'use strict';var _=require(_0x9139('0x0'));var util=require(_0x9139('0x1'));var logger=require('../../config/logger')(_0x9139('0x2'));var moment=require('moment');var BPromise=require(_0x9139('0x3'));var rp=require(_0x9139('0x4'));var fs=require('fs');var path=require(_0x9139('0x5'));var rimraf=require(_0x9139('0x6'));var config=require(_0x9139('0x7'));var attributes=require(_0x9139('0x8'));module['exports']=function(_0x54af2d,_0x8f086b){return _0x54af2d[_0x9139('0x9')](_0x9139('0xa'),attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':_0x9139('0xb'),'fields':['endtime']},{'name':'uniqueid','fields':[_0x9139('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8cad=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util'];(function(_0x4ed958,_0x14bcd6){var _0x2d2c88=function(_0x19192f){while(--_0x19192f){_0x4ed958['push'](_0x4ed958['shift']());}};_0x2d2c88(++_0x14bcd6);}(_0x8cad,0xfe));var _0xd8ca=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x8cad[_0x4c12ec];return _0x3ae42c;};'use strict';var _=require(_0xd8ca('0x0'));var util=require(_0xd8ca('0x1'));var logger=require(_0xd8ca('0x2'))(_0xd8ca('0x3'));var moment=require(_0xd8ca('0x4'));var BPromise=require(_0xd8ca('0x5'));var rp=require(_0xd8ca('0x6'));var fs=require('fs');var path=require(_0xd8ca('0x7'));var rimraf=require(_0xd8ca('0x8'));var config=require(_0xd8ca('0x9'));var attributes=require(_0xd8ca('0xa'));module[_0xd8ca('0xb')]=function(_0x14c73e,_0x6d5070){return _0x14c73e['define'](_0xd8ca('0xc'),attributes,{'tableName':_0xd8ca('0xd'),'paranoid':![],'indexes':[{'name':_0xd8ca('0xe'),'fields':[_0xd8ca('0xe')]},{'name':_0xd8ca('0xf'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 76609df..c8fac13 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 _0xca2b=['ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CmHopperHistory','options','then','CreateCmHopperHistory','catch','AvgHandleTime','findAll','raw','where','COUNT','sequelize','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','`state`\x20=\x2010,\x201,\x20null','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','outboundUnknownCallsDay','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory'];(function(_0xdcb03a,_0x2005ea){var _0x12f4de=function(_0x5bf69d){while(--_0x5bf69d){_0xdcb03a['push'](_0xdcb03a['shift']());}};_0x12f4de(++_0x2005ea);}(_0xca2b,0x156));var _0xbca2=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xca2b[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xbca2('0x0'));var util=require(_0xbca2('0x1'));var moment=require(_0xbca2('0x2'));var BPromise=require(_0xbca2('0x3'));var rs=require(_0xbca2('0x4'));var fs=require('fs');var Redis=require(_0xbca2('0x5'));var db=require(_0xbca2('0x6'))['db'];var utils=require(_0xbca2('0x7'));var logger=require('../../config/logger')(_0xbca2('0x8'));var config=require(_0xbca2('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xbca2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3476ee,_0x214cdf,_0x226fca){return new BPromise(function(_0x562cf5,_0x4b08fb){return client[_0xbca2('0xb')](_0x3476ee,_0x226fca)['then'](function(_0x4dcbb8){logger[_0xbca2('0xc')](_0xbca2('0xd'),_0x214cdf,_0xbca2('0xe'));logger[_0xbca2('0xf')](_0xbca2('0x10'),_0x214cdf,_0xbca2('0xe'),JSON[_0xbca2('0x11')](_0x4dcbb8));if(_0x4dcbb8[_0xbca2('0x12')]){if(_0x4dcbb8[_0xbca2('0x12')][_0xbca2('0x13')]===0x1f4){logger[_0xbca2('0x12')](_0xbca2('0xd'),_0x214cdf,_0x4dcbb8[_0xbca2('0x12')]['message']);return _0x4b08fb(_0x4dcbb8[_0xbca2('0x12')][_0xbca2('0x14')]);}logger[_0xbca2('0x12')](_0xbca2('0xd'),_0x214cdf,_0x4dcbb8[_0xbca2('0x12')][_0xbca2('0x14')]);return _0x562cf5(_0x4dcbb8[_0xbca2('0x12')][_0xbca2('0x14')]);}else{logger[_0xbca2('0xc')]('CmHopperHistory,\x20%s,\x20%s',_0x214cdf,'request\x20sent');_0x562cf5(_0x4dcbb8[_0xbca2('0x15')][_0xbca2('0x14')]);}})['catch'](function(_0x9d7a88){logger[_0xbca2('0x12')](_0xbca2('0xd'),_0x214cdf,_0x9d7a88);_0x4b08fb(_0x9d7a88);});});}exports['CreateCmHopperHistory']=function(_0x390095){var _0xfd34d3=this;return new Promise(function(_0x298b00,_0x345a9e){return db[_0xbca2('0x16')]['create'](_0x390095['body'],{'raw':_0x390095[_0xbca2('0x17')]?_0x390095[_0xbca2('0x17')]['raw']===undefined?!![]:![]:!![]})[_0xbca2('0x18')](function(_0x109b44){logger[_0xbca2('0xc')](_0xbca2('0x19'),_0x390095);logger[_0xbca2('0xf')](_0xbca2('0x19'),_0x390095,JSON['stringify'](_0x109b44));_0x298b00(_0x109b44);})[_0xbca2('0x1a')](function(_0x20b65d){logger[_0xbca2('0x12')](_0xbca2('0x19'),_0x20b65d[_0xbca2('0x14')],_0x390095);_0x345a9e(_0xfd34d3[_0xbca2('0x12')](0x1f4,_0x20b65d[_0xbca2('0x14')]));});});};exports[_0xbca2('0x1b')]=function(_0x8cdb5d){var _0x269ba4=this;return new Promise(function(_0xd27b87,_0x25d134){return db['CmHopperHistory'][_0xbca2('0x1c')]({'raw':_0x8cdb5d[_0xbca2('0x17')]?_0x8cdb5d[_0xbca2('0x17')][_0xbca2('0x1d')]===undefined?!![]:![]:!![],'where':_0x8cdb5d[_0xbca2('0x17')]?_0x8cdb5d[_0xbca2('0x17')][_0xbca2('0x1e')]||null:null,'attributes':[[db['sequelize']['fn'](_0xbca2('0x1f'),db[_0xbca2('0x20')][_0xbca2('0x21')]('id')),_0xbca2('0x22')],[db[_0xbca2('0x20')]['fn'](_0xbca2('0x1f'),db[_0xbca2('0x20')]['fn']('IF',db[_0xbca2('0x20')][_0xbca2('0x23')](_0xbca2('0x24')))),'predictiveIntervalAnsweredCalls'],[db[_0xbca2('0x20')]['fn']('COUNT',db[_0xbca2('0x20')]['fn']('IF',db['sequelize']['literal'](_0xbca2('0x25')))),'predictiveIntervalDroppedCallsTimeout'],[db[_0xbca2('0x20')]['fn'](_0xbca2('0x1f'),db['sequelize']['fn']('IF',db['sequelize'][_0xbca2('0x23')](_0xbca2('0x26')))),_0xbca2('0x27')],[db[_0xbca2('0x20')]['fn'](_0xbca2('0x28'),db[_0xbca2('0x20')]['fn']('IF',db[_0xbca2('0x20')][_0xbca2('0x23')](_0xbca2('0x29')))),_0xbca2('0x2a')],[db[_0xbca2('0x20')]['fn']('AVG',db[_0xbca2('0x20')]['fn']('IF',db[_0xbca2('0x20')][_0xbca2('0x23')]('`state`\x20=\x204,\x20`talktime`,\x20null'))),_0xbca2('0x2b')]]})[_0xbca2('0x18')](function(_0x11b902){logger[_0xbca2('0xc')](_0xbca2('0x1b'),_0x8cdb5d);logger[_0xbca2('0xf')](_0xbca2('0x1b'),_0x8cdb5d,JSON[_0xbca2('0x11')](_0x11b902));_0xd27b87(_0x11b902);})[_0xbca2('0x1a')](function(_0x2c415e){logger[_0xbca2('0x12')]('AvgHandleTime',_0x2c415e['message'],_0x8cdb5d);_0x25d134(_0x269ba4[_0xbca2('0x12')](0x1f4,_0x2c415e[_0xbca2('0x14')]));});});};exports[_0xbca2('0x2c')]=function(_0x45bd04){var _0x3aeab3=this;return new Promise(function(_0x56b5cc,_0x446ef6){return db[_0xbca2('0x16')][_0xbca2('0x1c')]({'raw':_0x45bd04[_0xbca2('0x17')]?_0x45bd04[_0xbca2('0x17')][_0xbca2('0x1d')]===undefined?!![]:![]:!![],'where':_0x45bd04[_0xbca2('0x17')]?_0x45bd04[_0xbca2('0x17')][_0xbca2('0x1e')]||null:null,'attributes':[[_0xbca2('0x2d'),_0xbca2('0x2e')],[db[_0xbca2('0x20')]['fn']('COUNT',db[_0xbca2('0x20')]['fn']('IF',db['sequelize'][_0xbca2('0x23')](_0xbca2('0x2f')))),_0xbca2('0x30')],[db[_0xbca2('0x20')]['fn'](_0xbca2('0x1f'),db['sequelize']['fn']('IF',db['sequelize']['literal']('`state`\x20=\x203,\x201,\x20null'))),'outboundNoAnswerCallsDay'],[db[_0xbca2('0x20')]['fn']('COUNT',db[_0xbca2('0x20')]['fn']('IF',db[_0xbca2('0x20')]['literal']('`state`\x20=\x204,\x201,\x20null'))),_0xbca2('0x31')],[db[_0xbca2('0x20')]['fn'](_0xbca2('0x1f'),db[_0xbca2('0x20')]['fn']('IF',db[_0xbca2('0x20')][_0xbca2('0x23')](_0xbca2('0x32')))),'outboundBusyCallsDay'],[db[_0xbca2('0x20')]['fn'](_0xbca2('0x1f'),db[_0xbca2('0x20')]['fn']('IF',db['sequelize']['literal'](_0xbca2('0x33')))),_0xbca2('0x34')],[db[_0xbca2('0x20')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xbca2('0x20')]['literal']('`state`\x20=\x2010\x20,\x201,\x20null'))),'outboundDropCallsDayTimeout'],[db['sequelize']['fn'](_0xbca2('0x1f'),db[_0xbca2('0x20')]['fn']('IF',db[_0xbca2('0x20')]['literal'](_0xbca2('0x35')))),_0xbca2('0x36')],[db[_0xbca2('0x20')]['fn'](_0xbca2('0x1f'),db[_0xbca2('0x20')]['fn']('IF',db[_0xbca2('0x20')][_0xbca2('0x23')]('`state`\x20=\x2012,\x201,\x20null'))),_0xbca2('0x37')],[db[_0xbca2('0x20')]['fn'](_0xbca2('0x1f'),db['sequelize']['fn']('IF',db[_0xbca2('0x20')][_0xbca2('0x23')]('`state`\x20=\x2013,\x201,\x20null'))),_0xbca2('0x38')],[db['sequelize']['fn'](_0xbca2('0x1f'),db[_0xbca2('0x20')]['fn']('IF',db[_0xbca2('0x20')][_0xbca2('0x23')](_0xbca2('0x39')))),_0xbca2('0x3a')],[db[_0xbca2('0x20')]['fn'](_0xbca2('0x1f'),db[_0xbca2('0x20')]['fn']('IF',db[_0xbca2('0x20')][_0xbca2('0x23')](_0xbca2('0x3b')))),_0xbca2('0x3c')],[db[_0xbca2('0x20')]['fn'](_0xbca2('0x1f'),db[_0xbca2('0x20')]['fn']('IF',db[_0xbca2('0x20')][_0xbca2('0x23')](_0xbca2('0x3d')))),'outboundAnswerAgiCallsDay'],[db[_0xbca2('0x20')]['fn'](_0xbca2('0x1f'),db['sequelize']['fn']('IF',db[_0xbca2('0x20')][_0xbca2('0x23')](_0xbca2('0x3e')))),_0xbca2('0x3c')],[db[_0xbca2('0x20')]['fn'](_0xbca2('0x1f'),db[_0xbca2('0x20')]['fn']('IF',db[_0xbca2('0x20')][_0xbca2('0x23')](_0xbca2('0x3f')))),_0xbca2('0x40')]],'group':['campaign']})[_0xbca2('0x18')](function(_0x472f39){logger[_0xbca2('0xc')](_0xbca2('0x2c'),_0x45bd04);logger[_0xbca2('0xf')](_0xbca2('0x2c'),_0x45bd04,JSON[_0xbca2('0x11')](_0x472f39));_0x56b5cc(_0x472f39);})['catch'](function(_0x47ea84){logger[_0xbca2('0x12')](_0xbca2('0x2c'),_0x47ea84[_0xbca2('0x14')],_0x45bd04);_0x446ef6(_0x3aeab3['error'](0x1f4,_0x47ea84[_0xbca2('0x14')]));});});};exports[_0xbca2('0x41')]=function(_0x36f160){var _0x2eacf1=this;return new Promise(function(_0x24b6f0,_0x3cd971){return db[_0xbca2('0x16')]['findAll']({'raw':_0x36f160['options']?_0x36f160[_0xbca2('0x17')][_0xbca2('0x1d')]===undefined?!![]:![]:!![],'where':_0x36f160[_0xbca2('0x17')]?_0x36f160[_0xbca2('0x17')][_0xbca2('0x1e')]||null:null,'attributes':[[_0xbca2('0x2d'),_0xbca2('0x2e')],[db['sequelize']['fn'](_0xbca2('0x1f'),db[_0xbca2('0x20')]['col']('id')),_0xbca2('0x42')],[db['sequelize']['fn'](_0xbca2('0x1f'),db[_0xbca2('0x20')]['fn']('IF',db[_0xbca2('0x20')][_0xbca2('0x23')](_0xbca2('0x24')))),_0xbca2('0x43')]],'group':[_0xbca2('0x2d')]})[_0xbca2('0x18')](function(_0x166497){logger['info']('GetCampaignHopperHistory',_0x36f160);logger[_0xbca2('0xf')](_0xbca2('0x41'),_0x36f160,JSON[_0xbca2('0x11')](_0x166497));_0x24b6f0(_0x166497);})[_0xbca2('0x1a')](function(_0x42818e){logger['error'](_0xbca2('0x41'),_0x42818e[_0xbca2('0x14')],_0x36f160);_0x3cd971(_0x2eacf1[_0xbca2('0x12')](0x1f4,_0x42818e['message']));});});}; \ No newline at end of file +var _0x2bc9=['AvgHandleTime','findAll','sequelize','COUNT','col','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','GetVoiceQueueHopperHistory','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','campaign','GetCampaignHopperHistory','where','ivrAnswerCallsDay','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','message','CmHopperHistory,\x20%s,\x20%s','catch','CreateCmHopperHistory','CmHopperHistory','create','options','raw'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x2bc9,0x1a7));var _0x92bc=function(_0x469393,_0x247969){_0x469393=_0x469393-0x0;var _0x5f720d=_0x2bc9[_0x469393];return _0x5f720d;};'use strict';var _=require('lodash');var util=require(_0x92bc('0x0'));var moment=require('moment');var BPromise=require(_0x92bc('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x92bc('0x2'));var db=require(_0x92bc('0x3'))['db'];var utils=require(_0x92bc('0x4'));var logger=require(_0x92bc('0x5'))(_0x92bc('0x6'));var config=require('../../config/environment');var jayson=require(_0x92bc('0x7'));var client=jayson[_0x92bc('0x8')][_0x92bc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x156bd4,_0x5a30b5,_0x32114e){return new BPromise(function(_0x3f938f,_0xa86670){return client[_0x92bc('0xa')](_0x156bd4,_0x32114e)[_0x92bc('0xb')](function(_0xe4fa98){logger[_0x92bc('0xc')]('CmHopperHistory,\x20%s,\x20%s',_0x5a30b5,_0x92bc('0xd'));logger[_0x92bc('0xe')]('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x5a30b5,_0x92bc('0xd'),JSON[_0x92bc('0xf')](_0xe4fa98));if(_0xe4fa98[_0x92bc('0x10')]){if(_0xe4fa98['error']['code']===0x1f4){logger[_0x92bc('0x10')]('CmHopperHistory,\x20%s,\x20%s',_0x5a30b5,_0xe4fa98[_0x92bc('0x10')]['message']);return _0xa86670(_0xe4fa98[_0x92bc('0x10')][_0x92bc('0x11')]);}logger['error'](_0x92bc('0x12'),_0x5a30b5,_0xe4fa98['error']['message']);return _0x3f938f(_0xe4fa98[_0x92bc('0x10')][_0x92bc('0x11')]);}else{logger[_0x92bc('0xc')](_0x92bc('0x12'),_0x5a30b5,'request\x20sent');_0x3f938f(_0xe4fa98['result'][_0x92bc('0x11')]);}})[_0x92bc('0x13')](function(_0x50de5c){logger[_0x92bc('0x10')](_0x92bc('0x12'),_0x5a30b5,_0x50de5c);_0xa86670(_0x50de5c);});});}exports[_0x92bc('0x14')]=function(_0x2cfab1){var _0xde9ecb=this;return new Promise(function(_0x4b7226,_0x4df991){return db[_0x92bc('0x15')][_0x92bc('0x16')](_0x2cfab1['body'],{'raw':_0x2cfab1['options']?_0x2cfab1[_0x92bc('0x17')][_0x92bc('0x18')]===undefined?!![]:![]:!![]})[_0x92bc('0xb')](function(_0x27150c){logger[_0x92bc('0xc')](_0x92bc('0x14'),_0x2cfab1);logger[_0x92bc('0xe')](_0x92bc('0x14'),_0x2cfab1,JSON[_0x92bc('0xf')](_0x27150c));_0x4b7226(_0x27150c);})[_0x92bc('0x13')](function(_0x474a3b){logger[_0x92bc('0x10')](_0x92bc('0x14'),_0x474a3b[_0x92bc('0x11')],_0x2cfab1);_0x4df991(_0xde9ecb[_0x92bc('0x10')](0x1f4,_0x474a3b['message']));});});};exports[_0x92bc('0x19')]=function(_0x265354){var _0x20d89a=this;return new Promise(function(_0x596eb2,_0x16bf65){return db['CmHopperHistory'][_0x92bc('0x1a')]({'raw':_0x265354[_0x92bc('0x17')]?_0x265354['options']['raw']===undefined?!![]:![]:!![],'where':_0x265354[_0x92bc('0x17')]?_0x265354[_0x92bc('0x17')]['where']||null:null,'attributes':[[db[_0x92bc('0x1b')]['fn'](_0x92bc('0x1c'),db[_0x92bc('0x1b')][_0x92bc('0x1d')]('id')),'predictiveIntervalTotalCalls'],[db['sequelize']['fn']('COUNT',db[_0x92bc('0x1b')]['fn']('IF',db[_0x92bc('0x1b')][_0x92bc('0x1e')](_0x92bc('0x1f')))),_0x92bc('0x20')],[db[_0x92bc('0x1b')]['fn'](_0x92bc('0x1c'),db[_0x92bc('0x1b')]['fn']('IF',db[_0x92bc('0x1b')][_0x92bc('0x1e')]('`state`\x20=\x2010,\x201,\x20null'))),_0x92bc('0x21')],[db[_0x92bc('0x1b')]['fn'](_0x92bc('0x1c'),db[_0x92bc('0x1b')]['fn']('IF',db[_0x92bc('0x1b')]['literal'](_0x92bc('0x22')))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0x92bc('0x1b')]['fn'](_0x92bc('0x23'),db[_0x92bc('0x1b')]['fn']('IF',db['sequelize']['literal'](_0x92bc('0x24')))),_0x92bc('0x25')],[db[_0x92bc('0x1b')]['fn']('AVG',db[_0x92bc('0x1b')]['fn']('IF',db[_0x92bc('0x1b')][_0x92bc('0x1e')](_0x92bc('0x26')))),'predictiveIntervalAvgTalktime']]})[_0x92bc('0xb')](function(_0xb6c3cc){logger[_0x92bc('0xc')](_0x92bc('0x19'),_0x265354);logger['debug'](_0x92bc('0x19'),_0x265354,JSON[_0x92bc('0xf')](_0xb6c3cc));_0x596eb2(_0xb6c3cc);})[_0x92bc('0x13')](function(_0x15570a){logger[_0x92bc('0x10')](_0x92bc('0x19'),_0x15570a[_0x92bc('0x11')],_0x265354);_0x16bf65(_0x20d89a[_0x92bc('0x10')](0x1f4,_0x15570a[_0x92bc('0x11')]));});});};exports[_0x92bc('0x27')]=function(_0x7fe8ce){var _0x1de980=this;return new Promise(function(_0x1d3235,_0x1dad93){return db[_0x92bc('0x15')][_0x92bc('0x1a')]({'raw':_0x7fe8ce[_0x92bc('0x17')]?_0x7fe8ce[_0x92bc('0x17')][_0x92bc('0x18')]===undefined?!![]:![]:!![],'where':_0x7fe8ce[_0x92bc('0x17')]?_0x7fe8ce['options']['where']||null:null,'attributes':[['campaign',_0x92bc('0x28')],[db[_0x92bc('0x1b')]['fn']('COUNT',db[_0x92bc('0x1b')]['fn']('IF',db[_0x92bc('0x1b')][_0x92bc('0x1e')](_0x92bc('0x29')))),_0x92bc('0x2a')],[db['sequelize']['fn'](_0x92bc('0x1c'),db[_0x92bc('0x1b')]['fn']('IF',db[_0x92bc('0x1b')][_0x92bc('0x1e')](_0x92bc('0x2b')))),'outboundNoAnswerCallsDay'],[db[_0x92bc('0x1b')]['fn'](_0x92bc('0x1c'),db[_0x92bc('0x1b')]['fn']('IF',db['sequelize'][_0x92bc('0x1e')](_0x92bc('0x1f')))),'outboundAnswerCallsDay'],[db[_0x92bc('0x1b')]['fn']('COUNT',db[_0x92bc('0x1b')]['fn']('IF',db[_0x92bc('0x1b')][_0x92bc('0x1e')](_0x92bc('0x2c')))),'outboundBusyCallsDay'],[db[_0x92bc('0x1b')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x92bc('0x1e')](_0x92bc('0x2d')))),_0x92bc('0x2e')],[db[_0x92bc('0x1b')]['fn'](_0x92bc('0x1c'),db[_0x92bc('0x1b')]['fn']('IF',db[_0x92bc('0x1b')][_0x92bc('0x1e')](_0x92bc('0x2f')))),_0x92bc('0x30')],[db[_0x92bc('0x1b')]['fn'](_0x92bc('0x1c'),db[_0x92bc('0x1b')]['fn']('IF',db['sequelize']['literal'](_0x92bc('0x31')))),_0x92bc('0x32')],[db[_0x92bc('0x1b')]['fn'](_0x92bc('0x1c'),db[_0x92bc('0x1b')]['fn']('IF',db[_0x92bc('0x1b')][_0x92bc('0x1e')]('`state`\x20=\x2012,\x201,\x20null'))),'outboundUnknownCallsDay'],[db[_0x92bc('0x1b')]['fn'](_0x92bc('0x1c'),db['sequelize']['fn']('IF',db[_0x92bc('0x1b')][_0x92bc('0x1e')](_0x92bc('0x33')))),_0x92bc('0x34')],[db['sequelize']['fn'](_0x92bc('0x1c'),db[_0x92bc('0x1b')]['fn']('IF',db[_0x92bc('0x1b')]['literal'](_0x92bc('0x35')))),'outboundOriginateFailureCallsDay'],[db[_0x92bc('0x1b')]['fn'](_0x92bc('0x1c'),db[_0x92bc('0x1b')]['fn']('IF',db[_0x92bc('0x1b')][_0x92bc('0x1e')]('`state`\x20=\x2018,\x201,\x20null'))),_0x92bc('0x36')],[db[_0x92bc('0x1b')]['fn'](_0x92bc('0x1c'),db[_0x92bc('0x1b')]['fn']('IF',db[_0x92bc('0x1b')][_0x92bc('0x1e')](_0x92bc('0x37')))),_0x92bc('0x38')],[db[_0x92bc('0x1b')]['fn'](_0x92bc('0x1c'),db[_0x92bc('0x1b')]['fn']('IF',db[_0x92bc('0x1b')]['literal'](_0x92bc('0x39')))),_0x92bc('0x36')],[db[_0x92bc('0x1b')]['fn']('COUNT',db[_0x92bc('0x1b')]['fn']('IF',db['sequelize'][_0x92bc('0x1e')](_0x92bc('0x3a')))),_0x92bc('0x3b')]],'group':[_0x92bc('0x3c')]})[_0x92bc('0xb')](function(_0xaf0b69){logger[_0x92bc('0xc')](_0x92bc('0x27'),_0x7fe8ce);logger[_0x92bc('0xe')](_0x92bc('0x27'),_0x7fe8ce,JSON[_0x92bc('0xf')](_0xaf0b69));_0x1d3235(_0xaf0b69);})[_0x92bc('0x13')](function(_0xb5b5b8){logger[_0x92bc('0x10')](_0x92bc('0x27'),_0xb5b5b8[_0x92bc('0x11')],_0x7fe8ce);_0x1dad93(_0x1de980['error'](0x1f4,_0xb5b5b8[_0x92bc('0x11')]));});});};exports[_0x92bc('0x3d')]=function(_0x370c6c){var _0x28015c=this;return new Promise(function(_0x408b4e,_0x2acf46){return db[_0x92bc('0x15')][_0x92bc('0x1a')]({'raw':_0x370c6c[_0x92bc('0x17')]?_0x370c6c[_0x92bc('0x17')][_0x92bc('0x18')]===undefined?!![]:![]:!![],'where':_0x370c6c[_0x92bc('0x17')]?_0x370c6c[_0x92bc('0x17')][_0x92bc('0x3e')]||null:null,'attributes':[['campaign','name'],[db['sequelize']['fn'](_0x92bc('0x1c'),db[_0x92bc('0x1b')][_0x92bc('0x1d')]('id')),'ivrTotalCallsDays'],[db['sequelize']['fn'](_0x92bc('0x1c'),db[_0x92bc('0x1b')]['fn']('IF',db['sequelize'][_0x92bc('0x1e')]('`state`\x20=\x204,\x201,\x20null'))),_0x92bc('0x3f')]],'group':[_0x92bc('0x3c')]})['then'](function(_0x2fece1){logger[_0x92bc('0xc')](_0x92bc('0x3d'),_0x370c6c);logger['debug']('GetCampaignHopperHistory',_0x370c6c,JSON[_0x92bc('0xf')](_0x2fece1));_0x408b4e(_0x2fece1);})[_0x92bc('0x13')](function(_0x5f1ac9){logger['error'](_0x92bc('0x3d'),_0x5f1ac9[_0x92bc('0x11')],_0x370c6c);_0x2acf46(_0x28015c[_0x92bc('0x10')](0x1f4,_0x5f1ac9[_0x92bc('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 7e77fe7..9201075 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 _0x2f60=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/describe','/:id','show','create','put','exports','multer','util','path'];(function(_0x1099b5,_0x5f2787){var _0x2d65e9=function(_0x4cca4f){while(--_0x4cca4f){_0x1099b5['push'](_0x1099b5['shift']());}};_0x2d65e9(++_0x5f2787);}(_0x2f60,0x96));var _0x02f6=function(_0x48f287,_0x285c89){_0x48f287=_0x48f287-0x0;var _0x3b9800=_0x2f60[_0x48f287];return _0x3b9800;};'use strict';var multer=require(_0x02f6('0x0'));var util=require(_0x02f6('0x1'));var path=require(_0x02f6('0x2'));var timeout=require(_0x02f6('0x3'));var express=require(_0x02f6('0x4'));var router=express[_0x02f6('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x02f6('0x6'));var interaction=require(_0x02f6('0x7'));var config=require('../../config/environment');var controller=require('./cmHopperHistory.controller');router['get']('/',auth[_0x02f6('0x8')](),controller[_0x02f6('0x9')]);router[_0x02f6('0xa')](_0x02f6('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x02f6('0xa')](_0x02f6('0xc'),auth[_0x02f6('0x8')](),controller[_0x02f6('0xd')]);router['post']('/',auth[_0x02f6('0x8')](),controller[_0x02f6('0xe')]);router[_0x02f6('0xf')]('/:id',auth[_0x02f6('0x8')](),controller['update']);module[_0x02f6('0x10')]=router; \ No newline at end of file +var _0xe2ec=['./cmHopperHistory.controller','isAuthenticated','index','/describe','describe','get','/:id','show','post','put','update','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x65beae,_0x55acd6){var _0x474783=function(_0x1b726a){while(--_0x1b726a){_0x65beae['push'](_0x65beae['shift']());}};_0x474783(++_0x55acd6);}(_0xe2ec,0xc0));var _0xce2e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xe2ec[_0x4243a3];return _0x1b2a33;};'use strict';var multer=require(_0xce2e('0x0'));var util=require('util');var path=require(_0xce2e('0x1'));var timeout=require(_0xce2e('0x2'));var express=require(_0xce2e('0x3'));var router=express[_0xce2e('0x4')]();var fs_extra=require(_0xce2e('0x5'));var auth=require(_0xce2e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xce2e('0x7'));var controller=require(_0xce2e('0x8'));router['get']('/',auth[_0xce2e('0x9')](),controller[_0xce2e('0xa')]);router['get'](_0xce2e('0xb'),auth[_0xce2e('0x9')](),controller[_0xce2e('0xc')]);router[_0xce2e('0xd')](_0xce2e('0xe'),auth['isAuthenticated'](),controller[_0xce2e('0xf')]);router[_0xce2e('0x10')]('/',auth[_0xce2e('0x9')](),controller['create']);router[_0xce2e('0x11')](_0xce2e('0xe'),auth['isAuthenticated'](),controller[_0xce2e('0x12')]);module[_0xce2e('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index c8c20b6..77c390a 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 _0x5243=['name','STRING','sequelize'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0x5243,0x71));var _0x3524=function(_0x1232b8,_0x5aaabb){_0x1232b8=_0x1232b8-0x0;var _0x5abe82=_0x5243[_0x1232b8];return _0x5abe82;};'use strict';var Sequelize=require(_0x3524('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x3524('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x3524('0x2')]},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xc23a=['exports','STRING','name'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xc23a,0xd2));var _0xac23=function(_0x4d337e,_0x2f7eed){_0x4d337e=_0x4d337e-0x0;var _0x247963=_0xc23a[_0x4d337e];return _0x247963;};'use strict';var Sequelize=require('sequelize');module[_0xac23('0x0')]={'name':{'type':Sequelize[_0xac23('0x1')],'unique':_0xac23('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'dialPrefix':{'type':Sequelize[_0xac23('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 7a3dba2..7b1efa0 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 _0x45c0=['addCustomField','sequelize','transaction','addCustomFields','Sequelize','text','TEXT','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','getCustomFields','findAndCountAll','getGlobalCustomFields','addAgents','omit','spread','userCmList:save','removeAgents','emit','userCmList:remove','getAgents','User','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','defaults','redis','localhost','./cmList.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','get','Lists','end','stack','name','send','index','map','CmList','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ListId','Disposition','getDispositions','findOne','removeDispositions','ids','addContacts','CmContact','tags','isArray','join','push','each','success','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','format','cf_%d','raw','getContactsCsv','ContactItemType','OrderBy','alias','select','from','cm_contacts','c.ListId\x20=\x20?','field','c.cf_','customField_','item','cm_contact_has_items','ItemTypeId\x20=\x20?','description','description_additionalPhone_','toString','isEmpty','now','setHeader','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download'];(function(_0x12a5ac,_0x4cb0d2){var _0x282958=function(_0x3ae041){while(--_0x3ae041){_0x12a5ac['push'](_0x12a5ac['shift']());}};_0x282958(++_0x4cb0d2);}(_0x45c0,0xbe));var _0x045c=function(_0x28d18d,_0x55896b){_0x28d18d=_0x28d18d-0x0;var _0x470640=_0x45c0[_0x28d18d];return _0x470640;};'use strict';var emlformat=require(_0x045c('0x0'));var rimraf=require(_0x045c('0x1'));var zipdir=require(_0x045c('0x2'));var jsonpatch=require(_0x045c('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x045c('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x045c('0x5'));var sox=require(_0x045c('0x6'));var csv=require(_0x045c('0x7'));var ejs=require(_0x045c('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x045c('0x9'));var crypto=require(_0x045c('0xa'));var jsforce=require(_0x045c('0xb'));var deskjs=require(_0x045c('0xc'));var toCsv=require(_0x045c('0x7'));var querystring=require('querystring');var Papa=require(_0x045c('0xd'));var Redis=require('ioredis');var authService=require(_0x045c('0xe'));var qs=require(_0x045c('0xf'));var as=require(_0x045c('0x10'));var hardwareService=require(_0x045c('0x11'));var logger=require(_0x045c('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x045c('0x13'));var db=require('../../mysqldb')['db'];var csv_results;config['redis']=_[_0x045c('0x14')](config[_0x045c('0x15')],{'host':_0x045c('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x045c('0x17'))[_0x045c('0x18')](socket);function respondWithStatusCode(_0x1ac403,_0x54adc4){_0x54adc4=_0x54adc4||0xcc;return function(_0x4f912f){if(_0x4f912f){return _0x1ac403[_0x045c('0x19')](_0x54adc4);}return _0x1ac403[_0x045c('0x1a')](_0x54adc4)['end']();};}function respondWithResult(_0x5689f3,_0x5042c3){_0x5042c3=_0x5042c3||0xc8;return function(_0x3962be){if(_0x3962be){return _0x5689f3['status'](_0x5042c3)[_0x045c('0x1b')](_0x3962be);}};}function respondWithFilteredResult(_0x5ec0a8,_0x4bee18){return function(_0x2cbe47){if(_0x2cbe47){var _0x1a6ba5=typeof _0x4bee18[_0x045c('0x1c')]===_0x045c('0x1d')&&typeof _0x4bee18[_0x045c('0x1e')]===_0x045c('0x1d');var _0x267663=_0x2cbe47[_0x045c('0x1f')];var _0x50416f=_0x1a6ba5?0x0:_0x4bee18[_0x045c('0x1c')];var _0x38149e=_0x1a6ba5?_0x2cbe47[_0x045c('0x1f')]:_0x4bee18[_0x045c('0x1c')]+_0x4bee18[_0x045c('0x1e')];var _0x2239f4;if(_0x38149e>=_0x267663){_0x38149e=_0x267663;_0x2239f4=0xc8;}else{_0x2239f4=0xce;}_0x5ec0a8[_0x045c('0x1a')](_0x2239f4);return _0x5ec0a8[_0x045c('0x20')]('Content-Range',_0x50416f+'-'+_0x38149e+'/'+_0x267663)[_0x045c('0x1b')](_0x2cbe47);}return null;};}function patchUpdates(_0x4c7196){return function(_0x3aecd4){try{jsonpatch[_0x045c('0x21')](_0x3aecd4,_0x4c7196,!![]);}catch(_0x495197){return BPromise[_0x045c('0x22')](_0x495197);}return _0x3aecd4[_0x045c('0x23')]();};}function saveUpdates(_0x3d5665,_0xfd10c9){return function(_0x2b1048){if(_0x2b1048){return _0x2b1048[_0x045c('0x24')](_0x3d5665)[_0x045c('0x25')](function(_0xbcd1cb){return _0xbcd1cb;});}return null;};}function removeEntity(_0x4b8047,_0x124cd4){return function(_0x90efc9){if(_0x90efc9){return _0x90efc9[_0x045c('0x26')]()[_0x045c('0x25')](function(){var _0x1b1a36=_0x90efc9[_0x045c('0x27')]({'plain':!![]});var _0x107e96=_0x045c('0x28');return db['UserProfileResource'][_0x045c('0x26')]({'where':{'type':_0x107e96,'resourceId':_0x1b1a36['id']}})[_0x045c('0x25')](function(){return _0x90efc9;});})[_0x045c('0x25')](function(){_0x4b8047[_0x045c('0x1a')](0xcc)[_0x045c('0x29')]();});}};}function handleEntityNotFound(_0x5b648b,_0x4ab539){return function(_0x5590ce){if(!_0x5590ce){_0x5b648b['sendStatus'](0x194);}return _0x5590ce;};}function handleError(_0x16d9e6,_0x343a00){_0x343a00=_0x343a00||0x1f4;return function(_0x446fda){logger['error'](_0x446fda[_0x045c('0x2a')]);if(_0x446fda[_0x045c('0x2b')]){delete _0x446fda['name'];}_0x16d9e6[_0x045c('0x1a')](_0x343a00)[_0x045c('0x2c')](_0x446fda);};}exports[_0x045c('0x2d')]=function(_0x2ae591,_0x67a274){var _0x4d7d9d={},_0x1d5614={},_0x459e8a={'count':0x0,'rows':[]};var _0x2973ce=_[_0x045c('0x2e')](db[_0x045c('0x2f')][_0x045c('0x30')],function(_0x414175){return{'name':_0x414175[_0x045c('0x31')],'type':_0x414175[_0x045c('0x32')]['key']};});_0x1d5614[_0x045c('0x33')]=_[_0x045c('0x2e')](_0x2973ce,_0x045c('0x2b'));_0x1d5614['query']=_[_0x045c('0x34')](_0x2ae591[_0x045c('0x35')]);_0x1d5614[_0x045c('0x36')]=_[_0x045c('0x37')](_0x1d5614[_0x045c('0x33')],_0x1d5614[_0x045c('0x35')]);_0x4d7d9d[_0x045c('0x38')]=_[_0x045c('0x37')](_0x1d5614[_0x045c('0x33')],qs['fields'](_0x2ae591[_0x045c('0x35')][_0x045c('0x39')]));_0x4d7d9d[_0x045c('0x38')]=_0x4d7d9d[_0x045c('0x38')][_0x045c('0x3a')]?_0x4d7d9d[_0x045c('0x38')]:_0x1d5614[_0x045c('0x33')];if(!_0x2ae591[_0x045c('0x35')][_0x045c('0x3b')](_0x045c('0x3c'))){_0x4d7d9d[_0x045c('0x1e')]=qs[_0x045c('0x1e')](_0x2ae591[_0x045c('0x35')][_0x045c('0x1e')]);_0x4d7d9d[_0x045c('0x1c')]=qs['offset'](_0x2ae591['query'][_0x045c('0x1c')]);}_0x4d7d9d[_0x045c('0x3d')]=qs[_0x045c('0x3e')](_0x2ae591['query'][_0x045c('0x3e')]);_0x4d7d9d[_0x045c('0x3f')]=qs[_0x045c('0x36')](_[_0x045c('0x40')](_0x2ae591['query'],_0x1d5614['filters']),_0x2973ce);if(_0x2ae591[_0x045c('0x35')][_0x045c('0x41')]){_0x4d7d9d[_0x045c('0x3f')]=_[_0x045c('0x42')](_0x4d7d9d[_0x045c('0x3f')],{'$or':_[_0x045c('0x2e')](_0x2973ce,function(_0x3ad553){if(_0x3ad553['type']!==_0x045c('0x43')){var _0x3a1cd7={};_0x3a1cd7[_0x3ad553[_0x045c('0x2b')]]={'$like':'%'+_0x2ae591[_0x045c('0x35')][_0x045c('0x41')]+'%'};return _0x3a1cd7;}})});}_0x4d7d9d=_[_0x045c('0x42')]({},_0x4d7d9d,_0x2ae591[_0x045c('0x44')]);var _0x486279={'where':_0x4d7d9d[_0x045c('0x3f')]};return db[_0x045c('0x2f')]['count'](_0x486279)[_0x045c('0x25')](function(_0x4f1f31){_0x459e8a[_0x045c('0x1f')]=_0x4f1f31;if(_0x2ae591[_0x045c('0x35')][_0x045c('0x45')]){_0x4d7d9d[_0x045c('0x46')]=[{'all':!![]}];}return db[_0x045c('0x2f')][_0x045c('0x47')](_0x4d7d9d);})[_0x045c('0x25')](function(_0x5a64ce){_0x459e8a[_0x045c('0x48')]=_0x5a64ce;return _0x459e8a;})[_0x045c('0x25')](respondWithFilteredResult(_0x67a274,_0x4d7d9d))[_0x045c('0x49')](handleError(_0x67a274,null));};exports['show']=function(_0x128fcf,_0x2432b9){var _0x23a18b={'raw':![],'where':{'id':_0x128fcf[_0x045c('0x4a')]['id']}},_0x196715={};_0x196715[_0x045c('0x33')]=_[_0x045c('0x34')](db[_0x045c('0x2f')][_0x045c('0x30')]);_0x196715[_0x045c('0x35')]=_[_0x045c('0x34')](_0x128fcf[_0x045c('0x35')]);_0x196715[_0x045c('0x36')]=_[_0x045c('0x37')](_0x196715[_0x045c('0x33')],_0x196715[_0x045c('0x35')]);_0x23a18b[_0x045c('0x38')]=_[_0x045c('0x37')](_0x196715[_0x045c('0x33')],qs[_0x045c('0x39')](_0x128fcf[_0x045c('0x35')][_0x045c('0x39')]));_0x23a18b['attributes']=_0x23a18b[_0x045c('0x38')][_0x045c('0x3a')]?_0x23a18b[_0x045c('0x38')]:_0x196715[_0x045c('0x33')];if(_0x128fcf['query'][_0x045c('0x45')]){_0x23a18b[_0x045c('0x46')]=[{'all':!![]}];}_0x23a18b=_[_0x045c('0x42')]({},_0x23a18b,_0x128fcf[_0x045c('0x44')]);return db[_0x045c('0x2f')][_0x045c('0x4b')](_0x23a18b)[_0x045c('0x25')](handleEntityNotFound(_0x2432b9,null))['then'](respondWithResult(_0x2432b9,null))[_0x045c('0x49')](handleError(_0x2432b9,null));};exports[_0x045c('0x4c')]=function(_0x20a324,_0x1d2d8a){return db['CmList'][_0x045c('0x4c')](_0x20a324[_0x045c('0x4d')],{})['then'](function(_0x3b6538){var _0x462e80=_0x20a324['user'][_0x045c('0x27')]({'plain':!![]});if(!_0x462e80)throw new Error(_0x045c('0x4e'));if(_0x462e80[_0x045c('0x4f')]==='user'){var _0x54443f=_0x3b6538['get']({'plain':!![]});var _0x56f5a3='Lists';return db[_0x045c('0x50')][_0x045c('0x4b')]({'where':{'name':_0x56f5a3,'userProfileId':_0x462e80[_0x045c('0x51')]},'raw':!![]})[_0x045c('0x25')](function(_0x548646){if(_0x548646&&_0x548646[_0x045c('0x52')]===0x0){return db[_0x045c('0x53')][_0x045c('0x4c')]({'name':_0x54443f[_0x045c('0x2b')],'resourceId':_0x54443f['id'],'type':_0x548646[_0x045c('0x2b')],'sectionId':_0x548646['id']},{})['then'](function(){return _0x3b6538;});}else{return _0x3b6538;}})[_0x045c('0x49')](function(_0x491c48){logger[_0x045c('0x54')](_0x045c('0x55'),_0x491c48);throw _0x491c48;});}return _0x3b6538;})['then'](respondWithResult(_0x1d2d8a,0xc9))[_0x045c('0x49')](handleError(_0x1d2d8a,null));};exports['update']=function(_0x3b4d14,_0x43f083){if(_0x3b4d14[_0x045c('0x4d')]['id']){delete _0x3b4d14[_0x045c('0x4d')]['id'];}return db[_0x045c('0x2f')][_0x045c('0x4b')]({'where':{'id':_0x3b4d14['params']['id']}})[_0x045c('0x25')](handleEntityNotFound(_0x43f083,null))[_0x045c('0x25')](saveUpdates(_0x3b4d14[_0x045c('0x4d')],null))[_0x045c('0x25')](respondWithResult(_0x43f083,null))['catch'](handleError(_0x43f083,null));};exports[_0x045c('0x26')]=function(_0x71a166,_0x5246aa){return db[_0x045c('0x2f')][_0x045c('0x4b')]({'where':{'id':_0x71a166[_0x045c('0x4a')]['id']}})[_0x045c('0x25')](handleEntityNotFound(_0x5246aa,null))[_0x045c('0x25')](removeEntity(_0x5246aa,null))[_0x045c('0x49')](handleError(_0x5246aa,null));};exports['describe']=function(_0x5a7c5c,_0x10324d){return db[_0x045c('0x2f')][_0x045c('0x56')]()['then'](respondWithResult(_0x10324d,null))[_0x045c('0x49')](handleError(_0x10324d,null));};exports[_0x045c('0x57')]=function(_0x11ec39,_0x4fad8f,_0x59edf1){if(_0x11ec39[_0x045c('0x4d')]['id']){delete _0x11ec39[_0x045c('0x4d')]['id'];}return db[_0x045c('0x2f')]['find']({'where':{'id':_0x11ec39[_0x045c('0x4a')]['id']}})[_0x045c('0x25')](handleEntityNotFound(_0x4fad8f,null))[_0x045c('0x25')](function(_0x5226c2){if(_0x5226c2){_0x11ec39[_0x045c('0x4d')][_0x045c('0x58')]=_0x5226c2['id'];return db[_0x045c('0x59')][_0x045c('0x4c')](_0x11ec39['body']);}})[_0x045c('0x25')](respondWithResult(_0x4fad8f,null))['catch'](handleError(_0x4fad8f,null));};exports[_0x045c('0x5a')]=function(_0x1f3963,_0x972cb,_0x3be864){var _0x1b7d1b={'raw':![],'where':{}};var _0x12b442={};var _0x40fa72={'count':0x0,'rows':[]};return db[_0x045c('0x2f')][_0x045c('0x5b')]({'where':{'id':_0x1f3963[_0x045c('0x4a')]['id']}})[_0x045c('0x25')](handleEntityNotFound(_0x972cb,null))[_0x045c('0x25')](function(_0xe9600d){if(_0xe9600d){_0x12b442[_0x045c('0x33')]=_[_0x045c('0x34')](db[_0x045c('0x59')][_0x045c('0x30')]);_0x12b442[_0x045c('0x35')]=_['keys'](_0x1f3963['query']);_0x12b442['filters']=_[_0x045c('0x37')](_0x12b442['model'],_0x12b442['query']);_0x1b7d1b['attributes']=_['intersection'](_0x12b442[_0x045c('0x33')],qs['fields'](_0x1f3963[_0x045c('0x35')][_0x045c('0x39')]));_0x1b7d1b[_0x045c('0x38')]=_0x1b7d1b[_0x045c('0x38')][_0x045c('0x3a')]?_0x1b7d1b[_0x045c('0x38')]:_0x12b442[_0x045c('0x33')];if(!_0x1f3963[_0x045c('0x35')][_0x045c('0x3b')](_0x045c('0x3c'))){_0x1b7d1b[_0x045c('0x1e')]=qs[_0x045c('0x1e')](_0x1f3963['query'][_0x045c('0x1e')]);_0x1b7d1b[_0x045c('0x1c')]=qs['offset'](_0x1f3963[_0x045c('0x35')]['offset']);}_0x1b7d1b[_0x045c('0x3d')]=qs['sort'](_0x1f3963[_0x045c('0x35')]['sort']);_0x1b7d1b[_0x045c('0x3f')]=qs[_0x045c('0x36')](_[_0x045c('0x40')](_0x1f3963[_0x045c('0x35')],_0x12b442[_0x045c('0x36')]));_0x1b7d1b[_0x045c('0x3f')][_0x045c('0x58')]=_0xe9600d['id'];if(_0x1f3963['query'][_0x045c('0x41')]){_0x1b7d1b[_0x045c('0x3f')]=_[_0x045c('0x42')](_0x1b7d1b['where'],{'$or':_[_0x045c('0x2e')](_0x1b7d1b[_0x045c('0x38')],function(_0x1610e2){var _0x5b2b29={};_0x5b2b29[_0x1610e2]={'$like':'%'+_0x1f3963[_0x045c('0x35')][_0x045c('0x41')]+'%'};return _0x5b2b29;})});}_0x1b7d1b=_['merge']({},_0x1b7d1b,_0x1f3963[_0x045c('0x44')]);return db['Disposition'][_0x045c('0x1f')]({'where':_0x1b7d1b[_0x045c('0x3f')]})[_0x045c('0x25')](function(_0x81b816){_0x40fa72[_0x045c('0x1f')]=_0x81b816;if(_0x1f3963[_0x045c('0x35')]['includeAll']){_0x1b7d1b[_0x045c('0x46')]=[{'all':!![]}];}return db[_0x045c('0x59')]['findAll'](_0x1b7d1b);})[_0x045c('0x25')](function(_0x175c2d){_0x40fa72[_0x045c('0x48')]=_0x175c2d;return _0x40fa72;});}})[_0x045c('0x25')](respondWithFilteredResult(_0x972cb,_0x1b7d1b))[_0x045c('0x49')](handleError(_0x972cb,null));};exports[_0x045c('0x5c')]=function(_0x2862e5,_0x1ff0e9,_0x3caff6){return db['CmList'][_0x045c('0x4b')]({'where':{'id':_0x2862e5[_0x045c('0x4a')]['id']}})[_0x045c('0x25')](handleEntityNotFound(_0x1ff0e9,null))[_0x045c('0x25')](function(_0x37d28d){if(_0x37d28d){return _0x37d28d['removeDispositions'](_0x2862e5['query'][_0x045c('0x5d')]);}})['then'](respondWithStatusCode(_0x1ff0e9,null))[_0x045c('0x49')](handleError(_0x1ff0e9,null));};exports[_0x045c('0x5e')]=function(_0x2a4bd1,_0x189a5a,_0x10f280){return db[_0x045c('0x2f')]['find']({'where':{'id':_0x2a4bd1[_0x045c('0x4a')]['id']}})[_0x045c('0x25')](handleEntityNotFound(_0x189a5a,null))[_0x045c('0x25')](function(_0x3f3524){if(_0x3f3524){var _0x399026=[];var _0x560b3e={'success':[],'errors':[]};return db[_0x045c('0x5f')]['describe']()[_0x045c('0x25')](function(_0x56c754){if(_0x2a4bd1['body'][_0x045c('0x60')]&&_[_0x045c('0x61')](_0x2a4bd1[_0x045c('0x4d')][_0x045c('0x60')])){if(_0x2a4bd1['body'][_0x045c('0x60')][_0x045c('0x3a')]){_0x2a4bd1[_0x045c('0x4d')]['tags']=_0x2a4bd1[_0x045c('0x4d')][_0x045c('0x60')][_0x045c('0x62')](';')+';';}else{_0x2a4bd1[_0x045c('0x4d')][_0x045c('0x60')]=null;}}else{_0x2a4bd1['body'][_0x045c('0x60')]=null;}if(_0x2a4bd1[_0x045c('0x4d')]&&_[_0x045c('0x61')](_0x2a4bd1['body'])){for(var _0x3ca5ca=0x0;_0x3ca5ca<_0x2a4bd1[_0x045c('0x4d')][_0x045c('0x3a')];_0x3ca5ca+=0x1){_0x2a4bd1['body'][_0x3ca5ca]['ListId']=_0x2a4bd1[_0x045c('0x4a')]['id'];_0x399026[_0x045c('0x63')](_0x2a4bd1['body'][_0x3ca5ca]);}return BPromise[_0x045c('0x64')](_0x399026,function(_0x42d43a){return db['CmContact'][_0x045c('0x4c')](_['omit'](_0x42d43a,['ids','id'])||{},{'fields':_[_0x045c('0x34')](_0x56c754),'raw':!![]})[_0x045c('0x25')](function(_0x209329){_0x560b3e[_0x045c('0x65')][_0x045c('0x63')](_0x209329[_0x045c('0x66')]);})[_0x045c('0x49')](function(_0x197ff3){_0x560b3e[_0x045c('0x67')][_0x045c('0x63')]({'data':_0x42d43a,'error':_0x197ff3[_0x045c('0x68')]});});})[_0x045c('0x25')](function(_0x2c6768){return _0x560b3e;})[_0x045c('0x49')](function(_0x48b865){return _0x48b865;});}else{_0x189a5a[_0x045c('0x1a')](0x190)[_0x045c('0x1b')]({'message':_0x045c('0x69')});}});}})[_0x045c('0x25')](respondWithResult(_0x189a5a,null))['catch'](handleError(_0x189a5a,null));};exports[_0x045c('0x6a')]=function(_0x142b69,_0x301382,_0x17d457){var _0x1795a7;return db[_0x045c('0x2f')][_0x045c('0x4b')]({'where':{'id':_0x142b69[_0x045c('0x4a')]['id']},'include':[{'model':db[_0x045c('0x6b')],'as':_0x045c('0x6c')}]})['then'](handleEntityNotFound(_0x301382,null))['then'](function(_0x4d578e){if(_0x4d578e){_0x1795a7=_0x4d578e;return db[_0x045c('0x5f')][_0x045c('0x30')];}})[_0x045c('0x25')](function(_0x49bac7){if(_0x49bac7){var _0x753a04={};var _0x1d3fc3={};_0x1d3fc3[_0x045c('0x33')]=_[_0x045c('0x6d')](_[_0x045c('0x34')](_0x49bac7),_[_0x045c('0x2e')](_0x1795a7[_0x045c('0x6c')],function(_0x5b09d7){return util[_0x045c('0x6e')](_0x045c('0x6f'),_0x5b09d7['id']);}));_0x1d3fc3[_0x045c('0x35')]=_['keys'](_0x142b69[_0x045c('0x35')]);_0x1d3fc3['filters']=_[_0x045c('0x37')](_0x1d3fc3[_0x045c('0x33')],_0x1d3fc3[_0x045c('0x35')]);_0x753a04['attributes']=_[_0x045c('0x37')](_0x1d3fc3[_0x045c('0x33')],qs[_0x045c('0x39')](_0x142b69[_0x045c('0x35')][_0x045c('0x39')]));_0x753a04[_0x045c('0x38')]=_0x753a04[_0x045c('0x38')]['length']?_0x753a04[_0x045c('0x38')]:_0x1d3fc3[_0x045c('0x33')];if(!_0x142b69[_0x045c('0x35')][_0x045c('0x3b')]('nolimit')){_0x753a04[_0x045c('0x1e')]=qs[_0x045c('0x1e')](_0x142b69[_0x045c('0x35')][_0x045c('0x1e')]);_0x753a04[_0x045c('0x1c')]=qs[_0x045c('0x1c')](_0x142b69[_0x045c('0x35')][_0x045c('0x1c')]);}_0x753a04['order']=qs[_0x045c('0x3e')](_0x142b69[_0x045c('0x35')][_0x045c('0x3e')]);_0x753a04['where']=qs[_0x045c('0x36')](_['pick'](_0x142b69[_0x045c('0x35')],_0x1d3fc3[_0x045c('0x36')]));_0x753a04[_0x045c('0x70')]=!![];if(_0x142b69[_0x045c('0x35')]['filter']){_0x753a04[_0x045c('0x3f')]=_[_0x045c('0x42')](_0x753a04[_0x045c('0x3f')],{'$or':_[_0x045c('0x2e')](_0x753a04[_0x045c('0x38')],function(_0x2e636d){var _0xdead6c={};_0xdead6c[_0x2e636d]={'$like':'%'+_0x142b69[_0x045c('0x35')][_0x045c('0x41')]+'%'};return _0xdead6c;})});}_0x753a04=_['merge']({},_0x753a04,_0x142b69[_0x045c('0x44')]);return _0x1795a7[_0x045c('0x6a')](_0x753a04);}})['then'](respondWithResult(_0x301382,null))[_0x045c('0x49')](handleError(_0x301382,null));};exports[_0x045c('0x71')]=function(_0xf5f706,_0x2812ed,_0x20744a){var _0x2327bb;var _0x144077;var _0x91bbac;var _0x4e4422=_0xf5f706['params']['id'];csv_results=[];return db[_0x045c('0x72')]['findAll']({'attributes':['id',_0x045c('0x2b')],'raw':!![],'order':[_0x045c('0x73')]})['then'](function(_0x551642){_0x2327bb=_0x551642;var _0x391cbd=_['keys'](db['CmContact'][_0x045c('0x30')]);return db[_0x045c('0x6b')][_0x045c('0x47')]({'raw':!![],'attributes':['id',_0x045c('0x74')]})['then'](function(_0x32ad7d){_0x144077=_0x32ad7d;var _0x1c74ef=squel[_0x045c('0x75')]()['fields'](_0x391cbd)[_0x045c('0x76')](_0x045c('0x77'),'c')[_0x045c('0x3f')](_0x045c('0x78'),_0x4e4422)[_0x045c('0x3f')]('c.deletedAt\x20is\x20null')['distinct']();for(var _0x5ee09e=0x0;_0x5ee09e<_0x144077[_0x045c('0x3a')];_0x5ee09e++){_0x1c74ef[_0x045c('0x79')](_0x045c('0x7a')+_0x144077[_0x5ee09e]['id'],_0x045c('0x7b')+_0x144077[_0x5ee09e]['alias']);}for(var _0x5ee09e=0x0;_0x5ee09e<_0x2327bb[_0x045c('0x3a')];_0x5ee09e++){_0x1c74ef[_0x045c('0x79')](squel[_0x045c('0x75')]()[_0x045c('0x79')](_0x045c('0x7c'))[_0x045c('0x76')](_0x045c('0x7d'))[_0x045c('0x3f')](_0x045c('0x7e'),_0x2327bb[_0x5ee09e]['id'])['where']('CmContactId\x20=\x20c.id'),'additionalPhone_'+_0x2327bb[_0x5ee09e]['name']);_0x1c74ef[_0x045c('0x79')](squel[_0x045c('0x75')]()[_0x045c('0x79')](_0x045c('0x7f'))['from']('cm_contact_has_items')[_0x045c('0x3f')]('ItemTypeId\x20=\x20?',_0x2327bb[_0x5ee09e]['id'])[_0x045c('0x3f')]('CmContactId\x20=\x20c.id'),_0x045c('0x80')+_0x2327bb[_0x5ee09e]['name']);}var _0xb35a1=[];_0xb35a1[_0x045c('0x63')](_0x1c74ef[_0x045c('0x81')]());BPromise[_0x045c('0x64')](_0xb35a1,handleQuery)[_0x045c('0x25')](function(_0x469c7e){handleQuery(_0x1c74ef[_0x045c('0x81')]());var _0x2e68e0=csv_results[0x0];if(!_[_0x045c('0x82')](_0x2e68e0)){var _0x4950f4=toCsv(_0x2e68e0);var _0x154ce3=Date[_0x045c('0x83')]();fs['writeFileSync'](util[_0x045c('0x6e')]('/tmp/list_%d_%s.csv',_0x4e4422,_0x154ce3),_0x4950f4);_0x2812ed[_0x045c('0x84')]('Content-disposition',_0x045c('0x85')+util[_0x045c('0x6e')](_0x045c('0x86'),_0x4e4422,_0x154ce3));_0x2812ed['setHeader'](_0x045c('0x87'),_0x045c('0x88'));return _0x2812ed[_0x045c('0x89')](util[_0x045c('0x6e')]('/tmp/list_%d_%s.csv',_0x4e4422,_0x154ce3));}else{return _0x2812ed['sendStatus'](0xcc);}});});});};exports[_0x045c('0x8a')]=function(_0x3ac128,_0x1bbff4,_0x2c2e59){var _0x1dc9de;delete _0x3ac128[_0x045c('0x4d')]['id'];return db['CmList'][_0x045c('0x5b')]({'where':{'id':_0x3ac128[_0x045c('0x4a')]['id']}})[_0x045c('0x25')](handleEntityNotFound(_0x1bbff4,null))['then'](function(_0x5217c1){if(_0x5217c1){return db[_0x045c('0x8b')][_0x045c('0x8c')](function(_0x492de5){return db['CmCustomField'][_0x045c('0x4c')](_0x3ac128[_0x045c('0x4d')],{'transaction':_0x492de5})['then'](function(_0x1bf4a3){_0x1dc9de=_0x1bf4a3;return _0x5217c1[_0x045c('0x8d')](_0x1bf4a3,{'transaction':_0x492de5});})[_0x045c('0x25')](function(){var _0x48eb82={'type':db[_0x045c('0x8e')]['TEXT'],'transaction':_0x492de5};switch(_0x3ac128[_0x045c('0x4d')][_0x045c('0x32')]){case _0x045c('0x8f'):_0x48eb82[_0x045c('0x32')]=db['Sequelize'][_0x045c('0x90')];break;case _0x045c('0x91'):_0x48eb82[_0x045c('0x32')]=db[_0x045c('0x8e')][_0x045c('0x92')];break;case _0x045c('0x93'):_0x48eb82[_0x045c('0x32')]=db[_0x045c('0x8e')][_0x045c('0x94')];_0x48eb82[_0x045c('0x95')]=![];break;default:}return db['sequelize'][_0x045c('0x96')][_0x045c('0x97')](_0x045c('0x77'),util[_0x045c('0x6e')]('cf_%s',_0x1dc9de['id']),_0x48eb82);})[_0x045c('0x25')](function(){return _0x1dc9de;});});}})[_0x045c('0x25')](respondWithResult(_0x1bbff4,null))[_0x045c('0x49')](handleError(_0x1bbff4,null));};exports[_0x045c('0x98')]=function(_0x127e98,_0x25e847,_0x502c48){var _0x15a0d7={};var _0x5dd655={};var _0x2042a3;var _0x30ebad;return db[_0x045c('0x2f')][_0x045c('0x5b')]({'where':{'id':_0x127e98['params']['id']}})[_0x045c('0x25')](handleEntityNotFound(_0x25e847,null))[_0x045c('0x25')](function(_0x2223a6){if(_0x2223a6){_0x2042a3=_0x2223a6;_0x5dd655[_0x045c('0x33')]=_[_0x045c('0x34')](db[_0x045c('0x6b')][_0x045c('0x30')]);_0x5dd655[_0x045c('0x35')]=_[_0x045c('0x34')](_0x127e98[_0x045c('0x35')]);_0x5dd655[_0x045c('0x36')]=_[_0x045c('0x37')](_0x5dd655[_0x045c('0x33')],_0x5dd655[_0x045c('0x35')]);_0x15a0d7[_0x045c('0x38')]=_[_0x045c('0x37')](_0x5dd655[_0x045c('0x33')],qs[_0x045c('0x39')](_0x127e98[_0x045c('0x35')][_0x045c('0x39')]));_0x15a0d7[_0x045c('0x38')]=_0x15a0d7[_0x045c('0x38')]['length']?_0x15a0d7[_0x045c('0x38')]:_0x5dd655['model'];_0x15a0d7[_0x045c('0x3d')]=qs[_0x045c('0x3e')](_0x127e98['query'][_0x045c('0x3e')]);_0x15a0d7[_0x045c('0x3f')]=qs[_0x045c('0x36')](_[_0x045c('0x40')](_0x127e98[_0x045c('0x35')],_0x5dd655[_0x045c('0x36')]));_0x15a0d7['where']=_[_0x045c('0x42')](_0x15a0d7[_0x045c('0x3f')],{'$or':[{'ListId':_0x2223a6['id']},{'ListId':null}]});if(_0x127e98[_0x045c('0x35')]['filter']){_0x15a0d7['where']=_['merge'](_0x15a0d7[_0x045c('0x3f')],{'$or':_[_0x045c('0x2e')](_0x15a0d7[_0x045c('0x38')],function(_0x15e021){var _0x1b0da2={};_0x1b0da2[_0x15e021]={'$like':'%'+_0x127e98[_0x045c('0x35')][_0x045c('0x41')]+'%'};return _0x1b0da2;})});}_0x15a0d7=_[_0x045c('0x42')]({},_0x15a0d7,_0x127e98[_0x045c('0x44')]);return db[_0x045c('0x6b')][_0x045c('0x99')](_0x15a0d7);}})[_0x045c('0x25')](respondWithResult(_0x25e847,null))[_0x045c('0x49')](handleError(_0x25e847,null));};exports[_0x045c('0x9a')]=function(_0x2907e8,_0x892447){return db['CmCustomField']['findAndCountAll']({'where':{'ListId':null}})[_0x045c('0x25')](handleEntityNotFound(_0x892447,null))['then'](function(_0x550285){return _0x550285;})['then'](respondWithResult(_0x892447,null))['catch'](handleError(_0x892447,null));};exports['addAgents']=function(_0x228df1,_0x55709e,_0x1a994e){return db[_0x045c('0x2f')][_0x045c('0x4b')]({'where':{'id':_0x228df1['params']['id']}})[_0x045c('0x25')](handleEntityNotFound(_0x55709e,null))['then'](function(_0x581fdc){if(_0x581fdc){return _0x581fdc[_0x045c('0x9b')](_0x228df1['body'][_0x045c('0x5d')],_[_0x045c('0x9c')](_0x228df1[_0x045c('0x4d')],['ids','id'])||{})[_0x045c('0x9d')](function(_0x52fa11){for(var _0x593063=0x0;_0x593063<_0x228df1[_0x045c('0x4d')][_0x045c('0x5d')][_0x045c('0x3a')];_0x593063+=0x1){socket['emit'](_0x045c('0x9e'),{'UserId':Number(_0x228df1[_0x045c('0x4d')][_0x045c('0x5d')][_0x593063]),'CmListId':Number(_0x228df1[_0x045c('0x4a')]['id'])});}return _0x52fa11;});}})[_0x045c('0x25')](respondWithResult(_0x55709e,null))[_0x045c('0x49')](handleError(_0x55709e,null));};exports[_0x045c('0x9f')]=function(_0x3877fb,_0x2450e5,_0xefc76){return db[_0x045c('0x2f')][_0x045c('0x4b')]({'where':{'id':_0x3877fb[_0x045c('0x4a')]['id']}})[_0x045c('0x25')](handleEntityNotFound(_0x2450e5,null))['then'](function(_0xa0293e){if(_0xa0293e){return _0xa0293e[_0x045c('0x9f')](_0x3877fb[_0x045c('0x35')][_0x045c('0x5d')])[_0x045c('0x25')](function(){if(_[_0x045c('0x61')](_0x3877fb['query'][_0x045c('0x5d')])){for(var _0x237733=0x0;_0x237733<_0x3877fb[_0x045c('0x35')]['ids'][_0x045c('0x3a')];_0x237733+=0x1){socket[_0x045c('0xa0')](_0x045c('0xa1'),{'UserId':Number(_0x3877fb[_0x045c('0x35')][_0x045c('0x5d')][_0x237733]),'CmListId':Number(_0x3877fb[_0x045c('0x4a')]['id'])});}}else{socket['emit'](_0x045c('0xa1'),{'UserId':Number(_0x3877fb[_0x045c('0x35')][_0x045c('0x5d')]),'CmListId':Number(_0x3877fb['params']['id'])});}});}})[_0x045c('0x25')](respondWithStatusCode(_0x2450e5,null))['catch'](handleError(_0x2450e5,null));};exports[_0x045c('0xa2')]=function(_0x294a5f,_0x468389,_0x234637){var _0xefedda={};var _0x156ebd={};var _0x10d29d;var _0x16a744;return db['CmList'][_0x045c('0x5b')]({'where':{'id':_0x294a5f['params']['id']}})[_0x045c('0x25')](handleEntityNotFound(_0x468389,null))[_0x045c('0x25')](function(_0x1de1da){if(_0x1de1da){_0x10d29d=_0x1de1da;_0x156ebd[_0x045c('0x33')]=_['keys'](db[_0x045c('0xa3')][_0x045c('0x30')]);_0x156ebd[_0x045c('0x35')]=_[_0x045c('0x34')](_0x294a5f[_0x045c('0x35')]);_0x156ebd['filters']=_['intersection'](_0x156ebd[_0x045c('0x33')],_0x156ebd[_0x045c('0x35')]);_0xefedda[_0x045c('0x38')]=_[_0x045c('0x37')](_0x156ebd['model'],qs[_0x045c('0x39')](_0x294a5f['query']['fields']));_0xefedda[_0x045c('0x38')]=_0xefedda['attributes'][_0x045c('0x3a')]?_0xefedda[_0x045c('0x38')]:_0x156ebd['model'];_0xefedda[_0x045c('0x3d')]=qs[_0x045c('0x3e')](_0x294a5f[_0x045c('0x35')]['sort']);_0xefedda[_0x045c('0x3f')]=qs['filters'](_['pick'](_0x294a5f[_0x045c('0x35')],_0x156ebd[_0x045c('0x36')]));if(_0x294a5f[_0x045c('0x35')][_0x045c('0x41')]){_0xefedda[_0x045c('0x3f')]=_[_0x045c('0x42')](_0xefedda[_0x045c('0x3f')],{'$or':_['map'](_0xefedda[_0x045c('0x38')],function(_0x299991){var _0x41ccb4={};_0x41ccb4[_0x299991]={'$like':'%'+_0x294a5f[_0x045c('0x35')][_0x045c('0x41')]+'%'};return _0x41ccb4;})});}_0xefedda=_[_0x045c('0x42')]({},_0xefedda,_0x294a5f['options']);return _0x10d29d['getAgents'](_0xefedda);}})[_0x045c('0x25')](function(_0x31a9e5){if(_0x31a9e5){_0x16a744=_0x31a9e5[_0x045c('0x3a')];if(!_0x294a5f[_0x045c('0x35')][_0x045c('0x3b')](_0x045c('0x3c'))){_0xefedda[_0x045c('0x1e')]=qs[_0x045c('0x1e')](_0x294a5f['query']['limit']);_0xefedda[_0x045c('0x1c')]=qs[_0x045c('0x1c')](_0x294a5f[_0x045c('0x35')]['offset']);}return _0x10d29d[_0x045c('0xa2')](_0xefedda);}})[_0x045c('0x25')](function(_0x56e3d4){if(_0x56e3d4){return _0x56e3d4?{'count':_0x16a744,'rows':_0x56e3d4}:null;}})[_0x045c('0x25')](respondWithResult(_0x468389,null))[_0x045c('0x49')](handleError(_0x468389,null));};function handleQuery(_0x2919a2){logger['info'](_0x2919a2);return db[_0x045c('0x8b')][_0x045c('0x35')](_0x2919a2)[_0x045c('0x9d')](function(_0x916313){csv_results['push'](_0x916313);})[_0x045c('0x49')](function(_0x1c7172){logger[_0x045c('0x54')](_0x1c7172[_0x045c('0x68')]);});} \ No newline at end of file +var _0xdd42=['distinct','field','c.cf_','customField_','alias','item','cm_contact_has_items','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','additionalPhone_','select','description','description_additionalPhone_','toString','each','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','addCustomField','sequelize','transaction','addCustomFields','Sequelize','TEXT','text','INTEGER','switch','BOOLEAN','defaultValue','cf_%s','getCustomFields','findAndCountAll','getGlobalCustomFields','addAgents','spread','emit','userCmList:save','userCmList:remove','getAgents','User','info','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./cmList.socket','status','end','json','undefined','limit','count','set','Content-Range','apply','update','destroy','then','Lists','UserProfileResource','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','keys','query','intersection','model','attributes','fields','hasOwnProperty','nolimit','offset','sort','where','filters','merge','VIRTUAL','options','CmList','includeAll','include','catch','params','find','create','body','user','get','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ListId','Disposition','findOne','length','pick','filter','removeDispositions','ids','addContacts','CmContact','tags','isArray','join','push','omit','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','format','order','raw','getContactsCsv','ContactItemType','findAll','OrderBy','from','cm_contacts','c.ListId\x20=\x20?'];(function(_0x298064,_0x1d2bfb){var _0x2512ea=function(_0x3e5b28){while(--_0x3e5b28){_0x298064['push'](_0x298064['shift']());}};_0x2512ea(++_0x1d2bfb);}(_0xdd42,0x176));var _0x2dd4=function(_0x2fbebe,_0xeb8962){_0x2fbebe=_0x2fbebe-0x0;var _0x59a329=_0xdd42[_0x2fbebe];return _0x59a329;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2dd4('0x0'));var jsonpatch=require(_0x2dd4('0x1'));var rp=require(_0x2dd4('0x2'));var moment=require(_0x2dd4('0x3'));var BPromise=require(_0x2dd4('0x4'));var Mustache=require(_0x2dd4('0x5'));var util=require(_0x2dd4('0x6'));var path=require(_0x2dd4('0x7'));var sox=require(_0x2dd4('0x8'));var csv=require(_0x2dd4('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2dd4('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x2dd4('0xb'));var jsforce=require(_0x2dd4('0xc'));var deskjs=require(_0x2dd4('0xd'));var toCsv=require(_0x2dd4('0x9'));var querystring=require(_0x2dd4('0xe'));var Papa=require('papaparse');var Redis=require(_0x2dd4('0xf'));var authService=require(_0x2dd4('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2dd4('0x11'));var logger=require(_0x2dd4('0x12'))(_0x2dd4('0x13'));var utils=require('../../config/utils');var config=require(_0x2dd4('0x14'));var licenseUtil=require(_0x2dd4('0x15'));var db=require(_0x2dd4('0x16'))['db'];var csv_results;config['redis']=_[_0x2dd4('0x17')](config['redis'],{'host':_0x2dd4('0x18'),'port':0x18eb});var socket=require(_0x2dd4('0x19'))(new Redis(config[_0x2dd4('0x1a')]));require(_0x2dd4('0x1b'))['register'](socket);function respondWithStatusCode(_0x60f9ca,_0x25ccbf){_0x25ccbf=_0x25ccbf||0xcc;return function(_0x4aea74){if(_0x4aea74){return _0x60f9ca['sendStatus'](_0x25ccbf);}return _0x60f9ca[_0x2dd4('0x1c')](_0x25ccbf)[_0x2dd4('0x1d')]();};}function respondWithResult(_0xba7e4e,_0x2fb76f){_0x2fb76f=_0x2fb76f||0xc8;return function(_0x584ad6){if(_0x584ad6){return _0xba7e4e[_0x2dd4('0x1c')](_0x2fb76f)[_0x2dd4('0x1e')](_0x584ad6);}};}function respondWithFilteredResult(_0x4c1cb8,_0x1c9071){return function(_0x19db2b){if(_0x19db2b){var _0x413453=typeof _0x1c9071['offset']===_0x2dd4('0x1f')&&typeof _0x1c9071[_0x2dd4('0x20')]===_0x2dd4('0x1f');var _0x1fd4d5=_0x19db2b[_0x2dd4('0x21')];var _0x45fee8=_0x413453?0x0:_0x1c9071['offset'];var _0x2534e9=_0x413453?_0x19db2b['count']:_0x1c9071['offset']+_0x1c9071[_0x2dd4('0x20')];var _0x4b6661;if(_0x2534e9>=_0x1fd4d5){_0x2534e9=_0x1fd4d5;_0x4b6661=0xc8;}else{_0x4b6661=0xce;}_0x4c1cb8['status'](_0x4b6661);return _0x4c1cb8[_0x2dd4('0x22')](_0x2dd4('0x23'),_0x45fee8+'-'+_0x2534e9+'/'+_0x1fd4d5)['json'](_0x19db2b);}return null;};}function patchUpdates(_0x16ae39){return function(_0x33432f){try{jsonpatch[_0x2dd4('0x24')](_0x33432f,_0x16ae39,!![]);}catch(_0x458dbd){return BPromise['reject'](_0x458dbd);}return _0x33432f['save']();};}function saveUpdates(_0x1aa8cb,_0x333433){return function(_0x5ca9c9){if(_0x5ca9c9){return _0x5ca9c9[_0x2dd4('0x25')](_0x1aa8cb)['then'](function(_0x3dc64d){return _0x3dc64d;});}return null;};}function removeEntity(_0x1b56aa,_0x1cda7a){return function(_0x504168){if(_0x504168){return _0x504168[_0x2dd4('0x26')]()[_0x2dd4('0x27')](function(){var _0x5c365f=_0x504168['get']({'plain':!![]});var _0x142cdc=_0x2dd4('0x28');return db[_0x2dd4('0x29')]['destroy']({'where':{'type':_0x142cdc,'resourceId':_0x5c365f['id']}})[_0x2dd4('0x27')](function(){return _0x504168;});})[_0x2dd4('0x27')](function(){_0x1b56aa[_0x2dd4('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x182607,_0x3eb843){return function(_0x5590fd){if(!_0x5590fd){_0x182607[_0x2dd4('0x2a')](0x194);}return _0x5590fd;};}function handleError(_0x95499f,_0x19efe2){_0x19efe2=_0x19efe2||0x1f4;return function(_0x1b124a){logger[_0x2dd4('0x2b')](_0x1b124a[_0x2dd4('0x2c')]);if(_0x1b124a[_0x2dd4('0x2d')]){delete _0x1b124a[_0x2dd4('0x2d')];}_0x95499f['status'](_0x19efe2)[_0x2dd4('0x2e')](_0x1b124a);};}exports[_0x2dd4('0x2f')]=function(_0x3d9cb0,_0x520986){var _0x3a1e7d={},_0x288eff={},_0x5d36a4={'count':0x0,'rows':[]};var _0x3880a5=_[_0x2dd4('0x30')](db['CmList'][_0x2dd4('0x31')],function(_0x159ce9){return{'name':_0x159ce9[_0x2dd4('0x32')],'type':_0x159ce9[_0x2dd4('0x33')][_0x2dd4('0x34')]};});_0x288eff['model']=_[_0x2dd4('0x30')](_0x3880a5,_0x2dd4('0x2d'));_0x288eff['query']=_[_0x2dd4('0x35')](_0x3d9cb0[_0x2dd4('0x36')]);_0x288eff['filters']=_[_0x2dd4('0x37')](_0x288eff[_0x2dd4('0x38')],_0x288eff[_0x2dd4('0x36')]);_0x3a1e7d[_0x2dd4('0x39')]=_[_0x2dd4('0x37')](_0x288eff['model'],qs[_0x2dd4('0x3a')](_0x3d9cb0[_0x2dd4('0x36')][_0x2dd4('0x3a')]));_0x3a1e7d[_0x2dd4('0x39')]=_0x3a1e7d['attributes']['length']?_0x3a1e7d[_0x2dd4('0x39')]:_0x288eff['model'];if(!_0x3d9cb0[_0x2dd4('0x36')][_0x2dd4('0x3b')](_0x2dd4('0x3c'))){_0x3a1e7d[_0x2dd4('0x20')]=qs['limit'](_0x3d9cb0[_0x2dd4('0x36')]['limit']);_0x3a1e7d[_0x2dd4('0x3d')]=qs[_0x2dd4('0x3d')](_0x3d9cb0[_0x2dd4('0x36')][_0x2dd4('0x3d')]);}_0x3a1e7d['order']=qs[_0x2dd4('0x3e')](_0x3d9cb0[_0x2dd4('0x36')][_0x2dd4('0x3e')]);_0x3a1e7d[_0x2dd4('0x3f')]=qs[_0x2dd4('0x40')](_['pick'](_0x3d9cb0['query'],_0x288eff['filters']),_0x3880a5);if(_0x3d9cb0['query']['filter']){_0x3a1e7d['where']=_[_0x2dd4('0x41')](_0x3a1e7d[_0x2dd4('0x3f')],{'$or':_[_0x2dd4('0x30')](_0x3880a5,function(_0x512805){if(_0x512805[_0x2dd4('0x33')]!==_0x2dd4('0x42')){var _0x1485a6={};_0x1485a6[_0x512805['name']]={'$like':'%'+_0x3d9cb0[_0x2dd4('0x36')]['filter']+'%'};return _0x1485a6;}})});}_0x3a1e7d=_['merge']({},_0x3a1e7d,_0x3d9cb0[_0x2dd4('0x43')]);var _0xc35d51={'where':_0x3a1e7d[_0x2dd4('0x3f')]};return db[_0x2dd4('0x44')][_0x2dd4('0x21')](_0xc35d51)[_0x2dd4('0x27')](function(_0x585797){_0x5d36a4[_0x2dd4('0x21')]=_0x585797;if(_0x3d9cb0['query'][_0x2dd4('0x45')]){_0x3a1e7d[_0x2dd4('0x46')]=[{'all':!![]}];}return db[_0x2dd4('0x44')]['findAll'](_0x3a1e7d);})['then'](function(_0x5afb14){_0x5d36a4['rows']=_0x5afb14;return _0x5d36a4;})['then'](respondWithFilteredResult(_0x520986,_0x3a1e7d))[_0x2dd4('0x47')](handleError(_0x520986,null));};exports['show']=function(_0x5a63a4,_0x468fa1){var _0x262bec={'raw':![],'where':{'id':_0x5a63a4[_0x2dd4('0x48')]['id']}},_0x246c2e={};_0x246c2e[_0x2dd4('0x38')]=_[_0x2dd4('0x35')](db['CmList'][_0x2dd4('0x31')]);_0x246c2e[_0x2dd4('0x36')]=_[_0x2dd4('0x35')](_0x5a63a4[_0x2dd4('0x36')]);_0x246c2e[_0x2dd4('0x40')]=_['intersection'](_0x246c2e['model'],_0x246c2e['query']);_0x262bec[_0x2dd4('0x39')]=_[_0x2dd4('0x37')](_0x246c2e['model'],qs['fields'](_0x5a63a4[_0x2dd4('0x36')][_0x2dd4('0x3a')]));_0x262bec[_0x2dd4('0x39')]=_0x262bec[_0x2dd4('0x39')]['length']?_0x262bec[_0x2dd4('0x39')]:_0x246c2e[_0x2dd4('0x38')];if(_0x5a63a4[_0x2dd4('0x36')][_0x2dd4('0x45')]){_0x262bec[_0x2dd4('0x46')]=[{'all':!![]}];}_0x262bec=_['merge']({},_0x262bec,_0x5a63a4[_0x2dd4('0x43')]);return db[_0x2dd4('0x44')][_0x2dd4('0x49')](_0x262bec)[_0x2dd4('0x27')](handleEntityNotFound(_0x468fa1,null))[_0x2dd4('0x27')](respondWithResult(_0x468fa1,null))['catch'](handleError(_0x468fa1,null));};exports[_0x2dd4('0x4a')]=function(_0x9ea9b7,_0x32a832){return db[_0x2dd4('0x44')]['create'](_0x9ea9b7[_0x2dd4('0x4b')],{})[_0x2dd4('0x27')](function(_0xaa0f1a){var _0x4f5137=_0x9ea9b7[_0x2dd4('0x4c')][_0x2dd4('0x4d')]({'plain':!![]});if(!_0x4f5137)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4f5137[_0x2dd4('0x4e')]==='user'){var _0x245855=_0xaa0f1a[_0x2dd4('0x4d')]({'plain':!![]});var _0x36271e=_0x2dd4('0x28');return db['UserProfileSection'][_0x2dd4('0x49')]({'where':{'name':_0x36271e,'userProfileId':_0x4f5137['userProfileId']},'raw':!![]})[_0x2dd4('0x27')](function(_0x4a29f4){if(_0x4a29f4&&_0x4a29f4[_0x2dd4('0x4f')]===0x0){return db[_0x2dd4('0x29')][_0x2dd4('0x4a')]({'name':_0x245855[_0x2dd4('0x2d')],'resourceId':_0x245855['id'],'type':_0x4a29f4[_0x2dd4('0x2d')],'sectionId':_0x4a29f4['id']},{})[_0x2dd4('0x27')](function(){return _0xaa0f1a;});}else{return _0xaa0f1a;}})[_0x2dd4('0x47')](function(_0x52413d){logger[_0x2dd4('0x2b')](_0x2dd4('0x50'),_0x52413d);throw _0x52413d;});}return _0xaa0f1a;})[_0x2dd4('0x27')](respondWithResult(_0x32a832,0xc9))[_0x2dd4('0x47')](handleError(_0x32a832,null));};exports[_0x2dd4('0x25')]=function(_0x5d43d8,_0x45a1da){if(_0x5d43d8['body']['id']){delete _0x5d43d8[_0x2dd4('0x4b')]['id'];}return db[_0x2dd4('0x44')][_0x2dd4('0x49')]({'where':{'id':_0x5d43d8[_0x2dd4('0x48')]['id']}})['then'](handleEntityNotFound(_0x45a1da,null))[_0x2dd4('0x27')](saveUpdates(_0x5d43d8[_0x2dd4('0x4b')],null))[_0x2dd4('0x27')](respondWithResult(_0x45a1da,null))[_0x2dd4('0x47')](handleError(_0x45a1da,null));};exports[_0x2dd4('0x26')]=function(_0x392414,_0x19192e){return db[_0x2dd4('0x44')][_0x2dd4('0x49')]({'where':{'id':_0x392414[_0x2dd4('0x48')]['id']}})[_0x2dd4('0x27')](handleEntityNotFound(_0x19192e,null))[_0x2dd4('0x27')](removeEntity(_0x19192e,null))[_0x2dd4('0x47')](handleError(_0x19192e,null));};exports[_0x2dd4('0x51')]=function(_0x5d73e2,_0x4fe11f){return db[_0x2dd4('0x44')][_0x2dd4('0x51')]()[_0x2dd4('0x27')](respondWithResult(_0x4fe11f,null))['catch'](handleError(_0x4fe11f,null));};exports[_0x2dd4('0x52')]=function(_0x1db4ad,_0x1d68b4,_0x2a134f){if(_0x1db4ad[_0x2dd4('0x4b')]['id']){delete _0x1db4ad[_0x2dd4('0x4b')]['id'];}return db[_0x2dd4('0x44')][_0x2dd4('0x49')]({'where':{'id':_0x1db4ad['params']['id']}})[_0x2dd4('0x27')](handleEntityNotFound(_0x1d68b4,null))['then'](function(_0x30b12d){if(_0x30b12d){_0x1db4ad['body'][_0x2dd4('0x53')]=_0x30b12d['id'];return db[_0x2dd4('0x54')][_0x2dd4('0x4a')](_0x1db4ad[_0x2dd4('0x4b')]);}})[_0x2dd4('0x27')](respondWithResult(_0x1d68b4,null))[_0x2dd4('0x47')](handleError(_0x1d68b4,null));};exports['getDispositions']=function(_0x45971e,_0x3d9505,_0x4b93d4){var _0x4f3ec2={'raw':![],'where':{}};var _0x3a1155={};var _0x26d80d={'count':0x0,'rows':[]};return db['CmList'][_0x2dd4('0x55')]({'where':{'id':_0x45971e[_0x2dd4('0x48')]['id']}})[_0x2dd4('0x27')](handleEntityNotFound(_0x3d9505,null))['then'](function(_0x5df958){if(_0x5df958){_0x3a1155[_0x2dd4('0x38')]=_[_0x2dd4('0x35')](db[_0x2dd4('0x54')][_0x2dd4('0x31')]);_0x3a1155[_0x2dd4('0x36')]=_[_0x2dd4('0x35')](_0x45971e[_0x2dd4('0x36')]);_0x3a1155[_0x2dd4('0x40')]=_['intersection'](_0x3a1155[_0x2dd4('0x38')],_0x3a1155[_0x2dd4('0x36')]);_0x4f3ec2[_0x2dd4('0x39')]=_[_0x2dd4('0x37')](_0x3a1155[_0x2dd4('0x38')],qs['fields'](_0x45971e[_0x2dd4('0x36')][_0x2dd4('0x3a')]));_0x4f3ec2[_0x2dd4('0x39')]=_0x4f3ec2[_0x2dd4('0x39')][_0x2dd4('0x56')]?_0x4f3ec2[_0x2dd4('0x39')]:_0x3a1155[_0x2dd4('0x38')];if(!_0x45971e[_0x2dd4('0x36')][_0x2dd4('0x3b')]('nolimit')){_0x4f3ec2[_0x2dd4('0x20')]=qs['limit'](_0x45971e[_0x2dd4('0x36')][_0x2dd4('0x20')]);_0x4f3ec2[_0x2dd4('0x3d')]=qs[_0x2dd4('0x3d')](_0x45971e[_0x2dd4('0x36')]['offset']);}_0x4f3ec2['order']=qs[_0x2dd4('0x3e')](_0x45971e['query'][_0x2dd4('0x3e')]);_0x4f3ec2[_0x2dd4('0x3f')]=qs[_0x2dd4('0x40')](_[_0x2dd4('0x57')](_0x45971e[_0x2dd4('0x36')],_0x3a1155[_0x2dd4('0x40')]));_0x4f3ec2['where']['ListId']=_0x5df958['id'];if(_0x45971e[_0x2dd4('0x36')][_0x2dd4('0x58')]){_0x4f3ec2[_0x2dd4('0x3f')]=_[_0x2dd4('0x41')](_0x4f3ec2[_0x2dd4('0x3f')],{'$or':_[_0x2dd4('0x30')](_0x4f3ec2[_0x2dd4('0x39')],function(_0x53c9e2){var _0x581365={};_0x581365[_0x53c9e2]={'$like':'%'+_0x45971e[_0x2dd4('0x36')][_0x2dd4('0x58')]+'%'};return _0x581365;})});}_0x4f3ec2=_[_0x2dd4('0x41')]({},_0x4f3ec2,_0x45971e[_0x2dd4('0x43')]);return db['Disposition']['count']({'where':_0x4f3ec2[_0x2dd4('0x3f')]})[_0x2dd4('0x27')](function(_0x48f8e6){_0x26d80d[_0x2dd4('0x21')]=_0x48f8e6;if(_0x45971e[_0x2dd4('0x36')][_0x2dd4('0x45')]){_0x4f3ec2[_0x2dd4('0x46')]=[{'all':!![]}];}return db[_0x2dd4('0x54')]['findAll'](_0x4f3ec2);})[_0x2dd4('0x27')](function(_0x3c68c4){_0x26d80d['rows']=_0x3c68c4;return _0x26d80d;});}})[_0x2dd4('0x27')](respondWithFilteredResult(_0x3d9505,_0x4f3ec2))['catch'](handleError(_0x3d9505,null));};exports['removeDispositions']=function(_0x243a41,_0x3cb85a,_0x135c04){return db[_0x2dd4('0x44')][_0x2dd4('0x49')]({'where':{'id':_0x243a41['params']['id']}})[_0x2dd4('0x27')](handleEntityNotFound(_0x3cb85a,null))[_0x2dd4('0x27')](function(_0x3fa423){if(_0x3fa423){return _0x3fa423[_0x2dd4('0x59')](_0x243a41['query'][_0x2dd4('0x5a')]);}})[_0x2dd4('0x27')](respondWithStatusCode(_0x3cb85a,null))[_0x2dd4('0x47')](handleError(_0x3cb85a,null));};exports[_0x2dd4('0x5b')]=function(_0x2a3ad5,_0x462fe4,_0x2af7c1){return db['CmList'][_0x2dd4('0x49')]({'where':{'id':_0x2a3ad5['params']['id']}})[_0x2dd4('0x27')](handleEntityNotFound(_0x462fe4,null))[_0x2dd4('0x27')](function(_0xcfc759){if(_0xcfc759){var _0x48bf4b=[];var _0x43297e={'success':[],'errors':[]};return db[_0x2dd4('0x5c')][_0x2dd4('0x51')]()['then'](function(_0x4b6251){if(_0x2a3ad5[_0x2dd4('0x4b')][_0x2dd4('0x5d')]&&_[_0x2dd4('0x5e')](_0x2a3ad5[_0x2dd4('0x4b')][_0x2dd4('0x5d')])){if(_0x2a3ad5['body'][_0x2dd4('0x5d')][_0x2dd4('0x56')]){_0x2a3ad5[_0x2dd4('0x4b')][_0x2dd4('0x5d')]=_0x2a3ad5[_0x2dd4('0x4b')][_0x2dd4('0x5d')][_0x2dd4('0x5f')](';')+';';}else{_0x2a3ad5['body'][_0x2dd4('0x5d')]=null;}}else{_0x2a3ad5['body'][_0x2dd4('0x5d')]=null;}if(_0x2a3ad5['body']&&_[_0x2dd4('0x5e')](_0x2a3ad5[_0x2dd4('0x4b')])){for(var _0xbc978d=0x0;_0xbc978d<_0x2a3ad5[_0x2dd4('0x4b')][_0x2dd4('0x56')];_0xbc978d+=0x1){_0x2a3ad5[_0x2dd4('0x4b')][_0xbc978d]['ListId']=_0x2a3ad5['params']['id'];_0x48bf4b[_0x2dd4('0x60')](_0x2a3ad5['body'][_0xbc978d]);}return BPromise['each'](_0x48bf4b,function(_0x3010d4){return db[_0x2dd4('0x5c')][_0x2dd4('0x4a')](_[_0x2dd4('0x61')](_0x3010d4,['ids','id'])||{},{'fields':_['keys'](_0x4b6251),'raw':!![]})[_0x2dd4('0x27')](function(_0x193d65){_0x43297e['success'][_0x2dd4('0x60')](_0x193d65[_0x2dd4('0x62')]);})[_0x2dd4('0x47')](function(_0x4824cc){_0x43297e[_0x2dd4('0x63')][_0x2dd4('0x60')]({'data':_0x3010d4,'error':_0x4824cc[_0x2dd4('0x64')]});});})['then'](function(_0x2ab80e){return _0x43297e;})[_0x2dd4('0x47')](function(_0x57beee){return _0x57beee;});}else{_0x462fe4[_0x2dd4('0x1c')](0x190)[_0x2dd4('0x1e')]({'message':_0x2dd4('0x65')});}});}})[_0x2dd4('0x27')](respondWithResult(_0x462fe4,null))[_0x2dd4('0x47')](handleError(_0x462fe4,null));};exports[_0x2dd4('0x66')]=function(_0x3c8f94,_0x439d37,_0x36d3d4){var _0xf17ce7;return db[_0x2dd4('0x44')][_0x2dd4('0x49')]({'where':{'id':_0x3c8f94['params']['id']},'include':[{'model':db[_0x2dd4('0x67')],'as':_0x2dd4('0x68')}]})[_0x2dd4('0x27')](handleEntityNotFound(_0x439d37,null))[_0x2dd4('0x27')](function(_0x510235){if(_0x510235){_0xf17ce7=_0x510235;return db[_0x2dd4('0x5c')][_0x2dd4('0x31')];}})[_0x2dd4('0x27')](function(_0x45c4d4){if(_0x45c4d4){var _0x1a078f={};var _0x422186={};_0x422186[_0x2dd4('0x38')]=_['concat'](_[_0x2dd4('0x35')](_0x45c4d4),_['map'](_0xf17ce7[_0x2dd4('0x68')],function(_0x3c0e81){return util[_0x2dd4('0x69')]('cf_%d',_0x3c0e81['id']);}));_0x422186[_0x2dd4('0x36')]=_['keys'](_0x3c8f94[_0x2dd4('0x36')]);_0x422186[_0x2dd4('0x40')]=_[_0x2dd4('0x37')](_0x422186[_0x2dd4('0x38')],_0x422186[_0x2dd4('0x36')]);_0x1a078f[_0x2dd4('0x39')]=_[_0x2dd4('0x37')](_0x422186[_0x2dd4('0x38')],qs[_0x2dd4('0x3a')](_0x3c8f94[_0x2dd4('0x36')]['fields']));_0x1a078f[_0x2dd4('0x39')]=_0x1a078f[_0x2dd4('0x39')][_0x2dd4('0x56')]?_0x1a078f['attributes']:_0x422186[_0x2dd4('0x38')];if(!_0x3c8f94[_0x2dd4('0x36')][_0x2dd4('0x3b')](_0x2dd4('0x3c'))){_0x1a078f['limit']=qs[_0x2dd4('0x20')](_0x3c8f94[_0x2dd4('0x36')][_0x2dd4('0x20')]);_0x1a078f[_0x2dd4('0x3d')]=qs[_0x2dd4('0x3d')](_0x3c8f94[_0x2dd4('0x36')][_0x2dd4('0x3d')]);}_0x1a078f[_0x2dd4('0x6a')]=qs[_0x2dd4('0x3e')](_0x3c8f94[_0x2dd4('0x36')][_0x2dd4('0x3e')]);_0x1a078f[_0x2dd4('0x3f')]=qs[_0x2dd4('0x40')](_[_0x2dd4('0x57')](_0x3c8f94[_0x2dd4('0x36')],_0x422186[_0x2dd4('0x40')]));_0x1a078f[_0x2dd4('0x6b')]=!![];if(_0x3c8f94['query'][_0x2dd4('0x58')]){_0x1a078f[_0x2dd4('0x3f')]=_[_0x2dd4('0x41')](_0x1a078f['where'],{'$or':_[_0x2dd4('0x30')](_0x1a078f['attributes'],function(_0x493f08){var _0x170a21={};_0x170a21[_0x493f08]={'$like':'%'+_0x3c8f94[_0x2dd4('0x36')][_0x2dd4('0x58')]+'%'};return _0x170a21;})});}_0x1a078f=_[_0x2dd4('0x41')]({},_0x1a078f,_0x3c8f94['options']);return _0xf17ce7['getContacts'](_0x1a078f);}})[_0x2dd4('0x27')](respondWithResult(_0x439d37,null))[_0x2dd4('0x47')](handleError(_0x439d37,null));};exports[_0x2dd4('0x6c')]=function(_0x213dd1,_0x3f3e93,_0x35841d){var _0x2ea105;var _0x1850c6;var _0xac1f9a;var _0x1af558=_0x213dd1[_0x2dd4('0x48')]['id'];csv_results=[];return db[_0x2dd4('0x6d')][_0x2dd4('0x6e')]({'attributes':['id',_0x2dd4('0x2d')],'raw':!![],'order':[_0x2dd4('0x6f')]})[_0x2dd4('0x27')](function(_0x4cc50a){_0x2ea105=_0x4cc50a;var _0x38f001=_['keys'](db[_0x2dd4('0x5c')][_0x2dd4('0x31')]);return db[_0x2dd4('0x67')][_0x2dd4('0x6e')]({'raw':!![],'attributes':['id','alias']})[_0x2dd4('0x27')](function(_0x5ea200){_0x1850c6=_0x5ea200;var _0x574689=squel['select']()[_0x2dd4('0x3a')](_0x38f001)[_0x2dd4('0x70')](_0x2dd4('0x71'),'c')['where'](_0x2dd4('0x72'),_0x1af558)[_0x2dd4('0x3f')]('c.deletedAt\x20is\x20null')[_0x2dd4('0x73')]();for(var _0x2e8245=0x0;_0x2e8245<_0x1850c6['length'];_0x2e8245++){_0x574689[_0x2dd4('0x74')](_0x2dd4('0x75')+_0x1850c6[_0x2e8245]['id'],_0x2dd4('0x76')+_0x1850c6[_0x2e8245][_0x2dd4('0x77')]);}for(var _0x2e8245=0x0;_0x2e8245<_0x2ea105[_0x2dd4('0x56')];_0x2e8245++){_0x574689[_0x2dd4('0x74')](squel['select']()[_0x2dd4('0x74')](_0x2dd4('0x78'))[_0x2dd4('0x70')](_0x2dd4('0x79'))[_0x2dd4('0x3f')](_0x2dd4('0x7a'),_0x2ea105[_0x2e8245]['id'])[_0x2dd4('0x3f')](_0x2dd4('0x7b')),_0x2dd4('0x7c')+_0x2ea105[_0x2e8245][_0x2dd4('0x2d')]);_0x574689[_0x2dd4('0x74')](squel[_0x2dd4('0x7d')]()[_0x2dd4('0x74')](_0x2dd4('0x7e'))[_0x2dd4('0x70')](_0x2dd4('0x79'))['where'](_0x2dd4('0x7a'),_0x2ea105[_0x2e8245]['id'])[_0x2dd4('0x3f')](_0x2dd4('0x7b')),_0x2dd4('0x7f')+_0x2ea105[_0x2e8245][_0x2dd4('0x2d')]);}var _0x3beb67=[];_0x3beb67[_0x2dd4('0x60')](_0x574689[_0x2dd4('0x80')]());BPromise[_0x2dd4('0x81')](_0x3beb67,handleQuery)[_0x2dd4('0x27')](function(_0x28fe06){handleQuery(_0x574689[_0x2dd4('0x80')]());var _0x378a9e=csv_results[0x0];if(!_[_0x2dd4('0x82')](_0x378a9e)){var _0x255868=toCsv(_0x378a9e);var _0xb094a8=Date[_0x2dd4('0x83')]();fs[_0x2dd4('0x84')](util[_0x2dd4('0x69')](_0x2dd4('0x85'),_0x1af558,_0xb094a8),_0x255868);_0x3f3e93[_0x2dd4('0x86')]('Content-disposition',_0x2dd4('0x87')+util['format'](_0x2dd4('0x88'),_0x1af558,_0xb094a8));_0x3f3e93[_0x2dd4('0x86')](_0x2dd4('0x89'),_0x2dd4('0x8a'));return _0x3f3e93[_0x2dd4('0x8b')](util[_0x2dd4('0x69')](_0x2dd4('0x85'),_0x1af558,_0xb094a8));}else{return _0x3f3e93['sendStatus'](0xcc);}});});});};exports[_0x2dd4('0x8c')]=function(_0x2393c1,_0x57b40e,_0x389c61){var _0x11c326;delete _0x2393c1[_0x2dd4('0x4b')]['id'];return db[_0x2dd4('0x44')][_0x2dd4('0x55')]({'where':{'id':_0x2393c1[_0x2dd4('0x48')]['id']}})['then'](handleEntityNotFound(_0x57b40e,null))['then'](function(_0x2e7983){if(_0x2e7983){return db[_0x2dd4('0x8d')][_0x2dd4('0x8e')](function(_0x3c3f00){return db['CmCustomField'][_0x2dd4('0x4a')](_0x2393c1[_0x2dd4('0x4b')],{'transaction':_0x3c3f00})[_0x2dd4('0x27')](function(_0x80c53d){_0x11c326=_0x80c53d;return _0x2e7983[_0x2dd4('0x8f')](_0x80c53d,{'transaction':_0x3c3f00});})[_0x2dd4('0x27')](function(){var _0x22447e={'type':db[_0x2dd4('0x90')][_0x2dd4('0x91')],'transaction':_0x3c3f00};switch(_0x2393c1['body'][_0x2dd4('0x33')]){case _0x2dd4('0x92'):_0x22447e[_0x2dd4('0x33')]=db['Sequelize'][_0x2dd4('0x91')];break;case'number':_0x22447e[_0x2dd4('0x33')]=db['Sequelize'][_0x2dd4('0x93')];break;case _0x2dd4('0x94'):_0x22447e['type']=db[_0x2dd4('0x90')][_0x2dd4('0x95')];_0x22447e[_0x2dd4('0x96')]=![];break;default:}return db[_0x2dd4('0x8d')]['queryInterface']['addColumn']('cm_contacts',util[_0x2dd4('0x69')](_0x2dd4('0x97'),_0x11c326['id']),_0x22447e);})[_0x2dd4('0x27')](function(){return _0x11c326;});});}})[_0x2dd4('0x27')](respondWithResult(_0x57b40e,null))[_0x2dd4('0x47')](handleError(_0x57b40e,null));};exports[_0x2dd4('0x98')]=function(_0x1b8f5f,_0x52ce2c,_0x559e5f){var _0x5b894e={};var _0x2228c8={};var _0x4b3f07;var _0x4649f2;return db[_0x2dd4('0x44')]['findOne']({'where':{'id':_0x1b8f5f[_0x2dd4('0x48')]['id']}})[_0x2dd4('0x27')](handleEntityNotFound(_0x52ce2c,null))[_0x2dd4('0x27')](function(_0x35882d){if(_0x35882d){_0x4b3f07=_0x35882d;_0x2228c8[_0x2dd4('0x38')]=_[_0x2dd4('0x35')](db['CmCustomField'][_0x2dd4('0x31')]);_0x2228c8[_0x2dd4('0x36')]=_[_0x2dd4('0x35')](_0x1b8f5f['query']);_0x2228c8[_0x2dd4('0x40')]=_[_0x2dd4('0x37')](_0x2228c8[_0x2dd4('0x38')],_0x2228c8[_0x2dd4('0x36')]);_0x5b894e[_0x2dd4('0x39')]=_[_0x2dd4('0x37')](_0x2228c8[_0x2dd4('0x38')],qs[_0x2dd4('0x3a')](_0x1b8f5f[_0x2dd4('0x36')]['fields']));_0x5b894e[_0x2dd4('0x39')]=_0x5b894e['attributes'][_0x2dd4('0x56')]?_0x5b894e['attributes']:_0x2228c8[_0x2dd4('0x38')];_0x5b894e['order']=qs[_0x2dd4('0x3e')](_0x1b8f5f['query']['sort']);_0x5b894e[_0x2dd4('0x3f')]=qs[_0x2dd4('0x40')](_[_0x2dd4('0x57')](_0x1b8f5f[_0x2dd4('0x36')],_0x2228c8[_0x2dd4('0x40')]));_0x5b894e['where']=_[_0x2dd4('0x41')](_0x5b894e[_0x2dd4('0x3f')],{'$or':[{'ListId':_0x35882d['id']},{'ListId':null}]});if(_0x1b8f5f['query']['filter']){_0x5b894e[_0x2dd4('0x3f')]=_[_0x2dd4('0x41')](_0x5b894e['where'],{'$or':_['map'](_0x5b894e[_0x2dd4('0x39')],function(_0x485a5c){var _0x18d587={};_0x18d587[_0x485a5c]={'$like':'%'+_0x1b8f5f[_0x2dd4('0x36')]['filter']+'%'};return _0x18d587;})});}_0x5b894e=_[_0x2dd4('0x41')]({},_0x5b894e,_0x1b8f5f[_0x2dd4('0x43')]);return db[_0x2dd4('0x67')][_0x2dd4('0x99')](_0x5b894e);}})[_0x2dd4('0x27')](respondWithResult(_0x52ce2c,null))[_0x2dd4('0x47')](handleError(_0x52ce2c,null));};exports[_0x2dd4('0x9a')]=function(_0x5f1046,_0x1741f3){return db[_0x2dd4('0x67')][_0x2dd4('0x99')]({'where':{'ListId':null}})[_0x2dd4('0x27')](handleEntityNotFound(_0x1741f3,null))[_0x2dd4('0x27')](function(_0x21946f){return _0x21946f;})['then'](respondWithResult(_0x1741f3,null))[_0x2dd4('0x47')](handleError(_0x1741f3,null));};exports['addAgents']=function(_0x5c692d,_0x396aa7,_0x4fe61b){return db['CmList']['find']({'where':{'id':_0x5c692d[_0x2dd4('0x48')]['id']}})[_0x2dd4('0x27')](handleEntityNotFound(_0x396aa7,null))[_0x2dd4('0x27')](function(_0x4d6df0){if(_0x4d6df0){return _0x4d6df0[_0x2dd4('0x9b')](_0x5c692d[_0x2dd4('0x4b')]['ids'],_[_0x2dd4('0x61')](_0x5c692d[_0x2dd4('0x4b')],[_0x2dd4('0x5a'),'id'])||{})[_0x2dd4('0x9c')](function(_0x1367a1){for(var _0x10fb77=0x0;_0x10fb77<_0x5c692d[_0x2dd4('0x4b')]['ids'][_0x2dd4('0x56')];_0x10fb77+=0x1){socket[_0x2dd4('0x9d')](_0x2dd4('0x9e'),{'UserId':Number(_0x5c692d[_0x2dd4('0x4b')][_0x2dd4('0x5a')][_0x10fb77]),'CmListId':Number(_0x5c692d['params']['id'])});}return _0x1367a1;});}})['then'](respondWithResult(_0x396aa7,null))[_0x2dd4('0x47')](handleError(_0x396aa7,null));};exports['removeAgents']=function(_0x53c051,_0x2d8d1f,_0x53a603){return db[_0x2dd4('0x44')][_0x2dd4('0x49')]({'where':{'id':_0x53c051[_0x2dd4('0x48')]['id']}})[_0x2dd4('0x27')](handleEntityNotFound(_0x2d8d1f,null))[_0x2dd4('0x27')](function(_0x5246c1){if(_0x5246c1){return _0x5246c1['removeAgents'](_0x53c051[_0x2dd4('0x36')][_0x2dd4('0x5a')])['then'](function(){if(_['isArray'](_0x53c051[_0x2dd4('0x36')]['ids'])){for(var _0x40cf54=0x0;_0x40cf54<_0x53c051[_0x2dd4('0x36')][_0x2dd4('0x5a')][_0x2dd4('0x56')];_0x40cf54+=0x1){socket['emit'](_0x2dd4('0x9f'),{'UserId':Number(_0x53c051[_0x2dd4('0x36')]['ids'][_0x40cf54]),'CmListId':Number(_0x53c051[_0x2dd4('0x48')]['id'])});}}else{socket['emit'](_0x2dd4('0x9f'),{'UserId':Number(_0x53c051['query']['ids']),'CmListId':Number(_0x53c051[_0x2dd4('0x48')]['id'])});}});}})[_0x2dd4('0x27')](respondWithStatusCode(_0x2d8d1f,null))[_0x2dd4('0x47')](handleError(_0x2d8d1f,null));};exports[_0x2dd4('0xa0')]=function(_0xcf572e,_0x42c778,_0x5668ab){var _0x494b80={};var _0x4957ca={};var _0xc27e00;var _0x1e29ea;return db[_0x2dd4('0x44')][_0x2dd4('0x55')]({'where':{'id':_0xcf572e[_0x2dd4('0x48')]['id']}})['then'](handleEntityNotFound(_0x42c778,null))[_0x2dd4('0x27')](function(_0x195815){if(_0x195815){_0xc27e00=_0x195815;_0x4957ca[_0x2dd4('0x38')]=_[_0x2dd4('0x35')](db[_0x2dd4('0xa1')][_0x2dd4('0x31')]);_0x4957ca[_0x2dd4('0x36')]=_['keys'](_0xcf572e[_0x2dd4('0x36')]);_0x4957ca[_0x2dd4('0x40')]=_['intersection'](_0x4957ca['model'],_0x4957ca[_0x2dd4('0x36')]);_0x494b80[_0x2dd4('0x39')]=_[_0x2dd4('0x37')](_0x4957ca['model'],qs[_0x2dd4('0x3a')](_0xcf572e[_0x2dd4('0x36')]['fields']));_0x494b80['attributes']=_0x494b80[_0x2dd4('0x39')][_0x2dd4('0x56')]?_0x494b80['attributes']:_0x4957ca[_0x2dd4('0x38')];_0x494b80[_0x2dd4('0x6a')]=qs[_0x2dd4('0x3e')](_0xcf572e[_0x2dd4('0x36')][_0x2dd4('0x3e')]);_0x494b80[_0x2dd4('0x3f')]=qs[_0x2dd4('0x40')](_[_0x2dd4('0x57')](_0xcf572e['query'],_0x4957ca['filters']));if(_0xcf572e[_0x2dd4('0x36')][_0x2dd4('0x58')]){_0x494b80[_0x2dd4('0x3f')]=_[_0x2dd4('0x41')](_0x494b80['where'],{'$or':_['map'](_0x494b80[_0x2dd4('0x39')],function(_0xf2fc6e){var _0x5ed5b6={};_0x5ed5b6[_0xf2fc6e]={'$like':'%'+_0xcf572e['query'][_0x2dd4('0x58')]+'%'};return _0x5ed5b6;})});}_0x494b80=_[_0x2dd4('0x41')]({},_0x494b80,_0xcf572e['options']);return _0xc27e00[_0x2dd4('0xa0')](_0x494b80);}})[_0x2dd4('0x27')](function(_0x36e55b){if(_0x36e55b){_0x1e29ea=_0x36e55b['length'];if(!_0xcf572e[_0x2dd4('0x36')][_0x2dd4('0x3b')](_0x2dd4('0x3c'))){_0x494b80[_0x2dd4('0x20')]=qs[_0x2dd4('0x20')](_0xcf572e['query'][_0x2dd4('0x20')]);_0x494b80[_0x2dd4('0x3d')]=qs[_0x2dd4('0x3d')](_0xcf572e[_0x2dd4('0x36')][_0x2dd4('0x3d')]);}return _0xc27e00[_0x2dd4('0xa0')](_0x494b80);}})[_0x2dd4('0x27')](function(_0x51644b){if(_0x51644b){return _0x51644b?{'count':_0x1e29ea,'rows':_0x51644b}:null;}})['then'](respondWithResult(_0x42c778,null))[_0x2dd4('0x47')](handleError(_0x42c778,null));};function handleQuery(_0x4034f0){logger[_0x2dd4('0xa2')](_0x4034f0);return db['sequelize'][_0x2dd4('0x36')](_0x4034f0)['spread'](function(_0x46182e){csv_results[_0x2dd4('0x60')](_0x46182e);})['catch'](function(_0x14018a){logger[_0x2dd4('0x2b')](_0x14018a[_0x2dd4('0x64')]);});} \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 82cb645..8f41152 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(_0x5c3526,_0x2a1e90){var _0xec27a2=function(_0x5ac4e1){while(--_0x5ac4e1){_0x5c3526['push'](_0x5c3526['shift']());}};_0xec27a2(++_0x2a1e90);}(_0x814b,0x1a2));var _0xb814=function(_0x2605dc,_0x50cf7e){_0x2605dc=_0x2605dc-0x0;var _0x4568c9=_0x814b[_0x2605dc];return _0x4568c9;};'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 _0xe14b=['hasOwnProperty','hook','exports','events','../../mysqldb','save','update','emit'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xe14b,0x93));var _0xbe14=function(_0x4deb73,_0x55852){_0x4deb73=_0x4deb73-0x0;var _0x336abd=_0xe14b[_0x4deb73];return _0x336abd;};'use strict';var EventEmitter=require(_0xbe14('0x0'));var CmList=require(_0xbe14('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbe14('0x2'),'afterUpdate':_0xbe14('0x3'),'afterDestroy':'remove'};function emitEvent(_0x7d3665){return function(_0x5ce8fb,_0x496c04,_0x1833e3){CmListEvents[_0xbe14('0x4')](_0x7d3665+':'+_0x5ce8fb['id'],_0x5ce8fb);CmListEvents[_0xbe14('0x4')](_0x7d3665,_0x5ce8fb);_0x1833e3(null);};}for(var e in events){if(events[_0xbe14('0x5')](e)){var event=events[e];CmList[_0xbe14('0x6')](e,emitEvent(event));}}module[_0xbe14('0x7')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 932cf56..1628570 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 _0xbec5=['request-promise','path','../../config/environment','./cmList.attributes','exports','define','CmList','cm_lists','lodash','util','api','moment','bluebird'];(function(_0x4b5562,_0x16564e){var _0x3f94d5=function(_0x4ddcdb){while(--_0x4ddcdb){_0x4b5562['push'](_0x4b5562['shift']());}};_0x3f94d5(++_0x16564e);}(_0xbec5,0xe5));var _0x5bec=function(_0x44f974,_0x4db616){_0x44f974=_0x44f974-0x0;var _0x805dbd=_0xbec5[_0x44f974];return _0x805dbd;};'use strict';var _=require(_0x5bec('0x0'));var util=require(_0x5bec('0x1'));var logger=require('../../config/logger')(_0x5bec('0x2'));var moment=require(_0x5bec('0x3'));var BPromise=require(_0x5bec('0x4'));var rp=require(_0x5bec('0x5'));var fs=require('fs');var path=require(_0x5bec('0x6'));var rimraf=require('rimraf');var config=require(_0x5bec('0x7'));var attributes=require(_0x5bec('0x8'));module[_0x5bec('0x9')]=function(_0x4aaac6,_0x3ed67a){return _0x4aaac6[_0x5bec('0xa')](_0x5bec('0xb'),attributes,{'tableName':_0x5bec('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4ea3=['CmList','cm_lists','lodash','util','../../config/logger','api','bluebird','path','./cmList.attributes','exports','define'];(function(_0x13137e,_0x29c0f3){var _0x346261=function(_0x8c7d4f){while(--_0x8c7d4f){_0x13137e['push'](_0x13137e['shift']());}};_0x346261(++_0x29c0f3);}(_0x4ea3,0x70));var _0x34ea=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x4ea3[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x34ea('0x0'));var util=require(_0x34ea('0x1'));var logger=require(_0x34ea('0x2'))(_0x34ea('0x3'));var moment=require('moment');var BPromise=require(_0x34ea('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x34ea('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x34ea('0x6'));module[_0x34ea('0x7')]=function(_0x962596,_0x123d48){return _0x962596[_0x34ea('0x8')](_0x34ea('0x9'),attributes,{'tableName':_0x34ea('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index 15d46d4..871ebdb 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 _0x3ebc=['randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./cmList.socket','request','info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment'];(function(_0x44653b,_0x2d5222){var _0x58b43a=function(_0x32b2e2){while(--_0x32b2e2){_0x44653b['push'](_0x44653b['shift']());}};_0x58b43a(++_0x2d5222);}(_0x3ebc,0x165));var _0xc3eb=function(_0x2f3054,_0x316a26){_0x2f3054=_0x2f3054-0x0;var _0x5ca645=_0x3ebc[_0x2f3054];return _0x5ca645;};'use strict';var _=require(_0xc3eb('0x0'));var util=require(_0xc3eb('0x1'));var moment=require(_0xc3eb('0x2'));var BPromise=require('bluebird');var rs=require(_0xc3eb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc3eb('0x4'))['db'];var utils=require(_0xc3eb('0x5'));var logger=require('../../config/logger')(_0xc3eb('0x6'));var config=require(_0xc3eb('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc3eb('0x8')]['http']({'port':0x232a});config[_0xc3eb('0x9')]=_[_0xc3eb('0xa')](config[_0xc3eb('0x9')],{'host':_0xc3eb('0xb'),'port':0x18eb});var socket=require(_0xc3eb('0xc'))(new Redis(config['redis']));require(_0xc3eb('0xd'))['register'](socket);function respondWithRpcPromise(_0x30bf8f,_0x12edee,_0x5a5dfa){return new BPromise(function(_0x31cf5e,_0x4f6742){return client[_0xc3eb('0xe')](_0x30bf8f,_0x5a5dfa)['then'](function(_0x4acfc1){logger[_0xc3eb('0xf')](_0xc3eb('0x10'),_0x12edee,_0xc3eb('0x11'));logger[_0xc3eb('0x12')](_0xc3eb('0x13'),_0x12edee,'request\x20sent',JSON['stringify'](_0x4acfc1));if(_0x4acfc1[_0xc3eb('0x14')]){if(_0x4acfc1[_0xc3eb('0x14')]['code']===0x1f4){logger[_0xc3eb('0x14')](_0xc3eb('0x10'),_0x12edee,_0x4acfc1['error'][_0xc3eb('0x15')]);return _0x4f6742(_0x4acfc1[_0xc3eb('0x14')]['message']);}logger[_0xc3eb('0x14')](_0xc3eb('0x10'),_0x12edee,_0x4acfc1[_0xc3eb('0x14')][_0xc3eb('0x15')]);return _0x31cf5e(_0x4acfc1['error'][_0xc3eb('0x15')]);}else{logger[_0xc3eb('0xf')](_0xc3eb('0x10'),_0x12edee,_0xc3eb('0x11'));_0x31cf5e(_0x4acfc1[_0xc3eb('0x16')]['message']);}})[_0xc3eb('0x17')](function(_0x4a9f5e){logger['error'](_0xc3eb('0x10'),_0x12edee,_0x4a9f5e);_0x4f6742(_0x4a9f5e);});});} \ No newline at end of file +var _0x5f64=['localhost','./cmList.socket','register','request','then','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','CmList,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5f64,0xff));var _0x45f6=function(_0x2932cf,_0x362fd9){_0x2932cf=_0x2932cf-0x0;var _0x1711dd=_0x5f64[_0x2932cf];return _0x1711dd;};'use strict';var _=require(_0x45f6('0x0'));var util=require(_0x45f6('0x1'));var moment=require(_0x45f6('0x2'));var BPromise=require(_0x45f6('0x3'));var rs=require(_0x45f6('0x4'));var fs=require('fs');var Redis=require(_0x45f6('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x45f6('0x6'));var logger=require(_0x45f6('0x7'))(_0x45f6('0x8'));var config=require(_0x45f6('0x9'));var jayson=require(_0x45f6('0xa'));var client=jayson[_0x45f6('0xb')][_0x45f6('0xc')]({'port':0x232a});config['redis']=_[_0x45f6('0xd')](config[_0x45f6('0xe')],{'host':_0x45f6('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x45f6('0x10'))[_0x45f6('0x11')](socket);function respondWithRpcPromise(_0x5177a2,_0x5c40d3,_0x491786){return new BPromise(function(_0x8ae4f5,_0x6dee8){return client[_0x45f6('0x12')](_0x5177a2,_0x491786)[_0x45f6('0x13')](function(_0x82d737){logger['info']('CmList,\x20%s,\x20%s',_0x5c40d3,_0x45f6('0x14'));logger[_0x45f6('0x15')](_0x45f6('0x16'),_0x5c40d3,'request\x20sent',JSON[_0x45f6('0x17')](_0x82d737));if(_0x82d737[_0x45f6('0x18')]){if(_0x82d737['error']['code']===0x1f4){logger[_0x45f6('0x18')](_0x45f6('0x19'),_0x5c40d3,_0x82d737[_0x45f6('0x18')][_0x45f6('0x1a')]);return _0x6dee8(_0x82d737['error'][_0x45f6('0x1a')]);}logger['error'](_0x45f6('0x19'),_0x5c40d3,_0x82d737[_0x45f6('0x18')][_0x45f6('0x1a')]);return _0x8ae4f5(_0x82d737[_0x45f6('0x18')]['message']);}else{logger[_0x45f6('0x1b')](_0x45f6('0x19'),_0x5c40d3,_0x45f6('0x14'));_0x8ae4f5(_0x82d737[_0x45f6('0x1c')][_0x45f6('0x1a')]);}})[_0x45f6('0x1d')](function(_0x3c7c15){logger['error']('CmList,\x20%s,\x20%s',_0x5c40d3,_0x3c7c15);_0x6dee8(_0x3c7c15);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index f18ef4c..b8a83ba 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 _0x29cb=['save','remove','update','emit','removeListener','register','length','cmList:','./cmList.events'];(function(_0x4de1b1,_0x18c64c){var _0x639f27=function(_0x635e03){while(--_0x635e03){_0x4de1b1['push'](_0x4de1b1['shift']());}};_0x639f27(++_0x18c64c);}(_0x29cb,0xce));var _0xb29c=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x29cb[_0x167cc1];return _0x10bc4b;};'use strict';var CmListEvents=require(_0xb29c('0x0'));var events=[_0xb29c('0x1'),_0xb29c('0x2'),_0xb29c('0x3')];function createListener(_0x1b9c03,_0x5c0978){return function(_0x250134){_0x5c0978[_0xb29c('0x4')](_0x1b9c03,_0x250134);};}function removeListener(_0x145108,_0x422a18){return function(){CmListEvents[_0xb29c('0x5')](_0x145108,_0x422a18);};}exports[_0xb29c('0x6')]=function(_0x471279){for(var _0xdbc289=0x0,_0x5e92c6=events[_0xb29c('0x7')];_0xdbc289<_0x5e92c6;_0xdbc289++){var _0x45f151=events[_0xdbc289];var _0x171652=createListener(_0xb29c('0x8')+_0x45f151,_0x471279);CmListEvents['on'](_0x45f151,_0x171652);}}; \ No newline at end of file +var _0xbd72=['save','remove','emit','register','length','cmList:','./cmList.events'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbd72,0x11e));var _0x2bd7=function(_0x1ebeea,_0x2f54f4){_0x1ebeea=_0x1ebeea-0x0;var _0x576465=_0xbd72[_0x1ebeea];return _0x576465;};'use strict';var CmListEvents=require(_0x2bd7('0x0'));var events=[_0x2bd7('0x1'),_0x2bd7('0x2'),'update'];function createListener(_0x82bd16,_0x242775){return function(_0x99173b){_0x242775[_0x2bd7('0x3')](_0x82bd16,_0x99173b);};}function removeListener(_0xcba1e1,_0x956a63){return function(){CmListEvents['removeListener'](_0xcba1e1,_0x956a63);};}exports[_0x2bd7('0x4')]=function(_0x176feb){for(var _0x1f399d=0x0,_0x488a05=events[_0x2bd7('0x5')];_0x1f399d<_0x488a05;_0x1f399d++){var _0x1a0cad=events[_0x1f399d];var _0x2b41fc=createListener(_0x2bd7('0x6')+_0x1a0cad,_0x176feb);CmListEvents['on'](_0x1a0cad,_0x2b41fc);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index c1f76a4..5fc7b77 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 _0x77b4=['addCustomField','put','update','delete','destroy','removeAgents','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmList.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/contacts','/:id/fields','getCustomFields','/:id/users','post','create','addDisposition','addContacts'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x77b4,0x11d));var _0x477b=function(_0x5204d9,_0x23cdab){_0x5204d9=_0x5204d9-0x0;var _0x1825cd=_0x77b4[_0x5204d9];return _0x1825cd;};'use strict';var multer=require('multer');var util=require(_0x477b('0x0'));var path=require(_0x477b('0x1'));var timeout=require(_0x477b('0x2'));var express=require(_0x477b('0x3'));var router=express[_0x477b('0x4')]();var fs_extra=require(_0x477b('0x5'));var auth=require(_0x477b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x477b('0x7'));var controller=require(_0x477b('0x8'));router[_0x477b('0x9')]('/',auth[_0x477b('0xa')](),controller['index']);router[_0x477b('0x9')](_0x477b('0xb'),auth[_0x477b('0xa')](),controller[_0x477b('0xc')]);router['get']('/global_fields',auth[_0x477b('0xa')](),controller['getGlobalCustomFields']);router[_0x477b('0x9')](_0x477b('0xd'),auth[_0x477b('0xa')](),controller[_0x477b('0xe')]);router['get'](_0x477b('0xf'),auth[_0x477b('0xa')](),controller[_0x477b('0x10')]);router[_0x477b('0x9')](_0x477b('0x11'),auth[_0x477b('0xa')](),controller['getContacts']);router[_0x477b('0x9')]('/:id/contacts/csv',auth[_0x477b('0xa')](),controller['getContactsCsv']);router[_0x477b('0x9')](_0x477b('0x12'),auth[_0x477b('0xa')](),controller[_0x477b('0x13')]);router[_0x477b('0x9')](_0x477b('0x14'),auth[_0x477b('0xa')](),controller['getAgents']);router[_0x477b('0x15')]('/',auth[_0x477b('0xa')](),controller[_0x477b('0x16')]);router[_0x477b('0x15')]('/:id/dispositions',auth[_0x477b('0xa')](),controller[_0x477b('0x17')]);router[_0x477b('0x15')](_0x477b('0x11'),auth[_0x477b('0xa')](),controller[_0x477b('0x18')]);router[_0x477b('0x15')]('/:id/fields',auth[_0x477b('0xa')](),controller[_0x477b('0x19')]);router[_0x477b('0x15')]('/:id/users',auth[_0x477b('0xa')](),controller['addAgents']);router[_0x477b('0x1a')]('/:id',auth[_0x477b('0xa')](),controller[_0x477b('0x1b')]);router[_0x477b('0x1c')](_0x477b('0xd'),auth[_0x477b('0xa')](),controller[_0x477b('0x1d')]);router[_0x477b('0x1c')](_0x477b('0xf'),auth[_0x477b('0xa')](),controller['removeDispositions']);router[_0x477b('0x1c')]('/:id/users',auth[_0x477b('0xa')](),controller[_0x477b('0x1e')]);module['exports']=router; \ No newline at end of file +var _0x6b40=['describe','/global_fields','getGlobalCustomFields','/:id','show','/:id/dispositions','/:id/contacts/csv','getContactsCsv','/:id/fields','post','addDisposition','/:id/contacts','addContacts','addCustomField','/:id/users','addAgents','put','update','delete','destroy','removeDispositions','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmList.controller','get','isAuthenticated','index','/describe'];(function(_0x1c1483,_0x344989){var _0x435d4d=function(_0x1ecc1a){while(--_0x1ecc1a){_0x1c1483['push'](_0x1c1483['shift']());}};_0x435d4d(++_0x344989);}(_0x6b40,0xcb));var _0x06b4=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x6b40[_0x57b54c];return _0x59cc19;};'use strict';var multer=require(_0x06b4('0x0'));var util=require(_0x06b4('0x1'));var path=require(_0x06b4('0x2'));var timeout=require(_0x06b4('0x3'));var express=require('express');var router=express[_0x06b4('0x4')]();var fs_extra=require(_0x06b4('0x5'));var auth=require(_0x06b4('0x6'));var interaction=require(_0x06b4('0x7'));var config=require('../../config/environment');var controller=require(_0x06b4('0x8'));router[_0x06b4('0x9')]('/',auth[_0x06b4('0xa')](),controller[_0x06b4('0xb')]);router[_0x06b4('0x9')](_0x06b4('0xc'),auth[_0x06b4('0xa')](),controller[_0x06b4('0xd')]);router[_0x06b4('0x9')](_0x06b4('0xe'),auth['isAuthenticated'](),controller[_0x06b4('0xf')]);router['get'](_0x06b4('0x10'),auth['isAuthenticated'](),controller[_0x06b4('0x11')]);router[_0x06b4('0x9')](_0x06b4('0x12'),auth[_0x06b4('0xa')](),controller['getDispositions']);router[_0x06b4('0x9')]('/:id/contacts',auth[_0x06b4('0xa')](),controller['getContacts']);router[_0x06b4('0x9')](_0x06b4('0x13'),auth['isAuthenticated'](),controller[_0x06b4('0x14')]);router[_0x06b4('0x9')](_0x06b4('0x15'),auth['isAuthenticated'](),controller['getCustomFields']);router[_0x06b4('0x9')]('/:id/users',auth[_0x06b4('0xa')](),controller['getAgents']);router[_0x06b4('0x16')]('/',auth['isAuthenticated'](),controller['create']);router[_0x06b4('0x16')](_0x06b4('0x12'),auth[_0x06b4('0xa')](),controller[_0x06b4('0x17')]);router['post'](_0x06b4('0x18'),auth['isAuthenticated'](),controller[_0x06b4('0x19')]);router[_0x06b4('0x16')](_0x06b4('0x15'),auth['isAuthenticated'](),controller[_0x06b4('0x1a')]);router[_0x06b4('0x16')](_0x06b4('0x1b'),auth['isAuthenticated'](),controller[_0x06b4('0x1c')]);router[_0x06b4('0x1d')]('/:id',auth[_0x06b4('0xa')](),controller[_0x06b4('0x1e')]);router[_0x06b4('0x1f')]('/:id',auth[_0x06b4('0xa')](),controller[_0x06b4('0x20')]);router[_0x06b4('0x1f')](_0x06b4('0x12'),auth[_0x06b4('0xa')](),controller[_0x06b4('0x21')]);router['delete'](_0x06b4('0x1b'),auth[_0x06b4('0xa')](),controller[_0x06b4('0x22')]);module[_0x06b4('0x23')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 40ae6c1..258d271 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 _0xf665=['sequelize','exports','STRING'];(function(_0x3b2212,_0x551a33){var _0xc490e5=function(_0x40a877){while(--_0x40a877){_0x3b2212['push'](_0x3b2212['shift']());}};_0xc490e5(++_0x551a33);}(_0xf665,0x6c));var _0x5f66=function(_0x5b2155,_0x11bf44){_0x5b2155=_0x5b2155-0x0;var _0x1fd657=_0xf665[_0x5b2155];return _0x1fd657;};'use strict';var Sequelize=require(_0x5f66('0x0'));module[_0x5f66('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x97f372){return this['getDataValue']('field');}},'field':{'type':Sequelize[_0x5f66('0x2')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x5f66('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xc046=['exports','getDataValue','field','STRING','sequelize'];(function(_0x1627ae,_0x2aaa24){var _0x34b38f=function(_0x5c4332){while(--_0x5c4332){_0x1627ae['push'](_0x1627ae['shift']());}};_0x34b38f(++_0x2aaa24);}(_0xc046,0x72));var _0x6c04=function(_0xf53119,_0x19019e){_0xf53119=_0xf53119-0x0;var _0x32ef85=_0xc046[_0xf53119];return _0x32ef85;};'use strict';var Sequelize=require(_0x6c04('0x0'));module[_0x6c04('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x460d17){return this[_0x6c04('0x2')](_0x6c04('0x3'));}},'field':{'type':Sequelize[_0x6c04('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0x6c04('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x6c04('0x4')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index 11dcc6d..09957e8 100644 --- a/server/api/condition/condition.controller.js +++ b/server/api/condition/condition.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x5e7571,_0x1657fa){var _0x302d9a=function(_0x5134e2){while(--_0x5134e2){_0x5e7571['push'](_0x5e7571['shift']());}};_0x302d9a(++_0x1657fa);}(_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 +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(_0x45c324,_0x364178){var _0x865593=function(_0xed6820){while(--_0xed6820){_0x45c324['push'](_0x45c324['shift']());}};_0x865593(++_0x364178);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){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 c48a72d..fb0d662 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 _0x9664=['Condition','tools_conditions','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./condition.attributes','exports'];(function(_0x587fb5,_0x59cb3b){var _0x551105=function(_0x5bbef4){while(--_0x5bbef4){_0x587fb5['push'](_0x587fb5['shift']());}};_0x551105(++_0x59cb3b);}(_0x9664,0xec));var _0x4966=function(_0x175462,_0x339a2f){_0x175462=_0x175462-0x0;var _0x3cf151=_0x9664[_0x175462];return _0x3cf151;};'use strict';var _=require(_0x4966('0x0'));var util=require(_0x4966('0x1'));var logger=require('../../config/logger')(_0x4966('0x2'));var moment=require(_0x4966('0x3'));var BPromise=require(_0x4966('0x4'));var rp=require(_0x4966('0x5'));var fs=require('fs');var path=require(_0x4966('0x6'));var rimraf=require(_0x4966('0x7'));var config=require(_0x4966('0x8'));var attributes=require(_0x4966('0x9'));module[_0x4966('0xa')]=function(_0x281414,_0x53fe01){return _0x281414['define'](_0x4966('0xb'),attributes,{'tableName':_0x4966('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5b3e=['../../config/environment','./condition.attributes','exports','Condition','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0xde5f74,_0xe0e8d7){var _0x2bcf62=function(_0x2c232b){while(--_0x2c232b){_0xde5f74['push'](_0xde5f74['shift']());}};_0x2bcf62(++_0xe0e8d7);}(_0x5b3e,0xa4));var _0xe5b3=function(_0x245d3b,_0x348320){_0x245d3b=_0x245d3b-0x0;var _0x486b89=_0x5b3e[_0x245d3b];return _0x486b89;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe5b3('0x0'))(_0xe5b3('0x1'));var moment=require(_0xe5b3('0x2'));var BPromise=require(_0xe5b3('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe5b3('0x4'));var rimraf=require(_0xe5b3('0x5'));var config=require(_0xe5b3('0x6'));var attributes=require(_0xe5b3('0x7'));module[_0xe5b3('0x8')]=function(_0xb9fdb2,_0x40de7c){return _0xb9fdb2['define'](_0xe5b3('0x9'),attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/condition/condition.rpc.js b/server/api/condition/condition.rpc.js index 68c34c9..f99898c 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 _0xe285=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util'];(function(_0x449660,_0x252d40){var _0x394e63=function(_0x15ab04){while(--_0x15ab04){_0x449660['push'](_0x449660['shift']());}};_0x394e63(++_0x252d40);}(_0xe285,0xae));var _0x5e28=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xe285[_0x1d1779];return _0x2377e9;};'use strict';var _=require(_0x5e28('0x0'));var util=require(_0x5e28('0x1'));var moment=require(_0x5e28('0x2'));var BPromise=require(_0x5e28('0x3'));var rs=require(_0x5e28('0x4'));var fs=require('fs');var Redis=require(_0x5e28('0x5'));var db=require(_0x5e28('0x6'))['db'];var utils=require(_0x5e28('0x7'));var logger=require(_0x5e28('0x8'))(_0x5e28('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5e28('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x17af6b,_0x125eed,_0x25f51a){return new BPromise(function(_0x28a520,_0x5635ea){return client[_0x5e28('0xb')](_0x17af6b,_0x25f51a)[_0x5e28('0xc')](function(_0x197535){logger[_0x5e28('0xd')](_0x5e28('0xe'),_0x125eed,_0x5e28('0xf'));logger[_0x5e28('0x10')]('Condition,\x20%s,\x20%s,\x20%s',_0x125eed,_0x5e28('0xf'),JSON[_0x5e28('0x11')](_0x197535));if(_0x197535[_0x5e28('0x12')]){if(_0x197535['error'][_0x5e28('0x13')]===0x1f4){logger[_0x5e28('0x12')](_0x5e28('0xe'),_0x125eed,_0x197535[_0x5e28('0x12')][_0x5e28('0x14')]);return _0x5635ea(_0x197535['error'][_0x5e28('0x14')]);}logger[_0x5e28('0x12')]('Condition,\x20%s,\x20%s',_0x125eed,_0x197535[_0x5e28('0x12')][_0x5e28('0x14')]);return _0x28a520(_0x197535[_0x5e28('0x12')]['message']);}else{logger[_0x5e28('0xd')]('Condition,\x20%s,\x20%s',_0x125eed,_0x5e28('0xf'));_0x28a520(_0x197535[_0x5e28('0x15')]['message']);}})['catch'](function(_0x270598){logger[_0x5e28('0x12')](_0x5e28('0xe'),_0x125eed,_0x270598);_0x5635ea(_0x270598);});});} \ No newline at end of file +var _0x5db6=['message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','then','info','Condition,\x20%s,\x20%s','debug','Condition,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x26b5ff,_0x709062){var _0x562b55=function(_0x772a84){while(--_0x772a84){_0x26b5ff['push'](_0x26b5ff['shift']());}};_0x562b55(++_0x709062);}(_0x5db6,0x120));var _0x65db=function(_0x189d3c,_0x5efebf){_0x189d3c=_0x189d3c-0x0;var _0x485959=_0x5db6[_0x189d3c];return _0x485959;};'use strict';var _=require(_0x65db('0x0'));var util=require(_0x65db('0x1'));var moment=require('moment');var BPromise=require(_0x65db('0x2'));var rs=require(_0x65db('0x3'));var fs=require('fs');var Redis=require(_0x65db('0x4'));var db=require(_0x65db('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x65db('0x6'))(_0x65db('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x65db('0x8')][_0x65db('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4a1f4a,_0x15f9f3,_0x33fc7c){return new BPromise(function(_0x272034,_0x432c84){return client[_0x65db('0xa')](_0x4a1f4a,_0x33fc7c)[_0x65db('0xb')](function(_0x2dc3c0){logger[_0x65db('0xc')](_0x65db('0xd'),_0x15f9f3,'request\x20sent');logger[_0x65db('0xe')](_0x65db('0xf'),_0x15f9f3,_0x65db('0x10'),JSON[_0x65db('0x11')](_0x2dc3c0));if(_0x2dc3c0[_0x65db('0x12')]){if(_0x2dc3c0['error'][_0x65db('0x13')]===0x1f4){logger[_0x65db('0x12')]('Condition,\x20%s,\x20%s',_0x15f9f3,_0x2dc3c0[_0x65db('0x12')][_0x65db('0x14')]);return _0x432c84(_0x2dc3c0[_0x65db('0x12')][_0x65db('0x14')]);}logger[_0x65db('0x12')](_0x65db('0xd'),_0x15f9f3,_0x2dc3c0[_0x65db('0x12')][_0x65db('0x14')]);return _0x272034(_0x2dc3c0[_0x65db('0x12')][_0x65db('0x14')]);}else{logger['info'](_0x65db('0xd'),_0x15f9f3,_0x65db('0x10'));_0x272034(_0x2dc3c0[_0x65db('0x15')][_0x65db('0x14')]);}})['catch'](function(_0x3aea9a){logger[_0x65db('0x12')]('Condition,\x20%s,\x20%s',_0x15f9f3,_0x3aea9a);_0x432c84(_0x3aea9a);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index ee6cab0..e387e6f 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 _0xd482=['put','isAuthenticated','delete','/:id','destroy','exports','multer','util','Router','../../components/auth/service','../../components/interaction/service','./condition.controller'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xd482,0x156));var _0x2d48=function(_0x5851e7,_0x5e4779){_0x5851e7=_0x5851e7-0x0;var _0x563e83=_0xd482[_0x5851e7];return _0x563e83;};'use strict';var multer=require(_0x2d48('0x0'));var util=require(_0x2d48('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2d48('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x2d48('0x3'));var interaction=require(_0x2d48('0x4'));var config=require('../../config/environment');var controller=require(_0x2d48('0x5'));router[_0x2d48('0x6')]('/:id',auth[_0x2d48('0x7')](),controller['update']);router[_0x2d48('0x8')](_0x2d48('0x9'),auth['isAuthenticated'](),controller[_0x2d48('0xa')]);module[_0x2d48('0xb')]=router; \ No newline at end of file +var _0xc943=['../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','/:id','isAuthenticated','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x4135e7,_0x14f68b){var _0x3032f9=function(_0x2b0e42){while(--_0x2b0e42){_0x4135e7['push'](_0x4135e7['shift']());}};_0x3032f9(++_0x14f68b);}(_0xc943,0x117));var _0x3c94=function(_0x585d09,_0x1274bc){_0x585d09=_0x585d09-0x0;var _0x7d9a14=_0xc943[_0x585d09];return _0x7d9a14;};'use strict';var multer=require(_0x3c94('0x0'));var util=require('util');var path=require(_0x3c94('0x1'));var timeout=require(_0x3c94('0x2'));var express=require(_0x3c94('0x3'));var router=express[_0x3c94('0x4')]();var fs_extra=require(_0x3c94('0x5'));var auth=require(_0x3c94('0x6'));var interaction=require(_0x3c94('0x7'));var config=require(_0x3c94('0x8'));var controller=require(_0x3c94('0x9'));router['put'](_0x3c94('0xa'),auth[_0x3c94('0xb')](),controller[_0x3c94('0xc')]);router[_0x3c94('0xd')](_0x3c94('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x3c94('0xe')]=router; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.attributes.js b/server/api/contactItemType/contactItemType.attributes.js index 1553254..dbe4244 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 _0x6a78=['STRING','name','INTEGER'];(function(_0x5b28ce,_0x4a52db){var _0x4291d6=function(_0x3059b7){while(--_0x3059b7){_0x5b28ce['push'](_0x5b28ce['shift']());}};_0x4291d6(++_0x4a52db);}(_0x6a78,0xea));var _0x86a7=function(_0x367bc,_0x53fd79){_0x367bc=_0x367bc-0x0;var _0x4acd37=_0x6a78[_0x367bc];return _0x4acd37;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x86a7('0x0')],'allowNull':![],'unique':_0x86a7('0x1')},'OrderBy':{'type':Sequelize[_0x86a7('0x2')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x86a7('0x0')],'allowNull':!![]}}; \ No newline at end of file +var _0x09c4=['STRING','name','INTEGER','exports'];(function(_0x155344,_0xf47680){var _0x332721=function(_0x2501f0){while(--_0x2501f0){_0x155344['push'](_0x155344['shift']());}};_0x332721(++_0xf47680);}(_0x09c4,0x137));var _0x409c=function(_0x299784,_0xb0918f){_0x299784=_0x299784-0x0;var _0x5ab008=_0x09c4[_0x299784];return _0x5ab008;};'use strict';var Sequelize=require('sequelize');module[_0x409c('0x0')]={'name':{'type':Sequelize[_0x409c('0x1')],'allowNull':![],'unique':_0x409c('0x2')},'OrderBy':{'type':Sequelize[_0x409c('0x3')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x409c('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.controller.js b/server/api/contactItemType/contactItemType.controller.js index edb7e25..4b065a7 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 _0x8f59=['index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','sort','where','pick','filter','merge','VIRTUAL','options','ContactItemType','includeAll','findAll','show','include','find','catch','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','apply','reject','save','then','destroy','get','ContactItemTypes','end','stack','name','send'];(function(_0x273063,_0x3e4b83){var _0x2f3db2=function(_0x144e7d){while(--_0x144e7d){_0x273063['push'](_0x273063['shift']());}};_0x2f3db2(++_0x3e4b83);}(_0x8f59,0x11d));var _0x98f5=function(_0xa1b8e1,_0x31e781){_0xa1b8e1=_0xa1b8e1-0x0;var _0x16e56c=_0x8f59[_0xa1b8e1];return _0x16e56c;};'use strict';var emlformat=require(_0x98f5('0x0'));var rimraf=require(_0x98f5('0x1'));var zipdir=require(_0x98f5('0x2'));var jsonpatch=require(_0x98f5('0x3'));var rp=require(_0x98f5('0x4'));var moment=require(_0x98f5('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x98f5('0x6'));var util=require(_0x98f5('0x7'));var path=require(_0x98f5('0x8'));var sox=require(_0x98f5('0x9'));var csv=require('to-csv');var ejs=require(_0x98f5('0xa'));var fs=require('fs');var fs_extra=require(_0x98f5('0xb'));var _=require(_0x98f5('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x98f5('0xd'));var deskjs=require(_0x98f5('0xe'));var toCsv=require(_0x98f5('0xf'));var querystring=require('querystring');var Papa=require(_0x98f5('0x10'));var Redis=require(_0x98f5('0x11'));var authService=require(_0x98f5('0x12'));var qs=require(_0x98f5('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x98f5('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x98f5('0x15'));var config=require(_0x98f5('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x98f5('0x17'))['db'];function respondWithStatusCode(_0x259abe,_0x1f00e8){_0x1f00e8=_0x1f00e8||0xcc;return function(_0x160626){if(_0x160626){return _0x259abe[_0x98f5('0x18')](_0x1f00e8);}return _0x259abe[_0x98f5('0x19')](_0x1f00e8)['end']();};}function respondWithResult(_0x24a7a9,_0xbade31){_0xbade31=_0xbade31||0xc8;return function(_0x5b8bab){if(_0x5b8bab){return _0x24a7a9[_0x98f5('0x19')](_0xbade31)[_0x98f5('0x1a')](_0x5b8bab);}};}function respondWithFilteredResult(_0xaa951a,_0x4ae70d){return function(_0x2437e7){if(_0x2437e7){var _0xc7a49b=typeof _0x4ae70d[_0x98f5('0x1b')]==='undefined'&&typeof _0x4ae70d[_0x98f5('0x1c')]===_0x98f5('0x1d');var _0x574644=_0x2437e7[_0x98f5('0x1e')];var _0x51a567=_0xc7a49b?0x0:_0x4ae70d[_0x98f5('0x1b')];var _0x9e42dd=_0xc7a49b?_0x2437e7[_0x98f5('0x1e')]:_0x4ae70d[_0x98f5('0x1b')]+_0x4ae70d[_0x98f5('0x1c')];var _0xa4477c;if(_0x9e42dd>=_0x574644){_0x9e42dd=_0x574644;_0xa4477c=0xc8;}else{_0xa4477c=0xce;}_0xaa951a['status'](_0xa4477c);return _0xaa951a[_0x98f5('0x1f')]('Content-Range',_0x51a567+'-'+_0x9e42dd+'/'+_0x574644)[_0x98f5('0x1a')](_0x2437e7);}return null;};}function patchUpdates(_0x191f23){return function(_0x5deca0){try{jsonpatch[_0x98f5('0x20')](_0x5deca0,_0x191f23,!![]);}catch(_0x2933d1){return BPromise[_0x98f5('0x21')](_0x2933d1);}return _0x5deca0[_0x98f5('0x22')]();};}function saveUpdates(_0x3b2d9d,_0x3dc7c2){return function(_0x38b46d){if(_0x38b46d){return _0x38b46d['update'](_0x3b2d9d)[_0x98f5('0x23')](function(_0x49ee4e){return _0x49ee4e;});}return null;};}function removeEntity(_0xcb10d6,_0x495889){return function(_0x44bfbb){if(_0x44bfbb){return _0x44bfbb[_0x98f5('0x24')]()[_0x98f5('0x23')](function(){var _0x5c64e=_0x44bfbb[_0x98f5('0x25')]({'plain':!![]});var _0x18052d=_0x98f5('0x26');return db['UserProfileResource'][_0x98f5('0x24')]({'where':{'type':_0x18052d,'resourceId':_0x5c64e['id']}})[_0x98f5('0x23')](function(){return _0x44bfbb;});})['then'](function(){_0xcb10d6[_0x98f5('0x19')](0xcc)[_0x98f5('0x27')]();});}};}function handleEntityNotFound(_0x5b08c2,_0x214130){return function(_0x230d1b){if(!_0x230d1b){_0x5b08c2[_0x98f5('0x18')](0x194);}return _0x230d1b;};}function handleError(_0x17dcb2,_0x2b6993){_0x2b6993=_0x2b6993||0x1f4;return function(_0x576c4b){logger['error'](_0x576c4b[_0x98f5('0x28')]);if(_0x576c4b[_0x98f5('0x29')]){delete _0x576c4b[_0x98f5('0x29')];}_0x17dcb2[_0x98f5('0x19')](_0x2b6993)[_0x98f5('0x2a')](_0x576c4b);};}exports[_0x98f5('0x2b')]=function(_0x5e9d73,_0x29e1f5){var _0x6d7418={},_0x7a922b={},_0xd20823={'count':0x0,'rows':[]};var _0x1e7138=_[_0x98f5('0x2c')](db['ContactItemType'][_0x98f5('0x2d')],function(_0x4d4b5c){return{'name':_0x4d4b5c[_0x98f5('0x2e')],'type':_0x4d4b5c[_0x98f5('0x2f')]['key']};});_0x7a922b[_0x98f5('0x30')]=_[_0x98f5('0x2c')](_0x1e7138,_0x98f5('0x29'));_0x7a922b[_0x98f5('0x31')]=_[_0x98f5('0x32')](_0x5e9d73[_0x98f5('0x31')]);_0x7a922b[_0x98f5('0x33')]=_[_0x98f5('0x34')](_0x7a922b[_0x98f5('0x30')],_0x7a922b[_0x98f5('0x31')]);_0x6d7418[_0x98f5('0x35')]=_[_0x98f5('0x34')](_0x7a922b[_0x98f5('0x30')],qs[_0x98f5('0x36')](_0x5e9d73[_0x98f5('0x31')][_0x98f5('0x36')]));_0x6d7418[_0x98f5('0x35')]=_0x6d7418[_0x98f5('0x35')][_0x98f5('0x37')]?_0x6d7418[_0x98f5('0x35')]:_0x7a922b['model'];if(!_0x5e9d73[_0x98f5('0x31')]['hasOwnProperty']('nolimit')){_0x6d7418[_0x98f5('0x1c')]=qs[_0x98f5('0x1c')](_0x5e9d73[_0x98f5('0x31')][_0x98f5('0x1c')]);_0x6d7418['offset']=qs[_0x98f5('0x1b')](_0x5e9d73[_0x98f5('0x31')][_0x98f5('0x1b')]);}_0x6d7418['order']=qs[_0x98f5('0x38')](_0x5e9d73[_0x98f5('0x31')]['sort']);_0x6d7418[_0x98f5('0x39')]=qs[_0x98f5('0x33')](_[_0x98f5('0x3a')](_0x5e9d73['query'],_0x7a922b[_0x98f5('0x33')]),_0x1e7138);if(_0x5e9d73[_0x98f5('0x31')][_0x98f5('0x3b')]){_0x6d7418[_0x98f5('0x39')]=_[_0x98f5('0x3c')](_0x6d7418['where'],{'$or':_['map'](_0x1e7138,function(_0x46cb30){if(_0x46cb30[_0x98f5('0x2f')]!==_0x98f5('0x3d')){var _0x3d7a4f={};_0x3d7a4f[_0x46cb30[_0x98f5('0x29')]]={'$like':'%'+_0x5e9d73[_0x98f5('0x31')]['filter']+'%'};return _0x3d7a4f;}})});}_0x6d7418=_['merge']({},_0x6d7418,_0x5e9d73[_0x98f5('0x3e')]);var _0xd74af2={'where':_0x6d7418[_0x98f5('0x39')]};return db[_0x98f5('0x3f')]['count'](_0xd74af2)['then'](function(_0x2dafcd){_0xd20823[_0x98f5('0x1e')]=_0x2dafcd;if(_0x5e9d73[_0x98f5('0x31')][_0x98f5('0x40')]){_0x6d7418['include']=[{'all':!![]}];}return db['ContactItemType'][_0x98f5('0x41')](_0x6d7418);})[_0x98f5('0x23')](function(_0x372c33){_0xd20823['rows']=_0x372c33;return _0xd20823;})[_0x98f5('0x23')](respondWithFilteredResult(_0x29e1f5,_0x6d7418))['catch'](handleError(_0x29e1f5,null));};exports[_0x98f5('0x42')]=function(_0x4ff7b0,_0x45d732){var _0x166e05={'raw':!![],'where':{'id':_0x4ff7b0['params']['id']}},_0x1b8d40={};_0x1b8d40[_0x98f5('0x30')]=_[_0x98f5('0x32')](db['ContactItemType'][_0x98f5('0x2d')]);_0x1b8d40[_0x98f5('0x31')]=_['keys'](_0x4ff7b0[_0x98f5('0x31')]);_0x1b8d40['filters']=_[_0x98f5('0x34')](_0x1b8d40[_0x98f5('0x30')],_0x1b8d40['query']);_0x166e05['attributes']=_['intersection'](_0x1b8d40['model'],qs[_0x98f5('0x36')](_0x4ff7b0['query'][_0x98f5('0x36')]));_0x166e05[_0x98f5('0x35')]=_0x166e05[_0x98f5('0x35')][_0x98f5('0x37')]?_0x166e05[_0x98f5('0x35')]:_0x1b8d40[_0x98f5('0x30')];if(_0x4ff7b0['query'][_0x98f5('0x40')]){_0x166e05[_0x98f5('0x43')]=[{'all':!![]}];}_0x166e05=_[_0x98f5('0x3c')]({},_0x166e05,_0x4ff7b0[_0x98f5('0x3e')]);return db[_0x98f5('0x3f')][_0x98f5('0x44')](_0x166e05)['then'](handleEntityNotFound(_0x45d732,null))[_0x98f5('0x23')](respondWithResult(_0x45d732,null))[_0x98f5('0x45')](handleError(_0x45d732,null));};exports[_0x98f5('0x46')]=function(_0x1d4b3b,_0x4a0cda){return db[_0x98f5('0x3f')][_0x98f5('0x46')](_0x1d4b3b[_0x98f5('0x47')],{})[_0x98f5('0x23')](function(_0x269861){var _0x4da817=_0x1d4b3b[_0x98f5('0x48')][_0x98f5('0x25')]({'plain':!![]});if(!_0x4da817)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4da817[_0x98f5('0x49')]==='user'){var _0x27ed57=_0x269861['get']({'plain':!![]});var _0x1bd2b9=_0x98f5('0x26');return db[_0x98f5('0x4a')]['find']({'where':{'name':_0x1bd2b9,'userProfileId':_0x4da817[_0x98f5('0x4b')]},'raw':!![]})[_0x98f5('0x23')](function(_0x1503fa){if(_0x1503fa&&_0x1503fa[_0x98f5('0x4c')]===0x0){return db[_0x98f5('0x4d')][_0x98f5('0x46')]({'name':_0x27ed57[_0x98f5('0x29')],'resourceId':_0x27ed57['id'],'type':_0x1503fa[_0x98f5('0x29')],'sectionId':_0x1503fa['id']},{})[_0x98f5('0x23')](function(){return _0x269861;});}else{return _0x269861;}})[_0x98f5('0x45')](function(_0x50343c){logger[_0x98f5('0x4e')](_0x98f5('0x4f'),_0x50343c);throw _0x50343c;});}return _0x269861;})[_0x98f5('0x23')](respondWithResult(_0x4a0cda,0xc9))[_0x98f5('0x45')](handleError(_0x4a0cda,null));};exports[_0x98f5('0x50')]=function(_0x23e955,_0x5c565d){if(_0x23e955[_0x98f5('0x47')]['id']){delete _0x23e955[_0x98f5('0x47')]['id'];}return db[_0x98f5('0x3f')][_0x98f5('0x44')]({'where':{'id':_0x23e955[_0x98f5('0x51')]['id']}})[_0x98f5('0x23')](handleEntityNotFound(_0x5c565d,null))['then'](saveUpdates(_0x23e955['body'],null))['then'](respondWithResult(_0x5c565d,null))[_0x98f5('0x45')](handleError(_0x5c565d,null));};exports[_0x98f5('0x24')]=function(_0x372c49,_0x1c5fb2){return db['ContactItemType'][_0x98f5('0x44')]({'where':{'id':_0x372c49['params']['id']}})[_0x98f5('0x23')](handleEntityNotFound(_0x1c5fb2,null))['then'](db['CmContactHasItem'][_0x98f5('0x50')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x372c49[_0x98f5('0x51')]['id']}}))[_0x98f5('0x23')](removeEntity(_0x1c5fb2,null))['catch'](handleError(_0x1c5fb2,null));}; \ No newline at end of file +var _0x160f=['UserProfileSection','userProfileId','CmContactHasItem','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','map','ContactItemType','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','ContactItemTypes'];(function(_0x4d7408,_0x55051b){var _0x556258=function(_0x55ef5f){while(--_0x55ef5f){_0x4d7408['push'](_0x4d7408['shift']());}};_0x556258(++_0x55051b);}(_0x160f,0x1ef));var _0xf160=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x160f[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xf160('0x0'));var rimraf=require(_0xf160('0x1'));var zipdir=require(_0xf160('0x2'));var jsonpatch=require(_0xf160('0x3'));var rp=require('request-promise');var moment=require(_0xf160('0x4'));var BPromise=require(_0xf160('0x5'));var Mustache=require(_0xf160('0x6'));var util=require(_0xf160('0x7'));var path=require(_0xf160('0x8'));var sox=require(_0xf160('0x9'));var csv=require('to-csv');var ejs=require(_0xf160('0xa'));var fs=require('fs');var fs_extra=require(_0xf160('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xf160('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf160('0xd'));var Papa=require(_0xf160('0xe'));var Redis=require(_0xf160('0xf'));var authService=require(_0xf160('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf160('0x11'));var logger=require(_0xf160('0x12'))(_0xf160('0x13'));var utils=require('../../config/utils');var config=require(_0xf160('0x14'));var licenseUtil=require(_0xf160('0x15'));var db=require(_0xf160('0x16'))['db'];function respondWithStatusCode(_0x3b09ea,_0x2d8854){_0x2d8854=_0x2d8854||0xcc;return function(_0x523af5){if(_0x523af5){return _0x3b09ea[_0xf160('0x17')](_0x2d8854);}return _0x3b09ea['status'](_0x2d8854)[_0xf160('0x18')]();};}function respondWithResult(_0x26951a,_0x12549a){_0x12549a=_0x12549a||0xc8;return function(_0x2bb6c7){if(_0x2bb6c7){return _0x26951a[_0xf160('0x19')](_0x12549a)[_0xf160('0x1a')](_0x2bb6c7);}};}function respondWithFilteredResult(_0x2643ba,_0x172337){return function(_0x1396ba){if(_0x1396ba){var _0x59ac02=typeof _0x172337[_0xf160('0x1b')]===_0xf160('0x1c')&&typeof _0x172337[_0xf160('0x1d')]===_0xf160('0x1c');var _0x51824b=_0x1396ba[_0xf160('0x1e')];var _0x4b8185=_0x59ac02?0x0:_0x172337[_0xf160('0x1b')];var _0x1cf6ba=_0x59ac02?_0x1396ba[_0xf160('0x1e')]:_0x172337[_0xf160('0x1b')]+_0x172337[_0xf160('0x1d')];var _0x205afa;if(_0x1cf6ba>=_0x51824b){_0x1cf6ba=_0x51824b;_0x205afa=0xc8;}else{_0x205afa=0xce;}_0x2643ba[_0xf160('0x19')](_0x205afa);return _0x2643ba[_0xf160('0x1f')](_0xf160('0x20'),_0x4b8185+'-'+_0x1cf6ba+'/'+_0x51824b)['json'](_0x1396ba);}return null;};}function patchUpdates(_0x40ccf0){return function(_0xa20d5a){try{jsonpatch[_0xf160('0x21')](_0xa20d5a,_0x40ccf0,!![]);}catch(_0x5ad173){return BPromise[_0xf160('0x22')](_0x5ad173);}return _0xa20d5a[_0xf160('0x23')]();};}function saveUpdates(_0x454e63,_0x36d0cb){return function(_0x2e03c8){if(_0x2e03c8){return _0x2e03c8[_0xf160('0x24')](_0x454e63)[_0xf160('0x25')](function(_0x5a72d1){return _0x5a72d1;});}return null;};}function removeEntity(_0x3d1f6c,_0x28bf27){return function(_0x305f6a){if(_0x305f6a){return _0x305f6a[_0xf160('0x26')]()['then'](function(){var _0x42458c=_0x305f6a[_0xf160('0x27')]({'plain':!![]});var _0x4a8003='ContactItemTypes';return db[_0xf160('0x28')][_0xf160('0x26')]({'where':{'type':_0x4a8003,'resourceId':_0x42458c['id']}})[_0xf160('0x25')](function(){return _0x305f6a;});})['then'](function(){_0x3d1f6c[_0xf160('0x19')](0xcc)[_0xf160('0x18')]();});}};}function handleEntityNotFound(_0x2851e8,_0x2e2b00){return function(_0x135e0f){if(!_0x135e0f){_0x2851e8[_0xf160('0x17')](0x194);}return _0x135e0f;};}function handleError(_0x5d0cc8,_0x4d7165){_0x4d7165=_0x4d7165||0x1f4;return function(_0x48145e){logger[_0xf160('0x29')](_0x48145e[_0xf160('0x2a')]);if(_0x48145e[_0xf160('0x2b')]){delete _0x48145e[_0xf160('0x2b')];}_0x5d0cc8[_0xf160('0x19')](_0x4d7165)['send'](_0x48145e);};}exports['index']=function(_0x329d6b,_0x558596){var _0x4ce478={},_0x22c2e3={},_0x3a35b3={'count':0x0,'rows':[]};var _0x5497f6=_[_0xf160('0x2c')](db[_0xf160('0x2d')]['rawAttributes'],function(_0x528dff){return{'name':_0x528dff['fieldName'],'type':_0x528dff['type'][_0xf160('0x2e')]};});_0x22c2e3[_0xf160('0x2f')]=_[_0xf160('0x2c')](_0x5497f6,_0xf160('0x2b'));_0x22c2e3[_0xf160('0x30')]=_[_0xf160('0x31')](_0x329d6b['query']);_0x22c2e3['filters']=_['intersection'](_0x22c2e3[_0xf160('0x2f')],_0x22c2e3['query']);_0x4ce478['attributes']=_[_0xf160('0x32')](_0x22c2e3[_0xf160('0x2f')],qs['fields'](_0x329d6b[_0xf160('0x30')][_0xf160('0x33')]));_0x4ce478[_0xf160('0x34')]=_0x4ce478[_0xf160('0x34')][_0xf160('0x35')]?_0x4ce478['attributes']:_0x22c2e3[_0xf160('0x2f')];if(!_0x329d6b[_0xf160('0x30')][_0xf160('0x36')]('nolimit')){_0x4ce478[_0xf160('0x1d')]=qs[_0xf160('0x1d')](_0x329d6b[_0xf160('0x30')][_0xf160('0x1d')]);_0x4ce478[_0xf160('0x1b')]=qs[_0xf160('0x1b')](_0x329d6b['query']['offset']);}_0x4ce478[_0xf160('0x37')]=qs[_0xf160('0x38')](_0x329d6b[_0xf160('0x30')][_0xf160('0x38')]);_0x4ce478[_0xf160('0x39')]=qs[_0xf160('0x3a')](_[_0xf160('0x3b')](_0x329d6b[_0xf160('0x30')],_0x22c2e3[_0xf160('0x3a')]),_0x5497f6);if(_0x329d6b[_0xf160('0x30')][_0xf160('0x3c')]){_0x4ce478[_0xf160('0x39')]=_[_0xf160('0x3d')](_0x4ce478[_0xf160('0x39')],{'$or':_[_0xf160('0x2c')](_0x5497f6,function(_0x256ce7){if(_0x256ce7[_0xf160('0x3e')]!==_0xf160('0x3f')){var _0x43f07f={};_0x43f07f[_0x256ce7[_0xf160('0x2b')]]={'$like':'%'+_0x329d6b[_0xf160('0x30')][_0xf160('0x3c')]+'%'};return _0x43f07f;}})});}_0x4ce478=_[_0xf160('0x3d')]({},_0x4ce478,_0x329d6b[_0xf160('0x40')]);var _0x494d76={'where':_0x4ce478[_0xf160('0x39')]};return db[_0xf160('0x2d')][_0xf160('0x1e')](_0x494d76)[_0xf160('0x25')](function(_0x3d273d){_0x3a35b3[_0xf160('0x1e')]=_0x3d273d;if(_0x329d6b[_0xf160('0x30')]['includeAll']){_0x4ce478[_0xf160('0x41')]=[{'all':!![]}];}return db['ContactItemType'][_0xf160('0x42')](_0x4ce478);})[_0xf160('0x25')](function(_0x530fc5){_0x3a35b3[_0xf160('0x43')]=_0x530fc5;return _0x3a35b3;})[_0xf160('0x25')](respondWithFilteredResult(_0x558596,_0x4ce478))[_0xf160('0x44')](handleError(_0x558596,null));};exports[_0xf160('0x45')]=function(_0x468600,_0x43d243){var _0x1154ed={'raw':!![],'where':{'id':_0x468600[_0xf160('0x46')]['id']}},_0x4f5eba={};_0x4f5eba[_0xf160('0x2f')]=_[_0xf160('0x31')](db[_0xf160('0x2d')][_0xf160('0x47')]);_0x4f5eba[_0xf160('0x30')]=_[_0xf160('0x31')](_0x468600[_0xf160('0x30')]);_0x4f5eba[_0xf160('0x3a')]=_[_0xf160('0x32')](_0x4f5eba[_0xf160('0x2f')],_0x4f5eba['query']);_0x1154ed['attributes']=_[_0xf160('0x32')](_0x4f5eba[_0xf160('0x2f')],qs[_0xf160('0x33')](_0x468600[_0xf160('0x30')][_0xf160('0x33')]));_0x1154ed[_0xf160('0x34')]=_0x1154ed['attributes'][_0xf160('0x35')]?_0x1154ed['attributes']:_0x4f5eba['model'];if(_0x468600[_0xf160('0x30')][_0xf160('0x48')]){_0x1154ed['include']=[{'all':!![]}];}_0x1154ed=_['merge']({},_0x1154ed,_0x468600[_0xf160('0x40')]);return db[_0xf160('0x2d')][_0xf160('0x49')](_0x1154ed)[_0xf160('0x25')](handleEntityNotFound(_0x43d243,null))['then'](respondWithResult(_0x43d243,null))['catch'](handleError(_0x43d243,null));};exports['create']=function(_0x50a97d,_0x406494){return db['ContactItemType'][_0xf160('0x4a')](_0x50a97d[_0xf160('0x4b')],{})[_0xf160('0x25')](function(_0x3bdfdb){var _0x4f2e23=_0x50a97d[_0xf160('0x4c')][_0xf160('0x27')]({'plain':!![]});if(!_0x4f2e23)throw new Error(_0xf160('0x4d'));if(_0x4f2e23['role']===_0xf160('0x4c')){var _0x40f855=_0x3bdfdb[_0xf160('0x27')]({'plain':!![]});var _0x5c3cee=_0xf160('0x4e');return db[_0xf160('0x4f')][_0xf160('0x49')]({'where':{'name':_0x5c3cee,'userProfileId':_0x4f2e23[_0xf160('0x50')]},'raw':!![]})[_0xf160('0x25')](function(_0x5d0fbb){if(_0x5d0fbb&&_0x5d0fbb['autoAssociation']===0x0){return db[_0xf160('0x28')]['create']({'name':_0x40f855[_0xf160('0x2b')],'resourceId':_0x40f855['id'],'type':_0x5d0fbb[_0xf160('0x2b')],'sectionId':_0x5d0fbb['id']},{})['then'](function(){return _0x3bdfdb;});}else{return _0x3bdfdb;}})['catch'](function(_0x321309){logger[_0xf160('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x321309);throw _0x321309;});}return _0x3bdfdb;})[_0xf160('0x25')](respondWithResult(_0x406494,0xc9))[_0xf160('0x44')](handleError(_0x406494,null));};exports[_0xf160('0x24')]=function(_0x405d7e,_0x5f3ded){if(_0x405d7e[_0xf160('0x4b')]['id']){delete _0x405d7e['body']['id'];}return db[_0xf160('0x2d')][_0xf160('0x49')]({'where':{'id':_0x405d7e[_0xf160('0x46')]['id']}})[_0xf160('0x25')](handleEntityNotFound(_0x5f3ded,null))[_0xf160('0x25')](saveUpdates(_0x405d7e['body'],null))[_0xf160('0x25')](respondWithResult(_0x5f3ded,null))['catch'](handleError(_0x5f3ded,null));};exports[_0xf160('0x26')]=function(_0x1229cd,_0x39628d){return db[_0xf160('0x2d')][_0xf160('0x49')]({'where':{'id':_0x1229cd[_0xf160('0x46')]['id']}})[_0xf160('0x25')](handleEntityNotFound(_0x39628d,null))[_0xf160('0x25')](db[_0xf160('0x51')][_0xf160('0x24')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x1229cd['params']['id']}}))['then'](removeEntity(_0x39628d,null))[_0xf160('0x44')](handleError(_0x39628d,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index 6bd405e..436f8ae 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 _0xbc05=['exports','ContactItemType','tools_contact_item_types','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./contactItemType.attributes'];(function(_0x226f3a,_0x16ae82){var _0x5f53a9=function(_0x53ea40){while(--_0x53ea40){_0x226f3a['push'](_0x226f3a['shift']());}};_0x5f53a9(++_0x16ae82);}(_0xbc05,0xab));var _0x5bc0=function(_0x394934,_0x4122ba){_0x394934=_0x394934-0x0;var _0x14c55b=_0xbc05[_0x394934];return _0x14c55b;};'use strict';var _=require(_0x5bc0('0x0'));var util=require(_0x5bc0('0x1'));var logger=require(_0x5bc0('0x2'))(_0x5bc0('0x3'));var moment=require(_0x5bc0('0x4'));var BPromise=require(_0x5bc0('0x5'));var rp=require(_0x5bc0('0x6'));var fs=require('fs');var path=require(_0x5bc0('0x7'));var rimraf=require(_0x5bc0('0x8'));var config=require(_0x5bc0('0x9'));var attributes=require(_0x5bc0('0xa'));module[_0x5bc0('0xb')]=function(_0x4812cd,_0x3a8144){return _0x4812cd['define'](_0x5bc0('0xc'),attributes,{'tableName':_0x5bc0('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7f0b=['bluebird','request-promise','rimraf','./contactItemType.attributes','exports','define','ContactItemType','lodash','util','../../config/logger','api'];(function(_0x13b57e,_0x35c48c){var _0x46b248=function(_0x5397f1){while(--_0x5397f1){_0x13b57e['push'](_0x13b57e['shift']());}};_0x46b248(++_0x35c48c);}(_0x7f0b,0x11a));var _0xb7f0=function(_0x4c7b20,_0x361515){_0x4c7b20=_0x4c7b20-0x0;var _0x4872bd=_0x7f0b[_0x4c7b20];return _0x4872bd;};'use strict';var _=require(_0xb7f0('0x0'));var util=require(_0xb7f0('0x1'));var logger=require(_0xb7f0('0x2'))(_0xb7f0('0x3'));var moment=require('moment');var BPromise=require(_0xb7f0('0x4'));var rp=require(_0xb7f0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb7f0('0x6'));var config=require('../../config/environment');var attributes=require(_0xb7f0('0x7'));module[_0xb7f0('0x8')]=function(_0x1b8d44,_0x547d79){return _0x1b8d44[_0xb7f0('0x9')](_0xb7f0('0xa'),attributes,{'tableName':'tools_contact_item_types','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 59b53d7..7bad9c3 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 _0x0790=['error','message','result','catch','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','ContactItemType,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x478688,_0x46377c){var _0x37158d=function(_0x120d8e){while(--_0x120d8e){_0x478688['push'](_0x478688['shift']());}};_0x37158d(++_0x46377c);}(_0x0790,0xf2));var _0x0079=function(_0x366388,_0x4595a6){_0x366388=_0x366388-0x0;var _0x41c97e=_0x0790[_0x366388];return _0x41c97e;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0079('0x0'));var fs=require('fs');var Redis=require(_0x0079('0x1'));var db=require(_0x0079('0x2'))['db'];var utils=require(_0x0079('0x3'));var logger=require(_0x0079('0x4'))(_0x0079('0x5'));var config=require('../../config/environment');var jayson=require(_0x0079('0x6'));var client=jayson[_0x0079('0x7')][_0x0079('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x504031,_0x40a385,_0x235f01){return new BPromise(function(_0x246e71,_0x1e14d0){return client['request'](_0x504031,_0x235f01)['then'](function(_0x101ff5){logger[_0x0079('0x9')](_0x0079('0xa'),_0x40a385,_0x0079('0xb'));logger['debug']('ContactItemType,\x20%s,\x20%s,\x20%s',_0x40a385,_0x0079('0xb'),JSON[_0x0079('0xc')](_0x101ff5));if(_0x101ff5['error']){if(_0x101ff5[_0x0079('0xd')]['code']===0x1f4){logger[_0x0079('0xd')](_0x0079('0xa'),_0x40a385,_0x101ff5['error']['message']);return _0x1e14d0(_0x101ff5[_0x0079('0xd')][_0x0079('0xe')]);}logger['error']('ContactItemType,\x20%s,\x20%s',_0x40a385,_0x101ff5['error'][_0x0079('0xe')]);return _0x246e71(_0x101ff5[_0x0079('0xd')]['message']);}else{logger[_0x0079('0x9')]('ContactItemType,\x20%s,\x20%s',_0x40a385,_0x0079('0xb'));_0x246e71(_0x101ff5[_0x0079('0xf')][_0x0079('0xe')]);}})[_0x0079('0x10')](function(_0x56a7de){logger[_0x0079('0xd')](_0x0079('0xa'),_0x40a385,_0x56a7de);_0x1e14d0(_0x56a7de);});});} \ No newline at end of file +var _0x851a=['message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','ContactItemType,\x20%s,\x20%s','debug','ContactItemType,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x462142,_0x5bf992){var _0x2b34b8=function(_0x56437f){while(--_0x56437f){_0x462142['push'](_0x462142['shift']());}};_0x2b34b8(++_0x5bf992);}(_0x851a,0x19b));var _0xa851=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x851a[_0x2c7618];return _0x5ce3f0;};'use strict';var _=require(_0xa851('0x0'));var util=require('util');var moment=require(_0xa851('0x1'));var BPromise=require(_0xa851('0x2'));var rs=require(_0xa851('0x3'));var fs=require('fs');var Redis=require(_0xa851('0x4'));var db=require(_0xa851('0x5'))['db'];var utils=require(_0xa851('0x6'));var logger=require(_0xa851('0x7'))(_0xa851('0x8'));var config=require('../../config/environment');var jayson=require(_0xa851('0x9'));var client=jayson['client'][_0xa851('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2fc0e0,_0x2f1f42,_0x551e16){return new BPromise(function(_0x3e1e9d,_0xa2162e){return client[_0xa851('0xb')](_0x2fc0e0,_0x551e16)[_0xa851('0xc')](function(_0x51f1be){logger[_0xa851('0xd')](_0xa851('0xe'),_0x2f1f42,'request\x20sent');logger[_0xa851('0xf')](_0xa851('0x10'),_0x2f1f42,_0xa851('0x11'),JSON[_0xa851('0x12')](_0x51f1be));if(_0x51f1be[_0xa851('0x13')]){if(_0x51f1be[_0xa851('0x13')][_0xa851('0x14')]===0x1f4){logger[_0xa851('0x13')](_0xa851('0xe'),_0x2f1f42,_0x51f1be[_0xa851('0x13')][_0xa851('0x15')]);return _0xa2162e(_0x51f1be[_0xa851('0x13')][_0xa851('0x15')]);}logger[_0xa851('0x13')](_0xa851('0xe'),_0x2f1f42,_0x51f1be[_0xa851('0x13')][_0xa851('0x15')]);return _0x3e1e9d(_0x51f1be[_0xa851('0x13')]['message']);}else{logger[_0xa851('0xd')](_0xa851('0xe'),_0x2f1f42,_0xa851('0x11'));_0x3e1e9d(_0x51f1be[_0xa851('0x16')]['message']);}})[_0xa851('0x17')](function(_0x1f38da){logger[_0xa851('0x13')](_0xa851('0xe'),_0x2f1f42,_0x1f38da);_0xa2162e(_0x1f38da);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index e8673da..41c9ac5 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 _0x0e8f=['./contactItemType.controller','get','index','isAuthenticated','show','post','create','put','update','/:id','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4c6a0b,_0x4b3b43){var _0x874c98=function(_0xd1b6a9){while(--_0xd1b6a9){_0x4c6a0b['push'](_0x4c6a0b['shift']());}};_0x874c98(++_0x4b3b43);}(_0x0e8f,0x187));var _0xf0e8=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x0e8f[_0x36eaaa];return _0x461349;};'use strict';var multer=require(_0xf0e8('0x0'));var util=require(_0xf0e8('0x1'));var path=require(_0xf0e8('0x2'));var timeout=require(_0xf0e8('0x3'));var express=require('express');var router=express[_0xf0e8('0x4')]();var fs_extra=require(_0xf0e8('0x5'));var auth=require(_0xf0e8('0x6'));var interaction=require(_0xf0e8('0x7'));var config=require('../../config/environment');var controller=require(_0xf0e8('0x8'));router[_0xf0e8('0x9')]('/',auth['isAuthenticated'](),controller[_0xf0e8('0xa')]);router['get']('/:id',auth[_0xf0e8('0xb')](),controller[_0xf0e8('0xc')]);router[_0xf0e8('0xd')]('/',auth[_0xf0e8('0xb')](),controller[_0xf0e8('0xe')]);router[_0xf0e8('0xf')]('/:id',auth[_0xf0e8('0xb')](),controller[_0xf0e8('0x10')]);router['delete'](_0xf0e8('0x11'),auth[_0xf0e8('0xb')](),controller[_0xf0e8('0x12')]);module['exports']=router; \ No newline at end of file +var _0x17f5=['util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./contactItemType.controller','get','index','/:id','isAuthenticated','post','create','put','update','delete','exports'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x17f5,0xb4));var _0x517f=function(_0x19e1e1,_0x3ec04b){_0x19e1e1=_0x19e1e1-0x0;var _0x479ee0=_0x17f5[_0x19e1e1];return _0x479ee0;};'use strict';var multer=require('multer');var util=require(_0x517f('0x0'));var path=require(_0x517f('0x1'));var timeout=require(_0x517f('0x2'));var express=require('express');var router=express[_0x517f('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x517f('0x4'));var interaction=require(_0x517f('0x5'));var config=require(_0x517f('0x6'));var controller=require(_0x517f('0x7'));router[_0x517f('0x8')]('/',auth['isAuthenticated'](),controller[_0x517f('0x9')]);router['get'](_0x517f('0xa'),auth[_0x517f('0xb')](),controller['show']);router[_0x517f('0xc')]('/',auth[_0x517f('0xb')](),controller[_0x517f('0xd')]);router[_0x517f('0xe')](_0x517f('0xa'),auth[_0x517f('0xb')](),controller[_0x517f('0xf')]);router[_0x517f('0x10')](_0x517f('0xa'),auth[_0x517f('0xb')](),controller['destroy']);module[_0x517f('0x11')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 215ba13..8cd4d55 100644 --- a/server/api/dashboard/dashboard.attributes.js +++ b/server/api/dashboard/dashboard.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['name','sequelize','STRING'];(function(_0xf9ec76,_0x35e34a){var _0xd5756f=function(_0x547433){while(--_0x547433){_0xf9ec76['push'](_0xf9ec76['shift']());}};_0xd5756f(++_0x35e34a);}(_0xb10b,0x12a));var _0xbb10=function(_0x2adaa9,_0x298fc0){_0x2adaa9=_0x2adaa9-0x0;var _0x2a3124=_0xb10b[_0x2adaa9];return _0x2a3124;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2')},'description':{'type':Sequelize[_0xbb10('0x1')]}}; \ No newline at end of file +var _0xbaf0=['name','exports','STRING'];(function(_0x403cff,_0x1cf463){var _0x5a7c56=function(_0x1bab9d){while(--_0x1bab9d){_0x403cff['push'](_0x403cff['shift']());}};_0x5a7c56(++_0x1cf463);}(_0xbaf0,0x12a));var _0x0baf=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xbaf0[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'name':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![],'unique':_0x0baf('0x2')},'description':{'type':Sequelize[_0x0baf('0x1')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 757037d..d4d67a8 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 _0x6a4c=['sendStatus','json','undefined','limit','count','offset','status','set','Content-Range','reject','save','update','then','destroy','get','CustomDashboards','UserProfileResource','end','error','name','send','index','map','Dashboard','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where','filter','merge','options','rows','catch','show','params','includeAll','include','create','body','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','user','role','autoAssociation','iframe','attrUrl','attrs','value','https://','custom','attrPath','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrVoiceQueues','web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','pick','nolimit','getItems','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./dashboard.socket'];(function(_0x10c8d2,_0x23e0d4){var _0x521419=function(_0x25bc55){while(--_0x25bc55){_0x10c8d2['push'](_0x10c8d2['shift']());}};_0x521419(++_0x23e0d4);}(_0x6a4c,0x161));var _0xc6a4=function(_0x2a3132,_0x496219){_0x2a3132=_0x2a3132-0x0;var _0x5c5602=_0x6a4c[_0x2a3132];return _0x5c5602;};'use strict';var emlformat=require(_0xc6a4('0x0'));var rimraf=require(_0xc6a4('0x1'));var zipdir=require(_0xc6a4('0x2'));var jsonpatch=require(_0xc6a4('0x3'));var rp=require(_0xc6a4('0x4'));var moment=require(_0xc6a4('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc6a4('0x6'));var util=require(_0xc6a4('0x7'));var path=require(_0xc6a4('0x8'));var sox=require('sox');var csv=require(_0xc6a4('0x9'));var ejs=require(_0xc6a4('0xa'));var fs=require('fs');var fs_extra=require(_0xc6a4('0xb'));var _=require('lodash');var squel=require(_0xc6a4('0xc'));var crypto=require(_0xc6a4('0xd'));var jsforce=require(_0xc6a4('0xe'));var deskjs=require(_0xc6a4('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc6a4('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc6a4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc6a4('0x12'))(_0xc6a4('0x13'));var utils=require(_0xc6a4('0x14'));var config=require(_0xc6a4('0x15'));var licenseUtil=require(_0xc6a4('0x16'));var db=require('../../mysqldb')['db'];config[_0xc6a4('0x17')]=_[_0xc6a4('0x18')](config[_0xc6a4('0x17')],{'host':_0xc6a4('0x19'),'port':0x18eb});var socket=require(_0xc6a4('0x1a'))(new Redis(config[_0xc6a4('0x17')]));require(_0xc6a4('0x1b'))['register'](socket);function respondWithStatusCode(_0x429890,_0x10a794){_0x10a794=_0x10a794||0xcc;return function(_0x48e20c){if(_0x48e20c){return _0x429890[_0xc6a4('0x1c')](_0x10a794);}return _0x429890['status'](_0x10a794)['end']();};}function respondWithResult(_0x5d9ed4,_0x512f68){_0x512f68=_0x512f68||0xc8;return function(_0x49e3aa){if(_0x49e3aa){return _0x5d9ed4['status'](_0x512f68)[_0xc6a4('0x1d')](_0x49e3aa);}};}function respondWithFilteredResult(_0x3b3d87,_0x233b30){return function(_0x18ea57){if(_0x18ea57){var _0x676881=typeof _0x233b30['offset']===_0xc6a4('0x1e')&&typeof _0x233b30[_0xc6a4('0x1f')]==='undefined';var _0x332198=_0x18ea57[_0xc6a4('0x20')];var _0x1b7a42=_0x676881?0x0:_0x233b30[_0xc6a4('0x21')];var _0x435ec9=_0x676881?_0x18ea57[_0xc6a4('0x20')]:_0x233b30[_0xc6a4('0x21')]+_0x233b30[_0xc6a4('0x1f')];var _0xffb362;if(_0x435ec9>=_0x332198){_0x435ec9=_0x332198;_0xffb362=0xc8;}else{_0xffb362=0xce;}_0x3b3d87[_0xc6a4('0x22')](_0xffb362);return _0x3b3d87[_0xc6a4('0x23')](_0xc6a4('0x24'),_0x1b7a42+'-'+_0x435ec9+'/'+_0x332198)[_0xc6a4('0x1d')](_0x18ea57);}return null;};}function patchUpdates(_0x184499){return function(_0x2ac546){try{jsonpatch['apply'](_0x2ac546,_0x184499,!![]);}catch(_0x566364){return BPromise[_0xc6a4('0x25')](_0x566364);}return _0x2ac546[_0xc6a4('0x26')]();};}function saveUpdates(_0x29eefa,_0x1af55c){return function(_0x21d687){if(_0x21d687){return _0x21d687[_0xc6a4('0x27')](_0x29eefa)[_0xc6a4('0x28')](function(_0x2a9276){return _0x2a9276;});}return null;};}function removeEntity(_0x264ed7,_0x5c12ae){return function(_0x205c8a){if(_0x205c8a){return _0x205c8a[_0xc6a4('0x29')]()[_0xc6a4('0x28')](function(){var _0x5a9d85=_0x205c8a[_0xc6a4('0x2a')]({'plain':!![]});var _0x3b39da=_0xc6a4('0x2b');return db[_0xc6a4('0x2c')]['destroy']({'where':{'type':_0x3b39da,'resourceId':_0x5a9d85['id']}})[_0xc6a4('0x28')](function(){return _0x205c8a;});})['then'](function(){_0x264ed7['status'](0xcc)[_0xc6a4('0x2d')]();});}};}function handleEntityNotFound(_0x1e294c,_0x36e8b6){return function(_0x1b5f1c){if(!_0x1b5f1c){_0x1e294c['sendStatus'](0x194);}return _0x1b5f1c;};}function handleError(_0x5294c7,_0x188e48){_0x188e48=_0x188e48||0x1f4;return function(_0x5d2d9b){logger[_0xc6a4('0x2e')](_0x5d2d9b['stack']);if(_0x5d2d9b[_0xc6a4('0x2f')]){delete _0x5d2d9b[_0xc6a4('0x2f')];}_0x5294c7[_0xc6a4('0x22')](_0x188e48)[_0xc6a4('0x30')](_0x5d2d9b);};}exports[_0xc6a4('0x31')]=function(_0x29a95a,_0x4b8a26){var _0x1eeef7={},_0xf6bf7c={},_0x4151a6={'count':0x0,'rows':[]};var _0x44b3c8=_[_0xc6a4('0x32')](db[_0xc6a4('0x33')][_0xc6a4('0x34')],function(_0x37e4ab){return{'name':_0x37e4ab[_0xc6a4('0x35')],'type':_0x37e4ab[_0xc6a4('0x36')][_0xc6a4('0x37')]};});_0xf6bf7c['model']=_[_0xc6a4('0x32')](_0x44b3c8,_0xc6a4('0x2f'));_0xf6bf7c[_0xc6a4('0x38')]=_[_0xc6a4('0x39')](_0x29a95a[_0xc6a4('0x38')]);_0xf6bf7c[_0xc6a4('0x3a')]=_[_0xc6a4('0x3b')](_0xf6bf7c['model'],_0xf6bf7c[_0xc6a4('0x38')]);_0x1eeef7[_0xc6a4('0x3c')]=_[_0xc6a4('0x3b')](_0xf6bf7c[_0xc6a4('0x3d')],qs['fields'](_0x29a95a[_0xc6a4('0x38')][_0xc6a4('0x3e')]));_0x1eeef7['attributes']=_0x1eeef7[_0xc6a4('0x3c')][_0xc6a4('0x3f')]?_0x1eeef7[_0xc6a4('0x3c')]:_0xf6bf7c[_0xc6a4('0x3d')];if(!_0x29a95a[_0xc6a4('0x38')][_0xc6a4('0x40')]('nolimit')){_0x1eeef7[_0xc6a4('0x1f')]=qs[_0xc6a4('0x1f')](_0x29a95a[_0xc6a4('0x38')][_0xc6a4('0x1f')]);_0x1eeef7['offset']=qs['offset'](_0x29a95a[_0xc6a4('0x38')][_0xc6a4('0x21')]);}_0x1eeef7[_0xc6a4('0x41')]=qs['sort'](_0x29a95a[_0xc6a4('0x38')][_0xc6a4('0x42')]);_0x1eeef7[_0xc6a4('0x43')]=qs[_0xc6a4('0x3a')](_['pick'](_0x29a95a['query'],_0xf6bf7c[_0xc6a4('0x3a')]),_0x44b3c8);if(_0x29a95a['query'][_0xc6a4('0x44')]){_0x1eeef7[_0xc6a4('0x43')]=_[_0xc6a4('0x45')](_0x1eeef7[_0xc6a4('0x43')],{'$or':_[_0xc6a4('0x32')](_0x44b3c8,function(_0x2cb73e){if(_0x2cb73e[_0xc6a4('0x36')]!=='VIRTUAL'){var _0x443546={};_0x443546[_0x2cb73e[_0xc6a4('0x2f')]]={'$like':'%'+_0x29a95a['query'][_0xc6a4('0x44')]+'%'};return _0x443546;}})});}_0x1eeef7=_[_0xc6a4('0x45')]({},_0x1eeef7,_0x29a95a[_0xc6a4('0x46')]);var _0x150acf={'where':_0x1eeef7[_0xc6a4('0x43')]};return db[_0xc6a4('0x33')]['count'](_0x150acf)[_0xc6a4('0x28')](function(_0x53e3ff){_0x4151a6[_0xc6a4('0x20')]=_0x53e3ff;if(_0x29a95a[_0xc6a4('0x38')]['includeAll']){_0x1eeef7['include']=[{'all':!![]}];}return db['Dashboard']['findAll'](_0x1eeef7);})['then'](function(_0x42ab57){_0x4151a6[_0xc6a4('0x47')]=_0x42ab57;return _0x4151a6;})['then'](respondWithFilteredResult(_0x4b8a26,_0x1eeef7))[_0xc6a4('0x48')](handleError(_0x4b8a26,null));};exports[_0xc6a4('0x49')]=function(_0xe9941a,_0x472521){var _0x5e8eaa={'raw':![],'where':{'id':_0xe9941a[_0xc6a4('0x4a')]['id']}},_0x2f6cd6={};_0x2f6cd6[_0xc6a4('0x3d')]=_['keys'](db['Dashboard'][_0xc6a4('0x34')]);_0x2f6cd6[_0xc6a4('0x38')]=_[_0xc6a4('0x39')](_0xe9941a[_0xc6a4('0x38')]);_0x2f6cd6['filters']=_[_0xc6a4('0x3b')](_0x2f6cd6[_0xc6a4('0x3d')],_0x2f6cd6[_0xc6a4('0x38')]);_0x5e8eaa[_0xc6a4('0x3c')]=_[_0xc6a4('0x3b')](_0x2f6cd6['model'],qs[_0xc6a4('0x3e')](_0xe9941a['query'][_0xc6a4('0x3e')]));_0x5e8eaa[_0xc6a4('0x3c')]=_0x5e8eaa['attributes'][_0xc6a4('0x3f')]?_0x5e8eaa[_0xc6a4('0x3c')]:_0x2f6cd6['model'];if(_0xe9941a[_0xc6a4('0x38')][_0xc6a4('0x4b')]){_0x5e8eaa[_0xc6a4('0x4c')]=[{'all':!![]}];}_0x5e8eaa=_['merge']({},_0x5e8eaa,_0xe9941a['options']);return db['Dashboard']['find'](_0x5e8eaa)[_0xc6a4('0x28')](handleEntityNotFound(_0x472521,null))['then'](respondWithResult(_0x472521,null))[_0xc6a4('0x48')](handleError(_0x472521,null));};exports[_0xc6a4('0x4d')]=function(_0x50e4fa,_0x1df563){return db[_0xc6a4('0x33')][_0xc6a4('0x4d')](_0x50e4fa[_0xc6a4('0x4e')],{})[_0xc6a4('0x28')](function(_0x597206){var _0x8e6a95=_0x50e4fa['user'][_0xc6a4('0x2a')]({'plain':!![]});if(!_0x8e6a95)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x8e6a95['role']==='user'){var _0x220dae=_0x597206[_0xc6a4('0x2a')]({'plain':!![]});var _0x4d485d=_0xc6a4('0x2b');return db[_0xc6a4('0x4f')][_0xc6a4('0x50')]({'where':{'name':_0x4d485d,'userProfileId':_0x8e6a95[_0xc6a4('0x51')]},'raw':!![]})[_0xc6a4('0x28')](function(_0x474c97){if(_0x474c97&&_0x474c97['autoAssociation']===0x0){return db[_0xc6a4('0x2c')]['create']({'name':_0x220dae[_0xc6a4('0x2f')],'resourceId':_0x220dae['id'],'type':_0x474c97[_0xc6a4('0x2f')],'sectionId':_0x474c97['id']},{})['then'](function(){return _0x597206;});}else{return _0x597206;}})[_0xc6a4('0x48')](function(_0x14cd58){logger[_0xc6a4('0x2e')](_0xc6a4('0x52'),_0x14cd58);throw _0x14cd58;});}return _0x597206;})[_0xc6a4('0x28')](respondWithResult(_0x1df563,0xc9))['catch'](handleError(_0x1df563,null));};exports[_0xc6a4('0x53')]=function(_0x268b92,_0x4f3c08){var _0x3c3038={'where':{'id':_0x268b92[_0xc6a4('0x4a')]['id']}},_0x44dcf9={};_0x44dcf9['model']=_[_0xc6a4('0x39')](db[_0xc6a4('0x33')][_0xc6a4('0x34')]);_0x3c3038[_0xc6a4('0x3c')]=_[_0xc6a4('0x3b')](_0x44dcf9['model'],qs[_0xc6a4('0x3e')](_0x268b92['query'][_0xc6a4('0x3e')]));_0x3c3038[_0xc6a4('0x3c')]=_0x3c3038[_0xc6a4('0x3c')][_0xc6a4('0x3f')]?_0x3c3038[_0xc6a4('0x3c')]:_0x44dcf9[_0xc6a4('0x3d')];if(_0x268b92[_0xc6a4('0x38')][_0xc6a4('0x4b')]){_0x3c3038['include']=[{'all':!![]}];}_0x3c3038=_[_0xc6a4('0x45')]({},_0x3c3038,_0x268b92['options']);return db[_0xc6a4('0x33')][_0xc6a4('0x50')](_0x3c3038)['then'](handleEntityNotFound(_0x4f3c08,null))[_0xc6a4('0x28')](function(_0x56254b){if(_0x56254b){var _0x1a3ab0=_0x56254b['get']({'plain':!![]});_0x1a3ab0=qs[_0xc6a4('0x54')](_0x1a3ab0,['id',_0xc6a4('0x55'),_0xc6a4('0x56')]);_0x268b92['body']=_[_0xc6a4('0x54')](_0x268b92[_0xc6a4('0x4e')],['id','createdAt','updatedAt']);return db['Dashboard'][_0xc6a4('0x4d')](_['merge'](_0x1a3ab0,_0x268b92[_0xc6a4('0x4e')]),{'include':_0x268b92[_0xc6a4('0x38')][_0xc6a4('0x4b')]?[{'all':!![]}]:undefined})[_0xc6a4('0x28')](function(_0x338743){var _0x1d8e68=_0x268b92[_0xc6a4('0x57')][_0xc6a4('0x2a')]({'plain':!![]});if(!_0x1d8e68)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1d8e68[_0xc6a4('0x58')]===_0xc6a4('0x57')){var _0x26420a=_0x338743[_0xc6a4('0x2a')]({'plain':!![]});var _0x6aa430='CustomDashboards';return db[_0xc6a4('0x4f')][_0xc6a4('0x50')]({'where':{'name':_0x6aa430,'userProfileId':_0x1d8e68[_0xc6a4('0x51')]},'raw':!![]})[_0xc6a4('0x28')](function(_0x42f9f7){if(_0x42f9f7&&_0x42f9f7[_0xc6a4('0x59')]===0x0){return db[_0xc6a4('0x2c')][_0xc6a4('0x4d')]({'name':_0x26420a[_0xc6a4('0x2f')],'resourceId':_0x26420a['id'],'type':_0x42f9f7[_0xc6a4('0x2f')],'sectionId':_0x42f9f7['id']},{})[_0xc6a4('0x28')](function(){return _0x338743;});}else{return _0x338743;}})[_0xc6a4('0x48')](function(_0x33ee53){logger[_0xc6a4('0x2e')](_0xc6a4('0x52'),_0x33ee53);throw _0x33ee53;});}return _0x338743;});}})[_0xc6a4('0x28')](respondWithResult(_0x4f3c08,0xc9))[_0xc6a4('0x48')](handleError(_0x4f3c08,null));};exports[_0xc6a4('0x27')]=function(_0x200122,_0x42e376){if(_0x200122[_0xc6a4('0x4e')]['id']){delete _0x200122[_0xc6a4('0x4e')]['id'];}return db[_0xc6a4('0x33')][_0xc6a4('0x50')]({'where':{'id':_0x200122['params']['id']}})['then'](handleEntityNotFound(_0x42e376,null))[_0xc6a4('0x28')](saveUpdates(_0x200122[_0xc6a4('0x4e')],null))[_0xc6a4('0x28')](respondWithResult(_0x42e376,null))[_0xc6a4('0x48')](handleError(_0x42e376,null));};exports[_0xc6a4('0x29')]=function(_0x213784,_0x331219){return db[_0xc6a4('0x33')][_0xc6a4('0x50')]({'where':{'id':_0x213784[_0xc6a4('0x4a')]['id']}})[_0xc6a4('0x28')](handleEntityNotFound(_0x331219,null))[_0xc6a4('0x28')](removeEntity(_0x331219,null))['catch'](handleError(_0x331219,null));};function widgetAttributes(_0x260f27){try{switch(_0x260f27[_0xc6a4('0x36')]){case _0xc6a4('0x5a'):return[{'name':_0xc6a4('0x5b'),'value':_0x260f27[_0xc6a4('0x5b')]||(_0x260f27[_0xc6a4('0x5c')]&&_0x260f27[_0xc6a4('0x5c')][0x0]?_0x260f27['attrs'][0x0][_0xc6a4('0x5d')]:undefined)||_0xc6a4('0x5e')}];case _0xc6a4('0x5f'):return[{'name':_0xc6a4('0x60'),'value':_0x260f27[_0xc6a4('0x60')]||(_0x260f27[_0xc6a4('0x5c')]&&_0x260f27[_0xc6a4('0x5c')][0x0]?_0x260f27[_0xc6a4('0x5c')][0x0][_0xc6a4('0x5d')]:undefined)||''}];case'clock':return[{'name':_0xc6a4('0x61'),'value':_0x260f27[_0xc6a4('0x61')]||(_0x260f27[_0xc6a4('0x5c')]&&_0x260f27[_0xc6a4('0x5c')][0x0]?_0x260f27[_0xc6a4('0x5c')][0x0][_0xc6a4('0x5d')]:undefined)||'HH:mm:ss'},{'name':'attrTimezone','value':_0x260f27[_0xc6a4('0x62')]||(_0x260f27['attrs']&&_0x260f27[_0xc6a4('0x5c')][0x1]?_0x260f27[_0xc6a4('0x5c')][0x1]['value']:undefined)||_0xc6a4('0x63')},{'name':'attrFontSize','value':_0x260f27[_0xc6a4('0x64')]||(_0x260f27['attrs']&&_0x260f27[_0xc6a4('0x5c')][0x2]?_0x260f27['attrs'][0x2][_0xc6a4('0x5d')]:undefined)||0xc}];case _0xc6a4('0x65'):return[{'name':_0xc6a4('0x66'),'value':_0x260f27[_0xc6a4('0x66')]||(_0x260f27['attrs']&&_0x260f27[_0xc6a4('0x5c')][0x0]?_0x260f27[_0xc6a4('0x5c')][0x0][_0xc6a4('0x5d')]:undefined)||'total'},{'name':'attrVoiceQueues','value':_0x260f27['attrVoiceQueues']||(_0x260f27['attrs']&&_0x260f27[_0xc6a4('0x5c')][0x1]?_0x260f27['attrs'][0x1][_0xc6a4('0x5d')]:undefined)||[]},{'name':_0xc6a4('0x64'),'value':_0x260f27[_0xc6a4('0x64')]||(_0x260f27[_0xc6a4('0x5c')]&&_0x260f27[_0xc6a4('0x5c')][0x2]?_0x260f27[_0xc6a4('0x5c')][0x2][_0xc6a4('0x5d')]:undefined)||0x14},{'name':_0xc6a4('0x67'),'value':_0x260f27[_0xc6a4('0x67')]||(_0x260f27[_0xc6a4('0x5c')]&&_0x260f27[_0xc6a4('0x5c')][0x3]?_0x260f27[_0xc6a4('0x5c')][0x3][_0xc6a4('0x5d')]:undefined)||_0xc6a4('0x68')},{'name':_0xc6a4('0x69'),'value':_0x260f27['attrEmailAccounts']||(_0x260f27[_0xc6a4('0x5c')]&&_0x260f27[_0xc6a4('0x5c')][0x4]?_0x260f27[_0xc6a4('0x5c')][0x4][_0xc6a4('0x5d')]:undefined)||''},{'name':_0xc6a4('0x6a'),'value':_0x260f27[_0xc6a4('0x6a')]||(_0x260f27['attrs']&&_0x260f27[_0xc6a4('0x5c')][0x5]?_0x260f27[_0xc6a4('0x5c')][0x5][_0xc6a4('0x5d')]:undefined)||''},{'name':_0xc6a4('0x6b'),'value':_0x260f27['attrSmsAccounts']||(_0x260f27['attrs']&&_0x260f27[_0xc6a4('0x5c')][0x6]?_0x260f27[_0xc6a4('0x5c')][0x6][_0xc6a4('0x5d')]:undefined)||''},{'name':_0xc6a4('0x6c'),'value':_0x260f27[_0xc6a4('0x6c')]||(_0x260f27[_0xc6a4('0x5c')]&&_0x260f27[_0xc6a4('0x5c')][0x7]?_0x260f27[_0xc6a4('0x5c')][0x7][_0xc6a4('0x5d')]:undefined)||''},{'name':_0xc6a4('0x6d'),'value':_0x260f27['attrWhatsappAccounts']||(_0x260f27[_0xc6a4('0x5c')]&&_0x260f27[_0xc6a4('0x5c')][0x8]?_0x260f27[_0xc6a4('0x5c')][0x8]['value']:undefined)||''},{'name':_0xc6a4('0x6e'),'value':_0x260f27['attrChatWebsites']||(_0x260f27['attrs']&&_0x260f27[_0xc6a4('0x5c')][0x9]?_0x260f27[_0xc6a4('0x5c')][0x9][_0xc6a4('0x5d')]:undefined)||''}];case'multibar-chart':case _0xc6a4('0x6f'):return[{'name':_0xc6a4('0x70'),'value':_0x260f27[_0xc6a4('0x70')]||(_0x260f27[_0xc6a4('0x5c')]&&_0x260f27['attrs'][0x0]?_0x260f27[_0xc6a4('0x5c')][0x0][_0xc6a4('0x5d')]:undefined)||'total'},{'name':_0xc6a4('0x71'),'value':_0x260f27[_0xc6a4('0x71')]||(_0x260f27['attrs']&&_0x260f27['attrs'][0x1]?_0x260f27[_0xc6a4('0x5c')][0x1][_0xc6a4('0x5d')]:undefined)||null},{'name':_0xc6a4('0x72'),'value':_0x260f27[_0xc6a4('0x72')]||(_0x260f27[_0xc6a4('0x5c')]&&_0x260f27['attrs'][0x2]?_0x260f27[_0xc6a4('0x5c')][0x2][_0xc6a4('0x5d')]:undefined)||null},{'name':_0xc6a4('0x73'),'value':_0x260f27[_0xc6a4('0x73')]||(_0x260f27[_0xc6a4('0x5c')]&&_0x260f27[_0xc6a4('0x5c')][0x3]?_0x260f27[_0xc6a4('0x5c')][0x3][_0xc6a4('0x5d')]:undefined)||[]},{'name':'attrChannel','value':_0x260f27[_0xc6a4('0x67')]||(_0x260f27['attrs']&&_0x260f27[_0xc6a4('0x5c')][0x4]?_0x260f27[_0xc6a4('0x5c')][0x4][_0xc6a4('0x5d')]:undefined)||_0xc6a4('0x68')},{'name':'attrEmailAccounts','value':_0x260f27[_0xc6a4('0x69')]||(_0x260f27[_0xc6a4('0x5c')]&&_0x260f27[_0xc6a4('0x5c')][0x5]?_0x260f27['attrs'][0x5][_0xc6a4('0x5d')]:undefined)||''},{'name':_0xc6a4('0x6a'),'value':_0x260f27[_0xc6a4('0x6a')]||(_0x260f27['attrs']&&_0x260f27[_0xc6a4('0x5c')][0x6]?_0x260f27[_0xc6a4('0x5c')][0x6][_0xc6a4('0x5d')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x260f27['attrSmsAccounts']||(_0x260f27['attrs']&&_0x260f27[_0xc6a4('0x5c')][0x7]?_0x260f27[_0xc6a4('0x5c')][0x7]['value']:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x260f27[_0xc6a4('0x6c')]||(_0x260f27[_0xc6a4('0x5c')]&&_0x260f27['attrs'][0x8]?_0x260f27[_0xc6a4('0x5c')][0x8][_0xc6a4('0x5d')]:undefined)||''},{'name':_0xc6a4('0x6d'),'value':_0x260f27[_0xc6a4('0x6d')]||(_0x260f27[_0xc6a4('0x5c')]&&_0x260f27['attrs'][0x9]?_0x260f27['attrs'][0x9][_0xc6a4('0x5d')]:undefined)||''},{'name':_0xc6a4('0x6e'),'value':_0x260f27[_0xc6a4('0x6e')]||(_0x260f27[_0xc6a4('0x5c')]&&_0x260f27['attrs'][0xa]?_0x260f27[_0xc6a4('0x5c')][0xa][_0xc6a4('0x5d')]:undefined)||''}];case _0xc6a4('0x74'):return[{'name':_0xc6a4('0x75'),'type':_0x260f27['reportType']||(_0x260f27[_0xc6a4('0x5c')]&&_0x260f27['attrs'][0x0]?_0x260f27[_0xc6a4('0x5c')][0x0]['type']:undefined)||null,'value':_0x260f27[_0xc6a4('0x75')]||(_0x260f27['attrs']&&_0x260f27['attrs'][0x0]?_0x260f27[_0xc6a4('0x5c')][0x0]['value']:undefined)||null},{'name':_0xc6a4('0x76'),'value':_0x260f27[_0xc6a4('0x76')]||(_0x260f27['attrs']&&_0x260f27[_0xc6a4('0x5c')][0x1]?_0x260f27[_0xc6a4('0x5c')][0x1][_0xc6a4('0x5d')]:undefined)||0x0}];default:return[];}}catch(_0x15261c){logger['error'](_0xc6a4('0x77'),JSON[_0xc6a4('0x78')](_0x15261c));return[];}}exports[_0xc6a4('0x79')]=function(_0x3aedf9,_0x276e15,_0x5ebd43){if(_0x3aedf9[_0xc6a4('0x4e')]['id']){delete _0x3aedf9[_0xc6a4('0x4e')]['id'];}return db[_0xc6a4('0x33')][_0xc6a4('0x50')]({'where':{'id':_0x3aedf9[_0xc6a4('0x4a')]['id']}})[_0xc6a4('0x28')](handleEntityNotFound(_0x276e15,null))['then'](function(_0x309af2){if(_0x309af2){_0x3aedf9[_0xc6a4('0x4e')][_0xc6a4('0x7a')]=_0x309af2['id'];_0x3aedf9[_0xc6a4('0x4e')][_0xc6a4('0x5c')]=widgetAttributes(_0x3aedf9[_0xc6a4('0x4e')]);return db[_0xc6a4('0x7b')]['create'](_0x3aedf9[_0xc6a4('0x4e')]);}})[_0xc6a4('0x28')](respondWithResult(_0x276e15,null))['catch'](handleError(_0x276e15,null));};exports['getItems']=function(_0x343a6b,_0xa7a88e,_0xc3a24a){var _0x129799={};var _0x4e664a={};var _0x4e6cc1;var _0x3a346b;return db[_0xc6a4('0x33')]['findOne']({'where':{'id':_0x343a6b[_0xc6a4('0x4a')]['id']}})[_0xc6a4('0x28')](handleEntityNotFound(_0xa7a88e,null))[_0xc6a4('0x28')](function(_0x54938e){if(_0x54938e){_0x4e6cc1=_0x54938e;_0x4e664a['model']=_[_0xc6a4('0x39')](db[_0xc6a4('0x7b')][_0xc6a4('0x34')]);_0x4e664a[_0xc6a4('0x38')]=_['keys'](_0x343a6b['query']);_0x4e664a['filters']=_[_0xc6a4('0x3b')](_0x4e664a[_0xc6a4('0x3d')],_0x4e664a[_0xc6a4('0x38')]);_0x129799[_0xc6a4('0x3c')]=_[_0xc6a4('0x3b')](_0x4e664a[_0xc6a4('0x3d')],qs['fields'](_0x343a6b['query'][_0xc6a4('0x3e')]));_0x129799[_0xc6a4('0x3c')]=_0x129799[_0xc6a4('0x3c')][_0xc6a4('0x3f')]?_0x129799[_0xc6a4('0x3c')]:_0x4e664a[_0xc6a4('0x3d')];_0x129799['order']=qs['sort'](_0x343a6b[_0xc6a4('0x38')][_0xc6a4('0x42')]);_0x129799[_0xc6a4('0x43')]=qs[_0xc6a4('0x3a')](_[_0xc6a4('0x7c')](_0x343a6b[_0xc6a4('0x38')],_0x4e664a['filters']));if(_0x343a6b[_0xc6a4('0x38')][_0xc6a4('0x44')]){_0x129799['where']=_[_0xc6a4('0x45')](_0x129799['where'],{'$or':_[_0xc6a4('0x32')](_0x129799['attributes'],function(_0x46f1cd){var _0x257537={};_0x257537[_0x46f1cd]={'$like':'%'+_0x343a6b[_0xc6a4('0x38')][_0xc6a4('0x44')]+'%'};return _0x257537;})});}_0x129799=_['merge']({},_0x129799,_0x343a6b[_0xc6a4('0x46')]);return _0x4e6cc1['getItems'](_0x129799);}})['then'](function(_0x2fe675){if(_0x2fe675){_0x3a346b=_0x2fe675[_0xc6a4('0x3f')];if(!_0x343a6b[_0xc6a4('0x38')][_0xc6a4('0x40')](_0xc6a4('0x7d'))){_0x129799[_0xc6a4('0x1f')]=qs[_0xc6a4('0x1f')](_0x343a6b[_0xc6a4('0x38')][_0xc6a4('0x1f')]);_0x129799[_0xc6a4('0x21')]=qs['offset'](_0x343a6b['query'][_0xc6a4('0x21')]);}return _0x4e6cc1[_0xc6a4('0x7e')](_0x129799);}})[_0xc6a4('0x28')](function(_0x4c4fa9){if(_0x4c4fa9){return _0x4c4fa9?{'count':_0x3a346b,'rows':_0x4c4fa9}:null;}})[_0xc6a4('0x28')](respondWithResult(_0xa7a88e,null))['catch'](handleError(_0xa7a88e,null));}; \ No newline at end of file +var _0x1860=['model','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','merge','find','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','create','createdAt','updatedAt','omit','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','iframe','attrUrl','attrs','https://','custom','attrPath','value','clock','attrHourFormat','attrTimezone','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','multibar-chart','attrSerie1','attrSerie2','attrSerie3','attrChatWebsites','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','addItem','DashboardId','DashboardItem','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','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','../../config/license/util','localhost','socket.io-emitter','redis','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','CustomDashboards','then','stack','name','send','index','Dashboard','rawAttributes','fieldName','type','key','map','filters','intersection','query','attributes','fields','length'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0x1860,0xc4));var _0x0186=function(_0x5e0817,_0x40b4d2){_0x5e0817=_0x5e0817-0x0;var _0x3374b9=_0x1860[_0x5e0817];return _0x3374b9;};'use strict';var emlformat=require(_0x0186('0x0'));var rimraf=require(_0x0186('0x1'));var zipdir=require(_0x0186('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0186('0x3'));var moment=require(_0x0186('0x4'));var BPromise=require(_0x0186('0x5'));var Mustache=require(_0x0186('0x6'));var util=require('util');var path=require(_0x0186('0x7'));var sox=require(_0x0186('0x8'));var csv=require(_0x0186('0x9'));var ejs=require(_0x0186('0xa'));var fs=require('fs');var fs_extra=require(_0x0186('0xb'));var _=require(_0x0186('0xc'));var squel=require(_0x0186('0xd'));var crypto=require(_0x0186('0xe'));var jsforce=require(_0x0186('0xf'));var deskjs=require(_0x0186('0x10'));var toCsv=require(_0x0186('0x9'));var querystring=require(_0x0186('0x11'));var Papa=require(_0x0186('0x12'));var Redis=require(_0x0186('0x13'));var authService=require(_0x0186('0x14'));var qs=require(_0x0186('0x15'));var as=require(_0x0186('0x16'));var hardwareService=require(_0x0186('0x17'));var logger=require(_0x0186('0x18'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0186('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x0186('0x1a'),'port':0x18eb});var socket=require(_0x0186('0x1b'))(new Redis(config[_0x0186('0x1c')]));require('./dashboard.socket')[_0x0186('0x1d')](socket);function respondWithStatusCode(_0x2e074a,_0x3312e0){_0x3312e0=_0x3312e0||0xcc;return function(_0xb04961){if(_0xb04961){return _0x2e074a[_0x0186('0x1e')](_0x3312e0);}return _0x2e074a[_0x0186('0x1f')](_0x3312e0)[_0x0186('0x20')]();};}function respondWithResult(_0x1efd6e,_0x20ea8a){_0x20ea8a=_0x20ea8a||0xc8;return function(_0x4c406b){if(_0x4c406b){return _0x1efd6e[_0x0186('0x1f')](_0x20ea8a)[_0x0186('0x21')](_0x4c406b);}};}function respondWithFilteredResult(_0x17c391,_0x2e02d2){return function(_0x52af45){if(_0x52af45){var _0x3b2f32=typeof _0x2e02d2[_0x0186('0x22')]===_0x0186('0x23')&&typeof _0x2e02d2[_0x0186('0x24')]===_0x0186('0x23');var _0x481218=_0x52af45[_0x0186('0x25')];var _0x23842d=_0x3b2f32?0x0:_0x2e02d2['offset'];var _0x6e6ab6=_0x3b2f32?_0x52af45[_0x0186('0x25')]:_0x2e02d2['offset']+_0x2e02d2['limit'];var _0x3b41e0;if(_0x6e6ab6>=_0x481218){_0x6e6ab6=_0x481218;_0x3b41e0=0xc8;}else{_0x3b41e0=0xce;}_0x17c391[_0x0186('0x1f')](_0x3b41e0);return _0x17c391[_0x0186('0x26')](_0x0186('0x27'),_0x23842d+'-'+_0x6e6ab6+'/'+_0x481218)[_0x0186('0x21')](_0x52af45);}return null;};}function patchUpdates(_0x57c7b6){return function(_0x5d864a){try{jsonpatch[_0x0186('0x28')](_0x5d864a,_0x57c7b6,!![]);}catch(_0xa3650e){return BPromise['reject'](_0xa3650e);}return _0x5d864a[_0x0186('0x29')]();};}function saveUpdates(_0x57b924,_0x320fc7){return function(_0x3afb20){if(_0x3afb20){return _0x3afb20[_0x0186('0x2a')](_0x57b924)['then'](function(_0x42ac0b){return _0x42ac0b;});}return null;};}function removeEntity(_0x116fac,_0x3cdb86){return function(_0x1de334){if(_0x1de334){return _0x1de334[_0x0186('0x2b')]()['then'](function(){var _0x568fd1=_0x1de334['get']({'plain':!![]});var _0x47e77c=_0x0186('0x2c');return db['UserProfileResource']['destroy']({'where':{'type':_0x47e77c,'resourceId':_0x568fd1['id']}})[_0x0186('0x2d')](function(){return _0x1de334;});})['then'](function(){_0x116fac[_0x0186('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x245a8d,_0x274d0b){return function(_0xb9e993){if(!_0xb9e993){_0x245a8d['sendStatus'](0x194);}return _0xb9e993;};}function handleError(_0x14ce45,_0x522453){_0x522453=_0x522453||0x1f4;return function(_0x44f9a2){logger['error'](_0x44f9a2[_0x0186('0x2e')]);if(_0x44f9a2[_0x0186('0x2f')]){delete _0x44f9a2['name'];}_0x14ce45['status'](_0x522453)[_0x0186('0x30')](_0x44f9a2);};}exports[_0x0186('0x31')]=function(_0x3823c6,_0xaced04){var _0x5273de={},_0x321375={},_0x566ecb={'count':0x0,'rows':[]};var _0x127c3d=_['map'](db[_0x0186('0x32')][_0x0186('0x33')],function(_0x3c5b6b){return{'name':_0x3c5b6b[_0x0186('0x34')],'type':_0x3c5b6b[_0x0186('0x35')][_0x0186('0x36')]};});_0x321375['model']=_[_0x0186('0x37')](_0x127c3d,_0x0186('0x2f'));_0x321375['query']=_['keys'](_0x3823c6['query']);_0x321375[_0x0186('0x38')]=_[_0x0186('0x39')](_0x321375['model'],_0x321375[_0x0186('0x3a')]);_0x5273de[_0x0186('0x3b')]=_[_0x0186('0x39')](_0x321375['model'],qs[_0x0186('0x3c')](_0x3823c6[_0x0186('0x3a')]['fields']));_0x5273de['attributes']=_0x5273de[_0x0186('0x3b')][_0x0186('0x3d')]?_0x5273de[_0x0186('0x3b')]:_0x321375[_0x0186('0x3e')];if(!_0x3823c6['query'][_0x0186('0x3f')](_0x0186('0x40'))){_0x5273de[_0x0186('0x24')]=qs[_0x0186('0x24')](_0x3823c6[_0x0186('0x3a')][_0x0186('0x24')]);_0x5273de[_0x0186('0x22')]=qs[_0x0186('0x22')](_0x3823c6[_0x0186('0x3a')][_0x0186('0x22')]);}_0x5273de[_0x0186('0x41')]=qs[_0x0186('0x42')](_0x3823c6[_0x0186('0x3a')]['sort']);_0x5273de[_0x0186('0x43')]=qs[_0x0186('0x38')](_[_0x0186('0x44')](_0x3823c6[_0x0186('0x3a')],_0x321375[_0x0186('0x38')]),_0x127c3d);if(_0x3823c6[_0x0186('0x3a')][_0x0186('0x45')]){_0x5273de[_0x0186('0x43')]=_['merge'](_0x5273de['where'],{'$or':_[_0x0186('0x37')](_0x127c3d,function(_0x51104b){if(_0x51104b[_0x0186('0x35')]!==_0x0186('0x46')){var _0xb6ccc7={};_0xb6ccc7[_0x51104b[_0x0186('0x2f')]]={'$like':'%'+_0x3823c6[_0x0186('0x3a')][_0x0186('0x45')]+'%'};return _0xb6ccc7;}})});}_0x5273de=_['merge']({},_0x5273de,_0x3823c6[_0x0186('0x47')]);var _0x367fec={'where':_0x5273de[_0x0186('0x43')]};return db['Dashboard'][_0x0186('0x25')](_0x367fec)[_0x0186('0x2d')](function(_0x6c31c5){_0x566ecb[_0x0186('0x25')]=_0x6c31c5;if(_0x3823c6[_0x0186('0x3a')][_0x0186('0x48')]){_0x5273de[_0x0186('0x49')]=[{'all':!![]}];}return db[_0x0186('0x32')][_0x0186('0x4a')](_0x5273de);})[_0x0186('0x2d')](function(_0x45a492){_0x566ecb[_0x0186('0x4b')]=_0x45a492;return _0x566ecb;})['then'](respondWithFilteredResult(_0xaced04,_0x5273de))[_0x0186('0x4c')](handleError(_0xaced04,null));};exports[_0x0186('0x4d')]=function(_0xa1e25f,_0x226175){var _0x3e97f8={'raw':![],'where':{'id':_0xa1e25f[_0x0186('0x4e')]['id']}},_0x3c8297={};_0x3c8297[_0x0186('0x3e')]=_[_0x0186('0x4f')](db[_0x0186('0x32')][_0x0186('0x33')]);_0x3c8297[_0x0186('0x3a')]=_['keys'](_0xa1e25f[_0x0186('0x3a')]);_0x3c8297[_0x0186('0x38')]=_['intersection'](_0x3c8297[_0x0186('0x3e')],_0x3c8297['query']);_0x3e97f8[_0x0186('0x3b')]=_['intersection'](_0x3c8297[_0x0186('0x3e')],qs['fields'](_0xa1e25f[_0x0186('0x3a')][_0x0186('0x3c')]));_0x3e97f8[_0x0186('0x3b')]=_0x3e97f8['attributes'][_0x0186('0x3d')]?_0x3e97f8['attributes']:_0x3c8297[_0x0186('0x3e')];if(_0xa1e25f['query']['includeAll']){_0x3e97f8['include']=[{'all':!![]}];}_0x3e97f8=_[_0x0186('0x50')]({},_0x3e97f8,_0xa1e25f[_0x0186('0x47')]);return db[_0x0186('0x32')][_0x0186('0x51')](_0x3e97f8)['then'](handleEntityNotFound(_0x226175,null))[_0x0186('0x2d')](respondWithResult(_0x226175,null))[_0x0186('0x4c')](handleError(_0x226175,null));};exports['create']=function(_0x5af7d8,_0x580ee4){return db[_0x0186('0x32')]['create'](_0x5af7d8[_0x0186('0x52')],{})[_0x0186('0x2d')](function(_0x5a4275){var _0x188f7e=_0x5af7d8[_0x0186('0x53')][_0x0186('0x54')]({'plain':!![]});if(!_0x188f7e)throw new Error(_0x0186('0x55'));if(_0x188f7e[_0x0186('0x56')]===_0x0186('0x53')){var _0x2e3694=_0x5a4275[_0x0186('0x54')]({'plain':!![]});var _0xa9020e=_0x0186('0x2c');return db[_0x0186('0x57')][_0x0186('0x51')]({'where':{'name':_0xa9020e,'userProfileId':_0x188f7e['userProfileId']},'raw':!![]})['then'](function(_0xac8e0c){if(_0xac8e0c&&_0xac8e0c[_0x0186('0x58')]===0x0){return db[_0x0186('0x59')][_0x0186('0x5a')]({'name':_0x2e3694[_0x0186('0x2f')],'resourceId':_0x2e3694['id'],'type':_0xac8e0c['name'],'sectionId':_0xac8e0c['id']},{})['then'](function(){return _0x5a4275;});}else{return _0x5a4275;}})[_0x0186('0x4c')](function(_0x46023e){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x46023e);throw _0x46023e;});}return _0x5a4275;})[_0x0186('0x2d')](respondWithResult(_0x580ee4,0xc9))[_0x0186('0x4c')](handleError(_0x580ee4,null));};exports['clone']=function(_0x350daa,_0x199539){var _0x5dcf69={'where':{'id':_0x350daa['params']['id']}},_0x109eeb={};_0x109eeb['model']=_['keys'](db[_0x0186('0x32')][_0x0186('0x33')]);_0x5dcf69[_0x0186('0x3b')]=_[_0x0186('0x39')](_0x109eeb[_0x0186('0x3e')],qs['fields'](_0x350daa[_0x0186('0x3a')][_0x0186('0x3c')]));_0x5dcf69[_0x0186('0x3b')]=_0x5dcf69[_0x0186('0x3b')][_0x0186('0x3d')]?_0x5dcf69[_0x0186('0x3b')]:_0x109eeb['model'];if(_0x350daa[_0x0186('0x3a')][_0x0186('0x48')]){_0x5dcf69['include']=[{'all':!![]}];}_0x5dcf69=_[_0x0186('0x50')]({},_0x5dcf69,_0x350daa[_0x0186('0x47')]);return db[_0x0186('0x32')]['find'](_0x5dcf69)['then'](handleEntityNotFound(_0x199539,null))[_0x0186('0x2d')](function(_0x3a5d00){if(_0x3a5d00){var _0x28e38f=_0x3a5d00[_0x0186('0x54')]({'plain':!![]});_0x28e38f=qs['omit'](_0x28e38f,['id',_0x0186('0x5b'),_0x0186('0x5c')]);_0x350daa[_0x0186('0x52')]=_[_0x0186('0x5d')](_0x350daa[_0x0186('0x52')],['id',_0x0186('0x5b'),_0x0186('0x5c')]);return db[_0x0186('0x32')][_0x0186('0x5a')](_['merge'](_0x28e38f,_0x350daa[_0x0186('0x52')]),{'include':_0x350daa[_0x0186('0x3a')][_0x0186('0x48')]?[{'all':!![]}]:undefined})[_0x0186('0x2d')](function(_0x2ba7db){var _0x4f194e=_0x350daa['user']['get']({'plain':!![]});if(!_0x4f194e)throw new Error(_0x0186('0x55'));if(_0x4f194e[_0x0186('0x56')]==='user'){var _0x1fe900=_0x2ba7db['get']({'plain':!![]});var _0x437f20=_0x0186('0x2c');return db[_0x0186('0x57')][_0x0186('0x51')]({'where':{'name':_0x437f20,'userProfileId':_0x4f194e[_0x0186('0x5e')]},'raw':!![]})['then'](function(_0x48b09b){if(_0x48b09b&&_0x48b09b[_0x0186('0x58')]===0x0){return db['UserProfileResource'][_0x0186('0x5a')]({'name':_0x1fe900[_0x0186('0x2f')],'resourceId':_0x1fe900['id'],'type':_0x48b09b[_0x0186('0x2f')],'sectionId':_0x48b09b['id']},{})[_0x0186('0x2d')](function(){return _0x2ba7db;});}else{return _0x2ba7db;}})[_0x0186('0x4c')](function(_0x255b39){logger[_0x0186('0x5f')](_0x0186('0x60'),_0x255b39);throw _0x255b39;});}return _0x2ba7db;});}})[_0x0186('0x2d')](respondWithResult(_0x199539,0xc9))[_0x0186('0x4c')](handleError(_0x199539,null));};exports['update']=function(_0x50d146,_0x5c1adc){if(_0x50d146[_0x0186('0x52')]['id']){delete _0x50d146[_0x0186('0x52')]['id'];}return db[_0x0186('0x32')][_0x0186('0x51')]({'where':{'id':_0x50d146[_0x0186('0x4e')]['id']}})[_0x0186('0x2d')](handleEntityNotFound(_0x5c1adc,null))[_0x0186('0x2d')](saveUpdates(_0x50d146[_0x0186('0x52')],null))['then'](respondWithResult(_0x5c1adc,null))[_0x0186('0x4c')](handleError(_0x5c1adc,null));};exports[_0x0186('0x2b')]=function(_0x55f60e,_0x461be0){return db[_0x0186('0x32')][_0x0186('0x51')]({'where':{'id':_0x55f60e[_0x0186('0x4e')]['id']}})['then'](handleEntityNotFound(_0x461be0,null))[_0x0186('0x2d')](removeEntity(_0x461be0,null))[_0x0186('0x4c')](handleError(_0x461be0,null));};function widgetAttributes(_0x1c9797){try{switch(_0x1c9797[_0x0186('0x35')]){case _0x0186('0x61'):return[{'name':_0x0186('0x62'),'value':_0x1c9797[_0x0186('0x62')]||(_0x1c9797[_0x0186('0x63')]&&_0x1c9797[_0x0186('0x63')][0x0]?_0x1c9797[_0x0186('0x63')][0x0]['value']:undefined)||_0x0186('0x64')}];case _0x0186('0x65'):return[{'name':_0x0186('0x66'),'value':_0x1c9797['attrPath']||(_0x1c9797[_0x0186('0x63')]&&_0x1c9797[_0x0186('0x63')][0x0]?_0x1c9797['attrs'][0x0][_0x0186('0x67')]:undefined)||''}];case _0x0186('0x68'):return[{'name':_0x0186('0x69'),'value':_0x1c9797[_0x0186('0x69')]||(_0x1c9797[_0x0186('0x63')]&&_0x1c9797[_0x0186('0x63')][0x0]?_0x1c9797['attrs'][0x0][_0x0186('0x67')]:undefined)||'HH:mm:ss'},{'name':_0x0186('0x6a'),'value':_0x1c9797[_0x0186('0x6a')]||(_0x1c9797[_0x0186('0x63')]&&_0x1c9797['attrs'][0x1]?_0x1c9797[_0x0186('0x63')][0x1]['value']:undefined)||'0.00'},{'name':'attrFontSize','value':_0x1c9797[_0x0186('0x6b')]||(_0x1c9797[_0x0186('0x63')]&&_0x1c9797[_0x0186('0x63')][0x2]?_0x1c9797[_0x0186('0x63')][0x2][_0x0186('0x67')]:undefined)||0xc}];case _0x0186('0x6c'):return[{'name':_0x0186('0x6d'),'value':_0x1c9797[_0x0186('0x6d')]||(_0x1c9797[_0x0186('0x63')]&&_0x1c9797[_0x0186('0x63')][0x0]?_0x1c9797['attrs'][0x0][_0x0186('0x67')]:undefined)||_0x0186('0x6e')},{'name':'attrVoiceQueues','value':_0x1c9797[_0x0186('0x6f')]||(_0x1c9797[_0x0186('0x63')]&&_0x1c9797['attrs'][0x1]?_0x1c9797[_0x0186('0x63')][0x1][_0x0186('0x67')]:undefined)||[]},{'name':_0x0186('0x6b'),'value':_0x1c9797['attrFontSize']||(_0x1c9797[_0x0186('0x63')]&&_0x1c9797[_0x0186('0x63')][0x2]?_0x1c9797[_0x0186('0x63')][0x2]['value']:undefined)||0x14},{'name':'attrChannel','value':_0x1c9797['attrChannel']||(_0x1c9797[_0x0186('0x63')]&&_0x1c9797['attrs'][0x3]?_0x1c9797[_0x0186('0x63')][0x3][_0x0186('0x67')]:undefined)||'voice'},{'name':_0x0186('0x70'),'value':_0x1c9797[_0x0186('0x70')]||(_0x1c9797['attrs']&&_0x1c9797[_0x0186('0x63')][0x4]?_0x1c9797['attrs'][0x4][_0x0186('0x67')]:undefined)||''},{'name':_0x0186('0x71'),'value':_0x1c9797[_0x0186('0x71')]||(_0x1c9797[_0x0186('0x63')]&&_0x1c9797[_0x0186('0x63')][0x5]?_0x1c9797[_0x0186('0x63')][0x5][_0x0186('0x67')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x1c9797[_0x0186('0x72')]||(_0x1c9797[_0x0186('0x63')]&&_0x1c9797[_0x0186('0x63')][0x6]?_0x1c9797[_0x0186('0x63')][0x6]['value']:undefined)||''},{'name':_0x0186('0x73'),'value':_0x1c9797[_0x0186('0x73')]||(_0x1c9797['attrs']&&_0x1c9797[_0x0186('0x63')][0x7]?_0x1c9797['attrs'][0x7][_0x0186('0x67')]:undefined)||''},{'name':_0x0186('0x74'),'value':_0x1c9797[_0x0186('0x74')]||(_0x1c9797['attrs']&&_0x1c9797[_0x0186('0x63')][0x8]?_0x1c9797[_0x0186('0x63')][0x8]['value']:undefined)||''},{'name':'attrChatWebsites','value':_0x1c9797['attrChatWebsites']||(_0x1c9797['attrs']&&_0x1c9797['attrs'][0x9]?_0x1c9797['attrs'][0x9][_0x0186('0x67')]:undefined)||''}];case _0x0186('0x75'):case'pie-chart':return[{'name':_0x0186('0x76'),'value':_0x1c9797[_0x0186('0x76')]||(_0x1c9797[_0x0186('0x63')]&&_0x1c9797[_0x0186('0x63')][0x0]?_0x1c9797[_0x0186('0x63')][0x0][_0x0186('0x67')]:undefined)||_0x0186('0x6e')},{'name':'attrSerie2','value':_0x1c9797[_0x0186('0x77')]||(_0x1c9797[_0x0186('0x63')]&&_0x1c9797[_0x0186('0x63')][0x1]?_0x1c9797[_0x0186('0x63')][0x1][_0x0186('0x67')]:undefined)||null},{'name':'attrSerie3','value':_0x1c9797[_0x0186('0x78')]||(_0x1c9797[_0x0186('0x63')]&&_0x1c9797[_0x0186('0x63')][0x2]?_0x1c9797[_0x0186('0x63')][0x2][_0x0186('0x67')]:undefined)||null},{'name':_0x0186('0x6f'),'value':_0x1c9797[_0x0186('0x6f')]||(_0x1c9797['attrs']&&_0x1c9797['attrs'][0x3]?_0x1c9797['attrs'][0x3][_0x0186('0x67')]:undefined)||[]},{'name':'attrChannel','value':_0x1c9797['attrChannel']||(_0x1c9797[_0x0186('0x63')]&&_0x1c9797[_0x0186('0x63')][0x4]?_0x1c9797[_0x0186('0x63')][0x4][_0x0186('0x67')]:undefined)||'voice'},{'name':'attrEmailAccounts','value':_0x1c9797[_0x0186('0x70')]||(_0x1c9797['attrs']&&_0x1c9797['attrs'][0x5]?_0x1c9797[_0x0186('0x63')][0x5][_0x0186('0x67')]:undefined)||''},{'name':_0x0186('0x71'),'value':_0x1c9797['attrFaxAccounts']||(_0x1c9797[_0x0186('0x63')]&&_0x1c9797[_0x0186('0x63')][0x6]?_0x1c9797[_0x0186('0x63')][0x6][_0x0186('0x67')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x1c9797['attrSmsAccounts']||(_0x1c9797[_0x0186('0x63')]&&_0x1c9797[_0x0186('0x63')][0x7]?_0x1c9797[_0x0186('0x63')][0x7]['value']:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x1c9797[_0x0186('0x73')]||(_0x1c9797[_0x0186('0x63')]&&_0x1c9797[_0x0186('0x63')][0x8]?_0x1c9797['attrs'][0x8]['value']:undefined)||''},{'name':_0x0186('0x74'),'value':_0x1c9797[_0x0186('0x74')]||(_0x1c9797[_0x0186('0x63')]&&_0x1c9797[_0x0186('0x63')][0x9]?_0x1c9797['attrs'][0x9][_0x0186('0x67')]:undefined)||''},{'name':'attrChatWebsites','value':_0x1c9797[_0x0186('0x79')]||(_0x1c9797['attrs']&&_0x1c9797['attrs'][0xa]?_0x1c9797[_0x0186('0x63')][0xa][_0x0186('0x67')]:undefined)||''}];case'web-report':return[{'name':_0x0186('0x7a'),'type':_0x1c9797[_0x0186('0x7b')]||(_0x1c9797['attrs']&&_0x1c9797[_0x0186('0x63')][0x0]?_0x1c9797[_0x0186('0x63')][0x0][_0x0186('0x35')]:undefined)||null,'value':_0x1c9797[_0x0186('0x7a')]||(_0x1c9797[_0x0186('0x63')]&&_0x1c9797['attrs'][0x0]?_0x1c9797[_0x0186('0x63')][0x0][_0x0186('0x67')]:undefined)||null},{'name':_0x0186('0x7c'),'value':_0x1c9797[_0x0186('0x7c')]||(_0x1c9797[_0x0186('0x63')]&&_0x1c9797[_0x0186('0x63')][0x1]?_0x1c9797[_0x0186('0x63')][0x1][_0x0186('0x67')]:undefined)||0x0}];default:return[];}}catch(_0x35c854){logger[_0x0186('0x5f')](_0x0186('0x7d'),JSON['stringify'](_0x35c854));return[];}}exports[_0x0186('0x7e')]=function(_0x30473d,_0x44dbae,_0x459423){if(_0x30473d[_0x0186('0x52')]['id']){delete _0x30473d[_0x0186('0x52')]['id'];}return db['Dashboard'][_0x0186('0x51')]({'where':{'id':_0x30473d[_0x0186('0x4e')]['id']}})[_0x0186('0x2d')](handleEntityNotFound(_0x44dbae,null))[_0x0186('0x2d')](function(_0x4fd1de){if(_0x4fd1de){_0x30473d[_0x0186('0x52')][_0x0186('0x7f')]=_0x4fd1de['id'];_0x30473d[_0x0186('0x52')][_0x0186('0x63')]=widgetAttributes(_0x30473d['body']);return db[_0x0186('0x80')][_0x0186('0x5a')](_0x30473d[_0x0186('0x52')]);}})[_0x0186('0x2d')](respondWithResult(_0x44dbae,null))['catch'](handleError(_0x44dbae,null));};exports['getItems']=function(_0x5b08c6,_0x4d8949,_0x6cbac3){var _0x43e506={};var _0x9c1d9b={};var _0xa34205;var _0xe87f00;return db[_0x0186('0x32')]['findOne']({'where':{'id':_0x5b08c6[_0x0186('0x4e')]['id']}})[_0x0186('0x2d')](handleEntityNotFound(_0x4d8949,null))['then'](function(_0x298f40){if(_0x298f40){_0xa34205=_0x298f40;_0x9c1d9b[_0x0186('0x3e')]=_[_0x0186('0x4f')](db[_0x0186('0x80')][_0x0186('0x33')]);_0x9c1d9b[_0x0186('0x3a')]=_[_0x0186('0x4f')](_0x5b08c6[_0x0186('0x3a')]);_0x9c1d9b[_0x0186('0x38')]=_[_0x0186('0x39')](_0x9c1d9b[_0x0186('0x3e')],_0x9c1d9b['query']);_0x43e506[_0x0186('0x3b')]=_[_0x0186('0x39')](_0x9c1d9b[_0x0186('0x3e')],qs[_0x0186('0x3c')](_0x5b08c6[_0x0186('0x3a')][_0x0186('0x3c')]));_0x43e506['attributes']=_0x43e506['attributes'][_0x0186('0x3d')]?_0x43e506[_0x0186('0x3b')]:_0x9c1d9b['model'];_0x43e506[_0x0186('0x41')]=qs[_0x0186('0x42')](_0x5b08c6[_0x0186('0x3a')][_0x0186('0x42')]);_0x43e506[_0x0186('0x43')]=qs['filters'](_[_0x0186('0x44')](_0x5b08c6[_0x0186('0x3a')],_0x9c1d9b[_0x0186('0x38')]));if(_0x5b08c6['query'][_0x0186('0x45')]){_0x43e506[_0x0186('0x43')]=_[_0x0186('0x50')](_0x43e506[_0x0186('0x43')],{'$or':_[_0x0186('0x37')](_0x43e506[_0x0186('0x3b')],function(_0x2e11b5){var _0x499afa={};_0x499afa[_0x2e11b5]={'$like':'%'+_0x5b08c6[_0x0186('0x3a')][_0x0186('0x45')]+'%'};return _0x499afa;})});}_0x43e506=_[_0x0186('0x50')]({},_0x43e506,_0x5b08c6[_0x0186('0x47')]);return _0xa34205['getItems'](_0x43e506);}})[_0x0186('0x2d')](function(_0x245cd2){if(_0x245cd2){_0xe87f00=_0x245cd2[_0x0186('0x3d')];if(!_0x5b08c6[_0x0186('0x3a')][_0x0186('0x3f')](_0x0186('0x40'))){_0x43e506['limit']=qs[_0x0186('0x24')](_0x5b08c6['query'][_0x0186('0x24')]);_0x43e506[_0x0186('0x22')]=qs[_0x0186('0x22')](_0x5b08c6[_0x0186('0x3a')][_0x0186('0x22')]);}return _0xa34205['getItems'](_0x43e506);}})[_0x0186('0x2d')](function(_0x48487e){if(_0x48487e){return _0x48487e?{'count':_0xe87f00,'rows':_0x48487e}:null;}})['then'](respondWithResult(_0x4d8949,null))[_0x0186('0x4c')](handleError(_0x4d8949,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 0f858b6..5aefd8c 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 _0xa90b=['remove','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','save','update'];(function(_0x2493f7,_0x49c670){var _0x594ab2=function(_0x344ec2){while(--_0x344ec2){_0x2493f7['push'](_0x2493f7['shift']());}};_0x594ab2(++_0x49c670);}(_0xa90b,0x10c));var _0xba90=function(_0x54defc,_0x627178){_0x54defc=_0x54defc-0x0;var _0x1955d3=_0xa90b[_0x54defc];return _0x1955d3;};'use strict';var EventEmitter=require('events');var Dashboard=require(_0xba90('0x0'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0xba90('0x1')](0x0);var events={'afterCreate':_0xba90('0x2'),'afterUpdate':_0xba90('0x3'),'afterDestroy':_0xba90('0x4')};function emitEvent(_0x72ab8){return function(_0x2097b7,_0x1d3014,_0x217969){DashboardEvents['emit'](_0x72ab8+':'+_0x2097b7['id'],_0x2097b7);DashboardEvents['emit'](_0x72ab8,_0x2097b7);_0x217969(null);};}for(var e in events){if(events[_0xba90('0x5')](e)){var event=events[e];Dashboard[_0xba90('0x6')](e,emitEvent(event));}}module[_0xba90('0x7')]=DashboardEvents; \ No newline at end of file +var _0xef78=['emit','hasOwnProperty','exports','events','setMaxListeners','save','update','remove'];(function(_0x569998,_0x361b8d){var _0x2f8256=function(_0x3354f1){while(--_0x3354f1){_0x569998['push'](_0x569998['shift']());}};_0x2f8256(++_0x361b8d);}(_0xef78,0x18b));var _0x8ef7=function(_0x5bcc8a,_0x5ad372){_0x5bcc8a=_0x5bcc8a-0x0;var _0x105f52=_0xef78[_0x5bcc8a];return _0x105f52;};'use strict';var EventEmitter=require(_0x8ef7('0x0'));var Dashboard=require('../../mysqldb')['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0x8ef7('0x1')](0x0);var events={'afterCreate':_0x8ef7('0x2'),'afterUpdate':_0x8ef7('0x3'),'afterDestroy':_0x8ef7('0x4')};function emitEvent(_0xfc3f45){return function(_0x46217f,_0x3a7c66,_0x569f1b){DashboardEvents[_0x8ef7('0x5')](_0xfc3f45+':'+_0x46217f['id'],_0x46217f);DashboardEvents['emit'](_0xfc3f45,_0x46217f);_0x569f1b(null);};}for(var e in events){if(events[_0x8ef7('0x6')](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0x8ef7('0x7')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 5061a40..1ea1a1b 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 _0xcc8d=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./dashboard.attributes','define','Dashboard','dashboards'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0xcc8d,0xc3));var _0xdcc8=function(_0x55bd38,_0x48eacf){_0x55bd38=_0x55bd38-0x0;var _0x444323=_0xcc8d[_0x55bd38];return _0x444323;};'use strict';var _=require(_0xdcc8('0x0'));var util=require(_0xdcc8('0x1'));var logger=require('../../config/logger')(_0xdcc8('0x2'));var moment=require(_0xdcc8('0x3'));var BPromise=require(_0xdcc8('0x4'));var rp=require(_0xdcc8('0x5'));var fs=require('fs');var path=require(_0xdcc8('0x6'));var rimraf=require(_0xdcc8('0x7'));var config=require(_0xdcc8('0x8'));var attributes=require(_0xdcc8('0x9'));module['exports']=function(_0x347aa7,_0x399fa9){return _0x347aa7[_0xdcc8('0xa')](_0xdcc8('0xb'),attributes,{'tableName':_0xdcc8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x62d5=['bluebird','request-promise','path','../../config/environment','exports','define','Dashboard','dashboards','lodash','util','../../config/logger','api'];(function(_0xe9d8e1,_0x549de5){var _0x5e4b89=function(_0x2510b3){while(--_0x2510b3){_0xe9d8e1['push'](_0xe9d8e1['shift']());}};_0x5e4b89(++_0x549de5);}(_0x62d5,0xbc));var _0x562d=function(_0x5f47e7,_0x175c4e){_0x5f47e7=_0x5f47e7-0x0;var _0x2ce2e9=_0x62d5[_0x5f47e7];return _0x2ce2e9;};'use strict';var _=require(_0x562d('0x0'));var util=require(_0x562d('0x1'));var logger=require(_0x562d('0x2'))(_0x562d('0x3'));var moment=require('moment');var BPromise=require(_0x562d('0x4'));var rp=require(_0x562d('0x5'));var fs=require('fs');var path=require(_0x562d('0x6'));var rimraf=require('rimraf');var config=require(_0x562d('0x7'));var attributes=require('./dashboard.attributes');module[_0x562d('0x8')]=function(_0x28d7c6,_0x505f16){return _0x28d7c6[_0x562d('0x9')](_0x562d('0xa'),attributes,{'tableName':_0x562d('0xb'),'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 3173af8..ee6c13d 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 _0xe9ab=['util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./dashboard.socket','request','then','info','Dashboard,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','Dashboard,\x20%s,\x20%s','result','catch'];(function(_0x2495fb,_0x24d764){var _0x11e74=function(_0x31c8ce){while(--_0x31c8ce){_0x2495fb['push'](_0x2495fb['shift']());}};_0x11e74(++_0x24d764);}(_0xe9ab,0xf0));var _0xbe9a=function(_0x1357ee,_0x420763){_0x1357ee=_0x1357ee-0x0;var _0x55cf4d=_0xe9ab[_0x1357ee];return _0x55cf4d;};'use strict';var _=require('lodash');var util=require(_0xbe9a('0x0'));var moment=require('moment');var BPromise=require(_0xbe9a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbe9a('0x2'));var db=require(_0xbe9a('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xbe9a('0x4'))(_0xbe9a('0x5'));var config=require(_0xbe9a('0x6'));var jayson=require(_0xbe9a('0x7'));var client=jayson['client'][_0xbe9a('0x8')]({'port':0x232a});config[_0xbe9a('0x9')]=_[_0xbe9a('0xa')](config[_0xbe9a('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xbe9a('0xb'))(new Redis(config['redis']));require(_0xbe9a('0xc'))['register'](socket);function respondWithRpcPromise(_0x52be6c,_0x45e831,_0x4489ac){return new BPromise(function(_0x18002a,_0x3e6ae3){return client[_0xbe9a('0xd')](_0x52be6c,_0x4489ac)[_0xbe9a('0xe')](function(_0x1cfacf){logger[_0xbe9a('0xf')]('Dashboard,\x20%s,\x20%s',_0x45e831,'request\x20sent');logger['debug'](_0xbe9a('0x10'),_0x45e831,_0xbe9a('0x11'),JSON[_0xbe9a('0x12')](_0x1cfacf));if(_0x1cfacf[_0xbe9a('0x13')]){if(_0x1cfacf[_0xbe9a('0x13')]['code']===0x1f4){logger[_0xbe9a('0x13')]('Dashboard,\x20%s,\x20%s',_0x45e831,_0x1cfacf[_0xbe9a('0x13')][_0xbe9a('0x14')]);return _0x3e6ae3(_0x1cfacf[_0xbe9a('0x13')]['message']);}logger[_0xbe9a('0x13')](_0xbe9a('0x15'),_0x45e831,_0x1cfacf[_0xbe9a('0x13')]['message']);return _0x18002a(_0x1cfacf['error'][_0xbe9a('0x14')]);}else{logger[_0xbe9a('0xf')](_0xbe9a('0x15'),_0x45e831,'request\x20sent');_0x18002a(_0x1cfacf[_0xbe9a('0x16')][_0xbe9a('0x14')]);}})[_0xbe9a('0x17')](function(_0x2dae86){logger[_0xbe9a('0x13')](_0xbe9a('0x15'),_0x45e831,_0x2dae86);_0x3e6ae3(_0x2dae86);});});} \ No newline at end of file +var _0x9771=['request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Dashboard,\x20%s,\x20%s','info','result','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','then'];(function(_0x3b68d9,_0x563741){var _0x5f302a=function(_0x1ed83b){while(--_0x1ed83b){_0x3b68d9['push'](_0x3b68d9['shift']());}};_0x5f302a(++_0x563741);}(_0x9771,0x96));var _0x1977=function(_0x493e96,_0x31e402){_0x493e96=_0x493e96-0x0;var _0x5ddfa8=_0x9771[_0x493e96];return _0x5ddfa8;};'use strict';var _=require(_0x1977('0x0'));var util=require(_0x1977('0x1'));var moment=require('moment');var BPromise=require(_0x1977('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1977('0x3'));var db=require(_0x1977('0x4'))['db'];var utils=require(_0x1977('0x5'));var logger=require(_0x1977('0x6'))(_0x1977('0x7'));var config=require(_0x1977('0x8'));var jayson=require(_0x1977('0x9'));var client=jayson['client'][_0x1977('0xa')]({'port':0x232a});config[_0x1977('0xb')]=_[_0x1977('0xc')](config[_0x1977('0xb')],{'host':_0x1977('0xd'),'port':0x18eb});var socket=require(_0x1977('0xe'))(new Redis(config[_0x1977('0xb')]));require('./dashboard.socket')[_0x1977('0xf')](socket);function respondWithRpcPromise(_0x28380b,_0x1b2fe8,_0x2e498b){return new BPromise(function(_0x13a90f,_0xc256cc){return client[_0x1977('0x10')](_0x28380b,_0x2e498b)[_0x1977('0x11')](function(_0x94c39c){logger['info']('Dashboard,\x20%s,\x20%s',_0x1b2fe8,_0x1977('0x12'));logger[_0x1977('0x13')](_0x1977('0x14'),_0x1b2fe8,'request\x20sent',JSON[_0x1977('0x15')](_0x94c39c));if(_0x94c39c['error']){if(_0x94c39c[_0x1977('0x16')][_0x1977('0x17')]===0x1f4){logger[_0x1977('0x16')]('Dashboard,\x20%s,\x20%s',_0x1b2fe8,_0x94c39c['error'][_0x1977('0x18')]);return _0xc256cc(_0x94c39c[_0x1977('0x16')][_0x1977('0x18')]);}logger[_0x1977('0x16')](_0x1977('0x19'),_0x1b2fe8,_0x94c39c[_0x1977('0x16')]['message']);return _0x13a90f(_0x94c39c[_0x1977('0x16')][_0x1977('0x18')]);}else{logger[_0x1977('0x1a')]('Dashboard,\x20%s,\x20%s',_0x1b2fe8,_0x1977('0x12'));_0x13a90f(_0x94c39c[_0x1977('0x1b')][_0x1977('0x18')]);}})['catch'](function(_0x1d498e){logger['error'](_0x1977('0x19'),_0x1b2fe8,_0x1d498e);_0xc256cc(_0x1d498e);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 142aa62..9aa53e1 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 _0x85f5=['length','dashboard:','./dashboard.events','save','update','removeListener'];(function(_0x25a602,_0x489c63){var _0x253899=function(_0x3c02c6){while(--_0x3c02c6){_0x25a602['push'](_0x25a602['shift']());}};_0x253899(++_0x489c63);}(_0x85f5,0x80));var _0x585f=function(_0x295143,_0x105ade){_0x295143=_0x295143-0x0;var _0x7982e4=_0x85f5[_0x295143];return _0x7982e4;};'use strict';var DashboardEvents=require(_0x585f('0x0'));var events=[_0x585f('0x1'),'remove',_0x585f('0x2')];function createListener(_0x17cbe7,_0x18f977){return function(_0x170052){_0x18f977['emit'](_0x17cbe7,_0x170052);};}function removeListener(_0x10af99,_0x1e22c5){return function(){DashboardEvents[_0x585f('0x3')](_0x10af99,_0x1e22c5);};}exports['register']=function(_0x52a237){for(var _0x20da81=0x0,_0x5036d8=events[_0x585f('0x4')];_0x20da81<_0x5036d8;_0x20da81++){var _0x19a6b2=events[_0x20da81];var _0x521ab4=createListener(_0x585f('0x5')+_0x19a6b2,_0x52a237);DashboardEvents['on'](_0x19a6b2,_0x521ab4);}}; \ No newline at end of file +var _0x3465=['dashboard:','save','remove','update','emit','removeListener','register','length'];(function(_0x3592ab,_0x4f669a){var _0x13298a=function(_0x25f018){while(--_0x25f018){_0x3592ab['push'](_0x3592ab['shift']());}};_0x13298a(++_0x4f669a);}(_0x3465,0xd1));var _0x5346=function(_0x5d5e5a,_0x2f4878){_0x5d5e5a=_0x5d5e5a-0x0;var _0x2ec9c9=_0x3465[_0x5d5e5a];return _0x2ec9c9;};'use strict';var DashboardEvents=require('./dashboard.events');var events=[_0x5346('0x0'),_0x5346('0x1'),_0x5346('0x2')];function createListener(_0x40f4c7,_0x1221fe){return function(_0x308c3a){_0x1221fe[_0x5346('0x3')](_0x40f4c7,_0x308c3a);};}function removeListener(_0x2f94b6,_0x1dd10e){return function(){DashboardEvents[_0x5346('0x4')](_0x2f94b6,_0x1dd10e);};}exports[_0x5346('0x5')]=function(_0x1c116){for(var _0x2d5f46=0x0,_0x338776=events[_0x5346('0x6')];_0x2d5f46<_0x338776;_0x2d5f46++){var _0x32cb6c=events[_0x2d5f46];var _0x99c77b=createListener(_0x5346('0x7')+_0x32cb6c,_0x1c116);DashboardEvents['on'](_0x32cb6c,_0x99c77b);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 0516736..74cea15 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 _0x73b6=['post','create','/:id/clone','clone','put','/:id','delete','destroy','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','show','/:id/items','getItems'];(function(_0x4b719b,_0x440b42){var _0x90fbee=function(_0xccfd7e){while(--_0xccfd7e){_0x4b719b['push'](_0x4b719b['shift']());}};_0x90fbee(++_0x440b42);}(_0x73b6,0xce));var _0x673b=function(_0xe66cf2,_0x32ba5f){_0xe66cf2=_0xe66cf2-0x0;var _0x2d84e7=_0x73b6[_0xe66cf2];return _0x2d84e7;};'use strict';var multer=require(_0x673b('0x0'));var util=require('util');var path=require(_0x673b('0x1'));var timeout=require(_0x673b('0x2'));var express=require(_0x673b('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x673b('0x4'));var interaction=require(_0x673b('0x5'));var config=require(_0x673b('0x6'));var controller=require(_0x673b('0x7'));router[_0x673b('0x8')]('/',auth[_0x673b('0x9')](),controller[_0x673b('0xa')]);router[_0x673b('0x8')]('/:id',auth[_0x673b('0x9')](),controller[_0x673b('0xb')]);router['get'](_0x673b('0xc'),auth[_0x673b('0x9')](),controller[_0x673b('0xd')]);router[_0x673b('0xe')]('/',auth[_0x673b('0x9')](),controller[_0x673b('0xf')]);router[_0x673b('0xe')](_0x673b('0x10'),auth['isAuthenticated'](),controller[_0x673b('0x11')]);router[_0x673b('0xe')]('/:id/items',auth[_0x673b('0x9')](),controller['addItem']);router[_0x673b('0x12')](_0x673b('0x13'),auth['isAuthenticated'](),controller['update']);router[_0x673b('0x14')](_0x673b('0x13'),auth[_0x673b('0x9')](),controller[_0x673b('0x15')]);module['exports']=router; \ No newline at end of file +var _0x1d0f=['./dashboard.controller','isAuthenticated','index','get','/:id','show','/:id/items','getItems','post','create','clone','addItem','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0xa3c06b,_0x490f99){var _0x33aa1d=function(_0x23a88e){while(--_0x23a88e){_0xa3c06b['push'](_0xa3c06b['shift']());}};_0x33aa1d(++_0x490f99);}(_0x1d0f,0xde));var _0xf1d0=function(_0x2cccbe,_0x225889){_0x2cccbe=_0x2cccbe-0x0;var _0x5edce5=_0x1d0f[_0x2cccbe];return _0x5edce5;};'use strict';var multer=require(_0xf1d0('0x0'));var util=require(_0xf1d0('0x1'));var path=require('path');var timeout=require(_0xf1d0('0x2'));var express=require(_0xf1d0('0x3'));var router=express[_0xf1d0('0x4')]();var fs_extra=require(_0xf1d0('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf1d0('0x6'));var config=require(_0xf1d0('0x7'));var controller=require(_0xf1d0('0x8'));router['get']('/',auth[_0xf1d0('0x9')](),controller[_0xf1d0('0xa')]);router[_0xf1d0('0xb')](_0xf1d0('0xc'),auth[_0xf1d0('0x9')](),controller[_0xf1d0('0xd')]);router[_0xf1d0('0xb')](_0xf1d0('0xe'),auth[_0xf1d0('0x9')](),controller[_0xf1d0('0xf')]);router[_0xf1d0('0x10')]('/',auth[_0xf1d0('0x9')](),controller[_0xf1d0('0x11')]);router[_0xf1d0('0x10')]('/:id/clone',auth[_0xf1d0('0x9')](),controller[_0xf1d0('0x12')]);router[_0xf1d0('0x10')](_0xf1d0('0xe'),auth[_0xf1d0('0x9')](),controller[_0xf1d0('0x13')]);router['put'](_0xf1d0('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xf1d0('0x14')](_0xf1d0('0xc'),auth[_0xf1d0('0x9')](),controller[_0xf1d0('0x15')]);module[_0xf1d0('0x16')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 1ccaa7b..257dbbf 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 _0x2a07=['setDataValue','stringify','INTEGER','#2196f3','sequelize','squel','lodash','exports','STRING','TEXT','long','parse','getDataValue','attrs'];(function(_0x19d339,_0x18ae8e){var _0x49e86f=function(_0x51de9c){while(--_0x51de9c){_0x19d339['push'](_0x19d339['shift']());}};_0x49e86f(++_0x18ae8e);}(_0x2a07,0x74));var _0x72a0=function(_0x153c6a,_0x2a217a){_0x153c6a=_0x153c6a-0x0;var _0xce898f=_0x2a07[_0x153c6a];return _0xce898f;};'use strict';var Sequelize=require(_0x72a0('0x0'));var squel=require(_0x72a0('0x1'));var _=require(_0x72a0('0x2'));module[_0x72a0('0x3')]={'title':{'type':Sequelize[_0x72a0('0x4')],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x72a0('0x5')](_0x72a0('0x6')),'get':function(){try{return JSON[_0x72a0('0x7')](this[_0x72a0('0x8')](_0x72a0('0x9')));}catch(_0xce74c){return[];}},'set':function(_0x3ccf6d){try{this[_0x72a0('0xa')](_0x72a0('0x9'),JSON[_0x72a0('0xb')](_0x3ccf6d));}catch(_0x21c819){this[_0x72a0('0xa')](_0x72a0('0x9'),JSON[_0x72a0('0xb')]([]));}}},'sizeX':{'type':Sequelize[_0x72a0('0xc')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x72a0('0xc')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0x72a0('0xc')]},'background':{'type':Sequelize[_0x72a0('0x4')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x72a0('0x4')],'allowNull':![],'defaultValue':_0x72a0('0xd'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x72a0('0x4')]},'titleFontSize':{'type':Sequelize[_0x72a0('0xc')],'defaultValue':0xc}}; \ No newline at end of file +var _0x5fab=['STRING','TEXT','long','parse','getDataValue','attrs','stringify','setDataValue','INTEGER','#ffffff','#2196f3','sequelize','squel','exports'];(function(_0x3c2303,_0x54b506){var _0x3ff407=function(_0x3a2e1d){while(--_0x3a2e1d){_0x3c2303['push'](_0x3c2303['shift']());}};_0x3ff407(++_0x54b506);}(_0x5fab,0x177));var _0xb5fa=function(_0x8290f1,_0x1ab791){_0x8290f1=_0x8290f1-0x0;var _0xd8bfcc=_0x5fab[_0x8290f1];return _0xd8bfcc;};'use strict';var Sequelize=require(_0xb5fa('0x0'));var squel=require(_0xb5fa('0x1'));var _=require('lodash');module[_0xb5fa('0x2')]={'title':{'type':Sequelize[_0xb5fa('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xb5fa('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xb5fa('0x4')](_0xb5fa('0x5')),'get':function(){try{return JSON[_0xb5fa('0x6')](this[_0xb5fa('0x7')](_0xb5fa('0x8')));}catch(_0x10361d){return[];}},'set':function(_0x44df89){try{this['setDataValue']('attrs',JSON[_0xb5fa('0x9')](_0x44df89));}catch(_0x1aec3e){this[_0xb5fa('0xa')]('attrs',JSON[_0xb5fa('0x9')]([]));}}},'sizeX':{'type':Sequelize[_0xb5fa('0xb')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xb5fa('0xb')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize['INTEGER']},'background':{'type':Sequelize[_0xb5fa('0x3')],'allowNull':![],'defaultValue':_0xb5fa('0xc'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xb5fa('0x3')],'allowNull':![],'defaultValue':_0xb5fa('0xd'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xb5fa('0x3')]},'titleFontSize':{'type':Sequelize[_0xb5fa('0xb')],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 66b490d..9724bbc 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 _0x6bb4=['rawAttributes','query','intersection','fields','attributes','length','includeAll','include','merge','options','find','catch','type','iframe','attrUrl','attrs','https://','attrPath','clock','value','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','update','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','socket.io-emitter','./dashboardItem.socket','register','sendStatus','end','status','offset','undefined','limit','count','json','apply','then','destroy','error','stack','name','send','show','params','model','keys','DashboardItem'];(function(_0x1d94d1,_0x347bb8){var _0x23c397=function(_0x489441){while(--_0x489441){_0x1d94d1['push'](_0x1d94d1['shift']());}};_0x23c397(++_0x347bb8);}(_0x6bb4,0x1a7));var _0x46bb=function(_0x1693ed,_0x5700fe){_0x1693ed=_0x1693ed-0x0;var _0x1442bb=_0x6bb4[_0x1693ed];return _0x1442bb;};'use strict';var emlformat=require(_0x46bb('0x0'));var rimraf=require(_0x46bb('0x1'));var zipdir=require(_0x46bb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x46bb('0x3'));var moment=require(_0x46bb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x46bb('0x5'));var util=require(_0x46bb('0x6'));var path=require(_0x46bb('0x7'));var sox=require(_0x46bb('0x8'));var csv=require(_0x46bb('0x9'));var ejs=require(_0x46bb('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x46bb('0xb'));var crypto=require(_0x46bb('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x46bb('0xd'));var Papa=require(_0x46bb('0xe'));var Redis=require('ioredis');var authService=require(_0x46bb('0xf'));var qs=require(_0x46bb('0x10'));var as=require(_0x46bb('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x46bb('0x12'))(_0x46bb('0x13'));var utils=require('../../config/utils');var config=require(_0x46bb('0x14'));var licenseUtil=require(_0x46bb('0x15'));var db=require(_0x46bb('0x16'))['db'];config['redis']=_[_0x46bb('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x46bb('0x18'))(new Redis(config['redis']));require(_0x46bb('0x19'))[_0x46bb('0x1a')](socket);function respondWithStatusCode(_0x50f198,_0x365805){_0x365805=_0x365805||0xcc;return function(_0x5a5468){if(_0x5a5468){return _0x50f198[_0x46bb('0x1b')](_0x365805);}return _0x50f198['status'](_0x365805)[_0x46bb('0x1c')]();};}function respondWithResult(_0x547aff,_0x556efa){_0x556efa=_0x556efa||0xc8;return function(_0x3aedc4){if(_0x3aedc4){return _0x547aff[_0x46bb('0x1d')](_0x556efa)['json'](_0x3aedc4);}};}function respondWithFilteredResult(_0x3f0817,_0x2afac6){return function(_0x5eb0e1){if(_0x5eb0e1){var _0x53ee66=typeof _0x2afac6[_0x46bb('0x1e')]===_0x46bb('0x1f')&&typeof _0x2afac6[_0x46bb('0x20')]===_0x46bb('0x1f');var _0x20e011=_0x5eb0e1[_0x46bb('0x21')];var _0x2d8023=_0x53ee66?0x0:_0x2afac6[_0x46bb('0x1e')];var _0x5b697c=_0x53ee66?_0x5eb0e1['count']:_0x2afac6[_0x46bb('0x1e')]+_0x2afac6[_0x46bb('0x20')];var _0x2ff232;if(_0x5b697c>=_0x20e011){_0x5b697c=_0x20e011;_0x2ff232=0xc8;}else{_0x2ff232=0xce;}_0x3f0817['status'](_0x2ff232);return _0x3f0817['set']('Content-Range',_0x2d8023+'-'+_0x5b697c+'/'+_0x20e011)[_0x46bb('0x22')](_0x5eb0e1);}return null;};}function patchUpdates(_0x2b3443){return function(_0x43fea7){try{jsonpatch[_0x46bb('0x23')](_0x43fea7,_0x2b3443,!![]);}catch(_0x5b8e04){return BPromise['reject'](_0x5b8e04);}return _0x43fea7['save']();};}function saveUpdates(_0x5c2885,_0x5a0659){return function(_0x38699f){if(_0x38699f){return _0x38699f['update'](_0x5c2885)[_0x46bb('0x24')](function(_0x3c0031){return _0x3c0031;});}return null;};}function removeEntity(_0x16413b,_0x1ee93a){return function(_0x44eb24){if(_0x44eb24){return _0x44eb24[_0x46bb('0x25')]()[_0x46bb('0x24')](function(){_0x16413b[_0x46bb('0x1d')](0xcc)[_0x46bb('0x1c')]();});}};}function handleEntityNotFound(_0x4277c4,_0x48db48){return function(_0x104e9b){if(!_0x104e9b){_0x4277c4[_0x46bb('0x1b')](0x194);}return _0x104e9b;};}function handleError(_0x49a84d,_0x34e43a){_0x34e43a=_0x34e43a||0x1f4;return function(_0x3a9927){logger[_0x46bb('0x26')](_0x3a9927[_0x46bb('0x27')]);if(_0x3a9927[_0x46bb('0x28')]){delete _0x3a9927[_0x46bb('0x28')];}_0x49a84d[_0x46bb('0x1d')](_0x34e43a)[_0x46bb('0x29')](_0x3a9927);};}exports[_0x46bb('0x2a')]=function(_0x1762b0,_0x1f669f){var _0x1fb8ea={'raw':![],'where':{'id':_0x1762b0[_0x46bb('0x2b')]['id']}},_0x2d34d6={};_0x2d34d6[_0x46bb('0x2c')]=_[_0x46bb('0x2d')](db[_0x46bb('0x2e')][_0x46bb('0x2f')]);_0x2d34d6[_0x46bb('0x30')]=_[_0x46bb('0x2d')](_0x1762b0[_0x46bb('0x30')]);_0x2d34d6['filters']=_[_0x46bb('0x31')](_0x2d34d6['model'],_0x2d34d6[_0x46bb('0x30')]);_0x1fb8ea['attributes']=_[_0x46bb('0x31')](_0x2d34d6[_0x46bb('0x2c')],qs[_0x46bb('0x32')](_0x1762b0['query'][_0x46bb('0x32')]));_0x1fb8ea[_0x46bb('0x33')]=_0x1fb8ea[_0x46bb('0x33')][_0x46bb('0x34')]?_0x1fb8ea[_0x46bb('0x33')]:_0x2d34d6['model'];if(_0x1762b0[_0x46bb('0x30')][_0x46bb('0x35')]){_0x1fb8ea[_0x46bb('0x36')]=[{'all':!![]}];}_0x1fb8ea=_[_0x46bb('0x37')]({},_0x1fb8ea,_0x1762b0[_0x46bb('0x38')]);return db[_0x46bb('0x2e')][_0x46bb('0x39')](_0x1fb8ea)[_0x46bb('0x24')](handleEntityNotFound(_0x1f669f,null))[_0x46bb('0x24')](respondWithResult(_0x1f669f,null))[_0x46bb('0x3a')](handleError(_0x1f669f,null));};exports[_0x46bb('0x25')]=function(_0x461735,_0x7e9c51){return db[_0x46bb('0x2e')][_0x46bb('0x39')]({'where':{'id':_0x461735[_0x46bb('0x2b')]['id']}})[_0x46bb('0x24')](handleEntityNotFound(_0x7e9c51,null))[_0x46bb('0x24')](removeEntity(_0x7e9c51,null))[_0x46bb('0x3a')](handleError(_0x7e9c51,null));};function widgetAttributes(_0x41fc4d){try{switch(_0x41fc4d[_0x46bb('0x3b')]){case _0x46bb('0x3c'):return[{'name':_0x46bb('0x3d'),'value':_0x41fc4d['attrUrl']||(_0x41fc4d[_0x46bb('0x3e')]&&_0x41fc4d['attrs'][0x0]?_0x41fc4d['attrs'][0x0]['value']:undefined)||_0x46bb('0x3f')}];case'custom':return[{'name':_0x46bb('0x40'),'value':_0x41fc4d['attrPath']||(_0x41fc4d['attrs']&&_0x41fc4d[_0x46bb('0x3e')][0x0]?_0x41fc4d[_0x46bb('0x3e')][0x0]['value']:undefined)||''}];case _0x46bb('0x41'):return[{'name':'attrHourFormat','value':_0x41fc4d['attrHourFormat']||(_0x41fc4d[_0x46bb('0x3e')]&&_0x41fc4d['attrs'][0x0]?_0x41fc4d[_0x46bb('0x3e')][0x0][_0x46bb('0x42')]:undefined)||_0x46bb('0x43')},{'name':'attrTimezone','value':_0x41fc4d[_0x46bb('0x44')]||(_0x41fc4d[_0x46bb('0x3e')]&&_0x41fc4d[_0x46bb('0x3e')][0x1]?_0x41fc4d['attrs'][0x1][_0x46bb('0x42')]:undefined)||_0x46bb('0x45')},{'name':_0x46bb('0x46'),'value':_0x41fc4d[_0x46bb('0x46')]||(_0x41fc4d[_0x46bb('0x3e')]&&_0x41fc4d[_0x46bb('0x3e')][0x2]?_0x41fc4d['attrs'][0x2][_0x46bb('0x42')]:undefined)||0xc}];case'counter':return[{'name':_0x46bb('0x47'),'value':_0x41fc4d['attrMetric']||(_0x41fc4d[_0x46bb('0x3e')]&&_0x41fc4d[_0x46bb('0x3e')][0x0]?_0x41fc4d[_0x46bb('0x3e')][0x0]['value']:undefined)||_0x46bb('0x48')},{'name':_0x46bb('0x49'),'value':_0x41fc4d[_0x46bb('0x49')]||(_0x41fc4d['attrs']&&_0x41fc4d['attrs'][0x1]?_0x41fc4d[_0x46bb('0x3e')][0x1][_0x46bb('0x42')]:undefined)||[]},{'name':_0x46bb('0x46'),'value':_0x41fc4d[_0x46bb('0x46')]||(_0x41fc4d[_0x46bb('0x3e')]&&_0x41fc4d[_0x46bb('0x3e')][0x2]?_0x41fc4d[_0x46bb('0x3e')][0x2][_0x46bb('0x42')]:undefined)||0x14},{'name':'attrChannel','value':_0x41fc4d[_0x46bb('0x4a')]||(_0x41fc4d[_0x46bb('0x3e')]&&_0x41fc4d[_0x46bb('0x3e')][0x3]?_0x41fc4d[_0x46bb('0x3e')][0x3]['value']:undefined)||_0x46bb('0x4b')},{'name':_0x46bb('0x4c'),'value':_0x41fc4d[_0x46bb('0x4c')]||(_0x41fc4d[_0x46bb('0x3e')]&&_0x41fc4d[_0x46bb('0x3e')][0x4]?_0x41fc4d[_0x46bb('0x3e')][0x4][_0x46bb('0x42')]:undefined)||''},{'name':_0x46bb('0x4d'),'value':_0x41fc4d[_0x46bb('0x4d')]||(_0x41fc4d['attrs']&&_0x41fc4d[_0x46bb('0x3e')][0x5]?_0x41fc4d[_0x46bb('0x3e')][0x5][_0x46bb('0x42')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x41fc4d[_0x46bb('0x4e')]||(_0x41fc4d['attrs']&&_0x41fc4d[_0x46bb('0x3e')][0x6]?_0x41fc4d['attrs'][0x6][_0x46bb('0x42')]:undefined)||''},{'name':_0x46bb('0x4f'),'value':_0x41fc4d['attrOpenchannelAccounts']||(_0x41fc4d['attrs']&&_0x41fc4d[_0x46bb('0x3e')][0x7]?_0x41fc4d[_0x46bb('0x3e')][0x7]['value']:undefined)||''},{'name':_0x46bb('0x50'),'value':_0x41fc4d['attrWhatsappAccounts']||(_0x41fc4d[_0x46bb('0x3e')]&&_0x41fc4d[_0x46bb('0x3e')][0x8]?_0x41fc4d[_0x46bb('0x3e')][0x8]['value']:undefined)||''},{'name':_0x46bb('0x51'),'value':_0x41fc4d[_0x46bb('0x51')]||(_0x41fc4d[_0x46bb('0x3e')]&&_0x41fc4d[_0x46bb('0x3e')][0x9]?_0x41fc4d['attrs'][0x9]['value']:undefined)||''}];case _0x46bb('0x52'):case'pie-chart':return[{'name':'attrSerie1','value':_0x41fc4d[_0x46bb('0x53')]||(_0x41fc4d[_0x46bb('0x3e')]&&_0x41fc4d['attrs'][0x0]?_0x41fc4d[_0x46bb('0x3e')][0x0][_0x46bb('0x42')]:undefined)||'total'},{'name':_0x46bb('0x54'),'value':_0x41fc4d[_0x46bb('0x54')]||(_0x41fc4d[_0x46bb('0x3e')]&&_0x41fc4d[_0x46bb('0x3e')][0x1]?_0x41fc4d[_0x46bb('0x3e')][0x1][_0x46bb('0x42')]:undefined)||null},{'name':_0x46bb('0x55'),'value':_0x41fc4d[_0x46bb('0x55')]||(_0x41fc4d[_0x46bb('0x3e')]&&_0x41fc4d[_0x46bb('0x3e')][0x2]?_0x41fc4d[_0x46bb('0x3e')][0x2][_0x46bb('0x42')]:undefined)||null},{'name':_0x46bb('0x49'),'value':_0x41fc4d[_0x46bb('0x49')]||(_0x41fc4d[_0x46bb('0x3e')]&&_0x41fc4d[_0x46bb('0x3e')][0x3]?_0x41fc4d['attrs'][0x3][_0x46bb('0x42')]:undefined)||[]},{'name':_0x46bb('0x4a'),'value':_0x41fc4d[_0x46bb('0x4a')]||(_0x41fc4d[_0x46bb('0x3e')]&&_0x41fc4d[_0x46bb('0x3e')][0x4]?_0x41fc4d[_0x46bb('0x3e')][0x4]['value']:undefined)||_0x46bb('0x4b')},{'name':'attrEmailAccounts','value':_0x41fc4d[_0x46bb('0x4c')]||(_0x41fc4d[_0x46bb('0x3e')]&&_0x41fc4d[_0x46bb('0x3e')][0x5]?_0x41fc4d['attrs'][0x5][_0x46bb('0x42')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x41fc4d[_0x46bb('0x4d')]||(_0x41fc4d[_0x46bb('0x3e')]&&_0x41fc4d[_0x46bb('0x3e')][0x6]?_0x41fc4d[_0x46bb('0x3e')][0x6][_0x46bb('0x42')]:undefined)||''},{'name':_0x46bb('0x4e'),'value':_0x41fc4d[_0x46bb('0x4e')]||(_0x41fc4d[_0x46bb('0x3e')]&&_0x41fc4d[_0x46bb('0x3e')][0x7]?_0x41fc4d['attrs'][0x7][_0x46bb('0x42')]:undefined)||''},{'name':_0x46bb('0x4f'),'value':_0x41fc4d['attrOpenchannelAccounts']||(_0x41fc4d[_0x46bb('0x3e')]&&_0x41fc4d['attrs'][0x8]?_0x41fc4d[_0x46bb('0x3e')][0x8][_0x46bb('0x42')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x41fc4d['attrWhatsappAccounts']||(_0x41fc4d['attrs']&&_0x41fc4d[_0x46bb('0x3e')][0x9]?_0x41fc4d[_0x46bb('0x3e')][0x9]['value']:undefined)||''},{'name':_0x46bb('0x51'),'value':_0x41fc4d[_0x46bb('0x51')]||(_0x41fc4d['attrs']&&_0x41fc4d[_0x46bb('0x3e')][0xa]?_0x41fc4d[_0x46bb('0x3e')][0xa][_0x46bb('0x42')]:undefined)||''}];case _0x46bb('0x56'):return[{'name':_0x46bb('0x57'),'type':_0x41fc4d['reportType']||(_0x41fc4d[_0x46bb('0x3e')]&&_0x41fc4d['attrs'][0x0]?_0x41fc4d[_0x46bb('0x3e')][0x0][_0x46bb('0x3b')]:undefined)||null,'value':_0x41fc4d[_0x46bb('0x57')]||(_0x41fc4d[_0x46bb('0x3e')]&&_0x41fc4d[_0x46bb('0x3e')][0x0]?_0x41fc4d[_0x46bb('0x3e')][0x0][_0x46bb('0x42')]:undefined)||null},{'name':_0x46bb('0x58'),'value':_0x41fc4d[_0x46bb('0x58')]||(_0x41fc4d[_0x46bb('0x3e')]&&_0x41fc4d[_0x46bb('0x3e')][0x1]?_0x41fc4d[_0x46bb('0x3e')][0x1][_0x46bb('0x42')]:undefined)||0x0}];default:return[];}}catch(_0x12c40d){logger[_0x46bb('0x26')](_0x46bb('0x59'),JSON[_0x46bb('0x5a')](_0x12c40d));return[];}}exports[_0x46bb('0x5b')]=function(_0x44eeee,_0x1b9889){if(_0x44eeee[_0x46bb('0x5c')]){_0x44eeee[_0x46bb('0x5c')]['attrs']=widgetAttributes(_0x44eeee[_0x46bb('0x5c')]);}return db['DashboardItem']['create'](_0x44eeee['body'],{})[_0x46bb('0x24')](respondWithResult(_0x1b9889,0xc9))[_0x46bb('0x3a')](handleError(_0x1b9889,null));};exports[_0x46bb('0x5d')]=function(_0x277768,_0x297d4a){if(_0x277768[_0x46bb('0x5c')]['id']){delete _0x277768[_0x46bb('0x5c')]['id'];}_0x277768['body'][_0x46bb('0x3e')]=widgetAttributes(_0x277768['body']);return db[_0x46bb('0x2e')]['find']({'where':{'id':_0x277768['params']['id']}})[_0x46bb('0x24')](handleEntityNotFound(_0x297d4a,null))['then'](saveUpdates(_0x277768[_0x46bb('0x5c')],null))[_0x46bb('0x24')](respondWithResult(_0x297d4a,null))['catch'](handleError(_0x297d4a,null));}; \ No newline at end of file +var _0xbd3c=['attrRefresh','widgetAttributes:\x20%s','stringify','create','body','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./dashboardItem.socket','sendStatus','status','json','limit','undefined','offset','Content-Range','apply','reject','save','update','destroy','then','end','error','name','send','show','model','rawAttributes','query','keys','filters','intersection','attributes','fields','length','include','options','DashboardItem','find','catch','attrUrl','attrs','https://','custom','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','web-report','attrReport','reportType'];(function(_0x368053,_0x2d9f9f){var _0x5655f6=function(_0x42174b){while(--_0x42174b){_0x368053['push'](_0x368053['shift']());}};_0x5655f6(++_0x2d9f9f);}(_0xbd3c,0xc2));var _0xcbd3=function(_0x10cc32,_0x3f796f){_0x10cc32=_0x10cc32-0x0;var _0x6936e8=_0xbd3c[_0x10cc32];return _0x6936e8;};'use strict';var emlformat=require(_0xcbd3('0x0'));var rimraf=require(_0xcbd3('0x1'));var zipdir=require(_0xcbd3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcbd3('0x3'));var moment=require(_0xcbd3('0x4'));var BPromise=require(_0xcbd3('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xcbd3('0x6'));var sox=require('sox');var csv=require(_0xcbd3('0x7'));var ejs=require(_0xcbd3('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcbd3('0x9'));var squel=require(_0xcbd3('0xa'));var crypto=require(_0xcbd3('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xcbd3('0xc'));var toCsv=require(_0xcbd3('0x7'));var querystring=require(_0xcbd3('0xd'));var Papa=require(_0xcbd3('0xe'));var Redis=require(_0xcbd3('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xcbd3('0x10'));var hardwareService=require(_0xcbd3('0x11'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xcbd3('0x12'));var licenseUtil=require(_0xcbd3('0x13'));var db=require(_0xcbd3('0x14'))['db'];config['redis']=_[_0xcbd3('0x15')](config[_0xcbd3('0x16')],{'host':_0xcbd3('0x17'),'port':0x18eb});var socket=require(_0xcbd3('0x18'))(new Redis(config[_0xcbd3('0x16')]));require(_0xcbd3('0x19'))['register'](socket);function respondWithStatusCode(_0x3cb72d,_0x4f1dfd){_0x4f1dfd=_0x4f1dfd||0xcc;return function(_0xfb116b){if(_0xfb116b){return _0x3cb72d[_0xcbd3('0x1a')](_0x4f1dfd);}return _0x3cb72d[_0xcbd3('0x1b')](_0x4f1dfd)['end']();};}function respondWithResult(_0xaec2d4,_0x518954){_0x518954=_0x518954||0xc8;return function(_0x3a379c){if(_0x3a379c){return _0xaec2d4['status'](_0x518954)[_0xcbd3('0x1c')](_0x3a379c);}};}function respondWithFilteredResult(_0x4dd582,_0x202970){return function(_0x115336){if(_0x115336){var _0xb02b09=typeof _0x202970['offset']==='undefined'&&typeof _0x202970[_0xcbd3('0x1d')]===_0xcbd3('0x1e');var _0xa13da3=_0x115336['count'];var _0x6888ef=_0xb02b09?0x0:_0x202970['offset'];var _0x389c72=_0xb02b09?_0x115336['count']:_0x202970[_0xcbd3('0x1f')]+_0x202970['limit'];var _0x27b0a5;if(_0x389c72>=_0xa13da3){_0x389c72=_0xa13da3;_0x27b0a5=0xc8;}else{_0x27b0a5=0xce;}_0x4dd582['status'](_0x27b0a5);return _0x4dd582['set'](_0xcbd3('0x20'),_0x6888ef+'-'+_0x389c72+'/'+_0xa13da3)[_0xcbd3('0x1c')](_0x115336);}return null;};}function patchUpdates(_0x1369c5){return function(_0x530903){try{jsonpatch[_0xcbd3('0x21')](_0x530903,_0x1369c5,!![]);}catch(_0x2b3339){return BPromise[_0xcbd3('0x22')](_0x2b3339);}return _0x530903[_0xcbd3('0x23')]();};}function saveUpdates(_0x2a68db,_0x3d514b){return function(_0x32d34f){if(_0x32d34f){return _0x32d34f[_0xcbd3('0x24')](_0x2a68db)['then'](function(_0x35fd76){return _0x35fd76;});}return null;};}function removeEntity(_0x5d9047,_0x2f1cea){return function(_0x526a56){if(_0x526a56){return _0x526a56[_0xcbd3('0x25')]()[_0xcbd3('0x26')](function(){_0x5d9047['status'](0xcc)[_0xcbd3('0x27')]();});}};}function handleEntityNotFound(_0x52cc97,_0x319837){return function(_0xb3ae68){if(!_0xb3ae68){_0x52cc97[_0xcbd3('0x1a')](0x194);}return _0xb3ae68;};}function handleError(_0x407e8e,_0x3a17a2){_0x3a17a2=_0x3a17a2||0x1f4;return function(_0x197b00){logger[_0xcbd3('0x28')](_0x197b00['stack']);if(_0x197b00[_0xcbd3('0x29')]){delete _0x197b00[_0xcbd3('0x29')];}_0x407e8e[_0xcbd3('0x1b')](_0x3a17a2)[_0xcbd3('0x2a')](_0x197b00);};}exports[_0xcbd3('0x2b')]=function(_0x45aadb,_0x3a74e2){var _0x15ed47={'raw':![],'where':{'id':_0x45aadb['params']['id']}},_0x2df328={};_0x2df328[_0xcbd3('0x2c')]=_['keys'](db['DashboardItem'][_0xcbd3('0x2d')]);_0x2df328[_0xcbd3('0x2e')]=_[_0xcbd3('0x2f')](_0x45aadb[_0xcbd3('0x2e')]);_0x2df328[_0xcbd3('0x30')]=_[_0xcbd3('0x31')](_0x2df328[_0xcbd3('0x2c')],_0x2df328['query']);_0x15ed47[_0xcbd3('0x32')]=_['intersection'](_0x2df328[_0xcbd3('0x2c')],qs[_0xcbd3('0x33')](_0x45aadb[_0xcbd3('0x2e')][_0xcbd3('0x33')]));_0x15ed47[_0xcbd3('0x32')]=_0x15ed47[_0xcbd3('0x32')][_0xcbd3('0x34')]?_0x15ed47[_0xcbd3('0x32')]:_0x2df328[_0xcbd3('0x2c')];if(_0x45aadb['query']['includeAll']){_0x15ed47[_0xcbd3('0x35')]=[{'all':!![]}];}_0x15ed47=_['merge']({},_0x15ed47,_0x45aadb[_0xcbd3('0x36')]);return db[_0xcbd3('0x37')][_0xcbd3('0x38')](_0x15ed47)[_0xcbd3('0x26')](handleEntityNotFound(_0x3a74e2,null))[_0xcbd3('0x26')](respondWithResult(_0x3a74e2,null))[_0xcbd3('0x39')](handleError(_0x3a74e2,null));};exports['destroy']=function(_0x1d7734,_0x2b8f3d){return db['DashboardItem'][_0xcbd3('0x38')]({'where':{'id':_0x1d7734['params']['id']}})[_0xcbd3('0x26')](handleEntityNotFound(_0x2b8f3d,null))[_0xcbd3('0x26')](removeEntity(_0x2b8f3d,null))[_0xcbd3('0x39')](handleError(_0x2b8f3d,null));};function widgetAttributes(_0x43d9f5){try{switch(_0x43d9f5['type']){case'iframe':return[{'name':_0xcbd3('0x3a'),'value':_0x43d9f5['attrUrl']||(_0x43d9f5[_0xcbd3('0x3b')]&&_0x43d9f5[_0xcbd3('0x3b')][0x0]?_0x43d9f5[_0xcbd3('0x3b')][0x0]['value']:undefined)||_0xcbd3('0x3c')}];case _0xcbd3('0x3d'):return[{'name':'attrPath','value':_0x43d9f5[_0xcbd3('0x3e')]||(_0x43d9f5[_0xcbd3('0x3b')]&&_0x43d9f5['attrs'][0x0]?_0x43d9f5[_0xcbd3('0x3b')][0x0][_0xcbd3('0x3f')]:undefined)||''}];case _0xcbd3('0x40'):return[{'name':_0xcbd3('0x41'),'value':_0x43d9f5[_0xcbd3('0x41')]||(_0x43d9f5[_0xcbd3('0x3b')]&&_0x43d9f5[_0xcbd3('0x3b')][0x0]?_0x43d9f5[_0xcbd3('0x3b')][0x0]['value']:undefined)||_0xcbd3('0x42')},{'name':_0xcbd3('0x43'),'value':_0x43d9f5[_0xcbd3('0x43')]||(_0x43d9f5[_0xcbd3('0x3b')]&&_0x43d9f5[_0xcbd3('0x3b')][0x1]?_0x43d9f5['attrs'][0x1][_0xcbd3('0x3f')]:undefined)||_0xcbd3('0x44')},{'name':_0xcbd3('0x45'),'value':_0x43d9f5[_0xcbd3('0x45')]||(_0x43d9f5[_0xcbd3('0x3b')]&&_0x43d9f5[_0xcbd3('0x3b')][0x2]?_0x43d9f5[_0xcbd3('0x3b')][0x2][_0xcbd3('0x3f')]:undefined)||0xc}];case'counter':return[{'name':_0xcbd3('0x46'),'value':_0x43d9f5[_0xcbd3('0x46')]||(_0x43d9f5[_0xcbd3('0x3b')]&&_0x43d9f5[_0xcbd3('0x3b')][0x0]?_0x43d9f5[_0xcbd3('0x3b')][0x0]['value']:undefined)||_0xcbd3('0x47')},{'name':_0xcbd3('0x48'),'value':_0x43d9f5[_0xcbd3('0x48')]||(_0x43d9f5[_0xcbd3('0x3b')]&&_0x43d9f5[_0xcbd3('0x3b')][0x1]?_0x43d9f5[_0xcbd3('0x3b')][0x1]['value']:undefined)||[]},{'name':_0xcbd3('0x45'),'value':_0x43d9f5[_0xcbd3('0x45')]||(_0x43d9f5['attrs']&&_0x43d9f5[_0xcbd3('0x3b')][0x2]?_0x43d9f5[_0xcbd3('0x3b')][0x2][_0xcbd3('0x3f')]:undefined)||0x14},{'name':_0xcbd3('0x49'),'value':_0x43d9f5['attrChannel']||(_0x43d9f5['attrs']&&_0x43d9f5[_0xcbd3('0x3b')][0x3]?_0x43d9f5[_0xcbd3('0x3b')][0x3][_0xcbd3('0x3f')]:undefined)||_0xcbd3('0x4a')},{'name':_0xcbd3('0x4b'),'value':_0x43d9f5[_0xcbd3('0x4b')]||(_0x43d9f5[_0xcbd3('0x3b')]&&_0x43d9f5[_0xcbd3('0x3b')][0x4]?_0x43d9f5['attrs'][0x4][_0xcbd3('0x3f')]:undefined)||''},{'name':_0xcbd3('0x4c'),'value':_0x43d9f5[_0xcbd3('0x4c')]||(_0x43d9f5['attrs']&&_0x43d9f5[_0xcbd3('0x3b')][0x5]?_0x43d9f5[_0xcbd3('0x3b')][0x5][_0xcbd3('0x3f')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x43d9f5[_0xcbd3('0x4d')]||(_0x43d9f5[_0xcbd3('0x3b')]&&_0x43d9f5[_0xcbd3('0x3b')][0x6]?_0x43d9f5[_0xcbd3('0x3b')][0x6][_0xcbd3('0x3f')]:undefined)||''},{'name':_0xcbd3('0x4e'),'value':_0x43d9f5[_0xcbd3('0x4e')]||(_0x43d9f5[_0xcbd3('0x3b')]&&_0x43d9f5[_0xcbd3('0x3b')][0x7]?_0x43d9f5['attrs'][0x7][_0xcbd3('0x3f')]:undefined)||''},{'name':_0xcbd3('0x4f'),'value':_0x43d9f5[_0xcbd3('0x4f')]||(_0x43d9f5[_0xcbd3('0x3b')]&&_0x43d9f5['attrs'][0x8]?_0x43d9f5[_0xcbd3('0x3b')][0x8]['value']:undefined)||''},{'name':_0xcbd3('0x50'),'value':_0x43d9f5['attrChatWebsites']||(_0x43d9f5[_0xcbd3('0x3b')]&&_0x43d9f5[_0xcbd3('0x3b')][0x9]?_0x43d9f5[_0xcbd3('0x3b')][0x9]['value']:undefined)||''}];case _0xcbd3('0x51'):case _0xcbd3('0x52'):return[{'name':_0xcbd3('0x53'),'value':_0x43d9f5[_0xcbd3('0x53')]||(_0x43d9f5['attrs']&&_0x43d9f5['attrs'][0x0]?_0x43d9f5[_0xcbd3('0x3b')][0x0][_0xcbd3('0x3f')]:undefined)||_0xcbd3('0x47')},{'name':_0xcbd3('0x54'),'value':_0x43d9f5['attrSerie2']||(_0x43d9f5[_0xcbd3('0x3b')]&&_0x43d9f5['attrs'][0x1]?_0x43d9f5[_0xcbd3('0x3b')][0x1][_0xcbd3('0x3f')]:undefined)||null},{'name':'attrSerie3','value':_0x43d9f5['attrSerie3']||(_0x43d9f5[_0xcbd3('0x3b')]&&_0x43d9f5[_0xcbd3('0x3b')][0x2]?_0x43d9f5[_0xcbd3('0x3b')][0x2][_0xcbd3('0x3f')]:undefined)||null},{'name':_0xcbd3('0x48'),'value':_0x43d9f5[_0xcbd3('0x48')]||(_0x43d9f5[_0xcbd3('0x3b')]&&_0x43d9f5['attrs'][0x3]?_0x43d9f5[_0xcbd3('0x3b')][0x3][_0xcbd3('0x3f')]:undefined)||[]},{'name':'attrChannel','value':_0x43d9f5[_0xcbd3('0x49')]||(_0x43d9f5['attrs']&&_0x43d9f5[_0xcbd3('0x3b')][0x4]?_0x43d9f5[_0xcbd3('0x3b')][0x4][_0xcbd3('0x3f')]:undefined)||_0xcbd3('0x4a')},{'name':'attrEmailAccounts','value':_0x43d9f5['attrEmailAccounts']||(_0x43d9f5[_0xcbd3('0x3b')]&&_0x43d9f5[_0xcbd3('0x3b')][0x5]?_0x43d9f5[_0xcbd3('0x3b')][0x5][_0xcbd3('0x3f')]:undefined)||''},{'name':_0xcbd3('0x4c'),'value':_0x43d9f5[_0xcbd3('0x4c')]||(_0x43d9f5[_0xcbd3('0x3b')]&&_0x43d9f5[_0xcbd3('0x3b')][0x6]?_0x43d9f5[_0xcbd3('0x3b')][0x6][_0xcbd3('0x3f')]:undefined)||''},{'name':_0xcbd3('0x4d'),'value':_0x43d9f5['attrSmsAccounts']||(_0x43d9f5[_0xcbd3('0x3b')]&&_0x43d9f5[_0xcbd3('0x3b')][0x7]?_0x43d9f5['attrs'][0x7]['value']:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x43d9f5[_0xcbd3('0x4e')]||(_0x43d9f5['attrs']&&_0x43d9f5['attrs'][0x8]?_0x43d9f5[_0xcbd3('0x3b')][0x8][_0xcbd3('0x3f')]:undefined)||''},{'name':_0xcbd3('0x4f'),'value':_0x43d9f5[_0xcbd3('0x4f')]||(_0x43d9f5[_0xcbd3('0x3b')]&&_0x43d9f5[_0xcbd3('0x3b')][0x9]?_0x43d9f5[_0xcbd3('0x3b')][0x9][_0xcbd3('0x3f')]:undefined)||''},{'name':_0xcbd3('0x50'),'value':_0x43d9f5[_0xcbd3('0x50')]||(_0x43d9f5[_0xcbd3('0x3b')]&&_0x43d9f5[_0xcbd3('0x3b')][0xa]?_0x43d9f5[_0xcbd3('0x3b')][0xa][_0xcbd3('0x3f')]:undefined)||''}];case _0xcbd3('0x55'):return[{'name':_0xcbd3('0x56'),'type':_0x43d9f5[_0xcbd3('0x57')]||(_0x43d9f5[_0xcbd3('0x3b')]&&_0x43d9f5[_0xcbd3('0x3b')][0x0]?_0x43d9f5[_0xcbd3('0x3b')][0x0]['type']:undefined)||null,'value':_0x43d9f5[_0xcbd3('0x56')]||(_0x43d9f5[_0xcbd3('0x3b')]&&_0x43d9f5['attrs'][0x0]?_0x43d9f5[_0xcbd3('0x3b')][0x0][_0xcbd3('0x3f')]:undefined)||null},{'name':_0xcbd3('0x58'),'value':_0x43d9f5['attrRefresh']||(_0x43d9f5[_0xcbd3('0x3b')]&&_0x43d9f5[_0xcbd3('0x3b')][0x1]?_0x43d9f5[_0xcbd3('0x3b')][0x1][_0xcbd3('0x3f')]:undefined)||0x0}];default:return[];}}catch(_0x7827ba){logger[_0xcbd3('0x28')](_0xcbd3('0x59'),JSON[_0xcbd3('0x5a')](_0x7827ba));return[];}}exports[_0xcbd3('0x5b')]=function(_0x12bcbe,_0x35a0a0){if(_0x12bcbe['body']){_0x12bcbe['body'][_0xcbd3('0x3b')]=widgetAttributes(_0x12bcbe[_0xcbd3('0x5c')]);}return db[_0xcbd3('0x37')]['create'](_0x12bcbe[_0xcbd3('0x5c')],{})['then'](respondWithResult(_0x35a0a0,0xc9))['catch'](handleError(_0x35a0a0,null));};exports['update']=function(_0x213e93,_0x31f3c0){if(_0x213e93['body']['id']){delete _0x213e93[_0xcbd3('0x5c')]['id'];}_0x213e93[_0xcbd3('0x5c')]['attrs']=widgetAttributes(_0x213e93[_0xcbd3('0x5c')]);return db[_0xcbd3('0x37')]['find']({'where':{'id':_0x213e93[_0xcbd3('0x5d')]['id']}})['then'](handleEntityNotFound(_0x31f3c0,null))['then'](saveUpdates(_0x213e93[_0xcbd3('0x5c')],null))[_0xcbd3('0x26')](respondWithResult(_0x31f3c0,null))['catch'](handleError(_0x31f3c0,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 1af06f9..0f994d1 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 _0x03ff=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x2ec118,_0x23df2d){var _0x52735f=function(_0x5c73cd){while(--_0x5c73cd){_0x2ec118['push'](_0x2ec118['shift']());}};_0x52735f(++_0x23df2d);}(_0x03ff,0x1a8));var _0xf03f=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x03ff[_0xefd519];return _0x4bb882;};'use strict';var EventEmitter=require(_0xf03f('0x0'));var DashboardItem=require(_0xf03f('0x1'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xf03f('0x2')](0x0);var events={'afterCreate':_0xf03f('0x3'),'afterUpdate':_0xf03f('0x4'),'afterDestroy':_0xf03f('0x5')};function emitEvent(_0x12487b){return function(_0x222897,_0x2b4673,_0x1bac62){DashboardItemEvents['emit'](_0x12487b+':'+_0x222897['id'],_0x222897);DashboardItemEvents[_0xf03f('0x6')](_0x12487b,_0x222897);_0x1bac62(null);};}for(var e in events){if(events[_0xf03f('0x7')](e)){var event=events[e];DashboardItem[_0xf03f('0x8')](e,emitEvent(event));}}module[_0xf03f('0x9')]=DashboardItemEvents; \ No newline at end of file +var _0xdc1d=['DashboardItem','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x52ece1,_0x425dc5){var _0x329205=function(_0xf76c47){while(--_0xf76c47){_0x52ece1['push'](_0x52ece1['shift']());}};_0x329205(++_0x425dc5);}(_0xdc1d,0x88));var _0xddc1=function(_0x4e225a,_0x2201dd){_0x4e225a=_0x4e225a-0x0;var _0xda98f=_0xdc1d[_0x4e225a];return _0xda98f;};'use strict';var EventEmitter=require('events');var DashboardItem=require('../../mysqldb')['db'][_0xddc1('0x0')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xddc1('0x1')](0x0);var events={'afterCreate':_0xddc1('0x2'),'afterUpdate':_0xddc1('0x3'),'afterDestroy':'remove'};function emitEvent(_0x11cc02){return function(_0x5ddfa8,_0x3cd0fa,_0x514ef3){DashboardItemEvents[_0xddc1('0x4')](_0x11cc02+':'+_0x5ddfa8['id'],_0x5ddfa8);DashboardItemEvents[_0xddc1('0x4')](_0x11cc02,_0x5ddfa8);_0x514ef3(null);};}for(var e in events){if(events[_0xddc1('0x5')](e)){var event=events[e];DashboardItem[_0xddc1('0x6')](e,emitEvent(event));}}module[_0xddc1('0x7')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 8a53190..c9b0cec 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 _0x2f5a=['DashboardItem','dashboard_items','util','api','moment','bluebird','path','rimraf','../../config/environment','exports','define'];(function(_0x575045,_0x1c2016){var _0x2d73d5=function(_0x58ac00){while(--_0x58ac00){_0x575045['push'](_0x575045['shift']());}};_0x2d73d5(++_0x1c2016);}(_0x2f5a,0x1e6));var _0xa2f5=function(_0x1fa007,_0x5d3503){_0x1fa007=_0x1fa007-0x0;var _0x24a0c2=_0x2f5a[_0x1fa007];return _0x24a0c2;};'use strict';var _=require('lodash');var util=require(_0xa2f5('0x0'));var logger=require('../../config/logger')(_0xa2f5('0x1'));var moment=require(_0xa2f5('0x2'));var BPromise=require(_0xa2f5('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa2f5('0x4'));var rimraf=require(_0xa2f5('0x5'));var config=require(_0xa2f5('0x6'));var attributes=require('./dashboardItem.attributes');module[_0xa2f5('0x7')]=function(_0x210ca5,_0x58450b){return _0x210ca5[_0xa2f5('0x8')](_0xa2f5('0x9'),attributes,{'tableName':_0xa2f5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x53cf=['exports','define','DashboardItem','dashboard_items','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./dashboardItem.attributes'];(function(_0x5da0d9,_0x49ee54){var _0x4b6d2f=function(_0x9832cf){while(--_0x9832cf){_0x5da0d9['push'](_0x5da0d9['shift']());}};_0x4b6d2f(++_0x49ee54);}(_0x53cf,0xd4));var _0xf53c=function(_0x2a98c3,_0x461c43){_0x2a98c3=_0x2a98c3-0x0;var _0x1e227b=_0x53cf[_0x2a98c3];return _0x1e227b;};'use strict';var _=require(_0xf53c('0x0'));var util=require(_0xf53c('0x1'));var logger=require('../../config/logger')(_0xf53c('0x2'));var moment=require(_0xf53c('0x3'));var BPromise=require(_0xf53c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf53c('0x5'));var rimraf=require(_0xf53c('0x6'));var config=require(_0xf53c('0x7'));var attributes=require(_0xf53c('0x8'));module[_0xf53c('0x9')]=function(_0x3f9a3f,_0x427a48){return _0x3f9a3f[_0xf53c('0xa')](_0xf53c('0xb'),attributes,{'tableName':_0xf53c('0xc'),'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 a7bfc35..40ffc8a 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 _0x9b83=['./dashboardItem.socket','register','request','info','request\x20sent','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','DashboardItem,\x20%s,\x20%s','message','result','catch','moment','bluebird','ioredis','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter'];(function(_0x59ecc3,_0x5b635d){var _0x1ee91f=function(_0x2621ee){while(--_0x2621ee){_0x59ecc3['push'](_0x59ecc3['shift']());}};_0x1ee91f(++_0x5b635d);}(_0x9b83,0x16c));var _0x39b8=function(_0xe66cf2,_0x32ba5f){_0xe66cf2=_0xe66cf2-0x0;var _0x2d84e7=_0x9b83[_0xe66cf2];return _0x2d84e7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x39b8('0x0'));var BPromise=require(_0x39b8('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x39b8('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x39b8('0x3'));var jayson=require(_0x39b8('0x4'));var client=jayson[_0x39b8('0x5')][_0x39b8('0x6')]({'port':0x232a});config[_0x39b8('0x7')]=_[_0x39b8('0x8')](config[_0x39b8('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x39b8('0x9'))(new Redis(config[_0x39b8('0x7')]));require(_0x39b8('0xa'))[_0x39b8('0xb')](socket);function respondWithRpcPromise(_0x2c8555,_0x458c09,_0x46ec8e){return new BPromise(function(_0x462257,_0x235e0c){return client[_0x39b8('0xc')](_0x2c8555,_0x46ec8e)['then'](function(_0x500827){logger[_0x39b8('0xd')]('DashboardItem,\x20%s,\x20%s',_0x458c09,_0x39b8('0xe'));logger['debug'](_0x39b8('0xf'),_0x458c09,'request\x20sent',JSON[_0x39b8('0x10')](_0x500827));if(_0x500827[_0x39b8('0x11')]){if(_0x500827[_0x39b8('0x11')]['code']===0x1f4){logger[_0x39b8('0x11')](_0x39b8('0x12'),_0x458c09,_0x500827[_0x39b8('0x11')][_0x39b8('0x13')]);return _0x235e0c(_0x500827[_0x39b8('0x11')][_0x39b8('0x13')]);}logger['error'](_0x39b8('0x12'),_0x458c09,_0x500827[_0x39b8('0x11')][_0x39b8('0x13')]);return _0x462257(_0x500827[_0x39b8('0x11')][_0x39b8('0x13')]);}else{logger[_0x39b8('0xd')](_0x39b8('0x12'),_0x458c09,_0x39b8('0xe'));_0x462257(_0x500827[_0x39b8('0x14')][_0x39b8('0x13')]);}})[_0x39b8('0x15')](function(_0x3ed242){logger[_0x39b8('0x11')](_0x39b8('0x12'),_0x458c09,_0x3ed242);_0x235e0c(_0x3ed242);});});} \ No newline at end of file +var _0xaef0=['request','then','info','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','DashboardItem,\x20%s,\x20%s','message','lodash','util','randomstring','../../config/utils','rpc','../../config/environment','http','redis','localhost','socket.io-emitter','./dashboardItem.socket','register'];(function(_0x1d9549,_0x28aead){var _0x33590a=function(_0x3c611a){while(--_0x3c611a){_0x1d9549['push'](_0x1d9549['shift']());}};_0x33590a(++_0x28aead);}(_0xaef0,0x95));var _0x0aef=function(_0x3474ac,_0x22d0f7){_0x3474ac=_0x3474ac-0x0;var _0x5345ec=_0xaef0[_0x3474ac];return _0x5345ec;};'use strict';var _=require(_0x0aef('0x0'));var util=require(_0x0aef('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0aef('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0aef('0x3'));var logger=require('../../config/logger')(_0x0aef('0x4'));var config=require(_0x0aef('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0aef('0x6')]({'port':0x232a});config[_0x0aef('0x7')]=_['defaults'](config[_0x0aef('0x7')],{'host':_0x0aef('0x8'),'port':0x18eb});var socket=require(_0x0aef('0x9'))(new Redis(config[_0x0aef('0x7')]));require(_0x0aef('0xa'))[_0x0aef('0xb')](socket);function respondWithRpcPromise(_0x235f04,_0x26e573,_0x1729d7){return new BPromise(function(_0x240bf4,_0x21ba1d){return client[_0x0aef('0xc')](_0x235f04,_0x1729d7)[_0x0aef('0xd')](function(_0x24ecd0){logger[_0x0aef('0xe')]('DashboardItem,\x20%s,\x20%s',_0x26e573,_0x0aef('0xf'));logger[_0x0aef('0x10')](_0x0aef('0x11'),_0x26e573,_0x0aef('0xf'),JSON[_0x0aef('0x12')](_0x24ecd0));if(_0x24ecd0[_0x0aef('0x13')]){if(_0x24ecd0[_0x0aef('0x13')][_0x0aef('0x14')]===0x1f4){logger[_0x0aef('0x13')](_0x0aef('0x15'),_0x26e573,_0x24ecd0['error'][_0x0aef('0x16')]);return _0x21ba1d(_0x24ecd0[_0x0aef('0x13')][_0x0aef('0x16')]);}logger['error'](_0x0aef('0x15'),_0x26e573,_0x24ecd0['error'][_0x0aef('0x16')]);return _0x240bf4(_0x24ecd0[_0x0aef('0x13')]['message']);}else{logger[_0x0aef('0xe')](_0x0aef('0x15'),_0x26e573,_0x0aef('0xf'));_0x240bf4(_0x24ecd0['result'][_0x0aef('0x16')]);}})['catch'](function(_0x2c93d1){logger[_0x0aef('0x13')](_0x0aef('0x15'),_0x26e573,_0x2c93d1);_0x21ba1d(_0x2c93d1);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index a6185d9..bc93f23 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 _0xfee0=['update','emit','register','dashboardItem:','./dashboardItem.events','save','remove'];(function(_0x58a09c,_0x5a3c28){var _0x157cb9=function(_0x58d28a){while(--_0x58d28a){_0x58a09c['push'](_0x58a09c['shift']());}};_0x157cb9(++_0x5a3c28);}(_0xfee0,0x90));var _0x0fee=function(_0x557f77,_0x2ff13f){_0x557f77=_0x557f77-0x0;var _0x166ce5=_0xfee0[_0x557f77];return _0x166ce5;};'use strict';var DashboardItemEvents=require(_0x0fee('0x0'));var events=[_0x0fee('0x1'),_0x0fee('0x2'),_0x0fee('0x3')];function createListener(_0x301946,_0xb24517){return function(_0x2bb53a){_0xb24517[_0x0fee('0x4')](_0x301946,_0x2bb53a);};}function removeListener(_0xfa00a,_0x42c8b4){return function(){DashboardItemEvents['removeListener'](_0xfa00a,_0x42c8b4);};}exports[_0x0fee('0x5')]=function(_0x35dabb){for(var _0xbd3028=0x0,_0x938379=events['length'];_0xbd3028<_0x938379;_0xbd3028++){var _0x2dbef3=events[_0xbd3028];var _0xf5d2b3=createListener(_0x0fee('0x6')+_0x2dbef3,_0x35dabb);DashboardItemEvents['on'](_0x2dbef3,_0xf5d2b3);}}; \ No newline at end of file +var _0x63f2=['removeListener','register','./dashboardItem.events','update'];(function(_0x2ce42d,_0x48f144){var _0x1593eb=function(_0x2782dc){while(--_0x2782dc){_0x2ce42d['push'](_0x2ce42d['shift']());}};_0x1593eb(++_0x48f144);}(_0x63f2,0x10a));var _0x263f=function(_0x257c83,_0x87a0a1){_0x257c83=_0x257c83-0x0;var _0x3abc1e=_0x63f2[_0x257c83];return _0x3abc1e;};'use strict';var DashboardItemEvents=require(_0x263f('0x0'));var events=['save','remove',_0x263f('0x1')];function createListener(_0x473830,_0x10a90b){return function(_0x17c39c){_0x10a90b['emit'](_0x473830,_0x17c39c);};}function removeListener(_0x5cce3b,_0x1e3168){return function(){DashboardItemEvents[_0x263f('0x2')](_0x5cce3b,_0x1e3168);};}exports[_0x263f('0x3')]=function(_0x303dd6){for(var _0x56adec=0x0,_0x157c29=events['length'];_0x56adec<_0x157c29;_0x56adec++){var _0x82c66f=events[_0x56adec];var _0x26b505=createListener('dashboardItem:'+_0x82c66f,_0x303dd6);DashboardItemEvents['on'](_0x82c66f,_0x26b505);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 24dc6dd..c9a2ef1 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 _0x3238=['./dashboardItem.controller','get','isAuthenticated','show','post','create','put','update','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x57f340,_0x63f729){var _0x49ee30=function(_0x2f2a11){while(--_0x2f2a11){_0x57f340['push'](_0x57f340['shift']());}};_0x49ee30(++_0x63f729);}(_0x3238,0x97));var _0x8323=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3238[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x8323('0x0'));var util=require(_0x8323('0x1'));var path=require(_0x8323('0x2'));var timeout=require(_0x8323('0x3'));var express=require(_0x8323('0x4'));var router=express[_0x8323('0x5')]();var fs_extra=require(_0x8323('0x6'));var auth=require(_0x8323('0x7'));var interaction=require(_0x8323('0x8'));var config=require('../../config/environment');var controller=require(_0x8323('0x9'));router[_0x8323('0xa')]('/:id',auth[_0x8323('0xb')](),controller[_0x8323('0xc')]);router[_0x8323('0xd')]('/',auth[_0x8323('0xb')](),controller[_0x8323('0xe')]);router[_0x8323('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x8323('0x10')]);router['delete'](_0x8323('0x11'),auth[_0x8323('0xb')](),controller[_0x8323('0x12')]);module[_0x8323('0x13')]=router; \ No newline at end of file +var _0x2dd3=['isAuthenticated','/:id','update','destroy','exports','multer','path','express','../../config/environment','./dashboardItem.controller','get','show','post'];(function(_0x9606da,_0x299242){var _0x2be444=function(_0x157bae){while(--_0x157bae){_0x9606da['push'](_0x9606da['shift']());}};_0x2be444(++_0x299242);}(_0x2dd3,0x198));var _0x32dd=function(_0x52f86e,_0x47bb68){_0x52f86e=_0x52f86e-0x0;var _0x2bdebd=_0x2dd3[_0x52f86e];return _0x2bdebd;};'use strict';var multer=require(_0x32dd('0x0'));var util=require('util');var path=require(_0x32dd('0x1'));var timeout=require('connect-timeout');var express=require(_0x32dd('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x32dd('0x3'));var controller=require(_0x32dd('0x4'));router[_0x32dd('0x5')]('/:id',auth['isAuthenticated'](),controller[_0x32dd('0x6')]);router[_0x32dd('0x7')]('/',auth[_0x32dd('0x8')](),controller['create']);router['put'](_0x32dd('0x9'),auth[_0x32dd('0x8')](),controller[_0x32dd('0xa')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x32dd('0xb')]);module[_0x32dd('0xc')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 8a9cfc4..224bcf5 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 _0x9150=['second','third','sequelize','exports','STRING','first'];(function(_0x301c60,_0xcb7733){var _0x2b5357=function(_0x58bb19){while(--_0x58bb19){_0x301c60['push'](_0x301c60['shift']());}};_0x2b5357(++_0xcb7733);}(_0x9150,0xbc));var _0x0915=function(_0x13e042,_0x2ef7ae){_0x13e042=_0x13e042-0x0;var _0x5a2071=_0x9150[_0x13e042];return _0x5a2071;};'use strict';var Sequelize=require(_0x0915('0x0'));module[_0x0915('0x1')]={'name':{'type':Sequelize[_0x0915('0x2')],'allowNull':![]},'level':{'type':Sequelize['ENUM'](_0x0915('0x3'),_0x0915('0x4'),_0x0915('0x5')),'allowNull':![],'defaultValue':_0x0915('0x3')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0f97=['STRING','ENUM','first','sequelize','exports'];(function(_0x5db906,_0x79f1e3){var _0x42efd3=function(_0x4011b9){while(--_0x4011b9){_0x5db906['push'](_0x5db906['shift']());}};_0x42efd3(++_0x79f1e3);}(_0x0f97,0x1e8));var _0x70f9=function(_0x38a3d6,_0x52e305){_0x38a3d6=_0x38a3d6-0x0;var _0x3768d7=_0x0f97[_0x38a3d6];return _0x3768d7;};'use strict';var Sequelize=require(_0x70f9('0x0'));module[_0x70f9('0x1')]={'name':{'type':Sequelize[_0x70f9('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0x70f9('0x3')](_0x70f9('0x4'),'second','third'),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize[_0x70f9('0x2')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 02a6da2..1a156d3 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 _0xec30=['fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','params','include','find','create','body','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','end','status','json','limit','count','offset','set','Content-Range','reject','update','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','send','index','Disposition','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes'];(function(_0x219379,_0x53362a){var _0x57fa33=function(_0x98d5d3){while(--_0x98d5d3){_0x219379['push'](_0x219379['shift']());}};_0x57fa33(++_0x53362a);}(_0xec30,0xf9));var _0x0ec3=function(_0x360f17,_0xf88d45){_0x360f17=_0x360f17-0x0;var _0x128eb3=_0xec30[_0x360f17];return _0x128eb3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0ec3('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0ec3('0x1'));var rp=require('request-promise');var moment=require(_0x0ec3('0x2'));var BPromise=require(_0x0ec3('0x3'));var Mustache=require('mustache');var util=require(_0x0ec3('0x4'));var path=require(_0x0ec3('0x5'));var sox=require(_0x0ec3('0x6'));var csv=require(_0x0ec3('0x7'));var ejs=require(_0x0ec3('0x8'));var fs=require('fs');var fs_extra=require(_0x0ec3('0x9'));var _=require(_0x0ec3('0xa'));var squel=require(_0x0ec3('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0ec3('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0ec3('0xc'));var qs=require(_0x0ec3('0xd'));var as=require(_0x0ec3('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0ec3('0xf'))('api');var utils=require(_0x0ec3('0x10'));var config=require(_0x0ec3('0x11'));var licenseUtil=require(_0x0ec3('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x433dc0,_0x5b83ca){_0x5b83ca=_0x5b83ca||0xcc;return function(_0x1b6d68){if(_0x1b6d68){return _0x433dc0['sendStatus'](_0x5b83ca);}return _0x433dc0['status'](_0x5b83ca)[_0x0ec3('0x13')]();};}function respondWithResult(_0x222998,_0x569f5c){_0x569f5c=_0x569f5c||0xc8;return function(_0x2ba033){if(_0x2ba033){return _0x222998[_0x0ec3('0x14')](_0x569f5c)[_0x0ec3('0x15')](_0x2ba033);}};}function respondWithFilteredResult(_0x308dfd,_0x243293){return function(_0x256a3){if(_0x256a3){var _0x3b8f66=typeof _0x243293['offset']==='undefined'&&typeof _0x243293[_0x0ec3('0x16')]==='undefined';var _0xd9daee=_0x256a3[_0x0ec3('0x17')];var _0x35bc1a=_0x3b8f66?0x0:_0x243293['offset'];var _0x4fe11f=_0x3b8f66?_0x256a3[_0x0ec3('0x17')]:_0x243293[_0x0ec3('0x18')]+_0x243293[_0x0ec3('0x16')];var _0x339b50;if(_0x4fe11f>=_0xd9daee){_0x4fe11f=_0xd9daee;_0x339b50=0xc8;}else{_0x339b50=0xce;}_0x308dfd['status'](_0x339b50);return _0x308dfd[_0x0ec3('0x19')](_0x0ec3('0x1a'),_0x35bc1a+'-'+_0x4fe11f+'/'+_0xd9daee)['json'](_0x256a3);}return null;};}function patchUpdates(_0x2d5a44){return function(_0x45ab45){try{jsonpatch['apply'](_0x45ab45,_0x2d5a44,!![]);}catch(_0x49f903){return BPromise[_0x0ec3('0x1b')](_0x49f903);}return _0x45ab45['save']();};}function saveUpdates(_0x38a422,_0x2f0af6){return function(_0x3c3fe1){if(_0x3c3fe1){return _0x3c3fe1[_0x0ec3('0x1c')](_0x38a422)[_0x0ec3('0x1d')](function(_0x6d32e4){return _0x6d32e4;});}return null;};}function removeEntity(_0x5ee92e,_0x2834bc){return function(_0x3070e6){if(_0x3070e6){return _0x3070e6[_0x0ec3('0x1e')]()[_0x0ec3('0x1d')](function(){var _0x78a803=_0x3070e6[_0x0ec3('0x1f')]({'plain':!![]});var _0xe3219f='Dispositions';return db[_0x0ec3('0x20')]['destroy']({'where':{'type':_0xe3219f,'resourceId':_0x78a803['id']}})['then'](function(){return _0x3070e6;});})[_0x0ec3('0x1d')](function(){_0x5ee92e['status'](0xcc)[_0x0ec3('0x13')]();});}};}function handleEntityNotFound(_0x53cef5,_0x18542a){return function(_0x44180b){if(!_0x44180b){_0x53cef5[_0x0ec3('0x21')](0x194);}return _0x44180b;};}function handleError(_0x3fc05f,_0x59aa44){_0x59aa44=_0x59aa44||0x1f4;return function(_0x80f387){logger[_0x0ec3('0x22')](_0x80f387[_0x0ec3('0x23')]);if(_0x80f387[_0x0ec3('0x24')]){delete _0x80f387[_0x0ec3('0x24')];}_0x3fc05f[_0x0ec3('0x14')](_0x59aa44)[_0x0ec3('0x25')](_0x80f387);};}exports[_0x0ec3('0x26')]=function(_0x1ef362,_0x592e99){var _0x130938={},_0x59bdda={},_0x111d1b={'count':0x0,'rows':[]};var _0x3e8c09=_['map'](db[_0x0ec3('0x27')][_0x0ec3('0x28')],function(_0xa72ecd){return{'name':_0xa72ecd[_0x0ec3('0x29')],'type':_0xa72ecd[_0x0ec3('0x2a')][_0x0ec3('0x2b')]};});_0x59bdda[_0x0ec3('0x2c')]=_[_0x0ec3('0x2d')](_0x3e8c09,_0x0ec3('0x24'));_0x59bdda[_0x0ec3('0x2e')]=_[_0x0ec3('0x2f')](_0x1ef362[_0x0ec3('0x2e')]);_0x59bdda[_0x0ec3('0x30')]=_[_0x0ec3('0x31')](_0x59bdda['model'],_0x59bdda['query']);_0x130938[_0x0ec3('0x32')]=_['intersection'](_0x59bdda['model'],qs[_0x0ec3('0x33')](_0x1ef362['query'][_0x0ec3('0x33')]));_0x130938['attributes']=_0x130938['attributes'][_0x0ec3('0x34')]?_0x130938['attributes']:_0x59bdda['model'];if(!_0x1ef362[_0x0ec3('0x2e')][_0x0ec3('0x35')]('nolimit')){_0x130938['limit']=qs[_0x0ec3('0x16')](_0x1ef362[_0x0ec3('0x2e')][_0x0ec3('0x16')]);_0x130938[_0x0ec3('0x18')]=qs['offset'](_0x1ef362[_0x0ec3('0x2e')][_0x0ec3('0x18')]);}_0x130938[_0x0ec3('0x36')]=qs[_0x0ec3('0x37')](_0x1ef362['query']['sort']);_0x130938[_0x0ec3('0x38')]=qs['filters'](_[_0x0ec3('0x39')](_0x1ef362[_0x0ec3('0x2e')],_0x59bdda[_0x0ec3('0x30')]),_0x3e8c09);if(_0x1ef362[_0x0ec3('0x2e')][_0x0ec3('0x3a')]){_0x130938[_0x0ec3('0x38')]=_[_0x0ec3('0x3b')](_0x130938[_0x0ec3('0x38')],{'$or':_[_0x0ec3('0x2d')](_0x3e8c09,function(_0x4a619c){if(_0x4a619c['type']!==_0x0ec3('0x3c')){var _0x295ca5={};_0x295ca5[_0x4a619c[_0x0ec3('0x24')]]={'$like':'%'+_0x1ef362[_0x0ec3('0x2e')][_0x0ec3('0x3a')]+'%'};return _0x295ca5;}})});}_0x130938=_[_0x0ec3('0x3b')]({},_0x130938,_0x1ef362[_0x0ec3('0x3d')]);var _0xa63fd={'where':_0x130938[_0x0ec3('0x38')]};return db[_0x0ec3('0x27')][_0x0ec3('0x17')](_0xa63fd)[_0x0ec3('0x1d')](function(_0xf6144){_0x111d1b['count']=_0xf6144;if(_0x1ef362[_0x0ec3('0x2e')]['includeAll']){_0x130938['include']=[{'all':!![]}];}return db[_0x0ec3('0x27')][_0x0ec3('0x3e')](_0x130938);})[_0x0ec3('0x1d')](function(_0x17fa42){_0x111d1b[_0x0ec3('0x3f')]=_0x17fa42;return _0x111d1b;})[_0x0ec3('0x1d')](respondWithFilteredResult(_0x592e99,_0x130938))[_0x0ec3('0x40')](handleError(_0x592e99,null));};exports['show']=function(_0x13c902,_0x399070){var _0x476c1c={'raw':!![],'where':{'id':_0x13c902[_0x0ec3('0x41')]['id']}},_0x40994c={};_0x40994c[_0x0ec3('0x2c')]=_['keys'](db[_0x0ec3('0x27')][_0x0ec3('0x28')]);_0x40994c[_0x0ec3('0x2e')]=_[_0x0ec3('0x2f')](_0x13c902[_0x0ec3('0x2e')]);_0x40994c[_0x0ec3('0x30')]=_[_0x0ec3('0x31')](_0x40994c[_0x0ec3('0x2c')],_0x40994c[_0x0ec3('0x2e')]);_0x476c1c[_0x0ec3('0x32')]=_[_0x0ec3('0x31')](_0x40994c[_0x0ec3('0x2c')],qs[_0x0ec3('0x33')](_0x13c902['query'][_0x0ec3('0x33')]));_0x476c1c[_0x0ec3('0x32')]=_0x476c1c[_0x0ec3('0x32')][_0x0ec3('0x34')]?_0x476c1c[_0x0ec3('0x32')]:_0x40994c[_0x0ec3('0x2c')];if(_0x13c902[_0x0ec3('0x2e')]['includeAll']){_0x476c1c[_0x0ec3('0x42')]=[{'all':!![]}];}_0x476c1c=_[_0x0ec3('0x3b')]({},_0x476c1c,_0x13c902[_0x0ec3('0x3d')]);return db[_0x0ec3('0x27')][_0x0ec3('0x43')](_0x476c1c)[_0x0ec3('0x1d')](handleEntityNotFound(_0x399070,null))[_0x0ec3('0x1d')](respondWithResult(_0x399070,null))[_0x0ec3('0x40')](handleError(_0x399070,null));};exports[_0x0ec3('0x44')]=function(_0xa4de05,_0x12cc27){return db['Disposition'][_0x0ec3('0x44')](_0xa4de05[_0x0ec3('0x45')],{})['then'](function(_0x574018){var _0x3b7b1f=_0xa4de05[_0x0ec3('0x46')][_0x0ec3('0x1f')]({'plain':!![]});if(!_0x3b7b1f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3b7b1f['role']===_0x0ec3('0x46')){var _0x2b5a3d=_0x574018['get']({'plain':!![]});var _0x462fdc='Dispositions';return db[_0x0ec3('0x47')][_0x0ec3('0x43')]({'where':{'name':_0x462fdc,'userProfileId':_0x3b7b1f[_0x0ec3('0x48')]},'raw':!![]})[_0x0ec3('0x1d')](function(_0x1e5fd0){if(_0x1e5fd0&&_0x1e5fd0[_0x0ec3('0x49')]===0x0){return db[_0x0ec3('0x20')]['create']({'name':_0x2b5a3d['name'],'resourceId':_0x2b5a3d['id'],'type':_0x1e5fd0[_0x0ec3('0x24')],'sectionId':_0x1e5fd0['id']},{})[_0x0ec3('0x1d')](function(){return _0x574018;});}else{return _0x574018;}})[_0x0ec3('0x40')](function(_0x520acf){logger[_0x0ec3('0x22')](_0x0ec3('0x4a'),_0x520acf);throw _0x520acf;});}return _0x574018;})[_0x0ec3('0x1d')](respondWithResult(_0x12cc27,0xc9))['catch'](handleError(_0x12cc27,null));};exports[_0x0ec3('0x1c')]=function(_0x1ee75c,_0xdd5ce1){if(_0x1ee75c[_0x0ec3('0x45')]['id']){delete _0x1ee75c[_0x0ec3('0x45')]['id'];}return db['Disposition'][_0x0ec3('0x43')]({'where':{'id':_0x1ee75c[_0x0ec3('0x41')]['id']}})[_0x0ec3('0x1d')](handleEntityNotFound(_0xdd5ce1,null))[_0x0ec3('0x1d')](saveUpdates(_0x1ee75c[_0x0ec3('0x45')],null))['then'](respondWithResult(_0xdd5ce1,null))[_0x0ec3('0x40')](handleError(_0xdd5ce1,null));};exports[_0x0ec3('0x1e')]=function(_0xd38523,_0x1f7049){return db[_0x0ec3('0x27')][_0x0ec3('0x43')]({'where':{'id':_0xd38523[_0x0ec3('0x41')]['id']}})[_0x0ec3('0x1d')](handleEntityNotFound(_0x1f7049,null))[_0x0ec3('0x1d')](removeEntity(_0x1f7049,null))[_0x0ec3('0x40')](handleError(_0x1f7049,null));}; \ No newline at end of file +var _0xdeb6=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','get','Dispositions','end','sendStatus','error','stack','name','send','index','map','Disposition','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','rawAttributes','find','create','body'];(function(_0x4c4f89,_0x5ec4af){var _0x5dd78e=function(_0x4fdd7f){while(--_0x4fdd7f){_0x4c4f89['push'](_0x4c4f89['shift']());}};_0x5dd78e(++_0x5ec4af);}(_0xdeb6,0x114));var _0x6deb=function(_0x12f451,_0x3b618f){_0x12f451=_0x12f451-0x0;var _0x5e9589=_0xdeb6[_0x12f451];return _0x5e9589;};'use strict';var emlformat=require(_0x6deb('0x0'));var rimraf=require(_0x6deb('0x1'));var zipdir=require(_0x6deb('0x2'));var jsonpatch=require(_0x6deb('0x3'));var rp=require(_0x6deb('0x4'));var moment=require(_0x6deb('0x5'));var BPromise=require(_0x6deb('0x6'));var Mustache=require(_0x6deb('0x7'));var util=require(_0x6deb('0x8'));var path=require(_0x6deb('0x9'));var sox=require(_0x6deb('0xa'));var csv=require(_0x6deb('0xb'));var ejs=require(_0x6deb('0xc'));var fs=require('fs');var fs_extra=require(_0x6deb('0xd'));var _=require(_0x6deb('0xe'));var squel=require(_0x6deb('0xf'));var crypto=require(_0x6deb('0x10'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6deb('0x11'));var Papa=require('papaparse');var Redis=require(_0x6deb('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6deb('0x13'));var hardwareService=require(_0x6deb('0x14'));var logger=require(_0x6deb('0x15'))(_0x6deb('0x16'));var utils=require(_0x6deb('0x17'));var config=require(_0x6deb('0x18'));var licenseUtil=require(_0x6deb('0x19'));var db=require(_0x6deb('0x1a'))['db'];function respondWithStatusCode(_0x30d081,_0x4a7bb2){_0x4a7bb2=_0x4a7bb2||0xcc;return function(_0x992af8){if(_0x992af8){return _0x30d081['sendStatus'](_0x4a7bb2);}return _0x30d081[_0x6deb('0x1b')](_0x4a7bb2)['end']();};}function respondWithResult(_0x10ab7e,_0xd05a14){_0xd05a14=_0xd05a14||0xc8;return function(_0x122ccc){if(_0x122ccc){return _0x10ab7e[_0x6deb('0x1b')](_0xd05a14)[_0x6deb('0x1c')](_0x122ccc);}};}function respondWithFilteredResult(_0x22dde3,_0x2bb086){return function(_0x152b5c){if(_0x152b5c){var _0x3a9906=typeof _0x2bb086[_0x6deb('0x1d')]==='undefined'&&typeof _0x2bb086[_0x6deb('0x1e')]===_0x6deb('0x1f');var _0x19df68=_0x152b5c[_0x6deb('0x20')];var _0x27aee0=_0x3a9906?0x0:_0x2bb086['offset'];var _0x22ae7d=_0x3a9906?_0x152b5c[_0x6deb('0x20')]:_0x2bb086['offset']+_0x2bb086['limit'];var _0x2d379e;if(_0x22ae7d>=_0x19df68){_0x22ae7d=_0x19df68;_0x2d379e=0xc8;}else{_0x2d379e=0xce;}_0x22dde3[_0x6deb('0x1b')](_0x2d379e);return _0x22dde3[_0x6deb('0x21')](_0x6deb('0x22'),_0x27aee0+'-'+_0x22ae7d+'/'+_0x19df68)[_0x6deb('0x1c')](_0x152b5c);}return null;};}function patchUpdates(_0x234eed){return function(_0x3d2e59){try{jsonpatch[_0x6deb('0x23')](_0x3d2e59,_0x234eed,!![]);}catch(_0x54d210){return BPromise[_0x6deb('0x24')](_0x54d210);}return _0x3d2e59[_0x6deb('0x25')]();};}function saveUpdates(_0x3afda7,_0x4270b){return function(_0x451e45){if(_0x451e45){return _0x451e45['update'](_0x3afda7)[_0x6deb('0x26')](function(_0x3c2dbb){return _0x3c2dbb;});}return null;};}function removeEntity(_0x458ee3,_0x14d795){return function(_0x509b66){if(_0x509b66){return _0x509b66[_0x6deb('0x27')]()[_0x6deb('0x26')](function(){var _0x2ea324=_0x509b66[_0x6deb('0x28')]({'plain':!![]});var _0x391614=_0x6deb('0x29');return db['UserProfileResource'][_0x6deb('0x27')]({'where':{'type':_0x391614,'resourceId':_0x2ea324['id']}})[_0x6deb('0x26')](function(){return _0x509b66;});})[_0x6deb('0x26')](function(){_0x458ee3['status'](0xcc)[_0x6deb('0x2a')]();});}};}function handleEntityNotFound(_0x2ee6a5,_0x2175b7){return function(_0x4f0ead){if(!_0x4f0ead){_0x2ee6a5[_0x6deb('0x2b')](0x194);}return _0x4f0ead;};}function handleError(_0x4d3cd0,_0x2def2b){_0x2def2b=_0x2def2b||0x1f4;return function(_0x3d015a){logger[_0x6deb('0x2c')](_0x3d015a[_0x6deb('0x2d')]);if(_0x3d015a[_0x6deb('0x2e')]){delete _0x3d015a[_0x6deb('0x2e')];}_0x4d3cd0[_0x6deb('0x1b')](_0x2def2b)[_0x6deb('0x2f')](_0x3d015a);};}exports[_0x6deb('0x30')]=function(_0x572e0f,_0x2fcc01){var _0x5baff3={},_0x364cc1={},_0xedf36d={'count':0x0,'rows':[]};var _0x1b33da=_[_0x6deb('0x31')](db[_0x6deb('0x32')]['rawAttributes'],function(_0x3f442b){return{'name':_0x3f442b[_0x6deb('0x33')],'type':_0x3f442b[_0x6deb('0x34')]['key']};});_0x364cc1[_0x6deb('0x35')]=_[_0x6deb('0x31')](_0x1b33da,_0x6deb('0x2e'));_0x364cc1[_0x6deb('0x36')]=_['keys'](_0x572e0f[_0x6deb('0x36')]);_0x364cc1['filters']=_[_0x6deb('0x37')](_0x364cc1[_0x6deb('0x35')],_0x364cc1[_0x6deb('0x36')]);_0x5baff3[_0x6deb('0x38')]=_['intersection'](_0x364cc1[_0x6deb('0x35')],qs[_0x6deb('0x39')](_0x572e0f[_0x6deb('0x36')]['fields']));_0x5baff3[_0x6deb('0x38')]=_0x5baff3[_0x6deb('0x38')][_0x6deb('0x3a')]?_0x5baff3['attributes']:_0x364cc1[_0x6deb('0x35')];if(!_0x572e0f[_0x6deb('0x36')][_0x6deb('0x3b')](_0x6deb('0x3c'))){_0x5baff3[_0x6deb('0x1e')]=qs['limit'](_0x572e0f[_0x6deb('0x36')][_0x6deb('0x1e')]);_0x5baff3[_0x6deb('0x1d')]=qs[_0x6deb('0x1d')](_0x572e0f['query'][_0x6deb('0x1d')]);}_0x5baff3[_0x6deb('0x3d')]=qs['sort'](_0x572e0f[_0x6deb('0x36')]['sort']);_0x5baff3[_0x6deb('0x3e')]=qs[_0x6deb('0x3f')](_[_0x6deb('0x40')](_0x572e0f[_0x6deb('0x36')],_0x364cc1[_0x6deb('0x3f')]),_0x1b33da);if(_0x572e0f['query'][_0x6deb('0x41')]){_0x5baff3[_0x6deb('0x3e')]=_[_0x6deb('0x42')](_0x5baff3[_0x6deb('0x3e')],{'$or':_[_0x6deb('0x31')](_0x1b33da,function(_0x30397a){if(_0x30397a[_0x6deb('0x34')]!==_0x6deb('0x43')){var _0x4d24d9={};_0x4d24d9[_0x30397a[_0x6deb('0x2e')]]={'$like':'%'+_0x572e0f[_0x6deb('0x36')][_0x6deb('0x41')]+'%'};return _0x4d24d9;}})});}_0x5baff3=_['merge']({},_0x5baff3,_0x572e0f[_0x6deb('0x44')]);var _0x2dab68={'where':_0x5baff3[_0x6deb('0x3e')]};return db[_0x6deb('0x32')][_0x6deb('0x20')](_0x2dab68)[_0x6deb('0x26')](function(_0x557225){_0xedf36d[_0x6deb('0x20')]=_0x557225;if(_0x572e0f['query'][_0x6deb('0x45')]){_0x5baff3[_0x6deb('0x46')]=[{'all':!![]}];}return db[_0x6deb('0x32')][_0x6deb('0x47')](_0x5baff3);})[_0x6deb('0x26')](function(_0xe2422b){_0xedf36d[_0x6deb('0x48')]=_0xe2422b;return _0xedf36d;})['then'](respondWithFilteredResult(_0x2fcc01,_0x5baff3))[_0x6deb('0x49')](handleError(_0x2fcc01,null));};exports[_0x6deb('0x4a')]=function(_0x5ee112,_0x354059){var _0x3983f3={'raw':!![],'where':{'id':_0x5ee112['params']['id']}},_0x1884e4={};_0x1884e4[_0x6deb('0x35')]=_[_0x6deb('0x4b')](db[_0x6deb('0x32')][_0x6deb('0x4c')]);_0x1884e4[_0x6deb('0x36')]=_[_0x6deb('0x4b')](_0x5ee112[_0x6deb('0x36')]);_0x1884e4[_0x6deb('0x3f')]=_[_0x6deb('0x37')](_0x1884e4[_0x6deb('0x35')],_0x1884e4[_0x6deb('0x36')]);_0x3983f3[_0x6deb('0x38')]=_[_0x6deb('0x37')](_0x1884e4[_0x6deb('0x35')],qs[_0x6deb('0x39')](_0x5ee112[_0x6deb('0x36')]['fields']));_0x3983f3['attributes']=_0x3983f3[_0x6deb('0x38')][_0x6deb('0x3a')]?_0x3983f3[_0x6deb('0x38')]:_0x1884e4[_0x6deb('0x35')];if(_0x5ee112['query'][_0x6deb('0x45')]){_0x3983f3[_0x6deb('0x46')]=[{'all':!![]}];}_0x3983f3=_[_0x6deb('0x42')]({},_0x3983f3,_0x5ee112[_0x6deb('0x44')]);return db[_0x6deb('0x32')][_0x6deb('0x4d')](_0x3983f3)[_0x6deb('0x26')](handleEntityNotFound(_0x354059,null))[_0x6deb('0x26')](respondWithResult(_0x354059,null))[_0x6deb('0x49')](handleError(_0x354059,null));};exports['create']=function(_0x32ecf5,_0x423e91){return db['Disposition'][_0x6deb('0x4e')](_0x32ecf5[_0x6deb('0x4f')],{})[_0x6deb('0x26')](function(_0x48e13c){var _0x2e33b8=_0x32ecf5[_0x6deb('0x50')][_0x6deb('0x28')]({'plain':!![]});if(!_0x2e33b8)throw new Error(_0x6deb('0x51'));if(_0x2e33b8[_0x6deb('0x52')]===_0x6deb('0x50')){var _0x4e28d7=_0x48e13c[_0x6deb('0x28')]({'plain':!![]});var _0x309573=_0x6deb('0x29');return db['UserProfileSection']['find']({'where':{'name':_0x309573,'userProfileId':_0x2e33b8[_0x6deb('0x53')]},'raw':!![]})[_0x6deb('0x26')](function(_0xd41875){if(_0xd41875&&_0xd41875[_0x6deb('0x54')]===0x0){return db[_0x6deb('0x55')][_0x6deb('0x4e')]({'name':_0x4e28d7[_0x6deb('0x2e')],'resourceId':_0x4e28d7['id'],'type':_0xd41875['name'],'sectionId':_0xd41875['id']},{})[_0x6deb('0x26')](function(){return _0x48e13c;});}else{return _0x48e13c;}})[_0x6deb('0x49')](function(_0x1db8de){logger[_0x6deb('0x2c')](_0x6deb('0x56'),_0x1db8de);throw _0x1db8de;});}return _0x48e13c;})[_0x6deb('0x26')](respondWithResult(_0x423e91,0xc9))['catch'](handleError(_0x423e91,null));};exports[_0x6deb('0x57')]=function(_0x24c602,_0x2a31c4){if(_0x24c602['body']['id']){delete _0x24c602[_0x6deb('0x4f')]['id'];}return db[_0x6deb('0x32')][_0x6deb('0x4d')]({'where':{'id':_0x24c602['params']['id']}})[_0x6deb('0x26')](handleEntityNotFound(_0x2a31c4,null))[_0x6deb('0x26')](saveUpdates(_0x24c602[_0x6deb('0x4f')],null))[_0x6deb('0x26')](respondWithResult(_0x2a31c4,null))[_0x6deb('0x49')](handleError(_0x2a31c4,null));};exports[_0x6deb('0x27')]=function(_0x5c62cf,_0x48ff61){return db[_0x6deb('0x32')][_0x6deb('0x4d')]({'where':{'id':_0x5c62cf[_0x6deb('0x58')]['id']}})[_0x6deb('0x26')](handleEntityNotFound(_0x48ff61,null))[_0x6deb('0x26')](removeEntity(_0x48ff61,null))['catch'](handleError(_0x48ff61,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index d37a30f..ba0cdbf 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 _0x5dc2=['rimraf','./disposition.attributes','exports','define','Disposition','tools_dispositions','name_voice','name','ListId','ChatWebsiteId','name_mail','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','util','../../config/logger','moment','request-promise','path'];(function(_0x5b6af3,_0x568f44){var _0x1f3652=function(_0x34dc29){while(--_0x34dc29){_0x5b6af3['push'](_0x5b6af3['shift']());}};_0x1f3652(++_0x568f44);}(_0x5dc2,0x14a));var _0x25dc=function(_0x25ae0d,_0x55eb0d){_0x25ae0d=_0x25ae0d-0x0;var _0x2fad17=_0x5dc2[_0x25ae0d];return _0x2fad17;};'use strict';var _=require(_0x25dc('0x0'));var util=require(_0x25dc('0x1'));var logger=require(_0x25dc('0x2'))('api');var moment=require(_0x25dc('0x3'));var BPromise=require('bluebird');var rp=require(_0x25dc('0x4'));var fs=require('fs');var path=require(_0x25dc('0x5'));var rimraf=require(_0x25dc('0x6'));var config=require('../../config/environment');var attributes=require(_0x25dc('0x7'));module[_0x25dc('0x8')]=function(_0x567106,_0x57113e){return _0x567106[_0x25dc('0x9')](_0x25dc('0xa'),attributes,{'tableName':_0x25dc('0xb'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x25dc('0xc'),'fields':[_0x25dc('0xd'),_0x25dc('0xe')]},{'unique':!![],'name':'name_chat','fields':[_0x25dc('0xd'),_0x25dc('0xf')]},{'unique':!![],'name':_0x25dc('0x10'),'fields':[_0x25dc('0xd'),'MailAccountId']},{'unique':!![],'name':'name_sms','fields':[_0x25dc('0xd'),'SmsAccountId']},{'unique':!![],'name':'name_fax','fields':[_0x25dc('0xd'),'FaxAccountId']},{'unique':!![],'name':_0x25dc('0x11'),'fields':[_0x25dc('0xd'),_0x25dc('0x12')]},{'unique':!![],'name':_0x25dc('0x13'),'fields':[_0x25dc('0xd'),_0x25dc('0x14')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa0ef=['name_voice','name','ListId','name_chat','ChatWebsiteId','name_mail','MailAccountId','name_sms','SmsAccountId','name_fax','FaxAccountId','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./disposition.attributes','exports','define','tools_dispositions'];(function(_0x1d0e03,_0x21dfca){var _0x3fdf30=function(_0x5b7f44){while(--_0x5b7f44){_0x1d0e03['push'](_0x1d0e03['shift']());}};_0x3fdf30(++_0x21dfca);}(_0xa0ef,0x121));var _0xfa0e=function(_0x527824,_0xc824a9){_0x527824=_0x527824-0x0;var _0xc8b8ed=_0xa0ef[_0x527824];return _0xc8b8ed;};'use strict';var _=require('lodash');var util=require(_0xfa0e('0x0'));var logger=require(_0xfa0e('0x1'))(_0xfa0e('0x2'));var moment=require(_0xfa0e('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xfa0e('0x4'));var rimraf=require(_0xfa0e('0x5'));var config=require(_0xfa0e('0x6'));var attributes=require(_0xfa0e('0x7'));module[_0xfa0e('0x8')]=function(_0x37d789,_0xa9a20e){return _0x37d789[_0xfa0e('0x9')]('Disposition',attributes,{'tableName':_0xfa0e('0xa'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xfa0e('0xb'),'fields':[_0xfa0e('0xc'),_0xfa0e('0xd')]},{'unique':!![],'name':_0xfa0e('0xe'),'fields':[_0xfa0e('0xc'),_0xfa0e('0xf')]},{'unique':!![],'name':_0xfa0e('0x10'),'fields':['name',_0xfa0e('0x11')]},{'unique':!![],'name':_0xfa0e('0x12'),'fields':['name',_0xfa0e('0x13')]},{'unique':!![],'name':_0xfa0e('0x14'),'fields':[_0xfa0e('0xc'),_0xfa0e('0x15')]},{'unique':!![],'name':'name_openchannel','fields':[_0xfa0e('0xc'),_0xfa0e('0x16')]},{'unique':!![],'name':_0xfa0e('0x17'),'fields':[_0xfa0e('0xc'),_0xfa0e('0x18')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index f7a5a28..05e9513 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(_0x4ae77f,_0x50b1fe){var _0x27d916=function(_0x2f4a11){while(--_0x2f4a11){_0x4ae77f['push'](_0x4ae77f['shift']());}};_0x27d916(++_0x50b1fe);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xa9e0[_0x4709c0];return _0x13348b;};'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(_0x1a0714,_0x2e610c){var _0x5cb259=function(_0x30a36d){while(--_0x30a36d){_0x1a0714['push'](_0x1a0714['shift']());}};_0x5cb259(++_0x2e610c);}(_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 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 905cbfd..dc2e968 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 _0xcf99=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','exports','multer','util','path','express'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xcf99,0x18b));var _0x9cf9=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xcf99[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x9cf9('0x0'));var util=require(_0x9cf9('0x1'));var path=require(_0x9cf9('0x2'));var timeout=require('connect-timeout');var express=require(_0x9cf9('0x3'));var router=express[_0x9cf9('0x4')]();var fs_extra=require(_0x9cf9('0x5'));var auth=require(_0x9cf9('0x6'));var interaction=require(_0x9cf9('0x7'));var config=require(_0x9cf9('0x8'));var controller=require(_0x9cf9('0x9'));router[_0x9cf9('0xa')]('/',auth[_0x9cf9('0xb')](),controller[_0x9cf9('0xc')]);router['get']('/:id',auth[_0x9cf9('0xb')](),controller[_0x9cf9('0xd')]);router[_0x9cf9('0xe')]('/',auth[_0x9cf9('0xb')](),controller[_0x9cf9('0xf')]);router[_0x9cf9('0x10')](_0x9cf9('0x11'),auth['isAuthenticated'](),controller[_0x9cf9('0x12')]);router[_0x9cf9('0x13')](_0x9cf9('0x11'),auth[_0x9cf9('0xb')](),controller['destroy']);module[_0x9cf9('0x14')]=router; \ No newline at end of file +var _0xfe52=['../../config/environment','./disposition.controller','get','isAuthenticated','index','/:id','show','create','put','update','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x22d2eb,_0x2cdf40){var _0xc97972=function(_0x508b9e){while(--_0x508b9e){_0x22d2eb['push'](_0x22d2eb['shift']());}};_0xc97972(++_0x2cdf40);}(_0xfe52,0xdb));var _0x2fe5=function(_0x573d89,_0x4cb34f){_0x573d89=_0x573d89-0x0;var _0x41e1ad=_0xfe52[_0x573d89];return _0x41e1ad;};'use strict';var multer=require(_0x2fe5('0x0'));var util=require(_0x2fe5('0x1'));var path=require(_0x2fe5('0x2'));var timeout=require(_0x2fe5('0x3'));var express=require(_0x2fe5('0x4'));var router=express[_0x2fe5('0x5')]();var fs_extra=require(_0x2fe5('0x6'));var auth=require(_0x2fe5('0x7'));var interaction=require(_0x2fe5('0x8'));var config=require(_0x2fe5('0x9'));var controller=require(_0x2fe5('0xa'));router[_0x2fe5('0xb')]('/',auth[_0x2fe5('0xc')](),controller[_0x2fe5('0xd')]);router[_0x2fe5('0xb')](_0x2fe5('0xe'),auth[_0x2fe5('0xc')](),controller[_0x2fe5('0xf')]);router['post']('/',auth[_0x2fe5('0xc')](),controller[_0x2fe5('0x10')]);router[_0x2fe5('0x11')](_0x2fe5('0xe'),auth[_0x2fe5('0xc')](),controller[_0x2fe5('0x12')]);router['delete']('/:id',auth[_0x2fe5('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 0917b07..6751c8a 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 _0xcaf2=['sequelize','STRING','yes','xCALLY\x20Motion\x20Fax','localstationid','ENUM','2400','7200','9600','12000','14400','4800','INTEGER','SIP','IAX','DADHI','KHOMP','TEXT','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition'];(function(_0x325baa,_0x1dd6df){var _0x347820=function(_0x45ee71){while(--_0x45ee71){_0x325baa['push'](_0x325baa['shift']());}};_0x347820(++_0x1dd6df);}(_0xcaf2,0x8a));var _0x2caf=function(_0x231dda,_0x5b04cc){_0x231dda=_0x231dda-0x0;var _0x3f88cb=_0xcaf2[_0x231dda];return _0x3f88cb;};'use strict';var Sequelize=require(_0x2caf('0x0'));module['exports']={'name':{'type':Sequelize[_0x2caf('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x2caf('0x1')]},'ecm':{'type':Sequelize['ENUM'](_0x2caf('0x2'),'no'),'defaultValue':_0x2caf('0x2')},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':_0x2caf('0x3')},'localstationid':{'type':Sequelize['STRING'],'unique':_0x2caf('0x4')},'minrate':{'type':Sequelize[_0x2caf('0x5')](_0x2caf('0x6'),'4800',_0x2caf('0x7'),_0x2caf('0x8'),_0x2caf('0x9'),_0x2caf('0xa')),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0x2caf('0x5')](_0x2caf('0x6'),_0x2caf('0xb'),_0x2caf('0x7'),_0x2caf('0x8'),_0x2caf('0x9'),_0x2caf('0xa')),'defaultValue':_0x2caf('0xa')},'modem':{'type':Sequelize[_0x2caf('0x1')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0x2caf('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x2caf('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x2caf('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x2caf('0x5')](_0x2caf('0xd'),_0x2caf('0xe'),_0x2caf('0xf'),_0x2caf('0x10')),'defaultValue':'SIP'},'key':{'type':Sequelize[_0x2caf('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x2caf('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['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x2caf('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x2caf('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x2caf('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2caf('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x2caf('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x2caf('0x13')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x2caf('0x14'),'set':function(_0x57f3cd){if(!_0x57f3cd)this['setDataValue'](_0x2caf('0x15'),null);this['setDataValue'](_0x2caf('0x16'),_0x57f3cd);}}}; \ No newline at end of file +var _0x5fab=['12000','14400','4800','v17,v27,v29','INTEGER','IAX','DADHI','SIP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','9600'];(function(_0x1fbeaf,_0x256fbd){var _0x13daa3=function(_0x295348){while(--_0x295348){_0x1fbeaf['push'](_0x1fbeaf['shift']());}};_0x13daa3(++_0x256fbd);}(_0x5fab,0x177));var _0xb5fa=function(_0x54597a,_0x4ea42f){_0x54597a=_0x54597a-0x0;var _0x5a764f=_0x5fab[_0x54597a];return _0x5a764f;};'use strict';var Sequelize=require(_0xb5fa('0x0'));module[_0xb5fa('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xb5fa('0x2')]},'ecm':{'type':Sequelize[_0xb5fa('0x3')](_0xb5fa('0x4'),'no'),'defaultValue':_0xb5fa('0x4')},'headerinfo':{'type':Sequelize[_0xb5fa('0x2')],'defaultValue':_0xb5fa('0x5')},'localstationid':{'type':Sequelize[_0xb5fa('0x2')],'unique':_0xb5fa('0x6')},'minrate':{'type':Sequelize[_0xb5fa('0x3')](_0xb5fa('0x7'),'4800','7200',_0xb5fa('0x8'),_0xb5fa('0x9'),_0xb5fa('0xa')),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0xb5fa('0x3')](_0xb5fa('0x7'),_0xb5fa('0xb'),'7200','9600',_0xb5fa('0x9'),_0xb5fa('0xa')),'defaultValue':_0xb5fa('0xa')},'modem':{'type':Sequelize[_0xb5fa('0x2')],'defaultValue':_0xb5fa('0xc')},'gateway':{'type':Sequelize[_0xb5fa('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xb5fa('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xb5fa('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xb5fa('0x3')]('SIP',_0xb5fa('0xe'),_0xb5fa('0xf'),'KHOMP'),'defaultValue':_0xb5fa('0x10')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xb5fa('0x11')],'defaultValue':function(){return _0xb5fa('0x12');}},'notificationSound':{'type':Sequelize[_0xb5fa('0x13')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb5fa('0x13')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xb5fa('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb5fa('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb5fa('0x13')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb5fa('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb5fa('0xd')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xb5fa('0x14'),'set':function(_0x1f7f05){if(!_0x1f7f05)this[_0xb5fa('0x15')](_0xb5fa('0x16'),null);this[_0xb5fa('0x15')](_0xb5fa('0x17'),_0x1f7f05);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 7a783a6..efe39d2 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 _0x1996=['getAnswers','removeAnswers','addInteraction','FaxInteraction','omit','CmContact','User','Owner','Tag','color','tag','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','findAndCountAll','priority','getApplications','from-voip-provider','exten','localstationid','app','system','description','appdata','push','Answer','ecm','gateway','faxdetect','headerinfo','minrate','modem','t38timeout','Set','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','VoiceExtension','transaction','bulkCreate','tech','createdAt','updatedAt','TrunkId','getMessages','FaxMessage','$gte','split','format','CmList','List','Contacts','DESC','attachments','root','server/files/attachments','basename','CheckAfterSend','isNil','\x22%s\x22\x20<%s>','fax','defaults','ListId','List\x20not\x20found','out','user','spread','filename','ContactId','dataValues','Messages','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./faxAccount.socket','register','jayson/promise','client','http','request','then','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','FaxAccount,\x20%s,\x20%s','message','info','result','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','get','UserProfileResource','destroy','name','send','index','Pause','map','FaxAccount','rawAttributes','fieldName','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','type','options','includeAll','include','findAll','rows','catch','show','params','mandatoryDispositionPause','create','body','role','FaxAccounts','UserProfileSection','find','autoAssociation','describe','addDisposition','Disposition','findOne','ids','FaxAccountId','CannedAnswer'];(function(_0x5babb2,_0xb506a){var _0x573366=function(_0x137e5d){while(--_0x137e5d){_0x5babb2['push'](_0x5babb2['shift']());}};_0x573366(++_0xb506a);}(_0x1996,0x1c9));var _0x6199=function(_0x2895fe,_0x441443){_0x2895fe=_0x2895fe-0x0;var _0x192ef6=_0x1996[_0x2895fe];return _0x192ef6;};'use strict';var emlformat=require(_0x6199('0x0'));var rimraf=require(_0x6199('0x1'));var zipdir=require(_0x6199('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6199('0x3'));var BPromise=require(_0x6199('0x4'));var Mustache=require(_0x6199('0x5'));var util=require(_0x6199('0x6'));var path=require(_0x6199('0x7'));var sox=require('sox');var csv=require(_0x6199('0x8'));var ejs=require(_0x6199('0x9'));var fs=require('fs');var fs_extra=require(_0x6199('0xa'));var _=require(_0x6199('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6199('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6199('0xd'));var authService=require(_0x6199('0xe'));var qs=require(_0x6199('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6199('0x10'))(_0x6199('0x11'));var utils=require(_0x6199('0x12'));var config=require(_0x6199('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x6199('0x14'))['db'];config[_0x6199('0x15')]=_['defaults'](config[_0x6199('0x15')],{'host':_0x6199('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x6199('0x17'))[_0x6199('0x18')](socket);var jayson=require(_0x6199('0x19'));var client=jayson[_0x6199('0x1a')]['http']({'port':0x232c});var client9002=jayson['client'][_0x6199('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x39272c,_0x5a4b0c,_0x516cd7,_0x4545f3){return new BPromise(function(_0x259d3f,_0x4d956a){var _0xbe186f=_0x4545f3||client;return _0xbe186f[_0x6199('0x1c')](_0x39272c,_0x516cd7)[_0x6199('0x1d')](function(_0x5aab71){logger['info']('FaxAccount,\x20%s,\x20%s',_0x5a4b0c,'request\x20sent');logger[_0x6199('0x1e')](_0x6199('0x1f'),_0x5a4b0c,_0x6199('0x20'),JSON['stringify'](_0x5aab71));if(_0x5aab71[_0x6199('0x21')]){if(_0x5aab71['error'][_0x6199('0x22')]===0x1f4){logger[_0x6199('0x21')](_0x6199('0x23'),_0x5a4b0c,_0x5aab71['error'][_0x6199('0x24')]);return _0x4d956a(_0x5aab71[_0x6199('0x21')][_0x6199('0x24')]);}logger[_0x6199('0x21')](_0x6199('0x23'),_0x5a4b0c,_0x5aab71['error'][_0x6199('0x24')]);return _0x259d3f(_0x5aab71['error']['message']);}else{logger[_0x6199('0x25')](_0x6199('0x23'),_0x5a4b0c,'request\x20sent');_0x259d3f(_0x5aab71[_0x6199('0x26')][_0x6199('0x24')]);}})['catch'](function(_0x544645){logger[_0x6199('0x21')](_0x6199('0x23'),_0x5a4b0c,_0x544645);_0x4d956a(_0x544645);});});}function respondWithStatusCode(_0x2c9f8d,_0x36d32a){_0x36d32a=_0x36d32a||0xcc;return function(_0x161be7){if(_0x161be7){return _0x2c9f8d[_0x6199('0x27')](_0x36d32a);}return _0x2c9f8d[_0x6199('0x28')](_0x36d32a)[_0x6199('0x29')]();};}function respondWithResult(_0x2b0f5f,_0x27a8f7){_0x27a8f7=_0x27a8f7||0xc8;return function(_0x2da040){if(_0x2da040){return _0x2b0f5f[_0x6199('0x28')](_0x27a8f7)[_0x6199('0x2a')](_0x2da040);}};}function respondWithFilteredResult(_0x193f55,_0x3d6de5){return function(_0x2b589c){if(_0x2b589c){var _0x1c25bb=typeof _0x3d6de5[_0x6199('0x2b')]==='undefined'&&typeof _0x3d6de5[_0x6199('0x2c')]===_0x6199('0x2d');var _0x39e7f6=_0x2b589c[_0x6199('0x2e')];var _0x21ff73=_0x1c25bb?0x0:_0x3d6de5[_0x6199('0x2b')];var _0x4713d3=_0x1c25bb?_0x2b589c[_0x6199('0x2e')]:_0x3d6de5[_0x6199('0x2b')]+_0x3d6de5['limit'];var _0x495280;if(_0x4713d3>=_0x39e7f6){_0x4713d3=_0x39e7f6;_0x495280=0xc8;}else{_0x495280=0xce;}_0x193f55['status'](_0x495280);return _0x193f55[_0x6199('0x2f')](_0x6199('0x30'),_0x21ff73+'-'+_0x4713d3+'/'+_0x39e7f6)[_0x6199('0x2a')](_0x2b589c);}return null;};}function patchUpdates(_0x8994a5){return function(_0x57dde4){try{jsonpatch[_0x6199('0x31')](_0x57dde4,_0x8994a5,!![]);}catch(_0x11619a){return BPromise[_0x6199('0x32')](_0x11619a);}return _0x57dde4['save']();};}function saveUpdates(_0x343e6a,_0x3f9b3c){return function(_0x1d2e49){if(_0x1d2e49){return _0x1d2e49[_0x6199('0x33')](_0x343e6a)['then'](function(_0x2e54fd){return _0x2e54fd;});}return null;};}function removeEntity(_0x3238d6,_0x1e1299){return function(_0xce019c){if(_0xce019c){return _0xce019c['destroy']()['then'](function(){var _0x330aec=_0xce019c[_0x6199('0x34')]({'plain':!![]});var _0x2f6d70='FaxAccounts';return db[_0x6199('0x35')][_0x6199('0x36')]({'where':{'type':_0x2f6d70,'resourceId':_0x330aec['id']}})[_0x6199('0x1d')](function(){return _0xce019c;});})[_0x6199('0x1d')](function(){_0x3238d6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x164e15,_0x8b8342){return function(_0x5d8b17){if(!_0x5d8b17){_0x164e15[_0x6199('0x27')](0x194);}return _0x5d8b17;};}function handleError(_0x47bb05,_0x367f2b){_0x367f2b=_0x367f2b||0x1f4;return function(_0x37cffa){logger[_0x6199('0x21')](_0x37cffa['stack']);if(_0x37cffa['name']){delete _0x37cffa[_0x6199('0x37')];}_0x47bb05['status'](_0x367f2b)[_0x6199('0x38')](_0x37cffa);};}exports[_0x6199('0x39')]=function(_0x2d58f0,_0x1055a1){var _0x4d222f={'include':[{'model':db[_0x6199('0x3a')],'as':'mandatoryDispositionPause'}]},_0x7a68fb={},_0x280e7c={'count':0x0,'rows':[]};var _0x1010e4=_[_0x6199('0x3b')](db[_0x6199('0x3c')][_0x6199('0x3d')],function(_0x54d60b){return{'name':_0x54d60b[_0x6199('0x3e')],'type':_0x54d60b['type'][_0x6199('0x3f')]};});_0x7a68fb[_0x6199('0x40')]=_[_0x6199('0x3b')](_0x1010e4,'name');_0x7a68fb[_0x6199('0x41')]=_[_0x6199('0x42')](_0x2d58f0[_0x6199('0x41')]);_0x7a68fb['filters']=_['intersection'](_0x7a68fb['model'],_0x7a68fb[_0x6199('0x41')]);_0x4d222f[_0x6199('0x43')]=_[_0x6199('0x44')](_0x7a68fb[_0x6199('0x40')],qs[_0x6199('0x45')](_0x2d58f0[_0x6199('0x41')][_0x6199('0x45')]));_0x4d222f[_0x6199('0x43')]=_0x4d222f['attributes'][_0x6199('0x46')]?_0x4d222f['attributes']:_0x7a68fb['model'];if(!_0x2d58f0[_0x6199('0x41')][_0x6199('0x47')](_0x6199('0x48'))){_0x4d222f[_0x6199('0x2c')]=qs['limit'](_0x2d58f0[_0x6199('0x41')][_0x6199('0x2c')]);_0x4d222f['offset']=qs[_0x6199('0x2b')](_0x2d58f0[_0x6199('0x41')]['offset']);}_0x4d222f[_0x6199('0x49')]=qs['sort'](_0x2d58f0[_0x6199('0x41')][_0x6199('0x4a')]);_0x4d222f[_0x6199('0x4b')]=qs['filters'](_[_0x6199('0x4c')](_0x2d58f0[_0x6199('0x41')],_0x7a68fb[_0x6199('0x4d')]),_0x1010e4);if(_0x2d58f0[_0x6199('0x41')][_0x6199('0x4e')]){_0x4d222f['where']=_[_0x6199('0x4f')](_0x4d222f[_0x6199('0x4b')],{'$or':_['map'](_0x1010e4,function(_0x359a56){if(_0x359a56[_0x6199('0x50')]!=='VIRTUAL'){var _0x804910={};_0x804910[_0x359a56[_0x6199('0x37')]]={'$like':'%'+_0x2d58f0[_0x6199('0x41')][_0x6199('0x4e')]+'%'};return _0x804910;}})});}_0x4d222f=_[_0x6199('0x4f')]({},_0x4d222f,_0x2d58f0[_0x6199('0x51')]);var _0x252be2={'where':_0x4d222f[_0x6199('0x4b')]};return db['FaxAccount'][_0x6199('0x2e')](_0x252be2)['then'](function(_0x34f96c){_0x280e7c['count']=_0x34f96c;if(_0x2d58f0[_0x6199('0x41')][_0x6199('0x52')]){_0x4d222f[_0x6199('0x53')]=[{'all':!![]}];}return db[_0x6199('0x3c')][_0x6199('0x54')](_0x4d222f);})[_0x6199('0x1d')](function(_0x38ba50){_0x280e7c[_0x6199('0x55')]=_0x38ba50;return _0x280e7c;})[_0x6199('0x1d')](respondWithFilteredResult(_0x1055a1,_0x4d222f))[_0x6199('0x56')](handleError(_0x1055a1,null));};exports[_0x6199('0x57')]=function(_0x5ea302,_0x1edc3e){var _0x10cab9={'raw':![],'where':{'id':_0x5ea302[_0x6199('0x58')]['id']},'include':[{'model':db[_0x6199('0x3a')],'as':_0x6199('0x59')}]},_0x4ba249={};_0x4ba249[_0x6199('0x40')]=_[_0x6199('0x42')](db['FaxAccount'][_0x6199('0x3d')]);_0x4ba249[_0x6199('0x41')]=_[_0x6199('0x42')](_0x5ea302[_0x6199('0x41')]);_0x4ba249[_0x6199('0x4d')]=_['intersection'](_0x4ba249[_0x6199('0x40')],_0x4ba249['query']);_0x10cab9['attributes']=_[_0x6199('0x44')](_0x4ba249['model'],qs[_0x6199('0x45')](_0x5ea302[_0x6199('0x41')][_0x6199('0x45')]));_0x10cab9[_0x6199('0x43')]=_0x10cab9[_0x6199('0x43')][_0x6199('0x46')]?_0x10cab9[_0x6199('0x43')]:_0x4ba249[_0x6199('0x40')];if(_0x5ea302[_0x6199('0x41')][_0x6199('0x52')]){_0x10cab9[_0x6199('0x53')]=[{'all':!![]}];}_0x10cab9=_[_0x6199('0x4f')]({},_0x10cab9,_0x5ea302[_0x6199('0x51')]);return db['FaxAccount']['find'](_0x10cab9)[_0x6199('0x1d')](handleEntityNotFound(_0x1edc3e,null))[_0x6199('0x1d')](respondWithResult(_0x1edc3e,null))[_0x6199('0x56')](handleError(_0x1edc3e,null));};exports[_0x6199('0x5a')]=function(_0x33fecf,_0x193132){return db[_0x6199('0x3c')][_0x6199('0x5a')](_0x33fecf[_0x6199('0x5b')],{})[_0x6199('0x1d')](function(_0x6bcf6f){var _0x578247=_0x33fecf['user'][_0x6199('0x34')]({'plain':!![]});if(!_0x578247)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x578247[_0x6199('0x5c')]==='user'){var _0x205c84=_0x6bcf6f[_0x6199('0x34')]({'plain':!![]});var _0xfee60d=_0x6199('0x5d');return db[_0x6199('0x5e')][_0x6199('0x5f')]({'where':{'name':_0xfee60d,'userProfileId':_0x578247['userProfileId']},'raw':!![]})[_0x6199('0x1d')](function(_0x36238d){if(_0x36238d&&_0x36238d[_0x6199('0x60')]===0x0){return db[_0x6199('0x35')][_0x6199('0x5a')]({'name':_0x205c84['name'],'resourceId':_0x205c84['id'],'type':_0x36238d[_0x6199('0x37')],'sectionId':_0x36238d['id']},{})[_0x6199('0x1d')](function(){return _0x6bcf6f;});}else{return _0x6bcf6f;}})[_0x6199('0x56')](function(_0x30333b){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x30333b);throw _0x30333b;});}return _0x6bcf6f;})['then'](respondWithResult(_0x193132,0xc9))[_0x6199('0x56')](handleError(_0x193132,null));};exports[_0x6199('0x33')]=function(_0x4f04b5,_0x1f7376){if(_0x4f04b5[_0x6199('0x5b')]['id']){delete _0x4f04b5[_0x6199('0x5b')]['id'];}return db[_0x6199('0x3c')][_0x6199('0x5f')]({'where':{'id':_0x4f04b5[_0x6199('0x58')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x6199('0x1d')](handleEntityNotFound(_0x1f7376,null))[_0x6199('0x1d')](saveUpdates(_0x4f04b5[_0x6199('0x5b')],null))[_0x6199('0x1d')](respondWithResult(_0x1f7376,null))[_0x6199('0x56')](handleError(_0x1f7376,null));};exports[_0x6199('0x36')]=function(_0x545786,_0x24d40f){return db[_0x6199('0x3c')][_0x6199('0x5f')]({'where':{'id':_0x545786[_0x6199('0x58')]['id']}})['then'](handleEntityNotFound(_0x24d40f,null))['then'](removeEntity(_0x24d40f,null))[_0x6199('0x56')](handleError(_0x24d40f,null));};exports[_0x6199('0x61')]=function(_0x1e44b9,_0x34bfd1){return db[_0x6199('0x3c')][_0x6199('0x61')]()[_0x6199('0x1d')](respondWithResult(_0x34bfd1,null))[_0x6199('0x56')](handleError(_0x34bfd1,null));};exports[_0x6199('0x62')]=function(_0x4c495d,_0x34feed,_0x2c1160){if(_0x4c495d['body']['id']){delete _0x4c495d[_0x6199('0x5b')]['id'];}return db['FaxAccount'][_0x6199('0x5f')]({'where':{'id':_0x4c495d[_0x6199('0x58')]['id']}})[_0x6199('0x1d')](handleEntityNotFound(_0x34feed,null))[_0x6199('0x1d')](function(_0x529e59){if(_0x529e59){_0x4c495d[_0x6199('0x5b')]['FaxAccountId']=_0x529e59['id'];return db[_0x6199('0x63')][_0x6199('0x5a')](_0x4c495d[_0x6199('0x5b')]);}})[_0x6199('0x1d')](respondWithResult(_0x34feed,null))[_0x6199('0x56')](handleError(_0x34feed,null));};exports['getDispositions']=function(_0x59d922,_0x26a8ce,_0x51b15d){var _0x5b722e={'raw':![],'where':{}};var _0x469162={};var _0x15e5c0={'count':0x0,'rows':[]};return db[_0x6199('0x3c')][_0x6199('0x64')]({'where':{'id':_0x59d922[_0x6199('0x58')]['id']}})[_0x6199('0x1d')](handleEntityNotFound(_0x26a8ce,null))['then'](function(_0x57e9f){if(_0x57e9f){_0x469162[_0x6199('0x40')]=_[_0x6199('0x42')](db[_0x6199('0x63')]['rawAttributes']);_0x469162[_0x6199('0x41')]=_[_0x6199('0x42')](_0x59d922[_0x6199('0x41')]);_0x469162[_0x6199('0x4d')]=_[_0x6199('0x44')](_0x469162[_0x6199('0x40')],_0x469162[_0x6199('0x41')]);_0x5b722e[_0x6199('0x43')]=_[_0x6199('0x44')](_0x469162[_0x6199('0x40')],qs[_0x6199('0x45')](_0x59d922[_0x6199('0x41')][_0x6199('0x45')]));_0x5b722e[_0x6199('0x43')]=_0x5b722e[_0x6199('0x43')][_0x6199('0x46')]?_0x5b722e[_0x6199('0x43')]:_0x469162[_0x6199('0x40')];if(!_0x59d922[_0x6199('0x41')][_0x6199('0x47')](_0x6199('0x48'))){_0x5b722e[_0x6199('0x2c')]=qs[_0x6199('0x2c')](_0x59d922[_0x6199('0x41')]['limit']);_0x5b722e['offset']=qs[_0x6199('0x2b')](_0x59d922['query'][_0x6199('0x2b')]);}_0x5b722e[_0x6199('0x49')]=qs[_0x6199('0x4a')](_0x59d922[_0x6199('0x41')]['sort']);_0x5b722e[_0x6199('0x4b')]=qs[_0x6199('0x4d')](_['pick'](_0x59d922[_0x6199('0x41')],_0x469162['filters']));_0x5b722e[_0x6199('0x4b')]['FaxAccountId']=_0x57e9f['id'];if(_0x59d922[_0x6199('0x41')]['filter']){_0x5b722e[_0x6199('0x4b')]=_[_0x6199('0x4f')](_0x5b722e[_0x6199('0x4b')],{'$or':_[_0x6199('0x3b')](_0x5b722e[_0x6199('0x43')],function(_0x20a4df){var _0x7ee689={};_0x7ee689[_0x20a4df]={'$like':'%'+_0x59d922[_0x6199('0x41')][_0x6199('0x4e')]+'%'};return _0x7ee689;})});}_0x5b722e=_[_0x6199('0x4f')]({},_0x5b722e,_0x59d922[_0x6199('0x51')]);return db['Disposition'][_0x6199('0x2e')]({'where':_0x5b722e[_0x6199('0x4b')]})['then'](function(_0xb8aadc){_0x15e5c0[_0x6199('0x2e')]=_0xb8aadc;if(_0x59d922[_0x6199('0x41')]['includeAll']){_0x5b722e[_0x6199('0x53')]=[{'all':!![]}];}return db[_0x6199('0x63')][_0x6199('0x54')](_0x5b722e);})[_0x6199('0x1d')](function(_0x1bb1e9){_0x15e5c0[_0x6199('0x55')]=_0x1bb1e9;return _0x15e5c0;});}})[_0x6199('0x1d')](respondWithFilteredResult(_0x26a8ce,_0x5b722e))[_0x6199('0x56')](handleError(_0x26a8ce,null));};exports['removeDispositions']=function(_0x1d3eb,_0xf3979e,_0xdd9587){return db[_0x6199('0x3c')][_0x6199('0x5f')]({'where':{'id':_0x1d3eb[_0x6199('0x58')]['id']}})[_0x6199('0x1d')](handleEntityNotFound(_0xf3979e,null))[_0x6199('0x1d')](function(_0x44f730){if(_0x44f730){return _0x44f730['removeDispositions'](_0x1d3eb[_0x6199('0x41')][_0x6199('0x65')]);}})['then'](respondWithStatusCode(_0xf3979e,null))[_0x6199('0x56')](handleError(_0xf3979e,null));};exports['addAnswer']=function(_0x5f17e3,_0x141101,_0x49ba22){if(_0x5f17e3[_0x6199('0x5b')]['id']){delete _0x5f17e3[_0x6199('0x5b')]['id'];}return db[_0x6199('0x3c')]['find']({'where':{'id':_0x5f17e3[_0x6199('0x58')]['id']}})['then'](handleEntityNotFound(_0x141101,null))[_0x6199('0x1d')](function(_0x8bb1eb){if(_0x8bb1eb){_0x5f17e3[_0x6199('0x5b')][_0x6199('0x66')]=_0x8bb1eb['id'];return db[_0x6199('0x67')][_0x6199('0x5a')](_0x5f17e3[_0x6199('0x5b')]);}})['then'](respondWithResult(_0x141101,null))[_0x6199('0x56')](handleError(_0x141101,null));};exports[_0x6199('0x68')]=function(_0xe1a654,_0x4edc05,_0x137b14){var _0x57cfff={'raw':![],'where':{}};var _0x49147a={};var _0xc7fb5a={'count':0x0,'rows':[]};return db[_0x6199('0x3c')]['findOne']({'where':{'id':_0xe1a654[_0x6199('0x58')]['id']}})[_0x6199('0x1d')](handleEntityNotFound(_0x4edc05,null))[_0x6199('0x1d')](function(_0x2c67a5){if(_0x2c67a5){_0x49147a[_0x6199('0x40')]=_[_0x6199('0x42')](db['CannedAnswer']['rawAttributes']);_0x49147a[_0x6199('0x41')]=_[_0x6199('0x42')](_0xe1a654['query']);_0x49147a[_0x6199('0x4d')]=_['intersection'](_0x49147a['model'],_0x49147a[_0x6199('0x41')]);_0x57cfff[_0x6199('0x43')]=_['intersection'](_0x49147a[_0x6199('0x40')],qs[_0x6199('0x45')](_0xe1a654[_0x6199('0x41')]['fields']));_0x57cfff['attributes']=_0x57cfff['attributes']['length']?_0x57cfff['attributes']:_0x49147a[_0x6199('0x40')];if(!_0xe1a654[_0x6199('0x41')][_0x6199('0x47')](_0x6199('0x48'))){_0x57cfff['limit']=qs['limit'](_0xe1a654['query'][_0x6199('0x2c')]);_0x57cfff[_0x6199('0x2b')]=qs['offset'](_0xe1a654[_0x6199('0x41')]['offset']);}_0x57cfff[_0x6199('0x49')]=qs[_0x6199('0x4a')](_0xe1a654[_0x6199('0x41')][_0x6199('0x4a')]);_0x57cfff[_0x6199('0x4b')]=qs[_0x6199('0x4d')](_['pick'](_0xe1a654[_0x6199('0x41')],_0x49147a[_0x6199('0x4d')]));_0x57cfff[_0x6199('0x4b')][_0x6199('0x66')]=_0x2c67a5['id'];if(_0xe1a654[_0x6199('0x41')]['filter']){_0x57cfff[_0x6199('0x4b')]=_['merge'](_0x57cfff['where'],{'$or':_[_0x6199('0x3b')](_0x57cfff['attributes'],function(_0x576e43){var _0x1ba260={};_0x1ba260[_0x576e43]={'$like':'%'+_0xe1a654[_0x6199('0x41')]['filter']+'%'};return _0x1ba260;})});}_0x57cfff=_['merge']({},_0x57cfff,_0xe1a654[_0x6199('0x51')]);return db[_0x6199('0x67')][_0x6199('0x2e')]({'where':_0x57cfff[_0x6199('0x4b')]})['then'](function(_0x1a68ec){_0xc7fb5a[_0x6199('0x2e')]=_0x1a68ec;if(_0xe1a654[_0x6199('0x41')][_0x6199('0x52')]){_0x57cfff['include']=[{'all':!![]}];}return db[_0x6199('0x67')][_0x6199('0x54')](_0x57cfff);})[_0x6199('0x1d')](function(_0x199b7e){_0xc7fb5a['rows']=_0x199b7e;return _0xc7fb5a;});}})[_0x6199('0x1d')](respondWithFilteredResult(_0x4edc05,_0x57cfff))['catch'](handleError(_0x4edc05,null));};exports[_0x6199('0x69')]=function(_0x56c9f9,_0x4ed033,_0x4b24ee){return db[_0x6199('0x3c')]['find']({'where':{'id':_0x56c9f9[_0x6199('0x58')]['id']}})[_0x6199('0x1d')](handleEntityNotFound(_0x4ed033,null))[_0x6199('0x1d')](function(_0xb72557){if(_0xb72557){return _0xb72557[_0x6199('0x69')](_0x56c9f9[_0x6199('0x41')][_0x6199('0x65')]);}})[_0x6199('0x1d')](respondWithStatusCode(_0x4ed033,null))[_0x6199('0x56')](handleError(_0x4ed033,null));};exports[_0x6199('0x6a')]=function(_0xfd935a,_0x5730e9,_0x548e61){return db[_0x6199('0x6b')][_0x6199('0x5f')]({'where':{'id':_0xfd935a[_0x6199('0x58')]['id']}})[_0x6199('0x1d')](handleEntityNotFound(_0x5730e9,null))[_0x6199('0x1d')](function(_0x3f763d){if(_0x3f763d){return _0x3f763d[_0x6199('0x6a')](_0xfd935a[_0x6199('0x5b')][_0x6199('0x65')],_[_0x6199('0x6c')](_0xfd935a[_0x6199('0x5b')],[_0x6199('0x65'),'id'])||{});}})[_0x6199('0x1d')](respondWithResult(_0x5730e9,null))['catch'](handleError(_0x5730e9,null));};exports['getInteractions']=function(_0x2f4d98,_0x214e11,_0x1b9fb7){var _0x514eca={'raw':![],'where':{}};var _0x108744={};var _0x269682={'count':0x0,'rows':[]};return db[_0x6199('0x3c')][_0x6199('0x64')]({'where':{'id':_0x2f4d98[_0x6199('0x58')]['id']}})[_0x6199('0x1d')](handleEntityNotFound(_0x214e11,null))[_0x6199('0x1d')](function(_0x521a34){if(_0x521a34){_0x108744[_0x6199('0x40')]=_[_0x6199('0x42')](db[_0x6199('0x6b')][_0x6199('0x3d')]);_0x108744['query']=_[_0x6199('0x42')](_0x2f4d98[_0x6199('0x41')]);_0x108744[_0x6199('0x4d')]=_[_0x6199('0x44')](_0x108744[_0x6199('0x40')],_0x108744['query']);_0x514eca[_0x6199('0x43')]=_[_0x6199('0x44')](_0x108744[_0x6199('0x40')],qs[_0x6199('0x45')](_0x2f4d98[_0x6199('0x41')][_0x6199('0x45')]));_0x514eca['attributes']=_0x514eca['attributes'][_0x6199('0x46')]?_0x514eca['attributes']:_0x108744['model'];if(!_0x2f4d98[_0x6199('0x41')][_0x6199('0x47')](_0x6199('0x48'))){_0x514eca[_0x6199('0x2c')]=qs[_0x6199('0x2c')](_0x2f4d98[_0x6199('0x41')][_0x6199('0x2c')]);_0x514eca[_0x6199('0x2b')]=qs[_0x6199('0x2b')](_0x2f4d98[_0x6199('0x41')][_0x6199('0x2b')]);}_0x514eca[_0x6199('0x49')]=qs[_0x6199('0x4a')](_0x2f4d98[_0x6199('0x41')]['sort']);_0x514eca[_0x6199('0x4b')]=qs[_0x6199('0x4d')](_[_0x6199('0x4c')](_0x2f4d98[_0x6199('0x41')],_0x108744[_0x6199('0x4d')]));_0x514eca['where'][_0x6199('0x66')]=_0x521a34['id'];if(_0x2f4d98[_0x6199('0x41')][_0x6199('0x4e')]){_0x514eca['where']=_[_0x6199('0x4f')](_0x514eca[_0x6199('0x4b')],{'$or':_['map'](_0x514eca[_0x6199('0x43')],function(_0x3a05f2){var _0x2951ac={};_0x2951ac[_0x3a05f2]={'$like':'%'+_0x2f4d98[_0x6199('0x41')][_0x6199('0x4e')]+'%'};return _0x2951ac;})});}_0x514eca=_[_0x6199('0x4f')]({},_0x514eca,_0x2f4d98[_0x6199('0x51')]);return db[_0x6199('0x6b')][_0x6199('0x2e')]({'where':_0x514eca[_0x6199('0x4b')]})[_0x6199('0x1d')](function(_0x21ec69){_0x269682[_0x6199('0x2e')]=_0x21ec69;if(_0x2f4d98[_0x6199('0x41')][_0x6199('0x52')]){_0x514eca[_0x6199('0x53')]=[{'model':db[_0x6199('0x6d')],'as':'Contact','required':![]},{'model':db[_0x6199('0x6e')],'as':_0x6199('0x6f'),'attributes':['name','fullname','internal'],'required':![]},{'model':db[_0x6199('0x70')],'as':'Tags','attributes':['id',_0x6199('0x37'),_0x6199('0x71')],'where':_0x2f4d98[_0x6199('0x41')][_0x6199('0x72')]?{'id':_0x2f4d98[_0x6199('0x41')][_0x6199('0x72')]}:undefined,'required':_0x2f4d98[_0x6199('0x41')][_0x6199('0x72')]?!![]:![]}];}return db['FaxInteraction'][_0x6199('0x54')](_0x514eca);})[_0x6199('0x1d')](function(_0x56b648){_0x269682['rows']=_0x56b648;return _0x269682;});}})[_0x6199('0x1d')](respondWithFilteredResult(_0x214e11,_0x514eca))[_0x6199('0x56')](handleError(_0x214e11,null));};exports['addApplications']=function(_0x15a17a,_0x7f38ae){var _0x25df87=_0x15a17a[_0x6199('0x58')]['id'];var _0x4f2fab=_0x15a17a['body'];var _0x1a791b=0xc8;var _0x23b3b1=null;return db[_0x6199('0x73')]['transaction']({'isolationLevel':db['sequelize'][_0x6199('0x74')][_0x6199('0x75')][_0x6199('0x76')]},function(_0x1ded83){return db[_0x6199('0x3c')][_0x6199('0x64')]({'where':{'id':_0x25df87},'transaction':_0x1ded83})['then'](function(_0x77cd5a){if(_0x77cd5a){return db['FaxApplication'][_0x6199('0x36')]({'where':{'FaxAccountId':_0x25df87},'transaction':_0x1ded83})['then'](function(){var _0x4bf341=_['map'](_0x4f2fab,function(_0xcf4471){_0xcf4471[_0x6199('0x66')]=_0x25df87;return _0xcf4471;});return db[_0x6199('0x77')]['bulkCreate'](_0x4bf341,{'transaction':_0x1ded83});});}else{_0x1a791b=0x194;_0x23b3b1=[];}});})[_0x6199('0x1d')](function(){if(_0x1a791b!==0x194){return db[_0x6199('0x77')][_0x6199('0x78')]({'where':{'FaxAccountId':_0x25df87},'order':_0x6199('0x79')})[_0x6199('0x1d')](function(_0x35ff7f){_0x23b3b1=_0x35ff7f;});}})[_0x6199('0x56')](function(_0x514c57){_0x1a791b=0x1f4;logger[_0x6199('0x21')](_0x514c57['stack']);if(_0x514c57[_0x6199('0x37')]){delete _0x514c57[_0x6199('0x37')];}_0x23b3b1=_0x514c57;})['finally'](function(){if(_0x23b3b1===null){_0x7f38ae['sendStatus'](_0x1a791b);}else{if(_0x1a791b===0x1f4){_0x7f38ae['status'](_0x1a791b)[_0x6199('0x38')](_0x23b3b1);}else{_0x7f38ae['status'](_0x1a791b)['json'](_0x23b3b1);}}});};exports[_0x6199('0x7a')]=function(_0x47a101,_0x324885,_0x275a9b){var _0x4110de={};var _0xd0213={};var _0x3b5e0f;var _0x5a73df;return db[_0x6199('0x3c')]['findOne']({'where':{'id':_0x47a101[_0x6199('0x58')]['id']}})[_0x6199('0x1d')](handleEntityNotFound(_0x324885,null))['then'](function(_0x2d51b9){if(_0x2d51b9){_0x3b5e0f=_0x2d51b9;_0xd0213[_0x6199('0x40')]=_[_0x6199('0x42')](db[_0x6199('0x77')][_0x6199('0x3d')]);_0xd0213[_0x6199('0x41')]=_[_0x6199('0x42')](_0x47a101['query']);_0xd0213['filters']=_[_0x6199('0x44')](_0xd0213['model'],_0xd0213['query']);_0x4110de['attributes']=_[_0x6199('0x44')](_0xd0213[_0x6199('0x40')],qs[_0x6199('0x45')](_0x47a101['query'][_0x6199('0x45')]));_0x4110de['attributes']=_0x4110de[_0x6199('0x43')][_0x6199('0x46')]?_0x4110de[_0x6199('0x43')]:_0xd0213[_0x6199('0x40')];_0x4110de[_0x6199('0x49')]=qs[_0x6199('0x4a')](_0x47a101[_0x6199('0x41')][_0x6199('0x4a')]);_0x4110de[_0x6199('0x4b')]=qs[_0x6199('0x4d')](_['pick'](_0x47a101[_0x6199('0x41')],_0xd0213[_0x6199('0x4d')]));if(_0x47a101[_0x6199('0x41')][_0x6199('0x4e')]){_0x4110de[_0x6199('0x4b')]=_[_0x6199('0x4f')](_0x4110de[_0x6199('0x4b')],{'$or':_[_0x6199('0x3b')](_0x4110de[_0x6199('0x43')],function(_0x155d5e){var _0x3f0d03={};_0x3f0d03[_0x155d5e]={'$like':'%'+_0x47a101['query'][_0x6199('0x4e')]+'%'};return _0x3f0d03;})});}_0x4110de=_[_0x6199('0x4f')]({},_0x4110de,_0x47a101[_0x6199('0x51')]);return _0x3b5e0f[_0x6199('0x7a')](_0x4110de);}})[_0x6199('0x1d')](function(_0x92aafa){if(_0x92aafa){_0x5a73df=_0x92aafa['length'];if(!_0x47a101['query'][_0x6199('0x47')](_0x6199('0x48'))){_0x4110de[_0x6199('0x2c')]=qs[_0x6199('0x2c')](_0x47a101['query'][_0x6199('0x2c')]);_0x4110de[_0x6199('0x2b')]=qs['offset'](_0x47a101[_0x6199('0x41')][_0x6199('0x2b')]);}return _0x3b5e0f[_0x6199('0x7a')](_0x4110de);}})[_0x6199('0x1d')](function(_0x4b1ded){if(_0x4b1ded){return _0x4b1ded?{'count':_0x5a73df,'rows':_0x4b1ded}:null;}})[_0x6199('0x1d')](respondWithResult(_0x324885,null))[_0x6199('0x56')](handleError(_0x324885,null));};function Extension(_0x82420f,_0x155ce1,_0x6d94ec,_0x32b769){this['context']=_0x6199('0x7b');this[_0x6199('0x7c')]=_0x82420f[_0x6199('0x7d')];this[_0x6199('0x7e')]=_0x32b769;this['type']=_0x6199('0x7f');this[_0x6199('0x80')]='Fax\x20Extension';this[_0x6199('0x66')]=_0x82420f['id'];this[_0x6199('0x79')]=_0x155ce1;this[_0x6199('0x81')]=_0x6d94ec;}function createExtensionsReciveFax(_0x157977){var _0x24c659=0x1;var _0x3aa3cb=[];_0x3aa3cb[_0x6199('0x82')](new Extension(_0x157977,_0x24c659,'',_0x6199('0x83')));_0x24c659+=0x1;_0x3aa3cb[_0x6199('0x82')](new Extension(_0x157977,_0x24c659,'CDR(type)=inbound-fax','Set'));_0x24c659+=0x1;for(var _0x24c08f in _0x157977){if(_0x157977[_0x6199('0x47')](_0x24c08f)&&(_0x24c08f===_0x6199('0x84')||_0x24c08f===_0x6199('0x7d')||_0x24c08f===_0x6199('0x85')||_0x24c08f===_0x6199('0x86')||_0x24c08f===_0x6199('0x87')||_0x24c08f==='maxrate'||_0x24c08f===_0x6199('0x88')||_0x24c08f===_0x6199('0x89')||_0x24c08f===_0x6199('0x8a'))){_0x3aa3cb[_0x6199('0x82')](new Extension(_0x157977,_0x24c659,'FAXOPT('+_0x24c08f+')='+_0x157977[_0x24c08f],_0x6199('0x8b')));_0x24c659+=0x1;}}_0x3aa3cb[_0x6199('0x82')](new Extension(_0x157977,_0x24c659,'6',_0x6199('0x8c')));_0x24c659+=0x1;_0x3aa3cb[_0x6199('0x82')](new Extension(_0x157977,_0x24c659,_0x6199('0x8d'),_0x6199('0x8e')));_0x24c659=0x0;return _0x3aa3cb;}exports[_0x6199('0x8f')]=function(_0x22d7e6,_0x5c80fa,_0x56d0f8){var _0x2ee668;return db[_0x6199('0x73')]['transaction'](function(_0x15d62a){return db[_0x6199('0x3c')]['create'](_0x22d7e6[_0x6199('0x5b')],{'transaction':_0x15d62a})['then'](function(_0x37388c){_0x2ee668=_0x37388c[_0x6199('0x34')]({'plain':!![]});return db[_0x6199('0x90')]['bulkCreate'](createExtensionsReciveFax(_0x2ee668),{'transaction':_0x15d62a});});})['then'](function(){return _0x2ee668;})[_0x6199('0x1d')](respondWithResult(_0x5c80fa,null))[_0x6199('0x56')](handleError(_0x5c80fa,null));};exports['updateAccountApplications']=function(_0x2615dc,_0x415605,_0x33d955){var _0x5bdbfc;return db['sequelize'][_0x6199('0x91')](function(_0x3f5936){return db[_0x6199('0x3c')][_0x6199('0x33')](_0x2615dc[_0x6199('0x5b')],{'where':{'id':_0x2615dc[_0x6199('0x5b')]['id']},'transaction':_0x3f5936})[_0x6199('0x1d')](function(_0x1af84c){return db['VoiceExtension']['destroy']({'where':{'FaxAccountId':_0x2615dc[_0x6199('0x5b')]['id']},'transaction':_0x3f5936})['then'](function(_0x3633a8){return db[_0x6199('0x90')][_0x6199('0x92')](createExtensionsReciveFax(_[_0x6199('0x6c')](_0x2615dc[_0x6199('0x5b')],[_0x6199('0x93'),_0x6199('0x3f'),_0x6199('0x94'),_0x6199('0x95'),_0x6199('0x96'),'ListId'])),{'transaction':_0x3f5936});});});})[_0x6199('0x1d')](function(){return db[_0x6199('0x3c')]['findById'](_0x2615dc['body']['id']);})[_0x6199('0x1d')](respondWithResult(_0x415605,null))[_0x6199('0x56')](handleError(_0x415605,null));};exports[_0x6199('0x97')]=function(_0x3aaa5f,_0x16b40e,_0x48b8f7){var _0x1661cd={'raw':!![],'where':{}};var _0x2a44aa={};var _0x1793e5={'count':0x0,'rows':[]};return db['FaxAccount'][_0x6199('0x64')]({'where':{'id':_0x3aaa5f[_0x6199('0x58')]['id']}})[_0x6199('0x1d')](handleEntityNotFound(_0x16b40e,null))[_0x6199('0x1d')](function(_0x27e0df){if(_0x27e0df){_0x2a44aa['model']=_[_0x6199('0x42')](db[_0x6199('0x98')][_0x6199('0x3d')]);_0x2a44aa['query']=_[_0x6199('0x42')](_0x3aaa5f[_0x6199('0x41')]);_0x2a44aa[_0x6199('0x4d')]=_[_0x6199('0x44')](_0x2a44aa[_0x6199('0x40')],_0x2a44aa[_0x6199('0x41')]);_0x1661cd[_0x6199('0x43')]=_[_0x6199('0x44')](_0x2a44aa[_0x6199('0x40')],qs[_0x6199('0x45')](_0x3aaa5f[_0x6199('0x41')][_0x6199('0x45')]));_0x1661cd[_0x6199('0x43')]=_0x1661cd[_0x6199('0x43')][_0x6199('0x46')]?_0x1661cd[_0x6199('0x43')]:_0x2a44aa[_0x6199('0x40')];if(!_0x3aaa5f[_0x6199('0x41')][_0x6199('0x47')](_0x6199('0x48'))){_0x1661cd['limit']=qs['limit'](_0x3aaa5f['query'][_0x6199('0x2c')]);_0x1661cd[_0x6199('0x2b')]=qs[_0x6199('0x2b')](_0x3aaa5f[_0x6199('0x41')][_0x6199('0x2b')]);}_0x1661cd[_0x6199('0x49')]=qs[_0x6199('0x4a')](_0x3aaa5f[_0x6199('0x41')][_0x6199('0x4a')]);_0x1661cd[_0x6199('0x4b')]=qs[_0x6199('0x4d')](_[_0x6199('0x4c')](_0x3aaa5f[_0x6199('0x41')],_0x2a44aa['filters']));_0x1661cd[_0x6199('0x4b')][_0x6199('0x66')]=_0x27e0df['id'];if(_0x3aaa5f[_0x6199('0x41')][_0x6199('0x4e')]){_0x1661cd['where']=_[_0x6199('0x4f')](_0x1661cd[_0x6199('0x4b')],{'$or':_[_0x6199('0x3b')](_0x1661cd['attributes'],function(_0x2ac9f7){var _0x205213={};_0x205213[_0x2ac9f7]={'$like':'%'+_0x3aaa5f[_0x6199('0x41')][_0x6199('0x4e')]+'%'};return _0x205213;})});}if(_0x3aaa5f['query'][_0x6199('0x99')]){var _0x3838a7=_0x3aaa5f[_0x6199('0x41')]['$gte'][_0x6199('0x9a')](',');var _0x3949f3={};_0x3949f3[_0x3838a7[0x0]]={'$gte':moment(_0x3838a7[0x1])[_0x6199('0x9b')]('YYYY-MM-DD\x20HH:mm:ss')};_0x1661cd[_0x6199('0x4b')]=_[_0x6199('0x4f')](_0x1661cd[_0x6199('0x4b')],_0x3949f3);}_0x1661cd=_['merge']({},_0x1661cd,_0x3aaa5f[_0x6199('0x51')]);return db[_0x6199('0x98')][_0x6199('0x2e')]({'where':_0x1661cd[_0x6199('0x4b')]})[_0x6199('0x1d')](function(_0x2788ca){_0x1793e5[_0x6199('0x2e')]=_0x2788ca;if(_0x3aaa5f[_0x6199('0x41')][_0x6199('0x52')]){_0x1661cd['include']=[{'all':!![]}];}return db[_0x6199('0x98')][_0x6199('0x54')](_0x1661cd);})['then'](function(_0x4e03aa){_0x1793e5[_0x6199('0x55')]=_0x4e03aa;return _0x1793e5;});}})[_0x6199('0x1d')](respondWithFilteredResult(_0x16b40e,_0x1661cd))[_0x6199('0x56')](handleError(_0x16b40e,null));};exports['send']=function(_0x112e0f,_0x2d64b1,_0xc503a5){var _0x4d99a4,_0x144837={},_0x5389a6;if(_0x112e0f[_0x6199('0x5b')]['to']){_0x5389a6=_0x112e0f[_0x6199('0x5b')]['to'][0x0];}return db[_0x6199('0x3c')][_0x6199('0x5f')]({'where':{'id':_0x112e0f['params']['id']},'include':[{'model':db[_0x6199('0x9c')],'as':_0x6199('0x9d'),'include':[{'model':db[_0x6199('0x6d')],'as':_0x6199('0x9e'),'where':{'fax':_0x5389a6},'limit':0x1,'order':[['updatedAt',_0x6199('0x9f')]]}]}]})[_0x6199('0x1d')](handleEntityNotFound(_0x2d64b1,null))[_0x6199('0x1d')](function(_0x4d5baa){_0x4d99a4=_0x4d5baa;if(_0x112e0f['body'][_0x6199('0xa0')]&&_0x112e0f[_0x6199('0x5b')][_0x6199('0xa0')][_0x6199('0x46')]){for(var _0x227ead=0x0;_0x227ead<_0x112e0f[_0x6199('0x5b')][_0x6199('0xa0')]['length'];_0x227ead+=0x1){_0x112e0f[_0x6199('0x5b')][_0x6199('0xa0')][_0x227ead]={'filename':_0x112e0f[_0x6199('0x5b')][_0x6199('0xa0')][_0x227ead][_0x6199('0x37')],'id':_0x112e0f[_0x6199('0x5b')][_0x6199('0xa0')][_0x227ead]['id'],'path':path['join'](config[_0x6199('0xa1')],_0x6199('0xa2'),_0x112e0f[_0x6199('0x5b')]['attachments'][_0x227ead][_0x6199('0xa3')])};}}return respondWithRpcPromise(_0x6199('0xa4'),_0x6199('0xa4'),{'FaxAccountId':_[_0x6199('0xa5')](_0x112e0f[_0x6199('0x58')]['id'])?undefined:_0x112e0f['params']['id'],'path':_['isNil'](_0x112e0f[_0x6199('0x5b')][_0x6199('0xa0')][0x0][_0x6199('0x7')])?undefined:_0x112e0f[_0x6199('0x5b')][_0x6199('0xa0')][0x0]['path'],'fax':_[_0x6199('0xa5')](_0x112e0f[_0x6199('0x5b')]['to'][0x0])?undefined:_0x112e0f[_0x6199('0x5b')]['to'][0x0]},client9002);})[_0x6199('0x1d')](function(){if(_0x4d99a4){if(_[_0x6199('0xa5')](_0x112e0f[_0x6199('0x5b')]['from'])){_0x112e0f['body']['from']=util[_0x6199('0x9b')](_0x6199('0xa6'),_0x4d99a4['name'],_0x4d99a4[_0x6199('0xa7')]);}if(_0x4d99a4[_0x6199('0x9d')]){if(_0x4d99a4[_0x6199('0x9d')][_0x6199('0x9e')][_0x6199('0x46')]){return _0x4d99a4['List'][_0x6199('0x9e')][0x0];}else{return db[_0x6199('0x6d')][_0x6199('0x5a')](_[_0x6199('0xa8')](_0x112e0f['body'],{'firstName':_0x112e0f[_0x6199('0x5b')]['to'][0x0],'phone':_0x112e0f[_0x6199('0x5b')]['to'][0x0],'fax':_0x112e0f[_0x6199('0x5b')]['to'][0x0],'ListId':_0x4d99a4[_0x6199('0xa9')]}));}}else{throw new Error(_0x6199('0xaa'));}}else{throw new Error('Send\x20Fax\x20failed');}})[_0x6199('0x1d')](function(_0x4572b2){if(_0x4572b2){return db[_0x6199('0x6b')][_0x6199('0x5f')]({'where':{'ContactId':_0x4572b2['id'],'closed':![],'FaxAccountId':_0x4d99a4['id']}})['then'](function(_0x3c193d){if(_0x3c193d){return[_0x3c193d,![]];}return db['FaxInteraction'][_0x6199('0x5a')]({'UserId':_0x112e0f['user']['id'],'ContactId':_0x4572b2['id'],'FaxAccountId':_0x4d99a4['id'],'fax':_0x112e0f[_0x6199('0x5b')]['to'][0x0],'firstMsgDirection':_0x6199('0xab'),'Messages':[_['merge'](_0x112e0f[_0x6199('0x5b')],{'read':![],'body':_0x112e0f[_0x6199('0x5b')][_0x6199('0xa0')][0x0]['filename'],'FaxAccountId':_0x4d99a4['id'],'UserId':_0x112e0f[_0x6199('0xac')]['id'],'ContactId':_0x4572b2['id'],'AttachmentId':_0x112e0f[_0x6199('0x5b')][_0x6199('0xa0')][0x0]['id']})]},{'include':[{'model':db[_0x6199('0x98')],'as':'Messages'}]})[_0x6199('0x1d')](function(_0x592af1){return[_0x592af1,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x6199('0xad')](function(_0x371cb5,_0x1ec7a6){if(_0x1ec7a6){return _0x371cb5;}return db[_0x6199('0x98')][_0x6199('0x5a')]({'direction':_0x6199('0xab'),'read':![],'body':_0x112e0f[_0x6199('0x5b')]['attachments'][0x0][_0x6199('0xae')],'FaxAccountId':_0x4d99a4['id'],'FaxInteractionId':_0x371cb5['id'],'UserId':_0x112e0f['user']['id'],'ContactId':_0x371cb5[_0x6199('0xaf')],'AttachmentId':_0x112e0f[_0x6199('0x5b')][_0x6199('0xa0')][0x0]['id']})['then'](function(_0xdf7164){_0x371cb5[_0x6199('0xb0')][_0x6199('0xb1')]=[];_0x371cb5['dataValues'][_0x6199('0xb1')][_0x6199('0x82')](_0xdf7164[_0x6199('0xb0')]);return _0x371cb5;});})['then'](function(_0x251180){respondWithRpcPromise(_0x6199('0xb2'),_0x6199('0xb2'),{'FaxAccountId':_[_0x6199('0xa5')](_0x112e0f[_0x6199('0x58')]['id'])?undefined:_0x112e0f[_0x6199('0x58')]['id'],'path':_['isNil'](_0x112e0f['body']['attachments'][0x0][_0x6199('0x7')])?undefined:_0x112e0f[_0x6199('0x5b')][_0x6199('0xa0')][0x0]['path'],'fax':_['isNil'](_0x112e0f[_0x6199('0x5b')]['to'][0x0])?undefined:_0x112e0f[_0x6199('0x5b')]['to'][0x0],'AttachmentId':_0x112e0f['body'][_0x6199('0xa0')][0x0]['id']},client9002)[_0x6199('0x1d')](function(_0x437379){logger[_0x6199('0x25')](_0x6199('0xb3'),_0x437379);})[_0x6199('0x56')](function(_0x46588b){logger[_0x6199('0x25')](_0x6199('0xb3'),_0x46588b);});return _0x251180;})['then'](respondWithResult(_0x2d64b1,null))[_0x6199('0x56')](handleError(_0x2d64b1,null));};exports[_0x6199('0xb4')]=function(_0x4d0515,_0x1902db,_0x64b9d7){return db[_0x6199('0x3c')][_0x6199('0x5f')]({'where':{'id':_0x4d0515['params']['id']}})['then'](handleEntityNotFound(_0x1902db,null))[_0x6199('0x1d')](function(_0x15b29c){if(_0x15b29c){return _0x15b29c[_0x6199('0xb4')](_0x4d0515[_0x6199('0x5b')]['ids'],_[_0x6199('0x6c')](_0x4d0515[_0x6199('0x5b')],[_0x6199('0x65'),'id'])||{})[_0x6199('0xad')](function(_0x37c982){for(var _0x4e1b9c=0x0;_0x4e1b9c<_0x4d0515[_0x6199('0x5b')][_0x6199('0x65')][_0x6199('0x46')];_0x4e1b9c+=0x1){socket[_0x6199('0xb5')](_0x6199('0xb6'),{'UserId':Number(_0x4d0515[_0x6199('0x5b')][_0x6199('0x65')][_0x4e1b9c]),'FaxAccountId':Number(_0x4d0515['params']['id'])});}return _0x37c982;});}})[_0x6199('0x1d')](respondWithResult(_0x1902db,null))[_0x6199('0x56')](handleError(_0x1902db,null));};exports[_0x6199('0xb7')]=function(_0x478a19,_0x486d38,_0x46b2ee){return db[_0x6199('0x3c')][_0x6199('0x5f')]({'where':{'id':_0x478a19[_0x6199('0x58')]['id']}})[_0x6199('0x1d')](handleEntityNotFound(_0x486d38,null))['then'](function(_0x156932){if(_0x156932){return _0x156932['removeAgents'](_0x478a19[_0x6199('0x41')][_0x6199('0x65')])['then'](function(){if(_[_0x6199('0xb8')](_0x478a19[_0x6199('0x41')]['ids'])){for(var _0x1b551f=0x0;_0x1b551f<_0x478a19[_0x6199('0x41')]['ids'][_0x6199('0x46')];_0x1b551f+=0x1){socket['emit'](_0x6199('0xb9'),{'UserId':Number(_0x478a19[_0x6199('0x41')][_0x6199('0x65')][_0x1b551f]),'FaxAccountId':Number(_0x478a19[_0x6199('0x58')]['id'])});}}else{socket['emit'](_0x6199('0xb9'),{'UserId':Number(_0x478a19[_0x6199('0x41')][_0x6199('0x65')]),'FaxAccountId':Number(_0x478a19[_0x6199('0x58')]['id'])});}});}})[_0x6199('0x1d')](respondWithStatusCode(_0x486d38,null))[_0x6199('0x56')](handleError(_0x486d38,null));};exports[_0x6199('0xba')]=function(_0x3d271d,_0xfe435a,_0x3c3a86){var _0x3780a4={};var _0x221bc5={};var _0xd14325;var _0x54e3fa;return db['FaxAccount'][_0x6199('0x64')]({'where':{'id':_0x3d271d['params']['id']}})[_0x6199('0x1d')](handleEntityNotFound(_0xfe435a,null))[_0x6199('0x1d')](function(_0x24febf){if(_0x24febf){_0xd14325=_0x24febf;_0x221bc5[_0x6199('0x40')]=_['keys'](db[_0x6199('0x6e')][_0x6199('0x3d')]);_0x221bc5[_0x6199('0x41')]=_[_0x6199('0x42')](_0x3d271d[_0x6199('0x41')]);_0x221bc5[_0x6199('0x4d')]=_['intersection'](_0x221bc5[_0x6199('0x40')],_0x221bc5['query']);_0x3780a4['attributes']=_[_0x6199('0x44')](_0x221bc5[_0x6199('0x40')],qs['fields'](_0x3d271d[_0x6199('0x41')]['fields']));_0x3780a4[_0x6199('0x43')]=_0x3780a4[_0x6199('0x43')][_0x6199('0x46')]?_0x3780a4['attributes']:_0x221bc5[_0x6199('0x40')];_0x3780a4[_0x6199('0x49')]=qs['sort'](_0x3d271d[_0x6199('0x41')][_0x6199('0x4a')]);_0x3780a4[_0x6199('0x4b')]=qs['filters'](_[_0x6199('0x4c')](_0x3d271d['query'],_0x221bc5['filters']));if(_0x3d271d[_0x6199('0x41')][_0x6199('0x4e')]){_0x3780a4['where']=_['merge'](_0x3780a4[_0x6199('0x4b')],{'$or':_[_0x6199('0x3b')](_0x3780a4[_0x6199('0x43')],function(_0x319f76){var _0x489808={};_0x489808[_0x319f76]={'$like':'%'+_0x3d271d[_0x6199('0x41')][_0x6199('0x4e')]+'%'};return _0x489808;})});}_0x3780a4=_[_0x6199('0x4f')]({},_0x3780a4,_0x3d271d[_0x6199('0x51')]);return _0xd14325['getAgents'](_0x3780a4);}})[_0x6199('0x1d')](function(_0x148676){if(_0x148676){_0x54e3fa=_0x148676[_0x6199('0x46')];if(!_0x3d271d[_0x6199('0x41')][_0x6199('0x47')](_0x6199('0x48'))){_0x3780a4[_0x6199('0x2c')]=qs[_0x6199('0x2c')](_0x3d271d[_0x6199('0x41')][_0x6199('0x2c')]);_0x3780a4[_0x6199('0x2b')]=qs[_0x6199('0x2b')](_0x3d271d['query'][_0x6199('0x2b')]);}return _0xd14325['getAgents'](_0x3780a4);}})['then'](function(_0x3b2b90){if(_0x3b2b90){return _0x3b2b90?{'count':_0x54e3fa,'rows':_0x3b2b90}:null;}})[_0x6199('0x1d')](respondWithResult(_0xfe435a,null))['catch'](handleError(_0xfe435a,null));}; \ No newline at end of file +var _0x07ac=['eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','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/environment','../../config/license/util','localhost','redis','./faxAccount.socket','jayson/promise','client','http','request','then','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','destroy','get','UserProfileResource','name','send','Pause','mandatoryDispositionPause','FaxAccount','rawAttributes','fieldName','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','FaxAccounts','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addDisposition','Disposition','getDispositions','pick','FaxAccountId','removeDispositions','addAnswer','CannedAnswer','removeAnswers','ids','addInteraction','FaxInteraction','omit','getInteractions','findOne','CmContact','Contact','User','Owner','Tag','Tags','tag','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','stack','finally','getApplications','description','Fax\x20Extension','appdata','push','Answer','CDR(type)=inbound-fax','Set','ecm','gateway','minrate','modem','t38timeout','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','transaction','VoiceExtension','updateAccountApplications','tech','createdAt','updatedAt','TrunkId','ListId','findById','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','CmList','List','Contacts','DESC','attachments','join','server/files/attachments','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','defaults','List\x20not\x20found','Messages','Contact\x20not\x20found','spread','out','dataValues','SendFax','info','SendFaxRpc,\x20%s','addAgents','userFaxAccount:save','emit','userFaxAccount:remove','getAgents'];(function(_0x1ae31c,_0x8dcd2d){var _0x19519d=function(_0x22b8cd){while(--_0x22b8cd){_0x1ae31c['push'](_0x1ae31c['shift']());}};_0x19519d(++_0x8dcd2d);}(_0x07ac,0x176));var _0xc07a=function(_0x55abd9,_0x1148af){_0x55abd9=_0x55abd9-0x0;var _0x3e5669=_0x07ac[_0x55abd9];return _0x3e5669;};'use strict';var emlformat=require(_0xc07a('0x0'));var rimraf=require(_0xc07a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc07a('0x2'));var rp=require(_0xc07a('0x3'));var moment=require(_0xc07a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc07a('0x5'));var util=require(_0xc07a('0x6'));var path=require(_0xc07a('0x7'));var sox=require('sox');var csv=require(_0xc07a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc07a('0x9'));var _=require(_0xc07a('0xa'));var squel=require('squel');var crypto=require(_0xc07a('0xb'));var jsforce=require(_0xc07a('0xc'));var deskjs=require(_0xc07a('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc07a('0xe'));var Papa=require(_0xc07a('0xf'));var Redis=require(_0xc07a('0x10'));var authService=require(_0xc07a('0x11'));var qs=require(_0xc07a('0x12'));var as=require(_0xc07a('0x13'));var hardwareService=require(_0xc07a('0x14'));var logger=require('../../config/logger')(_0xc07a('0x15'));var utils=require(_0xc07a('0x16'));var config=require(_0xc07a('0x17'));var licenseUtil=require(_0xc07a('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xc07a('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc07a('0x1a')]));require(_0xc07a('0x1b'))['register'](socket);var jayson=require(_0xc07a('0x1c'));var client=jayson[_0xc07a('0x1d')]['http']({'port':0x232c});var client9002=jayson['client'][_0xc07a('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x5e394e,_0x2b412a,_0x174613,_0x2ac665){return new BPromise(function(_0x62739d,_0x4ad04c){var _0x48c19d=_0x2ac665||client;return _0x48c19d[_0xc07a('0x1f')](_0x5e394e,_0x174613)[_0xc07a('0x20')](function(_0x1d7b56){logger['info'](_0xc07a('0x21'),_0x2b412a,_0xc07a('0x22'));logger[_0xc07a('0x23')](_0xc07a('0x24'),_0x2b412a,_0xc07a('0x22'),JSON['stringify'](_0x1d7b56));if(_0x1d7b56['error']){if(_0x1d7b56[_0xc07a('0x25')][_0xc07a('0x26')]===0x1f4){logger[_0xc07a('0x25')](_0xc07a('0x21'),_0x2b412a,_0x1d7b56[_0xc07a('0x25')][_0xc07a('0x27')]);return _0x4ad04c(_0x1d7b56['error'][_0xc07a('0x27')]);}logger[_0xc07a('0x25')]('FaxAccount,\x20%s,\x20%s',_0x2b412a,_0x1d7b56[_0xc07a('0x25')][_0xc07a('0x27')]);return _0x62739d(_0x1d7b56[_0xc07a('0x25')]['message']);}else{logger['info'](_0xc07a('0x21'),_0x2b412a,_0xc07a('0x22'));_0x62739d(_0x1d7b56[_0xc07a('0x28')][_0xc07a('0x27')]);}})[_0xc07a('0x29')](function(_0x43f5d4){logger[_0xc07a('0x25')](_0xc07a('0x21'),_0x2b412a,_0x43f5d4);_0x4ad04c(_0x43f5d4);});});}function respondWithStatusCode(_0xbf2d50,_0x595f9c){_0x595f9c=_0x595f9c||0xcc;return function(_0x20aafa){if(_0x20aafa){return _0xbf2d50[_0xc07a('0x2a')](_0x595f9c);}return _0xbf2d50[_0xc07a('0x2b')](_0x595f9c)[_0xc07a('0x2c')]();};}function respondWithResult(_0x16de5f,_0x439a3f){_0x439a3f=_0x439a3f||0xc8;return function(_0x3f6b63){if(_0x3f6b63){return _0x16de5f['status'](_0x439a3f)[_0xc07a('0x2d')](_0x3f6b63);}};}function respondWithFilteredResult(_0x164ca6,_0x1654ea){return function(_0x314236){if(_0x314236){var _0x30dcf6=typeof _0x1654ea['offset']===_0xc07a('0x2e')&&typeof _0x1654ea[_0xc07a('0x2f')]===_0xc07a('0x2e');var _0x456dcd=_0x314236[_0xc07a('0x30')];var _0x17fd69=_0x30dcf6?0x0:_0x1654ea[_0xc07a('0x31')];var _0x5a2ea1=_0x30dcf6?_0x314236[_0xc07a('0x30')]:_0x1654ea['offset']+_0x1654ea[_0xc07a('0x2f')];var _0x2136d6;if(_0x5a2ea1>=_0x456dcd){_0x5a2ea1=_0x456dcd;_0x2136d6=0xc8;}else{_0x2136d6=0xce;}_0x164ca6['status'](_0x2136d6);return _0x164ca6[_0xc07a('0x32')]('Content-Range',_0x17fd69+'-'+_0x5a2ea1+'/'+_0x456dcd)[_0xc07a('0x2d')](_0x314236);}return null;};}function patchUpdates(_0xce0979){return function(_0x304ae4){try{jsonpatch[_0xc07a('0x33')](_0x304ae4,_0xce0979,!![]);}catch(_0x3cf394){return BPromise[_0xc07a('0x34')](_0x3cf394);}return _0x304ae4[_0xc07a('0x35')]();};}function saveUpdates(_0x4fba3d,_0x31065b){return function(_0x1d58fb){if(_0x1d58fb){return _0x1d58fb[_0xc07a('0x36')](_0x4fba3d)[_0xc07a('0x20')](function(_0x2efa60){return _0x2efa60;});}return null;};}function removeEntity(_0x59c15d,_0x1e21b9){return function(_0x4fec98){if(_0x4fec98){return _0x4fec98[_0xc07a('0x37')]()[_0xc07a('0x20')](function(){var _0x5df82a=_0x4fec98[_0xc07a('0x38')]({'plain':!![]});var _0x5c6d8b='FaxAccounts';return db[_0xc07a('0x39')][_0xc07a('0x37')]({'where':{'type':_0x5c6d8b,'resourceId':_0x5df82a['id']}})['then'](function(){return _0x4fec98;});})[_0xc07a('0x20')](function(){_0x59c15d[_0xc07a('0x2b')](0xcc)[_0xc07a('0x2c')]();});}};}function handleEntityNotFound(_0x32fb7e,_0x1adfc6){return function(_0x5b2fc7){if(!_0x5b2fc7){_0x32fb7e[_0xc07a('0x2a')](0x194);}return _0x5b2fc7;};}function handleError(_0x27bb64,_0x1cd92b){_0x1cd92b=_0x1cd92b||0x1f4;return function(_0x55f050){logger[_0xc07a('0x25')](_0x55f050['stack']);if(_0x55f050['name']){delete _0x55f050[_0xc07a('0x3a')];}_0x27bb64[_0xc07a('0x2b')](_0x1cd92b)[_0xc07a('0x3b')](_0x55f050);};}exports['index']=function(_0x3bbe40,_0x230891){var _0x36a9fe={'include':[{'model':db[_0xc07a('0x3c')],'as':_0xc07a('0x3d')}]},_0x2bed56={},_0x237d85={'count':0x0,'rows':[]};var _0x744227=_['map'](db[_0xc07a('0x3e')][_0xc07a('0x3f')],function(_0xf17de8){return{'name':_0xf17de8[_0xc07a('0x40')],'type':_0xf17de8['type']['key']};});_0x2bed56[_0xc07a('0x41')]=_[_0xc07a('0x42')](_0x744227,'name');_0x2bed56[_0xc07a('0x43')]=_[_0xc07a('0x44')](_0x3bbe40[_0xc07a('0x43')]);_0x2bed56[_0xc07a('0x45')]=_[_0xc07a('0x46')](_0x2bed56[_0xc07a('0x41')],_0x2bed56[_0xc07a('0x43')]);_0x36a9fe[_0xc07a('0x47')]=_[_0xc07a('0x46')](_0x2bed56[_0xc07a('0x41')],qs[_0xc07a('0x48')](_0x3bbe40['query'][_0xc07a('0x48')]));_0x36a9fe['attributes']=_0x36a9fe[_0xc07a('0x47')][_0xc07a('0x49')]?_0x36a9fe[_0xc07a('0x47')]:_0x2bed56[_0xc07a('0x41')];if(!_0x3bbe40[_0xc07a('0x43')][_0xc07a('0x4a')](_0xc07a('0x4b'))){_0x36a9fe[_0xc07a('0x2f')]=qs['limit'](_0x3bbe40['query'][_0xc07a('0x2f')]);_0x36a9fe['offset']=qs[_0xc07a('0x31')](_0x3bbe40[_0xc07a('0x43')][_0xc07a('0x31')]);}_0x36a9fe[_0xc07a('0x4c')]=qs[_0xc07a('0x4d')](_0x3bbe40[_0xc07a('0x43')]['sort']);_0x36a9fe[_0xc07a('0x4e')]=qs['filters'](_['pick'](_0x3bbe40[_0xc07a('0x43')],_0x2bed56[_0xc07a('0x45')]),_0x744227);if(_0x3bbe40[_0xc07a('0x43')][_0xc07a('0x4f')]){_0x36a9fe[_0xc07a('0x4e')]=_['merge'](_0x36a9fe[_0xc07a('0x4e')],{'$or':_['map'](_0x744227,function(_0x28f9a3){if(_0x28f9a3['type']!==_0xc07a('0x50')){var _0x2cb544={};_0x2cb544[_0x28f9a3[_0xc07a('0x3a')]]={'$like':'%'+_0x3bbe40[_0xc07a('0x43')][_0xc07a('0x4f')]+'%'};return _0x2cb544;}})});}_0x36a9fe=_[_0xc07a('0x51')]({},_0x36a9fe,_0x3bbe40[_0xc07a('0x52')]);var _0x5276a2={'where':_0x36a9fe[_0xc07a('0x4e')]};return db[_0xc07a('0x3e')]['count'](_0x5276a2)[_0xc07a('0x20')](function(_0x5efabb){_0x237d85[_0xc07a('0x30')]=_0x5efabb;if(_0x3bbe40[_0xc07a('0x43')][_0xc07a('0x53')]){_0x36a9fe[_0xc07a('0x54')]=[{'all':!![]}];}return db[_0xc07a('0x3e')][_0xc07a('0x55')](_0x36a9fe);})['then'](function(_0x140b7c){_0x237d85[_0xc07a('0x56')]=_0x140b7c;return _0x237d85;})[_0xc07a('0x20')](respondWithFilteredResult(_0x230891,_0x36a9fe))[_0xc07a('0x29')](handleError(_0x230891,null));};exports['show']=function(_0x24f45a,_0x950c06){var _0x564189={'raw':![],'where':{'id':_0x24f45a[_0xc07a('0x57')]['id']},'include':[{'model':db['Pause'],'as':_0xc07a('0x3d')}]},_0x787b18={};_0x787b18[_0xc07a('0x41')]=_['keys'](db[_0xc07a('0x3e')][_0xc07a('0x3f')]);_0x787b18['query']=_[_0xc07a('0x44')](_0x24f45a['query']);_0x787b18[_0xc07a('0x45')]=_['intersection'](_0x787b18[_0xc07a('0x41')],_0x787b18[_0xc07a('0x43')]);_0x564189[_0xc07a('0x47')]=_[_0xc07a('0x46')](_0x787b18[_0xc07a('0x41')],qs['fields'](_0x24f45a['query'][_0xc07a('0x48')]));_0x564189[_0xc07a('0x47')]=_0x564189[_0xc07a('0x47')][_0xc07a('0x49')]?_0x564189[_0xc07a('0x47')]:_0x787b18[_0xc07a('0x41')];if(_0x24f45a[_0xc07a('0x43')]['includeAll']){_0x564189[_0xc07a('0x54')]=[{'all':!![]}];}_0x564189=_[_0xc07a('0x51')]({},_0x564189,_0x24f45a[_0xc07a('0x52')]);return db['FaxAccount'][_0xc07a('0x58')](_0x564189)['then'](handleEntityNotFound(_0x950c06,null))[_0xc07a('0x20')](respondWithResult(_0x950c06,null))['catch'](handleError(_0x950c06,null));};exports[_0xc07a('0x59')]=function(_0x819bc4,_0x283ceb){return db[_0xc07a('0x3e')][_0xc07a('0x59')](_0x819bc4[_0xc07a('0x5a')],{})[_0xc07a('0x20')](function(_0xe112){var _0x3b0679=_0x819bc4[_0xc07a('0x5b')][_0xc07a('0x38')]({'plain':!![]});if(!_0x3b0679)throw new Error(_0xc07a('0x5c'));if(_0x3b0679[_0xc07a('0x5d')]==='user'){var _0x1663f7=_0xe112[_0xc07a('0x38')]({'plain':!![]});var _0x4454b0=_0xc07a('0x5e');return db[_0xc07a('0x5f')][_0xc07a('0x58')]({'where':{'name':_0x4454b0,'userProfileId':_0x3b0679[_0xc07a('0x60')]},'raw':!![]})['then'](function(_0x28ec4b){if(_0x28ec4b&&_0x28ec4b[_0xc07a('0x61')]===0x0){return db[_0xc07a('0x39')][_0xc07a('0x59')]({'name':_0x1663f7['name'],'resourceId':_0x1663f7['id'],'type':_0x28ec4b[_0xc07a('0x3a')],'sectionId':_0x28ec4b['id']},{})[_0xc07a('0x20')](function(){return _0xe112;});}else{return _0xe112;}})['catch'](function(_0x445383){logger[_0xc07a('0x25')](_0xc07a('0x62'),_0x445383);throw _0x445383;});}return _0xe112;})[_0xc07a('0x20')](respondWithResult(_0x283ceb,0xc9))[_0xc07a('0x29')](handleError(_0x283ceb,null));};exports[_0xc07a('0x36')]=function(_0x40e131,_0x42914c){if(_0x40e131['body']['id']){delete _0x40e131[_0xc07a('0x5a')]['id'];}return db[_0xc07a('0x3e')][_0xc07a('0x58')]({'where':{'id':_0x40e131[_0xc07a('0x57')]['id']},'include':[{'model':db[_0xc07a('0x3c')],'as':_0xc07a('0x3d')}]})['then'](handleEntityNotFound(_0x42914c,null))[_0xc07a('0x20')](saveUpdates(_0x40e131[_0xc07a('0x5a')],null))[_0xc07a('0x20')](respondWithResult(_0x42914c,null))[_0xc07a('0x29')](handleError(_0x42914c,null));};exports[_0xc07a('0x37')]=function(_0x439292,_0x1f515a){return db[_0xc07a('0x3e')][_0xc07a('0x58')]({'where':{'id':_0x439292[_0xc07a('0x57')]['id']}})[_0xc07a('0x20')](handleEntityNotFound(_0x1f515a,null))[_0xc07a('0x20')](removeEntity(_0x1f515a,null))[_0xc07a('0x29')](handleError(_0x1f515a,null));};exports['describe']=function(_0x3dbc93,_0x3ec3e8){return db['FaxAccount']['describe']()['then'](respondWithResult(_0x3ec3e8,null))['catch'](handleError(_0x3ec3e8,null));};exports[_0xc07a('0x63')]=function(_0x6a255b,_0x30d1d9,_0x2a98f0){if(_0x6a255b[_0xc07a('0x5a')]['id']){delete _0x6a255b[_0xc07a('0x5a')]['id'];}return db[_0xc07a('0x3e')][_0xc07a('0x58')]({'where':{'id':_0x6a255b['params']['id']}})[_0xc07a('0x20')](handleEntityNotFound(_0x30d1d9,null))[_0xc07a('0x20')](function(_0x54c0d7){if(_0x54c0d7){_0x6a255b[_0xc07a('0x5a')]['FaxAccountId']=_0x54c0d7['id'];return db[_0xc07a('0x64')][_0xc07a('0x59')](_0x6a255b[_0xc07a('0x5a')]);}})[_0xc07a('0x20')](respondWithResult(_0x30d1d9,null))[_0xc07a('0x29')](handleError(_0x30d1d9,null));};exports[_0xc07a('0x65')]=function(_0x526bc7,_0x3f514f,_0x1d75e8){var _0x154b66={'raw':![],'where':{}};var _0xf2a5a1={};var _0x4f1c32={'count':0x0,'rows':[]};return db[_0xc07a('0x3e')]['findOne']({'where':{'id':_0x526bc7['params']['id']}})[_0xc07a('0x20')](handleEntityNotFound(_0x3f514f,null))['then'](function(_0x3ad093){if(_0x3ad093){_0xf2a5a1[_0xc07a('0x41')]=_[_0xc07a('0x44')](db['Disposition'][_0xc07a('0x3f')]);_0xf2a5a1[_0xc07a('0x43')]=_[_0xc07a('0x44')](_0x526bc7[_0xc07a('0x43')]);_0xf2a5a1[_0xc07a('0x45')]=_['intersection'](_0xf2a5a1['model'],_0xf2a5a1[_0xc07a('0x43')]);_0x154b66[_0xc07a('0x47')]=_[_0xc07a('0x46')](_0xf2a5a1[_0xc07a('0x41')],qs[_0xc07a('0x48')](_0x526bc7[_0xc07a('0x43')][_0xc07a('0x48')]));_0x154b66[_0xc07a('0x47')]=_0x154b66[_0xc07a('0x47')][_0xc07a('0x49')]?_0x154b66[_0xc07a('0x47')]:_0xf2a5a1[_0xc07a('0x41')];if(!_0x526bc7['query'][_0xc07a('0x4a')](_0xc07a('0x4b'))){_0x154b66[_0xc07a('0x2f')]=qs[_0xc07a('0x2f')](_0x526bc7[_0xc07a('0x43')][_0xc07a('0x2f')]);_0x154b66[_0xc07a('0x31')]=qs['offset'](_0x526bc7[_0xc07a('0x43')][_0xc07a('0x31')]);}_0x154b66['order']=qs[_0xc07a('0x4d')](_0x526bc7['query'][_0xc07a('0x4d')]);_0x154b66[_0xc07a('0x4e')]=qs[_0xc07a('0x45')](_[_0xc07a('0x66')](_0x526bc7['query'],_0xf2a5a1[_0xc07a('0x45')]));_0x154b66[_0xc07a('0x4e')][_0xc07a('0x67')]=_0x3ad093['id'];if(_0x526bc7[_0xc07a('0x43')][_0xc07a('0x4f')]){_0x154b66[_0xc07a('0x4e')]=_[_0xc07a('0x51')](_0x154b66['where'],{'$or':_[_0xc07a('0x42')](_0x154b66[_0xc07a('0x47')],function(_0x12f371){var _0x346a04={};_0x346a04[_0x12f371]={'$like':'%'+_0x526bc7['query'][_0xc07a('0x4f')]+'%'};return _0x346a04;})});}_0x154b66=_[_0xc07a('0x51')]({},_0x154b66,_0x526bc7[_0xc07a('0x52')]);return db['Disposition'][_0xc07a('0x30')]({'where':_0x154b66[_0xc07a('0x4e')]})[_0xc07a('0x20')](function(_0x31ee61){_0x4f1c32[_0xc07a('0x30')]=_0x31ee61;if(_0x526bc7['query'][_0xc07a('0x53')]){_0x154b66[_0xc07a('0x54')]=[{'all':!![]}];}return db[_0xc07a('0x64')][_0xc07a('0x55')](_0x154b66);})[_0xc07a('0x20')](function(_0x2693ba){_0x4f1c32[_0xc07a('0x56')]=_0x2693ba;return _0x4f1c32;});}})[_0xc07a('0x20')](respondWithFilteredResult(_0x3f514f,_0x154b66))[_0xc07a('0x29')](handleError(_0x3f514f,null));};exports[_0xc07a('0x68')]=function(_0xe14504,_0x4b4a65,_0x440a1b){return db[_0xc07a('0x3e')]['find']({'where':{'id':_0xe14504[_0xc07a('0x57')]['id']}})['then'](handleEntityNotFound(_0x4b4a65,null))['then'](function(_0x13be9a){if(_0x13be9a){return _0x13be9a[_0xc07a('0x68')](_0xe14504[_0xc07a('0x43')]['ids']);}})[_0xc07a('0x20')](respondWithStatusCode(_0x4b4a65,null))[_0xc07a('0x29')](handleError(_0x4b4a65,null));};exports[_0xc07a('0x69')]=function(_0x3aa5a9,_0x74468f,_0x46679e){if(_0x3aa5a9['body']['id']){delete _0x3aa5a9[_0xc07a('0x5a')]['id'];}return db[_0xc07a('0x3e')][_0xc07a('0x58')]({'where':{'id':_0x3aa5a9['params']['id']}})[_0xc07a('0x20')](handleEntityNotFound(_0x74468f,null))[_0xc07a('0x20')](function(_0x39ef2d){if(_0x39ef2d){_0x3aa5a9[_0xc07a('0x5a')][_0xc07a('0x67')]=_0x39ef2d['id'];return db[_0xc07a('0x6a')][_0xc07a('0x59')](_0x3aa5a9[_0xc07a('0x5a')]);}})['then'](respondWithResult(_0x74468f,null))['catch'](handleError(_0x74468f,null));};exports['getAnswers']=function(_0x3fce93,_0x1aa6c1,_0x4d6f82){var _0x455fbf={'raw':![],'where':{}};var _0x590b2b={};var _0x54d537={'count':0x0,'rows':[]};return db[_0xc07a('0x3e')]['findOne']({'where':{'id':_0x3fce93[_0xc07a('0x57')]['id']}})[_0xc07a('0x20')](handleEntityNotFound(_0x1aa6c1,null))[_0xc07a('0x20')](function(_0x47b094){if(_0x47b094){_0x590b2b[_0xc07a('0x41')]=_[_0xc07a('0x44')](db[_0xc07a('0x6a')][_0xc07a('0x3f')]);_0x590b2b[_0xc07a('0x43')]=_[_0xc07a('0x44')](_0x3fce93['query']);_0x590b2b[_0xc07a('0x45')]=_['intersection'](_0x590b2b[_0xc07a('0x41')],_0x590b2b['query']);_0x455fbf[_0xc07a('0x47')]=_['intersection'](_0x590b2b[_0xc07a('0x41')],qs[_0xc07a('0x48')](_0x3fce93[_0xc07a('0x43')][_0xc07a('0x48')]));_0x455fbf[_0xc07a('0x47')]=_0x455fbf[_0xc07a('0x47')][_0xc07a('0x49')]?_0x455fbf['attributes']:_0x590b2b[_0xc07a('0x41')];if(!_0x3fce93[_0xc07a('0x43')][_0xc07a('0x4a')](_0xc07a('0x4b'))){_0x455fbf['limit']=qs[_0xc07a('0x2f')](_0x3fce93[_0xc07a('0x43')]['limit']);_0x455fbf[_0xc07a('0x31')]=qs[_0xc07a('0x31')](_0x3fce93['query'][_0xc07a('0x31')]);}_0x455fbf[_0xc07a('0x4c')]=qs['sort'](_0x3fce93[_0xc07a('0x43')][_0xc07a('0x4d')]);_0x455fbf[_0xc07a('0x4e')]=qs[_0xc07a('0x45')](_['pick'](_0x3fce93['query'],_0x590b2b[_0xc07a('0x45')]));_0x455fbf[_0xc07a('0x4e')][_0xc07a('0x67')]=_0x47b094['id'];if(_0x3fce93['query'][_0xc07a('0x4f')]){_0x455fbf['where']=_['merge'](_0x455fbf['where'],{'$or':_[_0xc07a('0x42')](_0x455fbf[_0xc07a('0x47')],function(_0x2bcb45){var _0x106fc4={};_0x106fc4[_0x2bcb45]={'$like':'%'+_0x3fce93[_0xc07a('0x43')][_0xc07a('0x4f')]+'%'};return _0x106fc4;})});}_0x455fbf=_[_0xc07a('0x51')]({},_0x455fbf,_0x3fce93[_0xc07a('0x52')]);return db[_0xc07a('0x6a')][_0xc07a('0x30')]({'where':_0x455fbf[_0xc07a('0x4e')]})[_0xc07a('0x20')](function(_0x35d847){_0x54d537[_0xc07a('0x30')]=_0x35d847;if(_0x3fce93[_0xc07a('0x43')][_0xc07a('0x53')]){_0x455fbf['include']=[{'all':!![]}];}return db[_0xc07a('0x6a')][_0xc07a('0x55')](_0x455fbf);})[_0xc07a('0x20')](function(_0x3a2f29){_0x54d537[_0xc07a('0x56')]=_0x3a2f29;return _0x54d537;});}})[_0xc07a('0x20')](respondWithFilteredResult(_0x1aa6c1,_0x455fbf))[_0xc07a('0x29')](handleError(_0x1aa6c1,null));};exports[_0xc07a('0x6b')]=function(_0x52e5d6,_0x437383,_0x5de48a){return db['FaxAccount'][_0xc07a('0x58')]({'where':{'id':_0x52e5d6['params']['id']}})[_0xc07a('0x20')](handleEntityNotFound(_0x437383,null))[_0xc07a('0x20')](function(_0xfbfaa2){if(_0xfbfaa2){return _0xfbfaa2[_0xc07a('0x6b')](_0x52e5d6[_0xc07a('0x43')][_0xc07a('0x6c')]);}})['then'](respondWithStatusCode(_0x437383,null))[_0xc07a('0x29')](handleError(_0x437383,null));};exports[_0xc07a('0x6d')]=function(_0x22785d,_0x28954c,_0x13a955){return db[_0xc07a('0x6e')]['find']({'where':{'id':_0x22785d[_0xc07a('0x57')]['id']}})[_0xc07a('0x20')](handleEntityNotFound(_0x28954c,null))[_0xc07a('0x20')](function(_0x14751b){if(_0x14751b){return _0x14751b['addInteraction'](_0x22785d[_0xc07a('0x5a')][_0xc07a('0x6c')],_[_0xc07a('0x6f')](_0x22785d[_0xc07a('0x5a')],[_0xc07a('0x6c'),'id'])||{});}})[_0xc07a('0x20')](respondWithResult(_0x28954c,null))['catch'](handleError(_0x28954c,null));};exports[_0xc07a('0x70')]=function(_0x35eb59,_0x4fec4a,_0x474501){var _0x4c733d={'raw':![],'where':{}};var _0x42d15c={};var _0x5ef1b4={'count':0x0,'rows':[]};return db[_0xc07a('0x3e')][_0xc07a('0x71')]({'where':{'id':_0x35eb59[_0xc07a('0x57')]['id']}})['then'](handleEntityNotFound(_0x4fec4a,null))[_0xc07a('0x20')](function(_0x5de481){if(_0x5de481){_0x42d15c[_0xc07a('0x41')]=_[_0xc07a('0x44')](db[_0xc07a('0x6e')][_0xc07a('0x3f')]);_0x42d15c[_0xc07a('0x43')]=_[_0xc07a('0x44')](_0x35eb59[_0xc07a('0x43')]);_0x42d15c['filters']=_[_0xc07a('0x46')](_0x42d15c['model'],_0x42d15c[_0xc07a('0x43')]);_0x4c733d[_0xc07a('0x47')]=_['intersection'](_0x42d15c[_0xc07a('0x41')],qs[_0xc07a('0x48')](_0x35eb59['query'][_0xc07a('0x48')]));_0x4c733d[_0xc07a('0x47')]=_0x4c733d[_0xc07a('0x47')]['length']?_0x4c733d[_0xc07a('0x47')]:_0x42d15c[_0xc07a('0x41')];if(!_0x35eb59[_0xc07a('0x43')]['hasOwnProperty'](_0xc07a('0x4b'))){_0x4c733d[_0xc07a('0x2f')]=qs[_0xc07a('0x2f')](_0x35eb59[_0xc07a('0x43')][_0xc07a('0x2f')]);_0x4c733d['offset']=qs[_0xc07a('0x31')](_0x35eb59[_0xc07a('0x43')][_0xc07a('0x31')]);}_0x4c733d[_0xc07a('0x4c')]=qs[_0xc07a('0x4d')](_0x35eb59[_0xc07a('0x43')]['sort']);_0x4c733d[_0xc07a('0x4e')]=qs[_0xc07a('0x45')](_[_0xc07a('0x66')](_0x35eb59[_0xc07a('0x43')],_0x42d15c[_0xc07a('0x45')]));_0x4c733d[_0xc07a('0x4e')][_0xc07a('0x67')]=_0x5de481['id'];if(_0x35eb59[_0xc07a('0x43')]['filter']){_0x4c733d[_0xc07a('0x4e')]=_[_0xc07a('0x51')](_0x4c733d[_0xc07a('0x4e')],{'$or':_[_0xc07a('0x42')](_0x4c733d[_0xc07a('0x47')],function(_0xd2d0e1){var _0x1f5120={};_0x1f5120[_0xd2d0e1]={'$like':'%'+_0x35eb59['query']['filter']+'%'};return _0x1f5120;})});}_0x4c733d=_[_0xc07a('0x51')]({},_0x4c733d,_0x35eb59[_0xc07a('0x52')]);return db[_0xc07a('0x6e')][_0xc07a('0x30')]({'where':_0x4c733d[_0xc07a('0x4e')]})['then'](function(_0x193eac){_0x5ef1b4['count']=_0x193eac;if(_0x35eb59[_0xc07a('0x43')]['includeAll']){_0x4c733d['include']=[{'model':db[_0xc07a('0x72')],'as':_0xc07a('0x73'),'required':![]},{'model':db[_0xc07a('0x74')],'as':_0xc07a('0x75'),'attributes':[_0xc07a('0x3a'),'fullname','internal'],'required':![]},{'model':db[_0xc07a('0x76')],'as':_0xc07a('0x77'),'attributes':['id',_0xc07a('0x3a'),'color'],'where':_0x35eb59['query']['tag']?{'id':_0x35eb59['query'][_0xc07a('0x78')]}:undefined,'required':_0x35eb59['query'][_0xc07a('0x78')]?!![]:![]}];}return db[_0xc07a('0x6e')][_0xc07a('0x55')](_0x4c733d);})[_0xc07a('0x20')](function(_0x239f04){_0x5ef1b4[_0xc07a('0x56')]=_0x239f04;return _0x5ef1b4;});}})[_0xc07a('0x20')](respondWithFilteredResult(_0x4fec4a,_0x4c733d))[_0xc07a('0x29')](handleError(_0x4fec4a,null));};exports['addApplications']=function(_0x12069d,_0x4acada){var _0x106e6f=_0x12069d['params']['id'];var _0x2edafd=_0x12069d['body'];var _0x33f4e1=0xc8;var _0x56d7fe=null;return db[_0xc07a('0x79')]['transaction']({'isolationLevel':db['sequelize'][_0xc07a('0x7a')][_0xc07a('0x7b')][_0xc07a('0x7c')]},function(_0xeaca71){return db[_0xc07a('0x3e')][_0xc07a('0x71')]({'where':{'id':_0x106e6f},'transaction':_0xeaca71})[_0xc07a('0x20')](function(_0x22eb1f){if(_0x22eb1f){return db[_0xc07a('0x7d')][_0xc07a('0x37')]({'where':{'FaxAccountId':_0x106e6f},'transaction':_0xeaca71})[_0xc07a('0x20')](function(){var _0x56b0b2=_[_0xc07a('0x42')](_0x2edafd,function(_0x52a978){_0x52a978['FaxAccountId']=_0x106e6f;return _0x52a978;});return db[_0xc07a('0x7d')][_0xc07a('0x7e')](_0x56b0b2,{'transaction':_0xeaca71});});}else{_0x33f4e1=0x194;_0x56d7fe=[];}});})[_0xc07a('0x20')](function(){if(_0x33f4e1!==0x194){return db[_0xc07a('0x7d')]['findAndCountAll']({'where':{'FaxAccountId':_0x106e6f},'order':'priority'})['then'](function(_0x4cc770){_0x56d7fe=_0x4cc770;});}})[_0xc07a('0x29')](function(_0x494f89){_0x33f4e1=0x1f4;logger[_0xc07a('0x25')](_0x494f89[_0xc07a('0x7f')]);if(_0x494f89[_0xc07a('0x3a')]){delete _0x494f89[_0xc07a('0x3a')];}_0x56d7fe=_0x494f89;})[_0xc07a('0x80')](function(){if(_0x56d7fe===null){_0x4acada['sendStatus'](_0x33f4e1);}else{if(_0x33f4e1===0x1f4){_0x4acada['status'](_0x33f4e1)[_0xc07a('0x3b')](_0x56d7fe);}else{_0x4acada[_0xc07a('0x2b')](_0x33f4e1)['json'](_0x56d7fe);}}});};exports[_0xc07a('0x81')]=function(_0x641d1c,_0x4acf85,_0x4da6f1){var _0x122f9e={};var _0x161e02={};var _0x1ddcf1;var _0x43cd77;return db[_0xc07a('0x3e')][_0xc07a('0x71')]({'where':{'id':_0x641d1c['params']['id']}})[_0xc07a('0x20')](handleEntityNotFound(_0x4acf85,null))[_0xc07a('0x20')](function(_0x358465){if(_0x358465){_0x1ddcf1=_0x358465;_0x161e02['model']=_[_0xc07a('0x44')](db[_0xc07a('0x7d')][_0xc07a('0x3f')]);_0x161e02[_0xc07a('0x43')]=_[_0xc07a('0x44')](_0x641d1c[_0xc07a('0x43')]);_0x161e02[_0xc07a('0x45')]=_[_0xc07a('0x46')](_0x161e02['model'],_0x161e02[_0xc07a('0x43')]);_0x122f9e[_0xc07a('0x47')]=_[_0xc07a('0x46')](_0x161e02[_0xc07a('0x41')],qs['fields'](_0x641d1c[_0xc07a('0x43')][_0xc07a('0x48')]));_0x122f9e['attributes']=_0x122f9e[_0xc07a('0x47')][_0xc07a('0x49')]?_0x122f9e[_0xc07a('0x47')]:_0x161e02[_0xc07a('0x41')];_0x122f9e['order']=qs[_0xc07a('0x4d')](_0x641d1c['query']['sort']);_0x122f9e['where']=qs[_0xc07a('0x45')](_['pick'](_0x641d1c[_0xc07a('0x43')],_0x161e02[_0xc07a('0x45')]));if(_0x641d1c['query']['filter']){_0x122f9e['where']=_['merge'](_0x122f9e[_0xc07a('0x4e')],{'$or':_['map'](_0x122f9e[_0xc07a('0x47')],function(_0x149ec7){var _0x4da240={};_0x4da240[_0x149ec7]={'$like':'%'+_0x641d1c[_0xc07a('0x43')][_0xc07a('0x4f')]+'%'};return _0x4da240;})});}_0x122f9e=_[_0xc07a('0x51')]({},_0x122f9e,_0x641d1c[_0xc07a('0x52')]);return _0x1ddcf1['getApplications'](_0x122f9e);}})[_0xc07a('0x20')](function(_0x2d9618){if(_0x2d9618){_0x43cd77=_0x2d9618[_0xc07a('0x49')];if(!_0x641d1c[_0xc07a('0x43')][_0xc07a('0x4a')](_0xc07a('0x4b'))){_0x122f9e[_0xc07a('0x2f')]=qs[_0xc07a('0x2f')](_0x641d1c[_0xc07a('0x43')][_0xc07a('0x2f')]);_0x122f9e[_0xc07a('0x31')]=qs[_0xc07a('0x31')](_0x641d1c[_0xc07a('0x43')]['offset']);}return _0x1ddcf1[_0xc07a('0x81')](_0x122f9e);}})[_0xc07a('0x20')](function(_0x5ab827){if(_0x5ab827){return _0x5ab827?{'count':_0x43cd77,'rows':_0x5ab827}:null;}})[_0xc07a('0x20')](respondWithResult(_0x4acf85,null))[_0xc07a('0x29')](handleError(_0x4acf85,null));};function Extension(_0x511bf6,_0x5035d0,_0x5c9bdc,_0x5d2ee6){this['context']='from-voip-provider';this['exten']=_0x511bf6['localstationid'];this['app']=_0x5d2ee6;this['type']='system';this[_0xc07a('0x82')]=_0xc07a('0x83');this[_0xc07a('0x67')]=_0x511bf6['id'];this['priority']=_0x5035d0;this[_0xc07a('0x84')]=_0x5c9bdc;}function createExtensionsReciveFax(_0x4ca465){var _0x2558bf=0x1;var _0x5c4cd7=[];_0x5c4cd7[_0xc07a('0x85')](new Extension(_0x4ca465,_0x2558bf,'',_0xc07a('0x86')));_0x2558bf+=0x1;_0x5c4cd7['push'](new Extension(_0x4ca465,_0x2558bf,_0xc07a('0x87'),_0xc07a('0x88')));_0x2558bf+=0x1;for(var _0x262d9e in _0x4ca465){if(_0x4ca465['hasOwnProperty'](_0x262d9e)&&(_0x262d9e===_0xc07a('0x89')||_0x262d9e==='localstationid'||_0x262d9e===_0xc07a('0x8a')||_0x262d9e==='faxdetect'||_0x262d9e==='headerinfo'||_0x262d9e==='maxrate'||_0x262d9e===_0xc07a('0x8b')||_0x262d9e===_0xc07a('0x8c')||_0x262d9e===_0xc07a('0x8d'))){_0x5c4cd7[_0xc07a('0x85')](new Extension(_0x4ca465,_0x2558bf,_0xc07a('0x8e')+_0x262d9e+')='+_0x4ca465[_0x262d9e],_0xc07a('0x88')));_0x2558bf+=0x1;}}_0x5c4cd7[_0xc07a('0x85')](new Extension(_0x4ca465,_0x2558bf,'6',_0xc07a('0x8f')));_0x2558bf+=0x1;_0x5c4cd7[_0xc07a('0x85')](new Extension(_0x4ca465,_0x2558bf,_0xc07a('0x90'),'ReceiveFax'));_0x2558bf=0x0;return _0x5c4cd7;}exports['addAccountApplications']=function(_0x15e9c5,_0x24b4ee,_0x199b3a){var _0x38e95c;return db[_0xc07a('0x79')][_0xc07a('0x91')](function(_0x4264f2){return db[_0xc07a('0x3e')]['create'](_0x15e9c5[_0xc07a('0x5a')],{'transaction':_0x4264f2})['then'](function(_0x4ff973){_0x38e95c=_0x4ff973[_0xc07a('0x38')]({'plain':!![]});return db[_0xc07a('0x92')][_0xc07a('0x7e')](createExtensionsReciveFax(_0x38e95c),{'transaction':_0x4264f2});});})['then'](function(){return _0x38e95c;})[_0xc07a('0x20')](respondWithResult(_0x24b4ee,null))[_0xc07a('0x29')](handleError(_0x24b4ee,null));};exports[_0xc07a('0x93')]=function(_0x4aec34,_0x2f1064,_0x84d166){var _0x3ce961;return db[_0xc07a('0x79')][_0xc07a('0x91')](function(_0x1c2397){return db[_0xc07a('0x3e')]['update'](_0x4aec34[_0xc07a('0x5a')],{'where':{'id':_0x4aec34[_0xc07a('0x5a')]['id']},'transaction':_0x1c2397})[_0xc07a('0x20')](function(_0x5f35da){return db['VoiceExtension'][_0xc07a('0x37')]({'where':{'FaxAccountId':_0x4aec34[_0xc07a('0x5a')]['id']},'transaction':_0x1c2397})[_0xc07a('0x20')](function(_0x5dc837){return db[_0xc07a('0x92')][_0xc07a('0x7e')](createExtensionsReciveFax(_[_0xc07a('0x6f')](_0x4aec34[_0xc07a('0x5a')],[_0xc07a('0x94'),'key',_0xc07a('0x95'),_0xc07a('0x96'),_0xc07a('0x97'),_0xc07a('0x98')])),{'transaction':_0x1c2397});});});})['then'](function(){return db['FaxAccount'][_0xc07a('0x99')](_0x4aec34['body']['id']);})[_0xc07a('0x20')](respondWithResult(_0x2f1064,null))[_0xc07a('0x29')](handleError(_0x2f1064,null));};exports[_0xc07a('0x9a')]=function(_0x54d963,_0x1e9dba,_0x40620d){var _0x1ef54c={'raw':!![],'where':{}};var _0xec512a={};var _0x31b6ce={'count':0x0,'rows':[]};return db[_0xc07a('0x3e')][_0xc07a('0x71')]({'where':{'id':_0x54d963['params']['id']}})['then'](handleEntityNotFound(_0x1e9dba,null))[_0xc07a('0x20')](function(_0x1e77f3){if(_0x1e77f3){_0xec512a[_0xc07a('0x41')]=_[_0xc07a('0x44')](db['FaxMessage'][_0xc07a('0x3f')]);_0xec512a[_0xc07a('0x43')]=_[_0xc07a('0x44')](_0x54d963[_0xc07a('0x43')]);_0xec512a['filters']=_[_0xc07a('0x46')](_0xec512a[_0xc07a('0x41')],_0xec512a[_0xc07a('0x43')]);_0x1ef54c[_0xc07a('0x47')]=_['intersection'](_0xec512a[_0xc07a('0x41')],qs[_0xc07a('0x48')](_0x54d963[_0xc07a('0x43')][_0xc07a('0x48')]));_0x1ef54c[_0xc07a('0x47')]=_0x1ef54c[_0xc07a('0x47')][_0xc07a('0x49')]?_0x1ef54c[_0xc07a('0x47')]:_0xec512a[_0xc07a('0x41')];if(!_0x54d963['query'][_0xc07a('0x4a')](_0xc07a('0x4b'))){_0x1ef54c[_0xc07a('0x2f')]=qs[_0xc07a('0x2f')](_0x54d963[_0xc07a('0x43')][_0xc07a('0x2f')]);_0x1ef54c['offset']=qs[_0xc07a('0x31')](_0x54d963[_0xc07a('0x43')]['offset']);}_0x1ef54c['order']=qs[_0xc07a('0x4d')](_0x54d963[_0xc07a('0x43')][_0xc07a('0x4d')]);_0x1ef54c['where']=qs[_0xc07a('0x45')](_[_0xc07a('0x66')](_0x54d963['query'],_0xec512a['filters']));_0x1ef54c[_0xc07a('0x4e')][_0xc07a('0x67')]=_0x1e77f3['id'];if(_0x54d963[_0xc07a('0x43')][_0xc07a('0x4f')]){_0x1ef54c[_0xc07a('0x4e')]=_['merge'](_0x1ef54c[_0xc07a('0x4e')],{'$or':_[_0xc07a('0x42')](_0x1ef54c[_0xc07a('0x47')],function(_0x5b1aa3){var _0x501cb6={};_0x501cb6[_0x5b1aa3]={'$like':'%'+_0x54d963[_0xc07a('0x43')][_0xc07a('0x4f')]+'%'};return _0x501cb6;})});}if(_0x54d963[_0xc07a('0x43')]['$gte']){var _0x1f6220=_0x54d963[_0xc07a('0x43')][_0xc07a('0x9b')][_0xc07a('0x9c')](',');var _0x3074a6={};_0x3074a6[_0x1f6220[0x0]]={'$gte':moment(_0x1f6220[0x1])[_0xc07a('0x9d')](_0xc07a('0x9e'))};_0x1ef54c['where']=_['merge'](_0x1ef54c['where'],_0x3074a6);}_0x1ef54c=_[_0xc07a('0x51')]({},_0x1ef54c,_0x54d963[_0xc07a('0x52')]);return db['FaxMessage'][_0xc07a('0x30')]({'where':_0x1ef54c['where']})[_0xc07a('0x20')](function(_0x5e4813){_0x31b6ce[_0xc07a('0x30')]=_0x5e4813;if(_0x54d963['query'][_0xc07a('0x53')]){_0x1ef54c['include']=[{'all':!![]}];}return db[_0xc07a('0x9f')]['findAll'](_0x1ef54c);})[_0xc07a('0x20')](function(_0x262ada){_0x31b6ce[_0xc07a('0x56')]=_0x262ada;return _0x31b6ce;});}})[_0xc07a('0x20')](respondWithFilteredResult(_0x1e9dba,_0x1ef54c))['catch'](handleError(_0x1e9dba,null));};exports[_0xc07a('0x3b')]=function(_0x53dbe0,_0x329c98,_0x58c117){var _0x11ec18,_0x17271c={},_0x384717;if(_0x53dbe0[_0xc07a('0x5a')]['to']){_0x384717=_0x53dbe0['body']['to'][0x0];}return db[_0xc07a('0x3e')]['find']({'where':{'id':_0x53dbe0[_0xc07a('0x57')]['id']},'include':[{'model':db[_0xc07a('0xa0')],'as':_0xc07a('0xa1'),'include':[{'model':db[_0xc07a('0x72')],'as':_0xc07a('0xa2'),'where':{'fax':_0x384717},'limit':0x1,'order':[['updatedAt',_0xc07a('0xa3')]]}]}]})[_0xc07a('0x20')](handleEntityNotFound(_0x329c98,null))[_0xc07a('0x20')](function(_0xa97c1c){_0x11ec18=_0xa97c1c;if(_0x53dbe0[_0xc07a('0x5a')]['attachments']&&_0x53dbe0[_0xc07a('0x5a')][_0xc07a('0xa4')]['length']){for(var _0x221886=0x0;_0x221886<_0x53dbe0['body']['attachments']['length'];_0x221886+=0x1){_0x53dbe0[_0xc07a('0x5a')][_0xc07a('0xa4')][_0x221886]={'filename':_0x53dbe0[_0xc07a('0x5a')][_0xc07a('0xa4')][_0x221886][_0xc07a('0x3a')],'id':_0x53dbe0[_0xc07a('0x5a')]['attachments'][_0x221886]['id'],'path':path[_0xc07a('0xa5')](config['root'],_0xc07a('0xa6'),_0x53dbe0['body'][_0xc07a('0xa4')][_0x221886]['basename'])};}}return respondWithRpcPromise(_0xc07a('0xa7'),_0xc07a('0xa7'),{'FaxAccountId':_[_0xc07a('0xa8')](_0x53dbe0[_0xc07a('0x57')]['id'])?undefined:_0x53dbe0['params']['id'],'path':_[_0xc07a('0xa8')](_0x53dbe0[_0xc07a('0x5a')][_0xc07a('0xa4')][0x0][_0xc07a('0x7')])?undefined:_0x53dbe0[_0xc07a('0x5a')][_0xc07a('0xa4')][0x0]['path'],'fax':_[_0xc07a('0xa8')](_0x53dbe0[_0xc07a('0x5a')]['to'][0x0])?undefined:_0x53dbe0[_0xc07a('0x5a')]['to'][0x0]},client9002);})['then'](function(){if(_0x11ec18){if(_[_0xc07a('0xa8')](_0x53dbe0[_0xc07a('0x5a')]['from'])){_0x53dbe0[_0xc07a('0x5a')][_0xc07a('0xa9')]=util[_0xc07a('0x9d')](_0xc07a('0xaa'),_0x11ec18[_0xc07a('0x3a')],_0x11ec18[_0xc07a('0xab')]);}if(_0x11ec18[_0xc07a('0xa1')]){if(_0x11ec18['List'][_0xc07a('0xa2')]['length']){return _0x11ec18[_0xc07a('0xa1')]['Contacts'][0x0];}else{return db[_0xc07a('0x72')]['create'](_[_0xc07a('0xac')](_0x53dbe0[_0xc07a('0x5a')],{'firstName':_0x53dbe0[_0xc07a('0x5a')]['to'][0x0],'phone':_0x53dbe0[_0xc07a('0x5a')]['to'][0x0],'fax':_0x53dbe0[_0xc07a('0x5a')]['to'][0x0],'ListId':_0x11ec18['ListId']}));}}else{throw new Error(_0xc07a('0xad'));}}else{throw new Error('Send\x20Fax\x20failed');}})[_0xc07a('0x20')](function(_0x503e9c){if(_0x503e9c){return db['FaxInteraction'][_0xc07a('0x58')]({'where':{'ContactId':_0x503e9c['id'],'closed':![],'FaxAccountId':_0x11ec18['id']}})[_0xc07a('0x20')](function(_0x5d5b8c){if(_0x5d5b8c){return[_0x5d5b8c,![]];}return db[_0xc07a('0x6e')]['create']({'UserId':_0x53dbe0['user']['id'],'ContactId':_0x503e9c['id'],'FaxAccountId':_0x11ec18['id'],'fax':_0x53dbe0[_0xc07a('0x5a')]['to'][0x0],'firstMsgDirection':'out','Messages':[_['merge'](_0x53dbe0[_0xc07a('0x5a')],{'read':![],'body':_0x53dbe0[_0xc07a('0x5a')][_0xc07a('0xa4')][0x0]['filename'],'FaxAccountId':_0x11ec18['id'],'UserId':_0x53dbe0[_0xc07a('0x5b')]['id'],'ContactId':_0x503e9c['id'],'AttachmentId':_0x53dbe0['body'][_0xc07a('0xa4')][0x0]['id']})]},{'include':[{'model':db[_0xc07a('0x9f')],'as':_0xc07a('0xae')}]})[_0xc07a('0x20')](function(_0x2f4341){return[_0x2f4341,!![]];});});}else{throw new Error(_0xc07a('0xaf'));}})[_0xc07a('0xb0')](function(_0x5e19f1,_0x863e8){if(_0x863e8){return _0x5e19f1;}return db[_0xc07a('0x9f')][_0xc07a('0x59')]({'direction':_0xc07a('0xb1'),'read':![],'body':_0x53dbe0['body'][_0xc07a('0xa4')][0x0]['filename'],'FaxAccountId':_0x11ec18['id'],'FaxInteractionId':_0x5e19f1['id'],'UserId':_0x53dbe0['user']['id'],'ContactId':_0x5e19f1['ContactId'],'AttachmentId':_0x53dbe0[_0xc07a('0x5a')]['attachments'][0x0]['id']})[_0xc07a('0x20')](function(_0x407952){_0x5e19f1[_0xc07a('0xb2')][_0xc07a('0xae')]=[];_0x5e19f1[_0xc07a('0xb2')][_0xc07a('0xae')][_0xc07a('0x85')](_0x407952['dataValues']);return _0x5e19f1;});})[_0xc07a('0x20')](function(_0x1a20ae){respondWithRpcPromise(_0xc07a('0xb3'),_0xc07a('0xb3'),{'FaxAccountId':_[_0xc07a('0xa8')](_0x53dbe0['params']['id'])?undefined:_0x53dbe0[_0xc07a('0x57')]['id'],'path':_['isNil'](_0x53dbe0[_0xc07a('0x5a')][_0xc07a('0xa4')][0x0][_0xc07a('0x7')])?undefined:_0x53dbe0[_0xc07a('0x5a')][_0xc07a('0xa4')][0x0][_0xc07a('0x7')],'fax':_[_0xc07a('0xa8')](_0x53dbe0['body']['to'][0x0])?undefined:_0x53dbe0['body']['to'][0x0],'AttachmentId':_0x53dbe0['body'][_0xc07a('0xa4')][0x0]['id']},client9002)[_0xc07a('0x20')](function(_0x179b76){logger[_0xc07a('0xb4')](_0xc07a('0xb5'),_0x179b76);})['catch'](function(_0x4eda24){logger[_0xc07a('0xb4')](_0xc07a('0xb5'),_0x4eda24);});return _0x1a20ae;})[_0xc07a('0x20')](respondWithResult(_0x329c98,null))[_0xc07a('0x29')](handleError(_0x329c98,null));};exports[_0xc07a('0xb6')]=function(_0x5a342e,_0x279f84,_0x17579d){return db['FaxAccount']['find']({'where':{'id':_0x5a342e[_0xc07a('0x57')]['id']}})['then'](handleEntityNotFound(_0x279f84,null))[_0xc07a('0x20')](function(_0x293068){if(_0x293068){return _0x293068[_0xc07a('0xb6')](_0x5a342e['body'][_0xc07a('0x6c')],_['omit'](_0x5a342e[_0xc07a('0x5a')],['ids','id'])||{})[_0xc07a('0xb0')](function(_0x4f25bc){for(var _0x4c27ea=0x0;_0x4c27ea<_0x5a342e['body'][_0xc07a('0x6c')][_0xc07a('0x49')];_0x4c27ea+=0x1){socket['emit'](_0xc07a('0xb7'),{'UserId':Number(_0x5a342e['body'][_0xc07a('0x6c')][_0x4c27ea]),'FaxAccountId':Number(_0x5a342e[_0xc07a('0x57')]['id'])});}return _0x4f25bc;});}})[_0xc07a('0x20')](respondWithResult(_0x279f84,null))['catch'](handleError(_0x279f84,null));};exports['removeAgents']=function(_0x1b80ae,_0x5cf297,_0x3dc81b){return db[_0xc07a('0x3e')][_0xc07a('0x58')]({'where':{'id':_0x1b80ae[_0xc07a('0x57')]['id']}})[_0xc07a('0x20')](handleEntityNotFound(_0x5cf297,null))['then'](function(_0x4902df){if(_0x4902df){return _0x4902df['removeAgents'](_0x1b80ae[_0xc07a('0x43')][_0xc07a('0x6c')])['then'](function(){if(_['isArray'](_0x1b80ae[_0xc07a('0x43')]['ids'])){for(var _0x386767=0x0;_0x386767<_0x1b80ae[_0xc07a('0x43')][_0xc07a('0x6c')][_0xc07a('0x49')];_0x386767+=0x1){socket[_0xc07a('0xb8')](_0xc07a('0xb9'),{'UserId':Number(_0x1b80ae[_0xc07a('0x43')][_0xc07a('0x6c')][_0x386767]),'FaxAccountId':Number(_0x1b80ae[_0xc07a('0x57')]['id'])});}}else{socket[_0xc07a('0xb8')](_0xc07a('0xb9'),{'UserId':Number(_0x1b80ae['query'][_0xc07a('0x6c')]),'FaxAccountId':Number(_0x1b80ae[_0xc07a('0x57')]['id'])});}});}})[_0xc07a('0x20')](respondWithStatusCode(_0x5cf297,null))[_0xc07a('0x29')](handleError(_0x5cf297,null));};exports[_0xc07a('0xba')]=function(_0x1f6633,_0x4130be,_0x23c043){var _0x29d455={};var _0x3f9557={};var _0x48156a;var _0x47892b;return db[_0xc07a('0x3e')]['findOne']({'where':{'id':_0x1f6633[_0xc07a('0x57')]['id']}})[_0xc07a('0x20')](handleEntityNotFound(_0x4130be,null))['then'](function(_0x4ac721){if(_0x4ac721){_0x48156a=_0x4ac721;_0x3f9557[_0xc07a('0x41')]=_[_0xc07a('0x44')](db[_0xc07a('0x74')][_0xc07a('0x3f')]);_0x3f9557[_0xc07a('0x43')]=_[_0xc07a('0x44')](_0x1f6633['query']);_0x3f9557['filters']=_[_0xc07a('0x46')](_0x3f9557[_0xc07a('0x41')],_0x3f9557['query']);_0x29d455[_0xc07a('0x47')]=_[_0xc07a('0x46')](_0x3f9557[_0xc07a('0x41')],qs[_0xc07a('0x48')](_0x1f6633[_0xc07a('0x43')][_0xc07a('0x48')]));_0x29d455[_0xc07a('0x47')]=_0x29d455['attributes'][_0xc07a('0x49')]?_0x29d455[_0xc07a('0x47')]:_0x3f9557[_0xc07a('0x41')];_0x29d455[_0xc07a('0x4c')]=qs[_0xc07a('0x4d')](_0x1f6633['query']['sort']);_0x29d455[_0xc07a('0x4e')]=qs[_0xc07a('0x45')](_[_0xc07a('0x66')](_0x1f6633[_0xc07a('0x43')],_0x3f9557[_0xc07a('0x45')]));if(_0x1f6633[_0xc07a('0x43')][_0xc07a('0x4f')]){_0x29d455[_0xc07a('0x4e')]=_[_0xc07a('0x51')](_0x29d455[_0xc07a('0x4e')],{'$or':_[_0xc07a('0x42')](_0x29d455[_0xc07a('0x47')],function(_0x3566be){var _0x1480f5={};_0x1480f5[_0x3566be]={'$like':'%'+_0x1f6633[_0xc07a('0x43')]['filter']+'%'};return _0x1480f5;})});}_0x29d455=_[_0xc07a('0x51')]({},_0x29d455,_0x1f6633['options']);return _0x48156a[_0xc07a('0xba')](_0x29d455);}})[_0xc07a('0x20')](function(_0x2ad8d2){if(_0x2ad8d2){_0x47892b=_0x2ad8d2['length'];if(!_0x1f6633[_0xc07a('0x43')][_0xc07a('0x4a')](_0xc07a('0x4b'))){_0x29d455[_0xc07a('0x2f')]=qs[_0xc07a('0x2f')](_0x1f6633['query'][_0xc07a('0x2f')]);_0x29d455[_0xc07a('0x31')]=qs[_0xc07a('0x31')](_0x1f6633[_0xc07a('0x43')][_0xc07a('0x31')]);}return _0x48156a[_0xc07a('0xba')](_0x29d455);}})[_0xc07a('0x20')](function(_0x144c97){if(_0x144c97){return _0x144c97?{'count':_0x47892b,'rows':_0x144c97}:null;}})[_0xc07a('0x20')](respondWithResult(_0x4130be,null))[_0xc07a('0x29')](handleError(_0x4130be,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 8d2f2b7..5245f99 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 _0x4cbf=['hasOwnProperty','hook','exports','events','../../mysqldb','FaxAccount','save','update','remove','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4cbf,0xfd));var _0xf4cb=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x4cbf[_0x432682];return _0x463d05;};'use strict';var EventEmitter=require(_0xf4cb('0x0'));var FaxAccount=require(_0xf4cb('0x1'))['db'][_0xf4cb('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf4cb('0x3'),'afterUpdate':_0xf4cb('0x4'),'afterDestroy':_0xf4cb('0x5')};function emitEvent(_0xb2197){return function(_0x44f635,_0x192119,_0x1a9db0){FaxAccountEvents[_0xf4cb('0x6')](_0xb2197+':'+_0x44f635['id'],_0x44f635);FaxAccountEvents['emit'](_0xb2197,_0x44f635);_0x1a9db0(null);};}for(var e in events){if(events[_0xf4cb('0x7')](e)){var event=events[e];FaxAccount[_0xf4cb('0x8')](e,emitEvent(event));}}module[_0xf4cb('0x9')]=FaxAccountEvents; \ No newline at end of file +var _0x1d72=['hasOwnProperty','hook','exports','events','../../mysqldb','FaxAccount','setMaxListeners','save','remove'];(function(_0x51652a,_0x5144fc){var _0xae7099=function(_0x4b239b){while(--_0x4b239b){_0x51652a['push'](_0x51652a['shift']());}};_0xae7099(++_0x5144fc);}(_0x1d72,0x1aa));var _0x21d7=function(_0x52685f,_0x2c0887){_0x52685f=_0x52685f-0x0;var _0x1f7d77=_0x1d72[_0x52685f];return _0x1f7d77;};'use strict';var EventEmitter=require(_0x21d7('0x0'));var FaxAccount=require(_0x21d7('0x1'))['db'][_0x21d7('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x21d7('0x3')](0x0);var events={'afterCreate':_0x21d7('0x4'),'afterUpdate':'update','afterDestroy':_0x21d7('0x5')};function emitEvent(_0x13c0da){return function(_0x4a9dce,_0x43adf2,_0x1d0332){FaxAccountEvents['emit'](_0x13c0da+':'+_0x4a9dce['id'],_0x4a9dce);FaxAccountEvents['emit'](_0x13c0da,_0x4a9dce);_0x1d0332(null);};}for(var e in events){if(events[_0x21d7('0x6')](e)){var event=events[e];FaxAccount[_0x21d7('0x7')](e,emitEvent(event));}}module[_0x21d7('0x8')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 07392f6..a4d470d 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 _0xbd32=['rimraf','./faxAccount.attributes','exports','define','FaxAccount','fax_accounts','lodash','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x3fd166,_0x226529){var _0x5dbb14=function(_0xcd3091){while(--_0xcd3091){_0x3fd166['push'](_0x3fd166['shift']());}};_0x5dbb14(++_0x226529);}(_0xbd32,0xc6));var _0x2bd3=function(_0x4e2c5d,_0xb6fd93){_0x4e2c5d=_0x4e2c5d-0x0;var _0xee81fb=_0xbd32[_0x4e2c5d];return _0xee81fb;};'use strict';var _=require(_0x2bd3('0x0'));var util=require('util');var logger=require(_0x2bd3('0x1'))('api');var moment=require(_0x2bd3('0x2'));var BPromise=require(_0x2bd3('0x3'));var rp=require(_0x2bd3('0x4'));var fs=require('fs');var path=require(_0x2bd3('0x5'));var rimraf=require(_0x2bd3('0x6'));var config=require('../../config/environment');var attributes=require(_0x2bd3('0x7'));module[_0x2bd3('0x8')]=function(_0x1bb7df,_0x4f8ec4){return _0x1bb7df[_0x2bd3('0x9')](_0x2bd3('0xa'),attributes,{'tableName':_0x2bd3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0b3c=['exports','FaxAccount','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./faxAccount.attributes'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x0b3c,0x91));var _0xc0b3=function(_0x55d0fd,_0x1b1bdd){_0x55d0fd=_0x55d0fd-0x0;var _0x40ce6f=_0x0b3c[_0x55d0fd];return _0x40ce6f;};'use strict';var _=require('lodash');var util=require(_0xc0b3('0x0'));var logger=require(_0xc0b3('0x1'))(_0xc0b3('0x2'));var moment=require(_0xc0b3('0x3'));var BPromise=require(_0xc0b3('0x4'));var rp=require(_0xc0b3('0x5'));var fs=require('fs');var path=require(_0xc0b3('0x6'));var rimraf=require(_0xc0b3('0x7'));var config=require('../../config/environment');var attributes=require(_0xc0b3('0x8'));module[_0xc0b3('0x9')]=function(_0x1e6c82,_0x4c972e){return _0x1e6c82['define'](_0xc0b3('0xa'),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 a23ae8c..168cf24 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 _0xee21=['User','UserId','unshift','agent','waitForTheAssignedAgent','FaxQueue','queueId','queue','name','Start','startRouting','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','register','request','info','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetFaxAccount','FaxAccount','findAll','options','raw','where','attributes','limit','include','map','model','debug','catch','NotifyFaxAccount','CmContact','describe','then','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','ListId','body','isNil','from','Sequelize','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','List','DESC','FaxApplication','Applications','get','applications','list','orderBy','asc','Contacts','length','create','contact','FaxInteraction','Contact\x20not\x20found','spread','autoclose','close','*,*,*,*','created','interaction','ContactId','AttachmentId'];(function(_0x42c3ea,_0x2cae04){var _0x294a04=function(_0x265626){while(--_0x265626){_0x42c3ea['push'](_0x42c3ea['shift']());}};_0x294a04(++_0x2cae04);}(_0xee21,0x17f));var _0x1ee2=function(_0xedde59,_0x50d9b1){_0xedde59=_0xedde59-0x0;var _0x4db279=_0xee21[_0xedde59];return _0x4db279;};'use strict';var _=require(_0x1ee2('0x0'));var util=require('util');var moment=require(_0x1ee2('0x1'));var BPromise=require(_0x1ee2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1ee2('0x3'));var db=require(_0x1ee2('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1ee2('0x5'))(_0x1ee2('0x6'));var config=require(_0x1ee2('0x7'));var jayson=require(_0x1ee2('0x8'));var client=jayson['client'][_0x1ee2('0x9')]({'port':0x232c});config[_0x1ee2('0xa')]=_[_0x1ee2('0xb')](config[_0x1ee2('0xa')],{'host':_0x1ee2('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1ee2('0xa')]));require('./faxAccount.socket')[_0x1ee2('0xd')](socket);function respondWithRpcPromise(_0x5c315e,_0x4538c7,_0x27cf0a){return new BPromise(function(_0x24517e,_0x1fe0d3){return client[_0x1ee2('0xe')](_0x5c315e,_0x27cf0a)['then'](function(_0xc8e7ea){logger[_0x1ee2('0xf')](_0x1ee2('0x10'),_0x4538c7,_0x1ee2('0x11'));logger['debug'](_0x1ee2('0x12'),_0x4538c7,'request\x20sent',JSON[_0x1ee2('0x13')](_0xc8e7ea));if(_0xc8e7ea[_0x1ee2('0x14')]){if(_0xc8e7ea[_0x1ee2('0x14')][_0x1ee2('0x15')]===0x1f4){logger[_0x1ee2('0x14')](_0x1ee2('0x10'),_0x4538c7,_0xc8e7ea[_0x1ee2('0x14')]['message']);return _0x1fe0d3(_0xc8e7ea[_0x1ee2('0x14')][_0x1ee2('0x16')]);}logger[_0x1ee2('0x14')]('FaxAccount,\x20%s,\x20%s',_0x4538c7,_0xc8e7ea['error'][_0x1ee2('0x16')]);return _0x24517e(_0xc8e7ea[_0x1ee2('0x14')][_0x1ee2('0x16')]);}else{logger['info']('FaxAccount,\x20%s,\x20%s',_0x4538c7,_0x1ee2('0x11'));_0x24517e(_0xc8e7ea[_0x1ee2('0x17')][_0x1ee2('0x16')]);}})['catch'](function(_0x11466a){logger['error'](_0x1ee2('0x10'),_0x4538c7,_0x11466a);_0x1fe0d3(_0x11466a);});});}exports[_0x1ee2('0x18')]=function(_0x4a9544){var _0x34c45a=this;return new Promise(function(_0x2e29d9,_0x595499){return db[_0x1ee2('0x19')][_0x1ee2('0x1a')]({'raw':_0x4a9544[_0x1ee2('0x1b')]?_0x4a9544[_0x1ee2('0x1b')][_0x1ee2('0x1c')]===undefined?!![]:![]:!![],'where':_0x4a9544[_0x1ee2('0x1b')]?_0x4a9544[_0x1ee2('0x1b')][_0x1ee2('0x1d')]||null:null,'attributes':_0x4a9544[_0x1ee2('0x1b')]?_0x4a9544['options'][_0x1ee2('0x1e')]||null:null,'limit':_0x4a9544[_0x1ee2('0x1b')]?_0x4a9544[_0x1ee2('0x1b')][_0x1ee2('0x1f')]||null:null,'include':_0x4a9544['options']?_0x4a9544['options'][_0x1ee2('0x20')]?_[_0x1ee2('0x21')](_0x4a9544[_0x1ee2('0x1b')][_0x1ee2('0x20')],function(_0x16b2c2){return{'model':db[_0x16b2c2[_0x1ee2('0x22')]],'as':_0x16b2c2['as'],'attributes':_0x16b2c2[_0x1ee2('0x1e')],'include':_0x16b2c2[_0x1ee2('0x20')]?_[_0x1ee2('0x21')](_0x16b2c2['include'],function(_0x3bbb51){return{'model':db[_0x3bbb51[_0x1ee2('0x22')]],'as':_0x3bbb51['as'],'attributes':_0x3bbb51[_0x1ee2('0x1e')],'include':_0x3bbb51[_0x1ee2('0x20')]?_[_0x1ee2('0x21')](_0x3bbb51[_0x1ee2('0x20')],function(_0x46413f){return{'model':db[_0x46413f[_0x1ee2('0x22')]],'as':_0x46413f['as'],'attributes':_0x46413f['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x40ee7e){logger[_0x1ee2('0xf')](_0x1ee2('0x18'),_0x4a9544);logger[_0x1ee2('0x23')](_0x1ee2('0x18'),_0x4a9544,JSON['stringify'](_0x40ee7e));_0x2e29d9(_0x40ee7e);})[_0x1ee2('0x24')](function(_0x3fb246){logger['error'](_0x1ee2('0x18'),_0x3fb246[_0x1ee2('0x16')],_0x4a9544);_0x595499(_0x34c45a['error'](0x1f4,_0x3fb246['message']));});});};exports[_0x1ee2('0x25')]=function(_0xd1a22f,_0xc68253,_0x1884bf){var _0x46cb33=this;return new Promise(function(_0x5e9f7a,_0x29a527){var _0x483d40={'body':_0xd1a22f['body'],'channel':'fax'};var _0x15f431=[];var _0x44a05d=[];var _0x7d5133={};return db[_0x1ee2('0x26')][_0x1ee2('0x27')]()[_0x1ee2('0x28')](function(_0x3bde70){if(!_0x3bde70){throw new db['Sequelize']['ValidationError'](_0x1ee2('0x29'));}_0x15f431=_[_0x1ee2('0x2a')](_[_0x1ee2('0x2b')](_0x3bde70),[_0x1ee2('0x2c'),_0x1ee2('0x2d')]);_0x44a05d=_[_0x1ee2('0x2a')](_[_0x1ee2('0x2b')](_0x3bde70),['createdAt',_0x1ee2('0x2d'),'CompanyId',_0x1ee2('0x2e')]);if(_0xd1a22f[_0x1ee2('0x2f')]['id']){delete _0xd1a22f[_0x1ee2('0x2f')]['id'];}if(_[_0x1ee2('0x30')](_0xd1a22f[_0x1ee2('0x2f')][_0x1ee2('0x31')])){throw new db[(_0x1ee2('0x32'))][(_0x1ee2('0x33'))](_0x1ee2('0x34'));}if(_[_0x1ee2('0x30')](_0xd1a22f[_0x1ee2('0x2f')][_0x1ee2('0x2f')])||_0xd1a22f['body'][_0x1ee2('0x2f')]===''){throw new db[(_0x1ee2('0x32'))]['ValidationError'](_0x1ee2('0x35'));}if(_[_0x1ee2('0x30')](_0xd1a22f[_0x1ee2('0x2f')]['mapKey'])){throw new db[(_0x1ee2('0x32'))][(_0x1ee2('0x33'))](_0x1ee2('0x36')+_0x44a05d);}if(!_['includes'](_0x44a05d,_0xd1a22f[_0x1ee2('0x2f')][_0x1ee2('0x37')])){throw new db[(_0x1ee2('0x32'))]['ValidationError'](_0x1ee2('0x38')+_0x44a05d);}_0x7d5133[_0xd1a22f[_0x1ee2('0x2f')][_0x1ee2('0x37')]]=_0xd1a22f[_0x1ee2('0x2f')]['from'];})[_0x1ee2('0x28')](function(){return db[_0x1ee2('0x19')][_0x1ee2('0x39')]({'where':{'id':_0xd1a22f[_0x1ee2('0x3a')]['id']},'include':[{'model':db['CmList'],'as':_0x1ee2('0x3b'),'include':[{'model':db[_0x1ee2('0x26')],'as':'Contacts','where':_0x7d5133,'limit':0x1,'order':[['updatedAt',_0x1ee2('0x3c')]]}]},{'model':db[_0x1ee2('0x3d')],'as':_0x1ee2('0x3e')}]});})[_0x1ee2('0x28')](function(_0x1907dd){if(_0x1907dd&&_0x1907dd['List']){var _0xa0d6b4=_0x1907dd[_0x1ee2('0x3f')]({'plain':!![]});_0x483d40[_0x1ee2('0x3a')]=_0xa0d6b4;_0x483d40[_0x1ee2('0x40')]=_0xa0d6b4[_0x1ee2('0x3e')];_0x483d40[_0x1ee2('0x41')]=_0xa0d6b4[_0x1ee2('0x3b')];_0x483d40[_0x1ee2('0x40')]=_[_0x1ee2('0x42')](_0x483d40[_0x1ee2('0x40')],['priority'],[_0x1ee2('0x43')]);if(_0x483d40['account'][_0x1ee2('0x3e')]){delete _0x483d40[_0x1ee2('0x3a')][_0x1ee2('0x3e')];}if(_0x483d40[_0x1ee2('0x3a')]['List']&&_0x483d40[_0x1ee2('0x3a')]['List'][_0x1ee2('0x44')][_0x1ee2('0x45')]){return _0x483d40[_0x1ee2('0x3a')][_0x1ee2('0x3b')][_0x1ee2('0x44')][0x0];}var _0x29f64e=_[_0x1ee2('0xb')](_0xd1a22f[_0x1ee2('0x2f')],{'firstName':_0xd1a22f[_0x1ee2('0x2f')][_0x1ee2('0x31')],'ListId':_0xa0d6b4['ListId']});_0x29f64e[_0xd1a22f[_0x1ee2('0x2f')][_0x1ee2('0x37')]]=_0xd1a22f[_0x1ee2('0x2f')][_0x1ee2('0x31')];return db[_0x1ee2('0x26')][_0x1ee2('0x46')](_0x29f64e,{'fields':_0x15f431,'raw':!![]});}})[_0x1ee2('0x28')](function(_0x497552){_0x483d40[_0x1ee2('0x47')]=_0x497552;if(_0x497552){var _0x179061={'ContactId':_0x497552['id'],'FaxAccountId':_0xd1a22f['account']['id'],'fax':_0x497552['fax']};return db['FaxInteraction'][_0x1ee2('0x39')]({'where':{'ContactId':_0x497552['id'],'closed':![],'FaxAccountId':_0xd1a22f['account']['id']}})[_0x1ee2('0x28')](function(_0x18f2a4){if(_0x18f2a4){return[_0x18f2a4,![]];}return db[_0x1ee2('0x48')][_0x1ee2('0x46')](_0x179061)[_0x1ee2('0x28')](function(_0x2c29ce){return[_0x2c29ce,!![]];});});}else{throw new Error(_0x1ee2('0x49'));}})[_0x1ee2('0x4a')](function(_0x3788e6,_0x202bc2){var _0x4015b8=_0x3788e6[_0x1ee2('0x3f')]({'plain':!![]});if(_0x202bc2){if(_0x483d40['account'][_0x1ee2('0x4b')]){_0x483d40['applications']['push']({'id':0x0,'priority':_0x483d40[_0x1ee2('0x40')]['length']+0x1,'app':_0x1ee2('0x4c'),'appdata':'unmanaged','interval':_0x1ee2('0x4d')});}_0x4015b8[_0x1ee2('0x4e')]=!![];}else{_0x4015b8[_0x1ee2('0x4e')]=![];}_0x483d40[_0x1ee2('0x4f')]=_0x4015b8;return db['FaxMessage'][_0x1ee2('0x46')]({'body':_0xd1a22f[_0x1ee2('0x2f')][_0x1ee2('0x2f')],'FaxAccountId':_0xd1a22f['account']['id'],'FaxInteractionId':_0x3788e6['id'],'direction':'in','ContactId':_0x3788e6[_0x1ee2('0x50')],'AttachmentId':_0xd1a22f[_0x1ee2('0x2f')][_0x1ee2('0x51')]});})['then'](function(_0x47c874){_0x483d40[_0x1ee2('0x16')]=_0x47c874;if(!_0x483d40[_0x1ee2('0x4f')]['UserId'])return;return db[_0x1ee2('0x52')][_0x1ee2('0x39')]({'attributes':['id','name'],'where':{'id':_0x483d40[_0x1ee2('0x4f')][_0x1ee2('0x53')]}});})[_0x1ee2('0x28')](function(_0x4e6760){if(_0x4e6760){_0x483d40[_0x1ee2('0x40')][_0x1ee2('0x54')]({'id':0x0,'priority':0x0,'app':_0x1ee2('0x55'),'appdata':_0x4e6760['name']+','+(_0x483d40[_0x1ee2('0x3a')][_0x1ee2('0x56')]||0xa),'interval':_0x1ee2('0x4d')});}if(!_0x483d40[_0x1ee2('0x4f')]['queueId'])return;return db[_0x1ee2('0x57')][_0x1ee2('0x39')]({'attributes':['id','name'],'where':{'id':_0x483d40[_0x1ee2('0x4f')][_0x1ee2('0x58')]}});})['then'](function(_0x1ba9e9){if(_0x1ba9e9){_0x483d40[_0x1ee2('0x40')][_0x1ee2('0x54')]({'id':0x0,'priority':0x1,'app':_0x1ee2('0x59'),'appdata':_0x1ba9e9[_0x1ee2('0x5a')]+','+(_0x483d40[_0x1ee2('0x3a')]['waitForTheAssignedQueue']||0x12c),'interval':_0x1ee2('0x4d')});}return respondWithRpcPromise(_0x1ee2('0x5b'),_0x1ee2('0x5c'),_0x483d40);})[_0x1ee2('0x28')](function(_0x1417a9){_0x5e9f7a(_0x1417a9);})[_0x1ee2('0x24')](function(_0xf3cdd1){_0x29a527(_0x46cb33[_0x1ee2('0x14')](0x1f4,_0xf3cdd1[_0x1ee2('0x16')]));});});}; \ No newline at end of file +var _0x137f=['unshift','agent','name','waitForTheAssignedAgent','queueId','FaxQueue','queue','waitForTheAssignedQueue','Start','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','redis','defaults','localhost','register','request','then','info','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','result','catch','GetFaxAccount','FaxAccount','findAll','options','where','limit','include','map','model','attributes','NotifyFaxAccount','body','CmContact','difference','keys','createdAt','updatedAt','CompanyId','ListId','isNil','from','Sequelize','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','List','Applications','get','applications','orderBy','priority','asc','length','Contacts','contact','fax','FaxInteraction','create','Contact\x20not\x20found','spread','autoclose','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','User','UserId'];(function(_0x37259e,_0x4aedfd){var _0x33936f=function(_0x2566bd){while(--_0x2566bd){_0x37259e['push'](_0x37259e['shift']());}};_0x33936f(++_0x4aedfd);}(_0x137f,0xc8));var _0xf137=function(_0x2c2031,_0x22d0e7){_0x2c2031=_0x2c2031-0x0;var _0x5d8520=_0x137f[_0x2c2031];return _0x5d8520;};'use strict';var _=require(_0xf137('0x0'));var util=require(_0xf137('0x1'));var moment=require(_0xf137('0x2'));var BPromise=require(_0xf137('0x3'));var rs=require(_0xf137('0x4'));var fs=require('fs');var Redis=require(_0xf137('0x5'));var db=require(_0xf137('0x6'))['db'];var utils=require(_0xf137('0x7'));var logger=require(_0xf137('0x8'))(_0xf137('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf137('0xa')]['http']({'port':0x232c});config[_0xf137('0xb')]=_[_0xf137('0xc')](config[_0xf137('0xb')],{'host':_0xf137('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf137('0xb')]));require('./faxAccount.socket')[_0xf137('0xe')](socket);function respondWithRpcPromise(_0x31416d,_0x2cc6d0,_0x435f37){return new BPromise(function(_0x4d14f7,_0x536d96){return client[_0xf137('0xf')](_0x31416d,_0x435f37)[_0xf137('0x10')](function(_0x1dd113){logger[_0xf137('0x11')]('FaxAccount,\x20%s,\x20%s',_0x2cc6d0,_0xf137('0x12'));logger[_0xf137('0x13')](_0xf137('0x14'),_0x2cc6d0,_0xf137('0x12'),JSON[_0xf137('0x15')](_0x1dd113));if(_0x1dd113[_0xf137('0x16')]){if(_0x1dd113[_0xf137('0x16')][_0xf137('0x17')]===0x1f4){logger[_0xf137('0x16')](_0xf137('0x18'),_0x2cc6d0,_0x1dd113[_0xf137('0x16')][_0xf137('0x19')]);return _0x536d96(_0x1dd113[_0xf137('0x16')][_0xf137('0x19')]);}logger[_0xf137('0x16')]('FaxAccount,\x20%s,\x20%s',_0x2cc6d0,_0x1dd113['error'][_0xf137('0x19')]);return _0x4d14f7(_0x1dd113[_0xf137('0x16')][_0xf137('0x19')]);}else{logger['info'](_0xf137('0x18'),_0x2cc6d0,_0xf137('0x12'));_0x4d14f7(_0x1dd113[_0xf137('0x1a')][_0xf137('0x19')]);}})[_0xf137('0x1b')](function(_0xcfc243){logger[_0xf137('0x16')](_0xf137('0x18'),_0x2cc6d0,_0xcfc243);_0x536d96(_0xcfc243);});});}exports[_0xf137('0x1c')]=function(_0x2e820c){var _0x2b1700=this;return new Promise(function(_0x2a2ae4,_0x598427){return db[_0xf137('0x1d')][_0xf137('0x1e')]({'raw':_0x2e820c[_0xf137('0x1f')]?_0x2e820c[_0xf137('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x2e820c[_0xf137('0x1f')]?_0x2e820c[_0xf137('0x1f')][_0xf137('0x20')]||null:null,'attributes':_0x2e820c[_0xf137('0x1f')]?_0x2e820c['options']['attributes']||null:null,'limit':_0x2e820c[_0xf137('0x1f')]?_0x2e820c[_0xf137('0x1f')][_0xf137('0x21')]||null:null,'include':_0x2e820c[_0xf137('0x1f')]?_0x2e820c['options'][_0xf137('0x22')]?_[_0xf137('0x23')](_0x2e820c[_0xf137('0x1f')]['include'],function(_0x3b230c){return{'model':db[_0x3b230c[_0xf137('0x24')]],'as':_0x3b230c['as'],'attributes':_0x3b230c[_0xf137('0x25')],'include':_0x3b230c['include']?_[_0xf137('0x23')](_0x3b230c[_0xf137('0x22')],function(_0x58b8b8){return{'model':db[_0x58b8b8[_0xf137('0x24')]],'as':_0x58b8b8['as'],'attributes':_0x58b8b8[_0xf137('0x25')],'include':_0x58b8b8['include']?_[_0xf137('0x23')](_0x58b8b8[_0xf137('0x22')],function(_0x161094){return{'model':db[_0x161094[_0xf137('0x24')]],'as':_0x161094['as'],'attributes':_0x161094['attributes']};}):[]};}):[]};}):[]:[]})[_0xf137('0x10')](function(_0x159fef){logger[_0xf137('0x11')](_0xf137('0x1c'),_0x2e820c);logger[_0xf137('0x13')](_0xf137('0x1c'),_0x2e820c,JSON['stringify'](_0x159fef));_0x2a2ae4(_0x159fef);})[_0xf137('0x1b')](function(_0x2d6b63){logger[_0xf137('0x16')]('GetFaxAccount',_0x2d6b63[_0xf137('0x19')],_0x2e820c);_0x598427(_0x2b1700[_0xf137('0x16')](0x1f4,_0x2d6b63[_0xf137('0x19')]));});});};exports[_0xf137('0x26')]=function(_0x51e1dd,_0x479518,_0x49f9ea){var _0x5a87b0=this;return new Promise(function(_0x5c184a,_0x4bf8ca){var _0x3aebab={'body':_0x51e1dd[_0xf137('0x27')],'channel':'fax'};var _0x24128e=[];var _0x4b6b0f=[];var _0x54b076={};return db[_0xf137('0x28')]['describe']()['then'](function(_0x1ea34d){if(!_0x1ea34d){throw new db['Sequelize']['ValidationError']('no\x20available\x20attributes');}_0x24128e=_[_0xf137('0x29')](_[_0xf137('0x2a')](_0x1ea34d),[_0xf137('0x2b'),_0xf137('0x2c')]);_0x4b6b0f=_[_0xf137('0x29')](_['keys'](_0x1ea34d),['createdAt',_0xf137('0x2c'),_0xf137('0x2d'),_0xf137('0x2e')]);if(_0x51e1dd[_0xf137('0x27')]['id']){delete _0x51e1dd[_0xf137('0x27')]['id'];}if(_[_0xf137('0x2f')](_0x51e1dd['body'][_0xf137('0x30')])){throw new db[(_0xf137('0x31'))][(_0xf137('0x32'))](_0xf137('0x33'));}if(_['isNil'](_0x51e1dd['body'][_0xf137('0x27')])||_0x51e1dd['body']['body']===''){throw new db[(_0xf137('0x31'))]['ValidationError'](_0xf137('0x34'));}if(_[_0xf137('0x2f')](_0x51e1dd['body']['mapKey'])){throw new db[(_0xf137('0x31'))][(_0xf137('0x32'))](_0xf137('0x35')+_0x4b6b0f);}if(!_[_0xf137('0x36')](_0x4b6b0f,_0x51e1dd['body'][_0xf137('0x37')])){throw new db[(_0xf137('0x31'))][(_0xf137('0x32'))](_0xf137('0x38')+_0x4b6b0f);}_0x54b076[_0x51e1dd[_0xf137('0x27')][_0xf137('0x37')]]=_0x51e1dd[_0xf137('0x27')]['from'];})[_0xf137('0x10')](function(){return db['FaxAccount'][_0xf137('0x39')]({'where':{'id':_0x51e1dd[_0xf137('0x3a')]['id']},'include':[{'model':db[_0xf137('0x3b')],'as':_0xf137('0x3c'),'include':[{'model':db[_0xf137('0x28')],'as':'Contacts','where':_0x54b076,'limit':0x1,'order':[[_0xf137('0x2c'),'DESC']]}]},{'model':db['FaxApplication'],'as':_0xf137('0x3d')}]});})[_0xf137('0x10')](function(_0x3a5c30){if(_0x3a5c30&&_0x3a5c30[_0xf137('0x3c')]){var _0x44a283=_0x3a5c30[_0xf137('0x3e')]({'plain':!![]});_0x3aebab[_0xf137('0x3a')]=_0x44a283;_0x3aebab['applications']=_0x44a283[_0xf137('0x3d')];_0x3aebab['list']=_0x44a283[_0xf137('0x3c')];_0x3aebab[_0xf137('0x3f')]=_[_0xf137('0x40')](_0x3aebab['applications'],[_0xf137('0x41')],[_0xf137('0x42')]);if(_0x3aebab[_0xf137('0x3a')][_0xf137('0x3d')]){delete _0x3aebab[_0xf137('0x3a')][_0xf137('0x3d')];}if(_0x3aebab[_0xf137('0x3a')]['List']&&_0x3aebab[_0xf137('0x3a')]['List']['Contacts'][_0xf137('0x43')]){return _0x3aebab[_0xf137('0x3a')]['List'][_0xf137('0x44')][0x0];}var _0x4069cb=_[_0xf137('0xc')](_0x51e1dd[_0xf137('0x27')],{'firstName':_0x51e1dd['body']['from'],'ListId':_0x44a283[_0xf137('0x2e')]});_0x4069cb[_0x51e1dd[_0xf137('0x27')][_0xf137('0x37')]]=_0x51e1dd[_0xf137('0x27')][_0xf137('0x30')];return db[_0xf137('0x28')]['create'](_0x4069cb,{'fields':_0x24128e,'raw':!![]});}})[_0xf137('0x10')](function(_0x1da8fe){_0x3aebab[_0xf137('0x45')]=_0x1da8fe;if(_0x1da8fe){var _0x1aa1e3={'ContactId':_0x1da8fe['id'],'FaxAccountId':_0x51e1dd[_0xf137('0x3a')]['id'],'fax':_0x1da8fe[_0xf137('0x46')]};return db['FaxInteraction']['find']({'where':{'ContactId':_0x1da8fe['id'],'closed':![],'FaxAccountId':_0x51e1dd[_0xf137('0x3a')]['id']}})[_0xf137('0x10')](function(_0x19f8da){if(_0x19f8da){return[_0x19f8da,![]];}return db[_0xf137('0x47')][_0xf137('0x48')](_0x1aa1e3)[_0xf137('0x10')](function(_0x34e46f){return[_0x34e46f,!![]];});});}else{throw new Error(_0xf137('0x49'));}})[_0xf137('0x4a')](function(_0x11e69a,_0x5d0756){var _0x12279c=_0x11e69a[_0xf137('0x3e')]({'plain':!![]});if(_0x5d0756){if(_0x3aebab[_0xf137('0x3a')][_0xf137('0x4b')]){_0x3aebab[_0xf137('0x3f')]['push']({'id':0x0,'priority':_0x3aebab[_0xf137('0x3f')]['length']+0x1,'app':'close','appdata':_0xf137('0x4c'),'interval':_0xf137('0x4d')});}_0x12279c[_0xf137('0x4e')]=!![];}else{_0x12279c['created']=![];}_0x3aebab[_0xf137('0x4f')]=_0x12279c;return db[_0xf137('0x50')][_0xf137('0x48')]({'body':_0x51e1dd['body']['body'],'FaxAccountId':_0x51e1dd[_0xf137('0x3a')]['id'],'FaxInteractionId':_0x11e69a['id'],'direction':'in','ContactId':_0x11e69a[_0xf137('0x51')],'AttachmentId':_0x51e1dd[_0xf137('0x27')][_0xf137('0x52')]});})[_0xf137('0x10')](function(_0x485f51){_0x3aebab[_0xf137('0x19')]=_0x485f51;if(!_0x3aebab[_0xf137('0x4f')]['UserId'])return;return db[_0xf137('0x53')][_0xf137('0x39')]({'attributes':['id','name'],'where':{'id':_0x3aebab[_0xf137('0x4f')][_0xf137('0x54')]}});})[_0xf137('0x10')](function(_0x1f1bdb){if(_0x1f1bdb){_0x3aebab[_0xf137('0x3f')][_0xf137('0x55')]({'id':0x0,'priority':0x0,'app':_0xf137('0x56'),'appdata':_0x1f1bdb[_0xf137('0x57')]+','+(_0x3aebab[_0xf137('0x3a')][_0xf137('0x58')]||0xa),'interval':_0xf137('0x4d')});}if(!_0x3aebab['interaction'][_0xf137('0x59')])return;return db[_0xf137('0x5a')][_0xf137('0x39')]({'attributes':['id',_0xf137('0x57')],'where':{'id':_0x3aebab['interaction'][_0xf137('0x59')]}});})[_0xf137('0x10')](function(_0x28492c){if(_0x28492c){_0x3aebab[_0xf137('0x3f')]['unshift']({'id':0x0,'priority':0x1,'app':_0xf137('0x5b'),'appdata':_0x28492c[_0xf137('0x57')]+','+(_0x3aebab[_0xf137('0x3a')][_0xf137('0x5c')]||0x12c),'interval':_0xf137('0x4d')});}return respondWithRpcPromise(_0xf137('0x5d'),_0xf137('0x5e'),_0x3aebab);})[_0xf137('0x10')](function(_0x475cb2){_0x5c184a(_0x475cb2);})['catch'](function(_0x7721c2){_0x4bf8ca(_0x5a87b0[_0xf137('0x16')](0x1f4,_0x7721c2[_0xf137('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 4aa9149..331c56e 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 _0x3726=['register','length','faxAccount:','./faxAccount.events','update'];(function(_0x2bbea2,_0xe55753){var _0x38c3d1=function(_0x5376a8){while(--_0x5376a8){_0x2bbea2['push'](_0x2bbea2['shift']());}};_0x38c3d1(++_0xe55753);}(_0x3726,0x148));var _0x6372=function(_0x2f23d4,_0x577a52){_0x2f23d4=_0x2f23d4-0x0;var _0x54ee29=_0x3726[_0x2f23d4];return _0x54ee29;};'use strict';var FaxAccountEvents=require(_0x6372('0x0'));var events=['save','remove',_0x6372('0x1')];function createListener(_0xaf9570,_0x586f90){return function(_0x20f734){_0x586f90['emit'](_0xaf9570,_0x20f734);};}function removeListener(_0x3a9e2e,_0x2b7705){return function(){FaxAccountEvents['removeListener'](_0x3a9e2e,_0x2b7705);};}exports[_0x6372('0x2')]=function(_0x45f812){for(var _0x134e43=0x0,_0x4cd216=events[_0x6372('0x3')];_0x134e43<_0x4cd216;_0x134e43++){var _0xbcb697=events[_0x134e43];var _0x15f335=createListener(_0x6372('0x4')+_0xbcb697,_0x45f812);FaxAccountEvents['on'](_0xbcb697,_0x15f335);}}; \ No newline at end of file +var _0x89f4=['register','length','faxAccount:','./faxAccount.events','save','remove','emit','removeListener'];(function(_0x4b5f41,_0x3e9217){var _0x5a50c2=function(_0x4a50aa){while(--_0x4a50aa){_0x4b5f41['push'](_0x4b5f41['shift']());}};_0x5a50c2(++_0x3e9217);}(_0x89f4,0xeb));var _0x489f=function(_0x4db3bd,_0x3bff80){_0x4db3bd=_0x4db3bd-0x0;var _0x553a92=_0x89f4[_0x4db3bd];return _0x553a92;};'use strict';var FaxAccountEvents=require(_0x489f('0x0'));var events=[_0x489f('0x1'),_0x489f('0x2'),'update'];function createListener(_0x4aa5a9,_0x32271e){return function(_0x50a6a0){_0x32271e[_0x489f('0x3')](_0x4aa5a9,_0x50a6a0);};}function removeListener(_0x57ad9b,_0x10394c){return function(){FaxAccountEvents[_0x489f('0x4')](_0x57ad9b,_0x10394c);};}exports[_0x489f('0x5')]=function(_0x5fd6ea){for(var _0x46e396=0x0,_0x43fd17=events[_0x489f('0x6')];_0x46e396<_0x43fd17;_0x46e396++){var _0x49e9a9=events[_0x46e396];var _0x58ba49=createListener(_0x489f('0x7')+_0x49e9a9,_0x5fd6ea);FaxAccountEvents['on'](_0x49e9a9,_0x58ba49);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 9d818c8..e5e97be 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 _0xfe2c=['delete','removeDispositions','removeAnswers','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','./faxAccount.controller','get','isAuthenticated','/describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/users','getAgents','create','addDisposition','post','addAnswer','addInteraction','addApplications','/addaccountapplications','/updateaccountapplications','updateAccountApplications','/:id/send','addAgents','put','/:id','destroy'];(function(_0x339b6c,_0x4e18a1){var _0x586d54=function(_0x3e4a00){while(--_0x3e4a00){_0x339b6c['push'](_0x339b6c['shift']());}};_0x586d54(++_0x4e18a1);}(_0xfe2c,0x154));var _0xcfe2=function(_0x352100,_0x1962b6){_0x352100=_0x352100-0x0;var _0x5fb2a0=_0xfe2c[_0x352100];return _0x5fb2a0;};'use strict';var multer=require(_0xcfe2('0x0'));var util=require(_0xcfe2('0x1'));var path=require(_0xcfe2('0x2'));var timeout=require(_0xcfe2('0x3'));var express=require(_0xcfe2('0x4'));var router=express[_0xcfe2('0x5')]();var fs_extra=require(_0xcfe2('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xcfe2('0x7'));router[_0xcfe2('0x8')]('/',auth[_0xcfe2('0x9')](),controller['index']);router[_0xcfe2('0x8')](_0xcfe2('0xa'),auth[_0xcfe2('0x9')](),controller['describe']);router[_0xcfe2('0x8')]('/:id',auth[_0xcfe2('0x9')](),controller[_0xcfe2('0xb')]);router[_0xcfe2('0x8')](_0xcfe2('0xc'),auth[_0xcfe2('0x9')](),controller[_0xcfe2('0xd')]);router['get'](_0xcfe2('0xe'),auth[_0xcfe2('0x9')](),controller[_0xcfe2('0xf')]);router['get'](_0xcfe2('0x10'),auth[_0xcfe2('0x9')](),controller[_0xcfe2('0x11')]);router[_0xcfe2('0x8')](_0xcfe2('0x12'),auth[_0xcfe2('0x9')](),controller[_0xcfe2('0x13')]);router[_0xcfe2('0x8')](_0xcfe2('0x14'),auth['isAuthenticated'](),controller[_0xcfe2('0x15')]);router[_0xcfe2('0x8')](_0xcfe2('0x16'),auth[_0xcfe2('0x9')](),controller[_0xcfe2('0x17')]);router['post']('/',auth['isAuthenticated'](),controller[_0xcfe2('0x18')]);router['post']('/:id/dispositions',auth[_0xcfe2('0x9')](),controller[_0xcfe2('0x19')]);router[_0xcfe2('0x1a')](_0xcfe2('0xe'),auth[_0xcfe2('0x9')](),controller[_0xcfe2('0x1b')]);router['post']('/:id/interactions',auth[_0xcfe2('0x9')](),controller[_0xcfe2('0x1c')]);router[_0xcfe2('0x1a')]('/:id/applications',auth[_0xcfe2('0x9')](),controller[_0xcfe2('0x1d')]);router[_0xcfe2('0x1a')](_0xcfe2('0x1e'),auth[_0xcfe2('0x9')](),controller['addAccountApplications']);router[_0xcfe2('0x1a')](_0xcfe2('0x1f'),auth[_0xcfe2('0x9')](),controller[_0xcfe2('0x20')]);router['post'](_0xcfe2('0x21'),auth[_0xcfe2('0x9')](),controller['send']);router[_0xcfe2('0x1a')]('/:id/users',auth[_0xcfe2('0x9')](),controller[_0xcfe2('0x22')]);router[_0xcfe2('0x23')](_0xcfe2('0x24'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xcfe2('0x24'),auth['isAuthenticated'](),controller[_0xcfe2('0x25')]);router[_0xcfe2('0x26')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xcfe2('0x27')]);router[_0xcfe2('0x26')]('/:id/canned_answers',auth[_0xcfe2('0x9')](),controller[_0xcfe2('0x28')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xcfe2('0x29')]);module['exports']=router; \ No newline at end of file +var _0x5c34=['addAgents','delete','destroy','removeDispositions','removeAnswers','removeAgents','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications','/:id/messages','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','/:id/interactions','addInteraction','addApplications','addAccountApplications','updateAccountApplications','/:id/send','send'];(function(_0x5a5977,_0x43b2d2){var _0x1c58f8=function(_0x5942e7){while(--_0x5942e7){_0x5a5977['push'](_0x5a5977['shift']());}};_0x1c58f8(++_0x43b2d2);}(_0x5c34,0x125));var _0x45c3=function(_0xf83039,_0x3adcab){_0xf83039=_0xf83039-0x0;var _0x3e6575=_0x5c34[_0xf83039];return _0x3e6575;};'use strict';var multer=require(_0x45c3('0x0'));var util=require(_0x45c3('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x45c3('0x2'));var router=express[_0x45c3('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x45c3('0x4'));var interaction=require(_0x45c3('0x5'));var config=require(_0x45c3('0x6'));var controller=require(_0x45c3('0x7'));router[_0x45c3('0x8')]('/',auth[_0x45c3('0x9')](),controller[_0x45c3('0xa')]);router[_0x45c3('0x8')](_0x45c3('0xb'),auth[_0x45c3('0x9')](),controller[_0x45c3('0xc')]);router[_0x45c3('0x8')](_0x45c3('0xd'),auth[_0x45c3('0x9')](),controller[_0x45c3('0xe')]);router[_0x45c3('0x8')](_0x45c3('0xf'),auth['isAuthenticated'](),controller[_0x45c3('0x10')]);router[_0x45c3('0x8')]('/:id/canned_answers',auth[_0x45c3('0x9')](),controller[_0x45c3('0x11')]);router[_0x45c3('0x8')]('/:id/interactions',auth['isAuthenticated'](),controller['getInteractions']);router[_0x45c3('0x8')](_0x45c3('0x12'),auth[_0x45c3('0x9')](),controller[_0x45c3('0x13')]);router[_0x45c3('0x8')](_0x45c3('0x14'),auth[_0x45c3('0x9')](),controller['getMessages']);router['get'](_0x45c3('0x15'),auth['isAuthenticated'](),controller[_0x45c3('0x16')]);router[_0x45c3('0x17')]('/',auth['isAuthenticated'](),controller[_0x45c3('0x18')]);router[_0x45c3('0x17')](_0x45c3('0xf'),auth[_0x45c3('0x9')](),controller[_0x45c3('0x19')]);router[_0x45c3('0x17')](_0x45c3('0x1a'),auth[_0x45c3('0x9')](),controller[_0x45c3('0x1b')]);router[_0x45c3('0x17')](_0x45c3('0x1c'),auth['isAuthenticated'](),controller[_0x45c3('0x1d')]);router['post'](_0x45c3('0x12'),auth[_0x45c3('0x9')](),controller[_0x45c3('0x1e')]);router[_0x45c3('0x17')]('/addaccountapplications',auth[_0x45c3('0x9')](),controller[_0x45c3('0x1f')]);router[_0x45c3('0x17')]('/updateaccountapplications',auth[_0x45c3('0x9')](),controller[_0x45c3('0x20')]);router[_0x45c3('0x17')](_0x45c3('0x21'),auth['isAuthenticated'](),controller[_0x45c3('0x22')]);router[_0x45c3('0x17')](_0x45c3('0x15'),auth[_0x45c3('0x9')](),controller[_0x45c3('0x23')]);router['put'](_0x45c3('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x45c3('0x24')](_0x45c3('0xd'),auth['isAuthenticated'](),controller[_0x45c3('0x25')]);router['delete'](_0x45c3('0xf'),auth[_0x45c3('0x9')](),controller[_0x45c3('0x26')]);router['delete']('/:id/canned_answers',auth[_0x45c3('0x9')](),controller[_0x45c3('0x27')]);router[_0x45c3('0x24')](_0x45c3('0x15'),auth[_0x45c3('0x9')](),controller[_0x45c3('0x28')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index 41b2f6c..fd427af 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 _0xb14c=['exports','INTEGER','TEXT','STRING','*,*,*,*'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xb14c,0xe6));var _0xcb14=function(_0xd3b0ac,_0x2f5065){_0xd3b0ac=_0xd3b0ac-0x0;var _0x3d773e=_0xb14c[_0xd3b0ac];return _0x3d773e;};'use strict';var Sequelize=require('sequelize');module[_0xcb14('0x0')]={'priority':{'type':Sequelize[_0xcb14('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xcb14('0x2')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xcb14('0x3')],'defaultValue':_0xcb14('0x4')}}; \ No newline at end of file +var _0xddf4=['*,*,*,*','sequelize','exports','INTEGER','noop','TEXT','STRING'];(function(_0x5774af,_0x411c94){var _0x480589=function(_0x414114){while(--_0x414114){_0x5774af['push'](_0x5774af['shift']());}};_0x480589(++_0x411c94);}(_0xddf4,0x189));var _0x4ddf=function(_0x1fe62a,_0x28091f){_0x1fe62a=_0x1fe62a-0x0;var _0x5d0219=_0xddf4[_0x1fe62a];return _0x5d0219;};'use strict';var Sequelize=require(_0x4ddf('0x0'));module[_0x4ddf('0x1')]={'priority':{'type':Sequelize[_0x4ddf('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x4ddf('0x3')},'appdata':{'type':Sequelize[_0x4ddf('0x4')]()},'description':{'type':Sequelize[_0x4ddf('0x5')]},'interval':{'type':Sequelize[_0x4ddf('0x5')],'defaultValue':_0x4ddf('0x6')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 971f810..5185439 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 _0x237c=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','stack','name','send','index','map','FaxApplication','fieldName','type','key','model','keys','filters','intersection','attributes','fields','query','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','rawAttributes','options','create','body','update','find','params','eml-format','fast-json-patch','moment','util','path','sox','to-csv','ejs','squel','crypto','desk.js'];(function(_0x493a1c,_0x174356){var _0x110cc6=function(_0x29838d){while(--_0x29838d){_0x493a1c['push'](_0x493a1c['shift']());}};_0x110cc6(++_0x174356);}(_0x237c,0x14e));var _0xc237=function(_0x28f626,_0x2609e2){_0x28f626=_0x28f626-0x0;var _0x2bf26c=_0x237c[_0x28f626];return _0x2bf26c;};'use strict';var emlformat=require(_0xc237('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc237('0x1'));var rp=require('request-promise');var moment=require(_0xc237('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc237('0x3'));var path=require(_0xc237('0x4'));var sox=require(_0xc237('0x5'));var csv=require(_0xc237('0x6'));var ejs=require(_0xc237('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc237('0x8'));var crypto=require(_0xc237('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xc237('0xa'));var toCsv=require(_0xc237('0x6'));var querystring=require(_0xc237('0xb'));var Papa=require(_0xc237('0xc'));var Redis=require(_0xc237('0xd'));var authService=require(_0xc237('0xe'));var qs=require(_0xc237('0xf'));var as=require(_0xc237('0x10'));var hardwareService=require(_0xc237('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0xc237('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xc237('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xc1a71d,_0x5c5f89){_0x5c5f89=_0x5c5f89||0xcc;return function(_0x40ee8c){if(_0x40ee8c){return _0xc1a71d[_0xc237('0x14')](_0x5c5f89);}return _0xc1a71d[_0xc237('0x15')](_0x5c5f89)[_0xc237('0x16')]();};}function respondWithResult(_0x42a521,_0x58a769){_0x58a769=_0x58a769||0xc8;return function(_0x25eada){if(_0x25eada){return _0x42a521[_0xc237('0x15')](_0x58a769)[_0xc237('0x17')](_0x25eada);}};}function respondWithFilteredResult(_0x58d891,_0x143846){return function(_0x4f6c91){if(_0x4f6c91){var _0x24898d=typeof _0x143846[_0xc237('0x18')]===_0xc237('0x19')&&typeof _0x143846[_0xc237('0x1a')]===_0xc237('0x19');var _0x315244=_0x4f6c91['count'];var _0x4d4d75=_0x24898d?0x0:_0x143846['offset'];var _0x39f3ba=_0x24898d?_0x4f6c91[_0xc237('0x1b')]:_0x143846[_0xc237('0x18')]+_0x143846[_0xc237('0x1a')];var _0x3ed703;if(_0x39f3ba>=_0x315244){_0x39f3ba=_0x315244;_0x3ed703=0xc8;}else{_0x3ed703=0xce;}_0x58d891[_0xc237('0x15')](_0x3ed703);return _0x58d891[_0xc237('0x1c')](_0xc237('0x1d'),_0x4d4d75+'-'+_0x39f3ba+'/'+_0x315244)[_0xc237('0x17')](_0x4f6c91);}return null;};}function patchUpdates(_0xb7999a){return function(_0x16681a){try{jsonpatch[_0xc237('0x1e')](_0x16681a,_0xb7999a,!![]);}catch(_0x3f910d){return BPromise[_0xc237('0x1f')](_0x3f910d);}return _0x16681a[_0xc237('0x20')]();};}function saveUpdates(_0x300baf,_0x1aa628){return function(_0x136d94){if(_0x136d94){return _0x136d94['update'](_0x300baf)[_0xc237('0x21')](function(_0x3768a9){return _0x3768a9;});}return null;};}function removeEntity(_0x438480,_0xf0f217){return function(_0x3f7522){if(_0x3f7522){return _0x3f7522[_0xc237('0x22')]()[_0xc237('0x21')](function(){_0x438480[_0xc237('0x15')](0xcc)[_0xc237('0x16')]();});}};}function handleEntityNotFound(_0x3efae9,_0x51c1db){return function(_0x5eebda){if(!_0x5eebda){_0x3efae9[_0xc237('0x14')](0x194);}return _0x5eebda;};}function handleError(_0x376cdb,_0x4f74ff){_0x4f74ff=_0x4f74ff||0x1f4;return function(_0x8a2090){logger['error'](_0x8a2090[_0xc237('0x23')]);if(_0x8a2090['name']){delete _0x8a2090[_0xc237('0x24')];}_0x376cdb[_0xc237('0x15')](_0x4f74ff)[_0xc237('0x25')](_0x8a2090);};}exports[_0xc237('0x26')]=function(_0xe00339,_0x3649c3){var _0x26cb26={},_0x40e48b={},_0x5cbb64={'count':0x0,'rows':[]};var _0x32dd9a=_[_0xc237('0x27')](db[_0xc237('0x28')]['rawAttributes'],function(_0x38a604){return{'name':_0x38a604[_0xc237('0x29')],'type':_0x38a604[_0xc237('0x2a')][_0xc237('0x2b')]};});_0x40e48b[_0xc237('0x2c')]=_[_0xc237('0x27')](_0x32dd9a,_0xc237('0x24'));_0x40e48b['query']=_[_0xc237('0x2d')](_0xe00339['query']);_0x40e48b[_0xc237('0x2e')]=_[_0xc237('0x2f')](_0x40e48b[_0xc237('0x2c')],_0x40e48b['query']);_0x26cb26[_0xc237('0x30')]=_[_0xc237('0x2f')](_0x40e48b[_0xc237('0x2c')],qs[_0xc237('0x31')](_0xe00339[_0xc237('0x32')][_0xc237('0x31')]));_0x26cb26[_0xc237('0x30')]=_0x26cb26['attributes']['length']?_0x26cb26[_0xc237('0x30')]:_0x40e48b[_0xc237('0x2c')];if(!_0xe00339[_0xc237('0x32')]['hasOwnProperty']('nolimit')){_0x26cb26[_0xc237('0x1a')]=qs['limit'](_0xe00339[_0xc237('0x32')][_0xc237('0x1a')]);_0x26cb26[_0xc237('0x18')]=qs['offset'](_0xe00339[_0xc237('0x32')][_0xc237('0x18')]);}_0x26cb26[_0xc237('0x33')]=qs[_0xc237('0x34')](_0xe00339[_0xc237('0x32')][_0xc237('0x34')]);_0x26cb26[_0xc237('0x35')]=qs[_0xc237('0x2e')](_[_0xc237('0x36')](_0xe00339[_0xc237('0x32')],_0x40e48b[_0xc237('0x2e')]),_0x32dd9a);if(_0xe00339['query'][_0xc237('0x37')]){_0x26cb26[_0xc237('0x35')]=_[_0xc237('0x38')](_0x26cb26[_0xc237('0x35')],{'$or':_[_0xc237('0x27')](_0x32dd9a,function(_0x409ba5){if(_0x409ba5['type']!==_0xc237('0x39')){var _0x505616={};_0x505616[_0x409ba5['name']]={'$like':'%'+_0xe00339['query'][_0xc237('0x37')]+'%'};return _0x505616;}})});}_0x26cb26=_[_0xc237('0x38')]({},_0x26cb26,_0xe00339['options']);var _0x29a76f={'where':_0x26cb26['where']};return db[_0xc237('0x28')][_0xc237('0x1b')](_0x29a76f)['then'](function(_0x39c59e){_0x5cbb64[_0xc237('0x1b')]=_0x39c59e;if(_0xe00339[_0xc237('0x32')][_0xc237('0x3a')]){_0x26cb26[_0xc237('0x3b')]=[{'all':!![]}];}return db['FaxApplication']['findAll'](_0x26cb26);})[_0xc237('0x21')](function(_0x454bfa){_0x5cbb64[_0xc237('0x3c')]=_0x454bfa;return _0x5cbb64;})['then'](respondWithFilteredResult(_0x3649c3,_0x26cb26))[_0xc237('0x3d')](handleError(_0x3649c3,null));};exports['show']=function(_0x4fd6f3,_0x2b76e8){var _0x584aba={'raw':!![],'where':{'id':_0x4fd6f3['params']['id']}},_0x4f7df0={};_0x4f7df0['model']=_[_0xc237('0x2d')](db[_0xc237('0x28')][_0xc237('0x3e')]);_0x4f7df0[_0xc237('0x32')]=_['keys'](_0x4fd6f3['query']);_0x4f7df0[_0xc237('0x2e')]=_['intersection'](_0x4f7df0['model'],_0x4f7df0[_0xc237('0x32')]);_0x584aba[_0xc237('0x30')]=_[_0xc237('0x2f')](_0x4f7df0['model'],qs[_0xc237('0x31')](_0x4fd6f3[_0xc237('0x32')]['fields']));_0x584aba[_0xc237('0x30')]=_0x584aba['attributes']['length']?_0x584aba[_0xc237('0x30')]:_0x4f7df0[_0xc237('0x2c')];if(_0x4fd6f3[_0xc237('0x32')][_0xc237('0x3a')]){_0x584aba[_0xc237('0x3b')]=[{'all':!![]}];}_0x584aba=_[_0xc237('0x38')]({},_0x584aba,_0x4fd6f3[_0xc237('0x3f')]);return db[_0xc237('0x28')]['find'](_0x584aba)['then'](handleEntityNotFound(_0x2b76e8,null))[_0xc237('0x21')](respondWithResult(_0x2b76e8,null))[_0xc237('0x3d')](handleError(_0x2b76e8,null));};exports[_0xc237('0x40')]=function(_0x5b3cf4,_0x105f8e){return db[_0xc237('0x28')][_0xc237('0x40')](_0x5b3cf4[_0xc237('0x41')],{})[_0xc237('0x21')](respondWithResult(_0x105f8e,0xc9))['catch'](handleError(_0x105f8e,null));};exports[_0xc237('0x42')]=function(_0x267844,_0x38228d){if(_0x267844[_0xc237('0x41')]['id']){delete _0x267844[_0xc237('0x41')]['id'];}return db['FaxApplication'][_0xc237('0x43')]({'where':{'id':_0x267844[_0xc237('0x44')]['id']}})[_0xc237('0x21')](handleEntityNotFound(_0x38228d,null))[_0xc237('0x21')](saveUpdates(_0x267844[_0xc237('0x41')],null))[_0xc237('0x21')](respondWithResult(_0x38228d,null))[_0xc237('0x3d')](handleError(_0x38228d,null));};exports['destroy']=function(_0x155379,_0xeca6a){return db[_0xc237('0x28')]['find']({'where':{'id':_0x155379['params']['id']}})[_0xc237('0x21')](handleEntityNotFound(_0xeca6a,null))['then'](removeEntity(_0xeca6a,null))[_0xc237('0x3d')](handleError(_0xeca6a,null));}; \ No newline at end of file +var _0xb028=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','status','end','json','undefined','limit','count','offset','set','reject','update','then','destroy','error','stack','name','send','index','map','FaxApplication','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb028,0x86));var _0x8b02=function(_0x37f02e,_0x24e12d){_0x37f02e=_0x37f02e-0x0;var _0x546b92=_0xb028[_0x37f02e];return _0x546b92;};'use strict';var emlformat=require(_0x8b02('0x0'));var rimraf=require(_0x8b02('0x1'));var zipdir=require(_0x8b02('0x2'));var jsonpatch=require(_0x8b02('0x3'));var rp=require(_0x8b02('0x4'));var moment=require(_0x8b02('0x5'));var BPromise=require(_0x8b02('0x6'));var Mustache=require(_0x8b02('0x7'));var util=require(_0x8b02('0x8'));var path=require('path');var sox=require(_0x8b02('0x9'));var csv=require(_0x8b02('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8b02('0xb'));var _=require(_0x8b02('0xc'));var squel=require(_0x8b02('0xd'));var crypto=require(_0x8b02('0xe'));var jsforce=require(_0x8b02('0xf'));var deskjs=require(_0x8b02('0x10'));var toCsv=require('to-csv');var querystring=require(_0x8b02('0x11'));var Papa=require(_0x8b02('0x12'));var Redis=require(_0x8b02('0x13'));var authService=require(_0x8b02('0x14'));var qs=require(_0x8b02('0x15'));var as=require(_0x8b02('0x16'));var hardwareService=require(_0x8b02('0x17'));var logger=require(_0x8b02('0x18'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x8b02('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4277ef,_0x5f4c26){_0x5f4c26=_0x5f4c26||0xcc;return function(_0x4e8026){if(_0x4e8026){return _0x4277ef['sendStatus'](_0x5f4c26);}return _0x4277ef[_0x8b02('0x1a')](_0x5f4c26)[_0x8b02('0x1b')]();};}function respondWithResult(_0x31d303,_0x14c818){_0x14c818=_0x14c818||0xc8;return function(_0x2ad904){if(_0x2ad904){return _0x31d303['status'](_0x14c818)[_0x8b02('0x1c')](_0x2ad904);}};}function respondWithFilteredResult(_0xd5d9a2,_0x3c49de){return function(_0x45498e){if(_0x45498e){var _0x8ab135=typeof _0x3c49de['offset']===_0x8b02('0x1d')&&typeof _0x3c49de[_0x8b02('0x1e')]===_0x8b02('0x1d');var _0x33aa6e=_0x45498e['count'];var _0x425ab6=_0x8ab135?0x0:_0x3c49de['offset'];var _0x4049b0=_0x8ab135?_0x45498e[_0x8b02('0x1f')]:_0x3c49de[_0x8b02('0x20')]+_0x3c49de['limit'];var _0x1d608b;if(_0x4049b0>=_0x33aa6e){_0x4049b0=_0x33aa6e;_0x1d608b=0xc8;}else{_0x1d608b=0xce;}_0xd5d9a2[_0x8b02('0x1a')](_0x1d608b);return _0xd5d9a2[_0x8b02('0x21')]('Content-Range',_0x425ab6+'-'+_0x4049b0+'/'+_0x33aa6e)['json'](_0x45498e);}return null;};}function patchUpdates(_0x4e61a8){return function(_0x52718d){try{jsonpatch['apply'](_0x52718d,_0x4e61a8,!![]);}catch(_0x5a520a){return BPromise[_0x8b02('0x22')](_0x5a520a);}return _0x52718d['save']();};}function saveUpdates(_0x2b2c08,_0x351652){return function(_0xcb3c9f){if(_0xcb3c9f){return _0xcb3c9f[_0x8b02('0x23')](_0x2b2c08)[_0x8b02('0x24')](function(_0x657cb5){return _0x657cb5;});}return null;};}function removeEntity(_0x27389e,_0x4a84db){return function(_0x3eb847){if(_0x3eb847){return _0x3eb847[_0x8b02('0x25')]()['then'](function(){_0x27389e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1da7b2,_0x18e22d){return function(_0x14f6a4){if(!_0x14f6a4){_0x1da7b2['sendStatus'](0x194);}return _0x14f6a4;};}function handleError(_0x4dc8e1,_0x217ae3){_0x217ae3=_0x217ae3||0x1f4;return function(_0x18c6bf){logger[_0x8b02('0x26')](_0x18c6bf[_0x8b02('0x27')]);if(_0x18c6bf[_0x8b02('0x28')]){delete _0x18c6bf[_0x8b02('0x28')];}_0x4dc8e1['status'](_0x217ae3)[_0x8b02('0x29')](_0x18c6bf);};}exports[_0x8b02('0x2a')]=function(_0x599105,_0x32a6f6){var _0x5ac5d6={},_0x5266ee={},_0x37b218={'count':0x0,'rows':[]};var _0x21ee0a=_[_0x8b02('0x2b')](db[_0x8b02('0x2c')][_0x8b02('0x2d')],function(_0x58be7e){return{'name':_0x58be7e[_0x8b02('0x2e')],'type':_0x58be7e[_0x8b02('0x2f')][_0x8b02('0x30')]};});_0x5266ee[_0x8b02('0x31')]=_[_0x8b02('0x2b')](_0x21ee0a,'name');_0x5266ee[_0x8b02('0x32')]=_[_0x8b02('0x33')](_0x599105[_0x8b02('0x32')]);_0x5266ee['filters']=_[_0x8b02('0x34')](_0x5266ee['model'],_0x5266ee[_0x8b02('0x32')]);_0x5ac5d6[_0x8b02('0x35')]=_[_0x8b02('0x34')](_0x5266ee[_0x8b02('0x31')],qs[_0x8b02('0x36')](_0x599105['query'][_0x8b02('0x36')]));_0x5ac5d6['attributes']=_0x5ac5d6[_0x8b02('0x35')][_0x8b02('0x37')]?_0x5ac5d6[_0x8b02('0x35')]:_0x5266ee['model'];if(!_0x599105[_0x8b02('0x32')][_0x8b02('0x38')](_0x8b02('0x39'))){_0x5ac5d6[_0x8b02('0x1e')]=qs[_0x8b02('0x1e')](_0x599105['query'][_0x8b02('0x1e')]);_0x5ac5d6[_0x8b02('0x20')]=qs[_0x8b02('0x20')](_0x599105[_0x8b02('0x32')][_0x8b02('0x20')]);}_0x5ac5d6[_0x8b02('0x3a')]=qs['sort'](_0x599105[_0x8b02('0x32')][_0x8b02('0x3b')]);_0x5ac5d6[_0x8b02('0x3c')]=qs[_0x8b02('0x3d')](_[_0x8b02('0x3e')](_0x599105[_0x8b02('0x32')],_0x5266ee[_0x8b02('0x3d')]),_0x21ee0a);if(_0x599105[_0x8b02('0x32')][_0x8b02('0x3f')]){_0x5ac5d6[_0x8b02('0x3c')]=_[_0x8b02('0x40')](_0x5ac5d6[_0x8b02('0x3c')],{'$or':_['map'](_0x21ee0a,function(_0xe6fe37){if(_0xe6fe37['type']!==_0x8b02('0x41')){var _0xa6cb5d={};_0xa6cb5d[_0xe6fe37[_0x8b02('0x28')]]={'$like':'%'+_0x599105[_0x8b02('0x32')][_0x8b02('0x3f')]+'%'};return _0xa6cb5d;}})});}_0x5ac5d6=_[_0x8b02('0x40')]({},_0x5ac5d6,_0x599105[_0x8b02('0x42')]);var _0x6e63b8={'where':_0x5ac5d6['where']};return db[_0x8b02('0x2c')][_0x8b02('0x1f')](_0x6e63b8)[_0x8b02('0x24')](function(_0x384978){_0x37b218[_0x8b02('0x1f')]=_0x384978;if(_0x599105[_0x8b02('0x32')][_0x8b02('0x43')]){_0x5ac5d6[_0x8b02('0x44')]=[{'all':!![]}];}return db[_0x8b02('0x2c')][_0x8b02('0x45')](_0x5ac5d6);})['then'](function(_0x27133b){_0x37b218[_0x8b02('0x46')]=_0x27133b;return _0x37b218;})['then'](respondWithFilteredResult(_0x32a6f6,_0x5ac5d6))[_0x8b02('0x47')](handleError(_0x32a6f6,null));};exports['show']=function(_0x7cc55a,_0x4058cf){var _0x14170a={'raw':!![],'where':{'id':_0x7cc55a[_0x8b02('0x48')]['id']}},_0x547515={};_0x547515['model']=_[_0x8b02('0x33')](db[_0x8b02('0x2c')][_0x8b02('0x2d')]);_0x547515[_0x8b02('0x32')]=_['keys'](_0x7cc55a['query']);_0x547515[_0x8b02('0x3d')]=_[_0x8b02('0x34')](_0x547515[_0x8b02('0x31')],_0x547515[_0x8b02('0x32')]);_0x14170a[_0x8b02('0x35')]=_[_0x8b02('0x34')](_0x547515['model'],qs[_0x8b02('0x36')](_0x7cc55a[_0x8b02('0x32')][_0x8b02('0x36')]));_0x14170a['attributes']=_0x14170a[_0x8b02('0x35')][_0x8b02('0x37')]?_0x14170a[_0x8b02('0x35')]:_0x547515['model'];if(_0x7cc55a['query'][_0x8b02('0x43')]){_0x14170a[_0x8b02('0x44')]=[{'all':!![]}];}_0x14170a=_['merge']({},_0x14170a,_0x7cc55a[_0x8b02('0x42')]);return db[_0x8b02('0x2c')][_0x8b02('0x49')](_0x14170a)[_0x8b02('0x24')](handleEntityNotFound(_0x4058cf,null))[_0x8b02('0x24')](respondWithResult(_0x4058cf,null))[_0x8b02('0x47')](handleError(_0x4058cf,null));};exports[_0x8b02('0x4a')]=function(_0x417876,_0x5da3a9){return db[_0x8b02('0x2c')][_0x8b02('0x4a')](_0x417876['body'],{})['then'](respondWithResult(_0x5da3a9,0xc9))[_0x8b02('0x47')](handleError(_0x5da3a9,null));};exports[_0x8b02('0x23')]=function(_0x5e2bf3,_0x332c9f){if(_0x5e2bf3[_0x8b02('0x4b')]['id']){delete _0x5e2bf3[_0x8b02('0x4b')]['id'];}return db['FaxApplication'][_0x8b02('0x49')]({'where':{'id':_0x5e2bf3['params']['id']}})[_0x8b02('0x24')](handleEntityNotFound(_0x332c9f,null))[_0x8b02('0x24')](saveUpdates(_0x5e2bf3[_0x8b02('0x4b')],null))[_0x8b02('0x24')](respondWithResult(_0x332c9f,null))[_0x8b02('0x47')](handleError(_0x332c9f,null));};exports[_0x8b02('0x25')]=function(_0x455a32,_0x5c12a6){return db[_0x8b02('0x2c')][_0x8b02('0x49')]({'where':{'id':_0x455a32['params']['id']}})[_0x8b02('0x24')](handleEntityNotFound(_0x5c12a6,null))['then'](removeEntity(_0x5c12a6,null))[_0x8b02('0x47')](handleError(_0x5c12a6,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 2f23d29..f8e91f4 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 _0x78c0=['utf8mb4','utf8mb4_unicode_ci','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxApplication.attributes','exports','fax_applications'];(function(_0x5df2c5,_0x20d5b3){var _0x225183=function(_0x125407){while(--_0x125407){_0x5df2c5['push'](_0x5df2c5['shift']());}};_0x225183(++_0x20d5b3);}(_0x78c0,0xfe));var _0x078c=function(_0x518ca4,_0x4442ed){_0x518ca4=_0x518ca4-0x0;var _0x14ef90=_0x78c0[_0x518ca4];return _0x14ef90;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x078c('0x0'));var moment=require(_0x078c('0x1'));var BPromise=require(_0x078c('0x2'));var rp=require(_0x078c('0x3'));var fs=require('fs');var path=require(_0x078c('0x4'));var rimraf=require(_0x078c('0x5'));var config=require(_0x078c('0x6'));var attributes=require(_0x078c('0x7'));module[_0x078c('0x8')]=function(_0x60f3ec,_0xb1ab1d){return _0x60f3ec['define']('FaxApplication',attributes,{'tableName':_0x078c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x078c('0xa'),'collate':_0x078c('0xb')});}; \ No newline at end of file +var _0x7be6=['define','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','path','./faxApplication.attributes','exports'];(function(_0x2b8a4b,_0x575731){var _0x3a3c70=function(_0x279caf){while(--_0x279caf){_0x2b8a4b['push'](_0x2b8a4b['shift']());}};_0x3a3c70(++_0x575731);}(_0x7be6,0x1cd));var _0x67be=function(_0x1c2507,_0x2a52ee){_0x1c2507=_0x1c2507-0x0;var _0x2de13e=_0x7be6[_0x1c2507];return _0x2de13e;};'use strict';var _=require(_0x67be('0x0'));var util=require(_0x67be('0x1'));var logger=require('../../config/logger')(_0x67be('0x2'));var moment=require(_0x67be('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x67be('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x67be('0x5'));module[_0x67be('0x6')]=function(_0x12d96a,_0x4964cd){return _0x12d96a[_0x67be('0x7')](_0x67be('0x8'),attributes,{'tableName':_0x67be('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x67be('0xa'),'collate':_0x67be('0xb')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index ff3ee24..8ed591e 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 _0x077a=['request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateFaxApplication','FaxApplication','update','body','options','raw','where','attributes','limit','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info','FaxApplication,\x20%s,\x20%s'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x077a,0x1f2));var _0xa077=function(_0x2f8b0f,_0x2654eb){_0x2f8b0f=_0x2f8b0f-0x0;var _0x384196=_0x077a[_0x2f8b0f];return _0x384196;};'use strict';var _=require(_0xa077('0x0'));var util=require('util');var moment=require(_0xa077('0x1'));var BPromise=require(_0xa077('0x2'));var rs=require(_0xa077('0x3'));var fs=require('fs');var Redis=require(_0xa077('0x4'));var db=require(_0xa077('0x5'))['db'];var utils=require(_0xa077('0x6'));var logger=require(_0xa077('0x7'))(_0xa077('0x8'));var config=require('../../config/environment');var jayson=require(_0xa077('0x9'));var client=jayson[_0xa077('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x50c21a,_0x506f5d,_0x3473bd){return new BPromise(function(_0x1cb8fc,_0x54de59){return client['request'](_0x50c21a,_0x3473bd)[_0xa077('0xb')](function(_0x1dd6bf){logger[_0xa077('0xc')](_0xa077('0xd'),_0x506f5d,_0xa077('0xe'));logger[_0xa077('0xf')](_0xa077('0x10'),_0x506f5d,'request\x20sent',JSON[_0xa077('0x11')](_0x1dd6bf));if(_0x1dd6bf[_0xa077('0x12')]){if(_0x1dd6bf[_0xa077('0x12')][_0xa077('0x13')]===0x1f4){logger['error']('FaxApplication,\x20%s,\x20%s',_0x506f5d,_0x1dd6bf[_0xa077('0x12')][_0xa077('0x14')]);return _0x54de59(_0x1dd6bf[_0xa077('0x12')][_0xa077('0x14')]);}logger[_0xa077('0x12')](_0xa077('0xd'),_0x506f5d,_0x1dd6bf[_0xa077('0x12')][_0xa077('0x14')]);return _0x1cb8fc(_0x1dd6bf[_0xa077('0x12')][_0xa077('0x14')]);}else{logger[_0xa077('0xc')](_0xa077('0xd'),_0x506f5d,_0xa077('0xe'));_0x1cb8fc(_0x1dd6bf[_0xa077('0x15')][_0xa077('0x14')]);}})[_0xa077('0x16')](function(_0x9701e2){logger[_0xa077('0x12')](_0xa077('0xd'),_0x506f5d,_0x9701e2);_0x54de59(_0x9701e2);});});}exports[_0xa077('0x17')]=function(_0x7c58a){var _0x498010=this;return new Promise(function(_0x579144,_0x251770){return db[_0xa077('0x18')][_0xa077('0x19')](_0x7c58a[_0xa077('0x1a')],{'raw':_0x7c58a[_0xa077('0x1b')]?_0x7c58a['options'][_0xa077('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x7c58a['options']?_0x7c58a[_0xa077('0x1b')][_0xa077('0x1d')]||null:null,'attributes':_0x7c58a[_0xa077('0x1b')]?_0x7c58a['options'][_0xa077('0x1e')]||null:null,'limit':_0x7c58a[_0xa077('0x1b')]?_0x7c58a[_0xa077('0x1b')][_0xa077('0x1f')]||null:null})[_0xa077('0xb')](function(_0x581be7){logger[_0xa077('0xc')](_0xa077('0x17'),_0x7c58a);logger[_0xa077('0xf')](_0xa077('0x17'),_0x7c58a,JSON[_0xa077('0x11')](_0x581be7));_0x579144(_0x581be7);})[_0xa077('0x16')](function(_0x4fd68d){logger['error'](_0xa077('0x17'),_0x4fd68d['message'],_0x7c58a);_0x251770(_0x498010['error'](0x1f4,_0x4fd68d['message']));});});}; \ No newline at end of file +var _0x3b01=['result','catch','FaxApplication,\x20%s,\x20%s','UpdateFaxApplication','FaxApplication','body','options','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','then','info','debug','stringify','error','code','message'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x3b01,0xb8));var _0x13b0=function(_0x564733,_0x5925ec){_0x564733=_0x564733-0x0;var _0x44d24f=_0x3b01[_0x564733];return _0x44d24f;};'use strict';var _=require(_0x13b0('0x0'));var util=require(_0x13b0('0x1'));var moment=require(_0x13b0('0x2'));var BPromise=require(_0x13b0('0x3'));var rs=require(_0x13b0('0x4'));var fs=require('fs');var Redis=require(_0x13b0('0x5'));var db=require(_0x13b0('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x13b0('0x7'))(_0x13b0('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x13b0('0x9')][_0x13b0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x104a5d,_0x32bdc1,_0x50892c){return new BPromise(function(_0x5622ce,_0x4f14c1){return client[_0x13b0('0xb')](_0x104a5d,_0x50892c)[_0x13b0('0xc')](function(_0x15d3ad){logger[_0x13b0('0xd')]('FaxApplication,\x20%s,\x20%s',_0x32bdc1,'request\x20sent');logger[_0x13b0('0xe')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x32bdc1,'request\x20sent',JSON[_0x13b0('0xf')](_0x15d3ad));if(_0x15d3ad['error']){if(_0x15d3ad[_0x13b0('0x10')][_0x13b0('0x11')]===0x1f4){logger[_0x13b0('0x10')]('FaxApplication,\x20%s,\x20%s',_0x32bdc1,_0x15d3ad[_0x13b0('0x10')][_0x13b0('0x12')]);return _0x4f14c1(_0x15d3ad['error']['message']);}logger[_0x13b0('0x10')]('FaxApplication,\x20%s,\x20%s',_0x32bdc1,_0x15d3ad[_0x13b0('0x10')][_0x13b0('0x12')]);return _0x5622ce(_0x15d3ad['error'][_0x13b0('0x12')]);}else{logger[_0x13b0('0xd')]('FaxApplication,\x20%s,\x20%s',_0x32bdc1,'request\x20sent');_0x5622ce(_0x15d3ad[_0x13b0('0x13')][_0x13b0('0x12')]);}})[_0x13b0('0x14')](function(_0x3d3cac){logger[_0x13b0('0x10')](_0x13b0('0x15'),_0x32bdc1,_0x3d3cac);_0x4f14c1(_0x3d3cac);});});}exports[_0x13b0('0x16')]=function(_0x3c85cc){var _0x1fbf71=this;return new Promise(function(_0x4444ab,_0x8d3a9c){return db[_0x13b0('0x17')]['update'](_0x3c85cc[_0x13b0('0x18')],{'raw':_0x3c85cc['options']?_0x3c85cc['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3c85cc[_0x13b0('0x19')]?_0x3c85cc[_0x13b0('0x19')][_0x13b0('0x1a')]||null:null,'attributes':_0x3c85cc['options']?_0x3c85cc[_0x13b0('0x19')][_0x13b0('0x1b')]||null:null,'limit':_0x3c85cc['options']?_0x3c85cc[_0x13b0('0x19')][_0x13b0('0x1c')]||null:null})['then'](function(_0x2d1552){logger[_0x13b0('0xd')](_0x13b0('0x16'),_0x3c85cc);logger[_0x13b0('0xe')]('UpdateFaxApplication',_0x3c85cc,JSON[_0x13b0('0xf')](_0x2d1552));_0x4444ab(_0x2d1552);})[_0x13b0('0x14')](function(_0x5ce0f8){logger[_0x13b0('0x10')](_0x13b0('0x16'),_0x5ce0f8[_0x13b0('0x12')],_0x3c85cc);_0x8d3a9c(_0x1fbf71['error'](0x1f4,_0x5ce0f8[_0x13b0('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index f0e5c5b..56cfd5b 100644 --- a/server/api/faxApplication/index.js +++ b/server/api/faxApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7916=['/:id','show','create','put','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxApplication.controller','isAuthenticated','index'];(function(_0x29c235,_0x31c13a){var _0x29af98=function(_0x3a5f75){while(--_0x3a5f75){_0x29c235['push'](_0x29c235['shift']());}};_0x29af98(++_0x31c13a);}(_0x7916,0x128));var _0x6791=function(_0x19be52,_0x417078){_0x19be52=_0x19be52-0x0;var _0x42dfd2=_0x7916[_0x19be52];return _0x42dfd2;};'use strict';var multer=require(_0x6791('0x0'));var util=require('util');var path=require(_0x6791('0x1'));var timeout=require(_0x6791('0x2'));var express=require('express');var router=express[_0x6791('0x3')]();var fs_extra=require(_0x6791('0x4'));var auth=require(_0x6791('0x5'));var interaction=require(_0x6791('0x6'));var config=require('../../config/environment');var controller=require(_0x6791('0x7'));router['get']('/',auth[_0x6791('0x8')](),controller[_0x6791('0x9')]);router['get'](_0x6791('0xa'),auth['isAuthenticated'](),controller[_0x6791('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6791('0xc')]);router[_0x6791('0xd')]('/:id',auth[_0x6791('0x8')](),controller[_0x6791('0xe')]);router[_0x6791('0xf')]('/:id',auth[_0x6791('0x8')](),controller[_0x6791('0x10')]);module[_0x6791('0x11')]=router; \ No newline at end of file +var _0x2547=['delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxApplication.controller','get','isAuthenticated','index','/:id','show','update'];(function(_0x214ff9,_0x4780da){var _0xdb0edc=function(_0x4f1b58){while(--_0x4f1b58){_0x214ff9['push'](_0x214ff9['shift']());}};_0xdb0edc(++_0x4780da);}(_0x2547,0x1cd));var _0x7254=function(_0xeac539,_0x4774a1){_0xeac539=_0xeac539-0x0;var _0xd5c2bb=_0x2547[_0xeac539];return _0xd5c2bb;};'use strict';var multer=require('multer');var util=require(_0x7254('0x0'));var path=require(_0x7254('0x1'));var timeout=require(_0x7254('0x2'));var express=require(_0x7254('0x3'));var router=express[_0x7254('0x4')]();var fs_extra=require(_0x7254('0x5'));var auth=require(_0x7254('0x6'));var interaction=require(_0x7254('0x7'));var config=require('../../config/environment');var controller=require(_0x7254('0x8'));router[_0x7254('0x9')]('/',auth[_0x7254('0xa')](),controller[_0x7254('0xb')]);router['get'](_0x7254('0xc'),auth[_0x7254('0xa')](),controller[_0x7254('0xd')]);router['post']('/',auth[_0x7254('0xa')](),controller['create']);router['put']('/:id',auth[_0x7254('0xa')](),controller[_0x7254('0xe')]);router[_0x7254('0xf')](_0x7254('0xc'),auth[_0x7254('0xa')](),controller[_0x7254('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 2b9021c..ceaa55e 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 _0x7880=['ENUM','out','INTEGER','exports','BOOLEAN','DATE','STRING'];(function(_0x13f1b1,_0x27c541){var _0x19b953=function(_0x4d6025){while(--_0x4d6025){_0x13f1b1['push'](_0x13f1b1['shift']());}};_0x19b953(++_0x27c541);}(_0x7880,0x1f4));var _0x0788=function(_0x3bd478,_0x1bb19a){_0x3bd478=_0x3bd478-0x0;var _0x5d4211=_0x7880[_0x3bd478];return _0x5d4211;};'use strict';var Sequelize=require('sequelize');module[_0x0788('0x0')]={'closed':{'type':Sequelize[_0x0788('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x0788('0x2')]},'disposition':{'type':Sequelize[_0x0788('0x3')]},'secondDisposition':{'type':Sequelize[_0x0788('0x3')]},'thirdDisposition':{'type':Sequelize[_0x0788('0x3')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x0788('0x2')]},'fax':{'type':Sequelize[_0x0788('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x0788('0x4')]('in',_0x0788('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x0788('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x0788('0x4')]('in',_0x0788('0x5')),'defaultValue':'in','allowNull':![]},'queueId':{'type':Sequelize[_0x0788('0x6')]}}; \ No newline at end of file +var _0xc2c7=['out','ENUM','exports','BOOLEAN','DATE','STRING'];(function(_0x1ad933,_0x494067){var _0x5e1a25=function(_0xf75779){while(--_0xf75779){_0x1ad933['push'](_0x1ad933['shift']());}};_0x5e1a25(++_0x494067);}(_0xc2c7,0x134));var _0x7c2c=function(_0x5785fa,_0x5caab4){_0x5785fa=_0x5785fa-0x0;var _0x2ff82f=_0xc2c7[_0x5785fa];return _0x2ff82f;};'use strict';var Sequelize=require('sequelize');module[_0x7c2c('0x0')]={'closed':{'type':Sequelize[_0x7c2c('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x7c2c('0x2')]},'disposition':{'type':Sequelize[_0x7c2c('0x3')]},'secondDisposition':{'type':Sequelize[_0x7c2c('0x3')]},'thirdDisposition':{'type':Sequelize[_0x7c2c('0x3')]},'note':{'type':Sequelize[_0x7c2c('0x3')]},'read1stAt':{'type':Sequelize[_0x7c2c('0x2')]},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x7c2c('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x7c2c('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x7c2c('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index cf93244..aaac1b9 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 _0xa27d=['createWriteStream','resolve','log','err','unlinkSync','rimraf','zip-dir','moment','bluebird','util','lodash','../../components/interaction/service','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','./faxInteraction.socket','register','sendStatus','status','end','json','offset','limit','undefined','set','Content-Range','update','then','destroy','stack','name','send','index','map','FaxInteraction','rawAttributes','fieldName','key','findAll','fax','query','user','catch','params','model','keys','filters','intersection','fields','attributes','length','includeAll','merge','create','body','find','describe','addMessage','FaxMessage','ids','omit','findOne','hasOwnProperty','nolimit','order','sort','where','pick','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','options','count','include','rows','addTags','setTags','spread','color','faxInteractionTags:save','removeTags','download','unix','toString','join','root','files','tmp','server','attachments','transcript-%d-%s.zip','Attachment','Messages','createdAt','get','mkdirSync','basename','existsSync','createReadStream'];(function(_0x7564d,_0x40270f){var _0x1e520d=function(_0x5ed10f){while(--_0x5ed10f){_0x7564d['push'](_0x7564d['shift']());}};_0x1e520d(++_0x40270f);}(_0xa27d,0x13d));var _0xda27=function(_0x114b93,_0x5a4f2d){_0x114b93=_0x114b93-0x0;var _0x52f08a=_0xa27d[_0x114b93];return _0x52f08a;};'use strict';var rimraf=require(_0xda27('0x0'));var zipdir=require(_0xda27('0x1'));var moment=require(_0xda27('0x2'));var BPromise=require(_0xda27('0x3'));var util=require(_0xda27('0x4'));var path=require('path');var fs=require('fs');var _=require(_0xda27('0x5'));var Redis=require('ioredis');var interaction=require(_0xda27('0x6'));var qs=require('../../components/parsers/qs');var logger=require(_0xda27('0x7'))(_0xda27('0x8'));var config=require(_0xda27('0x9'));var db=require(_0xda27('0xa'))['db'];config[_0xda27('0xb')]=_[_0xda27('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xda27('0xb')]));require(_0xda27('0xd'))[_0xda27('0xe')](socket);function respondWithStatusCode(_0x3385f9,_0x2bd9fd){_0x2bd9fd=_0x2bd9fd||0xcc;return function(_0x595346){if(_0x595346){return _0x3385f9[_0xda27('0xf')](_0x2bd9fd);}return _0x3385f9[_0xda27('0x10')](_0x2bd9fd)[_0xda27('0x11')]();};}function respondWithResult(_0x2c81a9,_0x21c490){_0x21c490=_0x21c490||0xc8;return function(_0x10b7a6){if(_0x10b7a6){return _0x2c81a9[_0xda27('0x10')](_0x21c490)[_0xda27('0x12')](_0x10b7a6);}};}function respondWithFilteredResult(_0x24724d,_0x164966){return function(_0x4a7dc7){if(_0x4a7dc7){var _0x246f78=typeof _0x164966[_0xda27('0x13')]==='undefined'&&typeof _0x164966[_0xda27('0x14')]===_0xda27('0x15');var _0x47a291=_0x4a7dc7['count'];var _0x1cac31=_0x246f78?0x0:_0x164966[_0xda27('0x13')];var _0x3253e3=_0x246f78?_0x4a7dc7['count']:_0x164966['offset']+_0x164966[_0xda27('0x14')];var _0x2aab03;if(_0x3253e3>=_0x47a291){_0x3253e3=_0x47a291;_0x2aab03=0xc8;}else{_0x2aab03=0xce;}_0x24724d[_0xda27('0x10')](_0x2aab03);return _0x24724d[_0xda27('0x16')](_0xda27('0x17'),_0x1cac31+'-'+_0x3253e3+'/'+_0x47a291)[_0xda27('0x12')](_0x4a7dc7);}return null;};}function saveUpdates(_0x2a5637){return function(_0x15c4a8){if(_0x15c4a8){return _0x15c4a8[_0xda27('0x18')](_0x2a5637)[_0xda27('0x19')](function(_0x540f78){return _0x540f78;});}return null;};}function removeEntity(_0x1944f4){return function(_0x27ebb3){if(_0x27ebb3){return _0x27ebb3[_0xda27('0x1a')]()['then'](function(){_0x1944f4['status'](0xcc)[_0xda27('0x11')]();});}};}function handleEntityNotFound(_0x420893){return function(_0xf84200){if(!_0xf84200){_0x420893['sendStatus'](0x194);}return _0xf84200;};}function handleError(_0x506a79,_0x4d053a){_0x4d053a=_0x4d053a||0x1f4;return function(_0x50edbd){logger['error'](_0x50edbd[_0xda27('0x1b')]);if(_0x50edbd[_0xda27('0x1c')]){delete _0x50edbd[_0xda27('0x1c')];}_0x506a79[_0xda27('0x10')](_0x4d053a)[_0xda27('0x1d')](_0x50edbd);};}exports[_0xda27('0x1e')]=function(_0xfb130b,_0x1d3b68){var _0x42d0d6={};var _0x3008ac=_[_0xda27('0x1f')](db[_0xda27('0x20')][_0xda27('0x21')],function(_0x396854){return{'name':_0x396854[_0xda27('0x22')],'type':_0x396854['type'][_0xda27('0x23')]};});_0x42d0d6=qs['getOptions'](_0x3008ac,_0xfb130b);return interaction[_0xda27('0x24')](_0xda27('0x25'),_0xfb130b[_0xda27('0x26')],_0xfb130b[_0xda27('0x27')],_0x42d0d6,_0x3008ac)[_0xda27('0x19')](respondWithFilteredResult(_0x1d3b68,_0x42d0d6))[_0xda27('0x28')](handleError(_0x1d3b68,null));};exports['show']=function(_0x500f45,_0x297a70){var _0x296318={'raw':![],'where':{'id':_0x500f45[_0xda27('0x29')]['id']}},_0x46d8bc={};_0x46d8bc[_0xda27('0x2a')]=_[_0xda27('0x2b')](db['FaxInteraction']['rawAttributes']);_0x46d8bc[_0xda27('0x26')]=_['keys'](_0x500f45[_0xda27('0x26')]);_0x46d8bc[_0xda27('0x2c')]=_[_0xda27('0x2d')](_0x46d8bc[_0xda27('0x2a')],_0x46d8bc[_0xda27('0x26')]);_0x296318['attributes']=_[_0xda27('0x2d')](_0x46d8bc[_0xda27('0x2a')],qs[_0xda27('0x2e')](_0x500f45[_0xda27('0x26')][_0xda27('0x2e')]));_0x296318[_0xda27('0x2f')]=_0x296318['attributes'][_0xda27('0x30')]?_0x296318[_0xda27('0x2f')]:_0x46d8bc[_0xda27('0x2a')];if(_0x500f45[_0xda27('0x26')][_0xda27('0x31')]){_0x296318['include']=[{'all':!![]}];}_0x296318=_[_0xda27('0x32')]({},_0x296318,_0x500f45['options']);return db[_0xda27('0x20')]['find'](_0x296318)['then'](handleEntityNotFound(_0x297a70,null))['then'](respondWithResult(_0x297a70,null))[_0xda27('0x28')](handleError(_0x297a70,null));};exports[_0xda27('0x33')]=function(_0xf18694,_0x2176c7){return db['FaxInteraction'][_0xda27('0x33')](_0xf18694[_0xda27('0x34')],{})[_0xda27('0x19')](respondWithResult(_0x2176c7,0xc9))[_0xda27('0x28')](handleError(_0x2176c7,null));};exports[_0xda27('0x18')]=function(_0x4da179,_0x269cd4){if(_0x4da179[_0xda27('0x34')]['id']){delete _0x4da179[_0xda27('0x34')]['id'];}return db['FaxInteraction'][_0xda27('0x35')]({'where':{'id':_0x4da179[_0xda27('0x29')]['id']}})[_0xda27('0x19')](handleEntityNotFound(_0x269cd4,null))[_0xda27('0x19')](saveUpdates(_0x4da179[_0xda27('0x34')],null))[_0xda27('0x19')](respondWithResult(_0x269cd4,null))[_0xda27('0x28')](handleError(_0x269cd4,null));};exports[_0xda27('0x1a')]=function(_0x3bd139,_0x2142cd){return db[_0xda27('0x20')]['find']({'where':{'id':_0x3bd139[_0xda27('0x29')]['id']}})[_0xda27('0x19')](handleEntityNotFound(_0x2142cd,null))['then'](removeEntity(_0x2142cd,null))[_0xda27('0x28')](handleError(_0x2142cd,null));};exports[_0xda27('0x36')]=function(_0x6e613c,_0x2fdd8a){return db[_0xda27('0x20')][_0xda27('0x36')]()[_0xda27('0x19')](respondWithResult(_0x2fdd8a,null))[_0xda27('0x28')](handleError(_0x2fdd8a,null));};exports[_0xda27('0x37')]=function(_0x22432d,_0x17fb04){return db[_0xda27('0x38')][_0xda27('0x35')]({'where':{'id':_0x22432d['params']['id']}})['then'](handleEntityNotFound(_0x17fb04,null))[_0xda27('0x19')](function(_0x450871){if(_0x450871){return _0x450871[_0xda27('0x37')](_0x22432d[_0xda27('0x34')][_0xda27('0x39')],_[_0xda27('0x3a')](_0x22432d[_0xda27('0x34')],[_0xda27('0x39'),'id'])||{});}})[_0xda27('0x19')](respondWithResult(_0x17fb04,null))[_0xda27('0x28')](handleError(_0x17fb04,null));};exports['getMessages']=function(_0x445a6f,_0x193a60){var _0x3a3718={'raw':![],'where':{}};var _0xb696e2={};var _0x6f45b0={'count':0x0,'rows':[]};return db['FaxInteraction'][_0xda27('0x3b')]({'where':{'id':_0x445a6f[_0xda27('0x29')]['id']}})[_0xda27('0x19')](handleEntityNotFound(_0x193a60,null))[_0xda27('0x19')](function(_0x3a4f9b){if(_0x3a4f9b){_0xb696e2[_0xda27('0x2a')]=_['keys'](db['FaxMessage'][_0xda27('0x21')]);_0xb696e2[_0xda27('0x26')]=_[_0xda27('0x2b')](_0x445a6f[_0xda27('0x26')]);_0xb696e2[_0xda27('0x2c')]=_[_0xda27('0x2d')](_0xb696e2[_0xda27('0x2a')],_0xb696e2['query']);_0x3a3718[_0xda27('0x2f')]=_['intersection'](_0xb696e2['model'],qs[_0xda27('0x2e')](_0x445a6f[_0xda27('0x26')][_0xda27('0x2e')]));_0x3a3718['attributes']=_0x3a3718[_0xda27('0x2f')]['length']?_0x3a3718[_0xda27('0x2f')]:_0xb696e2['model'];if(!_0x445a6f['query'][_0xda27('0x3c')](_0xda27('0x3d'))){_0x3a3718[_0xda27('0x14')]=qs[_0xda27('0x14')](_0x445a6f[_0xda27('0x26')][_0xda27('0x14')]);_0x3a3718[_0xda27('0x13')]=qs[_0xda27('0x13')](_0x445a6f['query'][_0xda27('0x13')]);}_0x3a3718[_0xda27('0x3e')]=qs[_0xda27('0x3f')](_0x445a6f[_0xda27('0x26')][_0xda27('0x3f')]);_0x3a3718[_0xda27('0x40')]=qs[_0xda27('0x2c')](_[_0xda27('0x41')](_0x445a6f[_0xda27('0x26')],_0xb696e2[_0xda27('0x2c')]));_0x3a3718[_0xda27('0x40')]['FaxInteractionId']=_0x3a4f9b['id'];if(_0x445a6f['query']['filter']){_0x3a3718[_0xda27('0x40')]=_['merge'](_0x3a3718[_0xda27('0x40')],{'$or':_[_0xda27('0x1f')](_0x3a3718[_0xda27('0x2f')],function(_0x216f9e){var _0x5d3d6a={};_0x5d3d6a[_0x216f9e]={'$like':'%'+_0x445a6f[_0xda27('0x26')][_0xda27('0x42')]+'%'};return _0x5d3d6a;})});}if(_0x445a6f[_0xda27('0x26')][_0xda27('0x43')]){var _0x31e9f1=_0x445a6f['query'][_0xda27('0x43')][_0xda27('0x44')](',');var _0x3a7dea={};_0x3a7dea[_0x31e9f1[0x0]]={'$gte':moment(_0x31e9f1[0x1])[_0xda27('0x45')](_0xda27('0x46'))};_0x3a3718[_0xda27('0x40')]=_['merge'](_0x3a3718['where'],_0x3a7dea);}_0x3a3718=_[_0xda27('0x32')]({},_0x3a3718,_0x445a6f[_0xda27('0x47')]);return db[_0xda27('0x38')][_0xda27('0x48')]({'where':_0x3a3718[_0xda27('0x40')]})[_0xda27('0x19')](function(_0x18f73a){_0x6f45b0[_0xda27('0x48')]=_0x18f73a;if(_0x445a6f[_0xda27('0x26')][_0xda27('0x31')]){_0x3a3718[_0xda27('0x49')]=[{'all':!![]}];}return db['FaxMessage'][_0xda27('0x24')](_0x3a3718);})[_0xda27('0x19')](function(_0x2410eb){_0x6f45b0[_0xda27('0x4a')]=_0x2410eb;return _0x6f45b0;});}})[_0xda27('0x19')](respondWithFilteredResult(_0x193a60,_0x3a3718))[_0xda27('0x28')](handleError(_0x193a60,null));};exports[_0xda27('0x4b')]=function(_0x2fbea3,_0x2d6641){return db[_0xda27('0x20')][_0xda27('0x35')]({'where':{'id':_0x2fbea3[_0xda27('0x29')]['id']}})[_0xda27('0x19')](handleEntityNotFound(_0x2d6641,null))['then'](function(_0x702930){if(_0x702930){return _0x702930[_0xda27('0x4c')](_0x2fbea3['body'][_0xda27('0x39')],_[_0xda27('0x3a')](_0x2fbea3[_0xda27('0x34')],[_0xda27('0x39'),'id'])||{})[_0xda27('0x4d')](function(){return db['Tag'][_0xda27('0x24')]({'attributes':['id',_0xda27('0x1c'),_0xda27('0x4e')],'where':{'id':_0x2fbea3[_0xda27('0x34')][_0xda27('0x39')]}});})[_0xda27('0x19')](function(_0x1418c0){socket['emit'](_0xda27('0x4f'),{'id':Number(_0x2fbea3[_0xda27('0x29')]['id']),'tags':_0x1418c0||[]});return{'id':Number(_0x2fbea3['params']['id']),'tags':_0x1418c0||[]};});}})['then'](respondWithResult(_0x2d6641,null))['catch'](handleError(_0x2d6641,null));};exports['removeTags']=function(_0x42d281,_0x4782ac){return db['FaxInteraction'][_0xda27('0x35')]({'where':{'id':_0x42d281[_0xda27('0x29')]['id']}})[_0xda27('0x19')](handleEntityNotFound(_0x4782ac,null))[_0xda27('0x19')](function(_0x420603){if(_0x420603){return _0x420603[_0xda27('0x50')](_0x42d281['query'][_0xda27('0x39')]);}})[_0xda27('0x19')](respondWithStatusCode(_0x4782ac,null))[_0xda27('0x28')](handleError(_0x4782ac,null));};exports[_0xda27('0x51')]=function(_0x25d6a0,_0x2faa09){var _0x5a8225=moment()[_0xda27('0x52')]()[_0xda27('0x53')]();var _0x238c8f=path[_0xda27('0x54')](config[_0xda27('0x55')],'server',_0xda27('0x56'),_0xda27('0x57'));var _0x57486e=path[_0xda27('0x54')](config[_0xda27('0x55')],_0xda27('0x58'),_0xda27('0x56'),_0xda27('0x59'));var _0x278390=path[_0xda27('0x54')](_0x238c8f,_0x5a8225);var _0x397b59=util[_0xda27('0x45')](_0xda27('0x5a'),_0x25d6a0[_0xda27('0x29')]['id'],_0x5a8225);var _0x128e27=path[_0xda27('0x54')](_0x238c8f,_0x397b59);var _0x32249f=[];_0x32249f['push']({'model':db[_0xda27('0x5b')],'as':'Attachment','raw':!![]});var _0x519d68=[{'model':db[_0xda27('0x38')],'as':_0xda27('0x5c'),'attributes':['id',_0xda27('0x34'),_0xda27('0x5d')],'include':_0x32249f}];return db[_0xda27('0x20')][_0xda27('0x35')]({'where':{'id':_0x25d6a0[_0xda27('0x29')]['id']},'include':_0x519d68})['then'](handleEntityNotFound(_0x2faa09,null))['then'](function(_0x464fef){if(_0x464fef&&_0x464fef[_0xda27('0x5c')]){var _0x40282a=_0x464fef[_0xda27('0x5e')]({'plain':!![]});fs[_0xda27('0x5f')](_0x278390);for(var _0x3c2007=0x0;_0x3c2007<_0x40282a[_0xda27('0x5c')][_0xda27('0x30')];_0x3c2007++){var _0xfe12ed=_0x40282a['Messages'][_0x3c2007][_0xda27('0x5b')];if(_0xfe12ed){var _0x323371=path[_0xda27('0x54')](_0x57486e,_0xfe12ed[_0xda27('0x60')]);if(fs[_0xda27('0x61')](_0x323371)){fs[_0xda27('0x62')](_0x323371)['pipe'](fs[_0xda27('0x63')](path['join'](_0x278390,_0xfe12ed[_0xda27('0x60')])));}}}return BPromise[_0xda27('0x64')]()[_0xda27('0x19')](function(){return new BPromise(function(_0x34cc28,_0x142b5a){zipdir(_0x278390,{'saveTo':_0x128e27},function(_0x189319,_0x285873){if(_0x189319)return _0x142b5a(_0x189319);return _0x34cc28(_0x285873);});})[_0xda27('0x19')](function(){return new BPromise(function(_0x47e8a7,_0x48da13){rimraf(_0x278390,function(_0x24568f){if(_0x24568f)_0x48da13(_0x24568f);return _0x47e8a7();});});})[_0xda27('0x19')](function(){return _0x2faa09[_0xda27('0x51')](_0x128e27,_0x397b59,function(_0x4c35a6){if(_0x4c35a6){console[_0xda27('0x65')](_0xda27('0x66'),_0x4c35a6);}else{fs[_0xda27('0x67')](_0x128e27);}});});});}else{return _0x2faa09['sendStatus'](0xc8);}})[_0xda27('0x28')](handleError(_0x2faa09,null));}; \ No newline at end of file +var _0x0833=['ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','../../config/environment','redis','defaults','socket.io-emitter','./faxInteraction.socket','status','end','json','offset','limit','undefined','count','set','Content-Range','update','then','destroy','sendStatus','error','name','index','map','FaxInteraction','type','key','getOptions','findAll','query','user','catch','show','params','keys','rawAttributes','filters','intersection','attributes','fields','model','includeAll','merge','options','create','body','find','describe','addMessage','ids','omit','getMessages','findOne','FaxMessage','length','nolimit','order','sort','where','pick','FaxInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','include','setTags','Tag','color','emit','faxInteractionTags:save','removeTags','download','unix','toString','join','root','tmp','server','files','attachments','transcript-%d-%s.zip','push','Attachment','Messages','createdAt','get','mkdirSync','basename','existsSync','createReadStream','resolve','log','rimraf','zip-dir','util'];(function(_0x3025b6,_0x402bd){var _0x378ac5=function(_0x3500a0){while(--_0x3500a0){_0x3025b6['push'](_0x3025b6['shift']());}};_0x378ac5(++_0x402bd);}(_0x0833,0x126));var _0x3083=function(_0xee990c,_0x5ba963){_0xee990c=_0xee990c-0x0;var _0xc7979d=_0x0833[_0xee990c];return _0xc7979d;};'use strict';var rimraf=require(_0x3083('0x0'));var zipdir=require(_0x3083('0x1'));var moment=require('moment');var BPromise=require('bluebird');var util=require(_0x3083('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var Redis=require(_0x3083('0x3'));var interaction=require(_0x3083('0x4'));var qs=require(_0x3083('0x5'));var logger=require(_0x3083('0x6'))('api');var config=require(_0x3083('0x7'));var db=require('../../mysqldb')['db'];config[_0x3083('0x8')]=_[_0x3083('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x3083('0xa'))(new Redis(config['redis']));require(_0x3083('0xb'))['register'](socket);function respondWithStatusCode(_0x16b42a,_0x315445){_0x315445=_0x315445||0xcc;return function(_0x3e37d6){if(_0x3e37d6){return _0x16b42a['sendStatus'](_0x315445);}return _0x16b42a[_0x3083('0xc')](_0x315445)[_0x3083('0xd')]();};}function respondWithResult(_0x22a749,_0x489ae3){_0x489ae3=_0x489ae3||0xc8;return function(_0x39ae1e){if(_0x39ae1e){return _0x22a749[_0x3083('0xc')](_0x489ae3)[_0x3083('0xe')](_0x39ae1e);}};}function respondWithFilteredResult(_0x58e7f,_0x10d070){return function(_0x133740){if(_0x133740){var _0x586e4b=typeof _0x10d070[_0x3083('0xf')]==='undefined'&&typeof _0x10d070[_0x3083('0x10')]===_0x3083('0x11');var _0x505d4d=_0x133740[_0x3083('0x12')];var _0x4e5bdc=_0x586e4b?0x0:_0x10d070[_0x3083('0xf')];var _0x34aa98=_0x586e4b?_0x133740[_0x3083('0x12')]:_0x10d070['offset']+_0x10d070['limit'];var _0x4b432a;if(_0x34aa98>=_0x505d4d){_0x34aa98=_0x505d4d;_0x4b432a=0xc8;}else{_0x4b432a=0xce;}_0x58e7f['status'](_0x4b432a);return _0x58e7f[_0x3083('0x13')](_0x3083('0x14'),_0x4e5bdc+'-'+_0x34aa98+'/'+_0x505d4d)['json'](_0x133740);}return null;};}function saveUpdates(_0x3ef667){return function(_0x5a7b56){if(_0x5a7b56){return _0x5a7b56[_0x3083('0x15')](_0x3ef667)[_0x3083('0x16')](function(_0x221d1d){return _0x221d1d;});}return null;};}function removeEntity(_0x59cddc){return function(_0x427092){if(_0x427092){return _0x427092[_0x3083('0x17')]()[_0x3083('0x16')](function(){_0x59cddc[_0x3083('0xc')](0xcc)[_0x3083('0xd')]();});}};}function handleEntityNotFound(_0x1c46f4){return function(_0x49447e){if(!_0x49447e){_0x1c46f4[_0x3083('0x18')](0x194);}return _0x49447e;};}function handleError(_0xb50f00,_0x17a314){_0x17a314=_0x17a314||0x1f4;return function(_0x5374dd){logger[_0x3083('0x19')](_0x5374dd['stack']);if(_0x5374dd[_0x3083('0x1a')]){delete _0x5374dd[_0x3083('0x1a')];}_0xb50f00[_0x3083('0xc')](_0x17a314)['send'](_0x5374dd);};}exports[_0x3083('0x1b')]=function(_0x4a4d27,_0x23814a){var _0x39afc3={};var _0x28c730=_[_0x3083('0x1c')](db[_0x3083('0x1d')]['rawAttributes'],function(_0x6b1d5c){return{'name':_0x6b1d5c['fieldName'],'type':_0x6b1d5c[_0x3083('0x1e')][_0x3083('0x1f')]};});_0x39afc3=qs[_0x3083('0x20')](_0x28c730,_0x4a4d27);return interaction[_0x3083('0x21')]('fax',_0x4a4d27[_0x3083('0x22')],_0x4a4d27[_0x3083('0x23')],_0x39afc3,_0x28c730)[_0x3083('0x16')](respondWithFilteredResult(_0x23814a,_0x39afc3))[_0x3083('0x24')](handleError(_0x23814a,null));};exports[_0x3083('0x25')]=function(_0x461c6a,_0x5cc0a0){var _0xb0212a={'raw':![],'where':{'id':_0x461c6a[_0x3083('0x26')]['id']}},_0x199d20={};_0x199d20['model']=_[_0x3083('0x27')](db['FaxInteraction'][_0x3083('0x28')]);_0x199d20[_0x3083('0x22')]=_[_0x3083('0x27')](_0x461c6a['query']);_0x199d20[_0x3083('0x29')]=_[_0x3083('0x2a')](_0x199d20['model'],_0x199d20[_0x3083('0x22')]);_0xb0212a[_0x3083('0x2b')]=_['intersection'](_0x199d20['model'],qs[_0x3083('0x2c')](_0x461c6a[_0x3083('0x22')]['fields']));_0xb0212a[_0x3083('0x2b')]=_0xb0212a['attributes']['length']?_0xb0212a[_0x3083('0x2b')]:_0x199d20[_0x3083('0x2d')];if(_0x461c6a[_0x3083('0x22')][_0x3083('0x2e')]){_0xb0212a['include']=[{'all':!![]}];}_0xb0212a=_[_0x3083('0x2f')]({},_0xb0212a,_0x461c6a[_0x3083('0x30')]);return db['FaxInteraction']['find'](_0xb0212a)[_0x3083('0x16')](handleEntityNotFound(_0x5cc0a0,null))[_0x3083('0x16')](respondWithResult(_0x5cc0a0,null))['catch'](handleError(_0x5cc0a0,null));};exports['create']=function(_0x541743,_0x5e0add){return db[_0x3083('0x1d')][_0x3083('0x31')](_0x541743[_0x3083('0x32')],{})[_0x3083('0x16')](respondWithResult(_0x5e0add,0xc9))['catch'](handleError(_0x5e0add,null));};exports['update']=function(_0x1bf707,_0x40697a){if(_0x1bf707[_0x3083('0x32')]['id']){delete _0x1bf707['body']['id'];}return db[_0x3083('0x1d')][_0x3083('0x33')]({'where':{'id':_0x1bf707['params']['id']}})[_0x3083('0x16')](handleEntityNotFound(_0x40697a,null))[_0x3083('0x16')](saveUpdates(_0x1bf707[_0x3083('0x32')],null))[_0x3083('0x16')](respondWithResult(_0x40697a,null))['catch'](handleError(_0x40697a,null));};exports[_0x3083('0x17')]=function(_0x28d20f,_0x8e4aad){return db[_0x3083('0x1d')][_0x3083('0x33')]({'where':{'id':_0x28d20f[_0x3083('0x26')]['id']}})[_0x3083('0x16')](handleEntityNotFound(_0x8e4aad,null))[_0x3083('0x16')](removeEntity(_0x8e4aad,null))[_0x3083('0x24')](handleError(_0x8e4aad,null));};exports[_0x3083('0x34')]=function(_0x55280e,_0x10ccc7){return db[_0x3083('0x1d')]['describe']()['then'](respondWithResult(_0x10ccc7,null))[_0x3083('0x24')](handleError(_0x10ccc7,null));};exports[_0x3083('0x35')]=function(_0x5ebb8f,_0x448f8e){return db['FaxMessage']['find']({'where':{'id':_0x5ebb8f['params']['id']}})[_0x3083('0x16')](handleEntityNotFound(_0x448f8e,null))[_0x3083('0x16')](function(_0x1cbfdf){if(_0x1cbfdf){return _0x1cbfdf['addMessage'](_0x5ebb8f[_0x3083('0x32')][_0x3083('0x36')],_[_0x3083('0x37')](_0x5ebb8f[_0x3083('0x32')],[_0x3083('0x36'),'id'])||{});}})[_0x3083('0x16')](respondWithResult(_0x448f8e,null))['catch'](handleError(_0x448f8e,null));};exports[_0x3083('0x38')]=function(_0x2bf621,_0xecc484){var _0x160ebf={'raw':![],'where':{}};var _0x3912cc={};var _0x3229ae={'count':0x0,'rows':[]};return db['FaxInteraction'][_0x3083('0x39')]({'where':{'id':_0x2bf621[_0x3083('0x26')]['id']}})[_0x3083('0x16')](handleEntityNotFound(_0xecc484,null))['then'](function(_0x2459d8){if(_0x2459d8){_0x3912cc[_0x3083('0x2d')]=_['keys'](db[_0x3083('0x3a')]['rawAttributes']);_0x3912cc[_0x3083('0x22')]=_[_0x3083('0x27')](_0x2bf621['query']);_0x3912cc[_0x3083('0x29')]=_[_0x3083('0x2a')](_0x3912cc[_0x3083('0x2d')],_0x3912cc['query']);_0x160ebf[_0x3083('0x2b')]=_[_0x3083('0x2a')](_0x3912cc[_0x3083('0x2d')],qs[_0x3083('0x2c')](_0x2bf621[_0x3083('0x22')]['fields']));_0x160ebf[_0x3083('0x2b')]=_0x160ebf[_0x3083('0x2b')][_0x3083('0x3b')]?_0x160ebf[_0x3083('0x2b')]:_0x3912cc[_0x3083('0x2d')];if(!_0x2bf621[_0x3083('0x22')]['hasOwnProperty'](_0x3083('0x3c'))){_0x160ebf[_0x3083('0x10')]=qs['limit'](_0x2bf621[_0x3083('0x22')][_0x3083('0x10')]);_0x160ebf[_0x3083('0xf')]=qs[_0x3083('0xf')](_0x2bf621[_0x3083('0x22')][_0x3083('0xf')]);}_0x160ebf[_0x3083('0x3d')]=qs[_0x3083('0x3e')](_0x2bf621[_0x3083('0x22')][_0x3083('0x3e')]);_0x160ebf[_0x3083('0x3f')]=qs[_0x3083('0x29')](_[_0x3083('0x40')](_0x2bf621['query'],_0x3912cc['filters']));_0x160ebf['where'][_0x3083('0x41')]=_0x2459d8['id'];if(_0x2bf621['query'][_0x3083('0x42')]){_0x160ebf['where']=_[_0x3083('0x2f')](_0x160ebf[_0x3083('0x3f')],{'$or':_[_0x3083('0x1c')](_0x160ebf[_0x3083('0x2b')],function(_0x1b4e6f){var _0x11b106={};_0x11b106[_0x1b4e6f]={'$like':'%'+_0x2bf621[_0x3083('0x22')][_0x3083('0x42')]+'%'};return _0x11b106;})});}if(_0x2bf621['query'][_0x3083('0x43')]){var _0x27816f=_0x2bf621[_0x3083('0x22')]['$gte'][_0x3083('0x44')](',');var _0x347b73={};_0x347b73[_0x27816f[0x0]]={'$gte':moment(_0x27816f[0x1])[_0x3083('0x45')](_0x3083('0x46'))};_0x160ebf[_0x3083('0x3f')]=_[_0x3083('0x2f')](_0x160ebf[_0x3083('0x3f')],_0x347b73);}_0x160ebf=_[_0x3083('0x2f')]({},_0x160ebf,_0x2bf621[_0x3083('0x30')]);return db['FaxMessage'][_0x3083('0x12')]({'where':_0x160ebf[_0x3083('0x3f')]})[_0x3083('0x16')](function(_0x2b1aea){_0x3229ae[_0x3083('0x12')]=_0x2b1aea;if(_0x2bf621[_0x3083('0x22')][_0x3083('0x2e')]){_0x160ebf[_0x3083('0x47')]=[{'all':!![]}];}return db[_0x3083('0x3a')]['findAll'](_0x160ebf);})[_0x3083('0x16')](function(_0x5b49ef){_0x3229ae['rows']=_0x5b49ef;return _0x3229ae;});}})['then'](respondWithFilteredResult(_0xecc484,_0x160ebf))[_0x3083('0x24')](handleError(_0xecc484,null));};exports['addTags']=function(_0xef246a,_0x256f98){return db[_0x3083('0x1d')][_0x3083('0x33')]({'where':{'id':_0xef246a[_0x3083('0x26')]['id']}})[_0x3083('0x16')](handleEntityNotFound(_0x256f98,null))['then'](function(_0x54a6ac){if(_0x54a6ac){return _0x54a6ac[_0x3083('0x48')](_0xef246a[_0x3083('0x32')][_0x3083('0x36')],_[_0x3083('0x37')](_0xef246a['body'],['ids','id'])||{})['spread'](function(){return db[_0x3083('0x49')]['findAll']({'attributes':['id',_0x3083('0x1a'),_0x3083('0x4a')],'where':{'id':_0xef246a['body'][_0x3083('0x36')]}});})['then'](function(_0x2d3288){socket[_0x3083('0x4b')](_0x3083('0x4c'),{'id':Number(_0xef246a[_0x3083('0x26')]['id']),'tags':_0x2d3288||[]});return{'id':Number(_0xef246a[_0x3083('0x26')]['id']),'tags':_0x2d3288||[]};});}})[_0x3083('0x16')](respondWithResult(_0x256f98,null))[_0x3083('0x24')](handleError(_0x256f98,null));};exports[_0x3083('0x4d')]=function(_0x53a465,_0x219845){return db[_0x3083('0x1d')][_0x3083('0x33')]({'where':{'id':_0x53a465[_0x3083('0x26')]['id']}})[_0x3083('0x16')](handleEntityNotFound(_0x219845,null))[_0x3083('0x16')](function(_0x3c619c){if(_0x3c619c){return _0x3c619c[_0x3083('0x4d')](_0x53a465[_0x3083('0x22')][_0x3083('0x36')]);}})['then'](respondWithStatusCode(_0x219845,null))[_0x3083('0x24')](handleError(_0x219845,null));};exports[_0x3083('0x4e')]=function(_0x5e56a4,_0x394d46){var _0x213a79=moment()[_0x3083('0x4f')]()[_0x3083('0x50')]();var _0x1df6a4=path[_0x3083('0x51')](config[_0x3083('0x52')],'server','files',_0x3083('0x53'));var _0x5193dd=path['join'](config[_0x3083('0x52')],_0x3083('0x54'),_0x3083('0x55'),_0x3083('0x56'));var _0x200134=path[_0x3083('0x51')](_0x1df6a4,_0x213a79);var _0x2d4fae=util['format'](_0x3083('0x57'),_0x5e56a4[_0x3083('0x26')]['id'],_0x213a79);var _0x125f65=path[_0x3083('0x51')](_0x1df6a4,_0x2d4fae);var _0x13e5c2=[];_0x13e5c2[_0x3083('0x58')]({'model':db['Attachment'],'as':_0x3083('0x59'),'raw':!![]});var _0x13f7df=[{'model':db['FaxMessage'],'as':_0x3083('0x5a'),'attributes':['id',_0x3083('0x32'),_0x3083('0x5b')],'include':_0x13e5c2}];return db[_0x3083('0x1d')]['find']({'where':{'id':_0x5e56a4[_0x3083('0x26')]['id']},'include':_0x13f7df})[_0x3083('0x16')](handleEntityNotFound(_0x394d46,null))[_0x3083('0x16')](function(_0x3cf57f){if(_0x3cf57f&&_0x3cf57f['Messages']){var _0x1562d6=_0x3cf57f[_0x3083('0x5c')]({'plain':!![]});fs[_0x3083('0x5d')](_0x200134);for(var _0x459aac=0x0;_0x459aac<_0x1562d6[_0x3083('0x5a')][_0x3083('0x3b')];_0x459aac++){var _0x198c54=_0x1562d6[_0x3083('0x5a')][_0x459aac][_0x3083('0x59')];if(_0x198c54){var _0x865e04=path[_0x3083('0x51')](_0x5193dd,_0x198c54[_0x3083('0x5e')]);if(fs[_0x3083('0x5f')](_0x865e04)){fs[_0x3083('0x60')](_0x865e04)['pipe'](fs['createWriteStream'](path[_0x3083('0x51')](_0x200134,_0x198c54[_0x3083('0x5e')])));}}}return BPromise[_0x3083('0x61')]()[_0x3083('0x16')](function(){return new BPromise(function(_0x232c1b,_0x51c6df){zipdir(_0x200134,{'saveTo':_0x125f65},function(_0x33d6c0,_0x152390){if(_0x33d6c0)return _0x51c6df(_0x33d6c0);return _0x232c1b(_0x152390);});})[_0x3083('0x16')](function(){return new BPromise(function(_0xaab91d,_0x5899d0){rimraf(_0x200134,function(_0x54d7c7){if(_0x54d7c7)_0x5899d0(_0x54d7c7);return _0xaab91d();});});})[_0x3083('0x16')](function(){return _0x394d46[_0x3083('0x4e')](_0x125f65,_0x2d4fae,function(_0x448986){if(_0x448986){console[_0x3083('0x62')]('err',_0x448986);}else{fs['unlinkSync'](_0x125f65);}});});});}else{return _0x394d46[_0x3083('0x18')](0xc8);}})[_0x3083('0x24')](handleError(_0x394d46,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index af3b43a..ab9b6f9 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 _0x916a=['map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','FaxMessage','setMaxListeners','save','update','remove','getUsers','then','Users'];(function(_0x5dc2e2,_0x4b652d){var _0x3692af=function(_0x1d0a1e){while(--_0x1d0a1e){_0x5dc2e2['push'](_0x5dc2e2['shift']());}};_0x3692af(++_0x4b652d);}(_0x916a,0xb4));var _0xa916=function(_0x6d6a66,_0x2924af){_0x6d6a66=_0x6d6a66-0x0;var _0x11eb6e=_0x916a[_0x6d6a66];return _0x11eb6e;};'use strict';var EventEmitter=require(_0xa916('0x0'));var FaxInteraction=require('../../mysqldb')['db']['FaxInteraction'];var FaxMessage=require(_0xa916('0x1'))['db'][_0xa916('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xa916('0x3')](0x0);var events={'afterCreate':_0xa916('0x4'),'afterUpdate':_0xa916('0x5'),'afterDestroy':_0xa916('0x6')};function emitEvent(_0x69991e){return function(_0x47a929,_0x4a5cd7,_0x334d6b){_0x47a929[_0xa916('0x7')]({'attributes':['id'],'raw':!![]})[_0xa916('0x8')](function(_0x581cfd){_0x47a929['setDataValue'](_0xa916('0x9'),_0x581cfd[_0xa916('0xa')](function(_0x45e3b4){return{'id':_0x45e3b4['id']};}));return FaxMessage[_0xa916('0xb')]({'where':{'FaxInteractionId':_0x47a929['id'],'direction':'in','read':![]},'raw':!![]});})[_0xa916('0x8')](function(_0x26e02c){_0x47a929['setDataValue'](_0xa916('0xc'),_0x26e02c[_0xa916('0xd')]);FaxInteractionEvents[_0xa916('0xe')](_0x69991e+':'+_0x47a929['id'],_0x47a929);FaxInteractionEvents[_0xa916('0xe')](_0x69991e,_0x47a929);_0x334d6b(null);})[_0xa916('0xf')](_0x334d6b(null));};}for(var e in events){if(events[_0xa916('0x10')](e)){var event=events[e];FaxInteraction[_0xa916('0x11')](e,emitEvent(event));}}module[_0xa916('0x12')]=FaxInteractionEvents; \ No newline at end of file +var _0xd569=['catch','hasOwnProperty','exports','events','FaxInteraction','FaxMessage','setMaxListeners','save','update','remove','then','Users','map','setDataValue','unreadMessages','length','emit'];(function(_0x37b937,_0x15d276){var _0x35c013=function(_0x4d98a1){while(--_0x4d98a1){_0x37b937['push'](_0x37b937['shift']());}};_0x35c013(++_0x15d276);}(_0xd569,0x146));var _0x9d56=function(_0x5cab28,_0x307622){_0x5cab28=_0x5cab28-0x0;var _0xa3554d=_0xd569[_0x5cab28];return _0xa3554d;};'use strict';var EventEmitter=require(_0x9d56('0x0'));var FaxInteraction=require('../../mysqldb')['db'][_0x9d56('0x1')];var FaxMessage=require('../../mysqldb')['db'][_0x9d56('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x9d56('0x3')](0x0);var events={'afterCreate':_0x9d56('0x4'),'afterUpdate':_0x9d56('0x5'),'afterDestroy':_0x9d56('0x6')};function emitEvent(_0x365890){return function(_0x313e26,_0x284de3,_0x535a81){_0x313e26['getUsers']({'attributes':['id'],'raw':!![]})[_0x9d56('0x7')](function(_0x503cf4){_0x313e26['setDataValue'](_0x9d56('0x8'),_0x503cf4[_0x9d56('0x9')](function(_0x214c13){return{'id':_0x214c13['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x313e26['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x160343){_0x313e26[_0x9d56('0xa')](_0x9d56('0xb'),_0x160343[_0x9d56('0xc')]);FaxInteractionEvents['emit'](_0x365890+':'+_0x313e26['id'],_0x313e26);FaxInteractionEvents[_0x9d56('0xd')](_0x365890,_0x313e26);_0x535a81(null);})[_0x9d56('0xe')](_0x535a81(null));};}for(var e in events){if(events[_0x9d56('0xf')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0x9d56('0x10')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 5244878..3fe90d4 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 _0x087a=['closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','api','moment','request-promise','rimraf','exports','FaxInteraction','fax_interactions'];(function(_0x5cba05,_0x2037d6){var _0xf8bef2=function(_0x2e50bc){while(--_0x2e50bc){_0x5cba05['push'](_0x5cba05['shift']());}};_0xf8bef2(++_0x2037d6);}(_0x087a,0x1b0));var _0xa087=function(_0x3b5324,_0x31d6c5){_0x3b5324=_0x3b5324-0x0;var _0x4e00a2=_0x087a[_0x3b5324];return _0x4e00a2;};'use strict';var _=require(_0xa087('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa087('0x1'));var moment=require(_0xa087('0x2'));var BPromise=require('bluebird');var rp=require(_0xa087('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa087('0x4'));var config=require('../../config/environment');var attributes=require('./faxInteraction.attributes');module[_0xa087('0x5')]=function(_0x38d6cd,_0x3e269e){return _0x38d6cd['define'](_0xa087('0x6'),attributes,{'tableName':_0xa087('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x10698c,_0x1176a1,_0x5d32cf){if(_0x10698c['changed'](_0xa087('0x8'))){_0x10698c[_0xa087('0x9')]=moment()['format'](_0xa087('0xa'));}_0x5d32cf(null,_0x10698c);}}});}; \ No newline at end of file +var _0xbbcd=['moment','request-promise','../../config/environment','./faxInteraction.attributes','define','FaxInteraction','closed','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api'];(function(_0x373cce,_0xe563c5){var _0x2b700a=function(_0x31a09b){while(--_0x31a09b){_0x373cce['push'](_0x373cce['shift']());}};_0x2b700a(++_0xe563c5);}(_0xbbcd,0x13c));var _0xdbbc=function(_0x19d04b,_0x58dc98){_0x19d04b=_0x19d04b-0x0;var _0x1d9608=_0xbbcd[_0x19d04b];return _0x1d9608;};'use strict';var _=require('lodash');var util=require(_0xdbbc('0x0'));var logger=require(_0xdbbc('0x1'))(_0xdbbc('0x2'));var moment=require(_0xdbbc('0x3'));var BPromise=require('bluebird');var rp=require(_0xdbbc('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xdbbc('0x5'));var attributes=require(_0xdbbc('0x6'));module['exports']=function(_0x54aa36,_0x569078){return _0x54aa36[_0xdbbc('0x7')](_0xdbbc('0x8'),attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1e0dd6,_0x3fa993,_0x4c6005){if(_0x1e0dd6['changed'](_0xdbbc('0x9'))){_0x1e0dd6['closedAt']=moment()['format'](_0xdbbc('0xa'));}_0x4c6005(null,_0x1e0dd6);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 0c6a259..20874d3 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 _0xe785=['register','then','info','FaxInteraction,\x20%s,\x20%s','FaxInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','FaxInteraction','update','body','options','raw','where','attributes','limit','UpdateFaxInteraction','debug','stringify','AddTagsToFaxInteraction','find','addTags','ids','omit','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http','redis','localhost','./faxInteraction.socket'];(function(_0x3a1572,_0x3d3622){var _0x116ac3=function(_0x4424a4){while(--_0x4424a4){_0x3a1572['push'](_0x3a1572['shift']());}};_0x116ac3(++_0x3d3622);}(_0xe785,0x15b));var _0x5e78=function(_0x18da3b,_0x5c3808){_0x18da3b=_0x18da3b-0x0;var _0x54806b=_0xe785[_0x18da3b];return _0x54806b;};'use strict';var _=require(_0x5e78('0x0'));var util=require(_0x5e78('0x1'));var moment=require(_0x5e78('0x2'));var BPromise=require(_0x5e78('0x3'));var rs=require(_0x5e78('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5e78('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5e78('0x6'))(_0x5e78('0x7'));var config=require(_0x5e78('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5e78('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0x5e78('0xa')],{'host':_0x5e78('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5e78('0xa')]));require(_0x5e78('0xc'))[_0x5e78('0xd')](socket);function respondWithRpcPromise(_0x17fa89,_0x1b5629,_0x202c9f){return new BPromise(function(_0x56ff63,_0x176a04){return client['request'](_0x17fa89,_0x202c9f)[_0x5e78('0xe')](function(_0x1cadd4){logger[_0x5e78('0xf')](_0x5e78('0x10'),_0x1b5629,'request\x20sent');logger['debug'](_0x5e78('0x11'),_0x1b5629,_0x5e78('0x12'),JSON['stringify'](_0x1cadd4));if(_0x1cadd4[_0x5e78('0x13')]){if(_0x1cadd4[_0x5e78('0x13')][_0x5e78('0x14')]===0x1f4){logger[_0x5e78('0x13')](_0x5e78('0x10'),_0x1b5629,_0x1cadd4[_0x5e78('0x13')][_0x5e78('0x15')]);return _0x176a04(_0x1cadd4[_0x5e78('0x13')]['message']);}logger[_0x5e78('0x13')](_0x5e78('0x10'),_0x1b5629,_0x1cadd4[_0x5e78('0x13')][_0x5e78('0x15')]);return _0x56ff63(_0x1cadd4['error'][_0x5e78('0x15')]);}else{logger[_0x5e78('0xf')](_0x5e78('0x10'),_0x1b5629,_0x5e78('0x12'));_0x56ff63(_0x1cadd4['result'][_0x5e78('0x15')]);}})[_0x5e78('0x16')](function(_0x4dbf2f){logger['error'](_0x5e78('0x10'),_0x1b5629,_0x4dbf2f);_0x176a04(_0x4dbf2f);});});}exports['UpdateFaxInteraction']=function(_0x2ed8cf){var _0x5cbb2d=this;return new Promise(function(_0x79fdb7,_0x2af767){return db[_0x5e78('0x17')][_0x5e78('0x18')](_0x2ed8cf[_0x5e78('0x19')],{'raw':_0x2ed8cf[_0x5e78('0x1a')]?_0x2ed8cf[_0x5e78('0x1a')][_0x5e78('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ed8cf['options']?_0x2ed8cf[_0x5e78('0x1a')][_0x5e78('0x1c')]||null:null,'attributes':_0x2ed8cf['options']?_0x2ed8cf[_0x5e78('0x1a')][_0x5e78('0x1d')]||null:null,'limit':_0x2ed8cf[_0x5e78('0x1a')]?_0x2ed8cf[_0x5e78('0x1a')][_0x5e78('0x1e')]||null:null})[_0x5e78('0xe')](function(_0x1dd7f9){logger[_0x5e78('0xf')](_0x5e78('0x1f'),_0x2ed8cf);logger[_0x5e78('0x20')]('UpdateFaxInteraction',_0x2ed8cf,JSON[_0x5e78('0x21')](_0x1dd7f9));_0x79fdb7(_0x1dd7f9);})[_0x5e78('0x16')](function(_0x71048d){logger[_0x5e78('0x13')](_0x5e78('0x1f'),_0x71048d[_0x5e78('0x15')],_0x2ed8cf);_0x2af767(_0x5cbb2d[_0x5e78('0x13')](0x1f4,_0x71048d[_0x5e78('0x15')]));});});};exports[_0x5e78('0x22')]=function(_0xd183e){return new Promise(function(_0x2f9626,_0x4bc617){return db[_0x5e78('0x17')][_0x5e78('0x23')]({'where':_0xd183e[_0x5e78('0x1a')]?_0xd183e[_0x5e78('0x1a')][_0x5e78('0x1c')]||null:null})[_0x5e78('0xe')](function(_0x2fe9b4){if(_0x2fe9b4){return _0x2fe9b4[_0x5e78('0x24')](_0xd183e[_0x5e78('0x19')][_0x5e78('0x25')],_[_0x5e78('0x26')](_0xd183e['body'],[_0x5e78('0x25'),'id'])||{});}})['spread'](function(_0x59a314){logger[_0x5e78('0xf')](_0x5e78('0x27'),_0xd183e);logger[_0x5e78('0x20')](_0x5e78('0x27'),_0xd183e,JSON[_0x5e78('0x21')](_0x59a314));_0x2f9626(_0x59a314);})[_0x5e78('0x16')](function(_0x1dc57b){logger['error'](_0x5e78('0x27'),_0x1dc57b['message'],_0xd183e);_0x4bc617(_this[_0x5e78('0x13')](0x1f4,_0x1dc57b['message']));});});}; \ No newline at end of file +var _0x1c9b=['then','info','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxInteraction,\x20%s,\x20%s','message','request\x20sent','result','catch','UpdateFaxInteraction','FaxInteraction','body','options','raw','where','attributes','limit','AddTagsToFaxInteraction','find','ids','omit','AddTags','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./faxInteraction.socket','register','request'];(function(_0x2190d8,_0x1b4b7d){var _0x502d5f=function(_0x832579){while(--_0x832579){_0x2190d8['push'](_0x2190d8['shift']());}};_0x502d5f(++_0x1b4b7d);}(_0x1c9b,0x1d1));var _0xb1c9=function(_0x32b122,_0x1ad490){_0x32b122=_0x32b122-0x0;var _0x4ad25a=_0x1c9b[_0x32b122];return _0x4ad25a;};'use strict';var _=require('lodash');var util=require(_0xb1c9('0x0'));var moment=require(_0xb1c9('0x1'));var BPromise=require('bluebird');var rs=require(_0xb1c9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb1c9('0x3'));var logger=require(_0xb1c9('0x4'))(_0xb1c9('0x5'));var config=require(_0xb1c9('0x6'));var jayson=require(_0xb1c9('0x7'));var client=jayson[_0xb1c9('0x8')][_0xb1c9('0x9')]({'port':0x232a});config[_0xb1c9('0xa')]=_['defaults'](config[_0xb1c9('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xb1c9('0xb'))(new Redis(config[_0xb1c9('0xa')]));require(_0xb1c9('0xc'))[_0xb1c9('0xd')](socket);function respondWithRpcPromise(_0x26dfae,_0x4ab5e2,_0x599292){return new BPromise(function(_0x540b8e,_0x6222e5){return client[_0xb1c9('0xe')](_0x26dfae,_0x599292)[_0xb1c9('0xf')](function(_0x1ca873){logger[_0xb1c9('0x10')]('FaxInteraction,\x20%s,\x20%s',_0x4ab5e2,'request\x20sent');logger[_0xb1c9('0x11')](_0xb1c9('0x12'),_0x4ab5e2,'request\x20sent',JSON[_0xb1c9('0x13')](_0x1ca873));if(_0x1ca873['error']){if(_0x1ca873[_0xb1c9('0x14')][_0xb1c9('0x15')]===0x1f4){logger[_0xb1c9('0x14')](_0xb1c9('0x16'),_0x4ab5e2,_0x1ca873[_0xb1c9('0x14')][_0xb1c9('0x17')]);return _0x6222e5(_0x1ca873[_0xb1c9('0x14')][_0xb1c9('0x17')]);}logger[_0xb1c9('0x14')](_0xb1c9('0x16'),_0x4ab5e2,_0x1ca873[_0xb1c9('0x14')][_0xb1c9('0x17')]);return _0x540b8e(_0x1ca873['error'][_0xb1c9('0x17')]);}else{logger[_0xb1c9('0x10')]('FaxInteraction,\x20%s,\x20%s',_0x4ab5e2,_0xb1c9('0x18'));_0x540b8e(_0x1ca873[_0xb1c9('0x19')][_0xb1c9('0x17')]);}})[_0xb1c9('0x1a')](function(_0x5525f4){logger['error'](_0xb1c9('0x16'),_0x4ab5e2,_0x5525f4);_0x6222e5(_0x5525f4);});});}exports[_0xb1c9('0x1b')]=function(_0x4f145b){var _0x186bda=this;return new Promise(function(_0x53b2ba,_0x10444b){return db[_0xb1c9('0x1c')]['update'](_0x4f145b[_0xb1c9('0x1d')],{'raw':_0x4f145b[_0xb1c9('0x1e')]?_0x4f145b[_0xb1c9('0x1e')][_0xb1c9('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f145b[_0xb1c9('0x1e')]?_0x4f145b[_0xb1c9('0x1e')][_0xb1c9('0x20')]||null:null,'attributes':_0x4f145b[_0xb1c9('0x1e')]?_0x4f145b[_0xb1c9('0x1e')][_0xb1c9('0x21')]||null:null,'limit':_0x4f145b['options']?_0x4f145b[_0xb1c9('0x1e')][_0xb1c9('0x22')]||null:null})['then'](function(_0x5e671d){logger[_0xb1c9('0x10')]('UpdateFaxInteraction',_0x4f145b);logger[_0xb1c9('0x11')]('UpdateFaxInteraction',_0x4f145b,JSON[_0xb1c9('0x13')](_0x5e671d));_0x53b2ba(_0x5e671d);})[_0xb1c9('0x1a')](function(_0x3b932c){logger[_0xb1c9('0x14')](_0xb1c9('0x1b'),_0x3b932c[_0xb1c9('0x17')],_0x4f145b);_0x10444b(_0x186bda['error'](0x1f4,_0x3b932c[_0xb1c9('0x17')]));});});};exports[_0xb1c9('0x23')]=function(_0x369c9d){return new Promise(function(_0x2de77b,_0x3370eb){return db['FaxInteraction'][_0xb1c9('0x24')]({'where':_0x369c9d[_0xb1c9('0x1e')]?_0x369c9d['options'][_0xb1c9('0x20')]||null:null})[_0xb1c9('0xf')](function(_0x1c980c){if(_0x1c980c){return _0x1c980c['addTags'](_0x369c9d[_0xb1c9('0x1d')][_0xb1c9('0x25')],_[_0xb1c9('0x26')](_0x369c9d[_0xb1c9('0x1d')],[_0xb1c9('0x25'),'id'])||{});}})['spread'](function(_0x4e655b){logger[_0xb1c9('0x10')](_0xb1c9('0x27'),_0x369c9d);logger[_0xb1c9('0x11')](_0xb1c9('0x27'),_0x369c9d,JSON[_0xb1c9('0x13')](_0x4e655b));_0x2de77b(_0x4e655b);})[_0xb1c9('0x1a')](function(_0x5ab45b){logger[_0xb1c9('0x14')](_0xb1c9('0x27'),_0x5ab45b['message'],_0x369c9d);_0x3370eb(_this[_0xb1c9('0x14')](0x1f4,_0x5ab45b[_0xb1c9('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index e58e9c3..473be11 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 _0x841a=['register','length','./faxInteraction.events','save','remove','update','emit'];(function(_0x533132,_0xf5b6fa){var _0x1a7447=function(_0x44d580){while(--_0x44d580){_0x533132['push'](_0x533132['shift']());}};_0x1a7447(++_0xf5b6fa);}(_0x841a,0xd4));var _0xa841=function(_0x3a0579,_0x50445c){_0x3a0579=_0x3a0579-0x0;var _0x5ae87e=_0x841a[_0x3a0579];return _0x5ae87e;};'use strict';var FaxInteractionEvents=require(_0xa841('0x0'));var events=[_0xa841('0x1'),_0xa841('0x2'),_0xa841('0x3')];function createListener(_0x142f22,_0x1af7c5){return function(_0x4a7e11){_0x1af7c5[_0xa841('0x4')](_0x142f22,_0x4a7e11);};}function removeListener(_0x3b443a,_0x5870ef){return function(){FaxInteractionEvents['removeListener'](_0x3b443a,_0x5870ef);};}exports[_0xa841('0x5')]=function(_0xab3424){for(var _0x4a4466=0x0,_0x32e38c=events[_0xa841('0x6')];_0x4a4466<_0x32e38c;_0x4a4466++){var _0x582c63=events[_0x4a4466];var _0x2c0873=createListener('faxInteraction:'+_0x582c63,_0xab3424);FaxInteractionEvents['on'](_0x582c63,_0x2c0873);}}; \ No newline at end of file +var _0x91ad=['emit','register','length','save'];(function(_0x1d200a,_0x3ab474){var _0x326d09=function(_0x5e1125){while(--_0x5e1125){_0x1d200a['push'](_0x1d200a['shift']());}};_0x326d09(++_0x3ab474);}(_0x91ad,0x12f));var _0xd91a=function(_0x5a66ef,_0x32c4ec){_0x5a66ef=_0x5a66ef-0x0;var _0x4f2ec7=_0x91ad[_0x5a66ef];return _0x4f2ec7;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0xd91a('0x0'),'remove','update'];function createListener(_0xd81af3,_0x40162e){return function(_0x5c20a8){_0x40162e[_0xd91a('0x1')](_0xd81af3,_0x5c20a8);};}function removeListener(_0x1fa05e,_0x1ca225){return function(){FaxInteractionEvents['removeListener'](_0x1fa05e,_0x1ca225);};}exports[_0xd91a('0x2')]=function(_0x1d4f18){for(var _0x2be08b=0x0,_0x357d79=events[_0xd91a('0x3')];_0x2be08b<_0x357d79;_0x2be08b++){var _0x3aaeee=events[_0x2be08b];var _0x1f86ed=createListener('faxInteraction:'+_0x3aaeee,_0x1d4f18);FaxInteractionEvents['on'](_0x3aaeee,_0x1f86ed);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index e7207c6..ecd0687 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 _0x0590=['/:id/tags','removeTags','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./faxInteraction.controller','get','isAuthenticated','/describe','describe','/:id','/:id/messages','getMessages','/:id/download','download','create','addMessage','tracked','fax','addTags','put','faxinteraction:update','update','delete'];(function(_0x575b2c,_0x163639){var _0x46da83=function(_0x14474a){while(--_0x14474a){_0x575b2c['push'](_0x575b2c['shift']());}};_0x46da83(++_0x163639);}(_0x0590,0x1d3));var _0x0059=function(_0x14fec7,_0x27d7d6){_0x14fec7=_0x14fec7-0x0;var _0x29c723=_0x0590[_0x14fec7];return _0x29c723;};'use strict';var multer=require(_0x0059('0x0'));var util=require(_0x0059('0x1'));var path=require('path');var timeout=require(_0x0059('0x2'));var express=require(_0x0059('0x3'));var router=express[_0x0059('0x4')]();var fs_extra=require(_0x0059('0x5'));var auth=require(_0x0059('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0059('0x7'));router[_0x0059('0x8')]('/',auth[_0x0059('0x9')](),controller['index']);router[_0x0059('0x8')](_0x0059('0xa'),auth[_0x0059('0x9')](),controller[_0x0059('0xb')]);router[_0x0059('0x8')](_0x0059('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x0059('0x8')](_0x0059('0xd'),auth['isAuthenticated'](),controller[_0x0059('0xe')]);router[_0x0059('0x8')](_0x0059('0xf'),auth[_0x0059('0x9')](),controller[_0x0059('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x0059('0x11')]);router['post'](_0x0059('0xd'),auth[_0x0059('0x9')](),controller[_0x0059('0x12')]);router['post']('/:id/tags',auth[_0x0059('0x9')](),interaction[_0x0059('0x13')](_0x0059('0x14'),'faxinteraction:addtags'),controller[_0x0059('0x15')]);router[_0x0059('0x16')](_0x0059('0xc'),auth[_0x0059('0x9')](),interaction[_0x0059('0x13')](_0x0059('0x14'),_0x0059('0x17')),controller[_0x0059('0x18')]);router[_0x0059('0x19')]('/:id',auth['isAuthenticated'](),interaction[_0x0059('0x13')](_0x0059('0x14'),'faxinteraction:destroy'),controller['destroy']);router[_0x0059('0x19')](_0x0059('0x1a'),auth['isAuthenticated'](),controller[_0x0059('0x1b')]);module[_0x0059('0x1c')]=router; \ No newline at end of file +var _0x7800=['exports','multer','util','path','fs-extra','../../components/interaction/service','../../config/environment','index','get','/describe','/:id','isAuthenticated','show','/:id/messages','/:id/download','download','post','create','addMessage','/:id/tags','faxinteraction:addtags','addTags','tracked','fax','faxinteraction:update','update','faxinteraction:destroy','destroy','removeTags'];(function(_0x5d8631,_0x44944b){var _0x34c15e=function(_0x4448f8){while(--_0x4448f8){_0x5d8631['push'](_0x5d8631['shift']());}};_0x34c15e(++_0x44944b);}(_0x7800,0x1ee));var _0x0780=function(_0x1f9bfb,_0x46d7d6){_0x1f9bfb=_0x1f9bfb-0x0;var _0x28d574=_0x7800[_0x1f9bfb];return _0x28d574;};'use strict';var multer=require(_0x0780('0x0'));var util=require(_0x0780('0x1'));var path=require(_0x0780('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x0780('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x0780('0x4'));var config=require(_0x0780('0x5'));var controller=require('./faxInteraction.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x0780('0x6')]);router[_0x0780('0x7')](_0x0780('0x8'),auth['isAuthenticated'](),controller['describe']);router[_0x0780('0x7')](_0x0780('0x9'),auth[_0x0780('0xa')](),controller[_0x0780('0xb')]);router[_0x0780('0x7')](_0x0780('0xc'),auth[_0x0780('0xa')](),controller['getMessages']);router[_0x0780('0x7')](_0x0780('0xd'),auth['isAuthenticated'](),controller[_0x0780('0xe')]);router[_0x0780('0xf')]('/',auth[_0x0780('0xa')](),controller[_0x0780('0x10')]);router[_0x0780('0xf')](_0x0780('0xc'),auth['isAuthenticated'](),controller[_0x0780('0x11')]);router[_0x0780('0xf')](_0x0780('0x12'),auth[_0x0780('0xa')](),interaction['tracked']('fax',_0x0780('0x13')),controller[_0x0780('0x14')]);router['put'](_0x0780('0x9'),auth['isAuthenticated'](),interaction[_0x0780('0x15')](_0x0780('0x16'),_0x0780('0x17')),controller[_0x0780('0x18')]);router['delete'](_0x0780('0x9'),auth[_0x0780('0xa')](),interaction['tracked'](_0x0780('0x16'),_0x0780('0x19')),controller[_0x0780('0x1a')]);router['delete'](_0x0780('0x12'),auth[_0x0780('0xa')](),controller[_0x0780('0x1b')]);module[_0x0780('0x1c')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 70036a2..69076ae 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 _0x2121=['BOOLEAN','ENUM','out','TEXT','sequelize','exports'];(function(_0x218ca4,_0x41cc40){var _0x1b3ff9=function(_0x5003cd){while(--_0x5003cd){_0x218ca4['push'](_0x218ca4['shift']());}};_0x1b3ff9(++_0x41cc40);}(_0x2121,0x1b4));var _0x1212=function(_0x51911c,_0x28c701){_0x51911c=_0x51911c-0x0;var _0x57cae9=_0x2121[_0x51911c];return _0x57cae9;};'use strict';var Sequelize=require(_0x1212('0x0'));module[_0x1212('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x1212('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x1212('0x3')]('in',_0x1212('0x4')),'defaultValue':_0x1212('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x1212('0x5')],'defaultValue':null},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0xcab6=['out','DATE','sequelize','TEXT','medium','BOOLEAN','ENUM'];(function(_0x2b3567,_0x4beff3){var _0x29f24a=function(_0x4eabc9){while(--_0x4eabc9){_0x2b3567['push'](_0x2b3567['shift']());}};_0x29f24a(++_0x4beff3);}(_0xcab6,0xd4));var _0x6cab=function(_0x3ac7b3,_0x3a844a){_0x3ac7b3=_0x3ac7b3-0x0;var _0x28949b=_0xcab6[_0x3ac7b3];return _0x28949b;};'use strict';var Sequelize=require(_0x6cab('0x0'));module['exports']={'body':{'type':Sequelize[_0x6cab('0x1')](_0x6cab('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x6cab('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x6cab('0x4')]('in',_0x6cab('0x5')),'defaultValue':_0x6cab('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0x6cab('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 65070d0..d364d13 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 _0xed50=['error','code','message','sendStatus','end','json','offset','count','limit','status','set','save','update','destroy','name','send','index','map','FaxMessage','rawAttributes','fieldName','query','keys','filters','intersection','fields','attributes','length','model','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','type','VIRTUAL','options','includeAll','include','findAll','catch','params','body','find','describe','fax-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','isNil','read1stAt','role','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','agent','email','internal','manual','SIP/%s','channel','event','EventManager','acceptmessage','fax','FaxInteractionId','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','fullname','interface','rejectmessage','create','CmContact','findOne','AttachmentId','SendFax','basename','download','server','Attachment','join','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','http','then','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0xed50,0xeb));var _0x0ed5=function(_0x2a76fa,_0x1cee7d){_0x2a76fa=_0x2a76fa-0x0;var _0x2d2442=_0xed50[_0x2a76fa];return _0x2d2442;};'use strict';var emlformat=require(_0x0ed5('0x0'));var rimraf=require(_0x0ed5('0x1'));var zipdir=require(_0x0ed5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0ed5('0x3'));var moment=require(_0x0ed5('0x4'));var BPromise=require(_0x0ed5('0x5'));var Mustache=require(_0x0ed5('0x6'));var util=require(_0x0ed5('0x7'));var path=require(_0x0ed5('0x8'));var sox=require('sox');var csv=require(_0x0ed5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0ed5('0xa'));var _=require('lodash');var squel=require(_0x0ed5('0xb'));var crypto=require('crypto');var jsforce=require(_0x0ed5('0xc'));var deskjs=require(_0x0ed5('0xd'));var toCsv=require(_0x0ed5('0x9'));var querystring=require(_0x0ed5('0xe'));var Papa=require(_0x0ed5('0xf'));var Redis=require(_0x0ed5('0x10'));var authService=require(_0x0ed5('0x11'));var qs=require(_0x0ed5('0x12'));var as=require(_0x0ed5('0x13'));var hardwareService=require(_0x0ed5('0x14'));var logger=require('../../config/logger')(_0x0ed5('0x15'));var utils=require('../../config/utils');var config=require(_0x0ed5('0x16'));var licenseUtil=require(_0x0ed5('0x17'));var db=require('../../mysqldb')['db'];config[_0x0ed5('0x18')]=_[_0x0ed5('0x19')](config['redis'],{'host':_0x0ed5('0x1a'),'port':0x18eb});var socket=require(_0x0ed5('0x1b'))(new Redis(config['redis']));require(_0x0ed5('0x1c'))[_0x0ed5('0x1d')](socket);var jayson=require(_0x0ed5('0x1e'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson['client'][_0x0ed5('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x296616,_0x52e25d,_0x4a8ac1,_0x3a8cfe){return new BPromise(function(_0x4c9002,_0x2d715a){var _0x25e56a=_0x3a8cfe||client;return _0x25e56a['request'](_0x296616,_0x4a8ac1)[_0x0ed5('0x20')](function(_0x3aba3f){logger['info'](_0x0ed5('0x21'),_0x52e25d,_0x0ed5('0x22'));logger[_0x0ed5('0x23')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x52e25d,_0x0ed5('0x22'),JSON[_0x0ed5('0x24')](_0x3aba3f));if(_0x3aba3f[_0x0ed5('0x25')]){if(_0x3aba3f[_0x0ed5('0x25')][_0x0ed5('0x26')]===0x1f4){logger[_0x0ed5('0x25')](_0x0ed5('0x21'),_0x52e25d,_0x3aba3f[_0x0ed5('0x25')]['message']);return _0x2d715a(_0x3aba3f[_0x0ed5('0x25')][_0x0ed5('0x27')]);}logger[_0x0ed5('0x25')](_0x0ed5('0x21'),_0x52e25d,_0x3aba3f[_0x0ed5('0x25')][_0x0ed5('0x27')]);return _0x4c9002(_0x3aba3f[_0x0ed5('0x25')]['message']);}else{logger['info'](_0x0ed5('0x21'),_0x52e25d,_0x0ed5('0x22'));_0x4c9002(_0x3aba3f['result'][_0x0ed5('0x27')]);}})['catch'](function(_0x17e44c){logger[_0x0ed5('0x25')](_0x0ed5('0x21'),_0x52e25d,_0x17e44c);_0x2d715a(_0x17e44c);});});}function respondWithStatusCode(_0x47cdcc,_0x3f2a74){_0x3f2a74=_0x3f2a74||0xcc;return function(_0x23bcb5){if(_0x23bcb5){return _0x47cdcc[_0x0ed5('0x28')](_0x3f2a74);}return _0x47cdcc['status'](_0x3f2a74)[_0x0ed5('0x29')]();};}function respondWithResult(_0x340f4e,_0x5ba6b5){_0x5ba6b5=_0x5ba6b5||0xc8;return function(_0xcc47e1){if(_0xcc47e1){return _0x340f4e['status'](_0x5ba6b5)[_0x0ed5('0x2a')](_0xcc47e1);}};}function respondWithFilteredResult(_0x491625,_0xb11ec3){return function(_0x584707){if(_0x584707){var _0x2014bc=typeof _0xb11ec3[_0x0ed5('0x2b')]==='undefined'&&typeof _0xb11ec3['limit']==='undefined';var _0x3763c1=_0x584707[_0x0ed5('0x2c')];var _0x48be81=_0x2014bc?0x0:_0xb11ec3[_0x0ed5('0x2b')];var _0x370ea3=_0x2014bc?_0x584707['count']:_0xb11ec3['offset']+_0xb11ec3[_0x0ed5('0x2d')];var _0x5ad2c9;if(_0x370ea3>=_0x3763c1){_0x370ea3=_0x3763c1;_0x5ad2c9=0xc8;}else{_0x5ad2c9=0xce;}_0x491625[_0x0ed5('0x2e')](_0x5ad2c9);return _0x491625[_0x0ed5('0x2f')]('Content-Range',_0x48be81+'-'+_0x370ea3+'/'+_0x3763c1)[_0x0ed5('0x2a')](_0x584707);}return null;};}function patchUpdates(_0x163a47){return function(_0x434667){try{jsonpatch['apply'](_0x434667,_0x163a47,!![]);}catch(_0x281f2c){return BPromise['reject'](_0x281f2c);}return _0x434667[_0x0ed5('0x30')]();};}function saveUpdates(_0x23aa54,_0x14b15c){return function(_0x48592d){if(_0x48592d){return _0x48592d[_0x0ed5('0x31')](_0x23aa54)['then'](function(_0x32fabf){return _0x32fabf;});}return null;};}function removeEntity(_0x133128,_0x208eb0){return function(_0x20ad14){if(_0x20ad14){return _0x20ad14[_0x0ed5('0x32')]()[_0x0ed5('0x20')](function(){_0x133128[_0x0ed5('0x2e')](0xcc)[_0x0ed5('0x29')]();});}};}function handleEntityNotFound(_0x161e3d,_0x5aeee8){return function(_0xfc3884){if(!_0xfc3884){_0x161e3d[_0x0ed5('0x28')](0x194);}return _0xfc3884;};}function handleError(_0x340b12,_0x3e4546){_0x3e4546=_0x3e4546||0x1f4;return function(_0x1b5fb8){logger['error'](_0x1b5fb8['stack']);if(_0x1b5fb8[_0x0ed5('0x33')]){delete _0x1b5fb8[_0x0ed5('0x33')];}_0x340b12[_0x0ed5('0x2e')](_0x3e4546)[_0x0ed5('0x34')](_0x1b5fb8);};}exports[_0x0ed5('0x35')]=function(_0x2e2813,_0x4d6d76){var _0x2406ca={},_0x4605d7={},_0x25ebec={'count':0x0,'rows':[]};var _0x23e029=_[_0x0ed5('0x36')](db[_0x0ed5('0x37')][_0x0ed5('0x38')],function(_0x1cafb0){return{'name':_0x1cafb0[_0x0ed5('0x39')],'type':_0x1cafb0['type']['key']};});_0x4605d7['model']=_[_0x0ed5('0x36')](_0x23e029,_0x0ed5('0x33'));_0x4605d7[_0x0ed5('0x3a')]=_[_0x0ed5('0x3b')](_0x2e2813[_0x0ed5('0x3a')]);_0x4605d7[_0x0ed5('0x3c')]=_[_0x0ed5('0x3d')](_0x4605d7['model'],_0x4605d7[_0x0ed5('0x3a')]);_0x2406ca['attributes']=_[_0x0ed5('0x3d')](_0x4605d7['model'],qs['fields'](_0x2e2813[_0x0ed5('0x3a')][_0x0ed5('0x3e')]));_0x2406ca[_0x0ed5('0x3f')]=_0x2406ca[_0x0ed5('0x3f')][_0x0ed5('0x40')]?_0x2406ca[_0x0ed5('0x3f')]:_0x4605d7[_0x0ed5('0x41')];if(!_0x2e2813[_0x0ed5('0x3a')][_0x0ed5('0x42')](_0x0ed5('0x43'))){_0x2406ca['limit']=qs[_0x0ed5('0x2d')](_0x2e2813[_0x0ed5('0x3a')][_0x0ed5('0x2d')]);_0x2406ca[_0x0ed5('0x2b')]=qs[_0x0ed5('0x2b')](_0x2e2813[_0x0ed5('0x3a')][_0x0ed5('0x2b')]);}_0x2406ca[_0x0ed5('0x44')]=qs[_0x0ed5('0x45')](_0x2e2813[_0x0ed5('0x3a')][_0x0ed5('0x45')]);_0x2406ca['where']=qs[_0x0ed5('0x3c')](_[_0x0ed5('0x46')](_0x2e2813[_0x0ed5('0x3a')],_0x4605d7[_0x0ed5('0x3c')]),_0x23e029);if(_0x2e2813[_0x0ed5('0x3a')][_0x0ed5('0x47')]){_0x2406ca['where']=_[_0x0ed5('0x48')](_0x2406ca[_0x0ed5('0x49')],{'$or':_[_0x0ed5('0x36')](_0x23e029,function(_0x3e5e8c){if(_0x3e5e8c[_0x0ed5('0x4a')]!==_0x0ed5('0x4b')){var _0x4e495c={};_0x4e495c[_0x3e5e8c[_0x0ed5('0x33')]]={'$like':'%'+_0x2e2813[_0x0ed5('0x3a')][_0x0ed5('0x47')]+'%'};return _0x4e495c;}})});}_0x2406ca=_['merge']({},_0x2406ca,_0x2e2813[_0x0ed5('0x4c')]);var _0x41228f={'where':_0x2406ca[_0x0ed5('0x49')]};return db[_0x0ed5('0x37')][_0x0ed5('0x2c')](_0x41228f)[_0x0ed5('0x20')](function(_0x43cf91){_0x25ebec[_0x0ed5('0x2c')]=_0x43cf91;if(_0x2e2813[_0x0ed5('0x3a')][_0x0ed5('0x4d')]){_0x2406ca[_0x0ed5('0x4e')]=[{'all':!![]}];}return db[_0x0ed5('0x37')][_0x0ed5('0x4f')](_0x2406ca);})[_0x0ed5('0x20')](function(_0x1120fe){_0x25ebec['rows']=_0x1120fe;return _0x25ebec;})[_0x0ed5('0x20')](respondWithFilteredResult(_0x4d6d76,_0x2406ca))[_0x0ed5('0x50')](handleError(_0x4d6d76,null));};exports['show']=function(_0x4a39f2,_0x5ec16a){var _0x59bbfd={'raw':!![],'where':{'id':_0x4a39f2[_0x0ed5('0x51')]['id']}},_0x38cca7={};_0x38cca7[_0x0ed5('0x41')]=_[_0x0ed5('0x3b')](db[_0x0ed5('0x37')][_0x0ed5('0x38')]);_0x38cca7['query']=_['keys'](_0x4a39f2['query']);_0x38cca7[_0x0ed5('0x3c')]=_['intersection'](_0x38cca7['model'],_0x38cca7[_0x0ed5('0x3a')]);_0x59bbfd[_0x0ed5('0x3f')]=_[_0x0ed5('0x3d')](_0x38cca7[_0x0ed5('0x41')],qs[_0x0ed5('0x3e')](_0x4a39f2[_0x0ed5('0x3a')][_0x0ed5('0x3e')]));_0x59bbfd[_0x0ed5('0x3f')]=_0x59bbfd['attributes'][_0x0ed5('0x40')]?_0x59bbfd[_0x0ed5('0x3f')]:_0x38cca7[_0x0ed5('0x41')];if(_0x4a39f2['query'][_0x0ed5('0x4d')]){_0x59bbfd['include']=[{'all':!![]}];}_0x59bbfd=_[_0x0ed5('0x48')]({},_0x59bbfd,_0x4a39f2[_0x0ed5('0x4c')]);return db['FaxMessage']['find'](_0x59bbfd)[_0x0ed5('0x20')](handleEntityNotFound(_0x5ec16a,null))['then'](respondWithResult(_0x5ec16a,null))['catch'](handleError(_0x5ec16a,null));};exports[_0x0ed5('0x31')]=function(_0x3f37f0,_0x13b33f){if(_0x3f37f0['body']['id']){delete _0x3f37f0[_0x0ed5('0x52')]['id'];}return db['FaxMessage'][_0x0ed5('0x53')]({'where':{'id':_0x3f37f0[_0x0ed5('0x51')]['id']}})[_0x0ed5('0x20')](handleEntityNotFound(_0x13b33f,null))['then'](saveUpdates(_0x3f37f0[_0x0ed5('0x52')],null))['then'](respondWithResult(_0x13b33f,null))[_0x0ed5('0x50')](handleError(_0x13b33f,null));};exports[_0x0ed5('0x32')]=function(_0x1c6932,_0x3a8a3b){return db[_0x0ed5('0x37')][_0x0ed5('0x53')]({'where':{'id':_0x1c6932['params']['id']}})['then'](handleEntityNotFound(_0x3a8a3b,null))[_0x0ed5('0x20')](removeEntity(_0x3a8a3b,null))[_0x0ed5('0x50')](handleError(_0x3a8a3b,null));};exports['describe']=function(_0x212b8a,_0x36fe1c){return db['FaxMessage'][_0x0ed5('0x54')]()[_0x0ed5('0x20')](respondWithResult(_0x36fe1c,null))[_0x0ed5('0x50')](handleError(_0x36fe1c,null));};var interaction_log=require('../../config/logger')(_0x0ed5('0x55'));exports[_0x0ed5('0x56')]=function(_0x5f3113,_0x24fcdb,_0x249dcb){var _0x8b963={'agent':{},'channel':'fax'};if(_0x5f3113[_0x0ed5('0x52')]['id']){delete _0x5f3113[_0x0ed5('0x52')]['id'];}_0x5f3113['body'][_0x0ed5('0x57')]=!![];_0x5f3113['body'][_0x0ed5('0x58')]=moment()[_0x0ed5('0x59')](_0x0ed5('0x5a'));_0x5f3113[_0x0ed5('0x52')][_0x0ed5('0x5b')]=_0x5f3113[_0x0ed5('0x52')][_0x0ed5('0x5b')]||_0x5f3113[_0x0ed5('0x5c')]['id'];_0x8b963['agent']['id']=_0x5f3113[_0x0ed5('0x52')]['UserId'];return db[_0x0ed5('0x37')]['find']({'where':{'id':_0x5f3113[_0x0ed5('0x51')]['id'],'UserId':null}})[_0x0ed5('0x20')](handleEntityNotFound(_0x24fcdb,null))[_0x0ed5('0x20')](saveUpdates(_0x5f3113[_0x0ed5('0x52')],null))['then'](function(_0x1cbb13){if(_0x1cbb13){_0x8b963['message']=_0x1cbb13[_0x0ed5('0x5d')]({'plain':!![]});return db['FaxInteraction']['find']({'where':{'id':_0x1cbb13['FaxInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x24fcdb,null))[_0x0ed5('0x20')](function(_0x144cc8){if(_0x144cc8){return _0x144cc8[_0x0ed5('0x31')]({'UserId':_0x5f3113[_0x0ed5('0x52')]['UserId'],'read1stAt':_[_0x0ed5('0x5e')](_0x144cc8[_0x0ed5('0x5f')])?moment()['format'](_0x0ed5('0x5a')):undefined});}return null;})[_0x0ed5('0x20')](function(_0x26095c){if(_0x26095c){_0x8b963['interaction']=_0x26095c[_0x0ed5('0x5d')]({'plain':!![]});interaction_log['info']('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5f3113['user']['id'],_0x5f3113[_0x0ed5('0x5c')]['name'],_0x5f3113['user'][_0x0ed5('0x60')],_0x8b963[_0x0ed5('0x61')]['id'],_0x5f3113[_0x0ed5('0x52')]?JSON[_0x0ed5('0x24')](_0x5f3113[_0x0ed5('0x52')]):_0x0ed5('0x62'));return respondWithRpcPromise(_0x0ed5('0x63'),_0x0ed5('0x64'),_0x8b963);}return null;})[_0x0ed5('0x20')](function(_0x39a6dc){var _0x4c4fae=_0x0ed5('0x65')+_0x39a6dc[_0x0ed5('0x27')][_0x0ed5('0x66')];return db[_0x0ed5('0x67')][_0x0ed5('0x3a')](_0x4c4fae,{'type':db[_0x0ed5('0x68')][_0x0ed5('0x69')][_0x0ed5('0x6a')],'raw':!![]})['then'](function(_0xf1ed89){return _0xf1ed89;});})[_0x0ed5('0x20')](function(_0x550587){if(_0x550587){_0x8b963[_0x0ed5('0x27')][_0x0ed5('0x6b')]=_0x550587[0x0];if(!_0x5f3113[_0x0ed5('0x52')][_0x0ed5('0x5b')])return;return db[_0x0ed5('0x6c')]['find']({'where':{'id':_0x5f3113[_0x0ed5('0x52')]['UserId'],'role':_0x0ed5('0x6d')},'attributes':['id',_0x0ed5('0x33'),'fullname',_0x0ed5('0x6e'),_0x0ed5('0x6f')],'raw':!![]});}return null;})['then'](function(_0x37a864){if(!_0x37a864)return null;_0x8b963['message']['agent']=_0x37a864;return _0x8b963;})[_0x0ed5('0x20')](function(_0x4f34fc){if(_0x4f34fc){if(_0x5f3113['body'][_0x0ed5('0x70')]){_0x8b963[_0x0ed5('0x27')]['interface']=util['format'](_0x0ed5('0x71'),_0x5f3113[_0x0ed5('0x5c')][_0x0ed5('0x33')]);_0x8b963['message'][_0x0ed5('0x72')]=_0x8b963[_0x0ed5('0x72')];_0x8b963[_0x0ed5('0x27')]['motionChannel']=_0x8b963[_0x0ed5('0x72')];_0x8b963[_0x0ed5('0x27')][_0x0ed5('0x73')]='accept';return respondWithRpcPromise(_0x0ed5('0x74'),_0x0ed5('0x74'),{'event':_0x0ed5('0x75'),'message':_0x8b963[_0x0ed5('0x27')]},client9002)[_0x0ed5('0x20')](function(){return _0x8b963;});}return _0x8b963;}return null;})[_0x0ed5('0x20')](respondWithResult(_0x24fcdb,null))[_0x0ed5('0x50')](handleError(_0x24fcdb,null));};var interaction_log=require('../../config/logger')(_0x0ed5('0x55'));exports['reject']=function(_0x5804e3,_0x5ad7e0,_0x2bc49f){var _0x280188={'agent':{},'channel':_0x0ed5('0x76')};if(_0x5804e3[_0x0ed5('0x52')]['id']){delete _0x5804e3[_0x0ed5('0x52')]['id'];}_0x5804e3['body']['UserId']=_0x5804e3[_0x0ed5('0x52')][_0x0ed5('0x5b')]||_0x5804e3[_0x0ed5('0x5c')]['id'];_0x280188[_0x0ed5('0x6d')]['id']=_0x5804e3[_0x0ed5('0x52')][_0x0ed5('0x5b')];return db[_0x0ed5('0x37')][_0x0ed5('0x53')]({'where':{'id':_0x5804e3[_0x0ed5('0x51')]['id'],'UserId':null}})[_0x0ed5('0x20')](handleEntityNotFound(_0x5ad7e0,null))[_0x0ed5('0x20')](function(_0x303f86){if(_0x303f86){_0x280188[_0x0ed5('0x27')]=_0x303f86[_0x0ed5('0x5d')]({'plain':!![]});return db['FaxInteraction'][_0x0ed5('0x53')]({'where':{'id':_0x303f86[_0x0ed5('0x77')]}});}return null;})[_0x0ed5('0x20')](handleEntityNotFound(_0x5ad7e0,null))[_0x0ed5('0x20')](function(_0x1a22c8){if(_0x1a22c8){_0x280188[_0x0ed5('0x61')]=_0x1a22c8['get']({'plain':!![]});interaction_log['info'](_0x0ed5('0x78'),_0x5804e3[_0x0ed5('0x5c')]['id'],_0x5804e3[_0x0ed5('0x5c')][_0x0ed5('0x33')],_0x5804e3[_0x0ed5('0x5c')][_0x0ed5('0x60')],_0x280188[_0x0ed5('0x61')]['id'],_0x5804e3[_0x0ed5('0x52')]?JSON[_0x0ed5('0x24')](_0x5804e3[_0x0ed5('0x52')]):'null');return respondWithRpcPromise(_0x0ed5('0x79'),_0x0ed5('0x7a'),_0x280188);}return null;})[_0x0ed5('0x20')](function(_0x66db59){var _0xa919f4=_0x0ed5('0x65')+_0x66db59['message']['ContactId'];return db['sequelize'][_0x0ed5('0x3a')](_0xa919f4,{'type':db[_0x0ed5('0x68')][_0x0ed5('0x69')][_0x0ed5('0x6a')],'raw':!![]})[_0x0ed5('0x20')](function(_0x1ddda2){return _0x1ddda2;});})[_0x0ed5('0x20')](function(_0x203ceb){if(_0x203ceb){_0x280188['message']['contact']=_0x203ceb[0x0];if(!_0x5804e3[_0x0ed5('0x52')]['UserId'])return;return db[_0x0ed5('0x6c')][_0x0ed5('0x53')]({'where':{'id':_0x5804e3['body']['UserId'],'role':'agent'},'attributes':['id',_0x0ed5('0x33'),_0x0ed5('0x7b'),_0x0ed5('0x6e'),'internal'],'raw':!![]});}return null;})[_0x0ed5('0x20')](function(_0x4fbbb6){if(!_0x4fbbb6)return null;_0x280188[_0x0ed5('0x27')][_0x0ed5('0x6d')]=_0x4fbbb6;return _0x280188;})[_0x0ed5('0x20')](function(_0x4a51a6){if(_0x4a51a6){_0x4a51a6[_0x0ed5('0x27')][_0x0ed5('0x7c')]=util[_0x0ed5('0x59')](_0x0ed5('0x71'),_0x5804e3[_0x0ed5('0x5c')][_0x0ed5('0x33')]);_0x4a51a6[_0x0ed5('0x27')][_0x0ed5('0x72')]=_0x280188[_0x0ed5('0x72')];_0x4a51a6['message']['motionChannel']=_0x280188[_0x0ed5('0x72')];_0x4a51a6['message']['event']='reject';respondWithRpcPromise(_0x0ed5('0x74'),_0x0ed5('0x74'),{'event':_0x0ed5('0x7d'),'message':_0x4a51a6['message']},client9002);return _0x280188;}return null;})[_0x0ed5('0x20')](respondWithResult(_0x5ad7e0,null))[_0x0ed5('0x50')](handleError(_0x5ad7e0,null));};exports[_0x0ed5('0x7e')]=function(_0x474c44,_0x16e6ce){var _0x5a769f;return db[_0x0ed5('0x37')][_0x0ed5('0x7e')](_0x474c44[_0x0ed5('0x52')],{})['then'](function(_0x12778b){_0x5a769f=_0x12778b;return db[_0x0ed5('0x7f')][_0x0ed5('0x80')]({'where':{'id':_0x5a769f[_0x0ed5('0x66')]}});})[_0x0ed5('0x20')](function(_0x4ee477){if(_[_0x0ed5('0x5e')](_0x4ee477)){return;}else{_0x5a769f[_0x0ed5('0x76')]=_0x4ee477[_0x0ed5('0x76')];return db['Attachment'][_0x0ed5('0x80')]({'where':{'id':_0x5a769f[_0x0ed5('0x81')]}});}})[_0x0ed5('0x20')](function(_0x2806bd){return respondWithRpcPromise(_0x0ed5('0x82'),_0x0ed5('0x82'),{'FaxAccountId':_[_0x0ed5('0x5e')](_0x474c44[_0x0ed5('0x52')])?undefined:_0x474c44[_0x0ed5('0x52')]['FaxAccountId'],'path':_[_0x0ed5('0x5e')](_0x2806bd)?undefined:util[_0x0ed5('0x59')]('/var/opt/motion2/server/files/attachments/%s',_0x2806bd[_0x0ed5('0x83')]),'fax':_[_0x0ed5('0x5e')](_0x5a769f[_0x0ed5('0x76')])?undefined:_0x5a769f[_0x0ed5('0x76')],'AttachmentId':_0x5a769f[_0x0ed5('0x81')]},client9002);})[_0x0ed5('0x20')](respondWithResult(_0x16e6ce,0xc9))[_0x0ed5('0x50')](handleError(_0x16e6ce,null));};exports[_0x0ed5('0x84')]=function(_0x49a3a8,_0x237c7f){var _0x49adf4=path['join'](config['root'],_0x0ed5('0x85'),'files','attachments');return db[_0x0ed5('0x37')][_0x0ed5('0x53')]({'where':{'id':_0x49a3a8['params']['id']},'include':[{'model':db[_0x0ed5('0x86')],'as':_0x0ed5('0x86')}]})[_0x0ed5('0x20')](handleEntityNotFound(_0x237c7f,null))['then'](function(_0x410fe7){if(_0x410fe7){return _0x237c7f[_0x0ed5('0x84')](path[_0x0ed5('0x87')](_0x49adf4,_0x410fe7[_0x0ed5('0x86')]['basename']));}})['catch'](handleError(_0x237c7f,null));}; \ No newline at end of file +var _0x2134=['lodash','squel','crypto','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./faxMessage.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','result','sendStatus','status','end','offset','undefined','count','limit','json','apply','reject','save','stack','name','send','FaxMessage','rawAttributes','fieldName','key','map','query','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','rows','catch','show','length','includeAll','find','update','body','params','destroy','describe','../../config/logger','fax-interactions','accept','fax','read','format','UserId','user','agent','FaxInteraction','FaxInteractionId','isNil','YYYY-MM-DD\x20HH:mm:ss','get','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','contact','User','email','internal','manual','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','sequelize','Sequelize','SELECT','event','rejectmessage','create','CmContact','findOne','Attachment','AttachmentId','SendFax','FaxAccountId','download','join','root','server','attachments','basename','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra'];(function(_0x2c82c2,_0x53e29b){var _0x11a4a1=function(_0x161df){while(--_0x161df){_0x2c82c2['push'](_0x2c82c2['shift']());}};_0x11a4a1(++_0x53e29b);}(_0x2134,0x1ac));var _0x4213=function(_0x57f50f,_0x309da4){_0x57f50f=_0x57f50f-0x0;var _0x34a3f4=_0x2134[_0x57f50f];return _0x34a3f4;};'use strict';var emlformat=require(_0x4213('0x0'));var rimraf=require(_0x4213('0x1'));var zipdir=require(_0x4213('0x2'));var jsonpatch=require(_0x4213('0x3'));var rp=require(_0x4213('0x4'));var moment=require(_0x4213('0x5'));var BPromise=require(_0x4213('0x6'));var Mustache=require(_0x4213('0x7'));var util=require(_0x4213('0x8'));var path=require(_0x4213('0x9'));var sox=require(_0x4213('0xa'));var csv=require('to-csv');var ejs=require(_0x4213('0xb'));var fs=require('fs');var fs_extra=require(_0x4213('0xc'));var _=require(_0x4213('0xd'));var squel=require(_0x4213('0xe'));var crypto=require(_0x4213('0xf'));var jsforce=require(_0x4213('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x4213('0x11'));var querystring=require(_0x4213('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4213('0x13'));var qs=require(_0x4213('0x14'));var as=require(_0x4213('0x15'));var hardwareService=require(_0x4213('0x16'));var logger=require('../../config/logger')(_0x4213('0x17'));var utils=require(_0x4213('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x4213('0x19'));var db=require(_0x4213('0x1a'))['db'];config[_0x4213('0x1b')]=_[_0x4213('0x1c')](config[_0x4213('0x1b')],{'host':_0x4213('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4213('0x1b')]));require(_0x4213('0x1e'))[_0x4213('0x1f')](socket);var jayson=require(_0x4213('0x20'));var client=jayson[_0x4213('0x21')]['http']({'port':0x232c});var client9002=jayson['client'][_0x4213('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x5e4c7a,_0x496601,_0x700ed0,_0x48e32c){return new BPromise(function(_0x3f3fd3,_0x4e3932){var _0x3bf803=_0x48e32c||client;return _0x3bf803[_0x4213('0x23')](_0x5e4c7a,_0x700ed0)[_0x4213('0x24')](function(_0x76bd5f){logger[_0x4213('0x25')]('FaxMessage,\x20%s,\x20%s',_0x496601,_0x4213('0x26'));logger[_0x4213('0x27')](_0x4213('0x28'),_0x496601,'request\x20sent',JSON[_0x4213('0x29')](_0x76bd5f));if(_0x76bd5f['error']){if(_0x76bd5f[_0x4213('0x2a')][_0x4213('0x2b')]===0x1f4){logger[_0x4213('0x2a')](_0x4213('0x2c'),_0x496601,_0x76bd5f['error']['message']);return _0x4e3932(_0x76bd5f[_0x4213('0x2a')][_0x4213('0x2d')]);}logger[_0x4213('0x2a')](_0x4213('0x2c'),_0x496601,_0x76bd5f['error'][_0x4213('0x2d')]);return _0x3f3fd3(_0x76bd5f[_0x4213('0x2a')][_0x4213('0x2d')]);}else{logger[_0x4213('0x25')](_0x4213('0x2c'),_0x496601,_0x4213('0x26'));_0x3f3fd3(_0x76bd5f[_0x4213('0x2e')][_0x4213('0x2d')]);}})['catch'](function(_0x1932f7){logger[_0x4213('0x2a')](_0x4213('0x2c'),_0x496601,_0x1932f7);_0x4e3932(_0x1932f7);});});}function respondWithStatusCode(_0x22d3f7,_0x3cdd2e){_0x3cdd2e=_0x3cdd2e||0xcc;return function(_0xe4ea0f){if(_0xe4ea0f){return _0x22d3f7[_0x4213('0x2f')](_0x3cdd2e);}return _0x22d3f7[_0x4213('0x30')](_0x3cdd2e)[_0x4213('0x31')]();};}function respondWithResult(_0x5cfec7,_0x152d59){_0x152d59=_0x152d59||0xc8;return function(_0x80d92){if(_0x80d92){return _0x5cfec7[_0x4213('0x30')](_0x152d59)['json'](_0x80d92);}};}function respondWithFilteredResult(_0xc15b6a,_0x3533ce){return function(_0x20b767){if(_0x20b767){var _0x5e635a=typeof _0x3533ce[_0x4213('0x32')]===_0x4213('0x33')&&typeof _0x3533ce['limit']===_0x4213('0x33');var _0x419b34=_0x20b767[_0x4213('0x34')];var _0x20cf96=_0x5e635a?0x0:_0x3533ce[_0x4213('0x32')];var _0x370d53=_0x5e635a?_0x20b767[_0x4213('0x34')]:_0x3533ce['offset']+_0x3533ce[_0x4213('0x35')];var _0x33bfd9;if(_0x370d53>=_0x419b34){_0x370d53=_0x419b34;_0x33bfd9=0xc8;}else{_0x33bfd9=0xce;}_0xc15b6a[_0x4213('0x30')](_0x33bfd9);return _0xc15b6a['set']('Content-Range',_0x20cf96+'-'+_0x370d53+'/'+_0x419b34)[_0x4213('0x36')](_0x20b767);}return null;};}function patchUpdates(_0x289f35){return function(_0x10ec97){try{jsonpatch[_0x4213('0x37')](_0x10ec97,_0x289f35,!![]);}catch(_0x3f0d91){return BPromise[_0x4213('0x38')](_0x3f0d91);}return _0x10ec97[_0x4213('0x39')]();};}function saveUpdates(_0x4122b7,_0x363196){return function(_0x2f8a62){if(_0x2f8a62){return _0x2f8a62['update'](_0x4122b7)['then'](function(_0x584f45){return _0x584f45;});}return null;};}function removeEntity(_0x453d4d,_0x252aba){return function(_0x3a472d){if(_0x3a472d){return _0x3a472d['destroy']()[_0x4213('0x24')](function(){_0x453d4d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xd60d81,_0x23f8af){return function(_0xece98b){if(!_0xece98b){_0xd60d81[_0x4213('0x2f')](0x194);}return _0xece98b;};}function handleError(_0x348fe5,_0x4ee977){_0x4ee977=_0x4ee977||0x1f4;return function(_0x176e40){logger['error'](_0x176e40[_0x4213('0x3a')]);if(_0x176e40[_0x4213('0x3b')]){delete _0x176e40[_0x4213('0x3b')];}_0x348fe5[_0x4213('0x30')](_0x4ee977)[_0x4213('0x3c')](_0x176e40);};}exports['index']=function(_0x1282c0,_0x9c320a){var _0x361be6={},_0x34032c={},_0x5081b5={'count':0x0,'rows':[]};var _0x489e2e=_['map'](db[_0x4213('0x3d')][_0x4213('0x3e')],function(_0x30b4f5){return{'name':_0x30b4f5[_0x4213('0x3f')],'type':_0x30b4f5['type'][_0x4213('0x40')]};});_0x34032c['model']=_[_0x4213('0x41')](_0x489e2e,_0x4213('0x3b'));_0x34032c[_0x4213('0x42')]=_['keys'](_0x1282c0[_0x4213('0x42')]);_0x34032c['filters']=_[_0x4213('0x43')](_0x34032c[_0x4213('0x44')],_0x34032c[_0x4213('0x42')]);_0x361be6[_0x4213('0x45')]=_['intersection'](_0x34032c[_0x4213('0x44')],qs[_0x4213('0x46')](_0x1282c0['query'][_0x4213('0x46')]));_0x361be6['attributes']=_0x361be6['attributes']['length']?_0x361be6[_0x4213('0x45')]:_0x34032c[_0x4213('0x44')];if(!_0x1282c0[_0x4213('0x42')][_0x4213('0x47')](_0x4213('0x48'))){_0x361be6[_0x4213('0x35')]=qs[_0x4213('0x35')](_0x1282c0['query']['limit']);_0x361be6[_0x4213('0x32')]=qs[_0x4213('0x32')](_0x1282c0[_0x4213('0x42')][_0x4213('0x32')]);}_0x361be6['order']=qs['sort'](_0x1282c0[_0x4213('0x42')][_0x4213('0x49')]);_0x361be6[_0x4213('0x4a')]=qs[_0x4213('0x4b')](_[_0x4213('0x4c')](_0x1282c0[_0x4213('0x42')],_0x34032c[_0x4213('0x4b')]),_0x489e2e);if(_0x1282c0['query'][_0x4213('0x4d')]){_0x361be6[_0x4213('0x4a')]=_[_0x4213('0x4e')](_0x361be6['where'],{'$or':_[_0x4213('0x41')](_0x489e2e,function(_0x490ea7){if(_0x490ea7['type']!==_0x4213('0x4f')){var _0x1f8901={};_0x1f8901[_0x490ea7[_0x4213('0x3b')]]={'$like':'%'+_0x1282c0[_0x4213('0x42')][_0x4213('0x4d')]+'%'};return _0x1f8901;}})});}_0x361be6=_['merge']({},_0x361be6,_0x1282c0[_0x4213('0x50')]);var _0x594bd7={'where':_0x361be6[_0x4213('0x4a')]};return db[_0x4213('0x3d')]['count'](_0x594bd7)['then'](function(_0x8dcf10){_0x5081b5[_0x4213('0x34')]=_0x8dcf10;if(_0x1282c0[_0x4213('0x42')]['includeAll']){_0x361be6[_0x4213('0x51')]=[{'all':!![]}];}return db[_0x4213('0x3d')]['findAll'](_0x361be6);})[_0x4213('0x24')](function(_0x2b8628){_0x5081b5[_0x4213('0x52')]=_0x2b8628;return _0x5081b5;})[_0x4213('0x24')](respondWithFilteredResult(_0x9c320a,_0x361be6))[_0x4213('0x53')](handleError(_0x9c320a,null));};exports[_0x4213('0x54')]=function(_0x12da9a,_0x45f29a){var _0x1f4cfc={'raw':!![],'where':{'id':_0x12da9a['params']['id']}},_0x266384={};_0x266384['model']=_['keys'](db['FaxMessage'][_0x4213('0x3e')]);_0x266384[_0x4213('0x42')]=_['keys'](_0x12da9a['query']);_0x266384[_0x4213('0x4b')]=_[_0x4213('0x43')](_0x266384[_0x4213('0x44')],_0x266384[_0x4213('0x42')]);_0x1f4cfc[_0x4213('0x45')]=_['intersection'](_0x266384[_0x4213('0x44')],qs[_0x4213('0x46')](_0x12da9a[_0x4213('0x42')][_0x4213('0x46')]));_0x1f4cfc[_0x4213('0x45')]=_0x1f4cfc[_0x4213('0x45')][_0x4213('0x55')]?_0x1f4cfc[_0x4213('0x45')]:_0x266384[_0x4213('0x44')];if(_0x12da9a[_0x4213('0x42')][_0x4213('0x56')]){_0x1f4cfc[_0x4213('0x51')]=[{'all':!![]}];}_0x1f4cfc=_['merge']({},_0x1f4cfc,_0x12da9a[_0x4213('0x50')]);return db[_0x4213('0x3d')][_0x4213('0x57')](_0x1f4cfc)[_0x4213('0x24')](handleEntityNotFound(_0x45f29a,null))[_0x4213('0x24')](respondWithResult(_0x45f29a,null))['catch'](handleError(_0x45f29a,null));};exports[_0x4213('0x58')]=function(_0xda9a7c,_0x4d471c){if(_0xda9a7c[_0x4213('0x59')]['id']){delete _0xda9a7c[_0x4213('0x59')]['id'];}return db['FaxMessage'][_0x4213('0x57')]({'where':{'id':_0xda9a7c[_0x4213('0x5a')]['id']}})[_0x4213('0x24')](handleEntityNotFound(_0x4d471c,null))[_0x4213('0x24')](saveUpdates(_0xda9a7c[_0x4213('0x59')],null))['then'](respondWithResult(_0x4d471c,null))['catch'](handleError(_0x4d471c,null));};exports[_0x4213('0x5b')]=function(_0xa66ae0,_0x2acee2){return db['FaxMessage'][_0x4213('0x57')]({'where':{'id':_0xa66ae0['params']['id']}})[_0x4213('0x24')](handleEntityNotFound(_0x2acee2,null))['then'](removeEntity(_0x2acee2,null))[_0x4213('0x53')](handleError(_0x2acee2,null));};exports[_0x4213('0x5c')]=function(_0x28cb0c,_0x3e8c69){return db['FaxMessage'][_0x4213('0x5c')]()[_0x4213('0x24')](respondWithResult(_0x3e8c69,null))[_0x4213('0x53')](handleError(_0x3e8c69,null));};var interaction_log=require(_0x4213('0x5d'))(_0x4213('0x5e'));exports[_0x4213('0x5f')]=function(_0x2c4f8e,_0x2a1813,_0x261194){var _0x518d10={'agent':{},'channel':_0x4213('0x60')};if(_0x2c4f8e[_0x4213('0x59')]['id']){delete _0x2c4f8e[_0x4213('0x59')]['id'];}_0x2c4f8e[_0x4213('0x59')][_0x4213('0x61')]=!![];_0x2c4f8e[_0x4213('0x59')]['readAt']=moment()[_0x4213('0x62')]('YYYY-MM-DD\x20HH:mm:ss');_0x2c4f8e[_0x4213('0x59')][_0x4213('0x63')]=_0x2c4f8e[_0x4213('0x59')][_0x4213('0x63')]||_0x2c4f8e[_0x4213('0x64')]['id'];_0x518d10[_0x4213('0x65')]['id']=_0x2c4f8e[_0x4213('0x59')][_0x4213('0x63')];return db['FaxMessage'][_0x4213('0x57')]({'where':{'id':_0x2c4f8e['params']['id'],'UserId':null}})[_0x4213('0x24')](handleEntityNotFound(_0x2a1813,null))[_0x4213('0x24')](saveUpdates(_0x2c4f8e[_0x4213('0x59')],null))['then'](function(_0x1c4285){if(_0x1c4285){_0x518d10[_0x4213('0x2d')]=_0x1c4285['get']({'plain':!![]});return db[_0x4213('0x66')][_0x4213('0x57')]({'where':{'id':_0x1c4285[_0x4213('0x67')]}});}return null;})['then'](handleEntityNotFound(_0x2a1813,null))[_0x4213('0x24')](function(_0x4e63a9){if(_0x4e63a9){return _0x4e63a9['update']({'UserId':_0x2c4f8e['body']['UserId'],'read1stAt':_[_0x4213('0x68')](_0x4e63a9['read1stAt'])?moment()[_0x4213('0x62')](_0x4213('0x69')):undefined});}return null;})['then'](function(_0x3044cb){if(_0x3044cb){_0x518d10['interaction']=_0x3044cb[_0x4213('0x6a')]({'plain':!![]});interaction_log[_0x4213('0x25')](_0x4213('0x6b'),_0x2c4f8e[_0x4213('0x64')]['id'],_0x2c4f8e[_0x4213('0x64')][_0x4213('0x3b')],_0x2c4f8e[_0x4213('0x64')][_0x4213('0x6c')],_0x518d10[_0x4213('0x6d')]['id'],_0x2c4f8e[_0x4213('0x59')]?JSON[_0x4213('0x29')](_0x2c4f8e[_0x4213('0x59')]):_0x4213('0x6e'));return respondWithRpcPromise(_0x4213('0x6f'),'acceptMessage',_0x518d10);}return null;})[_0x4213('0x24')](function(_0x29e00b){var _0x5ac335=_0x4213('0x70')+_0x29e00b[_0x4213('0x2d')][_0x4213('0x71')];return db['sequelize'][_0x4213('0x42')](_0x5ac335,{'type':db['Sequelize'][_0x4213('0x72')]['SELECT'],'raw':!![]})[_0x4213('0x24')](function(_0xa4b2b1){return _0xa4b2b1;});})['then'](function(_0x260a7f){if(_0x260a7f){_0x518d10[_0x4213('0x2d')][_0x4213('0x73')]=_0x260a7f[0x0];if(!_0x2c4f8e[_0x4213('0x59')]['UserId'])return;return db[_0x4213('0x74')][_0x4213('0x57')]({'where':{'id':_0x2c4f8e[_0x4213('0x59')][_0x4213('0x63')],'role':_0x4213('0x65')},'attributes':['id',_0x4213('0x3b'),'fullname',_0x4213('0x75'),_0x4213('0x76')],'raw':!![]});}return null;})[_0x4213('0x24')](function(_0x56196c){if(!_0x56196c)return null;_0x518d10[_0x4213('0x2d')][_0x4213('0x65')]=_0x56196c;return _0x518d10;})['then'](function(_0x21fad4){if(_0x21fad4){if(_0x2c4f8e[_0x4213('0x59')][_0x4213('0x77')]){_0x518d10['message'][_0x4213('0x78')]=util[_0x4213('0x62')](_0x4213('0x79'),_0x2c4f8e[_0x4213('0x64')][_0x4213('0x3b')]);_0x518d10[_0x4213('0x2d')][_0x4213('0x7a')]=_0x518d10['channel'];_0x518d10[_0x4213('0x2d')][_0x4213('0x7b')]=_0x518d10[_0x4213('0x7a')];_0x518d10['message']['event']=_0x4213('0x5f');return respondWithRpcPromise(_0x4213('0x7c'),_0x4213('0x7c'),{'event':_0x4213('0x7d'),'message':_0x518d10[_0x4213('0x2d')]},client9002)[_0x4213('0x24')](function(){return _0x518d10;});}return _0x518d10;}return null;})[_0x4213('0x24')](respondWithResult(_0x2a1813,null))[_0x4213('0x53')](handleError(_0x2a1813,null));};var interaction_log=require(_0x4213('0x5d'))('fax-interactions');exports[_0x4213('0x38')]=function(_0x2d6056,_0x4b67f7,_0x190389){var _0x36ed99={'agent':{},'channel':'fax'};if(_0x2d6056['body']['id']){delete _0x2d6056[_0x4213('0x59')]['id'];}_0x2d6056[_0x4213('0x59')][_0x4213('0x63')]=_0x2d6056['body'][_0x4213('0x63')]||_0x2d6056[_0x4213('0x64')]['id'];_0x36ed99[_0x4213('0x65')]['id']=_0x2d6056[_0x4213('0x59')]['UserId'];return db[_0x4213('0x3d')][_0x4213('0x57')]({'where':{'id':_0x2d6056['params']['id'],'UserId':null}})[_0x4213('0x24')](handleEntityNotFound(_0x4b67f7,null))['then'](function(_0xaf5dff){if(_0xaf5dff){_0x36ed99[_0x4213('0x2d')]=_0xaf5dff[_0x4213('0x6a')]({'plain':!![]});return db[_0x4213('0x66')][_0x4213('0x57')]({'where':{'id':_0xaf5dff['FaxInteractionId']}});}return null;})[_0x4213('0x24')](handleEntityNotFound(_0x4b67f7,null))['then'](function(_0x50bf1d){if(_0x50bf1d){_0x36ed99[_0x4213('0x6d')]=_0x50bf1d[_0x4213('0x6a')]({'plain':!![]});interaction_log[_0x4213('0x25')](_0x4213('0x7e'),_0x2d6056['user']['id'],_0x2d6056[_0x4213('0x64')][_0x4213('0x3b')],_0x2d6056[_0x4213('0x64')][_0x4213('0x6c')],_0x36ed99[_0x4213('0x6d')]['id'],_0x2d6056['body']?JSON[_0x4213('0x29')](_0x2d6056['body']):'null');return respondWithRpcPromise(_0x4213('0x7f'),_0x4213('0x80'),_0x36ed99);}return null;})[_0x4213('0x24')](function(_0x1e1bc6){var _0x2d2332=_0x4213('0x70')+_0x1e1bc6[_0x4213('0x2d')][_0x4213('0x71')];return db[_0x4213('0x81')]['query'](_0x2d2332,{'type':db[_0x4213('0x82')]['QueryTypes'][_0x4213('0x83')],'raw':!![]})[_0x4213('0x24')](function(_0x30cf69){return _0x30cf69;});})[_0x4213('0x24')](function(_0x16974c){if(_0x16974c){_0x36ed99[_0x4213('0x2d')][_0x4213('0x73')]=_0x16974c[0x0];if(!_0x2d6056[_0x4213('0x59')][_0x4213('0x63')])return;return db[_0x4213('0x74')]['find']({'where':{'id':_0x2d6056[_0x4213('0x59')]['UserId'],'role':_0x4213('0x65')},'attributes':['id',_0x4213('0x3b'),'fullname',_0x4213('0x75'),_0x4213('0x76')],'raw':!![]});}return null;})[_0x4213('0x24')](function(_0x1daa36){if(!_0x1daa36)return null;_0x36ed99['message']['agent']=_0x1daa36;return _0x36ed99;})[_0x4213('0x24')](function(_0x17a0e0){if(_0x17a0e0){_0x17a0e0[_0x4213('0x2d')][_0x4213('0x78')]=util[_0x4213('0x62')](_0x4213('0x79'),_0x2d6056[_0x4213('0x64')]['name']);_0x17a0e0[_0x4213('0x2d')][_0x4213('0x7a')]=_0x36ed99['channel'];_0x17a0e0['message']['motionChannel']=_0x36ed99['channel'];_0x17a0e0[_0x4213('0x2d')][_0x4213('0x84')]=_0x4213('0x38');respondWithRpcPromise(_0x4213('0x7c'),_0x4213('0x7c'),{'event':_0x4213('0x85'),'message':_0x17a0e0[_0x4213('0x2d')]},client9002);return _0x36ed99;}return null;})['then'](respondWithResult(_0x4b67f7,null))[_0x4213('0x53')](handleError(_0x4b67f7,null));};exports[_0x4213('0x86')]=function(_0x414245,_0x15912c){var _0x5e5e9d;return db['FaxMessage'][_0x4213('0x86')](_0x414245[_0x4213('0x59')],{})[_0x4213('0x24')](function(_0x388b34){_0x5e5e9d=_0x388b34;return db[_0x4213('0x87')][_0x4213('0x88')]({'where':{'id':_0x5e5e9d[_0x4213('0x71')]}});})[_0x4213('0x24')](function(_0x2ab0ea){if(_['isNil'](_0x2ab0ea)){return;}else{_0x5e5e9d[_0x4213('0x60')]=_0x2ab0ea[_0x4213('0x60')];return db[_0x4213('0x89')]['findOne']({'where':{'id':_0x5e5e9d[_0x4213('0x8a')]}});}})[_0x4213('0x24')](function(_0x1dc1d6){return respondWithRpcPromise(_0x4213('0x8b'),'SendFax',{'FaxAccountId':_[_0x4213('0x68')](_0x414245[_0x4213('0x59')])?undefined:_0x414245[_0x4213('0x59')][_0x4213('0x8c')],'path':_[_0x4213('0x68')](_0x1dc1d6)?undefined:util[_0x4213('0x62')]('/var/opt/motion2/server/files/attachments/%s',_0x1dc1d6['basename']),'fax':_[_0x4213('0x68')](_0x5e5e9d[_0x4213('0x60')])?undefined:_0x5e5e9d['fax'],'AttachmentId':_0x5e5e9d[_0x4213('0x8a')]},client9002);})[_0x4213('0x24')](respondWithResult(_0x15912c,0xc9))[_0x4213('0x53')](handleError(_0x15912c,null));};exports[_0x4213('0x8d')]=function(_0x21a3ba,_0x4ac93f){var _0x17f211=path[_0x4213('0x8e')](config[_0x4213('0x8f')],_0x4213('0x90'),'files',_0x4213('0x91'));return db['FaxMessage'][_0x4213('0x57')]({'where':{'id':_0x21a3ba[_0x4213('0x5a')]['id']},'include':[{'model':db[_0x4213('0x89')],'as':'Attachment'}]})[_0x4213('0x24')](handleEntityNotFound(_0x4ac93f,null))[_0x4213('0x24')](function(_0x1480de){if(_0x1480de){return _0x4ac93f['download'](path[_0x4213('0x8e')](_0x17f211,_0x1480de[_0x4213('0x89')][_0x4213('0x92')]));}})['catch'](handleError(_0x4ac93f,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index b28bd19..b7e3c66 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 _0x59ac=['FaxMessage','setMaxListeners','save','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x1b16da,_0x452da0){var _0xb1f5a2=function(_0x4ce7bd){while(--_0x4ce7bd){_0x1b16da['push'](_0x1b16da['shift']());}};_0xb1f5a2(++_0x452da0);}(_0x59ac,0x73));var _0xc59a=function(_0x23da02,_0x528d27){_0x23da02=_0x23da02-0x0;var _0x1ed19b=_0x59ac[_0x23da02];return _0x1ed19b;};'use strict';var EventEmitter=require(_0xc59a('0x0'));var FaxMessage=require(_0xc59a('0x1'))['db'][_0xc59a('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xc59a('0x3')](0x0);var events={'afterCreate':_0xc59a('0x4'),'afterUpdate':'update','afterDestroy':_0xc59a('0x5')};function emitEvent(_0x2d6707){return function(_0x4dfceb,_0x3b7b43,_0x18a901){FaxMessageEvents[_0xc59a('0x6')](_0x2d6707+':'+_0x4dfceb['id'],_0x4dfceb);FaxMessageEvents[_0xc59a('0x6')](_0x2d6707,_0x4dfceb);_0x18a901(null);};}for(var e in events){if(events[_0xc59a('0x7')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0xc59a('0x8')]=FaxMessageEvents; \ No newline at end of file +var _0xdec3=['hook','exports','events','FaxMessage','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x10a501,_0x2c12da){var _0xef0315=function(_0x71da0e){while(--_0x71da0e){_0x10a501['push'](_0x10a501['shift']());}};_0xef0315(++_0x2c12da);}(_0xdec3,0x89));var _0x3dec=function(_0x4fb614,_0x3f1326){_0x4fb614=_0x4fb614-0x0;var _0x14222b=_0xdec3[_0x4fb614];return _0x14222b;};'use strict';var EventEmitter=require(_0x3dec('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0x3dec('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x3dec('0x2')](0x0);var events={'afterCreate':_0x3dec('0x3'),'afterUpdate':'update','afterDestroy':_0x3dec('0x4')};function emitEvent(_0x2821f7){return function(_0x16966b,_0x113b21,_0x5ca438){FaxMessageEvents[_0x3dec('0x5')](_0x2821f7+':'+_0x16966b['id'],_0x16966b);FaxMessageEvents[_0x3dec('0x5')](_0x2821f7,_0x16966b);_0x5ca438(null);};}for(var e in events){if(events[_0x3dec('0x6')](e)){var event=events[e];FaxMessage[_0x3dec('0x7')](e,emitEvent(event));}}module[_0x3dec('0x8')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 60a7b36..236769f 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 _0x7e00=['FaxInteraction','findOne','FaxInteractionId','then','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./faxMessage.attributes','exports','define','FaxMessage','fax_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId'];(function(_0x44dc32,_0x3fca3b){var _0xa2f21=function(_0x19b7e7){while(--_0x19b7e7){_0x44dc32['push'](_0x44dc32['shift']());}};_0xa2f21(++_0x3fca3b);}(_0x7e00,0x6c));var _0x07e0=function(_0x230d46,_0x3d452c){_0x230d46=_0x230d46-0x0;var _0x49401c=_0x7e00[_0x230d46];return _0x49401c;};'use strict';var _=require(_0x07e0('0x0'));var util=require(_0x07e0('0x1'));var logger=require(_0x07e0('0x2'))(_0x07e0('0x3'));var moment=require(_0x07e0('0x4'));var BPromise=require(_0x07e0('0x5'));var rp=require(_0x07e0('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x07e0('0x7'));var config=require(_0x07e0('0x8'));var attributes=require(_0x07e0('0x9'));module[_0x07e0('0xa')]=function(_0xc4043,_0x1729cf){return _0xc4043[_0x07e0('0xb')](_0x07e0('0xc'),attributes,{'tableName':_0x07e0('0xd'),'paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0x07e0('0xe')],'type':_0x07e0('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x482417,_0x303c02,_0x345a1a){var _0x360869=_0xc4043[_0x07e0('0x10')];var _0x46c6f1=_0x482417[_0x07e0('0x11')]({'plain':!![]});if(_0x46c6f1[_0x07e0('0x12')][_0x07e0('0x13')]()==='in'||_0x46c6f1['direction'][_0x07e0('0x13')]()===_0x07e0('0x14')&&!_0x46c6f1[_0x07e0('0x15')]&&!_[_0x07e0('0x16')](_0x46c6f1[_0x07e0('0x17')])){_0x360869[_0x07e0('0x18')][_0x07e0('0x19')]({'where':{'id':_0x46c6f1[_0x07e0('0x1a')]}})[_0x07e0('0x1b')](function(_0x307101){if(_0x307101){_0x307101['update']({'lastMsgAt':_0x46c6f1[_0x07e0('0x1c')],'lastMsgDirection':_0x46c6f1[_0x07e0('0x12')][_0x07e0('0x13')]()});}})[_0x07e0('0x1d')](function(_0x372e97){console[_0x07e0('0x1e')](_0x372e97);});}_0x345a1a();}},'charset':_0x07e0('0x1f'),'collate':_0x07e0('0x20')});}; \ No newline at end of file +var _0xc923=['FaxInteractionId','then','update','createdAt','error','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./faxMessage.attributes','define','body','FULLTEXT','models','get','direction','secret','isNil','UserId'];(function(_0x330723,_0x8de382){var _0x60c546=function(_0xd6d3fe){while(--_0xd6d3fe){_0x330723['push'](_0x330723['shift']());}};_0x60c546(++_0x8de382);}(_0xc923,0x132));var _0x3c92=function(_0x3b7ee8,_0x2dbf6a){_0x3b7ee8=_0x3b7ee8-0x0;var _0x556d72=_0xc923[_0x3b7ee8];return _0x556d72;};'use strict';var _=require(_0x3c92('0x0'));var util=require(_0x3c92('0x1'));var logger=require(_0x3c92('0x2'))(_0x3c92('0x3'));var moment=require(_0x3c92('0x4'));var BPromise=require(_0x3c92('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3c92('0x6'));var rimraf=require(_0x3c92('0x7'));var config=require(_0x3c92('0x8'));var attributes=require(_0x3c92('0x9'));module['exports']=function(_0xb0613a,_0x1f05ef){return _0xb0613a[_0x3c92('0xa')]('FaxMessage',attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0x3c92('0xb')],'type':_0x3c92('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x44abfc,_0x4a004b,_0x2ededf){var _0x2eb2ee=_0xb0613a[_0x3c92('0xd')];var _0x1c577d=_0x44abfc[_0x3c92('0xe')]({'plain':!![]});if(_0x1c577d['direction']['toLowerCase']()==='in'||_0x1c577d[_0x3c92('0xf')]['toLowerCase']()==='out'&&!_0x1c577d[_0x3c92('0x10')]&&!_[_0x3c92('0x11')](_0x1c577d[_0x3c92('0x12')])){_0x2eb2ee['FaxInteraction']['findOne']({'where':{'id':_0x1c577d[_0x3c92('0x13')]}})[_0x3c92('0x14')](function(_0xe66f1e){if(_0xe66f1e){_0xe66f1e[_0x3c92('0x15')]({'lastMsgAt':_0x1c577d[_0x3c92('0x16')],'lastMsgDirection':_0x1c577d[_0x3c92('0xf')]['toLowerCase']()});}})['catch'](function(_0xf05033){console[_0x3c92('0x17')](_0xf05033);});}_0x2ededf();}},'charset':_0x3c92('0x18'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 727eed0..0f53606 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 _0x2dae=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','request','then','info','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FaxMessage,\x20%s,\x20%s','result','catch','CreateFaxMessage','FaxMessage','create','body','options','debug','UpdateFaxMessage','update','raw','attributes'];(function(_0xbb14db,_0x3ee8c6){var _0x36bed7=function(_0x16c478){while(--_0x16c478){_0xbb14db['push'](_0xbb14db['shift']());}};_0x36bed7(++_0x3ee8c6);}(_0x2dae,0xc3));var _0xe2da=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0x2dae[_0x21549c];return _0x426cbd;};'use strict';var _=require(_0xe2da('0x0'));var util=require('util');var moment=require(_0xe2da('0x1'));var BPromise=require(_0xe2da('0x2'));var rs=require(_0xe2da('0x3'));var fs=require('fs');var Redis=require(_0xe2da('0x4'));var db=require(_0xe2da('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe2da('0x6'))(_0xe2da('0x7'));var config=require(_0xe2da('0x8'));var jayson=require(_0xe2da('0x9'));var client=jayson['client'][_0xe2da('0xa')]({'port':0x232a});config[_0xe2da('0xb')]=_[_0xe2da('0xc')](config[_0xe2da('0xb')],{'host':_0xe2da('0xd'),'port':0x18eb});var socket=require(_0xe2da('0xe'))(new Redis(config[_0xe2da('0xb')]));require(_0xe2da('0xf'))[_0xe2da('0x10')](socket);function respondWithRpcPromise(_0x5a2fc5,_0x52e650,_0x3baaa8){return new BPromise(function(_0x104fb3,_0x17086c){return client[_0xe2da('0x11')](_0x5a2fc5,_0x3baaa8)[_0xe2da('0x12')](function(_0x1a29b9){logger[_0xe2da('0x13')]('FaxMessage,\x20%s,\x20%s',_0x52e650,_0xe2da('0x14'));logger['debug'](_0xe2da('0x15'),_0x52e650,_0xe2da('0x14'),JSON[_0xe2da('0x16')](_0x1a29b9));if(_0x1a29b9[_0xe2da('0x17')]){if(_0x1a29b9[_0xe2da('0x17')][_0xe2da('0x18')]===0x1f4){logger[_0xe2da('0x17')]('FaxMessage,\x20%s,\x20%s',_0x52e650,_0x1a29b9[_0xe2da('0x17')]['message']);return _0x17086c(_0x1a29b9['error'][_0xe2da('0x19')]);}logger[_0xe2da('0x17')](_0xe2da('0x1a'),_0x52e650,_0x1a29b9['error'][_0xe2da('0x19')]);return _0x104fb3(_0x1a29b9[_0xe2da('0x17')][_0xe2da('0x19')]);}else{logger[_0xe2da('0x13')]('FaxMessage,\x20%s,\x20%s',_0x52e650,_0xe2da('0x14'));_0x104fb3(_0x1a29b9[_0xe2da('0x1b')][_0xe2da('0x19')]);}})[_0xe2da('0x1c')](function(_0x329ffe){logger['error'](_0xe2da('0x1a'),_0x52e650,_0x329ffe);_0x17086c(_0x329ffe);});});}exports[_0xe2da('0x1d')]=function(_0x538d96){var _0x1a9324=this;return new Promise(function(_0x254b37,_0x332193){return db[_0xe2da('0x1e')][_0xe2da('0x1f')](_0x538d96[_0xe2da('0x20')],{'raw':_0x538d96['options']?_0x538d96[_0xe2da('0x21')]['raw']===undefined?!![]:![]:!![]})[_0xe2da('0x12')](function(_0x191d38){logger[_0xe2da('0x13')](_0xe2da('0x1d'),_0x538d96);logger[_0xe2da('0x22')](_0xe2da('0x1d'),_0x538d96,JSON[_0xe2da('0x16')](_0x191d38));_0x254b37(_0x191d38);})[_0xe2da('0x1c')](function(_0x5a08d6){logger[_0xe2da('0x17')](_0xe2da('0x1d'),_0x5a08d6[_0xe2da('0x19')],_0x538d96);_0x332193(_0x1a9324[_0xe2da('0x17')](0x1f4,_0x5a08d6[_0xe2da('0x19')]));});});};exports[_0xe2da('0x23')]=function(_0x124d93){var _0x56c37e=this;return new Promise(function(_0x2adc49,_0x3e23d7){return db[_0xe2da('0x1e')][_0xe2da('0x24')](_0x124d93[_0xe2da('0x20')],{'raw':_0x124d93[_0xe2da('0x21')]?_0x124d93[_0xe2da('0x21')][_0xe2da('0x25')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x124d93['options']?_0x124d93['options']['where']||null:null,'attributes':_0x124d93[_0xe2da('0x21')]?_0x124d93[_0xe2da('0x21')][_0xe2da('0x26')]||null:null,'limit':_0x124d93[_0xe2da('0x21')]?_0x124d93['options']['limit']||null:null})[_0xe2da('0x12')](function(_0x1ec8ca){logger[_0xe2da('0x13')](_0xe2da('0x23'),_0x124d93);logger[_0xe2da('0x22')](_0xe2da('0x23'),_0x124d93,JSON[_0xe2da('0x16')](_0x1ec8ca));_0x2adc49(_0x1ec8ca);})[_0xe2da('0x1c')](function(_0x461610){logger['error']('UpdateFaxMessage',_0x461610[_0xe2da('0x19')],_0x124d93);_0x3e23d7(_0x56c37e[_0xe2da('0x17')](0x1f4,_0x461610[_0xe2da('0x19')]));});});}; \ No newline at end of file +var _0x34e8=['request\x20sent','result','catch','CreateFaxMessage','FaxMessage','create','options','raw','update','body','attributes','limit','UpdateFaxMessage','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./faxMessage.socket','register','request','then','info','FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x4f4e79,_0x22ba0a){var _0x170baf=function(_0x4f62dd){while(--_0x4f62dd){_0x4f4e79['push'](_0x4f4e79['shift']());}};_0x170baf(++_0x22ba0a);}(_0x34e8,0x12c));var _0x834e=function(_0x3ea149,_0xdb2cfc){_0x3ea149=_0x3ea149-0x0;var _0x365280=_0x34e8[_0x3ea149];return _0x365280;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var moment=require(_0x834e('0x2'));var BPromise=require(_0x834e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x834e('0x4'));var db=require(_0x834e('0x5'))['db'];var utils=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));var config=require(_0x834e('0x9'));var jayson=require(_0x834e('0xa'));var client=jayson['client'][_0x834e('0xb')]({'port':0x232a});config['redis']=_[_0x834e('0xc')](config[_0x834e('0xd')],{'host':_0x834e('0xe'),'port':0x18eb});var socket=require(_0x834e('0xf'))(new Redis(config[_0x834e('0xd')]));require(_0x834e('0x10'))[_0x834e('0x11')](socket);function respondWithRpcPromise(_0x1af45a,_0x3bdda9,_0x186b3b){return new BPromise(function(_0x1e41fe,_0x36e124){return client[_0x834e('0x12')](_0x1af45a,_0x186b3b)[_0x834e('0x13')](function(_0x293514){logger[_0x834e('0x14')](_0x834e('0x15'),_0x3bdda9,'request\x20sent');logger[_0x834e('0x16')](_0x834e('0x17'),_0x3bdda9,'request\x20sent',JSON[_0x834e('0x18')](_0x293514));if(_0x293514[_0x834e('0x19')]){if(_0x293514[_0x834e('0x19')][_0x834e('0x1a')]===0x1f4){logger['error'](_0x834e('0x15'),_0x3bdda9,_0x293514[_0x834e('0x19')]['message']);return _0x36e124(_0x293514[_0x834e('0x19')]['message']);}logger[_0x834e('0x19')](_0x834e('0x15'),_0x3bdda9,_0x293514['error'][_0x834e('0x1b')]);return _0x1e41fe(_0x293514[_0x834e('0x19')][_0x834e('0x1b')]);}else{logger['info'](_0x834e('0x15'),_0x3bdda9,_0x834e('0x1c'));_0x1e41fe(_0x293514[_0x834e('0x1d')][_0x834e('0x1b')]);}})[_0x834e('0x1e')](function(_0x254677){logger[_0x834e('0x19')]('FaxMessage,\x20%s,\x20%s',_0x3bdda9,_0x254677);_0x36e124(_0x254677);});});}exports[_0x834e('0x1f')]=function(_0x1fd2c6){var _0x113ff4=this;return new Promise(function(_0x325a99,_0x4ab05d){return db[_0x834e('0x20')][_0x834e('0x21')](_0x1fd2c6['body'],{'raw':_0x1fd2c6[_0x834e('0x22')]?_0x1fd2c6[_0x834e('0x22')][_0x834e('0x23')]===undefined?!![]:![]:!![]})['then'](function(_0x4e3f48){logger[_0x834e('0x14')](_0x834e('0x1f'),_0x1fd2c6);logger['debug'](_0x834e('0x1f'),_0x1fd2c6,JSON[_0x834e('0x18')](_0x4e3f48));_0x325a99(_0x4e3f48);})['catch'](function(_0x3bc4f7){logger[_0x834e('0x19')](_0x834e('0x1f'),_0x3bc4f7['message'],_0x1fd2c6);_0x4ab05d(_0x113ff4[_0x834e('0x19')](0x1f4,_0x3bc4f7[_0x834e('0x1b')]));});});};exports['UpdateFaxMessage']=function(_0x5bef62){var _0x1e713a=this;return new Promise(function(_0x508a1d,_0x2826ec){return db[_0x834e('0x20')][_0x834e('0x24')](_0x5bef62[_0x834e('0x25')],{'raw':_0x5bef62[_0x834e('0x22')]?_0x5bef62[_0x834e('0x22')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5bef62['options']?_0x5bef62['options']['where']||null:null,'attributes':_0x5bef62[_0x834e('0x22')]?_0x5bef62[_0x834e('0x22')][_0x834e('0x26')]||null:null,'limit':_0x5bef62['options']?_0x5bef62[_0x834e('0x22')][_0x834e('0x27')]||null:null})[_0x834e('0x13')](function(_0x1e026a){logger[_0x834e('0x14')](_0x834e('0x28'),_0x5bef62);logger[_0x834e('0x16')](_0x834e('0x28'),_0x5bef62,JSON[_0x834e('0x18')](_0x1e026a));_0x508a1d(_0x1e026a);})['catch'](function(_0xef9ec2){logger['error'](_0x834e('0x28'),_0xef9ec2[_0x834e('0x1b')],_0x5bef62);_0x2826ec(_0x1e713a[_0x834e('0x19')](0x1f4,_0xef9ec2[_0x834e('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index ab98819..189e7b8 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 _0xe095=['./faxMessage.events','remove','update','emit','register','faxMessage:'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0xe095,0xf0));var _0x5e09=function(_0x557703,_0x23e92e){_0x557703=_0x557703-0x0;var _0x4f7ae9=_0xe095[_0x557703];return _0x4f7ae9;};'use strict';var FaxMessageEvents=require(_0x5e09('0x0'));var events=['save',_0x5e09('0x1'),_0x5e09('0x2')];function createListener(_0x493f5d,_0x558d6f){return function(_0x3443c9){_0x558d6f[_0x5e09('0x3')](_0x493f5d,_0x3443c9);};}function removeListener(_0x209dc4,_0x441f18){return function(){FaxMessageEvents['removeListener'](_0x209dc4,_0x441f18);};}exports[_0x5e09('0x4')]=function(_0x2658ae){for(var _0x275142=0x0,_0x17abd5=events['length'];_0x275142<_0x17abd5;_0x275142++){var _0x3eff6b=events[_0x275142];var _0x3053d5=createListener(_0x5e09('0x5')+_0x3eff6b,_0x2658ae);FaxMessageEvents['on'](_0x3eff6b,_0x3053d5);}}; \ No newline at end of file +var _0x4d04=['update','emit','removeListener','length','./faxMessage.events','save','remove'];(function(_0x1109eb,_0x68f359){var _0x120d4e=function(_0x570cff){while(--_0x570cff){_0x1109eb['push'](_0x1109eb['shift']());}};_0x120d4e(++_0x68f359);}(_0x4d04,0x1bd));var _0x44d0=function(_0x442599,_0x4509a1){_0x442599=_0x442599-0x0;var _0xe7b6a6=_0x4d04[_0x442599];return _0xe7b6a6;};'use strict';var FaxMessageEvents=require(_0x44d0('0x0'));var events=[_0x44d0('0x1'),_0x44d0('0x2'),_0x44d0('0x3')];function createListener(_0x5682b2,_0x56bc97){return function(_0x3aab3d){_0x56bc97[_0x44d0('0x4')](_0x5682b2,_0x3aab3d);};}function removeListener(_0x2d4066,_0x187bc9){return function(){FaxMessageEvents[_0x44d0('0x5')](_0x2d4066,_0x187bc9);};}exports['register']=function(_0x43fc61){for(var _0x47a22b=0x0,_0x587af9=events[_0x44d0('0x6')];_0x47a22b<_0x587af9;_0x47a22b++){var _0x386a33=events[_0x47a22b];var _0x510615=createListener('faxMessage:'+_0x386a33,_0x43fc61);FaxMessageEvents['on'](_0x386a33,_0x510615);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 7fd0539..4a16d90 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 _0x3f8c=['/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','path','connect-timeout','express','Router','get','isAuthenticated','index','/describe','/:id','show','/:id/download','post','tracked','fax','create','put'];(function(_0x304efc,_0x2c6a48){var _0x34e2b9=function(_0x327c24){while(--_0x327c24){_0x304efc['push'](_0x304efc['shift']());}};_0x34e2b9(++_0x2c6a48);}(_0x3f8c,0x104));var _0xc3f8=function(_0x5d55db,_0x5eb91c){_0x5d55db=_0x5d55db-0x0;var _0x199c5c=_0x3f8c[_0x5d55db];return _0x199c5c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc3f8('0x0'));var timeout=require(_0xc3f8('0x1'));var express=require(_0xc3f8('0x2'));var router=express[_0xc3f8('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./faxMessage.controller');router[_0xc3f8('0x4')]('/',auth[_0xc3f8('0x5')](),controller[_0xc3f8('0x6')]);router[_0xc3f8('0x4')](_0xc3f8('0x7'),auth[_0xc3f8('0x5')](),controller['describe']);router[_0xc3f8('0x4')](_0xc3f8('0x8'),auth[_0xc3f8('0x5')](),controller[_0xc3f8('0x9')]);router[_0xc3f8('0x4')](_0xc3f8('0xa'),auth[_0xc3f8('0x5')](),controller['download']);router[_0xc3f8('0xb')]('/',auth[_0xc3f8('0x5')](),interaction[_0xc3f8('0xc')](_0xc3f8('0xd'),'faxmessage:create'),controller[_0xc3f8('0xe')]);router[_0xc3f8('0xf')](_0xc3f8('0x8'),auth[_0xc3f8('0x5')](),controller['update']);router[_0xc3f8('0xf')](_0xc3f8('0x10'),auth[_0xc3f8('0x5')](),controller[_0xc3f8('0x11')]);router[_0xc3f8('0xf')](_0xc3f8('0x12'),auth[_0xc3f8('0x5')](),controller[_0xc3f8('0x13')]);router[_0xc3f8('0x14')](_0xc3f8('0x8'),auth[_0xc3f8('0x5')](),controller[_0xc3f8('0x15')]);module[_0xc3f8('0x16')]=router; \ No newline at end of file +var _0xd8b0=['tracked','faxmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','/:id/download','download','post'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_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('./faxMessage.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('0x9')](_0x0d8b('0xd'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')]('/',auth['isAuthenticated'](),interaction[_0x0d8b('0x10')]('fax',_0x0d8b('0x11')),controller[_0x0d8b('0x12')]);router[_0x0d8b('0x13')](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x14')]);router[_0x0d8b('0x13')](_0x0d8b('0x15'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x16')]);router[_0x0d8b('0x13')](_0x0d8b('0x17'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x18')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x19')]);module[_0x0d8b('0x1a')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 3250dc5..b4d2f97 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 _0xecc5=['INTEGER','ENUM','rrmemory','roundrobin','sequelize','exports','STRING','name'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xecc5,0x16c));var _0x5ecc=function(_0x205fb4,_0x3aa00b){_0x205fb4=_0x205fb4-0x0;var _0x1796da=_0xecc5[_0x205fb4];return _0x1796da;};'use strict';var Sequelize=require(_0x5ecc('0x0'));module[_0x5ecc('0x1')]={'name':{'type':Sequelize[_0x5ecc('0x2')],'unique':_0x5ecc('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x5ecc('0x2')]},'timeout':{'type':Sequelize[_0x5ecc('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x5ecc('0x5')](_0x5ecc('0x6'),'beepall',_0x5ecc('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x5ecc('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x2581=['name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING'];(function(_0x1e4d67,_0xeb3c00){var _0x5bcd06=function(_0x46ee2f){while(--_0x46ee2f){_0x1e4d67['push'](_0x1e4d67['shift']());}};_0x5bcd06(++_0xeb3c00);}(_0x2581,0x72));var _0x1258=function(_0x21332b,_0x40a678){_0x21332b=_0x21332b-0x0;var _0x21c46c=_0x2581[_0x21332b];return _0x21c46c;};'use strict';var Sequelize=require(_0x1258('0x0'));module[_0x1258('0x1')]={'name':{'type':Sequelize[_0x1258('0x2')],'unique':_0x1258('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x1258('0x2')]},'timeout':{'type':Sequelize[_0x1258('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1258('0x5')](_0x1258('0x6'),_0x1258('0x7'),_0x1258('0x8')),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'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 6707314..f744e16 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 _0x46e1=['show','params','model','keys','intersection','fields','attributes','length','merge','options','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserFaxQueue','filters','hasOwnProperty','nolimit','order','sort','pick','filter','User','findAndCountAll','UserId','updatedAt','rows','%s/%s','SIP','faxPause','createdAt','getTeams','Team','addTeams','ids','online','voicePause','interface','flatMap','each','findOrCreate','forEach','emit','userFaxQueue:save','select','field','tq.TeamId','from','team_has_fax_queues','join','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','Agents','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','all','compact','value','removeTeams','isEmpty','removeAgents','addAgents','omit','isArray','userFaxQueue:remove','getAgents','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','update','then','destroy','FaxQueues','UserProfileResource','name','send','index','map','rawAttributes','type','getOptions','where','FaxQueue','include','query','findAll'];(function(_0x386a30,_0x46eada){var _0x2313d2=function(_0x1a57f7){while(--_0x1a57f7){_0x386a30['push'](_0x386a30['shift']());}};_0x2313d2(++_0x46eada);}(_0x46e1,0x155));var _0x146e=function(_0x5db308,_0x3aa3eb){_0x5db308=_0x5db308-0x0;var _0x170d9d=_0x46e1[_0x5db308];return _0x170d9d;};'use strict';var BPromise=require(_0x146e('0x0'));var util=require(_0x146e('0x1'));var _=require(_0x146e('0x2'));var squel=require(_0x146e('0x3'));var Redis=require(_0x146e('0x4'));var qs=require(_0x146e('0x5'));var logger=require(_0x146e('0x6'))(_0x146e('0x7'));var config=require(_0x146e('0x8'));var db=require(_0x146e('0x9'))['db'];config['redis']=_[_0x146e('0xa')](config[_0x146e('0xb')],{'host':_0x146e('0xc'),'port':0x18eb});var socket=require(_0x146e('0xd'))(new Redis(config[_0x146e('0xb')]));require(_0x146e('0xe'))[_0x146e('0xf')](socket);function respondWithStatusCode(_0x5f33c0,_0x4a6929){_0x4a6929=_0x4a6929||0xcc;return function(_0x4c15f9){if(_0x4c15f9){return _0x5f33c0[_0x146e('0x10')](_0x4a6929);}return _0x5f33c0[_0x146e('0x11')](_0x4a6929)[_0x146e('0x12')]();};}function respondWithResult(_0x453b5a,_0x15cea1){_0x15cea1=_0x15cea1||0xc8;return function(_0x335df8){if(_0x335df8){return _0x453b5a['status'](_0x15cea1)['json'](_0x335df8);}};}function respondWithFilteredResult(_0x209e62,_0x2226f6){return function(_0x29d111){if(_0x29d111){var _0x1a567a=typeof _0x2226f6[_0x146e('0x13')]===_0x146e('0x14')&&typeof _0x2226f6[_0x146e('0x15')]===_0x146e('0x14');var _0x524209=_0x29d111['count'];var _0x2b925a=_0x1a567a?0x0:_0x2226f6[_0x146e('0x13')];var _0x18e9bc=_0x1a567a?_0x29d111[_0x146e('0x16')]:_0x2226f6[_0x146e('0x13')]+_0x2226f6[_0x146e('0x15')];var _0x469b94;if(_0x18e9bc>=_0x524209){_0x18e9bc=_0x524209;_0x469b94=0xc8;}else{_0x469b94=0xce;}_0x209e62[_0x146e('0x11')](_0x469b94);return _0x209e62[_0x146e('0x17')](_0x146e('0x18'),_0x2b925a+'-'+_0x18e9bc+'/'+_0x524209)[_0x146e('0x19')](_0x29d111);}return null;};}function saveUpdates(_0x55fddc){return function(_0xcfd5f6){if(_0xcfd5f6){return _0xcfd5f6[_0x146e('0x1a')](_0x55fddc)[_0x146e('0x1b')](function(_0x88e062){return _0x88e062;});}return null;};}function removeEntity(_0x2286f6){return function(_0x431a60){if(_0x431a60){return _0x431a60[_0x146e('0x1c')]()['then'](function(){var _0x2a8dd2=_0x431a60['get']({'plain':!![]});var _0x109cfe=_0x146e('0x1d');return db[_0x146e('0x1e')]['destroy']({'where':{'type':_0x109cfe,'resourceId':_0x2a8dd2['id']}})[_0x146e('0x1b')](function(){return _0x431a60;});})['then'](function(){_0x2286f6[_0x146e('0x11')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3df09c){return function(_0x474475){if(!_0x474475){_0x3df09c['sendStatus'](0x194);}return _0x474475;};}function handleError(_0x47c6d1,_0x4eca1a){_0x4eca1a=_0x4eca1a||0x1f4;return function(_0x4b72e9){logger['error'](_0x4b72e9['stack']);if(_0x4b72e9[_0x146e('0x1f')]){delete _0x4b72e9['name'];}_0x47c6d1[_0x146e('0x11')](_0x4eca1a)[_0x146e('0x20')](_0x4b72e9);};}exports[_0x146e('0x21')]=function(_0x37e774,_0x44345a){var _0xed7b99={};var _0x260465={'count':0x0,'rows':[]};var _0x4cc850=_[_0x146e('0x22')](db['FaxQueue'][_0x146e('0x23')],function(_0x4afb82){return{'name':_0x4afb82['fieldName'],'type':_0x4afb82[_0x146e('0x24')]['key']};});_0xed7b99=qs[_0x146e('0x25')](_0x4cc850,_0x37e774);var _0x43e3b5={'where':_0xed7b99[_0x146e('0x26')]};return db[_0x146e('0x27')][_0x146e('0x16')](_0x43e3b5)['then'](function(_0x1ce964){_0x260465[_0x146e('0x16')]=_0x1ce964;_0xed7b99[_0x146e('0x28')]=qs[_0x146e('0x28')](_0x37e774[_0x146e('0x29')]);return db[_0x146e('0x27')][_0x146e('0x2a')](_0xed7b99);})[_0x146e('0x1b')](function(_0x502324){_0x260465['rows']=_0x502324;return _0x260465;})[_0x146e('0x1b')](respondWithFilteredResult(_0x44345a,_0xed7b99))['catch'](handleError(_0x44345a,null));};exports[_0x146e('0x2b')]=function(_0x5345fb,_0x52b279){var _0x33ded4={'raw':!![],'where':{'id':_0x5345fb[_0x146e('0x2c')]['id']}},_0x1ed5c7={};_0x1ed5c7[_0x146e('0x2d')]=_[_0x146e('0x2e')](db[_0x146e('0x27')]['rawAttributes']);_0x1ed5c7[_0x146e('0x29')]=_['keys'](_0x5345fb[_0x146e('0x29')]);_0x1ed5c7['filters']=_[_0x146e('0x2f')](_0x1ed5c7[_0x146e('0x2d')],_0x1ed5c7[_0x146e('0x29')]);_0x33ded4['attributes']=_[_0x146e('0x2f')](_0x1ed5c7[_0x146e('0x2d')],qs['fields'](_0x5345fb[_0x146e('0x29')][_0x146e('0x30')]));_0x33ded4[_0x146e('0x31')]=_0x33ded4[_0x146e('0x31')][_0x146e('0x32')]?_0x33ded4[_0x146e('0x31')]:_0x1ed5c7[_0x146e('0x2d')];if(_0x5345fb['query']['includeAll']){_0x33ded4[_0x146e('0x28')]=[{'all':!![]}];}_0x33ded4=_[_0x146e('0x33')]({},_0x33ded4,_0x5345fb[_0x146e('0x34')]);return db[_0x146e('0x27')][_0x146e('0x35')](_0x33ded4)[_0x146e('0x1b')](handleEntityNotFound(_0x52b279,null))['then'](respondWithResult(_0x52b279,null))[_0x146e('0x36')](handleError(_0x52b279,null));};exports['create']=function(_0x14217b,_0xbdb2aa){return db[_0x146e('0x27')][_0x146e('0x37')](_0x14217b[_0x146e('0x38')],{})[_0x146e('0x1b')](function(_0x48e2f3){var _0x4a9616=_0x14217b['user']['get']({'plain':!![]});if(!_0x4a9616)throw new Error(_0x146e('0x39'));if(_0x4a9616[_0x146e('0x3a')]===_0x146e('0x3b')){var _0x45be48=_0x48e2f3[_0x146e('0x3c')]({'plain':!![]});var _0xc33b27=_0x146e('0x1d');return db[_0x146e('0x3d')][_0x146e('0x35')]({'where':{'name':_0xc33b27,'userProfileId':_0x4a9616[_0x146e('0x3e')]},'raw':!![]})['then'](function(_0x393d96){if(_0x393d96&&_0x393d96[_0x146e('0x3f')]===0x0){return db[_0x146e('0x1e')][_0x146e('0x37')]({'name':_0x45be48[_0x146e('0x1f')],'resourceId':_0x45be48['id'],'type':_0x393d96['name'],'sectionId':_0x393d96['id']},{})[_0x146e('0x1b')](function(){return _0x48e2f3;});}else{return _0x48e2f3;}})[_0x146e('0x36')](function(_0x199d6a){logger[_0x146e('0x40')](_0x146e('0x41'),_0x199d6a);throw _0x199d6a;});}return _0x48e2f3;})[_0x146e('0x1b')](respondWithResult(_0xbdb2aa,0xc9))['catch'](handleError(_0xbdb2aa,null));};exports[_0x146e('0x1a')]=function(_0x43fe18,_0x1a55e7){if(_0x43fe18['body']['id']){delete _0x43fe18[_0x146e('0x38')]['id'];}return db[_0x146e('0x27')]['find']({'where':{'id':_0x43fe18['params']['id']}})['then'](handleEntityNotFound(_0x1a55e7,null))[_0x146e('0x1b')](saveUpdates(_0x43fe18[_0x146e('0x38')],null))[_0x146e('0x1b')](respondWithResult(_0x1a55e7,null))[_0x146e('0x36')](handleError(_0x1a55e7,null));};exports['destroy']=function(_0x3e085e,_0x385410){return db[_0x146e('0x27')][_0x146e('0x35')]({'where':{'id':_0x3e085e[_0x146e('0x2c')]['id']}})['then'](handleEntityNotFound(_0x385410,null))[_0x146e('0x1b')](removeEntity(_0x385410,null))['catch'](handleError(_0x385410,null));};exports[_0x146e('0x42')]=function(_0x1476c1,_0xf50315){return db[_0x146e('0x27')]['describe']()[_0x146e('0x1b')](respondWithResult(_0xf50315,null))['catch'](handleError(_0xf50315,null));};exports[_0x146e('0x43')]=function(_0x212058,_0x18e7bc){var _0xc73063={'raw':!![],'where':{}},_0x18a443={},_0x295b80;return db['FaxQueue'][_0x146e('0x44')]({'where':{'id':_0x212058[_0x146e('0x2c')]['id']}})['then'](handleEntityNotFound(_0x18e7bc,null))[_0x146e('0x1b')](function(_0x11968c){if(_0x11968c){_0x295b80=_0x11968c[_0x146e('0x3c')]({'plain':!![]});_0x18a443[_0x146e('0x2d')]=_[_0x146e('0x2e')](db[_0x146e('0x45')]['rawAttributes']);_0x18a443[_0x146e('0x29')]=_[_0x146e('0x2e')](_0x212058[_0x146e('0x29')]);_0x18a443[_0x146e('0x46')]=_[_0x146e('0x2f')](_0x18a443[_0x146e('0x2d')],_0x18a443[_0x146e('0x29')]);_0xc73063[_0x146e('0x31')]=_['intersection'](_0x18a443[_0x146e('0x2d')],qs[_0x146e('0x30')](_0x212058['query'][_0x146e('0x30')]));_0xc73063[_0x146e('0x31')]=_0xc73063[_0x146e('0x31')][_0x146e('0x32')]?_0xc73063['attributes']:_0x18a443[_0x146e('0x2d')];if(!_0x212058[_0x146e('0x29')][_0x146e('0x47')](_0x146e('0x48'))){_0xc73063[_0x146e('0x15')]=qs[_0x146e('0x15')](_0x212058['query'][_0x146e('0x15')]);_0xc73063[_0x146e('0x13')]=qs[_0x146e('0x13')](_0x212058[_0x146e('0x29')]['offset']);}_0xc73063[_0x146e('0x49')]=qs[_0x146e('0x4a')](_0x212058[_0x146e('0x29')][_0x146e('0x4a')]);_0xc73063[_0x146e('0x26')]=qs['filters'](_[_0x146e('0x4b')](_0x212058[_0x146e('0x29')],_0x18a443[_0x146e('0x46')]));_0xc73063[_0x146e('0x26')]['FaxQueueId']=_0x11968c['id'];if(_0x212058[_0x146e('0x29')][_0x146e('0x4c')]){_0xc73063['where']=_[_0x146e('0x33')](_0xc73063[_0x146e('0x26')],{'$or':_[_0x146e('0x22')](_0xc73063[_0x146e('0x31')],function(_0x5e3930){var _0x182dc0={};_0x182dc0[_0x5e3930]={'$like':'%'+_0x212058['query'][_0x146e('0x4c')]+'%'};return _0x182dc0;})});}_0xc73063=_[_0x146e('0x33')]({},_0xc73063,_0x212058[_0x146e('0x34')]);return db['UserFaxQueue']['findAll'](_0xc73063);}})[_0x146e('0x1b')](function(_0xc31f04){if(_0xc31f04){return db[_0x146e('0x4d')][_0x146e('0x4e')]({'where':{'id':_[_0x146e('0x22')](_0xc31f04,_0x146e('0x4f')),'role':'agent'},'attributes':['id',_0x146e('0x1f'),'faxPause',_0x146e('0x50'),'createdAt']});}})['then'](function(_0x4fc698){if(_0x4fc698){return{'count':_0x4fc698[_0x146e('0x16')],'rows':_[_0x146e('0x22')](_0x4fc698[_0x146e('0x51')],function(_0x1e5c86){return{'membername':_0x1e5c86[_0x146e('0x1f')],'UserId':_0x1e5c86['id'],'queue_name':_0x295b80[_0x146e('0x1f')],'FaxQueueId':_0x295b80['id'],'interface':util['format'](_0x146e('0x52'),_0x146e('0x53'),_0x1e5c86[_0x146e('0x1f')]),'penalty':0x0,'paused':_0x1e5c86[_0x146e('0x54')],'createdAt':_0x1e5c86[_0x146e('0x55')],'updatedAt':_0x1e5c86['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x18e7bc,_0xc73063))['catch'](handleError(_0x18e7bc,null));};exports[_0x146e('0x56')]=function(_0x2d8ce5,_0x2a536c){var _0x1af583={};var _0x267080={};var _0x42e536;var _0x24eb19;return db[_0x146e('0x27')][_0x146e('0x44')]({'where':{'id':_0x2d8ce5[_0x146e('0x2c')]['id']}})['then'](handleEntityNotFound(_0x2a536c,null))[_0x146e('0x1b')](function(_0x121920){if(_0x121920){_0x42e536=_0x121920;_0x267080['model']=_[_0x146e('0x2e')](db[_0x146e('0x57')][_0x146e('0x23')]);_0x267080['query']=_[_0x146e('0x2e')](_0x2d8ce5[_0x146e('0x29')]);_0x267080[_0x146e('0x46')]=_[_0x146e('0x2f')](_0x267080[_0x146e('0x2d')],_0x267080[_0x146e('0x29')]);_0x1af583[_0x146e('0x31')]=_[_0x146e('0x2f')](_0x267080['model'],qs['fields'](_0x2d8ce5['query'][_0x146e('0x30')]));_0x1af583[_0x146e('0x31')]=_0x1af583[_0x146e('0x31')]['length']?_0x1af583['attributes']:_0x267080[_0x146e('0x2d')];_0x1af583[_0x146e('0x49')]=qs[_0x146e('0x4a')](_0x2d8ce5[_0x146e('0x29')][_0x146e('0x4a')]);_0x1af583[_0x146e('0x26')]=qs['filters'](_['pick'](_0x2d8ce5['query'],_0x267080[_0x146e('0x46')]));if(_0x2d8ce5[_0x146e('0x29')][_0x146e('0x4c')]){_0x1af583[_0x146e('0x26')]=_['merge'](_0x1af583[_0x146e('0x26')],{'$or':_[_0x146e('0x22')](_0x1af583['attributes'],function(_0x79d72a){var _0x3de993={};_0x3de993[_0x79d72a]={'$like':'%'+_0x2d8ce5[_0x146e('0x29')]['filter']+'%'};return _0x3de993;})});}_0x1af583=_[_0x146e('0x33')]({},_0x1af583,_0x2d8ce5[_0x146e('0x34')]);return _0x42e536[_0x146e('0x56')](_0x1af583);}})['then'](function(_0x311dd8){if(_0x311dd8){_0x24eb19=_0x311dd8[_0x146e('0x32')];if(!_0x2d8ce5[_0x146e('0x29')][_0x146e('0x47')](_0x146e('0x48'))){_0x1af583[_0x146e('0x15')]=qs[_0x146e('0x15')](_0x2d8ce5[_0x146e('0x29')][_0x146e('0x15')]);_0x1af583[_0x146e('0x13')]=qs[_0x146e('0x13')](_0x2d8ce5[_0x146e('0x29')]['offset']);}return _0x42e536[_0x146e('0x56')](_0x1af583);}})['then'](function(_0x3f7ae5){if(_0x3f7ae5){return _0x3f7ae5?{'count':_0x24eb19,'rows':_0x3f7ae5}:null;}})[_0x146e('0x1b')](respondWithResult(_0x2a536c,null))[_0x146e('0x36')](handleError(_0x2a536c,null));};exports[_0x146e('0x58')]=function(_0x2925b9,_0x2c824d){var _0x237623=_0x2925b9[_0x146e('0x38')][_0x146e('0x59')];return db[_0x146e('0x57')]['findAll']({'where':{'id':_0x237623},'attributes':['id'],'include':[{'model':db[_0x146e('0x4d')],'as':'Agents','attributes':['id',_0x146e('0x1f'),_0x146e('0x5a'),_0x146e('0x5b'),_0x146e('0x5c')],'raw':!![]}]})['then'](function(_0x4c9a74){if(_0x4c9a74){var _0x4b2bae=_[_0x146e('0x5d')](_0x4c9a74,function(_0x2bbdf4){var _0x756c5d=_0x2bbdf4[_0x146e('0x3c')]({'plain':!![]});return _0x756c5d['Agents'];});return db[_0x146e('0x27')]['find']({'where':{'id':_0x2925b9['params']['id']}})[_0x146e('0x1b')](function(_0x1ed62b){return db['sequelize']['transaction'](function(_0x3ef7a5){return _0x1ed62b[_0x146e('0x58')](_0x237623,{'transaction':_0x3ef7a5})[_0x146e('0x1b')](function(){return BPromise[_0x146e('0x5e')](_0x4b2bae,function(_0x33e9b9){return db[_0x146e('0x45')][_0x146e('0x5f')]({'where':{'UserId':_0x33e9b9['id'],'FaxQueueId':_0x2925b9[_0x146e('0x2c')]['id']},'transaction':_0x3ef7a5});});})['then'](function(){_0x4b2bae[_0x146e('0x60')](function(_0x2baeff){socket[_0x146e('0x61')](_0x146e('0x62'),{'UserId':_0x2baeff['id'],'FaxQueueId':_0x1ed62b['id']});});});});});}})['then'](respondWithStatusCode(_0x2c824d,null))[_0x146e('0x36')](handleError(_0x2c824d,null));};exports['removeTeams']=function(_0x3e0f92,_0x4612f7){return db[_0x146e('0x57')][_0x146e('0x2a')]({'where':{'id':_0x3e0f92[_0x146e('0x29')][_0x146e('0x59')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x146e('0x1b')](handleEntityNotFound(_0x4612f7,null))['then'](function(_0x2ac690){var _0xe1debc=_[_0x146e('0x22')](_0x2ac690,'id');var _0x45a25f=[];var _0x481d8f=[];var _0x520e88=squel[_0x146e('0x63')]();_0x520e88[_0x146e('0x64')](_0x146e('0x65'))[_0x146e('0x66')](_0x146e('0x67'),'tq')[_0x146e('0x68')]('user_has_teams','ut',_0x146e('0x69'))[_0x146e('0x26')](_0x146e('0x6a'),_0x3e0f92['params']['id']);for(var _0x2b0733=0x0;_0x2b0733<_0x2ac690[_0x146e('0x32')];_0x2b0733+=0x1){let _0x5dd283=_0x2ac690[_0x2b0733];for(var _0x298476=0x0;_0x298476<_0x5dd283[_0x146e('0x6b')][_0x146e('0x32')];_0x298476+=0x1){let _0x2f9b87=_0x5dd283[_0x146e('0x6b')][_0x298476];var _0x21f138=_0x520e88['clone']();_0x21f138[_0x146e('0x26')](_0x146e('0x6c'),_0x2f9b87['id']);_0x481d8f[_0x146e('0x6d')](db[_0x146e('0x6e')]['query'](_0x21f138[_0x146e('0x6f')](),{'type':db[_0x146e('0x6e')][_0x146e('0x70')][_0x146e('0x71')]})[_0x146e('0x1b')](function(_0x23476b){if(_0x23476b[_0x146e('0x32')]===0x1){return _0x2f9b87['id'];}else{var _0x453189=_[_0x146e('0x72')](_['map'](_0x23476b,_0x146e('0x73')),function(_0x48dbeb){return _[_0x146e('0x74')](_0xe1debc,_0x48dbeb);});if(_0x453189){return _0x2f9b87['id'];}}}));}}return BPromise[_0x146e('0x75')](_0x481d8f)[_0x146e('0x1b')](function(_0x460a4f){_0x45a25f=_(_0x45a25f)['union'](_0x460a4f)[_0x146e('0x76')]()[_0x146e('0x77')]();return db[_0x146e('0x27')][_0x146e('0x35')]({'where':{'id':_0x3e0f92['params']['id']}})['then'](function(_0x2916f0){return db['sequelize']['transaction'](function(_0x37b108){return _0x2916f0[_0x146e('0x78')](_0x3e0f92[_0x146e('0x29')][_0x146e('0x59')],{'transaction':_0x37b108})['then'](function(){if(!_[_0x146e('0x79')](_0x45a25f)){return _0x2916f0[_0x146e('0x7a')](_0x45a25f,{'transaction':_0x37b108});}})[_0x146e('0x1b')](function(){_0x45a25f['forEach'](function(_0x92497f){socket[_0x146e('0x61')]('userFaxQueue:remove',{'UserId':_0x92497f,'FaxQueueId':_0x2916f0['id']});});});});});});})[_0x146e('0x1b')](respondWithStatusCode(_0x4612f7,null))['catch'](handleError(_0x4612f7,null));};exports['addAgents']=function(_0xc9363d,_0x5cbf7f){return db[_0x146e('0x27')]['find']({'where':{'id':_0xc9363d[_0x146e('0x2c')]['id']}})['then'](handleEntityNotFound(_0x5cbf7f,null))[_0x146e('0x1b')](function(_0xf08ae7){if(_0xf08ae7){return _0xf08ae7[_0x146e('0x7b')](_0xc9363d[_0x146e('0x38')]['ids'],_[_0x146e('0x7c')](_0xc9363d[_0x146e('0x38')],[_0x146e('0x59'),'id'])||{})['spread'](function(_0x14d7af){for(var _0x319e39=0x0;_0x319e39<_0xc9363d[_0x146e('0x38')][_0x146e('0x59')][_0x146e('0x32')];_0x319e39+=0x1){socket[_0x146e('0x61')](_0x146e('0x62'),{'UserId':Number(_0xc9363d['body']['ids'][_0x319e39]),'FaxQueueId':Number(_0xc9363d['params']['id'])});}return _0x14d7af;});}})[_0x146e('0x1b')](respondWithResult(_0x5cbf7f,null))['catch'](handleError(_0x5cbf7f,null));};exports['removeAgents']=function(_0x25f522,_0xfad4c6){return db[_0x146e('0x27')][_0x146e('0x35')]({'where':{'id':_0x25f522[_0x146e('0x2c')]['id']}})['then'](handleEntityNotFound(_0xfad4c6,null))[_0x146e('0x1b')](function(_0x3e1b6d){if(_0x3e1b6d){return _0x3e1b6d[_0x146e('0x7a')](_0x25f522[_0x146e('0x29')][_0x146e('0x59')])[_0x146e('0x1b')](function(){if(_[_0x146e('0x7d')](_0x25f522[_0x146e('0x29')][_0x146e('0x59')])){for(var _0x135ba6=0x0;_0x135ba6<_0x25f522[_0x146e('0x29')][_0x146e('0x59')][_0x146e('0x32')];_0x135ba6+=0x1){socket[_0x146e('0x61')](_0x146e('0x7e'),{'UserId':Number(_0x25f522['query']['ids'][_0x135ba6]),'FaxQueueId':Number(_0x25f522[_0x146e('0x2c')]['id'])});}}else{socket[_0x146e('0x61')]('userFaxQueue:remove',{'UserId':Number(_0x25f522['query'][_0x146e('0x59')]),'FaxQueueId':Number(_0x25f522[_0x146e('0x2c')]['id'])});}});}})[_0x146e('0x1b')](respondWithStatusCode(_0xfad4c6,null))[_0x146e('0x36')](handleError(_0xfad4c6,null));};exports['getAgents']=function(_0x8528e7,_0xf6e508){var _0x4034b4={};var _0x304a62={};var _0x5e367c;var _0x46d8fa;return db[_0x146e('0x27')][_0x146e('0x44')]({'where':{'id':_0x8528e7[_0x146e('0x2c')]['id']}})[_0x146e('0x1b')](handleEntityNotFound(_0xf6e508,null))['then'](function(_0x3dd262){if(_0x3dd262){_0x5e367c=_0x3dd262;_0x304a62[_0x146e('0x2d')]=_['keys'](db[_0x146e('0x4d')][_0x146e('0x23')]);_0x304a62[_0x146e('0x29')]=_[_0x146e('0x2e')](_0x8528e7[_0x146e('0x29')]);_0x304a62[_0x146e('0x46')]=_[_0x146e('0x2f')](_0x304a62[_0x146e('0x2d')],_0x304a62[_0x146e('0x29')]);_0x4034b4[_0x146e('0x31')]=_[_0x146e('0x2f')](_0x304a62[_0x146e('0x2d')],qs[_0x146e('0x30')](_0x8528e7[_0x146e('0x29')][_0x146e('0x30')]));_0x4034b4[_0x146e('0x31')]=_0x4034b4[_0x146e('0x31')]['length']?_0x4034b4['attributes']:_0x304a62['model'];_0x4034b4[_0x146e('0x49')]=qs[_0x146e('0x4a')](_0x8528e7[_0x146e('0x29')][_0x146e('0x4a')]);_0x4034b4[_0x146e('0x26')]=qs['filters'](_[_0x146e('0x4b')](_0x8528e7[_0x146e('0x29')],_0x304a62[_0x146e('0x46')]));if(_0x8528e7[_0x146e('0x29')][_0x146e('0x4c')]){_0x4034b4[_0x146e('0x26')]=_[_0x146e('0x33')](_0x4034b4[_0x146e('0x26')],{'$or':_[_0x146e('0x22')](_0x4034b4[_0x146e('0x31')],function(_0x23aa0d){var _0x29d431={};_0x29d431[_0x23aa0d]={'$like':'%'+_0x8528e7['query'][_0x146e('0x4c')]+'%'};return _0x29d431;})});}_0x4034b4=_[_0x146e('0x33')]({},_0x4034b4,_0x8528e7[_0x146e('0x34')]);return _0x5e367c['getAgents'](_0x4034b4);}})['then'](function(_0x12260d){if(_0x12260d){_0x46d8fa=_0x12260d['length'];if(!_0x8528e7['query'][_0x146e('0x47')]('nolimit')){_0x4034b4[_0x146e('0x15')]=qs['limit'](_0x8528e7[_0x146e('0x29')][_0x146e('0x15')]);_0x4034b4[_0x146e('0x13')]=qs['offset'](_0x8528e7['query']['offset']);}return _0x5e367c[_0x146e('0x7f')](_0x4034b4);}})[_0x146e('0x1b')](function(_0x45387e){if(_0x45387e){return _0x45387e?{'count':_0x46d8fa,'rows':_0x45387e}:null;}})[_0x146e('0x1b')](respondWithResult(_0xf6e508,null))[_0x146e('0x36')](handleError(_0xf6e508,null));}; \ No newline at end of file +var _0xc838=['create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','update','body','describe','findOne','UserFaxQueue','nolimit','order','sort','pick','FaxQueueId','merge','filter','findAndCountAll','UserId','agent','faxPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','hasOwnProperty','addTeams','ids','Agents','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','userFaxQueue:save','removeTeams','User','tq.TeamId','from','team_has_fax_queues','join','ut.TeamId\x20=\x20tq.TeamId','clone','push','toString','QueryTypes','SELECT','every','includes','all','compact','value','isEmpty','removeAgents','emit','addAgents','omit','spread','isArray','userFaxQueue:remove','getAgents','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','then','FaxQueues','UserProfileResource','name','index','map','FaxQueue','rawAttributes','fieldName','where','include','findAll','rows','show','params','model','keys','query','filters','intersection','fields','attributes','length','includeAll','options','find','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId'];(function(_0x73b4e8,_0x24724d){var _0x2554c5=function(_0x55c28e){while(--_0x55c28e){_0x73b4e8['push'](_0x73b4e8['shift']());}};_0x2554c5(++_0x24724d);}(_0xc838,0xbd));var _0x8c83=function(_0x43db3e,_0x19549c){_0x43db3e=_0x43db3e-0x0;var _0x3063be=_0xc838[_0x43db3e];return _0x3063be;};'use strict';var BPromise=require(_0x8c83('0x0'));var util=require(_0x8c83('0x1'));var _=require(_0x8c83('0x2'));var squel=require(_0x8c83('0x3'));var Redis=require(_0x8c83('0x4'));var qs=require(_0x8c83('0x5'));var logger=require(_0x8c83('0x6'))(_0x8c83('0x7'));var config=require(_0x8c83('0x8'));var db=require(_0x8c83('0x9'))['db'];config[_0x8c83('0xa')]=_[_0x8c83('0xb')](config[_0x8c83('0xa')],{'host':_0x8c83('0xc'),'port':0x18eb});var socket=require(_0x8c83('0xd'))(new Redis(config['redis']));require('./faxQueue.socket')[_0x8c83('0xe')](socket);function respondWithStatusCode(_0x4c2f04,_0x389c28){_0x389c28=_0x389c28||0xcc;return function(_0x3e7a8f){if(_0x3e7a8f){return _0x4c2f04[_0x8c83('0xf')](_0x389c28);}return _0x4c2f04[_0x8c83('0x10')](_0x389c28)[_0x8c83('0x11')]();};}function respondWithResult(_0x21442e,_0x2e547f){_0x2e547f=_0x2e547f||0xc8;return function(_0x105a36){if(_0x105a36){return _0x21442e[_0x8c83('0x10')](_0x2e547f)[_0x8c83('0x12')](_0x105a36);}};}function respondWithFilteredResult(_0x2fb6e5,_0x599205){return function(_0x1fc0b1){if(_0x1fc0b1){var _0x506562=typeof _0x599205['offset']===_0x8c83('0x13')&&typeof _0x599205['limit']===_0x8c83('0x13');var _0x113c7b=_0x1fc0b1[_0x8c83('0x14')];var _0x45d86c=_0x506562?0x0:_0x599205[_0x8c83('0x15')];var _0x1aaac5=_0x506562?_0x1fc0b1[_0x8c83('0x14')]:_0x599205[_0x8c83('0x15')]+_0x599205[_0x8c83('0x16')];var _0xf2dee0;if(_0x1aaac5>=_0x113c7b){_0x1aaac5=_0x113c7b;_0xf2dee0=0xc8;}else{_0xf2dee0=0xce;}_0x2fb6e5['status'](_0xf2dee0);return _0x2fb6e5[_0x8c83('0x17')](_0x8c83('0x18'),_0x45d86c+'-'+_0x1aaac5+'/'+_0x113c7b)['json'](_0x1fc0b1);}return null;};}function saveUpdates(_0x593c97){return function(_0x40bc0d){if(_0x40bc0d){return _0x40bc0d['update'](_0x593c97)[_0x8c83('0x19')](function(_0x535962){return _0x535962;});}return null;};}function removeEntity(_0x47d076){return function(_0x3f4b38){if(_0x3f4b38){return _0x3f4b38['destroy']()[_0x8c83('0x19')](function(){var _0x8899b3=_0x3f4b38['get']({'plain':!![]});var _0x5a2a69=_0x8c83('0x1a');return db[_0x8c83('0x1b')]['destroy']({'where':{'type':_0x5a2a69,'resourceId':_0x8899b3['id']}})[_0x8c83('0x19')](function(){return _0x3f4b38;});})[_0x8c83('0x19')](function(){_0x47d076['status'](0xcc)[_0x8c83('0x11')]();});}};}function handleEntityNotFound(_0x4cde38){return function(_0x34fdab){if(!_0x34fdab){_0x4cde38[_0x8c83('0xf')](0x194);}return _0x34fdab;};}function handleError(_0x17937e,_0xf7b089){_0xf7b089=_0xf7b089||0x1f4;return function(_0x9e56){logger['error'](_0x9e56['stack']);if(_0x9e56[_0x8c83('0x1c')]){delete _0x9e56[_0x8c83('0x1c')];}_0x17937e['status'](_0xf7b089)['send'](_0x9e56);};}exports[_0x8c83('0x1d')]=function(_0xce3514,_0x27aefd){var _0x5034e1={};var _0x1bd922={'count':0x0,'rows':[]};var _0x4f7088=_[_0x8c83('0x1e')](db[_0x8c83('0x1f')][_0x8c83('0x20')],function(_0x1180e1){return{'name':_0x1180e1[_0x8c83('0x21')],'type':_0x1180e1['type']['key']};});_0x5034e1=qs['getOptions'](_0x4f7088,_0xce3514);var _0x41d7be={'where':_0x5034e1[_0x8c83('0x22')]};return db['FaxQueue'][_0x8c83('0x14')](_0x41d7be)[_0x8c83('0x19')](function(_0x142201){_0x1bd922['count']=_0x142201;_0x5034e1['include']=qs[_0x8c83('0x23')](_0xce3514['query']);return db[_0x8c83('0x1f')][_0x8c83('0x24')](_0x5034e1);})[_0x8c83('0x19')](function(_0x178056){_0x1bd922[_0x8c83('0x25')]=_0x178056;return _0x1bd922;})[_0x8c83('0x19')](respondWithFilteredResult(_0x27aefd,_0x5034e1))['catch'](handleError(_0x27aefd,null));};exports[_0x8c83('0x26')]=function(_0x5587db,_0x4c9bca){var _0x6ca25b={'raw':!![],'where':{'id':_0x5587db[_0x8c83('0x27')]['id']}},_0x242d5b={};_0x242d5b[_0x8c83('0x28')]=_[_0x8c83('0x29')](db[_0x8c83('0x1f')][_0x8c83('0x20')]);_0x242d5b['query']=_[_0x8c83('0x29')](_0x5587db[_0x8c83('0x2a')]);_0x242d5b[_0x8c83('0x2b')]=_['intersection'](_0x242d5b[_0x8c83('0x28')],_0x242d5b[_0x8c83('0x2a')]);_0x6ca25b['attributes']=_[_0x8c83('0x2c')](_0x242d5b[_0x8c83('0x28')],qs[_0x8c83('0x2d')](_0x5587db[_0x8c83('0x2a')][_0x8c83('0x2d')]));_0x6ca25b[_0x8c83('0x2e')]=_0x6ca25b[_0x8c83('0x2e')][_0x8c83('0x2f')]?_0x6ca25b[_0x8c83('0x2e')]:_0x242d5b[_0x8c83('0x28')];if(_0x5587db[_0x8c83('0x2a')][_0x8c83('0x30')]){_0x6ca25b['include']=[{'all':!![]}];}_0x6ca25b=_['merge']({},_0x6ca25b,_0x5587db[_0x8c83('0x31')]);return db[_0x8c83('0x1f')][_0x8c83('0x32')](_0x6ca25b)[_0x8c83('0x19')](handleEntityNotFound(_0x4c9bca,null))[_0x8c83('0x19')](respondWithResult(_0x4c9bca,null))['catch'](handleError(_0x4c9bca,null));};exports['create']=function(_0x3a200c,_0x4347d6){return db[_0x8c83('0x1f')]['create'](_0x3a200c['body'],{})['then'](function(_0x4cde01){var _0x259bca=_0x3a200c[_0x8c83('0x33')][_0x8c83('0x34')]({'plain':!![]});if(!_0x259bca)throw new Error(_0x8c83('0x35'));if(_0x259bca[_0x8c83('0x36')]===_0x8c83('0x33')){var _0x1e9867=_0x4cde01[_0x8c83('0x34')]({'plain':!![]});var _0x4da901='FaxQueues';return db[_0x8c83('0x37')][_0x8c83('0x32')]({'where':{'name':_0x4da901,'userProfileId':_0x259bca[_0x8c83('0x38')]},'raw':!![]})['then'](function(_0x2bab6d){if(_0x2bab6d&&_0x2bab6d['autoAssociation']===0x0){return db[_0x8c83('0x1b')][_0x8c83('0x39')]({'name':_0x1e9867['name'],'resourceId':_0x1e9867['id'],'type':_0x2bab6d[_0x8c83('0x1c')],'sectionId':_0x2bab6d['id']},{})['then'](function(){return _0x4cde01;});}else{return _0x4cde01;}})['catch'](function(_0x5dfc16){logger[_0x8c83('0x3a')](_0x8c83('0x3b'),_0x5dfc16);throw _0x5dfc16;});}return _0x4cde01;})[_0x8c83('0x19')](respondWithResult(_0x4347d6,0xc9))[_0x8c83('0x3c')](handleError(_0x4347d6,null));};exports[_0x8c83('0x3d')]=function(_0x3883de,_0x3a6c98){if(_0x3883de['body']['id']){delete _0x3883de['body']['id'];}return db[_0x8c83('0x1f')][_0x8c83('0x32')]({'where':{'id':_0x3883de[_0x8c83('0x27')]['id']}})[_0x8c83('0x19')](handleEntityNotFound(_0x3a6c98,null))[_0x8c83('0x19')](saveUpdates(_0x3883de[_0x8c83('0x3e')],null))[_0x8c83('0x19')](respondWithResult(_0x3a6c98,null))['catch'](handleError(_0x3a6c98,null));};exports['destroy']=function(_0x2a4c6c,_0x1f1a10){return db[_0x8c83('0x1f')][_0x8c83('0x32')]({'where':{'id':_0x2a4c6c[_0x8c83('0x27')]['id']}})[_0x8c83('0x19')](handleEntityNotFound(_0x1f1a10,null))[_0x8c83('0x19')](removeEntity(_0x1f1a10,null))[_0x8c83('0x3c')](handleError(_0x1f1a10,null));};exports[_0x8c83('0x3f')]=function(_0x1c5033,_0x50ef1e){return db['FaxQueue'][_0x8c83('0x3f')]()[_0x8c83('0x19')](respondWithResult(_0x50ef1e,null))[_0x8c83('0x3c')](handleError(_0x50ef1e,null));};exports['getMembers']=function(_0x37d89c,_0x19ff09){var _0x28d8b0={'raw':!![],'where':{}},_0x53c8f3={},_0x5338fd;return db['FaxQueue'][_0x8c83('0x40')]({'where':{'id':_0x37d89c['params']['id']}})['then'](handleEntityNotFound(_0x19ff09,null))[_0x8c83('0x19')](function(_0x4f2aea){if(_0x4f2aea){_0x5338fd=_0x4f2aea[_0x8c83('0x34')]({'plain':!![]});_0x53c8f3[_0x8c83('0x28')]=_[_0x8c83('0x29')](db[_0x8c83('0x41')]['rawAttributes']);_0x53c8f3['query']=_[_0x8c83('0x29')](_0x37d89c[_0x8c83('0x2a')]);_0x53c8f3[_0x8c83('0x2b')]=_['intersection'](_0x53c8f3[_0x8c83('0x28')],_0x53c8f3['query']);_0x28d8b0[_0x8c83('0x2e')]=_[_0x8c83('0x2c')](_0x53c8f3[_0x8c83('0x28')],qs[_0x8c83('0x2d')](_0x37d89c['query'][_0x8c83('0x2d')]));_0x28d8b0['attributes']=_0x28d8b0['attributes'][_0x8c83('0x2f')]?_0x28d8b0[_0x8c83('0x2e')]:_0x53c8f3[_0x8c83('0x28')];if(!_0x37d89c[_0x8c83('0x2a')]['hasOwnProperty'](_0x8c83('0x42'))){_0x28d8b0[_0x8c83('0x16')]=qs[_0x8c83('0x16')](_0x37d89c[_0x8c83('0x2a')][_0x8c83('0x16')]);_0x28d8b0[_0x8c83('0x15')]=qs[_0x8c83('0x15')](_0x37d89c[_0x8c83('0x2a')]['offset']);}_0x28d8b0[_0x8c83('0x43')]=qs['sort'](_0x37d89c[_0x8c83('0x2a')][_0x8c83('0x44')]);_0x28d8b0['where']=qs['filters'](_[_0x8c83('0x45')](_0x37d89c[_0x8c83('0x2a')],_0x53c8f3['filters']));_0x28d8b0['where'][_0x8c83('0x46')]=_0x4f2aea['id'];if(_0x37d89c[_0x8c83('0x2a')]['filter']){_0x28d8b0[_0x8c83('0x22')]=_[_0x8c83('0x47')](_0x28d8b0[_0x8c83('0x22')],{'$or':_['map'](_0x28d8b0[_0x8c83('0x2e')],function(_0x1f7d36){var _0x10a783={};_0x10a783[_0x1f7d36]={'$like':'%'+_0x37d89c['query'][_0x8c83('0x48')]+'%'};return _0x10a783;})});}_0x28d8b0=_[_0x8c83('0x47')]({},_0x28d8b0,_0x37d89c[_0x8c83('0x31')]);return db[_0x8c83('0x41')][_0x8c83('0x24')](_0x28d8b0);}})[_0x8c83('0x19')](function(_0x57a463){if(_0x57a463){return db['User'][_0x8c83('0x49')]({'where':{'id':_[_0x8c83('0x1e')](_0x57a463,_0x8c83('0x4a')),'role':_0x8c83('0x4b')},'attributes':['id',_0x8c83('0x1c'),_0x8c83('0x4c'),_0x8c83('0x4d'),_0x8c83('0x4e')]});}})[_0x8c83('0x19')](function(_0x480bf4){if(_0x480bf4){return{'count':_0x480bf4['count'],'rows':_[_0x8c83('0x1e')](_0x480bf4[_0x8c83('0x25')],function(_0x30ff01){return{'membername':_0x30ff01[_0x8c83('0x1c')],'UserId':_0x30ff01['id'],'queue_name':_0x5338fd[_0x8c83('0x1c')],'FaxQueueId':_0x5338fd['id'],'interface':util[_0x8c83('0x4f')](_0x8c83('0x50'),_0x8c83('0x51'),_0x30ff01[_0x8c83('0x1c')]),'penalty':0x0,'paused':_0x30ff01[_0x8c83('0x4c')],'createdAt':_0x30ff01['createdAt'],'updatedAt':_0x30ff01[_0x8c83('0x4d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8c83('0x19')](respondWithFilteredResult(_0x19ff09,_0x28d8b0))[_0x8c83('0x3c')](handleError(_0x19ff09,null));};exports[_0x8c83('0x52')]=function(_0x2c9865,_0xe7401b){var _0x1573bc={};var _0x31130c={};var _0x2f0a57;var _0x724ecf;return db['FaxQueue'][_0x8c83('0x40')]({'where':{'id':_0x2c9865['params']['id']}})[_0x8c83('0x19')](handleEntityNotFound(_0xe7401b,null))[_0x8c83('0x19')](function(_0x3cc45c){if(_0x3cc45c){_0x2f0a57=_0x3cc45c;_0x31130c['model']=_[_0x8c83('0x29')](db[_0x8c83('0x53')]['rawAttributes']);_0x31130c['query']=_['keys'](_0x2c9865[_0x8c83('0x2a')]);_0x31130c['filters']=_[_0x8c83('0x2c')](_0x31130c[_0x8c83('0x28')],_0x31130c['query']);_0x1573bc['attributes']=_['intersection'](_0x31130c[_0x8c83('0x28')],qs[_0x8c83('0x2d')](_0x2c9865['query']['fields']));_0x1573bc[_0x8c83('0x2e')]=_0x1573bc[_0x8c83('0x2e')]['length']?_0x1573bc[_0x8c83('0x2e')]:_0x31130c[_0x8c83('0x28')];_0x1573bc[_0x8c83('0x43')]=qs['sort'](_0x2c9865[_0x8c83('0x2a')][_0x8c83('0x44')]);_0x1573bc[_0x8c83('0x22')]=qs['filters'](_[_0x8c83('0x45')](_0x2c9865['query'],_0x31130c[_0x8c83('0x2b')]));if(_0x2c9865[_0x8c83('0x2a')][_0x8c83('0x48')]){_0x1573bc[_0x8c83('0x22')]=_['merge'](_0x1573bc['where'],{'$or':_[_0x8c83('0x1e')](_0x1573bc[_0x8c83('0x2e')],function(_0x4169b9){var _0x54ba39={};_0x54ba39[_0x4169b9]={'$like':'%'+_0x2c9865[_0x8c83('0x2a')]['filter']+'%'};return _0x54ba39;})});}_0x1573bc=_[_0x8c83('0x47')]({},_0x1573bc,_0x2c9865[_0x8c83('0x31')]);return _0x2f0a57[_0x8c83('0x52')](_0x1573bc);}})[_0x8c83('0x19')](function(_0x3fbbb4){if(_0x3fbbb4){_0x724ecf=_0x3fbbb4['length'];if(!_0x2c9865[_0x8c83('0x2a')][_0x8c83('0x54')](_0x8c83('0x42'))){_0x1573bc['limit']=qs['limit'](_0x2c9865[_0x8c83('0x2a')][_0x8c83('0x16')]);_0x1573bc['offset']=qs[_0x8c83('0x15')](_0x2c9865['query'][_0x8c83('0x15')]);}return _0x2f0a57[_0x8c83('0x52')](_0x1573bc);}})[_0x8c83('0x19')](function(_0x1f7b9f){if(_0x1f7b9f){return _0x1f7b9f?{'count':_0x724ecf,'rows':_0x1f7b9f}:null;}})['then'](respondWithResult(_0xe7401b,null))['catch'](handleError(_0xe7401b,null));};exports[_0x8c83('0x55')]=function(_0x479a92,_0x28f1cb){var _0x4aae54=_0x479a92['body'][_0x8c83('0x56')];return db[_0x8c83('0x53')]['findAll']({'where':{'id':_0x4aae54},'attributes':['id'],'include':[{'model':db['User'],'as':_0x8c83('0x57'),'attributes':['id',_0x8c83('0x1c'),'online',_0x8c83('0x58'),_0x8c83('0x59')],'raw':!![]}]})[_0x8c83('0x19')](function(_0x27c855){if(_0x27c855){var _0x1e6417=_[_0x8c83('0x5a')](_0x27c855,function(_0x4236f8){var _0x1bdafe=_0x4236f8[_0x8c83('0x34')]({'plain':!![]});return _0x1bdafe[_0x8c83('0x57')];});return db[_0x8c83('0x1f')][_0x8c83('0x32')]({'where':{'id':_0x479a92[_0x8c83('0x27')]['id']}})[_0x8c83('0x19')](function(_0x28c917){return db[_0x8c83('0x5b')][_0x8c83('0x5c')](function(_0x556d0a){return _0x28c917[_0x8c83('0x55')](_0x4aae54,{'transaction':_0x556d0a})['then'](function(){return BPromise[_0x8c83('0x5d')](_0x1e6417,function(_0x4c2822){return db[_0x8c83('0x41')][_0x8c83('0x5e')]({'where':{'UserId':_0x4c2822['id'],'FaxQueueId':_0x479a92[_0x8c83('0x27')]['id']},'transaction':_0x556d0a});});})[_0x8c83('0x19')](function(){_0x1e6417[_0x8c83('0x5f')](function(_0x292a0d){socket['emit'](_0x8c83('0x60'),{'UserId':_0x292a0d['id'],'FaxQueueId':_0x28c917['id']});});});});});}})[_0x8c83('0x19')](respondWithStatusCode(_0x28f1cb,null))['catch'](handleError(_0x28f1cb,null));};exports[_0x8c83('0x61')]=function(_0x38cf08,_0x4a8ab1){return db[_0x8c83('0x53')][_0x8c83('0x24')]({'where':{'id':_0x38cf08[_0x8c83('0x2a')][_0x8c83('0x56')]},'attributes':['id'],'include':[{'model':db[_0x8c83('0x62')],'as':_0x8c83('0x57'),'attributes':['id'],'raw':!![]}]})[_0x8c83('0x19')](handleEntityNotFound(_0x4a8ab1,null))['then'](function(_0x3cda43){var _0x33b38d=_[_0x8c83('0x1e')](_0x3cda43,'id');var _0x386b95=[];var _0x3b2b03=[];var _0x1f90fb=squel['select']();_0x1f90fb['field'](_0x8c83('0x63'))[_0x8c83('0x64')](_0x8c83('0x65'),'tq')[_0x8c83('0x66')]('user_has_teams','ut',_0x8c83('0x67'))['where']('FaxQueueId\x20=\x20?',_0x38cf08[_0x8c83('0x27')]['id']);for(var _0x1dc42e=0x0;_0x1dc42e<_0x3cda43[_0x8c83('0x2f')];_0x1dc42e+=0x1){let _0x254957=_0x3cda43[_0x1dc42e];for(var _0x3a2037=0x0;_0x3a2037<_0x254957['Agents'][_0x8c83('0x2f')];_0x3a2037+=0x1){let _0x1201e8=_0x254957['Agents'][_0x3a2037];var _0x5b8aa3=_0x1f90fb[_0x8c83('0x68')]();_0x5b8aa3[_0x8c83('0x22')]('ut.UserId\x20=\x20?',_0x1201e8['id']);_0x3b2b03[_0x8c83('0x69')](db['sequelize'][_0x8c83('0x2a')](_0x5b8aa3[_0x8c83('0x6a')](),{'type':db['sequelize'][_0x8c83('0x6b')][_0x8c83('0x6c')]})['then'](function(_0x303100){if(_0x303100[_0x8c83('0x2f')]===0x1){return _0x1201e8['id'];}else{var _0x114126=_[_0x8c83('0x6d')](_[_0x8c83('0x1e')](_0x303100,'TeamId'),function(_0x4c62ff){return _[_0x8c83('0x6e')](_0x33b38d,_0x4c62ff);});if(_0x114126){return _0x1201e8['id'];}}}));}}return BPromise[_0x8c83('0x6f')](_0x3b2b03)[_0x8c83('0x19')](function(_0x5135fb){_0x386b95=_(_0x386b95)['union'](_0x5135fb)[_0x8c83('0x70')]()[_0x8c83('0x71')]();return db[_0x8c83('0x1f')][_0x8c83('0x32')]({'where':{'id':_0x38cf08['params']['id']}})[_0x8c83('0x19')](function(_0x3cad90){return db[_0x8c83('0x5b')][_0x8c83('0x5c')](function(_0x201c2f){return _0x3cad90['removeTeams'](_0x38cf08['query'][_0x8c83('0x56')],{'transaction':_0x201c2f})[_0x8c83('0x19')](function(){if(!_[_0x8c83('0x72')](_0x386b95)){return _0x3cad90[_0x8c83('0x73')](_0x386b95,{'transaction':_0x201c2f});}})[_0x8c83('0x19')](function(){_0x386b95[_0x8c83('0x5f')](function(_0xe71a0f){socket[_0x8c83('0x74')]('userFaxQueue:remove',{'UserId':_0xe71a0f,'FaxQueueId':_0x3cad90['id']});});});});});});})[_0x8c83('0x19')](respondWithStatusCode(_0x4a8ab1,null))['catch'](handleError(_0x4a8ab1,null));};exports[_0x8c83('0x75')]=function(_0x29c52b,_0x3dbb17){return db[_0x8c83('0x1f')][_0x8c83('0x32')]({'where':{'id':_0x29c52b[_0x8c83('0x27')]['id']}})[_0x8c83('0x19')](handleEntityNotFound(_0x3dbb17,null))[_0x8c83('0x19')](function(_0x58f7e5){if(_0x58f7e5){return _0x58f7e5[_0x8c83('0x75')](_0x29c52b[_0x8c83('0x3e')][_0x8c83('0x56')],_[_0x8c83('0x76')](_0x29c52b[_0x8c83('0x3e')],[_0x8c83('0x56'),'id'])||{})[_0x8c83('0x77')](function(_0x40c6db){for(var _0x1c095a=0x0;_0x1c095a<_0x29c52b[_0x8c83('0x3e')][_0x8c83('0x56')][_0x8c83('0x2f')];_0x1c095a+=0x1){socket[_0x8c83('0x74')]('userFaxQueue:save',{'UserId':Number(_0x29c52b[_0x8c83('0x3e')][_0x8c83('0x56')][_0x1c095a]),'FaxQueueId':Number(_0x29c52b[_0x8c83('0x27')]['id'])});}return _0x40c6db;});}})[_0x8c83('0x19')](respondWithResult(_0x3dbb17,null))[_0x8c83('0x3c')](handleError(_0x3dbb17,null));};exports[_0x8c83('0x73')]=function(_0x21aa78,_0x24ee37){return db[_0x8c83('0x1f')]['find']({'where':{'id':_0x21aa78['params']['id']}})[_0x8c83('0x19')](handleEntityNotFound(_0x24ee37,null))['then'](function(_0x2e7176){if(_0x2e7176){return _0x2e7176[_0x8c83('0x73')](_0x21aa78[_0x8c83('0x2a')][_0x8c83('0x56')])[_0x8c83('0x19')](function(){if(_[_0x8c83('0x78')](_0x21aa78[_0x8c83('0x2a')]['ids'])){for(var _0x55c54b=0x0;_0x55c54b<_0x21aa78[_0x8c83('0x2a')]['ids'][_0x8c83('0x2f')];_0x55c54b+=0x1){socket[_0x8c83('0x74')](_0x8c83('0x79'),{'UserId':Number(_0x21aa78[_0x8c83('0x2a')][_0x8c83('0x56')][_0x55c54b]),'FaxQueueId':Number(_0x21aa78['params']['id'])});}}else{socket[_0x8c83('0x74')](_0x8c83('0x79'),{'UserId':Number(_0x21aa78['query']['ids']),'FaxQueueId':Number(_0x21aa78[_0x8c83('0x27')]['id'])});}});}})[_0x8c83('0x19')](respondWithStatusCode(_0x24ee37,null))['catch'](handleError(_0x24ee37,null));};exports['getAgents']=function(_0x261d38,_0x3ddbfe){var _0x51bd82={};var _0x55be5b={};var _0x4e62bb;var _0x1d3e22;return db[_0x8c83('0x1f')][_0x8c83('0x40')]({'where':{'id':_0x261d38['params']['id']}})[_0x8c83('0x19')](handleEntityNotFound(_0x3ddbfe,null))['then'](function(_0x105b62){if(_0x105b62){_0x4e62bb=_0x105b62;_0x55be5b[_0x8c83('0x28')]=_[_0x8c83('0x29')](db[_0x8c83('0x62')][_0x8c83('0x20')]);_0x55be5b[_0x8c83('0x2a')]=_['keys'](_0x261d38[_0x8c83('0x2a')]);_0x55be5b[_0x8c83('0x2b')]=_[_0x8c83('0x2c')](_0x55be5b[_0x8c83('0x28')],_0x55be5b[_0x8c83('0x2a')]);_0x51bd82[_0x8c83('0x2e')]=_[_0x8c83('0x2c')](_0x55be5b['model'],qs['fields'](_0x261d38[_0x8c83('0x2a')][_0x8c83('0x2d')]));_0x51bd82[_0x8c83('0x2e')]=_0x51bd82['attributes'][_0x8c83('0x2f')]?_0x51bd82[_0x8c83('0x2e')]:_0x55be5b[_0x8c83('0x28')];_0x51bd82[_0x8c83('0x43')]=qs[_0x8c83('0x44')](_0x261d38[_0x8c83('0x2a')][_0x8c83('0x44')]);_0x51bd82[_0x8c83('0x22')]=qs['filters'](_['pick'](_0x261d38['query'],_0x55be5b[_0x8c83('0x2b')]));if(_0x261d38['query'][_0x8c83('0x48')]){_0x51bd82[_0x8c83('0x22')]=_[_0x8c83('0x47')](_0x51bd82[_0x8c83('0x22')],{'$or':_[_0x8c83('0x1e')](_0x51bd82['attributes'],function(_0x5975fa){var _0x53c770={};_0x53c770[_0x5975fa]={'$like':'%'+_0x261d38[_0x8c83('0x2a')][_0x8c83('0x48')]+'%'};return _0x53c770;})});}_0x51bd82=_['merge']({},_0x51bd82,_0x261d38[_0x8c83('0x31')]);return _0x4e62bb['getAgents'](_0x51bd82);}})[_0x8c83('0x19')](function(_0x4dd494){if(_0x4dd494){_0x1d3e22=_0x4dd494['length'];if(!_0x261d38[_0x8c83('0x2a')][_0x8c83('0x54')](_0x8c83('0x42'))){_0x51bd82[_0x8c83('0x16')]=qs[_0x8c83('0x16')](_0x261d38['query'][_0x8c83('0x16')]);_0x51bd82[_0x8c83('0x15')]=qs[_0x8c83('0x15')](_0x261d38[_0x8c83('0x2a')][_0x8c83('0x15')]);}return _0x4e62bb[_0x8c83('0x7a')](_0x51bd82);}})[_0x8c83('0x19')](function(_0x1f0379){if(_0x1f0379){return _0x1f0379?{'count':_0x1d3e22,'rows':_0x1f0379}:null;}})[_0x8c83('0x19')](respondWithResult(_0x3ddbfe,null))['catch'](handleError(_0x3ddbfe,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 675daf5..0c05346 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 _0x164f=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','FaxQueue','save'];(function(_0x437b88,_0x3b8d8c){var _0x5b76e0=function(_0x3215a9){while(--_0x3215a9){_0x437b88['push'](_0x437b88['shift']());}};_0x5b76e0(++_0x3b8d8c);}(_0x164f,0x10c));var _0xf164=function(_0x36059a,_0xb439ad){_0x36059a=_0x36059a-0x0;var _0x43ab51=_0x164f[_0x36059a];return _0x43ab51;};'use strict';var EventEmitter=require(_0xf164('0x0'));var FaxQueue=require(_0xf164('0x1'))['db'][_0xf164('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf164('0x3'),'afterUpdate':'update','afterDestroy':_0xf164('0x4')};function emitEvent(_0x2f96a1){return function(_0x2c60e6,_0x52751d,_0x3fd0e2){FaxQueueEvents[_0xf164('0x5')](_0x2f96a1+':'+_0x2c60e6['id'],_0x2c60e6);FaxQueueEvents[_0xf164('0x5')](_0x2f96a1,_0x2c60e6);_0x3fd0e2(null);};}for(var e in events){if(events[_0xf164('0x6')](e)){var event=events[e];FaxQueue[_0xf164('0x7')](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file +var _0xe928=['remove','emit','hasOwnProperty','exports','../../mysqldb','FaxQueue','setMaxListeners','save','update'];(function(_0x145eeb,_0x14255a){var _0x483471=function(_0x17e2ee){while(--_0x17e2ee){_0x145eeb['push'](_0x145eeb['shift']());}};_0x483471(++_0x14255a);}(_0xe928,0xc1));var _0x8e92=function(_0x453036,_0x521770){_0x453036=_0x453036-0x0;var _0x203aa2=_0xe928[_0x453036];return _0x203aa2;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0x8e92('0x0'))['db'][_0x8e92('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x8e92('0x2')](0x0);var events={'afterCreate':_0x8e92('0x3'),'afterUpdate':_0x8e92('0x4'),'afterDestroy':_0x8e92('0x5')};function emitEvent(_0x5c387b){return function(_0x2f23a0,_0x39fe5d,_0x30b05a){FaxQueueEvents[_0x8e92('0x6')](_0x5c387b+':'+_0x2f23a0['id'],_0x2f23a0);FaxQueueEvents[_0x8e92('0x6')](_0x5c387b,_0x2f23a0);_0x30b05a(null);};}for(var e in events){if(events[_0x8e92('0x7')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0x8e92('0x8')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 9d5f512..7947223 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 _0x9760=['./faxQueue.attributes','exports','define','FaxQueue','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x3b911c,_0x2d30f2){var _0x293605=function(_0x58e69b){while(--_0x58e69b){_0x3b911c['push'](_0x3b911c['shift']());}};_0x293605(++_0x2d30f2);}(_0x9760,0x100));var _0x0976=function(_0xb5c719,_0x5f4689){_0xb5c719=_0xb5c719-0x0;var _0x464c4f=_0x9760[_0xb5c719];return _0x464c4f;};'use strict';var _=require(_0x0976('0x0'));var util=require(_0x0976('0x1'));var logger=require(_0x0976('0x2'))(_0x0976('0x3'));var moment=require(_0x0976('0x4'));var BPromise=require(_0x0976('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0976('0x6'));var rimraf=require(_0x0976('0x7'));var config=require('../../config/environment');var attributes=require(_0x0976('0x8'));module[_0x0976('0x9')]=function(_0xa9447f,_0xac188d){return _0xa9447f[_0x0976('0xa')](_0x0976('0xb'),attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf1ce=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./faxQueue.attributes','exports','define','FaxQueue','fax_queues'];(function(_0x57392e,_0x2ba38b){var _0x1f2183=function(_0x2563ad){while(--_0x2563ad){_0x57392e['push'](_0x57392e['shift']());}};_0x1f2183(++_0x2ba38b);}(_0xf1ce,0x1c7));var _0xef1c=function(_0x25608d,_0x22c90d){_0x25608d=_0x25608d-0x0;var _0x5374cc=_0xf1ce[_0x25608d];return _0x5374cc;};'use strict';var _=require(_0xef1c('0x0'));var util=require(_0xef1c('0x1'));var logger=require(_0xef1c('0x2'))(_0xef1c('0x3'));var moment=require(_0xef1c('0x4'));var BPromise=require(_0xef1c('0x5'));var rp=require(_0xef1c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xef1c('0x7'));var config=require('../../config/environment');var attributes=require(_0xef1c('0x8'));module[_0xef1c('0x9')]=function(_0x27a39d,_0xf124a8){return _0x27a39d[_0xef1c('0xa')](_0xef1c('0xb'),attributes,{'tableName':_0xef1c('0xc'),'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 cd233da..b6cfbb9 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 _0xcf20=['ShowFaxQueue','raw','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then','info','FaxQueue,\x20%s,\x20%s','debug','FaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch','FaxQueue','options','where','attributes','include','map','model','GetFaxQueue'];(function(_0x3f8840,_0x67bf4e){var _0x52af23=function(_0x3cb746){while(--_0x3cb746){_0x3f8840['push'](_0x3f8840['shift']());}};_0x52af23(++_0x67bf4e);}(_0xcf20,0x1bf));var _0x0cf2=function(_0x1c00de,_0x14329f){_0x1c00de=_0x1c00de-0x0;var _0x3ae664=_0xcf20[_0x1c00de];return _0x3ae664;};'use strict';var _=require(_0x0cf2('0x0'));var util=require(_0x0cf2('0x1'));var moment=require(_0x0cf2('0x2'));var BPromise=require('bluebird');var rs=require(_0x0cf2('0x3'));var fs=require('fs');var Redis=require(_0x0cf2('0x4'));var db=require(_0x0cf2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0cf2('0x6'))(_0x0cf2('0x7'));var config=require(_0x0cf2('0x8'));var jayson=require(_0x0cf2('0x9'));var client=jayson[_0x0cf2('0xa')][_0x0cf2('0xb')]({'port':0x232a});config[_0x0cf2('0xc')]=_[_0x0cf2('0xd')](config[_0x0cf2('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x0cf2('0xe'))(new Redis(config[_0x0cf2('0xc')]));require('./faxQueue.socket')[_0x0cf2('0xf')](socket);function respondWithRpcPromise(_0x31fd2b,_0x406b2c,_0x34489f){return new BPromise(function(_0x45a262,_0x1c40e7){return client[_0x0cf2('0x10')](_0x31fd2b,_0x34489f)[_0x0cf2('0x11')](function(_0x3be12c){logger[_0x0cf2('0x12')](_0x0cf2('0x13'),_0x406b2c,'request\x20sent');logger[_0x0cf2('0x14')](_0x0cf2('0x15'),_0x406b2c,_0x0cf2('0x16'),JSON['stringify'](_0x3be12c));if(_0x3be12c[_0x0cf2('0x17')]){if(_0x3be12c[_0x0cf2('0x17')]['code']===0x1f4){logger['error'](_0x0cf2('0x13'),_0x406b2c,_0x3be12c[_0x0cf2('0x17')][_0x0cf2('0x18')]);return _0x1c40e7(_0x3be12c[_0x0cf2('0x17')][_0x0cf2('0x18')]);}logger['error'](_0x0cf2('0x13'),_0x406b2c,_0x3be12c[_0x0cf2('0x17')][_0x0cf2('0x18')]);return _0x45a262(_0x3be12c[_0x0cf2('0x17')][_0x0cf2('0x18')]);}else{logger['info'](_0x0cf2('0x13'),_0x406b2c,_0x0cf2('0x16'));_0x45a262(_0x3be12c['result'][_0x0cf2('0x18')]);}})[_0x0cf2('0x19')](function(_0x1b3286){logger[_0x0cf2('0x17')](_0x0cf2('0x13'),_0x406b2c,_0x1b3286);_0x1c40e7(_0x1b3286);});});}exports['GetFaxQueue']=function(_0x278532){var _0x21df7a=this;return new Promise(function(_0x276ff4,_0x2b61bc){return db[_0x0cf2('0x1a')]['findAll']({'raw':_0x278532[_0x0cf2('0x1b')]?_0x278532['options']['raw']===undefined?!![]:![]:!![],'where':_0x278532['options']?_0x278532[_0x0cf2('0x1b')][_0x0cf2('0x1c')]||null:null,'attributes':_0x278532[_0x0cf2('0x1b')]?_0x278532[_0x0cf2('0x1b')][_0x0cf2('0x1d')]||null:null,'limit':_0x278532[_0x0cf2('0x1b')]?_0x278532[_0x0cf2('0x1b')]['limit']||null:null,'include':_0x278532[_0x0cf2('0x1b')]?_0x278532[_0x0cf2('0x1b')][_0x0cf2('0x1e')]?_[_0x0cf2('0x1f')](_0x278532['options']['include'],function(_0x6c3b11){return{'model':db[_0x6c3b11[_0x0cf2('0x20')]],'as':_0x6c3b11['as'],'attributes':_0x6c3b11['attributes'],'include':_0x6c3b11['include']?_[_0x0cf2('0x1f')](_0x6c3b11[_0x0cf2('0x1e')],function(_0x548a96){return{'model':db[_0x548a96['model']],'as':_0x548a96['as'],'attributes':_0x548a96[_0x0cf2('0x1d')],'include':_0x548a96['include']?_['map'](_0x548a96['include'],function(_0x1611a8){return{'model':db[_0x1611a8['model']],'as':_0x1611a8['as'],'attributes':_0x1611a8[_0x0cf2('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0cf2('0x11')](function(_0x1cebbe){logger['info'](_0x0cf2('0x21'),_0x278532);logger[_0x0cf2('0x14')](_0x0cf2('0x21'),_0x278532,JSON['stringify'](_0x1cebbe));_0x276ff4(_0x1cebbe);})[_0x0cf2('0x19')](function(_0xfe0129){logger[_0x0cf2('0x17')](_0x0cf2('0x21'),_0xfe0129[_0x0cf2('0x18')],_0x278532);_0x2b61bc(_0x21df7a[_0x0cf2('0x17')](0x1f4,_0xfe0129[_0x0cf2('0x18')]));});});};exports[_0x0cf2('0x22')]=function(_0x440e90){var _0x1e0642=this;return new Promise(function(_0x5007f2,_0x3721e2){return db['FaxQueue']['find']({'raw':_0x440e90[_0x0cf2('0x1b')]?_0x440e90[_0x0cf2('0x1b')][_0x0cf2('0x23')]===undefined?!![]:![]:!![],'where':_0x440e90['options']?_0x440e90[_0x0cf2('0x1b')][_0x0cf2('0x1c')]||null:null,'attributes':_0x440e90['options']?_0x440e90[_0x0cf2('0x1b')][_0x0cf2('0x1d')]||null:null,'include':_0x440e90[_0x0cf2('0x1b')]?_0x440e90[_0x0cf2('0x1b')][_0x0cf2('0x1e')]?_[_0x0cf2('0x1f')](_0x440e90[_0x0cf2('0x1b')]['include'],function(_0x58a56c){return{'model':db[_0x58a56c[_0x0cf2('0x20')]],'as':_0x58a56c['as'],'attributes':_0x58a56c['attributes'],'include':_0x58a56c['include']?_[_0x0cf2('0x1f')](_0x58a56c[_0x0cf2('0x1e')],function(_0x2a809f){return{'model':db[_0x2a809f[_0x0cf2('0x20')]],'as':_0x2a809f['as'],'attributes':_0x2a809f['attributes'],'include':_0x2a809f[_0x0cf2('0x1e')]?_['map'](_0x2a809f[_0x0cf2('0x1e')],function(_0x3bb1f2){return{'model':db[_0x3bb1f2[_0x0cf2('0x20')]],'as':_0x3bb1f2['as'],'attributes':_0x3bb1f2[_0x0cf2('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0cf2('0x11')](function(_0x40a41a){logger[_0x0cf2('0x12')](_0x0cf2('0x22'),_0x440e90);logger['debug']('ShowFaxQueue',_0x440e90,JSON[_0x0cf2('0x24')](_0x40a41a));_0x5007f2(_0x40a41a);})[_0x0cf2('0x19')](function(_0x436f98){logger[_0x0cf2('0x17')](_0x0cf2('0x22'),_0x436f98[_0x0cf2('0x18')],_0x440e90);_0x3721e2(_0x1e0642[_0x0cf2('0x17')](0x1f4,_0x436f98[_0x0cf2('0x18')]));});});}; \ No newline at end of file +var _0xf87d=['model','then','ShowFaxQueue','FaxQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./faxQueue.socket','request','info','debug','FaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','FaxQueue,\x20%s,\x20%s','message','result','catch','GetFaxQueue','findAll','options','raw','where','attributes','include','map'];(function(_0x3afcaa,_0x547d51){var _0x1a436a=function(_0x25d6d9){while(--_0x25d6d9){_0x3afcaa['push'](_0x3afcaa['shift']());}};_0x1a436a(++_0x547d51);}(_0xf87d,0x1d3));var _0xdf87=function(_0x42cb0c,_0x148d03){_0x42cb0c=_0x42cb0c-0x0;var _0x4ac84b=_0xf87d[_0x42cb0c];return _0x4ac84b;};'use strict';var _=require(_0xdf87('0x0'));var util=require(_0xdf87('0x1'));var moment=require(_0xdf87('0x2'));var BPromise=require(_0xdf87('0x3'));var rs=require(_0xdf87('0x4'));var fs=require('fs');var Redis=require(_0xdf87('0x5'));var db=require(_0xdf87('0x6'))['db'];var utils=require(_0xdf87('0x7'));var logger=require('../../config/logger')(_0xdf87('0x8'));var config=require(_0xdf87('0x9'));var jayson=require(_0xdf87('0xa'));var client=jayson[_0xdf87('0xb')][_0xdf87('0xc')]({'port':0x232a});config[_0xdf87('0xd')]=_[_0xdf87('0xe')](config[_0xdf87('0xd')],{'host':_0xdf87('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdf87('0xd')]));require(_0xdf87('0x10'))['register'](socket);function respondWithRpcPromise(_0x3bbfda,_0x11bc99,_0x1bedb2){return new BPromise(function(_0x588cbd,_0x44cb41){return client[_0xdf87('0x11')](_0x3bbfda,_0x1bedb2)['then'](function(_0x5b805e){logger[_0xdf87('0x12')]('FaxQueue,\x20%s,\x20%s',_0x11bc99,'request\x20sent');logger[_0xdf87('0x13')](_0xdf87('0x14'),_0x11bc99,_0xdf87('0x15'),JSON[_0xdf87('0x16')](_0x5b805e));if(_0x5b805e[_0xdf87('0x17')]){if(_0x5b805e['error'][_0xdf87('0x18')]===0x1f4){logger[_0xdf87('0x17')](_0xdf87('0x19'),_0x11bc99,_0x5b805e['error'][_0xdf87('0x1a')]);return _0x44cb41(_0x5b805e[_0xdf87('0x17')]['message']);}logger[_0xdf87('0x17')]('FaxQueue,\x20%s,\x20%s',_0x11bc99,_0x5b805e[_0xdf87('0x17')]['message']);return _0x588cbd(_0x5b805e[_0xdf87('0x17')][_0xdf87('0x1a')]);}else{logger[_0xdf87('0x12')](_0xdf87('0x19'),_0x11bc99,_0xdf87('0x15'));_0x588cbd(_0x5b805e[_0xdf87('0x1b')][_0xdf87('0x1a')]);}})[_0xdf87('0x1c')](function(_0x176ea8){logger[_0xdf87('0x17')](_0xdf87('0x19'),_0x11bc99,_0x176ea8);_0x44cb41(_0x176ea8);});});}exports[_0xdf87('0x1d')]=function(_0x5c2354){var _0x17f6ce=this;return new Promise(function(_0x4e42c3,_0x180e66){return db['FaxQueue'][_0xdf87('0x1e')]({'raw':_0x5c2354[_0xdf87('0x1f')]?_0x5c2354[_0xdf87('0x1f')][_0xdf87('0x20')]===undefined?!![]:![]:!![],'where':_0x5c2354[_0xdf87('0x1f')]?_0x5c2354[_0xdf87('0x1f')][_0xdf87('0x21')]||null:null,'attributes':_0x5c2354[_0xdf87('0x1f')]?_0x5c2354[_0xdf87('0x1f')][_0xdf87('0x22')]||null:null,'limit':_0x5c2354['options']?_0x5c2354[_0xdf87('0x1f')]['limit']||null:null,'include':_0x5c2354[_0xdf87('0x1f')]?_0x5c2354[_0xdf87('0x1f')][_0xdf87('0x23')]?_[_0xdf87('0x24')](_0x5c2354[_0xdf87('0x1f')][_0xdf87('0x23')],function(_0x30858e){return{'model':db[_0x30858e[_0xdf87('0x25')]],'as':_0x30858e['as'],'attributes':_0x30858e['attributes'],'include':_0x30858e['include']?_[_0xdf87('0x24')](_0x30858e[_0xdf87('0x23')],function(_0x5e1039){return{'model':db[_0x5e1039['model']],'as':_0x5e1039['as'],'attributes':_0x5e1039[_0xdf87('0x22')],'include':_0x5e1039[_0xdf87('0x23')]?_[_0xdf87('0x24')](_0x5e1039['include'],function(_0x4c255f){return{'model':db[_0x4c255f[_0xdf87('0x25')]],'as':_0x4c255f['as'],'attributes':_0x4c255f[_0xdf87('0x22')]};}):[]};}):[]};}):[]:[]})[_0xdf87('0x26')](function(_0x17e934){logger['info'](_0xdf87('0x1d'),_0x5c2354);logger[_0xdf87('0x13')]('GetFaxQueue',_0x5c2354,JSON['stringify'](_0x17e934));_0x4e42c3(_0x17e934);})[_0xdf87('0x1c')](function(_0x415e59){logger[_0xdf87('0x17')](_0xdf87('0x1d'),_0x415e59['message'],_0x5c2354);_0x180e66(_0x17f6ce['error'](0x1f4,_0x415e59['message']));});});};exports[_0xdf87('0x27')]=function(_0x1f9d6d){var _0x1e409f=this;return new Promise(function(_0x25dc5b,_0x5303aa){return db[_0xdf87('0x28')][_0xdf87('0x29')]({'raw':_0x1f9d6d[_0xdf87('0x1f')]?_0x1f9d6d[_0xdf87('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x1f9d6d[_0xdf87('0x1f')]?_0x1f9d6d[_0xdf87('0x1f')][_0xdf87('0x21')]||null:null,'attributes':_0x1f9d6d[_0xdf87('0x1f')]?_0x1f9d6d[_0xdf87('0x1f')][_0xdf87('0x22')]||null:null,'include':_0x1f9d6d[_0xdf87('0x1f')]?_0x1f9d6d[_0xdf87('0x1f')]['include']?_[_0xdf87('0x24')](_0x1f9d6d[_0xdf87('0x1f')][_0xdf87('0x23')],function(_0x371e26){return{'model':db[_0x371e26[_0xdf87('0x25')]],'as':_0x371e26['as'],'attributes':_0x371e26[_0xdf87('0x22')],'include':_0x371e26[_0xdf87('0x23')]?_[_0xdf87('0x24')](_0x371e26[_0xdf87('0x23')],function(_0x109fbd){return{'model':db[_0x109fbd['model']],'as':_0x109fbd['as'],'attributes':_0x109fbd[_0xdf87('0x22')],'include':_0x109fbd['include']?_[_0xdf87('0x24')](_0x109fbd[_0xdf87('0x23')],function(_0x27118a){return{'model':db[_0x27118a[_0xdf87('0x25')]],'as':_0x27118a['as'],'attributes':_0x27118a['attributes']};}):[]};}):[]};}):[]:[]})[_0xdf87('0x26')](function(_0x21b8c9){logger['info'](_0xdf87('0x27'),_0x1f9d6d);logger[_0xdf87('0x13')](_0xdf87('0x27'),_0x1f9d6d,JSON[_0xdf87('0x16')](_0x21b8c9));_0x25dc5b(_0x21b8c9);})['catch'](function(_0xad975b){logger[_0xdf87('0x17')](_0xdf87('0x27'),_0xad975b[_0xdf87('0x1a')],_0x1f9d6d);_0x5303aa(_0x1e409f[_0xdf87('0x17')](0x1f4,_0xad975b[_0xdf87('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index c377ced..d0c2df7 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 _0x78e7=['emit','removeListener','./faxQueue.events','save','remove','update'];(function(_0x27481b,_0x58aec6){var _0x47263e=function(_0x5ee50e){while(--_0x5ee50e){_0x27481b['push'](_0x27481b['shift']());}};_0x47263e(++_0x58aec6);}(_0x78e7,0xb0));var _0x778e=function(_0x24976a,_0x292010){_0x24976a=_0x24976a-0x0;var _0x1a89e1=_0x78e7[_0x24976a];return _0x1a89e1;};'use strict';var FaxQueueEvents=require(_0x778e('0x0'));var events=[_0x778e('0x1'),_0x778e('0x2'),_0x778e('0x3')];function createListener(_0x277fc6,_0x2f28cd){return function(_0x32382b){_0x2f28cd[_0x778e('0x4')](_0x277fc6,_0x32382b);};}function removeListener(_0xa40be2,_0xb361e0){return function(){FaxQueueEvents[_0x778e('0x5')](_0xa40be2,_0xb361e0);};}exports['register']=function(_0x3a1894){for(var _0x15aacb=0x0,_0x503bd9=events['length'];_0x15aacb<_0x503bd9;_0x15aacb++){var _0x1ca849=events[_0x15aacb];var _0x308b73=createListener('faxQueue:'+_0x1ca849,_0x3a1894);FaxQueueEvents['on'](_0x1ca849,_0x308b73);}}; \ No newline at end of file +var _0x20ef=['register','faxQueue:','save','remove','emit','removeListener'];(function(_0x5c5252,_0x5c57c3){var _0x48a8b4=function(_0x3126e2){while(--_0x3126e2){_0x5c5252['push'](_0x5c5252['shift']());}};_0x48a8b4(++_0x5c57c3);}(_0x20ef,0x9e));var _0xf20e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x20ef[_0x3dd15e];return _0x231fd0;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=[_0xf20e('0x0'),_0xf20e('0x1'),'update'];function createListener(_0x399efc,_0x2c11e9){return function(_0x2e66f2){_0x2c11e9[_0xf20e('0x2')](_0x399efc,_0x2e66f2);};}function removeListener(_0x4ee77b,_0x5792a0){return function(){FaxQueueEvents[_0xf20e('0x3')](_0x4ee77b,_0x5792a0);};}exports[_0xf20e('0x4')]=function(_0x141d2b){for(var _0x26b003=0x0,_0x62143b=events['length'];_0x26b003<_0x62143b;_0x26b003++){var _0x146c28=events[_0x26b003];var _0x3330cd=createListener(_0xf20e('0x5')+_0x146c28,_0x141d2b);FaxQueueEvents['on'](_0x146c28,_0x3330cd);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index d783069..a8a19f5 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 _0x15ef=['isAuthenticated','show','/:id/teams','/:id/users','getAgents','create','post','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxQueue.controller','get','/describe','describe','/:id'];(function(_0x592bac,_0x39af88){var _0x56b102=function(_0x3e652a){while(--_0x3e652a){_0x592bac['push'](_0x592bac['shift']());}};_0x56b102(++_0x39af88);}(_0x15ef,0x80));var _0xf15e=function(_0x28bed8,_0x128876){_0x28bed8=_0x28bed8-0x0;var _0x36aac2=_0x15ef[_0x28bed8];return _0x36aac2;};'use strict';var multer=require('multer');var util=require(_0xf15e('0x0'));var path=require(_0xf15e('0x1'));var timeout=require('connect-timeout');var express=require(_0xf15e('0x2'));var router=express[_0xf15e('0x3')]();var fs_extra=require(_0xf15e('0x4'));var auth=require(_0xf15e('0x5'));var interaction=require(_0xf15e('0x6'));var config=require('../../config/environment');var controller=require(_0xf15e('0x7'));router[_0xf15e('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf15e('0x8')](_0xf15e('0x9'),auth['isAuthenticated'](),controller[_0xf15e('0xa')]);router['get'](_0xf15e('0xb'),auth[_0xf15e('0xc')](),controller[_0xf15e('0xd')]);router[_0xf15e('0x8')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router[_0xf15e('0x8')](_0xf15e('0xe'),auth['isAuthenticated'](),controller['getTeams']);router['get'](_0xf15e('0xf'),auth[_0xf15e('0xc')](),controller[_0xf15e('0x10')]);router['post']('/',auth[_0xf15e('0xc')](),controller[_0xf15e('0x11')]);router[_0xf15e('0x12')]('/:id/teams',auth[_0xf15e('0xc')](),controller[_0xf15e('0x13')]);router[_0xf15e('0x12')](_0xf15e('0xf'),auth[_0xf15e('0xc')](),controller[_0xf15e('0x14')]);router[_0xf15e('0x15')](_0xf15e('0xb'),auth['isAuthenticated'](),controller[_0xf15e('0x16')]);router[_0xf15e('0x17')]('/:id',auth[_0xf15e('0xc')](),controller[_0xf15e('0x18')]);router[_0xf15e('0x17')]('/:id/teams',auth['isAuthenticated'](),controller[_0xf15e('0x19')]);router[_0xf15e('0x17')]('/:id/users',auth[_0xf15e('0xc')](),controller[_0xf15e('0x1a')]);module[_0xf15e('0x1b')]=router; \ No newline at end of file +var _0x90ec=['/:id/teams','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxQueue.controller','get','index','/describe','isAuthenticated','/:id','show','/:id/members','getMembers','getAgents','post','create','addTeams','/:id/users','addAgents','delete','destroy'];(function(_0x409a65,_0x4f3a75){var _0x2d7c4b=function(_0x5a6a83){while(--_0x5a6a83){_0x409a65['push'](_0x409a65['shift']());}};_0x2d7c4b(++_0x4f3a75);}(_0x90ec,0x1d4));var _0xc90e=function(_0xdd4f11,_0x274420){_0xdd4f11=_0xdd4f11-0x0;var _0x50a0a1=_0x90ec[_0xdd4f11];return _0x50a0a1;};'use strict';var multer=require(_0xc90e('0x0'));var util=require(_0xc90e('0x1'));var path=require('path');var timeout=require(_0xc90e('0x2'));var express=require(_0xc90e('0x3'));var router=express[_0xc90e('0x4')]();var fs_extra=require(_0xc90e('0x5'));var auth=require(_0xc90e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc90e('0x7'));var controller=require(_0xc90e('0x8'));router[_0xc90e('0x9')]('/',auth['isAuthenticated'](),controller[_0xc90e('0xa')]);router['get'](_0xc90e('0xb'),auth[_0xc90e('0xc')](),controller['describe']);router[_0xc90e('0x9')](_0xc90e('0xd'),auth[_0xc90e('0xc')](),controller[_0xc90e('0xe')]);router[_0xc90e('0x9')](_0xc90e('0xf'),auth[_0xc90e('0xc')](),controller[_0xc90e('0x10')]);router[_0xc90e('0x9')]('/:id/teams',auth[_0xc90e('0xc')](),controller['getTeams']);router['get']('/:id/users',auth['isAuthenticated'](),controller[_0xc90e('0x11')]);router[_0xc90e('0x12')]('/',auth['isAuthenticated'](),controller[_0xc90e('0x13')]);router[_0xc90e('0x12')]('/:id/teams',auth[_0xc90e('0xc')](),controller[_0xc90e('0x14')]);router[_0xc90e('0x12')](_0xc90e('0x15'),auth[_0xc90e('0xc')](),controller[_0xc90e('0x16')]);router['put'](_0xc90e('0xd'),auth[_0xc90e('0xc')](),controller['update']);router[_0xc90e('0x17')]('/:id',auth[_0xc90e('0xc')](),controller[_0xc90e('0x18')]);router['delete'](_0xc90e('0x19'),auth[_0xc90e('0xc')](),controller[_0xc90e('0x1a')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xc90e('0x1b')]);module[_0xc90e('0x1c')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index b710aab..0aedd99 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 _0x3954=['DATE','moment','sequelize','STRING'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x3954,0x16d));var _0x4395=function(_0xfab6aa,_0x12d79b){_0xfab6aa=_0xfab6aa-0x0;var _0x218d89=_0x3954[_0xfab6aa];return _0x218d89;};'use strict';var moment=require(_0x4395('0x0'));var Sequelize=require(_0x4395('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x4395('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x4395('0x3')]},'leaveAt':{'type':Sequelize[_0x4395('0x3')]},'acceptAt':{'type':Sequelize[_0x4395('0x3')]},'exitAt':{'type':Sequelize[_0x4395('0x3')]},'reason':{'type':Sequelize[_0x4395('0x2')]}}; \ No newline at end of file +var _0x05de=['sequelize','exports','STRING','DATE','moment'];(function(_0x57ff59,_0x4b9327){var _0x58e63f=function(_0x3b1072){while(--_0x3b1072){_0x57ff59['push'](_0x57ff59['shift']());}};_0x58e63f(++_0x4b9327);}(_0x05de,0x135));var _0xe05d=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x05de[_0xa464c9];return _0x3d73c4;};'use strict';var moment=require(_0xe05d('0x0'));var Sequelize=require(_0xe05d('0x1'));module[_0xe05d('0x2')]={'uniqueid':{'type':Sequelize[_0xe05d('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xe05d('0x3')]},'joinAt':{'type':Sequelize[_0xe05d('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xe05d('0x4')]},'exitAt':{'type':Sequelize[_0xe05d('0x4')]},'reason':{'type':Sequelize[_0xe05d('0x3')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 4e6a420..6137615 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 _0xbe45=['pick','filter','where','VIRTUAL','merge','options','FaxQueueReport','includeAll','findAll','rows','catch','show','params','include','create','body','find','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','reject','save','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort'];(function(_0x11ade4,_0x5ef3f0){var _0x4b0034=function(_0x4e11e9){while(--_0x4e11e9){_0x11ade4['push'](_0x11ade4['shift']());}};_0x4b0034(++_0x5ef3f0);}(_0xbe45,0xf0));var _0x5be4=function(_0x2b8192,_0x3bb7d4){_0x2b8192=_0x2b8192-0x0;var _0x2647dd=_0xbe45[_0x2b8192];return _0x2647dd;};'use strict';var emlformat=require(_0x5be4('0x0'));var rimraf=require(_0x5be4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5be4('0x2'));var rp=require(_0x5be4('0x3'));var moment=require(_0x5be4('0x4'));var BPromise=require(_0x5be4('0x5'));var Mustache=require(_0x5be4('0x6'));var util=require(_0x5be4('0x7'));var path=require('path');var sox=require(_0x5be4('0x8'));var csv=require(_0x5be4('0x9'));var ejs=require(_0x5be4('0xa'));var fs=require('fs');var fs_extra=require(_0x5be4('0xb'));var _=require(_0x5be4('0xc'));var squel=require(_0x5be4('0xd'));var crypto=require(_0x5be4('0xe'));var jsforce=require(_0x5be4('0xf'));var deskjs=require(_0x5be4('0x10'));var toCsv=require(_0x5be4('0x9'));var querystring=require(_0x5be4('0x11'));var Papa=require(_0x5be4('0x12'));var Redis=require(_0x5be4('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x5be4('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5be4('0x15'))('api');var utils=require(_0x5be4('0x16'));var config=require(_0x5be4('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x5be4('0x18'))['db'];function respondWithStatusCode(_0x43a60f,_0x1d7960){_0x1d7960=_0x1d7960||0xcc;return function(_0x5c6615){if(_0x5c6615){return _0x43a60f[_0x5be4('0x19')](_0x1d7960);}return _0x43a60f['status'](_0x1d7960)[_0x5be4('0x1a')]();};}function respondWithResult(_0x2afee8,_0x2dd93e){_0x2dd93e=_0x2dd93e||0xc8;return function(_0x335842){if(_0x335842){return _0x2afee8[_0x5be4('0x1b')](_0x2dd93e)[_0x5be4('0x1c')](_0x335842);}};}function respondWithFilteredResult(_0x3980fc,_0x5ebe65){return function(_0x3e830e){if(_0x3e830e){var _0x8466a7=typeof _0x5ebe65[_0x5be4('0x1d')]===_0x5be4('0x1e')&&typeof _0x5ebe65[_0x5be4('0x1f')]===_0x5be4('0x1e');var _0x94f434=_0x3e830e[_0x5be4('0x20')];var _0x51662a=_0x8466a7?0x0:_0x5ebe65[_0x5be4('0x1d')];var _0x50b970=_0x8466a7?_0x3e830e['count']:_0x5ebe65[_0x5be4('0x1d')]+_0x5ebe65[_0x5be4('0x1f')];var _0x4cce93;if(_0x50b970>=_0x94f434){_0x50b970=_0x94f434;_0x4cce93=0xc8;}else{_0x4cce93=0xce;}_0x3980fc[_0x5be4('0x1b')](_0x4cce93);return _0x3980fc[_0x5be4('0x21')]('Content-Range',_0x51662a+'-'+_0x50b970+'/'+_0x94f434)['json'](_0x3e830e);}return null;};}function patchUpdates(_0x2690be){return function(_0x207948){try{jsonpatch['apply'](_0x207948,_0x2690be,!![]);}catch(_0x553f59){return BPromise[_0x5be4('0x22')](_0x553f59);}return _0x207948[_0x5be4('0x23')]();};}function saveUpdates(_0x2843e3,_0x3ccd67){return function(_0xa20552){if(_0xa20552){return _0xa20552['update'](_0x2843e3)[_0x5be4('0x24')](function(_0x51d7a7){return _0x51d7a7;});}return null;};}function removeEntity(_0x242005,_0x12b9cd){return function(_0x4d6eff){if(_0x4d6eff){return _0x4d6eff[_0x5be4('0x25')]()[_0x5be4('0x24')](function(){_0x242005['status'](0xcc)[_0x5be4('0x1a')]();});}};}function handleEntityNotFound(_0x2b2e2c,_0x353a65){return function(_0x39cf54){if(!_0x39cf54){_0x2b2e2c[_0x5be4('0x19')](0x194);}return _0x39cf54;};}function handleError(_0x13779f,_0x112728){_0x112728=_0x112728||0x1f4;return function(_0x5b49ea){logger['error'](_0x5b49ea[_0x5be4('0x26')]);if(_0x5b49ea[_0x5be4('0x27')]){delete _0x5b49ea[_0x5be4('0x27')];}_0x13779f['status'](_0x112728)[_0x5be4('0x28')](_0x5b49ea);};}exports[_0x5be4('0x29')]=function(_0x3bd842,_0x412ef6){var _0x16f3bf={},_0x1e0485={},_0x4b9029={'count':0x0,'rows':[]};var _0x1661c2=_[_0x5be4('0x2a')](db['FaxQueueReport'][_0x5be4('0x2b')],function(_0x49780a){return{'name':_0x49780a[_0x5be4('0x2c')],'type':_0x49780a[_0x5be4('0x2d')]['key']};});_0x1e0485[_0x5be4('0x2e')]=_['map'](_0x1661c2,'name');_0x1e0485[_0x5be4('0x2f')]=_[_0x5be4('0x30')](_0x3bd842[_0x5be4('0x2f')]);_0x1e0485[_0x5be4('0x31')]=_[_0x5be4('0x32')](_0x1e0485[_0x5be4('0x2e')],_0x1e0485[_0x5be4('0x2f')]);_0x16f3bf[_0x5be4('0x33')]=_[_0x5be4('0x32')](_0x1e0485[_0x5be4('0x2e')],qs[_0x5be4('0x34')](_0x3bd842[_0x5be4('0x2f')]['fields']));_0x16f3bf['attributes']=_0x16f3bf[_0x5be4('0x33')][_0x5be4('0x35')]?_0x16f3bf[_0x5be4('0x33')]:_0x1e0485[_0x5be4('0x2e')];if(!_0x3bd842['query'][_0x5be4('0x36')]('nolimit')){_0x16f3bf[_0x5be4('0x1f')]=qs['limit'](_0x3bd842[_0x5be4('0x2f')][_0x5be4('0x1f')]);_0x16f3bf['offset']=qs['offset'](_0x3bd842[_0x5be4('0x2f')]['offset']);}_0x16f3bf['order']=qs[_0x5be4('0x37')](_0x3bd842[_0x5be4('0x2f')][_0x5be4('0x37')]);_0x16f3bf['where']=qs[_0x5be4('0x31')](_[_0x5be4('0x38')](_0x3bd842['query'],_0x1e0485[_0x5be4('0x31')]),_0x1661c2);if(_0x3bd842[_0x5be4('0x2f')][_0x5be4('0x39')]){_0x16f3bf[_0x5be4('0x3a')]=_['merge'](_0x16f3bf[_0x5be4('0x3a')],{'$or':_[_0x5be4('0x2a')](_0x1661c2,function(_0x178500){if(_0x178500[_0x5be4('0x2d')]!==_0x5be4('0x3b')){var _0x3ddba4={};_0x3ddba4[_0x178500[_0x5be4('0x27')]]={'$like':'%'+_0x3bd842[_0x5be4('0x2f')]['filter']+'%'};return _0x3ddba4;}})});}_0x16f3bf=_[_0x5be4('0x3c')]({},_0x16f3bf,_0x3bd842[_0x5be4('0x3d')]);var _0x348c30={'where':_0x16f3bf[_0x5be4('0x3a')]};return db[_0x5be4('0x3e')]['count'](_0x348c30)[_0x5be4('0x24')](function(_0x344411){_0x4b9029['count']=_0x344411;if(_0x3bd842[_0x5be4('0x2f')][_0x5be4('0x3f')]){_0x16f3bf['include']=[{'all':!![]}];}return db[_0x5be4('0x3e')][_0x5be4('0x40')](_0x16f3bf);})[_0x5be4('0x24')](function(_0x1d480c){_0x4b9029[_0x5be4('0x41')]=_0x1d480c;return _0x4b9029;})[_0x5be4('0x24')](respondWithFilteredResult(_0x412ef6,_0x16f3bf))[_0x5be4('0x42')](handleError(_0x412ef6,null));};exports[_0x5be4('0x43')]=function(_0x2313d6,_0x53974f){var _0x1add45={'raw':!![],'where':{'id':_0x2313d6[_0x5be4('0x44')]['id']}},_0x536473={};_0x536473[_0x5be4('0x2e')]=_['keys'](db[_0x5be4('0x3e')]['rawAttributes']);_0x536473['query']=_[_0x5be4('0x30')](_0x2313d6[_0x5be4('0x2f')]);_0x536473[_0x5be4('0x31')]=_[_0x5be4('0x32')](_0x536473[_0x5be4('0x2e')],_0x536473[_0x5be4('0x2f')]);_0x1add45[_0x5be4('0x33')]=_['intersection'](_0x536473[_0x5be4('0x2e')],qs['fields'](_0x2313d6[_0x5be4('0x2f')]['fields']));_0x1add45[_0x5be4('0x33')]=_0x1add45[_0x5be4('0x33')]['length']?_0x1add45[_0x5be4('0x33')]:_0x536473[_0x5be4('0x2e')];if(_0x2313d6[_0x5be4('0x2f')]['includeAll']){_0x1add45[_0x5be4('0x45')]=[{'all':!![]}];}_0x1add45=_[_0x5be4('0x3c')]({},_0x1add45,_0x2313d6['options']);return db[_0x5be4('0x3e')]['find'](_0x1add45)['then'](handleEntityNotFound(_0x53974f,null))[_0x5be4('0x24')](respondWithResult(_0x53974f,null))[_0x5be4('0x42')](handleError(_0x53974f,null));};exports['create']=function(_0x47734f,_0x57f25d){return db['FaxQueueReport'][_0x5be4('0x46')](_0x47734f[_0x5be4('0x47')],{})[_0x5be4('0x24')](respondWithResult(_0x57f25d,0xc9))['catch'](handleError(_0x57f25d,null));};exports['update']=function(_0x378ae7,_0x2fb7cd){if(_0x378ae7[_0x5be4('0x47')]['id']){delete _0x378ae7[_0x5be4('0x47')]['id'];}return db['FaxQueueReport'][_0x5be4('0x48')]({'where':{'id':_0x378ae7[_0x5be4('0x44')]['id']}})['then'](handleEntityNotFound(_0x2fb7cd,null))[_0x5be4('0x24')](saveUpdates(_0x378ae7[_0x5be4('0x47')],null))[_0x5be4('0x24')](respondWithResult(_0x2fb7cd,null))['catch'](handleError(_0x2fb7cd,null));};exports[_0x5be4('0x25')]=function(_0x3481c9,_0xc9ca2f){return db[_0x5be4('0x3e')][_0x5be4('0x48')]({'where':{'id':_0x3481c9[_0x5be4('0x44')]['id']}})[_0x5be4('0x24')](handleEntityNotFound(_0xc9ca2f,null))[_0x5be4('0x24')](removeEntity(_0xc9ca2f,null))[_0x5be4('0x42')](handleError(_0xc9ca2f,null));};exports[_0x5be4('0x49')]=function(_0x5f0999,_0x2caec3){return db['FaxQueueReport'][_0x5be4('0x49')]()[_0x5be4('0x24')](respondWithResult(_0x2caec3,null))[_0x5be4('0x42')](handleError(_0x2caec3,null));}; \ No newline at end of file +var _0xbf3f=['end','offset','limit','undefined','count','Content-Range','json','apply','update','then','destroy','error','stack','name','send','index','map','FaxQueueReport','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','eml-format','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x2aefb6,_0x1bd384){var _0x202772=function(_0x507d3f){while(--_0x507d3f){_0x2aefb6['push'](_0x2aefb6['shift']());}};_0x202772(++_0x1bd384);}(_0xbf3f,0x10f));var _0xfbf3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbf3f[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xfbf3('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(_0xfbf3('0x1'));var Mustache=require(_0xfbf3('0x2'));var util=require(_0xfbf3('0x3'));var path=require('path');var sox=require(_0xfbf3('0x4'));var csv=require(_0xfbf3('0x5'));var ejs=require(_0xfbf3('0x6'));var fs=require('fs');var fs_extra=require(_0xfbf3('0x7'));var _=require(_0xfbf3('0x8'));var squel=require(_0xfbf3('0x9'));var crypto=require(_0xfbf3('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xfbf3('0xb'));var toCsv=require(_0xfbf3('0x5'));var querystring=require(_0xfbf3('0xc'));var Papa=require(_0xfbf3('0xd'));var Redis=require(_0xfbf3('0xe'));var authService=require(_0xfbf3('0xf'));var qs=require(_0xfbf3('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfbf3('0x11'));var logger=require(_0xfbf3('0x12'))('api');var utils=require(_0xfbf3('0x13'));var config=require(_0xfbf3('0x14'));var licenseUtil=require(_0xfbf3('0x15'));var db=require(_0xfbf3('0x16'))['db'];function respondWithStatusCode(_0x4a9f3c,_0x4c3898){_0x4c3898=_0x4c3898||0xcc;return function(_0x258bc4){if(_0x258bc4){return _0x4a9f3c[_0xfbf3('0x17')](_0x4c3898);}return _0x4a9f3c[_0xfbf3('0x18')](_0x4c3898)[_0xfbf3('0x19')]();};}function respondWithResult(_0x260348,_0x2683a1){_0x2683a1=_0x2683a1||0xc8;return function(_0x46c54c){if(_0x46c54c){return _0x260348[_0xfbf3('0x18')](_0x2683a1)['json'](_0x46c54c);}};}function respondWithFilteredResult(_0x51b30b,_0x3a24a5){return function(_0x565361){if(_0x565361){var _0x3cb3de=typeof _0x3a24a5[_0xfbf3('0x1a')]==='undefined'&&typeof _0x3a24a5[_0xfbf3('0x1b')]===_0xfbf3('0x1c');var _0x2e139b=_0x565361['count'];var _0x543b69=_0x3cb3de?0x0:_0x3a24a5[_0xfbf3('0x1a')];var _0x51af71=_0x3cb3de?_0x565361[_0xfbf3('0x1d')]:_0x3a24a5[_0xfbf3('0x1a')]+_0x3a24a5[_0xfbf3('0x1b')];var _0x228dfd;if(_0x51af71>=_0x2e139b){_0x51af71=_0x2e139b;_0x228dfd=0xc8;}else{_0x228dfd=0xce;}_0x51b30b[_0xfbf3('0x18')](_0x228dfd);return _0x51b30b['set'](_0xfbf3('0x1e'),_0x543b69+'-'+_0x51af71+'/'+_0x2e139b)[_0xfbf3('0x1f')](_0x565361);}return null;};}function patchUpdates(_0x3daba0){return function(_0x3ac52c){try{jsonpatch[_0xfbf3('0x20')](_0x3ac52c,_0x3daba0,!![]);}catch(_0x589300){return BPromise['reject'](_0x589300);}return _0x3ac52c['save']();};}function saveUpdates(_0x328c6f,_0x3233f5){return function(_0x4eb4dc){if(_0x4eb4dc){return _0x4eb4dc[_0xfbf3('0x21')](_0x328c6f)[_0xfbf3('0x22')](function(_0x512cec){return _0x512cec;});}return null;};}function removeEntity(_0x5ee5f7,_0x4f8175){return function(_0x147306){if(_0x147306){return _0x147306[_0xfbf3('0x23')]()[_0xfbf3('0x22')](function(){_0x5ee5f7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xf72528,_0xc9240f){return function(_0x441a99){if(!_0x441a99){_0xf72528['sendStatus'](0x194);}return _0x441a99;};}function handleError(_0x52e145,_0x3bdafe){_0x3bdafe=_0x3bdafe||0x1f4;return function(_0x5d6a07){logger[_0xfbf3('0x24')](_0x5d6a07[_0xfbf3('0x25')]);if(_0x5d6a07[_0xfbf3('0x26')]){delete _0x5d6a07[_0xfbf3('0x26')];}_0x52e145['status'](_0x3bdafe)[_0xfbf3('0x27')](_0x5d6a07);};}exports[_0xfbf3('0x28')]=function(_0xfe5877,_0x2191b2){var _0x4dbb5b={},_0x2315ba={},_0x22e436={'count':0x0,'rows':[]};var _0x43fb4b=_[_0xfbf3('0x29')](db[_0xfbf3('0x2a')][_0xfbf3('0x2b')],function(_0x1f2c55){return{'name':_0x1f2c55['fieldName'],'type':_0x1f2c55[_0xfbf3('0x2c')][_0xfbf3('0x2d')]};});_0x2315ba[_0xfbf3('0x2e')]=_[_0xfbf3('0x29')](_0x43fb4b,'name');_0x2315ba[_0xfbf3('0x2f')]=_[_0xfbf3('0x30')](_0xfe5877[_0xfbf3('0x2f')]);_0x2315ba['filters']=_[_0xfbf3('0x31')](_0x2315ba[_0xfbf3('0x2e')],_0x2315ba[_0xfbf3('0x2f')]);_0x4dbb5b[_0xfbf3('0x32')]=_[_0xfbf3('0x31')](_0x2315ba[_0xfbf3('0x2e')],qs[_0xfbf3('0x33')](_0xfe5877['query'][_0xfbf3('0x33')]));_0x4dbb5b[_0xfbf3('0x32')]=_0x4dbb5b['attributes'][_0xfbf3('0x34')]?_0x4dbb5b['attributes']:_0x2315ba[_0xfbf3('0x2e')];if(!_0xfe5877[_0xfbf3('0x2f')][_0xfbf3('0x35')](_0xfbf3('0x36'))){_0x4dbb5b[_0xfbf3('0x1b')]=qs[_0xfbf3('0x1b')](_0xfe5877[_0xfbf3('0x2f')][_0xfbf3('0x1b')]);_0x4dbb5b['offset']=qs[_0xfbf3('0x1a')](_0xfe5877['query'][_0xfbf3('0x1a')]);}_0x4dbb5b[_0xfbf3('0x37')]=qs[_0xfbf3('0x38')](_0xfe5877[_0xfbf3('0x2f')][_0xfbf3('0x38')]);_0x4dbb5b['where']=qs[_0xfbf3('0x39')](_['pick'](_0xfe5877['query'],_0x2315ba['filters']),_0x43fb4b);if(_0xfe5877[_0xfbf3('0x2f')][_0xfbf3('0x3a')]){_0x4dbb5b[_0xfbf3('0x3b')]=_[_0xfbf3('0x3c')](_0x4dbb5b[_0xfbf3('0x3b')],{'$or':_[_0xfbf3('0x29')](_0x43fb4b,function(_0x6a31de){if(_0x6a31de[_0xfbf3('0x2c')]!==_0xfbf3('0x3d')){var _0x5d0c28={};_0x5d0c28[_0x6a31de[_0xfbf3('0x26')]]={'$like':'%'+_0xfe5877[_0xfbf3('0x2f')][_0xfbf3('0x3a')]+'%'};return _0x5d0c28;}})});}_0x4dbb5b=_[_0xfbf3('0x3c')]({},_0x4dbb5b,_0xfe5877[_0xfbf3('0x3e')]);var _0x5a0a29={'where':_0x4dbb5b['where']};return db['FaxQueueReport']['count'](_0x5a0a29)[_0xfbf3('0x22')](function(_0x872fef){_0x22e436[_0xfbf3('0x1d')]=_0x872fef;if(_0xfe5877[_0xfbf3('0x2f')][_0xfbf3('0x3f')]){_0x4dbb5b[_0xfbf3('0x40')]=[{'all':!![]}];}return db[_0xfbf3('0x2a')][_0xfbf3('0x41')](_0x4dbb5b);})[_0xfbf3('0x22')](function(_0x2b350b){_0x22e436[_0xfbf3('0x42')]=_0x2b350b;return _0x22e436;})['then'](respondWithFilteredResult(_0x2191b2,_0x4dbb5b))[_0xfbf3('0x43')](handleError(_0x2191b2,null));};exports[_0xfbf3('0x44')]=function(_0x49663e,_0x121677){var _0x521468={'raw':!![],'where':{'id':_0x49663e['params']['id']}},_0x79bee2={};_0x79bee2[_0xfbf3('0x2e')]=_['keys'](db[_0xfbf3('0x2a')][_0xfbf3('0x2b')]);_0x79bee2[_0xfbf3('0x2f')]=_[_0xfbf3('0x30')](_0x49663e[_0xfbf3('0x2f')]);_0x79bee2[_0xfbf3('0x39')]=_[_0xfbf3('0x31')](_0x79bee2[_0xfbf3('0x2e')],_0x79bee2[_0xfbf3('0x2f')]);_0x521468[_0xfbf3('0x32')]=_[_0xfbf3('0x31')](_0x79bee2[_0xfbf3('0x2e')],qs[_0xfbf3('0x33')](_0x49663e[_0xfbf3('0x2f')][_0xfbf3('0x33')]));_0x521468[_0xfbf3('0x32')]=_0x521468['attributes'][_0xfbf3('0x34')]?_0x521468[_0xfbf3('0x32')]:_0x79bee2['model'];if(_0x49663e[_0xfbf3('0x2f')]['includeAll']){_0x521468[_0xfbf3('0x40')]=[{'all':!![]}];}_0x521468=_['merge']({},_0x521468,_0x49663e[_0xfbf3('0x3e')]);return db[_0xfbf3('0x2a')][_0xfbf3('0x45')](_0x521468)['then'](handleEntityNotFound(_0x121677,null))[_0xfbf3('0x22')](respondWithResult(_0x121677,null))[_0xfbf3('0x43')](handleError(_0x121677,null));};exports['create']=function(_0x9cbe19,_0xca651d){return db[_0xfbf3('0x2a')][_0xfbf3('0x46')](_0x9cbe19[_0xfbf3('0x47')],{})[_0xfbf3('0x22')](respondWithResult(_0xca651d,0xc9))[_0xfbf3('0x43')](handleError(_0xca651d,null));};exports[_0xfbf3('0x21')]=function(_0x4bf609,_0x2669eb){if(_0x4bf609['body']['id']){delete _0x4bf609[_0xfbf3('0x47')]['id'];}return db['FaxQueueReport'][_0xfbf3('0x45')]({'where':{'id':_0x4bf609[_0xfbf3('0x48')]['id']}})['then'](handleEntityNotFound(_0x2669eb,null))[_0xfbf3('0x22')](saveUpdates(_0x4bf609[_0xfbf3('0x47')],null))[_0xfbf3('0x22')](respondWithResult(_0x2669eb,null))[_0xfbf3('0x43')](handleError(_0x2669eb,null));};exports[_0xfbf3('0x23')]=function(_0x48eac3,_0x2c610a){return db[_0xfbf3('0x2a')]['find']({'where':{'id':_0x48eac3[_0xfbf3('0x48')]['id']}})['then'](handleEntityNotFound(_0x2c610a,null))[_0xfbf3('0x22')](removeEntity(_0x2c610a,null))[_0xfbf3('0x43')](handleError(_0x2c610a,null));};exports['describe']=function(_0x3fe5fc,_0x5a61a3){return db['FaxQueueReport'][_0xfbf3('0x49')]()[_0xfbf3('0x22')](respondWithResult(_0x5a61a3,null))[_0xfbf3('0x43')](handleError(_0x5a61a3,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 5429b4c..1b77371 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 _0x7a54=['report_fax_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','FaxQueueReport'];(function(_0x3b998d,_0x3a7ee9){var _0x4d415e=function(_0x4a5952){while(--_0x4a5952){_0x3b998d['push'](_0x3b998d['shift']());}};_0x4d415e(++_0x3a7ee9);}(_0x7a54,0x106));var _0x47a5=function(_0x228879,_0x2fade2){_0x228879=_0x228879-0x0;var _0x375267=_0x7a54[_0x228879];return _0x375267;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x47a5('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5fc3=['util','api','moment','bluebird','request-promise','path','../../config/environment','./faxQueueReport.attributes','exports','define','report_fax_queue','uniqueid','lodash'];(function(_0x217ce7,_0x592574){var _0x4d3f53=function(_0x26d25c){while(--_0x26d25c){_0x217ce7['push'](_0x217ce7['shift']());}};_0x4d3f53(++_0x592574);}(_0x5fc3,0xa8));var _0x35fc=function(_0x409deb,_0x2b731){_0x409deb=_0x409deb-0x0;var _0x15a4f7=_0x5fc3[_0x409deb];return _0x15a4f7;};'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')]('FaxQueueReport',attributes,{'tableName':_0x35fc('0xb'),'paranoid':![],'indexes':[{'name':_0x35fc('0xc'),'fields':[_0x35fc('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 8f1952c..517c326 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 _0xa1f1=['request\x20sent','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateFaxQueueReport','body','options','raw','info','UpdateFaxQueueReport','update','where','attributes','then','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','FaxQueueReport,\x20%s,\x20%s'];(function(_0x193857,_0x476b7d){var _0x2dbf2a=function(_0x4c5e97){while(--_0x4c5e97){_0x193857['push'](_0x193857['shift']());}};_0x2dbf2a(++_0x476b7d);}(_0xa1f1,0x6b));var _0x1a1f=function(_0x2181fc,_0x7283aa){_0x2181fc=_0x2181fc-0x0;var _0x315da1=_0xa1f1[_0x2181fc];return _0x315da1;};'use strict';var _=require(_0x1a1f('0x0'));var util=require(_0x1a1f('0x1'));var moment=require('moment');var BPromise=require(_0x1a1f('0x2'));var rs=require(_0x1a1f('0x3'));var fs=require('fs');var Redis=require(_0x1a1f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1a1f('0x5'));var logger=require(_0x1a1f('0x6'))(_0x1a1f('0x7'));var config=require(_0x1a1f('0x8'));var jayson=require(_0x1a1f('0x9'));var client=jayson[_0x1a1f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x121108,_0x73c01d,_0x5caaa8){return new BPromise(function(_0x53c533,_0x4cc84d){return client[_0x1a1f('0xb')](_0x121108,_0x5caaa8)['then'](function(_0x5eef0c){logger['info'](_0x1a1f('0xc'),_0x73c01d,_0x1a1f('0xd'));logger['debug'](_0x1a1f('0xe'),_0x73c01d,_0x1a1f('0xd'),JSON[_0x1a1f('0xf')](_0x5eef0c));if(_0x5eef0c[_0x1a1f('0x10')]){if(_0x5eef0c[_0x1a1f('0x10')][_0x1a1f('0x11')]===0x1f4){logger[_0x1a1f('0x10')](_0x1a1f('0xc'),_0x73c01d,_0x5eef0c[_0x1a1f('0x10')][_0x1a1f('0x12')]);return _0x4cc84d(_0x5eef0c['error'][_0x1a1f('0x12')]);}logger[_0x1a1f('0x10')]('FaxQueueReport,\x20%s,\x20%s',_0x73c01d,_0x5eef0c[_0x1a1f('0x10')]['message']);return _0x53c533(_0x5eef0c[_0x1a1f('0x10')][_0x1a1f('0x12')]);}else{logger['info'](_0x1a1f('0xc'),_0x73c01d,_0x1a1f('0xd'));_0x53c533(_0x5eef0c['result']['message']);}})[_0x1a1f('0x13')](function(_0x3b6ba5){logger[_0x1a1f('0x10')](_0x1a1f('0xc'),_0x73c01d,_0x3b6ba5);_0x4cc84d(_0x3b6ba5);});});}exports[_0x1a1f('0x14')]=function(_0x308c7b){var _0xa4fd1b=this;return new Promise(function(_0x1d7992,_0x13a3ae){return db['FaxQueueReport']['create'](_0x308c7b[_0x1a1f('0x15')],{'raw':_0x308c7b[_0x1a1f('0x16')]?_0x308c7b['options'][_0x1a1f('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x33c8a2){logger[_0x1a1f('0x18')]('CreateFaxQueueReport',_0x308c7b);logger['debug']('CreateFaxQueueReport',_0x308c7b,JSON[_0x1a1f('0xf')](_0x33c8a2));_0x1d7992(_0x33c8a2);})['catch'](function(_0x2b4e4c){logger[_0x1a1f('0x10')](_0x1a1f('0x14'),_0x2b4e4c[_0x1a1f('0x12')],_0x308c7b);_0x13a3ae(_0xa4fd1b[_0x1a1f('0x10')](0x1f4,_0x2b4e4c[_0x1a1f('0x12')]));});});};exports[_0x1a1f('0x19')]=function(_0x458dad){var _0x4a2f5e=this;return new Promise(function(_0x50615c,_0x18cbd1){return db['FaxQueueReport'][_0x1a1f('0x1a')](_0x458dad[_0x1a1f('0x15')],{'raw':_0x458dad[_0x1a1f('0x16')]?_0x458dad[_0x1a1f('0x16')][_0x1a1f('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x458dad[_0x1a1f('0x16')]?_0x458dad[_0x1a1f('0x16')][_0x1a1f('0x1b')]||null:null,'attributes':_0x458dad[_0x1a1f('0x16')]?_0x458dad[_0x1a1f('0x16')][_0x1a1f('0x1c')]||null:null,'limit':_0x458dad[_0x1a1f('0x16')]?_0x458dad[_0x1a1f('0x16')]['limit']||null:null})[_0x1a1f('0x1d')](function(_0x537701){logger[_0x1a1f('0x18')](_0x1a1f('0x19'),_0x458dad);logger['debug']('UpdateFaxQueueReport',_0x458dad,JSON[_0x1a1f('0xf')](_0x537701));_0x50615c(_0x537701);})['catch'](function(_0x7144e4){logger[_0x1a1f('0x10')]('UpdateFaxQueueReport',_0x7144e4[_0x1a1f('0x12')],_0x458dad);_0x18cbd1(_0x4a2f5e[_0x1a1f('0x10')](0x1f4,_0x7144e4['message']));});});}; \ No newline at end of file +var _0x405c=['error','FaxQueueReport,\x20%s,\x20%s','message','result','create','body','options','CreateFaxQueueReport','catch','UpdateFaxQueueReport','FaxQueueReport','update','raw','where','attributes','limit','stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','request','then','info','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0x405c,0x91));var _0xc405=function(_0x95af24,_0x2ad9d3){_0x95af24=_0x95af24-0x0;var _0x31902e=_0x405c[_0x95af24];return _0x31902e;};'use strict';var _=require(_0xc405('0x0'));var util=require(_0xc405('0x1'));var moment=require('moment');var BPromise=require(_0xc405('0x2'));var rs=require(_0xc405('0x3'));var fs=require('fs');var Redis=require(_0xc405('0x4'));var db=require(_0xc405('0x5'))['db'];var utils=require(_0xc405('0x6'));var logger=require('../../config/logger')(_0xc405('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc405('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x226f6d,_0x3a8de9,_0x1c3d70){return new BPromise(function(_0x18adb4,_0x12da03){return client[_0xc405('0x9')](_0x226f6d,_0x1c3d70)[_0xc405('0xa')](function(_0x28e570){logger[_0xc405('0xb')]('FaxQueueReport,\x20%s,\x20%s',_0x3a8de9,_0xc405('0xc'));logger[_0xc405('0xd')](_0xc405('0xe'),_0x3a8de9,_0xc405('0xc'),JSON['stringify'](_0x28e570));if(_0x28e570[_0xc405('0xf')]){if(_0x28e570['error']['code']===0x1f4){logger[_0xc405('0xf')](_0xc405('0x10'),_0x3a8de9,_0x28e570[_0xc405('0xf')]['message']);return _0x12da03(_0x28e570[_0xc405('0xf')]['message']);}logger['error'](_0xc405('0x10'),_0x3a8de9,_0x28e570[_0xc405('0xf')][_0xc405('0x11')]);return _0x18adb4(_0x28e570['error'][_0xc405('0x11')]);}else{logger[_0xc405('0xb')](_0xc405('0x10'),_0x3a8de9,_0xc405('0xc'));_0x18adb4(_0x28e570[_0xc405('0x12')]['message']);}})['catch'](function(_0x26fc31){logger['error'](_0xc405('0x10'),_0x3a8de9,_0x26fc31);_0x12da03(_0x26fc31);});});}exports['CreateFaxQueueReport']=function(_0x28d6fb){var _0x4b051d=this;return new Promise(function(_0x6cdc05,_0xaff3bc){return db['FaxQueueReport'][_0xc405('0x13')](_0x28d6fb[_0xc405('0x14')],{'raw':_0x28d6fb['options']?_0x28d6fb[_0xc405('0x15')]['raw']===undefined?!![]:![]:!![]})[_0xc405('0xa')](function(_0x2d481a){logger['info'](_0xc405('0x16'),_0x28d6fb);logger[_0xc405('0xd')]('CreateFaxQueueReport',_0x28d6fb,JSON['stringify'](_0x2d481a));_0x6cdc05(_0x2d481a);})[_0xc405('0x17')](function(_0x1cf7f2){logger['error'](_0xc405('0x16'),_0x1cf7f2[_0xc405('0x11')],_0x28d6fb);_0xaff3bc(_0x4b051d[_0xc405('0xf')](0x1f4,_0x1cf7f2[_0xc405('0x11')]));});});};exports[_0xc405('0x18')]=function(_0x4a26c5){var _0x22f3de=this;return new Promise(function(_0x2603c7,_0x4d60f6){return db[_0xc405('0x19')][_0xc405('0x1a')](_0x4a26c5[_0xc405('0x14')],{'raw':_0x4a26c5[_0xc405('0x15')]?_0x4a26c5['options'][_0xc405('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4a26c5[_0xc405('0x15')]?_0x4a26c5[_0xc405('0x15')][_0xc405('0x1c')]||null:null,'attributes':_0x4a26c5[_0xc405('0x15')]?_0x4a26c5[_0xc405('0x15')][_0xc405('0x1d')]||null:null,'limit':_0x4a26c5[_0xc405('0x15')]?_0x4a26c5[_0xc405('0x15')][_0xc405('0x1e')]||null:null})['then'](function(_0x28041a){logger[_0xc405('0xb')](_0xc405('0x18'),_0x4a26c5);logger['debug']('UpdateFaxQueueReport',_0x4a26c5,JSON[_0xc405('0x1f')](_0x28041a));_0x2603c7(_0x28041a);})[_0xc405('0x17')](function(_0x4d9541){logger[_0xc405('0xf')](_0xc405('0x18'),_0x4d9541[_0xc405('0x11')],_0x4a26c5);_0x4d60f6(_0x22f3de['error'](0x1f4,_0x4d9541[_0xc405('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index b35923a..d886a88 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 _0x5474=['get','index','/describe','isAuthenticated','/:id','show','post','create','put','destroy','multer','util','path','connect-timeout','express','../../components/interaction/service','./faxQueueReport.controller'];(function(_0x40822a,_0x582b60){var _0x357420=function(_0x6cee0b){while(--_0x6cee0b){_0x40822a['push'](_0x40822a['shift']());}};_0x357420(++_0x582b60);}(_0x5474,0x15e));var _0x4547=function(_0x38d21f,_0x7920f3){_0x38d21f=_0x38d21f-0x0;var _0x3ffd50=_0x5474[_0x38d21f];return _0x3ffd50;};'use strict';var multer=require(_0x4547('0x0'));var util=require(_0x4547('0x1'));var path=require(_0x4547('0x2'));var timeout=require(_0x4547('0x3'));var express=require(_0x4547('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4547('0x5'));var config=require('../../config/environment');var controller=require(_0x4547('0x6'));router[_0x4547('0x7')]('/',auth['isAuthenticated'](),controller[_0x4547('0x8')]);router[_0x4547('0x7')](_0x4547('0x9'),auth[_0x4547('0xa')](),controller['describe']);router[_0x4547('0x7')](_0x4547('0xb'),auth['isAuthenticated'](),controller[_0x4547('0xc')]);router[_0x4547('0xd')]('/',auth['isAuthenticated'](),controller[_0x4547('0xe')]);router[_0x4547('0xf')](_0x4547('0xb'),auth[_0x4547('0xa')](),controller['update']);router['delete'](_0x4547('0xb'),auth[_0x4547('0xa')](),controller[_0x4547('0x10')]);module['exports']=router; \ No newline at end of file +var _0x59f5=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout'];(function(_0x3d6b0e,_0x490d38){var _0x268553=function(_0x231516){while(--_0x231516){_0x3d6b0e['push'](_0x3d6b0e['shift']());}};_0x268553(++_0x490d38);}(_0x59f5,0x19f));var _0x559f=function(_0x27785b,_0x375427){_0x27785b=_0x27785b-0x0;var _0xb406e3=_0x59f5[_0x27785b];return _0xb406e3;};'use strict';var multer=require(_0x559f('0x0'));var util=require('util');var path=require(_0x559f('0x1'));var timeout=require(_0x559f('0x2'));var express=require(_0x559f('0x3'));var router=express['Router']();var fs_extra=require(_0x559f('0x4'));var auth=require(_0x559f('0x5'));var interaction=require(_0x559f('0x6'));var config=require(_0x559f('0x7'));var controller=require('./faxQueueReport.controller');router['get']('/',auth[_0x559f('0x8')](),controller[_0x559f('0x9')]);router[_0x559f('0xa')](_0x559f('0xb'),auth['isAuthenticated'](),controller[_0x559f('0xc')]);router[_0x559f('0xa')]('/:id',auth[_0x559f('0x8')](),controller['show']);router['post']('/',auth[_0x559f('0x8')](),controller['create']);router[_0x559f('0xd')](_0x559f('0xe'),auth[_0x559f('0x8')](),controller[_0x559f('0xf')]);router[_0x559f('0x10')](_0x559f('0xe'),auth['isAuthenticated'](),controller[_0x559f('0x11')]);module[_0x559f('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 90676d2..2828d51 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 _0xe706=['NOW','moment','sequelize','exports','ENUM','account','agent','queue','DATE'];(function(_0x4eede1,_0x3ab4e0){var _0x4298eb=function(_0x2c9f8a){while(--_0x2c9f8a){_0x4eede1['push'](_0x4eede1['shift']());}};_0x4298eb(++_0x3ab4e0);}(_0xe706,0xa3));var _0x6e70=function(_0x320cb3,_0x49c0cf){_0x320cb3=_0x320cb3-0x0;var _0x899c86=_0xe706[_0x320cb3];return _0x899c86;};'use strict';var moment=require(_0x6e70('0x0'));var Sequelize=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x6e70('0x3')](_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6')),'allowNull':![],'defaultValue':_0x6e70('0x6')},'transferredAt':{'type':Sequelize[_0x6e70('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x6e70('0x8')]}}; \ No newline at end of file +var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x6263e8,_0x5e5748){var _0x159ecd=function(_0x3b44b1){while(--_0x3b44b1){_0x6263e8['push'](_0x6263e8['shift']());}};_0x159ecd(++_0x5e5748);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x5f3562,_0x212f41){_0x5f3562=_0x5f3562-0x0;var _0x1b39b4=_0xf3cd[_0x5f3562];return _0x1b39b4;};'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 68ca455..8eede43 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 _0x70c1=['rawAttributes','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','merge','type','options','includeAll','include','findAll','rows','show','keys','length','find','catch','create','body','destroy','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','end','error','stack','name','send','map','FaxTransferReport'];(function(_0x1c2d3d,_0x10fc39){var _0xcc7553=function(_0x4bec44){while(--_0x4bec44){_0x1c2d3d['push'](_0x1c2d3d['shift']());}};_0xcc7553(++_0x10fc39);}(_0x70c1,0xf3));var _0x170c=function(_0x214909,_0x507439){_0x214909=_0x214909-0x0;var _0x3d3536=_0x70c1[_0x214909];return _0x3d3536;};'use strict';var emlformat=require(_0x170c('0x0'));var rimraf=require(_0x170c('0x1'));var zipdir=require(_0x170c('0x2'));var jsonpatch=require(_0x170c('0x3'));var rp=require(_0x170c('0x4'));var moment=require('moment');var BPromise=require(_0x170c('0x5'));var Mustache=require('mustache');var util=require(_0x170c('0x6'));var path=require(_0x170c('0x7'));var sox=require(_0x170c('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x170c('0x9'));var _=require('lodash');var squel=require(_0x170c('0xa'));var crypto=require(_0x170c('0xb'));var jsforce=require(_0x170c('0xc'));var deskjs=require(_0x170c('0xd'));var toCsv=require('to-csv');var querystring=require(_0x170c('0xe'));var Papa=require(_0x170c('0xf'));var Redis=require(_0x170c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x170c('0x11'));var as=require(_0x170c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x170c('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x170c('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x525816,_0x22d15b){_0x22d15b=_0x22d15b||0xcc;return function(_0x539aa5){if(_0x539aa5){return _0x525816[_0x170c('0x15')](_0x22d15b);}return _0x525816['status'](_0x22d15b)['end']();};}function respondWithResult(_0x36a5ec,_0x31c7be){_0x31c7be=_0x31c7be||0xc8;return function(_0xbf4adb){if(_0xbf4adb){return _0x36a5ec[_0x170c('0x16')](_0x31c7be)[_0x170c('0x17')](_0xbf4adb);}};}function respondWithFilteredResult(_0x5a5a22,_0x34afc9){return function(_0x511b98){if(_0x511b98){var _0x508eae=typeof _0x34afc9[_0x170c('0x18')]===_0x170c('0x19')&&typeof _0x34afc9[_0x170c('0x1a')]==='undefined';var _0x26d6a7=_0x511b98[_0x170c('0x1b')];var _0x314bc7=_0x508eae?0x0:_0x34afc9[_0x170c('0x18')];var _0x2202dd=_0x508eae?_0x511b98[_0x170c('0x1b')]:_0x34afc9[_0x170c('0x18')]+_0x34afc9[_0x170c('0x1a')];var _0x21f217;if(_0x2202dd>=_0x26d6a7){_0x2202dd=_0x26d6a7;_0x21f217=0xc8;}else{_0x21f217=0xce;}_0x5a5a22['status'](_0x21f217);return _0x5a5a22[_0x170c('0x1c')](_0x170c('0x1d'),_0x314bc7+'-'+_0x2202dd+'/'+_0x26d6a7)['json'](_0x511b98);}return null;};}function patchUpdates(_0x1a9edd){return function(_0x56992a){try{jsonpatch['apply'](_0x56992a,_0x1a9edd,!![]);}catch(_0x25c2cf){return BPromise[_0x170c('0x1e')](_0x25c2cf);}return _0x56992a[_0x170c('0x1f')]();};}function saveUpdates(_0x849510,_0x45721c){return function(_0xd2a474){if(_0xd2a474){return _0xd2a474[_0x170c('0x20')](_0x849510)[_0x170c('0x21')](function(_0x5c4c8c){return _0x5c4c8c;});}return null;};}function removeEntity(_0x3fabc3,_0xde42c9){return function(_0x21e724){if(_0x21e724){return _0x21e724['destroy']()[_0x170c('0x21')](function(){_0x3fabc3[_0x170c('0x16')](0xcc)[_0x170c('0x22')]();});}};}function handleEntityNotFound(_0x1fe9e6,_0x4e30d5){return function(_0x2bb6a8){if(!_0x2bb6a8){_0x1fe9e6['sendStatus'](0x194);}return _0x2bb6a8;};}function handleError(_0x267211,_0xbbcb76){_0xbbcb76=_0xbbcb76||0x1f4;return function(_0x7ddb28){logger[_0x170c('0x23')](_0x7ddb28[_0x170c('0x24')]);if(_0x7ddb28['name']){delete _0x7ddb28[_0x170c('0x25')];}_0x267211[_0x170c('0x16')](_0xbbcb76)[_0x170c('0x26')](_0x7ddb28);};}exports['index']=function(_0x28bd3a,_0x1ae542){var _0x576f19={},_0x4afaff={},_0x2eaea0={'count':0x0,'rows':[]};var _0x303023=_[_0x170c('0x27')](db[_0x170c('0x28')][_0x170c('0x29')],function(_0x49900e){return{'name':_0x49900e['fieldName'],'type':_0x49900e['type'][_0x170c('0x2a')]};});_0x4afaff[_0x170c('0x2b')]=_[_0x170c('0x27')](_0x303023,'name');_0x4afaff[_0x170c('0x2c')]=_['keys'](_0x28bd3a[_0x170c('0x2c')]);_0x4afaff[_0x170c('0x2d')]=_[_0x170c('0x2e')](_0x4afaff[_0x170c('0x2b')],_0x4afaff[_0x170c('0x2c')]);_0x576f19[_0x170c('0x2f')]=_[_0x170c('0x2e')](_0x4afaff['model'],qs[_0x170c('0x30')](_0x28bd3a[_0x170c('0x2c')][_0x170c('0x30')]));_0x576f19[_0x170c('0x2f')]=_0x576f19['attributes']['length']?_0x576f19[_0x170c('0x2f')]:_0x4afaff['model'];if(!_0x28bd3a[_0x170c('0x2c')][_0x170c('0x31')](_0x170c('0x32'))){_0x576f19['limit']=qs[_0x170c('0x1a')](_0x28bd3a[_0x170c('0x2c')][_0x170c('0x1a')]);_0x576f19['offset']=qs[_0x170c('0x18')](_0x28bd3a[_0x170c('0x2c')][_0x170c('0x18')]);}_0x576f19['order']=qs['sort'](_0x28bd3a[_0x170c('0x2c')][_0x170c('0x33')]);_0x576f19[_0x170c('0x34')]=qs[_0x170c('0x2d')](_['pick'](_0x28bd3a['query'],_0x4afaff[_0x170c('0x2d')]),_0x303023);if(_0x28bd3a['query'][_0x170c('0x35')]){_0x576f19[_0x170c('0x34')]=_[_0x170c('0x36')](_0x576f19[_0x170c('0x34')],{'$or':_[_0x170c('0x27')](_0x303023,function(_0x5f3bbf){if(_0x5f3bbf[_0x170c('0x37')]!=='VIRTUAL'){var _0x1f9335={};_0x1f9335[_0x5f3bbf[_0x170c('0x25')]]={'$like':'%'+_0x28bd3a[_0x170c('0x2c')][_0x170c('0x35')]+'%'};return _0x1f9335;}})});}_0x576f19=_[_0x170c('0x36')]({},_0x576f19,_0x28bd3a[_0x170c('0x38')]);var _0x5ef895={'where':_0x576f19['where']};return db[_0x170c('0x28')][_0x170c('0x1b')](_0x5ef895)[_0x170c('0x21')](function(_0x495f6d){_0x2eaea0[_0x170c('0x1b')]=_0x495f6d;if(_0x28bd3a[_0x170c('0x2c')][_0x170c('0x39')]){_0x576f19[_0x170c('0x3a')]=[{'all':!![]}];}return db[_0x170c('0x28')][_0x170c('0x3b')](_0x576f19);})[_0x170c('0x21')](function(_0x539a75){_0x2eaea0[_0x170c('0x3c')]=_0x539a75;return _0x2eaea0;})['then'](respondWithFilteredResult(_0x1ae542,_0x576f19))['catch'](handleError(_0x1ae542,null));};exports[_0x170c('0x3d')]=function(_0x227e9b,_0x34713b){var _0x2165dd={'raw':!![],'where':{'id':_0x227e9b['params']['id']}},_0x21b239={};_0x21b239[_0x170c('0x2b')]=_[_0x170c('0x3e')](db[_0x170c('0x28')][_0x170c('0x29')]);_0x21b239[_0x170c('0x2c')]=_['keys'](_0x227e9b[_0x170c('0x2c')]);_0x21b239[_0x170c('0x2d')]=_[_0x170c('0x2e')](_0x21b239[_0x170c('0x2b')],_0x21b239[_0x170c('0x2c')]);_0x2165dd[_0x170c('0x2f')]=_[_0x170c('0x2e')](_0x21b239[_0x170c('0x2b')],qs[_0x170c('0x30')](_0x227e9b[_0x170c('0x2c')][_0x170c('0x30')]));_0x2165dd[_0x170c('0x2f')]=_0x2165dd[_0x170c('0x2f')][_0x170c('0x3f')]?_0x2165dd[_0x170c('0x2f')]:_0x21b239[_0x170c('0x2b')];if(_0x227e9b[_0x170c('0x2c')]['includeAll']){_0x2165dd[_0x170c('0x3a')]=[{'all':!![]}];}_0x2165dd=_['merge']({},_0x2165dd,_0x227e9b['options']);return db[_0x170c('0x28')][_0x170c('0x40')](_0x2165dd)[_0x170c('0x21')](handleEntityNotFound(_0x34713b,null))[_0x170c('0x21')](respondWithResult(_0x34713b,null))[_0x170c('0x41')](handleError(_0x34713b,null));};exports[_0x170c('0x42')]=function(_0x2ada05,_0x2e9751){return db['FaxTransferReport'][_0x170c('0x42')](_0x2ada05[_0x170c('0x43')],{})[_0x170c('0x21')](respondWithResult(_0x2e9751,0xc9))[_0x170c('0x41')](handleError(_0x2e9751,null));};exports[_0x170c('0x20')]=function(_0x325852,_0x59a27c){if(_0x325852['body']['id']){delete _0x325852[_0x170c('0x43')]['id'];}return db[_0x170c('0x28')][_0x170c('0x40')]({'where':{'id':_0x325852['params']['id']}})[_0x170c('0x21')](handleEntityNotFound(_0x59a27c,null))['then'](saveUpdates(_0x325852[_0x170c('0x43')],null))[_0x170c('0x21')](respondWithResult(_0x59a27c,null))['catch'](handleError(_0x59a27c,null));};exports[_0x170c('0x44')]=function(_0x22c393,_0x2a8bc0){return db[_0x170c('0x28')][_0x170c('0x40')]({'where':{'id':_0x22c393[_0x170c('0x45')]['id']}})[_0x170c('0x21')](handleEntityNotFound(_0x2a8bc0,null))['then'](removeEntity(_0x2a8bc0,null))[_0x170c('0x41')](handleError(_0x2a8bc0,null));};exports['describe']=function(_0x30e244,_0x3f6466){return db[_0x170c('0x28')][_0x170c('0x46')]()['then'](respondWithResult(_0x3f6466,null))['catch'](handleError(_0x3f6466,null));}; \ No newline at end of file +var _0x8bbc=['end','json','offset','limit','undefined','count','Content-Range','apply','save','update','then','destroy','error','name','send','FaxTransferReport','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','include','rows','catch','show','params','rawAttributes','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x2dcd5f,_0x3ba7bf){var _0x44cf64=function(_0x5a911f){while(--_0x5a911f){_0x2dcd5f['push'](_0x2dcd5f['shift']());}};_0x44cf64(++_0x3ba7bf);}(_0x8bbc,0x7a));var _0xc8bb=function(_0xc14df7,_0x163f90){_0xc14df7=_0xc14df7-0x0;var _0x34a445=_0x8bbc[_0xc14df7];return _0x34a445;};'use strict';var emlformat=require(_0xc8bb('0x0'));var rimraf=require(_0xc8bb('0x1'));var zipdir=require(_0xc8bb('0x2'));var jsonpatch=require(_0xc8bb('0x3'));var rp=require('request-promise');var moment=require(_0xc8bb('0x4'));var BPromise=require(_0xc8bb('0x5'));var Mustache=require(_0xc8bb('0x6'));var util=require(_0xc8bb('0x7'));var path=require(_0xc8bb('0x8'));var sox=require(_0xc8bb('0x9'));var csv=require('to-csv');var ejs=require(_0xc8bb('0xa'));var fs=require('fs');var fs_extra=require(_0xc8bb('0xb'));var _=require(_0xc8bb('0xc'));var squel=require(_0xc8bb('0xd'));var crypto=require(_0xc8bb('0xe'));var jsforce=require(_0xc8bb('0xf'));var deskjs=require(_0xc8bb('0x10'));var toCsv=require(_0xc8bb('0x11'));var querystring=require(_0xc8bb('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc8bb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc8bb('0x14'))(_0xc8bb('0x15'));var utils=require(_0xc8bb('0x16'));var config=require(_0xc8bb('0x17'));var licenseUtil=require(_0xc8bb('0x18'));var db=require(_0xc8bb('0x19'))['db'];function respondWithStatusCode(_0x2f98c5,_0x2308bf){_0x2308bf=_0x2308bf||0xcc;return function(_0x348609){if(_0x348609){return _0x2f98c5[_0xc8bb('0x1a')](_0x2308bf);}return _0x2f98c5[_0xc8bb('0x1b')](_0x2308bf)[_0xc8bb('0x1c')]();};}function respondWithResult(_0x559b96,_0x3f1354){_0x3f1354=_0x3f1354||0xc8;return function(_0x2b7bd3){if(_0x2b7bd3){return _0x559b96[_0xc8bb('0x1b')](_0x3f1354)[_0xc8bb('0x1d')](_0x2b7bd3);}};}function respondWithFilteredResult(_0x8542d,_0x551113){return function(_0x103b64){if(_0x103b64){var _0x3041ee=typeof _0x551113[_0xc8bb('0x1e')]==='undefined'&&typeof _0x551113[_0xc8bb('0x1f')]===_0xc8bb('0x20');var _0x34dd1e=_0x103b64['count'];var _0x4d0948=_0x3041ee?0x0:_0x551113[_0xc8bb('0x1e')];var _0x56790b=_0x3041ee?_0x103b64[_0xc8bb('0x21')]:_0x551113[_0xc8bb('0x1e')]+_0x551113['limit'];var _0x49365f;if(_0x56790b>=_0x34dd1e){_0x56790b=_0x34dd1e;_0x49365f=0xc8;}else{_0x49365f=0xce;}_0x8542d[_0xc8bb('0x1b')](_0x49365f);return _0x8542d['set'](_0xc8bb('0x22'),_0x4d0948+'-'+_0x56790b+'/'+_0x34dd1e)[_0xc8bb('0x1d')](_0x103b64);}return null;};}function patchUpdates(_0x3c459c){return function(_0x52924d){try{jsonpatch[_0xc8bb('0x23')](_0x52924d,_0x3c459c,!![]);}catch(_0x3972af){return BPromise['reject'](_0x3972af);}return _0x52924d[_0xc8bb('0x24')]();};}function saveUpdates(_0x26610d,_0x96d8b){return function(_0x1db898){if(_0x1db898){return _0x1db898[_0xc8bb('0x25')](_0x26610d)[_0xc8bb('0x26')](function(_0x341883){return _0x341883;});}return null;};}function removeEntity(_0x2e4052,_0x265bc8){return function(_0x41ec4c){if(_0x41ec4c){return _0x41ec4c[_0xc8bb('0x27')]()[_0xc8bb('0x26')](function(){_0x2e4052[_0xc8bb('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x281cd8,_0x36359a){return function(_0x593116){if(!_0x593116){_0x281cd8[_0xc8bb('0x1a')](0x194);}return _0x593116;};}function handleError(_0x26b07b,_0x474cd5){_0x474cd5=_0x474cd5||0x1f4;return function(_0x425e71){logger[_0xc8bb('0x28')](_0x425e71['stack']);if(_0x425e71[_0xc8bb('0x29')]){delete _0x425e71[_0xc8bb('0x29')];}_0x26b07b[_0xc8bb('0x1b')](_0x474cd5)[_0xc8bb('0x2a')](_0x425e71);};}exports['index']=function(_0x374a13,_0x563bda){var _0x10ade1={},_0x1305d2={},_0x5d18c8={'count':0x0,'rows':[]};var _0x3acca1=_['map'](db[_0xc8bb('0x2b')]['rawAttributes'],function(_0x37920b){return{'name':_0x37920b[_0xc8bb('0x2c')],'type':_0x37920b['type'][_0xc8bb('0x2d')]};});_0x1305d2[_0xc8bb('0x2e')]=_[_0xc8bb('0x2f')](_0x3acca1,'name');_0x1305d2[_0xc8bb('0x30')]=_[_0xc8bb('0x31')](_0x374a13[_0xc8bb('0x30')]);_0x1305d2[_0xc8bb('0x32')]=_[_0xc8bb('0x33')](_0x1305d2[_0xc8bb('0x2e')],_0x1305d2[_0xc8bb('0x30')]);_0x10ade1['attributes']=_[_0xc8bb('0x33')](_0x1305d2[_0xc8bb('0x2e')],qs[_0xc8bb('0x34')](_0x374a13[_0xc8bb('0x30')][_0xc8bb('0x34')]));_0x10ade1[_0xc8bb('0x35')]=_0x10ade1[_0xc8bb('0x35')][_0xc8bb('0x36')]?_0x10ade1[_0xc8bb('0x35')]:_0x1305d2['model'];if(!_0x374a13[_0xc8bb('0x30')][_0xc8bb('0x37')](_0xc8bb('0x38'))){_0x10ade1[_0xc8bb('0x1f')]=qs[_0xc8bb('0x1f')](_0x374a13[_0xc8bb('0x30')]['limit']);_0x10ade1['offset']=qs[_0xc8bb('0x1e')](_0x374a13[_0xc8bb('0x30')][_0xc8bb('0x1e')]);}_0x10ade1['order']=qs[_0xc8bb('0x39')](_0x374a13['query'][_0xc8bb('0x39')]);_0x10ade1[_0xc8bb('0x3a')]=qs[_0xc8bb('0x32')](_[_0xc8bb('0x3b')](_0x374a13[_0xc8bb('0x30')],_0x1305d2['filters']),_0x3acca1);if(_0x374a13[_0xc8bb('0x30')][_0xc8bb('0x3c')]){_0x10ade1['where']=_['merge'](_0x10ade1[_0xc8bb('0x3a')],{'$or':_[_0xc8bb('0x2f')](_0x3acca1,function(_0x4a8d76){if(_0x4a8d76['type']!==_0xc8bb('0x3d')){var _0x7676c7={};_0x7676c7[_0x4a8d76[_0xc8bb('0x29')]]={'$like':'%'+_0x374a13['query'][_0xc8bb('0x3c')]+'%'};return _0x7676c7;}})});}_0x10ade1=_[_0xc8bb('0x3e')]({},_0x10ade1,_0x374a13[_0xc8bb('0x3f')]);var _0x53e43b={'where':_0x10ade1[_0xc8bb('0x3a')]};return db['FaxTransferReport'][_0xc8bb('0x21')](_0x53e43b)[_0xc8bb('0x26')](function(_0x24abb0){_0x5d18c8[_0xc8bb('0x21')]=_0x24abb0;if(_0x374a13[_0xc8bb('0x30')]['includeAll']){_0x10ade1[_0xc8bb('0x40')]=[{'all':!![]}];}return db[_0xc8bb('0x2b')]['findAll'](_0x10ade1);})[_0xc8bb('0x26')](function(_0xad4a66){_0x5d18c8[_0xc8bb('0x41')]=_0xad4a66;return _0x5d18c8;})[_0xc8bb('0x26')](respondWithFilteredResult(_0x563bda,_0x10ade1))[_0xc8bb('0x42')](handleError(_0x563bda,null));};exports[_0xc8bb('0x43')]=function(_0x3b79af,_0x3c5264){var _0x3c4a9c={'raw':!![],'where':{'id':_0x3b79af[_0xc8bb('0x44')]['id']}},_0x100239={};_0x100239[_0xc8bb('0x2e')]=_[_0xc8bb('0x31')](db[_0xc8bb('0x2b')][_0xc8bb('0x45')]);_0x100239[_0xc8bb('0x30')]=_[_0xc8bb('0x31')](_0x3b79af[_0xc8bb('0x30')]);_0x100239[_0xc8bb('0x32')]=_[_0xc8bb('0x33')](_0x100239['model'],_0x100239['query']);_0x3c4a9c[_0xc8bb('0x35')]=_['intersection'](_0x100239[_0xc8bb('0x2e')],qs[_0xc8bb('0x34')](_0x3b79af[_0xc8bb('0x30')][_0xc8bb('0x34')]));_0x3c4a9c[_0xc8bb('0x35')]=_0x3c4a9c[_0xc8bb('0x35')]['length']?_0x3c4a9c[_0xc8bb('0x35')]:_0x100239[_0xc8bb('0x2e')];if(_0x3b79af['query'][_0xc8bb('0x46')]){_0x3c4a9c[_0xc8bb('0x40')]=[{'all':!![]}];}_0x3c4a9c=_['merge']({},_0x3c4a9c,_0x3b79af[_0xc8bb('0x3f')]);return db[_0xc8bb('0x2b')][_0xc8bb('0x47')](_0x3c4a9c)[_0xc8bb('0x26')](handleEntityNotFound(_0x3c5264,null))[_0xc8bb('0x26')](respondWithResult(_0x3c5264,null))[_0xc8bb('0x42')](handleError(_0x3c5264,null));};exports['create']=function(_0x5c0736,_0x4cf73b){return db[_0xc8bb('0x2b')][_0xc8bb('0x48')](_0x5c0736[_0xc8bb('0x49')],{})[_0xc8bb('0x26')](respondWithResult(_0x4cf73b,0xc9))[_0xc8bb('0x42')](handleError(_0x4cf73b,null));};exports[_0xc8bb('0x25')]=function(_0x4d4105,_0x3b9d10){if(_0x4d4105[_0xc8bb('0x49')]['id']){delete _0x4d4105[_0xc8bb('0x49')]['id'];}return db[_0xc8bb('0x2b')]['find']({'where':{'id':_0x4d4105['params']['id']}})[_0xc8bb('0x26')](handleEntityNotFound(_0x3b9d10,null))[_0xc8bb('0x26')](saveUpdates(_0x4d4105[_0xc8bb('0x49')],null))['then'](respondWithResult(_0x3b9d10,null))[_0xc8bb('0x42')](handleError(_0x3b9d10,null));};exports['destroy']=function(_0x57e7d9,_0x19e069){return db[_0xc8bb('0x2b')][_0xc8bb('0x47')]({'where':{'id':_0x57e7d9[_0xc8bb('0x44')]['id']}})[_0xc8bb('0x26')](handleEntityNotFound(_0x19e069,null))['then'](removeEntity(_0x19e069,null))[_0xc8bb('0x42')](handleError(_0x19e069,null));};exports[_0xc8bb('0x4a')]=function(_0x27a6ed,_0x12f191){return db[_0xc8bb('0x2b')][_0xc8bb('0x4a')]()[_0xc8bb('0x26')](respondWithResult(_0x12f191,null))[_0xc8bb('0x42')](handleError(_0x12f191,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 46abd88..2eebfb3 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 _0xacae=['rimraf','./faxTransferReport.attributes','exports','define','FaxTransferReport','uniqueid','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x4d4700,_0x19ceae){var _0x11c4bf=function(_0x13386c){while(--_0x13386c){_0x4d4700['push'](_0x4d4700['shift']());}};_0x11c4bf(++_0x19ceae);}(_0xacae,0x103));var _0xeaca=function(_0x471eec,_0x97e5f7){_0x471eec=_0x471eec-0x0;var _0x42818f=_0xacae[_0x471eec];return _0x42818f;};'use strict';var _=require(_0xeaca('0x0'));var util=require('util');var logger=require(_0xeaca('0x1'))('api');var moment=require(_0xeaca('0x2'));var BPromise=require(_0xeaca('0x3'));var rp=require(_0xeaca('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xeaca('0x5'));var config=require('../../config/environment');var attributes=require(_0xeaca('0x6'));module[_0xeaca('0x7')]=function(_0x28a2b9,_0x47015c){return _0x28a2b9[_0xeaca('0x8')](_0xeaca('0x9'),attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xeaca('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc638=['api','bluebird','request-promise','path','rimraf','../../config/environment','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util'];(function(_0x149225,_0x5869e2){var _0x21e6ac=function(_0x3bbef8){while(--_0x3bbef8){_0x149225['push'](_0x149225['shift']());}};_0x21e6ac(++_0x5869e2);}(_0xc638,0x112));var _0x8c63=function(_0x3768f6,_0x2c8ad6){_0x3768f6=_0x3768f6-0x0;var _0x9b1902=_0xc638[_0x3768f6];return _0x9b1902;};'use strict';var _=require(_0x8c63('0x0'));var util=require(_0x8c63('0x1'));var logger=require('../../config/logger')(_0x8c63('0x2'));var moment=require('moment');var BPromise=require(_0x8c63('0x3'));var rp=require(_0x8c63('0x4'));var fs=require('fs');var path=require(_0x8c63('0x5'));var rimraf=require(_0x8c63('0x6'));var config=require(_0x8c63('0x7'));var attributes=require('./faxTransferReport.attributes');module['exports']=function(_0x4f6303,_0x5deb49){return _0x4f6303[_0x8c63('0x8')](_0x8c63('0x9'),attributes,{'tableName':_0x8c63('0xa'),'paranoid':![],'indexes':[{'name':_0x8c63('0xb'),'fields':[_0x8c63('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index ce73972..bfde82f 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 _0xbbe8=['bluebird','rpc','../../config/environment','jayson/promise','then','info','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxTransferReport,\x20%s,\x20%s','message','catch','lodash','util','moment'];(function(_0x50a004,_0x193d84){var _0x5e9992=function(_0x3c8c37){while(--_0x3c8c37){_0x50a004['push'](_0x50a004['shift']());}};_0x5e9992(++_0x193d84);}(_0xbbe8,0x165));var _0x8bbe=function(_0x54ea6d,_0xcb0c43){_0x54ea6d=_0x54ea6d-0x0;var _0x492640=_0xbbe8[_0x54ea6d];return _0x492640;};'use strict';var _=require(_0x8bbe('0x0'));var util=require(_0x8bbe('0x1'));var moment=require(_0x8bbe('0x2'));var BPromise=require(_0x8bbe('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8bbe('0x4'));var config=require(_0x8bbe('0x5'));var jayson=require(_0x8bbe('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x408ebf,_0x2dfb77,_0x4fbed4){return new BPromise(function(_0x43af40,_0x31f31a){return client['request'](_0x408ebf,_0x4fbed4)[_0x8bbe('0x7')](function(_0x25b03a){logger[_0x8bbe('0x8')]('FaxTransferReport,\x20%s,\x20%s',_0x2dfb77,_0x8bbe('0x9'));logger[_0x8bbe('0xa')](_0x8bbe('0xb'),_0x2dfb77,'request\x20sent',JSON[_0x8bbe('0xc')](_0x25b03a));if(_0x25b03a[_0x8bbe('0xd')]){if(_0x25b03a[_0x8bbe('0xd')][_0x8bbe('0xe')]===0x1f4){logger[_0x8bbe('0xd')](_0x8bbe('0xf'),_0x2dfb77,_0x25b03a[_0x8bbe('0xd')][_0x8bbe('0x10')]);return _0x31f31a(_0x25b03a[_0x8bbe('0xd')][_0x8bbe('0x10')]);}logger[_0x8bbe('0xd')](_0x8bbe('0xf'),_0x2dfb77,_0x25b03a[_0x8bbe('0xd')][_0x8bbe('0x10')]);return _0x43af40(_0x25b03a[_0x8bbe('0xd')][_0x8bbe('0x10')]);}else{logger[_0x8bbe('0x8')](_0x8bbe('0xf'),_0x2dfb77,_0x8bbe('0x9'));_0x43af40(_0x25b03a['result'][_0x8bbe('0x10')]);}})[_0x8bbe('0x11')](function(_0x3b99a0){logger[_0x8bbe('0xd')](_0x8bbe('0xf'),_0x2dfb77,_0x3b99a0);_0x31f31a(_0x3b99a0);});});} \ No newline at end of file +var _0xf878=['message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','then','info','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','error','code','FaxTransferReport,\x20%s,\x20%s'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xf878,0x7b));var _0x8f87=function(_0x3cb39f,_0x40c71b){_0x3cb39f=_0x3cb39f-0x0;var _0x45021d=_0xf878[_0x3cb39f];return _0x45021d;};'use strict';var _=require(_0x8f87('0x0'));var util=require('util');var moment=require(_0x8f87('0x1'));var BPromise=require('bluebird');var rs=require(_0x8f87('0x2'));var fs=require('fs');var Redis=require(_0x8f87('0x3'));var db=require(_0x8f87('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8f87('0x5'))(_0x8f87('0x6'));var config=require(_0x8f87('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8f87('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x18c695,_0x5cd814,_0xfe4716){return new BPromise(function(_0x40b125,_0x400584){return client['request'](_0x18c695,_0xfe4716)[_0x8f87('0x9')](function(_0x5b2eb0){logger[_0x8f87('0xa')]('FaxTransferReport,\x20%s,\x20%s',_0x5cd814,_0x8f87('0xb'));logger[_0x8f87('0xc')](_0x8f87('0xd'),_0x5cd814,_0x8f87('0xb'),JSON['stringify'](_0x5b2eb0));if(_0x5b2eb0[_0x8f87('0xe')]){if(_0x5b2eb0['error'][_0x8f87('0xf')]===0x1f4){logger[_0x8f87('0xe')]('FaxTransferReport,\x20%s,\x20%s',_0x5cd814,_0x5b2eb0[_0x8f87('0xe')]['message']);return _0x400584(_0x5b2eb0[_0x8f87('0xe')]['message']);}logger[_0x8f87('0xe')](_0x8f87('0x10'),_0x5cd814,_0x5b2eb0[_0x8f87('0xe')]['message']);return _0x40b125(_0x5b2eb0[_0x8f87('0xe')][_0x8f87('0x11')]);}else{logger[_0x8f87('0xa')](_0x8f87('0x10'),_0x5cd814,_0x8f87('0xb'));_0x40b125(_0x5b2eb0[_0x8f87('0x12')]['message']);}})[_0x8f87('0x13')](function(_0x2bf863){logger[_0x8f87('0xe')]('FaxTransferReport,\x20%s,\x20%s',_0x5cd814,_0x2bf863);_0x400584(_0x2bf863);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index b2d3278..06979ae 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 _0x36fb=['../../config/environment','get','index','/describe','isAuthenticated','/:id','post','put','update','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0xc5d872,_0x7ecafa){var _0x2476ff=function(_0x2a4794){while(--_0x2a4794){_0xc5d872['push'](_0xc5d872['shift']());}};_0x2476ff(++_0x7ecafa);}(_0x36fb,0x1e7));var _0xb36f=function(_0x8299df,_0x2887e1){_0x8299df=_0x8299df-0x0;var _0x4a707f=_0x36fb[_0x8299df];return _0x4a707f;};'use strict';var multer=require(_0xb36f('0x0'));var util=require(_0xb36f('0x1'));var path=require(_0xb36f('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb36f('0x3')]();var fs_extra=require(_0xb36f('0x4'));var auth=require(_0xb36f('0x5'));var interaction=require(_0xb36f('0x6'));var config=require(_0xb36f('0x7'));var controller=require('./faxTransferReport.controller');router[_0xb36f('0x8')]('/',auth['isAuthenticated'](),controller[_0xb36f('0x9')]);router[_0xb36f('0x8')](_0xb36f('0xa'),auth[_0xb36f('0xb')](),controller['describe']);router['get'](_0xb36f('0xc'),auth[_0xb36f('0xb')](),controller['show']);router[_0xb36f('0xd')]('/',auth[_0xb36f('0xb')](),controller['create']);router[_0xb36f('0xe')](_0xb36f('0xc'),auth[_0xb36f('0xb')](),controller[_0xb36f('0xf')]);router[_0xb36f('0x10')](_0xb36f('0xc'),auth[_0xb36f('0xb')](),controller[_0xb36f('0x11')]);module[_0xb36f('0x12')]=router; \ No newline at end of file +var _0x7095=['isAuthenticated','post','create','/:id','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','/describe'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x7095,0x127));var _0x5709=function(_0xca5839,_0x2792f7){_0xca5839=_0xca5839-0x0;var _0x105c88=_0x7095[_0xca5839];return _0x105c88;};'use strict';var multer=require(_0x5709('0x0'));var util=require('util');var path=require(_0x5709('0x1'));var timeout=require(_0x5709('0x2'));var express=require(_0x5709('0x3'));var router=express[_0x5709('0x4')]();var fs_extra=require(_0x5709('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x5709('0x6'));var config=require(_0x5709('0x7'));var controller=require(_0x5709('0x8'));router[_0x5709('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5709('0x9')](_0x5709('0xa'),auth[_0x5709('0xb')](),controller['describe']);router[_0x5709('0x9')]('/:id',auth[_0x5709('0xb')](),controller['show']);router[_0x5709('0xc')]('/',auth['isAuthenticated'](),controller[_0x5709('0xd')]);router['put'](_0x5709('0xe'),auth[_0x5709('0xb')](),controller[_0x5709('0xf')]);router[_0x5709('0x10')](_0x5709('0xe'),auth[_0x5709('0xb')](),controller['destroy']);module[_0x5709('0x11')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 0ec6948..0902af3 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 _0xa606=['getConfigurations','getFields','create','/:id/configurations','put','update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./intDeskAccount.controller','get','index','isAuthenticated','show'];(function(_0x2a2451,_0x4e6e31){var _0x53b38f=function(_0x59be8f){while(--_0x59be8f){_0x2a2451['push'](_0x2a2451['shift']());}};_0x53b38f(++_0x4e6e31);}(_0xa606,0x198));var _0x6a60=function(_0x2aa792,_0x291069){_0x2aa792=_0x2aa792-0x0;var _0x10dfce=_0xa606[_0x2aa792];return _0x10dfce;};'use strict';var multer=require(_0x6a60('0x0'));var util=require(_0x6a60('0x1'));var path=require(_0x6a60('0x2'));var timeout=require(_0x6a60('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x6a60('0x4'));var auth=require(_0x6a60('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6a60('0x6'));var controller=require(_0x6a60('0x7'));router[_0x6a60('0x8')]('/',auth['isAuthenticated'](),controller[_0x6a60('0x9')]);router[_0x6a60('0x8')]('/:id',auth[_0x6a60('0xa')](),controller[_0x6a60('0xb')]);router[_0x6a60('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x6a60('0xc')]);router[_0x6a60('0x8')]('/:id/fields',auth[_0x6a60('0xa')](),controller[_0x6a60('0xd')]);router['post']('/',auth[_0x6a60('0xa')](),controller[_0x6a60('0xe')]);router['post'](_0x6a60('0xf'),auth[_0x6a60('0xa')](),controller['addConfiguration']);router[_0x6a60('0x10')]('/:id',auth[_0x6a60('0xa')](),controller[_0x6a60('0x11')]);router[_0x6a60('0x12')]('/:id',auth[_0x6a60('0xa')](),controller[_0x6a60('0x13')]);module[_0x6a60('0x14')]=router; \ No newline at end of file +var _0x6928=['get','/:id','/:id/configurations','getConfigurations','/:id/fields','post','addConfiguration','delete','destroy','exports','multer','util','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','isAuthenticated','index'];(function(_0x222c69,_0x4f6267){var _0x55ba8f=function(_0x2a3900){while(--_0x2a3900){_0x222c69['push'](_0x222c69['shift']());}};_0x55ba8f(++_0x4f6267);}(_0x6928,0x14d));var _0x8692=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0x6928[_0x13b8f3];return _0x1a6d06;};'use strict';var multer=require(_0x8692('0x0'));var util=require(_0x8692('0x1'));var path=require('path');var timeout=require(_0x8692('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x8692('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x8692('0x4'));var config=require(_0x8692('0x5'));var controller=require(_0x8692('0x6'));router['get']('/',auth[_0x8692('0x7')](),controller[_0x8692('0x8')]);router[_0x8692('0x9')](_0x8692('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x8692('0x9')](_0x8692('0xb'),auth['isAuthenticated'](),controller[_0x8692('0xc')]);router[_0x8692('0x9')](_0x8692('0xd'),auth[_0x8692('0x7')](),controller['getFields']);router[_0x8692('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x8692('0xe')](_0x8692('0xb'),auth[_0x8692('0x7')](),controller[_0x8692('0xf')]);router['put']('/:id',auth[_0x8692('0x7')](),controller['update']);router[_0x8692('0x10')](_0x8692('0xa'),auth[_0x8692('0x7')](),controller[_0x8692('0x11')]);module[_0x8692('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 09182d8..7cdd968 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 _0x62bc=['exports','STRING','ENUM','basic','integrationTab','newTab','sequelize'];(function(_0x2007d8,_0x5dce57){var _0xc88bc0=function(_0x1e1662){while(--_0x1e1662){_0x2007d8['push'](_0x2007d8['shift']());}};_0xc88bc0(++_0x5dce57);}(_0x62bc,0xb5));var _0xc62b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x62bc[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xc62b('0x0'));module[_0xc62b('0x1')]={'name':{'type':Sequelize[_0xc62b('0x2')]},'description':{'type':Sequelize[_0xc62b('0x2')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xc62b('0x2')]},'authType':{'type':Sequelize[_0xc62b('0x3')](_0xc62b('0x4')),'defaultValue':_0xc62b('0x4')},'password':{'type':Sequelize[_0xc62b('0x2')]},'consumerKey':{'type':Sequelize[_0xc62b('0x2')]},'consumerSecret':{'type':Sequelize[_0xc62b('0x2')]},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize[_0xc62b('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xc62b('0x3')](_0xc62b('0x5'),_0xc62b('0x6')),'defaultValue':_0xc62b('0x5')}}; \ No newline at end of file +var _0xf154=['basic','integrationTab','newTab','sequelize','exports','STRING'];(function(_0x23f8ae,_0x520203){var _0x347b92=function(_0x26133c){while(--_0x26133c){_0x23f8ae['push'](_0x23f8ae['shift']());}};_0x347b92(++_0x520203);}(_0xf154,0x1b3));var _0x4f15=function(_0x2b8487,_0x3c0353){_0x2b8487=_0x2b8487-0x0;var _0x433952=_0xf154[_0x2b8487];return _0x433952;};'use strict';var Sequelize=require(_0x4f15('0x0'));module[_0x4f15('0x1')]={'name':{'type':Sequelize[_0x4f15('0x2')]},'description':{'type':Sequelize[_0x4f15('0x2')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize['ENUM'](_0x4f15('0x3')),'defaultValue':_0x4f15('0x3')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize[_0x4f15('0x2')]},'consumerSecret':{'type':Sequelize[_0x4f15('0x2')]},'token':{'type':Sequelize[_0x4f15('0x2')]},'tokenSecret':{'type':Sequelize[_0x4f15('0x2')]},'serverUrl':{'type':Sequelize[_0x4f15('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x4f15('0x4'),_0x4f15('0x5')),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index efe4b96..6156add 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 _0x27d0=['map','DeskAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','params','keys','find','catch','create','body','getConfigurations','findOne','DeskConfiguration','order','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','DeskField','getFields','priority','remoteUri','username','password','consumerSecret','token','tokenSecret','slice','lastIndexOf','GET','format','authType','basic','headers','Authorization','%s:%s','toString','base64','entries','label','statusCode','getFields,\x20%s,\x20%s,\x20%s','test','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','status','send','index'];(function(_0x2c6810,_0x23c079){var _0x213881=function(_0x528021){while(--_0x528021){_0x2c6810['push'](_0x2c6810['shift']());}};_0x213881(++_0x23c079);}(_0x27d0,0xb6));var _0x027d=function(_0x55f1d2,_0x57961a){_0x55f1d2=_0x55f1d2-0x0;var _0x1168b9=_0x27d0[_0x55f1d2];return _0x1168b9;};'use strict';var emlformat=require(_0x027d('0x0'));var rimraf=require(_0x027d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x027d('0x2'));var rp=require(_0x027d('0x3'));var moment=require('moment');var BPromise=require(_0x027d('0x4'));var Mustache=require(_0x027d('0x5'));var util=require(_0x027d('0x6'));var path=require(_0x027d('0x7'));var sox=require(_0x027d('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x027d('0x9'));var _=require('lodash');var squel=require(_0x027d('0xa'));var crypto=require(_0x027d('0xb'));var jsforce=require(_0x027d('0xc'));var deskjs=require(_0x027d('0xd'));var toCsv=require(_0x027d('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x027d('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x027d('0x10'));var as=require(_0x027d('0x11'));var hardwareService=require(_0x027d('0x12'));var logger=require(_0x027d('0x13'))(_0x027d('0x14'));var utils=require(_0x027d('0x15'));var config=require(_0x027d('0x16'));var licenseUtil=require(_0x027d('0x17'));var db=require(_0x027d('0x18'))['db'];var integrations=require(_0x027d('0x19'));function respondWithStatusCode(_0x1256d3,_0x4e52b4){_0x4e52b4=_0x4e52b4||0xcc;return function(_0x3bf16c){if(_0x3bf16c){return _0x1256d3[_0x027d('0x1a')](_0x4e52b4);}return _0x1256d3['status'](_0x4e52b4)[_0x027d('0x1b')]();};}function respondWithResult(_0x327ab5,_0x5ba756){_0x5ba756=_0x5ba756||0xc8;return function(_0x4e200e){if(_0x4e200e){return _0x327ab5['status'](_0x5ba756)[_0x027d('0x1c')](_0x4e200e);}};}function respondWithFilteredResult(_0x1ab360,_0x5dfd95){return function(_0x1a8851){if(_0x1a8851){var _0x2a6f25=typeof _0x5dfd95[_0x027d('0x1d')]===_0x027d('0x1e')&&typeof _0x5dfd95[_0x027d('0x1f')]===_0x027d('0x1e');var _0x168786=_0x1a8851[_0x027d('0x20')];var _0xe562f4=_0x2a6f25?0x0:_0x5dfd95[_0x027d('0x1d')];var _0x22173a=_0x2a6f25?_0x1a8851['count']:_0x5dfd95[_0x027d('0x1d')]+_0x5dfd95['limit'];var _0x567463;if(_0x22173a>=_0x168786){_0x22173a=_0x168786;_0x567463=0xc8;}else{_0x567463=0xce;}_0x1ab360['status'](_0x567463);return _0x1ab360[_0x027d('0x21')](_0x027d('0x22'),_0xe562f4+'-'+_0x22173a+'/'+_0x168786)['json'](_0x1a8851);}return null;};}function patchUpdates(_0x20b093){return function(_0x78360d){try{jsonpatch[_0x027d('0x23')](_0x78360d,_0x20b093,!![]);}catch(_0x4086d0){return BPromise['reject'](_0x4086d0);}return _0x78360d[_0x027d('0x24')]();};}function saveUpdates(_0xbcaf80,_0x3270f0){return function(_0x84bd55){if(_0x84bd55){return _0x84bd55[_0x027d('0x25')](_0xbcaf80)[_0x027d('0x26')](function(_0x289565){return _0x289565;});}return null;};}function removeEntity(_0x519e0e,_0x2db8f3){return function(_0x408562){if(_0x408562){return _0x408562[_0x027d('0x27')]()[_0x027d('0x26')](function(){_0x519e0e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x52bccd,_0x1baffd){return function(_0x2d1d6f){if(!_0x2d1d6f){_0x52bccd['sendStatus'](0x194);}return _0x2d1d6f;};}function handleError(_0x26e500,_0x26daa3){_0x26daa3=_0x26daa3||0x1f4;return function(_0x1bdb66){logger[_0x027d('0x28')](_0x1bdb66[_0x027d('0x29')]);if(_0x1bdb66['name']){delete _0x1bdb66[_0x027d('0x2a')];}_0x26e500[_0x027d('0x2b')](_0x26daa3)[_0x027d('0x2c')](_0x1bdb66);};}exports[_0x027d('0x2d')]=function(_0x3eead6,_0x87dbe1){var _0x4793dd={},_0x33683f={},_0x2a03b0={'count':0x0,'rows':[]};var _0xfced62=_[_0x027d('0x2e')](db[_0x027d('0x2f')][_0x027d('0x30')],function(_0x1ffe26){return{'name':_0x1ffe26[_0x027d('0x31')],'type':_0x1ffe26[_0x027d('0x32')][_0x027d('0x33')]};});_0x33683f[_0x027d('0x34')]=_[_0x027d('0x2e')](_0xfced62,'name');_0x33683f[_0x027d('0x35')]=_['keys'](_0x3eead6[_0x027d('0x35')]);_0x33683f[_0x027d('0x36')]=_[_0x027d('0x37')](_0x33683f['model'],_0x33683f[_0x027d('0x35')]);_0x4793dd['attributes']=_[_0x027d('0x37')](_0x33683f[_0x027d('0x34')],qs[_0x027d('0x38')](_0x3eead6[_0x027d('0x35')]['fields']));_0x4793dd['attributes']=_0x4793dd[_0x027d('0x39')][_0x027d('0x3a')]?_0x4793dd[_0x027d('0x39')]:_0x33683f[_0x027d('0x34')];if(!_0x3eead6[_0x027d('0x35')][_0x027d('0x3b')](_0x027d('0x3c'))){_0x4793dd[_0x027d('0x1f')]=qs['limit'](_0x3eead6[_0x027d('0x35')]['limit']);_0x4793dd['offset']=qs[_0x027d('0x1d')](_0x3eead6[_0x027d('0x35')][_0x027d('0x1d')]);}_0x4793dd['order']=qs[_0x027d('0x3d')](_0x3eead6['query'][_0x027d('0x3d')]);_0x4793dd[_0x027d('0x3e')]=qs[_0x027d('0x36')](_[_0x027d('0x3f')](_0x3eead6[_0x027d('0x35')],_0x33683f['filters']),_0xfced62);if(_0x3eead6[_0x027d('0x35')]['filter']){_0x4793dd['where']=_[_0x027d('0x40')](_0x4793dd[_0x027d('0x3e')],{'$or':_[_0x027d('0x2e')](_0xfced62,function(_0x4c126e){if(_0x4c126e[_0x027d('0x32')]!==_0x027d('0x41')){var _0x3916c7={};_0x3916c7[_0x4c126e[_0x027d('0x2a')]]={'$like':'%'+_0x3eead6[_0x027d('0x35')][_0x027d('0x42')]+'%'};return _0x3916c7;}})});}_0x4793dd=_[_0x027d('0x40')]({},_0x4793dd,_0x3eead6[_0x027d('0x43')]);var _0x4a21ab={'where':_0x4793dd[_0x027d('0x3e')]};return db[_0x027d('0x2f')][_0x027d('0x20')](_0x4a21ab)[_0x027d('0x26')](function(_0x5467fa){_0x2a03b0[_0x027d('0x20')]=_0x5467fa;if(_0x3eead6[_0x027d('0x35')][_0x027d('0x44')]){_0x4793dd[_0x027d('0x45')]=[{'all':!![]}];}return db[_0x027d('0x2f')][_0x027d('0x46')](_0x4793dd);})[_0x027d('0x26')](function(_0x396bb4){_0x2a03b0['rows']=_0x396bb4;return _0x2a03b0;})['then'](respondWithFilteredResult(_0x87dbe1,_0x4793dd))['catch'](handleError(_0x87dbe1,null));};exports['show']=function(_0x288fc6,_0x268304){var _0x1c996d={'raw':![],'where':{'id':_0x288fc6[_0x027d('0x47')]['id']}},_0x406d7c={};_0x406d7c[_0x027d('0x34')]=_[_0x027d('0x48')](db[_0x027d('0x2f')][_0x027d('0x30')]);_0x406d7c['query']=_[_0x027d('0x48')](_0x288fc6['query']);_0x406d7c[_0x027d('0x36')]=_[_0x027d('0x37')](_0x406d7c['model'],_0x406d7c[_0x027d('0x35')]);_0x1c996d[_0x027d('0x39')]=_[_0x027d('0x37')](_0x406d7c[_0x027d('0x34')],qs[_0x027d('0x38')](_0x288fc6[_0x027d('0x35')]['fields']));_0x1c996d['attributes']=_0x1c996d[_0x027d('0x39')][_0x027d('0x3a')]?_0x1c996d['attributes']:_0x406d7c[_0x027d('0x34')];if(_0x288fc6['query'][_0x027d('0x44')]){_0x1c996d['include']=[{'all':!![]}];}_0x1c996d=_[_0x027d('0x40')]({},_0x1c996d,_0x288fc6[_0x027d('0x43')]);return db[_0x027d('0x2f')][_0x027d('0x49')](_0x1c996d)[_0x027d('0x26')](handleEntityNotFound(_0x268304,null))[_0x027d('0x26')](respondWithResult(_0x268304,null))[_0x027d('0x4a')](handleError(_0x268304,null));};exports[_0x027d('0x4b')]=function(_0x1ddaf7,_0xe743c){return db[_0x027d('0x2f')][_0x027d('0x4b')](_0x1ddaf7[_0x027d('0x4c')],{})[_0x027d('0x26')](respondWithResult(_0xe743c,0xc9))[_0x027d('0x4a')](handleError(_0xe743c,null));};exports[_0x027d('0x25')]=function(_0x550681,_0x5ba7a4){if(_0x550681[_0x027d('0x4c')]['id']){delete _0x550681[_0x027d('0x4c')]['id'];}return db[_0x027d('0x2f')]['find']({'where':{'id':_0x550681[_0x027d('0x47')]['id']}})[_0x027d('0x26')](handleEntityNotFound(_0x5ba7a4,null))[_0x027d('0x26')](saveUpdates(_0x550681[_0x027d('0x4c')],null))[_0x027d('0x26')](respondWithResult(_0x5ba7a4,null))[_0x027d('0x4a')](handleError(_0x5ba7a4,null));};exports['destroy']=function(_0x2e1aa7,_0x444db6){return db[_0x027d('0x2f')]['find']({'where':{'id':_0x2e1aa7[_0x027d('0x47')]['id']}})[_0x027d('0x26')](handleEntityNotFound(_0x444db6,null))['then'](removeEntity(_0x444db6,null))[_0x027d('0x4a')](handleError(_0x444db6,null));};exports[_0x027d('0x4d')]=function(_0x11b556,_0x1f2a72,_0x38de7b){var _0x2bf728={};var _0xa56999={};var _0x7a69bb;var _0x4ff04f;return db[_0x027d('0x2f')][_0x027d('0x4e')]({'where':{'id':_0x11b556[_0x027d('0x47')]['id']}})['then'](handleEntityNotFound(_0x1f2a72,null))[_0x027d('0x26')](function(_0x11bc7d){if(_0x11bc7d){_0x7a69bb=_0x11bc7d;_0xa56999[_0x027d('0x34')]=_[_0x027d('0x48')](db[_0x027d('0x4f')][_0x027d('0x30')]);_0xa56999[_0x027d('0x35')]=_[_0x027d('0x48')](_0x11b556['query']);_0xa56999[_0x027d('0x36')]=_[_0x027d('0x37')](_0xa56999[_0x027d('0x34')],_0xa56999[_0x027d('0x35')]);_0x2bf728['attributes']=_[_0x027d('0x37')](_0xa56999[_0x027d('0x34')],qs[_0x027d('0x38')](_0x11b556['query'][_0x027d('0x38')]));_0x2bf728[_0x027d('0x39')]=_0x2bf728[_0x027d('0x39')][_0x027d('0x3a')]?_0x2bf728[_0x027d('0x39')]:_0xa56999[_0x027d('0x34')];_0x2bf728[_0x027d('0x50')]=qs[_0x027d('0x3d')](_0x11b556[_0x027d('0x35')][_0x027d('0x3d')]);_0x2bf728[_0x027d('0x3e')]=qs['filters'](_[_0x027d('0x3f')](_0x11b556[_0x027d('0x35')],_0xa56999[_0x027d('0x36')]));if(_0x11b556[_0x027d('0x35')][_0x027d('0x42')]){_0x2bf728[_0x027d('0x3e')]=_[_0x027d('0x40')](_0x2bf728[_0x027d('0x3e')],{'$or':_['map'](_0x2bf728[_0x027d('0x39')],function(_0x359c80){var _0x2257ed={};_0x2257ed[_0x359c80]={'$like':'%'+_0x11b556[_0x027d('0x35')][_0x027d('0x42')]+'%'};return _0x2257ed;})});}_0x2bf728=_[_0x027d('0x40')]({},_0x2bf728,_0x11b556[_0x027d('0x43')]);return _0x7a69bb['getConfigurations'](_0x2bf728);}})[_0x027d('0x26')](function(_0x1a88fb){if(_0x1a88fb){_0x4ff04f=_0x1a88fb['length'];if(!_0x11b556[_0x027d('0x35')][_0x027d('0x3b')]('nolimit')){_0x2bf728[_0x027d('0x1f')]=qs[_0x027d('0x1f')](_0x11b556[_0x027d('0x35')][_0x027d('0x1f')]);_0x2bf728[_0x027d('0x1d')]=qs[_0x027d('0x1d')](_0x11b556[_0x027d('0x35')][_0x027d('0x1d')]);}return _0x7a69bb['getConfigurations'](_0x2bf728);}})[_0x027d('0x26')](function(_0x126023){if(_0x126023){return _0x126023?{'count':_0x4ff04f,'rows':_0x126023}:null;}})[_0x027d('0x26')](respondWithResult(_0x1f2a72,null))[_0x027d('0x4a')](handleError(_0x1f2a72,null));};exports[_0x027d('0x51')]=function(_0x33fd55,_0x47c32c,_0xb640e6){if(_0x33fd55[_0x027d('0x4c')]['id']){delete _0x33fd55[_0x027d('0x4c')]['id'];}return db[_0x027d('0x2f')][_0x027d('0x4e')]({'where':{'id':_0x33fd55[_0x027d('0x47')]['id']}})[_0x027d('0x26')](handleEntityNotFound(_0x47c32c,null))[_0x027d('0x26')](function(_0x4aaa1d){if(_0x4aaa1d){_0x33fd55['body'][_0x027d('0x52')]=_0x4aaa1d['id'];_0x33fd55[_0x027d('0x4c')][_0x027d('0x53')]=integrations[_0x027d('0x54')](_0x33fd55[_0x027d('0x4c')][_0x027d('0x55')],_0x33fd55[_0x027d('0x4c')]['type']);_0x33fd55[_0x027d('0x4c')][_0x027d('0x56')]=integrations[_0x027d('0x57')](_0x33fd55[_0x027d('0x4c')][_0x027d('0x55')],_0x33fd55[_0x027d('0x4c')][_0x027d('0x32')]);return db[_0x027d('0x4f')][_0x027d('0x4b')](_0x33fd55[_0x027d('0x4c')],{'include':[{'model':db['DeskField'],'as':_0x027d('0x53')},{'model':db[_0x027d('0x58')],'as':_0x027d('0x56')}]});}return null;})['then'](respondWithResult(_0x47c32c,null))[_0x027d('0x4a')](handleError(_0x47c32c,null));};exports[_0x027d('0x59')]=function(_0x5097bc,_0x4b37d2,_0x322c5e){var _0x332ebc=[{'name':_0x027d('0x5a'),'label':_0x027d('0x5a'),'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 _0xf5f33b='';return db[_0x027d('0x2f')][_0x027d('0x4e')]({'where':{'id':_0x5097bc[_0x027d('0x47')]['id']},'attributes':['id',_0x027d('0x5b'),'authType',_0x027d('0x5c'),_0x027d('0x5d'),'consumerKey',_0x027d('0x5e'),_0x027d('0x5f'),_0x027d('0x60')]})[_0x027d('0x26')](handleEntityNotFound(_0x4b37d2,null))['then'](function(_0x5e4d14){if(_0x5e4d14){_0xf5f33b=_0x5e4d14[_0x027d('0x5b')];var _0x4e6752=_0xf5f33b[_0x027d('0x61')](-0x1);if(_0x4e6752==='/'){_0xf5f33b=_0xf5f33b['substring'](0x0,_0xf5f33b[_0x027d('0x62')](_0x4e6752));}var _0x2a2845={'method':_0x027d('0x63'),'uri':util[_0x027d('0x64')]('%s/custom_fields',_0xf5f33b),'headers':{'Content-Type':'application/json','Accept':'application/json'},'json':!![]};if(_0x5e4d14[_0x027d('0x65')]===_0x027d('0x66')){_0x2a2845[_0x027d('0x67')][_0x027d('0x68')]=util[_0x027d('0x64')]('Basic\x20%s',new Buffer(util['format'](_0x027d('0x69'),_0x5e4d14['username'],_0x5e4d14[_0x027d('0x5d')]))[_0x027d('0x6a')](_0x027d('0x6b')));}return rp(_0x2a2845)[_0x027d('0x26')](function(_0x22a6c5){return _0x332ebc['concat'](_[_0x027d('0x2e')](_0x22a6c5['_embedded'][_0x027d('0x6c')],function(_0x51286c){return{'id':_0x51286c[_0x027d('0x2a')],'name':_0x51286c[_0x027d('0x2a')],'type':_0x51286c[_0x027d('0x32')],'active':_0x51286c['active'],'label':_0x51286c[_0x027d('0x6d')],'custom':!![]};}));});}})[_0x027d('0x26')](function(_0xd63f6a){return{'count':_0xd63f6a[_0x027d('0x3a')],'rows':_0xd63f6a};})[_0x027d('0x26')](respondWithResult(_0x4b37d2,null))[_0x027d('0x4a')](function(_0x59078e){var _0x10d716=_0x5097bc['query']['test']?0x1f4:_0x59078e[_0x027d('0x6e')]||0x1f4;logger[_0x027d('0x28')](_0x027d('0x6f'),_0x027d('0x59'),_0x10d716,JSON['stringify'](_0x59078e));delete _0x59078e[_0x027d('0x2a')];if(_0x10d716===0x191){_0x10d716=0x190;}_0x4b37d2['status'](_0x10d716)[_0x027d('0x2c')](_0x5097bc[_0x027d('0x35')][_0x027d('0x70')]?{'message':_0x027d('0x71'),'statusCode':_0x59078e[_0x027d('0x6e')]}:_0x59078e);});}; \ No newline at end of file +var _0xb4a4=['attributes','fields','length','nolimit','order','sort','where','filters','filter','merge','options','includeAll','include','findAll','rows','catch','show','create','body','update','params','getConfigurations','DeskConfiguration','hasOwnProperty','Subjects','channel','getDescriptions','DeskField','Descriptions','getFields','priority','findOne','authType','username','password','consumerSecret','token','tokenSecret','slice','substring','lastIndexOf','GET','application/json','basic','headers','Authorization','format','Basic\x20%s','toString','concat','_embedded','entries','active','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','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','offset','undefined','limit','count','Content-Range','json','reject','then','destroy','error','name','index','map','DeskAccount','rawAttributes','fieldName','type','query','keys','intersection','model'];(function(_0x513f31,_0x3b43f7){var _0x16c0ff=function(_0x57e286){while(--_0x57e286){_0x513f31['push'](_0x513f31['shift']());}};_0x16c0ff(++_0x3b43f7);}(_0xb4a4,0x185));var _0x4b4a=function(_0x4d7c63,_0x3d8255){_0x4d7c63=_0x4d7c63-0x0;var _0x668e23=_0xb4a4[_0x4d7c63];return _0x668e23;};'use strict';var emlformat=require(_0x4b4a('0x0'));var rimraf=require(_0x4b4a('0x1'));var zipdir=require(_0x4b4a('0x2'));var jsonpatch=require(_0x4b4a('0x3'));var rp=require(_0x4b4a('0x4'));var moment=require(_0x4b4a('0x5'));var BPromise=require(_0x4b4a('0x6'));var Mustache=require(_0x4b4a('0x7'));var util=require('util');var path=require('path');var sox=require(_0x4b4a('0x8'));var csv=require(_0x4b4a('0x9'));var ejs=require(_0x4b4a('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4b4a('0xb'));var squel=require('squel');var crypto=require(_0x4b4a('0xc'));var jsforce=require(_0x4b4a('0xd'));var deskjs=require(_0x4b4a('0xe'));var toCsv=require(_0x4b4a('0x9'));var querystring=require(_0x4b4a('0xf'));var Papa=require('papaparse');var Redis=require(_0x4b4a('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x4b4a('0x11'));var as=require(_0x4b4a('0x12'));var hardwareService=require(_0x4b4a('0x13'));var logger=require(_0x4b4a('0x14'))(_0x4b4a('0x15'));var utils=require(_0x4b4a('0x16'));var config=require(_0x4b4a('0x17'));var licenseUtil=require(_0x4b4a('0x18'));var db=require(_0x4b4a('0x19'))['db'];var integrations=require(_0x4b4a('0x1a'));function respondWithStatusCode(_0x1a2678,_0x298f0f){_0x298f0f=_0x298f0f||0xcc;return function(_0x125bc4){if(_0x125bc4){return _0x1a2678[_0x4b4a('0x1b')](_0x298f0f);}return _0x1a2678[_0x4b4a('0x1c')](_0x298f0f)[_0x4b4a('0x1d')]();};}function respondWithResult(_0x2dd75e,_0xa1fd40){_0xa1fd40=_0xa1fd40||0xc8;return function(_0x50e872){if(_0x50e872){return _0x2dd75e[_0x4b4a('0x1c')](_0xa1fd40)['json'](_0x50e872);}};}function respondWithFilteredResult(_0x256cf5,_0x55850e){return function(_0x3f50cc){if(_0x3f50cc){var _0x48fc5a=typeof _0x55850e[_0x4b4a('0x1e')]===_0x4b4a('0x1f')&&typeof _0x55850e[_0x4b4a('0x20')]===_0x4b4a('0x1f');var _0x5441aa=_0x3f50cc[_0x4b4a('0x21')];var _0x42cd1b=_0x48fc5a?0x0:_0x55850e[_0x4b4a('0x1e')];var _0x10bbd2=_0x48fc5a?_0x3f50cc[_0x4b4a('0x21')]:_0x55850e[_0x4b4a('0x1e')]+_0x55850e[_0x4b4a('0x20')];var _0x5c0997;if(_0x10bbd2>=_0x5441aa){_0x10bbd2=_0x5441aa;_0x5c0997=0xc8;}else{_0x5c0997=0xce;}_0x256cf5[_0x4b4a('0x1c')](_0x5c0997);return _0x256cf5['set'](_0x4b4a('0x22'),_0x42cd1b+'-'+_0x10bbd2+'/'+_0x5441aa)[_0x4b4a('0x23')](_0x3f50cc);}return null;};}function patchUpdates(_0x1817eb){return function(_0xeaafd4){try{jsonpatch['apply'](_0xeaafd4,_0x1817eb,!![]);}catch(_0x188194){return BPromise[_0x4b4a('0x24')](_0x188194);}return _0xeaafd4['save']();};}function saveUpdates(_0x92374,_0x56be12){return function(_0x1131bb){if(_0x1131bb){return _0x1131bb['update'](_0x92374)[_0x4b4a('0x25')](function(_0x42e8f6){return _0x42e8f6;});}return null;};}function removeEntity(_0xb167d3,_0x4c56c3){return function(_0x4ca4fa){if(_0x4ca4fa){return _0x4ca4fa[_0x4b4a('0x26')]()[_0x4b4a('0x25')](function(){_0xb167d3[_0x4b4a('0x1c')](0xcc)[_0x4b4a('0x1d')]();});}};}function handleEntityNotFound(_0x1a3a7f,_0x11801f){return function(_0x27136a){if(!_0x27136a){_0x1a3a7f[_0x4b4a('0x1b')](0x194);}return _0x27136a;};}function handleError(_0x5d0f77,_0x409094){_0x409094=_0x409094||0x1f4;return function(_0x16a660){logger[_0x4b4a('0x27')](_0x16a660['stack']);if(_0x16a660[_0x4b4a('0x28')]){delete _0x16a660[_0x4b4a('0x28')];}_0x5d0f77[_0x4b4a('0x1c')](_0x409094)['send'](_0x16a660);};}exports[_0x4b4a('0x29')]=function(_0x30cb19,_0x4b218a){var _0x8b6ce1={},_0x2a4d2f={},_0x2da918={'count':0x0,'rows':[]};var _0x571e21=_[_0x4b4a('0x2a')](db[_0x4b4a('0x2b')][_0x4b4a('0x2c')],function(_0x4d6881){return{'name':_0x4d6881[_0x4b4a('0x2d')],'type':_0x4d6881[_0x4b4a('0x2e')]['key']};});_0x2a4d2f['model']=_[_0x4b4a('0x2a')](_0x571e21,_0x4b4a('0x28'));_0x2a4d2f[_0x4b4a('0x2f')]=_[_0x4b4a('0x30')](_0x30cb19[_0x4b4a('0x2f')]);_0x2a4d2f['filters']=_[_0x4b4a('0x31')](_0x2a4d2f[_0x4b4a('0x32')],_0x2a4d2f['query']);_0x8b6ce1[_0x4b4a('0x33')]=_[_0x4b4a('0x31')](_0x2a4d2f[_0x4b4a('0x32')],qs[_0x4b4a('0x34')](_0x30cb19[_0x4b4a('0x2f')]['fields']));_0x8b6ce1['attributes']=_0x8b6ce1['attributes'][_0x4b4a('0x35')]?_0x8b6ce1[_0x4b4a('0x33')]:_0x2a4d2f[_0x4b4a('0x32')];if(!_0x30cb19[_0x4b4a('0x2f')]['hasOwnProperty'](_0x4b4a('0x36'))){_0x8b6ce1[_0x4b4a('0x20')]=qs[_0x4b4a('0x20')](_0x30cb19['query'][_0x4b4a('0x20')]);_0x8b6ce1[_0x4b4a('0x1e')]=qs[_0x4b4a('0x1e')](_0x30cb19[_0x4b4a('0x2f')]['offset']);}_0x8b6ce1[_0x4b4a('0x37')]=qs['sort'](_0x30cb19[_0x4b4a('0x2f')][_0x4b4a('0x38')]);_0x8b6ce1[_0x4b4a('0x39')]=qs['filters'](_['pick'](_0x30cb19[_0x4b4a('0x2f')],_0x2a4d2f[_0x4b4a('0x3a')]),_0x571e21);if(_0x30cb19[_0x4b4a('0x2f')][_0x4b4a('0x3b')]){_0x8b6ce1[_0x4b4a('0x39')]=_[_0x4b4a('0x3c')](_0x8b6ce1[_0x4b4a('0x39')],{'$or':_[_0x4b4a('0x2a')](_0x571e21,function(_0x10eba0){if(_0x10eba0[_0x4b4a('0x2e')]!=='VIRTUAL'){var _0x4281bb={};_0x4281bb[_0x10eba0[_0x4b4a('0x28')]]={'$like':'%'+_0x30cb19[_0x4b4a('0x2f')][_0x4b4a('0x3b')]+'%'};return _0x4281bb;}})});}_0x8b6ce1=_[_0x4b4a('0x3c')]({},_0x8b6ce1,_0x30cb19[_0x4b4a('0x3d')]);var _0x1535f6={'where':_0x8b6ce1[_0x4b4a('0x39')]};return db['DeskAccount'][_0x4b4a('0x21')](_0x1535f6)[_0x4b4a('0x25')](function(_0x11c032){_0x2da918[_0x4b4a('0x21')]=_0x11c032;if(_0x30cb19[_0x4b4a('0x2f')][_0x4b4a('0x3e')]){_0x8b6ce1[_0x4b4a('0x3f')]=[{'all':!![]}];}return db[_0x4b4a('0x2b')][_0x4b4a('0x40')](_0x8b6ce1);})[_0x4b4a('0x25')](function(_0xe04f8a){_0x2da918[_0x4b4a('0x41')]=_0xe04f8a;return _0x2da918;})[_0x4b4a('0x25')](respondWithFilteredResult(_0x4b218a,_0x8b6ce1))[_0x4b4a('0x42')](handleError(_0x4b218a,null));};exports[_0x4b4a('0x43')]=function(_0x43ecdf,_0x328aff){var _0x3849a1={'raw':![],'where':{'id':_0x43ecdf['params']['id']}},_0x3d04a1={};_0x3d04a1[_0x4b4a('0x32')]=_[_0x4b4a('0x30')](db['DeskAccount'][_0x4b4a('0x2c')]);_0x3d04a1[_0x4b4a('0x2f')]=_[_0x4b4a('0x30')](_0x43ecdf['query']);_0x3d04a1[_0x4b4a('0x3a')]=_['intersection'](_0x3d04a1[_0x4b4a('0x32')],_0x3d04a1[_0x4b4a('0x2f')]);_0x3849a1[_0x4b4a('0x33')]=_[_0x4b4a('0x31')](_0x3d04a1['model'],qs[_0x4b4a('0x34')](_0x43ecdf[_0x4b4a('0x2f')][_0x4b4a('0x34')]));_0x3849a1[_0x4b4a('0x33')]=_0x3849a1[_0x4b4a('0x33')][_0x4b4a('0x35')]?_0x3849a1['attributes']:_0x3d04a1[_0x4b4a('0x32')];if(_0x43ecdf[_0x4b4a('0x2f')]['includeAll']){_0x3849a1[_0x4b4a('0x3f')]=[{'all':!![]}];}_0x3849a1=_[_0x4b4a('0x3c')]({},_0x3849a1,_0x43ecdf[_0x4b4a('0x3d')]);return db[_0x4b4a('0x2b')]['find'](_0x3849a1)[_0x4b4a('0x25')](handleEntityNotFound(_0x328aff,null))['then'](respondWithResult(_0x328aff,null))['catch'](handleError(_0x328aff,null));};exports['create']=function(_0x4097bc,_0x487376){return db[_0x4b4a('0x2b')][_0x4b4a('0x44')](_0x4097bc[_0x4b4a('0x45')],{})['then'](respondWithResult(_0x487376,0xc9))[_0x4b4a('0x42')](handleError(_0x487376,null));};exports[_0x4b4a('0x46')]=function(_0x13c34b,_0x1308f9){if(_0x13c34b[_0x4b4a('0x45')]['id']){delete _0x13c34b[_0x4b4a('0x45')]['id'];}return db[_0x4b4a('0x2b')]['find']({'where':{'id':_0x13c34b[_0x4b4a('0x47')]['id']}})[_0x4b4a('0x25')](handleEntityNotFound(_0x1308f9,null))['then'](saveUpdates(_0x13c34b[_0x4b4a('0x45')],null))[_0x4b4a('0x25')](respondWithResult(_0x1308f9,null))[_0x4b4a('0x42')](handleError(_0x1308f9,null));};exports[_0x4b4a('0x26')]=function(_0x4a4972,_0x4e489b){return db[_0x4b4a('0x2b')]['find']({'where':{'id':_0x4a4972['params']['id']}})[_0x4b4a('0x25')](handleEntityNotFound(_0x4e489b,null))[_0x4b4a('0x25')](removeEntity(_0x4e489b,null))[_0x4b4a('0x42')](handleError(_0x4e489b,null));};exports[_0x4b4a('0x48')]=function(_0x141873,_0x3d6d42,_0x3c0982){var _0x2c947c={};var _0x1714c6={};var _0x303bb9;var _0x47a775;return db[_0x4b4a('0x2b')]['findOne']({'where':{'id':_0x141873[_0x4b4a('0x47')]['id']}})[_0x4b4a('0x25')](handleEntityNotFound(_0x3d6d42,null))['then'](function(_0x124157){if(_0x124157){_0x303bb9=_0x124157;_0x1714c6[_0x4b4a('0x32')]=_[_0x4b4a('0x30')](db[_0x4b4a('0x49')][_0x4b4a('0x2c')]);_0x1714c6[_0x4b4a('0x2f')]=_[_0x4b4a('0x30')](_0x141873[_0x4b4a('0x2f')]);_0x1714c6[_0x4b4a('0x3a')]=_['intersection'](_0x1714c6[_0x4b4a('0x32')],_0x1714c6['query']);_0x2c947c[_0x4b4a('0x33')]=_[_0x4b4a('0x31')](_0x1714c6['model'],qs[_0x4b4a('0x34')](_0x141873[_0x4b4a('0x2f')][_0x4b4a('0x34')]));_0x2c947c[_0x4b4a('0x33')]=_0x2c947c[_0x4b4a('0x33')][_0x4b4a('0x35')]?_0x2c947c[_0x4b4a('0x33')]:_0x1714c6['model'];_0x2c947c[_0x4b4a('0x37')]=qs['sort'](_0x141873['query'][_0x4b4a('0x38')]);_0x2c947c[_0x4b4a('0x39')]=qs[_0x4b4a('0x3a')](_['pick'](_0x141873[_0x4b4a('0x2f')],_0x1714c6[_0x4b4a('0x3a')]));if(_0x141873[_0x4b4a('0x2f')][_0x4b4a('0x3b')]){_0x2c947c['where']=_[_0x4b4a('0x3c')](_0x2c947c['where'],{'$or':_[_0x4b4a('0x2a')](_0x2c947c[_0x4b4a('0x33')],function(_0x2f0fdc){var _0x5b665b={};_0x5b665b[_0x2f0fdc]={'$like':'%'+_0x141873[_0x4b4a('0x2f')][_0x4b4a('0x3b')]+'%'};return _0x5b665b;})});}_0x2c947c=_[_0x4b4a('0x3c')]({},_0x2c947c,_0x141873[_0x4b4a('0x3d')]);return _0x303bb9[_0x4b4a('0x48')](_0x2c947c);}})[_0x4b4a('0x25')](function(_0xe6552f){if(_0xe6552f){_0x47a775=_0xe6552f[_0x4b4a('0x35')];if(!_0x141873[_0x4b4a('0x2f')][_0x4b4a('0x4a')]('nolimit')){_0x2c947c[_0x4b4a('0x20')]=qs['limit'](_0x141873[_0x4b4a('0x2f')]['limit']);_0x2c947c['offset']=qs[_0x4b4a('0x1e')](_0x141873[_0x4b4a('0x2f')][_0x4b4a('0x1e')]);}return _0x303bb9[_0x4b4a('0x48')](_0x2c947c);}})['then'](function(_0x225004){if(_0x225004){return _0x225004?{'count':_0x47a775,'rows':_0x225004}:null;}})[_0x4b4a('0x25')](respondWithResult(_0x3d6d42,null))[_0x4b4a('0x42')](handleError(_0x3d6d42,null));};exports['addConfiguration']=function(_0x29cf41,_0x15b345,_0x4b6601){if(_0x29cf41['body']['id']){delete _0x29cf41[_0x4b4a('0x45')]['id'];}return db[_0x4b4a('0x2b')]['findOne']({'where':{'id':_0x29cf41['params']['id']}})['then'](handleEntityNotFound(_0x15b345,null))['then'](function(_0x4cdd1f){if(_0x4cdd1f){_0x29cf41[_0x4b4a('0x45')]['AccountId']=_0x4cdd1f['id'];_0x29cf41[_0x4b4a('0x45')][_0x4b4a('0x4b')]=integrations['getSubjects'](_0x29cf41[_0x4b4a('0x45')][_0x4b4a('0x4c')],_0x29cf41[_0x4b4a('0x45')][_0x4b4a('0x2e')]);_0x29cf41[_0x4b4a('0x45')]['Descriptions']=integrations[_0x4b4a('0x4d')](_0x29cf41[_0x4b4a('0x45')][_0x4b4a('0x4c')],_0x29cf41[_0x4b4a('0x45')][_0x4b4a('0x2e')]);return db['DeskConfiguration'][_0x4b4a('0x44')](_0x29cf41['body'],{'include':[{'model':db[_0x4b4a('0x4e')],'as':_0x4b4a('0x4b')},{'model':db['DeskField'],'as':_0x4b4a('0x4f')}]});}return null;})[_0x4b4a('0x25')](respondWithResult(_0x15b345,null))[_0x4b4a('0x42')](handleError(_0x15b345,null));};exports[_0x4b4a('0x50')]=function(_0x10e572,_0x2014d8,_0x47bb45){var _0x3e474a=[{'name':_0x4b4a('0x51'),'label':_0x4b4a('0x51'),'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 _0x2dbcaa='';return db['DeskAccount'][_0x4b4a('0x52')]({'where':{'id':_0x10e572[_0x4b4a('0x47')]['id']},'attributes':['id','remoteUri',_0x4b4a('0x53'),_0x4b4a('0x54'),_0x4b4a('0x55'),'consumerKey',_0x4b4a('0x56'),_0x4b4a('0x57'),_0x4b4a('0x58')]})[_0x4b4a('0x25')](handleEntityNotFound(_0x2014d8,null))[_0x4b4a('0x25')](function(_0xb04954){if(_0xb04954){_0x2dbcaa=_0xb04954['remoteUri'];var _0x4f5d3b=_0x2dbcaa[_0x4b4a('0x59')](-0x1);if(_0x4f5d3b==='/'){_0x2dbcaa=_0x2dbcaa[_0x4b4a('0x5a')](0x0,_0x2dbcaa[_0x4b4a('0x5b')](_0x4f5d3b));}var _0x3c9529={'method':_0x4b4a('0x5c'),'uri':util['format']('%s/custom_fields',_0x2dbcaa),'headers':{'Content-Type':_0x4b4a('0x5d'),'Accept':'application/json'},'json':!![]};if(_0xb04954['authType']===_0x4b4a('0x5e')){_0x3c9529[_0x4b4a('0x5f')][_0x4b4a('0x60')]=util[_0x4b4a('0x61')](_0x4b4a('0x62'),new Buffer(util['format']('%s:%s',_0xb04954[_0x4b4a('0x54')],_0xb04954[_0x4b4a('0x55')]))[_0x4b4a('0x63')]('base64'));}return rp(_0x3c9529)[_0x4b4a('0x25')](function(_0x5d2706){return _0x3e474a[_0x4b4a('0x64')](_[_0x4b4a('0x2a')](_0x5d2706[_0x4b4a('0x65')][_0x4b4a('0x66')],function(_0x370051){return{'id':_0x370051['name'],'name':_0x370051['name'],'type':_0x370051[_0x4b4a('0x2e')],'active':_0x370051[_0x4b4a('0x67')],'label':_0x370051['label'],'custom':!![]};}));});}})[_0x4b4a('0x25')](function(_0xdabac2){return{'count':_0xdabac2[_0x4b4a('0x35')],'rows':_0xdabac2};})[_0x4b4a('0x25')](respondWithResult(_0x2014d8,null))[_0x4b4a('0x42')](function(_0x35cd97){var _0x5409dd=_0x10e572['query']['test']?0x1f4:_0x35cd97[_0x4b4a('0x68')]||0x1f4;logger[_0x4b4a('0x27')](_0x4b4a('0x69'),_0x4b4a('0x50'),_0x5409dd,JSON[_0x4b4a('0x6a')](_0x35cd97));delete _0x35cd97[_0x4b4a('0x28')];if(_0x5409dd===0x191){_0x5409dd=0x190;}_0x2014d8['status'](_0x5409dd)[_0x4b4a('0x6b')](_0x10e572[_0x4b4a('0x2f')][_0x4b4a('0x6c')]?{'message':_0x4b4a('0x6d'),'statusCode':_0x35cd97['statusCode']}:_0x35cd97);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index f784aef..fca5062 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 _0x8422=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','int_desk_accounts','lodash'];(function(_0x14a769,_0x2e547b){var _0x37ebe9=function(_0x41967c){while(--_0x41967c){_0x14a769['push'](_0x14a769['shift']());}};_0x37ebe9(++_0x2e547b);}(_0x8422,0x1d3));var _0x2842=function(_0x2067e9,_0x5e6a97){_0x2067e9=_0x2067e9-0x0;var _0x280ce4=_0x8422[_0x2067e9];return _0x280ce4;};'use strict';var _=require(_0x2842('0x0'));var util=require(_0x2842('0x1'));var logger=require(_0x2842('0x2'))(_0x2842('0x3'));var moment=require('moment');var BPromise=require(_0x2842('0x4'));var rp=require(_0x2842('0x5'));var fs=require('fs');var path=require(_0x2842('0x6'));var rimraf=require(_0x2842('0x7'));var config=require(_0x2842('0x8'));var attributes=require(_0x2842('0x9'));var integrations=require(_0x2842('0xa'));module[_0x2842('0xb')]=function(_0x59a755,_0x5ecdae){return _0x59a755['define']('DeskAccount',attributes,{'tableName':_0x2842('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x38ad=['bluebird','path','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','int_desk_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x1b2ede,_0x192b6c){var _0x5ca209=function(_0x3b432f){while(--_0x3b432f){_0x1b2ede['push'](_0x1b2ede['shift']());}};_0x5ca209(++_0x192b6c);}(_0x38ad,0x163));var _0xd38a=function(_0x2c809d,_0x5371b4){_0x2c809d=_0x2c809d-0x0;var _0x2429b6=_0x38ad[_0x2c809d];return _0x2429b6;};'use strict';var _=require(_0xd38a('0x0'));var util=require(_0xd38a('0x1'));var logger=require(_0xd38a('0x2'))(_0xd38a('0x3'));var moment=require(_0xd38a('0x4'));var BPromise=require(_0xd38a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd38a('0x6'));var rimraf=require('rimraf');var config=require(_0xd38a('0x7'));var attributes=require(_0xd38a('0x8'));var integrations=require(_0xd38a('0x9'));module[_0xd38a('0xa')]=function(_0x49ea69,_0x47fb90){return _0x49ea69['define']('DeskAccount',attributes,{'tableName':_0xd38a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.rpc.js b/server/api/intDeskAccount/intDeskAccount.rpc.js index b795cf3..0288785 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 _0xfb19=['code','message','result','catch','GetDeskAccount','findAll','options','raw','limit','map','include','model','attributes','then','ShowDeskAccount','find','where','lodash','util','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','info','DeskAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error'];(function(_0x4558c5,_0x18b582){var _0xaaea06=function(_0x1a2a29){while(--_0x1a2a29){_0x4558c5['push'](_0x4558c5['shift']());}};_0xaaea06(++_0x18b582);}(_0xfb19,0x1be));var _0x9fb1=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xfb19[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x9fb1('0x0'));var util=require(_0x9fb1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9fb1('0x2'));var db=require(_0x9fb1('0x3'))['db'];var utils=require(_0x9fb1('0x4'));var logger=require('../../config/logger')(_0x9fb1('0x5'));var config=require(_0x9fb1('0x6'));var jayson=require(_0x9fb1('0x7'));var client=jayson['client'][_0x9fb1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4274c5,_0xd7d8ce,_0x27a277){return new BPromise(function(_0x541901,_0x5ff35f){return client[_0x9fb1('0x9')](_0x4274c5,_0x27a277)['then'](function(_0x4049f2){logger[_0x9fb1('0xa')](_0x9fb1('0xb'),_0xd7d8ce,'request\x20sent');logger[_0x9fb1('0xc')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0xd7d8ce,_0x9fb1('0xd'),JSON[_0x9fb1('0xe')](_0x4049f2));if(_0x4049f2[_0x9fb1('0xf')]){if(_0x4049f2[_0x9fb1('0xf')][_0x9fb1('0x10')]===0x1f4){logger[_0x9fb1('0xf')](_0x9fb1('0xb'),_0xd7d8ce,_0x4049f2[_0x9fb1('0xf')]['message']);return _0x5ff35f(_0x4049f2['error'][_0x9fb1('0x11')]);}logger[_0x9fb1('0xf')](_0x9fb1('0xb'),_0xd7d8ce,_0x4049f2[_0x9fb1('0xf')][_0x9fb1('0x11')]);return _0x541901(_0x4049f2[_0x9fb1('0xf')][_0x9fb1('0x11')]);}else{logger[_0x9fb1('0xa')](_0x9fb1('0xb'),_0xd7d8ce,'request\x20sent');_0x541901(_0x4049f2[_0x9fb1('0x12')][_0x9fb1('0x11')]);}})[_0x9fb1('0x13')](function(_0x4ff7e2){logger[_0x9fb1('0xf')]('DeskAccount,\x20%s,\x20%s',_0xd7d8ce,_0x4ff7e2);_0x5ff35f(_0x4ff7e2);});});}exports[_0x9fb1('0x14')]=function(_0x2ab75c){var _0x51c136=this;return new Promise(function(_0x56aeb0,_0x368992){return db['DeskAccount'][_0x9fb1('0x15')]({'raw':_0x2ab75c[_0x9fb1('0x16')]?_0x2ab75c[_0x9fb1('0x16')][_0x9fb1('0x17')]===undefined?!![]:![]:!![],'where':_0x2ab75c[_0x9fb1('0x16')]?_0x2ab75c[_0x9fb1('0x16')]['where']||null:null,'attributes':_0x2ab75c['options']?_0x2ab75c[_0x9fb1('0x16')]['attributes']||null:null,'limit':_0x2ab75c['options']?_0x2ab75c[_0x9fb1('0x16')][_0x9fb1('0x18')]||null:null,'include':_0x2ab75c[_0x9fb1('0x16')]?_0x2ab75c[_0x9fb1('0x16')]['include']?_[_0x9fb1('0x19')](_0x2ab75c[_0x9fb1('0x16')][_0x9fb1('0x1a')],function(_0x2d0b17){return{'model':db[_0x2d0b17[_0x9fb1('0x1b')]],'as':_0x2d0b17['as'],'attributes':_0x2d0b17[_0x9fb1('0x1c')],'include':_0x2d0b17['include']?_[_0x9fb1('0x19')](_0x2d0b17['include'],function(_0x3eabe4){return{'model':db[_0x3eabe4[_0x9fb1('0x1b')]],'as':_0x3eabe4['as'],'attributes':_0x3eabe4[_0x9fb1('0x1c')],'include':_0x3eabe4[_0x9fb1('0x1a')]?_['map'](_0x3eabe4['include'],function(_0x45642b){return{'model':db[_0x45642b['model']],'as':_0x45642b['as'],'attributes':_0x45642b[_0x9fb1('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x9fb1('0x1d')](function(_0x1cf9bd){logger[_0x9fb1('0xa')](_0x9fb1('0x14'),_0x2ab75c);logger[_0x9fb1('0xc')](_0x9fb1('0x14'),_0x2ab75c,JSON['stringify'](_0x1cf9bd));_0x56aeb0(_0x1cf9bd);})[_0x9fb1('0x13')](function(_0x150216){logger[_0x9fb1('0xf')](_0x9fb1('0x14'),_0x150216[_0x9fb1('0x11')],_0x2ab75c);_0x368992(_0x51c136[_0x9fb1('0xf')](0x1f4,_0x150216[_0x9fb1('0x11')]));});});};exports[_0x9fb1('0x1e')]=function(_0x212f4c){var _0x29b6c4=this;return new Promise(function(_0x5359ef,_0x2f5d00){return db['DeskAccount'][_0x9fb1('0x1f')]({'raw':_0x212f4c['options']?_0x212f4c[_0x9fb1('0x16')][_0x9fb1('0x17')]===undefined?!![]:![]:!![],'where':_0x212f4c['options']?_0x212f4c['options'][_0x9fb1('0x20')]||null:null,'attributes':_0x212f4c[_0x9fb1('0x16')]?_0x212f4c[_0x9fb1('0x16')][_0x9fb1('0x1c')]||null:null,'include':_0x212f4c[_0x9fb1('0x16')]?_0x212f4c['options'][_0x9fb1('0x1a')]?_[_0x9fb1('0x19')](_0x212f4c['options'][_0x9fb1('0x1a')],function(_0x59f8ea){return{'model':db[_0x59f8ea[_0x9fb1('0x1b')]],'as':_0x59f8ea['as'],'attributes':_0x59f8ea[_0x9fb1('0x1c')],'include':_0x59f8ea[_0x9fb1('0x1a')]?_['map'](_0x59f8ea[_0x9fb1('0x1a')],function(_0x15c460){return{'model':db[_0x15c460[_0x9fb1('0x1b')]],'as':_0x15c460['as'],'attributes':_0x15c460[_0x9fb1('0x1c')],'include':_0x15c460[_0x9fb1('0x1a')]?_['map'](_0x15c460[_0x9fb1('0x1a')],function(_0x41369a){return{'model':db[_0x41369a[_0x9fb1('0x1b')]],'as':_0x41369a['as'],'attributes':_0x41369a[_0x9fb1('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x9fb1('0x1d')](function(_0x2a3a1a){logger[_0x9fb1('0xa')]('ShowDeskAccount',_0x212f4c);logger['debug'](_0x9fb1('0x1e'),_0x212f4c,JSON[_0x9fb1('0xe')](_0x2a3a1a));_0x5359ef(_0x2a3a1a);})[_0x9fb1('0x13')](function(_0x4a1fbb){logger[_0x9fb1('0xf')](_0x9fb1('0x1e'),_0x4a1fbb['message'],_0x212f4c);_0x2f5d00(_0x29b6c4[_0x9fb1('0xf')](0x1f4,_0x4a1fbb['message']));});});}; \ No newline at end of file +var _0x84f7=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','DeskAccount','findAll','options','raw','attributes','include','map','model','GetDeskAccount','catch','ShowDeskAccount','find','where'];(function(_0xbffdb5,_0x93ff24){var _0x5bc599=function(_0x272c2d){while(--_0x272c2d){_0xbffdb5['push'](_0xbffdb5['shift']());}};_0x5bc599(++_0x93ff24);}(_0x84f7,0x120));var _0x784f=function(_0x710815,_0x520da8){_0x710815=_0x710815-0x0;var _0x5b3b89=_0x84f7[_0x710815];return _0x5b3b89;};'use strict';var _=require(_0x784f('0x0'));var util=require(_0x784f('0x1'));var moment=require(_0x784f('0x2'));var BPromise=require('bluebird');var rs=require(_0x784f('0x3'));var fs=require('fs');var Redis=require(_0x784f('0x4'));var db=require(_0x784f('0x5'))['db'];var utils=require(_0x784f('0x6'));var logger=require(_0x784f('0x7'))(_0x784f('0x8'));var config=require(_0x784f('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x784f('0xa')][_0x784f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x215ca0,_0x4309a7,_0x536ca){return new BPromise(function(_0x17fcb3,_0x1b7f4c){return client[_0x784f('0xc')](_0x215ca0,_0x536ca)[_0x784f('0xd')](function(_0x5f292d){logger[_0x784f('0xe')](_0x784f('0xf'),_0x4309a7,_0x784f('0x10'));logger[_0x784f('0x11')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x4309a7,_0x784f('0x10'),JSON[_0x784f('0x12')](_0x5f292d));if(_0x5f292d[_0x784f('0x13')]){if(_0x5f292d['error'][_0x784f('0x14')]===0x1f4){logger[_0x784f('0x13')](_0x784f('0xf'),_0x4309a7,_0x5f292d[_0x784f('0x13')]['message']);return _0x1b7f4c(_0x5f292d['error'][_0x784f('0x15')]);}logger[_0x784f('0x13')]('DeskAccount,\x20%s,\x20%s',_0x4309a7,_0x5f292d[_0x784f('0x13')]['message']);return _0x17fcb3(_0x5f292d['error'][_0x784f('0x15')]);}else{logger[_0x784f('0xe')](_0x784f('0xf'),_0x4309a7,'request\x20sent');_0x17fcb3(_0x5f292d[_0x784f('0x16')]['message']);}})['catch'](function(_0x528a93){logger[_0x784f('0x13')](_0x784f('0xf'),_0x4309a7,_0x528a93);_0x1b7f4c(_0x528a93);});});}exports['GetDeskAccount']=function(_0x221a9b){var _0x4983a3=this;return new Promise(function(_0x1ad6d0,_0x11552d){return db[_0x784f('0x17')][_0x784f('0x18')]({'raw':_0x221a9b[_0x784f('0x19')]?_0x221a9b[_0x784f('0x19')][_0x784f('0x1a')]===undefined?!![]:![]:!![],'where':_0x221a9b['options']?_0x221a9b[_0x784f('0x19')]['where']||null:null,'attributes':_0x221a9b['options']?_0x221a9b['options'][_0x784f('0x1b')]||null:null,'limit':_0x221a9b[_0x784f('0x19')]?_0x221a9b[_0x784f('0x19')]['limit']||null:null,'include':_0x221a9b[_0x784f('0x19')]?_0x221a9b['options']['include']?_['map'](_0x221a9b['options'][_0x784f('0x1c')],function(_0x2d2099){return{'model':db[_0x2d2099['model']],'as':_0x2d2099['as'],'attributes':_0x2d2099[_0x784f('0x1b')],'include':_0x2d2099[_0x784f('0x1c')]?_[_0x784f('0x1d')](_0x2d2099[_0x784f('0x1c')],function(_0x2d5a0a){return{'model':db[_0x2d5a0a[_0x784f('0x1e')]],'as':_0x2d5a0a['as'],'attributes':_0x2d5a0a[_0x784f('0x1b')],'include':_0x2d5a0a[_0x784f('0x1c')]?_[_0x784f('0x1d')](_0x2d5a0a[_0x784f('0x1c')],function(_0x134fa7){return{'model':db[_0x134fa7['model']],'as':_0x134fa7['as'],'attributes':_0x134fa7[_0x784f('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x784f('0xd')](function(_0x17941c){logger[_0x784f('0xe')](_0x784f('0x1f'),_0x221a9b);logger[_0x784f('0x11')](_0x784f('0x1f'),_0x221a9b,JSON[_0x784f('0x12')](_0x17941c));_0x1ad6d0(_0x17941c);})[_0x784f('0x20')](function(_0x13d67c){logger[_0x784f('0x13')](_0x784f('0x1f'),_0x13d67c[_0x784f('0x15')],_0x221a9b);_0x11552d(_0x4983a3[_0x784f('0x13')](0x1f4,_0x13d67c[_0x784f('0x15')]));});});};exports[_0x784f('0x21')]=function(_0x121ab1){var _0x1e197b=this;return new Promise(function(_0x3bc310,_0x14bda6){return db['DeskAccount'][_0x784f('0x22')]({'raw':_0x121ab1['options']?_0x121ab1[_0x784f('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x121ab1[_0x784f('0x19')]?_0x121ab1['options'][_0x784f('0x23')]||null:null,'attributes':_0x121ab1[_0x784f('0x19')]?_0x121ab1[_0x784f('0x19')]['attributes']||null:null,'include':_0x121ab1['options']?_0x121ab1['options'][_0x784f('0x1c')]?_['map'](_0x121ab1['options']['include'],function(_0x26b9b9){return{'model':db[_0x26b9b9[_0x784f('0x1e')]],'as':_0x26b9b9['as'],'attributes':_0x26b9b9['attributes'],'include':_0x26b9b9[_0x784f('0x1c')]?_[_0x784f('0x1d')](_0x26b9b9[_0x784f('0x1c')],function(_0x2fe128){return{'model':db[_0x2fe128['model']],'as':_0x2fe128['as'],'attributes':_0x2fe128[_0x784f('0x1b')],'include':_0x2fe128['include']?_[_0x784f('0x1d')](_0x2fe128['include'],function(_0x3ed61a){return{'model':db[_0x3ed61a['model']],'as':_0x3ed61a['as'],'attributes':_0x3ed61a[_0x784f('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x784f('0xd')](function(_0x2202ef){logger['info']('ShowDeskAccount',_0x121ab1);logger['debug']('ShowDeskAccount',_0x121ab1,JSON['stringify'](_0x2202ef));_0x3bc310(_0x2202ef);})[_0x784f('0x20')](function(_0x4cdf4d){logger[_0x784f('0x13')](_0x784f('0x21'),_0x4cdf4d[_0x784f('0x15')],_0x121ab1);_0x14bda6(_0x1e197b[_0x784f('0x13')](0x1f4,_0x4cdf4d[_0x784f('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index c5dec43..c84cf13 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 _0x3e74=['show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','getTags','post','/:id/tags','setTags','update','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id'];(function(_0x1cdfcd,_0x37be5f){var _0x274b60=function(_0x34f017){while(--_0x34f017){_0x1cdfcd['push'](_0x1cdfcd['shift']());}};_0x274b60(++_0x37be5f);}(_0x3e74,0x175));var _0x43e7=function(_0x1fcb2a,_0x3ed5df){_0x1fcb2a=_0x1fcb2a-0x0;var _0x2d199e=_0x3e74[_0x1fcb2a];return _0x2d199e;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/subjects',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/tags',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0x13'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router['put']('/:id',auth[_0x43e7('0x8')](),controller[_0x43e7('0x15')]);router[_0x43e7('0x16')](_0x43e7('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x43e7('0x17')]=router; \ No newline at end of file +var _0x55ca=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','setTags','put','/:id','update','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service'];(function(_0x27c25f,_0x4ff5fe){var _0x2da4c4=function(_0x1f3c9a){while(--_0x1f3c9a){_0x27c25f['push'](_0x27c25f['shift']());}};_0x2da4c4(++_0x4ff5fe);}(_0x55ca,0x126));var _0xa55c=function(_0x5365d5,_0x51aa66){_0x5365d5=_0x5365d5-0x0;var _0x1d3d0e=_0x55ca[_0x5365d5];return _0x1d3d0e;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['getFields']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getTags']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/tags',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x13'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router['delete'](_0xa55c('0x13'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x15')]);module[_0xa55c('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 049dfd2..76562f1 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 _0xce87=['STRING','sequelize','exports'];(function(_0x3293df,_0x38665e){var _0x128927=function(_0x517450){while(--_0x517450){_0x3293df['push'](_0x3293df['shift']());}};_0x128927(++_0x38665e);}(_0xce87,0x14b));var _0x7ce8=function(_0x21096f,_0x156dec){_0x21096f=_0x21096f-0x0;var _0xcb0469=_0xce87[_0x21096f];return _0xcb0469;};'use strict';var Sequelize=require(_0x7ce8('0x0'));module[_0x7ce8('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x7ce8('0x2')]}}; \ No newline at end of file +var _0xdc59=['STRING','sequelize'];(function(_0x4dfc2c,_0x14aee4){var _0x463fdb=function(_0x9d87ef){while(--_0x9d87ef){_0x4dfc2c['push'](_0x4dfc2c['shift']());}};_0x463fdb(++_0x14aee4);}(_0xdc59,0x10b));var _0x9dc5=function(_0x79b649,_0x2115b3){_0x79b649=_0x79b649-0x0;var _0x1af9b1=_0xdc59[_0x79b649];return _0x1af9b1;};'use strict';var Sequelize=require(_0x9dc5('0x0'));module['exports']={'name':{'type':Sequelize[_0x9dc5('0x1')]},'description':{'type':Sequelize[_0x9dc5('0x1')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 1784ea5..7a8a033 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 _0x3db3=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','reject','save','update','then','destroy','error','stack','name','send','index','map','DeskConfiguration','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','includeAll','include','create','body','find','DeskField','getFields','hasOwnProperty','getSubjects','getDescriptions','Tag','getTags','findOne','setTags','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis'];(function(_0x480bc8,_0x1fac40){var _0x28c245=function(_0x22a049){while(--_0x22a049){_0x480bc8['push'](_0x480bc8['shift']());}};_0x28c245(++_0x1fac40);}(_0x3db3,0x146));var _0x33db=function(_0xe43d8c,_0x4fbc14){_0xe43d8c=_0xe43d8c-0x0;var _0x37b22e=_0x3db3[_0xe43d8c];return _0x37b22e;};'use strict';var emlformat=require(_0x33db('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x33db('0x1'));var jsonpatch=require(_0x33db('0x2'));var rp=require(_0x33db('0x3'));var moment=require(_0x33db('0x4'));var BPromise=require(_0x33db('0x5'));var Mustache=require(_0x33db('0x6'));var util=require('util');var path=require(_0x33db('0x7'));var sox=require('sox');var csv=require(_0x33db('0x8'));var ejs=require(_0x33db('0x9'));var fs=require('fs');var fs_extra=require(_0x33db('0xa'));var _=require(_0x33db('0xb'));var squel=require(_0x33db('0xc'));var crypto=require(_0x33db('0xd'));var jsforce=require(_0x33db('0xe'));var deskjs=require(_0x33db('0xf'));var toCsv=require(_0x33db('0x8'));var querystring=require('querystring');var Papa=require(_0x33db('0x10'));var Redis=require(_0x33db('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x33db('0x12'));var as=require(_0x33db('0x13'));var hardwareService=require(_0x33db('0x14'));var logger=require(_0x33db('0x15'))(_0x33db('0x16'));var utils=require(_0x33db('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x33db('0x18'))['db'];function respondWithStatusCode(_0x1c3857,_0xec6517){_0xec6517=_0xec6517||0xcc;return function(_0x4795cd){if(_0x4795cd){return _0x1c3857[_0x33db('0x19')](_0xec6517);}return _0x1c3857[_0x33db('0x1a')](_0xec6517)[_0x33db('0x1b')]();};}function respondWithResult(_0x293d8f,_0x1dddcc){_0x1dddcc=_0x1dddcc||0xc8;return function(_0x4a0895){if(_0x4a0895){return _0x293d8f[_0x33db('0x1a')](_0x1dddcc)[_0x33db('0x1c')](_0x4a0895);}};}function respondWithFilteredResult(_0x239b73,_0x1cec2c){return function(_0x541379){if(_0x541379){var _0xcaed58=typeof _0x1cec2c[_0x33db('0x1d')]==='undefined'&&typeof _0x1cec2c[_0x33db('0x1e')]===_0x33db('0x1f');var _0x31669b=_0x541379['count'];var _0x15875e=_0xcaed58?0x0:_0x1cec2c['offset'];var _0x18d283=_0xcaed58?_0x541379[_0x33db('0x20')]:_0x1cec2c['offset']+_0x1cec2c[_0x33db('0x1e')];var _0xc276c6;if(_0x18d283>=_0x31669b){_0x18d283=_0x31669b;_0xc276c6=0xc8;}else{_0xc276c6=0xce;}_0x239b73[_0x33db('0x1a')](_0xc276c6);return _0x239b73[_0x33db('0x21')]('Content-Range',_0x15875e+'-'+_0x18d283+'/'+_0x31669b)['json'](_0x541379);}return null;};}function patchUpdates(_0x3f5c44){return function(_0x45487a){try{jsonpatch['apply'](_0x45487a,_0x3f5c44,!![]);}catch(_0x24329a){return BPromise[_0x33db('0x22')](_0x24329a);}return _0x45487a[_0x33db('0x23')]();};}function saveUpdates(_0x467a8e,_0x3277be){return function(_0xab4f06){if(_0xab4f06){return _0xab4f06[_0x33db('0x24')](_0x467a8e)[_0x33db('0x25')](function(_0x257c50){return _0x257c50;});}return null;};}function removeEntity(_0x148cbf,_0x31a1d6){return function(_0x5747e4){if(_0x5747e4){return _0x5747e4[_0x33db('0x26')]()[_0x33db('0x25')](function(){_0x148cbf[_0x33db('0x1a')](0xcc)[_0x33db('0x1b')]();});}};}function handleEntityNotFound(_0x3e69ac,_0x2be15c){return function(_0x260814){if(!_0x260814){_0x3e69ac['sendStatus'](0x194);}return _0x260814;};}function handleError(_0x150535,_0x5dac2f){_0x5dac2f=_0x5dac2f||0x1f4;return function(_0x2acb76){logger[_0x33db('0x27')](_0x2acb76[_0x33db('0x28')]);if(_0x2acb76[_0x33db('0x29')]){delete _0x2acb76['name'];}_0x150535[_0x33db('0x1a')](_0x5dac2f)[_0x33db('0x2a')](_0x2acb76);};}exports[_0x33db('0x2b')]=function(_0x1640c2,_0x3525d3){var _0x4da7f8={},_0x11616e={},_0x2debb2={'count':0x0,'rows':[]};var _0x3bb15b=_[_0x33db('0x2c')](db[_0x33db('0x2d')][_0x33db('0x2e')],function(_0x40d014){return{'name':_0x40d014[_0x33db('0x2f')],'type':_0x40d014[_0x33db('0x30')][_0x33db('0x31')]};});_0x11616e['model']=_['map'](_0x3bb15b,'name');_0x11616e[_0x33db('0x32')]=_[_0x33db('0x33')](_0x1640c2[_0x33db('0x32')]);_0x11616e[_0x33db('0x34')]=_[_0x33db('0x35')](_0x11616e['model'],_0x11616e[_0x33db('0x32')]);_0x4da7f8[_0x33db('0x36')]=_['intersection'](_0x11616e[_0x33db('0x37')],qs[_0x33db('0x38')](_0x1640c2[_0x33db('0x32')][_0x33db('0x38')]));_0x4da7f8[_0x33db('0x36')]=_0x4da7f8[_0x33db('0x36')][_0x33db('0x39')]?_0x4da7f8[_0x33db('0x36')]:_0x11616e[_0x33db('0x37')];if(!_0x1640c2['query']['hasOwnProperty'](_0x33db('0x3a'))){_0x4da7f8[_0x33db('0x1e')]=qs[_0x33db('0x1e')](_0x1640c2[_0x33db('0x32')]['limit']);_0x4da7f8[_0x33db('0x1d')]=qs['offset'](_0x1640c2['query'][_0x33db('0x1d')]);}_0x4da7f8[_0x33db('0x3b')]=qs[_0x33db('0x3c')](_0x1640c2[_0x33db('0x32')][_0x33db('0x3c')]);_0x4da7f8[_0x33db('0x3d')]=qs['filters'](_[_0x33db('0x3e')](_0x1640c2['query'],_0x11616e[_0x33db('0x34')]),_0x3bb15b);if(_0x1640c2['query'][_0x33db('0x3f')]){_0x4da7f8[_0x33db('0x3d')]=_[_0x33db('0x40')](_0x4da7f8['where'],{'$or':_[_0x33db('0x2c')](_0x3bb15b,function(_0x359154){if(_0x359154[_0x33db('0x30')]!==_0x33db('0x41')){var _0x45860a={};_0x45860a[_0x359154[_0x33db('0x29')]]={'$like':'%'+_0x1640c2[_0x33db('0x32')]['filter']+'%'};return _0x45860a;}})});}_0x4da7f8=_['merge']({},_0x4da7f8,_0x1640c2[_0x33db('0x42')]);var _0x33448a={'where':_0x4da7f8[_0x33db('0x3d')]};return db[_0x33db('0x2d')]['count'](_0x33448a)['then'](function(_0x2f5798){_0x2debb2[_0x33db('0x20')]=_0x2f5798;if(_0x1640c2[_0x33db('0x32')]['includeAll']){_0x4da7f8['include']=[{'all':!![]}];}return db[_0x33db('0x2d')][_0x33db('0x43')](_0x4da7f8);})[_0x33db('0x25')](function(_0x268a21){_0x2debb2[_0x33db('0x44')]=_0x268a21;return _0x2debb2;})[_0x33db('0x25')](respondWithFilteredResult(_0x3525d3,_0x4da7f8))[_0x33db('0x45')](handleError(_0x3525d3,null));};exports[_0x33db('0x46')]=function(_0x5b7be9,_0x4f64c5){var _0xb9af2e={'raw':![],'where':{'id':_0x5b7be9[_0x33db('0x47')]['id']}},_0x420fa0={};_0x420fa0[_0x33db('0x37')]=_[_0x33db('0x33')](db['DeskConfiguration'][_0x33db('0x2e')]);_0x420fa0[_0x33db('0x32')]=_[_0x33db('0x33')](_0x5b7be9[_0x33db('0x32')]);_0x420fa0[_0x33db('0x34')]=_[_0x33db('0x35')](_0x420fa0['model'],_0x420fa0[_0x33db('0x32')]);_0xb9af2e[_0x33db('0x36')]=_[_0x33db('0x35')](_0x420fa0['model'],qs[_0x33db('0x38')](_0x5b7be9['query'][_0x33db('0x38')]));_0xb9af2e[_0x33db('0x36')]=_0xb9af2e[_0x33db('0x36')][_0x33db('0x39')]?_0xb9af2e[_0x33db('0x36')]:_0x420fa0[_0x33db('0x37')];if(_0x5b7be9[_0x33db('0x32')][_0x33db('0x48')]){_0xb9af2e[_0x33db('0x49')]=[{'all':!![]}];}_0xb9af2e=_['merge']({},_0xb9af2e,_0x5b7be9[_0x33db('0x42')]);return db[_0x33db('0x2d')]['find'](_0xb9af2e)[_0x33db('0x25')](handleEntityNotFound(_0x4f64c5,null))['then'](respondWithResult(_0x4f64c5,null))[_0x33db('0x45')](handleError(_0x4f64c5,null));};exports['create']=function(_0x426268,_0x40d2a2){return db['DeskConfiguration'][_0x33db('0x4a')](_0x426268[_0x33db('0x4b')],{})[_0x33db('0x25')](respondWithResult(_0x40d2a2,0xc9))[_0x33db('0x45')](handleError(_0x40d2a2,null));};exports[_0x33db('0x24')]=function(_0x5a9b26,_0x3c1ca0){if(_0x5a9b26['body']['id']){delete _0x5a9b26[_0x33db('0x4b')]['id'];}return db[_0x33db('0x2d')][_0x33db('0x4c')]({'where':{'id':_0x5a9b26['params']['id']}})[_0x33db('0x25')](handleEntityNotFound(_0x3c1ca0,null))[_0x33db('0x25')](saveUpdates(_0x5a9b26[_0x33db('0x4b')],null))['then'](respondWithResult(_0x3c1ca0,null))['catch'](handleError(_0x3c1ca0,null));};exports[_0x33db('0x26')]=function(_0x26bf7c,_0x5bb503){return db[_0x33db('0x2d')][_0x33db('0x4c')]({'where':{'id':_0x26bf7c['params']['id']}})[_0x33db('0x25')](handleEntityNotFound(_0x5bb503,null))[_0x33db('0x25')](removeEntity(_0x5bb503,null))[_0x33db('0x45')](handleError(_0x5bb503,null));};exports['getFields']=function(_0x2c58f4,_0x893a9,_0x4fdc7c){var _0x24f533={};var _0xd4163d={};var _0x3a1f9d;var _0x3ea751;return db[_0x33db('0x2d')]['findOne']({'where':{'id':_0x2c58f4['params']['id']}})['then'](handleEntityNotFound(_0x893a9,null))[_0x33db('0x25')](function(_0x5ac473){if(_0x5ac473){_0x3a1f9d=_0x5ac473;_0xd4163d['model']=_[_0x33db('0x33')](db[_0x33db('0x4d')][_0x33db('0x2e')]);_0xd4163d[_0x33db('0x32')]=_['keys'](_0x2c58f4[_0x33db('0x32')]);_0xd4163d[_0x33db('0x34')]=_[_0x33db('0x35')](_0xd4163d[_0x33db('0x37')],_0xd4163d[_0x33db('0x32')]);_0x24f533[_0x33db('0x36')]=_[_0x33db('0x35')](_0xd4163d['model'],qs['fields'](_0x2c58f4[_0x33db('0x32')][_0x33db('0x38')]));_0x24f533[_0x33db('0x36')]=_0x24f533['attributes'][_0x33db('0x39')]?_0x24f533[_0x33db('0x36')]:_0xd4163d['model'];_0x24f533[_0x33db('0x3b')]=qs[_0x33db('0x3c')](_0x2c58f4[_0x33db('0x32')][_0x33db('0x3c')]);_0x24f533['where']=qs['filters'](_[_0x33db('0x3e')](_0x2c58f4[_0x33db('0x32')],_0xd4163d['filters']));if(_0x2c58f4[_0x33db('0x32')][_0x33db('0x3f')]){_0x24f533['where']=_['merge'](_0x24f533['where'],{'$or':_['map'](_0x24f533[_0x33db('0x36')],function(_0x10e469){var _0x16df59={};_0x16df59[_0x10e469]={'$like':'%'+_0x2c58f4[_0x33db('0x32')][_0x33db('0x3f')]+'%'};return _0x16df59;})});}_0x24f533=_['merge']({},_0x24f533,_0x2c58f4[_0x33db('0x42')]);return _0x3a1f9d[_0x33db('0x4e')](_0x24f533);}})[_0x33db('0x25')](function(_0x4e5d30){if(_0x4e5d30){_0x3ea751=_0x4e5d30[_0x33db('0x39')];if(!_0x2c58f4[_0x33db('0x32')][_0x33db('0x4f')](_0x33db('0x3a'))){_0x24f533[_0x33db('0x1e')]=qs[_0x33db('0x1e')](_0x2c58f4['query'][_0x33db('0x1e')]);_0x24f533['offset']=qs[_0x33db('0x1d')](_0x2c58f4['query']['offset']);}return _0x3a1f9d[_0x33db('0x4e')](_0x24f533);}})[_0x33db('0x25')](function(_0x335fa8){if(_0x335fa8){return _0x335fa8?{'count':_0x3ea751,'rows':_0x335fa8}:null;}})['then'](respondWithResult(_0x893a9,null))[_0x33db('0x45')](handleError(_0x893a9,null));};exports[_0x33db('0x50')]=function(_0x2cf385,_0x25938a,_0x2beef1){var _0x3d57d0={};var _0x56085c={};var _0x4fd70f;var _0x300a8a;return db[_0x33db('0x2d')]['findOne']({'where':{'id':_0x2cf385['params']['id']}})[_0x33db('0x25')](handleEntityNotFound(_0x25938a,null))['then'](function(_0x2919f4){if(_0x2919f4){_0x4fd70f=_0x2919f4;_0x56085c[_0x33db('0x37')]=_[_0x33db('0x33')](db[_0x33db('0x4d')][_0x33db('0x2e')]);_0x56085c['query']=_[_0x33db('0x33')](_0x2cf385[_0x33db('0x32')]);_0x56085c[_0x33db('0x34')]=_[_0x33db('0x35')](_0x56085c[_0x33db('0x37')],_0x56085c[_0x33db('0x32')]);_0x3d57d0[_0x33db('0x36')]=_[_0x33db('0x35')](_0x56085c['model'],qs[_0x33db('0x38')](_0x2cf385[_0x33db('0x32')]['fields']));_0x3d57d0[_0x33db('0x36')]=_0x3d57d0['attributes'][_0x33db('0x39')]?_0x3d57d0[_0x33db('0x36')]:_0x56085c['model'];_0x3d57d0[_0x33db('0x3b')]=qs['sort'](_0x2cf385['query'][_0x33db('0x3c')]);_0x3d57d0['where']=qs[_0x33db('0x34')](_['pick'](_0x2cf385[_0x33db('0x32')],_0x56085c[_0x33db('0x34')]));if(_0x2cf385['query']['filter']){_0x3d57d0['where']=_['merge'](_0x3d57d0['where'],{'$or':_[_0x33db('0x2c')](_0x3d57d0[_0x33db('0x36')],function(_0x464a77){var _0x3b6e58={};_0x3b6e58[_0x464a77]={'$like':'%'+_0x2cf385[_0x33db('0x32')]['filter']+'%'};return _0x3b6e58;})});}_0x3d57d0=_[_0x33db('0x40')]({},_0x3d57d0,_0x2cf385[_0x33db('0x42')]);return _0x4fd70f[_0x33db('0x50')](_0x3d57d0);}})[_0x33db('0x25')](function(_0x3e3b29){if(_0x3e3b29){_0x300a8a=_0x3e3b29[_0x33db('0x39')];if(!_0x2cf385[_0x33db('0x32')]['hasOwnProperty'](_0x33db('0x3a'))){_0x3d57d0['limit']=qs['limit'](_0x2cf385[_0x33db('0x32')]['limit']);_0x3d57d0[_0x33db('0x1d')]=qs[_0x33db('0x1d')](_0x2cf385['query'][_0x33db('0x1d')]);}return _0x4fd70f[_0x33db('0x50')](_0x3d57d0);}})[_0x33db('0x25')](function(_0x4493f4){if(_0x4493f4){return _0x4493f4?{'count':_0x300a8a,'rows':_0x4493f4}:null;}})[_0x33db('0x25')](respondWithResult(_0x25938a,null))['catch'](handleError(_0x25938a,null));};exports[_0x33db('0x51')]=function(_0x15bfb9,_0x2ce50b,_0x525b05){var _0x1c30c7={};var _0x5b1a03={};var _0x249ae1;var _0x1a3e64;return db[_0x33db('0x2d')]['findOne']({'where':{'id':_0x15bfb9[_0x33db('0x47')]['id']}})[_0x33db('0x25')](handleEntityNotFound(_0x2ce50b,null))['then'](function(_0x3071e6){if(_0x3071e6){_0x249ae1=_0x3071e6;_0x5b1a03['model']=_[_0x33db('0x33')](db[_0x33db('0x4d')][_0x33db('0x2e')]);_0x5b1a03['query']=_['keys'](_0x15bfb9['query']);_0x5b1a03[_0x33db('0x34')]=_[_0x33db('0x35')](_0x5b1a03[_0x33db('0x37')],_0x5b1a03['query']);_0x1c30c7[_0x33db('0x36')]=_[_0x33db('0x35')](_0x5b1a03[_0x33db('0x37')],qs[_0x33db('0x38')](_0x15bfb9[_0x33db('0x32')]['fields']));_0x1c30c7[_0x33db('0x36')]=_0x1c30c7['attributes'][_0x33db('0x39')]?_0x1c30c7[_0x33db('0x36')]:_0x5b1a03[_0x33db('0x37')];_0x1c30c7['order']=qs['sort'](_0x15bfb9[_0x33db('0x32')][_0x33db('0x3c')]);_0x1c30c7[_0x33db('0x3d')]=qs['filters'](_['pick'](_0x15bfb9[_0x33db('0x32')],_0x5b1a03[_0x33db('0x34')]));if(_0x15bfb9['query'][_0x33db('0x3f')]){_0x1c30c7[_0x33db('0x3d')]=_[_0x33db('0x40')](_0x1c30c7[_0x33db('0x3d')],{'$or':_['map'](_0x1c30c7[_0x33db('0x36')],function(_0xce6feb){var _0x3f82dc={};_0x3f82dc[_0xce6feb]={'$like':'%'+_0x15bfb9['query'][_0x33db('0x3f')]+'%'};return _0x3f82dc;})});}_0x1c30c7=_[_0x33db('0x40')]({},_0x1c30c7,_0x15bfb9[_0x33db('0x42')]);return _0x249ae1['getDescriptions'](_0x1c30c7);}})['then'](function(_0x2967bb){if(_0x2967bb){_0x1a3e64=_0x2967bb[_0x33db('0x39')];if(!_0x15bfb9['query'][_0x33db('0x4f')](_0x33db('0x3a'))){_0x1c30c7['limit']=qs['limit'](_0x15bfb9[_0x33db('0x32')][_0x33db('0x1e')]);_0x1c30c7[_0x33db('0x1d')]=qs[_0x33db('0x1d')](_0x15bfb9[_0x33db('0x32')][_0x33db('0x1d')]);}return _0x249ae1[_0x33db('0x51')](_0x1c30c7);}})[_0x33db('0x25')](function(_0x515719){if(_0x515719){return _0x515719?{'count':_0x1a3e64,'rows':_0x515719}:null;}})[_0x33db('0x25')](respondWithResult(_0x2ce50b,null))[_0x33db('0x45')](handleError(_0x2ce50b,null));};exports['getTags']=function(_0x478702,_0x5d83c3,_0x3de6df){var _0x374206={};var _0x4665fc={};var _0x1d3515;var _0x47bcc9;return db['DeskConfiguration']['findOne']({'where':{'id':_0x478702['params']['id']}})[_0x33db('0x25')](handleEntityNotFound(_0x5d83c3,null))[_0x33db('0x25')](function(_0x45dd1b){if(_0x45dd1b){_0x1d3515=_0x45dd1b;_0x4665fc[_0x33db('0x37')]=_[_0x33db('0x33')](db[_0x33db('0x52')]['rawAttributes']);_0x4665fc[_0x33db('0x32')]=_['keys'](_0x478702[_0x33db('0x32')]);_0x4665fc[_0x33db('0x34')]=_[_0x33db('0x35')](_0x4665fc[_0x33db('0x37')],_0x4665fc[_0x33db('0x32')]);_0x374206[_0x33db('0x36')]=_[_0x33db('0x35')](_0x4665fc['model'],qs[_0x33db('0x38')](_0x478702['query'][_0x33db('0x38')]));_0x374206[_0x33db('0x36')]=_0x374206[_0x33db('0x36')][_0x33db('0x39')]?_0x374206['attributes']:_0x4665fc['model'];_0x374206[_0x33db('0x3b')]=qs['sort'](_0x478702[_0x33db('0x32')][_0x33db('0x3c')]);_0x374206[_0x33db('0x3d')]=qs['filters'](_[_0x33db('0x3e')](_0x478702[_0x33db('0x32')],_0x4665fc[_0x33db('0x34')]));if(_0x478702[_0x33db('0x32')][_0x33db('0x3f')]){_0x374206[_0x33db('0x3d')]=_[_0x33db('0x40')](_0x374206[_0x33db('0x3d')],{'$or':_['map'](_0x374206['attributes'],function(_0x2b89c3){var _0x6bbf31={};_0x6bbf31[_0x2b89c3]={'$like':'%'+_0x478702[_0x33db('0x32')][_0x33db('0x3f')]+'%'};return _0x6bbf31;})});}_0x374206=_[_0x33db('0x40')]({},_0x374206,_0x478702['options']);return _0x1d3515[_0x33db('0x53')](_0x374206);}})[_0x33db('0x25')](function(_0x247f83){if(_0x247f83){_0x47bcc9=_0x247f83[_0x33db('0x39')];if(!_0x478702[_0x33db('0x32')][_0x33db('0x4f')](_0x33db('0x3a'))){_0x374206[_0x33db('0x1e')]=qs[_0x33db('0x1e')](_0x478702[_0x33db('0x32')]['limit']);_0x374206[_0x33db('0x1d')]=qs[_0x33db('0x1d')](_0x478702['query'][_0x33db('0x1d')]);}return _0x1d3515[_0x33db('0x53')](_0x374206);}})[_0x33db('0x25')](function(_0x599b59){if(_0x599b59){return _0x599b59?{'count':_0x47bcc9,'rows':_0x599b59}:null;}})[_0x33db('0x25')](respondWithResult(_0x5d83c3,null))['catch'](handleError(_0x5d83c3,null));};exports['setTags']=function(_0x4b675b,_0x54e429,_0x5ae74a){if(_0x4b675b[_0x33db('0x4b')]['id']){delete _0x4b675b[_0x33db('0x4b')]['id'];}return db[_0x33db('0x2d')][_0x33db('0x54')]({'where':{'id':_0x4b675b['params']['id']}})[_0x33db('0x25')](handleEntityNotFound(_0x54e429,null))['then'](function(_0x166adc){if(_0x166adc){return _0x166adc[_0x33db('0x55')](_0x4b675b['body']['ids']||[]);}return null;})['then'](respondWithResult(_0x54e429,null))['catch'](handleError(_0x54e429,null));}; \ No newline at end of file +var _0xefee=['name','send','index','DeskConfiguration','fieldName','type','key','model','map','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','options','includeAll','findAll','rows','catch','show','keys','rawAttributes','filters','include','merge','find','create','update','body','params','findOne','DeskField','pick','filter','getFields','getSubjects','getDescriptions','getTags','setTags','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../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','save','then','destroy','stack'];(function(_0x2fb87c,_0x2dee49){var _0x43038b=function(_0x7e5396){while(--_0x7e5396){_0x2fb87c['push'](_0x2fb87c['shift']());}};_0x43038b(++_0x2dee49);}(_0xefee,0x80));var _0xeefe=function(_0x1aa5df,_0x1219ff){_0x1aa5df=_0x1aa5df-0x0;var _0xc3d16c=_0xefee[_0x1aa5df];return _0xc3d16c;};'use strict';var emlformat=require(_0xeefe('0x0'));var rimraf=require(_0xeefe('0x1'));var zipdir=require(_0xeefe('0x2'));var jsonpatch=require(_0xeefe('0x3'));var rp=require(_0xeefe('0x4'));var moment=require(_0xeefe('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xeefe('0x6'));var util=require(_0xeefe('0x7'));var path=require(_0xeefe('0x8'));var sox=require('sox');var csv=require(_0xeefe('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xeefe('0xa'));var _=require(_0xeefe('0xb'));var squel=require('squel');var crypto=require(_0xeefe('0xc'));var jsforce=require(_0xeefe('0xd'));var deskjs=require(_0xeefe('0xe'));var toCsv=require(_0xeefe('0x9'));var querystring=require(_0xeefe('0xf'));var Papa=require('papaparse');var Redis=require(_0xeefe('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xeefe('0x11'));var hardwareService=require(_0xeefe('0x12'));var logger=require(_0xeefe('0x13'))('api');var utils=require(_0xeefe('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xeefe('0x15'));var db=require(_0xeefe('0x16'))['db'];function respondWithStatusCode(_0x2730e2,_0x43d090){_0x43d090=_0x43d090||0xcc;return function(_0x2939a0){if(_0x2939a0){return _0x2730e2[_0xeefe('0x17')](_0x43d090);}return _0x2730e2['status'](_0x43d090)[_0xeefe('0x18')]();};}function respondWithResult(_0x336cb7,_0x1a9fb7){_0x1a9fb7=_0x1a9fb7||0xc8;return function(_0x2b0bd9){if(_0x2b0bd9){return _0x336cb7[_0xeefe('0x19')](_0x1a9fb7)[_0xeefe('0x1a')](_0x2b0bd9);}};}function respondWithFilteredResult(_0x30e4bd,_0x3afde9){return function(_0x15fac3){if(_0x15fac3){var _0x4ed27b=typeof _0x3afde9[_0xeefe('0x1b')]===_0xeefe('0x1c')&&typeof _0x3afde9[_0xeefe('0x1d')]===_0xeefe('0x1c');var _0x4c6ce4=_0x15fac3[_0xeefe('0x1e')];var _0x14381d=_0x4ed27b?0x0:_0x3afde9[_0xeefe('0x1b')];var _0x4680f9=_0x4ed27b?_0x15fac3[_0xeefe('0x1e')]:_0x3afde9[_0xeefe('0x1b')]+_0x3afde9[_0xeefe('0x1d')];var _0x5e3590;if(_0x4680f9>=_0x4c6ce4){_0x4680f9=_0x4c6ce4;_0x5e3590=0xc8;}else{_0x5e3590=0xce;}_0x30e4bd[_0xeefe('0x19')](_0x5e3590);return _0x30e4bd[_0xeefe('0x1f')](_0xeefe('0x20'),_0x14381d+'-'+_0x4680f9+'/'+_0x4c6ce4)[_0xeefe('0x1a')](_0x15fac3);}return null;};}function patchUpdates(_0x13f688){return function(_0xa81a56){try{jsonpatch[_0xeefe('0x21')](_0xa81a56,_0x13f688,!![]);}catch(_0x2006a6){return BPromise['reject'](_0x2006a6);}return _0xa81a56[_0xeefe('0x22')]();};}function saveUpdates(_0x194fbe,_0x4df72c){return function(_0x261011){if(_0x261011){return _0x261011['update'](_0x194fbe)[_0xeefe('0x23')](function(_0x29e8aa){return _0x29e8aa;});}return null;};}function removeEntity(_0x45c79d,_0x40bc96){return function(_0x5d43ae){if(_0x5d43ae){return _0x5d43ae[_0xeefe('0x24')]()['then'](function(){_0x45c79d['status'](0xcc)[_0xeefe('0x18')]();});}};}function handleEntityNotFound(_0x57be86,_0x2c1e87){return function(_0xe1e6c3){if(!_0xe1e6c3){_0x57be86[_0xeefe('0x17')](0x194);}return _0xe1e6c3;};}function handleError(_0x2a0ef3,_0x23df99){_0x23df99=_0x23df99||0x1f4;return function(_0x222a19){logger['error'](_0x222a19[_0xeefe('0x25')]);if(_0x222a19[_0xeefe('0x26')]){delete _0x222a19[_0xeefe('0x26')];}_0x2a0ef3[_0xeefe('0x19')](_0x23df99)[_0xeefe('0x27')](_0x222a19);};}exports[_0xeefe('0x28')]=function(_0x573d5c,_0x17341f){var _0x505c96={},_0x3402b7={},_0x37fa31={'count':0x0,'rows':[]};var _0x120835=_['map'](db[_0xeefe('0x29')]['rawAttributes'],function(_0x26d935){return{'name':_0x26d935[_0xeefe('0x2a')],'type':_0x26d935[_0xeefe('0x2b')][_0xeefe('0x2c')]};});_0x3402b7[_0xeefe('0x2d')]=_[_0xeefe('0x2e')](_0x120835,_0xeefe('0x26'));_0x3402b7[_0xeefe('0x2f')]=_['keys'](_0x573d5c[_0xeefe('0x2f')]);_0x3402b7['filters']=_['intersection'](_0x3402b7[_0xeefe('0x2d')],_0x3402b7[_0xeefe('0x2f')]);_0x505c96[_0xeefe('0x30')]=_[_0xeefe('0x31')](_0x3402b7['model'],qs[_0xeefe('0x32')](_0x573d5c['query'][_0xeefe('0x32')]));_0x505c96['attributes']=_0x505c96['attributes'][_0xeefe('0x33')]?_0x505c96[_0xeefe('0x30')]:_0x3402b7[_0xeefe('0x2d')];if(!_0x573d5c[_0xeefe('0x2f')][_0xeefe('0x34')](_0xeefe('0x35'))){_0x505c96[_0xeefe('0x1d')]=qs['limit'](_0x573d5c[_0xeefe('0x2f')][_0xeefe('0x1d')]);_0x505c96[_0xeefe('0x1b')]=qs[_0xeefe('0x1b')](_0x573d5c[_0xeefe('0x2f')][_0xeefe('0x1b')]);}_0x505c96[_0xeefe('0x36')]=qs[_0xeefe('0x37')](_0x573d5c[_0xeefe('0x2f')]['sort']);_0x505c96[_0xeefe('0x38')]=qs['filters'](_['pick'](_0x573d5c[_0xeefe('0x2f')],_0x3402b7['filters']),_0x120835);if(_0x573d5c[_0xeefe('0x2f')]['filter']){_0x505c96[_0xeefe('0x38')]=_['merge'](_0x505c96['where'],{'$or':_[_0xeefe('0x2e')](_0x120835,function(_0x4bc17a){if(_0x4bc17a['type']!==_0xeefe('0x39')){var _0x432508={};_0x432508[_0x4bc17a[_0xeefe('0x26')]]={'$like':'%'+_0x573d5c[_0xeefe('0x2f')]['filter']+'%'};return _0x432508;}})});}_0x505c96=_['merge']({},_0x505c96,_0x573d5c[_0xeefe('0x3a')]);var _0x3ec420={'where':_0x505c96[_0xeefe('0x38')]};return db[_0xeefe('0x29')][_0xeefe('0x1e')](_0x3ec420)[_0xeefe('0x23')](function(_0x7d4e2c){_0x37fa31['count']=_0x7d4e2c;if(_0x573d5c[_0xeefe('0x2f')][_0xeefe('0x3b')]){_0x505c96['include']=[{'all':!![]}];}return db['DeskConfiguration'][_0xeefe('0x3c')](_0x505c96);})[_0xeefe('0x23')](function(_0x510763){_0x37fa31[_0xeefe('0x3d')]=_0x510763;return _0x37fa31;})['then'](respondWithFilteredResult(_0x17341f,_0x505c96))[_0xeefe('0x3e')](handleError(_0x17341f,null));};exports[_0xeefe('0x3f')]=function(_0x1aa9c2,_0x471a85){var _0x4ee4f6={'raw':![],'where':{'id':_0x1aa9c2['params']['id']}},_0x28daa1={};_0x28daa1['model']=_[_0xeefe('0x40')](db[_0xeefe('0x29')][_0xeefe('0x41')]);_0x28daa1[_0xeefe('0x2f')]=_[_0xeefe('0x40')](_0x1aa9c2[_0xeefe('0x2f')]);_0x28daa1[_0xeefe('0x42')]=_[_0xeefe('0x31')](_0x28daa1['model'],_0x28daa1[_0xeefe('0x2f')]);_0x4ee4f6[_0xeefe('0x30')]=_[_0xeefe('0x31')](_0x28daa1['model'],qs[_0xeefe('0x32')](_0x1aa9c2['query'][_0xeefe('0x32')]));_0x4ee4f6['attributes']=_0x4ee4f6[_0xeefe('0x30')][_0xeefe('0x33')]?_0x4ee4f6[_0xeefe('0x30')]:_0x28daa1['model'];if(_0x1aa9c2['query'][_0xeefe('0x3b')]){_0x4ee4f6[_0xeefe('0x43')]=[{'all':!![]}];}_0x4ee4f6=_[_0xeefe('0x44')]({},_0x4ee4f6,_0x1aa9c2[_0xeefe('0x3a')]);return db[_0xeefe('0x29')][_0xeefe('0x45')](_0x4ee4f6)['then'](handleEntityNotFound(_0x471a85,null))[_0xeefe('0x23')](respondWithResult(_0x471a85,null))[_0xeefe('0x3e')](handleError(_0x471a85,null));};exports[_0xeefe('0x46')]=function(_0x5e83ce,_0x59a720){return db[_0xeefe('0x29')][_0xeefe('0x46')](_0x5e83ce['body'],{})[_0xeefe('0x23')](respondWithResult(_0x59a720,0xc9))[_0xeefe('0x3e')](handleError(_0x59a720,null));};exports[_0xeefe('0x47')]=function(_0x410f8a,_0x2c9281){if(_0x410f8a[_0xeefe('0x48')]['id']){delete _0x410f8a[_0xeefe('0x48')]['id'];}return db[_0xeefe('0x29')]['find']({'where':{'id':_0x410f8a[_0xeefe('0x49')]['id']}})[_0xeefe('0x23')](handleEntityNotFound(_0x2c9281,null))['then'](saveUpdates(_0x410f8a[_0xeefe('0x48')],null))[_0xeefe('0x23')](respondWithResult(_0x2c9281,null))[_0xeefe('0x3e')](handleError(_0x2c9281,null));};exports['destroy']=function(_0x432b0f,_0x35dba1){return db[_0xeefe('0x29')][_0xeefe('0x45')]({'where':{'id':_0x432b0f[_0xeefe('0x49')]['id']}})['then'](handleEntityNotFound(_0x35dba1,null))[_0xeefe('0x23')](removeEntity(_0x35dba1,null))[_0xeefe('0x3e')](handleError(_0x35dba1,null));};exports['getFields']=function(_0x2267ec,_0x43d87a,_0x4d3c75){var _0x4c2a0a={};var _0x1a41f7={};var _0x4caecd;var _0x4a3812;return db[_0xeefe('0x29')][_0xeefe('0x4a')]({'where':{'id':_0x2267ec[_0xeefe('0x49')]['id']}})[_0xeefe('0x23')](handleEntityNotFound(_0x43d87a,null))['then'](function(_0x4860d5){if(_0x4860d5){_0x4caecd=_0x4860d5;_0x1a41f7[_0xeefe('0x2d')]=_['keys'](db[_0xeefe('0x4b')]['rawAttributes']);_0x1a41f7[_0xeefe('0x2f')]=_[_0xeefe('0x40')](_0x2267ec[_0xeefe('0x2f')]);_0x1a41f7[_0xeefe('0x42')]=_[_0xeefe('0x31')](_0x1a41f7[_0xeefe('0x2d')],_0x1a41f7[_0xeefe('0x2f')]);_0x4c2a0a[_0xeefe('0x30')]=_[_0xeefe('0x31')](_0x1a41f7['model'],qs['fields'](_0x2267ec[_0xeefe('0x2f')][_0xeefe('0x32')]));_0x4c2a0a[_0xeefe('0x30')]=_0x4c2a0a[_0xeefe('0x30')][_0xeefe('0x33')]?_0x4c2a0a[_0xeefe('0x30')]:_0x1a41f7[_0xeefe('0x2d')];_0x4c2a0a[_0xeefe('0x36')]=qs[_0xeefe('0x37')](_0x2267ec[_0xeefe('0x2f')][_0xeefe('0x37')]);_0x4c2a0a['where']=qs['filters'](_[_0xeefe('0x4c')](_0x2267ec[_0xeefe('0x2f')],_0x1a41f7[_0xeefe('0x42')]));if(_0x2267ec[_0xeefe('0x2f')][_0xeefe('0x4d')]){_0x4c2a0a[_0xeefe('0x38')]=_[_0xeefe('0x44')](_0x4c2a0a[_0xeefe('0x38')],{'$or':_[_0xeefe('0x2e')](_0x4c2a0a[_0xeefe('0x30')],function(_0x418ea2){var _0x5e4569={};_0x5e4569[_0x418ea2]={'$like':'%'+_0x2267ec['query'][_0xeefe('0x4d')]+'%'};return _0x5e4569;})});}_0x4c2a0a=_[_0xeefe('0x44')]({},_0x4c2a0a,_0x2267ec['options']);return _0x4caecd[_0xeefe('0x4e')](_0x4c2a0a);}})[_0xeefe('0x23')](function(_0x34f889){if(_0x34f889){_0x4a3812=_0x34f889['length'];if(!_0x2267ec['query'][_0xeefe('0x34')]('nolimit')){_0x4c2a0a[_0xeefe('0x1d')]=qs[_0xeefe('0x1d')](_0x2267ec[_0xeefe('0x2f')][_0xeefe('0x1d')]);_0x4c2a0a[_0xeefe('0x1b')]=qs[_0xeefe('0x1b')](_0x2267ec['query']['offset']);}return _0x4caecd[_0xeefe('0x4e')](_0x4c2a0a);}})[_0xeefe('0x23')](function(_0x289b40){if(_0x289b40){return _0x289b40?{'count':_0x4a3812,'rows':_0x289b40}:null;}})[_0xeefe('0x23')](respondWithResult(_0x43d87a,null))['catch'](handleError(_0x43d87a,null));};exports[_0xeefe('0x4f')]=function(_0x2e6658,_0x2ffeba,_0x16fe64){var _0x44f0e6={};var _0x472597={};var _0x14ba5c;var _0x263985;return db[_0xeefe('0x29')][_0xeefe('0x4a')]({'where':{'id':_0x2e6658['params']['id']}})[_0xeefe('0x23')](handleEntityNotFound(_0x2ffeba,null))[_0xeefe('0x23')](function(_0x46c1d2){if(_0x46c1d2){_0x14ba5c=_0x46c1d2;_0x472597[_0xeefe('0x2d')]=_[_0xeefe('0x40')](db[_0xeefe('0x4b')]['rawAttributes']);_0x472597[_0xeefe('0x2f')]=_['keys'](_0x2e6658[_0xeefe('0x2f')]);_0x472597[_0xeefe('0x42')]=_[_0xeefe('0x31')](_0x472597[_0xeefe('0x2d')],_0x472597[_0xeefe('0x2f')]);_0x44f0e6[_0xeefe('0x30')]=_['intersection'](_0x472597['model'],qs[_0xeefe('0x32')](_0x2e6658[_0xeefe('0x2f')][_0xeefe('0x32')]));_0x44f0e6[_0xeefe('0x30')]=_0x44f0e6[_0xeefe('0x30')][_0xeefe('0x33')]?_0x44f0e6[_0xeefe('0x30')]:_0x472597[_0xeefe('0x2d')];_0x44f0e6[_0xeefe('0x36')]=qs[_0xeefe('0x37')](_0x2e6658[_0xeefe('0x2f')][_0xeefe('0x37')]);_0x44f0e6[_0xeefe('0x38')]=qs[_0xeefe('0x42')](_[_0xeefe('0x4c')](_0x2e6658[_0xeefe('0x2f')],_0x472597[_0xeefe('0x42')]));if(_0x2e6658[_0xeefe('0x2f')][_0xeefe('0x4d')]){_0x44f0e6[_0xeefe('0x38')]=_[_0xeefe('0x44')](_0x44f0e6[_0xeefe('0x38')],{'$or':_[_0xeefe('0x2e')](_0x44f0e6[_0xeefe('0x30')],function(_0x2e546a){var _0x3756d0={};_0x3756d0[_0x2e546a]={'$like':'%'+_0x2e6658[_0xeefe('0x2f')]['filter']+'%'};return _0x3756d0;})});}_0x44f0e6=_[_0xeefe('0x44')]({},_0x44f0e6,_0x2e6658['options']);return _0x14ba5c[_0xeefe('0x4f')](_0x44f0e6);}})[_0xeefe('0x23')](function(_0x2d10b3){if(_0x2d10b3){_0x263985=_0x2d10b3[_0xeefe('0x33')];if(!_0x2e6658[_0xeefe('0x2f')][_0xeefe('0x34')](_0xeefe('0x35'))){_0x44f0e6[_0xeefe('0x1d')]=qs[_0xeefe('0x1d')](_0x2e6658['query']['limit']);_0x44f0e6[_0xeefe('0x1b')]=qs[_0xeefe('0x1b')](_0x2e6658['query'][_0xeefe('0x1b')]);}return _0x14ba5c[_0xeefe('0x4f')](_0x44f0e6);}})[_0xeefe('0x23')](function(_0x5590b8){if(_0x5590b8){return _0x5590b8?{'count':_0x263985,'rows':_0x5590b8}:null;}})[_0xeefe('0x23')](respondWithResult(_0x2ffeba,null))[_0xeefe('0x3e')](handleError(_0x2ffeba,null));};exports[_0xeefe('0x50')]=function(_0x2800ea,_0x21125d,_0x3ad8f4){var _0x2b7ca6={};var _0x132029={};var _0x5ac8c9;var _0x3af10;return db[_0xeefe('0x29')][_0xeefe('0x4a')]({'where':{'id':_0x2800ea['params']['id']}})[_0xeefe('0x23')](handleEntityNotFound(_0x21125d,null))[_0xeefe('0x23')](function(_0x4747d0){if(_0x4747d0){_0x5ac8c9=_0x4747d0;_0x132029[_0xeefe('0x2d')]=_[_0xeefe('0x40')](db[_0xeefe('0x4b')][_0xeefe('0x41')]);_0x132029[_0xeefe('0x2f')]=_['keys'](_0x2800ea['query']);_0x132029[_0xeefe('0x42')]=_[_0xeefe('0x31')](_0x132029[_0xeefe('0x2d')],_0x132029['query']);_0x2b7ca6[_0xeefe('0x30')]=_[_0xeefe('0x31')](_0x132029[_0xeefe('0x2d')],qs[_0xeefe('0x32')](_0x2800ea[_0xeefe('0x2f')][_0xeefe('0x32')]));_0x2b7ca6[_0xeefe('0x30')]=_0x2b7ca6['attributes'][_0xeefe('0x33')]?_0x2b7ca6[_0xeefe('0x30')]:_0x132029[_0xeefe('0x2d')];_0x2b7ca6['order']=qs[_0xeefe('0x37')](_0x2800ea[_0xeefe('0x2f')]['sort']);_0x2b7ca6['where']=qs[_0xeefe('0x42')](_[_0xeefe('0x4c')](_0x2800ea['query'],_0x132029[_0xeefe('0x42')]));if(_0x2800ea[_0xeefe('0x2f')][_0xeefe('0x4d')]){_0x2b7ca6[_0xeefe('0x38')]=_[_0xeefe('0x44')](_0x2b7ca6[_0xeefe('0x38')],{'$or':_[_0xeefe('0x2e')](_0x2b7ca6[_0xeefe('0x30')],function(_0x973f1a){var _0x4040ea={};_0x4040ea[_0x973f1a]={'$like':'%'+_0x2800ea[_0xeefe('0x2f')]['filter']+'%'};return _0x4040ea;})});}_0x2b7ca6=_[_0xeefe('0x44')]({},_0x2b7ca6,_0x2800ea['options']);return _0x5ac8c9[_0xeefe('0x50')](_0x2b7ca6);}})['then'](function(_0x41942c){if(_0x41942c){_0x3af10=_0x41942c[_0xeefe('0x33')];if(!_0x2800ea[_0xeefe('0x2f')][_0xeefe('0x34')](_0xeefe('0x35'))){_0x2b7ca6[_0xeefe('0x1d')]=qs[_0xeefe('0x1d')](_0x2800ea[_0xeefe('0x2f')][_0xeefe('0x1d')]);_0x2b7ca6[_0xeefe('0x1b')]=qs['offset'](_0x2800ea[_0xeefe('0x2f')][_0xeefe('0x1b')]);}return _0x5ac8c9[_0xeefe('0x50')](_0x2b7ca6);}})['then'](function(_0x589322){if(_0x589322){return _0x589322?{'count':_0x3af10,'rows':_0x589322}:null;}})[_0xeefe('0x23')](respondWithResult(_0x21125d,null))[_0xeefe('0x3e')](handleError(_0x21125d,null));};exports['getTags']=function(_0x2aa56b,_0xfef99e,_0x43f21c){var _0x481c82={};var _0x166700={};var _0x2095d2;var _0x1db369;return db[_0xeefe('0x29')][_0xeefe('0x4a')]({'where':{'id':_0x2aa56b[_0xeefe('0x49')]['id']}})['then'](handleEntityNotFound(_0xfef99e,null))[_0xeefe('0x23')](function(_0x4b11e2){if(_0x4b11e2){_0x2095d2=_0x4b11e2;_0x166700['model']=_['keys'](db['Tag'][_0xeefe('0x41')]);_0x166700[_0xeefe('0x2f')]=_['keys'](_0x2aa56b[_0xeefe('0x2f')]);_0x166700[_0xeefe('0x42')]=_[_0xeefe('0x31')](_0x166700['model'],_0x166700['query']);_0x481c82[_0xeefe('0x30')]=_[_0xeefe('0x31')](_0x166700[_0xeefe('0x2d')],qs[_0xeefe('0x32')](_0x2aa56b[_0xeefe('0x2f')]['fields']));_0x481c82[_0xeefe('0x30')]=_0x481c82[_0xeefe('0x30')][_0xeefe('0x33')]?_0x481c82[_0xeefe('0x30')]:_0x166700[_0xeefe('0x2d')];_0x481c82[_0xeefe('0x36')]=qs[_0xeefe('0x37')](_0x2aa56b[_0xeefe('0x2f')][_0xeefe('0x37')]);_0x481c82[_0xeefe('0x38')]=qs[_0xeefe('0x42')](_[_0xeefe('0x4c')](_0x2aa56b[_0xeefe('0x2f')],_0x166700[_0xeefe('0x42')]));if(_0x2aa56b[_0xeefe('0x2f')][_0xeefe('0x4d')]){_0x481c82['where']=_[_0xeefe('0x44')](_0x481c82[_0xeefe('0x38')],{'$or':_[_0xeefe('0x2e')](_0x481c82['attributes'],function(_0x1240f5){var _0x3eb82c={};_0x3eb82c[_0x1240f5]={'$like':'%'+_0x2aa56b[_0xeefe('0x2f')][_0xeefe('0x4d')]+'%'};return _0x3eb82c;})});}_0x481c82=_['merge']({},_0x481c82,_0x2aa56b[_0xeefe('0x3a')]);return _0x2095d2['getTags'](_0x481c82);}})[_0xeefe('0x23')](function(_0x268d54){if(_0x268d54){_0x1db369=_0x268d54[_0xeefe('0x33')];if(!_0x2aa56b['query'][_0xeefe('0x34')](_0xeefe('0x35'))){_0x481c82[_0xeefe('0x1d')]=qs[_0xeefe('0x1d')](_0x2aa56b['query'][_0xeefe('0x1d')]);_0x481c82[_0xeefe('0x1b')]=qs[_0xeefe('0x1b')](_0x2aa56b['query']['offset']);}return _0x2095d2[_0xeefe('0x51')](_0x481c82);}})[_0xeefe('0x23')](function(_0x26bada){if(_0x26bada){return _0x26bada?{'count':_0x1db369,'rows':_0x26bada}:null;}})[_0xeefe('0x23')](respondWithResult(_0xfef99e,null))['catch'](handleError(_0xfef99e,null));};exports[_0xeefe('0x52')]=function(_0x572b08,_0x35ae79,_0x3cb608){if(_0x572b08[_0xeefe('0x48')]['id']){delete _0x572b08[_0xeefe('0x48')]['id'];}return db[_0xeefe('0x29')][_0xeefe('0x4a')]({'where':{'id':_0x572b08['params']['id']}})['then'](handleEntityNotFound(_0x35ae79,null))[_0xeefe('0x23')](function(_0x554e25){if(_0x554e25){return _0x554e25[_0xeefe('0x52')](_0x572b08[_0xeefe('0x48')]['ids']||[]);}return null;})[_0xeefe('0x23')](respondWithResult(_0x35ae79,null))[_0xeefe('0x3e')](handleError(_0x35ae79,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 140b07d..3f9fe94 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 _0x6790=['api','bluebird','request-promise','path','rimraf','./intDeskConfiguration.attributes','exports','define','int_desk_configurations','util','../../config/logger'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x6790,0x1ed));var _0x0679=function(_0x3230b3,_0x13336f){_0x3230b3=_0x3230b3-0x0;var _0x2ec2c5=_0x6790[_0x3230b3];return _0x2ec2c5;};'use strict';var _=require('lodash');var util=require(_0x0679('0x0'));var logger=require(_0x0679('0x1'))(_0x0679('0x2'));var moment=require('moment');var BPromise=require(_0x0679('0x3'));var rp=require(_0x0679('0x4'));var fs=require('fs');var path=require(_0x0679('0x5'));var rimraf=require(_0x0679('0x6'));var config=require('../../config/environment');var attributes=require(_0x0679('0x7'));module[_0x0679('0x8')]=function(_0x23107e,_0x20907b){return _0x23107e[_0x0679('0x9')]('DeskConfiguration',attributes,{'tableName':_0x0679('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0738=['path','rimraf','../../config/environment','./intDeskConfiguration.attributes','define','int_desk_configurations','lodash','util','api','moment','bluebird','request-promise'];(function(_0xaff75b,_0x1bf838){var _0x53c37f=function(_0x406cb7){while(--_0x406cb7){_0xaff75b['push'](_0xaff75b['shift']());}};_0x53c37f(++_0x1bf838);}(_0x0738,0x186));var _0x8073=function(_0x5f6a8a,_0x45f474){_0x5f6a8a=_0x5f6a8a-0x0;var _0x2cce4d=_0x0738[_0x5f6a8a];return _0x2cce4d;};'use strict';var _=require(_0x8073('0x0'));var util=require(_0x8073('0x1'));var logger=require('../../config/logger')(_0x8073('0x2'));var moment=require(_0x8073('0x3'));var BPromise=require(_0x8073('0x4'));var rp=require(_0x8073('0x5'));var fs=require('fs');var path=require(_0x8073('0x6'));var rimraf=require(_0x8073('0x7'));var config=require(_0x8073('0x8'));var attributes=require(_0x8073('0x9'));module['exports']=function(_0x12858e,_0x32700d){return _0x12858e[_0x8073('0xa')]('DeskConfiguration',attributes,{'tableName':_0x8073('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js index aaa916d..cea4c16 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 _0x6f3e=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util'];(function(_0xae95c5,_0x578169){var _0x3b4cda=function(_0x384f73){while(--_0x384f73){_0xae95c5['push'](_0xae95c5['shift']());}};_0x3b4cda(++_0x578169);}(_0x6f3e,0x9f));var _0xe6f3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6f3e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe6f3('0x0'));var util=require(_0xe6f3('0x1'));var moment=require(_0xe6f3('0x2'));var BPromise=require(_0xe6f3('0x3'));var rs=require(_0xe6f3('0x4'));var fs=require('fs');var Redis=require(_0xe6f3('0x5'));var db=require(_0xe6f3('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xe6f3('0x7'))(_0xe6f3('0x8'));var config=require('../../config/environment');var jayson=require(_0xe6f3('0x9'));var client=jayson[_0xe6f3('0xa')][_0xe6f3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5b59eb,_0x44cedc,_0x17242d){return new BPromise(function(_0x53d62d,_0x4ba888){return client[_0xe6f3('0xc')](_0x5b59eb,_0x17242d)['then'](function(_0x331856){logger[_0xe6f3('0xd')](_0xe6f3('0xe'),_0x44cedc,_0xe6f3('0xf'));logger[_0xe6f3('0x10')](_0xe6f3('0x11'),_0x44cedc,'request\x20sent',JSON[_0xe6f3('0x12')](_0x331856));if(_0x331856['error']){if(_0x331856[_0xe6f3('0x13')][_0xe6f3('0x14')]===0x1f4){logger[_0xe6f3('0x13')](_0xe6f3('0xe'),_0x44cedc,_0x331856['error'][_0xe6f3('0x15')]);return _0x4ba888(_0x331856[_0xe6f3('0x13')][_0xe6f3('0x15')]);}logger[_0xe6f3('0x13')](_0xe6f3('0xe'),_0x44cedc,_0x331856[_0xe6f3('0x13')][_0xe6f3('0x15')]);return _0x53d62d(_0x331856['error'][_0xe6f3('0x15')]);}else{logger[_0xe6f3('0xd')](_0xe6f3('0xe'),_0x44cedc,_0xe6f3('0xf'));_0x53d62d(_0x331856[_0xe6f3('0x16')]['message']);}})['catch'](function(_0x410177){logger[_0xe6f3('0x13')](_0xe6f3('0xe'),_0x44cedc,_0x410177);_0x4ba888(_0x410177);});});} \ No newline at end of file +var _0x236c=['error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x55dcc3,_0x1d7dcb){var _0x1869a7=function(_0x2dcf1e){while(--_0x2dcf1e){_0x55dcc3['push'](_0x55dcc3['shift']());}};_0x1869a7(++_0x1d7dcb);}(_0x236c,0x155));var _0xc236=function(_0x32f483,_0x569c72){_0x32f483=_0x32f483-0x0;var _0x3fb684=_0x236c[_0x32f483];return _0x3fb684;};'use strict';var _=require(_0xc236('0x0'));var util=require('util');var moment=require(_0xc236('0x1'));var BPromise=require(_0xc236('0x2'));var rs=require(_0xc236('0x3'));var fs=require('fs');var Redis=require(_0xc236('0x4'));var db=require(_0xc236('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc236('0x6'))(_0xc236('0x7'));var config=require(_0xc236('0x8'));var jayson=require(_0xc236('0x9'));var client=jayson[_0xc236('0xa')][_0xc236('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5abd65,_0xd612c6,_0x4d349b){return new BPromise(function(_0x51a13b,_0x5bc6a2){return client['request'](_0x5abd65,_0x4d349b)[_0xc236('0xc')](function(_0x4b8dc6){logger[_0xc236('0xd')](_0xc236('0xe'),_0xd612c6,_0xc236('0xf'));logger[_0xc236('0x10')](_0xc236('0x11'),_0xd612c6,'request\x20sent',JSON[_0xc236('0x12')](_0x4b8dc6));if(_0x4b8dc6[_0xc236('0x13')]){if(_0x4b8dc6['error'][_0xc236('0x14')]===0x1f4){logger[_0xc236('0x13')]('DeskConfiguration,\x20%s,\x20%s',_0xd612c6,_0x4b8dc6[_0xc236('0x13')]['message']);return _0x5bc6a2(_0x4b8dc6['error'][_0xc236('0x15')]);}logger[_0xc236('0x13')](_0xc236('0xe'),_0xd612c6,_0x4b8dc6[_0xc236('0x13')]['message']);return _0x51a13b(_0x4b8dc6[_0xc236('0x13')]['message']);}else{logger['info'](_0xc236('0xe'),_0xd612c6,_0xc236('0xf'));_0x51a13b(_0x4b8dc6[_0xc236('0x16')][_0xc236('0x15')]);}})[_0xc236('0x17')](function(_0x5ac3ed){logger['error']('DeskConfiguration,\x20%s,\x20%s',_0xd612c6,_0x5ac3ed);_0x5bc6a2(_0x5ac3ed);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 8378359..1eb05b7 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 _0xd2c4=['fs-extra','../../components/auth/service','get','isAuthenticated','index','/:id','post','create','put','delete','exports','multer','util','connect-timeout','express','Router'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd2c4,0xeb));var _0x4d2c=function(_0x5eb26d,_0x1f3383){_0x5eb26d=_0x5eb26d-0x0;var _0x2a5303=_0xd2c4[_0x5eb26d];return _0x2a5303;};'use strict';var multer=require(_0x4d2c('0x0'));var util=require(_0x4d2c('0x1'));var path=require('path');var timeout=require(_0x4d2c('0x2'));var express=require(_0x4d2c('0x3'));var router=express[_0x4d2c('0x4')]();var fs_extra=require(_0x4d2c('0x5'));var auth=require(_0x4d2c('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intDeskField.controller');router[_0x4d2c('0x7')]('/',auth[_0x4d2c('0x8')](),controller[_0x4d2c('0x9')]);router[_0x4d2c('0x7')](_0x4d2c('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x4d2c('0xb')]('/',auth[_0x4d2c('0x8')](),controller[_0x4d2c('0xc')]);router[_0x4d2c('0xd')](_0x4d2c('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x4d2c('0xe')](_0x4d2c('0xa'),auth[_0x4d2c('0x8')](),controller['destroy']);module[_0x4d2c('0xf')]=router; \ No newline at end of file +var _0xd0ce=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','index','/:id','isAuthenticated','show','post','create','put','delete','destroy','exports','multer','util','path'];(function(_0x95575a,_0x1560ff){var _0x22c1c9=function(_0x4b9f0b){while(--_0x4b9f0b){_0x95575a['push'](_0x95575a['shift']());}};_0x22c1c9(++_0x1560ff);}(_0xd0ce,0x105));var _0xed0c=function(_0x3c97e3,_0x321677){_0x3c97e3=_0x3c97e3-0x0;var _0x9bb0ed=_0xd0ce[_0x3c97e3];return _0x9bb0ed;};'use strict';var multer=require(_0xed0c('0x0'));var util=require(_0xed0c('0x1'));var path=require(_0xed0c('0x2'));var timeout=require(_0xed0c('0x3'));var express=require(_0xed0c('0x4'));var router=express[_0xed0c('0x5')]();var fs_extra=require(_0xed0c('0x6'));var auth=require(_0xed0c('0x7'));var interaction=require(_0xed0c('0x8'));var config=require(_0xed0c('0x9'));var controller=require(_0xed0c('0xa'));router[_0xed0c('0xb')]('/',auth['isAuthenticated'](),controller[_0xed0c('0xc')]);router[_0xed0c('0xb')](_0xed0c('0xd'),auth[_0xed0c('0xe')](),controller[_0xed0c('0xf')]);router[_0xed0c('0x10')]('/',auth[_0xed0c('0xe')](),controller[_0xed0c('0x11')]);router[_0xed0c('0x12')](_0xed0c('0xd'),auth[_0xed0c('0xe')](),controller['update']);router[_0xed0c('0x13')](_0xed0c('0xd'),auth[_0xed0c('0xe')](),controller[_0xed0c('0x14')]);module[_0xed0c('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index e31f08c..c33f17f 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 _0xb5f0=['string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports'];(function(_0x11e98b,_0x3c35a7){var _0x4a7e14=function(_0x264990){while(--_0x264990){_0x11e98b['push'](_0x11e98b['shift']());}};_0x4a7e14(++_0x3c35a7);}(_0xb5f0,0x193));var _0x0b5f=function(_0xfb83e2,_0x10631e){_0xfb83e2=_0xfb83e2-0x0;var _0x14a03a=_0xb5f0[_0xfb83e2];return _0x14a03a;};'use strict';var Sequelize=require(_0x0b5f('0x0'));module[_0x0b5f('0x1')]={'type':{'type':Sequelize['ENUM'](_0x0b5f('0x2'),_0x0b5f('0x3'),_0x0b5f('0x4'),_0x0b5f('0x5'),_0x0b5f('0x6')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x0b5f('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x0b5f('0x2'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x0b5f('0x7')]},'idField':{'type':Sequelize[_0x0b5f('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x0b5f('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0b5f('0x7')]}}; \ No newline at end of file +var _0xc06d=['exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN'];(function(_0x118903,_0x46007b){var _0x3d088a=function(_0x2495ca){while(--_0x2495ca){_0x118903['push'](_0x118903['shift']());}};_0x3d088a(++_0x46007b);}(_0xc06d,0x1ef));var _0xdc06=function(_0x480604,_0x53e1a3){_0x480604=_0x480604-0x0;var _0x363ce5=_0xc06d[_0x480604];return _0x363ce5;};'use strict';var Sequelize=require('sequelize');module[_0xdc06('0x0')]={'type':{'type':Sequelize[_0xdc06('0x1')](_0xdc06('0x2'),_0xdc06('0x3'),_0xdc06('0x4'),_0xdc06('0x5'),_0xdc06('0x6')),'defaultValue':_0xdc06('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xdc06('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0xdc06('0x2'),_0xdc06('0x3'),_0xdc06('0x4'))},'keyContent':{'type':Sequelize[_0xdc06('0x7')]},'idField':{'type':Sequelize[_0xdc06('0x7')]},'nameField':{'type':Sequelize[_0xdc06('0x7')]},'customField':{'type':Sequelize[_0xdc06('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xdc06('0x7')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index df50f34..d2d3baa 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 _0x9cb4=['filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','show','keys','find','catch','create','body','params','eml-format','rimraf','zip-dir','mustache','util','path','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/license/util','status','end','offset','undefined','limit','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','DeskField','rawAttributes','fieldName','type','model','query'];(function(_0x4e6ae6,_0x49dba6){var _0x23c108=function(_0x1bc103){while(--_0x1bc103){_0x4e6ae6['push'](_0x4e6ae6['shift']());}};_0x23c108(++_0x49dba6);}(_0x9cb4,0x12d));var _0x49cb=function(_0x3799af,_0x10b0b0){_0x3799af=_0x3799af-0x0;var _0x27ac60=_0x9cb4[_0x3799af];return _0x27ac60;};'use strict';var emlformat=require(_0x49cb('0x0'));var rimraf=require(_0x49cb('0x1'));var zipdir=require(_0x49cb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x49cb('0x3'));var util=require(_0x49cb('0x4'));var path=require(_0x49cb('0x5'));var sox=require('sox');var csv=require(_0x49cb('0x6'));var ejs=require(_0x49cb('0x7'));var fs=require('fs');var fs_extra=require(_0x49cb('0x8'));var _=require(_0x49cb('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x49cb('0xa'));var deskjs=require(_0x49cb('0xb'));var toCsv=require(_0x49cb('0x6'));var querystring=require(_0x49cb('0xc'));var Papa=require(_0x49cb('0xd'));var Redis=require(_0x49cb('0xe'));var authService=require(_0x49cb('0xf'));var qs=require(_0x49cb('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x49cb('0x11'));var logger=require('../../config/logger')(_0x49cb('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x49cb('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x29058d,_0x5288b4){_0x5288b4=_0x5288b4||0xcc;return function(_0xded295){if(_0xded295){return _0x29058d['sendStatus'](_0x5288b4);}return _0x29058d[_0x49cb('0x14')](_0x5288b4)[_0x49cb('0x15')]();};}function respondWithResult(_0x34d92a,_0x4afc06){_0x4afc06=_0x4afc06||0xc8;return function(_0x2dbf2d){if(_0x2dbf2d){return _0x34d92a[_0x49cb('0x14')](_0x4afc06)['json'](_0x2dbf2d);}};}function respondWithFilteredResult(_0x576f7d,_0x3acf95){return function(_0x4417c3){if(_0x4417c3){var _0x913ed6=typeof _0x3acf95[_0x49cb('0x16')]===_0x49cb('0x17')&&typeof _0x3acf95[_0x49cb('0x18')]===_0x49cb('0x17');var _0x17300a=_0x4417c3['count'];var _0x5eec57=_0x913ed6?0x0:_0x3acf95[_0x49cb('0x16')];var _0x20851a=_0x913ed6?_0x4417c3['count']:_0x3acf95['offset']+_0x3acf95['limit'];var _0x3c3db0;if(_0x20851a>=_0x17300a){_0x20851a=_0x17300a;_0x3c3db0=0xc8;}else{_0x3c3db0=0xce;}_0x576f7d[_0x49cb('0x14')](_0x3c3db0);return _0x576f7d['set']('Content-Range',_0x5eec57+'-'+_0x20851a+'/'+_0x17300a)[_0x49cb('0x19')](_0x4417c3);}return null;};}function patchUpdates(_0x39563c){return function(_0x363f78){try{jsonpatch[_0x49cb('0x1a')](_0x363f78,_0x39563c,!![]);}catch(_0x2a54f5){return BPromise[_0x49cb('0x1b')](_0x2a54f5);}return _0x363f78[_0x49cb('0x1c')]();};}function saveUpdates(_0x505674,_0x246c7a){return function(_0xead4cc){if(_0xead4cc){return _0xead4cc[_0x49cb('0x1d')](_0x505674)[_0x49cb('0x1e')](function(_0x55bca6){return _0x55bca6;});}return null;};}function removeEntity(_0x29d3d5,_0x2fc11f){return function(_0xd4e5c){if(_0xd4e5c){return _0xd4e5c[_0x49cb('0x1f')]()[_0x49cb('0x1e')](function(){_0x29d3d5[_0x49cb('0x14')](0xcc)[_0x49cb('0x15')]();});}};}function handleEntityNotFound(_0x58a28f,_0x47d668){return function(_0x5cb79f){if(!_0x5cb79f){_0x58a28f[_0x49cb('0x20')](0x194);}return _0x5cb79f;};}function handleError(_0x55253e,_0x1cb757){_0x1cb757=_0x1cb757||0x1f4;return function(_0x2d4d16){logger[_0x49cb('0x21')](_0x2d4d16[_0x49cb('0x22')]);if(_0x2d4d16[_0x49cb('0x23')]){delete _0x2d4d16['name'];}_0x55253e['status'](_0x1cb757)['send'](_0x2d4d16);};}exports[_0x49cb('0x24')]=function(_0x580dfb,_0x3c4fee){var _0x39aa1a={},_0x248cd2={},_0x27f55e={'count':0x0,'rows':[]};var _0x2163f3=_[_0x49cb('0x25')](db[_0x49cb('0x26')][_0x49cb('0x27')],function(_0x5ec899){return{'name':_0x5ec899[_0x49cb('0x28')],'type':_0x5ec899[_0x49cb('0x29')]['key']};});_0x248cd2[_0x49cb('0x2a')]=_[_0x49cb('0x25')](_0x2163f3,_0x49cb('0x23'));_0x248cd2[_0x49cb('0x2b')]=_['keys'](_0x580dfb['query']);_0x248cd2[_0x49cb('0x2c')]=_[_0x49cb('0x2d')](_0x248cd2[_0x49cb('0x2a')],_0x248cd2[_0x49cb('0x2b')]);_0x39aa1a[_0x49cb('0x2e')]=_[_0x49cb('0x2d')](_0x248cd2['model'],qs[_0x49cb('0x2f')](_0x580dfb[_0x49cb('0x2b')][_0x49cb('0x2f')]));_0x39aa1a[_0x49cb('0x2e')]=_0x39aa1a[_0x49cb('0x2e')][_0x49cb('0x30')]?_0x39aa1a[_0x49cb('0x2e')]:_0x248cd2['model'];if(!_0x580dfb[_0x49cb('0x2b')][_0x49cb('0x31')]('nolimit')){_0x39aa1a[_0x49cb('0x18')]=qs['limit'](_0x580dfb['query'][_0x49cb('0x18')]);_0x39aa1a[_0x49cb('0x16')]=qs[_0x49cb('0x16')](_0x580dfb[_0x49cb('0x2b')][_0x49cb('0x16')]);}_0x39aa1a['order']=qs[_0x49cb('0x32')](_0x580dfb['query'][_0x49cb('0x32')]);_0x39aa1a[_0x49cb('0x33')]=qs[_0x49cb('0x2c')](_[_0x49cb('0x34')](_0x580dfb[_0x49cb('0x2b')],_0x248cd2['filters']),_0x2163f3);if(_0x580dfb[_0x49cb('0x2b')][_0x49cb('0x35')]){_0x39aa1a['where']=_['merge'](_0x39aa1a['where'],{'$or':_[_0x49cb('0x25')](_0x2163f3,function(_0x4789c1){if(_0x4789c1[_0x49cb('0x29')]!==_0x49cb('0x36')){var _0x5aac90={};_0x5aac90[_0x4789c1[_0x49cb('0x23')]]={'$like':'%'+_0x580dfb[_0x49cb('0x2b')]['filter']+'%'};return _0x5aac90;}})});}_0x39aa1a=_[_0x49cb('0x37')]({},_0x39aa1a,_0x580dfb[_0x49cb('0x38')]);var _0x247705={'where':_0x39aa1a[_0x49cb('0x33')]};return db[_0x49cb('0x26')][_0x49cb('0x39')](_0x247705)['then'](function(_0x2980c8){_0x27f55e[_0x49cb('0x39')]=_0x2980c8;if(_0x580dfb[_0x49cb('0x2b')][_0x49cb('0x3a')]){_0x39aa1a[_0x49cb('0x3b')]=[{'all':!![]}];}return db[_0x49cb('0x26')][_0x49cb('0x3c')](_0x39aa1a);})[_0x49cb('0x1e')](function(_0x1b2da6){_0x27f55e[_0x49cb('0x3d')]=_0x1b2da6;return _0x27f55e;})[_0x49cb('0x1e')](respondWithFilteredResult(_0x3c4fee,_0x39aa1a))['catch'](handleError(_0x3c4fee,null));};exports[_0x49cb('0x3e')]=function(_0x58e4e2,_0x44854c){var _0x2e34c9={'raw':!![],'where':{'id':_0x58e4e2['params']['id']}},_0x3a33df={};_0x3a33df['model']=_[_0x49cb('0x3f')](db[_0x49cb('0x26')]['rawAttributes']);_0x3a33df[_0x49cb('0x2b')]=_[_0x49cb('0x3f')](_0x58e4e2[_0x49cb('0x2b')]);_0x3a33df[_0x49cb('0x2c')]=_[_0x49cb('0x2d')](_0x3a33df[_0x49cb('0x2a')],_0x3a33df[_0x49cb('0x2b')]);_0x2e34c9['attributes']=_['intersection'](_0x3a33df['model'],qs[_0x49cb('0x2f')](_0x58e4e2['query'][_0x49cb('0x2f')]));_0x2e34c9['attributes']=_0x2e34c9[_0x49cb('0x2e')][_0x49cb('0x30')]?_0x2e34c9[_0x49cb('0x2e')]:_0x3a33df[_0x49cb('0x2a')];if(_0x58e4e2[_0x49cb('0x2b')]['includeAll']){_0x2e34c9['include']=[{'all':!![]}];}_0x2e34c9=_[_0x49cb('0x37')]({},_0x2e34c9,_0x58e4e2['options']);return db['DeskField'][_0x49cb('0x40')](_0x2e34c9)['then'](handleEntityNotFound(_0x44854c,null))['then'](respondWithResult(_0x44854c,null))[_0x49cb('0x41')](handleError(_0x44854c,null));};exports['create']=function(_0x380756,_0x458239){return db[_0x49cb('0x26')][_0x49cb('0x42')](_0x380756['body'],{})[_0x49cb('0x1e')](respondWithResult(_0x458239,0xc9))['catch'](handleError(_0x458239,null));};exports['update']=function(_0x3e0e2c,_0x3986be){if(_0x3e0e2c[_0x49cb('0x43')]['id']){delete _0x3e0e2c['body']['id'];}return db['DeskField'][_0x49cb('0x40')]({'where':{'id':_0x3e0e2c[_0x49cb('0x44')]['id']}})[_0x49cb('0x1e')](handleEntityNotFound(_0x3986be,null))[_0x49cb('0x1e')](saveUpdates(_0x3e0e2c[_0x49cb('0x43')],null))['then'](respondWithResult(_0x3986be,null))[_0x49cb('0x41')](handleError(_0x3986be,null));};exports['destroy']=function(_0x5f09d5,_0x328532){return db[_0x49cb('0x26')][_0x49cb('0x40')]({'where':{'id':_0x5f09d5[_0x49cb('0x44')]['id']}})[_0x49cb('0x1e')](handleEntityNotFound(_0x328532,null))[_0x49cb('0x1e')](removeEntity(_0x328532,null))[_0x49cb('0x41')](handleError(_0x328532,null));}; \ No newline at end of file +var _0x0699=['filter','where','merge','VIRTUAL','options','DeskField','include','rows','catch','show','params','includeAll','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','keys','query','intersection','attributes','fields','length','hasOwnProperty','offset','order','sort','filters'];(function(_0x17915a,_0x46868f){var _0x502045=function(_0x38f703){while(--_0x38f703){_0x17915a['push'](_0x17915a['shift']());}};_0x502045(++_0x46868f);}(_0x0699,0x181));var _0x9069=function(_0x29cdc4,_0x979626){_0x29cdc4=_0x29cdc4-0x0;var _0x6f7e81=_0x0699[_0x29cdc4];return _0x6f7e81;};'use strict';var emlformat=require(_0x9069('0x0'));var rimraf=require(_0x9069('0x1'));var zipdir=require(_0x9069('0x2'));var jsonpatch=require(_0x9069('0x3'));var rp=require('request-promise');var moment=require(_0x9069('0x4'));var BPromise=require(_0x9069('0x5'));var Mustache=require('mustache');var util=require(_0x9069('0x6'));var path=require(_0x9069('0x7'));var sox=require(_0x9069('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9069('0x9'));var _=require(_0x9069('0xa'));var squel=require(_0x9069('0xb'));var crypto=require(_0x9069('0xc'));var jsforce=require(_0x9069('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x9069('0xe'));var querystring=require(_0x9069('0xf'));var Papa=require(_0x9069('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9069('0x11'));var hardwareService=require(_0x9069('0x12'));var logger=require('../../config/logger')(_0x9069('0x13'));var utils=require(_0x9069('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x9069('0x15'));var db=require(_0x9069('0x16'))['db'];function respondWithStatusCode(_0x10f811,_0x36dd33){_0x36dd33=_0x36dd33||0xcc;return function(_0xb7b6bd){if(_0xb7b6bd){return _0x10f811['sendStatus'](_0x36dd33);}return _0x10f811[_0x9069('0x17')](_0x36dd33)['end']();};}function respondWithResult(_0x36e2d0,_0x3cbdfe){_0x3cbdfe=_0x3cbdfe||0xc8;return function(_0x5f3379){if(_0x5f3379){return _0x36e2d0[_0x9069('0x17')](_0x3cbdfe)[_0x9069('0x18')](_0x5f3379);}};}function respondWithFilteredResult(_0x4c2601,_0x28800c){return function(_0x1309b4){if(_0x1309b4){var _0x45ea54=typeof _0x28800c['offset']===_0x9069('0x19')&&typeof _0x28800c[_0x9069('0x1a')]==='undefined';var _0x5d3464=_0x1309b4[_0x9069('0x1b')];var _0xb7b17a=_0x45ea54?0x0:_0x28800c['offset'];var _0x5b645e=_0x45ea54?_0x1309b4[_0x9069('0x1b')]:_0x28800c['offset']+_0x28800c['limit'];var _0x27ba65;if(_0x5b645e>=_0x5d3464){_0x5b645e=_0x5d3464;_0x27ba65=0xc8;}else{_0x27ba65=0xce;}_0x4c2601[_0x9069('0x17')](_0x27ba65);return _0x4c2601[_0x9069('0x1c')](_0x9069('0x1d'),_0xb7b17a+'-'+_0x5b645e+'/'+_0x5d3464)[_0x9069('0x18')](_0x1309b4);}return null;};}function patchUpdates(_0x708fe1){return function(_0x47483b){try{jsonpatch[_0x9069('0x1e')](_0x47483b,_0x708fe1,!![]);}catch(_0xa34e71){return BPromise[_0x9069('0x1f')](_0xa34e71);}return _0x47483b[_0x9069('0x20')]();};}function saveUpdates(_0x149c32,_0x261281){return function(_0x1f4c73){if(_0x1f4c73){return _0x1f4c73[_0x9069('0x21')](_0x149c32)[_0x9069('0x22')](function(_0x330ece){return _0x330ece;});}return null;};}function removeEntity(_0x5c37d5,_0x5c1950){return function(_0x203514){if(_0x203514){return _0x203514[_0x9069('0x23')]()[_0x9069('0x22')](function(){_0x5c37d5[_0x9069('0x17')](0xcc)[_0x9069('0x24')]();});}};}function handleEntityNotFound(_0x20e4e7,_0x127829){return function(_0x3894bc){if(!_0x3894bc){_0x20e4e7[_0x9069('0x25')](0x194);}return _0x3894bc;};}function handleError(_0x25f684,_0x50fc56){_0x50fc56=_0x50fc56||0x1f4;return function(_0x192592){logger['error'](_0x192592[_0x9069('0x26')]);if(_0x192592[_0x9069('0x27')]){delete _0x192592[_0x9069('0x27')];}_0x25f684[_0x9069('0x17')](_0x50fc56)[_0x9069('0x28')](_0x192592);};}exports[_0x9069('0x29')]=function(_0x28b899,_0x4d82e4){var _0x1b43e7={},_0x16c2b7={},_0x5a2a0c={'count':0x0,'rows':[]};var _0xe43d51=_['map'](db['DeskField'][_0x9069('0x2a')],function(_0x178115){return{'name':_0x178115[_0x9069('0x2b')],'type':_0x178115[_0x9069('0x2c')][_0x9069('0x2d')]};});_0x16c2b7[_0x9069('0x2e')]=_[_0x9069('0x2f')](_0xe43d51,_0x9069('0x27'));_0x16c2b7['query']=_[_0x9069('0x30')](_0x28b899[_0x9069('0x31')]);_0x16c2b7['filters']=_[_0x9069('0x32')](_0x16c2b7[_0x9069('0x2e')],_0x16c2b7[_0x9069('0x31')]);_0x1b43e7[_0x9069('0x33')]=_['intersection'](_0x16c2b7['model'],qs[_0x9069('0x34')](_0x28b899[_0x9069('0x31')][_0x9069('0x34')]));_0x1b43e7['attributes']=_0x1b43e7['attributes'][_0x9069('0x35')]?_0x1b43e7[_0x9069('0x33')]:_0x16c2b7[_0x9069('0x2e')];if(!_0x28b899[_0x9069('0x31')][_0x9069('0x36')]('nolimit')){_0x1b43e7['limit']=qs['limit'](_0x28b899[_0x9069('0x31')][_0x9069('0x1a')]);_0x1b43e7['offset']=qs[_0x9069('0x37')](_0x28b899[_0x9069('0x31')]['offset']);}_0x1b43e7[_0x9069('0x38')]=qs[_0x9069('0x39')](_0x28b899['query']['sort']);_0x1b43e7['where']=qs[_0x9069('0x3a')](_['pick'](_0x28b899[_0x9069('0x31')],_0x16c2b7[_0x9069('0x3a')]),_0xe43d51);if(_0x28b899[_0x9069('0x31')][_0x9069('0x3b')]){_0x1b43e7[_0x9069('0x3c')]=_[_0x9069('0x3d')](_0x1b43e7[_0x9069('0x3c')],{'$or':_[_0x9069('0x2f')](_0xe43d51,function(_0x28abc1){if(_0x28abc1[_0x9069('0x2c')]!==_0x9069('0x3e')){var _0x180968={};_0x180968[_0x28abc1['name']]={'$like':'%'+_0x28b899[_0x9069('0x31')][_0x9069('0x3b')]+'%'};return _0x180968;}})});}_0x1b43e7=_[_0x9069('0x3d')]({},_0x1b43e7,_0x28b899[_0x9069('0x3f')]);var _0x38bfb4={'where':_0x1b43e7[_0x9069('0x3c')]};return db[_0x9069('0x40')]['count'](_0x38bfb4)[_0x9069('0x22')](function(_0x3ecba0){_0x5a2a0c[_0x9069('0x1b')]=_0x3ecba0;if(_0x28b899[_0x9069('0x31')]['includeAll']){_0x1b43e7[_0x9069('0x41')]=[{'all':!![]}];}return db[_0x9069('0x40')]['findAll'](_0x1b43e7);})[_0x9069('0x22')](function(_0x3f5021){_0x5a2a0c[_0x9069('0x42')]=_0x3f5021;return _0x5a2a0c;})['then'](respondWithFilteredResult(_0x4d82e4,_0x1b43e7))[_0x9069('0x43')](handleError(_0x4d82e4,null));};exports[_0x9069('0x44')]=function(_0x47a35d,_0x48bf75){var _0x134f94={'raw':!![],'where':{'id':_0x47a35d[_0x9069('0x45')]['id']}},_0x6e5b8={};_0x6e5b8[_0x9069('0x2e')]=_[_0x9069('0x30')](db[_0x9069('0x40')][_0x9069('0x2a')]);_0x6e5b8[_0x9069('0x31')]=_[_0x9069('0x30')](_0x47a35d['query']);_0x6e5b8[_0x9069('0x3a')]=_[_0x9069('0x32')](_0x6e5b8[_0x9069('0x2e')],_0x6e5b8[_0x9069('0x31')]);_0x134f94['attributes']=_[_0x9069('0x32')](_0x6e5b8['model'],qs['fields'](_0x47a35d[_0x9069('0x31')]['fields']));_0x134f94['attributes']=_0x134f94[_0x9069('0x33')][_0x9069('0x35')]?_0x134f94[_0x9069('0x33')]:_0x6e5b8[_0x9069('0x2e')];if(_0x47a35d[_0x9069('0x31')][_0x9069('0x46')]){_0x134f94[_0x9069('0x41')]=[{'all':!![]}];}_0x134f94=_[_0x9069('0x3d')]({},_0x134f94,_0x47a35d[_0x9069('0x3f')]);return db['DeskField'][_0x9069('0x47')](_0x134f94)[_0x9069('0x22')](handleEntityNotFound(_0x48bf75,null))[_0x9069('0x22')](respondWithResult(_0x48bf75,null))['catch'](handleError(_0x48bf75,null));};exports['create']=function(_0x3f6d67,_0x457fe0){return db[_0x9069('0x40')][_0x9069('0x48')](_0x3f6d67[_0x9069('0x49')],{})['then'](respondWithResult(_0x457fe0,0xc9))['catch'](handleError(_0x457fe0,null));};exports['update']=function(_0xd99f68,_0x5a1b50){if(_0xd99f68[_0x9069('0x49')]['id']){delete _0xd99f68['body']['id'];}return db[_0x9069('0x40')][_0x9069('0x47')]({'where':{'id':_0xd99f68[_0x9069('0x45')]['id']}})[_0x9069('0x22')](handleEntityNotFound(_0x5a1b50,null))[_0x9069('0x22')](saveUpdates(_0xd99f68[_0x9069('0x49')],null))[_0x9069('0x22')](respondWithResult(_0x5a1b50,null))['catch'](handleError(_0x5a1b50,null));};exports[_0x9069('0x23')]=function(_0x47084b,_0x6dc7d5){return db['DeskField']['find']({'where':{'id':_0x47084b[_0x9069('0x45')]['id']}})[_0x9069('0x22')](handleEntityNotFound(_0x6dc7d5,null))['then'](removeEntity(_0x6dc7d5,null))[_0x9069('0x43')](handleError(_0x6dc7d5,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 5f13aab..168042d 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 _0x5381=['api','bluebird','request-promise','rimraf','../../config/environment','exports','define','DeskField','int_desk_fields','FieldId','util'];(function(_0x5317b5,_0x4dfd6e){var _0x3b7ce2=function(_0xc146d6){while(--_0xc146d6){_0x5317b5['push'](_0x5317b5['shift']());}};_0x3b7ce2(++_0x4dfd6e);}(_0x5381,0x1d8));var _0x1538=function(_0x39ed09,_0x33b122){_0x39ed09=_0x39ed09-0x0;var _0x9d95d5=_0x5381[_0x39ed09];return _0x9d95d5;};'use strict';var _=require('lodash');var util=require(_0x1538('0x0'));var logger=require('../../config/logger')(_0x1538('0x1'));var moment=require('moment');var BPromise=require(_0x1538('0x2'));var rp=require(_0x1538('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1538('0x4'));var config=require(_0x1538('0x5'));var attributes=require('./intDeskField.attributes');module[_0x1538('0x6')]=function(_0x84f8a0,_0x5a6e21){return _0x84f8a0[_0x1538('0x7')](_0x1538('0x8'),attributes,{'tableName':_0x1538('0x9'),'paranoid':![],'indexes':[{'name':'desk_unique_index','fields':['idField',_0x1538('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8904=['bluebird','request-promise','path','rimraf','../../config/environment','./intDeskField.attributes','exports','define','idField','FieldId','lodash','../../config/logger','api','moment'];(function(_0x501732,_0x53aaa0){var _0x588ae8=function(_0x2ad1fd){while(--_0x2ad1fd){_0x501732['push'](_0x501732['shift']());}};_0x588ae8(++_0x53aaa0);}(_0x8904,0x1bc));var _0x4890=function(_0x1dc192,_0x329b5b){_0x1dc192=_0x1dc192-0x0;var _0xe4dbb0=_0x8904[_0x1dc192];return _0xe4dbb0;};'use strict';var _=require(_0x4890('0x0'));var util=require('util');var logger=require(_0x4890('0x1'))(_0x4890('0x2'));var moment=require(_0x4890('0x3'));var BPromise=require(_0x4890('0x4'));var rp=require(_0x4890('0x5'));var fs=require('fs');var path=require(_0x4890('0x6'));var rimraf=require(_0x4890('0x7'));var config=require(_0x4890('0x8'));var attributes=require(_0x4890('0x9'));module[_0x4890('0xa')]=function(_0x454355,_0x2f485f){return _0x454355[_0x4890('0xb')]('DeskField',attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':'desk_unique_index','fields':[_0x4890('0xc'),_0x4890('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js index 2de49c9..9909896 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 _0xb7a6=['DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info'];(function(_0x54f46f,_0x42f5a3){var _0x1d4006=function(_0x5a7b3d){while(--_0x5a7b3d){_0x54f46f['push'](_0x54f46f['shift']());}};_0x1d4006(++_0x42f5a3);}(_0xb7a6,0x120));var _0x6b7a=function(_0x3e49be,_0x55924c){_0x3e49be=_0x3e49be-0x0;var _0x5af8cf=_0xb7a6[_0x3e49be];return _0x5af8cf;};'use strict';var _=require('lodash');var util=require(_0x6b7a('0x0'));var moment=require(_0x6b7a('0x1'));var BPromise=require(_0x6b7a('0x2'));var rs=require(_0x6b7a('0x3'));var fs=require('fs');var Redis=require(_0x6b7a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6b7a('0x5'));var logger=require(_0x6b7a('0x6'))('rpc');var config=require(_0x6b7a('0x7'));var jayson=require(_0x6b7a('0x8'));var client=jayson['client'][_0x6b7a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xbbba6c,_0x49738e,_0x1aa6dd){return new BPromise(function(_0x5e96e7,_0xd5b2ae){return client[_0x6b7a('0xa')](_0xbbba6c,_0x1aa6dd)['then'](function(_0xded5f9){logger[_0x6b7a('0xb')](_0x6b7a('0xc'),_0x49738e,_0x6b7a('0xd'));logger[_0x6b7a('0xe')](_0x6b7a('0xf'),_0x49738e,_0x6b7a('0xd'),JSON['stringify'](_0xded5f9));if(_0xded5f9[_0x6b7a('0x10')]){if(_0xded5f9['error'][_0x6b7a('0x11')]===0x1f4){logger[_0x6b7a('0x10')]('DeskField,\x20%s,\x20%s',_0x49738e,_0xded5f9['error']['message']);return _0xd5b2ae(_0xded5f9[_0x6b7a('0x10')][_0x6b7a('0x12')]);}logger['error'](_0x6b7a('0xc'),_0x49738e,_0xded5f9[_0x6b7a('0x10')]['message']);return _0x5e96e7(_0xded5f9['error'][_0x6b7a('0x12')]);}else{logger[_0x6b7a('0xb')]('DeskField,\x20%s,\x20%s',_0x49738e,'request\x20sent');_0x5e96e7(_0xded5f9[_0x6b7a('0x13')]['message']);}})['catch'](function(_0x132381){logger[_0x6b7a('0x10')]('DeskField,\x20%s,\x20%s',_0x49738e,_0x132381);_0xd5b2ae(_0x132381);});});} \ No newline at end of file +var _0x2383=['code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x13b436,_0x58481c){var _0x466b45=function(_0x2dcee1){while(--_0x2dcee1){_0x13b436['push'](_0x13b436['shift']());}};_0x466b45(++_0x58481c);}(_0x2383,0x13c));var _0x3238=function(_0x5464fc,_0x10c079){_0x5464fc=_0x5464fc-0x0;var _0xc0058f=_0x2383[_0x5464fc];return _0xc0058f;};'use strict';var _=require('lodash');var util=require(_0x3238('0x0'));var moment=require('moment');var BPromise=require(_0x3238('0x1'));var rs=require(_0x3238('0x2'));var fs=require('fs');var Redis=require(_0x3238('0x3'));var db=require(_0x3238('0x4'))['db'];var utils=require(_0x3238('0x5'));var logger=require(_0x3238('0x6'))(_0x3238('0x7'));var config=require(_0x3238('0x8'));var jayson=require(_0x3238('0x9'));var client=jayson[_0x3238('0xa')][_0x3238('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5b8ebb,_0x1445f3,_0x43a1cd){return new BPromise(function(_0x4f6f85,_0x3fa14f){return client[_0x3238('0xc')](_0x5b8ebb,_0x43a1cd)[_0x3238('0xd')](function(_0x3566be){logger[_0x3238('0xe')](_0x3238('0xf'),_0x1445f3,_0x3238('0x10'));logger[_0x3238('0x11')]('DeskField,\x20%s,\x20%s,\x20%s',_0x1445f3,'request\x20sent',JSON[_0x3238('0x12')](_0x3566be));if(_0x3566be[_0x3238('0x13')]){if(_0x3566be[_0x3238('0x13')][_0x3238('0x14')]===0x1f4){logger[_0x3238('0x13')](_0x3238('0xf'),_0x1445f3,_0x3566be[_0x3238('0x13')][_0x3238('0x15')]);return _0x3fa14f(_0x3566be['error'][_0x3238('0x15')]);}logger[_0x3238('0x13')](_0x3238('0xf'),_0x1445f3,_0x3566be[_0x3238('0x13')][_0x3238('0x15')]);return _0x4f6f85(_0x3566be[_0x3238('0x13')][_0x3238('0x15')]);}else{logger[_0x3238('0xe')](_0x3238('0xf'),_0x1445f3,_0x3238('0x10'));_0x4f6f85(_0x3566be[_0x3238('0x16')][_0x3238('0x15')]);}})[_0x3238('0x17')](function(_0x3aa4d3){logger[_0x3238('0x13')](_0x3238('0xf'),_0x1445f3,_0x3aa4d3);_0x3fa14f(_0x3aa4d3);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 0600902..63304c6 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 _0xc0cd=['delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','index','show','/:id/configurations','isAuthenticated','/:id/fields','getFields','post','update'];(function(_0x4c5ebd,_0x5740a1){var _0x8f450b=function(_0x51a5aa){while(--_0x51a5aa){_0x4c5ebd['push'](_0x4c5ebd['shift']());}};_0x8f450b(++_0x5740a1);}(_0xc0cd,0x138));var _0xdc0c=function(_0xb9d968,_0x2bf504){_0xb9d968=_0xb9d968-0x0;var _0x29b431=_0xc0cd[_0xb9d968];return _0x29b431;};'use strict';var multer=require(_0xdc0c('0x0'));var util=require(_0xdc0c('0x1'));var path=require(_0xdc0c('0x2'));var timeout=require(_0xdc0c('0x3'));var express=require(_0xdc0c('0x4'));var router=express['Router']();var fs_extra=require(_0xdc0c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xdc0c('0x6'));var config=require(_0xdc0c('0x7'));var controller=require(_0xdc0c('0x8'));router[_0xdc0c('0x9')]('/',auth['isAuthenticated'](),controller[_0xdc0c('0xa')]);router[_0xdc0c('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xdc0c('0xb')]);router[_0xdc0c('0x9')](_0xdc0c('0xc'),auth[_0xdc0c('0xd')](),controller['getConfigurations']);router[_0xdc0c('0x9')](_0xdc0c('0xe'),auth[_0xdc0c('0xd')](),controller[_0xdc0c('0xf')]);router[_0xdc0c('0x10')]('/',auth[_0xdc0c('0xd')](),controller['create']);router[_0xdc0c('0x10')](_0xdc0c('0xc'),auth[_0xdc0c('0xd')](),controller['addConfiguration']);router['put']('/:id',auth[_0xdc0c('0xd')](),controller[_0xdc0c('0x11')]);router[_0xdc0c('0x12')](_0xdc0c('0x13'),auth['isAuthenticated'](),controller[_0xdc0c('0x14')]);module[_0xdc0c('0x15')]=router; \ No newline at end of file +var _0x466e=['destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete'];(function(_0xe704ea,_0xc73e4b){var _0x1e7480=function(_0x2fc09a){while(--_0x2fc09a){_0xe704ea['push'](_0xe704ea['shift']());}};_0x1e7480(++_0xc73e4b);}(_0x466e,0x16e));var _0xe466=function(_0x25d431,_0x2b1703){_0x25d431=_0x25d431-0x0;var _0x348a21=_0x466e[_0x25d431];return _0x348a21;};'use strict';var multer=require(_0xe466('0x0'));var util=require(_0xe466('0x1'));var path=require('path');var timeout=require(_0xe466('0x2'));var express=require(_0xe466('0x3'));var router=express['Router']();var fs_extra=require(_0xe466('0x4'));var auth=require(_0xe466('0x5'));var interaction=require(_0xe466('0x6'));var config=require(_0xe466('0x7'));var controller=require(_0xe466('0x8'));router[_0xe466('0x9')]('/',auth['isAuthenticated'](),controller[_0xe466('0xa')]);router[_0xe466('0x9')](_0xe466('0xb'),auth[_0xe466('0xc')](),controller[_0xe466('0xd')]);router['get'](_0xe466('0xe'),auth[_0xe466('0xc')](),controller[_0xe466('0xf')]);router[_0xe466('0x9')](_0xe466('0x10'),auth[_0xe466('0xc')](),controller[_0xe466('0x11')]);router[_0xe466('0x12')]('/',auth['isAuthenticated'](),controller[_0xe466('0x13')]);router[_0xe466('0x12')](_0xe466('0xe'),auth[_0xe466('0xc')](),controller[_0xe466('0x14')]);router[_0xe466('0x15')]('/:id',auth[_0xe466('0xc')](),controller[_0xe466('0x16')]);router[_0xe466('0x17')](_0xe466('0xb'),auth[_0xe466('0xc')](),controller[_0xe466('0x18')]);module[_0xe466('0x19')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 597e98b..5c0b10a 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 _0xfa45=['exports','STRING','BOOLEAN','sequelize'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xfa45,0x11b));var _0x5fa4=function(_0x16d785,_0x15bf0f){_0x16d785=_0x16d785-0x0;var _0x43b65d=_0xfa45[_0x16d785];return _0x43b65d;};'use strict';var Sequelize=require(_0x5fa4('0x0'));module[_0x5fa4('0x1')]={'name':{'type':Sequelize[_0x5fa4('0x2')]},'username':{'type':Sequelize[_0x5fa4('0x2')]},'password':{'type':Sequelize[_0x5fa4('0x2')]},'remoteUri':{'type':Sequelize[_0x5fa4('0x2')]},'tenantId':{'type':Sequelize[_0x5fa4('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x5fa4('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x5fa4('0x2')]},'modernAuthentication':{'type':Sequelize[_0x5fa4('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x9e8a=['STRING','sequelize','exports'];(function(_0x1090f4,_0xbb0d5f){var _0x141d87=function(_0x31d559){while(--_0x31d559){_0x1090f4['push'](_0x1090f4['shift']());}};_0x141d87(++_0xbb0d5f);}(_0x9e8a,0x112));var _0xa9e8=function(_0x2b8764,_0x43d49f){_0x2b8764=_0x2b8764-0x0;var _0x11af3d=_0x9e8a[_0x2b8764];return _0x11af3d;};'use strict';var Sequelize=require(_0xa9e8('0x0'));module[_0xa9e8('0x1')]={'name':{'type':Sequelize[_0xa9e8('0x2')]},'username':{'type':Sequelize[_0xa9e8('0x2')]},'password':{'type':Sequelize[_0xa9e8('0x2')]},'remoteUri':{'type':Sequelize[_0xa9e8('0x2')]},'tenantId':{'type':Sequelize[_0xa9e8('0x2')]},'clientId':{'type':Sequelize[_0xa9e8('0x2')]},'clientSecret':{'type':Sequelize[_0xa9e8('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 06104e8..c94a279 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 _0xb7d1=['ticketType','incident','Incident','PhoneCall','title','description','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidyominame','actualserviceunits','billedserviceunits','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','emailaddress','entitlementidname','entityimage_url','escalatedon','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','lastonholdtime','masteridname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedonbehalfbyname','msdyn_incidenttypename','msdyn_iotalertname','onholdtime','overriddencreatedon','owneridname','owneridtype','parentcaseidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','responseby','responsiblecontactidname','responsiblecontactidyominame','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','versionnumber','username','password','remoteUri','tenantId','clientId','clientSecret','CloudProvider','data5','data7','modernAuthentication','POST','https://login.microsoftonline.com/','access_token','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','4.0','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Bearer\x20','remove','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','all','isNil','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','concat','error','test','GET',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','util','lodash','../../components/parsers/qs','../../config/logger','api','../../components/integrations/configuration','json','offset','undefined','limit','count','status','set','Content-Range','then','end','stack','name','send','index','Dynamics365Account','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','options','findAll','rows','catch','show','params','keys','include','create','body','update','find','getConfigurations','findOne','Dynamics365Configuration','rawAttributes','sort','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','getFields'];(function(_0x1afc77,_0x3aadc7){var _0x392f97=function(_0x2e7dd4){while(--_0x2e7dd4){_0x1afc77['push'](_0x1afc77['shift']());}};_0x392f97(++_0x3aadc7);}(_0xb7d1,0x79));var _0x1b7d=function(_0x43b0a2,_0x188a9d){_0x43b0a2=_0x43b0a2-0x0;var _0xd5025c=_0xb7d1[_0x43b0a2];return _0xd5025c;};'use strict';var rp=require(_0x1b7d('0x0'));var util=require(_0x1b7d('0x1'));var _=require(_0x1b7d('0x2'));var qs=require(_0x1b7d('0x3'));var logger=require(_0x1b7d('0x4'))(_0x1b7d('0x5'));var db=require('../../mysqldb')['db'];var integrations=require(_0x1b7d('0x6'));function respondWithResult(_0x50b219,_0x5af97d){_0x5af97d=_0x5af97d||0xc8;return function(_0x53bb98){if(_0x53bb98){return _0x50b219['status'](_0x5af97d)[_0x1b7d('0x7')](_0x53bb98);}};}function respondWithFilteredResult(_0xcbf80d,_0xe7436b){return function(_0x21d814){if(_0x21d814){var _0x2eb249=typeof _0xe7436b[_0x1b7d('0x8')]===_0x1b7d('0x9')&&typeof _0xe7436b[_0x1b7d('0xa')]===_0x1b7d('0x9');var _0x13d7e6=_0x21d814['count'];var _0xaf2510=_0x2eb249?0x0:_0xe7436b[_0x1b7d('0x8')];var _0xa12fc2=_0x2eb249?_0x21d814[_0x1b7d('0xb')]:_0xe7436b[_0x1b7d('0x8')]+_0xe7436b[_0x1b7d('0xa')];var _0x328c3e;if(_0xa12fc2>=_0x13d7e6){_0xa12fc2=_0x13d7e6;_0x328c3e=0xc8;}else{_0x328c3e=0xce;}_0xcbf80d[_0x1b7d('0xc')](_0x328c3e);return _0xcbf80d[_0x1b7d('0xd')](_0x1b7d('0xe'),_0xaf2510+'-'+_0xa12fc2+'/'+_0x13d7e6)[_0x1b7d('0x7')](_0x21d814);}return null;};}function saveUpdates(_0x288dfd){return function(_0x48853f){if(_0x48853f){return _0x48853f['update'](_0x288dfd)[_0x1b7d('0xf')](function(_0x381865){return _0x381865;});}return null;};}function removeEntity(_0x2c5bfc){return function(_0x1f448f){if(_0x1f448f){return _0x1f448f['destroy']()[_0x1b7d('0xf')](function(){_0x2c5bfc[_0x1b7d('0xc')](0xcc)[_0x1b7d('0x10')]();});}};}function handleEntityNotFound(_0x15ed67){return function(_0x787ad8){if(!_0x787ad8){_0x15ed67['sendStatus'](0x194);}return _0x787ad8;};}function handleError(_0x26ad2e,_0x82c937){_0x82c937=_0x82c937||0x1f4;return function(_0x42d207){logger['error'](_0x42d207[_0x1b7d('0x11')]);if(_0x42d207[_0x1b7d('0x12')]){delete _0x42d207[_0x1b7d('0x12')];}_0x26ad2e[_0x1b7d('0xc')](_0x82c937)[_0x1b7d('0x13')](_0x42d207);};}exports[_0x1b7d('0x14')]=function(_0x327f36,_0x1ad55a){var _0x219ca9={},_0x37a81a={},_0x546a93={'count':0x0,'rows':[]};var _0x1e4fb9=_['map'](db[_0x1b7d('0x15')]['rawAttributes'],function(_0x8a4eb2){return{'name':_0x8a4eb2[_0x1b7d('0x16')],'type':_0x8a4eb2[_0x1b7d('0x17')][_0x1b7d('0x18')]};});_0x37a81a[_0x1b7d('0x19')]=_[_0x1b7d('0x1a')](_0x1e4fb9,_0x1b7d('0x12'));_0x37a81a[_0x1b7d('0x1b')]=_['keys'](_0x327f36['query']);_0x37a81a[_0x1b7d('0x1c')]=_[_0x1b7d('0x1d')](_0x37a81a[_0x1b7d('0x19')],_0x37a81a[_0x1b7d('0x1b')]);_0x219ca9[_0x1b7d('0x1e')]=_[_0x1b7d('0x1d')](_0x37a81a['model'],qs[_0x1b7d('0x1f')](_0x327f36['query'][_0x1b7d('0x1f')]));_0x219ca9[_0x1b7d('0x1e')]=_0x219ca9['attributes'][_0x1b7d('0x20')]?_0x219ca9['attributes']:_0x37a81a[_0x1b7d('0x19')];if(!_0x327f36[_0x1b7d('0x1b')][_0x1b7d('0x21')](_0x1b7d('0x22'))){_0x219ca9[_0x1b7d('0xa')]=qs[_0x1b7d('0xa')](_0x327f36['query'][_0x1b7d('0xa')]);_0x219ca9['offset']=qs[_0x1b7d('0x8')](_0x327f36['query'][_0x1b7d('0x8')]);}_0x219ca9[_0x1b7d('0x23')]=qs['sort'](_0x327f36[_0x1b7d('0x1b')]['sort']);_0x219ca9[_0x1b7d('0x24')]=qs[_0x1b7d('0x1c')](_[_0x1b7d('0x25')](_0x327f36['query'],_0x37a81a[_0x1b7d('0x1c')]),_0x1e4fb9);if(_0x327f36[_0x1b7d('0x1b')][_0x1b7d('0x26')]){_0x219ca9['where']=_[_0x1b7d('0x27')](_0x219ca9['where'],{'$or':_[_0x1b7d('0x1a')](_0x1e4fb9,function(_0x36040c){if(_0x36040c[_0x1b7d('0x17')]!=='VIRTUAL'){var _0x4ac7a1={};_0x4ac7a1[_0x36040c['name']]={'$like':'%'+_0x327f36[_0x1b7d('0x1b')][_0x1b7d('0x26')]+'%'};return _0x4ac7a1;}})});}_0x219ca9=_[_0x1b7d('0x27')]({},_0x219ca9,_0x327f36[_0x1b7d('0x28')]);var _0x690b0a={'where':_0x219ca9['where']};return db[_0x1b7d('0x15')][_0x1b7d('0xb')](_0x690b0a)[_0x1b7d('0xf')](function(_0x49f8e2){_0x546a93['count']=_0x49f8e2;if(_0x327f36[_0x1b7d('0x1b')]['includeAll']){_0x219ca9['include']=[{'all':!![]}];}return db['Dynamics365Account'][_0x1b7d('0x29')](_0x219ca9);})[_0x1b7d('0xf')](function(_0x256b40){_0x546a93[_0x1b7d('0x2a')]=_0x256b40;return _0x546a93;})[_0x1b7d('0xf')](respondWithFilteredResult(_0x1ad55a,_0x219ca9))[_0x1b7d('0x2b')](handleError(_0x1ad55a,null));};exports[_0x1b7d('0x2c')]=function(_0x3aaec6,_0x5d0ffa){var _0x209726={'raw':![],'where':{'id':_0x3aaec6[_0x1b7d('0x2d')]['id']}},_0x599faf={};_0x599faf[_0x1b7d('0x19')]=_[_0x1b7d('0x2e')](db[_0x1b7d('0x15')]['rawAttributes']);_0x599faf[_0x1b7d('0x1b')]=_[_0x1b7d('0x2e')](_0x3aaec6[_0x1b7d('0x1b')]);_0x599faf['filters']=_[_0x1b7d('0x1d')](_0x599faf[_0x1b7d('0x19')],_0x599faf['query']);_0x209726[_0x1b7d('0x1e')]=_[_0x1b7d('0x1d')](_0x599faf[_0x1b7d('0x19')],qs[_0x1b7d('0x1f')](_0x3aaec6[_0x1b7d('0x1b')][_0x1b7d('0x1f')]));_0x209726[_0x1b7d('0x1e')]=_0x209726[_0x1b7d('0x1e')][_0x1b7d('0x20')]?_0x209726[_0x1b7d('0x1e')]:_0x599faf[_0x1b7d('0x19')];if(_0x3aaec6[_0x1b7d('0x1b')]['includeAll']){_0x209726[_0x1b7d('0x2f')]=[{'all':!![]}];}_0x209726=_[_0x1b7d('0x27')]({},_0x209726,_0x3aaec6[_0x1b7d('0x28')]);return db[_0x1b7d('0x15')]['find'](_0x209726)[_0x1b7d('0xf')](handleEntityNotFound(_0x5d0ffa,null))[_0x1b7d('0xf')](respondWithResult(_0x5d0ffa,null))['catch'](handleError(_0x5d0ffa,null));};exports[_0x1b7d('0x30')]=function(_0x40b1e5,_0x41e3f5){return db['Dynamics365Account']['create'](_0x40b1e5[_0x1b7d('0x31')],{})['then'](respondWithResult(_0x41e3f5,0xc9))[_0x1b7d('0x2b')](handleError(_0x41e3f5,null));};exports[_0x1b7d('0x32')]=function(_0x2fa759,_0x3f0db6){if(_0x2fa759[_0x1b7d('0x31')]['id']){delete _0x2fa759[_0x1b7d('0x31')]['id'];}return db['Dynamics365Account'][_0x1b7d('0x33')]({'where':{'id':_0x2fa759[_0x1b7d('0x2d')]['id']}})[_0x1b7d('0xf')](handleEntityNotFound(_0x3f0db6,null))[_0x1b7d('0xf')](saveUpdates(_0x2fa759['body'],null))['then'](respondWithResult(_0x3f0db6,null))['catch'](handleError(_0x3f0db6,null));};exports['destroy']=function(_0x2a7f30,_0x3c6afd){return db['Dynamics365Account'][_0x1b7d('0x33')]({'where':{'id':_0x2a7f30[_0x1b7d('0x2d')]['id']}})['then'](handleEntityNotFound(_0x3c6afd,null))[_0x1b7d('0xf')](removeEntity(_0x3c6afd,null))[_0x1b7d('0x2b')](handleError(_0x3c6afd,null));};exports[_0x1b7d('0x34')]=function(_0xd0a704,_0x527127){var _0xb2ced5={};var _0x49582d={};var _0x2f53bd;var _0x5c966f;return db[_0x1b7d('0x15')][_0x1b7d('0x35')]({'where':{'id':_0xd0a704['params']['id']}})[_0x1b7d('0xf')](handleEntityNotFound(_0x527127,null))['then'](function(_0x37e9bc){if(_0x37e9bc){_0x2f53bd=_0x37e9bc;_0x49582d['model']=_['keys'](db[_0x1b7d('0x36')][_0x1b7d('0x37')]);_0x49582d['query']=_[_0x1b7d('0x2e')](_0xd0a704['query']);_0x49582d['filters']=_[_0x1b7d('0x1d')](_0x49582d[_0x1b7d('0x19')],_0x49582d[_0x1b7d('0x1b')]);_0xb2ced5[_0x1b7d('0x1e')]=_[_0x1b7d('0x1d')](_0x49582d[_0x1b7d('0x19')],qs[_0x1b7d('0x1f')](_0xd0a704[_0x1b7d('0x1b')]['fields']));_0xb2ced5['attributes']=_0xb2ced5[_0x1b7d('0x1e')][_0x1b7d('0x20')]?_0xb2ced5['attributes']:_0x49582d[_0x1b7d('0x19')];_0xb2ced5[_0x1b7d('0x23')]=qs[_0x1b7d('0x38')](_0xd0a704[_0x1b7d('0x1b')][_0x1b7d('0x38')]);_0xb2ced5[_0x1b7d('0x24')]=qs[_0x1b7d('0x1c')](_[_0x1b7d('0x25')](_0xd0a704[_0x1b7d('0x1b')],_0x49582d['filters']));if(_0xd0a704[_0x1b7d('0x1b')][_0x1b7d('0x26')]){_0xb2ced5['where']=_[_0x1b7d('0x27')](_0xb2ced5[_0x1b7d('0x24')],{'$or':_['map'](_0xb2ced5[_0x1b7d('0x1e')],function(_0x453683){var _0x11c3ea={};_0x11c3ea[_0x453683]={'$like':'%'+_0xd0a704['query'][_0x1b7d('0x26')]+'%'};return _0x11c3ea;})});}_0xb2ced5=_[_0x1b7d('0x27')]({},_0xb2ced5,_0xd0a704[_0x1b7d('0x28')]);return _0x2f53bd[_0x1b7d('0x34')](_0xb2ced5);}})['then'](function(_0x58aa6a){if(_0x58aa6a){_0x5c966f=_0x58aa6a[_0x1b7d('0x20')];if(!_0xd0a704['query'][_0x1b7d('0x21')](_0x1b7d('0x22'))){_0xb2ced5['limit']=qs['limit'](_0xd0a704[_0x1b7d('0x1b')][_0x1b7d('0xa')]);_0xb2ced5[_0x1b7d('0x8')]=qs[_0x1b7d('0x8')](_0xd0a704['query'][_0x1b7d('0x8')]);}return _0x2f53bd['getConfigurations'](_0xb2ced5);}})[_0x1b7d('0xf')](function(_0x3da757){if(_0x3da757){return _0x3da757?{'count':_0x5c966f,'rows':_0x3da757}:null;}})['then'](respondWithResult(_0x527127,null))[_0x1b7d('0x2b')](handleError(_0x527127,null));};exports[_0x1b7d('0x39')]=function(_0x4367cf,_0x5fc026){if(_0x4367cf[_0x1b7d('0x31')]['id']){delete _0x4367cf[_0x1b7d('0x31')]['id'];}return db[_0x1b7d('0x15')][_0x1b7d('0x35')]({'where':{'id':_0x4367cf[_0x1b7d('0x2d')]['id']}})[_0x1b7d('0xf')](handleEntityNotFound(_0x5fc026,null))[_0x1b7d('0xf')](function(_0x4e951b){if(_0x4e951b){_0x4367cf['body'][_0x1b7d('0x3a')]=_0x4e951b['id'];_0x4367cf[_0x1b7d('0x31')][_0x1b7d('0x3b')]=integrations[_0x1b7d('0x3c')](_0x4367cf[_0x1b7d('0x31')][_0x1b7d('0x3d')],_0x4367cf['body'][_0x1b7d('0x17')]);_0x4367cf[_0x1b7d('0x31')][_0x1b7d('0x3e')]=integrations[_0x1b7d('0x3f')](_0x4367cf[_0x1b7d('0x31')][_0x1b7d('0x3d')],_0x4367cf[_0x1b7d('0x31')][_0x1b7d('0x17')]);return db[_0x1b7d('0x36')]['create'](_0x4367cf['body'],{'include':[{'model':db[_0x1b7d('0x40')],'as':'Subjects'},{'model':db['Dynamics365Field'],'as':_0x1b7d('0x3e')}]});}return null;})[_0x1b7d('0xf')](respondWithResult(_0x5fc026,null))[_0x1b7d('0x2b')](handleError(_0x5fc026,null));};function sanitizeRemoteUri(_0x54730e){var _0x52be5d=_0x54730e[_0x1b7d('0x41')](-0x1);if(_0x52be5d==='/')return _0x54730e[_0x1b7d('0x42')](0x0,_0x54730e[_0x1b7d('0x43')](_0x52be5d));return _0x54730e;}function getWebApiUrl(_0x1bab70){return util[_0x1b7d('0x44')](_0x1b7d('0x45'),_0x1bab70);}exports[_0x1b7d('0x46')]=function(_0x46e1d0,_0xedcbee){var _0x1355d0=_0x46e1d0[_0x1b7d('0x1b')][_0x1b7d('0x47')];var _0xb9c1fb=_0x1355d0===_0x1b7d('0x48')?_0x1b7d('0x49'):_0x1b7d('0x4a');var _0x2d37b6='';var _0x56f0c2='';var _0x29bbd5='';var _0x18173a='';var _0x206d97='';var _0x328cf3='';var _0x122640='';var _0x5b3352='';var _0x386844=[_0x1b7d('0x4b'),_0x1b7d('0x4c'),'customerid',_0x1b7d('0x4d'),_0x1b7d('0x4e'),_0x1b7d('0x4f'),_0x1b7d('0x50'),_0x1b7d('0x51'),_0x1b7d('0x52'),_0x1b7d('0x53')];var _0x4a0686=['accountidname',_0x1b7d('0x54'),_0x1b7d('0x55'),_0x1b7d('0x56'),'contactidname',_0x1b7d('0x57'),_0x1b7d('0x58'),_0x1b7d('0x59'),_0x1b7d('0x5a'),_0x1b7d('0x5b'),_0x1b7d('0x5c'),'createdbyyominame',_0x1b7d('0x5d'),_0x1b7d('0x5e'),_0x1b7d('0x5f'),_0x1b7d('0x60'),_0x1b7d('0x61'),'customeridyominame',_0x1b7d('0x62'),_0x1b7d('0x63'),'entityimage_timestamp',_0x1b7d('0x64'),_0x1b7d('0x65'),'exchangerate',_0x1b7d('0x66'),_0x1b7d('0x67'),_0x1b7d('0x68'),_0x1b7d('0x69'),'kbarticleidname',_0x1b7d('0x6a'),_0x1b7d('0x6b'),'modifiedbyexternalpartyname',_0x1b7d('0x6c'),_0x1b7d('0x6d'),_0x1b7d('0x6e'),'modifiedon',_0x1b7d('0x6f'),'modifiedonbehalfbyyominame',_0x1b7d('0x70'),_0x1b7d('0x71'),'numberofchildincidents',_0x1b7d('0x72'),_0x1b7d('0x73'),_0x1b7d('0x74'),_0x1b7d('0x75'),'owneridyominame',_0x1b7d('0x76'),'primarycontactidname',_0x1b7d('0x77'),_0x1b7d('0x78'),_0x1b7d('0x79'),_0x1b7d('0x7a'),_0x1b7d('0x7b'),'resolvebykpiidname',_0x1b7d('0x7c'),_0x1b7d('0x7d'),_0x1b7d('0x7e'),'sentimentvalue',_0x1b7d('0x7f'),_0x1b7d('0x80'),_0x1b7d('0x81'),_0x1b7d('0x82'),_0x1b7d('0x83'),_0x1b7d('0x84'),_0x1b7d('0x85'),_0x1b7d('0x86'),_0x1b7d('0x87'),'traversedpath','utcconversiontimezonecode',_0x1b7d('0x88')];var _0x1b197e=_0x386844['concat'](_0x4a0686);return db['Dynamics365Account'][_0x1b7d('0x35')]({'where':{'id':_0x46e1d0[_0x1b7d('0x2d')]['id']},'attributes':['id',_0x1b7d('0x89'),_0x1b7d('0x8a'),_0x1b7d('0x8b'),_0x1b7d('0x8c'),_0x1b7d('0x8d'),_0x1b7d('0x8e'),'modernAuthentication'],'include':[{'model':db[_0x1b7d('0x8f')],'as':_0x1b7d('0x8f'),'attributes':['id',_0x1b7d('0x90'),_0x1b7d('0x91')]}]})[_0x1b7d('0xf')](handleEntityNotFound(_0xedcbee,null))['then'](function(_0x22a0b0){if(_0x22a0b0){if(_0x22a0b0[_0x1b7d('0x92')]){_0x22a0b0['access_token']=_0x22a0b0[_0x1b7d('0x8f')][_0x1b7d('0x90')];_0x5b3352=sanitizeRemoteUri(_0x22a0b0[_0x1b7d('0x8f')]['data7']);_0x122640=getWebApiUrl(_0x5b3352);return _0x22a0b0;}_0x5b3352=sanitizeRemoteUri(_0x22a0b0[_0x1b7d('0x8b')]);_0x122640=getWebApiUrl(_0x5b3352);var _0x4aab26={'method':_0x1b7d('0x93'),'uri':_0x1b7d('0x94')+_0x22a0b0['tenantId']+'/oauth2/token','form':{'client_id':_0x22a0b0[_0x1b7d('0x8d')],'resource':_0x5b3352,'username':_0x22a0b0[_0x1b7d('0x89')],'password':_0x22a0b0[_0x1b7d('0x8a')],'grant_type':_0x1b7d('0x8a'),'client_secret':_0x22a0b0[_0x1b7d('0x8e')]},'json':!![]};return rp(_0x4aab26);}})[_0x1b7d('0xf')](function(_0x36bf4a){_0x328cf3=_0x36bf4a[_0x1b7d('0x95')];var _0x1d1d11={'method':'GET','uri':encodeURI(_0x122640+_0x1b7d('0x96')+_0xb9c1fb+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x328cf3,'If-None-Match':null,'OData-Version':_0x1b7d('0x97')},'json':!![]};return rp(_0x1d1d11);})[_0x1b7d('0xf')](function(_0x3143d4){var _0x189e17=_0x3143d4[_0x1b7d('0x98')][0x0];var _0x7a90f7=_0x189e17[_0x1b7d('0x99')];var _0x49286c={'method':'GET','uri':_0x122640+_0x1b7d('0x9a')+_0x7a90f7+_0x1b7d('0x9b'),'headers':{'Authorization':_0x1b7d('0x9c')+_0x328cf3,'If-None-Match':null,'OData-Version':_0x1b7d('0x97')},'json':!![]};return rp(_0x49286c);})[_0x1b7d('0xf')](function(_0x22b807){_0x2d37b6=_0x22b807;_0x56f0c2=_0x2d37b6['Attributes'];_0x56f0c2=_[_0x1b7d('0x9d')](_0x56f0c2,function(_0xefa3fd){return!_0x1b197e[_0x1b7d('0x9e')](_0xefa3fd[_0x1b7d('0x9f')]);});var _0x330f36=[];var _0x32b91e=[];_0x56f0c2[_0x1b7d('0xa0')](function(_0x31632c){if(_0x31632c['@odata.type']){var _0x4f058a=_0x31632c[_0x1b7d('0xa1')][_0x1b7d('0x42')](_0x31632c[_0x1b7d('0xa1')]['lastIndexOf']('.')+0x1);if(_0x4f058a===_0x1b7d('0xa2')){_0x330f36[_0x1b7d('0xa3')](getSelectList(_0x122640,_0x1355d0,_0x32b91e,_0x2d37b6[_0x1b7d('0x99')],_0x31632c[_0x1b7d('0x99')],_0x328cf3));}}});return Promise[_0x1b7d('0xa4')](_0x330f36);})['then'](function(_0x34326d){_0x29bbd5=_0x34326d[0x0];var _0x4c6f22=[];var _0xe4d3e2=[];_0x56f0c2['forEach'](function(_0x49817f){if(!_[_0x1b7d('0xa5')](_0x49817f['@odata.type'])){var _0x2fb07a=_0x49817f['@odata.type'][_0x1b7d('0x42')](_0x49817f[_0x1b7d('0xa1')][_0x1b7d('0x43')]('.')+0x1);if(_0x2fb07a==='BooleanAttributeMetadata'){_0x4c6f22[_0x1b7d('0xa3')](getBooleanList(_0x122640,_0x1355d0,_0xe4d3e2,_0x2d37b6[_0x1b7d('0x99')],_0x49817f['MetadataId'],_0x328cf3));}}});return Promise['all'](_0x4c6f22);})[_0x1b7d('0xf')](function(_0x16bb02){_0x18173a=_0x16bb02[0x0];var _0x3e34fe=[];var _0x361681=[];_0x56f0c2[_0x1b7d('0xa0')](function(_0x29311e){if(_0x29311e[_0x1b7d('0xa1')]){var _0x46dc7c=_0x29311e['@odata.type'][_0x1b7d('0x42')](_0x29311e[_0x1b7d('0xa1')][_0x1b7d('0x43')]('.')+0x1);if(_0x46dc7c==='StringAttributeMetadata'||_0x46dc7c==='DoubleAttributeMetadata'||_0x46dc7c===_0x1b7d('0xa6')||_0x46dc7c===_0x1b7d('0xa7')||_0x46dc7c===_0x1b7d('0xa8')||_0x46dc7c===_0x1b7d('0xa9')||_0x46dc7c==='StatusAttributeMetadata'||_0x46dc7c===_0x1b7d('0xaa')||_0x46dc7c===_0x1b7d('0xab')||_0x46dc7c==='DecimalAttributeMetadata'){_0x3e34fe[_0x1b7d('0xa3')](getInputList(_0x122640,_0x1355d0,_0x46dc7c,_0x361681,_0x2d37b6[_0x1b7d('0x99')],_0x29311e[_0x1b7d('0x99')],_0x328cf3));}}});return Promise[_0x1b7d('0xa4')](_0x3e34fe);})[_0x1b7d('0xf')](function(_0x4ce2bd){_0x206d97=_0x4ce2bd[0x0];var _0x5d4e38=_0x29bbd5[_0x1b7d('0xac')](_0x18173a)[_0x1b7d('0xac')](_0x206d97);var _0x103505={'count':_0x5d4e38[_0x1b7d('0x20')],'rows':_0x5d4e38};return _0x103505;})[_0x1b7d('0xf')](respondWithResult(_0xedcbee,null))[_0x1b7d('0x2b')](function(_0xdbc1b6){var _0x4919ff=_0x46e1d0[_0x1b7d('0x1b')]['test']?0x1f4:_0xdbc1b6['statusCode']||0x1f4;logger[_0x1b7d('0xad')](_0xdbc1b6[_0x1b7d('0x11')]);delete _0xdbc1b6[_0x1b7d('0x12')];if(_0x4919ff===0x191){_0x4919ff=0x190;}_0xedcbee[_0x1b7d('0xc')](_0x4919ff)['send'](_0x46e1d0[_0x1b7d('0x1b')][_0x1b7d('0xae')]?{'message':'Wrong\x20credentials','statusCode':_0xdbc1b6['statusCode']}:_0xdbc1b6);});};function getSelectList(_0x1601c9,_0x509a5a,_0x1a7910,_0x2e19f7,_0x2d0249,_0x1a03f8){var _0xa3ebce={'method':_0x1b7d('0xaf'),'uri':_0x1601c9+_0x1b7d('0x9a')+_0x2e19f7+_0x1b7d('0xb0')+_0x2d0249+_0x1b7d('0xb1')+_0x1b7d('0xb2'),'headers':{'Authorization':_0x1b7d('0x9c')+_0x1a03f8,'If-None-Match':null,'OData-Version':_0x1b7d('0x97')},'json':!![]};return rp(_0xa3ebce)[_0x1b7d('0xf')](function(_0x363dde){var _0x15c799=[];var _0x48f55e=_0x363dde[_0x1b7d('0xb3')][_0x1b7d('0xb4')];_0x48f55e[_0x1b7d('0xa0')](function(_0x1acaf0){_0x15c799[_0x1b7d('0xa3')]({'name':_0x1acaf0[_0x1b7d('0xb5')][_0x1b7d('0xb6')][_0x1b7d('0xb5')],'value':String(_0x1acaf0[_0x1b7d('0xb7')])});});var _0x31aa6f={'id':_0x509a5a+'_'+_0x363dde[_0x1b7d('0x9f')],'name':_0x363dde[_0x1b7d('0xb8')][_0x1b7d('0xb6')][_0x1b7d('0xb5')],'custom':![],'options':_0x15c799};_0x1a7910[_0x1b7d('0xa3')](_0x31aa6f);return _0x1a7910;});}function getBooleanList(_0x4d44a2,_0x58ed99,_0x31bf37,_0x44254c,_0x296843,_0x155052){var _0x1b506a={'method':'GET','uri':_0x4d44a2+_0x1b7d('0x9a')+_0x44254c+_0x1b7d('0xb0')+_0x296843+_0x1b7d('0xb9'),'headers':{'Authorization':_0x1b7d('0x9c')+_0x155052,'If-None-Match':null,'OData-Version':_0x1b7d('0x97')},'json':!![]};return rp(_0x1b506a)[_0x1b7d('0xf')](function(_0x52c3b2){var _0x467e6=[];_0x467e6[_0x1b7d('0xa3')]({'name':_0x52c3b2[_0x1b7d('0xb3')][_0x1b7d('0xba')]['Label']['UserLocalizedLabel'][_0x1b7d('0xb5')],'value':_0x1b7d('0xbb')},{'name':_0x52c3b2[_0x1b7d('0xb3')][_0x1b7d('0xbc')]['Label'][_0x1b7d('0xb6')][_0x1b7d('0xb5')],'value':_0x1b7d('0xbd')});var _0x532da2={'id':_0x58ed99+'_'+_0x52c3b2[_0x1b7d('0x9f')],'name':_0x52c3b2[_0x1b7d('0xb8')][_0x1b7d('0xb6')]['Label'],'custom':![],'options':_0x467e6};_0x31bf37[_0x1b7d('0xa3')](_0x532da2);return _0x31bf37;});}function getInputList(_0xb7fa6a,_0x2c1d6b,_0x3adcab,_0x6914bc,_0x2525cc,_0x6555ba,_0x2315e8){var _0x123578={'method':_0x1b7d('0xaf'),'uri':_0xb7fa6a+_0x1b7d('0x9a')+_0x2525cc+_0x1b7d('0xb0')+_0x6555ba+_0x1b7d('0xbe')+_0x3adcab+_0x1b7d('0xbf'),'headers':{'Authorization':_0x1b7d('0x9c')+_0x2315e8,'If-None-Match':null,'OData-Version':_0x1b7d('0x97')},'json':!![]};return rp(_0x123578)['then'](function(_0xdde5b){var _0x1024fe={'id':_0x2c1d6b+'_'+_0xdde5b[_0x1b7d('0x9f')],'name':_0xdde5b[_0x1b7d('0xb8')][_0x1b7d('0xb6')]?_0xdde5b[_0x1b7d('0xb8')][_0x1b7d('0xb6')]['Label']:_0xdde5b[_0x1b7d('0x9f')],'custom':![],'options':[]};_0x6914bc[_0x1b7d('0xa3')](_0x1024fe);return _0x6914bc;});} \ No newline at end of file +var _0x78a8=[')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','LogicalName','forEach','@odata.type','substring','PicklistAttributeMetadata','push','all','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','statusCode','stack',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','true','false','?$select=DisplayName,LogicalName','request-promise','util','lodash','api','../../mysqldb','../../components/integrations/configuration','status','json','offset','limit','undefined','count','set','Content-Range','update','destroy','then','end','sendStatus','name','send','index','map','Dynamics365Account','rawAttributes','type','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','intersection','find','create','body','getConfigurations','findOne','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Configuration','Dynamics365Field','slice','lastIndexOf','format','%s/api/data/v9.0/','incident','Incident','PhoneCall','description','customerid','caseorigincode','subject','phonenumber','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyyominame','createdbyname','createdonbehalfbyyominame','customeridtype','emailaddress','entitlementidname','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyyominame','modifiedonbehalfbyname','msdyn_iotalertname','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productserialnumber','resolveby','responseby','responsiblecontactidname','slainvokedidname','slaname','socialprofileidname','statecode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','concat','username','password','tenantId','clientId','clientSecret','modernAuthentication','CloudProvider','data5','data7','access_token','remoteUri','POST','https://login.microsoftonline.com/','/oauth2/token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','MetadataId','EntityDefinitions('];(function(_0x32a2cf,_0x20b153){var _0x250e9d=function(_0x506bf2){while(--_0x506bf2){_0x32a2cf['push'](_0x32a2cf['shift']());}};_0x250e9d(++_0x20b153);}(_0x78a8,0xda));var _0x878a=function(_0x5bf895,_0x326027){_0x5bf895=_0x5bf895-0x0;var _0x142e6a=_0x78a8[_0x5bf895];return _0x142e6a;};'use strict';var rp=require(_0x878a('0x0'));var util=require(_0x878a('0x1'));var _=require(_0x878a('0x2'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x878a('0x3'));var db=require(_0x878a('0x4'))['db'];var integrations=require(_0x878a('0x5'));function respondWithResult(_0x108efd,_0x26471b){_0x26471b=_0x26471b||0xc8;return function(_0x37afa1){if(_0x37afa1){return _0x108efd[_0x878a('0x6')](_0x26471b)[_0x878a('0x7')](_0x37afa1);}};}function respondWithFilteredResult(_0x1f6a01,_0x40bd85){return function(_0x42ebf5){if(_0x42ebf5){var _0x4ddccf=typeof _0x40bd85[_0x878a('0x8')]==='undefined'&&typeof _0x40bd85[_0x878a('0x9')]===_0x878a('0xa');var _0x3a7b9c=_0x42ebf5[_0x878a('0xb')];var _0x5328d5=_0x4ddccf?0x0:_0x40bd85[_0x878a('0x8')];var _0x1a6acf=_0x4ddccf?_0x42ebf5['count']:_0x40bd85[_0x878a('0x8')]+_0x40bd85['limit'];var _0x52e250;if(_0x1a6acf>=_0x3a7b9c){_0x1a6acf=_0x3a7b9c;_0x52e250=0xc8;}else{_0x52e250=0xce;}_0x1f6a01[_0x878a('0x6')](_0x52e250);return _0x1f6a01[_0x878a('0xc')](_0x878a('0xd'),_0x5328d5+'-'+_0x1a6acf+'/'+_0x3a7b9c)['json'](_0x42ebf5);}return null;};}function saveUpdates(_0x3e3ce5){return function(_0x3938f9){if(_0x3938f9){return _0x3938f9[_0x878a('0xe')](_0x3e3ce5)['then'](function(_0x32e263){return _0x32e263;});}return null;};}function removeEntity(_0x53bb33){return function(_0x5d9650){if(_0x5d9650){return _0x5d9650[_0x878a('0xf')]()[_0x878a('0x10')](function(){_0x53bb33[_0x878a('0x6')](0xcc)[_0x878a('0x11')]();});}};}function handleEntityNotFound(_0x56f5e5){return function(_0x182fc5){if(!_0x182fc5){_0x56f5e5[_0x878a('0x12')](0x194);}return _0x182fc5;};}function handleError(_0x23639d,_0x4124a1){_0x4124a1=_0x4124a1||0x1f4;return function(_0x35241e){logger['error'](_0x35241e['stack']);if(_0x35241e[_0x878a('0x13')]){delete _0x35241e[_0x878a('0x13')];}_0x23639d['status'](_0x4124a1)[_0x878a('0x14')](_0x35241e);};}exports[_0x878a('0x15')]=function(_0x1334c2,_0x3ff944){var _0x1dfd03={},_0x31c83d={},_0x4fe335={'count':0x0,'rows':[]};var _0x424333=_[_0x878a('0x16')](db[_0x878a('0x17')][_0x878a('0x18')],function(_0x29269a){return{'name':_0x29269a['fieldName'],'type':_0x29269a[_0x878a('0x19')]['key']};});_0x31c83d[_0x878a('0x1a')]=_[_0x878a('0x16')](_0x424333,'name');_0x31c83d[_0x878a('0x1b')]=_[_0x878a('0x1c')](_0x1334c2[_0x878a('0x1b')]);_0x31c83d[_0x878a('0x1d')]=_['intersection'](_0x31c83d[_0x878a('0x1a')],_0x31c83d[_0x878a('0x1b')]);_0x1dfd03[_0x878a('0x1e')]=_['intersection'](_0x31c83d[_0x878a('0x1a')],qs[_0x878a('0x1f')](_0x1334c2[_0x878a('0x1b')][_0x878a('0x1f')]));_0x1dfd03[_0x878a('0x1e')]=_0x1dfd03[_0x878a('0x1e')][_0x878a('0x20')]?_0x1dfd03[_0x878a('0x1e')]:_0x31c83d['model'];if(!_0x1334c2['query'][_0x878a('0x21')](_0x878a('0x22'))){_0x1dfd03[_0x878a('0x9')]=qs[_0x878a('0x9')](_0x1334c2[_0x878a('0x1b')][_0x878a('0x9')]);_0x1dfd03[_0x878a('0x8')]=qs['offset'](_0x1334c2[_0x878a('0x1b')][_0x878a('0x8')]);}_0x1dfd03[_0x878a('0x23')]=qs[_0x878a('0x24')](_0x1334c2[_0x878a('0x1b')][_0x878a('0x24')]);_0x1dfd03[_0x878a('0x25')]=qs[_0x878a('0x1d')](_[_0x878a('0x26')](_0x1334c2['query'],_0x31c83d[_0x878a('0x1d')]),_0x424333);if(_0x1334c2[_0x878a('0x1b')][_0x878a('0x27')]){_0x1dfd03[_0x878a('0x25')]=_[_0x878a('0x28')](_0x1dfd03['where'],{'$or':_[_0x878a('0x16')](_0x424333,function(_0x1b5fed){if(_0x1b5fed[_0x878a('0x19')]!==_0x878a('0x29')){var _0x2044e3={};_0x2044e3[_0x1b5fed[_0x878a('0x13')]]={'$like':'%'+_0x1334c2[_0x878a('0x1b')][_0x878a('0x27')]+'%'};return _0x2044e3;}})});}_0x1dfd03=_[_0x878a('0x28')]({},_0x1dfd03,_0x1334c2[_0x878a('0x2a')]);var _0x362778={'where':_0x1dfd03[_0x878a('0x25')]};return db['Dynamics365Account'][_0x878a('0xb')](_0x362778)[_0x878a('0x10')](function(_0x48c2eb){_0x4fe335['count']=_0x48c2eb;if(_0x1334c2[_0x878a('0x1b')][_0x878a('0x2b')]){_0x1dfd03[_0x878a('0x2c')]=[{'all':!![]}];}return db[_0x878a('0x17')]['findAll'](_0x1dfd03);})['then'](function(_0x53ecc9){_0x4fe335[_0x878a('0x2d')]=_0x53ecc9;return _0x4fe335;})[_0x878a('0x10')](respondWithFilteredResult(_0x3ff944,_0x1dfd03))[_0x878a('0x2e')](handleError(_0x3ff944,null));};exports[_0x878a('0x2f')]=function(_0x428e0a,_0x230713){var _0x23aa62={'raw':![],'where':{'id':_0x428e0a[_0x878a('0x30')]['id']}},_0x488508={};_0x488508[_0x878a('0x1a')]=_[_0x878a('0x1c')](db[_0x878a('0x17')][_0x878a('0x18')]);_0x488508[_0x878a('0x1b')]=_[_0x878a('0x1c')](_0x428e0a[_0x878a('0x1b')]);_0x488508[_0x878a('0x1d')]=_['intersection'](_0x488508[_0x878a('0x1a')],_0x488508['query']);_0x23aa62[_0x878a('0x1e')]=_[_0x878a('0x31')](_0x488508[_0x878a('0x1a')],qs['fields'](_0x428e0a[_0x878a('0x1b')][_0x878a('0x1f')]));_0x23aa62[_0x878a('0x1e')]=_0x23aa62[_0x878a('0x1e')][_0x878a('0x20')]?_0x23aa62[_0x878a('0x1e')]:_0x488508[_0x878a('0x1a')];if(_0x428e0a[_0x878a('0x1b')]['includeAll']){_0x23aa62['include']=[{'all':!![]}];}_0x23aa62=_[_0x878a('0x28')]({},_0x23aa62,_0x428e0a[_0x878a('0x2a')]);return db[_0x878a('0x17')][_0x878a('0x32')](_0x23aa62)['then'](handleEntityNotFound(_0x230713,null))[_0x878a('0x10')](respondWithResult(_0x230713,null))['catch'](handleError(_0x230713,null));};exports['create']=function(_0x2e34a8,_0x1bb8b1){return db[_0x878a('0x17')][_0x878a('0x33')](_0x2e34a8['body'],{})[_0x878a('0x10')](respondWithResult(_0x1bb8b1,0xc9))['catch'](handleError(_0x1bb8b1,null));};exports[_0x878a('0xe')]=function(_0x660408,_0x405fd6){if(_0x660408[_0x878a('0x34')]['id']){delete _0x660408[_0x878a('0x34')]['id'];}return db[_0x878a('0x17')][_0x878a('0x32')]({'where':{'id':_0x660408[_0x878a('0x30')]['id']}})[_0x878a('0x10')](handleEntityNotFound(_0x405fd6,null))[_0x878a('0x10')](saveUpdates(_0x660408['body'],null))[_0x878a('0x10')](respondWithResult(_0x405fd6,null))[_0x878a('0x2e')](handleError(_0x405fd6,null));};exports[_0x878a('0xf')]=function(_0x30c24b,_0x4320f9){return db[_0x878a('0x17')]['find']({'where':{'id':_0x30c24b[_0x878a('0x30')]['id']}})[_0x878a('0x10')](handleEntityNotFound(_0x4320f9,null))[_0x878a('0x10')](removeEntity(_0x4320f9,null))[_0x878a('0x2e')](handleError(_0x4320f9,null));};exports[_0x878a('0x35')]=function(_0x3a1b82,_0x15bd6b){var _0xea4621={};var _0x32add2={};var _0x309f7f;var _0x2b16dc;return db[_0x878a('0x17')][_0x878a('0x36')]({'where':{'id':_0x3a1b82[_0x878a('0x30')]['id']}})[_0x878a('0x10')](handleEntityNotFound(_0x15bd6b,null))[_0x878a('0x10')](function(_0x2c5e91){if(_0x2c5e91){_0x309f7f=_0x2c5e91;_0x32add2[_0x878a('0x1a')]=_['keys'](db['Dynamics365Configuration']['rawAttributes']);_0x32add2['query']=_['keys'](_0x3a1b82[_0x878a('0x1b')]);_0x32add2['filters']=_['intersection'](_0x32add2[_0x878a('0x1a')],_0x32add2[_0x878a('0x1b')]);_0xea4621[_0x878a('0x1e')]=_[_0x878a('0x31')](_0x32add2['model'],qs[_0x878a('0x1f')](_0x3a1b82[_0x878a('0x1b')]['fields']));_0xea4621[_0x878a('0x1e')]=_0xea4621[_0x878a('0x1e')][_0x878a('0x20')]?_0xea4621[_0x878a('0x1e')]:_0x32add2[_0x878a('0x1a')];_0xea4621[_0x878a('0x23')]=qs[_0x878a('0x24')](_0x3a1b82[_0x878a('0x1b')][_0x878a('0x24')]);_0xea4621[_0x878a('0x25')]=qs[_0x878a('0x1d')](_[_0x878a('0x26')](_0x3a1b82[_0x878a('0x1b')],_0x32add2[_0x878a('0x1d')]));if(_0x3a1b82['query'][_0x878a('0x27')]){_0xea4621[_0x878a('0x25')]=_[_0x878a('0x28')](_0xea4621[_0x878a('0x25')],{'$or':_[_0x878a('0x16')](_0xea4621['attributes'],function(_0x5e4c82){var _0xe093d1={};_0xe093d1[_0x5e4c82]={'$like':'%'+_0x3a1b82[_0x878a('0x1b')][_0x878a('0x27')]+'%'};return _0xe093d1;})});}_0xea4621=_['merge']({},_0xea4621,_0x3a1b82['options']);return _0x309f7f['getConfigurations'](_0xea4621);}})['then'](function(_0x180efb){if(_0x180efb){_0x2b16dc=_0x180efb[_0x878a('0x20')];if(!_0x3a1b82['query'][_0x878a('0x21')](_0x878a('0x22'))){_0xea4621['limit']=qs['limit'](_0x3a1b82['query'][_0x878a('0x9')]);_0xea4621[_0x878a('0x8')]=qs[_0x878a('0x8')](_0x3a1b82[_0x878a('0x1b')][_0x878a('0x8')]);}return _0x309f7f['getConfigurations'](_0xea4621);}})[_0x878a('0x10')](function(_0x327a9c){if(_0x327a9c){return _0x327a9c?{'count':_0x2b16dc,'rows':_0x327a9c}:null;}})[_0x878a('0x10')](respondWithResult(_0x15bd6b,null))['catch'](handleError(_0x15bd6b,null));};exports[_0x878a('0x37')]=function(_0x245f24,_0xb59587){if(_0x245f24[_0x878a('0x34')]['id']){delete _0x245f24['body']['id'];}return db['Dynamics365Account'][_0x878a('0x36')]({'where':{'id':_0x245f24[_0x878a('0x30')]['id']}})[_0x878a('0x10')](handleEntityNotFound(_0xb59587,null))['then'](function(_0x30a903){if(_0x30a903){_0x245f24[_0x878a('0x34')][_0x878a('0x38')]=_0x30a903['id'];_0x245f24['body'][_0x878a('0x39')]=integrations[_0x878a('0x3a')](_0x245f24[_0x878a('0x34')][_0x878a('0x3b')],_0x245f24[_0x878a('0x34')][_0x878a('0x19')]);_0x245f24[_0x878a('0x34')][_0x878a('0x3c')]=integrations[_0x878a('0x3d')](_0x245f24[_0x878a('0x34')][_0x878a('0x3b')],_0x245f24[_0x878a('0x34')][_0x878a('0x19')]);return db[_0x878a('0x3e')]['create'](_0x245f24[_0x878a('0x34')],{'include':[{'model':db[_0x878a('0x3f')],'as':'Subjects'},{'model':db[_0x878a('0x3f')],'as':_0x878a('0x3c')}]});}return null;})[_0x878a('0x10')](respondWithResult(_0xb59587,null))[_0x878a('0x2e')](handleError(_0xb59587,null));};function sanitizeRemoteUri(_0x5bdebb){var _0x608590=_0x5bdebb[_0x878a('0x40')](-0x1);if(_0x608590==='/')return _0x5bdebb['substring'](0x0,_0x5bdebb[_0x878a('0x41')](_0x608590));return _0x5bdebb;}function getWebApiUrl(_0x4f4c52){return util[_0x878a('0x42')](_0x878a('0x43'),_0x4f4c52);}exports['getFields']=function(_0x44ad78,_0xbd3b47){var _0x185579=_0x44ad78[_0x878a('0x1b')]['ticketType'];var _0x48ddf1=_0x185579===_0x878a('0x44')?_0x878a('0x45'):_0x878a('0x46');var _0x18e50e='';var _0x4b91c8='';var _0x220fd2='';var _0x21581f='';var _0x44afb3='';var _0x59d8b4='';var _0x12c3ec='';var _0x4e8db9='';var _0x32b52f=['title',_0x878a('0x47'),_0x878a('0x48'),'ownerid',_0x878a('0x49'),_0x878a('0x4a'),_0x878a('0x4b'),'regardingobjectid',_0x878a('0x4c'),_0x878a('0x4d')];var _0x28577a=[_0x878a('0x4e'),_0x878a('0x4f'),_0x878a('0x50'),'billedserviceunits','contactidname',_0x878a('0x51'),_0x878a('0x52'),_0x878a('0x53'),'createdbyexternalpartyname',_0x878a('0x54'),_0x878a('0x55'),'createdbyyominame','createdon','createdonbehalfbyname',_0x878a('0x56'),'customeridname',_0x878a('0x57'),'customeridyominame',_0x878a('0x58'),_0x878a('0x59'),'entityimage_timestamp','entityimage_url',_0x878a('0x5a'),_0x878a('0x5b'),_0x878a('0x5c'),_0x878a('0x5d'),_0x878a('0x5e'),'influencescore',_0x878a('0x5f'),_0x878a('0x60'),_0x878a('0x61'),_0x878a('0x62'),'modifiedbyexternalpartyyominame','modifiedbyname',_0x878a('0x63'),'modifiedon',_0x878a('0x64'),'modifiedonbehalfbyyominame','msdyn_incidenttypename',_0x878a('0x65'),'numberofchildincidents','onholdtime','overriddencreatedon',_0x878a('0x66'),_0x878a('0x67'),_0x878a('0x68'),_0x878a('0x69'),_0x878a('0x6a'),_0x878a('0x6b'),_0x878a('0x6c'),'productidname',_0x878a('0x6d'),_0x878a('0x6e'),'resolvebykpiidname',_0x878a('0x6f'),_0x878a('0x70'),'responsiblecontactidyominame','sentimentvalue',_0x878a('0x71'),_0x878a('0x72'),_0x878a('0x73'),_0x878a('0x74'),'statuscode',_0x878a('0x75'),_0x878a('0x76'),_0x878a('0x77'),_0x878a('0x78'),_0x878a('0x79'),_0x878a('0x7a'),'versionnumber'];var _0x8e8e39=_0x32b52f[_0x878a('0x7b')](_0x28577a);return db[_0x878a('0x17')][_0x878a('0x36')]({'where':{'id':_0x44ad78[_0x878a('0x30')]['id']},'attributes':['id',_0x878a('0x7c'),_0x878a('0x7d'),'remoteUri',_0x878a('0x7e'),_0x878a('0x7f'),_0x878a('0x80'),_0x878a('0x81')],'include':[{'model':db[_0x878a('0x82')],'as':_0x878a('0x82'),'attributes':['id',_0x878a('0x83'),_0x878a('0x84')]}]})[_0x878a('0x10')](handleEntityNotFound(_0xbd3b47,null))['then'](function(_0x40755f){if(_0x40755f){if(_0x40755f[_0x878a('0x81')]){_0x40755f[_0x878a('0x85')]=_0x40755f[_0x878a('0x82')][_0x878a('0x83')];_0x4e8db9=sanitizeRemoteUri(_0x40755f[_0x878a('0x82')][_0x878a('0x84')]);_0x12c3ec=getWebApiUrl(_0x4e8db9);return _0x40755f;}_0x4e8db9=sanitizeRemoteUri(_0x40755f[_0x878a('0x86')]);_0x12c3ec=getWebApiUrl(_0x4e8db9);var _0x407691={'method':_0x878a('0x87'),'uri':_0x878a('0x88')+_0x40755f[_0x878a('0x7e')]+_0x878a('0x89'),'form':{'client_id':_0x40755f[_0x878a('0x7f')],'resource':_0x4e8db9,'username':_0x40755f['username'],'password':_0x40755f['password'],'grant_type':_0x878a('0x7d'),'client_secret':_0x40755f['clientSecret']},'json':!![]};return rp(_0x407691);}})[_0x878a('0x10')](function(_0x46cb90){_0x59d8b4=_0x46cb90[_0x878a('0x85')];var _0xc6305f={'method':_0x878a('0x8a'),'uri':encodeURI(_0x12c3ec+_0x878a('0x8b')+_0x48ddf1+'\x27'),'headers':{'Authorization':_0x878a('0x8c')+_0x59d8b4,'If-None-Match':null,'OData-Version':_0x878a('0x8d')},'json':!![]};return rp(_0xc6305f);})[_0x878a('0x10')](function(_0x2682d7){var _0x4b8232=_0x2682d7['value'][0x0];var _0x4f3f58=_0x4b8232[_0x878a('0x8e')];var _0x1413d7={'method':_0x878a('0x8a'),'uri':_0x12c3ec+_0x878a('0x8f')+_0x4f3f58+_0x878a('0x90'),'headers':{'Authorization':_0x878a('0x8c')+_0x59d8b4,'If-None-Match':null,'OData-Version':_0x878a('0x8d')},'json':!![]};return rp(_0x1413d7);})[_0x878a('0x10')](function(_0x138a78){_0x18e50e=_0x138a78;_0x4b91c8=_0x18e50e[_0x878a('0x91')];_0x4b91c8=_[_0x878a('0x92')](_0x4b91c8,function(_0x2f165e){return!_0x8e8e39[_0x878a('0x93')](_0x2f165e[_0x878a('0x94')]);});var _0x5bb5a3=[];var _0x2eec83=[];_0x4b91c8[_0x878a('0x95')](function(_0x1544ae){if(_0x1544ae[_0x878a('0x96')]){var _0x3e9e76=_0x1544ae[_0x878a('0x96')][_0x878a('0x97')](_0x1544ae[_0x878a('0x96')][_0x878a('0x41')]('.')+0x1);if(_0x3e9e76===_0x878a('0x98')){_0x5bb5a3[_0x878a('0x99')](getSelectList(_0x12c3ec,_0x185579,_0x2eec83,_0x18e50e[_0x878a('0x8e')],_0x1544ae[_0x878a('0x8e')],_0x59d8b4));}}});return Promise[_0x878a('0x9a')](_0x5bb5a3);})[_0x878a('0x10')](function(_0x26e685){_0x220fd2=_0x26e685[0x0];var _0x83c0d5=[];var _0x3c7c8c=[];_0x4b91c8['forEach'](function(_0x43c3d8){if(!_['isNil'](_0x43c3d8[_0x878a('0x96')])){var _0x579374=_0x43c3d8['@odata.type'][_0x878a('0x97')](_0x43c3d8['@odata.type'][_0x878a('0x41')]('.')+0x1);if(_0x579374===_0x878a('0x9b')){_0x83c0d5[_0x878a('0x99')](getBooleanList(_0x12c3ec,_0x185579,_0x3c7c8c,_0x18e50e['MetadataId'],_0x43c3d8[_0x878a('0x8e')],_0x59d8b4));}}});return Promise[_0x878a('0x9a')](_0x83c0d5);})[_0x878a('0x10')](function(_0x4685ad){_0x21581f=_0x4685ad[0x0];var _0x3ec81e=[];var _0x28a913=[];_0x4b91c8['forEach'](function(_0x5db453){if(_0x5db453[_0x878a('0x96')]){var _0x36966a=_0x5db453['@odata.type'][_0x878a('0x97')](_0x5db453[_0x878a('0x96')][_0x878a('0x41')]('.')+0x1);if(_0x36966a===_0x878a('0x9c')||_0x36966a===_0x878a('0x9d')||_0x36966a===_0x878a('0x9e')||_0x36966a===_0x878a('0x9f')||_0x36966a===_0x878a('0xa0')||_0x36966a===_0x878a('0xa1')||_0x36966a===_0x878a('0xa2')||_0x36966a==='EntityNameAttributeMetadata'||_0x36966a===_0x878a('0xa3')||_0x36966a===_0x878a('0xa4')){_0x3ec81e['push'](getInputList(_0x12c3ec,_0x185579,_0x36966a,_0x28a913,_0x18e50e[_0x878a('0x8e')],_0x5db453['MetadataId'],_0x59d8b4));}}});return Promise['all'](_0x3ec81e);})['then'](function(_0x181e9d){_0x44afb3=_0x181e9d[0x0];var _0x40052c=_0x220fd2[_0x878a('0x7b')](_0x21581f)['concat'](_0x44afb3);var _0x1b634c={'count':_0x40052c[_0x878a('0x20')],'rows':_0x40052c};return _0x1b634c;})[_0x878a('0x10')](respondWithResult(_0xbd3b47,null))[_0x878a('0x2e')](function(_0x45adf1){var _0x1c84e0=_0x44ad78[_0x878a('0x1b')][_0x878a('0xa5')]?0x1f4:_0x45adf1[_0x878a('0xa6')]||0x1f4;logger['error'](_0x45adf1[_0x878a('0xa7')]);delete _0x45adf1[_0x878a('0x13')];if(_0x1c84e0===0x191){_0x1c84e0=0x190;}_0xbd3b47[_0x878a('0x6')](_0x1c84e0)[_0x878a('0x14')](_0x44ad78[_0x878a('0x1b')][_0x878a('0xa5')]?{'message':'Wrong\x20credentials','statusCode':_0x45adf1[_0x878a('0xa6')]}:_0x45adf1);});};function getSelectList(_0x333106,_0x2091dd,_0x40dd5a,_0x2a6e61,_0x5bec69,_0x1bea3b){var _0x2d6c25={'method':_0x878a('0x8a'),'uri':_0x333106+_0x878a('0x8f')+_0x2a6e61+_0x878a('0xa8')+_0x5bec69+_0x878a('0xa9')+_0x878a('0xaa'),'headers':{'Authorization':'Bearer\x20'+_0x1bea3b,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x2d6c25)[_0x878a('0x10')](function(_0x3bbaa1){var _0x92d3fb=[];var _0x450e20=_0x3bbaa1[_0x878a('0xab')][_0x878a('0xac')];_0x450e20[_0x878a('0x95')](function(_0x2750ca){_0x92d3fb[_0x878a('0x99')]({'name':_0x2750ca[_0x878a('0xad')][_0x878a('0xae')][_0x878a('0xad')],'value':String(_0x2750ca[_0x878a('0xaf')])});});var _0x2dfece={'id':_0x2091dd+'_'+_0x3bbaa1[_0x878a('0x94')],'name':_0x3bbaa1[_0x878a('0xb0')][_0x878a('0xae')]['Label'],'custom':![],'options':_0x92d3fb};_0x40dd5a[_0x878a('0x99')](_0x2dfece);return _0x40dd5a;});}function getBooleanList(_0x5aa309,_0x3d9ed8,_0x527b50,_0x5255a8,_0x58f62d,_0x2e8f19){var _0x138ba6={'method':_0x878a('0x8a'),'uri':_0x5aa309+'EntityDefinitions('+_0x5255a8+')/Attributes('+_0x58f62d+_0x878a('0xb1'),'headers':{'Authorization':_0x878a('0x8c')+_0x2e8f19,'If-None-Match':null,'OData-Version':_0x878a('0x8d')},'json':!![]};return rp(_0x138ba6)[_0x878a('0x10')](function(_0x376bcb){var _0x58884f=[];_0x58884f[_0x878a('0x99')]({'name':_0x376bcb[_0x878a('0xab')]['TrueOption'][_0x878a('0xad')][_0x878a('0xae')]['Label'],'value':_0x878a('0xb2')},{'name':_0x376bcb['OptionSet']['FalseOption']['Label']['UserLocalizedLabel'][_0x878a('0xad')],'value':_0x878a('0xb3')});var _0x6fffe8={'id':_0x3d9ed8+'_'+_0x376bcb[_0x878a('0x94')],'name':_0x376bcb['DisplayName'][_0x878a('0xae')]['Label'],'custom':![],'options':_0x58884f};_0x527b50['push'](_0x6fffe8);return _0x527b50;});}function getInputList(_0x58814c,_0x806fd0,_0x500a32,_0x40dd9a,_0x5224a9,_0x15c9c1,_0xc36ff2){var _0x360a33={'method':_0x878a('0x8a'),'uri':_0x58814c+_0x878a('0x8f')+_0x5224a9+')/Attributes('+_0x15c9c1+')/Microsoft.Dynamics.CRM.'+_0x500a32+_0x878a('0xb4'),'headers':{'Authorization':_0x878a('0x8c')+_0xc36ff2,'If-None-Match':null,'OData-Version':_0x878a('0x8d')},'json':!![]};return rp(_0x360a33)[_0x878a('0x10')](function(_0x2dcd50){var _0x2ef981={'id':_0x806fd0+'_'+_0x2dcd50[_0x878a('0x94')],'name':_0x2dcd50['DisplayName']['UserLocalizedLabel']?_0x2dcd50[_0x878a('0xb0')][_0x878a('0xae')]['Label']:_0x2dcd50[_0x878a('0x94')],'custom':![],'options':[]};_0x40dd9a[_0x878a('0x99')](_0x2ef981);return _0x40dd9a;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 1962825..49b9455 100644 --- a/server/api/intDynamics365Account/intDynamics365Account.model.js +++ b/server/api/intDynamics365Account/intDynamics365Account.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb7e7=['int_dynamics365_accounts','lodash','../../config/logger','moment','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','define'];(function(_0x179550,_0x21738c){var _0x227d66=function(_0x1c6c4a){while(--_0x1c6c4a){_0x179550['push'](_0x179550['shift']());}};_0x227d66(++_0x21738c);}(_0xb7e7,0x121));var _0x7b7e=function(_0x710815,_0x520da8){_0x710815=_0x710815-0x0;var _0x5b3b89=_0xb7e7[_0x710815];return _0x5b3b89;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x333fa4,_0x372bde){return _0x333fa4[_0x7b7e('0x7')]('Dynamics365Account',attributes,{'tableName':_0x7b7e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd8b0=['exports','Dynamics365Account','int_dynamics365_accounts','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x538fd2,_0x55d880){var _0x28bcfa=function(_0x1a906d){while(--_0x1a906d){_0x538fd2['push'](_0x538fd2['shift']());}};_0x28bcfa(++_0x55d880);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./intDynamics365Account.attributes');var integrations=require('../../components/integrations/configuration');module[_0x0d8b('0x7')]=function(_0x227c63,_0x39f43a){return _0x227c63['define'](_0x0d8b('0x8'),attributes,{'tableName':_0x0d8b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index ef47d5e..0d5ae7e 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 _0xa375=['client','http','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','include','map','model','attributes','find','ShowDynamics365Account','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x3c4e9b,_0x1ac317){var _0x232723=function(_0xf73b73){while(--_0xf73b73){_0x3c4e9b['push'](_0x3c4e9b['shift']());}};_0x232723(++_0x1ac317);}(_0xa375,0x129));var _0x5a37=function(_0x50af9c,_0xf03b1e){_0x50af9c=_0x50af9c-0x0;var _0x5b5e5a=_0xa375[_0x50af9c];return _0x5b5e5a;};'use strict';var _=require('lodash');var util=require(_0x5a37('0x0'));var moment=require(_0x5a37('0x1'));var BPromise=require(_0x5a37('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5a37('0x3'));var db=require(_0x5a37('0x4'))['db'];var utils=require(_0x5a37('0x5'));var logger=require(_0x5a37('0x6'))('rpc');var config=require(_0x5a37('0x7'));var jayson=require(_0x5a37('0x8'));var client=jayson[_0x5a37('0x9')][_0x5a37('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x17065c,_0x57b1c7,_0x48d568){return new BPromise(function(_0x5c9864,_0x9a3a9b){return client['request'](_0x17065c,_0x48d568)[_0x5a37('0xb')](function(_0xb56337){logger[_0x5a37('0xc')](_0x5a37('0xd'),_0x57b1c7,_0x5a37('0xe'));logger[_0x5a37('0xf')](_0x5a37('0x10'),_0x57b1c7,'request\x20sent',JSON['stringify'](_0xb56337));if(_0xb56337[_0x5a37('0x11')]){if(_0xb56337[_0x5a37('0x11')][_0x5a37('0x12')]===0x1f4){logger[_0x5a37('0x11')]('Dynamics365Account,\x20%s,\x20%s',_0x57b1c7,_0xb56337[_0x5a37('0x11')]['message']);return _0x9a3a9b(_0xb56337[_0x5a37('0x11')][_0x5a37('0x13')]);}logger['error'](_0x5a37('0xd'),_0x57b1c7,_0xb56337[_0x5a37('0x11')][_0x5a37('0x13')]);return _0x5c9864(_0xb56337[_0x5a37('0x11')][_0x5a37('0x13')]);}else{logger['info']('Dynamics365Account,\x20%s,\x20%s',_0x57b1c7,'request\x20sent');_0x5c9864(_0xb56337[_0x5a37('0x14')]['message']);}})[_0x5a37('0x15')](function(_0x2cd9d4){logger[_0x5a37('0x11')](_0x5a37('0xd'),_0x57b1c7,_0x2cd9d4);_0x9a3a9b(_0x2cd9d4);});});}exports[_0x5a37('0x16')]=function(_0x2f1169){var _0x596e51=this;return new Promise(function(_0x5e50ac,_0x1e3a98){return db[_0x5a37('0x17')][_0x5a37('0x18')]({'raw':_0x2f1169['options']?_0x2f1169[_0x5a37('0x19')][_0x5a37('0x1a')]===undefined?!![]:![]:!![],'where':_0x2f1169[_0x5a37('0x19')]?_0x2f1169[_0x5a37('0x19')][_0x5a37('0x1b')]||null:null,'attributes':_0x2f1169[_0x5a37('0x19')]?_0x2f1169[_0x5a37('0x19')]['attributes']||null:null,'limit':_0x2f1169[_0x5a37('0x19')]?_0x2f1169[_0x5a37('0x19')]['limit']||null:null,'include':_0x2f1169[_0x5a37('0x19')]?_0x2f1169['options'][_0x5a37('0x1c')]?_[_0x5a37('0x1d')](_0x2f1169[_0x5a37('0x19')][_0x5a37('0x1c')],function(_0x5b4cfb){return{'model':db[_0x5b4cfb[_0x5a37('0x1e')]],'as':_0x5b4cfb['as'],'attributes':_0x5b4cfb[_0x5a37('0x1f')],'include':_0x5b4cfb[_0x5a37('0x1c')]?_[_0x5a37('0x1d')](_0x5b4cfb[_0x5a37('0x1c')],function(_0x43614e){return{'model':db[_0x43614e['model']],'as':_0x43614e['as'],'attributes':_0x43614e['attributes'],'include':_0x43614e['include']?_['map'](_0x43614e[_0x5a37('0x1c')],function(_0x255ed5){return{'model':db[_0x255ed5['model']],'as':_0x255ed5['as'],'attributes':_0x255ed5[_0x5a37('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x5a37('0xb')](function(_0x443f20){logger[_0x5a37('0xc')](_0x5a37('0x16'),_0x2f1169);logger[_0x5a37('0xf')]('GetDynamics365Account',_0x2f1169,JSON['stringify'](_0x443f20));_0x5e50ac(_0x443f20);})[_0x5a37('0x15')](function(_0x2cbe2a){logger[_0x5a37('0x11')](_0x5a37('0x16'),_0x2cbe2a['message'],_0x2f1169);_0x1e3a98(_0x596e51[_0x5a37('0x11')](0x1f4,_0x2cbe2a[_0x5a37('0x13')]));});});};exports['ShowDynamics365Account']=function(_0x252fee){var _0x1588e7=this;return new Promise(function(_0x1f718,_0x226414){return db[_0x5a37('0x17')][_0x5a37('0x20')]({'raw':_0x252fee[_0x5a37('0x19')]?_0x252fee[_0x5a37('0x19')][_0x5a37('0x1a')]===undefined?!![]:![]:!![],'where':_0x252fee[_0x5a37('0x19')]?_0x252fee[_0x5a37('0x19')][_0x5a37('0x1b')]||null:null,'attributes':_0x252fee[_0x5a37('0x19')]?_0x252fee[_0x5a37('0x19')][_0x5a37('0x1f')]||null:null,'include':_0x252fee[_0x5a37('0x19')]?_0x252fee[_0x5a37('0x19')][_0x5a37('0x1c')]?_[_0x5a37('0x1d')](_0x252fee[_0x5a37('0x19')][_0x5a37('0x1c')],function(_0x2335fa){return{'model':db[_0x2335fa['model']],'as':_0x2335fa['as'],'attributes':_0x2335fa[_0x5a37('0x1f')],'include':_0x2335fa[_0x5a37('0x1c')]?_[_0x5a37('0x1d')](_0x2335fa[_0x5a37('0x1c')],function(_0x4b51a9){return{'model':db[_0x4b51a9[_0x5a37('0x1e')]],'as':_0x4b51a9['as'],'attributes':_0x4b51a9[_0x5a37('0x1f')],'include':_0x4b51a9[_0x5a37('0x1c')]?_[_0x5a37('0x1d')](_0x4b51a9[_0x5a37('0x1c')],function(_0x1a9cb1){return{'model':db[_0x1a9cb1['model']],'as':_0x1a9cb1['as'],'attributes':_0x1a9cb1['attributes']};}):[]};}):[]};}):[]:[]})[_0x5a37('0xb')](function(_0x34e69f){logger[_0x5a37('0xc')]('ShowDynamics365Account',_0x252fee);logger[_0x5a37('0xf')](_0x5a37('0x21'),_0x252fee,JSON['stringify'](_0x34e69f));_0x1f718(_0x34e69f);})[_0x5a37('0x15')](function(_0x14e69a){logger[_0x5a37('0x11')](_0x5a37('0x21'),_0x14e69a[_0x5a37('0x13')],_0x252fee);_0x226414(_0x1588e7[_0x5a37('0x11')](0x1f4,_0x14e69a['message']));});});}; \ No newline at end of file +var _0x4d11=['then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','attributes','limit','include','map','model','ShowDynamics365Account','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request'];(function(_0x13cd29,_0x510b62){var _0x4dcaee=function(_0x2f62ae){while(--_0x2f62ae){_0x13cd29['push'](_0x13cd29['shift']());}};_0x4dcaee(++_0x510b62);}(_0x4d11,0xa3));var _0x14d1=function(_0x2bc326,_0x473cf8){_0x2bc326=_0x2bc326-0x0;var _0x43722e=_0x4d11[_0x2bc326];return _0x43722e;};'use strict';var _=require(_0x14d1('0x0'));var util=require(_0x14d1('0x1'));var moment=require('moment');var BPromise=require(_0x14d1('0x2'));var rs=require(_0x14d1('0x3'));var fs=require('fs');var Redis=require(_0x14d1('0x4'));var db=require(_0x14d1('0x5'))['db'];var utils=require(_0x14d1('0x6'));var logger=require(_0x14d1('0x7'))(_0x14d1('0x8'));var config=require('../../config/environment');var jayson=require(_0x14d1('0x9'));var client=jayson['client'][_0x14d1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x548907,_0x51d266,_0x260f2d){return new BPromise(function(_0x1a5af9,_0x1bbf0a){return client[_0x14d1('0xb')](_0x548907,_0x260f2d)[_0x14d1('0xc')](function(_0x5562a7){logger[_0x14d1('0xd')](_0x14d1('0xe'),_0x51d266,_0x14d1('0xf'));logger['debug'](_0x14d1('0x10'),_0x51d266,_0x14d1('0xf'),JSON[_0x14d1('0x11')](_0x5562a7));if(_0x5562a7[_0x14d1('0x12')]){if(_0x5562a7[_0x14d1('0x12')][_0x14d1('0x13')]===0x1f4){logger[_0x14d1('0x12')](_0x14d1('0xe'),_0x51d266,_0x5562a7[_0x14d1('0x12')]['message']);return _0x1bbf0a(_0x5562a7[_0x14d1('0x12')][_0x14d1('0x14')]);}logger[_0x14d1('0x12')](_0x14d1('0xe'),_0x51d266,_0x5562a7[_0x14d1('0x12')][_0x14d1('0x14')]);return _0x1a5af9(_0x5562a7[_0x14d1('0x12')][_0x14d1('0x14')]);}else{logger[_0x14d1('0xd')](_0x14d1('0xe'),_0x51d266,_0x14d1('0xf'));_0x1a5af9(_0x5562a7[_0x14d1('0x15')][_0x14d1('0x14')]);}})[_0x14d1('0x16')](function(_0x20e203){logger[_0x14d1('0x12')](_0x14d1('0xe'),_0x51d266,_0x20e203);_0x1bbf0a(_0x20e203);});});}exports[_0x14d1('0x17')]=function(_0x24e873){var _0x1291dc=this;return new Promise(function(_0x27696e,_0x3850d0){return db[_0x14d1('0x18')][_0x14d1('0x19')]({'raw':_0x24e873[_0x14d1('0x1a')]?_0x24e873[_0x14d1('0x1a')][_0x14d1('0x1b')]===undefined?!![]:![]:!![],'where':_0x24e873[_0x14d1('0x1a')]?_0x24e873[_0x14d1('0x1a')][_0x14d1('0x1c')]||null:null,'attributes':_0x24e873[_0x14d1('0x1a')]?_0x24e873['options'][_0x14d1('0x1d')]||null:null,'limit':_0x24e873[_0x14d1('0x1a')]?_0x24e873[_0x14d1('0x1a')][_0x14d1('0x1e')]||null:null,'include':_0x24e873[_0x14d1('0x1a')]?_0x24e873['options'][_0x14d1('0x1f')]?_[_0x14d1('0x20')](_0x24e873[_0x14d1('0x1a')][_0x14d1('0x1f')],function(_0x59daa7){return{'model':db[_0x59daa7['model']],'as':_0x59daa7['as'],'attributes':_0x59daa7[_0x14d1('0x1d')],'include':_0x59daa7[_0x14d1('0x1f')]?_[_0x14d1('0x20')](_0x59daa7[_0x14d1('0x1f')],function(_0x48edc6){return{'model':db[_0x48edc6[_0x14d1('0x21')]],'as':_0x48edc6['as'],'attributes':_0x48edc6[_0x14d1('0x1d')],'include':_0x48edc6[_0x14d1('0x1f')]?_[_0x14d1('0x20')](_0x48edc6[_0x14d1('0x1f')],function(_0x5ebc9a){return{'model':db[_0x5ebc9a[_0x14d1('0x21')]],'as':_0x5ebc9a['as'],'attributes':_0x5ebc9a[_0x14d1('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x14d1('0xc')](function(_0x3abe39){logger[_0x14d1('0xd')](_0x14d1('0x17'),_0x24e873);logger['debug'](_0x14d1('0x17'),_0x24e873,JSON[_0x14d1('0x11')](_0x3abe39));_0x27696e(_0x3abe39);})[_0x14d1('0x16')](function(_0x43450f){logger[_0x14d1('0x12')](_0x14d1('0x17'),_0x43450f[_0x14d1('0x14')],_0x24e873);_0x3850d0(_0x1291dc['error'](0x1f4,_0x43450f['message']));});});};exports[_0x14d1('0x22')]=function(_0x3ae0fc){var _0xf051f=this;return new Promise(function(_0x181319,_0x467c53){return db['Dynamics365Account']['find']({'raw':_0x3ae0fc[_0x14d1('0x1a')]?_0x3ae0fc[_0x14d1('0x1a')][_0x14d1('0x1b')]===undefined?!![]:![]:!![],'where':_0x3ae0fc['options']?_0x3ae0fc[_0x14d1('0x1a')]['where']||null:null,'attributes':_0x3ae0fc['options']?_0x3ae0fc[_0x14d1('0x1a')][_0x14d1('0x1d')]||null:null,'include':_0x3ae0fc[_0x14d1('0x1a')]?_0x3ae0fc[_0x14d1('0x1a')][_0x14d1('0x1f')]?_[_0x14d1('0x20')](_0x3ae0fc[_0x14d1('0x1a')][_0x14d1('0x1f')],function(_0x113068){return{'model':db[_0x113068[_0x14d1('0x21')]],'as':_0x113068['as'],'attributes':_0x113068[_0x14d1('0x1d')],'include':_0x113068[_0x14d1('0x1f')]?_[_0x14d1('0x20')](_0x113068[_0x14d1('0x1f')],function(_0x5adebd){return{'model':db[_0x5adebd[_0x14d1('0x21')]],'as':_0x5adebd['as'],'attributes':_0x5adebd[_0x14d1('0x1d')],'include':_0x5adebd[_0x14d1('0x1f')]?_[_0x14d1('0x20')](_0x5adebd[_0x14d1('0x1f')],function(_0x555904){return{'model':db[_0x555904[_0x14d1('0x21')]],'as':_0x555904['as'],'attributes':_0x555904['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x24a241){logger[_0x14d1('0xd')](_0x14d1('0x22'),_0x3ae0fc);logger['debug'](_0x14d1('0x22'),_0x3ae0fc,JSON[_0x14d1('0x11')](_0x24a241));_0x181319(_0x24a241);})[_0x14d1('0x16')](function(_0x3eb453){logger['error'](_0x14d1('0x22'),_0x3eb453[_0x14d1('0x14')],_0x3ae0fc);_0x467c53(_0xf051f['error'](0x1f4,_0x3eb453[_0x14d1('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 8b7f1c8..6c5fc1b 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 _0xc4be=['delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','/:id','isAuthenticated','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','update'];(function(_0x3cc765,_0x250db1){var _0x2d8c5d=function(_0x365513){while(--_0x365513){_0x3cc765['push'](_0x3cc765['shift']());}};_0x2d8c5d(++_0x250db1);}(_0xc4be,0x1bb));var _0xec4b=function(_0xfd75c7,_0x4b6dd2){_0xfd75c7=_0xfd75c7-0x0;var _0x2b106e=_0xc4be[_0xfd75c7];return _0x2b106e;};'use strict';var multer=require(_0xec4b('0x0'));var util=require('util');var path=require(_0xec4b('0x1'));var timeout=require(_0xec4b('0x2'));var express=require(_0xec4b('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xec4b('0x4'));var interaction=require(_0xec4b('0x5'));var config=require(_0xec4b('0x6'));var controller=require(_0xec4b('0x7'));router[_0xec4b('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xec4b('0x8')](_0xec4b('0x9'),auth[_0xec4b('0xa')](),controller['show']);router['get'](_0xec4b('0xb'),auth[_0xec4b('0xa')](),controller[_0xec4b('0xc')]);router[_0xec4b('0x8')](_0xec4b('0xd'),auth[_0xec4b('0xa')](),controller[_0xec4b('0xe')]);router['get'](_0xec4b('0xf'),auth[_0xec4b('0xa')](),controller[_0xec4b('0x10')]);router['post']('/',auth[_0xec4b('0xa')](),controller[_0xec4b('0x11')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xec4b('0x12')]);router[_0xec4b('0x13')]('/:id',auth[_0xec4b('0xa')](),controller[_0xec4b('0x14')]);module[_0xec4b('0x15')]=router; \ No newline at end of file +var _0xef1a=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','update','delete','destroy','multer'];(function(_0x588959,_0x9aa719){var _0x5aff9b=function(_0x455dc1){while(--_0x455dc1){_0x588959['push'](_0x588959['shift']());}};_0x5aff9b(++_0x9aa719);}(_0xef1a,0x1c1));var _0xaef1=function(_0x3f37fb,_0x14d440){_0x3f37fb=_0x3f37fb-0x0;var _0x59cacc=_0xef1a[_0x3f37fb];return _0x59cacc;};'use strict';var multer=require(_0xaef1('0x0'));var util=require(_0xaef1('0x1'));var path=require(_0xaef1('0x2'));var timeout=require(_0xaef1('0x3'));var express=require(_0xaef1('0x4'));var router=express[_0xaef1('0x5')]();var fs_extra=require(_0xaef1('0x6'));var auth=require(_0xaef1('0x7'));var interaction=require(_0xaef1('0x8'));var config=require(_0xaef1('0x9'));var controller=require(_0xaef1('0xa'));router[_0xaef1('0xb')]('/',auth[_0xaef1('0xc')](),controller[_0xaef1('0xd')]);router[_0xaef1('0xb')](_0xaef1('0xe'),auth[_0xaef1('0xc')](),controller[_0xaef1('0xf')]);router['get'](_0xaef1('0x10'),auth[_0xaef1('0xc')](),controller[_0xaef1('0x11')]);router['get'](_0xaef1('0x12'),auth[_0xaef1('0xc')](),controller[_0xaef1('0x13')]);router[_0xaef1('0xb')](_0xaef1('0x14'),auth['isAuthenticated'](),controller[_0xaef1('0x15')]);router['post']('/',auth[_0xaef1('0xc')](),controller['create']);router['put'](_0xaef1('0xe'),auth[_0xaef1('0xc')](),controller[_0xaef1('0x16')]);router[_0xaef1('0x17')]('/:id',auth['isAuthenticated'](),controller[_0xaef1('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index ff6486e..eb5a382 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 _0x669d=['sequelize','exports','STRING','ENUM','incident','phonecall','contact','nothing','BOOLEAN'];(function(_0x54ea3a,_0xe6f7dc){var _0x1960f9=function(_0x21e7ed){while(--_0x21e7ed){_0x54ea3a['push'](_0x54ea3a['shift']());}};_0x1960f9(++_0xe6f7dc);}(_0x669d,0xd8));var _0xd669=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x669d[_0x138adb];return _0x1b27f2;};'use strict';var Sequelize=require(_0xd669('0x0'));module[_0xd669('0x1')]={'name':{'type':Sequelize[_0xd669('0x2')]},'description':{'type':Sequelize[_0xd669('0x2')]},'ticketType':{'type':Sequelize[_0xd669('0x3')](_0xd669('0x4'),_0xd669('0x5')),'defaultValue':_0xd669('0x4')},'moduleCreate':{'type':Sequelize[_0xd669('0x3')](_0xd669('0x6'),_0xd669('0x7')),'defaultValue':_0xd669('0x6'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0xd669('0x2')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0xd669('0x8')],'defaultValue':!![]}}; \ No newline at end of file +var _0x4755=['STRING','ENUM','phonecall','contact','BOOLEAN','sequelize','exports'];(function(_0xec3797,_0x5358cd){var _0x3bae2d=function(_0x52faf4){while(--_0x52faf4){_0xec3797['push'](_0xec3797['shift']());}};_0x3bae2d(++_0x5358cd);}(_0x4755,0xec));var _0x5475=function(_0x409353,_0xe9f04d){_0x409353=_0x409353-0x0;var _0x4f4b59=_0x4755[_0x409353];return _0x4f4b59;};'use strict';var Sequelize=require(_0x5475('0x0'));module[_0x5475('0x1')]={'name':{'type':Sequelize[_0x5475('0x2')]},'description':{'type':Sequelize[_0x5475('0x2')]},'ticketType':{'type':Sequelize[_0x5475('0x3')]('incident',_0x5475('0x4')),'defaultValue':'incident'},'moduleCreate':{'type':Sequelize['ENUM'](_0x5475('0x5'),'nothing'),'defaultValue':_0x5475('0x5'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize['STRING'],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0x5475('0x6')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 389194f..cbfea69 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 _0xb225=['type','VIRTUAL','filter','options','includeAll','include','Dynamics365Configuration','findAll','rows','catch','show','params','keys','rawAttributes','create','body','update','destroy','find','getFields','findOne','Dynamics365Field','getSubjects','getDescriptions','rimraf','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','../../components/auth/service','../../config/logger','api','../../config/environment','../../mysqldb','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','then','sendStatus','stack','name','send','map','fieldName','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge'];(function(_0x3eb04f,_0x29f230){var _0x15c285=function(_0x22e2bf){while(--_0x22e2bf){_0x3eb04f['push'](_0x3eb04f['shift']());}};_0x15c285(++_0x29f230);}(_0xb225,0x144));var _0x5b22=function(_0x34b1b8,_0x54c9bf){_0x34b1b8=_0x34b1b8-0x0;var _0x542dd8=_0xb225[_0x34b1b8];return _0x542dd8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5b22('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5b22('0x1'));var rp=require(_0x5b22('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5b22('0x3'));var util=require(_0x5b22('0x4'));var path=require(_0x5b22('0x5'));var sox=require('sox');var csv=require(_0x5b22('0x6'));var ejs=require(_0x5b22('0x7'));var fs=require('fs');var fs_extra=require(_0x5b22('0x8'));var _=require(_0x5b22('0x9'));var squel=require(_0x5b22('0xa'));var crypto=require('crypto');var jsforce=require(_0x5b22('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x5b22('0x6'));var querystring=require(_0x5b22('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5b22('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5b22('0xe'))(_0x5b22('0xf'));var utils=require('../../config/utils');var config=require(_0x5b22('0x10'));var licenseUtil=require('../../config/license/util');var db=require(_0x5b22('0x11'))['db'];function respondWithStatusCode(_0x1191b7,_0x4d1ded){_0x4d1ded=_0x4d1ded||0xcc;return function(_0x3e5af1){if(_0x3e5af1){return _0x1191b7['sendStatus'](_0x4d1ded);}return _0x1191b7['status'](_0x4d1ded)[_0x5b22('0x12')]();};}function respondWithResult(_0x4d43b8,_0xa891c3){_0xa891c3=_0xa891c3||0xc8;return function(_0x4f49e0){if(_0x4f49e0){return _0x4d43b8[_0x5b22('0x13')](_0xa891c3)[_0x5b22('0x14')](_0x4f49e0);}};}function respondWithFilteredResult(_0xeece65,_0x1cf6d6){return function(_0x13cd3d){if(_0x13cd3d){var _0x3bf3c2=typeof _0x1cf6d6[_0x5b22('0x15')]===_0x5b22('0x16')&&typeof _0x1cf6d6['limit']===_0x5b22('0x16');var _0x5036ac=_0x13cd3d[_0x5b22('0x17')];var _0x92aed3=_0x3bf3c2?0x0:_0x1cf6d6[_0x5b22('0x15')];var _0xfa7a57=_0x3bf3c2?_0x13cd3d[_0x5b22('0x17')]:_0x1cf6d6[_0x5b22('0x15')]+_0x1cf6d6[_0x5b22('0x18')];var _0x3a1f18;if(_0xfa7a57>=_0x5036ac){_0xfa7a57=_0x5036ac;_0x3a1f18=0xc8;}else{_0x3a1f18=0xce;}_0xeece65[_0x5b22('0x13')](_0x3a1f18);return _0xeece65[_0x5b22('0x19')](_0x5b22('0x1a'),_0x92aed3+'-'+_0xfa7a57+'/'+_0x5036ac)[_0x5b22('0x14')](_0x13cd3d);}return null;};}function patchUpdates(_0x3de13a){return function(_0x57fcf5){try{jsonpatch[_0x5b22('0x1b')](_0x57fcf5,_0x3de13a,!![]);}catch(_0x5a7f76){return BPromise[_0x5b22('0x1c')](_0x5a7f76);}return _0x57fcf5['save']();};}function saveUpdates(_0x3463df,_0x70d095){return function(_0x963492){if(_0x963492){return _0x963492['update'](_0x3463df)[_0x5b22('0x1d')](function(_0x827cb8){return _0x827cb8;});}return null;};}function removeEntity(_0x4c15c9,_0x1e4bed){return function(_0x581346){if(_0x581346){return _0x581346['destroy']()[_0x5b22('0x1d')](function(){_0x4c15c9[_0x5b22('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x25847e,_0x119d13){return function(_0x37d2a9){if(!_0x37d2a9){_0x25847e[_0x5b22('0x1e')](0x194);}return _0x37d2a9;};}function handleError(_0x25ac99,_0x556f61){_0x556f61=_0x556f61||0x1f4;return function(_0x473a88){logger['error'](_0x473a88[_0x5b22('0x1f')]);if(_0x473a88[_0x5b22('0x20')]){delete _0x473a88['name'];}_0x25ac99['status'](_0x556f61)[_0x5b22('0x21')](_0x473a88);};}exports['index']=function(_0x3d0cc8,_0x490b1a){var _0x59d5f8={},_0x500979={},_0x314e3b={'count':0x0,'rows':[]};var _0x188059=_[_0x5b22('0x22')](db['Dynamics365Configuration']['rawAttributes'],function(_0x2e764a){return{'name':_0x2e764a[_0x5b22('0x23')],'type':_0x2e764a['type'][_0x5b22('0x24')]};});_0x500979[_0x5b22('0x25')]=_[_0x5b22('0x22')](_0x188059,_0x5b22('0x20'));_0x500979[_0x5b22('0x26')]=_['keys'](_0x3d0cc8[_0x5b22('0x26')]);_0x500979['filters']=_[_0x5b22('0x27')](_0x500979[_0x5b22('0x25')],_0x500979[_0x5b22('0x26')]);_0x59d5f8[_0x5b22('0x28')]=_['intersection'](_0x500979[_0x5b22('0x25')],qs['fields'](_0x3d0cc8[_0x5b22('0x26')][_0x5b22('0x29')]));_0x59d5f8[_0x5b22('0x28')]=_0x59d5f8[_0x5b22('0x28')][_0x5b22('0x2a')]?_0x59d5f8['attributes']:_0x500979[_0x5b22('0x25')];if(!_0x3d0cc8[_0x5b22('0x26')][_0x5b22('0x2b')](_0x5b22('0x2c'))){_0x59d5f8[_0x5b22('0x18')]=qs[_0x5b22('0x18')](_0x3d0cc8[_0x5b22('0x26')][_0x5b22('0x18')]);_0x59d5f8[_0x5b22('0x15')]=qs[_0x5b22('0x15')](_0x3d0cc8[_0x5b22('0x26')]['offset']);}_0x59d5f8[_0x5b22('0x2d')]=qs[_0x5b22('0x2e')](_0x3d0cc8['query'][_0x5b22('0x2e')]);_0x59d5f8[_0x5b22('0x2f')]=qs[_0x5b22('0x30')](_[_0x5b22('0x31')](_0x3d0cc8[_0x5b22('0x26')],_0x500979['filters']),_0x188059);if(_0x3d0cc8[_0x5b22('0x26')]['filter']){_0x59d5f8['where']=_[_0x5b22('0x32')](_0x59d5f8[_0x5b22('0x2f')],{'$or':_[_0x5b22('0x22')](_0x188059,function(_0x30159c){if(_0x30159c[_0x5b22('0x33')]!==_0x5b22('0x34')){var _0x139704={};_0x139704[_0x30159c['name']]={'$like':'%'+_0x3d0cc8[_0x5b22('0x26')][_0x5b22('0x35')]+'%'};return _0x139704;}})});}_0x59d5f8=_['merge']({},_0x59d5f8,_0x3d0cc8[_0x5b22('0x36')]);var _0x258942={'where':_0x59d5f8['where']};return db['Dynamics365Configuration'][_0x5b22('0x17')](_0x258942)[_0x5b22('0x1d')](function(_0x1b0146){_0x314e3b[_0x5b22('0x17')]=_0x1b0146;if(_0x3d0cc8[_0x5b22('0x26')][_0x5b22('0x37')]){_0x59d5f8[_0x5b22('0x38')]=[{'all':!![]}];}return db[_0x5b22('0x39')][_0x5b22('0x3a')](_0x59d5f8);})[_0x5b22('0x1d')](function(_0xe1754e){_0x314e3b[_0x5b22('0x3b')]=_0xe1754e;return _0x314e3b;})['then'](respondWithFilteredResult(_0x490b1a,_0x59d5f8))[_0x5b22('0x3c')](handleError(_0x490b1a,null));};exports[_0x5b22('0x3d')]=function(_0x36e83f,_0x5013c8){var _0xa118a7={'raw':![],'where':{'id':_0x36e83f[_0x5b22('0x3e')]['id']}},_0x4568f7={};_0x4568f7[_0x5b22('0x25')]=_[_0x5b22('0x3f')](db[_0x5b22('0x39')][_0x5b22('0x40')]);_0x4568f7[_0x5b22('0x26')]=_[_0x5b22('0x3f')](_0x36e83f[_0x5b22('0x26')]);_0x4568f7[_0x5b22('0x30')]=_['intersection'](_0x4568f7[_0x5b22('0x25')],_0x4568f7['query']);_0xa118a7['attributes']=_[_0x5b22('0x27')](_0x4568f7[_0x5b22('0x25')],qs[_0x5b22('0x29')](_0x36e83f[_0x5b22('0x26')][_0x5b22('0x29')]));_0xa118a7['attributes']=_0xa118a7[_0x5b22('0x28')][_0x5b22('0x2a')]?_0xa118a7[_0x5b22('0x28')]:_0x4568f7[_0x5b22('0x25')];if(_0x36e83f['query'][_0x5b22('0x37')]){_0xa118a7[_0x5b22('0x38')]=[{'all':!![]}];}_0xa118a7=_[_0x5b22('0x32')]({},_0xa118a7,_0x36e83f['options']);return db[_0x5b22('0x39')]['find'](_0xa118a7)['then'](handleEntityNotFound(_0x5013c8,null))[_0x5b22('0x1d')](respondWithResult(_0x5013c8,null))[_0x5b22('0x3c')](handleError(_0x5013c8,null));};exports[_0x5b22('0x41')]=function(_0x4b2166,_0x2d31d4){return db['Dynamics365Configuration'][_0x5b22('0x41')](_0x4b2166[_0x5b22('0x42')],{})[_0x5b22('0x1d')](respondWithResult(_0x2d31d4,0xc9))[_0x5b22('0x3c')](handleError(_0x2d31d4,null));};exports[_0x5b22('0x43')]=function(_0xf1549c,_0x3e811e){if(_0xf1549c[_0x5b22('0x42')]['id']){delete _0xf1549c[_0x5b22('0x42')]['id'];}return db[_0x5b22('0x39')]['find']({'where':{'id':_0xf1549c[_0x5b22('0x3e')]['id']}})[_0x5b22('0x1d')](handleEntityNotFound(_0x3e811e,null))[_0x5b22('0x1d')](saveUpdates(_0xf1549c[_0x5b22('0x42')],null))[_0x5b22('0x1d')](respondWithResult(_0x3e811e,null))['catch'](handleError(_0x3e811e,null));};exports[_0x5b22('0x44')]=function(_0x21ac8c,_0x50dfcb){return db[_0x5b22('0x39')][_0x5b22('0x45')]({'where':{'id':_0x21ac8c[_0x5b22('0x3e')]['id']}})['then'](handleEntityNotFound(_0x50dfcb,null))[_0x5b22('0x1d')](removeEntity(_0x50dfcb,null))[_0x5b22('0x3c')](handleError(_0x50dfcb,null));};exports[_0x5b22('0x46')]=function(_0x24cd0e,_0x7a6804,_0x4a4e99){var _0x54eeb5={};var _0x3c3161={};var _0x26b44e;var _0x243e90;return db[_0x5b22('0x39')][_0x5b22('0x47')]({'where':{'id':_0x24cd0e[_0x5b22('0x3e')]['id']}})['then'](handleEntityNotFound(_0x7a6804,null))[_0x5b22('0x1d')](function(_0x59ea37){if(_0x59ea37){_0x26b44e=_0x59ea37;_0x3c3161[_0x5b22('0x25')]=_['keys'](db[_0x5b22('0x48')]['rawAttributes']);_0x3c3161['query']=_[_0x5b22('0x3f')](_0x24cd0e['query']);_0x3c3161[_0x5b22('0x30')]=_[_0x5b22('0x27')](_0x3c3161[_0x5b22('0x25')],_0x3c3161[_0x5b22('0x26')]);_0x54eeb5[_0x5b22('0x28')]=_['intersection'](_0x3c3161[_0x5b22('0x25')],qs[_0x5b22('0x29')](_0x24cd0e[_0x5b22('0x26')][_0x5b22('0x29')]));_0x54eeb5[_0x5b22('0x28')]=_0x54eeb5[_0x5b22('0x28')]['length']?_0x54eeb5[_0x5b22('0x28')]:_0x3c3161[_0x5b22('0x25')];_0x54eeb5[_0x5b22('0x2d')]=qs['sort'](_0x24cd0e[_0x5b22('0x26')][_0x5b22('0x2e')]);_0x54eeb5['where']=qs[_0x5b22('0x30')](_[_0x5b22('0x31')](_0x24cd0e[_0x5b22('0x26')],_0x3c3161[_0x5b22('0x30')]));if(_0x24cd0e['query']['filter']){_0x54eeb5['where']=_['merge'](_0x54eeb5[_0x5b22('0x2f')],{'$or':_[_0x5b22('0x22')](_0x54eeb5[_0x5b22('0x28')],function(_0x30e2dd){var _0x4b2b04={};_0x4b2b04[_0x30e2dd]={'$like':'%'+_0x24cd0e[_0x5b22('0x26')][_0x5b22('0x35')]+'%'};return _0x4b2b04;})});}_0x54eeb5=_[_0x5b22('0x32')]({},_0x54eeb5,_0x24cd0e[_0x5b22('0x36')]);return _0x26b44e['getFields'](_0x54eeb5);}})[_0x5b22('0x1d')](function(_0x3871af){if(_0x3871af){_0x243e90=_0x3871af[_0x5b22('0x2a')];if(!_0x24cd0e['query'][_0x5b22('0x2b')](_0x5b22('0x2c'))){_0x54eeb5[_0x5b22('0x18')]=qs['limit'](_0x24cd0e[_0x5b22('0x26')][_0x5b22('0x18')]);_0x54eeb5[_0x5b22('0x15')]=qs[_0x5b22('0x15')](_0x24cd0e[_0x5b22('0x26')][_0x5b22('0x15')]);}return _0x26b44e['getFields'](_0x54eeb5);}})[_0x5b22('0x1d')](function(_0x5f0cc5){if(_0x5f0cc5){return _0x5f0cc5?{'count':_0x243e90,'rows':_0x5f0cc5}:null;}})['then'](respondWithResult(_0x7a6804,null))['catch'](handleError(_0x7a6804,null));};exports['getSubjects']=function(_0x2e049f,_0x363bcb,_0x6e7735){var _0x296874={};var _0x6123c9={};var _0x52ac64;var _0x4b3839;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0x2e049f[_0x5b22('0x3e')]['id']}})['then'](handleEntityNotFound(_0x363bcb,null))[_0x5b22('0x1d')](function(_0x504b7d){if(_0x504b7d){_0x52ac64=_0x504b7d;_0x6123c9[_0x5b22('0x25')]=_['keys'](db['Dynamics365Field'][_0x5b22('0x40')]);_0x6123c9[_0x5b22('0x26')]=_['keys'](_0x2e049f[_0x5b22('0x26')]);_0x6123c9[_0x5b22('0x30')]=_['intersection'](_0x6123c9[_0x5b22('0x25')],_0x6123c9['query']);_0x296874[_0x5b22('0x28')]=_[_0x5b22('0x27')](_0x6123c9[_0x5b22('0x25')],qs[_0x5b22('0x29')](_0x2e049f[_0x5b22('0x26')]['fields']));_0x296874[_0x5b22('0x28')]=_0x296874[_0x5b22('0x28')][_0x5b22('0x2a')]?_0x296874['attributes']:_0x6123c9[_0x5b22('0x25')];_0x296874[_0x5b22('0x2d')]=qs[_0x5b22('0x2e')](_0x2e049f[_0x5b22('0x26')][_0x5b22('0x2e')]);_0x296874[_0x5b22('0x2f')]=qs[_0x5b22('0x30')](_['pick'](_0x2e049f['query'],_0x6123c9['filters']));if(_0x2e049f[_0x5b22('0x26')][_0x5b22('0x35')]){_0x296874[_0x5b22('0x2f')]=_[_0x5b22('0x32')](_0x296874['where'],{'$or':_[_0x5b22('0x22')](_0x296874[_0x5b22('0x28')],function(_0x5678d8){var _0x235c19={};_0x235c19[_0x5678d8]={'$like':'%'+_0x2e049f[_0x5b22('0x26')]['filter']+'%'};return _0x235c19;})});}_0x296874=_['merge']({},_0x296874,_0x2e049f[_0x5b22('0x36')]);return _0x52ac64[_0x5b22('0x49')](_0x296874);}})[_0x5b22('0x1d')](function(_0x4dc336){if(_0x4dc336){_0x4b3839=_0x4dc336[_0x5b22('0x2a')];if(!_0x2e049f[_0x5b22('0x26')][_0x5b22('0x2b')](_0x5b22('0x2c'))){_0x296874[_0x5b22('0x18')]=qs['limit'](_0x2e049f[_0x5b22('0x26')][_0x5b22('0x18')]);_0x296874[_0x5b22('0x15')]=qs[_0x5b22('0x15')](_0x2e049f['query'][_0x5b22('0x15')]);}return _0x52ac64['getSubjects'](_0x296874);}})['then'](function(_0x57a7e5){if(_0x57a7e5){return _0x57a7e5?{'count':_0x4b3839,'rows':_0x57a7e5}:null;}})[_0x5b22('0x1d')](respondWithResult(_0x363bcb,null))[_0x5b22('0x3c')](handleError(_0x363bcb,null));};exports[_0x5b22('0x4a')]=function(_0x2620ca,_0xc0de59,_0x384877){var _0x5c9e97={};var _0x184aeb={};var _0x5d8324;var _0x34fe76;return db[_0x5b22('0x39')]['findOne']({'where':{'id':_0x2620ca[_0x5b22('0x3e')]['id']}})[_0x5b22('0x1d')](handleEntityNotFound(_0xc0de59,null))[_0x5b22('0x1d')](function(_0x19ff2e){if(_0x19ff2e){_0x5d8324=_0x19ff2e;_0x184aeb[_0x5b22('0x25')]=_[_0x5b22('0x3f')](db[_0x5b22('0x48')]['rawAttributes']);_0x184aeb[_0x5b22('0x26')]=_[_0x5b22('0x3f')](_0x2620ca[_0x5b22('0x26')]);_0x184aeb[_0x5b22('0x30')]=_[_0x5b22('0x27')](_0x184aeb[_0x5b22('0x25')],_0x184aeb[_0x5b22('0x26')]);_0x5c9e97[_0x5b22('0x28')]=_[_0x5b22('0x27')](_0x184aeb[_0x5b22('0x25')],qs[_0x5b22('0x29')](_0x2620ca[_0x5b22('0x26')][_0x5b22('0x29')]));_0x5c9e97['attributes']=_0x5c9e97[_0x5b22('0x28')][_0x5b22('0x2a')]?_0x5c9e97['attributes']:_0x184aeb[_0x5b22('0x25')];_0x5c9e97[_0x5b22('0x2d')]=qs[_0x5b22('0x2e')](_0x2620ca[_0x5b22('0x26')][_0x5b22('0x2e')]);_0x5c9e97[_0x5b22('0x2f')]=qs['filters'](_['pick'](_0x2620ca[_0x5b22('0x26')],_0x184aeb[_0x5b22('0x30')]));if(_0x2620ca['query'][_0x5b22('0x35')]){_0x5c9e97[_0x5b22('0x2f')]=_[_0x5b22('0x32')](_0x5c9e97[_0x5b22('0x2f')],{'$or':_[_0x5b22('0x22')](_0x5c9e97[_0x5b22('0x28')],function(_0x3a0c43){var _0x5e2dd6={};_0x5e2dd6[_0x3a0c43]={'$like':'%'+_0x2620ca['query'][_0x5b22('0x35')]+'%'};return _0x5e2dd6;})});}_0x5c9e97=_[_0x5b22('0x32')]({},_0x5c9e97,_0x2620ca[_0x5b22('0x36')]);return _0x5d8324['getDescriptions'](_0x5c9e97);}})[_0x5b22('0x1d')](function(_0x4423fa){if(_0x4423fa){_0x34fe76=_0x4423fa[_0x5b22('0x2a')];if(!_0x2620ca[_0x5b22('0x26')][_0x5b22('0x2b')](_0x5b22('0x2c'))){_0x5c9e97['limit']=qs[_0x5b22('0x18')](_0x2620ca['query']['limit']);_0x5c9e97[_0x5b22('0x15')]=qs['offset'](_0x2620ca[_0x5b22('0x26')][_0x5b22('0x15')]);}return _0x5d8324[_0x5b22('0x4a')](_0x5c9e97);}})['then'](function(_0x41d38c){if(_0x41d38c){return _0x41d38c?{'count':_0x34fe76,'rows':_0x41d38c}:null;}})['then'](respondWithResult(_0xc0de59,null))[_0x5b22('0x3c')](handleError(_0xc0de59,null));}; \ No newline at end of file +var _0xf246=['../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','destroy','then','end','error','name','send','index','Dynamics365Configuration','rawAttributes','fieldName','type','key','model','map','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','pick','filter','merge','where','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','findOne','Dynamics365Field','order','sort','getFields','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xf246,0xdc));var _0x6f24=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf246[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x6f24('0x0'));var rimraf=require(_0x6f24('0x1'));var zipdir=require(_0x6f24('0x2'));var jsonpatch=require(_0x6f24('0x3'));var rp=require('request-promise');var moment=require(_0x6f24('0x4'));var BPromise=require(_0x6f24('0x5'));var Mustache=require('mustache');var util=require(_0x6f24('0x6'));var path=require(_0x6f24('0x7'));var sox=require(_0x6f24('0x8'));var csv=require(_0x6f24('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6f24('0xa'));var squel=require('squel');var crypto=require(_0x6f24('0xb'));var jsforce=require(_0x6f24('0xc'));var deskjs=require(_0x6f24('0xd'));var toCsv=require(_0x6f24('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6f24('0xe'));var authService=require(_0x6f24('0xf'));var qs=require(_0x6f24('0x10'));var as=require(_0x6f24('0x11'));var hardwareService=require(_0x6f24('0x12'));var logger=require(_0x6f24('0x13'))('api');var utils=require(_0x6f24('0x14'));var config=require(_0x6f24('0x15'));var licenseUtil=require(_0x6f24('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a12b6,_0x5aa3e3){_0x5aa3e3=_0x5aa3e3||0xcc;return function(_0x36b18b){if(_0x36b18b){return _0x2a12b6[_0x6f24('0x17')](_0x5aa3e3);}return _0x2a12b6[_0x6f24('0x18')](_0x5aa3e3)['end']();};}function respondWithResult(_0x2e869e,_0x181bdd){_0x181bdd=_0x181bdd||0xc8;return function(_0x497901){if(_0x497901){return _0x2e869e[_0x6f24('0x18')](_0x181bdd)[_0x6f24('0x19')](_0x497901);}};}function respondWithFilteredResult(_0x30d92a,_0x52d03b){return function(_0x1e42f7){if(_0x1e42f7){var _0x4019b8=typeof _0x52d03b[_0x6f24('0x1a')]===_0x6f24('0x1b')&&typeof _0x52d03b[_0x6f24('0x1c')]===_0x6f24('0x1b');var _0x59512d=_0x1e42f7[_0x6f24('0x1d')];var _0x3f587e=_0x4019b8?0x0:_0x52d03b[_0x6f24('0x1a')];var _0x5bc1ea=_0x4019b8?_0x1e42f7[_0x6f24('0x1d')]:_0x52d03b[_0x6f24('0x1a')]+_0x52d03b['limit'];var _0x2e2678;if(_0x5bc1ea>=_0x59512d){_0x5bc1ea=_0x59512d;_0x2e2678=0xc8;}else{_0x2e2678=0xce;}_0x30d92a[_0x6f24('0x18')](_0x2e2678);return _0x30d92a['set'](_0x6f24('0x1e'),_0x3f587e+'-'+_0x5bc1ea+'/'+_0x59512d)[_0x6f24('0x19')](_0x1e42f7);}return null;};}function patchUpdates(_0x2475c7){return function(_0x40801d){try{jsonpatch[_0x6f24('0x1f')](_0x40801d,_0x2475c7,!![]);}catch(_0x1b8df2){return BPromise['reject'](_0x1b8df2);}return _0x40801d[_0x6f24('0x20')]();};}function saveUpdates(_0x3fef91,_0x522f55){return function(_0x52a8d1){if(_0x52a8d1){return _0x52a8d1[_0x6f24('0x21')](_0x3fef91)['then'](function(_0x3eee3f){return _0x3eee3f;});}return null;};}function removeEntity(_0x2a8b75,_0x3b4fcb){return function(_0x5e2a09){if(_0x5e2a09){return _0x5e2a09[_0x6f24('0x22')]()[_0x6f24('0x23')](function(){_0x2a8b75[_0x6f24('0x18')](0xcc)[_0x6f24('0x24')]();});}};}function handleEntityNotFound(_0x319b06,_0x5bc3dc){return function(_0x474172){if(!_0x474172){_0x319b06[_0x6f24('0x17')](0x194);}return _0x474172;};}function handleError(_0x6fb370,_0x2c1bf8){_0x2c1bf8=_0x2c1bf8||0x1f4;return function(_0x4b2b5a){logger[_0x6f24('0x25')](_0x4b2b5a['stack']);if(_0x4b2b5a[_0x6f24('0x26')]){delete _0x4b2b5a['name'];}_0x6fb370['status'](_0x2c1bf8)[_0x6f24('0x27')](_0x4b2b5a);};}exports[_0x6f24('0x28')]=function(_0x510a2a,_0x1b1c7d){var _0x1740fc={},_0x55d492={},_0x372fa5={'count':0x0,'rows':[]};var _0x582f7f=_['map'](db[_0x6f24('0x29')][_0x6f24('0x2a')],function(_0x4149a9){return{'name':_0x4149a9[_0x6f24('0x2b')],'type':_0x4149a9[_0x6f24('0x2c')][_0x6f24('0x2d')]};});_0x55d492[_0x6f24('0x2e')]=_[_0x6f24('0x2f')](_0x582f7f,_0x6f24('0x26'));_0x55d492['query']=_[_0x6f24('0x30')](_0x510a2a[_0x6f24('0x31')]);_0x55d492[_0x6f24('0x32')]=_['intersection'](_0x55d492[_0x6f24('0x2e')],_0x55d492['query']);_0x1740fc[_0x6f24('0x33')]=_[_0x6f24('0x34')](_0x55d492[_0x6f24('0x2e')],qs[_0x6f24('0x35')](_0x510a2a[_0x6f24('0x31')][_0x6f24('0x35')]));_0x1740fc[_0x6f24('0x33')]=_0x1740fc[_0x6f24('0x33')][_0x6f24('0x36')]?_0x1740fc[_0x6f24('0x33')]:_0x55d492[_0x6f24('0x2e')];if(!_0x510a2a[_0x6f24('0x31')][_0x6f24('0x37')](_0x6f24('0x38'))){_0x1740fc['limit']=qs[_0x6f24('0x1c')](_0x510a2a['query'][_0x6f24('0x1c')]);_0x1740fc['offset']=qs[_0x6f24('0x1a')](_0x510a2a['query']['offset']);}_0x1740fc['order']=qs['sort'](_0x510a2a[_0x6f24('0x31')]['sort']);_0x1740fc['where']=qs['filters'](_[_0x6f24('0x39')](_0x510a2a[_0x6f24('0x31')],_0x55d492[_0x6f24('0x32')]),_0x582f7f);if(_0x510a2a[_0x6f24('0x31')][_0x6f24('0x3a')]){_0x1740fc['where']=_[_0x6f24('0x3b')](_0x1740fc[_0x6f24('0x3c')],{'$or':_[_0x6f24('0x2f')](_0x582f7f,function(_0x4f25c0){if(_0x4f25c0[_0x6f24('0x2c')]!==_0x6f24('0x3d')){var _0x48a1b8={};_0x48a1b8[_0x4f25c0[_0x6f24('0x26')]]={'$like':'%'+_0x510a2a['query'][_0x6f24('0x3a')]+'%'};return _0x48a1b8;}})});}_0x1740fc=_[_0x6f24('0x3b')]({},_0x1740fc,_0x510a2a['options']);var _0x4bdb79={'where':_0x1740fc['where']};return db['Dynamics365Configuration']['count'](_0x4bdb79)[_0x6f24('0x23')](function(_0x5119ca){_0x372fa5['count']=_0x5119ca;if(_0x510a2a[_0x6f24('0x31')][_0x6f24('0x3e')]){_0x1740fc[_0x6f24('0x3f')]=[{'all':!![]}];}return db[_0x6f24('0x29')][_0x6f24('0x40')](_0x1740fc);})[_0x6f24('0x23')](function(_0x209e4c){_0x372fa5[_0x6f24('0x41')]=_0x209e4c;return _0x372fa5;})[_0x6f24('0x23')](respondWithFilteredResult(_0x1b1c7d,_0x1740fc))[_0x6f24('0x42')](handleError(_0x1b1c7d,null));};exports[_0x6f24('0x43')]=function(_0x444f4a,_0x9c16d5){var _0x1ead59={'raw':![],'where':{'id':_0x444f4a[_0x6f24('0x44')]['id']}},_0x4d2e80={};_0x4d2e80['model']=_['keys'](db['Dynamics365Configuration'][_0x6f24('0x2a')]);_0x4d2e80[_0x6f24('0x31')]=_['keys'](_0x444f4a[_0x6f24('0x31')]);_0x4d2e80[_0x6f24('0x32')]=_[_0x6f24('0x34')](_0x4d2e80[_0x6f24('0x2e')],_0x4d2e80[_0x6f24('0x31')]);_0x1ead59[_0x6f24('0x33')]=_[_0x6f24('0x34')](_0x4d2e80[_0x6f24('0x2e')],qs[_0x6f24('0x35')](_0x444f4a['query'][_0x6f24('0x35')]));_0x1ead59[_0x6f24('0x33')]=_0x1ead59[_0x6f24('0x33')]['length']?_0x1ead59[_0x6f24('0x33')]:_0x4d2e80[_0x6f24('0x2e')];if(_0x444f4a[_0x6f24('0x31')][_0x6f24('0x3e')]){_0x1ead59['include']=[{'all':!![]}];}_0x1ead59=_[_0x6f24('0x3b')]({},_0x1ead59,_0x444f4a[_0x6f24('0x45')]);return db[_0x6f24('0x29')][_0x6f24('0x46')](_0x1ead59)[_0x6f24('0x23')](handleEntityNotFound(_0x9c16d5,null))['then'](respondWithResult(_0x9c16d5,null))[_0x6f24('0x42')](handleError(_0x9c16d5,null));};exports[_0x6f24('0x47')]=function(_0x4b4980,_0x642d9e){return db['Dynamics365Configuration'][_0x6f24('0x47')](_0x4b4980[_0x6f24('0x48')],{})[_0x6f24('0x23')](respondWithResult(_0x642d9e,0xc9))[_0x6f24('0x42')](handleError(_0x642d9e,null));};exports[_0x6f24('0x21')]=function(_0x50ae31,_0x37f758){if(_0x50ae31['body']['id']){delete _0x50ae31['body']['id'];}return db['Dynamics365Configuration'][_0x6f24('0x46')]({'where':{'id':_0x50ae31[_0x6f24('0x44')]['id']}})['then'](handleEntityNotFound(_0x37f758,null))[_0x6f24('0x23')](saveUpdates(_0x50ae31['body'],null))[_0x6f24('0x23')](respondWithResult(_0x37f758,null))['catch'](handleError(_0x37f758,null));};exports['destroy']=function(_0x5022dc,_0x8486b){return db[_0x6f24('0x29')][_0x6f24('0x46')]({'where':{'id':_0x5022dc[_0x6f24('0x44')]['id']}})['then'](handleEntityNotFound(_0x8486b,null))['then'](removeEntity(_0x8486b,null))[_0x6f24('0x42')](handleError(_0x8486b,null));};exports['getFields']=function(_0x15ab56,_0x519cc6,_0x47a433){var _0x3e20a3={};var _0x5a96a6={};var _0x10a5ef;var _0x73cc12;return db[_0x6f24('0x29')][_0x6f24('0x49')]({'where':{'id':_0x15ab56[_0x6f24('0x44')]['id']}})[_0x6f24('0x23')](handleEntityNotFound(_0x519cc6,null))[_0x6f24('0x23')](function(_0x172256){if(_0x172256){_0x10a5ef=_0x172256;_0x5a96a6[_0x6f24('0x2e')]=_[_0x6f24('0x30')](db[_0x6f24('0x4a')][_0x6f24('0x2a')]);_0x5a96a6[_0x6f24('0x31')]=_[_0x6f24('0x30')](_0x15ab56[_0x6f24('0x31')]);_0x5a96a6[_0x6f24('0x32')]=_[_0x6f24('0x34')](_0x5a96a6[_0x6f24('0x2e')],_0x5a96a6['query']);_0x3e20a3['attributes']=_['intersection'](_0x5a96a6[_0x6f24('0x2e')],qs['fields'](_0x15ab56[_0x6f24('0x31')][_0x6f24('0x35')]));_0x3e20a3['attributes']=_0x3e20a3[_0x6f24('0x33')][_0x6f24('0x36')]?_0x3e20a3['attributes']:_0x5a96a6[_0x6f24('0x2e')];_0x3e20a3[_0x6f24('0x4b')]=qs[_0x6f24('0x4c')](_0x15ab56[_0x6f24('0x31')][_0x6f24('0x4c')]);_0x3e20a3[_0x6f24('0x3c')]=qs[_0x6f24('0x32')](_['pick'](_0x15ab56[_0x6f24('0x31')],_0x5a96a6['filters']));if(_0x15ab56[_0x6f24('0x31')][_0x6f24('0x3a')]){_0x3e20a3[_0x6f24('0x3c')]=_[_0x6f24('0x3b')](_0x3e20a3[_0x6f24('0x3c')],{'$or':_['map'](_0x3e20a3[_0x6f24('0x33')],function(_0x593d44){var _0x1812ee={};_0x1812ee[_0x593d44]={'$like':'%'+_0x15ab56[_0x6f24('0x31')][_0x6f24('0x3a')]+'%'};return _0x1812ee;})});}_0x3e20a3=_[_0x6f24('0x3b')]({},_0x3e20a3,_0x15ab56['options']);return _0x10a5ef[_0x6f24('0x4d')](_0x3e20a3);}})[_0x6f24('0x23')](function(_0x520fbc){if(_0x520fbc){_0x73cc12=_0x520fbc[_0x6f24('0x36')];if(!_0x15ab56[_0x6f24('0x31')]['hasOwnProperty'](_0x6f24('0x38'))){_0x3e20a3[_0x6f24('0x1c')]=qs[_0x6f24('0x1c')](_0x15ab56['query'][_0x6f24('0x1c')]);_0x3e20a3[_0x6f24('0x1a')]=qs[_0x6f24('0x1a')](_0x15ab56['query'][_0x6f24('0x1a')]);}return _0x10a5ef[_0x6f24('0x4d')](_0x3e20a3);}})[_0x6f24('0x23')](function(_0x3f0a60){if(_0x3f0a60){return _0x3f0a60?{'count':_0x73cc12,'rows':_0x3f0a60}:null;}})[_0x6f24('0x23')](respondWithResult(_0x519cc6,null))['catch'](handleError(_0x519cc6,null));};exports[_0x6f24('0x4e')]=function(_0x4d67c8,_0x52ba6e,_0x3e70ad){var _0x43fd47={};var _0x28b4a4={};var _0x5bb890;var _0x337288;return db[_0x6f24('0x29')][_0x6f24('0x49')]({'where':{'id':_0x4d67c8[_0x6f24('0x44')]['id']}})[_0x6f24('0x23')](handleEntityNotFound(_0x52ba6e,null))[_0x6f24('0x23')](function(_0xa7a015){if(_0xa7a015){_0x5bb890=_0xa7a015;_0x28b4a4[_0x6f24('0x2e')]=_[_0x6f24('0x30')](db['Dynamics365Field'][_0x6f24('0x2a')]);_0x28b4a4[_0x6f24('0x31')]=_['keys'](_0x4d67c8[_0x6f24('0x31')]);_0x28b4a4[_0x6f24('0x32')]=_['intersection'](_0x28b4a4[_0x6f24('0x2e')],_0x28b4a4[_0x6f24('0x31')]);_0x43fd47['attributes']=_['intersection'](_0x28b4a4[_0x6f24('0x2e')],qs[_0x6f24('0x35')](_0x4d67c8[_0x6f24('0x31')]['fields']));_0x43fd47[_0x6f24('0x33')]=_0x43fd47[_0x6f24('0x33')][_0x6f24('0x36')]?_0x43fd47['attributes']:_0x28b4a4['model'];_0x43fd47[_0x6f24('0x4b')]=qs['sort'](_0x4d67c8['query']['sort']);_0x43fd47[_0x6f24('0x3c')]=qs[_0x6f24('0x32')](_[_0x6f24('0x39')](_0x4d67c8[_0x6f24('0x31')],_0x28b4a4['filters']));if(_0x4d67c8['query'][_0x6f24('0x3a')]){_0x43fd47[_0x6f24('0x3c')]=_[_0x6f24('0x3b')](_0x43fd47[_0x6f24('0x3c')],{'$or':_['map'](_0x43fd47[_0x6f24('0x33')],function(_0x234b2d){var _0x4beb5a={};_0x4beb5a[_0x234b2d]={'$like':'%'+_0x4d67c8[_0x6f24('0x31')][_0x6f24('0x3a')]+'%'};return _0x4beb5a;})});}_0x43fd47=_['merge']({},_0x43fd47,_0x4d67c8['options']);return _0x5bb890[_0x6f24('0x4e')](_0x43fd47);}})[_0x6f24('0x23')](function(_0x14d10a){if(_0x14d10a){_0x337288=_0x14d10a[_0x6f24('0x36')];if(!_0x4d67c8['query'][_0x6f24('0x37')](_0x6f24('0x38'))){_0x43fd47[_0x6f24('0x1c')]=qs[_0x6f24('0x1c')](_0x4d67c8[_0x6f24('0x31')][_0x6f24('0x1c')]);_0x43fd47[_0x6f24('0x1a')]=qs['offset'](_0x4d67c8['query'][_0x6f24('0x1a')]);}return _0x5bb890[_0x6f24('0x4e')](_0x43fd47);}})[_0x6f24('0x23')](function(_0x271f1d){if(_0x271f1d){return _0x271f1d?{'count':_0x337288,'rows':_0x271f1d}:null;}})[_0x6f24('0x23')](respondWithResult(_0x52ba6e,null))[_0x6f24('0x42')](handleError(_0x52ba6e,null));};exports['getDescriptions']=function(_0x1fb92a,_0x164212,_0x2d90f0){var _0x2320a5={};var _0x5f5080={};var _0xe837da;var _0x111647;return db['Dynamics365Configuration'][_0x6f24('0x49')]({'where':{'id':_0x1fb92a[_0x6f24('0x44')]['id']}})[_0x6f24('0x23')](handleEntityNotFound(_0x164212,null))[_0x6f24('0x23')](function(_0x11b8f7){if(_0x11b8f7){_0xe837da=_0x11b8f7;_0x5f5080[_0x6f24('0x2e')]=_[_0x6f24('0x30')](db[_0x6f24('0x4a')][_0x6f24('0x2a')]);_0x5f5080[_0x6f24('0x31')]=_[_0x6f24('0x30')](_0x1fb92a[_0x6f24('0x31')]);_0x5f5080['filters']=_[_0x6f24('0x34')](_0x5f5080[_0x6f24('0x2e')],_0x5f5080[_0x6f24('0x31')]);_0x2320a5['attributes']=_[_0x6f24('0x34')](_0x5f5080[_0x6f24('0x2e')],qs[_0x6f24('0x35')](_0x1fb92a[_0x6f24('0x31')][_0x6f24('0x35')]));_0x2320a5['attributes']=_0x2320a5[_0x6f24('0x33')]['length']?_0x2320a5[_0x6f24('0x33')]:_0x5f5080['model'];_0x2320a5['order']=qs[_0x6f24('0x4c')](_0x1fb92a[_0x6f24('0x31')][_0x6f24('0x4c')]);_0x2320a5[_0x6f24('0x3c')]=qs['filters'](_[_0x6f24('0x39')](_0x1fb92a['query'],_0x5f5080[_0x6f24('0x32')]));if(_0x1fb92a[_0x6f24('0x31')][_0x6f24('0x3a')]){_0x2320a5['where']=_[_0x6f24('0x3b')](_0x2320a5['where'],{'$or':_[_0x6f24('0x2f')](_0x2320a5[_0x6f24('0x33')],function(_0x4ec86d){var _0x1c61d2={};_0x1c61d2[_0x4ec86d]={'$like':'%'+_0x1fb92a[_0x6f24('0x31')][_0x6f24('0x3a')]+'%'};return _0x1c61d2;})});}_0x2320a5=_[_0x6f24('0x3b')]({},_0x2320a5,_0x1fb92a[_0x6f24('0x45')]);return _0xe837da[_0x6f24('0x4f')](_0x2320a5);}})[_0x6f24('0x23')](function(_0x353a9c){if(_0x353a9c){_0x111647=_0x353a9c[_0x6f24('0x36')];if(!_0x1fb92a[_0x6f24('0x31')][_0x6f24('0x37')](_0x6f24('0x38'))){_0x2320a5[_0x6f24('0x1c')]=qs[_0x6f24('0x1c')](_0x1fb92a[_0x6f24('0x31')]['limit']);_0x2320a5[_0x6f24('0x1a')]=qs[_0x6f24('0x1a')](_0x1fb92a[_0x6f24('0x31')][_0x6f24('0x1a')]);}return _0xe837da[_0x6f24('0x4f')](_0x2320a5);}})['then'](function(_0x7d1cca){if(_0x7d1cca){return _0x7d1cca?{'count':_0x111647,'rows':_0x7d1cca}:null;}})[_0x6f24('0x23')](respondWithResult(_0x164212,null))['catch'](handleError(_0x164212,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index c22ed55..d0341b9 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 _0xe5b3=['request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define','int_dynamics365_configurations','util','../../config/logger','api','moment','bluebird'];(function(_0x2f54b6,_0x3cc6cb){var _0x169f21=function(_0x4dac27){while(--_0x4dac27){_0x2f54b6['push'](_0x2f54b6['shift']());}};_0x169f21(++_0x3cc6cb);}(_0xe5b3,0x133));var _0x3e5b=function(_0x161e4a,_0x19096d){_0x161e4a=_0x161e4a-0x0;var _0x57cb12=_0xe5b3[_0x161e4a];return _0x57cb12;};'use strict';var _=require('lodash');var util=require(_0x3e5b('0x0'));var logger=require(_0x3e5b('0x1'))(_0x3e5b('0x2'));var moment=require(_0x3e5b('0x3'));var BPromise=require(_0x3e5b('0x4'));var rp=require(_0x3e5b('0x5'));var fs=require('fs');var path=require(_0x3e5b('0x6'));var rimraf=require(_0x3e5b('0x7'));var config=require(_0x3e5b('0x8'));var attributes=require(_0x3e5b('0x9'));module[_0x3e5b('0xa')]=function(_0x54e1fb,_0x174923){return _0x54e1fb[_0x3e5b('0xb')]('Dynamics365Configuration',attributes,{'tableName':_0x3e5b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb43b=['rimraf','../../config/environment','./intDynamics365Configuration.attributes','Dynamics365Configuration','int_dynamics365_configurations','lodash','util','api','moment','bluebird','path'];(function(_0x159678,_0x2befbe){var _0x3aa058=function(_0xb3ab17){while(--_0xb3ab17){_0x159678['push'](_0x159678['shift']());}};_0x3aa058(++_0x2befbe);}(_0xb43b,0x1b2));var _0xbb43=function(_0x1a3291,_0x1578e2){_0x1a3291=_0x1a3291-0x0;var _0xad0054=_0xb43b[_0x1a3291];return _0xad0054;};'use strict';var _=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var logger=require('../../config/logger')(_0xbb43('0x2'));var moment=require(_0xbb43('0x3'));var BPromise=require(_0xbb43('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbb43('0x5'));var rimraf=require(_0xbb43('0x6'));var config=require(_0xbb43('0x7'));var attributes=require(_0xbb43('0x8'));module['exports']=function(_0x491fb9,_0x378df5){return _0x491fb9['define'](_0xbb43('0x9'),attributes,{'tableName':_0xbb43('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index b8bcbcb..b8b3d5f 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 _0x3958=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x110f3b,_0xb4de71){var _0x1544ca=function(_0xafb305){while(--_0xafb305){_0x110f3b['push'](_0x110f3b['shift']());}};_0x1544ca(++_0xb4de71);}(_0x3958,0x1b3));var _0x8395=function(_0x5e15ee,_0x4ed8fb){_0x5e15ee=_0x5e15ee-0x0;var _0x107fda=_0x3958[_0x5e15ee];return _0x107fda;};'use strict';var _=require(_0x8395('0x0'));var util=require(_0x8395('0x1'));var moment=require(_0x8395('0x2'));var BPromise=require(_0x8395('0x3'));var rs=require(_0x8395('0x4'));var fs=require('fs');var Redis=require(_0x8395('0x5'));var db=require(_0x8395('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8395('0x7'));var config=require(_0x8395('0x8'));var jayson=require(_0x8395('0x9'));var client=jayson[_0x8395('0xa')][_0x8395('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x372b90,_0x2b8de7,_0x1a6629){return new BPromise(function(_0x3bf625,_0x3a6a1f){return client[_0x8395('0xc')](_0x372b90,_0x1a6629)[_0x8395('0xd')](function(_0x2d0518){logger[_0x8395('0xe')](_0x8395('0xf'),_0x2b8de7,_0x8395('0x10'));logger[_0x8395('0x11')](_0x8395('0x12'),_0x2b8de7,_0x8395('0x10'),JSON['stringify'](_0x2d0518));if(_0x2d0518[_0x8395('0x13')]){if(_0x2d0518[_0x8395('0x13')][_0x8395('0x14')]===0x1f4){logger[_0x8395('0x13')](_0x8395('0xf'),_0x2b8de7,_0x2d0518[_0x8395('0x13')][_0x8395('0x15')]);return _0x3a6a1f(_0x2d0518[_0x8395('0x13')]['message']);}logger[_0x8395('0x13')](_0x8395('0xf'),_0x2b8de7,_0x2d0518[_0x8395('0x13')][_0x8395('0x15')]);return _0x3bf625(_0x2d0518[_0x8395('0x13')]['message']);}else{logger[_0x8395('0xe')](_0x8395('0xf'),_0x2b8de7,_0x8395('0x10'));_0x3bf625(_0x2d0518[_0x8395('0x16')][_0x8395('0x15')]);}})[_0x8395('0x17')](function(_0x5c7766){logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x2b8de7,_0x5c7766);_0x3a6a1f(_0x5c7766);});});} \ No newline at end of file +var _0xebbd=['request\x20sent','debug','stringify','code','error','message','Dynamics365Configuration,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info'];(function(_0x367017,_0x4bfb36){var _0x541edc=function(_0x1133a9){while(--_0x1133a9){_0x367017['push'](_0x367017['shift']());}};_0x541edc(++_0x4bfb36);}(_0xebbd,0xef));var _0xdebb=function(_0x3fd50c,_0x1b41ed){_0x3fd50c=_0x3fd50c-0x0;var _0x4cebb2=_0xebbd[_0x3fd50c];return _0x4cebb2;};'use strict';var _=require(_0xdebb('0x0'));var util=require(_0xdebb('0x1'));var moment=require(_0xdebb('0x2'));var BPromise=require(_0xdebb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdebb('0x4'));var db=require(_0xdebb('0x5'))['db'];var utils=require(_0xdebb('0x6'));var logger=require(_0xdebb('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xdebb('0x8'));var client=jayson[_0xdebb('0x9')][_0xdebb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x7ae9d1,_0x1511ab,_0x3eafc1){return new BPromise(function(_0x15865e,_0x220e80){return client[_0xdebb('0xb')](_0x7ae9d1,_0x3eafc1)[_0xdebb('0xc')](function(_0x485568){logger[_0xdebb('0xd')]('Dynamics365Configuration,\x20%s,\x20%s',_0x1511ab,_0xdebb('0xe'));logger[_0xdebb('0xf')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x1511ab,'request\x20sent',JSON[_0xdebb('0x10')](_0x485568));if(_0x485568['error']){if(_0x485568['error'][_0xdebb('0x11')]===0x1f4){logger[_0xdebb('0x12')]('Dynamics365Configuration,\x20%s,\x20%s',_0x1511ab,_0x485568[_0xdebb('0x12')]['message']);return _0x220e80(_0x485568['error'][_0xdebb('0x13')]);}logger[_0xdebb('0x12')](_0xdebb('0x14'),_0x1511ab,_0x485568[_0xdebb('0x12')][_0xdebb('0x13')]);return _0x15865e(_0x485568['error'][_0xdebb('0x13')]);}else{logger[_0xdebb('0xd')](_0xdebb('0x14'),_0x1511ab,_0xdebb('0xe'));_0x15865e(_0x485568[_0xdebb('0x15')]['message']);}})[_0xdebb('0x16')](function(_0x10fbae){logger['error'](_0xdebb('0x14'),_0x1511ab,_0x10fbae);_0x220e80(_0x10fbae);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 9a4abb8..a86cb67 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 _0xb29e=['./intDynamics365Field.controller','get','isAuthenticated','index','/:id','create','put','destroy','exports','util','path','express','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x35f094,_0x1fac9e){var _0x22cebd=function(_0x4e0c51){while(--_0x4e0c51){_0x35f094['push'](_0x35f094['shift']());}};_0x22cebd(++_0x1fac9e);}(_0xb29e,0x1e9));var _0xeb29=function(_0x1f0398,_0x37a6dd){_0x1f0398=_0x1f0398-0x0;var _0x3f0ad5=_0xb29e[_0x1f0398];return _0x3f0ad5;};'use strict';var multer=require('multer');var util=require(_0xeb29('0x0'));var path=require(_0xeb29('0x1'));var timeout=require('connect-timeout');var express=require(_0xeb29('0x2'));var router=express['Router']();var fs_extra=require(_0xeb29('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xeb29('0x4'));var config=require(_0xeb29('0x5'));var controller=require(_0xeb29('0x6'));router[_0xeb29('0x7')]('/',auth[_0xeb29('0x8')](),controller[_0xeb29('0x9')]);router[_0xeb29('0x7')](_0xeb29('0xa'),auth[_0xeb29('0x8')](),controller['show']);router['post']('/',auth[_0xeb29('0x8')](),controller[_0xeb29('0xb')]);router[_0xeb29('0xc')](_0xeb29('0xa'),auth[_0xeb29('0x8')](),controller['update']);router['delete'](_0xeb29('0xa'),auth[_0xeb29('0x8')](),controller[_0xeb29('0xd')]);module[_0xeb29('0xe')]=router; \ No newline at end of file +var _0x8d77=['show','post','create','put','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x3f809b,_0x505bed){var _0x1ac5e8=function(_0x154858){while(--_0x154858){_0x3f809b['push'](_0x3f809b['shift']());}};_0x1ac5e8(++_0x505bed);}(_0x8d77,0x1bb));var _0x78d7=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x8d77[_0x4e9628];return _0x27bc8c;};'use strict';var multer=require('multer');var util=require(_0x78d7('0x0'));var path=require(_0x78d7('0x1'));var timeout=require(_0x78d7('0x2'));var express=require(_0x78d7('0x3'));var router=express[_0x78d7('0x4')]();var fs_extra=require(_0x78d7('0x5'));var auth=require(_0x78d7('0x6'));var interaction=require(_0x78d7('0x7'));var config=require(_0x78d7('0x8'));var controller=require('./intDynamics365Field.controller');router[_0x78d7('0x9')]('/',auth[_0x78d7('0xa')](),controller[_0x78d7('0xb')]);router[_0x78d7('0x9')](_0x78d7('0xc'),auth['isAuthenticated'](),controller[_0x78d7('0xd')]);router[_0x78d7('0xe')]('/',auth[_0x78d7('0xa')](),controller[_0x78d7('0xf')]);router[_0x78d7('0x10')]('/:id',auth[_0x78d7('0xa')](),controller['update']);router[_0x78d7('0x11')](_0x78d7('0xc'),auth[_0x78d7('0xa')](),controller['destroy']);module[_0x78d7('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 b31d366..1855817 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 _0x686f=['STRING','sequelize','exports','ENUM','variable','customVariable','keyValue','picklist','string'];(function(_0x201361,_0x3d6778){var _0x300db2=function(_0x3b3c10){while(--_0x3b3c10){_0x201361['push'](_0x201361['shift']());}};_0x300db2(++_0x3d6778);}(_0x686f,0xb5));var _0xf686=function(_0x470f1f,_0x1494f4){_0x470f1f=_0x470f1f-0x0;var _0x1c0abc=_0x686f[_0x470f1f];return _0x1c0abc;};'use strict';var Sequelize=require(_0xf686('0x0'));module[_0xf686('0x1')]={'type':{'type':Sequelize[_0xf686('0x2')]('string',_0xf686('0x3'),_0xf686('0x4'),_0xf686('0x5'),_0xf686('0x6')),'defaultValue':_0xf686('0x7')},'content':{'type':Sequelize[_0xf686('0x8')]},'key':{'type':Sequelize[_0xf686('0x8')]},'keyType':{'type':Sequelize[_0xf686('0x2')](_0xf686('0x7'),_0xf686('0x3'),_0xf686('0x4'))},'keyContent':{'type':Sequelize[_0xf686('0x8')]},'idField':{'type':Sequelize[_0xf686('0x8')]},'nameField':{'type':Sequelize[_0xf686('0x8')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf686('0x8')]}}; \ No newline at end of file +var _0xa91e=['BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue','STRING'];(function(_0x2edbf7,_0x17ae11){var _0xfd4551=function(_0x50213e){while(--_0x50213e){_0x2edbf7['push'](_0x2edbf7['shift']());}};_0xfd4551(++_0x17ae11);}(_0xa91e,0xe2));var _0xea91=function(_0x50a3c0,_0x2723f8){_0x50a3c0=_0x50a3c0-0x0;var _0x9495df=_0xa91e[_0x50a3c0];return _0x9495df;};'use strict';var Sequelize=require(_0xea91('0x0'));module[_0xea91('0x1')]={'type':{'type':Sequelize[_0xea91('0x2')](_0xea91('0x3'),_0xea91('0x4'),_0xea91('0x5'),_0xea91('0x6'),'picklist'),'defaultValue':_0xea91('0x3')},'content':{'type':Sequelize[_0xea91('0x7')]},'key':{'type':Sequelize[_0xea91('0x7')]},'keyType':{'type':Sequelize[_0xea91('0x2')](_0xea91('0x3'),'variable',_0xea91('0x5'))},'keyContent':{'type':Sequelize[_0xea91('0x7')]},'idField':{'type':Sequelize[_0xea91('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xea91('0x8')],'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 64dcd83..54a692e 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 _0x45c5=['update','destroy','then','stack','name','index','map','rawAttributes','fieldName','type','keys','query','intersection','attributes','model','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','Dynamics365Field','findAll','rows','catch','show','params','fields','find','create','body','eml-format','rimraf','moment','bluebird','util','path','to-csv','ejs','fs-extra','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','json','apply','reject','save'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x45c5,0x18a));var _0x545c=function(_0x1b24ef,_0x31c0a7){_0x1b24ef=_0x1b24ef-0x0;var _0x42a4dd=_0x45c5[_0x1b24ef];return _0x42a4dd;};'use strict';var emlformat=require(_0x545c('0x0'));var rimraf=require(_0x545c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x545c('0x2'));var BPromise=require(_0x545c('0x3'));var Mustache=require('mustache');var util=require(_0x545c('0x4'));var path=require(_0x545c('0x5'));var sox=require('sox');var csv=require(_0x545c('0x6'));var ejs=require(_0x545c('0x7'));var fs=require('fs');var fs_extra=require(_0x545c('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x545c('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x545c('0xa'));var Papa=require(_0x545c('0xb'));var Redis=require(_0x545c('0xc'));var authService=require(_0x545c('0xd'));var qs=require(_0x545c('0xe'));var as=require(_0x545c('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x545c('0x10'))(_0x545c('0x11'));var utils=require(_0x545c('0x12'));var config=require(_0x545c('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x545c('0x14'))['db'];function respondWithStatusCode(_0x3eb1b0,_0x4ae9ac){_0x4ae9ac=_0x4ae9ac||0xcc;return function(_0x463a31){if(_0x463a31){return _0x3eb1b0[_0x545c('0x15')](_0x4ae9ac);}return _0x3eb1b0[_0x545c('0x16')](_0x4ae9ac)['end']();};}function respondWithResult(_0x3b4c2f,_0x20b29f){_0x20b29f=_0x20b29f||0xc8;return function(_0x221cc8){if(_0x221cc8){return _0x3b4c2f[_0x545c('0x16')](_0x20b29f)['json'](_0x221cc8);}};}function respondWithFilteredResult(_0x1df90d,_0x5c4a71){return function(_0x4082cc){if(_0x4082cc){var _0x5297a7=typeof _0x5c4a71[_0x545c('0x17')]===_0x545c('0x18')&&typeof _0x5c4a71[_0x545c('0x19')]===_0x545c('0x18');var _0x49fe7e=_0x4082cc[_0x545c('0x1a')];var _0x3d3909=_0x5297a7?0x0:_0x5c4a71[_0x545c('0x17')];var _0x31caae=_0x5297a7?_0x4082cc[_0x545c('0x1a')]:_0x5c4a71[_0x545c('0x17')]+_0x5c4a71[_0x545c('0x19')];var _0x4b6cba;if(_0x31caae>=_0x49fe7e){_0x31caae=_0x49fe7e;_0x4b6cba=0xc8;}else{_0x4b6cba=0xce;}_0x1df90d['status'](_0x4b6cba);return _0x1df90d[_0x545c('0x1b')]('Content-Range',_0x3d3909+'-'+_0x31caae+'/'+_0x49fe7e)[_0x545c('0x1c')](_0x4082cc);}return null;};}function patchUpdates(_0x2f1099){return function(_0x2c45c5){try{jsonpatch[_0x545c('0x1d')](_0x2c45c5,_0x2f1099,!![]);}catch(_0x193ab9){return BPromise[_0x545c('0x1e')](_0x193ab9);}return _0x2c45c5[_0x545c('0x1f')]();};}function saveUpdates(_0x418a99,_0x3c8e3e){return function(_0x2e92ea){if(_0x2e92ea){return _0x2e92ea[_0x545c('0x20')](_0x418a99)['then'](function(_0x48cb4a){return _0x48cb4a;});}return null;};}function removeEntity(_0x4e3013,_0x5863d5){return function(_0x4c4cc7){if(_0x4c4cc7){return _0x4c4cc7[_0x545c('0x21')]()[_0x545c('0x22')](function(){_0x4e3013[_0x545c('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a6e24,_0x51573b){return function(_0x46640e){if(!_0x46640e){_0x3a6e24[_0x545c('0x15')](0x194);}return _0x46640e;};}function handleError(_0x2d890a,_0x4bde19){_0x4bde19=_0x4bde19||0x1f4;return function(_0x518ca8){logger['error'](_0x518ca8[_0x545c('0x23')]);if(_0x518ca8[_0x545c('0x24')]){delete _0x518ca8[_0x545c('0x24')];}_0x2d890a[_0x545c('0x16')](_0x4bde19)['send'](_0x518ca8);};}exports[_0x545c('0x25')]=function(_0x3cc252,_0x4f2304){var _0x49e33a={},_0x40781a={},_0x3f5f16={'count':0x0,'rows':[]};var _0x3c8677=_[_0x545c('0x26')](db['Dynamics365Field'][_0x545c('0x27')],function(_0x17fafe){return{'name':_0x17fafe[_0x545c('0x28')],'type':_0x17fafe[_0x545c('0x29')]['key']};});_0x40781a['model']=_[_0x545c('0x26')](_0x3c8677,'name');_0x40781a['query']=_[_0x545c('0x2a')](_0x3cc252[_0x545c('0x2b')]);_0x40781a['filters']=_[_0x545c('0x2c')](_0x40781a['model'],_0x40781a[_0x545c('0x2b')]);_0x49e33a[_0x545c('0x2d')]=_[_0x545c('0x2c')](_0x40781a[_0x545c('0x2e')],qs['fields'](_0x3cc252[_0x545c('0x2b')]['fields']));_0x49e33a[_0x545c('0x2d')]=_0x49e33a[_0x545c('0x2d')][_0x545c('0x2f')]?_0x49e33a[_0x545c('0x2d')]:_0x40781a[_0x545c('0x2e')];if(!_0x3cc252['query'][_0x545c('0x30')](_0x545c('0x31'))){_0x49e33a[_0x545c('0x19')]=qs[_0x545c('0x19')](_0x3cc252[_0x545c('0x2b')][_0x545c('0x19')]);_0x49e33a[_0x545c('0x17')]=qs['offset'](_0x3cc252[_0x545c('0x2b')][_0x545c('0x17')]);}_0x49e33a[_0x545c('0x32')]=qs[_0x545c('0x33')](_0x3cc252[_0x545c('0x2b')][_0x545c('0x33')]);_0x49e33a[_0x545c('0x34')]=qs[_0x545c('0x35')](_[_0x545c('0x36')](_0x3cc252[_0x545c('0x2b')],_0x40781a[_0x545c('0x35')]),_0x3c8677);if(_0x3cc252[_0x545c('0x2b')][_0x545c('0x37')]){_0x49e33a[_0x545c('0x34')]=_[_0x545c('0x38')](_0x49e33a[_0x545c('0x34')],{'$or':_['map'](_0x3c8677,function(_0x49c49d){if(_0x49c49d[_0x545c('0x29')]!==_0x545c('0x39')){var _0xbaebf8={};_0xbaebf8[_0x49c49d[_0x545c('0x24')]]={'$like':'%'+_0x3cc252['query']['filter']+'%'};return _0xbaebf8;}})});}_0x49e33a=_[_0x545c('0x38')]({},_0x49e33a,_0x3cc252[_0x545c('0x3a')]);var _0x4e1c80={'where':_0x49e33a[_0x545c('0x34')]};return db['Dynamics365Field']['count'](_0x4e1c80)[_0x545c('0x22')](function(_0x11455b){_0x3f5f16[_0x545c('0x1a')]=_0x11455b;if(_0x3cc252['query'][_0x545c('0x3b')]){_0x49e33a[_0x545c('0x3c')]=[{'all':!![]}];}return db[_0x545c('0x3d')][_0x545c('0x3e')](_0x49e33a);})[_0x545c('0x22')](function(_0x108c9e){_0x3f5f16[_0x545c('0x3f')]=_0x108c9e;return _0x3f5f16;})[_0x545c('0x22')](respondWithFilteredResult(_0x4f2304,_0x49e33a))[_0x545c('0x40')](handleError(_0x4f2304,null));};exports[_0x545c('0x41')]=function(_0xd5e145,_0x5d94fb){var _0x1f9080={'raw':!![],'where':{'id':_0xd5e145[_0x545c('0x42')]['id']}},_0x219a40={};_0x219a40[_0x545c('0x2e')]=_['keys'](db[_0x545c('0x3d')][_0x545c('0x27')]);_0x219a40['query']=_['keys'](_0xd5e145[_0x545c('0x2b')]);_0x219a40['filters']=_[_0x545c('0x2c')](_0x219a40[_0x545c('0x2e')],_0x219a40[_0x545c('0x2b')]);_0x1f9080[_0x545c('0x2d')]=_[_0x545c('0x2c')](_0x219a40[_0x545c('0x2e')],qs['fields'](_0xd5e145['query'][_0x545c('0x43')]));_0x1f9080['attributes']=_0x1f9080[_0x545c('0x2d')][_0x545c('0x2f')]?_0x1f9080['attributes']:_0x219a40[_0x545c('0x2e')];if(_0xd5e145[_0x545c('0x2b')][_0x545c('0x3b')]){_0x1f9080[_0x545c('0x3c')]=[{'all':!![]}];}_0x1f9080=_[_0x545c('0x38')]({},_0x1f9080,_0xd5e145['options']);return db['Dynamics365Field'][_0x545c('0x44')](_0x1f9080)[_0x545c('0x22')](handleEntityNotFound(_0x5d94fb,null))['then'](respondWithResult(_0x5d94fb,null))[_0x545c('0x40')](handleError(_0x5d94fb,null));};exports[_0x545c('0x45')]=function(_0xf0dfd1,_0x375680){return db[_0x545c('0x3d')]['create'](_0xf0dfd1[_0x545c('0x46')],{})['then'](respondWithResult(_0x375680,0xc9))[_0x545c('0x40')](handleError(_0x375680,null));};exports[_0x545c('0x20')]=function(_0x24b1d2,_0x440eed){if(_0x24b1d2[_0x545c('0x46')]['id']){delete _0x24b1d2[_0x545c('0x46')]['id'];}return db[_0x545c('0x3d')][_0x545c('0x44')]({'where':{'id':_0x24b1d2['params']['id']}})['then'](handleEntityNotFound(_0x440eed,null))[_0x545c('0x22')](saveUpdates(_0x24b1d2[_0x545c('0x46')],null))[_0x545c('0x22')](respondWithResult(_0x440eed,null))[_0x545c('0x40')](handleError(_0x440eed,null));};exports[_0x545c('0x21')]=function(_0x539a72,_0x2778f9){return db[_0x545c('0x3d')][_0x545c('0x44')]({'where':{'id':_0x539a72[_0x545c('0x42')]['id']}})[_0x545c('0x22')](handleEntityNotFound(_0x2778f9,null))[_0x545c('0x22')](removeEntity(_0x2778f9,null))[_0x545c('0x40')](handleError(_0x2778f9,null));}; \ No newline at end of file +var _0xe5a2=['path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','error','name','send','index','map','type','model','keys','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','options','Dynamics365Field','includeAll','findAll','rows','catch','show','rawAttributes','intersection','include','find','body','destroy','eml-format','rimraf','zip-dir','moment','bluebird','mustache'];(function(_0x31bab3,_0x44554f){var _0x4fd382=function(_0x42b336){while(--_0x42b336){_0x31bab3['push'](_0x31bab3['shift']());}};_0x4fd382(++_0x44554f);}(_0xe5a2,0x1dd));var _0x2e5a=function(_0x13efb6,_0x17bee8){_0x13efb6=_0x13efb6-0x0;var _0x203dc2=_0xe5a2[_0x13efb6];return _0x203dc2;};'use strict';var emlformat=require(_0x2e5a('0x0'));var rimraf=require(_0x2e5a('0x1'));var zipdir=require(_0x2e5a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2e5a('0x3'));var BPromise=require(_0x2e5a('0x4'));var Mustache=require(_0x2e5a('0x5'));var util=require('util');var path=require(_0x2e5a('0x6'));var sox=require(_0x2e5a('0x7'));var csv=require(_0x2e5a('0x8'));var ejs=require(_0x2e5a('0x9'));var fs=require('fs');var fs_extra=require(_0x2e5a('0xa'));var _=require(_0x2e5a('0xb'));var squel=require('squel');var crypto=require(_0x2e5a('0xc'));var jsforce=require(_0x2e5a('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2e5a('0xe'));var Papa=require(_0x2e5a('0xf'));var Redis=require(_0x2e5a('0x10'));var authService=require(_0x2e5a('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2e5a('0x12'));var utils=require(_0x2e5a('0x13'));var config=require(_0x2e5a('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x2e5a('0x15'))['db'];function respondWithStatusCode(_0x4ba636,_0x3c896a){_0x3c896a=_0x3c896a||0xcc;return function(_0x2efd1a){if(_0x2efd1a){return _0x4ba636[_0x2e5a('0x16')](_0x3c896a);}return _0x4ba636[_0x2e5a('0x17')](_0x3c896a)[_0x2e5a('0x18')]();};}function respondWithResult(_0x2a3d1e,_0x385c06){_0x385c06=_0x385c06||0xc8;return function(_0x5c8feb){if(_0x5c8feb){return _0x2a3d1e[_0x2e5a('0x17')](_0x385c06)[_0x2e5a('0x19')](_0x5c8feb);}};}function respondWithFilteredResult(_0x5b5f44,_0x1dcb71){return function(_0x3c1887){if(_0x3c1887){var _0x525b72=typeof _0x1dcb71[_0x2e5a('0x1a')]===_0x2e5a('0x1b')&&typeof _0x1dcb71[_0x2e5a('0x1c')]===_0x2e5a('0x1b');var _0x13220e=_0x3c1887[_0x2e5a('0x1d')];var _0x104821=_0x525b72?0x0:_0x1dcb71[_0x2e5a('0x1a')];var _0x38b9ea=_0x525b72?_0x3c1887[_0x2e5a('0x1d')]:_0x1dcb71[_0x2e5a('0x1a')]+_0x1dcb71[_0x2e5a('0x1c')];var _0x424821;if(_0x38b9ea>=_0x13220e){_0x38b9ea=_0x13220e;_0x424821=0xc8;}else{_0x424821=0xce;}_0x5b5f44[_0x2e5a('0x17')](_0x424821);return _0x5b5f44['set']('Content-Range',_0x104821+'-'+_0x38b9ea+'/'+_0x13220e)['json'](_0x3c1887);}return null;};}function patchUpdates(_0x587b77){return function(_0x1b3fbd){try{jsonpatch[_0x2e5a('0x1e')](_0x1b3fbd,_0x587b77,!![]);}catch(_0x5c54f7){return BPromise[_0x2e5a('0x1f')](_0x5c54f7);}return _0x1b3fbd[_0x2e5a('0x20')]();};}function saveUpdates(_0xd436f5,_0x241b5){return function(_0x2f61e4){if(_0x2f61e4){return _0x2f61e4[_0x2e5a('0x21')](_0xd436f5)['then'](function(_0x45c372){return _0x45c372;});}return null;};}function removeEntity(_0x3cdad2,_0x85602f){return function(_0x59dae9){if(_0x59dae9){return _0x59dae9['destroy']()[_0x2e5a('0x22')](function(){_0x3cdad2[_0x2e5a('0x17')](0xcc)[_0x2e5a('0x18')]();});}};}function handleEntityNotFound(_0x3dfeb2,_0xcb0487){return function(_0x582526){if(!_0x582526){_0x3dfeb2['sendStatus'](0x194);}return _0x582526;};}function handleError(_0x3ab254,_0x542824){_0x542824=_0x542824||0x1f4;return function(_0x5d380d){logger[_0x2e5a('0x23')](_0x5d380d['stack']);if(_0x5d380d[_0x2e5a('0x24')]){delete _0x5d380d['name'];}_0x3ab254[_0x2e5a('0x17')](_0x542824)[_0x2e5a('0x25')](_0x5d380d);};}exports[_0x2e5a('0x26')]=function(_0x34318f,_0x40a861){var _0x171138={},_0x5e495c={},_0xbb9afd={'count':0x0,'rows':[]};var _0x21601c=_[_0x2e5a('0x27')](db['Dynamics365Field']['rawAttributes'],function(_0x5e4495){return{'name':_0x5e4495['fieldName'],'type':_0x5e4495[_0x2e5a('0x28')]['key']};});_0x5e495c[_0x2e5a('0x29')]=_[_0x2e5a('0x27')](_0x21601c,_0x2e5a('0x24'));_0x5e495c['query']=_[_0x2e5a('0x2a')](_0x34318f['query']);_0x5e495c['filters']=_['intersection'](_0x5e495c[_0x2e5a('0x29')],_0x5e495c[_0x2e5a('0x2b')]);_0x171138[_0x2e5a('0x2c')]=_['intersection'](_0x5e495c[_0x2e5a('0x29')],qs['fields'](_0x34318f[_0x2e5a('0x2b')][_0x2e5a('0x2d')]));_0x171138[_0x2e5a('0x2c')]=_0x171138[_0x2e5a('0x2c')][_0x2e5a('0x2e')]?_0x171138[_0x2e5a('0x2c')]:_0x5e495c[_0x2e5a('0x29')];if(!_0x34318f[_0x2e5a('0x2b')][_0x2e5a('0x2f')](_0x2e5a('0x30'))){_0x171138[_0x2e5a('0x1c')]=qs[_0x2e5a('0x1c')](_0x34318f[_0x2e5a('0x2b')]['limit']);_0x171138['offset']=qs[_0x2e5a('0x1a')](_0x34318f[_0x2e5a('0x2b')][_0x2e5a('0x1a')]);}_0x171138[_0x2e5a('0x31')]=qs[_0x2e5a('0x32')](_0x34318f[_0x2e5a('0x2b')][_0x2e5a('0x32')]);_0x171138[_0x2e5a('0x33')]=qs[_0x2e5a('0x34')](_[_0x2e5a('0x35')](_0x34318f['query'],_0x5e495c['filters']),_0x21601c);if(_0x34318f['query'][_0x2e5a('0x36')]){_0x171138[_0x2e5a('0x33')]=_['merge'](_0x171138['where'],{'$or':_['map'](_0x21601c,function(_0x4aaf91){if(_0x4aaf91[_0x2e5a('0x28')]!==_0x2e5a('0x37')){var _0x1034ea={};_0x1034ea[_0x4aaf91[_0x2e5a('0x24')]]={'$like':'%'+_0x34318f[_0x2e5a('0x2b')][_0x2e5a('0x36')]+'%'};return _0x1034ea;}})});}_0x171138=_['merge']({},_0x171138,_0x34318f[_0x2e5a('0x38')]);var _0x59caf7={'where':_0x171138[_0x2e5a('0x33')]};return db[_0x2e5a('0x39')]['count'](_0x59caf7)[_0x2e5a('0x22')](function(_0x17ad0c){_0xbb9afd[_0x2e5a('0x1d')]=_0x17ad0c;if(_0x34318f[_0x2e5a('0x2b')][_0x2e5a('0x3a')]){_0x171138['include']=[{'all':!![]}];}return db[_0x2e5a('0x39')][_0x2e5a('0x3b')](_0x171138);})[_0x2e5a('0x22')](function(_0x315776){_0xbb9afd[_0x2e5a('0x3c')]=_0x315776;return _0xbb9afd;})[_0x2e5a('0x22')](respondWithFilteredResult(_0x40a861,_0x171138))[_0x2e5a('0x3d')](handleError(_0x40a861,null));};exports[_0x2e5a('0x3e')]=function(_0x47778f,_0x2fc1c8){var _0x2a4a54={'raw':!![],'where':{'id':_0x47778f['params']['id']}},_0x3bc148={};_0x3bc148[_0x2e5a('0x29')]=_[_0x2e5a('0x2a')](db[_0x2e5a('0x39')][_0x2e5a('0x3f')]);_0x3bc148['query']=_['keys'](_0x47778f[_0x2e5a('0x2b')]);_0x3bc148[_0x2e5a('0x34')]=_[_0x2e5a('0x40')](_0x3bc148[_0x2e5a('0x29')],_0x3bc148[_0x2e5a('0x2b')]);_0x2a4a54[_0x2e5a('0x2c')]=_[_0x2e5a('0x40')](_0x3bc148[_0x2e5a('0x29')],qs[_0x2e5a('0x2d')](_0x47778f[_0x2e5a('0x2b')][_0x2e5a('0x2d')]));_0x2a4a54[_0x2e5a('0x2c')]=_0x2a4a54[_0x2e5a('0x2c')][_0x2e5a('0x2e')]?_0x2a4a54[_0x2e5a('0x2c')]:_0x3bc148[_0x2e5a('0x29')];if(_0x47778f[_0x2e5a('0x2b')][_0x2e5a('0x3a')]){_0x2a4a54[_0x2e5a('0x41')]=[{'all':!![]}];}_0x2a4a54=_['merge']({},_0x2a4a54,_0x47778f['options']);return db['Dynamics365Field'][_0x2e5a('0x42')](_0x2a4a54)[_0x2e5a('0x22')](handleEntityNotFound(_0x2fc1c8,null))[_0x2e5a('0x22')](respondWithResult(_0x2fc1c8,null))[_0x2e5a('0x3d')](handleError(_0x2fc1c8,null));};exports['create']=function(_0x4ee999,_0x202e27){return db['Dynamics365Field']['create'](_0x4ee999[_0x2e5a('0x43')],{})[_0x2e5a('0x22')](respondWithResult(_0x202e27,0xc9))['catch'](handleError(_0x202e27,null));};exports[_0x2e5a('0x21')]=function(_0x1928c1,_0x55b172){if(_0x1928c1[_0x2e5a('0x43')]['id']){delete _0x1928c1[_0x2e5a('0x43')]['id'];}return db[_0x2e5a('0x39')][_0x2e5a('0x42')]({'where':{'id':_0x1928c1['params']['id']}})[_0x2e5a('0x22')](handleEntityNotFound(_0x55b172,null))[_0x2e5a('0x22')](saveUpdates(_0x1928c1[_0x2e5a('0x43')],null))[_0x2e5a('0x22')](respondWithResult(_0x55b172,null))[_0x2e5a('0x3d')](handleError(_0x55b172,null));};exports[_0x2e5a('0x44')]=function(_0x477923,_0x490630){return db[_0x2e5a('0x39')]['find']({'where':{'id':_0x477923['params']['id']}})[_0x2e5a('0x22')](handleEntityNotFound(_0x490630,null))[_0x2e5a('0x22')](removeEntity(_0x490630,null))[_0x2e5a('0x3d')](handleError(_0x490630,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 9a1cd4a..e635afb 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 _0xcd44=['request-promise','rimraf','../../config/environment','./intDynamics365Field.attributes','define','int_dynamics365_fields','idField','lodash','../../config/logger','api','moment','bluebird'];(function(_0x410f2c,_0x3b546a){var _0x359c88=function(_0x5b94c0){while(--_0x5b94c0){_0x410f2c['push'](_0x410f2c['shift']());}};_0x359c88(++_0x3b546a);}(_0xcd44,0x103));var _0x4cd4=function(_0x3109da,_0x42e44e){_0x3109da=_0x3109da-0x0;var _0x5b83a1=_0xcd44[_0x3109da];return _0x5b83a1;};'use strict';var _=require(_0x4cd4('0x0'));var util=require('util');var logger=require(_0x4cd4('0x1'))(_0x4cd4('0x2'));var moment=require(_0x4cd4('0x3'));var BPromise=require(_0x4cd4('0x4'));var rp=require(_0x4cd4('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4cd4('0x6'));var config=require(_0x4cd4('0x7'));var attributes=require(_0x4cd4('0x8'));module['exports']=function(_0x4d9fe2,_0x2d6d09){return _0x4d9fe2[_0x4cd4('0x9')]('Dynamics365Field',attributes,{'tableName':_0x4cd4('0xa'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':[_0x4cd4('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa3d2=['int_dynamics365_fields','dynamics365_unique_index','idField','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes','define','Dynamics365Field'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa3d2,0x1a7));var _0x2a3d=function(_0x44afa4,_0x5be27b){_0x44afa4=_0x44afa4-0x0;var _0xcad289=_0xa3d2[_0x44afa4];return _0xcad289;};'use strict';var _=require('lodash');var util=require(_0x2a3d('0x0'));var logger=require(_0x2a3d('0x1'))(_0x2a3d('0x2'));var moment=require(_0x2a3d('0x3'));var BPromise=require('bluebird');var rp=require(_0x2a3d('0x4'));var fs=require('fs');var path=require(_0x2a3d('0x5'));var rimraf=require(_0x2a3d('0x6'));var config=require(_0x2a3d('0x7'));var attributes=require(_0x2a3d('0x8'));module['exports']=function(_0x21942d,_0x2eb45a){return _0x21942d[_0x2a3d('0x9')](_0x2a3d('0xa'),attributes,{'tableName':_0x2a3d('0xb'),'paranoid':![],'indexes':[{'name':_0x2a3d('0xc'),'fields':[_0x2a3d('0xd'),'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 3940563..f2e64f7 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 _0x3ccc=['http','request','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/environment','client'];(function(_0x573f95,_0x39d1de){var _0xf4875f=function(_0x4bd3eb){while(--_0x4bd3eb){_0x573f95['push'](_0x573f95['shift']());}};_0xf4875f(++_0x39d1de);}(_0x3ccc,0x19a));var _0xc3cc=function(_0x93be41,_0x46c7f2){_0x93be41=_0x93be41-0x0;var _0x5cf92a=_0x3ccc[_0x93be41];return _0x5cf92a;};'use strict';var _=require(_0xc3cc('0x0'));var util=require(_0xc3cc('0x1'));var moment=require(_0xc3cc('0x2'));var BPromise=require(_0xc3cc('0x3'));var rs=require(_0xc3cc('0x4'));var fs=require('fs');var Redis=require(_0xc3cc('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xc3cc('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xc3cc('0x7')][_0xc3cc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4a3473,_0x20ed5a,_0x3eb38f){return new BPromise(function(_0x422873,_0x6014cf){return client[_0xc3cc('0x9')](_0x4a3473,_0x3eb38f)['then'](function(_0x46e3ab){logger[_0xc3cc('0xa')](_0xc3cc('0xb'),_0x20ed5a,_0xc3cc('0xc'));logger['debug'](_0xc3cc('0xd'),_0x20ed5a,_0xc3cc('0xc'),JSON[_0xc3cc('0xe')](_0x46e3ab));if(_0x46e3ab['error']){if(_0x46e3ab['error'][_0xc3cc('0xf')]===0x1f4){logger['error']('Dynamics365Field,\x20%s,\x20%s',_0x20ed5a,_0x46e3ab[_0xc3cc('0x10')][_0xc3cc('0x11')]);return _0x6014cf(_0x46e3ab[_0xc3cc('0x10')][_0xc3cc('0x11')]);}logger[_0xc3cc('0x10')](_0xc3cc('0xb'),_0x20ed5a,_0x46e3ab[_0xc3cc('0x10')][_0xc3cc('0x11')]);return _0x422873(_0x46e3ab[_0xc3cc('0x10')][_0xc3cc('0x11')]);}else{logger[_0xc3cc('0xa')]('Dynamics365Field,\x20%s,\x20%s',_0x20ed5a,_0xc3cc('0xc'));_0x422873(_0x46e3ab['result'][_0xc3cc('0x11')]);}})[_0xc3cc('0x12')](function(_0xd3b323){logger[_0xc3cc('0x10')](_0xc3cc('0xb'),_0x20ed5a,_0xd3b323);_0x6014cf(_0xd3b323);});});} \ No newline at end of file +var _0x22d7=['code','Dynamics365Field,\x20%s,\x20%s','message','result','catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','info','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x22d7,0x195));var _0x722d=function(_0x4fe7bb,_0x1bdd1c){_0x4fe7bb=_0x4fe7bb-0x0;var _0x5659cc=_0x22d7[_0x4fe7bb];return _0x5659cc;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x722d('0x0'));var BPromise=require(_0x722d('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x722d('0x2'));var db=require(_0x722d('0x3'))['db'];var utils=require(_0x722d('0x4'));var logger=require(_0x722d('0x5'))(_0x722d('0x6'));var config=require('../../config/environment');var jayson=require(_0x722d('0x7'));var client=jayson['client'][_0x722d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x454b3e,_0x171bd9,_0xc0ae2f){return new BPromise(function(_0x15cbc,_0x1072ed){return client['request'](_0x454b3e,_0xc0ae2f)['then'](function(_0x1ab053){logger[_0x722d('0x9')]('Dynamics365Field,\x20%s,\x20%s',_0x171bd9,_0x722d('0xa'));logger[_0x722d('0xb')](_0x722d('0xc'),_0x171bd9,_0x722d('0xa'),JSON[_0x722d('0xd')](_0x1ab053));if(_0x1ab053['error']){if(_0x1ab053[_0x722d('0xe')][_0x722d('0xf')]===0x1f4){logger[_0x722d('0xe')](_0x722d('0x10'),_0x171bd9,_0x1ab053[_0x722d('0xe')][_0x722d('0x11')]);return _0x1072ed(_0x1ab053[_0x722d('0xe')][_0x722d('0x11')]);}logger['error'](_0x722d('0x10'),_0x171bd9,_0x1ab053[_0x722d('0xe')]['message']);return _0x15cbc(_0x1ab053[_0x722d('0xe')][_0x722d('0x11')]);}else{logger[_0x722d('0x9')](_0x722d('0x10'),_0x171bd9,_0x722d('0xa'));_0x15cbc(_0x1ab053[_0x722d('0x12')][_0x722d('0x11')]);}})[_0x722d('0x13')](function(_0x54fc95){logger[_0x722d('0xe')]('Dynamics365Field,\x20%s,\x20%s',_0x171bd9,_0x54fc95);_0x1072ed(_0x54fc95);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 04e3898..745693e 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 _0x7f45=['addConfiguration','put','/:id','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshdeskAccount.controller','get','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create'];(function(_0x6cf1f1,_0x2d7d1f){var _0x55d649=function(_0x3250db){while(--_0x3250db){_0x6cf1f1['push'](_0x6cf1f1['shift']());}};_0x55d649(++_0x2d7d1f);}(_0x7f45,0x1ba));var _0x57f4=function(_0x144ff9,_0x2c14d8){_0x144ff9=_0x144ff9-0x0;var _0x5d00db=_0x7f45[_0x144ff9];return _0x5d00db;};'use strict';var multer=require(_0x57f4('0x0'));var util=require(_0x57f4('0x1'));var path=require(_0x57f4('0x2'));var timeout=require(_0x57f4('0x3'));var express=require(_0x57f4('0x4'));var router=express[_0x57f4('0x5')]();var fs_extra=require(_0x57f4('0x6'));var auth=require(_0x57f4('0x7'));var interaction=require(_0x57f4('0x8'));var config=require('../../config/environment');var controller=require(_0x57f4('0x9'));router[_0x57f4('0xa')]('/',auth[_0x57f4('0xb')](),controller['index']);router['get']('/:id',auth[_0x57f4('0xb')](),controller['show']);router[_0x57f4('0xa')](_0x57f4('0xc'),auth[_0x57f4('0xb')](),controller[_0x57f4('0xd')]);router['get'](_0x57f4('0xe'),auth[_0x57f4('0xb')](),controller[_0x57f4('0xf')]);router[_0x57f4('0x10')]('/',auth['isAuthenticated'](),controller[_0x57f4('0x11')]);router[_0x57f4('0x10')](_0x57f4('0xc'),auth[_0x57f4('0xb')](),controller[_0x57f4('0x12')]);router[_0x57f4('0x13')](_0x57f4('0x14'),auth['isAuthenticated'](),controller['update']);router[_0x57f4('0x15')](_0x57f4('0x14'),auth['isAuthenticated'](),controller[_0x57f4('0x16')]);module['exports']=router; \ No newline at end of file +var _0xf793=['isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshdeskAccount.controller','get'];(function(_0x100dea,_0x2ca828){var _0x785cb5=function(_0x1827ec){while(--_0x1827ec){_0x100dea['push'](_0x100dea['shift']());}};_0x785cb5(++_0x2ca828);}(_0xf793,0x1af));var _0x3f79=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xf793[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0x3f79('0x0'));var util=require(_0x3f79('0x1'));var path=require(_0x3f79('0x2'));var timeout=require(_0x3f79('0x3'));var express=require(_0x3f79('0x4'));var router=express[_0x3f79('0x5')]();var fs_extra=require(_0x3f79('0x6'));var auth=require(_0x3f79('0x7'));var interaction=require(_0x3f79('0x8'));var config=require('../../config/environment');var controller=require(_0x3f79('0x9'));router[_0x3f79('0xa')]('/',auth[_0x3f79('0xb')](),controller[_0x3f79('0xc')]);router[_0x3f79('0xa')](_0x3f79('0xd'),auth[_0x3f79('0xb')](),controller[_0x3f79('0xe')]);router[_0x3f79('0xa')](_0x3f79('0xf'),auth[_0x3f79('0xb')](),controller['getConfigurations']);router[_0x3f79('0xa')](_0x3f79('0x10'),auth[_0x3f79('0xb')](),controller[_0x3f79('0x11')]);router[_0x3f79('0x12')]('/',auth['isAuthenticated'](),controller[_0x3f79('0x13')]);router['post'](_0x3f79('0xf'),auth[_0x3f79('0xb')](),controller[_0x3f79('0x14')]);router[_0x3f79('0x15')](_0x3f79('0xd'),auth[_0x3f79('0xb')](),controller[_0x3f79('0x16')]);router[_0x3f79('0x17')](_0x3f79('0xd'),auth[_0x3f79('0xb')](),controller[_0x3f79('0x18')]);module[_0x3f79('0x19')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index c85e156..a7952cb 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 _0x33af=['exports','STRING','username','remoteUri'];(function(_0x11fe31,_0x2c2cdc){var _0x55e6b9=function(_0x11c4c4){while(--_0x11c4c4){_0x11fe31['push'](_0x11fe31['shift']());}};_0x55e6b9(++_0x2c2cdc);}(_0x33af,0xec));var _0xf33a=function(_0x20ba6d,_0x256177){_0x20ba6d=_0x20ba6d-0x0;var _0x338188=_0x33af[_0x20ba6d];return _0x338188;};'use strict';var Sequelize=require('sequelize');module[_0xf33a('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xf33a('0x1')]},'username':{'type':Sequelize[_0xf33a('0x1')],'unique':_0xf33a('0x2')},'apiKey':{'type':Sequelize[_0xf33a('0x1')]},'remoteUri':{'type':Sequelize[_0xf33a('0x1')],'unique':_0xf33a('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0xffd6=['exports','STRING','username','sequelize'];(function(_0xcb5dc6,_0x348060){var _0x363561=function(_0x84cfcd){while(--_0x84cfcd){_0xcb5dc6['push'](_0xcb5dc6['shift']());}};_0x363561(++_0x348060);}(_0xffd6,0x97));var _0x6ffd=function(_0x2341c6,_0x3af092){_0x2341c6=_0x2341c6-0x0;var _0x54c34d=_0xffd6[_0x2341c6];return _0x54c34d;};'use strict';var Sequelize=require(_0x6ffd('0x0'));module[_0x6ffd('0x1')]={'name':{'type':Sequelize[_0x6ffd('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x6ffd('0x3')},'apiKey':{'type':Sequelize[_0x6ffd('0x2')]},'remoteUri':{'type':Sequelize[_0x6ffd('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x6ffd('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 41bac73..5879318 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 _0x3495=['%s/%s','Basic\x20%s','toString','base64','requester','agent','description','priority','group','source','ticket_type','company','includes','default','custom_text','custom_dropdown','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','index','FreshdeskAccount','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','includeAll','catch','show','rawAttributes','include','options','create','body','find','params','getConfigurations','findOne','addConfiguration','channel','Descriptions','FreshdeskConfiguration','Subjects','FreshdeskField','getFields','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format'];(function(_0xabbd2f,_0x44d05a){var _0x34a040=function(_0x3736d9){while(--_0x3736d9){_0xabbd2f['push'](_0xabbd2f['shift']());}};_0x34a040(++_0x44d05a);}(_0x3495,0x1de));var _0x5349=function(_0x1a30fd,_0xcbc16d){_0x1a30fd=_0x1a30fd-0x0;var _0x317710=_0x3495[_0x1a30fd];return _0x317710;};'use strict';var emlformat=require(_0x5349('0x0'));var rimraf=require(_0x5349('0x1'));var zipdir=require(_0x5349('0x2'));var jsonpatch=require(_0x5349('0x3'));var rp=require(_0x5349('0x4'));var moment=require(_0x5349('0x5'));var BPromise=require(_0x5349('0x6'));var Mustache=require(_0x5349('0x7'));var util=require(_0x5349('0x8'));var path=require('path');var sox=require(_0x5349('0x9'));var csv=require(_0x5349('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5349('0xb'));var _=require('lodash');var squel=require(_0x5349('0xc'));var crypto=require('crypto');var jsforce=require(_0x5349('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x5349('0xa'));var querystring=require(_0x5349('0xe'));var Papa=require(_0x5349('0xf'));var Redis=require(_0x5349('0x10'));var authService=require(_0x5349('0x11'));var qs=require(_0x5349('0x12'));var as=require(_0x5349('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5349('0x14'))('api');var utils=require(_0x5349('0x15'));var config=require(_0x5349('0x16'));var licenseUtil=require(_0x5349('0x17'));var db=require(_0x5349('0x18'))['db'];var integrations=require(_0x5349('0x19'));function respondWithStatusCode(_0x3c592a,_0x642966){_0x642966=_0x642966||0xcc;return function(_0x52c253){if(_0x52c253){return _0x3c592a[_0x5349('0x1a')](_0x642966);}return _0x3c592a[_0x5349('0x1b')](_0x642966)['end']();};}function respondWithResult(_0x2fde66,_0x367c25){_0x367c25=_0x367c25||0xc8;return function(_0x47b25d){if(_0x47b25d){return _0x2fde66[_0x5349('0x1b')](_0x367c25)[_0x5349('0x1c')](_0x47b25d);}};}function respondWithFilteredResult(_0x2fe611,_0x49bbec){return function(_0x5bcb3a){if(_0x5bcb3a){var _0x558fbb=typeof _0x49bbec[_0x5349('0x1d')]==='undefined'&&typeof _0x49bbec[_0x5349('0x1e')]==='undefined';var _0x24d30b=_0x5bcb3a[_0x5349('0x1f')];var _0x1f5747=_0x558fbb?0x0:_0x49bbec[_0x5349('0x1d')];var _0x4e128c=_0x558fbb?_0x5bcb3a[_0x5349('0x1f')]:_0x49bbec[_0x5349('0x1d')]+_0x49bbec[_0x5349('0x1e')];var _0x443b0a;if(_0x4e128c>=_0x24d30b){_0x4e128c=_0x24d30b;_0x443b0a=0xc8;}else{_0x443b0a=0xce;}_0x2fe611['status'](_0x443b0a);return _0x2fe611[_0x5349('0x20')](_0x5349('0x21'),_0x1f5747+'-'+_0x4e128c+'/'+_0x24d30b)['json'](_0x5bcb3a);}return null;};}function patchUpdates(_0x4c96dc){return function(_0x491c84){try{jsonpatch[_0x5349('0x22')](_0x491c84,_0x4c96dc,!![]);}catch(_0x48ba3c){return BPromise[_0x5349('0x23')](_0x48ba3c);}return _0x491c84[_0x5349('0x24')]();};}function saveUpdates(_0x164978,_0x6c80cd){return function(_0x2dda33){if(_0x2dda33){return _0x2dda33[_0x5349('0x25')](_0x164978)[_0x5349('0x26')](function(_0x43a0c2){return _0x43a0c2;});}return null;};}function removeEntity(_0x2a3258,_0x34353f){return function(_0x1a84ce){if(_0x1a84ce){return _0x1a84ce[_0x5349('0x27')]()['then'](function(){_0x2a3258[_0x5349('0x1b')](0xcc)[_0x5349('0x28')]();});}};}function handleEntityNotFound(_0x41d67e,_0x49435a){return function(_0x404700){if(!_0x404700){_0x41d67e['sendStatus'](0x194);}return _0x404700;};}function handleError(_0x1afba7,_0x203896){_0x203896=_0x203896||0x1f4;return function(_0x1db8cc){logger['error'](_0x1db8cc[_0x5349('0x29')]);if(_0x1db8cc[_0x5349('0x2a')]){delete _0x1db8cc[_0x5349('0x2a')];}_0x1afba7[_0x5349('0x1b')](_0x203896)[_0x5349('0x2b')](_0x1db8cc);};}exports[_0x5349('0x2c')]=function(_0x3b6faa,_0x463a42){var _0x39b3a9={},_0x5b5d6c={},_0x3b3e79={'count':0x0,'rows':[]};var _0x1ab20a=_['map'](db[_0x5349('0x2d')]['rawAttributes'],function(_0x1df8b0){return{'name':_0x1df8b0[_0x5349('0x2e')],'type':_0x1df8b0[_0x5349('0x2f')][_0x5349('0x30')]};});_0x5b5d6c[_0x5349('0x31')]=_[_0x5349('0x32')](_0x1ab20a,'name');_0x5b5d6c[_0x5349('0x33')]=_[_0x5349('0x34')](_0x3b6faa[_0x5349('0x33')]);_0x5b5d6c[_0x5349('0x35')]=_['intersection'](_0x5b5d6c['model'],_0x5b5d6c[_0x5349('0x33')]);_0x39b3a9[_0x5349('0x36')]=_[_0x5349('0x37')](_0x5b5d6c['model'],qs[_0x5349('0x38')](_0x3b6faa['query'][_0x5349('0x38')]));_0x39b3a9[_0x5349('0x36')]=_0x39b3a9[_0x5349('0x36')][_0x5349('0x39')]?_0x39b3a9[_0x5349('0x36')]:_0x5b5d6c[_0x5349('0x31')];if(!_0x3b6faa['query']['hasOwnProperty'](_0x5349('0x3a'))){_0x39b3a9[_0x5349('0x1e')]=qs[_0x5349('0x1e')](_0x3b6faa[_0x5349('0x33')][_0x5349('0x1e')]);_0x39b3a9[_0x5349('0x1d')]=qs[_0x5349('0x1d')](_0x3b6faa['query']['offset']);}_0x39b3a9[_0x5349('0x3b')]=qs['sort'](_0x3b6faa['query'][_0x5349('0x3c')]);_0x39b3a9['where']=qs[_0x5349('0x35')](_[_0x5349('0x3d')](_0x3b6faa[_0x5349('0x33')],_0x5b5d6c['filters']),_0x1ab20a);if(_0x3b6faa[_0x5349('0x33')]['filter']){_0x39b3a9[_0x5349('0x3e')]=_[_0x5349('0x3f')](_0x39b3a9[_0x5349('0x3e')],{'$or':_['map'](_0x1ab20a,function(_0x48a765){if(_0x48a765['type']!==_0x5349('0x40')){var _0x26da1e={};_0x26da1e[_0x48a765[_0x5349('0x2a')]]={'$like':'%'+_0x3b6faa[_0x5349('0x33')][_0x5349('0x41')]+'%'};return _0x26da1e;}})});}_0x39b3a9=_[_0x5349('0x3f')]({},_0x39b3a9,_0x3b6faa['options']);var _0x52ab9d={'where':_0x39b3a9[_0x5349('0x3e')]};return db[_0x5349('0x2d')][_0x5349('0x1f')](_0x52ab9d)['then'](function(_0x7ca6dc){_0x3b3e79[_0x5349('0x1f')]=_0x7ca6dc;if(_0x3b6faa[_0x5349('0x33')][_0x5349('0x42')]){_0x39b3a9['include']=[{'all':!![]}];}return db[_0x5349('0x2d')]['findAll'](_0x39b3a9);})[_0x5349('0x26')](function(_0x196d68){_0x3b3e79['rows']=_0x196d68;return _0x3b3e79;})[_0x5349('0x26')](respondWithFilteredResult(_0x463a42,_0x39b3a9))[_0x5349('0x43')](handleError(_0x463a42,null));};exports[_0x5349('0x44')]=function(_0x370849,_0x173904){var _0xd29178={'raw':![],'where':{'id':_0x370849['params']['id']}},_0x4252ec={};_0x4252ec['model']=_[_0x5349('0x34')](db[_0x5349('0x2d')][_0x5349('0x45')]);_0x4252ec[_0x5349('0x33')]=_['keys'](_0x370849[_0x5349('0x33')]);_0x4252ec['filters']=_['intersection'](_0x4252ec[_0x5349('0x31')],_0x4252ec[_0x5349('0x33')]);_0xd29178[_0x5349('0x36')]=_[_0x5349('0x37')](_0x4252ec['model'],qs[_0x5349('0x38')](_0x370849[_0x5349('0x33')][_0x5349('0x38')]));_0xd29178[_0x5349('0x36')]=_0xd29178[_0x5349('0x36')][_0x5349('0x39')]?_0xd29178[_0x5349('0x36')]:_0x4252ec[_0x5349('0x31')];if(_0x370849[_0x5349('0x33')][_0x5349('0x42')]){_0xd29178[_0x5349('0x46')]=[{'all':!![]}];}_0xd29178=_[_0x5349('0x3f')]({},_0xd29178,_0x370849[_0x5349('0x47')]);return db[_0x5349('0x2d')]['find'](_0xd29178)['then'](handleEntityNotFound(_0x173904,null))[_0x5349('0x26')](respondWithResult(_0x173904,null))[_0x5349('0x43')](handleError(_0x173904,null));};exports[_0x5349('0x48')]=function(_0x366634,_0x5e8cf3){return db[_0x5349('0x2d')]['create'](_0x366634[_0x5349('0x49')],{})[_0x5349('0x26')](respondWithResult(_0x5e8cf3,0xc9))[_0x5349('0x43')](handleError(_0x5e8cf3,null));};exports[_0x5349('0x25')]=function(_0x26d06a,_0x1a5a2f){if(_0x26d06a['body']['id']){delete _0x26d06a[_0x5349('0x49')]['id'];}return db['FreshdeskAccount'][_0x5349('0x4a')]({'where':{'id':_0x26d06a[_0x5349('0x4b')]['id']}})[_0x5349('0x26')](handleEntityNotFound(_0x1a5a2f,null))[_0x5349('0x26')](saveUpdates(_0x26d06a[_0x5349('0x49')],null))['then'](respondWithResult(_0x1a5a2f,null))[_0x5349('0x43')](handleError(_0x1a5a2f,null));};exports[_0x5349('0x27')]=function(_0x3891af,_0x302aab){return db['FreshdeskAccount'][_0x5349('0x4a')]({'where':{'id':_0x3891af[_0x5349('0x4b')]['id']}})[_0x5349('0x26')](handleEntityNotFound(_0x302aab,null))[_0x5349('0x26')](removeEntity(_0x302aab,null))[_0x5349('0x43')](handleError(_0x302aab,null));};exports[_0x5349('0x4c')]=function(_0x451f97,_0x3b27ca,_0x1ec66b){var _0x264763={};var _0x477782={};var _0x2a6f80;var _0x1286a2;return db[_0x5349('0x2d')][_0x5349('0x4d')]({'where':{'id':_0x451f97[_0x5349('0x4b')]['id']}})[_0x5349('0x26')](handleEntityNotFound(_0x3b27ca,null))[_0x5349('0x26')](function(_0x55457d){if(_0x55457d){_0x2a6f80=_0x55457d;_0x477782[_0x5349('0x31')]=_[_0x5349('0x34')](db['FreshdeskConfiguration']['rawAttributes']);_0x477782[_0x5349('0x33')]=_[_0x5349('0x34')](_0x451f97[_0x5349('0x33')]);_0x477782[_0x5349('0x35')]=_[_0x5349('0x37')](_0x477782[_0x5349('0x31')],_0x477782[_0x5349('0x33')]);_0x264763['attributes']=_[_0x5349('0x37')](_0x477782[_0x5349('0x31')],qs[_0x5349('0x38')](_0x451f97['query']['fields']));_0x264763[_0x5349('0x36')]=_0x264763[_0x5349('0x36')][_0x5349('0x39')]?_0x264763[_0x5349('0x36')]:_0x477782[_0x5349('0x31')];_0x264763[_0x5349('0x3b')]=qs[_0x5349('0x3c')](_0x451f97[_0x5349('0x33')]['sort']);_0x264763[_0x5349('0x3e')]=qs['filters'](_[_0x5349('0x3d')](_0x451f97[_0x5349('0x33')],_0x477782[_0x5349('0x35')]));if(_0x451f97[_0x5349('0x33')]['filter']){_0x264763['where']=_['merge'](_0x264763[_0x5349('0x3e')],{'$or':_['map'](_0x264763[_0x5349('0x36')],function(_0x276710){var _0x401ef0={};_0x401ef0[_0x276710]={'$like':'%'+_0x451f97[_0x5349('0x33')][_0x5349('0x41')]+'%'};return _0x401ef0;})});}_0x264763=_[_0x5349('0x3f')]({},_0x264763,_0x451f97['options']);return _0x2a6f80[_0x5349('0x4c')](_0x264763);}})[_0x5349('0x26')](function(_0x16f6d3){if(_0x16f6d3){_0x1286a2=_0x16f6d3[_0x5349('0x39')];if(!_0x451f97[_0x5349('0x33')]['hasOwnProperty'](_0x5349('0x3a'))){_0x264763['limit']=qs[_0x5349('0x1e')](_0x451f97['query']['limit']);_0x264763[_0x5349('0x1d')]=qs[_0x5349('0x1d')](_0x451f97[_0x5349('0x33')][_0x5349('0x1d')]);}return _0x2a6f80[_0x5349('0x4c')](_0x264763);}})[_0x5349('0x26')](function(_0x266fb1){if(_0x266fb1){return _0x266fb1?{'count':_0x1286a2,'rows':_0x266fb1}:null;}})[_0x5349('0x26')](respondWithResult(_0x3b27ca,null))['catch'](handleError(_0x3b27ca,null));};exports[_0x5349('0x4e')]=function(_0xbefe3a,_0x22c21d,_0x36f0ba){if(_0xbefe3a[_0x5349('0x49')]['id']){delete _0xbefe3a['body']['id'];}return db[_0x5349('0x2d')]['findOne']({'where':{'id':_0xbefe3a[_0x5349('0x4b')]['id']}})[_0x5349('0x26')](handleEntityNotFound(_0x22c21d,null))[_0x5349('0x26')](function(_0x49511a){if(_0x49511a){_0xbefe3a[_0x5349('0x49')]['AccountId']=_0x49511a['id'];_0xbefe3a[_0x5349('0x49')]['Subjects']=integrations['getSubjects'](_0xbefe3a[_0x5349('0x49')][_0x5349('0x4f')],_0xbefe3a['body'][_0x5349('0x2f')]);_0xbefe3a[_0x5349('0x49')][_0x5349('0x50')]=integrations['getDescriptions'](_0xbefe3a[_0x5349('0x49')][_0x5349('0x4f')],_0xbefe3a['body']['type']);return db[_0x5349('0x51')]['create'](_0xbefe3a['body'],{'include':[{'model':db['FreshdeskField'],'as':_0x5349('0x52')},{'model':db[_0x5349('0x53')],'as':_0x5349('0x50')}]});}return null;})['then'](respondWithResult(_0x22c21d,null))[_0x5349('0x43')](handleError(_0x22c21d,null));};exports[_0x5349('0x54')]=function(_0x27271e,_0x5812b0,_0x5239da){var _0x674054='';return db[_0x5349('0x2d')][_0x5349('0x4d')]({'where':{'id':_0x27271e[_0x5349('0x4b')]['id']},'attributes':['id',_0x5349('0x55'),_0x5349('0x56')]})[_0x5349('0x26')](handleEntityNotFound(_0x5812b0,null))[_0x5349('0x26')](function(_0x25b07f){if(_0x25b07f){_0x674054=_0x25b07f[_0x5349('0x55')];var _0xb5edf7=_0x674054[_0x5349('0x57')](-0x1);if(_0xb5edf7==='/'){_0x674054=_0x674054[_0x5349('0x58')](0x0,_0x674054[_0x5349('0x59')](_0xb5edf7));}return rp({'method':_0x5349('0x5a'),'uri':util[_0x5349('0x5b')](_0x5349('0x5c'),_0x674054,'api/v2/ticket_fields'),'headers':{'Authorization':util['format'](_0x5349('0x5d'),new Buffer(util[_0x5349('0x5b')]('%s:X',_0x25b07f[_0x5349('0x56')]))[_0x5349('0x5e')](_0x5349('0x5f')))},'json':!![]});}})['then'](function(_0x55ec12){if(_0x55ec12){var _0x4d4498=[_0x5349('0x60'),'subject',_0x5349('0x61'),_0x5349('0x62'),_0x5349('0x1b'),_0x5349('0x63'),_0x5349('0x64'),_0x5349('0x65'),_0x5349('0x66'),'group',_0x5349('0x67')];_['remove'](_0x55ec12,function(_0x17c13f){return _0x4d4498[_0x5349('0x68')](_0x17c13f[_0x5349('0x2a')])||!_0x17c13f[_0x5349('0x69')]&&_0x17c13f[_0x5349('0x2f')]!==_0x5349('0x6a')&&_0x17c13f[_0x5349('0x2f')]!==_0x5349('0x6b');});return{'count':_0x55ec12['length'],'rows':_['map'](_0x55ec12,function(_0xc336cf){return{'id':_0xc336cf['name'],'name':_0xc336cf['label'],'custom':!_0xc336cf['default'],'options':_0xc336cf[_0x5349('0x6c')]?_[_0x5349('0x32')](_0xc336cf[_0x5349('0x6c')],function(_0x34256e){return{'name':_[_0x5349('0x6d')](_0x34256e),'value':_0x34256e};}):[]};})};}})[_0x5349('0x26')](respondWithResult(_0x5812b0,null))[_0x5349('0x43')](function(_0x28b831){var _0x483f2e=_0x27271e['query'][_0x5349('0x6e')]?0x1f4:_0x28b831[_0x5349('0x6f')]||0x1f4;logger['error'](_0x5349('0x70'),_0x5349('0x54'),_0x483f2e,JSON[_0x5349('0x71')](_0x28b831));delete _0x28b831[_0x5349('0x2a')];if(_0x483f2e===0x191){_0x483f2e=0x190;}_0x5812b0[_0x5349('0x1b')](_0x483f2e)[_0x5349('0x2b')](_0x27271e['query'][_0x5349('0x6e')]?{'message':'Wrong\x20credentials','statusCode':_0x28b831[_0x5349('0x6f')]}:_0x28b831);});}; \ No newline at end of file +var _0xf151=['intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','merge','filter','includeAll','include','rows','catch','show','params','length','options','find','create','FreshdeskAccount','body','getConfigurations','findOne','FreshdeskConfiguration','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','FreshdeskField','remoteUri','apiKey','slice','substring','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','toString','requester','description','group','source','ticket_type','company','remove','includes','default','custom_dropdown','label','choices','capitalize','test','statusCode','getFields','stringify','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','then','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys'];(function(_0x35895d,_0x4d18af){var _0x27df87=function(_0xab82e9){while(--_0xab82e9){_0x35895d['push'](_0x35895d['shift']());}};_0x27df87(++_0x4d18af);}(_0xf151,0xab));var _0x1f15=function(_0x264f24,_0x4eb644){_0x264f24=_0x264f24-0x0;var _0x521464=_0xf151[_0x264f24];return _0x521464;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1f15('0x0'));var jsonpatch=require(_0x1f15('0x1'));var rp=require(_0x1f15('0x2'));var moment=require(_0x1f15('0x3'));var BPromise=require(_0x1f15('0x4'));var Mustache=require(_0x1f15('0x5'));var util=require(_0x1f15('0x6'));var path=require(_0x1f15('0x7'));var sox=require('sox');var csv=require(_0x1f15('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x1f15('0x9'));var crypto=require(_0x1f15('0xa'));var jsforce=require(_0x1f15('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1f15('0x8'));var querystring=require(_0x1f15('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1f15('0xd'));var qs=require(_0x1f15('0xe'));var as=require(_0x1f15('0xf'));var hardwareService=require(_0x1f15('0x10'));var logger=require('../../config/logger')(_0x1f15('0x11'));var utils=require(_0x1f15('0x12'));var config=require(_0x1f15('0x13'));var licenseUtil=require(_0x1f15('0x14'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x340109,_0x94e8e4){_0x94e8e4=_0x94e8e4||0xcc;return function(_0x440c0b){if(_0x440c0b){return _0x340109[_0x1f15('0x15')](_0x94e8e4);}return _0x340109[_0x1f15('0x16')](_0x94e8e4)[_0x1f15('0x17')]();};}function respondWithResult(_0x5a9f14,_0xfafc5c){_0xfafc5c=_0xfafc5c||0xc8;return function(_0x356768){if(_0x356768){return _0x5a9f14[_0x1f15('0x16')](_0xfafc5c)[_0x1f15('0x18')](_0x356768);}};}function respondWithFilteredResult(_0x48ef33,_0x428133){return function(_0x5baa48){if(_0x5baa48){var _0x19f7a2=typeof _0x428133[_0x1f15('0x19')]===_0x1f15('0x1a')&&typeof _0x428133['limit']==='undefined';var _0x25697e=_0x5baa48[_0x1f15('0x1b')];var _0x448725=_0x19f7a2?0x0:_0x428133['offset'];var _0xccfdf5=_0x19f7a2?_0x5baa48['count']:_0x428133[_0x1f15('0x19')]+_0x428133[_0x1f15('0x1c')];var _0x4ff4fb;if(_0xccfdf5>=_0x25697e){_0xccfdf5=_0x25697e;_0x4ff4fb=0xc8;}else{_0x4ff4fb=0xce;}_0x48ef33['status'](_0x4ff4fb);return _0x48ef33[_0x1f15('0x1d')]('Content-Range',_0x448725+'-'+_0xccfdf5+'/'+_0x25697e)[_0x1f15('0x18')](_0x5baa48);}return null;};}function patchUpdates(_0x2916b5){return function(_0x3598dd){try{jsonpatch[_0x1f15('0x1e')](_0x3598dd,_0x2916b5,!![]);}catch(_0xbf02bc){return BPromise[_0x1f15('0x1f')](_0xbf02bc);}return _0x3598dd[_0x1f15('0x20')]();};}function saveUpdates(_0x588c78,_0x4888c8){return function(_0x36b211){if(_0x36b211){return _0x36b211[_0x1f15('0x21')](_0x588c78)['then'](function(_0x57cb54){return _0x57cb54;});}return null;};}function removeEntity(_0x303d93,_0x49fe69){return function(_0x2598b4){if(_0x2598b4){return _0x2598b4['destroy']()[_0x1f15('0x22')](function(){_0x303d93[_0x1f15('0x16')](0xcc)[_0x1f15('0x17')]();});}};}function handleEntityNotFound(_0x46e8a7,_0x262121){return function(_0xdca8f4){if(!_0xdca8f4){_0x46e8a7[_0x1f15('0x15')](0x194);}return _0xdca8f4;};}function handleError(_0x317bfc,_0x42e5e3){_0x42e5e3=_0x42e5e3||0x1f4;return function(_0x49bf73){logger[_0x1f15('0x23')](_0x49bf73['stack']);if(_0x49bf73[_0x1f15('0x24')]){delete _0x49bf73[_0x1f15('0x24')];}_0x317bfc['status'](_0x42e5e3)[_0x1f15('0x25')](_0x49bf73);};}exports[_0x1f15('0x26')]=function(_0x1a5a14,_0x4be862){var _0x38ce55={},_0x14f9f4={},_0x15b68f={'count':0x0,'rows':[]};var _0x51b054=_[_0x1f15('0x27')](db['FreshdeskAccount'][_0x1f15('0x28')],function(_0x47e627){return{'name':_0x47e627[_0x1f15('0x29')],'type':_0x47e627[_0x1f15('0x2a')][_0x1f15('0x2b')]};});_0x14f9f4[_0x1f15('0x2c')]=_[_0x1f15('0x27')](_0x51b054,_0x1f15('0x24'));_0x14f9f4[_0x1f15('0x2d')]=_[_0x1f15('0x2e')](_0x1a5a14['query']);_0x14f9f4['filters']=_[_0x1f15('0x2f')](_0x14f9f4[_0x1f15('0x2c')],_0x14f9f4[_0x1f15('0x2d')]);_0x38ce55[_0x1f15('0x30')]=_[_0x1f15('0x2f')](_0x14f9f4[_0x1f15('0x2c')],qs['fields'](_0x1a5a14[_0x1f15('0x2d')][_0x1f15('0x31')]));_0x38ce55[_0x1f15('0x30')]=_0x38ce55[_0x1f15('0x30')]['length']?_0x38ce55['attributes']:_0x14f9f4['model'];if(!_0x1a5a14['query'][_0x1f15('0x32')](_0x1f15('0x33'))){_0x38ce55[_0x1f15('0x1c')]=qs[_0x1f15('0x1c')](_0x1a5a14['query'][_0x1f15('0x1c')]);_0x38ce55['offset']=qs[_0x1f15('0x19')](_0x1a5a14[_0x1f15('0x2d')][_0x1f15('0x19')]);}_0x38ce55[_0x1f15('0x34')]=qs[_0x1f15('0x35')](_0x1a5a14[_0x1f15('0x2d')]['sort']);_0x38ce55[_0x1f15('0x36')]=qs[_0x1f15('0x37')](_['pick'](_0x1a5a14[_0x1f15('0x2d')],_0x14f9f4[_0x1f15('0x37')]),_0x51b054);if(_0x1a5a14[_0x1f15('0x2d')]['filter']){_0x38ce55[_0x1f15('0x36')]=_[_0x1f15('0x38')](_0x38ce55['where'],{'$or':_['map'](_0x51b054,function(_0x327db9){if(_0x327db9[_0x1f15('0x2a')]!=='VIRTUAL'){var _0x21785a={};_0x21785a[_0x327db9[_0x1f15('0x24')]]={'$like':'%'+_0x1a5a14['query'][_0x1f15('0x39')]+'%'};return _0x21785a;}})});}_0x38ce55=_[_0x1f15('0x38')]({},_0x38ce55,_0x1a5a14['options']);var _0x112b38={'where':_0x38ce55['where']};return db['FreshdeskAccount']['count'](_0x112b38)['then'](function(_0x3f19b9){_0x15b68f[_0x1f15('0x1b')]=_0x3f19b9;if(_0x1a5a14[_0x1f15('0x2d')][_0x1f15('0x3a')]){_0x38ce55[_0x1f15('0x3b')]=[{'all':!![]}];}return db['FreshdeskAccount']['findAll'](_0x38ce55);})[_0x1f15('0x22')](function(_0x5f049a){_0x15b68f[_0x1f15('0x3c')]=_0x5f049a;return _0x15b68f;})['then'](respondWithFilteredResult(_0x4be862,_0x38ce55))[_0x1f15('0x3d')](handleError(_0x4be862,null));};exports[_0x1f15('0x3e')]=function(_0xadb025,_0x17947b){var _0x5a6ad4={'raw':![],'where':{'id':_0xadb025[_0x1f15('0x3f')]['id']}},_0x3de951={};_0x3de951[_0x1f15('0x2c')]=_[_0x1f15('0x2e')](db['FreshdeskAccount'][_0x1f15('0x28')]);_0x3de951[_0x1f15('0x2d')]=_['keys'](_0xadb025[_0x1f15('0x2d')]);_0x3de951['filters']=_[_0x1f15('0x2f')](_0x3de951[_0x1f15('0x2c')],_0x3de951[_0x1f15('0x2d')]);_0x5a6ad4[_0x1f15('0x30')]=_[_0x1f15('0x2f')](_0x3de951[_0x1f15('0x2c')],qs[_0x1f15('0x31')](_0xadb025[_0x1f15('0x2d')][_0x1f15('0x31')]));_0x5a6ad4['attributes']=_0x5a6ad4[_0x1f15('0x30')][_0x1f15('0x40')]?_0x5a6ad4['attributes']:_0x3de951[_0x1f15('0x2c')];if(_0xadb025[_0x1f15('0x2d')][_0x1f15('0x3a')]){_0x5a6ad4['include']=[{'all':!![]}];}_0x5a6ad4=_[_0x1f15('0x38')]({},_0x5a6ad4,_0xadb025[_0x1f15('0x41')]);return db['FreshdeskAccount'][_0x1f15('0x42')](_0x5a6ad4)['then'](handleEntityNotFound(_0x17947b,null))[_0x1f15('0x22')](respondWithResult(_0x17947b,null))[_0x1f15('0x3d')](handleError(_0x17947b,null));};exports[_0x1f15('0x43')]=function(_0x655f34,_0x54858b){return db[_0x1f15('0x44')][_0x1f15('0x43')](_0x655f34[_0x1f15('0x45')],{})[_0x1f15('0x22')](respondWithResult(_0x54858b,0xc9))[_0x1f15('0x3d')](handleError(_0x54858b,null));};exports[_0x1f15('0x21')]=function(_0x391332,_0x2cbcb7){if(_0x391332[_0x1f15('0x45')]['id']){delete _0x391332['body']['id'];}return db[_0x1f15('0x44')][_0x1f15('0x42')]({'where':{'id':_0x391332['params']['id']}})[_0x1f15('0x22')](handleEntityNotFound(_0x2cbcb7,null))[_0x1f15('0x22')](saveUpdates(_0x391332[_0x1f15('0x45')],null))[_0x1f15('0x22')](respondWithResult(_0x2cbcb7,null))[_0x1f15('0x3d')](handleError(_0x2cbcb7,null));};exports['destroy']=function(_0x253ef7,_0x3c1429){return db[_0x1f15('0x44')][_0x1f15('0x42')]({'where':{'id':_0x253ef7[_0x1f15('0x3f')]['id']}})[_0x1f15('0x22')](handleEntityNotFound(_0x3c1429,null))['then'](removeEntity(_0x3c1429,null))[_0x1f15('0x3d')](handleError(_0x3c1429,null));};exports[_0x1f15('0x46')]=function(_0xc27f39,_0x3ad899,_0x1e9291){var _0xfc9a74={};var _0x43cdb8={};var _0x4a5f00;var _0x499779;return db[_0x1f15('0x44')][_0x1f15('0x47')]({'where':{'id':_0xc27f39[_0x1f15('0x3f')]['id']}})[_0x1f15('0x22')](handleEntityNotFound(_0x3ad899,null))[_0x1f15('0x22')](function(_0x18e508){if(_0x18e508){_0x4a5f00=_0x18e508;_0x43cdb8['model']=_[_0x1f15('0x2e')](db[_0x1f15('0x48')][_0x1f15('0x28')]);_0x43cdb8['query']=_['keys'](_0xc27f39[_0x1f15('0x2d')]);_0x43cdb8[_0x1f15('0x37')]=_['intersection'](_0x43cdb8[_0x1f15('0x2c')],_0x43cdb8['query']);_0xfc9a74['attributes']=_[_0x1f15('0x2f')](_0x43cdb8[_0x1f15('0x2c')],qs[_0x1f15('0x31')](_0xc27f39[_0x1f15('0x2d')]['fields']));_0xfc9a74[_0x1f15('0x30')]=_0xfc9a74[_0x1f15('0x30')]['length']?_0xfc9a74[_0x1f15('0x30')]:_0x43cdb8[_0x1f15('0x2c')];_0xfc9a74[_0x1f15('0x34')]=qs[_0x1f15('0x35')](_0xc27f39[_0x1f15('0x2d')][_0x1f15('0x35')]);_0xfc9a74[_0x1f15('0x36')]=qs[_0x1f15('0x37')](_[_0x1f15('0x49')](_0xc27f39[_0x1f15('0x2d')],_0x43cdb8[_0x1f15('0x37')]));if(_0xc27f39[_0x1f15('0x2d')]['filter']){_0xfc9a74['where']=_[_0x1f15('0x38')](_0xfc9a74[_0x1f15('0x36')],{'$or':_['map'](_0xfc9a74[_0x1f15('0x30')],function(_0xaa82e8){var _0x3400cd={};_0x3400cd[_0xaa82e8]={'$like':'%'+_0xc27f39[_0x1f15('0x2d')]['filter']+'%'};return _0x3400cd;})});}_0xfc9a74=_[_0x1f15('0x38')]({},_0xfc9a74,_0xc27f39[_0x1f15('0x41')]);return _0x4a5f00['getConfigurations'](_0xfc9a74);}})[_0x1f15('0x22')](function(_0x2ac5a7){if(_0x2ac5a7){_0x499779=_0x2ac5a7['length'];if(!_0xc27f39[_0x1f15('0x2d')]['hasOwnProperty'](_0x1f15('0x33'))){_0xfc9a74[_0x1f15('0x1c')]=qs[_0x1f15('0x1c')](_0xc27f39[_0x1f15('0x2d')][_0x1f15('0x1c')]);_0xfc9a74['offset']=qs[_0x1f15('0x19')](_0xc27f39['query']['offset']);}return _0x4a5f00[_0x1f15('0x46')](_0xfc9a74);}})[_0x1f15('0x22')](function(_0x487f62){if(_0x487f62){return _0x487f62?{'count':_0x499779,'rows':_0x487f62}:null;}})[_0x1f15('0x22')](respondWithResult(_0x3ad899,null))[_0x1f15('0x3d')](handleError(_0x3ad899,null));};exports[_0x1f15('0x4a')]=function(_0x437397,_0x524ebb,_0x273d42){if(_0x437397[_0x1f15('0x45')]['id']){delete _0x437397[_0x1f15('0x45')]['id'];}return db['FreshdeskAccount'][_0x1f15('0x47')]({'where':{'id':_0x437397[_0x1f15('0x3f')]['id']}})[_0x1f15('0x22')](handleEntityNotFound(_0x524ebb,null))[_0x1f15('0x22')](function(_0x2f7621){if(_0x2f7621){_0x437397[_0x1f15('0x45')][_0x1f15('0x4b')]=_0x2f7621['id'];_0x437397[_0x1f15('0x45')][_0x1f15('0x4c')]=integrations[_0x1f15('0x4d')](_0x437397[_0x1f15('0x45')][_0x1f15('0x4e')],_0x437397[_0x1f15('0x45')]['type']);_0x437397[_0x1f15('0x45')][_0x1f15('0x4f')]=integrations['getDescriptions'](_0x437397['body'][_0x1f15('0x4e')],_0x437397[_0x1f15('0x45')][_0x1f15('0x2a')]);return db['FreshdeskConfiguration'][_0x1f15('0x43')](_0x437397[_0x1f15('0x45')],{'include':[{'model':db['FreshdeskField'],'as':_0x1f15('0x4c')},{'model':db[_0x1f15('0x50')],'as':_0x1f15('0x4f')}]});}return null;})[_0x1f15('0x22')](respondWithResult(_0x524ebb,null))['catch'](handleError(_0x524ebb,null));};exports['getFields']=function(_0x2b8711,_0xa7307f,_0x2e06d1){var _0x5a2a13='';return db[_0x1f15('0x44')][_0x1f15('0x47')]({'where':{'id':_0x2b8711[_0x1f15('0x3f')]['id']},'attributes':['id',_0x1f15('0x51'),_0x1f15('0x52')]})['then'](handleEntityNotFound(_0xa7307f,null))['then'](function(_0x5e313f){if(_0x5e313f){_0x5a2a13=_0x5e313f[_0x1f15('0x51')];var _0x57e2c4=_0x5a2a13[_0x1f15('0x53')](-0x1);if(_0x57e2c4==='/'){_0x5a2a13=_0x5a2a13[_0x1f15('0x54')](0x0,_0x5a2a13['lastIndexOf'](_0x57e2c4));}return rp({'method':_0x1f15('0x55'),'uri':util[_0x1f15('0x56')](_0x1f15('0x57'),_0x5a2a13,_0x1f15('0x58')),'headers':{'Authorization':util[_0x1f15('0x56')](_0x1f15('0x59'),new Buffer(util['format'](_0x1f15('0x5a'),_0x5e313f[_0x1f15('0x52')]))[_0x1f15('0x5b')]('base64'))},'json':!![]});}})[_0x1f15('0x22')](function(_0x399eb7){if(_0x399eb7){var _0x5a72c1=[_0x1f15('0x5c'),'subject','agent',_0x1f15('0x5d'),_0x1f15('0x16'),'priority',_0x1f15('0x5e'),_0x1f15('0x5f'),_0x1f15('0x60'),_0x1f15('0x5e'),_0x1f15('0x61')];_[_0x1f15('0x62')](_0x399eb7,function(_0x560e5f){return _0x5a72c1[_0x1f15('0x63')](_0x560e5f[_0x1f15('0x24')])||!_0x560e5f[_0x1f15('0x64')]&&_0x560e5f[_0x1f15('0x2a')]!=='custom_text'&&_0x560e5f['type']!==_0x1f15('0x65');});return{'count':_0x399eb7[_0x1f15('0x40')],'rows':_['map'](_0x399eb7,function(_0x37363b){return{'id':_0x37363b[_0x1f15('0x24')],'name':_0x37363b[_0x1f15('0x66')],'custom':!_0x37363b[_0x1f15('0x64')],'options':_0x37363b[_0x1f15('0x67')]?_[_0x1f15('0x27')](_0x37363b['choices'],function(_0x4a2b32){return{'name':_[_0x1f15('0x68')](_0x4a2b32),'value':_0x4a2b32};}):[]};})};}})[_0x1f15('0x22')](respondWithResult(_0xa7307f,null))[_0x1f15('0x3d')](function(_0x481f5f){var _0x46afff=_0x2b8711[_0x1f15('0x2d')][_0x1f15('0x69')]?0x1f4:_0x481f5f[_0x1f15('0x6a')]||0x1f4;logger[_0x1f15('0x23')]('getFields,\x20%s,\x20%s,\x20%s',_0x1f15('0x6b'),_0x46afff,JSON[_0x1f15('0x6c')](_0x481f5f));delete _0x481f5f[_0x1f15('0x24')];if(_0x46afff===0x191){_0x46afff=0x190;}_0xa7307f[_0x1f15('0x16')](_0x46afff)[_0x1f15('0x25')](_0x2b8711[_0x1f15('0x2d')][_0x1f15('0x69')]?{'message':'Wrong\x20credentials','statusCode':_0x481f5f[_0x1f15('0x6a')]}:_0x481f5f);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 5c5f442..ae65c9c 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 _0x8d40=['moment','request-promise','rimraf','../../config/environment','FreshdeskAccount','lodash','util','../../config/logger'];(function(_0x332a78,_0x4d38b3){var _0x537ac5=function(_0x1a7526){while(--_0x1a7526){_0x332a78['push'](_0x332a78['shift']());}};_0x537ac5(++_0x4d38b3);}(_0x8d40,0x1b5));var _0x08d4=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x8d40[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x08d4('0x0'));var util=require(_0x08d4('0x1'));var logger=require(_0x08d4('0x2'))('api');var moment=require(_0x08d4('0x3'));var BPromise=require('bluebird');var rp=require(_0x08d4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x08d4('0x5'));var config=require(_0x08d4('0x6'));var attributes=require('./intFreshdeskAccount.attributes');var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x1c95d7,_0x31c08d){return _0x1c95d7['define'](_0x08d4('0x7'),attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x38b7=['../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','FreshdeskAccount','int_freshdesk_accounts','util','api','request-promise','path','rimraf'];(function(_0x5bf122,_0x27987e){var _0x4dd339=function(_0x32293a){while(--_0x32293a){_0x5bf122['push'](_0x5bf122['shift']());}};_0x4dd339(++_0x27987e);}(_0x38b7,0x19f));var _0x738b=function(_0x28b381,_0x5a33d0){_0x28b381=_0x28b381-0x0;var _0x45b42a=_0x38b7[_0x28b381];return _0x45b42a;};'use strict';var _=require('lodash');var util=require(_0x738b('0x0'));var logger=require('../../config/logger')(_0x738b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x738b('0x2'));var fs=require('fs');var path=require(_0x738b('0x3'));var rimraf=require(_0x738b('0x4'));var config=require(_0x738b('0x5'));var attributes=require(_0x738b('0x6'));var integrations=require(_0x738b('0x7'));module[_0x738b('0x8')]=function(_0x5a403b,_0x32e5cd){return _0x5a403b[_0x738b('0x9')](_0x738b('0xa'),attributes,{'tableName':_0x738b('0xb'),'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 c617a1a..9aef833 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 _0x485d=['options','raw','where','attributes','limit','include','map','model','then','stringify','ShowFreshdeskAccount','FreshdeskAccount','find','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetFreshdeskAccount','findAll'];(function(_0x3a7db6,_0x40cdad){var _0x22c793=function(_0x5546d0){while(--_0x5546d0){_0x3a7db6['push'](_0x3a7db6['shift']());}};_0x22c793(++_0x40cdad);}(_0x485d,0xd3));var _0xd485=function(_0x1c510a,_0x1413a9){_0x1c510a=_0x1c510a-0x0;var _0x23cedd=_0x485d[_0x1c510a];return _0x23cedd;};'use strict';var _=require(_0xd485('0x0'));var util=require(_0xd485('0x1'));var moment=require('moment');var BPromise=require(_0xd485('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd485('0x3'));var db=require(_0xd485('0x4'))['db'];var utils=require(_0xd485('0x5'));var logger=require('../../config/logger')(_0xd485('0x6'));var config=require(_0xd485('0x7'));var jayson=require(_0xd485('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x45c192,_0x275462,_0x56d506){return new BPromise(function(_0x2412a6,_0x3f867f){return client['request'](_0x45c192,_0x56d506)['then'](function(_0x22173e){logger[_0xd485('0x9')](_0xd485('0xa'),_0x275462,_0xd485('0xb'));logger[_0xd485('0xc')](_0xd485('0xd'),_0x275462,_0xd485('0xb'),JSON['stringify'](_0x22173e));if(_0x22173e[_0xd485('0xe')]){if(_0x22173e['error']['code']===0x1f4){logger[_0xd485('0xe')](_0xd485('0xa'),_0x275462,_0x22173e[_0xd485('0xe')][_0xd485('0xf')]);return _0x3f867f(_0x22173e[_0xd485('0xe')][_0xd485('0xf')]);}logger['error'](_0xd485('0xa'),_0x275462,_0x22173e['error'][_0xd485('0xf')]);return _0x2412a6(_0x22173e[_0xd485('0xe')][_0xd485('0xf')]);}else{logger[_0xd485('0x9')](_0xd485('0xa'),_0x275462,'request\x20sent');_0x2412a6(_0x22173e[_0xd485('0x10')][_0xd485('0xf')]);}})[_0xd485('0x11')](function(_0x43a8e0){logger['error'](_0xd485('0xa'),_0x275462,_0x43a8e0);_0x3f867f(_0x43a8e0);});});}exports[_0xd485('0x12')]=function(_0x12e6c5){var _0x163b79=this;return new Promise(function(_0x5f474a,_0x108f6c){return db['FreshdeskAccount'][_0xd485('0x13')]({'raw':_0x12e6c5[_0xd485('0x14')]?_0x12e6c5[_0xd485('0x14')][_0xd485('0x15')]===undefined?!![]:![]:!![],'where':_0x12e6c5[_0xd485('0x14')]?_0x12e6c5[_0xd485('0x14')][_0xd485('0x16')]||null:null,'attributes':_0x12e6c5[_0xd485('0x14')]?_0x12e6c5[_0xd485('0x14')][_0xd485('0x17')]||null:null,'limit':_0x12e6c5['options']?_0x12e6c5[_0xd485('0x14')][_0xd485('0x18')]||null:null,'include':_0x12e6c5[_0xd485('0x14')]?_0x12e6c5['options'][_0xd485('0x19')]?_[_0xd485('0x1a')](_0x12e6c5[_0xd485('0x14')][_0xd485('0x19')],function(_0x4d8067){return{'model':db[_0x4d8067[_0xd485('0x1b')]],'as':_0x4d8067['as'],'attributes':_0x4d8067[_0xd485('0x17')],'include':_0x4d8067[_0xd485('0x19')]?_[_0xd485('0x1a')](_0x4d8067[_0xd485('0x19')],function(_0x33016e){return{'model':db[_0x33016e[_0xd485('0x1b')]],'as':_0x33016e['as'],'attributes':_0x33016e[_0xd485('0x17')],'include':_0x33016e[_0xd485('0x19')]?_[_0xd485('0x1a')](_0x33016e[_0xd485('0x19')],function(_0x16058e){return{'model':db[_0x16058e[_0xd485('0x1b')]],'as':_0x16058e['as'],'attributes':_0x16058e[_0xd485('0x17')]};}):[]};}):[]};}):[]:[]})[_0xd485('0x1c')](function(_0x4af8d1){logger['info']('GetFreshdeskAccount',_0x12e6c5);logger[_0xd485('0xc')]('GetFreshdeskAccount',_0x12e6c5,JSON[_0xd485('0x1d')](_0x4af8d1));_0x5f474a(_0x4af8d1);})[_0xd485('0x11')](function(_0x2824af){logger[_0xd485('0xe')](_0xd485('0x12'),_0x2824af['message'],_0x12e6c5);_0x108f6c(_0x163b79['error'](0x1f4,_0x2824af[_0xd485('0xf')]));});});};exports[_0xd485('0x1e')]=function(_0x505fdc){var _0x498b73=this;return new Promise(function(_0x27441d,_0x836f7a){return db[_0xd485('0x1f')][_0xd485('0x20')]({'raw':_0x505fdc[_0xd485('0x14')]?_0x505fdc[_0xd485('0x14')][_0xd485('0x15')]===undefined?!![]:![]:!![],'where':_0x505fdc[_0xd485('0x14')]?_0x505fdc[_0xd485('0x14')][_0xd485('0x16')]||null:null,'attributes':_0x505fdc[_0xd485('0x14')]?_0x505fdc[_0xd485('0x14')][_0xd485('0x17')]||null:null,'include':_0x505fdc[_0xd485('0x14')]?_0x505fdc[_0xd485('0x14')][_0xd485('0x19')]?_['map'](_0x505fdc[_0xd485('0x14')][_0xd485('0x19')],function(_0x5e29a0){return{'model':db[_0x5e29a0['model']],'as':_0x5e29a0['as'],'attributes':_0x5e29a0[_0xd485('0x17')],'include':_0x5e29a0['include']?_[_0xd485('0x1a')](_0x5e29a0['include'],function(_0x5965f8){return{'model':db[_0x5965f8[_0xd485('0x1b')]],'as':_0x5965f8['as'],'attributes':_0x5965f8[_0xd485('0x17')],'include':_0x5965f8[_0xd485('0x19')]?_['map'](_0x5965f8[_0xd485('0x19')],function(_0x296bed){return{'model':db[_0x296bed['model']],'as':_0x296bed['as'],'attributes':_0x296bed[_0xd485('0x17')]};}):[]};}):[]};}):[]:[]})[_0xd485('0x1c')](function(_0x389725){logger[_0xd485('0x9')](_0xd485('0x1e'),_0x505fdc);logger['debug'](_0xd485('0x1e'),_0x505fdc,JSON['stringify'](_0x389725));_0x27441d(_0x389725);})[_0xd485('0x11')](function(_0x18af0d){logger[_0xd485('0xe')](_0xd485('0x1e'),_0x18af0d[_0xd485('0xf')],_0x505fdc);_0x836f7a(_0x498b73['error'](0x1f4,_0x18af0d['message']));});});}; \ No newline at end of file +var _0x3228=['lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetFreshdeskAccount','FreshdeskAccount','options','raw','where','limit','include','map','model','attributes','ShowFreshdeskAccount','find'];(function(_0x5c5a25,_0x5efcb9){var _0x1018bd=function(_0xf35926){while(--_0xf35926){_0x5c5a25['push'](_0x5c5a25['shift']());}};_0x1018bd(++_0x5efcb9);}(_0x3228,0x181));var _0x8322=function(_0x2545b2,_0x5b8952){_0x2545b2=_0x2545b2-0x0;var _0x432c87=_0x3228[_0x2545b2];return _0x432c87;};'use strict';var _=require(_0x8322('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8322('0x1'));var rs=require(_0x8322('0x2'));var fs=require('fs');var Redis=require(_0x8322('0x3'));var db=require(_0x8322('0x4'))['db'];var utils=require(_0x8322('0x5'));var logger=require(_0x8322('0x6'))(_0x8322('0x7'));var config=require(_0x8322('0x8'));var jayson=require(_0x8322('0x9'));var client=jayson['client'][_0x8322('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d7870,_0x589881,_0xec133e){return new BPromise(function(_0x140394,_0x3b3bb9){return client[_0x8322('0xb')](_0x1d7870,_0xec133e)[_0x8322('0xc')](function(_0x288ee8){logger[_0x8322('0xd')](_0x8322('0xe'),_0x589881,_0x8322('0xf'));logger[_0x8322('0x10')](_0x8322('0x11'),_0x589881,'request\x20sent',JSON['stringify'](_0x288ee8));if(_0x288ee8[_0x8322('0x12')]){if(_0x288ee8[_0x8322('0x12')][_0x8322('0x13')]===0x1f4){logger[_0x8322('0x12')](_0x8322('0xe'),_0x589881,_0x288ee8[_0x8322('0x12')][_0x8322('0x14')]);return _0x3b3bb9(_0x288ee8[_0x8322('0x12')][_0x8322('0x14')]);}logger[_0x8322('0x12')](_0x8322('0xe'),_0x589881,_0x288ee8[_0x8322('0x12')][_0x8322('0x14')]);return _0x140394(_0x288ee8[_0x8322('0x12')][_0x8322('0x14')]);}else{logger[_0x8322('0xd')](_0x8322('0xe'),_0x589881,_0x8322('0xf'));_0x140394(_0x288ee8[_0x8322('0x15')]['message']);}})[_0x8322('0x16')](function(_0x57e80c){logger[_0x8322('0x12')](_0x8322('0xe'),_0x589881,_0x57e80c);_0x3b3bb9(_0x57e80c);});});}exports[_0x8322('0x17')]=function(_0x4712af){var _0x247bb0=this;return new Promise(function(_0x19ad17,_0x193b1f){return db[_0x8322('0x18')]['findAll']({'raw':_0x4712af[_0x8322('0x19')]?_0x4712af[_0x8322('0x19')][_0x8322('0x1a')]===undefined?!![]:![]:!![],'where':_0x4712af[_0x8322('0x19')]?_0x4712af[_0x8322('0x19')][_0x8322('0x1b')]||null:null,'attributes':_0x4712af[_0x8322('0x19')]?_0x4712af['options']['attributes']||null:null,'limit':_0x4712af['options']?_0x4712af[_0x8322('0x19')][_0x8322('0x1c')]||null:null,'include':_0x4712af[_0x8322('0x19')]?_0x4712af[_0x8322('0x19')][_0x8322('0x1d')]?_[_0x8322('0x1e')](_0x4712af[_0x8322('0x19')][_0x8322('0x1d')],function(_0x35792b){return{'model':db[_0x35792b[_0x8322('0x1f')]],'as':_0x35792b['as'],'attributes':_0x35792b[_0x8322('0x20')],'include':_0x35792b[_0x8322('0x1d')]?_[_0x8322('0x1e')](_0x35792b[_0x8322('0x1d')],function(_0x5506af){return{'model':db[_0x5506af[_0x8322('0x1f')]],'as':_0x5506af['as'],'attributes':_0x5506af[_0x8322('0x20')],'include':_0x5506af[_0x8322('0x1d')]?_[_0x8322('0x1e')](_0x5506af[_0x8322('0x1d')],function(_0x5757b7){return{'model':db[_0x5757b7[_0x8322('0x1f')]],'as':_0x5757b7['as'],'attributes':_0x5757b7[_0x8322('0x20')]};}):[]};}):[]};}):[]:[]})[_0x8322('0xc')](function(_0x33bc26){logger[_0x8322('0xd')]('GetFreshdeskAccount',_0x4712af);logger['debug'](_0x8322('0x17'),_0x4712af,JSON['stringify'](_0x33bc26));_0x19ad17(_0x33bc26);})[_0x8322('0x16')](function(_0x516e85){logger[_0x8322('0x12')](_0x8322('0x17'),_0x516e85['message'],_0x4712af);_0x193b1f(_0x247bb0[_0x8322('0x12')](0x1f4,_0x516e85[_0x8322('0x14')]));});});};exports[_0x8322('0x21')]=function(_0x169759){var _0x2b9e74=this;return new Promise(function(_0x36130a,_0xae1974){return db[_0x8322('0x18')][_0x8322('0x22')]({'raw':_0x169759[_0x8322('0x19')]?_0x169759[_0x8322('0x19')][_0x8322('0x1a')]===undefined?!![]:![]:!![],'where':_0x169759[_0x8322('0x19')]?_0x169759[_0x8322('0x19')][_0x8322('0x1b')]||null:null,'attributes':_0x169759[_0x8322('0x19')]?_0x169759['options'][_0x8322('0x20')]||null:null,'include':_0x169759['options']?_0x169759[_0x8322('0x19')][_0x8322('0x1d')]?_['map'](_0x169759[_0x8322('0x19')][_0x8322('0x1d')],function(_0x1cdeef){return{'model':db[_0x1cdeef[_0x8322('0x1f')]],'as':_0x1cdeef['as'],'attributes':_0x1cdeef[_0x8322('0x20')],'include':_0x1cdeef['include']?_[_0x8322('0x1e')](_0x1cdeef[_0x8322('0x1d')],function(_0x3b85b0){return{'model':db[_0x3b85b0[_0x8322('0x1f')]],'as':_0x3b85b0['as'],'attributes':_0x3b85b0[_0x8322('0x20')],'include':_0x3b85b0[_0x8322('0x1d')]?_[_0x8322('0x1e')](_0x3b85b0[_0x8322('0x1d')],function(_0x48d137){return{'model':db[_0x48d137[_0x8322('0x1f')]],'as':_0x48d137['as'],'attributes':_0x48d137[_0x8322('0x20')]};}):[]};}):[]};}):[]:[]})[_0x8322('0xc')](function(_0x5cc468){logger[_0x8322('0xd')]('ShowFreshdeskAccount',_0x169759);logger[_0x8322('0x10')](_0x8322('0x21'),_0x169759,JSON['stringify'](_0x5cc468));_0x36130a(_0x5cc468);})[_0x8322('0x16')](function(_0x872e13){logger[_0x8322('0x12')](_0x8322('0x21'),_0x872e13[_0x8322('0x14')],_0x169759);_0xae1974(_0x2b9e74[_0x8322('0x12')](0x1f4,_0x872e13[_0x8322('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 305ad6b..6e057ea 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 _0xdce6=['/:id','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','setTags','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','./intFreshdeskConfiguration.controller','get','isAuthenticated'];(function(_0x3f22df,_0x81013){var _0x17ae59=function(_0x56cd8f){while(--_0x56cd8f){_0x3f22df['push'](_0x3f22df['shift']());}};_0x17ae59(++_0x81013);}(_0xdce6,0x16d));var _0x6dce=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xdce6[_0x1035c1];return _0x308d67;};'use strict';var multer=require(_0x6dce('0x0'));var util=require(_0x6dce('0x1'));var path=require(_0x6dce('0x2'));var timeout=require(_0x6dce('0x3'));var express=require(_0x6dce('0x4'));var router=express['Router']();var fs_extra=require(_0x6dce('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6dce('0x6'));var config=require('../../config/environment');var controller=require(_0x6dce('0x7'));router[_0x6dce('0x8')]('/',auth[_0x6dce('0x9')](),controller['index']);router['get'](_0x6dce('0xa'),auth[_0x6dce('0x9')](),controller['show']);router[_0x6dce('0x8')](_0x6dce('0xb'),auth[_0x6dce('0x9')](),controller[_0x6dce('0xc')]);router[_0x6dce('0x8')](_0x6dce('0xd'),auth['isAuthenticated'](),controller[_0x6dce('0xe')]);router[_0x6dce('0x8')](_0x6dce('0xf'),auth[_0x6dce('0x9')](),controller[_0x6dce('0x10')]);router[_0x6dce('0x8')](_0x6dce('0x11'),auth[_0x6dce('0x9')](),controller[_0x6dce('0x12')]);router[_0x6dce('0x13')]('/',auth[_0x6dce('0x9')](),controller[_0x6dce('0x14')]);router['post'](_0x6dce('0x11'),auth['isAuthenticated'](),controller[_0x6dce('0x15')]);router['put'](_0x6dce('0xa'),auth[_0x6dce('0x9')](),controller[_0x6dce('0x16')]);router['delete'](_0x6dce('0xa'),auth['isAuthenticated'](),controller[_0x6dce('0x17')]);module[_0x6dce('0x18')]=router; \ No newline at end of file +var _0x9123=['../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','index','isAuthenticated','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','create','setTags','put','/:id','update','destroy','multer','connect-timeout','express','Router','../../components/auth/service'];(function(_0x14413f,_0x2674df){var _0x3bd248=function(_0x42dc89){while(--_0x42dc89){_0x14413f['push'](_0x14413f['shift']());}};_0x3bd248(++_0x2674df);}(_0x9123,0x1f3));var _0x3912=function(_0x47c76b,_0x122c34){_0x47c76b=_0x47c76b-0x0;var _0x5f305a=_0x9123[_0x47c76b];return _0x5f305a;};'use strict';var multer=require(_0x3912('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3912('0x1'));var express=require(_0x3912('0x2'));var router=express[_0x3912('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x3912('0x4'));var interaction=require(_0x3912('0x5'));var config=require(_0x3912('0x6'));var controller=require(_0x3912('0x7'));router[_0x3912('0x8')]('/',auth['isAuthenticated'](),controller[_0x3912('0x9')]);router['get']('/:id',auth[_0x3912('0xa')](),controller['show']);router[_0x3912('0x8')](_0x3912('0xb'),auth[_0x3912('0xa')](),controller['getFields']);router[_0x3912('0x8')](_0x3912('0xc'),auth[_0x3912('0xa')](),controller[_0x3912('0xd')]);router[_0x3912('0x8')](_0x3912('0xe'),auth[_0x3912('0xa')](),controller[_0x3912('0xf')]);router[_0x3912('0x8')](_0x3912('0x10'),auth['isAuthenticated'](),controller[_0x3912('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0x3912('0x12')]);router['post'](_0x3912('0x10'),auth[_0x3912('0xa')](),controller[_0x3912('0x13')]);router[_0x3912('0x14')](_0x3912('0x15'),auth['isAuthenticated'](),controller[_0x3912('0x16')]);router['delete']('/:id',auth[_0x3912('0xa')](),controller[_0x3912('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 5e56efc..ccfbff7 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 _0xbe3c=['sequelize','exports','STRING'];(function(_0x170a52,_0x40acf4){var _0x4295a2=function(_0x48b043){while(--_0x48b043){_0x170a52['push'](_0x170a52['shift']());}};_0x4295a2(++_0x40acf4);}(_0xbe3c,0x1ec));var _0xcbe3=function(_0x337e47,_0x3ef503){_0x337e47=_0x337e47-0x0;var _0xe18c2e=_0xbe3c[_0x337e47];return _0xe18c2e;};'use strict';var Sequelize=require(_0xcbe3('0x0'));module[_0xcbe3('0x1')]={'name':{'type':Sequelize[_0xcbe3('0x2')]},'description':{'type':Sequelize[_0xcbe3('0x2')]}}; \ No newline at end of file +var _0x151a=['sequelize','exports','STRING'];(function(_0x55b75e,_0x23e1dc){var _0x1909b1=function(_0x4152ed){while(--_0x4152ed){_0x55b75e['push'](_0x55b75e['shift']());}};_0x1909b1(++_0x23e1dc);}(_0x151a,0x1b0));var _0xa151=function(_0xe61544,_0x30b2d2){_0xe61544=_0xe61544-0x0;var _0x58cc3e=_0x151a[_0xe61544];return _0x58cc3e;};'use strict';var Sequelize=require(_0xa151('0x0'));module[_0xa151('0x1')]={'name':{'type':Sequelize[_0xa151('0x2')]},'description':{'type':Sequelize[_0xa151('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index a60b5d1..990c157 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 _0x9339=['rows','show','keys','find','catch','create','body','params','getFields','FreshdeskField','length','hasOwnProperty','getSubjects','getDescriptions','getTags','findOne','Tag','setTags','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','send','map','FreshdeskConfiguration','rawAttributes','type','key','name','query','filters','intersection','model','attributes','fields','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll'];(function(_0x48863d,_0xb57402){var _0x16c8f1=function(_0xbc21a4){while(--_0xbc21a4){_0x48863d['push'](_0x48863d['shift']());}};_0x16c8f1(++_0xb57402);}(_0x9339,0x111));var _0x9933=function(_0x403c20,_0x4a7b99){_0x403c20=_0x403c20-0x0;var _0x2b271a=_0x9339[_0x403c20];return _0x2b271a;};'use strict';var emlformat=require(_0x9933('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9933('0x1'));var rp=require(_0x9933('0x2'));var moment=require(_0x9933('0x3'));var BPromise=require(_0x9933('0x4'));var Mustache=require(_0x9933('0x5'));var util=require(_0x9933('0x6'));var path=require(_0x9933('0x7'));var sox=require(_0x9933('0x8'));var csv=require(_0x9933('0x9'));var ejs=require(_0x9933('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9933('0xb'));var squel=require(_0x9933('0xc'));var crypto=require(_0x9933('0xd'));var jsforce=require(_0x9933('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x9933('0x9'));var querystring=require(_0x9933('0xf'));var Papa=require(_0x9933('0x10'));var Redis=require(_0x9933('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x9933('0x12'));var as=require(_0x9933('0x13'));var hardwareService=require(_0x9933('0x14'));var logger=require(_0x9933('0x15'))(_0x9933('0x16'));var utils=require('../../config/utils');var config=require(_0x9933('0x17'));var licenseUtil=require(_0x9933('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4a2997,_0x2e2810){_0x2e2810=_0x2e2810||0xcc;return function(_0x3ca5b1){if(_0x3ca5b1){return _0x4a2997['sendStatus'](_0x2e2810);}return _0x4a2997[_0x9933('0x19')](_0x2e2810)[_0x9933('0x1a')]();};}function respondWithResult(_0x12de23,_0x1362b){_0x1362b=_0x1362b||0xc8;return function(_0x23f718){if(_0x23f718){return _0x12de23[_0x9933('0x19')](_0x1362b)['json'](_0x23f718);}};}function respondWithFilteredResult(_0x56660a,_0x43fc99){return function(_0xd9b2f4){if(_0xd9b2f4){var _0x52a54a=typeof _0x43fc99[_0x9933('0x1b')]===_0x9933('0x1c')&&typeof _0x43fc99['limit']===_0x9933('0x1c');var _0x5bda44=_0xd9b2f4[_0x9933('0x1d')];var _0xf5c458=_0x52a54a?0x0:_0x43fc99[_0x9933('0x1b')];var _0x5ef246=_0x52a54a?_0xd9b2f4['count']:_0x43fc99[_0x9933('0x1b')]+_0x43fc99[_0x9933('0x1e')];var _0x2105a9;if(_0x5ef246>=_0x5bda44){_0x5ef246=_0x5bda44;_0x2105a9=0xc8;}else{_0x2105a9=0xce;}_0x56660a[_0x9933('0x19')](_0x2105a9);return _0x56660a[_0x9933('0x1f')](_0x9933('0x20'),_0xf5c458+'-'+_0x5ef246+'/'+_0x5bda44)[_0x9933('0x21')](_0xd9b2f4);}return null;};}function patchUpdates(_0x4ef7a5){return function(_0x30b130){try{jsonpatch[_0x9933('0x22')](_0x30b130,_0x4ef7a5,!![]);}catch(_0x4ffeda){return BPromise[_0x9933('0x23')](_0x4ffeda);}return _0x30b130[_0x9933('0x24')]();};}function saveUpdates(_0x2fdf1e,_0x40bd43){return function(_0x461ba7){if(_0x461ba7){return _0x461ba7[_0x9933('0x25')](_0x2fdf1e)[_0x9933('0x26')](function(_0x7e0a80){return _0x7e0a80;});}return null;};}function removeEntity(_0x30729b,_0x265912){return function(_0x4fc42b){if(_0x4fc42b){return _0x4fc42b[_0x9933('0x27')]()[_0x9933('0x26')](function(){_0x30729b[_0x9933('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x49dcf8,_0x3ef085){return function(_0x58d667){if(!_0x58d667){_0x49dcf8['sendStatus'](0x194);}return _0x58d667;};}function handleError(_0x138c2c,_0x198f09){_0x198f09=_0x198f09||0x1f4;return function(_0x5ef126){logger[_0x9933('0x28')](_0x5ef126[_0x9933('0x29')]);if(_0x5ef126['name']){delete _0x5ef126['name'];}_0x138c2c[_0x9933('0x19')](_0x198f09)[_0x9933('0x2a')](_0x5ef126);};}exports['index']=function(_0x363e44,_0x53d5be){var _0x4f582f={},_0x4b92f6={},_0x5b5b78={'count':0x0,'rows':[]};var _0x23bcd5=_[_0x9933('0x2b')](db[_0x9933('0x2c')][_0x9933('0x2d')],function(_0x49eac8){return{'name':_0x49eac8['fieldName'],'type':_0x49eac8[_0x9933('0x2e')][_0x9933('0x2f')]};});_0x4b92f6['model']=_[_0x9933('0x2b')](_0x23bcd5,_0x9933('0x30'));_0x4b92f6[_0x9933('0x31')]=_['keys'](_0x363e44['query']);_0x4b92f6[_0x9933('0x32')]=_[_0x9933('0x33')](_0x4b92f6[_0x9933('0x34')],_0x4b92f6[_0x9933('0x31')]);_0x4f582f[_0x9933('0x35')]=_[_0x9933('0x33')](_0x4b92f6[_0x9933('0x34')],qs[_0x9933('0x36')](_0x363e44[_0x9933('0x31')][_0x9933('0x36')]));_0x4f582f['attributes']=_0x4f582f['attributes']['length']?_0x4f582f['attributes']:_0x4b92f6[_0x9933('0x34')];if(!_0x363e44[_0x9933('0x31')]['hasOwnProperty'](_0x9933('0x37'))){_0x4f582f[_0x9933('0x1e')]=qs[_0x9933('0x1e')](_0x363e44['query']['limit']);_0x4f582f[_0x9933('0x1b')]=qs[_0x9933('0x1b')](_0x363e44['query'][_0x9933('0x1b')]);}_0x4f582f[_0x9933('0x38')]=qs[_0x9933('0x39')](_0x363e44['query']['sort']);_0x4f582f[_0x9933('0x3a')]=qs['filters'](_[_0x9933('0x3b')](_0x363e44[_0x9933('0x31')],_0x4b92f6[_0x9933('0x32')]),_0x23bcd5);if(_0x363e44['query']['filter']){_0x4f582f[_0x9933('0x3a')]=_[_0x9933('0x3c')](_0x4f582f['where'],{'$or':_[_0x9933('0x2b')](_0x23bcd5,function(_0xc9792f){if(_0xc9792f[_0x9933('0x2e')]!==_0x9933('0x3d')){var _0x324157={};_0x324157[_0xc9792f[_0x9933('0x30')]]={'$like':'%'+_0x363e44[_0x9933('0x31')][_0x9933('0x3e')]+'%'};return _0x324157;}})});}_0x4f582f=_[_0x9933('0x3c')]({},_0x4f582f,_0x363e44[_0x9933('0x3f')]);var _0x366405={'where':_0x4f582f['where']};return db[_0x9933('0x2c')][_0x9933('0x1d')](_0x366405)[_0x9933('0x26')](function(_0x2d761f){_0x5b5b78[_0x9933('0x1d')]=_0x2d761f;if(_0x363e44[_0x9933('0x31')][_0x9933('0x40')]){_0x4f582f[_0x9933('0x41')]=[{'all':!![]}];}return db[_0x9933('0x2c')][_0x9933('0x42')](_0x4f582f);})[_0x9933('0x26')](function(_0x5ee3fd){_0x5b5b78[_0x9933('0x43')]=_0x5ee3fd;return _0x5b5b78;})[_0x9933('0x26')](respondWithFilteredResult(_0x53d5be,_0x4f582f))['catch'](handleError(_0x53d5be,null));};exports[_0x9933('0x44')]=function(_0x22ac04,_0x454008){var _0xf17bf9={'raw':![],'where':{'id':_0x22ac04['params']['id']}},_0xbba1c7={};_0xbba1c7['model']=_['keys'](db[_0x9933('0x2c')][_0x9933('0x2d')]);_0xbba1c7[_0x9933('0x31')]=_[_0x9933('0x45')](_0x22ac04['query']);_0xbba1c7[_0x9933('0x32')]=_['intersection'](_0xbba1c7['model'],_0xbba1c7[_0x9933('0x31')]);_0xf17bf9[_0x9933('0x35')]=_[_0x9933('0x33')](_0xbba1c7['model'],qs[_0x9933('0x36')](_0x22ac04[_0x9933('0x31')][_0x9933('0x36')]));_0xf17bf9['attributes']=_0xf17bf9['attributes']['length']?_0xf17bf9[_0x9933('0x35')]:_0xbba1c7[_0x9933('0x34')];if(_0x22ac04[_0x9933('0x31')][_0x9933('0x40')]){_0xf17bf9[_0x9933('0x41')]=[{'all':!![]}];}_0xf17bf9=_[_0x9933('0x3c')]({},_0xf17bf9,_0x22ac04[_0x9933('0x3f')]);return db[_0x9933('0x2c')][_0x9933('0x46')](_0xf17bf9)[_0x9933('0x26')](handleEntityNotFound(_0x454008,null))[_0x9933('0x26')](respondWithResult(_0x454008,null))[_0x9933('0x47')](handleError(_0x454008,null));};exports[_0x9933('0x48')]=function(_0x3c05f7,_0x267151){return db['FreshdeskConfiguration'][_0x9933('0x48')](_0x3c05f7['body'],{})['then'](respondWithResult(_0x267151,0xc9))[_0x9933('0x47')](handleError(_0x267151,null));};exports[_0x9933('0x25')]=function(_0x5af2ac,_0x1270e0){if(_0x5af2ac[_0x9933('0x49')]['id']){delete _0x5af2ac[_0x9933('0x49')]['id'];}return db[_0x9933('0x2c')][_0x9933('0x46')]({'where':{'id':_0x5af2ac[_0x9933('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1270e0,null))[_0x9933('0x26')](saveUpdates(_0x5af2ac[_0x9933('0x49')],null))[_0x9933('0x26')](respondWithResult(_0x1270e0,null))[_0x9933('0x47')](handleError(_0x1270e0,null));};exports[_0x9933('0x27')]=function(_0x29fbb7,_0x13d02c){return db['FreshdeskConfiguration']['find']({'where':{'id':_0x29fbb7['params']['id']}})[_0x9933('0x26')](handleEntityNotFound(_0x13d02c,null))[_0x9933('0x26')](removeEntity(_0x13d02c,null))['catch'](handleError(_0x13d02c,null));};exports[_0x9933('0x4b')]=function(_0x1d865f,_0x3c4ecb,_0x3070ef){var _0x3ba20a={};var _0x229618={};var _0x44d710;var _0x100d10;return db[_0x9933('0x2c')]['findOne']({'where':{'id':_0x1d865f[_0x9933('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3c4ecb,null))[_0x9933('0x26')](function(_0x1896dd){if(_0x1896dd){_0x44d710=_0x1896dd;_0x229618[_0x9933('0x34')]=_[_0x9933('0x45')](db[_0x9933('0x4c')][_0x9933('0x2d')]);_0x229618[_0x9933('0x31')]=_[_0x9933('0x45')](_0x1d865f[_0x9933('0x31')]);_0x229618[_0x9933('0x32')]=_[_0x9933('0x33')](_0x229618[_0x9933('0x34')],_0x229618[_0x9933('0x31')]);_0x3ba20a[_0x9933('0x35')]=_[_0x9933('0x33')](_0x229618[_0x9933('0x34')],qs[_0x9933('0x36')](_0x1d865f[_0x9933('0x31')][_0x9933('0x36')]));_0x3ba20a[_0x9933('0x35')]=_0x3ba20a[_0x9933('0x35')]['length']?_0x3ba20a[_0x9933('0x35')]:_0x229618[_0x9933('0x34')];_0x3ba20a['order']=qs[_0x9933('0x39')](_0x1d865f[_0x9933('0x31')][_0x9933('0x39')]);_0x3ba20a[_0x9933('0x3a')]=qs[_0x9933('0x32')](_[_0x9933('0x3b')](_0x1d865f[_0x9933('0x31')],_0x229618[_0x9933('0x32')]));if(_0x1d865f[_0x9933('0x31')]['filter']){_0x3ba20a[_0x9933('0x3a')]=_['merge'](_0x3ba20a[_0x9933('0x3a')],{'$or':_[_0x9933('0x2b')](_0x3ba20a[_0x9933('0x35')],function(_0x2a0a1b){var _0x2dffed={};_0x2dffed[_0x2a0a1b]={'$like':'%'+_0x1d865f[_0x9933('0x31')][_0x9933('0x3e')]+'%'};return _0x2dffed;})});}_0x3ba20a=_[_0x9933('0x3c')]({},_0x3ba20a,_0x1d865f[_0x9933('0x3f')]);return _0x44d710['getFields'](_0x3ba20a);}})[_0x9933('0x26')](function(_0x1b73f4){if(_0x1b73f4){_0x100d10=_0x1b73f4[_0x9933('0x4d')];if(!_0x1d865f[_0x9933('0x31')][_0x9933('0x4e')](_0x9933('0x37'))){_0x3ba20a[_0x9933('0x1e')]=qs[_0x9933('0x1e')](_0x1d865f[_0x9933('0x31')][_0x9933('0x1e')]);_0x3ba20a[_0x9933('0x1b')]=qs[_0x9933('0x1b')](_0x1d865f[_0x9933('0x31')][_0x9933('0x1b')]);}return _0x44d710[_0x9933('0x4b')](_0x3ba20a);}})[_0x9933('0x26')](function(_0x5f37b0){if(_0x5f37b0){return _0x5f37b0?{'count':_0x100d10,'rows':_0x5f37b0}:null;}})[_0x9933('0x26')](respondWithResult(_0x3c4ecb,null))[_0x9933('0x47')](handleError(_0x3c4ecb,null));};exports[_0x9933('0x4f')]=function(_0x45fd22,_0x5a9505,_0x1e8ceb){var _0x25ab67={};var _0x48ba59={};var _0x3865ec;var _0x4dd62f;return db[_0x9933('0x2c')]['findOne']({'where':{'id':_0x45fd22[_0x9933('0x4a')]['id']}})[_0x9933('0x26')](handleEntityNotFound(_0x5a9505,null))['then'](function(_0x4361f8){if(_0x4361f8){_0x3865ec=_0x4361f8;_0x48ba59['model']=_[_0x9933('0x45')](db[_0x9933('0x4c')][_0x9933('0x2d')]);_0x48ba59['query']=_[_0x9933('0x45')](_0x45fd22[_0x9933('0x31')]);_0x48ba59[_0x9933('0x32')]=_[_0x9933('0x33')](_0x48ba59[_0x9933('0x34')],_0x48ba59[_0x9933('0x31')]);_0x25ab67[_0x9933('0x35')]=_[_0x9933('0x33')](_0x48ba59[_0x9933('0x34')],qs[_0x9933('0x36')](_0x45fd22[_0x9933('0x31')][_0x9933('0x36')]));_0x25ab67[_0x9933('0x35')]=_0x25ab67[_0x9933('0x35')][_0x9933('0x4d')]?_0x25ab67[_0x9933('0x35')]:_0x48ba59[_0x9933('0x34')];_0x25ab67['order']=qs['sort'](_0x45fd22['query'][_0x9933('0x39')]);_0x25ab67[_0x9933('0x3a')]=qs['filters'](_['pick'](_0x45fd22[_0x9933('0x31')],_0x48ba59[_0x9933('0x32')]));if(_0x45fd22[_0x9933('0x31')][_0x9933('0x3e')]){_0x25ab67['where']=_['merge'](_0x25ab67[_0x9933('0x3a')],{'$or':_[_0x9933('0x2b')](_0x25ab67[_0x9933('0x35')],function(_0x115cba){var _0x76927c={};_0x76927c[_0x115cba]={'$like':'%'+_0x45fd22[_0x9933('0x31')][_0x9933('0x3e')]+'%'};return _0x76927c;})});}_0x25ab67=_[_0x9933('0x3c')]({},_0x25ab67,_0x45fd22[_0x9933('0x3f')]);return _0x3865ec[_0x9933('0x4f')](_0x25ab67);}})[_0x9933('0x26')](function(_0x193f5f){if(_0x193f5f){_0x4dd62f=_0x193f5f[_0x9933('0x4d')];if(!_0x45fd22[_0x9933('0x31')][_0x9933('0x4e')](_0x9933('0x37'))){_0x25ab67[_0x9933('0x1e')]=qs[_0x9933('0x1e')](_0x45fd22[_0x9933('0x31')][_0x9933('0x1e')]);_0x25ab67[_0x9933('0x1b')]=qs[_0x9933('0x1b')](_0x45fd22['query'][_0x9933('0x1b')]);}return _0x3865ec[_0x9933('0x4f')](_0x25ab67);}})[_0x9933('0x26')](function(_0x118622){if(_0x118622){return _0x118622?{'count':_0x4dd62f,'rows':_0x118622}:null;}})[_0x9933('0x26')](respondWithResult(_0x5a9505,null))[_0x9933('0x47')](handleError(_0x5a9505,null));};exports[_0x9933('0x50')]=function(_0x22eb7b,_0x2f6f8f,_0x1688dc){var _0x46dbe2={};var _0xaf70ac={};var _0x2c3b2b;var _0xd8ac98;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x22eb7b['params']['id']}})['then'](handleEntityNotFound(_0x2f6f8f,null))[_0x9933('0x26')](function(_0x3672ec){if(_0x3672ec){_0x2c3b2b=_0x3672ec;_0xaf70ac[_0x9933('0x34')]=_['keys'](db[_0x9933('0x4c')][_0x9933('0x2d')]);_0xaf70ac[_0x9933('0x31')]=_[_0x9933('0x45')](_0x22eb7b[_0x9933('0x31')]);_0xaf70ac[_0x9933('0x32')]=_[_0x9933('0x33')](_0xaf70ac[_0x9933('0x34')],_0xaf70ac['query']);_0x46dbe2[_0x9933('0x35')]=_[_0x9933('0x33')](_0xaf70ac[_0x9933('0x34')],qs['fields'](_0x22eb7b['query'][_0x9933('0x36')]));_0x46dbe2[_0x9933('0x35')]=_0x46dbe2['attributes']['length']?_0x46dbe2[_0x9933('0x35')]:_0xaf70ac[_0x9933('0x34')];_0x46dbe2['order']=qs[_0x9933('0x39')](_0x22eb7b['query'][_0x9933('0x39')]);_0x46dbe2[_0x9933('0x3a')]=qs[_0x9933('0x32')](_[_0x9933('0x3b')](_0x22eb7b[_0x9933('0x31')],_0xaf70ac[_0x9933('0x32')]));if(_0x22eb7b['query'][_0x9933('0x3e')]){_0x46dbe2[_0x9933('0x3a')]=_[_0x9933('0x3c')](_0x46dbe2[_0x9933('0x3a')],{'$or':_[_0x9933('0x2b')](_0x46dbe2[_0x9933('0x35')],function(_0x3c0264){var _0x3bd6b0={};_0x3bd6b0[_0x3c0264]={'$like':'%'+_0x22eb7b[_0x9933('0x31')]['filter']+'%'};return _0x3bd6b0;})});}_0x46dbe2=_['merge']({},_0x46dbe2,_0x22eb7b[_0x9933('0x3f')]);return _0x2c3b2b['getDescriptions'](_0x46dbe2);}})[_0x9933('0x26')](function(_0x99ec80){if(_0x99ec80){_0xd8ac98=_0x99ec80[_0x9933('0x4d')];if(!_0x22eb7b['query'][_0x9933('0x4e')]('nolimit')){_0x46dbe2[_0x9933('0x1e')]=qs[_0x9933('0x1e')](_0x22eb7b[_0x9933('0x31')][_0x9933('0x1e')]);_0x46dbe2[_0x9933('0x1b')]=qs['offset'](_0x22eb7b[_0x9933('0x31')][_0x9933('0x1b')]);}return _0x2c3b2b[_0x9933('0x50')](_0x46dbe2);}})[_0x9933('0x26')](function(_0x4ac5a4){if(_0x4ac5a4){return _0x4ac5a4?{'count':_0xd8ac98,'rows':_0x4ac5a4}:null;}})[_0x9933('0x26')](respondWithResult(_0x2f6f8f,null))[_0x9933('0x47')](handleError(_0x2f6f8f,null));};exports[_0x9933('0x51')]=function(_0xcbb9a6,_0x5ac024,_0x1cbe30){var _0x26db09={};var _0x302874={};var _0x1f4902;var _0x3fc9db;return db[_0x9933('0x2c')][_0x9933('0x52')]({'where':{'id':_0xcbb9a6[_0x9933('0x4a')]['id']}})[_0x9933('0x26')](handleEntityNotFound(_0x5ac024,null))[_0x9933('0x26')](function(_0x5413a4){if(_0x5413a4){_0x1f4902=_0x5413a4;_0x302874[_0x9933('0x34')]=_['keys'](db[_0x9933('0x53')][_0x9933('0x2d')]);_0x302874[_0x9933('0x31')]=_[_0x9933('0x45')](_0xcbb9a6[_0x9933('0x31')]);_0x302874[_0x9933('0x32')]=_[_0x9933('0x33')](_0x302874[_0x9933('0x34')],_0x302874[_0x9933('0x31')]);_0x26db09[_0x9933('0x35')]=_[_0x9933('0x33')](_0x302874[_0x9933('0x34')],qs[_0x9933('0x36')](_0xcbb9a6[_0x9933('0x31')][_0x9933('0x36')]));_0x26db09[_0x9933('0x35')]=_0x26db09[_0x9933('0x35')][_0x9933('0x4d')]?_0x26db09[_0x9933('0x35')]:_0x302874[_0x9933('0x34')];_0x26db09[_0x9933('0x38')]=qs['sort'](_0xcbb9a6['query']['sort']);_0x26db09[_0x9933('0x3a')]=qs[_0x9933('0x32')](_[_0x9933('0x3b')](_0xcbb9a6[_0x9933('0x31')],_0x302874[_0x9933('0x32')]));if(_0xcbb9a6[_0x9933('0x31')][_0x9933('0x3e')]){_0x26db09[_0x9933('0x3a')]=_[_0x9933('0x3c')](_0x26db09[_0x9933('0x3a')],{'$or':_[_0x9933('0x2b')](_0x26db09[_0x9933('0x35')],function(_0x15d3fa){var _0x32608f={};_0x32608f[_0x15d3fa]={'$like':'%'+_0xcbb9a6[_0x9933('0x31')][_0x9933('0x3e')]+'%'};return _0x32608f;})});}_0x26db09=_[_0x9933('0x3c')]({},_0x26db09,_0xcbb9a6[_0x9933('0x3f')]);return _0x1f4902[_0x9933('0x51')](_0x26db09);}})[_0x9933('0x26')](function(_0xbed926){if(_0xbed926){_0x3fc9db=_0xbed926[_0x9933('0x4d')];if(!_0xcbb9a6[_0x9933('0x31')]['hasOwnProperty'](_0x9933('0x37'))){_0x26db09[_0x9933('0x1e')]=qs[_0x9933('0x1e')](_0xcbb9a6[_0x9933('0x31')][_0x9933('0x1e')]);_0x26db09['offset']=qs[_0x9933('0x1b')](_0xcbb9a6['query'][_0x9933('0x1b')]);}return _0x1f4902[_0x9933('0x51')](_0x26db09);}})[_0x9933('0x26')](function(_0x586fec){if(_0x586fec){return _0x586fec?{'count':_0x3fc9db,'rows':_0x586fec}:null;}})[_0x9933('0x26')](respondWithResult(_0x5ac024,null))[_0x9933('0x47')](handleError(_0x5ac024,null));};exports[_0x9933('0x54')]=function(_0x75cea9,_0x54489c,_0x1b9a80){if(_0x75cea9[_0x9933('0x49')]['id']){delete _0x75cea9[_0x9933('0x49')]['id'];}return db['FreshdeskConfiguration'][_0x9933('0x52')]({'where':{'id':_0x75cea9[_0x9933('0x4a')]['id']}})[_0x9933('0x26')](handleEntityNotFound(_0x54489c,null))[_0x9933('0x26')](function(_0x12a659){if(_0x12a659){return _0x12a659[_0x9933('0x54')](_0x75cea9['body']['ids']||[]);}return null;})['then'](respondWithResult(_0x54489c,null))[_0x9933('0x47')](handleError(_0x54489c,null));}; \ No newline at end of file +var _0xfeb6=['options','includeAll','FreshdeskConfiguration','findAll','catch','show','params','keys','rawAttributes','find','create','body','getFields','FreshdeskField','intersection','nolimit','getSubjects','findOne','hasOwnProperty','getDescriptions','getTags','setTags','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','fieldName','type','key','model','query','filters','fields','attributes','length','order','sort','where','pick','merge','filter'];(function(_0xced98a,_0x5cb79a){var _0x2055db=function(_0x7c4807){while(--_0x7c4807){_0xced98a['push'](_0xced98a['shift']());}};_0x2055db(++_0x5cb79a);}(_0xfeb6,0x16a));var _0x6feb=function(_0x10afb5,_0x205425){_0x10afb5=_0x10afb5-0x0;var _0x3c628c=_0xfeb6[_0x10afb5];return _0x3c628c;};'use strict';var emlformat=require(_0x6feb('0x0'));var rimraf=require(_0x6feb('0x1'));var zipdir=require(_0x6feb('0x2'));var jsonpatch=require(_0x6feb('0x3'));var rp=require(_0x6feb('0x4'));var moment=require(_0x6feb('0x5'));var BPromise=require(_0x6feb('0x6'));var Mustache=require(_0x6feb('0x7'));var util=require(_0x6feb('0x8'));var path=require(_0x6feb('0x9'));var sox=require(_0x6feb('0xa'));var csv=require(_0x6feb('0xb'));var ejs=require(_0x6feb('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6feb('0xd'));var squel=require(_0x6feb('0xe'));var crypto=require(_0x6feb('0xf'));var jsforce=require(_0x6feb('0x10'));var deskjs=require(_0x6feb('0x11'));var toCsv=require(_0x6feb('0xb'));var querystring=require('querystring');var Papa=require(_0x6feb('0x12'));var Redis=require(_0x6feb('0x13'));var authService=require(_0x6feb('0x14'));var qs=require(_0x6feb('0x15'));var as=require(_0x6feb('0x16'));var hardwareService=require(_0x6feb('0x17'));var logger=require('../../config/logger')('api');var utils=require(_0x6feb('0x18'));var config=require(_0x6feb('0x19'));var licenseUtil=require(_0x6feb('0x1a'));var db=require(_0x6feb('0x1b'))['db'];function respondWithStatusCode(_0x10d808,_0x269796){_0x269796=_0x269796||0xcc;return function(_0x2f22dd){if(_0x2f22dd){return _0x10d808[_0x6feb('0x1c')](_0x269796);}return _0x10d808[_0x6feb('0x1d')](_0x269796)[_0x6feb('0x1e')]();};}function respondWithResult(_0x2ba259,_0x549c61){_0x549c61=_0x549c61||0xc8;return function(_0x2c96c3){if(_0x2c96c3){return _0x2ba259[_0x6feb('0x1d')](_0x549c61)[_0x6feb('0x1f')](_0x2c96c3);}};}function respondWithFilteredResult(_0x4f46fd,_0x24f8b1){return function(_0xa565a9){if(_0xa565a9){var _0x3cc42a=typeof _0x24f8b1[_0x6feb('0x20')]===_0x6feb('0x21')&&typeof _0x24f8b1[_0x6feb('0x22')]==='undefined';var _0xaaf640=_0xa565a9['count'];var _0x1ef338=_0x3cc42a?0x0:_0x24f8b1[_0x6feb('0x20')];var _0x115793=_0x3cc42a?_0xa565a9[_0x6feb('0x23')]:_0x24f8b1[_0x6feb('0x20')]+_0x24f8b1[_0x6feb('0x22')];var _0x1adaec;if(_0x115793>=_0xaaf640){_0x115793=_0xaaf640;_0x1adaec=0xc8;}else{_0x1adaec=0xce;}_0x4f46fd[_0x6feb('0x1d')](_0x1adaec);return _0x4f46fd['set'](_0x6feb('0x24'),_0x1ef338+'-'+_0x115793+'/'+_0xaaf640)['json'](_0xa565a9);}return null;};}function patchUpdates(_0x67cbca){return function(_0x125d7c){try{jsonpatch[_0x6feb('0x25')](_0x125d7c,_0x67cbca,!![]);}catch(_0x5b6548){return BPromise[_0x6feb('0x26')](_0x5b6548);}return _0x125d7c['save']();};}function saveUpdates(_0x45426b,_0x5baa13){return function(_0x1b01f0){if(_0x1b01f0){return _0x1b01f0[_0x6feb('0x27')](_0x45426b)[_0x6feb('0x28')](function(_0x28e166){return _0x28e166;});}return null;};}function removeEntity(_0x5e3fa0,_0x59599c){return function(_0x7d1fa7){if(_0x7d1fa7){return _0x7d1fa7[_0x6feb('0x29')]()['then'](function(){_0x5e3fa0[_0x6feb('0x1d')](0xcc)[_0x6feb('0x1e')]();});}};}function handleEntityNotFound(_0x1fe7fe,_0x421cc5){return function(_0x4e2e32){if(!_0x4e2e32){_0x1fe7fe[_0x6feb('0x1c')](0x194);}return _0x4e2e32;};}function handleError(_0x81c558,_0x15dbea){_0x15dbea=_0x15dbea||0x1f4;return function(_0xbd383e){logger[_0x6feb('0x2a')](_0xbd383e[_0x6feb('0x2b')]);if(_0xbd383e[_0x6feb('0x2c')]){delete _0xbd383e['name'];}_0x81c558[_0x6feb('0x1d')](_0x15dbea)[_0x6feb('0x2d')](_0xbd383e);};}exports[_0x6feb('0x2e')]=function(_0x5d127c,_0x59cedd){var _0x448a70={},_0x2f89dd={},_0x452c6c={'count':0x0,'rows':[]};var _0x492fe6=_[_0x6feb('0x2f')](db['FreshdeskConfiguration']['rawAttributes'],function(_0x4a9c8f){return{'name':_0x4a9c8f[_0x6feb('0x30')],'type':_0x4a9c8f[_0x6feb('0x31')][_0x6feb('0x32')]};});_0x2f89dd[_0x6feb('0x33')]=_[_0x6feb('0x2f')](_0x492fe6,_0x6feb('0x2c'));_0x2f89dd[_0x6feb('0x34')]=_['keys'](_0x5d127c[_0x6feb('0x34')]);_0x2f89dd[_0x6feb('0x35')]=_['intersection'](_0x2f89dd[_0x6feb('0x33')],_0x2f89dd[_0x6feb('0x34')]);_0x448a70['attributes']=_['intersection'](_0x2f89dd[_0x6feb('0x33')],qs[_0x6feb('0x36')](_0x5d127c['query'][_0x6feb('0x36')]));_0x448a70[_0x6feb('0x37')]=_0x448a70['attributes'][_0x6feb('0x38')]?_0x448a70[_0x6feb('0x37')]:_0x2f89dd['model'];if(!_0x5d127c[_0x6feb('0x34')]['hasOwnProperty']('nolimit')){_0x448a70['limit']=qs['limit'](_0x5d127c[_0x6feb('0x34')][_0x6feb('0x22')]);_0x448a70['offset']=qs[_0x6feb('0x20')](_0x5d127c['query']['offset']);}_0x448a70[_0x6feb('0x39')]=qs[_0x6feb('0x3a')](_0x5d127c[_0x6feb('0x34')][_0x6feb('0x3a')]);_0x448a70[_0x6feb('0x3b')]=qs[_0x6feb('0x35')](_[_0x6feb('0x3c')](_0x5d127c[_0x6feb('0x34')],_0x2f89dd[_0x6feb('0x35')]),_0x492fe6);if(_0x5d127c[_0x6feb('0x34')]['filter']){_0x448a70[_0x6feb('0x3b')]=_[_0x6feb('0x3d')](_0x448a70[_0x6feb('0x3b')],{'$or':_['map'](_0x492fe6,function(_0x4b5864){if(_0x4b5864['type']!=='VIRTUAL'){var _0x40ef89={};_0x40ef89[_0x4b5864[_0x6feb('0x2c')]]={'$like':'%'+_0x5d127c[_0x6feb('0x34')][_0x6feb('0x3e')]+'%'};return _0x40ef89;}})});}_0x448a70=_[_0x6feb('0x3d')]({},_0x448a70,_0x5d127c[_0x6feb('0x3f')]);var _0x346c06={'where':_0x448a70[_0x6feb('0x3b')]};return db['FreshdeskConfiguration'][_0x6feb('0x23')](_0x346c06)[_0x6feb('0x28')](function(_0x347f5a){_0x452c6c['count']=_0x347f5a;if(_0x5d127c[_0x6feb('0x34')][_0x6feb('0x40')]){_0x448a70['include']=[{'all':!![]}];}return db[_0x6feb('0x41')][_0x6feb('0x42')](_0x448a70);})[_0x6feb('0x28')](function(_0x109c88){_0x452c6c['rows']=_0x109c88;return _0x452c6c;})[_0x6feb('0x28')](respondWithFilteredResult(_0x59cedd,_0x448a70))[_0x6feb('0x43')](handleError(_0x59cedd,null));};exports[_0x6feb('0x44')]=function(_0x392b56,_0x114e25){var _0x178998={'raw':![],'where':{'id':_0x392b56[_0x6feb('0x45')]['id']}},_0x47f2a9={};_0x47f2a9[_0x6feb('0x33')]=_[_0x6feb('0x46')](db[_0x6feb('0x41')][_0x6feb('0x47')]);_0x47f2a9[_0x6feb('0x34')]=_['keys'](_0x392b56[_0x6feb('0x34')]);_0x47f2a9[_0x6feb('0x35')]=_['intersection'](_0x47f2a9['model'],_0x47f2a9[_0x6feb('0x34')]);_0x178998[_0x6feb('0x37')]=_['intersection'](_0x47f2a9[_0x6feb('0x33')],qs['fields'](_0x392b56[_0x6feb('0x34')][_0x6feb('0x36')]));_0x178998['attributes']=_0x178998['attributes']['length']?_0x178998['attributes']:_0x47f2a9[_0x6feb('0x33')];if(_0x392b56[_0x6feb('0x34')][_0x6feb('0x40')]){_0x178998['include']=[{'all':!![]}];}_0x178998=_['merge']({},_0x178998,_0x392b56[_0x6feb('0x3f')]);return db[_0x6feb('0x41')][_0x6feb('0x48')](_0x178998)[_0x6feb('0x28')](handleEntityNotFound(_0x114e25,null))[_0x6feb('0x28')](respondWithResult(_0x114e25,null))[_0x6feb('0x43')](handleError(_0x114e25,null));};exports[_0x6feb('0x49')]=function(_0x51bf24,_0x147401){return db[_0x6feb('0x41')][_0x6feb('0x49')](_0x51bf24[_0x6feb('0x4a')],{})[_0x6feb('0x28')](respondWithResult(_0x147401,0xc9))[_0x6feb('0x43')](handleError(_0x147401,null));};exports[_0x6feb('0x27')]=function(_0x4d16b0,_0xcbcf6f){if(_0x4d16b0[_0x6feb('0x4a')]['id']){delete _0x4d16b0[_0x6feb('0x4a')]['id'];}return db[_0x6feb('0x41')]['find']({'where':{'id':_0x4d16b0[_0x6feb('0x45')]['id']}})[_0x6feb('0x28')](handleEntityNotFound(_0xcbcf6f,null))[_0x6feb('0x28')](saveUpdates(_0x4d16b0[_0x6feb('0x4a')],null))[_0x6feb('0x28')](respondWithResult(_0xcbcf6f,null))[_0x6feb('0x43')](handleError(_0xcbcf6f,null));};exports[_0x6feb('0x29')]=function(_0x204561,_0x2217f7){return db[_0x6feb('0x41')]['find']({'where':{'id':_0x204561['params']['id']}})[_0x6feb('0x28')](handleEntityNotFound(_0x2217f7,null))['then'](removeEntity(_0x2217f7,null))[_0x6feb('0x43')](handleError(_0x2217f7,null));};exports[_0x6feb('0x4b')]=function(_0x3b3bc8,_0xd47913,_0x5d4dd7){var _0x1d4f2d={};var _0x2694e3={};var _0x35af12;var _0x30362c;return db[_0x6feb('0x41')]['findOne']({'where':{'id':_0x3b3bc8['params']['id']}})[_0x6feb('0x28')](handleEntityNotFound(_0xd47913,null))[_0x6feb('0x28')](function(_0x1a1332){if(_0x1a1332){_0x35af12=_0x1a1332;_0x2694e3[_0x6feb('0x33')]=_[_0x6feb('0x46')](db[_0x6feb('0x4c')][_0x6feb('0x47')]);_0x2694e3[_0x6feb('0x34')]=_['keys'](_0x3b3bc8[_0x6feb('0x34')]);_0x2694e3['filters']=_['intersection'](_0x2694e3[_0x6feb('0x33')],_0x2694e3[_0x6feb('0x34')]);_0x1d4f2d[_0x6feb('0x37')]=_[_0x6feb('0x4d')](_0x2694e3[_0x6feb('0x33')],qs[_0x6feb('0x36')](_0x3b3bc8[_0x6feb('0x34')][_0x6feb('0x36')]));_0x1d4f2d[_0x6feb('0x37')]=_0x1d4f2d[_0x6feb('0x37')]['length']?_0x1d4f2d['attributes']:_0x2694e3['model'];_0x1d4f2d[_0x6feb('0x39')]=qs[_0x6feb('0x3a')](_0x3b3bc8[_0x6feb('0x34')][_0x6feb('0x3a')]);_0x1d4f2d[_0x6feb('0x3b')]=qs[_0x6feb('0x35')](_[_0x6feb('0x3c')](_0x3b3bc8[_0x6feb('0x34')],_0x2694e3[_0x6feb('0x35')]));if(_0x3b3bc8['query'][_0x6feb('0x3e')]){_0x1d4f2d[_0x6feb('0x3b')]=_['merge'](_0x1d4f2d['where'],{'$or':_[_0x6feb('0x2f')](_0x1d4f2d[_0x6feb('0x37')],function(_0x25b541){var _0x4749f9={};_0x4749f9[_0x25b541]={'$like':'%'+_0x3b3bc8[_0x6feb('0x34')]['filter']+'%'};return _0x4749f9;})});}_0x1d4f2d=_[_0x6feb('0x3d')]({},_0x1d4f2d,_0x3b3bc8[_0x6feb('0x3f')]);return _0x35af12[_0x6feb('0x4b')](_0x1d4f2d);}})[_0x6feb('0x28')](function(_0x398aff){if(_0x398aff){_0x30362c=_0x398aff[_0x6feb('0x38')];if(!_0x3b3bc8[_0x6feb('0x34')]['hasOwnProperty'](_0x6feb('0x4e'))){_0x1d4f2d[_0x6feb('0x22')]=qs[_0x6feb('0x22')](_0x3b3bc8[_0x6feb('0x34')][_0x6feb('0x22')]);_0x1d4f2d[_0x6feb('0x20')]=qs['offset'](_0x3b3bc8['query'][_0x6feb('0x20')]);}return _0x35af12['getFields'](_0x1d4f2d);}})['then'](function(_0x4784ee){if(_0x4784ee){return _0x4784ee?{'count':_0x30362c,'rows':_0x4784ee}:null;}})[_0x6feb('0x28')](respondWithResult(_0xd47913,null))[_0x6feb('0x43')](handleError(_0xd47913,null));};exports[_0x6feb('0x4f')]=function(_0x1e3ef5,_0x5ae353,_0x22e47e){var _0x22a496={};var _0x393190={};var _0x21c51c;var _0x4fb3b4;return db[_0x6feb('0x41')][_0x6feb('0x50')]({'where':{'id':_0x1e3ef5[_0x6feb('0x45')]['id']}})[_0x6feb('0x28')](handleEntityNotFound(_0x5ae353,null))[_0x6feb('0x28')](function(_0x3fbb45){if(_0x3fbb45){_0x21c51c=_0x3fbb45;_0x393190['model']=_[_0x6feb('0x46')](db['FreshdeskField'][_0x6feb('0x47')]);_0x393190[_0x6feb('0x34')]=_[_0x6feb('0x46')](_0x1e3ef5['query']);_0x393190[_0x6feb('0x35')]=_['intersection'](_0x393190[_0x6feb('0x33')],_0x393190[_0x6feb('0x34')]);_0x22a496['attributes']=_['intersection'](_0x393190[_0x6feb('0x33')],qs[_0x6feb('0x36')](_0x1e3ef5[_0x6feb('0x34')][_0x6feb('0x36')]));_0x22a496['attributes']=_0x22a496[_0x6feb('0x37')]['length']?_0x22a496['attributes']:_0x393190[_0x6feb('0x33')];_0x22a496[_0x6feb('0x39')]=qs['sort'](_0x1e3ef5[_0x6feb('0x34')][_0x6feb('0x3a')]);_0x22a496[_0x6feb('0x3b')]=qs[_0x6feb('0x35')](_['pick'](_0x1e3ef5[_0x6feb('0x34')],_0x393190[_0x6feb('0x35')]));if(_0x1e3ef5[_0x6feb('0x34')]['filter']){_0x22a496[_0x6feb('0x3b')]=_[_0x6feb('0x3d')](_0x22a496[_0x6feb('0x3b')],{'$or':_[_0x6feb('0x2f')](_0x22a496[_0x6feb('0x37')],function(_0x49cbda){var _0x46043a={};_0x46043a[_0x49cbda]={'$like':'%'+_0x1e3ef5[_0x6feb('0x34')][_0x6feb('0x3e')]+'%'};return _0x46043a;})});}_0x22a496=_[_0x6feb('0x3d')]({},_0x22a496,_0x1e3ef5[_0x6feb('0x3f')]);return _0x21c51c[_0x6feb('0x4f')](_0x22a496);}})[_0x6feb('0x28')](function(_0x29a813){if(_0x29a813){_0x4fb3b4=_0x29a813['length'];if(!_0x1e3ef5[_0x6feb('0x34')][_0x6feb('0x51')]('nolimit')){_0x22a496[_0x6feb('0x22')]=qs[_0x6feb('0x22')](_0x1e3ef5[_0x6feb('0x34')][_0x6feb('0x22')]);_0x22a496[_0x6feb('0x20')]=qs[_0x6feb('0x20')](_0x1e3ef5['query'][_0x6feb('0x20')]);}return _0x21c51c[_0x6feb('0x4f')](_0x22a496);}})[_0x6feb('0x28')](function(_0x1c7732){if(_0x1c7732){return _0x1c7732?{'count':_0x4fb3b4,'rows':_0x1c7732}:null;}})['then'](respondWithResult(_0x5ae353,null))[_0x6feb('0x43')](handleError(_0x5ae353,null));};exports[_0x6feb('0x52')]=function(_0x4ba1bc,_0x1993fc,_0x6fcbdb){var _0x1c1f21={};var _0x1cdc71={};var _0x4f67c0;var _0x33e60d;return db[_0x6feb('0x41')]['findOne']({'where':{'id':_0x4ba1bc[_0x6feb('0x45')]['id']}})['then'](handleEntityNotFound(_0x1993fc,null))[_0x6feb('0x28')](function(_0x16b291){if(_0x16b291){_0x4f67c0=_0x16b291;_0x1cdc71[_0x6feb('0x33')]=_[_0x6feb('0x46')](db[_0x6feb('0x4c')]['rawAttributes']);_0x1cdc71['query']=_[_0x6feb('0x46')](_0x4ba1bc[_0x6feb('0x34')]);_0x1cdc71[_0x6feb('0x35')]=_['intersection'](_0x1cdc71['model'],_0x1cdc71['query']);_0x1c1f21['attributes']=_['intersection'](_0x1cdc71[_0x6feb('0x33')],qs[_0x6feb('0x36')](_0x4ba1bc['query'][_0x6feb('0x36')]));_0x1c1f21['attributes']=_0x1c1f21[_0x6feb('0x37')]['length']?_0x1c1f21[_0x6feb('0x37')]:_0x1cdc71[_0x6feb('0x33')];_0x1c1f21[_0x6feb('0x39')]=qs[_0x6feb('0x3a')](_0x4ba1bc[_0x6feb('0x34')][_0x6feb('0x3a')]);_0x1c1f21[_0x6feb('0x3b')]=qs[_0x6feb('0x35')](_['pick'](_0x4ba1bc[_0x6feb('0x34')],_0x1cdc71[_0x6feb('0x35')]));if(_0x4ba1bc[_0x6feb('0x34')]['filter']){_0x1c1f21['where']=_['merge'](_0x1c1f21[_0x6feb('0x3b')],{'$or':_[_0x6feb('0x2f')](_0x1c1f21[_0x6feb('0x37')],function(_0x6ac7f1){var _0x299423={};_0x299423[_0x6ac7f1]={'$like':'%'+_0x4ba1bc['query'][_0x6feb('0x3e')]+'%'};return _0x299423;})});}_0x1c1f21=_['merge']({},_0x1c1f21,_0x4ba1bc[_0x6feb('0x3f')]);return _0x4f67c0[_0x6feb('0x52')](_0x1c1f21);}})[_0x6feb('0x28')](function(_0x53e590){if(_0x53e590){_0x33e60d=_0x53e590[_0x6feb('0x38')];if(!_0x4ba1bc['query'][_0x6feb('0x51')](_0x6feb('0x4e'))){_0x1c1f21[_0x6feb('0x22')]=qs[_0x6feb('0x22')](_0x4ba1bc[_0x6feb('0x34')][_0x6feb('0x22')]);_0x1c1f21['offset']=qs[_0x6feb('0x20')](_0x4ba1bc['query'][_0x6feb('0x20')]);}return _0x4f67c0[_0x6feb('0x52')](_0x1c1f21);}})[_0x6feb('0x28')](function(_0x257ad8){if(_0x257ad8){return _0x257ad8?{'count':_0x33e60d,'rows':_0x257ad8}:null;}})[_0x6feb('0x28')](respondWithResult(_0x1993fc,null))['catch'](handleError(_0x1993fc,null));};exports[_0x6feb('0x53')]=function(_0x24ca7d,_0x25c307,_0x9f1a9f){var _0x5acea4={};var _0x4cccf6={};var _0x402cb2;var _0x297a19;return db['FreshdeskConfiguration'][_0x6feb('0x50')]({'where':{'id':_0x24ca7d[_0x6feb('0x45')]['id']}})[_0x6feb('0x28')](handleEntityNotFound(_0x25c307,null))[_0x6feb('0x28')](function(_0x524149){if(_0x524149){_0x402cb2=_0x524149;_0x4cccf6[_0x6feb('0x33')]=_[_0x6feb('0x46')](db['Tag']['rawAttributes']);_0x4cccf6[_0x6feb('0x34')]=_['keys'](_0x24ca7d[_0x6feb('0x34')]);_0x4cccf6[_0x6feb('0x35')]=_[_0x6feb('0x4d')](_0x4cccf6[_0x6feb('0x33')],_0x4cccf6[_0x6feb('0x34')]);_0x5acea4[_0x6feb('0x37')]=_['intersection'](_0x4cccf6[_0x6feb('0x33')],qs[_0x6feb('0x36')](_0x24ca7d[_0x6feb('0x34')][_0x6feb('0x36')]));_0x5acea4[_0x6feb('0x37')]=_0x5acea4[_0x6feb('0x37')][_0x6feb('0x38')]?_0x5acea4[_0x6feb('0x37')]:_0x4cccf6['model'];_0x5acea4[_0x6feb('0x39')]=qs[_0x6feb('0x3a')](_0x24ca7d[_0x6feb('0x34')][_0x6feb('0x3a')]);_0x5acea4[_0x6feb('0x3b')]=qs['filters'](_[_0x6feb('0x3c')](_0x24ca7d[_0x6feb('0x34')],_0x4cccf6['filters']));if(_0x24ca7d[_0x6feb('0x34')][_0x6feb('0x3e')]){_0x5acea4['where']=_[_0x6feb('0x3d')](_0x5acea4[_0x6feb('0x3b')],{'$or':_[_0x6feb('0x2f')](_0x5acea4[_0x6feb('0x37')],function(_0xd7845a){var _0x1bcaed={};_0x1bcaed[_0xd7845a]={'$like':'%'+_0x24ca7d[_0x6feb('0x34')][_0x6feb('0x3e')]+'%'};return _0x1bcaed;})});}_0x5acea4=_[_0x6feb('0x3d')]({},_0x5acea4,_0x24ca7d[_0x6feb('0x3f')]);return _0x402cb2[_0x6feb('0x53')](_0x5acea4);}})[_0x6feb('0x28')](function(_0x97d366){if(_0x97d366){_0x297a19=_0x97d366[_0x6feb('0x38')];if(!_0x24ca7d[_0x6feb('0x34')][_0x6feb('0x51')](_0x6feb('0x4e'))){_0x5acea4[_0x6feb('0x22')]=qs[_0x6feb('0x22')](_0x24ca7d[_0x6feb('0x34')][_0x6feb('0x22')]);_0x5acea4[_0x6feb('0x20')]=qs[_0x6feb('0x20')](_0x24ca7d[_0x6feb('0x34')][_0x6feb('0x20')]);}return _0x402cb2[_0x6feb('0x53')](_0x5acea4);}})[_0x6feb('0x28')](function(_0x584607){if(_0x584607){return _0x584607?{'count':_0x297a19,'rows':_0x584607}:null;}})[_0x6feb('0x28')](respondWithResult(_0x25c307,null))[_0x6feb('0x43')](handleError(_0x25c307,null));};exports['setTags']=function(_0x21c508,_0x5c193a,_0x54fefe){if(_0x21c508['body']['id']){delete _0x21c508[_0x6feb('0x4a')]['id'];}return db['FreshdeskConfiguration'][_0x6feb('0x50')]({'where':{'id':_0x21c508[_0x6feb('0x45')]['id']}})[_0x6feb('0x28')](handleEntityNotFound(_0x5c193a,null))[_0x6feb('0x28')](function(_0x525e3f){if(_0x525e3f){return _0x525e3f[_0x6feb('0x54')](_0x21c508['body']['ids']||[]);}return null;})[_0x6feb('0x28')](respondWithResult(_0x5c193a,null))[_0x6feb('0x43')](handleError(_0x5c193a,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 217e626..b9c3f6d 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 _0x047e=['bluebird','request-promise','rimraf','exports','define','int_freshdesk_configurations','lodash','util','../../config/logger'];(function(_0xd25b9a,_0x3b3f08){var _0x48c055=function(_0x26d582){while(--_0x26d582){_0xd25b9a['push'](_0xd25b9a['shift']());}};_0x48c055(++_0x3b3f08);}(_0x047e,0x84));var _0xe047=function(_0x3e57ad,_0xe263db){_0x3e57ad=_0x3e57ad-0x0;var _0x1545bd=_0x047e[_0x3e57ad];return _0x1545bd;};'use strict';var _=require(_0xe047('0x0'));var util=require(_0xe047('0x1'));var logger=require(_0xe047('0x2'))('api');var moment=require('moment');var BPromise=require(_0xe047('0x3'));var rp=require(_0xe047('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe047('0x5'));var config=require('../../config/environment');var attributes=require('./intFreshdeskConfiguration.attributes');module[_0xe047('0x6')]=function(_0x4c886f,_0x41ebec){return _0x4c886f[_0xe047('0x7')]('FreshdeskConfiguration',attributes,{'tableName':_0xe047('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc969=['request-promise','path','rimraf','../../config/environment','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','../../config/logger','bluebird'];(function(_0x4dd21a,_0x46c99c){var _0x2755af=function(_0xd160ee){while(--_0xd160ee){_0x4dd21a['push'](_0x4dd21a['shift']());}};_0x2755af(++_0x46c99c);}(_0xc969,0x189));var _0x9c96=function(_0x40bffc,_0x3a45d7){_0x40bffc=_0x40bffc-0x0;var _0x3007e9=_0xc969[_0x40bffc];return _0x3007e9;};'use strict';var _=require(_0x9c96('0x0'));var util=require('util');var logger=require(_0x9c96('0x1'))('api');var moment=require('moment');var BPromise=require(_0x9c96('0x2'));var rp=require(_0x9c96('0x3'));var fs=require('fs');var path=require(_0x9c96('0x4'));var rimraf=require(_0x9c96('0x5'));var config=require(_0x9c96('0x6'));var attributes=require('./intFreshdeskConfiguration.attributes');module[_0x9c96('0x7')]=function(_0x31147d,_0x215972){return _0x31147d[_0x9c96('0x8')](_0x9c96('0x9'),attributes,{'tableName':_0x9c96('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js index 5b7803d..18dab99 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 _0x4c62=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','lodash','util'];(function(_0x5d0390,_0x11bef3){var _0x4bed69=function(_0x245a8f){while(--_0x245a8f){_0x5d0390['push'](_0x5d0390['shift']());}};_0x4bed69(++_0x11bef3);}(_0x4c62,0xfb));var _0x24c6=function(_0x1e6b3c,_0x555787){_0x1e6b3c=_0x1e6b3c-0x0;var _0x59ef91=_0x4c62[_0x1e6b3c];return _0x59ef91;};'use strict';var _=require(_0x24c6('0x0'));var util=require(_0x24c6('0x1'));var moment=require(_0x24c6('0x2'));var BPromise=require(_0x24c6('0x3'));var rs=require(_0x24c6('0x4'));var fs=require('fs');var Redis=require(_0x24c6('0x5'));var db=require(_0x24c6('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x24c6('0x7'))(_0x24c6('0x8'));var config=require(_0x24c6('0x9'));var jayson=require(_0x24c6('0xa'));var client=jayson[_0x24c6('0xb')][_0x24c6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x105475,_0x37fe92,_0x2b3828){return new BPromise(function(_0x1a515e,_0x1db3cf){return client[_0x24c6('0xd')](_0x105475,_0x2b3828)['then'](function(_0x1ea47f){logger[_0x24c6('0xe')](_0x24c6('0xf'),_0x37fe92,_0x24c6('0x10'));logger['debug'](_0x24c6('0x11'),_0x37fe92,'request\x20sent',JSON[_0x24c6('0x12')](_0x1ea47f));if(_0x1ea47f['error']){if(_0x1ea47f['error'][_0x24c6('0x13')]===0x1f4){logger[_0x24c6('0x14')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x37fe92,_0x1ea47f[_0x24c6('0x14')][_0x24c6('0x15')]);return _0x1db3cf(_0x1ea47f['error'][_0x24c6('0x15')]);}logger['error'](_0x24c6('0xf'),_0x37fe92,_0x1ea47f[_0x24c6('0x14')][_0x24c6('0x15')]);return _0x1a515e(_0x1ea47f['error']['message']);}else{logger[_0x24c6('0xe')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x37fe92,_0x24c6('0x10'));_0x1a515e(_0x1ea47f['result'][_0x24c6('0x15')]);}})[_0x24c6('0x16')](function(_0x3c5ba1){logger[_0x24c6('0x14')](_0x24c6('0xf'),_0x37fe92,_0x3c5ba1);_0x1db3cf(_0x3c5ba1);});});} \ No newline at end of file +var _0xc014=['result','catch','lodash','bluebird','../../mysqldb','../../config/utils','jayson/promise','client','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','code','error','message'];(function(_0x4d82ea,_0x4d459f){var _0x257f4a=function(_0x424c4f){while(--_0x424c4f){_0x4d82ea['push'](_0x4d82ea['shift']());}};_0x257f4a(++_0x4d459f);}(_0xc014,0xfe));var _0x4c01=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xc014[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x4c01('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4c01('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4c01('0x2'))['db'];var utils=require(_0x4c01('0x3'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x4c01('0x4'));var client=jayson[_0x4c01('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5042d2,_0x4e79d2,_0x18d6bc){return new BPromise(function(_0x4c2f37,_0x158053){return client[_0x4c01('0x6')](_0x5042d2,_0x18d6bc)[_0x4c01('0x7')](function(_0x25da2d){logger[_0x4c01('0x8')](_0x4c01('0x9'),_0x4e79d2,_0x4c01('0xa'));logger[_0x4c01('0xb')](_0x4c01('0xc'),_0x4e79d2,'request\x20sent',JSON['stringify'](_0x25da2d));if(_0x25da2d['error']){if(_0x25da2d['error'][_0x4c01('0xd')]===0x1f4){logger[_0x4c01('0xe')](_0x4c01('0x9'),_0x4e79d2,_0x25da2d[_0x4c01('0xe')]['message']);return _0x158053(_0x25da2d[_0x4c01('0xe')][_0x4c01('0xf')]);}logger[_0x4c01('0xe')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x4e79d2,_0x25da2d[_0x4c01('0xe')][_0x4c01('0xf')]);return _0x4c2f37(_0x25da2d[_0x4c01('0xe')][_0x4c01('0xf')]);}else{logger['info'](_0x4c01('0x9'),_0x4e79d2,_0x4c01('0xa'));_0x4c2f37(_0x25da2d[_0x4c01('0x10')][_0x4c01('0xf')]);}})[_0x4c01('0x11')](function(_0x4d9da1){logger[_0x4c01('0xe')](_0x4c01('0x9'),_0x4e79d2,_0x4d9da1);_0x158053(_0x4d9da1);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 6dfce0e..d9af1c5 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 _0x52e0=['index','/:id','create','put','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x52e0,0x97));var _0x052e=function(_0x5862e4,_0xec1470){_0x5862e4=_0x5862e4-0x0;var _0x2567af=_0x52e0[_0x5862e4];return _0x2567af;};'use strict';var multer=require(_0x052e('0x0'));var util=require(_0x052e('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x052e('0x2'));var router=express[_0x052e('0x3')]();var fs_extra=require(_0x052e('0x4'));var auth=require(_0x052e('0x5'));var interaction=require(_0x052e('0x6'));var config=require(_0x052e('0x7'));var controller=require(_0x052e('0x8'));router[_0x052e('0x9')]('/',auth[_0x052e('0xa')](),controller[_0x052e('0xb')]);router[_0x052e('0x9')](_0x052e('0xc'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x052e('0xa')](),controller[_0x052e('0xd')]);router[_0x052e('0xe')](_0x052e('0xc'),auth[_0x052e('0xa')](),controller['update']);router[_0x052e('0xf')](_0x052e('0xc'),auth[_0x052e('0xa')](),controller[_0x052e('0x10')]);module[_0x052e('0x11')]=router; \ No newline at end of file +var _0xe48d=['multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intFreshdeskField.controller','isAuthenticated','index','get','/:id','show','create','put','update','delete','destroy','exports'];(function(_0x29c3b2,_0x3c12ac){var _0x4b3aa7=function(_0x622a9d){while(--_0x622a9d){_0x29c3b2['push'](_0x29c3b2['shift']());}};_0x4b3aa7(++_0x3c12ac);}(_0xe48d,0xf7));var _0xde48=function(_0x5e25da,_0x1b9710){_0x5e25da=_0x5e25da-0x0;var _0x5c9f7e=_0xe48d[_0x5e25da];return _0x5c9f7e;};'use strict';var multer=require(_0xde48('0x0'));var util=require(_0xde48('0x1'));var path=require('path');var timeout=require(_0xde48('0x2'));var express=require(_0xde48('0x3'));var router=express[_0xde48('0x4')]();var fs_extra=require(_0xde48('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xde48('0x6'));var config=require('../../config/environment');var controller=require(_0xde48('0x7'));router['get']('/',auth[_0xde48('0x8')](),controller[_0xde48('0x9')]);router[_0xde48('0xa')](_0xde48('0xb'),auth[_0xde48('0x8')](),controller[_0xde48('0xc')]);router['post']('/',auth[_0xde48('0x8')](),controller[_0xde48('0xd')]);router[_0xde48('0xe')](_0xde48('0xb'),auth[_0xde48('0x8')](),controller[_0xde48('0xf')]);router[_0xde48('0x10')](_0xde48('0xb'),auth['isAuthenticated'](),controller[_0xde48('0x11')]);module[_0xde48('0x12')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 8c79709..b34eb0e 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 _0x1e95=['BOOLEAN','sequelize','exports','ENUM','string','keyValue','picklist','variable','STRING'];(function(_0x142a66,_0x56638f){var _0x221e49=function(_0xf6abe3){while(--_0xf6abe3){_0x142a66['push'](_0x142a66['shift']());}};_0x221e49(++_0x56638f);}(_0x1e95,0x1b1));var _0x51e9=function(_0x6e2348,_0x4a65d6){_0x6e2348=_0x6e2348-0x0;var _0x58ab55=_0x1e95[_0x6e2348];return _0x58ab55;};'use strict';var Sequelize=require(_0x51e9('0x0'));module[_0x51e9('0x1')]={'type':{'type':Sequelize[_0x51e9('0x2')](_0x51e9('0x3'),'variable','customVariable',_0x51e9('0x4'),_0x51e9('0x5')),'defaultValue':_0x51e9('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x51e9('0x2')](_0x51e9('0x3'),_0x51e9('0x6'),'customVariable')},'keyContent':{'type':Sequelize[_0x51e9('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x51e9('0x7')]},'customField':{'type':Sequelize[_0x51e9('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x51e9('0x7')]}}; \ No newline at end of file +var _0x8f49=['customVariable','keyValue','picklist','string','STRING','BOOLEAN','sequelize','ENUM','variable'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8f49,0xb1));var _0x98f4=function(_0x36c9fb,_0xa63d2d){_0x36c9fb=_0x36c9fb-0x0;var _0x34514b=_0x8f49[_0x36c9fb];return _0x34514b;};'use strict';var Sequelize=require(_0x98f4('0x0'));module['exports']={'type':{'type':Sequelize[_0x98f4('0x1')]('string',_0x98f4('0x2'),_0x98f4('0x3'),_0x98f4('0x4'),_0x98f4('0x5')),'defaultValue':_0x98f4('0x6')},'content':{'type':Sequelize[_0x98f4('0x7')]},'key':{'type':Sequelize[_0x98f4('0x7')]},'keyType':{'type':Sequelize[_0x98f4('0x1')]('string','variable',_0x98f4('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x98f4('0x7')]},'nameField':{'type':Sequelize[_0x98f4('0x7')]},'customField':{'type':Sequelize[_0x98f4('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x98f4('0x7')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index f8249f7..109f1f2 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 _0xe605=['moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','index','map','FreshdeskField','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','fields','find','create','body','eml-format','rimraf','fast-json-patch','request-promise'];(function(_0x40005d,_0x267754){var _0x58024c=function(_0x57d78e){while(--_0x57d78e){_0x40005d['push'](_0x40005d['shift']());}};_0x58024c(++_0x267754);}(_0xe605,0x92));var _0x5e60=function(_0xb00992,_0x1f6321){_0xb00992=_0xb00992-0x0;var _0x289661=_0xe605[_0xb00992];return _0x289661;};'use strict';var emlformat=require(_0x5e60('0x0'));var rimraf=require(_0x5e60('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5e60('0x2'));var rp=require(_0x5e60('0x3'));var moment=require(_0x5e60('0x4'));var BPromise=require(_0x5e60('0x5'));var Mustache=require(_0x5e60('0x6'));var util=require(_0x5e60('0x7'));var path=require(_0x5e60('0x8'));var sox=require(_0x5e60('0x9'));var csv=require(_0x5e60('0xa'));var ejs=require(_0x5e60('0xb'));var fs=require('fs');var fs_extra=require(_0x5e60('0xc'));var _=require(_0x5e60('0xd'));var squel=require('squel');var crypto=require(_0x5e60('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5e60('0xf'));var Papa=require(_0x5e60('0x10'));var Redis=require(_0x5e60('0x11'));var authService=require(_0x5e60('0x12'));var qs=require(_0x5e60('0x13'));var as=require(_0x5e60('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5e60('0x15'))('api');var utils=require(_0x5e60('0x16'));var config=require(_0x5e60('0x17'));var licenseUtil=require(_0x5e60('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x371df7,_0x178782){_0x178782=_0x178782||0xcc;return function(_0x1f4e14){if(_0x1f4e14){return _0x371df7[_0x5e60('0x19')](_0x178782);}return _0x371df7[_0x5e60('0x1a')](_0x178782)[_0x5e60('0x1b')]();};}function respondWithResult(_0x4fd10e,_0x209adb){_0x209adb=_0x209adb||0xc8;return function(_0x45304f){if(_0x45304f){return _0x4fd10e[_0x5e60('0x1a')](_0x209adb)[_0x5e60('0x1c')](_0x45304f);}};}function respondWithFilteredResult(_0x5b028f,_0x20af5f){return function(_0x529ffe){if(_0x529ffe){var _0x1ffd77=typeof _0x20af5f[_0x5e60('0x1d')]==='undefined'&&typeof _0x20af5f[_0x5e60('0x1e')]===_0x5e60('0x1f');var _0xaa7d05=_0x529ffe[_0x5e60('0x20')];var _0x5c485d=_0x1ffd77?0x0:_0x20af5f[_0x5e60('0x1d')];var _0x22d718=_0x1ffd77?_0x529ffe['count']:_0x20af5f[_0x5e60('0x1d')]+_0x20af5f[_0x5e60('0x1e')];var _0x17c630;if(_0x22d718>=_0xaa7d05){_0x22d718=_0xaa7d05;_0x17c630=0xc8;}else{_0x17c630=0xce;}_0x5b028f[_0x5e60('0x1a')](_0x17c630);return _0x5b028f[_0x5e60('0x21')](_0x5e60('0x22'),_0x5c485d+'-'+_0x22d718+'/'+_0xaa7d05)[_0x5e60('0x1c')](_0x529ffe);}return null;};}function patchUpdates(_0x524c93){return function(_0x3282e4){try{jsonpatch[_0x5e60('0x23')](_0x3282e4,_0x524c93,!![]);}catch(_0x228f13){return BPromise['reject'](_0x228f13);}return _0x3282e4[_0x5e60('0x24')]();};}function saveUpdates(_0x5d77dd,_0x376069){return function(_0x1a44e5){if(_0x1a44e5){return _0x1a44e5[_0x5e60('0x25')](_0x5d77dd)[_0x5e60('0x26')](function(_0x34e98d){return _0x34e98d;});}return null;};}function removeEntity(_0x2a499e,_0x2636f1){return function(_0x5d2c03){if(_0x5d2c03){return _0x5d2c03[_0x5e60('0x27')]()[_0x5e60('0x26')](function(){_0x2a499e[_0x5e60('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45cb62,_0x56e3a5){return function(_0x2d8aac){if(!_0x2d8aac){_0x45cb62[_0x5e60('0x19')](0x194);}return _0x2d8aac;};}function handleError(_0x4a0dbc,_0x3bedea){_0x3bedea=_0x3bedea||0x1f4;return function(_0x5712f7){logger[_0x5e60('0x28')](_0x5712f7[_0x5e60('0x29')]);if(_0x5712f7['name']){delete _0x5712f7[_0x5e60('0x2a')];}_0x4a0dbc[_0x5e60('0x1a')](_0x3bedea)['send'](_0x5712f7);};}exports[_0x5e60('0x2b')]=function(_0xac9c7a,_0x52c97c){var _0x5431a8={},_0x52f668={},_0xf25956={'count':0x0,'rows':[]};var _0x235cc7=_[_0x5e60('0x2c')](db[_0x5e60('0x2d')][_0x5e60('0x2e')],function(_0x558197){return{'name':_0x558197[_0x5e60('0x2f')],'type':_0x558197[_0x5e60('0x30')]['key']};});_0x52f668[_0x5e60('0x31')]=_['map'](_0x235cc7,'name');_0x52f668[_0x5e60('0x32')]=_[_0x5e60('0x33')](_0xac9c7a[_0x5e60('0x32')]);_0x52f668[_0x5e60('0x34')]=_[_0x5e60('0x35')](_0x52f668[_0x5e60('0x31')],_0x52f668[_0x5e60('0x32')]);_0x5431a8[_0x5e60('0x36')]=_[_0x5e60('0x35')](_0x52f668[_0x5e60('0x31')],qs['fields'](_0xac9c7a[_0x5e60('0x32')]['fields']));_0x5431a8['attributes']=_0x5431a8[_0x5e60('0x36')][_0x5e60('0x37')]?_0x5431a8['attributes']:_0x52f668[_0x5e60('0x31')];if(!_0xac9c7a['query'][_0x5e60('0x38')](_0x5e60('0x39'))){_0x5431a8[_0x5e60('0x1e')]=qs[_0x5e60('0x1e')](_0xac9c7a[_0x5e60('0x32')][_0x5e60('0x1e')]);_0x5431a8[_0x5e60('0x1d')]=qs[_0x5e60('0x1d')](_0xac9c7a['query'][_0x5e60('0x1d')]);}_0x5431a8[_0x5e60('0x3a')]=qs[_0x5e60('0x3b')](_0xac9c7a[_0x5e60('0x32')][_0x5e60('0x3b')]);_0x5431a8[_0x5e60('0x3c')]=qs[_0x5e60('0x34')](_['pick'](_0xac9c7a[_0x5e60('0x32')],_0x52f668[_0x5e60('0x34')]),_0x235cc7);if(_0xac9c7a['query']['filter']){_0x5431a8[_0x5e60('0x3c')]=_[_0x5e60('0x3d')](_0x5431a8[_0x5e60('0x3c')],{'$or':_[_0x5e60('0x2c')](_0x235cc7,function(_0x31b900){if(_0x31b900['type']!==_0x5e60('0x3e')){var _0x413bf0={};_0x413bf0[_0x31b900[_0x5e60('0x2a')]]={'$like':'%'+_0xac9c7a[_0x5e60('0x32')][_0x5e60('0x3f')]+'%'};return _0x413bf0;}})});}_0x5431a8=_[_0x5e60('0x3d')]({},_0x5431a8,_0xac9c7a[_0x5e60('0x40')]);var _0x54022a={'where':_0x5431a8[_0x5e60('0x3c')]};return db[_0x5e60('0x2d')]['count'](_0x54022a)['then'](function(_0x47a6df){_0xf25956[_0x5e60('0x20')]=_0x47a6df;if(_0xac9c7a[_0x5e60('0x32')][_0x5e60('0x41')]){_0x5431a8[_0x5e60('0x42')]=[{'all':!![]}];}return db['FreshdeskField'][_0x5e60('0x43')](_0x5431a8);})[_0x5e60('0x26')](function(_0x4b6192){_0xf25956['rows']=_0x4b6192;return _0xf25956;})[_0x5e60('0x26')](respondWithFilteredResult(_0x52c97c,_0x5431a8))[_0x5e60('0x44')](handleError(_0x52c97c,null));};exports[_0x5e60('0x45')]=function(_0x38ff1d,_0x39ab09){var _0x3899ae={'raw':!![],'where':{'id':_0x38ff1d[_0x5e60('0x46')]['id']}},_0x2522d2={};_0x2522d2[_0x5e60('0x31')]=_['keys'](db[_0x5e60('0x2d')][_0x5e60('0x2e')]);_0x2522d2['query']=_[_0x5e60('0x33')](_0x38ff1d[_0x5e60('0x32')]);_0x2522d2[_0x5e60('0x34')]=_[_0x5e60('0x35')](_0x2522d2[_0x5e60('0x31')],_0x2522d2['query']);_0x3899ae[_0x5e60('0x36')]=_[_0x5e60('0x35')](_0x2522d2[_0x5e60('0x31')],qs[_0x5e60('0x47')](_0x38ff1d['query']['fields']));_0x3899ae['attributes']=_0x3899ae[_0x5e60('0x36')][_0x5e60('0x37')]?_0x3899ae[_0x5e60('0x36')]:_0x2522d2[_0x5e60('0x31')];if(_0x38ff1d[_0x5e60('0x32')][_0x5e60('0x41')]){_0x3899ae['include']=[{'all':!![]}];}_0x3899ae=_[_0x5e60('0x3d')]({},_0x3899ae,_0x38ff1d[_0x5e60('0x40')]);return db[_0x5e60('0x2d')][_0x5e60('0x48')](_0x3899ae)[_0x5e60('0x26')](handleEntityNotFound(_0x39ab09,null))[_0x5e60('0x26')](respondWithResult(_0x39ab09,null))[_0x5e60('0x44')](handleError(_0x39ab09,null));};exports['create']=function(_0x24c757,_0x3ed45d){return db[_0x5e60('0x2d')][_0x5e60('0x49')](_0x24c757[_0x5e60('0x4a')],{})[_0x5e60('0x26')](respondWithResult(_0x3ed45d,0xc9))[_0x5e60('0x44')](handleError(_0x3ed45d,null));};exports[_0x5e60('0x25')]=function(_0x1518bd,_0x350d6d){if(_0x1518bd[_0x5e60('0x4a')]['id']){delete _0x1518bd[_0x5e60('0x4a')]['id'];}return db[_0x5e60('0x2d')][_0x5e60('0x48')]({'where':{'id':_0x1518bd[_0x5e60('0x46')]['id']}})[_0x5e60('0x26')](handleEntityNotFound(_0x350d6d,null))[_0x5e60('0x26')](saveUpdates(_0x1518bd[_0x5e60('0x4a')],null))['then'](respondWithResult(_0x350d6d,null))['catch'](handleError(_0x350d6d,null));};exports[_0x5e60('0x27')]=function(_0x4d3588,_0x3525d){return db[_0x5e60('0x2d')][_0x5e60('0x48')]({'where':{'id':_0x4d3588[_0x5e60('0x46')]['id']}})[_0x5e60('0x26')](handleEntityNotFound(_0x3525d,null))[_0x5e60('0x26')](removeEntity(_0x3525d,null))['catch'](handleError(_0x3525d,null));}; \ No newline at end of file +var _0x0647=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','apply','save','then','error','stack','index','map','FreshdeskField','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','name','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs'];(function(_0x4421c8,_0xb9c2a){var _0x20a96c=function(_0x131533){while(--_0x131533){_0x4421c8['push'](_0x4421c8['shift']());}};_0x20a96c(++_0xb9c2a);}(_0x0647,0xd0));var _0x7064=function(_0x8b8564,_0x162976){_0x8b8564=_0x8b8564-0x0;var _0x360c61=_0x0647[_0x8b8564];return _0x360c61;};'use strict';var emlformat=require(_0x7064('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7064('0x1'));var jsonpatch=require(_0x7064('0x2'));var rp=require(_0x7064('0x3'));var moment=require(_0x7064('0x4'));var BPromise=require(_0x7064('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7064('0x6'));var sox=require(_0x7064('0x7'));var csv=require(_0x7064('0x8'));var ejs=require(_0x7064('0x9'));var fs=require('fs');var fs_extra=require(_0x7064('0xa'));var _=require(_0x7064('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7064('0xc'));var deskjs=require(_0x7064('0xd'));var toCsv=require(_0x7064('0x8'));var querystring=require('querystring');var Papa=require(_0x7064('0xe'));var Redis=require(_0x7064('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x7064('0x10'));var as=require(_0x7064('0x11'));var hardwareService=require(_0x7064('0x12'));var logger=require('../../config/logger')(_0x7064('0x13'));var utils=require(_0x7064('0x14'));var config=require(_0x7064('0x15'));var licenseUtil=require(_0x7064('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x303dcd,_0x4151b6){_0x4151b6=_0x4151b6||0xcc;return function(_0x268a94){if(_0x268a94){return _0x303dcd[_0x7064('0x17')](_0x4151b6);}return _0x303dcd[_0x7064('0x18')](_0x4151b6)[_0x7064('0x19')]();};}function respondWithResult(_0x265aa6,_0x3badc8){_0x3badc8=_0x3badc8||0xc8;return function(_0x57e440){if(_0x57e440){return _0x265aa6['status'](_0x3badc8)['json'](_0x57e440);}};}function respondWithFilteredResult(_0x39f83b,_0x15a1c0){return function(_0x36378c){if(_0x36378c){var _0x4b39db=typeof _0x15a1c0[_0x7064('0x1a')]===_0x7064('0x1b')&&typeof _0x15a1c0['limit']===_0x7064('0x1b');var _0x38d20c=_0x36378c[_0x7064('0x1c')];var _0x203633=_0x4b39db?0x0:_0x15a1c0[_0x7064('0x1a')];var _0x17f306=_0x4b39db?_0x36378c[_0x7064('0x1c')]:_0x15a1c0[_0x7064('0x1a')]+_0x15a1c0[_0x7064('0x1d')];var _0x19b456;if(_0x17f306>=_0x38d20c){_0x17f306=_0x38d20c;_0x19b456=0xc8;}else{_0x19b456=0xce;}_0x39f83b[_0x7064('0x18')](_0x19b456);return _0x39f83b[_0x7064('0x1e')](_0x7064('0x1f'),_0x203633+'-'+_0x17f306+'/'+_0x38d20c)['json'](_0x36378c);}return null;};}function patchUpdates(_0x431fac){return function(_0x141983){try{jsonpatch[_0x7064('0x20')](_0x141983,_0x431fac,!![]);}catch(_0x2d49a9){return BPromise['reject'](_0x2d49a9);}return _0x141983[_0x7064('0x21')]();};}function saveUpdates(_0x51ae69,_0x446730){return function(_0x6eed9e){if(_0x6eed9e){return _0x6eed9e['update'](_0x51ae69)[_0x7064('0x22')](function(_0x14b006){return _0x14b006;});}return null;};}function removeEntity(_0x1a62a2,_0x464e8a){return function(_0x167149){if(_0x167149){return _0x167149['destroy']()['then'](function(){_0x1a62a2[_0x7064('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2eec57,_0x3b12b6){return function(_0x25d627){if(!_0x25d627){_0x2eec57['sendStatus'](0x194);}return _0x25d627;};}function handleError(_0x2749a6,_0x178150){_0x178150=_0x178150||0x1f4;return function(_0x2fedca){logger[_0x7064('0x23')](_0x2fedca[_0x7064('0x24')]);if(_0x2fedca['name']){delete _0x2fedca['name'];}_0x2749a6['status'](_0x178150)['send'](_0x2fedca);};}exports[_0x7064('0x25')]=function(_0x4aad53,_0x4406d5){var _0x411c32={},_0x51b526={},_0x40a434={'count':0x0,'rows':[]};var _0x2b26a9=_[_0x7064('0x26')](db[_0x7064('0x27')][_0x7064('0x28')],function(_0x5c1b1d){return{'name':_0x5c1b1d[_0x7064('0x29')],'type':_0x5c1b1d[_0x7064('0x2a')][_0x7064('0x2b')]};});_0x51b526[_0x7064('0x2c')]=_['map'](_0x2b26a9,'name');_0x51b526['query']=_[_0x7064('0x2d')](_0x4aad53['query']);_0x51b526[_0x7064('0x2e')]=_[_0x7064('0x2f')](_0x51b526['model'],_0x51b526[_0x7064('0x30')]);_0x411c32[_0x7064('0x31')]=_[_0x7064('0x2f')](_0x51b526[_0x7064('0x2c')],qs['fields'](_0x4aad53['query'][_0x7064('0x32')]));_0x411c32['attributes']=_0x411c32[_0x7064('0x31')][_0x7064('0x33')]?_0x411c32[_0x7064('0x31')]:_0x51b526['model'];if(!_0x4aad53[_0x7064('0x30')][_0x7064('0x34')](_0x7064('0x35'))){_0x411c32[_0x7064('0x1d')]=qs['limit'](_0x4aad53['query'][_0x7064('0x1d')]);_0x411c32[_0x7064('0x1a')]=qs['offset'](_0x4aad53[_0x7064('0x30')][_0x7064('0x1a')]);}_0x411c32[_0x7064('0x36')]=qs[_0x7064('0x37')](_0x4aad53[_0x7064('0x30')][_0x7064('0x37')]);_0x411c32[_0x7064('0x38')]=qs[_0x7064('0x2e')](_[_0x7064('0x39')](_0x4aad53[_0x7064('0x30')],_0x51b526[_0x7064('0x2e')]),_0x2b26a9);if(_0x4aad53['query'][_0x7064('0x3a')]){_0x411c32[_0x7064('0x38')]=_[_0x7064('0x3b')](_0x411c32[_0x7064('0x38')],{'$or':_[_0x7064('0x26')](_0x2b26a9,function(_0x5ad869){if(_0x5ad869[_0x7064('0x2a')]!==_0x7064('0x3c')){var _0x1ffafd={};_0x1ffafd[_0x5ad869[_0x7064('0x3d')]]={'$like':'%'+_0x4aad53[_0x7064('0x30')][_0x7064('0x3a')]+'%'};return _0x1ffafd;}})});}_0x411c32=_['merge']({},_0x411c32,_0x4aad53[_0x7064('0x3e')]);var _0xa0eef2={'where':_0x411c32['where']};return db[_0x7064('0x27')][_0x7064('0x1c')](_0xa0eef2)[_0x7064('0x22')](function(_0x2b81d9){_0x40a434[_0x7064('0x1c')]=_0x2b81d9;if(_0x4aad53[_0x7064('0x30')][_0x7064('0x3f')]){_0x411c32[_0x7064('0x40')]=[{'all':!![]}];}return db[_0x7064('0x27')][_0x7064('0x41')](_0x411c32);})[_0x7064('0x22')](function(_0x329dfa){_0x40a434[_0x7064('0x42')]=_0x329dfa;return _0x40a434;})['then'](respondWithFilteredResult(_0x4406d5,_0x411c32))[_0x7064('0x43')](handleError(_0x4406d5,null));};exports[_0x7064('0x44')]=function(_0x5953de,_0x272e3c){var _0x2e45bd={'raw':!![],'where':{'id':_0x5953de[_0x7064('0x45')]['id']}},_0x10e45f={};_0x10e45f[_0x7064('0x2c')]=_[_0x7064('0x2d')](db['FreshdeskField']['rawAttributes']);_0x10e45f[_0x7064('0x30')]=_[_0x7064('0x2d')](_0x5953de['query']);_0x10e45f[_0x7064('0x2e')]=_[_0x7064('0x2f')](_0x10e45f['model'],_0x10e45f[_0x7064('0x30')]);_0x2e45bd['attributes']=_['intersection'](_0x10e45f['model'],qs[_0x7064('0x32')](_0x5953de[_0x7064('0x30')]['fields']));_0x2e45bd[_0x7064('0x31')]=_0x2e45bd[_0x7064('0x31')]['length']?_0x2e45bd[_0x7064('0x31')]:_0x10e45f[_0x7064('0x2c')];if(_0x5953de['query'][_0x7064('0x3f')]){_0x2e45bd[_0x7064('0x40')]=[{'all':!![]}];}_0x2e45bd=_[_0x7064('0x3b')]({},_0x2e45bd,_0x5953de['options']);return db['FreshdeskField'][_0x7064('0x46')](_0x2e45bd)[_0x7064('0x22')](handleEntityNotFound(_0x272e3c,null))[_0x7064('0x22')](respondWithResult(_0x272e3c,null))[_0x7064('0x43')](handleError(_0x272e3c,null));};exports[_0x7064('0x47')]=function(_0x1f2281,_0x379aa0){return db['FreshdeskField']['create'](_0x1f2281[_0x7064('0x48')],{})[_0x7064('0x22')](respondWithResult(_0x379aa0,0xc9))[_0x7064('0x43')](handleError(_0x379aa0,null));};exports[_0x7064('0x49')]=function(_0x1db6f7,_0x56fda1){if(_0x1db6f7[_0x7064('0x48')]['id']){delete _0x1db6f7['body']['id'];}return db['FreshdeskField']['find']({'where':{'id':_0x1db6f7['params']['id']}})['then'](handleEntityNotFound(_0x56fda1,null))['then'](saveUpdates(_0x1db6f7['body'],null))[_0x7064('0x22')](respondWithResult(_0x56fda1,null))['catch'](handleError(_0x56fda1,null));};exports[_0x7064('0x4a')]=function(_0x249e43,_0xfa02c0){return db[_0x7064('0x27')][_0x7064('0x46')]({'where':{'id':_0x249e43[_0x7064('0x45')]['id']}})['then'](handleEntityNotFound(_0xfa02c0,null))['then'](removeEntity(_0xfa02c0,null))['catch'](handleError(_0xfa02c0,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 71a0d1a..d7c9d7c 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 _0x7ada=['exports','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','lodash','util','api','bluebird','request-promise','rimraf','./intFreshdeskField.attributes'];(function(_0xd1a223,_0x119ea8){var _0x387b1d=function(_0x451a40){while(--_0x451a40){_0xd1a223['push'](_0xd1a223['shift']());}};_0x387b1d(++_0x119ea8);}(_0x7ada,0x103));var _0xa7ad=function(_0x3c6995,_0xc7b0ee){_0x3c6995=_0x3c6995-0x0;var _0x22df0a=_0x7ada[_0x3c6995];return _0x22df0a;};'use strict';var _=require(_0xa7ad('0x0'));var util=require(_0xa7ad('0x1'));var logger=require('../../config/logger')(_0xa7ad('0x2'));var moment=require('moment');var BPromise=require(_0xa7ad('0x3'));var rp=require(_0xa7ad('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa7ad('0x5'));var config=require('../../config/environment');var attributes=require(_0xa7ad('0x6'));module[_0xa7ad('0x7')]=function(_0x30767,_0xb96d6a){return _0x30767[_0xa7ad('0x8')](_0xa7ad('0x9'),attributes,{'tableName':_0xa7ad('0xa'),'paranoid':![],'indexes':[{'name':_0xa7ad('0xb'),'fields':[_0xa7ad('0xc'),_0xa7ad('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3fb9=['api','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','lodash','util','../../config/logger'];(function(_0x3ce21d,_0x42d491){var _0x367043=function(_0x5eab12){while(--_0x5eab12){_0x3ce21d['push'](_0x3ce21d['shift']());}};_0x367043(++_0x42d491);}(_0x3fb9,0x1d9));var _0x93fb=function(_0x1aecf0,_0x3fdcba){_0x1aecf0=_0x1aecf0-0x0;var _0x3c2d08=_0x3fb9[_0x1aecf0];return _0x3c2d08;};'use strict';var _=require(_0x93fb('0x0'));var util=require(_0x93fb('0x1'));var logger=require(_0x93fb('0x2'))(_0x93fb('0x3'));var moment=require('moment');var BPromise=require(_0x93fb('0x4'));var rp=require(_0x93fb('0x5'));var fs=require('fs');var path=require(_0x93fb('0x6'));var rimraf=require(_0x93fb('0x7'));var config=require(_0x93fb('0x8'));var attributes=require(_0x93fb('0x9'));module[_0x93fb('0xa')]=function(_0x2c78d4,_0x347d58){return _0x2c78d4[_0x93fb('0xb')](_0x93fb('0xc'),attributes,{'tableName':_0x93fb('0xd'),'paranoid':![],'indexes':[{'name':_0x93fb('0xe'),'fields':[_0x93fb('0xf'),_0x93fb('0x10')],'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 42b649d..db6065f 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 _0x0767=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskField,\x20%s,\x20%s','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','util','moment'];(function(_0x56d9c7,_0x1de0c4){var _0x41f873=function(_0x478e51){while(--_0x478e51){_0x56d9c7['push'](_0x56d9c7['shift']());}};_0x41f873(++_0x1de0c4);}(_0x0767,0x106));var _0x7076=function(_0x45f0d4,_0x4cd5c5){_0x45f0d4=_0x45f0d4-0x0;var _0x53b011=_0x0767[_0x45f0d4];return _0x53b011;};'use strict';var _=require('lodash');var util=require(_0x7076('0x0'));var moment=require(_0x7076('0x1'));var BPromise=require(_0x7076('0x2'));var rs=require(_0x7076('0x3'));var fs=require('fs');var Redis=require(_0x7076('0x4'));var db=require(_0x7076('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7076('0x6'))(_0x7076('0x7'));var config=require(_0x7076('0x8'));var jayson=require(_0x7076('0x9'));var client=jayson[_0x7076('0xa')][_0x7076('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xe0163f,_0x1ed592,_0x42ae9b){return new BPromise(function(_0x384821,_0x497e7e){return client[_0x7076('0xc')](_0xe0163f,_0x42ae9b)[_0x7076('0xd')](function(_0x2922ff){logger[_0x7076('0xe')](_0x7076('0xf'),_0x1ed592,'request\x20sent');logger[_0x7076('0x10')](_0x7076('0x11'),_0x1ed592,_0x7076('0x12'),JSON[_0x7076('0x13')](_0x2922ff));if(_0x2922ff[_0x7076('0x14')]){if(_0x2922ff[_0x7076('0x14')]['code']===0x1f4){logger[_0x7076('0x14')]('FreshdeskField,\x20%s,\x20%s',_0x1ed592,_0x2922ff[_0x7076('0x14')][_0x7076('0x15')]);return _0x497e7e(_0x2922ff[_0x7076('0x14')]['message']);}logger['error'](_0x7076('0xf'),_0x1ed592,_0x2922ff[_0x7076('0x14')]['message']);return _0x384821(_0x2922ff[_0x7076('0x14')][_0x7076('0x15')]);}else{logger[_0x7076('0xe')](_0x7076('0xf'),_0x1ed592,_0x7076('0x12'));_0x384821(_0x2922ff['result'][_0x7076('0x15')]);}})['catch'](function(_0x511065){logger['error'](_0x7076('0xf'),_0x1ed592,_0x511065);_0x497e7e(_0x511065);});});} \ No newline at end of file +var _0x7bf6=['../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','FreshdeskField,\x20%s,\x20%s','debug','request\x20sent','error','message','info','util','moment','ioredis','../../mysqldb','../../config/utils'];(function(_0x39d982,_0x414bf7){var _0x505d99=function(_0x1bd9c9){while(--_0x1bd9c9){_0x39d982['push'](_0x39d982['shift']());}};_0x505d99(++_0x414bf7);}(_0x7bf6,0xaf));var _0x67bf=function(_0x2fca8a,_0x321893){_0x2fca8a=_0x2fca8a-0x0;var _0xe6cada=_0x7bf6[_0x2fca8a];return _0xe6cada;};'use strict';var _=require('lodash');var util=require(_0x67bf('0x0'));var moment=require(_0x67bf('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x67bf('0x2'));var db=require(_0x67bf('0x3'))['db'];var utils=require(_0x67bf('0x4'));var logger=require(_0x67bf('0x5'))(_0x67bf('0x6'));var config=require(_0x67bf('0x7'));var jayson=require(_0x67bf('0x8'));var client=jayson[_0x67bf('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4a2c6a,_0x5229d0,_0x4cc419){return new BPromise(function(_0x58efba,_0x178c98){return client[_0x67bf('0xa')](_0x4a2c6a,_0x4cc419)[_0x67bf('0xb')](function(_0x4e1b69){logger['info'](_0x67bf('0xc'),_0x5229d0,'request\x20sent');logger[_0x67bf('0xd')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x5229d0,_0x67bf('0xe'),JSON['stringify'](_0x4e1b69));if(_0x4e1b69[_0x67bf('0xf')]){if(_0x4e1b69['error']['code']===0x1f4){logger[_0x67bf('0xf')](_0x67bf('0xc'),_0x5229d0,_0x4e1b69[_0x67bf('0xf')][_0x67bf('0x10')]);return _0x178c98(_0x4e1b69[_0x67bf('0xf')][_0x67bf('0x10')]);}logger['error']('FreshdeskField,\x20%s,\x20%s',_0x5229d0,_0x4e1b69['error'][_0x67bf('0x10')]);return _0x58efba(_0x4e1b69[_0x67bf('0xf')][_0x67bf('0x10')]);}else{logger[_0x67bf('0x11')](_0x67bf('0xc'),_0x5229d0,'request\x20sent');_0x58efba(_0x4e1b69['result'][_0x67bf('0x10')]);}})['catch'](function(_0x5eab47){logger['error'](_0x67bf('0xc'),_0x5229d0,_0x5eab47);_0x178c98(_0x5eab47);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index a413924..dc1e7c8 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 _0xb7e7=['put','update','exports','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','index','get','/:id','show','/:id/configurations','isAuthenticated','getConfigurations','/:id/fields','getFields','post','create','addConfiguration'];(function(_0x5e8602,_0x2ce012){var _0x4434fb=function(_0x5ea1cb){while(--_0x5ea1cb){_0x5e8602['push'](_0x5e8602['shift']());}};_0x4434fb(++_0x2ce012);}(_0xb7e7,0x121));var _0x7b7e=function(_0x432fca,_0xb0b1b5){_0x432fca=_0x432fca-0x0;var _0x3adba4=_0xb7e7[_0x432fca];return _0x3adba4;};'use strict';var multer=require(_0x7b7e('0x0'));var util=require('util');var path=require(_0x7b7e('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b7e('0x2'));var router=express['Router']();var fs_extra=require(_0x7b7e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var controller=require(_0x7b7e('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x7b7e('0x7')]);router[_0x7b7e('0x8')](_0x7b7e('0x9'),auth['isAuthenticated'](),controller[_0x7b7e('0xa')]);router[_0x7b7e('0x8')](_0x7b7e('0xb'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0xd')]);router[_0x7b7e('0x8')](_0x7b7e('0xe'),auth['isAuthenticated'](),controller[_0x7b7e('0xf')]);router[_0x7b7e('0x10')]('/',auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x11')]);router[_0x7b7e('0x10')](_0x7b7e('0xb'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x12')]);router[_0x7b7e('0x13')]('/:id',auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x14')]);router['delete'](_0x7b7e('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x7b7e('0x15')]=router; \ No newline at end of file +var _0x4024=['express','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id/configurations','post','create','addConfiguration','put','update','delete','/:id','destroy','exports','multer','util','connect-timeout'];(function(_0x32c72e,_0x5c2fd8){var _0xf77dc5=function(_0x37c530){while(--_0x37c530){_0x32c72e['push'](_0x32c72e['shift']());}};_0xf77dc5(++_0x5c2fd8);}(_0x4024,0x89));var _0x4402=function(_0x567f78,_0x184a9f){_0x567f78=_0x567f78-0x0;var _0x51522e=_0x4024[_0x567f78];return _0x51522e;};'use strict';var multer=require(_0x4402('0x0'));var util=require(_0x4402('0x1'));var path=require('path');var timeout=require(_0x4402('0x2'));var express=require(_0x4402('0x3'));var router=express['Router']();var fs_extra=require(_0x4402('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4402('0x5'));var config=require(_0x4402('0x6'));var controller=require('./intFreshsalesAccount.controller');router['get']('/',auth[_0x4402('0x7')](),controller[_0x4402('0x8')]);router[_0x4402('0x9')]('/:id',auth[_0x4402('0x7')](),controller['show']);router['get'](_0x4402('0xa'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0x4402('0x9')]('/:id/fields',auth[_0x4402('0x7')](),controller['getFields']);router[_0x4402('0xb')]('/',auth['isAuthenticated'](),controller[_0x4402('0xc')]);router[_0x4402('0xb')]('/:id/configurations',auth[_0x4402('0x7')](),controller[_0x4402('0xd')]);router[_0x4402('0xe')]('/:id',auth[_0x4402('0x7')](),controller[_0x4402('0xf')]);router[_0x4402('0x10')](_0x4402('0x11'),auth[_0x4402('0x7')](),controller[_0x4402('0x12')]);module[_0x4402('0x13')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 94f2f97..1d675df 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 _0x4e2e=['username','remoteUri','exports','STRING'];(function(_0x958330,_0x3ae899){var _0x467da8=function(_0x48a5e7){while(--_0x48a5e7){_0x958330['push'](_0x958330['shift']());}};_0x467da8(++_0x3ae899);}(_0x4e2e,0x1f2));var _0xe4e2=function(_0x1b26bb,_0x4876a7){_0x1b26bb=_0x1b26bb-0x0;var _0x37b491=_0x4e2e[_0x1b26bb];return _0x37b491;};'use strict';var Sequelize=require('sequelize');module[_0xe4e2('0x0')]={'name':{'type':Sequelize[_0xe4e2('0x1')]},'description':{'type':Sequelize[_0xe4e2('0x1')]},'username':{'type':Sequelize[_0xe4e2('0x1')],'unique':_0xe4e2('0x2')},'apiKey':{'type':Sequelize[_0xe4e2('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xe4e2('0x3')},'serverUrl':{'type':Sequelize[_0xe4e2('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xe820=['sequelize','STRING','username'];(function(_0x5c31c8,_0x4b97a6){var _0x4bdcee=function(_0x40cd6f){while(--_0x40cd6f){_0x5c31c8['push'](_0x5c31c8['shift']());}};_0x4bdcee(++_0x4b97a6);}(_0xe820,0xd2));var _0x0e82=function(_0x37bd50,_0x6730be){_0x37bd50=_0x37bd50-0x0;var _0x91f42a=_0xe820[_0x37bd50];return _0x91f42a;};'use strict';var Sequelize=require(_0x0e82('0x0'));module['exports']={'name':{'type':Sequelize[_0x0e82('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x0e82('0x2')},'apiKey':{'type':Sequelize[_0x0e82('0x1')]},'remoteUri':{'type':Sequelize[_0x0e82('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x0e82('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index 6cde2dd..2249c83 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 _0x6e6f=['apiKey','username','remoteUri','slice','substring','format','%s%s','/api/selector/owners','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','test','statusCode','Wrong\x20credentials','rimraf','zip-dir','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/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','index','map','FreshsalesAccount','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','show','params','rawAttributes','find','create','update','body','getConfigurations','findOne','FreshsalesConfiguration','nolimit','addConfiguration','getSubjects','channel','Descriptions','getDescriptions','FreshsalesField','Subjects','getFields'];(function(_0x2743f8,_0x354d26){var _0x580986=function(_0x2e3b5f){while(--_0x2e3b5f){_0x2743f8['push'](_0x2743f8['shift']());}};_0x580986(++_0x354d26);}(_0x6e6f,0x76));var _0xf6e6=function(_0x5179a5,_0x419746){_0x5179a5=_0x5179a5-0x0;var _0x15c8ce=_0x6e6f[_0x5179a5];return _0x15c8ce;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf6e6('0x0'));var zipdir=require(_0xf6e6('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf6e6('0x2'));var moment=require(_0xf6e6('0x3'));var BPromise=require(_0xf6e6('0x4'));var Mustache=require(_0xf6e6('0x5'));var util=require(_0xf6e6('0x6'));var path=require(_0xf6e6('0x7'));var sox=require(_0xf6e6('0x8'));var csv=require('to-csv');var ejs=require(_0xf6e6('0x9'));var fs=require('fs');var fs_extra=require(_0xf6e6('0xa'));var _=require(_0xf6e6('0xb'));var squel=require(_0xf6e6('0xc'));var crypto=require(_0xf6e6('0xd'));var jsforce=require(_0xf6e6('0xe'));var deskjs=require(_0xf6e6('0xf'));var toCsv=require(_0xf6e6('0x10'));var querystring=require('querystring');var Papa=require(_0xf6e6('0x11'));var Redis=require(_0xf6e6('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xf6e6('0x13'));var as=require(_0xf6e6('0x14'));var hardwareService=require(_0xf6e6('0x15'));var logger=require(_0xf6e6('0x16'))(_0xf6e6('0x17'));var utils=require(_0xf6e6('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xf6e6('0x19'));var db=require('../../mysqldb')['db'];var integrations=require(_0xf6e6('0x1a'));function respondWithStatusCode(_0x49f6e1,_0x132117){_0x132117=_0x132117||0xcc;return function(_0x1476d3){if(_0x1476d3){return _0x49f6e1[_0xf6e6('0x1b')](_0x132117);}return _0x49f6e1[_0xf6e6('0x1c')](_0x132117)[_0xf6e6('0x1d')]();};}function respondWithResult(_0x3ac118,_0x5eb785){_0x5eb785=_0x5eb785||0xc8;return function(_0x47ed15){if(_0x47ed15){return _0x3ac118[_0xf6e6('0x1c')](_0x5eb785)[_0xf6e6('0x1e')](_0x47ed15);}};}function respondWithFilteredResult(_0x1cc43b,_0xffcde6){return function(_0xc0bac6){if(_0xc0bac6){var _0x36e928=typeof _0xffcde6[_0xf6e6('0x1f')]===_0xf6e6('0x20')&&typeof _0xffcde6[_0xf6e6('0x21')]===_0xf6e6('0x20');var _0x2acc10=_0xc0bac6[_0xf6e6('0x22')];var _0x1ddc3c=_0x36e928?0x0:_0xffcde6['offset'];var _0x439d86=_0x36e928?_0xc0bac6[_0xf6e6('0x22')]:_0xffcde6[_0xf6e6('0x1f')]+_0xffcde6[_0xf6e6('0x21')];var _0x335daf;if(_0x439d86>=_0x2acc10){_0x439d86=_0x2acc10;_0x335daf=0xc8;}else{_0x335daf=0xce;}_0x1cc43b['status'](_0x335daf);return _0x1cc43b[_0xf6e6('0x23')](_0xf6e6('0x24'),_0x1ddc3c+'-'+_0x439d86+'/'+_0x2acc10)[_0xf6e6('0x1e')](_0xc0bac6);}return null;};}function patchUpdates(_0x2993bd){return function(_0x3bcfba){try{jsonpatch[_0xf6e6('0x25')](_0x3bcfba,_0x2993bd,!![]);}catch(_0x5650d2){return BPromise[_0xf6e6('0x26')](_0x5650d2);}return _0x3bcfba['save']();};}function saveUpdates(_0x38b570,_0x2f4378){return function(_0x49b80f){if(_0x49b80f){return _0x49b80f['update'](_0x38b570)[_0xf6e6('0x27')](function(_0x303c96){return _0x303c96;});}return null;};}function removeEntity(_0x538f8d,_0x3d439b){return function(_0x46b308){if(_0x46b308){return _0x46b308[_0xf6e6('0x28')]()[_0xf6e6('0x27')](function(){_0x538f8d[_0xf6e6('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a4ead,_0x2227e0){return function(_0x2bf171){if(!_0x2bf171){_0x4a4ead[_0xf6e6('0x1b')](0x194);}return _0x2bf171;};}function handleError(_0x518a17,_0x185eb6){_0x185eb6=_0x185eb6||0x1f4;return function(_0x3fb01b){logger[_0xf6e6('0x29')](_0x3fb01b[_0xf6e6('0x2a')]);if(_0x3fb01b[_0xf6e6('0x2b')]){delete _0x3fb01b[_0xf6e6('0x2b')];}_0x518a17['status'](_0x185eb6)[_0xf6e6('0x2c')](_0x3fb01b);};}exports[_0xf6e6('0x2d')]=function(_0x3ef2ff,_0x290841){var _0x128031={},_0x4a33aa={},_0x57e994={'count':0x0,'rows':[]};var _0x298c22=_[_0xf6e6('0x2e')](db[_0xf6e6('0x2f')]['rawAttributes'],function(_0x41aab0){return{'name':_0x41aab0[_0xf6e6('0x30')],'type':_0x41aab0[_0xf6e6('0x31')]['key']};});_0x4a33aa[_0xf6e6('0x32')]=_[_0xf6e6('0x2e')](_0x298c22,_0xf6e6('0x2b'));_0x4a33aa[_0xf6e6('0x33')]=_[_0xf6e6('0x34')](_0x3ef2ff[_0xf6e6('0x33')]);_0x4a33aa[_0xf6e6('0x35')]=_['intersection'](_0x4a33aa[_0xf6e6('0x32')],_0x4a33aa['query']);_0x128031[_0xf6e6('0x36')]=_[_0xf6e6('0x37')](_0x4a33aa[_0xf6e6('0x32')],qs['fields'](_0x3ef2ff[_0xf6e6('0x33')][_0xf6e6('0x38')]));_0x128031[_0xf6e6('0x36')]=_0x128031['attributes'][_0xf6e6('0x39')]?_0x128031[_0xf6e6('0x36')]:_0x4a33aa[_0xf6e6('0x32')];if(!_0x3ef2ff[_0xf6e6('0x33')]['hasOwnProperty']('nolimit')){_0x128031[_0xf6e6('0x21')]=qs['limit'](_0x3ef2ff['query']['limit']);_0x128031[_0xf6e6('0x1f')]=qs[_0xf6e6('0x1f')](_0x3ef2ff[_0xf6e6('0x33')]['offset']);}_0x128031[_0xf6e6('0x3a')]=qs[_0xf6e6('0x3b')](_0x3ef2ff[_0xf6e6('0x33')][_0xf6e6('0x3b')]);_0x128031[_0xf6e6('0x3c')]=qs[_0xf6e6('0x35')](_[_0xf6e6('0x3d')](_0x3ef2ff['query'],_0x4a33aa[_0xf6e6('0x35')]),_0x298c22);if(_0x3ef2ff[_0xf6e6('0x33')][_0xf6e6('0x3e')]){_0x128031['where']=_[_0xf6e6('0x3f')](_0x128031[_0xf6e6('0x3c')],{'$or':_[_0xf6e6('0x2e')](_0x298c22,function(_0x5cc359){if(_0x5cc359[_0xf6e6('0x31')]!==_0xf6e6('0x40')){var _0x3076fe={};_0x3076fe[_0x5cc359[_0xf6e6('0x2b')]]={'$like':'%'+_0x3ef2ff['query'][_0xf6e6('0x3e')]+'%'};return _0x3076fe;}})});}_0x128031=_[_0xf6e6('0x3f')]({},_0x128031,_0x3ef2ff[_0xf6e6('0x41')]);var _0x26d18d={'where':_0x128031[_0xf6e6('0x3c')]};return db[_0xf6e6('0x2f')][_0xf6e6('0x22')](_0x26d18d)[_0xf6e6('0x27')](function(_0x3a2b82){_0x57e994[_0xf6e6('0x22')]=_0x3a2b82;if(_0x3ef2ff['query'][_0xf6e6('0x42')]){_0x128031[_0xf6e6('0x43')]=[{'all':!![]}];}return db['FreshsalesAccount']['findAll'](_0x128031);})['then'](function(_0xfc15b8){_0x57e994['rows']=_0xfc15b8;return _0x57e994;})[_0xf6e6('0x27')](respondWithFilteredResult(_0x290841,_0x128031))[_0xf6e6('0x44')](handleError(_0x290841,null));};exports[_0xf6e6('0x45')]=function(_0x3f9fd7,_0x454e85){var _0x125af6={'raw':![],'where':{'id':_0x3f9fd7[_0xf6e6('0x46')]['id']}},_0x2192ec={};_0x2192ec[_0xf6e6('0x32')]=_['keys'](db[_0xf6e6('0x2f')][_0xf6e6('0x47')]);_0x2192ec['query']=_[_0xf6e6('0x34')](_0x3f9fd7[_0xf6e6('0x33')]);_0x2192ec[_0xf6e6('0x35')]=_[_0xf6e6('0x37')](_0x2192ec[_0xf6e6('0x32')],_0x2192ec[_0xf6e6('0x33')]);_0x125af6[_0xf6e6('0x36')]=_[_0xf6e6('0x37')](_0x2192ec[_0xf6e6('0x32')],qs[_0xf6e6('0x38')](_0x3f9fd7[_0xf6e6('0x33')]['fields']));_0x125af6[_0xf6e6('0x36')]=_0x125af6[_0xf6e6('0x36')][_0xf6e6('0x39')]?_0x125af6['attributes']:_0x2192ec['model'];if(_0x3f9fd7[_0xf6e6('0x33')]['includeAll']){_0x125af6['include']=[{'all':!![]}];}_0x125af6=_[_0xf6e6('0x3f')]({},_0x125af6,_0x3f9fd7[_0xf6e6('0x41')]);return db[_0xf6e6('0x2f')][_0xf6e6('0x48')](_0x125af6)[_0xf6e6('0x27')](handleEntityNotFound(_0x454e85,null))['then'](respondWithResult(_0x454e85,null))[_0xf6e6('0x44')](handleError(_0x454e85,null));};exports['create']=function(_0x34c9f9,_0x2d091e){return db[_0xf6e6('0x2f')][_0xf6e6('0x49')](_0x34c9f9['body'],{})[_0xf6e6('0x27')](respondWithResult(_0x2d091e,0xc9))[_0xf6e6('0x44')](handleError(_0x2d091e,null));};exports[_0xf6e6('0x4a')]=function(_0x32c25a,_0x1366b2){if(_0x32c25a[_0xf6e6('0x4b')]['id']){delete _0x32c25a[_0xf6e6('0x4b')]['id'];}return db['FreshsalesAccount'][_0xf6e6('0x48')]({'where':{'id':_0x32c25a['params']['id']}})[_0xf6e6('0x27')](handleEntityNotFound(_0x1366b2,null))['then'](saveUpdates(_0x32c25a[_0xf6e6('0x4b')],null))[_0xf6e6('0x27')](respondWithResult(_0x1366b2,null))[_0xf6e6('0x44')](handleError(_0x1366b2,null));};exports[_0xf6e6('0x28')]=function(_0x2d1cfa,_0x241d51){return db[_0xf6e6('0x2f')][_0xf6e6('0x48')]({'where':{'id':_0x2d1cfa[_0xf6e6('0x46')]['id']}})[_0xf6e6('0x27')](handleEntityNotFound(_0x241d51,null))['then'](removeEntity(_0x241d51,null))[_0xf6e6('0x44')](handleError(_0x241d51,null));};exports[_0xf6e6('0x4c')]=function(_0x119b48,_0x40b6cd,_0x4967e7){var _0x3ecdb9={};var _0x4dc3fd={};var _0x3471c4;var _0x20c54c;return db[_0xf6e6('0x2f')][_0xf6e6('0x4d')]({'where':{'id':_0x119b48[_0xf6e6('0x46')]['id']}})[_0xf6e6('0x27')](handleEntityNotFound(_0x40b6cd,null))['then'](function(_0x1b50e9){if(_0x1b50e9){_0x3471c4=_0x1b50e9;_0x4dc3fd[_0xf6e6('0x32')]=_['keys'](db[_0xf6e6('0x4e')][_0xf6e6('0x47')]);_0x4dc3fd[_0xf6e6('0x33')]=_[_0xf6e6('0x34')](_0x119b48['query']);_0x4dc3fd[_0xf6e6('0x35')]=_[_0xf6e6('0x37')](_0x4dc3fd[_0xf6e6('0x32')],_0x4dc3fd['query']);_0x3ecdb9[_0xf6e6('0x36')]=_['intersection'](_0x4dc3fd[_0xf6e6('0x32')],qs[_0xf6e6('0x38')](_0x119b48[_0xf6e6('0x33')][_0xf6e6('0x38')]));_0x3ecdb9['attributes']=_0x3ecdb9[_0xf6e6('0x36')]['length']?_0x3ecdb9[_0xf6e6('0x36')]:_0x4dc3fd[_0xf6e6('0x32')];_0x3ecdb9[_0xf6e6('0x3a')]=qs[_0xf6e6('0x3b')](_0x119b48[_0xf6e6('0x33')][_0xf6e6('0x3b')]);_0x3ecdb9[_0xf6e6('0x3c')]=qs[_0xf6e6('0x35')](_[_0xf6e6('0x3d')](_0x119b48[_0xf6e6('0x33')],_0x4dc3fd[_0xf6e6('0x35')]));if(_0x119b48['query'][_0xf6e6('0x3e')]){_0x3ecdb9[_0xf6e6('0x3c')]=_['merge'](_0x3ecdb9[_0xf6e6('0x3c')],{'$or':_['map'](_0x3ecdb9[_0xf6e6('0x36')],function(_0x17fd62){var _0x5bebac={};_0x5bebac[_0x17fd62]={'$like':'%'+_0x119b48[_0xf6e6('0x33')][_0xf6e6('0x3e')]+'%'};return _0x5bebac;})});}_0x3ecdb9=_[_0xf6e6('0x3f')]({},_0x3ecdb9,_0x119b48[_0xf6e6('0x41')]);return _0x3471c4['getConfigurations'](_0x3ecdb9);}})['then'](function(_0x145ca5){if(_0x145ca5){_0x20c54c=_0x145ca5['length'];if(!_0x119b48[_0xf6e6('0x33')]['hasOwnProperty'](_0xf6e6('0x4f'))){_0x3ecdb9[_0xf6e6('0x21')]=qs['limit'](_0x119b48[_0xf6e6('0x33')][_0xf6e6('0x21')]);_0x3ecdb9[_0xf6e6('0x1f')]=qs[_0xf6e6('0x1f')](_0x119b48[_0xf6e6('0x33')][_0xf6e6('0x1f')]);}return _0x3471c4[_0xf6e6('0x4c')](_0x3ecdb9);}})[_0xf6e6('0x27')](function(_0x4fd22f){if(_0x4fd22f){return _0x4fd22f?{'count':_0x20c54c,'rows':_0x4fd22f}:null;}})['then'](respondWithResult(_0x40b6cd,null))[_0xf6e6('0x44')](handleError(_0x40b6cd,null));};exports[_0xf6e6('0x50')]=function(_0x84eba1,_0x42b285,_0x4f3fa9){if(_0x84eba1[_0xf6e6('0x4b')]['id']){delete _0x84eba1[_0xf6e6('0x4b')]['id'];}return db[_0xf6e6('0x2f')][_0xf6e6('0x4d')]({'where':{'id':_0x84eba1[_0xf6e6('0x46')]['id']}})[_0xf6e6('0x27')](handleEntityNotFound(_0x42b285,null))[_0xf6e6('0x27')](function(_0x2a4388){if(_0x2a4388){_0x84eba1[_0xf6e6('0x4b')]['AccountId']=_0x2a4388['id'];_0x84eba1['body']['Subjects']=integrations[_0xf6e6('0x51')](_0x84eba1[_0xf6e6('0x4b')][_0xf6e6('0x52')],_0x84eba1[_0xf6e6('0x4b')][_0xf6e6('0x31')]);_0x84eba1[_0xf6e6('0x4b')][_0xf6e6('0x53')]=integrations[_0xf6e6('0x54')](_0x84eba1['body']['channel'],_0x84eba1[_0xf6e6('0x4b')]['type']);return db[_0xf6e6('0x4e')][_0xf6e6('0x49')](_0x84eba1[_0xf6e6('0x4b')],{'include':[{'model':db[_0xf6e6('0x55')],'as':_0xf6e6('0x56')},{'model':db[_0xf6e6('0x55')],'as':_0xf6e6('0x53')}]});}return null;})['then'](respondWithResult(_0x42b285,null))[_0xf6e6('0x44')](handleError(_0x42b285,null));};exports[_0xf6e6('0x57')]=function(_0x43b953,_0x49cef4,_0x208f5f){var _0x4872a8='';var _0x3a3970='';return db[_0xf6e6('0x2f')][_0xf6e6('0x4d')]({'where':{'id':_0x43b953[_0xf6e6('0x46')]['id']},'attributes':['id','username','remoteUri',_0xf6e6('0x58')]})[_0xf6e6('0x27')](handleEntityNotFound(_0x49cef4,null))['then'](function(_0x406844){if(_0x406844){_0x3a3970=_0x406844[_0xf6e6('0x59')];_0x4872a8=_0x406844['remoteUri'];var _0x3b5d31=_0x406844[_0xf6e6('0x5a')][_0xf6e6('0x5b')](-0x1);if(_0x3b5d31==='/'){_0x4872a8=_0x4872a8[_0xf6e6('0x5c')](0x0,_0x4872a8['lastIndexOf'](_0x3b5d31));}return rp({'method':'GET','uri':util[_0xf6e6('0x5d')](_0xf6e6('0x5e'),_0x4872a8,_0xf6e6('0x5f')),'headers':{'Authorization':_0xf6e6('0x60')+_0x406844['apiKey']},'json':!![]});}})[_0xf6e6('0x27')](function(_0x49eab4){if(_0x49eab4){var _0x38aabd=_0x49eab4[_0xf6e6('0x61')];var _0x3e9c5f=![];var _0x2a0042=null;for(_0x2a0042=0x0;_0x2a0042<_0x38aabd[_0xf6e6('0x39')];_0x2a0042++){if(_0x38aabd[_0x2a0042][_0xf6e6('0x62')]===_0x3a3970){_0x3e9c5f=!![];}}if(_0x3e9c5f){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xf6e6('0x63')});}}})[_0xf6e6('0x27')](respondWithResult(_0x49cef4,null))[_0xf6e6('0x44')](function(_0x166a22){var _0x3e3991=_0x43b953[_0xf6e6('0x33')][_0xf6e6('0x64')]?0x1f4:_0x166a22[_0xf6e6('0x65')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0xf6e6('0x57'),_0x3e3991,JSON['stringify'](_0x166a22));delete _0x166a22[_0xf6e6('0x2b')];if(_0x3e3991===0x191){_0x3e3991=0x190;}_0x49cef4[_0xf6e6('0x1c')](_0x3e3991)[_0xf6e6('0x2c')](_0x43b953[_0xf6e6('0x33')][_0xf6e6('0x64')]?{'message':_0xf6e6('0x66'),'statusCode':_0x166a22['statusCode']}:_0x166a22);});}; \ No newline at end of file +var _0x9d7c=['../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','count','limit','set','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','FreshsalesAccount','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','nolimit','order','sort','filters','merge','where','type','filter','options','include','findAll','rows','show','params','length','find','catch','create','body','getConfigurations','findOne','FreshsalesConfiguration','hasOwnProperty','addConfiguration','Subjects','channel','getDescriptions','FreshsalesField','Descriptions','getFields','username','remoteUri','apiKey','substring','lastIndexOf','GET','%s%s','/api/selector/owners','Token\x20token=','users','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util'];(function(_0x4997d6,_0x28cb64){var _0x39d5cb=function(_0x4ab967){while(--_0x4ab967){_0x4997d6['push'](_0x4997d6['shift']());}};_0x39d5cb(++_0x28cb64);}(_0x9d7c,0x183));var _0xc9d7=function(_0xa9eaa0,_0x4ba2b4){_0xa9eaa0=_0xa9eaa0-0x0;var _0x30897a=_0x9d7c[_0xa9eaa0];return _0x30897a;};'use strict';var emlformat=require(_0xc9d7('0x0'));var rimraf=require(_0xc9d7('0x1'));var zipdir=require(_0xc9d7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc9d7('0x3'));var moment=require(_0xc9d7('0x4'));var BPromise=require(_0xc9d7('0x5'));var Mustache=require(_0xc9d7('0x6'));var util=require(_0xc9d7('0x7'));var path=require(_0xc9d7('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc9d7('0x9'));var _=require(_0xc9d7('0xa'));var squel=require(_0xc9d7('0xb'));var crypto=require(_0xc9d7('0xc'));var jsforce=require(_0xc9d7('0xd'));var deskjs=require(_0xc9d7('0xe'));var toCsv=require(_0xc9d7('0xf'));var querystring=require(_0xc9d7('0x10'));var Papa=require(_0xc9d7('0x11'));var Redis=require('ioredis');var authService=require(_0xc9d7('0x12'));var qs=require(_0xc9d7('0x13'));var as=require(_0xc9d7('0x14'));var hardwareService=require(_0xc9d7('0x15'));var logger=require(_0xc9d7('0x16'))('api');var utils=require('../../config/utils');var config=require(_0xc9d7('0x17'));var licenseUtil=require(_0xc9d7('0x18'));var db=require(_0xc9d7('0x19'))['db'];var integrations=require(_0xc9d7('0x1a'));function respondWithStatusCode(_0x5a1c5c,_0x39e3e4){_0x39e3e4=_0x39e3e4||0xcc;return function(_0x3acadb){if(_0x3acadb){return _0x5a1c5c[_0xc9d7('0x1b')](_0x39e3e4);}return _0x5a1c5c['status'](_0x39e3e4)['end']();};}function respondWithResult(_0x2872f0,_0x4746f1){_0x4746f1=_0x4746f1||0xc8;return function(_0x45531d){if(_0x45531d){return _0x2872f0[_0xc9d7('0x1c')](_0x4746f1)[_0xc9d7('0x1d')](_0x45531d);}};}function respondWithFilteredResult(_0x4bf203,_0x4e4f73){return function(_0x37c170){if(_0x37c170){var _0x1da5a9=typeof _0x4e4f73[_0xc9d7('0x1e')]===_0xc9d7('0x1f')&&typeof _0x4e4f73['limit']===_0xc9d7('0x1f');var _0x1fefb1=_0x37c170['count'];var _0x25057b=_0x1da5a9?0x0:_0x4e4f73['offset'];var _0x107fe8=_0x1da5a9?_0x37c170[_0xc9d7('0x20')]:_0x4e4f73[_0xc9d7('0x1e')]+_0x4e4f73[_0xc9d7('0x21')];var _0x51cce6;if(_0x107fe8>=_0x1fefb1){_0x107fe8=_0x1fefb1;_0x51cce6=0xc8;}else{_0x51cce6=0xce;}_0x4bf203[_0xc9d7('0x1c')](_0x51cce6);return _0x4bf203[_0xc9d7('0x22')]('Content-Range',_0x25057b+'-'+_0x107fe8+'/'+_0x1fefb1)[_0xc9d7('0x1d')](_0x37c170);}return null;};}function patchUpdates(_0x2c42a1){return function(_0x157b9f){try{jsonpatch[_0xc9d7('0x23')](_0x157b9f,_0x2c42a1,!![]);}catch(_0x22b2b9){return BPromise[_0xc9d7('0x24')](_0x22b2b9);}return _0x157b9f[_0xc9d7('0x25')]();};}function saveUpdates(_0x1af270,_0x5288e3){return function(_0x171fae){if(_0x171fae){return _0x171fae[_0xc9d7('0x26')](_0x1af270)['then'](function(_0x9cadf0){return _0x9cadf0;});}return null;};}function removeEntity(_0x38ee0b,_0x2c898a){return function(_0x215f09){if(_0x215f09){return _0x215f09[_0xc9d7('0x27')]()[_0xc9d7('0x28')](function(){_0x38ee0b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x25b8f8,_0x3e5d96){return function(_0x18940d){if(!_0x18940d){_0x25b8f8['sendStatus'](0x194);}return _0x18940d;};}function handleError(_0x33ae63,_0x370f9b){_0x370f9b=_0x370f9b||0x1f4;return function(_0x5f257e){logger[_0xc9d7('0x29')](_0x5f257e[_0xc9d7('0x2a')]);if(_0x5f257e[_0xc9d7('0x2b')]){delete _0x5f257e[_0xc9d7('0x2b')];}_0x33ae63[_0xc9d7('0x1c')](_0x370f9b)[_0xc9d7('0x2c')](_0x5f257e);};}exports[_0xc9d7('0x2d')]=function(_0x385dab,_0x3d0623){var _0x386e8a={},_0x3af11e={},_0x133d76={'count':0x0,'rows':[]};var _0x9dc871=_[_0xc9d7('0x2e')](db[_0xc9d7('0x2f')][_0xc9d7('0x30')],function(_0x4d7bfe){return{'name':_0x4d7bfe[_0xc9d7('0x31')],'type':_0x4d7bfe['type'][_0xc9d7('0x32')]};});_0x3af11e[_0xc9d7('0x33')]=_[_0xc9d7('0x2e')](_0x9dc871,'name');_0x3af11e[_0xc9d7('0x34')]=_[_0xc9d7('0x35')](_0x385dab[_0xc9d7('0x34')]);_0x3af11e['filters']=_[_0xc9d7('0x36')](_0x3af11e[_0xc9d7('0x33')],_0x3af11e[_0xc9d7('0x34')]);_0x386e8a[_0xc9d7('0x37')]=_[_0xc9d7('0x36')](_0x3af11e[_0xc9d7('0x33')],qs['fields'](_0x385dab['query'][_0xc9d7('0x38')]));_0x386e8a[_0xc9d7('0x37')]=_0x386e8a[_0xc9d7('0x37')]['length']?_0x386e8a[_0xc9d7('0x37')]:_0x3af11e[_0xc9d7('0x33')];if(!_0x385dab[_0xc9d7('0x34')]['hasOwnProperty'](_0xc9d7('0x39'))){_0x386e8a['limit']=qs[_0xc9d7('0x21')](_0x385dab['query'][_0xc9d7('0x21')]);_0x386e8a[_0xc9d7('0x1e')]=qs[_0xc9d7('0x1e')](_0x385dab[_0xc9d7('0x34')][_0xc9d7('0x1e')]);}_0x386e8a[_0xc9d7('0x3a')]=qs['sort'](_0x385dab[_0xc9d7('0x34')][_0xc9d7('0x3b')]);_0x386e8a['where']=qs[_0xc9d7('0x3c')](_['pick'](_0x385dab[_0xc9d7('0x34')],_0x3af11e[_0xc9d7('0x3c')]),_0x9dc871);if(_0x385dab['query']['filter']){_0x386e8a['where']=_[_0xc9d7('0x3d')](_0x386e8a[_0xc9d7('0x3e')],{'$or':_[_0xc9d7('0x2e')](_0x9dc871,function(_0x1a3c53){if(_0x1a3c53[_0xc9d7('0x3f')]!=='VIRTUAL'){var _0x14e8ab={};_0x14e8ab[_0x1a3c53[_0xc9d7('0x2b')]]={'$like':'%'+_0x385dab['query'][_0xc9d7('0x40')]+'%'};return _0x14e8ab;}})});}_0x386e8a=_[_0xc9d7('0x3d')]({},_0x386e8a,_0x385dab[_0xc9d7('0x41')]);var _0x50fa9d={'where':_0x386e8a[_0xc9d7('0x3e')]};return db[_0xc9d7('0x2f')][_0xc9d7('0x20')](_0x50fa9d)[_0xc9d7('0x28')](function(_0x1be992){_0x133d76[_0xc9d7('0x20')]=_0x1be992;if(_0x385dab['query']['includeAll']){_0x386e8a[_0xc9d7('0x42')]=[{'all':!![]}];}return db[_0xc9d7('0x2f')][_0xc9d7('0x43')](_0x386e8a);})[_0xc9d7('0x28')](function(_0x5eafd6){_0x133d76[_0xc9d7('0x44')]=_0x5eafd6;return _0x133d76;})[_0xc9d7('0x28')](respondWithFilteredResult(_0x3d0623,_0x386e8a))['catch'](handleError(_0x3d0623,null));};exports[_0xc9d7('0x45')]=function(_0x1e3d83,_0x3df637){var _0x166879={'raw':![],'where':{'id':_0x1e3d83[_0xc9d7('0x46')]['id']}},_0xf4e2c={};_0xf4e2c[_0xc9d7('0x33')]=_['keys'](db[_0xc9d7('0x2f')][_0xc9d7('0x30')]);_0xf4e2c[_0xc9d7('0x34')]=_[_0xc9d7('0x35')](_0x1e3d83[_0xc9d7('0x34')]);_0xf4e2c[_0xc9d7('0x3c')]=_[_0xc9d7('0x36')](_0xf4e2c[_0xc9d7('0x33')],_0xf4e2c[_0xc9d7('0x34')]);_0x166879['attributes']=_[_0xc9d7('0x36')](_0xf4e2c[_0xc9d7('0x33')],qs[_0xc9d7('0x38')](_0x1e3d83['query'][_0xc9d7('0x38')]));_0x166879[_0xc9d7('0x37')]=_0x166879[_0xc9d7('0x37')][_0xc9d7('0x47')]?_0x166879[_0xc9d7('0x37')]:_0xf4e2c[_0xc9d7('0x33')];if(_0x1e3d83[_0xc9d7('0x34')]['includeAll']){_0x166879[_0xc9d7('0x42')]=[{'all':!![]}];}_0x166879=_['merge']({},_0x166879,_0x1e3d83['options']);return db['FreshsalesAccount'][_0xc9d7('0x48')](_0x166879)['then'](handleEntityNotFound(_0x3df637,null))[_0xc9d7('0x28')](respondWithResult(_0x3df637,null))[_0xc9d7('0x49')](handleError(_0x3df637,null));};exports[_0xc9d7('0x4a')]=function(_0x5b8f4f,_0x547059){return db[_0xc9d7('0x2f')]['create'](_0x5b8f4f['body'],{})[_0xc9d7('0x28')](respondWithResult(_0x547059,0xc9))[_0xc9d7('0x49')](handleError(_0x547059,null));};exports[_0xc9d7('0x26')]=function(_0x4d5759,_0x301b5a){if(_0x4d5759['body']['id']){delete _0x4d5759[_0xc9d7('0x4b')]['id'];}return db['FreshsalesAccount'][_0xc9d7('0x48')]({'where':{'id':_0x4d5759[_0xc9d7('0x46')]['id']}})[_0xc9d7('0x28')](handleEntityNotFound(_0x301b5a,null))[_0xc9d7('0x28')](saveUpdates(_0x4d5759[_0xc9d7('0x4b')],null))[_0xc9d7('0x28')](respondWithResult(_0x301b5a,null))[_0xc9d7('0x49')](handleError(_0x301b5a,null));};exports[_0xc9d7('0x27')]=function(_0x5e7aa4,_0x1469f5){return db[_0xc9d7('0x2f')]['find']({'where':{'id':_0x5e7aa4[_0xc9d7('0x46')]['id']}})[_0xc9d7('0x28')](handleEntityNotFound(_0x1469f5,null))['then'](removeEntity(_0x1469f5,null))['catch'](handleError(_0x1469f5,null));};exports[_0xc9d7('0x4c')]=function(_0x38759e,_0x5668b1,_0x28c94d){var _0x149536={};var _0x300c9a={};var _0x1fa57c;var _0x4a3c07;return db[_0xc9d7('0x2f')][_0xc9d7('0x4d')]({'where':{'id':_0x38759e[_0xc9d7('0x46')]['id']}})[_0xc9d7('0x28')](handleEntityNotFound(_0x5668b1,null))[_0xc9d7('0x28')](function(_0x1c6dbe){if(_0x1c6dbe){_0x1fa57c=_0x1c6dbe;_0x300c9a['model']=_[_0xc9d7('0x35')](db[_0xc9d7('0x4e')]['rawAttributes']);_0x300c9a[_0xc9d7('0x34')]=_[_0xc9d7('0x35')](_0x38759e[_0xc9d7('0x34')]);_0x300c9a[_0xc9d7('0x3c')]=_['intersection'](_0x300c9a['model'],_0x300c9a[_0xc9d7('0x34')]);_0x149536[_0xc9d7('0x37')]=_[_0xc9d7('0x36')](_0x300c9a[_0xc9d7('0x33')],qs[_0xc9d7('0x38')](_0x38759e['query']['fields']));_0x149536[_0xc9d7('0x37')]=_0x149536[_0xc9d7('0x37')][_0xc9d7('0x47')]?_0x149536[_0xc9d7('0x37')]:_0x300c9a[_0xc9d7('0x33')];_0x149536['order']=qs[_0xc9d7('0x3b')](_0x38759e[_0xc9d7('0x34')]['sort']);_0x149536[_0xc9d7('0x3e')]=qs[_0xc9d7('0x3c')](_['pick'](_0x38759e[_0xc9d7('0x34')],_0x300c9a[_0xc9d7('0x3c')]));if(_0x38759e[_0xc9d7('0x34')][_0xc9d7('0x40')]){_0x149536[_0xc9d7('0x3e')]=_['merge'](_0x149536['where'],{'$or':_[_0xc9d7('0x2e')](_0x149536[_0xc9d7('0x37')],function(_0x5c604c){var _0x86e051={};_0x86e051[_0x5c604c]={'$like':'%'+_0x38759e[_0xc9d7('0x34')][_0xc9d7('0x40')]+'%'};return _0x86e051;})});}_0x149536=_[_0xc9d7('0x3d')]({},_0x149536,_0x38759e[_0xc9d7('0x41')]);return _0x1fa57c[_0xc9d7('0x4c')](_0x149536);}})[_0xc9d7('0x28')](function(_0x3654a1){if(_0x3654a1){_0x4a3c07=_0x3654a1[_0xc9d7('0x47')];if(!_0x38759e['query'][_0xc9d7('0x4f')](_0xc9d7('0x39'))){_0x149536[_0xc9d7('0x21')]=qs[_0xc9d7('0x21')](_0x38759e[_0xc9d7('0x34')]['limit']);_0x149536[_0xc9d7('0x1e')]=qs[_0xc9d7('0x1e')](_0x38759e[_0xc9d7('0x34')][_0xc9d7('0x1e')]);}return _0x1fa57c[_0xc9d7('0x4c')](_0x149536);}})['then'](function(_0x4af321){if(_0x4af321){return _0x4af321?{'count':_0x4a3c07,'rows':_0x4af321}:null;}})['then'](respondWithResult(_0x5668b1,null))[_0xc9d7('0x49')](handleError(_0x5668b1,null));};exports[_0xc9d7('0x50')]=function(_0x4edf15,_0x390940,_0x2d9ddc){if(_0x4edf15[_0xc9d7('0x4b')]['id']){delete _0x4edf15['body']['id'];}return db[_0xc9d7('0x2f')]['findOne']({'where':{'id':_0x4edf15[_0xc9d7('0x46')]['id']}})[_0xc9d7('0x28')](handleEntityNotFound(_0x390940,null))[_0xc9d7('0x28')](function(_0x406d17){if(_0x406d17){_0x4edf15[_0xc9d7('0x4b')]['AccountId']=_0x406d17['id'];_0x4edf15['body'][_0xc9d7('0x51')]=integrations['getSubjects'](_0x4edf15[_0xc9d7('0x4b')][_0xc9d7('0x52')],_0x4edf15['body']['type']);_0x4edf15[_0xc9d7('0x4b')]['Descriptions']=integrations[_0xc9d7('0x53')](_0x4edf15['body'][_0xc9d7('0x52')],_0x4edf15[_0xc9d7('0x4b')]['type']);return db[_0xc9d7('0x4e')]['create'](_0x4edf15['body'],{'include':[{'model':db[_0xc9d7('0x54')],'as':'Subjects'},{'model':db['FreshsalesField'],'as':_0xc9d7('0x55')}]});}return null;})['then'](respondWithResult(_0x390940,null))['catch'](handleError(_0x390940,null));};exports[_0xc9d7('0x56')]=function(_0x3c3ee9,_0x5f33a2,_0x363b18){var _0x46a4a7='';var _0x146dc7='';return db[_0xc9d7('0x2f')][_0xc9d7('0x4d')]({'where':{'id':_0x3c3ee9['params']['id']},'attributes':['id',_0xc9d7('0x57'),_0xc9d7('0x58'),_0xc9d7('0x59')]})[_0xc9d7('0x28')](handleEntityNotFound(_0x5f33a2,null))[_0xc9d7('0x28')](function(_0x7864fb){if(_0x7864fb){_0x146dc7=_0x7864fb[_0xc9d7('0x57')];_0x46a4a7=_0x7864fb[_0xc9d7('0x58')];var _0x2cf7d0=_0x7864fb['remoteUri']['slice'](-0x1);if(_0x2cf7d0==='/'){_0x46a4a7=_0x46a4a7[_0xc9d7('0x5a')](0x0,_0x46a4a7[_0xc9d7('0x5b')](_0x2cf7d0));}return rp({'method':_0xc9d7('0x5c'),'uri':util['format'](_0xc9d7('0x5d'),_0x46a4a7,_0xc9d7('0x5e')),'headers':{'Authorization':_0xc9d7('0x5f')+_0x7864fb[_0xc9d7('0x59')]},'json':!![]});}})['then'](function(_0x5511e8){if(_0x5511e8){var _0x4e8e58=_0x5511e8[_0xc9d7('0x60')];var _0x2bb48b=![];var _0x591060=null;for(_0x591060=0x0;_0x591060<_0x4e8e58[_0xc9d7('0x47')];_0x591060++){if(_0x4e8e58[_0x591060]['email']===_0x146dc7){_0x2bb48b=!![];}}if(_0x2bb48b){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xc9d7('0x61')});}}})[_0xc9d7('0x28')](respondWithResult(_0x5f33a2,null))[_0xc9d7('0x49')](function(_0x27d3ad){var _0xbd11ca=_0x3c3ee9['query'][_0xc9d7('0x62')]?0x1f4:_0x27d3ad[_0xc9d7('0x63')]||0x1f4;logger[_0xc9d7('0x29')](_0xc9d7('0x64'),_0xc9d7('0x56'),_0xbd11ca,JSON[_0xc9d7('0x65')](_0x27d3ad));delete _0x27d3ad[_0xc9d7('0x2b')];if(_0xbd11ca===0x191){_0xbd11ca=0x190;}_0x5f33a2['status'](_0xbd11ca)[_0xc9d7('0x2c')](_0x3c3ee9[_0xc9d7('0x34')]['test']?{'message':_0xc9d7('0x66'),'statusCode':_0x27d3ad[_0xc9d7('0x63')]}:_0x27d3ad);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index dadc092..cfc14f0 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 _0xcaf2=['./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','FreshsalesAccount','int_freshsales_accounts','lodash','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0xe9c8e4,_0x3aa2f6){var _0x2037fa=function(_0xcb43b1){while(--_0xcb43b1){_0xe9c8e4['push'](_0xe9c8e4['shift']());}};_0x2037fa(++_0x3aa2f6);}(_0xcaf2,0x8a));var _0x2caf=function(_0x48b724,_0x5a8e26){_0x48b724=_0x48b724-0x0;var _0x4d38b3=_0xcaf2[_0x48b724];return _0x4d38b3;};'use strict';var _=require(_0x2caf('0x0'));var util=require('util');var logger=require(_0x2caf('0x1'))(_0x2caf('0x2'));var moment=require('moment');var BPromise=require(_0x2caf('0x3'));var rp=require(_0x2caf('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2caf('0x5'));var config=require('../../config/environment');var attributes=require(_0x2caf('0x6'));var integrations=require(_0x2caf('0x7'));module[_0x2caf('0x8')]=function(_0x599ce7,_0xc44e4e){return _0x599ce7[_0x2caf('0x9')](_0x2caf('0xa'),attributes,{'tableName':_0x2caf('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdb28=['bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','FreshsalesAccount','int_freshsales_accounts','lodash','util','../../config/logger','api'];(function(_0x53e3bf,_0x547106){var _0x59b198=function(_0x329bb4){while(--_0x329bb4){_0x53e3bf['push'](_0x53e3bf['shift']());}};_0x59b198(++_0x547106);}(_0xdb28,0x106));var _0x8db2=function(_0x633c65,_0x2e94a2){_0x633c65=_0x633c65-0x0;var _0x476caa=_0xdb28[_0x633c65];return _0x476caa;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var logger=require(_0x8db2('0x2'))(_0x8db2('0x3'));var moment=require('moment');var BPromise=require(_0x8db2('0x4'));var rp=require(_0x8db2('0x5'));var fs=require('fs');var path=require(_0x8db2('0x6'));var rimraf=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var attributes=require('./intFreshsalesAccount.attributes');var integrations=require(_0x8db2('0x9'));module[_0x8db2('0xa')]=function(_0x5f42ee,_0x494b40){return _0x5f42ee[_0x8db2('0xb')](_0x8db2('0xc'),attributes,{'tableName':_0x8db2('0xd'),'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 2befba2..ad2355e 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 _0xafc4=['raw','where','attributes','limit','include','model','map','ShowFreshsalesAccount','find','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','info','FreshsalesAccount,\x20%s,\x20%s','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','GetFreshsalesAccount','FreshsalesAccount','options'];(function(_0x4e43d4,_0xd760d0){var _0x4db61c=function(_0x4385c5){while(--_0x4385c5){_0x4e43d4['push'](_0x4e43d4['shift']());}};_0x4db61c(++_0xd760d0);}(_0xafc4,0x69));var _0x4afc=function(_0x531fe7,_0x58edb7){_0x531fe7=_0x531fe7-0x0;var _0x2ee486=_0xafc4[_0x531fe7];return _0x2ee486;};'use strict';var _=require(_0x4afc('0x0'));var util=require('util');var moment=require(_0x4afc('0x1'));var BPromise=require('bluebird');var rs=require(_0x4afc('0x2'));var fs=require('fs');var Redis=require(_0x4afc('0x3'));var db=require(_0x4afc('0x4'))['db'];var utils=require(_0x4afc('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x4afc('0x6'));var client=jayson[_0x4afc('0x7')][_0x4afc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1bb281,_0xc828d9,_0xaf053d){return new BPromise(function(_0x5e1e29,_0x31e165){return client[_0x4afc('0x9')](_0x1bb281,_0xaf053d)[_0x4afc('0xa')](function(_0x1e6bf5){logger[_0x4afc('0xb')](_0x4afc('0xc'),_0xc828d9,'request\x20sent');logger['debug'](_0x4afc('0xd'),_0xc828d9,'request\x20sent',JSON[_0x4afc('0xe')](_0x1e6bf5));if(_0x1e6bf5[_0x4afc('0xf')]){if(_0x1e6bf5['error'][_0x4afc('0x10')]===0x1f4){logger[_0x4afc('0xf')](_0x4afc('0xc'),_0xc828d9,_0x1e6bf5[_0x4afc('0xf')][_0x4afc('0x11')]);return _0x31e165(_0x1e6bf5[_0x4afc('0xf')][_0x4afc('0x11')]);}logger[_0x4afc('0xf')]('FreshsalesAccount,\x20%s,\x20%s',_0xc828d9,_0x1e6bf5[_0x4afc('0xf')][_0x4afc('0x11')]);return _0x5e1e29(_0x1e6bf5[_0x4afc('0xf')][_0x4afc('0x11')]);}else{logger['info']('FreshsalesAccount,\x20%s,\x20%s',_0xc828d9,_0x4afc('0x12'));_0x5e1e29(_0x1e6bf5['result'][_0x4afc('0x11')]);}})[_0x4afc('0x13')](function(_0x2b928b){logger[_0x4afc('0xf')](_0x4afc('0xc'),_0xc828d9,_0x2b928b);_0x31e165(_0x2b928b);});});}exports[_0x4afc('0x14')]=function(_0x22f809){var _0x3ad418=this;return new Promise(function(_0x16365f,_0x135349){return db[_0x4afc('0x15')]['findAll']({'raw':_0x22f809[_0x4afc('0x16')]?_0x22f809[_0x4afc('0x16')][_0x4afc('0x17')]===undefined?!![]:![]:!![],'where':_0x22f809[_0x4afc('0x16')]?_0x22f809['options'][_0x4afc('0x18')]||null:null,'attributes':_0x22f809[_0x4afc('0x16')]?_0x22f809[_0x4afc('0x16')][_0x4afc('0x19')]||null:null,'limit':_0x22f809[_0x4afc('0x16')]?_0x22f809[_0x4afc('0x16')][_0x4afc('0x1a')]||null:null,'include':_0x22f809['options']?_0x22f809[_0x4afc('0x16')][_0x4afc('0x1b')]?_['map'](_0x22f809[_0x4afc('0x16')]['include'],function(_0x1aa676){return{'model':db[_0x1aa676[_0x4afc('0x1c')]],'as':_0x1aa676['as'],'attributes':_0x1aa676[_0x4afc('0x19')],'include':_0x1aa676[_0x4afc('0x1b')]?_[_0x4afc('0x1d')](_0x1aa676[_0x4afc('0x1b')],function(_0x40a0db){return{'model':db[_0x40a0db[_0x4afc('0x1c')]],'as':_0x40a0db['as'],'attributes':_0x40a0db[_0x4afc('0x19')],'include':_0x40a0db[_0x4afc('0x1b')]?_[_0x4afc('0x1d')](_0x40a0db[_0x4afc('0x1b')],function(_0x35f5b3){return{'model':db[_0x35f5b3['model']],'as':_0x35f5b3['as'],'attributes':_0x35f5b3[_0x4afc('0x19')]};}):[]};}):[]};}):[]:[]})[_0x4afc('0xa')](function(_0x2d6112){logger['info']('GetFreshsalesAccount',_0x22f809);logger['debug'](_0x4afc('0x14'),_0x22f809,JSON[_0x4afc('0xe')](_0x2d6112));_0x16365f(_0x2d6112);})['catch'](function(_0xd26d2f){logger[_0x4afc('0xf')]('GetFreshsalesAccount',_0xd26d2f['message'],_0x22f809);_0x135349(_0x3ad418['error'](0x1f4,_0xd26d2f[_0x4afc('0x11')]));});});};exports[_0x4afc('0x1e')]=function(_0x17a43d){var _0x46357b=this;return new Promise(function(_0xc1d91,_0x28cd3e){return db['FreshsalesAccount'][_0x4afc('0x1f')]({'raw':_0x17a43d[_0x4afc('0x16')]?_0x17a43d[_0x4afc('0x16')][_0x4afc('0x17')]===undefined?!![]:![]:!![],'where':_0x17a43d[_0x4afc('0x16')]?_0x17a43d[_0x4afc('0x16')][_0x4afc('0x18')]||null:null,'attributes':_0x17a43d[_0x4afc('0x16')]?_0x17a43d['options'][_0x4afc('0x19')]||null:null,'include':_0x17a43d['options']?_0x17a43d['options'][_0x4afc('0x1b')]?_[_0x4afc('0x1d')](_0x17a43d[_0x4afc('0x16')][_0x4afc('0x1b')],function(_0x3ec6fa){return{'model':db[_0x3ec6fa[_0x4afc('0x1c')]],'as':_0x3ec6fa['as'],'attributes':_0x3ec6fa['attributes'],'include':_0x3ec6fa[_0x4afc('0x1b')]?_[_0x4afc('0x1d')](_0x3ec6fa[_0x4afc('0x1b')],function(_0x127ac8){return{'model':db[_0x127ac8[_0x4afc('0x1c')]],'as':_0x127ac8['as'],'attributes':_0x127ac8[_0x4afc('0x19')],'include':_0x127ac8['include']?_[_0x4afc('0x1d')](_0x127ac8[_0x4afc('0x1b')],function(_0x91565d){return{'model':db[_0x91565d[_0x4afc('0x1c')]],'as':_0x91565d['as'],'attributes':_0x91565d['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x43c341){logger[_0x4afc('0xb')](_0x4afc('0x1e'),_0x17a43d);logger['debug']('ShowFreshsalesAccount',_0x17a43d,JSON[_0x4afc('0xe')](_0x43c341));_0xc1d91(_0x43c341);})['catch'](function(_0x5947bb){logger[_0x4afc('0xf')](_0x4afc('0x1e'),_0x5947bb[_0x4afc('0x11')],_0x17a43d);_0x28cd3e(_0x46357b[_0x4afc('0xf')](0x1f4,_0x5947bb[_0x4afc('0x11')]));});});}; \ No newline at end of file +var _0x4888=['FreshsalesAccount','findAll','options','raw','where','attributes','limit','map','include','model','catch','ShowFreshsalesAccount','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','GetFreshsalesAccount'];(function(_0x31c102,_0x280d14){var _0x2cefd0=function(_0x5d782e){while(--_0x5d782e){_0x31c102['push'](_0x31c102['shift']());}};_0x2cefd0(++_0x280d14);}(_0x4888,0x198));var _0x8488=function(_0x49e2b8,_0x5cf700){_0x49e2b8=_0x49e2b8-0x0;var _0x1f2213=_0x4888[_0x49e2b8];return _0x1f2213;};'use strict';var _=require('lodash');var util=require(_0x8488('0x0'));var moment=require(_0x8488('0x1'));var BPromise=require(_0x8488('0x2'));var rs=require(_0x8488('0x3'));var fs=require('fs');var Redis=require(_0x8488('0x4'));var db=require(_0x8488('0x5'))['db'];var utils=require(_0x8488('0x6'));var logger=require('../../config/logger')(_0x8488('0x7'));var config=require(_0x8488('0x8'));var jayson=require(_0x8488('0x9'));var client=jayson[_0x8488('0xa')][_0x8488('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x19e508,_0x5250a1,_0x5b30a7){return new BPromise(function(_0x56aad0,_0x568a82){return client[_0x8488('0xc')](_0x19e508,_0x5b30a7)[_0x8488('0xd')](function(_0x542bd8){logger[_0x8488('0xe')](_0x8488('0xf'),_0x5250a1,_0x8488('0x10'));logger[_0x8488('0x11')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x5250a1,_0x8488('0x10'),JSON[_0x8488('0x12')](_0x542bd8));if(_0x542bd8[_0x8488('0x13')]){if(_0x542bd8[_0x8488('0x13')][_0x8488('0x14')]===0x1f4){logger['error'](_0x8488('0xf'),_0x5250a1,_0x542bd8[_0x8488('0x13')]['message']);return _0x568a82(_0x542bd8['error'][_0x8488('0x15')]);}logger['error'](_0x8488('0xf'),_0x5250a1,_0x542bd8['error']['message']);return _0x56aad0(_0x542bd8[_0x8488('0x13')][_0x8488('0x15')]);}else{logger[_0x8488('0xe')](_0x8488('0xf'),_0x5250a1,_0x8488('0x10'));_0x56aad0(_0x542bd8[_0x8488('0x16')][_0x8488('0x15')]);}})['catch'](function(_0x3dad45){logger[_0x8488('0x13')](_0x8488('0xf'),_0x5250a1,_0x3dad45);_0x568a82(_0x3dad45);});});}exports[_0x8488('0x17')]=function(_0x60ae2f){var _0x39775f=this;return new Promise(function(_0x1aedb1,_0x27c62a){return db[_0x8488('0x18')][_0x8488('0x19')]({'raw':_0x60ae2f[_0x8488('0x1a')]?_0x60ae2f[_0x8488('0x1a')][_0x8488('0x1b')]===undefined?!![]:![]:!![],'where':_0x60ae2f['options']?_0x60ae2f['options'][_0x8488('0x1c')]||null:null,'attributes':_0x60ae2f[_0x8488('0x1a')]?_0x60ae2f[_0x8488('0x1a')][_0x8488('0x1d')]||null:null,'limit':_0x60ae2f[_0x8488('0x1a')]?_0x60ae2f[_0x8488('0x1a')][_0x8488('0x1e')]||null:null,'include':_0x60ae2f[_0x8488('0x1a')]?_0x60ae2f[_0x8488('0x1a')]['include']?_[_0x8488('0x1f')](_0x60ae2f[_0x8488('0x1a')][_0x8488('0x20')],function(_0x1361a6){return{'model':db[_0x1361a6[_0x8488('0x21')]],'as':_0x1361a6['as'],'attributes':_0x1361a6['attributes'],'include':_0x1361a6['include']?_['map'](_0x1361a6['include'],function(_0x472624){return{'model':db[_0x472624['model']],'as':_0x472624['as'],'attributes':_0x472624['attributes'],'include':_0x472624[_0x8488('0x20')]?_[_0x8488('0x1f')](_0x472624[_0x8488('0x20')],function(_0x6ebee0){return{'model':db[_0x6ebee0[_0x8488('0x21')]],'as':_0x6ebee0['as'],'attributes':_0x6ebee0['attributes']};}):[]};}):[]};}):[]:[]})[_0x8488('0xd')](function(_0x38c137){logger[_0x8488('0xe')](_0x8488('0x17'),_0x60ae2f);logger[_0x8488('0x11')](_0x8488('0x17'),_0x60ae2f,JSON[_0x8488('0x12')](_0x38c137));_0x1aedb1(_0x38c137);})[_0x8488('0x22')](function(_0x368f9c){logger[_0x8488('0x13')](_0x8488('0x17'),_0x368f9c['message'],_0x60ae2f);_0x27c62a(_0x39775f['error'](0x1f4,_0x368f9c['message']));});});};exports[_0x8488('0x23')]=function(_0x408c36){var _0x19cf42=this;return new Promise(function(_0x121dcc,_0x117321){return db[_0x8488('0x18')]['find']({'raw':_0x408c36[_0x8488('0x1a')]?_0x408c36[_0x8488('0x1a')][_0x8488('0x1b')]===undefined?!![]:![]:!![],'where':_0x408c36[_0x8488('0x1a')]?_0x408c36[_0x8488('0x1a')]['where']||null:null,'attributes':_0x408c36[_0x8488('0x1a')]?_0x408c36[_0x8488('0x1a')]['attributes']||null:null,'include':_0x408c36[_0x8488('0x1a')]?_0x408c36[_0x8488('0x1a')][_0x8488('0x20')]?_[_0x8488('0x1f')](_0x408c36[_0x8488('0x1a')]['include'],function(_0x44c8f3){return{'model':db[_0x44c8f3[_0x8488('0x21')]],'as':_0x44c8f3['as'],'attributes':_0x44c8f3[_0x8488('0x1d')],'include':_0x44c8f3['include']?_[_0x8488('0x1f')](_0x44c8f3['include'],function(_0x205ccc){return{'model':db[_0x205ccc[_0x8488('0x21')]],'as':_0x205ccc['as'],'attributes':_0x205ccc[_0x8488('0x1d')],'include':_0x205ccc[_0x8488('0x20')]?_['map'](_0x205ccc[_0x8488('0x20')],function(_0xe71bd9){return{'model':db[_0xe71bd9[_0x8488('0x21')]],'as':_0xe71bd9['as'],'attributes':_0xe71bd9['attributes']};}):[]};}):[]};}):[]:[]})[_0x8488('0xd')](function(_0x17bfea){logger[_0x8488('0xe')](_0x8488('0x23'),_0x408c36);logger[_0x8488('0x11')](_0x8488('0x23'),_0x408c36,JSON[_0x8488('0x12')](_0x17bfea));_0x121dcc(_0x17bfea);})[_0x8488('0x22')](function(_0x1a8235){logger[_0x8488('0x13')](_0x8488('0x23'),_0x1a8235['message'],_0x408c36);_0x117321(_0x19cf42['error'](0x1f4,_0x1a8235[_0x8488('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 96169ce..8161c92 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 _0xf577=['./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id/descriptions','getDescriptions','getFields','create','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5b1efe,_0x376a90){var _0x19e604=function(_0x124ac7){while(--_0x124ac7){_0x5b1efe['push'](_0x5b1efe['shift']());}};_0x19e604(++_0x376a90);}(_0xf577,0x1c5));var _0x7f57=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0xf577[_0x36ed48];return _0x51c63a;};'use strict';var multer=require(_0x7f57('0x0'));var util=require(_0x7f57('0x1'));var path=require(_0x7f57('0x2'));var timeout=require(_0x7f57('0x3'));var express=require(_0x7f57('0x4'));var router=express[_0x7f57('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x7f57('0x6'));var interaction=require(_0x7f57('0x7'));var config=require(_0x7f57('0x8'));var controller=require(_0x7f57('0x9'));router[_0x7f57('0xa')]('/',auth[_0x7f57('0xb')](),controller[_0x7f57('0xc')]);router[_0x7f57('0xa')]('/:id',auth[_0x7f57('0xb')](),controller['show']);router[_0x7f57('0xa')]('/:id/subjects',auth[_0x7f57('0xb')](),controller['getSubjects']);router[_0x7f57('0xa')](_0x7f57('0xd'),auth[_0x7f57('0xb')](),controller[_0x7f57('0xe')]);router[_0x7f57('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0x7f57('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x7f57('0x10')]);router[_0x7f57('0x11')](_0x7f57('0x12'),auth[_0x7f57('0xb')](),controller['update']);router[_0x7f57('0x13')](_0x7f57('0x12'),auth[_0x7f57('0xb')](),controller[_0x7f57('0x14')]);module[_0x7f57('0x15')]=router; \ No newline at end of file +var _0x80e1=['create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','/:id','getSubjects','/:id/descriptions','getDescriptions','getFields','post'];(function(_0x26bcd4,_0xdca363){var _0x20e078=function(_0x532f3a){while(--_0x532f3a){_0x26bcd4['push'](_0x26bcd4['shift']());}};_0x20e078(++_0xdca363);}(_0x80e1,0xd4));var _0x180e=function(_0x28bfe0,_0x21a7ec){_0x28bfe0=_0x28bfe0-0x0;var _0x57cc63=_0x80e1[_0x28bfe0];return _0x57cc63;};'use strict';var multer=require(_0x180e('0x0'));var util=require(_0x180e('0x1'));var path=require(_0x180e('0x2'));var timeout=require(_0x180e('0x3'));var express=require('express');var router=express[_0x180e('0x4')]();var fs_extra=require(_0x180e('0x5'));var auth=require(_0x180e('0x6'));var interaction=require(_0x180e('0x7'));var config=require(_0x180e('0x8'));var controller=require(_0x180e('0x9'));router[_0x180e('0xa')]('/',auth[_0x180e('0xb')](),controller['index']);router['get'](_0x180e('0xc'),auth[_0x180e('0xb')](),controller['show']);router[_0x180e('0xa')]('/:id/subjects',auth[_0x180e('0xb')](),controller[_0x180e('0xd')]);router[_0x180e('0xa')](_0x180e('0xe'),auth[_0x180e('0xb')](),controller[_0x180e('0xf')]);router[_0x180e('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0x180e('0x10')]);router[_0x180e('0x11')]('/',auth[_0x180e('0xb')](),controller[_0x180e('0x12')]);router['put'](_0x180e('0xc'),auth[_0x180e('0xb')](),controller[_0x180e('0x13')]);router[_0x180e('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x180e('0x15')]);module[_0x180e('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 5978d1a..a688135 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 _0x0916=['sequelize','exports','STRING'];(function(_0x1181f3,_0xf81baa){var _0x37abb6=function(_0x3610bf){while(--_0x3610bf){_0x1181f3['push'](_0x1181f3['shift']());}};_0x37abb6(++_0xf81baa);}(_0x0916,0x1d7));var _0x6091=function(_0x365977,_0x57b7ae){_0x365977=_0x365977-0x0;var _0x843665=_0x0916[_0x365977];return _0x843665;};'use strict';var Sequelize=require(_0x6091('0x0'));module[_0x6091('0x1')]={'name':{'type':Sequelize[_0x6091('0x2')]},'description':{'type':Sequelize[_0x6091('0x2')]}}; \ No newline at end of file +'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 66ed375..96262ca 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 _0x2f0e=['bluebird','mustache','util','ejs','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','apply','reject','save','update','then','stack','send','index','map','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','name','FreshsalesConfiguration','findAll','rows','catch','params','includeAll','options','find','create','body','destroy','getSubjects','findOne','FreshsalesField','length','getDescriptions','rawAttributes','getFields','eml-format','rimraf','zip-dir','request-promise','moment'];(function(_0x4fbfd7,_0x3b7dc6){var _0x5b6ea7=function(_0x4884df){while(--_0x4884df){_0x4fbfd7['push'](_0x4fbfd7['shift']());}};_0x5b6ea7(++_0x3b7dc6);}(_0x2f0e,0x133));var _0xe2f0=function(_0x13fb64,_0x250eb2){_0x13fb64=_0x13fb64-0x0;var _0x2dfabd=_0x2f0e[_0x13fb64];return _0x2dfabd;};'use strict';var emlformat=require(_0xe2f0('0x0'));var rimraf=require(_0xe2f0('0x1'));var zipdir=require(_0xe2f0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe2f0('0x3'));var moment=require(_0xe2f0('0x4'));var BPromise=require(_0xe2f0('0x5'));var Mustache=require(_0xe2f0('0x6'));var util=require(_0xe2f0('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe2f0('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe2f0('0x9'));var squel=require(_0xe2f0('0xa'));var crypto=require(_0xe2f0('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xe2f0('0xc'));var toCsv=require(_0xe2f0('0xd'));var querystring=require('querystring');var Papa=require(_0xe2f0('0xe'));var Redis=require(_0xe2f0('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xe2f0('0x10'));var as=require(_0xe2f0('0x11'));var hardwareService=require(_0xe2f0('0x12'));var logger=require(_0xe2f0('0x13'))('api');var utils=require(_0xe2f0('0x14'));var config=require(_0xe2f0('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xe2f0('0x16'))['db'];function respondWithStatusCode(_0x5ebce9,_0x25a662){_0x25a662=_0x25a662||0xcc;return function(_0x5189d2){if(_0x5189d2){return _0x5ebce9[_0xe2f0('0x17')](_0x25a662);}return _0x5ebce9['status'](_0x25a662)[_0xe2f0('0x18')]();};}function respondWithResult(_0x1a2716,_0x4438c9){_0x4438c9=_0x4438c9||0xc8;return function(_0x431424){if(_0x431424){return _0x1a2716['status'](_0x4438c9)[_0xe2f0('0x19')](_0x431424);}};}function respondWithFilteredResult(_0x2feb02,_0x3cbb3a){return function(_0x281814){if(_0x281814){var _0x466819=typeof _0x3cbb3a[_0xe2f0('0x1a')]===_0xe2f0('0x1b')&&typeof _0x3cbb3a[_0xe2f0('0x1c')]===_0xe2f0('0x1b');var _0x550490=_0x281814[_0xe2f0('0x1d')];var _0x4d2f91=_0x466819?0x0:_0x3cbb3a[_0xe2f0('0x1a')];var _0x58d4a0=_0x466819?_0x281814[_0xe2f0('0x1d')]:_0x3cbb3a['offset']+_0x3cbb3a[_0xe2f0('0x1c')];var _0x1e32aa;if(_0x58d4a0>=_0x550490){_0x58d4a0=_0x550490;_0x1e32aa=0xc8;}else{_0x1e32aa=0xce;}_0x2feb02[_0xe2f0('0x1e')](_0x1e32aa);return _0x2feb02[_0xe2f0('0x1f')]('Content-Range',_0x4d2f91+'-'+_0x58d4a0+'/'+_0x550490)[_0xe2f0('0x19')](_0x281814);}return null;};}function patchUpdates(_0x108d41){return function(_0x14fe97){try{jsonpatch[_0xe2f0('0x20')](_0x14fe97,_0x108d41,!![]);}catch(_0x508d8b){return BPromise[_0xe2f0('0x21')](_0x508d8b);}return _0x14fe97[_0xe2f0('0x22')]();};}function saveUpdates(_0xe25bec,_0x2ab448){return function(_0x322734){if(_0x322734){return _0x322734[_0xe2f0('0x23')](_0xe25bec)[_0xe2f0('0x24')](function(_0x4c04f8){return _0x4c04f8;});}return null;};}function removeEntity(_0x3187cb,_0x3f76e4){return function(_0xc84d40){if(_0xc84d40){return _0xc84d40['destroy']()['then'](function(){_0x3187cb[_0xe2f0('0x1e')](0xcc)[_0xe2f0('0x18')]();});}};}function handleEntityNotFound(_0x565451,_0x8450f){return function(_0x1e7c2f){if(!_0x1e7c2f){_0x565451[_0xe2f0('0x17')](0x194);}return _0x1e7c2f;};}function handleError(_0x5902ff,_0x516266){_0x516266=_0x516266||0x1f4;return function(_0x34c377){logger['error'](_0x34c377[_0xe2f0('0x25')]);if(_0x34c377['name']){delete _0x34c377['name'];}_0x5902ff[_0xe2f0('0x1e')](_0x516266)[_0xe2f0('0x26')](_0x34c377);};}exports[_0xe2f0('0x27')]=function(_0x222d0b,_0x24f110){var _0x2740a5={},_0x4a691c={},_0x586fa1={'count':0x0,'rows':[]};var _0x306f96=_[_0xe2f0('0x28')](db['FreshsalesConfiguration']['rawAttributes'],function(_0x454163){return{'name':_0x454163['fieldName'],'type':_0x454163[_0xe2f0('0x29')][_0xe2f0('0x2a')]};});_0x4a691c['model']=_[_0xe2f0('0x28')](_0x306f96,'name');_0x4a691c[_0xe2f0('0x2b')]=_[_0xe2f0('0x2c')](_0x222d0b[_0xe2f0('0x2b')]);_0x4a691c[_0xe2f0('0x2d')]=_[_0xe2f0('0x2e')](_0x4a691c[_0xe2f0('0x2f')],_0x4a691c[_0xe2f0('0x2b')]);_0x2740a5['attributes']=_[_0xe2f0('0x2e')](_0x4a691c[_0xe2f0('0x2f')],qs[_0xe2f0('0x30')](_0x222d0b[_0xe2f0('0x2b')][_0xe2f0('0x30')]));_0x2740a5['attributes']=_0x2740a5[_0xe2f0('0x31')]['length']?_0x2740a5[_0xe2f0('0x31')]:_0x4a691c[_0xe2f0('0x2f')];if(!_0x222d0b[_0xe2f0('0x2b')][_0xe2f0('0x32')](_0xe2f0('0x33'))){_0x2740a5[_0xe2f0('0x1c')]=qs[_0xe2f0('0x1c')](_0x222d0b[_0xe2f0('0x2b')][_0xe2f0('0x1c')]);_0x2740a5[_0xe2f0('0x1a')]=qs[_0xe2f0('0x1a')](_0x222d0b[_0xe2f0('0x2b')][_0xe2f0('0x1a')]);}_0x2740a5[_0xe2f0('0x34')]=qs[_0xe2f0('0x35')](_0x222d0b[_0xe2f0('0x2b')][_0xe2f0('0x35')]);_0x2740a5[_0xe2f0('0x36')]=qs[_0xe2f0('0x2d')](_[_0xe2f0('0x37')](_0x222d0b['query'],_0x4a691c['filters']),_0x306f96);if(_0x222d0b[_0xe2f0('0x2b')][_0xe2f0('0x38')]){_0x2740a5[_0xe2f0('0x36')]=_[_0xe2f0('0x39')](_0x2740a5[_0xe2f0('0x36')],{'$or':_[_0xe2f0('0x28')](_0x306f96,function(_0x4b9fa0){if(_0x4b9fa0['type']!==_0xe2f0('0x3a')){var _0x456d89={};_0x456d89[_0x4b9fa0[_0xe2f0('0x3b')]]={'$like':'%'+_0x222d0b[_0xe2f0('0x2b')][_0xe2f0('0x38')]+'%'};return _0x456d89;}})});}_0x2740a5=_['merge']({},_0x2740a5,_0x222d0b['options']);var _0x51013c={'where':_0x2740a5[_0xe2f0('0x36')]};return db[_0xe2f0('0x3c')][_0xe2f0('0x1d')](_0x51013c)[_0xe2f0('0x24')](function(_0x1d1337){_0x586fa1[_0xe2f0('0x1d')]=_0x1d1337;if(_0x222d0b['query']['includeAll']){_0x2740a5['include']=[{'all':!![]}];}return db[_0xe2f0('0x3c')][_0xe2f0('0x3d')](_0x2740a5);})[_0xe2f0('0x24')](function(_0xed88be){_0x586fa1[_0xe2f0('0x3e')]=_0xed88be;return _0x586fa1;})[_0xe2f0('0x24')](respondWithFilteredResult(_0x24f110,_0x2740a5))[_0xe2f0('0x3f')](handleError(_0x24f110,null));};exports['show']=function(_0x2ade7c,_0x5f3072){var _0x14e3d5={'raw':![],'where':{'id':_0x2ade7c[_0xe2f0('0x40')]['id']}},_0x339644={};_0x339644[_0xe2f0('0x2f')]=_['keys'](db[_0xe2f0('0x3c')]['rawAttributes']);_0x339644['query']=_['keys'](_0x2ade7c[_0xe2f0('0x2b')]);_0x339644['filters']=_['intersection'](_0x339644['model'],_0x339644['query']);_0x14e3d5['attributes']=_[_0xe2f0('0x2e')](_0x339644['model'],qs[_0xe2f0('0x30')](_0x2ade7c[_0xe2f0('0x2b')]['fields']));_0x14e3d5[_0xe2f0('0x31')]=_0x14e3d5['attributes']['length']?_0x14e3d5[_0xe2f0('0x31')]:_0x339644[_0xe2f0('0x2f')];if(_0x2ade7c[_0xe2f0('0x2b')][_0xe2f0('0x41')]){_0x14e3d5['include']=[{'all':!![]}];}_0x14e3d5=_[_0xe2f0('0x39')]({},_0x14e3d5,_0x2ade7c[_0xe2f0('0x42')]);return db['FreshsalesConfiguration'][_0xe2f0('0x43')](_0x14e3d5)[_0xe2f0('0x24')](handleEntityNotFound(_0x5f3072,null))[_0xe2f0('0x24')](respondWithResult(_0x5f3072,null))['catch'](handleError(_0x5f3072,null));};exports[_0xe2f0('0x44')]=function(_0x3538fd,_0x5c7a6a){return db[_0xe2f0('0x3c')][_0xe2f0('0x44')](_0x3538fd[_0xe2f0('0x45')],{})[_0xe2f0('0x24')](respondWithResult(_0x5c7a6a,0xc9))[_0xe2f0('0x3f')](handleError(_0x5c7a6a,null));};exports[_0xe2f0('0x23')]=function(_0x79ec0f,_0x1a28a5){if(_0x79ec0f[_0xe2f0('0x45')]['id']){delete _0x79ec0f['body']['id'];}return db['FreshsalesConfiguration'][_0xe2f0('0x43')]({'where':{'id':_0x79ec0f['params']['id']}})[_0xe2f0('0x24')](handleEntityNotFound(_0x1a28a5,null))[_0xe2f0('0x24')](saveUpdates(_0x79ec0f['body'],null))[_0xe2f0('0x24')](respondWithResult(_0x1a28a5,null))[_0xe2f0('0x3f')](handleError(_0x1a28a5,null));};exports[_0xe2f0('0x46')]=function(_0x447616,_0x2aa126){return db['FreshsalesConfiguration'][_0xe2f0('0x43')]({'where':{'id':_0x447616['params']['id']}})['then'](handleEntityNotFound(_0x2aa126,null))[_0xe2f0('0x24')](removeEntity(_0x2aa126,null))[_0xe2f0('0x3f')](handleError(_0x2aa126,null));};exports[_0xe2f0('0x47')]=function(_0x3f7b70,_0x47b928,_0x1400e8){var _0x37256c={};var _0x3cfdf8={};var _0x24a78a;var _0x1eb9fe;return db['FreshsalesConfiguration'][_0xe2f0('0x48')]({'where':{'id':_0x3f7b70[_0xe2f0('0x40')]['id']}})[_0xe2f0('0x24')](handleEntityNotFound(_0x47b928,null))[_0xe2f0('0x24')](function(_0x22e1ee){if(_0x22e1ee){_0x24a78a=_0x22e1ee;_0x3cfdf8[_0xe2f0('0x2f')]=_[_0xe2f0('0x2c')](db[_0xe2f0('0x49')]['rawAttributes']);_0x3cfdf8['query']=_[_0xe2f0('0x2c')](_0x3f7b70['query']);_0x3cfdf8[_0xe2f0('0x2d')]=_[_0xe2f0('0x2e')](_0x3cfdf8[_0xe2f0('0x2f')],_0x3cfdf8[_0xe2f0('0x2b')]);_0x37256c['attributes']=_['intersection'](_0x3cfdf8['model'],qs[_0xe2f0('0x30')](_0x3f7b70[_0xe2f0('0x2b')][_0xe2f0('0x30')]));_0x37256c[_0xe2f0('0x31')]=_0x37256c[_0xe2f0('0x31')][_0xe2f0('0x4a')]?_0x37256c[_0xe2f0('0x31')]:_0x3cfdf8['model'];_0x37256c['order']=qs[_0xe2f0('0x35')](_0x3f7b70['query']['sort']);_0x37256c[_0xe2f0('0x36')]=qs['filters'](_[_0xe2f0('0x37')](_0x3f7b70[_0xe2f0('0x2b')],_0x3cfdf8[_0xe2f0('0x2d')]));if(_0x3f7b70[_0xe2f0('0x2b')][_0xe2f0('0x38')]){_0x37256c['where']=_['merge'](_0x37256c[_0xe2f0('0x36')],{'$or':_[_0xe2f0('0x28')](_0x37256c[_0xe2f0('0x31')],function(_0x49f9f5){var _0x404d1c={};_0x404d1c[_0x49f9f5]={'$like':'%'+_0x3f7b70['query'][_0xe2f0('0x38')]+'%'};return _0x404d1c;})});}_0x37256c=_[_0xe2f0('0x39')]({},_0x37256c,_0x3f7b70['options']);return _0x24a78a[_0xe2f0('0x47')](_0x37256c);}})[_0xe2f0('0x24')](function(_0x1f6d12){if(_0x1f6d12){_0x1eb9fe=_0x1f6d12[_0xe2f0('0x4a')];if(!_0x3f7b70[_0xe2f0('0x2b')][_0xe2f0('0x32')](_0xe2f0('0x33'))){_0x37256c[_0xe2f0('0x1c')]=qs['limit'](_0x3f7b70[_0xe2f0('0x2b')][_0xe2f0('0x1c')]);_0x37256c['offset']=qs['offset'](_0x3f7b70[_0xe2f0('0x2b')][_0xe2f0('0x1a')]);}return _0x24a78a[_0xe2f0('0x47')](_0x37256c);}})[_0xe2f0('0x24')](function(_0x3b7ded){if(_0x3b7ded){return _0x3b7ded?{'count':_0x1eb9fe,'rows':_0x3b7ded}:null;}})[_0xe2f0('0x24')](respondWithResult(_0x47b928,null))[_0xe2f0('0x3f')](handleError(_0x47b928,null));};exports[_0xe2f0('0x4b')]=function(_0x4555dc,_0x35e101,_0x144505){var _0xd6011b={};var _0x3d6cd8={};var _0x459210;var _0x3dd774;return db[_0xe2f0('0x3c')][_0xe2f0('0x48')]({'where':{'id':_0x4555dc[_0xe2f0('0x40')]['id']}})[_0xe2f0('0x24')](handleEntityNotFound(_0x35e101,null))[_0xe2f0('0x24')](function(_0x4c2ef7){if(_0x4c2ef7){_0x459210=_0x4c2ef7;_0x3d6cd8[_0xe2f0('0x2f')]=_['keys'](db[_0xe2f0('0x49')][_0xe2f0('0x4c')]);_0x3d6cd8[_0xe2f0('0x2b')]=_[_0xe2f0('0x2c')](_0x4555dc[_0xe2f0('0x2b')]);_0x3d6cd8[_0xe2f0('0x2d')]=_[_0xe2f0('0x2e')](_0x3d6cd8['model'],_0x3d6cd8[_0xe2f0('0x2b')]);_0xd6011b[_0xe2f0('0x31')]=_[_0xe2f0('0x2e')](_0x3d6cd8[_0xe2f0('0x2f')],qs[_0xe2f0('0x30')](_0x4555dc[_0xe2f0('0x2b')][_0xe2f0('0x30')]));_0xd6011b['attributes']=_0xd6011b[_0xe2f0('0x31')][_0xe2f0('0x4a')]?_0xd6011b[_0xe2f0('0x31')]:_0x3d6cd8[_0xe2f0('0x2f')];_0xd6011b[_0xe2f0('0x34')]=qs['sort'](_0x4555dc['query'][_0xe2f0('0x35')]);_0xd6011b['where']=qs[_0xe2f0('0x2d')](_[_0xe2f0('0x37')](_0x4555dc[_0xe2f0('0x2b')],_0x3d6cd8[_0xe2f0('0x2d')]));if(_0x4555dc[_0xe2f0('0x2b')]['filter']){_0xd6011b[_0xe2f0('0x36')]=_['merge'](_0xd6011b['where'],{'$or':_[_0xe2f0('0x28')](_0xd6011b[_0xe2f0('0x31')],function(_0x563840){var _0x1cb48d={};_0x1cb48d[_0x563840]={'$like':'%'+_0x4555dc[_0xe2f0('0x2b')][_0xe2f0('0x38')]+'%'};return _0x1cb48d;})});}_0xd6011b=_[_0xe2f0('0x39')]({},_0xd6011b,_0x4555dc[_0xe2f0('0x42')]);return _0x459210[_0xe2f0('0x4b')](_0xd6011b);}})[_0xe2f0('0x24')](function(_0x3fbfba){if(_0x3fbfba){_0x3dd774=_0x3fbfba[_0xe2f0('0x4a')];if(!_0x4555dc['query'][_0xe2f0('0x32')]('nolimit')){_0xd6011b['limit']=qs[_0xe2f0('0x1c')](_0x4555dc[_0xe2f0('0x2b')][_0xe2f0('0x1c')]);_0xd6011b[_0xe2f0('0x1a')]=qs[_0xe2f0('0x1a')](_0x4555dc[_0xe2f0('0x2b')]['offset']);}return _0x459210[_0xe2f0('0x4b')](_0xd6011b);}})['then'](function(_0x27debc){if(_0x27debc){return _0x27debc?{'count':_0x3dd774,'rows':_0x27debc}:null;}})[_0xe2f0('0x24')](respondWithResult(_0x35e101,null))['catch'](handleError(_0x35e101,null));};exports[_0xe2f0('0x4d')]=function(_0x47febf,_0x3bb5f0,_0x29ad7c){var _0x2b0a9f={};var _0x41882c={};var _0xed5f05;var _0xefa42a;return db[_0xe2f0('0x3c')]['findOne']({'where':{'id':_0x47febf['params']['id']}})[_0xe2f0('0x24')](handleEntityNotFound(_0x3bb5f0,null))[_0xe2f0('0x24')](function(_0x462888){if(_0x462888){_0xed5f05=_0x462888;_0x41882c[_0xe2f0('0x2f')]=_[_0xe2f0('0x2c')](db[_0xe2f0('0x49')]['rawAttributes']);_0x41882c[_0xe2f0('0x2b')]=_[_0xe2f0('0x2c')](_0x47febf['query']);_0x41882c[_0xe2f0('0x2d')]=_['intersection'](_0x41882c[_0xe2f0('0x2f')],_0x41882c['query']);_0x2b0a9f[_0xe2f0('0x31')]=_[_0xe2f0('0x2e')](_0x41882c[_0xe2f0('0x2f')],qs[_0xe2f0('0x30')](_0x47febf[_0xe2f0('0x2b')][_0xe2f0('0x30')]));_0x2b0a9f[_0xe2f0('0x31')]=_0x2b0a9f[_0xe2f0('0x31')][_0xe2f0('0x4a')]?_0x2b0a9f[_0xe2f0('0x31')]:_0x41882c[_0xe2f0('0x2f')];_0x2b0a9f['order']=qs[_0xe2f0('0x35')](_0x47febf[_0xe2f0('0x2b')]['sort']);_0x2b0a9f['where']=qs[_0xe2f0('0x2d')](_['pick'](_0x47febf[_0xe2f0('0x2b')],_0x41882c[_0xe2f0('0x2d')]));if(_0x47febf[_0xe2f0('0x2b')][_0xe2f0('0x38')]){_0x2b0a9f['where']=_['merge'](_0x2b0a9f[_0xe2f0('0x36')],{'$or':_[_0xe2f0('0x28')](_0x2b0a9f[_0xe2f0('0x31')],function(_0x233d3c){var _0x50a2e0={};_0x50a2e0[_0x233d3c]={'$like':'%'+_0x47febf[_0xe2f0('0x2b')][_0xe2f0('0x38')]+'%'};return _0x50a2e0;})});}_0x2b0a9f=_[_0xe2f0('0x39')]({},_0x2b0a9f,_0x47febf[_0xe2f0('0x42')]);return _0xed5f05[_0xe2f0('0x4d')](_0x2b0a9f);}})[_0xe2f0('0x24')](function(_0x26406e){if(_0x26406e){_0xefa42a=_0x26406e[_0xe2f0('0x4a')];if(!_0x47febf[_0xe2f0('0x2b')][_0xe2f0('0x32')](_0xe2f0('0x33'))){_0x2b0a9f[_0xe2f0('0x1c')]=qs[_0xe2f0('0x1c')](_0x47febf[_0xe2f0('0x2b')]['limit']);_0x2b0a9f[_0xe2f0('0x1a')]=qs[_0xe2f0('0x1a')](_0x47febf[_0xe2f0('0x2b')][_0xe2f0('0x1a')]);}return _0xed5f05[_0xe2f0('0x4d')](_0x2b0a9f);}})[_0xe2f0('0x24')](function(_0x490aca){if(_0x490aca){return _0x490aca?{'count':_0xefa42a,'rows':_0x490aca}:null;}})['then'](respondWithResult(_0x3bb5f0,null))[_0xe2f0('0x3f')](handleError(_0x3bb5f0,null));}; \ No newline at end of file +var _0x47f4=['save','update','destroy','then','error','stack','name','send','map','FreshsalesConfiguration','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','include','rows','catch','show','params','length','includeAll','options','find','create','body','getSubjects','findOne','FreshsalesField','pick','getDescriptions','getFields','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','apply','reject'];(function(_0x4fc80b,_0xfe1b3d){var _0x119dba=function(_0x16ed12){while(--_0x16ed12){_0x4fc80b['push'](_0x4fc80b['shift']());}};_0x119dba(++_0xfe1b3d);}(_0x47f4,0x11a));var _0x447f=function(_0x4bfc7e,_0x3d9ebe){_0x4bfc7e=_0x4bfc7e-0x0;var _0x49b522=_0x47f4[_0x4bfc7e];return _0x49b522;};'use strict';var emlformat=require(_0x447f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x447f('0x1'));var rp=require(_0x447f('0x2'));var moment=require('moment');var BPromise=require(_0x447f('0x3'));var Mustache=require(_0x447f('0x4'));var util=require(_0x447f('0x5'));var path=require('path');var sox=require(_0x447f('0x6'));var csv=require(_0x447f('0x7'));var ejs=require(_0x447f('0x8'));var fs=require('fs');var fs_extra=require(_0x447f('0x9'));var _=require(_0x447f('0xa'));var squel=require(_0x447f('0xb'));var crypto=require(_0x447f('0xc'));var jsforce=require(_0x447f('0xd'));var deskjs=require(_0x447f('0xe'));var toCsv=require('to-csv');var querystring=require(_0x447f('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x447f('0x10'));var qs=require(_0x447f('0x11'));var as=require(_0x447f('0x12'));var hardwareService=require(_0x447f('0x13'));var logger=require(_0x447f('0x14'))(_0x447f('0x15'));var utils=require('../../config/utils');var config=require(_0x447f('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x447f('0x17'))['db'];function respondWithStatusCode(_0x17cf22,_0x4b02e7){_0x4b02e7=_0x4b02e7||0xcc;return function(_0x5b635b){if(_0x5b635b){return _0x17cf22[_0x447f('0x18')](_0x4b02e7);}return _0x17cf22[_0x447f('0x19')](_0x4b02e7)[_0x447f('0x1a')]();};}function respondWithResult(_0x1c6248,_0x2d3500){_0x2d3500=_0x2d3500||0xc8;return function(_0x5db4d3){if(_0x5db4d3){return _0x1c6248[_0x447f('0x19')](_0x2d3500)[_0x447f('0x1b')](_0x5db4d3);}};}function respondWithFilteredResult(_0x2b05de,_0x58a97c){return function(_0x247d49){if(_0x247d49){var _0x2621b3=typeof _0x58a97c[_0x447f('0x1c')]==='undefined'&&typeof _0x58a97c[_0x447f('0x1d')]==='undefined';var _0x4b9966=_0x247d49[_0x447f('0x1e')];var _0x3c8e1b=_0x2621b3?0x0:_0x58a97c[_0x447f('0x1c')];var _0x305cb6=_0x2621b3?_0x247d49[_0x447f('0x1e')]:_0x58a97c[_0x447f('0x1c')]+_0x58a97c[_0x447f('0x1d')];var _0x32b300;if(_0x305cb6>=_0x4b9966){_0x305cb6=_0x4b9966;_0x32b300=0xc8;}else{_0x32b300=0xce;}_0x2b05de[_0x447f('0x19')](_0x32b300);return _0x2b05de[_0x447f('0x1f')]('Content-Range',_0x3c8e1b+'-'+_0x305cb6+'/'+_0x4b9966)[_0x447f('0x1b')](_0x247d49);}return null;};}function patchUpdates(_0x2cda90){return function(_0x2ca65b){try{jsonpatch[_0x447f('0x20')](_0x2ca65b,_0x2cda90,!![]);}catch(_0x9bd311){return BPromise[_0x447f('0x21')](_0x9bd311);}return _0x2ca65b[_0x447f('0x22')]();};}function saveUpdates(_0x4b4c09,_0x448459){return function(_0x8f10d4){if(_0x8f10d4){return _0x8f10d4[_0x447f('0x23')](_0x4b4c09)['then'](function(_0x103b17){return _0x103b17;});}return null;};}function removeEntity(_0x412413,_0x37f5c6){return function(_0x6b24f5){if(_0x6b24f5){return _0x6b24f5[_0x447f('0x24')]()[_0x447f('0x25')](function(){_0x412413[_0x447f('0x19')](0xcc)[_0x447f('0x1a')]();});}};}function handleEntityNotFound(_0x2e0bbf,_0x3ea741){return function(_0x537fdc){if(!_0x537fdc){_0x2e0bbf[_0x447f('0x18')](0x194);}return _0x537fdc;};}function handleError(_0x1a6cd8,_0xcc029e){_0xcc029e=_0xcc029e||0x1f4;return function(_0x405c51){logger[_0x447f('0x26')](_0x405c51[_0x447f('0x27')]);if(_0x405c51[_0x447f('0x28')]){delete _0x405c51[_0x447f('0x28')];}_0x1a6cd8[_0x447f('0x19')](_0xcc029e)[_0x447f('0x29')](_0x405c51);};}exports['index']=function(_0x17a034,_0x18b4b6){var _0x372deb={},_0x47d53e={},_0x2cbf7d={'count':0x0,'rows':[]};var _0x3ecf93=_[_0x447f('0x2a')](db[_0x447f('0x2b')][_0x447f('0x2c')],function(_0x5cd6f1){return{'name':_0x5cd6f1[_0x447f('0x2d')],'type':_0x5cd6f1[_0x447f('0x2e')][_0x447f('0x2f')]};});_0x47d53e[_0x447f('0x30')]=_[_0x447f('0x2a')](_0x3ecf93,'name');_0x47d53e[_0x447f('0x31')]=_[_0x447f('0x32')](_0x17a034[_0x447f('0x31')]);_0x47d53e['filters']=_[_0x447f('0x33')](_0x47d53e[_0x447f('0x30')],_0x47d53e[_0x447f('0x31')]);_0x372deb[_0x447f('0x34')]=_[_0x447f('0x33')](_0x47d53e['model'],qs[_0x447f('0x35')](_0x17a034[_0x447f('0x31')][_0x447f('0x35')]));_0x372deb[_0x447f('0x34')]=_0x372deb['attributes']['length']?_0x372deb[_0x447f('0x34')]:_0x47d53e[_0x447f('0x30')];if(!_0x17a034[_0x447f('0x31')][_0x447f('0x36')](_0x447f('0x37'))){_0x372deb[_0x447f('0x1d')]=qs[_0x447f('0x1d')](_0x17a034[_0x447f('0x31')][_0x447f('0x1d')]);_0x372deb[_0x447f('0x1c')]=qs['offset'](_0x17a034['query'][_0x447f('0x1c')]);}_0x372deb[_0x447f('0x38')]=qs[_0x447f('0x39')](_0x17a034[_0x447f('0x31')][_0x447f('0x39')]);_0x372deb[_0x447f('0x3a')]=qs[_0x447f('0x3b')](_['pick'](_0x17a034[_0x447f('0x31')],_0x47d53e['filters']),_0x3ecf93);if(_0x17a034[_0x447f('0x31')][_0x447f('0x3c')]){_0x372deb[_0x447f('0x3a')]=_[_0x447f('0x3d')](_0x372deb[_0x447f('0x3a')],{'$or':_[_0x447f('0x2a')](_0x3ecf93,function(_0x5c2ba9){if(_0x5c2ba9['type']!=='VIRTUAL'){var _0x593ccb={};_0x593ccb[_0x5c2ba9[_0x447f('0x28')]]={'$like':'%'+_0x17a034[_0x447f('0x31')][_0x447f('0x3c')]+'%'};return _0x593ccb;}})});}_0x372deb=_[_0x447f('0x3d')]({},_0x372deb,_0x17a034['options']);var _0xe666db={'where':_0x372deb[_0x447f('0x3a')]};return db[_0x447f('0x2b')][_0x447f('0x1e')](_0xe666db)[_0x447f('0x25')](function(_0x56541c){_0x2cbf7d[_0x447f('0x1e')]=_0x56541c;if(_0x17a034[_0x447f('0x31')]['includeAll']){_0x372deb[_0x447f('0x3e')]=[{'all':!![]}];}return db[_0x447f('0x2b')]['findAll'](_0x372deb);})[_0x447f('0x25')](function(_0x478606){_0x2cbf7d[_0x447f('0x3f')]=_0x478606;return _0x2cbf7d;})['then'](respondWithFilteredResult(_0x18b4b6,_0x372deb))[_0x447f('0x40')](handleError(_0x18b4b6,null));};exports[_0x447f('0x41')]=function(_0x40b89d,_0x17f3a1){var _0x36e2ad={'raw':![],'where':{'id':_0x40b89d[_0x447f('0x42')]['id']}},_0x12ed16={};_0x12ed16[_0x447f('0x30')]=_[_0x447f('0x32')](db[_0x447f('0x2b')][_0x447f('0x2c')]);_0x12ed16[_0x447f('0x31')]=_['keys'](_0x40b89d[_0x447f('0x31')]);_0x12ed16[_0x447f('0x3b')]=_[_0x447f('0x33')](_0x12ed16[_0x447f('0x30')],_0x12ed16[_0x447f('0x31')]);_0x36e2ad[_0x447f('0x34')]=_[_0x447f('0x33')](_0x12ed16['model'],qs[_0x447f('0x35')](_0x40b89d[_0x447f('0x31')][_0x447f('0x35')]));_0x36e2ad['attributes']=_0x36e2ad[_0x447f('0x34')][_0x447f('0x43')]?_0x36e2ad[_0x447f('0x34')]:_0x12ed16[_0x447f('0x30')];if(_0x40b89d[_0x447f('0x31')][_0x447f('0x44')]){_0x36e2ad[_0x447f('0x3e')]=[{'all':!![]}];}_0x36e2ad=_[_0x447f('0x3d')]({},_0x36e2ad,_0x40b89d[_0x447f('0x45')]);return db[_0x447f('0x2b')][_0x447f('0x46')](_0x36e2ad)[_0x447f('0x25')](handleEntityNotFound(_0x17f3a1,null))[_0x447f('0x25')](respondWithResult(_0x17f3a1,null))[_0x447f('0x40')](handleError(_0x17f3a1,null));};exports[_0x447f('0x47')]=function(_0x371806,_0xfa6dcb){return db['FreshsalesConfiguration']['create'](_0x371806[_0x447f('0x48')],{})[_0x447f('0x25')](respondWithResult(_0xfa6dcb,0xc9))['catch'](handleError(_0xfa6dcb,null));};exports[_0x447f('0x23')]=function(_0x536bc1,_0x4c7460){if(_0x536bc1[_0x447f('0x48')]['id']){delete _0x536bc1[_0x447f('0x48')]['id'];}return db[_0x447f('0x2b')]['find']({'where':{'id':_0x536bc1['params']['id']}})[_0x447f('0x25')](handleEntityNotFound(_0x4c7460,null))['then'](saveUpdates(_0x536bc1[_0x447f('0x48')],null))[_0x447f('0x25')](respondWithResult(_0x4c7460,null))[_0x447f('0x40')](handleError(_0x4c7460,null));};exports[_0x447f('0x24')]=function(_0x534f9f,_0x86dab0){return db[_0x447f('0x2b')][_0x447f('0x46')]({'where':{'id':_0x534f9f['params']['id']}})[_0x447f('0x25')](handleEntityNotFound(_0x86dab0,null))['then'](removeEntity(_0x86dab0,null))[_0x447f('0x40')](handleError(_0x86dab0,null));};exports[_0x447f('0x49')]=function(_0x21df00,_0x1e4e78,_0x561c94){var _0x3fe20c={};var _0xcc5e8a={};var _0x4023b6;var _0x1c4638;return db['FreshsalesConfiguration'][_0x447f('0x4a')]({'where':{'id':_0x21df00['params']['id']}})[_0x447f('0x25')](handleEntityNotFound(_0x1e4e78,null))[_0x447f('0x25')](function(_0x17e6e1){if(_0x17e6e1){_0x4023b6=_0x17e6e1;_0xcc5e8a[_0x447f('0x30')]=_[_0x447f('0x32')](db[_0x447f('0x4b')]['rawAttributes']);_0xcc5e8a[_0x447f('0x31')]=_['keys'](_0x21df00[_0x447f('0x31')]);_0xcc5e8a[_0x447f('0x3b')]=_[_0x447f('0x33')](_0xcc5e8a[_0x447f('0x30')],_0xcc5e8a['query']);_0x3fe20c[_0x447f('0x34')]=_[_0x447f('0x33')](_0xcc5e8a[_0x447f('0x30')],qs['fields'](_0x21df00[_0x447f('0x31')][_0x447f('0x35')]));_0x3fe20c[_0x447f('0x34')]=_0x3fe20c[_0x447f('0x34')][_0x447f('0x43')]?_0x3fe20c[_0x447f('0x34')]:_0xcc5e8a[_0x447f('0x30')];_0x3fe20c['order']=qs[_0x447f('0x39')](_0x21df00[_0x447f('0x31')][_0x447f('0x39')]);_0x3fe20c[_0x447f('0x3a')]=qs[_0x447f('0x3b')](_[_0x447f('0x4c')](_0x21df00['query'],_0xcc5e8a[_0x447f('0x3b')]));if(_0x21df00[_0x447f('0x31')][_0x447f('0x3c')]){_0x3fe20c[_0x447f('0x3a')]=_[_0x447f('0x3d')](_0x3fe20c[_0x447f('0x3a')],{'$or':_[_0x447f('0x2a')](_0x3fe20c[_0x447f('0x34')],function(_0x19ee6c){var _0x3328ed={};_0x3328ed[_0x19ee6c]={'$like':'%'+_0x21df00[_0x447f('0x31')][_0x447f('0x3c')]+'%'};return _0x3328ed;})});}_0x3fe20c=_['merge']({},_0x3fe20c,_0x21df00[_0x447f('0x45')]);return _0x4023b6['getSubjects'](_0x3fe20c);}})[_0x447f('0x25')](function(_0x3e50a7){if(_0x3e50a7){_0x1c4638=_0x3e50a7['length'];if(!_0x21df00[_0x447f('0x31')][_0x447f('0x36')]('nolimit')){_0x3fe20c['limit']=qs[_0x447f('0x1d')](_0x21df00[_0x447f('0x31')][_0x447f('0x1d')]);_0x3fe20c[_0x447f('0x1c')]=qs[_0x447f('0x1c')](_0x21df00[_0x447f('0x31')]['offset']);}return _0x4023b6[_0x447f('0x49')](_0x3fe20c);}})[_0x447f('0x25')](function(_0x2a268f){if(_0x2a268f){return _0x2a268f?{'count':_0x1c4638,'rows':_0x2a268f}:null;}})[_0x447f('0x25')](respondWithResult(_0x1e4e78,null))['catch'](handleError(_0x1e4e78,null));};exports[_0x447f('0x4d')]=function(_0xb4f950,_0x3275ee,_0x2daac2){var _0x357679={};var _0x3798ce={};var _0x48e89e;var _0x556fc5;return db['FreshsalesConfiguration'][_0x447f('0x4a')]({'where':{'id':_0xb4f950[_0x447f('0x42')]['id']}})['then'](handleEntityNotFound(_0x3275ee,null))[_0x447f('0x25')](function(_0x546050){if(_0x546050){_0x48e89e=_0x546050;_0x3798ce[_0x447f('0x30')]=_[_0x447f('0x32')](db[_0x447f('0x4b')]['rawAttributes']);_0x3798ce[_0x447f('0x31')]=_[_0x447f('0x32')](_0xb4f950['query']);_0x3798ce[_0x447f('0x3b')]=_[_0x447f('0x33')](_0x3798ce['model'],_0x3798ce[_0x447f('0x31')]);_0x357679['attributes']=_[_0x447f('0x33')](_0x3798ce['model'],qs['fields'](_0xb4f950['query'][_0x447f('0x35')]));_0x357679['attributes']=_0x357679['attributes'][_0x447f('0x43')]?_0x357679['attributes']:_0x3798ce[_0x447f('0x30')];_0x357679[_0x447f('0x38')]=qs[_0x447f('0x39')](_0xb4f950[_0x447f('0x31')][_0x447f('0x39')]);_0x357679['where']=qs[_0x447f('0x3b')](_[_0x447f('0x4c')](_0xb4f950['query'],_0x3798ce[_0x447f('0x3b')]));if(_0xb4f950[_0x447f('0x31')]['filter']){_0x357679[_0x447f('0x3a')]=_['merge'](_0x357679[_0x447f('0x3a')],{'$or':_['map'](_0x357679[_0x447f('0x34')],function(_0x2b303e){var _0x39b347={};_0x39b347[_0x2b303e]={'$like':'%'+_0xb4f950[_0x447f('0x31')][_0x447f('0x3c')]+'%'};return _0x39b347;})});}_0x357679=_[_0x447f('0x3d')]({},_0x357679,_0xb4f950[_0x447f('0x45')]);return _0x48e89e['getDescriptions'](_0x357679);}})[_0x447f('0x25')](function(_0x5d3342){if(_0x5d3342){_0x556fc5=_0x5d3342[_0x447f('0x43')];if(!_0xb4f950['query'][_0x447f('0x36')](_0x447f('0x37'))){_0x357679[_0x447f('0x1d')]=qs['limit'](_0xb4f950['query'][_0x447f('0x1d')]);_0x357679[_0x447f('0x1c')]=qs[_0x447f('0x1c')](_0xb4f950['query'][_0x447f('0x1c')]);}return _0x48e89e[_0x447f('0x4d')](_0x357679);}})[_0x447f('0x25')](function(_0x423799){if(_0x423799){return _0x423799?{'count':_0x556fc5,'rows':_0x423799}:null;}})[_0x447f('0x25')](respondWithResult(_0x3275ee,null))[_0x447f('0x40')](handleError(_0x3275ee,null));};exports['getFields']=function(_0x40f991,_0x400aea,_0xbc530b){var _0x662b32={};var _0x414a9f={};var _0x4fd9ea;var _0x4d08ea;return db[_0x447f('0x2b')][_0x447f('0x4a')]({'where':{'id':_0x40f991[_0x447f('0x42')]['id']}})[_0x447f('0x25')](handleEntityNotFound(_0x400aea,null))[_0x447f('0x25')](function(_0x32b476){if(_0x32b476){_0x4fd9ea=_0x32b476;_0x414a9f[_0x447f('0x30')]=_[_0x447f('0x32')](db[_0x447f('0x4b')][_0x447f('0x2c')]);_0x414a9f[_0x447f('0x31')]=_['keys'](_0x40f991[_0x447f('0x31')]);_0x414a9f[_0x447f('0x3b')]=_[_0x447f('0x33')](_0x414a9f[_0x447f('0x30')],_0x414a9f[_0x447f('0x31')]);_0x662b32[_0x447f('0x34')]=_[_0x447f('0x33')](_0x414a9f['model'],qs[_0x447f('0x35')](_0x40f991[_0x447f('0x31')][_0x447f('0x35')]));_0x662b32[_0x447f('0x34')]=_0x662b32[_0x447f('0x34')]['length']?_0x662b32[_0x447f('0x34')]:_0x414a9f[_0x447f('0x30')];_0x662b32[_0x447f('0x38')]=qs[_0x447f('0x39')](_0x40f991[_0x447f('0x31')][_0x447f('0x39')]);_0x662b32[_0x447f('0x3a')]=qs[_0x447f('0x3b')](_[_0x447f('0x4c')](_0x40f991[_0x447f('0x31')],_0x414a9f['filters']));if(_0x40f991[_0x447f('0x31')][_0x447f('0x3c')]){_0x662b32[_0x447f('0x3a')]=_[_0x447f('0x3d')](_0x662b32[_0x447f('0x3a')],{'$or':_['map'](_0x662b32['attributes'],function(_0x460bfe){var _0x570936={};_0x570936[_0x460bfe]={'$like':'%'+_0x40f991['query'][_0x447f('0x3c')]+'%'};return _0x570936;})});}_0x662b32=_[_0x447f('0x3d')]({},_0x662b32,_0x40f991[_0x447f('0x45')]);return _0x4fd9ea[_0x447f('0x4e')](_0x662b32);}})[_0x447f('0x25')](function(_0xadc815){if(_0xadc815){_0x4d08ea=_0xadc815[_0x447f('0x43')];if(!_0x40f991[_0x447f('0x31')]['hasOwnProperty'](_0x447f('0x37'))){_0x662b32[_0x447f('0x1d')]=qs[_0x447f('0x1d')](_0x40f991[_0x447f('0x31')][_0x447f('0x1d')]);_0x662b32[_0x447f('0x1c')]=qs[_0x447f('0x1c')](_0x40f991[_0x447f('0x31')][_0x447f('0x1c')]);}return _0x4fd9ea[_0x447f('0x4e')](_0x662b32);}})[_0x447f('0x25')](function(_0x5b4527){if(_0x5b4527){return _0x5b4527?{'count':_0x4d08ea,'rows':_0x5b4527}:null;}})['then'](respondWithResult(_0x400aea,null))[_0x447f('0x40')](handleError(_0x400aea,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index addace6..18cd868 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 _0x1284=['../../config/environment','./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1284,0xc5));var _0x4128=function(_0x3a2118,_0x31fc3c){_0x3a2118=_0x3a2118-0x0;var _0x1d181d=_0x1284[_0x3a2118];return _0x1d181d;};'use strict';var _=require('lodash');var util=require(_0x4128('0x0'));var logger=require(_0x4128('0x1'))(_0x4128('0x2'));var moment=require('moment');var BPromise=require(_0x4128('0x3'));var rp=require(_0x4128('0x4'));var fs=require('fs');var path=require(_0x4128('0x5'));var rimraf=require(_0x4128('0x6'));var config=require(_0x4128('0x7'));var attributes=require(_0x4128('0x8'));module[_0x4128('0x9')]=function(_0x478f20,_0x1628f2){return _0x478f20[_0x4128('0xa')](_0x4128('0xb'),attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2996=['exports','define','FreshsalesConfiguration','int_freshsales_configurations','lodash','util','../../config/logger','api','moment','bluebird','path','./intFreshsalesConfiguration.attributes'];(function(_0x2ce1f2,_0x1337df){var _0x5319a9=function(_0x5b8b97){while(--_0x5b8b97){_0x2ce1f2['push'](_0x2ce1f2['shift']());}};_0x5319a9(++_0x1337df);}(_0x2996,0x184));var _0x6299=function(_0x511ede,_0x805a3a){_0x511ede=_0x511ede-0x0;var _0x409877=_0x2996[_0x511ede];return _0x409877;};'use strict';var _=require(_0x6299('0x0'));var util=require(_0x6299('0x1'));var logger=require(_0x6299('0x2'))(_0x6299('0x3'));var moment=require(_0x6299('0x4'));var BPromise=require(_0x6299('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6299('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6299('0x7'));module[_0x6299('0x8')]=function(_0x39a634,_0x4239f0){return _0x39a634[_0x6299('0x9')](_0x6299('0xa'),attributes,{'tableName':_0x6299('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 69e723c..e153f8e 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 _0x2987=['request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2987,0x141));var _0x7298=function(_0x3866a0,_0x501e9a){_0x3866a0=_0x3866a0-0x0;var _0x4de61c=_0x2987[_0x3866a0];return _0x4de61c;};'use strict';var _=require(_0x7298('0x0'));var util=require(_0x7298('0x1'));var moment=require(_0x7298('0x2'));var BPromise=require(_0x7298('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7298('0x4'));var db=require(_0x7298('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7298('0x6'));var config=require(_0x7298('0x7'));var jayson=require(_0x7298('0x8'));var client=jayson[_0x7298('0x9')][_0x7298('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5935d8,_0x3d8d27,_0x2abe6a){return new BPromise(function(_0x2a386e,_0x9a4dc0){return client[_0x7298('0xb')](_0x5935d8,_0x2abe6a)[_0x7298('0xc')](function(_0x3d3150){logger[_0x7298('0xd')](_0x7298('0xe'),_0x3d8d27,_0x7298('0xf'));logger[_0x7298('0x10')](_0x7298('0x11'),_0x3d8d27,'request\x20sent',JSON[_0x7298('0x12')](_0x3d3150));if(_0x3d3150['error']){if(_0x3d3150[_0x7298('0x13')]['code']===0x1f4){logger[_0x7298('0x13')](_0x7298('0xe'),_0x3d8d27,_0x3d3150[_0x7298('0x13')][_0x7298('0x14')]);return _0x9a4dc0(_0x3d3150['error'][_0x7298('0x14')]);}logger[_0x7298('0x13')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x3d8d27,_0x3d3150[_0x7298('0x13')]['message']);return _0x2a386e(_0x3d3150[_0x7298('0x13')][_0x7298('0x14')]);}else{logger[_0x7298('0xd')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x3d8d27,_0x7298('0xf'));_0x2a386e(_0x3d3150['result'][_0x7298('0x14')]);}})['catch'](function(_0x5e2620){logger[_0x7298('0x13')](_0x7298('0xe'),_0x3d8d27,_0x5e2620);_0x9a4dc0(_0x5e2620);});});} \ No newline at end of file +var _0x50ce=['stringify','error','code','FreshsalesConfiguration,\x20%s,\x20%s','message','info','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','debug','request\x20sent'];(function(_0x2a56ad,_0x2b94bf){var _0x425175=function(_0x342f20){while(--_0x342f20){_0x2a56ad['push'](_0x2a56ad['shift']());}};_0x425175(++_0x2b94bf);}(_0x50ce,0x16f));var _0xe50c=function(_0x588011,_0x5e9d11){_0x588011=_0x588011-0x0;var _0x3b3773=_0x50ce[_0x588011];return _0x3b3773;};'use strict';var _=require(_0xe50c('0x0'));var util=require(_0xe50c('0x1'));var moment=require('moment');var BPromise=require(_0xe50c('0x2'));var rs=require(_0xe50c('0x3'));var fs=require('fs');var Redis=require(_0xe50c('0x4'));var db=require(_0xe50c('0x5'))['db'];var utils=require(_0xe50c('0x6'));var logger=require(_0xe50c('0x7'))(_0xe50c('0x8'));var config=require(_0xe50c('0x9'));var jayson=require(_0xe50c('0xa'));var client=jayson[_0xe50c('0xb')][_0xe50c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xaba5fd,_0x338432,_0x4fa261){return new BPromise(function(_0x3cf0ac,_0x2c4f20){return client[_0xe50c('0xd')](_0xaba5fd,_0x4fa261)[_0xe50c('0xe')](function(_0x1e74aa){logger['info']('FreshsalesConfiguration,\x20%s,\x20%s',_0x338432,'request\x20sent');logger[_0xe50c('0xf')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x338432,_0xe50c('0x10'),JSON[_0xe50c('0x11')](_0x1e74aa));if(_0x1e74aa['error']){if(_0x1e74aa[_0xe50c('0x12')][_0xe50c('0x13')]===0x1f4){logger[_0xe50c('0x12')](_0xe50c('0x14'),_0x338432,_0x1e74aa[_0xe50c('0x12')]['message']);return _0x2c4f20(_0x1e74aa[_0xe50c('0x12')][_0xe50c('0x15')]);}logger[_0xe50c('0x12')](_0xe50c('0x14'),_0x338432,_0x1e74aa['error']['message']);return _0x3cf0ac(_0x1e74aa[_0xe50c('0x12')][_0xe50c('0x15')]);}else{logger[_0xe50c('0x16')](_0xe50c('0x14'),_0x338432,_0xe50c('0x10'));_0x3cf0ac(_0x1e74aa[_0xe50c('0x17')]['message']);}})['catch'](function(_0x42ee92){logger['error'](_0xe50c('0x14'),_0x338432,_0x42ee92);_0x2c4f20(_0x42ee92);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index e9cd5a9..b8ce8bd 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 _0x6ce9=['update','delete','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','isAuthenticated','index','get','show','post','put','/:id'];(function(_0x2fa246,_0x24a067){var _0x57b155=function(_0x843a4){while(--_0x843a4){_0x2fa246['push'](_0x2fa246['shift']());}};_0x57b155(++_0x24a067);}(_0x6ce9,0x76));var _0x96ce=function(_0x1d9da3,_0x206669){_0x1d9da3=_0x1d9da3-0x0;var _0x2fef91=_0x6ce9[_0x1d9da3];return _0x2fef91;};'use strict';var multer=require(_0x96ce('0x0'));var util=require(_0x96ce('0x1'));var path=require(_0x96ce('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x96ce('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x96ce('0x4'));var interaction=require(_0x96ce('0x5'));var config=require(_0x96ce('0x6'));var controller=require(_0x96ce('0x7'));router['get']('/',auth[_0x96ce('0x8')](),controller[_0x96ce('0x9')]);router[_0x96ce('0xa')]('/:id',auth[_0x96ce('0x8')](),controller[_0x96ce('0xb')]);router[_0x96ce('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x96ce('0xd')](_0x96ce('0xe'),auth[_0x96ce('0x8')](),controller[_0x96ce('0xf')]);router[_0x96ce('0x10')](_0x96ce('0xe'),auth[_0x96ce('0x8')](),controller[_0x96ce('0x11')]);module[_0x96ce('0x12')]=router; \ No newline at end of file +var _0x37a4=['path','express','Router','fs-extra','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','exports','multer'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0x37a4,0xcb));var _0x437a=function(_0x3c6476,_0xf97e64){_0x3c6476=_0x3c6476-0x0;var _0x1c6a66=_0x37a4[_0x3c6476];return _0x1c6a66;};'use strict';var multer=require(_0x437a('0x0'));var util=require('util');var path=require(_0x437a('0x1'));var timeout=require('connect-timeout');var express=require(_0x437a('0x2'));var router=express[_0x437a('0x3')]();var fs_extra=require(_0x437a('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x437a('0x5'));var controller=require(_0x437a('0x6'));router[_0x437a('0x7')]('/',auth[_0x437a('0x8')](),controller['index']);router[_0x437a('0x7')](_0x437a('0x9'),auth['isAuthenticated'](),controller[_0x437a('0xa')]);router[_0x437a('0xb')]('/',auth[_0x437a('0x8')](),controller[_0x437a('0xc')]);router[_0x437a('0xd')](_0x437a('0x9'),auth[_0x437a('0x8')](),controller[_0x437a('0xe')]);router[_0x437a('0xf')](_0x437a('0x9'),auth[_0x437a('0x8')](),controller['destroy']);module[_0x437a('0x10')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index fc6e07b..a8f3ba7 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 _0xa7e1=['variable','BOOLEAN','exports','ENUM','string','customVariable','keyValue','STRING'];(function(_0x55c20a,_0x9815eb){var _0x36a083=function(_0x3c15c1){while(--_0x3c15c1){_0x55c20a['push'](_0x55c20a['shift']());}};_0x36a083(++_0x9815eb);}(_0xa7e1,0x102));var _0x1a7e=function(_0x572215,_0x3ff962){_0x572215=_0x572215-0x0;var _0x1d7eb6=_0xa7e1[_0x572215];return _0x1d7eb6;};'use strict';var Sequelize=require('sequelize');module[_0x1a7e('0x0')]={'type':{'type':Sequelize[_0x1a7e('0x1')](_0x1a7e('0x2'),'variable',_0x1a7e('0x3'),_0x1a7e('0x4'),'picklist'),'defaultValue':_0x1a7e('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x1a7e('0x5')]},'keyType':{'type':Sequelize[_0x1a7e('0x1')](_0x1a7e('0x2'),_0x1a7e('0x6'),'customVariable')},'keyContent':{'type':Sequelize[_0x1a7e('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x1a7e('0x5')]},'customField':{'type':Sequelize[_0x1a7e('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1a7e('0x5')]}}; \ No newline at end of file +var _0x99c7=['BOOLEAN','sequelize','exports','ENUM','string','customVariable','keyValue','picklist','STRING'];(function(_0x662bb0,_0x4e23f0){var _0x1650af=function(_0x34292b){while(--_0x34292b){_0x662bb0['push'](_0x662bb0['shift']());}};_0x1650af(++_0x4e23f0);}(_0x99c7,0x1a8));var _0x799c=function(_0x14e8f2,_0x5f3e33){_0x14e8f2=_0x14e8f2-0x0;var _0x2fbe07=_0x99c7[_0x14e8f2];return _0x2fbe07;};'use strict';var Sequelize=require(_0x799c('0x0'));module[_0x799c('0x1')]={'type':{'type':Sequelize[_0x799c('0x2')](_0x799c('0x3'),'variable',_0x799c('0x4'),_0x799c('0x5'),_0x799c('0x6')),'defaultValue':_0x799c('0x3')},'content':{'type':Sequelize[_0x799c('0x7')]},'key':{'type':Sequelize[_0x799c('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x799c('0x3'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x799c('0x7')]},'idField':{'type':Sequelize[_0x799c('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x799c('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 4841d09..a568404 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 _0x2f1b=['end','offset','limit','count','Content-Range','reject','update','destroy','then','stack','name','send','map','FreshsalesField','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','params','include','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','sendStatus','status'];(function(_0x40d172,_0x39baf8){var _0x3f1cc2=function(_0x41df75){while(--_0x41df75){_0x40d172['push'](_0x40d172['shift']());}};_0x3f1cc2(++_0x39baf8);}(_0x2f1b,0xf7));var _0xb2f1=function(_0x1b95a5,_0x59f484){_0x1b95a5=_0x1b95a5-0x0;var _0x22e550=_0x2f1b[_0x1b95a5];return _0x22e550;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb2f1('0x0'));var zipdir=require(_0xb2f1('0x1'));var jsonpatch=require(_0xb2f1('0x2'));var rp=require(_0xb2f1('0x3'));var moment=require(_0xb2f1('0x4'));var BPromise=require(_0xb2f1('0x5'));var Mustache=require(_0xb2f1('0x6'));var util=require(_0xb2f1('0x7'));var path=require(_0xb2f1('0x8'));var sox=require(_0xb2f1('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb2f1('0xa'));var squel=require(_0xb2f1('0xb'));var crypto=require(_0xb2f1('0xc'));var jsforce=require(_0xb2f1('0xd'));var deskjs=require(_0xb2f1('0xe'));var toCsv=require('to-csv');var querystring=require(_0xb2f1('0xf'));var Papa=require('papaparse');var Redis=require(_0xb2f1('0x10'));var authService=require(_0xb2f1('0x11'));var qs=require(_0xb2f1('0x12'));var as=require(_0xb2f1('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb2f1('0x14'))(_0xb2f1('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb2f1('0x16'))['db'];function respondWithStatusCode(_0x3984eb,_0x1ad495){_0x1ad495=_0x1ad495||0xcc;return function(_0x1e6e0a){if(_0x1e6e0a){return _0x3984eb[_0xb2f1('0x17')](_0x1ad495);}return _0x3984eb[_0xb2f1('0x18')](_0x1ad495)[_0xb2f1('0x19')]();};}function respondWithResult(_0x13421f,_0x29afb3){_0x29afb3=_0x29afb3||0xc8;return function(_0x2c57c1){if(_0x2c57c1){return _0x13421f[_0xb2f1('0x18')](_0x29afb3)['json'](_0x2c57c1);}};}function respondWithFilteredResult(_0x413ef3,_0x45cb1d){return function(_0x993d2){if(_0x993d2){var _0x14984e=typeof _0x45cb1d[_0xb2f1('0x1a')]==='undefined'&&typeof _0x45cb1d[_0xb2f1('0x1b')]==='undefined';var _0x55e3fe=_0x993d2['count'];var _0x258372=_0x14984e?0x0:_0x45cb1d[_0xb2f1('0x1a')];var _0x58bb05=_0x14984e?_0x993d2[_0xb2f1('0x1c')]:_0x45cb1d[_0xb2f1('0x1a')]+_0x45cb1d[_0xb2f1('0x1b')];var _0x157a52;if(_0x58bb05>=_0x55e3fe){_0x58bb05=_0x55e3fe;_0x157a52=0xc8;}else{_0x157a52=0xce;}_0x413ef3['status'](_0x157a52);return _0x413ef3['set'](_0xb2f1('0x1d'),_0x258372+'-'+_0x58bb05+'/'+_0x55e3fe)['json'](_0x993d2);}return null;};}function patchUpdates(_0x319d04){return function(_0x13072f){try{jsonpatch['apply'](_0x13072f,_0x319d04,!![]);}catch(_0xacf5c6){return BPromise[_0xb2f1('0x1e')](_0xacf5c6);}return _0x13072f['save']();};}function saveUpdates(_0x2f9430,_0x56527c){return function(_0x1724b2){if(_0x1724b2){return _0x1724b2[_0xb2f1('0x1f')](_0x2f9430)['then'](function(_0x2319e7){return _0x2319e7;});}return null;};}function removeEntity(_0xe732cb,_0x484383){return function(_0x1e3272){if(_0x1e3272){return _0x1e3272[_0xb2f1('0x20')]()[_0xb2f1('0x21')](function(){_0xe732cb[_0xb2f1('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x520067,_0xd9669e){return function(_0x1a7697){if(!_0x1a7697){_0x520067[_0xb2f1('0x17')](0x194);}return _0x1a7697;};}function handleError(_0x1cf5bc,_0x4a3638){_0x4a3638=_0x4a3638||0x1f4;return function(_0x39b544){logger['error'](_0x39b544[_0xb2f1('0x22')]);if(_0x39b544[_0xb2f1('0x23')]){delete _0x39b544['name'];}_0x1cf5bc[_0xb2f1('0x18')](_0x4a3638)[_0xb2f1('0x24')](_0x39b544);};}exports['index']=function(_0x1f8495,_0x231186){var _0x2c9554={},_0x1227f4={},_0xf68eae={'count':0x0,'rows':[]};var _0xda788=_[_0xb2f1('0x25')](db[_0xb2f1('0x26')][_0xb2f1('0x27')],function(_0x413b58){return{'name':_0x413b58[_0xb2f1('0x28')],'type':_0x413b58[_0xb2f1('0x29')][_0xb2f1('0x2a')]};});_0x1227f4[_0xb2f1('0x2b')]=_[_0xb2f1('0x25')](_0xda788,_0xb2f1('0x23'));_0x1227f4[_0xb2f1('0x2c')]=_[_0xb2f1('0x2d')](_0x1f8495['query']);_0x1227f4[_0xb2f1('0x2e')]=_['intersection'](_0x1227f4[_0xb2f1('0x2b')],_0x1227f4[_0xb2f1('0x2c')]);_0x2c9554[_0xb2f1('0x2f')]=_[_0xb2f1('0x30')](_0x1227f4['model'],qs['fields'](_0x1f8495[_0xb2f1('0x2c')][_0xb2f1('0x31')]));_0x2c9554[_0xb2f1('0x2f')]=_0x2c9554[_0xb2f1('0x2f')][_0xb2f1('0x32')]?_0x2c9554[_0xb2f1('0x2f')]:_0x1227f4['model'];if(!_0x1f8495[_0xb2f1('0x2c')]['hasOwnProperty'](_0xb2f1('0x33'))){_0x2c9554[_0xb2f1('0x1b')]=qs[_0xb2f1('0x1b')](_0x1f8495[_0xb2f1('0x2c')]['limit']);_0x2c9554[_0xb2f1('0x1a')]=qs[_0xb2f1('0x1a')](_0x1f8495['query'][_0xb2f1('0x1a')]);}_0x2c9554['order']=qs[_0xb2f1('0x34')](_0x1f8495[_0xb2f1('0x2c')][_0xb2f1('0x34')]);_0x2c9554[_0xb2f1('0x35')]=qs[_0xb2f1('0x2e')](_[_0xb2f1('0x36')](_0x1f8495[_0xb2f1('0x2c')],_0x1227f4[_0xb2f1('0x2e')]),_0xda788);if(_0x1f8495[_0xb2f1('0x2c')][_0xb2f1('0x37')]){_0x2c9554['where']=_[_0xb2f1('0x38')](_0x2c9554[_0xb2f1('0x35')],{'$or':_[_0xb2f1('0x25')](_0xda788,function(_0x30b0f7){if(_0x30b0f7['type']!==_0xb2f1('0x39')){var _0x149efd={};_0x149efd[_0x30b0f7[_0xb2f1('0x23')]]={'$like':'%'+_0x1f8495['query'][_0xb2f1('0x37')]+'%'};return _0x149efd;}})});}_0x2c9554=_[_0xb2f1('0x38')]({},_0x2c9554,_0x1f8495[_0xb2f1('0x3a')]);var _0xe23aab={'where':_0x2c9554[_0xb2f1('0x35')]};return db[_0xb2f1('0x26')]['count'](_0xe23aab)[_0xb2f1('0x21')](function(_0x3e5acc){_0xf68eae['count']=_0x3e5acc;if(_0x1f8495[_0xb2f1('0x2c')][_0xb2f1('0x3b')]){_0x2c9554['include']=[{'all':!![]}];}return db['FreshsalesField']['findAll'](_0x2c9554);})[_0xb2f1('0x21')](function(_0x5090fc){_0xf68eae[_0xb2f1('0x3c')]=_0x5090fc;return _0xf68eae;})['then'](respondWithFilteredResult(_0x231186,_0x2c9554))[_0xb2f1('0x3d')](handleError(_0x231186,null));};exports[_0xb2f1('0x3e')]=function(_0x58fa86,_0x56e010){var _0x1cab7e={'raw':!![],'where':{'id':_0x58fa86[_0xb2f1('0x3f')]['id']}},_0x2df2d4={};_0x2df2d4[_0xb2f1('0x2b')]=_[_0xb2f1('0x2d')](db['FreshsalesField'][_0xb2f1('0x27')]);_0x2df2d4[_0xb2f1('0x2c')]=_[_0xb2f1('0x2d')](_0x58fa86[_0xb2f1('0x2c')]);_0x2df2d4[_0xb2f1('0x2e')]=_['intersection'](_0x2df2d4[_0xb2f1('0x2b')],_0x2df2d4[_0xb2f1('0x2c')]);_0x1cab7e[_0xb2f1('0x2f')]=_['intersection'](_0x2df2d4[_0xb2f1('0x2b')],qs[_0xb2f1('0x31')](_0x58fa86[_0xb2f1('0x2c')][_0xb2f1('0x31')]));_0x1cab7e[_0xb2f1('0x2f')]=_0x1cab7e['attributes']['length']?_0x1cab7e[_0xb2f1('0x2f')]:_0x2df2d4[_0xb2f1('0x2b')];if(_0x58fa86[_0xb2f1('0x2c')][_0xb2f1('0x3b')]){_0x1cab7e[_0xb2f1('0x40')]=[{'all':!![]}];}_0x1cab7e=_[_0xb2f1('0x38')]({},_0x1cab7e,_0x58fa86['options']);return db['FreshsalesField'][_0xb2f1('0x41')](_0x1cab7e)[_0xb2f1('0x21')](handleEntityNotFound(_0x56e010,null))[_0xb2f1('0x21')](respondWithResult(_0x56e010,null))[_0xb2f1('0x3d')](handleError(_0x56e010,null));};exports[_0xb2f1('0x42')]=function(_0x42bb32,_0x2bf549){return db[_0xb2f1('0x26')]['create'](_0x42bb32[_0xb2f1('0x43')],{})[_0xb2f1('0x21')](respondWithResult(_0x2bf549,0xc9))['catch'](handleError(_0x2bf549,null));};exports[_0xb2f1('0x1f')]=function(_0x1a20fc,_0x393dc7){if(_0x1a20fc['body']['id']){delete _0x1a20fc[_0xb2f1('0x43')]['id'];}return db[_0xb2f1('0x26')]['find']({'where':{'id':_0x1a20fc['params']['id']}})[_0xb2f1('0x21')](handleEntityNotFound(_0x393dc7,null))[_0xb2f1('0x21')](saveUpdates(_0x1a20fc['body'],null))[_0xb2f1('0x21')](respondWithResult(_0x393dc7,null))['catch'](handleError(_0x393dc7,null));};exports[_0xb2f1('0x20')]=function(_0x1f6727,_0x23dfd2){return db['FreshsalesField'][_0xb2f1('0x41')]({'where':{'id':_0x1f6727[_0xb2f1('0x3f')]['id']}})['then'](handleEntityNotFound(_0x23dfd2,null))[_0xb2f1('0x21')](removeEntity(_0x23dfd2,null))[_0xb2f1('0x3d')](handleError(_0x23dfd2,null));}; \ No newline at end of file +var _0x1dc8=['error','name','send','map','FreshsalesField','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','show','params','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','reject','update','then','destroy'];(function(_0x2bd88d,_0x2d5dc3){var _0x5516d4=function(_0x1272c8){while(--_0x1272c8){_0x2bd88d['push'](_0x2bd88d['shift']());}};_0x5516d4(++_0x2d5dc3);}(_0x1dc8,0x197));var _0x81dc=function(_0x48cb73,_0x53e512){_0x48cb73=_0x48cb73-0x0;var _0x1435f8=_0x1dc8[_0x48cb73];return _0x1435f8;};'use strict';var emlformat=require(_0x81dc('0x0'));var rimraf=require(_0x81dc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x81dc('0x2'));var rp=require(_0x81dc('0x3'));var moment=require('moment');var BPromise=require(_0x81dc('0x4'));var Mustache=require(_0x81dc('0x5'));var util=require('util');var path=require(_0x81dc('0x6'));var sox=require(_0x81dc('0x7'));var csv=require(_0x81dc('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x81dc('0x9'));var crypto=require(_0x81dc('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x81dc('0xb'));var toCsv=require(_0x81dc('0x8'));var querystring=require(_0x81dc('0xc'));var Papa=require(_0x81dc('0xd'));var Redis=require(_0x81dc('0xe'));var authService=require(_0x81dc('0xf'));var qs=require(_0x81dc('0x10'));var as=require(_0x81dc('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x81dc('0x12'))(_0x81dc('0x13'));var utils=require(_0x81dc('0x14'));var config=require(_0x81dc('0x15'));var licenseUtil=require(_0x81dc('0x16'));var db=require(_0x81dc('0x17'))['db'];function respondWithStatusCode(_0x119567,_0x50d2c4){_0x50d2c4=_0x50d2c4||0xcc;return function(_0x244054){if(_0x244054){return _0x119567[_0x81dc('0x18')](_0x50d2c4);}return _0x119567['status'](_0x50d2c4)[_0x81dc('0x19')]();};}function respondWithResult(_0x2981f4,_0x37d1b3){_0x37d1b3=_0x37d1b3||0xc8;return function(_0xfe8b53){if(_0xfe8b53){return _0x2981f4[_0x81dc('0x1a')](_0x37d1b3)[_0x81dc('0x1b')](_0xfe8b53);}};}function respondWithFilteredResult(_0x19e529,_0x470649){return function(_0x11afc1){if(_0x11afc1){var _0x48a452=typeof _0x470649[_0x81dc('0x1c')]===_0x81dc('0x1d')&&typeof _0x470649[_0x81dc('0x1e')]===_0x81dc('0x1d');var _0x3f6d11=_0x11afc1[_0x81dc('0x1f')];var _0x4e28d1=_0x48a452?0x0:_0x470649[_0x81dc('0x1c')];var _0x389cd9=_0x48a452?_0x11afc1[_0x81dc('0x1f')]:_0x470649[_0x81dc('0x1c')]+_0x470649['limit'];var _0xdfb67c;if(_0x389cd9>=_0x3f6d11){_0x389cd9=_0x3f6d11;_0xdfb67c=0xc8;}else{_0xdfb67c=0xce;}_0x19e529[_0x81dc('0x1a')](_0xdfb67c);return _0x19e529[_0x81dc('0x20')]('Content-Range',_0x4e28d1+'-'+_0x389cd9+'/'+_0x3f6d11)[_0x81dc('0x1b')](_0x11afc1);}return null;};}function patchUpdates(_0x4f7d12){return function(_0x159111){try{jsonpatch['apply'](_0x159111,_0x4f7d12,!![]);}catch(_0x20f95c){return BPromise[_0x81dc('0x21')](_0x20f95c);}return _0x159111['save']();};}function saveUpdates(_0x3c1408,_0x9642fd){return function(_0x42874a){if(_0x42874a){return _0x42874a[_0x81dc('0x22')](_0x3c1408)[_0x81dc('0x23')](function(_0x17f593){return _0x17f593;});}return null;};}function removeEntity(_0x7d51a6,_0x933863){return function(_0x4ec85d){if(_0x4ec85d){return _0x4ec85d[_0x81dc('0x24')]()[_0x81dc('0x23')](function(){_0x7d51a6[_0x81dc('0x1a')](0xcc)[_0x81dc('0x19')]();});}};}function handleEntityNotFound(_0x6caf14,_0x5ce49b){return function(_0x5ac20d){if(!_0x5ac20d){_0x6caf14['sendStatus'](0x194);}return _0x5ac20d;};}function handleError(_0x178488,_0xb18873){_0xb18873=_0xb18873||0x1f4;return function(_0x2f1cf3){logger[_0x81dc('0x25')](_0x2f1cf3['stack']);if(_0x2f1cf3[_0x81dc('0x26')]){delete _0x2f1cf3[_0x81dc('0x26')];}_0x178488[_0x81dc('0x1a')](_0xb18873)[_0x81dc('0x27')](_0x2f1cf3);};}exports['index']=function(_0x439843,_0x5d9309){var _0x4bdd89={},_0x301e32={},_0x2a1fb8={'count':0x0,'rows':[]};var _0x29015e=_[_0x81dc('0x28')](db[_0x81dc('0x29')][_0x81dc('0x2a')],function(_0x334182){return{'name':_0x334182[_0x81dc('0x2b')],'type':_0x334182[_0x81dc('0x2c')][_0x81dc('0x2d')]};});_0x301e32[_0x81dc('0x2e')]=_[_0x81dc('0x28')](_0x29015e,'name');_0x301e32[_0x81dc('0x2f')]=_[_0x81dc('0x30')](_0x439843[_0x81dc('0x2f')]);_0x301e32[_0x81dc('0x31')]=_[_0x81dc('0x32')](_0x301e32[_0x81dc('0x2e')],_0x301e32['query']);_0x4bdd89[_0x81dc('0x33')]=_[_0x81dc('0x32')](_0x301e32['model'],qs[_0x81dc('0x34')](_0x439843[_0x81dc('0x2f')][_0x81dc('0x34')]));_0x4bdd89['attributes']=_0x4bdd89['attributes'][_0x81dc('0x35')]?_0x4bdd89[_0x81dc('0x33')]:_0x301e32[_0x81dc('0x2e')];if(!_0x439843[_0x81dc('0x2f')][_0x81dc('0x36')](_0x81dc('0x37'))){_0x4bdd89['limit']=qs['limit'](_0x439843[_0x81dc('0x2f')][_0x81dc('0x1e')]);_0x4bdd89[_0x81dc('0x1c')]=qs[_0x81dc('0x1c')](_0x439843[_0x81dc('0x2f')]['offset']);}_0x4bdd89[_0x81dc('0x38')]=qs[_0x81dc('0x39')](_0x439843['query'][_0x81dc('0x39')]);_0x4bdd89[_0x81dc('0x3a')]=qs[_0x81dc('0x31')](_[_0x81dc('0x3b')](_0x439843[_0x81dc('0x2f')],_0x301e32[_0x81dc('0x31')]),_0x29015e);if(_0x439843[_0x81dc('0x2f')][_0x81dc('0x3c')]){_0x4bdd89['where']=_[_0x81dc('0x3d')](_0x4bdd89['where'],{'$or':_['map'](_0x29015e,function(_0x5daeb4){if(_0x5daeb4[_0x81dc('0x2c')]!==_0x81dc('0x3e')){var _0x1b29a3={};_0x1b29a3[_0x5daeb4['name']]={'$like':'%'+_0x439843[_0x81dc('0x2f')]['filter']+'%'};return _0x1b29a3;}})});}_0x4bdd89=_[_0x81dc('0x3d')]({},_0x4bdd89,_0x439843[_0x81dc('0x3f')]);var _0x174d79={'where':_0x4bdd89[_0x81dc('0x3a')]};return db[_0x81dc('0x29')]['count'](_0x174d79)[_0x81dc('0x23')](function(_0x165a37){_0x2a1fb8[_0x81dc('0x1f')]=_0x165a37;if(_0x439843['query'][_0x81dc('0x40')]){_0x4bdd89[_0x81dc('0x41')]=[{'all':!![]}];}return db[_0x81dc('0x29')][_0x81dc('0x42')](_0x4bdd89);})[_0x81dc('0x23')](function(_0x29401e){_0x2a1fb8[_0x81dc('0x43')]=_0x29401e;return _0x2a1fb8;})[_0x81dc('0x23')](respondWithFilteredResult(_0x5d9309,_0x4bdd89))[_0x81dc('0x44')](handleError(_0x5d9309,null));};exports[_0x81dc('0x45')]=function(_0xd11896,_0x574518){var _0x3862b5={'raw':!![],'where':{'id':_0xd11896[_0x81dc('0x46')]['id']}},_0x2ecaae={};_0x2ecaae[_0x81dc('0x2e')]=_[_0x81dc('0x30')](db[_0x81dc('0x29')][_0x81dc('0x2a')]);_0x2ecaae[_0x81dc('0x2f')]=_[_0x81dc('0x30')](_0xd11896[_0x81dc('0x2f')]);_0x2ecaae[_0x81dc('0x31')]=_[_0x81dc('0x32')](_0x2ecaae['model'],_0x2ecaae['query']);_0x3862b5[_0x81dc('0x33')]=_[_0x81dc('0x32')](_0x2ecaae[_0x81dc('0x2e')],qs[_0x81dc('0x34')](_0xd11896[_0x81dc('0x2f')][_0x81dc('0x34')]));_0x3862b5['attributes']=_0x3862b5[_0x81dc('0x33')][_0x81dc('0x35')]?_0x3862b5['attributes']:_0x2ecaae['model'];if(_0xd11896[_0x81dc('0x2f')]['includeAll']){_0x3862b5[_0x81dc('0x41')]=[{'all':!![]}];}_0x3862b5=_[_0x81dc('0x3d')]({},_0x3862b5,_0xd11896[_0x81dc('0x3f')]);return db[_0x81dc('0x29')][_0x81dc('0x47')](_0x3862b5)['then'](handleEntityNotFound(_0x574518,null))[_0x81dc('0x23')](respondWithResult(_0x574518,null))['catch'](handleError(_0x574518,null));};exports[_0x81dc('0x48')]=function(_0x38f148,_0x3b484f){return db[_0x81dc('0x29')][_0x81dc('0x48')](_0x38f148['body'],{})[_0x81dc('0x23')](respondWithResult(_0x3b484f,0xc9))['catch'](handleError(_0x3b484f,null));};exports['update']=function(_0x37ea94,_0x38f26c){if(_0x37ea94[_0x81dc('0x49')]['id']){delete _0x37ea94[_0x81dc('0x49')]['id'];}return db[_0x81dc('0x29')]['find']({'where':{'id':_0x37ea94[_0x81dc('0x46')]['id']}})[_0x81dc('0x23')](handleEntityNotFound(_0x38f26c,null))[_0x81dc('0x23')](saveUpdates(_0x37ea94['body'],null))[_0x81dc('0x23')](respondWithResult(_0x38f26c,null))[_0x81dc('0x44')](handleError(_0x38f26c,null));};exports[_0x81dc('0x24')]=function(_0x1d6d16,_0x27aa3e){return db[_0x81dc('0x29')][_0x81dc('0x47')]({'where':{'id':_0x1d6d16[_0x81dc('0x46')]['id']}})[_0x81dc('0x23')](handleEntityNotFound(_0x27aa3e,null))[_0x81dc('0x23')](removeEntity(_0x27aa3e,null))['catch'](handleError(_0x27aa3e,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 46407ec..140fc09 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 _0x6a95=['util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./intFreshsalesField.attributes','exports','define','FreshsalesField','idField','FieldId','lodash'];(function(_0x3c7634,_0x4b12ec){var _0x380a32=function(_0x53183b){while(--_0x53183b){_0x3c7634['push'](_0x3c7634['shift']());}};_0x380a32(++_0x4b12ec);}(_0x6a95,0x1db));var _0x56a9=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0x6a95[_0x1e7b16];return _0x37fadc;};'use strict';var _=require(_0x56a9('0x0'));var util=require(_0x56a9('0x1'));var logger=require(_0x56a9('0x2'))(_0x56a9('0x3'));var moment=require(_0x56a9('0x4'));var BPromise=require(_0x56a9('0x5'));var rp=require(_0x56a9('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x56a9('0x7'));var attributes=require(_0x56a9('0x8'));module[_0x56a9('0x9')]=function(_0x2eb132,_0x3c15b6){return _0x2eb132[_0x56a9('0xa')](_0x56a9('0xb'),attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0x56a9('0xc'),_0x56a9('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x30c7=['int_freshsales_fields','freshsales_unique_index','FieldId','lodash','../../config/logger','api','moment','request-promise','path','FreshsalesField'];(function(_0x57fc2a,_0x14bbe5){var _0xa839b=function(_0x26572c){while(--_0x26572c){_0x57fc2a['push'](_0x57fc2a['shift']());}};_0xa839b(++_0x14bbe5);}(_0x30c7,0x111));var _0x730c=function(_0x5ee3de,_0x8f1cec){_0x5ee3de=_0x5ee3de-0x0;var _0x1fd417=_0x30c7[_0x5ee3de];return _0x1fd417;};'use strict';var _=require(_0x730c('0x0'));var util=require('util');var logger=require(_0x730c('0x1'))(_0x730c('0x2'));var moment=require(_0x730c('0x3'));var BPromise=require('bluebird');var rp=require(_0x730c('0x4'));var fs=require('fs');var path=require(_0x730c('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intFreshsalesField.attributes');module['exports']=function(_0x3516be,_0x229682){return _0x3516be['define'](_0x730c('0x6'),attributes,{'tableName':_0x730c('0x7'),'paranoid':![],'indexes':[{'name':_0x730c('0x8'),'fields':['idField',_0x730c('0x9')],'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 91ec41a..7a707f0 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 _0x4819=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','FreshsalesField,\x20%s,\x20%s','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','util','moment'];(function(_0x4bd2a1,_0x1c855d){var _0x3f2d19=function(_0x38bc94){while(--_0x38bc94){_0x4bd2a1['push'](_0x4bd2a1['shift']());}};_0x3f2d19(++_0x1c855d);}(_0x4819,0xcd));var _0x9481=function(_0x33c32a,_0x2143db){_0x33c32a=_0x33c32a-0x0;var _0x221571=_0x4819[_0x33c32a];return _0x221571;};'use strict';var _=require('lodash');var util=require(_0x9481('0x0'));var moment=require(_0x9481('0x1'));var BPromise=require(_0x9481('0x2'));var rs=require(_0x9481('0x3'));var fs=require('fs');var Redis=require(_0x9481('0x4'));var db=require(_0x9481('0x5'))['db'];var utils=require(_0x9481('0x6'));var logger=require(_0x9481('0x7'))(_0x9481('0x8'));var config=require(_0x9481('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9481('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54cc78,_0x14e05a,_0x6c6a08){return new BPromise(function(_0x27c033,_0x3278ff){return client[_0x9481('0xb')](_0x54cc78,_0x6c6a08)['then'](function(_0x1818cf){logger['info'](_0x9481('0xc'),_0x14e05a,'request\x20sent');logger[_0x9481('0xd')](_0x9481('0xe'),_0x14e05a,_0x9481('0xf'),JSON[_0x9481('0x10')](_0x1818cf));if(_0x1818cf[_0x9481('0x11')]){if(_0x1818cf[_0x9481('0x11')][_0x9481('0x12')]===0x1f4){logger[_0x9481('0x11')](_0x9481('0xc'),_0x14e05a,_0x1818cf['error']['message']);return _0x3278ff(_0x1818cf[_0x9481('0x11')][_0x9481('0x13')]);}logger[_0x9481('0x11')](_0x9481('0xc'),_0x14e05a,_0x1818cf[_0x9481('0x11')][_0x9481('0x13')]);return _0x27c033(_0x1818cf[_0x9481('0x11')]['message']);}else{logger[_0x9481('0x14')](_0x9481('0xc'),_0x14e05a,'request\x20sent');_0x27c033(_0x1818cf[_0x9481('0x15')]['message']);}})[_0x9481('0x16')](function(_0x7a2ac8){logger[_0x9481('0x11')](_0x9481('0xc'),_0x14e05a,_0x7a2ac8);_0x3278ff(_0x7a2ac8);});});} \ No newline at end of file +var _0x4819=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','FreshsalesField,\x20%s,\x20%s','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','util','moment'];(function(_0x32874b,_0x40e1a0){var _0xd8900f=function(_0x80e08){while(--_0x80e08){_0x32874b['push'](_0x32874b['shift']());}};_0xd8900f(++_0x40e1a0);}(_0x4819,0xcd));var _0x9481=function(_0x860520,_0x20520a){_0x860520=_0x860520-0x0;var _0x22ce80=_0x4819[_0x860520];return _0x22ce80;};'use strict';var _=require('lodash');var util=require(_0x9481('0x0'));var moment=require(_0x9481('0x1'));var BPromise=require(_0x9481('0x2'));var rs=require(_0x9481('0x3'));var fs=require('fs');var Redis=require(_0x9481('0x4'));var db=require(_0x9481('0x5'))['db'];var utils=require(_0x9481('0x6'));var logger=require(_0x9481('0x7'))(_0x9481('0x8'));var config=require(_0x9481('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9481('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54cc78,_0x14e05a,_0x6c6a08){return new BPromise(function(_0x27c033,_0x3278ff){return client[_0x9481('0xb')](_0x54cc78,_0x6c6a08)['then'](function(_0x1818cf){logger['info'](_0x9481('0xc'),_0x14e05a,'request\x20sent');logger[_0x9481('0xd')](_0x9481('0xe'),_0x14e05a,_0x9481('0xf'),JSON[_0x9481('0x10')](_0x1818cf));if(_0x1818cf[_0x9481('0x11')]){if(_0x1818cf[_0x9481('0x11')][_0x9481('0x12')]===0x1f4){logger[_0x9481('0x11')](_0x9481('0xc'),_0x14e05a,_0x1818cf['error']['message']);return _0x3278ff(_0x1818cf[_0x9481('0x11')][_0x9481('0x13')]);}logger[_0x9481('0x11')](_0x9481('0xc'),_0x14e05a,_0x1818cf[_0x9481('0x11')][_0x9481('0x13')]);return _0x27c033(_0x1818cf[_0x9481('0x11')]['message']);}else{logger[_0x9481('0x14')](_0x9481('0xc'),_0x14e05a,'request\x20sent');_0x27c033(_0x1818cf[_0x9481('0x15')]['message']);}})[_0x9481('0x16')](function(_0x7a2ac8){logger[_0x9481('0x11')](_0x9481('0xc'),_0x14e05a,_0x7a2ac8);_0x3278ff(_0x7a2ac8);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 0022d8b..1a1982e 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(_0x1f73c3,_0xa8af11){var _0x20450e=function(_0x2f30fb){while(--_0x2f30fb){_0x1f73c3['push'](_0x1f73c3['shift']());}};_0x20450e(++_0xa8af11);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x51bcab,_0x56845c){var _0x265986=function(_0x497f31){while(--_0x497f31){_0x51bcab['push'](_0x51bcab['shift']());}};_0x265986(++_0x56845c);}(_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/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 055a858..04aee38 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 _0xe98f=['username','integrationTab','sequelize','STRING'];(function(_0x2c23bb,_0x325048){var _0x4434cb=function(_0x4925d2){while(--_0x4925d2){_0x2c23bb['push'](_0x2c23bb['shift']());}};_0x4434cb(++_0x325048);}(_0xe98f,0xde));var _0xfe98=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe98f[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xfe98('0x0'));module['exports']={'name':{'type':Sequelize[_0xfe98('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xfe98('0x1')],'unique':_0xfe98('0x2')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xfe98('0x1')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize[_0xfe98('0x1')]},'serverUrl':{'type':Sequelize[_0xfe98('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xfe98('0x3'),'newTab'),'defaultValue':_0xfe98('0x3')}}; \ No newline at end of file +var _0xfa25=['STRING','username','ENUM','integrationTab','exports'];(function(_0x247fa1,_0x4ec37c){var _0x244f35=function(_0xfb98be){while(--_0xfb98be){_0x247fa1['push'](_0x247fa1['shift']());}};_0x244f35(++_0x4ec37c);}(_0xfa25,0xd1));var _0x5fa2=function(_0x4a95b2,_0x47d036){_0x4a95b2=_0x4a95b2-0x0;var _0x5206eb=_0xfa25[_0x4a95b2];return _0x5206eb;};'use strict';var Sequelize=require('sequelize');module[_0x5fa2('0x0')]={'name':{'type':Sequelize[_0x5fa2('0x1')]},'description':{'type':Sequelize[_0x5fa2('0x1')]},'username':{'type':Sequelize[_0x5fa2('0x1')],'unique':_0x5fa2('0x2')},'remoteUri':{'type':Sequelize[_0x5fa2('0x1')]},'password':{'type':Sequelize[_0x5fa2('0x1')]},'clientId':{'type':Sequelize[_0x5fa2('0x1')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x5fa2('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x5fa2('0x3')]('integrationTab','newTab'),'defaultValue':_0x5fa2('0x4')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 61f4281..476e479 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 _0x8a32=['getConfigurations','SalesforceConfiguration','pick','addConfiguration','findOne','AccountId','getSubjects','channel','SalesforceField','Subjects','getFields','Task','remoteUri','clientSecret','substring','lastIndexOf','Connection','clientId','login','password','concat','securityToken','describe','OwnerId','IsReminderSet','IsRecurrence','Subject','Description','int','picklist','boolean','email','textarea','phone','remove','includes','label','value','True','true','False','false','statusCode','stringify','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','bluebird','util','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','SalesforceAccount','rawAttributes','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','filters','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8a32,0xa2));var _0x28a3=function(_0x351b55,_0x2d699b){_0x351b55=_0x351b55-0x0;var _0x417e9c=_0x8a32[_0x351b55];return _0x417e9c;};'use strict';var emlformat=require(_0x28a3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x28a3('0x1'));var jsonpatch=require(_0x28a3('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x28a3('0x3'));var Mustache=require('mustache');var util=require(_0x28a3('0x4'));var path=require('path');var sox=require(_0x28a3('0x5'));var csv=require('to-csv');var ejs=require(_0x28a3('0x6'));var fs=require('fs');var fs_extra=require(_0x28a3('0x7'));var _=require(_0x28a3('0x8'));var squel=require('squel');var crypto=require(_0x28a3('0x9'));var jsforce=require(_0x28a3('0xa'));var deskjs=require(_0x28a3('0xb'));var toCsv=require(_0x28a3('0xc'));var querystring=require('querystring');var Papa=require(_0x28a3('0xd'));var Redis=require(_0x28a3('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x28a3('0xf'));var hardwareService=require(_0x28a3('0x10'));var logger=require(_0x28a3('0x11'))(_0x28a3('0x12'));var utils=require(_0x28a3('0x13'));var config=require(_0x28a3('0x14'));var licenseUtil=require(_0x28a3('0x15'));var db=require(_0x28a3('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x1b77cd,_0x587008){_0x587008=_0x587008||0xcc;return function(_0x5dcdd9){if(_0x5dcdd9){return _0x1b77cd[_0x28a3('0x17')](_0x587008);}return _0x1b77cd['status'](_0x587008)['end']();};}function respondWithResult(_0x3b69f3,_0x73ba3a){_0x73ba3a=_0x73ba3a||0xc8;return function(_0x1a9634){if(_0x1a9634){return _0x3b69f3[_0x28a3('0x18')](_0x73ba3a)[_0x28a3('0x19')](_0x1a9634);}};}function respondWithFilteredResult(_0x498ea8,_0x43e11f){return function(_0x2dd311){if(_0x2dd311){var _0x405b4e=typeof _0x43e11f[_0x28a3('0x1a')]==='undefined'&&typeof _0x43e11f[_0x28a3('0x1b')]===_0x28a3('0x1c');var _0x277c7a=_0x2dd311[_0x28a3('0x1d')];var _0x5635bb=_0x405b4e?0x0:_0x43e11f[_0x28a3('0x1a')];var _0x2be80b=_0x405b4e?_0x2dd311['count']:_0x43e11f[_0x28a3('0x1a')]+_0x43e11f[_0x28a3('0x1b')];var _0x326125;if(_0x2be80b>=_0x277c7a){_0x2be80b=_0x277c7a;_0x326125=0xc8;}else{_0x326125=0xce;}_0x498ea8[_0x28a3('0x18')](_0x326125);return _0x498ea8['set']('Content-Range',_0x5635bb+'-'+_0x2be80b+'/'+_0x277c7a)[_0x28a3('0x19')](_0x2dd311);}return null;};}function patchUpdates(_0x19e1e9){return function(_0x4556e3){try{jsonpatch[_0x28a3('0x1e')](_0x4556e3,_0x19e1e9,!![]);}catch(_0x21a71f){return BPromise[_0x28a3('0x1f')](_0x21a71f);}return _0x4556e3[_0x28a3('0x20')]();};}function saveUpdates(_0x9229c2,_0x432630){return function(_0x3c9e5d){if(_0x3c9e5d){return _0x3c9e5d[_0x28a3('0x21')](_0x9229c2)[_0x28a3('0x22')](function(_0x3ed3ec){return _0x3ed3ec;});}return null;};}function removeEntity(_0x191eda,_0x3d7f97){return function(_0x1f5eb){if(_0x1f5eb){return _0x1f5eb[_0x28a3('0x23')]()[_0x28a3('0x22')](function(){_0x191eda[_0x28a3('0x18')](0xcc)[_0x28a3('0x24')]();});}};}function handleEntityNotFound(_0x322af6,_0x105453){return function(_0x27145f){if(!_0x27145f){_0x322af6['sendStatus'](0x194);}return _0x27145f;};}function handleError(_0x7e538c,_0x4d5d97){_0x4d5d97=_0x4d5d97||0x1f4;return function(_0x155f68){logger[_0x28a3('0x25')](_0x155f68[_0x28a3('0x26')]);if(_0x155f68[_0x28a3('0x27')]){delete _0x155f68[_0x28a3('0x27')];}_0x7e538c['status'](_0x4d5d97)[_0x28a3('0x28')](_0x155f68);};}exports[_0x28a3('0x29')]=function(_0x17c34b,_0x4dabba){var _0x2327d8={},_0x52fec1={},_0x3f4d85={'count':0x0,'rows':[]};var _0x59b478=_[_0x28a3('0x2a')](db[_0x28a3('0x2b')][_0x28a3('0x2c')],function(_0x3c65f3){return{'name':_0x3c65f3['fieldName'],'type':_0x3c65f3[_0x28a3('0x2d')][_0x28a3('0x2e')]};});_0x52fec1['model']=_[_0x28a3('0x2a')](_0x59b478,_0x28a3('0x27'));_0x52fec1[_0x28a3('0x2f')]=_[_0x28a3('0x30')](_0x17c34b[_0x28a3('0x2f')]);_0x52fec1['filters']=_[_0x28a3('0x31')](_0x52fec1[_0x28a3('0x32')],_0x52fec1[_0x28a3('0x2f')]);_0x2327d8[_0x28a3('0x33')]=_[_0x28a3('0x31')](_0x52fec1[_0x28a3('0x32')],qs[_0x28a3('0x34')](_0x17c34b[_0x28a3('0x2f')][_0x28a3('0x34')]));_0x2327d8[_0x28a3('0x33')]=_0x2327d8[_0x28a3('0x33')][_0x28a3('0x35')]?_0x2327d8[_0x28a3('0x33')]:_0x52fec1[_0x28a3('0x32')];if(!_0x17c34b['query'][_0x28a3('0x36')]('nolimit')){_0x2327d8[_0x28a3('0x1b')]=qs[_0x28a3('0x1b')](_0x17c34b['query'][_0x28a3('0x1b')]);_0x2327d8[_0x28a3('0x1a')]=qs[_0x28a3('0x1a')](_0x17c34b['query'][_0x28a3('0x1a')]);}_0x2327d8[_0x28a3('0x37')]=qs[_0x28a3('0x38')](_0x17c34b['query'][_0x28a3('0x38')]);_0x2327d8['where']=qs['filters'](_['pick'](_0x17c34b[_0x28a3('0x2f')],_0x52fec1[_0x28a3('0x39')]),_0x59b478);if(_0x17c34b[_0x28a3('0x2f')][_0x28a3('0x3a')]){_0x2327d8[_0x28a3('0x3b')]=_[_0x28a3('0x3c')](_0x2327d8[_0x28a3('0x3b')],{'$or':_[_0x28a3('0x2a')](_0x59b478,function(_0x333b3a){if(_0x333b3a[_0x28a3('0x2d')]!==_0x28a3('0x3d')){var _0x5f1498={};_0x5f1498[_0x333b3a[_0x28a3('0x27')]]={'$like':'%'+_0x17c34b[_0x28a3('0x2f')][_0x28a3('0x3a')]+'%'};return _0x5f1498;}})});}_0x2327d8=_[_0x28a3('0x3c')]({},_0x2327d8,_0x17c34b[_0x28a3('0x3e')]);var _0xc4679b={'where':_0x2327d8['where']};return db['SalesforceAccount']['count'](_0xc4679b)[_0x28a3('0x22')](function(_0x203af4){_0x3f4d85[_0x28a3('0x1d')]=_0x203af4;if(_0x17c34b['query'][_0x28a3('0x3f')]){_0x2327d8[_0x28a3('0x40')]=[{'all':!![]}];}return db['SalesforceAccount'][_0x28a3('0x41')](_0x2327d8);})[_0x28a3('0x22')](function(_0x61853c){_0x3f4d85['rows']=_0x61853c;return _0x3f4d85;})[_0x28a3('0x22')](respondWithFilteredResult(_0x4dabba,_0x2327d8))[_0x28a3('0x42')](handleError(_0x4dabba,null));};exports[_0x28a3('0x43')]=function(_0x2ee395,_0x4e3861){var _0x10f947={'raw':![],'where':{'id':_0x2ee395[_0x28a3('0x44')]['id']}},_0x399593={};_0x399593[_0x28a3('0x32')]=_[_0x28a3('0x30')](db['SalesforceAccount'][_0x28a3('0x2c')]);_0x399593['query']=_[_0x28a3('0x30')](_0x2ee395[_0x28a3('0x2f')]);_0x399593[_0x28a3('0x39')]=_[_0x28a3('0x31')](_0x399593[_0x28a3('0x32')],_0x399593[_0x28a3('0x2f')]);_0x10f947[_0x28a3('0x33')]=_[_0x28a3('0x31')](_0x399593[_0x28a3('0x32')],qs['fields'](_0x2ee395[_0x28a3('0x2f')][_0x28a3('0x34')]));_0x10f947[_0x28a3('0x33')]=_0x10f947['attributes'][_0x28a3('0x35')]?_0x10f947[_0x28a3('0x33')]:_0x399593[_0x28a3('0x32')];if(_0x2ee395[_0x28a3('0x2f')][_0x28a3('0x3f')]){_0x10f947[_0x28a3('0x40')]=[{'all':!![]}];}_0x10f947=_[_0x28a3('0x3c')]({},_0x10f947,_0x2ee395[_0x28a3('0x3e')]);return db[_0x28a3('0x2b')][_0x28a3('0x45')](_0x10f947)[_0x28a3('0x22')](handleEntityNotFound(_0x4e3861,null))[_0x28a3('0x22')](respondWithResult(_0x4e3861,null))[_0x28a3('0x42')](handleError(_0x4e3861,null));};exports[_0x28a3('0x46')]=function(_0x2e9a07,_0x442c9f){return db[_0x28a3('0x2b')][_0x28a3('0x46')](_0x2e9a07[_0x28a3('0x47')],{})[_0x28a3('0x22')](respondWithResult(_0x442c9f,0xc9))['catch'](handleError(_0x442c9f,null));};exports['update']=function(_0x219933,_0x29824f){if(_0x219933[_0x28a3('0x47')]['id']){delete _0x219933[_0x28a3('0x47')]['id'];}return db[_0x28a3('0x2b')]['find']({'where':{'id':_0x219933[_0x28a3('0x44')]['id']}})[_0x28a3('0x22')](handleEntityNotFound(_0x29824f,null))['then'](saveUpdates(_0x219933['body'],null))[_0x28a3('0x22')](respondWithResult(_0x29824f,null))['catch'](handleError(_0x29824f,null));};exports['destroy']=function(_0x4f49f6,_0x47ed54){return db['SalesforceAccount'][_0x28a3('0x45')]({'where':{'id':_0x4f49f6[_0x28a3('0x44')]['id']}})['then'](handleEntityNotFound(_0x47ed54,null))[_0x28a3('0x22')](removeEntity(_0x47ed54,null))[_0x28a3('0x42')](handleError(_0x47ed54,null));};exports[_0x28a3('0x48')]=function(_0x3971f7,_0xae1c87,_0x535923){var _0x5f22e4={};var _0x448985={};var _0x58648d;var _0x50c5d7;return db['SalesforceAccount']['findOne']({'where':{'id':_0x3971f7[_0x28a3('0x44')]['id']}})[_0x28a3('0x22')](handleEntityNotFound(_0xae1c87,null))['then'](function(_0xfa5ea6){if(_0xfa5ea6){_0x58648d=_0xfa5ea6;_0x448985[_0x28a3('0x32')]=_[_0x28a3('0x30')](db[_0x28a3('0x49')][_0x28a3('0x2c')]);_0x448985[_0x28a3('0x2f')]=_[_0x28a3('0x30')](_0x3971f7['query']);_0x448985[_0x28a3('0x39')]=_[_0x28a3('0x31')](_0x448985['model'],_0x448985[_0x28a3('0x2f')]);_0x5f22e4['attributes']=_['intersection'](_0x448985['model'],qs[_0x28a3('0x34')](_0x3971f7['query'][_0x28a3('0x34')]));_0x5f22e4[_0x28a3('0x33')]=_0x5f22e4[_0x28a3('0x33')]['length']?_0x5f22e4[_0x28a3('0x33')]:_0x448985['model'];_0x5f22e4[_0x28a3('0x37')]=qs[_0x28a3('0x38')](_0x3971f7['query']['sort']);_0x5f22e4[_0x28a3('0x3b')]=qs[_0x28a3('0x39')](_[_0x28a3('0x4a')](_0x3971f7[_0x28a3('0x2f')],_0x448985[_0x28a3('0x39')]));if(_0x3971f7[_0x28a3('0x2f')][_0x28a3('0x3a')]){_0x5f22e4[_0x28a3('0x3b')]=_['merge'](_0x5f22e4['where'],{'$or':_[_0x28a3('0x2a')](_0x5f22e4['attributes'],function(_0x350ff9){var _0x233ba0={};_0x233ba0[_0x350ff9]={'$like':'%'+_0x3971f7[_0x28a3('0x2f')][_0x28a3('0x3a')]+'%'};return _0x233ba0;})});}_0x5f22e4=_[_0x28a3('0x3c')]({},_0x5f22e4,_0x3971f7[_0x28a3('0x3e')]);return _0x58648d[_0x28a3('0x48')](_0x5f22e4);}})[_0x28a3('0x22')](function(_0x325805){if(_0x325805){_0x50c5d7=_0x325805[_0x28a3('0x35')];if(!_0x3971f7[_0x28a3('0x2f')][_0x28a3('0x36')]('nolimit')){_0x5f22e4[_0x28a3('0x1b')]=qs['limit'](_0x3971f7[_0x28a3('0x2f')][_0x28a3('0x1b')]);_0x5f22e4[_0x28a3('0x1a')]=qs[_0x28a3('0x1a')](_0x3971f7[_0x28a3('0x2f')][_0x28a3('0x1a')]);}return _0x58648d[_0x28a3('0x48')](_0x5f22e4);}})['then'](function(_0x13f215){if(_0x13f215){return _0x13f215?{'count':_0x50c5d7,'rows':_0x13f215}:null;}})[_0x28a3('0x22')](respondWithResult(_0xae1c87,null))['catch'](handleError(_0xae1c87,null));};exports[_0x28a3('0x4b')]=function(_0x3780ca,_0x3c1f48,_0x56db27){if(_0x3780ca[_0x28a3('0x47')]['id']){delete _0x3780ca[_0x28a3('0x47')]['id'];}return db['SalesforceAccount'][_0x28a3('0x4c')]({'where':{'id':_0x3780ca[_0x28a3('0x44')]['id']}})[_0x28a3('0x22')](handleEntityNotFound(_0x3c1f48,null))[_0x28a3('0x22')](function(_0x263c36){if(_0x263c36){_0x3780ca[_0x28a3('0x47')][_0x28a3('0x4d')]=_0x263c36['id'];_0x3780ca[_0x28a3('0x47')]['Subjects']=integrations[_0x28a3('0x4e')](_0x3780ca[_0x28a3('0x47')][_0x28a3('0x4f')],_0x3780ca['body'][_0x28a3('0x2d')]);_0x3780ca[_0x28a3('0x47')]['Descriptions']=integrations['getDescriptions'](_0x3780ca[_0x28a3('0x47')][_0x28a3('0x4f')],_0x3780ca['body'][_0x28a3('0x2d')]);return db[_0x28a3('0x49')][_0x28a3('0x46')](_0x3780ca[_0x28a3('0x47')],{'include':[{'model':db[_0x28a3('0x50')],'as':_0x28a3('0x51')},{'model':db['SalesforceField'],'as':'Descriptions'}]});}return null;})[_0x28a3('0x22')](respondWithResult(_0x3c1f48,null))[_0x28a3('0x42')](handleError(_0x3c1f48,null));};exports[_0x28a3('0x52')]=function(_0x220104,_0xd5d6e1,_0x59f402){var _0x477275;var _0x2bbd7d='';var _0x2a63b9=_0x28a3('0x53');return db[_0x28a3('0x2b')][_0x28a3('0x4c')]({'where':{'id':_0x220104['params']['id']},'attributes':['id',_0x28a3('0x54'),'clientId',_0x28a3('0x55'),'username','password','securityToken']})['then'](handleEntityNotFound(_0xd5d6e1,null))['then'](function(_0xc85db5){if(_0xc85db5){_0x2bbd7d=_0xc85db5[_0x28a3('0x54')];var _0x3c6704=_0x2bbd7d['slice'](-0x1);if(_0x3c6704==='/'){_0x2bbd7d=_0x2bbd7d[_0x28a3('0x56')](0x0,_0x2bbd7d[_0x28a3('0x57')](_0x3c6704));}_0x477275=new jsforce[(_0x28a3('0x58'))]({'oauth2':{'loginUrl':_0x2bbd7d,'clientId':_0xc85db5[_0x28a3('0x59')],'clientSecret':_0xc85db5['clientSecret']}});return _0x477275[_0x28a3('0x5a')](_0xc85db5['username'],_0xc85db5[_0x28a3('0x5b')][_0x28a3('0x5c')](_0xc85db5[_0x28a3('0x5d')]));}})[_0x28a3('0x22')](function(_0x4500a2){if(_0x4500a2){if(!_['isNil'](_0x220104[_0x28a3('0x2f')]['ticketType'])){_0x2a63b9=_0x220104['query']['ticketType'];}return _0x477275['sobject'](_0x2a63b9)[_0x28a3('0x5e')]();}})[_0x28a3('0x22')](function(_0x1c95c3){var _0x2a475c=[_0x28a3('0x5f'),'ActivityDate',_0x28a3('0x60'),_0x28a3('0x61'),_0x28a3('0x62'),_0x28a3('0x63')];var _0x536fdf=['string',_0x28a3('0x64'),_0x28a3('0x65'),_0x28a3('0x66'),_0x28a3('0x67'),_0x28a3('0x68'),_0x28a3('0x69')];if(_0x1c95c3){_[_0x28a3('0x6a')](_0x1c95c3[_0x28a3('0x34')],function(_0x3cd481){return _0x2a475c[_0x28a3('0x6b')](_0x3cd481[_0x28a3('0x27')])||!_0x536fdf[_0x28a3('0x6b')](_0x3cd481[_0x28a3('0x2d')]);});return{'count':_0x1c95c3[_0x28a3('0x34')][_0x28a3('0x35')],'rows':_[_0x28a3('0x2a')](_0x1c95c3[_0x28a3('0x34')],function(_0x5e7b0c){return{'id':_0x5e7b0c['name'],'name':_0x5e7b0c['label'],'custom':_0x5e7b0c['custom'],'options':_0x5e7b0c['picklistValues']['length']>0x0?_[_0x28a3('0x2a')](_0x5e7b0c['picklistValues'],function(_0x164294){return{'name':_0x164294[_0x28a3('0x6c')],'value':_0x164294[_0x28a3('0x6d')]};}):_0x5e7b0c['type']=='boolean'?[{'name':_0x28a3('0x6e'),'value':_0x28a3('0x6f')},{'name':_0x28a3('0x70'),'value':_0x28a3('0x71')}]:[]};})};}})[_0x28a3('0x22')](respondWithResult(_0xd5d6e1,null))[_0x28a3('0x42')](function(_0x453647){var _0x5972fc=_0x220104[_0x28a3('0x2f')]['test']?0x1f4:_0x453647[_0x28a3('0x72')]||0x1f4;logger[_0x28a3('0x25')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x5972fc,JSON[_0x28a3('0x73')](_0x453647));delete _0x453647[_0x28a3('0x27')];if(_0x5972fc===0x191){_0x5972fc=0x190;}_0xd5d6e1[_0x28a3('0x18')](_0x5972fc)[_0x28a3('0x28')](_0x220104[_0x28a3('0x2f')]['test']?{'message':_0x28a3('0x74'),'statusCode':_0x453647[_0x28a3('0x72')]}:_0x453647);});}; \ No newline at end of file +var _0x6363=['includeAll','create','body','update','find','getConfigurations','findOne','SalesforceConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','SalesforceField','Descriptions','getFields','Task','remoteUri','clientId','clientSecret','username','password','securityToken','slice','substring','lastIndexOf','Connection','concat','isNil','ticketType','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','int','picklist','boolean','textarea','phone','remove','includes','custom','picklistValues','label','value','false','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','rimraf','fast-json-patch','request-promise','mustache','path','to-csv','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','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','destroy','then','stack','name','send','SalesforceAccount','fieldName','model','map','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','type','VIRTUAL','options','include','rows','catch','show','params','rawAttributes'];(function(_0x54ce6e,_0xb83da2){var _0x2d7739=function(_0x250e38){while(--_0x250e38){_0x54ce6e['push'](_0x54ce6e['shift']());}};_0x2d7739(++_0xb83da2);}(_0x6363,0xb2));var _0x3636=function(_0x53449f,_0x568c16){_0x53449f=_0x53449f-0x0;var _0x47d37c=_0x6363[_0x53449f];return _0x47d37c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3636('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3636('0x1'));var rp=require(_0x3636('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3636('0x3'));var util=require('util');var path=require(_0x3636('0x4'));var sox=require('sox');var csv=require(_0x3636('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3636('0x6'));var squel=require(_0x3636('0x7'));var crypto=require(_0x3636('0x8'));var jsforce=require(_0x3636('0x9'));var deskjs=require(_0x3636('0xa'));var toCsv=require('to-csv');var querystring=require(_0x3636('0xb'));var Papa=require(_0x3636('0xc'));var Redis=require(_0x3636('0xd'));var authService=require(_0x3636('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x3636('0xf'));var hardwareService=require(_0x3636('0x10'));var logger=require(_0x3636('0x11'))(_0x3636('0x12'));var utils=require(_0x3636('0x13'));var config=require(_0x3636('0x14'));var licenseUtil=require(_0x3636('0x15'));var db=require(_0x3636('0x16'))['db'];var integrations=require(_0x3636('0x17'));function respondWithStatusCode(_0x1cdd3b,_0x260e61){_0x260e61=_0x260e61||0xcc;return function(_0x9b4720){if(_0x9b4720){return _0x1cdd3b[_0x3636('0x18')](_0x260e61);}return _0x1cdd3b[_0x3636('0x19')](_0x260e61)[_0x3636('0x1a')]();};}function respondWithResult(_0x16fc4b,_0x83c38f){_0x83c38f=_0x83c38f||0xc8;return function(_0x5e331a){if(_0x5e331a){return _0x16fc4b[_0x3636('0x19')](_0x83c38f)[_0x3636('0x1b')](_0x5e331a);}};}function respondWithFilteredResult(_0x5d6bd9,_0x1b7bdd){return function(_0x1cc530){if(_0x1cc530){var _0x296871=typeof _0x1b7bdd['offset']===_0x3636('0x1c')&&typeof _0x1b7bdd[_0x3636('0x1d')]===_0x3636('0x1c');var _0x4de3a1=_0x1cc530[_0x3636('0x1e')];var _0x520a54=_0x296871?0x0:_0x1b7bdd[_0x3636('0x1f')];var _0x568a96=_0x296871?_0x1cc530[_0x3636('0x1e')]:_0x1b7bdd[_0x3636('0x1f')]+_0x1b7bdd['limit'];var _0x32f94a;if(_0x568a96>=_0x4de3a1){_0x568a96=_0x4de3a1;_0x32f94a=0xc8;}else{_0x32f94a=0xce;}_0x5d6bd9['status'](_0x32f94a);return _0x5d6bd9[_0x3636('0x20')](_0x3636('0x21'),_0x520a54+'-'+_0x568a96+'/'+_0x4de3a1)['json'](_0x1cc530);}return null;};}function patchUpdates(_0x31ef87){return function(_0x4a612b){try{jsonpatch[_0x3636('0x22')](_0x4a612b,_0x31ef87,!![]);}catch(_0x40bcb6){return BPromise[_0x3636('0x23')](_0x40bcb6);}return _0x4a612b[_0x3636('0x24')]();};}function saveUpdates(_0x1a7a94,_0x2d8b58){return function(_0x4d3ebd){if(_0x4d3ebd){return _0x4d3ebd['update'](_0x1a7a94)['then'](function(_0x16c9a6){return _0x16c9a6;});}return null;};}function removeEntity(_0x3ae82a,_0x4fd500){return function(_0x4869cd){if(_0x4869cd){return _0x4869cd[_0x3636('0x25')]()[_0x3636('0x26')](function(){_0x3ae82a['status'](0xcc)[_0x3636('0x1a')]();});}};}function handleEntityNotFound(_0x2a490b,_0x56aed1){return function(_0x4a1eae){if(!_0x4a1eae){_0x2a490b['sendStatus'](0x194);}return _0x4a1eae;};}function handleError(_0x2a4518,_0x311c75){_0x311c75=_0x311c75||0x1f4;return function(_0x1e0af7){logger['error'](_0x1e0af7[_0x3636('0x27')]);if(_0x1e0af7[_0x3636('0x28')]){delete _0x1e0af7[_0x3636('0x28')];}_0x2a4518[_0x3636('0x19')](_0x311c75)[_0x3636('0x29')](_0x1e0af7);};}exports['index']=function(_0x4347d3,_0x2d8b5f){var _0x3f802c={},_0x1aeb17={},_0x51a1c0={'count':0x0,'rows':[]};var _0x449895=_['map'](db[_0x3636('0x2a')]['rawAttributes'],function(_0x174d91){return{'name':_0x174d91[_0x3636('0x2b')],'type':_0x174d91['type']['key']};});_0x1aeb17[_0x3636('0x2c')]=_[_0x3636('0x2d')](_0x449895,_0x3636('0x28'));_0x1aeb17['query']=_[_0x3636('0x2e')](_0x4347d3[_0x3636('0x2f')]);_0x1aeb17['filters']=_[_0x3636('0x30')](_0x1aeb17[_0x3636('0x2c')],_0x1aeb17['query']);_0x3f802c[_0x3636('0x31')]=_['intersection'](_0x1aeb17['model'],qs[_0x3636('0x32')](_0x4347d3[_0x3636('0x2f')]['fields']));_0x3f802c['attributes']=_0x3f802c[_0x3636('0x31')][_0x3636('0x33')]?_0x3f802c[_0x3636('0x31')]:_0x1aeb17['model'];if(!_0x4347d3[_0x3636('0x2f')][_0x3636('0x34')](_0x3636('0x35'))){_0x3f802c[_0x3636('0x1d')]=qs[_0x3636('0x1d')](_0x4347d3[_0x3636('0x2f')]['limit']);_0x3f802c[_0x3636('0x1f')]=qs[_0x3636('0x1f')](_0x4347d3[_0x3636('0x2f')]['offset']);}_0x3f802c[_0x3636('0x36')]=qs[_0x3636('0x37')](_0x4347d3[_0x3636('0x2f')][_0x3636('0x37')]);_0x3f802c[_0x3636('0x38')]=qs['filters'](_[_0x3636('0x39')](_0x4347d3[_0x3636('0x2f')],_0x1aeb17[_0x3636('0x3a')]),_0x449895);if(_0x4347d3[_0x3636('0x2f')][_0x3636('0x3b')]){_0x3f802c[_0x3636('0x38')]=_[_0x3636('0x3c')](_0x3f802c[_0x3636('0x38')],{'$or':_['map'](_0x449895,function(_0x109205){if(_0x109205[_0x3636('0x3d')]!==_0x3636('0x3e')){var _0x57006a={};_0x57006a[_0x109205[_0x3636('0x28')]]={'$like':'%'+_0x4347d3[_0x3636('0x2f')]['filter']+'%'};return _0x57006a;}})});}_0x3f802c=_['merge']({},_0x3f802c,_0x4347d3[_0x3636('0x3f')]);var _0x34fecd={'where':_0x3f802c[_0x3636('0x38')]};return db['SalesforceAccount'][_0x3636('0x1e')](_0x34fecd)[_0x3636('0x26')](function(_0xf28026){_0x51a1c0[_0x3636('0x1e')]=_0xf28026;if(_0x4347d3[_0x3636('0x2f')]['includeAll']){_0x3f802c[_0x3636('0x40')]=[{'all':!![]}];}return db[_0x3636('0x2a')]['findAll'](_0x3f802c);})[_0x3636('0x26')](function(_0x5ea8c5){_0x51a1c0[_0x3636('0x41')]=_0x5ea8c5;return _0x51a1c0;})[_0x3636('0x26')](respondWithFilteredResult(_0x2d8b5f,_0x3f802c))[_0x3636('0x42')](handleError(_0x2d8b5f,null));};exports[_0x3636('0x43')]=function(_0x14408a,_0x23dd49){var _0x53490f={'raw':![],'where':{'id':_0x14408a[_0x3636('0x44')]['id']}},_0x537819={};_0x537819[_0x3636('0x2c')]=_[_0x3636('0x2e')](db[_0x3636('0x2a')][_0x3636('0x45')]);_0x537819[_0x3636('0x2f')]=_[_0x3636('0x2e')](_0x14408a['query']);_0x537819[_0x3636('0x3a')]=_[_0x3636('0x30')](_0x537819['model'],_0x537819[_0x3636('0x2f')]);_0x53490f['attributes']=_['intersection'](_0x537819[_0x3636('0x2c')],qs['fields'](_0x14408a[_0x3636('0x2f')]['fields']));_0x53490f[_0x3636('0x31')]=_0x53490f[_0x3636('0x31')][_0x3636('0x33')]?_0x53490f[_0x3636('0x31')]:_0x537819[_0x3636('0x2c')];if(_0x14408a[_0x3636('0x2f')][_0x3636('0x46')]){_0x53490f[_0x3636('0x40')]=[{'all':!![]}];}_0x53490f=_['merge']({},_0x53490f,_0x14408a[_0x3636('0x3f')]);return db['SalesforceAccount']['find'](_0x53490f)[_0x3636('0x26')](handleEntityNotFound(_0x23dd49,null))[_0x3636('0x26')](respondWithResult(_0x23dd49,null))[_0x3636('0x42')](handleError(_0x23dd49,null));};exports[_0x3636('0x47')]=function(_0x286aea,_0x56c74b){return db[_0x3636('0x2a')][_0x3636('0x47')](_0x286aea[_0x3636('0x48')],{})[_0x3636('0x26')](respondWithResult(_0x56c74b,0xc9))[_0x3636('0x42')](handleError(_0x56c74b,null));};exports[_0x3636('0x49')]=function(_0x21ed58,_0x5e16d1){if(_0x21ed58[_0x3636('0x48')]['id']){delete _0x21ed58[_0x3636('0x48')]['id'];}return db[_0x3636('0x2a')]['find']({'where':{'id':_0x21ed58[_0x3636('0x44')]['id']}})[_0x3636('0x26')](handleEntityNotFound(_0x5e16d1,null))[_0x3636('0x26')](saveUpdates(_0x21ed58[_0x3636('0x48')],null))['then'](respondWithResult(_0x5e16d1,null))[_0x3636('0x42')](handleError(_0x5e16d1,null));};exports[_0x3636('0x25')]=function(_0x406859,_0x4c04ae){return db[_0x3636('0x2a')][_0x3636('0x4a')]({'where':{'id':_0x406859['params']['id']}})['then'](handleEntityNotFound(_0x4c04ae,null))[_0x3636('0x26')](removeEntity(_0x4c04ae,null))['catch'](handleError(_0x4c04ae,null));};exports[_0x3636('0x4b')]=function(_0x53de5f,_0x1d74a0,_0x4e6709){var _0x43ef44={};var _0x42e8a3={};var _0x58bb2a;var _0x50db63;return db['SalesforceAccount'][_0x3636('0x4c')]({'where':{'id':_0x53de5f[_0x3636('0x44')]['id']}})[_0x3636('0x26')](handleEntityNotFound(_0x1d74a0,null))[_0x3636('0x26')](function(_0x2b0b8c){if(_0x2b0b8c){_0x58bb2a=_0x2b0b8c;_0x42e8a3[_0x3636('0x2c')]=_[_0x3636('0x2e')](db[_0x3636('0x4d')][_0x3636('0x45')]);_0x42e8a3[_0x3636('0x2f')]=_[_0x3636('0x2e')](_0x53de5f[_0x3636('0x2f')]);_0x42e8a3[_0x3636('0x3a')]=_[_0x3636('0x30')](_0x42e8a3['model'],_0x42e8a3[_0x3636('0x2f')]);_0x43ef44[_0x3636('0x31')]=_[_0x3636('0x30')](_0x42e8a3['model'],qs[_0x3636('0x32')](_0x53de5f['query']['fields']));_0x43ef44[_0x3636('0x31')]=_0x43ef44['attributes']['length']?_0x43ef44['attributes']:_0x42e8a3[_0x3636('0x2c')];_0x43ef44[_0x3636('0x36')]=qs[_0x3636('0x37')](_0x53de5f['query']['sort']);_0x43ef44[_0x3636('0x38')]=qs[_0x3636('0x3a')](_[_0x3636('0x39')](_0x53de5f[_0x3636('0x2f')],_0x42e8a3[_0x3636('0x3a')]));if(_0x53de5f[_0x3636('0x2f')][_0x3636('0x3b')]){_0x43ef44[_0x3636('0x38')]=_[_0x3636('0x3c')](_0x43ef44['where'],{'$or':_['map'](_0x43ef44[_0x3636('0x31')],function(_0x4c8004){var _0x2f28bb={};_0x2f28bb[_0x4c8004]={'$like':'%'+_0x53de5f[_0x3636('0x2f')][_0x3636('0x3b')]+'%'};return _0x2f28bb;})});}_0x43ef44=_[_0x3636('0x3c')]({},_0x43ef44,_0x53de5f[_0x3636('0x3f')]);return _0x58bb2a[_0x3636('0x4b')](_0x43ef44);}})['then'](function(_0xae696){if(_0xae696){_0x50db63=_0xae696[_0x3636('0x33')];if(!_0x53de5f[_0x3636('0x2f')][_0x3636('0x34')](_0x3636('0x35'))){_0x43ef44[_0x3636('0x1d')]=qs[_0x3636('0x1d')](_0x53de5f[_0x3636('0x2f')]['limit']);_0x43ef44[_0x3636('0x1f')]=qs[_0x3636('0x1f')](_0x53de5f[_0x3636('0x2f')]['offset']);}return _0x58bb2a[_0x3636('0x4b')](_0x43ef44);}})[_0x3636('0x26')](function(_0x26f6a8){if(_0x26f6a8){return _0x26f6a8?{'count':_0x50db63,'rows':_0x26f6a8}:null;}})[_0x3636('0x26')](respondWithResult(_0x1d74a0,null))[_0x3636('0x42')](handleError(_0x1d74a0,null));};exports[_0x3636('0x4e')]=function(_0x286f04,_0x3de4af,_0x1040e4){if(_0x286f04[_0x3636('0x48')]['id']){delete _0x286f04[_0x3636('0x48')]['id'];}return db[_0x3636('0x2a')][_0x3636('0x4c')]({'where':{'id':_0x286f04['params']['id']}})[_0x3636('0x26')](handleEntityNotFound(_0x3de4af,null))[_0x3636('0x26')](function(_0x4a0dde){if(_0x4a0dde){_0x286f04[_0x3636('0x48')][_0x3636('0x4f')]=_0x4a0dde['id'];_0x286f04[_0x3636('0x48')][_0x3636('0x50')]=integrations[_0x3636('0x51')](_0x286f04[_0x3636('0x48')][_0x3636('0x52')],_0x286f04[_0x3636('0x48')][_0x3636('0x3d')]);_0x286f04[_0x3636('0x48')]['Descriptions']=integrations[_0x3636('0x53')](_0x286f04['body'][_0x3636('0x52')],_0x286f04[_0x3636('0x48')]['type']);return db[_0x3636('0x4d')][_0x3636('0x47')](_0x286f04[_0x3636('0x48')],{'include':[{'model':db[_0x3636('0x54')],'as':_0x3636('0x50')},{'model':db[_0x3636('0x54')],'as':_0x3636('0x55')}]});}return null;})[_0x3636('0x26')](respondWithResult(_0x3de4af,null))[_0x3636('0x42')](handleError(_0x3de4af,null));};exports[_0x3636('0x56')]=function(_0x4a45b1,_0x1e3a64,_0x1a37cd){var _0x35a5e9;var _0x3c89ca='';var _0x3c8fbd=_0x3636('0x57');return db[_0x3636('0x2a')][_0x3636('0x4c')]({'where':{'id':_0x4a45b1[_0x3636('0x44')]['id']},'attributes':['id',_0x3636('0x58'),_0x3636('0x59'),_0x3636('0x5a'),_0x3636('0x5b'),_0x3636('0x5c'),_0x3636('0x5d')]})[_0x3636('0x26')](handleEntityNotFound(_0x1e3a64,null))[_0x3636('0x26')](function(_0x33500e){if(_0x33500e){_0x3c89ca=_0x33500e[_0x3636('0x58')];var _0x65042b=_0x3c89ca[_0x3636('0x5e')](-0x1);if(_0x65042b==='/'){_0x3c89ca=_0x3c89ca[_0x3636('0x5f')](0x0,_0x3c89ca[_0x3636('0x60')](_0x65042b));}_0x35a5e9=new jsforce[(_0x3636('0x61'))]({'oauth2':{'loginUrl':_0x3c89ca,'clientId':_0x33500e['clientId'],'clientSecret':_0x33500e[_0x3636('0x5a')]}});return _0x35a5e9['login'](_0x33500e[_0x3636('0x5b')],_0x33500e[_0x3636('0x5c')][_0x3636('0x62')](_0x33500e[_0x3636('0x5d')]));}})[_0x3636('0x26')](function(_0x5c7230){if(_0x5c7230){if(!_[_0x3636('0x63')](_0x4a45b1[_0x3636('0x2f')][_0x3636('0x64')])){_0x3c8fbd=_0x4a45b1['query'][_0x3636('0x64')];}return _0x35a5e9['sobject'](_0x3c8fbd)[_0x3636('0x65')]();}})[_0x3636('0x26')](function(_0x53da1b){var _0x1ac329=[_0x3636('0x66'),_0x3636('0x67'),_0x3636('0x68'),_0x3636('0x69'),_0x3636('0x6a'),'Description'];var _0x27243d=['string',_0x3636('0x6b'),_0x3636('0x6c'),_0x3636('0x6d'),'email',_0x3636('0x6e'),_0x3636('0x6f')];if(_0x53da1b){_[_0x3636('0x70')](_0x53da1b[_0x3636('0x32')],function(_0xf48240){return _0x1ac329[_0x3636('0x71')](_0xf48240[_0x3636('0x28')])||!_0x27243d[_0x3636('0x71')](_0xf48240[_0x3636('0x3d')]);});return{'count':_0x53da1b[_0x3636('0x32')][_0x3636('0x33')],'rows':_[_0x3636('0x2d')](_0x53da1b[_0x3636('0x32')],function(_0x2561b9){return{'id':_0x2561b9[_0x3636('0x28')],'name':_0x2561b9['label'],'custom':_0x2561b9[_0x3636('0x72')],'options':_0x2561b9['picklistValues'][_0x3636('0x33')]>0x0?_[_0x3636('0x2d')](_0x2561b9[_0x3636('0x73')],function(_0x48dec6){return{'name':_0x48dec6[_0x3636('0x74')],'value':_0x48dec6[_0x3636('0x75')]};}):_0x2561b9[_0x3636('0x3d')]=='boolean'?[{'name':'True','value':'true'},{'name':'False','value':_0x3636('0x76')}]:[]};})};}})[_0x3636('0x26')](respondWithResult(_0x1e3a64,null))[_0x3636('0x42')](function(_0x484e80){var _0x282bbf=_0x4a45b1[_0x3636('0x2f')][_0x3636('0x77')]?0x1f4:_0x484e80[_0x3636('0x78')]||0x1f4;logger[_0x3636('0x79')](_0x3636('0x7a'),_0x3636('0x56'),_0x282bbf,JSON[_0x3636('0x7b')](_0x484e80));delete _0x484e80['name'];if(_0x282bbf===0x191){_0x282bbf=0x190;}_0x1e3a64['status'](_0x282bbf)[_0x3636('0x29')](_0x4a45b1[_0x3636('0x2f')][_0x3636('0x77')]?{'message':'Wrong\x20credentials','statusCode':_0x484e80[_0x3636('0x78')]}:_0x484e80);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index aa577fb..c9804c1 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 _0x32d3=['request-promise','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','define','SalesforceAccount','int_salesforce_accounts','lodash','util','api','moment','bluebird'];(function(_0x359f82,_0x4ce668){var _0x37dd95=function(_0x4da2cf){while(--_0x4da2cf){_0x359f82['push'](_0x359f82['shift']());}};_0x37dd95(++_0x4ce668);}(_0x32d3,0xbf));var _0x332d=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x32d3[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x332d('0x0'));var util=require(_0x332d('0x1'));var logger=require('../../config/logger')(_0x332d('0x2'));var moment=require(_0x332d('0x3'));var BPromise=require(_0x332d('0x4'));var rp=require(_0x332d('0x5'));var fs=require('fs');var path=require(_0x332d('0x6'));var rimraf=require(_0x332d('0x7'));var config=require(_0x332d('0x8'));var attributes=require(_0x332d('0x9'));var integrations=require(_0x332d('0xa'));module['exports']=function(_0x36ca9e,_0x554d84){return _0x36ca9e[_0x332d('0xb')](_0x332d('0xc'),attributes,{'tableName':_0x332d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc35b=['int_salesforce_accounts','util','../../config/logger','moment','rimraf','../../config/environment','exports','define','SalesforceAccount'];(function(_0x41e213,_0xfe1dc6){var _0x8a527b=function(_0x4d64bd){while(--_0x4d64bd){_0x41e213['push'](_0x41e213['shift']());}};_0x8a527b(++_0xfe1dc6);}(_0xc35b,0xa3));var _0xbc35=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xc35b[_0x56482c];return _0x5aae7a;};'use strict';var _=require('lodash');var util=require(_0xbc35('0x0'));var logger=require(_0xbc35('0x1'))('api');var moment=require(_0xbc35('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xbc35('0x3'));var config=require(_0xbc35('0x4'));var attributes=require('./intSalesforceAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0xbc35('0x5')]=function(_0x1acf44,_0x2db8fd){return _0x1acf44[_0xbc35('0x6')](_0xbc35('0x7'),attributes,{'tableName':_0xbc35('0x8'),'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 9d23e20..d9c65c1 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 _0xb7f1=['catch','SalesforceAccount','findAll','options','raw','where','limit','include','map','model','attributes','GetSalesforceAccount','ShowSalesforceAccount','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','SalesforceAccount,\x20%s,\x20%s','message','result'];(function(_0x270978,_0x196912){var _0x44dc59=function(_0x15a68f){while(--_0x15a68f){_0x270978['push'](_0x270978['shift']());}};_0x44dc59(++_0x196912);}(_0xb7f1,0xc1));var _0x1b7f=function(_0x1c8392,_0x2f531a){_0x1c8392=_0x1c8392-0x0;var _0x123902=_0xb7f1[_0x1c8392];return _0x123902;};'use strict';var _=require('lodash');var util=require(_0x1b7f('0x0'));var moment=require(_0x1b7f('0x1'));var BPromise=require(_0x1b7f('0x2'));var rs=require(_0x1b7f('0x3'));var fs=require('fs');var Redis=require(_0x1b7f('0x4'));var db=require(_0x1b7f('0x5'))['db'];var utils=require(_0x1b7f('0x6'));var logger=require('../../config/logger')(_0x1b7f('0x7'));var config=require(_0x1b7f('0x8'));var jayson=require(_0x1b7f('0x9'));var client=jayson[_0x1b7f('0xa')][_0x1b7f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x14241a,_0x45ac2b,_0x4248c3){return new BPromise(function(_0xd90f10,_0x548c3a){return client[_0x1b7f('0xc')](_0x14241a,_0x4248c3)[_0x1b7f('0xd')](function(_0x1e2413){logger[_0x1b7f('0xe')]('SalesforceAccount,\x20%s,\x20%s',_0x45ac2b,_0x1b7f('0xf'));logger[_0x1b7f('0x10')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x45ac2b,'request\x20sent',JSON[_0x1b7f('0x11')](_0x1e2413));if(_0x1e2413[_0x1b7f('0x12')]){if(_0x1e2413[_0x1b7f('0x12')][_0x1b7f('0x13')]===0x1f4){logger[_0x1b7f('0x12')](_0x1b7f('0x14'),_0x45ac2b,_0x1e2413[_0x1b7f('0x12')]['message']);return _0x548c3a(_0x1e2413[_0x1b7f('0x12')][_0x1b7f('0x15')]);}logger[_0x1b7f('0x12')]('SalesforceAccount,\x20%s,\x20%s',_0x45ac2b,_0x1e2413[_0x1b7f('0x12')]['message']);return _0xd90f10(_0x1e2413[_0x1b7f('0x12')]['message']);}else{logger[_0x1b7f('0xe')](_0x1b7f('0x14'),_0x45ac2b,'request\x20sent');_0xd90f10(_0x1e2413[_0x1b7f('0x16')][_0x1b7f('0x15')]);}})[_0x1b7f('0x17')](function(_0x5bb74f){logger['error'](_0x1b7f('0x14'),_0x45ac2b,_0x5bb74f);_0x548c3a(_0x5bb74f);});});}exports['GetSalesforceAccount']=function(_0x284209){var _0x467aa7=this;return new Promise(function(_0x307329,_0x572599){return db[_0x1b7f('0x18')][_0x1b7f('0x19')]({'raw':_0x284209[_0x1b7f('0x1a')]?_0x284209[_0x1b7f('0x1a')][_0x1b7f('0x1b')]===undefined?!![]:![]:!![],'where':_0x284209['options']?_0x284209[_0x1b7f('0x1a')][_0x1b7f('0x1c')]||null:null,'attributes':_0x284209[_0x1b7f('0x1a')]?_0x284209['options']['attributes']||null:null,'limit':_0x284209[_0x1b7f('0x1a')]?_0x284209[_0x1b7f('0x1a')][_0x1b7f('0x1d')]||null:null,'include':_0x284209['options']?_0x284209[_0x1b7f('0x1a')][_0x1b7f('0x1e')]?_[_0x1b7f('0x1f')](_0x284209[_0x1b7f('0x1a')]['include'],function(_0xf87853){return{'model':db[_0xf87853[_0x1b7f('0x20')]],'as':_0xf87853['as'],'attributes':_0xf87853[_0x1b7f('0x21')],'include':_0xf87853[_0x1b7f('0x1e')]?_[_0x1b7f('0x1f')](_0xf87853['include'],function(_0x5d73c5){return{'model':db[_0x5d73c5['model']],'as':_0x5d73c5['as'],'attributes':_0x5d73c5[_0x1b7f('0x21')],'include':_0x5d73c5['include']?_[_0x1b7f('0x1f')](_0x5d73c5[_0x1b7f('0x1e')],function(_0x4bf802){return{'model':db[_0x4bf802[_0x1b7f('0x20')]],'as':_0x4bf802['as'],'attributes':_0x4bf802['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5bf39d){logger['info'](_0x1b7f('0x22'),_0x284209);logger['debug'](_0x1b7f('0x22'),_0x284209,JSON['stringify'](_0x5bf39d));_0x307329(_0x5bf39d);})['catch'](function(_0x1f242d){logger[_0x1b7f('0x12')](_0x1b7f('0x22'),_0x1f242d['message'],_0x284209);_0x572599(_0x467aa7[_0x1b7f('0x12')](0x1f4,_0x1f242d[_0x1b7f('0x15')]));});});};exports[_0x1b7f('0x23')]=function(_0x53b68f){var _0x3ac18b=this;return new Promise(function(_0x49542b,_0x205251){return db[_0x1b7f('0x18')]['find']({'raw':_0x53b68f[_0x1b7f('0x1a')]?_0x53b68f['options'][_0x1b7f('0x1b')]===undefined?!![]:![]:!![],'where':_0x53b68f[_0x1b7f('0x1a')]?_0x53b68f['options'][_0x1b7f('0x1c')]||null:null,'attributes':_0x53b68f['options']?_0x53b68f[_0x1b7f('0x1a')][_0x1b7f('0x21')]||null:null,'include':_0x53b68f[_0x1b7f('0x1a')]?_0x53b68f['options'][_0x1b7f('0x1e')]?_[_0x1b7f('0x1f')](_0x53b68f[_0x1b7f('0x1a')]['include'],function(_0xa15f3a){return{'model':db[_0xa15f3a[_0x1b7f('0x20')]],'as':_0xa15f3a['as'],'attributes':_0xa15f3a[_0x1b7f('0x21')],'include':_0xa15f3a[_0x1b7f('0x1e')]?_[_0x1b7f('0x1f')](_0xa15f3a['include'],function(_0x4897c9){return{'model':db[_0x4897c9[_0x1b7f('0x20')]],'as':_0x4897c9['as'],'attributes':_0x4897c9[_0x1b7f('0x21')],'include':_0x4897c9['include']?_[_0x1b7f('0x1f')](_0x4897c9[_0x1b7f('0x1e')],function(_0x38d227){return{'model':db[_0x38d227['model']],'as':_0x38d227['as'],'attributes':_0x38d227['attributes']};}):[]};}):[]};}):[]:[]})[_0x1b7f('0xd')](function(_0x511b19){logger[_0x1b7f('0xe')](_0x1b7f('0x23'),_0x53b68f);logger[_0x1b7f('0x10')](_0x1b7f('0x23'),_0x53b68f,JSON[_0x1b7f('0x11')](_0x511b19));_0x49542b(_0x511b19);})[_0x1b7f('0x17')](function(_0x402125){logger[_0x1b7f('0x12')](_0x1b7f('0x23'),_0x402125['message'],_0x53b68f);_0x205251(_0x3ac18b[_0x1b7f('0x12')](0x1f4,_0x402125[_0x1b7f('0x15')]));});});}; \ No newline at end of file +var _0x70ef=['find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SalesforceAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','catch','SalesforceAccount','findAll','options','raw','where','attributes','limit','include','map','model','GetSalesforceAccount','ShowSalesforceAccount'];(function(_0x37d522,_0x5dc2fe){var _0x155013=function(_0x2e3c4d){while(--_0x2e3c4d){_0x37d522['push'](_0x37d522['shift']());}};_0x155013(++_0x5dc2fe);}(_0x70ef,0x6a));var _0xf70e=function(_0x3d6df8,_0x5a096b){_0x3d6df8=_0x3d6df8-0x0;var _0x20ed7a=_0x70ef[_0x3d6df8];return _0x20ed7a;};'use strict';var _=require(_0xf70e('0x0'));var util=require(_0xf70e('0x1'));var moment=require(_0xf70e('0x2'));var BPromise=require(_0xf70e('0x3'));var rs=require(_0xf70e('0x4'));var fs=require('fs');var Redis=require(_0xf70e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf70e('0x6'));var logger=require(_0xf70e('0x7'))(_0xf70e('0x8'));var config=require(_0xf70e('0x9'));var jayson=require(_0xf70e('0xa'));var client=jayson[_0xf70e('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x23136c,_0x216834,_0x2be5e3){return new BPromise(function(_0x468396,_0x158d20){return client[_0xf70e('0xc')](_0x23136c,_0x2be5e3)[_0xf70e('0xd')](function(_0xd5f7f1){logger[_0xf70e('0xe')](_0xf70e('0xf'),_0x216834,'request\x20sent');logger[_0xf70e('0x10')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x216834,_0xf70e('0x11'),JSON[_0xf70e('0x12')](_0xd5f7f1));if(_0xd5f7f1[_0xf70e('0x13')]){if(_0xd5f7f1[_0xf70e('0x13')]['code']===0x1f4){logger['error'](_0xf70e('0xf'),_0x216834,_0xd5f7f1['error'][_0xf70e('0x14')]);return _0x158d20(_0xd5f7f1['error'][_0xf70e('0x14')]);}logger[_0xf70e('0x13')]('SalesforceAccount,\x20%s,\x20%s',_0x216834,_0xd5f7f1['error']['message']);return _0x468396(_0xd5f7f1[_0xf70e('0x13')][_0xf70e('0x14')]);}else{logger[_0xf70e('0xe')](_0xf70e('0xf'),_0x216834,'request\x20sent');_0x468396(_0xd5f7f1['result'][_0xf70e('0x14')]);}})[_0xf70e('0x15')](function(_0x45ef94){logger[_0xf70e('0x13')]('SalesforceAccount,\x20%s,\x20%s',_0x216834,_0x45ef94);_0x158d20(_0x45ef94);});});}exports['GetSalesforceAccount']=function(_0x578da0){var _0x48c5c9=this;return new Promise(function(_0x305d9b,_0x2959ac){return db[_0xf70e('0x16')][_0xf70e('0x17')]({'raw':_0x578da0[_0xf70e('0x18')]?_0x578da0[_0xf70e('0x18')][_0xf70e('0x19')]===undefined?!![]:![]:!![],'where':_0x578da0['options']?_0x578da0[_0xf70e('0x18')][_0xf70e('0x1a')]||null:null,'attributes':_0x578da0[_0xf70e('0x18')]?_0x578da0[_0xf70e('0x18')][_0xf70e('0x1b')]||null:null,'limit':_0x578da0[_0xf70e('0x18')]?_0x578da0['options'][_0xf70e('0x1c')]||null:null,'include':_0x578da0[_0xf70e('0x18')]?_0x578da0[_0xf70e('0x18')][_0xf70e('0x1d')]?_[_0xf70e('0x1e')](_0x578da0[_0xf70e('0x18')][_0xf70e('0x1d')],function(_0x20dd73){return{'model':db[_0x20dd73['model']],'as':_0x20dd73['as'],'attributes':_0x20dd73[_0xf70e('0x1b')],'include':_0x20dd73[_0xf70e('0x1d')]?_[_0xf70e('0x1e')](_0x20dd73['include'],function(_0x4ad9da){return{'model':db[_0x4ad9da[_0xf70e('0x1f')]],'as':_0x4ad9da['as'],'attributes':_0x4ad9da['attributes'],'include':_0x4ad9da[_0xf70e('0x1d')]?_[_0xf70e('0x1e')](_0x4ad9da[_0xf70e('0x1d')],function(_0x5c1532){return{'model':db[_0x5c1532[_0xf70e('0x1f')]],'as':_0x5c1532['as'],'attributes':_0x5c1532[_0xf70e('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xf70e('0xd')](function(_0x5ec6d7){logger['info']('GetSalesforceAccount',_0x578da0);logger['debug'](_0xf70e('0x20'),_0x578da0,JSON['stringify'](_0x5ec6d7));_0x305d9b(_0x5ec6d7);})[_0xf70e('0x15')](function(_0x2be729){logger['error']('GetSalesforceAccount',_0x2be729[_0xf70e('0x14')],_0x578da0);_0x2959ac(_0x48c5c9[_0xf70e('0x13')](0x1f4,_0x2be729[_0xf70e('0x14')]));});});};exports[_0xf70e('0x21')]=function(_0x1f4af8){var _0x28250b=this;return new Promise(function(_0x1b37da,_0x42e016){return db[_0xf70e('0x16')][_0xf70e('0x22')]({'raw':_0x1f4af8[_0xf70e('0x18')]?_0x1f4af8[_0xf70e('0x18')][_0xf70e('0x19')]===undefined?!![]:![]:!![],'where':_0x1f4af8['options']?_0x1f4af8['options'][_0xf70e('0x1a')]||null:null,'attributes':_0x1f4af8[_0xf70e('0x18')]?_0x1f4af8[_0xf70e('0x18')][_0xf70e('0x1b')]||null:null,'include':_0x1f4af8['options']?_0x1f4af8[_0xf70e('0x18')]['include']?_[_0xf70e('0x1e')](_0x1f4af8[_0xf70e('0x18')][_0xf70e('0x1d')],function(_0x3d25d0){return{'model':db[_0x3d25d0[_0xf70e('0x1f')]],'as':_0x3d25d0['as'],'attributes':_0x3d25d0[_0xf70e('0x1b')],'include':_0x3d25d0[_0xf70e('0x1d')]?_[_0xf70e('0x1e')](_0x3d25d0['include'],function(_0x7577a7){return{'model':db[_0x7577a7[_0xf70e('0x1f')]],'as':_0x7577a7['as'],'attributes':_0x7577a7[_0xf70e('0x1b')],'include':_0x7577a7[_0xf70e('0x1d')]?_[_0xf70e('0x1e')](_0x7577a7[_0xf70e('0x1d')],function(_0xab1b5){return{'model':db[_0xab1b5[_0xf70e('0x1f')]],'as':_0xab1b5['as'],'attributes':_0xab1b5['attributes']};}):[]};}):[]};}):[]:[]})[_0xf70e('0xd')](function(_0x534027){logger[_0xf70e('0xe')](_0xf70e('0x21'),_0x1f4af8);logger[_0xf70e('0x10')](_0xf70e('0x21'),_0x1f4af8,JSON[_0xf70e('0x12')](_0x534027));_0x1b37da(_0x534027);})[_0xf70e('0x15')](function(_0x265e15){logger[_0xf70e('0x13')](_0xf70e('0x21'),_0x265e15['message'],_0x1f4af8);_0x42e016(_0x28250b['error'](0x1f4,_0x265e15['message']));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 2abdcc8..79be772 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 _0x5f2f=['Router','fs-extra','../../components/auth/service','./intSalesforceConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','create','put','update','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x19f453,_0x13b9b7){var _0x301689=function(_0x8636c6){while(--_0x8636c6){_0x19f453['push'](_0x19f453['shift']());}};_0x301689(++_0x13b9b7);}(_0x5f2f,0x73));var _0xf5f2=function(_0xd03fff,_0x1c14ce){_0xd03fff=_0xd03fff-0x0;var _0x1ac5f8=_0x5f2f[_0xd03fff];return _0x1ac5f8;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x9')](_0xf5f2('0x10'),auth['isAuthenticated'](),controller[_0xf5f2('0x11')]);router['get']('/:id/descriptions',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x12')]);router['post']('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x13')]);router[_0xf5f2('0x14')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x15')]);router['delete'](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x16')]);module[_0xf5f2('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(_0x57bda6,_0x3571e1){var _0x5221e3=function(_0x156ac0){while(--_0x156ac0){_0x57bda6['push'](_0x57bda6['shift']());}};_0x5221e3(++_0x3571e1);}(_0x7a54,0x106));var _0x47a5=function(_0x5dfa5c,_0x9f2938){_0x5dfa5c=_0x5dfa5c-0x0;var _0x6ef11f=_0x7a54[_0x5dfa5c];return _0x6ef11f;};'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 42795eb..4b603bd 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 _0x745d=['account','nothing','exports','STRING','Task','ENUM','contact','lead','account_contact_lead'];(function(_0x132411,_0x332904){var _0x4560b5=function(_0x312437){while(--_0x312437){_0x132411['push'](_0x132411['shift']());}};_0x4560b5(++_0x332904);}(_0x745d,0xa4));var _0xd745=function(_0x14e654,_0x216bf7){_0x14e654=_0x14e654-0x0;var _0x268809=_0x745d[_0x14e654];return _0x268809;};'use strict';var Sequelize=require('sequelize');module[_0xd745('0x0')]={'name':{'type':Sequelize[_0xd745('0x1')]},'description':{'type':Sequelize[_0xd745('0x1')]},'ticketType':{'type':Sequelize['ENUM'](_0xd745('0x2'),'Case'),'defaultValue':_0xd745('0x2')},'moduleSearch':{'type':Sequelize[_0xd745('0x3')]('contact_lead',_0xd745('0x4'),_0xd745('0x5'),_0xd745('0x6'),_0xd745('0x7')),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize[_0xd745('0x3')](_0xd745('0x8'),_0xd745('0x4'),_0xd745('0x5'),_0xd745('0x7')),'defaultValue':_0xd745('0x5')},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize[_0xd745('0x1')]},'additionalSearchContact':{'type':Sequelize[_0xd745('0x1')]},'additionalSearchLead':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7162=['STRING','ENUM','Task','Case','contact_lead','lead','account_contact_lead','account','nothing','contact','sequelize','exports'];(function(_0x1d211b,_0x475f3b){var _0x47c88b=function(_0x3126f5){while(--_0x3126f5){_0x1d211b['push'](_0x1d211b['shift']());}};_0x47c88b(++_0x475f3b);}(_0x7162,0xe2));var _0x2716=function(_0x1261c5,_0x8a1ccc){_0x1261c5=_0x1261c5-0x0;var _0x4167f5=_0x7162[_0x1261c5];return _0x4167f5;};'use strict';var Sequelize=require(_0x2716('0x0'));module[_0x2716('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2716('0x2')]},'ticketType':{'type':Sequelize[_0x2716('0x3')](_0x2716('0x4'),_0x2716('0x5')),'defaultValue':_0x2716('0x4')},'moduleSearch':{'type':Sequelize[_0x2716('0x3')](_0x2716('0x6'),'contact',_0x2716('0x7'),_0x2716('0x8'),_0x2716('0x9')),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize[_0x2716('0x3')](_0x2716('0xa'),_0x2716('0xb'),_0x2716('0x7'),_0x2716('0x9')),'defaultValue':_0x2716('0x7')},'leadId':{'type':Sequelize[_0x2716('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0x2716('0x2')]},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize[_0x2716('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index bbb7435..43154cc 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 _0xc2b0=['VIRTUAL','filter','options','SalesforceConfiguration','include','findAll','params','catch','create','body','find','getFields','findOne','SalesforceField','getSubjects','getDescriptions','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','end','error','stack','name','send','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xc2b0,0x13c));var _0x0c2b=function(_0x3a3a6a,_0x5eb6a9){_0x3a3a6a=_0x3a3a6a-0x0;var _0xa89294=_0xc2b0[_0x3a3a6a];return _0xa89294;};'use strict';var emlformat=require(_0x0c2b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0c2b('0x1'));var rp=require(_0x0c2b('0x2'));var moment=require('moment');var BPromise=require(_0x0c2b('0x3'));var Mustache=require(_0x0c2b('0x4'));var util=require(_0x0c2b('0x5'));var path=require(_0x0c2b('0x6'));var sox=require(_0x0c2b('0x7'));var csv=require('to-csv');var ejs=require(_0x0c2b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0c2b('0x9'));var squel=require('squel');var crypto=require(_0x0c2b('0xa'));var jsforce=require(_0x0c2b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0c2b('0xc'));var querystring=require(_0x0c2b('0xd'));var Papa=require(_0x0c2b('0xe'));var Redis=require('ioredis');var authService=require(_0x0c2b('0xf'));var qs=require(_0x0c2b('0x10'));var as=require(_0x0c2b('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0c2b('0x12'))('api');var utils=require(_0x0c2b('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x0c2b('0x14'));var db=require(_0x0c2b('0x15'))['db'];function respondWithStatusCode(_0x3b27e1,_0x477d67){_0x477d67=_0x477d67||0xcc;return function(_0x1b862f){if(_0x1b862f){return _0x3b27e1[_0x0c2b('0x16')](_0x477d67);}return _0x3b27e1[_0x0c2b('0x17')](_0x477d67)['end']();};}function respondWithResult(_0x292b18,_0x5aec89){_0x5aec89=_0x5aec89||0xc8;return function(_0x70c2e0){if(_0x70c2e0){return _0x292b18['status'](_0x5aec89)[_0x0c2b('0x18')](_0x70c2e0);}};}function respondWithFilteredResult(_0x1ad948,_0x1d7970){return function(_0x1f7741){if(_0x1f7741){var _0x1b4d3e=typeof _0x1d7970[_0x0c2b('0x19')]===_0x0c2b('0x1a')&&typeof _0x1d7970[_0x0c2b('0x1b')]===_0x0c2b('0x1a');var _0x4f49df=_0x1f7741[_0x0c2b('0x1c')];var _0x43824b=_0x1b4d3e?0x0:_0x1d7970[_0x0c2b('0x19')];var _0x2df134=_0x1b4d3e?_0x1f7741[_0x0c2b('0x1c')]:_0x1d7970[_0x0c2b('0x19')]+_0x1d7970[_0x0c2b('0x1b')];var _0x16b0e1;if(_0x2df134>=_0x4f49df){_0x2df134=_0x4f49df;_0x16b0e1=0xc8;}else{_0x16b0e1=0xce;}_0x1ad948[_0x0c2b('0x17')](_0x16b0e1);return _0x1ad948[_0x0c2b('0x1d')](_0x0c2b('0x1e'),_0x43824b+'-'+_0x2df134+'/'+_0x4f49df)[_0x0c2b('0x18')](_0x1f7741);}return null;};}function patchUpdates(_0x3e444a){return function(_0x45a965){try{jsonpatch['apply'](_0x45a965,_0x3e444a,!![]);}catch(_0xfa018f){return BPromise[_0x0c2b('0x1f')](_0xfa018f);}return _0x45a965[_0x0c2b('0x20')]();};}function saveUpdates(_0x42ab9d,_0x7123e7){return function(_0x4d5fe7){if(_0x4d5fe7){return _0x4d5fe7[_0x0c2b('0x21')](_0x42ab9d)[_0x0c2b('0x22')](function(_0x50671e){return _0x50671e;});}return null;};}function removeEntity(_0x43ee13,_0x5e9411){return function(_0x115f52){if(_0x115f52){return _0x115f52['destroy']()[_0x0c2b('0x22')](function(){_0x43ee13[_0x0c2b('0x17')](0xcc)[_0x0c2b('0x23')]();});}};}function handleEntityNotFound(_0x19db3b,_0x4d9542){return function(_0x402922){if(!_0x402922){_0x19db3b[_0x0c2b('0x16')](0x194);}return _0x402922;};}function handleError(_0x5cec61,_0x27e8df){_0x27e8df=_0x27e8df||0x1f4;return function(_0x56cb95){logger[_0x0c2b('0x24')](_0x56cb95[_0x0c2b('0x25')]);if(_0x56cb95['name']){delete _0x56cb95[_0x0c2b('0x26')];}_0x5cec61[_0x0c2b('0x17')](_0x27e8df)[_0x0c2b('0x27')](_0x56cb95);};}exports['index']=function(_0x514e3e,_0x200b34){var _0x31bb3d={},_0x1e09ed={},_0x26e3e6={'count':0x0,'rows':[]};var _0x384f74=_['map'](db['SalesforceConfiguration'][_0x0c2b('0x28')],function(_0x47855a){return{'name':_0x47855a['fieldName'],'type':_0x47855a[_0x0c2b('0x29')][_0x0c2b('0x2a')]};});_0x1e09ed[_0x0c2b('0x2b')]=_['map'](_0x384f74,_0x0c2b('0x26'));_0x1e09ed[_0x0c2b('0x2c')]=_[_0x0c2b('0x2d')](_0x514e3e[_0x0c2b('0x2c')]);_0x1e09ed[_0x0c2b('0x2e')]=_[_0x0c2b('0x2f')](_0x1e09ed[_0x0c2b('0x2b')],_0x1e09ed[_0x0c2b('0x2c')]);_0x31bb3d[_0x0c2b('0x30')]=_['intersection'](_0x1e09ed['model'],qs[_0x0c2b('0x31')](_0x514e3e[_0x0c2b('0x2c')][_0x0c2b('0x31')]));_0x31bb3d[_0x0c2b('0x30')]=_0x31bb3d[_0x0c2b('0x30')][_0x0c2b('0x32')]?_0x31bb3d[_0x0c2b('0x30')]:_0x1e09ed[_0x0c2b('0x2b')];if(!_0x514e3e[_0x0c2b('0x2c')][_0x0c2b('0x33')](_0x0c2b('0x34'))){_0x31bb3d[_0x0c2b('0x1b')]=qs['limit'](_0x514e3e[_0x0c2b('0x2c')][_0x0c2b('0x1b')]);_0x31bb3d['offset']=qs[_0x0c2b('0x19')](_0x514e3e[_0x0c2b('0x2c')][_0x0c2b('0x19')]);}_0x31bb3d[_0x0c2b('0x35')]=qs[_0x0c2b('0x36')](_0x514e3e['query']['sort']);_0x31bb3d[_0x0c2b('0x37')]=qs[_0x0c2b('0x2e')](_[_0x0c2b('0x38')](_0x514e3e[_0x0c2b('0x2c')],_0x1e09ed[_0x0c2b('0x2e')]),_0x384f74);if(_0x514e3e['query']['filter']){_0x31bb3d['where']=_[_0x0c2b('0x39')](_0x31bb3d[_0x0c2b('0x37')],{'$or':_[_0x0c2b('0x3a')](_0x384f74,function(_0xbc81b2){if(_0xbc81b2[_0x0c2b('0x29')]!==_0x0c2b('0x3b')){var _0x14e12b={};_0x14e12b[_0xbc81b2['name']]={'$like':'%'+_0x514e3e[_0x0c2b('0x2c')][_0x0c2b('0x3c')]+'%'};return _0x14e12b;}})});}_0x31bb3d=_['merge']({},_0x31bb3d,_0x514e3e[_0x0c2b('0x3d')]);var _0x1b0eb0={'where':_0x31bb3d[_0x0c2b('0x37')]};return db[_0x0c2b('0x3e')][_0x0c2b('0x1c')](_0x1b0eb0)[_0x0c2b('0x22')](function(_0x44a938){_0x26e3e6[_0x0c2b('0x1c')]=_0x44a938;if(_0x514e3e[_0x0c2b('0x2c')]['includeAll']){_0x31bb3d[_0x0c2b('0x3f')]=[{'all':!![]}];}return db[_0x0c2b('0x3e')][_0x0c2b('0x40')](_0x31bb3d);})[_0x0c2b('0x22')](function(_0x5603db){_0x26e3e6['rows']=_0x5603db;return _0x26e3e6;})['then'](respondWithFilteredResult(_0x200b34,_0x31bb3d))['catch'](handleError(_0x200b34,null));};exports['show']=function(_0x134c28,_0x3bc5bc){var _0x161052={'raw':![],'where':{'id':_0x134c28[_0x0c2b('0x41')]['id']}},_0x9cc601={};_0x9cc601[_0x0c2b('0x2b')]=_[_0x0c2b('0x2d')](db['SalesforceConfiguration'][_0x0c2b('0x28')]);_0x9cc601[_0x0c2b('0x2c')]=_['keys'](_0x134c28[_0x0c2b('0x2c')]);_0x9cc601['filters']=_['intersection'](_0x9cc601[_0x0c2b('0x2b')],_0x9cc601['query']);_0x161052['attributes']=_[_0x0c2b('0x2f')](_0x9cc601['model'],qs[_0x0c2b('0x31')](_0x134c28['query'][_0x0c2b('0x31')]));_0x161052[_0x0c2b('0x30')]=_0x161052['attributes'][_0x0c2b('0x32')]?_0x161052[_0x0c2b('0x30')]:_0x9cc601[_0x0c2b('0x2b')];if(_0x134c28[_0x0c2b('0x2c')]['includeAll']){_0x161052[_0x0c2b('0x3f')]=[{'all':!![]}];}_0x161052=_[_0x0c2b('0x39')]({},_0x161052,_0x134c28[_0x0c2b('0x3d')]);return db[_0x0c2b('0x3e')]['find'](_0x161052)[_0x0c2b('0x22')](handleEntityNotFound(_0x3bc5bc,null))[_0x0c2b('0x22')](respondWithResult(_0x3bc5bc,null))[_0x0c2b('0x42')](handleError(_0x3bc5bc,null));};exports[_0x0c2b('0x43')]=function(_0x1feb6a,_0x1fa967){return db[_0x0c2b('0x3e')][_0x0c2b('0x43')](_0x1feb6a[_0x0c2b('0x44')],{})[_0x0c2b('0x22')](respondWithResult(_0x1fa967,0xc9))[_0x0c2b('0x42')](handleError(_0x1fa967,null));};exports[_0x0c2b('0x21')]=function(_0x4eb922,_0x112760){if(_0x4eb922[_0x0c2b('0x44')]['id']){delete _0x4eb922['body']['id'];}return db['SalesforceConfiguration'][_0x0c2b('0x45')]({'where':{'id':_0x4eb922[_0x0c2b('0x41')]['id']}})[_0x0c2b('0x22')](handleEntityNotFound(_0x112760,null))[_0x0c2b('0x22')](saveUpdates(_0x4eb922['body'],null))[_0x0c2b('0x22')](respondWithResult(_0x112760,null))['catch'](handleError(_0x112760,null));};exports['destroy']=function(_0x4ececb,_0x97790a){return db[_0x0c2b('0x3e')]['find']({'where':{'id':_0x4ececb[_0x0c2b('0x41')]['id']}})[_0x0c2b('0x22')](handleEntityNotFound(_0x97790a,null))['then'](removeEntity(_0x97790a,null))['catch'](handleError(_0x97790a,null));};exports[_0x0c2b('0x46')]=function(_0x4bdc22,_0x57ee96,_0x2a3549){var _0x5445de={};var _0xd62f99={};var _0x11bc36;var _0x38a73e;return db[_0x0c2b('0x3e')][_0x0c2b('0x47')]({'where':{'id':_0x4bdc22[_0x0c2b('0x41')]['id']}})[_0x0c2b('0x22')](handleEntityNotFound(_0x57ee96,null))[_0x0c2b('0x22')](function(_0x365fee){if(_0x365fee){_0x11bc36=_0x365fee;_0xd62f99['model']=_[_0x0c2b('0x2d')](db[_0x0c2b('0x48')]['rawAttributes']);_0xd62f99[_0x0c2b('0x2c')]=_['keys'](_0x4bdc22[_0x0c2b('0x2c')]);_0xd62f99[_0x0c2b('0x2e')]=_[_0x0c2b('0x2f')](_0xd62f99[_0x0c2b('0x2b')],_0xd62f99[_0x0c2b('0x2c')]);_0x5445de['attributes']=_[_0x0c2b('0x2f')](_0xd62f99[_0x0c2b('0x2b')],qs[_0x0c2b('0x31')](_0x4bdc22[_0x0c2b('0x2c')][_0x0c2b('0x31')]));_0x5445de[_0x0c2b('0x30')]=_0x5445de[_0x0c2b('0x30')]['length']?_0x5445de[_0x0c2b('0x30')]:_0xd62f99[_0x0c2b('0x2b')];_0x5445de['order']=qs[_0x0c2b('0x36')](_0x4bdc22['query'][_0x0c2b('0x36')]);_0x5445de[_0x0c2b('0x37')]=qs[_0x0c2b('0x2e')](_[_0x0c2b('0x38')](_0x4bdc22[_0x0c2b('0x2c')],_0xd62f99[_0x0c2b('0x2e')]));if(_0x4bdc22[_0x0c2b('0x2c')][_0x0c2b('0x3c')]){_0x5445de['where']=_['merge'](_0x5445de[_0x0c2b('0x37')],{'$or':_[_0x0c2b('0x3a')](_0x5445de[_0x0c2b('0x30')],function(_0x38e149){var _0x4c00cb={};_0x4c00cb[_0x38e149]={'$like':'%'+_0x4bdc22[_0x0c2b('0x2c')]['filter']+'%'};return _0x4c00cb;})});}_0x5445de=_['merge']({},_0x5445de,_0x4bdc22[_0x0c2b('0x3d')]);return _0x11bc36['getFields'](_0x5445de);}})[_0x0c2b('0x22')](function(_0x2e6211){if(_0x2e6211){_0x38a73e=_0x2e6211[_0x0c2b('0x32')];if(!_0x4bdc22[_0x0c2b('0x2c')][_0x0c2b('0x33')](_0x0c2b('0x34'))){_0x5445de[_0x0c2b('0x1b')]=qs[_0x0c2b('0x1b')](_0x4bdc22[_0x0c2b('0x2c')][_0x0c2b('0x1b')]);_0x5445de['offset']=qs['offset'](_0x4bdc22['query'][_0x0c2b('0x19')]);}return _0x11bc36[_0x0c2b('0x46')](_0x5445de);}})['then'](function(_0x2dd5db){if(_0x2dd5db){return _0x2dd5db?{'count':_0x38a73e,'rows':_0x2dd5db}:null;}})[_0x0c2b('0x22')](respondWithResult(_0x57ee96,null))[_0x0c2b('0x42')](handleError(_0x57ee96,null));};exports[_0x0c2b('0x49')]=function(_0x506ccb,_0xe91147,_0x2a0752){var _0x4a9930={};var _0x1f51ca={};var _0xe96f2a;var _0x4e2bee;return db[_0x0c2b('0x3e')][_0x0c2b('0x47')]({'where':{'id':_0x506ccb[_0x0c2b('0x41')]['id']}})['then'](handleEntityNotFound(_0xe91147,null))['then'](function(_0x2bda42){if(_0x2bda42){_0xe96f2a=_0x2bda42;_0x1f51ca[_0x0c2b('0x2b')]=_[_0x0c2b('0x2d')](db[_0x0c2b('0x48')][_0x0c2b('0x28')]);_0x1f51ca[_0x0c2b('0x2c')]=_[_0x0c2b('0x2d')](_0x506ccb[_0x0c2b('0x2c')]);_0x1f51ca['filters']=_[_0x0c2b('0x2f')](_0x1f51ca[_0x0c2b('0x2b')],_0x1f51ca[_0x0c2b('0x2c')]);_0x4a9930[_0x0c2b('0x30')]=_[_0x0c2b('0x2f')](_0x1f51ca[_0x0c2b('0x2b')],qs[_0x0c2b('0x31')](_0x506ccb[_0x0c2b('0x2c')][_0x0c2b('0x31')]));_0x4a9930[_0x0c2b('0x30')]=_0x4a9930[_0x0c2b('0x30')][_0x0c2b('0x32')]?_0x4a9930['attributes']:_0x1f51ca[_0x0c2b('0x2b')];_0x4a9930['order']=qs['sort'](_0x506ccb[_0x0c2b('0x2c')][_0x0c2b('0x36')]);_0x4a9930[_0x0c2b('0x37')]=qs[_0x0c2b('0x2e')](_[_0x0c2b('0x38')](_0x506ccb[_0x0c2b('0x2c')],_0x1f51ca[_0x0c2b('0x2e')]));if(_0x506ccb[_0x0c2b('0x2c')][_0x0c2b('0x3c')]){_0x4a9930[_0x0c2b('0x37')]=_[_0x0c2b('0x39')](_0x4a9930[_0x0c2b('0x37')],{'$or':_[_0x0c2b('0x3a')](_0x4a9930[_0x0c2b('0x30')],function(_0xc8ad7d){var _0x53d34b={};_0x53d34b[_0xc8ad7d]={'$like':'%'+_0x506ccb['query'][_0x0c2b('0x3c')]+'%'};return _0x53d34b;})});}_0x4a9930=_[_0x0c2b('0x39')]({},_0x4a9930,_0x506ccb['options']);return _0xe96f2a[_0x0c2b('0x49')](_0x4a9930);}})[_0x0c2b('0x22')](function(_0x43b800){if(_0x43b800){_0x4e2bee=_0x43b800['length'];if(!_0x506ccb[_0x0c2b('0x2c')][_0x0c2b('0x33')](_0x0c2b('0x34'))){_0x4a9930[_0x0c2b('0x1b')]=qs[_0x0c2b('0x1b')](_0x506ccb[_0x0c2b('0x2c')][_0x0c2b('0x1b')]);_0x4a9930['offset']=qs[_0x0c2b('0x19')](_0x506ccb[_0x0c2b('0x2c')][_0x0c2b('0x19')]);}return _0xe96f2a['getSubjects'](_0x4a9930);}})[_0x0c2b('0x22')](function(_0x35dfd5){if(_0x35dfd5){return _0x35dfd5?{'count':_0x4e2bee,'rows':_0x35dfd5}:null;}})['then'](respondWithResult(_0xe91147,null))[_0x0c2b('0x42')](handleError(_0xe91147,null));};exports['getDescriptions']=function(_0x35c1f5,_0x3ce37b,_0x45852b){var _0x2ede4d={};var _0x4ff078={};var _0x28242f;var _0x49db86;return db[_0x0c2b('0x3e')]['findOne']({'where':{'id':_0x35c1f5[_0x0c2b('0x41')]['id']}})[_0x0c2b('0x22')](handleEntityNotFound(_0x3ce37b,null))[_0x0c2b('0x22')](function(_0x172445){if(_0x172445){_0x28242f=_0x172445;_0x4ff078[_0x0c2b('0x2b')]=_[_0x0c2b('0x2d')](db['SalesforceField'][_0x0c2b('0x28')]);_0x4ff078[_0x0c2b('0x2c')]=_['keys'](_0x35c1f5[_0x0c2b('0x2c')]);_0x4ff078[_0x0c2b('0x2e')]=_[_0x0c2b('0x2f')](_0x4ff078[_0x0c2b('0x2b')],_0x4ff078[_0x0c2b('0x2c')]);_0x2ede4d[_0x0c2b('0x30')]=_['intersection'](_0x4ff078[_0x0c2b('0x2b')],qs[_0x0c2b('0x31')](_0x35c1f5[_0x0c2b('0x2c')][_0x0c2b('0x31')]));_0x2ede4d['attributes']=_0x2ede4d['attributes'][_0x0c2b('0x32')]?_0x2ede4d[_0x0c2b('0x30')]:_0x4ff078['model'];_0x2ede4d[_0x0c2b('0x35')]=qs[_0x0c2b('0x36')](_0x35c1f5[_0x0c2b('0x2c')]['sort']);_0x2ede4d[_0x0c2b('0x37')]=qs[_0x0c2b('0x2e')](_[_0x0c2b('0x38')](_0x35c1f5[_0x0c2b('0x2c')],_0x4ff078['filters']));if(_0x35c1f5[_0x0c2b('0x2c')][_0x0c2b('0x3c')]){_0x2ede4d['where']=_['merge'](_0x2ede4d[_0x0c2b('0x37')],{'$or':_[_0x0c2b('0x3a')](_0x2ede4d['attributes'],function(_0x26be65){var _0x218a12={};_0x218a12[_0x26be65]={'$like':'%'+_0x35c1f5['query'][_0x0c2b('0x3c')]+'%'};return _0x218a12;})});}_0x2ede4d=_['merge']({},_0x2ede4d,_0x35c1f5[_0x0c2b('0x3d')]);return _0x28242f[_0x0c2b('0x4a')](_0x2ede4d);}})[_0x0c2b('0x22')](function(_0x353bcd){if(_0x353bcd){_0x49db86=_0x353bcd[_0x0c2b('0x32')];if(!_0x35c1f5[_0x0c2b('0x2c')][_0x0c2b('0x33')](_0x0c2b('0x34'))){_0x2ede4d[_0x0c2b('0x1b')]=qs[_0x0c2b('0x1b')](_0x35c1f5[_0x0c2b('0x2c')]['limit']);_0x2ede4d[_0x0c2b('0x19')]=qs[_0x0c2b('0x19')](_0x35c1f5['query'][_0x0c2b('0x19')]);}return _0x28242f['getDescriptions'](_0x2ede4d);}})[_0x0c2b('0x22')](function(_0x322b50){if(_0x322b50){return _0x322b50?{'count':_0x49db86,'rows':_0x322b50}:null;}})['then'](respondWithResult(_0x3ce37b,null))[_0x0c2b('0x42')](handleError(_0x3ce37b,null));}; \ No newline at end of file +var _0xc46f=['set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','SalesforceConfiguration','includeAll','findAll','rows','catch','params','keys','length','find','create','body','getFields','SalesforceField','getSubjects','findOne','eml-format','zip-dir','moment','bluebird','util','sox','to-csv','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit'];(function(_0x352883,_0x41216a){var _0x2f61cb=function(_0x3d19e3){while(--_0x3d19e3){_0x352883['push'](_0x352883['shift']());}};_0x2f61cb(++_0x41216a);}(_0xc46f,0x158));var _0xfc46=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xc46f[_0x199572];return _0x13cfa3;};'use strict';var emlformat=require(_0xfc46('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfc46('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xfc46('0x2'));var BPromise=require(_0xfc46('0x3'));var Mustache=require('mustache');var util=require(_0xfc46('0x4'));var path=require('path');var sox=require(_0xfc46('0x5'));var csv=require(_0xfc46('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xfc46('0x7'));var crypto=require('crypto');var jsforce=require(_0xfc46('0x8'));var deskjs=require('desk.js');var toCsv=require(_0xfc46('0x6'));var querystring=require('querystring');var Papa=require(_0xfc46('0x9'));var Redis=require(_0xfc46('0xa'));var authService=require(_0xfc46('0xb'));var qs=require(_0xfc46('0xc'));var as=require(_0xfc46('0xd'));var hardwareService=require(_0xfc46('0xe'));var logger=require(_0xfc46('0xf'))(_0xfc46('0x10'));var utils=require('../../config/utils');var config=require(_0xfc46('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0xfc46('0x12'))['db'];function respondWithStatusCode(_0x14c02e,_0x10a7f9){_0x10a7f9=_0x10a7f9||0xcc;return function(_0x4a8d37){if(_0x4a8d37){return _0x14c02e[_0xfc46('0x13')](_0x10a7f9);}return _0x14c02e['status'](_0x10a7f9)[_0xfc46('0x14')]();};}function respondWithResult(_0x34552d,_0x4fce9f){_0x4fce9f=_0x4fce9f||0xc8;return function(_0xbbc6cf){if(_0xbbc6cf){return _0x34552d[_0xfc46('0x15')](_0x4fce9f)[_0xfc46('0x16')](_0xbbc6cf);}};}function respondWithFilteredResult(_0x1bc0ff,_0x45302a){return function(_0x5bf747){if(_0x5bf747){var _0xdace41=typeof _0x45302a[_0xfc46('0x17')]===_0xfc46('0x18')&&typeof _0x45302a[_0xfc46('0x19')]==='undefined';var _0xf860f2=_0x5bf747['count'];var _0x38a069=_0xdace41?0x0:_0x45302a['offset'];var _0x413c5f=_0xdace41?_0x5bf747['count']:_0x45302a[_0xfc46('0x17')]+_0x45302a[_0xfc46('0x19')];var _0x118662;if(_0x413c5f>=_0xf860f2){_0x413c5f=_0xf860f2;_0x118662=0xc8;}else{_0x118662=0xce;}_0x1bc0ff[_0xfc46('0x15')](_0x118662);return _0x1bc0ff[_0xfc46('0x1a')](_0xfc46('0x1b'),_0x38a069+'-'+_0x413c5f+'/'+_0xf860f2)[_0xfc46('0x16')](_0x5bf747);}return null;};}function patchUpdates(_0x19571f){return function(_0xe9de95){try{jsonpatch[_0xfc46('0x1c')](_0xe9de95,_0x19571f,!![]);}catch(_0x2027c2){return BPromise[_0xfc46('0x1d')](_0x2027c2);}return _0xe9de95[_0xfc46('0x1e')]();};}function saveUpdates(_0x39cfd5,_0x351535){return function(_0x4f1390){if(_0x4f1390){return _0x4f1390[_0xfc46('0x1f')](_0x39cfd5)[_0xfc46('0x20')](function(_0xdce0fa){return _0xdce0fa;});}return null;};}function removeEntity(_0x1aaee7,_0x1bf94e){return function(_0x8fe758){if(_0x8fe758){return _0x8fe758[_0xfc46('0x21')]()[_0xfc46('0x20')](function(){_0x1aaee7[_0xfc46('0x15')](0xcc)[_0xfc46('0x14')]();});}};}function handleEntityNotFound(_0x2e64e5,_0x4c9eeb){return function(_0x443d63){if(!_0x443d63){_0x2e64e5[_0xfc46('0x13')](0x194);}return _0x443d63;};}function handleError(_0x25243c,_0xc71e31){_0xc71e31=_0xc71e31||0x1f4;return function(_0x5da862){logger[_0xfc46('0x22')](_0x5da862[_0xfc46('0x23')]);if(_0x5da862[_0xfc46('0x24')]){delete _0x5da862[_0xfc46('0x24')];}_0x25243c[_0xfc46('0x15')](_0xc71e31)[_0xfc46('0x25')](_0x5da862);};}exports[_0xfc46('0x26')]=function(_0x31fd1f,_0x225ddb){var _0x4e78f4={},_0x4b3ac5={},_0x33f2c9={'count':0x0,'rows':[]};var _0x4b9535=_[_0xfc46('0x27')](db['SalesforceConfiguration'][_0xfc46('0x28')],function(_0x43957a){return{'name':_0x43957a[_0xfc46('0x29')],'type':_0x43957a[_0xfc46('0x2a')][_0xfc46('0x2b')]};});_0x4b3ac5['model']=_[_0xfc46('0x27')](_0x4b9535,'name');_0x4b3ac5[_0xfc46('0x2c')]=_['keys'](_0x31fd1f['query']);_0x4b3ac5[_0xfc46('0x2d')]=_[_0xfc46('0x2e')](_0x4b3ac5[_0xfc46('0x2f')],_0x4b3ac5[_0xfc46('0x2c')]);_0x4e78f4[_0xfc46('0x30')]=_[_0xfc46('0x2e')](_0x4b3ac5[_0xfc46('0x2f')],qs[_0xfc46('0x31')](_0x31fd1f[_0xfc46('0x2c')][_0xfc46('0x31')]));_0x4e78f4[_0xfc46('0x30')]=_0x4e78f4['attributes']['length']?_0x4e78f4[_0xfc46('0x30')]:_0x4b3ac5['model'];if(!_0x31fd1f[_0xfc46('0x2c')][_0xfc46('0x32')](_0xfc46('0x33'))){_0x4e78f4[_0xfc46('0x19')]=qs[_0xfc46('0x19')](_0x31fd1f['query'][_0xfc46('0x19')]);_0x4e78f4[_0xfc46('0x17')]=qs[_0xfc46('0x17')](_0x31fd1f['query'][_0xfc46('0x17')]);}_0x4e78f4[_0xfc46('0x34')]=qs[_0xfc46('0x35')](_0x31fd1f[_0xfc46('0x2c')]['sort']);_0x4e78f4[_0xfc46('0x36')]=qs['filters'](_[_0xfc46('0x37')](_0x31fd1f['query'],_0x4b3ac5[_0xfc46('0x2d')]),_0x4b9535);if(_0x31fd1f[_0xfc46('0x2c')]['filter']){_0x4e78f4[_0xfc46('0x36')]=_[_0xfc46('0x38')](_0x4e78f4['where'],{'$or':_[_0xfc46('0x27')](_0x4b9535,function(_0x36ef04){if(_0x36ef04['type']!=='VIRTUAL'){var _0x510dad={};_0x510dad[_0x36ef04[_0xfc46('0x24')]]={'$like':'%'+_0x31fd1f[_0xfc46('0x2c')][_0xfc46('0x39')]+'%'};return _0x510dad;}})});}_0x4e78f4=_['merge']({},_0x4e78f4,_0x31fd1f[_0xfc46('0x3a')]);var _0x17aae5={'where':_0x4e78f4[_0xfc46('0x36')]};return db[_0xfc46('0x3b')]['count'](_0x17aae5)[_0xfc46('0x20')](function(_0x378c0b){_0x33f2c9['count']=_0x378c0b;if(_0x31fd1f[_0xfc46('0x2c')][_0xfc46('0x3c')]){_0x4e78f4['include']=[{'all':!![]}];}return db[_0xfc46('0x3b')][_0xfc46('0x3d')](_0x4e78f4);})[_0xfc46('0x20')](function(_0x4a2ef1){_0x33f2c9[_0xfc46('0x3e')]=_0x4a2ef1;return _0x33f2c9;})[_0xfc46('0x20')](respondWithFilteredResult(_0x225ddb,_0x4e78f4))[_0xfc46('0x3f')](handleError(_0x225ddb,null));};exports['show']=function(_0x3359b2,_0x53e024){var _0x4d0cdf={'raw':![],'where':{'id':_0x3359b2[_0xfc46('0x40')]['id']}},_0x5b8a16={};_0x5b8a16['model']=_[_0xfc46('0x41')](db['SalesforceConfiguration']['rawAttributes']);_0x5b8a16['query']=_[_0xfc46('0x41')](_0x3359b2[_0xfc46('0x2c')]);_0x5b8a16[_0xfc46('0x2d')]=_[_0xfc46('0x2e')](_0x5b8a16['model'],_0x5b8a16[_0xfc46('0x2c')]);_0x4d0cdf[_0xfc46('0x30')]=_[_0xfc46('0x2e')](_0x5b8a16[_0xfc46('0x2f')],qs[_0xfc46('0x31')](_0x3359b2[_0xfc46('0x2c')]['fields']));_0x4d0cdf[_0xfc46('0x30')]=_0x4d0cdf[_0xfc46('0x30')][_0xfc46('0x42')]?_0x4d0cdf[_0xfc46('0x30')]:_0x5b8a16[_0xfc46('0x2f')];if(_0x3359b2['query'][_0xfc46('0x3c')]){_0x4d0cdf['include']=[{'all':!![]}];}_0x4d0cdf=_[_0xfc46('0x38')]({},_0x4d0cdf,_0x3359b2[_0xfc46('0x3a')]);return db[_0xfc46('0x3b')][_0xfc46('0x43')](_0x4d0cdf)[_0xfc46('0x20')](handleEntityNotFound(_0x53e024,null))[_0xfc46('0x20')](respondWithResult(_0x53e024,null))[_0xfc46('0x3f')](handleError(_0x53e024,null));};exports['create']=function(_0xb3c697,_0xb9b00b){return db[_0xfc46('0x3b')][_0xfc46('0x44')](_0xb3c697[_0xfc46('0x45')],{})['then'](respondWithResult(_0xb9b00b,0xc9))['catch'](handleError(_0xb9b00b,null));};exports[_0xfc46('0x1f')]=function(_0x10fc89,_0x5d570c){if(_0x10fc89[_0xfc46('0x45')]['id']){delete _0x10fc89['body']['id'];}return db[_0xfc46('0x3b')][_0xfc46('0x43')]({'where':{'id':_0x10fc89[_0xfc46('0x40')]['id']}})[_0xfc46('0x20')](handleEntityNotFound(_0x5d570c,null))[_0xfc46('0x20')](saveUpdates(_0x10fc89[_0xfc46('0x45')],null))['then'](respondWithResult(_0x5d570c,null))['catch'](handleError(_0x5d570c,null));};exports[_0xfc46('0x21')]=function(_0x10e28f,_0x421c20){return db[_0xfc46('0x3b')][_0xfc46('0x43')]({'where':{'id':_0x10e28f[_0xfc46('0x40')]['id']}})['then'](handleEntityNotFound(_0x421c20,null))[_0xfc46('0x20')](removeEntity(_0x421c20,null))[_0xfc46('0x3f')](handleError(_0x421c20,null));};exports[_0xfc46('0x46')]=function(_0x118709,_0x1f2fd0,_0x33cb6d){var _0x4325df={};var _0x5b35ef={};var _0x373ccd;var _0x1e44ff;return db[_0xfc46('0x3b')]['findOne']({'where':{'id':_0x118709[_0xfc46('0x40')]['id']}})[_0xfc46('0x20')](handleEntityNotFound(_0x1f2fd0,null))['then'](function(_0x26688){if(_0x26688){_0x373ccd=_0x26688;_0x5b35ef[_0xfc46('0x2f')]=_[_0xfc46('0x41')](db[_0xfc46('0x47')][_0xfc46('0x28')]);_0x5b35ef[_0xfc46('0x2c')]=_[_0xfc46('0x41')](_0x118709[_0xfc46('0x2c')]);_0x5b35ef['filters']=_[_0xfc46('0x2e')](_0x5b35ef[_0xfc46('0x2f')],_0x5b35ef[_0xfc46('0x2c')]);_0x4325df[_0xfc46('0x30')]=_[_0xfc46('0x2e')](_0x5b35ef[_0xfc46('0x2f')],qs[_0xfc46('0x31')](_0x118709[_0xfc46('0x2c')][_0xfc46('0x31')]));_0x4325df[_0xfc46('0x30')]=_0x4325df[_0xfc46('0x30')][_0xfc46('0x42')]?_0x4325df[_0xfc46('0x30')]:_0x5b35ef[_0xfc46('0x2f')];_0x4325df[_0xfc46('0x34')]=qs[_0xfc46('0x35')](_0x118709[_0xfc46('0x2c')][_0xfc46('0x35')]);_0x4325df[_0xfc46('0x36')]=qs[_0xfc46('0x2d')](_['pick'](_0x118709[_0xfc46('0x2c')],_0x5b35ef[_0xfc46('0x2d')]));if(_0x118709[_0xfc46('0x2c')][_0xfc46('0x39')]){_0x4325df['where']=_[_0xfc46('0x38')](_0x4325df[_0xfc46('0x36')],{'$or':_[_0xfc46('0x27')](_0x4325df['attributes'],function(_0x19e2e8){var _0x31f4c2={};_0x31f4c2[_0x19e2e8]={'$like':'%'+_0x118709[_0xfc46('0x2c')][_0xfc46('0x39')]+'%'};return _0x31f4c2;})});}_0x4325df=_[_0xfc46('0x38')]({},_0x4325df,_0x118709[_0xfc46('0x3a')]);return _0x373ccd[_0xfc46('0x46')](_0x4325df);}})[_0xfc46('0x20')](function(_0xa3ee7f){if(_0xa3ee7f){_0x1e44ff=_0xa3ee7f['length'];if(!_0x118709[_0xfc46('0x2c')][_0xfc46('0x32')]('nolimit')){_0x4325df['limit']=qs[_0xfc46('0x19')](_0x118709[_0xfc46('0x2c')][_0xfc46('0x19')]);_0x4325df['offset']=qs[_0xfc46('0x17')](_0x118709[_0xfc46('0x2c')]['offset']);}return _0x373ccd[_0xfc46('0x46')](_0x4325df);}})[_0xfc46('0x20')](function(_0x35ea4f){if(_0x35ea4f){return _0x35ea4f?{'count':_0x1e44ff,'rows':_0x35ea4f}:null;}})[_0xfc46('0x20')](respondWithResult(_0x1f2fd0,null))[_0xfc46('0x3f')](handleError(_0x1f2fd0,null));};exports[_0xfc46('0x48')]=function(_0x1c9ad9,_0x5efd31,_0x3729f6){var _0x5436be={};var _0x86d925={};var _0x1afb2b;var _0x3955e5;return db[_0xfc46('0x3b')][_0xfc46('0x49')]({'where':{'id':_0x1c9ad9[_0xfc46('0x40')]['id']}})[_0xfc46('0x20')](handleEntityNotFound(_0x5efd31,null))['then'](function(_0x3c42a6){if(_0x3c42a6){_0x1afb2b=_0x3c42a6;_0x86d925[_0xfc46('0x2f')]=_[_0xfc46('0x41')](db[_0xfc46('0x47')][_0xfc46('0x28')]);_0x86d925[_0xfc46('0x2c')]=_[_0xfc46('0x41')](_0x1c9ad9[_0xfc46('0x2c')]);_0x86d925[_0xfc46('0x2d')]=_[_0xfc46('0x2e')](_0x86d925[_0xfc46('0x2f')],_0x86d925[_0xfc46('0x2c')]);_0x5436be['attributes']=_['intersection'](_0x86d925[_0xfc46('0x2f')],qs[_0xfc46('0x31')](_0x1c9ad9['query'][_0xfc46('0x31')]));_0x5436be[_0xfc46('0x30')]=_0x5436be[_0xfc46('0x30')][_0xfc46('0x42')]?_0x5436be[_0xfc46('0x30')]:_0x86d925[_0xfc46('0x2f')];_0x5436be[_0xfc46('0x34')]=qs[_0xfc46('0x35')](_0x1c9ad9[_0xfc46('0x2c')][_0xfc46('0x35')]);_0x5436be['where']=qs[_0xfc46('0x2d')](_[_0xfc46('0x37')](_0x1c9ad9[_0xfc46('0x2c')],_0x86d925[_0xfc46('0x2d')]));if(_0x1c9ad9[_0xfc46('0x2c')][_0xfc46('0x39')]){_0x5436be[_0xfc46('0x36')]=_['merge'](_0x5436be[_0xfc46('0x36')],{'$or':_[_0xfc46('0x27')](_0x5436be['attributes'],function(_0x404ab7){var _0x3908ac={};_0x3908ac[_0x404ab7]={'$like':'%'+_0x1c9ad9[_0xfc46('0x2c')]['filter']+'%'};return _0x3908ac;})});}_0x5436be=_[_0xfc46('0x38')]({},_0x5436be,_0x1c9ad9['options']);return _0x1afb2b[_0xfc46('0x48')](_0x5436be);}})['then'](function(_0x3fa5ec){if(_0x3fa5ec){_0x3955e5=_0x3fa5ec[_0xfc46('0x42')];if(!_0x1c9ad9['query'][_0xfc46('0x32')]('nolimit')){_0x5436be[_0xfc46('0x19')]=qs['limit'](_0x1c9ad9[_0xfc46('0x2c')][_0xfc46('0x19')]);_0x5436be[_0xfc46('0x17')]=qs[_0xfc46('0x17')](_0x1c9ad9[_0xfc46('0x2c')][_0xfc46('0x17')]);}return _0x1afb2b['getSubjects'](_0x5436be);}})[_0xfc46('0x20')](function(_0x1b424d){if(_0x1b424d){return _0x1b424d?{'count':_0x3955e5,'rows':_0x1b424d}:null;}})[_0xfc46('0x20')](respondWithResult(_0x5efd31,null))[_0xfc46('0x3f')](handleError(_0x5efd31,null));};exports['getDescriptions']=function(_0x2a00e9,_0x49d6d9,_0x5d495f){var _0x4bb91c={};var _0x30d169={};var _0x3b846c;var _0x84ba9a;return db[_0xfc46('0x3b')][_0xfc46('0x49')]({'where':{'id':_0x2a00e9[_0xfc46('0x40')]['id']}})['then'](handleEntityNotFound(_0x49d6d9,null))[_0xfc46('0x20')](function(_0x59c1c5){if(_0x59c1c5){_0x3b846c=_0x59c1c5;_0x30d169[_0xfc46('0x2f')]=_[_0xfc46('0x41')](db['SalesforceField'][_0xfc46('0x28')]);_0x30d169[_0xfc46('0x2c')]=_[_0xfc46('0x41')](_0x2a00e9[_0xfc46('0x2c')]);_0x30d169[_0xfc46('0x2d')]=_['intersection'](_0x30d169['model'],_0x30d169[_0xfc46('0x2c')]);_0x4bb91c[_0xfc46('0x30')]=_[_0xfc46('0x2e')](_0x30d169[_0xfc46('0x2f')],qs['fields'](_0x2a00e9[_0xfc46('0x2c')][_0xfc46('0x31')]));_0x4bb91c[_0xfc46('0x30')]=_0x4bb91c[_0xfc46('0x30')]['length']?_0x4bb91c[_0xfc46('0x30')]:_0x30d169[_0xfc46('0x2f')];_0x4bb91c['order']=qs[_0xfc46('0x35')](_0x2a00e9[_0xfc46('0x2c')][_0xfc46('0x35')]);_0x4bb91c['where']=qs['filters'](_['pick'](_0x2a00e9['query'],_0x30d169[_0xfc46('0x2d')]));if(_0x2a00e9[_0xfc46('0x2c')][_0xfc46('0x39')]){_0x4bb91c['where']=_[_0xfc46('0x38')](_0x4bb91c[_0xfc46('0x36')],{'$or':_[_0xfc46('0x27')](_0x4bb91c['attributes'],function(_0x320fca){var _0x38f3d3={};_0x38f3d3[_0x320fca]={'$like':'%'+_0x2a00e9[_0xfc46('0x2c')][_0xfc46('0x39')]+'%'};return _0x38f3d3;})});}_0x4bb91c=_[_0xfc46('0x38')]({},_0x4bb91c,_0x2a00e9[_0xfc46('0x3a')]);return _0x3b846c['getDescriptions'](_0x4bb91c);}})[_0xfc46('0x20')](function(_0x285cfd){if(_0x285cfd){_0x84ba9a=_0x285cfd[_0xfc46('0x42')];if(!_0x2a00e9[_0xfc46('0x2c')][_0xfc46('0x32')]('nolimit')){_0x4bb91c[_0xfc46('0x19')]=qs[_0xfc46('0x19')](_0x2a00e9[_0xfc46('0x2c')]['limit']);_0x4bb91c[_0xfc46('0x17')]=qs[_0xfc46('0x17')](_0x2a00e9[_0xfc46('0x2c')][_0xfc46('0x17')]);}return _0x3b846c['getDescriptions'](_0x4bb91c);}})['then'](function(_0x3cddd3){if(_0x3cddd3){return _0x3cddd3?{'count':_0x84ba9a,'rows':_0x3cddd3}:null;}})['then'](respondWithResult(_0x49d6d9,null))['catch'](handleError(_0x49d6d9,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index d246442..894298c 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 _0x462a=['./intSalesforceConfiguration.attributes','exports','define','SalesforceConfiguration','int_salesforce_configurations','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x25c5d8,_0x55f73b){var _0x21a4dc=function(_0x2fd9ce){while(--_0x2fd9ce){_0x25c5d8['push'](_0x25c5d8['shift']());}};_0x21a4dc(++_0x55f73b);}(_0x462a,0x155));var _0xa462=function(_0x11a4d0,_0x2e3cf1){_0x11a4d0=_0x11a4d0-0x0;var _0x4555b7=_0x462a[_0x11a4d0];return _0x4555b7;};'use strict';var _=require('lodash');var util=require(_0xa462('0x0'));var logger=require(_0xa462('0x1'))(_0xa462('0x2'));var moment=require(_0xa462('0x3'));var BPromise=require(_0xa462('0x4'));var rp=require(_0xa462('0x5'));var fs=require('fs');var path=require(_0xa462('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa462('0x7'));module[_0xa462('0x8')]=function(_0xb323f6,_0x1f26ac){return _0xb323f6[_0xa462('0x9')](_0xa462('0xa'),attributes,{'tableName':_0xa462('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb82a=['rimraf','exports','define','int_salesforce_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x31e2ae,_0x18e7c2){var _0xf3dea5=function(_0x25c6b8){while(--_0x25c6b8){_0x31e2ae['push'](_0x31e2ae['shift']());}};_0xf3dea5(++_0x18e7c2);}(_0xb82a,0x190));var _0xab82=function(_0x547045,_0x3169bf){_0x547045=_0x547045-0x0;var _0x409ba5=_0xb82a[_0x547045];return _0x409ba5;};'use strict';var _=require(_0xab82('0x0'));var util=require(_0xab82('0x1'));var logger=require(_0xab82('0x2'))(_0xab82('0x3'));var moment=require(_0xab82('0x4'));var BPromise=require(_0xab82('0x5'));var rp=require(_0xab82('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xab82('0x7'));var config=require('../../config/environment');var attributes=require('./intSalesforceConfiguration.attributes');module[_0xab82('0x8')]=function(_0x3562b7,_0x4189a5){return _0x3562b7[_0xab82('0x9')]('SalesforceConfiguration',attributes,{'tableName':_0xab82('0xa'),'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 74d85df..700ab7b 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 _0x2b64=['http','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise'];(function(_0x2b2206,_0x360017){var _0x56a045=function(_0x13d5cf){while(--_0x13d5cf){_0x2b2206['push'](_0x2b2206['shift']());}};_0x56a045(++_0x360017);}(_0x2b64,0xf3));var _0x42b6=function(_0x47b0cd,_0x546313){_0x47b0cd=_0x47b0cd-0x0;var _0x1a3269=_0x2b64[_0x47b0cd];return _0x1a3269;};'use strict';var _=require('lodash');var util=require(_0x42b6('0x0'));var moment=require(_0x42b6('0x1'));var BPromise=require(_0x42b6('0x2'));var rs=require(_0x42b6('0x3'));var fs=require('fs');var Redis=require(_0x42b6('0x4'));var db=require(_0x42b6('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x42b6('0x6'));var config=require(_0x42b6('0x7'));var jayson=require(_0x42b6('0x8'));var client=jayson['client'][_0x42b6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x514b11,_0x5ec868,_0xff221a){return new BPromise(function(_0x577e9e,_0x20d62d){return client['request'](_0x514b11,_0xff221a)[_0x42b6('0xa')](function(_0x779e11){logger[_0x42b6('0xb')](_0x42b6('0xc'),_0x5ec868,_0x42b6('0xd'));logger[_0x42b6('0xe')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x5ec868,'request\x20sent',JSON[_0x42b6('0xf')](_0x779e11));if(_0x779e11[_0x42b6('0x10')]){if(_0x779e11[_0x42b6('0x10')][_0x42b6('0x11')]===0x1f4){logger[_0x42b6('0x10')]('SalesforceConfiguration,\x20%s,\x20%s',_0x5ec868,_0x779e11[_0x42b6('0x10')][_0x42b6('0x12')]);return _0x20d62d(_0x779e11[_0x42b6('0x10')][_0x42b6('0x12')]);}logger['error'](_0x42b6('0xc'),_0x5ec868,_0x779e11[_0x42b6('0x10')][_0x42b6('0x12')]);return _0x577e9e(_0x779e11[_0x42b6('0x10')]['message']);}else{logger[_0x42b6('0xb')](_0x42b6('0xc'),_0x5ec868,_0x42b6('0xd'));_0x577e9e(_0x779e11[_0x42b6('0x13')][_0x42b6('0x12')]);}})[_0x42b6('0x14')](function(_0xe5deb9){logger[_0x42b6('0x10')](_0x42b6('0xc'),_0x5ec868,_0xe5deb9);_0x20d62d(_0xe5deb9);});});} \ No newline at end of file +var _0x4e92=['../../config/environment','jayson/promise','client','http','then','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','SalesforceConfiguration,\x20%s,\x20%s','message','info','result','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x21cf45,_0x32ac6f){var _0xbb6df=function(_0x263358){while(--_0x263358){_0x21cf45['push'](_0x21cf45['shift']());}};_0xbb6df(++_0x32ac6f);}(_0x4e92,0x1c7));var _0x24e9=function(_0x3e9ef3,_0x21a7e4){_0x3e9ef3=_0x3e9ef3-0x0;var _0x333748=_0x4e92[_0x3e9ef3];return _0x333748;};'use strict';var _=require(_0x24e9('0x0'));var util=require(_0x24e9('0x1'));var moment=require(_0x24e9('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x24e9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x24e9('0x4'));var logger=require(_0x24e9('0x5'))(_0x24e9('0x6'));var config=require(_0x24e9('0x7'));var jayson=require(_0x24e9('0x8'));var client=jayson[_0x24e9('0x9')][_0x24e9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x485b0d,_0x12349b,_0x3ba618){return new BPromise(function(_0x4dd3b5,_0x1752d8){return client['request'](_0x485b0d,_0x3ba618)[_0x24e9('0xb')](function(_0x57f45c){logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x12349b,_0x24e9('0xc'));logger[_0x24e9('0xd')](_0x24e9('0xe'),_0x12349b,_0x24e9('0xc'),JSON[_0x24e9('0xf')](_0x57f45c));if(_0x57f45c[_0x24e9('0x10')]){if(_0x57f45c['error'][_0x24e9('0x11')]===0x1f4){logger[_0x24e9('0x10')](_0x24e9('0x12'),_0x12349b,_0x57f45c[_0x24e9('0x10')]['message']);return _0x1752d8(_0x57f45c[_0x24e9('0x10')][_0x24e9('0x13')]);}logger[_0x24e9('0x10')](_0x24e9('0x12'),_0x12349b,_0x57f45c[_0x24e9('0x10')]['message']);return _0x4dd3b5(_0x57f45c[_0x24e9('0x10')][_0x24e9('0x13')]);}else{logger[_0x24e9('0x14')]('SalesforceConfiguration,\x20%s,\x20%s',_0x12349b,'request\x20sent');_0x4dd3b5(_0x57f45c[_0x24e9('0x15')][_0x24e9('0x13')]);}})['catch'](function(_0x5b2dc8){logger[_0x24e9('0x10')]('SalesforceConfiguration,\x20%s,\x20%s',_0x12349b,_0x5b2dc8);_0x1752d8(_0x5b2dc8);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 5bb0afc..ba02e91 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 _0x2e71=['exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete'];(function(_0x4a9947,_0x3c0ddd){var _0x368745=function(_0x157f9f){while(--_0x157f9f){_0x4a9947['push'](_0x4a9947['shift']());}};_0x368745(++_0x3c0ddd);}(_0x2e71,0x1e7));var _0x12e7=function(_0x2e41e2,_0x4e7250){_0x2e41e2=_0x2e41e2-0x0;var _0x2844d6=_0x2e71[_0x2e41e2];return _0x2844d6;};'use strict';var multer=require(_0x12e7('0x0'));var util=require(_0x12e7('0x1'));var path=require(_0x12e7('0x2'));var timeout=require(_0x12e7('0x3'));var express=require(_0x12e7('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x12e7('0x5'));var config=require(_0x12e7('0x6'));var controller=require(_0x12e7('0x7'));router[_0x12e7('0x8')]('/',auth[_0x12e7('0x9')](),controller[_0x12e7('0xa')]);router['get'](_0x12e7('0xb'),auth[_0x12e7('0x9')](),controller[_0x12e7('0xc')]);router['post']('/',auth[_0x12e7('0x9')](),controller[_0x12e7('0xd')]);router[_0x12e7('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x12e7('0xf')]);router[_0x12e7('0x10')](_0x12e7('0xb'),auth[_0x12e7('0x9')](),controller['destroy']);module[_0x12e7('0x11')]=router; \ No newline at end of file +var _0xd881=['update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceField.controller','get','isAuthenticated','index','/:id','show','create','put'];(function(_0x4cf9ea,_0x44fdf5){var _0x8363ca=function(_0x5719b6){while(--_0x5719b6){_0x4cf9ea['push'](_0x4cf9ea['shift']());}};_0x8363ca(++_0x44fdf5);}(_0xd881,0x143));var _0x1d88=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xd881[_0x42cae2];return _0x5f256f;};'use strict';var multer=require(_0x1d88('0x0'));var util=require(_0x1d88('0x1'));var path=require(_0x1d88('0x2'));var timeout=require(_0x1d88('0x3'));var express=require(_0x1d88('0x4'));var router=express[_0x1d88('0x5')]();var fs_extra=require(_0x1d88('0x6'));var auth=require(_0x1d88('0x7'));var interaction=require(_0x1d88('0x8'));var config=require('../../config/environment');var controller=require(_0x1d88('0x9'));router[_0x1d88('0xa')]('/',auth[_0x1d88('0xb')](),controller[_0x1d88('0xc')]);router[_0x1d88('0xa')](_0x1d88('0xd'),auth['isAuthenticated'](),controller[_0x1d88('0xe')]);router['post']('/',auth[_0x1d88('0xb')](),controller[_0x1d88('0xf')]);router[_0x1d88('0x10')]('/:id',auth[_0x1d88('0xb')](),controller[_0x1d88('0x11')]);router['delete'](_0x1d88('0xd'),auth[_0x1d88('0xb')](),controller[_0x1d88('0x12')]);module[_0x1d88('0x13')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 4c38de7..771ea9c 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 _0x77ea=['customVariable','keyValue','picklist','STRING','ENUM','sequelize','exports','string','variable'];(function(_0x212bf5,_0x165cbd){var _0xfcad21=function(_0x4a4e6e){while(--_0x4a4e6e){_0x212bf5['push'](_0x212bf5['shift']());}};_0xfcad21(++_0x165cbd);}(_0x77ea,0x10a));var _0xa77e=function(_0x4d7735,_0x3728ea){_0x4d7735=_0x4d7735-0x0;var _0x3517a0=_0x77ea[_0x4d7735];return _0x3517a0;};'use strict';var Sequelize=require(_0xa77e('0x0'));module[_0xa77e('0x1')]={'type':{'type':Sequelize['ENUM'](_0xa77e('0x2'),_0xa77e('0x3'),_0xa77e('0x4'),_0xa77e('0x5'),_0xa77e('0x6')),'defaultValue':_0xa77e('0x2')},'content':{'type':Sequelize[_0xa77e('0x7')]},'key':{'type':Sequelize[_0xa77e('0x7')]},'keyType':{'type':Sequelize[_0xa77e('0x8')](_0xa77e('0x2'),_0xa77e('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0xa77e('0x7')]},'idField':{'type':Sequelize[_0xa77e('0x7')]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9467=['picklist','STRING','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x278208,_0x5a0144){var _0x3023d5=function(_0x22e777){while(--_0x22e777){_0x278208['push'](_0x278208['shift']());}};_0x3023d5(++_0x5a0144);}(_0x9467,0x11a));var _0x7946=function(_0x44307d,_0x421ed6){_0x44307d=_0x44307d-0x0;var _0x5c67ae=_0x9467[_0x44307d];return _0x5c67ae;};'use strict';var Sequelize=require(_0x7946('0x0'));module[_0x7946('0x1')]={'type':{'type':Sequelize[_0x7946('0x2')](_0x7946('0x3'),_0x7946('0x4'),_0x7946('0x5'),'keyValue',_0x7946('0x6')),'defaultValue':_0x7946('0x3')},'content':{'type':Sequelize[_0x7946('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x7946('0x2')](_0x7946('0x3'),_0x7946('0x4'),_0x7946('0x5'))},'keyContent':{'type':Sequelize[_0x7946('0x7')]},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize[_0x7946('0x7')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 0ccccfe..de03c5a 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 _0x0698=['bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','destroy','then','stack','name','send','index','map','SalesforceField','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','pick','filter','where','merge','VIRTUAL','includeAll','findAll','rows','catch','include','options','find','create','body','params','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x0698,0x127));var _0x8069=function(_0x7d0183,_0x1b002e){_0x7d0183=_0x7d0183-0x0;var _0x2b8dbf=_0x0698[_0x7d0183];return _0x2b8dbf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8069('0x0'));var zipdir=require(_0x8069('0x1'));var jsonpatch=require(_0x8069('0x2'));var rp=require(_0x8069('0x3'));var moment=require(_0x8069('0x4'));var BPromise=require(_0x8069('0x5'));var Mustache=require(_0x8069('0x6'));var util=require(_0x8069('0x7'));var path=require(_0x8069('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8069('0x9'));var fs=require('fs');var fs_extra=require(_0x8069('0xa'));var _=require(_0x8069('0xb'));var squel=require(_0x8069('0xc'));var crypto=require(_0x8069('0xd'));var jsforce=require(_0x8069('0xe'));var deskjs=require(_0x8069('0xf'));var toCsv=require(_0x8069('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8069('0x11'));var authService=require(_0x8069('0x12'));var qs=require(_0x8069('0x13'));var as=require(_0x8069('0x14'));var hardwareService=require(_0x8069('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x8069('0x16'));var config=require(_0x8069('0x17'));var licenseUtil=require(_0x8069('0x18'));var db=require(_0x8069('0x19'))['db'];function respondWithStatusCode(_0x360fa1,_0xd1b23f){_0xd1b23f=_0xd1b23f||0xcc;return function(_0x458d81){if(_0x458d81){return _0x360fa1[_0x8069('0x1a')](_0xd1b23f);}return _0x360fa1[_0x8069('0x1b')](_0xd1b23f)[_0x8069('0x1c')]();};}function respondWithResult(_0x39e030,_0x4d5a91){_0x4d5a91=_0x4d5a91||0xc8;return function(_0x3aa749){if(_0x3aa749){return _0x39e030['status'](_0x4d5a91)[_0x8069('0x1d')](_0x3aa749);}};}function respondWithFilteredResult(_0x133cbd,_0xd1dfdc){return function(_0x291896){if(_0x291896){var _0x1fc1d4=typeof _0xd1dfdc[_0x8069('0x1e')]===_0x8069('0x1f')&&typeof _0xd1dfdc[_0x8069('0x20')]==='undefined';var _0x1ba3f5=_0x291896[_0x8069('0x21')];var _0x16ae13=_0x1fc1d4?0x0:_0xd1dfdc[_0x8069('0x1e')];var _0xe96516=_0x1fc1d4?_0x291896[_0x8069('0x21')]:_0xd1dfdc[_0x8069('0x1e')]+_0xd1dfdc['limit'];var _0x581957;if(_0xe96516>=_0x1ba3f5){_0xe96516=_0x1ba3f5;_0x581957=0xc8;}else{_0x581957=0xce;}_0x133cbd[_0x8069('0x1b')](_0x581957);return _0x133cbd[_0x8069('0x22')]('Content-Range',_0x16ae13+'-'+_0xe96516+'/'+_0x1ba3f5)[_0x8069('0x1d')](_0x291896);}return null;};}function patchUpdates(_0x4e91c4){return function(_0x51315b){try{jsonpatch[_0x8069('0x23')](_0x51315b,_0x4e91c4,!![]);}catch(_0x11df7e){return BPromise['reject'](_0x11df7e);}return _0x51315b[_0x8069('0x24')]();};}function saveUpdates(_0x1d1abe,_0x314df6){return function(_0x218822){if(_0x218822){return _0x218822[_0x8069('0x25')](_0x1d1abe)['then'](function(_0x2a3dc3){return _0x2a3dc3;});}return null;};}function removeEntity(_0x4e06ed,_0x30ea2f){return function(_0x30e290){if(_0x30e290){return _0x30e290[_0x8069('0x26')]()[_0x8069('0x27')](function(){_0x4e06ed['status'](0xcc)[_0x8069('0x1c')]();});}};}function handleEntityNotFound(_0x1fe413,_0xccbc38){return function(_0x5e7957){if(!_0x5e7957){_0x1fe413[_0x8069('0x1a')](0x194);}return _0x5e7957;};}function handleError(_0x3d0a03,_0x5de60a){_0x5de60a=_0x5de60a||0x1f4;return function(_0x429c59){logger['error'](_0x429c59[_0x8069('0x28')]);if(_0x429c59[_0x8069('0x29')]){delete _0x429c59[_0x8069('0x29')];}_0x3d0a03[_0x8069('0x1b')](_0x5de60a)[_0x8069('0x2a')](_0x429c59);};}exports[_0x8069('0x2b')]=function(_0x320fb5,_0xe32748){var _0x457f58={},_0x306e5b={},_0x2f8182={'count':0x0,'rows':[]};var _0x463102=_[_0x8069('0x2c')](db[_0x8069('0x2d')][_0x8069('0x2e')],function(_0xb207b9){return{'name':_0xb207b9[_0x8069('0x2f')],'type':_0xb207b9[_0x8069('0x30')][_0x8069('0x31')]};});_0x306e5b[_0x8069('0x32')]=_[_0x8069('0x2c')](_0x463102,_0x8069('0x29'));_0x306e5b['query']=_[_0x8069('0x33')](_0x320fb5[_0x8069('0x34')]);_0x306e5b[_0x8069('0x35')]=_[_0x8069('0x36')](_0x306e5b[_0x8069('0x32')],_0x306e5b[_0x8069('0x34')]);_0x457f58['attributes']=_[_0x8069('0x36')](_0x306e5b[_0x8069('0x32')],qs['fields'](_0x320fb5[_0x8069('0x34')][_0x8069('0x37')]));_0x457f58[_0x8069('0x38')]=_0x457f58[_0x8069('0x38')][_0x8069('0x39')]?_0x457f58['attributes']:_0x306e5b[_0x8069('0x32')];if(!_0x320fb5[_0x8069('0x34')][_0x8069('0x3a')]('nolimit')){_0x457f58[_0x8069('0x20')]=qs[_0x8069('0x20')](_0x320fb5['query']['limit']);_0x457f58['offset']=qs[_0x8069('0x1e')](_0x320fb5['query']['offset']);}_0x457f58['order']=qs[_0x8069('0x3b')](_0x320fb5['query']['sort']);_0x457f58['where']=qs['filters'](_[_0x8069('0x3c')](_0x320fb5[_0x8069('0x34')],_0x306e5b[_0x8069('0x35')]),_0x463102);if(_0x320fb5['query'][_0x8069('0x3d')]){_0x457f58[_0x8069('0x3e')]=_[_0x8069('0x3f')](_0x457f58['where'],{'$or':_['map'](_0x463102,function(_0x52d542){if(_0x52d542['type']!==_0x8069('0x40')){var _0x2b7fc1={};_0x2b7fc1[_0x52d542[_0x8069('0x29')]]={'$like':'%'+_0x320fb5[_0x8069('0x34')][_0x8069('0x3d')]+'%'};return _0x2b7fc1;}})});}_0x457f58=_[_0x8069('0x3f')]({},_0x457f58,_0x320fb5['options']);var _0x654f17={'where':_0x457f58[_0x8069('0x3e')]};return db[_0x8069('0x2d')][_0x8069('0x21')](_0x654f17)['then'](function(_0x4c2ef4){_0x2f8182['count']=_0x4c2ef4;if(_0x320fb5[_0x8069('0x34')][_0x8069('0x41')]){_0x457f58['include']=[{'all':!![]}];}return db[_0x8069('0x2d')][_0x8069('0x42')](_0x457f58);})[_0x8069('0x27')](function(_0x355a9d){_0x2f8182[_0x8069('0x43')]=_0x355a9d;return _0x2f8182;})[_0x8069('0x27')](respondWithFilteredResult(_0xe32748,_0x457f58))[_0x8069('0x44')](handleError(_0xe32748,null));};exports['show']=function(_0x3f8954,_0x880140){var _0x7903f0={'raw':!![],'where':{'id':_0x3f8954['params']['id']}},_0x3537da={};_0x3537da['model']=_[_0x8069('0x33')](db['SalesforceField'][_0x8069('0x2e')]);_0x3537da[_0x8069('0x34')]=_[_0x8069('0x33')](_0x3f8954[_0x8069('0x34')]);_0x3537da[_0x8069('0x35')]=_[_0x8069('0x36')](_0x3537da[_0x8069('0x32')],_0x3537da[_0x8069('0x34')]);_0x7903f0[_0x8069('0x38')]=_['intersection'](_0x3537da['model'],qs['fields'](_0x3f8954[_0x8069('0x34')][_0x8069('0x37')]));_0x7903f0[_0x8069('0x38')]=_0x7903f0[_0x8069('0x38')][_0x8069('0x39')]?_0x7903f0[_0x8069('0x38')]:_0x3537da[_0x8069('0x32')];if(_0x3f8954[_0x8069('0x34')]['includeAll']){_0x7903f0[_0x8069('0x45')]=[{'all':!![]}];}_0x7903f0=_['merge']({},_0x7903f0,_0x3f8954[_0x8069('0x46')]);return db[_0x8069('0x2d')][_0x8069('0x47')](_0x7903f0)[_0x8069('0x27')](handleEntityNotFound(_0x880140,null))[_0x8069('0x27')](respondWithResult(_0x880140,null))[_0x8069('0x44')](handleError(_0x880140,null));};exports[_0x8069('0x48')]=function(_0x29b42b,_0x24b5f1){return db[_0x8069('0x2d')][_0x8069('0x48')](_0x29b42b[_0x8069('0x49')],{})[_0x8069('0x27')](respondWithResult(_0x24b5f1,0xc9))['catch'](handleError(_0x24b5f1,null));};exports[_0x8069('0x25')]=function(_0x2a8e24,_0x3ce232){if(_0x2a8e24[_0x8069('0x49')]['id']){delete _0x2a8e24[_0x8069('0x49')]['id'];}return db[_0x8069('0x2d')][_0x8069('0x47')]({'where':{'id':_0x2a8e24[_0x8069('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3ce232,null))[_0x8069('0x27')](saveUpdates(_0x2a8e24[_0x8069('0x49')],null))[_0x8069('0x27')](respondWithResult(_0x3ce232,null))[_0x8069('0x44')](handleError(_0x3ce232,null));};exports[_0x8069('0x26')]=function(_0x4b81c7,_0x376126){return db[_0x8069('0x2d')]['find']({'where':{'id':_0x4b81c7[_0x8069('0x4a')]['id']}})[_0x8069('0x27')](handleEntityNotFound(_0x376126,null))['then'](removeEntity(_0x376126,null))['catch'](handleError(_0x376126,null));}; \ No newline at end of file +var _0x0bcd=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../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','map','SalesforceField','rawAttributes','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','jsforce','desk.js','querystring'];(function(_0x3a39f9,_0x1e9da8){var _0x305044=function(_0x50fcbf){while(--_0x50fcbf){_0x3a39f9['push'](_0x3a39f9['shift']());}};_0x305044(++_0x1e9da8);}(_0x0bcd,0x87));var _0xd0bc=function(_0x2f3ffa,_0xd4b047){_0x2f3ffa=_0x2f3ffa-0x0;var _0x12abdd=_0x0bcd[_0x2f3ffa];return _0x12abdd;};'use strict';var emlformat=require(_0xd0bc('0x0'));var rimraf=require(_0xd0bc('0x1'));var zipdir=require(_0xd0bc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd0bc('0x3'));var moment=require(_0xd0bc('0x4'));var BPromise=require(_0xd0bc('0x5'));var Mustache=require(_0xd0bc('0x6'));var util=require(_0xd0bc('0x7'));var path=require(_0xd0bc('0x8'));var sox=require(_0xd0bc('0x9'));var csv=require(_0xd0bc('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd0bc('0xb'));var crypto=require('crypto');var jsforce=require(_0xd0bc('0xc'));var deskjs=require(_0xd0bc('0xd'));var toCsv=require(_0xd0bc('0xa'));var querystring=require(_0xd0bc('0xe'));var Papa=require(_0xd0bc('0xf'));var Redis=require(_0xd0bc('0x10'));var authService=require(_0xd0bc('0x11'));var qs=require(_0xd0bc('0x12'));var as=require(_0xd0bc('0x13'));var hardwareService=require(_0xd0bc('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xd0bc('0x15'));var config=require(_0xd0bc('0x16'));var licenseUtil=require(_0xd0bc('0x17'));var db=require(_0xd0bc('0x18'))['db'];function respondWithStatusCode(_0x3bac2a,_0x3c4c14){_0x3c4c14=_0x3c4c14||0xcc;return function(_0x12910d){if(_0x12910d){return _0x3bac2a[_0xd0bc('0x19')](_0x3c4c14);}return _0x3bac2a['status'](_0x3c4c14)[_0xd0bc('0x1a')]();};}function respondWithResult(_0x415c95,_0x4d3206){_0x4d3206=_0x4d3206||0xc8;return function(_0x31c862){if(_0x31c862){return _0x415c95[_0xd0bc('0x1b')](_0x4d3206)[_0xd0bc('0x1c')](_0x31c862);}};}function respondWithFilteredResult(_0x5e4c26,_0x1556db){return function(_0x484a98){if(_0x484a98){var _0x3af6ab=typeof _0x1556db[_0xd0bc('0x1d')]===_0xd0bc('0x1e')&&typeof _0x1556db[_0xd0bc('0x1f')]===_0xd0bc('0x1e');var _0x4262f0=_0x484a98[_0xd0bc('0x20')];var _0x1c90d1=_0x3af6ab?0x0:_0x1556db[_0xd0bc('0x1d')];var _0x16847c=_0x3af6ab?_0x484a98[_0xd0bc('0x20')]:_0x1556db[_0xd0bc('0x1d')]+_0x1556db['limit'];var _0x4012c1;if(_0x16847c>=_0x4262f0){_0x16847c=_0x4262f0;_0x4012c1=0xc8;}else{_0x4012c1=0xce;}_0x5e4c26[_0xd0bc('0x1b')](_0x4012c1);return _0x5e4c26[_0xd0bc('0x21')](_0xd0bc('0x22'),_0x1c90d1+'-'+_0x16847c+'/'+_0x4262f0)[_0xd0bc('0x1c')](_0x484a98);}return null;};}function patchUpdates(_0x28392d){return function(_0x56c099){try{jsonpatch['apply'](_0x56c099,_0x28392d,!![]);}catch(_0x488f08){return BPromise[_0xd0bc('0x23')](_0x488f08);}return _0x56c099[_0xd0bc('0x24')]();};}function saveUpdates(_0x412572,_0x299020){return function(_0x2d29db){if(_0x2d29db){return _0x2d29db[_0xd0bc('0x25')](_0x412572)[_0xd0bc('0x26')](function(_0x5c8d92){return _0x5c8d92;});}return null;};}function removeEntity(_0x27c3d1,_0xedac27){return function(_0x2dbab5){if(_0x2dbab5){return _0x2dbab5['destroy']()[_0xd0bc('0x26')](function(){_0x27c3d1[_0xd0bc('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0xb5fae0,_0x564650){return function(_0xdf0268){if(!_0xdf0268){_0xb5fae0[_0xd0bc('0x19')](0x194);}return _0xdf0268;};}function handleError(_0x1c3065,_0x521d8c){_0x521d8c=_0x521d8c||0x1f4;return function(_0x3381e1){logger[_0xd0bc('0x27')](_0x3381e1[_0xd0bc('0x28')]);if(_0x3381e1[_0xd0bc('0x29')]){delete _0x3381e1['name'];}_0x1c3065['status'](_0x521d8c)['send'](_0x3381e1);};}exports['index']=function(_0x3a13aa,_0x2ab8e1){var _0x4114da={},_0x148575={},_0x3d6a4d={'count':0x0,'rows':[]};var _0x20da66=_[_0xd0bc('0x2a')](db[_0xd0bc('0x2b')][_0xd0bc('0x2c')],function(_0x4892ec){return{'name':_0x4892ec['fieldName'],'type':_0x4892ec[_0xd0bc('0x2d')][_0xd0bc('0x2e')]};});_0x148575[_0xd0bc('0x2f')]=_['map'](_0x20da66,'name');_0x148575[_0xd0bc('0x30')]=_[_0xd0bc('0x31')](_0x3a13aa[_0xd0bc('0x30')]);_0x148575['filters']=_['intersection'](_0x148575[_0xd0bc('0x2f')],_0x148575['query']);_0x4114da[_0xd0bc('0x32')]=_[_0xd0bc('0x33')](_0x148575['model'],qs[_0xd0bc('0x34')](_0x3a13aa[_0xd0bc('0x30')]['fields']));_0x4114da[_0xd0bc('0x32')]=_0x4114da[_0xd0bc('0x32')][_0xd0bc('0x35')]?_0x4114da['attributes']:_0x148575[_0xd0bc('0x2f')];if(!_0x3a13aa[_0xd0bc('0x30')][_0xd0bc('0x36')](_0xd0bc('0x37'))){_0x4114da[_0xd0bc('0x1f')]=qs[_0xd0bc('0x1f')](_0x3a13aa[_0xd0bc('0x30')][_0xd0bc('0x1f')]);_0x4114da[_0xd0bc('0x1d')]=qs[_0xd0bc('0x1d')](_0x3a13aa[_0xd0bc('0x30')][_0xd0bc('0x1d')]);}_0x4114da[_0xd0bc('0x38')]=qs[_0xd0bc('0x39')](_0x3a13aa[_0xd0bc('0x30')][_0xd0bc('0x39')]);_0x4114da[_0xd0bc('0x3a')]=qs[_0xd0bc('0x3b')](_['pick'](_0x3a13aa[_0xd0bc('0x30')],_0x148575[_0xd0bc('0x3b')]),_0x20da66);if(_0x3a13aa[_0xd0bc('0x30')][_0xd0bc('0x3c')]){_0x4114da[_0xd0bc('0x3a')]=_[_0xd0bc('0x3d')](_0x4114da[_0xd0bc('0x3a')],{'$or':_[_0xd0bc('0x2a')](_0x20da66,function(_0xf9e4ae){if(_0xf9e4ae[_0xd0bc('0x2d')]!==_0xd0bc('0x3e')){var _0x192f13={};_0x192f13[_0xf9e4ae[_0xd0bc('0x29')]]={'$like':'%'+_0x3a13aa[_0xd0bc('0x30')][_0xd0bc('0x3c')]+'%'};return _0x192f13;}})});}_0x4114da=_['merge']({},_0x4114da,_0x3a13aa[_0xd0bc('0x3f')]);var _0x35a97e={'where':_0x4114da[_0xd0bc('0x3a')]};return db['SalesforceField'][_0xd0bc('0x20')](_0x35a97e)[_0xd0bc('0x26')](function(_0x5d1aca){_0x3d6a4d[_0xd0bc('0x20')]=_0x5d1aca;if(_0x3a13aa['query'][_0xd0bc('0x40')]){_0x4114da[_0xd0bc('0x41')]=[{'all':!![]}];}return db[_0xd0bc('0x2b')][_0xd0bc('0x42')](_0x4114da);})[_0xd0bc('0x26')](function(_0x513c79){_0x3d6a4d[_0xd0bc('0x43')]=_0x513c79;return _0x3d6a4d;})['then'](respondWithFilteredResult(_0x2ab8e1,_0x4114da))[_0xd0bc('0x44')](handleError(_0x2ab8e1,null));};exports[_0xd0bc('0x45')]=function(_0x6ed32e,_0x34ae2e){var _0x249bd6={'raw':!![],'where':{'id':_0x6ed32e[_0xd0bc('0x46')]['id']}},_0x177ccd={};_0x177ccd['model']=_[_0xd0bc('0x31')](db[_0xd0bc('0x2b')][_0xd0bc('0x2c')]);_0x177ccd['query']=_[_0xd0bc('0x31')](_0x6ed32e['query']);_0x177ccd[_0xd0bc('0x3b')]=_[_0xd0bc('0x33')](_0x177ccd['model'],_0x177ccd[_0xd0bc('0x30')]);_0x249bd6[_0xd0bc('0x32')]=_[_0xd0bc('0x33')](_0x177ccd[_0xd0bc('0x2f')],qs[_0xd0bc('0x34')](_0x6ed32e[_0xd0bc('0x30')][_0xd0bc('0x34')]));_0x249bd6[_0xd0bc('0x32')]=_0x249bd6[_0xd0bc('0x32')]['length']?_0x249bd6['attributes']:_0x177ccd['model'];if(_0x6ed32e[_0xd0bc('0x30')][_0xd0bc('0x40')]){_0x249bd6[_0xd0bc('0x41')]=[{'all':!![]}];}_0x249bd6=_[_0xd0bc('0x3d')]({},_0x249bd6,_0x6ed32e[_0xd0bc('0x3f')]);return db[_0xd0bc('0x2b')][_0xd0bc('0x47')](_0x249bd6)[_0xd0bc('0x26')](handleEntityNotFound(_0x34ae2e,null))['then'](respondWithResult(_0x34ae2e,null))[_0xd0bc('0x44')](handleError(_0x34ae2e,null));};exports[_0xd0bc('0x48')]=function(_0x81961,_0x126477){return db[_0xd0bc('0x2b')][_0xd0bc('0x48')](_0x81961['body'],{})[_0xd0bc('0x26')](respondWithResult(_0x126477,0xc9))[_0xd0bc('0x44')](handleError(_0x126477,null));};exports[_0xd0bc('0x25')]=function(_0x1553cc,_0x316893){if(_0x1553cc[_0xd0bc('0x49')]['id']){delete _0x1553cc[_0xd0bc('0x49')]['id'];}return db[_0xd0bc('0x2b')][_0xd0bc('0x47')]({'where':{'id':_0x1553cc[_0xd0bc('0x46')]['id']}})[_0xd0bc('0x26')](handleEntityNotFound(_0x316893,null))[_0xd0bc('0x26')](saveUpdates(_0x1553cc[_0xd0bc('0x49')],null))[_0xd0bc('0x26')](respondWithResult(_0x316893,null))[_0xd0bc('0x44')](handleError(_0x316893,null));};exports[_0xd0bc('0x4a')]=function(_0x46c5e2,_0x43ef2b){return db['SalesforceField'][_0xd0bc('0x47')]({'where':{'id':_0x46c5e2[_0xd0bc('0x46')]['id']}})[_0xd0bc('0x26')](handleEntityNotFound(_0x43ef2b,null))[_0xd0bc('0x26')](removeEntity(_0x43ef2b,null))[_0xd0bc('0x44')](handleError(_0x43ef2b,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 7099f85..a3d1f6a 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 _0xa80b=['util','../../config/logger','moment','bluebird','path','../../config/environment','./intSalesforceField.attributes','exports','define','SalesforceField','int_salesforce_fields','idField','FieldId'];(function(_0x39b130,_0xee6166){var _0x3613c0=function(_0x28a0f7){while(--_0x28a0f7){_0x39b130['push'](_0x39b130['shift']());}};_0x3613c0(++_0xee6166);}(_0xa80b,0x8f));var _0xba80=function(_0x43cf8f,_0x1c436c){_0x43cf8f=_0x43cf8f-0x0;var _0x928a69=_0xa80b[_0x43cf8f];return _0x928a69;};'use strict';var _=require('lodash');var util=require(_0xba80('0x0'));var logger=require(_0xba80('0x1'))('api');var moment=require(_0xba80('0x2'));var BPromise=require(_0xba80('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xba80('0x4'));var rimraf=require('rimraf');var config=require(_0xba80('0x5'));var attributes=require(_0xba80('0x6'));module[_0xba80('0x7')]=function(_0x5d8069,_0x5a211f){return _0x5d8069[_0xba80('0x8')](_0xba80('0x9'),attributes,{'tableName':_0xba80('0xa'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0xba80('0xb'),_0xba80('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa4c7=['path','rimraf','../../config/environment','./intSalesforceField.attributes','exports','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','moment','bluebird','request-promise'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xa4c7,0x193));var _0x7a4c=function(_0x3ab0e1,_0x2b6b2a){_0x3ab0e1=_0x3ab0e1-0x0;var _0x17b039=_0xa4c7[_0x3ab0e1];return _0x17b039;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x7a4c('0x0'));var BPromise=require(_0x7a4c('0x1'));var rp=require(_0x7a4c('0x2'));var fs=require('fs');var path=require(_0x7a4c('0x3'));var rimraf=require(_0x7a4c('0x4'));var config=require(_0x7a4c('0x5'));var attributes=require(_0x7a4c('0x6'));module[_0x7a4c('0x7')]=function(_0x2bd2e8,_0x5b6c26){return _0x2bd2e8[_0x7a4c('0x8')](_0x7a4c('0x9'),attributes,{'tableName':_0x7a4c('0xa'),'paranoid':![],'indexes':[{'name':_0x7a4c('0xb'),'fields':[_0x7a4c('0xc'),_0x7a4c('0xd')],'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 c06edde..7b3f89e 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 _0xfc1d=['error','code','SalesforceField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xfc1d,0xae));var _0xdfc1=function(_0x347db7,_0x54d139){_0x347db7=_0x347db7-0x0;var _0x333418=_0xfc1d[_0x347db7];return _0x333418;};'use strict';var _=require(_0xdfc1('0x0'));var util=require(_0xdfc1('0x1'));var moment=require(_0xdfc1('0x2'));var BPromise=require(_0xdfc1('0x3'));var rs=require(_0xdfc1('0x4'));var fs=require('fs');var Redis=require(_0xdfc1('0x5'));var db=require(_0xdfc1('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdfc1('0x7'));var config=require(_0xdfc1('0x8'));var jayson=require(_0xdfc1('0x9'));var client=jayson[_0xdfc1('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x51463a,_0x204096,_0x316afc){return new BPromise(function(_0x2c9617,_0x513cdb){return client[_0xdfc1('0xb')](_0x51463a,_0x316afc)[_0xdfc1('0xc')](function(_0x2d8980){logger[_0xdfc1('0xd')]('SalesforceField,\x20%s,\x20%s',_0x204096,_0xdfc1('0xe'));logger[_0xdfc1('0xf')](_0xdfc1('0x10'),_0x204096,_0xdfc1('0xe'),JSON[_0xdfc1('0x11')](_0x2d8980));if(_0x2d8980[_0xdfc1('0x12')]){if(_0x2d8980[_0xdfc1('0x12')][_0xdfc1('0x13')]===0x1f4){logger[_0xdfc1('0x12')](_0xdfc1('0x14'),_0x204096,_0x2d8980[_0xdfc1('0x12')][_0xdfc1('0x15')]);return _0x513cdb(_0x2d8980['error'][_0xdfc1('0x15')]);}logger[_0xdfc1('0x12')](_0xdfc1('0x14'),_0x204096,_0x2d8980['error']['message']);return _0x2c9617(_0x2d8980[_0xdfc1('0x12')]['message']);}else{logger[_0xdfc1('0xd')]('SalesforceField,\x20%s,\x20%s',_0x204096,_0xdfc1('0xe'));_0x2c9617(_0x2d8980[_0xdfc1('0x16')][_0xdfc1('0x15')]);}})[_0xdfc1('0x17')](function(_0xea9bad){logger[_0xdfc1('0x12')](_0xdfc1('0x14'),_0x204096,_0xea9bad);_0x513cdb(_0xea9bad);});});} \ No newline at end of file +var _0x96df=['message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','then','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x5109d4,_0x546e83){var _0x5e77ea=function(_0x1d816f){while(--_0x1d816f){_0x5109d4['push'](_0x5109d4['shift']());}};_0x5e77ea(++_0x546e83);}(_0x96df,0x88));var _0xf96d=function(_0x27d443,_0x4ee5ec){_0x27d443=_0x27d443-0x0;var _0x21b822=_0x96df[_0x27d443];return _0x21b822;};'use strict';var _=require(_0xf96d('0x0'));var util=require(_0xf96d('0x1'));var moment=require(_0xf96d('0x2'));var BPromise=require(_0xf96d('0x3'));var rs=require(_0xf96d('0x4'));var fs=require('fs');var Redis=require(_0xf96d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf96d('0x6'));var logger=require(_0xf96d('0x7'))(_0xf96d('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf96d('0x9')][_0xf96d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1050da,_0x4dbac0,_0x1f44d7){return new BPromise(function(_0x70aef2,_0x3030d3){return client['request'](_0x1050da,_0x1f44d7)[_0xf96d('0xb')](function(_0x2d3480){logger['info'](_0xf96d('0xc'),_0x4dbac0,_0xf96d('0xd'));logger[_0xf96d('0xe')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x4dbac0,_0xf96d('0xd'),JSON[_0xf96d('0xf')](_0x2d3480));if(_0x2d3480[_0xf96d('0x10')]){if(_0x2d3480[_0xf96d('0x10')][_0xf96d('0x11')]===0x1f4){logger[_0xf96d('0x10')]('SalesforceField,\x20%s,\x20%s',_0x4dbac0,_0x2d3480[_0xf96d('0x10')][_0xf96d('0x12')]);return _0x3030d3(_0x2d3480['error'][_0xf96d('0x12')]);}logger['error'](_0xf96d('0xc'),_0x4dbac0,_0x2d3480[_0xf96d('0x10')]['message']);return _0x70aef2(_0x2d3480['error']['message']);}else{logger[_0xf96d('0x13')](_0xf96d('0xc'),_0x4dbac0,'request\x20sent');_0x70aef2(_0x2d3480[_0xf96d('0x14')][_0xf96d('0x12')]);}})[_0xf96d('0x15')](function(_0x434248){logger[_0xf96d('0x10')](_0xf96d('0xc'),_0x4dbac0,_0x434248);_0x3030d3(_0x434248);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index cf07158..779dc3a 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 _0xe559=['get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','getFields','post','addConfiguration','put','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','./intServicenowAccount.controller'];(function(_0x2cc166,_0x5c4b97){var _0x583751=function(_0x255349){while(--_0x255349){_0x2cc166['push'](_0x2cc166['shift']());}};_0x583751(++_0x5c4b97);}(_0xe559,0xc1));var _0x9e55=function(_0x5716b4,_0x5482c2){_0x5716b4=_0x5716b4-0x0;var _0x307cb3=_0xe559[_0x5716b4];return _0x307cb3;};'use strict';var multer=require(_0x9e55('0x0'));var util=require(_0x9e55('0x1'));var path=require('path');var timeout=require(_0x9e55('0x2'));var express=require(_0x9e55('0x3'));var router=express[_0x9e55('0x4')]();var fs_extra=require(_0x9e55('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9e55('0x6'));router[_0x9e55('0x7')]('/',auth[_0x9e55('0x8')](),controller['index']);router['get'](_0x9e55('0x9'),auth['isAuthenticated'](),controller[_0x9e55('0xa')]);router[_0x9e55('0x7')](_0x9e55('0xb'),auth[_0x9e55('0x8')](),controller[_0x9e55('0xc')]);router[_0x9e55('0x7')]('/:id/fields',auth[_0x9e55('0x8')](),controller[_0x9e55('0xd')]);router[_0x9e55('0xe')]('/',auth[_0x9e55('0x8')](),controller['create']);router[_0x9e55('0xe')](_0x9e55('0xb'),auth[_0x9e55('0x8')](),controller[_0x9e55('0xf')]);router[_0x9e55('0x10')](_0x9e55('0x9'),auth[_0x9e55('0x8')](),controller[_0x9e55('0x11')]);router[_0x9e55('0x12')](_0x9e55('0x9'),auth[_0x9e55('0x8')](),controller[_0x9e55('0x13')]);module['exports']=router; \ No newline at end of file +var _0xe3d7=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','getConfigurations','/:id/fields','post','create','addConfiguration','put','update','delete','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x86b219,_0x43038f){var _0x1f320c=function(_0x8cd63f){while(--_0x8cd63f){_0x86b219['push'](_0x86b219['shift']());}};_0x1f320c(++_0x43038f);}(_0xe3d7,0xf6));var _0x7e3d=function(_0x58d61a,_0x464877){_0x58d61a=_0x58d61a-0x0;var _0xc5a485=_0xe3d7[_0x58d61a];return _0xc5a485;};'use strict';var multer=require(_0x7e3d('0x0'));var util=require(_0x7e3d('0x1'));var path=require('path');var timeout=require(_0x7e3d('0x2'));var express=require(_0x7e3d('0x3'));var router=express['Router']();var fs_extra=require(_0x7e3d('0x4'));var auth=require(_0x7e3d('0x5'));var interaction=require(_0x7e3d('0x6'));var config=require(_0x7e3d('0x7'));var controller=require('./intServicenowAccount.controller');router[_0x7e3d('0x8')]('/',auth[_0x7e3d('0x9')](),controller[_0x7e3d('0xa')]);router[_0x7e3d('0x8')](_0x7e3d('0xb'),auth[_0x7e3d('0x9')](),controller['show']);router[_0x7e3d('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x7e3d('0xc')]);router[_0x7e3d('0x8')](_0x7e3d('0xd'),auth[_0x7e3d('0x9')](),controller['getFields']);router[_0x7e3d('0xe')]('/',auth[_0x7e3d('0x9')](),controller[_0x7e3d('0xf')]);router[_0x7e3d('0xe')]('/:id/configurations',auth[_0x7e3d('0x9')](),controller[_0x7e3d('0x10')]);router[_0x7e3d('0x11')](_0x7e3d('0xb'),auth[_0x7e3d('0x9')](),controller[_0x7e3d('0x12')]);router[_0x7e3d('0x13')](_0x7e3d('0xb'),auth[_0x7e3d('0x9')](),controller['destroy']);module[_0x7e3d('0x14')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index f2452aa..6212cf0 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 _0xf404=['exports','STRING','remoteUri','sequelize'];(function(_0x4a7920,_0x97e71b){var _0x2a9575=function(_0x26824e){while(--_0x26824e){_0x4a7920['push'](_0x4a7920['shift']());}};_0x2a9575(++_0x97e71b);}(_0xf404,0x83));var _0x4f40=function(_0x271da7,_0x4ce38d){_0x271da7=_0x271da7-0x0;var _0x4267b5=_0xf404[_0x271da7];return _0x4267b5;};'use strict';var Sequelize=require(_0x4f40('0x0'));module[_0x4f40('0x1')]={'name':{'type':Sequelize[_0x4f40('0x2')]},'description':{'type':Sequelize[_0x4f40('0x2')]},'username':{'type':Sequelize[_0x4f40('0x2')],'unique':'username'},'password':{'type':Sequelize[_0x4f40('0x2')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x4f40('0x2')],'unique':_0x4f40('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0xbe85=['STRING','username','remoteUri','exports'];(function(_0x669461,_0x40a5a5){var _0x127a14=function(_0x476f85){while(--_0x476f85){_0x669461['push'](_0x669461['shift']());}};_0x127a14(++_0x40a5a5);}(_0xbe85,0x137));var _0x5be8=function(_0x5095c7,_0x483b08){_0x5095c7=_0x5095c7-0x0;var _0x3ed658=_0xbe85[_0x5095c7];return _0x3ed658;};'use strict';var Sequelize=require('sequelize');module[_0x5be8('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5be8('0x1')]},'username':{'type':Sequelize[_0x5be8('0x1')],'unique':_0x5be8('0x2')},'password':{'type':Sequelize[_0x5be8('0x1')]},'email':{'type':Sequelize[_0x5be8('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x5be8('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index 7cc0c46..be248a4 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 _0xc210=['squel','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../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','reject','update','then','error','stack','name','send','index','ServicenowAccount','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','params','catch','create','body','find','getConfigurations','findOne','ServicenowConfiguration','addConfiguration','AccountId','getSubjects','channel','Descriptions','ServicenowField','getFields','made_sla','subcategory','close_code','severity','category','parent','caused_by','watch_list','child_incidents','hold_reason','number','resolved_by','opened_by','user_input','sys_created_on','sys_domain','state','sys_created_by','knowledge','calendar_stc','closed_at','delivery_plan','impact','active','business_service','priority','sys_domain_path','rfc','time_worked','opened_at','business_duration','group_list','reopened_time','resolved_at','caller_id','approval_set','short_description','correlation_display','delivery_task','assignment_group','description','calendar_duration','sys_class_name','closed_by','follow_up','parent_incident','sys_id','reopened_by','incident_state','problem_id','reassignment_count','activity_due','comments','sla_due','approval','due_date','sys_mod_count','sys_tags','escalation','correlation_id','location','username','password','email','serverUrl','remoteUri','substring','lastIndexOf','%s/api/now/doc/table/schema/','incident?sysparm_display_value=all','result','log','remove','forEach','label','push','all','assign','TCL:\x20_object','includes','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','internalType','concat','test','statusCode','Wrong\x20credentials','boolean','true','false','GET','sys_choice?sysparm_query=name=incident^element=','inactive','value','eml-format','rimraf','fast-json-patch','request-promise','bluebird','path','sox','ejs'];(function(_0x409f5b,_0x1aed80){var _0x150a2b=function(_0x4a2442){while(--_0x4a2442){_0x409f5b['push'](_0x409f5b['shift']());}};_0x150a2b(++_0x1aed80);}(_0xc210,0x15a));var _0x0c21=function(_0xf3ae5e,_0x385757){_0xf3ae5e=_0xf3ae5e-0x0;var _0x353c92=_0xc210[_0xf3ae5e];return _0x353c92;};'use strict';var emlformat=require(_0x0c21('0x0'));var rimraf=require(_0x0c21('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0c21('0x2'));var rp=require(_0x0c21('0x3'));var moment=require('moment');var BPromise=require(_0x0c21('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x0c21('0x5'));var sox=require(_0x0c21('0x6'));var csv=require('to-csv');var ejs=require(_0x0c21('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x0c21('0x8'));var crypto=require('crypto');var jsforce=require(_0x0c21('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x0c21('0xa'));var querystring=require(_0x0c21('0xb'));var Papa=require(_0x0c21('0xc'));var Redis=require('ioredis');var authService=require(_0x0c21('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x0c21('0xe'));var hardwareService=require(_0x0c21('0xf'));var logger=require(_0x0c21('0x10'))(_0x0c21('0x11'));var utils=require(_0x0c21('0x12'));var config=require(_0x0c21('0x13'));var licenseUtil=require(_0x0c21('0x14'));var db=require(_0x0c21('0x15'))['db'];var integrations=require(_0x0c21('0x16'));function respondWithStatusCode(_0x4e9554,_0xa3d470){_0xa3d470=_0xa3d470||0xcc;return function(_0x2cf7e7){if(_0x2cf7e7){return _0x4e9554[_0x0c21('0x17')](_0xa3d470);}return _0x4e9554[_0x0c21('0x18')](_0xa3d470)[_0x0c21('0x19')]();};}function respondWithResult(_0x9ba51a,_0x886bf7){_0x886bf7=_0x886bf7||0xc8;return function(_0x3dc348){if(_0x3dc348){return _0x9ba51a[_0x0c21('0x18')](_0x886bf7)[_0x0c21('0x1a')](_0x3dc348);}};}function respondWithFilteredResult(_0x477ee3,_0xc2f6f5){return function(_0x3f3441){if(_0x3f3441){var _0x4ce626=typeof _0xc2f6f5[_0x0c21('0x1b')]===_0x0c21('0x1c')&&typeof _0xc2f6f5[_0x0c21('0x1d')]===_0x0c21('0x1c');var _0x427782=_0x3f3441[_0x0c21('0x1e')];var _0x49132b=_0x4ce626?0x0:_0xc2f6f5[_0x0c21('0x1b')];var _0x1e08ab=_0x4ce626?_0x3f3441[_0x0c21('0x1e')]:_0xc2f6f5['offset']+_0xc2f6f5[_0x0c21('0x1d')];var _0x4e21ba;if(_0x1e08ab>=_0x427782){_0x1e08ab=_0x427782;_0x4e21ba=0xc8;}else{_0x4e21ba=0xce;}_0x477ee3[_0x0c21('0x18')](_0x4e21ba);return _0x477ee3[_0x0c21('0x1f')](_0x0c21('0x20'),_0x49132b+'-'+_0x1e08ab+'/'+_0x427782)[_0x0c21('0x1a')](_0x3f3441);}return null;};}function patchUpdates(_0x1b8b9b){return function(_0x45f7b6){try{jsonpatch['apply'](_0x45f7b6,_0x1b8b9b,!![]);}catch(_0x14dbc5){return BPromise[_0x0c21('0x21')](_0x14dbc5);}return _0x45f7b6['save']();};}function saveUpdates(_0x192b92,_0x500a24){return function(_0xdd0a13){if(_0xdd0a13){return _0xdd0a13[_0x0c21('0x22')](_0x192b92)[_0x0c21('0x23')](function(_0x213ec9){return _0x213ec9;});}return null;};}function removeEntity(_0x340a43,_0x504a4e){return function(_0x1c03ae){if(_0x1c03ae){return _0x1c03ae['destroy']()[_0x0c21('0x23')](function(){_0x340a43[_0x0c21('0x18')](0xcc)[_0x0c21('0x19')]();});}};}function handleEntityNotFound(_0x19c19d,_0x27b91c){return function(_0x4493c8){if(!_0x4493c8){_0x19c19d['sendStatus'](0x194);}return _0x4493c8;};}function handleError(_0x578c52,_0x539c93){_0x539c93=_0x539c93||0x1f4;return function(_0x4c4c98){logger[_0x0c21('0x24')](_0x4c4c98[_0x0c21('0x25')]);if(_0x4c4c98[_0x0c21('0x26')]){delete _0x4c4c98[_0x0c21('0x26')];}_0x578c52[_0x0c21('0x18')](_0x539c93)[_0x0c21('0x27')](_0x4c4c98);};}exports[_0x0c21('0x28')]=function(_0x45c040,_0x3b2a6b){var _0x481fdb={},_0x1271e5={},_0x13404e={'count':0x0,'rows':[]};var _0x48d65b=_['map'](db[_0x0c21('0x29')][_0x0c21('0x2a')],function(_0x2afcc7){return{'name':_0x2afcc7[_0x0c21('0x2b')],'type':_0x2afcc7[_0x0c21('0x2c')][_0x0c21('0x2d')]};});_0x1271e5['model']=_[_0x0c21('0x2e')](_0x48d65b,_0x0c21('0x26'));_0x1271e5[_0x0c21('0x2f')]=_[_0x0c21('0x30')](_0x45c040[_0x0c21('0x2f')]);_0x1271e5[_0x0c21('0x31')]=_[_0x0c21('0x32')](_0x1271e5[_0x0c21('0x33')],_0x1271e5['query']);_0x481fdb['attributes']=_[_0x0c21('0x32')](_0x1271e5[_0x0c21('0x33')],qs[_0x0c21('0x34')](_0x45c040[_0x0c21('0x2f')][_0x0c21('0x34')]));_0x481fdb[_0x0c21('0x35')]=_0x481fdb[_0x0c21('0x35')][_0x0c21('0x36')]?_0x481fdb[_0x0c21('0x35')]:_0x1271e5[_0x0c21('0x33')];if(!_0x45c040[_0x0c21('0x2f')][_0x0c21('0x37')](_0x0c21('0x38'))){_0x481fdb[_0x0c21('0x1d')]=qs['limit'](_0x45c040[_0x0c21('0x2f')][_0x0c21('0x1d')]);_0x481fdb['offset']=qs[_0x0c21('0x1b')](_0x45c040[_0x0c21('0x2f')][_0x0c21('0x1b')]);}_0x481fdb[_0x0c21('0x39')]=qs[_0x0c21('0x3a')](_0x45c040[_0x0c21('0x2f')][_0x0c21('0x3a')]);_0x481fdb['where']=qs[_0x0c21('0x31')](_[_0x0c21('0x3b')](_0x45c040[_0x0c21('0x2f')],_0x1271e5['filters']),_0x48d65b);if(_0x45c040[_0x0c21('0x2f')][_0x0c21('0x3c')]){_0x481fdb['where']=_[_0x0c21('0x3d')](_0x481fdb[_0x0c21('0x3e')],{'$or':_[_0x0c21('0x2e')](_0x48d65b,function(_0x216122){if(_0x216122[_0x0c21('0x2c')]!==_0x0c21('0x3f')){var _0x53fd28={};_0x53fd28[_0x216122[_0x0c21('0x26')]]={'$like':'%'+_0x45c040[_0x0c21('0x2f')]['filter']+'%'};return _0x53fd28;}})});}_0x481fdb=_['merge']({},_0x481fdb,_0x45c040[_0x0c21('0x40')]);var _0x515827={'where':_0x481fdb[_0x0c21('0x3e')]};return db[_0x0c21('0x29')][_0x0c21('0x1e')](_0x515827)[_0x0c21('0x23')](function(_0x4c323a){_0x13404e[_0x0c21('0x1e')]=_0x4c323a;if(_0x45c040['query'][_0x0c21('0x41')]){_0x481fdb[_0x0c21('0x42')]=[{'all':!![]}];}return db['ServicenowAccount'][_0x0c21('0x43')](_0x481fdb);})[_0x0c21('0x23')](function(_0x290782){_0x13404e[_0x0c21('0x44')]=_0x290782;return _0x13404e;})[_0x0c21('0x23')](respondWithFilteredResult(_0x3b2a6b,_0x481fdb))['catch'](handleError(_0x3b2a6b,null));};exports['show']=function(_0x51e2ec,_0x2a83f0){var _0x2e30f7={'raw':![],'where':{'id':_0x51e2ec[_0x0c21('0x45')]['id']}},_0x9432f8={};_0x9432f8['model']=_['keys'](db[_0x0c21('0x29')][_0x0c21('0x2a')]);_0x9432f8[_0x0c21('0x2f')]=_[_0x0c21('0x30')](_0x51e2ec[_0x0c21('0x2f')]);_0x9432f8[_0x0c21('0x31')]=_[_0x0c21('0x32')](_0x9432f8[_0x0c21('0x33')],_0x9432f8['query']);_0x2e30f7[_0x0c21('0x35')]=_['intersection'](_0x9432f8[_0x0c21('0x33')],qs[_0x0c21('0x34')](_0x51e2ec[_0x0c21('0x2f')][_0x0c21('0x34')]));_0x2e30f7[_0x0c21('0x35')]=_0x2e30f7[_0x0c21('0x35')][_0x0c21('0x36')]?_0x2e30f7[_0x0c21('0x35')]:_0x9432f8['model'];if(_0x51e2ec[_0x0c21('0x2f')][_0x0c21('0x41')]){_0x2e30f7['include']=[{'all':!![]}];}_0x2e30f7=_[_0x0c21('0x3d')]({},_0x2e30f7,_0x51e2ec[_0x0c21('0x40')]);return db[_0x0c21('0x29')]['find'](_0x2e30f7)[_0x0c21('0x23')](handleEntityNotFound(_0x2a83f0,null))[_0x0c21('0x23')](respondWithResult(_0x2a83f0,null))[_0x0c21('0x46')](handleError(_0x2a83f0,null));};exports[_0x0c21('0x47')]=function(_0x41f4ed,_0x4c88f3){return db[_0x0c21('0x29')][_0x0c21('0x47')](_0x41f4ed['body'],{})[_0x0c21('0x23')](respondWithResult(_0x4c88f3,0xc9))[_0x0c21('0x46')](handleError(_0x4c88f3,null));};exports[_0x0c21('0x22')]=function(_0x433418,_0xc159e6){if(_0x433418[_0x0c21('0x48')]['id']){delete _0x433418['body']['id'];}return db[_0x0c21('0x29')][_0x0c21('0x49')]({'where':{'id':_0x433418[_0x0c21('0x45')]['id']}})[_0x0c21('0x23')](handleEntityNotFound(_0xc159e6,null))[_0x0c21('0x23')](saveUpdates(_0x433418[_0x0c21('0x48')],null))[_0x0c21('0x23')](respondWithResult(_0xc159e6,null))[_0x0c21('0x46')](handleError(_0xc159e6,null));};exports['destroy']=function(_0x32836a,_0x554b7a){return db[_0x0c21('0x29')][_0x0c21('0x49')]({'where':{'id':_0x32836a[_0x0c21('0x45')]['id']}})['then'](handleEntityNotFound(_0x554b7a,null))[_0x0c21('0x23')](removeEntity(_0x554b7a,null))['catch'](handleError(_0x554b7a,null));};exports[_0x0c21('0x4a')]=function(_0x15c4b7,_0x3c5258,_0x13a44c){var _0x51c332={};var _0x459cd8={};var _0x1cf07d;var _0x11a649;return db['ServicenowAccount'][_0x0c21('0x4b')]({'where':{'id':_0x15c4b7['params']['id']}})[_0x0c21('0x23')](handleEntityNotFound(_0x3c5258,null))[_0x0c21('0x23')](function(_0x554fd3){if(_0x554fd3){_0x1cf07d=_0x554fd3;_0x459cd8[_0x0c21('0x33')]=_[_0x0c21('0x30')](db[_0x0c21('0x4c')][_0x0c21('0x2a')]);_0x459cd8[_0x0c21('0x2f')]=_[_0x0c21('0x30')](_0x15c4b7[_0x0c21('0x2f')]);_0x459cd8['filters']=_[_0x0c21('0x32')](_0x459cd8['model'],_0x459cd8[_0x0c21('0x2f')]);_0x51c332['attributes']=_[_0x0c21('0x32')](_0x459cd8['model'],qs[_0x0c21('0x34')](_0x15c4b7[_0x0c21('0x2f')][_0x0c21('0x34')]));_0x51c332[_0x0c21('0x35')]=_0x51c332[_0x0c21('0x35')][_0x0c21('0x36')]?_0x51c332[_0x0c21('0x35')]:_0x459cd8[_0x0c21('0x33')];_0x51c332[_0x0c21('0x39')]=qs['sort'](_0x15c4b7[_0x0c21('0x2f')][_0x0c21('0x3a')]);_0x51c332[_0x0c21('0x3e')]=qs[_0x0c21('0x31')](_[_0x0c21('0x3b')](_0x15c4b7[_0x0c21('0x2f')],_0x459cd8[_0x0c21('0x31')]));if(_0x15c4b7[_0x0c21('0x2f')][_0x0c21('0x3c')]){_0x51c332[_0x0c21('0x3e')]=_['merge'](_0x51c332[_0x0c21('0x3e')],{'$or':_[_0x0c21('0x2e')](_0x51c332['attributes'],function(_0x2a185d){var _0x2c1e12={};_0x2c1e12[_0x2a185d]={'$like':'%'+_0x15c4b7[_0x0c21('0x2f')][_0x0c21('0x3c')]+'%'};return _0x2c1e12;})});}_0x51c332=_[_0x0c21('0x3d')]({},_0x51c332,_0x15c4b7[_0x0c21('0x40')]);return _0x1cf07d['getConfigurations'](_0x51c332);}})[_0x0c21('0x23')](function(_0x12dfde){if(_0x12dfde){_0x11a649=_0x12dfde['length'];if(!_0x15c4b7[_0x0c21('0x2f')][_0x0c21('0x37')]('nolimit')){_0x51c332[_0x0c21('0x1d')]=qs[_0x0c21('0x1d')](_0x15c4b7['query'][_0x0c21('0x1d')]);_0x51c332['offset']=qs['offset'](_0x15c4b7[_0x0c21('0x2f')][_0x0c21('0x1b')]);}return _0x1cf07d[_0x0c21('0x4a')](_0x51c332);}})[_0x0c21('0x23')](function(_0x3eb5ee){if(_0x3eb5ee){return _0x3eb5ee?{'count':_0x11a649,'rows':_0x3eb5ee}:null;}})[_0x0c21('0x23')](respondWithResult(_0x3c5258,null))[_0x0c21('0x46')](handleError(_0x3c5258,null));};exports[_0x0c21('0x4d')]=function(_0x53cdc3,_0x2faa72,_0x45870d){if(_0x53cdc3['body']['id']){delete _0x53cdc3[_0x0c21('0x48')]['id'];}return db[_0x0c21('0x29')][_0x0c21('0x4b')]({'where':{'id':_0x53cdc3[_0x0c21('0x45')]['id']}})[_0x0c21('0x23')](handleEntityNotFound(_0x2faa72,null))[_0x0c21('0x23')](function(_0x1279d4){if(_0x1279d4){_0x53cdc3[_0x0c21('0x48')][_0x0c21('0x4e')]=_0x1279d4['id'];_0x53cdc3[_0x0c21('0x48')]['Subjects']=integrations[_0x0c21('0x4f')](_0x53cdc3['body'][_0x0c21('0x50')],_0x53cdc3[_0x0c21('0x48')][_0x0c21('0x2c')]);_0x53cdc3[_0x0c21('0x48')][_0x0c21('0x51')]=integrations['getDescriptions'](_0x53cdc3[_0x0c21('0x48')][_0x0c21('0x50')],_0x53cdc3[_0x0c21('0x48')][_0x0c21('0x2c')]);return db[_0x0c21('0x4c')][_0x0c21('0x47')](_0x53cdc3[_0x0c21('0x48')],{'include':[{'model':db[_0x0c21('0x52')],'as':'Subjects'},{'model':db['ServicenowField'],'as':_0x0c21('0x51')}]});}return null;})['then'](respondWithResult(_0x2faa72,null))[_0x0c21('0x46')](handleError(_0x2faa72,null));};exports[_0x0c21('0x53')]=function(_0x392c03,_0x4b428b,_0x40a98e){var _0xb1acac=[_0x0c21('0x54'),'hold_reason','knowledge',_0x0c21('0x55'),_0x0c21('0x56'),'notify','incident_state',_0x0c21('0x57'),_0x0c21('0x58')];var _0x1a7636=[_0x0c21('0x59'),'made_sla',_0x0c21('0x5a'),_0x0c21('0x5b'),'upon_reject','sys_updated_on',_0x0c21('0x5c'),_0x0c21('0x5d'),'approval_history',_0x0c21('0x5e'),_0x0c21('0x5f'),'sys_updated_by',_0x0c21('0x60'),_0x0c21('0x61'),_0x0c21('0x62'),_0x0c21('0x63'),_0x0c21('0x64'),_0x0c21('0x65'),_0x0c21('0x66'),_0x0c21('0x39'),_0x0c21('0x67'),_0x0c21('0x68'),'cmdb_ci',_0x0c21('0x69'),_0x0c21('0x6a'),_0x0c21('0x6b'),'work_notes_list',_0x0c21('0x6c'),_0x0c21('0x6d'),_0x0c21('0x6e'),_0x0c21('0x6f'),_0x0c21('0x70'),'expected_start',_0x0c21('0x71'),_0x0c21('0x72'),_0x0c21('0x73'),'work_end',_0x0c21('0x74'),_0x0c21('0x75'),_0x0c21('0x76'),_0x0c21('0x77'),_0x0c21('0x55'),'work_notes',_0x0c21('0x78'),_0x0c21('0x56'),_0x0c21('0x79'),_0x0c21('0x7a'),'work_start',_0x0c21('0x7b'),'business_stc','additional_assignee_list',_0x0c21('0x7c'),_0x0c21('0x7d'),'notify',_0x0c21('0x7e'),'close_notes',_0x0c21('0x7f'),_0x0c21('0x80'),_0x0c21('0x81'),_0x0c21('0x82'),'contact_type',_0x0c21('0x83'),_0x0c21('0x84'),'urgency',_0x0c21('0x85'),'company',_0x0c21('0x86'),_0x0c21('0x87'),'assigned_to','severity',_0x0c21('0x88'),_0x0c21('0x89'),_0x0c21('0x8a'),'comments_and_work_notes',_0x0c21('0x8b'),_0x0c21('0x8c'),'reopen_count',_0x0c21('0x8d'),_0x0c21('0x8e'),'upon_approval',_0x0c21('0x8f'),_0x0c21('0x90'),_0x0c21('0x58')];var _0x3f9615='';var _0x1c60f0='';var _0x49719e=[];var _0x251d65='';var _0x367137='';var _0x3c1be3=[];var _0x30b32f='';var _0x1204f5='';var _0x56f5ed={};var _0x3dddd1='';return db['ServicenowAccount'][_0x0c21('0x4b')]({'where':{'id':_0x392c03['params']['id']},'attributes':['id',_0x0c21('0x91'),_0x0c21('0x92'),_0x0c21('0x93'),'remoteUri',_0x0c21('0x94')]})[_0x0c21('0x23')](handleEntityNotFound(_0x4b428b,null))[_0x0c21('0x23')](function(_0x4b500e){if(_0x4b500e){_0x3dddd1=_0x4b500e[_0x0c21('0x95')];var _0x18e069=_0x3dddd1['slice'](-0x1);if(_0x18e069==='/'){_0x3dddd1=_0x3dddd1[_0x0c21('0x96')](0x0,_0x3dddd1[_0x0c21('0x97')](_0x18e069));}_0x1204f5=util['format'](_0x0c21('0x98'),_0x3dddd1);_0x30b32f=util['format']('%s/api/now/table/',_0x3dddd1);_0x56f5ed={'user':_0x4b500e[_0x0c21('0x91')],'pass':_0x4b500e[_0x0c21('0x92')]};var _0x4bf0aa={'method':'GET','uri':_0x1204f5+_0x0c21('0x99'),'auth':_0x56f5ed,'json':!![]};return rp(_0x4bf0aa);}})['then'](function(_0x539b65){if(_0x539b65[_0x0c21('0x9a')][_0x0c21('0x36')]>0x0){_0x3f9615=_0x539b65[_0x0c21('0x9a')];}console[_0x0c21('0x9b')]('incident\x20table\x20objects',_0x3f9615);_0x3c1be3=[];_0x1c60f0=Object['assign']([],_0x3f9615);_[_0x0c21('0x9c')](_0x1c60f0,function(_0x92584f){return!_0xb1acac['includes'](_0x92584f[_0x0c21('0x26')]);});_0x1c60f0[_0x0c21('0x9d')](function(_0x6d4af8){var _0x186720=createFieldObject(_0x30b32f,_0x56f5ed,_0x6d4af8['internalType'],_0x6d4af8[_0x0c21('0x26')],_0x6d4af8[_0x0c21('0x9e')],![]);_0x3c1be3[_0x0c21('0x9f')](_0x186720);});return Promise[_0x0c21('0xa0')](_0x3c1be3);})[_0x0c21('0x23')](function(_0x22c4c4){_0x49719e=_0x22c4c4;_0x251d65=Object[_0x0c21('0xa1')]([],_0x3f9615);console[_0x0c21('0x9b')](_0x0c21('0xa2'),_0x3f9615);_['remove'](_0x251d65,function(_0x15b5ef){return _0x1a7636[_0x0c21('0xa3')](_0x15b5ef['name']);});console[_0x0c21('0x9b')](_0x0c21('0xa4'),_0x251d65);_0x3c1be3=[];_0x251d65[_0x0c21('0x9d')](function(_0x30fea2){var _0xa548d2=createFieldObject(_0x30b32f,_0x56f5ed,_0x30fea2[_0x0c21('0xa5')],_0x30fea2[_0x0c21('0x26')],_0x30fea2[_0x0c21('0x9e')],!![]);_0x3c1be3['push'](_0xa548d2);});return Promise[_0x0c21('0xa0')](_0x3c1be3);})[_0x0c21('0x23')](function(_0x39f743){_0x367137=_0x39f743;var _0x3af63c=_0x49719e[_0x0c21('0xa6')](_0x367137);return{'count':_0x3af63c[_0x0c21('0x36')],'rows':_0x3af63c};})['then'](respondWithResult(_0x4b428b,null))[_0x0c21('0x46')](function(_0x4f31f6){console[_0x0c21('0x9b')]('ServiceNow\x20error:\x20'+_0x4f31f6);var _0xd41161=_0x392c03['query'][_0x0c21('0xa7')]?0x1f4:_0x4f31f6[_0x0c21('0xa8')]||0x1f4;logger[_0x0c21('0x24')](_0x4f31f6[_0x0c21('0x25')]);delete _0x4f31f6[_0x0c21('0x26')];if(_0xd41161===0x191){_0xd41161=0x190;}_0x4b428b[_0x0c21('0x18')](_0xd41161)[_0x0c21('0x27')](_0x392c03[_0x0c21('0x2f')][_0x0c21('0xa7')]?{'message':_0x0c21('0xa9'),'statusCode':_0x4f31f6[_0x0c21('0xa8')]}:_0x4f31f6);});};function createFieldObject(_0x2603bf,_0x982c75,_0x33ba6f,_0x540332,_0x4b2f4e,_0x2d1a25){return new Promise(function(_0x3f32f7,_0x49a106){var _0x1a9989={'id':_0x540332,'name':_0x4b2f4e,'custom':_0x2d1a25};if(_0x33ba6f===_0x0c21('0xaa')){_0x1a9989[_0x0c21('0x40')]=[{'name':'True','value':_0x0c21('0xab')},{'name':'False','value':_0x0c21('0xac')}];_0x3f32f7(_0x1a9989);}else{var _0x1256bd={'method':_0x0c21('0xad'),'uri':_0x2603bf+_0x0c21('0xae')+_0x540332,'auth':_0x982c75,'json':!![]};return rp(_0x1256bd)[_0x0c21('0x23')](function(_0x3fbc82){var _0xd5775f=[];if(_0x3fbc82['result'][_0x0c21('0x36')]>0x0){_0x3fbc82['result'][_0x0c21('0x9d')](function(_0x209937){if(_0x209937[_0x0c21('0xaf')]===_0x0c21('0xac')){var _0x25d792={'name':_0x209937['label'],'value':_0x209937[_0x0c21('0xb0')]};_0xd5775f[_0x0c21('0x9f')](_0x25d792);}});}_0x1a9989['options']=_0xd5775f;if(_0x1a9989['options'][_0x0c21('0x36')]>0x0){_0x3f32f7(_0x1a9989);}else{if(_0x2d1a25==![]){_0x3f32f7();}else{_0x3f32f7(_0x1a9989);}}});}});} \ No newline at end of file +var _0x33ad=['push','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','ServicenowAccount','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','includeAll','include','rows','show','find','catch','create','body','params','getConfigurations','findOne','ServicenowConfiguration','AccountId','getSubjects','Descriptions','getDescriptions','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','notify','incident_state','category','watch_list','upon_reject','sys_updated_on','approval_history','resolved_by','sys_updated_by','opened_by','user_input','sys_domain','state','sys_created_by','calendar_stc','cmdb_ci','delivery_plan','impact','work_notes_list','business_service','priority','sys_domain_path','rfc','time_worked','expected_start','business_duration','group_list','work_end','reopened_time','caller_id','approval_set','work_notes','short_description','correlation_display','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','description','close_notes','closed_by','follow_up','parent_incident','sys_id','contact_type','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','severity','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','correlation_id','location','username','password','email','remoteUri','lastIndexOf','format','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','log','remove','includes','forEach','internalType','label','all','assign','TCL:\x20_object','concat','ServiceNow\x20error:\x20','test','statusCode','boolean','True','False','false','sys_choice?sysparm_query=name=incident^element=','value'];(function(_0x5fa1e4,_0x4569d7){var _0x18777f=function(_0x674dca){while(--_0x674dca){_0x5fa1e4['push'](_0x5fa1e4['shift']());}};_0x18777f(++_0x4569d7);}(_0x33ad,0x171));var _0xd33a=function(_0x3c537c,_0x5f2651){_0x3c537c=_0x3c537c-0x0;var _0x170a65=_0x33ad[_0x3c537c];return _0x170a65;};'use strict';var emlformat=require(_0xd33a('0x0'));var rimraf=require(_0xd33a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd33a('0x2'));var rp=require(_0xd33a('0x3'));var moment=require(_0xd33a('0x4'));var BPromise=require(_0xd33a('0x5'));var Mustache=require(_0xd33a('0x6'));var util=require(_0xd33a('0x7'));var path=require(_0xd33a('0x8'));var sox=require(_0xd33a('0x9'));var csv=require('to-csv');var ejs=require(_0xd33a('0xa'));var fs=require('fs');var fs_extra=require(_0xd33a('0xb'));var _=require(_0xd33a('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd33a('0xd'));var deskjs=require(_0xd33a('0xe'));var toCsv=require(_0xd33a('0xf'));var querystring=require('querystring');var Papa=require(_0xd33a('0x10'));var Redis=require(_0xd33a('0x11'));var authService=require(_0xd33a('0x12'));var qs=require(_0xd33a('0x13'));var as=require(_0xd33a('0x14'));var hardwareService=require(_0xd33a('0x15'));var logger=require(_0xd33a('0x16'))(_0xd33a('0x17'));var utils=require(_0xd33a('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xd33a('0x19'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x414c17,_0x545b20){_0x545b20=_0x545b20||0xcc;return function(_0x177cfc){if(_0x177cfc){return _0x414c17[_0xd33a('0x1a')](_0x545b20);}return _0x414c17[_0xd33a('0x1b')](_0x545b20)[_0xd33a('0x1c')]();};}function respondWithResult(_0x49f349,_0xeee5c){_0xeee5c=_0xeee5c||0xc8;return function(_0x6dbbe9){if(_0x6dbbe9){return _0x49f349[_0xd33a('0x1b')](_0xeee5c)[_0xd33a('0x1d')](_0x6dbbe9);}};}function respondWithFilteredResult(_0x38de81,_0x3197cd){return function(_0x2ca371){if(_0x2ca371){var _0xf920cb=typeof _0x3197cd[_0xd33a('0x1e')]===_0xd33a('0x1f')&&typeof _0x3197cd[_0xd33a('0x20')]===_0xd33a('0x1f');var _0x48442e=_0x2ca371['count'];var _0x2c8168=_0xf920cb?0x0:_0x3197cd[_0xd33a('0x1e')];var _0xb660f8=_0xf920cb?_0x2ca371[_0xd33a('0x21')]:_0x3197cd[_0xd33a('0x1e')]+_0x3197cd[_0xd33a('0x20')];var _0x593284;if(_0xb660f8>=_0x48442e){_0xb660f8=_0x48442e;_0x593284=0xc8;}else{_0x593284=0xce;}_0x38de81['status'](_0x593284);return _0x38de81[_0xd33a('0x22')](_0xd33a('0x23'),_0x2c8168+'-'+_0xb660f8+'/'+_0x48442e)[_0xd33a('0x1d')](_0x2ca371);}return null;};}function patchUpdates(_0x35dcb3){return function(_0x52611a){try{jsonpatch[_0xd33a('0x24')](_0x52611a,_0x35dcb3,!![]);}catch(_0x4ecdaf){return BPromise['reject'](_0x4ecdaf);}return _0x52611a[_0xd33a('0x25')]();};}function saveUpdates(_0x3e342f,_0x1997a8){return function(_0x1a7c39){if(_0x1a7c39){return _0x1a7c39[_0xd33a('0x26')](_0x3e342f)[_0xd33a('0x27')](function(_0x14416f){return _0x14416f;});}return null;};}function removeEntity(_0x3a5511,_0x72f048){return function(_0x10e24e){if(_0x10e24e){return _0x10e24e[_0xd33a('0x28')]()[_0xd33a('0x27')](function(){_0x3a5511['status'](0xcc)[_0xd33a('0x1c')]();});}};}function handleEntityNotFound(_0x49c05c,_0x37f642){return function(_0x374662){if(!_0x374662){_0x49c05c[_0xd33a('0x1a')](0x194);}return _0x374662;};}function handleError(_0x531c33,_0x1b0572){_0x1b0572=_0x1b0572||0x1f4;return function(_0x30012c){logger[_0xd33a('0x29')](_0x30012c[_0xd33a('0x2a')]);if(_0x30012c[_0xd33a('0x2b')]){delete _0x30012c[_0xd33a('0x2b')];}_0x531c33['status'](_0x1b0572)[_0xd33a('0x2c')](_0x30012c);};}exports[_0xd33a('0x2d')]=function(_0x5bdc6f,_0x707c76){var _0x1d50ca={},_0x3fb10b={},_0x4d0855={'count':0x0,'rows':[]};var _0x568b0d=_[_0xd33a('0x2e')](db[_0xd33a('0x2f')][_0xd33a('0x30')],function(_0x3cb965){return{'name':_0x3cb965[_0xd33a('0x31')],'type':_0x3cb965[_0xd33a('0x32')]['key']};});_0x3fb10b[_0xd33a('0x33')]=_[_0xd33a('0x2e')](_0x568b0d,_0xd33a('0x2b'));_0x3fb10b[_0xd33a('0x34')]=_[_0xd33a('0x35')](_0x5bdc6f[_0xd33a('0x34')]);_0x3fb10b['filters']=_[_0xd33a('0x36')](_0x3fb10b[_0xd33a('0x33')],_0x3fb10b[_0xd33a('0x34')]);_0x1d50ca[_0xd33a('0x37')]=_[_0xd33a('0x36')](_0x3fb10b[_0xd33a('0x33')],qs[_0xd33a('0x38')](_0x5bdc6f[_0xd33a('0x34')][_0xd33a('0x38')]));_0x1d50ca[_0xd33a('0x37')]=_0x1d50ca['attributes'][_0xd33a('0x39')]?_0x1d50ca[_0xd33a('0x37')]:_0x3fb10b[_0xd33a('0x33')];if(!_0x5bdc6f[_0xd33a('0x34')][_0xd33a('0x3a')](_0xd33a('0x3b'))){_0x1d50ca['limit']=qs['limit'](_0x5bdc6f[_0xd33a('0x34')][_0xd33a('0x20')]);_0x1d50ca[_0xd33a('0x1e')]=qs['offset'](_0x5bdc6f[_0xd33a('0x34')][_0xd33a('0x1e')]);}_0x1d50ca[_0xd33a('0x3c')]=qs[_0xd33a('0x3d')](_0x5bdc6f[_0xd33a('0x34')]['sort']);_0x1d50ca['where']=qs[_0xd33a('0x3e')](_['pick'](_0x5bdc6f['query'],_0x3fb10b[_0xd33a('0x3e')]),_0x568b0d);if(_0x5bdc6f[_0xd33a('0x34')][_0xd33a('0x3f')]){_0x1d50ca[_0xd33a('0x40')]=_[_0xd33a('0x41')](_0x1d50ca[_0xd33a('0x40')],{'$or':_[_0xd33a('0x2e')](_0x568b0d,function(_0x5cca9d){if(_0x5cca9d['type']!==_0xd33a('0x42')){var _0x333612={};_0x333612[_0x5cca9d[_0xd33a('0x2b')]]={'$like':'%'+_0x5bdc6f['query']['filter']+'%'};return _0x333612;}})});}_0x1d50ca=_[_0xd33a('0x41')]({},_0x1d50ca,_0x5bdc6f[_0xd33a('0x43')]);var _0x310640={'where':_0x1d50ca[_0xd33a('0x40')]};return db[_0xd33a('0x2f')][_0xd33a('0x21')](_0x310640)['then'](function(_0x422062){_0x4d0855[_0xd33a('0x21')]=_0x422062;if(_0x5bdc6f[_0xd33a('0x34')][_0xd33a('0x44')]){_0x1d50ca[_0xd33a('0x45')]=[{'all':!![]}];}return db[_0xd33a('0x2f')]['findAll'](_0x1d50ca);})['then'](function(_0x1ce345){_0x4d0855[_0xd33a('0x46')]=_0x1ce345;return _0x4d0855;})[_0xd33a('0x27')](respondWithFilteredResult(_0x707c76,_0x1d50ca))['catch'](handleError(_0x707c76,null));};exports[_0xd33a('0x47')]=function(_0x5b1a6e,_0x127f71){var _0x107ad9={'raw':![],'where':{'id':_0x5b1a6e['params']['id']}},_0x16e662={};_0x16e662[_0xd33a('0x33')]=_[_0xd33a('0x35')](db['ServicenowAccount'][_0xd33a('0x30')]);_0x16e662[_0xd33a('0x34')]=_[_0xd33a('0x35')](_0x5b1a6e['query']);_0x16e662['filters']=_[_0xd33a('0x36')](_0x16e662['model'],_0x16e662[_0xd33a('0x34')]);_0x107ad9[_0xd33a('0x37')]=_[_0xd33a('0x36')](_0x16e662[_0xd33a('0x33')],qs['fields'](_0x5b1a6e[_0xd33a('0x34')][_0xd33a('0x38')]));_0x107ad9[_0xd33a('0x37')]=_0x107ad9[_0xd33a('0x37')][_0xd33a('0x39')]?_0x107ad9[_0xd33a('0x37')]:_0x16e662[_0xd33a('0x33')];if(_0x5b1a6e[_0xd33a('0x34')][_0xd33a('0x44')]){_0x107ad9[_0xd33a('0x45')]=[{'all':!![]}];}_0x107ad9=_[_0xd33a('0x41')]({},_0x107ad9,_0x5b1a6e['options']);return db[_0xd33a('0x2f')][_0xd33a('0x48')](_0x107ad9)[_0xd33a('0x27')](handleEntityNotFound(_0x127f71,null))['then'](respondWithResult(_0x127f71,null))[_0xd33a('0x49')](handleError(_0x127f71,null));};exports[_0xd33a('0x4a')]=function(_0x430e92,_0x4a9d28){return db[_0xd33a('0x2f')]['create'](_0x430e92[_0xd33a('0x4b')],{})[_0xd33a('0x27')](respondWithResult(_0x4a9d28,0xc9))[_0xd33a('0x49')](handleError(_0x4a9d28,null));};exports[_0xd33a('0x26')]=function(_0x55192d,_0x3115d5){if(_0x55192d['body']['id']){delete _0x55192d[_0xd33a('0x4b')]['id'];}return db['ServicenowAccount'][_0xd33a('0x48')]({'where':{'id':_0x55192d['params']['id']}})[_0xd33a('0x27')](handleEntityNotFound(_0x3115d5,null))['then'](saveUpdates(_0x55192d[_0xd33a('0x4b')],null))['then'](respondWithResult(_0x3115d5,null))[_0xd33a('0x49')](handleError(_0x3115d5,null));};exports[_0xd33a('0x28')]=function(_0x2bc4b9,_0x2e8446){return db['ServicenowAccount']['find']({'where':{'id':_0x2bc4b9[_0xd33a('0x4c')]['id']}})[_0xd33a('0x27')](handleEntityNotFound(_0x2e8446,null))[_0xd33a('0x27')](removeEntity(_0x2e8446,null))['catch'](handleError(_0x2e8446,null));};exports[_0xd33a('0x4d')]=function(_0xab6328,_0x3b95df,_0x2baa13){var _0x358021={};var _0x546b52={};var _0x135101;var _0x4b930b;return db[_0xd33a('0x2f')][_0xd33a('0x4e')]({'where':{'id':_0xab6328[_0xd33a('0x4c')]['id']}})[_0xd33a('0x27')](handleEntityNotFound(_0x3b95df,null))['then'](function(_0x5c7dd6){if(_0x5c7dd6){_0x135101=_0x5c7dd6;_0x546b52[_0xd33a('0x33')]=_[_0xd33a('0x35')](db[_0xd33a('0x4f')][_0xd33a('0x30')]);_0x546b52[_0xd33a('0x34')]=_[_0xd33a('0x35')](_0xab6328['query']);_0x546b52[_0xd33a('0x3e')]=_[_0xd33a('0x36')](_0x546b52[_0xd33a('0x33')],_0x546b52[_0xd33a('0x34')]);_0x358021[_0xd33a('0x37')]=_[_0xd33a('0x36')](_0x546b52['model'],qs['fields'](_0xab6328[_0xd33a('0x34')]['fields']));_0x358021[_0xd33a('0x37')]=_0x358021[_0xd33a('0x37')][_0xd33a('0x39')]?_0x358021['attributes']:_0x546b52[_0xd33a('0x33')];_0x358021['order']=qs[_0xd33a('0x3d')](_0xab6328[_0xd33a('0x34')][_0xd33a('0x3d')]);_0x358021[_0xd33a('0x40')]=qs[_0xd33a('0x3e')](_['pick'](_0xab6328[_0xd33a('0x34')],_0x546b52[_0xd33a('0x3e')]));if(_0xab6328[_0xd33a('0x34')][_0xd33a('0x3f')]){_0x358021['where']=_[_0xd33a('0x41')](_0x358021[_0xd33a('0x40')],{'$or':_[_0xd33a('0x2e')](_0x358021[_0xd33a('0x37')],function(_0x4a6d75){var _0x5a0bfe={};_0x5a0bfe[_0x4a6d75]={'$like':'%'+_0xab6328[_0xd33a('0x34')][_0xd33a('0x3f')]+'%'};return _0x5a0bfe;})});}_0x358021=_[_0xd33a('0x41')]({},_0x358021,_0xab6328[_0xd33a('0x43')]);return _0x135101[_0xd33a('0x4d')](_0x358021);}})[_0xd33a('0x27')](function(_0x27de51){if(_0x27de51){_0x4b930b=_0x27de51[_0xd33a('0x39')];if(!_0xab6328[_0xd33a('0x34')][_0xd33a('0x3a')](_0xd33a('0x3b'))){_0x358021[_0xd33a('0x20')]=qs[_0xd33a('0x20')](_0xab6328[_0xd33a('0x34')]['limit']);_0x358021[_0xd33a('0x1e')]=qs[_0xd33a('0x1e')](_0xab6328[_0xd33a('0x34')][_0xd33a('0x1e')]);}return _0x135101['getConfigurations'](_0x358021);}})['then'](function(_0x25b4a0){if(_0x25b4a0){return _0x25b4a0?{'count':_0x4b930b,'rows':_0x25b4a0}:null;}})[_0xd33a('0x27')](respondWithResult(_0x3b95df,null))['catch'](handleError(_0x3b95df,null));};exports['addConfiguration']=function(_0x485151,_0x52e81d,_0x3da834){if(_0x485151[_0xd33a('0x4b')]['id']){delete _0x485151['body']['id'];}return db[_0xd33a('0x2f')][_0xd33a('0x4e')]({'where':{'id':_0x485151['params']['id']}})[_0xd33a('0x27')](handleEntityNotFound(_0x52e81d,null))[_0xd33a('0x27')](function(_0xd6cd1d){if(_0xd6cd1d){_0x485151['body'][_0xd33a('0x50')]=_0xd6cd1d['id'];_0x485151[_0xd33a('0x4b')]['Subjects']=integrations[_0xd33a('0x51')](_0x485151[_0xd33a('0x4b')]['channel'],_0x485151[_0xd33a('0x4b')][_0xd33a('0x32')]);_0x485151['body'][_0xd33a('0x52')]=integrations[_0xd33a('0x53')](_0x485151['body']['channel'],_0x485151[_0xd33a('0x4b')][_0xd33a('0x32')]);return db[_0xd33a('0x4f')][_0xd33a('0x4a')](_0x485151['body'],{'include':[{'model':db['ServicenowField'],'as':'Subjects'},{'model':db['ServicenowField'],'as':'Descriptions'}]});}return null;})[_0xd33a('0x27')](respondWithResult(_0x52e81d,null))[_0xd33a('0x49')](handleError(_0x52e81d,null));};exports[_0xd33a('0x54')]=function(_0x5292f1,_0x2199d7,_0x2b50fe){var _0x1b7db2=[_0xd33a('0x55'),_0xd33a('0x56'),_0xd33a('0x57'),_0xd33a('0x58'),_0xd33a('0x59'),_0xd33a('0x5a'),_0xd33a('0x5b'),'severity',_0xd33a('0x5c')];var _0xf142f9=['parent',_0xd33a('0x55'),'caused_by',_0xd33a('0x5d'),_0xd33a('0x5e'),_0xd33a('0x5f'),'child_incidents','hold_reason',_0xd33a('0x60'),'number',_0xd33a('0x61'),_0xd33a('0x62'),_0xd33a('0x63'),_0xd33a('0x64'),'sys_created_on',_0xd33a('0x65'),_0xd33a('0x66'),_0xd33a('0x67'),'knowledge',_0xd33a('0x3c'),_0xd33a('0x68'),'closed_at',_0xd33a('0x69'),_0xd33a('0x6a'),_0xd33a('0x6b'),'active',_0xd33a('0x6c'),_0xd33a('0x6d'),_0xd33a('0x6e'),_0xd33a('0x6f'),_0xd33a('0x70'),_0xd33a('0x71'),_0xd33a('0x72'),'opened_at',_0xd33a('0x73'),_0xd33a('0x74'),_0xd33a('0x75'),_0xd33a('0x76'),'resolved_at',_0xd33a('0x77'),_0xd33a('0x78'),_0xd33a('0x58'),_0xd33a('0x79'),_0xd33a('0x7a'),_0xd33a('0x59'),_0xd33a('0x7b'),_0xd33a('0x7c'),_0xd33a('0x7d'),_0xd33a('0x7e'),_0xd33a('0x7f'),_0xd33a('0x80'),_0xd33a('0x81'),'calendar_duration',_0xd33a('0x5a'),'sys_class_name',_0xd33a('0x82'),_0xd33a('0x83'),_0xd33a('0x84'),_0xd33a('0x85'),_0xd33a('0x86'),_0xd33a('0x87'),'reopened_by','incident_state',_0xd33a('0x88'),_0xd33a('0x89'),_0xd33a('0x8a'),_0xd33a('0x8b'),_0xd33a('0x8c'),_0xd33a('0x8d'),_0xd33a('0x8e'),'comments',_0xd33a('0x8f'),_0xd33a('0x90'),_0xd33a('0x91'),_0xd33a('0x92'),_0xd33a('0x93'),_0xd33a('0x94'),_0xd33a('0x95'),_0xd33a('0x96'),_0xd33a('0x97'),_0xd33a('0x98'),_0xd33a('0x99'),'category'];var _0x2f88ad='';var _0x41d7ae='';var _0x5ea019=[];var _0x3e72ee='';var _0x516db3='';var _0x5d1a4c=[];var _0x62cd52='';var _0x31f300='';var _0x43450c={};var _0x156808='';return db[_0xd33a('0x2f')][_0xd33a('0x4e')]({'where':{'id':_0x5292f1[_0xd33a('0x4c')]['id']},'attributes':['id',_0xd33a('0x9a'),_0xd33a('0x9b'),_0xd33a('0x9c'),_0xd33a('0x9d'),'serverUrl']})['then'](handleEntityNotFound(_0x2199d7,null))[_0xd33a('0x27')](function(_0x1ae7e1){if(_0x1ae7e1){_0x156808=_0x1ae7e1[_0xd33a('0x9d')];var _0x525557=_0x156808['slice'](-0x1);if(_0x525557==='/'){_0x156808=_0x156808['substring'](0x0,_0x156808[_0xd33a('0x9e')](_0x525557));}_0x31f300=util['format']('%s/api/now/doc/table/schema/',_0x156808);_0x62cd52=util[_0xd33a('0x9f')](_0xd33a('0xa0'),_0x156808);_0x43450c={'user':_0x1ae7e1[_0xd33a('0x9a')],'pass':_0x1ae7e1[_0xd33a('0x9b')]};var _0x5892f1={'method':_0xd33a('0xa1'),'uri':_0x31f300+_0xd33a('0xa2'),'auth':_0x43450c,'json':!![]};return rp(_0x5892f1);}})[_0xd33a('0x27')](function(_0xd70abb){if(_0xd70abb[_0xd33a('0xa3')][_0xd33a('0x39')]>0x0){_0x2f88ad=_0xd70abb['result'];}console[_0xd33a('0xa4')]('incident\x20table\x20objects',_0x2f88ad);_0x5d1a4c=[];_0x41d7ae=Object['assign']([],_0x2f88ad);_[_0xd33a('0xa5')](_0x41d7ae,function(_0x3f85c7){return!_0x1b7db2[_0xd33a('0xa6')](_0x3f85c7[_0xd33a('0x2b')]);});_0x41d7ae[_0xd33a('0xa7')](function(_0x29857b){var _0xfe0430=createFieldObject(_0x62cd52,_0x43450c,_0x29857b[_0xd33a('0xa8')],_0x29857b[_0xd33a('0x2b')],_0x29857b[_0xd33a('0xa9')],![]);_0x5d1a4c['push'](_0xfe0430);});return Promise[_0xd33a('0xaa')](_0x5d1a4c);})[_0xd33a('0x27')](function(_0x9a6398){_0x5ea019=_0x9a6398;_0x3e72ee=Object[_0xd33a('0xab')]([],_0x2f88ad);console[_0xd33a('0xa4')](_0xd33a('0xac'),_0x2f88ad);_[_0xd33a('0xa5')](_0x3e72ee,function(_0x443738){return _0xf142f9[_0xd33a('0xa6')](_0x443738['name']);});console[_0xd33a('0xa4')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x3e72ee);_0x5d1a4c=[];_0x3e72ee[_0xd33a('0xa7')](function(_0x52b7eb){var _0x59017b=createFieldObject(_0x62cd52,_0x43450c,_0x52b7eb['internalType'],_0x52b7eb[_0xd33a('0x2b')],_0x52b7eb['label'],!![]);_0x5d1a4c['push'](_0x59017b);});return Promise[_0xd33a('0xaa')](_0x5d1a4c);})[_0xd33a('0x27')](function(_0x5568ca){_0x516db3=_0x5568ca;var _0x329f14=_0x5ea019[_0xd33a('0xad')](_0x516db3);return{'count':_0x329f14[_0xd33a('0x39')],'rows':_0x329f14};})['then'](respondWithResult(_0x2199d7,null))[_0xd33a('0x49')](function(_0x3794a0){console[_0xd33a('0xa4')](_0xd33a('0xae')+_0x3794a0);var _0x156802=_0x5292f1[_0xd33a('0x34')][_0xd33a('0xaf')]?0x1f4:_0x3794a0[_0xd33a('0xb0')]||0x1f4;logger[_0xd33a('0x29')](_0x3794a0[_0xd33a('0x2a')]);delete _0x3794a0[_0xd33a('0x2b')];if(_0x156802===0x191){_0x156802=0x190;}_0x2199d7['status'](_0x156802)[_0xd33a('0x2c')](_0x5292f1[_0xd33a('0x34')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x3794a0['statusCode']}:_0x3794a0);});};function createFieldObject(_0x59488a,_0x5c3f20,_0x3e53ff,_0x16a60f,_0x47dae4,_0x247a46){return new Promise(function(_0x5436f4,_0x3b3899){var _0xbbd788={'id':_0x16a60f,'name':_0x47dae4,'custom':_0x247a46};if(_0x3e53ff===_0xd33a('0xb1')){_0xbbd788[_0xd33a('0x43')]=[{'name':_0xd33a('0xb2'),'value':'true'},{'name':_0xd33a('0xb3'),'value':_0xd33a('0xb4')}];_0x5436f4(_0xbbd788);}else{var _0x51b971={'method':_0xd33a('0xa1'),'uri':_0x59488a+_0xd33a('0xb5')+_0x16a60f,'auth':_0x5c3f20,'json':!![]};return rp(_0x51b971)[_0xd33a('0x27')](function(_0x5840c0){var _0x69ec=[];if(_0x5840c0[_0xd33a('0xa3')]['length']>0x0){_0x5840c0[_0xd33a('0xa3')][_0xd33a('0xa7')](function(_0x23564d){if(_0x23564d['inactive']===_0xd33a('0xb4')){var _0x13251b={'name':_0x23564d[_0xd33a('0xa9')],'value':_0x23564d[_0xd33a('0xb6')]};_0x69ec[_0xd33a('0xb7')](_0x13251b);}});}_0xbbd788['options']=_0x69ec;if(_0xbbd788[_0xd33a('0x43')][_0xd33a('0x39')]>0x0){_0x5436f4(_0xbbd788);}else{if(_0x247a46==![]){_0x5436f4();}else{_0x5436f4(_0xbbd788);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index d2514eb..bc7c620 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 _0x5075=['bluebird','request-promise','rimraf','../../config/environment','./intServicenowAccount.attributes','ServicenowAccount','int_servicenow_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x2ea780,_0x46ec71){var _0x3dc36c=function(_0x223749){while(--_0x223749){_0x2ea780['push'](_0x2ea780['shift']());}};_0x3dc36c(++_0x46ec71);}(_0x5075,0x73));var _0x5507=function(_0x24ca1f,_0x3d2164){_0x24ca1f=_0x24ca1f-0x0;var _0x5f4222=_0x5075[_0x24ca1f];return _0x5f4222;};'use strict';var _=require(_0x5507('0x0'));var util=require(_0x5507('0x1'));var logger=require(_0x5507('0x2'))(_0x5507('0x3'));var moment=require(_0x5507('0x4'));var BPromise=require(_0x5507('0x5'));var rp=require(_0x5507('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5507('0x7'));var config=require(_0x5507('0x8'));var attributes=require(_0x5507('0x9'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x2cd9ee,_0x773559){return _0x2cd9ee['define'](_0x5507('0xa'),attributes,{'tableName':_0x5507('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x187d=['exports','define','ServicenowAccount','int_servicenow_accounts','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intServicenowAccount.attributes'];(function(_0x2f2601,_0x10b8be){var _0x3c6e6=function(_0x12a171){while(--_0x12a171){_0x2f2601['push'](_0x2f2601['shift']());}};_0x3c6e6(++_0x10b8be);}(_0x187d,0x93));var _0xd187=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x187d[_0x56482c];return _0x5aae7a;};'use strict';var _=require(_0xd187('0x0'));var util=require('util');var logger=require(_0xd187('0x1'))(_0xd187('0x2'));var moment=require(_0xd187('0x3'));var BPromise=require(_0xd187('0x4'));var rp=require(_0xd187('0x5'));var fs=require('fs');var path=require(_0xd187('0x6'));var rimraf=require('rimraf');var config=require(_0xd187('0x7'));var attributes=require(_0xd187('0x8'));var integrations=require('../../components/integrations/configuration');module[_0xd187('0x9')]=function(_0x58ee7,_0x444a60){return _0x58ee7[_0xd187('0xa')](_0xd187('0xb'),attributes,{'tableName':_0xd187('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js index f0507db..391e2ed 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 _0x3319=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','code','ServicenowAccount,\x20%s,\x20%s','message','result','catch','GetServicenowAccount','ServicenowAccount','options','raw','attributes','limit','map','model','include','info','stringify','ShowServicenowAccount','find','where','lodash','util','moment','randomstring'];(function(_0x16534e,_0x1eca22){var _0x1d0ccf=function(_0xa89489){while(--_0xa89489){_0x16534e['push'](_0x16534e['shift']());}};_0x1d0ccf(++_0x1eca22);}(_0x3319,0xb0));var _0x9331=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0x3319[_0x47e7cb];return _0x2a8874;};'use strict';var _=require(_0x9331('0x0'));var util=require(_0x9331('0x1'));var moment=require(_0x9331('0x2'));var BPromise=require('bluebird');var rs=require(_0x9331('0x3'));var fs=require('fs');var Redis=require(_0x9331('0x4'));var db=require(_0x9331('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9331('0x6'))(_0x9331('0x7'));var config=require(_0x9331('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9331('0x9')][_0x9331('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x389f3c,_0x5f23c5,_0x1e2d87){return new BPromise(function(_0x3f0fec,_0x92fc75){return client[_0x9331('0xb')](_0x389f3c,_0x1e2d87)[_0x9331('0xc')](function(_0x2aaad4){logger['info']('ServicenowAccount,\x20%s,\x20%s',_0x5f23c5,_0x9331('0xd'));logger[_0x9331('0xe')](_0x9331('0xf'),_0x5f23c5,'request\x20sent',JSON['stringify'](_0x2aaad4));if(_0x2aaad4[_0x9331('0x10')]){if(_0x2aaad4[_0x9331('0x10')][_0x9331('0x11')]===0x1f4){logger[_0x9331('0x10')](_0x9331('0x12'),_0x5f23c5,_0x2aaad4[_0x9331('0x10')][_0x9331('0x13')]);return _0x92fc75(_0x2aaad4[_0x9331('0x10')]['message']);}logger[_0x9331('0x10')](_0x9331('0x12'),_0x5f23c5,_0x2aaad4[_0x9331('0x10')]['message']);return _0x3f0fec(_0x2aaad4['error']['message']);}else{logger['info'](_0x9331('0x12'),_0x5f23c5,_0x9331('0xd'));_0x3f0fec(_0x2aaad4[_0x9331('0x14')][_0x9331('0x13')]);}})[_0x9331('0x15')](function(_0x4f926b){logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x5f23c5,_0x4f926b);_0x92fc75(_0x4f926b);});});}exports[_0x9331('0x16')]=function(_0xedeb1){var _0x3882c2=this;return new Promise(function(_0x2bb17f,_0x2964e1){return db[_0x9331('0x17')]['findAll']({'raw':_0xedeb1[_0x9331('0x18')]?_0xedeb1['options'][_0x9331('0x19')]===undefined?!![]:![]:!![],'where':_0xedeb1[_0x9331('0x18')]?_0xedeb1[_0x9331('0x18')]['where']||null:null,'attributes':_0xedeb1[_0x9331('0x18')]?_0xedeb1[_0x9331('0x18')][_0x9331('0x1a')]||null:null,'limit':_0xedeb1[_0x9331('0x18')]?_0xedeb1[_0x9331('0x18')][_0x9331('0x1b')]||null:null,'include':_0xedeb1[_0x9331('0x18')]?_0xedeb1[_0x9331('0x18')]['include']?_[_0x9331('0x1c')](_0xedeb1[_0x9331('0x18')]['include'],function(_0x43d76d){return{'model':db[_0x43d76d[_0x9331('0x1d')]],'as':_0x43d76d['as'],'attributes':_0x43d76d[_0x9331('0x1a')],'include':_0x43d76d[_0x9331('0x1e')]?_[_0x9331('0x1c')](_0x43d76d[_0x9331('0x1e')],function(_0x284cc2){return{'model':db[_0x284cc2[_0x9331('0x1d')]],'as':_0x284cc2['as'],'attributes':_0x284cc2[_0x9331('0x1a')],'include':_0x284cc2[_0x9331('0x1e')]?_['map'](_0x284cc2[_0x9331('0x1e')],function(_0x43df38){return{'model':db[_0x43df38[_0x9331('0x1d')]],'as':_0x43df38['as'],'attributes':_0x43df38[_0x9331('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x313c3b){logger[_0x9331('0x1f')](_0x9331('0x16'),_0xedeb1);logger[_0x9331('0xe')](_0x9331('0x16'),_0xedeb1,JSON[_0x9331('0x20')](_0x313c3b));_0x2bb17f(_0x313c3b);})[_0x9331('0x15')](function(_0x39b49f){logger[_0x9331('0x10')](_0x9331('0x16'),_0x39b49f[_0x9331('0x13')],_0xedeb1);_0x2964e1(_0x3882c2['error'](0x1f4,_0x39b49f[_0x9331('0x13')]));});});};exports[_0x9331('0x21')]=function(_0x4ed00a){var _0x18c388=this;return new Promise(function(_0x53945d,_0x14b448){return db['ServicenowAccount'][_0x9331('0x22')]({'raw':_0x4ed00a[_0x9331('0x18')]?_0x4ed00a['options'][_0x9331('0x19')]===undefined?!![]:![]:!![],'where':_0x4ed00a[_0x9331('0x18')]?_0x4ed00a[_0x9331('0x18')][_0x9331('0x23')]||null:null,'attributes':_0x4ed00a['options']?_0x4ed00a['options'][_0x9331('0x1a')]||null:null,'include':_0x4ed00a[_0x9331('0x18')]?_0x4ed00a[_0x9331('0x18')]['include']?_[_0x9331('0x1c')](_0x4ed00a['options'][_0x9331('0x1e')],function(_0x3e9976){return{'model':db[_0x3e9976[_0x9331('0x1d')]],'as':_0x3e9976['as'],'attributes':_0x3e9976[_0x9331('0x1a')],'include':_0x3e9976['include']?_[_0x9331('0x1c')](_0x3e9976['include'],function(_0x7c1aef){return{'model':db[_0x7c1aef[_0x9331('0x1d')]],'as':_0x7c1aef['as'],'attributes':_0x7c1aef['attributes'],'include':_0x7c1aef[_0x9331('0x1e')]?_[_0x9331('0x1c')](_0x7c1aef[_0x9331('0x1e')],function(_0x137820){return{'model':db[_0x137820[_0x9331('0x1d')]],'as':_0x137820['as'],'attributes':_0x137820[_0x9331('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x9331('0xc')](function(_0x23fcec){logger[_0x9331('0x1f')](_0x9331('0x21'),_0x4ed00a);logger[_0x9331('0xe')](_0x9331('0x21'),_0x4ed00a,JSON[_0x9331('0x20')](_0x23fcec));_0x53945d(_0x23fcec);})['catch'](function(_0x2556e1){logger[_0x9331('0x10')](_0x9331('0x21'),_0x2556e1[_0x9331('0x13')],_0x4ed00a);_0x14b448(_0x18c388[_0x9331('0x10')](0x1f4,_0x2556e1[_0x9331('0x13')]));});});}; \ No newline at end of file +var _0xe7cc=['error','code','message','info','result','catch','GetServicenowAccount','options','raw','where','attributes','include','model','map','ShowServicenowAccount','ServicenowAccount','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','then','ServicenowAccount,\x20%s,\x20%s','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x50d822,_0x1191f7){var _0x4ac4e1=function(_0x31909a){while(--_0x31909a){_0x50d822['push'](_0x50d822['shift']());}};_0x4ac4e1(++_0x1191f7);}(_0xe7cc,0x94));var _0xce7c=function(_0x5e4065,_0x7e78f7){_0x5e4065=_0x5e4065-0x0;var _0x574707=_0xe7cc[_0x5e4065];return _0x574707;};'use strict';var _=require(_0xce7c('0x0'));var util=require(_0xce7c('0x1'));var moment=require('moment');var BPromise=require(_0xce7c('0x2'));var rs=require(_0xce7c('0x3'));var fs=require('fs');var Redis=require(_0xce7c('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xce7c('0x5'))(_0xce7c('0x6'));var config=require('../../config/environment');var jayson=require(_0xce7c('0x7'));var client=jayson[_0xce7c('0x8')][_0xce7c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xabdf02,_0x2c9df1,_0x2cb6a0){return new BPromise(function(_0x3d249d,_0x488be0){return client[_0xce7c('0xa')](_0xabdf02,_0x2cb6a0)[_0xce7c('0xb')](function(_0x5d5387){logger['info'](_0xce7c('0xc'),_0x2c9df1,'request\x20sent');logger[_0xce7c('0xd')](_0xce7c('0xe'),_0x2c9df1,_0xce7c('0xf'),JSON[_0xce7c('0x10')](_0x5d5387));if(_0x5d5387[_0xce7c('0x11')]){if(_0x5d5387[_0xce7c('0x11')][_0xce7c('0x12')]===0x1f4){logger[_0xce7c('0x11')](_0xce7c('0xc'),_0x2c9df1,_0x5d5387[_0xce7c('0x11')][_0xce7c('0x13')]);return _0x488be0(_0x5d5387[_0xce7c('0x11')][_0xce7c('0x13')]);}logger[_0xce7c('0x11')](_0xce7c('0xc'),_0x2c9df1,_0x5d5387[_0xce7c('0x11')][_0xce7c('0x13')]);return _0x3d249d(_0x5d5387['error'][_0xce7c('0x13')]);}else{logger[_0xce7c('0x14')]('ServicenowAccount,\x20%s,\x20%s',_0x2c9df1,'request\x20sent');_0x3d249d(_0x5d5387[_0xce7c('0x15')]['message']);}})[_0xce7c('0x16')](function(_0x9a16c9){logger[_0xce7c('0x11')]('ServicenowAccount,\x20%s,\x20%s',_0x2c9df1,_0x9a16c9);_0x488be0(_0x9a16c9);});});}exports[_0xce7c('0x17')]=function(_0x13fc8e){var _0x4507ed=this;return new Promise(function(_0x2f12e7,_0x4a8993){return db['ServicenowAccount']['findAll']({'raw':_0x13fc8e[_0xce7c('0x18')]?_0x13fc8e[_0xce7c('0x18')][_0xce7c('0x19')]===undefined?!![]:![]:!![],'where':_0x13fc8e[_0xce7c('0x18')]?_0x13fc8e[_0xce7c('0x18')][_0xce7c('0x1a')]||null:null,'attributes':_0x13fc8e['options']?_0x13fc8e[_0xce7c('0x18')][_0xce7c('0x1b')]||null:null,'limit':_0x13fc8e['options']?_0x13fc8e[_0xce7c('0x18')]['limit']||null:null,'include':_0x13fc8e[_0xce7c('0x18')]?_0x13fc8e[_0xce7c('0x18')][_0xce7c('0x1c')]?_['map'](_0x13fc8e[_0xce7c('0x18')]['include'],function(_0x40c6b6){return{'model':db[_0x40c6b6[_0xce7c('0x1d')]],'as':_0x40c6b6['as'],'attributes':_0x40c6b6[_0xce7c('0x1b')],'include':_0x40c6b6['include']?_[_0xce7c('0x1e')](_0x40c6b6[_0xce7c('0x1c')],function(_0x39548f){return{'model':db[_0x39548f[_0xce7c('0x1d')]],'as':_0x39548f['as'],'attributes':_0x39548f['attributes'],'include':_0x39548f[_0xce7c('0x1c')]?_[_0xce7c('0x1e')](_0x39548f['include'],function(_0x43721b){return{'model':db[_0x43721b[_0xce7c('0x1d')]],'as':_0x43721b['as'],'attributes':_0x43721b[_0xce7c('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xce7c('0xb')](function(_0x301f27){logger['info'](_0xce7c('0x17'),_0x13fc8e);logger[_0xce7c('0xd')](_0xce7c('0x17'),_0x13fc8e,JSON[_0xce7c('0x10')](_0x301f27));_0x2f12e7(_0x301f27);})[_0xce7c('0x16')](function(_0x5d307f){logger[_0xce7c('0x11')]('GetServicenowAccount',_0x5d307f[_0xce7c('0x13')],_0x13fc8e);_0x4a8993(_0x4507ed[_0xce7c('0x11')](0x1f4,_0x5d307f[_0xce7c('0x13')]));});});};exports[_0xce7c('0x1f')]=function(_0x4321ab){var _0x5591dc=this;return new Promise(function(_0x87eb37,_0x33cb93){return db[_0xce7c('0x20')]['find']({'raw':_0x4321ab[_0xce7c('0x18')]?_0x4321ab[_0xce7c('0x18')][_0xce7c('0x19')]===undefined?!![]:![]:!![],'where':_0x4321ab[_0xce7c('0x18')]?_0x4321ab[_0xce7c('0x18')]['where']||null:null,'attributes':_0x4321ab[_0xce7c('0x18')]?_0x4321ab[_0xce7c('0x18')]['attributes']||null:null,'include':_0x4321ab[_0xce7c('0x18')]?_0x4321ab[_0xce7c('0x18')]['include']?_['map'](_0x4321ab['options']['include'],function(_0x4336dd){return{'model':db[_0x4336dd[_0xce7c('0x1d')]],'as':_0x4336dd['as'],'attributes':_0x4336dd[_0xce7c('0x1b')],'include':_0x4336dd['include']?_['map'](_0x4336dd[_0xce7c('0x1c')],function(_0x388f2c){return{'model':db[_0x388f2c[_0xce7c('0x1d')]],'as':_0x388f2c['as'],'attributes':_0x388f2c['attributes'],'include':_0x388f2c[_0xce7c('0x1c')]?_['map'](_0x388f2c[_0xce7c('0x1c')],function(_0x2b2926){return{'model':db[_0x2b2926['model']],'as':_0x2b2926['as'],'attributes':_0x2b2926['attributes']};}):[]};}):[]};}):[]:[]})[_0xce7c('0xb')](function(_0x249169){logger[_0xce7c('0x14')]('ShowServicenowAccount',_0x4321ab);logger[_0xce7c('0xd')](_0xce7c('0x1f'),_0x4321ab,JSON[_0xce7c('0x10')](_0x249169));_0x87eb37(_0x249169);})[_0xce7c('0x16')](function(_0x220f35){logger[_0xce7c('0x11')]('ShowServicenowAccount',_0x220f35[_0xce7c('0x13')],_0x4321ab);_0x33cb93(_0x5591dc[_0xce7c('0x11')](0x1f4,_0x220f35[_0xce7c('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 54541a0..a8b2c3e 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 _0x2274=['isAuthenticated','index','/:id','show','/:id/fields','getFields','getSubjects','getDescriptions','post','create','update','delete','destroy','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get'];(function(_0x1a3ca2,_0xe144e7){var _0x30ea08=function(_0x37a9f6){while(--_0x37a9f6){_0x1a3ca2['push'](_0x1a3ca2['shift']());}};_0x30ea08(++_0xe144e7);}(_0x2274,0x141));var _0x4227=function(_0x433807,_0x5bde92){_0x433807=_0x433807-0x0;var _0x5e9376=_0x2274[_0x433807];return _0x5e9376;};'use strict';var multer=require(_0x4227('0x0'));var util=require(_0x4227('0x1'));var path=require(_0x4227('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x4227('0x3'));var auth=require(_0x4227('0x4'));var interaction=require(_0x4227('0x5'));var config=require(_0x4227('0x6'));var controller=require(_0x4227('0x7'));router[_0x4227('0x8')]('/',auth[_0x4227('0x9')](),controller[_0x4227('0xa')]);router['get'](_0x4227('0xb'),auth[_0x4227('0x9')](),controller[_0x4227('0xc')]);router['get'](_0x4227('0xd'),auth[_0x4227('0x9')](),controller[_0x4227('0xe')]);router[_0x4227('0x8')]('/:id/subjects',auth[_0x4227('0x9')](),controller[_0x4227('0xf')]);router[_0x4227('0x8')]('/:id/descriptions',auth[_0x4227('0x9')](),controller[_0x4227('0x10')]);router[_0x4227('0x11')]('/',auth[_0x4227('0x9')](),controller[_0x4227('0x12')]);router['put']('/:id',auth[_0x4227('0x9')](),controller[_0x4227('0x13')]);router[_0x4227('0x14')](_0x4227('0xb'),auth['isAuthenticated'](),controller[_0x4227('0x15')]);module['exports']=router; \ No newline at end of file +var _0x8909=['util','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','update','/:id','destroy','exports'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x8909,0xa8));var _0x9890=function(_0x17b0d4,_0x377add){_0x17b0d4=_0x17b0d4-0x0;var _0x2d02c7=_0x8909[_0x17b0d4];return _0x2d02c7;};'use strict';var multer=require('multer');var util=require(_0x9890('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9890('0x1'));var router=express['Router']();var fs_extra=require(_0x9890('0x2'));var auth=require(_0x9890('0x3'));var interaction=require(_0x9890('0x4'));var config=require('../../config/environment');var controller=require(_0x9890('0x5'));router[_0x9890('0x6')]('/',auth[_0x9890('0x7')](),controller[_0x9890('0x8')]);router[_0x9890('0x6')]('/:id',auth[_0x9890('0x7')](),controller['show']);router[_0x9890('0x6')](_0x9890('0x9'),auth[_0x9890('0x7')](),controller[_0x9890('0xa')]);router['get'](_0x9890('0xb'),auth[_0x9890('0x7')](),controller[_0x9890('0xc')]);router[_0x9890('0x6')](_0x9890('0xd'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0x9890('0xe')]('/',auth[_0x9890('0x7')](),controller[_0x9890('0xf')]);router[_0x9890('0x10')]('/:id',auth[_0x9890('0x7')](),controller[_0x9890('0x11')]);router['delete'](_0x9890('0x12'),auth[_0x9890('0x7')](),controller[_0x9890('0x13')]);module[_0x9890('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 15a6d35..46be58d 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 _0x1e6e=['STRING','sequelize'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0x1e6e,0x14b));var _0xe1e6=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0x1e6e[_0x40220a];return _0x3903cc;};'use strict';var Sequelize=require(_0xe1e6('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe1e6('0x1')]}}; \ No newline at end of file +var _0xdaa3=['exports','sequelize'];(function(_0x3358ba,_0x24c5fc){var _0x296e73=function(_0x843ff3){while(--_0x843ff3){_0x3358ba['push'](_0x3358ba['shift']());}};_0x296e73(++_0x24c5fc);}(_0xdaa3,0xef));var _0x3daa=function(_0x2a2849,_0x4bd9d8){_0x2a2849=_0x2a2849-0x0;var _0x3d5485=_0xdaa3[_0x2a2849];return _0x3d5485;};'use strict';var Sequelize=require(_0x3daa('0x0'));module[_0x3daa('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 69923e1..b8f5576 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 _0x0923=['sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','destroy','then','sendStatus','error','name','send','index','map','ServicenowConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','catch','show','params','length','find','create','body','getFields','findOne','ServicenowField','getSubjects','getDescriptions','pick','rimraf','zip-dir','request-promise','mustache','util','path'];(function(_0x597483,_0x24d999){var _0x5908f1=function(_0x47a4fd){while(--_0x47a4fd){_0x597483['push'](_0x597483['shift']());}};_0x5908f1(++_0x24d999);}(_0x0923,0x1da));var _0x3092=function(_0x504922,_0x52270d){_0x504922=_0x504922-0x0;var _0x5243d6=_0x0923[_0x504922];return _0x5243d6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3092('0x0'));var zipdir=require(_0x3092('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3092('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3092('0x3'));var util=require(_0x3092('0x4'));var path=require(_0x3092('0x5'));var sox=require(_0x3092('0x6'));var csv=require(_0x3092('0x7'));var ejs=require(_0x3092('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3092('0x9'));var squel=require(_0x3092('0xa'));var crypto=require(_0x3092('0xb'));var jsforce=require(_0x3092('0xc'));var deskjs=require(_0x3092('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3092('0xe'));var Redis=require(_0x3092('0xf'));var authService=require(_0x3092('0x10'));var qs=require(_0x3092('0x11'));var as=require(_0x3092('0x12'));var hardwareService=require(_0x3092('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x3092('0x14'));var config=require(_0x3092('0x15'));var licenseUtil=require(_0x3092('0x16'));var db=require(_0x3092('0x17'))['db'];function respondWithStatusCode(_0x5148a9,_0x3900e4){_0x3900e4=_0x3900e4||0xcc;return function(_0x548bfb){if(_0x548bfb){return _0x5148a9['sendStatus'](_0x3900e4);}return _0x5148a9['status'](_0x3900e4)[_0x3092('0x18')]();};}function respondWithResult(_0x203e42,_0x480dfc){_0x480dfc=_0x480dfc||0xc8;return function(_0x27258e){if(_0x27258e){return _0x203e42[_0x3092('0x19')](_0x480dfc)['json'](_0x27258e);}};}function respondWithFilteredResult(_0x274da5,_0x1d4f66){return function(_0x544ef3){if(_0x544ef3){var _0x2a3f26=typeof _0x1d4f66[_0x3092('0x1a')]===_0x3092('0x1b')&&typeof _0x1d4f66[_0x3092('0x1c')]===_0x3092('0x1b');var _0x3961ab=_0x544ef3[_0x3092('0x1d')];var _0x343bfc=_0x2a3f26?0x0:_0x1d4f66[_0x3092('0x1a')];var _0x4be8a4=_0x2a3f26?_0x544ef3[_0x3092('0x1d')]:_0x1d4f66[_0x3092('0x1a')]+_0x1d4f66['limit'];var _0x1ca09a;if(_0x4be8a4>=_0x3961ab){_0x4be8a4=_0x3961ab;_0x1ca09a=0xc8;}else{_0x1ca09a=0xce;}_0x274da5['status'](_0x1ca09a);return _0x274da5[_0x3092('0x1e')](_0x3092('0x1f'),_0x343bfc+'-'+_0x4be8a4+'/'+_0x3961ab)[_0x3092('0x20')](_0x544ef3);}return null;};}function patchUpdates(_0x2caa5f){return function(_0xdf7e5d){try{jsonpatch[_0x3092('0x21')](_0xdf7e5d,_0x2caa5f,!![]);}catch(_0x281316){return BPromise[_0x3092('0x22')](_0x281316);}return _0xdf7e5d['save']();};}function saveUpdates(_0x5d4e99,_0x4db781){return function(_0x314300){if(_0x314300){return _0x314300[_0x3092('0x23')](_0x5d4e99)['then'](function(_0x1f0f3c){return _0x1f0f3c;});}return null;};}function removeEntity(_0x59f792,_0xce0aa3){return function(_0x334993){if(_0x334993){return _0x334993[_0x3092('0x24')]()[_0x3092('0x25')](function(){_0x59f792['status'](0xcc)[_0x3092('0x18')]();});}};}function handleEntityNotFound(_0x5a275a,_0x46fc20){return function(_0xad1320){if(!_0xad1320){_0x5a275a[_0x3092('0x26')](0x194);}return _0xad1320;};}function handleError(_0x37a6b4,_0x529db7){_0x529db7=_0x529db7||0x1f4;return function(_0x592b7e){logger[_0x3092('0x27')](_0x592b7e['stack']);if(_0x592b7e[_0x3092('0x28')]){delete _0x592b7e['name'];}_0x37a6b4['status'](_0x529db7)[_0x3092('0x29')](_0x592b7e);};}exports[_0x3092('0x2a')]=function(_0x550341,_0x4c3f43){var _0x413277={},_0x42bafc={},_0x4bf917={'count':0x0,'rows':[]};var _0x1e8781=_[_0x3092('0x2b')](db[_0x3092('0x2c')][_0x3092('0x2d')],function(_0x152716){return{'name':_0x152716[_0x3092('0x2e')],'type':_0x152716[_0x3092('0x2f')][_0x3092('0x30')]};});_0x42bafc[_0x3092('0x31')]=_['map'](_0x1e8781,_0x3092('0x28'));_0x42bafc[_0x3092('0x32')]=_[_0x3092('0x33')](_0x550341['query']);_0x42bafc[_0x3092('0x34')]=_[_0x3092('0x35')](_0x42bafc[_0x3092('0x31')],_0x42bafc[_0x3092('0x32')]);_0x413277[_0x3092('0x36')]=_[_0x3092('0x35')](_0x42bafc[_0x3092('0x31')],qs[_0x3092('0x37')](_0x550341[_0x3092('0x32')][_0x3092('0x37')]));_0x413277[_0x3092('0x36')]=_0x413277[_0x3092('0x36')]['length']?_0x413277[_0x3092('0x36')]:_0x42bafc[_0x3092('0x31')];if(!_0x550341[_0x3092('0x32')][_0x3092('0x38')](_0x3092('0x39'))){_0x413277['limit']=qs[_0x3092('0x1c')](_0x550341[_0x3092('0x32')][_0x3092('0x1c')]);_0x413277['offset']=qs[_0x3092('0x1a')](_0x550341[_0x3092('0x32')]['offset']);}_0x413277[_0x3092('0x3a')]=qs[_0x3092('0x3b')](_0x550341[_0x3092('0x32')]['sort']);_0x413277[_0x3092('0x3c')]=qs[_0x3092('0x34')](_['pick'](_0x550341[_0x3092('0x32')],_0x42bafc[_0x3092('0x34')]),_0x1e8781);if(_0x550341[_0x3092('0x32')][_0x3092('0x3d')]){_0x413277['where']=_[_0x3092('0x3e')](_0x413277['where'],{'$or':_[_0x3092('0x2b')](_0x1e8781,function(_0x49d5e9){if(_0x49d5e9['type']!==_0x3092('0x3f')){var _0x92d201={};_0x92d201[_0x49d5e9[_0x3092('0x28')]]={'$like':'%'+_0x550341[_0x3092('0x32')][_0x3092('0x3d')]+'%'};return _0x92d201;}})});}_0x413277=_['merge']({},_0x413277,_0x550341[_0x3092('0x40')]);var _0xdf9f3={'where':_0x413277[_0x3092('0x3c')]};return db['ServicenowConfiguration'][_0x3092('0x1d')](_0xdf9f3)[_0x3092('0x25')](function(_0x5bcc44){_0x4bf917[_0x3092('0x1d')]=_0x5bcc44;if(_0x550341['query']['includeAll']){_0x413277[_0x3092('0x41')]=[{'all':!![]}];}return db['ServicenowConfiguration'][_0x3092('0x42')](_0x413277);})[_0x3092('0x25')](function(_0x24fdc5){_0x4bf917['rows']=_0x24fdc5;return _0x4bf917;})[_0x3092('0x25')](respondWithFilteredResult(_0x4c3f43,_0x413277))[_0x3092('0x43')](handleError(_0x4c3f43,null));};exports[_0x3092('0x44')]=function(_0x30fbb0,_0x37fbd6){var _0x421487={'raw':![],'where':{'id':_0x30fbb0[_0x3092('0x45')]['id']}},_0xda5e56={};_0xda5e56[_0x3092('0x31')]=_[_0x3092('0x33')](db['ServicenowConfiguration'][_0x3092('0x2d')]);_0xda5e56[_0x3092('0x32')]=_[_0x3092('0x33')](_0x30fbb0[_0x3092('0x32')]);_0xda5e56[_0x3092('0x34')]=_['intersection'](_0xda5e56[_0x3092('0x31')],_0xda5e56['query']);_0x421487['attributes']=_['intersection'](_0xda5e56[_0x3092('0x31')],qs['fields'](_0x30fbb0['query'][_0x3092('0x37')]));_0x421487[_0x3092('0x36')]=_0x421487[_0x3092('0x36')][_0x3092('0x46')]?_0x421487['attributes']:_0xda5e56[_0x3092('0x31')];if(_0x30fbb0[_0x3092('0x32')]['includeAll']){_0x421487['include']=[{'all':!![]}];}_0x421487=_[_0x3092('0x3e')]({},_0x421487,_0x30fbb0['options']);return db[_0x3092('0x2c')][_0x3092('0x47')](_0x421487)[_0x3092('0x25')](handleEntityNotFound(_0x37fbd6,null))[_0x3092('0x25')](respondWithResult(_0x37fbd6,null))['catch'](handleError(_0x37fbd6,null));};exports[_0x3092('0x48')]=function(_0x2d2001,_0x19f876){return db[_0x3092('0x2c')][_0x3092('0x48')](_0x2d2001[_0x3092('0x49')],{})[_0x3092('0x25')](respondWithResult(_0x19f876,0xc9))[_0x3092('0x43')](handleError(_0x19f876,null));};exports[_0x3092('0x23')]=function(_0x2a5691,_0x1ca3ae){if(_0x2a5691[_0x3092('0x49')]['id']){delete _0x2a5691[_0x3092('0x49')]['id'];}return db[_0x3092('0x2c')][_0x3092('0x47')]({'where':{'id':_0x2a5691[_0x3092('0x45')]['id']}})[_0x3092('0x25')](handleEntityNotFound(_0x1ca3ae,null))[_0x3092('0x25')](saveUpdates(_0x2a5691[_0x3092('0x49')],null))['then'](respondWithResult(_0x1ca3ae,null))[_0x3092('0x43')](handleError(_0x1ca3ae,null));};exports[_0x3092('0x24')]=function(_0x313fe2,_0x482c1f){return db[_0x3092('0x2c')][_0x3092('0x47')]({'where':{'id':_0x313fe2['params']['id']}})[_0x3092('0x25')](handleEntityNotFound(_0x482c1f,null))[_0x3092('0x25')](removeEntity(_0x482c1f,null))[_0x3092('0x43')](handleError(_0x482c1f,null));};exports[_0x3092('0x4a')]=function(_0x241c1b,_0x32c6cc,_0x3f9ad2){var _0x34050c={};var _0x57c411={};var _0x43aa2a;var _0x559fa2;return db[_0x3092('0x2c')][_0x3092('0x4b')]({'where':{'id':_0x241c1b[_0x3092('0x45')]['id']}})['then'](handleEntityNotFound(_0x32c6cc,null))[_0x3092('0x25')](function(_0x240c34){if(_0x240c34){_0x43aa2a=_0x240c34;_0x57c411[_0x3092('0x31')]=_['keys'](db[_0x3092('0x4c')][_0x3092('0x2d')]);_0x57c411[_0x3092('0x32')]=_[_0x3092('0x33')](_0x241c1b['query']);_0x57c411['filters']=_[_0x3092('0x35')](_0x57c411[_0x3092('0x31')],_0x57c411[_0x3092('0x32')]);_0x34050c[_0x3092('0x36')]=_[_0x3092('0x35')](_0x57c411['model'],qs['fields'](_0x241c1b[_0x3092('0x32')][_0x3092('0x37')]));_0x34050c[_0x3092('0x36')]=_0x34050c['attributes'][_0x3092('0x46')]?_0x34050c[_0x3092('0x36')]:_0x57c411[_0x3092('0x31')];_0x34050c[_0x3092('0x3a')]=qs[_0x3092('0x3b')](_0x241c1b[_0x3092('0x32')][_0x3092('0x3b')]);_0x34050c['where']=qs[_0x3092('0x34')](_['pick'](_0x241c1b['query'],_0x57c411[_0x3092('0x34')]));if(_0x241c1b['query'][_0x3092('0x3d')]){_0x34050c[_0x3092('0x3c')]=_[_0x3092('0x3e')](_0x34050c[_0x3092('0x3c')],{'$or':_[_0x3092('0x2b')](_0x34050c['attributes'],function(_0x2fc1a9){var _0x5bd147={};_0x5bd147[_0x2fc1a9]={'$like':'%'+_0x241c1b[_0x3092('0x32')][_0x3092('0x3d')]+'%'};return _0x5bd147;})});}_0x34050c=_[_0x3092('0x3e')]({},_0x34050c,_0x241c1b[_0x3092('0x40')]);return _0x43aa2a[_0x3092('0x4a')](_0x34050c);}})[_0x3092('0x25')](function(_0x176409){if(_0x176409){_0x559fa2=_0x176409['length'];if(!_0x241c1b['query']['hasOwnProperty'](_0x3092('0x39'))){_0x34050c[_0x3092('0x1c')]=qs[_0x3092('0x1c')](_0x241c1b[_0x3092('0x32')]['limit']);_0x34050c[_0x3092('0x1a')]=qs[_0x3092('0x1a')](_0x241c1b[_0x3092('0x32')]['offset']);}return _0x43aa2a[_0x3092('0x4a')](_0x34050c);}})['then'](function(_0x11e156){if(_0x11e156){return _0x11e156?{'count':_0x559fa2,'rows':_0x11e156}:null;}})['then'](respondWithResult(_0x32c6cc,null))[_0x3092('0x43')](handleError(_0x32c6cc,null));};exports[_0x3092('0x4d')]=function(_0xf07c87,_0x1a358d,_0x528eab){var _0x1d26b8={};var _0x52101d={};var _0x3e3c0e;var _0x281d89;return db[_0x3092('0x2c')][_0x3092('0x4b')]({'where':{'id':_0xf07c87[_0x3092('0x45')]['id']}})[_0x3092('0x25')](handleEntityNotFound(_0x1a358d,null))[_0x3092('0x25')](function(_0x4fa9b7){if(_0x4fa9b7){_0x3e3c0e=_0x4fa9b7;_0x52101d['model']=_[_0x3092('0x33')](db[_0x3092('0x4c')][_0x3092('0x2d')]);_0x52101d[_0x3092('0x32')]=_['keys'](_0xf07c87[_0x3092('0x32')]);_0x52101d['filters']=_[_0x3092('0x35')](_0x52101d[_0x3092('0x31')],_0x52101d[_0x3092('0x32')]);_0x1d26b8[_0x3092('0x36')]=_['intersection'](_0x52101d['model'],qs['fields'](_0xf07c87[_0x3092('0x32')][_0x3092('0x37')]));_0x1d26b8[_0x3092('0x36')]=_0x1d26b8[_0x3092('0x36')][_0x3092('0x46')]?_0x1d26b8['attributes']:_0x52101d[_0x3092('0x31')];_0x1d26b8['order']=qs['sort'](_0xf07c87['query'][_0x3092('0x3b')]);_0x1d26b8[_0x3092('0x3c')]=qs[_0x3092('0x34')](_['pick'](_0xf07c87[_0x3092('0x32')],_0x52101d[_0x3092('0x34')]));if(_0xf07c87[_0x3092('0x32')][_0x3092('0x3d')]){_0x1d26b8[_0x3092('0x3c')]=_[_0x3092('0x3e')](_0x1d26b8[_0x3092('0x3c')],{'$or':_['map'](_0x1d26b8['attributes'],function(_0x400136){var _0x1e0f22={};_0x1e0f22[_0x400136]={'$like':'%'+_0xf07c87[_0x3092('0x32')]['filter']+'%'};return _0x1e0f22;})});}_0x1d26b8=_[_0x3092('0x3e')]({},_0x1d26b8,_0xf07c87[_0x3092('0x40')]);return _0x3e3c0e[_0x3092('0x4d')](_0x1d26b8);}})['then'](function(_0x371141){if(_0x371141){_0x281d89=_0x371141[_0x3092('0x46')];if(!_0xf07c87[_0x3092('0x32')][_0x3092('0x38')](_0x3092('0x39'))){_0x1d26b8[_0x3092('0x1c')]=qs['limit'](_0xf07c87[_0x3092('0x32')][_0x3092('0x1c')]);_0x1d26b8[_0x3092('0x1a')]=qs['offset'](_0xf07c87[_0x3092('0x32')]['offset']);}return _0x3e3c0e[_0x3092('0x4d')](_0x1d26b8);}})[_0x3092('0x25')](function(_0xe08d84){if(_0xe08d84){return _0xe08d84?{'count':_0x281d89,'rows':_0xe08d84}:null;}})[_0x3092('0x25')](respondWithResult(_0x1a358d,null))[_0x3092('0x43')](handleError(_0x1a358d,null));};exports[_0x3092('0x4e')]=function(_0x1adb08,_0x467e80,_0x5e0d42){var _0x4d3ddd={};var _0x238e76={};var _0x1e3706;var _0x56ed72;return db[_0x3092('0x2c')]['findOne']({'where':{'id':_0x1adb08[_0x3092('0x45')]['id']}})[_0x3092('0x25')](handleEntityNotFound(_0x467e80,null))['then'](function(_0x5cc1a5){if(_0x5cc1a5){_0x1e3706=_0x5cc1a5;_0x238e76['model']=_[_0x3092('0x33')](db[_0x3092('0x4c')][_0x3092('0x2d')]);_0x238e76['query']=_[_0x3092('0x33')](_0x1adb08[_0x3092('0x32')]);_0x238e76[_0x3092('0x34')]=_[_0x3092('0x35')](_0x238e76[_0x3092('0x31')],_0x238e76[_0x3092('0x32')]);_0x4d3ddd[_0x3092('0x36')]=_[_0x3092('0x35')](_0x238e76['model'],qs[_0x3092('0x37')](_0x1adb08['query'][_0x3092('0x37')]));_0x4d3ddd[_0x3092('0x36')]=_0x4d3ddd[_0x3092('0x36')][_0x3092('0x46')]?_0x4d3ddd[_0x3092('0x36')]:_0x238e76[_0x3092('0x31')];_0x4d3ddd['order']=qs[_0x3092('0x3b')](_0x1adb08[_0x3092('0x32')][_0x3092('0x3b')]);_0x4d3ddd['where']=qs[_0x3092('0x34')](_[_0x3092('0x4f')](_0x1adb08[_0x3092('0x32')],_0x238e76[_0x3092('0x34')]));if(_0x1adb08[_0x3092('0x32')][_0x3092('0x3d')]){_0x4d3ddd[_0x3092('0x3c')]=_[_0x3092('0x3e')](_0x4d3ddd[_0x3092('0x3c')],{'$or':_[_0x3092('0x2b')](_0x4d3ddd[_0x3092('0x36')],function(_0x477bb7){var _0x21b1f9={};_0x21b1f9[_0x477bb7]={'$like':'%'+_0x1adb08[_0x3092('0x32')][_0x3092('0x3d')]+'%'};return _0x21b1f9;})});}_0x4d3ddd=_[_0x3092('0x3e')]({},_0x4d3ddd,_0x1adb08['options']);return _0x1e3706[_0x3092('0x4e')](_0x4d3ddd);}})[_0x3092('0x25')](function(_0x5f21a1){if(_0x5f21a1){_0x56ed72=_0x5f21a1[_0x3092('0x46')];if(!_0x1adb08['query'][_0x3092('0x38')](_0x3092('0x39'))){_0x4d3ddd['limit']=qs[_0x3092('0x1c')](_0x1adb08[_0x3092('0x32')]['limit']);_0x4d3ddd['offset']=qs[_0x3092('0x1a')](_0x1adb08['query'][_0x3092('0x1a')]);}return _0x1e3706['getDescriptions'](_0x4d3ddd);}})['then'](function(_0x59fead){if(_0x59fead){return _0x59fead?{'count':_0x56ed72,'rows':_0x59fead}:null;}})[_0x3092('0x25')](respondWithResult(_0x467e80,null))[_0x3092('0x43')](handleError(_0x467e80,null));}; \ No newline at end of file +var _0xdd7c=['pick','filter','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','fields','find','create','body','getFields','findOne','ServicenowField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','error','stack','name','index','map','ServicenowConfiguration','rawAttributes','fieldName','type','model','keys','filters','intersection','query','attributes','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0xef7207,_0xdc2797){var _0x4ca968=function(_0x380f6f){while(--_0x380f6f){_0xef7207['push'](_0xef7207['shift']());}};_0x4ca968(++_0xdc2797);}(_0xdd7c,0x15c));var _0xcdd7=function(_0x3042c5,_0x36cb88){_0x3042c5=_0x3042c5-0x0;var _0x7cd140=_0xdd7c[_0x3042c5];return _0x7cd140;};'use strict';var emlformat=require(_0xcdd7('0x0'));var rimraf=require(_0xcdd7('0x1'));var zipdir=require(_0xcdd7('0x2'));var jsonpatch=require(_0xcdd7('0x3'));var rp=require(_0xcdd7('0x4'));var moment=require(_0xcdd7('0x5'));var BPromise=require(_0xcdd7('0x6'));var Mustache=require(_0xcdd7('0x7'));var util=require(_0xcdd7('0x8'));var path=require(_0xcdd7('0x9'));var sox=require(_0xcdd7('0xa'));var csv=require(_0xcdd7('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcdd7('0xc'));var _=require(_0xcdd7('0xd'));var squel=require(_0xcdd7('0xe'));var crypto=require(_0xcdd7('0xf'));var jsforce=require(_0xcdd7('0x10'));var deskjs=require(_0xcdd7('0x11'));var toCsv=require('to-csv');var querystring=require(_0xcdd7('0x12'));var Papa=require(_0xcdd7('0x13'));var Redis=require(_0xcdd7('0x14'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xcdd7('0x15'));var hardwareService=require(_0xcdd7('0x16'));var logger=require(_0xcdd7('0x17'))(_0xcdd7('0x18'));var utils=require(_0xcdd7('0x19'));var config=require(_0xcdd7('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4a3425,_0x39fecc){_0x39fecc=_0x39fecc||0xcc;return function(_0x2155c0){if(_0x2155c0){return _0x4a3425[_0xcdd7('0x1b')](_0x39fecc);}return _0x4a3425[_0xcdd7('0x1c')](_0x39fecc)[_0xcdd7('0x1d')]();};}function respondWithResult(_0x4add76,_0x46f444){_0x46f444=_0x46f444||0xc8;return function(_0x1edad8){if(_0x1edad8){return _0x4add76[_0xcdd7('0x1c')](_0x46f444)[_0xcdd7('0x1e')](_0x1edad8);}};}function respondWithFilteredResult(_0x2951c6,_0x1ce4d3){return function(_0x49adb1){if(_0x49adb1){var _0x455006=typeof _0x1ce4d3[_0xcdd7('0x1f')]===_0xcdd7('0x20')&&typeof _0x1ce4d3[_0xcdd7('0x21')]===_0xcdd7('0x20');var _0x216e9e=_0x49adb1[_0xcdd7('0x22')];var _0x12dfaf=_0x455006?0x0:_0x1ce4d3['offset'];var _0x2348d=_0x455006?_0x49adb1[_0xcdd7('0x22')]:_0x1ce4d3[_0xcdd7('0x1f')]+_0x1ce4d3[_0xcdd7('0x21')];var _0x420fda;if(_0x2348d>=_0x216e9e){_0x2348d=_0x216e9e;_0x420fda=0xc8;}else{_0x420fda=0xce;}_0x2951c6[_0xcdd7('0x1c')](_0x420fda);return _0x2951c6[_0xcdd7('0x23')]('Content-Range',_0x12dfaf+'-'+_0x2348d+'/'+_0x216e9e)[_0xcdd7('0x1e')](_0x49adb1);}return null;};}function patchUpdates(_0x530ec9){return function(_0x3f62e7){try{jsonpatch[_0xcdd7('0x24')](_0x3f62e7,_0x530ec9,!![]);}catch(_0x2c6c99){return BPromise[_0xcdd7('0x25')](_0x2c6c99);}return _0x3f62e7['save']();};}function saveUpdates(_0x13ad16,_0x39d13b){return function(_0x316f51){if(_0x316f51){return _0x316f51[_0xcdd7('0x26')](_0x13ad16)[_0xcdd7('0x27')](function(_0x336f17){return _0x336f17;});}return null;};}function removeEntity(_0x3681c7,_0x1144bf){return function(_0x5c2111){if(_0x5c2111){return _0x5c2111[_0xcdd7('0x28')]()[_0xcdd7('0x27')](function(){_0x3681c7['status'](0xcc)[_0xcdd7('0x1d')]();});}};}function handleEntityNotFound(_0x365792,_0x1a8ca0){return function(_0x835993){if(!_0x835993){_0x365792[_0xcdd7('0x1b')](0x194);}return _0x835993;};}function handleError(_0x4bb50b,_0x4b50d0){_0x4b50d0=_0x4b50d0||0x1f4;return function(_0x56123e){logger[_0xcdd7('0x29')](_0x56123e[_0xcdd7('0x2a')]);if(_0x56123e['name']){delete _0x56123e[_0xcdd7('0x2b')];}_0x4bb50b[_0xcdd7('0x1c')](_0x4b50d0)['send'](_0x56123e);};}exports[_0xcdd7('0x2c')]=function(_0x2333fe,_0x250aac){var _0x290322={},_0x5ace46={},_0x4ad1eb={'count':0x0,'rows':[]};var _0x122100=_[_0xcdd7('0x2d')](db[_0xcdd7('0x2e')][_0xcdd7('0x2f')],function(_0x37f560){return{'name':_0x37f560[_0xcdd7('0x30')],'type':_0x37f560[_0xcdd7('0x31')]['key']};});_0x5ace46[_0xcdd7('0x32')]=_[_0xcdd7('0x2d')](_0x122100,_0xcdd7('0x2b'));_0x5ace46['query']=_[_0xcdd7('0x33')](_0x2333fe['query']);_0x5ace46[_0xcdd7('0x34')]=_[_0xcdd7('0x35')](_0x5ace46['model'],_0x5ace46[_0xcdd7('0x36')]);_0x290322[_0xcdd7('0x37')]=_[_0xcdd7('0x35')](_0x5ace46[_0xcdd7('0x32')],qs['fields'](_0x2333fe[_0xcdd7('0x36')]['fields']));_0x290322[_0xcdd7('0x37')]=_0x290322['attributes'][_0xcdd7('0x38')]?_0x290322[_0xcdd7('0x37')]:_0x5ace46['model'];if(!_0x2333fe['query'][_0xcdd7('0x39')](_0xcdd7('0x3a'))){_0x290322[_0xcdd7('0x21')]=qs[_0xcdd7('0x21')](_0x2333fe[_0xcdd7('0x36')][_0xcdd7('0x21')]);_0x290322['offset']=qs['offset'](_0x2333fe[_0xcdd7('0x36')][_0xcdd7('0x1f')]);}_0x290322[_0xcdd7('0x3b')]=qs[_0xcdd7('0x3c')](_0x2333fe['query'][_0xcdd7('0x3c')]);_0x290322[_0xcdd7('0x3d')]=qs[_0xcdd7('0x34')](_[_0xcdd7('0x3e')](_0x2333fe[_0xcdd7('0x36')],_0x5ace46[_0xcdd7('0x34')]),_0x122100);if(_0x2333fe['query'][_0xcdd7('0x3f')]){_0x290322[_0xcdd7('0x3d')]=_['merge'](_0x290322[_0xcdd7('0x3d')],{'$or':_[_0xcdd7('0x2d')](_0x122100,function(_0x478189){if(_0x478189[_0xcdd7('0x31')]!==_0xcdd7('0x40')){var _0x253438={};_0x253438[_0x478189['name']]={'$like':'%'+_0x2333fe[_0xcdd7('0x36')][_0xcdd7('0x3f')]+'%'};return _0x253438;}})});}_0x290322=_[_0xcdd7('0x41')]({},_0x290322,_0x2333fe[_0xcdd7('0x42')]);var _0x58bdfb={'where':_0x290322['where']};return db[_0xcdd7('0x2e')][_0xcdd7('0x22')](_0x58bdfb)['then'](function(_0x527a46){_0x4ad1eb[_0xcdd7('0x22')]=_0x527a46;if(_0x2333fe['query']['includeAll']){_0x290322[_0xcdd7('0x43')]=[{'all':!![]}];}return db[_0xcdd7('0x2e')][_0xcdd7('0x44')](_0x290322);})['then'](function(_0x146eb2){_0x4ad1eb[_0xcdd7('0x45')]=_0x146eb2;return _0x4ad1eb;})['then'](respondWithFilteredResult(_0x250aac,_0x290322))[_0xcdd7('0x46')](handleError(_0x250aac,null));};exports[_0xcdd7('0x47')]=function(_0x2af389,_0x4fd3b4){var _0x762d72={'raw':![],'where':{'id':_0x2af389[_0xcdd7('0x48')]['id']}},_0x3ad4d8={};_0x3ad4d8[_0xcdd7('0x32')]=_[_0xcdd7('0x33')](db[_0xcdd7('0x2e')][_0xcdd7('0x2f')]);_0x3ad4d8['query']=_[_0xcdd7('0x33')](_0x2af389[_0xcdd7('0x36')]);_0x3ad4d8['filters']=_['intersection'](_0x3ad4d8[_0xcdd7('0x32')],_0x3ad4d8['query']);_0x762d72[_0xcdd7('0x37')]=_[_0xcdd7('0x35')](_0x3ad4d8[_0xcdd7('0x32')],qs[_0xcdd7('0x49')](_0x2af389['query'][_0xcdd7('0x49')]));_0x762d72[_0xcdd7('0x37')]=_0x762d72[_0xcdd7('0x37')][_0xcdd7('0x38')]?_0x762d72[_0xcdd7('0x37')]:_0x3ad4d8[_0xcdd7('0x32')];if(_0x2af389[_0xcdd7('0x36')]['includeAll']){_0x762d72[_0xcdd7('0x43')]=[{'all':!![]}];}_0x762d72=_[_0xcdd7('0x41')]({},_0x762d72,_0x2af389[_0xcdd7('0x42')]);return db[_0xcdd7('0x2e')][_0xcdd7('0x4a')](_0x762d72)['then'](handleEntityNotFound(_0x4fd3b4,null))[_0xcdd7('0x27')](respondWithResult(_0x4fd3b4,null))['catch'](handleError(_0x4fd3b4,null));};exports[_0xcdd7('0x4b')]=function(_0x2a4962,_0xeafc7){return db[_0xcdd7('0x2e')][_0xcdd7('0x4b')](_0x2a4962[_0xcdd7('0x4c')],{})[_0xcdd7('0x27')](respondWithResult(_0xeafc7,0xc9))[_0xcdd7('0x46')](handleError(_0xeafc7,null));};exports[_0xcdd7('0x26')]=function(_0x23057c,_0x48b593){if(_0x23057c[_0xcdd7('0x4c')]['id']){delete _0x23057c[_0xcdd7('0x4c')]['id'];}return db['ServicenowConfiguration'][_0xcdd7('0x4a')]({'where':{'id':_0x23057c[_0xcdd7('0x48')]['id']}})['then'](handleEntityNotFound(_0x48b593,null))[_0xcdd7('0x27')](saveUpdates(_0x23057c[_0xcdd7('0x4c')],null))['then'](respondWithResult(_0x48b593,null))[_0xcdd7('0x46')](handleError(_0x48b593,null));};exports[_0xcdd7('0x28')]=function(_0x4eab3e,_0x16d2ea){return db['ServicenowConfiguration'][_0xcdd7('0x4a')]({'where':{'id':_0x4eab3e[_0xcdd7('0x48')]['id']}})['then'](handleEntityNotFound(_0x16d2ea,null))[_0xcdd7('0x27')](removeEntity(_0x16d2ea,null))[_0xcdd7('0x46')](handleError(_0x16d2ea,null));};exports[_0xcdd7('0x4d')]=function(_0xe3b8d,_0x399e82,_0x4aa082){var _0x462d8e={};var _0x165135={};var _0x44efd4;var _0x5f3c59;return db[_0xcdd7('0x2e')][_0xcdd7('0x4e')]({'where':{'id':_0xe3b8d[_0xcdd7('0x48')]['id']}})['then'](handleEntityNotFound(_0x399e82,null))[_0xcdd7('0x27')](function(_0x42dc2e){if(_0x42dc2e){_0x44efd4=_0x42dc2e;_0x165135[_0xcdd7('0x32')]=_[_0xcdd7('0x33')](db[_0xcdd7('0x4f')][_0xcdd7('0x2f')]);_0x165135[_0xcdd7('0x36')]=_['keys'](_0xe3b8d[_0xcdd7('0x36')]);_0x165135[_0xcdd7('0x34')]=_[_0xcdd7('0x35')](_0x165135[_0xcdd7('0x32')],_0x165135['query']);_0x462d8e[_0xcdd7('0x37')]=_[_0xcdd7('0x35')](_0x165135[_0xcdd7('0x32')],qs[_0xcdd7('0x49')](_0xe3b8d['query'][_0xcdd7('0x49')]));_0x462d8e['attributes']=_0x462d8e[_0xcdd7('0x37')][_0xcdd7('0x38')]?_0x462d8e[_0xcdd7('0x37')]:_0x165135[_0xcdd7('0x32')];_0x462d8e['order']=qs[_0xcdd7('0x3c')](_0xe3b8d[_0xcdd7('0x36')][_0xcdd7('0x3c')]);_0x462d8e[_0xcdd7('0x3d')]=qs[_0xcdd7('0x34')](_['pick'](_0xe3b8d[_0xcdd7('0x36')],_0x165135[_0xcdd7('0x34')]));if(_0xe3b8d['query'][_0xcdd7('0x3f')]){_0x462d8e[_0xcdd7('0x3d')]=_[_0xcdd7('0x41')](_0x462d8e[_0xcdd7('0x3d')],{'$or':_[_0xcdd7('0x2d')](_0x462d8e[_0xcdd7('0x37')],function(_0x3eaca9){var _0x145d57={};_0x145d57[_0x3eaca9]={'$like':'%'+_0xe3b8d[_0xcdd7('0x36')]['filter']+'%'};return _0x145d57;})});}_0x462d8e=_[_0xcdd7('0x41')]({},_0x462d8e,_0xe3b8d['options']);return _0x44efd4[_0xcdd7('0x4d')](_0x462d8e);}})[_0xcdd7('0x27')](function(_0x4d7bdd){if(_0x4d7bdd){_0x5f3c59=_0x4d7bdd['length'];if(!_0xe3b8d['query']['hasOwnProperty'](_0xcdd7('0x3a'))){_0x462d8e['limit']=qs['limit'](_0xe3b8d[_0xcdd7('0x36')][_0xcdd7('0x21')]);_0x462d8e[_0xcdd7('0x1f')]=qs[_0xcdd7('0x1f')](_0xe3b8d['query'][_0xcdd7('0x1f')]);}return _0x44efd4['getFields'](_0x462d8e);}})[_0xcdd7('0x27')](function(_0x3c2ac9){if(_0x3c2ac9){return _0x3c2ac9?{'count':_0x5f3c59,'rows':_0x3c2ac9}:null;}})[_0xcdd7('0x27')](respondWithResult(_0x399e82,null))[_0xcdd7('0x46')](handleError(_0x399e82,null));};exports[_0xcdd7('0x50')]=function(_0x4e4ef4,_0xe9c171,_0x118fe9){var _0x66b424={};var _0x20540c={};var _0x199722;var _0x46713f;return db['ServicenowConfiguration'][_0xcdd7('0x4e')]({'where':{'id':_0x4e4ef4[_0xcdd7('0x48')]['id']}})[_0xcdd7('0x27')](handleEntityNotFound(_0xe9c171,null))[_0xcdd7('0x27')](function(_0x31b270){if(_0x31b270){_0x199722=_0x31b270;_0x20540c[_0xcdd7('0x32')]=_[_0xcdd7('0x33')](db[_0xcdd7('0x4f')][_0xcdd7('0x2f')]);_0x20540c[_0xcdd7('0x36')]=_[_0xcdd7('0x33')](_0x4e4ef4[_0xcdd7('0x36')]);_0x20540c[_0xcdd7('0x34')]=_['intersection'](_0x20540c[_0xcdd7('0x32')],_0x20540c['query']);_0x66b424[_0xcdd7('0x37')]=_[_0xcdd7('0x35')](_0x20540c[_0xcdd7('0x32')],qs[_0xcdd7('0x49')](_0x4e4ef4[_0xcdd7('0x36')][_0xcdd7('0x49')]));_0x66b424[_0xcdd7('0x37')]=_0x66b424[_0xcdd7('0x37')][_0xcdd7('0x38')]?_0x66b424['attributes']:_0x20540c[_0xcdd7('0x32')];_0x66b424[_0xcdd7('0x3b')]=qs['sort'](_0x4e4ef4[_0xcdd7('0x36')]['sort']);_0x66b424[_0xcdd7('0x3d')]=qs[_0xcdd7('0x34')](_[_0xcdd7('0x3e')](_0x4e4ef4['query'],_0x20540c[_0xcdd7('0x34')]));if(_0x4e4ef4[_0xcdd7('0x36')][_0xcdd7('0x3f')]){_0x66b424['where']=_[_0xcdd7('0x41')](_0x66b424['where'],{'$or':_[_0xcdd7('0x2d')](_0x66b424[_0xcdd7('0x37')],function(_0xc1d5a3){var _0x79497b={};_0x79497b[_0xc1d5a3]={'$like':'%'+_0x4e4ef4[_0xcdd7('0x36')][_0xcdd7('0x3f')]+'%'};return _0x79497b;})});}_0x66b424=_[_0xcdd7('0x41')]({},_0x66b424,_0x4e4ef4[_0xcdd7('0x42')]);return _0x199722[_0xcdd7('0x50')](_0x66b424);}})['then'](function(_0x855838){if(_0x855838){_0x46713f=_0x855838['length'];if(!_0x4e4ef4[_0xcdd7('0x36')]['hasOwnProperty']('nolimit')){_0x66b424[_0xcdd7('0x21')]=qs[_0xcdd7('0x21')](_0x4e4ef4['query'][_0xcdd7('0x21')]);_0x66b424[_0xcdd7('0x1f')]=qs[_0xcdd7('0x1f')](_0x4e4ef4[_0xcdd7('0x36')][_0xcdd7('0x1f')]);}return _0x199722[_0xcdd7('0x50')](_0x66b424);}})['then'](function(_0x27e8b9){if(_0x27e8b9){return _0x27e8b9?{'count':_0x46713f,'rows':_0x27e8b9}:null;}})[_0xcdd7('0x27')](respondWithResult(_0xe9c171,null))['catch'](handleError(_0xe9c171,null));};exports['getDescriptions']=function(_0x547a88,_0x234ca6,_0x463d4e){var _0x5a03b1={};var _0x4d9ce8={};var _0x3d199d;var _0xbd8b36;return db[_0xcdd7('0x2e')]['findOne']({'where':{'id':_0x547a88[_0xcdd7('0x48')]['id']}})['then'](handleEntityNotFound(_0x234ca6,null))[_0xcdd7('0x27')](function(_0x54b470){if(_0x54b470){_0x3d199d=_0x54b470;_0x4d9ce8[_0xcdd7('0x32')]=_['keys'](db[_0xcdd7('0x4f')]['rawAttributes']);_0x4d9ce8[_0xcdd7('0x36')]=_['keys'](_0x547a88[_0xcdd7('0x36')]);_0x4d9ce8[_0xcdd7('0x34')]=_['intersection'](_0x4d9ce8[_0xcdd7('0x32')],_0x4d9ce8[_0xcdd7('0x36')]);_0x5a03b1['attributes']=_[_0xcdd7('0x35')](_0x4d9ce8[_0xcdd7('0x32')],qs[_0xcdd7('0x49')](_0x547a88[_0xcdd7('0x36')]['fields']));_0x5a03b1[_0xcdd7('0x37')]=_0x5a03b1[_0xcdd7('0x37')][_0xcdd7('0x38')]?_0x5a03b1[_0xcdd7('0x37')]:_0x4d9ce8[_0xcdd7('0x32')];_0x5a03b1[_0xcdd7('0x3b')]=qs[_0xcdd7('0x3c')](_0x547a88[_0xcdd7('0x36')][_0xcdd7('0x3c')]);_0x5a03b1[_0xcdd7('0x3d')]=qs['filters'](_[_0xcdd7('0x3e')](_0x547a88['query'],_0x4d9ce8[_0xcdd7('0x34')]));if(_0x547a88[_0xcdd7('0x36')][_0xcdd7('0x3f')]){_0x5a03b1[_0xcdd7('0x3d')]=_[_0xcdd7('0x41')](_0x5a03b1['where'],{'$or':_[_0xcdd7('0x2d')](_0x5a03b1['attributes'],function(_0x2eb886){var _0x4a3c0c={};_0x4a3c0c[_0x2eb886]={'$like':'%'+_0x547a88[_0xcdd7('0x36')][_0xcdd7('0x3f')]+'%'};return _0x4a3c0c;})});}_0x5a03b1=_[_0xcdd7('0x41')]({},_0x5a03b1,_0x547a88[_0xcdd7('0x42')]);return _0x3d199d['getDescriptions'](_0x5a03b1);}})[_0xcdd7('0x27')](function(_0x4729ba){if(_0x4729ba){_0xbd8b36=_0x4729ba['length'];if(!_0x547a88[_0xcdd7('0x36')][_0xcdd7('0x39')]('nolimit')){_0x5a03b1[_0xcdd7('0x21')]=qs[_0xcdd7('0x21')](_0x547a88[_0xcdd7('0x36')][_0xcdd7('0x21')]);_0x5a03b1[_0xcdd7('0x1f')]=qs[_0xcdd7('0x1f')](_0x547a88['query'][_0xcdd7('0x1f')]);}return _0x3d199d[_0xcdd7('0x51')](_0x5a03b1);}})['then'](function(_0x44fdd8){if(_0x44fdd8){return _0x44fdd8?{'count':_0xbd8b36,'rows':_0x44fdd8}:null;}})[_0xcdd7('0x27')](respondWithResult(_0x234ca6,null))['catch'](handleError(_0x234ca6,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index b77d91d..aa1a4b8 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 _0x7b37=['int_servicenow_configurations','lodash','util','api','moment','request-promise','rimraf','../../config/environment','./intServicenowConfiguration.attributes'];(function(_0x1e1fd5,_0x1173d8){var _0x397946=function(_0x5c2e42){while(--_0x5c2e42){_0x1e1fd5['push'](_0x1e1fd5['shift']());}};_0x397946(++_0x1173d8);}(_0x7b37,0xd9));var _0x77b3=function(_0x2eb9e9,_0x3dfdd7){_0x2eb9e9=_0x2eb9e9-0x0;var _0x3279aa=_0x7b37[_0x2eb9e9];return _0x3279aa;};'use strict';var _=require(_0x77b3('0x0'));var util=require(_0x77b3('0x1'));var logger=require('../../config/logger')(_0x77b3('0x2'));var moment=require(_0x77b3('0x3'));var BPromise=require('bluebird');var rp=require(_0x77b3('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x77b3('0x5'));var config=require(_0x77b3('0x6'));var attributes=require(_0x77b3('0x7'));module['exports']=function(_0x3acdea,_0x32345c){return _0x3acdea['define']('ServicenowConfiguration',attributes,{'tableName':_0x77b3('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x49db=['util','../../config/logger','api','moment','request-promise','path','rimraf','./intServicenowConfiguration.attributes','define','ServicenowConfiguration','lodash'];(function(_0x448313,_0x2b5e0f){var _0x3740be=function(_0x130a0d){while(--_0x130a0d){_0x448313['push'](_0x448313['shift']());}};_0x3740be(++_0x2b5e0f);}(_0x49db,0xc5));var _0xb49d=function(_0x5b1f89,_0x49933a){_0x5b1f89=_0x5b1f89-0x0;var _0x2276ca=_0x49db[_0x5b1f89];return _0x2276ca;};'use strict';var _=require(_0xb49d('0x0'));var util=require(_0xb49d('0x1'));var logger=require(_0xb49d('0x2'))(_0xb49d('0x3'));var moment=require(_0xb49d('0x4'));var BPromise=require('bluebird');var rp=require(_0xb49d('0x5'));var fs=require('fs');var path=require(_0xb49d('0x6'));var rimraf=require(_0xb49d('0x7'));var config=require('../../config/environment');var attributes=require(_0xb49d('0x8'));module['exports']=function(_0x4c6887,_0x144a9a){return _0x4c6887[_0xb49d('0x9')](_0xb49d('0xa'),attributes,{'tableName':'int_servicenow_configurations','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 4ea0ac0..c0c8e8d 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 _0x2d79=['debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x4ad9c3,_0x156d65){var _0x2beae7=function(_0x2c51f0){while(--_0x2c51f0){_0x4ad9c3['push'](_0x4ad9c3['shift']());}};_0x2beae7(++_0x156d65);}(_0x2d79,0x7a));var _0x92d7=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x2d79[_0x19950b];return _0x3c6b41;};'use strict';var _=require('lodash');var util=require(_0x92d7('0x0'));var moment=require(_0x92d7('0x1'));var BPromise=require('bluebird');var rs=require(_0x92d7('0x2'));var fs=require('fs');var Redis=require(_0x92d7('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x92d7('0x4'));var logger=require(_0x92d7('0x5'))(_0x92d7('0x6'));var config=require(_0x92d7('0x7'));var jayson=require(_0x92d7('0x8'));var client=jayson[_0x92d7('0x9')][_0x92d7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e3448,_0x2d05b4,_0x231447){return new BPromise(function(_0xbc1e1b,_0x40a415){return client[_0x92d7('0xb')](_0x1e3448,_0x231447)[_0x92d7('0xc')](function(_0xe82224){logger[_0x92d7('0xd')](_0x92d7('0xe'),_0x2d05b4,_0x92d7('0xf'));logger[_0x92d7('0x10')](_0x92d7('0x11'),_0x2d05b4,_0x92d7('0xf'),JSON[_0x92d7('0x12')](_0xe82224));if(_0xe82224[_0x92d7('0x13')]){if(_0xe82224[_0x92d7('0x13')]['code']===0x1f4){logger[_0x92d7('0x13')](_0x92d7('0xe'),_0x2d05b4,_0xe82224[_0x92d7('0x13')][_0x92d7('0x14')]);return _0x40a415(_0xe82224[_0x92d7('0x13')][_0x92d7('0x14')]);}logger['error'](_0x92d7('0xe'),_0x2d05b4,_0xe82224[_0x92d7('0x13')][_0x92d7('0x14')]);return _0xbc1e1b(_0xe82224['error'][_0x92d7('0x14')]);}else{logger[_0x92d7('0xd')](_0x92d7('0xe'),_0x2d05b4,'request\x20sent');_0xbc1e1b(_0xe82224[_0x92d7('0x15')][_0x92d7('0x14')]);}})[_0x92d7('0x16')](function(_0x362269){logger[_0x92d7('0x13')](_0x92d7('0xe'),_0x2d05b4,_0x362269);_0x40a415(_0x362269);});});} \ No newline at end of file +var _0xbc89=['then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x29996a,_0x1c69c3){var _0x1dd7a7=function(_0x1eb412){while(--_0x1eb412){_0x29996a['push'](_0x29996a['shift']());}};_0x1dd7a7(++_0x1c69c3);}(_0xbc89,0x9c));var _0x9bc8=function(_0x31147e,_0x2ff5b9){_0x31147e=_0x31147e-0x0;var _0x395bf8=_0xbc89[_0x31147e];return _0x395bf8;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x9bc8('0x0'));var rs=require(_0x9bc8('0x1'));var fs=require('fs');var Redis=require(_0x9bc8('0x2'));var db=require(_0x9bc8('0x3'))['db'];var utils=require(_0x9bc8('0x4'));var logger=require(_0x9bc8('0x5'))(_0x9bc8('0x6'));var config=require(_0x9bc8('0x7'));var jayson=require(_0x9bc8('0x8'));var client=jayson[_0x9bc8('0x9')][_0x9bc8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x417bb1,_0x5f16c8,_0x5eb132){return new BPromise(function(_0x486e97,_0x578b31){return client[_0x9bc8('0xb')](_0x417bb1,_0x5eb132)[_0x9bc8('0xc')](function(_0x212f43){logger[_0x9bc8('0xd')](_0x9bc8('0xe'),_0x5f16c8,_0x9bc8('0xf'));logger[_0x9bc8('0x10')](_0x9bc8('0x11'),_0x5f16c8,_0x9bc8('0xf'),JSON[_0x9bc8('0x12')](_0x212f43));if(_0x212f43[_0x9bc8('0x13')]){if(_0x212f43[_0x9bc8('0x13')][_0x9bc8('0x14')]===0x1f4){logger['error'](_0x9bc8('0xe'),_0x5f16c8,_0x212f43[_0x9bc8('0x13')]['message']);return _0x578b31(_0x212f43[_0x9bc8('0x13')][_0x9bc8('0x15')]);}logger['error'](_0x9bc8('0xe'),_0x5f16c8,_0x212f43[_0x9bc8('0x13')][_0x9bc8('0x15')]);return _0x486e97(_0x212f43[_0x9bc8('0x13')][_0x9bc8('0x15')]);}else{logger[_0x9bc8('0xd')](_0x9bc8('0xe'),_0x5f16c8,'request\x20sent');_0x486e97(_0x212f43[_0x9bc8('0x16')][_0x9bc8('0x15')]);}})[_0x9bc8('0x17')](function(_0x16d830){logger[_0x9bc8('0x13')](_0x9bc8('0xe'),_0x5f16c8,_0x16d830);_0x578b31(_0x16d830);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 209ed0d..6da92b7 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 _0x574f=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','index','/:id','show','post','put','isAuthenticated','update','delete','destroy','exports','util','path','connect-timeout','express','Router'];(function(_0x3b75a5,_0x3cae9b){var _0x349f3c=function(_0x3cf235){while(--_0x3cf235){_0x3b75a5['push'](_0x3b75a5['shift']());}};_0x349f3c(++_0x3cae9b);}(_0x574f,0x136));var _0xf574=function(_0x54fe94,_0x1e1295){_0x54fe94=_0x54fe94-0x0;var _0x301b8a=_0x574f[_0x54fe94];return _0x301b8a;};'use strict';var multer=require('multer');var util=require(_0xf574('0x0'));var path=require(_0xf574('0x1'));var timeout=require(_0xf574('0x2'));var express=require(_0xf574('0x3'));var router=express[_0xf574('0x4')]();var fs_extra=require(_0xf574('0x5'));var auth=require(_0xf574('0x6'));var interaction=require(_0xf574('0x7'));var config=require(_0xf574('0x8'));var controller=require(_0xf574('0x9'));router[_0xf574('0xa')]('/',auth['isAuthenticated'](),controller[_0xf574('0xb')]);router[_0xf574('0xa')](_0xf574('0xc'),auth['isAuthenticated'](),controller[_0xf574('0xd')]);router[_0xf574('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xf574('0xf')](_0xf574('0xc'),auth[_0xf574('0x10')](),controller[_0xf574('0x11')]);router[_0xf574('0x12')](_0xf574('0xc'),auth[_0xf574('0x10')](),controller[_0xf574('0x13')]);module[_0xf574('0x14')]=router; \ No newline at end of file +var _0x0a66=['../../components/auth/service','../../components/interaction/service','./intServicenowField.controller','isAuthenticated','index','get','/:id','show','post','put','update','delete','destroy','util','path','express','Router'];(function(_0x40f310,_0x33f8ba){var _0x414b2d=function(_0x23aa85){while(--_0x23aa85){_0x40f310['push'](_0x40f310['shift']());}};_0x414b2d(++_0x33f8ba);}(_0x0a66,0x10c));var _0x60a6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0a66[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0x60a6('0x0'));var path=require(_0x60a6('0x1'));var timeout=require('connect-timeout');var express=require(_0x60a6('0x2'));var router=express[_0x60a6('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x60a6('0x4'));var interaction=require(_0x60a6('0x5'));var config=require('../../config/environment');var controller=require(_0x60a6('0x6'));router['get']('/',auth[_0x60a6('0x7')](),controller[_0x60a6('0x8')]);router[_0x60a6('0x9')](_0x60a6('0xa'),auth[_0x60a6('0x7')](),controller[_0x60a6('0xb')]);router[_0x60a6('0xc')]('/',auth[_0x60a6('0x7')](),controller['create']);router[_0x60a6('0xd')](_0x60a6('0xa'),auth[_0x60a6('0x7')](),controller[_0x60a6('0xe')]);router[_0x60a6('0xf')]('/:id',auth[_0x60a6('0x7')](),controller[_0x60a6('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index b39d1dc..9e486c4 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 _0xe968=['STRING','ENUM','sequelize','exports','string','variable','customVariable','keyValue','picklist'];(function(_0x4dec3f,_0x1e94a4){var _0x20f5c8=function(_0x49cfd0){while(--_0x49cfd0){_0x4dec3f['push'](_0x4dec3f['shift']());}};_0x20f5c8(++_0x1e94a4);}(_0xe968,0xb6));var _0x8e96=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xe968[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0x8e96('0x0'));module[_0x8e96('0x1')]={'type':{'type':Sequelize['ENUM'](_0x8e96('0x2'),_0x8e96('0x3'),_0x8e96('0x4'),_0x8e96('0x5'),_0x8e96('0x6')),'defaultValue':_0x8e96('0x2')},'content':{'type':Sequelize[_0x8e96('0x7')]},'key':{'type':Sequelize[_0x8e96('0x7')]},'keyType':{'type':Sequelize[_0x8e96('0x8')]('string',_0x8e96('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x8e96('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x8e96('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd177=['variable','customVariable','keyValue','string','STRING','BOOLEAN','sequelize','ENUM'];(function(_0x999b85,_0x1edc2b){var _0x1d7124=function(_0x59cd29){while(--_0x59cd29){_0x999b85['push'](_0x999b85['shift']());}};_0x1d7124(++_0x1edc2b);}(_0xd177,0x8e));var _0x7d17=function(_0x1f159a,_0x469311){_0x1f159a=_0x1f159a-0x0;var _0x1f46b9=_0xd177[_0x1f159a];return _0x1f46b9;};'use strict';var Sequelize=require(_0x7d17('0x0'));module['exports']={'type':{'type':Sequelize[_0x7d17('0x1')]('string',_0x7d17('0x2'),_0x7d17('0x3'),_0x7d17('0x4'),'picklist'),'defaultValue':_0x7d17('0x5')},'content':{'type':Sequelize[_0x7d17('0x6')]},'key':{'type':Sequelize[_0x7d17('0x6')]},'keyType':{'type':Sequelize[_0x7d17('0x1')](_0x7d17('0x5'),_0x7d17('0x2'),_0x7d17('0x3'))},'keyContent':{'type':Sequelize[_0x7d17('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x7d17('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7d17('0x6')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index f535138..ee0267a 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 _0x65d1=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','then','destroy','error','stack','name','send','index','map','ServicenowField','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','merge','type','VIRTUAL','options','where','includeAll','include','rows','catch','show','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x61b8f1,_0x5731a9){var _0x5a49ef=function(_0x5aa3c3){while(--_0x5aa3c3){_0x61b8f1['push'](_0x61b8f1['shift']());}};_0x5a49ef(++_0x5731a9);}(_0x65d1,0x8c));var _0x165d=function(_0x4ef77b,_0x6a3df){_0x4ef77b=_0x4ef77b-0x0;var _0x58d1a6=_0x65d1[_0x4ef77b];return _0x58d1a6;};'use strict';var emlformat=require(_0x165d('0x0'));var rimraf=require(_0x165d('0x1'));var zipdir=require(_0x165d('0x2'));var jsonpatch=require(_0x165d('0x3'));var rp=require(_0x165d('0x4'));var moment=require('moment');var BPromise=require(_0x165d('0x5'));var Mustache=require(_0x165d('0x6'));var util=require(_0x165d('0x7'));var path=require('path');var sox=require(_0x165d('0x8'));var csv=require(_0x165d('0x9'));var ejs=require(_0x165d('0xa'));var fs=require('fs');var fs_extra=require(_0x165d('0xb'));var _=require('lodash');var squel=require(_0x165d('0xc'));var crypto=require(_0x165d('0xd'));var jsforce=require(_0x165d('0xe'));var deskjs=require(_0x165d('0xf'));var toCsv=require(_0x165d('0x9'));var querystring=require(_0x165d('0x10'));var Papa=require(_0x165d('0x11'));var Redis=require('ioredis');var authService=require(_0x165d('0x12'));var qs=require(_0x165d('0x13'));var as=require(_0x165d('0x14'));var hardwareService=require(_0x165d('0x15'));var logger=require(_0x165d('0x16'))(_0x165d('0x17'));var utils=require(_0x165d('0x18'));var config=require(_0x165d('0x19'));var licenseUtil=require(_0x165d('0x1a'));var db=require(_0x165d('0x1b'))['db'];function respondWithStatusCode(_0x26245d,_0x5ae2be){_0x5ae2be=_0x5ae2be||0xcc;return function(_0x12c356){if(_0x12c356){return _0x26245d[_0x165d('0x1c')](_0x5ae2be);}return _0x26245d[_0x165d('0x1d')](_0x5ae2be)[_0x165d('0x1e')]();};}function respondWithResult(_0x15bb02,_0x2daad0){_0x2daad0=_0x2daad0||0xc8;return function(_0x2228a4){if(_0x2228a4){return _0x15bb02[_0x165d('0x1d')](_0x2daad0)[_0x165d('0x1f')](_0x2228a4);}};}function respondWithFilteredResult(_0x1bd82e,_0x4905c7){return function(_0x411a8c){if(_0x411a8c){var _0x379c65=typeof _0x4905c7[_0x165d('0x20')]==='undefined'&&typeof _0x4905c7['limit']===_0x165d('0x21');var _0x492d4c=_0x411a8c[_0x165d('0x22')];var _0x153197=_0x379c65?0x0:_0x4905c7[_0x165d('0x20')];var _0x18d0db=_0x379c65?_0x411a8c[_0x165d('0x22')]:_0x4905c7[_0x165d('0x20')]+_0x4905c7[_0x165d('0x23')];var _0xa682aa;if(_0x18d0db>=_0x492d4c){_0x18d0db=_0x492d4c;_0xa682aa=0xc8;}else{_0xa682aa=0xce;}_0x1bd82e['status'](_0xa682aa);return _0x1bd82e[_0x165d('0x24')]('Content-Range',_0x153197+'-'+_0x18d0db+'/'+_0x492d4c)[_0x165d('0x1f')](_0x411a8c);}return null;};}function patchUpdates(_0x1f505d){return function(_0x34851b){try{jsonpatch[_0x165d('0x25')](_0x34851b,_0x1f505d,!![]);}catch(_0x3c3e11){return BPromise[_0x165d('0x26')](_0x3c3e11);}return _0x34851b[_0x165d('0x27')]();};}function saveUpdates(_0x506374,_0x273f44){return function(_0x2fd014){if(_0x2fd014){return _0x2fd014['update'](_0x506374)[_0x165d('0x28')](function(_0x33b828){return _0x33b828;});}return null;};}function removeEntity(_0x5476bb,_0x572d0a){return function(_0x325f63){if(_0x325f63){return _0x325f63[_0x165d('0x29')]()['then'](function(){_0x5476bb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3cb7ca,_0x4fc2a4){return function(_0x80af97){if(!_0x80af97){_0x3cb7ca[_0x165d('0x1c')](0x194);}return _0x80af97;};}function handleError(_0x3112d9,_0x3e4d36){_0x3e4d36=_0x3e4d36||0x1f4;return function(_0xf72813){logger[_0x165d('0x2a')](_0xf72813[_0x165d('0x2b')]);if(_0xf72813[_0x165d('0x2c')]){delete _0xf72813[_0x165d('0x2c')];}_0x3112d9['status'](_0x3e4d36)[_0x165d('0x2d')](_0xf72813);};}exports[_0x165d('0x2e')]=function(_0x44ffa7,_0x3f7e40){var _0xfa153c={},_0x453860={},_0x897f04={'count':0x0,'rows':[]};var _0x151c33=_[_0x165d('0x2f')](db[_0x165d('0x30')][_0x165d('0x31')],function(_0x30687f){return{'name':_0x30687f[_0x165d('0x32')],'type':_0x30687f['type'][_0x165d('0x33')]};});_0x453860[_0x165d('0x34')]=_[_0x165d('0x2f')](_0x151c33,_0x165d('0x2c'));_0x453860[_0x165d('0x35')]=_[_0x165d('0x36')](_0x44ffa7['query']);_0x453860[_0x165d('0x37')]=_[_0x165d('0x38')](_0x453860['model'],_0x453860[_0x165d('0x35')]);_0xfa153c[_0x165d('0x39')]=_[_0x165d('0x38')](_0x453860[_0x165d('0x34')],qs[_0x165d('0x3a')](_0x44ffa7[_0x165d('0x35')][_0x165d('0x3a')]));_0xfa153c[_0x165d('0x39')]=_0xfa153c[_0x165d('0x39')][_0x165d('0x3b')]?_0xfa153c[_0x165d('0x39')]:_0x453860[_0x165d('0x34')];if(!_0x44ffa7[_0x165d('0x35')][_0x165d('0x3c')](_0x165d('0x3d'))){_0xfa153c[_0x165d('0x23')]=qs[_0x165d('0x23')](_0x44ffa7[_0x165d('0x35')][_0x165d('0x23')]);_0xfa153c[_0x165d('0x20')]=qs['offset'](_0x44ffa7[_0x165d('0x35')][_0x165d('0x20')]);}_0xfa153c[_0x165d('0x3e')]=qs[_0x165d('0x3f')](_0x44ffa7['query'][_0x165d('0x3f')]);_0xfa153c['where']=qs[_0x165d('0x37')](_[_0x165d('0x40')](_0x44ffa7[_0x165d('0x35')],_0x453860['filters']),_0x151c33);if(_0x44ffa7['query']['filter']){_0xfa153c['where']=_[_0x165d('0x41')](_0xfa153c['where'],{'$or':_[_0x165d('0x2f')](_0x151c33,function(_0x4bea30){if(_0x4bea30[_0x165d('0x42')]!==_0x165d('0x43')){var _0x415f26={};_0x415f26[_0x4bea30[_0x165d('0x2c')]]={'$like':'%'+_0x44ffa7[_0x165d('0x35')]['filter']+'%'};return _0x415f26;}})});}_0xfa153c=_[_0x165d('0x41')]({},_0xfa153c,_0x44ffa7[_0x165d('0x44')]);var _0x2650e3={'where':_0xfa153c[_0x165d('0x45')]};return db[_0x165d('0x30')][_0x165d('0x22')](_0x2650e3)[_0x165d('0x28')](function(_0x552b60){_0x897f04[_0x165d('0x22')]=_0x552b60;if(_0x44ffa7[_0x165d('0x35')][_0x165d('0x46')]){_0xfa153c[_0x165d('0x47')]=[{'all':!![]}];}return db[_0x165d('0x30')]['findAll'](_0xfa153c);})[_0x165d('0x28')](function(_0x1b461a){_0x897f04[_0x165d('0x48')]=_0x1b461a;return _0x897f04;})[_0x165d('0x28')](respondWithFilteredResult(_0x3f7e40,_0xfa153c))[_0x165d('0x49')](handleError(_0x3f7e40,null));};exports[_0x165d('0x4a')]=function(_0x3f00ca,_0x3379a8){var _0x639743={'raw':!![],'where':{'id':_0x3f00ca['params']['id']}},_0x1a8faf={};_0x1a8faf[_0x165d('0x34')]=_[_0x165d('0x36')](db[_0x165d('0x30')]['rawAttributes']);_0x1a8faf[_0x165d('0x35')]=_['keys'](_0x3f00ca[_0x165d('0x35')]);_0x1a8faf[_0x165d('0x37')]=_[_0x165d('0x38')](_0x1a8faf[_0x165d('0x34')],_0x1a8faf[_0x165d('0x35')]);_0x639743[_0x165d('0x39')]=_[_0x165d('0x38')](_0x1a8faf[_0x165d('0x34')],qs[_0x165d('0x3a')](_0x3f00ca[_0x165d('0x35')][_0x165d('0x3a')]));_0x639743[_0x165d('0x39')]=_0x639743[_0x165d('0x39')][_0x165d('0x3b')]?_0x639743[_0x165d('0x39')]:_0x1a8faf[_0x165d('0x34')];if(_0x3f00ca[_0x165d('0x35')][_0x165d('0x46')]){_0x639743[_0x165d('0x47')]=[{'all':!![]}];}_0x639743=_['merge']({},_0x639743,_0x3f00ca[_0x165d('0x44')]);return db[_0x165d('0x30')][_0x165d('0x4b')](_0x639743)[_0x165d('0x28')](handleEntityNotFound(_0x3379a8,null))[_0x165d('0x28')](respondWithResult(_0x3379a8,null))[_0x165d('0x49')](handleError(_0x3379a8,null));};exports[_0x165d('0x4c')]=function(_0x1532ec,_0x4dc07e){return db[_0x165d('0x30')][_0x165d('0x4c')](_0x1532ec[_0x165d('0x4d')],{})['then'](respondWithResult(_0x4dc07e,0xc9))['catch'](handleError(_0x4dc07e,null));};exports['update']=function(_0x280b52,_0xaeee80){if(_0x280b52[_0x165d('0x4d')]['id']){delete _0x280b52['body']['id'];}return db[_0x165d('0x30')][_0x165d('0x4b')]({'where':{'id':_0x280b52[_0x165d('0x4e')]['id']}})['then'](handleEntityNotFound(_0xaeee80,null))[_0x165d('0x28')](saveUpdates(_0x280b52[_0x165d('0x4d')],null))[_0x165d('0x28')](respondWithResult(_0xaeee80,null))['catch'](handleError(_0xaeee80,null));};exports[_0x165d('0x29')]=function(_0x5d3889,_0x4d1b4f){return db[_0x165d('0x30')][_0x165d('0x4b')]({'where':{'id':_0x5d3889[_0x165d('0x4e')]['id']}})[_0x165d('0x28')](handleEntityNotFound(_0x4d1b4f,null))[_0x165d('0x28')](removeEntity(_0x4d1b4f,null))[_0x165d('0x49')](handleError(_0x4d1b4f,null));}; \ No newline at end of file +var _0xfbba=['save','update','then','destroy','error','name','send','map','ServicenowField','rawAttributes','type','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','include','rows','catch','show','params','includeAll','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject'];(function(_0x105577,_0x3af1f1){var _0x28bbd6=function(_0x5d16cb){while(--_0x5d16cb){_0x105577['push'](_0x105577['shift']());}};_0x28bbd6(++_0x3af1f1);}(_0xfbba,0xfe));var _0xafbb=function(_0x443177,_0x29ca2f){_0x443177=_0x443177-0x0;var _0x463d65=_0xfbba[_0x443177];return _0x463d65;};'use strict';var emlformat=require(_0xafbb('0x0'));var rimraf=require(_0xafbb('0x1'));var zipdir=require(_0xafbb('0x2'));var jsonpatch=require(_0xafbb('0x3'));var rp=require(_0xafbb('0x4'));var moment=require(_0xafbb('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xafbb('0x6'));var util=require(_0xafbb('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xafbb('0x8'));var ejs=require(_0xafbb('0x9'));var fs=require('fs');var fs_extra=require(_0xafbb('0xa'));var _=require(_0xafbb('0xb'));var squel=require(_0xafbb('0xc'));var crypto=require(_0xafbb('0xd'));var jsforce=require(_0xafbb('0xe'));var deskjs=require(_0xafbb('0xf'));var toCsv=require(_0xafbb('0x8'));var querystring=require('querystring');var Papa=require(_0xafbb('0x10'));var Redis=require(_0xafbb('0x11'));var authService=require(_0xafbb('0x12'));var qs=require(_0xafbb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xafbb('0x14'));var logger=require(_0xafbb('0x15'))(_0xafbb('0x16'));var utils=require('../../config/utils');var config=require(_0xafbb('0x17'));var licenseUtil=require(_0xafbb('0x18'));var db=require(_0xafbb('0x19'))['db'];function respondWithStatusCode(_0x1e71c1,_0x114c2d){_0x114c2d=_0x114c2d||0xcc;return function(_0x3f120a){if(_0x3f120a){return _0x1e71c1[_0xafbb('0x1a')](_0x114c2d);}return _0x1e71c1['status'](_0x114c2d)[_0xafbb('0x1b')]();};}function respondWithResult(_0x5930cd,_0x2905c9){_0x2905c9=_0x2905c9||0xc8;return function(_0x15ddcd){if(_0x15ddcd){return _0x5930cd[_0xafbb('0x1c')](_0x2905c9)[_0xafbb('0x1d')](_0x15ddcd);}};}function respondWithFilteredResult(_0x3cd6b2,_0x2beebe){return function(_0x3e6ffe){if(_0x3e6ffe){var _0x3603be=typeof _0x2beebe[_0xafbb('0x1e')]===_0xafbb('0x1f')&&typeof _0x2beebe[_0xafbb('0x20')]==='undefined';var _0x2a6d19=_0x3e6ffe[_0xafbb('0x21')];var _0x26b8bf=_0x3603be?0x0:_0x2beebe[_0xafbb('0x1e')];var _0x1224c7=_0x3603be?_0x3e6ffe[_0xafbb('0x21')]:_0x2beebe[_0xafbb('0x1e')]+_0x2beebe[_0xafbb('0x20')];var _0x1c0abf;if(_0x1224c7>=_0x2a6d19){_0x1224c7=_0x2a6d19;_0x1c0abf=0xc8;}else{_0x1c0abf=0xce;}_0x3cd6b2['status'](_0x1c0abf);return _0x3cd6b2[_0xafbb('0x22')](_0xafbb('0x23'),_0x26b8bf+'-'+_0x1224c7+'/'+_0x2a6d19)[_0xafbb('0x1d')](_0x3e6ffe);}return null;};}function patchUpdates(_0x10fec3){return function(_0x2e5850){try{jsonpatch[_0xafbb('0x24')](_0x2e5850,_0x10fec3,!![]);}catch(_0x51eefb){return BPromise[_0xafbb('0x25')](_0x51eefb);}return _0x2e5850[_0xafbb('0x26')]();};}function saveUpdates(_0x721511,_0x313063){return function(_0x921d7a){if(_0x921d7a){return _0x921d7a[_0xafbb('0x27')](_0x721511)[_0xafbb('0x28')](function(_0x537d94){return _0x537d94;});}return null;};}function removeEntity(_0x1dedf7,_0x1d53bc){return function(_0x5c4423){if(_0x5c4423){return _0x5c4423[_0xafbb('0x29')]()[_0xafbb('0x28')](function(){_0x1dedf7[_0xafbb('0x1c')](0xcc)[_0xafbb('0x1b')]();});}};}function handleEntityNotFound(_0x322e2c,_0x34825e){return function(_0x105d4b){if(!_0x105d4b){_0x322e2c[_0xafbb('0x1a')](0x194);}return _0x105d4b;};}function handleError(_0x3b9fb1,_0x2653f7){_0x2653f7=_0x2653f7||0x1f4;return function(_0x362ea4){logger[_0xafbb('0x2a')](_0x362ea4['stack']);if(_0x362ea4[_0xafbb('0x2b')]){delete _0x362ea4[_0xafbb('0x2b')];}_0x3b9fb1[_0xafbb('0x1c')](_0x2653f7)[_0xafbb('0x2c')](_0x362ea4);};}exports['index']=function(_0x435720,_0x3922e4){var _0x8b7913={},_0x1b0ec4={},_0x3ce70c={'count':0x0,'rows':[]};var _0x47a83f=_[_0xafbb('0x2d')](db[_0xafbb('0x2e')][_0xafbb('0x2f')],function(_0x594c54){return{'name':_0x594c54['fieldName'],'type':_0x594c54[_0xafbb('0x30')]['key']};});_0x1b0ec4[_0xafbb('0x31')]=_['map'](_0x47a83f,'name');_0x1b0ec4['query']=_[_0xafbb('0x32')](_0x435720['query']);_0x1b0ec4[_0xafbb('0x33')]=_[_0xafbb('0x34')](_0x1b0ec4[_0xafbb('0x31')],_0x1b0ec4[_0xafbb('0x35')]);_0x8b7913['attributes']=_[_0xafbb('0x34')](_0x1b0ec4['model'],qs[_0xafbb('0x36')](_0x435720[_0xafbb('0x35')][_0xafbb('0x36')]));_0x8b7913[_0xafbb('0x37')]=_0x8b7913['attributes'][_0xafbb('0x38')]?_0x8b7913['attributes']:_0x1b0ec4[_0xafbb('0x31')];if(!_0x435720[_0xafbb('0x35')][_0xafbb('0x39')](_0xafbb('0x3a'))){_0x8b7913[_0xafbb('0x20')]=qs[_0xafbb('0x20')](_0x435720[_0xafbb('0x35')][_0xafbb('0x20')]);_0x8b7913[_0xafbb('0x1e')]=qs[_0xafbb('0x1e')](_0x435720['query'][_0xafbb('0x1e')]);}_0x8b7913['order']=qs[_0xafbb('0x3b')](_0x435720['query'][_0xafbb('0x3b')]);_0x8b7913[_0xafbb('0x3c')]=qs['filters'](_['pick'](_0x435720[_0xafbb('0x35')],_0x1b0ec4[_0xafbb('0x33')]),_0x47a83f);if(_0x435720[_0xafbb('0x35')][_0xafbb('0x3d')]){_0x8b7913[_0xafbb('0x3c')]=_[_0xafbb('0x3e')](_0x8b7913['where'],{'$or':_['map'](_0x47a83f,function(_0x1fb3e1){if(_0x1fb3e1[_0xafbb('0x30')]!==_0xafbb('0x3f')){var _0x3e0ea5={};_0x3e0ea5[_0x1fb3e1[_0xafbb('0x2b')]]={'$like':'%'+_0x435720['query']['filter']+'%'};return _0x3e0ea5;}})});}_0x8b7913=_[_0xafbb('0x3e')]({},_0x8b7913,_0x435720['options']);var _0x191a1b={'where':_0x8b7913[_0xafbb('0x3c')]};return db[_0xafbb('0x2e')]['count'](_0x191a1b)[_0xafbb('0x28')](function(_0x1b8993){_0x3ce70c[_0xafbb('0x21')]=_0x1b8993;if(_0x435720[_0xafbb('0x35')]['includeAll']){_0x8b7913[_0xafbb('0x40')]=[{'all':!![]}];}return db[_0xafbb('0x2e')]['findAll'](_0x8b7913);})[_0xafbb('0x28')](function(_0x557a21){_0x3ce70c[_0xafbb('0x41')]=_0x557a21;return _0x3ce70c;})[_0xafbb('0x28')](respondWithFilteredResult(_0x3922e4,_0x8b7913))[_0xafbb('0x42')](handleError(_0x3922e4,null));};exports[_0xafbb('0x43')]=function(_0x26b35f,_0x53564a){var _0x131577={'raw':!![],'where':{'id':_0x26b35f[_0xafbb('0x44')]['id']}},_0x303fc9={};_0x303fc9['model']=_[_0xafbb('0x32')](db['ServicenowField'][_0xafbb('0x2f')]);_0x303fc9[_0xafbb('0x35')]=_['keys'](_0x26b35f[_0xafbb('0x35')]);_0x303fc9[_0xafbb('0x33')]=_['intersection'](_0x303fc9[_0xafbb('0x31')],_0x303fc9[_0xafbb('0x35')]);_0x131577[_0xafbb('0x37')]=_['intersection'](_0x303fc9['model'],qs[_0xafbb('0x36')](_0x26b35f[_0xafbb('0x35')][_0xafbb('0x36')]));_0x131577[_0xafbb('0x37')]=_0x131577[_0xafbb('0x37')][_0xafbb('0x38')]?_0x131577[_0xafbb('0x37')]:_0x303fc9[_0xafbb('0x31')];if(_0x26b35f[_0xafbb('0x35')][_0xafbb('0x45')]){_0x131577[_0xafbb('0x40')]=[{'all':!![]}];}_0x131577=_[_0xafbb('0x3e')]({},_0x131577,_0x26b35f['options']);return db[_0xafbb('0x2e')][_0xafbb('0x46')](_0x131577)[_0xafbb('0x28')](handleEntityNotFound(_0x53564a,null))[_0xafbb('0x28')](respondWithResult(_0x53564a,null))['catch'](handleError(_0x53564a,null));};exports[_0xafbb('0x47')]=function(_0x19ea8f,_0x404eaa){return db[_0xafbb('0x2e')]['create'](_0x19ea8f[_0xafbb('0x48')],{})[_0xafbb('0x28')](respondWithResult(_0x404eaa,0xc9))[_0xafbb('0x42')](handleError(_0x404eaa,null));};exports['update']=function(_0x30173a,_0x4d13a9){if(_0x30173a[_0xafbb('0x48')]['id']){delete _0x30173a[_0xafbb('0x48')]['id'];}return db[_0xafbb('0x2e')][_0xafbb('0x46')]({'where':{'id':_0x30173a[_0xafbb('0x44')]['id']}})['then'](handleEntityNotFound(_0x4d13a9,null))[_0xafbb('0x28')](saveUpdates(_0x30173a[_0xafbb('0x48')],null))['then'](respondWithResult(_0x4d13a9,null))[_0xafbb('0x42')](handleError(_0x4d13a9,null));};exports[_0xafbb('0x29')]=function(_0x3722fb,_0x44ec21){return db[_0xafbb('0x2e')][_0xafbb('0x46')]({'where':{'id':_0x3722fb[_0xafbb('0x44')]['id']}})[_0xafbb('0x28')](handleEntityNotFound(_0x44ec21,null))[_0xafbb('0x28')](removeEntity(_0x44ec21,null))[_0xafbb('0x42')](handleError(_0x44ec21,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 760e387..ed0b52b 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 _0x8c6f=['bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowField.attributes','exports','idField','FieldId','util','../../config/logger','api','moment'];(function(_0x2e76d5,_0xa83ceb){var _0x3ecae9=function(_0xaab140){while(--_0xaab140){_0x2e76d5['push'](_0x2e76d5['shift']());}};_0x3ecae9(++_0xa83ceb);}(_0x8c6f,0x8b));var _0xf8c6=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x8c6f[_0x57b54c];return _0x59cc19;};'use strict';var _=require('lodash');var util=require(_0xf8c6('0x0'));var logger=require(_0xf8c6('0x1'))(_0xf8c6('0x2'));var moment=require(_0xf8c6('0x3'));var BPromise=require(_0xf8c6('0x4'));var rp=require(_0xf8c6('0x5'));var fs=require('fs');var path=require(_0xf8c6('0x6'));var rimraf=require(_0xf8c6('0x7'));var config=require(_0xf8c6('0x8'));var attributes=require(_0xf8c6('0x9'));module[_0xf8c6('0xa')]=function(_0x191cca,_0xa83af9){return _0x191cca['define']('ServicenowField',attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0xf8c6('0xb'),_0xf8c6('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf460=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowField.attributes','exports','define','ServicenowField','int_servicenow_fields','idField','FieldId','lodash'];(function(_0x2a09d4,_0x22f00f){var _0x2e0bd4=function(_0x5131c5){while(--_0x5131c5){_0x2a09d4['push'](_0x2a09d4['shift']());}};_0x2e0bd4(++_0x22f00f);}(_0xf460,0xff));var _0x0f46=function(_0x2edd6e,_0x58921f){_0x2edd6e=_0x2edd6e-0x0;var _0x3b0431=_0xf460[_0x2edd6e];return _0x3b0431;};'use strict';var _=require(_0x0f46('0x0'));var util=require(_0x0f46('0x1'));var logger=require(_0x0f46('0x2'))(_0x0f46('0x3'));var moment=require('moment');var BPromise=require(_0x0f46('0x4'));var rp=require(_0x0f46('0x5'));var fs=require('fs');var path=require(_0x0f46('0x6'));var rimraf=require(_0x0f46('0x7'));var config=require(_0x0f46('0x8'));var attributes=require(_0x0f46('0x9'));module[_0x0f46('0xa')]=function(_0x562b5f,_0x3bca4b){return _0x562b5f[_0x0f46('0xb')](_0x0f46('0xc'),attributes,{'tableName':_0x0f46('0xd'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0x0f46('0xe'),_0x0f46('0xf')],'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 6cfdec8..bde4bcc 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 _0xf4eb=['ServicenowField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0xb9404d,_0xb9c541){var _0x5cfcf7=function(_0x1732d2){while(--_0x1732d2){_0xb9404d['push'](_0xb9404d['shift']());}};_0x5cfcf7(++_0xb9c541);}(_0xf4eb,0xec));var _0xbf4e=function(_0xbf8a06,_0x4c0fe0){_0xbf8a06=_0xbf8a06-0x0;var _0x56176a=_0xf4eb[_0xbf8a06];return _0x56176a;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf4e('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbf4e('0x2'))(_0xbf4e('0x3'));var config=require(_0xbf4e('0x4'));var jayson=require(_0xbf4e('0x5'));var client=jayson[_0xbf4e('0x6')][_0xbf4e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15b99f,_0x540736,_0x449d55){return new BPromise(function(_0x5013c2,_0x5e23d4){return client[_0xbf4e('0x8')](_0x15b99f,_0x449d55)[_0xbf4e('0x9')](function(_0xcc4097){logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));logger[_0xbf4e('0xd')]('ServicenowField,\x20%s,\x20%s,\x20%s',_0x540736,'request\x20sent',JSON[_0xbf4e('0xe')](_0xcc4097));if(_0xcc4097['error']){if(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x10')]===0x1f4){logger['error'](_0xbf4e('0xb'),_0x540736,_0xcc4097['error']['message']);return _0x5e23d4(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);}logger[_0xbf4e('0xf')](_0xbf4e('0xb'),_0x540736,_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);return _0x5013c2(_0xcc4097['error']['message']);}else{logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));_0x5013c2(_0xcc4097['result'][_0xbf4e('0x11')]);}})[_0xbf4e('0x12')](function(_0x912fc0){logger[_0xbf4e('0xf')]('ServicenowField,\x20%s,\x20%s',_0x540736,_0x912fc0);_0x5e23d4(_0x912fc0);});});} \ No newline at end of file +var _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s'];(function(_0x2ee0de,_0x26e645){var _0x50a185=function(_0x353cde){while(--_0x353cde){_0x2ee0de['push'](_0x2ee0de['shift']());}};_0x50a185(++_0x26e645);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1ee0a1,_0x51058e){_0x1ee0a1=_0x1ee0a1-0x0;var _0x1d2d5b=_0xcb91[_0x1ee0a1];return _0x1d2d5b;};'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')]('ServicenowField,\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 diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index e0d7cf2..136d488 100644 --- a/server/api/intSugarcrmAccount/index.js +++ b/server/api/intSugarcrmAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x3a8931,_0x36e7a7){var _0x34dd86=function(_0xfe9f74){while(--_0xfe9f74){_0x3a8931['push'](_0x3a8931['shift']());}};_0x34dd86(++_0x36e7a7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('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','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x1f6f3e,_0x14ec02){var _0x32ea7e=function(_0x69b277){while(--_0x69b277){_0x1f6f3e['push'](_0x1f6f3e['shift']());}};_0x32ea7e(++_0x14ec02);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index 02acfff..b306922 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(_0x2f432f,_0x23c29c){var _0x3c5ef3=function(_0x2d4261){while(--_0x2d4261){_0x2f432f['push'](_0x2f432f['shift']());}};_0x3c5ef3(++_0x23c29c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'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(_0x4f6a3b,_0x23aecc){var _0x1a998e=function(_0x67e18a){while(--_0x67e18a){_0x4f6a3b['push'](_0x4f6a3b['shift']());}};_0x1a998e(++_0x23aecc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'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 8a8ae0a..28b14c2 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 _0xe3a5=['../../config/logger','api','../../config/environment','../../config/license/util','../../components/integrations/configuration','status','end','offset','undefined','count','set','Content-Range','json','apply','reject','save','update','destroy','then','stack','send','index','map','rawAttributes','type','name','query','keys','intersection','model','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','SugarcrmAccount','create','body','find','getConfigurations','findOne','SugarcrmConfiguration','length','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','SugarcrmField','Descriptions','getFields','assigned_user_id','description','duration_hours','parent_id','parent_name','direction','username','password','remoteUri','slice','substring','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','JSON','stringify','PLAIN','Invalid\x20Login','Password\x20Expired','get_module_fields','Calls','values','module_fields','includes','label','endsWith','value','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x568363,_0x2e79a7){var _0x47f0ed=function(_0x7d922b){while(--_0x7d922b){_0x568363['push'](_0x568363['shift']());}};_0x47f0ed(++_0x2e79a7);}(_0xe3a5,0xdc));var _0x5e3a=function(_0x366872,_0x5b9df7){_0x366872=_0x366872-0x0;var _0x3ab5dc=_0xe3a5[_0x366872];return _0x3ab5dc;};'use strict';var emlformat=require(_0x5e3a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5e3a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5e3a('0x2'));var moment=require(_0x5e3a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5e3a('0x4'));var util=require(_0x5e3a('0x5'));var path=require(_0x5e3a('0x6'));var sox=require(_0x5e3a('0x7'));var csv=require(_0x5e3a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5e3a('0x9'));var _=require('lodash');var squel=require(_0x5e3a('0xa'));var crypto=require(_0x5e3a('0xb'));var jsforce=require(_0x5e3a('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x5e3a('0x8'));var querystring=require(_0x5e3a('0xd'));var Papa=require(_0x5e3a('0xe'));var Redis=require(_0x5e3a('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x5e3a('0x10'));var as=require(_0x5e3a('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5e3a('0x12'))(_0x5e3a('0x13'));var utils=require('../../config/utils');var config=require(_0x5e3a('0x14'));var licenseUtil=require(_0x5e3a('0x15'));var db=require('../../mysqldb')['db'];var integrations=require(_0x5e3a('0x16'));function respondWithStatusCode(_0x202376,_0x25d02e){_0x25d02e=_0x25d02e||0xcc;return function(_0xd5e31c){if(_0xd5e31c){return _0x202376['sendStatus'](_0x25d02e);}return _0x202376[_0x5e3a('0x17')](_0x25d02e)[_0x5e3a('0x18')]();};}function respondWithResult(_0x33dbc5,_0x637ff0){_0x637ff0=_0x637ff0||0xc8;return function(_0x88b0c1){if(_0x88b0c1){return _0x33dbc5['status'](_0x637ff0)['json'](_0x88b0c1);}};}function respondWithFilteredResult(_0x6aa945,_0x1dde56){return function(_0x378d41){if(_0x378d41){var _0x5f1b65=typeof _0x1dde56[_0x5e3a('0x19')]===_0x5e3a('0x1a')&&typeof _0x1dde56['limit']===_0x5e3a('0x1a');var _0x501880=_0x378d41['count'];var _0x1baab4=_0x5f1b65?0x0:_0x1dde56[_0x5e3a('0x19')];var _0x210c20=_0x5f1b65?_0x378d41[_0x5e3a('0x1b')]:_0x1dde56['offset']+_0x1dde56['limit'];var _0x36d827;if(_0x210c20>=_0x501880){_0x210c20=_0x501880;_0x36d827=0xc8;}else{_0x36d827=0xce;}_0x6aa945['status'](_0x36d827);return _0x6aa945[_0x5e3a('0x1c')](_0x5e3a('0x1d'),_0x1baab4+'-'+_0x210c20+'/'+_0x501880)[_0x5e3a('0x1e')](_0x378d41);}return null;};}function patchUpdates(_0x4640a5){return function(_0x8aa225){try{jsonpatch[_0x5e3a('0x1f')](_0x8aa225,_0x4640a5,!![]);}catch(_0x520df8){return BPromise[_0x5e3a('0x20')](_0x520df8);}return _0x8aa225[_0x5e3a('0x21')]();};}function saveUpdates(_0x2388c9,_0x7feb89){return function(_0x53f05b){if(_0x53f05b){return _0x53f05b[_0x5e3a('0x22')](_0x2388c9)['then'](function(_0x5f1b77){return _0x5f1b77;});}return null;};}function removeEntity(_0xcf552,_0x174667){return function(_0x13ddbb){if(_0x13ddbb){return _0x13ddbb[_0x5e3a('0x23')]()[_0x5e3a('0x24')](function(){_0xcf552[_0x5e3a('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f7783,_0x233d21){return function(_0x2741ad){if(!_0x2741ad){_0x1f7783['sendStatus'](0x194);}return _0x2741ad;};}function handleError(_0x3298c2,_0x4c43b4){_0x4c43b4=_0x4c43b4||0x1f4;return function(_0x563f7b){logger['error'](_0x563f7b[_0x5e3a('0x25')]);if(_0x563f7b['name']){delete _0x563f7b['name'];}_0x3298c2['status'](_0x4c43b4)[_0x5e3a('0x26')](_0x563f7b);};}exports[_0x5e3a('0x27')]=function(_0x5e7eea,_0x196d76){var _0x3869d3={},_0x5c70d2={},_0x215c8b={'count':0x0,'rows':[]};var _0x26e131=_[_0x5e3a('0x28')](db['SugarcrmAccount'][_0x5e3a('0x29')],function(_0x54f560){return{'name':_0x54f560['fieldName'],'type':_0x54f560[_0x5e3a('0x2a')]['key']};});_0x5c70d2['model']=_[_0x5e3a('0x28')](_0x26e131,_0x5e3a('0x2b'));_0x5c70d2[_0x5e3a('0x2c')]=_[_0x5e3a('0x2d')](_0x5e7eea[_0x5e3a('0x2c')]);_0x5c70d2['filters']=_[_0x5e3a('0x2e')](_0x5c70d2[_0x5e3a('0x2f')],_0x5c70d2['query']);_0x3869d3['attributes']=_['intersection'](_0x5c70d2[_0x5e3a('0x2f')],qs[_0x5e3a('0x30')](_0x5e7eea[_0x5e3a('0x2c')]['fields']));_0x3869d3[_0x5e3a('0x31')]=_0x3869d3[_0x5e3a('0x31')]['length']?_0x3869d3[_0x5e3a('0x31')]:_0x5c70d2['model'];if(!_0x5e7eea[_0x5e3a('0x2c')][_0x5e3a('0x32')](_0x5e3a('0x33'))){_0x3869d3['limit']=qs[_0x5e3a('0x34')](_0x5e7eea[_0x5e3a('0x2c')]['limit']);_0x3869d3[_0x5e3a('0x19')]=qs[_0x5e3a('0x19')](_0x5e7eea[_0x5e3a('0x2c')][_0x5e3a('0x19')]);}_0x3869d3[_0x5e3a('0x35')]=qs[_0x5e3a('0x36')](_0x5e7eea[_0x5e3a('0x2c')][_0x5e3a('0x36')]);_0x3869d3['where']=qs[_0x5e3a('0x37')](_[_0x5e3a('0x38')](_0x5e7eea['query'],_0x5c70d2[_0x5e3a('0x37')]),_0x26e131);if(_0x5e7eea[_0x5e3a('0x2c')][_0x5e3a('0x39')]){_0x3869d3[_0x5e3a('0x3a')]=_[_0x5e3a('0x3b')](_0x3869d3[_0x5e3a('0x3a')],{'$or':_[_0x5e3a('0x28')](_0x26e131,function(_0x2e0e58){if(_0x2e0e58['type']!==_0x5e3a('0x3c')){var _0x10d8cd={};_0x10d8cd[_0x2e0e58[_0x5e3a('0x2b')]]={'$like':'%'+_0x5e7eea['query'][_0x5e3a('0x39')]+'%'};return _0x10d8cd;}})});}_0x3869d3=_['merge']({},_0x3869d3,_0x5e7eea[_0x5e3a('0x3d')]);var _0x5f2786={'where':_0x3869d3['where']};return db['SugarcrmAccount']['count'](_0x5f2786)[_0x5e3a('0x24')](function(_0x50cfbc){_0x215c8b[_0x5e3a('0x1b')]=_0x50cfbc;if(_0x5e7eea[_0x5e3a('0x2c')][_0x5e3a('0x3e')]){_0x3869d3[_0x5e3a('0x3f')]=[{'all':!![]}];}return db['SugarcrmAccount'][_0x5e3a('0x40')](_0x3869d3);})[_0x5e3a('0x24')](function(_0x84b861){_0x215c8b[_0x5e3a('0x41')]=_0x84b861;return _0x215c8b;})[_0x5e3a('0x24')](respondWithFilteredResult(_0x196d76,_0x3869d3))[_0x5e3a('0x42')](handleError(_0x196d76,null));};exports['show']=function(_0x2e30dd,_0x4dfe37){var _0x4a3eb2={'raw':![],'where':{'id':_0x2e30dd[_0x5e3a('0x43')]['id']}},_0x4a1458={};_0x4a1458['model']=_[_0x5e3a('0x2d')](db[_0x5e3a('0x44')][_0x5e3a('0x29')]);_0x4a1458[_0x5e3a('0x2c')]=_[_0x5e3a('0x2d')](_0x2e30dd[_0x5e3a('0x2c')]);_0x4a1458['filters']=_[_0x5e3a('0x2e')](_0x4a1458[_0x5e3a('0x2f')],_0x4a1458[_0x5e3a('0x2c')]);_0x4a3eb2['attributes']=_[_0x5e3a('0x2e')](_0x4a1458[_0x5e3a('0x2f')],qs[_0x5e3a('0x30')](_0x2e30dd['query'][_0x5e3a('0x30')]));_0x4a3eb2[_0x5e3a('0x31')]=_0x4a3eb2['attributes']['length']?_0x4a3eb2['attributes']:_0x4a1458[_0x5e3a('0x2f')];if(_0x2e30dd[_0x5e3a('0x2c')][_0x5e3a('0x3e')]){_0x4a3eb2[_0x5e3a('0x3f')]=[{'all':!![]}];}_0x4a3eb2=_[_0x5e3a('0x3b')]({},_0x4a3eb2,_0x2e30dd[_0x5e3a('0x3d')]);return db[_0x5e3a('0x44')]['find'](_0x4a3eb2)[_0x5e3a('0x24')](handleEntityNotFound(_0x4dfe37,null))[_0x5e3a('0x24')](respondWithResult(_0x4dfe37,null))[_0x5e3a('0x42')](handleError(_0x4dfe37,null));};exports[_0x5e3a('0x45')]=function(_0x4ccad4,_0x1d3548){return db[_0x5e3a('0x44')]['create'](_0x4ccad4[_0x5e3a('0x46')],{})[_0x5e3a('0x24')](respondWithResult(_0x1d3548,0xc9))[_0x5e3a('0x42')](handleError(_0x1d3548,null));};exports[_0x5e3a('0x22')]=function(_0x593473,_0x4c5e0e){if(_0x593473['body']['id']){delete _0x593473['body']['id'];}return db[_0x5e3a('0x44')]['find']({'where':{'id':_0x593473[_0x5e3a('0x43')]['id']}})['then'](handleEntityNotFound(_0x4c5e0e,null))['then'](saveUpdates(_0x593473['body'],null))[_0x5e3a('0x24')](respondWithResult(_0x4c5e0e,null))['catch'](handleError(_0x4c5e0e,null));};exports['destroy']=function(_0x3c0835,_0x4f79f4){return db[_0x5e3a('0x44')][_0x5e3a('0x47')]({'where':{'id':_0x3c0835[_0x5e3a('0x43')]['id']}})[_0x5e3a('0x24')](handleEntityNotFound(_0x4f79f4,null))[_0x5e3a('0x24')](removeEntity(_0x4f79f4,null))[_0x5e3a('0x42')](handleError(_0x4f79f4,null));};exports[_0x5e3a('0x48')]=function(_0x4b2a8c,_0x4fb06b,_0x1d51f7){var _0x3a7975={};var _0x30914a={};var _0x5d2c1f;var _0x5c1048;return db[_0x5e3a('0x44')][_0x5e3a('0x49')]({'where':{'id':_0x4b2a8c[_0x5e3a('0x43')]['id']}})[_0x5e3a('0x24')](handleEntityNotFound(_0x4fb06b,null))[_0x5e3a('0x24')](function(_0x48a6ee){if(_0x48a6ee){_0x5d2c1f=_0x48a6ee;_0x30914a[_0x5e3a('0x2f')]=_['keys'](db[_0x5e3a('0x4a')][_0x5e3a('0x29')]);_0x30914a['query']=_['keys'](_0x4b2a8c[_0x5e3a('0x2c')]);_0x30914a['filters']=_['intersection'](_0x30914a[_0x5e3a('0x2f')],_0x30914a[_0x5e3a('0x2c')]);_0x3a7975[_0x5e3a('0x31')]=_[_0x5e3a('0x2e')](_0x30914a[_0x5e3a('0x2f')],qs[_0x5e3a('0x30')](_0x4b2a8c['query']['fields']));_0x3a7975[_0x5e3a('0x31')]=_0x3a7975[_0x5e3a('0x31')][_0x5e3a('0x4b')]?_0x3a7975[_0x5e3a('0x31')]:_0x30914a[_0x5e3a('0x2f')];_0x3a7975[_0x5e3a('0x35')]=qs[_0x5e3a('0x36')](_0x4b2a8c[_0x5e3a('0x2c')][_0x5e3a('0x36')]);_0x3a7975['where']=qs[_0x5e3a('0x37')](_[_0x5e3a('0x38')](_0x4b2a8c[_0x5e3a('0x2c')],_0x30914a[_0x5e3a('0x37')]));if(_0x4b2a8c[_0x5e3a('0x2c')][_0x5e3a('0x39')]){_0x3a7975[_0x5e3a('0x3a')]=_[_0x5e3a('0x3b')](_0x3a7975[_0x5e3a('0x3a')],{'$or':_[_0x5e3a('0x28')](_0x3a7975[_0x5e3a('0x31')],function(_0x34298c){var _0x5f4083={};_0x5f4083[_0x34298c]={'$like':'%'+_0x4b2a8c[_0x5e3a('0x2c')][_0x5e3a('0x39')]+'%'};return _0x5f4083;})});}_0x3a7975=_[_0x5e3a('0x3b')]({},_0x3a7975,_0x4b2a8c['options']);return _0x5d2c1f['getConfigurations'](_0x3a7975);}})['then'](function(_0x4baf9c){if(_0x4baf9c){_0x5c1048=_0x4baf9c['length'];if(!_0x4b2a8c[_0x5e3a('0x2c')][_0x5e3a('0x32')](_0x5e3a('0x33'))){_0x3a7975[_0x5e3a('0x34')]=qs[_0x5e3a('0x34')](_0x4b2a8c[_0x5e3a('0x2c')][_0x5e3a('0x34')]);_0x3a7975[_0x5e3a('0x19')]=qs[_0x5e3a('0x19')](_0x4b2a8c[_0x5e3a('0x2c')][_0x5e3a('0x19')]);}return _0x5d2c1f['getConfigurations'](_0x3a7975);}})[_0x5e3a('0x24')](function(_0x398ac0){if(_0x398ac0){return _0x398ac0?{'count':_0x5c1048,'rows':_0x398ac0}:null;}})['then'](respondWithResult(_0x4fb06b,null))[_0x5e3a('0x42')](handleError(_0x4fb06b,null));};exports[_0x5e3a('0x4c')]=function(_0x115c83,_0x4fb982,_0x7b3f1a){if(_0x115c83['body']['id']){delete _0x115c83['body']['id'];}return db[_0x5e3a('0x44')][_0x5e3a('0x49')]({'where':{'id':_0x115c83[_0x5e3a('0x43')]['id']}})[_0x5e3a('0x24')](handleEntityNotFound(_0x4fb982,null))[_0x5e3a('0x24')](function(_0x322e7b){if(_0x322e7b){_0x115c83['body'][_0x5e3a('0x4d')]=_0x322e7b['id'];_0x115c83['body'][_0x5e3a('0x4e')]=integrations[_0x5e3a('0x4f')](_0x115c83['body'][_0x5e3a('0x50')],_0x115c83[_0x5e3a('0x46')]['type']);_0x115c83[_0x5e3a('0x46')]['Descriptions']=integrations[_0x5e3a('0x51')](_0x115c83[_0x5e3a('0x46')]['channel'],_0x115c83[_0x5e3a('0x46')][_0x5e3a('0x2a')]);return db[_0x5e3a('0x4a')]['create'](_0x115c83[_0x5e3a('0x46')],{'include':[{'model':db[_0x5e3a('0x52')],'as':_0x5e3a('0x4e')},{'model':db[_0x5e3a('0x52')],'as':_0x5e3a('0x53')}]});}return null;})['then'](respondWithResult(_0x4fb982,null))[_0x5e3a('0x42')](handleError(_0x4fb982,null));};exports[_0x5e3a('0x54')]=function(_0x422e6f,_0x21deee,_0x4d33f2){var _0x294a3b='';var _0x4cde77=['id',_0x5e3a('0x2b'),_0x5e3a('0x55'),'created_by',_0x5e3a('0x56'),'date_start',_0x5e3a('0x57'),'duration_minutes',_0x5e3a('0x58'),'parent_type',_0x5e3a('0x59'),_0x5e3a('0x5a')];return db[_0x5e3a('0x44')][_0x5e3a('0x49')]({'where':{'id':_0x422e6f[_0x5e3a('0x43')]['id']},'attributes':['id',_0x5e3a('0x5b'),_0x5e3a('0x5c'),_0x5e3a('0x5d')]})[_0x5e3a('0x24')](handleEntityNotFound(_0x21deee,null))[_0x5e3a('0x24')](function(_0x263357){if(_0x263357){_0x294a3b=_0x263357[_0x5e3a('0x5d')];var _0x2a2ca4=_0x294a3b[_0x5e3a('0x5e')](-0x1);if(_0x2a2ca4==='/'){_0x294a3b=_0x294a3b[_0x5e3a('0x5f')](0x0,_0x294a3b[_0x5e3a('0x60')](_0x2a2ca4));}return rp({'method':_0x5e3a('0x61'),'uri':util[_0x5e3a('0x62')](_0x5e3a('0x63'),_0x294a3b,_0x5e3a('0x64')),'json':!![],'form':{'method':'login','input_type':'JSON','response_type':_0x5e3a('0x65'),'rest_data':JSON[_0x5e3a('0x66')]({'user_auth':{'user_name':_0x263357[_0x5e3a('0x5b')],'password':_0x263357[_0x5e3a('0x5c')],'encryption':_0x5e3a('0x67')},'application':'xCALLY\x20Motion\x20Integration'})}});}})[_0x5e3a('0x24')](function(_0x8212bd){if(_0x8212bd&&_0x8212bd[_0x5e3a('0x2b')]!==_0x5e3a('0x68')&&_0x8212bd[_0x5e3a('0x2b')]!==_0x5e3a('0x69')){return rp({'method':'POST','uri':util[_0x5e3a('0x62')](_0x5e3a('0x63'),_0x294a3b,_0x5e3a('0x64')),'json':!![],'form':{'method':_0x5e3a('0x6a'),'input_type':_0x5e3a('0x65'),'response_type':_0x5e3a('0x65'),'rest_data':JSON[_0x5e3a('0x66')]({'session':_0x8212bd['id'],'module_name':_0x5e3a('0x6b')})}})[_0x5e3a('0x24')](function(_0x111295){if(_0x111295){var _0x364c3d=_[_0x5e3a('0x6c')](_0x111295[_0x5e3a('0x6d')]);_['remove'](_0x364c3d,function(_0x5c7f48){return _0x4cde77[_0x5e3a('0x6e')](_0x5c7f48[_0x5e3a('0x2b')]);});return{'count':_0x364c3d[_0x5e3a('0x4b')],'rows':_[_0x5e3a('0x28')](_0x364c3d,function(_0x4c11cf){return{'id':_0x4c11cf[_0x5e3a('0x2b')],'name':_0x4c11cf[_0x5e3a('0x6f')],'custom':_[_0x5e3a('0x70')](_0x4c11cf[_0x5e3a('0x2b')],'_c')?!![]:![],'options':_0x4c11cf[_0x5e3a('0x3d')]?_[_0x5e3a('0x28')](_[_0x5e3a('0x6c')](_0x4c11cf[_0x5e3a('0x3d')]),function(_0x51220a){return{'name':_0x51220a[_0x5e3a('0x71')],'value':_0x51220a[_0x5e3a('0x2b')]};}):[]};})};}})[_0x5e3a('0x24')](respondWithResult(_0x21deee,null))[_0x5e3a('0x42')](function(_0x528648){var _0x2fa7f1=_0x422e6f['query'][_0x5e3a('0x72')]?0x1f4:_0x528648[_0x5e3a('0x73')]||0x1f4;logger[_0x5e3a('0x74')](_0x5e3a('0x75'),_0x5e3a('0x54'),_0x2fa7f1,JSON[_0x5e3a('0x66')](_0x528648));delete _0x528648[_0x5e3a('0x2b')];if(_0x2fa7f1===0x191){_0x2fa7f1=0x190;}_0x21deee[_0x5e3a('0x17')](_0x2fa7f1)['send'](_0x422e6f[_0x5e3a('0x2c')][_0x5e3a('0x72')]?{'message':_0x5e3a('0x76'),'statusCode':_0x528648[_0x5e3a('0x73')]}:_0x528648);});}else{var _0x3da0f3=0x1f4;_0x21deee['status'](_0x3da0f3)[_0x5e3a('0x26')]({'message':_0x5e3a('0x76'),'statusCode':0x190});}});}; \ No newline at end of file +var _0xa5d4=['end','error','name','send','index','map','SugarcrmAccount','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','nolimit','order','sort','where','filter','merge','options','includeAll','include','rows','params','length','find','catch','create','body','findOne','pick','getConfigurations','hasOwnProperty','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmConfiguration','SugarcrmField','getFields','assigned_user_id','created_by','date_start','duration_hours','parent_id','parent_type','username','password','slice','substring','format','/service/v4_1/rest.php','login','JSON','stringify','PLAIN','Invalid\x20Login','Password\x20Expired','POST','%s%s','get_module_fields','Calls','values','module_fields','remove','includes','label','test','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy'];(function(_0x16d2ff,_0x5d2626){var _0x125eab=function(_0x26fa62){while(--_0x26fa62){_0x16d2ff['push'](_0x16d2ff['shift']());}};_0x125eab(++_0x5d2626);}(_0xa5d4,0x135));var _0x4a5d=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xa5d4[_0x46698a];return _0x356db0;};'use strict';var emlformat=require(_0x4a5d('0x0'));var rimraf=require(_0x4a5d('0x1'));var zipdir=require(_0x4a5d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4a5d('0x3'));var moment=require(_0x4a5d('0x4'));var BPromise=require(_0x4a5d('0x5'));var Mustache=require('mustache');var util=require(_0x4a5d('0x6'));var path=require(_0x4a5d('0x7'));var sox=require(_0x4a5d('0x8'));var csv=require(_0x4a5d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4a5d('0xa'));var _=require(_0x4a5d('0xb'));var squel=require(_0x4a5d('0xc'));var crypto=require(_0x4a5d('0xd'));var jsforce=require(_0x4a5d('0xe'));var deskjs=require(_0x4a5d('0xf'));var toCsv=require(_0x4a5d('0x9'));var querystring=require(_0x4a5d('0x10'));var Papa=require(_0x4a5d('0x11'));var Redis=require(_0x4a5d('0x12'));var authService=require(_0x4a5d('0x13'));var qs=require(_0x4a5d('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4a5d('0x15'));var logger=require(_0x4a5d('0x16'))('api');var utils=require(_0x4a5d('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x49cb5c,_0x4ba914){_0x4ba914=_0x4ba914||0xcc;return function(_0x28dadb){if(_0x28dadb){return _0x49cb5c[_0x4a5d('0x18')](_0x4ba914);}return _0x49cb5c[_0x4a5d('0x19')](_0x4ba914)['end']();};}function respondWithResult(_0x64be,_0x3619fd){_0x3619fd=_0x3619fd||0xc8;return function(_0x384396){if(_0x384396){return _0x64be['status'](_0x3619fd)[_0x4a5d('0x1a')](_0x384396);}};}function respondWithFilteredResult(_0x26ed4e,_0x5ce7d3){return function(_0x394326){if(_0x394326){var _0x426e49=typeof _0x5ce7d3[_0x4a5d('0x1b')]===_0x4a5d('0x1c')&&typeof _0x5ce7d3[_0x4a5d('0x1d')]===_0x4a5d('0x1c');var _0x23d578=_0x394326[_0x4a5d('0x1e')];var _0x5019a7=_0x426e49?0x0:_0x5ce7d3[_0x4a5d('0x1b')];var _0x4a767d=_0x426e49?_0x394326[_0x4a5d('0x1e')]:_0x5ce7d3[_0x4a5d('0x1b')]+_0x5ce7d3['limit'];var _0x1086d6;if(_0x4a767d>=_0x23d578){_0x4a767d=_0x23d578;_0x1086d6=0xc8;}else{_0x1086d6=0xce;}_0x26ed4e[_0x4a5d('0x19')](_0x1086d6);return _0x26ed4e[_0x4a5d('0x1f')](_0x4a5d('0x20'),_0x5019a7+'-'+_0x4a767d+'/'+_0x23d578)['json'](_0x394326);}return null;};}function patchUpdates(_0x654609){return function(_0x44286b){try{jsonpatch[_0x4a5d('0x21')](_0x44286b,_0x654609,!![]);}catch(_0x4c4dc6){return BPromise[_0x4a5d('0x22')](_0x4c4dc6);}return _0x44286b[_0x4a5d('0x23')]();};}function saveUpdates(_0x275be1,_0x26e09b){return function(_0x4117d8){if(_0x4117d8){return _0x4117d8[_0x4a5d('0x24')](_0x275be1)[_0x4a5d('0x25')](function(_0x34f687){return _0x34f687;});}return null;};}function removeEntity(_0x334697,_0xf49051){return function(_0x228b6d){if(_0x228b6d){return _0x228b6d[_0x4a5d('0x26')]()['then'](function(){_0x334697[_0x4a5d('0x19')](0xcc)[_0x4a5d('0x27')]();});}};}function handleEntityNotFound(_0x555add,_0x2451c5){return function(_0x1b530d){if(!_0x1b530d){_0x555add[_0x4a5d('0x18')](0x194);}return _0x1b530d;};}function handleError(_0xc9d984,_0x27f4f4){_0x27f4f4=_0x27f4f4||0x1f4;return function(_0x5e978b){logger[_0x4a5d('0x28')](_0x5e978b['stack']);if(_0x5e978b[_0x4a5d('0x29')]){delete _0x5e978b[_0x4a5d('0x29')];}_0xc9d984['status'](_0x27f4f4)[_0x4a5d('0x2a')](_0x5e978b);};}exports[_0x4a5d('0x2b')]=function(_0x27fc4c,_0x2bc95f){var _0x4cfbd9={},_0x75ab00={},_0x330192={'count':0x0,'rows':[]};var _0x34372f=_[_0x4a5d('0x2c')](db[_0x4a5d('0x2d')][_0x4a5d('0x2e')],function(_0x24aa35){return{'name':_0x24aa35[_0x4a5d('0x2f')],'type':_0x24aa35[_0x4a5d('0x30')][_0x4a5d('0x31')]};});_0x75ab00['model']=_[_0x4a5d('0x2c')](_0x34372f,'name');_0x75ab00[_0x4a5d('0x32')]=_[_0x4a5d('0x33')](_0x27fc4c[_0x4a5d('0x32')]);_0x75ab00[_0x4a5d('0x34')]=_[_0x4a5d('0x35')](_0x75ab00[_0x4a5d('0x36')],_0x75ab00[_0x4a5d('0x32')]);_0x4cfbd9[_0x4a5d('0x37')]=_[_0x4a5d('0x35')](_0x75ab00[_0x4a5d('0x36')],qs[_0x4a5d('0x38')](_0x27fc4c[_0x4a5d('0x32')][_0x4a5d('0x38')]));_0x4cfbd9[_0x4a5d('0x37')]=_0x4cfbd9[_0x4a5d('0x37')]['length']?_0x4cfbd9[_0x4a5d('0x37')]:_0x75ab00[_0x4a5d('0x36')];if(!_0x27fc4c[_0x4a5d('0x32')]['hasOwnProperty'](_0x4a5d('0x39'))){_0x4cfbd9[_0x4a5d('0x1d')]=qs['limit'](_0x27fc4c[_0x4a5d('0x32')]['limit']);_0x4cfbd9['offset']=qs[_0x4a5d('0x1b')](_0x27fc4c[_0x4a5d('0x32')][_0x4a5d('0x1b')]);}_0x4cfbd9[_0x4a5d('0x3a')]=qs[_0x4a5d('0x3b')](_0x27fc4c[_0x4a5d('0x32')][_0x4a5d('0x3b')]);_0x4cfbd9[_0x4a5d('0x3c')]=qs[_0x4a5d('0x34')](_['pick'](_0x27fc4c[_0x4a5d('0x32')],_0x75ab00[_0x4a5d('0x34')]),_0x34372f);if(_0x27fc4c[_0x4a5d('0x32')][_0x4a5d('0x3d')]){_0x4cfbd9[_0x4a5d('0x3c')]=_[_0x4a5d('0x3e')](_0x4cfbd9[_0x4a5d('0x3c')],{'$or':_[_0x4a5d('0x2c')](_0x34372f,function(_0x4052a3){if(_0x4052a3[_0x4a5d('0x30')]!=='VIRTUAL'){var _0x399506={};_0x399506[_0x4052a3['name']]={'$like':'%'+_0x27fc4c['query'][_0x4a5d('0x3d')]+'%'};return _0x399506;}})});}_0x4cfbd9=_[_0x4a5d('0x3e')]({},_0x4cfbd9,_0x27fc4c[_0x4a5d('0x3f')]);var _0x4778aa={'where':_0x4cfbd9['where']};return db[_0x4a5d('0x2d')][_0x4a5d('0x1e')](_0x4778aa)['then'](function(_0x42fdbc){_0x330192[_0x4a5d('0x1e')]=_0x42fdbc;if(_0x27fc4c['query'][_0x4a5d('0x40')]){_0x4cfbd9[_0x4a5d('0x41')]=[{'all':!![]}];}return db['SugarcrmAccount']['findAll'](_0x4cfbd9);})['then'](function(_0x33f8da){_0x330192[_0x4a5d('0x42')]=_0x33f8da;return _0x330192;})[_0x4a5d('0x25')](respondWithFilteredResult(_0x2bc95f,_0x4cfbd9))['catch'](handleError(_0x2bc95f,null));};exports['show']=function(_0x1b1330,_0x42edba){var _0x31a332={'raw':![],'where':{'id':_0x1b1330[_0x4a5d('0x43')]['id']}},_0x7c6ed7={};_0x7c6ed7[_0x4a5d('0x36')]=_[_0x4a5d('0x33')](db[_0x4a5d('0x2d')][_0x4a5d('0x2e')]);_0x7c6ed7[_0x4a5d('0x32')]=_[_0x4a5d('0x33')](_0x1b1330[_0x4a5d('0x32')]);_0x7c6ed7[_0x4a5d('0x34')]=_[_0x4a5d('0x35')](_0x7c6ed7['model'],_0x7c6ed7[_0x4a5d('0x32')]);_0x31a332['attributes']=_[_0x4a5d('0x35')](_0x7c6ed7['model'],qs[_0x4a5d('0x38')](_0x1b1330['query'][_0x4a5d('0x38')]));_0x31a332[_0x4a5d('0x37')]=_0x31a332['attributes'][_0x4a5d('0x44')]?_0x31a332['attributes']:_0x7c6ed7['model'];if(_0x1b1330['query'][_0x4a5d('0x40')]){_0x31a332[_0x4a5d('0x41')]=[{'all':!![]}];}_0x31a332=_[_0x4a5d('0x3e')]({},_0x31a332,_0x1b1330[_0x4a5d('0x3f')]);return db[_0x4a5d('0x2d')][_0x4a5d('0x45')](_0x31a332)[_0x4a5d('0x25')](handleEntityNotFound(_0x42edba,null))[_0x4a5d('0x25')](respondWithResult(_0x42edba,null))[_0x4a5d('0x46')](handleError(_0x42edba,null));};exports[_0x4a5d('0x47')]=function(_0xd92bf0,_0x2c6c89){return db[_0x4a5d('0x2d')][_0x4a5d('0x47')](_0xd92bf0[_0x4a5d('0x48')],{})['then'](respondWithResult(_0x2c6c89,0xc9))['catch'](handleError(_0x2c6c89,null));};exports[_0x4a5d('0x24')]=function(_0x1518e2,_0x73bcfe){if(_0x1518e2['body']['id']){delete _0x1518e2[_0x4a5d('0x48')]['id'];}return db[_0x4a5d('0x2d')][_0x4a5d('0x45')]({'where':{'id':_0x1518e2['params']['id']}})[_0x4a5d('0x25')](handleEntityNotFound(_0x73bcfe,null))[_0x4a5d('0x25')](saveUpdates(_0x1518e2['body'],null))[_0x4a5d('0x25')](respondWithResult(_0x73bcfe,null))['catch'](handleError(_0x73bcfe,null));};exports[_0x4a5d('0x26')]=function(_0x299cf8,_0x165ed6){return db[_0x4a5d('0x2d')]['find']({'where':{'id':_0x299cf8[_0x4a5d('0x43')]['id']}})[_0x4a5d('0x25')](handleEntityNotFound(_0x165ed6,null))[_0x4a5d('0x25')](removeEntity(_0x165ed6,null))[_0x4a5d('0x46')](handleError(_0x165ed6,null));};exports['getConfigurations']=function(_0x4fb7d1,_0x4c283e,_0x349e22){var _0x2bef53={};var _0x8f3589={};var _0x594dcf;var _0x39a108;return db[_0x4a5d('0x2d')][_0x4a5d('0x49')]({'where':{'id':_0x4fb7d1[_0x4a5d('0x43')]['id']}})[_0x4a5d('0x25')](handleEntityNotFound(_0x4c283e,null))[_0x4a5d('0x25')](function(_0x330546){if(_0x330546){_0x594dcf=_0x330546;_0x8f3589[_0x4a5d('0x36')]=_[_0x4a5d('0x33')](db['SugarcrmConfiguration'][_0x4a5d('0x2e')]);_0x8f3589[_0x4a5d('0x32')]=_[_0x4a5d('0x33')](_0x4fb7d1[_0x4a5d('0x32')]);_0x8f3589[_0x4a5d('0x34')]=_[_0x4a5d('0x35')](_0x8f3589[_0x4a5d('0x36')],_0x8f3589[_0x4a5d('0x32')]);_0x2bef53[_0x4a5d('0x37')]=_[_0x4a5d('0x35')](_0x8f3589[_0x4a5d('0x36')],qs['fields'](_0x4fb7d1[_0x4a5d('0x32')][_0x4a5d('0x38')]));_0x2bef53['attributes']=_0x2bef53[_0x4a5d('0x37')][_0x4a5d('0x44')]?_0x2bef53[_0x4a5d('0x37')]:_0x8f3589[_0x4a5d('0x36')];_0x2bef53[_0x4a5d('0x3a')]=qs[_0x4a5d('0x3b')](_0x4fb7d1[_0x4a5d('0x32')][_0x4a5d('0x3b')]);_0x2bef53['where']=qs[_0x4a5d('0x34')](_[_0x4a5d('0x4a')](_0x4fb7d1[_0x4a5d('0x32')],_0x8f3589[_0x4a5d('0x34')]));if(_0x4fb7d1['query']['filter']){_0x2bef53[_0x4a5d('0x3c')]=_[_0x4a5d('0x3e')](_0x2bef53[_0x4a5d('0x3c')],{'$or':_[_0x4a5d('0x2c')](_0x2bef53[_0x4a5d('0x37')],function(_0x87a1cc){var _0x81ed54={};_0x81ed54[_0x87a1cc]={'$like':'%'+_0x4fb7d1[_0x4a5d('0x32')][_0x4a5d('0x3d')]+'%'};return _0x81ed54;})});}_0x2bef53=_[_0x4a5d('0x3e')]({},_0x2bef53,_0x4fb7d1[_0x4a5d('0x3f')]);return _0x594dcf[_0x4a5d('0x4b')](_0x2bef53);}})['then'](function(_0x4c7c6b){if(_0x4c7c6b){_0x39a108=_0x4c7c6b[_0x4a5d('0x44')];if(!_0x4fb7d1[_0x4a5d('0x32')][_0x4a5d('0x4c')](_0x4a5d('0x39'))){_0x2bef53[_0x4a5d('0x1d')]=qs[_0x4a5d('0x1d')](_0x4fb7d1['query'][_0x4a5d('0x1d')]);_0x2bef53['offset']=qs[_0x4a5d('0x1b')](_0x4fb7d1[_0x4a5d('0x32')][_0x4a5d('0x1b')]);}return _0x594dcf[_0x4a5d('0x4b')](_0x2bef53);}})['then'](function(_0x23ead6){if(_0x23ead6){return _0x23ead6?{'count':_0x39a108,'rows':_0x23ead6}:null;}})[_0x4a5d('0x25')](respondWithResult(_0x4c283e,null))[_0x4a5d('0x46')](handleError(_0x4c283e,null));};exports[_0x4a5d('0x4d')]=function(_0x1010c3,_0x4bf54b,_0x1f1d52){if(_0x1010c3[_0x4a5d('0x48')]['id']){delete _0x1010c3['body']['id'];}return db[_0x4a5d('0x2d')]['findOne']({'where':{'id':_0x1010c3[_0x4a5d('0x43')]['id']}})['then'](handleEntityNotFound(_0x4bf54b,null))[_0x4a5d('0x25')](function(_0x92cbfe){if(_0x92cbfe){_0x1010c3['body']['AccountId']=_0x92cbfe['id'];_0x1010c3[_0x4a5d('0x48')][_0x4a5d('0x4e')]=integrations[_0x4a5d('0x4f')](_0x1010c3['body'][_0x4a5d('0x50')],_0x1010c3[_0x4a5d('0x48')]['type']);_0x1010c3[_0x4a5d('0x48')][_0x4a5d('0x51')]=integrations[_0x4a5d('0x52')](_0x1010c3[_0x4a5d('0x48')][_0x4a5d('0x50')],_0x1010c3[_0x4a5d('0x48')][_0x4a5d('0x30')]);return db[_0x4a5d('0x53')][_0x4a5d('0x47')](_0x1010c3[_0x4a5d('0x48')],{'include':[{'model':db[_0x4a5d('0x54')],'as':'Subjects'},{'model':db[_0x4a5d('0x54')],'as':_0x4a5d('0x51')}]});}return null;})[_0x4a5d('0x25')](respondWithResult(_0x4bf54b,null))[_0x4a5d('0x46')](handleError(_0x4bf54b,null));};exports[_0x4a5d('0x55')]=function(_0x1a307b,_0x439afe,_0x2b8d0d){var _0x35d6f3='';var _0x1e36bc=['id',_0x4a5d('0x29'),_0x4a5d('0x56'),_0x4a5d('0x57'),'description',_0x4a5d('0x58'),_0x4a5d('0x59'),'duration_minutes',_0x4a5d('0x5a'),_0x4a5d('0x5b'),'parent_name','direction'];return db['SugarcrmAccount'][_0x4a5d('0x49')]({'where':{'id':_0x1a307b[_0x4a5d('0x43')]['id']},'attributes':['id',_0x4a5d('0x5c'),_0x4a5d('0x5d'),'remoteUri']})[_0x4a5d('0x25')](handleEntityNotFound(_0x439afe,null))['then'](function(_0x4063b8){if(_0x4063b8){_0x35d6f3=_0x4063b8['remoteUri'];var _0x18aa7=_0x35d6f3[_0x4a5d('0x5e')](-0x1);if(_0x18aa7==='/'){_0x35d6f3=_0x35d6f3[_0x4a5d('0x5f')](0x0,_0x35d6f3['lastIndexOf'](_0x18aa7));}return rp({'method':'POST','uri':util[_0x4a5d('0x60')]('%s%s',_0x35d6f3,_0x4a5d('0x61')),'json':!![],'form':{'method':_0x4a5d('0x62'),'input_type':'JSON','response_type':_0x4a5d('0x63'),'rest_data':JSON[_0x4a5d('0x64')]({'user_auth':{'user_name':_0x4063b8[_0x4a5d('0x5c')],'password':_0x4063b8[_0x4a5d('0x5d')],'encryption':_0x4a5d('0x65')},'application':'xCALLY\x20Motion\x20Integration'})}});}})[_0x4a5d('0x25')](function(_0x2ae36e){if(_0x2ae36e&&_0x2ae36e['name']!==_0x4a5d('0x66')&&_0x2ae36e[_0x4a5d('0x29')]!==_0x4a5d('0x67')){return rp({'method':_0x4a5d('0x68'),'uri':util[_0x4a5d('0x60')](_0x4a5d('0x69'),_0x35d6f3,_0x4a5d('0x61')),'json':!![],'form':{'method':_0x4a5d('0x6a'),'input_type':_0x4a5d('0x63'),'response_type':_0x4a5d('0x63'),'rest_data':JSON['stringify']({'session':_0x2ae36e['id'],'module_name':_0x4a5d('0x6b')})}})[_0x4a5d('0x25')](function(_0x4b0f62){if(_0x4b0f62){var _0x233622=_[_0x4a5d('0x6c')](_0x4b0f62[_0x4a5d('0x6d')]);_[_0x4a5d('0x6e')](_0x233622,function(_0x1bae77){return _0x1e36bc[_0x4a5d('0x6f')](_0x1bae77['name']);});return{'count':_0x233622[_0x4a5d('0x44')],'rows':_[_0x4a5d('0x2c')](_0x233622,function(_0x451b21){return{'id':_0x451b21[_0x4a5d('0x29')],'name':_0x451b21[_0x4a5d('0x70')],'custom':_['endsWith'](_0x451b21['name'],'_c')?!![]:![],'options':_0x451b21[_0x4a5d('0x3f')]?_[_0x4a5d('0x2c')](_[_0x4a5d('0x6c')](_0x451b21['options']),function(_0x46225d){return{'name':_0x46225d['value'],'value':_0x46225d[_0x4a5d('0x29')]};}):[]};})};}})[_0x4a5d('0x25')](respondWithResult(_0x439afe,null))[_0x4a5d('0x46')](function(_0x17838f){var _0x3790af=_0x1a307b[_0x4a5d('0x32')][_0x4a5d('0x71')]?0x1f4:_0x17838f['statusCode']||0x1f4;logger['error'](_0x4a5d('0x72'),_0x4a5d('0x55'),_0x3790af,JSON[_0x4a5d('0x64')](_0x17838f));delete _0x17838f['name'];if(_0x3790af===0x191){_0x3790af=0x190;}_0x439afe[_0x4a5d('0x19')](_0x3790af)[_0x4a5d('0x2a')](_0x1a307b[_0x4a5d('0x32')][_0x4a5d('0x71')]?{'message':_0x4a5d('0x73'),'statusCode':_0x17838f['statusCode']}:_0x17838f);});}else{var _0x27ed85=0x1f4;_0x439afe[_0x4a5d('0x19')](_0x27ed85)['send']({'message':'Wrong\x20credentials','statusCode':0x190});}});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js index 7f7eab7..246a5dc 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 _0x814a=['moment','bluebird','request-promise','path','./intSugarcrmAccount.attributes','../../components/integrations/configuration','SugarcrmAccount','util','../../config/logger'];(function(_0x378770,_0xb50588){var _0x2a1de7=function(_0x2d9b5d){while(--_0x2d9b5d){_0x378770['push'](_0x378770['shift']());}};_0x2a1de7(++_0xb50588);}(_0x814a,0x8e));var _0xa814=function(_0x2c9e4e,_0x5949f0){_0x2c9e4e=_0x2c9e4e-0x0;var _0x32300e=_0x814a[_0x2c9e4e];return _0x32300e;};'use strict';var _=require('lodash');var util=require(_0xa814('0x0'));var logger=require(_0xa814('0x1'))('api');var moment=require(_0xa814('0x2'));var BPromise=require(_0xa814('0x3'));var rp=require(_0xa814('0x4'));var fs=require('fs');var path=require(_0xa814('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa814('0x6'));var integrations=require(_0xa814('0x7'));module['exports']=function(_0x1fadc7,_0x4a8208){return _0x1fadc7['define'](_0xa814('0x8'),attributes,{'tableName':'int_sugarcrm_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8403=['SugarcrmAccount','int_sugarcrm_accounts','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','../../components/integrations/configuration','exports','define'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x8403,0x188));var _0x3840=function(_0x5c1c6d,_0x29ba36){_0x5c1c6d=_0x5c1c6d-0x0;var _0x3be802=_0x8403[_0x5c1c6d];return _0x3be802;};'use strict';var _=require(_0x3840('0x0'));var util=require(_0x3840('0x1'));var logger=require(_0x3840('0x2'))(_0x3840('0x3'));var moment=require(_0x3840('0x4'));var BPromise=require('bluebird');var rp=require(_0x3840('0x5'));var fs=require('fs');var path=require(_0x3840('0x6'));var rimraf=require('rimraf');var config=require(_0x3840('0x7'));var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0x3840('0x8'));module[_0x3840('0x9')]=function(_0x28bb58,_0xe6c707){return _0x28bb58[_0x3840('0xa')](_0x3840('0xb'),attributes,{'tableName':_0x3840('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js index ffb2077..a0d3b13 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 _0x29f3=['message','result','catch','GetSugarcrmAccount','findAll','options','raw','where','limit','include','model','attributes','map','ShowSugarcrmAccount','SugarcrmAccount','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0xdfaa9,_0x415c09){var _0x16e5d5=function(_0x5b4f7b){while(--_0x5b4f7b){_0xdfaa9['push'](_0xdfaa9['shift']());}};_0x16e5d5(++_0x415c09);}(_0x29f3,0x182));var _0x329f=function(_0x187b95,_0x426a0f){_0x187b95=_0x187b95-0x0;var _0x2ea4bf=_0x29f3[_0x187b95];return _0x2ea4bf;};'use strict';var _=require(_0x329f('0x0'));var util=require(_0x329f('0x1'));var moment=require(_0x329f('0x2'));var BPromise=require('bluebird');var rs=require(_0x329f('0x3'));var fs=require('fs');var Redis=require(_0x329f('0x4'));var db=require(_0x329f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x329f('0x6'))('rpc');var config=require(_0x329f('0x7'));var jayson=require(_0x329f('0x8'));var client=jayson[_0x329f('0x9')][_0x329f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x473bde,_0x314a5d,_0x5db106){return new BPromise(function(_0x545c35,_0x47ec7f){return client[_0x329f('0xb')](_0x473bde,_0x5db106)[_0x329f('0xc')](function(_0x231385){logger[_0x329f('0xd')](_0x329f('0xe'),_0x314a5d,_0x329f('0xf'));logger[_0x329f('0x10')](_0x329f('0x11'),_0x314a5d,_0x329f('0xf'),JSON[_0x329f('0x12')](_0x231385));if(_0x231385[_0x329f('0x13')]){if(_0x231385['error'][_0x329f('0x14')]===0x1f4){logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x314a5d,_0x231385[_0x329f('0x13')][_0x329f('0x15')]);return _0x47ec7f(_0x231385['error'][_0x329f('0x15')]);}logger[_0x329f('0x13')](_0x329f('0xe'),_0x314a5d,_0x231385[_0x329f('0x13')][_0x329f('0x15')]);return _0x545c35(_0x231385[_0x329f('0x13')][_0x329f('0x15')]);}else{logger['info'](_0x329f('0xe'),_0x314a5d,_0x329f('0xf'));_0x545c35(_0x231385[_0x329f('0x16')][_0x329f('0x15')]);}})[_0x329f('0x17')](function(_0x55b389){logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x314a5d,_0x55b389);_0x47ec7f(_0x55b389);});});}exports[_0x329f('0x18')]=function(_0x3c29a1){var _0x14868b=this;return new Promise(function(_0x5b5ca4,_0x3b7e59){return db['SugarcrmAccount'][_0x329f('0x19')]({'raw':_0x3c29a1[_0x329f('0x1a')]?_0x3c29a1[_0x329f('0x1a')][_0x329f('0x1b')]===undefined?!![]:![]:!![],'where':_0x3c29a1[_0x329f('0x1a')]?_0x3c29a1[_0x329f('0x1a')][_0x329f('0x1c')]||null:null,'attributes':_0x3c29a1[_0x329f('0x1a')]?_0x3c29a1[_0x329f('0x1a')]['attributes']||null:null,'limit':_0x3c29a1[_0x329f('0x1a')]?_0x3c29a1[_0x329f('0x1a')][_0x329f('0x1d')]||null:null,'include':_0x3c29a1['options']?_0x3c29a1[_0x329f('0x1a')][_0x329f('0x1e')]?_['map'](_0x3c29a1[_0x329f('0x1a')]['include'],function(_0x357c66){return{'model':db[_0x357c66[_0x329f('0x1f')]],'as':_0x357c66['as'],'attributes':_0x357c66[_0x329f('0x20')],'include':_0x357c66[_0x329f('0x1e')]?_[_0x329f('0x21')](_0x357c66[_0x329f('0x1e')],function(_0x53969e){return{'model':db[_0x53969e[_0x329f('0x1f')]],'as':_0x53969e['as'],'attributes':_0x53969e[_0x329f('0x20')],'include':_0x53969e[_0x329f('0x1e')]?_[_0x329f('0x21')](_0x53969e[_0x329f('0x1e')],function(_0x999d5a){return{'model':db[_0x999d5a['model']],'as':_0x999d5a['as'],'attributes':_0x999d5a[_0x329f('0x20')]};}):[]};}):[]};}):[]:[]})[_0x329f('0xc')](function(_0x433b2d){logger['info'](_0x329f('0x18'),_0x3c29a1);logger[_0x329f('0x10')](_0x329f('0x18'),_0x3c29a1,JSON[_0x329f('0x12')](_0x433b2d));_0x5b5ca4(_0x433b2d);})['catch'](function(_0x38d26a){logger[_0x329f('0x13')]('GetSugarcrmAccount',_0x38d26a[_0x329f('0x15')],_0x3c29a1);_0x3b7e59(_0x14868b['error'](0x1f4,_0x38d26a[_0x329f('0x15')]));});});};exports[_0x329f('0x22')]=function(_0x1011ed){var _0x164a18=this;return new Promise(function(_0x3bb219,_0xa81ddf){return db[_0x329f('0x23')][_0x329f('0x24')]({'raw':_0x1011ed['options']?_0x1011ed[_0x329f('0x1a')][_0x329f('0x1b')]===undefined?!![]:![]:!![],'where':_0x1011ed['options']?_0x1011ed[_0x329f('0x1a')][_0x329f('0x1c')]||null:null,'attributes':_0x1011ed['options']?_0x1011ed['options']['attributes']||null:null,'include':_0x1011ed[_0x329f('0x1a')]?_0x1011ed[_0x329f('0x1a')][_0x329f('0x1e')]?_['map'](_0x1011ed[_0x329f('0x1a')][_0x329f('0x1e')],function(_0x11f2e7){return{'model':db[_0x11f2e7['model']],'as':_0x11f2e7['as'],'attributes':_0x11f2e7[_0x329f('0x20')],'include':_0x11f2e7[_0x329f('0x1e')]?_[_0x329f('0x21')](_0x11f2e7[_0x329f('0x1e')],function(_0x8423a3){return{'model':db[_0x8423a3[_0x329f('0x1f')]],'as':_0x8423a3['as'],'attributes':_0x8423a3[_0x329f('0x20')],'include':_0x8423a3['include']?_['map'](_0x8423a3[_0x329f('0x1e')],function(_0x22376b){return{'model':db[_0x22376b['model']],'as':_0x22376b['as'],'attributes':_0x22376b[_0x329f('0x20')]};}):[]};}):[]};}):[]:[]})[_0x329f('0xc')](function(_0x1b178c){logger[_0x329f('0xd')](_0x329f('0x22'),_0x1011ed);logger[_0x329f('0x10')]('ShowSugarcrmAccount',_0x1011ed,JSON[_0x329f('0x12')](_0x1b178c));_0x3bb219(_0x1b178c);})[_0x329f('0x17')](function(_0x2bba29){logger[_0x329f('0x13')](_0x329f('0x22'),_0x2bba29[_0x329f('0x15')],_0x1011ed);_0xa81ddf(_0x164a18['error'](0x1f4,_0x2bba29['message']));});});}; \ No newline at end of file +var _0xbd7b=['options','raw','where','attributes','map','include','model','GetSugarcrmAccount','SugarcrmAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','findAll'];(function(_0x55bcaa,_0x4e289d){var _0x43e15b=function(_0x14222e){while(--_0x14222e){_0x55bcaa['push'](_0x55bcaa['shift']());}};_0x43e15b(++_0x4e289d);}(_0xbd7b,0x122));var _0xbbd7=function(_0x5167a4,_0x4ac437){_0x5167a4=_0x5167a4-0x0;var _0xba0081=_0xbd7b[_0x5167a4];return _0xba0081;};'use strict';var _=require(_0xbbd7('0x0'));var util=require(_0xbbd7('0x1'));var moment=require(_0xbbd7('0x2'));var BPromise=require(_0xbbd7('0x3'));var rs=require(_0xbbd7('0x4'));var fs=require('fs');var Redis=require(_0xbbd7('0x5'));var db=require(_0xbbd7('0x6'))['db'];var utils=require(_0xbbd7('0x7'));var logger=require(_0xbbd7('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbbd7('0x9'));var client=jayson[_0xbbd7('0xa')][_0xbbd7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5cbf6b,_0x28e3f3,_0x168e62){return new BPromise(function(_0x5c310d,_0x266fd7){return client[_0xbbd7('0xc')](_0x5cbf6b,_0x168e62)[_0xbbd7('0xd')](function(_0x5a1d76){logger[_0xbbd7('0xe')](_0xbbd7('0xf'),_0x28e3f3,'request\x20sent');logger[_0xbbd7('0x10')](_0xbbd7('0x11'),_0x28e3f3,'request\x20sent',JSON[_0xbbd7('0x12')](_0x5a1d76));if(_0x5a1d76['error']){if(_0x5a1d76[_0xbbd7('0x13')][_0xbbd7('0x14')]===0x1f4){logger['error'](_0xbbd7('0xf'),_0x28e3f3,_0x5a1d76['error'][_0xbbd7('0x15')]);return _0x266fd7(_0x5a1d76[_0xbbd7('0x13')][_0xbbd7('0x15')]);}logger[_0xbbd7('0x13')]('SugarcrmAccount,\x20%s,\x20%s',_0x28e3f3,_0x5a1d76['error'][_0xbbd7('0x15')]);return _0x5c310d(_0x5a1d76['error']['message']);}else{logger['info']('SugarcrmAccount,\x20%s,\x20%s',_0x28e3f3,_0xbbd7('0x16'));_0x5c310d(_0x5a1d76['result'][_0xbbd7('0x15')]);}})[_0xbbd7('0x17')](function(_0x41c918){logger[_0xbbd7('0x13')](_0xbbd7('0xf'),_0x28e3f3,_0x41c918);_0x266fd7(_0x41c918);});});}exports['GetSugarcrmAccount']=function(_0x259dae){var _0x5884c4=this;return new Promise(function(_0x205d7f,_0x58cf50){return db['SugarcrmAccount'][_0xbbd7('0x18')]({'raw':_0x259dae[_0xbbd7('0x19')]?_0x259dae['options'][_0xbbd7('0x1a')]===undefined?!![]:![]:!![],'where':_0x259dae[_0xbbd7('0x19')]?_0x259dae[_0xbbd7('0x19')][_0xbbd7('0x1b')]||null:null,'attributes':_0x259dae['options']?_0x259dae['options'][_0xbbd7('0x1c')]||null:null,'limit':_0x259dae['options']?_0x259dae[_0xbbd7('0x19')]['limit']||null:null,'include':_0x259dae['options']?_0x259dae[_0xbbd7('0x19')]['include']?_[_0xbbd7('0x1d')](_0x259dae[_0xbbd7('0x19')][_0xbbd7('0x1e')],function(_0x269a63){return{'model':db[_0x269a63['model']],'as':_0x269a63['as'],'attributes':_0x269a63[_0xbbd7('0x1c')],'include':_0x269a63['include']?_[_0xbbd7('0x1d')](_0x269a63['include'],function(_0x525fe7){return{'model':db[_0x525fe7[_0xbbd7('0x1f')]],'as':_0x525fe7['as'],'attributes':_0x525fe7[_0xbbd7('0x1c')],'include':_0x525fe7[_0xbbd7('0x1e')]?_[_0xbbd7('0x1d')](_0x525fe7[_0xbbd7('0x1e')],function(_0x26922b){return{'model':db[_0x26922b[_0xbbd7('0x1f')]],'as':_0x26922b['as'],'attributes':_0x26922b['attributes']};}):[]};}):[]};}):[]:[]})[_0xbbd7('0xd')](function(_0x44d7f2){logger[_0xbbd7('0xe')](_0xbbd7('0x20'),_0x259dae);logger[_0xbbd7('0x10')]('GetSugarcrmAccount',_0x259dae,JSON[_0xbbd7('0x12')](_0x44d7f2));_0x205d7f(_0x44d7f2);})['catch'](function(_0x2d0dd8){logger[_0xbbd7('0x13')]('GetSugarcrmAccount',_0x2d0dd8[_0xbbd7('0x15')],_0x259dae);_0x58cf50(_0x5884c4[_0xbbd7('0x13')](0x1f4,_0x2d0dd8[_0xbbd7('0x15')]));});});};exports['ShowSugarcrmAccount']=function(_0x2d5ba8){var _0x4a38a8=this;return new Promise(function(_0x1a2f30,_0x49e40c){return db[_0xbbd7('0x21')][_0xbbd7('0x22')]({'raw':_0x2d5ba8[_0xbbd7('0x19')]?_0x2d5ba8[_0xbbd7('0x19')][_0xbbd7('0x1a')]===undefined?!![]:![]:!![],'where':_0x2d5ba8[_0xbbd7('0x19')]?_0x2d5ba8[_0xbbd7('0x19')][_0xbbd7('0x1b')]||null:null,'attributes':_0x2d5ba8[_0xbbd7('0x19')]?_0x2d5ba8[_0xbbd7('0x19')][_0xbbd7('0x1c')]||null:null,'include':_0x2d5ba8[_0xbbd7('0x19')]?_0x2d5ba8['options'][_0xbbd7('0x1e')]?_['map'](_0x2d5ba8[_0xbbd7('0x19')][_0xbbd7('0x1e')],function(_0x3a6009){return{'model':db[_0x3a6009[_0xbbd7('0x1f')]],'as':_0x3a6009['as'],'attributes':_0x3a6009[_0xbbd7('0x1c')],'include':_0x3a6009[_0xbbd7('0x1e')]?_[_0xbbd7('0x1d')](_0x3a6009['include'],function(_0x2029d4){return{'model':db[_0x2029d4[_0xbbd7('0x1f')]],'as':_0x2029d4['as'],'attributes':_0x2029d4[_0xbbd7('0x1c')],'include':_0x2029d4['include']?_[_0xbbd7('0x1d')](_0x2029d4[_0xbbd7('0x1e')],function(_0x3c1ecc){return{'model':db[_0x3c1ecc[_0xbbd7('0x1f')]],'as':_0x3c1ecc['as'],'attributes':_0x3c1ecc[_0xbbd7('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xf65d9a){logger[_0xbbd7('0xe')]('ShowSugarcrmAccount',_0x2d5ba8);logger[_0xbbd7('0x10')]('ShowSugarcrmAccount',_0x2d5ba8,JSON[_0xbbd7('0x12')](_0xf65d9a));_0x1a2f30(_0xf65d9a);})[_0xbbd7('0x17')](function(_0x5d7b31){logger['error']('ShowSugarcrmAccount',_0x5d7b31['message'],_0x2d5ba8);_0x49e40c(_0x4a38a8[_0xbbd7('0x13')](0x1f4,_0x5d7b31[_0xbbd7('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 889600f..52d8bfb 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 _0x68d7=['getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x68d7,0xf4));var _0x768d=function(_0x52ecdb,_0x53506b){_0x52ecdb=_0x52ecdb-0x0;var _0x1613b5=_0x68d7[_0x52ecdb];return _0x1613b5;};'use strict';var multer=require(_0x768d('0x0'));var util=require(_0x768d('0x1'));var path=require('path');var timeout=require(_0x768d('0x2'));var express=require(_0x768d('0x3'));var router=express[_0x768d('0x4')]();var fs_extra=require(_0x768d('0x5'));var auth=require(_0x768d('0x6'));var interaction=require(_0x768d('0x7'));var config=require(_0x768d('0x8'));var controller=require(_0x768d('0x9'));router[_0x768d('0xa')]('/',auth[_0x768d('0xb')](),controller[_0x768d('0xc')]);router[_0x768d('0xa')](_0x768d('0xd'),auth['isAuthenticated'](),controller[_0x768d('0xe')]);router['get'](_0x768d('0xf'),auth[_0x768d('0xb')](),controller[_0x768d('0x10')]);router['get'](_0x768d('0x11'),auth[_0x768d('0xb')](),controller[_0x768d('0x12')]);router[_0x768d('0xa')](_0x768d('0x13'),auth[_0x768d('0xb')](),controller[_0x768d('0x14')]);router[_0x768d('0x15')]('/',auth['isAuthenticated'](),controller[_0x768d('0x16')]);router['put'](_0x768d('0xd'),auth[_0x768d('0xb')](),controller[_0x768d('0x17')]);router[_0x768d('0x18')](_0x768d('0xd'),auth[_0x768d('0xb')](),controller[_0x768d('0x19')]);module['exports']=router; \ No newline at end of file +var _0xaa79=['isAuthenticated','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','create','put','/:id','delete','exports','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x522422,_0x4f8029){var _0x42cd1c=function(_0x5a721e){while(--_0x5a721e){_0x522422['push'](_0x522422['shift']());}};_0x42cd1c(++_0x4f8029);}(_0xaa79,0x13d));var _0x9aa7=function(_0x23ac3a,_0x1e1890){_0x23ac3a=_0x23ac3a-0x0;var _0x36e268=_0xaa79[_0x23ac3a];return _0x36e268;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9aa7('0x0'));var timeout=require(_0x9aa7('0x1'));var express=require('express');var router=express[_0x9aa7('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x9aa7('0x3'));var interaction=require(_0x9aa7('0x4'));var config=require(_0x9aa7('0x5'));var controller=require('./intSugarcrmConfiguration.controller');router[_0x9aa7('0x6')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth[_0x9aa7('0x7')](),controller['show']);router[_0x9aa7('0x6')](_0x9aa7('0x8'),auth['isAuthenticated'](),controller[_0x9aa7('0x9')]);router[_0x9aa7('0x6')](_0x9aa7('0xa'),auth['isAuthenticated'](),controller[_0x9aa7('0xb')]);router[_0x9aa7('0x6')]('/:id/descriptions',auth[_0x9aa7('0x7')](),controller[_0x9aa7('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9aa7('0xd')]);router[_0x9aa7('0xe')](_0x9aa7('0xf'),auth['isAuthenticated'](),controller['update']);router[_0x9aa7('0x10')](_0x9aa7('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x9aa7('0x11')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 5ee464b..1cfdb00 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 _0xd691=['STRING','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd691,0x82));var _0x1d69=function(_0x70800b,_0x18c90c){_0x70800b=_0x70800b-0x0;var _0x8db856=_0xd691[_0x70800b];return _0x8db856;};'use strict';var Sequelize=require(_0x1d69('0x0'));module[_0x1d69('0x1')]={'name':{'type':Sequelize[_0x1d69('0x2')]},'description':{'type':Sequelize[_0x1d69('0x2')]}}; \ No newline at end of file +var _0xe9c0=['STRING','sequelize','exports'];(function(_0x297c55,_0x34fa75){var _0x120389=function(_0x595108){while(--_0x595108){_0x297c55['push'](_0x297c55['shift']());}};_0x120389(++_0x34fa75);}(_0xe9c0,0x175));var _0x0e9c=function(_0xd3a823,_0x4ad32e){_0xd3a823=_0xd3a823-0x0;var _0x54b98a=_0xe9c0[_0xd3a823];return _0x54b98a;};'use strict';var Sequelize=require(_0x0e9c('0x0'));module[_0x0e9c('0x1')]={'name':{'type':Sequelize[_0x0e9c('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index cdb59c1..750e89d 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 _0x5a0b=['create','body','update','getFields','findOne','order','pick','merge','options','hasOwnProperty','getSubjects','SugarcrmField','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','SugarcrmConfiguration','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','sort','where','filters','map','VIRTUAL','filter','count','includeAll','include','rows','catch','show','params','find'];(function(_0x16a8da,_0x4b4e97){var _0x2fec7e=function(_0x14ab4a){while(--_0x14ab4a){_0x16a8da['push'](_0x16a8da['shift']());}};_0x2fec7e(++_0x4b4e97);}(_0x5a0b,0x145));var _0xb5a0=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0x5a0b[_0x16d10f];return _0x50c823;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb5a0('0x0'));var zipdir=require(_0xb5a0('0x1'));var jsonpatch=require(_0xb5a0('0x2'));var rp=require(_0xb5a0('0x3'));var moment=require(_0xb5a0('0x4'));var BPromise=require(_0xb5a0('0x5'));var Mustache=require(_0xb5a0('0x6'));var util=require('util');var path=require('path');var sox=require(_0xb5a0('0x7'));var csv=require('to-csv');var ejs=require(_0xb5a0('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb5a0('0x9'));var squel=require(_0xb5a0('0xa'));var crypto=require(_0xb5a0('0xb'));var jsforce=require(_0xb5a0('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb5a0('0xd'));var Papa=require('papaparse');var Redis=require(_0xb5a0('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb5a0('0xf'))(_0xb5a0('0x10'));var utils=require('../../config/utils');var config=require(_0xb5a0('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0xb5a0('0x12'))['db'];function respondWithStatusCode(_0x253d7d,_0x4a986b){_0x4a986b=_0x4a986b||0xcc;return function(_0x5ec26e){if(_0x5ec26e){return _0x253d7d[_0xb5a0('0x13')](_0x4a986b);}return _0x253d7d[_0xb5a0('0x14')](_0x4a986b)[_0xb5a0('0x15')]();};}function respondWithResult(_0x5743ac,_0x525e70){_0x525e70=_0x525e70||0xc8;return function(_0x3c300b){if(_0x3c300b){return _0x5743ac['status'](_0x525e70)[_0xb5a0('0x16')](_0x3c300b);}};}function respondWithFilteredResult(_0x4ad7d4,_0x275452){return function(_0x1b3504){if(_0x1b3504){var _0x5b4408=typeof _0x275452[_0xb5a0('0x17')]==='undefined'&&typeof _0x275452[_0xb5a0('0x18')]===_0xb5a0('0x19');var _0x449d5b=_0x1b3504['count'];var _0x5bf3be=_0x5b4408?0x0:_0x275452[_0xb5a0('0x17')];var _0x537f19=_0x5b4408?_0x1b3504['count']:_0x275452[_0xb5a0('0x17')]+_0x275452[_0xb5a0('0x18')];var _0x1f4d94;if(_0x537f19>=_0x449d5b){_0x537f19=_0x449d5b;_0x1f4d94=0xc8;}else{_0x1f4d94=0xce;}_0x4ad7d4[_0xb5a0('0x14')](_0x1f4d94);return _0x4ad7d4[_0xb5a0('0x1a')](_0xb5a0('0x1b'),_0x5bf3be+'-'+_0x537f19+'/'+_0x449d5b)[_0xb5a0('0x16')](_0x1b3504);}return null;};}function patchUpdates(_0x4dd94a){return function(_0x56b12f){try{jsonpatch[_0xb5a0('0x1c')](_0x56b12f,_0x4dd94a,!![]);}catch(_0x2bda74){return BPromise[_0xb5a0('0x1d')](_0x2bda74);}return _0x56b12f[_0xb5a0('0x1e')]();};}function saveUpdates(_0x275656,_0x3b808d){return function(_0x13b36e){if(_0x13b36e){return _0x13b36e['update'](_0x275656)[_0xb5a0('0x1f')](function(_0x528e19){return _0x528e19;});}return null;};}function removeEntity(_0x2a2c2b,_0x270418){return function(_0x2b318e){if(_0x2b318e){return _0x2b318e[_0xb5a0('0x20')]()[_0xb5a0('0x1f')](function(){_0x2a2c2b['status'](0xcc)[_0xb5a0('0x15')]();});}};}function handleEntityNotFound(_0x358f79,_0x26f0b1){return function(_0x42fe80){if(!_0x42fe80){_0x358f79['sendStatus'](0x194);}return _0x42fe80;};}function handleError(_0x56da18,_0x3d5e26){_0x3d5e26=_0x3d5e26||0x1f4;return function(_0x4c7dd5){logger[_0xb5a0('0x21')](_0x4c7dd5[_0xb5a0('0x22')]);if(_0x4c7dd5[_0xb5a0('0x23')]){delete _0x4c7dd5[_0xb5a0('0x23')];}_0x56da18[_0xb5a0('0x14')](_0x3d5e26)[_0xb5a0('0x24')](_0x4c7dd5);};}exports[_0xb5a0('0x25')]=function(_0x3d0016,_0x3306db){var _0x57cd37={},_0x5999b8={},_0x52bc1c={'count':0x0,'rows':[]};var _0x1d3aa6=_['map'](db[_0xb5a0('0x26')][_0xb5a0('0x27')],function(_0x1a12c2){return{'name':_0x1a12c2[_0xb5a0('0x28')],'type':_0x1a12c2[_0xb5a0('0x29')][_0xb5a0('0x2a')]};});_0x5999b8[_0xb5a0('0x2b')]=_['map'](_0x1d3aa6,_0xb5a0('0x23'));_0x5999b8[_0xb5a0('0x2c')]=_[_0xb5a0('0x2d')](_0x3d0016['query']);_0x5999b8['filters']=_[_0xb5a0('0x2e')](_0x5999b8[_0xb5a0('0x2b')],_0x5999b8[_0xb5a0('0x2c')]);_0x57cd37[_0xb5a0('0x2f')]=_[_0xb5a0('0x2e')](_0x5999b8[_0xb5a0('0x2b')],qs['fields'](_0x3d0016[_0xb5a0('0x2c')][_0xb5a0('0x30')]));_0x57cd37[_0xb5a0('0x2f')]=_0x57cd37[_0xb5a0('0x2f')][_0xb5a0('0x31')]?_0x57cd37[_0xb5a0('0x2f')]:_0x5999b8[_0xb5a0('0x2b')];if(!_0x3d0016[_0xb5a0('0x2c')]['hasOwnProperty'](_0xb5a0('0x32'))){_0x57cd37['limit']=qs[_0xb5a0('0x18')](_0x3d0016[_0xb5a0('0x2c')][_0xb5a0('0x18')]);_0x57cd37[_0xb5a0('0x17')]=qs[_0xb5a0('0x17')](_0x3d0016[_0xb5a0('0x2c')][_0xb5a0('0x17')]);}_0x57cd37['order']=qs[_0xb5a0('0x33')](_0x3d0016[_0xb5a0('0x2c')][_0xb5a0('0x33')]);_0x57cd37[_0xb5a0('0x34')]=qs[_0xb5a0('0x35')](_['pick'](_0x3d0016[_0xb5a0('0x2c')],_0x5999b8[_0xb5a0('0x35')]),_0x1d3aa6);if(_0x3d0016['query']['filter']){_0x57cd37['where']=_['merge'](_0x57cd37[_0xb5a0('0x34')],{'$or':_[_0xb5a0('0x36')](_0x1d3aa6,function(_0x10fa53){if(_0x10fa53[_0xb5a0('0x29')]!==_0xb5a0('0x37')){var _0x1d5c28={};_0x1d5c28[_0x10fa53[_0xb5a0('0x23')]]={'$like':'%'+_0x3d0016[_0xb5a0('0x2c')][_0xb5a0('0x38')]+'%'};return _0x1d5c28;}})});}_0x57cd37=_['merge']({},_0x57cd37,_0x3d0016['options']);var _0x4042bc={'where':_0x57cd37['where']};return db[_0xb5a0('0x26')][_0xb5a0('0x39')](_0x4042bc)[_0xb5a0('0x1f')](function(_0x11798b){_0x52bc1c[_0xb5a0('0x39')]=_0x11798b;if(_0x3d0016[_0xb5a0('0x2c')][_0xb5a0('0x3a')]){_0x57cd37[_0xb5a0('0x3b')]=[{'all':!![]}];}return db[_0xb5a0('0x26')]['findAll'](_0x57cd37);})['then'](function(_0x25a1cf){_0x52bc1c[_0xb5a0('0x3c')]=_0x25a1cf;return _0x52bc1c;})[_0xb5a0('0x1f')](respondWithFilteredResult(_0x3306db,_0x57cd37))[_0xb5a0('0x3d')](handleError(_0x3306db,null));};exports[_0xb5a0('0x3e')]=function(_0x4ee48d,_0x538c70){var _0x3052ff={'raw':![],'where':{'id':_0x4ee48d[_0xb5a0('0x3f')]['id']}},_0x543fa8={};_0x543fa8[_0xb5a0('0x2b')]=_[_0xb5a0('0x2d')](db[_0xb5a0('0x26')][_0xb5a0('0x27')]);_0x543fa8[_0xb5a0('0x2c')]=_['keys'](_0x4ee48d[_0xb5a0('0x2c')]);_0x543fa8[_0xb5a0('0x35')]=_[_0xb5a0('0x2e')](_0x543fa8[_0xb5a0('0x2b')],_0x543fa8[_0xb5a0('0x2c')]);_0x3052ff['attributes']=_[_0xb5a0('0x2e')](_0x543fa8[_0xb5a0('0x2b')],qs[_0xb5a0('0x30')](_0x4ee48d[_0xb5a0('0x2c')][_0xb5a0('0x30')]));_0x3052ff[_0xb5a0('0x2f')]=_0x3052ff[_0xb5a0('0x2f')][_0xb5a0('0x31')]?_0x3052ff[_0xb5a0('0x2f')]:_0x543fa8[_0xb5a0('0x2b')];if(_0x4ee48d['query'][_0xb5a0('0x3a')]){_0x3052ff[_0xb5a0('0x3b')]=[{'all':!![]}];}_0x3052ff=_['merge']({},_0x3052ff,_0x4ee48d['options']);return db[_0xb5a0('0x26')][_0xb5a0('0x40')](_0x3052ff)[_0xb5a0('0x1f')](handleEntityNotFound(_0x538c70,null))[_0xb5a0('0x1f')](respondWithResult(_0x538c70,null))[_0xb5a0('0x3d')](handleError(_0x538c70,null));};exports[_0xb5a0('0x41')]=function(_0x1e2645,_0x423902){return db[_0xb5a0('0x26')][_0xb5a0('0x41')](_0x1e2645[_0xb5a0('0x42')],{})['then'](respondWithResult(_0x423902,0xc9))[_0xb5a0('0x3d')](handleError(_0x423902,null));};exports[_0xb5a0('0x43')]=function(_0x509439,_0x41fd1d){if(_0x509439['body']['id']){delete _0x509439[_0xb5a0('0x42')]['id'];}return db[_0xb5a0('0x26')][_0xb5a0('0x40')]({'where':{'id':_0x509439['params']['id']}})[_0xb5a0('0x1f')](handleEntityNotFound(_0x41fd1d,null))[_0xb5a0('0x1f')](saveUpdates(_0x509439[_0xb5a0('0x42')],null))['then'](respondWithResult(_0x41fd1d,null))[_0xb5a0('0x3d')](handleError(_0x41fd1d,null));};exports[_0xb5a0('0x20')]=function(_0x354475,_0xaf3fc1){return db[_0xb5a0('0x26')][_0xb5a0('0x40')]({'where':{'id':_0x354475[_0xb5a0('0x3f')]['id']}})[_0xb5a0('0x1f')](handleEntityNotFound(_0xaf3fc1,null))[_0xb5a0('0x1f')](removeEntity(_0xaf3fc1,null))[_0xb5a0('0x3d')](handleError(_0xaf3fc1,null));};exports[_0xb5a0('0x44')]=function(_0x2e6291,_0x30f185,_0xe5dbde){var _0x2f67cd={};var _0x3815d0={};var _0x4c3d7d;var _0x4116b5;return db[_0xb5a0('0x26')][_0xb5a0('0x45')]({'where':{'id':_0x2e6291['params']['id']}})['then'](handleEntityNotFound(_0x30f185,null))[_0xb5a0('0x1f')](function(_0x2df329){if(_0x2df329){_0x4c3d7d=_0x2df329;_0x3815d0[_0xb5a0('0x2b')]=_[_0xb5a0('0x2d')](db['SugarcrmField'][_0xb5a0('0x27')]);_0x3815d0[_0xb5a0('0x2c')]=_[_0xb5a0('0x2d')](_0x2e6291['query']);_0x3815d0[_0xb5a0('0x35')]=_[_0xb5a0('0x2e')](_0x3815d0[_0xb5a0('0x2b')],_0x3815d0['query']);_0x2f67cd[_0xb5a0('0x2f')]=_[_0xb5a0('0x2e')](_0x3815d0[_0xb5a0('0x2b')],qs[_0xb5a0('0x30')](_0x2e6291[_0xb5a0('0x2c')]['fields']));_0x2f67cd[_0xb5a0('0x2f')]=_0x2f67cd[_0xb5a0('0x2f')][_0xb5a0('0x31')]?_0x2f67cd['attributes']:_0x3815d0['model'];_0x2f67cd[_0xb5a0('0x46')]=qs[_0xb5a0('0x33')](_0x2e6291[_0xb5a0('0x2c')][_0xb5a0('0x33')]);_0x2f67cd[_0xb5a0('0x34')]=qs[_0xb5a0('0x35')](_[_0xb5a0('0x47')](_0x2e6291[_0xb5a0('0x2c')],_0x3815d0[_0xb5a0('0x35')]));if(_0x2e6291[_0xb5a0('0x2c')][_0xb5a0('0x38')]){_0x2f67cd[_0xb5a0('0x34')]=_[_0xb5a0('0x48')](_0x2f67cd['where'],{'$or':_[_0xb5a0('0x36')](_0x2f67cd['attributes'],function(_0x5d08d7){var _0x412087={};_0x412087[_0x5d08d7]={'$like':'%'+_0x2e6291[_0xb5a0('0x2c')][_0xb5a0('0x38')]+'%'};return _0x412087;})});}_0x2f67cd=_[_0xb5a0('0x48')]({},_0x2f67cd,_0x2e6291[_0xb5a0('0x49')]);return _0x4c3d7d[_0xb5a0('0x44')](_0x2f67cd);}})['then'](function(_0x53d512){if(_0x53d512){_0x4116b5=_0x53d512['length'];if(!_0x2e6291[_0xb5a0('0x2c')][_0xb5a0('0x4a')](_0xb5a0('0x32'))){_0x2f67cd[_0xb5a0('0x18')]=qs[_0xb5a0('0x18')](_0x2e6291[_0xb5a0('0x2c')][_0xb5a0('0x18')]);_0x2f67cd[_0xb5a0('0x17')]=qs[_0xb5a0('0x17')](_0x2e6291[_0xb5a0('0x2c')]['offset']);}return _0x4c3d7d[_0xb5a0('0x44')](_0x2f67cd);}})['then'](function(_0x1a1bd1){if(_0x1a1bd1){return _0x1a1bd1?{'count':_0x4116b5,'rows':_0x1a1bd1}:null;}})[_0xb5a0('0x1f')](respondWithResult(_0x30f185,null))['catch'](handleError(_0x30f185,null));};exports[_0xb5a0('0x4b')]=function(_0x1e5713,_0x206f23,_0x46f843){var _0x4764a3={};var _0x3cdf78={};var _0x553750;var _0x35e19e;return db[_0xb5a0('0x26')]['findOne']({'where':{'id':_0x1e5713[_0xb5a0('0x3f')]['id']}})['then'](handleEntityNotFound(_0x206f23,null))[_0xb5a0('0x1f')](function(_0xf43f52){if(_0xf43f52){_0x553750=_0xf43f52;_0x3cdf78[_0xb5a0('0x2b')]=_[_0xb5a0('0x2d')](db[_0xb5a0('0x4c')][_0xb5a0('0x27')]);_0x3cdf78[_0xb5a0('0x2c')]=_[_0xb5a0('0x2d')](_0x1e5713[_0xb5a0('0x2c')]);_0x3cdf78['filters']=_['intersection'](_0x3cdf78[_0xb5a0('0x2b')],_0x3cdf78[_0xb5a0('0x2c')]);_0x4764a3[_0xb5a0('0x2f')]=_[_0xb5a0('0x2e')](_0x3cdf78[_0xb5a0('0x2b')],qs[_0xb5a0('0x30')](_0x1e5713[_0xb5a0('0x2c')][_0xb5a0('0x30')]));_0x4764a3[_0xb5a0('0x2f')]=_0x4764a3[_0xb5a0('0x2f')][_0xb5a0('0x31')]?_0x4764a3[_0xb5a0('0x2f')]:_0x3cdf78[_0xb5a0('0x2b')];_0x4764a3[_0xb5a0('0x46')]=qs[_0xb5a0('0x33')](_0x1e5713[_0xb5a0('0x2c')]['sort']);_0x4764a3[_0xb5a0('0x34')]=qs[_0xb5a0('0x35')](_['pick'](_0x1e5713[_0xb5a0('0x2c')],_0x3cdf78[_0xb5a0('0x35')]));if(_0x1e5713[_0xb5a0('0x2c')][_0xb5a0('0x38')]){_0x4764a3[_0xb5a0('0x34')]=_[_0xb5a0('0x48')](_0x4764a3[_0xb5a0('0x34')],{'$or':_[_0xb5a0('0x36')](_0x4764a3[_0xb5a0('0x2f')],function(_0x44d96a){var _0x50061a={};_0x50061a[_0x44d96a]={'$like':'%'+_0x1e5713[_0xb5a0('0x2c')][_0xb5a0('0x38')]+'%'};return _0x50061a;})});}_0x4764a3=_[_0xb5a0('0x48')]({},_0x4764a3,_0x1e5713[_0xb5a0('0x49')]);return _0x553750[_0xb5a0('0x4b')](_0x4764a3);}})['then'](function(_0x472dee){if(_0x472dee){_0x35e19e=_0x472dee[_0xb5a0('0x31')];if(!_0x1e5713[_0xb5a0('0x2c')]['hasOwnProperty'](_0xb5a0('0x32'))){_0x4764a3[_0xb5a0('0x18')]=qs[_0xb5a0('0x18')](_0x1e5713[_0xb5a0('0x2c')][_0xb5a0('0x18')]);_0x4764a3[_0xb5a0('0x17')]=qs[_0xb5a0('0x17')](_0x1e5713['query'][_0xb5a0('0x17')]);}return _0x553750[_0xb5a0('0x4b')](_0x4764a3);}})['then'](function(_0x380298){if(_0x380298){return _0x380298?{'count':_0x35e19e,'rows':_0x380298}:null;}})[_0xb5a0('0x1f')](respondWithResult(_0x206f23,null))[_0xb5a0('0x3d')](handleError(_0x206f23,null));};exports[_0xb5a0('0x4d')]=function(_0x5a4347,_0x1b212e,_0x470564){var _0x7f50ad={};var _0x58de36={};var _0x368566;var _0x1e7b28;return db[_0xb5a0('0x26')][_0xb5a0('0x45')]({'where':{'id':_0x5a4347[_0xb5a0('0x3f')]['id']}})[_0xb5a0('0x1f')](handleEntityNotFound(_0x1b212e,null))[_0xb5a0('0x1f')](function(_0x3a4e98){if(_0x3a4e98){_0x368566=_0x3a4e98;_0x58de36[_0xb5a0('0x2b')]=_['keys'](db[_0xb5a0('0x4c')][_0xb5a0('0x27')]);_0x58de36[_0xb5a0('0x2c')]=_[_0xb5a0('0x2d')](_0x5a4347['query']);_0x58de36[_0xb5a0('0x35')]=_[_0xb5a0('0x2e')](_0x58de36[_0xb5a0('0x2b')],_0x58de36[_0xb5a0('0x2c')]);_0x7f50ad[_0xb5a0('0x2f')]=_[_0xb5a0('0x2e')](_0x58de36[_0xb5a0('0x2b')],qs[_0xb5a0('0x30')](_0x5a4347['query'][_0xb5a0('0x30')]));_0x7f50ad[_0xb5a0('0x2f')]=_0x7f50ad['attributes']['length']?_0x7f50ad[_0xb5a0('0x2f')]:_0x58de36[_0xb5a0('0x2b')];_0x7f50ad[_0xb5a0('0x46')]=qs[_0xb5a0('0x33')](_0x5a4347[_0xb5a0('0x2c')][_0xb5a0('0x33')]);_0x7f50ad[_0xb5a0('0x34')]=qs['filters'](_[_0xb5a0('0x47')](_0x5a4347[_0xb5a0('0x2c')],_0x58de36[_0xb5a0('0x35')]));if(_0x5a4347[_0xb5a0('0x2c')][_0xb5a0('0x38')]){_0x7f50ad[_0xb5a0('0x34')]=_[_0xb5a0('0x48')](_0x7f50ad['where'],{'$or':_['map'](_0x7f50ad[_0xb5a0('0x2f')],function(_0x1a4d7e){var _0x5d8aa7={};_0x5d8aa7[_0x1a4d7e]={'$like':'%'+_0x5a4347[_0xb5a0('0x2c')][_0xb5a0('0x38')]+'%'};return _0x5d8aa7;})});}_0x7f50ad=_[_0xb5a0('0x48')]({},_0x7f50ad,_0x5a4347['options']);return _0x368566[_0xb5a0('0x4d')](_0x7f50ad);}})['then'](function(_0x2de1c6){if(_0x2de1c6){_0x1e7b28=_0x2de1c6[_0xb5a0('0x31')];if(!_0x5a4347[_0xb5a0('0x2c')][_0xb5a0('0x4a')](_0xb5a0('0x32'))){_0x7f50ad[_0xb5a0('0x18')]=qs[_0xb5a0('0x18')](_0x5a4347[_0xb5a0('0x2c')][_0xb5a0('0x18')]);_0x7f50ad[_0xb5a0('0x17')]=qs[_0xb5a0('0x17')](_0x5a4347['query']['offset']);}return _0x368566[_0xb5a0('0x4d')](_0x7f50ad);}})[_0xb5a0('0x1f')](function(_0x734b28){if(_0x734b28){return _0x734b28?{'count':_0x1e7b28,'rows':_0x734b28}:null;}})[_0xb5a0('0x1f')](respondWithResult(_0x1b212e,null))[_0xb5a0('0x3d')](handleError(_0x1b212e,null));}; \ No newline at end of file +var _0x9aa2=['keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','offset','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','body','destroy','findOne','SugarcrmField','order','getFields','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','status','end','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','map','SugarcrmConfiguration','fieldName','key','query'];(function(_0x566be4,_0x13a3ae){var _0x1ad6f5=function(_0xaadc36){while(--_0xaadc36){_0x566be4['push'](_0x566be4['shift']());}};_0x1ad6f5(++_0x13a3ae);}(_0x9aa2,0x7a));var _0x29aa=function(_0x3290f2,_0x3bb284){_0x3290f2=_0x3290f2-0x0;var _0x38e186=_0x9aa2[_0x3290f2];return _0x38e186;};'use strict';var emlformat=require(_0x29aa('0x0'));var rimraf=require(_0x29aa('0x1'));var zipdir=require(_0x29aa('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x29aa('0x3'));var moment=require(_0x29aa('0x4'));var BPromise=require(_0x29aa('0x5'));var Mustache=require(_0x29aa('0x6'));var util=require('util');var path=require(_0x29aa('0x7'));var sox=require(_0x29aa('0x8'));var csv=require('to-csv');var ejs=require(_0x29aa('0x9'));var fs=require('fs');var fs_extra=require(_0x29aa('0xa'));var _=require(_0x29aa('0xb'));var squel=require('squel');var crypto=require(_0x29aa('0xc'));var jsforce=require(_0x29aa('0xd'));var deskjs=require(_0x29aa('0xe'));var toCsv=require(_0x29aa('0xf'));var querystring=require(_0x29aa('0x10'));var Papa=require(_0x29aa('0x11'));var Redis=require(_0x29aa('0x12'));var authService=require(_0x29aa('0x13'));var qs=require(_0x29aa('0x14'));var as=require(_0x29aa('0x15'));var hardwareService=require(_0x29aa('0x16'));var logger=require(_0x29aa('0x17'))('api');var utils=require(_0x29aa('0x18'));var config=require(_0x29aa('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x509336,_0x4331e9){_0x4331e9=_0x4331e9||0xcc;return function(_0x57a429){if(_0x57a429){return _0x509336['sendStatus'](_0x4331e9);}return _0x509336[_0x29aa('0x1a')](_0x4331e9)[_0x29aa('0x1b')]();};}function respondWithResult(_0x40fcf3,_0x4c4fc7){_0x4c4fc7=_0x4c4fc7||0xc8;return function(_0x39c3f9){if(_0x39c3f9){return _0x40fcf3['status'](_0x4c4fc7)[_0x29aa('0x1c')](_0x39c3f9);}};}function respondWithFilteredResult(_0x32d6c5,_0x48360f){return function(_0x41cdc7){if(_0x41cdc7){var _0x16f1f1=typeof _0x48360f['offset']===_0x29aa('0x1d')&&typeof _0x48360f[_0x29aa('0x1e')]==='undefined';var _0xa86da7=_0x41cdc7[_0x29aa('0x1f')];var _0xfa43a6=_0x16f1f1?0x0:_0x48360f['offset'];var _0x276bb0=_0x16f1f1?_0x41cdc7[_0x29aa('0x1f')]:_0x48360f['offset']+_0x48360f[_0x29aa('0x1e')];var _0x584bf9;if(_0x276bb0>=_0xa86da7){_0x276bb0=_0xa86da7;_0x584bf9=0xc8;}else{_0x584bf9=0xce;}_0x32d6c5[_0x29aa('0x1a')](_0x584bf9);return _0x32d6c5[_0x29aa('0x20')](_0x29aa('0x21'),_0xfa43a6+'-'+_0x276bb0+'/'+_0xa86da7)[_0x29aa('0x1c')](_0x41cdc7);}return null;};}function patchUpdates(_0x3b9e9d){return function(_0x4d1099){try{jsonpatch[_0x29aa('0x22')](_0x4d1099,_0x3b9e9d,!![]);}catch(_0xc28672){return BPromise[_0x29aa('0x23')](_0xc28672);}return _0x4d1099[_0x29aa('0x24')]();};}function saveUpdates(_0x2371e4,_0x55740c){return function(_0x1ac9bb){if(_0x1ac9bb){return _0x1ac9bb[_0x29aa('0x25')](_0x2371e4)[_0x29aa('0x26')](function(_0x3d5ca7){return _0x3d5ca7;});}return null;};}function removeEntity(_0x9b6111,_0x846f26){return function(_0x59ca34){if(_0x59ca34){return _0x59ca34['destroy']()[_0x29aa('0x26')](function(){_0x9b6111[_0x29aa('0x1a')](0xcc)[_0x29aa('0x1b')]();});}};}function handleEntityNotFound(_0x3a0e66,_0x285184){return function(_0x461b26){if(!_0x461b26){_0x3a0e66[_0x29aa('0x27')](0x194);}return _0x461b26;};}function handleError(_0xe09184,_0x44f114){_0x44f114=_0x44f114||0x1f4;return function(_0x87dfc6){logger[_0x29aa('0x28')](_0x87dfc6[_0x29aa('0x29')]);if(_0x87dfc6[_0x29aa('0x2a')]){delete _0x87dfc6[_0x29aa('0x2a')];}_0xe09184[_0x29aa('0x1a')](_0x44f114)[_0x29aa('0x2b')](_0x87dfc6);};}exports[_0x29aa('0x2c')]=function(_0xf41096,_0x2184a7){var _0x16efb9={},_0x5a39d0={},_0x383d15={'count':0x0,'rows':[]};var _0x5bfb5f=_[_0x29aa('0x2d')](db[_0x29aa('0x2e')]['rawAttributes'],function(_0x1b8b07){return{'name':_0x1b8b07[_0x29aa('0x2f')],'type':_0x1b8b07['type'][_0x29aa('0x30')]};});_0x5a39d0['model']=_[_0x29aa('0x2d')](_0x5bfb5f,'name');_0x5a39d0[_0x29aa('0x31')]=_[_0x29aa('0x32')](_0xf41096[_0x29aa('0x31')]);_0x5a39d0[_0x29aa('0x33')]=_[_0x29aa('0x34')](_0x5a39d0['model'],_0x5a39d0[_0x29aa('0x31')]);_0x16efb9[_0x29aa('0x35')]=_['intersection'](_0x5a39d0[_0x29aa('0x36')],qs['fields'](_0xf41096[_0x29aa('0x31')][_0x29aa('0x37')]));_0x16efb9[_0x29aa('0x35')]=_0x16efb9[_0x29aa('0x35')][_0x29aa('0x38')]?_0x16efb9[_0x29aa('0x35')]:_0x5a39d0['model'];if(!_0xf41096[_0x29aa('0x31')][_0x29aa('0x39')](_0x29aa('0x3a'))){_0x16efb9[_0x29aa('0x1e')]=qs['limit'](_0xf41096[_0x29aa('0x31')]['limit']);_0x16efb9['offset']=qs[_0x29aa('0x3b')](_0xf41096[_0x29aa('0x31')]['offset']);}_0x16efb9['order']=qs[_0x29aa('0x3c')](_0xf41096[_0x29aa('0x31')][_0x29aa('0x3c')]);_0x16efb9[_0x29aa('0x3d')]=qs['filters'](_[_0x29aa('0x3e')](_0xf41096[_0x29aa('0x31')],_0x5a39d0[_0x29aa('0x33')]),_0x5bfb5f);if(_0xf41096[_0x29aa('0x31')][_0x29aa('0x3f')]){_0x16efb9['where']=_['merge'](_0x16efb9[_0x29aa('0x3d')],{'$or':_[_0x29aa('0x2d')](_0x5bfb5f,function(_0xc68e7d){if(_0xc68e7d[_0x29aa('0x40')]!==_0x29aa('0x41')){var _0x471d90={};_0x471d90[_0xc68e7d[_0x29aa('0x2a')]]={'$like':'%'+_0xf41096[_0x29aa('0x31')][_0x29aa('0x3f')]+'%'};return _0x471d90;}})});}_0x16efb9=_[_0x29aa('0x42')]({},_0x16efb9,_0xf41096[_0x29aa('0x43')]);var _0x41fc58={'where':_0x16efb9[_0x29aa('0x3d')]};return db['SugarcrmConfiguration'][_0x29aa('0x1f')](_0x41fc58)[_0x29aa('0x26')](function(_0xc30754){_0x383d15['count']=_0xc30754;if(_0xf41096[_0x29aa('0x31')][_0x29aa('0x44')]){_0x16efb9[_0x29aa('0x45')]=[{'all':!![]}];}return db[_0x29aa('0x2e')][_0x29aa('0x46')](_0x16efb9);})[_0x29aa('0x26')](function(_0x1ec1de){_0x383d15[_0x29aa('0x47')]=_0x1ec1de;return _0x383d15;})[_0x29aa('0x26')](respondWithFilteredResult(_0x2184a7,_0x16efb9))['catch'](handleError(_0x2184a7,null));};exports[_0x29aa('0x48')]=function(_0x2a3012,_0x4127fa){var _0x5f45b8={'raw':![],'where':{'id':_0x2a3012[_0x29aa('0x49')]['id']}},_0x4c3539={};_0x4c3539['model']=_[_0x29aa('0x32')](db[_0x29aa('0x2e')][_0x29aa('0x4a')]);_0x4c3539[_0x29aa('0x31')]=_[_0x29aa('0x32')](_0x2a3012['query']);_0x4c3539[_0x29aa('0x33')]=_['intersection'](_0x4c3539['model'],_0x4c3539[_0x29aa('0x31')]);_0x5f45b8[_0x29aa('0x35')]=_[_0x29aa('0x34')](_0x4c3539['model'],qs[_0x29aa('0x37')](_0x2a3012[_0x29aa('0x31')][_0x29aa('0x37')]));_0x5f45b8[_0x29aa('0x35')]=_0x5f45b8['attributes'][_0x29aa('0x38')]?_0x5f45b8[_0x29aa('0x35')]:_0x4c3539[_0x29aa('0x36')];if(_0x2a3012[_0x29aa('0x31')][_0x29aa('0x44')]){_0x5f45b8['include']=[{'all':!![]}];}_0x5f45b8=_[_0x29aa('0x42')]({},_0x5f45b8,_0x2a3012[_0x29aa('0x43')]);return db['SugarcrmConfiguration'][_0x29aa('0x4b')](_0x5f45b8)['then'](handleEntityNotFound(_0x4127fa,null))['then'](respondWithResult(_0x4127fa,null))[_0x29aa('0x4c')](handleError(_0x4127fa,null));};exports[_0x29aa('0x4d')]=function(_0x3ae49b,_0x554b70){return db[_0x29aa('0x2e')]['create'](_0x3ae49b[_0x29aa('0x4e')],{})['then'](respondWithResult(_0x554b70,0xc9))[_0x29aa('0x4c')](handleError(_0x554b70,null));};exports[_0x29aa('0x25')]=function(_0x4fd504,_0x571c77){if(_0x4fd504[_0x29aa('0x4e')]['id']){delete _0x4fd504[_0x29aa('0x4e')]['id'];}return db['SugarcrmConfiguration'][_0x29aa('0x4b')]({'where':{'id':_0x4fd504['params']['id']}})[_0x29aa('0x26')](handleEntityNotFound(_0x571c77,null))[_0x29aa('0x26')](saveUpdates(_0x4fd504['body'],null))[_0x29aa('0x26')](respondWithResult(_0x571c77,null))[_0x29aa('0x4c')](handleError(_0x571c77,null));};exports[_0x29aa('0x4f')]=function(_0x16000c,_0x280316){return db['SugarcrmConfiguration']['find']({'where':{'id':_0x16000c['params']['id']}})['then'](handleEntityNotFound(_0x280316,null))['then'](removeEntity(_0x280316,null))[_0x29aa('0x4c')](handleError(_0x280316,null));};exports['getFields']=function(_0x21c034,_0x265f88,_0x47e28e){var _0x4ececc={};var _0x3b1a8f={};var _0x33ec87;var _0x5f04e1;return db[_0x29aa('0x2e')][_0x29aa('0x50')]({'where':{'id':_0x21c034[_0x29aa('0x49')]['id']}})['then'](handleEntityNotFound(_0x265f88,null))['then'](function(_0x43bdc3){if(_0x43bdc3){_0x33ec87=_0x43bdc3;_0x3b1a8f[_0x29aa('0x36')]=_[_0x29aa('0x32')](db[_0x29aa('0x51')]['rawAttributes']);_0x3b1a8f[_0x29aa('0x31')]=_[_0x29aa('0x32')](_0x21c034['query']);_0x3b1a8f[_0x29aa('0x33')]=_['intersection'](_0x3b1a8f[_0x29aa('0x36')],_0x3b1a8f[_0x29aa('0x31')]);_0x4ececc[_0x29aa('0x35')]=_[_0x29aa('0x34')](_0x3b1a8f['model'],qs[_0x29aa('0x37')](_0x21c034[_0x29aa('0x31')][_0x29aa('0x37')]));_0x4ececc['attributes']=_0x4ececc['attributes'][_0x29aa('0x38')]?_0x4ececc[_0x29aa('0x35')]:_0x3b1a8f[_0x29aa('0x36')];_0x4ececc[_0x29aa('0x52')]=qs['sort'](_0x21c034[_0x29aa('0x31')]['sort']);_0x4ececc[_0x29aa('0x3d')]=qs[_0x29aa('0x33')](_[_0x29aa('0x3e')](_0x21c034['query'],_0x3b1a8f[_0x29aa('0x33')]));if(_0x21c034[_0x29aa('0x31')][_0x29aa('0x3f')]){_0x4ececc['where']=_[_0x29aa('0x42')](_0x4ececc[_0x29aa('0x3d')],{'$or':_[_0x29aa('0x2d')](_0x4ececc[_0x29aa('0x35')],function(_0xab4c45){var _0x5704e2={};_0x5704e2[_0xab4c45]={'$like':'%'+_0x21c034['query']['filter']+'%'};return _0x5704e2;})});}_0x4ececc=_['merge']({},_0x4ececc,_0x21c034['options']);return _0x33ec87[_0x29aa('0x53')](_0x4ececc);}})['then'](function(_0xeb25a){if(_0xeb25a){_0x5f04e1=_0xeb25a['length'];if(!_0x21c034['query'][_0x29aa('0x39')](_0x29aa('0x3a'))){_0x4ececc[_0x29aa('0x1e')]=qs[_0x29aa('0x1e')](_0x21c034[_0x29aa('0x31')][_0x29aa('0x1e')]);_0x4ececc[_0x29aa('0x3b')]=qs[_0x29aa('0x3b')](_0x21c034[_0x29aa('0x31')]['offset']);}return _0x33ec87['getFields'](_0x4ececc);}})['then'](function(_0x2f4de1){if(_0x2f4de1){return _0x2f4de1?{'count':_0x5f04e1,'rows':_0x2f4de1}:null;}})[_0x29aa('0x26')](respondWithResult(_0x265f88,null))[_0x29aa('0x4c')](handleError(_0x265f88,null));};exports['getSubjects']=function(_0x4070be,_0x2a8864,_0x3757b6){var _0x244835={};var _0x46cade={};var _0x257243;var _0x59b6b7;return db[_0x29aa('0x2e')][_0x29aa('0x50')]({'where':{'id':_0x4070be[_0x29aa('0x49')]['id']}})['then'](handleEntityNotFound(_0x2a8864,null))[_0x29aa('0x26')](function(_0x1696c3){if(_0x1696c3){_0x257243=_0x1696c3;_0x46cade[_0x29aa('0x36')]=_['keys'](db[_0x29aa('0x51')][_0x29aa('0x4a')]);_0x46cade[_0x29aa('0x31')]=_[_0x29aa('0x32')](_0x4070be[_0x29aa('0x31')]);_0x46cade[_0x29aa('0x33')]=_[_0x29aa('0x34')](_0x46cade[_0x29aa('0x36')],_0x46cade[_0x29aa('0x31')]);_0x244835[_0x29aa('0x35')]=_[_0x29aa('0x34')](_0x46cade[_0x29aa('0x36')],qs[_0x29aa('0x37')](_0x4070be[_0x29aa('0x31')][_0x29aa('0x37')]));_0x244835[_0x29aa('0x35')]=_0x244835[_0x29aa('0x35')]['length']?_0x244835['attributes']:_0x46cade[_0x29aa('0x36')];_0x244835['order']=qs[_0x29aa('0x3c')](_0x4070be[_0x29aa('0x31')][_0x29aa('0x3c')]);_0x244835['where']=qs[_0x29aa('0x33')](_[_0x29aa('0x3e')](_0x4070be['query'],_0x46cade[_0x29aa('0x33')]));if(_0x4070be[_0x29aa('0x31')]['filter']){_0x244835[_0x29aa('0x3d')]=_['merge'](_0x244835[_0x29aa('0x3d')],{'$or':_['map'](_0x244835[_0x29aa('0x35')],function(_0x1dd108){var _0x2d86ce={};_0x2d86ce[_0x1dd108]={'$like':'%'+_0x4070be[_0x29aa('0x31')][_0x29aa('0x3f')]+'%'};return _0x2d86ce;})});}_0x244835=_[_0x29aa('0x42')]({},_0x244835,_0x4070be[_0x29aa('0x43')]);return _0x257243['getSubjects'](_0x244835);}})[_0x29aa('0x26')](function(_0x53018c){if(_0x53018c){_0x59b6b7=_0x53018c[_0x29aa('0x38')];if(!_0x4070be[_0x29aa('0x31')][_0x29aa('0x39')](_0x29aa('0x3a'))){_0x244835[_0x29aa('0x1e')]=qs[_0x29aa('0x1e')](_0x4070be[_0x29aa('0x31')][_0x29aa('0x1e')]);_0x244835[_0x29aa('0x3b')]=qs[_0x29aa('0x3b')](_0x4070be[_0x29aa('0x31')][_0x29aa('0x3b')]);}return _0x257243[_0x29aa('0x54')](_0x244835);}})[_0x29aa('0x26')](function(_0x2c1bc2){if(_0x2c1bc2){return _0x2c1bc2?{'count':_0x59b6b7,'rows':_0x2c1bc2}:null;}})[_0x29aa('0x26')](respondWithResult(_0x2a8864,null))[_0x29aa('0x4c')](handleError(_0x2a8864,null));};exports[_0x29aa('0x55')]=function(_0x39e9bc,_0x1c7315,_0x3f3f99){var _0x37f63f={};var _0x31f326={};var _0x468f7a;var _0x28c705;return db[_0x29aa('0x2e')][_0x29aa('0x50')]({'where':{'id':_0x39e9bc[_0x29aa('0x49')]['id']}})['then'](handleEntityNotFound(_0x1c7315,null))[_0x29aa('0x26')](function(_0x4fbd3b){if(_0x4fbd3b){_0x468f7a=_0x4fbd3b;_0x31f326[_0x29aa('0x36')]=_[_0x29aa('0x32')](db[_0x29aa('0x51')][_0x29aa('0x4a')]);_0x31f326['query']=_[_0x29aa('0x32')](_0x39e9bc[_0x29aa('0x31')]);_0x31f326[_0x29aa('0x33')]=_[_0x29aa('0x34')](_0x31f326[_0x29aa('0x36')],_0x31f326[_0x29aa('0x31')]);_0x37f63f[_0x29aa('0x35')]=_[_0x29aa('0x34')](_0x31f326[_0x29aa('0x36')],qs[_0x29aa('0x37')](_0x39e9bc[_0x29aa('0x31')][_0x29aa('0x37')]));_0x37f63f[_0x29aa('0x35')]=_0x37f63f[_0x29aa('0x35')][_0x29aa('0x38')]?_0x37f63f[_0x29aa('0x35')]:_0x31f326[_0x29aa('0x36')];_0x37f63f[_0x29aa('0x52')]=qs['sort'](_0x39e9bc['query'][_0x29aa('0x3c')]);_0x37f63f[_0x29aa('0x3d')]=qs[_0x29aa('0x33')](_[_0x29aa('0x3e')](_0x39e9bc[_0x29aa('0x31')],_0x31f326[_0x29aa('0x33')]));if(_0x39e9bc[_0x29aa('0x31')][_0x29aa('0x3f')]){_0x37f63f[_0x29aa('0x3d')]=_[_0x29aa('0x42')](_0x37f63f[_0x29aa('0x3d')],{'$or':_[_0x29aa('0x2d')](_0x37f63f[_0x29aa('0x35')],function(_0x24c7a5){var _0x316361={};_0x316361[_0x24c7a5]={'$like':'%'+_0x39e9bc[_0x29aa('0x31')][_0x29aa('0x3f')]+'%'};return _0x316361;})});}_0x37f63f=_[_0x29aa('0x42')]({},_0x37f63f,_0x39e9bc[_0x29aa('0x43')]);return _0x468f7a[_0x29aa('0x55')](_0x37f63f);}})[_0x29aa('0x26')](function(_0x1c98be){if(_0x1c98be){_0x28c705=_0x1c98be[_0x29aa('0x38')];if(!_0x39e9bc[_0x29aa('0x31')][_0x29aa('0x39')](_0x29aa('0x3a'))){_0x37f63f[_0x29aa('0x1e')]=qs['limit'](_0x39e9bc[_0x29aa('0x31')][_0x29aa('0x1e')]);_0x37f63f[_0x29aa('0x3b')]=qs[_0x29aa('0x3b')](_0x39e9bc[_0x29aa('0x31')]['offset']);}return _0x468f7a[_0x29aa('0x55')](_0x37f63f);}})[_0x29aa('0x26')](function(_0x18780b){if(_0x18780b){return _0x18780b?{'count':_0x28c705,'rows':_0x18780b}:null;}})[_0x29aa('0x26')](respondWithResult(_0x1c7315,null))[_0x29aa('0x4c')](handleError(_0x1c7315,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 4f918af..b5504c4 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 _0x084a=['exports','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes'];(function(_0x2bd1f5,_0x8db4ec){var _0x43a4b3=function(_0x41cdf6){while(--_0x41cdf6){_0x2bd1f5['push'](_0x2bd1f5['shift']());}};_0x43a4b3(++_0x8db4ec);}(_0x084a,0x1b6));var _0xa084=function(_0x499ef5,_0x57f0e9){_0x499ef5=_0x499ef5-0x0;var _0x5bb00a=_0x084a[_0x499ef5];return _0x5bb00a;};'use strict';var _=require(_0xa084('0x0'));var util=require(_0xa084('0x1'));var logger=require('../../config/logger')(_0xa084('0x2'));var moment=require(_0xa084('0x3'));var BPromise=require(_0xa084('0x4'));var rp=require(_0xa084('0x5'));var fs=require('fs');var path=require(_0xa084('0x6'));var rimraf=require(_0xa084('0x7'));var config=require(_0xa084('0x8'));var attributes=require(_0xa084('0x9'));module[_0xa084('0xa')]=function(_0xb8094e,_0x28f7f4){return _0xb8094e[_0xa084('0xb')](_0xa084('0xc'),attributes,{'tableName':_0xa084('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x29e4=['path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x480916,_0x8c3896){var _0x19cb88=function(_0x2084f2){while(--_0x2084f2){_0x480916['push'](_0x480916['shift']());}};_0x19cb88(++_0x8c3896);}(_0x29e4,0xbd));var _0x429e=function(_0x15063b,_0x660360){_0x15063b=_0x15063b-0x0;var _0xdcb1b8=_0x29e4[_0x15063b];return _0xdcb1b8;};'use strict';var _=require(_0x429e('0x0'));var util=require(_0x429e('0x1'));var logger=require(_0x429e('0x2'))(_0x429e('0x3'));var moment=require(_0x429e('0x4'));var BPromise=require(_0x429e('0x5'));var rp=require(_0x429e('0x6'));var fs=require('fs');var path=require(_0x429e('0x7'));var rimraf=require(_0x429e('0x8'));var config=require(_0x429e('0x9'));var attributes=require(_0x429e('0xa'));module[_0x429e('0xb')]=function(_0x350bcc,_0x3dff56){return _0x350bcc[_0x429e('0xc')](_0x429e('0xd'),attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index 5820754..296d7a6 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 _0xb9d5=['lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','error','message','result'];(function(_0x379ca9,_0x268f7f){var _0x8c3467=function(_0x502132){while(--_0x502132){_0x379ca9['push'](_0x379ca9['shift']());}};_0x8c3467(++_0x268f7f);}(_0xb9d5,0x18f));var _0x5b9d=function(_0x57096d,_0x416c26){_0x57096d=_0x57096d-0x0;var _0x42ce3b=_0xb9d5[_0x57096d];return _0x42ce3b;};'use strict';var _=require(_0x5b9d('0x0'));var util=require(_0x5b9d('0x1'));var moment=require(_0x5b9d('0x2'));var BPromise=require(_0x5b9d('0x3'));var rs=require(_0x5b9d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5b9d('0x5'));var logger=require(_0x5b9d('0x6'))('rpc');var config=require(_0x5b9d('0x7'));var jayson=require(_0x5b9d('0x8'));var client=jayson[_0x5b9d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1e9c4a,_0xcc2a01,_0x26276b){return new BPromise(function(_0xdc6e18,_0x9d2620){return client['request'](_0x1e9c4a,_0x26276b)[_0x5b9d('0xa')](function(_0xd62020){logger[_0x5b9d('0xb')](_0x5b9d('0xc'),_0xcc2a01,_0x5b9d('0xd'));logger[_0x5b9d('0xe')](_0x5b9d('0xf'),_0xcc2a01,_0x5b9d('0xd'),JSON['stringify'](_0xd62020));if(_0xd62020['error']){if(_0xd62020[_0x5b9d('0x10')]['code']===0x1f4){logger[_0x5b9d('0x10')](_0x5b9d('0xc'),_0xcc2a01,_0xd62020['error'][_0x5b9d('0x11')]);return _0x9d2620(_0xd62020[_0x5b9d('0x10')][_0x5b9d('0x11')]);}logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0xcc2a01,_0xd62020[_0x5b9d('0x10')][_0x5b9d('0x11')]);return _0xdc6e18(_0xd62020[_0x5b9d('0x10')][_0x5b9d('0x11')]);}else{logger[_0x5b9d('0xb')](_0x5b9d('0xc'),_0xcc2a01,_0x5b9d('0xd'));_0xdc6e18(_0xd62020[_0x5b9d('0x12')][_0x5b9d('0x11')]);}})['catch'](function(_0x31111d){logger[_0x5b9d('0x10')]('SugarcrmConfiguration,\x20%s,\x20%s',_0xcc2a01,_0x31111d);_0x9d2620(_0x31111d);});});} \ No newline at end of file +var _0x0dba=['info','request\x20sent','debug','stringify','error','code','SugarcrmConfiguration,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request'];(function(_0x10d7fb,_0x1a6245){var _0x314fc6=function(_0x33bd9a){while(--_0x33bd9a){_0x10d7fb['push'](_0x10d7fb['shift']());}};_0x314fc6(++_0x1a6245);}(_0x0dba,0xbe));var _0xa0db=function(_0x115706,_0x3dd39c){_0x115706=_0x115706-0x0;var _0x562484=_0x0dba[_0x115706];return _0x562484;};'use strict';var _=require('lodash');var util=require(_0xa0db('0x0'));var moment=require(_0xa0db('0x1'));var BPromise=require(_0xa0db('0x2'));var rs=require(_0xa0db('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa0db('0x4'))['db'];var utils=require(_0xa0db('0x5'));var logger=require(_0xa0db('0x6'))(_0xa0db('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xa0db('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1c7813,_0x485ef8,_0x330d13){return new BPromise(function(_0xd4fb18,_0x14689d){return client[_0xa0db('0x9')](_0x1c7813,_0x330d13)['then'](function(_0x53020e){logger[_0xa0db('0xa')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x485ef8,_0xa0db('0xb'));logger[_0xa0db('0xc')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x485ef8,'request\x20sent',JSON[_0xa0db('0xd')](_0x53020e));if(_0x53020e[_0xa0db('0xe')]){if(_0x53020e[_0xa0db('0xe')][_0xa0db('0xf')]===0x1f4){logger['error'](_0xa0db('0x10'),_0x485ef8,_0x53020e[_0xa0db('0xe')][_0xa0db('0x11')]);return _0x14689d(_0x53020e[_0xa0db('0xe')]['message']);}logger[_0xa0db('0xe')](_0xa0db('0x10'),_0x485ef8,_0x53020e['error'][_0xa0db('0x11')]);return _0xd4fb18(_0x53020e['error']['message']);}else{logger[_0xa0db('0xa')](_0xa0db('0x10'),_0x485ef8,_0xa0db('0xb'));_0xd4fb18(_0x53020e[_0xa0db('0x12')][_0xa0db('0x11')]);}})[_0xa0db('0x13')](function(_0x579ee9){logger[_0xa0db('0xe')](_0xa0db('0x10'),_0x485ef8,_0x579ee9);_0x14689d(_0x579ee9);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 9076c93..d3fd080 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 _0x6b30=['create','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','isAuthenticated','index','get','/:id','show','post'];(function(_0x17bfd6,_0xfb2a1e){var _0x25cabf=function(_0xa33acd){while(--_0xa33acd){_0x17bfd6['push'](_0x17bfd6['shift']());}};_0x25cabf(++_0xfb2a1e);}(_0x6b30,0x181));var _0x06b3=function(_0x27b28a,_0x4fba01){_0x27b28a=_0x27b28a-0x0;var _0x5acca3=_0x6b30[_0x27b28a];return _0x5acca3;};'use strict';var multer=require('multer');var util=require(_0x06b3('0x0'));var path=require('path');var timeout=require(_0x06b3('0x1'));var express=require(_0x06b3('0x2'));var router=express[_0x06b3('0x3')]();var fs_extra=require(_0x06b3('0x4'));var auth=require(_0x06b3('0x5'));var interaction=require(_0x06b3('0x6'));var config=require(_0x06b3('0x7'));var controller=require(_0x06b3('0x8'));router['get']('/',auth[_0x06b3('0x9')](),controller[_0x06b3('0xa')]);router[_0x06b3('0xb')](_0x06b3('0xc'),auth[_0x06b3('0x9')](),controller[_0x06b3('0xd')]);router[_0x06b3('0xe')]('/',auth[_0x06b3('0x9')](),controller[_0x06b3('0xf')]);router['put'](_0x06b3('0xc'),auth[_0x06b3('0x9')](),controller[_0x06b3('0x10')]);router[_0x06b3('0x11')](_0x06b3('0xc'),auth[_0x06b3('0x9')](),controller[_0x06b3('0x12')]);module[_0x06b3('0x13')]=router; \ No newline at end of file +var _0x40a4=['index','/:id','show','post','create','put','update','delete','destroy','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated'];(function(_0x19a501,_0x4ae3d9){var _0x6af071=function(_0x4ac1a7){while(--_0x4ac1a7){_0x19a501['push'](_0x19a501['shift']());}};_0x6af071(++_0x4ae3d9);}(_0x40a4,0x15f));var _0x440a=function(_0x46618d,_0x4cf823){_0x46618d=_0x46618d-0x0;var _0x35b686=_0x40a4[_0x46618d];return _0x35b686;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x440a('0x0'));var timeout=require(_0x440a('0x1'));var express=require('express');var router=express[_0x440a('0x2')]();var fs_extra=require(_0x440a('0x3'));var auth=require(_0x440a('0x4'));var interaction=require(_0x440a('0x5'));var config=require(_0x440a('0x6'));var controller=require(_0x440a('0x7'));router[_0x440a('0x8')]('/',auth[_0x440a('0x9')](),controller[_0x440a('0xa')]);router[_0x440a('0x8')](_0x440a('0xb'),auth[_0x440a('0x9')](),controller[_0x440a('0xc')]);router[_0x440a('0xd')]('/',auth['isAuthenticated'](),controller[_0x440a('0xe')]);router[_0x440a('0xf')](_0x440a('0xb'),auth[_0x440a('0x9')](),controller[_0x440a('0x10')]);router[_0x440a('0x11')](_0x440a('0xb'),auth[_0x440a('0x9')](),controller[_0x440a('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 7144fa6..478945d 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 _0x60a5=['variable','customVariable','keyValue','picklist','STRING','sequelize','exports','ENUM','string'];(function(_0x52d0fa,_0x41d80a){var _0x43e892=function(_0x2d1f67){while(--_0x2d1f67){_0x52d0fa['push'](_0x52d0fa['shift']());}};_0x43e892(++_0x41d80a);}(_0x60a5,0x9e));var _0x560a=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x60a5[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0x560a('0x0'));module[_0x560a('0x1')]={'type':{'type':Sequelize[_0x560a('0x2')](_0x560a('0x3'),_0x560a('0x4'),_0x560a('0x5'),_0x560a('0x6'),_0x560a('0x7')),'defaultValue':_0x560a('0x3')},'content':{'type':Sequelize[_0x560a('0x8')]},'key':{'type':Sequelize[_0x560a('0x8')]},'keyType':{'type':Sequelize[_0x560a('0x2')]('string','variable',_0x560a('0x5'))},'keyContent':{'type':Sequelize[_0x560a('0x8')]},'idField':{'type':Sequelize[_0x560a('0x8')]},'nameField':{'type':Sequelize[_0x560a('0x8')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x560a('0x8')]}}; \ No newline at end of file +var _0x7ece=['picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue'];(function(_0x506a1a,_0x194e5a){var _0x55f149=function(_0x2bcbf9){while(--_0x2bcbf9){_0x506a1a['push'](_0x506a1a['shift']());}};_0x55f149(++_0x194e5a);}(_0x7ece,0xcb));var _0xe7ec=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0x7ece[_0x4a747d];return _0x3a5b5c;};'use strict';var Sequelize=require(_0xe7ec('0x0'));module[_0xe7ec('0x1')]={'type':{'type':Sequelize[_0xe7ec('0x2')](_0xe7ec('0x3'),_0xe7ec('0x4'),_0xe7ec('0x5'),_0xe7ec('0x6'),_0xe7ec('0x7')),'defaultValue':_0xe7ec('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xe7ec('0x8')]},'keyType':{'type':Sequelize[_0xe7ec('0x2')](_0xe7ec('0x3'),_0xe7ec('0x4'),_0xe7ec('0x5'))},'keyContent':{'type':Sequelize[_0xe7ec('0x8')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xe7ec('0x8')]},'customField':{'type':Sequelize[_0xe7ec('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe7ec('0x8')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 9992447..93f28a2 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 _0x96f7=['fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','Content-Range','reject','save','then','destroy','sendStatus','error','name','send','SugarcrmField','rawAttributes','type','key','model','map','filters','query','attributes','intersection','fields','length','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','include','rows','catch','show','keys','find','create','body','update','params','eml-format'];(function(_0x5f26e0,_0x2fb8dd){var _0x70de5a=function(_0x16ed83){while(--_0x16ed83){_0x5f26e0['push'](_0x5f26e0['shift']());}};_0x70de5a(++_0x2fb8dd);}(_0x96f7,0x1cd));var _0x796f=function(_0x5038e3,_0x29855b){_0x5038e3=_0x5038e3-0x0;var _0x593c8d=_0x96f7[_0x5038e3];return _0x593c8d;};'use strict';var emlformat=require(_0x796f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x796f('0x1'));var rp=require(_0x796f('0x2'));var moment=require(_0x796f('0x3'));var BPromise=require(_0x796f('0x4'));var Mustache=require('mustache');var util=require(_0x796f('0x5'));var path=require('path');var sox=require(_0x796f('0x6'));var csv=require(_0x796f('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x796f('0x8'));var _=require(_0x796f('0x9'));var squel=require('squel');var crypto=require(_0x796f('0xa'));var jsforce=require(_0x796f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x796f('0x7'));var querystring=require('querystring');var Papa=require(_0x796f('0xc'));var Redis=require(_0x796f('0xd'));var authService=require(_0x796f('0xe'));var qs=require(_0x796f('0xf'));var as=require(_0x796f('0x10'));var hardwareService=require(_0x796f('0x11'));var logger=require(_0x796f('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x796f('0x13'));var db=require(_0x796f('0x14'))['db'];function respondWithStatusCode(_0x547db8,_0x5624a4){_0x5624a4=_0x5624a4||0xcc;return function(_0x2b87b7){if(_0x2b87b7){return _0x547db8['sendStatus'](_0x5624a4);}return _0x547db8[_0x796f('0x15')](_0x5624a4)[_0x796f('0x16')]();};}function respondWithResult(_0x3cb402,_0x5d492e){_0x5d492e=_0x5d492e||0xc8;return function(_0x15dce7){if(_0x15dce7){return _0x3cb402[_0x796f('0x15')](_0x5d492e)['json'](_0x15dce7);}};}function respondWithFilteredResult(_0x2f4786,_0x501d7f){return function(_0x30d519){if(_0x30d519){var _0x155133=typeof _0x501d7f[_0x796f('0x17')]===_0x796f('0x18')&&typeof _0x501d7f[_0x796f('0x19')]===_0x796f('0x18');var _0x26d2b3=_0x30d519[_0x796f('0x1a')];var _0x3ab1bf=_0x155133?0x0:_0x501d7f[_0x796f('0x17')];var _0x55395b=_0x155133?_0x30d519['count']:_0x501d7f[_0x796f('0x17')]+_0x501d7f[_0x796f('0x19')];var _0x1515d7;if(_0x55395b>=_0x26d2b3){_0x55395b=_0x26d2b3;_0x1515d7=0xc8;}else{_0x1515d7=0xce;}_0x2f4786['status'](_0x1515d7);return _0x2f4786['set'](_0x796f('0x1b'),_0x3ab1bf+'-'+_0x55395b+'/'+_0x26d2b3)['json'](_0x30d519);}return null;};}function patchUpdates(_0x3d2758){return function(_0xb186c8){try{jsonpatch['apply'](_0xb186c8,_0x3d2758,!![]);}catch(_0x249bff){return BPromise[_0x796f('0x1c')](_0x249bff);}return _0xb186c8[_0x796f('0x1d')]();};}function saveUpdates(_0x42e955,_0x21a0a1){return function(_0x519db1){if(_0x519db1){return _0x519db1['update'](_0x42e955)[_0x796f('0x1e')](function(_0x35af85){return _0x35af85;});}return null;};}function removeEntity(_0x32da6c,_0xb0b9ec){return function(_0x4d827b){if(_0x4d827b){return _0x4d827b[_0x796f('0x1f')]()[_0x796f('0x1e')](function(){_0x32da6c['status'](0xcc)[_0x796f('0x16')]();});}};}function handleEntityNotFound(_0x285d84,_0x3e0884){return function(_0x5f3aba){if(!_0x5f3aba){_0x285d84[_0x796f('0x20')](0x194);}return _0x5f3aba;};}function handleError(_0x5df8cd,_0x5b2af5){_0x5b2af5=_0x5b2af5||0x1f4;return function(_0xd8bb78){logger[_0x796f('0x21')](_0xd8bb78['stack']);if(_0xd8bb78[_0x796f('0x22')]){delete _0xd8bb78['name'];}_0x5df8cd[_0x796f('0x15')](_0x5b2af5)[_0x796f('0x23')](_0xd8bb78);};}exports['index']=function(_0x2dba99,_0x2295d6){var _0x36af2f={},_0x278850={},_0x5d9fd6={'count':0x0,'rows':[]};var _0x1375a6=_['map'](db[_0x796f('0x24')][_0x796f('0x25')],function(_0x53712a){return{'name':_0x53712a['fieldName'],'type':_0x53712a[_0x796f('0x26')][_0x796f('0x27')]};});_0x278850[_0x796f('0x28')]=_[_0x796f('0x29')](_0x1375a6,_0x796f('0x22'));_0x278850['query']=_['keys'](_0x2dba99['query']);_0x278850[_0x796f('0x2a')]=_['intersection'](_0x278850[_0x796f('0x28')],_0x278850[_0x796f('0x2b')]);_0x36af2f[_0x796f('0x2c')]=_[_0x796f('0x2d')](_0x278850[_0x796f('0x28')],qs[_0x796f('0x2e')](_0x2dba99[_0x796f('0x2b')][_0x796f('0x2e')]));_0x36af2f['attributes']=_0x36af2f[_0x796f('0x2c')][_0x796f('0x2f')]?_0x36af2f[_0x796f('0x2c')]:_0x278850[_0x796f('0x28')];if(!_0x2dba99[_0x796f('0x2b')]['hasOwnProperty'](_0x796f('0x30'))){_0x36af2f[_0x796f('0x19')]=qs[_0x796f('0x19')](_0x2dba99['query'][_0x796f('0x19')]);_0x36af2f[_0x796f('0x17')]=qs[_0x796f('0x17')](_0x2dba99[_0x796f('0x2b')][_0x796f('0x17')]);}_0x36af2f['order']=qs[_0x796f('0x31')](_0x2dba99[_0x796f('0x2b')][_0x796f('0x31')]);_0x36af2f['where']=qs['filters'](_[_0x796f('0x32')](_0x2dba99[_0x796f('0x2b')],_0x278850[_0x796f('0x2a')]),_0x1375a6);if(_0x2dba99['query'][_0x796f('0x33')]){_0x36af2f[_0x796f('0x34')]=_[_0x796f('0x35')](_0x36af2f[_0x796f('0x34')],{'$or':_[_0x796f('0x29')](_0x1375a6,function(_0x240e1b){if(_0x240e1b[_0x796f('0x26')]!==_0x796f('0x36')){var _0x12937a={};_0x12937a[_0x240e1b['name']]={'$like':'%'+_0x2dba99[_0x796f('0x2b')]['filter']+'%'};return _0x12937a;}})});}_0x36af2f=_['merge']({},_0x36af2f,_0x2dba99[_0x796f('0x37')]);var _0x4912d9={'where':_0x36af2f[_0x796f('0x34')]};return db['SugarcrmField'][_0x796f('0x1a')](_0x4912d9)[_0x796f('0x1e')](function(_0x379ec6){_0x5d9fd6[_0x796f('0x1a')]=_0x379ec6;if(_0x2dba99[_0x796f('0x2b')]['includeAll']){_0x36af2f[_0x796f('0x38')]=[{'all':!![]}];}return db[_0x796f('0x24')]['findAll'](_0x36af2f);})['then'](function(_0x4d094b){_0x5d9fd6[_0x796f('0x39')]=_0x4d094b;return _0x5d9fd6;})['then'](respondWithFilteredResult(_0x2295d6,_0x36af2f))[_0x796f('0x3a')](handleError(_0x2295d6,null));};exports[_0x796f('0x3b')]=function(_0x343d8e,_0x4d6e28){var _0x1f9f6b={'raw':!![],'where':{'id':_0x343d8e['params']['id']}},_0x5deaed={};_0x5deaed[_0x796f('0x28')]=_['keys'](db[_0x796f('0x24')][_0x796f('0x25')]);_0x5deaed['query']=_[_0x796f('0x3c')](_0x343d8e['query']);_0x5deaed['filters']=_[_0x796f('0x2d')](_0x5deaed[_0x796f('0x28')],_0x5deaed[_0x796f('0x2b')]);_0x1f9f6b['attributes']=_['intersection'](_0x5deaed[_0x796f('0x28')],qs['fields'](_0x343d8e[_0x796f('0x2b')][_0x796f('0x2e')]));_0x1f9f6b['attributes']=_0x1f9f6b[_0x796f('0x2c')][_0x796f('0x2f')]?_0x1f9f6b['attributes']:_0x5deaed['model'];if(_0x343d8e['query']['includeAll']){_0x1f9f6b[_0x796f('0x38')]=[{'all':!![]}];}_0x1f9f6b=_[_0x796f('0x35')]({},_0x1f9f6b,_0x343d8e[_0x796f('0x37')]);return db[_0x796f('0x24')][_0x796f('0x3d')](_0x1f9f6b)[_0x796f('0x1e')](handleEntityNotFound(_0x4d6e28,null))[_0x796f('0x1e')](respondWithResult(_0x4d6e28,null))[_0x796f('0x3a')](handleError(_0x4d6e28,null));};exports[_0x796f('0x3e')]=function(_0x439361,_0x433cc4){return db['SugarcrmField']['create'](_0x439361[_0x796f('0x3f')],{})[_0x796f('0x1e')](respondWithResult(_0x433cc4,0xc9))[_0x796f('0x3a')](handleError(_0x433cc4,null));};exports[_0x796f('0x40')]=function(_0x510b06,_0x1edd74){if(_0x510b06[_0x796f('0x3f')]['id']){delete _0x510b06[_0x796f('0x3f')]['id'];}return db['SugarcrmField'][_0x796f('0x3d')]({'where':{'id':_0x510b06['params']['id']}})[_0x796f('0x1e')](handleEntityNotFound(_0x1edd74,null))[_0x796f('0x1e')](saveUpdates(_0x510b06[_0x796f('0x3f')],null))[_0x796f('0x1e')](respondWithResult(_0x1edd74,null))[_0x796f('0x3a')](handleError(_0x1edd74,null));};exports[_0x796f('0x1f')]=function(_0x203812,_0x49141d){return db['SugarcrmField'][_0x796f('0x3d')]({'where':{'id':_0x203812[_0x796f('0x41')]['id']}})[_0x796f('0x1e')](handleEntityNotFound(_0x49141d,null))[_0x796f('0x1e')](removeEntity(_0x49141d,null))[_0x796f('0x3a')](handleError(_0x49141d,null));}; \ No newline at end of file +var _0x49df=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','options','SugarcrmField','includeAll','include','findAll','rows','catch','show','params','keys','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0xe37f58,_0x1a167b){var _0x4dfcef=function(_0x3395b8){while(--_0x3395b8){_0xe37f58['push'](_0xe37f58['shift']());}};_0x4dfcef(++_0x1a167b);}(_0x49df,0x86));var _0xf49d=function(_0x37b1d8,_0x614312){_0x37b1d8=_0x37b1d8-0x0;var _0x3739e7=_0x49df[_0x37b1d8];return _0x3739e7;};'use strict';var emlformat=require(_0xf49d('0x0'));var rimraf=require(_0xf49d('0x1'));var zipdir=require(_0xf49d('0x2'));var jsonpatch=require(_0xf49d('0x3'));var rp=require(_0xf49d('0x4'));var moment=require('moment');var BPromise=require(_0xf49d('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xf49d('0x6'));var csv=require(_0xf49d('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf49d('0x8'));var _=require('lodash');var squel=require(_0xf49d('0x9'));var crypto=require(_0xf49d('0xa'));var jsforce=require(_0xf49d('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf49d('0xc'));var Papa=require('papaparse');var Redis=require(_0xf49d('0xd'));var authService=require(_0xf49d('0xe'));var qs=require(_0xf49d('0xf'));var as=require(_0xf49d('0x10'));var hardwareService=require(_0xf49d('0x11'));var logger=require(_0xf49d('0x12'))(_0xf49d('0x13'));var utils=require(_0xf49d('0x14'));var config=require(_0xf49d('0x15'));var licenseUtil=require(_0xf49d('0x16'));var db=require(_0xf49d('0x17'))['db'];function respondWithStatusCode(_0x35ea3a,_0x57e538){_0x57e538=_0x57e538||0xcc;return function(_0x403f88){if(_0x403f88){return _0x35ea3a[_0xf49d('0x18')](_0x57e538);}return _0x35ea3a['status'](_0x57e538)[_0xf49d('0x19')]();};}function respondWithResult(_0x2bae03,_0x3c2e15){_0x3c2e15=_0x3c2e15||0xc8;return function(_0x40c936){if(_0x40c936){return _0x2bae03['status'](_0x3c2e15)[_0xf49d('0x1a')](_0x40c936);}};}function respondWithFilteredResult(_0x4ddb3e,_0xa8074a){return function(_0x68f217){if(_0x68f217){var _0x380faf=typeof _0xa8074a[_0xf49d('0x1b')]===_0xf49d('0x1c')&&typeof _0xa8074a[_0xf49d('0x1d')]===_0xf49d('0x1c');var _0x47723c=_0x68f217[_0xf49d('0x1e')];var _0x184927=_0x380faf?0x0:_0xa8074a['offset'];var _0x58a85e=_0x380faf?_0x68f217[_0xf49d('0x1e')]:_0xa8074a[_0xf49d('0x1b')]+_0xa8074a['limit'];var _0x2f6c5f;if(_0x58a85e>=_0x47723c){_0x58a85e=_0x47723c;_0x2f6c5f=0xc8;}else{_0x2f6c5f=0xce;}_0x4ddb3e[_0xf49d('0x1f')](_0x2f6c5f);return _0x4ddb3e[_0xf49d('0x20')](_0xf49d('0x21'),_0x184927+'-'+_0x58a85e+'/'+_0x47723c)['json'](_0x68f217);}return null;};}function patchUpdates(_0x31c2f0){return function(_0x224365){try{jsonpatch[_0xf49d('0x22')](_0x224365,_0x31c2f0,!![]);}catch(_0x3bf788){return BPromise[_0xf49d('0x23')](_0x3bf788);}return _0x224365[_0xf49d('0x24')]();};}function saveUpdates(_0xde4eb5,_0x1f7e04){return function(_0x365595){if(_0x365595){return _0x365595[_0xf49d('0x25')](_0xde4eb5)[_0xf49d('0x26')](function(_0x110fe9){return _0x110fe9;});}return null;};}function removeEntity(_0x1be8c8,_0x154b21){return function(_0x10eb73){if(_0x10eb73){return _0x10eb73[_0xf49d('0x27')]()[_0xf49d('0x26')](function(){_0x1be8c8[_0xf49d('0x1f')](0xcc)[_0xf49d('0x19')]();});}};}function handleEntityNotFound(_0x2fda00,_0x2591f6){return function(_0x1d8fa6){if(!_0x1d8fa6){_0x2fda00[_0xf49d('0x18')](0x194);}return _0x1d8fa6;};}function handleError(_0x255a99,_0x174be4){_0x174be4=_0x174be4||0x1f4;return function(_0x1f542c){logger[_0xf49d('0x28')](_0x1f542c[_0xf49d('0x29')]);if(_0x1f542c[_0xf49d('0x2a')]){delete _0x1f542c[_0xf49d('0x2a')];}_0x255a99[_0xf49d('0x1f')](_0x174be4)[_0xf49d('0x2b')](_0x1f542c);};}exports[_0xf49d('0x2c')]=function(_0x1fbbbe,_0x42f252){var _0x3558bc={},_0x4144d8={},_0x272f73={'count':0x0,'rows':[]};var _0x578948=_[_0xf49d('0x2d')](db['SugarcrmField'][_0xf49d('0x2e')],function(_0x44e63b){return{'name':_0x44e63b[_0xf49d('0x2f')],'type':_0x44e63b[_0xf49d('0x30')]['key']};});_0x4144d8[_0xf49d('0x31')]=_['map'](_0x578948,_0xf49d('0x2a'));_0x4144d8[_0xf49d('0x32')]=_['keys'](_0x1fbbbe['query']);_0x4144d8[_0xf49d('0x33')]=_[_0xf49d('0x34')](_0x4144d8[_0xf49d('0x31')],_0x4144d8[_0xf49d('0x32')]);_0x3558bc[_0xf49d('0x35')]=_[_0xf49d('0x34')](_0x4144d8[_0xf49d('0x31')],qs[_0xf49d('0x36')](_0x1fbbbe[_0xf49d('0x32')]['fields']));_0x3558bc['attributes']=_0x3558bc[_0xf49d('0x35')][_0xf49d('0x37')]?_0x3558bc['attributes']:_0x4144d8[_0xf49d('0x31')];if(!_0x1fbbbe[_0xf49d('0x32')]['hasOwnProperty'](_0xf49d('0x38'))){_0x3558bc['limit']=qs[_0xf49d('0x1d')](_0x1fbbbe[_0xf49d('0x32')][_0xf49d('0x1d')]);_0x3558bc[_0xf49d('0x1b')]=qs[_0xf49d('0x1b')](_0x1fbbbe[_0xf49d('0x32')][_0xf49d('0x1b')]);}_0x3558bc[_0xf49d('0x39')]=qs[_0xf49d('0x3a')](_0x1fbbbe[_0xf49d('0x32')][_0xf49d('0x3a')]);_0x3558bc[_0xf49d('0x3b')]=qs[_0xf49d('0x33')](_[_0xf49d('0x3c')](_0x1fbbbe[_0xf49d('0x32')],_0x4144d8[_0xf49d('0x33')]),_0x578948);if(_0x1fbbbe[_0xf49d('0x32')]['filter']){_0x3558bc[_0xf49d('0x3b')]=_[_0xf49d('0x3d')](_0x3558bc[_0xf49d('0x3b')],{'$or':_['map'](_0x578948,function(_0x4c55de){if(_0x4c55de[_0xf49d('0x30')]!=='VIRTUAL'){var _0x2ad5a6={};_0x2ad5a6[_0x4c55de[_0xf49d('0x2a')]]={'$like':'%'+_0x1fbbbe['query']['filter']+'%'};return _0x2ad5a6;}})});}_0x3558bc=_[_0xf49d('0x3d')]({},_0x3558bc,_0x1fbbbe[_0xf49d('0x3e')]);var _0x388c30={'where':_0x3558bc[_0xf49d('0x3b')]};return db[_0xf49d('0x3f')][_0xf49d('0x1e')](_0x388c30)[_0xf49d('0x26')](function(_0x388771){_0x272f73[_0xf49d('0x1e')]=_0x388771;if(_0x1fbbbe[_0xf49d('0x32')][_0xf49d('0x40')]){_0x3558bc[_0xf49d('0x41')]=[{'all':!![]}];}return db[_0xf49d('0x3f')][_0xf49d('0x42')](_0x3558bc);})[_0xf49d('0x26')](function(_0x14153e){_0x272f73[_0xf49d('0x43')]=_0x14153e;return _0x272f73;})[_0xf49d('0x26')](respondWithFilteredResult(_0x42f252,_0x3558bc))[_0xf49d('0x44')](handleError(_0x42f252,null));};exports[_0xf49d('0x45')]=function(_0x465e58,_0x4acece){var _0x49619a={'raw':!![],'where':{'id':_0x465e58[_0xf49d('0x46')]['id']}},_0x5567a6={};_0x5567a6[_0xf49d('0x31')]=_[_0xf49d('0x47')](db[_0xf49d('0x3f')]['rawAttributes']);_0x5567a6[_0xf49d('0x32')]=_[_0xf49d('0x47')](_0x465e58[_0xf49d('0x32')]);_0x5567a6['filters']=_[_0xf49d('0x34')](_0x5567a6[_0xf49d('0x31')],_0x5567a6[_0xf49d('0x32')]);_0x49619a[_0xf49d('0x35')]=_['intersection'](_0x5567a6['model'],qs['fields'](_0x465e58[_0xf49d('0x32')][_0xf49d('0x36')]));_0x49619a[_0xf49d('0x35')]=_0x49619a[_0xf49d('0x35')][_0xf49d('0x37')]?_0x49619a[_0xf49d('0x35')]:_0x5567a6[_0xf49d('0x31')];if(_0x465e58[_0xf49d('0x32')][_0xf49d('0x40')]){_0x49619a['include']=[{'all':!![]}];}_0x49619a=_['merge']({},_0x49619a,_0x465e58[_0xf49d('0x3e')]);return db[_0xf49d('0x3f')]['find'](_0x49619a)[_0xf49d('0x26')](handleEntityNotFound(_0x4acece,null))[_0xf49d('0x26')](respondWithResult(_0x4acece,null))[_0xf49d('0x44')](handleError(_0x4acece,null));};exports['create']=function(_0xea50c,_0x4a2cbb){return db[_0xf49d('0x3f')][_0xf49d('0x48')](_0xea50c['body'],{})['then'](respondWithResult(_0x4a2cbb,0xc9))[_0xf49d('0x44')](handleError(_0x4a2cbb,null));};exports[_0xf49d('0x25')]=function(_0x50674f,_0x389e8f){if(_0x50674f[_0xf49d('0x49')]['id']){delete _0x50674f[_0xf49d('0x49')]['id'];}return db[_0xf49d('0x3f')][_0xf49d('0x4a')]({'where':{'id':_0x50674f[_0xf49d('0x46')]['id']}})[_0xf49d('0x26')](handleEntityNotFound(_0x389e8f,null))[_0xf49d('0x26')](saveUpdates(_0x50674f['body'],null))[_0xf49d('0x26')](respondWithResult(_0x389e8f,null))['catch'](handleError(_0x389e8f,null));};exports[_0xf49d('0x27')]=function(_0x374795,_0x28412f){return db['SugarcrmField'][_0xf49d('0x4a')]({'where':{'id':_0x374795[_0xf49d('0x46')]['id']}})['then'](handleEntityNotFound(_0x28412f,null))[_0xf49d('0x26')](removeEntity(_0x28412f,null))['catch'](handleError(_0x28412f,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index e6dfb4a..fadcaad 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 _0xcc6a=['SugarcrmField','int_sugarcrm_fields','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./intSugarcrmField.attributes','define'];(function(_0x18f29a,_0x34c5b4){var _0x4f8f82=function(_0x17e2ab){while(--_0x17e2ab){_0x18f29a['push'](_0x18f29a['shift']());}};_0x4f8f82(++_0x34c5b4);}(_0xcc6a,0x18c));var _0xacc6=function(_0xdc70ef,_0x463508){_0xdc70ef=_0xdc70ef-0x0;var _0xebf625=_0xcc6a[_0xdc70ef];return _0xebf625;};'use strict';var _=require(_0xacc6('0x0'));var util=require(_0xacc6('0x1'));var logger=require(_0xacc6('0x2'))(_0xacc6('0x3'));var moment=require(_0xacc6('0x4'));var BPromise=require(_0xacc6('0x5'));var rp=require(_0xacc6('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xacc6('0x7'));var attributes=require(_0xacc6('0x8'));module['exports']=function(_0x226b3b,_0x23d1e6){return _0x226b3b[_0xacc6('0x9')](_0xacc6('0xa'),attributes,{'tableName':_0xacc6('0xb'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0xacc6('0xc'),_0xacc6('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe2a5=['bluebird','request-promise','../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','lodash','util','api'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0xe2a5,0xc1));var _0x5e2a=function(_0x243cbd,_0x58d38d){_0x243cbd=_0x243cbd-0x0;var _0x2b3f19=_0xe2a5[_0x243cbd];return _0x2b3f19;};'use strict';var _=require(_0x5e2a('0x0'));var util=require(_0x5e2a('0x1'));var logger=require('../../config/logger')(_0x5e2a('0x2'));var moment=require('moment');var BPromise=require(_0x5e2a('0x3'));var rp=require(_0x5e2a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5e2a('0x5'));var attributes=require(_0x5e2a('0x6'));module[_0x5e2a('0x7')]=function(_0x344acd,_0x427dcc){return _0x344acd[_0x5e2a('0x8')](_0x5e2a('0x9'),attributes,{'tableName':_0x5e2a('0xa'),'paranoid':![],'indexes':[{'name':_0x5e2a('0xb'),'fields':[_0x5e2a('0xc'),_0x5e2a('0xd')],'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 56d46da..e703cec 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 _0x4140=['stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s'];(function(_0xca41dc,_0x22936e){var _0x3e125c=function(_0x1ef024){while(--_0x1ef024){_0xca41dc['push'](_0xca41dc['shift']());}};_0x3e125c(++_0x22936e);}(_0x4140,0xbd));var _0x0414=function(_0x4aa285,_0x1fe00d){_0x4aa285=_0x4aa285-0x0;var _0x2777ee=_0x4140[_0x4aa285];return _0x2777ee;};'use strict';var _=require(_0x0414('0x0'));var util=require(_0x0414('0x1'));var moment=require('moment');var BPromise=require(_0x0414('0x2'));var rs=require(_0x0414('0x3'));var fs=require('fs');var Redis=require(_0x0414('0x4'));var db=require(_0x0414('0x5'))['db'];var utils=require(_0x0414('0x6'));var logger=require(_0x0414('0x7'))(_0x0414('0x8'));var config=require(_0x0414('0x9'));var jayson=require(_0x0414('0xa'));var client=jayson[_0x0414('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4d7a22,_0x4c4650,_0x3f505b){return new BPromise(function(_0x5edda2,_0xba55b5){return client['request'](_0x4d7a22,_0x3f505b)[_0x0414('0xc')](function(_0x1685ac){logger[_0x0414('0xd')](_0x0414('0xe'),_0x4c4650,_0x0414('0xf'));logger[_0x0414('0x10')](_0x0414('0x11'),_0x4c4650,'request\x20sent',JSON[_0x0414('0x12')](_0x1685ac));if(_0x1685ac[_0x0414('0x13')]){if(_0x1685ac[_0x0414('0x13')]['code']===0x1f4){logger[_0x0414('0x13')](_0x0414('0xe'),_0x4c4650,_0x1685ac[_0x0414('0x13')]['message']);return _0xba55b5(_0x1685ac[_0x0414('0x13')][_0x0414('0x14')]);}logger[_0x0414('0x13')](_0x0414('0xe'),_0x4c4650,_0x1685ac[_0x0414('0x13')][_0x0414('0x14')]);return _0x5edda2(_0x1685ac[_0x0414('0x13')]['message']);}else{logger[_0x0414('0xd')](_0x0414('0xe'),_0x4c4650,_0x0414('0xf'));_0x5edda2(_0x1685ac[_0x0414('0x15')][_0x0414('0x14')]);}})[_0x0414('0x16')](function(_0x38f2a5){logger[_0x0414('0x13')]('SugarcrmField,\x20%s,\x20%s',_0x4c4650,_0x38f2a5);_0xba55b5(_0x38f2a5);});});} \ No newline at end of file +var _0xe3c9=['catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','info','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','SugarcrmField,\x20%s,\x20%s','message'];(function(_0x341c44,_0x2e1057){var _0x2bda72=function(_0x11d26a){while(--_0x11d26a){_0x341c44['push'](_0x341c44['shift']());}};_0x2bda72(++_0x2e1057);}(_0xe3c9,0x1b9));var _0x9e3c=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xe3c9[_0x618414];return _0x21c19a;};'use strict';var _=require('lodash');var util=require(_0x9e3c('0x0'));var moment=require(_0x9e3c('0x1'));var BPromise=require(_0x9e3c('0x2'));var rs=require(_0x9e3c('0x3'));var fs=require('fs');var Redis=require(_0x9e3c('0x4'));var db=require(_0x9e3c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9e3c('0x6'))('rpc');var config=require(_0x9e3c('0x7'));var jayson=require(_0x9e3c('0x8'));var client=jayson[_0x9e3c('0x9')][_0x9e3c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5e5962,_0xc7a8d4,_0x3d8153){return new BPromise(function(_0x108f85,_0xb9256e){return client['request'](_0x5e5962,_0x3d8153)['then'](function(_0x44aea3){logger[_0x9e3c('0xb')]('SugarcrmField,\x20%s,\x20%s',_0xc7a8d4,'request\x20sent');logger[_0x9e3c('0xc')](_0x9e3c('0xd'),_0xc7a8d4,_0x9e3c('0xe'),JSON['stringify'](_0x44aea3));if(_0x44aea3[_0x9e3c('0xf')]){if(_0x44aea3[_0x9e3c('0xf')][_0x9e3c('0x10')]===0x1f4){logger[_0x9e3c('0xf')](_0x9e3c('0x11'),_0xc7a8d4,_0x44aea3[_0x9e3c('0xf')][_0x9e3c('0x12')]);return _0xb9256e(_0x44aea3[_0x9e3c('0xf')]['message']);}logger[_0x9e3c('0xf')]('SugarcrmField,\x20%s,\x20%s',_0xc7a8d4,_0x44aea3['error'][_0x9e3c('0x12')]);return _0x108f85(_0x44aea3[_0x9e3c('0xf')][_0x9e3c('0x12')]);}else{logger[_0x9e3c('0xb')]('SugarcrmField,\x20%s,\x20%s',_0xc7a8d4,_0x9e3c('0xe'));_0x108f85(_0x44aea3['result'][_0x9e3c('0x12')]);}})[_0x9e3c('0x13')](function(_0x5f39b2){logger['error'](_0x9e3c('0x11'),_0xc7a8d4,_0x5f39b2);_0xb9256e(_0x5f39b2);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index e1c597c..05b099b 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 _0x77f2=['isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','util','connect-timeout','express','../../components/interaction/service','../../config/environment','get','/:id'];(function(_0x486610,_0x41b075){var _0x538645=function(_0x25ada0){while(--_0x25ada0){_0x486610['push'](_0x486610['shift']());}};_0x538645(++_0x41b075);}(_0x77f2,0x188));var _0x277f=function(_0x248703,_0xa58c07){_0x248703=_0x248703-0x0;var _0x12daa9=_0x77f2[_0x248703];return _0x12daa9;};'use strict';var multer=require('multer');var util=require(_0x277f('0x0'));var path=require('path');var timeout=require(_0x277f('0x1'));var express=require(_0x277f('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x277f('0x3'));var config=require(_0x277f('0x4'));var controller=require('./intVtigerAccount.controller');router[_0x277f('0x5')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x277f('0x6'),auth[_0x277f('0x7')](),controller[_0x277f('0x8')]);router['get'](_0x277f('0x9'),auth[_0x277f('0x7')](),controller[_0x277f('0xa')]);router[_0x277f('0x5')](_0x277f('0xb'),auth['isAuthenticated'](),controller[_0x277f('0xc')]);router[_0x277f('0xd')]('/',auth[_0x277f('0x7')](),controller[_0x277f('0xe')]);router[_0x277f('0xd')](_0x277f('0x9'),auth[_0x277f('0x7')](),controller[_0x277f('0xf')]);router[_0x277f('0x10')]('/:id',auth[_0x277f('0x7')](),controller[_0x277f('0x11')]);router[_0x277f('0x12')](_0x277f('0x6'),auth[_0x277f('0x7')](),controller[_0x277f('0x13')]);module[_0x277f('0x14')]=router; \ No newline at end of file +var _0x7884=['../../config/environment','get','isAuthenticated','index','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','/:id','update','delete','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5ac36f,_0x1aa79a){var _0x1b7203=function(_0x5ce8d9){while(--_0x5ce8d9){_0x5ac36f['push'](_0x5ac36f['shift']());}};_0x1b7203(++_0x1aa79a);}(_0x7884,0x10d));var _0x4788=function(_0x4b8b61,_0x5baafe){_0x4b8b61=_0x4b8b61-0x0;var _0x568f3=_0x7884[_0x4b8b61];return _0x568f3;};'use strict';var multer=require(_0x4788('0x0'));var util=require(_0x4788('0x1'));var path=require(_0x4788('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4788('0x3')]();var fs_extra=require(_0x4788('0x4'));var auth=require(_0x4788('0x5'));var interaction=require(_0x4788('0x6'));var config=require(_0x4788('0x7'));var controller=require('./intVtigerAccount.controller');router[_0x4788('0x8')]('/',auth[_0x4788('0x9')](),controller[_0x4788('0xa')]);router[_0x4788('0x8')]('/:id',auth[_0x4788('0x9')](),controller['show']);router[_0x4788('0x8')](_0x4788('0xb'),auth['isAuthenticated'](),controller[_0x4788('0xc')]);router['get'](_0x4788('0xd'),auth['isAuthenticated'](),controller[_0x4788('0xe')]);router[_0x4788('0xf')]('/',auth['isAuthenticated'](),controller[_0x4788('0x10')]);router[_0x4788('0xf')](_0x4788('0xb'),auth[_0x4788('0x9')](),controller[_0x4788('0x11')]);router[_0x4788('0x12')](_0x4788('0x13'),auth[_0x4788('0x9')](),controller[_0x4788('0x14')]);router[_0x4788('0x15')](_0x4788('0x13'),auth[_0x4788('0x9')](),controller[_0x4788('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 896043b..7fe69f4 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 _0x6206=['HelpDesk','sequelize','exports','STRING'];(function(_0xe0fc,_0x5005c7){var _0x2fc683=function(_0x3fae3a){while(--_0x3fae3a){_0xe0fc['push'](_0xe0fc['shift']());}};_0x2fc683(++_0x5005c7);}(_0x6206,0x189));var _0x6620=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0x6206[_0x29d94e];return _0x106237;};'use strict';var Sequelize=require(_0x6620('0x0'));module[_0x6620('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x6620('0x2')]},'username':{'type':Sequelize[_0x6620('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x6620('0x3')},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x6620('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x6620('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x2b88=['sequelize','exports','STRING','HelpDesk'];(function(_0x736709,_0x46a39e){var _0x43860c=function(_0x5a0e72){while(--_0x5a0e72){_0x736709['push'](_0x736709['shift']());}};_0x43860c(++_0x46a39e);}(_0x2b88,0x18c));var _0x82b8=function(_0x115edd,_0x505f03){_0x115edd=_0x115edd-0x0;var _0x255f84=_0x2b88[_0x115edd];return _0x255f84;};'use strict';var Sequelize=require(_0x82b8('0x0'));module[_0x82b8('0x1')]={'name':{'type':Sequelize[_0x82b8('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x82b8('0x2')]},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x82b8('0x3')},'remoteUri':{'type':Sequelize[_0x82b8('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x82b8('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x82b8('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 05678aa..bdcf9fa 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 _0x1b1a=['find','create','catch','body','getConfigurations','findOne','VtigerConfiguration','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','VtigerField','md5','getFields','username','remoteUri','serverUrl','accessKey','moduleName','slice','format','GET','getchallenge','POST','result','success','describe','sessionName','autogenerated','reference','owner','remove','includes','false','label','startsWith','cf_','picklist','picklistValues','vTiger\x20error:\x20','statusCode','stringify','send','test','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','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','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','error','stack','name','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','VtigerAccount','includeAll','include','findAll','show','params'];(function(_0x5aa141,_0x2d6e3a){var _0x446d2f=function(_0x11bb05){while(--_0x11bb05){_0x5aa141['push'](_0x5aa141['shift']());}};_0x446d2f(++_0x2d6e3a);}(_0x1b1a,0x19b));var _0xa1b1=function(_0x99ff94,_0x47a1b1){_0x99ff94=_0x99ff94-0x0;var _0x1b5bc0=_0x1b1a[_0x99ff94];return _0x1b5bc0;};'use strict';var emlformat=require(_0xa1b1('0x0'));var rimraf=require(_0xa1b1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa1b1('0x2'));var rp=require('request-promise');var moment=require(_0xa1b1('0x3'));var BPromise=require(_0xa1b1('0x4'));var Mustache=require(_0xa1b1('0x5'));var util=require(_0xa1b1('0x6'));var path=require('path');var sox=require(_0xa1b1('0x7'));var csv=require(_0xa1b1('0x8'));var ejs=require(_0xa1b1('0x9'));var fs=require('fs');var fs_extra=require(_0xa1b1('0xa'));var _=require('lodash');var squel=require(_0xa1b1('0xb'));var crypto=require(_0xa1b1('0xc'));var jsforce=require(_0xa1b1('0xd'));var deskjs=require(_0xa1b1('0xe'));var toCsv=require(_0xa1b1('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa1b1('0xf'));var authService=require(_0xa1b1('0x10'));var qs=require(_0xa1b1('0x11'));var as=require(_0xa1b1('0x12'));var hardwareService=require(_0xa1b1('0x13'));var logger=require(_0xa1b1('0x14'))(_0xa1b1('0x15'));var utils=require(_0xa1b1('0x16'));var config=require(_0xa1b1('0x17'));var licenseUtil=require(_0xa1b1('0x18'));var db=require(_0xa1b1('0x19'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x5ddfdb,_0x527bf5){_0x527bf5=_0x527bf5||0xcc;return function(_0xa65372){if(_0xa65372){return _0x5ddfdb[_0xa1b1('0x1a')](_0x527bf5);}return _0x5ddfdb['status'](_0x527bf5)[_0xa1b1('0x1b')]();};}function respondWithResult(_0x538c07,_0x2c2de9){_0x2c2de9=_0x2c2de9||0xc8;return function(_0x5f1a38){if(_0x5f1a38){return _0x538c07[_0xa1b1('0x1c')](_0x2c2de9)[_0xa1b1('0x1d')](_0x5f1a38);}};}function respondWithFilteredResult(_0x51832d,_0x5423be){return function(_0x18bfc9){if(_0x18bfc9){var _0x48bcb7=typeof _0x5423be[_0xa1b1('0x1e')]===_0xa1b1('0x1f')&&typeof _0x5423be[_0xa1b1('0x20')]===_0xa1b1('0x1f');var _0x8c6404=_0x18bfc9[_0xa1b1('0x21')];var _0x2f7169=_0x48bcb7?0x0:_0x5423be[_0xa1b1('0x1e')];var _0xfd5b03=_0x48bcb7?_0x18bfc9[_0xa1b1('0x21')]:_0x5423be[_0xa1b1('0x1e')]+_0x5423be['limit'];var _0x33bbc3;if(_0xfd5b03>=_0x8c6404){_0xfd5b03=_0x8c6404;_0x33bbc3=0xc8;}else{_0x33bbc3=0xce;}_0x51832d[_0xa1b1('0x1c')](_0x33bbc3);return _0x51832d[_0xa1b1('0x22')](_0xa1b1('0x23'),_0x2f7169+'-'+_0xfd5b03+'/'+_0x8c6404)[_0xa1b1('0x1d')](_0x18bfc9);}return null;};}function patchUpdates(_0x51a3d1){return function(_0x44753e){try{jsonpatch[_0xa1b1('0x24')](_0x44753e,_0x51a3d1,!![]);}catch(_0x4a29a5){return BPromise[_0xa1b1('0x25')](_0x4a29a5);}return _0x44753e['save']();};}function saveUpdates(_0x4814fb,_0x239053){return function(_0x5b7bc3){if(_0x5b7bc3){return _0x5b7bc3[_0xa1b1('0x26')](_0x4814fb)['then'](function(_0x2bc2bf){return _0x2bc2bf;});}return null;};}function removeEntity(_0x3f2a55,_0x96594c){return function(_0x4308c6){if(_0x4308c6){return _0x4308c6[_0xa1b1('0x27')]()[_0xa1b1('0x28')](function(){_0x3f2a55[_0xa1b1('0x1c')](0xcc)[_0xa1b1('0x1b')]();});}};}function handleEntityNotFound(_0x4df432,_0x22a6e8){return function(_0x14872f){if(!_0x14872f){_0x4df432[_0xa1b1('0x1a')](0x194);}return _0x14872f;};}function handleError(_0x1adfb1,_0x1276ec){_0x1276ec=_0x1276ec||0x1f4;return function(_0x4a97e2){logger[_0xa1b1('0x29')](_0x4a97e2[_0xa1b1('0x2a')]);if(_0x4a97e2[_0xa1b1('0x2b')]){delete _0x4a97e2[_0xa1b1('0x2b')];}_0x1adfb1[_0xa1b1('0x1c')](_0x1276ec)['send'](_0x4a97e2);};}exports['index']=function(_0x2c7e93,_0x25276a){var _0x3c1ab3={},_0xbe063e={},_0x4fccfe={'count':0x0,'rows':[]};var _0xdbdd9=_[_0xa1b1('0x2c')](db['VtigerAccount'][_0xa1b1('0x2d')],function(_0x3ec079){return{'name':_0x3ec079[_0xa1b1('0x2e')],'type':_0x3ec079[_0xa1b1('0x2f')][_0xa1b1('0x30')]};});_0xbe063e[_0xa1b1('0x31')]=_[_0xa1b1('0x2c')](_0xdbdd9,_0xa1b1('0x2b'));_0xbe063e[_0xa1b1('0x32')]=_[_0xa1b1('0x33')](_0x2c7e93['query']);_0xbe063e[_0xa1b1('0x34')]=_[_0xa1b1('0x35')](_0xbe063e['model'],_0xbe063e[_0xa1b1('0x32')]);_0x3c1ab3[_0xa1b1('0x36')]=_[_0xa1b1('0x35')](_0xbe063e[_0xa1b1('0x31')],qs[_0xa1b1('0x37')](_0x2c7e93[_0xa1b1('0x32')][_0xa1b1('0x37')]));_0x3c1ab3[_0xa1b1('0x36')]=_0x3c1ab3[_0xa1b1('0x36')][_0xa1b1('0x38')]?_0x3c1ab3[_0xa1b1('0x36')]:_0xbe063e[_0xa1b1('0x31')];if(!_0x2c7e93['query'][_0xa1b1('0x39')](_0xa1b1('0x3a'))){_0x3c1ab3[_0xa1b1('0x20')]=qs[_0xa1b1('0x20')](_0x2c7e93[_0xa1b1('0x32')][_0xa1b1('0x20')]);_0x3c1ab3[_0xa1b1('0x1e')]=qs[_0xa1b1('0x1e')](_0x2c7e93[_0xa1b1('0x32')][_0xa1b1('0x1e')]);}_0x3c1ab3[_0xa1b1('0x3b')]=qs[_0xa1b1('0x3c')](_0x2c7e93[_0xa1b1('0x32')][_0xa1b1('0x3c')]);_0x3c1ab3[_0xa1b1('0x3d')]=qs[_0xa1b1('0x34')](_[_0xa1b1('0x3e')](_0x2c7e93['query'],_0xbe063e[_0xa1b1('0x34')]),_0xdbdd9);if(_0x2c7e93[_0xa1b1('0x32')][_0xa1b1('0x3f')]){_0x3c1ab3[_0xa1b1('0x3d')]=_[_0xa1b1('0x40')](_0x3c1ab3[_0xa1b1('0x3d')],{'$or':_[_0xa1b1('0x2c')](_0xdbdd9,function(_0x51ef06){if(_0x51ef06['type']!==_0xa1b1('0x41')){var _0x2a158b={};_0x2a158b[_0x51ef06['name']]={'$like':'%'+_0x2c7e93[_0xa1b1('0x32')][_0xa1b1('0x3f')]+'%'};return _0x2a158b;}})});}_0x3c1ab3=_[_0xa1b1('0x40')]({},_0x3c1ab3,_0x2c7e93[_0xa1b1('0x42')]);var _0x729b7={'where':_0x3c1ab3[_0xa1b1('0x3d')]};return db[_0xa1b1('0x43')][_0xa1b1('0x21')](_0x729b7)[_0xa1b1('0x28')](function(_0x711b3){_0x4fccfe[_0xa1b1('0x21')]=_0x711b3;if(_0x2c7e93['query'][_0xa1b1('0x44')]){_0x3c1ab3[_0xa1b1('0x45')]=[{'all':!![]}];}return db[_0xa1b1('0x43')][_0xa1b1('0x46')](_0x3c1ab3);})[_0xa1b1('0x28')](function(_0x435b17){_0x4fccfe['rows']=_0x435b17;return _0x4fccfe;})[_0xa1b1('0x28')](respondWithFilteredResult(_0x25276a,_0x3c1ab3))['catch'](handleError(_0x25276a,null));};exports[_0xa1b1('0x47')]=function(_0x30fa7f,_0x39e9ab){var _0x2373ee={'raw':![],'where':{'id':_0x30fa7f[_0xa1b1('0x48')]['id']}},_0x2c7f29={};_0x2c7f29[_0xa1b1('0x31')]=_['keys'](db[_0xa1b1('0x43')][_0xa1b1('0x2d')]);_0x2c7f29[_0xa1b1('0x32')]=_[_0xa1b1('0x33')](_0x30fa7f['query']);_0x2c7f29[_0xa1b1('0x34')]=_[_0xa1b1('0x35')](_0x2c7f29[_0xa1b1('0x31')],_0x2c7f29[_0xa1b1('0x32')]);_0x2373ee['attributes']=_[_0xa1b1('0x35')](_0x2c7f29[_0xa1b1('0x31')],qs[_0xa1b1('0x37')](_0x30fa7f[_0xa1b1('0x32')][_0xa1b1('0x37')]));_0x2373ee[_0xa1b1('0x36')]=_0x2373ee[_0xa1b1('0x36')][_0xa1b1('0x38')]?_0x2373ee[_0xa1b1('0x36')]:_0x2c7f29[_0xa1b1('0x31')];if(_0x30fa7f[_0xa1b1('0x32')][_0xa1b1('0x44')]){_0x2373ee[_0xa1b1('0x45')]=[{'all':!![]}];}_0x2373ee=_[_0xa1b1('0x40')]({},_0x2373ee,_0x30fa7f[_0xa1b1('0x42')]);return db[_0xa1b1('0x43')][_0xa1b1('0x49')](_0x2373ee)[_0xa1b1('0x28')](handleEntityNotFound(_0x39e9ab,null))['then'](respondWithResult(_0x39e9ab,null))['catch'](handleError(_0x39e9ab,null));};exports[_0xa1b1('0x4a')]=function(_0x31e085,_0xf21f31){return db[_0xa1b1('0x43')][_0xa1b1('0x4a')](_0x31e085['body'],{})[_0xa1b1('0x28')](respondWithResult(_0xf21f31,0xc9))[_0xa1b1('0x4b')](handleError(_0xf21f31,null));};exports[_0xa1b1('0x26')]=function(_0x2408a8,_0x195742){if(_0x2408a8[_0xa1b1('0x4c')]['id']){delete _0x2408a8[_0xa1b1('0x4c')]['id'];}return db[_0xa1b1('0x43')][_0xa1b1('0x49')]({'where':{'id':_0x2408a8[_0xa1b1('0x48')]['id']}})[_0xa1b1('0x28')](handleEntityNotFound(_0x195742,null))[_0xa1b1('0x28')](saveUpdates(_0x2408a8['body'],null))['then'](respondWithResult(_0x195742,null))[_0xa1b1('0x4b')](handleError(_0x195742,null));};exports[_0xa1b1('0x27')]=function(_0x52f4b6,_0x12fc7a){return db['VtigerAccount'][_0xa1b1('0x49')]({'where':{'id':_0x52f4b6['params']['id']}})['then'](handleEntityNotFound(_0x12fc7a,null))[_0xa1b1('0x28')](removeEntity(_0x12fc7a,null))['catch'](handleError(_0x12fc7a,null));};exports[_0xa1b1('0x4d')]=function(_0x17c771,_0x3d7694,_0x15ffde){var _0x162370={};var _0x4f32c3={};var _0x7aeccd;var _0x515d04;return db[_0xa1b1('0x43')][_0xa1b1('0x4e')]({'where':{'id':_0x17c771[_0xa1b1('0x48')]['id']}})[_0xa1b1('0x28')](handleEntityNotFound(_0x3d7694,null))['then'](function(_0x5e6a1f){if(_0x5e6a1f){_0x7aeccd=_0x5e6a1f;_0x4f32c3[_0xa1b1('0x31')]=_[_0xa1b1('0x33')](db[_0xa1b1('0x4f')][_0xa1b1('0x2d')]);_0x4f32c3[_0xa1b1('0x32')]=_[_0xa1b1('0x33')](_0x17c771[_0xa1b1('0x32')]);_0x4f32c3[_0xa1b1('0x34')]=_['intersection'](_0x4f32c3[_0xa1b1('0x31')],_0x4f32c3[_0xa1b1('0x32')]);_0x162370[_0xa1b1('0x36')]=_[_0xa1b1('0x35')](_0x4f32c3[_0xa1b1('0x31')],qs['fields'](_0x17c771['query'][_0xa1b1('0x37')]));_0x162370[_0xa1b1('0x36')]=_0x162370[_0xa1b1('0x36')][_0xa1b1('0x38')]?_0x162370[_0xa1b1('0x36')]:_0x4f32c3[_0xa1b1('0x31')];_0x162370[_0xa1b1('0x3b')]=qs[_0xa1b1('0x3c')](_0x17c771[_0xa1b1('0x32')][_0xa1b1('0x3c')]);_0x162370[_0xa1b1('0x3d')]=qs[_0xa1b1('0x34')](_['pick'](_0x17c771[_0xa1b1('0x32')],_0x4f32c3[_0xa1b1('0x34')]));if(_0x17c771['query'][_0xa1b1('0x3f')]){_0x162370[_0xa1b1('0x3d')]=_[_0xa1b1('0x40')](_0x162370[_0xa1b1('0x3d')],{'$or':_[_0xa1b1('0x2c')](_0x162370['attributes'],function(_0x497721){var _0x36f8fd={};_0x36f8fd[_0x497721]={'$like':'%'+_0x17c771['query'][_0xa1b1('0x3f')]+'%'};return _0x36f8fd;})});}_0x162370=_[_0xa1b1('0x40')]({},_0x162370,_0x17c771[_0xa1b1('0x42')]);return _0x7aeccd[_0xa1b1('0x4d')](_0x162370);}})[_0xa1b1('0x28')](function(_0x49b1e2){if(_0x49b1e2){_0x515d04=_0x49b1e2[_0xa1b1('0x38')];if(!_0x17c771[_0xa1b1('0x32')][_0xa1b1('0x39')]('nolimit')){_0x162370[_0xa1b1('0x20')]=qs['limit'](_0x17c771['query']['limit']);_0x162370['offset']=qs[_0xa1b1('0x1e')](_0x17c771[_0xa1b1('0x32')]['offset']);}return _0x7aeccd[_0xa1b1('0x4d')](_0x162370);}})[_0xa1b1('0x28')](function(_0x42a8f0){if(_0x42a8f0){return _0x42a8f0?{'count':_0x515d04,'rows':_0x42a8f0}:null;}})['then'](respondWithResult(_0x3d7694,null))[_0xa1b1('0x4b')](handleError(_0x3d7694,null));};exports[_0xa1b1('0x50')]=function(_0x360852,_0x48f5ec,_0x541a46){if(_0x360852['body']['id']){delete _0x360852[_0xa1b1('0x4c')]['id'];}return db[_0xa1b1('0x43')][_0xa1b1('0x4e')]({'where':{'id':_0x360852[_0xa1b1('0x48')]['id']}})['then'](handleEntityNotFound(_0x48f5ec,null))[_0xa1b1('0x28')](function(_0x1dc477){if(_0x1dc477){_0x360852['body'][_0xa1b1('0x51')]=_0x1dc477['id'];_0x360852[_0xa1b1('0x4c')][_0xa1b1('0x52')]=integrations[_0xa1b1('0x53')](_0x360852[_0xa1b1('0x4c')]['channel'],_0x360852[_0xa1b1('0x4c')][_0xa1b1('0x2f')]);_0x360852[_0xa1b1('0x4c')][_0xa1b1('0x54')]=integrations[_0xa1b1('0x55')](_0x360852['body'][_0xa1b1('0x56')],_0x360852[_0xa1b1('0x4c')]['type']);return db['VtigerConfiguration'][_0xa1b1('0x4a')](_0x360852[_0xa1b1('0x4c')],{'include':[{'model':db[_0xa1b1('0x57')],'as':_0xa1b1('0x52')},{'model':db[_0xa1b1('0x57')],'as':_0xa1b1('0x54')}]});}return null;})['then'](respondWithResult(_0x48f5ec,null))[_0xa1b1('0x4b')](handleError(_0x48f5ec,null));};var md5=require(_0xa1b1('0x58'));exports[_0xa1b1('0x59')]=function(_0x39f96f,_0x27df9b,_0x41ce29){var _0x262c9a=null;var _0x3e6ccb=null;var _0x20ad3f=null;var _0x1c2cf5=null;var _0x2c606f='';return db['VtigerAccount'][_0xa1b1('0x4e')]({'where':{'id':_0x39f96f[_0xa1b1('0x48')]['id']},'attributes':['id',_0xa1b1('0x2b'),_0xa1b1('0x5a'),'description','moduleName',_0xa1b1('0x5b'),_0xa1b1('0x5c'),_0xa1b1('0x5d')]})['then'](handleEntityNotFound(_0x27df9b,null))[_0xa1b1('0x28')](function(_0x4f6fb9){if(_0x4f6fb9){_0x262c9a=_0x4f6fb9[_0xa1b1('0x5a')];_0x3e6ccb=_0x4f6fb9[_0xa1b1('0x5d')];_0x20ad3f=_0x4f6fb9[_0xa1b1('0x5e')];_0x2c606f=_0x4f6fb9['remoteUri'];var _0x241770=_0x2c606f[_0xa1b1('0x5f')](-0x1);if(_0x241770==='/'){_0x2c606f=_0x2c606f['substring'](0x0,_0x2c606f['lastIndexOf'](_0x241770));}_0x1c2cf5=util[_0xa1b1('0x60')]('%s/webservice.php',_0x2c606f);var _0x177b71={'method':_0xa1b1('0x61'),'uri':_0x1c2cf5,'qs':{'operation':_0xa1b1('0x62'),'username':_0x4f6fb9[_0xa1b1('0x5a')]},'json':!![]};return rp(_0x177b71);}})[_0xa1b1('0x28')](function(_0x136e02){if(_0x136e02['success']){var _0x5e9063={'method':_0xa1b1('0x63'),'uri':_0x1c2cf5,'form':{'operation':'login','username':_0x262c9a,'accessKey':md5(_0x136e02[_0xa1b1('0x64')]['token']+_0x3e6ccb)},'json':!![]};return rp(_0x5e9063);}})[_0xa1b1('0x28')](function(_0x50929c){if(_0x50929c[_0xa1b1('0x65')]){var _0x12cb0d={'method':'GET','uri':_0x1c2cf5,'qs':{'operation':_0xa1b1('0x66'),'username':_0x262c9a,'sessionName':_0x50929c[_0xa1b1('0x64')][_0xa1b1('0x67')],'elementType':_0x20ad3f},'json':!![]};return rp(_0x12cb0d);}})['then'](function(_0x47964a){if(_0x47964a[_0xa1b1('0x65')]){var _0x531438=[_0xa1b1('0x68'),_0xa1b1('0x69'),_0xa1b1('0x6a')];_[_0xa1b1('0x6b')](_0x47964a[_0xa1b1('0x64')]['fields'],function(_0x5a07c9){return _0x531438[_0xa1b1('0x6c')](_0x5a07c9[_0xa1b1('0x2f')][_0xa1b1('0x2b')]);});_[_0xa1b1('0x6b')](_0x47964a[_0xa1b1('0x64')][_0xa1b1('0x37')],function(_0x468e27){return _0x468e27['editable']===_0xa1b1('0x6d');});return{'count':_0x47964a[_0xa1b1('0x64')][_0xa1b1('0x37')][_0xa1b1('0x38')],'rows':_['map'](_0x47964a[_0xa1b1('0x64')][_0xa1b1('0x37')],function(_0x1289e3){return{'id':_0x1289e3['name'],'name':_0x1289e3[_0xa1b1('0x6e')],'custom':_[_0xa1b1('0x6f')](_0x1289e3[_0xa1b1('0x2b')],_0xa1b1('0x70'))?!![]:![],'options':_0x1289e3[_0xa1b1('0x2f')][_0xa1b1('0x2b')]===_0xa1b1('0x71')&&_0x1289e3[_0xa1b1('0x2f')][_0xa1b1('0x72')]['length']>0x0?_[_0xa1b1('0x2c')](_0x1289e3['type'][_0xa1b1('0x72')],function(_0x5a0fd6){return{'name':_0x5a0fd6[_0xa1b1('0x6e')],'value':_0x5a0fd6['value']};}):[]};})};}})[_0xa1b1('0x28')](respondWithResult(_0x27df9b,null))[_0xa1b1('0x4b')](function(_0x3b1980){console['log'](_0xa1b1('0x73')+_0x3b1980);var _0x1e9ffe=_0x39f96f[_0xa1b1('0x32')]['test']?0x1f4:_0x3b1980[_0xa1b1('0x74')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0xa1b1('0x59'),_0x1e9ffe,JSON[_0xa1b1('0x75')](_0x3b1980));delete _0x3b1980[_0xa1b1('0x2b')];if(_0x1e9ffe===0x191){_0x1e9ffe=0x190;}_0x27df9b['status'](_0x1e9ffe)[_0xa1b1('0x76')](_0x39f96f[_0xa1b1('0x32')][_0xa1b1('0x77')]?{'message':_0xa1b1('0x78'),'statusCode':_0x3b1980[_0xa1b1('0x74')]}:_0x3b1980);});}; \ No newline at end of file +var _0xc8c8=['sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','save','update','then','destroy','stack','name','send','index','map','VtigerAccount','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','type','VIRTUAL','merge','options','include','findAll','catch','show','params','length','find','create','body','getConfigurations','findOne','VtigerConfiguration','order','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerField','getFields','description','moduleName','remoteUri','serverUrl','accessKey','substring','lastIndexOf','%s/webservice.php','GET','username','success','POST','login','result','describe','autogenerated','reference','owner','remove','includes','editable','label','startsWith','picklist','picklistValues','log','statusCode','error','stringify','test','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util'];(function(_0x205bf0,_0xb39bc8){var _0x3bfb49=function(_0x2dd564){while(--_0x2dd564){_0x205bf0['push'](_0x205bf0['shift']());}};_0x3bfb49(++_0xb39bc8);}(_0xc8c8,0xe2));var _0x8c8c=function(_0x623876,_0x138eb5){_0x623876=_0x623876-0x0;var _0x2babcc=_0xc8c8[_0x623876];return _0x2babcc;};'use strict';var emlformat=require(_0x8c8c('0x0'));var rimraf=require(_0x8c8c('0x1'));var zipdir=require(_0x8c8c('0x2'));var jsonpatch=require(_0x8c8c('0x3'));var rp=require(_0x8c8c('0x4'));var moment=require(_0x8c8c('0x5'));var BPromise=require(_0x8c8c('0x6'));var Mustache=require('mustache');var util=require(_0x8c8c('0x7'));var path=require('path');var sox=require(_0x8c8c('0x8'));var csv=require(_0x8c8c('0x9'));var ejs=require(_0x8c8c('0xa'));var fs=require('fs');var fs_extra=require(_0x8c8c('0xb'));var _=require(_0x8c8c('0xc'));var squel=require(_0x8c8c('0xd'));var crypto=require('crypto');var jsforce=require(_0x8c8c('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8c8c('0xf'));var Papa=require(_0x8c8c('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8c8c('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8c8c('0x12'));var logger=require(_0x8c8c('0x13'))(_0x8c8c('0x14'));var utils=require(_0x8c8c('0x15'));var config=require(_0x8c8c('0x16'));var licenseUtil=require(_0x8c8c('0x17'));var db=require(_0x8c8c('0x18'))['db'];var integrations=require(_0x8c8c('0x19'));function respondWithStatusCode(_0x391dd4,_0x9f8446){_0x9f8446=_0x9f8446||0xcc;return function(_0x1832ef){if(_0x1832ef){return _0x391dd4[_0x8c8c('0x1a')](_0x9f8446);}return _0x391dd4['status'](_0x9f8446)[_0x8c8c('0x1b')]();};}function respondWithResult(_0x168651,_0x41f48a){_0x41f48a=_0x41f48a||0xc8;return function(_0x2a7f6b){if(_0x2a7f6b){return _0x168651[_0x8c8c('0x1c')](_0x41f48a)[_0x8c8c('0x1d')](_0x2a7f6b);}};}function respondWithFilteredResult(_0xe4495f,_0x1fb762){return function(_0x55acc6){if(_0x55acc6){var _0x10d20d=typeof _0x1fb762['offset']===_0x8c8c('0x1e')&&typeof _0x1fb762[_0x8c8c('0x1f')]===_0x8c8c('0x1e');var _0xa5a8f3=_0x55acc6[_0x8c8c('0x20')];var _0x4784fd=_0x10d20d?0x0:_0x1fb762[_0x8c8c('0x21')];var _0xef1bc4=_0x10d20d?_0x55acc6['count']:_0x1fb762[_0x8c8c('0x21')]+_0x1fb762['limit'];var _0x1e6c42;if(_0xef1bc4>=_0xa5a8f3){_0xef1bc4=_0xa5a8f3;_0x1e6c42=0xc8;}else{_0x1e6c42=0xce;}_0xe4495f[_0x8c8c('0x1c')](_0x1e6c42);return _0xe4495f[_0x8c8c('0x22')](_0x8c8c('0x23'),_0x4784fd+'-'+_0xef1bc4+'/'+_0xa5a8f3)['json'](_0x55acc6);}return null;};}function patchUpdates(_0x4ec8bc){return function(_0x124456){try{jsonpatch['apply'](_0x124456,_0x4ec8bc,!![]);}catch(_0x2aea33){return BPromise['reject'](_0x2aea33);}return _0x124456[_0x8c8c('0x24')]();};}function saveUpdates(_0x1056ad,_0x192c50){return function(_0x4dafec){if(_0x4dafec){return _0x4dafec[_0x8c8c('0x25')](_0x1056ad)[_0x8c8c('0x26')](function(_0x24e2f7){return _0x24e2f7;});}return null;};}function removeEntity(_0x3551c9,_0x3b2919){return function(_0x34a0dc){if(_0x34a0dc){return _0x34a0dc[_0x8c8c('0x27')]()[_0x8c8c('0x26')](function(){_0x3551c9[_0x8c8c('0x1c')](0xcc)[_0x8c8c('0x1b')]();});}};}function handleEntityNotFound(_0x2da6cf,_0x14ee3d){return function(_0x1e8736){if(!_0x1e8736){_0x2da6cf['sendStatus'](0x194);}return _0x1e8736;};}function handleError(_0x2d20c2,_0x148441){_0x148441=_0x148441||0x1f4;return function(_0x4bf035){logger['error'](_0x4bf035[_0x8c8c('0x28')]);if(_0x4bf035[_0x8c8c('0x29')]){delete _0x4bf035[_0x8c8c('0x29')];}_0x2d20c2[_0x8c8c('0x1c')](_0x148441)[_0x8c8c('0x2a')](_0x4bf035);};}exports[_0x8c8c('0x2b')]=function(_0x259ca0,_0x125921){var _0x3f40f6={},_0x39b7c9={},_0x1b4a68={'count':0x0,'rows':[]};var _0x3800eb=_[_0x8c8c('0x2c')](db[_0x8c8c('0x2d')][_0x8c8c('0x2e')],function(_0x53eecb){return{'name':_0x53eecb[_0x8c8c('0x2f')],'type':_0x53eecb['type']['key']};});_0x39b7c9[_0x8c8c('0x30')]=_['map'](_0x3800eb,_0x8c8c('0x29'));_0x39b7c9[_0x8c8c('0x31')]=_[_0x8c8c('0x32')](_0x259ca0[_0x8c8c('0x31')]);_0x39b7c9[_0x8c8c('0x33')]=_['intersection'](_0x39b7c9['model'],_0x39b7c9[_0x8c8c('0x31')]);_0x3f40f6['attributes']=_[_0x8c8c('0x34')](_0x39b7c9[_0x8c8c('0x30')],qs[_0x8c8c('0x35')](_0x259ca0[_0x8c8c('0x31')]['fields']));_0x3f40f6['attributes']=_0x3f40f6[_0x8c8c('0x36')]['length']?_0x3f40f6[_0x8c8c('0x36')]:_0x39b7c9[_0x8c8c('0x30')];if(!_0x259ca0[_0x8c8c('0x31')][_0x8c8c('0x37')](_0x8c8c('0x38'))){_0x3f40f6[_0x8c8c('0x1f')]=qs[_0x8c8c('0x1f')](_0x259ca0['query'][_0x8c8c('0x1f')]);_0x3f40f6[_0x8c8c('0x21')]=qs['offset'](_0x259ca0[_0x8c8c('0x31')][_0x8c8c('0x21')]);}_0x3f40f6['order']=qs[_0x8c8c('0x39')](_0x259ca0['query'][_0x8c8c('0x39')]);_0x3f40f6[_0x8c8c('0x3a')]=qs[_0x8c8c('0x33')](_[_0x8c8c('0x3b')](_0x259ca0[_0x8c8c('0x31')],_0x39b7c9[_0x8c8c('0x33')]),_0x3800eb);if(_0x259ca0[_0x8c8c('0x31')][_0x8c8c('0x3c')]){_0x3f40f6[_0x8c8c('0x3a')]=_['merge'](_0x3f40f6[_0x8c8c('0x3a')],{'$or':_[_0x8c8c('0x2c')](_0x3800eb,function(_0x48f92e){if(_0x48f92e[_0x8c8c('0x3d')]!==_0x8c8c('0x3e')){var _0x5eac06={};_0x5eac06[_0x48f92e['name']]={'$like':'%'+_0x259ca0[_0x8c8c('0x31')][_0x8c8c('0x3c')]+'%'};return _0x5eac06;}})});}_0x3f40f6=_[_0x8c8c('0x3f')]({},_0x3f40f6,_0x259ca0[_0x8c8c('0x40')]);var _0x10200e={'where':_0x3f40f6[_0x8c8c('0x3a')]};return db[_0x8c8c('0x2d')][_0x8c8c('0x20')](_0x10200e)[_0x8c8c('0x26')](function(_0xe6bb4){_0x1b4a68[_0x8c8c('0x20')]=_0xe6bb4;if(_0x259ca0[_0x8c8c('0x31')]['includeAll']){_0x3f40f6[_0x8c8c('0x41')]=[{'all':!![]}];}return db['VtigerAccount'][_0x8c8c('0x42')](_0x3f40f6);})[_0x8c8c('0x26')](function(_0x3eb112){_0x1b4a68['rows']=_0x3eb112;return _0x1b4a68;})[_0x8c8c('0x26')](respondWithFilteredResult(_0x125921,_0x3f40f6))[_0x8c8c('0x43')](handleError(_0x125921,null));};exports[_0x8c8c('0x44')]=function(_0x19c05b,_0x42916c){var _0x52e266={'raw':![],'where':{'id':_0x19c05b[_0x8c8c('0x45')]['id']}},_0x51b86e={};_0x51b86e[_0x8c8c('0x30')]=_[_0x8c8c('0x32')](db[_0x8c8c('0x2d')][_0x8c8c('0x2e')]);_0x51b86e['query']=_[_0x8c8c('0x32')](_0x19c05b[_0x8c8c('0x31')]);_0x51b86e[_0x8c8c('0x33')]=_[_0x8c8c('0x34')](_0x51b86e[_0x8c8c('0x30')],_0x51b86e[_0x8c8c('0x31')]);_0x52e266[_0x8c8c('0x36')]=_['intersection'](_0x51b86e[_0x8c8c('0x30')],qs['fields'](_0x19c05b[_0x8c8c('0x31')]['fields']));_0x52e266['attributes']=_0x52e266[_0x8c8c('0x36')][_0x8c8c('0x46')]?_0x52e266['attributes']:_0x51b86e[_0x8c8c('0x30')];if(_0x19c05b[_0x8c8c('0x31')]['includeAll']){_0x52e266[_0x8c8c('0x41')]=[{'all':!![]}];}_0x52e266=_['merge']({},_0x52e266,_0x19c05b[_0x8c8c('0x40')]);return db[_0x8c8c('0x2d')][_0x8c8c('0x47')](_0x52e266)[_0x8c8c('0x26')](handleEntityNotFound(_0x42916c,null))[_0x8c8c('0x26')](respondWithResult(_0x42916c,null))[_0x8c8c('0x43')](handleError(_0x42916c,null));};exports['create']=function(_0x188488,_0xe2dad8){return db[_0x8c8c('0x2d')][_0x8c8c('0x48')](_0x188488[_0x8c8c('0x49')],{})['then'](respondWithResult(_0xe2dad8,0xc9))[_0x8c8c('0x43')](handleError(_0xe2dad8,null));};exports['update']=function(_0x50a117,_0x331cf2){if(_0x50a117[_0x8c8c('0x49')]['id']){delete _0x50a117[_0x8c8c('0x49')]['id'];}return db['VtigerAccount']['find']({'where':{'id':_0x50a117[_0x8c8c('0x45')]['id']}})[_0x8c8c('0x26')](handleEntityNotFound(_0x331cf2,null))['then'](saveUpdates(_0x50a117['body'],null))[_0x8c8c('0x26')](respondWithResult(_0x331cf2,null))['catch'](handleError(_0x331cf2,null));};exports['destroy']=function(_0x4cc50f,_0x56b45b){return db['VtigerAccount']['find']({'where':{'id':_0x4cc50f['params']['id']}})['then'](handleEntityNotFound(_0x56b45b,null))[_0x8c8c('0x26')](removeEntity(_0x56b45b,null))[_0x8c8c('0x43')](handleError(_0x56b45b,null));};exports[_0x8c8c('0x4a')]=function(_0x15e1cf,_0x445dd0,_0x39d24a){var _0x1211ef={};var _0x4dc3a={};var _0x5060c5;var _0x5c914f;return db[_0x8c8c('0x2d')][_0x8c8c('0x4b')]({'where':{'id':_0x15e1cf[_0x8c8c('0x45')]['id']}})[_0x8c8c('0x26')](handleEntityNotFound(_0x445dd0,null))[_0x8c8c('0x26')](function(_0x150cf4){if(_0x150cf4){_0x5060c5=_0x150cf4;_0x4dc3a['model']=_[_0x8c8c('0x32')](db[_0x8c8c('0x4c')][_0x8c8c('0x2e')]);_0x4dc3a[_0x8c8c('0x31')]=_[_0x8c8c('0x32')](_0x15e1cf[_0x8c8c('0x31')]);_0x4dc3a[_0x8c8c('0x33')]=_[_0x8c8c('0x34')](_0x4dc3a[_0x8c8c('0x30')],_0x4dc3a[_0x8c8c('0x31')]);_0x1211ef[_0x8c8c('0x36')]=_['intersection'](_0x4dc3a[_0x8c8c('0x30')],qs[_0x8c8c('0x35')](_0x15e1cf[_0x8c8c('0x31')][_0x8c8c('0x35')]));_0x1211ef[_0x8c8c('0x36')]=_0x1211ef[_0x8c8c('0x36')][_0x8c8c('0x46')]?_0x1211ef[_0x8c8c('0x36')]:_0x4dc3a['model'];_0x1211ef[_0x8c8c('0x4d')]=qs[_0x8c8c('0x39')](_0x15e1cf[_0x8c8c('0x31')][_0x8c8c('0x39')]);_0x1211ef[_0x8c8c('0x3a')]=qs[_0x8c8c('0x33')](_[_0x8c8c('0x3b')](_0x15e1cf[_0x8c8c('0x31')],_0x4dc3a['filters']));if(_0x15e1cf[_0x8c8c('0x31')][_0x8c8c('0x3c')]){_0x1211ef[_0x8c8c('0x3a')]=_[_0x8c8c('0x3f')](_0x1211ef[_0x8c8c('0x3a')],{'$or':_[_0x8c8c('0x2c')](_0x1211ef[_0x8c8c('0x36')],function(_0xd79fa5){var _0x247093={};_0x247093[_0xd79fa5]={'$like':'%'+_0x15e1cf[_0x8c8c('0x31')]['filter']+'%'};return _0x247093;})});}_0x1211ef=_[_0x8c8c('0x3f')]({},_0x1211ef,_0x15e1cf[_0x8c8c('0x40')]);return _0x5060c5['getConfigurations'](_0x1211ef);}})[_0x8c8c('0x26')](function(_0x3f08b2){if(_0x3f08b2){_0x5c914f=_0x3f08b2[_0x8c8c('0x46')];if(!_0x15e1cf[_0x8c8c('0x31')]['hasOwnProperty'](_0x8c8c('0x38'))){_0x1211ef[_0x8c8c('0x1f')]=qs['limit'](_0x15e1cf[_0x8c8c('0x31')][_0x8c8c('0x1f')]);_0x1211ef[_0x8c8c('0x21')]=qs[_0x8c8c('0x21')](_0x15e1cf[_0x8c8c('0x31')][_0x8c8c('0x21')]);}return _0x5060c5[_0x8c8c('0x4a')](_0x1211ef);}})[_0x8c8c('0x26')](function(_0x9750cd){if(_0x9750cd){return _0x9750cd?{'count':_0x5c914f,'rows':_0x9750cd}:null;}})[_0x8c8c('0x26')](respondWithResult(_0x445dd0,null))[_0x8c8c('0x43')](handleError(_0x445dd0,null));};exports[_0x8c8c('0x4e')]=function(_0x36803c,_0x26aa38,_0x433b8e){if(_0x36803c['body']['id']){delete _0x36803c['body']['id'];}return db[_0x8c8c('0x2d')]['findOne']({'where':{'id':_0x36803c['params']['id']}})[_0x8c8c('0x26')](handleEntityNotFound(_0x26aa38,null))[_0x8c8c('0x26')](function(_0x120631){if(_0x120631){_0x36803c[_0x8c8c('0x49')][_0x8c8c('0x4f')]=_0x120631['id'];_0x36803c[_0x8c8c('0x49')][_0x8c8c('0x50')]=integrations[_0x8c8c('0x51')](_0x36803c[_0x8c8c('0x49')][_0x8c8c('0x52')],_0x36803c[_0x8c8c('0x49')][_0x8c8c('0x3d')]);_0x36803c[_0x8c8c('0x49')][_0x8c8c('0x53')]=integrations[_0x8c8c('0x54')](_0x36803c['body']['channel'],_0x36803c[_0x8c8c('0x49')][_0x8c8c('0x3d')]);return db[_0x8c8c('0x4c')][_0x8c8c('0x48')](_0x36803c[_0x8c8c('0x49')],{'include':[{'model':db[_0x8c8c('0x55')],'as':_0x8c8c('0x50')},{'model':db['VtigerField'],'as':_0x8c8c('0x53')}]});}return null;})['then'](respondWithResult(_0x26aa38,null))[_0x8c8c('0x43')](handleError(_0x26aa38,null));};var md5=require('md5');exports[_0x8c8c('0x56')]=function(_0x1627a2,_0x5d20d6,_0x1b6415){var _0x897812=null;var _0x5d1ab2=null;var _0x1b5f3d=null;var _0x5b5fa7=null;var _0x27cbfd='';return db['VtigerAccount'][_0x8c8c('0x4b')]({'where':{'id':_0x1627a2[_0x8c8c('0x45')]['id']},'attributes':['id',_0x8c8c('0x29'),'username',_0x8c8c('0x57'),_0x8c8c('0x58'),_0x8c8c('0x59'),_0x8c8c('0x5a'),_0x8c8c('0x5b')]})[_0x8c8c('0x26')](handleEntityNotFound(_0x5d20d6,null))['then'](function(_0x5d85c4){if(_0x5d85c4){_0x897812=_0x5d85c4['username'];_0x5d1ab2=_0x5d85c4[_0x8c8c('0x5b')];_0x1b5f3d=_0x5d85c4[_0x8c8c('0x58')];_0x27cbfd=_0x5d85c4['remoteUri'];var _0x12ad14=_0x27cbfd['slice'](-0x1);if(_0x12ad14==='/'){_0x27cbfd=_0x27cbfd[_0x8c8c('0x5c')](0x0,_0x27cbfd[_0x8c8c('0x5d')](_0x12ad14));}_0x5b5fa7=util['format'](_0x8c8c('0x5e'),_0x27cbfd);var _0x3d1915={'method':_0x8c8c('0x5f'),'uri':_0x5b5fa7,'qs':{'operation':'getchallenge','username':_0x5d85c4[_0x8c8c('0x60')]},'json':!![]};return rp(_0x3d1915);}})[_0x8c8c('0x26')](function(_0x557bd9){if(_0x557bd9[_0x8c8c('0x61')]){var _0x38f80d={'method':_0x8c8c('0x62'),'uri':_0x5b5fa7,'form':{'operation':_0x8c8c('0x63'),'username':_0x897812,'accessKey':md5(_0x557bd9[_0x8c8c('0x64')]['token']+_0x5d1ab2)},'json':!![]};return rp(_0x38f80d);}})[_0x8c8c('0x26')](function(_0x5c70f4){if(_0x5c70f4['success']){var _0x14da83={'method':_0x8c8c('0x5f'),'uri':_0x5b5fa7,'qs':{'operation':_0x8c8c('0x65'),'username':_0x897812,'sessionName':_0x5c70f4['result']['sessionName'],'elementType':_0x1b5f3d},'json':!![]};return rp(_0x14da83);}})['then'](function(_0x4b1bf2){if(_0x4b1bf2[_0x8c8c('0x61')]){var _0x2a078e=[_0x8c8c('0x66'),_0x8c8c('0x67'),_0x8c8c('0x68')];_[_0x8c8c('0x69')](_0x4b1bf2[_0x8c8c('0x64')][_0x8c8c('0x35')],function(_0x3cdfbd){return _0x2a078e[_0x8c8c('0x6a')](_0x3cdfbd[_0x8c8c('0x3d')][_0x8c8c('0x29')]);});_[_0x8c8c('0x69')](_0x4b1bf2[_0x8c8c('0x64')][_0x8c8c('0x35')],function(_0x1177b1){return _0x1177b1[_0x8c8c('0x6b')]==='false';});return{'count':_0x4b1bf2[_0x8c8c('0x64')][_0x8c8c('0x35')][_0x8c8c('0x46')],'rows':_[_0x8c8c('0x2c')](_0x4b1bf2[_0x8c8c('0x64')][_0x8c8c('0x35')],function(_0x53cda2){return{'id':_0x53cda2[_0x8c8c('0x29')],'name':_0x53cda2[_0x8c8c('0x6c')],'custom':_[_0x8c8c('0x6d')](_0x53cda2[_0x8c8c('0x29')],'cf_')?!![]:![],'options':_0x53cda2[_0x8c8c('0x3d')][_0x8c8c('0x29')]===_0x8c8c('0x6e')&&_0x53cda2[_0x8c8c('0x3d')][_0x8c8c('0x6f')][_0x8c8c('0x46')]>0x0?_[_0x8c8c('0x2c')](_0x53cda2[_0x8c8c('0x3d')][_0x8c8c('0x6f')],function(_0x514304){return{'name':_0x514304[_0x8c8c('0x6c')],'value':_0x514304['value']};}):[]};})};}})[_0x8c8c('0x26')](respondWithResult(_0x5d20d6,null))[_0x8c8c('0x43')](function(_0x14e956){console[_0x8c8c('0x70')]('vTiger\x20error:\x20'+_0x14e956);var _0x2679a8=_0x1627a2[_0x8c8c('0x31')]['test']?0x1f4:_0x14e956[_0x8c8c('0x71')]||0x1f4;logger[_0x8c8c('0x72')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x2679a8,JSON[_0x8c8c('0x73')](_0x14e956));delete _0x14e956[_0x8c8c('0x29')];if(_0x2679a8===0x191){_0x2679a8=0x190;}_0x5d20d6[_0x8c8c('0x1c')](_0x2679a8)[_0x8c8c('0x2a')](_0x1627a2[_0x8c8c('0x31')][_0x8c8c('0x74')]?{'message':'Wrong\x20credentials','statusCode':_0x14e956['statusCode']}:_0x14e956);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 30288d5..276f39e 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 _0xfa6b=['../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x1394a2,_0x533264){var _0x31dcd1=function(_0x58c693){while(--_0x58c693){_0x1394a2['push'](_0x1394a2['shift']());}};_0x31dcd1(++_0x533264);}(_0xfa6b,0x91));var _0xbfa6=function(_0x34577c,_0x29523e){_0x34577c=_0x34577c-0x0;var _0x3444a2=_0xfa6b[_0x34577c];return _0x3444a2;};'use strict';var _=require(_0xbfa6('0x0'));var util=require(_0xbfa6('0x1'));var logger=require(_0xbfa6('0x2'))(_0xbfa6('0x3'));var moment=require(_0xbfa6('0x4'));var BPromise=require(_0xbfa6('0x5'));var rp=require(_0xbfa6('0x6'));var fs=require('fs');var path=require(_0xbfa6('0x7'));var rimraf=require(_0xbfa6('0x8'));var config=require(_0xbfa6('0x9'));var attributes=require(_0xbfa6('0xa'));var integrations=require(_0xbfa6('0xb'));module[_0xbfa6('0xc')]=function(_0x2f68f6,_0x41b67c){return _0x2f68f6[_0xbfa6('0xd')]('VtigerAccount',attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1c87=['../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','VtigerAccount','int_vtiger_accounts','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x1c87,0x92));var _0x71c8=function(_0x537b4b,_0x2836db){_0x537b4b=_0x537b4b-0x0;var _0x3ce455=_0x1c87[_0x537b4b];return _0x3ce455;};'use strict';var _=require(_0x71c8('0x0'));var util=require(_0x71c8('0x1'));var logger=require('../../config/logger')(_0x71c8('0x2'));var moment=require(_0x71c8('0x3'));var BPromise=require(_0x71c8('0x4'));var rp=require(_0x71c8('0x5'));var fs=require('fs');var path=require(_0x71c8('0x6'));var rimraf=require(_0x71c8('0x7'));var config=require(_0x71c8('0x8'));var attributes=require(_0x71c8('0x9'));var integrations=require(_0x71c8('0xa'));module[_0x71c8('0xb')]=function(_0x10c286,_0x2eb137){return _0x10c286['define'](_0x71c8('0xc'),attributes,{'tableName':_0x71c8('0xd'),'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 2fd9129..24048e4 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 _0xcb91=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetVtigerAccount','VtigerAccount','findAll','options','raw','attributes','include','map','model','then','ShowVtigerAccount','find','where','moment','bluebird','randomstring','ioredis'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5ae8f7,_0x330d91){_0x5ae8f7=_0x5ae8f7-0x0;var _0x54c636=_0xcb91[_0x5ae8f7];return _0x54c636;};'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')]('VtigerAccount,\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);});});}exports[_0x1cb9('0x14')]=function(_0x23d3a9){var _0x4e1340=this;return new Promise(function(_0x479d43,_0x1b2fa6){return db[_0x1cb9('0x15')][_0x1cb9('0x16')]({'raw':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9[_0x1cb9('0x17')][_0x1cb9('0x18')]===undefined?!![]:![]:!![],'where':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9['options']['where']||null:null,'attributes':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9['options'][_0x1cb9('0x19')]||null:null,'limit':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9['options']['limit']||null:null,'include':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9[_0x1cb9('0x17')][_0x1cb9('0x1a')]?_[_0x1cb9('0x1b')](_0x23d3a9[_0x1cb9('0x17')][_0x1cb9('0x1a')],function(_0x59ebea){return{'model':db[_0x59ebea['model']],'as':_0x59ebea['as'],'attributes':_0x59ebea[_0x1cb9('0x19')],'include':_0x59ebea['include']?_[_0x1cb9('0x1b')](_0x59ebea[_0x1cb9('0x1a')],function(_0x69b4c8){return{'model':db[_0x69b4c8[_0x1cb9('0x1c')]],'as':_0x69b4c8['as'],'attributes':_0x69b4c8[_0x1cb9('0x19')],'include':_0x69b4c8['include']?_[_0x1cb9('0x1b')](_0x69b4c8[_0x1cb9('0x1a')],function(_0x4c8d76){return{'model':db[_0x4c8d76[_0x1cb9('0x1c')]],'as':_0x4c8d76['as'],'attributes':_0x4c8d76[_0x1cb9('0x19')]};}):[]};}):[]};}):[]:[]})[_0x1cb9('0x1d')](function(_0x1804fd){logger[_0x1cb9('0xa')](_0x1cb9('0x14'),_0x23d3a9);logger[_0x1cb9('0xd')](_0x1cb9('0x14'),_0x23d3a9,JSON[_0x1cb9('0xf')](_0x1804fd));_0x479d43(_0x1804fd);})[_0x1cb9('0x13')](function(_0x48888d){logger[_0x1cb9('0x10')]('GetVtigerAccount',_0x48888d[_0x1cb9('0x12')],_0x23d3a9);_0x1b2fa6(_0x4e1340['error'](0x1f4,_0x48888d[_0x1cb9('0x12')]));});});};exports[_0x1cb9('0x1e')]=function(_0x3cd7f5){var _0x2038aa=this;return new Promise(function(_0x561d89,_0x1c701f){return db['VtigerAccount'][_0x1cb9('0x1f')]({'raw':_0x3cd7f5[_0x1cb9('0x17')]?_0x3cd7f5[_0x1cb9('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x3cd7f5[_0x1cb9('0x17')]?_0x3cd7f5['options'][_0x1cb9('0x20')]||null:null,'attributes':_0x3cd7f5['options']?_0x3cd7f5[_0x1cb9('0x17')][_0x1cb9('0x19')]||null:null,'include':_0x3cd7f5[_0x1cb9('0x17')]?_0x3cd7f5[_0x1cb9('0x17')]['include']?_[_0x1cb9('0x1b')](_0x3cd7f5[_0x1cb9('0x17')][_0x1cb9('0x1a')],function(_0x91a1db){return{'model':db[_0x91a1db[_0x1cb9('0x1c')]],'as':_0x91a1db['as'],'attributes':_0x91a1db[_0x1cb9('0x19')],'include':_0x91a1db[_0x1cb9('0x1a')]?_[_0x1cb9('0x1b')](_0x91a1db[_0x1cb9('0x1a')],function(_0x1de287){return{'model':db[_0x1de287[_0x1cb9('0x1c')]],'as':_0x1de287['as'],'attributes':_0x1de287[_0x1cb9('0x19')],'include':_0x1de287[_0x1cb9('0x1a')]?_['map'](_0x1de287['include'],function(_0x299ff8){return{'model':db[_0x299ff8[_0x1cb9('0x1c')]],'as':_0x299ff8['as'],'attributes':_0x299ff8[_0x1cb9('0x19')]};}):[]};}):[]};}):[]:[]})[_0x1cb9('0x1d')](function(_0x385daa){logger[_0x1cb9('0xa')](_0x1cb9('0x1e'),_0x3cd7f5);logger[_0x1cb9('0xd')]('ShowVtigerAccount',_0x3cd7f5,JSON[_0x1cb9('0xf')](_0x385daa));_0x561d89(_0x385daa);})[_0x1cb9('0x13')](function(_0xefe136){logger['error'](_0x1cb9('0x1e'),_0xefe136['message'],_0x3cd7f5);_0x1c701f(_0x2038aa[_0x1cb9('0x10')](0x1f4,_0xefe136['message']));});});}; \ No newline at end of file +var _0x7072=['model','then','ShowVtigerAccount','VtigerAccount','find','map','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetVtigerAccount','options','raw','where','attributes','limit','include'];(function(_0x2b737c,_0x274adf){var _0x466ed5=function(_0x593124){while(--_0x593124){_0x2b737c['push'](_0x2b737c['shift']());}};_0x466ed5(++_0x274adf);}(_0x7072,0x138));var _0x2707=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x7072[_0x51020b];return _0x371e47;};'use strict';var _=require('lodash');var util=require(_0x2707('0x0'));var moment=require(_0x2707('0x1'));var BPromise=require(_0x2707('0x2'));var rs=require(_0x2707('0x3'));var fs=require('fs');var Redis=require(_0x2707('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2707('0x5'))('rpc');var config=require(_0x2707('0x6'));var jayson=require(_0x2707('0x7'));var client=jayson[_0x2707('0x8')][_0x2707('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2fd8ff,_0x128205,_0x21b0a0){return new BPromise(function(_0x745cfd,_0x4062b6){return client[_0x2707('0xa')](_0x2fd8ff,_0x21b0a0)['then'](function(_0x597ff9){logger[_0x2707('0xb')](_0x2707('0xc'),_0x128205,_0x2707('0xd'));logger[_0x2707('0xe')](_0x2707('0xf'),_0x128205,_0x2707('0xd'),JSON[_0x2707('0x10')](_0x597ff9));if(_0x597ff9[_0x2707('0x11')]){if(_0x597ff9[_0x2707('0x11')][_0x2707('0x12')]===0x1f4){logger[_0x2707('0x11')](_0x2707('0xc'),_0x128205,_0x597ff9[_0x2707('0x11')]['message']);return _0x4062b6(_0x597ff9[_0x2707('0x11')]['message']);}logger[_0x2707('0x11')](_0x2707('0xc'),_0x128205,_0x597ff9[_0x2707('0x11')][_0x2707('0x13')]);return _0x745cfd(_0x597ff9[_0x2707('0x11')]['message']);}else{logger[_0x2707('0xb')](_0x2707('0xc'),_0x128205,_0x2707('0xd'));_0x745cfd(_0x597ff9['result'][_0x2707('0x13')]);}})[_0x2707('0x14')](function(_0x1a979e){logger[_0x2707('0x11')](_0x2707('0xc'),_0x128205,_0x1a979e);_0x4062b6(_0x1a979e);});});}exports[_0x2707('0x15')]=function(_0x4a8b7f){var _0x119ac4=this;return new Promise(function(_0x449a61,_0x4009f3){return db['VtigerAccount']['findAll']({'raw':_0x4a8b7f['options']?_0x4a8b7f[_0x2707('0x16')][_0x2707('0x17')]===undefined?!![]:![]:!![],'where':_0x4a8b7f[_0x2707('0x16')]?_0x4a8b7f[_0x2707('0x16')][_0x2707('0x18')]||null:null,'attributes':_0x4a8b7f[_0x2707('0x16')]?_0x4a8b7f[_0x2707('0x16')][_0x2707('0x19')]||null:null,'limit':_0x4a8b7f[_0x2707('0x16')]?_0x4a8b7f[_0x2707('0x16')][_0x2707('0x1a')]||null:null,'include':_0x4a8b7f[_0x2707('0x16')]?_0x4a8b7f[_0x2707('0x16')][_0x2707('0x1b')]?_['map'](_0x4a8b7f[_0x2707('0x16')][_0x2707('0x1b')],function(_0x46259e){return{'model':db[_0x46259e[_0x2707('0x1c')]],'as':_0x46259e['as'],'attributes':_0x46259e[_0x2707('0x19')],'include':_0x46259e[_0x2707('0x1b')]?_['map'](_0x46259e[_0x2707('0x1b')],function(_0x3f6976){return{'model':db[_0x3f6976[_0x2707('0x1c')]],'as':_0x3f6976['as'],'attributes':_0x3f6976[_0x2707('0x19')],'include':_0x3f6976[_0x2707('0x1b')]?_['map'](_0x3f6976[_0x2707('0x1b')],function(_0x4ca05d){return{'model':db[_0x4ca05d[_0x2707('0x1c')]],'as':_0x4ca05d['as'],'attributes':_0x4ca05d[_0x2707('0x19')]};}):[]};}):[]};}):[]:[]})[_0x2707('0x1d')](function(_0x57da26){logger[_0x2707('0xb')](_0x2707('0x15'),_0x4a8b7f);logger[_0x2707('0xe')]('GetVtigerAccount',_0x4a8b7f,JSON[_0x2707('0x10')](_0x57da26));_0x449a61(_0x57da26);})[_0x2707('0x14')](function(_0x4a99ce){logger[_0x2707('0x11')]('GetVtigerAccount',_0x4a99ce['message'],_0x4a8b7f);_0x4009f3(_0x119ac4[_0x2707('0x11')](0x1f4,_0x4a99ce['message']));});});};exports[_0x2707('0x1e')]=function(_0x3f153d){var _0x417a97=this;return new Promise(function(_0x36b2e9,_0x48832b){return db[_0x2707('0x1f')][_0x2707('0x20')]({'raw':_0x3f153d[_0x2707('0x16')]?_0x3f153d[_0x2707('0x16')][_0x2707('0x17')]===undefined?!![]:![]:!![],'where':_0x3f153d[_0x2707('0x16')]?_0x3f153d[_0x2707('0x16')][_0x2707('0x18')]||null:null,'attributes':_0x3f153d[_0x2707('0x16')]?_0x3f153d['options'][_0x2707('0x19')]||null:null,'include':_0x3f153d[_0x2707('0x16')]?_0x3f153d['options']['include']?_['map'](_0x3f153d['options']['include'],function(_0x137e04){return{'model':db[_0x137e04['model']],'as':_0x137e04['as'],'attributes':_0x137e04['attributes'],'include':_0x137e04[_0x2707('0x1b')]?_[_0x2707('0x21')](_0x137e04['include'],function(_0x473954){return{'model':db[_0x473954[_0x2707('0x1c')]],'as':_0x473954['as'],'attributes':_0x473954['attributes'],'include':_0x473954['include']?_[_0x2707('0x21')](_0x473954[_0x2707('0x1b')],function(_0x521edb){return{'model':db[_0x521edb['model']],'as':_0x521edb['as'],'attributes':_0x521edb[_0x2707('0x19')]};}):[]};}):[]};}):[]:[]})[_0x2707('0x1d')](function(_0x5a18b0){logger[_0x2707('0xb')](_0x2707('0x1e'),_0x3f153d);logger[_0x2707('0xe')](_0x2707('0x1e'),_0x3f153d,JSON[_0x2707('0x10')](_0x5a18b0));_0x36b2e9(_0x5a18b0);})[_0x2707('0x14')](function(_0x5bd2e5){logger[_0x2707('0x11')](_0x2707('0x1e'),_0x5bd2e5[_0x2707('0x13')],_0x3f153d);_0x48832b(_0x417a97[_0x2707('0x11')](0x1f4,_0x5bd2e5[_0x2707('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 945d863..9037fc8 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 _0x2434=['/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intVtigerConfiguration.controller','get','index','/:id','isAuthenticated','show'];(function(_0xd18bb2,_0x36a3ce){var _0x12261b=function(_0x13d980){while(--_0x13d980){_0xd18bb2['push'](_0xd18bb2['shift']());}};_0x12261b(++_0x36a3ce);}(_0x2434,0x12a));var _0x4243=function(_0x28b49c,_0x1586bd){_0x28b49c=_0x28b49c-0x0;var _0x27a145=_0x2434[_0x28b49c];return _0x27a145;};'use strict';var multer=require(_0x4243('0x0'));var util=require(_0x4243('0x1'));var path=require('path');var timeout=require(_0x4243('0x2'));var express=require(_0x4243('0x3'));var router=express[_0x4243('0x4')]();var fs_extra=require(_0x4243('0x5'));var auth=require(_0x4243('0x6'));var interaction=require(_0x4243('0x7'));var config=require('../../config/environment');var controller=require(_0x4243('0x8'));router[_0x4243('0x9')]('/',auth['isAuthenticated'](),controller[_0x4243('0xa')]);router[_0x4243('0x9')](_0x4243('0xb'),auth[_0x4243('0xc')](),controller[_0x4243('0xd')]);router[_0x4243('0x9')](_0x4243('0xe'),auth[_0x4243('0xc')](),controller[_0x4243('0xf')]);router[_0x4243('0x9')]('/:id/subjects',auth['isAuthenticated'](),controller[_0x4243('0x10')]);router[_0x4243('0x9')](_0x4243('0x11'),auth['isAuthenticated'](),controller[_0x4243('0x12')]);router[_0x4243('0x13')]('/',auth[_0x4243('0xc')](),controller[_0x4243('0x14')]);router[_0x4243('0x15')]('/:id',auth[_0x4243('0xc')](),controller[_0x4243('0x16')]);router['delete'](_0x4243('0xb'),auth[_0x4243('0xc')](),controller[_0x4243('0x17')]);module['exports']=router; \ No newline at end of file +var _0x6348=['put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/descriptions','getDescriptions'];(function(_0x38854e,_0x23cbc9){var _0x3f8415=function(_0x4e493e){while(--_0x4e493e){_0x38854e['push'](_0x38854e['shift']());}};_0x3f8415(++_0x23cbc9);}(_0x6348,0xa3));var _0x8634=function(_0x1faf34,_0x5a96e7){_0x1faf34=_0x1faf34-0x0;var _0x294624=_0x6348[_0x1faf34];return _0x294624;};'use strict';var multer=require(_0x8634('0x0'));var util=require(_0x8634('0x1'));var path=require(_0x8634('0x2'));var timeout=require(_0x8634('0x3'));var express=require(_0x8634('0x4'));var router=express[_0x8634('0x5')]();var fs_extra=require(_0x8634('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8634('0x7'));var controller=require(_0x8634('0x8'));router[_0x8634('0x9')]('/',auth[_0x8634('0xa')](),controller['index']);router[_0x8634('0x9')](_0x8634('0xb'),auth[_0x8634('0xa')](),controller[_0x8634('0xc')]);router['get'](_0x8634('0xd'),auth[_0x8634('0xa')](),controller[_0x8634('0xe')]);router['get']('/:id/subjects',auth[_0x8634('0xa')](),controller['getSubjects']);router[_0x8634('0x9')](_0x8634('0xf'),auth['isAuthenticated'](),controller[_0x8634('0x10')]);router['post']('/',auth[_0x8634('0xa')](),controller['create']);router[_0x8634('0x11')](_0x8634('0xb'),auth['isAuthenticated'](),controller[_0x8634('0x12')]);router['delete']('/:id',auth[_0x8634('0xa')](),controller['destroy']);module[_0x8634('0x13')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 8814ab6..f29e948 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 _0xc02b=['STRING','sequelize','exports'];(function(_0x59ecdf,_0x1cca4f){var _0x1a2c80=function(_0x14b296){while(--_0x14b296){_0x59ecdf['push'](_0x59ecdf['shift']());}};_0x1a2c80(++_0x1cca4f);}(_0xc02b,0x88));var _0xbc02=function(_0x50a1f6,_0x238fd8){_0x50a1f6=_0x50a1f6-0x0;var _0x84f8d4=_0xc02b[_0x50a1f6];return _0x84f8d4;};'use strict';var Sequelize=require(_0xbc02('0x0'));module[_0xbc02('0x1')]={'name':{'type':Sequelize[_0xbc02('0x2')]},'description':{'type':Sequelize[_0xbc02('0x2')]}}; \ No newline at end of file +var _0x064f=['STRING','sequelize'];(function(_0x43f968,_0xffc554){var _0x38993=function(_0x577b1d){while(--_0x577b1d){_0x43f968['push'](_0x43f968['shift']());}};_0x38993(++_0xffc554);}(_0x064f,0xb3));var _0xf064=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x064f[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0xf064('0x0'));module['exports']={'name':{'type':Sequelize[_0xf064('0x1')]},'description':{'type':Sequelize[_0xf064('0x1')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 87725bd..f35a0b8 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 _0xeca7=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','pick','filter','where','VIRTUAL','merge','options','count','includeAll','findAll','rows','catch','show','rawAttributes','find','create','body','params','sort','getFields','getSubjects','VtigerField','findOne','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','map','VtigerConfiguration','fieldName','type','key','model','query'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0xeca7,0xba));var _0x7eca=function(_0x539386,_0x4cbc27){_0x539386=_0x539386-0x0;var _0x3d370c=_0xeca7[_0x539386];return _0x3d370c;};'use strict';var emlformat=require(_0x7eca('0x0'));var rimraf=require(_0x7eca('0x1'));var zipdir=require(_0x7eca('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7eca('0x3'));var moment=require(_0x7eca('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7eca('0x5'));var util=require(_0x7eca('0x6'));var path=require('path');var sox=require(_0x7eca('0x7'));var csv=require(_0x7eca('0x8'));var ejs=require(_0x7eca('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7eca('0xa'));var squel=require(_0x7eca('0xb'));var crypto=require(_0x7eca('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x7eca('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7eca('0xe'));var Redis=require('ioredis');var authService=require(_0x7eca('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x7eca('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7eca('0x11'));var utils=require(_0x7eca('0x12'));var config=require(_0x7eca('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x7eca('0x14'))['db'];function respondWithStatusCode(_0x215e7b,_0x4ec732){_0x4ec732=_0x4ec732||0xcc;return function(_0x50376c){if(_0x50376c){return _0x215e7b[_0x7eca('0x15')](_0x4ec732);}return _0x215e7b[_0x7eca('0x16')](_0x4ec732)[_0x7eca('0x17')]();};}function respondWithResult(_0x4161ae,_0x3db83c){_0x3db83c=_0x3db83c||0xc8;return function(_0xe09302){if(_0xe09302){return _0x4161ae[_0x7eca('0x16')](_0x3db83c)['json'](_0xe09302);}};}function respondWithFilteredResult(_0x38b246,_0x7d640e){return function(_0x11aa7e){if(_0x11aa7e){var _0x3f70a2=typeof _0x7d640e[_0x7eca('0x18')]===_0x7eca('0x19')&&typeof _0x7d640e[_0x7eca('0x1a')]===_0x7eca('0x19');var _0x4ae0bc=_0x11aa7e['count'];var _0xc91f60=_0x3f70a2?0x0:_0x7d640e[_0x7eca('0x18')];var _0x499e44=_0x3f70a2?_0x11aa7e['count']:_0x7d640e[_0x7eca('0x18')]+_0x7d640e[_0x7eca('0x1a')];var _0x242dad;if(_0x499e44>=_0x4ae0bc){_0x499e44=_0x4ae0bc;_0x242dad=0xc8;}else{_0x242dad=0xce;}_0x38b246['status'](_0x242dad);return _0x38b246[_0x7eca('0x1b')](_0x7eca('0x1c'),_0xc91f60+'-'+_0x499e44+'/'+_0x4ae0bc)['json'](_0x11aa7e);}return null;};}function patchUpdates(_0x21a6e2){return function(_0x2b1c00){try{jsonpatch['apply'](_0x2b1c00,_0x21a6e2,!![]);}catch(_0x1b26ca){return BPromise[_0x7eca('0x1d')](_0x1b26ca);}return _0x2b1c00[_0x7eca('0x1e')]();};}function saveUpdates(_0x2ef737,_0x332d79){return function(_0x5a0970){if(_0x5a0970){return _0x5a0970[_0x7eca('0x1f')](_0x2ef737)[_0x7eca('0x20')](function(_0x42f31b){return _0x42f31b;});}return null;};}function removeEntity(_0x4de8c3,_0x1c1615){return function(_0x185021){if(_0x185021){return _0x185021[_0x7eca('0x21')]()['then'](function(){_0x4de8c3[_0x7eca('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5bcd46,_0x1d0463){return function(_0x330e98){if(!_0x330e98){_0x5bcd46[_0x7eca('0x15')](0x194);}return _0x330e98;};}function handleError(_0x2171aa,_0x5df84e){_0x5df84e=_0x5df84e||0x1f4;return function(_0x4deec1){logger[_0x7eca('0x22')](_0x4deec1[_0x7eca('0x23')]);if(_0x4deec1['name']){delete _0x4deec1[_0x7eca('0x24')];}_0x2171aa['status'](_0x5df84e)[_0x7eca('0x25')](_0x4deec1);};}exports['index']=function(_0x13fdf1,_0x4019d9){var _0x32089c={},_0x1fc224={},_0x311341={'count':0x0,'rows':[]};var _0x349e0c=_[_0x7eca('0x26')](db[_0x7eca('0x27')]['rawAttributes'],function(_0x2bd8ef){return{'name':_0x2bd8ef[_0x7eca('0x28')],'type':_0x2bd8ef[_0x7eca('0x29')][_0x7eca('0x2a')]};});_0x1fc224[_0x7eca('0x2b')]=_[_0x7eca('0x26')](_0x349e0c,_0x7eca('0x24'));_0x1fc224[_0x7eca('0x2c')]=_[_0x7eca('0x2d')](_0x13fdf1[_0x7eca('0x2c')]);_0x1fc224[_0x7eca('0x2e')]=_[_0x7eca('0x2f')](_0x1fc224[_0x7eca('0x2b')],_0x1fc224[_0x7eca('0x2c')]);_0x32089c[_0x7eca('0x30')]=_['intersection'](_0x1fc224['model'],qs[_0x7eca('0x31')](_0x13fdf1[_0x7eca('0x2c')][_0x7eca('0x31')]));_0x32089c['attributes']=_0x32089c['attributes'][_0x7eca('0x32')]?_0x32089c[_0x7eca('0x30')]:_0x1fc224[_0x7eca('0x2b')];if(!_0x13fdf1[_0x7eca('0x2c')][_0x7eca('0x33')](_0x7eca('0x34'))){_0x32089c[_0x7eca('0x1a')]=qs[_0x7eca('0x1a')](_0x13fdf1['query']['limit']);_0x32089c['offset']=qs[_0x7eca('0x18')](_0x13fdf1[_0x7eca('0x2c')][_0x7eca('0x18')]);}_0x32089c[_0x7eca('0x35')]=qs['sort'](_0x13fdf1['query']['sort']);_0x32089c['where']=qs['filters'](_[_0x7eca('0x36')](_0x13fdf1[_0x7eca('0x2c')],_0x1fc224[_0x7eca('0x2e')]),_0x349e0c);if(_0x13fdf1[_0x7eca('0x2c')][_0x7eca('0x37')]){_0x32089c['where']=_['merge'](_0x32089c[_0x7eca('0x38')],{'$or':_['map'](_0x349e0c,function(_0x31805c){if(_0x31805c[_0x7eca('0x29')]!==_0x7eca('0x39')){var _0x1ec9e5={};_0x1ec9e5[_0x31805c[_0x7eca('0x24')]]={'$like':'%'+_0x13fdf1[_0x7eca('0x2c')]['filter']+'%'};return _0x1ec9e5;}})});}_0x32089c=_[_0x7eca('0x3a')]({},_0x32089c,_0x13fdf1[_0x7eca('0x3b')]);var _0x5deeb2={'where':_0x32089c['where']};return db[_0x7eca('0x27')][_0x7eca('0x3c')](_0x5deeb2)[_0x7eca('0x20')](function(_0x4c1fde){_0x311341['count']=_0x4c1fde;if(_0x13fdf1[_0x7eca('0x2c')][_0x7eca('0x3d')]){_0x32089c['include']=[{'all':!![]}];}return db['VtigerConfiguration'][_0x7eca('0x3e')](_0x32089c);})[_0x7eca('0x20')](function(_0x20a9de){_0x311341[_0x7eca('0x3f')]=_0x20a9de;return _0x311341;})[_0x7eca('0x20')](respondWithFilteredResult(_0x4019d9,_0x32089c))[_0x7eca('0x40')](handleError(_0x4019d9,null));};exports[_0x7eca('0x41')]=function(_0xf61005,_0x3d2d7b){var _0x38b296={'raw':![],'where':{'id':_0xf61005['params']['id']}},_0x53d0aa={};_0x53d0aa['model']=_['keys'](db[_0x7eca('0x27')][_0x7eca('0x42')]);_0x53d0aa[_0x7eca('0x2c')]=_[_0x7eca('0x2d')](_0xf61005[_0x7eca('0x2c')]);_0x53d0aa[_0x7eca('0x2e')]=_[_0x7eca('0x2f')](_0x53d0aa[_0x7eca('0x2b')],_0x53d0aa[_0x7eca('0x2c')]);_0x38b296[_0x7eca('0x30')]=_[_0x7eca('0x2f')](_0x53d0aa['model'],qs[_0x7eca('0x31')](_0xf61005[_0x7eca('0x2c')]['fields']));_0x38b296[_0x7eca('0x30')]=_0x38b296[_0x7eca('0x30')][_0x7eca('0x32')]?_0x38b296[_0x7eca('0x30')]:_0x53d0aa['model'];if(_0xf61005['query'][_0x7eca('0x3d')]){_0x38b296['include']=[{'all':!![]}];}_0x38b296=_['merge']({},_0x38b296,_0xf61005[_0x7eca('0x3b')]);return db[_0x7eca('0x27')][_0x7eca('0x43')](_0x38b296)[_0x7eca('0x20')](handleEntityNotFound(_0x3d2d7b,null))[_0x7eca('0x20')](respondWithResult(_0x3d2d7b,null))[_0x7eca('0x40')](handleError(_0x3d2d7b,null));};exports[_0x7eca('0x44')]=function(_0x61d8c0,_0x1b27d8){return db[_0x7eca('0x27')][_0x7eca('0x44')](_0x61d8c0['body'],{})[_0x7eca('0x20')](respondWithResult(_0x1b27d8,0xc9))['catch'](handleError(_0x1b27d8,null));};exports[_0x7eca('0x1f')]=function(_0x21359b,_0x4e834a){if(_0x21359b[_0x7eca('0x45')]['id']){delete _0x21359b[_0x7eca('0x45')]['id'];}return db[_0x7eca('0x27')][_0x7eca('0x43')]({'where':{'id':_0x21359b[_0x7eca('0x46')]['id']}})[_0x7eca('0x20')](handleEntityNotFound(_0x4e834a,null))[_0x7eca('0x20')](saveUpdates(_0x21359b['body'],null))[_0x7eca('0x20')](respondWithResult(_0x4e834a,null))[_0x7eca('0x40')](handleError(_0x4e834a,null));};exports['destroy']=function(_0x8a40bb,_0x59f81f){return db['VtigerConfiguration'][_0x7eca('0x43')]({'where':{'id':_0x8a40bb[_0x7eca('0x46')]['id']}})['then'](handleEntityNotFound(_0x59f81f,null))['then'](removeEntity(_0x59f81f,null))['catch'](handleError(_0x59f81f,null));};exports['getFields']=function(_0x3504bd,_0x30aafd,_0x579181){var _0x2d36ac={};var _0x2afa80={};var _0x11be74;var _0x2131e9;return db[_0x7eca('0x27')]['findOne']({'where':{'id':_0x3504bd[_0x7eca('0x46')]['id']}})[_0x7eca('0x20')](handleEntityNotFound(_0x30aafd,null))[_0x7eca('0x20')](function(_0x278a1a){if(_0x278a1a){_0x11be74=_0x278a1a;_0x2afa80[_0x7eca('0x2b')]=_[_0x7eca('0x2d')](db['VtigerField'][_0x7eca('0x42')]);_0x2afa80[_0x7eca('0x2c')]=_['keys'](_0x3504bd[_0x7eca('0x2c')]);_0x2afa80[_0x7eca('0x2e')]=_['intersection'](_0x2afa80[_0x7eca('0x2b')],_0x2afa80[_0x7eca('0x2c')]);_0x2d36ac[_0x7eca('0x30')]=_[_0x7eca('0x2f')](_0x2afa80[_0x7eca('0x2b')],qs[_0x7eca('0x31')](_0x3504bd[_0x7eca('0x2c')]['fields']));_0x2d36ac[_0x7eca('0x30')]=_0x2d36ac['attributes'][_0x7eca('0x32')]?_0x2d36ac[_0x7eca('0x30')]:_0x2afa80[_0x7eca('0x2b')];_0x2d36ac[_0x7eca('0x35')]=qs[_0x7eca('0x47')](_0x3504bd[_0x7eca('0x2c')]['sort']);_0x2d36ac[_0x7eca('0x38')]=qs[_0x7eca('0x2e')](_[_0x7eca('0x36')](_0x3504bd[_0x7eca('0x2c')],_0x2afa80[_0x7eca('0x2e')]));if(_0x3504bd['query'][_0x7eca('0x37')]){_0x2d36ac[_0x7eca('0x38')]=_[_0x7eca('0x3a')](_0x2d36ac[_0x7eca('0x38')],{'$or':_[_0x7eca('0x26')](_0x2d36ac[_0x7eca('0x30')],function(_0xbbb4c2){var _0x217341={};_0x217341[_0xbbb4c2]={'$like':'%'+_0x3504bd[_0x7eca('0x2c')][_0x7eca('0x37')]+'%'};return _0x217341;})});}_0x2d36ac=_['merge']({},_0x2d36ac,_0x3504bd['options']);return _0x11be74[_0x7eca('0x48')](_0x2d36ac);}})[_0x7eca('0x20')](function(_0x3aa627){if(_0x3aa627){_0x2131e9=_0x3aa627[_0x7eca('0x32')];if(!_0x3504bd['query'][_0x7eca('0x33')]('nolimit')){_0x2d36ac[_0x7eca('0x1a')]=qs['limit'](_0x3504bd[_0x7eca('0x2c')][_0x7eca('0x1a')]);_0x2d36ac[_0x7eca('0x18')]=qs['offset'](_0x3504bd[_0x7eca('0x2c')]['offset']);}return _0x11be74[_0x7eca('0x48')](_0x2d36ac);}})[_0x7eca('0x20')](function(_0x3488b3){if(_0x3488b3){return _0x3488b3?{'count':_0x2131e9,'rows':_0x3488b3}:null;}})[_0x7eca('0x20')](respondWithResult(_0x30aafd,null))[_0x7eca('0x40')](handleError(_0x30aafd,null));};exports[_0x7eca('0x49')]=function(_0xcdb002,_0x56c81c,_0x35e6d7){var _0xe1e0a9={};var _0x5ef87f={};var _0x3711af;var _0x4830f6;return db[_0x7eca('0x27')]['findOne']({'where':{'id':_0xcdb002[_0x7eca('0x46')]['id']}})[_0x7eca('0x20')](handleEntityNotFound(_0x56c81c,null))[_0x7eca('0x20')](function(_0x5ce1fe){if(_0x5ce1fe){_0x3711af=_0x5ce1fe;_0x5ef87f[_0x7eca('0x2b')]=_['keys'](db[_0x7eca('0x4a')][_0x7eca('0x42')]);_0x5ef87f[_0x7eca('0x2c')]=_['keys'](_0xcdb002[_0x7eca('0x2c')]);_0x5ef87f['filters']=_[_0x7eca('0x2f')](_0x5ef87f[_0x7eca('0x2b')],_0x5ef87f[_0x7eca('0x2c')]);_0xe1e0a9[_0x7eca('0x30')]=_[_0x7eca('0x2f')](_0x5ef87f[_0x7eca('0x2b')],qs[_0x7eca('0x31')](_0xcdb002[_0x7eca('0x2c')][_0x7eca('0x31')]));_0xe1e0a9[_0x7eca('0x30')]=_0xe1e0a9[_0x7eca('0x30')]['length']?_0xe1e0a9[_0x7eca('0x30')]:_0x5ef87f[_0x7eca('0x2b')];_0xe1e0a9[_0x7eca('0x35')]=qs[_0x7eca('0x47')](_0xcdb002[_0x7eca('0x2c')][_0x7eca('0x47')]);_0xe1e0a9['where']=qs[_0x7eca('0x2e')](_[_0x7eca('0x36')](_0xcdb002['query'],_0x5ef87f[_0x7eca('0x2e')]));if(_0xcdb002[_0x7eca('0x2c')][_0x7eca('0x37')]){_0xe1e0a9[_0x7eca('0x38')]=_[_0x7eca('0x3a')](_0xe1e0a9[_0x7eca('0x38')],{'$or':_[_0x7eca('0x26')](_0xe1e0a9[_0x7eca('0x30')],function(_0x3a5497){var _0x188665={};_0x188665[_0x3a5497]={'$like':'%'+_0xcdb002[_0x7eca('0x2c')][_0x7eca('0x37')]+'%'};return _0x188665;})});}_0xe1e0a9=_[_0x7eca('0x3a')]({},_0xe1e0a9,_0xcdb002[_0x7eca('0x3b')]);return _0x3711af[_0x7eca('0x49')](_0xe1e0a9);}})[_0x7eca('0x20')](function(_0x5c85c9){if(_0x5c85c9){_0x4830f6=_0x5c85c9[_0x7eca('0x32')];if(!_0xcdb002[_0x7eca('0x2c')]['hasOwnProperty'](_0x7eca('0x34'))){_0xe1e0a9['limit']=qs[_0x7eca('0x1a')](_0xcdb002[_0x7eca('0x2c')][_0x7eca('0x1a')]);_0xe1e0a9['offset']=qs[_0x7eca('0x18')](_0xcdb002[_0x7eca('0x2c')]['offset']);}return _0x3711af[_0x7eca('0x49')](_0xe1e0a9);}})[_0x7eca('0x20')](function(_0x107665){if(_0x107665){return _0x107665?{'count':_0x4830f6,'rows':_0x107665}:null;}})[_0x7eca('0x20')](respondWithResult(_0x56c81c,null))['catch'](handleError(_0x56c81c,null));};exports['getDescriptions']=function(_0x73b229,_0x15c6a6,_0x590f88){var _0x3d5dc9={};var _0x1b89e2={};var _0x215380;var _0x84c313;return db['VtigerConfiguration'][_0x7eca('0x4b')]({'where':{'id':_0x73b229[_0x7eca('0x46')]['id']}})[_0x7eca('0x20')](handleEntityNotFound(_0x15c6a6,null))['then'](function(_0x1c0197){if(_0x1c0197){_0x215380=_0x1c0197;_0x1b89e2[_0x7eca('0x2b')]=_[_0x7eca('0x2d')](db[_0x7eca('0x4a')][_0x7eca('0x42')]);_0x1b89e2[_0x7eca('0x2c')]=_['keys'](_0x73b229['query']);_0x1b89e2[_0x7eca('0x2e')]=_['intersection'](_0x1b89e2['model'],_0x1b89e2[_0x7eca('0x2c')]);_0x3d5dc9[_0x7eca('0x30')]=_['intersection'](_0x1b89e2[_0x7eca('0x2b')],qs[_0x7eca('0x31')](_0x73b229['query'][_0x7eca('0x31')]));_0x3d5dc9[_0x7eca('0x30')]=_0x3d5dc9[_0x7eca('0x30')][_0x7eca('0x32')]?_0x3d5dc9['attributes']:_0x1b89e2[_0x7eca('0x2b')];_0x3d5dc9[_0x7eca('0x35')]=qs['sort'](_0x73b229[_0x7eca('0x2c')][_0x7eca('0x47')]);_0x3d5dc9[_0x7eca('0x38')]=qs[_0x7eca('0x2e')](_['pick'](_0x73b229[_0x7eca('0x2c')],_0x1b89e2[_0x7eca('0x2e')]));if(_0x73b229['query'][_0x7eca('0x37')]){_0x3d5dc9[_0x7eca('0x38')]=_[_0x7eca('0x3a')](_0x3d5dc9[_0x7eca('0x38')],{'$or':_[_0x7eca('0x26')](_0x3d5dc9[_0x7eca('0x30')],function(_0x211fcf){var _0xb54302={};_0xb54302[_0x211fcf]={'$like':'%'+_0x73b229[_0x7eca('0x2c')][_0x7eca('0x37')]+'%'};return _0xb54302;})});}_0x3d5dc9=_[_0x7eca('0x3a')]({},_0x3d5dc9,_0x73b229[_0x7eca('0x3b')]);return _0x215380[_0x7eca('0x4c')](_0x3d5dc9);}})[_0x7eca('0x20')](function(_0x20fa91){if(_0x20fa91){_0x84c313=_0x20fa91['length'];if(!_0x73b229[_0x7eca('0x2c')][_0x7eca('0x33')]('nolimit')){_0x3d5dc9[_0x7eca('0x1a')]=qs[_0x7eca('0x1a')](_0x73b229[_0x7eca('0x2c')][_0x7eca('0x1a')]);_0x3d5dc9[_0x7eca('0x18')]=qs[_0x7eca('0x18')](_0x73b229[_0x7eca('0x2c')][_0x7eca('0x18')]);}return _0x215380[_0x7eca('0x4c')](_0x3d5dc9);}})['then'](function(_0x135ede){if(_0x135ede){return _0x135ede?{'count':_0x84c313,'rows':_0x135ede}:null;}})[_0x7eca('0x20')](respondWithResult(_0x15c6a6,null))[_0x7eca('0x40')](handleError(_0x15c6a6,null));}; \ No newline at end of file +var _0xba47=['../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','set','reject','then','destroy','sendStatus','name','send','index','map','VtigerConfiguration','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','options','include','rows','catch','params','rawAttributes','create','update','body','find','getFields','VtigerField','length','getSubjects','findOne','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x42dd8d,_0x11db83){var _0x2539c9=function(_0x175921){while(--_0x175921){_0x42dd8d['push'](_0x42dd8d['shift']());}};_0x2539c9(++_0x11db83);}(_0xba47,0x1ac));var _0x7ba4=function(_0x3fd9b8,_0x375ec2){_0x3fd9b8=_0x3fd9b8-0x0;var _0x648cb0=_0xba47[_0x3fd9b8];return _0x648cb0;};'use strict';var emlformat=require(_0x7ba4('0x0'));var rimraf=require(_0x7ba4('0x1'));var zipdir=require(_0x7ba4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7ba4('0x3'));var moment=require(_0x7ba4('0x4'));var BPromise=require(_0x7ba4('0x5'));var Mustache=require(_0x7ba4('0x6'));var util=require('util');var path=require(_0x7ba4('0x7'));var sox=require(_0x7ba4('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7ba4('0x9'));var _=require(_0x7ba4('0xa'));var squel=require(_0x7ba4('0xb'));var crypto=require(_0x7ba4('0xc'));var jsforce=require(_0x7ba4('0xd'));var deskjs=require(_0x7ba4('0xe'));var toCsv=require(_0x7ba4('0xf'));var querystring=require(_0x7ba4('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7ba4('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x7ba4('0x12'));var hardwareService=require(_0x7ba4('0x13'));var logger=require(_0x7ba4('0x14'))(_0x7ba4('0x15'));var utils=require('../../config/utils');var config=require(_0x7ba4('0x16'));var licenseUtil=require(_0x7ba4('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x83d2c,_0x266be2){_0x266be2=_0x266be2||0xcc;return function(_0x2fdee0){if(_0x2fdee0){return _0x83d2c['sendStatus'](_0x266be2);}return _0x83d2c[_0x7ba4('0x18')](_0x266be2)[_0x7ba4('0x19')]();};}function respondWithResult(_0x26da9d,_0x471e93){_0x471e93=_0x471e93||0xc8;return function(_0xcf45f6){if(_0xcf45f6){return _0x26da9d[_0x7ba4('0x18')](_0x471e93)[_0x7ba4('0x1a')](_0xcf45f6);}};}function respondWithFilteredResult(_0x1e16c5,_0x3197d9){return function(_0x480e0b){if(_0x480e0b){var _0x4b0fb7=typeof _0x3197d9[_0x7ba4('0x1b')]===_0x7ba4('0x1c')&&typeof _0x3197d9['limit']===_0x7ba4('0x1c');var _0xbc6330=_0x480e0b[_0x7ba4('0x1d')];var _0xd5bdde=_0x4b0fb7?0x0:_0x3197d9[_0x7ba4('0x1b')];var _0x988f2f=_0x4b0fb7?_0x480e0b[_0x7ba4('0x1d')]:_0x3197d9[_0x7ba4('0x1b')]+_0x3197d9['limit'];var _0x5d14ba;if(_0x988f2f>=_0xbc6330){_0x988f2f=_0xbc6330;_0x5d14ba=0xc8;}else{_0x5d14ba=0xce;}_0x1e16c5[_0x7ba4('0x18')](_0x5d14ba);return _0x1e16c5[_0x7ba4('0x1e')]('Content-Range',_0xd5bdde+'-'+_0x988f2f+'/'+_0xbc6330)[_0x7ba4('0x1a')](_0x480e0b);}return null;};}function patchUpdates(_0x14a214){return function(_0x3601ba){try{jsonpatch['apply'](_0x3601ba,_0x14a214,!![]);}catch(_0x5b1dde){return BPromise[_0x7ba4('0x1f')](_0x5b1dde);}return _0x3601ba['save']();};}function saveUpdates(_0x4bd364,_0x225b6a){return function(_0x4dffd7){if(_0x4dffd7){return _0x4dffd7['update'](_0x4bd364)[_0x7ba4('0x20')](function(_0x246943){return _0x246943;});}return null;};}function removeEntity(_0x3a3c67,_0x413a67){return function(_0x2afc11){if(_0x2afc11){return _0x2afc11[_0x7ba4('0x21')]()[_0x7ba4('0x20')](function(){_0x3a3c67['status'](0xcc)[_0x7ba4('0x19')]();});}};}function handleEntityNotFound(_0x34ee62,_0x10508e){return function(_0x3c679c){if(!_0x3c679c){_0x34ee62[_0x7ba4('0x22')](0x194);}return _0x3c679c;};}function handleError(_0x28c51c,_0x4f0ce5){_0x4f0ce5=_0x4f0ce5||0x1f4;return function(_0x901837){logger['error'](_0x901837['stack']);if(_0x901837['name']){delete _0x901837[_0x7ba4('0x23')];}_0x28c51c[_0x7ba4('0x18')](_0x4f0ce5)[_0x7ba4('0x24')](_0x901837);};}exports[_0x7ba4('0x25')]=function(_0x37d8cd,_0x494754){var _0x315cdb={},_0x45be5c={},_0xfb47a5={'count':0x0,'rows':[]};var _0x40a6fb=_[_0x7ba4('0x26')](db[_0x7ba4('0x27')]['rawAttributes'],function(_0x4fdbc7){return{'name':_0x4fdbc7[_0x7ba4('0x28')],'type':_0x4fdbc7[_0x7ba4('0x29')][_0x7ba4('0x2a')]};});_0x45be5c[_0x7ba4('0x2b')]=_[_0x7ba4('0x26')](_0x40a6fb,_0x7ba4('0x23'));_0x45be5c[_0x7ba4('0x2c')]=_[_0x7ba4('0x2d')](_0x37d8cd[_0x7ba4('0x2c')]);_0x45be5c[_0x7ba4('0x2e')]=_['intersection'](_0x45be5c[_0x7ba4('0x2b')],_0x45be5c[_0x7ba4('0x2c')]);_0x315cdb['attributes']=_[_0x7ba4('0x2f')](_0x45be5c[_0x7ba4('0x2b')],qs['fields'](_0x37d8cd[_0x7ba4('0x2c')][_0x7ba4('0x30')]));_0x315cdb['attributes']=_0x315cdb[_0x7ba4('0x31')]['length']?_0x315cdb['attributes']:_0x45be5c[_0x7ba4('0x2b')];if(!_0x37d8cd['query'][_0x7ba4('0x32')](_0x7ba4('0x33'))){_0x315cdb[_0x7ba4('0x34')]=qs[_0x7ba4('0x34')](_0x37d8cd[_0x7ba4('0x2c')][_0x7ba4('0x34')]);_0x315cdb['offset']=qs[_0x7ba4('0x1b')](_0x37d8cd[_0x7ba4('0x2c')][_0x7ba4('0x1b')]);}_0x315cdb[_0x7ba4('0x35')]=qs['sort'](_0x37d8cd[_0x7ba4('0x2c')][_0x7ba4('0x36')]);_0x315cdb[_0x7ba4('0x37')]=qs[_0x7ba4('0x2e')](_[_0x7ba4('0x38')](_0x37d8cd['query'],_0x45be5c[_0x7ba4('0x2e')]),_0x40a6fb);if(_0x37d8cd[_0x7ba4('0x2c')][_0x7ba4('0x39')]){_0x315cdb['where']=_[_0x7ba4('0x3a')](_0x315cdb[_0x7ba4('0x37')],{'$or':_[_0x7ba4('0x26')](_0x40a6fb,function(_0x498520){if(_0x498520[_0x7ba4('0x29')]!=='VIRTUAL'){var _0x21c7f8={};_0x21c7f8[_0x498520['name']]={'$like':'%'+_0x37d8cd[_0x7ba4('0x2c')][_0x7ba4('0x39')]+'%'};return _0x21c7f8;}})});}_0x315cdb=_[_0x7ba4('0x3a')]({},_0x315cdb,_0x37d8cd[_0x7ba4('0x3b')]);var _0x2307ef={'where':_0x315cdb[_0x7ba4('0x37')]};return db[_0x7ba4('0x27')][_0x7ba4('0x1d')](_0x2307ef)[_0x7ba4('0x20')](function(_0x234182){_0xfb47a5['count']=_0x234182;if(_0x37d8cd['query']['includeAll']){_0x315cdb[_0x7ba4('0x3c')]=[{'all':!![]}];}return db[_0x7ba4('0x27')]['findAll'](_0x315cdb);})[_0x7ba4('0x20')](function(_0x3daf6f){_0xfb47a5[_0x7ba4('0x3d')]=_0x3daf6f;return _0xfb47a5;})['then'](respondWithFilteredResult(_0x494754,_0x315cdb))[_0x7ba4('0x3e')](handleError(_0x494754,null));};exports['show']=function(_0x21338c,_0x242b7e){var _0x306e4e={'raw':![],'where':{'id':_0x21338c[_0x7ba4('0x3f')]['id']}},_0x35b21a={};_0x35b21a['model']=_['keys'](db[_0x7ba4('0x27')][_0x7ba4('0x40')]);_0x35b21a[_0x7ba4('0x2c')]=_['keys'](_0x21338c[_0x7ba4('0x2c')]);_0x35b21a['filters']=_[_0x7ba4('0x2f')](_0x35b21a[_0x7ba4('0x2b')],_0x35b21a['query']);_0x306e4e[_0x7ba4('0x31')]=_[_0x7ba4('0x2f')](_0x35b21a[_0x7ba4('0x2b')],qs[_0x7ba4('0x30')](_0x21338c[_0x7ba4('0x2c')][_0x7ba4('0x30')]));_0x306e4e[_0x7ba4('0x31')]=_0x306e4e[_0x7ba4('0x31')]['length']?_0x306e4e[_0x7ba4('0x31')]:_0x35b21a[_0x7ba4('0x2b')];if(_0x21338c[_0x7ba4('0x2c')]['includeAll']){_0x306e4e[_0x7ba4('0x3c')]=[{'all':!![]}];}_0x306e4e=_['merge']({},_0x306e4e,_0x21338c[_0x7ba4('0x3b')]);return db[_0x7ba4('0x27')]['find'](_0x306e4e)[_0x7ba4('0x20')](handleEntityNotFound(_0x242b7e,null))[_0x7ba4('0x20')](respondWithResult(_0x242b7e,null))[_0x7ba4('0x3e')](handleError(_0x242b7e,null));};exports['create']=function(_0x2ce0c0,_0x3000cf){return db['VtigerConfiguration'][_0x7ba4('0x41')](_0x2ce0c0['body'],{})[_0x7ba4('0x20')](respondWithResult(_0x3000cf,0xc9))[_0x7ba4('0x3e')](handleError(_0x3000cf,null));};exports[_0x7ba4('0x42')]=function(_0x4e62d6,_0x448cb5){if(_0x4e62d6[_0x7ba4('0x43')]['id']){delete _0x4e62d6[_0x7ba4('0x43')]['id'];}return db['VtigerConfiguration']['find']({'where':{'id':_0x4e62d6[_0x7ba4('0x3f')]['id']}})['then'](handleEntityNotFound(_0x448cb5,null))[_0x7ba4('0x20')](saveUpdates(_0x4e62d6['body'],null))[_0x7ba4('0x20')](respondWithResult(_0x448cb5,null))['catch'](handleError(_0x448cb5,null));};exports[_0x7ba4('0x21')]=function(_0x7044cc,_0x4946ae){return db[_0x7ba4('0x27')][_0x7ba4('0x44')]({'where':{'id':_0x7044cc[_0x7ba4('0x3f')]['id']}})[_0x7ba4('0x20')](handleEntityNotFound(_0x4946ae,null))[_0x7ba4('0x20')](removeEntity(_0x4946ae,null))['catch'](handleError(_0x4946ae,null));};exports[_0x7ba4('0x45')]=function(_0x1dfa4b,_0xd6d1da,_0xed34b2){var _0x5645f3={};var _0x104690={};var _0x26a000;var _0x18609d;return db[_0x7ba4('0x27')]['findOne']({'where':{'id':_0x1dfa4b[_0x7ba4('0x3f')]['id']}})[_0x7ba4('0x20')](handleEntityNotFound(_0xd6d1da,null))[_0x7ba4('0x20')](function(_0x3ffc1d){if(_0x3ffc1d){_0x26a000=_0x3ffc1d;_0x104690[_0x7ba4('0x2b')]=_[_0x7ba4('0x2d')](db[_0x7ba4('0x46')]['rawAttributes']);_0x104690['query']=_[_0x7ba4('0x2d')](_0x1dfa4b[_0x7ba4('0x2c')]);_0x104690[_0x7ba4('0x2e')]=_[_0x7ba4('0x2f')](_0x104690[_0x7ba4('0x2b')],_0x104690['query']);_0x5645f3['attributes']=_['intersection'](_0x104690['model'],qs[_0x7ba4('0x30')](_0x1dfa4b[_0x7ba4('0x2c')][_0x7ba4('0x30')]));_0x5645f3['attributes']=_0x5645f3[_0x7ba4('0x31')]['length']?_0x5645f3[_0x7ba4('0x31')]:_0x104690[_0x7ba4('0x2b')];_0x5645f3[_0x7ba4('0x35')]=qs[_0x7ba4('0x36')](_0x1dfa4b[_0x7ba4('0x2c')][_0x7ba4('0x36')]);_0x5645f3[_0x7ba4('0x37')]=qs[_0x7ba4('0x2e')](_[_0x7ba4('0x38')](_0x1dfa4b[_0x7ba4('0x2c')],_0x104690['filters']));if(_0x1dfa4b[_0x7ba4('0x2c')]['filter']){_0x5645f3['where']=_[_0x7ba4('0x3a')](_0x5645f3['where'],{'$or':_[_0x7ba4('0x26')](_0x5645f3[_0x7ba4('0x31')],function(_0x347cec){var _0x1a0436={};_0x1a0436[_0x347cec]={'$like':'%'+_0x1dfa4b[_0x7ba4('0x2c')][_0x7ba4('0x39')]+'%'};return _0x1a0436;})});}_0x5645f3=_[_0x7ba4('0x3a')]({},_0x5645f3,_0x1dfa4b[_0x7ba4('0x3b')]);return _0x26a000['getFields'](_0x5645f3);}})['then'](function(_0x10f248){if(_0x10f248){_0x18609d=_0x10f248[_0x7ba4('0x47')];if(!_0x1dfa4b[_0x7ba4('0x2c')]['hasOwnProperty'](_0x7ba4('0x33'))){_0x5645f3[_0x7ba4('0x34')]=qs[_0x7ba4('0x34')](_0x1dfa4b[_0x7ba4('0x2c')]['limit']);_0x5645f3['offset']=qs[_0x7ba4('0x1b')](_0x1dfa4b[_0x7ba4('0x2c')]['offset']);}return _0x26a000[_0x7ba4('0x45')](_0x5645f3);}})['then'](function(_0x3f5a1c){if(_0x3f5a1c){return _0x3f5a1c?{'count':_0x18609d,'rows':_0x3f5a1c}:null;}})[_0x7ba4('0x20')](respondWithResult(_0xd6d1da,null))[_0x7ba4('0x3e')](handleError(_0xd6d1da,null));};exports[_0x7ba4('0x48')]=function(_0x197137,_0x281511,_0x480cb4){var _0x5c0c62={};var _0x556ac5={};var _0x1f1c6e;var _0x1d0ad6;return db[_0x7ba4('0x27')][_0x7ba4('0x49')]({'where':{'id':_0x197137['params']['id']}})[_0x7ba4('0x20')](handleEntityNotFound(_0x281511,null))['then'](function(_0x3bf8c0){if(_0x3bf8c0){_0x1f1c6e=_0x3bf8c0;_0x556ac5['model']=_[_0x7ba4('0x2d')](db[_0x7ba4('0x46')]['rawAttributes']);_0x556ac5[_0x7ba4('0x2c')]=_[_0x7ba4('0x2d')](_0x197137[_0x7ba4('0x2c')]);_0x556ac5['filters']=_[_0x7ba4('0x2f')](_0x556ac5[_0x7ba4('0x2b')],_0x556ac5['query']);_0x5c0c62[_0x7ba4('0x31')]=_['intersection'](_0x556ac5[_0x7ba4('0x2b')],qs[_0x7ba4('0x30')](_0x197137[_0x7ba4('0x2c')][_0x7ba4('0x30')]));_0x5c0c62[_0x7ba4('0x31')]=_0x5c0c62[_0x7ba4('0x31')][_0x7ba4('0x47')]?_0x5c0c62[_0x7ba4('0x31')]:_0x556ac5[_0x7ba4('0x2b')];_0x5c0c62[_0x7ba4('0x35')]=qs['sort'](_0x197137[_0x7ba4('0x2c')]['sort']);_0x5c0c62[_0x7ba4('0x37')]=qs[_0x7ba4('0x2e')](_['pick'](_0x197137[_0x7ba4('0x2c')],_0x556ac5[_0x7ba4('0x2e')]));if(_0x197137[_0x7ba4('0x2c')][_0x7ba4('0x39')]){_0x5c0c62[_0x7ba4('0x37')]=_[_0x7ba4('0x3a')](_0x5c0c62['where'],{'$or':_['map'](_0x5c0c62[_0x7ba4('0x31')],function(_0x4c6569){var _0x5e88cd={};_0x5e88cd[_0x4c6569]={'$like':'%'+_0x197137['query']['filter']+'%'};return _0x5e88cd;})});}_0x5c0c62=_[_0x7ba4('0x3a')]({},_0x5c0c62,_0x197137[_0x7ba4('0x3b')]);return _0x1f1c6e[_0x7ba4('0x48')](_0x5c0c62);}})[_0x7ba4('0x20')](function(_0x149ec7){if(_0x149ec7){_0x1d0ad6=_0x149ec7[_0x7ba4('0x47')];if(!_0x197137[_0x7ba4('0x2c')][_0x7ba4('0x32')](_0x7ba4('0x33'))){_0x5c0c62[_0x7ba4('0x34')]=qs['limit'](_0x197137[_0x7ba4('0x2c')][_0x7ba4('0x34')]);_0x5c0c62[_0x7ba4('0x1b')]=qs[_0x7ba4('0x1b')](_0x197137['query']['offset']);}return _0x1f1c6e[_0x7ba4('0x48')](_0x5c0c62);}})[_0x7ba4('0x20')](function(_0x2bd5a8){if(_0x2bd5a8){return _0x2bd5a8?{'count':_0x1d0ad6,'rows':_0x2bd5a8}:null;}})[_0x7ba4('0x20')](respondWithResult(_0x281511,null))[_0x7ba4('0x3e')](handleError(_0x281511,null));};exports['getDescriptions']=function(_0x35404d,_0x54b139,_0x1ce2a1){var _0x56dca0={};var _0x48b87d={};var _0x23fe4b;var _0x436de8;return db[_0x7ba4('0x27')]['findOne']({'where':{'id':_0x35404d[_0x7ba4('0x3f')]['id']}})['then'](handleEntityNotFound(_0x54b139,null))[_0x7ba4('0x20')](function(_0x1a36b5){if(_0x1a36b5){_0x23fe4b=_0x1a36b5;_0x48b87d[_0x7ba4('0x2b')]=_[_0x7ba4('0x2d')](db[_0x7ba4('0x46')][_0x7ba4('0x40')]);_0x48b87d[_0x7ba4('0x2c')]=_[_0x7ba4('0x2d')](_0x35404d['query']);_0x48b87d[_0x7ba4('0x2e')]=_[_0x7ba4('0x2f')](_0x48b87d[_0x7ba4('0x2b')],_0x48b87d[_0x7ba4('0x2c')]);_0x56dca0[_0x7ba4('0x31')]=_['intersection'](_0x48b87d[_0x7ba4('0x2b')],qs['fields'](_0x35404d[_0x7ba4('0x2c')]['fields']));_0x56dca0[_0x7ba4('0x31')]=_0x56dca0['attributes'][_0x7ba4('0x47')]?_0x56dca0[_0x7ba4('0x31')]:_0x48b87d[_0x7ba4('0x2b')];_0x56dca0[_0x7ba4('0x35')]=qs[_0x7ba4('0x36')](_0x35404d[_0x7ba4('0x2c')][_0x7ba4('0x36')]);_0x56dca0[_0x7ba4('0x37')]=qs[_0x7ba4('0x2e')](_[_0x7ba4('0x38')](_0x35404d[_0x7ba4('0x2c')],_0x48b87d[_0x7ba4('0x2e')]));if(_0x35404d['query'][_0x7ba4('0x39')]){_0x56dca0[_0x7ba4('0x37')]=_[_0x7ba4('0x3a')](_0x56dca0['where'],{'$or':_[_0x7ba4('0x26')](_0x56dca0['attributes'],function(_0x168705){var _0x1c297c={};_0x1c297c[_0x168705]={'$like':'%'+_0x35404d[_0x7ba4('0x2c')][_0x7ba4('0x39')]+'%'};return _0x1c297c;})});}_0x56dca0=_[_0x7ba4('0x3a')]({},_0x56dca0,_0x35404d['options']);return _0x23fe4b[_0x7ba4('0x4a')](_0x56dca0);}})[_0x7ba4('0x20')](function(_0x9f9d87){if(_0x9f9d87){_0x436de8=_0x9f9d87[_0x7ba4('0x47')];if(!_0x35404d[_0x7ba4('0x2c')]['hasOwnProperty'](_0x7ba4('0x33'))){_0x56dca0[_0x7ba4('0x34')]=qs['limit'](_0x35404d[_0x7ba4('0x2c')][_0x7ba4('0x34')]);_0x56dca0[_0x7ba4('0x1b')]=qs[_0x7ba4('0x1b')](_0x35404d[_0x7ba4('0x2c')][_0x7ba4('0x1b')]);}return _0x23fe4b[_0x7ba4('0x4a')](_0x56dca0);}})[_0x7ba4('0x20')](function(_0x53665d){if(_0x53665d){return _0x53665d?{'count':_0x436de8,'rows':_0x53665d}:null;}})[_0x7ba4('0x20')](respondWithResult(_0x54b139,null))['catch'](handleError(_0x54b139,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 6e08013..98d7db7 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 _0x31fc=['../../config/environment','./intVtigerConfiguration.attributes','exports','VtigerConfiguration','../../config/logger','api','bluebird','request-promise'];(function(_0x1493c2,_0x453cef){var _0x378b8d=function(_0x269193){while(--_0x269193){_0x1493c2['push'](_0x1493c2['shift']());}};_0x378b8d(++_0x453cef);}(_0x31fc,0x74));var _0xc31f=function(_0xb5fec3,_0x156398){_0xb5fec3=_0xb5fec3-0x0;var _0x2c90ec=_0x31fc[_0xb5fec3];return _0x2c90ec;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc31f('0x0'))(_0xc31f('0x1'));var moment=require('moment');var BPromise=require(_0xc31f('0x2'));var rp=require(_0xc31f('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc31f('0x4'));var attributes=require(_0xc31f('0x5'));module[_0xc31f('0x6')]=function(_0x2431ba,_0x5b40a2){return _0x2431ba['define'](_0xc31f('0x7'),attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x779b=['api','moment','bluebird','request-promise','rimraf','../../config/environment','VtigerConfiguration','int_vtiger_configurations','util','../../config/logger'];(function(_0x278156,_0x2ae8ae){var _0x395c77=function(_0x3d6a1e){while(--_0x3d6a1e){_0x278156['push'](_0x278156['shift']());}};_0x395c77(++_0x2ae8ae);}(_0x779b,0x13e));var _0xb779=function(_0x37e25c,_0x1b311c){_0x37e25c=_0x37e25c-0x0;var _0x44c1be=_0x779b[_0x37e25c];return _0x44c1be;};'use strict';var _=require('lodash');var util=require(_0xb779('0x0'));var logger=require(_0xb779('0x1'))(_0xb779('0x2'));var moment=require(_0xb779('0x3'));var BPromise=require(_0xb779('0x4'));var rp=require(_0xb779('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb779('0x6'));var config=require(_0xb779('0x7'));var attributes=require('./intVtigerConfiguration.attributes');module['exports']=function(_0x57961c,_0x5b5c96){return _0x57961c['define'](_0xb779('0x8'),attributes,{'tableName':_0xb779('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 6baf4c2..2d7cb6c 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 _0xcfad=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerConfiguration,\x20%s,\x20%s','message','result','lodash','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x4de586,_0x183427){var _0x46baf5=function(_0x1157f0){while(--_0x1157f0){_0x4de586['push'](_0x4de586['shift']());}};_0x46baf5(++_0x183427);}(_0xcfad,0x145));var _0xdcfa=function(_0x1b46ae,_0x3c54b4){_0x1b46ae=_0x1b46ae-0x0;var _0x35574f=_0xcfad[_0x1b46ae];return _0x35574f;};'use strict';var _=require(_0xdcfa('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xdcfa('0x1'));var rs=require(_0xdcfa('0x2'));var fs=require('fs');var Redis=require(_0xdcfa('0x3'));var db=require(_0xdcfa('0x4'))['db'];var utils=require(_0xdcfa('0x5'));var logger=require(_0xdcfa('0x6'))('rpc');var config=require(_0xdcfa('0x7'));var jayson=require(_0xdcfa('0x8'));var client=jayson[_0xdcfa('0x9')][_0xdcfa('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2c4c8a,_0x511d33,_0x7d7f84){return new BPromise(function(_0xd66482,_0x17989f){return client[_0xdcfa('0xb')](_0x2c4c8a,_0x7d7f84)[_0xdcfa('0xc')](function(_0x274648){logger[_0xdcfa('0xd')]('VtigerConfiguration,\x20%s,\x20%s',_0x511d33,'request\x20sent');logger[_0xdcfa('0xe')](_0xdcfa('0xf'),_0x511d33,'request\x20sent',JSON[_0xdcfa('0x10')](_0x274648));if(_0x274648['error']){if(_0x274648[_0xdcfa('0x11')][_0xdcfa('0x12')]===0x1f4){logger[_0xdcfa('0x11')](_0xdcfa('0x13'),_0x511d33,_0x274648[_0xdcfa('0x11')][_0xdcfa('0x14')]);return _0x17989f(_0x274648[_0xdcfa('0x11')][_0xdcfa('0x14')]);}logger[_0xdcfa('0x11')](_0xdcfa('0x13'),_0x511d33,_0x274648[_0xdcfa('0x11')][_0xdcfa('0x14')]);return _0xd66482(_0x274648[_0xdcfa('0x11')][_0xdcfa('0x14')]);}else{logger[_0xdcfa('0xd')]('VtigerConfiguration,\x20%s,\x20%s',_0x511d33,'request\x20sent');_0xd66482(_0x274648[_0xdcfa('0x15')][_0xdcfa('0x14')]);}})['catch'](function(_0x56aaad){logger['error'](_0xdcfa('0x13'),_0x511d33,_0x56aaad);_0x17989f(_0x56aaad);});});} \ No newline at end of file +var _0xf889=['util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info','VtigerConfiguration,\x20%s,\x20%s','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result'];(function(_0x1d789d,_0x1cecd8){var _0x52f487=function(_0x1b36af){while(--_0x1b36af){_0x1d789d['push'](_0x1d789d['shift']());}};_0x52f487(++_0x1cecd8);}(_0xf889,0xab));var _0x9f88=function(_0xda0d69,_0x455ff8){_0xda0d69=_0xda0d69-0x0;var _0x4f2c74=_0xf889[_0xda0d69];return _0x4f2c74;};'use strict';var _=require('lodash');var util=require(_0x9f88('0x0'));var moment=require('moment');var BPromise=require(_0x9f88('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9f88('0x2'));var db=require(_0x9f88('0x3'))['db'];var utils=require(_0x9f88('0x4'));var logger=require(_0x9f88('0x5'))(_0x9f88('0x6'));var config=require('../../config/environment');var jayson=require(_0x9f88('0x7'));var client=jayson[_0x9f88('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x283953,_0x430441,_0x25bf96){return new BPromise(function(_0xf5eb59,_0x58b91c){return client['request'](_0x283953,_0x25bf96)[_0x9f88('0x9')](function(_0x175e1f){logger[_0x9f88('0xa')](_0x9f88('0xb'),_0x430441,'request\x20sent');logger[_0x9f88('0xc')](_0x9f88('0xd'),_0x430441,_0x9f88('0xe'),JSON['stringify'](_0x175e1f));if(_0x175e1f[_0x9f88('0xf')]){if(_0x175e1f[_0x9f88('0xf')][_0x9f88('0x10')]===0x1f4){logger['error'](_0x9f88('0xb'),_0x430441,_0x175e1f[_0x9f88('0xf')][_0x9f88('0x11')]);return _0x58b91c(_0x175e1f[_0x9f88('0xf')][_0x9f88('0x11')]);}logger[_0x9f88('0xf')](_0x9f88('0xb'),_0x430441,_0x175e1f[_0x9f88('0xf')][_0x9f88('0x11')]);return _0xf5eb59(_0x175e1f['error'][_0x9f88('0x11')]);}else{logger['info'](_0x9f88('0xb'),_0x430441,_0x9f88('0xe'));_0xf5eb59(_0x175e1f[_0x9f88('0x12')][_0x9f88('0x11')]);}})['catch'](function(_0x3695b9){logger[_0x9f88('0xf')]('VtigerConfiguration,\x20%s,\x20%s',_0x430441,_0x3695b9);_0x58b91c(_0x3695b9);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 89cb183..3fa301d 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 _0xf796=['util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports'];(function(_0x446ed4,_0xaf3121){var _0x37f6dc=function(_0x2fbe09){while(--_0x2fbe09){_0x446ed4['push'](_0x446ed4['shift']());}};_0x37f6dc(++_0xaf3121);}(_0xf796,0x143));var _0x6f79=function(_0xa98618,_0x5174e9){_0xa98618=_0xa98618-0x0;var _0x31c07d=_0xf796[_0xa98618];return _0x31c07d;};'use strict';var multer=require('multer');var util=require(_0x6f79('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6f79('0x1'));var router=express[_0x6f79('0x2')]();var fs_extra=require(_0x6f79('0x3'));var auth=require(_0x6f79('0x4'));var interaction=require(_0x6f79('0x5'));var config=require(_0x6f79('0x6'));var controller=require(_0x6f79('0x7'));router[_0x6f79('0x8')]('/',auth[_0x6f79('0x9')](),controller[_0x6f79('0xa')]);router['get'](_0x6f79('0xb'),auth[_0x6f79('0x9')](),controller[_0x6f79('0xc')]);router[_0x6f79('0xd')]('/',auth[_0x6f79('0x9')](),controller[_0x6f79('0xe')]);router['put'](_0x6f79('0xb'),auth[_0x6f79('0x9')](),controller[_0x6f79('0xf')]);router[_0x6f79('0x10')](_0x6f79('0xb'),auth[_0x6f79('0x9')](),controller[_0x6f79('0x11')]);module[_0x6f79('0x12')]=router; \ No newline at end of file +var _0x7ca5=['delete','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./intVtigerField.controller','get','index','/:id','isAuthenticated','show','post','put','update'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0x7ca5,0x191));var _0x57ca=function(_0xc83213,_0x586dc0){_0xc83213=_0xc83213-0x0;var _0x479f0b=_0x7ca5[_0xc83213];return _0x479f0b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x57ca('0x0'));var timeout=require(_0x57ca('0x1'));var express=require(_0x57ca('0x2'));var router=express['Router']();var fs_extra=require(_0x57ca('0x3'));var auth=require(_0x57ca('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x57ca('0x5'));var controller=require(_0x57ca('0x6'));router[_0x57ca('0x7')]('/',auth['isAuthenticated'](),controller[_0x57ca('0x8')]);router['get'](_0x57ca('0x9'),auth[_0x57ca('0xa')](),controller[_0x57ca('0xb')]);router[_0x57ca('0xc')]('/',auth[_0x57ca('0xa')](),controller['create']);router[_0x57ca('0xd')](_0x57ca('0x9'),auth[_0x57ca('0xa')](),controller[_0x57ca('0xe')]);router[_0x57ca('0xf')](_0x57ca('0x9'),auth[_0x57ca('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 265cc8a..e6d9bac 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 _0xe064=['BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING'];(function(_0x14ecbf,_0x67ccd4){var _0x30f404=function(_0xd6ce21){while(--_0xd6ce21){_0x14ecbf['push'](_0x14ecbf['shift']());}};_0x30f404(++_0x67ccd4);}(_0xe064,0xd3));var _0x4e06=function(_0x361026,_0x2375e2){_0x361026=_0x361026-0x0;var _0x37028e=_0xe064[_0x361026];return _0x37028e;};'use strict';var Sequelize=require(_0x4e06('0x0'));module[_0x4e06('0x1')]={'type':{'type':Sequelize[_0x4e06('0x2')](_0x4e06('0x3'),_0x4e06('0x4'),_0x4e06('0x5'),_0x4e06('0x6'),_0x4e06('0x7')),'defaultValue':_0x4e06('0x3')},'content':{'type':Sequelize[_0x4e06('0x8')]},'key':{'type':Sequelize[_0x4e06('0x8')]},'keyType':{'type':Sequelize['ENUM'](_0x4e06('0x3'),_0x4e06('0x4'),_0x4e06('0x5'))},'keyContent':{'type':Sequelize[_0x4e06('0x8')]},'idField':{'type':Sequelize[_0x4e06('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x4e06('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4e06('0x8')]}}; \ No newline at end of file +var _0x2952=['BOOLEAN','sequelize','exports','string','variable','customVariable','keyValue','picklist','STRING','ENUM'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x2952,0x8d));var _0x2295=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x2952[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require(_0x2295('0x0'));module[_0x2295('0x1')]={'type':{'type':Sequelize['ENUM'](_0x2295('0x2'),_0x2295('0x3'),_0x2295('0x4'),_0x2295('0x5'),_0x2295('0x6')),'defaultValue':_0x2295('0x2')},'content':{'type':Sequelize[_0x2295('0x7')]},'key':{'type':Sequelize[_0x2295('0x7')]},'keyType':{'type':Sequelize[_0x2295('0x8')]('string','variable',_0x2295('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x2295('0x7')]},'nameField':{'type':Sequelize[_0x2295('0x7')]},'customField':{'type':Sequelize[_0x2295('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2295('0x7')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index fd463b6..fc21194 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 _0x3312=['then','error','stack','name','send','index','map','VtigerField','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','show','find','catch','create','body','params','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','save','update'];(function(_0x21dd50,_0x921f70){var _0x1b7d5e=function(_0x317101){while(--_0x317101){_0x21dd50['push'](_0x21dd50['shift']());}};_0x1b7d5e(++_0x921f70);}(_0x3312,0xb5));var _0x2331=function(_0x25b595,_0x47f711){_0x25b595=_0x25b595-0x0;var _0x2c7299=_0x3312[_0x25b595];return _0x2c7299;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2331('0x0'));var zipdir=require(_0x2331('0x1'));var jsonpatch=require(_0x2331('0x2'));var rp=require('request-promise');var moment=require(_0x2331('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x2331('0x4'));var util=require(_0x2331('0x5'));var path=require(_0x2331('0x6'));var sox=require('sox');var csv=require(_0x2331('0x7'));var ejs=require(_0x2331('0x8'));var fs=require('fs');var fs_extra=require(_0x2331('0x9'));var _=require(_0x2331('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2331('0xb'));var deskjs=require(_0x2331('0xc'));var toCsv=require(_0x2331('0x7'));var querystring=require(_0x2331('0xd'));var Papa=require('papaparse');var Redis=require(_0x2331('0xe'));var authService=require(_0x2331('0xf'));var qs=require(_0x2331('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2331('0x11'));var logger=require(_0x2331('0x12'))('api');var utils=require(_0x2331('0x13'));var config=require(_0x2331('0x14'));var licenseUtil=require(_0x2331('0x15'));var db=require(_0x2331('0x16'))['db'];function respondWithStatusCode(_0x20e851,_0x448850){_0x448850=_0x448850||0xcc;return function(_0x422170){if(_0x422170){return _0x20e851[_0x2331('0x17')](_0x448850);}return _0x20e851[_0x2331('0x18')](_0x448850)[_0x2331('0x19')]();};}function respondWithResult(_0x1db47d,_0x56d42a){_0x56d42a=_0x56d42a||0xc8;return function(_0x51d525){if(_0x51d525){return _0x1db47d[_0x2331('0x18')](_0x56d42a)[_0x2331('0x1a')](_0x51d525);}};}function respondWithFilteredResult(_0x41e809,_0x3f5d72){return function(_0x4d319c){if(_0x4d319c){var _0x5b2436=typeof _0x3f5d72['offset']===_0x2331('0x1b')&&typeof _0x3f5d72[_0x2331('0x1c')]==='undefined';var _0x53d34f=_0x4d319c[_0x2331('0x1d')];var _0x142de6=_0x5b2436?0x0:_0x3f5d72[_0x2331('0x1e')];var _0x12e9bf=_0x5b2436?_0x4d319c[_0x2331('0x1d')]:_0x3f5d72['offset']+_0x3f5d72[_0x2331('0x1c')];var _0x589f6d;if(_0x12e9bf>=_0x53d34f){_0x12e9bf=_0x53d34f;_0x589f6d=0xc8;}else{_0x589f6d=0xce;}_0x41e809['status'](_0x589f6d);return _0x41e809[_0x2331('0x1f')]('Content-Range',_0x142de6+'-'+_0x12e9bf+'/'+_0x53d34f)[_0x2331('0x1a')](_0x4d319c);}return null;};}function patchUpdates(_0x3daa4b){return function(_0x3f345b){try{jsonpatch[_0x2331('0x20')](_0x3f345b,_0x3daa4b,!![]);}catch(_0x3f76d5){return BPromise['reject'](_0x3f76d5);}return _0x3f345b[_0x2331('0x21')]();};}function saveUpdates(_0x1555c1,_0xce63c6){return function(_0x4eadc4){if(_0x4eadc4){return _0x4eadc4[_0x2331('0x22')](_0x1555c1)[_0x2331('0x23')](function(_0x4d17d1){return _0x4d17d1;});}return null;};}function removeEntity(_0xf546c6,_0x5d4dae){return function(_0x185b34){if(_0x185b34){return _0x185b34['destroy']()[_0x2331('0x23')](function(){_0xf546c6[_0x2331('0x18')](0xcc)[_0x2331('0x19')]();});}};}function handleEntityNotFound(_0x437d43,_0x55e428){return function(_0x2a00d7){if(!_0x2a00d7){_0x437d43[_0x2331('0x17')](0x194);}return _0x2a00d7;};}function handleError(_0x4bb9be,_0x4d5c00){_0x4d5c00=_0x4d5c00||0x1f4;return function(_0x1925a6){logger[_0x2331('0x24')](_0x1925a6[_0x2331('0x25')]);if(_0x1925a6[_0x2331('0x26')]){delete _0x1925a6[_0x2331('0x26')];}_0x4bb9be['status'](_0x4d5c00)[_0x2331('0x27')](_0x1925a6);};}exports[_0x2331('0x28')]=function(_0x3ef42e,_0x53b7c0){var _0x1e8cad={},_0xd1e89b={},_0x363bcf={'count':0x0,'rows':[]};var _0x150c6a=_[_0x2331('0x29')](db[_0x2331('0x2a')]['rawAttributes'],function(_0x58957a){return{'name':_0x58957a[_0x2331('0x2b')],'type':_0x58957a[_0x2331('0x2c')][_0x2331('0x2d')]};});_0xd1e89b[_0x2331('0x2e')]=_[_0x2331('0x29')](_0x150c6a,_0x2331('0x26'));_0xd1e89b[_0x2331('0x2f')]=_[_0x2331('0x30')](_0x3ef42e[_0x2331('0x2f')]);_0xd1e89b[_0x2331('0x31')]=_[_0x2331('0x32')](_0xd1e89b[_0x2331('0x2e')],_0xd1e89b['query']);_0x1e8cad[_0x2331('0x33')]=_[_0x2331('0x32')](_0xd1e89b['model'],qs[_0x2331('0x34')](_0x3ef42e[_0x2331('0x2f')]['fields']));_0x1e8cad[_0x2331('0x33')]=_0x1e8cad[_0x2331('0x33')][_0x2331('0x35')]?_0x1e8cad[_0x2331('0x33')]:_0xd1e89b['model'];if(!_0x3ef42e['query']['hasOwnProperty'](_0x2331('0x36'))){_0x1e8cad[_0x2331('0x1c')]=qs['limit'](_0x3ef42e['query'][_0x2331('0x1c')]);_0x1e8cad[_0x2331('0x1e')]=qs[_0x2331('0x1e')](_0x3ef42e[_0x2331('0x2f')][_0x2331('0x1e')]);}_0x1e8cad[_0x2331('0x37')]=qs[_0x2331('0x38')](_0x3ef42e['query']['sort']);_0x1e8cad['where']=qs[_0x2331('0x31')](_[_0x2331('0x39')](_0x3ef42e[_0x2331('0x2f')],_0xd1e89b[_0x2331('0x31')]),_0x150c6a);if(_0x3ef42e[_0x2331('0x2f')][_0x2331('0x3a')]){_0x1e8cad[_0x2331('0x3b')]=_[_0x2331('0x3c')](_0x1e8cad[_0x2331('0x3b')],{'$or':_[_0x2331('0x29')](_0x150c6a,function(_0x426833){if(_0x426833[_0x2331('0x2c')]!==_0x2331('0x3d')){var _0x28f2db={};_0x28f2db[_0x426833[_0x2331('0x26')]]={'$like':'%'+_0x3ef42e[_0x2331('0x2f')][_0x2331('0x3a')]+'%'};return _0x28f2db;}})});}_0x1e8cad=_[_0x2331('0x3c')]({},_0x1e8cad,_0x3ef42e[_0x2331('0x3e')]);var _0x569c00={'where':_0x1e8cad[_0x2331('0x3b')]};return db['VtigerField'][_0x2331('0x1d')](_0x569c00)[_0x2331('0x23')](function(_0x255cbf){_0x363bcf[_0x2331('0x1d')]=_0x255cbf;if(_0x3ef42e['query'][_0x2331('0x3f')]){_0x1e8cad[_0x2331('0x40')]=[{'all':!![]}];}return db[_0x2331('0x2a')]['findAll'](_0x1e8cad);})[_0x2331('0x23')](function(_0x2b8a51){_0x363bcf[_0x2331('0x41')]=_0x2b8a51;return _0x363bcf;})[_0x2331('0x23')](respondWithFilteredResult(_0x53b7c0,_0x1e8cad))['catch'](handleError(_0x53b7c0,null));};exports[_0x2331('0x42')]=function(_0x3ae974,_0x22a0cd){var _0x1b64a2={'raw':!![],'where':{'id':_0x3ae974['params']['id']}},_0x2fb321={};_0x2fb321[_0x2331('0x2e')]=_['keys'](db['VtigerField']['rawAttributes']);_0x2fb321[_0x2331('0x2f')]=_[_0x2331('0x30')](_0x3ae974[_0x2331('0x2f')]);_0x2fb321[_0x2331('0x31')]=_[_0x2331('0x32')](_0x2fb321[_0x2331('0x2e')],_0x2fb321[_0x2331('0x2f')]);_0x1b64a2['attributes']=_[_0x2331('0x32')](_0x2fb321['model'],qs[_0x2331('0x34')](_0x3ae974[_0x2331('0x2f')][_0x2331('0x34')]));_0x1b64a2[_0x2331('0x33')]=_0x1b64a2[_0x2331('0x33')][_0x2331('0x35')]?_0x1b64a2[_0x2331('0x33')]:_0x2fb321['model'];if(_0x3ae974[_0x2331('0x2f')][_0x2331('0x3f')]){_0x1b64a2[_0x2331('0x40')]=[{'all':!![]}];}_0x1b64a2=_[_0x2331('0x3c')]({},_0x1b64a2,_0x3ae974[_0x2331('0x3e')]);return db[_0x2331('0x2a')][_0x2331('0x43')](_0x1b64a2)[_0x2331('0x23')](handleEntityNotFound(_0x22a0cd,null))[_0x2331('0x23')](respondWithResult(_0x22a0cd,null))[_0x2331('0x44')](handleError(_0x22a0cd,null));};exports[_0x2331('0x45')]=function(_0x20277e,_0x1c8296){return db[_0x2331('0x2a')][_0x2331('0x45')](_0x20277e[_0x2331('0x46')],{})['then'](respondWithResult(_0x1c8296,0xc9))[_0x2331('0x44')](handleError(_0x1c8296,null));};exports['update']=function(_0x5f28c8,_0x3d13b1){if(_0x5f28c8[_0x2331('0x46')]['id']){delete _0x5f28c8[_0x2331('0x46')]['id'];}return db['VtigerField']['find']({'where':{'id':_0x5f28c8[_0x2331('0x47')]['id']}})['then'](handleEntityNotFound(_0x3d13b1,null))[_0x2331('0x23')](saveUpdates(_0x5f28c8[_0x2331('0x46')],null))[_0x2331('0x23')](respondWithResult(_0x3d13b1,null))[_0x2331('0x44')](handleError(_0x3d13b1,null));};exports['destroy']=function(_0x57b489,_0x1eb96c){return db[_0x2331('0x2a')]['find']({'where':{'id':_0x57b489[_0x2331('0x47')]['id']}})[_0x2331('0x23')](handleEntityNotFound(_0x1eb96c,null))['then'](removeEntity(_0x1eb96c,null))[_0x2331('0x44')](handleError(_0x1eb96c,null));}; \ No newline at end of file +var _0x80d2=['zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','VtigerField','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','includeAll','include','rows','catch','show','params','rawAttributes','find','create','body','rimraf'];(function(_0x242e3,_0x46b16f){var _0x4c1699=function(_0x1937d2){while(--_0x1937d2){_0x242e3['push'](_0x242e3['shift']());}};_0x4c1699(++_0x46b16f);}(_0x80d2,0x167));var _0x280d=function(_0x498af0,_0x570e62){_0x498af0=_0x498af0-0x0;var _0x2d4d70=_0x80d2[_0x498af0];return _0x2d4d70;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x280d('0x0'));var zipdir=require(_0x280d('0x1'));var jsonpatch=require(_0x280d('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x280d('0x3'));var Mustache=require(_0x280d('0x4'));var util=require(_0x280d('0x5'));var path=require(_0x280d('0x6'));var sox=require(_0x280d('0x7'));var csv=require(_0x280d('0x8'));var ejs=require(_0x280d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x280d('0xa'));var squel=require(_0x280d('0xb'));var crypto=require(_0x280d('0xc'));var jsforce=require(_0x280d('0xd'));var deskjs=require(_0x280d('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x280d('0xf'));var Redis=require(_0x280d('0x10'));var authService=require(_0x280d('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x280d('0x12'));var logger=require(_0x280d('0x13'))(_0x280d('0x14'));var utils=require('../../config/utils');var config=require(_0x280d('0x15'));var licenseUtil=require(_0x280d('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1af23b,_0x55089b){_0x55089b=_0x55089b||0xcc;return function(_0x37a826){if(_0x37a826){return _0x1af23b[_0x280d('0x17')](_0x55089b);}return _0x1af23b[_0x280d('0x18')](_0x55089b)[_0x280d('0x19')]();};}function respondWithResult(_0x36179c,_0x481faa){_0x481faa=_0x481faa||0xc8;return function(_0x50d233){if(_0x50d233){return _0x36179c[_0x280d('0x18')](_0x481faa)[_0x280d('0x1a')](_0x50d233);}};}function respondWithFilteredResult(_0x19bb51,_0x1d6c15){return function(_0x513df9){if(_0x513df9){var _0x47c166=typeof _0x1d6c15[_0x280d('0x1b')]===_0x280d('0x1c')&&typeof _0x1d6c15['limit']===_0x280d('0x1c');var _0x3dd885=_0x513df9[_0x280d('0x1d')];var _0x5cb819=_0x47c166?0x0:_0x1d6c15['offset'];var _0xa398b8=_0x47c166?_0x513df9['count']:_0x1d6c15[_0x280d('0x1b')]+_0x1d6c15[_0x280d('0x1e')];var _0xfabfef;if(_0xa398b8>=_0x3dd885){_0xa398b8=_0x3dd885;_0xfabfef=0xc8;}else{_0xfabfef=0xce;}_0x19bb51['status'](_0xfabfef);return _0x19bb51[_0x280d('0x1f')](_0x280d('0x20'),_0x5cb819+'-'+_0xa398b8+'/'+_0x3dd885)[_0x280d('0x1a')](_0x513df9);}return null;};}function patchUpdates(_0x4c0015){return function(_0x18c3a9){try{jsonpatch[_0x280d('0x21')](_0x18c3a9,_0x4c0015,!![]);}catch(_0x311d50){return BPromise['reject'](_0x311d50);}return _0x18c3a9[_0x280d('0x22')]();};}function saveUpdates(_0x35d32d,_0x2d4da7){return function(_0x4b6ae4){if(_0x4b6ae4){return _0x4b6ae4[_0x280d('0x23')](_0x35d32d)[_0x280d('0x24')](function(_0x75926e){return _0x75926e;});}return null;};}function removeEntity(_0x3d3e2e,_0x1a9f79){return function(_0x139ad4){if(_0x139ad4){return _0x139ad4[_0x280d('0x25')]()[_0x280d('0x24')](function(){_0x3d3e2e[_0x280d('0x18')](0xcc)[_0x280d('0x19')]();});}};}function handleEntityNotFound(_0x35b81a,_0x20e59c){return function(_0x3524dc){if(!_0x3524dc){_0x35b81a[_0x280d('0x17')](0x194);}return _0x3524dc;};}function handleError(_0x3dc579,_0x5b70ca){_0x5b70ca=_0x5b70ca||0x1f4;return function(_0x5e3acd){logger[_0x280d('0x26')](_0x5e3acd[_0x280d('0x27')]);if(_0x5e3acd[_0x280d('0x28')]){delete _0x5e3acd['name'];}_0x3dc579[_0x280d('0x18')](_0x5b70ca)[_0x280d('0x29')](_0x5e3acd);};}exports[_0x280d('0x2a')]=function(_0xe6ab6b,_0x29fc6c){var _0x4270cf={},_0xbb894e={},_0x404466={'count':0x0,'rows':[]};var _0x4cf53c=_[_0x280d('0x2b')](db[_0x280d('0x2c')]['rawAttributes'],function(_0x33af86){return{'name':_0x33af86['fieldName'],'type':_0x33af86[_0x280d('0x2d')][_0x280d('0x2e')]};});_0xbb894e[_0x280d('0x2f')]=_[_0x280d('0x2b')](_0x4cf53c,_0x280d('0x28'));_0xbb894e[_0x280d('0x30')]=_[_0x280d('0x31')](_0xe6ab6b['query']);_0xbb894e[_0x280d('0x32')]=_[_0x280d('0x33')](_0xbb894e[_0x280d('0x2f')],_0xbb894e[_0x280d('0x30')]);_0x4270cf['attributes']=_[_0x280d('0x33')](_0xbb894e[_0x280d('0x2f')],qs[_0x280d('0x34')](_0xe6ab6b['query']['fields']));_0x4270cf[_0x280d('0x35')]=_0x4270cf[_0x280d('0x35')][_0x280d('0x36')]?_0x4270cf[_0x280d('0x35')]:_0xbb894e[_0x280d('0x2f')];if(!_0xe6ab6b[_0x280d('0x30')][_0x280d('0x37')](_0x280d('0x38'))){_0x4270cf[_0x280d('0x1e')]=qs['limit'](_0xe6ab6b[_0x280d('0x30')][_0x280d('0x1e')]);_0x4270cf[_0x280d('0x1b')]=qs[_0x280d('0x1b')](_0xe6ab6b[_0x280d('0x30')]['offset']);}_0x4270cf['order']=qs[_0x280d('0x39')](_0xe6ab6b[_0x280d('0x30')][_0x280d('0x39')]);_0x4270cf[_0x280d('0x3a')]=qs[_0x280d('0x32')](_['pick'](_0xe6ab6b[_0x280d('0x30')],_0xbb894e[_0x280d('0x32')]),_0x4cf53c);if(_0xe6ab6b[_0x280d('0x30')][_0x280d('0x3b')]){_0x4270cf['where']=_['merge'](_0x4270cf['where'],{'$or':_[_0x280d('0x2b')](_0x4cf53c,function(_0x234947){if(_0x234947[_0x280d('0x2d')]!=='VIRTUAL'){var _0x535c27={};_0x535c27[_0x234947[_0x280d('0x28')]]={'$like':'%'+_0xe6ab6b[_0x280d('0x30')][_0x280d('0x3b')]+'%'};return _0x535c27;}})});}_0x4270cf=_[_0x280d('0x3c')]({},_0x4270cf,_0xe6ab6b[_0x280d('0x3d')]);var _0x5d066d={'where':_0x4270cf[_0x280d('0x3a')]};return db[_0x280d('0x2c')][_0x280d('0x1d')](_0x5d066d)[_0x280d('0x24')](function(_0x28cb6c){_0x404466[_0x280d('0x1d')]=_0x28cb6c;if(_0xe6ab6b[_0x280d('0x30')][_0x280d('0x3e')]){_0x4270cf[_0x280d('0x3f')]=[{'all':!![]}];}return db['VtigerField']['findAll'](_0x4270cf);})['then'](function(_0x1346a3){_0x404466[_0x280d('0x40')]=_0x1346a3;return _0x404466;})[_0x280d('0x24')](respondWithFilteredResult(_0x29fc6c,_0x4270cf))[_0x280d('0x41')](handleError(_0x29fc6c,null));};exports[_0x280d('0x42')]=function(_0x183b42,_0x4d2343){var _0x58a692={'raw':!![],'where':{'id':_0x183b42[_0x280d('0x43')]['id']}},_0x3fbe27={};_0x3fbe27[_0x280d('0x2f')]=_[_0x280d('0x31')](db[_0x280d('0x2c')][_0x280d('0x44')]);_0x3fbe27['query']=_[_0x280d('0x31')](_0x183b42[_0x280d('0x30')]);_0x3fbe27[_0x280d('0x32')]=_[_0x280d('0x33')](_0x3fbe27['model'],_0x3fbe27[_0x280d('0x30')]);_0x58a692[_0x280d('0x35')]=_['intersection'](_0x3fbe27[_0x280d('0x2f')],qs['fields'](_0x183b42[_0x280d('0x30')][_0x280d('0x34')]));_0x58a692['attributes']=_0x58a692[_0x280d('0x35')][_0x280d('0x36')]?_0x58a692[_0x280d('0x35')]:_0x3fbe27[_0x280d('0x2f')];if(_0x183b42[_0x280d('0x30')][_0x280d('0x3e')]){_0x58a692[_0x280d('0x3f')]=[{'all':!![]}];}_0x58a692=_[_0x280d('0x3c')]({},_0x58a692,_0x183b42[_0x280d('0x3d')]);return db['VtigerField'][_0x280d('0x45')](_0x58a692)['then'](handleEntityNotFound(_0x4d2343,null))[_0x280d('0x24')](respondWithResult(_0x4d2343,null))['catch'](handleError(_0x4d2343,null));};exports[_0x280d('0x46')]=function(_0x2fe569,_0x5de05c){return db[_0x280d('0x2c')][_0x280d('0x46')](_0x2fe569[_0x280d('0x47')],{})['then'](respondWithResult(_0x5de05c,0xc9))['catch'](handleError(_0x5de05c,null));};exports['update']=function(_0x2217b1,_0x345ee8){if(_0x2217b1[_0x280d('0x47')]['id']){delete _0x2217b1[_0x280d('0x47')]['id'];}return db[_0x280d('0x2c')]['find']({'where':{'id':_0x2217b1['params']['id']}})[_0x280d('0x24')](handleEntityNotFound(_0x345ee8,null))['then'](saveUpdates(_0x2217b1[_0x280d('0x47')],null))[_0x280d('0x24')](respondWithResult(_0x345ee8,null))[_0x280d('0x41')](handleError(_0x345ee8,null));};exports['destroy']=function(_0x6b8b77,_0x58950c){return db[_0x280d('0x2c')][_0x280d('0x45')]({'where':{'id':_0x6b8b77[_0x280d('0x43')]['id']}})[_0x280d('0x24')](handleEntityNotFound(_0x58950c,null))[_0x280d('0x24')](removeEntity(_0x58950c,null))[_0x280d('0x41')](handleError(_0x58950c,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 4edc356..2683072 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 _0xf011=['exports','define','VtigerField','int_vtiger_fields','vtiger_unique_index','idField','lodash','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./intVtigerField.attributes'];(function(_0x390f61,_0x278de9){var _0x488957=function(_0x2e951a){while(--_0x2e951a){_0x390f61['push'](_0x390f61['shift']());}};_0x488957(++_0x278de9);}(_0xf011,0x68));var _0x1f01=function(_0x384226,_0x4053ac){_0x384226=_0x384226-0x0;var _0x1e1c5e=_0xf011[_0x384226];return _0x1e1c5e;};'use strict';var _=require(_0x1f01('0x0'));var util=require(_0x1f01('0x1'));var logger=require(_0x1f01('0x2'))('api');var moment=require(_0x1f01('0x3'));var BPromise=require('bluebird');var rp=require(_0x1f01('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1f01('0x5'));var config=require(_0x1f01('0x6'));var attributes=require(_0x1f01('0x7'));module[_0x1f01('0x8')]=function(_0x3716ea,_0x3694bf){return _0x3716ea[_0x1f01('0x9')](_0x1f01('0xa'),attributes,{'tableName':_0x1f01('0xb'),'paranoid':![],'indexes':[{'name':_0x1f01('0xc'),'fields':[_0x1f01('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3406=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intVtigerField.attributes','exports','define','VtigerField','int_vtiger_fields','vtiger_unique_index','idField','FieldId','util'];(function(_0x83b645,_0x33e5f7){var _0x2b5449=function(_0x5dd653){while(--_0x5dd653){_0x83b645['push'](_0x83b645['shift']());}};_0x2b5449(++_0x33e5f7);}(_0x3406,0xff));var _0x6340=function(_0x11b010,_0x5d6f97){_0x11b010=_0x11b010-0x0;var _0x5be1c7=_0x3406[_0x11b010];return _0x5be1c7;};'use strict';var _=require('lodash');var util=require(_0x6340('0x0'));var logger=require(_0x6340('0x1'))(_0x6340('0x2'));var moment=require(_0x6340('0x3'));var BPromise=require(_0x6340('0x4'));var rp=require(_0x6340('0x5'));var fs=require('fs');var path=require(_0x6340('0x6'));var rimraf=require(_0x6340('0x7'));var config=require('../../config/environment');var attributes=require(_0x6340('0x8'));module[_0x6340('0x9')]=function(_0x13e74a,_0x5cc4db){return _0x13e74a[_0x6340('0xa')](_0x6340('0xb'),attributes,{'tableName':_0x6340('0xc'),'paranoid':![],'indexes':[{'name':_0x6340('0xd'),'fields':[_0x6340('0xe'),_0x6340('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.rpc.js b/server/api/intVtigerField/intVtigerField.rpc.js index 90f5e31..bdc9a3f 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 _0xe829=['request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerField,\x20%s,\x20%s','message','info','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then'];(function(_0x36db65,_0x2b4af1){var _0x5bea6a=function(_0x513889){while(--_0x513889){_0x36db65['push'](_0x36db65['shift']());}};_0x5bea6a(++_0x2b4af1);}(_0xe829,0x1d8));var _0x9e82=function(_0x4fa08c,_0x30cac4){_0x4fa08c=_0x4fa08c-0x0;var _0x7a920a=_0xe829[_0x4fa08c];return _0x7a920a;};'use strict';var _=require(_0x9e82('0x0'));var util=require(_0x9e82('0x1'));var moment=require(_0x9e82('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9e82('0x3'));var db=require(_0x9e82('0x4'))['db'];var utils=require(_0x9e82('0x5'));var logger=require(_0x9e82('0x6'))(_0x9e82('0x7'));var config=require(_0x9e82('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9e82('0x9')][_0x9e82('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1a63b3,_0x7cebd4,_0x2d91ba){return new BPromise(function(_0x5c4c57,_0x149f39){return client['request'](_0x1a63b3,_0x2d91ba)[_0x9e82('0xb')](function(_0x13070b){logger['info']('VtigerField,\x20%s,\x20%s',_0x7cebd4,_0x9e82('0xc'));logger[_0x9e82('0xd')](_0x9e82('0xe'),_0x7cebd4,_0x9e82('0xc'),JSON[_0x9e82('0xf')](_0x13070b));if(_0x13070b[_0x9e82('0x10')]){if(_0x13070b[_0x9e82('0x10')][_0x9e82('0x11')]===0x1f4){logger[_0x9e82('0x10')](_0x9e82('0x12'),_0x7cebd4,_0x13070b[_0x9e82('0x10')][_0x9e82('0x13')]);return _0x149f39(_0x13070b['error']['message']);}logger[_0x9e82('0x10')](_0x9e82('0x12'),_0x7cebd4,_0x13070b[_0x9e82('0x10')][_0x9e82('0x13')]);return _0x5c4c57(_0x13070b['error'][_0x9e82('0x13')]);}else{logger[_0x9e82('0x14')](_0x9e82('0x12'),_0x7cebd4,_0x9e82('0xc'));_0x5c4c57(_0x13070b['result'][_0x9e82('0x13')]);}})[_0x9e82('0x15')](function(_0x3f70a3){logger[_0x9e82('0x10')]('VtigerField,\x20%s,\x20%s',_0x7cebd4,_0x3f70a3);_0x149f39(_0x3f70a3);});});} \ No newline at end of file +var _0x8b18=['ioredis','../../config/utils','../../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','code','message','result','util','moment','bluebird'];(function(_0x1e9ebc,_0x2b1f62){var _0x2410ea=function(_0x128436){while(--_0x128436){_0x1e9ebc['push'](_0x1e9ebc['shift']());}};_0x2410ea(++_0x2b1f62);}(_0x8b18,0x18d));var _0x88b1=function(_0x2de86f,_0x1672dd){_0x2de86f=_0x2de86f-0x0;var _0x47e1c6=_0x8b18[_0x2de86f];return _0x47e1c6;};'use strict';var _=require('lodash');var util=require(_0x88b1('0x0'));var moment=require(_0x88b1('0x1'));var BPromise=require(_0x88b1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x88b1('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x88b1('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x88b1('0x5'));var jayson=require(_0x88b1('0x6'));var client=jayson[_0x88b1('0x7')][_0x88b1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x338a15,_0x3c2e83,_0x113da6){return new BPromise(function(_0x1aaae1,_0x232aa5){return client[_0x88b1('0x9')](_0x338a15,_0x113da6)['then'](function(_0x316dc4){logger[_0x88b1('0xa')](_0x88b1('0xb'),_0x3c2e83,_0x88b1('0xc'));logger[_0x88b1('0xd')](_0x88b1('0xe'),_0x3c2e83,_0x88b1('0xc'),JSON[_0x88b1('0xf')](_0x316dc4));if(_0x316dc4[_0x88b1('0x10')]){if(_0x316dc4[_0x88b1('0x10')][_0x88b1('0x11')]===0x1f4){logger['error'](_0x88b1('0xb'),_0x3c2e83,_0x316dc4[_0x88b1('0x10')][_0x88b1('0x12')]);return _0x232aa5(_0x316dc4[_0x88b1('0x10')][_0x88b1('0x12')]);}logger[_0x88b1('0x10')]('VtigerField,\x20%s,\x20%s',_0x3c2e83,_0x316dc4[_0x88b1('0x10')]['message']);return _0x1aaae1(_0x316dc4[_0x88b1('0x10')][_0x88b1('0x12')]);}else{logger[_0x88b1('0xa')](_0x88b1('0xb'),_0x3c2e83,_0x88b1('0xc'));_0x1aaae1(_0x316dc4[_0x88b1('0x13')][_0x88b1('0x12')]);}})['catch'](function(_0x206cc1){logger['error']('VtigerField,\x20%s,\x20%s',_0x3c2e83,_0x206cc1);_0x232aa5(_0x206cc1);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 53ffa43..a2acf21 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 _0xb766=['../../components/interaction/service','./intZendeskAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','post','create','put','update','delete','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x5d846f,_0x51c4e0){var _0x2f0269=function(_0x5715b1){while(--_0x5715b1){_0x5d846f['push'](_0x5d846f['shift']());}};_0x2f0269(++_0x51c4e0);}(_0xb766,0x150));var _0x6b76=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xb766[_0x2f3848];return _0x102668;};'use strict';var multer=require(_0x6b76('0x0'));var util=require(_0x6b76('0x1'));var path=require('path');var timeout=require(_0x6b76('0x2'));var express=require(_0x6b76('0x3'));var router=express['Router']();var fs_extra=require(_0x6b76('0x4'));var auth=require(_0x6b76('0x5'));var interaction=require(_0x6b76('0x6'));var config=require('../../config/environment');var controller=require(_0x6b76('0x7'));router[_0x6b76('0x8')]('/',auth[_0x6b76('0x9')](),controller['index']);router[_0x6b76('0x8')](_0x6b76('0xa'),auth[_0x6b76('0x9')](),controller[_0x6b76('0xb')]);router[_0x6b76('0x8')](_0x6b76('0xc'),auth[_0x6b76('0x9')](),controller['getConfigurations']);router[_0x6b76('0x8')]('/:id/fields',auth[_0x6b76('0x9')](),controller['getFields']);router[_0x6b76('0xd')]('/',auth[_0x6b76('0x9')](),controller[_0x6b76('0xe')]);router[_0x6b76('0xd')]('/:id/configurations',auth[_0x6b76('0x9')](),controller['addConfiguration']);router[_0x6b76('0xf')](_0x6b76('0xa'),auth[_0x6b76('0x9')](),controller[_0x6b76('0x10')]);router[_0x6b76('0x11')](_0x6b76('0xa'),auth[_0x6b76('0x9')](),controller['destroy']);module[_0x6b76('0x12')]=router; \ No newline at end of file +var _0xe55d=['fs-extra','../../components/auth/service','../../components/interaction/service','./intZendeskAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','put','update','delete','destroy','multer','util','connect-timeout','express','Router'];(function(_0x5bb2d8,_0x47a1db){var _0x19dc01=function(_0x205c45){while(--_0x205c45){_0x5bb2d8['push'](_0x5bb2d8['shift']());}};_0x19dc01(++_0x47a1db);}(_0xe55d,0x126));var _0xde55=function(_0x3bcfb0,_0xffe700){_0x3bcfb0=_0x3bcfb0-0x0;var _0x5c47ab=_0xe55d[_0x3bcfb0];return _0x5c47ab;};'use strict';var multer=require(_0xde55('0x0'));var util=require(_0xde55('0x1'));var path=require('path');var timeout=require(_0xde55('0x2'));var express=require(_0xde55('0x3'));var router=express[_0xde55('0x4')]();var fs_extra=require(_0xde55('0x5'));var auth=require(_0xde55('0x6'));var interaction=require(_0xde55('0x7'));var config=require('../../config/environment');var controller=require(_0xde55('0x8'));router[_0xde55('0x9')]('/',auth[_0xde55('0xa')](),controller['index']);router[_0xde55('0x9')](_0xde55('0xb'),auth[_0xde55('0xa')](),controller[_0xde55('0xc')]);router[_0xde55('0x9')](_0xde55('0xd'),auth['isAuthenticated'](),controller[_0xde55('0xe')]);router[_0xde55('0x9')]('/:id/fields',auth['isAuthenticated'](),controller[_0xde55('0xf')]);router[_0xde55('0x10')]('/',auth['isAuthenticated'](),controller[_0xde55('0x11')]);router[_0xde55('0x10')]('/:id/configurations',auth[_0xde55('0xa')](),controller[_0xde55('0x12')]);router[_0xde55('0x13')]('/:id',auth[_0xde55('0xa')](),controller[_0xde55('0x14')]);router[_0xde55('0x15')](_0xde55('0xb'),auth[_0xde55('0xa')](),controller[_0xde55('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 9db2ad2..09fb386 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 _0x82d8=['password','token','integrationTab','sequelize','STRING','username','ENUM'];(function(_0x17a32f,_0x5a51a){var _0x15a293=function(_0x55fbd3){while(--_0x55fbd3){_0x17a32f['push'](_0x17a32f['shift']());}};_0x15a293(++_0x5a51a);}(_0x82d8,0xff));var _0x882d=function(_0x121411,_0x364511){_0x121411=_0x121411-0x0;var _0x5fd4d0=_0x82d8[_0x121411];return _0x5fd4d0;};'use strict';var Sequelize=require(_0x882d('0x0'));module['exports']={'name':{'type':Sequelize[_0x882d('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x882d('0x2')},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x882d('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'authType':{'type':Sequelize[_0x882d('0x3')](_0x882d('0x4'),_0x882d('0x5')),'defaultValue':_0x882d('0x4')},'serverUrl':{'type':Sequelize[_0x882d('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x882d('0x3')](_0x882d('0x6'),'newTab'),'defaultValue':_0x882d('0x6')}}; \ No newline at end of file +var _0x27a0=['STRING','username','ENUM','password','token','newTab','integrationTab','exports'];(function(_0x1ec4c5,_0x2bc91a){var _0x5dd4cb=function(_0x1e7452){while(--_0x1e7452){_0x1ec4c5['push'](_0x1ec4c5['shift']());}};_0x5dd4cb(++_0x2bc91a);}(_0x27a0,0xbf));var _0x027a=function(_0x4ed17a,_0x32abff){_0x4ed17a=_0x4ed17a-0x0;var _0x519bad=_0x27a0[_0x4ed17a];return _0x519bad;};'use strict';var Sequelize=require('sequelize');module[_0x027a('0x0')]={'name':{'type':Sequelize[_0x027a('0x1')]},'description':{'type':Sequelize[_0x027a('0x1')]},'username':{'type':Sequelize[_0x027a('0x1')],'unique':_0x027a('0x2')},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'authType':{'type':Sequelize[_0x027a('0x3')](_0x027a('0x4'),_0x027a('0x5')),'defaultValue':_0x027a('0x4')},'serverUrl':{'type':Sequelize[_0x027a('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x027a('0x3')]('integrationTab',_0x027a('0x6')),'defaultValue':_0x027a('0x7')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 5628506..be0b782 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 _0x04b8=['lodash','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','../../components/integrations/configuration','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','end','stack','name','send','map','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','where','merge','VIRTUAL','options','includeAll','ZendeskAccount','findAll','rows','catch','keys','include','find','create','body','params','getConfigurations','findOne','ZendeskConfiguration','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','ZendeskField','Descriptions','getFields','username','password','token','remoteUri','slice','lastIndexOf','GET','format','%s/%s','ticket_fields','authType','headers','Basic\x20%s','%s:%s','toString','base64','ValidationError','Unknown\x20authentication\x20type','subject','description','group','assignee','remove','includes','position','custom_field_options','test','error','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra'];(function(_0xcd68f7,_0x45a831){var _0x43f4cb=function(_0x46af88){while(--_0x46af88){_0xcd68f7['push'](_0xcd68f7['shift']());}};_0x43f4cb(++_0x45a831);}(_0x04b8,0x159));var _0x804b=function(_0x44d6e7,_0xba3d1c){_0x44d6e7=_0x44d6e7-0x0;var _0x13df55=_0x04b8[_0x44d6e7];return _0x13df55;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x804b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x804b('0x1'));var rp=require(_0x804b('0x2'));var moment=require('moment');var BPromise=require(_0x804b('0x3'));var Mustache=require(_0x804b('0x4'));var util=require('util');var path=require(_0x804b('0x5'));var sox=require(_0x804b('0x6'));var csv=require(_0x804b('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x804b('0x8'));var _=require(_0x804b('0x9'));var squel=require(_0x804b('0xa'));var crypto=require('crypto');var jsforce=require(_0x804b('0xb'));var deskjs=require(_0x804b('0xc'));var toCsv=require('to-csv');var querystring=require(_0x804b('0xd'));var Papa=require(_0x804b('0xe'));var Redis=require(_0x804b('0xf'));var authService=require(_0x804b('0x10'));var qs=require(_0x804b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x804b('0x12'));var logger=require(_0x804b('0x13'))(_0x804b('0x14'));var utils=require(_0x804b('0x15'));var config=require(_0x804b('0x16'));var licenseUtil=require(_0x804b('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x804b('0x18'));function respondWithStatusCode(_0x5303cc,_0x23ee57){_0x23ee57=_0x23ee57||0xcc;return function(_0x3a2702){if(_0x3a2702){return _0x5303cc[_0x804b('0x19')](_0x23ee57);}return _0x5303cc[_0x804b('0x1a')](_0x23ee57)['end']();};}function respondWithResult(_0x215825,_0x1b01a7){_0x1b01a7=_0x1b01a7||0xc8;return function(_0x274bb8){if(_0x274bb8){return _0x215825[_0x804b('0x1a')](_0x1b01a7)['json'](_0x274bb8);}};}function respondWithFilteredResult(_0x2fd593,_0x8ccbe0){return function(_0x5e1cfe){if(_0x5e1cfe){var _0x3c5986=typeof _0x8ccbe0['offset']===_0x804b('0x1b')&&typeof _0x8ccbe0[_0x804b('0x1c')]===_0x804b('0x1b');var _0x1760f8=_0x5e1cfe[_0x804b('0x1d')];var _0x5a0a82=_0x3c5986?0x0:_0x8ccbe0[_0x804b('0x1e')];var _0x50b4fe=_0x3c5986?_0x5e1cfe[_0x804b('0x1d')]:_0x8ccbe0[_0x804b('0x1e')]+_0x8ccbe0[_0x804b('0x1c')];var _0x469251;if(_0x50b4fe>=_0x1760f8){_0x50b4fe=_0x1760f8;_0x469251=0xc8;}else{_0x469251=0xce;}_0x2fd593['status'](_0x469251);return _0x2fd593[_0x804b('0x1f')](_0x804b('0x20'),_0x5a0a82+'-'+_0x50b4fe+'/'+_0x1760f8)[_0x804b('0x21')](_0x5e1cfe);}return null;};}function patchUpdates(_0x11eaf6){return function(_0x27844b){try{jsonpatch[_0x804b('0x22')](_0x27844b,_0x11eaf6,!![]);}catch(_0x3241a0){return BPromise[_0x804b('0x23')](_0x3241a0);}return _0x27844b[_0x804b('0x24')]();};}function saveUpdates(_0x2b7271,_0x1acc48){return function(_0x5a968b){if(_0x5a968b){return _0x5a968b[_0x804b('0x25')](_0x2b7271)[_0x804b('0x26')](function(_0x5585f8){return _0x5585f8;});}return null;};}function removeEntity(_0x44a921,_0x367024){return function(_0x115b8f){if(_0x115b8f){return _0x115b8f[_0x804b('0x27')]()[_0x804b('0x26')](function(){_0x44a921['status'](0xcc)[_0x804b('0x28')]();});}};}function handleEntityNotFound(_0x7d9c33,_0x4e7266){return function(_0x12b6a6){if(!_0x12b6a6){_0x7d9c33[_0x804b('0x19')](0x194);}return _0x12b6a6;};}function handleError(_0x1117a5,_0x27d5ec){_0x27d5ec=_0x27d5ec||0x1f4;return function(_0x2d88da){logger['error'](_0x2d88da[_0x804b('0x29')]);if(_0x2d88da[_0x804b('0x2a')]){delete _0x2d88da[_0x804b('0x2a')];}_0x1117a5[_0x804b('0x1a')](_0x27d5ec)[_0x804b('0x2b')](_0x2d88da);};}exports['index']=function(_0x3eb531,_0x2931ff){var _0x410871={},_0x5c7026={},_0x3dbd41={'count':0x0,'rows':[]};var _0x407357=_[_0x804b('0x2c')](db['ZendeskAccount'][_0x804b('0x2d')],function(_0x471c04){return{'name':_0x471c04['fieldName'],'type':_0x471c04[_0x804b('0x2e')][_0x804b('0x2f')]};});_0x5c7026[_0x804b('0x30')]=_[_0x804b('0x2c')](_0x407357,_0x804b('0x2a'));_0x5c7026[_0x804b('0x31')]=_['keys'](_0x3eb531[_0x804b('0x31')]);_0x5c7026[_0x804b('0x32')]=_[_0x804b('0x33')](_0x5c7026[_0x804b('0x30')],_0x5c7026[_0x804b('0x31')]);_0x410871[_0x804b('0x34')]=_[_0x804b('0x33')](_0x5c7026[_0x804b('0x30')],qs[_0x804b('0x35')](_0x3eb531[_0x804b('0x31')][_0x804b('0x35')]));_0x410871[_0x804b('0x34')]=_0x410871[_0x804b('0x34')][_0x804b('0x36')]?_0x410871[_0x804b('0x34')]:_0x5c7026[_0x804b('0x30')];if(!_0x3eb531[_0x804b('0x31')][_0x804b('0x37')](_0x804b('0x38'))){_0x410871[_0x804b('0x1c')]=qs[_0x804b('0x1c')](_0x3eb531[_0x804b('0x31')][_0x804b('0x1c')]);_0x410871[_0x804b('0x1e')]=qs[_0x804b('0x1e')](_0x3eb531['query']['offset']);}_0x410871['order']=qs[_0x804b('0x39')](_0x3eb531[_0x804b('0x31')][_0x804b('0x39')]);_0x410871['where']=qs['filters'](_['pick'](_0x3eb531[_0x804b('0x31')],_0x5c7026[_0x804b('0x32')]),_0x407357);if(_0x3eb531[_0x804b('0x31')][_0x804b('0x3a')]){_0x410871[_0x804b('0x3b')]=_[_0x804b('0x3c')](_0x410871[_0x804b('0x3b')],{'$or':_[_0x804b('0x2c')](_0x407357,function(_0x27ba88){if(_0x27ba88[_0x804b('0x2e')]!==_0x804b('0x3d')){var _0x22a3fa={};_0x22a3fa[_0x27ba88[_0x804b('0x2a')]]={'$like':'%'+_0x3eb531['query'][_0x804b('0x3a')]+'%'};return _0x22a3fa;}})});}_0x410871=_[_0x804b('0x3c')]({},_0x410871,_0x3eb531[_0x804b('0x3e')]);var _0x3d6d8a={'where':_0x410871[_0x804b('0x3b')]};return db['ZendeskAccount']['count'](_0x3d6d8a)[_0x804b('0x26')](function(_0x2afafd){_0x3dbd41[_0x804b('0x1d')]=_0x2afafd;if(_0x3eb531['query'][_0x804b('0x3f')]){_0x410871['include']=[{'all':!![]}];}return db[_0x804b('0x40')][_0x804b('0x41')](_0x410871);})[_0x804b('0x26')](function(_0x304710){_0x3dbd41[_0x804b('0x42')]=_0x304710;return _0x3dbd41;})[_0x804b('0x26')](respondWithFilteredResult(_0x2931ff,_0x410871))[_0x804b('0x43')](handleError(_0x2931ff,null));};exports['show']=function(_0x17972a,_0x1c0363){var _0x1dcec8={'raw':![],'where':{'id':_0x17972a['params']['id']}},_0x1d25f6={};_0x1d25f6[_0x804b('0x30')]=_[_0x804b('0x44')](db[_0x804b('0x40')][_0x804b('0x2d')]);_0x1d25f6[_0x804b('0x31')]=_[_0x804b('0x44')](_0x17972a[_0x804b('0x31')]);_0x1d25f6[_0x804b('0x32')]=_['intersection'](_0x1d25f6[_0x804b('0x30')],_0x1d25f6['query']);_0x1dcec8['attributes']=_['intersection'](_0x1d25f6[_0x804b('0x30')],qs['fields'](_0x17972a[_0x804b('0x31')][_0x804b('0x35')]));_0x1dcec8[_0x804b('0x34')]=_0x1dcec8[_0x804b('0x34')]['length']?_0x1dcec8[_0x804b('0x34')]:_0x1d25f6[_0x804b('0x30')];if(_0x17972a[_0x804b('0x31')]['includeAll']){_0x1dcec8[_0x804b('0x45')]=[{'all':!![]}];}_0x1dcec8=_[_0x804b('0x3c')]({},_0x1dcec8,_0x17972a[_0x804b('0x3e')]);return db['ZendeskAccount'][_0x804b('0x46')](_0x1dcec8)[_0x804b('0x26')](handleEntityNotFound(_0x1c0363,null))[_0x804b('0x26')](respondWithResult(_0x1c0363,null))[_0x804b('0x43')](handleError(_0x1c0363,null));};exports[_0x804b('0x47')]=function(_0x3a39f5,_0x392bc0){return db[_0x804b('0x40')][_0x804b('0x47')](_0x3a39f5[_0x804b('0x48')],{})[_0x804b('0x26')](respondWithResult(_0x392bc0,0xc9))[_0x804b('0x43')](handleError(_0x392bc0,null));};exports[_0x804b('0x25')]=function(_0x2c1796,_0x578e92){if(_0x2c1796['body']['id']){delete _0x2c1796[_0x804b('0x48')]['id'];}return db[_0x804b('0x40')][_0x804b('0x46')]({'where':{'id':_0x2c1796[_0x804b('0x49')]['id']}})[_0x804b('0x26')](handleEntityNotFound(_0x578e92,null))['then'](saveUpdates(_0x2c1796[_0x804b('0x48')],null))[_0x804b('0x26')](respondWithResult(_0x578e92,null))[_0x804b('0x43')](handleError(_0x578e92,null));};exports[_0x804b('0x27')]=function(_0x47247c,_0x111e3f){return db['ZendeskAccount']['find']({'where':{'id':_0x47247c[_0x804b('0x49')]['id']}})[_0x804b('0x26')](handleEntityNotFound(_0x111e3f,null))['then'](removeEntity(_0x111e3f,null))['catch'](handleError(_0x111e3f,null));};exports[_0x804b('0x4a')]=function(_0x3d56bb,_0x4a5068,_0x4efe2a){var _0x164c5d={};var _0x38c2c0={};var _0x54cc99;var _0x2756de;return db['ZendeskAccount'][_0x804b('0x4b')]({'where':{'id':_0x3d56bb['params']['id']}})[_0x804b('0x26')](handleEntityNotFound(_0x4a5068,null))[_0x804b('0x26')](function(_0x47c835){if(_0x47c835){_0x54cc99=_0x47c835;_0x38c2c0[_0x804b('0x30')]=_['keys'](db[_0x804b('0x4c')][_0x804b('0x2d')]);_0x38c2c0[_0x804b('0x31')]=_[_0x804b('0x44')](_0x3d56bb[_0x804b('0x31')]);_0x38c2c0[_0x804b('0x32')]=_[_0x804b('0x33')](_0x38c2c0[_0x804b('0x30')],_0x38c2c0[_0x804b('0x31')]);_0x164c5d[_0x804b('0x34')]=_['intersection'](_0x38c2c0['model'],qs[_0x804b('0x35')](_0x3d56bb['query']['fields']));_0x164c5d[_0x804b('0x34')]=_0x164c5d[_0x804b('0x34')][_0x804b('0x36')]?_0x164c5d[_0x804b('0x34')]:_0x38c2c0['model'];_0x164c5d['order']=qs[_0x804b('0x39')](_0x3d56bb[_0x804b('0x31')][_0x804b('0x39')]);_0x164c5d[_0x804b('0x3b')]=qs[_0x804b('0x32')](_[_0x804b('0x4d')](_0x3d56bb[_0x804b('0x31')],_0x38c2c0[_0x804b('0x32')]));if(_0x3d56bb[_0x804b('0x31')][_0x804b('0x3a')]){_0x164c5d[_0x804b('0x3b')]=_[_0x804b('0x3c')](_0x164c5d[_0x804b('0x3b')],{'$or':_[_0x804b('0x2c')](_0x164c5d[_0x804b('0x34')],function(_0x3d98a2){var _0x524291={};_0x524291[_0x3d98a2]={'$like':'%'+_0x3d56bb[_0x804b('0x31')][_0x804b('0x3a')]+'%'};return _0x524291;})});}_0x164c5d=_['merge']({},_0x164c5d,_0x3d56bb[_0x804b('0x3e')]);return _0x54cc99[_0x804b('0x4a')](_0x164c5d);}})[_0x804b('0x26')](function(_0x2576a4){if(_0x2576a4){_0x2756de=_0x2576a4['length'];if(!_0x3d56bb[_0x804b('0x31')][_0x804b('0x37')]('nolimit')){_0x164c5d[_0x804b('0x1c')]=qs[_0x804b('0x1c')](_0x3d56bb[_0x804b('0x31')]['limit']);_0x164c5d[_0x804b('0x1e')]=qs[_0x804b('0x1e')](_0x3d56bb[_0x804b('0x31')][_0x804b('0x1e')]);}return _0x54cc99[_0x804b('0x4a')](_0x164c5d);}})['then'](function(_0xb08c4e){if(_0xb08c4e){return _0xb08c4e?{'count':_0x2756de,'rows':_0xb08c4e}:null;}})[_0x804b('0x26')](respondWithResult(_0x4a5068,null))[_0x804b('0x43')](handleError(_0x4a5068,null));};exports[_0x804b('0x4e')]=function(_0x5dcc63,_0x4f8a81,_0x183796){if(_0x5dcc63['body']['id']){delete _0x5dcc63[_0x804b('0x48')]['id'];}return db[_0x804b('0x40')][_0x804b('0x4b')]({'where':{'id':_0x5dcc63[_0x804b('0x49')]['id']}})[_0x804b('0x26')](handleEntityNotFound(_0x4f8a81,null))['then'](function(_0x27f06c){if(_0x27f06c){_0x5dcc63[_0x804b('0x48')][_0x804b('0x4f')]=_0x27f06c['id'];_0x5dcc63['body'][_0x804b('0x50')]=integrations[_0x804b('0x51')](_0x5dcc63['body'][_0x804b('0x52')],_0x5dcc63['body'][_0x804b('0x2e')]);_0x5dcc63[_0x804b('0x48')]['Descriptions']=integrations[_0x804b('0x53')](_0x5dcc63[_0x804b('0x48')][_0x804b('0x52')],_0x5dcc63['body'][_0x804b('0x2e')]);return db['ZendeskConfiguration'][_0x804b('0x47')](_0x5dcc63[_0x804b('0x48')],{'include':[{'model':db[_0x804b('0x54')],'as':_0x804b('0x50')},{'model':db['ZendeskField'],'as':_0x804b('0x55')}]});}return null;})[_0x804b('0x26')](respondWithResult(_0x4f8a81,null))[_0x804b('0x43')](handleError(_0x4f8a81,null));};exports[_0x804b('0x56')]=function(_0x17e21c,_0x1bb4ec,_0x5b3b79){var _0x39ed3c='';return db[_0x804b('0x40')]['findOne']({'where':{'id':_0x17e21c[_0x804b('0x49')]['id']},'attributes':['id',_0x804b('0x57'),_0x804b('0x58'),_0x804b('0x59'),'authType',_0x804b('0x5a')]})[_0x804b('0x26')](handleEntityNotFound(_0x1bb4ec,null))['then'](function(_0x2541cd){if(_0x2541cd){_0x39ed3c=_0x2541cd[_0x804b('0x5a')];var _0x549504=_0x39ed3c[_0x804b('0x5b')](-0x1);if(_0x549504==='/'){_0x39ed3c=_0x39ed3c['substring'](0x0,_0x39ed3c[_0x804b('0x5c')](_0x549504));}var _0x3e2813={'method':_0x804b('0x5d'),'uri':util[_0x804b('0x5e')](_0x804b('0x5f'),_0x39ed3c,_0x804b('0x60')),'json':!![]};switch(_0x2541cd[_0x804b('0x61')]){case'password':_0x3e2813[_0x804b('0x62')]={'Authorization':util['format'](_0x804b('0x63'),new Buffer(util[_0x804b('0x5e')](_0x804b('0x64'),_0x2541cd[_0x804b('0x57')],_0x2541cd[_0x804b('0x58')]))[_0x804b('0x65')](_0x804b('0x66')))};break;case _0x804b('0x59'):_0x3e2813[_0x804b('0x62')]={'Authorization':util[_0x804b('0x5e')](_0x804b('0x63'),new Buffer(util['format']('%s/token:%s',_0x2541cd[_0x804b('0x57')],_0x2541cd[_0x804b('0x59')]))[_0x804b('0x65')](_0x804b('0x66')))};break;default:throw new db['Sequelize'][(_0x804b('0x67'))](_0x804b('0x68'));}return rp(_0x3e2813);}})[_0x804b('0x26')](function(_0x3dda89){if(_0x3dda89){var _0x260419=[_0x804b('0x69'),_0x804b('0x6a'),_0x804b('0x6b'),_0x804b('0x6c')];_[_0x804b('0x6d')](_0x3dda89['ticket_fields'],function(_0x5a6661){return _0x260419[_0x804b('0x6e')](_0x5a6661[_0x804b('0x2e')]);});return{'count':_0x3dda89['ticket_fields'][_0x804b('0x36')],'rows':_[_0x804b('0x2c')](_0x3dda89['ticket_fields'],function(_0x345bf7){return{'id':_0x345bf7['id'],'name':_0x345bf7['position']>0x7?_0x345bf7['title']:_0x345bf7[_0x804b('0x2e')],'custom':_0x345bf7[_0x804b('0x6f')]>0x7?!![]:![],'options':_0x345bf7['system_field_options']?_0x345bf7['system_field_options']:_0x345bf7[_0x804b('0x70')]?_0x345bf7[_0x804b('0x70')]:[]};})};}})['then'](respondWithResult(_0x1bb4ec,null))[_0x804b('0x43')](function(_0x5e2756){var _0x42dfc3=_0x17e21c[_0x804b('0x31')][_0x804b('0x71')]?0x1f4:_0x5e2756['statusCode']||0x1f4;logger[_0x804b('0x72')](_0x804b('0x73'),_0x804b('0x56'),_0x42dfc3,JSON[_0x804b('0x74')](_0x5e2756));delete _0x5e2756[_0x804b('0x2a')];if(_0x42dfc3===0x191){_0x42dfc3=0x190;}_0x1bb4ec[_0x804b('0x1a')](_0x42dfc3)[_0x804b('0x2b')](_0x17e21c[_0x804b('0x31')][_0x804b('0x71')]?{'message':_0x804b('0x75'),'statusCode':_0x5e2756['statusCode']}:_0x5e2756);});}; \ No newline at end of file +var _0xd914=['channel','ZendeskField','username','token','authType','remoteUri','substring','lastIndexOf','format','%s/%s','ticket_fields','password','headers','%s:%s','Basic\x20%s','%s/token:%s','toString','ValidationError','Unknown\x20authentication\x20type','group','position','title','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','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/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','index','ZendeskAccount','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','filter','merge','includeAll','include','findAll','rows','catch','show','params','keys','create','body','find','getConfigurations','findOne','ZendeskConfiguration','order','pick','map','options','nolimit','addConfiguration','AccountId','Subjects','Descriptions','getDescriptions'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd914,0x17f));var _0x4d91=function(_0x4e198a,_0x5a6bad){_0x4e198a=_0x4e198a-0x0;var _0xb84bfe=_0xd914[_0x4e198a];return _0xb84bfe;};'use strict';var emlformat=require(_0x4d91('0x0'));var rimraf=require(_0x4d91('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4d91('0x2'));var rp=require(_0x4d91('0x3'));var moment=require(_0x4d91('0x4'));var BPromise=require(_0x4d91('0x5'));var Mustache=require(_0x4d91('0x6'));var util=require(_0x4d91('0x7'));var path=require('path');var sox=require(_0x4d91('0x8'));var csv=require('to-csv');var ejs=require(_0x4d91('0x9'));var fs=require('fs');var fs_extra=require(_0x4d91('0xa'));var _=require(_0x4d91('0xb'));var squel=require(_0x4d91('0xc'));var crypto=require(_0x4d91('0xd'));var jsforce=require(_0x4d91('0xe'));var deskjs=require(_0x4d91('0xf'));var toCsv=require(_0x4d91('0x10'));var querystring=require('querystring');var Papa=require(_0x4d91('0x11'));var Redis=require(_0x4d91('0x12'));var authService=require(_0x4d91('0x13'));var qs=require(_0x4d91('0x14'));var as=require(_0x4d91('0x15'));var hardwareService=require(_0x4d91('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x4d91('0x17'));var config=require(_0x4d91('0x18'));var licenseUtil=require(_0x4d91('0x19'));var db=require(_0x4d91('0x1a'))['db'];var integrations=require(_0x4d91('0x1b'));function respondWithStatusCode(_0x318e0c,_0x4ea591){_0x4ea591=_0x4ea591||0xcc;return function(_0x577a69){if(_0x577a69){return _0x318e0c[_0x4d91('0x1c')](_0x4ea591);}return _0x318e0c[_0x4d91('0x1d')](_0x4ea591)[_0x4d91('0x1e')]();};}function respondWithResult(_0x3c9fd6,_0x33fbd4){_0x33fbd4=_0x33fbd4||0xc8;return function(_0x25bafc){if(_0x25bafc){return _0x3c9fd6[_0x4d91('0x1d')](_0x33fbd4)['json'](_0x25bafc);}};}function respondWithFilteredResult(_0x3a8ec9,_0x42631a){return function(_0x1e2ef7){if(_0x1e2ef7){var _0xb92681=typeof _0x42631a[_0x4d91('0x1f')]==='undefined'&&typeof _0x42631a[_0x4d91('0x20')]===_0x4d91('0x21');var _0x241564=_0x1e2ef7[_0x4d91('0x22')];var _0x4cfa40=_0xb92681?0x0:_0x42631a[_0x4d91('0x1f')];var _0x3b579b=_0xb92681?_0x1e2ef7[_0x4d91('0x22')]:_0x42631a['offset']+_0x42631a[_0x4d91('0x20')];var _0x127911;if(_0x3b579b>=_0x241564){_0x3b579b=_0x241564;_0x127911=0xc8;}else{_0x127911=0xce;}_0x3a8ec9[_0x4d91('0x1d')](_0x127911);return _0x3a8ec9[_0x4d91('0x23')](_0x4d91('0x24'),_0x4cfa40+'-'+_0x3b579b+'/'+_0x241564)[_0x4d91('0x25')](_0x1e2ef7);}return null;};}function patchUpdates(_0xc1d44f){return function(_0x193ca9){try{jsonpatch[_0x4d91('0x26')](_0x193ca9,_0xc1d44f,!![]);}catch(_0x226d85){return BPromise['reject'](_0x226d85);}return _0x193ca9[_0x4d91('0x27')]();};}function saveUpdates(_0x5f5236,_0x57913e){return function(_0x74a697){if(_0x74a697){return _0x74a697[_0x4d91('0x28')](_0x5f5236)[_0x4d91('0x29')](function(_0x9cb864){return _0x9cb864;});}return null;};}function removeEntity(_0x7d8cbf,_0x12b722){return function(_0x100cd4){if(_0x100cd4){return _0x100cd4[_0x4d91('0x2a')]()['then'](function(){_0x7d8cbf['status'](0xcc)[_0x4d91('0x1e')]();});}};}function handleEntityNotFound(_0x112923,_0x3bed98){return function(_0x45fc91){if(!_0x45fc91){_0x112923[_0x4d91('0x1c')](0x194);}return _0x45fc91;};}function handleError(_0x2c7d7a,_0x14bdb4){_0x14bdb4=_0x14bdb4||0x1f4;return function(_0x560966){logger[_0x4d91('0x2b')](_0x560966[_0x4d91('0x2c')]);if(_0x560966[_0x4d91('0x2d')]){delete _0x560966['name'];}_0x2c7d7a['status'](_0x14bdb4)[_0x4d91('0x2e')](_0x560966);};}exports[_0x4d91('0x2f')]=function(_0x5ed948,_0x50fe76){var _0x42d5a0={},_0x2d6981={},_0x43371e={'count':0x0,'rows':[]};var _0x17c7bc=_['map'](db[_0x4d91('0x30')][_0x4d91('0x31')],function(_0x468e95){return{'name':_0x468e95[_0x4d91('0x32')],'type':_0x468e95[_0x4d91('0x33')][_0x4d91('0x34')]};});_0x2d6981[_0x4d91('0x35')]=_['map'](_0x17c7bc,_0x4d91('0x2d'));_0x2d6981['query']=_['keys'](_0x5ed948[_0x4d91('0x36')]);_0x2d6981[_0x4d91('0x37')]=_['intersection'](_0x2d6981[_0x4d91('0x35')],_0x2d6981[_0x4d91('0x36')]);_0x42d5a0[_0x4d91('0x38')]=_[_0x4d91('0x39')](_0x2d6981[_0x4d91('0x35')],qs['fields'](_0x5ed948[_0x4d91('0x36')][_0x4d91('0x3a')]));_0x42d5a0[_0x4d91('0x38')]=_0x42d5a0[_0x4d91('0x38')][_0x4d91('0x3b')]?_0x42d5a0[_0x4d91('0x38')]:_0x2d6981['model'];if(!_0x5ed948[_0x4d91('0x36')][_0x4d91('0x3c')]('nolimit')){_0x42d5a0[_0x4d91('0x20')]=qs[_0x4d91('0x20')](_0x5ed948[_0x4d91('0x36')]['limit']);_0x42d5a0[_0x4d91('0x1f')]=qs[_0x4d91('0x1f')](_0x5ed948[_0x4d91('0x36')][_0x4d91('0x1f')]);}_0x42d5a0['order']=qs[_0x4d91('0x3d')](_0x5ed948[_0x4d91('0x36')][_0x4d91('0x3d')]);_0x42d5a0[_0x4d91('0x3e')]=qs['filters'](_['pick'](_0x5ed948[_0x4d91('0x36')],_0x2d6981[_0x4d91('0x37')]),_0x17c7bc);if(_0x5ed948['query'][_0x4d91('0x3f')]){_0x42d5a0[_0x4d91('0x3e')]=_[_0x4d91('0x40')](_0x42d5a0[_0x4d91('0x3e')],{'$or':_['map'](_0x17c7bc,function(_0x2eb7c7){if(_0x2eb7c7[_0x4d91('0x33')]!=='VIRTUAL'){var _0x1ba6cd={};_0x1ba6cd[_0x2eb7c7['name']]={'$like':'%'+_0x5ed948[_0x4d91('0x36')]['filter']+'%'};return _0x1ba6cd;}})});}_0x42d5a0=_[_0x4d91('0x40')]({},_0x42d5a0,_0x5ed948['options']);var _0x24fc69={'where':_0x42d5a0[_0x4d91('0x3e')]};return db[_0x4d91('0x30')][_0x4d91('0x22')](_0x24fc69)['then'](function(_0x5bcc9b){_0x43371e[_0x4d91('0x22')]=_0x5bcc9b;if(_0x5ed948['query'][_0x4d91('0x41')]){_0x42d5a0[_0x4d91('0x42')]=[{'all':!![]}];}return db['ZendeskAccount'][_0x4d91('0x43')](_0x42d5a0);})[_0x4d91('0x29')](function(_0x14db37){_0x43371e[_0x4d91('0x44')]=_0x14db37;return _0x43371e;})[_0x4d91('0x29')](respondWithFilteredResult(_0x50fe76,_0x42d5a0))[_0x4d91('0x45')](handleError(_0x50fe76,null));};exports[_0x4d91('0x46')]=function(_0x4f6254,_0x1e4c6d){var _0x4c70af={'raw':![],'where':{'id':_0x4f6254[_0x4d91('0x47')]['id']}},_0x41c06a={};_0x41c06a[_0x4d91('0x35')]=_[_0x4d91('0x48')](db[_0x4d91('0x30')][_0x4d91('0x31')]);_0x41c06a['query']=_['keys'](_0x4f6254[_0x4d91('0x36')]);_0x41c06a[_0x4d91('0x37')]=_['intersection'](_0x41c06a[_0x4d91('0x35')],_0x41c06a[_0x4d91('0x36')]);_0x4c70af[_0x4d91('0x38')]=_[_0x4d91('0x39')](_0x41c06a[_0x4d91('0x35')],qs[_0x4d91('0x3a')](_0x4f6254[_0x4d91('0x36')][_0x4d91('0x3a')]));_0x4c70af[_0x4d91('0x38')]=_0x4c70af['attributes']['length']?_0x4c70af[_0x4d91('0x38')]:_0x41c06a['model'];if(_0x4f6254[_0x4d91('0x36')][_0x4d91('0x41')]){_0x4c70af[_0x4d91('0x42')]=[{'all':!![]}];}_0x4c70af=_[_0x4d91('0x40')]({},_0x4c70af,_0x4f6254['options']);return db[_0x4d91('0x30')]['find'](_0x4c70af)['then'](handleEntityNotFound(_0x1e4c6d,null))[_0x4d91('0x29')](respondWithResult(_0x1e4c6d,null))[_0x4d91('0x45')](handleError(_0x1e4c6d,null));};exports[_0x4d91('0x49')]=function(_0xa03d75,_0x1f91ec){return db[_0x4d91('0x30')]['create'](_0xa03d75[_0x4d91('0x4a')],{})[_0x4d91('0x29')](respondWithResult(_0x1f91ec,0xc9))[_0x4d91('0x45')](handleError(_0x1f91ec,null));};exports[_0x4d91('0x28')]=function(_0x106e5b,_0x44e9ec){if(_0x106e5b[_0x4d91('0x4a')]['id']){delete _0x106e5b[_0x4d91('0x4a')]['id'];}return db[_0x4d91('0x30')][_0x4d91('0x4b')]({'where':{'id':_0x106e5b[_0x4d91('0x47')]['id']}})['then'](handleEntityNotFound(_0x44e9ec,null))[_0x4d91('0x29')](saveUpdates(_0x106e5b['body'],null))[_0x4d91('0x29')](respondWithResult(_0x44e9ec,null))[_0x4d91('0x45')](handleError(_0x44e9ec,null));};exports[_0x4d91('0x2a')]=function(_0x386935,_0x436a3d){return db[_0x4d91('0x30')][_0x4d91('0x4b')]({'where':{'id':_0x386935[_0x4d91('0x47')]['id']}})['then'](handleEntityNotFound(_0x436a3d,null))[_0x4d91('0x29')](removeEntity(_0x436a3d,null))[_0x4d91('0x45')](handleError(_0x436a3d,null));};exports[_0x4d91('0x4c')]=function(_0x2bba43,_0x26ecd7,_0x19e57e){var _0x5765ce={};var _0x4aae23={};var _0x392cc3;var _0x2159e4;return db[_0x4d91('0x30')][_0x4d91('0x4d')]({'where':{'id':_0x2bba43[_0x4d91('0x47')]['id']}})[_0x4d91('0x29')](handleEntityNotFound(_0x26ecd7,null))[_0x4d91('0x29')](function(_0x4138c5){if(_0x4138c5){_0x392cc3=_0x4138c5;_0x4aae23[_0x4d91('0x35')]=_[_0x4d91('0x48')](db[_0x4d91('0x4e')][_0x4d91('0x31')]);_0x4aae23[_0x4d91('0x36')]=_[_0x4d91('0x48')](_0x2bba43[_0x4d91('0x36')]);_0x4aae23[_0x4d91('0x37')]=_[_0x4d91('0x39')](_0x4aae23['model'],_0x4aae23['query']);_0x5765ce['attributes']=_[_0x4d91('0x39')](_0x4aae23[_0x4d91('0x35')],qs[_0x4d91('0x3a')](_0x2bba43['query'][_0x4d91('0x3a')]));_0x5765ce[_0x4d91('0x38')]=_0x5765ce[_0x4d91('0x38')]['length']?_0x5765ce['attributes']:_0x4aae23['model'];_0x5765ce[_0x4d91('0x4f')]=qs[_0x4d91('0x3d')](_0x2bba43[_0x4d91('0x36')][_0x4d91('0x3d')]);_0x5765ce[_0x4d91('0x3e')]=qs['filters'](_[_0x4d91('0x50')](_0x2bba43[_0x4d91('0x36')],_0x4aae23['filters']));if(_0x2bba43['query'][_0x4d91('0x3f')]){_0x5765ce['where']=_[_0x4d91('0x40')](_0x5765ce[_0x4d91('0x3e')],{'$or':_[_0x4d91('0x51')](_0x5765ce['attributes'],function(_0x2e0bff){var _0x3d6c26={};_0x3d6c26[_0x2e0bff]={'$like':'%'+_0x2bba43[_0x4d91('0x36')][_0x4d91('0x3f')]+'%'};return _0x3d6c26;})});}_0x5765ce=_[_0x4d91('0x40')]({},_0x5765ce,_0x2bba43[_0x4d91('0x52')]);return _0x392cc3[_0x4d91('0x4c')](_0x5765ce);}})['then'](function(_0x533572){if(_0x533572){_0x2159e4=_0x533572['length'];if(!_0x2bba43['query'][_0x4d91('0x3c')](_0x4d91('0x53'))){_0x5765ce[_0x4d91('0x20')]=qs['limit'](_0x2bba43[_0x4d91('0x36')]['limit']);_0x5765ce[_0x4d91('0x1f')]=qs[_0x4d91('0x1f')](_0x2bba43['query']['offset']);}return _0x392cc3[_0x4d91('0x4c')](_0x5765ce);}})[_0x4d91('0x29')](function(_0x31150f){if(_0x31150f){return _0x31150f?{'count':_0x2159e4,'rows':_0x31150f}:null;}})[_0x4d91('0x29')](respondWithResult(_0x26ecd7,null))[_0x4d91('0x45')](handleError(_0x26ecd7,null));};exports[_0x4d91('0x54')]=function(_0x7a94e2,_0x42e550,_0xd384a9){if(_0x7a94e2[_0x4d91('0x4a')]['id']){delete _0x7a94e2['body']['id'];}return db['ZendeskAccount'][_0x4d91('0x4d')]({'where':{'id':_0x7a94e2[_0x4d91('0x47')]['id']}})[_0x4d91('0x29')](handleEntityNotFound(_0x42e550,null))[_0x4d91('0x29')](function(_0x16ba26){if(_0x16ba26){_0x7a94e2[_0x4d91('0x4a')][_0x4d91('0x55')]=_0x16ba26['id'];_0x7a94e2[_0x4d91('0x4a')][_0x4d91('0x56')]=integrations['getSubjects'](_0x7a94e2['body']['channel'],_0x7a94e2['body'][_0x4d91('0x33')]);_0x7a94e2[_0x4d91('0x4a')][_0x4d91('0x57')]=integrations[_0x4d91('0x58')](_0x7a94e2[_0x4d91('0x4a')][_0x4d91('0x59')],_0x7a94e2[_0x4d91('0x4a')][_0x4d91('0x33')]);return db[_0x4d91('0x4e')][_0x4d91('0x49')](_0x7a94e2[_0x4d91('0x4a')],{'include':[{'model':db[_0x4d91('0x5a')],'as':_0x4d91('0x56')},{'model':db[_0x4d91('0x5a')],'as':_0x4d91('0x57')}]});}return null;})[_0x4d91('0x29')](respondWithResult(_0x42e550,null))[_0x4d91('0x45')](handleError(_0x42e550,null));};exports['getFields']=function(_0x4062c6,_0x1be4b1,_0xc4ef10){var _0x2e2105='';return db[_0x4d91('0x30')]['findOne']({'where':{'id':_0x4062c6[_0x4d91('0x47')]['id']},'attributes':['id',_0x4d91('0x5b'),'password',_0x4d91('0x5c'),_0x4d91('0x5d'),_0x4d91('0x5e')]})[_0x4d91('0x29')](handleEntityNotFound(_0x1be4b1,null))[_0x4d91('0x29')](function(_0x4bc5a0){if(_0x4bc5a0){_0x2e2105=_0x4bc5a0[_0x4d91('0x5e')];var _0x2a5bc0=_0x2e2105['slice'](-0x1);if(_0x2a5bc0==='/'){_0x2e2105=_0x2e2105[_0x4d91('0x5f')](0x0,_0x2e2105[_0x4d91('0x60')](_0x2a5bc0));}var _0xd94b29={'method':'GET','uri':util[_0x4d91('0x61')](_0x4d91('0x62'),_0x2e2105,_0x4d91('0x63')),'json':!![]};switch(_0x4bc5a0[_0x4d91('0x5d')]){case _0x4d91('0x64'):_0xd94b29[_0x4d91('0x65')]={'Authorization':util[_0x4d91('0x61')]('Basic\x20%s',new Buffer(util[_0x4d91('0x61')](_0x4d91('0x66'),_0x4bc5a0['username'],_0x4bc5a0[_0x4d91('0x64')]))['toString']('base64'))};break;case _0x4d91('0x5c'):_0xd94b29['headers']={'Authorization':util[_0x4d91('0x61')](_0x4d91('0x67'),new Buffer(util[_0x4d91('0x61')](_0x4d91('0x68'),_0x4bc5a0[_0x4d91('0x5b')],_0x4bc5a0[_0x4d91('0x5c')]))[_0x4d91('0x69')]('base64'))};break;default:throw new db['Sequelize'][(_0x4d91('0x6a'))](_0x4d91('0x6b'));}return rp(_0xd94b29);}})[_0x4d91('0x29')](function(_0x42164f){if(_0x42164f){var _0x1e3838=['subject','description',_0x4d91('0x6c'),'assignee'];_['remove'](_0x42164f[_0x4d91('0x63')],function(_0x54fea8){return _0x1e3838['includes'](_0x54fea8[_0x4d91('0x33')]);});return{'count':_0x42164f[_0x4d91('0x63')][_0x4d91('0x3b')],'rows':_['map'](_0x42164f['ticket_fields'],function(_0x52604d){return{'id':_0x52604d['id'],'name':_0x52604d[_0x4d91('0x6d')]>0x7?_0x52604d[_0x4d91('0x6e')]:_0x52604d[_0x4d91('0x33')],'custom':_0x52604d[_0x4d91('0x6d')]>0x7?!![]:![],'options':_0x52604d[_0x4d91('0x6f')]?_0x52604d[_0x4d91('0x6f')]:_0x52604d[_0x4d91('0x70')]?_0x52604d[_0x4d91('0x70')]:[]};})};}})[_0x4d91('0x29')](respondWithResult(_0x1be4b1,null))['catch'](function(_0xb9d1ff){var _0x579a9e=_0x4062c6['query'][_0x4d91('0x71')]?0x1f4:_0xb9d1ff[_0x4d91('0x72')]||0x1f4;logger[_0x4d91('0x2b')](_0x4d91('0x73'),'getFields',_0x579a9e,JSON[_0x4d91('0x74')](_0xb9d1ff));delete _0xb9d1ff[_0x4d91('0x2d')];if(_0x579a9e===0x191){_0x579a9e=0x190;}_0x1be4b1[_0x4d91('0x1d')](_0x579a9e)[_0x4d91('0x2e')](_0x4062c6[_0x4d91('0x36')][_0x4d91('0x71')]?{'message':_0x4d91('0x75'),'statusCode':_0xb9d1ff['statusCode']}:_0xb9d1ff);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 01f3335..bdee635 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 _0x9d01=['request-promise','path','rimraf','../../config/environment','./intZendeskAccount.attributes','define','int_zendesk_accounts','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x15a050,_0x7893c0){var _0x127bf7=function(_0x37b711){while(--_0x37b711){_0x15a050['push'](_0x15a050['shift']());}};_0x127bf7(++_0x7893c0);}(_0x9d01,0x13f));var _0x19d0=function(_0x5383f1,_0x327fb3){_0x5383f1=_0x5383f1-0x0;var _0xa23930=_0x9d01[_0x5383f1];return _0xa23930;};'use strict';var _=require(_0x19d0('0x0'));var util=require(_0x19d0('0x1'));var logger=require(_0x19d0('0x2'))(_0x19d0('0x3'));var moment=require(_0x19d0('0x4'));var BPromise=require(_0x19d0('0x5'));var rp=require(_0x19d0('0x6'));var fs=require('fs');var path=require(_0x19d0('0x7'));var rimraf=require(_0x19d0('0x8'));var config=require(_0x19d0('0x9'));var attributes=require(_0x19d0('0xa'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x3c1e18,_0x279118){return _0x3c1e18[_0x19d0('0xb')]('ZendeskAccount',attributes,{'tableName':_0x19d0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9d0d=['../../components/integrations/configuration','exports','define','int_zendesk_accounts','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskAccount.attributes'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x9d0d,0x118));var _0xd9d0=function(_0x543cd8,_0x4c5dc3){_0x543cd8=_0x543cd8-0x0;var _0x64622b=_0x9d0d[_0x543cd8];return _0x64622b;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xd9d0('0x0'));var moment=require(_0xd9d0('0x1'));var BPromise=require(_0xd9d0('0x2'));var rp=require(_0xd9d0('0x3'));var fs=require('fs');var path=require(_0xd9d0('0x4'));var rimraf=require(_0xd9d0('0x5'));var config=require(_0xd9d0('0x6'));var attributes=require(_0xd9d0('0x7'));var integrations=require(_0xd9d0('0x8'));module[_0xd9d0('0x9')]=function(_0x5ee391,_0x52dbcc){return _0x5ee391[_0xd9d0('0xa')]('ZendeskAccount',attributes,{'tableName':_0xd9d0('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 1cfa726..5158956 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 _0x56d8=['jayson/promise','client','http','then','ZendeskAccount,\x20%s,\x20%s','ZendeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','where','attributes','limit','include','model','map','debug','ShowZendeskAccount','find','info','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x475955,_0x22835d){var _0x25c590=function(_0x577c83){while(--_0x577c83){_0x475955['push'](_0x475955['shift']());}};_0x25c590(++_0x22835d);}(_0x56d8,0x11f));var _0x856d=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x56d8[_0xefd519];return _0x4bb882;};'use strict';var _=require(_0x856d('0x0'));var util=require('util');var moment=require(_0x856d('0x1'));var BPromise=require(_0x856d('0x2'));var rs=require(_0x856d('0x3'));var fs=require('fs');var Redis=require(_0x856d('0x4'));var db=require(_0x856d('0x5'))['db'];var utils=require(_0x856d('0x6'));var logger=require(_0x856d('0x7'))('rpc');var config=require(_0x856d('0x8'));var jayson=require(_0x856d('0x9'));var client=jayson[_0x856d('0xa')][_0x856d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x44bb8b,_0x35ae2b,_0xb4e586){return new BPromise(function(_0x4f9f70,_0x2c14b7){return client['request'](_0x44bb8b,_0xb4e586)[_0x856d('0xc')](function(_0x233ee4){logger['info'](_0x856d('0xd'),_0x35ae2b,'request\x20sent');logger['debug'](_0x856d('0xe'),_0x35ae2b,_0x856d('0xf'),JSON[_0x856d('0x10')](_0x233ee4));if(_0x233ee4[_0x856d('0x11')]){if(_0x233ee4['error'][_0x856d('0x12')]===0x1f4){logger[_0x856d('0x11')]('ZendeskAccount,\x20%s,\x20%s',_0x35ae2b,_0x233ee4['error']['message']);return _0x2c14b7(_0x233ee4['error'][_0x856d('0x13')]);}logger['error'](_0x856d('0xd'),_0x35ae2b,_0x233ee4[_0x856d('0x11')][_0x856d('0x13')]);return _0x4f9f70(_0x233ee4[_0x856d('0x11')][_0x856d('0x13')]);}else{logger['info'](_0x856d('0xd'),_0x35ae2b,_0x856d('0xf'));_0x4f9f70(_0x233ee4[_0x856d('0x14')][_0x856d('0x13')]);}})[_0x856d('0x15')](function(_0x45a468){logger[_0x856d('0x11')]('ZendeskAccount,\x20%s,\x20%s',_0x35ae2b,_0x45a468);_0x2c14b7(_0x45a468);});});}exports[_0x856d('0x16')]=function(_0x5ca6f1){var _0x103ef4=this;return new Promise(function(_0x70dba1,_0x9a7ca4){return db[_0x856d('0x17')][_0x856d('0x18')]({'raw':_0x5ca6f1[_0x856d('0x19')]?_0x5ca6f1[_0x856d('0x19')][_0x856d('0x1a')]===undefined?!![]:![]:!![],'where':_0x5ca6f1['options']?_0x5ca6f1[_0x856d('0x19')][_0x856d('0x1b')]||null:null,'attributes':_0x5ca6f1[_0x856d('0x19')]?_0x5ca6f1[_0x856d('0x19')][_0x856d('0x1c')]||null:null,'limit':_0x5ca6f1[_0x856d('0x19')]?_0x5ca6f1[_0x856d('0x19')][_0x856d('0x1d')]||null:null,'include':_0x5ca6f1[_0x856d('0x19')]?_0x5ca6f1[_0x856d('0x19')][_0x856d('0x1e')]?_['map'](_0x5ca6f1[_0x856d('0x19')][_0x856d('0x1e')],function(_0x3f4edb){return{'model':db[_0x3f4edb[_0x856d('0x1f')]],'as':_0x3f4edb['as'],'attributes':_0x3f4edb['attributes'],'include':_0x3f4edb[_0x856d('0x1e')]?_[_0x856d('0x20')](_0x3f4edb['include'],function(_0x31ffed){return{'model':db[_0x31ffed[_0x856d('0x1f')]],'as':_0x31ffed['as'],'attributes':_0x31ffed['attributes'],'include':_0x31ffed[_0x856d('0x1e')]?_['map'](_0x31ffed[_0x856d('0x1e')],function(_0x553982){return{'model':db[_0x553982[_0x856d('0x1f')]],'as':_0x553982['as'],'attributes':_0x553982[_0x856d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x856d('0xc')](function(_0x5e8838){logger['info']('GetZendeskAccount',_0x5ca6f1);logger[_0x856d('0x21')](_0x856d('0x16'),_0x5ca6f1,JSON[_0x856d('0x10')](_0x5e8838));_0x70dba1(_0x5e8838);})[_0x856d('0x15')](function(_0x38ce65){logger[_0x856d('0x11')]('GetZendeskAccount',_0x38ce65[_0x856d('0x13')],_0x5ca6f1);_0x9a7ca4(_0x103ef4[_0x856d('0x11')](0x1f4,_0x38ce65['message']));});});};exports[_0x856d('0x22')]=function(_0x1baf08){var _0x171910=this;return new Promise(function(_0x4974a2,_0x1a7266){return db[_0x856d('0x17')][_0x856d('0x23')]({'raw':_0x1baf08[_0x856d('0x19')]?_0x1baf08[_0x856d('0x19')][_0x856d('0x1a')]===undefined?!![]:![]:!![],'where':_0x1baf08[_0x856d('0x19')]?_0x1baf08[_0x856d('0x19')][_0x856d('0x1b')]||null:null,'attributes':_0x1baf08[_0x856d('0x19')]?_0x1baf08['options'][_0x856d('0x1c')]||null:null,'include':_0x1baf08['options']?_0x1baf08[_0x856d('0x19')][_0x856d('0x1e')]?_[_0x856d('0x20')](_0x1baf08['options']['include'],function(_0x4de707){return{'model':db[_0x4de707['model']],'as':_0x4de707['as'],'attributes':_0x4de707[_0x856d('0x1c')],'include':_0x4de707[_0x856d('0x1e')]?_[_0x856d('0x20')](_0x4de707['include'],function(_0xedb5ae){return{'model':db[_0xedb5ae[_0x856d('0x1f')]],'as':_0xedb5ae['as'],'attributes':_0xedb5ae[_0x856d('0x1c')],'include':_0xedb5ae[_0x856d('0x1e')]?_[_0x856d('0x20')](_0xedb5ae[_0x856d('0x1e')],function(_0x13e709){return{'model':db[_0x13e709[_0x856d('0x1f')]],'as':_0x13e709['as'],'attributes':_0x13e709['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x51c0a4){logger[_0x856d('0x24')]('ShowZendeskAccount',_0x1baf08);logger[_0x856d('0x21')]('ShowZendeskAccount',_0x1baf08,JSON['stringify'](_0x51c0a4));_0x4974a2(_0x51c0a4);})[_0x856d('0x15')](function(_0x2572fb){logger[_0x856d('0x11')](_0x856d('0x22'),_0x2572fb[_0x856d('0x13')],_0x1baf08);_0x1a7266(_0x171910[_0x856d('0x11')](0x1f4,_0x2572fb[_0x856d('0x13')]));});});}; \ No newline at end of file +var _0x3c21=['map','attributes','model','stringify','ShowZendeskAccount','where','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','debug','request\x20sent','error','code','ZendeskAccount,\x20%s,\x20%s','message','result','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','limit','include'];(function(_0x59cac8,_0xa09b00){var _0x2243e8=function(_0x44d90a){while(--_0x44d90a){_0x59cac8['push'](_0x59cac8['shift']());}};_0x2243e8(++_0xa09b00);}(_0x3c21,0x19e));var _0x13c2=function(_0x336145,_0x8a6e42){_0x336145=_0x336145-0x0;var _0x34daf4=_0x3c21[_0x336145];return _0x34daf4;};'use strict';var _=require('lodash');var util=require(_0x13c2('0x0'));var moment=require('moment');var BPromise=require(_0x13c2('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x13c2('0x2'));var db=require(_0x13c2('0x3'))['db'];var utils=require(_0x13c2('0x4'));var logger=require(_0x13c2('0x5'))('rpc');var config=require(_0x13c2('0x6'));var jayson=require(_0x13c2('0x7'));var client=jayson[_0x13c2('0x8')][_0x13c2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xc30c80,_0x8f69,_0x31a3c9){return new BPromise(function(_0x45e9b2,_0x185f44){return client[_0x13c2('0xa')](_0xc30c80,_0x31a3c9)[_0x13c2('0xb')](function(_0x4330d0){logger[_0x13c2('0xc')]('ZendeskAccount,\x20%s,\x20%s',_0x8f69,'request\x20sent');logger[_0x13c2('0xd')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x8f69,_0x13c2('0xe'),JSON['stringify'](_0x4330d0));if(_0x4330d0[_0x13c2('0xf')]){if(_0x4330d0[_0x13c2('0xf')][_0x13c2('0x10')]===0x1f4){logger[_0x13c2('0xf')](_0x13c2('0x11'),_0x8f69,_0x4330d0[_0x13c2('0xf')][_0x13c2('0x12')]);return _0x185f44(_0x4330d0[_0x13c2('0xf')][_0x13c2('0x12')]);}logger[_0x13c2('0xf')](_0x13c2('0x11'),_0x8f69,_0x4330d0['error'][_0x13c2('0x12')]);return _0x45e9b2(_0x4330d0['error'][_0x13c2('0x12')]);}else{logger[_0x13c2('0xc')]('ZendeskAccount,\x20%s,\x20%s',_0x8f69,_0x13c2('0xe'));_0x45e9b2(_0x4330d0[_0x13c2('0x13')]['message']);}})[_0x13c2('0x14')](function(_0x506737){logger[_0x13c2('0xf')](_0x13c2('0x11'),_0x8f69,_0x506737);_0x185f44(_0x506737);});});}exports[_0x13c2('0x15')]=function(_0x3e266a){var _0x82d3e9=this;return new Promise(function(_0x3df2ac,_0x33a9fe){return db[_0x13c2('0x16')][_0x13c2('0x17')]({'raw':_0x3e266a['options']?_0x3e266a[_0x13c2('0x18')][_0x13c2('0x19')]===undefined?!![]:![]:!![],'where':_0x3e266a['options']?_0x3e266a[_0x13c2('0x18')]['where']||null:null,'attributes':_0x3e266a[_0x13c2('0x18')]?_0x3e266a[_0x13c2('0x18')]['attributes']||null:null,'limit':_0x3e266a[_0x13c2('0x18')]?_0x3e266a[_0x13c2('0x18')][_0x13c2('0x1a')]||null:null,'include':_0x3e266a['options']?_0x3e266a[_0x13c2('0x18')][_0x13c2('0x1b')]?_[_0x13c2('0x1c')](_0x3e266a[_0x13c2('0x18')][_0x13c2('0x1b')],function(_0x49f698){return{'model':db[_0x49f698['model']],'as':_0x49f698['as'],'attributes':_0x49f698[_0x13c2('0x1d')],'include':_0x49f698['include']?_[_0x13c2('0x1c')](_0x49f698[_0x13c2('0x1b')],function(_0x54a78c){return{'model':db[_0x54a78c[_0x13c2('0x1e')]],'as':_0x54a78c['as'],'attributes':_0x54a78c[_0x13c2('0x1d')],'include':_0x54a78c[_0x13c2('0x1b')]?_[_0x13c2('0x1c')](_0x54a78c[_0x13c2('0x1b')],function(_0x36fb9c){return{'model':db[_0x36fb9c[_0x13c2('0x1e')]],'as':_0x36fb9c['as'],'attributes':_0x36fb9c[_0x13c2('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x13c2('0xb')](function(_0x46139d){logger[_0x13c2('0xc')](_0x13c2('0x15'),_0x3e266a);logger[_0x13c2('0xd')](_0x13c2('0x15'),_0x3e266a,JSON[_0x13c2('0x1f')](_0x46139d));_0x3df2ac(_0x46139d);})[_0x13c2('0x14')](function(_0x499458){logger[_0x13c2('0xf')](_0x13c2('0x15'),_0x499458['message'],_0x3e266a);_0x33a9fe(_0x82d3e9[_0x13c2('0xf')](0x1f4,_0x499458[_0x13c2('0x12')]));});});};exports[_0x13c2('0x20')]=function(_0x4c1d0a){var _0x1b3fc8=this;return new Promise(function(_0x546089,_0xa9927){return db[_0x13c2('0x16')]['find']({'raw':_0x4c1d0a[_0x13c2('0x18')]?_0x4c1d0a[_0x13c2('0x18')][_0x13c2('0x19')]===undefined?!![]:![]:!![],'where':_0x4c1d0a[_0x13c2('0x18')]?_0x4c1d0a['options'][_0x13c2('0x21')]||null:null,'attributes':_0x4c1d0a[_0x13c2('0x18')]?_0x4c1d0a[_0x13c2('0x18')][_0x13c2('0x1d')]||null:null,'include':_0x4c1d0a[_0x13c2('0x18')]?_0x4c1d0a[_0x13c2('0x18')][_0x13c2('0x1b')]?_['map'](_0x4c1d0a[_0x13c2('0x18')]['include'],function(_0x742d4d){return{'model':db[_0x742d4d[_0x13c2('0x1e')]],'as':_0x742d4d['as'],'attributes':_0x742d4d[_0x13c2('0x1d')],'include':_0x742d4d[_0x13c2('0x1b')]?_[_0x13c2('0x1c')](_0x742d4d['include'],function(_0x5a6df5){return{'model':db[_0x5a6df5[_0x13c2('0x1e')]],'as':_0x5a6df5['as'],'attributes':_0x5a6df5['attributes'],'include':_0x5a6df5[_0x13c2('0x1b')]?_['map'](_0x5a6df5['include'],function(_0xc1d0f2){return{'model':db[_0xc1d0f2[_0x13c2('0x1e')]],'as':_0xc1d0f2['as'],'attributes':_0xc1d0f2[_0x13c2('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x13c2('0xb')](function(_0x1f26fd){logger[_0x13c2('0xc')](_0x13c2('0x20'),_0x4c1d0a);logger[_0x13c2('0xd')](_0x13c2('0x20'),_0x4c1d0a,JSON[_0x13c2('0x1f')](_0x1f26fd));_0x546089(_0x1f26fd);})['catch'](function(_0x9668a9){logger[_0x13c2('0xf')]('ShowZendeskAccount',_0x9668a9[_0x13c2('0x12')],_0x4c1d0a);_0xa9927(_0x1b3fc8[_0x13c2('0xf')](0x1f4,_0x9668a9[_0x13c2('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index c6922ad..d4244f6 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 _0xbaf0=['isAuthenticated','index','/:id','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','getTags','post','create','/:id/tags','setTags','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get'];(function(_0x35d18b,_0x542a33){var _0x3142ab=function(_0x345357){while(--_0x345357){_0x35d18b['push'](_0x35d18b['shift']());}};_0x3142ab(++_0x542a33);}(_0xbaf0,0x12a));var _0x0baf=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xbaf0[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['show']);router[_0x0baf('0x9')]('/:id/fields',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0x9')](_0x0baf('0xe'),auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x9')](_0x0baf('0x10'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x11')]);router[_0x0baf('0x9')]('/:id/tags',auth['isAuthenticated'](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0x14')]);router['post'](_0x0baf('0x15'),auth['isAuthenticated'](),controller[_0x0baf('0x16')]);router[_0x0baf('0x17')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x18')]);router[_0x0baf('0x19')]('/:id',auth['isAuthenticated'](),controller[_0x0baf('0x1a')]);module[_0x0baf('0x1b')]=router; \ No newline at end of file +var _0xb688=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','update','exports','util'];(function(_0x8b631b,_0x386724){var _0x3e6832=function(_0x17a132){while(--_0x17a132){_0x8b631b['push'](_0x8b631b['shift']());}};_0x3e6832(++_0x386724);}(_0xb688,0xcf));var _0x8b68=function(_0xb4b80e,_0x1f02e8){_0xb4b80e=_0xb4b80e-0x0;var _0x5e4846=_0xb688[_0xb4b80e];return _0x5e4846;};'use strict';var multer=require('multer');var util=require(_0x8b68('0x0'));var path=require(_0x8b68('0x1'));var timeout=require(_0x8b68('0x2'));var express=require(_0x8b68('0x3'));var router=express[_0x8b68('0x4')]();var fs_extra=require(_0x8b68('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8b68('0x6'));var config=require(_0x8b68('0x7'));var controller=require(_0x8b68('0x8'));router[_0x8b68('0x9')]('/',auth['isAuthenticated'](),controller[_0x8b68('0xa')]);router['get'](_0x8b68('0xb'),auth[_0x8b68('0xc')](),controller[_0x8b68('0xd')]);router[_0x8b68('0x9')](_0x8b68('0xe'),auth[_0x8b68('0xc')](),controller[_0x8b68('0xf')]);router[_0x8b68('0x9')](_0x8b68('0x10'),auth[_0x8b68('0xc')](),controller[_0x8b68('0x11')]);router[_0x8b68('0x9')](_0x8b68('0x12'),auth['isAuthenticated'](),controller[_0x8b68('0x13')]);router[_0x8b68('0x9')](_0x8b68('0x14'),auth[_0x8b68('0xc')](),controller[_0x8b68('0x15')]);router[_0x8b68('0x16')]('/',auth[_0x8b68('0xc')](),controller[_0x8b68('0x17')]);router[_0x8b68('0x16')]('/:id/tags',auth[_0x8b68('0xc')](),controller['setTags']);router['put'](_0x8b68('0xb'),auth[_0x8b68('0xc')](),controller[_0x8b68('0x18')]);router['delete']('/:id',auth[_0x8b68('0xc')](),controller['destroy']);module[_0x8b68('0x19')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index a1c4be4..c6ffca0 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 _0x13e5=['sequelize','STRING'];(function(_0x593003,_0x775947){var _0x4a0b0d=function(_0x4a1e48){while(--_0x4a1e48){_0x593003['push'](_0x593003['shift']());}};_0x4a0b0d(++_0x775947);}(_0x13e5,0x1da));var _0x513e=function(_0x4d0027,_0x4518ca){_0x4d0027=_0x4d0027-0x0;var _0x313151=_0x13e5[_0x4d0027];return _0x313151;};'use strict';var Sequelize=require(_0x513e('0x0'));module['exports']={'name':{'type':Sequelize[_0x513e('0x1')]},'description':{'type':Sequelize[_0x513e('0x1')]}}; \ No newline at end of file +var _0xa072=['sequelize','exports','STRING'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xa072,0x16e));var _0x2a07=function(_0xd685e,_0x360045){_0xd685e=_0xd685e-0x0;var _0x5ef5e0=_0xa072[_0xd685e];return _0x5ef5e0;};'use strict';var Sequelize=require(_0x2a07('0x0'));module[_0x2a07('0x1')]={'name':{'type':Sequelize[_0x2a07('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index ea585a4..8525ced 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 _0xc7cc=['reject','update','then','destroy','end','index','map','ZendeskConfiguration','rawAttributes','type','key','model','name','keys','filters','intersection','fields','query','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','count','findAll','rows','catch','params','includeAll','include','find','create','body','getFields','findOne','ZendeskField','pick','getSubjects','order','getDescriptions','getTags','Tag','setTags','ids','rimraf','fast-json-patch','bluebird','util','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','Content-Range','apply'];(function(_0x5a4374,_0x4845d7){var _0x5b2fc1=function(_0x27ece4){while(--_0x27ece4){_0x5a4374['push'](_0x5a4374['shift']());}};_0x5b2fc1(++_0x4845d7);}(_0xc7cc,0x115));var _0xcc7c=function(_0x2a4200,_0x56fcf4){_0x2a4200=_0x2a4200-0x0;var _0x2d6704=_0xc7cc[_0x2a4200];return _0x2d6704;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcc7c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcc7c('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xcc7c('0x2'));var Mustache=require('mustache');var util=require(_0xcc7c('0x3'));var path=require('path');var sox=require('sox');var csv=require(_0xcc7c('0x4'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcc7c('0x5'));var squel=require(_0xcc7c('0x6'));var crypto=require(_0xcc7c('0x7'));var jsforce=require(_0xcc7c('0x8'));var deskjs=require(_0xcc7c('0x9'));var toCsv=require(_0xcc7c('0x4'));var querystring=require(_0xcc7c('0xa'));var Papa=require(_0xcc7c('0xb'));var Redis=require(_0xcc7c('0xc'));var authService=require('../../components/auth/service');var qs=require(_0xcc7c('0xd'));var as=require(_0xcc7c('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcc7c('0xf'))('api');var utils=require('../../config/utils');var config=require(_0xcc7c('0x10'));var licenseUtil=require(_0xcc7c('0x11'));var db=require(_0xcc7c('0x12'))['db'];function respondWithStatusCode(_0xfd79db,_0x578906){_0x578906=_0x578906||0xcc;return function(_0x8ce142){if(_0x8ce142){return _0xfd79db[_0xcc7c('0x13')](_0x578906);}return _0xfd79db[_0xcc7c('0x14')](_0x578906)['end']();};}function respondWithResult(_0x239c4d,_0x519f3e){_0x519f3e=_0x519f3e||0xc8;return function(_0x4d95e5){if(_0x4d95e5){return _0x239c4d['status'](_0x519f3e)[_0xcc7c('0x15')](_0x4d95e5);}};}function respondWithFilteredResult(_0x2b5815,_0x95b112){return function(_0x5bf444){if(_0x5bf444){var _0x54268c=typeof _0x95b112[_0xcc7c('0x16')]===_0xcc7c('0x17')&&typeof _0x95b112[_0xcc7c('0x18')]===_0xcc7c('0x17');var _0x3451ce=_0x5bf444['count'];var _0x3e87df=_0x54268c?0x0:_0x95b112['offset'];var _0x251439=_0x54268c?_0x5bf444['count']:_0x95b112[_0xcc7c('0x16')]+_0x95b112[_0xcc7c('0x18')];var _0x5f24cf;if(_0x251439>=_0x3451ce){_0x251439=_0x3451ce;_0x5f24cf=0xc8;}else{_0x5f24cf=0xce;}_0x2b5815[_0xcc7c('0x14')](_0x5f24cf);return _0x2b5815['set'](_0xcc7c('0x19'),_0x3e87df+'-'+_0x251439+'/'+_0x3451ce)['json'](_0x5bf444);}return null;};}function patchUpdates(_0x56b2ed){return function(_0x4e93d9){try{jsonpatch[_0xcc7c('0x1a')](_0x4e93d9,_0x56b2ed,!![]);}catch(_0x497b21){return BPromise[_0xcc7c('0x1b')](_0x497b21);}return _0x4e93d9['save']();};}function saveUpdates(_0x1aafcc,_0x2d770f){return function(_0x38ac8b){if(_0x38ac8b){return _0x38ac8b[_0xcc7c('0x1c')](_0x1aafcc)[_0xcc7c('0x1d')](function(_0x321f9b){return _0x321f9b;});}return null;};}function removeEntity(_0x285a69,_0x48d07a){return function(_0x1d795d){if(_0x1d795d){return _0x1d795d[_0xcc7c('0x1e')]()['then'](function(){_0x285a69['status'](0xcc)[_0xcc7c('0x1f')]();});}};}function handleEntityNotFound(_0x5bee1d,_0x5f2826){return function(_0x56127c){if(!_0x56127c){_0x5bee1d[_0xcc7c('0x13')](0x194);}return _0x56127c;};}function handleError(_0x14261a,_0x4082e8){_0x4082e8=_0x4082e8||0x1f4;return function(_0x890066){logger['error'](_0x890066['stack']);if(_0x890066['name']){delete _0x890066['name'];}_0x14261a[_0xcc7c('0x14')](_0x4082e8)['send'](_0x890066);};}exports[_0xcc7c('0x20')]=function(_0x10c12e,_0x247a78){var _0x2904d0={},_0x23c69b={},_0x5f142d={'count':0x0,'rows':[]};var _0x244670=_[_0xcc7c('0x21')](db[_0xcc7c('0x22')][_0xcc7c('0x23')],function(_0x44e665){return{'name':_0x44e665['fieldName'],'type':_0x44e665[_0xcc7c('0x24')][_0xcc7c('0x25')]};});_0x23c69b[_0xcc7c('0x26')]=_[_0xcc7c('0x21')](_0x244670,_0xcc7c('0x27'));_0x23c69b['query']=_[_0xcc7c('0x28')](_0x10c12e['query']);_0x23c69b[_0xcc7c('0x29')]=_['intersection'](_0x23c69b[_0xcc7c('0x26')],_0x23c69b['query']);_0x2904d0['attributes']=_[_0xcc7c('0x2a')](_0x23c69b['model'],qs[_0xcc7c('0x2b')](_0x10c12e[_0xcc7c('0x2c')][_0xcc7c('0x2b')]));_0x2904d0[_0xcc7c('0x2d')]=_0x2904d0[_0xcc7c('0x2d')][_0xcc7c('0x2e')]?_0x2904d0['attributes']:_0x23c69b[_0xcc7c('0x26')];if(!_0x10c12e[_0xcc7c('0x2c')][_0xcc7c('0x2f')](_0xcc7c('0x30'))){_0x2904d0[_0xcc7c('0x18')]=qs[_0xcc7c('0x18')](_0x10c12e['query'][_0xcc7c('0x18')]);_0x2904d0[_0xcc7c('0x16')]=qs[_0xcc7c('0x16')](_0x10c12e['query'][_0xcc7c('0x16')]);}_0x2904d0['order']=qs['sort'](_0x10c12e[_0xcc7c('0x2c')][_0xcc7c('0x31')]);_0x2904d0[_0xcc7c('0x32')]=qs[_0xcc7c('0x29')](_['pick'](_0x10c12e[_0xcc7c('0x2c')],_0x23c69b[_0xcc7c('0x29')]),_0x244670);if(_0x10c12e['query'][_0xcc7c('0x33')]){_0x2904d0[_0xcc7c('0x32')]=_[_0xcc7c('0x34')](_0x2904d0['where'],{'$or':_[_0xcc7c('0x21')](_0x244670,function(_0x2727ad){if(_0x2727ad[_0xcc7c('0x24')]!==_0xcc7c('0x35')){var _0x54bbc8={};_0x54bbc8[_0x2727ad['name']]={'$like':'%'+_0x10c12e[_0xcc7c('0x2c')][_0xcc7c('0x33')]+'%'};return _0x54bbc8;}})});}_0x2904d0=_['merge']({},_0x2904d0,_0x10c12e[_0xcc7c('0x36')]);var _0x306727={'where':_0x2904d0[_0xcc7c('0x32')]};return db[_0xcc7c('0x22')][_0xcc7c('0x37')](_0x306727)[_0xcc7c('0x1d')](function(_0x5442b1){_0x5f142d[_0xcc7c('0x37')]=_0x5442b1;if(_0x10c12e['query']['includeAll']){_0x2904d0['include']=[{'all':!![]}];}return db[_0xcc7c('0x22')][_0xcc7c('0x38')](_0x2904d0);})['then'](function(_0xd7d15f){_0x5f142d[_0xcc7c('0x39')]=_0xd7d15f;return _0x5f142d;})[_0xcc7c('0x1d')](respondWithFilteredResult(_0x247a78,_0x2904d0))[_0xcc7c('0x3a')](handleError(_0x247a78,null));};exports['show']=function(_0x1c0411,_0x4c79f9){var _0x546ac4={'raw':![],'where':{'id':_0x1c0411[_0xcc7c('0x3b')]['id']}},_0xac5d9d={};_0xac5d9d[_0xcc7c('0x26')]=_['keys'](db['ZendeskConfiguration'][_0xcc7c('0x23')]);_0xac5d9d['query']=_['keys'](_0x1c0411[_0xcc7c('0x2c')]);_0xac5d9d[_0xcc7c('0x29')]=_[_0xcc7c('0x2a')](_0xac5d9d['model'],_0xac5d9d[_0xcc7c('0x2c')]);_0x546ac4[_0xcc7c('0x2d')]=_['intersection'](_0xac5d9d[_0xcc7c('0x26')],qs[_0xcc7c('0x2b')](_0x1c0411[_0xcc7c('0x2c')][_0xcc7c('0x2b')]));_0x546ac4[_0xcc7c('0x2d')]=_0x546ac4[_0xcc7c('0x2d')]['length']?_0x546ac4['attributes']:_0xac5d9d[_0xcc7c('0x26')];if(_0x1c0411[_0xcc7c('0x2c')][_0xcc7c('0x3c')]){_0x546ac4[_0xcc7c('0x3d')]=[{'all':!![]}];}_0x546ac4=_[_0xcc7c('0x34')]({},_0x546ac4,_0x1c0411[_0xcc7c('0x36')]);return db[_0xcc7c('0x22')][_0xcc7c('0x3e')](_0x546ac4)['then'](handleEntityNotFound(_0x4c79f9,null))[_0xcc7c('0x1d')](respondWithResult(_0x4c79f9,null))[_0xcc7c('0x3a')](handleError(_0x4c79f9,null));};exports[_0xcc7c('0x3f')]=function(_0x39fa1a,_0x3ecce2){return db[_0xcc7c('0x22')]['create'](_0x39fa1a[_0xcc7c('0x40')],{})['then'](respondWithResult(_0x3ecce2,0xc9))[_0xcc7c('0x3a')](handleError(_0x3ecce2,null));};exports[_0xcc7c('0x1c')]=function(_0x12d035,_0x231317){if(_0x12d035['body']['id']){delete _0x12d035[_0xcc7c('0x40')]['id'];}return db[_0xcc7c('0x22')][_0xcc7c('0x3e')]({'where':{'id':_0x12d035[_0xcc7c('0x3b')]['id']}})[_0xcc7c('0x1d')](handleEntityNotFound(_0x231317,null))['then'](saveUpdates(_0x12d035['body'],null))[_0xcc7c('0x1d')](respondWithResult(_0x231317,null))['catch'](handleError(_0x231317,null));};exports['destroy']=function(_0x13e9d0,_0x539589){return db[_0xcc7c('0x22')]['find']({'where':{'id':_0x13e9d0[_0xcc7c('0x3b')]['id']}})[_0xcc7c('0x1d')](handleEntityNotFound(_0x539589,null))[_0xcc7c('0x1d')](removeEntity(_0x539589,null))[_0xcc7c('0x3a')](handleError(_0x539589,null));};exports[_0xcc7c('0x41')]=function(_0x44cd16,_0x428be8,_0x10d97){var _0x2abd97={};var _0x295bb2={};var _0x5399e7;var _0x4e2af3;return db[_0xcc7c('0x22')][_0xcc7c('0x42')]({'where':{'id':_0x44cd16[_0xcc7c('0x3b')]['id']}})['then'](handleEntityNotFound(_0x428be8,null))['then'](function(_0x555eb5){if(_0x555eb5){_0x5399e7=_0x555eb5;_0x295bb2[_0xcc7c('0x26')]=_[_0xcc7c('0x28')](db[_0xcc7c('0x43')][_0xcc7c('0x23')]);_0x295bb2[_0xcc7c('0x2c')]=_['keys'](_0x44cd16[_0xcc7c('0x2c')]);_0x295bb2[_0xcc7c('0x29')]=_[_0xcc7c('0x2a')](_0x295bb2[_0xcc7c('0x26')],_0x295bb2[_0xcc7c('0x2c')]);_0x2abd97[_0xcc7c('0x2d')]=_[_0xcc7c('0x2a')](_0x295bb2[_0xcc7c('0x26')],qs[_0xcc7c('0x2b')](_0x44cd16[_0xcc7c('0x2c')]['fields']));_0x2abd97[_0xcc7c('0x2d')]=_0x2abd97['attributes'][_0xcc7c('0x2e')]?_0x2abd97[_0xcc7c('0x2d')]:_0x295bb2[_0xcc7c('0x26')];_0x2abd97['order']=qs[_0xcc7c('0x31')](_0x44cd16[_0xcc7c('0x2c')][_0xcc7c('0x31')]);_0x2abd97[_0xcc7c('0x32')]=qs['filters'](_[_0xcc7c('0x44')](_0x44cd16[_0xcc7c('0x2c')],_0x295bb2['filters']));if(_0x44cd16[_0xcc7c('0x2c')][_0xcc7c('0x33')]){_0x2abd97[_0xcc7c('0x32')]=_[_0xcc7c('0x34')](_0x2abd97[_0xcc7c('0x32')],{'$or':_[_0xcc7c('0x21')](_0x2abd97[_0xcc7c('0x2d')],function(_0x4f9dd0){var _0x226e6f={};_0x226e6f[_0x4f9dd0]={'$like':'%'+_0x44cd16['query'][_0xcc7c('0x33')]+'%'};return _0x226e6f;})});}_0x2abd97=_['merge']({},_0x2abd97,_0x44cd16[_0xcc7c('0x36')]);return _0x5399e7[_0xcc7c('0x41')](_0x2abd97);}})[_0xcc7c('0x1d')](function(_0x306d0a){if(_0x306d0a){_0x4e2af3=_0x306d0a[_0xcc7c('0x2e')];if(!_0x44cd16[_0xcc7c('0x2c')]['hasOwnProperty'](_0xcc7c('0x30'))){_0x2abd97[_0xcc7c('0x18')]=qs['limit'](_0x44cd16[_0xcc7c('0x2c')][_0xcc7c('0x18')]);_0x2abd97[_0xcc7c('0x16')]=qs['offset'](_0x44cd16['query'][_0xcc7c('0x16')]);}return _0x5399e7['getFields'](_0x2abd97);}})[_0xcc7c('0x1d')](function(_0x8abe1){if(_0x8abe1){return _0x8abe1?{'count':_0x4e2af3,'rows':_0x8abe1}:null;}})[_0xcc7c('0x1d')](respondWithResult(_0x428be8,null))[_0xcc7c('0x3a')](handleError(_0x428be8,null));};exports[_0xcc7c('0x45')]=function(_0xc0b4a1,_0x4ee3c3,_0x2c58ad){var _0x5d3454={};var _0x449465={};var _0x29cb6d;var _0x3a333a;return db[_0xcc7c('0x22')][_0xcc7c('0x42')]({'where':{'id':_0xc0b4a1[_0xcc7c('0x3b')]['id']}})['then'](handleEntityNotFound(_0x4ee3c3,null))[_0xcc7c('0x1d')](function(_0xfa6b59){if(_0xfa6b59){_0x29cb6d=_0xfa6b59;_0x449465[_0xcc7c('0x26')]=_['keys'](db[_0xcc7c('0x43')][_0xcc7c('0x23')]);_0x449465['query']=_[_0xcc7c('0x28')](_0xc0b4a1['query']);_0x449465[_0xcc7c('0x29')]=_[_0xcc7c('0x2a')](_0x449465[_0xcc7c('0x26')],_0x449465[_0xcc7c('0x2c')]);_0x5d3454['attributes']=_['intersection'](_0x449465[_0xcc7c('0x26')],qs[_0xcc7c('0x2b')](_0xc0b4a1[_0xcc7c('0x2c')][_0xcc7c('0x2b')]));_0x5d3454['attributes']=_0x5d3454[_0xcc7c('0x2d')]['length']?_0x5d3454[_0xcc7c('0x2d')]:_0x449465[_0xcc7c('0x26')];_0x5d3454[_0xcc7c('0x46')]=qs['sort'](_0xc0b4a1[_0xcc7c('0x2c')][_0xcc7c('0x31')]);_0x5d3454[_0xcc7c('0x32')]=qs[_0xcc7c('0x29')](_[_0xcc7c('0x44')](_0xc0b4a1[_0xcc7c('0x2c')],_0x449465[_0xcc7c('0x29')]));if(_0xc0b4a1[_0xcc7c('0x2c')][_0xcc7c('0x33')]){_0x5d3454['where']=_[_0xcc7c('0x34')](_0x5d3454['where'],{'$or':_[_0xcc7c('0x21')](_0x5d3454['attributes'],function(_0x59c5ec){var _0x49961b={};_0x49961b[_0x59c5ec]={'$like':'%'+_0xc0b4a1['query'][_0xcc7c('0x33')]+'%'};return _0x49961b;})});}_0x5d3454=_[_0xcc7c('0x34')]({},_0x5d3454,_0xc0b4a1[_0xcc7c('0x36')]);return _0x29cb6d['getSubjects'](_0x5d3454);}})[_0xcc7c('0x1d')](function(_0x511f87){if(_0x511f87){_0x3a333a=_0x511f87[_0xcc7c('0x2e')];if(!_0xc0b4a1[_0xcc7c('0x2c')]['hasOwnProperty'](_0xcc7c('0x30'))){_0x5d3454['limit']=qs[_0xcc7c('0x18')](_0xc0b4a1[_0xcc7c('0x2c')][_0xcc7c('0x18')]);_0x5d3454[_0xcc7c('0x16')]=qs['offset'](_0xc0b4a1[_0xcc7c('0x2c')][_0xcc7c('0x16')]);}return _0x29cb6d[_0xcc7c('0x45')](_0x5d3454);}})[_0xcc7c('0x1d')](function(_0x1434fa){if(_0x1434fa){return _0x1434fa?{'count':_0x3a333a,'rows':_0x1434fa}:null;}})['then'](respondWithResult(_0x4ee3c3,null))[_0xcc7c('0x3a')](handleError(_0x4ee3c3,null));};exports['getDescriptions']=function(_0x4d57c8,_0x14299d,_0x470ef2){var _0x11e1a9={};var _0x400544={};var _0x11b83d;var _0x5d05a7;return db[_0xcc7c('0x22')][_0xcc7c('0x42')]({'where':{'id':_0x4d57c8['params']['id']}})[_0xcc7c('0x1d')](handleEntityNotFound(_0x14299d,null))[_0xcc7c('0x1d')](function(_0x355ab7){if(_0x355ab7){_0x11b83d=_0x355ab7;_0x400544['model']=_[_0xcc7c('0x28')](db['ZendeskField'][_0xcc7c('0x23')]);_0x400544[_0xcc7c('0x2c')]=_['keys'](_0x4d57c8[_0xcc7c('0x2c')]);_0x400544[_0xcc7c('0x29')]=_['intersection'](_0x400544[_0xcc7c('0x26')],_0x400544[_0xcc7c('0x2c')]);_0x11e1a9[_0xcc7c('0x2d')]=_['intersection'](_0x400544[_0xcc7c('0x26')],qs['fields'](_0x4d57c8[_0xcc7c('0x2c')][_0xcc7c('0x2b')]));_0x11e1a9['attributes']=_0x11e1a9[_0xcc7c('0x2d')][_0xcc7c('0x2e')]?_0x11e1a9['attributes']:_0x400544[_0xcc7c('0x26')];_0x11e1a9[_0xcc7c('0x46')]=qs[_0xcc7c('0x31')](_0x4d57c8[_0xcc7c('0x2c')][_0xcc7c('0x31')]);_0x11e1a9[_0xcc7c('0x32')]=qs['filters'](_[_0xcc7c('0x44')](_0x4d57c8[_0xcc7c('0x2c')],_0x400544[_0xcc7c('0x29')]));if(_0x4d57c8[_0xcc7c('0x2c')][_0xcc7c('0x33')]){_0x11e1a9[_0xcc7c('0x32')]=_[_0xcc7c('0x34')](_0x11e1a9[_0xcc7c('0x32')],{'$or':_['map'](_0x11e1a9[_0xcc7c('0x2d')],function(_0x4c08c7){var _0x10efd9={};_0x10efd9[_0x4c08c7]={'$like':'%'+_0x4d57c8['query']['filter']+'%'};return _0x10efd9;})});}_0x11e1a9=_[_0xcc7c('0x34')]({},_0x11e1a9,_0x4d57c8['options']);return _0x11b83d['getDescriptions'](_0x11e1a9);}})['then'](function(_0x484c1a){if(_0x484c1a){_0x5d05a7=_0x484c1a['length'];if(!_0x4d57c8['query'][_0xcc7c('0x2f')]('nolimit')){_0x11e1a9['limit']=qs['limit'](_0x4d57c8[_0xcc7c('0x2c')][_0xcc7c('0x18')]);_0x11e1a9[_0xcc7c('0x16')]=qs[_0xcc7c('0x16')](_0x4d57c8[_0xcc7c('0x2c')][_0xcc7c('0x16')]);}return _0x11b83d[_0xcc7c('0x47')](_0x11e1a9);}})[_0xcc7c('0x1d')](function(_0x227c36){if(_0x227c36){return _0x227c36?{'count':_0x5d05a7,'rows':_0x227c36}:null;}})[_0xcc7c('0x1d')](respondWithResult(_0x14299d,null))[_0xcc7c('0x3a')](handleError(_0x14299d,null));};exports[_0xcc7c('0x48')]=function(_0x1547ac,_0x38e349,_0x1cfeb3){var _0x1ac80f={};var _0x41a823={};var _0x5596e5;var _0x22327c;return db[_0xcc7c('0x22')][_0xcc7c('0x42')]({'where':{'id':_0x1547ac[_0xcc7c('0x3b')]['id']}})[_0xcc7c('0x1d')](handleEntityNotFound(_0x38e349,null))[_0xcc7c('0x1d')](function(_0x3eb72d){if(_0x3eb72d){_0x5596e5=_0x3eb72d;_0x41a823[_0xcc7c('0x26')]=_['keys'](db[_0xcc7c('0x49')][_0xcc7c('0x23')]);_0x41a823[_0xcc7c('0x2c')]=_[_0xcc7c('0x28')](_0x1547ac[_0xcc7c('0x2c')]);_0x41a823[_0xcc7c('0x29')]=_['intersection'](_0x41a823[_0xcc7c('0x26')],_0x41a823[_0xcc7c('0x2c')]);_0x1ac80f[_0xcc7c('0x2d')]=_['intersection'](_0x41a823['model'],qs[_0xcc7c('0x2b')](_0x1547ac[_0xcc7c('0x2c')][_0xcc7c('0x2b')]));_0x1ac80f[_0xcc7c('0x2d')]=_0x1ac80f[_0xcc7c('0x2d')][_0xcc7c('0x2e')]?_0x1ac80f[_0xcc7c('0x2d')]:_0x41a823['model'];_0x1ac80f[_0xcc7c('0x46')]=qs[_0xcc7c('0x31')](_0x1547ac['query'][_0xcc7c('0x31')]);_0x1ac80f[_0xcc7c('0x32')]=qs[_0xcc7c('0x29')](_[_0xcc7c('0x44')](_0x1547ac[_0xcc7c('0x2c')],_0x41a823['filters']));if(_0x1547ac[_0xcc7c('0x2c')][_0xcc7c('0x33')]){_0x1ac80f['where']=_['merge'](_0x1ac80f[_0xcc7c('0x32')],{'$or':_[_0xcc7c('0x21')](_0x1ac80f['attributes'],function(_0x38e68f){var _0x335887={};_0x335887[_0x38e68f]={'$like':'%'+_0x1547ac[_0xcc7c('0x2c')][_0xcc7c('0x33')]+'%'};return _0x335887;})});}_0x1ac80f=_[_0xcc7c('0x34')]({},_0x1ac80f,_0x1547ac[_0xcc7c('0x36')]);return _0x5596e5[_0xcc7c('0x48')](_0x1ac80f);}})[_0xcc7c('0x1d')](function(_0x217548){if(_0x217548){_0x22327c=_0x217548[_0xcc7c('0x2e')];if(!_0x1547ac[_0xcc7c('0x2c')]['hasOwnProperty'](_0xcc7c('0x30'))){_0x1ac80f[_0xcc7c('0x18')]=qs['limit'](_0x1547ac[_0xcc7c('0x2c')]['limit']);_0x1ac80f[_0xcc7c('0x16')]=qs[_0xcc7c('0x16')](_0x1547ac[_0xcc7c('0x2c')]['offset']);}return _0x5596e5['getTags'](_0x1ac80f);}})[_0xcc7c('0x1d')](function(_0x5893a1){if(_0x5893a1){return _0x5893a1?{'count':_0x22327c,'rows':_0x5893a1}:null;}})[_0xcc7c('0x1d')](respondWithResult(_0x38e349,null))['catch'](handleError(_0x38e349,null));};exports['setTags']=function(_0x5264f1,_0x205ab8,_0x333d19){if(_0x5264f1[_0xcc7c('0x40')]['id']){delete _0x5264f1[_0xcc7c('0x40')]['id'];}return db[_0xcc7c('0x22')][_0xcc7c('0x42')]({'where':{'id':_0x5264f1[_0xcc7c('0x3b')]['id']}})['then'](handleEntityNotFound(_0x205ab8,null))['then'](function(_0x2ebd1e){if(_0x2ebd1e){return _0x2ebd1e[_0xcc7c('0x4a')](_0x5264f1[_0xcc7c('0x40')][_0xcc7c('0x4b')]||[]);}return null;})['then'](respondWithResult(_0x205ab8,null))[_0xcc7c('0x3a')](handleError(_0x205ab8,null));}; \ No newline at end of file +var _0xae83=['mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','reject','update','then','destroy','error','name','send','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','map','VIRTUAL','options','ZendeskConfiguration','findAll','rows','show','params','includeAll','catch','create','body','find','getFields','findOne','ZendeskField','order','getSubjects','getDescriptions','getTags','Tag','setTags','eml-format','rimraf','zip-dir','request-promise','moment'];(function(_0x58ae8a,_0x3c619e){var _0x2f0b6b=function(_0x6db940){while(--_0x6db940){_0x58ae8a['push'](_0x58ae8a['shift']());}};_0x2f0b6b(++_0x3c619e);}(_0xae83,0x1d5));var _0x3ae8=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xae83[_0x199572];return _0x13cfa3;};'use strict';var emlformat=require(_0x3ae8('0x0'));var rimraf=require(_0x3ae8('0x1'));var zipdir=require(_0x3ae8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3ae8('0x3'));var moment=require(_0x3ae8('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3ae8('0x5'));var util=require(_0x3ae8('0x6'));var path=require(_0x3ae8('0x7'));var sox=require(_0x3ae8('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3ae8('0x9'));var _=require(_0x3ae8('0xa'));var squel=require(_0x3ae8('0xb'));var crypto=require(_0x3ae8('0xc'));var jsforce=require(_0x3ae8('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x3ae8('0xe'));var querystring=require('querystring');var Papa=require(_0x3ae8('0xf'));var Redis=require('ioredis');var authService=require(_0x3ae8('0x10'));var qs=require(_0x3ae8('0x11'));var as=require(_0x3ae8('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3ae8('0x13'))('api');var utils=require(_0x3ae8('0x14'));var config=require(_0x3ae8('0x15'));var licenseUtil=require(_0x3ae8('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x12f821,_0x75b73c){_0x75b73c=_0x75b73c||0xcc;return function(_0x19d073){if(_0x19d073){return _0x12f821[_0x3ae8('0x17')](_0x75b73c);}return _0x12f821['status'](_0x75b73c)[_0x3ae8('0x18')]();};}function respondWithResult(_0x4e3080,_0x5499fc){_0x5499fc=_0x5499fc||0xc8;return function(_0x15ca3b){if(_0x15ca3b){return _0x4e3080[_0x3ae8('0x19')](_0x5499fc)[_0x3ae8('0x1a')](_0x15ca3b);}};}function respondWithFilteredResult(_0x5750ed,_0xc90c37){return function(_0xe44c02){if(_0xe44c02){var _0x2af47b=typeof _0xc90c37[_0x3ae8('0x1b')]===_0x3ae8('0x1c')&&typeof _0xc90c37[_0x3ae8('0x1d')]===_0x3ae8('0x1c');var _0x101656=_0xe44c02[_0x3ae8('0x1e')];var _0x2d2d53=_0x2af47b?0x0:_0xc90c37[_0x3ae8('0x1b')];var _0x35fbab=_0x2af47b?_0xe44c02[_0x3ae8('0x1e')]:_0xc90c37['offset']+_0xc90c37[_0x3ae8('0x1d')];var _0x490218;if(_0x35fbab>=_0x101656){_0x35fbab=_0x101656;_0x490218=0xc8;}else{_0x490218=0xce;}_0x5750ed[_0x3ae8('0x19')](_0x490218);return _0x5750ed['set'](_0x3ae8('0x1f'),_0x2d2d53+'-'+_0x35fbab+'/'+_0x101656)[_0x3ae8('0x1a')](_0xe44c02);}return null;};}function patchUpdates(_0x12e755){return function(_0x327742){try{jsonpatch['apply'](_0x327742,_0x12e755,!![]);}catch(_0x41df34){return BPromise[_0x3ae8('0x20')](_0x41df34);}return _0x327742['save']();};}function saveUpdates(_0x523ab2,_0x41527a){return function(_0x21c7e6){if(_0x21c7e6){return _0x21c7e6[_0x3ae8('0x21')](_0x523ab2)[_0x3ae8('0x22')](function(_0x5dffdc){return _0x5dffdc;});}return null;};}function removeEntity(_0x517e02,_0x5e3d0b){return function(_0x1a7e3){if(_0x1a7e3){return _0x1a7e3[_0x3ae8('0x23')]()[_0x3ae8('0x22')](function(){_0x517e02[_0x3ae8('0x19')](0xcc)[_0x3ae8('0x18')]();});}};}function handleEntityNotFound(_0x53bfac,_0x46c265){return function(_0x1245a8){if(!_0x1245a8){_0x53bfac[_0x3ae8('0x17')](0x194);}return _0x1245a8;};}function handleError(_0x39999f,_0x2d8f03){_0x2d8f03=_0x2d8f03||0x1f4;return function(_0x1e6bd7){logger[_0x3ae8('0x24')](_0x1e6bd7['stack']);if(_0x1e6bd7[_0x3ae8('0x25')]){delete _0x1e6bd7[_0x3ae8('0x25')];}_0x39999f['status'](_0x2d8f03)[_0x3ae8('0x26')](_0x1e6bd7);};}exports['index']=function(_0x5c761e,_0x37cb50){var _0x1fccfa={},_0x39b809={},_0x33d716={'count':0x0,'rows':[]};var _0x1c10f2=_['map'](db['ZendeskConfiguration'][_0x3ae8('0x27')],function(_0x1d8a0a){return{'name':_0x1d8a0a['fieldName'],'type':_0x1d8a0a[_0x3ae8('0x28')][_0x3ae8('0x29')]};});_0x39b809[_0x3ae8('0x2a')]=_['map'](_0x1c10f2,_0x3ae8('0x25'));_0x39b809[_0x3ae8('0x2b')]=_[_0x3ae8('0x2c')](_0x5c761e[_0x3ae8('0x2b')]);_0x39b809['filters']=_[_0x3ae8('0x2d')](_0x39b809[_0x3ae8('0x2a')],_0x39b809['query']);_0x1fccfa[_0x3ae8('0x2e')]=_[_0x3ae8('0x2d')](_0x39b809[_0x3ae8('0x2a')],qs['fields'](_0x5c761e[_0x3ae8('0x2b')][_0x3ae8('0x2f')]));_0x1fccfa[_0x3ae8('0x2e')]=_0x1fccfa[_0x3ae8('0x2e')][_0x3ae8('0x30')]?_0x1fccfa[_0x3ae8('0x2e')]:_0x39b809[_0x3ae8('0x2a')];if(!_0x5c761e[_0x3ae8('0x2b')][_0x3ae8('0x31')](_0x3ae8('0x32'))){_0x1fccfa[_0x3ae8('0x1d')]=qs[_0x3ae8('0x1d')](_0x5c761e[_0x3ae8('0x2b')][_0x3ae8('0x1d')]);_0x1fccfa['offset']=qs[_0x3ae8('0x1b')](_0x5c761e[_0x3ae8('0x2b')]['offset']);}_0x1fccfa['order']=qs[_0x3ae8('0x33')](_0x5c761e[_0x3ae8('0x2b')]['sort']);_0x1fccfa[_0x3ae8('0x34')]=qs[_0x3ae8('0x35')](_[_0x3ae8('0x36')](_0x5c761e['query'],_0x39b809[_0x3ae8('0x35')]),_0x1c10f2);if(_0x5c761e[_0x3ae8('0x2b')][_0x3ae8('0x37')]){_0x1fccfa[_0x3ae8('0x34')]=_[_0x3ae8('0x38')](_0x1fccfa[_0x3ae8('0x34')],{'$or':_[_0x3ae8('0x39')](_0x1c10f2,function(_0x443fef){if(_0x443fef[_0x3ae8('0x28')]!==_0x3ae8('0x3a')){var _0x5eaa8f={};_0x5eaa8f[_0x443fef[_0x3ae8('0x25')]]={'$like':'%'+_0x5c761e[_0x3ae8('0x2b')][_0x3ae8('0x37')]+'%'};return _0x5eaa8f;}})});}_0x1fccfa=_[_0x3ae8('0x38')]({},_0x1fccfa,_0x5c761e[_0x3ae8('0x3b')]);var _0x4222ce={'where':_0x1fccfa[_0x3ae8('0x34')]};return db['ZendeskConfiguration'][_0x3ae8('0x1e')](_0x4222ce)['then'](function(_0xe5d1f7){_0x33d716['count']=_0xe5d1f7;if(_0x5c761e[_0x3ae8('0x2b')]['includeAll']){_0x1fccfa['include']=[{'all':!![]}];}return db[_0x3ae8('0x3c')][_0x3ae8('0x3d')](_0x1fccfa);})[_0x3ae8('0x22')](function(_0x3d7565){_0x33d716[_0x3ae8('0x3e')]=_0x3d7565;return _0x33d716;})[_0x3ae8('0x22')](respondWithFilteredResult(_0x37cb50,_0x1fccfa))['catch'](handleError(_0x37cb50,null));};exports[_0x3ae8('0x3f')]=function(_0x23292d,_0x20bb60){var _0x2adb86={'raw':![],'where':{'id':_0x23292d[_0x3ae8('0x40')]['id']}},_0x32bd93={};_0x32bd93[_0x3ae8('0x2a')]=_['keys'](db[_0x3ae8('0x3c')]['rawAttributes']);_0x32bd93[_0x3ae8('0x2b')]=_[_0x3ae8('0x2c')](_0x23292d[_0x3ae8('0x2b')]);_0x32bd93[_0x3ae8('0x35')]=_[_0x3ae8('0x2d')](_0x32bd93[_0x3ae8('0x2a')],_0x32bd93[_0x3ae8('0x2b')]);_0x2adb86[_0x3ae8('0x2e')]=_['intersection'](_0x32bd93[_0x3ae8('0x2a')],qs[_0x3ae8('0x2f')](_0x23292d[_0x3ae8('0x2b')]['fields']));_0x2adb86['attributes']=_0x2adb86[_0x3ae8('0x2e')]['length']?_0x2adb86['attributes']:_0x32bd93['model'];if(_0x23292d[_0x3ae8('0x2b')][_0x3ae8('0x41')]){_0x2adb86['include']=[{'all':!![]}];}_0x2adb86=_[_0x3ae8('0x38')]({},_0x2adb86,_0x23292d['options']);return db['ZendeskConfiguration']['find'](_0x2adb86)[_0x3ae8('0x22')](handleEntityNotFound(_0x20bb60,null))[_0x3ae8('0x22')](respondWithResult(_0x20bb60,null))[_0x3ae8('0x42')](handleError(_0x20bb60,null));};exports['create']=function(_0x4abf09,_0x37d79d){return db[_0x3ae8('0x3c')][_0x3ae8('0x43')](_0x4abf09[_0x3ae8('0x44')],{})[_0x3ae8('0x22')](respondWithResult(_0x37d79d,0xc9))['catch'](handleError(_0x37d79d,null));};exports['update']=function(_0x1dc29e,_0x1210e2){if(_0x1dc29e[_0x3ae8('0x44')]['id']){delete _0x1dc29e[_0x3ae8('0x44')]['id'];}return db[_0x3ae8('0x3c')]['find']({'where':{'id':_0x1dc29e[_0x3ae8('0x40')]['id']}})[_0x3ae8('0x22')](handleEntityNotFound(_0x1210e2,null))[_0x3ae8('0x22')](saveUpdates(_0x1dc29e[_0x3ae8('0x44')],null))[_0x3ae8('0x22')](respondWithResult(_0x1210e2,null))[_0x3ae8('0x42')](handleError(_0x1210e2,null));};exports[_0x3ae8('0x23')]=function(_0x4a365b,_0x290bd9){return db['ZendeskConfiguration'][_0x3ae8('0x45')]({'where':{'id':_0x4a365b[_0x3ae8('0x40')]['id']}})[_0x3ae8('0x22')](handleEntityNotFound(_0x290bd9,null))[_0x3ae8('0x22')](removeEntity(_0x290bd9,null))[_0x3ae8('0x42')](handleError(_0x290bd9,null));};exports[_0x3ae8('0x46')]=function(_0x46de00,_0x10bd4f,_0x305571){var _0x21fc23={};var _0x4f3565={};var _0x1ce70b;var _0x3628ee;return db['ZendeskConfiguration'][_0x3ae8('0x47')]({'where':{'id':_0x46de00[_0x3ae8('0x40')]['id']}})[_0x3ae8('0x22')](handleEntityNotFound(_0x10bd4f,null))['then'](function(_0x4c8b4a){if(_0x4c8b4a){_0x1ce70b=_0x4c8b4a;_0x4f3565[_0x3ae8('0x2a')]=_[_0x3ae8('0x2c')](db[_0x3ae8('0x48')][_0x3ae8('0x27')]);_0x4f3565[_0x3ae8('0x2b')]=_['keys'](_0x46de00[_0x3ae8('0x2b')]);_0x4f3565[_0x3ae8('0x35')]=_['intersection'](_0x4f3565[_0x3ae8('0x2a')],_0x4f3565['query']);_0x21fc23[_0x3ae8('0x2e')]=_[_0x3ae8('0x2d')](_0x4f3565[_0x3ae8('0x2a')],qs['fields'](_0x46de00[_0x3ae8('0x2b')][_0x3ae8('0x2f')]));_0x21fc23[_0x3ae8('0x2e')]=_0x21fc23[_0x3ae8('0x2e')]['length']?_0x21fc23[_0x3ae8('0x2e')]:_0x4f3565[_0x3ae8('0x2a')];_0x21fc23[_0x3ae8('0x49')]=qs['sort'](_0x46de00[_0x3ae8('0x2b')]['sort']);_0x21fc23[_0x3ae8('0x34')]=qs[_0x3ae8('0x35')](_[_0x3ae8('0x36')](_0x46de00['query'],_0x4f3565[_0x3ae8('0x35')]));if(_0x46de00[_0x3ae8('0x2b')]['filter']){_0x21fc23[_0x3ae8('0x34')]=_[_0x3ae8('0x38')](_0x21fc23[_0x3ae8('0x34')],{'$or':_[_0x3ae8('0x39')](_0x21fc23[_0x3ae8('0x2e')],function(_0x3a9b4f){var _0x1e30f0={};_0x1e30f0[_0x3a9b4f]={'$like':'%'+_0x46de00['query'][_0x3ae8('0x37')]+'%'};return _0x1e30f0;})});}_0x21fc23=_['merge']({},_0x21fc23,_0x46de00[_0x3ae8('0x3b')]);return _0x1ce70b[_0x3ae8('0x46')](_0x21fc23);}})[_0x3ae8('0x22')](function(_0x3598ff){if(_0x3598ff){_0x3628ee=_0x3598ff[_0x3ae8('0x30')];if(!_0x46de00[_0x3ae8('0x2b')]['hasOwnProperty'](_0x3ae8('0x32'))){_0x21fc23['limit']=qs[_0x3ae8('0x1d')](_0x46de00['query']['limit']);_0x21fc23[_0x3ae8('0x1b')]=qs[_0x3ae8('0x1b')](_0x46de00[_0x3ae8('0x2b')][_0x3ae8('0x1b')]);}return _0x1ce70b[_0x3ae8('0x46')](_0x21fc23);}})[_0x3ae8('0x22')](function(_0x57f80b){if(_0x57f80b){return _0x57f80b?{'count':_0x3628ee,'rows':_0x57f80b}:null;}})[_0x3ae8('0x22')](respondWithResult(_0x10bd4f,null))['catch'](handleError(_0x10bd4f,null));};exports['getSubjects']=function(_0xad05e9,_0x49f901,_0x39f8b9){var _0x4ee84c={};var _0x3075db={};var _0x393669;var _0x4c658c;return db[_0x3ae8('0x3c')][_0x3ae8('0x47')]({'where':{'id':_0xad05e9[_0x3ae8('0x40')]['id']}})['then'](handleEntityNotFound(_0x49f901,null))[_0x3ae8('0x22')](function(_0xa39cfa){if(_0xa39cfa){_0x393669=_0xa39cfa;_0x3075db[_0x3ae8('0x2a')]=_[_0x3ae8('0x2c')](db['ZendeskField']['rawAttributes']);_0x3075db[_0x3ae8('0x2b')]=_[_0x3ae8('0x2c')](_0xad05e9[_0x3ae8('0x2b')]);_0x3075db[_0x3ae8('0x35')]=_[_0x3ae8('0x2d')](_0x3075db[_0x3ae8('0x2a')],_0x3075db[_0x3ae8('0x2b')]);_0x4ee84c['attributes']=_[_0x3ae8('0x2d')](_0x3075db['model'],qs[_0x3ae8('0x2f')](_0xad05e9[_0x3ae8('0x2b')][_0x3ae8('0x2f')]));_0x4ee84c[_0x3ae8('0x2e')]=_0x4ee84c[_0x3ae8('0x2e')][_0x3ae8('0x30')]?_0x4ee84c[_0x3ae8('0x2e')]:_0x3075db[_0x3ae8('0x2a')];_0x4ee84c[_0x3ae8('0x49')]=qs[_0x3ae8('0x33')](_0xad05e9[_0x3ae8('0x2b')][_0x3ae8('0x33')]);_0x4ee84c[_0x3ae8('0x34')]=qs[_0x3ae8('0x35')](_[_0x3ae8('0x36')](_0xad05e9[_0x3ae8('0x2b')],_0x3075db[_0x3ae8('0x35')]));if(_0xad05e9['query'][_0x3ae8('0x37')]){_0x4ee84c[_0x3ae8('0x34')]=_[_0x3ae8('0x38')](_0x4ee84c[_0x3ae8('0x34')],{'$or':_[_0x3ae8('0x39')](_0x4ee84c[_0x3ae8('0x2e')],function(_0x49998b){var _0x158ed0={};_0x158ed0[_0x49998b]={'$like':'%'+_0xad05e9[_0x3ae8('0x2b')][_0x3ae8('0x37')]+'%'};return _0x158ed0;})});}_0x4ee84c=_[_0x3ae8('0x38')]({},_0x4ee84c,_0xad05e9[_0x3ae8('0x3b')]);return _0x393669[_0x3ae8('0x4a')](_0x4ee84c);}})[_0x3ae8('0x22')](function(_0x28d418){if(_0x28d418){_0x4c658c=_0x28d418[_0x3ae8('0x30')];if(!_0xad05e9['query'][_0x3ae8('0x31')](_0x3ae8('0x32'))){_0x4ee84c[_0x3ae8('0x1d')]=qs[_0x3ae8('0x1d')](_0xad05e9[_0x3ae8('0x2b')][_0x3ae8('0x1d')]);_0x4ee84c[_0x3ae8('0x1b')]=qs['offset'](_0xad05e9[_0x3ae8('0x2b')][_0x3ae8('0x1b')]);}return _0x393669[_0x3ae8('0x4a')](_0x4ee84c);}})[_0x3ae8('0x22')](function(_0x43fcf7){if(_0x43fcf7){return _0x43fcf7?{'count':_0x4c658c,'rows':_0x43fcf7}:null;}})[_0x3ae8('0x22')](respondWithResult(_0x49f901,null))[_0x3ae8('0x42')](handleError(_0x49f901,null));};exports[_0x3ae8('0x4b')]=function(_0x4fb1a8,_0x45ddb2,_0x135247){var _0x329855={};var _0x49390c={};var _0x1a01ed;var _0x48d8f0;return db[_0x3ae8('0x3c')][_0x3ae8('0x47')]({'where':{'id':_0x4fb1a8[_0x3ae8('0x40')]['id']}})['then'](handleEntityNotFound(_0x45ddb2,null))[_0x3ae8('0x22')](function(_0x178a77){if(_0x178a77){_0x1a01ed=_0x178a77;_0x49390c[_0x3ae8('0x2a')]=_[_0x3ae8('0x2c')](db[_0x3ae8('0x48')][_0x3ae8('0x27')]);_0x49390c[_0x3ae8('0x2b')]=_[_0x3ae8('0x2c')](_0x4fb1a8[_0x3ae8('0x2b')]);_0x49390c[_0x3ae8('0x35')]=_['intersection'](_0x49390c[_0x3ae8('0x2a')],_0x49390c['query']);_0x329855[_0x3ae8('0x2e')]=_[_0x3ae8('0x2d')](_0x49390c[_0x3ae8('0x2a')],qs[_0x3ae8('0x2f')](_0x4fb1a8[_0x3ae8('0x2b')]['fields']));_0x329855[_0x3ae8('0x2e')]=_0x329855['attributes'][_0x3ae8('0x30')]?_0x329855[_0x3ae8('0x2e')]:_0x49390c[_0x3ae8('0x2a')];_0x329855['order']=qs[_0x3ae8('0x33')](_0x4fb1a8['query'][_0x3ae8('0x33')]);_0x329855[_0x3ae8('0x34')]=qs[_0x3ae8('0x35')](_[_0x3ae8('0x36')](_0x4fb1a8['query'],_0x49390c[_0x3ae8('0x35')]));if(_0x4fb1a8['query'][_0x3ae8('0x37')]){_0x329855[_0x3ae8('0x34')]=_[_0x3ae8('0x38')](_0x329855[_0x3ae8('0x34')],{'$or':_[_0x3ae8('0x39')](_0x329855[_0x3ae8('0x2e')],function(_0x4b0335){var _0x371751={};_0x371751[_0x4b0335]={'$like':'%'+_0x4fb1a8[_0x3ae8('0x2b')][_0x3ae8('0x37')]+'%'};return _0x371751;})});}_0x329855=_[_0x3ae8('0x38')]({},_0x329855,_0x4fb1a8[_0x3ae8('0x3b')]);return _0x1a01ed[_0x3ae8('0x4b')](_0x329855);}})['then'](function(_0x696386){if(_0x696386){_0x48d8f0=_0x696386[_0x3ae8('0x30')];if(!_0x4fb1a8[_0x3ae8('0x2b')][_0x3ae8('0x31')](_0x3ae8('0x32'))){_0x329855['limit']=qs[_0x3ae8('0x1d')](_0x4fb1a8['query'][_0x3ae8('0x1d')]);_0x329855[_0x3ae8('0x1b')]=qs[_0x3ae8('0x1b')](_0x4fb1a8[_0x3ae8('0x2b')]['offset']);}return _0x1a01ed[_0x3ae8('0x4b')](_0x329855);}})[_0x3ae8('0x22')](function(_0x233ad7){if(_0x233ad7){return _0x233ad7?{'count':_0x48d8f0,'rows':_0x233ad7}:null;}})[_0x3ae8('0x22')](respondWithResult(_0x45ddb2,null))[_0x3ae8('0x42')](handleError(_0x45ddb2,null));};exports[_0x3ae8('0x4c')]=function(_0x41da8d,_0x335926,_0x17168e){var _0x1b0c7f={};var _0x302e8d={};var _0x204d93;var _0x74bd07;return db[_0x3ae8('0x3c')][_0x3ae8('0x47')]({'where':{'id':_0x41da8d[_0x3ae8('0x40')]['id']}})['then'](handleEntityNotFound(_0x335926,null))[_0x3ae8('0x22')](function(_0x31930b){if(_0x31930b){_0x204d93=_0x31930b;_0x302e8d[_0x3ae8('0x2a')]=_[_0x3ae8('0x2c')](db[_0x3ae8('0x4d')][_0x3ae8('0x27')]);_0x302e8d[_0x3ae8('0x2b')]=_[_0x3ae8('0x2c')](_0x41da8d[_0x3ae8('0x2b')]);_0x302e8d[_0x3ae8('0x35')]=_['intersection'](_0x302e8d[_0x3ae8('0x2a')],_0x302e8d[_0x3ae8('0x2b')]);_0x1b0c7f[_0x3ae8('0x2e')]=_[_0x3ae8('0x2d')](_0x302e8d[_0x3ae8('0x2a')],qs['fields'](_0x41da8d[_0x3ae8('0x2b')][_0x3ae8('0x2f')]));_0x1b0c7f[_0x3ae8('0x2e')]=_0x1b0c7f[_0x3ae8('0x2e')]['length']?_0x1b0c7f[_0x3ae8('0x2e')]:_0x302e8d[_0x3ae8('0x2a')];_0x1b0c7f[_0x3ae8('0x49')]=qs[_0x3ae8('0x33')](_0x41da8d['query']['sort']);_0x1b0c7f[_0x3ae8('0x34')]=qs['filters'](_[_0x3ae8('0x36')](_0x41da8d[_0x3ae8('0x2b')],_0x302e8d['filters']));if(_0x41da8d['query'][_0x3ae8('0x37')]){_0x1b0c7f[_0x3ae8('0x34')]=_[_0x3ae8('0x38')](_0x1b0c7f[_0x3ae8('0x34')],{'$or':_[_0x3ae8('0x39')](_0x1b0c7f[_0x3ae8('0x2e')],function(_0x32ae9d){var _0x152c7a={};_0x152c7a[_0x32ae9d]={'$like':'%'+_0x41da8d['query'][_0x3ae8('0x37')]+'%'};return _0x152c7a;})});}_0x1b0c7f=_['merge']({},_0x1b0c7f,_0x41da8d['options']);return _0x204d93['getTags'](_0x1b0c7f);}})['then'](function(_0x4e3520){if(_0x4e3520){_0x74bd07=_0x4e3520['length'];if(!_0x41da8d[_0x3ae8('0x2b')][_0x3ae8('0x31')](_0x3ae8('0x32'))){_0x1b0c7f['limit']=qs[_0x3ae8('0x1d')](_0x41da8d['query'][_0x3ae8('0x1d')]);_0x1b0c7f[_0x3ae8('0x1b')]=qs[_0x3ae8('0x1b')](_0x41da8d[_0x3ae8('0x2b')]['offset']);}return _0x204d93[_0x3ae8('0x4c')](_0x1b0c7f);}})[_0x3ae8('0x22')](function(_0x2e53b6){if(_0x2e53b6){return _0x2e53b6?{'count':_0x74bd07,'rows':_0x2e53b6}:null;}})[_0x3ae8('0x22')](respondWithResult(_0x335926,null))[_0x3ae8('0x42')](handleError(_0x335926,null));};exports[_0x3ae8('0x4e')]=function(_0x360dcf,_0x188b05,_0x4194a1){if(_0x360dcf[_0x3ae8('0x44')]['id']){delete _0x360dcf[_0x3ae8('0x44')]['id'];}return db[_0x3ae8('0x3c')][_0x3ae8('0x47')]({'where':{'id':_0x360dcf['params']['id']}})['then'](handleEntityNotFound(_0x188b05,null))[_0x3ae8('0x22')](function(_0x561508){if(_0x561508){return _0x561508[_0x3ae8('0x4e')](_0x360dcf[_0x3ae8('0x44')]['ids']||[]);}return null;})[_0x3ae8('0x22')](respondWithResult(_0x188b05,null))['catch'](handleError(_0x188b05,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index de3affe..d99abcd 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 _0xfff0=['./intZendeskConfiguration.attributes','define','int_zendesk_configurations','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0xfff0,0x139));var _0x0fff=function(_0x1fb23c,_0x56bb73){_0x1fb23c=_0x1fb23c-0x0;var _0x49eb35=_0xfff0[_0x1fb23c];return _0x49eb35;};'use strict';var _=require('lodash');var util=require(_0x0fff('0x0'));var logger=require(_0x0fff('0x1'))(_0x0fff('0x2'));var moment=require('moment');var BPromise=require(_0x0fff('0x3'));var rp=require(_0x0fff('0x4'));var fs=require('fs');var path=require(_0x0fff('0x5'));var rimraf=require('rimraf');var config=require(_0x0fff('0x6'));var attributes=require(_0x0fff('0x7'));module['exports']=function(_0x33c813,_0x4c2221){return _0x33c813[_0x0fff('0x8')]('ZendeskConfiguration',attributes,{'tableName':_0x0fff('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8603=['util','../../config/logger','api','request-promise','path','rimraf','./intZendeskConfiguration.attributes','define','ZendeskConfiguration','int_zendesk_configurations'];(function(_0x54aaac,_0x162860){var _0x37a771=function(_0x1ca4f0){while(--_0x1ca4f0){_0x54aaac['push'](_0x54aaac['shift']());}};_0x37a771(++_0x162860);}(_0x8603,0x190));var _0x3860=function(_0x63d942,_0x1ab2ca){_0x63d942=_0x63d942-0x0;var _0x5e2148=_0x8603[_0x63d942];return _0x5e2148;};'use strict';var _=require('lodash');var util=require(_0x3860('0x0'));var logger=require(_0x3860('0x1'))(_0x3860('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3860('0x3'));var fs=require('fs');var path=require(_0x3860('0x4'));var rimraf=require(_0x3860('0x5'));var config=require('../../config/environment');var attributes=require(_0x3860('0x6'));module['exports']=function(_0xb0fc24,_0x40739b){return _0xb0fc24[_0x3860('0x7')](_0x3860('0x8'),attributes,{'tableName':_0x3860('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js index ad3300a..71b3c17 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 _0x6bed=['client','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\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'];(function(_0x5c9ecc,_0x4c7b7e){var _0x47df8c=function(_0x2796af){while(--_0x2796af){_0x5c9ecc['push'](_0x5c9ecc['shift']());}};_0x47df8c(++_0x4c7b7e);}(_0x6bed,0xd6));var _0xd6be=function(_0x468336,_0x1f0ae9){_0x468336=_0x468336-0x0;var _0x409235=_0x6bed[_0x468336];return _0x409235;};'use strict';var _=require(_0xd6be('0x0'));var util=require(_0xd6be('0x1'));var moment=require(_0xd6be('0x2'));var BPromise=require('bluebird');var rs=require(_0xd6be('0x3'));var fs=require('fs');var Redis=require(_0xd6be('0x4'));var db=require(_0xd6be('0x5'))['db'];var utils=require(_0xd6be('0x6'));var logger=require(_0xd6be('0x7'))(_0xd6be('0x8'));var config=require(_0xd6be('0x9'));var jayson=require(_0xd6be('0xa'));var client=jayson[_0xd6be('0xb')][_0xd6be('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5229b7,_0xf29b07,_0x19f25e){return new BPromise(function(_0xd78a3f,_0x13be6c){return client[_0xd6be('0xd')](_0x5229b7,_0x19f25e)[_0xd6be('0xe')](function(_0x1c58fb){logger[_0xd6be('0xf')](_0xd6be('0x10'),_0xf29b07,_0xd6be('0x11'));logger[_0xd6be('0x12')](_0xd6be('0x13'),_0xf29b07,'request\x20sent',JSON[_0xd6be('0x14')](_0x1c58fb));if(_0x1c58fb[_0xd6be('0x15')]){if(_0x1c58fb[_0xd6be('0x15')]['code']===0x1f4){logger['error'](_0xd6be('0x10'),_0xf29b07,_0x1c58fb[_0xd6be('0x15')][_0xd6be('0x16')]);return _0x13be6c(_0x1c58fb[_0xd6be('0x15')][_0xd6be('0x16')]);}logger['error'](_0xd6be('0x10'),_0xf29b07,_0x1c58fb[_0xd6be('0x15')][_0xd6be('0x16')]);return _0xd78a3f(_0x1c58fb['error'][_0xd6be('0x16')]);}else{logger['info'](_0xd6be('0x10'),_0xf29b07,_0xd6be('0x11'));_0xd78a3f(_0x1c58fb[_0xd6be('0x17')][_0xd6be('0x16')]);}})[_0xd6be('0x18')](function(_0x559313){logger['error'](_0xd6be('0x10'),_0xf29b07,_0x559313);_0x13be6c(_0x559313);});});} \ No newline at end of file +var _0xc03f=['ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http'];(function(_0x44dba1,_0x270ad5){var _0x2fbd3f=function(_0x5e0865){while(--_0x5e0865){_0x44dba1['push'](_0x44dba1['shift']());}};_0x2fbd3f(++_0x270ad5);}(_0xc03f,0x17b));var _0xfc03=function(_0x1c6a76,_0x5087e2){_0x1c6a76=_0x1c6a76-0x0;var _0x44933c=_0xc03f[_0x1c6a76];return _0x44933c;};'use strict';var _=require(_0xfc03('0x0'));var util=require(_0xfc03('0x1'));var moment=require(_0xfc03('0x2'));var BPromise=require(_0xfc03('0x3'));var rs=require(_0xfc03('0x4'));var fs=require('fs');var Redis=require(_0xfc03('0x5'));var db=require(_0xfc03('0x6'))['db'];var utils=require(_0xfc03('0x7'));var logger=require(_0xfc03('0x8'))('rpc');var config=require(_0xfc03('0x9'));var jayson=require(_0xfc03('0xa'));var client=jayson['client'][_0xfc03('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xdcf458,_0x4dabba,_0x137c08){return new BPromise(function(_0x32e547,_0x5460ce){return client['request'](_0xdcf458,_0x137c08)['then'](function(_0x50d8b1){logger['info'](_0xfc03('0xc'),_0x4dabba,_0xfc03('0xd'));logger[_0xfc03('0xe')](_0xfc03('0xf'),_0x4dabba,_0xfc03('0xd'),JSON[_0xfc03('0x10')](_0x50d8b1));if(_0x50d8b1[_0xfc03('0x11')]){if(_0x50d8b1['error'][_0xfc03('0x12')]===0x1f4){logger['error'](_0xfc03('0xc'),_0x4dabba,_0x50d8b1['error'][_0xfc03('0x13')]);return _0x5460ce(_0x50d8b1[_0xfc03('0x11')]['message']);}logger[_0xfc03('0x11')]('ZendeskConfiguration,\x20%s,\x20%s',_0x4dabba,_0x50d8b1['error'][_0xfc03('0x13')]);return _0x32e547(_0x50d8b1[_0xfc03('0x11')][_0xfc03('0x13')]);}else{logger[_0xfc03('0x14')]('ZendeskConfiguration,\x20%s,\x20%s',_0x4dabba,_0xfc03('0xd'));_0x32e547(_0x50d8b1[_0xfc03('0x15')][_0xfc03('0x13')]);}})[_0xfc03('0x16')](function(_0x35fa92){logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x4dabba,_0x35fa92);_0x5460ce(_0x35fa92);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 7a6a5e9..d568114 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 _0x7417=['destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intZendeskField.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete'];(function(_0x2fd0f0,_0x4b634e){var _0x57f71a=function(_0x400d6f){while(--_0x400d6f){_0x2fd0f0['push'](_0x2fd0f0['shift']());}};_0x57f71a(++_0x4b634e);}(_0x7417,0xd4));var _0x7741=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x7417[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x7741('0x0'));var util=require(_0x7741('0x1'));var path=require(_0x7741('0x2'));var timeout=require(_0x7741('0x3'));var express=require('express');var router=express[_0x7741('0x4')]();var fs_extra=require(_0x7741('0x5'));var auth=require(_0x7741('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7741('0x7'));var controller=require(_0x7741('0x8'));router[_0x7741('0x9')]('/',auth['isAuthenticated'](),controller[_0x7741('0xa')]);router['get'](_0x7741('0xb'),auth[_0x7741('0xc')](),controller[_0x7741('0xd')]);router[_0x7741('0xe')]('/',auth[_0x7741('0xc')](),controller[_0x7741('0xf')]);router[_0x7741('0x10')](_0x7741('0xb'),auth['isAuthenticated'](),controller[_0x7741('0x11')]);router[_0x7741('0x12')](_0x7741('0xb'),auth[_0x7741('0xc')](),controller[_0x7741('0x13')]);module[_0x7741('0x14')]=router; \ No newline at end of file +var _0x2ee2=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','index','/:id','post','put','update','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x56c7d8,_0xa007e){var _0x5006ab=function(_0x4ecc56){while(--_0x4ecc56){_0x56c7d8['push'](_0x56c7d8['shift']());}};_0x5006ab(++_0xa007e);}(_0x2ee2,0x1e0));var _0x22ee=function(_0x9d14e3,_0x5a6072){_0x9d14e3=_0x9d14e3-0x0;var _0x19bf32=_0x2ee2[_0x9d14e3];return _0x19bf32;};'use strict';var multer=require(_0x22ee('0x0'));var util=require('util');var path=require(_0x22ee('0x1'));var timeout=require(_0x22ee('0x2'));var express=require(_0x22ee('0x3'));var router=express[_0x22ee('0x4')]();var fs_extra=require(_0x22ee('0x5'));var auth=require(_0x22ee('0x6'));var interaction=require(_0x22ee('0x7'));var config=require(_0x22ee('0x8'));var controller=require(_0x22ee('0x9'));router[_0x22ee('0xa')]('/',auth[_0x22ee('0xb')](),controller[_0x22ee('0xc')]);router['get'](_0x22ee('0xd'),auth[_0x22ee('0xb')](),controller['show']);router[_0x22ee('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x22ee('0xf')](_0x22ee('0xd'),auth[_0x22ee('0xb')](),controller[_0x22ee('0x10')]);router['delete'](_0x22ee('0xd'),auth[_0x22ee('0xb')](),controller['destroy']);module[_0x22ee('0x11')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index a4765a3..4f08305 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 _0x7470=['ENUM','string','variable','customVariable','keyValue','STRING','BOOLEAN','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7470,0x1db));var _0x0747=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x7470[_0x5bd426];return _0x23a7eb;};'use strict';var Sequelize=require(_0x0747('0x0'));module[_0x0747('0x1')]={'type':{'type':Sequelize[_0x0747('0x2')](_0x0747('0x3'),_0x0747('0x4'),_0x0747('0x5'),_0x0747('0x6'),'picklist'),'defaultValue':_0x0747('0x3')},'content':{'type':Sequelize[_0x0747('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x0747('0x3'),'variable',_0x0747('0x5'))},'keyContent':{'type':Sequelize[_0x0747('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x0747('0x7')]},'customField':{'type':Sequelize[_0x0747('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0747('0x7')]}}; \ No newline at end of file +var _0xf4e1=['string','variable','customVariable','STRING','BOOLEAN','exports','ENUM'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xf4e1,0x91));var _0x1f4e=function(_0x3ae4d1,_0x443046){_0x3ae4d1=_0x3ae4d1-0x0;var _0x190e73=_0xf4e1[_0x3ae4d1];return _0x190e73;};'use strict';var Sequelize=require('sequelize');module[_0x1f4e('0x0')]={'type':{'type':Sequelize[_0x1f4e('0x1')](_0x1f4e('0x2'),_0x1f4e('0x3'),_0x1f4e('0x4'),'keyValue','picklist'),'defaultValue':_0x1f4e('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x1f4e('0x5')]},'keyType':{'type':Sequelize[_0x1f4e('0x1')](_0x1f4e('0x2'),_0x1f4e('0x3'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x1f4e('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x1f4e('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1f4e('0x5')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 62ab0ad..ec4bd7a 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 _0x8146=['rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','findAll','catch','show','params','ZendeskField','find','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','index','map'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x8146,0x194));var _0x6814=function(_0x242a98,_0x13988e){_0x242a98=_0x242a98-0x0;var _0x580999=_0x8146[_0x242a98];return _0x580999;};'use strict';var emlformat=require(_0x6814('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6814('0x1'));var jsonpatch=require(_0x6814('0x2'));var rp=require(_0x6814('0x3'));var moment=require(_0x6814('0x4'));var BPromise=require(_0x6814('0x5'));var Mustache=require('mustache');var util=require(_0x6814('0x6'));var path=require(_0x6814('0x7'));var sox=require(_0x6814('0x8'));var csv=require(_0x6814('0x9'));var ejs=require(_0x6814('0xa'));var fs=require('fs');var fs_extra=require(_0x6814('0xb'));var _=require(_0x6814('0xc'));var squel=require(_0x6814('0xd'));var crypto=require('crypto');var jsforce=require(_0x6814('0xe'));var deskjs=require(_0x6814('0xf'));var toCsv=require(_0x6814('0x9'));var querystring=require('querystring');var Papa=require(_0x6814('0x10'));var Redis=require('ioredis');var authService=require(_0x6814('0x11'));var qs=require(_0x6814('0x12'));var as=require(_0x6814('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6814('0x14'))('api');var utils=require(_0x6814('0x15'));var config=require(_0x6814('0x16'));var licenseUtil=require(_0x6814('0x17'));var db=require(_0x6814('0x18'))['db'];function respondWithStatusCode(_0x274c30,_0x10335d){_0x10335d=_0x10335d||0xcc;return function(_0x170a95){if(_0x170a95){return _0x274c30[_0x6814('0x19')](_0x10335d);}return _0x274c30[_0x6814('0x1a')](_0x10335d)['end']();};}function respondWithResult(_0x545ab8,_0x23f5c2){_0x23f5c2=_0x23f5c2||0xc8;return function(_0x34bd11){if(_0x34bd11){return _0x545ab8[_0x6814('0x1a')](_0x23f5c2)[_0x6814('0x1b')](_0x34bd11);}};}function respondWithFilteredResult(_0x45dd01,_0x5ea8a1){return function(_0x222bc1){if(_0x222bc1){var _0x53f4ad=typeof _0x5ea8a1['offset']===_0x6814('0x1c')&&typeof _0x5ea8a1[_0x6814('0x1d')]==='undefined';var _0xb24a9a=_0x222bc1['count'];var _0x33f82c=_0x53f4ad?0x0:_0x5ea8a1['offset'];var _0x2da349=_0x53f4ad?_0x222bc1[_0x6814('0x1e')]:_0x5ea8a1[_0x6814('0x1f')]+_0x5ea8a1[_0x6814('0x1d')];var _0x4b0825;if(_0x2da349>=_0xb24a9a){_0x2da349=_0xb24a9a;_0x4b0825=0xc8;}else{_0x4b0825=0xce;}_0x45dd01['status'](_0x4b0825);return _0x45dd01[_0x6814('0x20')](_0x6814('0x21'),_0x33f82c+'-'+_0x2da349+'/'+_0xb24a9a)[_0x6814('0x1b')](_0x222bc1);}return null;};}function patchUpdates(_0x2f5208){return function(_0x395cda){try{jsonpatch[_0x6814('0x22')](_0x395cda,_0x2f5208,!![]);}catch(_0x13ecd8){return BPromise[_0x6814('0x23')](_0x13ecd8);}return _0x395cda['save']();};}function saveUpdates(_0x121fae,_0x44a8a1){return function(_0x1bfb6d){if(_0x1bfb6d){return _0x1bfb6d[_0x6814('0x24')](_0x121fae)[_0x6814('0x25')](function(_0x594c27){return _0x594c27;});}return null;};}function removeEntity(_0x5817e8,_0xe1a2ae){return function(_0x1aa89f){if(_0x1aa89f){return _0x1aa89f[_0x6814('0x26')]()['then'](function(){_0x5817e8[_0x6814('0x1a')](0xcc)[_0x6814('0x27')]();});}};}function handleEntityNotFound(_0x287563,_0x444a2f){return function(_0x2c1198){if(!_0x2c1198){_0x287563[_0x6814('0x19')](0x194);}return _0x2c1198;};}function handleError(_0x473ca0,_0x12c18d){_0x12c18d=_0x12c18d||0x1f4;return function(_0x56f586){logger[_0x6814('0x28')](_0x56f586[_0x6814('0x29')]);if(_0x56f586[_0x6814('0x2a')]){delete _0x56f586[_0x6814('0x2a')];}_0x473ca0[_0x6814('0x1a')](_0x12c18d)[_0x6814('0x2b')](_0x56f586);};}exports[_0x6814('0x2c')]=function(_0x1f6156,_0x554c4c){var _0x9575cc={},_0x267dc0={},_0x90195a={'count':0x0,'rows':[]};var _0x3a1f78=_[_0x6814('0x2d')](db['ZendeskField'][_0x6814('0x2e')],function(_0x5ddf33){return{'name':_0x5ddf33[_0x6814('0x2f')],'type':_0x5ddf33[_0x6814('0x30')][_0x6814('0x31')]};});_0x267dc0[_0x6814('0x32')]=_[_0x6814('0x2d')](_0x3a1f78,'name');_0x267dc0[_0x6814('0x33')]=_[_0x6814('0x34')](_0x1f6156[_0x6814('0x33')]);_0x267dc0[_0x6814('0x35')]=_[_0x6814('0x36')](_0x267dc0['model'],_0x267dc0[_0x6814('0x33')]);_0x9575cc[_0x6814('0x37')]=_[_0x6814('0x36')](_0x267dc0[_0x6814('0x32')],qs[_0x6814('0x38')](_0x1f6156[_0x6814('0x33')][_0x6814('0x38')]));_0x9575cc[_0x6814('0x37')]=_0x9575cc[_0x6814('0x37')][_0x6814('0x39')]?_0x9575cc['attributes']:_0x267dc0['model'];if(!_0x1f6156[_0x6814('0x33')][_0x6814('0x3a')](_0x6814('0x3b'))){_0x9575cc[_0x6814('0x1d')]=qs[_0x6814('0x1d')](_0x1f6156[_0x6814('0x33')][_0x6814('0x1d')]);_0x9575cc['offset']=qs['offset'](_0x1f6156[_0x6814('0x33')]['offset']);}_0x9575cc['order']=qs[_0x6814('0x3c')](_0x1f6156[_0x6814('0x33')][_0x6814('0x3c')]);_0x9575cc['where']=qs[_0x6814('0x35')](_[_0x6814('0x3d')](_0x1f6156[_0x6814('0x33')],_0x267dc0[_0x6814('0x35')]),_0x3a1f78);if(_0x1f6156[_0x6814('0x33')][_0x6814('0x3e')]){_0x9575cc[_0x6814('0x3f')]=_['merge'](_0x9575cc['where'],{'$or':_[_0x6814('0x2d')](_0x3a1f78,function(_0x465c4a){if(_0x465c4a[_0x6814('0x30')]!==_0x6814('0x40')){var _0x29d409={};_0x29d409[_0x465c4a[_0x6814('0x2a')]]={'$like':'%'+_0x1f6156[_0x6814('0x33')][_0x6814('0x3e')]+'%'};return _0x29d409;}})});}_0x9575cc=_[_0x6814('0x41')]({},_0x9575cc,_0x1f6156[_0x6814('0x42')]);var _0x14695c={'where':_0x9575cc['where']};return db['ZendeskField']['count'](_0x14695c)[_0x6814('0x25')](function(_0x7b37d4){_0x90195a['count']=_0x7b37d4;if(_0x1f6156[_0x6814('0x33')][_0x6814('0x43')]){_0x9575cc['include']=[{'all':!![]}];}return db['ZendeskField'][_0x6814('0x44')](_0x9575cc);})['then'](function(_0x290f52){_0x90195a['rows']=_0x290f52;return _0x90195a;})[_0x6814('0x25')](respondWithFilteredResult(_0x554c4c,_0x9575cc))[_0x6814('0x45')](handleError(_0x554c4c,null));};exports[_0x6814('0x46')]=function(_0x4e58c9,_0x2d729c){var _0x2056cd={'raw':!![],'where':{'id':_0x4e58c9[_0x6814('0x47')]['id']}},_0x1f344d={};_0x1f344d[_0x6814('0x32')]=_['keys'](db['ZendeskField'][_0x6814('0x2e')]);_0x1f344d[_0x6814('0x33')]=_[_0x6814('0x34')](_0x4e58c9[_0x6814('0x33')]);_0x1f344d[_0x6814('0x35')]=_[_0x6814('0x36')](_0x1f344d[_0x6814('0x32')],_0x1f344d['query']);_0x2056cd[_0x6814('0x37')]=_[_0x6814('0x36')](_0x1f344d[_0x6814('0x32')],qs[_0x6814('0x38')](_0x4e58c9[_0x6814('0x33')]['fields']));_0x2056cd[_0x6814('0x37')]=_0x2056cd[_0x6814('0x37')]['length']?_0x2056cd[_0x6814('0x37')]:_0x1f344d[_0x6814('0x32')];if(_0x4e58c9[_0x6814('0x33')][_0x6814('0x43')]){_0x2056cd['include']=[{'all':!![]}];}_0x2056cd=_[_0x6814('0x41')]({},_0x2056cd,_0x4e58c9[_0x6814('0x42')]);return db[_0x6814('0x48')][_0x6814('0x49')](_0x2056cd)[_0x6814('0x25')](handleEntityNotFound(_0x2d729c,null))['then'](respondWithResult(_0x2d729c,null))[_0x6814('0x45')](handleError(_0x2d729c,null));};exports['create']=function(_0x3161f2,_0x4d0cf6){return db[_0x6814('0x48')]['create'](_0x3161f2['body'],{})[_0x6814('0x25')](respondWithResult(_0x4d0cf6,0xc9))['catch'](handleError(_0x4d0cf6,null));};exports['update']=function(_0x35d21e,_0x3c3132){if(_0x35d21e[_0x6814('0x4a')]['id']){delete _0x35d21e['body']['id'];}return db[_0x6814('0x48')][_0x6814('0x49')]({'where':{'id':_0x35d21e[_0x6814('0x47')]['id']}})[_0x6814('0x25')](handleEntityNotFound(_0x3c3132,null))[_0x6814('0x25')](saveUpdates(_0x35d21e[_0x6814('0x4a')],null))[_0x6814('0x25')](respondWithResult(_0x3c3132,null))['catch'](handleError(_0x3c3132,null));};exports[_0x6814('0x26')]=function(_0x1803ce,_0x48235c){return db[_0x6814('0x48')]['find']({'where':{'id':_0x1803ce[_0x6814('0x47')]['id']}})[_0x6814('0x25')](handleEntityNotFound(_0x48235c,null))[_0x6814('0x25')](removeEntity(_0x48235c,null))[_0x6814('0x45')](handleError(_0x48235c,null));}; \ No newline at end of file +var _0x735a=['../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','apply','reject','save','then','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','params','ZendeskField','intersection','length','options','find','create','body','destroy','rimraf','zip-dir','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x34a8c8,_0x31e259){var _0x1fe6e5=function(_0x30f28d){while(--_0x30f28d){_0x34a8c8['push'](_0x34a8c8['shift']());}};_0x1fe6e5(++_0x31e259);}(_0x735a,0x1a9));var _0xa735=function(_0x1425fc,_0xbec12c){_0x1425fc=_0x1425fc-0x0;var _0x2bbe59=_0x735a[_0x1425fc];return _0x2bbe59;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa735('0x0'));var zipdir=require(_0xa735('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa735('0x2'));var BPromise=require(_0xa735('0x3'));var Mustache=require(_0xa735('0x4'));var util=require(_0xa735('0x5'));var path=require('path');var sox=require(_0xa735('0x6'));var csv=require(_0xa735('0x7'));var ejs=require(_0xa735('0x8'));var fs=require('fs');var fs_extra=require(_0xa735('0x9'));var _=require(_0xa735('0xa'));var squel=require(_0xa735('0xb'));var crypto=require(_0xa735('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xa735('0xd'));var toCsv=require(_0xa735('0x7'));var querystring=require(_0xa735('0xe'));var Papa=require(_0xa735('0xf'));var Redis=require(_0xa735('0x10'));var authService=require(_0xa735('0x11'));var qs=require(_0xa735('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa735('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xa735('0x14'));var config=require(_0xa735('0x15'));var licenseUtil=require(_0xa735('0x16'));var db=require(_0xa735('0x17'))['db'];function respondWithStatusCode(_0x1e55fd,_0x5428f2){_0x5428f2=_0x5428f2||0xcc;return function(_0x14dd33){if(_0x14dd33){return _0x1e55fd[_0xa735('0x18')](_0x5428f2);}return _0x1e55fd['status'](_0x5428f2)[_0xa735('0x19')]();};}function respondWithResult(_0x2f727c,_0xdc5020){_0xdc5020=_0xdc5020||0xc8;return function(_0x552c7d){if(_0x552c7d){return _0x2f727c[_0xa735('0x1a')](_0xdc5020)[_0xa735('0x1b')](_0x552c7d);}};}function respondWithFilteredResult(_0x57a8f7,_0x319704){return function(_0x1def2c){if(_0x1def2c){var _0x2e012f=typeof _0x319704['offset']===_0xa735('0x1c')&&typeof _0x319704[_0xa735('0x1d')]===_0xa735('0x1c');var _0x42ba1f=_0x1def2c[_0xa735('0x1e')];var _0x36ffb0=_0x2e012f?0x0:_0x319704[_0xa735('0x1f')];var _0x4e2ca5=_0x2e012f?_0x1def2c[_0xa735('0x1e')]:_0x319704[_0xa735('0x1f')]+_0x319704[_0xa735('0x1d')];var _0x1146e0;if(_0x4e2ca5>=_0x42ba1f){_0x4e2ca5=_0x42ba1f;_0x1146e0=0xc8;}else{_0x1146e0=0xce;}_0x57a8f7[_0xa735('0x1a')](_0x1146e0);return _0x57a8f7[_0xa735('0x20')]('Content-Range',_0x36ffb0+'-'+_0x4e2ca5+'/'+_0x42ba1f)[_0xa735('0x1b')](_0x1def2c);}return null;};}function patchUpdates(_0x4cb6cb){return function(_0xe82866){try{jsonpatch[_0xa735('0x21')](_0xe82866,_0x4cb6cb,!![]);}catch(_0x283d81){return BPromise[_0xa735('0x22')](_0x283d81);}return _0xe82866[_0xa735('0x23')]();};}function saveUpdates(_0x10903d,_0x437446){return function(_0x42cbfe){if(_0x42cbfe){return _0x42cbfe['update'](_0x10903d)[_0xa735('0x24')](function(_0x108201){return _0x108201;});}return null;};}function removeEntity(_0x434c3b,_0x304519){return function(_0x242d0e){if(_0x242d0e){return _0x242d0e['destroy']()[_0xa735('0x24')](function(){_0x434c3b['status'](0xcc)[_0xa735('0x19')]();});}};}function handleEntityNotFound(_0x5188ab,_0x377b93){return function(_0x53ca9d){if(!_0x53ca9d){_0x5188ab[_0xa735('0x18')](0x194);}return _0x53ca9d;};}function handleError(_0x25acd4,_0x5d8c0f){_0x5d8c0f=_0x5d8c0f||0x1f4;return function(_0x15b78b){logger['error'](_0x15b78b['stack']);if(_0x15b78b[_0xa735('0x25')]){delete _0x15b78b[_0xa735('0x25')];}_0x25acd4[_0xa735('0x1a')](_0x5d8c0f)[_0xa735('0x26')](_0x15b78b);};}exports[_0xa735('0x27')]=function(_0x46f05c,_0x1fe2bc){var _0x9cdf94={},_0x5d062d={},_0x2c8d2f={'count':0x0,'rows':[]};var _0x1a407a=_[_0xa735('0x28')](db['ZendeskField'][_0xa735('0x29')],function(_0x55e123){return{'name':_0x55e123[_0xa735('0x2a')],'type':_0x55e123[_0xa735('0x2b')][_0xa735('0x2c')]};});_0x5d062d[_0xa735('0x2d')]=_[_0xa735('0x28')](_0x1a407a,_0xa735('0x25'));_0x5d062d['query']=_[_0xa735('0x2e')](_0x46f05c[_0xa735('0x2f')]);_0x5d062d[_0xa735('0x30')]=_['intersection'](_0x5d062d['model'],_0x5d062d[_0xa735('0x2f')]);_0x9cdf94[_0xa735('0x31')]=_['intersection'](_0x5d062d[_0xa735('0x2d')],qs[_0xa735('0x32')](_0x46f05c[_0xa735('0x2f')]['fields']));_0x9cdf94[_0xa735('0x31')]=_0x9cdf94[_0xa735('0x31')]['length']?_0x9cdf94[_0xa735('0x31')]:_0x5d062d['model'];if(!_0x46f05c[_0xa735('0x2f')][_0xa735('0x33')](_0xa735('0x34'))){_0x9cdf94[_0xa735('0x1d')]=qs['limit'](_0x46f05c[_0xa735('0x2f')]['limit']);_0x9cdf94[_0xa735('0x1f')]=qs[_0xa735('0x1f')](_0x46f05c['query']['offset']);}_0x9cdf94[_0xa735('0x35')]=qs['sort'](_0x46f05c['query'][_0xa735('0x36')]);_0x9cdf94[_0xa735('0x37')]=qs[_0xa735('0x30')](_[_0xa735('0x38')](_0x46f05c['query'],_0x5d062d[_0xa735('0x30')]),_0x1a407a);if(_0x46f05c[_0xa735('0x2f')][_0xa735('0x39')]){_0x9cdf94[_0xa735('0x37')]=_[_0xa735('0x3a')](_0x9cdf94[_0xa735('0x37')],{'$or':_[_0xa735('0x28')](_0x1a407a,function(_0x3eaa98){if(_0x3eaa98[_0xa735('0x2b')]!==_0xa735('0x3b')){var _0x5dcdb2={};_0x5dcdb2[_0x3eaa98['name']]={'$like':'%'+_0x46f05c['query']['filter']+'%'};return _0x5dcdb2;}})});}_0x9cdf94=_['merge']({},_0x9cdf94,_0x46f05c['options']);var _0x4fdc21={'where':_0x9cdf94[_0xa735('0x37')]};return db['ZendeskField'][_0xa735('0x1e')](_0x4fdc21)[_0xa735('0x24')](function(_0x1aab59){_0x2c8d2f[_0xa735('0x1e')]=_0x1aab59;if(_0x46f05c[_0xa735('0x2f')][_0xa735('0x3c')]){_0x9cdf94[_0xa735('0x3d')]=[{'all':!![]}];}return db['ZendeskField']['findAll'](_0x9cdf94);})[_0xa735('0x24')](function(_0x304e0f){_0x2c8d2f[_0xa735('0x3e')]=_0x304e0f;return _0x2c8d2f;})['then'](respondWithFilteredResult(_0x1fe2bc,_0x9cdf94))[_0xa735('0x3f')](handleError(_0x1fe2bc,null));};exports[_0xa735('0x40')]=function(_0x34e6a0,_0x41c813){var _0x1a8bae={'raw':!![],'where':{'id':_0x34e6a0[_0xa735('0x41')]['id']}},_0x53caa5={};_0x53caa5['model']=_[_0xa735('0x2e')](db[_0xa735('0x42')]['rawAttributes']);_0x53caa5[_0xa735('0x2f')]=_['keys'](_0x34e6a0[_0xa735('0x2f')]);_0x53caa5[_0xa735('0x30')]=_[_0xa735('0x43')](_0x53caa5[_0xa735('0x2d')],_0x53caa5[_0xa735('0x2f')]);_0x1a8bae['attributes']=_[_0xa735('0x43')](_0x53caa5[_0xa735('0x2d')],qs[_0xa735('0x32')](_0x34e6a0[_0xa735('0x2f')][_0xa735('0x32')]));_0x1a8bae[_0xa735('0x31')]=_0x1a8bae['attributes'][_0xa735('0x44')]?_0x1a8bae[_0xa735('0x31')]:_0x53caa5[_0xa735('0x2d')];if(_0x34e6a0[_0xa735('0x2f')]['includeAll']){_0x1a8bae['include']=[{'all':!![]}];}_0x1a8bae=_[_0xa735('0x3a')]({},_0x1a8bae,_0x34e6a0[_0xa735('0x45')]);return db['ZendeskField'][_0xa735('0x46')](_0x1a8bae)[_0xa735('0x24')](handleEntityNotFound(_0x41c813,null))[_0xa735('0x24')](respondWithResult(_0x41c813,null))[_0xa735('0x3f')](handleError(_0x41c813,null));};exports[_0xa735('0x47')]=function(_0x2c0368,_0x21985d){return db['ZendeskField'][_0xa735('0x47')](_0x2c0368[_0xa735('0x48')],{})[_0xa735('0x24')](respondWithResult(_0x21985d,0xc9))[_0xa735('0x3f')](handleError(_0x21985d,null));};exports['update']=function(_0x65c322,_0x2ea179){if(_0x65c322[_0xa735('0x48')]['id']){delete _0x65c322['body']['id'];}return db[_0xa735('0x42')][_0xa735('0x46')]({'where':{'id':_0x65c322[_0xa735('0x41')]['id']}})[_0xa735('0x24')](handleEntityNotFound(_0x2ea179,null))[_0xa735('0x24')](saveUpdates(_0x65c322[_0xa735('0x48')],null))['then'](respondWithResult(_0x2ea179,null))[_0xa735('0x3f')](handleError(_0x2ea179,null));};exports[_0xa735('0x49')]=function(_0x6ed47c,_0x304d5c){return db[_0xa735('0x42')][_0xa735('0x46')]({'where':{'id':_0x6ed47c[_0xa735('0x41')]['id']}})[_0xa735('0x24')](handleEntityNotFound(_0x304d5c,null))[_0xa735('0x24')](removeEntity(_0x304d5c,null))[_0xa735('0x3f')](handleError(_0x304d5c,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 0089486..70c8a67 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 _0xb25b=['request-promise','path','./intZendeskField.attributes','exports','ZendeskField','int_zendesk_fields','zendesk_unique_index','util','../../config/logger','api','moment'];(function(_0x568cf0,_0x1a44cb){var _0x360f81=function(_0x414953){while(--_0x414953){_0x568cf0['push'](_0x568cf0['shift']());}};_0x360f81(++_0x1a44cb);}(_0xb25b,0x80));var _0xbb25=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xb25b[_0x3b380d];return _0x54502b;};'use strict';var _=require('lodash');var util=require(_0xbb25('0x0'));var logger=require(_0xbb25('0x1'))(_0xbb25('0x2'));var moment=require(_0xbb25('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb25('0x4'));var fs=require('fs');var path=require(_0xbb25('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbb25('0x6'));module[_0xbb25('0x7')]=function(_0x2bfd16,_0xf18cf5){return _0x2bfd16['define'](_0xbb25('0x8'),attributes,{'tableName':_0xbb25('0x9'),'paranoid':![],'indexes':[{'name':_0xbb25('0xa'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1f0b=['path','../../config/environment','exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0xdb7368,_0x5e765e){var _0x109b9e=function(_0x935d95){while(--_0x935d95){_0xdb7368['push'](_0xdb7368['shift']());}};_0x109b9e(++_0x5e765e);}(_0x1f0b,0x1e9));var _0xb1f0=function(_0xfc043c,_0x5d25af){_0xfc043c=_0xfc043c-0x0;var _0x5f598a=_0x1f0b[_0xfc043c];return _0x5f598a;};'use strict';var _=require(_0xb1f0('0x0'));var util=require(_0xb1f0('0x1'));var logger=require(_0xb1f0('0x2'))(_0xb1f0('0x3'));var moment=require('moment');var BPromise=require(_0xb1f0('0x4'));var rp=require(_0xb1f0('0x5'));var fs=require('fs');var path=require(_0xb1f0('0x6'));var rimraf=require('rimraf');var config=require(_0xb1f0('0x7'));var attributes=require('./intZendeskField.attributes');module[_0xb1f0('0x8')]=function(_0x3fa09e,_0x4ca27c){return _0x3fa09e[_0xb1f0('0x9')](_0xb1f0('0xa'),attributes,{'tableName':_0xb1f0('0xb'),'paranoid':![],'indexes':[{'name':_0xb1f0('0xc'),'fields':[_0xb1f0('0xd'),_0xb1f0('0xe')],'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 a19469f..e26debe 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 _0xaba4=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','info','ZendeskField,\x20%s,\x20%s','debug','ZendeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','lodash','util'];(function(_0x24b102,_0x219284){var _0x5e8c20=function(_0x5a9399){while(--_0x5a9399){_0x24b102['push'](_0x24b102['shift']());}};_0x5e8c20(++_0x219284);}(_0xaba4,0x1ca));var _0x4aba=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaba4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4aba('0x0'));var util=require(_0x4aba('0x1'));var moment=require(_0x4aba('0x2'));var BPromise=require(_0x4aba('0x3'));var rs=require(_0x4aba('0x4'));var fs=require('fs');var Redis=require(_0x4aba('0x5'));var db=require(_0x4aba('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x4aba('0x7'))(_0x4aba('0x8'));var config=require('../../config/environment');var jayson=require(_0x4aba('0x9'));var client=jayson['client'][_0x4aba('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x26306a,_0x13522f,_0x1824eb){return new BPromise(function(_0x51fef5,_0x473923){return client[_0x4aba('0xb')](_0x26306a,_0x1824eb)['then'](function(_0x336aaa){logger[_0x4aba('0xc')](_0x4aba('0xd'),_0x13522f,'request\x20sent');logger[_0x4aba('0xe')](_0x4aba('0xf'),_0x13522f,_0x4aba('0x10'),JSON[_0x4aba('0x11')](_0x336aaa));if(_0x336aaa['error']){if(_0x336aaa['error'][_0x4aba('0x12')]===0x1f4){logger[_0x4aba('0x13')](_0x4aba('0xd'),_0x13522f,_0x336aaa[_0x4aba('0x13')][_0x4aba('0x14')]);return _0x473923(_0x336aaa['error']['message']);}logger[_0x4aba('0x13')](_0x4aba('0xd'),_0x13522f,_0x336aaa[_0x4aba('0x13')]['message']);return _0x51fef5(_0x336aaa[_0x4aba('0x13')][_0x4aba('0x14')]);}else{logger['info'](_0x4aba('0xd'),_0x13522f,_0x4aba('0x10'));_0x51fef5(_0x336aaa[_0x4aba('0x15')][_0x4aba('0x14')]);}})[_0x4aba('0x16')](function(_0x3c76c0){logger[_0x4aba('0x13')](_0x4aba('0xd'),_0x13522f,_0x3c76c0);_0x473923(_0x3c76c0);});});} \ No newline at end of file +var _0x944d=['lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','error','message','result'];(function(_0x580f3e,_0x28f1aa){var _0x15c00c=function(_0x58c2b7){while(--_0x58c2b7){_0x580f3e['push'](_0x580f3e['shift']());}};_0x15c00c(++_0x28f1aa);}(_0x944d,0x1a4));var _0xd944=function(_0x3f3abb,_0x42610a){_0x3f3abb=_0x3f3abb-0x0;var _0x201d8c=_0x944d[_0x3f3abb];return _0x201d8c;};'use strict';var _=require(_0xd944('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd944('0x1'));var rs=require(_0xd944('0x2'));var fs=require('fs');var Redis=require(_0xd944('0x3'));var db=require(_0xd944('0x4'))['db'];var utils=require(_0xd944('0x5'));var logger=require('../../config/logger')(_0xd944('0x6'));var config=require(_0xd944('0x7'));var jayson=require(_0xd944('0x8'));var client=jayson[_0xd944('0x9')][_0xd944('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x453675,_0x477303,_0xa9d1a5){return new BPromise(function(_0x1c42dc,_0x11e096){return client[_0xd944('0xb')](_0x453675,_0xa9d1a5)['then'](function(_0x4f4f12){logger[_0xd944('0xc')](_0xd944('0xd'),_0x477303,_0xd944('0xe'));logger[_0xd944('0xf')](_0xd944('0x10'),_0x477303,'request\x20sent',JSON['stringify'](_0x4f4f12));if(_0x4f4f12['error']){if(_0x4f4f12['error']['code']===0x1f4){logger['error'](_0xd944('0xd'),_0x477303,_0x4f4f12[_0xd944('0x11')]['message']);return _0x11e096(_0x4f4f12[_0xd944('0x11')][_0xd944('0x12')]);}logger[_0xd944('0x11')](_0xd944('0xd'),_0x477303,_0x4f4f12[_0xd944('0x11')][_0xd944('0x12')]);return _0x1c42dc(_0x4f4f12[_0xd944('0x11')][_0xd944('0x12')]);}else{logger[_0xd944('0xc')](_0xd944('0xd'),_0x477303,_0xd944('0xe'));_0x1c42dc(_0x4f4f12[_0xd944('0x13')]['message']);}})['catch'](function(_0x2152c5){logger[_0xd944('0x11')](_0xd944('0xd'),_0x477303,_0x2152c5);_0x11e096(_0x2152c5);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 32b2d8b..f39c5b6 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 _0x1d64=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','/:id/configurations','addConfiguration','put','update','destroy'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1d64,0x1cd));var _0x41d6=function(_0x53b8e0,_0x55d46e){_0x53b8e0=_0x53b8e0-0x0;var _0x10630c=_0x1d64[_0x53b8e0];return _0x10630c;};'use strict';var multer=require(_0x41d6('0x0'));var util=require(_0x41d6('0x1'));var path=require(_0x41d6('0x2'));var timeout=require(_0x41d6('0x3'));var express=require(_0x41d6('0x4'));var router=express['Router']();var fs_extra=require(_0x41d6('0x5'));var auth=require(_0x41d6('0x6'));var interaction=require(_0x41d6('0x7'));var config=require(_0x41d6('0x8'));var controller=require('./intZohoAccount.controller');router[_0x41d6('0x9')]('/',auth[_0x41d6('0xa')](),controller['index']);router['get'](_0x41d6('0xb'),auth['isAuthenticated'](),controller[_0x41d6('0xc')]);router[_0x41d6('0x9')]('/:id/configurations',auth[_0x41d6('0xa')](),controller['getConfigurations']);router[_0x41d6('0x9')](_0x41d6('0xd'),auth[_0x41d6('0xa')](),controller['getFields']);router['post']('/',auth[_0x41d6('0xa')](),controller['create']);router['post'](_0x41d6('0xe'),auth[_0x41d6('0xa')](),controller[_0x41d6('0xf')]);router[_0x41d6('0x10')](_0x41d6('0xb'),auth['isAuthenticated'](),controller[_0x41d6('0x11')]);router['delete'](_0x41d6('0xb'),auth[_0x41d6('0xa')](),controller[_0x41d6('0x12')]);module[_0x41d6('0x13')]=router; \ No newline at end of file +var _0x6d3e=['isAuthenticated','/:id','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get'];(function(_0x5502cf,_0x43ab4a){var _0x59f280=function(_0x696577){while(--_0x696577){_0x5502cf['push'](_0x5502cf['shift']());}};_0x59f280(++_0x43ab4a);}(_0x6d3e,0x186));var _0xe6d3=function(_0x5e3bb1,_0x3cfe7c){_0x5e3bb1=_0x5e3bb1-0x0;var _0x4c1278=_0x6d3e[_0x5e3bb1];return _0x4c1278;};'use strict';var multer=require(_0xe6d3('0x0'));var util=require(_0xe6d3('0x1'));var path=require(_0xe6d3('0x2'));var timeout=require(_0xe6d3('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe6d3('0x4'));var auth=require(_0xe6d3('0x5'));var interaction=require(_0xe6d3('0x6'));var config=require(_0xe6d3('0x7'));var controller=require(_0xe6d3('0x8'));router[_0xe6d3('0x9')]('/',auth[_0xe6d3('0xa')](),controller['index']);router['get'](_0xe6d3('0xb'),auth[_0xe6d3('0xa')](),controller[_0xe6d3('0xc')]);router['get']('/:id/configurations',auth[_0xe6d3('0xa')](),controller[_0xe6d3('0xd')]);router['get'](_0xe6d3('0xe'),auth[_0xe6d3('0xa')](),controller[_0xe6d3('0xf')]);router[_0xe6d3('0x10')]('/',auth[_0xe6d3('0xa')](),controller[_0xe6d3('0x11')]);router[_0xe6d3('0x10')](_0xe6d3('0x12'),auth['isAuthenticated'](),controller[_0xe6d3('0x13')]);router[_0xe6d3('0x14')](_0xe6d3('0xb'),auth[_0xe6d3('0xa')](),controller[_0xe6d3('0x15')]);router[_0xe6d3('0x16')]('/:id',auth['isAuthenticated'](),controller[_0xe6d3('0x17')]);module[_0xe6d3('0x18')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 209556b..b9aeefb 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 _0xe14d=['exports','STRING','sequelize'];(function(_0x50c6ba,_0x2fefac){var _0x2f42b9=function(_0x52a9c4){while(--_0x52a9c4){_0x50c6ba['push'](_0x50c6ba['shift']());}};_0x2f42b9(++_0x2fefac);}(_0xe14d,0x1ee));var _0xde14=function(_0x409353,_0xe9f04d){_0x409353=_0x409353-0x0;var _0x4f4b59=_0xe14d[_0x409353];return _0x4f4b59;};'use strict';var Sequelize=require(_0xde14('0x0'));module[_0xde14('0x1')]={'name':{'type':Sequelize[_0xde14('0x2')]},'description':{'type':Sequelize[_0xde14('0x2')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0xde14('0x2')]},'clientId':{'type':Sequelize[_0xde14('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xde14('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0xde14('0x2')]},'refreshToken':{'type':Sequelize[_0xde14('0x2')]}}; \ No newline at end of file +var _0x9f62=['exports','STRING'];(function(_0x37118c,_0xc97c93){var _0x21a866=function(_0x100a93){while(--_0x100a93){_0x37118c['push'](_0x37118c['shift']());}};_0x21a866(++_0xc97c93);}(_0x9f62,0x154));var _0x29f6=function(_0x3ed169,_0x418a39){_0x3ed169=_0x3ed169-0x0;var _0x487cb4=_0x9f62[_0x3ed169];return _0x487cb4;};'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 diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index d59e401..7fa9700 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 _0x121c=['display_label','custom_field','data_type','pick_list_values','test','statusCode','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','ZohoAccount','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','catch','show','params','rawAttributes','includeAll','find','create','body','getConfigurations','ZohoConfiguration','pick','addConfiguration','AccountId','Subjects','channel','getDescriptions','ZohoField','Descriptions','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','getFields','host','zone','serverUrl','code','zoho.eu','com','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','message','Owner','Subject','Description','WhoId','Call_Start_Time','remove','includes','api_name','system_mandatory','push'];(function(_0x2aa58e,_0x1541d2){var _0x180b86=function(_0x475483){while(--_0x475483){_0x2aa58e['push'](_0x2aa58e['shift']());}};_0x180b86(++_0x1541d2);}(_0x121c,0x193));var _0xc121=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0x121c[_0x4dbaad];return _0x226c72;};'use strict';var emlformat=require(_0xc121('0x0'));var rimraf=require(_0xc121('0x1'));var zipdir=require(_0xc121('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc121('0x3'));var moment=require(_0xc121('0x4'));var BPromise=require(_0xc121('0x5'));var Mustache=require('mustache');var util=require(_0xc121('0x6'));var path=require(_0xc121('0x7'));var sox=require(_0xc121('0x8'));var csv=require(_0xc121('0x9'));var ejs=require(_0xc121('0xa'));var fs=require('fs');var fs_extra=require(_0xc121('0xb'));var _=require(_0xc121('0xc'));var squel=require(_0xc121('0xd'));var crypto=require('crypto');var jsforce=require(_0xc121('0xe'));var deskjs=require(_0xc121('0xf'));var toCsv=require(_0xc121('0x9'));var querystring=require(_0xc121('0x10'));var Papa=require(_0xc121('0x11'));var Redis=require(_0xc121('0x12'));var authService=require(_0xc121('0x13'));var qs=require(_0xc121('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc121('0x15'))(_0xc121('0x16'));var utils=require(_0xc121('0x17'));var config=require(_0xc121('0x18'));var licenseUtil=require(_0xc121('0x19'));var db=require('../../mysqldb')['db'];var integrations=require(_0xc121('0x1a'));function respondWithStatusCode(_0x27980a,_0x169001){_0x169001=_0x169001||0xcc;return function(_0x27d3d1){if(_0x27d3d1){return _0x27980a[_0xc121('0x1b')](_0x169001);}return _0x27980a[_0xc121('0x1c')](_0x169001)[_0xc121('0x1d')]();};}function respondWithResult(_0x410c75,_0x1b724c){_0x1b724c=_0x1b724c||0xc8;return function(_0x2d0854){if(_0x2d0854){return _0x410c75['status'](_0x1b724c)[_0xc121('0x1e')](_0x2d0854);}};}function respondWithFilteredResult(_0x39df26,_0x978a15){return function(_0x323f01){if(_0x323f01){var _0x1e6d71=typeof _0x978a15[_0xc121('0x1f')]===_0xc121('0x20')&&typeof _0x978a15[_0xc121('0x21')]===_0xc121('0x20');var _0x101eda=_0x323f01[_0xc121('0x22')];var _0x55723d=_0x1e6d71?0x0:_0x978a15[_0xc121('0x1f')];var _0x2e923e=_0x1e6d71?_0x323f01[_0xc121('0x22')]:_0x978a15[_0xc121('0x1f')]+_0x978a15['limit'];var _0x52bcdc;if(_0x2e923e>=_0x101eda){_0x2e923e=_0x101eda;_0x52bcdc=0xc8;}else{_0x52bcdc=0xce;}_0x39df26[_0xc121('0x1c')](_0x52bcdc);return _0x39df26['set'](_0xc121('0x23'),_0x55723d+'-'+_0x2e923e+'/'+_0x101eda)[_0xc121('0x1e')](_0x323f01);}return null;};}function patchUpdates(_0x240205){return function(_0x338b3f){try{jsonpatch[_0xc121('0x24')](_0x338b3f,_0x240205,!![]);}catch(_0x405cbc){return BPromise[_0xc121('0x25')](_0x405cbc);}return _0x338b3f[_0xc121('0x26')]();};}function saveUpdates(_0x4792ba,_0x264b7d){return function(_0x50f2f9){if(_0x50f2f9){return _0x50f2f9[_0xc121('0x27')](_0x4792ba)['then'](function(_0x51fc73){return _0x51fc73;});}return null;};}function removeEntity(_0x4bce8a,_0xd3362){return function(_0x5cc86a){if(_0x5cc86a){return _0x5cc86a[_0xc121('0x28')]()[_0xc121('0x29')](function(){_0x4bce8a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ce172,_0x24337d){return function(_0xa5f0ed){if(!_0xa5f0ed){_0x2ce172[_0xc121('0x1b')](0x194);}return _0xa5f0ed;};}function handleError(_0x545a43,_0x207563){_0x207563=_0x207563||0x1f4;return function(_0x126adc){logger[_0xc121('0x2a')](_0x126adc[_0xc121('0x2b')]);if(_0x126adc[_0xc121('0x2c')]){delete _0x126adc[_0xc121('0x2c')];}_0x545a43[_0xc121('0x1c')](_0x207563)[_0xc121('0x2d')](_0x126adc);};}exports[_0xc121('0x2e')]=function(_0x225986,_0x46d610){var _0x200b62={},_0x5ddbd4={},_0x42c789={'count':0x0,'rows':[]};var _0x241cc0=_['map'](db[_0xc121('0x2f')]['rawAttributes'],function(_0x33093d){return{'name':_0x33093d[_0xc121('0x30')],'type':_0x33093d[_0xc121('0x31')][_0xc121('0x32')]};});_0x5ddbd4[_0xc121('0x33')]=_[_0xc121('0x34')](_0x241cc0,'name');_0x5ddbd4[_0xc121('0x35')]=_[_0xc121('0x36')](_0x225986[_0xc121('0x35')]);_0x5ddbd4[_0xc121('0x37')]=_[_0xc121('0x38')](_0x5ddbd4[_0xc121('0x33')],_0x5ddbd4[_0xc121('0x35')]);_0x200b62[_0xc121('0x39')]=_[_0xc121('0x38')](_0x5ddbd4[_0xc121('0x33')],qs[_0xc121('0x3a')](_0x225986[_0xc121('0x35')][_0xc121('0x3a')]));_0x200b62[_0xc121('0x39')]=_0x200b62[_0xc121('0x39')][_0xc121('0x3b')]?_0x200b62['attributes']:_0x5ddbd4[_0xc121('0x33')];if(!_0x225986[_0xc121('0x35')][_0xc121('0x3c')](_0xc121('0x3d'))){_0x200b62['limit']=qs[_0xc121('0x21')](_0x225986['query'][_0xc121('0x21')]);_0x200b62['offset']=qs[_0xc121('0x1f')](_0x225986[_0xc121('0x35')]['offset']);}_0x200b62[_0xc121('0x3e')]=qs[_0xc121('0x3f')](_0x225986[_0xc121('0x35')][_0xc121('0x3f')]);_0x200b62[_0xc121('0x40')]=qs[_0xc121('0x37')](_['pick'](_0x225986[_0xc121('0x35')],_0x5ddbd4[_0xc121('0x37')]),_0x241cc0);if(_0x225986[_0xc121('0x35')][_0xc121('0x41')]){_0x200b62[_0xc121('0x40')]=_[_0xc121('0x42')](_0x200b62[_0xc121('0x40')],{'$or':_[_0xc121('0x34')](_0x241cc0,function(_0x1c113f){if(_0x1c113f[_0xc121('0x31')]!==_0xc121('0x43')){var _0x3bdbe8={};_0x3bdbe8[_0x1c113f[_0xc121('0x2c')]]={'$like':'%'+_0x225986[_0xc121('0x35')]['filter']+'%'};return _0x3bdbe8;}})});}_0x200b62=_['merge']({},_0x200b62,_0x225986[_0xc121('0x44')]);var _0xe5bec2={'where':_0x200b62['where']};return db[_0xc121('0x2f')][_0xc121('0x22')](_0xe5bec2)[_0xc121('0x29')](function(_0x5db7d8){_0x42c789['count']=_0x5db7d8;if(_0x225986['query']['includeAll']){_0x200b62[_0xc121('0x45')]=[{'all':!![]}];}return db[_0xc121('0x2f')]['findAll'](_0x200b62);})[_0xc121('0x29')](function(_0x4d556f){_0x42c789['rows']=_0x4d556f;return _0x42c789;})[_0xc121('0x29')](respondWithFilteredResult(_0x46d610,_0x200b62))[_0xc121('0x46')](handleError(_0x46d610,null));};exports[_0xc121('0x47')]=function(_0x4c5d57,_0x469324){var _0x1dd0a4={'raw':![],'where':{'id':_0x4c5d57[_0xc121('0x48')]['id']}},_0x1f6bb1={};_0x1f6bb1[_0xc121('0x33')]=_[_0xc121('0x36')](db[_0xc121('0x2f')][_0xc121('0x49')]);_0x1f6bb1[_0xc121('0x35')]=_[_0xc121('0x36')](_0x4c5d57['query']);_0x1f6bb1[_0xc121('0x37')]=_['intersection'](_0x1f6bb1[_0xc121('0x33')],_0x1f6bb1['query']);_0x1dd0a4[_0xc121('0x39')]=_[_0xc121('0x38')](_0x1f6bb1[_0xc121('0x33')],qs[_0xc121('0x3a')](_0x4c5d57[_0xc121('0x35')]['fields']));_0x1dd0a4[_0xc121('0x39')]=_0x1dd0a4[_0xc121('0x39')]['length']?_0x1dd0a4[_0xc121('0x39')]:_0x1f6bb1[_0xc121('0x33')];if(_0x4c5d57[_0xc121('0x35')][_0xc121('0x4a')]){_0x1dd0a4[_0xc121('0x45')]=[{'all':!![]}];}_0x1dd0a4=_[_0xc121('0x42')]({},_0x1dd0a4,_0x4c5d57[_0xc121('0x44')]);return db['ZohoAccount'][_0xc121('0x4b')](_0x1dd0a4)[_0xc121('0x29')](handleEntityNotFound(_0x469324,null))[_0xc121('0x29')](respondWithResult(_0x469324,null))[_0xc121('0x46')](handleError(_0x469324,null));};exports[_0xc121('0x4c')]=function(_0x484e26,_0xc18327){return db[_0xc121('0x2f')][_0xc121('0x4c')](_0x484e26[_0xc121('0x4d')],{})[_0xc121('0x29')](respondWithResult(_0xc18327,0xc9))[_0xc121('0x46')](handleError(_0xc18327,null));};exports[_0xc121('0x27')]=function(_0x22c0d5,_0x51ec65){if(_0x22c0d5['body']['id']){delete _0x22c0d5['body']['id'];}return db[_0xc121('0x2f')][_0xc121('0x4b')]({'where':{'id':_0x22c0d5[_0xc121('0x48')]['id']}})[_0xc121('0x29')](handleEntityNotFound(_0x51ec65,null))[_0xc121('0x29')](saveUpdates(_0x22c0d5['body'],null))[_0xc121('0x29')](respondWithResult(_0x51ec65,null))['catch'](handleError(_0x51ec65,null));};exports[_0xc121('0x28')]=function(_0x41ec32,_0x4ac137){return db[_0xc121('0x2f')][_0xc121('0x4b')]({'where':{'id':_0x41ec32[_0xc121('0x48')]['id']}})[_0xc121('0x29')](handleEntityNotFound(_0x4ac137,null))[_0xc121('0x29')](removeEntity(_0x4ac137,null))[_0xc121('0x46')](handleError(_0x4ac137,null));};exports[_0xc121('0x4e')]=function(_0x312fe8,_0x53a7f5,_0x203dbd){var _0x591e33={};var _0x1ae489={};var _0x392e56;var _0x379eb6;return db['ZohoAccount']['findOne']({'where':{'id':_0x312fe8[_0xc121('0x48')]['id']}})[_0xc121('0x29')](handleEntityNotFound(_0x53a7f5,null))['then'](function(_0x207f1d){if(_0x207f1d){_0x392e56=_0x207f1d;_0x1ae489[_0xc121('0x33')]=_[_0xc121('0x36')](db[_0xc121('0x4f')][_0xc121('0x49')]);_0x1ae489[_0xc121('0x35')]=_[_0xc121('0x36')](_0x312fe8[_0xc121('0x35')]);_0x1ae489[_0xc121('0x37')]=_[_0xc121('0x38')](_0x1ae489[_0xc121('0x33')],_0x1ae489[_0xc121('0x35')]);_0x591e33[_0xc121('0x39')]=_[_0xc121('0x38')](_0x1ae489[_0xc121('0x33')],qs[_0xc121('0x3a')](_0x312fe8[_0xc121('0x35')][_0xc121('0x3a')]));_0x591e33['attributes']=_0x591e33['attributes'][_0xc121('0x3b')]?_0x591e33[_0xc121('0x39')]:_0x1ae489[_0xc121('0x33')];_0x591e33[_0xc121('0x3e')]=qs['sort'](_0x312fe8['query'][_0xc121('0x3f')]);_0x591e33[_0xc121('0x40')]=qs[_0xc121('0x37')](_[_0xc121('0x50')](_0x312fe8[_0xc121('0x35')],_0x1ae489[_0xc121('0x37')]));if(_0x312fe8[_0xc121('0x35')][_0xc121('0x41')]){_0x591e33[_0xc121('0x40')]=_['merge'](_0x591e33[_0xc121('0x40')],{'$or':_['map'](_0x591e33[_0xc121('0x39')],function(_0x325980){var _0x571116={};_0x571116[_0x325980]={'$like':'%'+_0x312fe8[_0xc121('0x35')]['filter']+'%'};return _0x571116;})});}_0x591e33=_[_0xc121('0x42')]({},_0x591e33,_0x312fe8[_0xc121('0x44')]);return _0x392e56[_0xc121('0x4e')](_0x591e33);}})['then'](function(_0x59df3f){if(_0x59df3f){_0x379eb6=_0x59df3f[_0xc121('0x3b')];if(!_0x312fe8[_0xc121('0x35')]['hasOwnProperty'](_0xc121('0x3d'))){_0x591e33[_0xc121('0x21')]=qs[_0xc121('0x21')](_0x312fe8[_0xc121('0x35')][_0xc121('0x21')]);_0x591e33[_0xc121('0x1f')]=qs[_0xc121('0x1f')](_0x312fe8[_0xc121('0x35')][_0xc121('0x1f')]);}return _0x392e56[_0xc121('0x4e')](_0x591e33);}})[_0xc121('0x29')](function(_0xcc6165){if(_0xcc6165){return _0xcc6165?{'count':_0x379eb6,'rows':_0xcc6165}:null;}})[_0xc121('0x29')](respondWithResult(_0x53a7f5,null))[_0xc121('0x46')](handleError(_0x53a7f5,null));};exports[_0xc121('0x51')]=function(_0xc4db63,_0x488034,_0x1b134e){if(_0xc4db63[_0xc121('0x4d')]['id']){delete _0xc4db63[_0xc121('0x4d')]['id'];}return db['ZohoAccount']['findOne']({'where':{'id':_0xc4db63[_0xc121('0x48')]['id']}})[_0xc121('0x29')](handleEntityNotFound(_0x488034,null))[_0xc121('0x29')](function(_0xdef3c9){if(_0xdef3c9){_0xc4db63['body'][_0xc121('0x52')]=_0xdef3c9['id'];_0xc4db63[_0xc121('0x4d')][_0xc121('0x53')]=integrations['getSubjects'](_0xc4db63['body'][_0xc121('0x54')],_0xc4db63[_0xc121('0x4d')][_0xc121('0x31')]);_0xc4db63[_0xc121('0x4d')]['Descriptions']=integrations[_0xc121('0x55')](_0xc4db63['body']['channel'],_0xc4db63[_0xc121('0x4d')]['type']);return db['ZohoConfiguration'][_0xc121('0x4c')](_0xc4db63[_0xc121('0x4d')],{'include':[{'model':db['ZohoField'],'as':_0xc121('0x53')},{'model':db[_0xc121('0x56')],'as':_0xc121('0x57')}]});}return null;})[_0xc121('0x29')](respondWithResult(_0x488034,null))[_0xc121('0x46')](handleError(_0x488034,null));};function getAccessToken(_0x4ff73a){return new Promise(function(_0x31d50e,_0x3f6c00){var _0xdff5f5;switch(_0x4ff73a['zone']){case'US':_0xdff5f5=_0xc121('0x58');break;case'AU':_0xdff5f5=_0xc121('0x59');break;case'EU':_0xdff5f5='https://accounts.zoho.eu';break;case'IN':_0xdff5f5=_0xc121('0x5a');break;case'CN':_0xdff5f5='https://accounts.zoho.com.cn';break;default:_0xdff5f5=_0xc121('0x5b');break;}var _0x132080={'method':_0xc121('0x5c'),'uri':_0xdff5f5+_0xc121('0x5d'),'qs':{'refresh_token':_0x4ff73a[_0xc121('0x5e')],'client_id':_0x4ff73a[_0xc121('0x5f')],'client_secret':_0x4ff73a[_0xc121('0x60')],'grant_type':_0xc121('0x61')},'json':!![]};return rp(_0x132080)[_0xc121('0x29')](function(_0x50fd94){if(_0x50fd94[_0xc121('0x62')]){_0x31d50e(_0x50fd94[_0xc121('0x62')]);}else{_0x3f6c00('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})['catch'](function(_0x5c35f5){_0x3f6c00(_0x5c35f5);});});}exports[_0xc121('0x63')]=function(_0x3fbca2,_0x51304e,_0x3251b0){var _0x1e267f,_0x550e56,_0x415eed,_0x21b3a0,_0xb37ef1;return db[_0xc121('0x2f')]['findOne']({'where':{'id':_0x3fbca2[_0xc121('0x48')]['id']},'attributes':['id',_0xc121('0x64'),_0xc121('0x65'),'clientId','clientSecret',_0xc121('0x66'),_0xc121('0x67'),_0xc121('0x5e')]})['then'](handleEntityNotFound(_0x51304e,null))[_0xc121('0x29')](function(_0x4c3a59){_0xb37ef1=_0x4c3a59;_0x1e267f=_0xb37ef1[_0xc121('0x64')];_0x550e56=_0x1e267f===_0xc121('0x68')?'eu':_0xc121('0x69');_0x415eed=_0xb37ef1[_0xc121('0x66')];var _0x33f0c0=_0x415eed[_0xc121('0x6a')](-0x1);if(_0x33f0c0==='/'||_0x33f0c0==='\x5c'||_0x33f0c0===':'){_0x415eed=_0x415eed[_0xc121('0x6b')](0x0,_0x415eed[_0xc121('0x6c')](_0x33f0c0));}if(!_0xb37ef1[_0xc121('0x5e')]){throw new Error(_0xc121('0x6d'));}return getAccessToken(_0xb37ef1);})['then'](function(_0x20f6d4){if(_0x20f6d4){return rp({'method':'GET','uri':util['format'](_0xc121('0x6e'),_0x550e56),'qs':{'module':_0xc121('0x6f')},'headers':{'Authorization':_0xc121('0x70')+_0x20f6d4},'json':!![]});}})[_0xc121('0x29')](function(_0x251390){if(_0x251390){if(_0x251390[_0xc121('0x71')]&&_0x251390[_0xc121('0x71')][_0xc121('0x2a')]){throw new Error(_0x251390[_0xc121('0x71')][_0xc121('0x2a')][_0xc121('0x72')]);}var _0x10c738=[];var _0x3fe867=[];var _0x144647=[_0xc121('0x73'),_0xc121('0x74'),_0xc121('0x75'),_0xc121('0x76'),'Call_Duration','Call_Result',_0xc121('0x77'),'Call_Type'];_0x3fe867=_[_0xc121('0x78')](_0x251390[_0xc121('0x3a')],function(_0x1a2600){return _0x144647[_0xc121('0x79')](_0x1a2600[_0xc121('0x7a')]);});for(var _0x3c9d81=0x0;_0x3c9d81<_0x3fe867[_0xc121('0x3b')];_0x3c9d81++){if(_0x3fe867[_0x3c9d81][_0xc121('0x7b')]===![]){_0x10c738[_0xc121('0x7c')]({'id':_0x3fe867[_0x3c9d81]['id'],'name':_0x3fe867[_0x3c9d81][_0xc121('0x7d')],'custom':_0x3fe867[_0x3c9d81][_0xc121('0x7e')],'options':_0x3fe867[_0x3c9d81][_0xc121('0x7f')]==='picklist'&&_0x3fe867[_0x3c9d81][_0xc121('0x80')][_0xc121('0x3b')]>-0x1?_['map'](_0x3fe867[_0x3c9d81][_0xc121('0x80')],function(_0x3a17dc){return{'name':_0x3a17dc,'value':_0x3a17dc};}):[]});}}return{'count':_0x10c738[_0xc121('0x3b')],'rows':_0x10c738};}else{return{'count':0x0,'rows':[]};}})[_0xc121('0x29')](respondWithResult(_0x51304e,null))[_0xc121('0x46')](function(_0xad9848){var _0x34a382=_0x3fbca2[_0xc121('0x35')][_0xc121('0x81')]?0x1f4:_0xad9848[_0xc121('0x82')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x34a382,JSON['stringify'](_0xad9848));delete _0xad9848[_0xc121('0x2c')];if(_0x34a382===0x191){_0x34a382=0x190;}_0x51304e['status'](_0x34a382)[_0xc121('0x2d')](_0x3fbca2['query'][_0xc121('0x81')]?{'message':_0xc121('0x83'),'statusCode':_0xad9848[_0xc121('0x82')]}:_0xad9848);});}; \ No newline at end of file +var _0xadfe=['Owner','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','includes','api_name','push','custom_field','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','index','map','ZohoAccount','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','keys','filters','options','find','create','body','params','getConfigurations','findOne','ZohoConfiguration','addConfiguration','AccountId','channel','Descriptions','getDescriptions','ZohoField','Subjects','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','POST','refreshToken','clientSecret','refresh_token','access_token','host','code','zoho.eu','com','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','message'];(function(_0x39f6bb,_0x9400ee){var _0x4abee0=function(_0x27575c){while(--_0x27575c){_0x39f6bb['push'](_0x39f6bb['shift']());}};_0x4abee0(++_0x9400ee);}(_0xadfe,0x1a4));var _0xeadf=function(_0x801b8e,_0x56bade){_0x801b8e=_0x801b8e-0x0;var _0x58b513=_0xadfe[_0x801b8e];return _0x58b513;};'use strict';var emlformat=require(_0xeadf('0x0'));var rimraf=require(_0xeadf('0x1'));var zipdir=require(_0xeadf('0x2'));var jsonpatch=require(_0xeadf('0x3'));var rp=require(_0xeadf('0x4'));var moment=require('moment');var BPromise=require(_0xeadf('0x5'));var Mustache=require(_0xeadf('0x6'));var util=require(_0xeadf('0x7'));var path=require(_0xeadf('0x8'));var sox=require(_0xeadf('0x9'));var csv=require(_0xeadf('0xa'));var ejs=require(_0xeadf('0xb'));var fs=require('fs');var fs_extra=require(_0xeadf('0xc'));var _=require(_0xeadf('0xd'));var squel=require(_0xeadf('0xe'));var crypto=require(_0xeadf('0xf'));var jsforce=require(_0xeadf('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xeadf('0xa'));var querystring=require(_0xeadf('0x11'));var Papa=require(_0xeadf('0x12'));var Redis=require(_0xeadf('0x13'));var authService=require(_0xeadf('0x14'));var qs=require(_0xeadf('0x15'));var as=require(_0xeadf('0x16'));var hardwareService=require(_0xeadf('0x17'));var logger=require(_0xeadf('0x18'))(_0xeadf('0x19'));var utils=require(_0xeadf('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0xeadf('0x1b'));var db=require(_0xeadf('0x1c'))['db'];var integrations=require(_0xeadf('0x1d'));function respondWithStatusCode(_0x567b33,_0x203675){_0x203675=_0x203675||0xcc;return function(_0x422347){if(_0x422347){return _0x567b33[_0xeadf('0x1e')](_0x203675);}return _0x567b33[_0xeadf('0x1f')](_0x203675)['end']();};}function respondWithResult(_0x218129,_0x30f19a){_0x30f19a=_0x30f19a||0xc8;return function(_0x31e3a8){if(_0x31e3a8){return _0x218129[_0xeadf('0x1f')](_0x30f19a)[_0xeadf('0x20')](_0x31e3a8);}};}function respondWithFilteredResult(_0x373aa4,_0x5d67bc){return function(_0x28b8c4){if(_0x28b8c4){var _0x5e5365=typeof _0x5d67bc['offset']===_0xeadf('0x21')&&typeof _0x5d67bc['limit']==='undefined';var _0x592d49=_0x28b8c4[_0xeadf('0x22')];var _0x21119b=_0x5e5365?0x0:_0x5d67bc[_0xeadf('0x23')];var _0x611f6b=_0x5e5365?_0x28b8c4['count']:_0x5d67bc[_0xeadf('0x23')]+_0x5d67bc[_0xeadf('0x24')];var _0x4af856;if(_0x611f6b>=_0x592d49){_0x611f6b=_0x592d49;_0x4af856=0xc8;}else{_0x4af856=0xce;}_0x373aa4[_0xeadf('0x1f')](_0x4af856);return _0x373aa4[_0xeadf('0x25')](_0xeadf('0x26'),_0x21119b+'-'+_0x611f6b+'/'+_0x592d49)['json'](_0x28b8c4);}return null;};}function patchUpdates(_0x55a2d5){return function(_0x583e19){try{jsonpatch[_0xeadf('0x27')](_0x583e19,_0x55a2d5,!![]);}catch(_0xf1c79d){return BPromise[_0xeadf('0x28')](_0xf1c79d);}return _0x583e19['save']();};}function saveUpdates(_0x52b4dd,_0x398527){return function(_0x3a99aa){if(_0x3a99aa){return _0x3a99aa[_0xeadf('0x29')](_0x52b4dd)[_0xeadf('0x2a')](function(_0x3fcec3){return _0x3fcec3;});}return null;};}function removeEntity(_0x4168d7,_0x52d5c4){return function(_0x2035b2){if(_0x2035b2){return _0x2035b2[_0xeadf('0x2b')]()[_0xeadf('0x2a')](function(){_0x4168d7[_0xeadf('0x1f')](0xcc)[_0xeadf('0x2c')]();});}};}function handleEntityNotFound(_0x4e908b,_0x1b5a51){return function(_0x39cfdf){if(!_0x39cfdf){_0x4e908b[_0xeadf('0x1e')](0x194);}return _0x39cfdf;};}function handleError(_0x44ae49,_0x1e48cb){_0x1e48cb=_0x1e48cb||0x1f4;return function(_0x378d0c){logger[_0xeadf('0x2d')](_0x378d0c[_0xeadf('0x2e')]);if(_0x378d0c[_0xeadf('0x2f')]){delete _0x378d0c[_0xeadf('0x2f')];}_0x44ae49['status'](_0x1e48cb)['send'](_0x378d0c);};}exports[_0xeadf('0x30')]=function(_0x5a3963,_0x169622){var _0x4c4566={},_0x8f1f2f={},_0x95c27f={'count':0x0,'rows':[]};var _0x14a69d=_[_0xeadf('0x31')](db[_0xeadf('0x32')][_0xeadf('0x33')],function(_0x1abf14){return{'name':_0x1abf14[_0xeadf('0x34')],'type':_0x1abf14[_0xeadf('0x35')]['key']};});_0x8f1f2f[_0xeadf('0x36')]=_[_0xeadf('0x31')](_0x14a69d,_0xeadf('0x2f'));_0x8f1f2f[_0xeadf('0x37')]=_['keys'](_0x5a3963[_0xeadf('0x37')]);_0x8f1f2f['filters']=_[_0xeadf('0x38')](_0x8f1f2f[_0xeadf('0x36')],_0x8f1f2f[_0xeadf('0x37')]);_0x4c4566[_0xeadf('0x39')]=_[_0xeadf('0x38')](_0x8f1f2f[_0xeadf('0x36')],qs[_0xeadf('0x3a')](_0x5a3963[_0xeadf('0x37')][_0xeadf('0x3a')]));_0x4c4566[_0xeadf('0x39')]=_0x4c4566[_0xeadf('0x39')][_0xeadf('0x3b')]?_0x4c4566[_0xeadf('0x39')]:_0x8f1f2f[_0xeadf('0x36')];if(!_0x5a3963['query'][_0xeadf('0x3c')](_0xeadf('0x3d'))){_0x4c4566[_0xeadf('0x24')]=qs['limit'](_0x5a3963[_0xeadf('0x37')][_0xeadf('0x24')]);_0x4c4566[_0xeadf('0x23')]=qs[_0xeadf('0x23')](_0x5a3963[_0xeadf('0x37')][_0xeadf('0x23')]);}_0x4c4566[_0xeadf('0x3e')]=qs[_0xeadf('0x3f')](_0x5a3963[_0xeadf('0x37')][_0xeadf('0x3f')]);_0x4c4566[_0xeadf('0x40')]=qs['filters'](_[_0xeadf('0x41')](_0x5a3963[_0xeadf('0x37')],_0x8f1f2f['filters']),_0x14a69d);if(_0x5a3963[_0xeadf('0x37')][_0xeadf('0x42')]){_0x4c4566[_0xeadf('0x40')]=_['merge'](_0x4c4566[_0xeadf('0x40')],{'$or':_['map'](_0x14a69d,function(_0x349b76){if(_0x349b76[_0xeadf('0x35')]!=='VIRTUAL'){var _0x5b5eb3={};_0x5b5eb3[_0x349b76[_0xeadf('0x2f')]]={'$like':'%'+_0x5a3963[_0xeadf('0x37')][_0xeadf('0x42')]+'%'};return _0x5b5eb3;}})});}_0x4c4566=_[_0xeadf('0x43')]({},_0x4c4566,_0x5a3963['options']);var _0x48ea83={'where':_0x4c4566[_0xeadf('0x40')]};return db[_0xeadf('0x32')]['count'](_0x48ea83)[_0xeadf('0x2a')](function(_0x5cc4ec){_0x95c27f[_0xeadf('0x22')]=_0x5cc4ec;if(_0x5a3963['query'][_0xeadf('0x44')]){_0x4c4566[_0xeadf('0x45')]=[{'all':!![]}];}return db[_0xeadf('0x32')][_0xeadf('0x46')](_0x4c4566);})['then'](function(_0x598b89){_0x95c27f[_0xeadf('0x47')]=_0x598b89;return _0x95c27f;})['then'](respondWithFilteredResult(_0x169622,_0x4c4566))[_0xeadf('0x48')](handleError(_0x169622,null));};exports['show']=function(_0x3339f3,_0x2f4a10){var _0x5ad9d0={'raw':![],'where':{'id':_0x3339f3['params']['id']}},_0x512065={};_0x512065[_0xeadf('0x36')]=_['keys'](db[_0xeadf('0x32')][_0xeadf('0x33')]);_0x512065[_0xeadf('0x37')]=_[_0xeadf('0x49')](_0x3339f3['query']);_0x512065[_0xeadf('0x4a')]=_[_0xeadf('0x38')](_0x512065[_0xeadf('0x36')],_0x512065[_0xeadf('0x37')]);_0x5ad9d0[_0xeadf('0x39')]=_['intersection'](_0x512065['model'],qs[_0xeadf('0x3a')](_0x3339f3['query'][_0xeadf('0x3a')]));_0x5ad9d0[_0xeadf('0x39')]=_0x5ad9d0[_0xeadf('0x39')][_0xeadf('0x3b')]?_0x5ad9d0[_0xeadf('0x39')]:_0x512065[_0xeadf('0x36')];if(_0x3339f3[_0xeadf('0x37')]['includeAll']){_0x5ad9d0[_0xeadf('0x45')]=[{'all':!![]}];}_0x5ad9d0=_[_0xeadf('0x43')]({},_0x5ad9d0,_0x3339f3[_0xeadf('0x4b')]);return db['ZohoAccount'][_0xeadf('0x4c')](_0x5ad9d0)[_0xeadf('0x2a')](handleEntityNotFound(_0x2f4a10,null))['then'](respondWithResult(_0x2f4a10,null))[_0xeadf('0x48')](handleError(_0x2f4a10,null));};exports[_0xeadf('0x4d')]=function(_0x253b76,_0x23da49){return db[_0xeadf('0x32')][_0xeadf('0x4d')](_0x253b76['body'],{})['then'](respondWithResult(_0x23da49,0xc9))['catch'](handleError(_0x23da49,null));};exports['update']=function(_0x5bd94e,_0x3573a1){if(_0x5bd94e[_0xeadf('0x4e')]['id']){delete _0x5bd94e['body']['id'];}return db[_0xeadf('0x32')][_0xeadf('0x4c')]({'where':{'id':_0x5bd94e['params']['id']}})[_0xeadf('0x2a')](handleEntityNotFound(_0x3573a1,null))[_0xeadf('0x2a')](saveUpdates(_0x5bd94e['body'],null))[_0xeadf('0x2a')](respondWithResult(_0x3573a1,null))[_0xeadf('0x48')](handleError(_0x3573a1,null));};exports['destroy']=function(_0x33b0ba,_0x4f72cb){return db[_0xeadf('0x32')][_0xeadf('0x4c')]({'where':{'id':_0x33b0ba[_0xeadf('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4f72cb,null))[_0xeadf('0x2a')](removeEntity(_0x4f72cb,null))[_0xeadf('0x48')](handleError(_0x4f72cb,null));};exports[_0xeadf('0x50')]=function(_0x553948,_0x17b9cc,_0x4c3828){var _0x193232={};var _0x3de5f={};var _0x2b9dff;var _0xd6025b;return db['ZohoAccount'][_0xeadf('0x51')]({'where':{'id':_0x553948[_0xeadf('0x4f')]['id']}})[_0xeadf('0x2a')](handleEntityNotFound(_0x17b9cc,null))[_0xeadf('0x2a')](function(_0x2f158c){if(_0x2f158c){_0x2b9dff=_0x2f158c;_0x3de5f[_0xeadf('0x36')]=_[_0xeadf('0x49')](db[_0xeadf('0x52')][_0xeadf('0x33')]);_0x3de5f[_0xeadf('0x37')]=_[_0xeadf('0x49')](_0x553948[_0xeadf('0x37')]);_0x3de5f[_0xeadf('0x4a')]=_[_0xeadf('0x38')](_0x3de5f[_0xeadf('0x36')],_0x3de5f['query']);_0x193232[_0xeadf('0x39')]=_[_0xeadf('0x38')](_0x3de5f[_0xeadf('0x36')],qs['fields'](_0x553948[_0xeadf('0x37')][_0xeadf('0x3a')]));_0x193232['attributes']=_0x193232['attributes']['length']?_0x193232[_0xeadf('0x39')]:_0x3de5f[_0xeadf('0x36')];_0x193232[_0xeadf('0x3e')]=qs[_0xeadf('0x3f')](_0x553948[_0xeadf('0x37')][_0xeadf('0x3f')]);_0x193232[_0xeadf('0x40')]=qs[_0xeadf('0x4a')](_[_0xeadf('0x41')](_0x553948[_0xeadf('0x37')],_0x3de5f[_0xeadf('0x4a')]));if(_0x553948[_0xeadf('0x37')]['filter']){_0x193232[_0xeadf('0x40')]=_['merge'](_0x193232['where'],{'$or':_[_0xeadf('0x31')](_0x193232['attributes'],function(_0x3dd1f6){var _0x2eaee5={};_0x2eaee5[_0x3dd1f6]={'$like':'%'+_0x553948['query'][_0xeadf('0x42')]+'%'};return _0x2eaee5;})});}_0x193232=_[_0xeadf('0x43')]({},_0x193232,_0x553948['options']);return _0x2b9dff['getConfigurations'](_0x193232);}})['then'](function(_0x4ab63e){if(_0x4ab63e){_0xd6025b=_0x4ab63e[_0xeadf('0x3b')];if(!_0x553948[_0xeadf('0x37')][_0xeadf('0x3c')](_0xeadf('0x3d'))){_0x193232[_0xeadf('0x24')]=qs['limit'](_0x553948[_0xeadf('0x37')]['limit']);_0x193232['offset']=qs['offset'](_0x553948['query'][_0xeadf('0x23')]);}return _0x2b9dff[_0xeadf('0x50')](_0x193232);}})[_0xeadf('0x2a')](function(_0x5701a5){if(_0x5701a5){return _0x5701a5?{'count':_0xd6025b,'rows':_0x5701a5}:null;}})[_0xeadf('0x2a')](respondWithResult(_0x17b9cc,null))[_0xeadf('0x48')](handleError(_0x17b9cc,null));};exports[_0xeadf('0x53')]=function(_0x3b2dd2,_0x2281b0,_0x1cbc75){if(_0x3b2dd2[_0xeadf('0x4e')]['id']){delete _0x3b2dd2[_0xeadf('0x4e')]['id'];}return db[_0xeadf('0x32')][_0xeadf('0x51')]({'where':{'id':_0x3b2dd2[_0xeadf('0x4f')]['id']}})[_0xeadf('0x2a')](handleEntityNotFound(_0x2281b0,null))[_0xeadf('0x2a')](function(_0x70fac){if(_0x70fac){_0x3b2dd2[_0xeadf('0x4e')][_0xeadf('0x54')]=_0x70fac['id'];_0x3b2dd2[_0xeadf('0x4e')]['Subjects']=integrations['getSubjects'](_0x3b2dd2[_0xeadf('0x4e')][_0xeadf('0x55')],_0x3b2dd2[_0xeadf('0x4e')][_0xeadf('0x35')]);_0x3b2dd2['body'][_0xeadf('0x56')]=integrations[_0xeadf('0x57')](_0x3b2dd2[_0xeadf('0x4e')]['channel'],_0x3b2dd2[_0xeadf('0x4e')][_0xeadf('0x35')]);return db['ZohoConfiguration'][_0xeadf('0x4d')](_0x3b2dd2[_0xeadf('0x4e')],{'include':[{'model':db[_0xeadf('0x58')],'as':_0xeadf('0x59')},{'model':db['ZohoField'],'as':'Descriptions'}]});}return null;})[_0xeadf('0x2a')](respondWithResult(_0x2281b0,null))[_0xeadf('0x48')](handleError(_0x2281b0,null));};function getAccessToken(_0x556d4a){return new Promise(function(_0xbf11e1,_0x2bf94b){var _0x3763ed;switch(_0x556d4a[_0xeadf('0x5a')]){case'US':_0x3763ed=_0xeadf('0x5b');break;case'AU':_0x3763ed=_0xeadf('0x5c');break;case'EU':_0x3763ed=_0xeadf('0x5d');break;case'IN':_0x3763ed=_0xeadf('0x5e');break;case'CN':_0x3763ed='https://accounts.zoho.com.cn';break;default:_0x3763ed=_0xeadf('0x5d');break;}var _0x2d99cc={'method':_0xeadf('0x5f'),'uri':_0x3763ed+'/oauth/v2/token','qs':{'refresh_token':_0x556d4a[_0xeadf('0x60')],'client_id':_0x556d4a['clientId'],'client_secret':_0x556d4a[_0xeadf('0x61')],'grant_type':_0xeadf('0x62')},'json':!![]};return rp(_0x2d99cc)[_0xeadf('0x2a')](function(_0xaf626b){if(_0xaf626b[_0xeadf('0x63')]){_0xbf11e1(_0xaf626b[_0xeadf('0x63')]);}else{_0x2bf94b('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})[_0xeadf('0x48')](function(_0x462d6b){_0x2bf94b(_0x462d6b);});});}exports['getFields']=function(_0x3c357c,_0x2c20d0,_0x1b4a30){var _0x4dc733,_0x3a5357,_0x196299,_0x485210,_0x29f2eb;return db[_0xeadf('0x32')][_0xeadf('0x51')]({'where':{'id':_0x3c357c[_0xeadf('0x4f')]['id']},'attributes':['id',_0xeadf('0x64'),_0xeadf('0x5a'),'clientId',_0xeadf('0x61'),'serverUrl',_0xeadf('0x65'),_0xeadf('0x60')]})['then'](handleEntityNotFound(_0x2c20d0,null))[_0xeadf('0x2a')](function(_0x135f86){_0x29f2eb=_0x135f86;_0x4dc733=_0x29f2eb[_0xeadf('0x64')];_0x3a5357=_0x4dc733===_0xeadf('0x66')?'eu':_0xeadf('0x67');_0x196299=_0x29f2eb['serverUrl'];var _0x5f5897=_0x196299['slice'](-0x1);if(_0x5f5897==='/'||_0x5f5897==='\x5c'||_0x5f5897===':'){_0x196299=_0x196299['substring'](0x0,_0x196299[_0xeadf('0x68')](_0x5f5897));}if(!_0x29f2eb[_0xeadf('0x60')]){throw new Error(_0xeadf('0x69'));}return getAccessToken(_0x29f2eb);})[_0xeadf('0x2a')](function(_0x248b23){if(_0x248b23){return rp({'method':'GET','uri':util[_0xeadf('0x6a')](_0xeadf('0x6b'),_0x3a5357),'qs':{'module':_0xeadf('0x6c')},'headers':{'Authorization':_0xeadf('0x6d')+_0x248b23},'json':!![]});}})[_0xeadf('0x2a')](function(_0x38f59a){if(_0x38f59a){if(_0x38f59a[_0xeadf('0x6e')]&&_0x38f59a[_0xeadf('0x6e')][_0xeadf('0x2d')]){throw new Error(_0x38f59a[_0xeadf('0x6e')]['error'][_0xeadf('0x6f')]);}var _0x5ce150=[];var _0x25ffb5=[];var _0x466ed8=[_0xeadf('0x70'),_0xeadf('0x71'),_0xeadf('0x72'),_0xeadf('0x73'),_0xeadf('0x74'),_0xeadf('0x75'),_0xeadf('0x76'),_0xeadf('0x77')];_0x25ffb5=_['remove'](_0x38f59a[_0xeadf('0x3a')],function(_0x2f5bd0){return _0x466ed8[_0xeadf('0x78')](_0x2f5bd0[_0xeadf('0x79')]);});for(var _0x1068fa=0x0;_0x1068fa<_0x25ffb5[_0xeadf('0x3b')];_0x1068fa++){if(_0x25ffb5[_0x1068fa]['system_mandatory']===![]){_0x5ce150[_0xeadf('0x7a')]({'id':_0x25ffb5[_0x1068fa]['id'],'name':_0x25ffb5[_0x1068fa]['display_label'],'custom':_0x25ffb5[_0x1068fa][_0xeadf('0x7b')],'options':_0x25ffb5[_0x1068fa][_0xeadf('0x7c')]===_0xeadf('0x7d')&&_0x25ffb5[_0x1068fa][_0xeadf('0x7e')]['length']>-0x1?_[_0xeadf('0x31')](_0x25ffb5[_0x1068fa][_0xeadf('0x7e')],function(_0xe4fca1){return{'name':_0xe4fca1,'value':_0xe4fca1};}):[]});}}return{'count':_0x5ce150[_0xeadf('0x3b')],'rows':_0x5ce150};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x2c20d0,null))[_0xeadf('0x48')](function(_0x129e2c){var _0x1f81cc=_0x3c357c['query'][_0xeadf('0x7f')]?0x1f4:_0x129e2c[_0xeadf('0x80')]||0x1f4;logger[_0xeadf('0x2d')](_0xeadf('0x81'),'getFields',_0x1f81cc,JSON[_0xeadf('0x82')](_0x129e2c));delete _0x129e2c[_0xeadf('0x2f')];if(_0x1f81cc===0x191){_0x1f81cc=0x190;}_0x2c20d0['status'](_0x1f81cc)[_0xeadf('0x83')](_0x3c357c[_0xeadf('0x37')][_0xeadf('0x7f')]?{'message':_0xeadf('0x84'),'statusCode':_0x129e2c[_0xeadf('0x80')]}:_0x129e2c);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 471f99e..a725985 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 _0x652a=['https://accounts.zoho.eu','code','application/x-www-form-urlencoded','refreshToken','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','ZohoAccount','changed','zone','serverUrl','clientId','clientSecret','host','slice','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','/oauth/v2/token','authorization_code','parse','refresh_token','info','error','format','catch','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','substring','https://accounts.zoho.com.cn'];(function(_0x57a01b,_0x174e7b){var _0x252fd6=function(_0x3ded47){while(--_0x3ded47){_0x57a01b['push'](_0x57a01b['shift']());}};_0x252fd6(++_0x174e7b);}(_0x652a,0x78));var _0xa652=function(_0x4e67cc,_0x2454cc){_0x4e67cc=_0x4e67cc-0x0;var _0x226efd=_0x652a[_0x4e67cc];return _0x226efd;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa652('0x0'))(_0xa652('0x1'));var moment=require(_0xa652('0x2'));var BPromise=require(_0xa652('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa652('0x4'));var config=require(_0xa652('0x5'));var attributes=require(_0xa652('0x6'));var integrations=require(_0xa652('0x7'));module['exports']=function(_0x1b7be2,_0x40efcf){return _0x1b7be2['define'](_0xa652('0x8'),attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x39999b,_0x3e9fdd,_0x203cb8){if(_0x39999b[_0xa652('0x9')](_0xa652('0xa'))||_0x39999b[_0xa652('0x9')](_0xa652('0xb'))||_0x39999b[_0xa652('0x9')](_0xa652('0xc'))||_0x39999b['changed'](_0xa652('0xd'))||_0x39999b[_0xa652('0x9')]('code')||_0x39999b[_0xa652('0x9')](_0xa652('0xe'))){var _0x508189,_0x13f374;_0x508189=_0x39999b[_0xa652('0xb')];var _0x50c39d=_0x508189[_0xa652('0xf')](-0x1);if(_0x50c39d==='/'||_0x50c39d==='\x5c'||_0x50c39d===':'){_0x508189=_0x508189['substring'](0x0,_0x508189[_0xa652('0x10')](_0x50c39d));}switch(_0x39999b[_0xa652('0xa')]){case'US':_0x13f374=_0xa652('0x11');break;case'AU':_0x13f374=_0xa652('0x12');break;case'IN':_0x13f374=_0xa652('0x13');break;case'CN':_0x13f374='https://accounts.zoho.com.cn';break;default:_0x13f374='https://accounts.zoho.eu';break;}var _0x241c65={'method':'POST','uri':_0x13f374+_0xa652('0x14'),'form':{'grant_type':_0xa652('0x15'),'client_id':_0x39999b[_0xa652('0xc')],'client_secret':_0x39999b[_0xa652('0xd')],'redirect_uri':_0x39999b[_0xa652('0xb')],'code':_0x39999b['code']},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x241c65)['then'](function(_0x5e4118){var _0x1c700b=JSON[_0xa652('0x16')](_0x5e4118);if(_0x1c700b[_0xa652('0x17')]){_0x39999b['refreshToken']=_0x1c700b['refresh_token'];logger[_0xa652('0x18')](util['format']('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x39999b['name'],_0x39999b['id']));}else{logger[_0xa652('0x19')](util[_0xa652('0x1a')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x39999b['name'],_0x39999b['id']),util['inspect'](_0x1c700b,{'showHidden':![],'depth':null}));}return _0x203cb8(null,_0x3e9fdd);})[_0xa652('0x1b')](function(_0x2c76f7){logger[_0xa652('0x19')](util[_0xa652('0x1a')](_0xa652('0x1c'),_0x39999b['name'],_0x39999b['id']),util[_0xa652('0x1d')](parsedResult,{'showHidden':![],'depth':null}));return _0x203cb8(_0x2c76f7);});}else{return _0x203cb8(null,_0x3e9fdd);}},'beforeUpdate':function(_0xbda6b1,_0x36e580,_0x342582){if(_0xbda6b1[_0xa652('0x9')]('zone')||_0xbda6b1['changed'](_0xa652('0xb'))||_0xbda6b1[_0xa652('0x9')](_0xa652('0xc'))||_0xbda6b1[_0xa652('0x9')]('clientSecret')||_0xbda6b1[_0xa652('0x9')]('code')||_0xbda6b1[_0xa652('0x9')](_0xa652('0xe'))){var _0x3e24b2,_0x6faeaf;_0x3e24b2=_0xbda6b1[_0xa652('0xb')];var _0x232076=_0x3e24b2[_0xa652('0xf')](-0x1);if(_0x232076==='/'||_0x232076==='\x5c'||_0x232076===':'){_0x3e24b2=_0x3e24b2[_0xa652('0x1e')](0x0,_0x3e24b2[_0xa652('0x10')](_0x232076));}switch(_0xbda6b1[_0xa652('0xa')]){case'US':_0x6faeaf=_0xa652('0x11');break;case'AU':_0x6faeaf=_0xa652('0x12');break;case'IN':_0x6faeaf=_0xa652('0x13');break;case'CN':_0x6faeaf=_0xa652('0x1f');break;default:_0x6faeaf=_0xa652('0x20');break;}var _0x401cee={'method':'POST','uri':_0x6faeaf+_0xa652('0x14'),'form':{'grant_type':'authorization_code','client_id':_0xbda6b1['clientId'],'client_secret':_0xbda6b1[_0xa652('0xd')],'redirect_uri':_0xbda6b1[_0xa652('0xb')],'code':_0xbda6b1[_0xa652('0x21')]},'headers':{'Content-Type':_0xa652('0x22')}};return rp(_0x401cee)['then'](function(_0x2c9c7b){var _0x3832da=JSON[_0xa652('0x16')](_0x2c9c7b);if(_0x3832da[_0xa652('0x17')]){_0xbda6b1[_0xa652('0x23')]=_0x3832da['refresh_token'];logger[_0xa652('0x18')](util[_0xa652('0x1a')](_0xa652('0x24'),_0xbda6b1[_0xa652('0x25')],_0xbda6b1['id']));}else{logger[_0xa652('0x19')](util['format'](_0xa652('0x1c'),_0xbda6b1[_0xa652('0x25')],_0xbda6b1['id']),util[_0xa652('0x1d')](_0x3832da,{'showHidden':![],'depth':null}));}return _0x342582(null,_0x36e580);})[_0xa652('0x1b')](function(_0x30a1de){logger[_0xa652('0x19')](util[_0xa652('0x1a')](_0xa652('0x1c'),_0xbda6b1[_0xa652('0x25')],_0xbda6b1['id']),util[_0xa652('0x1d')](parsedResult,{'showHidden':![],'depth':null}));return _0x342582(_0x30a1de);});}else{return _0x342582(null,_0x36e580);}}}});}; \ No newline at end of file +var _0xe840=['moment','bluebird','request-promise','path','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','define','ZohoAccount','changed','clientSecret','code','slice','substring','lastIndexOf','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','/oauth/v2/token','authorization_code','clientId','serverUrl','then','parse','refresh_token','info','name','error','format','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','https://accounts.zoho.in','https://accounts.zoho.eu','POST','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','lodash','../../config/logger','api'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0xe840,0x1d1));var _0x0e84=function(_0x8f6c5,_0xfdc043){_0x8f6c5=_0x8f6c5-0x0;var _0x417de2=_0xe840[_0x8f6c5];return _0x417de2;};'use strict';var _=require(_0x0e84('0x0'));var util=require('util');var logger=require(_0x0e84('0x1'))(_0x0e84('0x2'));var moment=require(_0x0e84('0x3'));var BPromise=require(_0x0e84('0x4'));var rp=require(_0x0e84('0x5'));var fs=require('fs');var path=require(_0x0e84('0x6'));var rimraf=require('rimraf');var config=require(_0x0e84('0x7'));var attributes=require(_0x0e84('0x8'));var integrations=require(_0x0e84('0x9'));module['exports']=function(_0xca1e4a,_0x1340d0){return _0xca1e4a[_0x0e84('0xa')](_0x0e84('0xb'),attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0xf16ad5,_0x35bdf2,_0x325e25){if(_0xf16ad5[_0x0e84('0xc')]('zone')||_0xf16ad5[_0x0e84('0xc')]('serverUrl')||_0xf16ad5['changed']('clientId')||_0xf16ad5[_0x0e84('0xc')](_0x0e84('0xd'))||_0xf16ad5['changed'](_0x0e84('0xe'))||_0xf16ad5[_0x0e84('0xc')]('host')){var _0x7aa810,_0x22f33d;_0x7aa810=_0xf16ad5['serverUrl'];var _0x5d472c=_0x7aa810[_0x0e84('0xf')](-0x1);if(_0x5d472c==='/'||_0x5d472c==='\x5c'||_0x5d472c===':'){_0x7aa810=_0x7aa810[_0x0e84('0x10')](0x0,_0x7aa810[_0x0e84('0x11')](_0x5d472c));}switch(_0xf16ad5[_0x0e84('0x12')]){case'US':_0x22f33d=_0x0e84('0x13');break;case'AU':_0x22f33d=_0x0e84('0x14');break;case'IN':_0x22f33d='https://accounts.zoho.in';break;case'CN':_0x22f33d='https://accounts.zoho.com.cn';break;default:_0x22f33d='https://accounts.zoho.eu';break;}var _0x438b70={'method':'POST','uri':_0x22f33d+_0x0e84('0x15'),'form':{'grant_type':_0x0e84('0x16'),'client_id':_0xf16ad5[_0x0e84('0x17')],'client_secret':_0xf16ad5['clientSecret'],'redirect_uri':_0xf16ad5[_0x0e84('0x18')],'code':_0xf16ad5[_0x0e84('0xe')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x438b70)[_0x0e84('0x19')](function(_0x563fc2){var _0x3d1706=JSON[_0x0e84('0x1a')](_0x563fc2);if(_0x3d1706[_0x0e84('0x1b')]){_0xf16ad5['refreshToken']=_0x3d1706[_0x0e84('0x1b')];logger[_0x0e84('0x1c')](util['format']('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0xf16ad5[_0x0e84('0x1d')],_0xf16ad5['id']));}else{logger[_0x0e84('0x1e')](util[_0x0e84('0x1f')](_0x0e84('0x20'),_0xf16ad5['name'],_0xf16ad5['id']),util[_0x0e84('0x21')](_0x3d1706,{'showHidden':![],'depth':null}));}return _0x325e25(null,_0x35bdf2);})[_0x0e84('0x22')](function(_0x30d05e){logger[_0x0e84('0x1e')](util[_0x0e84('0x1f')](_0x0e84('0x20'),_0xf16ad5[_0x0e84('0x1d')],_0xf16ad5['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x325e25(_0x30d05e);});}else{return _0x325e25(null,_0x35bdf2);}},'beforeUpdate':function(_0x19a7a2,_0x4cf03e,_0x45cbc4){if(_0x19a7a2[_0x0e84('0xc')](_0x0e84('0x12'))||_0x19a7a2[_0x0e84('0xc')](_0x0e84('0x18'))||_0x19a7a2[_0x0e84('0xc')](_0x0e84('0x17'))||_0x19a7a2[_0x0e84('0xc')](_0x0e84('0xd'))||_0x19a7a2[_0x0e84('0xc')](_0x0e84('0xe'))||_0x19a7a2[_0x0e84('0xc')]('host')){var _0x2bd5f0,_0x568d69;_0x2bd5f0=_0x19a7a2[_0x0e84('0x18')];var _0x42fb73=_0x2bd5f0[_0x0e84('0xf')](-0x1);if(_0x42fb73==='/'||_0x42fb73==='\x5c'||_0x42fb73===':'){_0x2bd5f0=_0x2bd5f0['substring'](0x0,_0x2bd5f0[_0x0e84('0x11')](_0x42fb73));}switch(_0x19a7a2[_0x0e84('0x12')]){case'US':_0x568d69='https://accounts.zoho.com';break;case'AU':_0x568d69='https://accounts.zoho.com.au';break;case'IN':_0x568d69=_0x0e84('0x23');break;case'CN':_0x568d69='https://accounts.zoho.com.cn';break;default:_0x568d69=_0x0e84('0x24');break;}var _0x4daa3a={'method':_0x0e84('0x25'),'uri':_0x568d69+'/oauth/v2/token','form':{'grant_type':_0x0e84('0x16'),'client_id':_0x19a7a2[_0x0e84('0x17')],'client_secret':_0x19a7a2['clientSecret'],'redirect_uri':_0x19a7a2[_0x0e84('0x18')],'code':_0x19a7a2['code']},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x4daa3a)[_0x0e84('0x19')](function(_0x1c3cea){var _0x261877=JSON[_0x0e84('0x1a')](_0x1c3cea);if(_0x261877[_0x0e84('0x1b')]){_0x19a7a2['refreshToken']=_0x261877['refresh_token'];logger['info'](util['format'](_0x0e84('0x26'),_0x19a7a2[_0x0e84('0x1d')],_0x19a7a2['id']));}else{logger[_0x0e84('0x1e')](util[_0x0e84('0x1f')](_0x0e84('0x20'),_0x19a7a2['name'],_0x19a7a2['id']),util[_0x0e84('0x21')](_0x261877,{'showHidden':![],'depth':null}));}return _0x45cbc4(null,_0x4cf03e);})['catch'](function(_0x5b0fd6){logger[_0x0e84('0x1e')](util[_0x0e84('0x1f')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x19a7a2[_0x0e84('0x1d')],_0x19a7a2['id']),util[_0x0e84('0x21')](parsedResult,{'showHidden':![],'depth':null}));return _0x45cbc4(_0x5b0fd6);});}else{return _0x45cbc4(null,_0x4cf03e);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 98fa429..d25b049 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 _0x45c2=['find','where','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','GetZohoAccount','ZohoAccount','options','raw','attributes','map','include','model','debug','catch','ShowZohoAccount'];(function(_0x26975b,_0x82dc1e){var _0x4718bc=function(_0x3db672){while(--_0x3db672){_0x26975b['push'](_0x26975b['shift']());}};_0x4718bc(++_0x82dc1e);}(_0x45c2,0x68));var _0x245c=function(_0x13f0a2,_0x1b3623){_0x13f0a2=_0x13f0a2-0x0;var _0x4cd0b4=_0x45c2[_0x13f0a2];return _0x4cd0b4;};'use strict';var _=require(_0x245c('0x0'));var util=require(_0x245c('0x1'));var moment=require(_0x245c('0x2'));var BPromise=require(_0x245c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x245c('0x4'));var db=require(_0x245c('0x5'))['db'];var utils=require(_0x245c('0x6'));var logger=require('../../config/logger')(_0x245c('0x7'));var config=require(_0x245c('0x8'));var jayson=require(_0x245c('0x9'));var client=jayson[_0x245c('0xa')][_0x245c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2e1860,_0x20a6d7,_0x10da3e){return new BPromise(function(_0x20c72d,_0x40eab8){return client[_0x245c('0xc')](_0x2e1860,_0x10da3e)[_0x245c('0xd')](function(_0x558ef3){logger[_0x245c('0xe')](_0x245c('0xf'),_0x20a6d7,_0x245c('0x10'));logger['debug']('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x20a6d7,_0x245c('0x10'),JSON[_0x245c('0x11')](_0x558ef3));if(_0x558ef3['error']){if(_0x558ef3[_0x245c('0x12')]['code']===0x1f4){logger[_0x245c('0x12')](_0x245c('0xf'),_0x20a6d7,_0x558ef3[_0x245c('0x12')][_0x245c('0x13')]);return _0x40eab8(_0x558ef3[_0x245c('0x12')]['message']);}logger[_0x245c('0x12')](_0x245c('0xf'),_0x20a6d7,_0x558ef3[_0x245c('0x12')][_0x245c('0x13')]);return _0x20c72d(_0x558ef3['error'][_0x245c('0x13')]);}else{logger['info'](_0x245c('0xf'),_0x20a6d7,_0x245c('0x10'));_0x20c72d(_0x558ef3[_0x245c('0x14')][_0x245c('0x13')]);}})['catch'](function(_0x124e02){logger[_0x245c('0x12')](_0x245c('0xf'),_0x20a6d7,_0x124e02);_0x40eab8(_0x124e02);});});}exports[_0x245c('0x15')]=function(_0xee10c3){var _0x246d45=this;return new Promise(function(_0x5686a5,_0x3ebb6d){return db[_0x245c('0x16')]['findAll']({'raw':_0xee10c3[_0x245c('0x17')]?_0xee10c3[_0x245c('0x17')][_0x245c('0x18')]===undefined?!![]:![]:!![],'where':_0xee10c3[_0x245c('0x17')]?_0xee10c3['options']['where']||null:null,'attributes':_0xee10c3[_0x245c('0x17')]?_0xee10c3['options'][_0x245c('0x19')]||null:null,'limit':_0xee10c3[_0x245c('0x17')]?_0xee10c3[_0x245c('0x17')]['limit']||null:null,'include':_0xee10c3[_0x245c('0x17')]?_0xee10c3['options']['include']?_[_0x245c('0x1a')](_0xee10c3[_0x245c('0x17')][_0x245c('0x1b')],function(_0x177bca){return{'model':db[_0x177bca[_0x245c('0x1c')]],'as':_0x177bca['as'],'attributes':_0x177bca[_0x245c('0x19')],'include':_0x177bca['include']?_['map'](_0x177bca['include'],function(_0x51d0fc){return{'model':db[_0x51d0fc[_0x245c('0x1c')]],'as':_0x51d0fc['as'],'attributes':_0x51d0fc[_0x245c('0x19')],'include':_0x51d0fc[_0x245c('0x1b')]?_['map'](_0x51d0fc['include'],function(_0x2d3817){return{'model':db[_0x2d3817[_0x245c('0x1c')]],'as':_0x2d3817['as'],'attributes':_0x2d3817[_0x245c('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x24f80b){logger[_0x245c('0xe')](_0x245c('0x15'),_0xee10c3);logger[_0x245c('0x1d')]('GetZohoAccount',_0xee10c3,JSON[_0x245c('0x11')](_0x24f80b));_0x5686a5(_0x24f80b);})[_0x245c('0x1e')](function(_0x49a766){logger['error'](_0x245c('0x15'),_0x49a766[_0x245c('0x13')],_0xee10c3);_0x3ebb6d(_0x246d45[_0x245c('0x12')](0x1f4,_0x49a766[_0x245c('0x13')]));});});};exports[_0x245c('0x1f')]=function(_0x48a215){var _0x3676fe=this;return new Promise(function(_0x5e31b4,_0x4666fb){return db['ZohoAccount'][_0x245c('0x20')]({'raw':_0x48a215[_0x245c('0x17')]?_0x48a215[_0x245c('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x48a215[_0x245c('0x17')]?_0x48a215[_0x245c('0x17')][_0x245c('0x21')]||null:null,'attributes':_0x48a215[_0x245c('0x17')]?_0x48a215['options'][_0x245c('0x19')]||null:null,'include':_0x48a215[_0x245c('0x17')]?_0x48a215[_0x245c('0x17')][_0x245c('0x1b')]?_['map'](_0x48a215['options']['include'],function(_0x33044a){return{'model':db[_0x33044a['model']],'as':_0x33044a['as'],'attributes':_0x33044a['attributes'],'include':_0x33044a[_0x245c('0x1b')]?_[_0x245c('0x1a')](_0x33044a['include'],function(_0x358b4b){return{'model':db[_0x358b4b[_0x245c('0x1c')]],'as':_0x358b4b['as'],'attributes':_0x358b4b[_0x245c('0x19')],'include':_0x358b4b[_0x245c('0x1b')]?_[_0x245c('0x1a')](_0x358b4b[_0x245c('0x1b')],function(_0x1a429c){return{'model':db[_0x1a429c[_0x245c('0x1c')]],'as':_0x1a429c['as'],'attributes':_0x1a429c[_0x245c('0x19')]};}):[]};}):[]};}):[]:[]})[_0x245c('0xd')](function(_0x4b722d){logger[_0x245c('0xe')](_0x245c('0x1f'),_0x48a215);logger['debug']('ShowZohoAccount',_0x48a215,JSON[_0x245c('0x11')](_0x4b722d));_0x5e31b4(_0x4b722d);})['catch'](function(_0x534677){logger[_0x245c('0x12')](_0x245c('0x1f'),_0x534677[_0x245c('0x13')],_0x48a215);_0x4666fb(_0x3676fe[_0x245c('0x12')](0x1f4,_0x534677[_0x245c('0x13')]));});});}; \ No newline at end of file +var _0x34f0=['code','message','ZohoAccount,\x20%s,\x20%s','result','ZohoAccount','options','raw','attributes','limit','map','include','model','then','info','GetZohoAccount','catch','find','ShowZohoAccount','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x218808,_0x689fba){var _0x2ae3ce=function(_0x3b2f0b){while(--_0x3b2f0b){_0x218808['push'](_0x218808['shift']());}};_0x2ae3ce(++_0x689fba);}(_0x34f0,0x13b));var _0x034f=function(_0x1f3cda,_0x46c36c){_0x1f3cda=_0x1f3cda-0x0;var _0x123a03=_0x34f0[_0x1f3cda];return _0x123a03;};'use strict';var _=require(_0x034f('0x0'));var util=require(_0x034f('0x1'));var moment=require('moment');var BPromise=require(_0x034f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x034f('0x3'));var db=require(_0x034f('0x4'))['db'];var utils=require(_0x034f('0x5'));var logger=require(_0x034f('0x6'))(_0x034f('0x7'));var config=require('../../config/environment');var jayson=require(_0x034f('0x8'));var client=jayson[_0x034f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x18f23b,_0x4d03a0,_0x3994a0){return new BPromise(function(_0xcb64e8,_0x32e7ff){return client['request'](_0x18f23b,_0x3994a0)['then'](function(_0x44e85e){logger['info']('ZohoAccount,\x20%s,\x20%s',_0x4d03a0,_0x034f('0xa'));logger[_0x034f('0xb')](_0x034f('0xc'),_0x4d03a0,_0x034f('0xa'),JSON[_0x034f('0xd')](_0x44e85e));if(_0x44e85e['error']){if(_0x44e85e[_0x034f('0xe')][_0x034f('0xf')]===0x1f4){logger[_0x034f('0xe')]('ZohoAccount,\x20%s,\x20%s',_0x4d03a0,_0x44e85e[_0x034f('0xe')]['message']);return _0x32e7ff(_0x44e85e[_0x034f('0xe')][_0x034f('0x10')]);}logger[_0x034f('0xe')](_0x034f('0x11'),_0x4d03a0,_0x44e85e[_0x034f('0xe')][_0x034f('0x10')]);return _0xcb64e8(_0x44e85e[_0x034f('0xe')][_0x034f('0x10')]);}else{logger['info']('ZohoAccount,\x20%s,\x20%s',_0x4d03a0,_0x034f('0xa'));_0xcb64e8(_0x44e85e[_0x034f('0x12')][_0x034f('0x10')]);}})['catch'](function(_0x48cfb2){logger[_0x034f('0xe')](_0x034f('0x11'),_0x4d03a0,_0x48cfb2);_0x32e7ff(_0x48cfb2);});});}exports['GetZohoAccount']=function(_0xbf8794){var _0x58147d=this;return new Promise(function(_0x8500cb,_0x2b57d0){return db[_0x034f('0x13')]['findAll']({'raw':_0xbf8794[_0x034f('0x14')]?_0xbf8794[_0x034f('0x14')][_0x034f('0x15')]===undefined?!![]:![]:!![],'where':_0xbf8794[_0x034f('0x14')]?_0xbf8794[_0x034f('0x14')]['where']||null:null,'attributes':_0xbf8794[_0x034f('0x14')]?_0xbf8794[_0x034f('0x14')][_0x034f('0x16')]||null:null,'limit':_0xbf8794['options']?_0xbf8794[_0x034f('0x14')][_0x034f('0x17')]||null:null,'include':_0xbf8794[_0x034f('0x14')]?_0xbf8794['options']['include']?_[_0x034f('0x18')](_0xbf8794['options'][_0x034f('0x19')],function(_0x1fd774){return{'model':db[_0x1fd774[_0x034f('0x1a')]],'as':_0x1fd774['as'],'attributes':_0x1fd774[_0x034f('0x16')],'include':_0x1fd774[_0x034f('0x19')]?_[_0x034f('0x18')](_0x1fd774['include'],function(_0x880c16){return{'model':db[_0x880c16[_0x034f('0x1a')]],'as':_0x880c16['as'],'attributes':_0x880c16[_0x034f('0x16')],'include':_0x880c16[_0x034f('0x19')]?_['map'](_0x880c16[_0x034f('0x19')],function(_0x8eacf2){return{'model':db[_0x8eacf2[_0x034f('0x1a')]],'as':_0x8eacf2['as'],'attributes':_0x8eacf2['attributes']};}):[]};}):[]};}):[]:[]})[_0x034f('0x1b')](function(_0x12d945){logger[_0x034f('0x1c')](_0x034f('0x1d'),_0xbf8794);logger[_0x034f('0xb')](_0x034f('0x1d'),_0xbf8794,JSON[_0x034f('0xd')](_0x12d945));_0x8500cb(_0x12d945);})[_0x034f('0x1e')](function(_0xebc249){logger[_0x034f('0xe')](_0x034f('0x1d'),_0xebc249['message'],_0xbf8794);_0x2b57d0(_0x58147d['error'](0x1f4,_0xebc249[_0x034f('0x10')]));});});};exports['ShowZohoAccount']=function(_0x544854){var _0x5ea15a=this;return new Promise(function(_0x513827,_0x5b0a12){return db['ZohoAccount'][_0x034f('0x1f')]({'raw':_0x544854['options']?_0x544854[_0x034f('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x544854[_0x034f('0x14')]?_0x544854['options']['where']||null:null,'attributes':_0x544854['options']?_0x544854[_0x034f('0x14')][_0x034f('0x16')]||null:null,'include':_0x544854[_0x034f('0x14')]?_0x544854['options'][_0x034f('0x19')]?_['map'](_0x544854['options'][_0x034f('0x19')],function(_0x3a9fc3){return{'model':db[_0x3a9fc3[_0x034f('0x1a')]],'as':_0x3a9fc3['as'],'attributes':_0x3a9fc3[_0x034f('0x16')],'include':_0x3a9fc3[_0x034f('0x19')]?_[_0x034f('0x18')](_0x3a9fc3[_0x034f('0x19')],function(_0x19d69d){return{'model':db[_0x19d69d[_0x034f('0x1a')]],'as':_0x19d69d['as'],'attributes':_0x19d69d[_0x034f('0x16')],'include':_0x19d69d[_0x034f('0x19')]?_[_0x034f('0x18')](_0x19d69d[_0x034f('0x19')],function(_0x1e0bc9){return{'model':db[_0x1e0bc9[_0x034f('0x1a')]],'as':_0x1e0bc9['as'],'attributes':_0x1e0bc9['attributes']};}):[]};}):[]};}):[]:[]})[_0x034f('0x1b')](function(_0x20e082){logger[_0x034f('0x1c')](_0x034f('0x20'),_0x544854);logger['debug'](_0x034f('0x20'),_0x544854,JSON[_0x034f('0xd')](_0x20e082));_0x513827(_0x20e082);})[_0x034f('0x1e')](function(_0x1f149e){logger[_0x034f('0xe')](_0x034f('0x20'),_0x1f149e[_0x034f('0x10')],_0x544854);_0x5b0a12(_0x5ea15a[_0x034f('0xe')](0x1f4,_0x1f149e[_0x034f('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 8188924..b3f640f 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 _0x4975=['getSubjects','/:id/descriptions','getDescriptions','create','/:id','update','delete','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','./intZohoConfiguration.controller','isAuthenticated','get','show','getFields','/:id/subjects'];(function(_0x4741bb,_0x6ad630){var _0xe539a6=function(_0x5bc42c){while(--_0x5bc42c){_0x4741bb['push'](_0x4741bb['shift']());}};_0xe539a6(++_0x6ad630);}(_0x4975,0x9b));var _0x5497=function(_0x49c074,_0xe3883a){_0x49c074=_0x49c074-0x0;var _0x562761=_0x4975[_0x49c074];return _0x562761;};'use strict';var multer=require(_0x5497('0x0'));var util=require(_0x5497('0x1'));var path=require(_0x5497('0x2'));var timeout=require('connect-timeout');var express=require(_0x5497('0x3'));var router=express['Router']();var fs_extra=require(_0x5497('0x4'));var auth=require(_0x5497('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5497('0x6'));var controller=require(_0x5497('0x7'));router['get']('/',auth[_0x5497('0x8')](),controller['index']);router[_0x5497('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x5497('0xa')]);router[_0x5497('0x9')]('/:id/fields',auth['isAuthenticated'](),controller[_0x5497('0xb')]);router[_0x5497('0x9')](_0x5497('0xc'),auth[_0x5497('0x8')](),controller[_0x5497('0xd')]);router[_0x5497('0x9')](_0x5497('0xe'),auth[_0x5497('0x8')](),controller[_0x5497('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x5497('0x10')]);router['put'](_0x5497('0x11'),auth[_0x5497('0x8')](),controller[_0x5497('0x12')]);router[_0x5497('0x13')](_0x5497('0x11'),auth[_0x5497('0x8')](),controller['destroy']);module[_0x5497('0x14')]=router; \ No newline at end of file +var _0x8b30=['isAuthenticated','/:id/fields','getFields','getSubjects','getDescriptions','post','create','put','update','/:id','exports','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get'];(function(_0x4b352f,_0x2c3ac1){var _0xb78495=function(_0x1d47df){while(--_0x1d47df){_0x4b352f['push'](_0x4b352f['shift']());}};_0xb78495(++_0x2c3ac1);}(_0x8b30,0x14b));var _0x08b3=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x8b30[_0x4243a3];return _0x1b2a33;};'use strict';var multer=require(_0x08b3('0x0'));var util=require(_0x08b3('0x1'));var path=require(_0x08b3('0x2'));var timeout=require(_0x08b3('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x08b3('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x08b3('0x5'));var config=require(_0x08b3('0x6'));var controller=require(_0x08b3('0x7'));router[_0x08b3('0x8')]('/',auth[_0x08b3('0x9')](),controller['index']);router[_0x08b3('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0x08b3('0xa'),auth[_0x08b3('0x9')](),controller[_0x08b3('0xb')]);router[_0x08b3('0x8')]('/:id/subjects',auth[_0x08b3('0x9')](),controller[_0x08b3('0xc')]);router[_0x08b3('0x8')]('/:id/descriptions',auth[_0x08b3('0x9')](),controller[_0x08b3('0xd')]);router[_0x08b3('0xe')]('/',auth[_0x08b3('0x9')](),controller[_0x08b3('0xf')]);router[_0x08b3('0x10')]('/:id',auth[_0x08b3('0x9')](),controller[_0x08b3('0x11')]);router['delete'](_0x08b3('0x12'),auth['isAuthenticated'](),controller['destroy']);module[_0x08b3('0x13')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 78e0234..3d346c0 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 _0x405f=['contact_lead','exports','STRING','ENUM','lead','contact','nothing'];(function(_0x486f24,_0x329726){var _0x52febc=function(_0x33c1e5){while(--_0x33c1e5){_0x486f24['push'](_0x486f24['shift']());}};_0x52febc(++_0x329726);}(_0x405f,0x127));var _0xf405=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x405f[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require('sequelize');module[_0xf405('0x0')]={'name':{'type':Sequelize[_0xf405('0x1')]},'moduleCreate':{'type':Sequelize[_0xf405('0x2')](_0xf405('0x3'),_0xf405('0x4'),_0xf405('0x5')),'defaultValue':_0xf405('0x3')},'moduleSearch':{'type':Sequelize[_0xf405('0x2')](_0xf405('0x6'),'contact','lead'),'defaultValue':_0xf405('0x6')},'description':{'type':Sequelize[_0xf405('0x1')]}}; \ No newline at end of file +var _0xbadb=['sequelize','exports','STRING','ENUM','contact','contact_lead','lead'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbadb,0x1e3));var _0xbbad=function(_0x31d0f7,_0x478c8e){_0x31d0f7=_0x31d0f7-0x0;var _0x52f92c=_0xbadb[_0x31d0f7];return _0x52f92c;};'use strict';var Sequelize=require(_0xbbad('0x0'));module[_0xbbad('0x1')]={'name':{'type':Sequelize[_0xbbad('0x2')]},'moduleCreate':{'type':Sequelize[_0xbbad('0x3')]('lead',_0xbbad('0x4'),'nothing'),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize[_0xbbad('0x3')](_0xbbad('0x5'),_0xbbad('0x4'),_0xbbad('0x6')),'defaultValue':_0xbbad('0x5')},'description':{'type':Sequelize[_0xbbad('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 2725338..7b9863c 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 _0x571d=['attributes','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','ZohoConfiguration','includeAll','findAll','rows','show','params','keys','length','find','create','body','catch','getFields','ZohoField','options','getSubjects','findOne','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','filters','intersection','fields'];(function(_0x1874ec,_0x58ae96){var _0x163f52=function(_0x3ce427){while(--_0x3ce427){_0x1874ec['push'](_0x1874ec['shift']());}};_0x163f52(++_0x58ae96);}(_0x571d,0x1b7));var _0xd571=function(_0x378ee2,_0x293513){_0x378ee2=_0x378ee2-0x0;var _0x2696f4=_0x571d[_0x378ee2];return _0x2696f4;};'use strict';var emlformat=require(_0xd571('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd571('0x1'));var jsonpatch=require(_0xd571('0x2'));var rp=require(_0xd571('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd571('0x4'));var util=require(_0xd571('0x5'));var path=require(_0xd571('0x6'));var sox=require(_0xd571('0x7'));var csv=require(_0xd571('0x8'));var ejs=require(_0xd571('0x9'));var fs=require('fs');var fs_extra=require(_0xd571('0xa'));var _=require(_0xd571('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd571('0xc'));var deskjs=require(_0xd571('0xd'));var toCsv=require(_0xd571('0x8'));var querystring=require(_0xd571('0xe'));var Papa=require(_0xd571('0xf'));var Redis=require(_0xd571('0x10'));var authService=require(_0xd571('0x11'));var qs=require(_0xd571('0x12'));var as=require(_0xd571('0x13'));var hardwareService=require(_0xd571('0x14'));var logger=require('../../config/logger')(_0xd571('0x15'));var utils=require(_0xd571('0x16'));var config=require(_0xd571('0x17'));var licenseUtil=require(_0xd571('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2fc37e,_0x177bf2){_0x177bf2=_0x177bf2||0xcc;return function(_0x503032){if(_0x503032){return _0x2fc37e['sendStatus'](_0x177bf2);}return _0x2fc37e[_0xd571('0x19')](_0x177bf2)[_0xd571('0x1a')]();};}function respondWithResult(_0x24f824,_0x49c85d){_0x49c85d=_0x49c85d||0xc8;return function(_0x4440ab){if(_0x4440ab){return _0x24f824['status'](_0x49c85d)[_0xd571('0x1b')](_0x4440ab);}};}function respondWithFilteredResult(_0x5a8901,_0x5a92db){return function(_0x3e2887){if(_0x3e2887){var _0x33f9e6=typeof _0x5a92db[_0xd571('0x1c')]===_0xd571('0x1d')&&typeof _0x5a92db['limit']===_0xd571('0x1d');var _0x4839e6=_0x3e2887[_0xd571('0x1e')];var _0x41b278=_0x33f9e6?0x0:_0x5a92db[_0xd571('0x1c')];var _0x25d962=_0x33f9e6?_0x3e2887['count']:_0x5a92db[_0xd571('0x1c')]+_0x5a92db['limit'];var _0xe4838a;if(_0x25d962>=_0x4839e6){_0x25d962=_0x4839e6;_0xe4838a=0xc8;}else{_0xe4838a=0xce;}_0x5a8901['status'](_0xe4838a);return _0x5a8901[_0xd571('0x1f')](_0xd571('0x20'),_0x41b278+'-'+_0x25d962+'/'+_0x4839e6)['json'](_0x3e2887);}return null;};}function patchUpdates(_0x68d7a2){return function(_0x2c49ea){try{jsonpatch[_0xd571('0x21')](_0x2c49ea,_0x68d7a2,!![]);}catch(_0x874296){return BPromise['reject'](_0x874296);}return _0x2c49ea[_0xd571('0x22')]();};}function saveUpdates(_0x1b604f,_0x1b937a){return function(_0x22f639){if(_0x22f639){return _0x22f639[_0xd571('0x23')](_0x1b604f)[_0xd571('0x24')](function(_0x567d0){return _0x567d0;});}return null;};}function removeEntity(_0x262702,_0x40e083){return function(_0x4a94a4){if(_0x4a94a4){return _0x4a94a4[_0xd571('0x25')]()['then'](function(){_0x262702['status'](0xcc)[_0xd571('0x1a')]();});}};}function handleEntityNotFound(_0x6b7544,_0x270d2f){return function(_0x1c24b3){if(!_0x1c24b3){_0x6b7544[_0xd571('0x26')](0x194);}return _0x1c24b3;};}function handleError(_0x10fbbc,_0x4d0b90){_0x4d0b90=_0x4d0b90||0x1f4;return function(_0x187192){logger[_0xd571('0x27')](_0x187192[_0xd571('0x28')]);if(_0x187192['name']){delete _0x187192[_0xd571('0x29')];}_0x10fbbc['status'](_0x4d0b90)[_0xd571('0x2a')](_0x187192);};}exports[_0xd571('0x2b')]=function(_0x8d6638,_0xc7ad95){var _0x8948e2={},_0x5a1d26={},_0x34227f={'count':0x0,'rows':[]};var _0x5791b4=_[_0xd571('0x2c')](db['ZohoConfiguration'][_0xd571('0x2d')],function(_0xe4b6ba){return{'name':_0xe4b6ba[_0xd571('0x2e')],'type':_0xe4b6ba[_0xd571('0x2f')]['key']};});_0x5a1d26[_0xd571('0x30')]=_['map'](_0x5791b4,_0xd571('0x29'));_0x5a1d26['query']=_['keys'](_0x8d6638[_0xd571('0x31')]);_0x5a1d26[_0xd571('0x32')]=_['intersection'](_0x5a1d26['model'],_0x5a1d26[_0xd571('0x31')]);_0x8948e2['attributes']=_[_0xd571('0x33')](_0x5a1d26[_0xd571('0x30')],qs[_0xd571('0x34')](_0x8d6638['query'][_0xd571('0x34')]));_0x8948e2['attributes']=_0x8948e2['attributes']['length']?_0x8948e2[_0xd571('0x35')]:_0x5a1d26['model'];if(!_0x8d6638[_0xd571('0x31')][_0xd571('0x36')](_0xd571('0x37'))){_0x8948e2[_0xd571('0x38')]=qs[_0xd571('0x38')](_0x8d6638[_0xd571('0x31')][_0xd571('0x38')]);_0x8948e2['offset']=qs[_0xd571('0x1c')](_0x8d6638['query'][_0xd571('0x1c')]);}_0x8948e2[_0xd571('0x39')]=qs[_0xd571('0x3a')](_0x8d6638[_0xd571('0x31')][_0xd571('0x3a')]);_0x8948e2['where']=qs['filters'](_[_0xd571('0x3b')](_0x8d6638[_0xd571('0x31')],_0x5a1d26[_0xd571('0x32')]),_0x5791b4);if(_0x8d6638[_0xd571('0x31')][_0xd571('0x3c')]){_0x8948e2[_0xd571('0x3d')]=_[_0xd571('0x3e')](_0x8948e2[_0xd571('0x3d')],{'$or':_['map'](_0x5791b4,function(_0x385763){if(_0x385763['type']!==_0xd571('0x3f')){var _0x3c20a1={};_0x3c20a1[_0x385763['name']]={'$like':'%'+_0x8d6638[_0xd571('0x31')]['filter']+'%'};return _0x3c20a1;}})});}_0x8948e2=_[_0xd571('0x3e')]({},_0x8948e2,_0x8d6638['options']);var _0x5118e9={'where':_0x8948e2[_0xd571('0x3d')]};return db[_0xd571('0x40')][_0xd571('0x1e')](_0x5118e9)[_0xd571('0x24')](function(_0x1aaf47){_0x34227f['count']=_0x1aaf47;if(_0x8d6638[_0xd571('0x31')][_0xd571('0x41')]){_0x8948e2['include']=[{'all':!![]}];}return db['ZohoConfiguration'][_0xd571('0x42')](_0x8948e2);})['then'](function(_0x101e54){_0x34227f[_0xd571('0x43')]=_0x101e54;return _0x34227f;})[_0xd571('0x24')](respondWithFilteredResult(_0xc7ad95,_0x8948e2))['catch'](handleError(_0xc7ad95,null));};exports[_0xd571('0x44')]=function(_0x547610,_0x580c12){var _0x354529={'raw':![],'where':{'id':_0x547610[_0xd571('0x45')]['id']}},_0x31de37={};_0x31de37[_0xd571('0x30')]=_['keys'](db[_0xd571('0x40')][_0xd571('0x2d')]);_0x31de37['query']=_[_0xd571('0x46')](_0x547610[_0xd571('0x31')]);_0x31de37[_0xd571('0x32')]=_[_0xd571('0x33')](_0x31de37[_0xd571('0x30')],_0x31de37[_0xd571('0x31')]);_0x354529[_0xd571('0x35')]=_['intersection'](_0x31de37[_0xd571('0x30')],qs['fields'](_0x547610[_0xd571('0x31')][_0xd571('0x34')]));_0x354529[_0xd571('0x35')]=_0x354529[_0xd571('0x35')][_0xd571('0x47')]?_0x354529[_0xd571('0x35')]:_0x31de37['model'];if(_0x547610[_0xd571('0x31')]['includeAll']){_0x354529['include']=[{'all':!![]}];}_0x354529=_[_0xd571('0x3e')]({},_0x354529,_0x547610['options']);return db[_0xd571('0x40')][_0xd571('0x48')](_0x354529)[_0xd571('0x24')](handleEntityNotFound(_0x580c12,null))[_0xd571('0x24')](respondWithResult(_0x580c12,null))['catch'](handleError(_0x580c12,null));};exports[_0xd571('0x49')]=function(_0x1f485d,_0x3fb81e){return db[_0xd571('0x40')][_0xd571('0x49')](_0x1f485d[_0xd571('0x4a')],{})[_0xd571('0x24')](respondWithResult(_0x3fb81e,0xc9))[_0xd571('0x4b')](handleError(_0x3fb81e,null));};exports[_0xd571('0x23')]=function(_0x1bc70b,_0x5b5dbb){if(_0x1bc70b[_0xd571('0x4a')]['id']){delete _0x1bc70b['body']['id'];}return db[_0xd571('0x40')][_0xd571('0x48')]({'where':{'id':_0x1bc70b[_0xd571('0x45')]['id']}})[_0xd571('0x24')](handleEntityNotFound(_0x5b5dbb,null))[_0xd571('0x24')](saveUpdates(_0x1bc70b[_0xd571('0x4a')],null))[_0xd571('0x24')](respondWithResult(_0x5b5dbb,null))[_0xd571('0x4b')](handleError(_0x5b5dbb,null));};exports['destroy']=function(_0x2c873d,_0x2b1369){return db[_0xd571('0x40')][_0xd571('0x48')]({'where':{'id':_0x2c873d[_0xd571('0x45')]['id']}})[_0xd571('0x24')](handleEntityNotFound(_0x2b1369,null))[_0xd571('0x24')](removeEntity(_0x2b1369,null))['catch'](handleError(_0x2b1369,null));};exports[_0xd571('0x4c')]=function(_0x375f31,_0x58d3c1,_0x99264e){var _0x1a06bf={};var _0x1435a1={};var _0x12b0ca;var _0x3baa64;return db['ZohoConfiguration']['findOne']({'where':{'id':_0x375f31[_0xd571('0x45')]['id']}})[_0xd571('0x24')](handleEntityNotFound(_0x58d3c1,null))['then'](function(_0x25ec97){if(_0x25ec97){_0x12b0ca=_0x25ec97;_0x1435a1[_0xd571('0x30')]=_['keys'](db[_0xd571('0x4d')][_0xd571('0x2d')]);_0x1435a1[_0xd571('0x31')]=_['keys'](_0x375f31['query']);_0x1435a1['filters']=_[_0xd571('0x33')](_0x1435a1[_0xd571('0x30')],_0x1435a1[_0xd571('0x31')]);_0x1a06bf['attributes']=_[_0xd571('0x33')](_0x1435a1[_0xd571('0x30')],qs[_0xd571('0x34')](_0x375f31['query'][_0xd571('0x34')]));_0x1a06bf[_0xd571('0x35')]=_0x1a06bf[_0xd571('0x35')][_0xd571('0x47')]?_0x1a06bf[_0xd571('0x35')]:_0x1435a1[_0xd571('0x30')];_0x1a06bf['order']=qs[_0xd571('0x3a')](_0x375f31[_0xd571('0x31')][_0xd571('0x3a')]);_0x1a06bf[_0xd571('0x3d')]=qs[_0xd571('0x32')](_['pick'](_0x375f31[_0xd571('0x31')],_0x1435a1[_0xd571('0x32')]));if(_0x375f31[_0xd571('0x31')][_0xd571('0x3c')]){_0x1a06bf['where']=_[_0xd571('0x3e')](_0x1a06bf['where'],{'$or':_[_0xd571('0x2c')](_0x1a06bf['attributes'],function(_0x2fbb04){var _0x4452f0={};_0x4452f0[_0x2fbb04]={'$like':'%'+_0x375f31[_0xd571('0x31')][_0xd571('0x3c')]+'%'};return _0x4452f0;})});}_0x1a06bf=_['merge']({},_0x1a06bf,_0x375f31[_0xd571('0x4e')]);return _0x12b0ca[_0xd571('0x4c')](_0x1a06bf);}})['then'](function(_0x3033ee){if(_0x3033ee){_0x3baa64=_0x3033ee['length'];if(!_0x375f31[_0xd571('0x31')]['hasOwnProperty']('nolimit')){_0x1a06bf[_0xd571('0x38')]=qs[_0xd571('0x38')](_0x375f31[_0xd571('0x31')][_0xd571('0x38')]);_0x1a06bf[_0xd571('0x1c')]=qs['offset'](_0x375f31[_0xd571('0x31')][_0xd571('0x1c')]);}return _0x12b0ca['getFields'](_0x1a06bf);}})[_0xd571('0x24')](function(_0x101894){if(_0x101894){return _0x101894?{'count':_0x3baa64,'rows':_0x101894}:null;}})[_0xd571('0x24')](respondWithResult(_0x58d3c1,null))['catch'](handleError(_0x58d3c1,null));};exports[_0xd571('0x4f')]=function(_0x25a6e7,_0x256d35,_0x401c82){var _0x333a22={};var _0x55689e={};var _0x145a42;var _0xa57864;return db[_0xd571('0x40')][_0xd571('0x50')]({'where':{'id':_0x25a6e7[_0xd571('0x45')]['id']}})[_0xd571('0x24')](handleEntityNotFound(_0x256d35,null))[_0xd571('0x24')](function(_0x777c3a){if(_0x777c3a){_0x145a42=_0x777c3a;_0x55689e['model']=_[_0xd571('0x46')](db[_0xd571('0x4d')][_0xd571('0x2d')]);_0x55689e['query']=_[_0xd571('0x46')](_0x25a6e7[_0xd571('0x31')]);_0x55689e['filters']=_[_0xd571('0x33')](_0x55689e[_0xd571('0x30')],_0x55689e[_0xd571('0x31')]);_0x333a22['attributes']=_[_0xd571('0x33')](_0x55689e[_0xd571('0x30')],qs[_0xd571('0x34')](_0x25a6e7['query'][_0xd571('0x34')]));_0x333a22[_0xd571('0x35')]=_0x333a22[_0xd571('0x35')][_0xd571('0x47')]?_0x333a22[_0xd571('0x35')]:_0x55689e[_0xd571('0x30')];_0x333a22[_0xd571('0x39')]=qs[_0xd571('0x3a')](_0x25a6e7[_0xd571('0x31')][_0xd571('0x3a')]);_0x333a22[_0xd571('0x3d')]=qs[_0xd571('0x32')](_[_0xd571('0x3b')](_0x25a6e7[_0xd571('0x31')],_0x55689e[_0xd571('0x32')]));if(_0x25a6e7[_0xd571('0x31')][_0xd571('0x3c')]){_0x333a22[_0xd571('0x3d')]=_[_0xd571('0x3e')](_0x333a22[_0xd571('0x3d')],{'$or':_[_0xd571('0x2c')](_0x333a22['attributes'],function(_0x7c0aaa){var _0x3373d6={};_0x3373d6[_0x7c0aaa]={'$like':'%'+_0x25a6e7[_0xd571('0x31')][_0xd571('0x3c')]+'%'};return _0x3373d6;})});}_0x333a22=_[_0xd571('0x3e')]({},_0x333a22,_0x25a6e7[_0xd571('0x4e')]);return _0x145a42[_0xd571('0x4f')](_0x333a22);}})[_0xd571('0x24')](function(_0x30b6c1){if(_0x30b6c1){_0xa57864=_0x30b6c1[_0xd571('0x47')];if(!_0x25a6e7['query'][_0xd571('0x36')](_0xd571('0x37'))){_0x333a22[_0xd571('0x38')]=qs[_0xd571('0x38')](_0x25a6e7['query']['limit']);_0x333a22['offset']=qs[_0xd571('0x1c')](_0x25a6e7[_0xd571('0x31')][_0xd571('0x1c')]);}return _0x145a42[_0xd571('0x4f')](_0x333a22);}})['then'](function(_0xe9c9e0){if(_0xe9c9e0){return _0xe9c9e0?{'count':_0xa57864,'rows':_0xe9c9e0}:null;}})[_0xd571('0x24')](respondWithResult(_0x256d35,null))['catch'](handleError(_0x256d35,null));};exports[_0xd571('0x51')]=function(_0x4a6311,_0x44b093,_0x2ecec2){var _0x301856={};var _0xc84787={};var _0xae8a2c;var _0x946545;return db[_0xd571('0x40')][_0xd571('0x50')]({'where':{'id':_0x4a6311['params']['id']}})[_0xd571('0x24')](handleEntityNotFound(_0x44b093,null))[_0xd571('0x24')](function(_0x13deaf){if(_0x13deaf){_0xae8a2c=_0x13deaf;_0xc84787[_0xd571('0x30')]=_[_0xd571('0x46')](db[_0xd571('0x4d')][_0xd571('0x2d')]);_0xc84787['query']=_[_0xd571('0x46')](_0x4a6311[_0xd571('0x31')]);_0xc84787['filters']=_[_0xd571('0x33')](_0xc84787[_0xd571('0x30')],_0xc84787['query']);_0x301856[_0xd571('0x35')]=_[_0xd571('0x33')](_0xc84787['model'],qs[_0xd571('0x34')](_0x4a6311[_0xd571('0x31')][_0xd571('0x34')]));_0x301856['attributes']=_0x301856['attributes']['length']?_0x301856['attributes']:_0xc84787[_0xd571('0x30')];_0x301856['order']=qs[_0xd571('0x3a')](_0x4a6311[_0xd571('0x31')][_0xd571('0x3a')]);_0x301856['where']=qs[_0xd571('0x32')](_['pick'](_0x4a6311['query'],_0xc84787[_0xd571('0x32')]));if(_0x4a6311['query']['filter']){_0x301856[_0xd571('0x3d')]=_[_0xd571('0x3e')](_0x301856['where'],{'$or':_['map'](_0x301856[_0xd571('0x35')],function(_0x2910dd){var _0x445744={};_0x445744[_0x2910dd]={'$like':'%'+_0x4a6311[_0xd571('0x31')][_0xd571('0x3c')]+'%'};return _0x445744;})});}_0x301856=_[_0xd571('0x3e')]({},_0x301856,_0x4a6311['options']);return _0xae8a2c[_0xd571('0x51')](_0x301856);}})[_0xd571('0x24')](function(_0x47c108){if(_0x47c108){_0x946545=_0x47c108[_0xd571('0x47')];if(!_0x4a6311[_0xd571('0x31')]['hasOwnProperty']('nolimit')){_0x301856[_0xd571('0x38')]=qs[_0xd571('0x38')](_0x4a6311[_0xd571('0x31')][_0xd571('0x38')]);_0x301856['offset']=qs[_0xd571('0x1c')](_0x4a6311[_0xd571('0x31')]['offset']);}return _0xae8a2c['getDescriptions'](_0x301856);}})[_0xd571('0x24')](function(_0x481985){if(_0x481985){return _0x481985?{'count':_0x946545,'rows':_0x481985}:null;}})[_0xd571('0x24')](respondWithResult(_0x44b093,null))[_0xd571('0x4b')](handleError(_0x44b093,null));}; \ No newline at end of file +var _0x64ad=['fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','include','findAll','rows','show','params','keys','includeAll','find','catch','create','body','getFields','ZohoField','nolimit','findOne','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','index','map','ZohoConfiguration','rawAttributes','fieldName','type','key','model','query','filters','intersection'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x64ad,0x1b1));var _0xd64a=function(_0x1177d5,_0x22b649){_0x1177d5=_0x1177d5-0x0;var _0xc3ddc2=_0x64ad[_0x1177d5];return _0xc3ddc2;};'use strict';var emlformat=require(_0xd64a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd64a('0x1'));var jsonpatch=require(_0xd64a('0x2'));var rp=require(_0xd64a('0x3'));var moment=require(_0xd64a('0x4'));var BPromise=require(_0xd64a('0x5'));var Mustache=require(_0xd64a('0x6'));var util=require(_0xd64a('0x7'));var path=require(_0xd64a('0x8'));var sox=require('sox');var csv=require(_0xd64a('0x9'));var ejs=require(_0xd64a('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xd64a('0xb'));var jsforce=require(_0xd64a('0xc'));var deskjs=require(_0xd64a('0xd'));var toCsv=require(_0xd64a('0x9'));var querystring=require(_0xd64a('0xe'));var Papa=require('papaparse');var Redis=require(_0xd64a('0xf'));var authService=require(_0xd64a('0x10'));var qs=require(_0xd64a('0x11'));var as=require(_0xd64a('0x12'));var hardwareService=require(_0xd64a('0x13'));var logger=require(_0xd64a('0x14'))('api');var utils=require(_0xd64a('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xd64a('0x16'));var db=require(_0xd64a('0x17'))['db'];function respondWithStatusCode(_0x12cd40,_0x1336fc){_0x1336fc=_0x1336fc||0xcc;return function(_0x477396){if(_0x477396){return _0x12cd40[_0xd64a('0x18')](_0x1336fc);}return _0x12cd40[_0xd64a('0x19')](_0x1336fc)['end']();};}function respondWithResult(_0x36fa97,_0x1e32d2){_0x1e32d2=_0x1e32d2||0xc8;return function(_0x51d624){if(_0x51d624){return _0x36fa97[_0xd64a('0x19')](_0x1e32d2)[_0xd64a('0x1a')](_0x51d624);}};}function respondWithFilteredResult(_0x468c03,_0x1e9eef){return function(_0x24d3bd){if(_0x24d3bd){var _0x5d3c6e=typeof _0x1e9eef[_0xd64a('0x1b')]==='undefined'&&typeof _0x1e9eef['limit']===_0xd64a('0x1c');var _0x4b9535=_0x24d3bd[_0xd64a('0x1d')];var _0x146494=_0x5d3c6e?0x0:_0x1e9eef['offset'];var _0x27e9eb=_0x5d3c6e?_0x24d3bd['count']:_0x1e9eef[_0xd64a('0x1b')]+_0x1e9eef[_0xd64a('0x1e')];var _0x50db27;if(_0x27e9eb>=_0x4b9535){_0x27e9eb=_0x4b9535;_0x50db27=0xc8;}else{_0x50db27=0xce;}_0x468c03['status'](_0x50db27);return _0x468c03[_0xd64a('0x1f')](_0xd64a('0x20'),_0x146494+'-'+_0x27e9eb+'/'+_0x4b9535)[_0xd64a('0x1a')](_0x24d3bd);}return null;};}function patchUpdates(_0x3632cc){return function(_0x443db4){try{jsonpatch[_0xd64a('0x21')](_0x443db4,_0x3632cc,!![]);}catch(_0x168570){return BPromise[_0xd64a('0x22')](_0x168570);}return _0x443db4['save']();};}function saveUpdates(_0x190b0b,_0x1d7c80){return function(_0x3cdbcc){if(_0x3cdbcc){return _0x3cdbcc[_0xd64a('0x23')](_0x190b0b)[_0xd64a('0x24')](function(_0x4d6306){return _0x4d6306;});}return null;};}function removeEntity(_0x249ee7,_0x1ff945){return function(_0xf931ce){if(_0xf931ce){return _0xf931ce[_0xd64a('0x25')]()['then'](function(){_0x249ee7['status'](0xcc)[_0xd64a('0x26')]();});}};}function handleEntityNotFound(_0x2f2c5f,_0x19a3a5){return function(_0x4bbae8){if(!_0x4bbae8){_0x2f2c5f[_0xd64a('0x18')](0x194);}return _0x4bbae8;};}function handleError(_0x2136d7,_0x19d778){_0x19d778=_0x19d778||0x1f4;return function(_0x123da5){logger[_0xd64a('0x27')](_0x123da5[_0xd64a('0x28')]);if(_0x123da5[_0xd64a('0x29')]){delete _0x123da5[_0xd64a('0x29')];}_0x2136d7['status'](_0x19d778)['send'](_0x123da5);};}exports[_0xd64a('0x2a')]=function(_0x1d2c34,_0xcaa437){var _0x58c9d3={},_0x21e45a={},_0x3776e8={'count':0x0,'rows':[]};var _0x1cf289=_[_0xd64a('0x2b')](db[_0xd64a('0x2c')][_0xd64a('0x2d')],function(_0x385ee2){return{'name':_0x385ee2[_0xd64a('0x2e')],'type':_0x385ee2[_0xd64a('0x2f')][_0xd64a('0x30')]};});_0x21e45a[_0xd64a('0x31')]=_[_0xd64a('0x2b')](_0x1cf289,_0xd64a('0x29'));_0x21e45a[_0xd64a('0x32')]=_['keys'](_0x1d2c34['query']);_0x21e45a[_0xd64a('0x33')]=_['intersection'](_0x21e45a['model'],_0x21e45a[_0xd64a('0x32')]);_0x58c9d3['attributes']=_[_0xd64a('0x34')](_0x21e45a['model'],qs[_0xd64a('0x35')](_0x1d2c34[_0xd64a('0x32')][_0xd64a('0x35')]));_0x58c9d3['attributes']=_0x58c9d3[_0xd64a('0x36')][_0xd64a('0x37')]?_0x58c9d3['attributes']:_0x21e45a[_0xd64a('0x31')];if(!_0x1d2c34[_0xd64a('0x32')][_0xd64a('0x38')]('nolimit')){_0x58c9d3[_0xd64a('0x1e')]=qs[_0xd64a('0x1e')](_0x1d2c34[_0xd64a('0x32')][_0xd64a('0x1e')]);_0x58c9d3[_0xd64a('0x1b')]=qs[_0xd64a('0x1b')](_0x1d2c34[_0xd64a('0x32')][_0xd64a('0x1b')]);}_0x58c9d3[_0xd64a('0x39')]=qs[_0xd64a('0x3a')](_0x1d2c34[_0xd64a('0x32')]['sort']);_0x58c9d3[_0xd64a('0x3b')]=qs[_0xd64a('0x33')](_[_0xd64a('0x3c')](_0x1d2c34['query'],_0x21e45a['filters']),_0x1cf289);if(_0x1d2c34[_0xd64a('0x32')][_0xd64a('0x3d')]){_0x58c9d3[_0xd64a('0x3b')]=_['merge'](_0x58c9d3[_0xd64a('0x3b')],{'$or':_[_0xd64a('0x2b')](_0x1cf289,function(_0x586e57){if(_0x586e57[_0xd64a('0x2f')]!=='VIRTUAL'){var _0x2ce220={};_0x2ce220[_0x586e57[_0xd64a('0x29')]]={'$like':'%'+_0x1d2c34['query'][_0xd64a('0x3d')]+'%'};return _0x2ce220;}})});}_0x58c9d3=_[_0xd64a('0x3e')]({},_0x58c9d3,_0x1d2c34[_0xd64a('0x3f')]);var _0x4b7e0d={'where':_0x58c9d3[_0xd64a('0x3b')]};return db[_0xd64a('0x2c')][_0xd64a('0x1d')](_0x4b7e0d)['then'](function(_0x1e84a2){_0x3776e8[_0xd64a('0x1d')]=_0x1e84a2;if(_0x1d2c34[_0xd64a('0x32')]['includeAll']){_0x58c9d3[_0xd64a('0x40')]=[{'all':!![]}];}return db[_0xd64a('0x2c')][_0xd64a('0x41')](_0x58c9d3);})[_0xd64a('0x24')](function(_0x1cda40){_0x3776e8[_0xd64a('0x42')]=_0x1cda40;return _0x3776e8;})[_0xd64a('0x24')](respondWithFilteredResult(_0xcaa437,_0x58c9d3))['catch'](handleError(_0xcaa437,null));};exports[_0xd64a('0x43')]=function(_0x366839,_0x2cf00f){var _0x4f16ef={'raw':![],'where':{'id':_0x366839[_0xd64a('0x44')]['id']}},_0x5a8ea4={};_0x5a8ea4[_0xd64a('0x31')]=_[_0xd64a('0x45')](db[_0xd64a('0x2c')][_0xd64a('0x2d')]);_0x5a8ea4[_0xd64a('0x32')]=_[_0xd64a('0x45')](_0x366839[_0xd64a('0x32')]);_0x5a8ea4[_0xd64a('0x33')]=_[_0xd64a('0x34')](_0x5a8ea4[_0xd64a('0x31')],_0x5a8ea4[_0xd64a('0x32')]);_0x4f16ef['attributes']=_[_0xd64a('0x34')](_0x5a8ea4['model'],qs[_0xd64a('0x35')](_0x366839[_0xd64a('0x32')]['fields']));_0x4f16ef[_0xd64a('0x36')]=_0x4f16ef[_0xd64a('0x36')][_0xd64a('0x37')]?_0x4f16ef[_0xd64a('0x36')]:_0x5a8ea4[_0xd64a('0x31')];if(_0x366839[_0xd64a('0x32')][_0xd64a('0x46')]){_0x4f16ef[_0xd64a('0x40')]=[{'all':!![]}];}_0x4f16ef=_[_0xd64a('0x3e')]({},_0x4f16ef,_0x366839[_0xd64a('0x3f')]);return db[_0xd64a('0x2c')][_0xd64a('0x47')](_0x4f16ef)['then'](handleEntityNotFound(_0x2cf00f,null))[_0xd64a('0x24')](respondWithResult(_0x2cf00f,null))[_0xd64a('0x48')](handleError(_0x2cf00f,null));};exports[_0xd64a('0x49')]=function(_0x194101,_0x2e54ae){return db[_0xd64a('0x2c')][_0xd64a('0x49')](_0x194101[_0xd64a('0x4a')],{})['then'](respondWithResult(_0x2e54ae,0xc9))[_0xd64a('0x48')](handleError(_0x2e54ae,null));};exports[_0xd64a('0x23')]=function(_0x34c72d,_0x3e8093){if(_0x34c72d[_0xd64a('0x4a')]['id']){delete _0x34c72d[_0xd64a('0x4a')]['id'];}return db['ZohoConfiguration'][_0xd64a('0x47')]({'where':{'id':_0x34c72d[_0xd64a('0x44')]['id']}})['then'](handleEntityNotFound(_0x3e8093,null))[_0xd64a('0x24')](saveUpdates(_0x34c72d['body'],null))[_0xd64a('0x24')](respondWithResult(_0x3e8093,null))['catch'](handleError(_0x3e8093,null));};exports['destroy']=function(_0x295b8b,_0x561eee){return db['ZohoConfiguration'][_0xd64a('0x47')]({'where':{'id':_0x295b8b[_0xd64a('0x44')]['id']}})[_0xd64a('0x24')](handleEntityNotFound(_0x561eee,null))['then'](removeEntity(_0x561eee,null))['catch'](handleError(_0x561eee,null));};exports[_0xd64a('0x4b')]=function(_0x2b71ea,_0x303028,_0x308ce6){var _0x149d37={};var _0x2e5339={};var _0x355c52;var _0x385191;return db['ZohoConfiguration']['findOne']({'where':{'id':_0x2b71ea[_0xd64a('0x44')]['id']}})['then'](handleEntityNotFound(_0x303028,null))['then'](function(_0x546781){if(_0x546781){_0x355c52=_0x546781;_0x2e5339[_0xd64a('0x31')]=_['keys'](db[_0xd64a('0x4c')]['rawAttributes']);_0x2e5339[_0xd64a('0x32')]=_['keys'](_0x2b71ea['query']);_0x2e5339[_0xd64a('0x33')]=_[_0xd64a('0x34')](_0x2e5339['model'],_0x2e5339['query']);_0x149d37['attributes']=_['intersection'](_0x2e5339[_0xd64a('0x31')],qs[_0xd64a('0x35')](_0x2b71ea['query'][_0xd64a('0x35')]));_0x149d37[_0xd64a('0x36')]=_0x149d37[_0xd64a('0x36')][_0xd64a('0x37')]?_0x149d37[_0xd64a('0x36')]:_0x2e5339[_0xd64a('0x31')];_0x149d37[_0xd64a('0x39')]=qs[_0xd64a('0x3a')](_0x2b71ea[_0xd64a('0x32')]['sort']);_0x149d37['where']=qs[_0xd64a('0x33')](_[_0xd64a('0x3c')](_0x2b71ea['query'],_0x2e5339[_0xd64a('0x33')]));if(_0x2b71ea[_0xd64a('0x32')][_0xd64a('0x3d')]){_0x149d37[_0xd64a('0x3b')]=_[_0xd64a('0x3e')](_0x149d37['where'],{'$or':_['map'](_0x149d37[_0xd64a('0x36')],function(_0x1cc5f4){var _0x21d063={};_0x21d063[_0x1cc5f4]={'$like':'%'+_0x2b71ea[_0xd64a('0x32')]['filter']+'%'};return _0x21d063;})});}_0x149d37=_[_0xd64a('0x3e')]({},_0x149d37,_0x2b71ea[_0xd64a('0x3f')]);return _0x355c52[_0xd64a('0x4b')](_0x149d37);}})[_0xd64a('0x24')](function(_0x2a8ef1){if(_0x2a8ef1){_0x385191=_0x2a8ef1[_0xd64a('0x37')];if(!_0x2b71ea[_0xd64a('0x32')][_0xd64a('0x38')](_0xd64a('0x4d'))){_0x149d37['limit']=qs[_0xd64a('0x1e')](_0x2b71ea[_0xd64a('0x32')][_0xd64a('0x1e')]);_0x149d37[_0xd64a('0x1b')]=qs['offset'](_0x2b71ea[_0xd64a('0x32')][_0xd64a('0x1b')]);}return _0x355c52[_0xd64a('0x4b')](_0x149d37);}})[_0xd64a('0x24')](function(_0x13c374){if(_0x13c374){return _0x13c374?{'count':_0x385191,'rows':_0x13c374}:null;}})[_0xd64a('0x24')](respondWithResult(_0x303028,null))[_0xd64a('0x48')](handleError(_0x303028,null));};exports['getSubjects']=function(_0x1bc841,_0xf2c0af,_0x50f307){var _0x1ba513={};var _0x1f468e={};var _0xcea0f4;var _0x5b121d;return db[_0xd64a('0x2c')][_0xd64a('0x4e')]({'where':{'id':_0x1bc841[_0xd64a('0x44')]['id']}})[_0xd64a('0x24')](handleEntityNotFound(_0xf2c0af,null))[_0xd64a('0x24')](function(_0x1c1b64){if(_0x1c1b64){_0xcea0f4=_0x1c1b64;_0x1f468e['model']=_[_0xd64a('0x45')](db[_0xd64a('0x4c')][_0xd64a('0x2d')]);_0x1f468e[_0xd64a('0x32')]=_[_0xd64a('0x45')](_0x1bc841[_0xd64a('0x32')]);_0x1f468e['filters']=_[_0xd64a('0x34')](_0x1f468e[_0xd64a('0x31')],_0x1f468e['query']);_0x1ba513[_0xd64a('0x36')]=_[_0xd64a('0x34')](_0x1f468e[_0xd64a('0x31')],qs['fields'](_0x1bc841[_0xd64a('0x32')][_0xd64a('0x35')]));_0x1ba513['attributes']=_0x1ba513[_0xd64a('0x36')][_0xd64a('0x37')]?_0x1ba513['attributes']:_0x1f468e[_0xd64a('0x31')];_0x1ba513['order']=qs[_0xd64a('0x3a')](_0x1bc841[_0xd64a('0x32')]['sort']);_0x1ba513[_0xd64a('0x3b')]=qs[_0xd64a('0x33')](_['pick'](_0x1bc841['query'],_0x1f468e['filters']));if(_0x1bc841[_0xd64a('0x32')][_0xd64a('0x3d')]){_0x1ba513[_0xd64a('0x3b')]=_[_0xd64a('0x3e')](_0x1ba513[_0xd64a('0x3b')],{'$or':_['map'](_0x1ba513[_0xd64a('0x36')],function(_0x10a83a){var _0xdb491d={};_0xdb491d[_0x10a83a]={'$like':'%'+_0x1bc841[_0xd64a('0x32')]['filter']+'%'};return _0xdb491d;})});}_0x1ba513=_[_0xd64a('0x3e')]({},_0x1ba513,_0x1bc841['options']);return _0xcea0f4[_0xd64a('0x4f')](_0x1ba513);}})[_0xd64a('0x24')](function(_0x400147){if(_0x400147){_0x5b121d=_0x400147[_0xd64a('0x37')];if(!_0x1bc841[_0xd64a('0x32')]['hasOwnProperty']('nolimit')){_0x1ba513[_0xd64a('0x1e')]=qs[_0xd64a('0x1e')](_0x1bc841[_0xd64a('0x32')][_0xd64a('0x1e')]);_0x1ba513[_0xd64a('0x1b')]=qs[_0xd64a('0x1b')](_0x1bc841[_0xd64a('0x32')][_0xd64a('0x1b')]);}return _0xcea0f4[_0xd64a('0x4f')](_0x1ba513);}})[_0xd64a('0x24')](function(_0x2e3feb){if(_0x2e3feb){return _0x2e3feb?{'count':_0x5b121d,'rows':_0x2e3feb}:null;}})[_0xd64a('0x24')](respondWithResult(_0xf2c0af,null))[_0xd64a('0x48')](handleError(_0xf2c0af,null));};exports[_0xd64a('0x50')]=function(_0x23da9b,_0x58bb93,_0x36b712){var _0x384dac={};var _0x26fa10={};var _0x15ff78;var _0xf8c70d;return db[_0xd64a('0x2c')][_0xd64a('0x4e')]({'where':{'id':_0x23da9b[_0xd64a('0x44')]['id']}})[_0xd64a('0x24')](handleEntityNotFound(_0x58bb93,null))['then'](function(_0x29e3b5){if(_0x29e3b5){_0x15ff78=_0x29e3b5;_0x26fa10[_0xd64a('0x31')]=_['keys'](db[_0xd64a('0x4c')]['rawAttributes']);_0x26fa10['query']=_[_0xd64a('0x45')](_0x23da9b['query']);_0x26fa10[_0xd64a('0x33')]=_[_0xd64a('0x34')](_0x26fa10[_0xd64a('0x31')],_0x26fa10[_0xd64a('0x32')]);_0x384dac[_0xd64a('0x36')]=_[_0xd64a('0x34')](_0x26fa10['model'],qs[_0xd64a('0x35')](_0x23da9b[_0xd64a('0x32')][_0xd64a('0x35')]));_0x384dac[_0xd64a('0x36')]=_0x384dac[_0xd64a('0x36')]['length']?_0x384dac[_0xd64a('0x36')]:_0x26fa10['model'];_0x384dac[_0xd64a('0x39')]=qs[_0xd64a('0x3a')](_0x23da9b[_0xd64a('0x32')][_0xd64a('0x3a')]);_0x384dac[_0xd64a('0x3b')]=qs['filters'](_['pick'](_0x23da9b[_0xd64a('0x32')],_0x26fa10[_0xd64a('0x33')]));if(_0x23da9b[_0xd64a('0x32')][_0xd64a('0x3d')]){_0x384dac[_0xd64a('0x3b')]=_[_0xd64a('0x3e')](_0x384dac[_0xd64a('0x3b')],{'$or':_['map'](_0x384dac[_0xd64a('0x36')],function(_0x41fa10){var _0x30f679={};_0x30f679[_0x41fa10]={'$like':'%'+_0x23da9b[_0xd64a('0x32')][_0xd64a('0x3d')]+'%'};return _0x30f679;})});}_0x384dac=_[_0xd64a('0x3e')]({},_0x384dac,_0x23da9b['options']);return _0x15ff78['getDescriptions'](_0x384dac);}})[_0xd64a('0x24')](function(_0xc38aa8){if(_0xc38aa8){_0xf8c70d=_0xc38aa8[_0xd64a('0x37')];if(!_0x23da9b[_0xd64a('0x32')][_0xd64a('0x38')](_0xd64a('0x4d'))){_0x384dac[_0xd64a('0x1e')]=qs['limit'](_0x23da9b[_0xd64a('0x32')][_0xd64a('0x1e')]);_0x384dac[_0xd64a('0x1b')]=qs[_0xd64a('0x1b')](_0x23da9b['query'][_0xd64a('0x1b')]);}return _0x15ff78[_0xd64a('0x50')](_0x384dac);}})[_0xd64a('0x24')](function(_0x37d947){if(_0x37d947){return _0x37d947?{'count':_0xf8c70d,'rows':_0x37d947}:null;}})['then'](respondWithResult(_0x58bb93,null))[_0xd64a('0x48')](handleError(_0x58bb93,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 5584c1d..1a05868 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 _0x97ec=['request-promise','path','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1a13b1,_0x4d1d25){var _0x395e05=function(_0x209692){while(--_0x209692){_0x1a13b1['push'](_0x1a13b1['shift']());}};_0x395e05(++_0x4d1d25);}(_0x97ec,0x182));var _0xc97e=function(_0x555735,_0x28273f){_0x555735=_0x555735-0x0;var _0x3edf36=_0x97ec[_0x555735];return _0x3edf36;};'use strict';var _=require(_0xc97e('0x0'));var util=require(_0xc97e('0x1'));var logger=require(_0xc97e('0x2'))(_0xc97e('0x3'));var moment=require(_0xc97e('0x4'));var BPromise=require(_0xc97e('0x5'));var rp=require(_0xc97e('0x6'));var fs=require('fs');var path=require(_0xc97e('0x7'));var rimraf=require('rimraf');var config=require(_0xc97e('0x8'));var attributes=require(_0xc97e('0x9'));module[_0xc97e('0xa')]=function(_0x1b5deb,_0x2120e2){return _0x1b5deb[_0xc97e('0xb')](_0xc97e('0xc'),attributes,{'tableName':_0xc97e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd758=['request-promise','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','api','moment','bluebird'];(function(_0x33ac75,_0x4953e3){var _0x34d5f2=function(_0x4c2b4a){while(--_0x4c2b4a){_0x33ac75['push'](_0x33ac75['shift']());}};_0x34d5f2(++_0x4953e3);}(_0xd758,0xe1));var _0x8d75=function(_0x59b4d6,_0x378ea3){_0x59b4d6=_0x59b4d6-0x0;var _0x1fdf48=_0xd758[_0x59b4d6];return _0x1fdf48;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x8d75('0x0'));var moment=require(_0x8d75('0x1'));var BPromise=require(_0x8d75('0x2'));var rp=require(_0x8d75('0x3'));var fs=require('fs');var path=require(_0x8d75('0x4'));var rimraf=require(_0x8d75('0x5'));var config=require(_0x8d75('0x6'));var attributes=require(_0x8d75('0x7'));module[_0x8d75('0x8')]=function(_0x5ec456,_0x40db5c){return _0x5ec456[_0x8d75('0x9')](_0x8d75('0xa'),attributes,{'tableName':_0x8d75('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 c719704..318ea66 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 _0x906a=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoConfiguration,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird'];(function(_0x52885b,_0x1b4dbc){var _0x458b92=function(_0x14aada){while(--_0x14aada){_0x52885b['push'](_0x52885b['shift']());}};_0x458b92(++_0x1b4dbc);}(_0x906a,0x1c4));var _0xa906=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x906a[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0xa906('0x0'));var util=require(_0xa906('0x1'));var moment=require(_0xa906('0x2'));var BPromise=require(_0xa906('0x3'));var rs=require(_0xa906('0x4'));var fs=require('fs');var Redis=require(_0xa906('0x5'));var db=require(_0xa906('0x6'))['db'];var utils=require(_0xa906('0x7'));var logger=require(_0xa906('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa906('0x9'));var client=jayson[_0xa906('0xa')][_0xa906('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1feed5,_0x3f393a,_0x227769){return new BPromise(function(_0x96990b,_0x2cf3f9){return client[_0xa906('0xc')](_0x1feed5,_0x227769)[_0xa906('0xd')](function(_0x49989a){logger[_0xa906('0xe')]('ZohoConfiguration,\x20%s,\x20%s',_0x3f393a,_0xa906('0xf'));logger[_0xa906('0x10')](_0xa906('0x11'),_0x3f393a,_0xa906('0xf'),JSON[_0xa906('0x12')](_0x49989a));if(_0x49989a[_0xa906('0x13')]){if(_0x49989a['error'][_0xa906('0x14')]===0x1f4){logger[_0xa906('0x13')](_0xa906('0x15'),_0x3f393a,_0x49989a[_0xa906('0x13')][_0xa906('0x16')]);return _0x2cf3f9(_0x49989a[_0xa906('0x13')][_0xa906('0x16')]);}logger[_0xa906('0x13')](_0xa906('0x15'),_0x3f393a,_0x49989a[_0xa906('0x13')][_0xa906('0x16')]);return _0x96990b(_0x49989a[_0xa906('0x13')][_0xa906('0x16')]);}else{logger[_0xa906('0xe')]('ZohoConfiguration,\x20%s,\x20%s',_0x3f393a,_0xa906('0xf'));_0x96990b(_0x49989a[_0xa906('0x17')][_0xa906('0x16')]);}})['catch'](function(_0x15d206){logger['error'](_0xa906('0x15'),_0x3f393a,_0x15d206);_0x2cf3f9(_0x15d206);});});} \ No newline at end of file +var _0x06e8=['error','ZohoConfiguration,\x20%s,\x20%s','message','info','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x392caa,_0x28f516){var _0x3e1cd6=function(_0x53c714){while(--_0x53c714){_0x392caa['push'](_0x392caa['shift']());}};_0x3e1cd6(++_0x28f516);}(_0x06e8,0x196));var _0x806e=function(_0x46ef2b,_0x210b89){_0x46ef2b=_0x46ef2b-0x0;var _0x14b7b7=_0x06e8[_0x46ef2b];return _0x14b7b7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x806e('0x0'));var BPromise=require(_0x806e('0x1'));var rs=require(_0x806e('0x2'));var fs=require('fs');var Redis=require(_0x806e('0x3'));var db=require(_0x806e('0x4'))['db'];var utils=require(_0x806e('0x5'));var logger=require('../../config/logger')(_0x806e('0x6'));var config=require('../../config/environment');var jayson=require(_0x806e('0x7'));var client=jayson[_0x806e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x927f6e,_0x6e9395,_0x8f38e){return new BPromise(function(_0x333d1e,_0x11c579){return client[_0x806e('0x9')](_0x927f6e,_0x8f38e)[_0x806e('0xa')](function(_0x17c99c){logger['info']('ZohoConfiguration,\x20%s,\x20%s',_0x6e9395,_0x806e('0xb'));logger[_0x806e('0xc')](_0x806e('0xd'),_0x6e9395,_0x806e('0xb'),JSON['stringify'](_0x17c99c));if(_0x17c99c['error']){if(_0x17c99c[_0x806e('0xe')]['code']===0x1f4){logger[_0x806e('0xe')](_0x806e('0xf'),_0x6e9395,_0x17c99c[_0x806e('0xe')][_0x806e('0x10')]);return _0x11c579(_0x17c99c[_0x806e('0xe')][_0x806e('0x10')]);}logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x6e9395,_0x17c99c[_0x806e('0xe')][_0x806e('0x10')]);return _0x333d1e(_0x17c99c['error'][_0x806e('0x10')]);}else{logger[_0x806e('0x11')](_0x806e('0xf'),_0x6e9395,'request\x20sent');_0x333d1e(_0x17c99c[_0x806e('0x12')][_0x806e('0x10')]);}})[_0x806e('0x13')](function(_0x1e8e81){logger[_0x806e('0xe')](_0x806e('0xf'),_0x6e9395,_0x1e8e81);_0x11c579(_0x1e8e81);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index eef3c59..1be9ec8 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 _0xeefa=['post','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZohoField.controller','get','isAuthenticated','index','/:id','show'];(function(_0x44c768,_0x552a5e){var _0x55daf5=function(_0x4958e8){while(--_0x4958e8){_0x44c768['push'](_0x44c768['shift']());}};_0x55daf5(++_0x552a5e);}(_0xeefa,0xf5));var _0xaeef=function(_0x302d12,_0x2cae04){_0x302d12=_0x302d12-0x0;var _0x52fa2c=_0xeefa[_0x302d12];return _0x52fa2c;};'use strict';var multer=require(_0xaeef('0x0'));var util=require(_0xaeef('0x1'));var path=require(_0xaeef('0x2'));var timeout=require(_0xaeef('0x3'));var express=require(_0xaeef('0x4'));var router=express[_0xaeef('0x5')]();var fs_extra=require(_0xaeef('0x6'));var auth=require(_0xaeef('0x7'));var interaction=require(_0xaeef('0x8'));var config=require('../../config/environment');var controller=require(_0xaeef('0x9'));router[_0xaeef('0xa')]('/',auth[_0xaeef('0xb')](),controller[_0xaeef('0xc')]);router[_0xaeef('0xa')](_0xaeef('0xd'),auth['isAuthenticated'](),controller[_0xaeef('0xe')]);router[_0xaeef('0xf')]('/',auth[_0xaeef('0xb')](),controller['create']);router[_0xaeef('0x10')](_0xaeef('0xd'),auth['isAuthenticated'](),controller[_0xaeef('0x11')]);router[_0xaeef('0x12')]('/:id',auth[_0xaeef('0xb')](),controller['destroy']);module[_0xaeef('0x13')]=router; \ No newline at end of file +var _0x5f96=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intZohoField.controller','get','index','isAuthenticated','show','post','create','put','update','delete','/:id','exports','multer','util','path'];(function(_0x86b219,_0x43038f){var _0x1f320c=function(_0x8cd63f){while(--_0x8cd63f){_0x86b219['push'](_0x86b219['shift']());}};_0x1f320c(++_0x43038f);}(_0x5f96,0x75));var _0x65f9=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0x5f96[_0x29d915];return _0x160f86;};'use strict';var multer=require(_0x65f9('0x0'));var util=require(_0x65f9('0x1'));var path=require(_0x65f9('0x2'));var timeout=require(_0x65f9('0x3'));var express=require(_0x65f9('0x4'));var router=express[_0x65f9('0x5')]();var fs_extra=require(_0x65f9('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x65f9('0x7'));var config=require('../../config/environment');var controller=require(_0x65f9('0x8'));router[_0x65f9('0x9')]('/',auth['isAuthenticated'](),controller[_0x65f9('0xa')]);router[_0x65f9('0x9')]('/:id',auth[_0x65f9('0xb')](),controller[_0x65f9('0xc')]);router[_0x65f9('0xd')]('/',auth[_0x65f9('0xb')](),controller[_0x65f9('0xe')]);router[_0x65f9('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x65f9('0x10')]);router[_0x65f9('0x11')](_0x65f9('0x12'),auth[_0x65f9('0xb')](),controller['destroy']);module[_0x65f9('0x13')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 56a598f..ab60dc3 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 _0x7ea5=['exports','ENUM','string','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize'];(function(_0x335212,_0xa007b4){var _0x1497be=function(_0x542fa9){while(--_0x542fa9){_0x335212['push'](_0x335212['shift']());}};_0x1497be(++_0xa007b4);}(_0x7ea5,0x11f));var _0x57ea=function(_0x583668,_0xb6c66c){_0x583668=_0x583668-0x0;var _0x506044=_0x7ea5[_0x583668];return _0x506044;};'use strict';var Sequelize=require(_0x57ea('0x0'));module[_0x57ea('0x1')]={'type':{'type':Sequelize[_0x57ea('0x2')](_0x57ea('0x3'),'variable',_0x57ea('0x4'),_0x57ea('0x5'),_0x57ea('0x6')),'defaultValue':_0x57ea('0x3')},'content':{'type':Sequelize[_0x57ea('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x57ea('0x2')]('string','variable','customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x57ea('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x57ea('0x7')]}}; \ No newline at end of file +var _0x36cf=['customVariable','ENUM','string','variable','picklist','STRING'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x36cf,0x1db));var _0xf36c=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x36cf[_0x5d4607];return _0x5e4a86;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xf36c('0x0')](_0xf36c('0x1'),_0xf36c('0x2'),'customVariable','keyValue',_0xf36c('0x3')),'defaultValue':_0xf36c('0x1')},'content':{'type':Sequelize[_0xf36c('0x4')]},'key':{'type':Sequelize[_0xf36c('0x4')]},'keyType':{'type':Sequelize[_0xf36c('0x0')]('string',_0xf36c('0x2'),_0xf36c('0x5'))},'keyContent':{'type':Sequelize[_0xf36c('0x4')]},'idField':{'type':Sequelize[_0xf36c('0x4')]},'nameField':{'type':Sequelize[_0xf36c('0x4')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf36c('0x4')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index a80e1b3..a9c4e21 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 _0xabfa=['update','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','then','destroy','stack','name','send','index','map','ZohoField','rawAttributes','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','keys','find','create','body','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xabfa,0xdc));var _0xaabf=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xabfa[_0x199572];return _0x13cfa3;};'use strict';var emlformat=require(_0xaabf('0x0'));var rimraf=require(_0xaabf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaabf('0x2'));var rp=require('request-promise');var moment=require(_0xaabf('0x3'));var BPromise=require(_0xaabf('0x4'));var Mustache=require('mustache');var util=require(_0xaabf('0x5'));var path=require(_0xaabf('0x6'));var sox=require('sox');var csv=require(_0xaabf('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xaabf('0x8'));var _=require(_0xaabf('0x9'));var squel=require(_0xaabf('0xa'));var crypto=require(_0xaabf('0xb'));var jsforce=require(_0xaabf('0xc'));var deskjs=require(_0xaabf('0xd'));var toCsv=require(_0xaabf('0x7'));var querystring=require('querystring');var Papa=require(_0xaabf('0xe'));var Redis=require('ioredis');var authService=require(_0xaabf('0xf'));var qs=require(_0xaabf('0x10'));var as=require(_0xaabf('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xaabf('0x12'))(_0xaabf('0x13'));var utils=require(_0xaabf('0x14'));var config=require(_0xaabf('0x15'));var licenseUtil=require(_0xaabf('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x27923b,_0x4ae548){_0x4ae548=_0x4ae548||0xcc;return function(_0x585c05){if(_0x585c05){return _0x27923b[_0xaabf('0x17')](_0x4ae548);}return _0x27923b[_0xaabf('0x18')](_0x4ae548)[_0xaabf('0x19')]();};}function respondWithResult(_0x1b79e4,_0x504926){_0x504926=_0x504926||0xc8;return function(_0x378d41){if(_0x378d41){return _0x1b79e4[_0xaabf('0x18')](_0x504926)[_0xaabf('0x1a')](_0x378d41);}};}function respondWithFilteredResult(_0x479d2d,_0x494c62){return function(_0x4ef220){if(_0x4ef220){var _0x4d9372=typeof _0x494c62['offset']===_0xaabf('0x1b')&&typeof _0x494c62[_0xaabf('0x1c')]===_0xaabf('0x1b');var _0x13607d=_0x4ef220[_0xaabf('0x1d')];var _0x57547c=_0x4d9372?0x0:_0x494c62[_0xaabf('0x1e')];var _0x193b47=_0x4d9372?_0x4ef220[_0xaabf('0x1d')]:_0x494c62[_0xaabf('0x1e')]+_0x494c62['limit'];var _0x4a719f;if(_0x193b47>=_0x13607d){_0x193b47=_0x13607d;_0x4a719f=0xc8;}else{_0x4a719f=0xce;}_0x479d2d[_0xaabf('0x18')](_0x4a719f);return _0x479d2d[_0xaabf('0x1f')](_0xaabf('0x20'),_0x57547c+'-'+_0x193b47+'/'+_0x13607d)[_0xaabf('0x1a')](_0x4ef220);}return null;};}function patchUpdates(_0x449233){return function(_0x1e74ef){try{jsonpatch[_0xaabf('0x21')](_0x1e74ef,_0x449233,!![]);}catch(_0x48fb0f){return BPromise[_0xaabf('0x22')](_0x48fb0f);}return _0x1e74ef['save']();};}function saveUpdates(_0x3ee083,_0x2f463c){return function(_0x1c07f8){if(_0x1c07f8){return _0x1c07f8['update'](_0x3ee083)[_0xaabf('0x23')](function(_0x340dbb){return _0x340dbb;});}return null;};}function removeEntity(_0x6bd7e9,_0x13c584){return function(_0xf29954){if(_0xf29954){return _0xf29954[_0xaabf('0x24')]()[_0xaabf('0x23')](function(){_0x6bd7e9[_0xaabf('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41ec99,_0x1cd1a0){return function(_0x181d30){if(!_0x181d30){_0x41ec99[_0xaabf('0x17')](0x194);}return _0x181d30;};}function handleError(_0x420c52,_0xb9e149){_0xb9e149=_0xb9e149||0x1f4;return function(_0x4cb6fc){logger['error'](_0x4cb6fc[_0xaabf('0x25')]);if(_0x4cb6fc['name']){delete _0x4cb6fc[_0xaabf('0x26')];}_0x420c52[_0xaabf('0x18')](_0xb9e149)[_0xaabf('0x27')](_0x4cb6fc);};}exports[_0xaabf('0x28')]=function(_0x35e5b1,_0x1a7844){var _0xb484e8={},_0x22023e={},_0x30612b={'count':0x0,'rows':[]};var _0x5e5603=_[_0xaabf('0x29')](db[_0xaabf('0x2a')][_0xaabf('0x2b')],function(_0x122ebc){return{'name':_0x122ebc['fieldName'],'type':_0x122ebc['type']['key']};});_0x22023e[_0xaabf('0x2c')]=_[_0xaabf('0x29')](_0x5e5603,_0xaabf('0x26'));_0x22023e['query']=_['keys'](_0x35e5b1[_0xaabf('0x2d')]);_0x22023e[_0xaabf('0x2e')]=_[_0xaabf('0x2f')](_0x22023e[_0xaabf('0x2c')],_0x22023e[_0xaabf('0x2d')]);_0xb484e8['attributes']=_['intersection'](_0x22023e[_0xaabf('0x2c')],qs[_0xaabf('0x30')](_0x35e5b1['query'][_0xaabf('0x30')]));_0xb484e8[_0xaabf('0x31')]=_0xb484e8[_0xaabf('0x31')][_0xaabf('0x32')]?_0xb484e8['attributes']:_0x22023e[_0xaabf('0x2c')];if(!_0x35e5b1[_0xaabf('0x2d')][_0xaabf('0x33')](_0xaabf('0x34'))){_0xb484e8[_0xaabf('0x1c')]=qs[_0xaabf('0x1c')](_0x35e5b1['query']['limit']);_0xb484e8['offset']=qs[_0xaabf('0x1e')](_0x35e5b1[_0xaabf('0x2d')][_0xaabf('0x1e')]);}_0xb484e8['order']=qs['sort'](_0x35e5b1[_0xaabf('0x2d')][_0xaabf('0x35')]);_0xb484e8[_0xaabf('0x36')]=qs[_0xaabf('0x2e')](_[_0xaabf('0x37')](_0x35e5b1[_0xaabf('0x2d')],_0x22023e['filters']),_0x5e5603);if(_0x35e5b1[_0xaabf('0x2d')]['filter']){_0xb484e8[_0xaabf('0x36')]=_[_0xaabf('0x38')](_0xb484e8[_0xaabf('0x36')],{'$or':_[_0xaabf('0x29')](_0x5e5603,function(_0x838f97){if(_0x838f97[_0xaabf('0x39')]!==_0xaabf('0x3a')){var _0x112e6b={};_0x112e6b[_0x838f97['name']]={'$like':'%'+_0x35e5b1[_0xaabf('0x2d')][_0xaabf('0x3b')]+'%'};return _0x112e6b;}})});}_0xb484e8=_[_0xaabf('0x38')]({},_0xb484e8,_0x35e5b1[_0xaabf('0x3c')]);var _0x556692={'where':_0xb484e8[_0xaabf('0x36')]};return db[_0xaabf('0x2a')][_0xaabf('0x1d')](_0x556692)[_0xaabf('0x23')](function(_0x4e4471){_0x30612b['count']=_0x4e4471;if(_0x35e5b1['query'][_0xaabf('0x3d')]){_0xb484e8[_0xaabf('0x3e')]=[{'all':!![]}];}return db[_0xaabf('0x2a')][_0xaabf('0x3f')](_0xb484e8);})['then'](function(_0x387b8f){_0x30612b[_0xaabf('0x40')]=_0x387b8f;return _0x30612b;})[_0xaabf('0x23')](respondWithFilteredResult(_0x1a7844,_0xb484e8))['catch'](handleError(_0x1a7844,null));};exports[_0xaabf('0x41')]=function(_0x1d0717,_0x1d5f9c){var _0x352c4c={'raw':!![],'where':{'id':_0x1d0717[_0xaabf('0x42')]['id']}},_0x168f96={};_0x168f96[_0xaabf('0x2c')]=_[_0xaabf('0x43')](db[_0xaabf('0x2a')][_0xaabf('0x2b')]);_0x168f96[_0xaabf('0x2d')]=_['keys'](_0x1d0717[_0xaabf('0x2d')]);_0x168f96[_0xaabf('0x2e')]=_['intersection'](_0x168f96[_0xaabf('0x2c')],_0x168f96[_0xaabf('0x2d')]);_0x352c4c[_0xaabf('0x31')]=_['intersection'](_0x168f96[_0xaabf('0x2c')],qs['fields'](_0x1d0717[_0xaabf('0x2d')][_0xaabf('0x30')]));_0x352c4c[_0xaabf('0x31')]=_0x352c4c[_0xaabf('0x31')]['length']?_0x352c4c[_0xaabf('0x31')]:_0x168f96[_0xaabf('0x2c')];if(_0x1d0717[_0xaabf('0x2d')]['includeAll']){_0x352c4c['include']=[{'all':!![]}];}_0x352c4c=_[_0xaabf('0x38')]({},_0x352c4c,_0x1d0717['options']);return db[_0xaabf('0x2a')][_0xaabf('0x44')](_0x352c4c)['then'](handleEntityNotFound(_0x1d5f9c,null))[_0xaabf('0x23')](respondWithResult(_0x1d5f9c,null))['catch'](handleError(_0x1d5f9c,null));};exports[_0xaabf('0x45')]=function(_0x1d086c,_0x5322f4){return db[_0xaabf('0x2a')][_0xaabf('0x45')](_0x1d086c[_0xaabf('0x46')],{})[_0xaabf('0x23')](respondWithResult(_0x5322f4,0xc9))[_0xaabf('0x47')](handleError(_0x5322f4,null));};exports[_0xaabf('0x48')]=function(_0x21e343,_0x5ceae8){if(_0x21e343['body']['id']){delete _0x21e343[_0xaabf('0x46')]['id'];}return db[_0xaabf('0x2a')]['find']({'where':{'id':_0x21e343[_0xaabf('0x42')]['id']}})[_0xaabf('0x23')](handleEntityNotFound(_0x5ceae8,null))[_0xaabf('0x23')](saveUpdates(_0x21e343[_0xaabf('0x46')],null))['then'](respondWithResult(_0x5ceae8,null))[_0xaabf('0x47')](handleError(_0x5ceae8,null));};exports[_0xaabf('0x24')]=function(_0xb780bf,_0x447e95){return db[_0xaabf('0x2a')][_0xaabf('0x44')]({'where':{'id':_0xb780bf['params']['id']}})[_0xaabf('0x23')](handleEntityNotFound(_0x447e95,null))[_0xaabf('0x23')](removeEntity(_0x447e95,null))[_0xaabf('0x47')](handleError(_0x447e95,null));}; \ No newline at end of file +var _0x1932=['hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','rows','catch','params','keys','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','save','update','then','end','error','stack','name','send','index','map','ZohoField','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length'];(function(_0x45f923,_0x587594){var _0xe65d6b=function(_0x2f573a){while(--_0x2f573a){_0x45f923['push'](_0x45f923['shift']());}};_0xe65d6b(++_0x587594);}(_0x1932,0x1e8));var _0x2193=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x1932[_0x209941];return _0x1e8729;};'use strict';var emlformat=require(_0x2193('0x0'));var rimraf=require(_0x2193('0x1'));var zipdir=require(_0x2193('0x2'));var jsonpatch=require(_0x2193('0x3'));var rp=require(_0x2193('0x4'));var moment=require(_0x2193('0x5'));var BPromise=require(_0x2193('0x6'));var Mustache=require(_0x2193('0x7'));var util=require(_0x2193('0x8'));var path=require(_0x2193('0x9'));var sox=require(_0x2193('0xa'));var csv=require(_0x2193('0xb'));var ejs=require(_0x2193('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2193('0xd'));var squel=require(_0x2193('0xe'));var crypto=require(_0x2193('0xf'));var jsforce=require(_0x2193('0x10'));var deskjs=require(_0x2193('0x11'));var toCsv=require(_0x2193('0xb'));var querystring=require(_0x2193('0x12'));var Papa=require(_0x2193('0x13'));var Redis=require(_0x2193('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x2193('0x15'));var as=require(_0x2193('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2193('0x17'))(_0x2193('0x18'));var utils=require(_0x2193('0x19'));var config=require(_0x2193('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x2193('0x1b'))['db'];function respondWithStatusCode(_0x18c778,_0x3289fc){_0x3289fc=_0x3289fc||0xcc;return function(_0x33e371){if(_0x33e371){return _0x18c778[_0x2193('0x1c')](_0x3289fc);}return _0x18c778[_0x2193('0x1d')](_0x3289fc)['end']();};}function respondWithResult(_0x5bc094,_0xe66c90){_0xe66c90=_0xe66c90||0xc8;return function(_0x5ac58c){if(_0x5ac58c){return _0x5bc094[_0x2193('0x1d')](_0xe66c90)[_0x2193('0x1e')](_0x5ac58c);}};}function respondWithFilteredResult(_0x5a0f8c,_0x1f9bb6){return function(_0x495ea3){if(_0x495ea3){var _0x53140c=typeof _0x1f9bb6[_0x2193('0x1f')]===_0x2193('0x20')&&typeof _0x1f9bb6[_0x2193('0x21')]===_0x2193('0x20');var _0x52a695=_0x495ea3['count'];var _0x3fa42c=_0x53140c?0x0:_0x1f9bb6[_0x2193('0x1f')];var _0x5dce91=_0x53140c?_0x495ea3[_0x2193('0x22')]:_0x1f9bb6['offset']+_0x1f9bb6[_0x2193('0x21')];var _0x53c4f9;if(_0x5dce91>=_0x52a695){_0x5dce91=_0x52a695;_0x53c4f9=0xc8;}else{_0x53c4f9=0xce;}_0x5a0f8c[_0x2193('0x1d')](_0x53c4f9);return _0x5a0f8c[_0x2193('0x23')]('Content-Range',_0x3fa42c+'-'+_0x5dce91+'/'+_0x52a695)[_0x2193('0x1e')](_0x495ea3);}return null;};}function patchUpdates(_0x12c575){return function(_0x2bcc78){try{jsonpatch[_0x2193('0x24')](_0x2bcc78,_0x12c575,!![]);}catch(_0x67eea){return BPromise['reject'](_0x67eea);}return _0x2bcc78[_0x2193('0x25')]();};}function saveUpdates(_0x5c54c5,_0x576724){return function(_0xaa61c6){if(_0xaa61c6){return _0xaa61c6[_0x2193('0x26')](_0x5c54c5)[_0x2193('0x27')](function(_0x34dc12){return _0x34dc12;});}return null;};}function removeEntity(_0x2e4186,_0x3196df){return function(_0x51c971){if(_0x51c971){return _0x51c971['destroy']()['then'](function(){_0x2e4186[_0x2193('0x1d')](0xcc)[_0x2193('0x28')]();});}};}function handleEntityNotFound(_0x5d63d0,_0x19ef49){return function(_0x90279d){if(!_0x90279d){_0x5d63d0[_0x2193('0x1c')](0x194);}return _0x90279d;};}function handleError(_0x5145f2,_0x4ba028){_0x4ba028=_0x4ba028||0x1f4;return function(_0x43bb4f){logger[_0x2193('0x29')](_0x43bb4f[_0x2193('0x2a')]);if(_0x43bb4f[_0x2193('0x2b')]){delete _0x43bb4f[_0x2193('0x2b')];}_0x5145f2['status'](_0x4ba028)[_0x2193('0x2c')](_0x43bb4f);};}exports[_0x2193('0x2d')]=function(_0x5b3959,_0x501c99){var _0x11711a={},_0x801b52={},_0x5c9289={'count':0x0,'rows':[]};var _0x5f0b0e=_[_0x2193('0x2e')](db[_0x2193('0x2f')][_0x2193('0x30')],function(_0x3f5056){return{'name':_0x3f5056[_0x2193('0x31')],'type':_0x3f5056[_0x2193('0x32')][_0x2193('0x33')]};});_0x801b52[_0x2193('0x34')]=_[_0x2193('0x2e')](_0x5f0b0e,_0x2193('0x2b'));_0x801b52[_0x2193('0x35')]=_['keys'](_0x5b3959[_0x2193('0x35')]);_0x801b52['filters']=_[_0x2193('0x36')](_0x801b52[_0x2193('0x34')],_0x801b52[_0x2193('0x35')]);_0x11711a[_0x2193('0x37')]=_['intersection'](_0x801b52[_0x2193('0x34')],qs[_0x2193('0x38')](_0x5b3959[_0x2193('0x35')][_0x2193('0x38')]));_0x11711a['attributes']=_0x11711a[_0x2193('0x37')][_0x2193('0x39')]?_0x11711a[_0x2193('0x37')]:_0x801b52['model'];if(!_0x5b3959[_0x2193('0x35')][_0x2193('0x3a')](_0x2193('0x3b'))){_0x11711a[_0x2193('0x21')]=qs[_0x2193('0x21')](_0x5b3959['query'][_0x2193('0x21')]);_0x11711a[_0x2193('0x1f')]=qs[_0x2193('0x1f')](_0x5b3959[_0x2193('0x35')][_0x2193('0x1f')]);}_0x11711a[_0x2193('0x3c')]=qs[_0x2193('0x3d')](_0x5b3959[_0x2193('0x35')]['sort']);_0x11711a[_0x2193('0x3e')]=qs['filters'](_[_0x2193('0x3f')](_0x5b3959[_0x2193('0x35')],_0x801b52[_0x2193('0x40')]),_0x5f0b0e);if(_0x5b3959[_0x2193('0x35')][_0x2193('0x41')]){_0x11711a[_0x2193('0x3e')]=_[_0x2193('0x42')](_0x11711a['where'],{'$or':_[_0x2193('0x2e')](_0x5f0b0e,function(_0x5878d1){if(_0x5878d1[_0x2193('0x32')]!==_0x2193('0x43')){var _0x11925c={};_0x11925c[_0x5878d1[_0x2193('0x2b')]]={'$like':'%'+_0x5b3959[_0x2193('0x35')][_0x2193('0x41')]+'%'};return _0x11925c;}})});}_0x11711a=_['merge']({},_0x11711a,_0x5b3959[_0x2193('0x44')]);var _0x418274={'where':_0x11711a['where']};return db[_0x2193('0x2f')][_0x2193('0x22')](_0x418274)['then'](function(_0x540862){_0x5c9289[_0x2193('0x22')]=_0x540862;if(_0x5b3959['query'][_0x2193('0x45')]){_0x11711a['include']=[{'all':!![]}];}return db[_0x2193('0x2f')]['findAll'](_0x11711a);})['then'](function(_0x275c0b){_0x5c9289[_0x2193('0x46')]=_0x275c0b;return _0x5c9289;})['then'](respondWithFilteredResult(_0x501c99,_0x11711a))[_0x2193('0x47')](handleError(_0x501c99,null));};exports['show']=function(_0x5a33c1,_0x360b21){var _0x93dcca={'raw':!![],'where':{'id':_0x5a33c1[_0x2193('0x48')]['id']}},_0xe0498d={};_0xe0498d[_0x2193('0x34')]=_[_0x2193('0x49')](db['ZohoField']['rawAttributes']);_0xe0498d['query']=_['keys'](_0x5a33c1[_0x2193('0x35')]);_0xe0498d[_0x2193('0x40')]=_[_0x2193('0x36')](_0xe0498d['model'],_0xe0498d[_0x2193('0x35')]);_0x93dcca[_0x2193('0x37')]=_[_0x2193('0x36')](_0xe0498d[_0x2193('0x34')],qs[_0x2193('0x38')](_0x5a33c1[_0x2193('0x35')][_0x2193('0x38')]));_0x93dcca[_0x2193('0x37')]=_0x93dcca['attributes'][_0x2193('0x39')]?_0x93dcca['attributes']:_0xe0498d[_0x2193('0x34')];if(_0x5a33c1[_0x2193('0x35')]['includeAll']){_0x93dcca['include']=[{'all':!![]}];}_0x93dcca=_[_0x2193('0x42')]({},_0x93dcca,_0x5a33c1[_0x2193('0x44')]);return db['ZohoField'][_0x2193('0x4a')](_0x93dcca)['then'](handleEntityNotFound(_0x360b21,null))[_0x2193('0x27')](respondWithResult(_0x360b21,null))[_0x2193('0x47')](handleError(_0x360b21,null));};exports[_0x2193('0x4b')]=function(_0x5b3133,_0x31fd12){return db[_0x2193('0x2f')]['create'](_0x5b3133['body'],{})['then'](respondWithResult(_0x31fd12,0xc9))['catch'](handleError(_0x31fd12,null));};exports[_0x2193('0x26')]=function(_0x2d4029,_0x1a418c){if(_0x2d4029[_0x2193('0x4c')]['id']){delete _0x2d4029[_0x2193('0x4c')]['id'];}return db['ZohoField'][_0x2193('0x4a')]({'where':{'id':_0x2d4029['params']['id']}})[_0x2193('0x27')](handleEntityNotFound(_0x1a418c,null))[_0x2193('0x27')](saveUpdates(_0x2d4029['body'],null))[_0x2193('0x27')](respondWithResult(_0x1a418c,null))[_0x2193('0x47')](handleError(_0x1a418c,null));};exports[_0x2193('0x4d')]=function(_0x264241,_0x31ab4e){return db[_0x2193('0x2f')][_0x2193('0x4a')]({'where':{'id':_0x264241[_0x2193('0x48')]['id']}})[_0x2193('0x27')](handleEntityNotFound(_0x31ab4e,null))['then'](removeEntity(_0x31ab4e,null))[_0x2193('0x47')](handleError(_0x31ab4e,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index ca93584..617836f 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 _0x4137=['path','rimraf','../../config/environment','./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x44dea3,_0x57aff8){var _0x3224ea=function(_0x569f34){while(--_0x569f34){_0x44dea3['push'](_0x44dea3['shift']());}};_0x3224ea(++_0x57aff8);}(_0x4137,0xf8));var _0x7413=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x4137[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x7413('0x0'));var util=require(_0x7413('0x1'));var logger=require(_0x7413('0x2'))(_0x7413('0x3'));var moment=require(_0x7413('0x4'));var BPromise=require(_0x7413('0x5'));var rp=require(_0x7413('0x6'));var fs=require('fs');var path=require(_0x7413('0x7'));var rimraf=require(_0x7413('0x8'));var config=require(_0x7413('0x9'));var attributes=require(_0x7413('0xa'));module[_0x7413('0xb')]=function(_0x4fbade,_0xc808cd){return _0x4fbade[_0x7413('0xc')](_0x7413('0xd'),attributes,{'tableName':_0x7413('0xe'),'paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':[_0x7413('0xf'),_0x7413('0x10')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4745=['../../config/environment','./intZohoField.attributes','exports','define','int_zoho_fields','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x186683,_0x39ea45){var _0x29e712=function(_0x4b2a65){while(--_0x4b2a65){_0x186683['push'](_0x186683['shift']());}};_0x29e712(++_0x39ea45);}(_0x4745,0x1e7));var _0x5474=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x4745[_0x55f8b4];return _0x2475f9;};'use strict';var _=require(_0x5474('0x0'));var util=require(_0x5474('0x1'));var logger=require(_0x5474('0x2'))(_0x5474('0x3'));var moment=require(_0x5474('0x4'));var BPromise=require(_0x5474('0x5'));var rp=require(_0x5474('0x6'));var fs=require('fs');var path=require(_0x5474('0x7'));var rimraf=require(_0x5474('0x8'));var config=require(_0x5474('0x9'));var attributes=require(_0x5474('0xa'));module[_0x5474('0xb')]=function(_0x4e7ce7,_0x3d1e1){return _0x4e7ce7[_0x5474('0xc')]('ZohoField',attributes,{'tableName':_0x5474('0xd'),'paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':[_0x5474('0xe'),_0x5474('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.rpc.js b/server/api/intZohoField/intZohoField.rpc.js index d69f2b3..ec721f1 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 _0xd76e=['../../config/utils','../../config/environment','jayson/promise','client','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','ioredis','../../mysqldb'];(function(_0x53b992,_0x5951ad){var _0x561d89=function(_0x42e7d0){while(--_0x42e7d0){_0x53b992['push'](_0x53b992['shift']());}};_0x561d89(++_0x5951ad);}(_0xd76e,0x94));var _0xed76=function(_0x4d9b2d,_0x9e3220){_0x4d9b2d=_0x4d9b2d-0x0;var _0xd52e5a=_0xd76e[_0x4d9b2d];return _0xd52e5a;};'use strict';var _=require(_0xed76('0x0'));var util=require(_0xed76('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xed76('0x2'));var db=require(_0xed76('0x3'))['db'];var utils=require(_0xed76('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xed76('0x5'));var jayson=require(_0xed76('0x6'));var client=jayson[_0xed76('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x45b10c,_0x143323,_0x544e4f){return new BPromise(function(_0x3fb290,_0x413ec9){return client['request'](_0x45b10c,_0x544e4f)[_0xed76('0x8')](function(_0x3c8157){logger[_0xed76('0x9')](_0xed76('0xa'),_0x143323,_0xed76('0xb'));logger[_0xed76('0xc')](_0xed76('0xd'),_0x143323,_0xed76('0xb'),JSON[_0xed76('0xe')](_0x3c8157));if(_0x3c8157[_0xed76('0xf')]){if(_0x3c8157[_0xed76('0xf')]['code']===0x1f4){logger['error'](_0xed76('0xa'),_0x143323,_0x3c8157[_0xed76('0xf')][_0xed76('0x10')]);return _0x413ec9(_0x3c8157[_0xed76('0xf')][_0xed76('0x10')]);}logger['error'](_0xed76('0xa'),_0x143323,_0x3c8157['error'][_0xed76('0x10')]);return _0x3fb290(_0x3c8157[_0xed76('0xf')][_0xed76('0x10')]);}else{logger[_0xed76('0x9')](_0xed76('0xa'),_0x143323,_0xed76('0xb'));_0x3fb290(_0x3c8157[_0xed76('0x11')][_0xed76('0x10')]);}})[_0xed76('0x12')](function(_0x466362){logger[_0xed76('0xf')](_0xed76('0xa'),_0x143323,_0x466362);_0x413ec9(_0x466362);});});} \ No newline at end of file +var _0xf34a=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','request\x20sent','debug','stringify','error','code','message','ZohoField,\x20%s,\x20%s','result','lodash','util','moment','bluebird','randomstring'];(function(_0x542749,_0x3d95bb){var _0x4612dd=function(_0x556642){while(--_0x556642){_0x542749['push'](_0x542749['shift']());}};_0x4612dd(++_0x3d95bb);}(_0xf34a,0xd7));var _0xaf34=function(_0x16468d,_0x34689e){_0x16468d=_0x16468d-0x0;var _0x499dea=_0xf34a[_0x16468d];return _0x499dea;};'use strict';var _=require(_0xaf34('0x0'));var util=require(_0xaf34('0x1'));var moment=require(_0xaf34('0x2'));var BPromise=require(_0xaf34('0x3'));var rs=require(_0xaf34('0x4'));var fs=require('fs');var Redis=require(_0xaf34('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xaf34('0x6'));var logger=require(_0xaf34('0x7'))(_0xaf34('0x8'));var config=require(_0xaf34('0x9'));var jayson=require(_0xaf34('0xa'));var client=jayson[_0xaf34('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4226a9,_0x1f54ed,_0xc80d28){return new BPromise(function(_0x3ed752,_0x1b9fa0){return client['request'](_0x4226a9,_0xc80d28)[_0xaf34('0xc')](function(_0x18ffdd){logger[_0xaf34('0xd')]('ZohoField,\x20%s,\x20%s',_0x1f54ed,_0xaf34('0xe'));logger[_0xaf34('0xf')]('ZohoField,\x20%s,\x20%s,\x20%s',_0x1f54ed,_0xaf34('0xe'),JSON[_0xaf34('0x10')](_0x18ffdd));if(_0x18ffdd[_0xaf34('0x11')]){if(_0x18ffdd['error'][_0xaf34('0x12')]===0x1f4){logger[_0xaf34('0x11')]('ZohoField,\x20%s,\x20%s',_0x1f54ed,_0x18ffdd[_0xaf34('0x11')][_0xaf34('0x13')]);return _0x1b9fa0(_0x18ffdd[_0xaf34('0x11')]['message']);}logger[_0xaf34('0x11')](_0xaf34('0x14'),_0x1f54ed,_0x18ffdd[_0xaf34('0x11')][_0xaf34('0x13')]);return _0x3ed752(_0x18ffdd[_0xaf34('0x11')][_0xaf34('0x13')]);}else{logger[_0xaf34('0xd')](_0xaf34('0x14'),_0x1f54ed,_0xaf34('0xe'));_0x3ed752(_0x18ffdd[_0xaf34('0x15')][_0xaf34('0x13')]);}})['catch'](function(_0x20ac07){logger['error'](_0xaf34('0x14'),_0x1f54ed,_0x20ac07);_0x1b9fa0(_0x20ac07);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index ef09d3a..ee3dbe8 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(_0x188165,_0x4de657){var _0x2ab64a=function(_0x2ac7d2){while(--_0x2ac7d2){_0x188165['push'](_0x188165['shift']());}};_0x2ab64a(++_0x4de657);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x1d0948,_0x29a5ad){var _0x405614=function(_0x1ac2af){while(--_0x1ac2af){_0x1d0948['push'](_0x1d0948['shift']());}};_0x405614(++_0x29a5ad);}(_0x9c44,0x178));var _0x49c4=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0x9c44[_0x15bc81];return _0x59440e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index e1f923a..8aa9feb 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 _0xbee3=['INTEGER','BOOLEAN','state','exports','STRING','unique_name_and_version','app.js'];(function(_0x354164,_0x4c30de){var _0x5db9a8=function(_0x319b08){while(--_0x319b08){_0x354164['push'](_0x354164['shift']());}};_0x5db9a8(++_0x4c30de);}(_0xbee3,0xd5));var _0x3bee=function(_0x1cba2d,_0xc65c77){_0x1cba2d=_0x1cba2d-0x0;var _0x5d90ea=_0xbee3[_0x1cba2d];return _0x5d90ea;};'use strict';var Sequelize=require('sequelize');module[_0x3bee('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0x3bee('0x1')],'allowNull':![],'unique':_0x3bee('0x2')},'main':{'type':Sequelize['STRING'],'defaultValue':_0x3bee('0x3')},'filename':{'type':Sequelize[_0x3bee('0x1')]},'path':{'type':Sequelize[_0x3bee('0x1')]},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize[_0x3bee('0x4')]},'active':{'type':Sequelize[_0x3bee('0x5')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0x3bee('0x1')]},'state':{'type':Sequelize[_0x3bee('0x1')],'unique':_0x3bee('0x6')},'description':{'type':Sequelize[_0x3bee('0x1')]},'title':{'type':Sequelize[_0x3bee('0x1')]},'remoteUri':{'type':Sequelize[_0x3bee('0x1')]},'link':{'type':Sequelize[_0x3bee('0x1')],'defaultValue':'#'}}; \ No newline at end of file +var _0x0fd7=['unique_name_and_version','STRING','app.js','INTEGER','state','sequelize','exports'];(function(_0x132a0e,_0x3956fc){var _0x5bea3b=function(_0x6d0083){while(--_0x6d0083){_0x132a0e['push'](_0x132a0e['shift']());}};_0x5bea3b(++_0x3956fc);}(_0x0fd7,0x9f));var _0x70fd=function(_0x397681,_0x2f8fa4){_0x397681=_0x397681-0x0;var _0x18d369=_0x0fd7[_0x397681];return _0x18d369;};'use strict';var Sequelize=require(_0x70fd('0x0'));module[_0x70fd('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x70fd('0x2')},'version':{'type':Sequelize[_0x70fd('0x3')],'allowNull':![],'unique':_0x70fd('0x2')},'main':{'type':Sequelize[_0x70fd('0x3')],'defaultValue':_0x70fd('0x4')},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize[_0x70fd('0x3')]},'type':{'type':Sequelize[_0x70fd('0x3')]},'size':{'type':Sequelize[_0x70fd('0x5')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize[_0x70fd('0x3')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0x70fd('0x3')],'unique':_0x70fd('0x6')},'description':{'type':Sequelize[_0x70fd('0x3')]},'title':{'type':Sequelize[_0x70fd('0x3')]},'remoteUri':{'type':Sequelize[_0x70fd('0x3')]},'link':{'type':Sequelize[_0x70fd('0x3')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 198139d..995a192 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 _0x5fab=['querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','end','sendStatus','name','send','index','map','Integration','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','includeAll','include','findAll','then','rows','show','params','intersection','fields','options','find','catch','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce'];(function(_0x4ba811,_0x4428f2){var _0x3b616f=function(_0x5cc7e1){while(--_0x5cc7e1){_0x4ba811['push'](_0x4ba811['shift']());}};_0x3b616f(++_0x4428f2);}(_0x5fab,0x177));var _0xb5fa=function(_0x2873d2,_0x3178b6){_0x2873d2=_0x2873d2-0x0;var _0x31b7c1=_0x5fab[_0x2873d2];return _0x31b7c1;};'use strict';var emlformat=require(_0xb5fa('0x0'));var rimraf=require(_0xb5fa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb5fa('0x2'));var rp=require(_0xb5fa('0x3'));var moment=require(_0xb5fa('0x4'));var BPromise=require(_0xb5fa('0x5'));var Mustache=require(_0xb5fa('0x6'));var util=require(_0xb5fa('0x7'));var path=require(_0xb5fa('0x8'));var sox=require(_0xb5fa('0x9'));var csv=require(_0xb5fa('0xa'));var ejs=require(_0xb5fa('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb5fa('0xc'));var crypto=require(_0xb5fa('0xd'));var jsforce=require(_0xb5fa('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb5fa('0xa'));var querystring=require(_0xb5fa('0xf'));var Papa=require(_0xb5fa('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb5fa('0x11'));var as=require(_0xb5fa('0x12'));var hardwareService=require(_0xb5fa('0x13'));var logger=require(_0xb5fa('0x14'))(_0xb5fa('0x15'));var utils=require(_0xb5fa('0x16'));var config=require(_0xb5fa('0x17'));var licenseUtil=require(_0xb5fa('0x18'));var db=require(_0xb5fa('0x19'))['db'];function respondWithStatusCode(_0x4d3576,_0x2ad830){_0x2ad830=_0x2ad830||0xcc;return function(_0x3dad4d){if(_0x3dad4d){return _0x4d3576['sendStatus'](_0x2ad830);}return _0x4d3576[_0xb5fa('0x1a')](_0x2ad830)['end']();};}function respondWithResult(_0x265992,_0x3fc372){_0x3fc372=_0x3fc372||0xc8;return function(_0x40c914){if(_0x40c914){return _0x265992[_0xb5fa('0x1a')](_0x3fc372)[_0xb5fa('0x1b')](_0x40c914);}};}function respondWithFilteredResult(_0x5371cf,_0x567f31){return function(_0x38e964){if(_0x38e964){var _0x587043=typeof _0x567f31[_0xb5fa('0x1c')]===_0xb5fa('0x1d')&&typeof _0x567f31['limit']==='undefined';var _0x451a55=_0x38e964[_0xb5fa('0x1e')];var _0x32e9e5=_0x587043?0x0:_0x567f31[_0xb5fa('0x1c')];var _0x324ba5=_0x587043?_0x38e964[_0xb5fa('0x1e')]:_0x567f31[_0xb5fa('0x1c')]+_0x567f31[_0xb5fa('0x1f')];var _0xc14dc4;if(_0x324ba5>=_0x451a55){_0x324ba5=_0x451a55;_0xc14dc4=0xc8;}else{_0xc14dc4=0xce;}_0x5371cf[_0xb5fa('0x1a')](_0xc14dc4);return _0x5371cf[_0xb5fa('0x20')](_0xb5fa('0x21'),_0x32e9e5+'-'+_0x324ba5+'/'+_0x451a55)['json'](_0x38e964);}return null;};}function patchUpdates(_0x432bfa){return function(_0x519e20){try{jsonpatch[_0xb5fa('0x22')](_0x519e20,_0x432bfa,!![]);}catch(_0x4a6c04){return BPromise[_0xb5fa('0x23')](_0x4a6c04);}return _0x519e20[_0xb5fa('0x24')]();};}function saveUpdates(_0x4e05c0,_0x40dfdf){return function(_0x3a2ab9){if(_0x3a2ab9){return _0x3a2ab9[_0xb5fa('0x25')](_0x4e05c0)['then'](function(_0x32a85c){return _0x32a85c;});}return null;};}function removeEntity(_0xec108f,_0x444237){return function(_0x542348){if(_0x542348){return _0x542348[_0xb5fa('0x26')]()['then'](function(){_0xec108f[_0xb5fa('0x1a')](0xcc)[_0xb5fa('0x27')]();});}};}function handleEntityNotFound(_0x11053a,_0x543edf){return function(_0x2dbd22){if(!_0x2dbd22){_0x11053a[_0xb5fa('0x28')](0x194);}return _0x2dbd22;};}function handleError(_0x6a455c,_0x20d649){_0x20d649=_0x20d649||0x1f4;return function(_0x568870){logger['error'](_0x568870['stack']);if(_0x568870['name']){delete _0x568870[_0xb5fa('0x29')];}_0x6a455c[_0xb5fa('0x1a')](_0x20d649)[_0xb5fa('0x2a')](_0x568870);};}exports[_0xb5fa('0x2b')]=function(_0x534884,_0x3506a4){var _0x358549={},_0x353314={},_0x409af9={'count':0x0,'rows':[]};var _0x2a5690=_[_0xb5fa('0x2c')](db[_0xb5fa('0x2d')][_0xb5fa('0x2e')],function(_0x1f4380){return{'name':_0x1f4380[_0xb5fa('0x2f')],'type':_0x1f4380[_0xb5fa('0x30')][_0xb5fa('0x31')]};});_0x353314[_0xb5fa('0x32')]=_[_0xb5fa('0x2c')](_0x2a5690,_0xb5fa('0x29'));_0x353314[_0xb5fa('0x33')]=_[_0xb5fa('0x34')](_0x534884[_0xb5fa('0x33')]);_0x353314[_0xb5fa('0x35')]=_['intersection'](_0x353314[_0xb5fa('0x32')],_0x353314['query']);_0x358549['attributes']=_['intersection'](_0x353314[_0xb5fa('0x32')],qs['fields'](_0x534884[_0xb5fa('0x33')]['fields']));_0x358549['attributes']=_0x358549[_0xb5fa('0x36')][_0xb5fa('0x37')]?_0x358549['attributes']:_0x353314['model'];if(!_0x534884[_0xb5fa('0x33')][_0xb5fa('0x38')](_0xb5fa('0x39'))){_0x358549['limit']=qs[_0xb5fa('0x1f')](_0x534884[_0xb5fa('0x33')]['limit']);_0x358549[_0xb5fa('0x1c')]=qs[_0xb5fa('0x1c')](_0x534884[_0xb5fa('0x33')]['offset']);}_0x358549[_0xb5fa('0x3a')]=qs[_0xb5fa('0x3b')](_0x534884[_0xb5fa('0x33')]['sort']);_0x358549[_0xb5fa('0x3c')]=qs[_0xb5fa('0x35')](_[_0xb5fa('0x3d')](_0x534884[_0xb5fa('0x33')],_0x353314['filters']),_0x2a5690);if(_0x534884['query']['filter']){_0x358549['where']=_['merge'](_0x358549['where'],{'$or':_[_0xb5fa('0x2c')](_0x2a5690,function(_0x4c0a4d){if(_0x4c0a4d[_0xb5fa('0x30')]!==_0xb5fa('0x3e')){var _0x36db1a={};_0x36db1a[_0x4c0a4d[_0xb5fa('0x29')]]={'$like':'%'+_0x534884[_0xb5fa('0x33')][_0xb5fa('0x3f')]+'%'};return _0x36db1a;}})});}_0x358549=_['merge']({},_0x358549,_0x534884['options']);var _0x4c4bf0={'where':_0x358549[_0xb5fa('0x3c')]};return db['Integration'][_0xb5fa('0x1e')](_0x4c4bf0)['then'](function(_0x58aa97){_0x409af9[_0xb5fa('0x1e')]=_0x58aa97;if(_0x534884[_0xb5fa('0x33')][_0xb5fa('0x40')]){_0x358549[_0xb5fa('0x41')]=[{'all':!![]}];}return db[_0xb5fa('0x2d')][_0xb5fa('0x42')](_0x358549);})[_0xb5fa('0x43')](function(_0x83df0b){_0x409af9[_0xb5fa('0x44')]=_0x83df0b;return _0x409af9;})[_0xb5fa('0x43')](respondWithFilteredResult(_0x3506a4,_0x358549))['catch'](handleError(_0x3506a4,null));};exports[_0xb5fa('0x45')]=function(_0x4bc9df,_0x233f90){var _0x39aac3={'raw':![],'where':{'id':_0x4bc9df[_0xb5fa('0x46')]['id']}},_0x2c7c5f={};_0x2c7c5f[_0xb5fa('0x32')]=_[_0xb5fa('0x34')](db[_0xb5fa('0x2d')][_0xb5fa('0x2e')]);_0x2c7c5f['query']=_[_0xb5fa('0x34')](_0x4bc9df[_0xb5fa('0x33')]);_0x2c7c5f['filters']=_[_0xb5fa('0x47')](_0x2c7c5f['model'],_0x2c7c5f[_0xb5fa('0x33')]);_0x39aac3[_0xb5fa('0x36')]=_['intersection'](_0x2c7c5f['model'],qs[_0xb5fa('0x48')](_0x4bc9df[_0xb5fa('0x33')][_0xb5fa('0x48')]));_0x39aac3[_0xb5fa('0x36')]=_0x39aac3[_0xb5fa('0x36')][_0xb5fa('0x37')]?_0x39aac3[_0xb5fa('0x36')]:_0x2c7c5f[_0xb5fa('0x32')];if(_0x4bc9df['query'][_0xb5fa('0x40')]){_0x39aac3[_0xb5fa('0x41')]=[{'all':!![]}];}_0x39aac3=_['merge']({},_0x39aac3,_0x4bc9df[_0xb5fa('0x49')]);return db[_0xb5fa('0x2d')][_0xb5fa('0x4a')](_0x39aac3)[_0xb5fa('0x43')](handleEntityNotFound(_0x233f90,null))[_0xb5fa('0x43')](respondWithResult(_0x233f90,null))[_0xb5fa('0x4b')](handleError(_0x233f90,null));};exports[_0xb5fa('0x4c')]=function(_0x33eb2c,_0x20f5f5){return db[_0xb5fa('0x2d')][_0xb5fa('0x4c')](_0x33eb2c[_0xb5fa('0x4d')],{})[_0xb5fa('0x43')](respondWithResult(_0x20f5f5,0xc9))[_0xb5fa('0x4b')](handleError(_0x20f5f5,null));};exports[_0xb5fa('0x25')]=function(_0x3a39f2,_0x52f5d8){if(_0x3a39f2['body']['id']){delete _0x3a39f2[_0xb5fa('0x4d')]['id'];}return db['Integration'][_0xb5fa('0x4a')]({'where':{'id':_0x3a39f2[_0xb5fa('0x46')]['id']}})['then'](handleEntityNotFound(_0x52f5d8,null))[_0xb5fa('0x43')](saveUpdates(_0x3a39f2[_0xb5fa('0x4d')],null))[_0xb5fa('0x43')](respondWithResult(_0x52f5d8,null))[_0xb5fa('0x4b')](handleError(_0x52f5d8,null));};exports[_0xb5fa('0x26')]=function(_0x3ffee0,_0x51d5f7){return db[_0xb5fa('0x2d')]['find']({'where':{'id':_0x3ffee0[_0xb5fa('0x46')]['id']}})[_0xb5fa('0x43')](handleEntityNotFound(_0x51d5f7,null))[_0xb5fa('0x43')](removeEntity(_0x51d5f7,null))['catch'](handleError(_0x51d5f7,null));}; \ No newline at end of file +var _0x1883=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','Integration','includeAll','include','findAll','params','catch','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','apply','update','then','destroy','end','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters'];(function(_0x443251,_0x2e8685){var _0x2580b8=function(_0x26c8fc){while(--_0x26c8fc){_0x443251['push'](_0x443251['shift']());}};_0x2580b8(++_0x2e8685);}(_0x1883,0xab));var _0x3188=function(_0x187df6,_0x58ed69){_0x187df6=_0x187df6-0x0;var _0x5f4e5d=_0x1883[_0x187df6];return _0x5f4e5d;};'use strict';var emlformat=require(_0x3188('0x0'));var rimraf=require(_0x3188('0x1'));var zipdir=require(_0x3188('0x2'));var jsonpatch=require(_0x3188('0x3'));var rp=require(_0x3188('0x4'));var moment=require(_0x3188('0x5'));var BPromise=require(_0x3188('0x6'));var Mustache=require(_0x3188('0x7'));var util=require(_0x3188('0x8'));var path=require(_0x3188('0x9'));var sox=require(_0x3188('0xa'));var csv=require(_0x3188('0xb'));var ejs=require(_0x3188('0xc'));var fs=require('fs');var fs_extra=require(_0x3188('0xd'));var _=require(_0x3188('0xe'));var squel=require(_0x3188('0xf'));var crypto=require(_0x3188('0x10'));var jsforce=require('jsforce');var deskjs=require(_0x3188('0x11'));var toCsv=require(_0x3188('0xb'));var querystring=require('querystring');var Papa=require(_0x3188('0x12'));var Redis=require('ioredis');var authService=require(_0x3188('0x13'));var qs=require(_0x3188('0x14'));var as=require(_0x3188('0x15'));var hardwareService=require(_0x3188('0x16'));var logger=require('../../config/logger')(_0x3188('0x17'));var utils=require(_0x3188('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3188('0x19'))['db'];function respondWithStatusCode(_0x45e94e,_0x20fef6){_0x20fef6=_0x20fef6||0xcc;return function(_0x3ae228){if(_0x3ae228){return _0x45e94e[_0x3188('0x1a')](_0x20fef6);}return _0x45e94e[_0x3188('0x1b')](_0x20fef6)['end']();};}function respondWithResult(_0x276d69,_0x5e0044){_0x5e0044=_0x5e0044||0xc8;return function(_0x4a2f36){if(_0x4a2f36){return _0x276d69[_0x3188('0x1b')](_0x5e0044)['json'](_0x4a2f36);}};}function respondWithFilteredResult(_0x54a87f,_0x32c239){return function(_0x1beead){if(_0x1beead){var _0xa2269=typeof _0x32c239[_0x3188('0x1c')]===_0x3188('0x1d')&&typeof _0x32c239[_0x3188('0x1e')]==='undefined';var _0x19cc72=_0x1beead[_0x3188('0x1f')];var _0x3f5b35=_0xa2269?0x0:_0x32c239[_0x3188('0x1c')];var _0x18a71a=_0xa2269?_0x1beead[_0x3188('0x1f')]:_0x32c239[_0x3188('0x1c')]+_0x32c239[_0x3188('0x1e')];var _0x5bcbba;if(_0x18a71a>=_0x19cc72){_0x18a71a=_0x19cc72;_0x5bcbba=0xc8;}else{_0x5bcbba=0xce;}_0x54a87f[_0x3188('0x1b')](_0x5bcbba);return _0x54a87f[_0x3188('0x20')]('Content-Range',_0x3f5b35+'-'+_0x18a71a+'/'+_0x19cc72)['json'](_0x1beead);}return null;};}function patchUpdates(_0x5d8d62){return function(_0x46a318){try{jsonpatch[_0x3188('0x21')](_0x46a318,_0x5d8d62,!![]);}catch(_0xd292b5){return BPromise['reject'](_0xd292b5);}return _0x46a318['save']();};}function saveUpdates(_0x266260,_0x461286){return function(_0x375077){if(_0x375077){return _0x375077[_0x3188('0x22')](_0x266260)[_0x3188('0x23')](function(_0x4bd5ee){return _0x4bd5ee;});}return null;};}function removeEntity(_0x30cf2c,_0x33f882){return function(_0x5a2e67){if(_0x5a2e67){return _0x5a2e67[_0x3188('0x24')]()['then'](function(){_0x30cf2c['status'](0xcc)[_0x3188('0x25')]();});}};}function handleEntityNotFound(_0x129bd7,_0x87d5a3){return function(_0x1aeaba){if(!_0x1aeaba){_0x129bd7[_0x3188('0x1a')](0x194);}return _0x1aeaba;};}function handleError(_0x2cd060,_0xe57f73){_0xe57f73=_0xe57f73||0x1f4;return function(_0x11021c){logger['error'](_0x11021c[_0x3188('0x26')]);if(_0x11021c[_0x3188('0x27')]){delete _0x11021c['name'];}_0x2cd060[_0x3188('0x1b')](_0xe57f73)[_0x3188('0x28')](_0x11021c);};}exports[_0x3188('0x29')]=function(_0x44db9a,_0x20e6aa){var _0x1f1c6f={},_0x8f810f={},_0x472926={'count':0x0,'rows':[]};var _0x57c21c=_[_0x3188('0x2a')](db['Integration'][_0x3188('0x2b')],function(_0x5623f1){return{'name':_0x5623f1[_0x3188('0x2c')],'type':_0x5623f1[_0x3188('0x2d')][_0x3188('0x2e')]};});_0x8f810f[_0x3188('0x2f')]=_[_0x3188('0x2a')](_0x57c21c,_0x3188('0x27'));_0x8f810f[_0x3188('0x30')]=_[_0x3188('0x31')](_0x44db9a[_0x3188('0x30')]);_0x8f810f[_0x3188('0x32')]=_[_0x3188('0x33')](_0x8f810f[_0x3188('0x2f')],_0x8f810f[_0x3188('0x30')]);_0x1f1c6f[_0x3188('0x34')]=_[_0x3188('0x33')](_0x8f810f[_0x3188('0x2f')],qs[_0x3188('0x35')](_0x44db9a[_0x3188('0x30')]['fields']));_0x1f1c6f[_0x3188('0x34')]=_0x1f1c6f['attributes'][_0x3188('0x36')]?_0x1f1c6f[_0x3188('0x34')]:_0x8f810f['model'];if(!_0x44db9a[_0x3188('0x30')][_0x3188('0x37')](_0x3188('0x38'))){_0x1f1c6f[_0x3188('0x1e')]=qs[_0x3188('0x1e')](_0x44db9a[_0x3188('0x30')][_0x3188('0x1e')]);_0x1f1c6f['offset']=qs['offset'](_0x44db9a[_0x3188('0x30')][_0x3188('0x1c')]);}_0x1f1c6f[_0x3188('0x39')]=qs[_0x3188('0x3a')](_0x44db9a['query'][_0x3188('0x3a')]);_0x1f1c6f[_0x3188('0x3b')]=qs[_0x3188('0x32')](_[_0x3188('0x3c')](_0x44db9a['query'],_0x8f810f[_0x3188('0x32')]),_0x57c21c);if(_0x44db9a['query'][_0x3188('0x3d')]){_0x1f1c6f['where']=_[_0x3188('0x3e')](_0x1f1c6f[_0x3188('0x3b')],{'$or':_[_0x3188('0x2a')](_0x57c21c,function(_0x2990c4){if(_0x2990c4[_0x3188('0x2d')]!==_0x3188('0x3f')){var _0x4666b2={};_0x4666b2[_0x2990c4[_0x3188('0x27')]]={'$like':'%'+_0x44db9a[_0x3188('0x30')][_0x3188('0x3d')]+'%'};return _0x4666b2;}})});}_0x1f1c6f=_['merge']({},_0x1f1c6f,_0x44db9a[_0x3188('0x40')]);var _0x2bad0f={'where':_0x1f1c6f[_0x3188('0x3b')]};return db[_0x3188('0x41')][_0x3188('0x1f')](_0x2bad0f)[_0x3188('0x23')](function(_0x5a815d){_0x472926[_0x3188('0x1f')]=_0x5a815d;if(_0x44db9a['query'][_0x3188('0x42')]){_0x1f1c6f[_0x3188('0x43')]=[{'all':!![]}];}return db[_0x3188('0x41')][_0x3188('0x44')](_0x1f1c6f);})[_0x3188('0x23')](function(_0x549ab2){_0x472926['rows']=_0x549ab2;return _0x472926;})['then'](respondWithFilteredResult(_0x20e6aa,_0x1f1c6f))['catch'](handleError(_0x20e6aa,null));};exports['show']=function(_0x763943,_0x28c224){var _0x3e5f90={'raw':![],'where':{'id':_0x763943[_0x3188('0x45')]['id']}},_0x1b40b1={};_0x1b40b1['model']=_[_0x3188('0x31')](db['Integration'][_0x3188('0x2b')]);_0x1b40b1[_0x3188('0x30')]=_[_0x3188('0x31')](_0x763943[_0x3188('0x30')]);_0x1b40b1['filters']=_[_0x3188('0x33')](_0x1b40b1[_0x3188('0x2f')],_0x1b40b1[_0x3188('0x30')]);_0x3e5f90[_0x3188('0x34')]=_[_0x3188('0x33')](_0x1b40b1['model'],qs['fields'](_0x763943[_0x3188('0x30')][_0x3188('0x35')]));_0x3e5f90['attributes']=_0x3e5f90[_0x3188('0x34')][_0x3188('0x36')]?_0x3e5f90['attributes']:_0x1b40b1[_0x3188('0x2f')];if(_0x763943[_0x3188('0x30')][_0x3188('0x42')]){_0x3e5f90[_0x3188('0x43')]=[{'all':!![]}];}_0x3e5f90=_[_0x3188('0x3e')]({},_0x3e5f90,_0x763943['options']);return db[_0x3188('0x41')]['find'](_0x3e5f90)[_0x3188('0x23')](handleEntityNotFound(_0x28c224,null))[_0x3188('0x23')](respondWithResult(_0x28c224,null))[_0x3188('0x46')](handleError(_0x28c224,null));};exports[_0x3188('0x47')]=function(_0xe4cbb0,_0x315524){return db[_0x3188('0x41')][_0x3188('0x47')](_0xe4cbb0[_0x3188('0x48')],{})[_0x3188('0x23')](respondWithResult(_0x315524,0xc9))[_0x3188('0x46')](handleError(_0x315524,null));};exports['update']=function(_0x50fd56,_0x1b012d){if(_0x50fd56['body']['id']){delete _0x50fd56[_0x3188('0x48')]['id'];}return db[_0x3188('0x41')]['find']({'where':{'id':_0x50fd56[_0x3188('0x45')]['id']}})[_0x3188('0x23')](handleEntityNotFound(_0x1b012d,null))[_0x3188('0x23')](saveUpdates(_0x50fd56[_0x3188('0x48')],null))[_0x3188('0x23')](respondWithResult(_0x1b012d,null))[_0x3188('0x46')](handleError(_0x1b012d,null));};exports[_0x3188('0x24')]=function(_0x1e3592,_0x59a177){return db[_0x3188('0x41')][_0x3188('0x49')]({'where':{'id':_0x1e3592['params']['id']}})[_0x3188('0x23')](handleEntityNotFound(_0x59a177,null))['then'](removeEntity(_0x59a177,null))[_0x3188('0x46')](handleError(_0x59a177,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 83d367a..1b3a454 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 _0x8dbc=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./integration.attributes','define','Integration','integrations','util','../../config/logger'];(function(_0x18c9f3,_0x2c5b14){var _0x21416c=function(_0x42f796){while(--_0x42f796){_0x18c9f3['push'](_0x18c9f3['shift']());}};_0x21416c(++_0x2c5b14);}(_0x8dbc,0x1ba));var _0xc8db=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x8dbc[_0x56482c];return _0x5aae7a;};'use strict';var _=require('lodash');var util=require(_0xc8db('0x0'));var logger=require(_0xc8db('0x1'))('api');var moment=require(_0xc8db('0x2'));var BPromise=require(_0xc8db('0x3'));var rp=require(_0xc8db('0x4'));var fs=require('fs');var path=require(_0xc8db('0x5'));var rimraf=require(_0xc8db('0x6'));var config=require(_0xc8db('0x7'));var attributes=require(_0xc8db('0x8'));module['exports']=function(_0x393e9f,_0x2605b2){return _0x393e9f[_0xc8db('0x9')](_0xc8db('0xa'),attributes,{'tableName':_0xc8db('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe4bf=['api','moment','bluebird','request-promise','../../config/environment','./integration.attributes','define','integrations','lodash','util','../../config/logger'];(function(_0x66e4ab,_0xd70c4f){var _0x35faf2=function(_0x1dc1bb){while(--_0x1dc1bb){_0x66e4ab['push'](_0x66e4ab['shift']());}};_0x35faf2(++_0xd70c4f);}(_0xe4bf,0x8c));var _0xfe4b=function(_0x5e3701,_0x596265){_0x5e3701=_0x5e3701-0x0;var _0x345dcf=_0xe4bf[_0x5e3701];return _0x345dcf;};'use strict';var _=require(_0xfe4b('0x0'));var util=require(_0xfe4b('0x1'));var logger=require(_0xfe4b('0x2'))(_0xfe4b('0x3'));var moment=require(_0xfe4b('0x4'));var BPromise=require(_0xfe4b('0x5'));var rp=require(_0xfe4b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xfe4b('0x7'));var attributes=require(_0xfe4b('0x8'));module['exports']=function(_0xde39c5,_0x1549b3){return _0xde39c5[_0xfe4b('0x9')]('Integration',attributes,{'tableName':_0xfe4b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index 42be56e..8424c2b 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 _0x4975=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x166742,_0x55520c){var _0xb7814a=function(_0x18feaf){while(--_0x18feaf){_0x166742['push'](_0x166742['shift']());}};_0xb7814a(++_0x55520c);}(_0x4975,0x86));var _0x5497=function(_0x5c41ce,_0x3a4597){_0x5c41ce=_0x5c41ce-0x0;var _0x26a789=_0x4975[_0x5c41ce];return _0x26a789;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var moment=require(_0x5497('0x1'));var BPromise=require(_0x5497('0x2'));var rs=require(_0x5497('0x3'));var fs=require('fs');var Redis=require(_0x5497('0x4'));var db=require(_0x5497('0x5'))['db'];var utils=require(_0x5497('0x6'));var logger=require(_0x5497('0x7'))(_0x5497('0x8'));var config=require(_0x5497('0x9'));var jayson=require(_0x5497('0xa'));var client=jayson['client'][_0x5497('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f563d,_0x1d0019,_0x674a2a){return new BPromise(function(_0x368e8b,_0x57f930){return client[_0x5497('0xc')](_0x4f563d,_0x674a2a)['then'](function(_0x1f63d8){logger[_0x5497('0xd')](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));logger[_0x5497('0x10')](_0x5497('0x11'),_0x1d0019,_0x5497('0xf'),JSON[_0x5497('0x12')](_0x1f63d8));if(_0x1f63d8['error']){if(_0x1f63d8['error']['code']===0x1f4){logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x57f930(_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);}logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x368e8b(_0x1f63d8['error'][_0x5497('0x14')]);}else{logger['info'](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));_0x368e8b(_0x1f63d8[_0x5497('0x15')][_0x5497('0x14')]);}})[_0x5497('0x16')](function(_0x4073e6){logger[_0x5497('0x13')]('Integration,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});} \ No newline at end of file +var _0x0295=['client','http','then','info','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','Integration,\x20%s,\x20%s','message','result','catch','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x30e003,_0x5d7030){var _0x2e9da2=function(_0x8c5963){while(--_0x8c5963){_0x30e003['push'](_0x30e003['shift']());}};_0x2e9da2(++_0x5d7030);}(_0x0295,0x1f0));var _0x5029=function(_0x32d1ae,_0x575e52){_0x32d1ae=_0x32d1ae-0x0;var _0x49cf0b=_0x0295[_0x32d1ae];return _0x49cf0b;};'use strict';var _=require(_0x5029('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5029('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5029('0x2'))['db'];var utils=require(_0x5029('0x3'));var logger=require(_0x5029('0x4'))(_0x5029('0x5'));var config=require(_0x5029('0x6'));var jayson=require(_0x5029('0x7'));var client=jayson[_0x5029('0x8')][_0x5029('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b3cd,_0x502a62,_0x54978f){return new BPromise(function(_0x4ee867,_0xf4459b){return client['request'](_0x5b3cd,_0x54978f)[_0x5029('0xa')](function(_0x5bccfc){logger[_0x5029('0xb')]('Integration,\x20%s,\x20%s',_0x502a62,_0x5029('0xc'));logger[_0x5029('0xd')](_0x5029('0xe'),_0x502a62,'request\x20sent',JSON[_0x5029('0xf')](_0x5bccfc));if(_0x5bccfc[_0x5029('0x10')]){if(_0x5bccfc[_0x5029('0x10')]['code']===0x1f4){logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x5bccfc['error']['message']);return _0xf4459b(_0x5bccfc['error']['message']);}logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x5bccfc[_0x5029('0x10')][_0x5029('0x12')]);return _0x4ee867(_0x5bccfc[_0x5029('0x10')][_0x5029('0x12')]);}else{logger[_0x5029('0xb')](_0x5029('0x11'),_0x502a62,_0x5029('0xc'));_0x4ee867(_0x5bccfc[_0x5029('0x13')][_0x5029('0x12')]);}})[_0x5029('0x14')](function(_0x3786b5){logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x3786b5);_0xf4459b(_0x3786b5);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index ff7469d..66dd131 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 _0x9f0e=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','/describe','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','multer','util'];(function(_0x6a0266,_0x1552d6){var _0x309e00=function(_0x17c1d1){while(--_0x17c1d1){_0x6a0266['push'](_0x6a0266['shift']());}};_0x309e00(++_0x1552d6);}(_0x9f0e,0x116));var _0xe9f0=function(_0x31093c,_0xc15b35){_0x31093c=_0x31093c-0x0;var _0x4ecd8a=_0x9f0e[_0x31093c];return _0x4ecd8a;};'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('0xe')]('/',auth[_0xe9f0('0xb')](),controller[_0xe9f0('0xf')]);router[_0xe9f0('0x10')](_0xe9f0('0xc'),auth['isAuthenticated'](),controller[_0xe9f0('0x11')]);router[_0xe9f0('0x12')](_0xe9f0('0xc'),auth['isAuthenticated'](),controller[_0xe9f0('0x13')]);module['exports']=router; \ No newline at end of file +var _0xe2fe=['describe','/:id','post','update','destroy','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe'];(function(_0x4bf96c,_0x4d24fd){var _0x281d09=function(_0x56538e){while(--_0x56538e){_0x4bf96c['push'](_0x4bf96c['shift']());}};_0x281d09(++_0x4d24fd);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xee2f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xee2f('0x1'));var express=require('express');var router=express[_0xee2f('0x2')]();var fs_extra=require(_0xee2f('0x3'));var auth=require(_0xee2f('0x4'));var interaction=require(_0xee2f('0x5'));var config=require(_0xee2f('0x6'));var controller=require('./integrationReport.controller');router[_0xee2f('0x7')]('/',auth[_0xee2f('0x8')](),controller['index']);router[_0xee2f('0x7')](_0xee2f('0x9'),auth['isAuthenticated'](),controller[_0xee2f('0xa')]);router['get'](_0xee2f('0xb'),auth[_0xee2f('0x8')](),controller['show']);router[_0xee2f('0xc')]('/',auth[_0xee2f('0x8')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0xee2f('0xd')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xee2f('0xe')]);module[_0xee2f('0xf')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 0362fd7..85cc5cb 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 _0xf064=['BOOLEAN','INTEGER','TEXT','SENT','SENDING','RECEIVED','sequelize','STRING','DATE'];(function(_0x212545,_0x4bdb57){var _0xfec06c=function(_0x1b7c7e){while(--_0x1b7c7e){_0x212545['push'](_0x212545['shift']());}};_0xfec06c(++_0x4bdb57);}(_0xf064,0x69));var _0x4f06=function(_0x58a4fe,_0x11d439){_0x58a4fe=_0x58a4fe-0x0;var _0x697de2=_0xf064[_0x58a4fe];return _0x697de2;};'use strict';var Sequelize=require(_0x4f06('0x0'));module['exports']={'integration':{'type':Sequelize[_0x4f06('0x1')]},'eventChannel':{'type':Sequelize[_0x4f06('0x1')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize[_0x4f06('0x1')]},'uniqueid':{'type':Sequelize[_0x4f06('0x1')]},'calleridnum':{'type':Sequelize[_0x4f06('0x1')]},'calleridname':{'type':Sequelize[_0x4f06('0x1')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x4f06('0x1')]},'membername':{'type':Sequelize[_0x4f06('0x1')]},'agentcalledAt':{'type':Sequelize[_0x4f06('0x2')]},'agentconnectAt':{'type':Sequelize[_0x4f06('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x4f06('0x3')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x4f06('0x2')]},'talktime':{'type':Sequelize[_0x4f06('0x4')]},'agentacw':{'type':Sequelize[_0x4f06('0x3')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x4f06('0x1')]},'agentringnoanswer':{'type':Sequelize[_0x4f06('0x3')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x4f06('0x2')]},'agentdump':{'type':Sequelize[_0x4f06('0x3')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x4f06('0x2')]},'lastevent':{'type':Sequelize[_0x4f06('0x1')]},'channel':{'type':Sequelize[_0x4f06('0x1')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x4f06('0x1')]},'connectedlinenum':{'type':Sequelize[_0x4f06('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x4f06('0x1')]},'accountcode':{'type':Sequelize[_0x4f06('0x1')]},'context':{'type':Sequelize[_0x4f06('0x1')]},'exten':{'type':Sequelize[_0x4f06('0x1')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x4f06('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x4f06('0x1')]},'destcalleridnum':{'type':Sequelize[_0x4f06('0x1')]},'destcalleridname':{'type':Sequelize[_0x4f06('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x4f06('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x4f06('0x1')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x4f06('0x1')]},'destcontext':{'type':Sequelize[_0x4f06('0x1')]},'destexten':{'type':Sequelize[_0x4f06('0x1')]},'destpriority':{'type':Sequelize[_0x4f06('0x1')]},'destuniqueid':{'type':Sequelize[_0x4f06('0x1')]},'messageId':{'type':Sequelize[_0x4f06('0x1')]},'inReplyTo':{'type':Sequelize[_0x4f06('0x1')]},'subject':{'type':Sequelize[_0x4f06('0x1')]},'from':{'type':Sequelize[_0x4f06('0x1')]},'to':{'type':Sequelize[_0x4f06('0x1')]},'cc':{'type':Sequelize[_0x4f06('0x1')]},'attachment':{'type':Sequelize[_0x4f06('0x5')]},'html':{'type':Sequelize[_0x4f06('0x5')]},'text':{'type':Sequelize[_0x4f06('0x5')]},'status':{'type':Sequelize['ENUM'](_0x4f06('0x6'),_0x4f06('0x7'),_0x4f06('0x8'),'FAILED')},'url':{'type':Sequelize[_0x4f06('0x1')]},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize[_0x4f06('0x1')]},'projectId':{'type':Sequelize[_0x4f06('0x4')]}}; \ No newline at end of file +var _0xa9b8=['TEXT','SENT','FAILED','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN'];(function(_0x51639a,_0x35f006){var _0x3abae4=function(_0x89b35e){while(--_0x89b35e){_0x51639a['push'](_0x51639a['shift']());}};_0x3abae4(++_0x35f006);}(_0xa9b8,0x12c));var _0x8a9b=function(_0x20bf2b,_0xf0803){_0x20bf2b=_0x20bf2b-0x0;var _0x4c962f=_0xa9b8[_0x20bf2b];return _0x4c962f;};'use strict';var Sequelize=require(_0x8a9b('0x0'));module[_0x8a9b('0x1')]={'integration':{'type':Sequelize[_0x8a9b('0x2')]},'eventChannel':{'type':Sequelize[_0x8a9b('0x2')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0x8a9b('0x3')]},'contacts':{'type':Sequelize[_0x8a9b('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x8a9b('0x2')]},'calleridname':{'type':Sequelize[_0x8a9b('0x2')]},'queue':{'type':Sequelize[_0x8a9b('0x2')]},'interface':{'type':Sequelize[_0x8a9b('0x2')]},'membername':{'type':Sequelize[_0x8a9b('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x8a9b('0x4')]},'holdtime':{'type':Sequelize[_0x8a9b('0x3')]},'agentcomplete':{'type':Sequelize[_0x8a9b('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x8a9b('0x4')]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0x8a9b('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x8a9b('0x3')]},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize[_0x8a9b('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x8a9b('0x4')]},'agentdump':{'type':Sequelize[_0x8a9b('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x8a9b('0x4')]},'lastevent':{'type':Sequelize[_0x8a9b('0x2')]},'channel':{'type':Sequelize[_0x8a9b('0x2')]},'channelstate':{'type':Sequelize[_0x8a9b('0x3')]},'channelstatedesc':{'type':Sequelize[_0x8a9b('0x2')]},'connectedlinenum':{'type':Sequelize[_0x8a9b('0x2')]},'connectedlinename':{'type':Sequelize[_0x8a9b('0x2')]},'language':{'type':Sequelize[_0x8a9b('0x2')]},'accountcode':{'type':Sequelize[_0x8a9b('0x2')]},'context':{'type':Sequelize[_0x8a9b('0x2')]},'exten':{'type':Sequelize[_0x8a9b('0x2')]},'priority':{'type':Sequelize[_0x8a9b('0x2')]},'destchannel':{'type':Sequelize[_0x8a9b('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x8a9b('0x2')]},'destcalleridnum':{'type':Sequelize[_0x8a9b('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x8a9b('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x8a9b('0x2')]},'destlanguage':{'type':Sequelize[_0x8a9b('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x8a9b('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x8a9b('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize[_0x8a9b('0x2')]},'inReplyTo':{'type':Sequelize[_0x8a9b('0x2')]},'subject':{'type':Sequelize[_0x8a9b('0x2')]},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x8a9b('0x2')]},'cc':{'type':Sequelize[_0x8a9b('0x2')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0x8a9b('0x6')]},'text':{'type':Sequelize[_0x8a9b('0x6')]},'status':{'type':Sequelize['ENUM'](_0x8a9b('0x7'),'SENDING','RECEIVED',_0x8a9b('0x8'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0x8a9b('0x2')]},'appdata':{'type':Sequelize[_0x8a9b('0x2')]},'projectId':{'type':Sequelize[_0x8a9b('0x3')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 541b107..57cee28 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 _0x9e6c=['fields','query','length','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','includeAll','create','update','body','find','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','error','stack','send','index','map','IntegrationReport','type','key','name','keys','filters','intersection','model','attributes'];(function(_0xf96912,_0x1308ef){var _0x261213=function(_0x543217){while(--_0x543217){_0xf96912['push'](_0xf96912['shift']());}};_0x261213(++_0x1308ef);}(_0x9e6c,0x64));var _0xc9e6=function(_0x3d2bf2,_0x506413){_0x3d2bf2=_0x3d2bf2-0x0;var _0x4952de=_0x9e6c[_0x3d2bf2];return _0x4952de;};'use strict';var emlformat=require(_0xc9e6('0x0'));var rimraf=require(_0xc9e6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc9e6('0x2'));var rp=require(_0xc9e6('0x3'));var moment=require(_0xc9e6('0x4'));var BPromise=require(_0xc9e6('0x5'));var Mustache=require(_0xc9e6('0x6'));var util=require('util');var path=require(_0xc9e6('0x7'));var sox=require(_0xc9e6('0x8'));var csv=require(_0xc9e6('0x9'));var ejs=require(_0xc9e6('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc9e6('0xb'));var crypto=require(_0xc9e6('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xc9e6('0xd'));var toCsv=require(_0xc9e6('0x9'));var querystring=require('querystring');var Papa=require(_0xc9e6('0xe'));var Redis=require(_0xc9e6('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xc9e6('0x10'));var as=require(_0xc9e6('0x11'));var hardwareService=require(_0xc9e6('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xc9e6('0x13'));var config=require(_0xc9e6('0x14'));var licenseUtil=require(_0xc9e6('0x15'));var db=require(_0xc9e6('0x16'))['db'];function respondWithStatusCode(_0x1d4927,_0x518f35){_0x518f35=_0x518f35||0xcc;return function(_0x86f460){if(_0x86f460){return _0x1d4927[_0xc9e6('0x17')](_0x518f35);}return _0x1d4927[_0xc9e6('0x18')](_0x518f35)[_0xc9e6('0x19')]();};}function respondWithResult(_0x25572e,_0x4a0dc7){_0x4a0dc7=_0x4a0dc7||0xc8;return function(_0x2230cb){if(_0x2230cb){return _0x25572e['status'](_0x4a0dc7)['json'](_0x2230cb);}};}function respondWithFilteredResult(_0x213611,_0x16ab5d){return function(_0x406211){if(_0x406211){var _0x2f9b66=typeof _0x16ab5d[_0xc9e6('0x1a')]===_0xc9e6('0x1b')&&typeof _0x16ab5d[_0xc9e6('0x1c')]===_0xc9e6('0x1b');var _0x53e85c=_0x406211['count'];var _0x3a3e97=_0x2f9b66?0x0:_0x16ab5d['offset'];var _0x55d004=_0x2f9b66?_0x406211[_0xc9e6('0x1d')]:_0x16ab5d[_0xc9e6('0x1a')]+_0x16ab5d['limit'];var _0x4f5c92;if(_0x55d004>=_0x53e85c){_0x55d004=_0x53e85c;_0x4f5c92=0xc8;}else{_0x4f5c92=0xce;}_0x213611[_0xc9e6('0x18')](_0x4f5c92);return _0x213611[_0xc9e6('0x1e')](_0xc9e6('0x1f'),_0x3a3e97+'-'+_0x55d004+'/'+_0x53e85c)['json'](_0x406211);}return null;};}function patchUpdates(_0x54b6db){return function(_0x36349d){try{jsonpatch[_0xc9e6('0x20')](_0x36349d,_0x54b6db,!![]);}catch(_0x5dee95){return BPromise[_0xc9e6('0x21')](_0x5dee95);}return _0x36349d[_0xc9e6('0x22')]();};}function saveUpdates(_0x15dc12,_0x175420){return function(_0x35d800){if(_0x35d800){return _0x35d800['update'](_0x15dc12)[_0xc9e6('0x23')](function(_0x446319){return _0x446319;});}return null;};}function removeEntity(_0x2f2b3f,_0x120145){return function(_0x1bb090){if(_0x1bb090){return _0x1bb090['destroy']()[_0xc9e6('0x23')](function(){_0x2f2b3f[_0xc9e6('0x18')](0xcc)[_0xc9e6('0x19')]();});}};}function handleEntityNotFound(_0x3a3a78,_0x3381e6){return function(_0x21b651){if(!_0x21b651){_0x3a3a78[_0xc9e6('0x17')](0x194);}return _0x21b651;};}function handleError(_0x44be1e,_0x17930d){_0x17930d=_0x17930d||0x1f4;return function(_0x6a2bad){logger[_0xc9e6('0x24')](_0x6a2bad[_0xc9e6('0x25')]);if(_0x6a2bad['name']){delete _0x6a2bad['name'];}_0x44be1e[_0xc9e6('0x18')](_0x17930d)[_0xc9e6('0x26')](_0x6a2bad);};}exports[_0xc9e6('0x27')]=function(_0x1d935a,_0x791bb2){var _0x58cdf1={},_0x3efe39={},_0x44f892={'count':0x0,'rows':[]};var _0x34ff7=_[_0xc9e6('0x28')](db[_0xc9e6('0x29')]['rawAttributes'],function(_0x4e1908){return{'name':_0x4e1908['fieldName'],'type':_0x4e1908[_0xc9e6('0x2a')][_0xc9e6('0x2b')]};});_0x3efe39['model']=_['map'](_0x34ff7,_0xc9e6('0x2c'));_0x3efe39['query']=_[_0xc9e6('0x2d')](_0x1d935a['query']);_0x3efe39[_0xc9e6('0x2e')]=_[_0xc9e6('0x2f')](_0x3efe39[_0xc9e6('0x30')],_0x3efe39['query']);_0x58cdf1[_0xc9e6('0x31')]=_[_0xc9e6('0x2f')](_0x3efe39[_0xc9e6('0x30')],qs[_0xc9e6('0x32')](_0x1d935a[_0xc9e6('0x33')]['fields']));_0x58cdf1[_0xc9e6('0x31')]=_0x58cdf1[_0xc9e6('0x31')][_0xc9e6('0x34')]?_0x58cdf1[_0xc9e6('0x31')]:_0x3efe39[_0xc9e6('0x30')];if(!_0x1d935a[_0xc9e6('0x33')]['hasOwnProperty'](_0xc9e6('0x35'))){_0x58cdf1[_0xc9e6('0x1c')]=qs[_0xc9e6('0x1c')](_0x1d935a[_0xc9e6('0x33')][_0xc9e6('0x1c')]);_0x58cdf1[_0xc9e6('0x1a')]=qs['offset'](_0x1d935a[_0xc9e6('0x33')][_0xc9e6('0x1a')]);}_0x58cdf1[_0xc9e6('0x36')]=qs[_0xc9e6('0x37')](_0x1d935a[_0xc9e6('0x33')][_0xc9e6('0x37')]);_0x58cdf1['where']=qs[_0xc9e6('0x2e')](_[_0xc9e6('0x38')](_0x1d935a[_0xc9e6('0x33')],_0x3efe39[_0xc9e6('0x2e')]),_0x34ff7);if(_0x1d935a[_0xc9e6('0x33')]['filter']){_0x58cdf1[_0xc9e6('0x39')]=_[_0xc9e6('0x3a')](_0x58cdf1['where'],{'$or':_[_0xc9e6('0x28')](_0x34ff7,function(_0x51aed6){if(_0x51aed6[_0xc9e6('0x2a')]!==_0xc9e6('0x3b')){var _0x3c986f={};_0x3c986f[_0x51aed6[_0xc9e6('0x2c')]]={'$like':'%'+_0x1d935a[_0xc9e6('0x33')][_0xc9e6('0x3c')]+'%'};return _0x3c986f;}})});}_0x58cdf1=_[_0xc9e6('0x3a')]({},_0x58cdf1,_0x1d935a[_0xc9e6('0x3d')]);var _0x4d8d28={'where':_0x58cdf1['where']};return db[_0xc9e6('0x29')][_0xc9e6('0x1d')](_0x4d8d28)[_0xc9e6('0x23')](function(_0x34ba1c){_0x44f892[_0xc9e6('0x1d')]=_0x34ba1c;if(_0x1d935a[_0xc9e6('0x33')]['includeAll']){_0x58cdf1[_0xc9e6('0x3e')]=[{'all':!![]}];}return db[_0xc9e6('0x29')][_0xc9e6('0x3f')](_0x58cdf1);})['then'](function(_0x3995d6){_0x44f892[_0xc9e6('0x40')]=_0x3995d6;return _0x44f892;})[_0xc9e6('0x23')](respondWithFilteredResult(_0x791bb2,_0x58cdf1))[_0xc9e6('0x41')](handleError(_0x791bb2,null));};exports[_0xc9e6('0x42')]=function(_0x18b7f7,_0x3f1823){var _0x3c95fe={'raw':![],'where':{'id':_0x18b7f7[_0xc9e6('0x43')]['id']}},_0x5b1f51={};_0x5b1f51[_0xc9e6('0x30')]=_[_0xc9e6('0x2d')](db['IntegrationReport']['rawAttributes']);_0x5b1f51[_0xc9e6('0x33')]=_['keys'](_0x18b7f7[_0xc9e6('0x33')]);_0x5b1f51[_0xc9e6('0x2e')]=_[_0xc9e6('0x2f')](_0x5b1f51[_0xc9e6('0x30')],_0x5b1f51[_0xc9e6('0x33')]);_0x3c95fe[_0xc9e6('0x31')]=_[_0xc9e6('0x2f')](_0x5b1f51[_0xc9e6('0x30')],qs[_0xc9e6('0x32')](_0x18b7f7[_0xc9e6('0x33')][_0xc9e6('0x32')]));_0x3c95fe[_0xc9e6('0x31')]=_0x3c95fe[_0xc9e6('0x31')][_0xc9e6('0x34')]?_0x3c95fe[_0xc9e6('0x31')]:_0x5b1f51['model'];if(_0x18b7f7['query'][_0xc9e6('0x44')]){_0x3c95fe[_0xc9e6('0x3e')]=[{'all':!![]}];}_0x3c95fe=_[_0xc9e6('0x3a')]({},_0x3c95fe,_0x18b7f7[_0xc9e6('0x3d')]);return db[_0xc9e6('0x29')]['find'](_0x3c95fe)['then'](handleEntityNotFound(_0x3f1823,null))[_0xc9e6('0x23')](respondWithResult(_0x3f1823,null))[_0xc9e6('0x41')](handleError(_0x3f1823,null));};exports[_0xc9e6('0x45')]=function(_0x1231b3,_0x4d7ea2){return db[_0xc9e6('0x29')][_0xc9e6('0x45')](_0x1231b3['body'],{})[_0xc9e6('0x23')](respondWithResult(_0x4d7ea2,0xc9))[_0xc9e6('0x41')](handleError(_0x4d7ea2,null));};exports[_0xc9e6('0x46')]=function(_0x448f82,_0x36b305){if(_0x448f82[_0xc9e6('0x47')]['id']){delete _0x448f82[_0xc9e6('0x47')]['id'];}return db[_0xc9e6('0x29')][_0xc9e6('0x48')]({'where':{'id':_0x448f82[_0xc9e6('0x43')]['id']}})[_0xc9e6('0x23')](handleEntityNotFound(_0x36b305,null))[_0xc9e6('0x23')](saveUpdates(_0x448f82[_0xc9e6('0x47')],null))[_0xc9e6('0x23')](respondWithResult(_0x36b305,null))[_0xc9e6('0x41')](handleError(_0x36b305,null));};exports[_0xc9e6('0x49')]=function(_0x11aff2,_0x471295){return db[_0xc9e6('0x29')][_0xc9e6('0x48')]({'where':{'id':_0x11aff2[_0xc9e6('0x43')]['id']}})['then'](handleEntityNotFound(_0x471295,null))[_0xc9e6('0x23')](removeEntity(_0x471295,null))[_0xc9e6('0x41')](handleError(_0x471295,null));};exports['describe']=function(_0x22af16,_0x7bcd6a){return db[_0xc9e6('0x29')][_0xc9e6('0x4a')]()[_0xc9e6('0x23')](respondWithResult(_0x7bcd6a,null))['catch'](handleError(_0x7bcd6a,null));}; \ No newline at end of file +var _0xc012=['then','end','error','stack','name','send','index','map','IntegrationReport','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','includeAll','include','findAll','rows','show','params','keys','options','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','sox','ejs','fs-extra','squel','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','offset','count','apply','reject','save','update','destroy'];(function(_0x33a658,_0x4f2222){var _0x570a3a=function(_0xf85bff){while(--_0xf85bff){_0x33a658['push'](_0x33a658['shift']());}};_0x570a3a(++_0x4f2222);}(_0xc012,0x71));var _0x2c01=function(_0x56d896,_0x3b4c9c){_0x56d896=_0x56d896-0x0;var _0x293639=_0xc012[_0x56d896];return _0x293639;};'use strict';var emlformat=require(_0x2c01('0x0'));var rimraf=require(_0x2c01('0x1'));var zipdir=require(_0x2c01('0x2'));var jsonpatch=require(_0x2c01('0x3'));var rp=require(_0x2c01('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2c01('0x5'));var path=require('path');var sox=require(_0x2c01('0x6'));var csv=require('to-csv');var ejs=require(_0x2c01('0x7'));var fs=require('fs');var fs_extra=require(_0x2c01('0x8'));var _=require('lodash');var squel=require(_0x2c01('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2c01('0xa'));var toCsv=require(_0x2c01('0xb'));var querystring=require(_0x2c01('0xc'));var Papa=require('papaparse');var Redis=require(_0x2c01('0xd'));var authService=require(_0x2c01('0xe'));var qs=require(_0x2c01('0xf'));var as=require(_0x2c01('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x2c01('0x11'));var config=require(_0x2c01('0x12'));var licenseUtil=require(_0x2c01('0x13'));var db=require(_0x2c01('0x14'))['db'];function respondWithStatusCode(_0x3fc073,_0x4ece45){_0x4ece45=_0x4ece45||0xcc;return function(_0x819979){if(_0x819979){return _0x3fc073[_0x2c01('0x15')](_0x4ece45);}return _0x3fc073[_0x2c01('0x16')](_0x4ece45)['end']();};}function respondWithResult(_0x44d304,_0x1544d6){_0x1544d6=_0x1544d6||0xc8;return function(_0x55052d){if(_0x55052d){return _0x44d304['status'](_0x1544d6)[_0x2c01('0x17')](_0x55052d);}};}function respondWithFilteredResult(_0x327ca4,_0x1b02d0){return function(_0xe698ec){if(_0xe698ec){var _0x3253af=typeof _0x1b02d0['offset']===_0x2c01('0x18')&&typeof _0x1b02d0[_0x2c01('0x19')]===_0x2c01('0x18');var _0x3958f5=_0xe698ec['count'];var _0x33ea0e=_0x3253af?0x0:_0x1b02d0[_0x2c01('0x1a')];var _0xba3dd=_0x3253af?_0xe698ec[_0x2c01('0x1b')]:_0x1b02d0['offset']+_0x1b02d0['limit'];var _0x467b7a;if(_0xba3dd>=_0x3958f5){_0xba3dd=_0x3958f5;_0x467b7a=0xc8;}else{_0x467b7a=0xce;}_0x327ca4[_0x2c01('0x16')](_0x467b7a);return _0x327ca4['set']('Content-Range',_0x33ea0e+'-'+_0xba3dd+'/'+_0x3958f5)['json'](_0xe698ec);}return null;};}function patchUpdates(_0x353e1d){return function(_0x356049){try{jsonpatch[_0x2c01('0x1c')](_0x356049,_0x353e1d,!![]);}catch(_0x527d4f){return BPromise[_0x2c01('0x1d')](_0x527d4f);}return _0x356049[_0x2c01('0x1e')]();};}function saveUpdates(_0x2ac45d,_0x3e029a){return function(_0x55411f){if(_0x55411f){return _0x55411f[_0x2c01('0x1f')](_0x2ac45d)['then'](function(_0x186eb9){return _0x186eb9;});}return null;};}function removeEntity(_0x442e36,_0x115715){return function(_0x366df3){if(_0x366df3){return _0x366df3[_0x2c01('0x20')]()[_0x2c01('0x21')](function(){_0x442e36[_0x2c01('0x16')](0xcc)[_0x2c01('0x22')]();});}};}function handleEntityNotFound(_0xb22aa6,_0x217894){return function(_0x523412){if(!_0x523412){_0xb22aa6[_0x2c01('0x15')](0x194);}return _0x523412;};}function handleError(_0x115946,_0x414c7a){_0x414c7a=_0x414c7a||0x1f4;return function(_0x1f0f10){logger[_0x2c01('0x23')](_0x1f0f10[_0x2c01('0x24')]);if(_0x1f0f10[_0x2c01('0x25')]){delete _0x1f0f10[_0x2c01('0x25')];}_0x115946[_0x2c01('0x16')](_0x414c7a)[_0x2c01('0x26')](_0x1f0f10);};}exports[_0x2c01('0x27')]=function(_0x4825d1,_0x508117){var _0x3758b8={},_0x24a23d={},_0x56049b={'count':0x0,'rows':[]};var _0x57a17b=_[_0x2c01('0x28')](db[_0x2c01('0x29')][_0x2c01('0x2a')],function(_0x3b2f23){return{'name':_0x3b2f23['fieldName'],'type':_0x3b2f23['type'][_0x2c01('0x2b')]};});_0x24a23d[_0x2c01('0x2c')]=_[_0x2c01('0x28')](_0x57a17b,_0x2c01('0x25'));_0x24a23d[_0x2c01('0x2d')]=_['keys'](_0x4825d1[_0x2c01('0x2d')]);_0x24a23d[_0x2c01('0x2e')]=_[_0x2c01('0x2f')](_0x24a23d[_0x2c01('0x2c')],_0x24a23d['query']);_0x3758b8[_0x2c01('0x30')]=_[_0x2c01('0x2f')](_0x24a23d[_0x2c01('0x2c')],qs['fields'](_0x4825d1['query'][_0x2c01('0x31')]));_0x3758b8[_0x2c01('0x30')]=_0x3758b8[_0x2c01('0x30')][_0x2c01('0x32')]?_0x3758b8[_0x2c01('0x30')]:_0x24a23d[_0x2c01('0x2c')];if(!_0x4825d1[_0x2c01('0x2d')][_0x2c01('0x33')](_0x2c01('0x34'))){_0x3758b8[_0x2c01('0x19')]=qs[_0x2c01('0x19')](_0x4825d1[_0x2c01('0x2d')][_0x2c01('0x19')]);_0x3758b8['offset']=qs['offset'](_0x4825d1[_0x2c01('0x2d')][_0x2c01('0x1a')]);}_0x3758b8[_0x2c01('0x35')]=qs[_0x2c01('0x36')](_0x4825d1[_0x2c01('0x2d')]['sort']);_0x3758b8[_0x2c01('0x37')]=qs[_0x2c01('0x2e')](_[_0x2c01('0x38')](_0x4825d1[_0x2c01('0x2d')],_0x24a23d[_0x2c01('0x2e')]),_0x57a17b);if(_0x4825d1[_0x2c01('0x2d')][_0x2c01('0x39')]){_0x3758b8['where']=_[_0x2c01('0x3a')](_0x3758b8[_0x2c01('0x37')],{'$or':_[_0x2c01('0x28')](_0x57a17b,function(_0x38ff10){if(_0x38ff10[_0x2c01('0x3b')]!=='VIRTUAL'){var _0x1c2a6e={};_0x1c2a6e[_0x38ff10[_0x2c01('0x25')]]={'$like':'%'+_0x4825d1[_0x2c01('0x2d')][_0x2c01('0x39')]+'%'};return _0x1c2a6e;}})});}_0x3758b8=_['merge']({},_0x3758b8,_0x4825d1['options']);var _0x1d0843={'where':_0x3758b8[_0x2c01('0x37')]};return db[_0x2c01('0x29')]['count'](_0x1d0843)[_0x2c01('0x21')](function(_0x1be9c5){_0x56049b[_0x2c01('0x1b')]=_0x1be9c5;if(_0x4825d1[_0x2c01('0x2d')][_0x2c01('0x3c')]){_0x3758b8[_0x2c01('0x3d')]=[{'all':!![]}];}return db[_0x2c01('0x29')][_0x2c01('0x3e')](_0x3758b8);})['then'](function(_0x549d48){_0x56049b[_0x2c01('0x3f')]=_0x549d48;return _0x56049b;})[_0x2c01('0x21')](respondWithFilteredResult(_0x508117,_0x3758b8))['catch'](handleError(_0x508117,null));};exports[_0x2c01('0x40')]=function(_0x29caa9,_0x46b026){var _0x3c3401={'raw':![],'where':{'id':_0x29caa9[_0x2c01('0x41')]['id']}},_0x1fac39={};_0x1fac39[_0x2c01('0x2c')]=_[_0x2c01('0x42')](db['IntegrationReport'][_0x2c01('0x2a')]);_0x1fac39['query']=_[_0x2c01('0x42')](_0x29caa9[_0x2c01('0x2d')]);_0x1fac39['filters']=_[_0x2c01('0x2f')](_0x1fac39[_0x2c01('0x2c')],_0x1fac39['query']);_0x3c3401[_0x2c01('0x30')]=_['intersection'](_0x1fac39['model'],qs['fields'](_0x29caa9[_0x2c01('0x2d')][_0x2c01('0x31')]));_0x3c3401['attributes']=_0x3c3401[_0x2c01('0x30')][_0x2c01('0x32')]?_0x3c3401['attributes']:_0x1fac39[_0x2c01('0x2c')];if(_0x29caa9[_0x2c01('0x2d')][_0x2c01('0x3c')]){_0x3c3401[_0x2c01('0x3d')]=[{'all':!![]}];}_0x3c3401=_[_0x2c01('0x3a')]({},_0x3c3401,_0x29caa9[_0x2c01('0x43')]);return db[_0x2c01('0x29')][_0x2c01('0x44')](_0x3c3401)[_0x2c01('0x21')](handleEntityNotFound(_0x46b026,null))[_0x2c01('0x21')](respondWithResult(_0x46b026,null))[_0x2c01('0x45')](handleError(_0x46b026,null));};exports['create']=function(_0xff42eb,_0x50ae1e){return db['IntegrationReport'][_0x2c01('0x46')](_0xff42eb[_0x2c01('0x47')],{})[_0x2c01('0x21')](respondWithResult(_0x50ae1e,0xc9))[_0x2c01('0x45')](handleError(_0x50ae1e,null));};exports[_0x2c01('0x1f')]=function(_0x267aaf,_0x371ac9){if(_0x267aaf[_0x2c01('0x47')]['id']){delete _0x267aaf['body']['id'];}return db['IntegrationReport'][_0x2c01('0x44')]({'where':{'id':_0x267aaf[_0x2c01('0x41')]['id']}})['then'](handleEntityNotFound(_0x371ac9,null))[_0x2c01('0x21')](saveUpdates(_0x267aaf[_0x2c01('0x47')],null))[_0x2c01('0x21')](respondWithResult(_0x371ac9,null))[_0x2c01('0x45')](handleError(_0x371ac9,null));};exports[_0x2c01('0x20')]=function(_0x3987b9,_0x37f910){return db[_0x2c01('0x29')][_0x2c01('0x44')]({'where':{'id':_0x3987b9[_0x2c01('0x41')]['id']}})[_0x2c01('0x21')](handleEntityNotFound(_0x37f910,null))[_0x2c01('0x21')](removeEntity(_0x37f910,null))[_0x2c01('0x45')](handleError(_0x37f910,null));};exports[_0x2c01('0x48')]=function(_0x51785e,_0x3d28e4){return db[_0x2c01('0x29')][_0x2c01('0x48')]()[_0x2c01('0x21')](respondWithResult(_0x3d28e4,null))[_0x2c01('0x45')](handleError(_0x3d28e4,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 38ca91c..d4fbfb8 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 _0x71e2=['define','IntegrationReport','report_integration','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./integrationReport.attributes','exports'];(function(_0x366119,_0x4e5e8a){var _0x21f403=function(_0x314b0b){while(--_0x314b0b){_0x366119['push'](_0x366119['shift']());}};_0x21f403(++_0x4e5e8a);}(_0x71e2,0x99));var _0x271e=function(_0x4ee917,_0x948a17){_0x4ee917=_0x4ee917-0x0;var _0x2213a5=_0x71e2[_0x4ee917];return _0x2213a5;};'use strict';var _=require(_0x271e('0x0'));var util=require(_0x271e('0x1'));var logger=require(_0x271e('0x2'))(_0x271e('0x3'));var moment=require(_0x271e('0x4'));var BPromise=require(_0x271e('0x5'));var rp=require(_0x271e('0x6'));var fs=require('fs');var path=require(_0x271e('0x7'));var rimraf=require(_0x271e('0x8'));var config=require(_0x271e('0x9'));var attributes=require(_0x271e('0xa'));module[_0x271e('0xb')]=function(_0xefcb3f,_0x43bfa6){return _0xefcb3f[_0x271e('0xc')](_0x271e('0xd'),attributes,{'tableName':_0x271e('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0d3e=['report_integration','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./integrationReport.attributes','exports','define'];(function(_0x25701b,_0x2a6976){var _0x3a8a2c=function(_0x1a5e78){while(--_0x1a5e78){_0x25701b['push'](_0x25701b['shift']());}};_0x3a8a2c(++_0x2a6976);}(_0x0d3e,0xb7));var _0xe0d3=function(_0x57dff9,_0x37bd67){_0x57dff9=_0x57dff9-0x0;var _0x346ae6=_0x0d3e[_0x57dff9];return _0x346ae6;};'use strict';var _=require(_0xe0d3('0x0'));var util=require(_0xe0d3('0x1'));var logger=require(_0xe0d3('0x2'))('api');var moment=require(_0xe0d3('0x3'));var BPromise=require(_0xe0d3('0x4'));var rp=require(_0xe0d3('0x5'));var fs=require('fs');var path=require(_0xe0d3('0x6'));var rimraf=require(_0xe0d3('0x7'));var config=require(_0xe0d3('0x8'));var attributes=require(_0xe0d3('0x9'));module[_0xe0d3('0xa')]=function(_0x40a044,_0x29911e){return _0x40a044[_0xe0d3('0xb')]('IntegrationReport',attributes,{'tableName':_0xe0d3('0xc'),'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 c5755e2..f9aeb3b 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 _0x6d38=['request','then','IntegrationReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x26889f,_0x443e80){var _0x220368=function(_0x5ad0b0){while(--_0x5ad0b0){_0x26889f['push'](_0x26889f['shift']());}};_0x220368(++_0x443e80);}(_0x6d38,0x1ef));var _0x86d3=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x6d38[_0x4154a6];return _0x3b2786;};'use strict';var _=require('lodash');var util=require(_0x86d3('0x0'));var moment=require(_0x86d3('0x1'));var BPromise=require(_0x86d3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x86d3('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x86d3('0x4'))(_0x86d3('0x5'));var config=require(_0x86d3('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x86d3('0x7')][_0x86d3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x33d4aa,_0x2eaa15,_0x47e654){return new BPromise(function(_0x552b07,_0x2aea31){return client[_0x86d3('0x9')](_0x33d4aa,_0x47e654)[_0x86d3('0xa')](function(_0x499640){logger['info'](_0x86d3('0xb'),_0x2eaa15,_0x86d3('0xc'));logger['debug']('IntegrationReport,\x20%s,\x20%s,\x20%s',_0x2eaa15,_0x86d3('0xc'),JSON[_0x86d3('0xd')](_0x499640));if(_0x499640['error']){if(_0x499640[_0x86d3('0xe')]['code']===0x1f4){logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);return _0x2aea31(_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);}logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x499640['error'][_0x86d3('0xf')]);return _0x552b07(_0x499640[_0x86d3('0xe')][_0x86d3('0xf')]);}else{logger[_0x86d3('0x10')](_0x86d3('0xb'),_0x2eaa15,_0x86d3('0xc'));_0x552b07(_0x499640[_0x86d3('0x11')][_0x86d3('0xf')]);}})['catch'](function(_0x2d5ba9){logger[_0x86d3('0xe')](_0x86d3('0xb'),_0x2eaa15,_0x2d5ba9);_0x2aea31(_0x2d5ba9);});});} \ No newline at end of file +var _0x53ec=['error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','stringify','code'];(function(_0x9dfc10,_0x19c2d5){var _0x4f938a=function(_0x12b1e5){while(--_0x12b1e5){_0x9dfc10['push'](_0x9dfc10['shift']());}};_0x4f938a(++_0x19c2d5);}(_0x53ec,0x192));var _0xc53e=function(_0x5a0d6c,_0x180ba4){_0x5a0d6c=_0x5a0d6c-0x0;var _0x1b9fc1=_0x53ec[_0x5a0d6c];return _0x1b9fc1;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var moment=require(_0xc53e('0x2'));var BPromise=require(_0xc53e('0x3'));var rs=require(_0xc53e('0x4'));var fs=require('fs');var Redis=require(_0xc53e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc53e('0x6'));var logger=require('../../config/logger')(_0xc53e('0x7'));var config=require(_0xc53e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc53e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41a9e8,_0x2de88b,_0x5d3b28){return new BPromise(function(_0x1616ac,_0x1ac6c0){return client[_0xc53e('0xa')](_0x41a9e8,_0x5d3b28)[_0xc53e('0xb')](function(_0xd9612){logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));logger[_0xc53e('0xf')]('IntegrationReport,\x20%s,\x20%s,\x20%s',_0x2de88b,'request\x20sent',JSON[_0xc53e('0x10')](_0xd9612));if(_0xd9612['error']){if(_0xd9612['error'][_0xc53e('0x11')]===0x1f4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')]['message']);return _0x1ac6c0(_0xd9612['error'][_0xc53e('0x13')]);}logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);return _0x1616ac(_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);}else{logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));_0x1616ac(_0xd9612['result'][_0xc53e('0x13')]);}})[_0xc53e('0x14')](function(_0x535cd4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0x535cd4);_0x1ac6c0(_0x535cd4);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index fde1d7d..7a24b69 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 _0x5fa9=['multer','util','path','express','Router','../../components/interaction/service','./interval.controller','index','/:id','isAuthenticated','show','/:id/sub_intervals','create','post','addInterval','/:id/sub_intervals/create_many','addIntervals','put','update','delete','destroy'];(function(_0x5235f0,_0x1261e7){var _0x399649=function(_0xdf7dbe){while(--_0xdf7dbe){_0x5235f0['push'](_0x5235f0['shift']());}};_0x399649(++_0x1261e7);}(_0x5fa9,0x150));var _0x95fa=function(_0x137d1d,_0x35c663){_0x137d1d=_0x137d1d-0x0;var _0x485108=_0x5fa9[_0x137d1d];return _0x485108;};'use strict';var multer=require(_0x95fa('0x0'));var util=require(_0x95fa('0x1'));var path=require(_0x95fa('0x2'));var timeout=require('connect-timeout');var express=require(_0x95fa('0x3'));var router=express[_0x95fa('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x95fa('0x5'));var config=require('../../config/environment');var controller=require(_0x95fa('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x95fa('0x7')]);router['get'](_0x95fa('0x8'),auth[_0x95fa('0x9')](),controller[_0x95fa('0xa')]);router['get'](_0x95fa('0xb'),auth[_0x95fa('0x9')](),controller['getIntervals']);router['post']('/',auth['isAuthenticated'](),controller[_0x95fa('0xc')]);router[_0x95fa('0xd')](_0x95fa('0xb'),auth[_0x95fa('0x9')](),controller[_0x95fa('0xe')]);router['post'](_0x95fa('0xf'),auth['isAuthenticated'](),controller[_0x95fa('0x10')]);router[_0x95fa('0x11')](_0x95fa('0x8'),auth[_0x95fa('0x9')](),controller[_0x95fa('0x12')]);router[_0x95fa('0x13')](_0x95fa('0x8'),auth[_0x95fa('0x9')](),controller[_0x95fa('0x14')]);module['exports']=router; \ No newline at end of file +var _0xe35c=['put','update','destroy','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./interval.controller','get','isAuthenticated','/:id','show','/:id/sub_intervals','post','addInterval','addIntervals'];(function(_0x21979d,_0x3612a5){var _0x45137f=function(_0x2ecfb6){while(--_0x2ecfb6){_0x21979d['push'](_0x21979d['shift']());}};_0x45137f(++_0x3612a5);}(_0xe35c,0x146));var _0xce35=function(_0x399a6d,_0x3da642){_0x399a6d=_0x399a6d-0x0;var _0x4cb41d=_0xe35c[_0x399a6d];return _0x4cb41d;};'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('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xce35('0x6'));var config=require('../../config/environment');var controller=require(_0xce35('0x7'));router[_0xce35('0x8')]('/',auth[_0xce35('0x9')](),controller['index']);router[_0xce35('0x8')](_0xce35('0xa'),auth[_0xce35('0x9')](),controller[_0xce35('0xb')]);router['get'](_0xce35('0xc'),auth['isAuthenticated'](),controller['getIntervals']);router[_0xce35('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xce35('0xd')](_0xce35('0xc'),auth[_0xce35('0x9')](),controller[_0xce35('0xe')]);router[_0xce35('0xd')]('/:id/sub_intervals/create_many',auth['isAuthenticated'](),controller[_0xce35('0xf')]);router[_0xce35('0x10')](_0xce35('0xa'),auth[_0xce35('0x9')](),controller[_0xce35('0x11')]);router['delete']('/:id',auth[_0xce35('0x9')](),controller[_0xce35('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index a482437..9f14fbb 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 _0x330f=['STRING','sequelize','exports'];(function(_0x27856c,_0x2961ce){var _0x4594e4=function(_0x460b36){while(--_0x460b36){_0x27856c['push'](_0x27856c['shift']());}};_0x4594e4(++_0x2961ce);}(_0x330f,0xac));var _0xf330=function(_0x367a3d,_0x452717){_0x367a3d=_0x367a3d-0x0;var _0x460539=_0x330f[_0x367a3d];return _0x460539;};'use strict';var Sequelize=require(_0xf330('0x0'));module[_0xf330('0x1')]={'name':{'type':Sequelize[_0xf330('0x2')]},'description':{'type':Sequelize[_0xf330('0x2')]},'interval':{'type':Sequelize[_0xf330('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x5c92=['STRING','sequelize','exports'];(function(_0x479b16,_0x36714a){var _0x3be418=function(_0x209bfa){while(--_0x209bfa){_0x479b16['push'](_0x479b16['shift']());}};_0x3be418(++_0x36714a);}(_0x5c92,0x142));var _0x25c9=function(_0x452db0,_0x5cf2d4){_0x452db0=_0x452db0-0x0;var _0x29130d=_0x5c92[_0x452db0];return _0x29130d;};'use strict';var Sequelize=require(_0x25c9('0x0'));module[_0x25c9('0x1')]={'name':{'type':Sequelize[_0x25c9('0x2')]},'description':{'type':Sequelize[_0x25c9('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 942d6c9..5fb5ffb 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 _0x4fdb=['sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','get','Intervals','error','stack','name','send','map','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','Interval','includeAll','include','findAll','show','params','rawAttributes','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','addInterval','IntervalId','getIntervals','findOne','nolimit','transaction','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite'];(function(_0x3a22be,_0x2436ed){var _0x1085f1=function(_0x230ac2){while(--_0x230ac2){_0x3a22be['push'](_0x3a22be['shift']());}};_0x1085f1(++_0x2436ed);}(_0x4fdb,0x9c));var _0xb4fd=function(_0x54fe73,_0x4c95db){_0x54fe73=_0x54fe73-0x0;var _0x3576c4=_0x4fdb[_0x54fe73];return _0x3576c4;};'use strict';var emlformat=require(_0xb4fd('0x0'));var rimraf=require(_0xb4fd('0x1'));var zipdir=require(_0xb4fd('0x2'));var jsonpatch=require(_0xb4fd('0x3'));var rp=require(_0xb4fd('0x4'));var moment=require(_0xb4fd('0x5'));var BPromise=require(_0xb4fd('0x6'));var Mustache=require(_0xb4fd('0x7'));var util=require(_0xb4fd('0x8'));var path=require('path');var sox=require(_0xb4fd('0x9'));var csv=require('to-csv');var ejs=require(_0xb4fd('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb4fd('0xb'));var crypto=require(_0xb4fd('0xc'));var jsforce=require(_0xb4fd('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb4fd('0xe'));var Papa=require(_0xb4fd('0xf'));var Redis=require(_0xb4fd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xb4fd('0x11'));var as=require(_0xb4fd('0x12'));var hardwareService=require(_0xb4fd('0x13'));var logger=require(_0xb4fd('0x14'))(_0xb4fd('0x15'));var utils=require('../../config/utils');var config=require(_0xb4fd('0x16'));var licenseUtil=require(_0xb4fd('0x17'));var db=require(_0xb4fd('0x18'))['db'];var extensions=require(_0xb4fd('0x19'));function respondWithStatusCode(_0x5ba7e1,_0x38173d){_0x38173d=_0x38173d||0xcc;return function(_0x65f08a){if(_0x65f08a){return _0x5ba7e1[_0xb4fd('0x1a')](_0x38173d);}return _0x5ba7e1['status'](_0x38173d)[_0xb4fd('0x1b')]();};}function respondWithResult(_0x1234d7,_0xc35d8d){_0xc35d8d=_0xc35d8d||0xc8;return function(_0x41e21a){if(_0x41e21a){return _0x1234d7[_0xb4fd('0x1c')](_0xc35d8d)[_0xb4fd('0x1d')](_0x41e21a);}};}function respondWithFilteredResult(_0x3a0872,_0x47e288){return function(_0x2076d5){if(_0x2076d5){var _0x12401d=typeof _0x47e288[_0xb4fd('0x1e')]===_0xb4fd('0x1f')&&typeof _0x47e288[_0xb4fd('0x20')]===_0xb4fd('0x1f');var _0x1d0812=_0x2076d5[_0xb4fd('0x21')];var _0x28ecef=_0x12401d?0x0:_0x47e288[_0xb4fd('0x1e')];var _0x19f7b0=_0x12401d?_0x2076d5['count']:_0x47e288['offset']+_0x47e288['limit'];var _0x5c14c0;if(_0x19f7b0>=_0x1d0812){_0x19f7b0=_0x1d0812;_0x5c14c0=0xc8;}else{_0x5c14c0=0xce;}_0x3a0872[_0xb4fd('0x1c')](_0x5c14c0);return _0x3a0872[_0xb4fd('0x22')](_0xb4fd('0x23'),_0x28ecef+'-'+_0x19f7b0+'/'+_0x1d0812)[_0xb4fd('0x1d')](_0x2076d5);}return null;};}function patchUpdates(_0x458133){return function(_0x2adfbd){try{jsonpatch[_0xb4fd('0x24')](_0x2adfbd,_0x458133,!![]);}catch(_0x4ffaf1){return BPromise['reject'](_0x4ffaf1);}return _0x2adfbd[_0xb4fd('0x25')]();};}function saveUpdates(_0x25bb7d,_0x157fc2){return function(_0x4a1d88){if(_0x4a1d88){return _0x4a1d88[_0xb4fd('0x26')](_0x25bb7d)['then'](function(_0x46cba4){return _0x46cba4;});}return null;};}function removeEntity(_0x4f5032,_0x2a9c8c){return function(_0x2c2d8d){if(_0x2c2d8d){return _0x2c2d8d[_0xb4fd('0x27')]()[_0xb4fd('0x28')](function(){var _0xc00019=_0x2c2d8d[_0xb4fd('0x29')]({'plain':!![]});var _0x4f5971=_0xb4fd('0x2a');return db['UserProfileResource']['destroy']({'where':{'type':_0x4f5971,'resourceId':_0xc00019['id']}})['then'](function(){return _0x2c2d8d;});})[_0xb4fd('0x28')](function(){_0x4f5032['status'](0xcc)[_0xb4fd('0x1b')]();});}};}function handleEntityNotFound(_0x5e9d2b,_0x5738c2){return function(_0x282fe4){if(!_0x282fe4){_0x5e9d2b[_0xb4fd('0x1a')](0x194);}return _0x282fe4;};}function handleError(_0xda5ea8,_0x4a057d){_0x4a057d=_0x4a057d||0x1f4;return function(_0x11ed43){logger[_0xb4fd('0x2b')](_0x11ed43[_0xb4fd('0x2c')]);if(_0x11ed43[_0xb4fd('0x2d')]){delete _0x11ed43['name'];}_0xda5ea8[_0xb4fd('0x1c')](_0x4a057d)[_0xb4fd('0x2e')](_0x11ed43);};}exports['index']=function(_0x3e5060,_0x421c89){var _0xbe7d2c={},_0x597874={},_0xe73e10={'count':0x0,'rows':[]};var _0x2f564f=_[_0xb4fd('0x2f')](db['Interval']['rawAttributes'],function(_0x4d7a63){return{'name':_0x4d7a63['fieldName'],'type':_0x4d7a63[_0xb4fd('0x30')][_0xb4fd('0x31')]};});_0x597874[_0xb4fd('0x32')]=_[_0xb4fd('0x2f')](_0x2f564f,_0xb4fd('0x2d'));_0x597874[_0xb4fd('0x33')]=_[_0xb4fd('0x34')](_0x3e5060[_0xb4fd('0x33')]);_0x597874[_0xb4fd('0x35')]=_[_0xb4fd('0x36')](_0x597874[_0xb4fd('0x32')],_0x597874[_0xb4fd('0x33')]);_0xbe7d2c[_0xb4fd('0x37')]=_[_0xb4fd('0x36')](_0x597874[_0xb4fd('0x32')],qs[_0xb4fd('0x38')](_0x3e5060[_0xb4fd('0x33')][_0xb4fd('0x38')]));_0xbe7d2c['attributes']=_0xbe7d2c['attributes'][_0xb4fd('0x39')]?_0xbe7d2c[_0xb4fd('0x37')]:_0x597874[_0xb4fd('0x32')];if(!_0x3e5060[_0xb4fd('0x33')][_0xb4fd('0x3a')]('nolimit')){_0xbe7d2c[_0xb4fd('0x20')]=qs[_0xb4fd('0x20')](_0x3e5060[_0xb4fd('0x33')][_0xb4fd('0x20')]);_0xbe7d2c[_0xb4fd('0x1e')]=qs['offset'](_0x3e5060[_0xb4fd('0x33')]['offset']);}_0xbe7d2c[_0xb4fd('0x3b')]=qs[_0xb4fd('0x3c')](_0x3e5060['query']['sort']);_0xbe7d2c[_0xb4fd('0x3d')]=qs[_0xb4fd('0x35')](_[_0xb4fd('0x3e')](_0x3e5060[_0xb4fd('0x33')],_0x597874[_0xb4fd('0x35')]),_0x2f564f);if(_0x3e5060[_0xb4fd('0x33')]['filter']){_0xbe7d2c[_0xb4fd('0x3d')]=_[_0xb4fd('0x3f')](_0xbe7d2c['where'],{'$or':_[_0xb4fd('0x2f')](_0x2f564f,function(_0x5da3c0){if(_0x5da3c0[_0xb4fd('0x30')]!==_0xb4fd('0x40')){var _0x511d2b={};_0x511d2b[_0x5da3c0[_0xb4fd('0x2d')]]={'$like':'%'+_0x3e5060[_0xb4fd('0x33')][_0xb4fd('0x41')]+'%'};return _0x511d2b;}})});}_0xbe7d2c=_[_0xb4fd('0x3f')]({},_0xbe7d2c,_0x3e5060[_0xb4fd('0x42')]);var _0x3bd6f4={'where':_0xbe7d2c['where']};return db[_0xb4fd('0x43')][_0xb4fd('0x21')](_0x3bd6f4)['then'](function(_0x2120fa){_0xe73e10[_0xb4fd('0x21')]=_0x2120fa;if(_0x3e5060[_0xb4fd('0x33')][_0xb4fd('0x44')]){_0xbe7d2c[_0xb4fd('0x45')]=[{'all':!![]}];}return db['Interval'][_0xb4fd('0x46')](_0xbe7d2c);})[_0xb4fd('0x28')](function(_0xdaac5a){_0xe73e10['rows']=_0xdaac5a;return _0xe73e10;})[_0xb4fd('0x28')](respondWithFilteredResult(_0x421c89,_0xbe7d2c))['catch'](handleError(_0x421c89,null));};exports[_0xb4fd('0x47')]=function(_0x3d5177,_0x4d2c7c){var _0x563366={'raw':!![],'where':{'id':_0x3d5177[_0xb4fd('0x48')]['id']}},_0x4fbc36={};_0x4fbc36[_0xb4fd('0x32')]=_[_0xb4fd('0x34')](db['Interval'][_0xb4fd('0x49')]);_0x4fbc36[_0xb4fd('0x33')]=_[_0xb4fd('0x34')](_0x3d5177[_0xb4fd('0x33')]);_0x4fbc36[_0xb4fd('0x35')]=_[_0xb4fd('0x36')](_0x4fbc36[_0xb4fd('0x32')],_0x4fbc36['query']);_0x563366['attributes']=_[_0xb4fd('0x36')](_0x4fbc36[_0xb4fd('0x32')],qs[_0xb4fd('0x38')](_0x3d5177[_0xb4fd('0x33')]['fields']));_0x563366[_0xb4fd('0x37')]=_0x563366['attributes']['length']?_0x563366[_0xb4fd('0x37')]:_0x4fbc36[_0xb4fd('0x32')];if(_0x3d5177['query'][_0xb4fd('0x44')]){_0x563366[_0xb4fd('0x45')]=[{'all':!![]}];}_0x563366=_['merge']({},_0x563366,_0x3d5177[_0xb4fd('0x42')]);return db[_0xb4fd('0x43')][_0xb4fd('0x4a')](_0x563366)['then'](handleEntityNotFound(_0x4d2c7c,null))['then'](respondWithResult(_0x4d2c7c,null))[_0xb4fd('0x4b')](handleError(_0x4d2c7c,null));};exports[_0xb4fd('0x4c')]=function(_0x17fbc7,_0x339990){return db['Interval'][_0xb4fd('0x4c')](_0x17fbc7[_0xb4fd('0x4d')],{})['then'](function(_0x126225){var _0x24c7d4=_0x17fbc7[_0xb4fd('0x4e')]['get']({'plain':!![]});if(!_0x24c7d4)throw new Error(_0xb4fd('0x4f'));if(_0x24c7d4[_0xb4fd('0x50')]==='user'){var _0x47054f=_0x126225['get']({'plain':!![]});var _0x5a7bc0=_0xb4fd('0x2a');return db[_0xb4fd('0x51')][_0xb4fd('0x4a')]({'where':{'name':_0x5a7bc0,'userProfileId':_0x24c7d4[_0xb4fd('0x52')]},'raw':!![]})[_0xb4fd('0x28')](function(_0x409e41){if(_0x409e41&&_0x409e41[_0xb4fd('0x53')]===0x0){return db[_0xb4fd('0x54')][_0xb4fd('0x4c')]({'name':_0x47054f[_0xb4fd('0x2d')],'resourceId':_0x47054f['id'],'type':_0x409e41[_0xb4fd('0x2d')],'sectionId':_0x409e41['id']},{})[_0xb4fd('0x28')](function(){return _0x126225;});}else{return _0x126225;}})[_0xb4fd('0x4b')](function(_0x3ba6e3){logger[_0xb4fd('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3ba6e3);throw _0x3ba6e3;});}return _0x126225;})['then'](respondWithResult(_0x339990,0xc9))[_0xb4fd('0x4b')](handleError(_0x339990,null));};exports[_0xb4fd('0x26')]=function(_0x39b994,_0x2bf347){if(_0x39b994[_0xb4fd('0x4d')]['id']){delete _0x39b994['body']['id'];}return db['Interval'][_0xb4fd('0x4a')]({'where':{'id':_0x39b994[_0xb4fd('0x48')]['id']}})['then'](handleEntityNotFound(_0x2bf347,null))['then'](saveUpdates(_0x39b994['body'],null))[_0xb4fd('0x28')](respondWithResult(_0x2bf347,null))[_0xb4fd('0x4b')](handleError(_0x2bf347,null));};exports[_0xb4fd('0x27')]=function(_0xfdc372,_0x485cca){return db['Interval'][_0xb4fd('0x4a')]({'where':{'id':_0xfdc372[_0xb4fd('0x48')]['id']}})[_0xb4fd('0x28')](handleEntityNotFound(_0x485cca,null))['then'](removeEntity(_0x485cca,null))[_0xb4fd('0x4b')](handleError(_0x485cca,null));};exports[_0xb4fd('0x55')]=function(_0x135d0f,_0xc6f94c,_0x566b7c){if(_0x135d0f[_0xb4fd('0x4d')]['id']){delete _0x135d0f[_0xb4fd('0x4d')]['id'];}return db['Interval'][_0xb4fd('0x4a')]({'where':{'id':_0x135d0f['params']['id']}})[_0xb4fd('0x28')](handleEntityNotFound(_0xc6f94c,null))['then'](function(_0x1f68b0){if(_0x1f68b0){_0x135d0f[_0xb4fd('0x4d')][_0xb4fd('0x56')]=_0x1f68b0['id'];return db[_0xb4fd('0x43')][_0xb4fd('0x4c')](_0x135d0f[_0xb4fd('0x4d')]);}})[_0xb4fd('0x28')](respondWithResult(_0xc6f94c,null))[_0xb4fd('0x4b')](handleError(_0xc6f94c,null));};exports[_0xb4fd('0x57')]=function(_0x1e19e3,_0xe0ed97,_0x40882b){var _0x21a02d={};var _0x454acd={};var _0x5d5d2e;var _0x3274db;return db['Interval'][_0xb4fd('0x58')]({'where':{'id':_0x1e19e3['params']['id']}})[_0xb4fd('0x28')](handleEntityNotFound(_0xe0ed97,null))[_0xb4fd('0x28')](function(_0x39769a){if(_0x39769a){_0x5d5d2e=_0x39769a;_0x454acd[_0xb4fd('0x32')]=_['keys'](db['Interval'][_0xb4fd('0x49')]);_0x454acd['query']=_[_0xb4fd('0x34')](_0x1e19e3[_0xb4fd('0x33')]);_0x454acd[_0xb4fd('0x35')]=_['intersection'](_0x454acd[_0xb4fd('0x32')],_0x454acd['query']);_0x21a02d[_0xb4fd('0x37')]=_[_0xb4fd('0x36')](_0x454acd[_0xb4fd('0x32')],qs[_0xb4fd('0x38')](_0x1e19e3['query'][_0xb4fd('0x38')]));_0x21a02d['attributes']=_0x21a02d[_0xb4fd('0x37')][_0xb4fd('0x39')]?_0x21a02d[_0xb4fd('0x37')]:_0x454acd['model'];_0x21a02d['order']=qs['sort'](_0x1e19e3[_0xb4fd('0x33')]['sort']);_0x21a02d[_0xb4fd('0x3d')]=qs['filters'](_[_0xb4fd('0x3e')](_0x1e19e3[_0xb4fd('0x33')],_0x454acd[_0xb4fd('0x35')]));if(_0x1e19e3[_0xb4fd('0x33')]['filter']){_0x21a02d[_0xb4fd('0x3d')]=_[_0xb4fd('0x3f')](_0x21a02d[_0xb4fd('0x3d')],{'$or':_[_0xb4fd('0x2f')](_0x21a02d[_0xb4fd('0x37')],function(_0x5a2bf1){var _0x3b232e={};_0x3b232e[_0x5a2bf1]={'$like':'%'+_0x1e19e3[_0xb4fd('0x33')]['filter']+'%'};return _0x3b232e;})});}_0x21a02d=_[_0xb4fd('0x3f')]({},_0x21a02d,_0x1e19e3[_0xb4fd('0x42')]);return _0x5d5d2e[_0xb4fd('0x57')](_0x21a02d);}})[_0xb4fd('0x28')](function(_0xc0f45){if(_0xc0f45){_0x3274db=_0xc0f45[_0xb4fd('0x39')];if(!_0x1e19e3['query'][_0xb4fd('0x3a')](_0xb4fd('0x59'))){_0x21a02d[_0xb4fd('0x20')]=qs[_0xb4fd('0x20')](_0x1e19e3[_0xb4fd('0x33')][_0xb4fd('0x20')]);_0x21a02d[_0xb4fd('0x1e')]=qs[_0xb4fd('0x1e')](_0x1e19e3[_0xb4fd('0x33')][_0xb4fd('0x1e')]);}return _0x5d5d2e[_0xb4fd('0x57')](_0x21a02d);}})[_0xb4fd('0x28')](function(_0x88fb33){if(_0x88fb33){return _0x88fb33?{'count':_0x3274db,'rows':_0x88fb33}:null;}})[_0xb4fd('0x28')](respondWithResult(_0xe0ed97,null))[_0xb4fd('0x4b')](handleError(_0xe0ed97,null));};exports['addIntervals']=function(_0xf779ab,_0x444ca6,_0xef5a1f){return db['Interval'][_0xb4fd('0x58')]({'where':{'id':_0xf779ab['params']['id']}})[_0xb4fd('0x28')](handleEntityNotFound(_0x444ca6,null))['then'](function(_0x4b3ecb){if(_0x4b3ecb){return db['sequelize'][_0xb4fd('0x5a')](function(_0x57faf4){return db['Interval'][_0xb4fd('0x27')]({'where':{'IntervalId':_0xf779ab['params']['id']},'transaction':_0x57faf4})['then'](function(_0x276bca){var _0x53e09a=_[_0xb4fd('0x2f')](_0xf779ab[_0xb4fd('0x4d')],function(_0xf15364){delete _0xf15364['id'];_0xf15364[_0xb4fd('0x56')]=_0xf779ab[_0xb4fd('0x48')]['id'];return _0xf15364;});return db['Interval']['bulkCreate'](_0x53e09a,{'transaction':_0x57faf4});});})[_0xb4fd('0x28')](function(){return db[_0xb4fd('0x43')]['findAll']({'where':{'IntervalId':_0xf779ab[_0xb4fd('0x48')]['id']}});});}})[_0xb4fd('0x28')](respondWithResult(_0x444ca6,null))[_0xb4fd('0x4b')](handleError(_0x444ca6,null));}; \ No newline at end of file +var _0x5c09=['filter','include','findAll','rows','catch','show','keys','intersection','includeAll','merge','options','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','getIntervals','findOne','sort','sequelize','IntervalId','bulkCreate','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','destroy','then','get','Intervals','UserProfileResource','end','error','name','Interval','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','pick','where'];(function(_0x51e6fb,_0x1c0b7e){var _0x4e30a7=function(_0x2446c2){while(--_0x2446c2){_0x51e6fb['push'](_0x51e6fb['shift']());}};_0x4e30a7(++_0x1c0b7e);}(_0x5c09,0x178));var _0x95c0=function(_0x568c49,_0x46d862){_0x568c49=_0x568c49-0x0;var _0x181194=_0x5c09[_0x568c49];return _0x181194;};'use strict';var emlformat=require(_0x95c0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x95c0('0x1'));var jsonpatch=require(_0x95c0('0x2'));var rp=require(_0x95c0('0x3'));var moment=require(_0x95c0('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x95c0('0x5'));var util=require('util');var path=require('path');var sox=require(_0x95c0('0x6'));var csv=require(_0x95c0('0x7'));var ejs=require(_0x95c0('0x8'));var fs=require('fs');var fs_extra=require(_0x95c0('0x9'));var _=require(_0x95c0('0xa'));var squel=require(_0x95c0('0xb'));var crypto=require(_0x95c0('0xc'));var jsforce=require(_0x95c0('0xd'));var deskjs=require(_0x95c0('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x95c0('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x95c0('0x10'));var hardwareService=require(_0x95c0('0x11'));var logger=require('../../config/logger')(_0x95c0('0x12'));var utils=require(_0x95c0('0x13'));var config=require(_0x95c0('0x14'));var licenseUtil=require(_0x95c0('0x15'));var db=require(_0x95c0('0x16'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x56dad3,_0x3b8fbe){_0x3b8fbe=_0x3b8fbe||0xcc;return function(_0x4a7519){if(_0x4a7519){return _0x56dad3[_0x95c0('0x17')](_0x3b8fbe);}return _0x56dad3['status'](_0x3b8fbe)['end']();};}function respondWithResult(_0x3eccf3,_0x4926c2){_0x4926c2=_0x4926c2||0xc8;return function(_0x5b7473){if(_0x5b7473){return _0x3eccf3[_0x95c0('0x18')](_0x4926c2)[_0x95c0('0x19')](_0x5b7473);}};}function respondWithFilteredResult(_0xdde2c9,_0xa64265){return function(_0x521d59){if(_0x521d59){var _0x546bdd=typeof _0xa64265[_0x95c0('0x1a')]===_0x95c0('0x1b')&&typeof _0xa64265[_0x95c0('0x1c')]===_0x95c0('0x1b');var _0x1b04be=_0x521d59[_0x95c0('0x1d')];var _0x4c3a29=_0x546bdd?0x0:_0xa64265[_0x95c0('0x1a')];var _0x49d8e3=_0x546bdd?_0x521d59[_0x95c0('0x1d')]:_0xa64265['offset']+_0xa64265[_0x95c0('0x1c')];var _0x59e591;if(_0x49d8e3>=_0x1b04be){_0x49d8e3=_0x1b04be;_0x59e591=0xc8;}else{_0x59e591=0xce;}_0xdde2c9[_0x95c0('0x18')](_0x59e591);return _0xdde2c9[_0x95c0('0x1e')](_0x95c0('0x1f'),_0x4c3a29+'-'+_0x49d8e3+'/'+_0x1b04be)['json'](_0x521d59);}return null;};}function patchUpdates(_0xe3e74){return function(_0x1a34f3){try{jsonpatch['apply'](_0x1a34f3,_0xe3e74,!![]);}catch(_0x130201){return BPromise[_0x95c0('0x20')](_0x130201);}return _0x1a34f3['save']();};}function saveUpdates(_0xf50e9d,_0x50179a){return function(_0x556cfc){if(_0x556cfc){return _0x556cfc[_0x95c0('0x21')](_0xf50e9d)['then'](function(_0x56e508){return _0x56e508;});}return null;};}function removeEntity(_0x519f7a,_0xf0ed58){return function(_0x7e5db){if(_0x7e5db){return _0x7e5db[_0x95c0('0x22')]()[_0x95c0('0x23')](function(){var _0x2ddeba=_0x7e5db[_0x95c0('0x24')]({'plain':!![]});var _0x19c215=_0x95c0('0x25');return db[_0x95c0('0x26')][_0x95c0('0x22')]({'where':{'type':_0x19c215,'resourceId':_0x2ddeba['id']}})[_0x95c0('0x23')](function(){return _0x7e5db;});})[_0x95c0('0x23')](function(){_0x519f7a[_0x95c0('0x18')](0xcc)[_0x95c0('0x27')]();});}};}function handleEntityNotFound(_0x1058e1,_0x59e663){return function(_0x1e7485){if(!_0x1e7485){_0x1058e1['sendStatus'](0x194);}return _0x1e7485;};}function handleError(_0x1ce906,_0x3b540f){_0x3b540f=_0x3b540f||0x1f4;return function(_0x1fa902){logger[_0x95c0('0x28')](_0x1fa902['stack']);if(_0x1fa902[_0x95c0('0x29')]){delete _0x1fa902[_0x95c0('0x29')];}_0x1ce906['status'](_0x3b540f)['send'](_0x1fa902);};}exports['index']=function(_0x2beed6,_0x268975){var _0xb8c514={},_0xf5a13d={},_0x3c093d={'count':0x0,'rows':[]};var _0x471ee9=_['map'](db[_0x95c0('0x2a')][_0x95c0('0x2b')],function(_0x3a4891){return{'name':_0x3a4891[_0x95c0('0x2c')],'type':_0x3a4891[_0x95c0('0x2d')][_0x95c0('0x2e')]};});_0xf5a13d[_0x95c0('0x2f')]=_[_0x95c0('0x30')](_0x471ee9,_0x95c0('0x29'));_0xf5a13d[_0x95c0('0x31')]=_['keys'](_0x2beed6[_0x95c0('0x31')]);_0xf5a13d[_0x95c0('0x32')]=_['intersection'](_0xf5a13d[_0x95c0('0x2f')],_0xf5a13d[_0x95c0('0x31')]);_0xb8c514[_0x95c0('0x33')]=_['intersection'](_0xf5a13d[_0x95c0('0x2f')],qs[_0x95c0('0x34')](_0x2beed6[_0x95c0('0x31')][_0x95c0('0x34')]));_0xb8c514['attributes']=_0xb8c514[_0x95c0('0x33')][_0x95c0('0x35')]?_0xb8c514[_0x95c0('0x33')]:_0xf5a13d[_0x95c0('0x2f')];if(!_0x2beed6['query'][_0x95c0('0x36')](_0x95c0('0x37'))){_0xb8c514['limit']=qs[_0x95c0('0x1c')](_0x2beed6[_0x95c0('0x31')]['limit']);_0xb8c514[_0x95c0('0x1a')]=qs[_0x95c0('0x1a')](_0x2beed6['query'][_0x95c0('0x1a')]);}_0xb8c514[_0x95c0('0x38')]=qs['sort'](_0x2beed6[_0x95c0('0x31')]['sort']);_0xb8c514['where']=qs['filters'](_[_0x95c0('0x39')](_0x2beed6['query'],_0xf5a13d[_0x95c0('0x32')]),_0x471ee9);if(_0x2beed6[_0x95c0('0x31')]['filter']){_0xb8c514[_0x95c0('0x3a')]=_['merge'](_0xb8c514['where'],{'$or':_[_0x95c0('0x30')](_0x471ee9,function(_0x2eb091){if(_0x2eb091['type']!=='VIRTUAL'){var _0x5997ec={};_0x5997ec[_0x2eb091[_0x95c0('0x29')]]={'$like':'%'+_0x2beed6[_0x95c0('0x31')][_0x95c0('0x3b')]+'%'};return _0x5997ec;}})});}_0xb8c514=_['merge']({},_0xb8c514,_0x2beed6['options']);var _0x5b0453={'where':_0xb8c514[_0x95c0('0x3a')]};return db['Interval']['count'](_0x5b0453)[_0x95c0('0x23')](function(_0x139977){_0x3c093d[_0x95c0('0x1d')]=_0x139977;if(_0x2beed6[_0x95c0('0x31')]['includeAll']){_0xb8c514[_0x95c0('0x3c')]=[{'all':!![]}];}return db['Interval'][_0x95c0('0x3d')](_0xb8c514);})[_0x95c0('0x23')](function(_0x3b53cd){_0x3c093d[_0x95c0('0x3e')]=_0x3b53cd;return _0x3c093d;})['then'](respondWithFilteredResult(_0x268975,_0xb8c514))[_0x95c0('0x3f')](handleError(_0x268975,null));};exports[_0x95c0('0x40')]=function(_0xc774a7,_0x103361){var _0x59d183={'raw':!![],'where':{'id':_0xc774a7['params']['id']}},_0x464767={};_0x464767[_0x95c0('0x2f')]=_[_0x95c0('0x41')](db[_0x95c0('0x2a')][_0x95c0('0x2b')]);_0x464767[_0x95c0('0x31')]=_[_0x95c0('0x41')](_0xc774a7['query']);_0x464767[_0x95c0('0x32')]=_[_0x95c0('0x42')](_0x464767[_0x95c0('0x2f')],_0x464767[_0x95c0('0x31')]);_0x59d183[_0x95c0('0x33')]=_[_0x95c0('0x42')](_0x464767[_0x95c0('0x2f')],qs[_0x95c0('0x34')](_0xc774a7[_0x95c0('0x31')][_0x95c0('0x34')]));_0x59d183['attributes']=_0x59d183[_0x95c0('0x33')][_0x95c0('0x35')]?_0x59d183['attributes']:_0x464767[_0x95c0('0x2f')];if(_0xc774a7[_0x95c0('0x31')][_0x95c0('0x43')]){_0x59d183[_0x95c0('0x3c')]=[{'all':!![]}];}_0x59d183=_[_0x95c0('0x44')]({},_0x59d183,_0xc774a7[_0x95c0('0x45')]);return db[_0x95c0('0x2a')]['find'](_0x59d183)[_0x95c0('0x23')](handleEntityNotFound(_0x103361,null))[_0x95c0('0x23')](respondWithResult(_0x103361,null))[_0x95c0('0x3f')](handleError(_0x103361,null));};exports[_0x95c0('0x46')]=function(_0x15d1ed,_0xb0a06e){return db[_0x95c0('0x2a')][_0x95c0('0x46')](_0x15d1ed['body'],{})['then'](function(_0x2cb949){var _0x4444fe=_0x15d1ed[_0x95c0('0x47')][_0x95c0('0x24')]({'plain':!![]});if(!_0x4444fe)throw new Error(_0x95c0('0x48'));if(_0x4444fe[_0x95c0('0x49')]===_0x95c0('0x47')){var _0x4fae57=_0x2cb949[_0x95c0('0x24')]({'plain':!![]});var _0x2869b6=_0x95c0('0x25');return db[_0x95c0('0x4a')][_0x95c0('0x4b')]({'where':{'name':_0x2869b6,'userProfileId':_0x4444fe[_0x95c0('0x4c')]},'raw':!![]})[_0x95c0('0x23')](function(_0x44839f){if(_0x44839f&&_0x44839f[_0x95c0('0x4d')]===0x0){return db['UserProfileResource'][_0x95c0('0x46')]({'name':_0x4fae57[_0x95c0('0x29')],'resourceId':_0x4fae57['id'],'type':_0x44839f[_0x95c0('0x29')],'sectionId':_0x44839f['id']},{})[_0x95c0('0x23')](function(){return _0x2cb949;});}else{return _0x2cb949;}})[_0x95c0('0x3f')](function(_0x165761){logger[_0x95c0('0x28')](_0x95c0('0x4e'),_0x165761);throw _0x165761;});}return _0x2cb949;})['then'](respondWithResult(_0xb0a06e,0xc9))[_0x95c0('0x3f')](handleError(_0xb0a06e,null));};exports[_0x95c0('0x21')]=function(_0x13cf92,_0x5ccfd2){if(_0x13cf92[_0x95c0('0x4f')]['id']){delete _0x13cf92['body']['id'];}return db[_0x95c0('0x2a')][_0x95c0('0x4b')]({'where':{'id':_0x13cf92[_0x95c0('0x50')]['id']}})[_0x95c0('0x23')](handleEntityNotFound(_0x5ccfd2,null))['then'](saveUpdates(_0x13cf92[_0x95c0('0x4f')],null))[_0x95c0('0x23')](respondWithResult(_0x5ccfd2,null))[_0x95c0('0x3f')](handleError(_0x5ccfd2,null));};exports[_0x95c0('0x22')]=function(_0x2aa0ff,_0x511089){return db['Interval'][_0x95c0('0x4b')]({'where':{'id':_0x2aa0ff['params']['id']}})['then'](handleEntityNotFound(_0x511089,null))[_0x95c0('0x23')](removeEntity(_0x511089,null))[_0x95c0('0x3f')](handleError(_0x511089,null));};exports['addInterval']=function(_0x1116f1,_0x3f28cf,_0x3cadb7){if(_0x1116f1[_0x95c0('0x4f')]['id']){delete _0x1116f1[_0x95c0('0x4f')]['id'];}return db['Interval'][_0x95c0('0x4b')]({'where':{'id':_0x1116f1[_0x95c0('0x50')]['id']}})[_0x95c0('0x23')](handleEntityNotFound(_0x3f28cf,null))[_0x95c0('0x23')](function(_0x29d843){if(_0x29d843){_0x1116f1[_0x95c0('0x4f')]['IntervalId']=_0x29d843['id'];return db[_0x95c0('0x2a')][_0x95c0('0x46')](_0x1116f1[_0x95c0('0x4f')]);}})[_0x95c0('0x23')](respondWithResult(_0x3f28cf,null))[_0x95c0('0x3f')](handleError(_0x3f28cf,null));};exports[_0x95c0('0x51')]=function(_0x465f19,_0x379b72,_0x7062d3){var _0x4acf5c={};var _0x9b5a04={};var _0x47f4c1;var _0x4102d1;return db[_0x95c0('0x2a')][_0x95c0('0x52')]({'where':{'id':_0x465f19[_0x95c0('0x50')]['id']}})[_0x95c0('0x23')](handleEntityNotFound(_0x379b72,null))[_0x95c0('0x23')](function(_0x363944){if(_0x363944){_0x47f4c1=_0x363944;_0x9b5a04[_0x95c0('0x2f')]=_['keys'](db['Interval']['rawAttributes']);_0x9b5a04[_0x95c0('0x31')]=_[_0x95c0('0x41')](_0x465f19['query']);_0x9b5a04[_0x95c0('0x32')]=_[_0x95c0('0x42')](_0x9b5a04['model'],_0x9b5a04[_0x95c0('0x31')]);_0x4acf5c[_0x95c0('0x33')]=_[_0x95c0('0x42')](_0x9b5a04['model'],qs[_0x95c0('0x34')](_0x465f19[_0x95c0('0x31')][_0x95c0('0x34')]));_0x4acf5c[_0x95c0('0x33')]=_0x4acf5c[_0x95c0('0x33')][_0x95c0('0x35')]?_0x4acf5c[_0x95c0('0x33')]:_0x9b5a04[_0x95c0('0x2f')];_0x4acf5c[_0x95c0('0x38')]=qs[_0x95c0('0x53')](_0x465f19[_0x95c0('0x31')][_0x95c0('0x53')]);_0x4acf5c[_0x95c0('0x3a')]=qs[_0x95c0('0x32')](_['pick'](_0x465f19[_0x95c0('0x31')],_0x9b5a04['filters']));if(_0x465f19['query'][_0x95c0('0x3b')]){_0x4acf5c[_0x95c0('0x3a')]=_[_0x95c0('0x44')](_0x4acf5c[_0x95c0('0x3a')],{'$or':_[_0x95c0('0x30')](_0x4acf5c[_0x95c0('0x33')],function(_0x4baa46){var _0x2e668a={};_0x2e668a[_0x4baa46]={'$like':'%'+_0x465f19[_0x95c0('0x31')][_0x95c0('0x3b')]+'%'};return _0x2e668a;})});}_0x4acf5c=_[_0x95c0('0x44')]({},_0x4acf5c,_0x465f19[_0x95c0('0x45')]);return _0x47f4c1[_0x95c0('0x51')](_0x4acf5c);}})['then'](function(_0x5ce790){if(_0x5ce790){_0x4102d1=_0x5ce790[_0x95c0('0x35')];if(!_0x465f19[_0x95c0('0x31')][_0x95c0('0x36')](_0x95c0('0x37'))){_0x4acf5c['limit']=qs['limit'](_0x465f19[_0x95c0('0x31')]['limit']);_0x4acf5c[_0x95c0('0x1a')]=qs['offset'](_0x465f19[_0x95c0('0x31')][_0x95c0('0x1a')]);}return _0x47f4c1[_0x95c0('0x51')](_0x4acf5c);}})[_0x95c0('0x23')](function(_0x5b89c8){if(_0x5b89c8){return _0x5b89c8?{'count':_0x4102d1,'rows':_0x5b89c8}:null;}})['then'](respondWithResult(_0x379b72,null))[_0x95c0('0x3f')](handleError(_0x379b72,null));};exports['addIntervals']=function(_0x17ea32,_0x1ab8c3,_0x317d96){return db[_0x95c0('0x2a')][_0x95c0('0x52')]({'where':{'id':_0x17ea32[_0x95c0('0x50')]['id']}})[_0x95c0('0x23')](handleEntityNotFound(_0x1ab8c3,null))[_0x95c0('0x23')](function(_0x2e2aec){if(_0x2e2aec){return db[_0x95c0('0x54')]['transaction'](function(_0x546bf0){return db['Interval'][_0x95c0('0x22')]({'where':{'IntervalId':_0x17ea32[_0x95c0('0x50')]['id']},'transaction':_0x546bf0})[_0x95c0('0x23')](function(_0x128364){var _0x131dea=_[_0x95c0('0x30')](_0x17ea32[_0x95c0('0x4f')],function(_0x2fe9d2){delete _0x2fe9d2['id'];_0x2fe9d2[_0x95c0('0x55')]=_0x17ea32[_0x95c0('0x50')]['id'];return _0x2fe9d2;});return db[_0x95c0('0x2a')][_0x95c0('0x56')](_0x131dea,{'transaction':_0x546bf0});});})[_0x95c0('0x23')](function(){return db[_0x95c0('0x2a')][_0x95c0('0x3d')]({'where':{'IntervalId':_0x17ea32[_0x95c0('0x50')]['id']}});});}})[_0x95c0('0x23')](respondWithResult(_0x1ab8c3,null))[_0x95c0('0x3f')](handleError(_0x1ab8c3,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index cf87520..dcd3d4d 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 _0x10b1=['reduce','./interval.attributes','../../components/extensions/rewrite','../../utils/iftime','iftime','exports','Interval','tools_intervals','rewrite','string','interval','getIntervals','then','map','ifTime'];(function(_0x5dc85e,_0x20e2d0){var _0x4d87f8=function(_0x43939e){while(--_0x43939e){_0x5dc85e['push'](_0x5dc85e['shift']());}};_0x4d87f8(++_0x20e2d0);}(_0x10b1,0x1a5));var _0x110b=function(_0x923cb1,_0x294104){_0x923cb1=_0x923cb1-0x0;var _0x342e95=_0x10b1[_0x923cb1];return _0x342e95;};'use strict';var attributes=require(_0x110b('0x0'));var extensions=require(_0x110b('0x1'));var iftime=require(_0x110b('0x2'))[_0x110b('0x3')];module[_0x110b('0x4')]=function(_0x5e8fe7){return _0x5e8fe7['define'](_0x110b('0x5'),attributes,{'tableName':_0x110b('0x6'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x32a028){extensions['rewrite'](_0x5e8fe7,_0x32a028);},'afterBulkCreate':function(_0x4c9810,_0x1f5e25,_0x485e1f){_0x485e1f();extensions[_0x110b('0x7')](_0x5e8fe7,_0x4c9810[0x0]);},'afterUpdate':function(_0x37f756){extensions[_0x110b('0x7')](_0x5e8fe7,_0x37f756);},'afterDestroy':function(_0x31dacb){extensions['rewrite'](_0x5e8fe7,_0x31dacb);}},'instanceMethods':{'ifTime':function(_0x52ab74=undefined,_0x43daa6=new Date()){if(typeof this['interval']===_0x110b('0x8')){return iftime(this[_0x110b('0x9')],_0x52ab74,_0x43daa6);}else{return this[_0x110b('0xa')]()[_0x110b('0xb')](function(_0x22c0e8){return Promise['all'](_0x22c0e8[_0x110b('0xc')](function(_0x3a0293){return _0x3a0293[_0x110b('0xd')](_0x52ab74,_0x43daa6);}));})[_0x110b('0xb')](function(_0x33d51a){return _0x33d51a[_0x110b('0xe')](function(_0x1a5d5b,_0x3ffdf2){return _0x1a5d5b||_0x3ffdf2;},![]);});}}}});}; \ No newline at end of file +var _0x5c3b=['then','reduce','../../utils/iftime','iftime','exports','define','Interval','rewrite','interval','getIntervals','all','map','ifTime'];(function(_0x10ee5d,_0x2c893c){var _0x443bea=function(_0x55c7a3){while(--_0x55c7a3){_0x10ee5d['push'](_0x10ee5d['shift']());}};_0x443bea(++_0x2c893c);}(_0x5c3b,0xf9));var _0xb5c3=function(_0x566c43,_0x2cfca1){_0x566c43=_0x566c43-0x0;var _0x35c32c=_0x5c3b[_0x566c43];return _0x35c32c;};'use strict';var attributes=require('./interval.attributes');var extensions=require('../../components/extensions/rewrite');var iftime=require(_0xb5c3('0x0'))[_0xb5c3('0x1')];module[_0xb5c3('0x2')]=function(_0x157e1c){return _0x157e1c[_0xb5c3('0x3')](_0xb5c3('0x4'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x56866a){extensions[_0xb5c3('0x5')](_0x157e1c,_0x56866a);},'afterBulkCreate':function(_0x4ee896,_0x25ea21,_0x179d60){_0x179d60();extensions[_0xb5c3('0x5')](_0x157e1c,_0x4ee896[0x0]);},'afterUpdate':function(_0x503ff8){extensions[_0xb5c3('0x5')](_0x157e1c,_0x503ff8);},'afterDestroy':function(_0x2c1b8e){extensions[_0xb5c3('0x5')](_0x157e1c,_0x2c1b8e);}},'instanceMethods':{'ifTime':function(_0x1dd339=undefined,_0x14b431=new Date()){if(typeof this[_0xb5c3('0x6')]==='string'){return iftime(this[_0xb5c3('0x6')],_0x1dd339,_0x14b431);}else{return this[_0xb5c3('0x7')]()['then'](function(_0x24abd3){return Promise[_0xb5c3('0x8')](_0x24abd3[_0xb5c3('0x9')](function(_0x299d99){return _0x299d99[_0xb5c3('0xa')](_0x1dd339,_0x14b431);}));})[_0xb5c3('0xb')](function(_0x654410){return _0x654410[_0xb5c3('0xc')](function(_0x2cca54,_0x2129bc){return _0x2cca54||_0x2129bc;},![]);});}}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 7f584f9..1e50cec 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 _0x2dce=['info','debug','stringify','catch','message','error','ShowInterval','then','ifTime','reduce','format','name','join','findById','IntervalIftime','intervalIds','isArray','intervals','string','timezone','length','IntervalIftime:\x20interval\x20strings\x20=\x20%s','IntervalIftime:\x20timezone\x20=\x20%s','Iftime','silly','lodash','util','iftime','../../config/logger','rpc','GetInterval','Interval','findAll','options','raw','where','limit','include','attributes','map','model'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x2dce,0x138));var _0xe2dc=function(_0x2157ac,_0x1cb6bf){_0x2157ac=_0x2157ac-0x0;var _0x48d77a=_0x2dce[_0x2157ac];return _0x48d77a;};'use strict';var _=require(_0xe2dc('0x0'));var util=require(_0xe2dc('0x1'));var db=require('../../mysqldb')['db'];var iftime=require('../../utils/iftime')[_0xe2dc('0x2')];var logger=require(_0xe2dc('0x3'))(_0xe2dc('0x4'));exports[_0xe2dc('0x5')]=function(_0x44daf7){var _0x217efa=this;return new Promise(function(_0x467595,_0x3058ac){return db[_0xe2dc('0x6')][_0xe2dc('0x7')]({'raw':_0x44daf7[_0xe2dc('0x8')]?_0x44daf7[_0xe2dc('0x8')][_0xe2dc('0x9')]===undefined?!![]:![]:!![],'where':_0x44daf7[_0xe2dc('0x8')]?_0x44daf7[_0xe2dc('0x8')][_0xe2dc('0xa')]||null:null,'attributes':_0x44daf7[_0xe2dc('0x8')]?_0x44daf7['options']['attributes']||null:null,'limit':_0x44daf7[_0xe2dc('0x8')]?_0x44daf7[_0xe2dc('0x8')][_0xe2dc('0xb')]||null:null,'include':_0x44daf7[_0xe2dc('0x8')]?_0x44daf7[_0xe2dc('0x8')][_0xe2dc('0xc')]?_['map'](_0x44daf7['options'][_0xe2dc('0xc')],function(_0x1f6834){return{'model':db[_0x1f6834['model']],'as':_0x1f6834['as'],'attributes':_0x1f6834[_0xe2dc('0xd')],'include':_0x1f6834[_0xe2dc('0xc')]?_[_0xe2dc('0xe')](_0x1f6834['include'],function(_0x4be151){return{'model':db[_0x4be151[_0xe2dc('0xf')]],'as':_0x4be151['as'],'attributes':_0x4be151[_0xe2dc('0xd')],'include':_0x4be151['include']?_[_0xe2dc('0xe')](_0x4be151[_0xe2dc('0xc')],function(_0x41cea1){return{'model':db[_0x41cea1[_0xe2dc('0xf')]],'as':_0x41cea1['as'],'attributes':_0x41cea1[_0xe2dc('0xd')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x51e332){logger[_0xe2dc('0x10')]('GetInterval',_0x44daf7);logger[_0xe2dc('0x11')](_0xe2dc('0x5'),_0x44daf7,JSON[_0xe2dc('0x12')](_0x51e332));_0x467595(_0x51e332);})[_0xe2dc('0x13')](function(_0x49e55e){logger['error'](_0xe2dc('0x5'),_0x49e55e[_0xe2dc('0x14')],_0x44daf7);_0x3058ac(_0x217efa[_0xe2dc('0x15')](0x1f4,_0x49e55e['message']));});});};exports[_0xe2dc('0x16')]=function(_0x1ffbfb){var _0x30ee30=this;return new Promise(function(_0x43b59c,_0x5ede2e){return db[_0xe2dc('0x6')]['find']({'raw':_0x1ffbfb['options']?_0x1ffbfb[_0xe2dc('0x8')][_0xe2dc('0x9')]===undefined?!![]:![]:!![],'where':_0x1ffbfb[_0xe2dc('0x8')]?_0x1ffbfb[_0xe2dc('0x8')]['where']||null:null,'attributes':_0x1ffbfb[_0xe2dc('0x8')]?_0x1ffbfb['options'][_0xe2dc('0xd')]||null:null,'include':_0x1ffbfb[_0xe2dc('0x8')]?_0x1ffbfb[_0xe2dc('0x8')][_0xe2dc('0xc')]?_[_0xe2dc('0xe')](_0x1ffbfb[_0xe2dc('0x8')][_0xe2dc('0xc')],function(_0x138652){return{'model':db[_0x138652['model']],'as':_0x138652['as'],'attributes':_0x138652['attributes'],'include':_0x138652['include']?_['map'](_0x138652[_0xe2dc('0xc')],function(_0xaa652){return{'model':db[_0xaa652[_0xe2dc('0xf')]],'as':_0xaa652['as'],'attributes':_0xaa652[_0xe2dc('0xd')],'include':_0xaa652[_0xe2dc('0xc')]?_['map'](_0xaa652[_0xe2dc('0xc')],function(_0x4d9f68){return{'model':db[_0x4d9f68[_0xe2dc('0xf')]],'as':_0x4d9f68['as'],'attributes':_0x4d9f68[_0xe2dc('0xd')]};}):[]};}):[]};}):[]:[]})[_0xe2dc('0x17')](function(_0x46e7e3){logger['info']('ShowInterval',_0x1ffbfb);logger[_0xe2dc('0x11')](_0xe2dc('0x16'),_0x1ffbfb,JSON[_0xe2dc('0x12')](_0x46e7e3));_0x43b59c(_0x46e7e3);})['catch'](function(_0x4c8c73){logger['error']('ShowInterval',_0x4c8c73['message'],_0x1ffbfb);_0x5ede2e(_0x30ee30[_0xe2dc('0x15')](0x1f4,_0x4c8c73[_0xe2dc('0x14')]));});});};function checkArrayOfIntervals(_0x2c2f2a,_0x32441c){var _0x5b8bb8=[];return db[_0xe2dc('0x6')][_0xe2dc('0x7')]({'where':{'id':_0x2c2f2a}})[_0xe2dc('0x17')](function(_0x303ebf){_0x5b8bb8=_0x303ebf;return Promise['all'](_0x5b8bb8[_0xe2dc('0xe')](function(_0x4b6006){return _0x4b6006[_0xe2dc('0x18')](_0x32441c);}));})['then'](function(_0x3e81f4){var _0x5ec5ae=_0x3e81f4[_0xe2dc('0x19')](function(_0x5ef3c9,_0x5a4e33){return _0x5ef3c9||_0x5a4e33;},![]);logger['info'](util[_0xe2dc('0x1a')]('IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)',_0x5b8bb8[_0xe2dc('0xe')](function(_0x204f63){return _0x204f63[_0xe2dc('0x1b')];})[_0xe2dc('0x1c')](',\x20'),_0x5b8bb8[_0xe2dc('0xe')](function(_0x5ee8c4){return _0x5ee8c4['id'];})[_0xe2dc('0x1c')](',\x20')));return _0x5ec5ae;});}function checkSingleInterval(_0x4a5182,_0x4b0dbd){return db[_0xe2dc('0x6')][_0xe2dc('0x1d')](_0x4a5182)[_0xe2dc('0x17')](function(_0x5a4a60){if(_0x5a4a60){logger[_0xe2dc('0x10')](util['format']('IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)',_0x5a4a60[_0xe2dc('0x1b')],_0x5a4a60['id']));return _0x5a4a60[_0xe2dc('0x18')](_0x4b0dbd);}});}exports[_0xe2dc('0x1e')]=function(_0xa4eab7){var _0x3bdc34=_0xa4eab7[_0xe2dc('0x1f')];var _0x5e66cf=Array[_0xe2dc('0x20')](_0xa4eab7[_0xe2dc('0x21')])?_0xa4eab7['intervals']:typeof _0xa4eab7[_0xe2dc('0x21')]===_0xe2dc('0x22')?[_0xa4eab7['intervals']]:[];var _0x1a502a=_0xa4eab7[_0xe2dc('0x23')]||undefined;var _0x4db595=![];if(_0x5e66cf[_0xe2dc('0x24')]){logger[_0xe2dc('0x10')](util[_0xe2dc('0x1a')](_0xe2dc('0x25'),_0x5e66cf['join'](';\x20')));}if(_0x1a502a){logger[_0xe2dc('0x10')](util['format'](_0xe2dc('0x26'),_0x1a502a));}logger[_0xe2dc('0x11')](_0xe2dc('0x27'),_0x4db595);logger[_0xe2dc('0x28')](_0xe2dc('0x1e'),_0xa4eab7);return Promise['resolve']()['then'](function(){if(Array[_0xe2dc('0x20')](_0x3bdc34)){return checkArrayOfIntervals(_0x3bdc34,_0x1a502a);}else if(_0x3bdc34){return checkSingleInterval(_0x3bdc34,_0x1a502a);}})['then'](function(_0x58a36e){var _0x30bf05=_0x5e66cf[_0xe2dc('0x19')](function(_0x2890ab,_0x4b5a11){return _0x2890ab||iftime(_0x4b5a11,_0x1a502a);},![]);_0x4db595=_0x58a36e||_0x30bf05;return _0x4db595;})[_0xe2dc('0x13')](function(_0x5ad9c0){logger['error'](_0xe2dc('0x1e'),_0xa4eab7,_0x5ad9c0);throw this[_0xe2dc('0x15')](0x1f4,_0x5ad9c0[_0xe2dc('0x14')]);});}; \ No newline at end of file +var _0x1f8d=['string','timezone','length','IntervalIftime:\x20interval\x20strings\x20=\x20%s','IntervalIftime:\x20timezone\x20=\x20%s','Iftime','silly','IntervalIftime','resolve','lodash','util','../../utils/iftime','iftime','../../config/logger','rpc','GetInterval','options','raw','where','attributes','limit','include','model','map','then','info','debug','stringify','catch','error','message','Interval','ShowInterval','findAll','ifTime','reduce','name','join','findById','format','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)','intervalIds','intervals'];(function(_0x86b219,_0x43038f){var _0x1f320c=function(_0x8cd63f){while(--_0x8cd63f){_0x86b219['push'](_0x86b219['shift']());}};_0x1f320c(++_0x43038f);}(_0x1f8d,0x18c));var _0xd1f8=function(_0x2c90f1,_0x2b4723){_0x2c90f1=_0x2c90f1-0x0;var _0x22eb01=_0x1f8d[_0x2c90f1];return _0x22eb01;};'use strict';var _=require(_0xd1f8('0x0'));var util=require(_0xd1f8('0x1'));var db=require('../../mysqldb')['db'];var iftime=require(_0xd1f8('0x2'))[_0xd1f8('0x3')];var logger=require(_0xd1f8('0x4'))(_0xd1f8('0x5'));exports[_0xd1f8('0x6')]=function(_0x1800d1){var _0x15584e=this;return new Promise(function(_0x3b25a5,_0x308412){return db['Interval']['findAll']({'raw':_0x1800d1['options']?_0x1800d1[_0xd1f8('0x7')][_0xd1f8('0x8')]===undefined?!![]:![]:!![],'where':_0x1800d1['options']?_0x1800d1['options'][_0xd1f8('0x9')]||null:null,'attributes':_0x1800d1[_0xd1f8('0x7')]?_0x1800d1[_0xd1f8('0x7')][_0xd1f8('0xa')]||null:null,'limit':_0x1800d1[_0xd1f8('0x7')]?_0x1800d1[_0xd1f8('0x7')][_0xd1f8('0xb')]||null:null,'include':_0x1800d1['options']?_0x1800d1[_0xd1f8('0x7')][_0xd1f8('0xc')]?_['map'](_0x1800d1[_0xd1f8('0x7')][_0xd1f8('0xc')],function(_0x4a88ca){return{'model':db[_0x4a88ca[_0xd1f8('0xd')]],'as':_0x4a88ca['as'],'attributes':_0x4a88ca['attributes'],'include':_0x4a88ca[_0xd1f8('0xc')]?_[_0xd1f8('0xe')](_0x4a88ca[_0xd1f8('0xc')],function(_0x136ba1){return{'model':db[_0x136ba1['model']],'as':_0x136ba1['as'],'attributes':_0x136ba1[_0xd1f8('0xa')],'include':_0x136ba1['include']?_[_0xd1f8('0xe')](_0x136ba1[_0xd1f8('0xc')],function(_0x4ae437){return{'model':db[_0x4ae437[_0xd1f8('0xd')]],'as':_0x4ae437['as'],'attributes':_0x4ae437[_0xd1f8('0xa')]};}):[]};}):[]};}):[]:[]})[_0xd1f8('0xf')](function(_0x3c2e3d){logger[_0xd1f8('0x10')](_0xd1f8('0x6'),_0x1800d1);logger[_0xd1f8('0x11')](_0xd1f8('0x6'),_0x1800d1,JSON[_0xd1f8('0x12')](_0x3c2e3d));_0x3b25a5(_0x3c2e3d);})[_0xd1f8('0x13')](function(_0xd25f38){logger[_0xd1f8('0x14')](_0xd1f8('0x6'),_0xd25f38['message'],_0x1800d1);_0x308412(_0x15584e['error'](0x1f4,_0xd25f38[_0xd1f8('0x15')]));});});};exports['ShowInterval']=function(_0xb7f8b3){var _0x5a5905=this;return new Promise(function(_0x41e534,_0x3c9d51){return db[_0xd1f8('0x16')]['find']({'raw':_0xb7f8b3['options']?_0xb7f8b3[_0xd1f8('0x7')][_0xd1f8('0x8')]===undefined?!![]:![]:!![],'where':_0xb7f8b3['options']?_0xb7f8b3['options']['where']||null:null,'attributes':_0xb7f8b3['options']?_0xb7f8b3['options']['attributes']||null:null,'include':_0xb7f8b3[_0xd1f8('0x7')]?_0xb7f8b3['options'][_0xd1f8('0xc')]?_[_0xd1f8('0xe')](_0xb7f8b3['options'][_0xd1f8('0xc')],function(_0x598f10){return{'model':db[_0x598f10[_0xd1f8('0xd')]],'as':_0x598f10['as'],'attributes':_0x598f10[_0xd1f8('0xa')],'include':_0x598f10[_0xd1f8('0xc')]?_[_0xd1f8('0xe')](_0x598f10[_0xd1f8('0xc')],function(_0xb19261){return{'model':db[_0xb19261[_0xd1f8('0xd')]],'as':_0xb19261['as'],'attributes':_0xb19261[_0xd1f8('0xa')],'include':_0xb19261[_0xd1f8('0xc')]?_[_0xd1f8('0xe')](_0xb19261['include'],function(_0x1e9aad){return{'model':db[_0x1e9aad[_0xd1f8('0xd')]],'as':_0x1e9aad['as'],'attributes':_0x1e9aad[_0xd1f8('0xa')]};}):[]};}):[]};}):[]:[]})[_0xd1f8('0xf')](function(_0x273711){logger['info']('ShowInterval',_0xb7f8b3);logger[_0xd1f8('0x11')](_0xd1f8('0x17'),_0xb7f8b3,JSON[_0xd1f8('0x12')](_0x273711));_0x41e534(_0x273711);})[_0xd1f8('0x13')](function(_0x21d20a){logger[_0xd1f8('0x14')](_0xd1f8('0x17'),_0x21d20a[_0xd1f8('0x15')],_0xb7f8b3);_0x3c9d51(_0x5a5905['error'](0x1f4,_0x21d20a['message']));});});};function checkArrayOfIntervals(_0x1544e8,_0x32ed47){var _0x1b4963=[];return db[_0xd1f8('0x16')][_0xd1f8('0x18')]({'where':{'id':_0x1544e8}})[_0xd1f8('0xf')](function(_0x351a01){_0x1b4963=_0x351a01;return Promise['all'](_0x1b4963[_0xd1f8('0xe')](function(_0x2b15d8){return _0x2b15d8[_0xd1f8('0x19')](_0x32ed47);}));})['then'](function(_0x469cc0){var _0x597afe=_0x469cc0[_0xd1f8('0x1a')](function(_0x2d067d,_0x293f28){return _0x2d067d||_0x293f28;},![]);logger[_0xd1f8('0x10')](util['format']('IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)',_0x1b4963[_0xd1f8('0xe')](function(_0x140d2b){return _0x140d2b[_0xd1f8('0x1b')];})[_0xd1f8('0x1c')](',\x20'),_0x1b4963['map'](function(_0x3ca0b4){return _0x3ca0b4['id'];})[_0xd1f8('0x1c')](',\x20')));return _0x597afe;});}function checkSingleInterval(_0x5198bd,_0x371a43){return db[_0xd1f8('0x16')][_0xd1f8('0x1d')](_0x5198bd)[_0xd1f8('0xf')](function(_0x33872f){if(_0x33872f){logger[_0xd1f8('0x10')](util[_0xd1f8('0x1e')](_0xd1f8('0x1f'),_0x33872f[_0xd1f8('0x1b')],_0x33872f['id']));return _0x33872f[_0xd1f8('0x19')](_0x371a43);}});}exports['IntervalIftime']=function(_0x4eed40){var _0x4540b2=_0x4eed40[_0xd1f8('0x20')];var _0x369e77=Array['isArray'](_0x4eed40['intervals'])?_0x4eed40[_0xd1f8('0x21')]:typeof _0x4eed40[_0xd1f8('0x21')]===_0xd1f8('0x22')?[_0x4eed40[_0xd1f8('0x21')]]:[];var _0x207bfc=_0x4eed40[_0xd1f8('0x23')]||undefined;var _0x2a89c3=![];if(_0x369e77[_0xd1f8('0x24')]){logger[_0xd1f8('0x10')](util[_0xd1f8('0x1e')](_0xd1f8('0x25'),_0x369e77[_0xd1f8('0x1c')](';\x20')));}if(_0x207bfc){logger[_0xd1f8('0x10')](util[_0xd1f8('0x1e')](_0xd1f8('0x26'),_0x207bfc));}logger[_0xd1f8('0x11')](_0xd1f8('0x27'),_0x2a89c3);logger[_0xd1f8('0x28')](_0xd1f8('0x29'),_0x4eed40);return Promise[_0xd1f8('0x2a')]()['then'](function(){if(Array['isArray'](_0x4540b2)){return checkArrayOfIntervals(_0x4540b2,_0x207bfc);}else if(_0x4540b2){return checkSingleInterval(_0x4540b2,_0x207bfc);}})[_0xd1f8('0xf')](function(_0x1fcb0d){var _0x53960d=_0x369e77[_0xd1f8('0x1a')](function(_0x1daa72,_0xaa5722){return _0x1daa72||iftime(_0xaa5722,_0x207bfc);},![]);_0x2a89c3=_0x1fcb0d||_0x53960d;return _0x2a89c3;})[_0xd1f8('0x13')](function(_0x4c2a3e){logger[_0xd1f8('0x14')]('IntervalIftime',_0x4eed40,_0x4c2a3e);throw this[_0xd1f8('0x14')](0x1f4,_0x4c2a3e[_0xd1f8('0x15')]);});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index d31a6c9..dfa9ae9 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 _0x5f66=['send','exports','Router','./jira.controller','post','isAuthenticated'];(function(_0x4bb581,_0x6f7037){var _0x316bf5=function(_0x1f6ed0){while(--_0x1f6ed0){_0x4bb581['push'](_0x4bb581['shift']());}};_0x316bf5(++_0x6f7037);}(_0x5f66,0x1a0));var _0x65f6=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x5f66[_0x465028];return _0xb783d4;};'use strict';var express=require('express');var router=express[_0x65f6('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x65f6('0x1'));router[_0x65f6('0x2')]('/',auth[_0x65f6('0x3')](),controller[_0x65f6('0x4')]);module[_0x65f6('0x5')]=router; \ No newline at end of file +var _0x2032=['isAuthenticated','send','Router','../../components/auth/service','./jira.controller'];(function(_0x32ec70,_0xcb11d1){var _0x5be994=function(_0x3bf492){while(--_0x3bf492){_0x32ec70['push'](_0x32ec70['shift']());}};_0x5be994(++_0xcb11d1);}(_0x2032,0xd9));var _0x2203=function(_0x1ace14,_0x9db7cf){_0x1ace14=_0x1ace14-0x0;var _0x3775a5=_0x2032[_0x1ace14];return _0x3775a5;};'use strict';var express=require('express');var router=express[_0x2203('0x0')]();var auth=require(_0x2203('0x1'));var controller=require(_0x2203('0x2'));router['post']('/',auth[_0x2203('0x3')](),controller[_0x2203('0x4')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index bd7e953..cf011a7 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 _0x2168=['reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','setEncoding','data','end','status','statusCode','parse','json','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','openIssue','body','x-forwarded-for','connection','remoteAddress','bluebird','https','../../config/logger','api','support','3eAmWpBVP0','key','MOTGUI','summary','\x20from\x20','description','stringify','issuetype','Bug','fields','customfield_11500','email','customfield_11501','newToken','customfield_11503','customfield_11504'];(function(_0xbb394c,_0x51d56e){var _0x4bd0ff=function(_0x3709e6){while(--_0x3709e6){_0xbb394c['push'](_0xbb394c['shift']());}};_0x4bd0ff(++_0x51d56e);}(_0x2168,0xd5));var _0x8216=function(_0x232075,_0x5b8916){_0x232075=_0x232075-0x0;var _0x1daa2c=_0x2168[_0x232075];return _0x1daa2c;};'use strict';var BPromise=require(_0x8216('0x0'));var https=require(_0x8216('0x1'));var logger=require(_0x8216('0x2'))(_0x8216('0x3'));var USERNAME=_0x8216('0x4');var PASSWORD=_0x8216('0x5');function openIssue(_0x455d82,_0x578e28){var _0x555901={'fields':{'project':{'key':_0x455d82[_0x8216('0x6')]||_0x8216('0x7')},'summary':(_0x455d82[_0x8216('0x8')]||'Report')+_0x8216('0x9')+_0x455d82['ip'],'description':_0x455d82[_0x8216('0xa')]||JSON[_0x8216('0xb')](_0x455d82),'issuetype':{'name':_0x455d82[_0x8216('0xc')]||_0x8216('0xd')}}};_0x555901[_0x8216('0xe')][_0x8216('0xf')]=_0x455d82[_0x8216('0x10')];_0x555901[_0x8216('0xe')][_0x8216('0x11')]=_0x455d82['oldToken'];_0x555901[_0x8216('0xe')]['customfield_11502']=_0x455d82[_0x8216('0x12')];_0x555901['fields'][_0x8216('0x13')]=_0x455d82['name'];_0x555901['fields'][_0x8216('0x14')]=_0x455d82[_0x8216('0x15')];_0x555901[_0x8216('0xe')][_0x8216('0x16')]=_0x455d82['ip'];var _0x30497e={'host':_0x8216('0x17'),'port':0x1bb,'path':_0x8216('0x18'),'method':_0x8216('0x19'),'timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)['toString']('base64')}};var _0x113a30=JSON[_0x8216('0xb')](_0x555901);var _0x475d4b=https['request'](_0x30497e,function(_0x3c6f1c){_0x3c6f1c[_0x8216('0x1a')]('utf8');var _0x40ab1d='';_0x3c6f1c['on'](_0x8216('0x1b'),function(_0x7eec1b){_0x40ab1d+=_0x7eec1b;});_0x3c6f1c['on'](_0x8216('0x1c'),function(){if(_0x578e28){return _0x578e28[_0x8216('0x1d')](_0x3c6f1c[_0x8216('0x1e')])['json'](JSON[_0x8216('0x1f')](_0x40ab1d));}});});_0x475d4b['on']('error',function(_0x1ec22b){if(_0x578e28){return _0x578e28[_0x8216('0x1d')](0x1f4)[_0x8216('0x20')]({'errors':[{'message':_0x8216('0x21'),'type':'api.jira'}]});}});_0x475d4b['write'](_0x113a30);_0x475d4b['end']();}exports[_0x8216('0x22')]=openIssue;exports['send']=function(_0x1f4bdd,_0x431c54){_0x1f4bdd[_0x8216('0x23')]['ip']=_0x1f4bdd['headers'][_0x8216('0x24')]||_0x1f4bdd[_0x8216('0x25')]['remoteAddress']||_0x1f4bdd['socket'][_0x8216('0x26')]||_0x1f4bdd[_0x8216('0x25')]['socket'][_0x8216('0x26')];return openIssue(_0x1f4bdd[_0x8216('0x23')],_0x431c54);}; \ No newline at end of file +var _0x63e6=['track.xcallymotion.com','POST','application/json','Basic\x20','toString','base64','request','setEncoding','utf8','end','status','statusCode','parse','error','json','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','body','x-forwarded-for','remoteAddress','socket','bluebird','https','../../config/logger','api','support','key','summary','Report','\x20from\x20','description','stringify','issuetype','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','name','customfield_11504','reason'];(function(_0x2508fd,_0xa8375b){var _0x3ce952=function(_0x168476){while(--_0x168476){_0x2508fd['push'](_0x2508fd['shift']());}};_0x3ce952(++_0xa8375b);}(_0x63e6,0x103));var _0x663e=function(_0x34664d,_0x5a9943){_0x34664d=_0x34664d-0x0;var _0x2865cf=_0x63e6[_0x34664d];return _0x2865cf;};'use strict';var BPromise=require(_0x663e('0x0'));var https=require(_0x663e('0x1'));var logger=require(_0x663e('0x2'))(_0x663e('0x3'));var USERNAME=_0x663e('0x4');var PASSWORD='3eAmWpBVP0';function openIssue(_0x34ae0c,_0x3c83f6){var _0x3caeaa={'fields':{'project':{'key':_0x34ae0c[_0x663e('0x5')]||'MOTGUI'},'summary':(_0x34ae0c[_0x663e('0x6')]||_0x663e('0x7'))+_0x663e('0x8')+_0x34ae0c['ip'],'description':_0x34ae0c[_0x663e('0x9')]||JSON[_0x663e('0xa')](_0x34ae0c),'issuetype':{'name':_0x34ae0c[_0x663e('0xb')]||'Bug'}}};_0x3caeaa[_0x663e('0xc')][_0x663e('0xd')]=_0x34ae0c[_0x663e('0xe')];_0x3caeaa[_0x663e('0xc')][_0x663e('0xf')]=_0x34ae0c[_0x663e('0x10')];_0x3caeaa['fields'][_0x663e('0x11')]=_0x34ae0c[_0x663e('0x12')];_0x3caeaa[_0x663e('0xc')][_0x663e('0x13')]=_0x34ae0c[_0x663e('0x14')];_0x3caeaa['fields'][_0x663e('0x15')]=_0x34ae0c[_0x663e('0x16')];_0x3caeaa['fields']['customfield_10102']=_0x34ae0c['ip'];var _0x5686a8={'host':_0x663e('0x17'),'port':0x1bb,'path':'/rest/api/2/issue','method':_0x663e('0x18'),'timeout':0x4e20,'headers':{'Content-Type':_0x663e('0x19'),'Authorization':_0x663e('0x1a')+new Buffer(USERNAME+':'+PASSWORD)[_0x663e('0x1b')](_0x663e('0x1c'))}};var _0xf9d902=JSON[_0x663e('0xa')](_0x3caeaa);var _0x6494d6=https[_0x663e('0x1d')](_0x5686a8,function(_0x49272c){_0x49272c[_0x663e('0x1e')](_0x663e('0x1f'));var _0x3d7cee='';_0x49272c['on']('data',function(_0x2b8513){_0x3d7cee+=_0x2b8513;});_0x49272c['on'](_0x663e('0x20'),function(){if(_0x3c83f6){return _0x3c83f6[_0x663e('0x21')](_0x49272c[_0x663e('0x22')])['json'](JSON[_0x663e('0x23')](_0x3d7cee));}});});_0x6494d6['on'](_0x663e('0x24'),function(_0x21acea){if(_0x3c83f6){return _0x3c83f6[_0x663e('0x21')](0x1f4)[_0x663e('0x25')]({'errors':[{'message':_0x663e('0x26'),'type':_0x663e('0x27')}]});}});_0x6494d6[_0x663e('0x28')](_0xf9d902);_0x6494d6[_0x663e('0x20')]();}exports[_0x663e('0x29')]=openIssue;exports[_0x663e('0x2a')]=function(_0x185e3b,_0x3ad73a){_0x185e3b[_0x663e('0x2b')]['ip']=_0x185e3b['headers'][_0x663e('0x2c')]||_0x185e3b['connection'][_0x663e('0x2d')]||_0x185e3b[_0x663e('0x2e')][_0x663e('0x2d')]||_0x185e3b['connection'][_0x663e('0x2e')][_0x663e('0x2d')];return openIssue(_0x185e3b[_0x663e('0x2b')],_0x3ad73a);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index d4cecce..7362f06 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 _0xee5b=['fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','show','post','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','Router'];(function(_0x45b06c,_0x2a75e9){var _0x2136c5=function(_0x3bbb39){while(--_0x3bbb39){_0x45b06c['push'](_0x45b06c['shift']());}};_0x2136c5(++_0x2a75e9);}(_0xee5b,0x1f4));var _0xbee5=function(_0x4c8f5d,_0x28bf62){_0x4c8f5d=_0x4c8f5d-0x0;var _0x1cf1ca=_0xee5b[_0x4c8f5d];return _0x1cf1ca;};'use strict';var multer=require(_0xbee5('0x0'));var util=require('util');var path=require(_0xbee5('0x1'));var timeout=require(_0xbee5('0x2'));var express=require('express');var router=express[_0xbee5('0x3')]();var fs_extra=require(_0xbee5('0x4'));var auth=require(_0xbee5('0x5'));var interaction=require(_0xbee5('0x6'));var config=require('../../config/environment');var controller=require('./jscriptyAnswerReport.controller');router[_0xbee5('0x7')]('/',auth[_0xbee5('0x8')](),controller[_0xbee5('0x9')]);router[_0xbee5('0x7')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0xbee5('0x8')](),controller[_0xbee5('0xa')]);router[_0xbee5('0xb')]('/',auth[_0xbee5('0x8')](),controller['create']);router[_0xbee5('0xc')](_0xbee5('0xd'),auth[_0xbee5('0x8')](),controller[_0xbee5('0xe')]);router[_0xbee5('0xf')](_0xbee5('0xd'),auth[_0xbee5('0x8')](),controller[_0xbee5('0x10')]);module[_0xbee5('0x11')]=router; \ No newline at end of file +var _0xd2ea=['./jscriptyAnswerReport.controller','get','isAuthenticated','/describe','/:id','show','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1a468b,_0x5601e5){var _0x482135=function(_0x5ea5c1){while(--_0x5ea5c1){_0x1a468b['push'](_0x1a468b['shift']());}};_0x482135(++_0x5601e5);}(_0xd2ea,0x15f));var _0xad2e=function(_0x1fcea1,_0x4052fa){_0x1fcea1=_0x1fcea1-0x0;var _0x453124=_0xd2ea[_0x1fcea1];return _0x453124;};'use strict';var multer=require(_0xad2e('0x0'));var util=require(_0xad2e('0x1'));var path=require(_0xad2e('0x2'));var timeout=require(_0xad2e('0x3'));var express=require(_0xad2e('0x4'));var router=express['Router']();var fs_extra=require(_0xad2e('0x5'));var auth=require(_0xad2e('0x6'));var interaction=require(_0xad2e('0x7'));var config=require(_0xad2e('0x8'));var controller=require(_0xad2e('0x9'));router[_0xad2e('0xa')]('/',auth[_0xad2e('0xb')](),controller['index']);router[_0xad2e('0xa')](_0xad2e('0xc'),auth[_0xad2e('0xb')](),controller['describe']);router[_0xad2e('0xa')](_0xad2e('0xd'),auth['isAuthenticated'](),controller[_0xad2e('0xe')]);router['post']('/',auth[_0xad2e('0xb')](),controller[_0xad2e('0xf')]);router[_0xad2e('0x10')](_0xad2e('0xd'),auth['isAuthenticated'](),controller[_0xad2e('0x11')]);router['delete'](_0xad2e('0xd'),auth[_0xad2e('0xb')](),controller[_0xad2e('0x12')]);module[_0xad2e('0x13')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 84bf950..21ea32d 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(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x7a54,0x106));var _0x47a5=function(_0x5e1c8b,_0x3ce8ab){_0x5e1c8b=_0x5e1c8b-0x0;var _0x2cc75c=_0x7a54[_0x5e1c8b];return _0x2cc75c;};'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(_0x5a3054,_0x1e4b5d){_0x5a3054=_0x5a3054-0x0;var _0x57fd33=_0x7a54[_0x5a3054];return _0x57fd33;};'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 8a189d5..a1ed53c 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 _0xf96b=['model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','show','params','includeAll','find','create','body','catch','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','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','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject','save','update','then','error','stack','name','send','index','map','JscriptyAnswerReport','rawAttributes','type','key'];(function(_0x5b733d,_0x272606){var _0x2b7995=function(_0x1e5bf8){while(--_0x1e5bf8){_0x5b733d['push'](_0x5b733d['shift']());}};_0x2b7995(++_0x272606);}(_0xf96b,0x109));var _0xbf96=function(_0x5aedf6,_0x182448){_0x5aedf6=_0x5aedf6-0x0;var _0x1cbfad=_0xf96b[_0x5aedf6];return _0x1cbfad;};'use strict';var emlformat=require(_0xbf96('0x0'));var rimraf=require(_0xbf96('0x1'));var zipdir=require(_0xbf96('0x2'));var jsonpatch=require(_0xbf96('0x3'));var rp=require(_0xbf96('0x4'));var moment=require(_0xbf96('0x5'));var BPromise=require(_0xbf96('0x6'));var Mustache=require(_0xbf96('0x7'));var util=require(_0xbf96('0x8'));var path=require(_0xbf96('0x9'));var sox=require(_0xbf96('0xa'));var csv=require(_0xbf96('0xb'));var ejs=require(_0xbf96('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbf96('0xd'));var squel=require(_0xbf96('0xe'));var crypto=require(_0xbf96('0xf'));var jsforce=require(_0xbf96('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xbf96('0xb'));var querystring=require(_0xbf96('0x11'));var Papa=require(_0xbf96('0x12'));var Redis=require(_0xbf96('0x13'));var authService=require(_0xbf96('0x14'));var qs=require(_0xbf96('0x15'));var as=require(_0xbf96('0x16'));var hardwareService=require(_0xbf96('0x17'));var logger=require('../../config/logger')(_0xbf96('0x18'));var utils=require(_0xbf96('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xbf96('0x1a'));var db=require(_0xbf96('0x1b'))['db'];function respondWithStatusCode(_0x17115d,_0x48a709){_0x48a709=_0x48a709||0xcc;return function(_0xafd96c){if(_0xafd96c){return _0x17115d[_0xbf96('0x1c')](_0x48a709);}return _0x17115d[_0xbf96('0x1d')](_0x48a709)[_0xbf96('0x1e')]();};}function respondWithResult(_0x424819,_0x3e7a6b){_0x3e7a6b=_0x3e7a6b||0xc8;return function(_0x59c141){if(_0x59c141){return _0x424819[_0xbf96('0x1d')](_0x3e7a6b)[_0xbf96('0x1f')](_0x59c141);}};}function respondWithFilteredResult(_0x1f1814,_0x2dc5c4){return function(_0x38205a){if(_0x38205a){var _0xbb399b=typeof _0x2dc5c4[_0xbf96('0x20')]==='undefined'&&typeof _0x2dc5c4[_0xbf96('0x21')]==='undefined';var _0x41254f=_0x38205a[_0xbf96('0x22')];var _0x568425=_0xbb399b?0x0:_0x2dc5c4[_0xbf96('0x20')];var _0x64b2f9=_0xbb399b?_0x38205a['count']:_0x2dc5c4[_0xbf96('0x20')]+_0x2dc5c4[_0xbf96('0x21')];var _0x2bef74;if(_0x64b2f9>=_0x41254f){_0x64b2f9=_0x41254f;_0x2bef74=0xc8;}else{_0x2bef74=0xce;}_0x1f1814[_0xbf96('0x1d')](_0x2bef74);return _0x1f1814[_0xbf96('0x23')](_0xbf96('0x24'),_0x568425+'-'+_0x64b2f9+'/'+_0x41254f)[_0xbf96('0x1f')](_0x38205a);}return null;};}function patchUpdates(_0x5450e4){return function(_0x38cc22){try{jsonpatch['apply'](_0x38cc22,_0x5450e4,!![]);}catch(_0xa44474){return BPromise[_0xbf96('0x25')](_0xa44474);}return _0x38cc22[_0xbf96('0x26')]();};}function saveUpdates(_0x4c65ae,_0x21cf3c){return function(_0x55025c){if(_0x55025c){return _0x55025c[_0xbf96('0x27')](_0x4c65ae)[_0xbf96('0x28')](function(_0xdd84d9){return _0xdd84d9;});}return null;};}function removeEntity(_0x4e511b,_0x1c92f9){return function(_0xf132af){if(_0xf132af){return _0xf132af['destroy']()['then'](function(){_0x4e511b[_0xbf96('0x1d')](0xcc)[_0xbf96('0x1e')]();});}};}function handleEntityNotFound(_0x363379,_0x56d265){return function(_0x527558){if(!_0x527558){_0x363379['sendStatus'](0x194);}return _0x527558;};}function handleError(_0x57c5cd,_0x8c3967){_0x8c3967=_0x8c3967||0x1f4;return function(_0x30f345){logger[_0xbf96('0x29')](_0x30f345[_0xbf96('0x2a')]);if(_0x30f345['name']){delete _0x30f345[_0xbf96('0x2b')];}_0x57c5cd[_0xbf96('0x1d')](_0x8c3967)[_0xbf96('0x2c')](_0x30f345);};}exports[_0xbf96('0x2d')]=function(_0x5e99b3,_0x59edc6){var _0x16a659={},_0x1366e6={},_0x4138ef={'count':0x0,'rows':[]};var _0xb248da=_[_0xbf96('0x2e')](db[_0xbf96('0x2f')][_0xbf96('0x30')],function(_0x2764e0){return{'name':_0x2764e0['fieldName'],'type':_0x2764e0[_0xbf96('0x31')][_0xbf96('0x32')]};});_0x1366e6[_0xbf96('0x33')]=_['map'](_0xb248da,'name');_0x1366e6[_0xbf96('0x34')]=_['keys'](_0x5e99b3[_0xbf96('0x34')]);_0x1366e6[_0xbf96('0x35')]=_[_0xbf96('0x36')](_0x1366e6[_0xbf96('0x33')],_0x1366e6[_0xbf96('0x34')]);_0x16a659[_0xbf96('0x37')]=_[_0xbf96('0x36')](_0x1366e6[_0xbf96('0x33')],qs[_0xbf96('0x38')](_0x5e99b3['query'][_0xbf96('0x38')]));_0x16a659['attributes']=_0x16a659[_0xbf96('0x37')][_0xbf96('0x39')]?_0x16a659[_0xbf96('0x37')]:_0x1366e6['model'];if(!_0x5e99b3[_0xbf96('0x34')][_0xbf96('0x3a')](_0xbf96('0x3b'))){_0x16a659[_0xbf96('0x21')]=qs[_0xbf96('0x21')](_0x5e99b3[_0xbf96('0x34')][_0xbf96('0x21')]);_0x16a659[_0xbf96('0x20')]=qs['offset'](_0x5e99b3[_0xbf96('0x34')]['offset']);}_0x16a659[_0xbf96('0x3c')]=qs[_0xbf96('0x3d')](_0x5e99b3[_0xbf96('0x34')][_0xbf96('0x3d')]);_0x16a659[_0xbf96('0x3e')]=qs['filters'](_[_0xbf96('0x3f')](_0x5e99b3['query'],_0x1366e6[_0xbf96('0x35')]),_0xb248da);if(_0x5e99b3[_0xbf96('0x34')][_0xbf96('0x40')]){_0x16a659[_0xbf96('0x3e')]=_[_0xbf96('0x41')](_0x16a659[_0xbf96('0x3e')],{'$or':_['map'](_0xb248da,function(_0x1ef8cd){if(_0x1ef8cd['type']!==_0xbf96('0x42')){var _0x3db5f7={};_0x3db5f7[_0x1ef8cd[_0xbf96('0x2b')]]={'$like':'%'+_0x5e99b3['query'][_0xbf96('0x40')]+'%'};return _0x3db5f7;}})});}_0x16a659=_[_0xbf96('0x41')]({},_0x16a659,_0x5e99b3[_0xbf96('0x43')]);var _0x4caef2={'where':_0x16a659[_0xbf96('0x3e')]};return db[_0xbf96('0x2f')][_0xbf96('0x22')](_0x4caef2)[_0xbf96('0x28')](function(_0x17f345){_0x4138ef[_0xbf96('0x22')]=_0x17f345;if(_0x5e99b3[_0xbf96('0x34')]['includeAll']){_0x16a659[_0xbf96('0x44')]=[{'all':!![]}];}return db[_0xbf96('0x2f')]['findAll'](_0x16a659);})[_0xbf96('0x28')](function(_0x3cfb3c){_0x4138ef[_0xbf96('0x45')]=_0x3cfb3c;return _0x4138ef;})[_0xbf96('0x28')](respondWithFilteredResult(_0x59edc6,_0x16a659))['catch'](handleError(_0x59edc6,null));};exports[_0xbf96('0x46')]=function(_0x1b6cfd,_0x1a39d1){var _0x2b565f={'raw':!![],'where':{'id':_0x1b6cfd[_0xbf96('0x47')]['id']}},_0x27b78d={};_0x27b78d['model']=_['keys'](db[_0xbf96('0x2f')][_0xbf96('0x30')]);_0x27b78d[_0xbf96('0x34')]=_['keys'](_0x1b6cfd[_0xbf96('0x34')]);_0x27b78d[_0xbf96('0x35')]=_[_0xbf96('0x36')](_0x27b78d[_0xbf96('0x33')],_0x27b78d[_0xbf96('0x34')]);_0x2b565f[_0xbf96('0x37')]=_[_0xbf96('0x36')](_0x27b78d[_0xbf96('0x33')],qs[_0xbf96('0x38')](_0x1b6cfd['query'][_0xbf96('0x38')]));_0x2b565f['attributes']=_0x2b565f['attributes'][_0xbf96('0x39')]?_0x2b565f['attributes']:_0x27b78d[_0xbf96('0x33')];if(_0x1b6cfd['query'][_0xbf96('0x48')]){_0x2b565f[_0xbf96('0x44')]=[{'all':!![]}];}_0x2b565f=_[_0xbf96('0x41')]({},_0x2b565f,_0x1b6cfd['options']);return db[_0xbf96('0x2f')][_0xbf96('0x49')](_0x2b565f)['then'](handleEntityNotFound(_0x1a39d1,null))[_0xbf96('0x28')](respondWithResult(_0x1a39d1,null))['catch'](handleError(_0x1a39d1,null));};exports[_0xbf96('0x4a')]=function(_0xa852de,_0x1bb569){return db[_0xbf96('0x2f')][_0xbf96('0x4a')](_0xa852de[_0xbf96('0x4b')],{})['then'](respondWithResult(_0x1bb569,0xc9))[_0xbf96('0x4c')](handleError(_0x1bb569,null));};exports[_0xbf96('0x27')]=function(_0x86135f,_0x4bb10e){if(_0x86135f['body']['id']){delete _0x86135f[_0xbf96('0x4b')]['id'];}return db[_0xbf96('0x2f')][_0xbf96('0x49')]({'where':{'id':_0x86135f[_0xbf96('0x47')]['id']}})[_0xbf96('0x28')](handleEntityNotFound(_0x4bb10e,null))['then'](saveUpdates(_0x86135f[_0xbf96('0x4b')],null))[_0xbf96('0x28')](respondWithResult(_0x4bb10e,null))[_0xbf96('0x4c')](handleError(_0x4bb10e,null));};exports[_0xbf96('0x4d')]=function(_0x5874b7,_0x4f173f){return db[_0xbf96('0x2f')][_0xbf96('0x49')]({'where':{'id':_0x5874b7[_0xbf96('0x47')]['id']}})['then'](handleEntityNotFound(_0x4f173f,null))[_0xbf96('0x28')](removeEntity(_0x4f173f,null))['catch'](handleError(_0x4f173f,null));};exports['describe']=function(_0x45129c,_0x32cca5){return db[_0xbf96('0x2f')][_0xbf96('0x4e')]()[_0xbf96('0x28')](respondWithResult(_0x32cca5,null))['catch'](handleError(_0x32cca5,null));}; \ No newline at end of file +var _0x8ce1=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','error','send','index','JscriptyAnswerReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','map','VIRTUAL','name','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'];(function(_0x2c96f6,_0x877207){var _0x6d4808=function(_0x567e0c){while(--_0x567e0c){_0x2c96f6['push'](_0x2c96f6['shift']());}};_0x6d4808(++_0x877207);}(_0x8ce1,0x183));var _0x18ce=function(_0x46d351,_0x5cf590){_0x46d351=_0x46d351-0x0;var _0x4f67d9=_0x8ce1[_0x46d351];return _0x4f67d9;};'use strict';var emlformat=require(_0x18ce('0x0'));var rimraf=require(_0x18ce('0x1'));var zipdir=require(_0x18ce('0x2'));var jsonpatch=require(_0x18ce('0x3'));var rp=require(_0x18ce('0x4'));var moment=require(_0x18ce('0x5'));var BPromise=require(_0x18ce('0x6'));var Mustache=require(_0x18ce('0x7'));var util=require(_0x18ce('0x8'));var path=require(_0x18ce('0x9'));var sox=require(_0x18ce('0xa'));var csv=require(_0x18ce('0xb'));var ejs=require(_0x18ce('0xc'));var fs=require('fs');var fs_extra=require(_0x18ce('0xd'));var _=require(_0x18ce('0xe'));var squel=require(_0x18ce('0xf'));var crypto=require('crypto');var jsforce=require(_0x18ce('0x10'));var deskjs=require(_0x18ce('0x11'));var toCsv=require(_0x18ce('0xb'));var querystring=require(_0x18ce('0x12'));var Papa=require('papaparse');var Redis=require(_0x18ce('0x13'));var authService=require(_0x18ce('0x14'));var qs=require(_0x18ce('0x15'));var as=require(_0x18ce('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x18ce('0x17'));var utils=require(_0x18ce('0x18'));var config=require(_0x18ce('0x19'));var licenseUtil=require(_0x18ce('0x1a'));var db=require(_0x18ce('0x1b'))['db'];function respondWithStatusCode(_0x5e8c23,_0xbd514b){_0xbd514b=_0xbd514b||0xcc;return function(_0x402ba4){if(_0x402ba4){return _0x5e8c23[_0x18ce('0x1c')](_0xbd514b);}return _0x5e8c23[_0x18ce('0x1d')](_0xbd514b)[_0x18ce('0x1e')]();};}function respondWithResult(_0x5daf04,_0x176797){_0x176797=_0x176797||0xc8;return function(_0xdd4626){if(_0xdd4626){return _0x5daf04[_0x18ce('0x1d')](_0x176797)[_0x18ce('0x1f')](_0xdd4626);}};}function respondWithFilteredResult(_0x46e346,_0x36b5da){return function(_0x17460e){if(_0x17460e){var _0x4a934f=typeof _0x36b5da[_0x18ce('0x20')]===_0x18ce('0x21')&&typeof _0x36b5da[_0x18ce('0x22')]===_0x18ce('0x21');var _0x1edc10=_0x17460e[_0x18ce('0x23')];var _0x482458=_0x4a934f?0x0:_0x36b5da[_0x18ce('0x20')];var _0x29c691=_0x4a934f?_0x17460e[_0x18ce('0x23')]:_0x36b5da['offset']+_0x36b5da[_0x18ce('0x22')];var _0x2fa3d4;if(_0x29c691>=_0x1edc10){_0x29c691=_0x1edc10;_0x2fa3d4=0xc8;}else{_0x2fa3d4=0xce;}_0x46e346[_0x18ce('0x1d')](_0x2fa3d4);return _0x46e346['set'](_0x18ce('0x24'),_0x482458+'-'+_0x29c691+'/'+_0x1edc10)[_0x18ce('0x1f')](_0x17460e);}return null;};}function patchUpdates(_0x5d22cd){return function(_0x29c1ab){try{jsonpatch[_0x18ce('0x25')](_0x29c1ab,_0x5d22cd,!![]);}catch(_0x16802e){return BPromise[_0x18ce('0x26')](_0x16802e);}return _0x29c1ab[_0x18ce('0x27')]();};}function saveUpdates(_0xd41f29,_0x35abf9){return function(_0x545459){if(_0x545459){return _0x545459[_0x18ce('0x28')](_0xd41f29)['then'](function(_0x482c90){return _0x482c90;});}return null;};}function removeEntity(_0x5d2299,_0x32e910){return function(_0x576ecc){if(_0x576ecc){return _0x576ecc[_0x18ce('0x29')]()[_0x18ce('0x2a')](function(){_0x5d2299[_0x18ce('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x53abbd,_0x55e17c){return function(_0x317812){if(!_0x317812){_0x53abbd[_0x18ce('0x1c')](0x194);}return _0x317812;};}function handleError(_0x12dbd2,_0x461113){_0x461113=_0x461113||0x1f4;return function(_0x62b2bd){logger[_0x18ce('0x2b')](_0x62b2bd['stack']);if(_0x62b2bd['name']){delete _0x62b2bd['name'];}_0x12dbd2[_0x18ce('0x1d')](_0x461113)[_0x18ce('0x2c')](_0x62b2bd);};}exports[_0x18ce('0x2d')]=function(_0x5f3ec2,_0x1a87f6){var _0xf2683f={},_0x1988e4={},_0x5ef96c={'count':0x0,'rows':[]};var _0x56d296=_['map'](db[_0x18ce('0x2e')][_0x18ce('0x2f')],function(_0x5c2d96){return{'name':_0x5c2d96['fieldName'],'type':_0x5c2d96[_0x18ce('0x30')][_0x18ce('0x31')]};});_0x1988e4[_0x18ce('0x32')]=_['map'](_0x56d296,'name');_0x1988e4[_0x18ce('0x33')]=_[_0x18ce('0x34')](_0x5f3ec2[_0x18ce('0x33')]);_0x1988e4[_0x18ce('0x35')]=_[_0x18ce('0x36')](_0x1988e4[_0x18ce('0x32')],_0x1988e4[_0x18ce('0x33')]);_0xf2683f[_0x18ce('0x37')]=_['intersection'](_0x1988e4['model'],qs[_0x18ce('0x38')](_0x5f3ec2[_0x18ce('0x33')]['fields']));_0xf2683f[_0x18ce('0x37')]=_0xf2683f['attributes'][_0x18ce('0x39')]?_0xf2683f['attributes']:_0x1988e4[_0x18ce('0x32')];if(!_0x5f3ec2[_0x18ce('0x33')][_0x18ce('0x3a')]('nolimit')){_0xf2683f['limit']=qs[_0x18ce('0x22')](_0x5f3ec2[_0x18ce('0x33')]['limit']);_0xf2683f['offset']=qs[_0x18ce('0x20')](_0x5f3ec2[_0x18ce('0x33')][_0x18ce('0x20')]);}_0xf2683f[_0x18ce('0x3b')]=qs[_0x18ce('0x3c')](_0x5f3ec2[_0x18ce('0x33')][_0x18ce('0x3c')]);_0xf2683f[_0x18ce('0x3d')]=qs[_0x18ce('0x35')](_[_0x18ce('0x3e')](_0x5f3ec2[_0x18ce('0x33')],_0x1988e4[_0x18ce('0x35')]),_0x56d296);if(_0x5f3ec2[_0x18ce('0x33')]['filter']){_0xf2683f[_0x18ce('0x3d')]=_[_0x18ce('0x3f')](_0xf2683f[_0x18ce('0x3d')],{'$or':_[_0x18ce('0x40')](_0x56d296,function(_0x1e67dd){if(_0x1e67dd[_0x18ce('0x30')]!==_0x18ce('0x41')){var _0x27c55a={};_0x27c55a[_0x1e67dd[_0x18ce('0x42')]]={'$like':'%'+_0x5f3ec2[_0x18ce('0x33')]['filter']+'%'};return _0x27c55a;}})});}_0xf2683f=_['merge']({},_0xf2683f,_0x5f3ec2[_0x18ce('0x43')]);var _0x23486c={'where':_0xf2683f[_0x18ce('0x3d')]};return db[_0x18ce('0x2e')][_0x18ce('0x23')](_0x23486c)[_0x18ce('0x2a')](function(_0x2eba88){_0x5ef96c['count']=_0x2eba88;if(_0x5f3ec2['query'][_0x18ce('0x44')]){_0xf2683f[_0x18ce('0x45')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x18ce('0x46')](_0xf2683f);})[_0x18ce('0x2a')](function(_0x2941ce){_0x5ef96c[_0x18ce('0x47')]=_0x2941ce;return _0x5ef96c;})[_0x18ce('0x2a')](respondWithFilteredResult(_0x1a87f6,_0xf2683f))[_0x18ce('0x48')](handleError(_0x1a87f6,null));};exports[_0x18ce('0x49')]=function(_0x2a96a7,_0x33b409){var _0x1d6d5f={'raw':!![],'where':{'id':_0x2a96a7[_0x18ce('0x4a')]['id']}},_0x3885e6={};_0x3885e6['model']=_[_0x18ce('0x34')](db[_0x18ce('0x2e')][_0x18ce('0x2f')]);_0x3885e6[_0x18ce('0x33')]=_[_0x18ce('0x34')](_0x2a96a7[_0x18ce('0x33')]);_0x3885e6[_0x18ce('0x35')]=_['intersection'](_0x3885e6['model'],_0x3885e6[_0x18ce('0x33')]);_0x1d6d5f[_0x18ce('0x37')]=_[_0x18ce('0x36')](_0x3885e6[_0x18ce('0x32')],qs['fields'](_0x2a96a7[_0x18ce('0x33')][_0x18ce('0x38')]));_0x1d6d5f[_0x18ce('0x37')]=_0x1d6d5f['attributes']['length']?_0x1d6d5f[_0x18ce('0x37')]:_0x3885e6[_0x18ce('0x32')];if(_0x2a96a7['query'][_0x18ce('0x44')]){_0x1d6d5f[_0x18ce('0x45')]=[{'all':!![]}];}_0x1d6d5f=_[_0x18ce('0x3f')]({},_0x1d6d5f,_0x2a96a7[_0x18ce('0x43')]);return db[_0x18ce('0x2e')][_0x18ce('0x4b')](_0x1d6d5f)[_0x18ce('0x2a')](handleEntityNotFound(_0x33b409,null))['then'](respondWithResult(_0x33b409,null))[_0x18ce('0x48')](handleError(_0x33b409,null));};exports[_0x18ce('0x4c')]=function(_0x476c6a,_0x1e445d){return db[_0x18ce('0x2e')][_0x18ce('0x4c')](_0x476c6a[_0x18ce('0x4d')],{})[_0x18ce('0x2a')](respondWithResult(_0x1e445d,0xc9))[_0x18ce('0x48')](handleError(_0x1e445d,null));};exports[_0x18ce('0x28')]=function(_0x1211d0,_0x3f9960){if(_0x1211d0[_0x18ce('0x4d')]['id']){delete _0x1211d0[_0x18ce('0x4d')]['id'];}return db['JscriptyAnswerReport'][_0x18ce('0x4b')]({'where':{'id':_0x1211d0[_0x18ce('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3f9960,null))[_0x18ce('0x2a')](saveUpdates(_0x1211d0['body'],null))[_0x18ce('0x2a')](respondWithResult(_0x3f9960,null))['catch'](handleError(_0x3f9960,null));};exports[_0x18ce('0x29')]=function(_0x188f57,_0x3d5b1b){return db[_0x18ce('0x2e')]['find']({'where':{'id':_0x188f57[_0x18ce('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3d5b1b,null))['then'](removeEntity(_0x3d5b1b,null))[_0x18ce('0x48')](handleError(_0x3d5b1b,null));};exports[_0x18ce('0x4e')]=function(_0x8aa4a7,_0x5f164a){return db['JscriptyAnswerReport'][_0x18ce('0x4e')]()[_0x18ce('0x2a')](respondWithResult(_0x5f164a,null))[_0x18ce('0x48')](handleError(_0x5f164a,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 4330048..a7e6257 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 _0x8432=['rimraf','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','report_jscripty_answers','lodash','../../config/logger','api','bluebird','request-promise','path'];(function(_0x31631c,_0x47179b){var _0x2de94e=function(_0xad4f56){while(--_0xad4f56){_0x31631c['push'](_0x31631c['shift']());}};_0x2de94e(++_0x47179b);}(_0x8432,0x1f2));var _0x2843=function(_0x5496ff,_0x104d17){_0x5496ff=_0x5496ff-0x0;var _0x36881c=_0x8432[_0x5496ff];return _0x36881c;};'use strict';var _=require(_0x2843('0x0'));var util=require('util');var logger=require(_0x2843('0x1'))(_0x2843('0x2'));var moment=require('moment');var BPromise=require(_0x2843('0x3'));var rp=require(_0x2843('0x4'));var fs=require('fs');var path=require(_0x2843('0x5'));var rimraf=require(_0x2843('0x6'));var config=require('../../config/environment');var attributes=require(_0x2843('0x7'));module[_0x2843('0x8')]=function(_0x33e917,_0x1b77bb){return _0x33e917[_0x2843('0x9')](_0x2843('0xa'),attributes,{'tableName':_0x2843('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x77e1=['path','rimraf','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','report_jscripty_answers','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0x77e1,0x14c));var _0x177e=function(_0x4627ed,_0x468699){_0x4627ed=_0x4627ed-0x0;var _0x5c4e0b=_0x77e1[_0x4627ed];return _0x5c4e0b;};'use strict';var _=require('lodash');var util=require(_0x177e('0x0'));var logger=require(_0x177e('0x1'))(_0x177e('0x2'));var moment=require(_0x177e('0x3'));var BPromise=require(_0x177e('0x4'));var rp=require(_0x177e('0x5'));var fs=require('fs');var path=require(_0x177e('0x6'));var rimraf=require(_0x177e('0x7'));var config=require('../../config/environment');var attributes=require(_0x177e('0x8'));module[_0x177e('0x9')]=function(_0x423b9e,_0x5d3130){return _0x423b9e[_0x177e('0xa')](_0x177e('0xb'),attributes,{'tableName':_0x177e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js index ff8774c..728595c 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 _0x4596=['JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then'];(function(_0x46137c,_0x320d2b){var _0x65377d=function(_0x2f9e61){while(--_0x2f9e61){_0x46137c['push'](_0x46137c['shift']());}};_0x65377d(++_0x320d2b);}(_0x4596,0x181));var _0x6459=function(_0x5aa042,_0x4b2a2d){_0x5aa042=_0x5aa042-0x0;var _0x39cc72=_0x4596[_0x5aa042];return _0x39cc72;};'use strict';var _=require(_0x6459('0x0'));var util=require(_0x6459('0x1'));var moment=require('moment');var BPromise=require(_0x6459('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6459('0x3'))['db'];var utils=require(_0x6459('0x4'));var logger=require(_0x6459('0x5'))(_0x6459('0x6'));var config=require(_0x6459('0x7'));var jayson=require(_0x6459('0x8'));var client=jayson['client'][_0x6459('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x50fbe1,_0x21f2b9,_0x2d8029){return new BPromise(function(_0x3a3f9a,_0x434fb9){return client['request'](_0x50fbe1,_0x2d8029)[_0x6459('0xa')](function(_0x12039b){logger['info'](_0x6459('0xb'),_0x21f2b9,_0x6459('0xc'));logger[_0x6459('0xd')](_0x6459('0xe'),_0x21f2b9,_0x6459('0xc'),JSON[_0x6459('0xf')](_0x12039b));if(_0x12039b[_0x6459('0x10')]){if(_0x12039b[_0x6459('0x10')][_0x6459('0x11')]===0x1f4){logger[_0x6459('0x10')](_0x6459('0xb'),_0x21f2b9,_0x12039b['error'][_0x6459('0x12')]);return _0x434fb9(_0x12039b[_0x6459('0x10')]['message']);}logger[_0x6459('0x10')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x21f2b9,_0x12039b[_0x6459('0x10')][_0x6459('0x12')]);return _0x3a3f9a(_0x12039b[_0x6459('0x10')][_0x6459('0x12')]);}else{logger[_0x6459('0x13')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x21f2b9,'request\x20sent');_0x3a3f9a(_0x12039b[_0x6459('0x14')][_0x6459('0x12')]);}})[_0x6459('0x15')](function(_0x20e255){logger[_0x6459('0x10')](_0x6459('0xb'),_0x21f2b9,_0x20e255);_0x434fb9(_0x20e255);});});} \ No newline at end of file +var _0x2835=['request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s'];(function(_0x273600,_0x19a8d1){var _0x431a0c=function(_0x382628){while(--_0x382628){_0x273600['push'](_0x273600['shift']());}};_0x431a0c(++_0x19a8d1);}(_0x2835,0x11b));var _0x5283=function(_0x169d20,_0x4bdb9f){_0x169d20=_0x169d20-0x0;var _0x2bf2e4=_0x2835[_0x169d20];return _0x2bf2e4;};'use strict';var _=require(_0x5283('0x0'));var util=require(_0x5283('0x1'));var moment=require(_0x5283('0x2'));var BPromise=require('bluebird');var rs=require(_0x5283('0x3'));var fs=require('fs');var Redis=require(_0x5283('0x4'));var db=require(_0x5283('0x5'))['db'];var utils=require(_0x5283('0x6'));var logger=require(_0x5283('0x7'))(_0x5283('0x8'));var config=require(_0x5283('0x9'));var jayson=require(_0x5283('0xa'));var client=jayson[_0x5283('0xb')][_0x5283('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1f719b,_0x489e2b,_0x33bdab){return new BPromise(function(_0x514975,_0x369bff){return client[_0x5283('0xd')](_0x1f719b,_0x33bdab)[_0x5283('0xe')](function(_0x16e38b){logger[_0x5283('0xf')](_0x5283('0x10'),_0x489e2b,_0x5283('0x11'));logger[_0x5283('0x12')](_0x5283('0x13'),_0x489e2b,'request\x20sent',JSON[_0x5283('0x14')](_0x16e38b));if(_0x16e38b[_0x5283('0x15')]){if(_0x16e38b[_0x5283('0x15')][_0x5283('0x16')]===0x1f4){logger[_0x5283('0x15')](_0x5283('0x10'),_0x489e2b,_0x16e38b[_0x5283('0x15')]['message']);return _0x369bff(_0x16e38b['error'][_0x5283('0x17')]);}logger['error']('JscriptyAnswerReport,\x20%s,\x20%s',_0x489e2b,_0x16e38b[_0x5283('0x15')][_0x5283('0x17')]);return _0x514975(_0x16e38b['error'][_0x5283('0x17')]);}else{logger['info'](_0x5283('0x10'),_0x489e2b,_0x5283('0x11'));_0x514975(_0x16e38b[_0x5283('0x18')][_0x5283('0x17')]);}})['catch'](function(_0x373e12){logger['error'](_0x5283('0x10'),_0x489e2b,_0x373e12);_0x369bff(_0x373e12);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index dac027b..3113f82 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 _0x7bd7=['/:id/summary','getSummary','post','create','/:id/clone','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','isAuthenticated','index','get','show','getSessions','getAnswers'];(function(_0x2344e1,_0xfeae33){var _0x25468e=function(_0x1c2b65){while(--_0x1c2b65){_0x2344e1['push'](_0x2344e1['shift']());}};_0x25468e(++_0xfeae33);}(_0x7bd7,0x1d6));var _0x77bd=function(_0x216f6f,_0x4a18c7){_0x216f6f=_0x216f6f-0x0;var _0x3d6b5c=_0x7bd7[_0x216f6f];return _0x3d6b5c;};'use strict';var multer=require(_0x77bd('0x0'));var util=require(_0x77bd('0x1'));var path=require(_0x77bd('0x2'));var timeout=require(_0x77bd('0x3'));var express=require(_0x77bd('0x4'));var router=express[_0x77bd('0x5')]();var fs_extra=require(_0x77bd('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x77bd('0x7'));var config=require(_0x77bd('0x8'));var controller=require(_0x77bd('0x9'));router['get']('/',auth[_0x77bd('0xa')](),controller[_0x77bd('0xb')]);router[_0x77bd('0xc')]('/:id',auth[_0x77bd('0xa')](),controller[_0x77bd('0xd')]);router[_0x77bd('0xc')]('/:id/sessions',auth['isAuthenticated'](),controller[_0x77bd('0xe')]);router[_0x77bd('0xc')]('/:id/answers',auth[_0x77bd('0xa')](),controller[_0x77bd('0xf')]);router[_0x77bd('0xc')](_0x77bd('0x10'),auth[_0x77bd('0xa')](),timeout('30s'),controller[_0x77bd('0x11')]);router[_0x77bd('0x12')]('/',auth[_0x77bd('0xa')](),controller[_0x77bd('0x13')]);router[_0x77bd('0x12')](_0x77bd('0x14'),auth[_0x77bd('0xa')](),controller['clone']);router[_0x77bd('0x15')](_0x77bd('0x16'),auth[_0x77bd('0xa')](),controller[_0x77bd('0x17')]);router[_0x77bd('0x18')](_0x77bd('0x16'),auth[_0x77bd('0xa')](),controller[_0x77bd('0x19')]);module[_0x77bd('0x1a')]=router; \ No newline at end of file +var _0x4f72=['exports','multer','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/:id','/:id/sessions','/:id/answers','getAnswers','/:id/summary','getSummary','create','post','/:id/clone','put','update','delete','destroy'];(function(_0x3d564e,_0x2744e2){var _0x52e232=function(_0x1ab85f){while(--_0x1ab85f){_0x3d564e['push'](_0x3d564e['shift']());}};_0x52e232(++_0x2744e2);}(_0x4f72,0x94));var _0x24f7=function(_0x5ad6b6,_0x2b988b){_0x5ad6b6=_0x5ad6b6-0x0;var _0x2de828=_0x4f72[_0x5ad6b6];return _0x2de828;};'use strict';var multer=require(_0x24f7('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x24f7('0x1')]();var fs_extra=require(_0x24f7('0x2'));var auth=require(_0x24f7('0x3'));var interaction=require(_0x24f7('0x4'));var config=require('../../config/environment');var controller=require('./jscriptyProject.controller');router[_0x24f7('0x5')]('/',auth[_0x24f7('0x6')](),controller['index']);router['get'](_0x24f7('0x7'),auth[_0x24f7('0x6')](),controller['show']);router[_0x24f7('0x5')](_0x24f7('0x8'),auth[_0x24f7('0x6')](),controller['getSessions']);router[_0x24f7('0x5')](_0x24f7('0x9'),auth['isAuthenticated'](),controller[_0x24f7('0xa')]);router[_0x24f7('0x5')](_0x24f7('0xb'),auth[_0x24f7('0x6')](),timeout('30s'),controller[_0x24f7('0xc')]);router['post']('/',auth[_0x24f7('0x6')](),controller[_0x24f7('0xd')]);router[_0x24f7('0xe')](_0x24f7('0xf'),auth[_0x24f7('0x6')](),controller['clone']);router[_0x24f7('0x10')](_0x24f7('0x7'),auth[_0x24f7('0x6')](),controller[_0x24f7('0x11')]);router[_0x24f7('0x12')](_0x24f7('0x7'),auth[_0x24f7('0x6')](),controller[_0x24f7('0x13')]);module[_0x24f7('0x14')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index bd24efb..bbdfcbf 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 _0x5a12=['util','STRING','TEXT','long','isObjectLike','setDataValue','formData','stringify','isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','name','BOOLEAN','lodash'];(function(_0x23b980,_0x57697f){var _0x475354=function(_0x3ee3fb){while(--_0x3ee3fb){_0x23b980['push'](_0x23b980['shift']());}};_0x475354(++_0x57697f);}(_0x5a12,0x86));var _0x25a1=function(_0x1eea06,_0x1877a2){_0x1eea06=_0x1eea06-0x0;var _0x3ccff2=_0x5a12[_0x1eea06];return _0x3ccff2;};'use strict';var Sequelize=require('sequelize');var _=require(_0x25a1('0x0'));var util=require(_0x25a1('0x1'));module['exports']={'name':{'type':Sequelize[_0x25a1('0x2')],'unique':'name'},'description':{'type':Sequelize[_0x25a1('0x2')]},'formData':{'type':Sequelize[_0x25a1('0x3')](_0x25a1('0x4')),'set':function(_0x169bdd){if(_[_0x25a1('0x5')](_0x169bdd)){this[_0x25a1('0x6')](_0x25a1('0x7'),JSON[_0x25a1('0x8')](_0x169bdd));}else if(_[_0x25a1('0x9')](_0x169bdd)){this[_0x25a1('0x6')](_0x25a1('0x7'),_0x169bdd);}else{this[_0x25a1('0x6')](_0x25a1('0x7'),util[_0x25a1('0xa')](_0x25a1('0xb'),this[_0x25a1('0xc')](_0x25a1('0xd'))||'',this[_0x25a1('0xc')]('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x25a1('0xe')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xfd82=['format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','BOOLEAN','sequelize','lodash','util','exports','name','STRING','TEXT','long','isObjectLike','setDataValue','formData','stringify'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xfd82,0x184));var _0x2fd8=function(_0x207641,_0x4d6851){_0x207641=_0x207641-0x0;var _0xfdecf5=_0xfd82[_0x207641];return _0xfdecf5;};'use strict';var Sequelize=require(_0x2fd8('0x0'));var _=require(_0x2fd8('0x1'));var util=require(_0x2fd8('0x2'));module[_0x2fd8('0x3')]={'name':{'type':Sequelize['STRING'],'unique':_0x2fd8('0x4')},'description':{'type':Sequelize[_0x2fd8('0x5')]},'formData':{'type':Sequelize[_0x2fd8('0x6')](_0x2fd8('0x7')),'set':function(_0x30ab8f){if(_[_0x2fd8('0x8')](_0x30ab8f)){this[_0x2fd8('0x9')](_0x2fd8('0xa'),JSON[_0x2fd8('0xb')](_0x30ab8f));}else if(_['isString'](_0x30ab8f)){this[_0x2fd8('0x9')](_0x2fd8('0xa'),_0x30ab8f);}else{this[_0x2fd8('0x9')](_0x2fd8('0xa'),util[_0x2fd8('0xc')](_0x2fd8('0xd'),this[_0x2fd8('0xe')]('name')||'',this[_0x2fd8('0xe')]('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x2fd8('0xf')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 645efe8..8722d20 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 _0x3f40=['model','fields','attributes','length','hasOwnProperty','sort','where','pick','filters','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','body','getSessions','findOne','JscriptySessionReport','nolimit','order','ProjectId','rows','getAnswers','JscriptyAnswerReport','number','indexOf','toString','replace','getSummary','startTime','JscriptyQuestionReport','-createdAt','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','questionId','answer','push','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Content-type','text/csv','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','../../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','count','set','Content-Range','save','update','then','destroy','get','Projects','UserProfileResource','error','stack','name','send','index','map','JscriptyProject','rawAttributes','type','key','keys','query','intersection'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x3f40,0xbb));var _0x03f4=function(_0x23b41f,_0x21461f){_0x23b41f=_0x23b41f-0x0;var _0x480ba5=_0x3f40[_0x23b41f];return _0x480ba5;};'use strict';var emlformat=require(_0x03f4('0x0'));var rimraf=require(_0x03f4('0x1'));var zipdir=require(_0x03f4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x03f4('0x3'));var moment=require('moment');var BPromise=require(_0x03f4('0x4'));var Mustache=require(_0x03f4('0x5'));var util=require(_0x03f4('0x6'));var path=require(_0x03f4('0x7'));var sox=require('sox');var csv=require(_0x03f4('0x8'));var ejs=require(_0x03f4('0x9'));var fs=require('fs');var fs_extra=require(_0x03f4('0xa'));var _=require(_0x03f4('0xb'));var squel=require(_0x03f4('0xc'));var crypto=require(_0x03f4('0xd'));var jsforce=require(_0x03f4('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x03f4('0x8'));var querystring=require(_0x03f4('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x03f4('0x10'));var qs=require(_0x03f4('0x11'));var as=require(_0x03f4('0x12'));var hardwareService=require(_0x03f4('0x13'));var logger=require(_0x03f4('0x14'))(_0x03f4('0x15'));var utils=require(_0x03f4('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x03f4('0x17'));var db=require(_0x03f4('0x18'))['db'];function respondWithStatusCode(_0x3e4c25,_0x5f5198){_0x5f5198=_0x5f5198||0xcc;return function(_0x1b2947){if(_0x1b2947){return _0x3e4c25[_0x03f4('0x19')](_0x5f5198);}return _0x3e4c25[_0x03f4('0x1a')](_0x5f5198)[_0x03f4('0x1b')]();};}function respondWithResult(_0x4e2e04,_0x5e1624){_0x5e1624=_0x5e1624||0xc8;return function(_0x3828a3){if(_0x3828a3){return _0x4e2e04[_0x03f4('0x1a')](_0x5e1624)[_0x03f4('0x1c')](_0x3828a3);}};}function respondWithFilteredResult(_0x333f49,_0x3a806a){return function(_0x356e94){if(_0x356e94){var _0x6547fb=typeof _0x3a806a[_0x03f4('0x1d')]===_0x03f4('0x1e')&&typeof _0x3a806a[_0x03f4('0x1f')]===_0x03f4('0x1e');var _0x9ef505=_0x356e94[_0x03f4('0x20')];var _0x4ebc4f=_0x6547fb?0x0:_0x3a806a['offset'];var _0x559d4f=_0x6547fb?_0x356e94['count']:_0x3a806a['offset']+_0x3a806a['limit'];var _0x4c935d;if(_0x559d4f>=_0x9ef505){_0x559d4f=_0x9ef505;_0x4c935d=0xc8;}else{_0x4c935d=0xce;}_0x333f49[_0x03f4('0x1a')](_0x4c935d);return _0x333f49[_0x03f4('0x21')](_0x03f4('0x22'),_0x4ebc4f+'-'+_0x559d4f+'/'+_0x9ef505)[_0x03f4('0x1c')](_0x356e94);}return null;};}function patchUpdates(_0x4b9502){return function(_0x4d2963){try{jsonpatch['apply'](_0x4d2963,_0x4b9502,!![]);}catch(_0x2ca887){return BPromise['reject'](_0x2ca887);}return _0x4d2963[_0x03f4('0x23')]();};}function saveUpdates(_0x53a3fc,_0x324e35){return function(_0x435993){if(_0x435993){return _0x435993[_0x03f4('0x24')](_0x53a3fc)[_0x03f4('0x25')](function(_0x2f3840){return _0x2f3840;});}return null;};}function removeEntity(_0x115ffc,_0x403560){return function(_0x491bd9){if(_0x491bd9){return _0x491bd9[_0x03f4('0x26')]()[_0x03f4('0x25')](function(){var _0x3efcc9=_0x491bd9[_0x03f4('0x27')]({'plain':!![]});var _0x1e6943=_0x03f4('0x28');return db[_0x03f4('0x29')][_0x03f4('0x26')]({'where':{'type':_0x1e6943,'resourceId':_0x3efcc9['id']}})[_0x03f4('0x25')](function(){return _0x491bd9;});})[_0x03f4('0x25')](function(){_0x115ffc[_0x03f4('0x1a')](0xcc)[_0x03f4('0x1b')]();});}};}function handleEntityNotFound(_0x526ade,_0x153046){return function(_0x4fc412){if(!_0x4fc412){_0x526ade[_0x03f4('0x19')](0x194);}return _0x4fc412;};}function handleError(_0x51a879,_0x59c06c){_0x59c06c=_0x59c06c||0x1f4;return function(_0x4cfe61){logger[_0x03f4('0x2a')](_0x4cfe61[_0x03f4('0x2b')]);if(_0x4cfe61[_0x03f4('0x2c')]){delete _0x4cfe61[_0x03f4('0x2c')];}_0x51a879[_0x03f4('0x1a')](_0x59c06c)[_0x03f4('0x2d')](_0x4cfe61);};}exports[_0x03f4('0x2e')]=function(_0x53edb7,_0x36a3e6){var _0x1f8d47={},_0x42e6de={},_0x52efb8={'count':0x0,'rows':[]};var _0x5cebb8=_[_0x03f4('0x2f')](db[_0x03f4('0x30')][_0x03f4('0x31')],function(_0x462bc7){return{'name':_0x462bc7['fieldName'],'type':_0x462bc7[_0x03f4('0x32')][_0x03f4('0x33')]};});_0x42e6de['model']=_['map'](_0x5cebb8,_0x03f4('0x2c'));_0x42e6de['query']=_[_0x03f4('0x34')](_0x53edb7[_0x03f4('0x35')]);_0x42e6de['filters']=_[_0x03f4('0x36')](_0x42e6de['model'],_0x42e6de[_0x03f4('0x35')]);_0x1f8d47['attributes']=_[_0x03f4('0x36')](_0x42e6de[_0x03f4('0x37')],qs[_0x03f4('0x38')](_0x53edb7['query'][_0x03f4('0x38')]));_0x1f8d47['attributes']=_0x1f8d47[_0x03f4('0x39')][_0x03f4('0x3a')]?_0x1f8d47[_0x03f4('0x39')]:_0x42e6de[_0x03f4('0x37')];if(!_0x53edb7[_0x03f4('0x35')][_0x03f4('0x3b')]('nolimit')){_0x1f8d47[_0x03f4('0x1f')]=qs['limit'](_0x53edb7[_0x03f4('0x35')][_0x03f4('0x1f')]);_0x1f8d47[_0x03f4('0x1d')]=qs['offset'](_0x53edb7[_0x03f4('0x35')][_0x03f4('0x1d')]);}_0x1f8d47['order']=qs[_0x03f4('0x3c')](_0x53edb7[_0x03f4('0x35')]['sort']);_0x1f8d47[_0x03f4('0x3d')]=qs['filters'](_[_0x03f4('0x3e')](_0x53edb7['query'],_0x42e6de[_0x03f4('0x3f')]),_0x5cebb8);if(_0x53edb7[_0x03f4('0x35')][_0x03f4('0x40')]){_0x1f8d47[_0x03f4('0x3d')]=_[_0x03f4('0x41')](_0x1f8d47['where'],{'$or':_[_0x03f4('0x2f')](_0x5cebb8,function(_0x4fab8a){if(_0x4fab8a[_0x03f4('0x32')]!==_0x03f4('0x42')){var _0x326761={};_0x326761[_0x4fab8a[_0x03f4('0x2c')]]={'$like':'%'+_0x53edb7[_0x03f4('0x35')][_0x03f4('0x40')]+'%'};return _0x326761;}})});}_0x1f8d47=_[_0x03f4('0x41')]({},_0x1f8d47,_0x53edb7['options']);var _0x116cd5={'where':_0x1f8d47[_0x03f4('0x3d')]};return db[_0x03f4('0x30')][_0x03f4('0x20')](_0x116cd5)[_0x03f4('0x25')](function(_0x58fc9d){_0x52efb8[_0x03f4('0x20')]=_0x58fc9d;if(_0x53edb7[_0x03f4('0x35')][_0x03f4('0x43')]){_0x1f8d47[_0x03f4('0x44')]=[{'all':!![]}];}return db[_0x03f4('0x30')][_0x03f4('0x45')](_0x1f8d47);})[_0x03f4('0x25')](function(_0x38e50c){_0x52efb8['rows']=_0x38e50c;return _0x52efb8;})[_0x03f4('0x25')](respondWithFilteredResult(_0x36a3e6,_0x1f8d47))[_0x03f4('0x46')](handleError(_0x36a3e6,null));};exports[_0x03f4('0x47')]=function(_0x2a4f4e,_0x9c614b){var _0x1961e0={'raw':![],'where':{'id':_0x2a4f4e[_0x03f4('0x48')]['id']}},_0xd18692={};_0xd18692[_0x03f4('0x37')]=_['keys'](db['JscriptyProject'][_0x03f4('0x31')]);_0xd18692[_0x03f4('0x35')]=_[_0x03f4('0x34')](_0x2a4f4e[_0x03f4('0x35')]);_0xd18692[_0x03f4('0x3f')]=_['intersection'](_0xd18692[_0x03f4('0x37')],_0xd18692[_0x03f4('0x35')]);_0x1961e0[_0x03f4('0x39')]=_[_0x03f4('0x36')](_0xd18692['model'],qs[_0x03f4('0x38')](_0x2a4f4e[_0x03f4('0x35')]['fields']));_0x1961e0['attributes']=_0x1961e0['attributes'][_0x03f4('0x3a')]?_0x1961e0[_0x03f4('0x39')]:_0xd18692['model'];if(_0x2a4f4e[_0x03f4('0x35')][_0x03f4('0x43')]){_0x1961e0[_0x03f4('0x44')]=[{'all':!![]}];}_0x1961e0=_[_0x03f4('0x41')]({},_0x1961e0,_0x2a4f4e[_0x03f4('0x49')]);return db[_0x03f4('0x30')][_0x03f4('0x4a')](_0x1961e0)['then'](handleEntityNotFound(_0x9c614b,null))[_0x03f4('0x25')](respondWithResult(_0x9c614b,null))['catch'](handleError(_0x9c614b,null));};exports[_0x03f4('0x4b')]=function(_0x7e456e,_0x1df052){return db[_0x03f4('0x30')][_0x03f4('0x4b')](_0x7e456e['body'],{})[_0x03f4('0x25')](function(_0x58293c){var _0x490488=_0x7e456e['user'][_0x03f4('0x27')]({'plain':!![]});if(!_0x490488)throw new Error(_0x03f4('0x4c'));if(_0x490488[_0x03f4('0x4d')]===_0x03f4('0x4e')){var _0x2daed7=_0x58293c[_0x03f4('0x27')]({'plain':!![]});var _0x5eeec6=_0x03f4('0x28');return db[_0x03f4('0x4f')][_0x03f4('0x4a')]({'where':{'name':_0x5eeec6,'userProfileId':_0x490488[_0x03f4('0x50')]},'raw':!![]})[_0x03f4('0x25')](function(_0x5e73df){if(_0x5e73df&&_0x5e73df[_0x03f4('0x51')]===0x0){return db[_0x03f4('0x29')][_0x03f4('0x4b')]({'name':_0x2daed7[_0x03f4('0x2c')],'resourceId':_0x2daed7['id'],'type':_0x5e73df['name'],'sectionId':_0x5e73df['id']},{})[_0x03f4('0x25')](function(){return _0x58293c;});}else{return _0x58293c;}})[_0x03f4('0x46')](function(_0x46bc78){logger['error'](_0x03f4('0x52'),_0x46bc78);throw _0x46bc78;});}return _0x58293c;})[_0x03f4('0x25')](respondWithResult(_0x1df052,0xc9))[_0x03f4('0x46')](handleError(_0x1df052,null));};exports[_0x03f4('0x53')]=function(_0x149fcc,_0x2a3cdd){var _0x5d1d24={'where':{'id':_0x149fcc[_0x03f4('0x48')]['id']}},_0x378f68={};_0x378f68[_0x03f4('0x37')]=_['keys'](db[_0x03f4('0x30')][_0x03f4('0x31')]);_0x5d1d24['attributes']=_[_0x03f4('0x36')](_0x378f68[_0x03f4('0x37')],qs[_0x03f4('0x38')](_0x149fcc[_0x03f4('0x35')][_0x03f4('0x38')]));_0x5d1d24[_0x03f4('0x39')]=_0x5d1d24['attributes'][_0x03f4('0x3a')]?_0x5d1d24[_0x03f4('0x39')]:_0x378f68[_0x03f4('0x37')];if(_0x149fcc[_0x03f4('0x35')][_0x03f4('0x43')]){_0x5d1d24[_0x03f4('0x44')]=[{'all':!![]}];}_0x5d1d24=_[_0x03f4('0x41')]({},_0x5d1d24,_0x149fcc[_0x03f4('0x49')]);return db[_0x03f4('0x30')]['find'](_0x5d1d24)[_0x03f4('0x25')](handleEntityNotFound(_0x2a3cdd,null))[_0x03f4('0x25')](function(_0x1522d1){if(_0x1522d1){var _0x27f16b=_0x1522d1[_0x03f4('0x27')]({'plain':!![]});_0x27f16b=qs[_0x03f4('0x54')](_0x27f16b,['id',_0x03f4('0x55'),_0x03f4('0x56')]);_0x149fcc[_0x03f4('0x57')]=_[_0x03f4('0x54')](_0x149fcc['body'],['id',_0x03f4('0x55'),'updatedAt']);return db['JscriptyProject'][_0x03f4('0x4b')](_[_0x03f4('0x41')](_0x27f16b,_0x149fcc['body']),{'include':_0x149fcc[_0x03f4('0x35')]['includeAll']?[{'all':!![]}]:undefined})[_0x03f4('0x25')](function(_0x415d81){var _0x16b0c7=_0x149fcc[_0x03f4('0x4e')][_0x03f4('0x27')]({'plain':!![]});if(!_0x16b0c7)throw new Error(_0x03f4('0x4c'));if(_0x16b0c7[_0x03f4('0x4d')]===_0x03f4('0x4e')){var _0x3b6299=_0x415d81['get']({'plain':!![]});var _0x300205='Projects';return db[_0x03f4('0x4f')][_0x03f4('0x4a')]({'where':{'name':_0x300205,'userProfileId':_0x16b0c7['userProfileId']},'raw':!![]})['then'](function(_0x4908e2){if(_0x4908e2&&_0x4908e2[_0x03f4('0x51')]===0x0){return db[_0x03f4('0x29')][_0x03f4('0x4b')]({'name':_0x3b6299[_0x03f4('0x2c')],'resourceId':_0x3b6299['id'],'type':_0x4908e2['name'],'sectionId':_0x4908e2['id']},{})[_0x03f4('0x25')](function(){return _0x415d81;});}else{return _0x415d81;}})[_0x03f4('0x46')](function(_0x548548){logger[_0x03f4('0x2a')](_0x03f4('0x52'),_0x548548);throw _0x548548;});}return _0x415d81;});}})['then'](respondWithResult(_0x2a3cdd,0xc9))[_0x03f4('0x46')](handleError(_0x2a3cdd,null));};exports[_0x03f4('0x24')]=function(_0x1f7abe,_0x168f7e){if(_0x1f7abe[_0x03f4('0x57')]['id']){delete _0x1f7abe['body']['id'];}return db[_0x03f4('0x30')][_0x03f4('0x4a')]({'where':{'id':_0x1f7abe[_0x03f4('0x48')]['id']}})[_0x03f4('0x25')](handleEntityNotFound(_0x168f7e,null))['then'](saveUpdates(_0x1f7abe[_0x03f4('0x57')],null))['then'](respondWithResult(_0x168f7e,null))[_0x03f4('0x46')](handleError(_0x168f7e,null));};exports['destroy']=function(_0x8e6d2c,_0x2e494f){return db[_0x03f4('0x30')][_0x03f4('0x4a')]({'where':{'id':_0x8e6d2c[_0x03f4('0x48')]['id']}})[_0x03f4('0x25')](handleEntityNotFound(_0x2e494f,null))[_0x03f4('0x25')](removeEntity(_0x2e494f,null))[_0x03f4('0x46')](handleError(_0x2e494f,null));};exports[_0x03f4('0x58')]=function(_0x229b93,_0x3c0a11,_0x44350c){var _0x493c01={'raw':!![],'where':{}};var _0x3ce87e={};var _0x47a5b6={'count':0x0,'rows':[]};return db[_0x03f4('0x30')][_0x03f4('0x59')]({'where':{'id':_0x229b93['params']['id']}})['then'](handleEntityNotFound(_0x3c0a11,null))[_0x03f4('0x25')](function(_0x12055c){if(_0x12055c){_0x3ce87e[_0x03f4('0x37')]=_[_0x03f4('0x34')](db[_0x03f4('0x5a')][_0x03f4('0x31')]);_0x3ce87e[_0x03f4('0x35')]=_[_0x03f4('0x34')](_0x229b93[_0x03f4('0x35')]);_0x3ce87e[_0x03f4('0x3f')]=_[_0x03f4('0x36')](_0x3ce87e[_0x03f4('0x37')],_0x3ce87e['query']);_0x493c01['attributes']=_['intersection'](_0x3ce87e[_0x03f4('0x37')],qs['fields'](_0x229b93[_0x03f4('0x35')][_0x03f4('0x38')]));_0x493c01[_0x03f4('0x39')]=_0x493c01[_0x03f4('0x39')]['length']?_0x493c01['attributes']:_0x3ce87e['model'];if(!_0x229b93[_0x03f4('0x35')]['hasOwnProperty'](_0x03f4('0x5b'))){_0x493c01[_0x03f4('0x1f')]=qs['limit'](_0x229b93[_0x03f4('0x35')]['limit']);_0x493c01['offset']=qs[_0x03f4('0x1d')](_0x229b93[_0x03f4('0x35')][_0x03f4('0x1d')]);}_0x493c01[_0x03f4('0x5c')]=qs[_0x03f4('0x3c')](_0x229b93[_0x03f4('0x35')]['sort']);_0x493c01[_0x03f4('0x3d')]=qs[_0x03f4('0x3f')](_[_0x03f4('0x3e')](_0x229b93[_0x03f4('0x35')],_0x3ce87e['filters']));_0x493c01[_0x03f4('0x3d')][_0x03f4('0x5d')]=_0x12055c['id'];if(_0x229b93['query'][_0x03f4('0x40')]){_0x493c01[_0x03f4('0x3d')]=_[_0x03f4('0x41')](_0x493c01[_0x03f4('0x3d')],{'$or':_['map'](_0x493c01['attributes'],function(_0x45da64){var _0x44aecb={};_0x44aecb[_0x45da64]={'$like':'%'+_0x229b93['query']['filter']+'%'};return _0x44aecb;})});}_0x493c01=_['merge']({},_0x493c01,_0x229b93[_0x03f4('0x49')]);return db[_0x03f4('0x5a')][_0x03f4('0x20')]({'where':_0x493c01[_0x03f4('0x3d')]})[_0x03f4('0x25')](function(_0x280e41){_0x47a5b6['count']=_0x280e41;if(_0x229b93[_0x03f4('0x35')][_0x03f4('0x43')]){_0x493c01[_0x03f4('0x44')]=[{'all':!![]}];}return db[_0x03f4('0x5a')][_0x03f4('0x45')](_0x493c01);})[_0x03f4('0x25')](function(_0xbb6b42){_0x47a5b6[_0x03f4('0x5e')]=_0xbb6b42;return _0x47a5b6;});}})[_0x03f4('0x25')](respondWithFilteredResult(_0x3c0a11,_0x493c01))['catch'](handleError(_0x3c0a11,null));};exports[_0x03f4('0x5f')]=function(_0x29df3e,_0x48082a,_0x57b80c){var _0x464a9c={'raw':!![],'where':{}};var _0x15eba8={};var _0x4ddb64={'count':0x0,'rows':[]};return db[_0x03f4('0x30')][_0x03f4('0x59')]({'where':{'id':_0x29df3e[_0x03f4('0x48')]['id']}})[_0x03f4('0x25')](handleEntityNotFound(_0x48082a,null))[_0x03f4('0x25')](function(_0x267e4f){if(_0x267e4f){_0x15eba8['model']=_[_0x03f4('0x34')](db[_0x03f4('0x60')][_0x03f4('0x31')]);_0x15eba8['query']=_[_0x03f4('0x34')](_0x29df3e[_0x03f4('0x35')]);_0x15eba8[_0x03f4('0x3f')]=_[_0x03f4('0x36')](_0x15eba8[_0x03f4('0x37')],_0x15eba8['query']);_0x464a9c[_0x03f4('0x39')]=_[_0x03f4('0x36')](_0x15eba8[_0x03f4('0x37')],qs[_0x03f4('0x38')](_0x29df3e[_0x03f4('0x35')][_0x03f4('0x38')]));_0x464a9c[_0x03f4('0x39')]=_0x464a9c['attributes']['length']?_0x464a9c[_0x03f4('0x39')]:_0x15eba8['model'];if(!_0x29df3e['query'][_0x03f4('0x3b')]('nolimit')){_0x464a9c[_0x03f4('0x1f')]=qs[_0x03f4('0x1f')](_0x29df3e[_0x03f4('0x35')]['limit']);_0x464a9c['offset']=qs[_0x03f4('0x1d')](_0x29df3e['query'][_0x03f4('0x1d')]);}_0x464a9c[_0x03f4('0x5c')]=qs[_0x03f4('0x3c')](_0x29df3e[_0x03f4('0x35')]['sort']);_0x464a9c[_0x03f4('0x3d')]=qs[_0x03f4('0x3f')](_[_0x03f4('0x3e')](_0x29df3e[_0x03f4('0x35')],_0x15eba8['filters']));_0x464a9c[_0x03f4('0x3d')][_0x03f4('0x5d')]=_0x267e4f['id'];if(_0x29df3e[_0x03f4('0x35')][_0x03f4('0x40')]){_0x464a9c[_0x03f4('0x3d')]=_[_0x03f4('0x41')](_0x464a9c[_0x03f4('0x3d')],{'$or':_[_0x03f4('0x2f')](_0x464a9c[_0x03f4('0x39')],function(_0x3b4c77){var _0x2a3a42={};_0x2a3a42[_0x3b4c77]={'$like':'%'+_0x29df3e['query']['filter']+'%'};return _0x2a3a42;})});}_0x464a9c=_[_0x03f4('0x41')]({},_0x464a9c,_0x29df3e[_0x03f4('0x49')]);return db['JscriptyAnswerReport'][_0x03f4('0x20')]({'where':_0x464a9c['where']})['then'](function(_0x410660){_0x4ddb64['count']=_0x410660;if(_0x29df3e[_0x03f4('0x35')]['includeAll']){_0x464a9c[_0x03f4('0x44')]=[{'all':!![]}];}return db[_0x03f4('0x60')][_0x03f4('0x45')](_0x464a9c);})['then'](function(_0x307ca2){_0x4ddb64[_0x03f4('0x5e')]=_0x307ca2;return _0x4ddb64;});}})['then'](respondWithFilteredResult(_0x48082a,_0x464a9c))[_0x03f4('0x46')](handleError(_0x48082a,null));};function char(_0x19ace9){return _0x03f4('0x61')===typeof _0x19ace9?String['fromCharCode']['apply'](null,arguments):_0x19ace9;}function needsEncapsulation(_0x5db070){return!!_0x5db070&&(_0x5db070['toString']()[_0x03f4('0x62')](char(0xd))>=0x0||_0x5db070[_0x03f4('0x63')]()['indexOf'](char(0xa))>=0x0||_0x5db070[_0x03f4('0x63')]()[_0x03f4('0x62')](char(0x2c))>=0x0||_0x5db070[_0x03f4('0x63')]()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0x4faba7){var _0x4ab9c6=char(0x22),_0x575b0c='\x5c'+char(0x22),_0x55d9ac=_0x4faba7[_0x03f4('0x63')]()[_0x03f4('0x64')](new RegExp(_0x4ab9c6,'g'),_0x575b0c);return _0x4ab9c6+_0x55d9ac+_0x4ab9c6;}exports[_0x03f4('0x65')]=function(_0x299c25,_0x32c88d,_0x20d82e){var _0x480bb5,_0x468617;var _0xe79dfb={'where':{'ProjectId':_0x299c25[_0x03f4('0x48')]['id']}};if(_0x299c25['query'][_0x03f4('0x66')]){_0xe79dfb[_0x03f4('0x3d')]['starttime']=JSON['parse'](_0x299c25['query'][_0x03f4('0x66')]);}return db[_0x03f4('0x5a')][_0x03f4('0x45')](_0xe79dfb)[_0x03f4('0x25')](handleEntityNotFound(_0x32c88d,null))[_0x03f4('0x25')](function(_0x2f416c){if(_0x2f416c){_0x480bb5=_0x2f416c;return db[_0x03f4('0x67')][_0x03f4('0x45')]({'where':{'SessionId':{'$in':_['map'](_0x480bb5,'id')},'ProjectId':_0x299c25[_0x03f4('0x48')]['id']},'order':_0x03f4('0x68')});}})[_0x03f4('0x25')](handleEntityNotFound(_0x32c88d,null))['then'](function(_0x4bcc5b){if(_0x4bcc5b){_0x468617=_0x4bcc5b;var _0x4c6760={};for(var _0x57b1e1=0x0,_0x387c16=_0x468617[_0x03f4('0x3a')];_0x57b1e1<_0x387c16;_0x57b1e1++){if(!_0x4c6760[_0x03f4('0x3b')](_0x468617[_0x57b1e1]['questionId'])){_0x4c6760[_0x468617[_0x57b1e1]['questionId']]=needsEncapsulation(_0x468617[_0x57b1e1]['question'])?encapsulate(_0x468617[_0x57b1e1][_0x03f4('0x69')]):_0x468617[_0x57b1e1][_0x03f4('0x69')];}}var _0x2d301c=[],_0x3cb2cd={};for(var _0x14f7d0=0x0,_0x5659af=_0x480bb5['length'];_0x14f7d0<_0x5659af;_0x14f7d0++){_0x3cb2cd={'ProjectId':_0x299c25[_0x03f4('0x48')]['id'],'SessionId':_0x480bb5[_0x14f7d0]['id'],'StartTime':moment(_0x480bb5[_0x14f7d0]['starttime'])[_0x03f4('0x6a')](_0x03f4('0x6b'))};for(var _0x58030e=0x0,_0x29281a=_0x468617[_0x03f4('0x3a')];_0x58030e<_0x29281a;_0x58030e++){if(_0x468617[_0x58030e][_0x03f4('0x6c')]==_0x480bb5[_0x14f7d0]['id']&&_0x4c6760[_0x03f4('0x3b')](_0x468617[_0x58030e][_0x03f4('0x6d')])){_0x3cb2cd[_0x4c6760[_0x468617[_0x58030e][_0x03f4('0x6d')]]]=_0x468617[_0x58030e][_0x03f4('0x6e')];}}for(var _0x257908 in _0x4c6760){if(!_0x3cb2cd[_0x03f4('0x3b')](_0x4c6760[_0x257908])){_0x3cb2cd[_0x4c6760[_0x257908]]=null;}}_0x2d301c[_0x03f4('0x6f')](_0x3cb2cd);}return _0x2d301c;}})[_0x03f4('0x25')](function(_0x4766f4){if(!_[_0x03f4('0x70')](_0x4766f4)){var _0x555baa=toCsv(_0x4766f4);var _0x5908e0=Date[_0x03f4('0x71')]();fs[_0x03f4('0x72')](util[_0x03f4('0x6a')](_0x03f4('0x73'),_0x299c25[_0x03f4('0x48')]['id'],_0x5908e0),_0x555baa);_0x32c88d[_0x03f4('0x74')](_0x03f4('0x75'),_0x03f4('0x76')+util[_0x03f4('0x6a')]('Jscripty_Project_%d_Summary_%s.csv',_0x299c25['params']['id'],_0x5908e0));_0x32c88d[_0x03f4('0x74')](_0x03f4('0x77'),_0x03f4('0x78'));return _0x32c88d['download'](util[_0x03f4('0x6a')](_0x03f4('0x73'),_0x299c25['params']['id'],_0x5908e0));}else{return _0x32c88d[_0x03f4('0x19')](0xcc);}})[_0x03f4('0x46')](handleError(_0x32c88d,null));}; \ No newline at end of file +var _0x8a2a=['userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','options','omit','createdAt','updatedAt','UserProfileSection','getSessions','findOne','JscriptySessionReport','nolimit','ProjectId','getAnswers','JscriptyAnswerReport','order','number','toString','indexOf','replace','startTime','starttime','parse','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-type','text/csv','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','Projects','UserProfileResource','destroy','error','stack','name','index','map','JscriptyProject','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x4225b6,_0x5b05ac){var _0x4c9146=function(_0x3465ba){while(--_0x3465ba){_0x4225b6['push'](_0x4225b6['shift']());}};_0x4c9146(++_0x5b05ac);}(_0x8a2a,0x11f));var _0xa8a2=function(_0x114b7c,_0xc4b93b){_0x114b7c=_0x114b7c-0x0;var _0x47185f=_0x8a2a[_0x114b7c];return _0x47185f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa8a2('0x0'));var zipdir=require(_0xa8a2('0x1'));var jsonpatch=require(_0xa8a2('0x2'));var rp=require(_0xa8a2('0x3'));var moment=require(_0xa8a2('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa8a2('0x5'));var util=require(_0xa8a2('0x6'));var path=require(_0xa8a2('0x7'));var sox=require(_0xa8a2('0x8'));var csv=require(_0xa8a2('0x9'));var ejs=require(_0xa8a2('0xa'));var fs=require('fs');var fs_extra=require(_0xa8a2('0xb'));var _=require(_0xa8a2('0xc'));var squel=require('squel');var crypto=require(_0xa8a2('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa8a2('0xe'));var Papa=require(_0xa8a2('0xf'));var Redis=require(_0xa8a2('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xa8a2('0x11'));var as=require(_0xa8a2('0x12'));var hardwareService=require(_0xa8a2('0x13'));var logger=require(_0xa8a2('0x14'))(_0xa8a2('0x15'));var utils=require(_0xa8a2('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xa8a2('0x17'));var db=require(_0xa8a2('0x18'))['db'];function respondWithStatusCode(_0x187be5,_0x5787a6){_0x5787a6=_0x5787a6||0xcc;return function(_0x301465){if(_0x301465){return _0x187be5[_0xa8a2('0x19')](_0x5787a6);}return _0x187be5[_0xa8a2('0x1a')](_0x5787a6)[_0xa8a2('0x1b')]();};}function respondWithResult(_0x30d826,_0x3b8e1d){_0x3b8e1d=_0x3b8e1d||0xc8;return function(_0x9b5060){if(_0x9b5060){return _0x30d826['status'](_0x3b8e1d)[_0xa8a2('0x1c')](_0x9b5060);}};}function respondWithFilteredResult(_0x2b5290,_0x220325){return function(_0x4db3be){if(_0x4db3be){var _0x47e246=typeof _0x220325[_0xa8a2('0x1d')]===_0xa8a2('0x1e')&&typeof _0x220325[_0xa8a2('0x1f')]===_0xa8a2('0x1e');var _0x2ab21d=_0x4db3be[_0xa8a2('0x20')];var _0x274982=_0x47e246?0x0:_0x220325[_0xa8a2('0x1d')];var _0x529f03=_0x47e246?_0x4db3be[_0xa8a2('0x20')]:_0x220325[_0xa8a2('0x1d')]+_0x220325[_0xa8a2('0x1f')];var _0x47e08d;if(_0x529f03>=_0x2ab21d){_0x529f03=_0x2ab21d;_0x47e08d=0xc8;}else{_0x47e08d=0xce;}_0x2b5290[_0xa8a2('0x1a')](_0x47e08d);return _0x2b5290[_0xa8a2('0x21')](_0xa8a2('0x22'),_0x274982+'-'+_0x529f03+'/'+_0x2ab21d)[_0xa8a2('0x1c')](_0x4db3be);}return null;};}function patchUpdates(_0x4cb363){return function(_0x187ad6){try{jsonpatch[_0xa8a2('0x23')](_0x187ad6,_0x4cb363,!![]);}catch(_0x385e69){return BPromise[_0xa8a2('0x24')](_0x385e69);}return _0x187ad6[_0xa8a2('0x25')]();};}function saveUpdates(_0x278bb7,_0x1e2904){return function(_0x585b3a){if(_0x585b3a){return _0x585b3a[_0xa8a2('0x26')](_0x278bb7)[_0xa8a2('0x27')](function(_0x5af5d2){return _0x5af5d2;});}return null;};}function removeEntity(_0x12a1d7,_0x21a5ca){return function(_0x4f60c8){if(_0x4f60c8){return _0x4f60c8['destroy']()['then'](function(){var _0xee794=_0x4f60c8[_0xa8a2('0x28')]({'plain':!![]});var _0x3a2949=_0xa8a2('0x29');return db[_0xa8a2('0x2a')][_0xa8a2('0x2b')]({'where':{'type':_0x3a2949,'resourceId':_0xee794['id']}})[_0xa8a2('0x27')](function(){return _0x4f60c8;});})[_0xa8a2('0x27')](function(){_0x12a1d7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4aeec1,_0x2f17b8){return function(_0x3ddbe7){if(!_0x3ddbe7){_0x4aeec1[_0xa8a2('0x19')](0x194);}return _0x3ddbe7;};}function handleError(_0x2f89b2,_0x13d2ab){_0x13d2ab=_0x13d2ab||0x1f4;return function(_0x49a4c5){logger[_0xa8a2('0x2c')](_0x49a4c5[_0xa8a2('0x2d')]);if(_0x49a4c5[_0xa8a2('0x2e')]){delete _0x49a4c5[_0xa8a2('0x2e')];}_0x2f89b2['status'](_0x13d2ab)['send'](_0x49a4c5);};}exports[_0xa8a2('0x2f')]=function(_0x496519,_0x242c70){var _0x19efa4={},_0x266076={},_0x26a255={'count':0x0,'rows':[]};var _0x560c24=_[_0xa8a2('0x30')](db[_0xa8a2('0x31')][_0xa8a2('0x32')],function(_0x21ae89){return{'name':_0x21ae89[_0xa8a2('0x33')],'type':_0x21ae89[_0xa8a2('0x34')][_0xa8a2('0x35')]};});_0x266076[_0xa8a2('0x36')]=_[_0xa8a2('0x30')](_0x560c24,_0xa8a2('0x2e'));_0x266076[_0xa8a2('0x37')]=_[_0xa8a2('0x38')](_0x496519[_0xa8a2('0x37')]);_0x266076['filters']=_[_0xa8a2('0x39')](_0x266076[_0xa8a2('0x36')],_0x266076['query']);_0x19efa4[_0xa8a2('0x3a')]=_[_0xa8a2('0x39')](_0x266076['model'],qs[_0xa8a2('0x3b')](_0x496519[_0xa8a2('0x37')][_0xa8a2('0x3b')]));_0x19efa4[_0xa8a2('0x3a')]=_0x19efa4[_0xa8a2('0x3a')]['length']?_0x19efa4[_0xa8a2('0x3a')]:_0x266076[_0xa8a2('0x36')];if(!_0x496519['query'][_0xa8a2('0x3c')]('nolimit')){_0x19efa4['limit']=qs[_0xa8a2('0x1f')](_0x496519[_0xa8a2('0x37')][_0xa8a2('0x1f')]);_0x19efa4[_0xa8a2('0x1d')]=qs['offset'](_0x496519['query']['offset']);}_0x19efa4['order']=qs[_0xa8a2('0x3d')](_0x496519[_0xa8a2('0x37')][_0xa8a2('0x3d')]);_0x19efa4[_0xa8a2('0x3e')]=qs[_0xa8a2('0x3f')](_[_0xa8a2('0x40')](_0x496519['query'],_0x266076[_0xa8a2('0x3f')]),_0x560c24);if(_0x496519[_0xa8a2('0x37')][_0xa8a2('0x41')]){_0x19efa4[_0xa8a2('0x3e')]=_[_0xa8a2('0x42')](_0x19efa4[_0xa8a2('0x3e')],{'$or':_['map'](_0x560c24,function(_0x13ca7c){if(_0x13ca7c[_0xa8a2('0x34')]!==_0xa8a2('0x43')){var _0x5870fe={};_0x5870fe[_0x13ca7c[_0xa8a2('0x2e')]]={'$like':'%'+_0x496519[_0xa8a2('0x37')]['filter']+'%'};return _0x5870fe;}})});}_0x19efa4=_[_0xa8a2('0x42')]({},_0x19efa4,_0x496519['options']);var _0x14e44f={'where':_0x19efa4[_0xa8a2('0x3e')]};return db[_0xa8a2('0x31')][_0xa8a2('0x20')](_0x14e44f)[_0xa8a2('0x27')](function(_0x125016){_0x26a255[_0xa8a2('0x20')]=_0x125016;if(_0x496519[_0xa8a2('0x37')][_0xa8a2('0x44')]){_0x19efa4[_0xa8a2('0x45')]=[{'all':!![]}];}return db[_0xa8a2('0x31')][_0xa8a2('0x46')](_0x19efa4);})[_0xa8a2('0x27')](function(_0x950939){_0x26a255[_0xa8a2('0x47')]=_0x950939;return _0x26a255;})[_0xa8a2('0x27')](respondWithFilteredResult(_0x242c70,_0x19efa4))[_0xa8a2('0x48')](handleError(_0x242c70,null));};exports[_0xa8a2('0x49')]=function(_0x46b66b,_0x3e2aa8){var _0x273e1c={'raw':![],'where':{'id':_0x46b66b[_0xa8a2('0x4a')]['id']}},_0x54c12e={};_0x54c12e[_0xa8a2('0x36')]=_['keys'](db['JscriptyProject']['rawAttributes']);_0x54c12e['query']=_['keys'](_0x46b66b['query']);_0x54c12e[_0xa8a2('0x3f')]=_[_0xa8a2('0x39')](_0x54c12e[_0xa8a2('0x36')],_0x54c12e['query']);_0x273e1c[_0xa8a2('0x3a')]=_[_0xa8a2('0x39')](_0x54c12e[_0xa8a2('0x36')],qs[_0xa8a2('0x3b')](_0x46b66b[_0xa8a2('0x37')]['fields']));_0x273e1c[_0xa8a2('0x3a')]=_0x273e1c[_0xa8a2('0x3a')][_0xa8a2('0x4b')]?_0x273e1c[_0xa8a2('0x3a')]:_0x54c12e[_0xa8a2('0x36')];if(_0x46b66b[_0xa8a2('0x37')][_0xa8a2('0x44')]){_0x273e1c[_0xa8a2('0x45')]=[{'all':!![]}];}_0x273e1c=_[_0xa8a2('0x42')]({},_0x273e1c,_0x46b66b['options']);return db[_0xa8a2('0x31')][_0xa8a2('0x4c')](_0x273e1c)[_0xa8a2('0x27')](handleEntityNotFound(_0x3e2aa8,null))[_0xa8a2('0x27')](respondWithResult(_0x3e2aa8,null))['catch'](handleError(_0x3e2aa8,null));};exports[_0xa8a2('0x4d')]=function(_0x406d08,_0x591a8b){return db[_0xa8a2('0x31')][_0xa8a2('0x4d')](_0x406d08[_0xa8a2('0x4e')],{})[_0xa8a2('0x27')](function(_0x78dd89){var _0x42317c=_0x406d08[_0xa8a2('0x4f')][_0xa8a2('0x28')]({'plain':!![]});if(!_0x42317c)throw new Error(_0xa8a2('0x50'));if(_0x42317c[_0xa8a2('0x51')]===_0xa8a2('0x4f')){var _0x1bba0e=_0x78dd89[_0xa8a2('0x28')]({'plain':!![]});var _0x2e251d=_0xa8a2('0x29');return db['UserProfileSection'][_0xa8a2('0x4c')]({'where':{'name':_0x2e251d,'userProfileId':_0x42317c[_0xa8a2('0x52')]},'raw':!![]})[_0xa8a2('0x27')](function(_0x82bed4){if(_0x82bed4&&_0x82bed4[_0xa8a2('0x53')]===0x0){return db[_0xa8a2('0x2a')][_0xa8a2('0x4d')]({'name':_0x1bba0e[_0xa8a2('0x2e')],'resourceId':_0x1bba0e['id'],'type':_0x82bed4[_0xa8a2('0x2e')],'sectionId':_0x82bed4['id']},{})[_0xa8a2('0x27')](function(){return _0x78dd89;});}else{return _0x78dd89;}})['catch'](function(_0x36d680){logger[_0xa8a2('0x2c')](_0xa8a2('0x54'),_0x36d680);throw _0x36d680;});}return _0x78dd89;})[_0xa8a2('0x27')](respondWithResult(_0x591a8b,0xc9))[_0xa8a2('0x48')](handleError(_0x591a8b,null));};exports[_0xa8a2('0x55')]=function(_0x1e8b7c,_0x34c6bf){var _0xaf98={'where':{'id':_0x1e8b7c[_0xa8a2('0x4a')]['id']}},_0x5f3326={};_0x5f3326[_0xa8a2('0x36')]=_[_0xa8a2('0x38')](db[_0xa8a2('0x31')][_0xa8a2('0x32')]);_0xaf98[_0xa8a2('0x3a')]=_[_0xa8a2('0x39')](_0x5f3326[_0xa8a2('0x36')],qs['fields'](_0x1e8b7c[_0xa8a2('0x37')][_0xa8a2('0x3b')]));_0xaf98[_0xa8a2('0x3a')]=_0xaf98[_0xa8a2('0x3a')][_0xa8a2('0x4b')]?_0xaf98['attributes']:_0x5f3326[_0xa8a2('0x36')];if(_0x1e8b7c[_0xa8a2('0x37')][_0xa8a2('0x44')]){_0xaf98[_0xa8a2('0x45')]=[{'all':!![]}];}_0xaf98=_[_0xa8a2('0x42')]({},_0xaf98,_0x1e8b7c[_0xa8a2('0x56')]);return db['JscriptyProject'][_0xa8a2('0x4c')](_0xaf98)['then'](handleEntityNotFound(_0x34c6bf,null))[_0xa8a2('0x27')](function(_0xa75c3d){if(_0xa75c3d){var _0x31f94e=_0xa75c3d[_0xa8a2('0x28')]({'plain':!![]});_0x31f94e=qs[_0xa8a2('0x57')](_0x31f94e,['id',_0xa8a2('0x58'),_0xa8a2('0x59')]);_0x1e8b7c[_0xa8a2('0x4e')]=_[_0xa8a2('0x57')](_0x1e8b7c[_0xa8a2('0x4e')],['id',_0xa8a2('0x58'),_0xa8a2('0x59')]);return db[_0xa8a2('0x31')][_0xa8a2('0x4d')](_[_0xa8a2('0x42')](_0x31f94e,_0x1e8b7c['body']),{'include':_0x1e8b7c['query'][_0xa8a2('0x44')]?[{'all':!![]}]:undefined})[_0xa8a2('0x27')](function(_0x345cce){var _0x124fd0=_0x1e8b7c['user']['get']({'plain':!![]});if(!_0x124fd0)throw new Error(_0xa8a2('0x50'));if(_0x124fd0[_0xa8a2('0x51')]===_0xa8a2('0x4f')){var _0x33d9f8=_0x345cce['get']({'plain':!![]});var _0x23dd81='Projects';return db[_0xa8a2('0x5a')][_0xa8a2('0x4c')]({'where':{'name':_0x23dd81,'userProfileId':_0x124fd0[_0xa8a2('0x52')]},'raw':!![]})[_0xa8a2('0x27')](function(_0xe7c2e2){if(_0xe7c2e2&&_0xe7c2e2[_0xa8a2('0x53')]===0x0){return db[_0xa8a2('0x2a')][_0xa8a2('0x4d')]({'name':_0x33d9f8['name'],'resourceId':_0x33d9f8['id'],'type':_0xe7c2e2['name'],'sectionId':_0xe7c2e2['id']},{})[_0xa8a2('0x27')](function(){return _0x345cce;});}else{return _0x345cce;}})[_0xa8a2('0x48')](function(_0x169052){logger['error'](_0xa8a2('0x54'),_0x169052);throw _0x169052;});}return _0x345cce;});}})[_0xa8a2('0x27')](respondWithResult(_0x34c6bf,0xc9))[_0xa8a2('0x48')](handleError(_0x34c6bf,null));};exports[_0xa8a2('0x26')]=function(_0x1248be,_0x10db29){if(_0x1248be[_0xa8a2('0x4e')]['id']){delete _0x1248be['body']['id'];}return db['JscriptyProject']['find']({'where':{'id':_0x1248be[_0xa8a2('0x4a')]['id']}})[_0xa8a2('0x27')](handleEntityNotFound(_0x10db29,null))[_0xa8a2('0x27')](saveUpdates(_0x1248be['body'],null))[_0xa8a2('0x27')](respondWithResult(_0x10db29,null))[_0xa8a2('0x48')](handleError(_0x10db29,null));};exports[_0xa8a2('0x2b')]=function(_0x59df51,_0x21dd41){return db[_0xa8a2('0x31')]['find']({'where':{'id':_0x59df51[_0xa8a2('0x4a')]['id']}})['then'](handleEntityNotFound(_0x21dd41,null))[_0xa8a2('0x27')](removeEntity(_0x21dd41,null))[_0xa8a2('0x48')](handleError(_0x21dd41,null));};exports[_0xa8a2('0x5b')]=function(_0x1e9ceb,_0x574844,_0x376002){var _0x459726={'raw':!![],'where':{}};var _0x1659c9={};var _0x287465={'count':0x0,'rows':[]};return db[_0xa8a2('0x31')][_0xa8a2('0x5c')]({'where':{'id':_0x1e9ceb['params']['id']}})['then'](handleEntityNotFound(_0x574844,null))['then'](function(_0x2e5138){if(_0x2e5138){_0x1659c9[_0xa8a2('0x36')]=_[_0xa8a2('0x38')](db[_0xa8a2('0x5d')][_0xa8a2('0x32')]);_0x1659c9[_0xa8a2('0x37')]=_['keys'](_0x1e9ceb[_0xa8a2('0x37')]);_0x1659c9[_0xa8a2('0x3f')]=_[_0xa8a2('0x39')](_0x1659c9[_0xa8a2('0x36')],_0x1659c9[_0xa8a2('0x37')]);_0x459726['attributes']=_[_0xa8a2('0x39')](_0x1659c9['model'],qs[_0xa8a2('0x3b')](_0x1e9ceb[_0xa8a2('0x37')][_0xa8a2('0x3b')]));_0x459726['attributes']=_0x459726[_0xa8a2('0x3a')]['length']?_0x459726[_0xa8a2('0x3a')]:_0x1659c9[_0xa8a2('0x36')];if(!_0x1e9ceb[_0xa8a2('0x37')]['hasOwnProperty'](_0xa8a2('0x5e'))){_0x459726[_0xa8a2('0x1f')]=qs[_0xa8a2('0x1f')](_0x1e9ceb[_0xa8a2('0x37')][_0xa8a2('0x1f')]);_0x459726[_0xa8a2('0x1d')]=qs[_0xa8a2('0x1d')](_0x1e9ceb[_0xa8a2('0x37')]['offset']);}_0x459726['order']=qs['sort'](_0x1e9ceb[_0xa8a2('0x37')][_0xa8a2('0x3d')]);_0x459726[_0xa8a2('0x3e')]=qs['filters'](_[_0xa8a2('0x40')](_0x1e9ceb[_0xa8a2('0x37')],_0x1659c9[_0xa8a2('0x3f')]));_0x459726[_0xa8a2('0x3e')][_0xa8a2('0x5f')]=_0x2e5138['id'];if(_0x1e9ceb[_0xa8a2('0x37')][_0xa8a2('0x41')]){_0x459726['where']=_['merge'](_0x459726[_0xa8a2('0x3e')],{'$or':_[_0xa8a2('0x30')](_0x459726[_0xa8a2('0x3a')],function(_0x736859){var _0x31eaf7={};_0x31eaf7[_0x736859]={'$like':'%'+_0x1e9ceb['query'][_0xa8a2('0x41')]+'%'};return _0x31eaf7;})});}_0x459726=_[_0xa8a2('0x42')]({},_0x459726,_0x1e9ceb[_0xa8a2('0x56')]);return db['JscriptySessionReport'][_0xa8a2('0x20')]({'where':_0x459726['where']})[_0xa8a2('0x27')](function(_0x3a01b9){_0x287465[_0xa8a2('0x20')]=_0x3a01b9;if(_0x1e9ceb[_0xa8a2('0x37')][_0xa8a2('0x44')]){_0x459726[_0xa8a2('0x45')]=[{'all':!![]}];}return db[_0xa8a2('0x5d')]['findAll'](_0x459726);})[_0xa8a2('0x27')](function(_0x12aec9){_0x287465[_0xa8a2('0x47')]=_0x12aec9;return _0x287465;});}})['then'](respondWithFilteredResult(_0x574844,_0x459726))[_0xa8a2('0x48')](handleError(_0x574844,null));};exports[_0xa8a2('0x60')]=function(_0x4a3ff4,_0x4f6edf,_0x1bef07){var _0x44ed41={'raw':!![],'where':{}};var _0x46fbac={};var _0xd5e480={'count':0x0,'rows':[]};return db['JscriptyProject'][_0xa8a2('0x5c')]({'where':{'id':_0x4a3ff4[_0xa8a2('0x4a')]['id']}})[_0xa8a2('0x27')](handleEntityNotFound(_0x4f6edf,null))['then'](function(_0x3e6c22){if(_0x3e6c22){_0x46fbac['model']=_[_0xa8a2('0x38')](db[_0xa8a2('0x61')]['rawAttributes']);_0x46fbac[_0xa8a2('0x37')]=_[_0xa8a2('0x38')](_0x4a3ff4['query']);_0x46fbac[_0xa8a2('0x3f')]=_[_0xa8a2('0x39')](_0x46fbac[_0xa8a2('0x36')],_0x46fbac[_0xa8a2('0x37')]);_0x44ed41[_0xa8a2('0x3a')]=_[_0xa8a2('0x39')](_0x46fbac[_0xa8a2('0x36')],qs['fields'](_0x4a3ff4[_0xa8a2('0x37')][_0xa8a2('0x3b')]));_0x44ed41[_0xa8a2('0x3a')]=_0x44ed41[_0xa8a2('0x3a')][_0xa8a2('0x4b')]?_0x44ed41[_0xa8a2('0x3a')]:_0x46fbac[_0xa8a2('0x36')];if(!_0x4a3ff4[_0xa8a2('0x37')][_0xa8a2('0x3c')](_0xa8a2('0x5e'))){_0x44ed41['limit']=qs[_0xa8a2('0x1f')](_0x4a3ff4[_0xa8a2('0x37')][_0xa8a2('0x1f')]);_0x44ed41[_0xa8a2('0x1d')]=qs['offset'](_0x4a3ff4[_0xa8a2('0x37')][_0xa8a2('0x1d')]);}_0x44ed41[_0xa8a2('0x62')]=qs['sort'](_0x4a3ff4['query'][_0xa8a2('0x3d')]);_0x44ed41[_0xa8a2('0x3e')]=qs[_0xa8a2('0x3f')](_[_0xa8a2('0x40')](_0x4a3ff4[_0xa8a2('0x37')],_0x46fbac[_0xa8a2('0x3f')]));_0x44ed41[_0xa8a2('0x3e')][_0xa8a2('0x5f')]=_0x3e6c22['id'];if(_0x4a3ff4[_0xa8a2('0x37')][_0xa8a2('0x41')]){_0x44ed41['where']=_['merge'](_0x44ed41[_0xa8a2('0x3e')],{'$or':_[_0xa8a2('0x30')](_0x44ed41['attributes'],function(_0x2c232a){var _0x59b432={};_0x59b432[_0x2c232a]={'$like':'%'+_0x4a3ff4[_0xa8a2('0x37')][_0xa8a2('0x41')]+'%'};return _0x59b432;})});}_0x44ed41=_[_0xa8a2('0x42')]({},_0x44ed41,_0x4a3ff4['options']);return db['JscriptyAnswerReport'][_0xa8a2('0x20')]({'where':_0x44ed41['where']})['then'](function(_0x4d9bc2){_0xd5e480[_0xa8a2('0x20')]=_0x4d9bc2;if(_0x4a3ff4[_0xa8a2('0x37')][_0xa8a2('0x44')]){_0x44ed41[_0xa8a2('0x45')]=[{'all':!![]}];}return db[_0xa8a2('0x61')][_0xa8a2('0x46')](_0x44ed41);})[_0xa8a2('0x27')](function(_0x268b49){_0xd5e480[_0xa8a2('0x47')]=_0x268b49;return _0xd5e480;});}})[_0xa8a2('0x27')](respondWithFilteredResult(_0x4f6edf,_0x44ed41))[_0xa8a2('0x48')](handleError(_0x4f6edf,null));};function char(_0x2d6400){return _0xa8a2('0x63')===typeof _0x2d6400?String['fromCharCode'][_0xa8a2('0x23')](null,arguments):_0x2d6400;}function needsEncapsulation(_0x14c041){return!!_0x14c041&&(_0x14c041[_0xa8a2('0x64')]()[_0xa8a2('0x65')](char(0xd))>=0x0||_0x14c041[_0xa8a2('0x64')]()[_0xa8a2('0x65')](char(0xa))>=0x0||_0x14c041[_0xa8a2('0x64')]()['indexOf'](char(0x2c))>=0x0||_0x14c041[_0xa8a2('0x64')]()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0x3e4aa9){var _0x8373b8=char(0x22),_0x3dfd46='\x5c'+char(0x22),_0x15315b=_0x3e4aa9[_0xa8a2('0x64')]()[_0xa8a2('0x66')](new RegExp(_0x8373b8,'g'),_0x3dfd46);return _0x8373b8+_0x15315b+_0x8373b8;}exports['getSummary']=function(_0x1f0c3e,_0x42de78,_0x52be60){var _0x175f4f,_0x559baa;var _0x386846={'where':{'ProjectId':_0x1f0c3e[_0xa8a2('0x4a')]['id']}};if(_0x1f0c3e[_0xa8a2('0x37')][_0xa8a2('0x67')]){_0x386846['where'][_0xa8a2('0x68')]=JSON[_0xa8a2('0x69')](_0x1f0c3e[_0xa8a2('0x37')]['startTime']);}return db[_0xa8a2('0x5d')][_0xa8a2('0x46')](_0x386846)[_0xa8a2('0x27')](handleEntityNotFound(_0x42de78,null))['then'](function(_0xa7446b){if(_0xa7446b){_0x175f4f=_0xa7446b;return db['JscriptyQuestionReport'][_0xa8a2('0x46')]({'where':{'SessionId':{'$in':_[_0xa8a2('0x30')](_0x175f4f,'id')},'ProjectId':_0x1f0c3e['params']['id']},'order':_0xa8a2('0x6a')});}})[_0xa8a2('0x27')](handleEntityNotFound(_0x42de78,null))[_0xa8a2('0x27')](function(_0x421415){if(_0x421415){_0x559baa=_0x421415;var _0x455ce8={};for(var _0x4af20c=0x0,_0x5c9dda=_0x559baa['length'];_0x4af20c<_0x5c9dda;_0x4af20c++){if(!_0x455ce8[_0xa8a2('0x3c')](_0x559baa[_0x4af20c][_0xa8a2('0x6b')])){_0x455ce8[_0x559baa[_0x4af20c]['questionId']]=needsEncapsulation(_0x559baa[_0x4af20c][_0xa8a2('0x6c')])?encapsulate(_0x559baa[_0x4af20c]['question']):_0x559baa[_0x4af20c][_0xa8a2('0x6c')];}}var _0x35f625=[],_0x34b8bf={};for(var _0x2eb25f=0x0,_0x4e9b68=_0x175f4f['length'];_0x2eb25f<_0x4e9b68;_0x2eb25f++){_0x34b8bf={'ProjectId':_0x1f0c3e[_0xa8a2('0x4a')]['id'],'SessionId':_0x175f4f[_0x2eb25f]['id'],'StartTime':moment(_0x175f4f[_0x2eb25f][_0xa8a2('0x68')])[_0xa8a2('0x6d')](_0xa8a2('0x6e'))};for(var _0x142651=0x0,_0x571e68=_0x559baa[_0xa8a2('0x4b')];_0x142651<_0x571e68;_0x142651++){if(_0x559baa[_0x142651][_0xa8a2('0x6f')]==_0x175f4f[_0x2eb25f]['id']&&_0x455ce8[_0xa8a2('0x3c')](_0x559baa[_0x142651]['questionId'])){_0x34b8bf[_0x455ce8[_0x559baa[_0x142651][_0xa8a2('0x6b')]]]=_0x559baa[_0x142651][_0xa8a2('0x70')];}}for(var _0x168d6d in _0x455ce8){if(!_0x34b8bf[_0xa8a2('0x3c')](_0x455ce8[_0x168d6d])){_0x34b8bf[_0x455ce8[_0x168d6d]]=null;}}_0x35f625[_0xa8a2('0x71')](_0x34b8bf);}return _0x35f625;}})[_0xa8a2('0x27')](function(_0x46fa16){if(!_['isEmpty'](_0x46fa16)){var _0x352842=toCsv(_0x46fa16);var _0x4b4e6e=Date[_0xa8a2('0x72')]();fs[_0xa8a2('0x73')](util['format'](_0xa8a2('0x74'),_0x1f0c3e['params']['id'],_0x4b4e6e),_0x352842);_0x42de78['setHeader'](_0xa8a2('0x75'),_0xa8a2('0x76')+util[_0xa8a2('0x6d')](_0xa8a2('0x77'),_0x1f0c3e[_0xa8a2('0x4a')]['id'],_0x4b4e6e));_0x42de78[_0xa8a2('0x78')](_0xa8a2('0x79'),_0xa8a2('0x7a'));return _0x42de78['download'](util[_0xa8a2('0x6d')](_0xa8a2('0x74'),_0x1f0c3e[_0xa8a2('0x4a')]['id'],_0x4b4e6e));}else{return _0x42de78[_0xa8a2('0x19')](0xcc);}})[_0xa8a2('0x48')](handleError(_0x42de78,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 9bf7218..c15a691 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 _0xabe8=['lodash','util','../../config/logger','moment','bluebird','path','../../config/environment','./jscriptyProject.attributes','exports','jscripty_projects'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0xabe8,0x8c));var _0x8abe=function(_0x22af95,_0x3d0704){_0x22af95=_0x22af95-0x0;var _0x4e4adc=_0xabe8[_0x22af95];return _0x4e4adc;};'use strict';var _=require(_0x8abe('0x0'));var util=require(_0x8abe('0x1'));var logger=require(_0x8abe('0x2'))('api');var moment=require(_0x8abe('0x3'));var BPromise=require(_0x8abe('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8abe('0x5'));var rimraf=require('rimraf');var config=require(_0x8abe('0x6'));var attributes=require(_0x8abe('0x7'));module[_0x8abe('0x8')]=function(_0x3a24e6,_0x7619bb){return _0x3a24e6['define']('JscriptyProject',attributes,{'tableName':_0x8abe('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbf4e=['moment','bluebird','path','./jscriptyProject.attributes','exports','define','JscriptyProject','lodash','util','../../config/logger','api'];(function(_0x3ea64b,_0x42a5b3){var _0x31bc8f=function(_0xa7ab91){while(--_0xa7ab91){_0x3ea64b['push'](_0x3ea64b['shift']());}};_0x31bc8f(++_0x42a5b3);}(_0xbf4e,0x172));var _0xebf4=function(_0x5cebfa,_0x4c424f){_0x5cebfa=_0x5cebfa-0x0;var _0x189921=_0xbf4e[_0x5cebfa];return _0x189921;};'use strict';var _=require(_0xebf4('0x0'));var util=require(_0xebf4('0x1'));var logger=require(_0xebf4('0x2'))(_0xebf4('0x3'));var moment=require(_0xebf4('0x4'));var BPromise=require(_0xebf4('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xebf4('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xebf4('0x7'));module[_0xebf4('0x8')]=function(_0x5adea8,_0x412bbe){return _0x5adea8[_0xebf4('0x9')](_0xebf4('0xa'),attributes,{'tableName':'jscripty_projects','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 04003fa..70b3d25 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 _0xaa88=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','error','JscriptyProject,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird'];(function(_0x19d86d,_0x25b504){var _0x1d5503=function(_0x563c14){while(--_0x563c14){_0x19d86d['push'](_0x19d86d['shift']());}};_0x1d5503(++_0x25b504);}(_0xaa88,0x137));var _0x8aa8=function(_0x9d639c,_0x524dbe){_0x9d639c=_0x9d639c-0x0;var _0x1671de=_0xaa88[_0x9d639c];return _0x1671de;};'use strict';var _=require(_0x8aa8('0x0'));var util=require(_0x8aa8('0x1'));var moment=require(_0x8aa8('0x2'));var BPromise=require(_0x8aa8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8aa8('0x4'));var db=require(_0x8aa8('0x5'))['db'];var utils=require(_0x8aa8('0x6'));var logger=require(_0x8aa8('0x7'))(_0x8aa8('0x8'));var config=require(_0x8aa8('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8aa8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5264ff,_0x449d2d,_0x1ed84d){return new BPromise(function(_0x27c08d,_0x40826f){return client['request'](_0x5264ff,_0x1ed84d)[_0x8aa8('0xb')](function(_0x2d974c){logger[_0x8aa8('0xc')]('JscriptyProject,\x20%s,\x20%s',_0x449d2d,_0x8aa8('0xd'));logger[_0x8aa8('0xe')](_0x8aa8('0xf'),_0x449d2d,_0x8aa8('0xd'),JSON['stringify'](_0x2d974c));if(_0x2d974c[_0x8aa8('0x10')]){if(_0x2d974c[_0x8aa8('0x10')]['code']===0x1f4){logger[_0x8aa8('0x10')](_0x8aa8('0x11'),_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x40826f(_0x2d974c[_0x8aa8('0x10')][_0x8aa8('0x12')]);}logger[_0x8aa8('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x27c08d(_0x2d974c['error'][_0x8aa8('0x12')]);}else{logger[_0x8aa8('0xc')](_0x8aa8('0x11'),_0x449d2d,_0x8aa8('0xd'));_0x27c08d(_0x2d974c[_0x8aa8('0x13')][_0x8aa8('0x12')]);}})[_0x8aa8('0x14')](function(_0xd59fb8){logger[_0x8aa8('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x449d2d,_0xd59fb8);_0x40826f(_0xd59fb8);});});} \ 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(_0x2aae71,_0x276671){var _0x28bd3d=function(_0x37c588){while(--_0x37c588){_0x2aae71['push'](_0x2aae71['shift']());}};_0x28bd3d(++_0x276671);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'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 7bc3a6f..ed46f2f 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 _0x92d8=['multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create','/:id','update','delete'];(function(_0x51596b,_0x318016){var _0x4eba24=function(_0xbce050){while(--_0xbce050){_0x51596b['push'](_0x51596b['shift']());}};_0x4eba24(++_0x318016);}(_0x92d8,0xb4));var _0x892d=function(_0x40b729,_0x30ce96){_0x40b729=_0x40b729-0x0;var _0x42845f=_0x92d8[_0x40b729];return _0x42845f;};'use strict';var multer=require(_0x892d('0x0'));var util=require(_0x892d('0x1'));var path=require('path');var timeout=require(_0x892d('0x2'));var express=require(_0x892d('0x3'));var router=express['Router']();var fs_extra=require(_0x892d('0x4'));var auth=require(_0x892d('0x5'));var interaction=require(_0x892d('0x6'));var config=require(_0x892d('0x7'));var controller=require(_0x892d('0x8'));router[_0x892d('0x9')]('/',auth[_0x892d('0xa')](),controller[_0x892d('0xb')]);router[_0x892d('0x9')](_0x892d('0xc'),auth['isAuthenticated'](),controller[_0x892d('0xd')]);router[_0x892d('0x9')]('/:id',auth[_0x892d('0xa')](),controller[_0x892d('0xe')]);router[_0x892d('0xf')]('/',auth[_0x892d('0xa')](),controller[_0x892d('0x10')]);router['put'](_0x892d('0x11'),auth['isAuthenticated'](),controller[_0x892d('0x12')]);router[_0x892d('0x13')](_0x892d('0x11'),auth[_0x892d('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xec89=['path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','create','put','destroy','exports','multer'];(function(_0x12cb8e,_0x11409e){var _0xbc2428=function(_0x30fe28){while(--_0x30fe28){_0x12cb8e['push'](_0x12cb8e['shift']());}};_0xbc2428(++_0x11409e);}(_0xec89,0xc2));var _0x9ec8=function(_0x918cb4,_0x244f37){_0x918cb4=_0x918cb4-0x0;var _0x11e6d8=_0xec89[_0x918cb4];return _0x11e6d8;};'use strict';var multer=require(_0x9ec8('0x0'));var util=require('util');var path=require(_0x9ec8('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x9ec8('0x2'));var auth=require(_0x9ec8('0x3'));var interaction=require(_0x9ec8('0x4'));var config=require(_0x9ec8('0x5'));var controller=require('./jscriptyQuestionReport.controller');router[_0x9ec8('0x6')]('/',auth[_0x9ec8('0x7')](),controller[_0x9ec8('0x8')]);router[_0x9ec8('0x6')]('/describe',auth[_0x9ec8('0x7')](),controller['describe']);router[_0x9ec8('0x6')](_0x9ec8('0x9'),auth[_0x9ec8('0x7')](),controller[_0x9ec8('0xa')]);router['post']('/',auth[_0x9ec8('0x7')](),controller[_0x9ec8('0xb')]);router[_0x9ec8('0xc')]('/:id',auth[_0x9ec8('0x7')](),controller['update']);router['delete']('/:id',auth[_0x9ec8('0x7')](),controller[_0x9ec8('0xd')]);module[_0x9ec8('0xe')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 5e7eeca..36779ef 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(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x7a54,0x106));var _0x47a5=function(_0x4f8176,_0x4b3da8){_0x4f8176=_0x4f8176-0x0;var _0x3b2dfa=_0x7a54[_0x4f8176];return _0x3b2dfa;};'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(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x7a54,0x106));var _0x47a5=function(_0x426108,_0x3d46ec){_0x426108=_0x426108-0x0;var _0x45b27c=_0x7a54[_0x426108];return _0x45b27c;};'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 6860b42..ababf85 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 _0xbf16=['../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','then','destroy','error','stack','name','index','map','JscriptyQuestionReport','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','eml-format','fast-json-patch','request-promise','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x5cf980,_0x2d1346){var _0x278caf=function(_0x2cfd82){while(--_0x2cfd82){_0x5cf980['push'](_0x5cf980['shift']());}};_0x278caf(++_0x2d1346);}(_0xbf16,0x19a));var _0x6bf1=function(_0x1cf30a,_0x514480){_0x1cf30a=_0x1cf30a-0x0;var _0x15f651=_0xbf16[_0x1cf30a];return _0x15f651;};'use strict';var emlformat=require(_0x6bf1('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6bf1('0x1'));var rp=require(_0x6bf1('0x2'));var moment=require('moment');var BPromise=require(_0x6bf1('0x3'));var Mustache=require(_0x6bf1('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x6bf1('0x5'));var ejs=require(_0x6bf1('0x6'));var fs=require('fs');var fs_extra=require(_0x6bf1('0x7'));var _=require(_0x6bf1('0x8'));var squel=require(_0x6bf1('0x9'));var crypto=require(_0x6bf1('0xa'));var jsforce=require(_0x6bf1('0xb'));var deskjs=require(_0x6bf1('0xc'));var toCsv=require(_0x6bf1('0x5'));var querystring=require(_0x6bf1('0xd'));var Papa=require(_0x6bf1('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6bf1('0xf'));var as=require(_0x6bf1('0x10'));var hardwareService=require(_0x6bf1('0x11'));var logger=require(_0x6bf1('0x12'))(_0x6bf1('0x13'));var utils=require(_0x6bf1('0x14'));var config=require(_0x6bf1('0x15'));var licenseUtil=require(_0x6bf1('0x16'));var db=require(_0x6bf1('0x17'))['db'];function respondWithStatusCode(_0x6a310a,_0x1b52ba){_0x1b52ba=_0x1b52ba||0xcc;return function(_0x12bd8d){if(_0x12bd8d){return _0x6a310a['sendStatus'](_0x1b52ba);}return _0x6a310a[_0x6bf1('0x18')](_0x1b52ba)[_0x6bf1('0x19')]();};}function respondWithResult(_0x35eb85,_0x745870){_0x745870=_0x745870||0xc8;return function(_0x4c5465){if(_0x4c5465){return _0x35eb85[_0x6bf1('0x18')](_0x745870)[_0x6bf1('0x1a')](_0x4c5465);}};}function respondWithFilteredResult(_0x30ae30,_0x5e84fd){return function(_0x5d5196){if(_0x5d5196){var _0x3f3e0f=typeof _0x5e84fd[_0x6bf1('0x1b')]===_0x6bf1('0x1c')&&typeof _0x5e84fd[_0x6bf1('0x1d')]===_0x6bf1('0x1c');var _0x3b9e47=_0x5d5196[_0x6bf1('0x1e')];var _0x18968f=_0x3f3e0f?0x0:_0x5e84fd[_0x6bf1('0x1b')];var _0x2ce47c=_0x3f3e0f?_0x5d5196[_0x6bf1('0x1e')]:_0x5e84fd['offset']+_0x5e84fd['limit'];var _0x2578dd;if(_0x2ce47c>=_0x3b9e47){_0x2ce47c=_0x3b9e47;_0x2578dd=0xc8;}else{_0x2578dd=0xce;}_0x30ae30['status'](_0x2578dd);return _0x30ae30[_0x6bf1('0x1f')](_0x6bf1('0x20'),_0x18968f+'-'+_0x2ce47c+'/'+_0x3b9e47)[_0x6bf1('0x1a')](_0x5d5196);}return null;};}function patchUpdates(_0x5b83cd){return function(_0x24b749){try{jsonpatch['apply'](_0x24b749,_0x5b83cd,!![]);}catch(_0x656ea7){return BPromise['reject'](_0x656ea7);}return _0x24b749['save']();};}function saveUpdates(_0x5a9093,_0x4cfbe8){return function(_0x4a613c){if(_0x4a613c){return _0x4a613c['update'](_0x5a9093)[_0x6bf1('0x21')](function(_0x42a740){return _0x42a740;});}return null;};}function removeEntity(_0x4c6383,_0x2d8cdb){return function(_0x5d8072){if(_0x5d8072){return _0x5d8072[_0x6bf1('0x22')]()['then'](function(){_0x4c6383[_0x6bf1('0x18')](0xcc)[_0x6bf1('0x19')]();});}};}function handleEntityNotFound(_0x3657d3,_0xd70682){return function(_0x68bb96){if(!_0x68bb96){_0x3657d3['sendStatus'](0x194);}return _0x68bb96;};}function handleError(_0x5b7d7e,_0xdb60e3){_0xdb60e3=_0xdb60e3||0x1f4;return function(_0x4a8e71){logger[_0x6bf1('0x23')](_0x4a8e71[_0x6bf1('0x24')]);if(_0x4a8e71['name']){delete _0x4a8e71[_0x6bf1('0x25')];}_0x5b7d7e['status'](_0xdb60e3)['send'](_0x4a8e71);};}exports[_0x6bf1('0x26')]=function(_0x756215,_0x50ad7b){var _0x216c8e={},_0x71f70={},_0x305edc={'count':0x0,'rows':[]};var _0x3c785d=_[_0x6bf1('0x27')](db[_0x6bf1('0x28')][_0x6bf1('0x29')],function(_0x1bad4e){return{'name':_0x1bad4e[_0x6bf1('0x2a')],'type':_0x1bad4e['type'][_0x6bf1('0x2b')]};});_0x71f70[_0x6bf1('0x2c')]=_[_0x6bf1('0x27')](_0x3c785d,'name');_0x71f70[_0x6bf1('0x2d')]=_[_0x6bf1('0x2e')](_0x756215[_0x6bf1('0x2d')]);_0x71f70['filters']=_[_0x6bf1('0x2f')](_0x71f70[_0x6bf1('0x2c')],_0x71f70[_0x6bf1('0x2d')]);_0x216c8e[_0x6bf1('0x30')]=_[_0x6bf1('0x2f')](_0x71f70[_0x6bf1('0x2c')],qs[_0x6bf1('0x31')](_0x756215[_0x6bf1('0x2d')]['fields']));_0x216c8e[_0x6bf1('0x30')]=_0x216c8e[_0x6bf1('0x30')][_0x6bf1('0x32')]?_0x216c8e[_0x6bf1('0x30')]:_0x71f70[_0x6bf1('0x2c')];if(!_0x756215[_0x6bf1('0x2d')][_0x6bf1('0x33')]('nolimit')){_0x216c8e[_0x6bf1('0x1d')]=qs['limit'](_0x756215[_0x6bf1('0x2d')][_0x6bf1('0x1d')]);_0x216c8e[_0x6bf1('0x1b')]=qs[_0x6bf1('0x1b')](_0x756215[_0x6bf1('0x2d')][_0x6bf1('0x1b')]);}_0x216c8e[_0x6bf1('0x34')]=qs['sort'](_0x756215[_0x6bf1('0x2d')][_0x6bf1('0x35')]);_0x216c8e[_0x6bf1('0x36')]=qs[_0x6bf1('0x37')](_['pick'](_0x756215[_0x6bf1('0x2d')],_0x71f70[_0x6bf1('0x37')]),_0x3c785d);if(_0x756215[_0x6bf1('0x2d')]['filter']){_0x216c8e['where']=_['merge'](_0x216c8e['where'],{'$or':_[_0x6bf1('0x27')](_0x3c785d,function(_0x5c538a){if(_0x5c538a[_0x6bf1('0x38')]!==_0x6bf1('0x39')){var _0x2a7bb7={};_0x2a7bb7[_0x5c538a['name']]={'$like':'%'+_0x756215[_0x6bf1('0x2d')][_0x6bf1('0x3a')]+'%'};return _0x2a7bb7;}})});}_0x216c8e=_[_0x6bf1('0x3b')]({},_0x216c8e,_0x756215[_0x6bf1('0x3c')]);var _0x54f799={'where':_0x216c8e[_0x6bf1('0x36')]};return db[_0x6bf1('0x28')][_0x6bf1('0x1e')](_0x54f799)[_0x6bf1('0x21')](function(_0x4a771d){_0x305edc['count']=_0x4a771d;if(_0x756215[_0x6bf1('0x2d')][_0x6bf1('0x3d')]){_0x216c8e[_0x6bf1('0x3e')]=[{'all':!![]}];}return db[_0x6bf1('0x28')][_0x6bf1('0x3f')](_0x216c8e);})[_0x6bf1('0x21')](function(_0x2ee71f){_0x305edc[_0x6bf1('0x40')]=_0x2ee71f;return _0x305edc;})[_0x6bf1('0x21')](respondWithFilteredResult(_0x50ad7b,_0x216c8e))[_0x6bf1('0x41')](handleError(_0x50ad7b,null));};exports[_0x6bf1('0x42')]=function(_0x513cfb,_0x17d63b){var _0x2781b0={'raw':!![],'where':{'id':_0x513cfb['params']['id']}},_0x4aa129={};_0x4aa129['model']=_[_0x6bf1('0x2e')](db[_0x6bf1('0x28')][_0x6bf1('0x29')]);_0x4aa129['query']=_[_0x6bf1('0x2e')](_0x513cfb['query']);_0x4aa129[_0x6bf1('0x37')]=_['intersection'](_0x4aa129[_0x6bf1('0x2c')],_0x4aa129[_0x6bf1('0x2d')]);_0x2781b0[_0x6bf1('0x30')]=_[_0x6bf1('0x2f')](_0x4aa129[_0x6bf1('0x2c')],qs['fields'](_0x513cfb[_0x6bf1('0x2d')][_0x6bf1('0x31')]));_0x2781b0[_0x6bf1('0x30')]=_0x2781b0['attributes']['length']?_0x2781b0[_0x6bf1('0x30')]:_0x4aa129['model'];if(_0x513cfb[_0x6bf1('0x2d')][_0x6bf1('0x3d')]){_0x2781b0[_0x6bf1('0x3e')]=[{'all':!![]}];}_0x2781b0=_['merge']({},_0x2781b0,_0x513cfb[_0x6bf1('0x3c')]);return db[_0x6bf1('0x28')][_0x6bf1('0x43')](_0x2781b0)[_0x6bf1('0x21')](handleEntityNotFound(_0x17d63b,null))[_0x6bf1('0x21')](respondWithResult(_0x17d63b,null))[_0x6bf1('0x41')](handleError(_0x17d63b,null));};exports[_0x6bf1('0x44')]=function(_0x56084c,_0x2c71bb){return db['JscriptyQuestionReport']['create'](_0x56084c[_0x6bf1('0x45')],{})[_0x6bf1('0x21')](respondWithResult(_0x2c71bb,0xc9))[_0x6bf1('0x41')](handleError(_0x2c71bb,null));};exports['update']=function(_0x9eb9b0,_0x2d6993){if(_0x9eb9b0[_0x6bf1('0x45')]['id']){delete _0x9eb9b0[_0x6bf1('0x45')]['id'];}return db[_0x6bf1('0x28')]['find']({'where':{'id':_0x9eb9b0['params']['id']}})[_0x6bf1('0x21')](handleEntityNotFound(_0x2d6993,null))[_0x6bf1('0x21')](saveUpdates(_0x9eb9b0[_0x6bf1('0x45')],null))[_0x6bf1('0x21')](respondWithResult(_0x2d6993,null))['catch'](handleError(_0x2d6993,null));};exports[_0x6bf1('0x22')]=function(_0x4c594d,_0x21c65a){return db[_0x6bf1('0x28')]['find']({'where':{'id':_0x4c594d[_0x6bf1('0x46')]['id']}})[_0x6bf1('0x21')](handleEntityNotFound(_0x21c65a,null))[_0x6bf1('0x21')](removeEntity(_0x21c65a,null))[_0x6bf1('0x41')](handleError(_0x21c65a,null));};exports[_0x6bf1('0x47')]=function(_0x1b3987,_0x50b3d0){return db[_0x6bf1('0x28')][_0x6bf1('0x47')]()[_0x6bf1('0x21')](respondWithResult(_0x50b3d0,null))[_0x6bf1('0x41')](handleError(_0x50b3d0,null));}; \ No newline at end of file +var _0x6516=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','send','map','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','JscriptyQuestionReport','count','includeAll','include','findAll','rows','params','keys','length','options','find','create','body','catch','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse'];(function(_0x414cc6,_0x575533){var _0x13cc6c=function(_0x122fc0){while(--_0x122fc0){_0x414cc6['push'](_0x414cc6['shift']());}};_0x13cc6c(++_0x575533);}(_0x6516,0x1c4));var _0x6651=function(_0xa62c3a,_0x160877){_0xa62c3a=_0xa62c3a-0x0;var _0x4e30be=_0x6516[_0xa62c3a];return _0x4e30be;};'use strict';var emlformat=require(_0x6651('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6651('0x1'));var jsonpatch=require(_0x6651('0x2'));var rp=require(_0x6651('0x3'));var moment=require(_0x6651('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6651('0x5'));var util=require(_0x6651('0x6'));var path=require(_0x6651('0x7'));var sox=require(_0x6651('0x8'));var csv=require(_0x6651('0x9'));var ejs=require(_0x6651('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6651('0xb'));var squel=require(_0x6651('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6651('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6651('0xe'));var Papa=require(_0x6651('0xf'));var Redis=require(_0x6651('0x10'));var authService=require(_0x6651('0x11'));var qs=require(_0x6651('0x12'));var as=require(_0x6651('0x13'));var hardwareService=require(_0x6651('0x14'));var logger=require(_0x6651('0x15'))(_0x6651('0x16'));var utils=require('../../config/utils');var config=require(_0x6651('0x17'));var licenseUtil=require(_0x6651('0x18'));var db=require(_0x6651('0x19'))['db'];function respondWithStatusCode(_0x5f0e55,_0x5b2e49){_0x5b2e49=_0x5b2e49||0xcc;return function(_0x1e837d){if(_0x1e837d){return _0x5f0e55['sendStatus'](_0x5b2e49);}return _0x5f0e55[_0x6651('0x1a')](_0x5b2e49)[_0x6651('0x1b')]();};}function respondWithResult(_0x36edf8,_0x4f5e5e){_0x4f5e5e=_0x4f5e5e||0xc8;return function(_0x362f99){if(_0x362f99){return _0x36edf8[_0x6651('0x1a')](_0x4f5e5e)[_0x6651('0x1c')](_0x362f99);}};}function respondWithFilteredResult(_0x4218d6,_0x283c73){return function(_0x1877b8){if(_0x1877b8){var _0x93b83e=typeof _0x283c73[_0x6651('0x1d')]==='undefined'&&typeof _0x283c73[_0x6651('0x1e')]===_0x6651('0x1f');var _0x2d8e97=_0x1877b8['count'];var _0x2d3120=_0x93b83e?0x0:_0x283c73[_0x6651('0x1d')];var _0x5f0447=_0x93b83e?_0x1877b8['count']:_0x283c73[_0x6651('0x1d')]+_0x283c73[_0x6651('0x1e')];var _0x4261b4;if(_0x5f0447>=_0x2d8e97){_0x5f0447=_0x2d8e97;_0x4261b4=0xc8;}else{_0x4261b4=0xce;}_0x4218d6['status'](_0x4261b4);return _0x4218d6[_0x6651('0x20')](_0x6651('0x21'),_0x2d3120+'-'+_0x5f0447+'/'+_0x2d8e97)['json'](_0x1877b8);}return null;};}function patchUpdates(_0x5c4b27){return function(_0x31fd8c){try{jsonpatch['apply'](_0x31fd8c,_0x5c4b27,!![]);}catch(_0x112861){return BPromise[_0x6651('0x22')](_0x112861);}return _0x31fd8c[_0x6651('0x23')]();};}function saveUpdates(_0x1ca615,_0x32d8ba){return function(_0x5c0330){if(_0x5c0330){return _0x5c0330[_0x6651('0x24')](_0x1ca615)[_0x6651('0x25')](function(_0x33aabd){return _0x33aabd;});}return null;};}function removeEntity(_0x3009f4,_0x471144){return function(_0x314aa6){if(_0x314aa6){return _0x314aa6[_0x6651('0x26')]()[_0x6651('0x25')](function(){_0x3009f4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5aea23,_0x2449df){return function(_0x55502f){if(!_0x55502f){_0x5aea23[_0x6651('0x27')](0x194);}return _0x55502f;};}function handleError(_0xc585cd,_0x4ca045){_0x4ca045=_0x4ca045||0x1f4;return function(_0x58757d){logger[_0x6651('0x28')](_0x58757d[_0x6651('0x29')]);if(_0x58757d[_0x6651('0x2a')]){delete _0x58757d[_0x6651('0x2a')];}_0xc585cd[_0x6651('0x1a')](_0x4ca045)[_0x6651('0x2b')](_0x58757d);};}exports['index']=function(_0x489193,_0x3ac6be){var _0x55ae02={},_0x133159={},_0x4dfe37={'count':0x0,'rows':[]};var _0x19a3b9=_[_0x6651('0x2c')](db['JscriptyQuestionReport'][_0x6651('0x2d')],function(_0xd8b54){return{'name':_0xd8b54[_0x6651('0x2e')],'type':_0xd8b54['type'][_0x6651('0x2f')]};});_0x133159[_0x6651('0x30')]=_[_0x6651('0x2c')](_0x19a3b9,_0x6651('0x2a'));_0x133159[_0x6651('0x31')]=_['keys'](_0x489193[_0x6651('0x31')]);_0x133159[_0x6651('0x32')]=_[_0x6651('0x33')](_0x133159[_0x6651('0x30')],_0x133159['query']);_0x55ae02['attributes']=_[_0x6651('0x33')](_0x133159['model'],qs[_0x6651('0x34')](_0x489193[_0x6651('0x31')][_0x6651('0x34')]));_0x55ae02[_0x6651('0x35')]=_0x55ae02[_0x6651('0x35')]['length']?_0x55ae02[_0x6651('0x35')]:_0x133159['model'];if(!_0x489193[_0x6651('0x31')]['hasOwnProperty'](_0x6651('0x36'))){_0x55ae02[_0x6651('0x1e')]=qs[_0x6651('0x1e')](_0x489193['query']['limit']);_0x55ae02['offset']=qs[_0x6651('0x1d')](_0x489193[_0x6651('0x31')]['offset']);}_0x55ae02[_0x6651('0x37')]=qs[_0x6651('0x38')](_0x489193[_0x6651('0x31')][_0x6651('0x38')]);_0x55ae02[_0x6651('0x39')]=qs['filters'](_[_0x6651('0x3a')](_0x489193['query'],_0x133159[_0x6651('0x32')]),_0x19a3b9);if(_0x489193[_0x6651('0x31')][_0x6651('0x3b')]){_0x55ae02[_0x6651('0x39')]=_[_0x6651('0x3c')](_0x55ae02[_0x6651('0x39')],{'$or':_[_0x6651('0x2c')](_0x19a3b9,function(_0x48027d){if(_0x48027d[_0x6651('0x3d')]!==_0x6651('0x3e')){var _0x1c5150={};_0x1c5150[_0x48027d['name']]={'$like':'%'+_0x489193['query'][_0x6651('0x3b')]+'%'};return _0x1c5150;}})});}_0x55ae02=_[_0x6651('0x3c')]({},_0x55ae02,_0x489193['options']);var _0x498e70={'where':_0x55ae02[_0x6651('0x39')]};return db[_0x6651('0x3f')][_0x6651('0x40')](_0x498e70)[_0x6651('0x25')](function(_0x2ef77c){_0x4dfe37[_0x6651('0x40')]=_0x2ef77c;if(_0x489193[_0x6651('0x31')][_0x6651('0x41')]){_0x55ae02[_0x6651('0x42')]=[{'all':!![]}];}return db[_0x6651('0x3f')][_0x6651('0x43')](_0x55ae02);})['then'](function(_0x46ecce){_0x4dfe37[_0x6651('0x44')]=_0x46ecce;return _0x4dfe37;})[_0x6651('0x25')](respondWithFilteredResult(_0x3ac6be,_0x55ae02))['catch'](handleError(_0x3ac6be,null));};exports['show']=function(_0x26f5c0,_0x599bd9){var _0x29ecfe={'raw':!![],'where':{'id':_0x26f5c0[_0x6651('0x45')]['id']}},_0x382d22={};_0x382d22[_0x6651('0x30')]=_[_0x6651('0x46')](db[_0x6651('0x3f')][_0x6651('0x2d')]);_0x382d22[_0x6651('0x31')]=_[_0x6651('0x46')](_0x26f5c0[_0x6651('0x31')]);_0x382d22[_0x6651('0x32')]=_['intersection'](_0x382d22['model'],_0x382d22['query']);_0x29ecfe[_0x6651('0x35')]=_[_0x6651('0x33')](_0x382d22['model'],qs[_0x6651('0x34')](_0x26f5c0[_0x6651('0x31')][_0x6651('0x34')]));_0x29ecfe[_0x6651('0x35')]=_0x29ecfe[_0x6651('0x35')][_0x6651('0x47')]?_0x29ecfe['attributes']:_0x382d22[_0x6651('0x30')];if(_0x26f5c0[_0x6651('0x31')][_0x6651('0x41')]){_0x29ecfe[_0x6651('0x42')]=[{'all':!![]}];}_0x29ecfe=_[_0x6651('0x3c')]({},_0x29ecfe,_0x26f5c0[_0x6651('0x48')]);return db[_0x6651('0x3f')][_0x6651('0x49')](_0x29ecfe)[_0x6651('0x25')](handleEntityNotFound(_0x599bd9,null))['then'](respondWithResult(_0x599bd9,null))['catch'](handleError(_0x599bd9,null));};exports[_0x6651('0x4a')]=function(_0x49ed64,_0x2875f1){return db[_0x6651('0x3f')][_0x6651('0x4a')](_0x49ed64[_0x6651('0x4b')],{})[_0x6651('0x25')](respondWithResult(_0x2875f1,0xc9))[_0x6651('0x4c')](handleError(_0x2875f1,null));};exports[_0x6651('0x24')]=function(_0x76a400,_0x3c3484){if(_0x76a400[_0x6651('0x4b')]['id']){delete _0x76a400[_0x6651('0x4b')]['id'];}return db['JscriptyQuestionReport'][_0x6651('0x49')]({'where':{'id':_0x76a400[_0x6651('0x45')]['id']}})[_0x6651('0x25')](handleEntityNotFound(_0x3c3484,null))[_0x6651('0x25')](saveUpdates(_0x76a400['body'],null))[_0x6651('0x25')](respondWithResult(_0x3c3484,null))['catch'](handleError(_0x3c3484,null));};exports[_0x6651('0x26')]=function(_0x2d79cd,_0x322578){return db[_0x6651('0x3f')][_0x6651('0x49')]({'where':{'id':_0x2d79cd[_0x6651('0x45')]['id']}})[_0x6651('0x25')](handleEntityNotFound(_0x322578,null))['then'](removeEntity(_0x322578,null))[_0x6651('0x4c')](handleError(_0x322578,null));};exports[_0x6651('0x4d')]=function(_0x233cc8,_0x2013e2){return db[_0x6651('0x3f')][_0x6651('0x4d')]()[_0x6651('0x25')](respondWithResult(_0x2013e2,null))[_0x6651('0x4c')](handleError(_0x2013e2,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index a30e9aa..9024dc5 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 _0x536c=['define','JscriptyQuestionReport','report_jscripty_questions','lodash','util','api','moment','bluebird','request-promise','path','./jscriptyQuestionReport.attributes','exports'];(function(_0xc556aa,_0x4f9c9e){var _0x2cbb56=function(_0x4f410e){while(--_0x4f410e){_0xc556aa['push'](_0xc556aa['shift']());}};_0x2cbb56(++_0x4f9c9e);}(_0x536c,0xb7));var _0xc536=function(_0x37311f,_0x15c70b){_0x37311f=_0x37311f-0x0;var _0x2b101b=_0x536c[_0x37311f];return _0x2b101b;};'use strict';var _=require(_0xc536('0x0'));var util=require(_0xc536('0x1'));var logger=require('../../config/logger')(_0xc536('0x2'));var moment=require(_0xc536('0x3'));var BPromise=require(_0xc536('0x4'));var rp=require(_0xc536('0x5'));var fs=require('fs');var path=require(_0xc536('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc536('0x7'));module[_0xc536('0x8')]=function(_0x5c0f37,_0x1362a5){return _0x5c0f37[_0xc536('0x9')](_0xc536('0xa'),attributes,{'tableName':_0xc536('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdd1c=['path','./jscriptyQuestionReport.attributes','JscriptyQuestionReport','report_jscripty_questions','lodash','util','../../config/logger','api','moment'];(function(_0x23f1ed,_0x35ed62){var _0x55d23a=function(_0x514001){while(--_0x514001){_0x23f1ed['push'](_0x23f1ed['shift']());}};_0x55d23a(++_0x35ed62);}(_0xdd1c,0x190));var _0xcdd1=function(_0x30b145,_0x5b1406){_0x30b145=_0x30b145-0x0;var _0x5acce4=_0xdd1c[_0x30b145];return _0x5acce4;};'use strict';var _=require(_0xcdd1('0x0'));var util=require(_0xcdd1('0x1'));var logger=require(_0xcdd1('0x2'))(_0xcdd1('0x3'));var moment=require(_0xcdd1('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xcdd1('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcdd1('0x6'));module['exports']=function(_0x30db8f,_0x50a813){return _0x30db8f['define'](_0xcdd1('0x7'),attributes,{'tableName':_0xcdd1('0x8'),'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 acfe191..bbecb77 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 _0x72c1=['JscriptyQuestionReport,\x20%s,\x20%s','message','result','catch','lodash','moment','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','request','info','request\x20sent','debug','stringify','error'];(function(_0xd22d95,_0xc59f8f){var _0x15d7a3=function(_0x3db95c){while(--_0x3db95c){_0xd22d95['push'](_0xd22d95['shift']());}};_0x15d7a3(++_0xc59f8f);}(_0x72c1,0x1cf));var _0x172c=function(_0x2c8f1c,_0x18d822){_0x2c8f1c=_0x2c8f1c-0x0;var _0x28eea6=_0x72c1[_0x2c8f1c];return _0x28eea6;};'use strict';var _=require(_0x172c('0x0'));var util=require('util');var moment=require(_0x172c('0x1'));var BPromise=require('bluebird');var rs=require(_0x172c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x172c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x172c('0x4'))('rpc');var config=require(_0x172c('0x5'));var jayson=require(_0x172c('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x25fa44,_0x14d887,_0x7feee6){return new BPromise(function(_0x1d451f,_0xf8a6be){return client[_0x172c('0x7')](_0x25fa44,_0x7feee6)['then'](function(_0x345787){logger[_0x172c('0x8')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x14d887,_0x172c('0x9'));logger[_0x172c('0xa')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x14d887,_0x172c('0x9'),JSON[_0x172c('0xb')](_0x345787));if(_0x345787[_0x172c('0xc')]){if(_0x345787[_0x172c('0xc')]['code']===0x1f4){logger[_0x172c('0xc')](_0x172c('0xd'),_0x14d887,_0x345787[_0x172c('0xc')][_0x172c('0xe')]);return _0xf8a6be(_0x345787[_0x172c('0xc')][_0x172c('0xe')]);}logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0x14d887,_0x345787['error'][_0x172c('0xe')]);return _0x1d451f(_0x345787[_0x172c('0xc')][_0x172c('0xe')]);}else{logger[_0x172c('0x8')](_0x172c('0xd'),_0x14d887,'request\x20sent');_0x1d451f(_0x345787[_0x172c('0xf')][_0x172c('0xe')]);}})[_0x172c('0x10')](function(_0x47fe9d){logger[_0x172c('0xc')](_0x172c('0xd'),_0x14d887,_0x47fe9d);_0xf8a6be(_0x47fe9d);});});} \ No newline at end of file +var _0x398a=['request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','JscriptyQuestionReport,\x20%s,\x20%s'];(function(_0xd553ab,_0x788918){var _0x215442=function(_0x5b32f8){while(--_0x5b32f8){_0xd553ab['push'](_0xd553ab['shift']());}};_0x215442(++_0x788918);}(_0x398a,0x162));var _0xa398=function(_0x184982,_0x5e20e6){_0x184982=_0x184982-0x0;var _0x556962=_0x398a[_0x184982];return _0x556962;};'use strict';var _=require(_0xa398('0x0'));var util=require('util');var moment=require(_0xa398('0x1'));var BPromise=require(_0xa398('0x2'));var rs=require(_0xa398('0x3'));var fs=require('fs');var Redis=require(_0xa398('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa398('0x5'));var logger=require(_0xa398('0x6'))(_0xa398('0x7'));var config=require(_0xa398('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa398('0x9')][_0xa398('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe628ca,_0x2f8f3a,_0x303b97){return new BPromise(function(_0x51ca00,_0x19e76a){return client[_0xa398('0xb')](_0xe628ca,_0x303b97)[_0xa398('0xc')](function(_0x3ae8e4){logger['info'](_0xa398('0xd'),_0x2f8f3a,_0xa398('0xe'));logger[_0xa398('0xf')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x2f8f3a,_0xa398('0xe'),JSON[_0xa398('0x10')](_0x3ae8e4));if(_0x3ae8e4[_0xa398('0x11')]){if(_0x3ae8e4[_0xa398('0x11')][_0xa398('0x12')]===0x1f4){logger[_0xa398('0x11')](_0xa398('0xd'),_0x2f8f3a,_0x3ae8e4[_0xa398('0x11')]['message']);return _0x19e76a(_0x3ae8e4['error'][_0xa398('0x13')]);}logger[_0xa398('0x11')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x2f8f3a,_0x3ae8e4[_0xa398('0x11')]['message']);return _0x51ca00(_0x3ae8e4[_0xa398('0x11')]['message']);}else{logger[_0xa398('0x14')](_0xa398('0xd'),_0x2f8f3a,_0xa398('0xe'));_0x51ca00(_0x3ae8e4[_0xa398('0x15')][_0xa398('0x13')]);}})[_0xa398('0x16')](function(_0x15d608){logger[_0xa398('0x11')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x2f8f3a,_0x15d608);_0x19e76a(_0x15d608);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 57a8542..62ec622 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 _0x4e17=['./jscriptySessionReport.controller','get','isAuthenticated','index','/describe','/:id','show','getQuestions','post','create','put','update','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1655bb,_0x5a82ae){var _0x5e2020=function(_0x1ccfb4){while(--_0x1ccfb4){_0x1655bb['push'](_0x1655bb['shift']());}};_0x5e2020(++_0x5a82ae);}(_0x4e17,0x8b));var _0x74e1=function(_0x3d98fb,_0xf28543){_0x3d98fb=_0x3d98fb-0x0;var _0x436e18=_0x4e17[_0x3d98fb];return _0x436e18;};'use strict';var multer=require(_0x74e1('0x0'));var util=require(_0x74e1('0x1'));var path=require('path');var timeout=require(_0x74e1('0x2'));var express=require('express');var router=express[_0x74e1('0x3')]();var fs_extra=require(_0x74e1('0x4'));var auth=require(_0x74e1('0x5'));var interaction=require(_0x74e1('0x6'));var config=require(_0x74e1('0x7'));var controller=require(_0x74e1('0x8'));router[_0x74e1('0x9')]('/',auth[_0x74e1('0xa')](),controller[_0x74e1('0xb')]);router[_0x74e1('0x9')](_0x74e1('0xc'),auth[_0x74e1('0xa')](),controller['describe']);router[_0x74e1('0x9')](_0x74e1('0xd'),auth[_0x74e1('0xa')](),controller[_0x74e1('0xe')]);router[_0x74e1('0x9')]('/:id/questions',auth[_0x74e1('0xa')](),controller[_0x74e1('0xf')]);router[_0x74e1('0x10')]('/',auth['isAuthenticated'](),controller[_0x74e1('0x11')]);router[_0x74e1('0x12')](_0x74e1('0xd'),auth['isAuthenticated'](),controller[_0x74e1('0x13')]);router['delete'](_0x74e1('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x74e1('0x14')]=router; \ No newline at end of file +var _0xa98e=['/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','/describe','describe','show','getQuestions','post','create'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0xa98e,0xb8));var _0xea98=function(_0x288849,_0x3737f0){_0x288849=_0x288849-0x0;var _0x1d2622=_0xa98e[_0x288849];return _0x1d2622;};'use strict';var multer=require(_0xea98('0x0'));var util=require(_0xea98('0x1'));var path=require(_0xea98('0x2'));var timeout=require(_0xea98('0x3'));var express=require(_0xea98('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xea98('0x5'));var config=require(_0xea98('0x6'));var controller=require(_0xea98('0x7'));router[_0xea98('0x8')]('/',auth[_0xea98('0x9')](),controller['index']);router[_0xea98('0x8')](_0xea98('0xa'),auth['isAuthenticated'](),controller[_0xea98('0xb')]);router[_0xea98('0x8')]('/:id',auth[_0xea98('0x9')](),controller[_0xea98('0xc')]);router[_0xea98('0x8')]('/:id/questions',auth[_0xea98('0x9')](),controller[_0xea98('0xd')]);router[_0xea98('0xe')]('/',auth[_0xea98('0x9')](),controller[_0xea98('0xf')]);router['put'](_0xea98('0x10'),auth[_0xea98('0x9')](),controller['update']);router[_0xea98('0x11')](_0xea98('0x10'),auth['isAuthenticated'](),controller[_0xea98('0x12')]);module[_0xea98('0x13')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index c2edb3f..08c7337 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 _0x2087=['DATE','setDataValue','endtime','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment','sequelize','exports'];(function(_0x2512fd,_0x5f5bfd){var _0x576639=function(_0x516f80){while(--_0x516f80){_0x2512fd['push'](_0x2512fd['shift']());}};_0x576639(++_0x5f5bfd);}(_0x2087,0x9f));var _0x7208=function(_0x1fd2e5,_0x4a6165){_0x1fd2e5=_0x1fd2e5-0x0;var _0xccf127=_0x2087[_0x1fd2e5];return _0xccf127;};'use strict';var moment=require(_0x7208('0x0'));var Sequelize=require(_0x7208('0x1'));module[_0x7208('0x2')]={'starttime':{'type':Sequelize[_0x7208('0x3')],'set':function(_0x35e4dc){this[_0x7208('0x4')]('starttime',_0x35e4dc);this[_0x7208('0x4')](_0x7208('0x5'),moment()['format'](_0x7208('0x6')));}},'endtime':{'type':Sequelize[_0x7208('0x3')]},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0x7208('0x7')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x7208('0x7')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x7208('0x7')]},'completed':{'type':Sequelize[_0x7208('0x8')],'defaultValue':![]}}; \ No newline at end of file +var _0x609d=['DATE','starttime','YYYY-MM-DD\x20HH:mm:ss','STRING','sequelize','exports'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x609d,0x8e));var _0xd609=function(_0x34e14d,_0x5dea39){_0x34e14d=_0x34e14d-0x0;var _0x3d8e08=_0x609d[_0x34e14d];return _0x3d8e08;};'use strict';var moment=require('moment');var Sequelize=require(_0xd609('0x0'));module[_0xd609('0x1')]={'starttime':{'type':Sequelize[_0xd609('0x2')],'set':function(_0x57d9e4){this['setDataValue'](_0xd609('0x3'),_0x57d9e4);this['setDataValue']('endtime',moment()['format'](_0xd609('0x4')));}},'endtime':{'type':Sequelize[_0xd609('0x2')]},'membername':{'type':Sequelize[_0xd609('0x5')]},'projectname':{'type':Sequelize[_0xd609('0x5')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xd609('0x5')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xd609('0x5')]},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 18c630f..38b006e 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 _0xa9c3=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','limit','undefined','count','status','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','send','index','map','JscriptySessionReport','rawAttributes','type','key','model','query','intersection','attributes','length','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','filters','fields','find','create','body','update','describe','getQuestions','findOne','hasOwnProperty','SessionId','JscriptyQuestionReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis'];(function(_0x2526f4,_0x14ac6f){var _0x356a7b=function(_0x536c63){while(--_0x536c63){_0x2526f4['push'](_0x2526f4['shift']());}};_0x356a7b(++_0x14ac6f);}(_0xa9c3,0x13e));var _0x3a9c=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0xa9c3[_0x11005e];return _0x29338f;};'use strict';var emlformat=require(_0x3a9c('0x0'));var rimraf=require(_0x3a9c('0x1'));var zipdir=require(_0x3a9c('0x2'));var jsonpatch=require(_0x3a9c('0x3'));var rp=require(_0x3a9c('0x4'));var moment=require(_0x3a9c('0x5'));var BPromise=require(_0x3a9c('0x6'));var Mustache=require(_0x3a9c('0x7'));var util=require('util');var path=require(_0x3a9c('0x8'));var sox=require(_0x3a9c('0x9'));var csv=require(_0x3a9c('0xa'));var ejs=require(_0x3a9c('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3a9c('0xc'));var squel=require(_0x3a9c('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3a9c('0xe'));var toCsv=require('to-csv');var querystring=require(_0x3a9c('0xf'));var Papa=require(_0x3a9c('0x10'));var Redis=require(_0x3a9c('0x11'));var authService=require(_0x3a9c('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x3a9c('0x13'));var hardwareService=require(_0x3a9c('0x14'));var logger=require('../../config/logger')(_0x3a9c('0x15'));var utils=require(_0x3a9c('0x16'));var config=require(_0x3a9c('0x17'));var licenseUtil=require(_0x3a9c('0x18'));var db=require(_0x3a9c('0x19'))['db'];function respondWithStatusCode(_0x1984eb,_0x2658fd){_0x2658fd=_0x2658fd||0xcc;return function(_0x1814fa){if(_0x1814fa){return _0x1984eb[_0x3a9c('0x1a')](_0x2658fd);}return _0x1984eb['status'](_0x2658fd)['end']();};}function respondWithResult(_0x2fb152,_0x4ba2b0){_0x4ba2b0=_0x4ba2b0||0xc8;return function(_0x7adf6f){if(_0x7adf6f){return _0x2fb152['status'](_0x4ba2b0)[_0x3a9c('0x1b')](_0x7adf6f);}};}function respondWithFilteredResult(_0x461eda,_0x11581f){return function(_0x69c23){if(_0x69c23){var _0x2f3801=typeof _0x11581f[_0x3a9c('0x1c')]==='undefined'&&typeof _0x11581f[_0x3a9c('0x1d')]===_0x3a9c('0x1e');var _0x5ecb76=_0x69c23[_0x3a9c('0x1f')];var _0x3a0c90=_0x2f3801?0x0:_0x11581f[_0x3a9c('0x1c')];var _0x3f265e=_0x2f3801?_0x69c23[_0x3a9c('0x1f')]:_0x11581f[_0x3a9c('0x1c')]+_0x11581f[_0x3a9c('0x1d')];var _0x13b6c4;if(_0x3f265e>=_0x5ecb76){_0x3f265e=_0x5ecb76;_0x13b6c4=0xc8;}else{_0x13b6c4=0xce;}_0x461eda[_0x3a9c('0x20')](_0x13b6c4);return _0x461eda[_0x3a9c('0x21')](_0x3a9c('0x22'),_0x3a0c90+'-'+_0x3f265e+'/'+_0x5ecb76)[_0x3a9c('0x1b')](_0x69c23);}return null;};}function patchUpdates(_0x30b5ba){return function(_0x32d613){try{jsonpatch[_0x3a9c('0x23')](_0x32d613,_0x30b5ba,!![]);}catch(_0x1fba3b){return BPromise[_0x3a9c('0x24')](_0x1fba3b);}return _0x32d613[_0x3a9c('0x25')]();};}function saveUpdates(_0x427037,_0x48792b){return function(_0x3474b6){if(_0x3474b6){return _0x3474b6['update'](_0x427037)[_0x3a9c('0x26')](function(_0x3dd2d8){return _0x3dd2d8;});}return null;};}function removeEntity(_0x3f8980,_0x15f44b){return function(_0x99dd51){if(_0x99dd51){return _0x99dd51[_0x3a9c('0x27')]()[_0x3a9c('0x26')](function(){_0x3f8980['status'](0xcc)[_0x3a9c('0x28')]();});}};}function handleEntityNotFound(_0x528500,_0x1dd912){return function(_0x3f18a3){if(!_0x3f18a3){_0x528500[_0x3a9c('0x1a')](0x194);}return _0x3f18a3;};}function handleError(_0x5c66d9,_0xe4234a){_0xe4234a=_0xe4234a||0x1f4;return function(_0x36b751){logger[_0x3a9c('0x29')](_0x36b751[_0x3a9c('0x2a')]);if(_0x36b751[_0x3a9c('0x2b')]){delete _0x36b751[_0x3a9c('0x2b')];}_0x5c66d9[_0x3a9c('0x20')](_0xe4234a)[_0x3a9c('0x2c')](_0x36b751);};}exports[_0x3a9c('0x2d')]=function(_0x225ccc,_0x17c150){var _0xccb681={},_0x5d2439={},_0x3e3d45={'count':0x0,'rows':[]};var _0xec66c7=_[_0x3a9c('0x2e')](db[_0x3a9c('0x2f')][_0x3a9c('0x30')],function(_0x5a3ae9){return{'name':_0x5a3ae9['fieldName'],'type':_0x5a3ae9[_0x3a9c('0x31')][_0x3a9c('0x32')]};});_0x5d2439[_0x3a9c('0x33')]=_[_0x3a9c('0x2e')](_0xec66c7,_0x3a9c('0x2b'));_0x5d2439[_0x3a9c('0x34')]=_['keys'](_0x225ccc[_0x3a9c('0x34')]);_0x5d2439['filters']=_[_0x3a9c('0x35')](_0x5d2439[_0x3a9c('0x33')],_0x5d2439[_0x3a9c('0x34')]);_0xccb681[_0x3a9c('0x36')]=_[_0x3a9c('0x35')](_0x5d2439['model'],qs['fields'](_0x225ccc[_0x3a9c('0x34')]['fields']));_0xccb681[_0x3a9c('0x36')]=_0xccb681['attributes'][_0x3a9c('0x37')]?_0xccb681[_0x3a9c('0x36')]:_0x5d2439['model'];if(!_0x225ccc[_0x3a9c('0x34')]['hasOwnProperty'](_0x3a9c('0x38'))){_0xccb681['limit']=qs[_0x3a9c('0x1d')](_0x225ccc[_0x3a9c('0x34')][_0x3a9c('0x1d')]);_0xccb681['offset']=qs[_0x3a9c('0x1c')](_0x225ccc[_0x3a9c('0x34')]['offset']);}_0xccb681[_0x3a9c('0x39')]=qs[_0x3a9c('0x3a')](_0x225ccc[_0x3a9c('0x34')][_0x3a9c('0x3a')]);_0xccb681['where']=qs['filters'](_[_0x3a9c('0x3b')](_0x225ccc[_0x3a9c('0x34')],_0x5d2439['filters']),_0xec66c7);if(_0x225ccc[_0x3a9c('0x34')][_0x3a9c('0x3c')]){_0xccb681[_0x3a9c('0x3d')]=_['merge'](_0xccb681[_0x3a9c('0x3d')],{'$or':_[_0x3a9c('0x2e')](_0xec66c7,function(_0x5523b0){if(_0x5523b0[_0x3a9c('0x31')]!=='VIRTUAL'){var _0x54587b={};_0x54587b[_0x5523b0[_0x3a9c('0x2b')]]={'$like':'%'+_0x225ccc['query'][_0x3a9c('0x3c')]+'%'};return _0x54587b;}})});}_0xccb681=_[_0x3a9c('0x3e')]({},_0xccb681,_0x225ccc[_0x3a9c('0x3f')]);var _0xdb3f11={'where':_0xccb681[_0x3a9c('0x3d')]};return db[_0x3a9c('0x2f')][_0x3a9c('0x1f')](_0xdb3f11)[_0x3a9c('0x26')](function(_0x2ec97b){_0x3e3d45[_0x3a9c('0x1f')]=_0x2ec97b;if(_0x225ccc['query'][_0x3a9c('0x40')]){_0xccb681[_0x3a9c('0x41')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0x3a9c('0x42')](_0xccb681);})[_0x3a9c('0x26')](function(_0x2d13fb){_0x3e3d45[_0x3a9c('0x43')]=_0x2d13fb;return _0x3e3d45;})['then'](respondWithFilteredResult(_0x17c150,_0xccb681))[_0x3a9c('0x44')](handleError(_0x17c150,null));};exports[_0x3a9c('0x45')]=function(_0x2b090b,_0x1e71c4){var _0x16d796={'raw':!![],'where':{'id':_0x2b090b[_0x3a9c('0x46')]['id']}},_0x1081fb={};_0x1081fb[_0x3a9c('0x33')]=_[_0x3a9c('0x47')](db[_0x3a9c('0x2f')]['rawAttributes']);_0x1081fb[_0x3a9c('0x34')]=_[_0x3a9c('0x47')](_0x2b090b['query']);_0x1081fb[_0x3a9c('0x48')]=_[_0x3a9c('0x35')](_0x1081fb[_0x3a9c('0x33')],_0x1081fb[_0x3a9c('0x34')]);_0x16d796[_0x3a9c('0x36')]=_[_0x3a9c('0x35')](_0x1081fb[_0x3a9c('0x33')],qs[_0x3a9c('0x49')](_0x2b090b[_0x3a9c('0x34')][_0x3a9c('0x49')]));_0x16d796[_0x3a9c('0x36')]=_0x16d796[_0x3a9c('0x36')][_0x3a9c('0x37')]?_0x16d796[_0x3a9c('0x36')]:_0x1081fb[_0x3a9c('0x33')];if(_0x2b090b[_0x3a9c('0x34')][_0x3a9c('0x40')]){_0x16d796[_0x3a9c('0x41')]=[{'all':!![]}];}_0x16d796=_[_0x3a9c('0x3e')]({},_0x16d796,_0x2b090b[_0x3a9c('0x3f')]);return db[_0x3a9c('0x2f')][_0x3a9c('0x4a')](_0x16d796)[_0x3a9c('0x26')](handleEntityNotFound(_0x1e71c4,null))[_0x3a9c('0x26')](respondWithResult(_0x1e71c4,null))['catch'](handleError(_0x1e71c4,null));};exports[_0x3a9c('0x4b')]=function(_0x5a5f8d,_0x21975a){return db[_0x3a9c('0x2f')][_0x3a9c('0x4b')](_0x5a5f8d[_0x3a9c('0x4c')],{})['then'](respondWithResult(_0x21975a,0xc9))[_0x3a9c('0x44')](handleError(_0x21975a,null));};exports[_0x3a9c('0x4d')]=function(_0x33b97d,_0x3a1f70){if(_0x33b97d[_0x3a9c('0x4c')]['id']){delete _0x33b97d[_0x3a9c('0x4c')]['id'];}return db[_0x3a9c('0x2f')][_0x3a9c('0x4a')]({'where':{'id':_0x33b97d[_0x3a9c('0x46')]['id']}})['then'](handleEntityNotFound(_0x3a1f70,null))[_0x3a9c('0x26')](saveUpdates(_0x33b97d[_0x3a9c('0x4c')],null))[_0x3a9c('0x26')](respondWithResult(_0x3a1f70,null))['catch'](handleError(_0x3a1f70,null));};exports[_0x3a9c('0x27')]=function(_0x335ccb,_0x3ae555){return db[_0x3a9c('0x2f')][_0x3a9c('0x4a')]({'where':{'id':_0x335ccb['params']['id']}})['then'](handleEntityNotFound(_0x3ae555,null))[_0x3a9c('0x26')](removeEntity(_0x3ae555,null))[_0x3a9c('0x44')](handleError(_0x3ae555,null));};exports[_0x3a9c('0x4e')]=function(_0x1761e5,_0x17bf9f){return db['JscriptySessionReport']['describe']()[_0x3a9c('0x26')](respondWithResult(_0x17bf9f,null))[_0x3a9c('0x44')](handleError(_0x17bf9f,null));};exports[_0x3a9c('0x4f')]=function(_0x58bdd5,_0xc868e9,_0x15d6e3){var _0x352799={'raw':!![],'where':{}};var _0x3c76fc={};var _0x24288d={'count':0x0,'rows':[]};return db[_0x3a9c('0x2f')][_0x3a9c('0x50')]({'where':{'id':_0x58bdd5[_0x3a9c('0x46')]['id']}})[_0x3a9c('0x26')](handleEntityNotFound(_0xc868e9,null))[_0x3a9c('0x26')](function(_0x283229){if(_0x283229){_0x3c76fc['model']=_[_0x3a9c('0x47')](db['JscriptyQuestionReport']['rawAttributes']);_0x3c76fc[_0x3a9c('0x34')]=_[_0x3a9c('0x47')](_0x58bdd5[_0x3a9c('0x34')]);_0x3c76fc[_0x3a9c('0x48')]=_[_0x3a9c('0x35')](_0x3c76fc['model'],_0x3c76fc[_0x3a9c('0x34')]);_0x352799[_0x3a9c('0x36')]=_[_0x3a9c('0x35')](_0x3c76fc[_0x3a9c('0x33')],qs[_0x3a9c('0x49')](_0x58bdd5['query'][_0x3a9c('0x49')]));_0x352799[_0x3a9c('0x36')]=_0x352799[_0x3a9c('0x36')][_0x3a9c('0x37')]?_0x352799[_0x3a9c('0x36')]:_0x3c76fc[_0x3a9c('0x33')];if(!_0x58bdd5[_0x3a9c('0x34')][_0x3a9c('0x51')](_0x3a9c('0x38'))){_0x352799[_0x3a9c('0x1d')]=qs[_0x3a9c('0x1d')](_0x58bdd5['query'][_0x3a9c('0x1d')]);_0x352799[_0x3a9c('0x1c')]=qs[_0x3a9c('0x1c')](_0x58bdd5[_0x3a9c('0x34')][_0x3a9c('0x1c')]);}_0x352799['order']=qs['sort'](_0x58bdd5[_0x3a9c('0x34')][_0x3a9c('0x3a')]);_0x352799[_0x3a9c('0x3d')]=qs['filters'](_[_0x3a9c('0x3b')](_0x58bdd5[_0x3a9c('0x34')],_0x3c76fc[_0x3a9c('0x48')]));_0x352799['where'][_0x3a9c('0x52')]=_0x283229['id'];if(_0x58bdd5[_0x3a9c('0x34')]['filter']){_0x352799[_0x3a9c('0x3d')]=_[_0x3a9c('0x3e')](_0x352799[_0x3a9c('0x3d')],{'$or':_['map'](_0x352799['attributes'],function(_0x5e4b3d){var _0x5c5fbc={};_0x5c5fbc[_0x5e4b3d]={'$like':'%'+_0x58bdd5[_0x3a9c('0x34')][_0x3a9c('0x3c')]+'%'};return _0x5c5fbc;})});}_0x352799=_[_0x3a9c('0x3e')]({},_0x352799,_0x58bdd5[_0x3a9c('0x3f')]);return db['JscriptyQuestionReport'][_0x3a9c('0x1f')]({'where':_0x352799[_0x3a9c('0x3d')]})['then'](function(_0x2cc704){_0x24288d[_0x3a9c('0x1f')]=_0x2cc704;if(_0x58bdd5[_0x3a9c('0x34')]['includeAll']){_0x352799[_0x3a9c('0x41')]=[{'all':!![]}];}return db[_0x3a9c('0x53')][_0x3a9c('0x42')](_0x352799);})[_0x3a9c('0x26')](function(_0x743d7a){_0x24288d[_0x3a9c('0x43')]=_0x743d7a;return _0x24288d;});}})['then'](respondWithFilteredResult(_0xc868e9,_0x352799))[_0x3a9c('0x44')](handleError(_0xc868e9,null));}; \ No newline at end of file +var _0x1db4=['order','sort','where','pick','filter','type','VIRTUAL','includeAll','include','JscriptySessionReport','findAll','rows','catch','show','params','keys','options','create','body','find','describe','getQuestions','findOne','JscriptyQuestionReport','hasOwnProperty','SessionId','merge','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','end','sendStatus','name','send','index','map','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','nolimit'];(function(_0x385953,_0x3276a9){var _0x22d595=function(_0x3689f3){while(--_0x3689f3){_0x385953['push'](_0x385953['shift']());}};_0x22d595(++_0x3276a9);}(_0x1db4,0x1bf));var _0x41db=function(_0x1af0ae,_0x25a151){_0x1af0ae=_0x1af0ae-0x0;var _0x75f750=_0x1db4[_0x1af0ae];return _0x75f750;};'use strict';var emlformat=require(_0x41db('0x0'));var rimraf=require(_0x41db('0x1'));var zipdir=require(_0x41db('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x41db('0x3'));var moment=require(_0x41db('0x4'));var BPromise=require(_0x41db('0x5'));var Mustache=require(_0x41db('0x6'));var util=require(_0x41db('0x7'));var path=require(_0x41db('0x8'));var sox=require(_0x41db('0x9'));var csv=require(_0x41db('0xa'));var ejs=require(_0x41db('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x41db('0xc'));var squel=require(_0x41db('0xd'));var crypto=require(_0x41db('0xe'));var jsforce=require(_0x41db('0xf'));var deskjs=require(_0x41db('0x10'));var toCsv=require(_0x41db('0xa'));var querystring=require(_0x41db('0x11'));var Papa=require(_0x41db('0x12'));var Redis=require(_0x41db('0x13'));var authService=require(_0x41db('0x14'));var qs=require(_0x41db('0x15'));var as=require(_0x41db('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x41db('0x17'));var utils=require(_0x41db('0x18'));var config=require(_0x41db('0x19'));var licenseUtil=require(_0x41db('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x494a77,_0x4d8d89){_0x4d8d89=_0x4d8d89||0xcc;return function(_0x9379c4){if(_0x9379c4){return _0x494a77['sendStatus'](_0x4d8d89);}return _0x494a77[_0x41db('0x1b')](_0x4d8d89)['end']();};}function respondWithResult(_0x2e8045,_0x274acb){_0x274acb=_0x274acb||0xc8;return function(_0x1411ea){if(_0x1411ea){return _0x2e8045['status'](_0x274acb)[_0x41db('0x1c')](_0x1411ea);}};}function respondWithFilteredResult(_0x43c7c1,_0x36b620){return function(_0x5aae7b){if(_0x5aae7b){var _0x4fbad2=typeof _0x36b620[_0x41db('0x1d')]===_0x41db('0x1e')&&typeof _0x36b620[_0x41db('0x1f')]===_0x41db('0x1e');var _0x32920a=_0x5aae7b['count'];var _0x36d160=_0x4fbad2?0x0:_0x36b620[_0x41db('0x1d')];var _0xe44b4d=_0x4fbad2?_0x5aae7b[_0x41db('0x20')]:_0x36b620[_0x41db('0x1d')]+_0x36b620['limit'];var _0x355229;if(_0xe44b4d>=_0x32920a){_0xe44b4d=_0x32920a;_0x355229=0xc8;}else{_0x355229=0xce;}_0x43c7c1[_0x41db('0x1b')](_0x355229);return _0x43c7c1[_0x41db('0x21')]('Content-Range',_0x36d160+'-'+_0xe44b4d+'/'+_0x32920a)['json'](_0x5aae7b);}return null;};}function patchUpdates(_0x1543dc){return function(_0x427b40){try{jsonpatch[_0x41db('0x22')](_0x427b40,_0x1543dc,!![]);}catch(_0x172c14){return BPromise[_0x41db('0x23')](_0x172c14);}return _0x427b40[_0x41db('0x24')]();};}function saveUpdates(_0x1b2e42,_0x502875){return function(_0x1fdc09){if(_0x1fdc09){return _0x1fdc09[_0x41db('0x25')](_0x1b2e42)['then'](function(_0x3f72ba){return _0x3f72ba;});}return null;};}function removeEntity(_0x5c01fc,_0x5b218e){return function(_0x1b223f){if(_0x1b223f){return _0x1b223f[_0x41db('0x26')]()[_0x41db('0x27')](function(){_0x5c01fc[_0x41db('0x1b')](0xcc)[_0x41db('0x28')]();});}};}function handleEntityNotFound(_0x24a7a1,_0x10e3fa){return function(_0x5ea697){if(!_0x5ea697){_0x24a7a1[_0x41db('0x29')](0x194);}return _0x5ea697;};}function handleError(_0x2a79d7,_0x2a355e){_0x2a355e=_0x2a355e||0x1f4;return function(_0x5b58ee){logger['error'](_0x5b58ee['stack']);if(_0x5b58ee[_0x41db('0x2a')]){delete _0x5b58ee[_0x41db('0x2a')];}_0x2a79d7[_0x41db('0x1b')](_0x2a355e)[_0x41db('0x2b')](_0x5b58ee);};}exports[_0x41db('0x2c')]=function(_0x531c20,_0x191a36){var _0x130889={},_0x4af27b={},_0x1f0a33={'count':0x0,'rows':[]};var _0x5488a8=_[_0x41db('0x2d')](db['JscriptySessionReport'][_0x41db('0x2e')],function(_0x54b809){return{'name':_0x54b809[_0x41db('0x2f')],'type':_0x54b809['type'][_0x41db('0x30')]};});_0x4af27b[_0x41db('0x31')]=_[_0x41db('0x2d')](_0x5488a8,_0x41db('0x2a'));_0x4af27b['query']=_['keys'](_0x531c20[_0x41db('0x32')]);_0x4af27b[_0x41db('0x33')]=_[_0x41db('0x34')](_0x4af27b[_0x41db('0x31')],_0x4af27b[_0x41db('0x32')]);_0x130889['attributes']=_[_0x41db('0x34')](_0x4af27b[_0x41db('0x31')],qs[_0x41db('0x35')](_0x531c20[_0x41db('0x32')][_0x41db('0x35')]));_0x130889[_0x41db('0x36')]=_0x130889[_0x41db('0x36')][_0x41db('0x37')]?_0x130889['attributes']:_0x4af27b['model'];if(!_0x531c20[_0x41db('0x32')]['hasOwnProperty'](_0x41db('0x38'))){_0x130889[_0x41db('0x1f')]=qs[_0x41db('0x1f')](_0x531c20['query'][_0x41db('0x1f')]);_0x130889[_0x41db('0x1d')]=qs[_0x41db('0x1d')](_0x531c20['query'][_0x41db('0x1d')]);}_0x130889[_0x41db('0x39')]=qs[_0x41db('0x3a')](_0x531c20[_0x41db('0x32')][_0x41db('0x3a')]);_0x130889[_0x41db('0x3b')]=qs[_0x41db('0x33')](_[_0x41db('0x3c')](_0x531c20['query'],_0x4af27b['filters']),_0x5488a8);if(_0x531c20['query'][_0x41db('0x3d')]){_0x130889[_0x41db('0x3b')]=_['merge'](_0x130889['where'],{'$or':_[_0x41db('0x2d')](_0x5488a8,function(_0x2e9dfe){if(_0x2e9dfe[_0x41db('0x3e')]!==_0x41db('0x3f')){var _0x153adf={};_0x153adf[_0x2e9dfe[_0x41db('0x2a')]]={'$like':'%'+_0x531c20[_0x41db('0x32')][_0x41db('0x3d')]+'%'};return _0x153adf;}})});}_0x130889=_['merge']({},_0x130889,_0x531c20['options']);var _0x328c1c={'where':_0x130889['where']};return db['JscriptySessionReport'][_0x41db('0x20')](_0x328c1c)[_0x41db('0x27')](function(_0x10a0e4){_0x1f0a33[_0x41db('0x20')]=_0x10a0e4;if(_0x531c20[_0x41db('0x32')][_0x41db('0x40')]){_0x130889[_0x41db('0x41')]=[{'all':!![]}];}return db[_0x41db('0x42')][_0x41db('0x43')](_0x130889);})['then'](function(_0x29ff45){_0x1f0a33[_0x41db('0x44')]=_0x29ff45;return _0x1f0a33;})[_0x41db('0x27')](respondWithFilteredResult(_0x191a36,_0x130889))[_0x41db('0x45')](handleError(_0x191a36,null));};exports[_0x41db('0x46')]=function(_0x16aabb,_0xc496aa){var _0x36969e={'raw':!![],'where':{'id':_0x16aabb[_0x41db('0x47')]['id']}},_0x7a9463={};_0x7a9463[_0x41db('0x31')]=_[_0x41db('0x48')](db[_0x41db('0x42')][_0x41db('0x2e')]);_0x7a9463[_0x41db('0x32')]=_[_0x41db('0x48')](_0x16aabb[_0x41db('0x32')]);_0x7a9463[_0x41db('0x33')]=_['intersection'](_0x7a9463['model'],_0x7a9463[_0x41db('0x32')]);_0x36969e[_0x41db('0x36')]=_[_0x41db('0x34')](_0x7a9463['model'],qs[_0x41db('0x35')](_0x16aabb[_0x41db('0x32')][_0x41db('0x35')]));_0x36969e[_0x41db('0x36')]=_0x36969e[_0x41db('0x36')][_0x41db('0x37')]?_0x36969e[_0x41db('0x36')]:_0x7a9463[_0x41db('0x31')];if(_0x16aabb['query'][_0x41db('0x40')]){_0x36969e[_0x41db('0x41')]=[{'all':!![]}];}_0x36969e=_['merge']({},_0x36969e,_0x16aabb[_0x41db('0x49')]);return db[_0x41db('0x42')]['find'](_0x36969e)[_0x41db('0x27')](handleEntityNotFound(_0xc496aa,null))[_0x41db('0x27')](respondWithResult(_0xc496aa,null))[_0x41db('0x45')](handleError(_0xc496aa,null));};exports['create']=function(_0x7ed845,_0x4dc3f2){return db[_0x41db('0x42')][_0x41db('0x4a')](_0x7ed845[_0x41db('0x4b')],{})[_0x41db('0x27')](respondWithResult(_0x4dc3f2,0xc9))[_0x41db('0x45')](handleError(_0x4dc3f2,null));};exports['update']=function(_0x4772d8,_0x2b979b){if(_0x4772d8[_0x41db('0x4b')]['id']){delete _0x4772d8['body']['id'];}return db[_0x41db('0x42')][_0x41db('0x4c')]({'where':{'id':_0x4772d8[_0x41db('0x47')]['id']}})['then'](handleEntityNotFound(_0x2b979b,null))['then'](saveUpdates(_0x4772d8[_0x41db('0x4b')],null))[_0x41db('0x27')](respondWithResult(_0x2b979b,null))['catch'](handleError(_0x2b979b,null));};exports['destroy']=function(_0x26436c,_0x29374a){return db[_0x41db('0x42')][_0x41db('0x4c')]({'where':{'id':_0x26436c[_0x41db('0x47')]['id']}})[_0x41db('0x27')](handleEntityNotFound(_0x29374a,null))[_0x41db('0x27')](removeEntity(_0x29374a,null))[_0x41db('0x45')](handleError(_0x29374a,null));};exports[_0x41db('0x4d')]=function(_0x2c7d08,_0x4b7fd3){return db[_0x41db('0x42')][_0x41db('0x4d')]()[_0x41db('0x27')](respondWithResult(_0x4b7fd3,null))[_0x41db('0x45')](handleError(_0x4b7fd3,null));};exports[_0x41db('0x4e')]=function(_0x492672,_0x1a1251,_0x41dcdb){var _0x35611b={'raw':!![],'where':{}};var _0x51524f={};var _0x4e95c7={'count':0x0,'rows':[]};return db[_0x41db('0x42')][_0x41db('0x4f')]({'where':{'id':_0x492672[_0x41db('0x47')]['id']}})[_0x41db('0x27')](handleEntityNotFound(_0x1a1251,null))[_0x41db('0x27')](function(_0x1fa882){if(_0x1fa882){_0x51524f[_0x41db('0x31')]=_[_0x41db('0x48')](db[_0x41db('0x50')][_0x41db('0x2e')]);_0x51524f[_0x41db('0x32')]=_[_0x41db('0x48')](_0x492672[_0x41db('0x32')]);_0x51524f['filters']=_[_0x41db('0x34')](_0x51524f['model'],_0x51524f[_0x41db('0x32')]);_0x35611b[_0x41db('0x36')]=_[_0x41db('0x34')](_0x51524f[_0x41db('0x31')],qs[_0x41db('0x35')](_0x492672[_0x41db('0x32')][_0x41db('0x35')]));_0x35611b[_0x41db('0x36')]=_0x35611b[_0x41db('0x36')][_0x41db('0x37')]?_0x35611b[_0x41db('0x36')]:_0x51524f[_0x41db('0x31')];if(!_0x492672[_0x41db('0x32')][_0x41db('0x51')]('nolimit')){_0x35611b[_0x41db('0x1f')]=qs['limit'](_0x492672[_0x41db('0x32')][_0x41db('0x1f')]);_0x35611b[_0x41db('0x1d')]=qs['offset'](_0x492672[_0x41db('0x32')]['offset']);}_0x35611b['order']=qs['sort'](_0x492672[_0x41db('0x32')]['sort']);_0x35611b[_0x41db('0x3b')]=qs[_0x41db('0x33')](_['pick'](_0x492672[_0x41db('0x32')],_0x51524f[_0x41db('0x33')]));_0x35611b['where'][_0x41db('0x52')]=_0x1fa882['id'];if(_0x492672[_0x41db('0x32')][_0x41db('0x3d')]){_0x35611b[_0x41db('0x3b')]=_[_0x41db('0x53')](_0x35611b[_0x41db('0x3b')],{'$or':_[_0x41db('0x2d')](_0x35611b['attributes'],function(_0x5df644){var _0x3d25ea={};_0x3d25ea[_0x5df644]={'$like':'%'+_0x492672[_0x41db('0x32')][_0x41db('0x3d')]+'%'};return _0x3d25ea;})});}_0x35611b=_[_0x41db('0x53')]({},_0x35611b,_0x492672[_0x41db('0x49')]);return db[_0x41db('0x50')][_0x41db('0x20')]({'where':_0x35611b[_0x41db('0x3b')]})[_0x41db('0x27')](function(_0x47c8c4){_0x4e95c7['count']=_0x47c8c4;if(_0x492672[_0x41db('0x32')]['includeAll']){_0x35611b[_0x41db('0x41')]=[{'all':!![]}];}return db[_0x41db('0x50')][_0x41db('0x43')](_0x35611b);})[_0x41db('0x27')](function(_0x6bfec7){_0x4e95c7['rows']=_0x6bfec7;return _0x4e95c7;});}})[_0x41db('0x27')](respondWithFilteredResult(_0x1a1251,_0x35611b))[_0x41db('0x45')](handleError(_0x1a1251,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 8734f04..e79d441 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 _0x5075=['bluebird','request-promise','rimraf','../../config/environment','./jscriptySessionReport.attributes','define','report_jscripty_sessions','lodash','util','../../config/logger','api','moment'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x5075,0x73));var _0x5507=function(_0x207811,_0x3420a6){_0x207811=_0x207811-0x0;var _0x170d56=_0x5075[_0x207811];return _0x170d56;};'use strict';var _=require(_0x5507('0x0'));var util=require(_0x5507('0x1'));var logger=require(_0x5507('0x2'))(_0x5507('0x3'));var moment=require(_0x5507('0x4'));var BPromise=require(_0x5507('0x5'));var rp=require(_0x5507('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5507('0x7'));var config=require(_0x5507('0x8'));var attributes=require(_0x5507('0x9'));module['exports']=function(_0x5b6d7f,_0x2cd9ee){return _0x5b6d7f[_0x5507('0xa')]('JscriptySessionReport',attributes,{'tableName':_0x5507('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcb66=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','report_jscripty_sessions','util'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0xcb66,0x19f));var _0x6cb6=function(_0x523adf,_0x3e1620){_0x523adf=_0x523adf-0x0;var _0x283870=_0xcb66[_0x523adf];return _0x283870;};'use strict';var _=require('lodash');var util=require(_0x6cb6('0x0'));var logger=require(_0x6cb6('0x1'))(_0x6cb6('0x2'));var moment=require(_0x6cb6('0x3'));var BPromise=require(_0x6cb6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6cb6('0x5'));var rimraf=require(_0x6cb6('0x6'));var config=require(_0x6cb6('0x7'));var attributes=require(_0x6cb6('0x8'));module[_0x6cb6('0x9')]=function(_0x506d14,_0x53078d){return _0x506d14[_0x6cb6('0xa')](_0x6cb6('0xb'),attributes,{'tableName':_0x6cb6('0xc'),'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 0a878b0..5ff367f 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 _0x4991=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','JscriptySessionReport,\x20%s,\x20%s','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','moment','randomstring','ioredis','../../mysqldb'];(function(_0x21f9c2,_0x2b3d2a){var _0x3da17f=function(_0x57e2b9){while(--_0x57e2b9){_0x21f9c2['push'](_0x21f9c2['shift']());}};_0x3da17f(++_0x2b3d2a);}(_0x4991,0xf7));var _0x1499=function(_0x562eea,_0x1f9ea7){_0x562eea=_0x562eea-0x0;var _0x39caf9=_0x4991[_0x562eea];return _0x39caf9;};'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});function respondWithRpcPromise(_0x1c3bd7,_0x1c65c3,_0x33b261){return new BPromise(function(_0x133bae,_0x380e48){return client[_0x1499('0xb')](_0x1c3bd7,_0x33b261)[_0x1499('0xc')](function(_0x48d2ca){logger[_0x1499('0xd')](_0x1499('0xe'),_0x1c65c3,'request\x20sent');logger[_0x1499('0xf')](_0x1499('0x10'),_0x1c65c3,'request\x20sent',JSON[_0x1499('0x11')](_0x48d2ca));if(_0x48d2ca[_0x1499('0x12')]){if(_0x48d2ca['error']['code']===0x1f4){logger['error'](_0x1499('0xe'),_0x1c65c3,_0x48d2ca[_0x1499('0x12')][_0x1499('0x13')]);return _0x380e48(_0x48d2ca[_0x1499('0x12')][_0x1499('0x13')]);}logger['error']('JscriptySessionReport,\x20%s,\x20%s',_0x1c65c3,_0x48d2ca[_0x1499('0x12')]['message']);return _0x133bae(_0x48d2ca[_0x1499('0x12')][_0x1499('0x13')]);}else{logger[_0x1499('0xd')](_0x1499('0xe'),_0x1c65c3,'request\x20sent');_0x133bae(_0x48d2ca[_0x1499('0x14')][_0x1499('0x13')]);}})['catch'](function(_0x25164c){logger[_0x1499('0x12')](_0x1499('0xe'),_0x1c65c3,_0x25164c);_0x380e48(_0x25164c);});});} \ No newline at end of file +var _0xffd6=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xffd6,0x97));var _0x6ffd=function(_0x39d544,_0x35c14f){_0x39d544=_0x39d544-0x0;var _0x5a5ff2=_0xffd6[_0x39d544];return _0x5a5ff2;};'use strict';var _=require(_0x6ffd('0x0'));var util=require(_0x6ffd('0x1'));var moment=require(_0x6ffd('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6ffd('0x3'));var db=require(_0x6ffd('0x4'))['db'];var utils=require(_0x6ffd('0x5'));var logger=require('../../config/logger')(_0x6ffd('0x6'));var config=require(_0x6ffd('0x7'));var jayson=require(_0x6ffd('0x8'));var client=jayson[_0x6ffd('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x122b71,_0xeefe34,_0x2445a0){return new BPromise(function(_0x1fbbe6,_0x1d8b50){return client['request'](_0x122b71,_0x2445a0)[_0x6ffd('0xa')](function(_0x417f34){logger['info'](_0x6ffd('0xb'),_0xeefe34,_0x6ffd('0xc'));logger[_0x6ffd('0xd')](_0x6ffd('0xe'),_0xeefe34,_0x6ffd('0xc'),JSON[_0x6ffd('0xf')](_0x417f34));if(_0x417f34[_0x6ffd('0x10')]){if(_0x417f34['error'][_0x6ffd('0x11')]===0x1f4){logger[_0x6ffd('0x10')]('JscriptySessionReport,\x20%s,\x20%s',_0xeefe34,_0x417f34[_0x6ffd('0x10')][_0x6ffd('0x12')]);return _0x1d8b50(_0x417f34[_0x6ffd('0x10')][_0x6ffd('0x12')]);}logger['error'](_0x6ffd('0xb'),_0xeefe34,_0x417f34['error'][_0x6ffd('0x12')]);return _0x1fbbe6(_0x417f34['error'][_0x6ffd('0x12')]);}else{logger[_0x6ffd('0x13')](_0x6ffd('0xb'),_0xeefe34,'request\x20sent');_0x1fbbe6(_0x417f34[_0x6ffd('0x14')][_0x6ffd('0x12')]);}})[_0x6ffd('0x15')](function(_0x3394b2){logger[_0x6ffd('0x10')](_0x6ffd('0xb'),_0xeefe34,_0x3394b2);_0x1d8b50(_0x3394b2);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 11ec810..59fdd44 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 _0x5c85=['downloadLogFile','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','put','isAuthenticated','update'];(function(_0x177e5f,_0x37e620){var _0x37c389=function(_0x5215fb){while(--_0x5215fb){_0x177e5f['push'](_0x177e5f['shift']());}};_0x37c389(++_0x37e620);}(_0x5c85,0x1f1));var _0x55c8=function(_0x42047d,_0x22b7ac){_0x42047d=_0x42047d-0x0;var _0xb3ca08=_0x5c85[_0x42047d];return _0xb3ca08;};'use strict';var multer=require(_0x55c8('0x0'));var util=require(_0x55c8('0x1'));var path=require(_0x55c8('0x2'));var timeout=require(_0x55c8('0x3'));var express=require(_0x55c8('0x4'));var router=express[_0x55c8('0x5')]();var fs_extra=require(_0x55c8('0x6'));var auth=require(_0x55c8('0x7'));var interaction=require(_0x55c8('0x8'));var config=require(_0x55c8('0x9'));var controller=require('./license.controller');router[_0x55c8('0xa')]('/',controller[_0x55c8('0xb')]);router[_0x55c8('0xc')]('/:id',auth[_0x55c8('0xd')](),controller[_0x55c8('0xe')]);router[_0x55c8('0xa')]('/download_log_file',auth[_0x55c8('0xd')](),controller[_0x55c8('0xf')]);module['exports']=router; \ No newline at end of file +var _0x2b66=['/download_log_file','downloadLogFile','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','get','isAuthenticated','update'];(function(_0x26c68a,_0x5e11ee){var _0x3211a9=function(_0x5cd9e6){while(--_0x5cd9e6){_0x26c68a['push'](_0x26c68a['shift']());}};_0x3211a9(++_0x5e11ee);}(_0x2b66,0x1e3));var _0x62b6=function(_0x2229da,_0x1a9489){_0x2229da=_0x2229da-0x0;var _0x37218f=_0x2b66[_0x2229da];return _0x37218f;};'use strict';var multer=require(_0x62b6('0x0'));var util=require(_0x62b6('0x1'));var path=require('path');var timeout=require(_0x62b6('0x2'));var express=require(_0x62b6('0x3'));var router=express[_0x62b6('0x4')]();var fs_extra=require(_0x62b6('0x5'));var auth=require(_0x62b6('0x6'));var interaction=require(_0x62b6('0x7'));var config=require(_0x62b6('0x8'));var controller=require(_0x62b6('0x9'));router[_0x62b6('0xa')]('/',controller['index']);router['put']('/:id',auth[_0x62b6('0xb')](),controller[_0x62b6('0xc')]);router['get'](_0x62b6('0xd'),auth[_0x62b6('0xb')](),controller[_0x62b6('0xe')]);module[_0x62b6('0xf')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 3cad482..29a58a9 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 _0xdc88=['TEXT','STRING','INTEGER','exports'];(function(_0x4a3d63,_0x4a6172){var _0x94697b=function(_0xef7a3a){while(--_0xef7a3a){_0x4a3d63['push'](_0x4a3d63['shift']());}};_0x94697b(++_0x4a6172);}(_0xdc88,0x12b));var _0x8dc8=function(_0x51cd67,_0x5d3e39){_0x51cd67=_0x51cd67-0x0;var _0x11066f=_0xdc88[_0x51cd67];return _0x11066f;};'use strict';var Sequelize=require('sequelize');module[_0x8dc8('0x0')]={'license':{'type':Sequelize[_0x8dc8('0x1')]},'data1':{'type':Sequelize[_0x8dc8('0x2')]},'data2':{'type':Sequelize[_0x8dc8('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0x8dc8('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x2af8=['INTEGER','TEXT','STRING'];(function(_0x2b778d,_0x5dd9e4){var _0x46a581=function(_0x3eb2ee){while(--_0x3eb2ee){_0x2b778d['push'](_0x2b778d['shift']());}};_0x46a581(++_0x5dd9e4);}(_0x2af8,0x16c));var _0x82af=function(_0x1fb8db,_0x339e90){_0x1fb8db=_0x1fb8db-0x0;var _0x2acbdd=_0x2af8[_0x1fb8db];return _0x2acbdd;};'use strict';var Sequelize=require('sequelize');module['exports']={'license':{'type':Sequelize[_0x82af('0x0')]},'data1':{'type':Sequelize[_0x82af('0x1')]},'data2':{'type':Sequelize[_0x82af('0x1')]},'chatLicenseExceeded':{'type':Sequelize[_0x82af('0x2')],'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 8a6bd6d..cb60444 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 _0x57d9=['mustache','util','path','ejs','fs-extra','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','destroy','then','error','name','License','rawAttributes','query','keys','intersection','model','attributes','fields','length','merge','options','getLicense','catch','body','find','params','checkLicense','key','demo','license-info.log','join','/var','xcally','setHeader','Content-disposition','attachment;\x20filename=','Content-Type','text/plain','download','eml-format','rimraf','zip-dir','moment','bluebird'];(function(_0x5cef2a,_0x475977){var _0x3892b5=function(_0x42616e){while(--_0x42616e){_0x5cef2a['push'](_0x5cef2a['shift']());}};_0x3892b5(++_0x475977);}(_0x57d9,0x145));var _0x957d=function(_0x50aa2e,_0xfbd6f0){_0x50aa2e=_0x50aa2e-0x0;var _0x5e07f0=_0x57d9[_0x50aa2e];return _0x5e07f0;};'use strict';var emlformat=require(_0x957d('0x0'));var rimraf=require(_0x957d('0x1'));var zipdir=require(_0x957d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x957d('0x3'));var BPromise=require(_0x957d('0x4'));var Mustache=require(_0x957d('0x5'));var util=require(_0x957d('0x6'));var path=require(_0x957d('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x957d('0x8'));var fs=require('fs');var fs_extra=require(_0x957d('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x957d('0xa'));var jsforce=require(_0x957d('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x957d('0xc'));var querystring=require(_0x957d('0xd'));var Papa=require('papaparse');var Redis=require(_0x957d('0xe'));var authService=require(_0x957d('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x957d('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x957d('0x11'));var utils=require('../../config/utils');var config=require(_0x957d('0x12'));var licenseUtil=require(_0x957d('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x52c8f2,_0x122ece){_0x122ece=_0x122ece||0xcc;return function(_0x1d4639){if(_0x1d4639){return _0x52c8f2[_0x957d('0x14')](_0x122ece);}return _0x52c8f2[_0x957d('0x15')](_0x122ece)[_0x957d('0x16')]();};}function respondWithResult(_0x52f05f,_0x2b0191){_0x2b0191=_0x2b0191||0xc8;return function(_0x57a194){if(_0x57a194){return _0x52f05f[_0x957d('0x15')](_0x2b0191)[_0x957d('0x17')](_0x57a194);}};}function respondWithFilteredResult(_0x185907,_0x42a33d){return function(_0x4e0daa){if(_0x4e0daa){var _0x15c00c=typeof _0x42a33d[_0x957d('0x18')]==='undefined'&&typeof _0x42a33d['limit']===_0x957d('0x19');var _0x14527b=_0x4e0daa[_0x957d('0x1a')];var _0x556877=_0x15c00c?0x0:_0x42a33d[_0x957d('0x18')];var _0x55f234=_0x15c00c?_0x4e0daa['count']:_0x42a33d[_0x957d('0x18')]+_0x42a33d[_0x957d('0x1b')];var _0x5990b4;if(_0x55f234>=_0x14527b){_0x55f234=_0x14527b;_0x5990b4=0xc8;}else{_0x5990b4=0xce;}_0x185907[_0x957d('0x15')](_0x5990b4);return _0x185907[_0x957d('0x1c')]('Content-Range',_0x556877+'-'+_0x55f234+'/'+_0x14527b)[_0x957d('0x17')](_0x4e0daa);}return null;};}function patchUpdates(_0x529b24){return function(_0x10480f){try{jsonpatch[_0x957d('0x1d')](_0x10480f,_0x529b24,!![]);}catch(_0x581c51){return BPromise[_0x957d('0x1e')](_0x581c51);}return _0x10480f[_0x957d('0x1f')]();};}function saveUpdates(_0x3dd603,_0x5cb363){return function(_0x358079){if(_0x358079){return _0x358079[_0x957d('0x20')](_0x3dd603)['then'](function(_0x43254f){return _0x43254f;});}return null;};}function removeEntity(_0x5d4c9a,_0x126e5c){return function(_0x3fbe64){if(_0x3fbe64){return _0x3fbe64[_0x957d('0x21')]()[_0x957d('0x22')](function(){_0x5d4c9a[_0x957d('0x15')](0xcc)[_0x957d('0x16')]();});}};}function handleEntityNotFound(_0x3bf098,_0x183403){return function(_0x1180c1){if(!_0x1180c1){_0x3bf098['sendStatus'](0x194);}return _0x1180c1;};}function handleError(_0x1e547a,_0x5cfef6){_0x5cfef6=_0x5cfef6||0x1f4;return function(_0x356301){logger[_0x957d('0x23')](_0x356301['stack']);if(_0x356301[_0x957d('0x24')]){delete _0x356301[_0x957d('0x24')];}_0x1e547a[_0x957d('0x15')](_0x5cfef6)['send'](_0x356301);};}var utilLicense=require(_0x957d('0x13'));exports['index']=function(_0x34624e,_0x48a49e){var _0x3a4b9c={'raw':!![],'where':{'id':0x1}},_0x47bc9d={};_0x47bc9d['model']=_['keys'](db[_0x957d('0x25')][_0x957d('0x26')]);_0x47bc9d[_0x957d('0x27')]=_[_0x957d('0x28')](_0x34624e[_0x957d('0x27')]);_0x47bc9d['filters']=_[_0x957d('0x29')](_0x47bc9d[_0x957d('0x2a')],_0x47bc9d[_0x957d('0x27')]);_0x3a4b9c[_0x957d('0x2b')]=_['intersection'](_0x47bc9d['model'],qs[_0x957d('0x2c')](_0x34624e[_0x957d('0x27')]['fields']));_0x3a4b9c[_0x957d('0x2b')]=_0x3a4b9c[_0x957d('0x2b')][_0x957d('0x2d')]?_0x3a4b9c[_0x957d('0x2b')]:_0x47bc9d[_0x957d('0x2a')];_0x3a4b9c=_[_0x957d('0x2e')]({},_0x3a4b9c,_0x34624e[_0x957d('0x2f')]);return utilLicense[_0x957d('0x30')](_0x3a4b9c)['then'](respondWithResult(_0x48a49e,null))[_0x957d('0x31')](handleError(_0x48a49e,null));};exports[_0x957d('0x20')]=function(_0x1e13de,_0x741831){if(_0x1e13de[_0x957d('0x32')]['id']){delete _0x1e13de['body']['id'];}return db[_0x957d('0x25')][_0x957d('0x33')]({'where':{'id':_0x1e13de[_0x957d('0x34')]['id']}})['then'](handleEntityNotFound(_0x741831,null))[_0x957d('0x22')](function(_0x2b5ae5){var _0x6b3a6b=_0x2b5ae5['get']({'plain':!![]});return utilLicense[_0x957d('0x35')](_0x6b3a6b,_0x1e13de[_0x957d('0x32')][_0x957d('0x36')]);})[_0x957d('0x22')](function(_0x3bfdd3){if(!_0x3bfdd3[_0x957d('0x37')]){return saveUpdates(_0x1e13de[_0x957d('0x32')],null);}return _0x3bfdd3;})[_0x957d('0x22')](respondWithResult(_0x741831,null))[_0x957d('0x31')](handleError(_0x741831,null));};exports['downloadLogFile']=function(_0xa3fa58,_0x37f787){var _0x3c21be=_0x957d('0x38');var _0x300ebb=path[_0x957d('0x39')](_0x957d('0x3a'),'log',_0x957d('0x3b'),_0x3c21be);_0x37f787[_0x957d('0x3c')](_0x957d('0x3d'),_0x957d('0x3e')+_0x3c21be);_0x37f787['set'](_0x957d('0x3f'),_0x957d('0x40'));_0x37f787[_0x957d('0x41')](_0x300ebb);}; \ No newline at end of file +var _0x5f74=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','update','then','destroy','error','stack','name','index','model','keys','rawAttributes','query','filters','intersection','attributes','fields','merge','options','getLicense','License','find','params','get','checkLicense','body','key','demo','license-info.log','join','log','setHeader','Content-disposition','attachment;\x20filename=','Content-Type','text/plain','download','eml-format','rimraf'];(function(_0x2d8767,_0xb2b584){var _0x4a167e=function(_0x2c6d9e){while(--_0x2c6d9e){_0x2d8767['push'](_0x2d8767['shift']());}};_0x4a167e(++_0xb2b584);}(_0x5f74,0x92));var _0x45f7=function(_0x5b7235,_0x5c8cfe){_0x5b7235=_0x5b7235-0x0;var _0x1a001c=_0x5f74[_0x5b7235];return _0x1a001c;};'use strict';var emlformat=require(_0x45f7('0x0'));var rimraf=require(_0x45f7('0x1'));var zipdir=require(_0x45f7('0x2'));var jsonpatch=require(_0x45f7('0x3'));var rp=require(_0x45f7('0x4'));var moment=require(_0x45f7('0x5'));var BPromise=require(_0x45f7('0x6'));var Mustache=require(_0x45f7('0x7'));var util=require(_0x45f7('0x8'));var path=require(_0x45f7('0x9'));var sox=require(_0x45f7('0xa'));var csv=require(_0x45f7('0xb'));var ejs=require(_0x45f7('0xc'));var fs=require('fs');var fs_extra=require(_0x45f7('0xd'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x45f7('0xe'));var jsforce=require(_0x45f7('0xf'));var deskjs=require(_0x45f7('0x10'));var toCsv=require(_0x45f7('0xb'));var querystring=require(_0x45f7('0x11'));var Papa=require(_0x45f7('0x12'));var Redis=require('ioredis');var authService=require(_0x45f7('0x13'));var qs=require(_0x45f7('0x14'));var as=require(_0x45f7('0x15'));var hardwareService=require(_0x45f7('0x16'));var logger=require(_0x45f7('0x17'))(_0x45f7('0x18'));var utils=require('../../config/utils');var config=require(_0x45f7('0x19'));var licenseUtil=require(_0x45f7('0x1a'));var db=require(_0x45f7('0x1b'))['db'];function respondWithStatusCode(_0x27fb32,_0x137088){_0x137088=_0x137088||0xcc;return function(_0x354c50){if(_0x354c50){return _0x27fb32[_0x45f7('0x1c')](_0x137088);}return _0x27fb32[_0x45f7('0x1d')](_0x137088)[_0x45f7('0x1e')]();};}function respondWithResult(_0x4f82e7,_0xa098d7){_0xa098d7=_0xa098d7||0xc8;return function(_0x18c944){if(_0x18c944){return _0x4f82e7[_0x45f7('0x1d')](_0xa098d7)[_0x45f7('0x1f')](_0x18c944);}};}function respondWithFilteredResult(_0x4dc35a,_0x2ce06c){return function(_0x1ee047){if(_0x1ee047){var _0x365c48=typeof _0x2ce06c[_0x45f7('0x20')]===_0x45f7('0x21')&&typeof _0x2ce06c['limit']===_0x45f7('0x21');var _0x20bfc9=_0x1ee047['count'];var _0x4c5e66=_0x365c48?0x0:_0x2ce06c[_0x45f7('0x20')];var _0x44c039=_0x365c48?_0x1ee047[_0x45f7('0x22')]:_0x2ce06c[_0x45f7('0x20')]+_0x2ce06c[_0x45f7('0x23')];var _0x4343b5;if(_0x44c039>=_0x20bfc9){_0x44c039=_0x20bfc9;_0x4343b5=0xc8;}else{_0x4343b5=0xce;}_0x4dc35a[_0x45f7('0x1d')](_0x4343b5);return _0x4dc35a['set'](_0x45f7('0x24'),_0x4c5e66+'-'+_0x44c039+'/'+_0x20bfc9)['json'](_0x1ee047);}return null;};}function patchUpdates(_0x517860){return function(_0x1ec2a7){try{jsonpatch[_0x45f7('0x25')](_0x1ec2a7,_0x517860,!![]);}catch(_0x2e67d6){return BPromise[_0x45f7('0x26')](_0x2e67d6);}return _0x1ec2a7['save']();};}function saveUpdates(_0x16bb93,_0x273faa){return function(_0x325cdd){if(_0x325cdd){return _0x325cdd[_0x45f7('0x27')](_0x16bb93)[_0x45f7('0x28')](function(_0x163ffc){return _0x163ffc;});}return null;};}function removeEntity(_0x12bc6f,_0x172422){return function(_0x533944){if(_0x533944){return _0x533944[_0x45f7('0x29')]()[_0x45f7('0x28')](function(){_0x12bc6f['status'](0xcc)[_0x45f7('0x1e')]();});}};}function handleEntityNotFound(_0x4526bf,_0x5cbd40){return function(_0x3c7e18){if(!_0x3c7e18){_0x4526bf['sendStatus'](0x194);}return _0x3c7e18;};}function handleError(_0x1a9e75,_0x33eacb){_0x33eacb=_0x33eacb||0x1f4;return function(_0x3b04e4){logger[_0x45f7('0x2a')](_0x3b04e4[_0x45f7('0x2b')]);if(_0x3b04e4[_0x45f7('0x2c')]){delete _0x3b04e4['name'];}_0x1a9e75[_0x45f7('0x1d')](_0x33eacb)['send'](_0x3b04e4);};}var utilLicense=require(_0x45f7('0x1a'));exports[_0x45f7('0x2d')]=function(_0x271919,_0x2c52de){var _0x3639af={'raw':!![],'where':{'id':0x1}},_0x361a3a={};_0x361a3a[_0x45f7('0x2e')]=_[_0x45f7('0x2f')](db['License'][_0x45f7('0x30')]);_0x361a3a[_0x45f7('0x31')]=_[_0x45f7('0x2f')](_0x271919[_0x45f7('0x31')]);_0x361a3a[_0x45f7('0x32')]=_[_0x45f7('0x33')](_0x361a3a[_0x45f7('0x2e')],_0x361a3a['query']);_0x3639af[_0x45f7('0x34')]=_[_0x45f7('0x33')](_0x361a3a[_0x45f7('0x2e')],qs['fields'](_0x271919[_0x45f7('0x31')][_0x45f7('0x35')]));_0x3639af[_0x45f7('0x34')]=_0x3639af[_0x45f7('0x34')]['length']?_0x3639af[_0x45f7('0x34')]:_0x361a3a[_0x45f7('0x2e')];_0x3639af=_[_0x45f7('0x36')]({},_0x3639af,_0x271919[_0x45f7('0x37')]);return utilLicense[_0x45f7('0x38')](_0x3639af)[_0x45f7('0x28')](respondWithResult(_0x2c52de,null))['catch'](handleError(_0x2c52de,null));};exports[_0x45f7('0x27')]=function(_0x59d30a,_0xb2c1c7){if(_0x59d30a['body']['id']){delete _0x59d30a['body']['id'];}return db[_0x45f7('0x39')][_0x45f7('0x3a')]({'where':{'id':_0x59d30a[_0x45f7('0x3b')]['id']}})[_0x45f7('0x28')](handleEntityNotFound(_0xb2c1c7,null))[_0x45f7('0x28')](function(_0x593fbd){var _0x3abcdb=_0x593fbd[_0x45f7('0x3c')]({'plain':!![]});return utilLicense[_0x45f7('0x3d')](_0x3abcdb,_0x59d30a[_0x45f7('0x3e')][_0x45f7('0x3f')]);})['then'](function(_0x27fabb){if(!_0x27fabb[_0x45f7('0x40')]){return saveUpdates(_0x59d30a[_0x45f7('0x3e')],null);}return _0x27fabb;})[_0x45f7('0x28')](respondWithResult(_0xb2c1c7,null))['catch'](handleError(_0xb2c1c7,null));};exports['downloadLogFile']=function(_0x38cef5,_0x2b5942){var _0x169387=_0x45f7('0x41');var _0x30d8e6=path[_0x45f7('0x42')]('/var',_0x45f7('0x43'),'xcally',_0x169387);_0x2b5942[_0x45f7('0x44')](_0x45f7('0x45'),_0x45f7('0x46')+_0x169387);_0x2b5942['set'](_0x45f7('0x47'),_0x45f7('0x48'));_0x2b5942[_0x45f7('0x49')](_0x30d8e6);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 926acfe..d94cd94 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 _0x98c6=['./license.attributes','define','License','license','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x35bec5,_0x31723a){var _0x178a17=function(_0x3b6b28){while(--_0x3b6b28){_0x35bec5['push'](_0x35bec5['shift']());}};_0x178a17(++_0x31723a);}(_0x98c6,0xe1));var _0x698c=function(_0x32c2e4,_0x293687){_0x32c2e4=_0x32c2e4-0x0;var _0x20b0bd=_0x98c6[_0x32c2e4];return _0x20b0bd;};'use strict';var _=require(_0x698c('0x0'));var util=require(_0x698c('0x1'));var logger=require(_0x698c('0x2'))('api');var moment=require(_0x698c('0x3'));var BPromise=require(_0x698c('0x4'));var rp=require(_0x698c('0x5'));var fs=require('fs');var path=require(_0x698c('0x6'));var rimraf=require(_0x698c('0x7'));var config=require(_0x698c('0x8'));var attributes=require(_0x698c('0x9'));module['exports']=function(_0x518391,_0x2c609f){return _0x518391[_0x698c('0xa')](_0x698c('0xb'),attributes,{'tableName':_0x698c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe861=['bluebird','request-promise','path','../../config/environment','./license.attributes','define','License','license','util','api','moment'];(function(_0x2fcd5f,_0x289df4){var _0x346b78=function(_0x118d62){while(--_0x118d62){_0x2fcd5f['push'](_0x2fcd5f['shift']());}};_0x346b78(++_0x289df4);}(_0xe861,0x11b));var _0x1e86=function(_0x45134e,_0x2dac41){_0x45134e=_0x45134e-0x0;var _0x1f5f5a=_0xe861[_0x45134e];return _0x1f5f5a;};'use strict';var _=require('lodash');var util=require(_0x1e86('0x0'));var logger=require('../../config/logger')(_0x1e86('0x1'));var moment=require(_0x1e86('0x2'));var BPromise=require(_0x1e86('0x3'));var rp=require(_0x1e86('0x4'));var fs=require('fs');var path=require(_0x1e86('0x5'));var rimraf=require('rimraf');var config=require(_0x1e86('0x6'));var attributes=require(_0x1e86('0x7'));module['exports']=function(_0x55738b,_0x30d6c3){return _0x55738b[_0x1e86('0x8')](_0x1e86('0x9'),attributes,{'tableName':_0x1e86('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js index 7755705..1fba7cb 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 _0x9a60=['message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x33a21a,_0x22d1a8){var _0x4c628e=function(_0x59edab){while(--_0x59edab){_0x33a21a['push'](_0x33a21a['shift']());}};_0x4c628e(++_0x22d1a8);}(_0x9a60,0x7b));var _0x09a6=function(_0x1d4d2b,_0xc1eee3){_0x1d4d2b=_0x1d4d2b-0x0;var _0x4af051=_0x9a60[_0x1d4d2b];return _0x4af051;};'use strict';var _=require('lodash');var util=require(_0x09a6('0x0'));var moment=require('moment');var BPromise=require(_0x09a6('0x1'));var rs=require(_0x09a6('0x2'));var fs=require('fs');var Redis=require(_0x09a6('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x09a6('0x4'));var logger=require(_0x09a6('0x5'))(_0x09a6('0x6'));var config=require(_0x09a6('0x7'));var jayson=require(_0x09a6('0x8'));var client=jayson[_0x09a6('0x9')][_0x09a6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xd92fa3,_0x1617f4,_0x11fd67){return new BPromise(function(_0x3a3a70,_0x31b507){return client[_0x09a6('0xb')](_0xd92fa3,_0x11fd67)[_0x09a6('0xc')](function(_0x2e601f){logger[_0x09a6('0xd')](_0x09a6('0xe'),_0x1617f4,_0x09a6('0xf'));logger[_0x09a6('0x10')](_0x09a6('0x11'),_0x1617f4,_0x09a6('0xf'),JSON[_0x09a6('0x12')](_0x2e601f));if(_0x2e601f[_0x09a6('0x13')]){if(_0x2e601f[_0x09a6('0x13')][_0x09a6('0x14')]===0x1f4){logger[_0x09a6('0x13')](_0x09a6('0xe'),_0x1617f4,_0x2e601f[_0x09a6('0x13')][_0x09a6('0x15')]);return _0x31b507(_0x2e601f[_0x09a6('0x13')][_0x09a6('0x15')]);}logger['error'](_0x09a6('0xe'),_0x1617f4,_0x2e601f[_0x09a6('0x13')]['message']);return _0x3a3a70(_0x2e601f[_0x09a6('0x13')][_0x09a6('0x15')]);}else{logger['info'](_0x09a6('0xe'),_0x1617f4,_0x09a6('0xf'));_0x3a3a70(_0x2e601f[_0x09a6('0x16')][_0x09a6('0x15')]);}})[_0x09a6('0x17')](function(_0x4e4f19){logger['error'](_0x09a6('0xe'),_0x1617f4,_0x4e4f19);_0x31b507(_0x4e4f19);});});} \ No newline at end of file +var _0x46e3=['info','License,\x20%s,\x20%s','License,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x16a967,_0x2f3997){var _0x1ed7be=function(_0x42bc6e){while(--_0x42bc6e){_0x16a967['push'](_0x16a967['shift']());}};_0x1ed7be(++_0x2f3997);}(_0x46e3,0x18a));var _0x346e=function(_0x1aa961,_0x41b4cb){_0x1aa961=_0x1aa961-0x0;var _0x42af39=_0x46e3[_0x1aa961];return _0x42af39;};'use strict';var _=require(_0x346e('0x0'));var util=require('util');var moment=require(_0x346e('0x1'));var BPromise=require(_0x346e('0x2'));var rs=require(_0x346e('0x3'));var fs=require('fs');var Redis=require(_0x346e('0x4'));var db=require(_0x346e('0x5'))['db'];var utils=require(_0x346e('0x6'));var logger=require(_0x346e('0x7'))(_0x346e('0x8'));var config=require(_0x346e('0x9'));var jayson=require(_0x346e('0xa'));var client=jayson[_0x346e('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x462ff5,_0x4b277d,_0x594fce){return new BPromise(function(_0xb267c3,_0x406215){return client[_0x346e('0xc')](_0x462ff5,_0x594fce)[_0x346e('0xd')](function(_0x775343){logger[_0x346e('0xe')](_0x346e('0xf'),_0x4b277d,'request\x20sent');logger['debug'](_0x346e('0x10'),_0x4b277d,_0x346e('0x11'),JSON[_0x346e('0x12')](_0x775343));if(_0x775343[_0x346e('0x13')]){if(_0x775343[_0x346e('0x13')][_0x346e('0x14')]===0x1f4){logger[_0x346e('0x13')]('License,\x20%s,\x20%s',_0x4b277d,_0x775343[_0x346e('0x13')][_0x346e('0x15')]);return _0x406215(_0x775343[_0x346e('0x13')][_0x346e('0x15')]);}logger[_0x346e('0x13')]('License,\x20%s,\x20%s',_0x4b277d,_0x775343['error'][_0x346e('0x15')]);return _0xb267c3(_0x775343['error']['message']);}else{logger[_0x346e('0xe')](_0x346e('0xf'),_0x4b277d,'request\x20sent');_0xb267c3(_0x775343[_0x346e('0x16')][_0x346e('0x15')]);}})[_0x346e('0x17')](function(_0x4a7572){logger['error']('License,\x20%s,\x20%s',_0x4b277d,_0x4a7572);_0x406215(_0x4a7572);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 5f6a00c..24add28 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 _0x2e59=['getAnswers','/:id/in_servers','/:id/out_servers','getSmtp','/:id/interactions','/:id/applications','getApplications','/:id/messages','getMessages','verifySmtp','/:id/users','getAgents','post','addDisposition','create','addSmtp','addInteraction','addApplications','/:id/send','send','addAgents','put','update','delete','removeDispositions','removeAnswers','removeSmtp','removeAgents','exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','isAuthenticated','index','describe','get','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2e59,0x1bb));var _0x92e5=function(_0x1e500e,_0x2c9d74){_0x1e500e=_0x1e500e-0x0;var _0x10dc5e=_0x2e59[_0x1e500e];return _0x10dc5e;};'use strict';var multer=require('multer');var util=require(_0x92e5('0x0'));var path=require(_0x92e5('0x1'));var timeout=require('connect-timeout');var express=require(_0x92e5('0x2'));var router=express['Router']();var fs_extra=require(_0x92e5('0x3'));var auth=require(_0x92e5('0x4'));var interaction=require(_0x92e5('0x5'));var config=require(_0x92e5('0x6'));var controller=require(_0x92e5('0x7'));router['get']('/',auth[_0x92e5('0x8')](),controller[_0x92e5('0x9')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x92e5('0xa')]);router[_0x92e5('0xb')](_0x92e5('0xc'),auth[_0x92e5('0x8')](),controller[_0x92e5('0xd')]);router[_0x92e5('0xb')](_0x92e5('0xe'),auth[_0x92e5('0x8')](),controller[_0x92e5('0xf')]);router[_0x92e5('0xb')](_0x92e5('0x10'),auth[_0x92e5('0x8')](),controller[_0x92e5('0x11')]);router[_0x92e5('0xb')](_0x92e5('0x12'),auth[_0x92e5('0x8')](),controller['getImap']);router[_0x92e5('0xb')](_0x92e5('0x13'),auth[_0x92e5('0x8')](),controller[_0x92e5('0x14')]);router['get'](_0x92e5('0x15'),auth[_0x92e5('0x8')](),controller['getInteractions']);router['get'](_0x92e5('0x16'),auth[_0x92e5('0x8')](),controller[_0x92e5('0x17')]);router['get'](_0x92e5('0x18'),auth[_0x92e5('0x8')](),controller[_0x92e5('0x19')]);router[_0x92e5('0xb')]('/:id/verify',auth[_0x92e5('0x8')](),controller[_0x92e5('0x1a')]);router[_0x92e5('0xb')](_0x92e5('0x1b'),auth[_0x92e5('0x8')](),controller[_0x92e5('0x1c')]);router[_0x92e5('0x1d')](_0x92e5('0xe'),auth['isAuthenticated'](),controller[_0x92e5('0x1e')]);router['post'](_0x92e5('0x10'),auth['isAuthenticated'](),controller['addAnswer']);router['post']('/',auth[_0x92e5('0x8')](),controller[_0x92e5('0x1f')]);router[_0x92e5('0x1d')](_0x92e5('0x12'),auth[_0x92e5('0x8')](),controller['addImap']);router[_0x92e5('0x1d')](_0x92e5('0x13'),auth[_0x92e5('0x8')](),controller[_0x92e5('0x20')]);router['post'](_0x92e5('0x15'),auth[_0x92e5('0x8')](),controller[_0x92e5('0x21')]);router['post'](_0x92e5('0x16'),auth[_0x92e5('0x8')](),controller[_0x92e5('0x22')]);router[_0x92e5('0x1d')](_0x92e5('0x23'),auth[_0x92e5('0x8')](),controller[_0x92e5('0x24')]);router[_0x92e5('0x1d')]('/:id/users',auth[_0x92e5('0x8')](),controller[_0x92e5('0x25')]);router[_0x92e5('0x26')]('/:id',auth[_0x92e5('0x8')](),controller[_0x92e5('0x27')]);router[_0x92e5('0x28')](_0x92e5('0xe'),auth[_0x92e5('0x8')](),controller[_0x92e5('0x29')]);router[_0x92e5('0x28')]('/:id/canned_answers',auth[_0x92e5('0x8')](),controller[_0x92e5('0x2a')]);router[_0x92e5('0x28')]('/:id/in_servers',auth[_0x92e5('0x8')](),controller['removeImap']);router[_0x92e5('0x28')](_0x92e5('0x13'),auth[_0x92e5('0x8')](),controller[_0x92e5('0x2b')]);router['delete'](_0x92e5('0xc'),auth[_0x92e5('0x8')](),controller['destroy']);router[_0x92e5('0x28')]('/:id/users',auth[_0x92e5('0x8')](),controller[_0x92e5('0x2c')]);module[_0x92e5('0x2d')]=router; \ No newline at end of file +var _0xbdb7=['removeDispositions','removeAnswers','removeImap','removeSmtp','destroy','removeAgents','exports','multer','connect-timeout','../../components/auth/service','./mailAccount.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','/:id/applications','/:id/messages','getMessages','/:id/verify','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','create','addImap','addSmtp','addInteraction','addApplications','/:id/send','send','/:id/users','addAgents','put','update','delete'];(function(_0x2ca2d0,_0x3ea8e4){var _0x521c23=function(_0x5b0731){while(--_0x5b0731){_0x2ca2d0['push'](_0x2ca2d0['shift']());}};_0x521c23(++_0x3ea8e4);}(_0xbdb7,0x149));var _0x7bdb=function(_0xa7163a,_0x25b4df){_0xa7163a=_0xa7163a-0x0;var _0x2b68b7=_0xbdb7[_0xa7163a];return _0x2b68b7;};'use strict';var multer=require(_0x7bdb('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x7bdb('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x7bdb('0x2'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7bdb('0x3'));router[_0x7bdb('0x4')]('/',auth[_0x7bdb('0x5')](),controller['index']);router[_0x7bdb('0x4')](_0x7bdb('0x6'),auth[_0x7bdb('0x5')](),controller[_0x7bdb('0x7')]);router['get'](_0x7bdb('0x8'),auth[_0x7bdb('0x5')](),controller[_0x7bdb('0x9')]);router['get'](_0x7bdb('0xa'),auth[_0x7bdb('0x5')](),controller[_0x7bdb('0xb')]);router[_0x7bdb('0x4')]('/:id/canned_answers',auth[_0x7bdb('0x5')](),controller[_0x7bdb('0xc')]);router['get'](_0x7bdb('0xd'),auth[_0x7bdb('0x5')](),controller[_0x7bdb('0xe')]);router['get'](_0x7bdb('0xf'),auth[_0x7bdb('0x5')](),controller[_0x7bdb('0x10')]);router['get'](_0x7bdb('0x11'),auth[_0x7bdb('0x5')](),controller['getInteractions']);router[_0x7bdb('0x4')](_0x7bdb('0x12'),auth['isAuthenticated'](),controller['getApplications']);router['get'](_0x7bdb('0x13'),auth['isAuthenticated'](),controller[_0x7bdb('0x14')]);router[_0x7bdb('0x4')](_0x7bdb('0x15'),auth[_0x7bdb('0x5')](),controller['verifySmtp']);router[_0x7bdb('0x4')]('/:id/users',auth['isAuthenticated'](),controller[_0x7bdb('0x16')]);router[_0x7bdb('0x17')](_0x7bdb('0xa'),auth[_0x7bdb('0x5')](),controller[_0x7bdb('0x18')]);router[_0x7bdb('0x17')](_0x7bdb('0x19'),auth[_0x7bdb('0x5')](),controller[_0x7bdb('0x1a')]);router['post']('/',auth[_0x7bdb('0x5')](),controller[_0x7bdb('0x1b')]);router[_0x7bdb('0x17')](_0x7bdb('0xd'),auth[_0x7bdb('0x5')](),controller[_0x7bdb('0x1c')]);router[_0x7bdb('0x17')](_0x7bdb('0xf'),auth['isAuthenticated'](),controller[_0x7bdb('0x1d')]);router['post'](_0x7bdb('0x11'),auth[_0x7bdb('0x5')](),controller[_0x7bdb('0x1e')]);router[_0x7bdb('0x17')](_0x7bdb('0x12'),auth[_0x7bdb('0x5')](),controller[_0x7bdb('0x1f')]);router[_0x7bdb('0x17')](_0x7bdb('0x20'),auth[_0x7bdb('0x5')](),controller[_0x7bdb('0x21')]);router[_0x7bdb('0x17')](_0x7bdb('0x22'),auth[_0x7bdb('0x5')](),controller[_0x7bdb('0x23')]);router[_0x7bdb('0x24')](_0x7bdb('0x8'),auth[_0x7bdb('0x5')](),controller[_0x7bdb('0x25')]);router[_0x7bdb('0x26')](_0x7bdb('0xa'),auth[_0x7bdb('0x5')](),controller[_0x7bdb('0x27')]);router[_0x7bdb('0x26')]('/:id/canned_answers',auth[_0x7bdb('0x5')](),controller[_0x7bdb('0x28')]);router[_0x7bdb('0x26')](_0x7bdb('0xd'),auth[_0x7bdb('0x5')](),controller[_0x7bdb('0x29')]);router['delete']('/:id/out_servers',auth['isAuthenticated'](),controller[_0x7bdb('0x2a')]);router[_0x7bdb('0x26')](_0x7bdb('0x8'),auth[_0x7bdb('0x5')](),controller[_0x7bdb('0x2b')]);router[_0x7bdb('0x26')](_0x7bdb('0x22'),auth[_0x7bdb('0x5')](),controller[_0x7bdb('0x2c')]);module[_0x7bdb('0x2d')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 447cb29..361191d 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 _0x60ac=['setDataValue','mandatoryDisposition','ENUM','gmail','hotmail','yahoo','outlook365','getDataValue','custom','provider','sequelize','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x1bab1f,_0x1b51e8){var _0xeb960=function(_0x3199a6){while(--_0x3199a6){_0x1bab1f['push'](_0x1bab1f['shift']());}};_0xeb960(++_0x1b51e8);}(_0x60ac,0x88));var _0xc60a=function(_0x45e8fc,_0xb43907){_0x45e8fc=_0x45e8fc-0x0;var _0x462b6e=_0x60ac[_0x45e8fc];return _0x462b6e;};'use strict';var Sequelize=require(_0xc60a('0x0'));module[_0xc60a('0x1')]={'description':{'type':Sequelize[_0xc60a('0x2')]},'name':{'type':Sequelize[_0xc60a('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0xc60a('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0xc60a('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xc60a('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0xc60a('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0xc60a('0x4')]},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xc60a('0x2')],'allowNull':![],'defaultValue':_0xc60a('0x5')},'fontSize':{'type':Sequelize[_0xc60a('0x6')](0x2)[_0xc60a('0x7')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xc60a('0x4')],'defaultValue':function(){return _0xc60a('0x8');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xc60a('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xc60a('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xc60a('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xc60a('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xc60a('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xc60a('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xc60a('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0xc60a('0x9')},'mandatoryDisposition':{'type':Sequelize[_0xc60a('0x3')],'defaultValue':![],'comment':_0xc60a('0xa'),'set':function(_0x2e53cf){if(!_0x2e53cf)this[_0xc60a('0xb')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0xc60a('0xc'),_0x2e53cf);}},'provider':{'type':Sequelize[_0xc60a('0xd')](_0xc60a('0xe'),_0xc60a('0xf'),_0xc60a('0x10'),_0xc60a('0x11')),'defaultValue':null,'get':function(){if(!this[_0xc60a('0x12')]('provider'))return _0xc60a('0x13');return this[_0xc60a('0x12')](_0xc60a('0x14'));},'set':function(_0x1a2dc0){if(_0x1a2dc0===_0xc60a('0x13'))_0x1a2dc0=null;return this[_0xc60a('0xb')](_0xc60a('0x14'),_0x1a2dc0);}}}; \ No newline at end of file +var _0x512a=['setDataValue','mandatoryDisposition','ENUM','yahoo','outlook365','provider','custom','exports','STRING','BOOLEAN','TEXT','INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId'];(function(_0x5a2d3f,_0x27b04e){var _0x5c65d8=function(_0x2d1965){while(--_0x2d1965){_0x5a2d3f['push'](_0x5a2d3f['shift']());}};_0x5c65d8(++_0x27b04e);}(_0x512a,0x16c));var _0xa512=function(_0x44de30,_0x1bccce){_0x44de30=_0x44de30-0x0;var _0x111a14=_0x512a[_0x44de30];return _0x111a14;};'use strict';var Sequelize=require('sequelize');module[_0xa512('0x0')]={'description':{'type':Sequelize[_0xa512('0x1')]},'name':{'type':Sequelize[_0xa512('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0xa512('0x2')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xa512('0x2')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0xa512('0x3')]},'markAsUnread':{'type':Sequelize[_0xa512('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0xa512('0x4')](0x2)[_0xa512('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xa512('0x3')],'defaultValue':function(){return _0xa512('0x6');}},'notificationSound':{'type':Sequelize[_0xa512('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xa512('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xa512('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xa512('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa512('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa512('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa512('0x4')],'allowNull':!![],'defaultValue':null,'comment':_0xa512('0x7')},'mandatoryDisposition':{'type':Sequelize[_0xa512('0x2')],'defaultValue':![],'comment':_0xa512('0x8'),'set':function(_0x10cd01){if(!_0x10cd01)this['setDataValue'](_0xa512('0x9'),null);this[_0xa512('0xa')](_0xa512('0xb'),_0x10cd01);}},'provider':{'type':Sequelize[_0xa512('0xc')]('gmail','hotmail',_0xa512('0xd'),_0xa512('0xe')),'defaultValue':null,'get':function(){if(!this['getDataValue']('provider'))return'custom';return this['getDataValue'](_0xa512('0xf'));},'set':function(_0x563764){if(_0x563764===_0xa512('0x10'))_0x563764=null;return this['setDataValue'](_0xa512('0xf'),_0x563764);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index b425a0e..4796088 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 _0xf5e6=['keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','params','find','body','provider','addDisposition','MailAccountId','Disposition','getDispositions','findOne','length','pick','removeDispositions','ids','addAnswer','CannedAnswer','create','getAnswers','removeAnswers','custom','ListId','isNil','active','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','getInteractions','CmContact','Contact','User','Owner','fullname','Tags','color','tag','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','finally','getApplications','getMessages','$gte','YYYY-MM-DD\x20HH:mm:ss','MailMessage','inlineCss','true','split','List','Contacts','updatedAt','CloudProvider','Smtp\x20configuration\x20not\x20found','from','format','email','attachments','root','basename','getSmtpOptions','SendMail','sendMail','List\x20not\x20found','subject','attach','out','messageId','Messages','verifySmtp','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','omit','spread','emit','userMailAccount:save','removeAgents','isArray','getAgents','moment','bluebird','path','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','client','http','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','destroy','get','MailAccounts','UserProfileResource','stack','name','send','gmail','imap.gmail.com','yahoo','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','Unknown\x20email\x20service\x20provider','smtp.mail.yahoo.com','user','username','pass','password','modernAuthentication','CloudProviderId','host','port','secure','service','authentication','Imap','Smtp','index','MailServerIn','MailServerOut','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','type','key','model','query'];(function(_0x320a8d,_0x38c999){var _0x481ee3=function(_0x111e5d){while(--_0x111e5d){_0x320a8d['push'](_0x320a8d['shift']());}};_0x481ee3(++_0x38c999);}(_0xf5e6,0x132));var _0x6f5e=function(_0x3711d9,_0x32a172){_0x3711d9=_0x3711d9-0x0;var _0x41e327=_0xf5e6[_0x3711d9];return _0x41e327;};'use strict';var moment=require(_0x6f5e('0x0'));var BPromise=require(_0x6f5e('0x1'));var util=require('util');var path=require(_0x6f5e('0x2'));var _=require('lodash');var juice=require(_0x6f5e('0x3'));var Redis=require(_0x6f5e('0x4'));var qs=require(_0x6f5e('0x5'));var logger=require(_0x6f5e('0x6'))(_0x6f5e('0x7'));var config=require(_0x6f5e('0x8'));var db=require(_0x6f5e('0x9'))['db'];config[_0x6f5e('0xa')]=_[_0x6f5e('0xb')](config[_0x6f5e('0xa')],{'host':_0x6f5e('0xc'),'port':0x18eb});var socket=require(_0x6f5e('0xd'))(new Redis(config[_0x6f5e('0xa')]));require(_0x6f5e('0xe'))[_0x6f5e('0xf')](socket);var jayson=require('jayson/promise');var client=jayson[_0x6f5e('0x10')][_0x6f5e('0x11')]({'port':0x232b});function respondWithRpcPromise(_0x21bcfb,_0x451ddc,_0x543d7a,_0x2d8a4f){return new BPromise(function(_0x4c026e,_0x1c417f){var _0x243c02=_0x2d8a4f||client;return _0x243c02[_0x6f5e('0x12')](_0x21bcfb,_0x543d7a)[_0x6f5e('0x13')](function(_0xe08c07){logger[_0x6f5e('0x14')](_0x6f5e('0x15'),_0x451ddc,_0x6f5e('0x16'));logger[_0x6f5e('0x17')](_0x6f5e('0x18'),_0x451ddc,_0x6f5e('0x16'),JSON['stringify'](_0xe08c07));if(_0xe08c07[_0x6f5e('0x19')]){if(_0xe08c07[_0x6f5e('0x19')][_0x6f5e('0x1a')]===0x1f4){logger[_0x6f5e('0x19')](_0x6f5e('0x15'),_0x451ddc,_0xe08c07[_0x6f5e('0x19')]['message']);return _0x1c417f(_0xe08c07[_0x6f5e('0x19')][_0x6f5e('0x1b')]);}logger[_0x6f5e('0x19')]('MailAccount,\x20%s,\x20%s',_0x451ddc,_0xe08c07[_0x6f5e('0x19')][_0x6f5e('0x1b')]);return _0x4c026e(_0xe08c07[_0x6f5e('0x19')]['message']);}else{logger[_0x6f5e('0x14')]('MailAccount,\x20%s,\x20%s',_0x451ddc,_0x6f5e('0x16'));_0x4c026e(_0xe08c07[_0x6f5e('0x1c')][_0x6f5e('0x1b')]);}})[_0x6f5e('0x1d')](function(_0x308967){logger[_0x6f5e('0x19')](_0x6f5e('0x15'),_0x451ddc,_0x308967);_0x1c417f(_0x308967);});});}function respondWithStatusCode(_0x54e7d5,_0x5b495c){_0x5b495c=_0x5b495c||0xcc;return function(_0x80860a){if(_0x80860a){return _0x54e7d5[_0x6f5e('0x1e')](_0x5b495c);}return _0x54e7d5[_0x6f5e('0x1f')](_0x5b495c)[_0x6f5e('0x20')]();};}function respondWithResult(_0x5b7bc5,_0x259c87){_0x259c87=_0x259c87||0xc8;return function(_0x5068ce){if(_0x5068ce){return _0x5b7bc5[_0x6f5e('0x1f')](_0x259c87)[_0x6f5e('0x21')](_0x5068ce);}};}function respondWithFilteredResult(_0x3d4628,_0x14a5dc){return function(_0x5cc355){if(_0x5cc355){var _0x38434d=typeof _0x14a5dc[_0x6f5e('0x22')]===_0x6f5e('0x23')&&typeof _0x14a5dc[_0x6f5e('0x24')]===_0x6f5e('0x23');var _0x179dfb=_0x5cc355[_0x6f5e('0x25')];var _0x3bf9ca=_0x38434d?0x0:_0x14a5dc[_0x6f5e('0x22')];var _0x2952c6=_0x38434d?_0x5cc355[_0x6f5e('0x25')]:_0x14a5dc[_0x6f5e('0x22')]+_0x14a5dc[_0x6f5e('0x24')];var _0x101542;if(_0x2952c6>=_0x179dfb){_0x2952c6=_0x179dfb;_0x101542=0xc8;}else{_0x101542=0xce;}_0x3d4628[_0x6f5e('0x1f')](_0x101542);return _0x3d4628[_0x6f5e('0x26')](_0x6f5e('0x27'),_0x3bf9ca+'-'+_0x2952c6+'/'+_0x179dfb)[_0x6f5e('0x21')](_0x5cc355);}return null;};}function saveUpdates(_0x2bcbe2){return function(_0x5707bc){if(_0x5707bc){return _0x5707bc[_0x6f5e('0x28')](_0x2bcbe2)['then'](function(_0x4a6923){return _0x4a6923;});}return null;};}function removeEntity(_0x59a10f){return function(_0x49b4ba){if(_0x49b4ba){return _0x49b4ba[_0x6f5e('0x29')]()[_0x6f5e('0x13')](function(){var _0x3380c4=_0x49b4ba[_0x6f5e('0x2a')]({'plain':!![]});var _0x19d8ae=_0x6f5e('0x2b');return db[_0x6f5e('0x2c')][_0x6f5e('0x29')]({'where':{'type':_0x19d8ae,'resourceId':_0x3380c4['id']}})[_0x6f5e('0x13')](function(){return _0x49b4ba;});})[_0x6f5e('0x13')](function(){_0x59a10f[_0x6f5e('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0xebbe08){return function(_0x2a6a74){if(!_0x2a6a74){_0xebbe08[_0x6f5e('0x1e')](0x194);}return _0x2a6a74;};}function handleError(_0x32caf4,_0x57355f){_0x57355f=_0x57355f||0x1f4;return function(_0x419309){logger[_0x6f5e('0x19')](_0x419309[_0x6f5e('0x2d')]);if(_0x419309['name']){delete _0x419309[_0x6f5e('0x2e')];}_0x32caf4['status'](_0x57355f)[_0x6f5e('0x2f')](_0x419309);};}function getImapHost(_0x18766c){switch(_0x18766c){case _0x6f5e('0x30'):return _0x6f5e('0x31');case _0x6f5e('0x32'):return'imap.mail.yahoo.com';case _0x6f5e('0x33'):return _0x6f5e('0x34');case _0x6f5e('0x35'):return _0x6f5e('0x36');}throw new Error(_0x6f5e('0x37'),_0x18766c);}function getSmtpHost(_0x16163f){switch(_0x16163f){case _0x6f5e('0x30'):return'smtp.gmail.com';case _0x6f5e('0x32'):return _0x6f5e('0x38');case'hotmail':return'smtp-mail.outlook.com';case _0x6f5e('0x35'):return'smtp.office365.com';}throw new Error(_0x6f5e('0x37'),_0x16163f);}function getAuthenticationOptions(_0x13e8e3,_0x6b0fa8){var _0x65dab8={};var _0x4d9655={};if(_0x13e8e3){_0x65dab8[_0x6f5e('0x39')]=_0x4d9655[_0x6f5e('0x39')]=_0x6b0fa8[_0x6f5e('0x3a')];_0x65dab8['password']=_0x4d9655[_0x6f5e('0x3b')]=_0x6b0fa8[_0x6f5e('0x3c')];if(_0x6b0fa8[_0x6f5e('0x3d')]){_0x65dab8[_0x6f5e('0x3d')]=_0x4d9655[_0x6f5e('0x3d')]=!![];_0x65dab8['CloudProviderId']=_0x4d9655['CloudProviderId']=_0x6b0fa8['CloudProviderId'];_0x65dab8[_0x6f5e('0x3c')]=_0x4d9655[_0x6f5e('0x3b')]=null;}else{_0x65dab8[_0x6f5e('0x3e')]=_0x4d9655[_0x6f5e('0x3e')]=null;}_0x65dab8[_0x6f5e('0x3f')]=getImapHost(_0x13e8e3);_0x65dab8[_0x6f5e('0x40')]=0x3e1;_0x4d9655['host']=getSmtpHost(_0x13e8e3);_0x4d9655[_0x6f5e('0x40')]=0x24b;_0x4d9655[_0x6f5e('0x41')]=![];_0x65dab8['service']=_0x4d9655[_0x6f5e('0x42')]=null;}else{if(_0x6b0fa8[_0x6f5e('0x43')]){_0x65dab8[_0x6f5e('0x39')]=_0x4d9655[_0x6f5e('0x39')]=_0x6b0fa8[_0x6f5e('0x3a')];_0x65dab8[_0x6f5e('0x3c')]=_0x4d9655['pass']=_0x6b0fa8['password'];}else{_0x65dab8[_0x6f5e('0x43')]=_0x4d9655['authentication']=![];_0x65dab8[_0x6f5e('0x39')]=_0x4d9655[_0x6f5e('0x39')]=null;_0x65dab8[_0x6f5e('0x3c')]=_0x4d9655['pass']=null;}_0x65dab8['host']=_0x6b0fa8[_0x6f5e('0x44')]['host'];_0x65dab8[_0x6f5e('0x40')]=_0x6b0fa8[_0x6f5e('0x44')][_0x6f5e('0x40')];_0x4d9655[_0x6f5e('0x3f')]=_0x6b0fa8[_0x6f5e('0x45')]['host'];_0x4d9655[_0x6f5e('0x40')]=_0x6b0fa8[_0x6f5e('0x45')][_0x6f5e('0x40')];}return{'Imap':_0x65dab8,'Smtp':_0x4d9655};}exports[_0x6f5e('0x46')]=function(_0x59e49b,_0x4299ef){var _0x251b68={'include':[{'model':db[_0x6f5e('0x47')],'as':_0x6f5e('0x44')},{'model':db[_0x6f5e('0x48')],'as':'Smtp'},{'model':db['Pause'],'as':_0x6f5e('0x49')}]},_0x582f2e={},_0x3aa1e3={'count':0x0,'rows':[]};var _0x9c1472=_[_0x6f5e('0x4a')](db[_0x6f5e('0x4b')][_0x6f5e('0x4c')],function(_0x5eff9b){return{'name':_0x5eff9b[_0x6f5e('0x4d')],'type':_0x5eff9b[_0x6f5e('0x4e')][_0x6f5e('0x4f')]};});_0x582f2e[_0x6f5e('0x50')]=_[_0x6f5e('0x4a')](_0x9c1472,_0x6f5e('0x2e'));_0x582f2e[_0x6f5e('0x51')]=_[_0x6f5e('0x52')](_0x59e49b['query']);_0x582f2e[_0x6f5e('0x53')]=_[_0x6f5e('0x54')](_0x582f2e[_0x6f5e('0x50')],_0x582f2e[_0x6f5e('0x51')]);_0x251b68[_0x6f5e('0x55')]=_[_0x6f5e('0x54')](_0x582f2e[_0x6f5e('0x50')],qs[_0x6f5e('0x56')](_0x59e49b[_0x6f5e('0x51')][_0x6f5e('0x56')]));_0x251b68[_0x6f5e('0x55')]=_0x251b68[_0x6f5e('0x55')]['length']?_0x251b68[_0x6f5e('0x55')]:_0x582f2e[_0x6f5e('0x50')];if(!_0x59e49b['query'][_0x6f5e('0x57')](_0x6f5e('0x58'))){_0x251b68['limit']=qs[_0x6f5e('0x24')](_0x59e49b[_0x6f5e('0x51')][_0x6f5e('0x24')]);_0x251b68[_0x6f5e('0x22')]=qs[_0x6f5e('0x22')](_0x59e49b[_0x6f5e('0x51')][_0x6f5e('0x22')]);}_0x251b68[_0x6f5e('0x59')]=qs[_0x6f5e('0x5a')](_0x59e49b[_0x6f5e('0x51')][_0x6f5e('0x5a')]);_0x251b68[_0x6f5e('0x5b')]=qs['filters'](_['pick'](_0x59e49b[_0x6f5e('0x51')],_0x582f2e[_0x6f5e('0x53')]),_0x9c1472);if(_0x59e49b['query'][_0x6f5e('0x5c')]){_0x251b68['where']=_[_0x6f5e('0x5d')](_0x251b68[_0x6f5e('0x5b')],{'$or':_[_0x6f5e('0x4a')](_0x9c1472,function(_0x190c5d){if(_0x190c5d[_0x6f5e('0x4e')]!=='VIRTUAL'){var _0x1255a3={};_0x1255a3[_0x190c5d[_0x6f5e('0x2e')]]={'$like':'%'+_0x59e49b[_0x6f5e('0x51')][_0x6f5e('0x5c')]+'%'};return _0x1255a3;}})});}_0x251b68=_[_0x6f5e('0x5d')]({},_0x251b68,_0x59e49b[_0x6f5e('0x5e')]);var _0x471174={'where':_0x251b68[_0x6f5e('0x5b')]};return db[_0x6f5e('0x4b')][_0x6f5e('0x25')](_0x471174)[_0x6f5e('0x13')](function(_0xf4d03c){_0x3aa1e3[_0x6f5e('0x25')]=_0xf4d03c;if(_0x59e49b[_0x6f5e('0x51')][_0x6f5e('0x5f')]){_0x251b68[_0x6f5e('0x60')]=[{'all':!![]}];}return db[_0x6f5e('0x4b')][_0x6f5e('0x61')](_0x251b68);})['then'](function(_0x4515a5){_0x3aa1e3[_0x6f5e('0x62')]=_0x4515a5;return _0x3aa1e3;})[_0x6f5e('0x13')](respondWithFilteredResult(_0x4299ef,_0x251b68))['catch'](handleError(_0x4299ef,null));};exports['show']=function(_0x55af3d,_0x795ed4){var _0x22b2ca={'raw':![],'where':{'id':_0x55af3d[_0x6f5e('0x63')]['id']},'include':[{'model':db[_0x6f5e('0x47')],'as':_0x6f5e('0x44')},{'model':db[_0x6f5e('0x48')],'as':_0x6f5e('0x45')},{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x45513e={};_0x45513e['model']=_['keys'](db['MailAccount'][_0x6f5e('0x4c')]);_0x45513e['query']=_[_0x6f5e('0x52')](_0x55af3d['query']);_0x45513e[_0x6f5e('0x53')]=_[_0x6f5e('0x54')](_0x45513e[_0x6f5e('0x50')],_0x45513e['query']);_0x22b2ca[_0x6f5e('0x55')]=_[_0x6f5e('0x54')](_0x45513e[_0x6f5e('0x50')],qs[_0x6f5e('0x56')](_0x55af3d['query'][_0x6f5e('0x56')]));_0x22b2ca['attributes']=_0x22b2ca['attributes']['length']?_0x22b2ca[_0x6f5e('0x55')]:_0x45513e[_0x6f5e('0x50')];if(_0x55af3d['query'][_0x6f5e('0x5f')]){_0x22b2ca[_0x6f5e('0x60')]=[{'all':!![]}];}_0x22b2ca=_[_0x6f5e('0x5d')]({},_0x22b2ca,_0x55af3d[_0x6f5e('0x5e')]);return db[_0x6f5e('0x4b')][_0x6f5e('0x64')](_0x22b2ca)['then'](handleEntityNotFound(_0x795ed4,null))[_0x6f5e('0x13')](respondWithResult(_0x795ed4,null))[_0x6f5e('0x1d')](handleError(_0x795ed4,null));};exports[_0x6f5e('0x28')]=function(_0x3103c3,_0xdf6dbb){if(_0x3103c3['body']['id']){delete _0x3103c3[_0x6f5e('0x65')]['id'];}var _0x4a65f3=_0x3103c3[_0x6f5e('0x65')]['provider']==='custom'?null:_0x3103c3[_0x6f5e('0x65')][_0x6f5e('0x66')];var _0x4aca33=_0x3103c3[_0x6f5e('0x65')][_0x6f5e('0x44')]||{};var _0xa3e5c=_0x3103c3[_0x6f5e('0x65')][_0x6f5e('0x45')]||{};if(_0x4a65f3){_0x4aca33[_0x6f5e('0x3f')]=getImapHost(_0x4a65f3);_0x4aca33[_0x6f5e('0x40')]=0x3e1;_0xa3e5c[_0x6f5e('0x3f')]=getSmtpHost(_0x4a65f3);_0xa3e5c['port']=0x24b;_0xa3e5c[_0x6f5e('0x41')]=![];}if(_0xa3e5c[_0x6f5e('0x3d')]){_0xa3e5c[_0x6f5e('0x41')]=![];}else{_0xa3e5c[_0x6f5e('0x3e')]=null;}if(!_0x4aca33[_0x6f5e('0x3d')])_0x4aca33[_0x6f5e('0x3e')]=null;_0x3103c3[_0x6f5e('0x65')][_0x6f5e('0x44')]=_0x4aca33;_0x3103c3[_0x6f5e('0x65')][_0x6f5e('0x45')]=_0xa3e5c;return db[_0x6f5e('0x4b')]['find']({'where':{'id':_0x3103c3[_0x6f5e('0x63')]['id']},'include':[{'model':db['MailServerIn'],'as':_0x6f5e('0x44')},{'model':db[_0x6f5e('0x48')],'as':_0x6f5e('0x45')},{'model':db['Pause'],'as':_0x6f5e('0x49')}]})['then'](handleEntityNotFound(_0xdf6dbb,null))[_0x6f5e('0x13')](function(_0x16916c){if(!_0x16916c)throw new Error('Mail\x20Account\x20not\x20found');if(_0x16916c['service'])delete _0x3103c3[_0x6f5e('0x65')]['Imap'];return _0x16916c;})['then'](saveUpdates(_0x3103c3['body'],null))[_0x6f5e('0x13')](function(_0xf1f49f){if(!_0x3103c3[_0x6f5e('0x65')][_0x6f5e('0x44')])return _0xf1f49f;return db[_0x6f5e('0x47')]['update'](_0x3103c3[_0x6f5e('0x65')][_0x6f5e('0x44')],{'where':{'MailAccountId':_0xf1f49f['id']}})[_0x6f5e('0x13')](function(){return _0xf1f49f;});})['then'](function(_0x449c64){if(!_0x3103c3['body'][_0x6f5e('0x45')])return _0x449c64;return db[_0x6f5e('0x48')][_0x6f5e('0x28')](_0x3103c3[_0x6f5e('0x65')][_0x6f5e('0x45')],{'where':{'MailAccountId':_0x449c64['id']}})['then'](function(){return _0x449c64;});})[_0x6f5e('0x13')](respondWithResult(_0xdf6dbb,null))['catch'](handleError(_0xdf6dbb,null));};exports['describe']=function(_0x570b50,_0x2f3ba4){return db[_0x6f5e('0x4b')]['describe']()[_0x6f5e('0x13')](respondWithResult(_0x2f3ba4,null))['catch'](handleError(_0x2f3ba4,null));};exports[_0x6f5e('0x67')]=function(_0x1fbef6,_0x2e5dbf){if(_0x1fbef6[_0x6f5e('0x65')]['id']){delete _0x1fbef6[_0x6f5e('0x65')]['id'];}return db[_0x6f5e('0x4b')][_0x6f5e('0x64')]({'where':{'id':_0x1fbef6[_0x6f5e('0x63')]['id']}})[_0x6f5e('0x13')](handleEntityNotFound(_0x2e5dbf,null))[_0x6f5e('0x13')](function(_0x4256bb){if(_0x4256bb){_0x1fbef6[_0x6f5e('0x65')][_0x6f5e('0x68')]=_0x4256bb['id'];return db[_0x6f5e('0x69')]['create'](_0x1fbef6[_0x6f5e('0x65')]);}})[_0x6f5e('0x13')](respondWithResult(_0x2e5dbf,null))[_0x6f5e('0x1d')](handleError(_0x2e5dbf,null));};exports[_0x6f5e('0x6a')]=function(_0x3b0207,_0x1bba16){var _0x2f7890={'raw':![],'where':{}};var _0x5972de={};var _0x26a830={'count':0x0,'rows':[]};return db[_0x6f5e('0x4b')][_0x6f5e('0x6b')]({'where':{'id':_0x3b0207[_0x6f5e('0x63')]['id']}})[_0x6f5e('0x13')](handleEntityNotFound(_0x1bba16,null))[_0x6f5e('0x13')](function(_0x30e250){if(_0x30e250){_0x5972de[_0x6f5e('0x50')]=_[_0x6f5e('0x52')](db[_0x6f5e('0x69')][_0x6f5e('0x4c')]);_0x5972de[_0x6f5e('0x51')]=_['keys'](_0x3b0207[_0x6f5e('0x51')]);_0x5972de[_0x6f5e('0x53')]=_[_0x6f5e('0x54')](_0x5972de['model'],_0x5972de[_0x6f5e('0x51')]);_0x2f7890[_0x6f5e('0x55')]=_[_0x6f5e('0x54')](_0x5972de[_0x6f5e('0x50')],qs['fields'](_0x3b0207['query'][_0x6f5e('0x56')]));_0x2f7890[_0x6f5e('0x55')]=_0x2f7890['attributes'][_0x6f5e('0x6c')]?_0x2f7890[_0x6f5e('0x55')]:_0x5972de[_0x6f5e('0x50')];if(!_0x3b0207[_0x6f5e('0x51')][_0x6f5e('0x57')](_0x6f5e('0x58'))){_0x2f7890[_0x6f5e('0x24')]=qs[_0x6f5e('0x24')](_0x3b0207[_0x6f5e('0x51')]['limit']);_0x2f7890[_0x6f5e('0x22')]=qs[_0x6f5e('0x22')](_0x3b0207['query'][_0x6f5e('0x22')]);}_0x2f7890[_0x6f5e('0x59')]=qs[_0x6f5e('0x5a')](_0x3b0207[_0x6f5e('0x51')]['sort']);_0x2f7890[_0x6f5e('0x5b')]=qs[_0x6f5e('0x53')](_[_0x6f5e('0x6d')](_0x3b0207[_0x6f5e('0x51')],_0x5972de[_0x6f5e('0x53')]));_0x2f7890['where'][_0x6f5e('0x68')]=_0x30e250['id'];if(_0x3b0207[_0x6f5e('0x51')][_0x6f5e('0x5c')]){_0x2f7890[_0x6f5e('0x5b')]=_['merge'](_0x2f7890[_0x6f5e('0x5b')],{'$or':_[_0x6f5e('0x4a')](_0x2f7890[_0x6f5e('0x55')],function(_0x215527){var _0x3dca65={};_0x3dca65[_0x215527]={'$like':'%'+_0x3b0207[_0x6f5e('0x51')][_0x6f5e('0x5c')]+'%'};return _0x3dca65;})});}_0x2f7890=_[_0x6f5e('0x5d')]({},_0x2f7890,_0x3b0207[_0x6f5e('0x5e')]);return db[_0x6f5e('0x69')]['count']({'where':_0x2f7890['where']})[_0x6f5e('0x13')](function(_0x362dd7){_0x26a830[_0x6f5e('0x25')]=_0x362dd7;if(_0x3b0207[_0x6f5e('0x51')][_0x6f5e('0x5f')]){_0x2f7890[_0x6f5e('0x60')]=[{'all':!![]}];}return db[_0x6f5e('0x69')][_0x6f5e('0x61')](_0x2f7890);})[_0x6f5e('0x13')](function(_0x18973b){_0x26a830[_0x6f5e('0x62')]=_0x18973b;return _0x26a830;});}})[_0x6f5e('0x13')](respondWithFilteredResult(_0x1bba16,_0x2f7890))['catch'](handleError(_0x1bba16,null));};exports[_0x6f5e('0x6e')]=function(_0x320ec4,_0x12311a){return db[_0x6f5e('0x4b')]['find']({'where':{'id':_0x320ec4[_0x6f5e('0x63')]['id']}})[_0x6f5e('0x13')](handleEntityNotFound(_0x12311a,null))[_0x6f5e('0x13')](function(_0x33820f){if(_0x33820f){return _0x33820f[_0x6f5e('0x6e')](_0x320ec4['query'][_0x6f5e('0x6f')]);}})[_0x6f5e('0x13')](respondWithStatusCode(_0x12311a,null))['catch'](handleError(_0x12311a,null));};exports[_0x6f5e('0x70')]=function(_0x246aec,_0x2a7b40){if(_0x246aec[_0x6f5e('0x65')]['id']){delete _0x246aec['body']['id'];}return db['MailAccount'][_0x6f5e('0x64')]({'where':{'id':_0x246aec[_0x6f5e('0x63')]['id']}})[_0x6f5e('0x13')](handleEntityNotFound(_0x2a7b40,null))['then'](function(_0x5aaeb5){if(_0x5aaeb5){_0x246aec[_0x6f5e('0x65')][_0x6f5e('0x68')]=_0x5aaeb5['id'];return db[_0x6f5e('0x71')][_0x6f5e('0x72')](_0x246aec[_0x6f5e('0x65')]);}})[_0x6f5e('0x13')](respondWithResult(_0x2a7b40,null))[_0x6f5e('0x1d')](handleError(_0x2a7b40,null));};exports[_0x6f5e('0x73')]=function(_0x46bee6,_0x51cea8){var _0x16cc32={'raw':![],'where':{}};var _0xd6db5={};var _0x17e98a={'count':0x0,'rows':[]};return db[_0x6f5e('0x4b')][_0x6f5e('0x6b')]({'where':{'id':_0x46bee6[_0x6f5e('0x63')]['id']}})[_0x6f5e('0x13')](handleEntityNotFound(_0x51cea8,null))[_0x6f5e('0x13')](function(_0x3aa8d9){if(_0x3aa8d9){_0xd6db5['model']=_[_0x6f5e('0x52')](db['CannedAnswer'][_0x6f5e('0x4c')]);_0xd6db5[_0x6f5e('0x51')]=_[_0x6f5e('0x52')](_0x46bee6[_0x6f5e('0x51')]);_0xd6db5['filters']=_['intersection'](_0xd6db5[_0x6f5e('0x50')],_0xd6db5[_0x6f5e('0x51')]);_0x16cc32['attributes']=_[_0x6f5e('0x54')](_0xd6db5['model'],qs[_0x6f5e('0x56')](_0x46bee6['query'][_0x6f5e('0x56')]));_0x16cc32[_0x6f5e('0x55')]=_0x16cc32['attributes'][_0x6f5e('0x6c')]?_0x16cc32[_0x6f5e('0x55')]:_0xd6db5[_0x6f5e('0x50')];if(!_0x46bee6[_0x6f5e('0x51')]['hasOwnProperty']('nolimit')){_0x16cc32[_0x6f5e('0x24')]=qs['limit'](_0x46bee6[_0x6f5e('0x51')][_0x6f5e('0x24')]);_0x16cc32['offset']=qs['offset'](_0x46bee6[_0x6f5e('0x51')][_0x6f5e('0x22')]);}_0x16cc32[_0x6f5e('0x59')]=qs[_0x6f5e('0x5a')](_0x46bee6[_0x6f5e('0x51')][_0x6f5e('0x5a')]);_0x16cc32[_0x6f5e('0x5b')]=qs[_0x6f5e('0x53')](_[_0x6f5e('0x6d')](_0x46bee6[_0x6f5e('0x51')],_0xd6db5[_0x6f5e('0x53')]));_0x16cc32[_0x6f5e('0x5b')][_0x6f5e('0x68')]=_0x3aa8d9['id'];if(_0x46bee6[_0x6f5e('0x51')][_0x6f5e('0x5c')]){_0x16cc32[_0x6f5e('0x5b')]=_[_0x6f5e('0x5d')](_0x16cc32[_0x6f5e('0x5b')],{'$or':_[_0x6f5e('0x4a')](_0x16cc32[_0x6f5e('0x55')],function(_0x5af864){var _0x53199c={};_0x53199c[_0x5af864]={'$like':'%'+_0x46bee6[_0x6f5e('0x51')][_0x6f5e('0x5c')]+'%'};return _0x53199c;})});}_0x16cc32=_[_0x6f5e('0x5d')]({},_0x16cc32,_0x46bee6[_0x6f5e('0x5e')]);return db[_0x6f5e('0x71')]['count']({'where':_0x16cc32[_0x6f5e('0x5b')]})['then'](function(_0xf30b6d){_0x17e98a[_0x6f5e('0x25')]=_0xf30b6d;if(_0x46bee6['query'][_0x6f5e('0x5f')]){_0x16cc32[_0x6f5e('0x60')]=[{'all':!![]}];}return db[_0x6f5e('0x71')][_0x6f5e('0x61')](_0x16cc32);})[_0x6f5e('0x13')](function(_0xbd7bc4){_0x17e98a[_0x6f5e('0x62')]=_0xbd7bc4;return _0x17e98a;});}})[_0x6f5e('0x13')](respondWithFilteredResult(_0x51cea8,_0x16cc32))[_0x6f5e('0x1d')](handleError(_0x51cea8,null));};exports[_0x6f5e('0x74')]=function(_0x37e9a8,_0xaed1eb){return db[_0x6f5e('0x4b')][_0x6f5e('0x64')]({'where':{'id':_0x37e9a8[_0x6f5e('0x63')]['id']}})[_0x6f5e('0x13')](handleEntityNotFound(_0xaed1eb,null))[_0x6f5e('0x13')](function(_0x20a279){if(_0x20a279){return _0x20a279[_0x6f5e('0x74')](_0x37e9a8['query'][_0x6f5e('0x6f')]);}})['then'](respondWithStatusCode(_0xaed1eb,null))['catch'](handleError(_0xaed1eb,null));};exports['create']=function(_0x360b37,_0x58d3a9){var _0x47a009={'name':_0x360b37['body'][_0x6f5e('0x2e')],'key':_0x360b37[_0x6f5e('0x65')][_0x6f5e('0x4f')],'provider':_0x360b37[_0x6f5e('0x65')][_0x6f5e('0x66')]===_0x6f5e('0x75')?null:_0x360b37['body'][_0x6f5e('0x66')],'email':_0x360b37[_0x6f5e('0x65')]['email'],'ListId':_0x360b37[_0x6f5e('0x65')][_0x6f5e('0x76')],'active':!_[_0x6f5e('0x77')](_0x360b37[_0x6f5e('0x65')][_0x6f5e('0x78')])?_0x360b37['body'][_0x6f5e('0x78')]:!![],'description':_0x360b37[_0x6f5e('0x65')]['description']||null};var _0x47d170=getAuthenticationOptions(_0x47a009['provider'],_0x360b37[_0x6f5e('0x65')]);_0x47a009[_0x6f5e('0x44')]=_0x47d170[_0x6f5e('0x44')];_0x47a009[_0x6f5e('0x45')]=_0x47d170['Smtp'];return db['MailAccount'][_0x6f5e('0x72')](_0x47a009,{'include':[{'model':db['MailServerOut'],'as':_0x6f5e('0x45')},{'model':db['MailServerIn'],'as':'Imap'}]})[_0x6f5e('0x13')](function(_0x8c3e17){var _0x5f0420=_0x360b37['user'][_0x6f5e('0x2a')]({'plain':!![]});if(!_0x5f0420)throw new Error(_0x6f5e('0x79'));if(_0x5f0420[_0x6f5e('0x7a')]===_0x6f5e('0x39')){var _0x313eb9=_0x8c3e17[_0x6f5e('0x2a')]({'plain':!![]});return db[_0x6f5e('0x7b')][_0x6f5e('0x64')]({'where':{'name':_0x6f5e('0x2b'),'userProfileId':_0x5f0420['userProfileId']},'raw':!![]})[_0x6f5e('0x13')](function(_0xd5f986){if(_0xd5f986&&_0xd5f986[_0x6f5e('0x7c')]===0x0){return db[_0x6f5e('0x2c')][_0x6f5e('0x72')]({'name':_0x313eb9['name'],'resourceId':_0x313eb9['id'],'type':_0xd5f986[_0x6f5e('0x2e')],'sectionId':_0xd5f986['id']},{})['then'](function(){return _0x8c3e17;});}else{return _0x8c3e17;}})['catch'](function(_0x267dab){logger[_0x6f5e('0x19')](_0x6f5e('0x7d'),_0x267dab);throw _0x267dab;});}return _0x8c3e17;})[_0x6f5e('0x13')](respondWithResult(_0x58d3a9,0xc9))[_0x6f5e('0x1d')](handleError(_0x58d3a9,null));};exports['getImap']=function(_0x2a31f2,_0x7fa79b){return db[_0x6f5e('0x4b')]['findOne']({'where':{'id':_0x2a31f2[_0x6f5e('0x63')]['id']}})[_0x6f5e('0x13')](handleEntityNotFound(_0x7fa79b,null))[_0x6f5e('0x13')](function(_0x2e6602){if(_0x2e6602){return _0x2e6602[_0x6f5e('0x7e')]();}return null;})[_0x6f5e('0x13')](respondWithResult(_0x7fa79b,null))['catch'](handleError(_0x7fa79b,null));};exports[_0x6f5e('0x7f')]=function(_0x2e0370,_0x5cfec3){if(_0x2e0370[_0x6f5e('0x65')]['id']){delete _0x2e0370[_0x6f5e('0x65')]['id'];}return db[_0x6f5e('0x4b')]['find']({'where':{'id':_0x2e0370[_0x6f5e('0x63')]['id']}})[_0x6f5e('0x13')](handleEntityNotFound(_0x5cfec3,null))[_0x6f5e('0x13')](function(_0x1d9ae1){if(_0x1d9ae1){_0x2e0370['body'][_0x6f5e('0x68')]=_0x1d9ae1['id'];return db[_0x6f5e('0x47')][_0x6f5e('0x72')](_0x2e0370[_0x6f5e('0x65')]);}})[_0x6f5e('0x13')](respondWithResult(_0x5cfec3,null))[_0x6f5e('0x1d')](handleError(_0x5cfec3,null));};exports['removeImap']=function(_0xd9700f,_0x236615){return db[_0x6f5e('0x4b')][_0x6f5e('0x6b')]({'where':{'id':_0xd9700f[_0x6f5e('0x63')]['id']}})[_0x6f5e('0x13')](handleEntityNotFound(_0x236615,null))[_0x6f5e('0x13')](function(_0x3a8c36){if(_0x3a8c36){return _0x3a8c36[_0x6f5e('0x80')](null);}return null;})[_0x6f5e('0x13')](respondWithStatusCode(_0x236615,null))[_0x6f5e('0x1d')](handleError(_0x236615,null));};exports[_0x6f5e('0x81')]=function(_0x5bce7a,_0x561daa){return db['MailAccount'][_0x6f5e('0x6b')]({'where':{'id':_0x5bce7a['params']['id']}})[_0x6f5e('0x13')](handleEntityNotFound(_0x561daa,null))[_0x6f5e('0x13')](function(_0x4d26be){if(_0x4d26be){return _0x4d26be[_0x6f5e('0x81')]();}return null;})[_0x6f5e('0x13')](respondWithResult(_0x561daa,null))[_0x6f5e('0x1d')](handleError(_0x561daa,null));};exports[_0x6f5e('0x82')]=function(_0x46724d,_0x11cc16){if(_0x46724d[_0x6f5e('0x65')]['id']){delete _0x46724d[_0x6f5e('0x65')]['id'];}return db[_0x6f5e('0x4b')][_0x6f5e('0x64')]({'where':{'id':_0x46724d[_0x6f5e('0x63')]['id']}})[_0x6f5e('0x13')](handleEntityNotFound(_0x11cc16,null))[_0x6f5e('0x13')](function(_0x476e18){if(_0x476e18){_0x46724d[_0x6f5e('0x65')]['MailAccountId']=_0x476e18['id'];return db[_0x6f5e('0x48')][_0x6f5e('0x72')](_0x46724d[_0x6f5e('0x65')]);}})[_0x6f5e('0x13')](respondWithResult(_0x11cc16,null))[_0x6f5e('0x1d')](handleError(_0x11cc16,null));};exports[_0x6f5e('0x83')]=function(_0x50836d,_0x2fc20c){return db[_0x6f5e('0x4b')][_0x6f5e('0x6b')]({'where':{'id':_0x50836d['params']['id']}})[_0x6f5e('0x13')](handleEntityNotFound(_0x2fc20c,null))[_0x6f5e('0x13')](function(_0x24ad7d){if(_0x24ad7d){return _0x24ad7d[_0x6f5e('0x84')](null);}return null;})['then'](respondWithStatusCode(_0x2fc20c,null))[_0x6f5e('0x1d')](handleError(_0x2fc20c,null));};exports[_0x6f5e('0x85')]=function(_0x10ef2b,_0x475a0c){return db[_0x6f5e('0x86')][_0x6f5e('0x64')]({'where':{'id':_0x10ef2b[_0x6f5e('0x63')]['id']}})[_0x6f5e('0x13')](handleEntityNotFound(_0x475a0c,null))[_0x6f5e('0x13')](function(_0x4ede30){if(_0x4ede30){return _0x4ede30[_0x6f5e('0x85')](_0x10ef2b[_0x6f5e('0x65')][_0x6f5e('0x6f')],_['omit'](_0x10ef2b[_0x6f5e('0x65')],['ids','id'])||{});}})[_0x6f5e('0x13')](respondWithResult(_0x475a0c,null))[_0x6f5e('0x1d')](handleError(_0x475a0c,null));};exports[_0x6f5e('0x87')]=function(_0xa05cf3,_0x4302b2){var _0x5f019d={'raw':![],'where':{}};var _0x168ea5={};var _0x3a49e3={'count':0x0,'rows':[]};return db[_0x6f5e('0x4b')]['findOne']({'where':{'id':_0xa05cf3[_0x6f5e('0x63')]['id']}})[_0x6f5e('0x13')](handleEntityNotFound(_0x4302b2,null))['then'](function(_0x2936e2){if(_0x2936e2){_0x168ea5['model']=_[_0x6f5e('0x52')](db[_0x6f5e('0x86')]['rawAttributes']);_0x168ea5[_0x6f5e('0x51')]=_[_0x6f5e('0x52')](_0xa05cf3[_0x6f5e('0x51')]);_0x168ea5[_0x6f5e('0x53')]=_['intersection'](_0x168ea5[_0x6f5e('0x50')],_0x168ea5[_0x6f5e('0x51')]);_0x5f019d[_0x6f5e('0x55')]=_[_0x6f5e('0x54')](_0x168ea5[_0x6f5e('0x50')],qs[_0x6f5e('0x56')](_0xa05cf3['query'][_0x6f5e('0x56')]));_0x5f019d[_0x6f5e('0x55')]=_0x5f019d[_0x6f5e('0x55')][_0x6f5e('0x6c')]?_0x5f019d[_0x6f5e('0x55')]:_0x168ea5['model'];if(!_0xa05cf3['query'][_0x6f5e('0x57')]('nolimit')){_0x5f019d['limit']=qs[_0x6f5e('0x24')](_0xa05cf3['query']['limit']);_0x5f019d[_0x6f5e('0x22')]=qs[_0x6f5e('0x22')](_0xa05cf3['query'][_0x6f5e('0x22')]);}_0x5f019d[_0x6f5e('0x59')]=qs[_0x6f5e('0x5a')](_0xa05cf3['query'][_0x6f5e('0x5a')]);_0x5f019d[_0x6f5e('0x5b')]=qs[_0x6f5e('0x53')](_[_0x6f5e('0x6d')](_0xa05cf3[_0x6f5e('0x51')],_0x168ea5[_0x6f5e('0x53')]));_0x5f019d[_0x6f5e('0x5b')][_0x6f5e('0x68')]=_0x2936e2['id'];if(_0xa05cf3['query']['filter']){_0x5f019d[_0x6f5e('0x5b')]=_['merge'](_0x5f019d['where'],{'$or':_[_0x6f5e('0x4a')](_0x5f019d[_0x6f5e('0x55')],function(_0x1a40cc){var _0x1ed3ba={};_0x1ed3ba[_0x1a40cc]={'$like':'%'+_0xa05cf3[_0x6f5e('0x51')]['filter']+'%'};return _0x1ed3ba;})});}_0x5f019d=_[_0x6f5e('0x5d')]({},_0x5f019d,_0xa05cf3[_0x6f5e('0x5e')]);return db['MailInteraction'][_0x6f5e('0x25')]({'where':_0x5f019d[_0x6f5e('0x5b')]})['then'](function(_0x38be7f){_0x3a49e3[_0x6f5e('0x25')]=_0x38be7f;if(_0xa05cf3[_0x6f5e('0x51')][_0x6f5e('0x5f')]){_0x5f019d[_0x6f5e('0x60')]=[{'model':db[_0x6f5e('0x88')],'as':_0x6f5e('0x89'),'required':![]},{'model':db[_0x6f5e('0x8a')],'as':_0x6f5e('0x8b'),'attributes':[_0x6f5e('0x2e'),_0x6f5e('0x8c'),'internal'],'required':![]},{'model':db['Tag'],'as':_0x6f5e('0x8d'),'attributes':['id',_0x6f5e('0x2e'),_0x6f5e('0x8e')],'where':_0xa05cf3[_0x6f5e('0x51')][_0x6f5e('0x8f')]?{'id':_0xa05cf3[_0x6f5e('0x51')][_0x6f5e('0x8f')]}:undefined,'required':_0xa05cf3[_0x6f5e('0x51')]['tag']?!![]:![]}];}return db['MailInteraction']['findAll'](_0x5f019d);})[_0x6f5e('0x13')](function(_0x3865d0){_0x3a49e3['rows']=_0x3865d0;return _0x3a49e3;});}})['then'](respondWithFilteredResult(_0x4302b2,_0x5f019d))['catch'](handleError(_0x4302b2,null));};exports[_0x6f5e('0x90')]=function addApplications(_0x277e2b,_0x358544){var _0x4e5487=_0x277e2b[_0x6f5e('0x63')]['id'];var _0x558218=_0x277e2b[_0x6f5e('0x65')];var _0x1ba189=0xc8;var _0x11c0f6=null;return db[_0x6f5e('0x91')][_0x6f5e('0x92')]({'isolationLevel':db['sequelize']['Transaction'][_0x6f5e('0x93')][_0x6f5e('0x94')]},function(_0x3d1f60){return db[_0x6f5e('0x4b')]['findOne']({'where':{'id':_0x4e5487},'transaction':_0x3d1f60})['then'](function(_0x23ac04){if(_0x23ac04){return db[_0x6f5e('0x95')][_0x6f5e('0x29')]({'where':{'MailAccountId':_0x4e5487},'transaction':_0x3d1f60})[_0x6f5e('0x13')](function(){var _0x3a424b=_[_0x6f5e('0x4a')](_0x558218,function(_0x4bd83b){_0x4bd83b[_0x6f5e('0x68')]=_0x4e5487;return _0x4bd83b;});return db[_0x6f5e('0x95')][_0x6f5e('0x96')](_0x3a424b,{'transaction':_0x3d1f60});});}else{_0x1ba189=0x194;_0x11c0f6=[];}});})[_0x6f5e('0x13')](function(){if(_0x1ba189!==0x194){return db[_0x6f5e('0x95')][_0x6f5e('0x97')]({'where':{'MailAccountId':_0x4e5487},'order':'priority'})[_0x6f5e('0x13')](function(_0x520215){_0x11c0f6=_0x520215;});}})['catch'](function(_0x751e15){_0x1ba189=0x1f4;logger['error'](_0x751e15[_0x6f5e('0x2d')]);if(_0x751e15[_0x6f5e('0x2e')]){delete _0x751e15['name'];}_0x11c0f6=_0x751e15;})[_0x6f5e('0x98')](function(){if(_0x11c0f6===null){_0x358544['sendStatus'](_0x1ba189);}else{if(_0x1ba189===0x1f4){_0x358544[_0x6f5e('0x1f')](_0x1ba189)[_0x6f5e('0x2f')](_0x11c0f6);}else{_0x358544['status'](_0x1ba189)['json'](_0x11c0f6);}}});};exports[_0x6f5e('0x99')]=function(_0x286b2f,_0x510b5b){var _0x33ca0c={};var _0x2ae1fb={};var _0x5f3099;var _0x200ea9;return db[_0x6f5e('0x4b')]['findOne']({'where':{'id':_0x286b2f['params']['id']}})[_0x6f5e('0x13')](handleEntityNotFound(_0x510b5b,null))[_0x6f5e('0x13')](function(_0x4ffee3){if(_0x4ffee3){_0x5f3099=_0x4ffee3;_0x2ae1fb['model']=_[_0x6f5e('0x52')](db['MailApplication'][_0x6f5e('0x4c')]);_0x2ae1fb[_0x6f5e('0x51')]=_[_0x6f5e('0x52')](_0x286b2f[_0x6f5e('0x51')]);_0x2ae1fb['filters']=_[_0x6f5e('0x54')](_0x2ae1fb[_0x6f5e('0x50')],_0x2ae1fb[_0x6f5e('0x51')]);_0x33ca0c[_0x6f5e('0x55')]=_['intersection'](_0x2ae1fb[_0x6f5e('0x50')],qs[_0x6f5e('0x56')](_0x286b2f[_0x6f5e('0x51')][_0x6f5e('0x56')]));_0x33ca0c[_0x6f5e('0x55')]=_0x33ca0c[_0x6f5e('0x55')][_0x6f5e('0x6c')]?_0x33ca0c[_0x6f5e('0x55')]:_0x2ae1fb['model'];_0x33ca0c[_0x6f5e('0x59')]=qs[_0x6f5e('0x5a')](_0x286b2f[_0x6f5e('0x51')][_0x6f5e('0x5a')]);_0x33ca0c[_0x6f5e('0x5b')]=qs[_0x6f5e('0x53')](_['pick'](_0x286b2f[_0x6f5e('0x51')],_0x2ae1fb[_0x6f5e('0x53')]));if(_0x286b2f[_0x6f5e('0x51')][_0x6f5e('0x5c')]){_0x33ca0c[_0x6f5e('0x5b')]=_[_0x6f5e('0x5d')](_0x33ca0c[_0x6f5e('0x5b')],{'$or':_[_0x6f5e('0x4a')](_0x33ca0c['attributes'],function(_0x39b286){var _0xcb0898={};_0xcb0898[_0x39b286]={'$like':'%'+_0x286b2f[_0x6f5e('0x51')][_0x6f5e('0x5c')]+'%'};return _0xcb0898;})});}_0x33ca0c=_['merge']({},_0x33ca0c,_0x286b2f['options']);return _0x5f3099['getApplications'](_0x33ca0c);}})[_0x6f5e('0x13')](function(_0x24014a){if(_0x24014a){_0x200ea9=_0x24014a[_0x6f5e('0x6c')];if(!_0x286b2f['query'][_0x6f5e('0x57')](_0x6f5e('0x58'))){_0x33ca0c['limit']=qs[_0x6f5e('0x24')](_0x286b2f[_0x6f5e('0x51')]['limit']);_0x33ca0c['offset']=qs[_0x6f5e('0x22')](_0x286b2f[_0x6f5e('0x51')]['offset']);}return _0x5f3099['getApplications'](_0x33ca0c);}})['then'](function(_0x568bda){if(_0x568bda){return _0x568bda?{'count':_0x200ea9,'rows':_0x568bda}:null;}})[_0x6f5e('0x13')](respondWithResult(_0x510b5b,null))['catch'](handleError(_0x510b5b,null));};exports[_0x6f5e('0x9a')]=function(_0x4684ab,_0x4890bb){var _0xf4697c={'raw':!![],'where':{}};var _0x56ddff={};var _0x54b52d={'count':0x0,'rows':[]};return db[_0x6f5e('0x4b')][_0x6f5e('0x6b')]({'where':{'id':_0x4684ab[_0x6f5e('0x63')]['id']}})[_0x6f5e('0x13')](handleEntityNotFound(_0x4890bb,null))[_0x6f5e('0x13')](function(_0x4855eb){if(_0x4855eb){_0x56ddff[_0x6f5e('0x50')]=_[_0x6f5e('0x52')](db['MailMessage'][_0x6f5e('0x4c')]);_0x56ddff['query']=_['keys'](_0x4684ab[_0x6f5e('0x51')]);_0x56ddff[_0x6f5e('0x53')]=_[_0x6f5e('0x54')](_0x56ddff['model'],_0x56ddff[_0x6f5e('0x51')]);_0xf4697c['attributes']=_[_0x6f5e('0x54')](_0x56ddff['model'],qs[_0x6f5e('0x56')](_0x4684ab[_0x6f5e('0x51')][_0x6f5e('0x56')]));_0xf4697c[_0x6f5e('0x55')]=_0xf4697c['attributes'][_0x6f5e('0x6c')]?_0xf4697c[_0x6f5e('0x55')]:_0x56ddff[_0x6f5e('0x50')];if(!_0x4684ab[_0x6f5e('0x51')]['hasOwnProperty'](_0x6f5e('0x58'))){_0xf4697c['limit']=qs['limit'](_0x4684ab[_0x6f5e('0x51')]['limit']);_0xf4697c[_0x6f5e('0x22')]=qs[_0x6f5e('0x22')](_0x4684ab[_0x6f5e('0x51')]['offset']);}_0xf4697c['order']=qs['sort'](_0x4684ab[_0x6f5e('0x51')][_0x6f5e('0x5a')]);_0xf4697c[_0x6f5e('0x5b')]=qs[_0x6f5e('0x53')](_[_0x6f5e('0x6d')](_0x4684ab['query'],_0x56ddff[_0x6f5e('0x53')]));_0xf4697c[_0x6f5e('0x5b')][_0x6f5e('0x68')]=_0x4855eb['id'];if(_0x4684ab['query'][_0x6f5e('0x5c')]){_0xf4697c[_0x6f5e('0x5b')]=_[_0x6f5e('0x5d')](_0xf4697c[_0x6f5e('0x5b')],{'$or':_[_0x6f5e('0x4a')](_0xf4697c[_0x6f5e('0x55')],function(_0x3f8b1e){var _0x5939ab={};_0x5939ab[_0x3f8b1e]={'$like':'%'+_0x4684ab[_0x6f5e('0x51')][_0x6f5e('0x5c')]+'%'};return _0x5939ab;})});}if(_0x4684ab[_0x6f5e('0x51')][_0x6f5e('0x9b')]){var _0x5d5cbd=_0x4684ab[_0x6f5e('0x51')][_0x6f5e('0x9b')]['split'](',');var _0x16d5eb={};_0x16d5eb[_0x5d5cbd[0x0]]={'$gte':moment(_0x5d5cbd[0x1])['format'](_0x6f5e('0x9c'))};_0xf4697c[_0x6f5e('0x5b')]=_['merge'](_0xf4697c['where'],_0x16d5eb);}_0xf4697c=_[_0x6f5e('0x5d')]({},_0xf4697c,_0x4684ab['options']);return db[_0x6f5e('0x9d')]['count']({'where':_0xf4697c[_0x6f5e('0x5b')]})[_0x6f5e('0x13')](function(_0x4331e9){_0x54b52d[_0x6f5e('0x25')]=_0x4331e9;if(_0x4684ab[_0x6f5e('0x51')][_0x6f5e('0x5f')]){_0xf4697c[_0x6f5e('0x60')]=[{'all':!![]}];}return db['MailMessage'][_0x6f5e('0x61')](_0xf4697c);})[_0x6f5e('0x13')](function(_0x316879){if(_0x4684ab[_0x6f5e('0x51')][_0x6f5e('0x9e')]===_0x6f5e('0x9f')){for(var _0x20b9f8=0x0;_0x20b9f8<_0x316879[_0x6f5e('0x6c')];_0x20b9f8++){_0x316879[_0x20b9f8][_0x6f5e('0x65')]=juice(_0x316879[_0x20b9f8][_0x6f5e('0x65')]);}}_0x54b52d[_0x6f5e('0x62')]=_0x316879;return _0x54b52d;});}})[_0x6f5e('0x13')](respondWithFilteredResult(_0x4890bb,_0xf4697c))[_0x6f5e('0x1d')](handleError(_0x4890bb,null));};exports['send']=function(_0x17d474,_0x5e974f){var _0x18d3e5,_0x3431fa={},_0x175ac5;if(_0x17d474['body']['to']){_0x175ac5=_0x17d474['body']['to'][_0x6f5e('0xa0')](',')[0x0];}return db['MailAccount'][_0x6f5e('0x64')]({'where':{'id':_0x17d474[_0x6f5e('0x63')]['id']},'include':[{'model':db['CmList'],'as':_0x6f5e('0xa1'),'include':[{'model':db[_0x6f5e('0x88')],'as':_0x6f5e('0xa2'),'where':{'email':_0x175ac5},'limit':0x1,'order':[[_0x6f5e('0xa3'),'DESC']]}]},{'model':db[_0x6f5e('0x48')],'as':_0x6f5e('0x45'),'raw':!![],'include':[{'model':db[_0x6f5e('0xa4')],'as':'CloudProvider','raw':!![]}]}]})[_0x6f5e('0x13')](handleEntityNotFound(_0x5e974f,null))[_0x6f5e('0x13')](function(_0x9d959b){if(!_0x9d959b)return;_0x18d3e5=_0x9d959b;if(!_0x9d959b['Smtp'])throw new Error(_0x6f5e('0xa5'));if(_[_0x6f5e('0x77')](_0x17d474['body'][_0x6f5e('0xa6')])){_0x17d474['body'][_0x6f5e('0xa6')]=util[_0x6f5e('0xa7')]('%s\x20<%s>',_0x9d959b[_0x6f5e('0x2e')],_0x9d959b[_0x6f5e('0xa8')]||_0x9d959b['Smtp'][_0x6f5e('0x39')]);}if(_0x17d474['body'][_0x6f5e('0xa9')]&&_0x17d474['body'][_0x6f5e('0xa9')][_0x6f5e('0x6c')]){for(var _0x48ab92=0x0;_0x48ab92<_0x17d474[_0x6f5e('0x65')]['attachments'][_0x6f5e('0x6c')];_0x48ab92+=0x1){_0x17d474[_0x6f5e('0x65')][_0x6f5e('0xa9')][_0x48ab92]={'filename':_0x17d474[_0x6f5e('0x65')][_0x6f5e('0xa9')][_0x48ab92][_0x6f5e('0x2e')],'path':path['join'](config[_0x6f5e('0xaa')],'server/files/attachments',_0x17d474[_0x6f5e('0x65')]['attachments'][_0x48ab92][_0x6f5e('0xab')])};}}var _0x9a85e5=_0x9d959b[_0x6f5e('0xac')]();return respondWithRpcPromise(_0x6f5e('0xad'),_0x6f5e('0xae'),{'account':_0x9a85e5,'message':_0x17d474[_0x6f5e('0x65')]});})[_0x6f5e('0x13')](function(_0x313ae5){if(!_0x313ae5)return;_0x3431fa=_0x313ae5;if(!_0x18d3e5['List'])throw new Error(_0x6f5e('0xaf'));if(_0x18d3e5['List'][_0x6f5e('0xa2')]['length'])return _0x18d3e5[_0x6f5e('0xa1')][_0x6f5e('0xa2')][0x0];return db['CmContact'][_0x6f5e('0x72')](_[_0x6f5e('0xb')](_0x17d474[_0x6f5e('0x65')],{'firstName':_0x17d474['body']['to'],'email':_0x17d474[_0x6f5e('0x65')]['to'],'phone':_0x17d474[_0x6f5e('0x65')]['to'],'ListId':_0x18d3e5['ListId']}));})['then'](function(_0x86b330){if(!_0x86b330)return;var _0x83c5e8={'UserId':_0x17d474[_0x6f5e('0x39')]['id'],'ContactId':_0x86b330['id'],'MailAccountId':_0x18d3e5['id'],'inReplyTo':_0x3431fa['messageId'],'to':_0x17d474['body']['from'],'cc':_0x17d474[_0x6f5e('0x65')]['cc'],'subject':_0x17d474[_0x6f5e('0x65')][_0x6f5e('0xb0')],'attach':_0x17d474[_0x6f5e('0x65')][_0x6f5e('0xb1')],'firstMsgDirection':_0x6f5e('0xb2'),'lastMsgAt':moment()[_0x6f5e('0xa7')](_0x6f5e('0x9c')),'lastMsgDirection':'out','Messages':[_[_0x6f5e('0x5d')](_0x17d474[_0x6f5e('0x65')],{'messageId':_0x3431fa[_0x6f5e('0xb3')],'sentAt':moment()[_0x6f5e('0xa7')](_0x6f5e('0x9c')),'read':!![],'MailAccountId':_0x18d3e5['id'],'UserId':_0x17d474[_0x6f5e('0x39')]['id'],'ContactId':_0x86b330['id']})]};if(_0x17d474[_0x6f5e('0x65')]['Interaction']){_0x83c5e8=_[_0x6f5e('0x5d')](_0x83c5e8,_0x17d474[_0x6f5e('0x65')]['Interaction']);}return db[_0x6f5e('0x86')]['create'](_0x83c5e8,{'include':[{'model':db[_0x6f5e('0x9d')],'as':_0x6f5e('0xb4')}]});})[_0x6f5e('0x13')](respondWithResult(_0x5e974f,null))[_0x6f5e('0x1d')](handleError(_0x5e974f,null));};exports[_0x6f5e('0xb5')]=function(_0x39be74,_0x50292f){return db[_0x6f5e('0x4b')][_0x6f5e('0x64')]({'where':{'id':_0x39be74[_0x6f5e('0x63')]['id']},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db[_0x6f5e('0xa4')],'as':_0x6f5e('0xa4'),'raw':!![]}]}]})[_0x6f5e('0x13')](handleEntityNotFound(_0x50292f,null))[_0x6f5e('0x13')](function(_0x52a76e){if(!_0x52a76e['Smtp'])return;var _0x42f232=_0x52a76e['getSmtpOptions']();return respondWithRpcPromise(_0x6f5e('0xb6'),_0x6f5e('0xb5'),{'account':_0x42f232});})[_0x6f5e('0x13')](respondWithResult(_0x50292f,null))[_0x6f5e('0x1d')](handleError(_0x50292f,null));};exports[_0x6f5e('0x29')]=function(_0x4caaea,_0x1c2645){return db['MailAccount'][_0x6f5e('0x64')]({'where':{'id':_0x4caaea['params']['id']}})[_0x6f5e('0x13')](handleEntityNotFound(_0x1c2645,null))[_0x6f5e('0x13')](function(_0x2bdc49){if(_0x2bdc49&&_0x2bdc49[_0x6f5e('0x42')]){throw new db[(_0x6f5e('0xb7'))][(_0x6f5e('0xb8'))](_0x6f5e('0xb9'));}return _0x2bdc49;})[_0x6f5e('0x13')](removeEntity(_0x1c2645,null))[_0x6f5e('0x1d')](handleError(_0x1c2645,null));};exports[_0x6f5e('0xba')]=function(_0x86dd9a,_0x3de0c0){return db['MailAccount']['find']({'where':{'id':_0x86dd9a[_0x6f5e('0x63')]['id']}})['then'](handleEntityNotFound(_0x3de0c0,null))[_0x6f5e('0x13')](function(_0x80bc9){if(_0x80bc9){return _0x80bc9[_0x6f5e('0xba')](_0x86dd9a[_0x6f5e('0x65')][_0x6f5e('0x6f')],_[_0x6f5e('0xbb')](_0x86dd9a['body'],[_0x6f5e('0x6f'),'id'])||{})[_0x6f5e('0xbc')](function(_0x2208f9){for(var _0x306848=0x0;_0x306848<_0x86dd9a[_0x6f5e('0x65')][_0x6f5e('0x6f')]['length'];_0x306848+=0x1){socket[_0x6f5e('0xbd')](_0x6f5e('0xbe'),{'UserId':Number(_0x86dd9a['body']['ids'][_0x306848]),'MailAccountId':Number(_0x86dd9a[_0x6f5e('0x63')]['id'])});}return _0x2208f9;});}})[_0x6f5e('0x13')](respondWithResult(_0x3de0c0,null))[_0x6f5e('0x1d')](handleError(_0x3de0c0,null));};exports[_0x6f5e('0xbf')]=function(_0x1c6d30,_0x3cec24){return db[_0x6f5e('0x4b')][_0x6f5e('0x64')]({'where':{'id':_0x1c6d30[_0x6f5e('0x63')]['id']}})[_0x6f5e('0x13')](handleEntityNotFound(_0x3cec24,null))[_0x6f5e('0x13')](function(_0x72ff72){if(_0x72ff72){return _0x72ff72['removeAgents'](_0x1c6d30[_0x6f5e('0x51')][_0x6f5e('0x6f')])['then'](function(){if(_[_0x6f5e('0xc0')](_0x1c6d30[_0x6f5e('0x51')][_0x6f5e('0x6f')])){for(var _0x342d0e=0x0;_0x342d0e<_0x1c6d30[_0x6f5e('0x51')][_0x6f5e('0x6f')][_0x6f5e('0x6c')];_0x342d0e+=0x1){socket[_0x6f5e('0xbd')]('userMailAccount:remove',{'UserId':Number(_0x1c6d30['query']['ids'][_0x342d0e]),'MailAccountId':Number(_0x1c6d30['params']['id'])});}}else{socket[_0x6f5e('0xbd')]('userMailAccount:remove',{'UserId':Number(_0x1c6d30[_0x6f5e('0x51')][_0x6f5e('0x6f')]),'MailAccountId':Number(_0x1c6d30[_0x6f5e('0x63')]['id'])});}});}})['then'](respondWithStatusCode(_0x3cec24,null))[_0x6f5e('0x1d')](handleError(_0x3cec24,null));};exports['getAgents']=function(_0x58f7fe,_0x5e655f){var _0x1b156b={};var _0x319c15={};var _0x4b3d83;var _0x42101c;return db[_0x6f5e('0x4b')][_0x6f5e('0x6b')]({'where':{'id':_0x58f7fe[_0x6f5e('0x63')]['id']}})[_0x6f5e('0x13')](handleEntityNotFound(_0x5e655f,null))[_0x6f5e('0x13')](function(_0x3e381e){if(_0x3e381e){_0x4b3d83=_0x3e381e;_0x319c15[_0x6f5e('0x50')]=_[_0x6f5e('0x52')](db[_0x6f5e('0x8a')][_0x6f5e('0x4c')]);_0x319c15[_0x6f5e('0x51')]=_[_0x6f5e('0x52')](_0x58f7fe['query']);_0x319c15['filters']=_[_0x6f5e('0x54')](_0x319c15[_0x6f5e('0x50')],_0x319c15['query']);_0x1b156b['attributes']=_[_0x6f5e('0x54')](_0x319c15[_0x6f5e('0x50')],qs['fields'](_0x58f7fe['query']['fields']));_0x1b156b['attributes']=_0x1b156b[_0x6f5e('0x55')][_0x6f5e('0x6c')]?_0x1b156b[_0x6f5e('0x55')]:_0x319c15[_0x6f5e('0x50')];_0x1b156b[_0x6f5e('0x59')]=qs[_0x6f5e('0x5a')](_0x58f7fe[_0x6f5e('0x51')][_0x6f5e('0x5a')]);_0x1b156b['where']=qs[_0x6f5e('0x53')](_[_0x6f5e('0x6d')](_0x58f7fe[_0x6f5e('0x51')],_0x319c15[_0x6f5e('0x53')]));if(_0x58f7fe['query'][_0x6f5e('0x5c')]){_0x1b156b[_0x6f5e('0x5b')]=_[_0x6f5e('0x5d')](_0x1b156b[_0x6f5e('0x5b')],{'$or':_[_0x6f5e('0x4a')](_0x1b156b['attributes'],function(_0x414530){var _0x115b2f={};_0x115b2f[_0x414530]={'$like':'%'+_0x58f7fe[_0x6f5e('0x51')][_0x6f5e('0x5c')]+'%'};return _0x115b2f;})});}_0x1b156b=_[_0x6f5e('0x5d')]({},_0x1b156b,_0x58f7fe[_0x6f5e('0x5e')]);return _0x4b3d83[_0x6f5e('0xc1')](_0x1b156b);}})[_0x6f5e('0x13')](function(_0x4ec8cf){if(_0x4ec8cf){_0x42101c=_0x4ec8cf[_0x6f5e('0x6c')];if(!_0x58f7fe['query'][_0x6f5e('0x57')](_0x6f5e('0x58'))){_0x1b156b[_0x6f5e('0x24')]=qs[_0x6f5e('0x24')](_0x58f7fe[_0x6f5e('0x51')][_0x6f5e('0x24')]);_0x1b156b[_0x6f5e('0x22')]=qs[_0x6f5e('0x22')](_0x58f7fe[_0x6f5e('0x51')][_0x6f5e('0x22')]);}return _0x4b3d83[_0x6f5e('0xc1')](_0x1b156b);}})[_0x6f5e('0x13')](function(_0x1fea72){if(_0x1fea72){return _0x1fea72?{'count':_0x42101c,'rows':_0x1fea72}:null;}})[_0x6f5e('0x13')](respondWithResult(_0x5e655f,null))[_0x6f5e('0x1d')](handleError(_0x5e655f,null));}; \ No newline at end of file +var _0xd500=['imap.gmail.com','yahoo','imap.mail.yahoo.com','outlook.office365.com','Unknown\x20email\x20service\x20provider','smtp.gmail.com','smtp.mail.yahoo.com','smtp-mail.outlook.com','smtp.office365.com','user','username','password','pass','modernAuthentication','CloudProviderId','port','host','secure','service','authentication','Imap','Smtp','index','Pause','map','MailAccount','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','options','includeAll','findAll','rows','show','params','MailServerOut','mandatoryDispositionPause','include','find','body','provider','MailServerIn','describe','addDisposition','Disposition','create','getDispositions','removeDispositions','MailAccountId','getAnswers','findOne','CannedAnswer','removeAnswers','ids','custom','email','ListId','active','description','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','omit','getInteractions','MailInteraction','CmContact','Contact','User','Owner','Tag','Tags','color','tag','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority','getApplications','getMessages','MailMessage','$gte','format','split','CmList','List','Contacts','updatedAt','DESC','CloudProvider','isNil','from','%s\x20<%s>','attachments','join','root','server/files/attachments','SendMail','sendMail','List\x20not\x20found','attach','messageId','Interaction','Messages','verifySmtp','VerifySmtp','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','userMailAccount:save','removeAgents','isArray','emit','userMailAccount:remove','getAgents','moment','bluebird','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','jayson/promise','http','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','update','destroy','get','MailAccounts','UserProfileResource','stack','name','send','gmail'];(function(_0x3e5e43,_0x3b1739){var _0x1d31f8=function(_0x5f4b11){while(--_0x5f4b11){_0x3e5e43['push'](_0x3e5e43['shift']());}};_0x1d31f8(++_0x3b1739);}(_0xd500,0x8c));var _0x0d50=function(_0x3b231a,_0x53a00d){_0x3b231a=_0x3b231a-0x0;var _0x18d67a=_0xd500[_0x3b231a];return _0x18d67a;};'use strict';var moment=require(_0x0d50('0x0'));var BPromise=require(_0x0d50('0x1'));var util=require('util');var path=require('path');var _=require('lodash');var juice=require(_0x0d50('0x2'));var Redis=require(_0x0d50('0x3'));var qs=require(_0x0d50('0x4'));var logger=require(_0x0d50('0x5'))(_0x0d50('0x6'));var config=require(_0x0d50('0x7'));var db=require(_0x0d50('0x8'))['db'];config['redis']=_[_0x0d50('0x9')](config[_0x0d50('0xa')],{'host':_0x0d50('0xb'),'port':0x18eb});var socket=require(_0x0d50('0xc'))(new Redis(config[_0x0d50('0xa')]));require('./mailAccount.socket')['register'](socket);var jayson=require(_0x0d50('0xd'));var client=jayson['client'][_0x0d50('0xe')]({'port':0x232b});function respondWithRpcPromise(_0x4b88b4,_0x4808c5,_0x2510b1,_0x1bc472){return new BPromise(function(_0x22b771,_0x1cfd22){var _0x11bf96=_0x1bc472||client;return _0x11bf96[_0x0d50('0xf')](_0x4b88b4,_0x2510b1)[_0x0d50('0x10')](function(_0x248d6b){logger[_0x0d50('0x11')](_0x0d50('0x12'),_0x4808c5,_0x0d50('0x13'));logger['debug'](_0x0d50('0x14'),_0x4808c5,'request\x20sent',JSON[_0x0d50('0x15')](_0x248d6b));if(_0x248d6b[_0x0d50('0x16')]){if(_0x248d6b['error'][_0x0d50('0x17')]===0x1f4){logger['error'](_0x0d50('0x12'),_0x4808c5,_0x248d6b['error'][_0x0d50('0x18')]);return _0x1cfd22(_0x248d6b[_0x0d50('0x16')][_0x0d50('0x18')]);}logger['error']('MailAccount,\x20%s,\x20%s',_0x4808c5,_0x248d6b['error'][_0x0d50('0x18')]);return _0x22b771(_0x248d6b['error']['message']);}else{logger[_0x0d50('0x11')]('MailAccount,\x20%s,\x20%s',_0x4808c5,_0x0d50('0x13'));_0x22b771(_0x248d6b[_0x0d50('0x19')][_0x0d50('0x18')]);}})[_0x0d50('0x1a')](function(_0x42dd0f){logger[_0x0d50('0x16')]('MailAccount,\x20%s,\x20%s',_0x4808c5,_0x42dd0f);_0x1cfd22(_0x42dd0f);});});}function respondWithStatusCode(_0x2c980c,_0x508b08){_0x508b08=_0x508b08||0xcc;return function(_0x1c06b3){if(_0x1c06b3){return _0x2c980c[_0x0d50('0x1b')](_0x508b08);}return _0x2c980c['status'](_0x508b08)[_0x0d50('0x1c')]();};}function respondWithResult(_0x3dc933,_0x281e1f){_0x281e1f=_0x281e1f||0xc8;return function(_0x46d1c8){if(_0x46d1c8){return _0x3dc933[_0x0d50('0x1d')](_0x281e1f)[_0x0d50('0x1e')](_0x46d1c8);}};}function respondWithFilteredResult(_0xd0ee88,_0x3869ac){return function(_0xceae72){if(_0xceae72){var _0x5a9b07=typeof _0x3869ac['offset']===_0x0d50('0x1f')&&typeof _0x3869ac[_0x0d50('0x20')]===_0x0d50('0x1f');var _0x43e88c=_0xceae72[_0x0d50('0x21')];var _0x4b322c=_0x5a9b07?0x0:_0x3869ac[_0x0d50('0x22')];var _0x2595c6=_0x5a9b07?_0xceae72[_0x0d50('0x21')]:_0x3869ac[_0x0d50('0x22')]+_0x3869ac[_0x0d50('0x20')];var _0x295aae;if(_0x2595c6>=_0x43e88c){_0x2595c6=_0x43e88c;_0x295aae=0xc8;}else{_0x295aae=0xce;}_0xd0ee88[_0x0d50('0x1d')](_0x295aae);return _0xd0ee88[_0x0d50('0x23')](_0x0d50('0x24'),_0x4b322c+'-'+_0x2595c6+'/'+_0x43e88c)[_0x0d50('0x1e')](_0xceae72);}return null;};}function saveUpdates(_0x3f44fa){return function(_0x406ec1){if(_0x406ec1){return _0x406ec1[_0x0d50('0x25')](_0x3f44fa)[_0x0d50('0x10')](function(_0x33f36e){return _0x33f36e;});}return null;};}function removeEntity(_0x2762b8){return function(_0x4ccc30){if(_0x4ccc30){return _0x4ccc30[_0x0d50('0x26')]()['then'](function(){var _0x232ce3=_0x4ccc30[_0x0d50('0x27')]({'plain':!![]});var _0x13f58a=_0x0d50('0x28');return db[_0x0d50('0x29')][_0x0d50('0x26')]({'where':{'type':_0x13f58a,'resourceId':_0x232ce3['id']}})[_0x0d50('0x10')](function(){return _0x4ccc30;});})[_0x0d50('0x10')](function(){_0x2762b8[_0x0d50('0x1d')](0xcc)[_0x0d50('0x1c')]();});}};}function handleEntityNotFound(_0x48f0aa){return function(_0x473ba){if(!_0x473ba){_0x48f0aa[_0x0d50('0x1b')](0x194);}return _0x473ba;};}function handleError(_0x194a3f,_0x4c2dd6){_0x4c2dd6=_0x4c2dd6||0x1f4;return function(_0x294711){logger[_0x0d50('0x16')](_0x294711[_0x0d50('0x2a')]);if(_0x294711[_0x0d50('0x2b')]){delete _0x294711[_0x0d50('0x2b')];}_0x194a3f['status'](_0x4c2dd6)[_0x0d50('0x2c')](_0x294711);};}function getImapHost(_0x3e7c10){switch(_0x3e7c10){case _0x0d50('0x2d'):return _0x0d50('0x2e');case _0x0d50('0x2f'):return _0x0d50('0x30');case'hotmail':return'imap-mail.outlook.com';case'outlook365':return _0x0d50('0x31');}throw new Error(_0x0d50('0x32'),_0x3e7c10);}function getSmtpHost(_0x4cea23){switch(_0x4cea23){case _0x0d50('0x2d'):return _0x0d50('0x33');case'yahoo':return _0x0d50('0x34');case'hotmail':return _0x0d50('0x35');case'outlook365':return _0x0d50('0x36');}throw new Error('Unknown\x20email\x20service\x20provider',_0x4cea23);}function getAuthenticationOptions(_0x35fc43,_0x292382){var _0x2387a6={};var _0x3fddd4={};if(_0x35fc43){_0x2387a6[_0x0d50('0x37')]=_0x3fddd4['user']=_0x292382[_0x0d50('0x38')];_0x2387a6[_0x0d50('0x39')]=_0x3fddd4[_0x0d50('0x3a')]=_0x292382[_0x0d50('0x39')];if(_0x292382[_0x0d50('0x3b')]){_0x2387a6[_0x0d50('0x3b')]=_0x3fddd4['modernAuthentication']=!![];_0x2387a6['CloudProviderId']=_0x3fddd4[_0x0d50('0x3c')]=_0x292382[_0x0d50('0x3c')];_0x2387a6[_0x0d50('0x39')]=_0x3fddd4[_0x0d50('0x3a')]=null;}else{_0x2387a6['CloudProviderId']=_0x3fddd4[_0x0d50('0x3c')]=null;}_0x2387a6['host']=getImapHost(_0x35fc43);_0x2387a6[_0x0d50('0x3d')]=0x3e1;_0x3fddd4[_0x0d50('0x3e')]=getSmtpHost(_0x35fc43);_0x3fddd4[_0x0d50('0x3d')]=0x24b;_0x3fddd4[_0x0d50('0x3f')]=![];_0x2387a6[_0x0d50('0x40')]=_0x3fddd4[_0x0d50('0x40')]=null;}else{if(_0x292382[_0x0d50('0x41')]){_0x2387a6['user']=_0x3fddd4['user']=_0x292382[_0x0d50('0x38')];_0x2387a6['password']=_0x3fddd4[_0x0d50('0x3a')]=_0x292382[_0x0d50('0x39')];}else{_0x2387a6[_0x0d50('0x41')]=_0x3fddd4[_0x0d50('0x41')]=![];_0x2387a6[_0x0d50('0x37')]=_0x3fddd4[_0x0d50('0x37')]=null;_0x2387a6[_0x0d50('0x39')]=_0x3fddd4[_0x0d50('0x3a')]=null;}_0x2387a6['host']=_0x292382[_0x0d50('0x42')][_0x0d50('0x3e')];_0x2387a6['port']=_0x292382[_0x0d50('0x42')][_0x0d50('0x3d')];_0x3fddd4[_0x0d50('0x3e')]=_0x292382[_0x0d50('0x43')][_0x0d50('0x3e')];_0x3fddd4['port']=_0x292382[_0x0d50('0x43')][_0x0d50('0x3d')];}return{'Imap':_0x2387a6,'Smtp':_0x3fddd4};}exports[_0x0d50('0x44')]=function(_0xa8ef84,_0x1f1473){var _0x30681c={'include':[{'model':db['MailServerIn'],'as':_0x0d50('0x42')},{'model':db['MailServerOut'],'as':_0x0d50('0x43')},{'model':db[_0x0d50('0x45')],'as':'mandatoryDispositionPause'}]},_0x2d4951={},_0xd1f5ff={'count':0x0,'rows':[]};var _0x18a3f3=_[_0x0d50('0x46')](db[_0x0d50('0x47')][_0x0d50('0x48')],function(_0xfe97de){return{'name':_0xfe97de[_0x0d50('0x49')],'type':_0xfe97de['type']['key']};});_0x2d4951[_0x0d50('0x4a')]=_[_0x0d50('0x46')](_0x18a3f3,_0x0d50('0x2b'));_0x2d4951[_0x0d50('0x4b')]=_[_0x0d50('0x4c')](_0xa8ef84['query']);_0x2d4951[_0x0d50('0x4d')]=_[_0x0d50('0x4e')](_0x2d4951[_0x0d50('0x4a')],_0x2d4951['query']);_0x30681c['attributes']=_[_0x0d50('0x4e')](_0x2d4951[_0x0d50('0x4a')],qs[_0x0d50('0x4f')](_0xa8ef84['query']['fields']));_0x30681c[_0x0d50('0x50')]=_0x30681c[_0x0d50('0x50')][_0x0d50('0x51')]?_0x30681c[_0x0d50('0x50')]:_0x2d4951['model'];if(!_0xa8ef84[_0x0d50('0x4b')][_0x0d50('0x52')](_0x0d50('0x53'))){_0x30681c[_0x0d50('0x20')]=qs['limit'](_0xa8ef84['query'][_0x0d50('0x20')]);_0x30681c[_0x0d50('0x22')]=qs['offset'](_0xa8ef84['query']['offset']);}_0x30681c[_0x0d50('0x54')]=qs['sort'](_0xa8ef84['query'][_0x0d50('0x55')]);_0x30681c['where']=qs[_0x0d50('0x4d')](_[_0x0d50('0x56')](_0xa8ef84[_0x0d50('0x4b')],_0x2d4951[_0x0d50('0x4d')]),_0x18a3f3);if(_0xa8ef84[_0x0d50('0x4b')][_0x0d50('0x57')]){_0x30681c[_0x0d50('0x58')]=_[_0x0d50('0x59')](_0x30681c[_0x0d50('0x58')],{'$or':_[_0x0d50('0x46')](_0x18a3f3,function(_0x497901){if(_0x497901[_0x0d50('0x5a')]!=='VIRTUAL'){var _0x3d85fd={};_0x3d85fd[_0x497901[_0x0d50('0x2b')]]={'$like':'%'+_0xa8ef84['query'][_0x0d50('0x57')]+'%'};return _0x3d85fd;}})});}_0x30681c=_[_0x0d50('0x59')]({},_0x30681c,_0xa8ef84[_0x0d50('0x5b')]);var _0x2384c4={'where':_0x30681c[_0x0d50('0x58')]};return db[_0x0d50('0x47')][_0x0d50('0x21')](_0x2384c4)[_0x0d50('0x10')](function(_0x260562){_0xd1f5ff[_0x0d50('0x21')]=_0x260562;if(_0xa8ef84[_0x0d50('0x4b')][_0x0d50('0x5c')]){_0x30681c['include']=[{'all':!![]}];}return db['MailAccount'][_0x0d50('0x5d')](_0x30681c);})[_0x0d50('0x10')](function(_0x536203){_0xd1f5ff[_0x0d50('0x5e')]=_0x536203;return _0xd1f5ff;})[_0x0d50('0x10')](respondWithFilteredResult(_0x1f1473,_0x30681c))[_0x0d50('0x1a')](handleError(_0x1f1473,null));};exports[_0x0d50('0x5f')]=function(_0x17349e,_0x1c3678){var _0x2d0c01={'raw':![],'where':{'id':_0x17349e[_0x0d50('0x60')]['id']},'include':[{'model':db['MailServerIn'],'as':_0x0d50('0x42')},{'model':db[_0x0d50('0x61')],'as':_0x0d50('0x43')},{'model':db['Pause'],'as':_0x0d50('0x62')}]},_0x5deb9b={};_0x5deb9b['model']=_[_0x0d50('0x4c')](db[_0x0d50('0x47')][_0x0d50('0x48')]);_0x5deb9b['query']=_[_0x0d50('0x4c')](_0x17349e[_0x0d50('0x4b')]);_0x5deb9b[_0x0d50('0x4d')]=_['intersection'](_0x5deb9b[_0x0d50('0x4a')],_0x5deb9b[_0x0d50('0x4b')]);_0x2d0c01[_0x0d50('0x50')]=_['intersection'](_0x5deb9b[_0x0d50('0x4a')],qs[_0x0d50('0x4f')](_0x17349e['query']['fields']));_0x2d0c01['attributes']=_0x2d0c01[_0x0d50('0x50')]['length']?_0x2d0c01[_0x0d50('0x50')]:_0x5deb9b[_0x0d50('0x4a')];if(_0x17349e[_0x0d50('0x4b')][_0x0d50('0x5c')]){_0x2d0c01[_0x0d50('0x63')]=[{'all':!![]}];}_0x2d0c01=_[_0x0d50('0x59')]({},_0x2d0c01,_0x17349e[_0x0d50('0x5b')]);return db[_0x0d50('0x47')][_0x0d50('0x64')](_0x2d0c01)['then'](handleEntityNotFound(_0x1c3678,null))[_0x0d50('0x10')](respondWithResult(_0x1c3678,null))[_0x0d50('0x1a')](handleError(_0x1c3678,null));};exports['update']=function(_0x1e0355,_0x2830a1){if(_0x1e0355[_0x0d50('0x65')]['id']){delete _0x1e0355[_0x0d50('0x65')]['id'];}var _0x1ce9f1=_0x1e0355[_0x0d50('0x65')]['provider']==='custom'?null:_0x1e0355['body'][_0x0d50('0x66')];var _0x299538=_0x1e0355['body'][_0x0d50('0x42')]||{};var _0x5c9ae3=_0x1e0355[_0x0d50('0x65')][_0x0d50('0x43')]||{};if(_0x1ce9f1){_0x299538['host']=getImapHost(_0x1ce9f1);_0x299538[_0x0d50('0x3d')]=0x3e1;_0x5c9ae3['host']=getSmtpHost(_0x1ce9f1);_0x5c9ae3['port']=0x24b;_0x5c9ae3['secure']=![];}if(_0x5c9ae3[_0x0d50('0x3b')]){_0x5c9ae3[_0x0d50('0x3f')]=![];}else{_0x5c9ae3[_0x0d50('0x3c')]=null;}if(!_0x299538[_0x0d50('0x3b')])_0x299538[_0x0d50('0x3c')]=null;_0x1e0355[_0x0d50('0x65')][_0x0d50('0x42')]=_0x299538;_0x1e0355[_0x0d50('0x65')]['Smtp']=_0x5c9ae3;return db[_0x0d50('0x47')]['find']({'where':{'id':_0x1e0355['params']['id']},'include':[{'model':db[_0x0d50('0x67')],'as':_0x0d50('0x42')},{'model':db['MailServerOut'],'as':_0x0d50('0x43')},{'model':db['Pause'],'as':_0x0d50('0x62')}]})['then'](handleEntityNotFound(_0x2830a1,null))[_0x0d50('0x10')](function(_0x1fa46a){if(!_0x1fa46a)throw new Error('Mail\x20Account\x20not\x20found');if(_0x1fa46a['service'])delete _0x1e0355[_0x0d50('0x65')][_0x0d50('0x42')];return _0x1fa46a;})[_0x0d50('0x10')](saveUpdates(_0x1e0355[_0x0d50('0x65')],null))[_0x0d50('0x10')](function(_0x51ea99){if(!_0x1e0355[_0x0d50('0x65')][_0x0d50('0x42')])return _0x51ea99;return db['MailServerIn'][_0x0d50('0x25')](_0x1e0355['body'][_0x0d50('0x42')],{'where':{'MailAccountId':_0x51ea99['id']}})[_0x0d50('0x10')](function(){return _0x51ea99;});})[_0x0d50('0x10')](function(_0x37a6cc){if(!_0x1e0355[_0x0d50('0x65')][_0x0d50('0x43')])return _0x37a6cc;return db[_0x0d50('0x61')][_0x0d50('0x25')](_0x1e0355['body'][_0x0d50('0x43')],{'where':{'MailAccountId':_0x37a6cc['id']}})[_0x0d50('0x10')](function(){return _0x37a6cc;});})[_0x0d50('0x10')](respondWithResult(_0x2830a1,null))[_0x0d50('0x1a')](handleError(_0x2830a1,null));};exports[_0x0d50('0x68')]=function(_0x43b93c,_0x561e28){return db[_0x0d50('0x47')][_0x0d50('0x68')]()[_0x0d50('0x10')](respondWithResult(_0x561e28,null))[_0x0d50('0x1a')](handleError(_0x561e28,null));};exports[_0x0d50('0x69')]=function(_0x564c5,_0x283048){if(_0x564c5[_0x0d50('0x65')]['id']){delete _0x564c5['body']['id'];}return db[_0x0d50('0x47')][_0x0d50('0x64')]({'where':{'id':_0x564c5[_0x0d50('0x60')]['id']}})[_0x0d50('0x10')](handleEntityNotFound(_0x283048,null))[_0x0d50('0x10')](function(_0x285074){if(_0x285074){_0x564c5['body']['MailAccountId']=_0x285074['id'];return db[_0x0d50('0x6a')][_0x0d50('0x6b')](_0x564c5['body']);}})[_0x0d50('0x10')](respondWithResult(_0x283048,null))['catch'](handleError(_0x283048,null));};exports[_0x0d50('0x6c')]=function(_0x30ce57,_0x4b0a16){var _0x2cdd62={'raw':![],'where':{}};var _0x23d29d={};var _0x4a6cfe={'count':0x0,'rows':[]};return db[_0x0d50('0x47')]['findOne']({'where':{'id':_0x30ce57[_0x0d50('0x60')]['id']}})[_0x0d50('0x10')](handleEntityNotFound(_0x4b0a16,null))[_0x0d50('0x10')](function(_0x41b6ae){if(_0x41b6ae){_0x23d29d[_0x0d50('0x4a')]=_[_0x0d50('0x4c')](db['Disposition'][_0x0d50('0x48')]);_0x23d29d[_0x0d50('0x4b')]=_['keys'](_0x30ce57[_0x0d50('0x4b')]);_0x23d29d[_0x0d50('0x4d')]=_[_0x0d50('0x4e')](_0x23d29d[_0x0d50('0x4a')],_0x23d29d[_0x0d50('0x4b')]);_0x2cdd62[_0x0d50('0x50')]=_[_0x0d50('0x4e')](_0x23d29d[_0x0d50('0x4a')],qs[_0x0d50('0x4f')](_0x30ce57[_0x0d50('0x4b')][_0x0d50('0x4f')]));_0x2cdd62[_0x0d50('0x50')]=_0x2cdd62['attributes'][_0x0d50('0x51')]?_0x2cdd62[_0x0d50('0x50')]:_0x23d29d['model'];if(!_0x30ce57['query'][_0x0d50('0x52')](_0x0d50('0x53'))){_0x2cdd62[_0x0d50('0x20')]=qs['limit'](_0x30ce57[_0x0d50('0x4b')][_0x0d50('0x20')]);_0x2cdd62['offset']=qs[_0x0d50('0x22')](_0x30ce57[_0x0d50('0x4b')]['offset']);}_0x2cdd62[_0x0d50('0x54')]=qs[_0x0d50('0x55')](_0x30ce57[_0x0d50('0x4b')]['sort']);_0x2cdd62[_0x0d50('0x58')]=qs[_0x0d50('0x4d')](_['pick'](_0x30ce57[_0x0d50('0x4b')],_0x23d29d[_0x0d50('0x4d')]));_0x2cdd62[_0x0d50('0x58')]['MailAccountId']=_0x41b6ae['id'];if(_0x30ce57[_0x0d50('0x4b')][_0x0d50('0x57')]){_0x2cdd62[_0x0d50('0x58')]=_[_0x0d50('0x59')](_0x2cdd62[_0x0d50('0x58')],{'$or':_['map'](_0x2cdd62[_0x0d50('0x50')],function(_0x7c7d00){var _0x87c4a1={};_0x87c4a1[_0x7c7d00]={'$like':'%'+_0x30ce57[_0x0d50('0x4b')][_0x0d50('0x57')]+'%'};return _0x87c4a1;})});}_0x2cdd62=_[_0x0d50('0x59')]({},_0x2cdd62,_0x30ce57[_0x0d50('0x5b')]);return db[_0x0d50('0x6a')][_0x0d50('0x21')]({'where':_0x2cdd62[_0x0d50('0x58')]})['then'](function(_0xcf8c3f){_0x4a6cfe[_0x0d50('0x21')]=_0xcf8c3f;if(_0x30ce57[_0x0d50('0x4b')]['includeAll']){_0x2cdd62['include']=[{'all':!![]}];}return db['Disposition'][_0x0d50('0x5d')](_0x2cdd62);})['then'](function(_0xd8610a){_0x4a6cfe[_0x0d50('0x5e')]=_0xd8610a;return _0x4a6cfe;});}})['then'](respondWithFilteredResult(_0x4b0a16,_0x2cdd62))[_0x0d50('0x1a')](handleError(_0x4b0a16,null));};exports[_0x0d50('0x6d')]=function(_0x1947d0,_0x3db363){return db['MailAccount'][_0x0d50('0x64')]({'where':{'id':_0x1947d0[_0x0d50('0x60')]['id']}})[_0x0d50('0x10')](handleEntityNotFound(_0x3db363,null))[_0x0d50('0x10')](function(_0x4eaf51){if(_0x4eaf51){return _0x4eaf51[_0x0d50('0x6d')](_0x1947d0[_0x0d50('0x4b')]['ids']);}})[_0x0d50('0x10')](respondWithStatusCode(_0x3db363,null))['catch'](handleError(_0x3db363,null));};exports['addAnswer']=function(_0x5d1cef,_0x1d5923){if(_0x5d1cef[_0x0d50('0x65')]['id']){delete _0x5d1cef[_0x0d50('0x65')]['id'];}return db['MailAccount'][_0x0d50('0x64')]({'where':{'id':_0x5d1cef[_0x0d50('0x60')]['id']}})[_0x0d50('0x10')](handleEntityNotFound(_0x1d5923,null))[_0x0d50('0x10')](function(_0x1cad1e){if(_0x1cad1e){_0x5d1cef[_0x0d50('0x65')][_0x0d50('0x6e')]=_0x1cad1e['id'];return db['CannedAnswer']['create'](_0x5d1cef['body']);}})[_0x0d50('0x10')](respondWithResult(_0x1d5923,null))[_0x0d50('0x1a')](handleError(_0x1d5923,null));};exports[_0x0d50('0x6f')]=function(_0x59a100,_0x4657d7){var _0x15d1cc={'raw':![],'where':{}};var _0x45de85={};var _0x412a12={'count':0x0,'rows':[]};return db[_0x0d50('0x47')][_0x0d50('0x70')]({'where':{'id':_0x59a100[_0x0d50('0x60')]['id']}})[_0x0d50('0x10')](handleEntityNotFound(_0x4657d7,null))['then'](function(_0x4ac6a1){if(_0x4ac6a1){_0x45de85[_0x0d50('0x4a')]=_['keys'](db[_0x0d50('0x71')][_0x0d50('0x48')]);_0x45de85[_0x0d50('0x4b')]=_[_0x0d50('0x4c')](_0x59a100['query']);_0x45de85[_0x0d50('0x4d')]=_[_0x0d50('0x4e')](_0x45de85[_0x0d50('0x4a')],_0x45de85[_0x0d50('0x4b')]);_0x15d1cc['attributes']=_[_0x0d50('0x4e')](_0x45de85[_0x0d50('0x4a')],qs['fields'](_0x59a100[_0x0d50('0x4b')][_0x0d50('0x4f')]));_0x15d1cc[_0x0d50('0x50')]=_0x15d1cc['attributes'][_0x0d50('0x51')]?_0x15d1cc['attributes']:_0x45de85[_0x0d50('0x4a')];if(!_0x59a100['query'][_0x0d50('0x52')](_0x0d50('0x53'))){_0x15d1cc[_0x0d50('0x20')]=qs[_0x0d50('0x20')](_0x59a100[_0x0d50('0x4b')][_0x0d50('0x20')]);_0x15d1cc[_0x0d50('0x22')]=qs[_0x0d50('0x22')](_0x59a100[_0x0d50('0x4b')]['offset']);}_0x15d1cc[_0x0d50('0x54')]=qs[_0x0d50('0x55')](_0x59a100['query'][_0x0d50('0x55')]);_0x15d1cc[_0x0d50('0x58')]=qs['filters'](_['pick'](_0x59a100[_0x0d50('0x4b')],_0x45de85[_0x0d50('0x4d')]));_0x15d1cc[_0x0d50('0x58')][_0x0d50('0x6e')]=_0x4ac6a1['id'];if(_0x59a100[_0x0d50('0x4b')][_0x0d50('0x57')]){_0x15d1cc[_0x0d50('0x58')]=_[_0x0d50('0x59')](_0x15d1cc[_0x0d50('0x58')],{'$or':_[_0x0d50('0x46')](_0x15d1cc[_0x0d50('0x50')],function(_0x4c1ebe){var _0x26e5c9={};_0x26e5c9[_0x4c1ebe]={'$like':'%'+_0x59a100['query']['filter']+'%'};return _0x26e5c9;})});}_0x15d1cc=_[_0x0d50('0x59')]({},_0x15d1cc,_0x59a100['options']);return db['CannedAnswer'][_0x0d50('0x21')]({'where':_0x15d1cc[_0x0d50('0x58')]})[_0x0d50('0x10')](function(_0x570d80){_0x412a12[_0x0d50('0x21')]=_0x570d80;if(_0x59a100[_0x0d50('0x4b')][_0x0d50('0x5c')]){_0x15d1cc[_0x0d50('0x63')]=[{'all':!![]}];}return db[_0x0d50('0x71')][_0x0d50('0x5d')](_0x15d1cc);})[_0x0d50('0x10')](function(_0x461a05){_0x412a12[_0x0d50('0x5e')]=_0x461a05;return _0x412a12;});}})[_0x0d50('0x10')](respondWithFilteredResult(_0x4657d7,_0x15d1cc))['catch'](handleError(_0x4657d7,null));};exports[_0x0d50('0x72')]=function(_0x5a5d6a,_0x890a79){return db[_0x0d50('0x47')][_0x0d50('0x64')]({'where':{'id':_0x5a5d6a[_0x0d50('0x60')]['id']}})['then'](handleEntityNotFound(_0x890a79,null))[_0x0d50('0x10')](function(_0x482401){if(_0x482401){return _0x482401['removeAnswers'](_0x5a5d6a[_0x0d50('0x4b')][_0x0d50('0x73')]);}})['then'](respondWithStatusCode(_0x890a79,null))[_0x0d50('0x1a')](handleError(_0x890a79,null));};exports[_0x0d50('0x6b')]=function(_0x42957e,_0x4cfe7d){var _0x3761a7={'name':_0x42957e[_0x0d50('0x65')][_0x0d50('0x2b')],'key':_0x42957e[_0x0d50('0x65')]['key'],'provider':_0x42957e[_0x0d50('0x65')]['provider']===_0x0d50('0x74')?null:_0x42957e[_0x0d50('0x65')][_0x0d50('0x66')],'email':_0x42957e['body'][_0x0d50('0x75')],'ListId':_0x42957e[_0x0d50('0x65')][_0x0d50('0x76')],'active':!_['isNil'](_0x42957e['body'][_0x0d50('0x77')])?_0x42957e[_0x0d50('0x65')][_0x0d50('0x77')]:!![],'description':_0x42957e[_0x0d50('0x65')][_0x0d50('0x78')]||null};var _0x23757c=getAuthenticationOptions(_0x3761a7['provider'],_0x42957e[_0x0d50('0x65')]);_0x3761a7[_0x0d50('0x42')]=_0x23757c['Imap'];_0x3761a7['Smtp']=_0x23757c[_0x0d50('0x43')];return db[_0x0d50('0x47')][_0x0d50('0x6b')](_0x3761a7,{'include':[{'model':db[_0x0d50('0x61')],'as':_0x0d50('0x43')},{'model':db['MailServerIn'],'as':_0x0d50('0x42')}]})['then'](function(_0x2fbee7){var _0x4d2c28=_0x42957e[_0x0d50('0x37')][_0x0d50('0x27')]({'plain':!![]});if(!_0x4d2c28)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4d2c28[_0x0d50('0x79')]===_0x0d50('0x37')){var _0x2cdcd7=_0x2fbee7[_0x0d50('0x27')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x0d50('0x28'),'userProfileId':_0x4d2c28['userProfileId']},'raw':!![]})[_0x0d50('0x10')](function(_0x1f4e7a){if(_0x1f4e7a&&_0x1f4e7a['autoAssociation']===0x0){return db['UserProfileResource'][_0x0d50('0x6b')]({'name':_0x2cdcd7[_0x0d50('0x2b')],'resourceId':_0x2cdcd7['id'],'type':_0x1f4e7a[_0x0d50('0x2b')],'sectionId':_0x1f4e7a['id']},{})[_0x0d50('0x10')](function(){return _0x2fbee7;});}else{return _0x2fbee7;}})['catch'](function(_0x2d2f6f){logger[_0x0d50('0x16')](_0x0d50('0x7a'),_0x2d2f6f);throw _0x2d2f6f;});}return _0x2fbee7;})['then'](respondWithResult(_0x4cfe7d,0xc9))[_0x0d50('0x1a')](handleError(_0x4cfe7d,null));};exports[_0x0d50('0x7b')]=function(_0xe38c70,_0x36fb44){return db[_0x0d50('0x47')]['findOne']({'where':{'id':_0xe38c70[_0x0d50('0x60')]['id']}})[_0x0d50('0x10')](handleEntityNotFound(_0x36fb44,null))['then'](function(_0x2f7378){if(_0x2f7378){return _0x2f7378[_0x0d50('0x7b')]();}return null;})[_0x0d50('0x10')](respondWithResult(_0x36fb44,null))[_0x0d50('0x1a')](handleError(_0x36fb44,null));};exports[_0x0d50('0x7c')]=function(_0x53f379,_0x17f155){if(_0x53f379[_0x0d50('0x65')]['id']){delete _0x53f379[_0x0d50('0x65')]['id'];}return db[_0x0d50('0x47')][_0x0d50('0x64')]({'where':{'id':_0x53f379['params']['id']}})[_0x0d50('0x10')](handleEntityNotFound(_0x17f155,null))[_0x0d50('0x10')](function(_0x3d7c38){if(_0x3d7c38){_0x53f379[_0x0d50('0x65')][_0x0d50('0x6e')]=_0x3d7c38['id'];return db['MailServerIn'][_0x0d50('0x6b')](_0x53f379[_0x0d50('0x65')]);}})[_0x0d50('0x10')](respondWithResult(_0x17f155,null))['catch'](handleError(_0x17f155,null));};exports['removeImap']=function(_0x13d13d,_0x2e29fe){return db[_0x0d50('0x47')][_0x0d50('0x70')]({'where':{'id':_0x13d13d[_0x0d50('0x60')]['id']}})[_0x0d50('0x10')](handleEntityNotFound(_0x2e29fe,null))[_0x0d50('0x10')](function(_0x52cef4){if(_0x52cef4){return _0x52cef4['setImap'](null);}return null;})['then'](respondWithStatusCode(_0x2e29fe,null))[_0x0d50('0x1a')](handleError(_0x2e29fe,null));};exports[_0x0d50('0x7d')]=function(_0x39201b,_0xc9475e){return db['MailAccount'][_0x0d50('0x70')]({'where':{'id':_0x39201b[_0x0d50('0x60')]['id']}})[_0x0d50('0x10')](handleEntityNotFound(_0xc9475e,null))[_0x0d50('0x10')](function(_0x3a60f4){if(_0x3a60f4){return _0x3a60f4['getSmtp']();}return null;})[_0x0d50('0x10')](respondWithResult(_0xc9475e,null))[_0x0d50('0x1a')](handleError(_0xc9475e,null));};exports[_0x0d50('0x7e')]=function(_0x15649d,_0x1a8394){if(_0x15649d[_0x0d50('0x65')]['id']){delete _0x15649d[_0x0d50('0x65')]['id'];}return db['MailAccount'][_0x0d50('0x64')]({'where':{'id':_0x15649d[_0x0d50('0x60')]['id']}})[_0x0d50('0x10')](handleEntityNotFound(_0x1a8394,null))[_0x0d50('0x10')](function(_0x36c833){if(_0x36c833){_0x15649d[_0x0d50('0x65')][_0x0d50('0x6e')]=_0x36c833['id'];return db['MailServerOut'][_0x0d50('0x6b')](_0x15649d[_0x0d50('0x65')]);}})[_0x0d50('0x10')](respondWithResult(_0x1a8394,null))[_0x0d50('0x1a')](handleError(_0x1a8394,null));};exports[_0x0d50('0x7f')]=function(_0x13b78f,_0x184d69){return db[_0x0d50('0x47')][_0x0d50('0x70')]({'where':{'id':_0x13b78f[_0x0d50('0x60')]['id']}})[_0x0d50('0x10')](handleEntityNotFound(_0x184d69,null))[_0x0d50('0x10')](function(_0x5e9f8e){if(_0x5e9f8e){return _0x5e9f8e[_0x0d50('0x80')](null);}return null;})[_0x0d50('0x10')](respondWithStatusCode(_0x184d69,null))[_0x0d50('0x1a')](handleError(_0x184d69,null));};exports[_0x0d50('0x81')]=function(_0x3d6c0e,_0x8b2e91){return db['MailInteraction']['find']({'where':{'id':_0x3d6c0e[_0x0d50('0x60')]['id']}})['then'](handleEntityNotFound(_0x8b2e91,null))['then'](function(_0x5684e7){if(_0x5684e7){return _0x5684e7[_0x0d50('0x81')](_0x3d6c0e[_0x0d50('0x65')]['ids'],_[_0x0d50('0x82')](_0x3d6c0e[_0x0d50('0x65')],[_0x0d50('0x73'),'id'])||{});}})['then'](respondWithResult(_0x8b2e91,null))['catch'](handleError(_0x8b2e91,null));};exports[_0x0d50('0x83')]=function(_0x465281,_0x537a2c){var _0x5ad255={'raw':![],'where':{}};var _0x565e51={};var _0x34be6a={'count':0x0,'rows':[]};return db[_0x0d50('0x47')][_0x0d50('0x70')]({'where':{'id':_0x465281[_0x0d50('0x60')]['id']}})[_0x0d50('0x10')](handleEntityNotFound(_0x537a2c,null))['then'](function(_0xc0259a){if(_0xc0259a){_0x565e51[_0x0d50('0x4a')]=_[_0x0d50('0x4c')](db['MailInteraction'][_0x0d50('0x48')]);_0x565e51[_0x0d50('0x4b')]=_[_0x0d50('0x4c')](_0x465281[_0x0d50('0x4b')]);_0x565e51['filters']=_[_0x0d50('0x4e')](_0x565e51[_0x0d50('0x4a')],_0x565e51[_0x0d50('0x4b')]);_0x5ad255[_0x0d50('0x50')]=_[_0x0d50('0x4e')](_0x565e51['model'],qs[_0x0d50('0x4f')](_0x465281['query'][_0x0d50('0x4f')]));_0x5ad255['attributes']=_0x5ad255[_0x0d50('0x50')][_0x0d50('0x51')]?_0x5ad255['attributes']:_0x565e51['model'];if(!_0x465281['query'][_0x0d50('0x52')](_0x0d50('0x53'))){_0x5ad255['limit']=qs[_0x0d50('0x20')](_0x465281[_0x0d50('0x4b')]['limit']);_0x5ad255[_0x0d50('0x22')]=qs[_0x0d50('0x22')](_0x465281[_0x0d50('0x4b')][_0x0d50('0x22')]);}_0x5ad255[_0x0d50('0x54')]=qs['sort'](_0x465281['query'][_0x0d50('0x55')]);_0x5ad255[_0x0d50('0x58')]=qs[_0x0d50('0x4d')](_[_0x0d50('0x56')](_0x465281[_0x0d50('0x4b')],_0x565e51[_0x0d50('0x4d')]));_0x5ad255['where'][_0x0d50('0x6e')]=_0xc0259a['id'];if(_0x465281[_0x0d50('0x4b')][_0x0d50('0x57')]){_0x5ad255[_0x0d50('0x58')]=_[_0x0d50('0x59')](_0x5ad255[_0x0d50('0x58')],{'$or':_[_0x0d50('0x46')](_0x5ad255['attributes'],function(_0x32c3f9){var _0x15081d={};_0x15081d[_0x32c3f9]={'$like':'%'+_0x465281[_0x0d50('0x4b')][_0x0d50('0x57')]+'%'};return _0x15081d;})});}_0x5ad255=_['merge']({},_0x5ad255,_0x465281[_0x0d50('0x5b')]);return db[_0x0d50('0x84')][_0x0d50('0x21')]({'where':_0x5ad255[_0x0d50('0x58')]})['then'](function(_0x5c8d04){_0x34be6a[_0x0d50('0x21')]=_0x5c8d04;if(_0x465281[_0x0d50('0x4b')][_0x0d50('0x5c')]){_0x5ad255[_0x0d50('0x63')]=[{'model':db[_0x0d50('0x85')],'as':_0x0d50('0x86'),'required':![]},{'model':db[_0x0d50('0x87')],'as':_0x0d50('0x88'),'attributes':[_0x0d50('0x2b'),'fullname','internal'],'required':![]},{'model':db[_0x0d50('0x89')],'as':_0x0d50('0x8a'),'attributes':['id',_0x0d50('0x2b'),_0x0d50('0x8b')],'where':_0x465281[_0x0d50('0x4b')][_0x0d50('0x8c')]?{'id':_0x465281[_0x0d50('0x4b')][_0x0d50('0x8c')]}:undefined,'required':_0x465281[_0x0d50('0x4b')]['tag']?!![]:![]}];}return db['MailInteraction']['findAll'](_0x5ad255);})['then'](function(_0x536c56){_0x34be6a[_0x0d50('0x5e')]=_0x536c56;return _0x34be6a;});}})[_0x0d50('0x10')](respondWithFilteredResult(_0x537a2c,_0x5ad255))[_0x0d50('0x1a')](handleError(_0x537a2c,null));};exports[_0x0d50('0x8d')]=function addApplications(_0x438fa5,_0x4d60a8){var _0x5e9295=_0x438fa5[_0x0d50('0x60')]['id'];var _0x43b83a=_0x438fa5[_0x0d50('0x65')];var _0x374c7a=0xc8;var _0x3c2390=null;return db[_0x0d50('0x8e')][_0x0d50('0x8f')]({'isolationLevel':db['sequelize'][_0x0d50('0x90')]['ISOLATION_LEVELS'][_0x0d50('0x91')]},function(_0x836e5c){return db[_0x0d50('0x47')][_0x0d50('0x70')]({'where':{'id':_0x5e9295},'transaction':_0x836e5c})[_0x0d50('0x10')](function(_0x41d03b){if(_0x41d03b){return db['MailApplication'][_0x0d50('0x26')]({'where':{'MailAccountId':_0x5e9295},'transaction':_0x836e5c})['then'](function(){var _0x141fc2=_[_0x0d50('0x46')](_0x43b83a,function(_0x2ae1b9){_0x2ae1b9[_0x0d50('0x6e')]=_0x5e9295;return _0x2ae1b9;});return db[_0x0d50('0x92')][_0x0d50('0x93')](_0x141fc2,{'transaction':_0x836e5c});});}else{_0x374c7a=0x194;_0x3c2390=[];}});})[_0x0d50('0x10')](function(){if(_0x374c7a!==0x194){return db['MailApplication'][_0x0d50('0x94')]({'where':{'MailAccountId':_0x5e9295},'order':_0x0d50('0x95')})[_0x0d50('0x10')](function(_0x3fb6e0){_0x3c2390=_0x3fb6e0;});}})[_0x0d50('0x1a')](function(_0xaee7eb){_0x374c7a=0x1f4;logger[_0x0d50('0x16')](_0xaee7eb[_0x0d50('0x2a')]);if(_0xaee7eb[_0x0d50('0x2b')]){delete _0xaee7eb[_0x0d50('0x2b')];}_0x3c2390=_0xaee7eb;})['finally'](function(){if(_0x3c2390===null){_0x4d60a8[_0x0d50('0x1b')](_0x374c7a);}else{if(_0x374c7a===0x1f4){_0x4d60a8[_0x0d50('0x1d')](_0x374c7a)[_0x0d50('0x2c')](_0x3c2390);}else{_0x4d60a8[_0x0d50('0x1d')](_0x374c7a)[_0x0d50('0x1e')](_0x3c2390);}}});};exports[_0x0d50('0x96')]=function(_0x205453,_0x2a21c8){var _0x5bf58b={};var _0x184e07={};var _0x569cce;var _0x4c6b37;return db[_0x0d50('0x47')][_0x0d50('0x70')]({'where':{'id':_0x205453['params']['id']}})[_0x0d50('0x10')](handleEntityNotFound(_0x2a21c8,null))[_0x0d50('0x10')](function(_0x5ab07e){if(_0x5ab07e){_0x569cce=_0x5ab07e;_0x184e07[_0x0d50('0x4a')]=_[_0x0d50('0x4c')](db[_0x0d50('0x92')][_0x0d50('0x48')]);_0x184e07['query']=_['keys'](_0x205453[_0x0d50('0x4b')]);_0x184e07[_0x0d50('0x4d')]=_['intersection'](_0x184e07[_0x0d50('0x4a')],_0x184e07[_0x0d50('0x4b')]);_0x5bf58b[_0x0d50('0x50')]=_[_0x0d50('0x4e')](_0x184e07[_0x0d50('0x4a')],qs[_0x0d50('0x4f')](_0x205453[_0x0d50('0x4b')]['fields']));_0x5bf58b['attributes']=_0x5bf58b['attributes'][_0x0d50('0x51')]?_0x5bf58b['attributes']:_0x184e07[_0x0d50('0x4a')];_0x5bf58b['order']=qs[_0x0d50('0x55')](_0x205453[_0x0d50('0x4b')]['sort']);_0x5bf58b[_0x0d50('0x58')]=qs[_0x0d50('0x4d')](_[_0x0d50('0x56')](_0x205453['query'],_0x184e07[_0x0d50('0x4d')]));if(_0x205453[_0x0d50('0x4b')]['filter']){_0x5bf58b[_0x0d50('0x58')]=_[_0x0d50('0x59')](_0x5bf58b['where'],{'$or':_[_0x0d50('0x46')](_0x5bf58b[_0x0d50('0x50')],function(_0x19cc1f){var _0xfd03d1={};_0xfd03d1[_0x19cc1f]={'$like':'%'+_0x205453[_0x0d50('0x4b')][_0x0d50('0x57')]+'%'};return _0xfd03d1;})});}_0x5bf58b=_[_0x0d50('0x59')]({},_0x5bf58b,_0x205453[_0x0d50('0x5b')]);return _0x569cce[_0x0d50('0x96')](_0x5bf58b);}})[_0x0d50('0x10')](function(_0x13a037){if(_0x13a037){_0x4c6b37=_0x13a037[_0x0d50('0x51')];if(!_0x205453['query'][_0x0d50('0x52')](_0x0d50('0x53'))){_0x5bf58b['limit']=qs[_0x0d50('0x20')](_0x205453[_0x0d50('0x4b')][_0x0d50('0x20')]);_0x5bf58b[_0x0d50('0x22')]=qs[_0x0d50('0x22')](_0x205453[_0x0d50('0x4b')][_0x0d50('0x22')]);}return _0x569cce[_0x0d50('0x96')](_0x5bf58b);}})[_0x0d50('0x10')](function(_0x3411b6){if(_0x3411b6){return _0x3411b6?{'count':_0x4c6b37,'rows':_0x3411b6}:null;}})[_0x0d50('0x10')](respondWithResult(_0x2a21c8,null))[_0x0d50('0x1a')](handleError(_0x2a21c8,null));};exports[_0x0d50('0x97')]=function(_0x37698c,_0x161b53){var _0x419aa1={'raw':!![],'where':{}};var _0x1ee0ad={};var _0x596da4={'count':0x0,'rows':[]};return db[_0x0d50('0x47')][_0x0d50('0x70')]({'where':{'id':_0x37698c[_0x0d50('0x60')]['id']}})[_0x0d50('0x10')](handleEntityNotFound(_0x161b53,null))[_0x0d50('0x10')](function(_0x574849){if(_0x574849){_0x1ee0ad[_0x0d50('0x4a')]=_[_0x0d50('0x4c')](db[_0x0d50('0x98')][_0x0d50('0x48')]);_0x1ee0ad[_0x0d50('0x4b')]=_['keys'](_0x37698c[_0x0d50('0x4b')]);_0x1ee0ad[_0x0d50('0x4d')]=_[_0x0d50('0x4e')](_0x1ee0ad[_0x0d50('0x4a')],_0x1ee0ad[_0x0d50('0x4b')]);_0x419aa1[_0x0d50('0x50')]=_['intersection'](_0x1ee0ad[_0x0d50('0x4a')],qs[_0x0d50('0x4f')](_0x37698c[_0x0d50('0x4b')][_0x0d50('0x4f')]));_0x419aa1['attributes']=_0x419aa1['attributes'][_0x0d50('0x51')]?_0x419aa1['attributes']:_0x1ee0ad['model'];if(!_0x37698c[_0x0d50('0x4b')][_0x0d50('0x52')](_0x0d50('0x53'))){_0x419aa1['limit']=qs[_0x0d50('0x20')](_0x37698c[_0x0d50('0x4b')]['limit']);_0x419aa1[_0x0d50('0x22')]=qs['offset'](_0x37698c[_0x0d50('0x4b')][_0x0d50('0x22')]);}_0x419aa1[_0x0d50('0x54')]=qs['sort'](_0x37698c[_0x0d50('0x4b')]['sort']);_0x419aa1[_0x0d50('0x58')]=qs[_0x0d50('0x4d')](_[_0x0d50('0x56')](_0x37698c[_0x0d50('0x4b')],_0x1ee0ad['filters']));_0x419aa1[_0x0d50('0x58')][_0x0d50('0x6e')]=_0x574849['id'];if(_0x37698c[_0x0d50('0x4b')][_0x0d50('0x57')]){_0x419aa1[_0x0d50('0x58')]=_[_0x0d50('0x59')](_0x419aa1[_0x0d50('0x58')],{'$or':_[_0x0d50('0x46')](_0x419aa1['attributes'],function(_0x39c081){var _0x4a8a88={};_0x4a8a88[_0x39c081]={'$like':'%'+_0x37698c['query'][_0x0d50('0x57')]+'%'};return _0x4a8a88;})});}if(_0x37698c['query'][_0x0d50('0x99')]){var _0x4f5912=_0x37698c['query'][_0x0d50('0x99')]['split'](',');var _0x36ac7e={};_0x36ac7e[_0x4f5912[0x0]]={'$gte':moment(_0x4f5912[0x1])[_0x0d50('0x9a')]('YYYY-MM-DD\x20HH:mm:ss')};_0x419aa1[_0x0d50('0x58')]=_[_0x0d50('0x59')](_0x419aa1[_0x0d50('0x58')],_0x36ac7e);}_0x419aa1=_[_0x0d50('0x59')]({},_0x419aa1,_0x37698c[_0x0d50('0x5b')]);return db[_0x0d50('0x98')][_0x0d50('0x21')]({'where':_0x419aa1['where']})['then'](function(_0x4172e0){_0x596da4[_0x0d50('0x21')]=_0x4172e0;if(_0x37698c['query'][_0x0d50('0x5c')]){_0x419aa1[_0x0d50('0x63')]=[{'all':!![]}];}return db[_0x0d50('0x98')][_0x0d50('0x5d')](_0x419aa1);})[_0x0d50('0x10')](function(_0x6a6338){if(_0x37698c['query']['inlineCss']==='true'){for(var _0xbee066=0x0;_0xbee066<_0x6a6338[_0x0d50('0x51')];_0xbee066++){_0x6a6338[_0xbee066][_0x0d50('0x65')]=juice(_0x6a6338[_0xbee066]['body']);}}_0x596da4[_0x0d50('0x5e')]=_0x6a6338;return _0x596da4;});}})[_0x0d50('0x10')](respondWithFilteredResult(_0x161b53,_0x419aa1))[_0x0d50('0x1a')](handleError(_0x161b53,null));};exports[_0x0d50('0x2c')]=function(_0x284982,_0x4dd504){var _0x2d0947,_0x105133={},_0x30cb9a;if(_0x284982[_0x0d50('0x65')]['to']){_0x30cb9a=_0x284982[_0x0d50('0x65')]['to'][_0x0d50('0x9b')](',')[0x0];}return db['MailAccount'][_0x0d50('0x64')]({'where':{'id':_0x284982[_0x0d50('0x60')]['id']},'include':[{'model':db[_0x0d50('0x9c')],'as':_0x0d50('0x9d'),'include':[{'model':db[_0x0d50('0x85')],'as':_0x0d50('0x9e'),'where':{'email':_0x30cb9a},'limit':0x1,'order':[[_0x0d50('0x9f'),_0x0d50('0xa0')]]}]},{'model':db[_0x0d50('0x61')],'as':_0x0d50('0x43'),'raw':!![],'include':[{'model':db[_0x0d50('0xa1')],'as':'CloudProvider','raw':!![]}]}]})[_0x0d50('0x10')](handleEntityNotFound(_0x4dd504,null))[_0x0d50('0x10')](function(_0x2d0eb7){if(!_0x2d0eb7)return;_0x2d0947=_0x2d0eb7;if(!_0x2d0eb7[_0x0d50('0x43')])throw new Error('Smtp\x20configuration\x20not\x20found');if(_[_0x0d50('0xa2')](_0x284982[_0x0d50('0x65')][_0x0d50('0xa3')])){_0x284982[_0x0d50('0x65')]['from']=util['format'](_0x0d50('0xa4'),_0x2d0eb7[_0x0d50('0x2b')],_0x2d0eb7[_0x0d50('0x75')]||_0x2d0eb7[_0x0d50('0x43')][_0x0d50('0x37')]);}if(_0x284982[_0x0d50('0x65')]['attachments']&&_0x284982[_0x0d50('0x65')]['attachments'][_0x0d50('0x51')]){for(var _0x26a898=0x0;_0x26a898<_0x284982[_0x0d50('0x65')]['attachments']['length'];_0x26a898+=0x1){_0x284982['body'][_0x0d50('0xa5')][_0x26a898]={'filename':_0x284982[_0x0d50('0x65')]['attachments'][_0x26a898][_0x0d50('0x2b')],'path':path[_0x0d50('0xa6')](config[_0x0d50('0xa7')],_0x0d50('0xa8'),_0x284982[_0x0d50('0x65')][_0x0d50('0xa5')][_0x26a898]['basename'])};}}var _0x347c6f=_0x2d0eb7['getSmtpOptions']();return respondWithRpcPromise(_0x0d50('0xa9'),_0x0d50('0xaa'),{'account':_0x347c6f,'message':_0x284982[_0x0d50('0x65')]});})[_0x0d50('0x10')](function(_0x37dbdf){if(!_0x37dbdf)return;_0x105133=_0x37dbdf;if(!_0x2d0947['List'])throw new Error(_0x0d50('0xab'));if(_0x2d0947['List'][_0x0d50('0x9e')][_0x0d50('0x51')])return _0x2d0947['List'][_0x0d50('0x9e')][0x0];return db[_0x0d50('0x85')][_0x0d50('0x6b')](_[_0x0d50('0x9')](_0x284982[_0x0d50('0x65')],{'firstName':_0x284982[_0x0d50('0x65')]['to'],'email':_0x284982[_0x0d50('0x65')]['to'],'phone':_0x284982['body']['to'],'ListId':_0x2d0947[_0x0d50('0x76')]}));})['then'](function(_0x45cefd){if(!_0x45cefd)return;var _0xddc389={'UserId':_0x284982['user']['id'],'ContactId':_0x45cefd['id'],'MailAccountId':_0x2d0947['id'],'inReplyTo':_0x105133['messageId'],'to':_0x284982[_0x0d50('0x65')][_0x0d50('0xa3')],'cc':_0x284982[_0x0d50('0x65')]['cc'],'subject':_0x284982[_0x0d50('0x65')]['subject'],'attach':_0x284982[_0x0d50('0x65')][_0x0d50('0xac')],'firstMsgDirection':'out','lastMsgAt':moment()[_0x0d50('0x9a')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'out','Messages':[_[_0x0d50('0x59')](_0x284982[_0x0d50('0x65')],{'messageId':_0x105133[_0x0d50('0xad')],'sentAt':moment()[_0x0d50('0x9a')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x2d0947['id'],'UserId':_0x284982[_0x0d50('0x37')]['id'],'ContactId':_0x45cefd['id']})]};if(_0x284982['body'][_0x0d50('0xae')]){_0xddc389=_[_0x0d50('0x59')](_0xddc389,_0x284982[_0x0d50('0x65')][_0x0d50('0xae')]);}return db['MailInteraction'][_0x0d50('0x6b')](_0xddc389,{'include':[{'model':db['MailMessage'],'as':_0x0d50('0xaf')}]});})[_0x0d50('0x10')](respondWithResult(_0x4dd504,null))['catch'](handleError(_0x4dd504,null));};exports[_0x0d50('0xb0')]=function(_0x22d626,_0x55fa47){return db['MailAccount'][_0x0d50('0x64')]({'where':{'id':_0x22d626['params']['id']},'include':[{'model':db[_0x0d50('0x61')],'as':_0x0d50('0x43'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x0d50('0xa1'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x55fa47,null))['then'](function(_0x5c5b83){if(!_0x5c5b83[_0x0d50('0x43')])return;var _0x35dafc=_0x5c5b83['getSmtpOptions']();return respondWithRpcPromise(_0x0d50('0xb1'),'verifySmtp',{'account':_0x35dafc});})[_0x0d50('0x10')](respondWithResult(_0x55fa47,null))['catch'](handleError(_0x55fa47,null));};exports[_0x0d50('0x26')]=function(_0x12f4e7,_0x2350b3){return db[_0x0d50('0x47')][_0x0d50('0x64')]({'where':{'id':_0x12f4e7[_0x0d50('0x60')]['id']}})[_0x0d50('0x10')](handleEntityNotFound(_0x2350b3,null))[_0x0d50('0x10')](function(_0x2393d7){if(_0x2393d7&&_0x2393d7['service']){throw new db['Sequelize']['ValidationError'](_0x0d50('0xb2'));}return _0x2393d7;})['then'](removeEntity(_0x2350b3,null))[_0x0d50('0x1a')](handleError(_0x2350b3,null));};exports['addAgents']=function(_0x25772c,_0x2b67af){return db[_0x0d50('0x47')][_0x0d50('0x64')]({'where':{'id':_0x25772c[_0x0d50('0x60')]['id']}})[_0x0d50('0x10')](handleEntityNotFound(_0x2b67af,null))[_0x0d50('0x10')](function(_0x314b67){if(_0x314b67){return _0x314b67[_0x0d50('0xb3')](_0x25772c[_0x0d50('0x65')][_0x0d50('0x73')],_[_0x0d50('0x82')](_0x25772c[_0x0d50('0x65')],['ids','id'])||{})['spread'](function(_0x383207){for(var _0x334907=0x0;_0x334907<_0x25772c['body'][_0x0d50('0x73')][_0x0d50('0x51')];_0x334907+=0x1){socket['emit'](_0x0d50('0xb4'),{'UserId':Number(_0x25772c['body'][_0x0d50('0x73')][_0x334907]),'MailAccountId':Number(_0x25772c[_0x0d50('0x60')]['id'])});}return _0x383207;});}})[_0x0d50('0x10')](respondWithResult(_0x2b67af,null))[_0x0d50('0x1a')](handleError(_0x2b67af,null));};exports[_0x0d50('0xb5')]=function(_0x1312cb,_0x48f1c0){return db[_0x0d50('0x47')]['find']({'where':{'id':_0x1312cb[_0x0d50('0x60')]['id']}})['then'](handleEntityNotFound(_0x48f1c0,null))[_0x0d50('0x10')](function(_0x37c69){if(_0x37c69){return _0x37c69[_0x0d50('0xb5')](_0x1312cb[_0x0d50('0x4b')]['ids'])[_0x0d50('0x10')](function(){if(_[_0x0d50('0xb6')](_0x1312cb[_0x0d50('0x4b')]['ids'])){for(var _0x379c15=0x0;_0x379c15<_0x1312cb[_0x0d50('0x4b')]['ids']['length'];_0x379c15+=0x1){socket[_0x0d50('0xb7')]('userMailAccount:remove',{'UserId':Number(_0x1312cb['query'][_0x0d50('0x73')][_0x379c15]),'MailAccountId':Number(_0x1312cb[_0x0d50('0x60')]['id'])});}}else{socket[_0x0d50('0xb7')](_0x0d50('0xb8'),{'UserId':Number(_0x1312cb['query'][_0x0d50('0x73')]),'MailAccountId':Number(_0x1312cb[_0x0d50('0x60')]['id'])});}});}})['then'](respondWithStatusCode(_0x48f1c0,null))['catch'](handleError(_0x48f1c0,null));};exports[_0x0d50('0xb9')]=function(_0x192378,_0x584cdc){var _0x204f46={};var _0x32d15b={};var _0x20df01;var _0x3c45a9;return db[_0x0d50('0x47')][_0x0d50('0x70')]({'where':{'id':_0x192378[_0x0d50('0x60')]['id']}})[_0x0d50('0x10')](handleEntityNotFound(_0x584cdc,null))['then'](function(_0x1d1a50){if(_0x1d1a50){_0x20df01=_0x1d1a50;_0x32d15b['model']=_[_0x0d50('0x4c')](db[_0x0d50('0x87')][_0x0d50('0x48')]);_0x32d15b['query']=_['keys'](_0x192378['query']);_0x32d15b['filters']=_['intersection'](_0x32d15b[_0x0d50('0x4a')],_0x32d15b[_0x0d50('0x4b')]);_0x204f46['attributes']=_[_0x0d50('0x4e')](_0x32d15b[_0x0d50('0x4a')],qs['fields'](_0x192378[_0x0d50('0x4b')][_0x0d50('0x4f')]));_0x204f46[_0x0d50('0x50')]=_0x204f46[_0x0d50('0x50')][_0x0d50('0x51')]?_0x204f46['attributes']:_0x32d15b[_0x0d50('0x4a')];_0x204f46[_0x0d50('0x54')]=qs[_0x0d50('0x55')](_0x192378[_0x0d50('0x4b')][_0x0d50('0x55')]);_0x204f46['where']=qs[_0x0d50('0x4d')](_[_0x0d50('0x56')](_0x192378[_0x0d50('0x4b')],_0x32d15b[_0x0d50('0x4d')]));if(_0x192378[_0x0d50('0x4b')]['filter']){_0x204f46['where']=_[_0x0d50('0x59')](_0x204f46['where'],{'$or':_[_0x0d50('0x46')](_0x204f46[_0x0d50('0x50')],function(_0xea3620){var _0x8ac887={};_0x8ac887[_0xea3620]={'$like':'%'+_0x192378[_0x0d50('0x4b')][_0x0d50('0x57')]+'%'};return _0x8ac887;})});}_0x204f46=_[_0x0d50('0x59')]({},_0x204f46,_0x192378[_0x0d50('0x5b')]);return _0x20df01[_0x0d50('0xb9')](_0x204f46);}})[_0x0d50('0x10')](function(_0x1dc64d){if(_0x1dc64d){_0x3c45a9=_0x1dc64d[_0x0d50('0x51')];if(!_0x192378[_0x0d50('0x4b')][_0x0d50('0x52')](_0x0d50('0x53'))){_0x204f46['limit']=qs[_0x0d50('0x20')](_0x192378[_0x0d50('0x4b')][_0x0d50('0x20')]);_0x204f46[_0x0d50('0x22')]=qs[_0x0d50('0x22')](_0x192378['query'][_0x0d50('0x22')]);}return _0x20df01[_0x0d50('0xb9')](_0x204f46);}})[_0x0d50('0x10')](function(_0x184c4f){if(_0x184c4f){return _0x184c4f?{'count':_0x3c45a9,'rows':_0x184c4f}:null;}})[_0x0d50('0x10')](respondWithResult(_0x584cdc,null))['catch'](handleError(_0x584cdc,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 6c8d871..72c039c 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 _0x0fc9=['../../mysqldb','MailAccount','save','update','emit','hook','exports','events'];(function(_0x3bc83a,_0x163221){var _0x309771=function(_0x5eeb70){while(--_0x5eeb70){_0x3bc83a['push'](_0x3bc83a['shift']());}};_0x309771(++_0x163221);}(_0x0fc9,0x15f));var _0x90fc=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x0fc9[_0x3bf83f];return _0x22c4a9;};'use strict';var EventEmitter=require(_0x90fc('0x0'));var MailAccount=require(_0x90fc('0x1'))['db'][_0x90fc('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x90fc('0x3'),'afterUpdate':_0x90fc('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3799b9){return function(_0x379f42,_0x17929c,_0x9f16d5){MailAccountEvents[_0x90fc('0x5')](_0x3799b9+':'+_0x379f42['id'],_0x379f42);MailAccountEvents[_0x90fc('0x5')](_0x3799b9,_0x379f42);_0x9f16d5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount[_0x90fc('0x6')](e,emitEvent(event));}}module[_0x90fc('0x7')]=MailAccountEvents; \ No newline at end of file +var _0xbc36=['exports','events','MailAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x37e3b1,_0x354467){var _0x4b1064=function(_0x300acf){while(--_0x300acf){_0x37e3b1['push'](_0x37e3b1['shift']());}};_0x4b1064(++_0x354467);}(_0xbc36,0x169));var _0x6bc3=function(_0x3e3747,_0x302706){_0x3e3747=_0x3e3747-0x0;var _0x576c2d=_0xbc36[_0x3e3747];return _0x576c2d;};'use strict';var EventEmitter=require(_0x6bc3('0x0'));var MailAccount=require('../../mysqldb')['db'][_0x6bc3('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x6bc3('0x2')](0x0);var events={'afterCreate':_0x6bc3('0x3'),'afterUpdate':_0x6bc3('0x4'),'afterDestroy':_0x6bc3('0x5')};function emitEvent(_0x441f74){return function(_0x3f2335,_0x1d73ad,_0x3e8659){MailAccountEvents['emit'](_0x441f74+':'+_0x3f2335['id'],_0x3f2335);MailAccountEvents[_0x6bc3('0x6')](_0x441f74,_0x3f2335);_0x3e8659(null);};}for(var e in events){if(events[_0x6bc3('0x7')](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module[_0x6bc3('0x8')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 426d12f..9094f59 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 _0x02eb=['port','secure','modernAuthentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','OAuth2','data5','user','exports','define','MailAccount','mail_accounts','provider','custom','service','host','Smtp'];(function(_0x5a5395,_0x5361f6){var _0x4da43d=function(_0x149941){while(--_0x149941){_0x5a5395['push'](_0x5a5395['shift']());}};_0x4da43d(++_0x5361f6);}(_0x02eb,0x129));var _0xb02e=function(_0x18fe0a,_0x2c9a7f){_0x18fe0a=_0x18fe0a-0x0;var _0x5b9862=_0x02eb[_0x18fe0a];return _0x5b9862;};'use strict';var attributes=require('./mailAccount.attributes');module[_0xb02e('0x0')]=function(_0x1bf4f6){return _0x1bf4f6[_0xb02e('0x1')](_0xb02e('0x2'),attributes,{'tableName':_0xb02e('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x124a72=this;var _0x97e1={'id':_0x124a72['id'],'tls':{'rejectUnauthorized':![]}};if(_0x124a72[_0xb02e('0x4')]!==_0xb02e('0x5')){_0x97e1[_0xb02e('0x6')]=_0x124a72[_0xb02e('0x4')];}else{_0x97e1[_0xb02e('0x7')]=_0x124a72[_0xb02e('0x8')]['host'];_0x97e1[_0xb02e('0x9')]=_0x124a72[_0xb02e('0x8')][_0xb02e('0x9')];_0x97e1[_0xb02e('0xa')]=_0x124a72[_0xb02e('0x8')]['secure'];}if(_0x124a72[_0xb02e('0x8')]['authentication']){if(_0x124a72[_0xb02e('0x8')][_0xb02e('0xb')]){if(!_0x124a72[_0xb02e('0x8')][_0xb02e('0xc')])throw new Error(_0xb02e('0xd'));_0x97e1['auth']={'type':_0xb02e('0xe'),'user':_0x124a72[_0xb02e('0x8')]['user'],'accessToken':_0x124a72[_0xb02e('0x8')][_0xb02e('0xc')][_0xb02e('0xf')]};}else{_0x97e1['auth']={'user':_0x124a72['Smtp'][_0xb02e('0x10')],'pass':_0x124a72[_0xb02e('0x8')]['pass']};}}return _0x97e1;}}});}; \ No newline at end of file +var _0xb4a9=['Smtp','host','port','secure','authentication','modernAuthentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','OAuth2','user','data5','auth','pass','./mailAccount.attributes','exports','define','MailAccount','mail_accounts','custom','service','provider'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xb4a9,0x133));var _0x9b4a=function(_0xae76d3,_0x17db01){_0xae76d3=_0xae76d3-0x0;var _0x1ccdc0=_0xb4a9[_0xae76d3];return _0x1ccdc0;};'use strict';var attributes=require(_0x9b4a('0x0'));module[_0x9b4a('0x1')]=function(_0x102243){return _0x102243[_0x9b4a('0x2')](_0x9b4a('0x3'),attributes,{'tableName':_0x9b4a('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x4b472b=this;var _0xbe97a1={'id':_0x4b472b['id'],'tls':{'rejectUnauthorized':![]}};if(_0x4b472b['provider']!==_0x9b4a('0x5')){_0xbe97a1[_0x9b4a('0x6')]=_0x4b472b[_0x9b4a('0x7')];}else{_0xbe97a1['host']=_0x4b472b[_0x9b4a('0x8')][_0x9b4a('0x9')];_0xbe97a1[_0x9b4a('0xa')]=_0x4b472b[_0x9b4a('0x8')][_0x9b4a('0xa')];_0xbe97a1[_0x9b4a('0xb')]=_0x4b472b[_0x9b4a('0x8')][_0x9b4a('0xb')];}if(_0x4b472b[_0x9b4a('0x8')][_0x9b4a('0xc')]){if(_0x4b472b['Smtp'][_0x9b4a('0xd')]){if(!_0x4b472b[_0x9b4a('0x8')][_0x9b4a('0xe')])throw new Error(_0x9b4a('0xf'));_0xbe97a1['auth']={'type':_0x9b4a('0x10'),'user':_0x4b472b['Smtp'][_0x9b4a('0x11')],'accessToken':_0x4b472b[_0x9b4a('0x8')]['CloudProvider'][_0x9b4a('0x12')]};}else{_0xbe97a1[_0x9b4a('0x13')]={'user':_0x4b472b[_0x9b4a('0x8')][_0x9b4a('0x11')],'pass':_0x4b472b['Smtp'][_0x9b4a('0x14')]};}}return _0xbe97a1;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 394041f..15e1f49 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 _0x24ca=['YYYY-MM-DD\x20HH:mm:ss','interaction','created','contact','subject','attachments','originTo','originCc','bcc','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachment','Attachments','UserId','User','name','agent','waitForTheAssignedAgent','queueId','MailQueue','unshift','queue','waitForTheAssignedQueue','Start','startRouting','lodash','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','localhost','socket.io-emitter','redis','./mailAccount.socket','register','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetMailAccount','MailAccount','findAll','options','raw','where','limit','include','map','attributes','model','then','stringify','find','smtp','setDataValue','getSmtpOptions','ShowMailAccount','NotifyMailAccount','body','mail','difference','keys','createdAt','CompanyId','isNil','from','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','account','CmList','List','CmContact','Contacts','updatedAt','DESC','Applications','Smtp','CloudProvider','get','omit','applications','list','orderBy','push','length','*,*,*,*','ListId','messageId','generate','format','MailInteraction','MailMessage','Messages','inReplyTo','create','Contact\x20not\x20found','spread','update','attach'];(function(_0x867b0a,_0x587ccf){var _0x137438=function(_0xbeafa6){while(--_0xbeafa6){_0x867b0a['push'](_0x867b0a['shift']());}};_0x137438(++_0x587ccf);}(_0x24ca,0x8c));var _0xa24c=function(_0x413aac,_0x5e2430){_0x413aac=_0x413aac-0x0;var _0x569b11=_0x24ca[_0x413aac];return _0x569b11;};'use strict';var _=require(_0xa24c('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa24c('0x1'));var Redis=require('ioredis');var db=require(_0xa24c('0x2'))['db'];var logger=require(_0xa24c('0x3'))(_0xa24c('0x4'));var config=require('../../config/environment');var jayson=require(_0xa24c('0x5'));var client=jayson[_0xa24c('0x6')][_0xa24c('0x7')]({'port':0x232c});config['redis']=_['defaults'](config['redis'],{'host':_0xa24c('0x8'),'port':0x18eb});var socket=require(_0xa24c('0x9'))(new Redis(config[_0xa24c('0xa')]));require(_0xa24c('0xb'))[_0xa24c('0xc')](socket);function respondWithRpcPromise(_0x87c265,_0x5bedc6,_0x101ca7){return new BPromise(function(_0x413b3d,_0x355882){return client['request'](_0x87c265,_0x101ca7)['then'](function(_0x1331f4){logger[_0xa24c('0xd')](_0xa24c('0xe'),_0x5bedc6,_0xa24c('0xf'));logger[_0xa24c('0x10')](_0xa24c('0x11'),_0x5bedc6,'request\x20sent',JSON['stringify'](_0x1331f4));if(_0x1331f4['error']){if(_0x1331f4[_0xa24c('0x12')][_0xa24c('0x13')]===0x1f4){logger[_0xa24c('0x12')](_0xa24c('0xe'),_0x5bedc6,_0x1331f4[_0xa24c('0x12')]['message']);return _0x355882(_0x1331f4[_0xa24c('0x12')]['message']);}logger['error']('MailAccount,\x20%s,\x20%s',_0x5bedc6,_0x1331f4[_0xa24c('0x12')][_0xa24c('0x14')]);return _0x413b3d(_0x1331f4[_0xa24c('0x12')][_0xa24c('0x14')]);}else{logger[_0xa24c('0xd')](_0xa24c('0xe'),_0x5bedc6,_0xa24c('0xf'));_0x413b3d(_0x1331f4[_0xa24c('0x15')][_0xa24c('0x14')]);}})[_0xa24c('0x16')](function(_0x1970fc){logger[_0xa24c('0x12')](_0xa24c('0xe'),_0x5bedc6,_0x1970fc);_0x355882(_0x1970fc);});});}exports[_0xa24c('0x17')]=function(_0x5276b6){var _0x167a76=this;return new Promise(function(_0x48fb65,_0x98802d){return db[_0xa24c('0x18')][_0xa24c('0x19')]({'raw':_0x5276b6[_0xa24c('0x1a')]?_0x5276b6[_0xa24c('0x1a')][_0xa24c('0x1b')]===undefined?!![]:![]:!![],'where':_0x5276b6[_0xa24c('0x1a')]?_0x5276b6[_0xa24c('0x1a')][_0xa24c('0x1c')]||null:null,'attributes':_0x5276b6[_0xa24c('0x1a')]?_0x5276b6[_0xa24c('0x1a')]['attributes']||null:null,'limit':_0x5276b6['options']?_0x5276b6[_0xa24c('0x1a')][_0xa24c('0x1d')]||null:null,'include':_0x5276b6[_0xa24c('0x1a')]?_0x5276b6[_0xa24c('0x1a')][_0xa24c('0x1e')]?_[_0xa24c('0x1f')](_0x5276b6[_0xa24c('0x1a')][_0xa24c('0x1e')],function(_0x304d6c){return{'model':db[_0x304d6c['model']],'as':_0x304d6c['as'],'attributes':_0x304d6c[_0xa24c('0x20')],'include':_0x304d6c['include']?_[_0xa24c('0x1f')](_0x304d6c[_0xa24c('0x1e')],function(_0x471421){return{'model':db[_0x471421[_0xa24c('0x21')]],'as':_0x471421['as'],'attributes':_0x471421['attributes'],'include':_0x471421['include']?_['map'](_0x471421['include'],function(_0x23fb79){return{'model':db[_0x23fb79[_0xa24c('0x21')]],'as':_0x23fb79['as'],'attributes':_0x23fb79[_0xa24c('0x20')]};}):[]};}):[]};}):[]:[]})[_0xa24c('0x22')](function(_0x37cbd3){logger['info']('GetMailAccount',_0x5276b6);logger[_0xa24c('0x10')](_0xa24c('0x17'),_0x5276b6,JSON[_0xa24c('0x23')](_0x37cbd3));_0x48fb65(_0x37cbd3);})[_0xa24c('0x16')](function(_0x4566dc){logger[_0xa24c('0x12')](_0xa24c('0x17'),_0x4566dc[_0xa24c('0x14')],_0x5276b6);_0x98802d(_0x167a76[_0xa24c('0x12')](0x1f4,_0x4566dc[_0xa24c('0x14')]));});});};exports['ShowMailAccount']=function(_0x2dd4f1){var _0x3b94f0=this;return new Promise(function(_0x56b717,_0x3c9649){return db[_0xa24c('0x18')][_0xa24c('0x24')]({'raw':_0x2dd4f1[_0xa24c('0x1a')]?_0x2dd4f1[_0xa24c('0x1a')][_0xa24c('0x1b')]===undefined?!![]:![]:!![],'where':_0x2dd4f1[_0xa24c('0x1a')]?_0x2dd4f1[_0xa24c('0x1a')][_0xa24c('0x1c')]||null:null,'attributes':_0x2dd4f1[_0xa24c('0x1a')]?_0x2dd4f1['options']['attributes']||null:null,'include':_0x2dd4f1['options']?_0x2dd4f1[_0xa24c('0x1a')]['include']?_[_0xa24c('0x1f')](_0x2dd4f1[_0xa24c('0x1a')][_0xa24c('0x1e')],function(_0x4b8627){return{'model':db[_0x4b8627[_0xa24c('0x21')]],'as':_0x4b8627['as'],'attributes':_0x4b8627[_0xa24c('0x20')],'include':_0x4b8627[_0xa24c('0x1e')]?_['map'](_0x4b8627[_0xa24c('0x1e')],function(_0x16835f){return{'model':db[_0x16835f['model']],'as':_0x16835f['as'],'attributes':_0x16835f[_0xa24c('0x20')],'include':_0x16835f[_0xa24c('0x1e')]?_[_0xa24c('0x1f')](_0x16835f['include'],function(_0x45c429){return{'model':db[_0x45c429[_0xa24c('0x21')]],'as':_0x45c429['as'],'attributes':_0x45c429[_0xa24c('0x20')]};}):[]};}):[]};}):[]:[]})[_0xa24c('0x22')](function(_0x12e184){if(_0x2dd4f1['options'][_0xa24c('0x25')]===!![])_0x12e184[_0xa24c('0x26')]('smtpOptions',_0x12e184[_0xa24c('0x27')]());logger[_0xa24c('0xd')](_0xa24c('0x28'),_0x2dd4f1);logger['debug']('ShowMailAccount',_0x2dd4f1,JSON[_0xa24c('0x23')](_0x12e184));_0x56b717(_0x12e184);})[_0xa24c('0x16')](function(_0x219b2c){logger[_0xa24c('0x12')](_0xa24c('0x28'),_0x219b2c[_0xa24c('0x14')],_0x2dd4f1);_0x3c9649(_0x3b94f0['error'](0x1f4,_0x219b2c[_0xa24c('0x14')]));});});};exports[_0xa24c('0x29')]=function(_0x21e804){var _0x137a1d=this;return new Promise(function(_0x5f3cd4,_0x34026c){var _0x190dfc={'body':_0x21e804[_0xa24c('0x2a')],'channel':_0xa24c('0x2b')};var _0x103b50=_[_0xa24c('0x2c')](_[_0xa24c('0x2d')](db['CmContact']['rawAttributes']),[_0xa24c('0x2e'),'updatedAt',_0xa24c('0x2f'),'ListId']);var _0x32e151=![];if(_0x21e804[_0xa24c('0x2a')]['id']){delete _0x21e804[_0xa24c('0x2a')]['id'];}if(_[_0xa24c('0x30')](_0x21e804[_0xa24c('0x2a')][_0xa24c('0x31')])){return _0x34026c(_0x137a1d[_0xa24c('0x12')](0x1f4,_0xa24c('0x32')));}if(_[_0xa24c('0x30')](_0x21e804[_0xa24c('0x2a')][_0xa24c('0x2a')])||_0x21e804[_0xa24c('0x2a')][_0xa24c('0x2a')]===''){return _0x34026c(_0x137a1d[_0xa24c('0x12')](0x1f4,_0xa24c('0x33')));}if(_[_0xa24c('0x30')](_0x21e804['body'][_0xa24c('0x34')])){return _0x34026c(_0x137a1d[_0xa24c('0x12')](0x1f4,_0xa24c('0x35')+_0x103b50));}if(!_['includes'](_0x103b50,_0x21e804[_0xa24c('0x2a')][_0xa24c('0x34')])){return _0x34026c(_0x137a1d[_0xa24c('0x12')](0x1f4,_0xa24c('0x36')+_0x103b50));}var _0x4d8b8e={};_0x4d8b8e[_0x21e804[_0xa24c('0x2a')][_0xa24c('0x34')]]=_0x21e804[_0xa24c('0x2a')][_0xa24c('0x31')];return db[_0xa24c('0x18')][_0xa24c('0x24')]({'where':{'id':_0x21e804[_0xa24c('0x37')]['id']},'include':[{'model':db[_0xa24c('0x38')],'as':_0xa24c('0x39'),'include':[{'model':db[_0xa24c('0x3a')],'as':_0xa24c('0x3b'),'where':_0x4d8b8e,'limit':0x1,'order':[[_0xa24c('0x3c'),_0xa24c('0x3d')]]}]},{'model':db['MailApplication'],'as':_0xa24c('0x3e')},{'model':db['MailServerOut'],'as':_0xa24c('0x3f'),'include':[{'model':db[_0xa24c('0x40')],'as':_0xa24c('0x40')}]}]})[_0xa24c('0x22')](function(_0xd4761e){if(_0xd4761e&&_0xd4761e[_0xa24c('0x39')]){var _0x338877=_0xd4761e[_0xa24c('0x41')]({'plain':!![]});_0x190dfc[_0xa24c('0x37')]=_[_0xa24c('0x42')](_0x338877,[_0xa24c('0x3e'),_0xa24c('0x39')]);_0x190dfc[_0xa24c('0x37')]['smtpOptions']=_0xd4761e[_0xa24c('0x27')]();_0x190dfc[_0xa24c('0x43')]=_0x338877[_0xa24c('0x3e')];_0x190dfc[_0xa24c('0x44')]=_0x338877['List'];_0x190dfc[_0xa24c('0x43')]=_[_0xa24c('0x45')](_0x190dfc[_0xa24c('0x43')],['priority'],['asc']);if(_0x190dfc[_0xa24c('0x37')]&&_0x190dfc[_0xa24c('0x37')]['autoclose']){_0x190dfc[_0xa24c('0x43')][_0xa24c('0x46')]({'id':0x0,'priority':_0x190dfc['applications'][_0xa24c('0x47')]+0x1,'app':'close','appdata':'autoclose','interval':_0xa24c('0x48')});}if(_0x190dfc['account'][_0xa24c('0x3e')]){delete _0x190dfc[_0xa24c('0x37')]['Applications'];}if(_0x190dfc[_0xa24c('0x37')][_0xa24c('0x39')]){delete _0x190dfc[_0xa24c('0x37')][_0xa24c('0x39')];}if(_0x338877['List'][_0xa24c('0x3b')]['length']){return _0x338877[_0xa24c('0x39')][_0xa24c('0x3b')][0x0];}var _0x53e305=_['defaults'](_0x21e804[_0xa24c('0x2a')],{'firstName':_0x21e804[_0xa24c('0x2a')][_0xa24c('0x31')],'ListId':_0x338877[_0xa24c('0x49')]});_0x53e305[_0x21e804[_0xa24c('0x2a')]['mapKey']]=_0x21e804[_0xa24c('0x2a')]['from'];return db[_0xa24c('0x3a')]['create'](_0x53e305);}else{throw new Error('List\x20not\x20found');}})['then'](function(_0x3fc3d9){_0x190dfc['contact']=_0x3fc3d9;if(_0x3fc3d9){if(!_0x21e804['body'][_0xa24c('0x14')]['messageId']){_0x21e804[_0xa24c('0x2a')][_0xa24c('0x14')][_0xa24c('0x4a')]=rs[_0xa24c('0x4b')]()+'\x20'+_0x21e804[_0xa24c('0x2a')][_0xa24c('0x14')][_0xa24c('0x31')];}var _0x366505={'ContactId':_0x3fc3d9['id'],'MailAccountId':_0x21e804['account']['id'],'inReplyTo':_0x21e804['body'][_0xa24c('0x14')][_0xa24c('0x4a')],'to':_0x21e804['body'][_0xa24c('0x14')][_0xa24c('0x31')],'cc':_0x21e804['body'][_0xa24c('0x14')]['cc'],'subject':_0x21e804[_0xa24c('0x2a')][_0xa24c('0x14')]['subject'],'attach':_0x21e804[_0xa24c('0x2a')][_0xa24c('0x14')]['attach'],'lastMsgAt':moment()[_0xa24c('0x4c')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db[_0xa24c('0x4d')][_0xa24c('0x24')]({'where':{'closed':![],'MailAccountId':_0x21e804[_0xa24c('0x37')]['id']},'include':[{'model':db[_0xa24c('0x4e')],'as':_0xa24c('0x4f'),'attributes':[_0xa24c('0x4a')],'where':{'messageId':_0x21e804[_0xa24c('0x2a')][_0xa24c('0x14')][_0xa24c('0x50')]}}]})[_0xa24c('0x22')](function(_0x37a9c8){if(_0x37a9c8){return[_0x37a9c8,![]];}return db[_0xa24c('0x4d')][_0xa24c('0x51')](_0x366505)[_0xa24c('0x22')](function(_0xe32b69){return[_0xe32b69,!![]];});});}else{throw new Error(_0xa24c('0x52'));}})[_0xa24c('0x53')](function(_0x46aded,_0x5b5826){if(_0x46aded){_0x32e151=_0x5b5826;if(!_0x5b5826){return _0x46aded[_0xa24c('0x54')]({'inReplyTo':_0x21e804['body'][_0xa24c('0x14')][_0xa24c('0x4a')],'to':_0x21e804[_0xa24c('0x2a')][_0xa24c('0x14')]['from'],'cc':_0x21e804['body'][_0xa24c('0x14')]['cc'],'subject':_0x21e804[_0xa24c('0x2a')][_0xa24c('0x14')]['subject'],'attach':_0x46aded[_0xa24c('0x55')]?_0x46aded[_0xa24c('0x55')]:_0x21e804[_0xa24c('0x2a')][_0xa24c('0x14')][_0xa24c('0x55')],'substatus':null,'substatusAt':moment()[_0xa24c('0x4c')](_0xa24c('0x56')),'lastMsgAt':moment()[_0xa24c('0x4c')](_0xa24c('0x56')),'lastMsgDirection':'in'});}else{return _0x46aded;}}})[_0xa24c('0x22')](function(_0x2cb64e){_0x190dfc[_0xa24c('0x57')]=_0x2cb64e[_0xa24c('0x41')]({'plain':!![]});_0x190dfc[_0xa24c('0x57')][_0xa24c('0x58')]=_0x32e151;return db[_0xa24c('0x4e')][_0xa24c('0x51')]({'body':_0x21e804[_0xa24c('0x2a')][_0xa24c('0x2a')],'MailAccountId':_0x21e804[_0xa24c('0x37')]['id'],'MailInteractionId':_0x2cb64e['id'],'direction':'in','ContactId':_0x190dfc[_0xa24c('0x59')]['id'],'messageId':_0x21e804[_0xa24c('0x2a')][_0xa24c('0x14')][_0xa24c('0x4a')],'from':_0x21e804[_0xa24c('0x2a')][_0xa24c('0x14')][_0xa24c('0x31')],'to':_0x21e804[_0xa24c('0x2a')][_0xa24c('0x14')]['to'],'cc':_0x21e804[_0xa24c('0x2a')]['message']['cc'],'subject':_0x21e804[_0xa24c('0x2a')]['message'][_0xa24c('0x5a')],'attach':_0x21e804[_0xa24c('0x2a')][_0xa24c('0x14')][_0xa24c('0x55')],'Attachments':_0x21e804['body'][_0xa24c('0x14')][_0xa24c('0x5b')],'originTo':_0x21e804[_0xa24c('0x2a')]['message'][_0xa24c('0x5c')],'originCc':_0x21e804['body'][_0xa24c('0x14')][_0xa24c('0x5d')],'bcc':_0x21e804[_0xa24c('0x2a')]['message'][_0xa24c('0x5e')],'ChatWebsiteId':_0x21e804[_0xa24c('0x2a')]['message'][_0xa24c('0x5f')]||null,'originChannel':_0x21e804[_0xa24c('0x2a')][_0xa24c('0x14')][_0xa24c('0x60')]||_0xa24c('0x61'),'ChatOfflineMessageId':_0x21e804[_0xa24c('0x2a')][_0xa24c('0x14')][_0xa24c('0x62')]||null},{'include':[{'model':db[_0xa24c('0x63')],'as':_0xa24c('0x64')}]});})[_0xa24c('0x22')](function(_0x259684){_0x190dfc[_0xa24c('0x14')]=_0x259684;if(!_0x190dfc[_0xa24c('0x57')][_0xa24c('0x65')]){return;}return db[_0xa24c('0x66')]['find']({'attributes':['id',_0xa24c('0x67')],'where':{'id':_0x190dfc[_0xa24c('0x57')][_0xa24c('0x65')]}});})[_0xa24c('0x22')](function(_0xdf074f){if(_0xdf074f){_0x190dfc['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0xa24c('0x68'),'appdata':_0xdf074f[_0xa24c('0x67')]+','+(_0x190dfc[_0xa24c('0x37')][_0xa24c('0x69')]||0xa),'interval':_0xa24c('0x48')});}if(!_0x190dfc['interaction'][_0xa24c('0x6a')]){return;}return db[_0xa24c('0x6b')][_0xa24c('0x24')]({'attributes':['id','name'],'where':{'id':_0x190dfc[_0xa24c('0x57')]['queueId']}});})['then'](function(_0x5d507a){if(_0x5d507a){_0x190dfc[_0xa24c('0x43')][_0xa24c('0x6c')]({'id':0x0,'priority':0x1,'app':_0xa24c('0x6d'),'appdata':_0x5d507a[_0xa24c('0x67')]+','+(_0x190dfc['account'][_0xa24c('0x6e')]||0x12c),'interval':_0xa24c('0x48')});}return respondWithRpcPromise(_0xa24c('0x6f'),_0xa24c('0x70'),_0x190dfc);})[_0xa24c('0x22')](function(_0x4baa40){_0x5f3cd4(_0x4baa40);})[_0xa24c('0x16')](function(_0x157552){_0x34026c(_0x137a1d['error'](0x1f4,_0x157552['message']));});});}; \ No newline at end of file +var _0xee14=['localhost','socket.io-emitter','./mailAccount.socket','register','request','then','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetMailAccount','findAll','options','raw','where','attributes','limit','include','map','model','MailAccount','find','smtp','setDataValue','smtpOptions','getSmtpOptions','ShowMailAccount','NotifyMailAccount','body','mail','difference','CmContact','rawAttributes','updatedAt','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','isNil','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','Contacts','Applications','MailServerOut','Smtp','CloudProvider','get','omit','applications','list','priority','asc','autoclose','push','length','close','defaults','List\x20not\x20found','contact','messageId','subject','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','create','Contact\x20not\x20found','update','attach','interaction','created','originCc','ChatWebsiteId','originChannel','Email','Attachments','UserId','User','unshift','agent','name','waitForTheAssignedAgent','MailQueue','waitForTheAssignedQueue','*,*,*,*','Start','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xee14,0x13a));var _0x4ee1=function(_0x3e55e7,_0x563504){_0x3e55e7=_0x3e55e7-0x0;var _0x56edda=_0xee14[_0x3e55e7];return _0x56edda;};'use strict';var _=require('lodash');var moment=require('moment');var BPromise=require(_0x4ee1('0x0'));var rs=require(_0x4ee1('0x1'));var Redis=require(_0x4ee1('0x2'));var db=require(_0x4ee1('0x3'))['db'];var logger=require(_0x4ee1('0x4'))(_0x4ee1('0x5'));var config=require(_0x4ee1('0x6'));var jayson=require(_0x4ee1('0x7'));var client=jayson[_0x4ee1('0x8')]['http']({'port':0x232c});config[_0x4ee1('0x9')]=_['defaults'](config[_0x4ee1('0x9')],{'host':_0x4ee1('0xa'),'port':0x18eb});var socket=require(_0x4ee1('0xb'))(new Redis(config[_0x4ee1('0x9')]));require(_0x4ee1('0xc'))[_0x4ee1('0xd')](socket);function respondWithRpcPromise(_0x58a32f,_0x33dbe6,_0x38be25){return new BPromise(function(_0x4e88e8,_0x3fa61b){return client[_0x4ee1('0xe')](_0x58a32f,_0x38be25)[_0x4ee1('0xf')](function(_0x191da7){logger['info'](_0x4ee1('0x10'),_0x33dbe6,_0x4ee1('0x11'));logger[_0x4ee1('0x12')](_0x4ee1('0x13'),_0x33dbe6,_0x4ee1('0x11'),JSON[_0x4ee1('0x14')](_0x191da7));if(_0x191da7['error']){if(_0x191da7[_0x4ee1('0x15')][_0x4ee1('0x16')]===0x1f4){logger[_0x4ee1('0x15')](_0x4ee1('0x10'),_0x33dbe6,_0x191da7[_0x4ee1('0x15')][_0x4ee1('0x17')]);return _0x3fa61b(_0x191da7[_0x4ee1('0x15')][_0x4ee1('0x17')]);}logger[_0x4ee1('0x15')]('MailAccount,\x20%s,\x20%s',_0x33dbe6,_0x191da7[_0x4ee1('0x15')][_0x4ee1('0x17')]);return _0x4e88e8(_0x191da7[_0x4ee1('0x15')][_0x4ee1('0x17')]);}else{logger[_0x4ee1('0x18')](_0x4ee1('0x10'),_0x33dbe6,_0x4ee1('0x11'));_0x4e88e8(_0x191da7[_0x4ee1('0x19')][_0x4ee1('0x17')]);}})[_0x4ee1('0x1a')](function(_0x274de5){logger['error'](_0x4ee1('0x10'),_0x33dbe6,_0x274de5);_0x3fa61b(_0x274de5);});});}exports[_0x4ee1('0x1b')]=function(_0x173388){var _0x1034fb=this;return new Promise(function(_0x43f9a2,_0x383ab0){return db['MailAccount'][_0x4ee1('0x1c')]({'raw':_0x173388[_0x4ee1('0x1d')]?_0x173388[_0x4ee1('0x1d')][_0x4ee1('0x1e')]===undefined?!![]:![]:!![],'where':_0x173388[_0x4ee1('0x1d')]?_0x173388[_0x4ee1('0x1d')][_0x4ee1('0x1f')]||null:null,'attributes':_0x173388[_0x4ee1('0x1d')]?_0x173388[_0x4ee1('0x1d')][_0x4ee1('0x20')]||null:null,'limit':_0x173388['options']?_0x173388['options'][_0x4ee1('0x21')]||null:null,'include':_0x173388[_0x4ee1('0x1d')]?_0x173388[_0x4ee1('0x1d')][_0x4ee1('0x22')]?_[_0x4ee1('0x23')](_0x173388[_0x4ee1('0x1d')]['include'],function(_0x5cc0b5){return{'model':db[_0x5cc0b5[_0x4ee1('0x24')]],'as':_0x5cc0b5['as'],'attributes':_0x5cc0b5[_0x4ee1('0x20')],'include':_0x5cc0b5['include']?_[_0x4ee1('0x23')](_0x5cc0b5[_0x4ee1('0x22')],function(_0x36654c){return{'model':db[_0x36654c[_0x4ee1('0x24')]],'as':_0x36654c['as'],'attributes':_0x36654c[_0x4ee1('0x20')],'include':_0x36654c[_0x4ee1('0x22')]?_[_0x4ee1('0x23')](_0x36654c['include'],function(_0x1f7b74){return{'model':db[_0x1f7b74['model']],'as':_0x1f7b74['as'],'attributes':_0x1f7b74[_0x4ee1('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3dc870){logger[_0x4ee1('0x18')](_0x4ee1('0x1b'),_0x173388);logger[_0x4ee1('0x12')](_0x4ee1('0x1b'),_0x173388,JSON['stringify'](_0x3dc870));_0x43f9a2(_0x3dc870);})[_0x4ee1('0x1a')](function(_0x5b3792){logger[_0x4ee1('0x15')](_0x4ee1('0x1b'),_0x5b3792[_0x4ee1('0x17')],_0x173388);_0x383ab0(_0x1034fb[_0x4ee1('0x15')](0x1f4,_0x5b3792[_0x4ee1('0x17')]));});});};exports['ShowMailAccount']=function(_0xf66ab2){var _0x9fe2b8=this;return new Promise(function(_0x422ba8,_0x2e37a3){return db[_0x4ee1('0x25')][_0x4ee1('0x26')]({'raw':_0xf66ab2['options']?_0xf66ab2['options'][_0x4ee1('0x1e')]===undefined?!![]:![]:!![],'where':_0xf66ab2[_0x4ee1('0x1d')]?_0xf66ab2[_0x4ee1('0x1d')]['where']||null:null,'attributes':_0xf66ab2[_0x4ee1('0x1d')]?_0xf66ab2[_0x4ee1('0x1d')][_0x4ee1('0x20')]||null:null,'include':_0xf66ab2[_0x4ee1('0x1d')]?_0xf66ab2[_0x4ee1('0x1d')][_0x4ee1('0x22')]?_[_0x4ee1('0x23')](_0xf66ab2[_0x4ee1('0x1d')][_0x4ee1('0x22')],function(_0x3cc595){return{'model':db[_0x3cc595[_0x4ee1('0x24')]],'as':_0x3cc595['as'],'attributes':_0x3cc595[_0x4ee1('0x20')],'include':_0x3cc595[_0x4ee1('0x22')]?_['map'](_0x3cc595[_0x4ee1('0x22')],function(_0x3de40e){return{'model':db[_0x3de40e[_0x4ee1('0x24')]],'as':_0x3de40e['as'],'attributes':_0x3de40e['attributes'],'include':_0x3de40e['include']?_[_0x4ee1('0x23')](_0x3de40e[_0x4ee1('0x22')],function(_0x74e6e2){return{'model':db[_0x74e6e2[_0x4ee1('0x24')]],'as':_0x74e6e2['as'],'attributes':_0x74e6e2['attributes']};}):[]};}):[]};}):[]:[]})[_0x4ee1('0xf')](function(_0x2ed16f){if(_0xf66ab2[_0x4ee1('0x1d')][_0x4ee1('0x27')]===!![])_0x2ed16f[_0x4ee1('0x28')](_0x4ee1('0x29'),_0x2ed16f[_0x4ee1('0x2a')]());logger[_0x4ee1('0x18')]('ShowMailAccount',_0xf66ab2);logger[_0x4ee1('0x12')](_0x4ee1('0x2b'),_0xf66ab2,JSON[_0x4ee1('0x14')](_0x2ed16f));_0x422ba8(_0x2ed16f);})[_0x4ee1('0x1a')](function(_0x45bb22){logger[_0x4ee1('0x15')]('ShowMailAccount',_0x45bb22[_0x4ee1('0x17')],_0xf66ab2);_0x2e37a3(_0x9fe2b8[_0x4ee1('0x15')](0x1f4,_0x45bb22[_0x4ee1('0x17')]));});});};exports[_0x4ee1('0x2c')]=function(_0x6600f5){var _0x352dc5=this;return new Promise(function(_0x3f0d8b,_0xaac883){var _0x23bb5f={'body':_0x6600f5[_0x4ee1('0x2d')],'channel':_0x4ee1('0x2e')};var _0x46bf93=_[_0x4ee1('0x2f')](_['keys'](db[_0x4ee1('0x30')][_0x4ee1('0x31')]),['createdAt',_0x4ee1('0x32'),'CompanyId',_0x4ee1('0x33')]);var _0x52ebc0=![];if(_0x6600f5[_0x4ee1('0x2d')]['id']){delete _0x6600f5[_0x4ee1('0x2d')]['id'];}if(_['isNil'](_0x6600f5[_0x4ee1('0x2d')][_0x4ee1('0x34')])){return _0xaac883(_0x352dc5[_0x4ee1('0x15')](0x1f4,_0x4ee1('0x35')));}if(_['isNil'](_0x6600f5[_0x4ee1('0x2d')][_0x4ee1('0x2d')])||_0x6600f5[_0x4ee1('0x2d')]['body']===''){return _0xaac883(_0x352dc5['error'](0x1f4,_0x4ee1('0x36')));}if(_[_0x4ee1('0x37')](_0x6600f5[_0x4ee1('0x2d')][_0x4ee1('0x38')])){return _0xaac883(_0x352dc5[_0x4ee1('0x15')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x46bf93));}if(!_['includes'](_0x46bf93,_0x6600f5[_0x4ee1('0x2d')][_0x4ee1('0x38')])){return _0xaac883(_0x352dc5[_0x4ee1('0x15')](0x1f4,_0x4ee1('0x39')+_0x46bf93));}var _0x5c5862={};_0x5c5862[_0x6600f5[_0x4ee1('0x2d')][_0x4ee1('0x38')]]=_0x6600f5['body'][_0x4ee1('0x34')];return db[_0x4ee1('0x25')][_0x4ee1('0x26')]({'where':{'id':_0x6600f5[_0x4ee1('0x3a')]['id']},'include':[{'model':db[_0x4ee1('0x3b')],'as':_0x4ee1('0x3c'),'include':[{'model':db[_0x4ee1('0x30')],'as':_0x4ee1('0x3d'),'where':_0x5c5862,'limit':0x1,'order':[[_0x4ee1('0x32'),'DESC']]}]},{'model':db['MailApplication'],'as':_0x4ee1('0x3e')},{'model':db[_0x4ee1('0x3f')],'as':_0x4ee1('0x40'),'include':[{'model':db[_0x4ee1('0x41')],'as':'CloudProvider'}]}]})[_0x4ee1('0xf')](function(_0x3c66d1){if(_0x3c66d1&&_0x3c66d1[_0x4ee1('0x3c')]){var _0x2bc77f=_0x3c66d1[_0x4ee1('0x42')]({'plain':!![]});_0x23bb5f['account']=_[_0x4ee1('0x43')](_0x2bc77f,[_0x4ee1('0x3e'),_0x4ee1('0x3c')]);_0x23bb5f['account'][_0x4ee1('0x29')]=_0x3c66d1['getSmtpOptions']();_0x23bb5f[_0x4ee1('0x44')]=_0x2bc77f['Applications'];_0x23bb5f[_0x4ee1('0x45')]=_0x2bc77f['List'];_0x23bb5f[_0x4ee1('0x44')]=_['orderBy'](_0x23bb5f[_0x4ee1('0x44')],[_0x4ee1('0x46')],[_0x4ee1('0x47')]);if(_0x23bb5f['account']&&_0x23bb5f[_0x4ee1('0x3a')][_0x4ee1('0x48')]){_0x23bb5f[_0x4ee1('0x44')][_0x4ee1('0x49')]({'id':0x0,'priority':_0x23bb5f[_0x4ee1('0x44')][_0x4ee1('0x4a')]+0x1,'app':_0x4ee1('0x4b'),'appdata':'autoclose','interval':'*,*,*,*'});}if(_0x23bb5f[_0x4ee1('0x3a')][_0x4ee1('0x3e')]){delete _0x23bb5f[_0x4ee1('0x3a')][_0x4ee1('0x3e')];}if(_0x23bb5f[_0x4ee1('0x3a')][_0x4ee1('0x3c')]){delete _0x23bb5f[_0x4ee1('0x3a')][_0x4ee1('0x3c')];}if(_0x2bc77f[_0x4ee1('0x3c')][_0x4ee1('0x3d')][_0x4ee1('0x4a')]){return _0x2bc77f[_0x4ee1('0x3c')][_0x4ee1('0x3d')][0x0];}var _0x5e3172=_[_0x4ee1('0x4c')](_0x6600f5['body'],{'firstName':_0x6600f5[_0x4ee1('0x2d')][_0x4ee1('0x34')],'ListId':_0x2bc77f['ListId']});_0x5e3172[_0x6600f5[_0x4ee1('0x2d')][_0x4ee1('0x38')]]=_0x6600f5['body']['from'];return db[_0x4ee1('0x30')]['create'](_0x5e3172);}else{throw new Error(_0x4ee1('0x4d'));}})[_0x4ee1('0xf')](function(_0x59ba70){_0x23bb5f[_0x4ee1('0x4e')]=_0x59ba70;if(_0x59ba70){if(!_0x6600f5[_0x4ee1('0x2d')][_0x4ee1('0x17')][_0x4ee1('0x4f')]){_0x6600f5[_0x4ee1('0x2d')][_0x4ee1('0x17')][_0x4ee1('0x4f')]=rs['generate']()+'\x20'+_0x6600f5['body'][_0x4ee1('0x17')][_0x4ee1('0x34')];}var _0x5e43b6={'ContactId':_0x59ba70['id'],'MailAccountId':_0x6600f5[_0x4ee1('0x3a')]['id'],'inReplyTo':_0x6600f5[_0x4ee1('0x2d')][_0x4ee1('0x17')]['messageId'],'to':_0x6600f5[_0x4ee1('0x2d')]['message'][_0x4ee1('0x34')],'cc':_0x6600f5['body']['message']['cc'],'subject':_0x6600f5[_0x4ee1('0x2d')][_0x4ee1('0x17')][_0x4ee1('0x50')],'attach':_0x6600f5[_0x4ee1('0x2d')][_0x4ee1('0x17')]['attach'],'lastMsgAt':moment()[_0x4ee1('0x51')](_0x4ee1('0x52')),'lastMsgDirection':'in'};return db[_0x4ee1('0x53')]['find']({'where':{'closed':![],'MailAccountId':_0x6600f5[_0x4ee1('0x3a')]['id']},'include':[{'model':db[_0x4ee1('0x54')],'as':_0x4ee1('0x55'),'attributes':[_0x4ee1('0x4f')],'where':{'messageId':_0x6600f5[_0x4ee1('0x2d')][_0x4ee1('0x17')][_0x4ee1('0x56')]}}]})[_0x4ee1('0xf')](function(_0x19fa31){if(_0x19fa31){return[_0x19fa31,![]];}return db[_0x4ee1('0x53')][_0x4ee1('0x57')](_0x5e43b6)[_0x4ee1('0xf')](function(_0x5d396c){return[_0x5d396c,!![]];});});}else{throw new Error(_0x4ee1('0x58'));}})['spread'](function(_0x25cfc3,_0x4b9baa){if(_0x25cfc3){_0x52ebc0=_0x4b9baa;if(!_0x4b9baa){return _0x25cfc3[_0x4ee1('0x59')]({'inReplyTo':_0x6600f5[_0x4ee1('0x2d')][_0x4ee1('0x17')][_0x4ee1('0x4f')],'to':_0x6600f5[_0x4ee1('0x2d')][_0x4ee1('0x17')][_0x4ee1('0x34')],'cc':_0x6600f5[_0x4ee1('0x2d')][_0x4ee1('0x17')]['cc'],'subject':_0x6600f5[_0x4ee1('0x2d')][_0x4ee1('0x17')][_0x4ee1('0x50')],'attach':_0x25cfc3['attach']?_0x25cfc3[_0x4ee1('0x5a')]:_0x6600f5[_0x4ee1('0x2d')][_0x4ee1('0x17')]['attach'],'substatus':null,'substatusAt':moment()['format'](_0x4ee1('0x52')),'lastMsgAt':moment()[_0x4ee1('0x51')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'});}else{return _0x25cfc3;}}})[_0x4ee1('0xf')](function(_0x431dfa){_0x23bb5f[_0x4ee1('0x5b')]=_0x431dfa[_0x4ee1('0x42')]({'plain':!![]});_0x23bb5f[_0x4ee1('0x5b')][_0x4ee1('0x5c')]=_0x52ebc0;return db[_0x4ee1('0x54')][_0x4ee1('0x57')]({'body':_0x6600f5[_0x4ee1('0x2d')][_0x4ee1('0x2d')],'MailAccountId':_0x6600f5['account']['id'],'MailInteractionId':_0x431dfa['id'],'direction':'in','ContactId':_0x23bb5f[_0x4ee1('0x4e')]['id'],'messageId':_0x6600f5[_0x4ee1('0x2d')]['message']['messageId'],'from':_0x6600f5[_0x4ee1('0x2d')][_0x4ee1('0x17')][_0x4ee1('0x34')],'to':_0x6600f5[_0x4ee1('0x2d')][_0x4ee1('0x17')]['to'],'cc':_0x6600f5[_0x4ee1('0x2d')][_0x4ee1('0x17')]['cc'],'subject':_0x6600f5['body'][_0x4ee1('0x17')][_0x4ee1('0x50')],'attach':_0x6600f5[_0x4ee1('0x2d')][_0x4ee1('0x17')][_0x4ee1('0x5a')],'Attachments':_0x6600f5['body'][_0x4ee1('0x17')]['attachments'],'originTo':_0x6600f5[_0x4ee1('0x2d')][_0x4ee1('0x17')]['originTo'],'originCc':_0x6600f5['body'][_0x4ee1('0x17')][_0x4ee1('0x5d')],'bcc':_0x6600f5['body'][_0x4ee1('0x17')]['bcc'],'ChatWebsiteId':_0x6600f5['body'][_0x4ee1('0x17')][_0x4ee1('0x5e')]||null,'originChannel':_0x6600f5[_0x4ee1('0x2d')][_0x4ee1('0x17')][_0x4ee1('0x5f')]||_0x4ee1('0x60'),'ChatOfflineMessageId':_0x6600f5['body'][_0x4ee1('0x17')]['ChatOfflineMessageId']||null},{'include':[{'model':db['Attachment'],'as':_0x4ee1('0x61')}]});})[_0x4ee1('0xf')](function(_0x411c99){_0x23bb5f[_0x4ee1('0x17')]=_0x411c99;if(!_0x23bb5f[_0x4ee1('0x5b')][_0x4ee1('0x62')]){return;}return db[_0x4ee1('0x63')][_0x4ee1('0x26')]({'attributes':['id','name'],'where':{'id':_0x23bb5f[_0x4ee1('0x5b')][_0x4ee1('0x62')]}});})['then'](function(_0x1f4da8){if(_0x1f4da8){_0x23bb5f[_0x4ee1('0x44')][_0x4ee1('0x64')]({'id':0x0,'priority':0x0,'app':_0x4ee1('0x65'),'appdata':_0x1f4da8[_0x4ee1('0x66')]+','+(_0x23bb5f[_0x4ee1('0x3a')][_0x4ee1('0x67')]||0xa),'interval':'*,*,*,*'});}if(!_0x23bb5f[_0x4ee1('0x5b')]['queueId']){return;}return db[_0x4ee1('0x68')][_0x4ee1('0x26')]({'attributes':['id',_0x4ee1('0x66')],'where':{'id':_0x23bb5f[_0x4ee1('0x5b')]['queueId']}});})[_0x4ee1('0xf')](function(_0xce88e3){if(_0xce88e3){_0x23bb5f[_0x4ee1('0x44')]['unshift']({'id':0x0,'priority':0x1,'app':'queue','appdata':_0xce88e3[_0x4ee1('0x66')]+','+(_0x23bb5f['account'][_0x4ee1('0x69')]||0x12c),'interval':_0x4ee1('0x6a')});}return respondWithRpcPromise(_0x4ee1('0x6b'),'startRouting',_0x23bb5f);})['then'](function(_0x27fd3b){_0x3f0d8b(_0x27fd3b);})[_0x4ee1('0x1a')](function(_0x33af51){_0xaac883(_0x352dc5[_0x4ee1('0x15')](0x1f4,_0x33af51[_0x4ee1('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 42e5635..4d57c71 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 _0x80e0=['mailAccount:','remove','update','emit','removeListener','register'];(function(_0x5d8018,_0x588592){var _0x151ac4=function(_0x548679){while(--_0x548679){_0x5d8018['push'](_0x5d8018['shift']());}};_0x151ac4(++_0x588592);}(_0x80e0,0x9d));var _0x080e=function(_0x5d2150,_0x1c6996){_0x5d2150=_0x5d2150-0x0;var _0x327e54=_0x80e0[_0x5d2150];return _0x327e54;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=['save',_0x080e('0x0'),_0x080e('0x1')];function createListener(_0x43e383,_0x4c3ef9){return function(_0x32f4de){_0x4c3ef9[_0x080e('0x2')](_0x43e383,_0x32f4de);};}function removeListener(_0x3a4626,_0x498265){return function(){MailAccountEvents[_0x080e('0x3')](_0x3a4626,_0x498265);};}exports[_0x080e('0x4')]=function(_0x307481){for(var _0x52548f=0x0,_0x4b61b7=events['length'];_0x52548f<_0x4b61b7;_0x52548f++){var _0xd00ba7=events[_0x52548f];var _0x535ebf=createListener(_0x080e('0x5')+_0xd00ba7,_0x307481);MailAccountEvents['on'](_0xd00ba7,_0x535ebf);}}; \ No newline at end of file +var _0x719a=['emit','removeListener','register','length','mailAccount:','./mailAccount.events','save','remove','update'];(function(_0x2aeb4b,_0x1d020e){var _0x9bc330=function(_0x2172e4){while(--_0x2172e4){_0x2aeb4b['push'](_0x2aeb4b['shift']());}};_0x9bc330(++_0x1d020e);}(_0x719a,0x16d));var _0xa719=function(_0x6df56b,_0x1ddf85){_0x6df56b=_0x6df56b-0x0;var _0x1f69c3=_0x719a[_0x6df56b];return _0x1f69c3;};'use strict';var MailAccountEvents=require(_0xa719('0x0'));var events=[_0xa719('0x1'),_0xa719('0x2'),_0xa719('0x3')];function createListener(_0xc83166,_0x13e18f){return function(_0x3663dc){_0x13e18f[_0xa719('0x4')](_0xc83166,_0x3663dc);};}function removeListener(_0x5db95e,_0x28d96b){return function(){MailAccountEvents[_0xa719('0x5')](_0x5db95e,_0x28d96b);};}exports[_0xa719('0x6')]=function(_0x103dea){for(var _0xdb715f=0x0,_0x5767b9=events[_0xa719('0x7')];_0xdb715f<_0x5767b9;_0xdb715f++){var _0x4e489c=events[_0xdb715f];var _0x40c2ff=createListener(_0xa719('0x8')+_0x4e489c,_0x103dea);MailAccountEvents['on'](_0x4e489c,_0x40c2ff);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 364b152..b0f2acb 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 _0xa593=['exports','util','express','Router','./mailApplication.controller','get','/:id','isAuthenticated','show','put','delete','destroy'];(function(_0x377688,_0x40ee99){var _0x1f14ee=function(_0x1c80de){while(--_0x1c80de){_0x377688['push'](_0x377688['shift']());}};_0x1f14ee(++_0x40ee99);}(_0xa593,0xc1));var _0x3a59=function(_0x3a6bc3,_0x14bbed){_0x3a6bc3=_0x3a6bc3-0x0;var _0x1a827a=_0xa593[_0x3a6bc3];return _0x1a827a;};'use strict';var multer=require('multer');var util=require(_0x3a59('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3a59('0x1'));var router=express[_0x3a59('0x2')]();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(_0x3a59('0x3'));router[_0x3a59('0x4')](_0x3a59('0x5'),auth[_0x3a59('0x6')](),controller[_0x3a59('0x7')]);router[_0x3a59('0x8')](_0x3a59('0x5'),auth[_0x3a59('0x6')](),controller['update']);router[_0x3a59('0x9')](_0x3a59('0x5'),auth[_0x3a59('0x6')](),controller[_0x3a59('0xa')]);module[_0x3a59('0xb')]=router; \ No newline at end of file +var _0x158a=['/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','put'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x158a,0xf2));var _0xa158=function(_0x1a39b4,_0x5d0503){_0x1a39b4=_0x1a39b4-0x0;var _0x50eaca=_0x158a[_0x1a39b4];return _0x50eaca;};'use strict';var multer=require(_0xa158('0x0'));var util=require(_0xa158('0x1'));var path=require(_0xa158('0x2'));var timeout=require(_0xa158('0x3'));var express=require(_0xa158('0x4'));var router=express[_0xa158('0x5')]();var fs_extra=require(_0xa158('0x6'));var auth=require(_0xa158('0x7'));var interaction=require(_0xa158('0x8'));var config=require(_0xa158('0x9'));var controller=require('./mailApplication.controller');router[_0xa158('0xa')]('/:id',auth[_0xa158('0xb')](),controller['show']);router[_0xa158('0xc')](_0xa158('0xd'),auth[_0xa158('0xb')](),controller[_0xa158('0xe')]);router[_0xa158('0xf')](_0xa158('0xd'),auth[_0xa158('0xb')](),controller['destroy']);module[_0xa158('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 da068a9..395c5ed 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 _0xdaec=['INTEGER','STRING','noop','TEXT','sequelize','exports'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0xdaec,0x14e));var _0xcdae=function(_0x163d8f,_0x168394){_0x163d8f=_0x163d8f-0x0;var _0x3f3c38=_0xdaec[_0x163d8f];return _0x3f3c38;};'use strict';var Sequelize=require(_0xcdae('0x0'));module[_0xcdae('0x1')]={'priority':{'type':Sequelize[_0xcdae('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xcdae('0x3')],'allowNull':![],'defaultValue':_0xcdae('0x4')},'appdata':{'type':Sequelize[_0xcdae('0x5')]()},'description':{'type':Sequelize[_0xcdae('0x3')]},'interval':{'type':Sequelize[_0xcdae('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xcd1a=['*,*,*,*','sequelize','exports','INTEGER','STRING','noop','TEXT'];(function(_0x5cd42c,_0x1e16a1){var _0x46ab9a=function(_0x2d995b){while(--_0x2d995b){_0x5cd42c['push'](_0x5cd42c['shift']());}};_0x46ab9a(++_0x1e16a1);}(_0xcd1a,0x12e));var _0xacd1=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0xcd1a[_0x255d5b];return _0x3e141a;};'use strict';var Sequelize=require(_0xacd1('0x0'));module[_0xacd1('0x1')]={'priority':{'type':Sequelize[_0xacd1('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xacd1('0x3')],'allowNull':![],'defaultValue':_0xacd1('0x4')},'appdata':{'type':Sequelize[_0xacd1('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xacd1('0x3')],'defaultValue':_0xacd1('0x6')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index e99488c..a05b6db 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(_0x29f730,_0x23d7ed){var _0x189806=function(_0x2838a7){while(--_0x2838a7){_0x29f730['push'](_0x29f730['shift']());}};_0x189806(++_0x23d7ed);}(_0x9bde,0xe1));var _0xe9bd=function(_0x4afe2e,_0xcdb235){_0x4afe2e=_0x4afe2e-0x0;var _0x339a88=_0x9bde[_0x4afe2e];return _0x339a88;};'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 _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(_0x5880ad,_0x4da2dc){var _0x5b3222=function(_0x4d59d8){while(--_0x4d59d8){_0x5880ad['push'](_0x5880ad['shift']());}};_0x5b3222(++_0x4da2dc);}(_0x9bde,0xe1));var _0xe9bd=function(_0x3e7315,_0x2736d4){_0x3e7315=_0x3e7315-0x0;var _0xd14902=_0x9bde[_0x3e7315];return _0xd14902;};'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 diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 61e3fa5..6744d28 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 _0xb5f8=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','./mailApplication.attributes','exports','define','MailApplication','utf8mb4','lodash'];(function(_0x20546f,_0x42c4fa){var _0x22ac4a=function(_0x2a1eb6){while(--_0x2a1eb6){_0x20546f['push'](_0x20546f['shift']());}};_0x22ac4a(++_0x42c4fa);}(_0xb5f8,0x74));var _0x8b5f=function(_0x45ce64,_0xe29253){_0x45ce64=_0x45ce64-0x0;var _0x1e339a=_0xb5f8[_0x45ce64];return _0x1e339a;};'use strict';var _=require(_0x8b5f('0x0'));var util=require(_0x8b5f('0x1'));var logger=require(_0x8b5f('0x2'))(_0x8b5f('0x3'));var moment=require(_0x8b5f('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8b5f('0x5'));var rimraf=require(_0x8b5f('0x6'));var config=require(_0x8b5f('0x7'));var attributes=require(_0x8b5f('0x8'));module[_0x8b5f('0x9')]=function(_0x26fe4e,_0xe32213){return _0x26fe4e[_0x8b5f('0xa')](_0x8b5f('0xb'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8b5f('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x5c4f=['./mailApplication.attributes','define','MailApplication','mail_applications','lodash','util','api','request-promise','path','rimraf','../../config/environment'];(function(_0x473b31,_0x319831){var _0x2f9f61=function(_0x48fa23){while(--_0x48fa23){_0x473b31['push'](_0x473b31['shift']());}};_0x2f9f61(++_0x319831);}(_0x5c4f,0xb4));var _0xf5c4=function(_0x429473,_0x48bf6b){_0x429473=_0x429473-0x0;var _0xea869a=_0x5c4f[_0x429473];return _0xea869a;};'use strict';var _=require(_0xf5c4('0x0'));var util=require(_0xf5c4('0x1'));var logger=require('../../config/logger')(_0xf5c4('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf5c4('0x3'));var fs=require('fs');var path=require(_0xf5c4('0x4'));var rimraf=require(_0xf5c4('0x5'));var config=require(_0xf5c4('0x6'));var attributes=require(_0xf5c4('0x7'));module['exports']=function(_0x43d35a,_0x21e624){return _0x43d35a[_0xf5c4('0x8')](_0xf5c4('0x9'),attributes,{'tableName':_0xf5c4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','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 170438b..7382d33 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 _0x6d5e=['raw','where','attributes','util','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateMailApplication','update','body','options'];(function(_0x3522d8,_0x4fc9dd){var _0x33751f=function(_0x425c83){while(--_0x425c83){_0x3522d8['push'](_0x3522d8['shift']());}};_0x33751f(++_0x4fc9dd);}(_0x6d5e,0xd3));var _0xe6d5=function(_0xc1efce,_0x289fbc){_0xc1efce=_0xc1efce-0x0;var _0x55cec0=_0x6d5e[_0xc1efce];return _0x55cec0;};'use strict';var _=require('lodash');var util=require(_0xe6d5('0x0'));var moment=require('moment');var BPromise=require(_0xe6d5('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe6d5('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xe6d5('0x3'));var logger=require('../../config/logger')(_0xe6d5('0x4'));var config=require(_0xe6d5('0x5'));var jayson=require(_0xe6d5('0x6'));var client=jayson[_0xe6d5('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x26c58b,_0x5d1393,_0x4f6d1b){return new BPromise(function(_0x441562,_0x574095){return client[_0xe6d5('0x8')](_0x26c58b,_0x4f6d1b)[_0xe6d5('0x9')](function(_0x33190b){logger[_0xe6d5('0xa')](_0xe6d5('0xb'),_0x5d1393,_0xe6d5('0xc'));logger['debug']('MailApplication,\x20%s,\x20%s,\x20%s',_0x5d1393,_0xe6d5('0xc'),JSON[_0xe6d5('0xd')](_0x33190b));if(_0x33190b[_0xe6d5('0xe')]){if(_0x33190b[_0xe6d5('0xe')][_0xe6d5('0xf')]===0x1f4){logger[_0xe6d5('0xe')](_0xe6d5('0xb'),_0x5d1393,_0x33190b['error']['message']);return _0x574095(_0x33190b['error'][_0xe6d5('0x10')]);}logger[_0xe6d5('0xe')]('MailApplication,\x20%s,\x20%s',_0x5d1393,_0x33190b[_0xe6d5('0xe')][_0xe6d5('0x10')]);return _0x441562(_0x33190b[_0xe6d5('0xe')][_0xe6d5('0x10')]);}else{logger['info'](_0xe6d5('0xb'),_0x5d1393,_0xe6d5('0xc'));_0x441562(_0x33190b[_0xe6d5('0x11')][_0xe6d5('0x10')]);}})[_0xe6d5('0x12')](function(_0xe1f701){logger[_0xe6d5('0xe')](_0xe6d5('0xb'),_0x5d1393,_0xe1f701);_0x574095(_0xe1f701);});});}exports[_0xe6d5('0x13')]=function(_0x212d29){var _0x57d876=this;return new Promise(function(_0x5efc7c,_0x117961){return db['MailApplication'][_0xe6d5('0x14')](_0x212d29[_0xe6d5('0x15')],{'raw':_0x212d29['options']?_0x212d29[_0xe6d5('0x16')][_0xe6d5('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x212d29[_0xe6d5('0x16')]?_0x212d29[_0xe6d5('0x16')][_0xe6d5('0x18')]||null:null,'attributes':_0x212d29[_0xe6d5('0x16')]?_0x212d29[_0xe6d5('0x16')][_0xe6d5('0x19')]||null:null,'limit':_0x212d29[_0xe6d5('0x16')]?_0x212d29[_0xe6d5('0x16')]['limit']||null:null})[_0xe6d5('0x9')](function(_0x54c4ab){logger[_0xe6d5('0xa')](_0xe6d5('0x13'),_0x212d29);logger['debug'](_0xe6d5('0x13'),_0x212d29,JSON['stringify'](_0x54c4ab));_0x5efc7c(_0x54c4ab);})[_0xe6d5('0x12')](function(_0x255f8c){logger[_0xe6d5('0xe')](_0xe6d5('0x13'),_0x255f8c[_0xe6d5('0x10')],_0x212d29);_0x117961(_0x57d876['error'](0x1f4,_0x255f8c[_0xe6d5('0x10')]));});});}; \ No newline at end of file +var _0xe435=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateMailApplication','MailApplication','update','body','options','where','attributes','limit','then','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xe435,0xcc));var _0x5e43=function(_0x174c96,_0x78a114){_0x174c96=_0x174c96-0x0;var _0x3ad839=_0xe435[_0x174c96];return _0x3ad839;};'use strict';var _=require(_0x5e43('0x0'));var util=require(_0x5e43('0x1'));var moment=require(_0x5e43('0x2'));var BPromise=require(_0x5e43('0x3'));var rs=require(_0x5e43('0x4'));var fs=require('fs');var Redis=require(_0x5e43('0x5'));var db=require(_0x5e43('0x6'))['db'];var utils=require(_0x5e43('0x7'));var logger=require(_0x5e43('0x8'))(_0x5e43('0x9'));var config=require(_0x5e43('0xa'));var jayson=require(_0x5e43('0xb'));var client=jayson[_0x5e43('0xc')][_0x5e43('0xd')]({'port':0x232a});function respondWithRpcPromise(_0xd7beaf,_0x5c0353,_0x585b7c){return new BPromise(function(_0x1d94b8,_0x4aee71){return client[_0x5e43('0xe')](_0xd7beaf,_0x585b7c)['then'](function(_0x17e91d){logger[_0x5e43('0xf')](_0x5e43('0x10'),_0x5c0353,_0x5e43('0x11'));logger[_0x5e43('0x12')](_0x5e43('0x13'),_0x5c0353,_0x5e43('0x11'),JSON[_0x5e43('0x14')](_0x17e91d));if(_0x17e91d[_0x5e43('0x15')]){if(_0x17e91d[_0x5e43('0x15')][_0x5e43('0x16')]===0x1f4){logger['error'](_0x5e43('0x10'),_0x5c0353,_0x17e91d[_0x5e43('0x15')][_0x5e43('0x17')]);return _0x4aee71(_0x17e91d[_0x5e43('0x15')][_0x5e43('0x17')]);}logger[_0x5e43('0x15')](_0x5e43('0x10'),_0x5c0353,_0x17e91d[_0x5e43('0x15')]['message']);return _0x1d94b8(_0x17e91d['error'][_0x5e43('0x17')]);}else{logger[_0x5e43('0xf')](_0x5e43('0x10'),_0x5c0353,_0x5e43('0x11'));_0x1d94b8(_0x17e91d[_0x5e43('0x18')]['message']);}})['catch'](function(_0x5c308b){logger[_0x5e43('0x15')]('MailApplication,\x20%s,\x20%s',_0x5c0353,_0x5c308b);_0x4aee71(_0x5c308b);});});}exports[_0x5e43('0x19')]=function(_0x11ba22){var _0x5b593=this;return new Promise(function(_0x12b185,_0x4201e9){return db[_0x5e43('0x1a')][_0x5e43('0x1b')](_0x11ba22[_0x5e43('0x1c')],{'raw':_0x11ba22['options']?_0x11ba22[_0x5e43('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x11ba22['options']?_0x11ba22[_0x5e43('0x1d')][_0x5e43('0x1e')]||null:null,'attributes':_0x11ba22[_0x5e43('0x1d')]?_0x11ba22[_0x5e43('0x1d')][_0x5e43('0x1f')]||null:null,'limit':_0x11ba22[_0x5e43('0x1d')]?_0x11ba22['options'][_0x5e43('0x20')]||null:null})[_0x5e43('0x21')](function(_0x5c226c){logger[_0x5e43('0xf')](_0x5e43('0x19'),_0x11ba22);logger[_0x5e43('0x12')]('UpdateMailApplication',_0x11ba22,JSON[_0x5e43('0x14')](_0x5c226c));_0x12b185(_0x5c226c);})[_0x5e43('0x22')](function(_0x3ba386){logger[_0x5e43('0x15')](_0x5e43('0x19'),_0x3ba386[_0x5e43('0x17')],_0x11ba22);_0x4201e9(_0x5b593[_0x5e43('0x15')](0x1f4,_0x3ba386[_0x5e43('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 8a3e179..e813c91 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 _0x7401=['isAuthenticated','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','tracked','mail','mailinteraction:addtags','addTags','mailinteraction:update','update','delete','mailinteraction:destroy','destroy','removeTags','exports','express','../../components/interaction/service','./mailInteraction.controller','get','index','/describe','describe','/:id'];(function(_0x8f7825,_0xaa0ca0){var _0x29a7c9=function(_0x43f1eb){while(--_0x43f1eb){_0x8f7825['push'](_0x8f7825['shift']());}};_0x29a7c9(++_0xaa0ca0);}(_0x7401,0xd8));var _0x1740=function(_0x44b0c4,_0x5e6885){_0x44b0c4=_0x44b0c4-0x0;var _0x1a2713=_0x7401[_0x44b0c4];return _0x1a2713;};'use strict';var express=require(_0x1740('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x1740('0x1'));var controller=require(_0x1740('0x2'));router[_0x1740('0x3')]('/',auth['isAuthenticated'](),controller[_0x1740('0x4')]);router['get'](_0x1740('0x5'),auth['isAuthenticated'](),controller[_0x1740('0x6')]);router[_0x1740('0x3')](_0x1740('0x7'),auth[_0x1740('0x8')](),controller[_0x1740('0x9')]);router[_0x1740('0x3')](_0x1740('0xa'),auth[_0x1740('0x8')](),controller[_0x1740('0xb')]);router['get'](_0x1740('0xc'),auth[_0x1740('0x8')](),controller[_0x1740('0xd')]);router[_0x1740('0xe')]('/',auth[_0x1740('0x8')](),controller[_0x1740('0xf')]);router[_0x1740('0xe')]('/:id/messages',auth[_0x1740('0x8')](),controller[_0x1740('0x10')]);router[_0x1740('0xe')]('/:id/tags',auth[_0x1740('0x8')](),interaction[_0x1740('0x11')](_0x1740('0x12'),_0x1740('0x13')),controller[_0x1740('0x14')]);router['put'](_0x1740('0x7'),auth['isAuthenticated'](),interaction[_0x1740('0x11')](_0x1740('0x12'),_0x1740('0x15')),controller[_0x1740('0x16')]);router[_0x1740('0x17')](_0x1740('0x7'),auth['isAuthenticated'](),interaction['tracked']('mail',_0x1740('0x18')),controller[_0x1740('0x19')]);router[_0x1740('0x17')]('/:id/tags',auth[_0x1740('0x8')](),controller[_0x1740('0x1a')]);module[_0x1740('0x1b')]=router; \ No newline at end of file +var _0x9749=['/:id/download','download','post','create','/:id/messages','addMessage','/:id/tags','mail','mailinteraction:addtags','update','delete','tracked','mailinteraction:destroy','destroy','removeTags','exports','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','getMessages'];(function(_0x1147ab,_0x10e72b){var _0x55cb5a=function(_0x364bd6){while(--_0x364bd6){_0x1147ab['push'](_0x1147ab['shift']());}};_0x55cb5a(++_0x10e72b);}(_0x9749,0x1a5));var _0x9974=function(_0x1ce15a,_0x303dc9){_0x1ce15a=_0x1ce15a-0x0;var _0x55c07d=_0x9749[_0x1ce15a];return _0x55c07d;};'use strict';var express=require('express');var router=express[_0x9974('0x0')]();var auth=require(_0x9974('0x1'));var interaction=require(_0x9974('0x2'));var controller=require('./mailInteraction.controller');router[_0x9974('0x3')]('/',auth[_0x9974('0x4')](),controller[_0x9974('0x5')]);router[_0x9974('0x3')](_0x9974('0x6'),auth[_0x9974('0x4')](),controller[_0x9974('0x7')]);router[_0x9974('0x3')](_0x9974('0x8'),auth['isAuthenticated'](),controller[_0x9974('0x9')]);router[_0x9974('0x3')]('/:id/messages',auth['isAuthenticated'](),controller[_0x9974('0xa')]);router[_0x9974('0x3')](_0x9974('0xb'),auth[_0x9974('0x4')](),controller[_0x9974('0xc')]);router[_0x9974('0xd')]('/',auth[_0x9974('0x4')](),controller[_0x9974('0xe')]);router[_0x9974('0xd')](_0x9974('0xf'),auth[_0x9974('0x4')](),controller[_0x9974('0x10')]);router[_0x9974('0xd')](_0x9974('0x11'),auth[_0x9974('0x4')](),interaction['tracked'](_0x9974('0x12'),_0x9974('0x13')),controller['addTags']);router['put'](_0x9974('0x8'),auth[_0x9974('0x4')](),interaction['tracked'](_0x9974('0x12'),'mailinteraction:update'),controller[_0x9974('0x14')]);router[_0x9974('0x15')](_0x9974('0x8'),auth[_0x9974('0x4')](),interaction[_0x9974('0x16')](_0x9974('0x12'),_0x9974('0x17')),controller[_0x9974('0x18')]);router['delete']('/:id/tags',auth['isAuthenticated'](),controller[_0x9974('0x19')]);module[_0x9974('0x1a')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 2d60735..f683b08 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 _0xd2a0=['exports','BOOLEAN','DATE','STRING','long','TEXT','sequelize','iconv'];(function(_0x560b12,_0x4ecda3){var _0x13b3c7=function(_0x5e15ca){while(--_0x5e15ca){_0x560b12['push'](_0x560b12['shift']());}};_0x13b3c7(++_0x4ecda3);}(_0xd2a0,0xce));var _0x0d2a=function(_0x412d5e,_0x46ba9d){_0x412d5e=_0x412d5e-0x0;var _0x4a02de=_0xd2a0[_0x412d5e];return _0x4a02de;};'use strict';var Sequelize=require(_0x0d2a('0x0'));var iconv=require(_0x0d2a('0x1'));module[_0x0d2a('0x2')]={'closed':{'type':Sequelize[_0x0d2a('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x0d2a('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x0d2a('0x5')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x0d2a('0x5')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0x0d2a('0x5')]},'cc':{'type':Sequelize['TEXT'](_0x0d2a('0x6'))},'subject':{'type':Sequelize[_0x0d2a('0x7')]()},'attach':{'type':Sequelize[_0x0d2a('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x0d2a('0x4')]},'substatus':{'type':Sequelize[_0x0d2a('0x5')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x0d2a('0x4')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xd411=['long','ENUM','out','sequelize','iconv','exports','BOOLEAN','DATE','STRING','TEXT'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0xd411,0x125));var _0x1d41=function(_0x2ad989,_0x5d041e){_0x2ad989=_0x2ad989-0x0;var _0x1a53ff=_0xd411[_0x2ad989];return _0x1a53ff;};'use strict';var Sequelize=require(_0x1d41('0x0'));var iconv=require(_0x1d41('0x1'));module[_0x1d41('0x2')]={'closed':{'type':Sequelize[_0x1d41('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x1d41('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x1d41('0x5')]},'thirdDisposition':{'type':Sequelize[_0x1d41('0x5')]},'note':{'type':Sequelize[_0x1d41('0x5')]},'inReplyTo':{'type':Sequelize[_0x1d41('0x5')](0x1fe)},'to':{'type':Sequelize[_0x1d41('0x5')]},'cc':{'type':Sequelize[_0x1d41('0x6')](_0x1d41('0x7'))},'subject':{'type':Sequelize[_0x1d41('0x6')]()},'attach':{'type':Sequelize[_0x1d41('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x1d41('0x4')]},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize[_0x1d41('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x1d41('0x8')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x1d41('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x1d41('0x8')]('in',_0x1d41('0x9')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x1d41('0x3')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 7f6180e..c91afc4 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 _0xe0f9=['root','server','files','tmp','attachments','push','Attachments','Messages','from','bcc','createdAt','get','mkdirSync','each','subject','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','existsSync','writeFileSync','message%d.eml','unlinkSync','eml-format','rimraf','zip-dir','moment','bluebird','path','lodash','juice','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','html-entities','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','status','end','offset','limit','count','set','Content-Range','json','update','then','sendStatus','error','name','send','MailInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','query','user','catch','params','model','keys','filters','intersection','attributes','fields','includeAll','include','merge','find','create','body','describe','addMessage','MailMessage','omit','ids','getMessages','hasOwnProperty','order','sort','where','filter','$gte','split','format','inlineCss','true','length','rows','spread','Tag','color','emit','mailInteractionTags:save','removeTags','unix','toString','join'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xe0f9,0x1c8));var _0x9e0f=function(_0xeb0ae6,_0x408476){_0xeb0ae6=_0xeb0ae6-0x0;var _0xfe41e3=_0xe0f9[_0xeb0ae6];return _0xfe41e3;};'use strict';var emlformat=require(_0x9e0f('0x0'));var rimraf=require(_0x9e0f('0x1'));var zipdir=require(_0x9e0f('0x2'));var moment=require(_0x9e0f('0x3'));var BPromise=require(_0x9e0f('0x4'));var util=require('util');var path=require(_0x9e0f('0x5'));var fs=require('fs');var _=require(_0x9e0f('0x6'));var juice=require(_0x9e0f('0x7'));var Redis=require(_0x9e0f('0x8'));var interaction=require('../../components/interaction/service');var qs=require(_0x9e0f('0x9'));var logger=require(_0x9e0f('0xa'))('api');var config=require(_0x9e0f('0xb'));var db=require(_0x9e0f('0xc'))['db'];var htmlEntities=require(_0x9e0f('0xd'));config[_0x9e0f('0xe')]=_[_0x9e0f('0xf')](config[_0x9e0f('0xe')],{'host':_0x9e0f('0x10'),'port':0x18eb});var socket=require(_0x9e0f('0x11'))(new Redis(config['redis']));require(_0x9e0f('0x12'))[_0x9e0f('0x13')](socket);function respondWithStatusCode(_0x4ecabe,_0x5787d3){_0x5787d3=_0x5787d3||0xcc;return function(_0x305dba){if(_0x305dba){return _0x4ecabe['sendStatus'](_0x5787d3);}return _0x4ecabe[_0x9e0f('0x14')](_0x5787d3)[_0x9e0f('0x15')]();};}function respondWithResult(_0x2d93b3,_0xa10b12){_0xa10b12=_0xa10b12||0xc8;return function(_0x21a019){if(_0x21a019){return _0x2d93b3[_0x9e0f('0x14')](_0xa10b12)['json'](_0x21a019);}};}function respondWithFilteredResult(_0x20118f,_0x155399){return function(_0x1ef11d){if(_0x1ef11d){var _0x210439=typeof _0x155399[_0x9e0f('0x16')]==='undefined'&&typeof _0x155399[_0x9e0f('0x17')]==='undefined';var _0x8348c0=_0x1ef11d[_0x9e0f('0x18')];var _0x3cbad4=_0x210439?0x0:_0x155399[_0x9e0f('0x16')];var _0x2fbe47=_0x210439?_0x1ef11d[_0x9e0f('0x18')]:_0x155399[_0x9e0f('0x16')]+_0x155399[_0x9e0f('0x17')];var _0x5494ed;if(_0x2fbe47>=_0x8348c0){_0x2fbe47=_0x8348c0;_0x5494ed=0xc8;}else{_0x5494ed=0xce;}_0x20118f[_0x9e0f('0x14')](_0x5494ed);return _0x20118f[_0x9e0f('0x19')](_0x9e0f('0x1a'),_0x3cbad4+'-'+_0x2fbe47+'/'+_0x8348c0)[_0x9e0f('0x1b')](_0x1ef11d);}return null;};}function saveUpdates(_0x19c5fa){return function(_0x18a028){if(_0x18a028){return _0x18a028[_0x9e0f('0x1c')](_0x19c5fa)[_0x9e0f('0x1d')](function(_0x34f700){return _0x34f700;});}return null;};}function removeEntity(_0x49c6a9){return function(_0x36ddf1){if(_0x36ddf1){return _0x36ddf1['destroy']()[_0x9e0f('0x1d')](function(){_0x49c6a9[_0x9e0f('0x14')](0xcc)[_0x9e0f('0x15')]();});}};}function handleEntityNotFound(_0x5e9e04){return function(_0x17fc15){if(!_0x17fc15){_0x5e9e04[_0x9e0f('0x1e')](0x194);}return _0x17fc15;};}function handleError(_0x381430,_0xa4e8d2){_0xa4e8d2=_0xa4e8d2||0x1f4;return function(_0x479ecb){logger[_0x9e0f('0x1f')](_0x479ecb['stack']);if(_0x479ecb['name']){delete _0x479ecb[_0x9e0f('0x20')];}_0x381430[_0x9e0f('0x14')](_0xa4e8d2)[_0x9e0f('0x21')](_0x479ecb);};}exports['index']=function(_0x5e34d8,_0x3584c6){var _0x3a7ae0={};var _0x576d98=_['map'](db[_0x9e0f('0x22')][_0x9e0f('0x23')],function(_0x12b47d){return{'name':_0x12b47d[_0x9e0f('0x24')],'type':_0x12b47d[_0x9e0f('0x25')][_0x9e0f('0x26')]};});_0x3a7ae0=qs[_0x9e0f('0x27')](_0x576d98,_0x5e34d8);return interaction[_0x9e0f('0x28')]('mail',_0x5e34d8[_0x9e0f('0x29')],_0x5e34d8[_0x9e0f('0x2a')],_0x3a7ae0,_0x576d98)[_0x9e0f('0x1d')](respondWithFilteredResult(_0x3584c6,_0x3a7ae0))[_0x9e0f('0x2b')](handleError(_0x3584c6,null));};exports['show']=function(_0x5b4a6d,_0x5976cf){var _0x2ddc1b={'raw':![],'where':{'id':_0x5b4a6d[_0x9e0f('0x2c')]['id']}},_0x38a108={};_0x38a108[_0x9e0f('0x2d')]=_[_0x9e0f('0x2e')](db[_0x9e0f('0x22')]['rawAttributes']);_0x38a108['query']=_[_0x9e0f('0x2e')](_0x5b4a6d[_0x9e0f('0x29')]);_0x38a108[_0x9e0f('0x2f')]=_[_0x9e0f('0x30')](_0x38a108['model'],_0x38a108['query']);_0x2ddc1b[_0x9e0f('0x31')]=_['intersection'](_0x38a108[_0x9e0f('0x2d')],qs[_0x9e0f('0x32')](_0x5b4a6d[_0x9e0f('0x29')]['fields']));_0x2ddc1b[_0x9e0f('0x31')]=_0x2ddc1b[_0x9e0f('0x31')]['length']?_0x2ddc1b['attributes']:_0x38a108[_0x9e0f('0x2d')];if(_0x5b4a6d[_0x9e0f('0x29')][_0x9e0f('0x33')]){_0x2ddc1b[_0x9e0f('0x34')]=[{'all':!![]}];}_0x2ddc1b=_[_0x9e0f('0x35')]({},_0x2ddc1b,_0x5b4a6d['options']);return db['MailInteraction'][_0x9e0f('0x36')](_0x2ddc1b)[_0x9e0f('0x1d')](handleEntityNotFound(_0x5976cf,null))['then'](respondWithResult(_0x5976cf,null))[_0x9e0f('0x2b')](handleError(_0x5976cf,null));};exports[_0x9e0f('0x37')]=function(_0xaba157,_0x1d54cf){return db['MailInteraction'][_0x9e0f('0x37')](_0xaba157[_0x9e0f('0x38')],{})['then'](respondWithResult(_0x1d54cf,0xc9))['catch'](handleError(_0x1d54cf,null));};exports[_0x9e0f('0x1c')]=function(_0x3fe0ec,_0x4b37d3){if(_0x3fe0ec[_0x9e0f('0x38')]['id']){delete _0x3fe0ec['body']['id'];}return db[_0x9e0f('0x22')][_0x9e0f('0x36')]({'where':{'id':_0x3fe0ec['params']['id']}})['then'](handleEntityNotFound(_0x4b37d3,null))[_0x9e0f('0x1d')](saveUpdates(_0x3fe0ec[_0x9e0f('0x38')],null))['then'](respondWithResult(_0x4b37d3,null))['catch'](handleError(_0x4b37d3,null));};exports['destroy']=function(_0x111736,_0x49c8be){return db[_0x9e0f('0x22')][_0x9e0f('0x36')]({'where':{'id':_0x111736['params']['id']}})[_0x9e0f('0x1d')](handleEntityNotFound(_0x49c8be,null))['then'](removeEntity(_0x49c8be,null))[_0x9e0f('0x2b')](handleError(_0x49c8be,null));};exports[_0x9e0f('0x39')]=function(_0x3eadbd,_0x5890bc){return db[_0x9e0f('0x22')][_0x9e0f('0x39')]()[_0x9e0f('0x1d')](respondWithResult(_0x5890bc,null))[_0x9e0f('0x2b')](handleError(_0x5890bc,null));};exports[_0x9e0f('0x3a')]=function(_0x36ebb8,_0x1ac083){return db[_0x9e0f('0x3b')][_0x9e0f('0x36')]({'where':{'id':_0x36ebb8[_0x9e0f('0x2c')]['id']}})[_0x9e0f('0x1d')](handleEntityNotFound(_0x1ac083,null))[_0x9e0f('0x1d')](function(_0x2ab01f){if(_0x2ab01f){return _0x2ab01f[_0x9e0f('0x3a')](_0x36ebb8[_0x9e0f('0x38')]['ids'],_[_0x9e0f('0x3c')](_0x36ebb8['body'],[_0x9e0f('0x3d'),'id'])||{});}})[_0x9e0f('0x1d')](respondWithResult(_0x1ac083,null))[_0x9e0f('0x2b')](handleError(_0x1ac083,null));};exports[_0x9e0f('0x3e')]=function(_0xf5258,_0x5a6d70){var _0x340cb8={'raw':![],'where':{}};var _0x4283dd={};var _0x57a3ae={'count':0x0,'rows':[]};return db[_0x9e0f('0x22')]['findOne']({'where':{'id':_0xf5258[_0x9e0f('0x2c')]['id']}})['then'](handleEntityNotFound(_0x5a6d70,null))[_0x9e0f('0x1d')](function(_0x21d65e){if(_0x21d65e){_0x4283dd[_0x9e0f('0x2d')]=_[_0x9e0f('0x2e')](db[_0x9e0f('0x3b')][_0x9e0f('0x23')]);_0x4283dd[_0x9e0f('0x29')]=_[_0x9e0f('0x2e')](_0xf5258[_0x9e0f('0x29')]);_0x4283dd[_0x9e0f('0x2f')]=_['intersection'](_0x4283dd[_0x9e0f('0x2d')],_0x4283dd[_0x9e0f('0x29')]);_0x340cb8[_0x9e0f('0x31')]=_[_0x9e0f('0x30')](_0x4283dd[_0x9e0f('0x2d')],qs['fields'](_0xf5258[_0x9e0f('0x29')][_0x9e0f('0x32')]));_0x340cb8[_0x9e0f('0x31')]=_0x340cb8[_0x9e0f('0x31')]['length']?_0x340cb8['attributes']:_0x4283dd['model'];if(!_0xf5258[_0x9e0f('0x29')][_0x9e0f('0x3f')]('nolimit')){_0x340cb8['limit']=qs[_0x9e0f('0x17')](_0xf5258[_0x9e0f('0x29')][_0x9e0f('0x17')]);_0x340cb8[_0x9e0f('0x16')]=qs[_0x9e0f('0x16')](_0xf5258[_0x9e0f('0x29')][_0x9e0f('0x16')]);}_0x340cb8[_0x9e0f('0x40')]=qs[_0x9e0f('0x41')](_0xf5258[_0x9e0f('0x29')]['sort']);_0x340cb8[_0x9e0f('0x42')]=qs[_0x9e0f('0x2f')](_['pick'](_0xf5258['query'],_0x4283dd[_0x9e0f('0x2f')]));_0x340cb8[_0x9e0f('0x42')]['MailInteractionId']=_0x21d65e['id'];if(_0xf5258[_0x9e0f('0x29')]['filter']){_0x340cb8[_0x9e0f('0x42')]=_[_0x9e0f('0x35')](_0x340cb8['where'],{'$or':_['map'](_0x340cb8[_0x9e0f('0x31')],function(_0x18ef2f){var _0xedf2dd={};_0xedf2dd[_0x18ef2f]={'$like':'%'+_0xf5258[_0x9e0f('0x29')][_0x9e0f('0x43')]+'%'};return _0xedf2dd;})});}if(_0xf5258[_0x9e0f('0x29')][_0x9e0f('0x44')]){var _0xb48cc1=_0xf5258['query'][_0x9e0f('0x44')][_0x9e0f('0x45')](',');var _0x4ba05f={};_0x4ba05f[_0xb48cc1[0x0]]={'$gte':moment(_0xb48cc1[0x1])[_0x9e0f('0x46')]('YYYY-MM-DD\x20HH:mm:ss')};_0x340cb8['where']=_[_0x9e0f('0x35')](_0x340cb8['where'],_0x4ba05f);}_0x340cb8=_['merge']({},_0x340cb8,_0xf5258['options']);return db[_0x9e0f('0x3b')][_0x9e0f('0x18')]({'where':_0x340cb8[_0x9e0f('0x42')]})[_0x9e0f('0x1d')](function(_0x2ae42c){_0x57a3ae[_0x9e0f('0x18')]=_0x2ae42c;if(_0xf5258[_0x9e0f('0x29')][_0x9e0f('0x33')]){_0x340cb8[_0x9e0f('0x34')]=[{'all':!![]}];}return db[_0x9e0f('0x3b')][_0x9e0f('0x28')](_0x340cb8);})[_0x9e0f('0x1d')](function(_0x1b789c){if(_0xf5258['query'][_0x9e0f('0x47')]===_0x9e0f('0x48')){for(var _0xd97a81=0x0;_0xd97a81<_0x1b789c[_0x9e0f('0x49')];_0xd97a81++){_0x1b789c[_0xd97a81][_0x9e0f('0x38')]=juice(_0x1b789c[_0xd97a81]['body']);}}_0x57a3ae[_0x9e0f('0x4a')]=_0x1b789c;return _0x57a3ae;});}})['then'](respondWithFilteredResult(_0x5a6d70,_0x340cb8))[_0x9e0f('0x2b')](handleError(_0x5a6d70,null));};exports['addTags']=function(_0x3561b7,_0x2ac374){return db[_0x9e0f('0x22')][_0x9e0f('0x36')]({'where':{'id':_0x3561b7[_0x9e0f('0x2c')]['id']}})['then'](handleEntityNotFound(_0x2ac374,null))[_0x9e0f('0x1d')](function(_0x1feee8){if(_0x1feee8){return _0x1feee8['setTags'](_0x3561b7[_0x9e0f('0x38')][_0x9e0f('0x3d')],_[_0x9e0f('0x3c')](_0x3561b7[_0x9e0f('0x38')],['ids','id'])||{})[_0x9e0f('0x4b')](function(){return db[_0x9e0f('0x4c')]['findAll']({'attributes':['id','name',_0x9e0f('0x4d')],'where':{'id':_0x3561b7[_0x9e0f('0x38')][_0x9e0f('0x3d')]}});})[_0x9e0f('0x1d')](function(_0x11c9d2){socket[_0x9e0f('0x4e')](_0x9e0f('0x4f'),{'id':Number(_0x3561b7[_0x9e0f('0x2c')]['id']),'tags':_0x11c9d2||[]});return{'id':Number(_0x3561b7[_0x9e0f('0x2c')]['id']),'tags':_0x11c9d2||[]};});}})[_0x9e0f('0x1d')](respondWithResult(_0x2ac374,null))['catch'](handleError(_0x2ac374,null));};exports[_0x9e0f('0x50')]=function(_0xa5631f,_0x1da266){return db[_0x9e0f('0x22')][_0x9e0f('0x36')]({'where':{'id':_0xa5631f[_0x9e0f('0x2c')]['id']}})[_0x9e0f('0x1d')](handleEntityNotFound(_0x1da266,null))[_0x9e0f('0x1d')](function(_0x18dc60){if(_0x18dc60){return _0x18dc60[_0x9e0f('0x50')](_0xa5631f['query']['ids']);}})[_0x9e0f('0x1d')](respondWithStatusCode(_0x1da266,null))[_0x9e0f('0x2b')](handleError(_0x1da266,null));};exports['download']=function(_0x4fdde5,_0x10796b){var _0x587c5f=moment()[_0x9e0f('0x51')]()[_0x9e0f('0x52')]();var _0x57a8a6=path[_0x9e0f('0x53')](config[_0x9e0f('0x54')],_0x9e0f('0x55'),_0x9e0f('0x56'),_0x9e0f('0x57'));var _0xa465cd=path[_0x9e0f('0x53')](config['root'],_0x9e0f('0x55'),_0x9e0f('0x56'),'attachments');var _0x5423ca=path[_0x9e0f('0x53')](_0x57a8a6,_0x587c5f);var _0x23b98b=util[_0x9e0f('0x46')]('transcript-%d-%s.zip',_0x4fdde5[_0x9e0f('0x2c')]['id'],_0x587c5f);var _0x6c74cf=path[_0x9e0f('0x53')](_0x57a8a6,_0x23b98b);var _0x4236c3=[];if(_0x4fdde5[_0x9e0f('0x29')][_0x9e0f('0x58')]){_0x4236c3[_0x9e0f('0x59')]({'model':db['Attachment'],'as':_0x9e0f('0x5a'),'raw':!![]});}var _0x302c2d=[{'model':db[_0x9e0f('0x3b')],'as':_0x9e0f('0x5b'),'attributes':['id','body',_0x9e0f('0x5c'),'to','cc',_0x9e0f('0x5d'),'subject',_0x9e0f('0x5e')],'where':{'secret':![]},'order':qs[_0x9e0f('0x41')]('id'),'include':_0x4236c3}];return db[_0x9e0f('0x22')][_0x9e0f('0x36')]({'where':{'id':_0x4fdde5[_0x9e0f('0x2c')]['id']},'include':_0x302c2d})[_0x9e0f('0x1d')](handleEntityNotFound(_0x10796b,null))[_0x9e0f('0x1d')](function(_0x121f89){if(_0x121f89&&_0x121f89['Messages']){var _0x59a3f0=_0x121f89[_0x9e0f('0x5f')]({'plain':!![]});fs[_0x9e0f('0x60')](_0x5423ca);return BPromise[_0x9e0f('0x61')](_0x59a3f0[_0x9e0f('0x5b')],function(_0x48547e,_0x1cedf9){var _0x56379a={'from':_0x48547e[_0x9e0f('0x5c')],'to':_0x48547e['to']||'missing.recipient@your.company.com','subject':_0x48547e[_0x9e0f('0x62')],'html':htmlEntities[_0x9e0f('0x63')](_0x48547e['body']),'headers':{'Date':moment(_0x48547e['createdAt'])['format'](_0x9e0f('0x64'))},'attachments':[]};if(_0x48547e['cc']){_0x56379a[_0x9e0f('0x65')]['Cc']=_0x48547e['cc'];}if(_0x48547e['bcc']){_0x56379a['headers'][_0x9e0f('0x66')]=_0x48547e[_0x9e0f('0x5d')];}return new BPromise(function(_0x3e2ffa,_0x38cd18){if(_0x48547e[_0x9e0f('0x5a')]){for(var _0x57d755=0x0;_0x57d755<_0x48547e[_0x9e0f('0x5a')][_0x9e0f('0x49')];_0x57d755++){var _0x2b2746=_0x48547e[_0x9e0f('0x5a')][_0x57d755];var _0x39fd71=path['join'](_0xa465cd,_0x2b2746[_0x9e0f('0x67')]);if(fs[_0x9e0f('0x68')](_0x39fd71)){_0x56379a['attachments'][_0x9e0f('0x59')]({'name':_0x2b2746[_0x9e0f('0x20')],'contentType':_0x2b2746['type'],'data':fs['readFileSync'](_0x39fd71)});}}}emlformat['build'](_0x56379a,function(_0x5924ba,_0x4d1aab){if(_0x5924ba)return _0x38cd18(_0x5924ba);fs[_0x9e0f('0x69')](path[_0x9e0f('0x53')](_0x5423ca,util[_0x9e0f('0x46')](_0x9e0f('0x6a'),_0x1cedf9)),_0x4d1aab);return _0x3e2ffa(_0x4d1aab);});});})[_0x9e0f('0x1d')](function(){return new BPromise(function(_0xb61ce4,_0x24f117){zipdir(_0x5423ca,{'saveTo':_0x6c74cf},function(_0x34466c,_0x50bb3b){if(_0x34466c)return _0x24f117(_0x34466c);return _0xb61ce4(_0x50bb3b);});})[_0x9e0f('0x1d')](function(){return new BPromise(function(_0x3e0f2d,_0x45fd3f){rimraf(_0x5423ca,function(_0x1ddf6f){if(_0x1ddf6f)_0x45fd3f(_0x1ddf6f);return _0x3e0f2d();});});})['then'](function(){return _0x10796b['download'](_0x6c74cf,_0x23b98b,function(_0x14f55e){if(!_0x14f55e)fs[_0x9e0f('0x6b')](_0x6c74cf);});});});}else{return _0x10796b[_0x9e0f('0x1e')](0xc8);}})[_0x9e0f('0x2b')](handleError(_0x10796b,null));}; \ No newline at end of file +var _0x18b3=['zip-dir','moment','util','path','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','html-entities','defaults','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','sendStatus','status','end','json','limit','undefined','count','offset','set','then','destroy','error','stack','name','send','index','map','MailInteraction','rawAttributes','fieldName','type','getOptions','findAll','mail','query','user','catch','show','model','keys','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','create','body','update','params','describe','addMessage','MailMessage','ids','omit','getMessages','findOne','hasOwnProperty','nolimit','order','sort','pick','where','MailInteractionId','filter','$gte','split','format','inlineCss','true','rows','addTags','setTags','spread','Tag','emit','mailInteractionTags:save','removeTags','download','toString','root','server','files','join','transcript-%d-%s.zip','attachments','push','Attachments','Messages','from','subject','createdAt','get','each','missing.recipient@your.company.com','decode','headers','Bcc','bcc','basename','existsSync','readFileSync','writeFileSync','message%d.eml','unlinkSync','eml-format','rimraf'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x18b3,0x74));var _0x318b=function(_0x4581f5,_0x144351){_0x4581f5=_0x4581f5-0x0;var _0x26ca7c=_0x18b3[_0x4581f5];return _0x26ca7c;};'use strict';var emlformat=require(_0x318b('0x0'));var rimraf=require(_0x318b('0x1'));var zipdir=require(_0x318b('0x2'));var moment=require(_0x318b('0x3'));var BPromise=require('bluebird');var util=require(_0x318b('0x4'));var path=require(_0x318b('0x5'));var fs=require('fs');var _=require('lodash');var juice=require('juice');var Redis=require(_0x318b('0x6'));var interaction=require(_0x318b('0x7'));var qs=require(_0x318b('0x8'));var logger=require(_0x318b('0x9'))('api');var config=require(_0x318b('0xa'));var db=require(_0x318b('0xb'))['db'];var htmlEntities=require(_0x318b('0xc'));config['redis']=_[_0x318b('0xd')](config[_0x318b('0xe')],{'host':_0x318b('0xf'),'port':0x18eb});var socket=require(_0x318b('0x10'))(new Redis(config[_0x318b('0xe')]));require(_0x318b('0x11'))[_0x318b('0x12')](socket);function respondWithStatusCode(_0x5a106b,_0x5cd302){_0x5cd302=_0x5cd302||0xcc;return function(_0x2ff9ae){if(_0x2ff9ae){return _0x5a106b[_0x318b('0x13')](_0x5cd302);}return _0x5a106b[_0x318b('0x14')](_0x5cd302)[_0x318b('0x15')]();};}function respondWithResult(_0x332150,_0x407a1e){_0x407a1e=_0x407a1e||0xc8;return function(_0x37d42e){if(_0x37d42e){return _0x332150[_0x318b('0x14')](_0x407a1e)[_0x318b('0x16')](_0x37d42e);}};}function respondWithFilteredResult(_0x2f9e39,_0x2f0726){return function(_0x1e13cf){if(_0x1e13cf){var _0x2349b8=typeof _0x2f0726['offset']==='undefined'&&typeof _0x2f0726[_0x318b('0x17')]===_0x318b('0x18');var _0x5307d8=_0x1e13cf[_0x318b('0x19')];var _0x2a8e5f=_0x2349b8?0x0:_0x2f0726[_0x318b('0x1a')];var _0x784193=_0x2349b8?_0x1e13cf[_0x318b('0x19')]:_0x2f0726[_0x318b('0x1a')]+_0x2f0726[_0x318b('0x17')];var _0x12c4ac;if(_0x784193>=_0x5307d8){_0x784193=_0x5307d8;_0x12c4ac=0xc8;}else{_0x12c4ac=0xce;}_0x2f9e39[_0x318b('0x14')](_0x12c4ac);return _0x2f9e39[_0x318b('0x1b')]('Content-Range',_0x2a8e5f+'-'+_0x784193+'/'+_0x5307d8)[_0x318b('0x16')](_0x1e13cf);}return null;};}function saveUpdates(_0x447adb){return function(_0x1c2ccc){if(_0x1c2ccc){return _0x1c2ccc['update'](_0x447adb)[_0x318b('0x1c')](function(_0x1fe4ad){return _0x1fe4ad;});}return null;};}function removeEntity(_0x5c88d0){return function(_0x50c29c){if(_0x50c29c){return _0x50c29c[_0x318b('0x1d')]()[_0x318b('0x1c')](function(){_0x5c88d0['status'](0xcc)[_0x318b('0x15')]();});}};}function handleEntityNotFound(_0x55dee4){return function(_0x4f3ed7){if(!_0x4f3ed7){_0x55dee4['sendStatus'](0x194);}return _0x4f3ed7;};}function handleError(_0x2db223,_0x5a6a8a){_0x5a6a8a=_0x5a6a8a||0x1f4;return function(_0x4eff67){logger[_0x318b('0x1e')](_0x4eff67[_0x318b('0x1f')]);if(_0x4eff67[_0x318b('0x20')]){delete _0x4eff67['name'];}_0x2db223[_0x318b('0x14')](_0x5a6a8a)[_0x318b('0x21')](_0x4eff67);};}exports[_0x318b('0x22')]=function(_0x400624,_0x4d955b){var _0x43219a={};var _0x1def54=_[_0x318b('0x23')](db[_0x318b('0x24')][_0x318b('0x25')],function(_0x1e64da){return{'name':_0x1e64da[_0x318b('0x26')],'type':_0x1e64da[_0x318b('0x27')]['key']};});_0x43219a=qs[_0x318b('0x28')](_0x1def54,_0x400624);return interaction[_0x318b('0x29')](_0x318b('0x2a'),_0x400624[_0x318b('0x2b')],_0x400624[_0x318b('0x2c')],_0x43219a,_0x1def54)['then'](respondWithFilteredResult(_0x4d955b,_0x43219a))[_0x318b('0x2d')](handleError(_0x4d955b,null));};exports[_0x318b('0x2e')]=function(_0x2d0ec9,_0x498940){var _0x46168f={'raw':![],'where':{'id':_0x2d0ec9['params']['id']}},_0x1e5bfd={};_0x1e5bfd[_0x318b('0x2f')]=_['keys'](db[_0x318b('0x24')][_0x318b('0x25')]);_0x1e5bfd[_0x318b('0x2b')]=_[_0x318b('0x30')](_0x2d0ec9[_0x318b('0x2b')]);_0x1e5bfd[_0x318b('0x31')]=_[_0x318b('0x32')](_0x1e5bfd['model'],_0x1e5bfd[_0x318b('0x2b')]);_0x46168f[_0x318b('0x33')]=_[_0x318b('0x32')](_0x1e5bfd[_0x318b('0x2f')],qs['fields'](_0x2d0ec9[_0x318b('0x2b')][_0x318b('0x34')]));_0x46168f[_0x318b('0x33')]=_0x46168f[_0x318b('0x33')][_0x318b('0x35')]?_0x46168f['attributes']:_0x1e5bfd['model'];if(_0x2d0ec9['query'][_0x318b('0x36')]){_0x46168f[_0x318b('0x37')]=[{'all':!![]}];}_0x46168f=_[_0x318b('0x38')]({},_0x46168f,_0x2d0ec9[_0x318b('0x39')]);return db['MailInteraction'][_0x318b('0x3a')](_0x46168f)[_0x318b('0x1c')](handleEntityNotFound(_0x498940,null))[_0x318b('0x1c')](respondWithResult(_0x498940,null))[_0x318b('0x2d')](handleError(_0x498940,null));};exports[_0x318b('0x3b')]=function(_0x24465c,_0x5f0324){return db[_0x318b('0x24')][_0x318b('0x3b')](_0x24465c[_0x318b('0x3c')],{})['then'](respondWithResult(_0x5f0324,0xc9))['catch'](handleError(_0x5f0324,null));};exports[_0x318b('0x3d')]=function(_0x571adb,_0x456a24){if(_0x571adb[_0x318b('0x3c')]['id']){delete _0x571adb[_0x318b('0x3c')]['id'];}return db['MailInteraction']['find']({'where':{'id':_0x571adb[_0x318b('0x3e')]['id']}})[_0x318b('0x1c')](handleEntityNotFound(_0x456a24,null))[_0x318b('0x1c')](saveUpdates(_0x571adb[_0x318b('0x3c')],null))['then'](respondWithResult(_0x456a24,null))[_0x318b('0x2d')](handleError(_0x456a24,null));};exports['destroy']=function(_0x186c7b,_0x56443c){return db[_0x318b('0x24')][_0x318b('0x3a')]({'where':{'id':_0x186c7b['params']['id']}})['then'](handleEntityNotFound(_0x56443c,null))[_0x318b('0x1c')](removeEntity(_0x56443c,null))[_0x318b('0x2d')](handleError(_0x56443c,null));};exports['describe']=function(_0x54f3cb,_0x2d3737){return db[_0x318b('0x24')][_0x318b('0x3f')]()[_0x318b('0x1c')](respondWithResult(_0x2d3737,null))[_0x318b('0x2d')](handleError(_0x2d3737,null));};exports[_0x318b('0x40')]=function(_0x4a6322,_0x125fe0){return db[_0x318b('0x41')][_0x318b('0x3a')]({'where':{'id':_0x4a6322[_0x318b('0x3e')]['id']}})[_0x318b('0x1c')](handleEntityNotFound(_0x125fe0,null))['then'](function(_0x245e4a){if(_0x245e4a){return _0x245e4a['addMessage'](_0x4a6322[_0x318b('0x3c')][_0x318b('0x42')],_[_0x318b('0x43')](_0x4a6322[_0x318b('0x3c')],[_0x318b('0x42'),'id'])||{});}})[_0x318b('0x1c')](respondWithResult(_0x125fe0,null))['catch'](handleError(_0x125fe0,null));};exports[_0x318b('0x44')]=function(_0x1c9bb4,_0x2366e2){var _0x348d0a={'raw':![],'where':{}};var _0x435bf6={};var _0x5a7578={'count':0x0,'rows':[]};return db[_0x318b('0x24')][_0x318b('0x45')]({'where':{'id':_0x1c9bb4['params']['id']}})[_0x318b('0x1c')](handleEntityNotFound(_0x2366e2,null))[_0x318b('0x1c')](function(_0x19903f){if(_0x19903f){_0x435bf6[_0x318b('0x2f')]=_[_0x318b('0x30')](db['MailMessage'][_0x318b('0x25')]);_0x435bf6[_0x318b('0x2b')]=_[_0x318b('0x30')](_0x1c9bb4['query']);_0x435bf6[_0x318b('0x31')]=_['intersection'](_0x435bf6['model'],_0x435bf6[_0x318b('0x2b')]);_0x348d0a['attributes']=_['intersection'](_0x435bf6[_0x318b('0x2f')],qs[_0x318b('0x34')](_0x1c9bb4[_0x318b('0x2b')][_0x318b('0x34')]));_0x348d0a[_0x318b('0x33')]=_0x348d0a[_0x318b('0x33')][_0x318b('0x35')]?_0x348d0a['attributes']:_0x435bf6['model'];if(!_0x1c9bb4[_0x318b('0x2b')][_0x318b('0x46')](_0x318b('0x47'))){_0x348d0a['limit']=qs[_0x318b('0x17')](_0x1c9bb4[_0x318b('0x2b')][_0x318b('0x17')]);_0x348d0a[_0x318b('0x1a')]=qs['offset'](_0x1c9bb4[_0x318b('0x2b')][_0x318b('0x1a')]);}_0x348d0a[_0x318b('0x48')]=qs[_0x318b('0x49')](_0x1c9bb4[_0x318b('0x2b')]['sort']);_0x348d0a['where']=qs[_0x318b('0x31')](_[_0x318b('0x4a')](_0x1c9bb4[_0x318b('0x2b')],_0x435bf6[_0x318b('0x31')]));_0x348d0a[_0x318b('0x4b')][_0x318b('0x4c')]=_0x19903f['id'];if(_0x1c9bb4[_0x318b('0x2b')]['filter']){_0x348d0a[_0x318b('0x4b')]=_[_0x318b('0x38')](_0x348d0a[_0x318b('0x4b')],{'$or':_[_0x318b('0x23')](_0x348d0a[_0x318b('0x33')],function(_0x29cf2c){var _0x3ef949={};_0x3ef949[_0x29cf2c]={'$like':'%'+_0x1c9bb4[_0x318b('0x2b')][_0x318b('0x4d')]+'%'};return _0x3ef949;})});}if(_0x1c9bb4['query']['$gte']){var _0x7a1111=_0x1c9bb4[_0x318b('0x2b')][_0x318b('0x4e')][_0x318b('0x4f')](',');var _0x417894={};_0x417894[_0x7a1111[0x0]]={'$gte':moment(_0x7a1111[0x1])[_0x318b('0x50')]('YYYY-MM-DD\x20HH:mm:ss')};_0x348d0a[_0x318b('0x4b')]=_[_0x318b('0x38')](_0x348d0a[_0x318b('0x4b')],_0x417894);}_0x348d0a=_[_0x318b('0x38')]({},_0x348d0a,_0x1c9bb4[_0x318b('0x39')]);return db[_0x318b('0x41')][_0x318b('0x19')]({'where':_0x348d0a[_0x318b('0x4b')]})[_0x318b('0x1c')](function(_0x313fa2){_0x5a7578[_0x318b('0x19')]=_0x313fa2;if(_0x1c9bb4[_0x318b('0x2b')][_0x318b('0x36')]){_0x348d0a[_0x318b('0x37')]=[{'all':!![]}];}return db[_0x318b('0x41')][_0x318b('0x29')](_0x348d0a);})[_0x318b('0x1c')](function(_0x15427d){if(_0x1c9bb4['query'][_0x318b('0x51')]===_0x318b('0x52')){for(var _0x4c8536=0x0;_0x4c8536<_0x15427d[_0x318b('0x35')];_0x4c8536++){_0x15427d[_0x4c8536]['body']=juice(_0x15427d[_0x4c8536]['body']);}}_0x5a7578[_0x318b('0x53')]=_0x15427d;return _0x5a7578;});}})[_0x318b('0x1c')](respondWithFilteredResult(_0x2366e2,_0x348d0a))['catch'](handleError(_0x2366e2,null));};exports[_0x318b('0x54')]=function(_0x5396a3,_0x25235b){return db['MailInteraction'][_0x318b('0x3a')]({'where':{'id':_0x5396a3['params']['id']}})[_0x318b('0x1c')](handleEntityNotFound(_0x25235b,null))[_0x318b('0x1c')](function(_0x1ba00d){if(_0x1ba00d){return _0x1ba00d[_0x318b('0x55')](_0x5396a3['body'][_0x318b('0x42')],_[_0x318b('0x43')](_0x5396a3[_0x318b('0x3c')],[_0x318b('0x42'),'id'])||{})[_0x318b('0x56')](function(){return db[_0x318b('0x57')]['findAll']({'attributes':['id','name','color'],'where':{'id':_0x5396a3[_0x318b('0x3c')]['ids']}});})[_0x318b('0x1c')](function(_0x2228ec){socket[_0x318b('0x58')](_0x318b('0x59'),{'id':Number(_0x5396a3[_0x318b('0x3e')]['id']),'tags':_0x2228ec||[]});return{'id':Number(_0x5396a3['params']['id']),'tags':_0x2228ec||[]};});}})[_0x318b('0x1c')](respondWithResult(_0x25235b,null))[_0x318b('0x2d')](handleError(_0x25235b,null));};exports[_0x318b('0x5a')]=function(_0x44e18b,_0x38bb61){return db[_0x318b('0x24')]['find']({'where':{'id':_0x44e18b[_0x318b('0x3e')]['id']}})[_0x318b('0x1c')](handleEntityNotFound(_0x38bb61,null))[_0x318b('0x1c')](function(_0x3e4d77){if(_0x3e4d77){return _0x3e4d77[_0x318b('0x5a')](_0x44e18b[_0x318b('0x2b')][_0x318b('0x42')]);}})[_0x318b('0x1c')](respondWithStatusCode(_0x38bb61,null))[_0x318b('0x2d')](handleError(_0x38bb61,null));};exports[_0x318b('0x5b')]=function(_0x3666db,_0x49a4d1){var _0x14c0d2=moment()['unix']()[_0x318b('0x5c')]();var _0x43ae63=path['join'](config[_0x318b('0x5d')],_0x318b('0x5e'),'files','tmp');var _0x3c56a7=path['join'](config[_0x318b('0x5d')],_0x318b('0x5e'),_0x318b('0x5f'),'attachments');var _0x4768d9=path[_0x318b('0x60')](_0x43ae63,_0x14c0d2);var _0x49a99c=util['format'](_0x318b('0x61'),_0x3666db['params']['id'],_0x14c0d2);var _0x4e544b=path['join'](_0x43ae63,_0x49a99c);var _0x4d67f9=[];if(_0x3666db[_0x318b('0x2b')][_0x318b('0x62')]){_0x4d67f9[_0x318b('0x63')]({'model':db['Attachment'],'as':_0x318b('0x64'),'raw':!![]});}var _0x34ebdb=[{'model':db[_0x318b('0x41')],'as':_0x318b('0x65'),'attributes':['id',_0x318b('0x3c'),_0x318b('0x66'),'to','cc','bcc',_0x318b('0x67'),_0x318b('0x68')],'where':{'secret':![]},'order':qs[_0x318b('0x49')]('id'),'include':_0x4d67f9}];return db[_0x318b('0x24')][_0x318b('0x3a')]({'where':{'id':_0x3666db['params']['id']},'include':_0x34ebdb})['then'](handleEntityNotFound(_0x49a4d1,null))['then'](function(_0x4a66c4){if(_0x4a66c4&&_0x4a66c4[_0x318b('0x65')]){var _0x1d717f=_0x4a66c4[_0x318b('0x69')]({'plain':!![]});fs['mkdirSync'](_0x4768d9);return BPromise[_0x318b('0x6a')](_0x1d717f['Messages'],function(_0x131824,_0x5c8d5d){var _0x5b576e={'from':_0x131824[_0x318b('0x66')],'to':_0x131824['to']||_0x318b('0x6b'),'subject':_0x131824[_0x318b('0x67')],'html':htmlEntities[_0x318b('0x6c')](_0x131824[_0x318b('0x3c')]),'headers':{'Date':moment(_0x131824[_0x318b('0x68')])[_0x318b('0x50')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x131824['cc']){_0x5b576e[_0x318b('0x6d')]['Cc']=_0x131824['cc'];}if(_0x131824['bcc']){_0x5b576e[_0x318b('0x6d')][_0x318b('0x6e')]=_0x131824[_0x318b('0x6f')];}return new BPromise(function(_0x200119,_0x1da89b){if(_0x131824[_0x318b('0x64')]){for(var _0x4d1cff=0x0;_0x4d1cff<_0x131824[_0x318b('0x64')][_0x318b('0x35')];_0x4d1cff++){var _0x366bed=_0x131824[_0x318b('0x64')][_0x4d1cff];var _0x1ec0f1=path[_0x318b('0x60')](_0x3c56a7,_0x366bed[_0x318b('0x70')]);if(fs[_0x318b('0x71')](_0x1ec0f1)){_0x5b576e['attachments'][_0x318b('0x63')]({'name':_0x366bed[_0x318b('0x20')],'contentType':_0x366bed[_0x318b('0x27')],'data':fs[_0x318b('0x72')](_0x1ec0f1)});}}}emlformat['build'](_0x5b576e,function(_0x1b1daf,_0x1a28a0){if(_0x1b1daf)return _0x1da89b(_0x1b1daf);fs[_0x318b('0x73')](path[_0x318b('0x60')](_0x4768d9,util[_0x318b('0x50')](_0x318b('0x74'),_0x5c8d5d)),_0x1a28a0);return _0x200119(_0x1a28a0);});});})['then'](function(){return new BPromise(function(_0xda96dd,_0x2ae973){zipdir(_0x4768d9,{'saveTo':_0x4e544b},function(_0x488405,_0x2b5807){if(_0x488405)return _0x2ae973(_0x488405);return _0xda96dd(_0x2b5807);});})[_0x318b('0x1c')](function(){return new BPromise(function(_0x394b08,_0x587afe){rimraf(_0x4768d9,function(_0x5c876c){if(_0x5c876c)_0x587afe(_0x5c876c);return _0x394b08();});});})[_0x318b('0x1c')](function(){return _0x49a4d1[_0x318b('0x5b')](_0x4e544b,_0x49a99c,function(_0x2a679f){if(!_0x2a679f)fs[_0x318b('0x75')](_0x4e544b);});});});}else{return _0x49a4d1[_0x318b('0x13')](0xc8);}})[_0x318b('0x2d')](handleError(_0x49a4d1,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 4f4e4be..a0b50fa 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 _0x88a5=['../../mysqldb','MailInteraction','MailMessage','setMaxListeners','getUsers','then','map','findAll','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports'];(function(_0xc058ef,_0x5e76ff){var _0x264e17=function(_0x1bea1b){while(--_0x1bea1b){_0xc058ef['push'](_0xc058ef['shift']());}};_0x264e17(++_0x5e76ff);}(_0x88a5,0x90));var _0x588a=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x88a5[_0x126558];return _0x1f6d14;};'use strict';var EventEmitter=require('events');var MailInteraction=require(_0x588a('0x0'))['db'][_0x588a('0x1')];var MailMessage=require(_0x588a('0x0'))['db'][_0x588a('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x588a('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x11f81d){return function(_0x21cb8f,_0xea66db,_0x514650){_0x21cb8f[_0x588a('0x4')]({'attributes':['id'],'raw':!![]})[_0x588a('0x5')](function(_0x3d9c1e){_0x21cb8f['setDataValue']('Users',_0x3d9c1e[_0x588a('0x6')](function(_0x381486){return{'id':_0x381486['id']};}));return MailMessage[_0x588a('0x7')]({'where':{'MailInteractionId':_0x21cb8f['id'],'direction':'in','read':![]},'raw':!![]});})[_0x588a('0x5')](function(_0x343742){_0x21cb8f[_0x588a('0x8')](_0x588a('0x9'),_0x343742[_0x588a('0xa')]);MailInteractionEvents['emit'](_0x11f81d+':'+_0x21cb8f['id'],_0x21cb8f);MailInteractionEvents[_0x588a('0xb')](_0x11f81d,_0x21cb8f);_0x514650(null);})[_0x588a('0xc')](_0x514650(null));};}for(var e in events){if(events[_0x588a('0xd')](e)){var event=events[e];MailInteraction[_0x588a('0xe')](e,emitEvent(event));}}module[_0x588a('0xf')]=MailInteractionEvents; \ No newline at end of file +var _0x4e2e=['then','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','MailInteraction','setMaxListeners','save','update','remove','getUsers','setDataValue','Users','findAll'];(function(_0x2fc6cf,_0x2bb133){var _0xf2ade3=function(_0x522b04){while(--_0x522b04){_0x2fc6cf['push'](_0x2fc6cf['shift']());}};_0xf2ade3(++_0x2bb133);}(_0x4e2e,0x193));var _0xe4e2=function(_0x5b4f82,_0xa1f5fc){_0x5b4f82=_0x5b4f82-0x0;var _0x383810=_0x4e2e[_0x5b4f82];return _0x383810;};'use strict';var EventEmitter=require(_0xe4e2('0x0'));var MailInteraction=require(_0xe4e2('0x1'))['db'][_0xe4e2('0x2')];var MailMessage=require(_0xe4e2('0x1'))['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xe4e2('0x3')](0x0);var events={'afterCreate':_0xe4e2('0x4'),'afterUpdate':_0xe4e2('0x5'),'afterDestroy':_0xe4e2('0x6')};function emitEvent(_0x4aa2d5){return function(_0x1bc966,_0x4290b5,_0x1bcc36){_0x1bc966[_0xe4e2('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x4ce2a1){_0x1bc966[_0xe4e2('0x8')](_0xe4e2('0x9'),_0x4ce2a1['map'](function(_0x266d0b){return{'id':_0x266d0b['id']};}));return MailMessage[_0xe4e2('0xa')]({'where':{'MailInteractionId':_0x1bc966['id'],'direction':'in','read':![]},'raw':!![]});})[_0xe4e2('0xb')](function(_0x13222b){_0x1bc966[_0xe4e2('0x8')]('unreadMessages',_0x13222b[_0xe4e2('0xc')]);MailInteractionEvents[_0xe4e2('0xd')](_0x4aa2d5+':'+_0x1bc966['id'],_0x1bc966);MailInteractionEvents[_0xe4e2('0xd')](_0x4aa2d5,_0x1bc966);_0x1bcc36(null);})[_0xe4e2('0xe')](_0x1bcc36(null));};}for(var e in events){if(events[_0xe4e2('0xf')](e)){var event=events[e];MailInteraction[_0xe4e2('0x10')](e,emitEvent(event));}}module[_0xe4e2('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 1001722..ad0a953 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 _0x053d=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./mailInteraction.attributes','exports','MailInteraction','subject','FULLTEXT','substatus','substatusAt','format','closedAt','changed','YYYY-MM-DD\x20HH:mm:ss','closed','models','get','update','then','catch'];(function(_0xb8dee1,_0x53d8b7){var _0x5a8f5a=function(_0x3140ab){while(--_0x3140ab){_0xb8dee1['push'](_0xb8dee1['shift']());}};_0x5a8f5a(++_0x53d8b7);}(_0x053d,0xe2));var _0xd053=function(_0x4b897e,_0x1fde80){_0x4b897e=_0x4b897e-0x0;var _0x41082d=_0x053d[_0x4b897e];return _0x41082d;};'use strict';var _=require(_0xd053('0x0'));var util=require(_0xd053('0x1'));var logger=require(_0xd053('0x2'))(_0xd053('0x3'));var moment=require(_0xd053('0x4'));var BPromise=require(_0xd053('0x5'));var rp=require(_0xd053('0x6'));var fs=require('fs');var path=require(_0xd053('0x7'));var rimraf=require(_0xd053('0x8'));var config=require('../../config/environment');var attributes=require(_0xd053('0x9'));module[_0xd053('0xa')]=function(_0x5b4f5a,_0x2ca37e){return _0x5b4f5a['define'](_0xd053('0xb'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0xd053('0xc'),'to'],'type':_0xd053('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x23a066,_0x4e8896,_0xfc0ff0){if(_0x23a066[_0xd053('0xe')]){_0x23a066[_0xd053('0xf')]=moment()[_0xd053('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x23a066['closed']){_0x23a066[_0xd053('0x11')]=moment()[_0xd053('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}_0xfc0ff0(null,_0x4e8896);},'beforeUpdate':function(_0xfcf7db,_0x8f1575,_0x5f1051){if(_0xfcf7db[_0xd053('0x12')](_0xd053('0xe'))){_0xfcf7db['substatusAt']=_0xfcf7db[_0xd053('0xe')]?moment()[_0xd053('0x10')](_0xd053('0x13')):null;}if(_0xfcf7db[_0xd053('0x12')](_0xd053('0x14'))){_0xfcf7db[_0xd053('0x11')]=moment()[_0xd053('0x10')](_0xd053('0x13'));_0xfcf7db['substatus']=null;_0xfcf7db[_0xd053('0xf')]=null;}_0x5f1051(null,_0xfcf7db);},'afterUpdate':function(_0x32537d,_0x43d95f,_0xaf93dc){var _0x5d1e51=_0x5b4f5a[_0xd053('0x15')];var _0x32b04d=_0x32537d[_0xd053('0x16')]({'plain':!![]});if(_0x32b04d[_0xd053('0x14')]){return _0x5d1e51['MailMessage'][_0xd053('0x17')]({'read':!![]},{'where':{'MailInteractionId':_0x32b04d['id']}})[_0xd053('0x18')](function(){_0xaf93dc();})[_0xd053('0x19')](function(_0x5b908f){_0xaf93dc(_0x5b908f);});}else{_0xaf93dc();}}},'charset':_0xd053('0x1a'),'collate':_0xd053('0x1b')});}; \ No newline at end of file +var _0xce80=['then','catch','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','MailInteraction','mail_interactions','fti_mail_interactions','subject','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','models','get','MailMessage','update'];(function(_0x24e004,_0x179197){var _0x254c9e=function(_0xadb034){while(--_0xadb034){_0x24e004['push'](_0x24e004['shift']());}};_0x254c9e(++_0x179197);}(_0xce80,0x12b));var _0x0ce8=function(_0x20f6ea,_0x56aa91){_0x20f6ea=_0x20f6ea-0x0;var _0x271d34=_0xce80[_0x20f6ea];return _0x271d34;};'use strict';var _=require(_0x0ce8('0x0'));var util=require(_0x0ce8('0x1'));var logger=require('../../config/logger')(_0x0ce8('0x2'));var moment=require('moment');var BPromise=require(_0x0ce8('0x3'));var rp=require(_0x0ce8('0x4'));var fs=require('fs');var path=require(_0x0ce8('0x5'));var rimraf=require(_0x0ce8('0x6'));var config=require(_0x0ce8('0x7'));var attributes=require('./mailInteraction.attributes');module[_0x0ce8('0x8')]=function(_0x16d2d0,_0x11c5be){return _0x16d2d0[_0x0ce8('0x9')](_0x0ce8('0xa'),attributes,{'tableName':_0x0ce8('0xb'),'paranoid':![],'indexes':[{'name':_0x0ce8('0xc'),'fields':[_0x0ce8('0xd'),'to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2f7555,_0x4bab7c,_0x35545c){if(_0x2f7555[_0x0ce8('0xe')]){_0x2f7555[_0x0ce8('0xf')]=moment()[_0x0ce8('0x10')](_0x0ce8('0x11'));}if(_0x2f7555[_0x0ce8('0x12')]){_0x2f7555[_0x0ce8('0x13')]=moment()[_0x0ce8('0x10')](_0x0ce8('0x11'));}_0x35545c(null,_0x4bab7c);},'beforeUpdate':function(_0x53db41,_0x230f18,_0x254176){if(_0x53db41[_0x0ce8('0x14')]('substatus')){_0x53db41[_0x0ce8('0xf')]=_0x53db41['substatus']?moment()[_0x0ce8('0x10')](_0x0ce8('0x11')):null;}if(_0x53db41[_0x0ce8('0x14')](_0x0ce8('0x12'))){_0x53db41[_0x0ce8('0x13')]=moment()[_0x0ce8('0x10')](_0x0ce8('0x11'));_0x53db41['substatus']=null;_0x53db41[_0x0ce8('0xf')]=null;}_0x254176(null,_0x53db41);},'afterUpdate':function(_0x597a8b,_0x50ebaf,_0x46870a){var _0xac6a6a=_0x16d2d0[_0x0ce8('0x15')];var _0x3f146a=_0x597a8b[_0x0ce8('0x16')]({'plain':!![]});if(_0x3f146a['closed']){return _0xac6a6a[_0x0ce8('0x17')][_0x0ce8('0x18')]({'read':!![]},{'where':{'MailInteractionId':_0x3f146a['id']}})[_0x0ce8('0x19')](function(){_0x46870a();})[_0x0ce8('0x1a')](function(_0x24446d){_0x46870a(_0x24446d);});}else{_0x46870a();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 88508e4..c788328 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 _0xc43c=['result','catch','UpdateMailInteraction','update','body','options','raw','where','attributes','limit','AddTagsToMailInteraction','MailInteraction','addTags','ids','omit','spread','AddTags','lodash','util','moment','../../mysqldb','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message'];(function(_0x504dc3,_0x547139){var _0x2d352c=function(_0x3cb526){while(--_0x3cb526){_0x504dc3['push'](_0x504dc3['shift']());}};_0x2d352c(++_0x547139);}(_0xc43c,0xd4));var _0xcc43=function(_0x364cd9,_0x3bf41b){_0x364cd9=_0x364cd9-0x0;var _0x27b71c=_0xc43c[_0x364cd9];return _0x27b71c;};'use strict';var _=require(_0xcc43('0x0'));var util=require(_0xcc43('0x1'));var moment=require(_0xcc43('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcc43('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xcc43('0x4'));var jayson=require(_0xcc43('0x5'));var client=jayson[_0xcc43('0x6')]['http']({'port':0x232a});config[_0xcc43('0x7')]=_[_0xcc43('0x8')](config[_0xcc43('0x7')],{'host':_0xcc43('0x9'),'port':0x18eb});var socket=require(_0xcc43('0xa'))(new Redis(config[_0xcc43('0x7')]));require(_0xcc43('0xb'))[_0xcc43('0xc')](socket);function respondWithRpcPromise(_0x4b11dc,_0x3ddc64,_0x1a825b){return new BPromise(function(_0x2656bc,_0x3bc51e){return client[_0xcc43('0xd')](_0x4b11dc,_0x1a825b)[_0xcc43('0xe')](function(_0x439c43){logger[_0xcc43('0xf')](_0xcc43('0x10'),_0x3ddc64,_0xcc43('0x11'));logger[_0xcc43('0x12')]('MailInteraction,\x20%s,\x20%s,\x20%s',_0x3ddc64,_0xcc43('0x11'),JSON[_0xcc43('0x13')](_0x439c43));if(_0x439c43[_0xcc43('0x14')]){if(_0x439c43[_0xcc43('0x14')]['code']===0x1f4){logger[_0xcc43('0x14')](_0xcc43('0x10'),_0x3ddc64,_0x439c43[_0xcc43('0x14')][_0xcc43('0x15')]);return _0x3bc51e(_0x439c43[_0xcc43('0x14')]['message']);}logger[_0xcc43('0x14')](_0xcc43('0x10'),_0x3ddc64,_0x439c43['error'][_0xcc43('0x15')]);return _0x2656bc(_0x439c43['error'][_0xcc43('0x15')]);}else{logger[_0xcc43('0xf')](_0xcc43('0x10'),_0x3ddc64,'request\x20sent');_0x2656bc(_0x439c43[_0xcc43('0x16')][_0xcc43('0x15')]);}})[_0xcc43('0x17')](function(_0x326851){logger['error'](_0xcc43('0x10'),_0x3ddc64,_0x326851);_0x3bc51e(_0x326851);});});}exports[_0xcc43('0x18')]=function(_0x57bd2d){var _0x7ec240=this;return new Promise(function(_0x58d7fb,_0xcfb0d9){return db['MailInteraction'][_0xcc43('0x19')](_0x57bd2d[_0xcc43('0x1a')],{'raw':_0x57bd2d[_0xcc43('0x1b')]?_0x57bd2d['options'][_0xcc43('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x57bd2d['options']?_0x57bd2d[_0xcc43('0x1b')][_0xcc43('0x1d')]||null:null,'attributes':_0x57bd2d[_0xcc43('0x1b')]?_0x57bd2d[_0xcc43('0x1b')][_0xcc43('0x1e')]||null:null,'limit':_0x57bd2d['options']?_0x57bd2d[_0xcc43('0x1b')][_0xcc43('0x1f')]||null:null})['then'](function(_0x46378e){logger[_0xcc43('0xf')](_0xcc43('0x18'),_0x57bd2d);logger['debug'](_0xcc43('0x18'),_0x57bd2d,JSON['stringify'](_0x46378e));_0x58d7fb(_0x46378e);})[_0xcc43('0x17')](function(_0xf78759){logger[_0xcc43('0x14')](_0xcc43('0x18'),_0xf78759[_0xcc43('0x15')],_0x57bd2d);_0xcfb0d9(_0x7ec240['error'](0x1f4,_0xf78759[_0xcc43('0x15')]));});});};exports[_0xcc43('0x20')]=function(_0x3e5c00){return new Promise(function(_0x200f72,_0x246ecb){return db[_0xcc43('0x21')]['find']({'where':_0x3e5c00[_0xcc43('0x1b')]?_0x3e5c00[_0xcc43('0x1b')][_0xcc43('0x1d')]||null:null})[_0xcc43('0xe')](function(_0x532526){if(_0x532526){return _0x532526[_0xcc43('0x22')](_0x3e5c00[_0xcc43('0x1a')][_0xcc43('0x23')],_[_0xcc43('0x24')](_0x3e5c00['body'],[_0xcc43('0x23'),'id'])||{});}})[_0xcc43('0x25')](function(_0x3cb56f){logger[_0xcc43('0xf')]('AddTags',_0x3e5c00);logger['debug'](_0xcc43('0x26'),_0x3e5c00,JSON[_0xcc43('0x13')](_0x3cb56f));_0x200f72(_0x3cb56f);})[_0xcc43('0x17')](function(_0x799a9d){logger[_0xcc43('0x14')](_0xcc43('0x26'),_0x799a9d[_0xcc43('0x15')],_0x3e5c00);_0x246ecb(_this[_0xcc43('0x14')](0x1f4,_0x799a9d['message']));});});}; \ No newline at end of file +var _0xcf30=['MailInteraction','addTags','ids','omit','body','AddTags','debug','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/environment','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','request','then','MailInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','UpdateMailInteraction','update','options','raw','where','limit','AddTagsToMailInteraction'];(function(_0x4b3d88,_0x49a095){var _0x11dbf5=function(_0x54823f){while(--_0x54823f){_0x4b3d88['push'](_0x4b3d88['shift']());}};_0x11dbf5(++_0x49a095);}(_0xcf30,0x128));var _0x0cf3=function(_0x4a18ae,_0x1a52f8){_0x4a18ae=_0x4a18ae-0x0;var _0xe35d22=_0xcf30[_0x4a18ae];return _0xe35d22;};'use strict';var _=require(_0x0cf3('0x0'));var util=require(_0x0cf3('0x1'));var moment=require(_0x0cf3('0x2'));var BPromise=require(_0x0cf3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0cf3('0x4'));var db=require(_0x0cf3('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x0cf3('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x0cf3('0x7')]=_[_0x0cf3('0x8')](config[_0x0cf3('0x7')],{'host':_0x0cf3('0x9'),'port':0x18eb});var socket=require(_0x0cf3('0xa'))(new Redis(config['redis']));require(_0x0cf3('0xb'))['register'](socket);function respondWithRpcPromise(_0x141e8c,_0x1e3416,_0x18b2d1){return new BPromise(function(_0x1793a4,_0x1937c6){return client[_0x0cf3('0xc')](_0x141e8c,_0x18b2d1)[_0x0cf3('0xd')](function(_0x2e7cbc){logger['info'](_0x0cf3('0xe'),_0x1e3416,'request\x20sent');logger['debug']('MailInteraction,\x20%s,\x20%s,\x20%s',_0x1e3416,_0x0cf3('0xf'),JSON[_0x0cf3('0x10')](_0x2e7cbc));if(_0x2e7cbc['error']){if(_0x2e7cbc['error']['code']===0x1f4){logger[_0x0cf3('0x11')](_0x0cf3('0xe'),_0x1e3416,_0x2e7cbc[_0x0cf3('0x11')][_0x0cf3('0x12')]);return _0x1937c6(_0x2e7cbc[_0x0cf3('0x11')]['message']);}logger[_0x0cf3('0x11')](_0x0cf3('0xe'),_0x1e3416,_0x2e7cbc['error'][_0x0cf3('0x12')]);return _0x1793a4(_0x2e7cbc[_0x0cf3('0x11')][_0x0cf3('0x12')]);}else{logger[_0x0cf3('0x13')](_0x0cf3('0xe'),_0x1e3416,_0x0cf3('0xf'));_0x1793a4(_0x2e7cbc[_0x0cf3('0x14')][_0x0cf3('0x12')]);}})['catch'](function(_0x159846){logger[_0x0cf3('0x11')]('MailInteraction,\x20%s,\x20%s',_0x1e3416,_0x159846);_0x1937c6(_0x159846);});});}exports[_0x0cf3('0x15')]=function(_0x8e4561){var _0xa81872=this;return new Promise(function(_0x496516,_0x327694){return db['MailInteraction'][_0x0cf3('0x16')](_0x8e4561['body'],{'raw':_0x8e4561[_0x0cf3('0x17')]?_0x8e4561[_0x0cf3('0x17')][_0x0cf3('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x8e4561['options']?_0x8e4561[_0x0cf3('0x17')][_0x0cf3('0x19')]||null:null,'attributes':_0x8e4561['options']?_0x8e4561[_0x0cf3('0x17')]['attributes']||null:null,'limit':_0x8e4561[_0x0cf3('0x17')]?_0x8e4561['options'][_0x0cf3('0x1a')]||null:null})[_0x0cf3('0xd')](function(_0x4d0f5b){logger[_0x0cf3('0x13')](_0x0cf3('0x15'),_0x8e4561);logger['debug'](_0x0cf3('0x15'),_0x8e4561,JSON[_0x0cf3('0x10')](_0x4d0f5b));_0x496516(_0x4d0f5b);})['catch'](function(_0x5aed05){logger[_0x0cf3('0x11')](_0x0cf3('0x15'),_0x5aed05[_0x0cf3('0x12')],_0x8e4561);_0x327694(_0xa81872[_0x0cf3('0x11')](0x1f4,_0x5aed05['message']));});});};exports[_0x0cf3('0x1b')]=function(_0x32cf18){return new Promise(function(_0x4cb2bb,_0x1a1e94){return db[_0x0cf3('0x1c')]['find']({'where':_0x32cf18[_0x0cf3('0x17')]?_0x32cf18[_0x0cf3('0x17')][_0x0cf3('0x19')]||null:null})[_0x0cf3('0xd')](function(_0x46a83e){if(_0x46a83e){return _0x46a83e[_0x0cf3('0x1d')](_0x32cf18['body'][_0x0cf3('0x1e')],_[_0x0cf3('0x1f')](_0x32cf18[_0x0cf3('0x20')],[_0x0cf3('0x1e'),'id'])||{});}})['spread'](function(_0x189642){logger[_0x0cf3('0x13')](_0x0cf3('0x21'),_0x32cf18);logger[_0x0cf3('0x22')](_0x0cf3('0x21'),_0x32cf18,JSON[_0x0cf3('0x10')](_0x189642));_0x4cb2bb(_0x189642);})[_0x0cf3('0x23')](function(_0x14f58d){logger['error'](_0x0cf3('0x21'),_0x14f58d[_0x0cf3('0x12')],_0x32cf18);_0x1a1e94(_this['error'](0x1f4,_0x14f58d[_0x0cf3('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 18112e8..c72caf8 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 _0x2cb8=['remove','update','emit','length','mailInteraction:','./mailInteraction.events','save'];(function(_0x47daa1,_0x456720){var _0xf6c149=function(_0x2b929f){while(--_0x2b929f){_0x47daa1['push'](_0x47daa1['shift']());}};_0xf6c149(++_0x456720);}(_0x2cb8,0x14e));var _0x82cb=function(_0x45837a,_0x28403d){_0x45837a=_0x45837a-0x0;var _0x347136=_0x2cb8[_0x45837a];return _0x347136;};'use strict';var MailInteractionEvents=require(_0x82cb('0x0'));var events=[_0x82cb('0x1'),_0x82cb('0x2'),_0x82cb('0x3')];function createListener(_0x1c2855,_0x55e724){return function(_0x3cbe94){_0x55e724[_0x82cb('0x4')](_0x1c2855,_0x3cbe94);};}function removeListener(_0x3f9ee3,_0x3f6a75){return function(){MailInteractionEvents['removeListener'](_0x3f9ee3,_0x3f6a75);};}exports['register']=function(_0x4066d4){for(var _0x4e058e=0x0,_0x3b2a61=events[_0x82cb('0x5')];_0x4e058e<_0x3b2a61;_0x4e058e++){var _0x3e6b22=events[_0x4e058e];var _0x45cea5=createListener(_0x82cb('0x6')+_0x3e6b22,_0x4066d4);MailInteractionEvents['on'](_0x3e6b22,_0x45cea5);}}; \ No newline at end of file +var _0xb105=['removeListener','register','length','mailInteraction:','./mailInteraction.events','save','remove','emit'];(function(_0x67ff6c,_0x1d3a14){var _0xa95a99=function(_0xbb6179){while(--_0xbb6179){_0x67ff6c['push'](_0x67ff6c['shift']());}};_0xa95a99(++_0x1d3a14);}(_0xb105,0x12c));var _0x5b10=function(_0x348ac1,_0x851ba3){_0x348ac1=_0x348ac1-0x0;var _0x36af7e=_0xb105[_0x348ac1];return _0x36af7e;};'use strict';var MailInteractionEvents=require(_0x5b10('0x0'));var events=[_0x5b10('0x1'),_0x5b10('0x2'),'update'];function createListener(_0x56fa67,_0x7650fe){return function(_0x5bc488){_0x7650fe[_0x5b10('0x3')](_0x56fa67,_0x5bc488);};}function removeListener(_0x2da534,_0x301e28){return function(){MailInteractionEvents[_0x5b10('0x4')](_0x2da534,_0x301e28);};}exports[_0x5b10('0x5')]=function(_0x538fe7){for(var _0x9f8db1=0x0,_0x4554f5=events[_0x5b10('0x6')];_0x9f8db1<_0x4554f5;_0x9f8db1++){var _0x1f6e67=events[_0x9f8db1];var _0x426a1c=createListener(_0x5b10('0x7')+_0x1f6e67,_0x538fe7);MailInteractionEvents['on'](_0x1f6e67,_0x426a1c);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 26e031c..d0baf1f 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 _0x3c2c=['exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','download','post','mail','mailmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x3c2c,0x160));var _0xc3c2=function(_0xe2137f,_0x416e41){_0xe2137f=_0xe2137f-0x0;var _0x311cb2=_0x3c2c[_0xe2137f];return _0x311cb2;};'use strict';var multer=require(_0xc3c2('0x0'));var util=require(_0xc3c2('0x1'));var path=require(_0xc3c2('0x2'));var timeout=require(_0xc3c2('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xc3c2('0x4'));var auth=require(_0xc3c2('0x5'));var interaction=require(_0xc3c2('0x6'));var config=require(_0xc3c2('0x7'));var controller=require('./mailMessage.controller');router[_0xc3c2('0x8')]('/',auth[_0xc3c2('0x9')](),controller[_0xc3c2('0xa')]);router[_0xc3c2('0x8')](_0xc3c2('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xc3c2('0xc'),auth[_0xc3c2('0x9')](),controller['show']);router[_0xc3c2('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0xc3c2('0xd')]);router[_0xc3c2('0xe')]('/',auth[_0xc3c2('0x9')](),interaction['tracked'](_0xc3c2('0xf'),_0xc3c2('0x10')),controller[_0xc3c2('0x11')]);router[_0xc3c2('0x12')]('/:id',auth[_0xc3c2('0x9')](),controller[_0xc3c2('0x13')]);router['put'](_0xc3c2('0x14'),auth['isAuthenticated'](),controller[_0xc3c2('0x15')]);router['put'](_0xc3c2('0x16'),auth['isAuthenticated'](),controller[_0xc3c2('0x17')]);router[_0xc3c2('0x18')]('/:id',auth[_0xc3c2('0x9')](),controller[_0xc3c2('0x19')]);module[_0xc3c2('0x1a')]=router; \ No newline at end of file +var _0x2162=['put','update','/:id/accept','accept','/:id/reject','delete','destroy','exports','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./mailMessage.controller','get','index','isAuthenticated','describe','/:id','download','tracked','mail','mailmessage:create'];(function(_0x5b959f,_0x1e1227){var _0x510ff4=function(_0x5b57ea){while(--_0x5b57ea){_0x5b959f['push'](_0x5b959f['shift']());}};_0x510ff4(++_0x1e1227);}(_0x2162,0x110));var _0x2216=function(_0x4279e1,_0x39cda4){_0x4279e1=_0x4279e1-0x0;var _0x1e33ea=_0x2162[_0x4279e1];return _0x1e33ea;};'use strict';var multer=require('multer');var util=require(_0x2216('0x0'));var path=require('path');var timeout=require(_0x2216('0x1'));var express=require(_0x2216('0x2'));var router=express['Router']();var fs_extra=require(_0x2216('0x3'));var auth=require(_0x2216('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2216('0x5'));var controller=require(_0x2216('0x6'));router[_0x2216('0x7')]('/',auth['isAuthenticated'](),controller[_0x2216('0x8')]);router['get']('/describe',auth[_0x2216('0x9')](),controller[_0x2216('0xa')]);router[_0x2216('0x7')](_0x2216('0xb'),auth['isAuthenticated'](),controller['show']);router['get']('/:id/download',auth[_0x2216('0x9')](),controller[_0x2216('0xc')]);router['post']('/',auth[_0x2216('0x9')](),interaction[_0x2216('0xd')](_0x2216('0xe'),_0x2216('0xf')),controller['create']);router[_0x2216('0x10')](_0x2216('0xb'),auth[_0x2216('0x9')](),controller[_0x2216('0x11')]);router[_0x2216('0x10')](_0x2216('0x12'),auth[_0x2216('0x9')](),controller[_0x2216('0x13')]);router['put'](_0x2216('0x14'),auth[_0x2216('0x9')](),controller['reject']);router[_0x2216('0x15')]('/:id',auth[_0x2216('0x9')](),controller[_0x2216('0x16')]);module[_0x2216('0x17')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index b109825..224a11b 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 _0x885f=['STRING','DATE','INTEGER','Email','Chat','sequelize','lodash','TEXT','long','medium','ENUM','out'];(function(_0x15b5d2,_0x2f76a7){var _0x3ca950=function(_0x5c8514){while(--_0x5c8514){_0x15b5d2['push'](_0x15b5d2['shift']());}};_0x3ca950(++_0x2f76a7);}(_0x885f,0x185));var _0xf885=function(_0x470651,_0x2774a5){_0x470651=_0x470651-0x0;var _0x4c3597=_0x885f[_0x470651];return _0x4c3597;};'use strict';var Sequelize=require(_0xf885('0x0'));var _=require(_0xf885('0x1'));module['exports']={'body':{'type':Sequelize[_0xf885('0x2')](_0xf885('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xf885('0x2')](_0xf885('0x4'))},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xf885('0x5')]('in','out'),'defaultValue':_0xf885('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0xf885('0x7')](0x1fe)},'from':{'type':Sequelize[_0xf885('0x7')]},'to':{'type':Sequelize['TEXT']('long')},'cc':{'type':Sequelize[_0xf885('0x2')](_0xf885('0x3'))},'bcc':{'type':Sequelize[_0xf885('0x2')](_0xf885('0x3'))},'subject':{'type':Sequelize[_0xf885('0x2')]},'sentAt':{'type':Sequelize[_0xf885('0x8')]},'attach':{'type':Sequelize[_0xf885('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize[_0xf885('0x8')]},'originTo':{'type':Sequelize[_0xf885('0x2')](_0xf885('0x3'))},'originCc':{'type':Sequelize['TEXT'](_0xf885('0x3'))},'originChannel':{'type':Sequelize[_0xf885('0x5')](_0xf885('0xa'),_0xf885('0xb')),'defaultValue':'Email','allowNull':![]}}; \ No newline at end of file +var _0x86bb=['exports','TEXT','medium','BOOLEAN','ENUM','out','STRING','long','DATE','Chat','Email','lodash'];(function(_0x19af6b,_0x5b2017){var _0x2915aa=function(_0x233ce0){while(--_0x233ce0){_0x19af6b['push'](_0x19af6b['shift']());}};_0x2915aa(++_0x5b2017);}(_0x86bb,0xfb));var _0xb86b=function(_0x437808,_0x5d54e4){_0x437808=_0x437808-0x0;var _0x3752ac=_0x86bb[_0x437808];return _0x3752ac;};'use strict';var Sequelize=require('sequelize');var _=require(_0xb86b('0x0'));module[_0xb86b('0x1')]={'body':{'type':Sequelize[_0xb86b('0x2')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xb86b('0x2')](_0xb86b('0x3'))},'read':{'type':Sequelize[_0xb86b('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xb86b('0x5')]('in',_0xb86b('0x6')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xb86b('0x7')](0x1fe)},'from':{'type':Sequelize[_0xb86b('0x7')]},'to':{'type':Sequelize['TEXT'](_0xb86b('0x8'))},'cc':{'type':Sequelize[_0xb86b('0x2')]('long')},'bcc':{'type':Sequelize[_0xb86b('0x2')]('long')},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize[_0xb86b('0x9')]},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize[_0xb86b('0x4')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xb86b('0x9')]},'originTo':{'type':Sequelize[_0xb86b('0x2')](_0xb86b('0x8'))},'originCc':{'type':Sequelize[_0xb86b('0x2')](_0xb86b('0x8'))},'originChannel':{'type':Sequelize[_0xb86b('0x5')]('Email',_0xb86b('0xa')),'defaultValue':_0xb86b('0xb'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 2e63789..bf922c4 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 _0xd710=['interface','channel','motionChannel','event','fromString','EventManager','acceptmessage','reject','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT','fullname','internal','SIP/%s','unix','toString','server','files','tmp','message-%s.eml','bcc','subject','Attachment','Attachments','from','createdAt','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','push','readFileSync','writeFileSync','download','unlinkSync','eml-format','moment','util','path','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','mail-interactions','../../config/environment','defaults','redis','localhost','socket.io-emitter','html-entities','./mailMessage.socket','client','http','request','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','undefined','limit','count','offset','status','set','Content-Range','json','update','then','destroy','stack','name','send','map','MailMessage','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','fields','body','find','describe','create','direction','out','split','CmList','List','CmContact','updatedAt','Smtp','CloudProvider','getSmtpOptions','attachments','join','root','server/files/attachments','basename','Contacts','ListId','List\x20not\x20found','SendMail','sendMail','YYYY-MM-DD\x20HH:mm:ss','accept','format','UserId','get','MailInteraction','MailInteractionId','isNil','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','contact','User','agent','email','manual'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xd710,0x155));var _0x0d71=function(_0x13fdc4,_0x4f0d52){_0x13fdc4=_0x13fdc4-0x0;var _0x4956b9=_0xd710[_0x13fdc4];return _0x4956b9;};'use strict';var emlformat=require(_0x0d71('0x0'));var moment=require(_0x0d71('0x1'));var BPromise=require('bluebird');var util=require(_0x0d71('0x2'));var path=require(_0x0d71('0x3'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x0d71('0x4'));var htmlToText=require(_0x0d71('0x5'));var qs=require(_0x0d71('0x6'));var logger=require(_0x0d71('0x7'))('api');var interaction_log=require(_0x0d71('0x7'))(_0x0d71('0x8'));var config=require(_0x0d71('0x9'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x0d71('0xa')](config[_0x0d71('0xb')],{'host':_0x0d71('0xc'),'port':0x18eb});var socket=require(_0x0d71('0xd'))(new Redis(config[_0x0d71('0xb')]));var htmlEntities=require(_0x0d71('0xe'));require(_0x0d71('0xf'))['register'](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});var client9003=jayson[_0x0d71('0x10')][_0x0d71('0x11')]({'port':0x232b});var client9002=jayson[_0x0d71('0x10')][_0x0d71('0x11')]({'port':0x232a});function respondWithRpcPromise(_0x29a582,_0x43e591,_0x3a38fa,_0x555919){return new BPromise(function(_0x580b10,_0x28adef){var _0x4083e6=_0x555919||client;return _0x4083e6[_0x0d71('0x12')](_0x29a582,_0x3a38fa)['then'](function(_0x395f50){logger[_0x0d71('0x13')](_0x0d71('0x14'),_0x43e591,_0x0d71('0x15'));logger[_0x0d71('0x16')](_0x0d71('0x17'),_0x43e591,_0x0d71('0x15'),JSON[_0x0d71('0x18')](_0x395f50));if(_0x395f50[_0x0d71('0x19')]){if(_0x395f50['error'][_0x0d71('0x1a')]===0x1f4){logger[_0x0d71('0x19')](_0x0d71('0x14'),_0x43e591,_0x395f50[_0x0d71('0x19')]['message']);return _0x28adef(_0x395f50['error'][_0x0d71('0x1b')]);}logger[_0x0d71('0x19')](_0x0d71('0x14'),_0x43e591,_0x395f50['error'][_0x0d71('0x1b')]);return _0x580b10(_0x395f50[_0x0d71('0x19')]['message']);}else{logger['info'](_0x0d71('0x14'),_0x43e591,'request\x20sent');_0x580b10(_0x395f50[_0x0d71('0x1c')][_0x0d71('0x1b')]);}})[_0x0d71('0x1d')](function(_0x36f387){logger[_0x0d71('0x19')]('MailMessage,\x20%s,\x20%s',_0x43e591,_0x36f387);_0x28adef(_0x36f387);});});}function respondWithResult(_0xe7122f,_0x21f429){_0x21f429=_0x21f429||0xc8;return function(_0x4af626){if(_0x4af626){return _0xe7122f['status'](_0x21f429)['json'](_0x4af626);}};}function respondWithFilteredResult(_0x4de98d,_0x15ce78){return function(_0x3fab91){if(_0x3fab91){var _0x333402=typeof _0x15ce78['offset']===_0x0d71('0x1e')&&typeof _0x15ce78[_0x0d71('0x1f')]===_0x0d71('0x1e');var _0x21fd8e=_0x3fab91[_0x0d71('0x20')];var _0x13b126=_0x333402?0x0:_0x15ce78[_0x0d71('0x21')];var _0x447ac8=_0x333402?_0x3fab91[_0x0d71('0x20')]:_0x15ce78[_0x0d71('0x21')]+_0x15ce78[_0x0d71('0x1f')];var _0x8febf2;if(_0x447ac8>=_0x21fd8e){_0x447ac8=_0x21fd8e;_0x8febf2=0xc8;}else{_0x8febf2=0xce;}_0x4de98d[_0x0d71('0x22')](_0x8febf2);return _0x4de98d[_0x0d71('0x23')](_0x0d71('0x24'),_0x13b126+'-'+_0x447ac8+'/'+_0x21fd8e)[_0x0d71('0x25')](_0x3fab91);}return null;};}function saveUpdates(_0x164dea){return function(_0x1bc2e8){if(_0x1bc2e8){return _0x1bc2e8[_0x0d71('0x26')](_0x164dea)[_0x0d71('0x27')](function(_0x229362){return _0x229362;});}return null;};}function removeEntity(_0x851f4a){return function(_0x2c7cb4){if(_0x2c7cb4){return _0x2c7cb4[_0x0d71('0x28')]()[_0x0d71('0x27')](function(){_0x851f4a[_0x0d71('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x20438b){return function(_0x383e16){if(!_0x383e16){_0x20438b['sendStatus'](0x194);}return _0x383e16;};}function handleError(_0x1703ea,_0x106701){_0x106701=_0x106701||0x1f4;return function(_0x30308d){logger[_0x0d71('0x19')](_0x30308d[_0x0d71('0x29')]);if(_0x30308d[_0x0d71('0x2a')]){delete _0x30308d[_0x0d71('0x2a')];}_0x1703ea[_0x0d71('0x22')](_0x106701)[_0x0d71('0x2b')](_0x30308d);};}exports['index']=function(_0x3e93cd,_0x1b2dca){var _0x32fa0c={},_0x17f104={},_0x4ac435={'count':0x0,'rows':[]};var _0x4107ab=_[_0x0d71('0x2c')](db[_0x0d71('0x2d')][_0x0d71('0x2e')],function(_0x3ce118){return{'name':_0x3ce118[_0x0d71('0x2f')],'type':_0x3ce118[_0x0d71('0x30')][_0x0d71('0x31')]};});_0x17f104[_0x0d71('0x32')]=_[_0x0d71('0x2c')](_0x4107ab,_0x0d71('0x2a'));_0x17f104['query']=_[_0x0d71('0x33')](_0x3e93cd[_0x0d71('0x34')]);_0x17f104[_0x0d71('0x35')]=_[_0x0d71('0x36')](_0x17f104[_0x0d71('0x32')],_0x17f104[_0x0d71('0x34')]);_0x32fa0c['attributes']=_['intersection'](_0x17f104[_0x0d71('0x32')],qs['fields'](_0x3e93cd[_0x0d71('0x34')]['fields']));_0x32fa0c[_0x0d71('0x37')]=_0x32fa0c[_0x0d71('0x37')][_0x0d71('0x38')]?_0x32fa0c['attributes']:_0x17f104[_0x0d71('0x32')];if(!_0x3e93cd['query'][_0x0d71('0x39')](_0x0d71('0x3a'))){_0x32fa0c[_0x0d71('0x1f')]=qs[_0x0d71('0x1f')](_0x3e93cd[_0x0d71('0x34')][_0x0d71('0x1f')]);_0x32fa0c[_0x0d71('0x21')]=qs[_0x0d71('0x21')](_0x3e93cd[_0x0d71('0x34')][_0x0d71('0x21')]);}_0x32fa0c['order']=qs[_0x0d71('0x3b')](_0x3e93cd[_0x0d71('0x34')][_0x0d71('0x3b')]);_0x32fa0c[_0x0d71('0x3c')]=qs[_0x0d71('0x35')](_['pick'](_0x3e93cd['query'],_0x17f104[_0x0d71('0x35')]),_0x4107ab);if(_0x3e93cd[_0x0d71('0x34')][_0x0d71('0x3d')]){_0x32fa0c[_0x0d71('0x3c')]=_[_0x0d71('0x3e')](_0x32fa0c[_0x0d71('0x3c')],{'$or':_['map'](_0x4107ab,function(_0x214440){if(_0x214440['type']!==_0x0d71('0x3f')){var _0x2a2d51={};_0x2a2d51[_0x214440['name']]={'$like':'%'+_0x3e93cd[_0x0d71('0x34')]['filter']+'%'};return _0x2a2d51;}})});}_0x32fa0c=_[_0x0d71('0x3e')]({},_0x32fa0c,_0x3e93cd[_0x0d71('0x40')]);var _0x5c5901={'where':_0x32fa0c[_0x0d71('0x3c')]};return db[_0x0d71('0x2d')][_0x0d71('0x20')](_0x5c5901)['then'](function(_0x4453ac){_0x4ac435[_0x0d71('0x20')]=_0x4453ac;if(_0x3e93cd[_0x0d71('0x34')][_0x0d71('0x41')]){_0x32fa0c[_0x0d71('0x42')]=[{'all':!![]}];}return db['MailMessage']['findAll'](_0x32fa0c);})[_0x0d71('0x27')](function(_0xef688a){_0x4ac435[_0x0d71('0x43')]=_0xef688a;return _0x4ac435;})['then'](respondWithFilteredResult(_0x1b2dca,_0x32fa0c))['catch'](handleError(_0x1b2dca,null));};exports[_0x0d71('0x44')]=function(_0x2d5eb8,_0x2f4683){var _0x2f51bc={'raw':!![],'where':{'id':_0x2d5eb8[_0x0d71('0x45')]['id']}},_0x58be54={};_0x58be54[_0x0d71('0x32')]=_[_0x0d71('0x33')](db[_0x0d71('0x2d')]['rawAttributes']);_0x58be54['query']=_[_0x0d71('0x33')](_0x2d5eb8[_0x0d71('0x34')]);_0x58be54[_0x0d71('0x35')]=_[_0x0d71('0x36')](_0x58be54[_0x0d71('0x32')],_0x58be54[_0x0d71('0x34')]);_0x2f51bc[_0x0d71('0x37')]=_[_0x0d71('0x36')](_0x58be54[_0x0d71('0x32')],qs[_0x0d71('0x46')](_0x2d5eb8[_0x0d71('0x34')][_0x0d71('0x46')]));_0x2f51bc['attributes']=_0x2f51bc[_0x0d71('0x37')][_0x0d71('0x38')]?_0x2f51bc[_0x0d71('0x37')]:_0x58be54[_0x0d71('0x32')];if(_0x2d5eb8['query'][_0x0d71('0x41')]){_0x2f51bc[_0x0d71('0x42')]=[{'all':!![]}];}_0x2f51bc=_[_0x0d71('0x3e')]({},_0x2f51bc,_0x2d5eb8['options']);return db['MailMessage']['find'](_0x2f51bc)['then'](handleEntityNotFound(_0x2f4683,null))[_0x0d71('0x27')](respondWithResult(_0x2f4683,null))['catch'](handleError(_0x2f4683,null));};exports[_0x0d71('0x26')]=function(_0x413d3a,_0x181042){if(_0x413d3a[_0x0d71('0x47')]['id']){delete _0x413d3a[_0x0d71('0x47')]['id'];}return db[_0x0d71('0x2d')][_0x0d71('0x48')]({'where':{'id':_0x413d3a[_0x0d71('0x45')]['id']}})[_0x0d71('0x27')](handleEntityNotFound(_0x181042,null))['then'](saveUpdates(_0x413d3a[_0x0d71('0x47')],null))[_0x0d71('0x27')](respondWithResult(_0x181042,null))[_0x0d71('0x1d')](handleError(_0x181042,null));};exports[_0x0d71('0x28')]=function(_0x416cb3,_0x3e05b9){return db[_0x0d71('0x2d')][_0x0d71('0x48')]({'where':{'id':_0x416cb3[_0x0d71('0x45')]['id']}})['then'](handleEntityNotFound(_0x3e05b9,null))[_0x0d71('0x27')](removeEntity(_0x3e05b9,null))[_0x0d71('0x1d')](handleError(_0x3e05b9,null));};exports[_0x0d71('0x49')]=function(_0x3f8ae8,_0x2ceb5b){return db[_0x0d71('0x2d')][_0x0d71('0x49')]()[_0x0d71('0x27')](respondWithResult(_0x2ceb5b,null))[_0x0d71('0x1d')](handleError(_0x2ceb5b,null));};exports[_0x0d71('0x4a')]=function(_0x4fc86f,_0x38e306){return db['MailMessage']['create'](_0x4fc86f[_0x0d71('0x47')])['then'](function(_0x22a7a6){if(_0x22a7a6){if(_0x22a7a6[_0x0d71('0x4b')]===_0x0d71('0x4c')&&!_0x22a7a6['secret']){var _0x16d601,_0x1eed39,_0x43b905;if(_0x4fc86f['body']['to']){_0x1eed39=_0x4fc86f['body']['to'][_0x0d71('0x4d')](',')[0x0];}return db['MailAccount']['findOne']({'where':{'id':_0x22a7a6['MailAccountId']},'include':[{'model':db[_0x0d71('0x4e')],'as':_0x0d71('0x4f'),'include':[{'model':db[_0x0d71('0x50')],'as':'Contacts','where':{'email':_0x1eed39},'limit':0x1,'order':[[_0x0d71('0x51'),'DESC']]}]},{'model':db['MailServerOut'],'as':_0x0d71('0x52'),'raw':!![],'include':[{'model':db[_0x0d71('0x53')],'as':_0x0d71('0x53'),'raw':!![]}]}]})[_0x0d71('0x27')](function(_0x94be89){_0x16d601=_0x94be89;if(!_0x16d601||!_0x16d601[_0x0d71('0x52')])return;var _0x4e68dd=_0x16d601[_0x0d71('0x54')]();if(_0x4fc86f[_0x0d71('0x47')][_0x0d71('0x55')]&&_0x4fc86f['body'][_0x0d71('0x55')]['length']){for(var _0x84c7e2=0x0;_0x84c7e2<_0x4fc86f[_0x0d71('0x47')][_0x0d71('0x55')][_0x0d71('0x38')];_0x84c7e2+=0x1){_0x4fc86f[_0x0d71('0x47')][_0x0d71('0x55')][_0x84c7e2]={'filename':_0x4fc86f[_0x0d71('0x47')][_0x0d71('0x55')][_0x84c7e2][_0x0d71('0x2a')],'path':path[_0x0d71('0x56')](config[_0x0d71('0x57')],_0x0d71('0x58'),_0x4fc86f[_0x0d71('0x47')][_0x0d71('0x55')][_0x84c7e2][_0x0d71('0x59')])};}}_0x43b905={'account':_0x4e68dd,'message':_0x4fc86f[_0x0d71('0x47')]};return;})[_0x0d71('0x27')](function(){if(_0x16d601[_0x0d71('0x4f')]){if(_0x16d601[_0x0d71('0x4f')][_0x0d71('0x5a')][_0x0d71('0x38')]){return _0x16d601[_0x0d71('0x4f')]['Contacts'][0x0];}else{return db[_0x0d71('0x50')]['create'](_[_0x0d71('0xa')](_0x4fc86f[_0x0d71('0x47')],{'firstName':_0x4fc86f[_0x0d71('0x47')]['to'],'email':_0x4fc86f[_0x0d71('0x47')]['to'],'phone':_0x4fc86f[_0x0d71('0x47')]['to'],'ListId':_0x16d601[_0x0d71('0x5b')]}));}}else{throw new Error(_0x0d71('0x5c'));}})[_0x0d71('0x27')](function(){if(_0x43b905){return respondWithRpcPromise(_0x0d71('0x5d'),_0x0d71('0x5e'),_0x43b905,client9003)[_0x0d71('0x27')](function(_0x4c4a5d){return _0x22a7a6[_0x0d71('0x26')]({'read':!![],'messageId':_0x4c4a5d['messageId'],'sentAt':moment()['format'](_0x0d71('0x5f'))});})[_0x0d71('0x1d')](function(_0x1e8752){logger[_0x0d71('0x19')]('%s',JSON[_0x0d71('0x18')](_0x1e8752));return _0x22a7a6;});}return _0x22a7a6;});}return _0x22a7a6;}})[_0x0d71('0x27')](respondWithResult(_0x38e306,0xc9))[_0x0d71('0x1d')](handleError(_0x38e306,null));};exports[_0x0d71('0x60')]=function(_0x4fca12,_0x9af983){var _0x500770={'agent':{},'channel':'mail'};if(_0x4fca12[_0x0d71('0x47')]['id']){delete _0x4fca12[_0x0d71('0x47')]['id'];}_0x4fca12[_0x0d71('0x47')]['read']=!![];_0x4fca12[_0x0d71('0x47')]['readAt']=moment()[_0x0d71('0x61')]('YYYY-MM-DD\x20HH:mm:ss');_0x4fca12[_0x0d71('0x47')]['UserId']=_0x4fca12[_0x0d71('0x47')][_0x0d71('0x62')]||_0x4fca12['user']['id'];_0x500770['agent']['id']=_0x4fca12['body'][_0x0d71('0x62')];return db[_0x0d71('0x2d')][_0x0d71('0x48')]({'where':{'id':_0x4fca12[_0x0d71('0x45')]['id'],'UserId':null}})[_0x0d71('0x27')](handleEntityNotFound(_0x9af983,null))['then'](saveUpdates(_0x4fca12[_0x0d71('0x47')],null))[_0x0d71('0x27')](function(_0x339d1e){if(_0x339d1e){_0x500770[_0x0d71('0x1b')]=_0x339d1e[_0x0d71('0x63')]({'plain':!![]});return db[_0x0d71('0x64')]['find']({'where':{'id':_0x339d1e[_0x0d71('0x65')]}});}return null;})[_0x0d71('0x27')](handleEntityNotFound(_0x9af983,null))[_0x0d71('0x27')](function(_0x4cd746){if(_0x4cd746){return _0x4cd746['update']({'UserId':_0x4fca12[_0x0d71('0x47')][_0x0d71('0x62')],'read1stAt':_[_0x0d71('0x66')](_0x4cd746['read1stAt'])?moment()[_0x0d71('0x61')](_0x0d71('0x5f')):undefined});}return null;})['then'](function(_0x287ca8){if(_0x287ca8){_0x500770[_0x0d71('0x67')]=_0x287ca8['get']({'plain':!![]});interaction_log[_0x0d71('0x13')](_0x0d71('0x68'),_0x4fca12[_0x0d71('0x69')]['id'],_0x4fca12[_0x0d71('0x69')][_0x0d71('0x2a')],_0x4fca12[_0x0d71('0x69')][_0x0d71('0x6a')],_0x500770['interaction']['id'],_0x4fca12[_0x0d71('0x47')]?JSON['stringify'](_0x4fca12[_0x0d71('0x47')]):'null');return respondWithRpcPromise(_0x0d71('0x6b'),'acceptMessage',_0x500770);}return null;})[_0x0d71('0x27')](function(_0x46e463){var _0xbbf080=_0x0d71('0x6c')+_0x46e463[_0x0d71('0x1b')][_0x0d71('0x6d')];return db[_0x0d71('0x6e')][_0x0d71('0x34')](_0xbbf080,{'type':db[_0x0d71('0x6f')][_0x0d71('0x70')]['SELECT'],'raw':!![]})['then'](function(_0x160787){return _0x160787;});})[_0x0d71('0x27')](function(_0x2041cb){if(_0x2041cb){_0x500770[_0x0d71('0x1b')][_0x0d71('0x71')]=_0x2041cb[0x0];if(!_0x4fca12[_0x0d71('0x47')][_0x0d71('0x62')])return;return db[_0x0d71('0x72')][_0x0d71('0x48')]({'where':{'id':_0x4fca12[_0x0d71('0x47')]['UserId'],'role':_0x0d71('0x73')},'attributes':['id',_0x0d71('0x2a'),'fullname',_0x0d71('0x74'),'internal'],'raw':!![]});}return null;})[_0x0d71('0x27')](function(_0x93b79f){if(!_0x93b79f)return null;_0x500770[_0x0d71('0x1b')]['agent']=_0x93b79f;return _0x500770;})['then'](function(_0x257a40){if(_0x257a40){if(_0x4fca12[_0x0d71('0x47')][_0x0d71('0x75')]){_0x500770[_0x0d71('0x1b')][_0x0d71('0x76')]=util[_0x0d71('0x61')]('SIP/%s',_0x4fca12[_0x0d71('0x69')][_0x0d71('0x2a')]);_0x500770[_0x0d71('0x1b')][_0x0d71('0x77')]=_0x500770[_0x0d71('0x77')];_0x500770[_0x0d71('0x1b')][_0x0d71('0x78')]=_0x500770['channel'];_0x500770[_0x0d71('0x1b')][_0x0d71('0x79')]='accept';_0x500770[_0x0d71('0x1b')][_0x0d71('0x47')]=htmlToText[_0x0d71('0x7a')](_0x500770[_0x0d71('0x1b')][_0x0d71('0x47')]);return respondWithRpcPromise(_0x0d71('0x7b'),'EventManager',{'event':_0x0d71('0x7c'),'message':_0x500770['message']},client9002)[_0x0d71('0x27')](function(){return _0x500770;});}return _0x500770;}return null;})[_0x0d71('0x27')](respondWithResult(_0x9af983,null))['catch'](handleError(_0x9af983,null));};exports[_0x0d71('0x7d')]=function(_0x5158e2,_0x45c9cb){var _0x1fbf6f={'agent':{},'channel':'mail'};if(_0x5158e2[_0x0d71('0x47')]['id']){delete _0x5158e2[_0x0d71('0x47')]['id'];}_0x5158e2[_0x0d71('0x47')][_0x0d71('0x62')]=_0x5158e2['body'][_0x0d71('0x62')]||_0x5158e2[_0x0d71('0x69')]['id'];_0x1fbf6f[_0x0d71('0x73')]['id']=_0x5158e2['body'][_0x0d71('0x62')];return db[_0x0d71('0x2d')][_0x0d71('0x48')]({'where':{'id':_0x5158e2[_0x0d71('0x45')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x45c9cb,null))['then'](function(_0x16f128){if(_0x16f128){_0x1fbf6f[_0x0d71('0x1b')]=_0x16f128['get']({'plain':!![]});return db[_0x0d71('0x64')]['find']({'where':{'id':_0x16f128[_0x0d71('0x65')]}});}return null;})[_0x0d71('0x27')](handleEntityNotFound(_0x45c9cb,null))[_0x0d71('0x27')](function(_0x2667b8){if(_0x2667b8){_0x1fbf6f['interaction']=_0x2667b8[_0x0d71('0x63')]({'plain':!![]});interaction_log[_0x0d71('0x13')](_0x0d71('0x7e'),_0x5158e2[_0x0d71('0x69')]['id'],_0x5158e2['user']['name'],_0x5158e2[_0x0d71('0x69')][_0x0d71('0x6a')],_0x1fbf6f[_0x0d71('0x67')]['id'],_0x5158e2[_0x0d71('0x47')]?JSON[_0x0d71('0x18')](_0x5158e2[_0x0d71('0x47')]):'null');return respondWithRpcPromise(_0x0d71('0x7f'),_0x0d71('0x80'),_0x1fbf6f);}return null;})[_0x0d71('0x27')](function(_0x5d5e86){var _0x60165='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5d5e86[_0x0d71('0x1b')]['ContactId'];return db[_0x0d71('0x6e')]['query'](_0x60165,{'type':db[_0x0d71('0x6f')][_0x0d71('0x70')][_0x0d71('0x81')],'raw':!![]})['then'](function(_0x1d6600){return _0x1d6600;});})['then'](function(_0x4cc917){if(_0x4cc917){_0x1fbf6f[_0x0d71('0x1b')][_0x0d71('0x71')]=_0x4cc917[0x0];if(!_0x5158e2['body'][_0x0d71('0x62')])return;return db['User']['find']({'where':{'id':_0x5158e2[_0x0d71('0x47')]['UserId'],'role':_0x0d71('0x73')},'attributes':['id',_0x0d71('0x2a'),_0x0d71('0x82'),'email',_0x0d71('0x83')],'raw':!![]});}return null;})[_0x0d71('0x27')](function(_0x29e417){if(!_0x29e417)return null;_0x1fbf6f['message'][_0x0d71('0x73')]=_0x29e417;return _0x1fbf6f;})['then'](function(_0x27061e){if(_0x27061e){_0x27061e[_0x0d71('0x1b')][_0x0d71('0x76')]=util[_0x0d71('0x61')](_0x0d71('0x84'),_0x5158e2[_0x0d71('0x69')][_0x0d71('0x2a')]);_0x27061e[_0x0d71('0x1b')][_0x0d71('0x77')]=_0x1fbf6f[_0x0d71('0x77')];_0x27061e[_0x0d71('0x1b')][_0x0d71('0x78')]=_0x1fbf6f[_0x0d71('0x77')];_0x27061e[_0x0d71('0x1b')][_0x0d71('0x79')]=_0x0d71('0x7d');_0x27061e[_0x0d71('0x1b')][_0x0d71('0x47')]=htmlToText[_0x0d71('0x7a')](_0x1fbf6f[_0x0d71('0x1b')]['body']);respondWithRpcPromise(_0x0d71('0x7b'),_0x0d71('0x7b'),{'event':'rejectmessage','message':_0x27061e[_0x0d71('0x1b')]},client9002);return _0x1fbf6f;}return null;})[_0x0d71('0x27')](respondWithResult(_0x45c9cb,null))['catch'](handleError(_0x45c9cb,null));};exports['download']=function(_0x373b39,_0x35e6b9){var _0x49237d=moment()[_0x0d71('0x85')]()[_0x0d71('0x86')]();var _0x4dc069=path[_0x0d71('0x56')](config[_0x0d71('0x57')],_0x0d71('0x87'),_0x0d71('0x88'),_0x0d71('0x89'));var _0x5f42e0=path[_0x0d71('0x56')](config[_0x0d71('0x57')],_0x0d71('0x87'),'files','attachments');var _0x2e0a2c=util[_0x0d71('0x61')](_0x0d71('0x8a'),_0x49237d);return db[_0x0d71('0x2d')][_0x0d71('0x48')]({'where':{'id':_0x373b39[_0x0d71('0x45')]['id']},'attributes':['id',_0x0d71('0x47'),'from','to','cc',_0x0d71('0x8b'),_0x0d71('0x8c'),'createdAt'],'include':_0x373b39['query']['attachments']?[{'model':db[_0x0d71('0x8d')],'as':_0x0d71('0x8e')}]:undefined})[_0x0d71('0x27')](handleEntityNotFound(_0x35e6b9,null))[_0x0d71('0x27')](function(_0x14a0c1){if(_0x14a0c1){var _0x21cf2d=_0x14a0c1;var _0x3bfbe4={'from':_0x21cf2d[_0x0d71('0x8f')],'to':_0x21cf2d['to'],'subject':_0x21cf2d[_0x0d71('0x8c')],'html':htmlEntities['decode'](_0x21cf2d['body']),'headers':{'Date':moment(_0x21cf2d[_0x0d71('0x90')])[_0x0d71('0x61')](_0x0d71('0x91'))},'attachments':[]};if(_0x14a0c1['cc']){_0x3bfbe4[_0x0d71('0x92')]['Cc']=_0x14a0c1['cc'];}if(_0x14a0c1[_0x0d71('0x8b')]){_0x3bfbe4[_0x0d71('0x92')][_0x0d71('0x93')]=_0x14a0c1[_0x0d71('0x8b')];}return new BPromise(function(_0x94d176,_0x4204b0){if(_0x14a0c1['Attachments']){for(var _0x1748f2=0x0;_0x1748f2<_0x14a0c1['Attachments'][_0x0d71('0x38')];_0x1748f2++){var _0x2f24d9=_0x14a0c1[_0x0d71('0x8e')][_0x1748f2];var _0x11b7ac=path[_0x0d71('0x56')](_0x5f42e0,_0x2f24d9[_0x0d71('0x59')]);if(fs['existsSync'](_0x11b7ac)){_0x3bfbe4[_0x0d71('0x55')][_0x0d71('0x94')]({'name':_0x2f24d9[_0x0d71('0x2a')],'contentType':_0x2f24d9['type'],'data':fs[_0x0d71('0x95')](_0x11b7ac)});}}}emlformat['build'](_0x3bfbe4,function(_0xc18ad9,_0x2324ed){if(_0xc18ad9)return _0x4204b0(_0xc18ad9);fs[_0x0d71('0x96')](path[_0x0d71('0x56')](_0x4dc069,_0x2e0a2c),_0x2324ed);return _0x94d176(_0x2324ed);});});}})['then'](function(_0x48d02d){if(_0x48d02d){return _0x35e6b9[_0x0d71('0x97')](path[_0x0d71('0x56')](_0x4dc069,_0x2e0a2c),_0x2e0a2c,function(_0x153fe3){if(!_0x153fe3)fs[_0x0d71('0x98')](path[_0x0d71('0x56')](_0x4dc069,_0x2e0a2c));});}})[_0x0d71('0x1d')](handleError(_0x35e6b9,null));}; \ No newline at end of file +var _0x236d=['type','key','name','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','body','describe','create','direction','out','split','MailAccount','findOne','MailAccountId','CmList','List','CmContact','Contacts','Smtp','CloudProvider','getSmtpOptions','attachments','join','root','basename','List\x20not\x20found','SendMail','messageId','format','accept','mail','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','MailInteraction','MailInteractionId','isNil','read1stAt','interaction','get','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','fullname','internal','interface','SIP/%s','channel','motionChannel','event','fromString','EventManager','reject','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','contact','download','files','tmp','server','from','bcc','subject','createdAt','Attachment','Attachments','decode','headers','existsSync','readFileSync','build','eml-format','moment','bluebird','path','lodash','ioredis','../../config/logger','mail-interactions','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','html-entities','./mailMessage.socket','jayson/promise','client','http','request','request\x20sent','stringify','error','MailMessage,\x20%s,\x20%s','message','info','result','catch','status','json','offset','undefined','limit','count','Content-Range','update','destroy','then','end','sendStatus','stack','send','index','map','MailMessage','rawAttributes','fieldName'];(function(_0x28a4f6,_0x3a8a86){var _0x5573fd=function(_0xe10569){while(--_0xe10569){_0x28a4f6['push'](_0x28a4f6['shift']());}};_0x5573fd(++_0x3a8a86);}(_0x236d,0xfe));var _0xd236=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x236d[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xd236('0x0'));var moment=require(_0xd236('0x1'));var BPromise=require(_0xd236('0x2'));var util=require('util');var path=require(_0xd236('0x3'));var fs=require('fs');var _=require(_0xd236('0x4'));var Redis=require(_0xd236('0x5'));var htmlToText=require('html-to-text');var qs=require('../../components/parsers/qs');var logger=require(_0xd236('0x6'))('api');var interaction_log=require(_0xd236('0x6'))(_0xd236('0x7'));var config=require(_0xd236('0x8'));var db=require(_0xd236('0x9'))['db'];config['redis']=_[_0xd236('0xa')](config[_0xd236('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xd236('0xc'))(new Redis(config['redis']));var htmlEntities=require(_0xd236('0xd'));require(_0xd236('0xe'))['register'](socket);var jayson=require(_0xd236('0xf'));var client=jayson[_0xd236('0x10')][_0xd236('0x11')]({'port':0x232c});var client9003=jayson[_0xd236('0x10')][_0xd236('0x11')]({'port':0x232b});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x39c428,_0x58d29c,_0x423698,_0xe95b13){return new BPromise(function(_0x145141,_0x226139){var _0x13e6fb=_0xe95b13||client;return _0x13e6fb[_0xd236('0x12')](_0x39c428,_0x423698)['then'](function(_0x29bf0b){logger['info']('MailMessage,\x20%s,\x20%s',_0x58d29c,_0xd236('0x13'));logger['debug']('MailMessage,\x20%s,\x20%s,\x20%s',_0x58d29c,_0xd236('0x13'),JSON[_0xd236('0x14')](_0x29bf0b));if(_0x29bf0b[_0xd236('0x15')]){if(_0x29bf0b['error']['code']===0x1f4){logger[_0xd236('0x15')](_0xd236('0x16'),_0x58d29c,_0x29bf0b[_0xd236('0x15')][_0xd236('0x17')]);return _0x226139(_0x29bf0b[_0xd236('0x15')][_0xd236('0x17')]);}logger[_0xd236('0x15')]('MailMessage,\x20%s,\x20%s',_0x58d29c,_0x29bf0b[_0xd236('0x15')]['message']);return _0x145141(_0x29bf0b[_0xd236('0x15')][_0xd236('0x17')]);}else{logger[_0xd236('0x18')]('MailMessage,\x20%s,\x20%s',_0x58d29c,_0xd236('0x13'));_0x145141(_0x29bf0b[_0xd236('0x19')][_0xd236('0x17')]);}})[_0xd236('0x1a')](function(_0xfb7709){logger['error'](_0xd236('0x16'),_0x58d29c,_0xfb7709);_0x226139(_0xfb7709);});});}function respondWithResult(_0x548177,_0x5ee293){_0x5ee293=_0x5ee293||0xc8;return function(_0x277385){if(_0x277385){return _0x548177[_0xd236('0x1b')](_0x5ee293)[_0xd236('0x1c')](_0x277385);}};}function respondWithFilteredResult(_0x4a0525,_0x5a693f){return function(_0x4be84f){if(_0x4be84f){var _0x1a6b54=typeof _0x5a693f[_0xd236('0x1d')]===_0xd236('0x1e')&&typeof _0x5a693f[_0xd236('0x1f')]===_0xd236('0x1e');var _0xa6b300=_0x4be84f[_0xd236('0x20')];var _0x3bd323=_0x1a6b54?0x0:_0x5a693f[_0xd236('0x1d')];var _0x20f056=_0x1a6b54?_0x4be84f[_0xd236('0x20')]:_0x5a693f['offset']+_0x5a693f[_0xd236('0x1f')];var _0x49224f;if(_0x20f056>=_0xa6b300){_0x20f056=_0xa6b300;_0x49224f=0xc8;}else{_0x49224f=0xce;}_0x4a0525[_0xd236('0x1b')](_0x49224f);return _0x4a0525['set'](_0xd236('0x21'),_0x3bd323+'-'+_0x20f056+'/'+_0xa6b300)[_0xd236('0x1c')](_0x4be84f);}return null;};}function saveUpdates(_0x541511){return function(_0x5ab663){if(_0x5ab663){return _0x5ab663[_0xd236('0x22')](_0x541511)['then'](function(_0x2d65aa){return _0x2d65aa;});}return null;};}function removeEntity(_0x19508c){return function(_0x1ac117){if(_0x1ac117){return _0x1ac117[_0xd236('0x23')]()[_0xd236('0x24')](function(){_0x19508c[_0xd236('0x1b')](0xcc)[_0xd236('0x25')]();});}};}function handleEntityNotFound(_0x1b819d){return function(_0x5d5d30){if(!_0x5d5d30){_0x1b819d[_0xd236('0x26')](0x194);}return _0x5d5d30;};}function handleError(_0x67a7fb,_0x5007be){_0x5007be=_0x5007be||0x1f4;return function(_0x36ff58){logger['error'](_0x36ff58[_0xd236('0x27')]);if(_0x36ff58['name']){delete _0x36ff58['name'];}_0x67a7fb['status'](_0x5007be)[_0xd236('0x28')](_0x36ff58);};}exports[_0xd236('0x29')]=function(_0x5406ab,_0x4af4e8){var _0x4abf34={},_0x49ee1a={},_0x24511a={'count':0x0,'rows':[]};var _0x5566b9=_[_0xd236('0x2a')](db[_0xd236('0x2b')][_0xd236('0x2c')],function(_0x34b9b2){return{'name':_0x34b9b2[_0xd236('0x2d')],'type':_0x34b9b2[_0xd236('0x2e')][_0xd236('0x2f')]};});_0x49ee1a['model']=_[_0xd236('0x2a')](_0x5566b9,_0xd236('0x30'));_0x49ee1a['query']=_[_0xd236('0x31')](_0x5406ab[_0xd236('0x32')]);_0x49ee1a[_0xd236('0x33')]=_[_0xd236('0x34')](_0x49ee1a[_0xd236('0x35')],_0x49ee1a[_0xd236('0x32')]);_0x4abf34[_0xd236('0x36')]=_[_0xd236('0x34')](_0x49ee1a[_0xd236('0x35')],qs['fields'](_0x5406ab[_0xd236('0x32')][_0xd236('0x37')]));_0x4abf34[_0xd236('0x36')]=_0x4abf34[_0xd236('0x36')][_0xd236('0x38')]?_0x4abf34[_0xd236('0x36')]:_0x49ee1a[_0xd236('0x35')];if(!_0x5406ab[_0xd236('0x32')][_0xd236('0x39')](_0xd236('0x3a'))){_0x4abf34[_0xd236('0x1f')]=qs[_0xd236('0x1f')](_0x5406ab[_0xd236('0x32')][_0xd236('0x1f')]);_0x4abf34[_0xd236('0x1d')]=qs[_0xd236('0x1d')](_0x5406ab[_0xd236('0x32')]['offset']);}_0x4abf34[_0xd236('0x3b')]=qs['sort'](_0x5406ab[_0xd236('0x32')][_0xd236('0x3c')]);_0x4abf34[_0xd236('0x3d')]=qs[_0xd236('0x33')](_['pick'](_0x5406ab[_0xd236('0x32')],_0x49ee1a[_0xd236('0x33')]),_0x5566b9);if(_0x5406ab[_0xd236('0x32')]['filter']){_0x4abf34[_0xd236('0x3d')]=_[_0xd236('0x3e')](_0x4abf34['where'],{'$or':_[_0xd236('0x2a')](_0x5566b9,function(_0x52d09c){if(_0x52d09c[_0xd236('0x2e')]!==_0xd236('0x3f')){var _0x5b389e={};_0x5b389e[_0x52d09c[_0xd236('0x30')]]={'$like':'%'+_0x5406ab['query']['filter']+'%'};return _0x5b389e;}})});}_0x4abf34=_['merge']({},_0x4abf34,_0x5406ab[_0xd236('0x40')]);var _0x23f8eb={'where':_0x4abf34[_0xd236('0x3d')]};return db[_0xd236('0x2b')][_0xd236('0x20')](_0x23f8eb)[_0xd236('0x24')](function(_0x4a50e5){_0x24511a[_0xd236('0x20')]=_0x4a50e5;if(_0x5406ab[_0xd236('0x32')][_0xd236('0x41')]){_0x4abf34[_0xd236('0x42')]=[{'all':!![]}];}return db[_0xd236('0x2b')][_0xd236('0x43')](_0x4abf34);})['then'](function(_0x29cfdb){_0x24511a[_0xd236('0x44')]=_0x29cfdb;return _0x24511a;})[_0xd236('0x24')](respondWithFilteredResult(_0x4af4e8,_0x4abf34))[_0xd236('0x1a')](handleError(_0x4af4e8,null));};exports[_0xd236('0x45')]=function(_0x22a805,_0x27941e){var _0x29885c={'raw':!![],'where':{'id':_0x22a805[_0xd236('0x46')]['id']}},_0x2ac262={};_0x2ac262['model']=_[_0xd236('0x31')](db[_0xd236('0x2b')][_0xd236('0x2c')]);_0x2ac262[_0xd236('0x32')]=_[_0xd236('0x31')](_0x22a805[_0xd236('0x32')]);_0x2ac262['filters']=_[_0xd236('0x34')](_0x2ac262['model'],_0x2ac262[_0xd236('0x32')]);_0x29885c['attributes']=_[_0xd236('0x34')](_0x2ac262[_0xd236('0x35')],qs[_0xd236('0x37')](_0x22a805['query'][_0xd236('0x37')]));_0x29885c[_0xd236('0x36')]=_0x29885c['attributes'][_0xd236('0x38')]?_0x29885c[_0xd236('0x36')]:_0x2ac262[_0xd236('0x35')];if(_0x22a805[_0xd236('0x32')][_0xd236('0x41')]){_0x29885c['include']=[{'all':!![]}];}_0x29885c=_[_0xd236('0x3e')]({},_0x29885c,_0x22a805[_0xd236('0x40')]);return db[_0xd236('0x2b')][_0xd236('0x47')](_0x29885c)['then'](handleEntityNotFound(_0x27941e,null))[_0xd236('0x24')](respondWithResult(_0x27941e,null))['catch'](handleError(_0x27941e,null));};exports[_0xd236('0x22')]=function(_0x4ed97e,_0x2b845d){if(_0x4ed97e[_0xd236('0x48')]['id']){delete _0x4ed97e[_0xd236('0x48')]['id'];}return db['MailMessage']['find']({'where':{'id':_0x4ed97e[_0xd236('0x46')]['id']}})[_0xd236('0x24')](handleEntityNotFound(_0x2b845d,null))['then'](saveUpdates(_0x4ed97e[_0xd236('0x48')],null))[_0xd236('0x24')](respondWithResult(_0x2b845d,null))[_0xd236('0x1a')](handleError(_0x2b845d,null));};exports['destroy']=function(_0x278f26,_0x483a85){return db[_0xd236('0x2b')]['find']({'where':{'id':_0x278f26[_0xd236('0x46')]['id']}})['then'](handleEntityNotFound(_0x483a85,null))[_0xd236('0x24')](removeEntity(_0x483a85,null))[_0xd236('0x1a')](handleError(_0x483a85,null));};exports[_0xd236('0x49')]=function(_0x81d672,_0x2ec06d){return db[_0xd236('0x2b')][_0xd236('0x49')]()[_0xd236('0x24')](respondWithResult(_0x2ec06d,null))[_0xd236('0x1a')](handleError(_0x2ec06d,null));};exports['create']=function(_0x34b221,_0x1095ce){return db['MailMessage'][_0xd236('0x4a')](_0x34b221[_0xd236('0x48')])[_0xd236('0x24')](function(_0x128549){if(_0x128549){if(_0x128549[_0xd236('0x4b')]===_0xd236('0x4c')&&!_0x128549['secret']){var _0xff819,_0x2cfaf8,_0x4a7dbd;if(_0x34b221[_0xd236('0x48')]['to']){_0x2cfaf8=_0x34b221[_0xd236('0x48')]['to'][_0xd236('0x4d')](',')[0x0];}return db[_0xd236('0x4e')][_0xd236('0x4f')]({'where':{'id':_0x128549[_0xd236('0x50')]},'include':[{'model':db[_0xd236('0x51')],'as':_0xd236('0x52'),'include':[{'model':db[_0xd236('0x53')],'as':_0xd236('0x54'),'where':{'email':_0x2cfaf8},'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db['MailServerOut'],'as':_0xd236('0x55'),'raw':!![],'include':[{'model':db[_0xd236('0x56')],'as':'CloudProvider','raw':!![]}]}]})[_0xd236('0x24')](function(_0x502e22){_0xff819=_0x502e22;if(!_0xff819||!_0xff819['Smtp'])return;var _0x58112a=_0xff819[_0xd236('0x57')]();if(_0x34b221[_0xd236('0x48')][_0xd236('0x58')]&&_0x34b221[_0xd236('0x48')][_0xd236('0x58')]['length']){for(var _0x5aea4b=0x0;_0x5aea4b<_0x34b221['body'][_0xd236('0x58')]['length'];_0x5aea4b+=0x1){_0x34b221['body'][_0xd236('0x58')][_0x5aea4b]={'filename':_0x34b221[_0xd236('0x48')][_0xd236('0x58')][_0x5aea4b][_0xd236('0x30')],'path':path[_0xd236('0x59')](config[_0xd236('0x5a')],'server/files/attachments',_0x34b221[_0xd236('0x48')][_0xd236('0x58')][_0x5aea4b][_0xd236('0x5b')])};}}_0x4a7dbd={'account':_0x58112a,'message':_0x34b221[_0xd236('0x48')]};return;})['then'](function(){if(_0xff819[_0xd236('0x52')]){if(_0xff819[_0xd236('0x52')][_0xd236('0x54')][_0xd236('0x38')]){return _0xff819['List']['Contacts'][0x0];}else{return db[_0xd236('0x53')][_0xd236('0x4a')](_[_0xd236('0xa')](_0x34b221[_0xd236('0x48')],{'firstName':_0x34b221[_0xd236('0x48')]['to'],'email':_0x34b221[_0xd236('0x48')]['to'],'phone':_0x34b221[_0xd236('0x48')]['to'],'ListId':_0xff819['ListId']}));}}else{throw new Error(_0xd236('0x5c'));}})[_0xd236('0x24')](function(){if(_0x4a7dbd){return respondWithRpcPromise(_0xd236('0x5d'),'sendMail',_0x4a7dbd,client9003)[_0xd236('0x24')](function(_0x4e963e){return _0x128549[_0xd236('0x22')]({'read':!![],'messageId':_0x4e963e[_0xd236('0x5e')],'sentAt':moment()[_0xd236('0x5f')]('YYYY-MM-DD\x20HH:mm:ss')});})['catch'](function(_0x53db6b){logger['error']('%s',JSON[_0xd236('0x14')](_0x53db6b));return _0x128549;});}return _0x128549;});}return _0x128549;}})[_0xd236('0x24')](respondWithResult(_0x1095ce,0xc9))[_0xd236('0x1a')](handleError(_0x1095ce,null));};exports[_0xd236('0x60')]=function(_0x140b74,_0x4e5b5a){var _0x50cba0={'agent':{},'channel':_0xd236('0x61')};if(_0x140b74[_0xd236('0x48')]['id']){delete _0x140b74[_0xd236('0x48')]['id'];}_0x140b74[_0xd236('0x48')]['read']=!![];_0x140b74[_0xd236('0x48')][_0xd236('0x62')]=moment()[_0xd236('0x5f')](_0xd236('0x63'));_0x140b74[_0xd236('0x48')][_0xd236('0x64')]=_0x140b74[_0xd236('0x48')][_0xd236('0x64')]||_0x140b74[_0xd236('0x65')]['id'];_0x50cba0[_0xd236('0x66')]['id']=_0x140b74[_0xd236('0x48')][_0xd236('0x64')];return db[_0xd236('0x2b')][_0xd236('0x47')]({'where':{'id':_0x140b74['params']['id'],'UserId':null}})[_0xd236('0x24')](handleEntityNotFound(_0x4e5b5a,null))[_0xd236('0x24')](saveUpdates(_0x140b74[_0xd236('0x48')],null))[_0xd236('0x24')](function(_0x239d01){if(_0x239d01){_0x50cba0[_0xd236('0x17')]=_0x239d01['get']({'plain':!![]});return db[_0xd236('0x67')][_0xd236('0x47')]({'where':{'id':_0x239d01[_0xd236('0x68')]}});}return null;})[_0xd236('0x24')](handleEntityNotFound(_0x4e5b5a,null))[_0xd236('0x24')](function(_0x4bf74f){if(_0x4bf74f){return _0x4bf74f['update']({'UserId':_0x140b74['body'][_0xd236('0x64')],'read1stAt':_[_0xd236('0x69')](_0x4bf74f[_0xd236('0x6a')])?moment()['format'](_0xd236('0x63')):undefined});}return null;})[_0xd236('0x24')](function(_0x16a559){if(_0x16a559){_0x50cba0[_0xd236('0x6b')]=_0x16a559[_0xd236('0x6c')]({'plain':!![]});interaction_log[_0xd236('0x18')](_0xd236('0x6d'),_0x140b74['user']['id'],_0x140b74[_0xd236('0x65')][_0xd236('0x30')],_0x140b74[_0xd236('0x65')]['role'],_0x50cba0[_0xd236('0x6b')]['id'],_0x140b74[_0xd236('0x48')]?JSON[_0xd236('0x14')](_0x140b74[_0xd236('0x48')]):_0xd236('0x6e'));return respondWithRpcPromise(_0xd236('0x6f'),_0xd236('0x70'),_0x50cba0);}return null;})[_0xd236('0x24')](function(_0x420ce5){var _0x27f744=_0xd236('0x71')+_0x420ce5[_0xd236('0x17')][_0xd236('0x72')];return db[_0xd236('0x73')][_0xd236('0x32')](_0x27f744,{'type':db[_0xd236('0x74')][_0xd236('0x75')][_0xd236('0x76')],'raw':!![]})[_0xd236('0x24')](function(_0x315f54){return _0x315f54;});})[_0xd236('0x24')](function(_0xe47213){if(_0xe47213){_0x50cba0[_0xd236('0x17')]['contact']=_0xe47213[0x0];if(!_0x140b74[_0xd236('0x48')][_0xd236('0x64')])return;return db[_0xd236('0x77')][_0xd236('0x47')]({'where':{'id':_0x140b74[_0xd236('0x48')]['UserId'],'role':_0xd236('0x66')},'attributes':['id','name',_0xd236('0x78'),'email',_0xd236('0x79')],'raw':!![]});}return null;})['then'](function(_0x37b975){if(!_0x37b975)return null;_0x50cba0[_0xd236('0x17')]['agent']=_0x37b975;return _0x50cba0;})[_0xd236('0x24')](function(_0x3e9005){if(_0x3e9005){if(_0x140b74[_0xd236('0x48')]['manual']){_0x50cba0[_0xd236('0x17')][_0xd236('0x7a')]=util[_0xd236('0x5f')](_0xd236('0x7b'),_0x140b74[_0xd236('0x65')][_0xd236('0x30')]);_0x50cba0[_0xd236('0x17')]['channel']=_0x50cba0[_0xd236('0x7c')];_0x50cba0['message'][_0xd236('0x7d')]=_0x50cba0[_0xd236('0x7c')];_0x50cba0[_0xd236('0x17')][_0xd236('0x7e')]='accept';_0x50cba0['message']['body']=htmlToText[_0xd236('0x7f')](_0x50cba0[_0xd236('0x17')][_0xd236('0x48')]);return respondWithRpcPromise('EventManager',_0xd236('0x80'),{'event':'acceptmessage','message':_0x50cba0[_0xd236('0x17')]},client9002)['then'](function(){return _0x50cba0;});}return _0x50cba0;}return null;})[_0xd236('0x24')](respondWithResult(_0x4e5b5a,null))[_0xd236('0x1a')](handleError(_0x4e5b5a,null));};exports[_0xd236('0x81')]=function(_0x162580,_0x54111d){var _0x42f2e3={'agent':{},'channel':_0xd236('0x61')};if(_0x162580['body']['id']){delete _0x162580[_0xd236('0x48')]['id'];}_0x162580[_0xd236('0x48')]['UserId']=_0x162580[_0xd236('0x48')][_0xd236('0x64')]||_0x162580[_0xd236('0x65')]['id'];_0x42f2e3[_0xd236('0x66')]['id']=_0x162580['body'][_0xd236('0x64')];return db[_0xd236('0x2b')]['find']({'where':{'id':_0x162580['params']['id'],'UserId':null}})[_0xd236('0x24')](handleEntityNotFound(_0x54111d,null))[_0xd236('0x24')](function(_0x24bdb7){if(_0x24bdb7){_0x42f2e3[_0xd236('0x17')]=_0x24bdb7[_0xd236('0x6c')]({'plain':!![]});return db[_0xd236('0x67')][_0xd236('0x47')]({'where':{'id':_0x24bdb7[_0xd236('0x68')]}});}return null;})[_0xd236('0x24')](handleEntityNotFound(_0x54111d,null))[_0xd236('0x24')](function(_0x1c2e17){if(_0x1c2e17){_0x42f2e3['interaction']=_0x1c2e17[_0xd236('0x6c')]({'plain':!![]});interaction_log[_0xd236('0x18')](_0xd236('0x82'),_0x162580['user']['id'],_0x162580[_0xd236('0x65')][_0xd236('0x30')],_0x162580[_0xd236('0x65')][_0xd236('0x83')],_0x42f2e3[_0xd236('0x6b')]['id'],_0x162580[_0xd236('0x48')]?JSON[_0xd236('0x14')](_0x162580[_0xd236('0x48')]):_0xd236('0x6e'));return respondWithRpcPromise(_0xd236('0x84'),_0xd236('0x85'),_0x42f2e3);}return null;})[_0xd236('0x24')](function(_0x44fafe){var _0x5eea1c=_0xd236('0x71')+_0x44fafe[_0xd236('0x17')][_0xd236('0x72')];return db[_0xd236('0x73')][_0xd236('0x32')](_0x5eea1c,{'type':db[_0xd236('0x74')][_0xd236('0x75')]['SELECT'],'raw':!![]})[_0xd236('0x24')](function(_0x17e8cf){return _0x17e8cf;});})['then'](function(_0x1eb049){if(_0x1eb049){_0x42f2e3[_0xd236('0x17')][_0xd236('0x86')]=_0x1eb049[0x0];if(!_0x162580[_0xd236('0x48')][_0xd236('0x64')])return;return db[_0xd236('0x77')][_0xd236('0x47')]({'where':{'id':_0x162580['body'][_0xd236('0x64')],'role':'agent'},'attributes':['id',_0xd236('0x30'),'fullname','email',_0xd236('0x79')],'raw':!![]});}return null;})['then'](function(_0x298a0f){if(!_0x298a0f)return null;_0x42f2e3[_0xd236('0x17')][_0xd236('0x66')]=_0x298a0f;return _0x42f2e3;})['then'](function(_0x32aa6e){if(_0x32aa6e){_0x32aa6e[_0xd236('0x17')][_0xd236('0x7a')]=util[_0xd236('0x5f')]('SIP/%s',_0x162580[_0xd236('0x65')][_0xd236('0x30')]);_0x32aa6e[_0xd236('0x17')][_0xd236('0x7c')]=_0x42f2e3[_0xd236('0x7c')];_0x32aa6e[_0xd236('0x17')]['motionChannel']=_0x42f2e3[_0xd236('0x7c')];_0x32aa6e[_0xd236('0x17')]['event']=_0xd236('0x81');_0x32aa6e[_0xd236('0x17')][_0xd236('0x48')]=htmlToText[_0xd236('0x7f')](_0x42f2e3[_0xd236('0x17')][_0xd236('0x48')]);respondWithRpcPromise(_0xd236('0x80'),'EventManager',{'event':'rejectmessage','message':_0x32aa6e['message']},client9002);return _0x42f2e3;}return null;})[_0xd236('0x24')](respondWithResult(_0x54111d,null))[_0xd236('0x1a')](handleError(_0x54111d,null));};exports[_0xd236('0x87')]=function(_0x4da52b,_0x176a6a){var _0x5a5cf2=moment()['unix']()['toString']();var _0x13034a=path[_0xd236('0x59')](config[_0xd236('0x5a')],'server',_0xd236('0x88'),_0xd236('0x89'));var _0x436950=path['join'](config['root'],_0xd236('0x8a'),_0xd236('0x88'),_0xd236('0x58'));var _0x29db76=util[_0xd236('0x5f')]('message-%s.eml',_0x5a5cf2);return db['MailMessage']['find']({'where':{'id':_0x4da52b[_0xd236('0x46')]['id']},'attributes':['id',_0xd236('0x48'),_0xd236('0x8b'),'to','cc',_0xd236('0x8c'),_0xd236('0x8d'),_0xd236('0x8e')],'include':_0x4da52b[_0xd236('0x32')]['attachments']?[{'model':db[_0xd236('0x8f')],'as':_0xd236('0x90')}]:undefined})[_0xd236('0x24')](handleEntityNotFound(_0x176a6a,null))['then'](function(_0x39b91e){if(_0x39b91e){var _0x5e7a17=_0x39b91e;var _0x183a1c={'from':_0x5e7a17[_0xd236('0x8b')],'to':_0x5e7a17['to'],'subject':_0x5e7a17['subject'],'html':htmlEntities[_0xd236('0x91')](_0x5e7a17[_0xd236('0x48')]),'headers':{'Date':moment(_0x5e7a17[_0xd236('0x8e')])[_0xd236('0x5f')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x39b91e['cc']){_0x183a1c[_0xd236('0x92')]['Cc']=_0x39b91e['cc'];}if(_0x39b91e[_0xd236('0x8c')]){_0x183a1c[_0xd236('0x92')]['Bcc']=_0x39b91e[_0xd236('0x8c')];}return new BPromise(function(_0x222e8a,_0x7eca86){if(_0x39b91e[_0xd236('0x90')]){for(var _0x238052=0x0;_0x238052<_0x39b91e['Attachments'][_0xd236('0x38')];_0x238052++){var _0xb7eb0c=_0x39b91e[_0xd236('0x90')][_0x238052];var _0x5246a3=path[_0xd236('0x59')](_0x436950,_0xb7eb0c[_0xd236('0x5b')]);if(fs[_0xd236('0x93')](_0x5246a3)){_0x183a1c[_0xd236('0x58')]['push']({'name':_0xb7eb0c['name'],'contentType':_0xb7eb0c[_0xd236('0x2e')],'data':fs[_0xd236('0x94')](_0x5246a3)});}}}emlformat[_0xd236('0x95')](_0x183a1c,function(_0x2d031e,_0x2948ba){if(_0x2d031e)return _0x7eca86(_0x2d031e);fs['writeFileSync'](path[_0xd236('0x59')](_0x13034a,_0x29db76),_0x2948ba);return _0x222e8a(_0x2948ba);});});}})[_0xd236('0x24')](function(_0x496afa){if(_0x496afa){return _0x176a6a[_0xd236('0x87')](path[_0xd236('0x59')](_0x13034a,_0x29db76),_0x29db76,function(_0x591e95){if(!_0x591e95)fs['unlinkSync'](path['join'](_0x13034a,_0x29db76));});}})['catch'](handleError(_0x176a6a,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 9eb83a9..ed40471 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 _0xae47=['MailMessage','setMaxListeners','save','update','emit','hook','exports','events'];(function(_0x55f5db,_0x214f4a){var _0x13afe1=function(_0x30265f){while(--_0x30265f){_0x55f5db['push'](_0x55f5db['shift']());}};_0x13afe1(++_0x214f4a);}(_0xae47,0x1c7));var _0x7ae4=function(_0x55f512,_0x3dbc56){_0x55f512=_0x55f512-0x0;var _0x5d8422=_0xae47[_0x55f512];return _0x5d8422;};'use strict';var EventEmitter=require(_0x7ae4('0x0'));var MailMessage=require('../../mysqldb')['db'][_0x7ae4('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x7ae4('0x2')](0x0);var events={'afterCreate':_0x7ae4('0x3'),'afterUpdate':_0x7ae4('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4bc114){return function(_0x659679,_0x2f60e2,_0x2124e0){MailMessageEvents[_0x7ae4('0x5')](_0x4bc114+':'+_0x659679['id'],_0x659679);MailMessageEvents[_0x7ae4('0x5')](_0x4bc114,_0x659679);_0x2124e0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage[_0x7ae4('0x6')](e,emitEvent(event));}}module[_0x7ae4('0x7')]=MailMessageEvents; \ No newline at end of file +var _0xdc65=['hook','exports','events','../../mysqldb','MailMessage','setMaxListeners','save','update','remove','emit'];(function(_0x578122,_0x2141bc){var _0x295008=function(_0x5a54a0){while(--_0x5a54a0){_0x578122['push'](_0x578122['shift']());}};_0x295008(++_0x2141bc);}(_0xdc65,0x66));var _0x5dc6=function(_0x1d0011,_0x21742f){_0x1d0011=_0x1d0011-0x0;var _0x465c9c=_0xdc65[_0x1d0011];return _0x465c9c;};'use strict';var EventEmitter=require(_0x5dc6('0x0'));var MailMessage=require(_0x5dc6('0x1'))['db'][_0x5dc6('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x5dc6('0x3')](0x0);var events={'afterCreate':_0x5dc6('0x4'),'afterUpdate':_0x5dc6('0x5'),'afterDestroy':_0x5dc6('0x6')};function emitEvent(_0x2860c7){return function(_0x1ce536,_0x88e85c,_0xd01f10){MailMessageEvents[_0x5dc6('0x7')](_0x2860c7+':'+_0x1ce536['id'],_0x1ce536);MailMessageEvents['emit'](_0x2860c7,_0x1ce536);_0xd01f10(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage[_0x5dc6('0x8')](e,emitEvent(event));}}module[_0x5dc6('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 ee5567d..2ec499b 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 _0xac1b=['messageId','fti_mail_messages','plainBody','subject','body','fromString','models','get','toLowerCase','direction','out','isNil','UserId','MailInteraction','findOne','MailInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./mailMessage.attributes','exports','define'];(function(_0x187f53,_0x3a421b){var _0x5abf0d=function(_0x2d37f4){while(--_0x2d37f4){_0x187f53['push'](_0x187f53['shift']());}};_0x5abf0d(++_0x3a421b);}(_0xac1b,0x175));var _0xbac1=function(_0x49124e,_0x73a5e6){_0x49124e=_0x49124e-0x0;var _0x56552f=_0xac1b[_0x49124e];return _0x56552f;};'use strict';var _=require(_0xbac1('0x0'));var util=require(_0xbac1('0x1'));var logger=require(_0xbac1('0x2'))(_0xbac1('0x3'));var moment=require(_0xbac1('0x4'));var BPromise=require(_0xbac1('0x5'));var rp=require(_0xbac1('0x6'));var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0xbac1('0x7'));var rimraf=require('rimraf');var config=require(_0xbac1('0x8'));var attributes=require(_0xbac1('0x9'));module[_0xbac1('0xa')]=function(_0x112d94,_0x9b50b5){return _0x112d94[_0xbac1('0xb')]('MailMessage',attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0xbac1('0xc'),'fields':[_0xbac1('0xc')]},{'name':_0xbac1('0xd'),'fields':[_0xbac1('0xe'),_0xbac1('0xf')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5ab430,_0x81e27d,_0x2dbf5e){if(_0x5ab430[_0xbac1('0x10')]){_0x5ab430[_0xbac1('0xe')]=htmlToText[_0xbac1('0x11')](_0x5ab430['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x2dbf5e(null,_0x81e27d);},'afterCreate':function(_0x96d8a8,_0x413874,_0x523900){var _0x2bdb51=_0x112d94[_0xbac1('0x12')];var _0x180bbc=_0x96d8a8[_0xbac1('0x13')]({'plain':!![]});if(_0x180bbc['direction'][_0xbac1('0x14')]()==='in'||_0x180bbc[_0xbac1('0x15')][_0xbac1('0x14')]()===_0xbac1('0x16')&&!_0x180bbc['secret']&&!_[_0xbac1('0x17')](_0x180bbc[_0xbac1('0x18')])){_0x2bdb51[_0xbac1('0x19')][_0xbac1('0x1a')]({'where':{'id':_0x180bbc[_0xbac1('0x1b')]}})[_0xbac1('0x1c')](function(_0xb115e4){if(_0xb115e4){_0xb115e4[_0xbac1('0x1d')]({'lastMsgAt':_0x180bbc[_0xbac1('0x1e')],'lastMsgDirection':_0x180bbc[_0xbac1('0x15')]['toLowerCase']()});}})[_0xbac1('0x1f')](function(_0x2b8b2a){console[_0xbac1('0x20')](_0x2b8b2a);});}_0x523900();}},'charset':_0xbac1('0x21'),'collate':_0xbac1('0x22')});}; \ No newline at end of file +var _0xead1=['then','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','html-to-text','path','rimraf','../../config/environment','exports','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','fromString','body','models','get','toLowerCase','direction','out','isNil','MailInteraction','findOne','MailInteractionId'];(function(_0x1e1312,_0x33fffa){var _0x1d505c=function(_0x53207f){while(--_0x53207f){_0x1e1312['push'](_0x1e1312['shift']());}};_0x1d505c(++_0x33fffa);}(_0xead1,0x1da));var _0x1ead=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0xead1[_0x2b5eae];return _0x5f3ac9;};'use strict';var _=require(_0x1ead('0x0'));var util=require(_0x1ead('0x1'));var logger=require(_0x1ead('0x2'))(_0x1ead('0x3'));var moment=require(_0x1ead('0x4'));var BPromise=require(_0x1ead('0x5'));var rp=require(_0x1ead('0x6'));var htmlToText=require(_0x1ead('0x7'));var fs=require('fs');var path=require(_0x1ead('0x8'));var rimraf=require(_0x1ead('0x9'));var config=require(_0x1ead('0xa'));var attributes=require('./mailMessage.attributes');module[_0x1ead('0xb')]=function(_0x487e90,_0xd5460e){return _0x487e90['define'](_0x1ead('0xc'),attributes,{'tableName':_0x1ead('0xd'),'paranoid':![],'indexes':[{'name':_0x1ead('0xe'),'fields':[_0x1ead('0xe')]},{'name':_0x1ead('0xf'),'fields':[_0x1ead('0x10'),_0x1ead('0x11')],'type':_0x1ead('0x12')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5046ef,_0x1759a5,_0x129374){if(_0x5046ef['body']){_0x5046ef[_0x1ead('0x10')]=htmlToText[_0x1ead('0x13')](_0x5046ef[_0x1ead('0x14')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x129374(null,_0x1759a5);},'afterCreate':function(_0x40198e,_0x4aba3c,_0x36a41c){var _0x4dfab3=_0x487e90[_0x1ead('0x15')];var _0x3533b0=_0x40198e[_0x1ead('0x16')]({'plain':!![]});if(_0x3533b0['direction'][_0x1ead('0x17')]()==='in'||_0x3533b0[_0x1ead('0x18')][_0x1ead('0x17')]()===_0x1ead('0x19')&&!_0x3533b0['secret']&&!_[_0x1ead('0x1a')](_0x3533b0['UserId'])){_0x4dfab3[_0x1ead('0x1b')][_0x1ead('0x1c')]({'where':{'id':_0x3533b0[_0x1ead('0x1d')]}})[_0x1ead('0x1e')](function(_0xc9b127){if(_0xc9b127){_0xc9b127['update']({'lastMsgAt':_0x3533b0[_0x1ead('0x1f')],'lastMsgDirection':_0x3533b0[_0x1ead('0x18')][_0x1ead('0x17')]()});}})[_0x1ead('0x20')](function(_0x445b96){console[_0x1ead('0x21')](_0x445b96);});}_0x36a41c();}},'charset':_0x1ead('0x22'),'collate':_0x1ead('0x23')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 3a789c0..213047f 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 _0x1c9a=['raw','CreateMailMessage','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','MailMessage','create','options'];(function(_0x42b886,_0x3985db){var _0x38d050=function(_0x319252){while(--_0x319252){_0x42b886['push'](_0x42b886['shift']());}};_0x38d050(++_0x3985db);}(_0x1c9a,0x98));var _0xa1c9=function(_0x5cb3d6,_0x322575){_0x5cb3d6=_0x5cb3d6-0x0;var _0x5ee422=_0x1c9a[_0x5cb3d6];return _0x5ee422;};'use strict';var _=require(_0xa1c9('0x0'));var util=require('util');var moment=require(_0xa1c9('0x1'));var BPromise=require('bluebird');var rs=require(_0xa1c9('0x2'));var fs=require('fs');var Redis=require(_0xa1c9('0x3'));var db=require(_0xa1c9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa1c9('0x5'))(_0xa1c9('0x6'));var config=require(_0xa1c9('0x7'));var jayson=require(_0xa1c9('0x8'));var client=jayson['client'][_0xa1c9('0x9')]({'port':0x232a});config['redis']=_[_0xa1c9('0xa')](config[_0xa1c9('0xb')],{'host':_0xa1c9('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa1c9('0xb')]));require(_0xa1c9('0xd'))[_0xa1c9('0xe')](socket);function respondWithRpcPromise(_0x1efbab,_0x493cf6,_0x27b020){return new BPromise(function(_0x4437f2,_0x29e24a){return client[_0xa1c9('0xf')](_0x1efbab,_0x27b020)[_0xa1c9('0x10')](function(_0xbb76ef){logger[_0xa1c9('0x11')](_0xa1c9('0x12'),_0x493cf6,_0xa1c9('0x13'));logger[_0xa1c9('0x14')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x493cf6,_0xa1c9('0x13'),JSON[_0xa1c9('0x15')](_0xbb76ef));if(_0xbb76ef[_0xa1c9('0x16')]){if(_0xbb76ef[_0xa1c9('0x16')][_0xa1c9('0x17')]===0x1f4){logger['error'](_0xa1c9('0x12'),_0x493cf6,_0xbb76ef[_0xa1c9('0x16')][_0xa1c9('0x18')]);return _0x29e24a(_0xbb76ef[_0xa1c9('0x16')][_0xa1c9('0x18')]);}logger[_0xa1c9('0x16')](_0xa1c9('0x12'),_0x493cf6,_0xbb76ef[_0xa1c9('0x16')][_0xa1c9('0x18')]);return _0x4437f2(_0xbb76ef[_0xa1c9('0x16')]['message']);}else{logger[_0xa1c9('0x11')](_0xa1c9('0x12'),_0x493cf6,_0xa1c9('0x13'));_0x4437f2(_0xbb76ef['result'][_0xa1c9('0x18')]);}})['catch'](function(_0x21cd35){logger[_0xa1c9('0x16')](_0xa1c9('0x12'),_0x493cf6,_0x21cd35);_0x29e24a(_0x21cd35);});});}exports['CreateMailMessage']=function(_0x3a1110){var _0x46b1e4=this;return new Promise(function(_0x128732,_0x4edf37){return db[_0xa1c9('0x19')][_0xa1c9('0x1a')](_0x3a1110['body'],{'raw':_0x3a1110[_0xa1c9('0x1b')]?_0x3a1110[_0xa1c9('0x1b')][_0xa1c9('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x29f1b1){logger[_0xa1c9('0x11')](_0xa1c9('0x1d'),_0x3a1110);logger[_0xa1c9('0x14')](_0xa1c9('0x1d'),_0x3a1110,JSON['stringify'](_0x29f1b1));_0x128732(_0x29f1b1);})['catch'](function(_0x200749){logger['error'](_0xa1c9('0x1d'),_0x200749[_0xa1c9('0x18')],_0x3a1110);_0x4edf37(_0x46b1e4[_0xa1c9('0x16')](0x1f4,_0x200749[_0xa1c9('0x18')]));});});}; \ No newline at end of file +var _0xd4f4=['CreateMailMessage','create','body','options','raw','debug','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x12ed0b,_0x3d38a5){var _0x31392e=function(_0x317b09){while(--_0x317b09){_0x12ed0b['push'](_0x12ed0b['shift']());}};_0x31392e(++_0x3d38a5);}(_0xd4f4,0x8b));var _0x4d4f=function(_0x229f3e,_0x1a79c7){_0x229f3e=_0x229f3e-0x0;var _0xdccf09=_0xd4f4[_0x229f3e];return _0xdccf09;};'use strict';var _=require(_0x4d4f('0x0'));var util=require(_0x4d4f('0x1'));var moment=require(_0x4d4f('0x2'));var BPromise=require(_0x4d4f('0x3'));var rs=require(_0x4d4f('0x4'));var fs=require('fs');var Redis=require(_0x4d4f('0x5'));var db=require(_0x4d4f('0x6'))['db'];var utils=require(_0x4d4f('0x7'));var logger=require(_0x4d4f('0x8'))(_0x4d4f('0x9'));var config=require(_0x4d4f('0xa'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x4d4f('0xb')]=_[_0x4d4f('0xc')](config[_0x4d4f('0xb')],{'host':_0x4d4f('0xd'),'port':0x18eb});var socket=require(_0x4d4f('0xe'))(new Redis(config[_0x4d4f('0xb')]));require(_0x4d4f('0xf'))[_0x4d4f('0x10')](socket);function respondWithRpcPromise(_0x385597,_0xba5200,_0x20db50){return new BPromise(function(_0x88b592,_0x128d39){return client[_0x4d4f('0x11')](_0x385597,_0x20db50)[_0x4d4f('0x12')](function(_0x28fb3e){logger[_0x4d4f('0x13')](_0x4d4f('0x14'),_0xba5200,'request\x20sent');logger['debug']('MailMessage,\x20%s,\x20%s,\x20%s',_0xba5200,_0x4d4f('0x15'),JSON[_0x4d4f('0x16')](_0x28fb3e));if(_0x28fb3e['error']){if(_0x28fb3e[_0x4d4f('0x17')][_0x4d4f('0x18')]===0x1f4){logger[_0x4d4f('0x17')]('MailMessage,\x20%s,\x20%s',_0xba5200,_0x28fb3e[_0x4d4f('0x17')][_0x4d4f('0x19')]);return _0x128d39(_0x28fb3e[_0x4d4f('0x17')]['message']);}logger[_0x4d4f('0x17')]('MailMessage,\x20%s,\x20%s',_0xba5200,_0x28fb3e[_0x4d4f('0x17')][_0x4d4f('0x19')]);return _0x88b592(_0x28fb3e[_0x4d4f('0x17')]['message']);}else{logger[_0x4d4f('0x13')](_0x4d4f('0x14'),_0xba5200,'request\x20sent');_0x88b592(_0x28fb3e['result']['message']);}})['catch'](function(_0x5eebec){logger[_0x4d4f('0x17')](_0x4d4f('0x14'),_0xba5200,_0x5eebec);_0x128d39(_0x5eebec);});});}exports[_0x4d4f('0x1a')]=function(_0x3566a5){var _0x5d7b1f=this;return new Promise(function(_0x5b2863,_0x1e1ae2){return db['MailMessage'][_0x4d4f('0x1b')](_0x3566a5[_0x4d4f('0x1c')],{'raw':_0x3566a5[_0x4d4f('0x1d')]?_0x3566a5[_0x4d4f('0x1d')][_0x4d4f('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x570520){logger[_0x4d4f('0x13')]('CreateMailMessage',_0x3566a5);logger[_0x4d4f('0x1f')](_0x4d4f('0x1a'),_0x3566a5,JSON[_0x4d4f('0x16')](_0x570520));_0x5b2863(_0x570520);})[_0x4d4f('0x20')](function(_0xf3f7a4){logger['error'](_0x4d4f('0x1a'),_0xf3f7a4[_0x4d4f('0x19')],_0x3566a5);_0x1e1ae2(_0x5d7b1f[_0x4d4f('0x17')](0x1f4,_0xf3f7a4[_0x4d4f('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index c2b084a..8ace1e6 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 _0x9e68=['register','length','mailMessage:','update','removeListener'];(function(_0x1abeb2,_0x79f462){var _0x48da20=function(_0x42a90b){while(--_0x42a90b){_0x1abeb2['push'](_0x1abeb2['shift']());}};_0x48da20(++_0x79f462);}(_0x9e68,0x16b));var _0x89e6=function(_0x68bf3a,_0x32d237){_0x68bf3a=_0x68bf3a-0x0;var _0x3ea3d4=_0x9e68[_0x68bf3a];return _0x3ea3d4;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=['save','remove',_0x89e6('0x0')];function createListener(_0x35c405,_0x42d382){return function(_0x421bae){_0x42d382['emit'](_0x35c405,_0x421bae);};}function removeListener(_0x3f3359,_0x4dafaa){return function(){MailMessageEvents[_0x89e6('0x1')](_0x3f3359,_0x4dafaa);};}exports[_0x89e6('0x2')]=function(_0x45598){for(var _0x43806e=0x0,_0x3785f6=events[_0x89e6('0x3')];_0x43806e<_0x3785f6;_0x43806e++){var _0x36b2f4=events[_0x43806e];var _0x516150=createListener(_0x89e6('0x4')+_0x36b2f4,_0x45598);MailMessageEvents['on'](_0x36b2f4,_0x516150);}}; \ No newline at end of file +var _0x8c77=['update','emit','removeListener','register','length','mailMessage:','./mailMessage.events','save'];(function(_0x30283c,_0x1bd431){var _0x2ffd25=function(_0x1e41d1){while(--_0x1e41d1){_0x30283c['push'](_0x30283c['shift']());}};_0x2ffd25(++_0x1bd431);}(_0x8c77,0x1d6));var _0x78c7=function(_0x303a32,_0x1e787b){_0x303a32=_0x303a32-0x0;var _0xfe11f8=_0x8c77[_0x303a32];return _0xfe11f8;};'use strict';var MailMessageEvents=require(_0x78c7('0x0'));var events=[_0x78c7('0x1'),'remove',_0x78c7('0x2')];function createListener(_0x28e99c,_0xff06b4){return function(_0x4296dc){_0xff06b4[_0x78c7('0x3')](_0x28e99c,_0x4296dc);};}function removeListener(_0x1bea4b,_0x17118b){return function(){MailMessageEvents[_0x78c7('0x4')](_0x1bea4b,_0x17118b);};}exports[_0x78c7('0x5')]=function(_0x575548){for(var _0x42ff20=0x0,_0x5dad3d=events[_0x78c7('0x6')];_0x42ff20<_0x5dad3d;_0x42ff20++){var _0x27d168=events[_0x42ff20];var _0xa56bc0=createListener(_0x78c7('0x7')+_0x27d168,_0x575548);MailMessageEvents['on'](_0x27d168,_0xa56bc0);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index d764acf..8b03930 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 _0xd67e=['destroy','delete','removeAgents','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','/describe','/:id','show','getMembers','/:id/teams','getTeams','/:id/users','getAgents','create','post','put','update'];(function(_0x29af35,_0x15e6c6){var _0x211295=function(_0x4ef82){while(--_0x4ef82){_0x29af35['push'](_0x29af35['shift']());}};_0x211295(++_0x15e6c6);}(_0xd67e,0x1b4));var _0xed67=function(_0x1a6cb6,_0x58d767){_0x1a6cb6=_0x1a6cb6-0x0;var _0x281042=_0xd67e[_0x1a6cb6];return _0x281042;};'use strict';var multer=require(_0xed67('0x0'));var util=require(_0xed67('0x1'));var path=require(_0xed67('0x2'));var timeout=require(_0xed67('0x3'));var express=require(_0xed67('0x4'));var router=express['Router']();var fs_extra=require(_0xed67('0x5'));var auth=require(_0xed67('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xed67('0x7'));var controller=require(_0xed67('0x8'));router[_0xed67('0x9')]('/',auth[_0xed67('0xa')](),controller['index']);router[_0xed67('0x9')](_0xed67('0xb'),auth[_0xed67('0xa')](),controller['describe']);router[_0xed67('0x9')](_0xed67('0xc'),auth[_0xed67('0xa')](),controller[_0xed67('0xd')]);router[_0xed67('0x9')]('/:id/members',auth[_0xed67('0xa')](),controller[_0xed67('0xe')]);router[_0xed67('0x9')](_0xed67('0xf'),auth[_0xed67('0xa')](),controller[_0xed67('0x10')]);router['get'](_0xed67('0x11'),auth[_0xed67('0xa')](),controller[_0xed67('0x12')]);router['post']('/',auth[_0xed67('0xa')](),controller[_0xed67('0x13')]);router[_0xed67('0x14')](_0xed67('0xf'),auth[_0xed67('0xa')](),controller['addTeams']);router[_0xed67('0x14')](_0xed67('0x11'),auth['isAuthenticated'](),controller['addAgents']);router[_0xed67('0x15')](_0xed67('0xc'),auth['isAuthenticated'](),controller[_0xed67('0x16')]);router['delete'](_0xed67('0xc'),auth[_0xed67('0xa')](),controller[_0xed67('0x17')]);router[_0xed67('0x18')]('/:id/teams',auth[_0xed67('0xa')](),controller['removeTeams']);router['delete'](_0xed67('0x11'),auth[_0xed67('0xa')](),controller[_0xed67('0x19')]);module[_0xed67('0x1a')]=router; \ No newline at end of file +var _0xfa56=['../../config/environment','./mailQueue.controller','isAuthenticated','index','get','describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','post','create','addAgents','put','update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xfa56,0xfe));var _0x6fa5=function(_0x201bff,_0x60dec7){_0x201bff=_0x201bff-0x0;var _0x5c8abc=_0xfa56[_0x201bff];return _0x5c8abc;};'use strict';var multer=require(_0x6fa5('0x0'));var util=require(_0x6fa5('0x1'));var path=require('path');var timeout=require(_0x6fa5('0x2'));var express=require(_0x6fa5('0x3'));var router=express['Router']();var fs_extra=require(_0x6fa5('0x4'));var auth=require(_0x6fa5('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6fa5('0x6'));var controller=require(_0x6fa5('0x7'));router['get']('/',auth[_0x6fa5('0x8')](),controller[_0x6fa5('0x9')]);router[_0x6fa5('0xa')]('/describe',auth[_0x6fa5('0x8')](),controller[_0x6fa5('0xb')]);router[_0x6fa5('0xa')](_0x6fa5('0xc'),auth['isAuthenticated'](),controller[_0x6fa5('0xd')]);router['get'](_0x6fa5('0xe'),auth[_0x6fa5('0x8')](),controller['getMembers']);router[_0x6fa5('0xa')](_0x6fa5('0xf'),auth[_0x6fa5('0x8')](),controller[_0x6fa5('0x10')]);router['get'](_0x6fa5('0x11'),auth[_0x6fa5('0x8')](),controller['getAgents']);router[_0x6fa5('0x12')]('/',auth[_0x6fa5('0x8')](),controller[_0x6fa5('0x13')]);router[_0x6fa5('0x12')](_0x6fa5('0xf'),auth[_0x6fa5('0x8')](),controller['addTeams']);router[_0x6fa5('0x12')](_0x6fa5('0x11'),auth[_0x6fa5('0x8')](),controller[_0x6fa5('0x14')]);router[_0x6fa5('0x15')](_0x6fa5('0xc'),auth[_0x6fa5('0x8')](),controller[_0x6fa5('0x16')]);router[_0x6fa5('0x17')](_0x6fa5('0xc'),auth[_0x6fa5('0x8')](),controller[_0x6fa5('0x18')]);router['delete'](_0x6fa5('0xf'),auth['isAuthenticated'](),controller['removeTeams']);router[_0x6fa5('0x17')]('/:id/users',auth[_0x6fa5('0x8')](),controller['removeAgents']);module[_0x6fa5('0x19')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index cae5fc8..a3d5f4e 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 _0xf6c2=['INTEGER','ENUM','rrmemory','roundrobin','sequelize','STRING','name'];(function(_0x5af38c,_0x392000){var _0x319b18=function(_0xc22e54){while(--_0xc22e54){_0x5af38c['push'](_0x5af38c['shift']());}};_0x319b18(++_0x392000);}(_0xf6c2,0x12a));var _0x2f6c=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0xf6c2[_0xc4001c];return _0x49f7bc;};'use strict';var Sequelize=require(_0x2f6c('0x0'));module['exports']={'name':{'type':Sequelize[_0x2f6c('0x1')],'unique':_0x2f6c('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x2f6c('0x1')]},'timeout':{'type':Sequelize[_0x2f6c('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2f6c('0x4')](_0x2f6c('0x5'),'beepall',_0x2f6c('0x6'))}}; \ No newline at end of file +var _0xf4d4=['exports','STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize'];(function(_0x230daa,_0x2d4dd0){var _0x210dc5=function(_0x455859){while(--_0x455859){_0x230daa['push'](_0x230daa['shift']());}};_0x210dc5(++_0x2d4dd0);}(_0xf4d4,0xaa));var _0x4f4d=function(_0x4cb9d3,_0x4f4f4f){_0x4cb9d3=_0x4cb9d3-0x0;var _0x4c0735=_0xf4d4[_0x4cb9d3];return _0x4c0735;};'use strict';var Sequelize=require(_0x4f4d('0x0'));module[_0x4f4d('0x1')]={'name':{'type':Sequelize[_0x4f4d('0x2')],'unique':_0x4f4d('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x4f4d('0x2')]},'timeout':{'type':Sequelize[_0x4f4d('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4f4d('0x5')](_0x4f4d('0x6'),_0x4f4d('0x7'),_0x4f4d('0x8'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 06ba836..249c16f 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 _0xd54a=['send','map','MailQueue','rawAttributes','fieldName','type','key','getOptions','where','include','query','findAll','rows','show','params','model','keys','filters','intersection','fields','attributes','length','includeAll','merge','options','find','catch','create','body','user','get','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','hasOwnProperty','nolimit','order','sort','pick','filter','UserMailQueue','User','agent','mailPause','updatedAt','createdAt','%s/%s','getTeams','Team','ids','Agents','voicePause','interface','sequelize','transaction','addTeams','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','all','union','compact','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','spread','isArray','getAgents','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/environment','../../mysqldb','redis','defaults','./mailQueue.socket','register','status','end','json','offset','limit','undefined','count','Content-Range','update','then','destroy','MailQueues','sendStatus','stack','name'];(function(_0x1f2734,_0x529bad){var _0x17b385=function(_0x5eabc1){while(--_0x5eabc1){_0x1f2734['push'](_0x1f2734['shift']());}};_0x17b385(++_0x529bad);}(_0xd54a,0x1c1));var _0xad54=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0xd54a[_0x16b9ed];return _0x66b1f8;};'use strict';var BPromise=require(_0xad54('0x0'));var util=require(_0xad54('0x1'));var _=require(_0xad54('0x2'));var squel=require(_0xad54('0x3'));var Redis=require(_0xad54('0x4'));var qs=require(_0xad54('0x5'));var logger=require('../../config/logger')('api');var config=require(_0xad54('0x6'));var db=require(_0xad54('0x7'))['db'];config[_0xad54('0x8')]=_[_0xad54('0x9')](config[_0xad54('0x8')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xad54('0x8')]));require(_0xad54('0xa'))[_0xad54('0xb')](socket);function respondWithStatusCode(_0x4eb714,_0x23f1da){_0x23f1da=_0x23f1da||0xcc;return function(_0x4b3f7f){if(_0x4b3f7f){return _0x4eb714['sendStatus'](_0x23f1da);}return _0x4eb714[_0xad54('0xc')](_0x23f1da)[_0xad54('0xd')]();};}function respondWithResult(_0x220e4a,_0x38c634){_0x38c634=_0x38c634||0xc8;return function(_0x3e28d5){if(_0x3e28d5){return _0x220e4a['status'](_0x38c634)[_0xad54('0xe')](_0x3e28d5);}};}function respondWithFilteredResult(_0x312d69,_0x9fb0af){return function(_0x2f068a){if(_0x2f068a){var _0x4e621a=typeof _0x9fb0af[_0xad54('0xf')]==='undefined'&&typeof _0x9fb0af[_0xad54('0x10')]===_0xad54('0x11');var _0x5d3dc4=_0x2f068a[_0xad54('0x12')];var _0x2d4613=_0x4e621a?0x0:_0x9fb0af['offset'];var _0x1162e8=_0x4e621a?_0x2f068a[_0xad54('0x12')]:_0x9fb0af[_0xad54('0xf')]+_0x9fb0af['limit'];var _0x49f8c5;if(_0x1162e8>=_0x5d3dc4){_0x1162e8=_0x5d3dc4;_0x49f8c5=0xc8;}else{_0x49f8c5=0xce;}_0x312d69[_0xad54('0xc')](_0x49f8c5);return _0x312d69['set'](_0xad54('0x13'),_0x2d4613+'-'+_0x1162e8+'/'+_0x5d3dc4)[_0xad54('0xe')](_0x2f068a);}return null;};}function saveUpdates(_0x784afd){return function(_0x5a3066){if(_0x5a3066){return _0x5a3066[_0xad54('0x14')](_0x784afd)[_0xad54('0x15')](function(_0x4aecf5){return _0x4aecf5;});}return null;};}function removeEntity(_0x20b028){return function(_0x1336cb){if(_0x1336cb){return _0x1336cb[_0xad54('0x16')]()[_0xad54('0x15')](function(){var _0x32518a=_0x1336cb['get']({'plain':!![]});var _0x115575=_0xad54('0x17');return db['UserProfileResource'][_0xad54('0x16')]({'where':{'type':_0x115575,'resourceId':_0x32518a['id']}})[_0xad54('0x15')](function(){return _0x1336cb;});})[_0xad54('0x15')](function(){_0x20b028['status'](0xcc)[_0xad54('0xd')]();});}};}function handleEntityNotFound(_0xf5fb40){return function(_0x3d236d){if(!_0x3d236d){_0xf5fb40[_0xad54('0x18')](0x194);}return _0x3d236d;};}function handleError(_0x3bd230,_0x1f80b3){_0x1f80b3=_0x1f80b3||0x1f4;return function(_0xe5e388){logger['error'](_0xe5e388[_0xad54('0x19')]);if(_0xe5e388[_0xad54('0x1a')]){delete _0xe5e388[_0xad54('0x1a')];}_0x3bd230[_0xad54('0xc')](_0x1f80b3)[_0xad54('0x1b')](_0xe5e388);};}exports['index']=function(_0x2a95a1,_0x5cf457){var _0x469d9c={};var _0x3975b9={'count':0x0,'rows':[]};var _0x4f726e=_[_0xad54('0x1c')](db[_0xad54('0x1d')][_0xad54('0x1e')],function(_0x254256){return{'name':_0x254256[_0xad54('0x1f')],'type':_0x254256[_0xad54('0x20')][_0xad54('0x21')]};});_0x469d9c=qs[_0xad54('0x22')](_0x4f726e,_0x2a95a1);var _0x2f6744={'where':_0x469d9c[_0xad54('0x23')]};return db[_0xad54('0x1d')][_0xad54('0x12')](_0x2f6744)[_0xad54('0x15')](function(_0x3b4364){_0x3975b9[_0xad54('0x12')]=_0x3b4364;_0x469d9c[_0xad54('0x24')]=qs[_0xad54('0x24')](_0x2a95a1[_0xad54('0x25')]);return db[_0xad54('0x1d')][_0xad54('0x26')](_0x469d9c);})[_0xad54('0x15')](function(_0x590dfc){_0x3975b9[_0xad54('0x27')]=_0x590dfc;return _0x3975b9;})[_0xad54('0x15')](respondWithFilteredResult(_0x5cf457,_0x469d9c))['catch'](handleError(_0x5cf457,null));};exports[_0xad54('0x28')]=function(_0x3af151,_0x2de9ab){var _0xa09303={'raw':!![],'where':{'id':_0x3af151[_0xad54('0x29')]['id']}},_0x48077f={};_0x48077f[_0xad54('0x2a')]=_[_0xad54('0x2b')](db['MailQueue'][_0xad54('0x1e')]);_0x48077f[_0xad54('0x25')]=_[_0xad54('0x2b')](_0x3af151['query']);_0x48077f[_0xad54('0x2c')]=_[_0xad54('0x2d')](_0x48077f[_0xad54('0x2a')],_0x48077f[_0xad54('0x25')]);_0xa09303['attributes']=_[_0xad54('0x2d')](_0x48077f[_0xad54('0x2a')],qs[_0xad54('0x2e')](_0x3af151[_0xad54('0x25')][_0xad54('0x2e')]));_0xa09303['attributes']=_0xa09303[_0xad54('0x2f')][_0xad54('0x30')]?_0xa09303[_0xad54('0x2f')]:_0x48077f[_0xad54('0x2a')];if(_0x3af151['query'][_0xad54('0x31')]){_0xa09303[_0xad54('0x24')]=[{'all':!![]}];}_0xa09303=_[_0xad54('0x32')]({},_0xa09303,_0x3af151[_0xad54('0x33')]);return db[_0xad54('0x1d')][_0xad54('0x34')](_0xa09303)[_0xad54('0x15')](handleEntityNotFound(_0x2de9ab,null))[_0xad54('0x15')](respondWithResult(_0x2de9ab,null))[_0xad54('0x35')](handleError(_0x2de9ab,null));};exports['create']=function(_0x1b1fb2,_0x53ca48){return db['MailQueue'][_0xad54('0x36')](_0x1b1fb2[_0xad54('0x37')],{})['then'](function(_0x2e0782){var _0x5aa53f=_0x1b1fb2[_0xad54('0x38')][_0xad54('0x39')]({'plain':!![]});if(!_0x5aa53f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5aa53f[_0xad54('0x3a')]==='user'){var _0x4384c7=_0x2e0782[_0xad54('0x39')]({'plain':!![]});var _0x45e250=_0xad54('0x17');return db[_0xad54('0x3b')][_0xad54('0x34')]({'where':{'name':_0x45e250,'userProfileId':_0x5aa53f[_0xad54('0x3c')]},'raw':!![]})[_0xad54('0x15')](function(_0x4200da){if(_0x4200da&&_0x4200da[_0xad54('0x3d')]===0x0){return db['UserProfileResource']['create']({'name':_0x4384c7['name'],'resourceId':_0x4384c7['id'],'type':_0x4200da[_0xad54('0x1a')],'sectionId':_0x4200da['id']},{})['then'](function(){return _0x2e0782;});}else{return _0x2e0782;}})['catch'](function(_0x3cce35){logger[_0xad54('0x3e')](_0xad54('0x3f'),_0x3cce35);throw _0x3cce35;});}return _0x2e0782;})['then'](respondWithResult(_0x53ca48,0xc9))[_0xad54('0x35')](handleError(_0x53ca48,null));};exports[_0xad54('0x14')]=function(_0x46580f,_0x3403a2){if(_0x46580f['body']['id']){delete _0x46580f[_0xad54('0x37')]['id'];}return db[_0xad54('0x1d')][_0xad54('0x34')]({'where':{'id':_0x46580f[_0xad54('0x29')]['id']}})[_0xad54('0x15')](handleEntityNotFound(_0x3403a2,null))[_0xad54('0x15')](saveUpdates(_0x46580f['body'],null))[_0xad54('0x15')](respondWithResult(_0x3403a2,null))[_0xad54('0x35')](handleError(_0x3403a2,null));};exports[_0xad54('0x16')]=function(_0x5a87a2,_0x348e6b){return db[_0xad54('0x1d')][_0xad54('0x34')]({'where':{'id':_0x5a87a2['params']['id']}})[_0xad54('0x15')](handleEntityNotFound(_0x348e6b,null))['then'](removeEntity(_0x348e6b,null))['catch'](handleError(_0x348e6b,null));};exports[_0xad54('0x40')]=function(_0x1e3c17,_0x2d47ac){return db[_0xad54('0x1d')][_0xad54('0x40')]()[_0xad54('0x15')](respondWithResult(_0x2d47ac,null))[_0xad54('0x35')](handleError(_0x2d47ac,null));};exports[_0xad54('0x41')]=function(_0x637dab,_0x49d4ca){var _0x4c8f9d={'raw':!![],'where':{}},_0x5329bb={},_0x532879;return db[_0xad54('0x1d')][_0xad54('0x42')]({'where':{'id':_0x637dab[_0xad54('0x29')]['id']}})[_0xad54('0x15')](handleEntityNotFound(_0x49d4ca,null))['then'](function(_0x3118c7){if(_0x3118c7){_0x532879=_0x3118c7[_0xad54('0x39')]({'plain':!![]});_0x5329bb[_0xad54('0x2a')]=_['keys'](db['UserMailQueue']['rawAttributes']);_0x5329bb[_0xad54('0x25')]=_[_0xad54('0x2b')](_0x637dab[_0xad54('0x25')]);_0x5329bb[_0xad54('0x2c')]=_[_0xad54('0x2d')](_0x5329bb[_0xad54('0x2a')],_0x5329bb[_0xad54('0x25')]);_0x4c8f9d['attributes']=_[_0xad54('0x2d')](_0x5329bb[_0xad54('0x2a')],qs[_0xad54('0x2e')](_0x637dab['query'][_0xad54('0x2e')]));_0x4c8f9d[_0xad54('0x2f')]=_0x4c8f9d['attributes'][_0xad54('0x30')]?_0x4c8f9d[_0xad54('0x2f')]:_0x5329bb[_0xad54('0x2a')];if(!_0x637dab[_0xad54('0x25')][_0xad54('0x43')](_0xad54('0x44'))){_0x4c8f9d[_0xad54('0x10')]=qs[_0xad54('0x10')](_0x637dab[_0xad54('0x25')][_0xad54('0x10')]);_0x4c8f9d[_0xad54('0xf')]=qs[_0xad54('0xf')](_0x637dab[_0xad54('0x25')][_0xad54('0xf')]);}_0x4c8f9d[_0xad54('0x45')]=qs['sort'](_0x637dab[_0xad54('0x25')][_0xad54('0x46')]);_0x4c8f9d['where']=qs[_0xad54('0x2c')](_[_0xad54('0x47')](_0x637dab[_0xad54('0x25')],_0x5329bb[_0xad54('0x2c')]));_0x4c8f9d[_0xad54('0x23')]['MailQueueId']=_0x3118c7['id'];if(_0x637dab[_0xad54('0x25')][_0xad54('0x48')]){_0x4c8f9d[_0xad54('0x23')]=_['merge'](_0x4c8f9d['where'],{'$or':_[_0xad54('0x1c')](_0x4c8f9d[_0xad54('0x2f')],function(_0x442865){var _0x5b1699={};_0x5b1699[_0x442865]={'$like':'%'+_0x637dab['query'][_0xad54('0x48')]+'%'};return _0x5b1699;})});}_0x4c8f9d=_['merge']({},_0x4c8f9d,_0x637dab[_0xad54('0x33')]);return db[_0xad54('0x49')][_0xad54('0x26')](_0x4c8f9d);}})['then'](function(_0x42a02c){if(_0x42a02c){return db[_0xad54('0x4a')]['findAndCountAll']({'where':{'id':_['map'](_0x42a02c,'UserId'),'role':_0xad54('0x4b')},'attributes':['id',_0xad54('0x1a'),_0xad54('0x4c'),_0xad54('0x4d'),_0xad54('0x4e')]});}})['then'](function(_0x435aed){if(_0x435aed){return{'count':_0x435aed[_0xad54('0x12')],'rows':_[_0xad54('0x1c')](_0x435aed[_0xad54('0x27')],function(_0x36a059){return{'membername':_0x36a059['name'],'UserId':_0x36a059['id'],'queue_name':_0x532879[_0xad54('0x1a')],'MailQueueId':_0x532879['id'],'interface':util['format'](_0xad54('0x4f'),'SIP',_0x36a059['name']),'penalty':0x0,'paused':_0x36a059[_0xad54('0x4c')],'createdAt':_0x36a059[_0xad54('0x4e')],'updatedAt':_0x36a059[_0xad54('0x4d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xad54('0x15')](respondWithFilteredResult(_0x49d4ca,_0x4c8f9d))[_0xad54('0x35')](handleError(_0x49d4ca,null));};exports[_0xad54('0x50')]=function(_0x63d750,_0x4148ae){var _0x2fad28={};var _0x524a3f={};var _0x102aae;var _0x2d6cc5;return db[_0xad54('0x1d')]['findOne']({'where':{'id':_0x63d750[_0xad54('0x29')]['id']}})[_0xad54('0x15')](handleEntityNotFound(_0x4148ae,null))[_0xad54('0x15')](function(_0x561693){if(_0x561693){_0x102aae=_0x561693;_0x524a3f[_0xad54('0x2a')]=_[_0xad54('0x2b')](db[_0xad54('0x51')][_0xad54('0x1e')]);_0x524a3f[_0xad54('0x25')]=_[_0xad54('0x2b')](_0x63d750[_0xad54('0x25')]);_0x524a3f[_0xad54('0x2c')]=_['intersection'](_0x524a3f['model'],_0x524a3f[_0xad54('0x25')]);_0x2fad28[_0xad54('0x2f')]=_[_0xad54('0x2d')](_0x524a3f[_0xad54('0x2a')],qs[_0xad54('0x2e')](_0x63d750[_0xad54('0x25')][_0xad54('0x2e')]));_0x2fad28[_0xad54('0x2f')]=_0x2fad28[_0xad54('0x2f')][_0xad54('0x30')]?_0x2fad28[_0xad54('0x2f')]:_0x524a3f['model'];_0x2fad28[_0xad54('0x45')]=qs[_0xad54('0x46')](_0x63d750[_0xad54('0x25')][_0xad54('0x46')]);_0x2fad28['where']=qs[_0xad54('0x2c')](_[_0xad54('0x47')](_0x63d750[_0xad54('0x25')],_0x524a3f[_0xad54('0x2c')]));if(_0x63d750['query'][_0xad54('0x48')]){_0x2fad28[_0xad54('0x23')]=_[_0xad54('0x32')](_0x2fad28[_0xad54('0x23')],{'$or':_[_0xad54('0x1c')](_0x2fad28[_0xad54('0x2f')],function(_0x1b707e){var _0x7edb52={};_0x7edb52[_0x1b707e]={'$like':'%'+_0x63d750[_0xad54('0x25')]['filter']+'%'};return _0x7edb52;})});}_0x2fad28=_['merge']({},_0x2fad28,_0x63d750['options']);return _0x102aae[_0xad54('0x50')](_0x2fad28);}})[_0xad54('0x15')](function(_0x2aee9c){if(_0x2aee9c){_0x2d6cc5=_0x2aee9c[_0xad54('0x30')];if(!_0x63d750[_0xad54('0x25')][_0xad54('0x43')](_0xad54('0x44'))){_0x2fad28[_0xad54('0x10')]=qs[_0xad54('0x10')](_0x63d750[_0xad54('0x25')]['limit']);_0x2fad28['offset']=qs[_0xad54('0xf')](_0x63d750[_0xad54('0x25')][_0xad54('0xf')]);}return _0x102aae[_0xad54('0x50')](_0x2fad28);}})['then'](function(_0x33dc03){if(_0x33dc03){return _0x33dc03?{'count':_0x2d6cc5,'rows':_0x33dc03}:null;}})[_0xad54('0x15')](respondWithResult(_0x4148ae,null))[_0xad54('0x35')](handleError(_0x4148ae,null));};exports['addTeams']=function(_0x491bcd,_0x1ebd5d){var _0x1d9eef=_0x491bcd[_0xad54('0x37')][_0xad54('0x52')];return db[_0xad54('0x51')][_0xad54('0x26')]({'where':{'id':_0x1d9eef},'attributes':['id'],'include':[{'model':db[_0xad54('0x4a')],'as':_0xad54('0x53'),'attributes':['id',_0xad54('0x1a'),'online',_0xad54('0x54'),_0xad54('0x55')],'raw':!![]}]})[_0xad54('0x15')](function(_0x17b353){if(_0x17b353){var _0x2a44ee=_['flatMap'](_0x17b353,function(_0x50c010){var _0x3e6b33=_0x50c010[_0xad54('0x39')]({'plain':!![]});return _0x3e6b33['Agents'];});return db[_0xad54('0x1d')][_0xad54('0x34')]({'where':{'id':_0x491bcd[_0xad54('0x29')]['id']}})[_0xad54('0x15')](function(_0x242061){return db[_0xad54('0x56')][_0xad54('0x57')](function(_0x4613b8){return _0x242061[_0xad54('0x58')](_0x1d9eef,{'transaction':_0x4613b8})['then'](function(){return BPromise['each'](_0x2a44ee,function(_0x5cf669){return db['UserMailQueue'][_0xad54('0x59')]({'where':{'UserId':_0x5cf669['id'],'MailQueueId':_0x491bcd[_0xad54('0x29')]['id']},'transaction':_0x4613b8});});})[_0xad54('0x15')](function(){_0x2a44ee[_0xad54('0x5a')](function(_0x1f3c57){socket[_0xad54('0x5b')](_0xad54('0x5c'),{'UserId':_0x1f3c57['id'],'MailQueueId':_0x242061['id']});});});});});}})['then'](respondWithStatusCode(_0x1ebd5d,null))[_0xad54('0x35')](handleError(_0x1ebd5d,null));};exports[_0xad54('0x5d')]=function(_0x4bbaba,_0x572f0f){return db[_0xad54('0x51')]['findAll']({'where':{'id':_0x4bbaba[_0xad54('0x25')][_0xad54('0x52')]},'attributes':['id'],'include':[{'model':db[_0xad54('0x4a')],'as':_0xad54('0x53'),'attributes':['id'],'raw':!![]}]})[_0xad54('0x15')](handleEntityNotFound(_0x572f0f,null))[_0xad54('0x15')](function(_0x47102){var _0x22e6c9=_[_0xad54('0x1c')](_0x47102,'id');var _0x4eec4e=[];var _0x3af960=[];var _0xe11a09=squel['select']();_0xe11a09['field'](_0xad54('0x5e'))[_0xad54('0x5f')](_0xad54('0x60'),'tq')[_0xad54('0x61')](_0xad54('0x62'),'ut',_0xad54('0x63'))[_0xad54('0x23')](_0xad54('0x64'),_0x4bbaba['params']['id']);for(var _0x12515f=0x0;_0x12515f<_0x47102['length'];_0x12515f+=0x1){let _0xa4ef31=_0x47102[_0x12515f];for(var _0x2cfcea=0x0;_0x2cfcea<_0xa4ef31['Agents'][_0xad54('0x30')];_0x2cfcea+=0x1){let _0x3db273=_0xa4ef31['Agents'][_0x2cfcea];var _0x52e2bb=_0xe11a09[_0xad54('0x65')]();_0x52e2bb[_0xad54('0x23')](_0xad54('0x66'),_0x3db273['id']);_0x3af960[_0xad54('0x67')](db[_0xad54('0x56')]['query'](_0x52e2bb['toString'](),{'type':db[_0xad54('0x56')][_0xad54('0x68')][_0xad54('0x69')]})[_0xad54('0x15')](function(_0x1c5e81){if(_0x1c5e81['length']===0x1){return _0x3db273['id'];}else{var _0x17a8d7=_[_0xad54('0x6a')](_[_0xad54('0x1c')](_0x1c5e81,_0xad54('0x6b')),function(_0x5b9f18){return _['includes'](_0x22e6c9,_0x5b9f18);});if(_0x17a8d7){return _0x3db273['id'];}}}));}}return BPromise[_0xad54('0x6c')](_0x3af960)['then'](function(_0x5b2dda){_0x4eec4e=_(_0x4eec4e)[_0xad54('0x6d')](_0x5b2dda)[_0xad54('0x6e')]()['value']();return db[_0xad54('0x1d')]['find']({'where':{'id':_0x4bbaba[_0xad54('0x29')]['id']}})['then'](function(_0x17ba48){return db[_0xad54('0x56')][_0xad54('0x57')](function(_0x54117a){return _0x17ba48[_0xad54('0x5d')](_0x4bbaba[_0xad54('0x25')][_0xad54('0x52')],{'transaction':_0x54117a})[_0xad54('0x15')](function(){if(!_[_0xad54('0x6f')](_0x4eec4e)){return _0x17ba48[_0xad54('0x70')](_0x4eec4e,{'transaction':_0x54117a});}})[_0xad54('0x15')](function(){_0x4eec4e[_0xad54('0x5a')](function(_0x435be2){socket[_0xad54('0x5b')](_0xad54('0x71'),{'UserId':_0x435be2,'MailQueueId':_0x17ba48['id']});});});});});});})[_0xad54('0x15')](respondWithStatusCode(_0x572f0f,null))['catch'](handleError(_0x572f0f,null));};exports[_0xad54('0x72')]=function(_0x85b2b2,_0x5cc43b){return db[_0xad54('0x1d')][_0xad54('0x34')]({'where':{'id':_0x85b2b2['params']['id']}})[_0xad54('0x15')](handleEntityNotFound(_0x5cc43b,null))[_0xad54('0x15')](function(_0x419553){if(_0x419553){return _0x419553['addAgents'](_0x85b2b2['body'][_0xad54('0x52')],_[_0xad54('0x73')](_0x85b2b2[_0xad54('0x37')],[_0xad54('0x52'),'id'])||{})[_0xad54('0x74')](function(_0x3fbc24){for(var _0xf3e999=0x0;_0xf3e999<_0x85b2b2[_0xad54('0x37')][_0xad54('0x52')][_0xad54('0x30')];_0xf3e999+=0x1){socket['emit'](_0xad54('0x5c'),{'UserId':Number(_0x85b2b2[_0xad54('0x37')]['ids'][_0xf3e999]),'MailQueueId':Number(_0x85b2b2['params']['id'])});}return _0x3fbc24;});}})[_0xad54('0x15')](respondWithResult(_0x5cc43b,null))[_0xad54('0x35')](handleError(_0x5cc43b,null));};exports[_0xad54('0x70')]=function(_0x51ebb5,_0x1b52cd){return db[_0xad54('0x1d')][_0xad54('0x34')]({'where':{'id':_0x51ebb5['params']['id']}})[_0xad54('0x15')](handleEntityNotFound(_0x1b52cd,null))[_0xad54('0x15')](function(_0x1f5f09){if(_0x1f5f09){return _0x1f5f09['removeAgents'](_0x51ebb5['query'][_0xad54('0x52')])[_0xad54('0x15')](function(){if(_[_0xad54('0x75')](_0x51ebb5[_0xad54('0x25')][_0xad54('0x52')])){for(var _0x412cc9=0x0;_0x412cc9<_0x51ebb5[_0xad54('0x25')][_0xad54('0x52')][_0xad54('0x30')];_0x412cc9+=0x1){socket[_0xad54('0x5b')](_0xad54('0x71'),{'UserId':Number(_0x51ebb5['query']['ids'][_0x412cc9]),'MailQueueId':Number(_0x51ebb5[_0xad54('0x29')]['id'])});}}else{socket[_0xad54('0x5b')]('userMailQueue:remove',{'UserId':Number(_0x51ebb5[_0xad54('0x25')]['ids']),'MailQueueId':Number(_0x51ebb5[_0xad54('0x29')]['id'])});}});}})[_0xad54('0x15')](respondWithStatusCode(_0x1b52cd,null))[_0xad54('0x35')](handleError(_0x1b52cd,null));};exports[_0xad54('0x76')]=function(_0x5f054c,_0x3871b8){var _0x20fb61={};var _0x7876ec={};var _0x33b936;var _0x22c393;return db[_0xad54('0x1d')]['findOne']({'where':{'id':_0x5f054c[_0xad54('0x29')]['id']}})[_0xad54('0x15')](handleEntityNotFound(_0x3871b8,null))['then'](function(_0x15ee5b){if(_0x15ee5b){_0x33b936=_0x15ee5b;_0x7876ec[_0xad54('0x2a')]=_['keys'](db[_0xad54('0x4a')][_0xad54('0x1e')]);_0x7876ec[_0xad54('0x25')]=_[_0xad54('0x2b')](_0x5f054c[_0xad54('0x25')]);_0x7876ec[_0xad54('0x2c')]=_[_0xad54('0x2d')](_0x7876ec[_0xad54('0x2a')],_0x7876ec[_0xad54('0x25')]);_0x20fb61[_0xad54('0x2f')]=_[_0xad54('0x2d')](_0x7876ec['model'],qs[_0xad54('0x2e')](_0x5f054c[_0xad54('0x25')]['fields']));_0x20fb61[_0xad54('0x2f')]=_0x20fb61['attributes'][_0xad54('0x30')]?_0x20fb61[_0xad54('0x2f')]:_0x7876ec['model'];_0x20fb61['order']=qs[_0xad54('0x46')](_0x5f054c[_0xad54('0x25')][_0xad54('0x46')]);_0x20fb61[_0xad54('0x23')]=qs['filters'](_[_0xad54('0x47')](_0x5f054c['query'],_0x7876ec[_0xad54('0x2c')]));if(_0x5f054c[_0xad54('0x25')][_0xad54('0x48')]){_0x20fb61[_0xad54('0x23')]=_[_0xad54('0x32')](_0x20fb61[_0xad54('0x23')],{'$or':_[_0xad54('0x1c')](_0x20fb61['attributes'],function(_0x1c7b3f){var _0x14532c={};_0x14532c[_0x1c7b3f]={'$like':'%'+_0x5f054c['query'][_0xad54('0x48')]+'%'};return _0x14532c;})});}_0x20fb61=_['merge']({},_0x20fb61,_0x5f054c[_0xad54('0x33')]);return _0x33b936[_0xad54('0x76')](_0x20fb61);}})[_0xad54('0x15')](function(_0xbe31bc){if(_0xbe31bc){_0x22c393=_0xbe31bc[_0xad54('0x30')];if(!_0x5f054c['query'][_0xad54('0x43')](_0xad54('0x44'))){_0x20fb61[_0xad54('0x10')]=qs[_0xad54('0x10')](_0x5f054c['query'][_0xad54('0x10')]);_0x20fb61[_0xad54('0xf')]=qs[_0xad54('0xf')](_0x5f054c['query'][_0xad54('0xf')]);}return _0x33b936['getAgents'](_0x20fb61);}})[_0xad54('0x15')](function(_0x2e7615){if(_0x2e7615){return _0x2e7615?{'count':_0x22c393,'rows':_0x2e7615}:null;}})[_0xad54('0x15')](respondWithResult(_0x3871b8,null))[_0xad54('0x35')](handleError(_0x3871b8,null));}; \ No newline at end of file +var _0xa00c=['TeamId','includes','all','union','value','isEmpty','removeAgents','forEach','addAgents','spread','isArray','userMailQueue:remove','getAgents','util','squel','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','./mailQueue.socket','register','status','end','json','undefined','limit','count','offset','set','Content-Range','update','then','get','destroy','error','stack','name','send','index','MailQueue','fieldName','type','getOptions','include','query','rows','show','params','keys','rawAttributes','filters','intersection','model','attributes','fields','length','includeAll','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','MailQueues','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','hasOwnProperty','nolimit','order','sort','where','pick','MailQueueId','filter','map','findAll','findAndCountAll','UserId','mailPause','createdAt','%s/%s','SIP','updatedAt','getTeams','Team','ids','User','Agents','online','interface','flatMap','sequelize','transaction','addTeams','UserMailQueue','findOrCreate','emit','userMailQueue:save','removeTeams','select','field','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','QueryTypes','SELECT','every'];(function(_0x4bb581,_0x6f7037){var _0x316bf5=function(_0x1f6ed0){while(--_0x1f6ed0){_0x4bb581['push'](_0x4bb581['shift']());}};_0x316bf5(++_0x6f7037);}(_0xa00c,0x1e9));var _0xca00=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa00c[_0x19e35c];return _0x3e1fe8;};'use strict';var BPromise=require('bluebird');var util=require(_0xca00('0x0'));var _=require('lodash');var squel=require(_0xca00('0x1'));var Redis=require('ioredis');var qs=require(_0xca00('0x2'));var logger=require('../../config/logger')(_0xca00('0x3'));var config=require(_0xca00('0x4'));var db=require(_0xca00('0x5'))['db'];config[_0xca00('0x6')]=_[_0xca00('0x7')](config[_0xca00('0x6')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xca00('0x6')]));require(_0xca00('0x8'))[_0xca00('0x9')](socket);function respondWithStatusCode(_0x239f9a,_0x4e827b){_0x4e827b=_0x4e827b||0xcc;return function(_0x37acdb){if(_0x37acdb){return _0x239f9a['sendStatus'](_0x4e827b);}return _0x239f9a[_0xca00('0xa')](_0x4e827b)[_0xca00('0xb')]();};}function respondWithResult(_0x294c21,_0x527d0c){_0x527d0c=_0x527d0c||0xc8;return function(_0x15436e){if(_0x15436e){return _0x294c21['status'](_0x527d0c)[_0xca00('0xc')](_0x15436e);}};}function respondWithFilteredResult(_0x5708a7,_0x4100d4){return function(_0x87017c){if(_0x87017c){var _0x4e5a18=typeof _0x4100d4['offset']===_0xca00('0xd')&&typeof _0x4100d4[_0xca00('0xe')]===_0xca00('0xd');var _0x44a19b=_0x87017c[_0xca00('0xf')];var _0x57f796=_0x4e5a18?0x0:_0x4100d4[_0xca00('0x10')];var _0x3d029b=_0x4e5a18?_0x87017c[_0xca00('0xf')]:_0x4100d4[_0xca00('0x10')]+_0x4100d4[_0xca00('0xe')];var _0x398b3e;if(_0x3d029b>=_0x44a19b){_0x3d029b=_0x44a19b;_0x398b3e=0xc8;}else{_0x398b3e=0xce;}_0x5708a7['status'](_0x398b3e);return _0x5708a7[_0xca00('0x11')](_0xca00('0x12'),_0x57f796+'-'+_0x3d029b+'/'+_0x44a19b)[_0xca00('0xc')](_0x87017c);}return null;};}function saveUpdates(_0xcf98d6){return function(_0x1be0cc){if(_0x1be0cc){return _0x1be0cc[_0xca00('0x13')](_0xcf98d6)[_0xca00('0x14')](function(_0xc90be0){return _0xc90be0;});}return null;};}function removeEntity(_0x3032a5){return function(_0x33c8bf){if(_0x33c8bf){return _0x33c8bf['destroy']()['then'](function(){var _0x1bcb4a=_0x33c8bf[_0xca00('0x15')]({'plain':!![]});var _0xc7ecb9='MailQueues';return db['UserProfileResource'][_0xca00('0x16')]({'where':{'type':_0xc7ecb9,'resourceId':_0x1bcb4a['id']}})['then'](function(){return _0x33c8bf;});})[_0xca00('0x14')](function(){_0x3032a5[_0xca00('0xa')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ef11c){return function(_0x22b13a){if(!_0x22b13a){_0x5ef11c['sendStatus'](0x194);}return _0x22b13a;};}function handleError(_0x380355,_0x4ba8c4){_0x4ba8c4=_0x4ba8c4||0x1f4;return function(_0x12aa4b){logger[_0xca00('0x17')](_0x12aa4b[_0xca00('0x18')]);if(_0x12aa4b[_0xca00('0x19')]){delete _0x12aa4b[_0xca00('0x19')];}_0x380355[_0xca00('0xa')](_0x4ba8c4)[_0xca00('0x1a')](_0x12aa4b);};}exports[_0xca00('0x1b')]=function(_0x2dc751,_0x5e063d){var _0x2bfe0d={};var _0x57c05f={'count':0x0,'rows':[]};var _0x22e6ab=_['map'](db[_0xca00('0x1c')]['rawAttributes'],function(_0xd349c6){return{'name':_0xd349c6[_0xca00('0x1d')],'type':_0xd349c6[_0xca00('0x1e')]['key']};});_0x2bfe0d=qs[_0xca00('0x1f')](_0x22e6ab,_0x2dc751);var _0x53d76e={'where':_0x2bfe0d['where']};return db['MailQueue']['count'](_0x53d76e)[_0xca00('0x14')](function(_0x3cfe5a){_0x57c05f[_0xca00('0xf')]=_0x3cfe5a;_0x2bfe0d[_0xca00('0x20')]=qs[_0xca00('0x20')](_0x2dc751[_0xca00('0x21')]);return db[_0xca00('0x1c')]['findAll'](_0x2bfe0d);})[_0xca00('0x14')](function(_0x39117b){_0x57c05f[_0xca00('0x22')]=_0x39117b;return _0x57c05f;})['then'](respondWithFilteredResult(_0x5e063d,_0x2bfe0d))['catch'](handleError(_0x5e063d,null));};exports[_0xca00('0x23')]=function(_0x4deff8,_0x431c92){var _0x5b1339={'raw':!![],'where':{'id':_0x4deff8[_0xca00('0x24')]['id']}},_0x6f4f5a={};_0x6f4f5a['model']=_[_0xca00('0x25')](db[_0xca00('0x1c')][_0xca00('0x26')]);_0x6f4f5a[_0xca00('0x21')]=_['keys'](_0x4deff8[_0xca00('0x21')]);_0x6f4f5a[_0xca00('0x27')]=_[_0xca00('0x28')](_0x6f4f5a[_0xca00('0x29')],_0x6f4f5a['query']);_0x5b1339[_0xca00('0x2a')]=_[_0xca00('0x28')](_0x6f4f5a[_0xca00('0x29')],qs[_0xca00('0x2b')](_0x4deff8[_0xca00('0x21')]['fields']));_0x5b1339[_0xca00('0x2a')]=_0x5b1339[_0xca00('0x2a')][_0xca00('0x2c')]?_0x5b1339[_0xca00('0x2a')]:_0x6f4f5a['model'];if(_0x4deff8[_0xca00('0x21')][_0xca00('0x2d')]){_0x5b1339[_0xca00('0x20')]=[{'all':!![]}];}_0x5b1339=_[_0xca00('0x2e')]({},_0x5b1339,_0x4deff8[_0xca00('0x2f')]);return db['MailQueue'][_0xca00('0x30')](_0x5b1339)['then'](handleEntityNotFound(_0x431c92,null))['then'](respondWithResult(_0x431c92,null))['catch'](handleError(_0x431c92,null));};exports[_0xca00('0x31')]=function(_0x71d78d,_0x2d3e9a){return db[_0xca00('0x1c')][_0xca00('0x31')](_0x71d78d[_0xca00('0x32')],{})[_0xca00('0x14')](function(_0x2d361c){var _0x3217a2=_0x71d78d[_0xca00('0x33')][_0xca00('0x15')]({'plain':!![]});if(!_0x3217a2)throw new Error(_0xca00('0x34'));if(_0x3217a2[_0xca00('0x35')]===_0xca00('0x33')){var _0x5e36c0=_0x2d361c['get']({'plain':!![]});var _0x386e4d=_0xca00('0x36');return db[_0xca00('0x37')][_0xca00('0x30')]({'where':{'name':_0x386e4d,'userProfileId':_0x3217a2[_0xca00('0x38')]},'raw':!![]})[_0xca00('0x14')](function(_0x782876){if(_0x782876&&_0x782876[_0xca00('0x39')]===0x0){return db['UserProfileResource'][_0xca00('0x31')]({'name':_0x5e36c0[_0xca00('0x19')],'resourceId':_0x5e36c0['id'],'type':_0x782876[_0xca00('0x19')],'sectionId':_0x782876['id']},{})['then'](function(){return _0x2d361c;});}else{return _0x2d361c;}})[_0xca00('0x3a')](function(_0xfd3bd5){logger[_0xca00('0x17')](_0xca00('0x3b'),_0xfd3bd5);throw _0xfd3bd5;});}return _0x2d361c;})[_0xca00('0x14')](respondWithResult(_0x2d3e9a,0xc9))[_0xca00('0x3a')](handleError(_0x2d3e9a,null));};exports[_0xca00('0x13')]=function(_0x43438c,_0xde54e3){if(_0x43438c['body']['id']){delete _0x43438c['body']['id'];}return db['MailQueue'][_0xca00('0x30')]({'where':{'id':_0x43438c[_0xca00('0x24')]['id']}})[_0xca00('0x14')](handleEntityNotFound(_0xde54e3,null))[_0xca00('0x14')](saveUpdates(_0x43438c[_0xca00('0x32')],null))[_0xca00('0x14')](respondWithResult(_0xde54e3,null))[_0xca00('0x3a')](handleError(_0xde54e3,null));};exports['destroy']=function(_0x18277f,_0x3783ad){return db[_0xca00('0x1c')][_0xca00('0x30')]({'where':{'id':_0x18277f[_0xca00('0x24')]['id']}})[_0xca00('0x14')](handleEntityNotFound(_0x3783ad,null))[_0xca00('0x14')](removeEntity(_0x3783ad,null))[_0xca00('0x3a')](handleError(_0x3783ad,null));};exports['describe']=function(_0x17a114,_0x13de2f){return db[_0xca00('0x1c')][_0xca00('0x3c')]()[_0xca00('0x14')](respondWithResult(_0x13de2f,null))[_0xca00('0x3a')](handleError(_0x13de2f,null));};exports[_0xca00('0x3d')]=function(_0x584455,_0x4a31b0){var _0x229df7={'raw':!![],'where':{}},_0x5c9ea4={},_0x2b1a07;return db[_0xca00('0x1c')][_0xca00('0x3e')]({'where':{'id':_0x584455['params']['id']}})[_0xca00('0x14')](handleEntityNotFound(_0x4a31b0,null))[_0xca00('0x14')](function(_0x4a7fcf){if(_0x4a7fcf){_0x2b1a07=_0x4a7fcf[_0xca00('0x15')]({'plain':!![]});_0x5c9ea4[_0xca00('0x29')]=_[_0xca00('0x25')](db['UserMailQueue'][_0xca00('0x26')]);_0x5c9ea4[_0xca00('0x21')]=_[_0xca00('0x25')](_0x584455['query']);_0x5c9ea4[_0xca00('0x27')]=_[_0xca00('0x28')](_0x5c9ea4[_0xca00('0x29')],_0x5c9ea4['query']);_0x229df7[_0xca00('0x2a')]=_[_0xca00('0x28')](_0x5c9ea4[_0xca00('0x29')],qs[_0xca00('0x2b')](_0x584455[_0xca00('0x21')]['fields']));_0x229df7[_0xca00('0x2a')]=_0x229df7[_0xca00('0x2a')][_0xca00('0x2c')]?_0x229df7[_0xca00('0x2a')]:_0x5c9ea4[_0xca00('0x29')];if(!_0x584455[_0xca00('0x21')][_0xca00('0x3f')](_0xca00('0x40'))){_0x229df7['limit']=qs['limit'](_0x584455[_0xca00('0x21')][_0xca00('0xe')]);_0x229df7['offset']=qs[_0xca00('0x10')](_0x584455[_0xca00('0x21')][_0xca00('0x10')]);}_0x229df7[_0xca00('0x41')]=qs[_0xca00('0x42')](_0x584455[_0xca00('0x21')][_0xca00('0x42')]);_0x229df7[_0xca00('0x43')]=qs['filters'](_[_0xca00('0x44')](_0x584455[_0xca00('0x21')],_0x5c9ea4['filters']));_0x229df7[_0xca00('0x43')][_0xca00('0x45')]=_0x4a7fcf['id'];if(_0x584455['query'][_0xca00('0x46')]){_0x229df7[_0xca00('0x43')]=_['merge'](_0x229df7[_0xca00('0x43')],{'$or':_[_0xca00('0x47')](_0x229df7[_0xca00('0x2a')],function(_0xe8716c){var _0x55c2fa={};_0x55c2fa[_0xe8716c]={'$like':'%'+_0x584455['query']['filter']+'%'};return _0x55c2fa;})});}_0x229df7=_[_0xca00('0x2e')]({},_0x229df7,_0x584455[_0xca00('0x2f')]);return db['UserMailQueue'][_0xca00('0x48')](_0x229df7);}})['then'](function(_0x10056a){if(_0x10056a){return db['User'][_0xca00('0x49')]({'where':{'id':_[_0xca00('0x47')](_0x10056a,_0xca00('0x4a')),'role':'agent'},'attributes':['id',_0xca00('0x19'),_0xca00('0x4b'),'updatedAt',_0xca00('0x4c')]});}})[_0xca00('0x14')](function(_0x9010ff){if(_0x9010ff){return{'count':_0x9010ff['count'],'rows':_[_0xca00('0x47')](_0x9010ff['rows'],function(_0x5336af){return{'membername':_0x5336af[_0xca00('0x19')],'UserId':_0x5336af['id'],'queue_name':_0x2b1a07['name'],'MailQueueId':_0x2b1a07['id'],'interface':util['format'](_0xca00('0x4d'),_0xca00('0x4e'),_0x5336af['name']),'penalty':0x0,'paused':_0x5336af[_0xca00('0x4b')],'createdAt':_0x5336af[_0xca00('0x4c')],'updatedAt':_0x5336af[_0xca00('0x4f')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x4a31b0,_0x229df7))[_0xca00('0x3a')](handleError(_0x4a31b0,null));};exports[_0xca00('0x50')]=function(_0x5cdade,_0x5b121c){var _0xa79cd6={};var _0x299034={};var _0x25d70a;var _0x44dd30;return db[_0xca00('0x1c')][_0xca00('0x3e')]({'where':{'id':_0x5cdade[_0xca00('0x24')]['id']}})[_0xca00('0x14')](handleEntityNotFound(_0x5b121c,null))[_0xca00('0x14')](function(_0x21dd78){if(_0x21dd78){_0x25d70a=_0x21dd78;_0x299034[_0xca00('0x29')]=_[_0xca00('0x25')](db[_0xca00('0x51')]['rawAttributes']);_0x299034[_0xca00('0x21')]=_[_0xca00('0x25')](_0x5cdade[_0xca00('0x21')]);_0x299034[_0xca00('0x27')]=_[_0xca00('0x28')](_0x299034['model'],_0x299034[_0xca00('0x21')]);_0xa79cd6['attributes']=_[_0xca00('0x28')](_0x299034[_0xca00('0x29')],qs[_0xca00('0x2b')](_0x5cdade[_0xca00('0x21')][_0xca00('0x2b')]));_0xa79cd6[_0xca00('0x2a')]=_0xa79cd6['attributes']['length']?_0xa79cd6[_0xca00('0x2a')]:_0x299034[_0xca00('0x29')];_0xa79cd6[_0xca00('0x41')]=qs[_0xca00('0x42')](_0x5cdade['query'][_0xca00('0x42')]);_0xa79cd6[_0xca00('0x43')]=qs[_0xca00('0x27')](_[_0xca00('0x44')](_0x5cdade[_0xca00('0x21')],_0x299034[_0xca00('0x27')]));if(_0x5cdade['query']['filter']){_0xa79cd6['where']=_[_0xca00('0x2e')](_0xa79cd6[_0xca00('0x43')],{'$or':_['map'](_0xa79cd6[_0xca00('0x2a')],function(_0x546906){var _0x2557fc={};_0x2557fc[_0x546906]={'$like':'%'+_0x5cdade[_0xca00('0x21')][_0xca00('0x46')]+'%'};return _0x2557fc;})});}_0xa79cd6=_[_0xca00('0x2e')]({},_0xa79cd6,_0x5cdade[_0xca00('0x2f')]);return _0x25d70a['getTeams'](_0xa79cd6);}})[_0xca00('0x14')](function(_0x1f2aeb){if(_0x1f2aeb){_0x44dd30=_0x1f2aeb[_0xca00('0x2c')];if(!_0x5cdade['query'][_0xca00('0x3f')](_0xca00('0x40'))){_0xa79cd6['limit']=qs[_0xca00('0xe')](_0x5cdade[_0xca00('0x21')][_0xca00('0xe')]);_0xa79cd6['offset']=qs['offset'](_0x5cdade[_0xca00('0x21')][_0xca00('0x10')]);}return _0x25d70a[_0xca00('0x50')](_0xa79cd6);}})['then'](function(_0x2546a4){if(_0x2546a4){return _0x2546a4?{'count':_0x44dd30,'rows':_0x2546a4}:null;}})['then'](respondWithResult(_0x5b121c,null))[_0xca00('0x3a')](handleError(_0x5b121c,null));};exports['addTeams']=function(_0x4c20a9,_0x107eb3){var _0x396b49=_0x4c20a9['body'][_0xca00('0x52')];return db[_0xca00('0x51')][_0xca00('0x48')]({'where':{'id':_0x396b49},'attributes':['id'],'include':[{'model':db[_0xca00('0x53')],'as':_0xca00('0x54'),'attributes':['id','name',_0xca00('0x55'),'voicePause',_0xca00('0x56')],'raw':!![]}]})[_0xca00('0x14')](function(_0x3a625e){if(_0x3a625e){var _0x1ed36d=_[_0xca00('0x57')](_0x3a625e,function(_0x2ad2dd){var _0x4d6d20=_0x2ad2dd[_0xca00('0x15')]({'plain':!![]});return _0x4d6d20['Agents'];});return db[_0xca00('0x1c')]['find']({'where':{'id':_0x4c20a9[_0xca00('0x24')]['id']}})[_0xca00('0x14')](function(_0x3036ea){return db[_0xca00('0x58')][_0xca00('0x59')](function(_0x5691d0){return _0x3036ea[_0xca00('0x5a')](_0x396b49,{'transaction':_0x5691d0})[_0xca00('0x14')](function(){return BPromise['each'](_0x1ed36d,function(_0xc5d950){return db[_0xca00('0x5b')][_0xca00('0x5c')]({'where':{'UserId':_0xc5d950['id'],'MailQueueId':_0x4c20a9[_0xca00('0x24')]['id']},'transaction':_0x5691d0});});})[_0xca00('0x14')](function(){_0x1ed36d['forEach'](function(_0x49714c){socket[_0xca00('0x5d')](_0xca00('0x5e'),{'UserId':_0x49714c['id'],'MailQueueId':_0x3036ea['id']});});});});});}})['then'](respondWithStatusCode(_0x107eb3,null))['catch'](handleError(_0x107eb3,null));};exports[_0xca00('0x5f')]=function(_0x592f3f,_0x77d4c6){return db[_0xca00('0x51')][_0xca00('0x48')]({'where':{'id':_0x592f3f[_0xca00('0x21')][_0xca00('0x52')]},'attributes':['id'],'include':[{'model':db[_0xca00('0x53')],'as':_0xca00('0x54'),'attributes':['id'],'raw':!![]}]})[_0xca00('0x14')](handleEntityNotFound(_0x77d4c6,null))[_0xca00('0x14')](function(_0x571503){var _0x2d5112=_[_0xca00('0x47')](_0x571503,'id');var _0x3a65df=[];var _0xff60f2=[];var _0x2b2738=squel[_0xca00('0x60')]();_0x2b2738[_0xca00('0x61')]('tq.TeamId')['from'](_0xca00('0x62'),'tq')[_0xca00('0x63')](_0xca00('0x64'),'ut',_0xca00('0x65'))[_0xca00('0x43')]('MailQueueId\x20=\x20?',_0x592f3f[_0xca00('0x24')]['id']);for(var _0x1ea1ee=0x0;_0x1ea1ee<_0x571503[_0xca00('0x2c')];_0x1ea1ee+=0x1){let _0x2b369b=_0x571503[_0x1ea1ee];for(var _0x46974d=0x0;_0x46974d<_0x2b369b['Agents'][_0xca00('0x2c')];_0x46974d+=0x1){let _0x4d21bf=_0x2b369b[_0xca00('0x54')][_0x46974d];var _0x220216=_0x2b2738['clone']();_0x220216[_0xca00('0x43')](_0xca00('0x66'),_0x4d21bf['id']);_0xff60f2['push'](db[_0xca00('0x58')][_0xca00('0x21')](_0x220216['toString'](),{'type':db[_0xca00('0x58')][_0xca00('0x67')][_0xca00('0x68')]})[_0xca00('0x14')](function(_0x26a8fe){if(_0x26a8fe['length']===0x1){return _0x4d21bf['id'];}else{var _0x38e01a=_[_0xca00('0x69')](_[_0xca00('0x47')](_0x26a8fe,_0xca00('0x6a')),function(_0x2a2274){return _[_0xca00('0x6b')](_0x2d5112,_0x2a2274);});if(_0x38e01a){return _0x4d21bf['id'];}}}));}}return BPromise[_0xca00('0x6c')](_0xff60f2)[_0xca00('0x14')](function(_0xd128e2){_0x3a65df=_(_0x3a65df)[_0xca00('0x6d')](_0xd128e2)['compact']()[_0xca00('0x6e')]();return db[_0xca00('0x1c')][_0xca00('0x30')]({'where':{'id':_0x592f3f[_0xca00('0x24')]['id']}})['then'](function(_0x1a2d26){return db[_0xca00('0x58')]['transaction'](function(_0x1ba209){return _0x1a2d26[_0xca00('0x5f')](_0x592f3f[_0xca00('0x21')][_0xca00('0x52')],{'transaction':_0x1ba209})[_0xca00('0x14')](function(){if(!_[_0xca00('0x6f')](_0x3a65df)){return _0x1a2d26[_0xca00('0x70')](_0x3a65df,{'transaction':_0x1ba209});}})[_0xca00('0x14')](function(){_0x3a65df[_0xca00('0x71')](function(_0x5bd550){socket[_0xca00('0x5d')]('userMailQueue:remove',{'UserId':_0x5bd550,'MailQueueId':_0x1a2d26['id']});});});});});});})[_0xca00('0x14')](respondWithStatusCode(_0x77d4c6,null))[_0xca00('0x3a')](handleError(_0x77d4c6,null));};exports[_0xca00('0x72')]=function(_0x2081ea,_0xc43c6d){return db[_0xca00('0x1c')][_0xca00('0x30')]({'where':{'id':_0x2081ea[_0xca00('0x24')]['id']}})['then'](handleEntityNotFound(_0xc43c6d,null))[_0xca00('0x14')](function(_0x45a136){if(_0x45a136){return _0x45a136['addAgents'](_0x2081ea[_0xca00('0x32')][_0xca00('0x52')],_['omit'](_0x2081ea[_0xca00('0x32')],[_0xca00('0x52'),'id'])||{})[_0xca00('0x73')](function(_0x249ea1){for(var _0x233825=0x0;_0x233825<_0x2081ea[_0xca00('0x32')][_0xca00('0x52')]['length'];_0x233825+=0x1){socket['emit'](_0xca00('0x5e'),{'UserId':Number(_0x2081ea[_0xca00('0x32')][_0xca00('0x52')][_0x233825]),'MailQueueId':Number(_0x2081ea['params']['id'])});}return _0x249ea1;});}})[_0xca00('0x14')](respondWithResult(_0xc43c6d,null))[_0xca00('0x3a')](handleError(_0xc43c6d,null));};exports[_0xca00('0x70')]=function(_0x1ffab2,_0x390ee9){return db[_0xca00('0x1c')]['find']({'where':{'id':_0x1ffab2[_0xca00('0x24')]['id']}})['then'](handleEntityNotFound(_0x390ee9,null))['then'](function(_0x8392c2){if(_0x8392c2){return _0x8392c2[_0xca00('0x70')](_0x1ffab2[_0xca00('0x21')]['ids'])[_0xca00('0x14')](function(){if(_[_0xca00('0x74')](_0x1ffab2[_0xca00('0x21')][_0xca00('0x52')])){for(var _0x21c7bd=0x0;_0x21c7bd<_0x1ffab2[_0xca00('0x21')]['ids'][_0xca00('0x2c')];_0x21c7bd+=0x1){socket['emit'](_0xca00('0x75'),{'UserId':Number(_0x1ffab2[_0xca00('0x21')]['ids'][_0x21c7bd]),'MailQueueId':Number(_0x1ffab2[_0xca00('0x24')]['id'])});}}else{socket[_0xca00('0x5d')]('userMailQueue:remove',{'UserId':Number(_0x1ffab2[_0xca00('0x21')]['ids']),'MailQueueId':Number(_0x1ffab2[_0xca00('0x24')]['id'])});}});}})[_0xca00('0x14')](respondWithStatusCode(_0x390ee9,null))[_0xca00('0x3a')](handleError(_0x390ee9,null));};exports[_0xca00('0x76')]=function(_0x49d404,_0x19ee2c){var _0x15a465={};var _0x3c222e={};var _0x405422;var _0x2d8ccd;return db[_0xca00('0x1c')]['findOne']({'where':{'id':_0x49d404[_0xca00('0x24')]['id']}})[_0xca00('0x14')](handleEntityNotFound(_0x19ee2c,null))['then'](function(_0x3838bc){if(_0x3838bc){_0x405422=_0x3838bc;_0x3c222e[_0xca00('0x29')]=_[_0xca00('0x25')](db[_0xca00('0x53')][_0xca00('0x26')]);_0x3c222e[_0xca00('0x21')]=_[_0xca00('0x25')](_0x49d404[_0xca00('0x21')]);_0x3c222e['filters']=_[_0xca00('0x28')](_0x3c222e[_0xca00('0x29')],_0x3c222e[_0xca00('0x21')]);_0x15a465[_0xca00('0x2a')]=_[_0xca00('0x28')](_0x3c222e['model'],qs[_0xca00('0x2b')](_0x49d404[_0xca00('0x21')]['fields']));_0x15a465[_0xca00('0x2a')]=_0x15a465['attributes'][_0xca00('0x2c')]?_0x15a465[_0xca00('0x2a')]:_0x3c222e[_0xca00('0x29')];_0x15a465['order']=qs[_0xca00('0x42')](_0x49d404[_0xca00('0x21')][_0xca00('0x42')]);_0x15a465['where']=qs[_0xca00('0x27')](_['pick'](_0x49d404[_0xca00('0x21')],_0x3c222e[_0xca00('0x27')]));if(_0x49d404[_0xca00('0x21')][_0xca00('0x46')]){_0x15a465[_0xca00('0x43')]=_[_0xca00('0x2e')](_0x15a465[_0xca00('0x43')],{'$or':_['map'](_0x15a465['attributes'],function(_0x83b25f){var _0x52ced0={};_0x52ced0[_0x83b25f]={'$like':'%'+_0x49d404[_0xca00('0x21')]['filter']+'%'};return _0x52ced0;})});}_0x15a465=_['merge']({},_0x15a465,_0x49d404[_0xca00('0x2f')]);return _0x405422[_0xca00('0x76')](_0x15a465);}})[_0xca00('0x14')](function(_0x429bda){if(_0x429bda){_0x2d8ccd=_0x429bda[_0xca00('0x2c')];if(!_0x49d404['query'][_0xca00('0x3f')](_0xca00('0x40'))){_0x15a465[_0xca00('0xe')]=qs[_0xca00('0xe')](_0x49d404['query']['limit']);_0x15a465['offset']=qs['offset'](_0x49d404[_0xca00('0x21')][_0xca00('0x10')]);}return _0x405422[_0xca00('0x76')](_0x15a465);}})[_0xca00('0x14')](function(_0x7baec2){if(_0x7baec2){return _0x7baec2?{'count':_0x2d8ccd,'rows':_0x7baec2}:null;}})[_0xca00('0x14')](respondWithResult(_0x19ee2c,null))[_0xca00('0x3a')](handleError(_0x19ee2c,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 6624eed..0491375 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 _0xde03=['hook','events','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x44825a,_0x374843){var _0x5da801=function(_0xe4909c){while(--_0xe4909c){_0x44825a['push'](_0x44825a['shift']());}};_0x5da801(++_0x374843);}(_0xde03,0xf9));var _0x3de0=function(_0x124e3c,_0xce8d5){_0x124e3c=_0x124e3c-0x0;var _0x5e72c9=_0xde03[_0x124e3c];return _0x5e72c9;};'use strict';var EventEmitter=require(_0x3de0('0x0'));var MailQueue=require('../../mysqldb')['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x3de0('0x1')](0x0);var events={'afterCreate':_0x3de0('0x2'),'afterUpdate':_0x3de0('0x3'),'afterDestroy':_0x3de0('0x4')};function emitEvent(_0x1b40cc){return function(_0x30e3ad,_0x118e6d,_0x2795c2){MailQueueEvents[_0x3de0('0x5')](_0x1b40cc+':'+_0x30e3ad['id'],_0x30e3ad);MailQueueEvents['emit'](_0x1b40cc,_0x30e3ad);_0x2795c2(null);};}for(var e in events){if(events[_0x3de0('0x6')](e)){var event=events[e];MailQueue[_0x3de0('0x7')](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file +var _0x53e5=['save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','MailQueue','setMaxListeners'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0x53e5,0x7e));var _0x553e=function(_0x2727e1,_0x302d6e){_0x2727e1=_0x2727e1-0x0;var _0x4de837=_0x53e5[_0x2727e1];return _0x4de837;};'use strict';var EventEmitter=require(_0x553e('0x0'));var MailQueue=require(_0x553e('0x1'))['db'][_0x553e('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x553e('0x3')](0x0);var events={'afterCreate':_0x553e('0x4'),'afterUpdate':_0x553e('0x5'),'afterDestroy':_0x553e('0x6')};function emitEvent(_0x40d280){return function(_0x1eb596,_0xc4dc0e,_0x1e019c){MailQueueEvents[_0x553e('0x7')](_0x40d280+':'+_0x1eb596['id'],_0x1eb596);MailQueueEvents[_0x553e('0x7')](_0x40d280,_0x1eb596);_0x1e019c(null);};}for(var e in events){if(events[_0x553e('0x8')](e)){var event=events[e];MailQueue[_0x553e('0x9')](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 174950b..820394d 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 _0x5a76=['api','moment','path','rimraf','../../config/environment','./mailQueue.attributes','exports','MailQueue','lodash','../../config/logger'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x5a76,0x120));var _0x65a7=function(_0x31c0e3,_0x3c5cd6){_0x31c0e3=_0x31c0e3-0x0;var _0xf34e31=_0x5a76[_0x31c0e3];return _0xf34e31;};'use strict';var _=require(_0x65a7('0x0'));var util=require('util');var logger=require(_0x65a7('0x1'))(_0x65a7('0x2'));var moment=require(_0x65a7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x65a7('0x4'));var rimraf=require(_0x65a7('0x5'));var config=require(_0x65a7('0x6'));var attributes=require(_0x65a7('0x7'));module[_0x65a7('0x8')]=function(_0x5ebc51,_0xc6812b){return _0x5ebc51['define'](_0x65a7('0x9'),attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x43e1=['define','lodash','util','api','moment','request-promise','path','../../config/environment','./mailQueue.attributes','exports'];(function(_0x67c336,_0x2f4a21){var _0x34ca7f=function(_0x597fc2){while(--_0x597fc2){_0x67c336['push'](_0x67c336['shift']());}};_0x34ca7f(++_0x2f4a21);}(_0x43e1,0x79));var _0x143e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0x43e1[_0x45e98e];return _0x374dba;};'use strict';var _=require(_0x143e('0x0'));var util=require(_0x143e('0x1'));var logger=require('../../config/logger')(_0x143e('0x2'));var moment=require(_0x143e('0x3'));var BPromise=require('bluebird');var rp=require(_0x143e('0x4'));var fs=require('fs');var path=require(_0x143e('0x5'));var rimraf=require('rimraf');var config=require(_0x143e('0x6'));var attributes=require(_0x143e('0x7'));module[_0x143e('0x8')]=function(_0x3d6633,_0x58810b){return _0x3d6633[_0x143e('0x9')]('MailQueue',attributes,{'tableName':'mail_queues','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 7aa4d26..cbaf819 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 _0x8bd4=['../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','socket.io-emitter','./mailQueue.socket','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','MailQueue','options','raw','where','limit','include','model','attributes','GetMailQueue','ShowMailQueue','find','map','catch','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x48daa6,_0x2f383c){var _0x24b4e4=function(_0x2714ad){while(--_0x2714ad){_0x48daa6['push'](_0x48daa6['shift']());}};_0x24b4e4(++_0x2f383c);}(_0x8bd4,0xb9));var _0x48bd=function(_0x446aa1,_0x5b1c5b){_0x446aa1=_0x446aa1-0x0;var _0xf21d72=_0x8bd4[_0x446aa1];return _0xf21d72;};'use strict';var _=require('lodash');var util=require(_0x48bd('0x0'));var moment=require('moment');var BPromise=require(_0x48bd('0x1'));var rs=require(_0x48bd('0x2'));var fs=require('fs');var Redis=require(_0x48bd('0x3'));var db=require(_0x48bd('0x4'))['db'];var utils=require(_0x48bd('0x5'));var logger=require(_0x48bd('0x6'))(_0x48bd('0x7'));var config=require('../../config/environment');var jayson=require(_0x48bd('0x8'));var client=jayson[_0x48bd('0x9')]['http']({'port':0x232a});config[_0x48bd('0xa')]=_[_0x48bd('0xb')](config[_0x48bd('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x48bd('0xc'))(new Redis(config['redis']));require(_0x48bd('0xd'))['register'](socket);function respondWithRpcPromise(_0x5497a7,_0x1fd837,_0x199254){return new BPromise(function(_0x26da5d,_0x1ec816){return client['request'](_0x5497a7,_0x199254)[_0x48bd('0xe')](function(_0x4cd9da){logger[_0x48bd('0xf')](_0x48bd('0x10'),_0x1fd837,_0x48bd('0x11'));logger[_0x48bd('0x12')](_0x48bd('0x13'),_0x1fd837,_0x48bd('0x11'),JSON[_0x48bd('0x14')](_0x4cd9da));if(_0x4cd9da[_0x48bd('0x15')]){if(_0x4cd9da['error'][_0x48bd('0x16')]===0x1f4){logger[_0x48bd('0x15')](_0x48bd('0x10'),_0x1fd837,_0x4cd9da[_0x48bd('0x15')]['message']);return _0x1ec816(_0x4cd9da[_0x48bd('0x15')][_0x48bd('0x17')]);}logger['error'](_0x48bd('0x10'),_0x1fd837,_0x4cd9da[_0x48bd('0x15')][_0x48bd('0x17')]);return _0x26da5d(_0x4cd9da['error'][_0x48bd('0x17')]);}else{logger[_0x48bd('0xf')](_0x48bd('0x10'),_0x1fd837,_0x48bd('0x11'));_0x26da5d(_0x4cd9da[_0x48bd('0x18')][_0x48bd('0x17')]);}})['catch'](function(_0x5d3e0d){logger[_0x48bd('0x15')](_0x48bd('0x10'),_0x1fd837,_0x5d3e0d);_0x1ec816(_0x5d3e0d);});});}exports['GetMailQueue']=function(_0x5dd198){var _0x523d9f=this;return new Promise(function(_0x5d0432,_0x1948ca){return db[_0x48bd('0x19')]['findAll']({'raw':_0x5dd198[_0x48bd('0x1a')]?_0x5dd198['options'][_0x48bd('0x1b')]===undefined?!![]:![]:!![],'where':_0x5dd198[_0x48bd('0x1a')]?_0x5dd198[_0x48bd('0x1a')][_0x48bd('0x1c')]||null:null,'attributes':_0x5dd198[_0x48bd('0x1a')]?_0x5dd198[_0x48bd('0x1a')]['attributes']||null:null,'limit':_0x5dd198[_0x48bd('0x1a')]?_0x5dd198['options'][_0x48bd('0x1d')]||null:null,'include':_0x5dd198[_0x48bd('0x1a')]?_0x5dd198[_0x48bd('0x1a')]['include']?_['map'](_0x5dd198[_0x48bd('0x1a')][_0x48bd('0x1e')],function(_0x44b801){return{'model':db[_0x44b801[_0x48bd('0x1f')]],'as':_0x44b801['as'],'attributes':_0x44b801[_0x48bd('0x20')],'include':_0x44b801[_0x48bd('0x1e')]?_['map'](_0x44b801[_0x48bd('0x1e')],function(_0xa61d10){return{'model':db[_0xa61d10['model']],'as':_0xa61d10['as'],'attributes':_0xa61d10[_0x48bd('0x20')],'include':_0xa61d10[_0x48bd('0x1e')]?_['map'](_0xa61d10[_0x48bd('0x1e')],function(_0x50e635){return{'model':db[_0x50e635[_0x48bd('0x1f')]],'as':_0x50e635['as'],'attributes':_0x50e635['attributes']};}):[]};}):[]};}):[]:[]})[_0x48bd('0xe')](function(_0x1a25fb){logger[_0x48bd('0xf')](_0x48bd('0x21'),_0x5dd198);logger[_0x48bd('0x12')](_0x48bd('0x21'),_0x5dd198,JSON[_0x48bd('0x14')](_0x1a25fb));_0x5d0432(_0x1a25fb);})['catch'](function(_0x208254){logger[_0x48bd('0x15')]('GetMailQueue',_0x208254[_0x48bd('0x17')],_0x5dd198);_0x1948ca(_0x523d9f['error'](0x1f4,_0x208254['message']));});});};exports[_0x48bd('0x22')]=function(_0x2a80a0){var _0x461c91=this;return new Promise(function(_0x1b05e9,_0x51540d){return db[_0x48bd('0x19')][_0x48bd('0x23')]({'raw':_0x2a80a0[_0x48bd('0x1a')]?_0x2a80a0['options'][_0x48bd('0x1b')]===undefined?!![]:![]:!![],'where':_0x2a80a0[_0x48bd('0x1a')]?_0x2a80a0[_0x48bd('0x1a')][_0x48bd('0x1c')]||null:null,'attributes':_0x2a80a0[_0x48bd('0x1a')]?_0x2a80a0[_0x48bd('0x1a')][_0x48bd('0x20')]||null:null,'include':_0x2a80a0[_0x48bd('0x1a')]?_0x2a80a0['options'][_0x48bd('0x1e')]?_[_0x48bd('0x24')](_0x2a80a0[_0x48bd('0x1a')][_0x48bd('0x1e')],function(_0x38cfd0){return{'model':db[_0x38cfd0['model']],'as':_0x38cfd0['as'],'attributes':_0x38cfd0['attributes'],'include':_0x38cfd0[_0x48bd('0x1e')]?_[_0x48bd('0x24')](_0x38cfd0[_0x48bd('0x1e')],function(_0x24de5e){return{'model':db[_0x24de5e[_0x48bd('0x1f')]],'as':_0x24de5e['as'],'attributes':_0x24de5e[_0x48bd('0x20')],'include':_0x24de5e[_0x48bd('0x1e')]?_[_0x48bd('0x24')](_0x24de5e[_0x48bd('0x1e')],function(_0xa3d727){return{'model':db[_0xa3d727[_0x48bd('0x1f')]],'as':_0xa3d727['as'],'attributes':_0xa3d727[_0x48bd('0x20')]};}):[]};}):[]};}):[]:[]})[_0x48bd('0xe')](function(_0x56fa10){logger[_0x48bd('0xf')](_0x48bd('0x22'),_0x2a80a0);logger[_0x48bd('0x12')](_0x48bd('0x22'),_0x2a80a0,JSON[_0x48bd('0x14')](_0x56fa10));_0x1b05e9(_0x56fa10);})[_0x48bd('0x25')](function(_0x200da0){logger[_0x48bd('0x15')](_0x48bd('0x22'),_0x200da0[_0x48bd('0x17')],_0x2a80a0);_0x51540d(_0x461c91[_0x48bd('0x15')](0x1f4,_0x200da0[_0x48bd('0x17')]));});});}; \ No newline at end of file +var _0x233e=['info','result','GetMailQueue','MailQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowMailQueue','find','catch','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','socket.io-emitter','./mailQueue.socket','register','request','then','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','MailQueue,\x20%s,\x20%s','message'];(function(_0x909339,_0x858c03){var _0x1615c6=function(_0x3019c1){while(--_0x3019c1){_0x909339['push'](_0x909339['shift']());}};_0x1615c6(++_0x858c03);}(_0x233e,0x148));var _0xe233=function(_0x162046,_0x2a4c7f){_0x162046=_0x162046-0x0;var _0x19f97e=_0x233e[_0x162046];return _0x19f97e;};'use strict';var _=require(_0xe233('0x0'));var util=require('util');var moment=require(_0xe233('0x1'));var BPromise=require(_0xe233('0x2'));var rs=require(_0xe233('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe233('0x4'));var logger=require(_0xe233('0x5'))(_0xe233('0x6'));var config=require(_0xe233('0x7'));var jayson=require(_0xe233('0x8'));var client=jayson['client'][_0xe233('0x9')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xe233('0xa'))(new Redis(config['redis']));require(_0xe233('0xb'))[_0xe233('0xc')](socket);function respondWithRpcPromise(_0x4f36b9,_0x45f0b8,_0x53722c){return new BPromise(function(_0x167a28,_0x13f4be){return client[_0xe233('0xd')](_0x4f36b9,_0x53722c)[_0xe233('0xe')](function(_0x1df3bf){logger['info']('MailQueue,\x20%s,\x20%s',_0x45f0b8,_0xe233('0xf'));logger[_0xe233('0x10')](_0xe233('0x11'),_0x45f0b8,_0xe233('0xf'),JSON[_0xe233('0x12')](_0x1df3bf));if(_0x1df3bf['error']){if(_0x1df3bf[_0xe233('0x13')][_0xe233('0x14')]===0x1f4){logger[_0xe233('0x13')](_0xe233('0x15'),_0x45f0b8,_0x1df3bf[_0xe233('0x13')]['message']);return _0x13f4be(_0x1df3bf[_0xe233('0x13')]['message']);}logger[_0xe233('0x13')](_0xe233('0x15'),_0x45f0b8,_0x1df3bf[_0xe233('0x13')][_0xe233('0x16')]);return _0x167a28(_0x1df3bf[_0xe233('0x13')][_0xe233('0x16')]);}else{logger[_0xe233('0x17')](_0xe233('0x15'),_0x45f0b8,_0xe233('0xf'));_0x167a28(_0x1df3bf[_0xe233('0x18')]['message']);}})['catch'](function(_0x5dc831){logger[_0xe233('0x13')](_0xe233('0x15'),_0x45f0b8,_0x5dc831);_0x13f4be(_0x5dc831);});});}exports[_0xe233('0x19')]=function(_0x5d4556){var _0x28280b=this;return new Promise(function(_0x369976,_0x30db84){return db[_0xe233('0x1a')][_0xe233('0x1b')]({'raw':_0x5d4556[_0xe233('0x1c')]?_0x5d4556['options'][_0xe233('0x1d')]===undefined?!![]:![]:!![],'where':_0x5d4556['options']?_0x5d4556[_0xe233('0x1c')][_0xe233('0x1e')]||null:null,'attributes':_0x5d4556['options']?_0x5d4556[_0xe233('0x1c')][_0xe233('0x1f')]||null:null,'limit':_0x5d4556[_0xe233('0x1c')]?_0x5d4556[_0xe233('0x1c')][_0xe233('0x20')]||null:null,'include':_0x5d4556[_0xe233('0x1c')]?_0x5d4556['options'][_0xe233('0x21')]?_[_0xe233('0x22')](_0x5d4556[_0xe233('0x1c')][_0xe233('0x21')],function(_0x89af4d){return{'model':db[_0x89af4d[_0xe233('0x23')]],'as':_0x89af4d['as'],'attributes':_0x89af4d[_0xe233('0x1f')],'include':_0x89af4d[_0xe233('0x21')]?_[_0xe233('0x22')](_0x89af4d[_0xe233('0x21')],function(_0x360470){return{'model':db[_0x360470['model']],'as':_0x360470['as'],'attributes':_0x360470[_0xe233('0x1f')],'include':_0x360470[_0xe233('0x21')]?_['map'](_0x360470[_0xe233('0x21')],function(_0x5f2281){return{'model':db[_0x5f2281[_0xe233('0x23')]],'as':_0x5f2281['as'],'attributes':_0x5f2281[_0xe233('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xe233('0xe')](function(_0x5f4f73){logger[_0xe233('0x17')](_0xe233('0x19'),_0x5d4556);logger[_0xe233('0x10')](_0xe233('0x19'),_0x5d4556,JSON[_0xe233('0x12')](_0x5f4f73));_0x369976(_0x5f4f73);})['catch'](function(_0x1b2c73){logger[_0xe233('0x13')](_0xe233('0x19'),_0x1b2c73[_0xe233('0x16')],_0x5d4556);_0x30db84(_0x28280b['error'](0x1f4,_0x1b2c73['message']));});});};exports[_0xe233('0x24')]=function(_0x2cc242){var _0x1b403b=this;return new Promise(function(_0x1839c4,_0xbee6df){return db['MailQueue'][_0xe233('0x25')]({'raw':_0x2cc242['options']?_0x2cc242[_0xe233('0x1c')][_0xe233('0x1d')]===undefined?!![]:![]:!![],'where':_0x2cc242['options']?_0x2cc242['options']['where']||null:null,'attributes':_0x2cc242[_0xe233('0x1c')]?_0x2cc242['options'][_0xe233('0x1f')]||null:null,'include':_0x2cc242[_0xe233('0x1c')]?_0x2cc242[_0xe233('0x1c')][_0xe233('0x21')]?_['map'](_0x2cc242[_0xe233('0x1c')]['include'],function(_0x11a6d5){return{'model':db[_0x11a6d5[_0xe233('0x23')]],'as':_0x11a6d5['as'],'attributes':_0x11a6d5[_0xe233('0x1f')],'include':_0x11a6d5[_0xe233('0x21')]?_['map'](_0x11a6d5[_0xe233('0x21')],function(_0x3899fd){return{'model':db[_0x3899fd[_0xe233('0x23')]],'as':_0x3899fd['as'],'attributes':_0x3899fd[_0xe233('0x1f')],'include':_0x3899fd[_0xe233('0x21')]?_[_0xe233('0x22')](_0x3899fd[_0xe233('0x21')],function(_0x151a74){return{'model':db[_0x151a74[_0xe233('0x23')]],'as':_0x151a74['as'],'attributes':_0x151a74['attributes']};}):[]};}):[]};}):[]:[]})[_0xe233('0xe')](function(_0x36f2e9){logger['info'](_0xe233('0x24'),_0x2cc242);logger[_0xe233('0x10')](_0xe233('0x24'),_0x2cc242,JSON[_0xe233('0x12')](_0x36f2e9));_0x1839c4(_0x36f2e9);})[_0xe233('0x26')](function(_0x373547){logger[_0xe233('0x13')](_0xe233('0x24'),_0x373547['message'],_0x2cc242);_0xbee6df(_0x1b403b[_0xe233('0x13')](0x1f4,_0x373547[_0xe233('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 7417855..b5b4f70 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 _0x46af=['./mailQueue.events','remove','update','emit','mailQueue:'];(function(_0x29c3b2,_0x3c12ac){var _0x4b3aa7=function(_0x622a9d){while(--_0x622a9d){_0x29c3b2['push'](_0x29c3b2['shift']());}};_0x4b3aa7(++_0x3c12ac);}(_0x46af,0x18b));var _0xf46a=function(_0xd8461a,_0x15c458){_0xd8461a=_0xd8461a-0x0;var _0x3bb923=_0x46af[_0xd8461a];return _0x3bb923;};'use strict';var MailQueueEvents=require(_0xf46a('0x0'));var events=['save',_0xf46a('0x1'),_0xf46a('0x2')];function createListener(_0x4795f2,_0x1f59f7){return function(_0x125a06){_0x1f59f7[_0xf46a('0x3')](_0x4795f2,_0x125a06);};}function removeListener(_0x5dc0c1,_0x58c319){return function(){MailQueueEvents['removeListener'](_0x5dc0c1,_0x58c319);};}exports['register']=function(_0x57f58f){for(var _0x555422=0x0,_0x4de2a7=events['length'];_0x555422<_0x4de2a7;_0x555422++){var _0x23fac2=events[_0x555422];var _0x5bf546=createListener(_0xf46a('0x4')+_0x23fac2,_0x57f58f);MailQueueEvents['on'](_0x23fac2,_0x5bf546);}}; \ No newline at end of file +var _0x1e77=['remove','emit','register','length','./mailQueue.events','save'];(function(_0x16cb03,_0x43ea58){var _0x10944e=function(_0x27ebaa){while(--_0x27ebaa){_0x16cb03['push'](_0x16cb03['shift']());}};_0x10944e(++_0x43ea58);}(_0x1e77,0xca));var _0x71e7=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x1e77[_0x2dafbe];return _0x58a45a;};'use strict';var MailQueueEvents=require(_0x71e7('0x0'));var events=[_0x71e7('0x1'),_0x71e7('0x2'),'update'];function createListener(_0x205b45,_0x18d74e){return function(_0x394198){_0x18d74e[_0x71e7('0x3')](_0x205b45,_0x394198);};}function removeListener(_0x59149a,_0x484cee){return function(){MailQueueEvents['removeListener'](_0x59149a,_0x484cee);};}exports[_0x71e7('0x4')]=function(_0x1c7da3){for(var _0x13bc6e=0x0,_0x30918b=events[_0x71e7('0x5')];_0x13bc6e<_0x30918b;_0x13bc6e++){var _0x2ff941=events[_0x13bc6e];var _0x136324=createListener('mailQueue:'+_0x2ff941,_0x1c7da3);MailQueueEvents['on'](_0x2ff941,_0x136324);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 9eaf260..cfb6bfd 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 _0x5546=['/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated'];(function(_0x71b765,_0x3053f8){var _0x34cb24=function(_0x2dd237){while(--_0x2dd237){_0x71b765['push'](_0x71b765['shift']());}};_0x34cb24(++_0x3053f8);}(_0x5546,0x1ee));var _0x6554=function(_0x2290eb,_0x3f33e6){_0x2290eb=_0x2290eb-0x0;var _0x542a18=_0x5546[_0x2290eb];return _0x542a18;};'use strict';var multer=require(_0x6554('0x0'));var util=require(_0x6554('0x1'));var path=require(_0x6554('0x2'));var timeout=require(_0x6554('0x3'));var express=require(_0x6554('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6554('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6554('0x6'));var controller=require(_0x6554('0x7'));router[_0x6554('0x8')]('/',auth[_0x6554('0x9')](),controller['index']);router['get'](_0x6554('0xa'),auth[_0x6554('0x9')](),controller[_0x6554('0xb')]);router['get'](_0x6554('0xc'),auth['isAuthenticated'](),controller[_0x6554('0xd')]);router[_0x6554('0xe')]('/',auth[_0x6554('0x9')](),controller[_0x6554('0xf')]);router[_0x6554('0x10')]('/:id',auth[_0x6554('0x9')](),controller[_0x6554('0x11')]);router[_0x6554('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x6554('0x13')]);module[_0x6554('0x14')]=router; \ No newline at end of file +var _0xc0a4=['Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','describe','/:id','post','create','put','update','destroy','exports','util','path','connect-timeout'];(function(_0x1d5c62,_0x54b94a){var _0x5c7db9=function(_0x1173e8){while(--_0x1173e8){_0x1d5c62['push'](_0x1d5c62['shift']());}};_0x5c7db9(++_0x54b94a);}(_0xc0a4,0x1b7));var _0x4c0a=function(_0x539a64,_0x17ad3f){_0x539a64=_0x539a64-0x0;var _0x3c7800=_0xc0a4[_0x539a64];return _0x3c7800;};'use strict';var multer=require('multer');var util=require(_0x4c0a('0x0'));var path=require(_0x4c0a('0x1'));var timeout=require(_0x4c0a('0x2'));var express=require('express');var router=express[_0x4c0a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4c0a('0x4'));var interaction=require(_0x4c0a('0x5'));var config=require('../../config/environment');var controller=require('./mailQueueReport.controller');router[_0x4c0a('0x6')]('/',auth[_0x4c0a('0x7')](),controller[_0x4c0a('0x8')]);router[_0x4c0a('0x6')]('/describe',auth['isAuthenticated'](),controller[_0x4c0a('0x9')]);router[_0x4c0a('0x6')](_0x4c0a('0xa'),auth[_0x4c0a('0x7')](),controller['show']);router[_0x4c0a('0xb')]('/',auth[_0x4c0a('0x7')](),controller[_0x4c0a('0xc')]);router[_0x4c0a('0xd')](_0x4c0a('0xa'),auth['isAuthenticated'](),controller[_0x4c0a('0xe')]);router['delete'](_0x4c0a('0xa'),auth[_0x4c0a('0x7')](),controller[_0x4c0a('0xf')]);module[_0x4c0a('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 1d29b14..7c2ebac 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 _0xf776=['DATE','moment','exports','STRING'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xf776,0x169));var _0x6f77=function(_0x1724ea,_0x440f1c){_0x1724ea=_0x1724ea-0x0;var _0x114c8a=_0xf776[_0x1724ea];return _0x114c8a;};'use strict';var moment=require(_0x6f77('0x0'));var Sequelize=require('sequelize');module[_0x6f77('0x1')]={'uniqueid':{'type':Sequelize[_0x6f77('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x6f77('0x3')]},'leaveAt':{'type':Sequelize[_0x6f77('0x3')]},'acceptAt':{'type':Sequelize[_0x6f77('0x3')]},'exitAt':{'type':Sequelize[_0x6f77('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7c1e=['DATE','moment','STRING'];(function(_0x2cd298,_0xe37fd8){var _0xa49bd9=function(_0x21d2ed){while(--_0x21d2ed){_0x2cd298['push'](_0x2cd298['shift']());}};_0xa49bd9(++_0xe37fd8);}(_0x7c1e,0x112));var _0xe7c1=function(_0x28f635,_0x4b2e2a){_0x28f635=_0x28f635-0x0;var _0x34ee8f=_0x7c1e[_0x28f635];return _0x34ee8f;};'use strict';var moment=require(_0xe7c1('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xe7c1('0x1')]},'joinAt':{'type':Sequelize[_0xe7c1('0x2')]},'leaveAt':{'type':Sequelize[_0xe7c1('0x2')]},'acceptAt':{'type':Sequelize[_0xe7c1('0x2')]},'exitAt':{'type':Sequelize[_0xe7c1('0x2')]},'reason':{'type':Sequelize[_0xe7c1('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 76769c9..3a2640b 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 _0x5fdc=['papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','MailQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0x5fdc,0x127));var _0xc5fd=function(_0x19cb14,_0x390434){_0x19cb14=_0x19cb14-0x0;var _0x46118f=_0x5fdc[_0x19cb14];return _0x46118f;};'use strict';var emlformat=require(_0xc5fd('0x0'));var rimraf=require(_0xc5fd('0x1'));var zipdir=require(_0xc5fd('0x2'));var jsonpatch=require(_0xc5fd('0x3'));var rp=require(_0xc5fd('0x4'));var moment=require(_0xc5fd('0x5'));var BPromise=require(_0xc5fd('0x6'));var Mustache=require(_0xc5fd('0x7'));var util=require(_0xc5fd('0x8'));var path=require(_0xc5fd('0x9'));var sox=require(_0xc5fd('0xa'));var csv=require(_0xc5fd('0xb'));var ejs=require(_0xc5fd('0xc'));var fs=require('fs');var fs_extra=require(_0xc5fd('0xd'));var _=require(_0xc5fd('0xe'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc5fd('0xf'));var toCsv=require(_0xc5fd('0xb'));var querystring=require(_0xc5fd('0x10'));var Papa=require(_0xc5fd('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc5fd('0x12'));var as=require(_0xc5fd('0x13'));var hardwareService=require(_0xc5fd('0x14'));var logger=require(_0xc5fd('0x15'))(_0xc5fd('0x16'));var utils=require(_0xc5fd('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xc5fd('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x558939,_0x1b1b2b){_0x1b1b2b=_0x1b1b2b||0xcc;return function(_0x1bc6d1){if(_0x1bc6d1){return _0x558939[_0xc5fd('0x19')](_0x1b1b2b);}return _0x558939[_0xc5fd('0x1a')](_0x1b1b2b)[_0xc5fd('0x1b')]();};}function respondWithResult(_0x40b0f8,_0x27447e){_0x27447e=_0x27447e||0xc8;return function(_0xa7a954){if(_0xa7a954){return _0x40b0f8['status'](_0x27447e)[_0xc5fd('0x1c')](_0xa7a954);}};}function respondWithFilteredResult(_0x103c3d,_0x2221da){return function(_0x3404e0){if(_0x3404e0){var _0x4d3636=typeof _0x2221da['offset']==='undefined'&&typeof _0x2221da['limit']==='undefined';var _0x35a9d0=_0x3404e0[_0xc5fd('0x1d')];var _0x27f611=_0x4d3636?0x0:_0x2221da[_0xc5fd('0x1e')];var _0x2ee392=_0x4d3636?_0x3404e0[_0xc5fd('0x1d')]:_0x2221da[_0xc5fd('0x1e')]+_0x2221da['limit'];var _0xb7bab1;if(_0x2ee392>=_0x35a9d0){_0x2ee392=_0x35a9d0;_0xb7bab1=0xc8;}else{_0xb7bab1=0xce;}_0x103c3d[_0xc5fd('0x1a')](_0xb7bab1);return _0x103c3d[_0xc5fd('0x1f')](_0xc5fd('0x20'),_0x27f611+'-'+_0x2ee392+'/'+_0x35a9d0)[_0xc5fd('0x1c')](_0x3404e0);}return null;};}function patchUpdates(_0x48024e){return function(_0x3966a2){try{jsonpatch[_0xc5fd('0x21')](_0x3966a2,_0x48024e,!![]);}catch(_0x18048e){return BPromise[_0xc5fd('0x22')](_0x18048e);}return _0x3966a2['save']();};}function saveUpdates(_0x4c85d5,_0x13cc42){return function(_0x2ab935){if(_0x2ab935){return _0x2ab935[_0xc5fd('0x23')](_0x4c85d5)[_0xc5fd('0x24')](function(_0x334401){return _0x334401;});}return null;};}function removeEntity(_0x311952,_0x56d473){return function(_0x1a3f21){if(_0x1a3f21){return _0x1a3f21[_0xc5fd('0x25')]()[_0xc5fd('0x24')](function(){_0x311952[_0xc5fd('0x1a')](0xcc)[_0xc5fd('0x1b')]();});}};}function handleEntityNotFound(_0x4020af,_0x475b91){return function(_0x527018){if(!_0x527018){_0x4020af[_0xc5fd('0x19')](0x194);}return _0x527018;};}function handleError(_0x48cd1d,_0x2ee700){_0x2ee700=_0x2ee700||0x1f4;return function(_0x231368){logger[_0xc5fd('0x26')](_0x231368[_0xc5fd('0x27')]);if(_0x231368['name']){delete _0x231368[_0xc5fd('0x28')];}_0x48cd1d[_0xc5fd('0x1a')](_0x2ee700)[_0xc5fd('0x29')](_0x231368);};}exports[_0xc5fd('0x2a')]=function(_0x19df33,_0x209975){var _0x541c12={},_0x412ef7={},_0x5d4f70={'count':0x0,'rows':[]};var _0x4859f7=_[_0xc5fd('0x2b')](db[_0xc5fd('0x2c')][_0xc5fd('0x2d')],function(_0x38db1d){return{'name':_0x38db1d[_0xc5fd('0x2e')],'type':_0x38db1d[_0xc5fd('0x2f')][_0xc5fd('0x30')]};});_0x412ef7[_0xc5fd('0x31')]=_['map'](_0x4859f7,_0xc5fd('0x28'));_0x412ef7[_0xc5fd('0x32')]=_[_0xc5fd('0x33')](_0x19df33[_0xc5fd('0x32')]);_0x412ef7[_0xc5fd('0x34')]=_[_0xc5fd('0x35')](_0x412ef7[_0xc5fd('0x31')],_0x412ef7[_0xc5fd('0x32')]);_0x541c12[_0xc5fd('0x36')]=_[_0xc5fd('0x35')](_0x412ef7[_0xc5fd('0x31')],qs[_0xc5fd('0x37')](_0x19df33['query'][_0xc5fd('0x37')]));_0x541c12[_0xc5fd('0x36')]=_0x541c12[_0xc5fd('0x36')][_0xc5fd('0x38')]?_0x541c12[_0xc5fd('0x36')]:_0x412ef7[_0xc5fd('0x31')];if(!_0x19df33[_0xc5fd('0x32')][_0xc5fd('0x39')](_0xc5fd('0x3a'))){_0x541c12['limit']=qs[_0xc5fd('0x3b')](_0x19df33[_0xc5fd('0x32')][_0xc5fd('0x3b')]);_0x541c12[_0xc5fd('0x1e')]=qs[_0xc5fd('0x1e')](_0x19df33[_0xc5fd('0x32')][_0xc5fd('0x1e')]);}_0x541c12['order']=qs[_0xc5fd('0x3c')](_0x19df33[_0xc5fd('0x32')]['sort']);_0x541c12[_0xc5fd('0x3d')]=qs['filters'](_[_0xc5fd('0x3e')](_0x19df33[_0xc5fd('0x32')],_0x412ef7[_0xc5fd('0x34')]),_0x4859f7);if(_0x19df33['query'][_0xc5fd('0x3f')]){_0x541c12[_0xc5fd('0x3d')]=_['merge'](_0x541c12[_0xc5fd('0x3d')],{'$or':_[_0xc5fd('0x2b')](_0x4859f7,function(_0x31b457){if(_0x31b457[_0xc5fd('0x2f')]!==_0xc5fd('0x40')){var _0x33f669={};_0x33f669[_0x31b457['name']]={'$like':'%'+_0x19df33[_0xc5fd('0x32')][_0xc5fd('0x3f')]+'%'};return _0x33f669;}})});}_0x541c12=_[_0xc5fd('0x41')]({},_0x541c12,_0x19df33[_0xc5fd('0x42')]);var _0x5d3fce={'where':_0x541c12['where']};return db['MailQueueReport'][_0xc5fd('0x1d')](_0x5d3fce)[_0xc5fd('0x24')](function(_0x2dd4ca){_0x5d4f70[_0xc5fd('0x1d')]=_0x2dd4ca;if(_0x19df33[_0xc5fd('0x32')][_0xc5fd('0x43')]){_0x541c12[_0xc5fd('0x44')]=[{'all':!![]}];}return db[_0xc5fd('0x2c')][_0xc5fd('0x45')](_0x541c12);})['then'](function(_0x5a2199){_0x5d4f70[_0xc5fd('0x46')]=_0x5a2199;return _0x5d4f70;})['then'](respondWithFilteredResult(_0x209975,_0x541c12))[_0xc5fd('0x47')](handleError(_0x209975,null));};exports[_0xc5fd('0x48')]=function(_0x2259e4,_0x57fd81){var _0x6ebcbf={'raw':!![],'where':{'id':_0x2259e4['params']['id']}},_0x350753={};_0x350753[_0xc5fd('0x31')]=_[_0xc5fd('0x33')](db['MailQueueReport'][_0xc5fd('0x2d')]);_0x350753['query']=_[_0xc5fd('0x33')](_0x2259e4[_0xc5fd('0x32')]);_0x350753['filters']=_[_0xc5fd('0x35')](_0x350753[_0xc5fd('0x31')],_0x350753[_0xc5fd('0x32')]);_0x6ebcbf['attributes']=_[_0xc5fd('0x35')](_0x350753[_0xc5fd('0x31')],qs['fields'](_0x2259e4['query'][_0xc5fd('0x37')]));_0x6ebcbf['attributes']=_0x6ebcbf['attributes']['length']?_0x6ebcbf[_0xc5fd('0x36')]:_0x350753[_0xc5fd('0x31')];if(_0x2259e4[_0xc5fd('0x32')][_0xc5fd('0x43')]){_0x6ebcbf[_0xc5fd('0x44')]=[{'all':!![]}];}_0x6ebcbf=_[_0xc5fd('0x41')]({},_0x6ebcbf,_0x2259e4['options']);return db['MailQueueReport']['find'](_0x6ebcbf)[_0xc5fd('0x24')](handleEntityNotFound(_0x57fd81,null))[_0xc5fd('0x24')](respondWithResult(_0x57fd81,null))[_0xc5fd('0x47')](handleError(_0x57fd81,null));};exports['create']=function(_0x1a2200,_0x51641b){return db[_0xc5fd('0x2c')][_0xc5fd('0x49')](_0x1a2200[_0xc5fd('0x4a')],{})[_0xc5fd('0x24')](respondWithResult(_0x51641b,0xc9))[_0xc5fd('0x47')](handleError(_0x51641b,null));};exports[_0xc5fd('0x23')]=function(_0x54d86c,_0x6b2f77){if(_0x54d86c[_0xc5fd('0x4a')]['id']){delete _0x54d86c['body']['id'];}return db['MailQueueReport'][_0xc5fd('0x4b')]({'where':{'id':_0x54d86c['params']['id']}})['then'](handleEntityNotFound(_0x6b2f77,null))[_0xc5fd('0x24')](saveUpdates(_0x54d86c[_0xc5fd('0x4a')],null))['then'](respondWithResult(_0x6b2f77,null))[_0xc5fd('0x47')](handleError(_0x6b2f77,null));};exports[_0xc5fd('0x25')]=function(_0x5c49e7,_0x21d418){return db[_0xc5fd('0x2c')][_0xc5fd('0x4b')]({'where':{'id':_0x5c49e7[_0xc5fd('0x4c')]['id']}})[_0xc5fd('0x24')](handleEntityNotFound(_0x21d418,null))[_0xc5fd('0x24')](removeEntity(_0x21d418,null))[_0xc5fd('0x47')](handleError(_0x21d418,null));};exports[_0xc5fd('0x4d')]=function(_0x4217f7,_0x32721e){return db[_0xc5fd('0x2c')]['describe']()[_0xc5fd('0x24')](respondWithResult(_0x32721e,null))[_0xc5fd('0x47')](handleError(_0x32721e,null));}; \ No newline at end of file +var _0x6d11=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','apply','reject','then','destroy','stack','name','send','index','map','MailQueueReport','rawAttributes','key','model','query','keys','filters','intersection','attributes','length','sort','where','filter','merge','VIRTUAL','options','count','includeAll','include','show','params','fields','catch','create','body','find','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x6d11,0xbf));var _0x16d1=function(_0x13af32,_0x15682d){_0x13af32=_0x13af32-0x0;var _0x44113a=_0x6d11[_0x13af32];return _0x44113a;};'use strict';var emlformat=require(_0x16d1('0x0'));var rimraf=require(_0x16d1('0x1'));var zipdir=require(_0x16d1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x16d1('0x3'));var moment=require('moment');var BPromise=require(_0x16d1('0x4'));var Mustache=require(_0x16d1('0x5'));var util=require('util');var path=require('path');var sox=require(_0x16d1('0x6'));var csv=require(_0x16d1('0x7'));var ejs=require(_0x16d1('0x8'));var fs=require('fs');var fs_extra=require(_0x16d1('0x9'));var _=require(_0x16d1('0xa'));var squel=require(_0x16d1('0xb'));var crypto=require(_0x16d1('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x16d1('0xd'));var Papa=require(_0x16d1('0xe'));var Redis=require(_0x16d1('0xf'));var authService=require(_0x16d1('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x16d1('0x11'));var hardwareService=require(_0x16d1('0x12'));var logger=require(_0x16d1('0x13'))(_0x16d1('0x14'));var utils=require(_0x16d1('0x15'));var config=require(_0x16d1('0x16'));var licenseUtil=require(_0x16d1('0x17'));var db=require(_0x16d1('0x18'))['db'];function respondWithStatusCode(_0x4de260,_0x32fa68){_0x32fa68=_0x32fa68||0xcc;return function(_0x2e71fa){if(_0x2e71fa){return _0x4de260[_0x16d1('0x19')](_0x32fa68);}return _0x4de260[_0x16d1('0x1a')](_0x32fa68)[_0x16d1('0x1b')]();};}function respondWithResult(_0x5a1429,_0xc034b7){_0xc034b7=_0xc034b7||0xc8;return function(_0x1b71d3){if(_0x1b71d3){return _0x5a1429[_0x16d1('0x1a')](_0xc034b7)[_0x16d1('0x1c')](_0x1b71d3);}};}function respondWithFilteredResult(_0x29ebba,_0x173e16){return function(_0x2d7e8a){if(_0x2d7e8a){var _0x4ee46c=typeof _0x173e16[_0x16d1('0x1d')]===_0x16d1('0x1e')&&typeof _0x173e16['limit']==='undefined';var _0x1a9ec8=_0x2d7e8a['count'];var _0x46a25e=_0x4ee46c?0x0:_0x173e16['offset'];var _0x1da1b8=_0x4ee46c?_0x2d7e8a['count']:_0x173e16[_0x16d1('0x1d')]+_0x173e16[_0x16d1('0x1f')];var _0x48cd70;if(_0x1da1b8>=_0x1a9ec8){_0x1da1b8=_0x1a9ec8;_0x48cd70=0xc8;}else{_0x48cd70=0xce;}_0x29ebba['status'](_0x48cd70);return _0x29ebba['set']('Content-Range',_0x46a25e+'-'+_0x1da1b8+'/'+_0x1a9ec8)[_0x16d1('0x1c')](_0x2d7e8a);}return null;};}function patchUpdates(_0x55a0e0){return function(_0x34b88f){try{jsonpatch[_0x16d1('0x20')](_0x34b88f,_0x55a0e0,!![]);}catch(_0x1f6add){return BPromise[_0x16d1('0x21')](_0x1f6add);}return _0x34b88f['save']();};}function saveUpdates(_0x2c7825,_0x58a03b){return function(_0x2a897d){if(_0x2a897d){return _0x2a897d['update'](_0x2c7825)[_0x16d1('0x22')](function(_0x8c7266){return _0x8c7266;});}return null;};}function removeEntity(_0x17e038,_0x47cad4){return function(_0x215c23){if(_0x215c23){return _0x215c23[_0x16d1('0x23')]()[_0x16d1('0x22')](function(){_0x17e038[_0x16d1('0x1a')](0xcc)[_0x16d1('0x1b')]();});}};}function handleEntityNotFound(_0x335c24,_0x4b2b5c){return function(_0x15203b){if(!_0x15203b){_0x335c24[_0x16d1('0x19')](0x194);}return _0x15203b;};}function handleError(_0x262f89,_0x346b69){_0x346b69=_0x346b69||0x1f4;return function(_0x2b8403){logger['error'](_0x2b8403[_0x16d1('0x24')]);if(_0x2b8403[_0x16d1('0x25')]){delete _0x2b8403[_0x16d1('0x25')];}_0x262f89['status'](_0x346b69)[_0x16d1('0x26')](_0x2b8403);};}exports[_0x16d1('0x27')]=function(_0x364bf7,_0x22e5b3){var _0x6396fc={},_0x462e5b={},_0x1dd574={'count':0x0,'rows':[]};var _0x562908=_[_0x16d1('0x28')](db[_0x16d1('0x29')][_0x16d1('0x2a')],function(_0x30cd8f){return{'name':_0x30cd8f['fieldName'],'type':_0x30cd8f['type'][_0x16d1('0x2b')]};});_0x462e5b[_0x16d1('0x2c')]=_[_0x16d1('0x28')](_0x562908,_0x16d1('0x25'));_0x462e5b[_0x16d1('0x2d')]=_[_0x16d1('0x2e')](_0x364bf7[_0x16d1('0x2d')]);_0x462e5b[_0x16d1('0x2f')]=_[_0x16d1('0x30')](_0x462e5b[_0x16d1('0x2c')],_0x462e5b[_0x16d1('0x2d')]);_0x6396fc[_0x16d1('0x31')]=_[_0x16d1('0x30')](_0x462e5b[_0x16d1('0x2c')],qs['fields'](_0x364bf7[_0x16d1('0x2d')]['fields']));_0x6396fc[_0x16d1('0x31')]=_0x6396fc[_0x16d1('0x31')][_0x16d1('0x32')]?_0x6396fc[_0x16d1('0x31')]:_0x462e5b[_0x16d1('0x2c')];if(!_0x364bf7[_0x16d1('0x2d')]['hasOwnProperty']('nolimit')){_0x6396fc['limit']=qs[_0x16d1('0x1f')](_0x364bf7[_0x16d1('0x2d')][_0x16d1('0x1f')]);_0x6396fc[_0x16d1('0x1d')]=qs['offset'](_0x364bf7[_0x16d1('0x2d')][_0x16d1('0x1d')]);}_0x6396fc['order']=qs['sort'](_0x364bf7['query'][_0x16d1('0x33')]);_0x6396fc[_0x16d1('0x34')]=qs[_0x16d1('0x2f')](_['pick'](_0x364bf7[_0x16d1('0x2d')],_0x462e5b[_0x16d1('0x2f')]),_0x562908);if(_0x364bf7[_0x16d1('0x2d')][_0x16d1('0x35')]){_0x6396fc[_0x16d1('0x34')]=_[_0x16d1('0x36')](_0x6396fc[_0x16d1('0x34')],{'$or':_['map'](_0x562908,function(_0x50267b){if(_0x50267b['type']!==_0x16d1('0x37')){var _0x2306d3={};_0x2306d3[_0x50267b[_0x16d1('0x25')]]={'$like':'%'+_0x364bf7[_0x16d1('0x2d')][_0x16d1('0x35')]+'%'};return _0x2306d3;}})});}_0x6396fc=_[_0x16d1('0x36')]({},_0x6396fc,_0x364bf7[_0x16d1('0x38')]);var _0x369b1c={'where':_0x6396fc['where']};return db[_0x16d1('0x29')]['count'](_0x369b1c)['then'](function(_0x352c5b){_0x1dd574[_0x16d1('0x39')]=_0x352c5b;if(_0x364bf7[_0x16d1('0x2d')][_0x16d1('0x3a')]){_0x6396fc[_0x16d1('0x3b')]=[{'all':!![]}];}return db[_0x16d1('0x29')]['findAll'](_0x6396fc);})[_0x16d1('0x22')](function(_0x525212){_0x1dd574['rows']=_0x525212;return _0x1dd574;})['then'](respondWithFilteredResult(_0x22e5b3,_0x6396fc))['catch'](handleError(_0x22e5b3,null));};exports[_0x16d1('0x3c')]=function(_0x168e14,_0x24038b){var _0x1eb761={'raw':!![],'where':{'id':_0x168e14[_0x16d1('0x3d')]['id']}},_0x53de06={};_0x53de06['model']=_[_0x16d1('0x2e')](db[_0x16d1('0x29')][_0x16d1('0x2a')]);_0x53de06[_0x16d1('0x2d')]=_[_0x16d1('0x2e')](_0x168e14[_0x16d1('0x2d')]);_0x53de06[_0x16d1('0x2f')]=_[_0x16d1('0x30')](_0x53de06[_0x16d1('0x2c')],_0x53de06[_0x16d1('0x2d')]);_0x1eb761[_0x16d1('0x31')]=_[_0x16d1('0x30')](_0x53de06[_0x16d1('0x2c')],qs[_0x16d1('0x3e')](_0x168e14[_0x16d1('0x2d')]['fields']));_0x1eb761['attributes']=_0x1eb761[_0x16d1('0x31')][_0x16d1('0x32')]?_0x1eb761[_0x16d1('0x31')]:_0x53de06[_0x16d1('0x2c')];if(_0x168e14[_0x16d1('0x2d')][_0x16d1('0x3a')]){_0x1eb761['include']=[{'all':!![]}];}_0x1eb761=_[_0x16d1('0x36')]({},_0x1eb761,_0x168e14[_0x16d1('0x38')]);return db[_0x16d1('0x29')]['find'](_0x1eb761)['then'](handleEntityNotFound(_0x24038b,null))[_0x16d1('0x22')](respondWithResult(_0x24038b,null))[_0x16d1('0x3f')](handleError(_0x24038b,null));};exports['create']=function(_0x1cc137,_0x583151){return db[_0x16d1('0x29')][_0x16d1('0x40')](_0x1cc137[_0x16d1('0x41')],{})[_0x16d1('0x22')](respondWithResult(_0x583151,0xc9))['catch'](handleError(_0x583151,null));};exports['update']=function(_0x1d92cd,_0x8bb0c1){if(_0x1d92cd['body']['id']){delete _0x1d92cd[_0x16d1('0x41')]['id'];}return db[_0x16d1('0x29')][_0x16d1('0x42')]({'where':{'id':_0x1d92cd[_0x16d1('0x3d')]['id']}})[_0x16d1('0x22')](handleEntityNotFound(_0x8bb0c1,null))['then'](saveUpdates(_0x1d92cd[_0x16d1('0x41')],null))['then'](respondWithResult(_0x8bb0c1,null))[_0x16d1('0x3f')](handleError(_0x8bb0c1,null));};exports[_0x16d1('0x23')]=function(_0x5d384c,_0x413acd){return db[_0x16d1('0x29')][_0x16d1('0x42')]({'where':{'id':_0x5d384c[_0x16d1('0x3d')]['id']}})['then'](handleEntityNotFound(_0x413acd,null))['then'](removeEntity(_0x413acd,null))['catch'](handleError(_0x413acd,null));};exports[_0x16d1('0x43')]=function(_0xbf100f,_0x39fd41){return db[_0x16d1('0x29')]['describe']()[_0x16d1('0x22')](respondWithResult(_0x39fd41,null))[_0x16d1('0x3f')](handleError(_0x39fd41,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 321bb41..7408b57 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 _0xd309=['lodash','util','api','moment','request-promise','rimraf','exports','define','MailQueueReport','report_mail_queue','uniqueid'];(function(_0x17f671,_0x3e3865){var _0x34673c=function(_0x261124){while(--_0x261124){_0x17f671['push'](_0x17f671['shift']());}};_0x34673c(++_0x3e3865);}(_0xd309,0x84));var _0x9d30=function(_0x58a3d9,_0x2d50ba){_0x58a3d9=_0x58a3d9-0x0;var _0x49442f=_0xd309[_0x58a3d9];return _0x49442f;};'use strict';var _=require(_0x9d30('0x0'));var util=require(_0x9d30('0x1'));var logger=require('../../config/logger')(_0x9d30('0x2'));var moment=require(_0x9d30('0x3'));var BPromise=require('bluebird');var rp=require(_0x9d30('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9d30('0x5'));var config=require('../../config/environment');var attributes=require('./mailQueueReport.attributes');module[_0x9d30('0x6')]=function(_0x17b33e,_0x5a4bb6){return _0x17b33e[_0x9d30('0x7')](_0x9d30('0x8'),attributes,{'tableName':_0x9d30('0x9'),'paranoid':![],'indexes':[{'name':_0x9d30('0xa'),'fields':[_0x9d30('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6ba7=['exports','define','MailQueueReport','report_mail_queue','uniqueid','util','api','moment','bluebird','request-promise','path','../../config/environment','./mailQueueReport.attributes'];(function(_0x17b23c,_0x423472){var _0x3af1b4=function(_0x34e307){while(--_0x34e307){_0x17b23c['push'](_0x17b23c['shift']());}};_0x3af1b4(++_0x423472);}(_0x6ba7,0x94));var _0x76ba=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6ba7[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x76ba('0x0'));var logger=require('../../config/logger')(_0x76ba('0x1'));var moment=require(_0x76ba('0x2'));var BPromise=require(_0x76ba('0x3'));var rp=require(_0x76ba('0x4'));var fs=require('fs');var path=require(_0x76ba('0x5'));var rimraf=require('rimraf');var config=require(_0x76ba('0x6'));var attributes=require(_0x76ba('0x7'));module[_0x76ba('0x8')]=function(_0x294fd8,_0x5c1f01){return _0x294fd8[_0x76ba('0x9')](_0x76ba('0xa'),attributes,{'tableName':_0x76ba('0xb'),'paranoid':![],'indexes':[{'name':_0x76ba('0xc'),'fields':[_0x76ba('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index efde5eb..5202efa 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 _0x1261=['../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','MailQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateMailQueueReport','body','options','raw','stringify','MailQueueReport','update','where','UpdateMailQueueReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x37d9a9,_0xac62a7){var _0x4f17d5=function(_0x436a12){while(--_0x436a12){_0x37d9a9['push'](_0x37d9a9['shift']());}};_0x4f17d5(++_0xac62a7);}(_0x1261,0x144));var _0x1126=function(_0x1e4150,_0x55b02a){_0x1e4150=_0x1e4150-0x0;var _0x1ce3ee=_0x1261[_0x1e4150];return _0x1ce3ee;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('MailQueueReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}exports[_0x1126('0x15')]=function(_0x4a7b49){var _0x4d2b38=this;return new Promise(function(_0x22ae0b,_0x2b2487){return db['MailQueueReport']['create'](_0x4a7b49[_0x1126('0x16')],{'raw':_0x4a7b49['options']?_0x4a7b49[_0x1126('0x17')][_0x1126('0x18')]===undefined?!![]:![]:!![]})[_0x1126('0xc')](function(_0x54400a){logger[_0x1126('0xd')]('CreateMailQueueReport',_0x4a7b49);logger['debug'](_0x1126('0x15'),_0x4a7b49,JSON[_0x1126('0x19')](_0x54400a));_0x22ae0b(_0x54400a);})[_0x1126('0x14')](function(_0x36d254){logger['error'](_0x1126('0x15'),_0x36d254[_0x1126('0x13')],_0x4a7b49);_0x2b2487(_0x4d2b38['error'](0x1f4,_0x36d254[_0x1126('0x13')]));});});};exports['UpdateMailQueueReport']=function(_0x529dd9){var _0x4b57ab=this;return new Promise(function(_0x2199d9,_0x15bcc3){return db[_0x1126('0x1a')][_0x1126('0x1b')](_0x529dd9[_0x1126('0x16')],{'raw':_0x529dd9[_0x1126('0x17')]?_0x529dd9[_0x1126('0x17')][_0x1126('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x529dd9['options']?_0x529dd9[_0x1126('0x17')][_0x1126('0x1c')]||null:null,'attributes':_0x529dd9[_0x1126('0x17')]?_0x529dd9['options']['attributes']||null:null,'limit':_0x529dd9[_0x1126('0x17')]?_0x529dd9[_0x1126('0x17')]['limit']||null:null})[_0x1126('0xc')](function(_0x23d2bc){logger['info'](_0x1126('0x1d'),_0x529dd9);logger['debug'](_0x1126('0x1d'),_0x529dd9,JSON['stringify'](_0x23d2bc));_0x2199d9(_0x23d2bc);})[_0x1126('0x14')](function(_0x583ce6){logger[_0x1126('0x11')]('UpdateMailQueueReport',_0x583ce6['message'],_0x529dd9);_0x15bcc3(_0x4b57ab['error'](0x1f4,_0x583ce6[_0x1126('0x13')]));});});}; \ 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(_0x21e04a,_0x252aeb){var _0xe763e3=function(_0x4148e3){while(--_0x4148e3){_0x21e04a['push'](_0x21e04a['shift']());}};_0xe763e3(++_0x252aeb);}(_0x7a54,0x106));var _0x47a5=function(_0x55cec8,_0x4239a9){_0x55cec8=_0x55cec8-0x0;var _0x58e361=_0x7a54[_0x55cec8];return _0x58e361;};'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 d0e51a2..1facbba 100644 --- a/server/api/mailServerIn/index.js +++ b/server/api/mailServerIn/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x2b1ebb,_0x3316f8){var _0x1a8955=function(_0x5f5df1){while(--_0x5f5df1){_0x2b1ebb['push'](_0x2b1ebb['shift']());}};_0x1a8955(++_0x3316f8);}(_0x70e0,0x17b));var _0x070e=function(_0x17f7f3,_0x43d6f3){_0x17f7f3=_0x17f7f3-0x0;var _0x2b1f20=_0x70e0[_0x17f7f3];return _0x2b1f20;};'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(_0x2d623d,_0x24487a){var _0x5d7ddb=function(_0xfea6a0){while(--_0xfea6a0){_0x2d623d['push'](_0x2d623d['shift']());}};_0x5d7ddb(++_0x24487a);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index f0a802d..297b24f 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 _0xf0ad=['INTEGER','sequelize','exports','STRING','BOOLEAN'];(function(_0x17aa70,_0x121f9a){var _0x479d40=function(_0x5b66ab){while(--_0x5b66ab){_0x17aa70['push'](_0x17aa70['shift']());}};_0x479d40(++_0x121f9a);}(_0xf0ad,0x9c));var _0xdf0a=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xf0ad[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require(_0xdf0a('0x0'));module[_0xdf0a('0x1')]={'description':{'type':Sequelize[_0xdf0a('0x2')]},'host':{'type':Sequelize[_0xdf0a('0x2')]},'authentication':{'type':Sequelize[_0xdf0a('0x3')],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xdf0a('0x4')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize[_0xdf0a('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xdf0a('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0xdf0a('0x2')]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xb168=['sequelize','STRING','BOOLEAN','INTEGER','INBOX'];(function(_0x3ed091,_0x3491d4){var _0x49f07c=function(_0x296cbc){while(--_0x296cbc){_0x3ed091['push'](_0x3ed091['shift']());}};_0x49f07c(++_0x3491d4);}(_0xb168,0x14a));var _0x8b16=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb168[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x8b16('0x0'));module['exports']={'description':{'type':Sequelize[_0x8b16('0x1')]},'host':{'type':Sequelize[_0x8b16('0x1')]},'authentication':{'type':Sequelize[_0x8b16('0x2')],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x8b16('0x3')]},'tls':{'type':Sequelize[_0x8b16('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x8b16('0x1')],'defaultValue':_0x8b16('0x4')},'connTimeout':{'type':Sequelize[_0x8b16('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x8b16('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0x8b16('0x1')]},'modernAuthentication':{'type':Sequelize[_0x8b16('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index b4f8afe..1e63299 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 _0xff2c=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerIn.attributes','define','MailServerIn','mail_servers_in','lodash'];(function(_0x4d1945,_0x19aa2d){var _0x43290c=function(_0x169d12){while(--_0x169d12){_0x4d1945['push'](_0x4d1945['shift']());}};_0x43290c(++_0x19aa2d);}(_0xff2c,0x1e9));var _0xcff2=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0xff2c[_0x550d12];return _0x12103d;};'use strict';var _=require(_0xcff2('0x0'));var util=require(_0xcff2('0x1'));var logger=require(_0xcff2('0x2'))(_0xcff2('0x3'));var moment=require(_0xcff2('0x4'));var BPromise=require(_0xcff2('0x5'));var rp=require(_0xcff2('0x6'));var fs=require('fs');var path=require(_0xcff2('0x7'));var rimraf=require(_0xcff2('0x8'));var config=require(_0xcff2('0x9'));var attributes=require(_0xcff2('0xa'));module['exports']=function(_0x54d172,_0x293793){return _0x54d172[_0xcff2('0xb')](_0xcff2('0xc'),attributes,{'tableName':_0xcff2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1482=['rimraf','../../config/environment','./mailServerIn.attributes','exports','define','MailServerIn','mail_servers_in','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x1482,0x18f));var _0x2148=function(_0x184413,_0x337fd6){_0x184413=_0x184413-0x0;var _0x434fbe=_0x1482[_0x184413];return _0x434fbe;};'use strict';var _=require(_0x2148('0x0'));var util=require(_0x2148('0x1'));var logger=require('../../config/logger')(_0x2148('0x2'));var moment=require(_0x2148('0x3'));var BPromise=require(_0x2148('0x4'));var rp=require(_0x2148('0x5'));var fs=require('fs');var path=require(_0x2148('0x6'));var rimraf=require(_0x2148('0x7'));var config=require(_0x2148('0x8'));var attributes=require(_0x2148('0x9'));module[_0x2148('0xa')]=function(_0x479acb,_0x43c01e){return _0x479acb[_0x2148('0xb')](_0x2148('0xc'),attributes,{'tableName':_0x2148('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.rpc.js b/server/api/mailServerIn/mailServerIn.rpc.js index 5e27aff..5d7bdb0 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 _0xed4b=['MailServerIn,\x20%s,\x20%s','debug','MailServerIn,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','GetMailServerIn','MailServerIn','findAll','options','raw','limit','map','include','model','attributes','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x1afd36,_0x447b43){var _0x59e59f=function(_0x4b71ba){while(--_0x4b71ba){_0x1afd36['push'](_0x1afd36['shift']());}};_0x59e59f(++_0x447b43);}(_0xed4b,0x96));var _0xbed4=function(_0x5c5da8,_0x16baec){_0x5c5da8=_0x5c5da8-0x0;var _0x720b8b=_0xed4b[_0x5c5da8];return _0x720b8b;};'use strict';var _=require(_0xbed4('0x0'));var util=require(_0xbed4('0x1'));var moment=require(_0xbed4('0x2'));var BPromise=require('bluebird');var rs=require(_0xbed4('0x3'));var fs=require('fs');var Redis=require(_0xbed4('0x4'));var db=require(_0xbed4('0x5'))['db'];var utils=require(_0xbed4('0x6'));var logger=require(_0xbed4('0x7'))(_0xbed4('0x8'));var config=require('../../config/environment');var jayson=require(_0xbed4('0x9'));var client=jayson[_0xbed4('0xa')][_0xbed4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x272560,_0x303394,_0x413e70){return new BPromise(function(_0x112c5d,_0xb635b3){return client[_0xbed4('0xc')](_0x272560,_0x413e70)[_0xbed4('0xd')](function(_0x4813a9){logger[_0xbed4('0xe')](_0xbed4('0xf'),_0x303394,'request\x20sent');logger[_0xbed4('0x10')](_0xbed4('0x11'),_0x303394,'request\x20sent',JSON['stringify'](_0x4813a9));if(_0x4813a9['error']){if(_0x4813a9[_0xbed4('0x12')][_0xbed4('0x13')]===0x1f4){logger[_0xbed4('0x12')](_0xbed4('0xf'),_0x303394,_0x4813a9[_0xbed4('0x12')][_0xbed4('0x14')]);return _0xb635b3(_0x4813a9[_0xbed4('0x12')]['message']);}logger[_0xbed4('0x12')](_0xbed4('0xf'),_0x303394,_0x4813a9[_0xbed4('0x12')]['message']);return _0x112c5d(_0x4813a9[_0xbed4('0x12')][_0xbed4('0x14')]);}else{logger[_0xbed4('0xe')](_0xbed4('0xf'),_0x303394,_0xbed4('0x15'));_0x112c5d(_0x4813a9['result']['message']);}})['catch'](function(_0xbada41){logger['error']('MailServerIn,\x20%s,\x20%s',_0x303394,_0xbada41);_0xb635b3(_0xbada41);});});}exports[_0xbed4('0x16')]=function(_0x540b){var _0x4e80dc=this;return new Promise(function(_0x483474,_0x3e6120){return db[_0xbed4('0x17')][_0xbed4('0x18')]({'raw':_0x540b[_0xbed4('0x19')]?_0x540b[_0xbed4('0x19')][_0xbed4('0x1a')]===undefined?!![]:![]:!![],'where':_0x540b[_0xbed4('0x19')]?_0x540b[_0xbed4('0x19')]['where']||null:null,'attributes':_0x540b[_0xbed4('0x19')]?_0x540b[_0xbed4('0x19')]['attributes']||null:null,'limit':_0x540b['options']?_0x540b[_0xbed4('0x19')][_0xbed4('0x1b')]||null:null,'include':_0x540b['options']?_0x540b[_0xbed4('0x19')]['include']?_[_0xbed4('0x1c')](_0x540b['options'][_0xbed4('0x1d')],function(_0x593791){return{'model':db[_0x593791[_0xbed4('0x1e')]],'as':_0x593791['as'],'attributes':_0x593791[_0xbed4('0x1f')],'include':_0x593791[_0xbed4('0x1d')]?_['map'](_0x593791[_0xbed4('0x1d')],function(_0x419ea6){return{'model':db[_0x419ea6['model']],'as':_0x419ea6['as'],'attributes':_0x419ea6[_0xbed4('0x1f')],'include':_0x419ea6['include']?_['map'](_0x419ea6[_0xbed4('0x1d')],function(_0x1bce2c){return{'model':db[_0x1bce2c[_0xbed4('0x1e')]],'as':_0x1bce2c['as'],'attributes':_0x1bce2c[_0xbed4('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4bdee8){logger[_0xbed4('0xe')](_0xbed4('0x16'),_0x540b);logger['debug'](_0xbed4('0x16'),_0x540b,JSON['stringify'](_0x4bdee8));_0x483474(_0x4bdee8);})[_0xbed4('0x20')](function(_0x4484f7){logger['error'](_0xbed4('0x16'),_0x4484f7['message'],_0x540b);_0x3e6120(_0x4e80dc[_0xbed4('0x12')](0x1f4,_0x4484f7[_0xbed4('0x14')]));});});}; \ No newline at end of file +var _0xdb06=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','request\x20sent','MailServerIn,\x20%s,\x20%s,\x20%s','error','code','MailServerIn,\x20%s,\x20%s','message','result','catch','GetMailServerIn','MailServerIn','findAll','options','raw','where','limit','map','include','model','attributes','debug','lodash','util','moment','randomstring'];(function(_0x4c5202,_0x2c17df){var _0x3a30c1=function(_0x432f28){while(--_0x432f28){_0x4c5202['push'](_0x4c5202['shift']());}};_0x3a30c1(++_0x2c17df);}(_0xdb06,0x194));var _0x6db0=function(_0x52fa31,_0x322c91){_0x52fa31=_0x52fa31-0x0;var _0x52ea24=_0xdb06[_0x52fa31];return _0x52ea24;};'use strict';var _=require(_0x6db0('0x0'));var util=require(_0x6db0('0x1'));var moment=require(_0x6db0('0x2'));var BPromise=require('bluebird');var rs=require(_0x6db0('0x3'));var fs=require('fs');var Redis=require(_0x6db0('0x4'));var db=require(_0x6db0('0x5'))['db'];var utils=require(_0x6db0('0x6'));var logger=require('../../config/logger')(_0x6db0('0x7'));var config=require(_0x6db0('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6db0('0x9')][_0x6db0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x53af74,_0x52e26f,_0x3f76fe){return new BPromise(function(_0x397fc6,_0x4d6c2f){return client[_0x6db0('0xb')](_0x53af74,_0x3f76fe)[_0x6db0('0xc')](function(_0x179000){logger[_0x6db0('0xd')]('MailServerIn,\x20%s,\x20%s',_0x52e26f,_0x6db0('0xe'));logger['debug'](_0x6db0('0xf'),_0x52e26f,_0x6db0('0xe'),JSON['stringify'](_0x179000));if(_0x179000[_0x6db0('0x10')]){if(_0x179000[_0x6db0('0x10')][_0x6db0('0x11')]===0x1f4){logger[_0x6db0('0x10')](_0x6db0('0x12'),_0x52e26f,_0x179000['error'][_0x6db0('0x13')]);return _0x4d6c2f(_0x179000[_0x6db0('0x10')][_0x6db0('0x13')]);}logger['error'](_0x6db0('0x12'),_0x52e26f,_0x179000[_0x6db0('0x10')][_0x6db0('0x13')]);return _0x397fc6(_0x179000[_0x6db0('0x10')]['message']);}else{logger[_0x6db0('0xd')](_0x6db0('0x12'),_0x52e26f,'request\x20sent');_0x397fc6(_0x179000[_0x6db0('0x14')][_0x6db0('0x13')]);}})[_0x6db0('0x15')](function(_0x38d1d3){logger[_0x6db0('0x10')]('MailServerIn,\x20%s,\x20%s',_0x52e26f,_0x38d1d3);_0x4d6c2f(_0x38d1d3);});});}exports[_0x6db0('0x16')]=function(_0x4a245a){var _0x1efde7=this;return new Promise(function(_0x530230,_0x27f7b6){return db[_0x6db0('0x17')][_0x6db0('0x18')]({'raw':_0x4a245a[_0x6db0('0x19')]?_0x4a245a[_0x6db0('0x19')][_0x6db0('0x1a')]===undefined?!![]:![]:!![],'where':_0x4a245a['options']?_0x4a245a[_0x6db0('0x19')][_0x6db0('0x1b')]||null:null,'attributes':_0x4a245a[_0x6db0('0x19')]?_0x4a245a[_0x6db0('0x19')]['attributes']||null:null,'limit':_0x4a245a[_0x6db0('0x19')]?_0x4a245a[_0x6db0('0x19')][_0x6db0('0x1c')]||null:null,'include':_0x4a245a['options']?_0x4a245a['options']['include']?_[_0x6db0('0x1d')](_0x4a245a['options'][_0x6db0('0x1e')],function(_0x4d4162){return{'model':db[_0x4d4162[_0x6db0('0x1f')]],'as':_0x4d4162['as'],'attributes':_0x4d4162['attributes'],'include':_0x4d4162[_0x6db0('0x1e')]?_[_0x6db0('0x1d')](_0x4d4162[_0x6db0('0x1e')],function(_0x2ea92a){return{'model':db[_0x2ea92a[_0x6db0('0x1f')]],'as':_0x2ea92a['as'],'attributes':_0x2ea92a[_0x6db0('0x20')],'include':_0x2ea92a['include']?_[_0x6db0('0x1d')](_0x2ea92a[_0x6db0('0x1e')],function(_0x146e46){return{'model':db[_0x146e46['model']],'as':_0x146e46['as'],'attributes':_0x146e46[_0x6db0('0x20')]};}):[]};}):[]};}):[]:[]})[_0x6db0('0xc')](function(_0x18a791){logger[_0x6db0('0xd')]('GetMailServerIn',_0x4a245a);logger[_0x6db0('0x21')](_0x6db0('0x16'),_0x4a245a,JSON['stringify'](_0x18a791));_0x530230(_0x18a791);})[_0x6db0('0x15')](function(_0x22eb49){logger[_0x6db0('0x10')](_0x6db0('0x16'),_0x22eb49['message'],_0x4a245a);_0x27f7b6(_0x1efde7[_0x6db0('0x10')](0x1f4,_0x22eb49[_0x6db0('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 1bdcdd3..5fec2b2 100644 --- a/server/api/mailServerOut/index.js +++ b/server/api/mailServerOut/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7a54,0x106));var _0x47a5=function(_0x58d5e6,_0x1022a5){_0x58d5e6=_0x58d5e6-0x0;var _0x5573ae=_0x7a54[_0x58d5e6];return _0x5573ae;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file +var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x7a54,0x106));var _0x47a5=function(_0x10c987,_0x3c6496){_0x10c987=_0x10c987-0x0;var _0x65de18=_0x7a54[_0x10c987];return _0x65de18;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index 82824a6..3addef9 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 _0xdd4f=['sequelize','STRING','BOOLEAN'];(function(_0x6aeb25,_0x16d37a){var _0xeac2f8=function(_0x1c4014){while(--_0x1c4014){_0x6aeb25['push'](_0x6aeb25['shift']());}};_0xeac2f8(++_0x16d37a);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0xddbdfe,_0xd8148e){_0xddbdfe=_0xddbdfe-0x0;var _0x987edc=_0xdd4f[_0xddbdfe];return _0x987edc;};'use strict';var Sequelize=require(_0xfdd4('0x0'));module['exports']={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize[_0xfdd4('0x1')]},'pass':{'type':Sequelize[_0xfdd4('0x1')]},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize[_0xfdd4('0x2')],'defaultValue':![]},'service':{'type':Sequelize[_0xfdd4('0x1')]},'authentication':{'type':Sequelize[_0xfdd4('0x2')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x4483=['exports','STRING','INTEGER','BOOLEAN','sequelize'];(function(_0x4d170c,_0x4aac8c){var _0x2e014e=function(_0x2e2c36){while(--_0x2e2c36){_0x4d170c['push'](_0x4d170c['shift']());}};_0x2e014e(++_0x4aac8c);}(_0x4483,0x1a3));var _0x3448=function(_0xe149dc,_0x14d2f5){_0xe149dc=_0xe149dc-0x0;var _0x12c6c7=_0x4483[_0xe149dc];return _0x12c6c7;};'use strict';var Sequelize=require(_0x3448('0x0'));module[_0x3448('0x1')]={'description':{'type':Sequelize[_0x3448('0x2')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize[_0x3448('0x2')]},'pass':{'type':Sequelize[_0x3448('0x2')]},'port':{'type':Sequelize[_0x3448('0x3')]},'secure':{'type':Sequelize[_0x3448('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0x3448('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x3448('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index 89c438e..fbb5cea 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 _0xd438=['limit','set','Content-Range','apply','reject','save','name','send','map','rawAttributes','type','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','MailServerOut','include','findAll','then','rows','catch','includeAll','create','body','find','params','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count'];(function(_0x2305b2,_0x3890af){var _0x10679f=function(_0x156942){while(--_0x156942){_0x2305b2['push'](_0x2305b2['shift']());}};_0x10679f(++_0x3890af);}(_0xd438,0x151));var _0x8d43=function(_0x5466ab,_0x227b13){_0x5466ab=_0x5466ab-0x0;var _0x40751a=_0xd438[_0x5466ab];return _0x40751a;};'use strict';var emlformat=require(_0x8d43('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8d43('0x1'));var jsonpatch=require(_0x8d43('0x2'));var rp=require(_0x8d43('0x3'));var moment=require(_0x8d43('0x4'));var BPromise=require(_0x8d43('0x5'));var Mustache=require(_0x8d43('0x6'));var util=require('util');var path=require(_0x8d43('0x7'));var sox=require(_0x8d43('0x8'));var csv=require(_0x8d43('0x9'));var ejs=require(_0x8d43('0xa'));var fs=require('fs');var fs_extra=require(_0x8d43('0xb'));var _=require(_0x8d43('0xc'));var squel=require(_0x8d43('0xd'));var crypto=require(_0x8d43('0xe'));var jsforce=require(_0x8d43('0xf'));var deskjs=require(_0x8d43('0x10'));var toCsv=require(_0x8d43('0x9'));var querystring=require('querystring');var Papa=require(_0x8d43('0x11'));var Redis=require(_0x8d43('0x12'));var authService=require(_0x8d43('0x13'));var qs=require(_0x8d43('0x14'));var as=require(_0x8d43('0x15'));var hardwareService=require(_0x8d43('0x16'));var logger=require('../../config/logger')(_0x8d43('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x8d43('0x18'));var db=require(_0x8d43('0x19'))['db'];function respondWithStatusCode(_0x46cf06,_0x59d7ae){_0x59d7ae=_0x59d7ae||0xcc;return function(_0x171f4d){if(_0x171f4d){return _0x46cf06[_0x8d43('0x1a')](_0x59d7ae);}return _0x46cf06[_0x8d43('0x1b')](_0x59d7ae)[_0x8d43('0x1c')]();};}function respondWithResult(_0xc4a5c9,_0x315ae0){_0x315ae0=_0x315ae0||0xc8;return function(_0x13cdd4){if(_0x13cdd4){return _0xc4a5c9[_0x8d43('0x1b')](_0x315ae0)[_0x8d43('0x1d')](_0x13cdd4);}};}function respondWithFilteredResult(_0x37859e,_0x3194ef){return function(_0x5b7e2e){if(_0x5b7e2e){var _0x5ab0b9=typeof _0x3194ef[_0x8d43('0x1e')]===_0x8d43('0x1f')&&typeof _0x3194ef['limit']===_0x8d43('0x1f');var _0x5e381a=_0x5b7e2e[_0x8d43('0x20')];var _0x4187f1=_0x5ab0b9?0x0:_0x3194ef[_0x8d43('0x1e')];var _0x64ecb1=_0x5ab0b9?_0x5b7e2e[_0x8d43('0x20')]:_0x3194ef['offset']+_0x3194ef[_0x8d43('0x21')];var _0x2e19ee;if(_0x64ecb1>=_0x5e381a){_0x64ecb1=_0x5e381a;_0x2e19ee=0xc8;}else{_0x2e19ee=0xce;}_0x37859e[_0x8d43('0x1b')](_0x2e19ee);return _0x37859e[_0x8d43('0x22')](_0x8d43('0x23'),_0x4187f1+'-'+_0x64ecb1+'/'+_0x5e381a)[_0x8d43('0x1d')](_0x5b7e2e);}return null;};}function patchUpdates(_0x40b06c){return function(_0x1b1bb2){try{jsonpatch[_0x8d43('0x24')](_0x1b1bb2,_0x40b06c,!![]);}catch(_0x1e4841){return BPromise[_0x8d43('0x25')](_0x1e4841);}return _0x1b1bb2[_0x8d43('0x26')]();};}function saveUpdates(_0x54f21c,_0x344830){return function(_0x212516){if(_0x212516){return _0x212516['update'](_0x54f21c)['then'](function(_0x1203f1){return _0x1203f1;});}return null;};}function removeEntity(_0xc1ef9f,_0x2c841a){return function(_0xad1867){if(_0xad1867){return _0xad1867['destroy']()['then'](function(){_0xc1ef9f[_0x8d43('0x1b')](0xcc)[_0x8d43('0x1c')]();});}};}function handleEntityNotFound(_0x167c92,_0x2d0986){return function(_0x1fe369){if(!_0x1fe369){_0x167c92[_0x8d43('0x1a')](0x194);}return _0x1fe369;};}function handleError(_0x46055e,_0xfbfd00){_0xfbfd00=_0xfbfd00||0x1f4;return function(_0x15cf5f){logger['error'](_0x15cf5f['stack']);if(_0x15cf5f[_0x8d43('0x27')]){delete _0x15cf5f['name'];}_0x46055e[_0x8d43('0x1b')](_0xfbfd00)[_0x8d43('0x28')](_0x15cf5f);};}exports['index']=function(_0x5bbe45,_0x4bfca7){var _0x1f1e65={},_0x3bf0fc={},_0x5e9f3e={'count':0x0,'rows':[]};var _0x2d5079=_[_0x8d43('0x29')](db['MailServerOut'][_0x8d43('0x2a')],function(_0x3e56b5){return{'name':_0x3e56b5['fieldName'],'type':_0x3e56b5[_0x8d43('0x2b')]['key']};});_0x3bf0fc[_0x8d43('0x2c')]=_[_0x8d43('0x29')](_0x2d5079,_0x8d43('0x27'));_0x3bf0fc['query']=_[_0x8d43('0x2d')](_0x5bbe45[_0x8d43('0x2e')]);_0x3bf0fc[_0x8d43('0x2f')]=_['intersection'](_0x3bf0fc['model'],_0x3bf0fc[_0x8d43('0x2e')]);_0x1f1e65[_0x8d43('0x30')]=_[_0x8d43('0x31')](_0x3bf0fc[_0x8d43('0x2c')],qs[_0x8d43('0x32')](_0x5bbe45[_0x8d43('0x2e')][_0x8d43('0x32')]));_0x1f1e65[_0x8d43('0x30')]=_0x1f1e65[_0x8d43('0x30')][_0x8d43('0x33')]?_0x1f1e65[_0x8d43('0x30')]:_0x3bf0fc[_0x8d43('0x2c')];if(!_0x5bbe45['query'][_0x8d43('0x34')](_0x8d43('0x35'))){_0x1f1e65[_0x8d43('0x21')]=qs['limit'](_0x5bbe45[_0x8d43('0x2e')][_0x8d43('0x21')]);_0x1f1e65['offset']=qs[_0x8d43('0x1e')](_0x5bbe45[_0x8d43('0x2e')][_0x8d43('0x1e')]);}_0x1f1e65[_0x8d43('0x36')]=qs[_0x8d43('0x37')](_0x5bbe45['query'][_0x8d43('0x37')]);_0x1f1e65[_0x8d43('0x38')]=qs['filters'](_[_0x8d43('0x39')](_0x5bbe45[_0x8d43('0x2e')],_0x3bf0fc['filters']),_0x2d5079);if(_0x5bbe45[_0x8d43('0x2e')][_0x8d43('0x3a')]){_0x1f1e65[_0x8d43('0x38')]=_[_0x8d43('0x3b')](_0x1f1e65[_0x8d43('0x38')],{'$or':_['map'](_0x2d5079,function(_0x185604){if(_0x185604[_0x8d43('0x2b')]!==_0x8d43('0x3c')){var _0x94e7f4={};_0x94e7f4[_0x185604[_0x8d43('0x27')]]={'$like':'%'+_0x5bbe45['query'][_0x8d43('0x3a')]+'%'};return _0x94e7f4;}})});}_0x1f1e65=_[_0x8d43('0x3b')]({},_0x1f1e65,_0x5bbe45[_0x8d43('0x3d')]);var _0x47f171={'where':_0x1f1e65[_0x8d43('0x38')]};return db[_0x8d43('0x3e')][_0x8d43('0x20')](_0x47f171)['then'](function(_0x33d7da){_0x5e9f3e[_0x8d43('0x20')]=_0x33d7da;if(_0x5bbe45[_0x8d43('0x2e')]['includeAll']){_0x1f1e65[_0x8d43('0x3f')]=[{'all':!![]}];}return db['MailServerOut'][_0x8d43('0x40')](_0x1f1e65);})[_0x8d43('0x41')](function(_0x56eb68){_0x5e9f3e[_0x8d43('0x42')]=_0x56eb68;return _0x5e9f3e;})[_0x8d43('0x41')](respondWithFilteredResult(_0x4bfca7,_0x1f1e65))[_0x8d43('0x43')](handleError(_0x4bfca7,null));};exports['show']=function(_0x19b48f,_0x4d5fbe){var _0x3167b8={'raw':!![],'where':{'id':_0x19b48f['params']['id']}},_0x5cd1ff={};_0x5cd1ff['model']=_[_0x8d43('0x2d')](db[_0x8d43('0x3e')]['rawAttributes']);_0x5cd1ff[_0x8d43('0x2e')]=_[_0x8d43('0x2d')](_0x19b48f[_0x8d43('0x2e')]);_0x5cd1ff[_0x8d43('0x2f')]=_['intersection'](_0x5cd1ff[_0x8d43('0x2c')],_0x5cd1ff['query']);_0x3167b8[_0x8d43('0x30')]=_['intersection'](_0x5cd1ff[_0x8d43('0x2c')],qs['fields'](_0x19b48f[_0x8d43('0x2e')][_0x8d43('0x32')]));_0x3167b8[_0x8d43('0x30')]=_0x3167b8[_0x8d43('0x30')][_0x8d43('0x33')]?_0x3167b8[_0x8d43('0x30')]:_0x5cd1ff[_0x8d43('0x2c')];if(_0x19b48f[_0x8d43('0x2e')][_0x8d43('0x44')]){_0x3167b8[_0x8d43('0x3f')]=[{'all':!![]}];}_0x3167b8=_[_0x8d43('0x3b')]({},_0x3167b8,_0x19b48f[_0x8d43('0x3d')]);return db['MailServerOut']['find'](_0x3167b8)[_0x8d43('0x41')](handleEntityNotFound(_0x4d5fbe,null))[_0x8d43('0x41')](respondWithResult(_0x4d5fbe,null))[_0x8d43('0x43')](handleError(_0x4d5fbe,null));};exports[_0x8d43('0x45')]=function(_0xe773fc,_0x166300){return db['MailServerOut'][_0x8d43('0x45')](_0xe773fc[_0x8d43('0x46')],{})[_0x8d43('0x41')](respondWithResult(_0x166300,0xc9))['catch'](handleError(_0x166300,null));};exports['update']=function(_0x40c6fc,_0x479dbc){if(_0x40c6fc[_0x8d43('0x46')]['id']){delete _0x40c6fc[_0x8d43('0x46')]['id'];}return db['MailServerOut'][_0x8d43('0x47')]({'where':{'id':_0x40c6fc[_0x8d43('0x48')]['id']}})[_0x8d43('0x41')](handleEntityNotFound(_0x479dbc,null))[_0x8d43('0x41')](saveUpdates(_0x40c6fc[_0x8d43('0x46')],null))[_0x8d43('0x41')](respondWithResult(_0x479dbc,null))[_0x8d43('0x43')](handleError(_0x479dbc,null));};exports[_0x8d43('0x49')]=function(_0x5e00b3,_0x2e0071){return db[_0x8d43('0x3e')]['find']({'where':{'id':_0x5e00b3['params']['id']}})[_0x8d43('0x41')](handleEntityNotFound(_0x2e0071,null))[_0x8d43('0x41')](removeEntity(_0x2e0071,null))[_0x8d43('0x43')](handleError(_0x2e0071,null));}; \ No newline at end of file +var _0x9843=['nolimit','sort','where','filter','merge','VIRTUAL','options','MailServerOut','includeAll','include','findAll','show','params','rawAttributes','length','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','lodash','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','map','fieldName','type','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty'];(function(_0x1f647d,_0x517668){var _0x3de573=function(_0x1cc9c9){while(--_0x1cc9c9){_0x1f647d['push'](_0x1f647d['shift']());}};_0x3de573(++_0x517668);}(_0x9843,0x1c9));var _0x3984=function(_0x447a9f,_0x48619b){_0x447a9f=_0x447a9f-0x0;var _0x1286fc=_0x9843[_0x447a9f];return _0x1286fc;};'use strict';var emlformat=require(_0x3984('0x0'));var rimraf=require(_0x3984('0x1'));var zipdir=require(_0x3984('0x2'));var jsonpatch=require(_0x3984('0x3'));var rp=require(_0x3984('0x4'));var moment=require('moment');var BPromise=require(_0x3984('0x5'));var Mustache=require('mustache');var util=require(_0x3984('0x6'));var path=require(_0x3984('0x7'));var sox=require('sox');var csv=require(_0x3984('0x8'));var ejs=require(_0x3984('0x9'));var fs=require('fs');var fs_extra=require(_0x3984('0xa'));var _=require(_0x3984('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3984('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x3984('0x8'));var querystring=require(_0x3984('0xd'));var Papa=require('papaparse');var Redis=require(_0x3984('0xe'));var authService=require(_0x3984('0xf'));var qs=require(_0x3984('0x10'));var as=require(_0x3984('0x11'));var hardwareService=require(_0x3984('0x12'));var logger=require('../../config/logger')(_0x3984('0x13'));var utils=require(_0x3984('0x14'));var config=require(_0x3984('0x15'));var licenseUtil=require(_0x3984('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb0f543,_0x191699){_0x191699=_0x191699||0xcc;return function(_0x4eb09a){if(_0x4eb09a){return _0xb0f543[_0x3984('0x17')](_0x191699);}return _0xb0f543[_0x3984('0x18')](_0x191699)[_0x3984('0x19')]();};}function respondWithResult(_0x56a86e,_0x512dac){_0x512dac=_0x512dac||0xc8;return function(_0x3c5860){if(_0x3c5860){return _0x56a86e['status'](_0x512dac)[_0x3984('0x1a')](_0x3c5860);}};}function respondWithFilteredResult(_0x179441,_0x5a9485){return function(_0xe30772){if(_0xe30772){var _0x306313=typeof _0x5a9485[_0x3984('0x1b')]===_0x3984('0x1c')&&typeof _0x5a9485[_0x3984('0x1d')]===_0x3984('0x1c');var _0x1522e0=_0xe30772['count'];var _0x1af28b=_0x306313?0x0:_0x5a9485[_0x3984('0x1b')];var _0xfe46b1=_0x306313?_0xe30772[_0x3984('0x1e')]:_0x5a9485[_0x3984('0x1b')]+_0x5a9485[_0x3984('0x1d')];var _0x589949;if(_0xfe46b1>=_0x1522e0){_0xfe46b1=_0x1522e0;_0x589949=0xc8;}else{_0x589949=0xce;}_0x179441['status'](_0x589949);return _0x179441[_0x3984('0x1f')](_0x3984('0x20'),_0x1af28b+'-'+_0xfe46b1+'/'+_0x1522e0)[_0x3984('0x1a')](_0xe30772);}return null;};}function patchUpdates(_0x39549f){return function(_0x2b3d97){try{jsonpatch[_0x3984('0x21')](_0x2b3d97,_0x39549f,!![]);}catch(_0x4e57c7){return BPromise[_0x3984('0x22')](_0x4e57c7);}return _0x2b3d97[_0x3984('0x23')]();};}function saveUpdates(_0x1d01f7,_0x8ef9ff){return function(_0x55473c){if(_0x55473c){return _0x55473c[_0x3984('0x24')](_0x1d01f7)['then'](function(_0x11febc){return _0x11febc;});}return null;};}function removeEntity(_0x22ccf4,_0x48264b){return function(_0x3c8681){if(_0x3c8681){return _0x3c8681[_0x3984('0x25')]()[_0x3984('0x26')](function(){_0x22ccf4[_0x3984('0x18')](0xcc)[_0x3984('0x19')]();});}};}function handleEntityNotFound(_0x4d1f62,_0x2ae6e4){return function(_0x184f56){if(!_0x184f56){_0x4d1f62[_0x3984('0x17')](0x194);}return _0x184f56;};}function handleError(_0x43ffea,_0x59e12){_0x59e12=_0x59e12||0x1f4;return function(_0x5c79b3){logger[_0x3984('0x27')](_0x5c79b3[_0x3984('0x28')]);if(_0x5c79b3[_0x3984('0x29')]){delete _0x5c79b3[_0x3984('0x29')];}_0x43ffea[_0x3984('0x18')](_0x59e12)[_0x3984('0x2a')](_0x5c79b3);};}exports['index']=function(_0x3892a0,_0x324e4f){var _0x3bf992={},_0x1d1043={},_0x539609={'count':0x0,'rows':[]};var _0x538886=_[_0x3984('0x2b')](db['MailServerOut']['rawAttributes'],function(_0x3783b0){return{'name':_0x3783b0[_0x3984('0x2c')],'type':_0x3783b0[_0x3984('0x2d')]['key']};});_0x1d1043['model']=_[_0x3984('0x2b')](_0x538886,'name');_0x1d1043[_0x3984('0x2e')]=_[_0x3984('0x2f')](_0x3892a0[_0x3984('0x2e')]);_0x1d1043[_0x3984('0x30')]=_['intersection'](_0x1d1043[_0x3984('0x31')],_0x1d1043['query']);_0x3bf992[_0x3984('0x32')]=_[_0x3984('0x33')](_0x1d1043['model'],qs['fields'](_0x3892a0[_0x3984('0x2e')][_0x3984('0x34')]));_0x3bf992[_0x3984('0x32')]=_0x3bf992[_0x3984('0x32')]['length']?_0x3bf992[_0x3984('0x32')]:_0x1d1043[_0x3984('0x31')];if(!_0x3892a0[_0x3984('0x2e')][_0x3984('0x35')](_0x3984('0x36'))){_0x3bf992[_0x3984('0x1d')]=qs[_0x3984('0x1d')](_0x3892a0[_0x3984('0x2e')]['limit']);_0x3bf992[_0x3984('0x1b')]=qs['offset'](_0x3892a0[_0x3984('0x2e')][_0x3984('0x1b')]);}_0x3bf992['order']=qs[_0x3984('0x37')](_0x3892a0[_0x3984('0x2e')][_0x3984('0x37')]);_0x3bf992[_0x3984('0x38')]=qs[_0x3984('0x30')](_['pick'](_0x3892a0['query'],_0x1d1043[_0x3984('0x30')]),_0x538886);if(_0x3892a0[_0x3984('0x2e')][_0x3984('0x39')]){_0x3bf992[_0x3984('0x38')]=_[_0x3984('0x3a')](_0x3bf992['where'],{'$or':_[_0x3984('0x2b')](_0x538886,function(_0x1dd4d6){if(_0x1dd4d6[_0x3984('0x2d')]!==_0x3984('0x3b')){var _0x26e6c2={};_0x26e6c2[_0x1dd4d6[_0x3984('0x29')]]={'$like':'%'+_0x3892a0[_0x3984('0x2e')]['filter']+'%'};return _0x26e6c2;}})});}_0x3bf992=_[_0x3984('0x3a')]({},_0x3bf992,_0x3892a0[_0x3984('0x3c')]);var _0x47a132={'where':_0x3bf992[_0x3984('0x38')]};return db[_0x3984('0x3d')]['count'](_0x47a132)['then'](function(_0x2444ac){_0x539609[_0x3984('0x1e')]=_0x2444ac;if(_0x3892a0[_0x3984('0x2e')][_0x3984('0x3e')]){_0x3bf992[_0x3984('0x3f')]=[{'all':!![]}];}return db[_0x3984('0x3d')][_0x3984('0x40')](_0x3bf992);})[_0x3984('0x26')](function(_0x46951b){_0x539609['rows']=_0x46951b;return _0x539609;})['then'](respondWithFilteredResult(_0x324e4f,_0x3bf992))['catch'](handleError(_0x324e4f,null));};exports[_0x3984('0x41')]=function(_0x28d3dd,_0x2259c6){var _0x25d0e6={'raw':!![],'where':{'id':_0x28d3dd[_0x3984('0x42')]['id']}},_0x2f2276={};_0x2f2276[_0x3984('0x31')]=_['keys'](db[_0x3984('0x3d')][_0x3984('0x43')]);_0x2f2276['query']=_[_0x3984('0x2f')](_0x28d3dd[_0x3984('0x2e')]);_0x2f2276[_0x3984('0x30')]=_['intersection'](_0x2f2276[_0x3984('0x31')],_0x2f2276['query']);_0x25d0e6[_0x3984('0x32')]=_[_0x3984('0x33')](_0x2f2276[_0x3984('0x31')],qs[_0x3984('0x34')](_0x28d3dd[_0x3984('0x2e')][_0x3984('0x34')]));_0x25d0e6['attributes']=_0x25d0e6[_0x3984('0x32')][_0x3984('0x44')]?_0x25d0e6['attributes']:_0x2f2276[_0x3984('0x31')];if(_0x28d3dd[_0x3984('0x2e')][_0x3984('0x3e')]){_0x25d0e6[_0x3984('0x3f')]=[{'all':!![]}];}_0x25d0e6=_['merge']({},_0x25d0e6,_0x28d3dd['options']);return db[_0x3984('0x3d')][_0x3984('0x45')](_0x25d0e6)[_0x3984('0x26')](handleEntityNotFound(_0x2259c6,null))[_0x3984('0x26')](respondWithResult(_0x2259c6,null))[_0x3984('0x46')](handleError(_0x2259c6,null));};exports['create']=function(_0x34adda,_0x14859a){return db[_0x3984('0x3d')][_0x3984('0x47')](_0x34adda[_0x3984('0x48')],{})[_0x3984('0x26')](respondWithResult(_0x14859a,0xc9))['catch'](handleError(_0x14859a,null));};exports[_0x3984('0x24')]=function(_0x54f957,_0x32681d){if(_0x54f957[_0x3984('0x48')]['id']){delete _0x54f957['body']['id'];}return db[_0x3984('0x3d')][_0x3984('0x45')]({'where':{'id':_0x54f957[_0x3984('0x42')]['id']}})[_0x3984('0x26')](handleEntityNotFound(_0x32681d,null))[_0x3984('0x26')](saveUpdates(_0x54f957[_0x3984('0x48')],null))['then'](respondWithResult(_0x32681d,null))['catch'](handleError(_0x32681d,null));};exports['destroy']=function(_0x43f8ff,_0x348b88){return db['MailServerOut'][_0x3984('0x45')]({'where':{'id':_0x43f8ff[_0x3984('0x42')]['id']}})[_0x3984('0x26')](handleEntityNotFound(_0x348b88,null))['then'](removeEntity(_0x348b88,null))[_0x3984('0x46')](handleError(_0x348b88,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index fe25360..71eb4fe 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 _0x3402=['exports','MailServerOut','mail_servers_out','../../config/logger','api','path','rimraf','./mailServerOut.attributes'];(function(_0x2f5faa,_0x5baf6b){var _0x5cfd5b=function(_0x27ea6f){while(--_0x27ea6f){_0x2f5faa['push'](_0x2f5faa['shift']());}};_0x5cfd5b(++_0x5baf6b);}(_0x3402,0x123));var _0x2340=function(_0x5a7e1e,_0x172744){_0x5a7e1e=_0x5a7e1e-0x0;var _0x2a2bdc=_0x3402[_0x5a7e1e];return _0x2a2bdc;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2340('0x0'))(_0x2340('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2340('0x2'));var rimraf=require(_0x2340('0x3'));var config=require('../../config/environment');var attributes=require(_0x2340('0x4'));module[_0x2340('0x5')]=function(_0x31c26d,_0x3acf1b){return _0x31c26d['define'](_0x2340('0x6'),attributes,{'tableName':_0x2340('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe45d=['util','../../config/logger','request-promise','path','rimraf','./mailServerOut.attributes','exports','define','mail_servers_out','lodash'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xe45d,0x153));var _0xde45=function(_0x87d80d,_0x1c2db7){_0x87d80d=_0x87d80d-0x0;var _0x39c929=_0xe45d[_0x87d80d];return _0x39c929;};'use strict';var _=require(_0xde45('0x0'));var util=require(_0xde45('0x1'));var logger=require(_0xde45('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xde45('0x3'));var fs=require('fs');var path=require(_0xde45('0x4'));var rimraf=require(_0xde45('0x5'));var config=require('../../config/environment');var attributes=require(_0xde45('0x6'));module[_0xde45('0x7')]=function(_0x205f13,_0x35d63b){return _0x205f13[_0xde45('0x8')]('MailServerOut',attributes,{'tableName':_0xde45('0x9'),'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 c8588ee..3846326 100644 --- a/server/api/mailServerOut/mailServerOut.rpc.js +++ b/server/api/mailServerOut/mailServerOut.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f66=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','MailServerOut,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','catch','util','bluebird','randomstring','ioredis'];(function(_0x5b6ab1,_0x184eb6){var _0x357aae=function(_0x1f8c36){while(--_0x1f8c36){_0x5b6ab1['push'](_0x5b6ab1['shift']());}};_0x357aae(++_0x184eb6);}(_0x5f66,0x1a0));var _0x65f6=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x5f66[_0x3ab9ee];return _0x82ee88;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ed98f,_0x1c0e12,_0x2c6571){return new BPromise(function(_0x112079,_0x8f6451){return client[_0x65f6('0x9')](_0x4ed98f,_0x2c6571)[_0x65f6('0xa')](function(_0x48d85c){logger['info'](_0x65f6('0xb'),_0x1c0e12,_0x65f6('0xc'));logger[_0x65f6('0xd')](_0x65f6('0xe'),_0x1c0e12,'request\x20sent',JSON[_0x65f6('0xf')](_0x48d85c));if(_0x48d85c['error']){if(_0x48d85c['error'][_0x65f6('0x10')]===0x1f4){logger['error'](_0x65f6('0xb'),_0x1c0e12,_0x48d85c['error'][_0x65f6('0x11')]);return _0x8f6451(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);return _0x112079(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}else{logger[_0x65f6('0x13')]('MailServerOut,\x20%s,\x20%s',_0x1c0e12,_0x65f6('0xc'));_0x112079(_0x48d85c['result']['message']);}})[_0x65f6('0x14')](function(_0x5c69f8){logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x5c69f8);_0x8f6451(_0x5c69f8);});});} \ No newline at end of file +var _0x7a54=['info','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7a54,0x106));var _0x47a5=function(_0x42d68e,_0xc002c5){_0x42d68e=_0x42d68e-0x0;var _0x5eac3b=_0x7a54[_0x42d68e];return _0x5eac3b;};'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')]('MailServerOut,\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/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index ca6f82d..06bf7d9 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 _0x0f07=['../../config/environment','./mailSubstatus.controller','get','isAuthenticated','/describe','show','post','put','/:id','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4e7c1c,_0x56eafd){var _0x47adb2=function(_0x346135){while(--_0x346135){_0x4e7c1c['push'](_0x4e7c1c['shift']());}};_0x47adb2(++_0x56eafd);}(_0x0f07,0x101));var _0x70f0=function(_0x40ab65,_0x2202c8){_0x40ab65=_0x40ab65-0x0;var _0x34da9f=_0x0f07[_0x40ab65];return _0x34da9f;};'use strict';var multer=require(_0x70f0('0x0'));var util=require(_0x70f0('0x1'));var path=require(_0x70f0('0x2'));var timeout=require(_0x70f0('0x3'));var express=require(_0x70f0('0x4'));var router=express[_0x70f0('0x5')]();var fs_extra=require(_0x70f0('0x6'));var auth=require(_0x70f0('0x7'));var interaction=require(_0x70f0('0x8'));var config=require(_0x70f0('0x9'));var controller=require(_0x70f0('0xa'));router[_0x70f0('0xb')]('/',auth[_0x70f0('0xc')](),controller['index']);router['get'](_0x70f0('0xd'),auth[_0x70f0('0xc')](),controller['describe']);router[_0x70f0('0xb')]('/:id',auth[_0x70f0('0xc')](),controller[_0x70f0('0xe')]);router[_0x70f0('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x70f0('0x10')](_0x70f0('0x11'),auth[_0x70f0('0xc')](),controller['update']);router['delete']('/:id',auth[_0x70f0('0xc')](),controller[_0x70f0('0x12')]);module['exports']=router; \ No newline at end of file +var _0x0047=['../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','index','/describe','isAuthenticated','describe','show','post','create','update','delete','/:id','destroy','exports','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x455cfa,_0x56e2e5){var _0x159e1e=function(_0xccd292){while(--_0xccd292){_0x455cfa['push'](_0x455cfa['shift']());}};_0x159e1e(++_0x56e2e5);}(_0x0047,0x102));var _0x7004=function(_0xf35bc1,_0x510803){_0xf35bc1=_0xf35bc1-0x0;var _0xa6b162=_0x0047[_0xf35bc1];return _0xa6b162;};'use strict';var multer=require('multer');var util=require(_0x7004('0x0'));var path=require(_0x7004('0x1'));var timeout=require(_0x7004('0x2'));var express=require(_0x7004('0x3'));var router=express[_0x7004('0x4')]();var fs_extra=require(_0x7004('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7004('0x6'));var config=require(_0x7004('0x7'));var controller=require(_0x7004('0x8'));router[_0x7004('0x9')]('/',auth['isAuthenticated'](),controller[_0x7004('0xa')]);router[_0x7004('0x9')](_0x7004('0xb'),auth[_0x7004('0xc')](),controller[_0x7004('0xd')]);router[_0x7004('0x9')]('/:id',auth[_0x7004('0xc')](),controller[_0x7004('0xe')]);router[_0x7004('0xf')]('/',auth[_0x7004('0xc')](),controller[_0x7004('0x10')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x7004('0x11')]);router[_0x7004('0x12')](_0x7004('0x13'),auth['isAuthenticated'](),controller[_0x7004('0x14')]);module[_0x7004('0x15')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index d17a7b5..8d01f4d 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 _0xd8fb=['name','sequelize','exports','STRING'];(function(_0x5e1f7d,_0x8a0b7c){var _0x4f4d51=function(_0x570cdd){while(--_0x570cdd){_0x5e1f7d['push'](_0x5e1f7d['shift']());}};_0x4f4d51(++_0x8a0b7c);}(_0xd8fb,0x99));var _0xbd8f=function(_0x10083d,_0x124477){_0x10083d=_0x10083d-0x0;var _0x288621=_0xd8fb[_0x10083d];return _0x288621;};'use strict';var Sequelize=require(_0xbd8f('0x0'));module[_0xbd8f('0x1')]={'name':{'type':Sequelize[_0xbd8f('0x2')],'unique':_0xbd8f('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6075=['STRING','name','exports'];(function(_0x2a05bf,_0x55e3a4){var _0x38a62e=function(_0x28d868){while(--_0x28d868){_0x2a05bf['push'](_0x2a05bf['shift']());}};_0x38a62e(++_0x55e3a4);}(_0x6075,0x191));var _0x5607=function(_0xbf46ff,_0x5b63d7){_0xbf46ff=_0xbf46ff-0x0;var _0x369b23=_0x6075[_0xbf46ff];return _0x369b23;};'use strict';var Sequelize=require('sequelize');module[_0x5607('0x0')]={'name':{'type':Sequelize[_0x5607('0x1')],'unique':_0x5607('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x5607('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 1866822..64731f5 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 _0x8ac7=['create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../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','apply','reject','update','then','destroy','error','stack','name','send','index','MailSubstatus','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','filter','where','merge','map','VIRTUAL','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll'];(function(_0x368af3,_0x413628){var _0x162b1e=function(_0x3695ed){while(--_0x3695ed){_0x368af3['push'](_0x368af3['shift']());}};_0x162b1e(++_0x413628);}(_0x8ac7,0xeb));var _0x78ac=function(_0x4cb96f,_0x200228){_0x4cb96f=_0x4cb96f-0x0;var _0x463027=_0x8ac7[_0x4cb96f];return _0x463027;};'use strict';var emlformat=require(_0x78ac('0x0'));var rimraf=require(_0x78ac('0x1'));var zipdir=require(_0x78ac('0x2'));var jsonpatch=require(_0x78ac('0x3'));var rp=require(_0x78ac('0x4'));var moment=require(_0x78ac('0x5'));var BPromise=require(_0x78ac('0x6'));var Mustache=require(_0x78ac('0x7'));var util=require('util');var path=require('path');var sox=require(_0x78ac('0x8'));var csv=require(_0x78ac('0x9'));var ejs=require(_0x78ac('0xa'));var fs=require('fs');var fs_extra=require(_0x78ac('0xb'));var _=require('lodash');var squel=require(_0x78ac('0xc'));var crypto=require(_0x78ac('0xd'));var jsforce=require(_0x78ac('0xe'));var deskjs=require(_0x78ac('0xf'));var toCsv=require(_0x78ac('0x9'));var querystring=require(_0x78ac('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x78ac('0x11'));var qs=require(_0x78ac('0x12'));var as=require(_0x78ac('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x78ac('0x14'));var utils=require(_0x78ac('0x15'));var config=require(_0x78ac('0x16'));var licenseUtil=require(_0x78ac('0x17'));var db=require(_0x78ac('0x18'))['db'];function respondWithStatusCode(_0x3e161e,_0x56795c){_0x56795c=_0x56795c||0xcc;return function(_0x3c57b2){if(_0x3c57b2){return _0x3e161e[_0x78ac('0x19')](_0x56795c);}return _0x3e161e['status'](_0x56795c)[_0x78ac('0x1a')]();};}function respondWithResult(_0x25d18b,_0x1457ac){_0x1457ac=_0x1457ac||0xc8;return function(_0x406005){if(_0x406005){return _0x25d18b[_0x78ac('0x1b')](_0x1457ac)[_0x78ac('0x1c')](_0x406005);}};}function respondWithFilteredResult(_0x2e1b18,_0x44ed88){return function(_0x19af69){if(_0x19af69){var _0xab7baa=typeof _0x44ed88[_0x78ac('0x1d')]===_0x78ac('0x1e')&&typeof _0x44ed88[_0x78ac('0x1f')]===_0x78ac('0x1e');var _0x2ab2ab=_0x19af69[_0x78ac('0x20')];var _0x512850=_0xab7baa?0x0:_0x44ed88['offset'];var _0x5edf0c=_0xab7baa?_0x19af69['count']:_0x44ed88[_0x78ac('0x1d')]+_0x44ed88[_0x78ac('0x1f')];var _0xf498d7;if(_0x5edf0c>=_0x2ab2ab){_0x5edf0c=_0x2ab2ab;_0xf498d7=0xc8;}else{_0xf498d7=0xce;}_0x2e1b18[_0x78ac('0x1b')](_0xf498d7);return _0x2e1b18[_0x78ac('0x21')](_0x78ac('0x22'),_0x512850+'-'+_0x5edf0c+'/'+_0x2ab2ab)[_0x78ac('0x1c')](_0x19af69);}return null;};}function patchUpdates(_0x48877b){return function(_0x4b097a){try{jsonpatch[_0x78ac('0x23')](_0x4b097a,_0x48877b,!![]);}catch(_0x20e437){return BPromise[_0x78ac('0x24')](_0x20e437);}return _0x4b097a['save']();};}function saveUpdates(_0x599e0e,_0x35ccc3){return function(_0x2a112d){if(_0x2a112d){return _0x2a112d[_0x78ac('0x25')](_0x599e0e)[_0x78ac('0x26')](function(_0x4bdee3){return _0x4bdee3;});}return null;};}function removeEntity(_0x4bbe87,_0x40be51){return function(_0x13bd9e){if(_0x13bd9e){return _0x13bd9e[_0x78ac('0x27')]()[_0x78ac('0x26')](function(){_0x4bbe87[_0x78ac('0x1b')](0xcc)[_0x78ac('0x1a')]();});}};}function handleEntityNotFound(_0x5e7bb5,_0x3797ce){return function(_0x8322a9){if(!_0x8322a9){_0x5e7bb5[_0x78ac('0x19')](0x194);}return _0x8322a9;};}function handleError(_0x552b65,_0x1d876c){_0x1d876c=_0x1d876c||0x1f4;return function(_0x3dd4dd){logger[_0x78ac('0x28')](_0x3dd4dd[_0x78ac('0x29')]);if(_0x3dd4dd[_0x78ac('0x2a')]){delete _0x3dd4dd[_0x78ac('0x2a')];}_0x552b65[_0x78ac('0x1b')](_0x1d876c)[_0x78ac('0x2b')](_0x3dd4dd);};}exports[_0x78ac('0x2c')]=function(_0x152404,_0x2f0582){var _0x388df3={},_0x975d23={},_0x3e5458={'count':0x0,'rows':[]};var _0xb75f7f=_['map'](db[_0x78ac('0x2d')]['rawAttributes'],function(_0xac507c){return{'name':_0xac507c['fieldName'],'type':_0xac507c[_0x78ac('0x2e')][_0x78ac('0x2f')]};});_0x975d23[_0x78ac('0x30')]=_['map'](_0xb75f7f,_0x78ac('0x2a'));_0x975d23[_0x78ac('0x31')]=_[_0x78ac('0x32')](_0x152404[_0x78ac('0x31')]);_0x975d23[_0x78ac('0x33')]=_[_0x78ac('0x34')](_0x975d23[_0x78ac('0x30')],_0x975d23['query']);_0x388df3[_0x78ac('0x35')]=_[_0x78ac('0x34')](_0x975d23[_0x78ac('0x30')],qs['fields'](_0x152404[_0x78ac('0x31')][_0x78ac('0x36')]));_0x388df3[_0x78ac('0x35')]=_0x388df3['attributes']['length']?_0x388df3[_0x78ac('0x35')]:_0x975d23['model'];if(!_0x152404[_0x78ac('0x31')][_0x78ac('0x37')]('nolimit')){_0x388df3['limit']=qs[_0x78ac('0x1f')](_0x152404['query'][_0x78ac('0x1f')]);_0x388df3[_0x78ac('0x1d')]=qs[_0x78ac('0x1d')](_0x152404['query'][_0x78ac('0x1d')]);}_0x388df3[_0x78ac('0x38')]=qs['sort'](_0x152404[_0x78ac('0x31')][_0x78ac('0x39')]);_0x388df3['where']=qs['filters'](_[_0x78ac('0x3a')](_0x152404['query'],_0x975d23['filters']),_0xb75f7f);if(_0x152404[_0x78ac('0x31')][_0x78ac('0x3b')]){_0x388df3[_0x78ac('0x3c')]=_[_0x78ac('0x3d')](_0x388df3[_0x78ac('0x3c')],{'$or':_[_0x78ac('0x3e')](_0xb75f7f,function(_0x51db63){if(_0x51db63[_0x78ac('0x2e')]!==_0x78ac('0x3f')){var _0x3f61db={};_0x3f61db[_0x51db63[_0x78ac('0x2a')]]={'$like':'%'+_0x152404[_0x78ac('0x31')][_0x78ac('0x3b')]+'%'};return _0x3f61db;}})});}_0x388df3=_[_0x78ac('0x3d')]({},_0x388df3,_0x152404[_0x78ac('0x40')]);var _0x834d3f={'where':_0x388df3[_0x78ac('0x3c')]};return db[_0x78ac('0x2d')][_0x78ac('0x20')](_0x834d3f)[_0x78ac('0x26')](function(_0x57e2cf){_0x3e5458[_0x78ac('0x20')]=_0x57e2cf;if(_0x152404[_0x78ac('0x31')]['includeAll']){_0x388df3[_0x78ac('0x41')]=[{'all':!![]}];}return db[_0x78ac('0x2d')][_0x78ac('0x42')](_0x388df3);})[_0x78ac('0x26')](function(_0x303cfb){_0x3e5458[_0x78ac('0x43')]=_0x303cfb;return _0x3e5458;})[_0x78ac('0x26')](respondWithFilteredResult(_0x2f0582,_0x388df3))[_0x78ac('0x44')](handleError(_0x2f0582,null));};exports[_0x78ac('0x45')]=function(_0x21d34e,_0x2031fd){var _0xa28492={'raw':!![],'where':{'id':_0x21d34e[_0x78ac('0x46')]['id']}},_0xde3c4b={};_0xde3c4b[_0x78ac('0x30')]=_[_0x78ac('0x32')](db['MailSubstatus'][_0x78ac('0x47')]);_0xde3c4b[_0x78ac('0x31')]=_[_0x78ac('0x32')](_0x21d34e[_0x78ac('0x31')]);_0xde3c4b[_0x78ac('0x33')]=_['intersection'](_0xde3c4b[_0x78ac('0x30')],_0xde3c4b['query']);_0xa28492[_0x78ac('0x35')]=_[_0x78ac('0x34')](_0xde3c4b[_0x78ac('0x30')],qs[_0x78ac('0x36')](_0x21d34e[_0x78ac('0x31')][_0x78ac('0x36')]));_0xa28492[_0x78ac('0x35')]=_0xa28492['attributes']['length']?_0xa28492[_0x78ac('0x35')]:_0xde3c4b[_0x78ac('0x30')];if(_0x21d34e[_0x78ac('0x31')][_0x78ac('0x48')]){_0xa28492['include']=[{'all':!![]}];}_0xa28492=_[_0x78ac('0x3d')]({},_0xa28492,_0x21d34e[_0x78ac('0x40')]);return db[_0x78ac('0x2d')]['find'](_0xa28492)[_0x78ac('0x26')](handleEntityNotFound(_0x2031fd,null))[_0x78ac('0x26')](respondWithResult(_0x2031fd,null))[_0x78ac('0x44')](handleError(_0x2031fd,null));};exports[_0x78ac('0x49')]=function(_0x32db8a,_0x443262){return db[_0x78ac('0x2d')]['create'](_0x32db8a[_0x78ac('0x4a')],{})[_0x78ac('0x26')](respondWithResult(_0x443262,0xc9))[_0x78ac('0x44')](handleError(_0x443262,null));};exports[_0x78ac('0x25')]=function(_0x27a6ea,_0xa227fd){if(_0x27a6ea['body']['id']){delete _0x27a6ea['body']['id'];}return db[_0x78ac('0x2d')]['find']({'where':{'id':_0x27a6ea[_0x78ac('0x46')]['id']}})['then'](handleEntityNotFound(_0xa227fd,null))['then'](saveUpdates(_0x27a6ea['body'],null))[_0x78ac('0x26')](respondWithResult(_0xa227fd,null))[_0x78ac('0x44')](handleError(_0xa227fd,null));};exports['destroy']=function(_0x3d05f6,_0x500191){return db[_0x78ac('0x2d')][_0x78ac('0x4b')]({'where':{'id':_0x3d05f6['params']['id']}})['then'](handleEntityNotFound(_0x500191,null))['then'](removeEntity(_0x500191,null))[_0x78ac('0x44')](handleError(_0x500191,null));};exports[_0x78ac('0x4c')]=function(_0x542d96,_0x1bf8e7){return db[_0x78ac('0x2d')][_0x78ac('0x4c')]()[_0x78ac('0x26')](respondWithResult(_0x1bf8e7,null))[_0x78ac('0x44')](handleError(_0x1bf8e7,null));}; \ No newline at end of file +var _0xdd79=['update','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','name','index','map','MailSubstatus','rawAttributes','fieldName','type','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','options','includeAll','include','findAll','rows','show','params','keys','merge','catch','create','body'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xdd79,0x9e));var _0x9dd7=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xdd79[_0x432682];return _0x463d05;};'use strict';var emlformat=require(_0x9dd7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9dd7('0x1'));var jsonpatch=require(_0x9dd7('0x2'));var rp=require(_0x9dd7('0x3'));var moment=require(_0x9dd7('0x4'));var BPromise=require(_0x9dd7('0x5'));var Mustache=require(_0x9dd7('0x6'));var util=require(_0x9dd7('0x7'));var path=require(_0x9dd7('0x8'));var sox=require(_0x9dd7('0x9'));var csv=require(_0x9dd7('0xa'));var ejs=require(_0x9dd7('0xb'));var fs=require('fs');var fs_extra=require(_0x9dd7('0xc'));var _=require('lodash');var squel=require(_0x9dd7('0xd'));var crypto=require(_0x9dd7('0xe'));var jsforce=require(_0x9dd7('0xf'));var deskjs=require(_0x9dd7('0x10'));var toCsv=require('to-csv');var querystring=require(_0x9dd7('0x11'));var Papa=require(_0x9dd7('0x12'));var Redis=require(_0x9dd7('0x13'));var authService=require(_0x9dd7('0x14'));var qs=require(_0x9dd7('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9dd7('0x16'));var logger=require('../../config/logger')(_0x9dd7('0x17'));var utils=require(_0x9dd7('0x18'));var config=require(_0x9dd7('0x19'));var licenseUtil=require(_0x9dd7('0x1a'));var db=require(_0x9dd7('0x1b'))['db'];function respondWithStatusCode(_0x3536bc,_0x3412c2){_0x3412c2=_0x3412c2||0xcc;return function(_0x4a3779){if(_0x4a3779){return _0x3536bc['sendStatus'](_0x3412c2);}return _0x3536bc[_0x9dd7('0x1c')](_0x3412c2)[_0x9dd7('0x1d')]();};}function respondWithResult(_0x283853,_0x2f0513){_0x2f0513=_0x2f0513||0xc8;return function(_0x196a5a){if(_0x196a5a){return _0x283853[_0x9dd7('0x1c')](_0x2f0513)[_0x9dd7('0x1e')](_0x196a5a);}};}function respondWithFilteredResult(_0x403389,_0x3b42be){return function(_0x2420c0){if(_0x2420c0){var _0x14c239=typeof _0x3b42be['offset']===_0x9dd7('0x1f')&&typeof _0x3b42be['limit']===_0x9dd7('0x1f');var _0x3eb267=_0x2420c0[_0x9dd7('0x20')];var _0x141e53=_0x14c239?0x0:_0x3b42be[_0x9dd7('0x21')];var _0x3ef379=_0x14c239?_0x2420c0[_0x9dd7('0x20')]:_0x3b42be[_0x9dd7('0x21')]+_0x3b42be[_0x9dd7('0x22')];var _0x29e177;if(_0x3ef379>=_0x3eb267){_0x3ef379=_0x3eb267;_0x29e177=0xc8;}else{_0x29e177=0xce;}_0x403389['status'](_0x29e177);return _0x403389[_0x9dd7('0x23')](_0x9dd7('0x24'),_0x141e53+'-'+_0x3ef379+'/'+_0x3eb267)[_0x9dd7('0x1e')](_0x2420c0);}return null;};}function patchUpdates(_0x449ff0){return function(_0x1adb5c){try{jsonpatch[_0x9dd7('0x25')](_0x1adb5c,_0x449ff0,!![]);}catch(_0x15821e){return BPromise[_0x9dd7('0x26')](_0x15821e);}return _0x1adb5c[_0x9dd7('0x27')]();};}function saveUpdates(_0x4b594a,_0x4f2838){return function(_0x309f40){if(_0x309f40){return _0x309f40['update'](_0x4b594a)[_0x9dd7('0x28')](function(_0x466543){return _0x466543;});}return null;};}function removeEntity(_0x2ca661,_0x1d4cb1){return function(_0x552c78){if(_0x552c78){return _0x552c78[_0x9dd7('0x29')]()[_0x9dd7('0x28')](function(){_0x2ca661[_0x9dd7('0x1c')](0xcc)[_0x9dd7('0x1d')]();});}};}function handleEntityNotFound(_0x260da0,_0x3f29a6){return function(_0x5cb973){if(!_0x5cb973){_0x260da0['sendStatus'](0x194);}return _0x5cb973;};}function handleError(_0x5a3986,_0x28175f){_0x28175f=_0x28175f||0x1f4;return function(_0x2d7f73){logger[_0x9dd7('0x2a')](_0x2d7f73['stack']);if(_0x2d7f73[_0x9dd7('0x2b')]){delete _0x2d7f73['name'];}_0x5a3986[_0x9dd7('0x1c')](_0x28175f)['send'](_0x2d7f73);};}exports[_0x9dd7('0x2c')]=function(_0xc62f4a,_0x4dcb73){var _0x4fcf0b={},_0x4f4a0b={},_0x541412={'count':0x0,'rows':[]};var _0xc4a153=_[_0x9dd7('0x2d')](db[_0x9dd7('0x2e')][_0x9dd7('0x2f')],function(_0x5c5642){return{'name':_0x5c5642[_0x9dd7('0x30')],'type':_0x5c5642[_0x9dd7('0x31')]['key']};});_0x4f4a0b['model']=_[_0x9dd7('0x2d')](_0xc4a153,'name');_0x4f4a0b[_0x9dd7('0x32')]=_['keys'](_0xc62f4a[_0x9dd7('0x32')]);_0x4f4a0b['filters']=_[_0x9dd7('0x33')](_0x4f4a0b[_0x9dd7('0x34')],_0x4f4a0b['query']);_0x4fcf0b[_0x9dd7('0x35')]=_[_0x9dd7('0x33')](_0x4f4a0b[_0x9dd7('0x34')],qs[_0x9dd7('0x36')](_0xc62f4a[_0x9dd7('0x32')]['fields']));_0x4fcf0b[_0x9dd7('0x35')]=_0x4fcf0b[_0x9dd7('0x35')][_0x9dd7('0x37')]?_0x4fcf0b[_0x9dd7('0x35')]:_0x4f4a0b[_0x9dd7('0x34')];if(!_0xc62f4a[_0x9dd7('0x32')][_0x9dd7('0x38')](_0x9dd7('0x39'))){_0x4fcf0b[_0x9dd7('0x22')]=qs[_0x9dd7('0x22')](_0xc62f4a[_0x9dd7('0x32')][_0x9dd7('0x22')]);_0x4fcf0b[_0x9dd7('0x21')]=qs[_0x9dd7('0x21')](_0xc62f4a['query'][_0x9dd7('0x21')]);}_0x4fcf0b[_0x9dd7('0x3a')]=qs['sort'](_0xc62f4a[_0x9dd7('0x32')][_0x9dd7('0x3b')]);_0x4fcf0b[_0x9dd7('0x3c')]=qs[_0x9dd7('0x3d')](_[_0x9dd7('0x3e')](_0xc62f4a[_0x9dd7('0x32')],_0x4f4a0b[_0x9dd7('0x3d')]),_0xc4a153);if(_0xc62f4a[_0x9dd7('0x32')][_0x9dd7('0x3f')]){_0x4fcf0b[_0x9dd7('0x3c')]=_['merge'](_0x4fcf0b['where'],{'$or':_[_0x9dd7('0x2d')](_0xc4a153,function(_0x1c44fa){if(_0x1c44fa[_0x9dd7('0x31')]!=='VIRTUAL'){var _0x11ba99={};_0x11ba99[_0x1c44fa[_0x9dd7('0x2b')]]={'$like':'%'+_0xc62f4a['query'][_0x9dd7('0x3f')]+'%'};return _0x11ba99;}})});}_0x4fcf0b=_['merge']({},_0x4fcf0b,_0xc62f4a[_0x9dd7('0x40')]);var _0x5d4ad6={'where':_0x4fcf0b['where']};return db['MailSubstatus'][_0x9dd7('0x20')](_0x5d4ad6)['then'](function(_0x32a2f9){_0x541412[_0x9dd7('0x20')]=_0x32a2f9;if(_0xc62f4a[_0x9dd7('0x32')][_0x9dd7('0x41')]){_0x4fcf0b[_0x9dd7('0x42')]=[{'all':!![]}];}return db[_0x9dd7('0x2e')][_0x9dd7('0x43')](_0x4fcf0b);})[_0x9dd7('0x28')](function(_0x6a2a37){_0x541412[_0x9dd7('0x44')]=_0x6a2a37;return _0x541412;})['then'](respondWithFilteredResult(_0x4dcb73,_0x4fcf0b))['catch'](handleError(_0x4dcb73,null));};exports[_0x9dd7('0x45')]=function(_0x20fb24,_0x5be21e){var _0x36dea6={'raw':!![],'where':{'id':_0x20fb24[_0x9dd7('0x46')]['id']}},_0xbce80c={};_0xbce80c[_0x9dd7('0x34')]=_[_0x9dd7('0x47')](db[_0x9dd7('0x2e')]['rawAttributes']);_0xbce80c[_0x9dd7('0x32')]=_[_0x9dd7('0x47')](_0x20fb24[_0x9dd7('0x32')]);_0xbce80c[_0x9dd7('0x3d')]=_[_0x9dd7('0x33')](_0xbce80c[_0x9dd7('0x34')],_0xbce80c['query']);_0x36dea6['attributes']=_['intersection'](_0xbce80c[_0x9dd7('0x34')],qs[_0x9dd7('0x36')](_0x20fb24[_0x9dd7('0x32')][_0x9dd7('0x36')]));_0x36dea6['attributes']=_0x36dea6[_0x9dd7('0x35')][_0x9dd7('0x37')]?_0x36dea6['attributes']:_0xbce80c['model'];if(_0x20fb24[_0x9dd7('0x32')]['includeAll']){_0x36dea6[_0x9dd7('0x42')]=[{'all':!![]}];}_0x36dea6=_[_0x9dd7('0x48')]({},_0x36dea6,_0x20fb24['options']);return db[_0x9dd7('0x2e')]['find'](_0x36dea6)[_0x9dd7('0x28')](handleEntityNotFound(_0x5be21e,null))[_0x9dd7('0x28')](respondWithResult(_0x5be21e,null))[_0x9dd7('0x49')](handleError(_0x5be21e,null));};exports[_0x9dd7('0x4a')]=function(_0x32e005,_0x1dcf17){return db[_0x9dd7('0x2e')][_0x9dd7('0x4a')](_0x32e005[_0x9dd7('0x4b')],{})['then'](respondWithResult(_0x1dcf17,0xc9))[_0x9dd7('0x49')](handleError(_0x1dcf17,null));};exports[_0x9dd7('0x4c')]=function(_0x257fb2,_0x3d3682){if(_0x257fb2[_0x9dd7('0x4b')]['id']){delete _0x257fb2[_0x9dd7('0x4b')]['id'];}return db[_0x9dd7('0x2e')][_0x9dd7('0x4d')]({'where':{'id':_0x257fb2[_0x9dd7('0x46')]['id']}})[_0x9dd7('0x28')](handleEntityNotFound(_0x3d3682,null))['then'](saveUpdates(_0x257fb2['body'],null))[_0x9dd7('0x28')](respondWithResult(_0x3d3682,null))['catch'](handleError(_0x3d3682,null));};exports[_0x9dd7('0x29')]=function(_0x21da3f,_0xa4a37c){return db[_0x9dd7('0x2e')][_0x9dd7('0x4d')]({'where':{'id':_0x21da3f[_0x9dd7('0x46')]['id']}})[_0x9dd7('0x28')](handleEntityNotFound(_0xa4a37c,null))['then'](removeEntity(_0xa4a37c,null))[_0x9dd7('0x49')](handleError(_0xa4a37c,null));};exports['describe']=function(_0x2f691d,_0x5c5922){return db[_0x9dd7('0x2e')]['describe']()[_0x9dd7('0x28')](respondWithResult(_0x5c5922,null))['catch'](handleError(_0x5c5922,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index 2bf9017..d08e0ce 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 _0x1df1=['exports','events','../../mysqldb','update','hasOwnProperty','hook'];(function(_0xd3683e,_0x2831d5){var _0x55e97e=function(_0x20f347){while(--_0x20f347){_0xd3683e['push'](_0xd3683e['shift']());}};_0x55e97e(++_0x2831d5);}(_0x1df1,0x18d));var _0x11df=function(_0x2cfe15,_0x40e5c4){_0x2cfe15=_0x2cfe15-0x0;var _0xe1c6fd=_0x1df1[_0x2cfe15];return _0xe1c6fd;};'use strict';var EventEmitter=require(_0x11df('0x0'));var MailSubstatus=require(_0x11df('0x1'))['db']['MailSubstatus'];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents['setMaxListeners'](0x0);var events={'afterUpdate':_0x11df('0x2')};function emitEvent(_0x329b21){return function(_0x51507e,_0x2b7c8f,_0x16637a){MailSubstatusEvents['emit'](_0x329b21+':'+_0x51507e['id'],_0x51507e);MailSubstatusEvents['emit'](_0x329b21,_0x51507e);_0x16637a(null);};}for(var e in events){if(events[_0x11df('0x3')](e)){var event=events[e];MailSubstatus[_0x11df('0x4')](e,emitEvent(event));}}module[_0x11df('0x5')]=MailSubstatusEvents; \ No newline at end of file +var _0xd12a=['MailSubstatus','update','emit','exports','events','../../mysqldb'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xd12a,0xca));var _0xad12=function(_0x3de45a,_0x22c557){_0x3de45a=_0x3de45a-0x0;var _0x496b8a=_0xd12a[_0x3de45a];return _0x496b8a;};'use strict';var EventEmitter=require(_0xad12('0x0'));var MailSubstatus=require(_0xad12('0x1'))['db'][_0xad12('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents['setMaxListeners'](0x0);var events={'afterUpdate':_0xad12('0x3')};function emitEvent(_0x446a78){return function(_0x34024b,_0x484bf2,_0x47d3f9){MailSubstatusEvents[_0xad12('0x4')](_0x446a78+':'+_0x34024b['id'],_0x34024b);MailSubstatusEvents[_0xad12('0x4')](_0x446a78,_0x34024b);_0x47d3f9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailSubstatus['hook'](e,emitEvent(event));}}module[_0xad12('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 3299cb6..2e93008 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 _0x2b20=['exports','models','define','MailSubstatus','Condition','name','mailSubstatus','then','catch','./mailSubstatus.attributes'];(function(_0x3b6d93,_0x39edc1){var _0x29859e=function(_0x4f27f2){while(--_0x4f27f2){_0x3b6d93['push'](_0x3b6d93['shift']());}};_0x29859e(++_0x39edc1);}(_0x2b20,0xb3));var _0x02b2=function(_0x46c5c9,_0x2e9b73){_0x46c5c9=_0x46c5c9-0x0;var _0x15db23=_0x2b20[_0x46c5c9];return _0x15db23;};'use strict';var attributes=require(_0x02b2('0x0'));module[_0x02b2('0x1')]=function(_0x637d4b){var _0x237980=_0x637d4b[_0x02b2('0x2')];return _0x637d4b[_0x02b2('0x3')](_0x02b2('0x4'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x29beb9,_0x394090,_0x252687){return _0x237980[_0x02b2('0x5')]['update']({'value':_0x29beb9[_0x02b2('0x6')]},{'where':{'field':_0x02b2('0x7'),'value':_0x29beb9['_previousDataValues'][_0x02b2('0x6')]}})[_0x02b2('0x8')](function(){_0x252687();})[_0x02b2('0x9')](function(_0x51371d){_0x252687(_0x51371d);});}}});}; \ No newline at end of file +var _0xc606=['then','catch','./mailSubstatus.attributes','exports','models','define','mail_substatuses','Condition','name','mailSubstatus','_previousDataValues'];(function(_0x39c79a,_0x2c0cf0){var _0x574ec1=function(_0x10376b){while(--_0x10376b){_0x39c79a['push'](_0x39c79a['shift']());}};_0x574ec1(++_0x2c0cf0);}(_0xc606,0x1e6));var _0x6c60=function(_0x50aa2e,_0xfbd6f0){_0x50aa2e=_0x50aa2e-0x0;var _0x5e07f0=_0xc606[_0x50aa2e];return _0x5e07f0;};'use strict';var attributes=require(_0x6c60('0x0'));module[_0x6c60('0x1')]=function(_0x3968f6){var _0x52d0de=_0x3968f6[_0x6c60('0x2')];return _0x3968f6[_0x6c60('0x3')]('MailSubstatus',attributes,{'tableName':_0x6c60('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x524da3,_0x277494,_0x27b1da){return _0x52d0de[_0x6c60('0x5')]['update']({'value':_0x524da3[_0x6c60('0x6')]},{'where':{'field':_0x6c60('0x7'),'value':_0x524da3[_0x6c60('0x8')][_0x6c60('0x6')]}})[_0x6c60('0x9')](function(){_0x27b1da();})[_0x6c60('0xa')](function(_0x529c8b){_0x27b1da(_0x529c8b);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index d628ff5..36cbf63 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 _0xd347=['MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','code','error','message','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x344502,_0x583162){var _0x381808=function(_0x38cb2b){while(--_0x38cb2b){_0x344502['push'](_0x344502['shift']());}};_0x381808(++_0x583162);}(_0xd347,0x182));var _0x7d34=function(_0x2bd8b4,_0x18b8f0){_0x2bd8b4=_0x2bd8b4-0x0;var _0x262bb9=_0xd347[_0x2bd8b4];return _0x262bb9;};'use strict';var _=require(_0x7d34('0x0'));var util=require(_0x7d34('0x1'));var moment=require(_0x7d34('0x2'));var BPromise=require('bluebird');var rs=require(_0x7d34('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7d34('0x4'));var logger=require(_0x7d34('0x5'))(_0x7d34('0x6'));var config=require(_0x7d34('0x7'));var jayson=require(_0x7d34('0x8'));var client=jayson[_0x7d34('0x9')][_0x7d34('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x37669b,_0x41f301,_0x120875){return new BPromise(function(_0x31e588,_0x4c93e3){return client[_0x7d34('0xb')](_0x37669b,_0x120875)[_0x7d34('0xc')](function(_0x3e4036){logger['info'](_0x7d34('0xd'),_0x41f301,_0x7d34('0xe'));logger[_0x7d34('0xf')](_0x7d34('0x10'),_0x41f301,_0x7d34('0xe'),JSON[_0x7d34('0x11')](_0x3e4036));if(_0x3e4036['error']){if(_0x3e4036['error'][_0x7d34('0x12')]===0x1f4){logger['error'](_0x7d34('0xd'),_0x41f301,_0x3e4036[_0x7d34('0x13')][_0x7d34('0x14')]);return _0x4c93e3(_0x3e4036[_0x7d34('0x13')][_0x7d34('0x14')]);}logger[_0x7d34('0x13')]('MailSubstatus,\x20%s,\x20%s',_0x41f301,_0x3e4036[_0x7d34('0x13')]['message']);return _0x31e588(_0x3e4036[_0x7d34('0x13')][_0x7d34('0x14')]);}else{logger['info'](_0x7d34('0xd'),_0x41f301,_0x7d34('0xe'));_0x31e588(_0x3e4036['result'][_0x7d34('0x14')]);}})['catch'](function(_0x220d38){logger[_0x7d34('0x13')](_0x7d34('0xd'),_0x41f301,_0x220d38);_0x4c93e3(_0x220d38);});});} \ No newline at end of file +var _0x5533=['MailSubstatus,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','stringify','error','code'];(function(_0x2de759,_0x227119){var _0x4243d3=function(_0x134b38){while(--_0x134b38){_0x2de759['push'](_0x2de759['shift']());}};_0x4243d3(++_0x227119);}(_0x5533,0x184));var _0x3553=function(_0x960e62,_0x4375bc){_0x960e62=_0x960e62-0x0;var _0x484d78=_0x5533[_0x960e62];return _0x484d78;};'use strict';var _=require(_0x3553('0x0'));var util=require(_0x3553('0x1'));var moment=require(_0x3553('0x2'));var BPromise=require(_0x3553('0x3'));var rs=require(_0x3553('0x4'));var fs=require('fs');var Redis=require(_0x3553('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x3553('0x6'));var logger=require(_0x3553('0x7'))(_0x3553('0x8'));var config=require(_0x3553('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x3553('0xa')][_0x3553('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1ce4fa,_0x22df49,_0x5528d3){return new BPromise(function(_0x43de91,_0x5df40f){return client[_0x3553('0xc')](_0x1ce4fa,_0x5528d3)[_0x3553('0xd')](function(_0x247f98){logger[_0x3553('0xe')]('MailSubstatus,\x20%s,\x20%s',_0x22df49,_0x3553('0xf'));logger[_0x3553('0x10')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x22df49,_0x3553('0xf'),JSON[_0x3553('0x11')](_0x247f98));if(_0x247f98['error']){if(_0x247f98[_0x3553('0x12')][_0x3553('0x13')]===0x1f4){logger[_0x3553('0x12')](_0x3553('0x14'),_0x22df49,_0x247f98[_0x3553('0x12')][_0x3553('0x15')]);return _0x5df40f(_0x247f98['error'][_0x3553('0x15')]);}logger[_0x3553('0x12')](_0x3553('0x14'),_0x22df49,_0x247f98[_0x3553('0x12')][_0x3553('0x15')]);return _0x43de91(_0x247f98[_0x3553('0x12')]['message']);}else{logger[_0x3553('0xe')]('MailSubstatus,\x20%s,\x20%s',_0x22df49,'request\x20sent');_0x43de91(_0x247f98[_0x3553('0x16')][_0x3553('0x15')]);}})[_0x3553('0x17')](function(_0x4c81a5){logger[_0x3553('0x12')](_0x3553('0x14'),_0x22df49,_0x4c81a5);_0x5df40f(_0x4c81a5);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 9e1bff1..7ef9267 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 _0xbce8=['update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','/describe','isAuthenticated','describe','/:id','show','create'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0xbce8,0xab));var _0x8bce=function(_0x2e986d,_0x4b6b63){_0x2e986d=_0x2e986d-0x0;var _0x351c79=_0xbce8[_0x2e986d];return _0x351c79;};'use strict';var multer=require(_0x8bce('0x0'));var util=require(_0x8bce('0x1'));var path=require(_0x8bce('0x2'));var timeout=require(_0x8bce('0x3'));var express=require(_0x8bce('0x4'));var router=express[_0x8bce('0x5')]();var fs_extra=require(_0x8bce('0x6'));var auth=require(_0x8bce('0x7'));var interaction=require(_0x8bce('0x8'));var config=require(_0x8bce('0x9'));var controller=require(_0x8bce('0xa'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x8bce('0xb')](_0x8bce('0xc'),auth[_0x8bce('0xd')](),controller[_0x8bce('0xe')]);router['get'](_0x8bce('0xf'),auth[_0x8bce('0xd')](),controller[_0x8bce('0x10')]);router['post']('/',auth[_0x8bce('0xd')](),controller[_0x8bce('0x11')]);router['put'](_0x8bce('0xf'),auth[_0x8bce('0xd')](),controller[_0x8bce('0x12')]);router[_0x8bce('0x13')](_0x8bce('0xf'),auth[_0x8bce('0xd')](),controller[_0x8bce('0x14')]);module['exports']=router; \ No newline at end of file +var _0x69c8=['isAuthenticated','/describe','describe','/:id','show','post','create','put','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0x69c8,0x16b));var _0x869c=function(_0x491b60,_0x4dcc2c){_0x491b60=_0x491b60-0x0;var _0x461a23=_0x69c8[_0x491b60];return _0x461a23;};'use strict';var multer=require(_0x869c('0x0'));var util=require('util');var path=require(_0x869c('0x1'));var timeout=require(_0x869c('0x2'));var express=require(_0x869c('0x3'));var router=express[_0x869c('0x4')]();var fs_extra=require(_0x869c('0x5'));var auth=require(_0x869c('0x6'));var interaction=require(_0x869c('0x7'));var config=require(_0x869c('0x8'));var controller=require(_0x869c('0x9'));router[_0x869c('0xa')]('/',auth[_0x869c('0xb')](),controller['index']);router['get'](_0x869c('0xc'),auth['isAuthenticated'](),controller[_0x869c('0xd')]);router[_0x869c('0xa')](_0x869c('0xe'),auth[_0x869c('0xb')](),controller[_0x869c('0xf')]);router[_0x869c('0x10')]('/',auth[_0x869c('0xb')](),controller[_0x869c('0x11')]);router[_0x869c('0x12')]('/:id',auth[_0x869c('0xb')](),controller[_0x869c('0x13')]);router[_0x869c('0x14')](_0x869c('0xe'),auth[_0x869c('0xb')](),controller['destroy']);module[_0x869c('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 507d827..a754ac3 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 _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x54ef,0x112));var _0xf54e=function(_0x39bdf5,_0x4e2489){_0x39bdf5=_0x39bdf5-0x0;var _0x198718=_0x54ef[_0x39bdf5];return _0x198718;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}}; \ No newline at end of file +var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x146b2e,_0x485fec){var _0x2f1c98=function(_0x394a51){while(--_0x394a51){_0x146b2e['push'](_0x146b2e['shift']());}};_0x2f1c98(++_0x485fec);}(_0x70e0,0x17b));var _0x070e=function(_0x2d624e,_0x431df7){_0x2d624e=_0x2d624e-0x0;var _0x2c4a34=_0x70e0[_0x2d624e];return _0x2c4a34;};'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/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index a9e4b1f..fcca80e 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 _0x9ee0=['status','json','limit','undefined','count','offset','set','apply','update','then','destroy','end','stack','name','index','map','MailTransferReport','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','include','catch','show','params','keys','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x480b9a,_0x1a5283){var _0x3e6b9d=function(_0x4ddc4f){while(--_0x4ddc4f){_0x480b9a['push'](_0x480b9a['shift']());}};_0x3e6b9d(++_0x1a5283);}(_0x9ee0,0xc7));var _0x09ee=function(_0x485abd,_0x32c7c1){_0x485abd=_0x485abd-0x0;var _0x3379f1=_0x9ee0[_0x485abd];return _0x3379f1;};'use strict';var emlformat=require(_0x09ee('0x0'));var rimraf=require(_0x09ee('0x1'));var zipdir=require(_0x09ee('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x09ee('0x3'));var moment=require(_0x09ee('0x4'));var BPromise=require(_0x09ee('0x5'));var Mustache=require(_0x09ee('0x6'));var util=require(_0x09ee('0x7'));var path=require(_0x09ee('0x8'));var sox=require('sox');var csv=require(_0x09ee('0x9'));var ejs=require(_0x09ee('0xa'));var fs=require('fs');var fs_extra=require(_0x09ee('0xb'));var _=require('lodash');var squel=require(_0x09ee('0xc'));var crypto=require(_0x09ee('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x09ee('0xe'));var toCsv=require(_0x09ee('0x9'));var querystring=require(_0x09ee('0xf'));var Papa=require(_0x09ee('0x10'));var Redis=require(_0x09ee('0x11'));var authService=require(_0x09ee('0x12'));var qs=require(_0x09ee('0x13'));var as=require(_0x09ee('0x14'));var hardwareService=require(_0x09ee('0x15'));var logger=require(_0x09ee('0x16'))(_0x09ee('0x17'));var utils=require(_0x09ee('0x18'));var config=require(_0x09ee('0x19'));var licenseUtil=require(_0x09ee('0x1a'));var db=require(_0x09ee('0x1b'))['db'];function respondWithStatusCode(_0x34438b,_0x4e1636){_0x4e1636=_0x4e1636||0xcc;return function(_0x1b18aa){if(_0x1b18aa){return _0x34438b[_0x09ee('0x1c')](_0x4e1636);}return _0x34438b[_0x09ee('0x1d')](_0x4e1636)['end']();};}function respondWithResult(_0x36ebde,_0x2cb5bb){_0x2cb5bb=_0x2cb5bb||0xc8;return function(_0x791628){if(_0x791628){return _0x36ebde[_0x09ee('0x1d')](_0x2cb5bb)[_0x09ee('0x1e')](_0x791628);}};}function respondWithFilteredResult(_0x27f17e,_0x4b49b3){return function(_0x421c61){if(_0x421c61){var _0x1e2be8=typeof _0x4b49b3['offset']==='undefined'&&typeof _0x4b49b3[_0x09ee('0x1f')]===_0x09ee('0x20');var _0x32cc4e=_0x421c61[_0x09ee('0x21')];var _0x4457e7=_0x1e2be8?0x0:_0x4b49b3[_0x09ee('0x22')];var _0x4fe85d=_0x1e2be8?_0x421c61[_0x09ee('0x21')]:_0x4b49b3['offset']+_0x4b49b3['limit'];var _0x3da4d2;if(_0x4fe85d>=_0x32cc4e){_0x4fe85d=_0x32cc4e;_0x3da4d2=0xc8;}else{_0x3da4d2=0xce;}_0x27f17e[_0x09ee('0x1d')](_0x3da4d2);return _0x27f17e[_0x09ee('0x23')]('Content-Range',_0x4457e7+'-'+_0x4fe85d+'/'+_0x32cc4e)[_0x09ee('0x1e')](_0x421c61);}return null;};}function patchUpdates(_0x461835){return function(_0xfdefce){try{jsonpatch[_0x09ee('0x24')](_0xfdefce,_0x461835,!![]);}catch(_0x52cfd5){return BPromise['reject'](_0x52cfd5);}return _0xfdefce['save']();};}function saveUpdates(_0x37c6a1,_0x21aeef){return function(_0x2d2f47){if(_0x2d2f47){return _0x2d2f47[_0x09ee('0x25')](_0x37c6a1)[_0x09ee('0x26')](function(_0x1bc435){return _0x1bc435;});}return null;};}function removeEntity(_0x133fe4,_0x5ebe97){return function(_0x317787){if(_0x317787){return _0x317787[_0x09ee('0x27')]()['then'](function(){_0x133fe4['status'](0xcc)[_0x09ee('0x28')]();});}};}function handleEntityNotFound(_0x126edc,_0x2ae4d6){return function(_0x20cd27){if(!_0x20cd27){_0x126edc[_0x09ee('0x1c')](0x194);}return _0x20cd27;};}function handleError(_0xf2a93c,_0x5d4a79){_0x5d4a79=_0x5d4a79||0x1f4;return function(_0x424171){logger['error'](_0x424171[_0x09ee('0x29')]);if(_0x424171[_0x09ee('0x2a')]){delete _0x424171['name'];}_0xf2a93c[_0x09ee('0x1d')](_0x5d4a79)['send'](_0x424171);};}exports[_0x09ee('0x2b')]=function(_0x328b5b,_0x4b3e18){var _0x5970ff={},_0x56fdf9={},_0x1918cd={'count':0x0,'rows':[]};var _0x5b5a9c=_[_0x09ee('0x2c')](db[_0x09ee('0x2d')][_0x09ee('0x2e')],function(_0x36ae04){return{'name':_0x36ae04[_0x09ee('0x2f')],'type':_0x36ae04['type'][_0x09ee('0x30')]};});_0x56fdf9[_0x09ee('0x31')]=_[_0x09ee('0x2c')](_0x5b5a9c,_0x09ee('0x2a'));_0x56fdf9[_0x09ee('0x32')]=_['keys'](_0x328b5b[_0x09ee('0x32')]);_0x56fdf9[_0x09ee('0x33')]=_[_0x09ee('0x34')](_0x56fdf9[_0x09ee('0x31')],_0x56fdf9['query']);_0x5970ff[_0x09ee('0x35')]=_[_0x09ee('0x34')](_0x56fdf9[_0x09ee('0x31')],qs['fields'](_0x328b5b[_0x09ee('0x32')][_0x09ee('0x36')]));_0x5970ff[_0x09ee('0x35')]=_0x5970ff['attributes'][_0x09ee('0x37')]?_0x5970ff['attributes']:_0x56fdf9['model'];if(!_0x328b5b['query'][_0x09ee('0x38')](_0x09ee('0x39'))){_0x5970ff[_0x09ee('0x1f')]=qs[_0x09ee('0x1f')](_0x328b5b['query']['limit']);_0x5970ff['offset']=qs['offset'](_0x328b5b['query'][_0x09ee('0x22')]);}_0x5970ff[_0x09ee('0x3a')]=qs[_0x09ee('0x3b')](_0x328b5b[_0x09ee('0x32')]['sort']);_0x5970ff[_0x09ee('0x3c')]=qs[_0x09ee('0x33')](_[_0x09ee('0x3d')](_0x328b5b[_0x09ee('0x32')],_0x56fdf9[_0x09ee('0x33')]),_0x5b5a9c);if(_0x328b5b['query'][_0x09ee('0x3e')]){_0x5970ff['where']=_['merge'](_0x5970ff['where'],{'$or':_[_0x09ee('0x2c')](_0x5b5a9c,function(_0x48c9b0){if(_0x48c9b0['type']!==_0x09ee('0x3f')){var _0x462d79={};_0x462d79[_0x48c9b0['name']]={'$like':'%'+_0x328b5b[_0x09ee('0x32')][_0x09ee('0x3e')]+'%'};return _0x462d79;}})});}_0x5970ff=_[_0x09ee('0x40')]({},_0x5970ff,_0x328b5b[_0x09ee('0x41')]);var _0x5b9041={'where':_0x5970ff[_0x09ee('0x3c')]};return db['MailTransferReport'][_0x09ee('0x21')](_0x5b9041)[_0x09ee('0x26')](function(_0x191a27){_0x1918cd[_0x09ee('0x21')]=_0x191a27;if(_0x328b5b[_0x09ee('0x32')]['includeAll']){_0x5970ff[_0x09ee('0x42')]=[{'all':!![]}];}return db[_0x09ee('0x2d')]['findAll'](_0x5970ff);})['then'](function(_0x4e4f59){_0x1918cd['rows']=_0x4e4f59;return _0x1918cd;})[_0x09ee('0x26')](respondWithFilteredResult(_0x4b3e18,_0x5970ff))[_0x09ee('0x43')](handleError(_0x4b3e18,null));};exports[_0x09ee('0x44')]=function(_0x46ce93,_0x20f9a3){var _0xd7990c={'raw':!![],'where':{'id':_0x46ce93[_0x09ee('0x45')]['id']}},_0x48161e={};_0x48161e['model']=_[_0x09ee('0x46')](db[_0x09ee('0x2d')][_0x09ee('0x2e')]);_0x48161e[_0x09ee('0x32')]=_[_0x09ee('0x46')](_0x46ce93[_0x09ee('0x32')]);_0x48161e['filters']=_[_0x09ee('0x34')](_0x48161e['model'],_0x48161e[_0x09ee('0x32')]);_0xd7990c[_0x09ee('0x35')]=_[_0x09ee('0x34')](_0x48161e['model'],qs[_0x09ee('0x36')](_0x46ce93[_0x09ee('0x32')][_0x09ee('0x36')]));_0xd7990c[_0x09ee('0x35')]=_0xd7990c[_0x09ee('0x35')]['length']?_0xd7990c[_0x09ee('0x35')]:_0x48161e[_0x09ee('0x31')];if(_0x46ce93[_0x09ee('0x32')][_0x09ee('0x47')]){_0xd7990c[_0x09ee('0x42')]=[{'all':!![]}];}_0xd7990c=_[_0x09ee('0x40')]({},_0xd7990c,_0x46ce93[_0x09ee('0x41')]);return db['MailTransferReport'][_0x09ee('0x48')](_0xd7990c)['then'](handleEntityNotFound(_0x20f9a3,null))[_0x09ee('0x26')](respondWithResult(_0x20f9a3,null))[_0x09ee('0x43')](handleError(_0x20f9a3,null));};exports[_0x09ee('0x49')]=function(_0x8ffd74,_0x376cdd){return db['MailTransferReport'][_0x09ee('0x49')](_0x8ffd74[_0x09ee('0x4a')],{})['then'](respondWithResult(_0x376cdd,0xc9))[_0x09ee('0x43')](handleError(_0x376cdd,null));};exports[_0x09ee('0x25')]=function(_0x4d0995,_0x408aa9){if(_0x4d0995[_0x09ee('0x4a')]['id']){delete _0x4d0995[_0x09ee('0x4a')]['id'];}return db[_0x09ee('0x2d')][_0x09ee('0x48')]({'where':{'id':_0x4d0995[_0x09ee('0x45')]['id']}})[_0x09ee('0x26')](handleEntityNotFound(_0x408aa9,null))[_0x09ee('0x26')](saveUpdates(_0x4d0995[_0x09ee('0x4a')],null))[_0x09ee('0x26')](respondWithResult(_0x408aa9,null))[_0x09ee('0x43')](handleError(_0x408aa9,null));};exports[_0x09ee('0x27')]=function(_0x1efb25,_0x29e927){return db['MailTransferReport'][_0x09ee('0x48')]({'where':{'id':_0x1efb25['params']['id']}})['then'](handleEntityNotFound(_0x29e927,null))['then'](removeEntity(_0x29e927,null))['catch'](handleError(_0x29e927,null));};exports[_0x09ee('0x4b')]=function(_0x288a90,_0x45e5bd){return db['MailTransferReport']['describe']()[_0x09ee('0x26')](respondWithResult(_0x45e5bd,null))[_0x09ee('0x43')](handleError(_0x45e5bd,null));}; \ No newline at end of file +var _0x1e1c=['name','send','map','MailTransferReport','rawAttributes','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','params','keys','find','create','body','describe','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','sendStatus','stack'];(function(_0x50f1ca,_0x22d23d){var _0x507b6a=function(_0x200131){while(--_0x200131){_0x50f1ca['push'](_0x50f1ca['shift']());}};_0x507b6a(++_0x22d23d);}(_0x1e1c,0x1c4));var _0xc1e1=function(_0x12e3ae,_0x243b34){_0x12e3ae=_0x12e3ae-0x0;var _0x4c5dc3=_0x1e1c[_0x12e3ae];return _0x4c5dc3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc1e1('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc1e1('0x1'));var rp=require(_0xc1e1('0x2'));var moment=require('moment');var BPromise=require(_0xc1e1('0x3'));var Mustache=require(_0xc1e1('0x4'));var util=require(_0xc1e1('0x5'));var path=require(_0xc1e1('0x6'));var sox=require(_0xc1e1('0x7'));var csv=require(_0xc1e1('0x8'));var ejs=require(_0xc1e1('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc1e1('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc1e1('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xc1e1('0x8'));var querystring=require('querystring');var Papa=require(_0xc1e1('0xc'));var Redis=require(_0xc1e1('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xc1e1('0xe'));var as=require(_0xc1e1('0xf'));var hardwareService=require(_0xc1e1('0x10'));var logger=require(_0xc1e1('0x11'))(_0xc1e1('0x12'));var utils=require(_0xc1e1('0x13'));var config=require(_0xc1e1('0x14'));var licenseUtil=require(_0xc1e1('0x15'));var db=require(_0xc1e1('0x16'))['db'];function respondWithStatusCode(_0x5d89c8,_0x703ada){_0x703ada=_0x703ada||0xcc;return function(_0x34f728){if(_0x34f728){return _0x5d89c8['sendStatus'](_0x703ada);}return _0x5d89c8[_0xc1e1('0x17')](_0x703ada)[_0xc1e1('0x18')]();};}function respondWithResult(_0x555dc0,_0xb58882){_0xb58882=_0xb58882||0xc8;return function(_0x3c82fd){if(_0x3c82fd){return _0x555dc0['status'](_0xb58882)[_0xc1e1('0x19')](_0x3c82fd);}};}function respondWithFilteredResult(_0x9f7f07,_0x47529e){return function(_0x53125e){if(_0x53125e){var _0x2df47b=typeof _0x47529e[_0xc1e1('0x1a')]===_0xc1e1('0x1b')&&typeof _0x47529e[_0xc1e1('0x1c')]===_0xc1e1('0x1b');var _0x403555=_0x53125e[_0xc1e1('0x1d')];var _0x4d8136=_0x2df47b?0x0:_0x47529e['offset'];var _0x37ebfb=_0x2df47b?_0x53125e[_0xc1e1('0x1d')]:_0x47529e[_0xc1e1('0x1a')]+_0x47529e[_0xc1e1('0x1c')];var _0xabfad;if(_0x37ebfb>=_0x403555){_0x37ebfb=_0x403555;_0xabfad=0xc8;}else{_0xabfad=0xce;}_0x9f7f07[_0xc1e1('0x17')](_0xabfad);return _0x9f7f07[_0xc1e1('0x1e')](_0xc1e1('0x1f'),_0x4d8136+'-'+_0x37ebfb+'/'+_0x403555)[_0xc1e1('0x19')](_0x53125e);}return null;};}function patchUpdates(_0xf3a959){return function(_0x2c021e){try{jsonpatch[_0xc1e1('0x20')](_0x2c021e,_0xf3a959,!![]);}catch(_0x3ae7ba){return BPromise[_0xc1e1('0x21')](_0x3ae7ba);}return _0x2c021e['save']();};}function saveUpdates(_0x35521b,_0x5b93c0){return function(_0x33ac5c){if(_0x33ac5c){return _0x33ac5c[_0xc1e1('0x22')](_0x35521b)[_0xc1e1('0x23')](function(_0x4254f7){return _0x4254f7;});}return null;};}function removeEntity(_0x62dfd1,_0x4162e2){return function(_0x234de5){if(_0x234de5){return _0x234de5['destroy']()[_0xc1e1('0x23')](function(){_0x62dfd1[_0xc1e1('0x17')](0xcc)[_0xc1e1('0x18')]();});}};}function handleEntityNotFound(_0x2bbad1,_0x1cafad){return function(_0x4c02b6){if(!_0x4c02b6){_0x2bbad1[_0xc1e1('0x24')](0x194);}return _0x4c02b6;};}function handleError(_0x47c3a1,_0x12acda){_0x12acda=_0x12acda||0x1f4;return function(_0x2ca93a){logger['error'](_0x2ca93a[_0xc1e1('0x25')]);if(_0x2ca93a['name']){delete _0x2ca93a[_0xc1e1('0x26')];}_0x47c3a1['status'](_0x12acda)[_0xc1e1('0x27')](_0x2ca93a);};}exports['index']=function(_0x43e623,_0x41d7eb){var _0x441c6c={},_0x329288={},_0x55ef64={'count':0x0,'rows':[]};var _0x2f188a=_[_0xc1e1('0x28')](db[_0xc1e1('0x29')][_0xc1e1('0x2a')],function(_0x298ede){return{'name':_0x298ede['fieldName'],'type':_0x298ede[_0xc1e1('0x2b')][_0xc1e1('0x2c')]};});_0x329288[_0xc1e1('0x2d')]=_[_0xc1e1('0x28')](_0x2f188a,_0xc1e1('0x26'));_0x329288[_0xc1e1('0x2e')]=_['keys'](_0x43e623[_0xc1e1('0x2e')]);_0x329288[_0xc1e1('0x2f')]=_['intersection'](_0x329288[_0xc1e1('0x2d')],_0x329288[_0xc1e1('0x2e')]);_0x441c6c[_0xc1e1('0x30')]=_[_0xc1e1('0x31')](_0x329288[_0xc1e1('0x2d')],qs[_0xc1e1('0x32')](_0x43e623['query'][_0xc1e1('0x32')]));_0x441c6c['attributes']=_0x441c6c['attributes'][_0xc1e1('0x33')]?_0x441c6c[_0xc1e1('0x30')]:_0x329288[_0xc1e1('0x2d')];if(!_0x43e623['query'][_0xc1e1('0x34')](_0xc1e1('0x35'))){_0x441c6c[_0xc1e1('0x1c')]=qs[_0xc1e1('0x1c')](_0x43e623['query'][_0xc1e1('0x1c')]);_0x441c6c[_0xc1e1('0x1a')]=qs[_0xc1e1('0x1a')](_0x43e623[_0xc1e1('0x2e')][_0xc1e1('0x1a')]);}_0x441c6c['order']=qs[_0xc1e1('0x36')](_0x43e623[_0xc1e1('0x2e')]['sort']);_0x441c6c[_0xc1e1('0x37')]=qs[_0xc1e1('0x2f')](_['pick'](_0x43e623[_0xc1e1('0x2e')],_0x329288[_0xc1e1('0x2f')]),_0x2f188a);if(_0x43e623[_0xc1e1('0x2e')][_0xc1e1('0x38')]){_0x441c6c[_0xc1e1('0x37')]=_['merge'](_0x441c6c[_0xc1e1('0x37')],{'$or':_['map'](_0x2f188a,function(_0x3bc2a0){if(_0x3bc2a0['type']!==_0xc1e1('0x39')){var _0x21b40f={};_0x21b40f[_0x3bc2a0[_0xc1e1('0x26')]]={'$like':'%'+_0x43e623['query'][_0xc1e1('0x38')]+'%'};return _0x21b40f;}})});}_0x441c6c=_[_0xc1e1('0x3a')]({},_0x441c6c,_0x43e623[_0xc1e1('0x3b')]);var _0x22885e={'where':_0x441c6c[_0xc1e1('0x37')]};return db['MailTransferReport'][_0xc1e1('0x1d')](_0x22885e)[_0xc1e1('0x23')](function(_0x268df5){_0x55ef64['count']=_0x268df5;if(_0x43e623[_0xc1e1('0x2e')][_0xc1e1('0x3c')]){_0x441c6c[_0xc1e1('0x3d')]=[{'all':!![]}];}return db['MailTransferReport'][_0xc1e1('0x3e')](_0x441c6c);})[_0xc1e1('0x23')](function(_0x4cb8e9){_0x55ef64['rows']=_0x4cb8e9;return _0x55ef64;})[_0xc1e1('0x23')](respondWithFilteredResult(_0x41d7eb,_0x441c6c))[_0xc1e1('0x3f')](handleError(_0x41d7eb,null));};exports['show']=function(_0x15401d,_0x2c5080){var _0x1f27fe={'raw':!![],'where':{'id':_0x15401d[_0xc1e1('0x40')]['id']}},_0x5b61bc={};_0x5b61bc[_0xc1e1('0x2d')]=_[_0xc1e1('0x41')](db['MailTransferReport'][_0xc1e1('0x2a')]);_0x5b61bc['query']=_[_0xc1e1('0x41')](_0x15401d['query']);_0x5b61bc[_0xc1e1('0x2f')]=_['intersection'](_0x5b61bc[_0xc1e1('0x2d')],_0x5b61bc[_0xc1e1('0x2e')]);_0x1f27fe[_0xc1e1('0x30')]=_[_0xc1e1('0x31')](_0x5b61bc[_0xc1e1('0x2d')],qs[_0xc1e1('0x32')](_0x15401d['query'][_0xc1e1('0x32')]));_0x1f27fe[_0xc1e1('0x30')]=_0x1f27fe['attributes'][_0xc1e1('0x33')]?_0x1f27fe[_0xc1e1('0x30')]:_0x5b61bc[_0xc1e1('0x2d')];if(_0x15401d['query']['includeAll']){_0x1f27fe[_0xc1e1('0x3d')]=[{'all':!![]}];}_0x1f27fe=_[_0xc1e1('0x3a')]({},_0x1f27fe,_0x15401d[_0xc1e1('0x3b')]);return db[_0xc1e1('0x29')][_0xc1e1('0x42')](_0x1f27fe)['then'](handleEntityNotFound(_0x2c5080,null))[_0xc1e1('0x23')](respondWithResult(_0x2c5080,null))[_0xc1e1('0x3f')](handleError(_0x2c5080,null));};exports[_0xc1e1('0x43')]=function(_0x272df5,_0xa349a0){return db[_0xc1e1('0x29')]['create'](_0x272df5[_0xc1e1('0x44')],{})[_0xc1e1('0x23')](respondWithResult(_0xa349a0,0xc9))[_0xc1e1('0x3f')](handleError(_0xa349a0,null));};exports[_0xc1e1('0x22')]=function(_0x506270,_0x3e2952){if(_0x506270[_0xc1e1('0x44')]['id']){delete _0x506270['body']['id'];}return db['MailTransferReport'][_0xc1e1('0x42')]({'where':{'id':_0x506270['params']['id']}})[_0xc1e1('0x23')](handleEntityNotFound(_0x3e2952,null))[_0xc1e1('0x23')](saveUpdates(_0x506270[_0xc1e1('0x44')],null))[_0xc1e1('0x23')](respondWithResult(_0x3e2952,null))[_0xc1e1('0x3f')](handleError(_0x3e2952,null));};exports['destroy']=function(_0x5a7fd2,_0x4a9156){return db['MailTransferReport'][_0xc1e1('0x42')]({'where':{'id':_0x5a7fd2['params']['id']}})[_0xc1e1('0x23')](handleEntityNotFound(_0x4a9156,null))[_0xc1e1('0x23')](removeEntity(_0x4a9156,null))[_0xc1e1('0x3f')](handleError(_0x4a9156,null));};exports[_0xc1e1('0x45')]=function(_0x5d5591,_0x4e0605){return db[_0xc1e1('0x29')][_0xc1e1('0x45')]()[_0xc1e1('0x23')](respondWithResult(_0x4e0605,null))[_0xc1e1('0x3f')](handleError(_0x4e0605,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 1dbc99b..ad3ff3c 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 _0x1d86=['api','bluebird','request-promise','rimraf','../../config/environment','./mailTransferReport.attributes','MailTransferReport','report_mail_transfer','uniqueid'];(function(_0xfcb530,_0x3a4a84){var _0x381fa0=function(_0x24f5e7){while(--_0x24f5e7){_0xfcb530['push'](_0xfcb530['shift']());}};_0x381fa0(++_0x3a4a84);}(_0x1d86,0x7e));var _0x61d8=function(_0x22d4bb,_0x451b25){_0x22d4bb=_0x22d4bb-0x0;var _0x5c7d5f=_0x1d86[_0x22d4bb];return _0x5c7d5f;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x61d8('0x0'));var moment=require('moment');var BPromise=require(_0x61d8('0x1'));var rp=require(_0x61d8('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x61d8('0x3'));var config=require(_0x61d8('0x4'));var attributes=require(_0x61d8('0x5'));module['exports']=function(_0x18b56f,_0x5008dd){return _0x18b56f['define'](_0x61d8('0x6'),attributes,{'tableName':_0x61d8('0x7'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x61d8('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1af5=['./mailTransferReport.attributes','exports','define','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x44c57f,_0x59abd0){var _0xc77ca0=function(_0xd6d079){while(--_0xd6d079){_0x44c57f['push'](_0x44c57f['shift']());}};_0xc77ca0(++_0x59abd0);}(_0x1af5,0x17d));var _0x51af=function(_0x39f5fa,_0x26a39f){_0x39f5fa=_0x39f5fa-0x0;var _0x1ac658=_0x1af5[_0x39f5fa];return _0x1ac658;};'use strict';var _=require(_0x51af('0x0'));var util=require('util');var logger=require(_0x51af('0x1'))(_0x51af('0x2'));var moment=require(_0x51af('0x3'));var BPromise=require(_0x51af('0x4'));var rp=require(_0x51af('0x5'));var fs=require('fs');var path=require(_0x51af('0x6'));var rimraf=require(_0x51af('0x7'));var config=require(_0x51af('0x8'));var attributes=require(_0x51af('0x9'));module[_0x51af('0xa')]=function(_0x348f39,_0x3ebdd0){return _0x348f39[_0x51af('0xb')]('MailTransferReport',attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':_0x51af('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 857b0fe..eb87778 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 _0x6941=['ioredis','../../mysqldb','../../config/utils','rpc','client','http','then','info','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','MailTransferReport,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird'];(function(_0x50477c,_0x2aece7){var _0x3212a5=function(_0x45e3d8){while(--_0x45e3d8){_0x50477c['push'](_0x50477c['shift']());}};_0x3212a5(++_0x2aece7);}(_0x6941,0x137));var _0x1694=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0x6941[_0x29b609];return _0x54c952;};'use strict';var _=require(_0x1694('0x0'));var util=require(_0x1694('0x1'));var moment=require(_0x1694('0x2'));var BPromise=require(_0x1694('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1694('0x4'));var db=require(_0x1694('0x5'))['db'];var utils=require(_0x1694('0x6'));var logger=require('../../config/logger')(_0x1694('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1694('0x8')][_0x1694('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x57d669,_0x28c21f,_0x4ce22c){return new BPromise(function(_0x420ce4,_0x2a647d){return client['request'](_0x57d669,_0x4ce22c)[_0x1694('0xa')](function(_0x3d5606){logger[_0x1694('0xb')]('MailTransferReport,\x20%s,\x20%s',_0x28c21f,_0x1694('0xc'));logger[_0x1694('0xd')](_0x1694('0xe'),_0x28c21f,_0x1694('0xc'),JSON[_0x1694('0xf')](_0x3d5606));if(_0x3d5606[_0x1694('0x10')]){if(_0x3d5606[_0x1694('0x10')][_0x1694('0x11')]===0x1f4){logger[_0x1694('0x10')](_0x1694('0x12'),_0x28c21f,_0x3d5606['error'][_0x1694('0x13')]);return _0x2a647d(_0x3d5606['error'][_0x1694('0x13')]);}logger['error'](_0x1694('0x12'),_0x28c21f,_0x3d5606[_0x1694('0x10')][_0x1694('0x13')]);return _0x420ce4(_0x3d5606[_0x1694('0x10')][_0x1694('0x13')]);}else{logger[_0x1694('0xb')](_0x1694('0x12'),_0x28c21f,_0x1694('0xc'));_0x420ce4(_0x3d5606['result'][_0x1694('0x13')]);}})[_0x1694('0x14')](function(_0x4fdddd){logger[_0x1694('0x10')]('MailTransferReport,\x20%s,\x20%s',_0x28c21f,_0x4fdddd);_0x2a647d(_0x4fdddd);});});} \ No newline at end of file +var _0x3d48=['jayson/promise','client','http','request','then','info','MailTransferReport,\x20%s,\x20%s','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','result','message','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3e342b,_0x4fcbbe){var _0x5c1f14=function(_0x1c57c2){while(--_0x1c57c2){_0x3e342b['push'](_0x3e342b['shift']());}};_0x5c1f14(++_0x4fcbbe);}(_0x3d48,0x1a0));var _0x83d4=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x3d48[_0x4565bf];return _0x5610ba;};'use strict';var _=require('lodash');var util=require(_0x83d4('0x0'));var moment=require(_0x83d4('0x1'));var BPromise=require(_0x83d4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x83d4('0x3'));var db=require(_0x83d4('0x4'))['db'];var utils=require(_0x83d4('0x5'));var logger=require(_0x83d4('0x6'))(_0x83d4('0x7'));var config=require(_0x83d4('0x8'));var jayson=require(_0x83d4('0x9'));var client=jayson[_0x83d4('0xa')][_0x83d4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3a9110,_0x2e6de5,_0x507c9d){return new BPromise(function(_0x1c9c72,_0x45cae9){return client[_0x83d4('0xc')](_0x3a9110,_0x507c9d)[_0x83d4('0xd')](function(_0x13e92a){logger[_0x83d4('0xe')](_0x83d4('0xf'),_0x2e6de5,'request\x20sent');logger[_0x83d4('0x10')](_0x83d4('0x11'),_0x2e6de5,_0x83d4('0x12'),JSON[_0x83d4('0x13')](_0x13e92a));if(_0x13e92a[_0x83d4('0x14')]){if(_0x13e92a[_0x83d4('0x14')][_0x83d4('0x15')]===0x1f4){logger[_0x83d4('0x14')](_0x83d4('0xf'),_0x2e6de5,_0x13e92a[_0x83d4('0x14')]['message']);return _0x45cae9(_0x13e92a[_0x83d4('0x14')]['message']);}logger['error'](_0x83d4('0xf'),_0x2e6de5,_0x13e92a[_0x83d4('0x14')]['message']);return _0x1c9c72(_0x13e92a['error']['message']);}else{logger['info']('MailTransferReport,\x20%s,\x20%s',_0x2e6de5,'request\x20sent');_0x1c9c72(_0x13e92a[_0x83d4('0x16')][_0x83d4('0x17')]);}})[_0x83d4('0x18')](function(_0x345cc8){logger[_0x83d4('0x14')](_0x83d4('0xf'),_0x2e6de5,_0x345cc8);_0x45cae9(_0x345cc8);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index cfc3196..2248afe 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 _0x8f80=['isAuthenticated','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','Router','../../config/environment','./memberReport.controller','get'];(function(_0x2d0cfb,_0x48c6a4){var _0x5de578=function(_0x16b4bb){while(--_0x16b4bb){_0x2d0cfb['push'](_0x2d0cfb['shift']());}};_0x5de578(++_0x48c6a4);}(_0x8f80,0x11c));var _0x08f8=function(_0x3815e4,_0x220295){_0x3815e4=_0x3815e4-0x0;var _0x44bff0=_0x8f80[_0x3815e4];return _0x44bff0;};'use strict';var multer=require(_0x08f8('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x08f8('0x1')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x08f8('0x2'));var controller=require(_0x08f8('0x3'));router[_0x08f8('0x4')]('/',auth[_0x08f8('0x5')](),controller['index']);router[_0x08f8('0x4')](_0x08f8('0x6'),auth['isAuthenticated'](),controller[_0x08f8('0x7')]);router[_0x08f8('0x4')](_0x08f8('0x8'),auth[_0x08f8('0x5')](),controller[_0x08f8('0x9')]);router[_0x08f8('0xa')]('/',auth[_0x08f8('0x5')](),controller[_0x08f8('0xb')]);router[_0x08f8('0xc')]('/:id',auth[_0x08f8('0x5')](),controller[_0x08f8('0xd')]);router[_0x08f8('0xe')](_0x08f8('0x8'),auth[_0x08f8('0x5')](),controller[_0x08f8('0xf')]);module[_0x08f8('0x10')]=router; \ No newline at end of file +var _0x7664=['update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get','index','/describe','isAuthenticated','describe','/:id','create'];(function(_0x8469cd,_0x1de1da){var _0x4eee1e=function(_0x28a639){while(--_0x28a639){_0x8469cd['push'](_0x8469cd['shift']());}};_0x4eee1e(++_0x1de1da);}(_0x7664,0xd6));var _0x4766=function(_0xeb4c8b,_0x1dc497){_0xeb4c8b=_0xeb4c8b-0x0;var _0x90b0d0=_0x7664[_0xeb4c8b];return _0x90b0d0;};'use strict';var multer=require(_0x4766('0x0'));var util=require(_0x4766('0x1'));var path=require(_0x4766('0x2'));var timeout=require(_0x4766('0x3'));var express=require('express');var router=express[_0x4766('0x4')]();var fs_extra=require(_0x4766('0x5'));var auth=require(_0x4766('0x6'));var interaction=require(_0x4766('0x7'));var config=require(_0x4766('0x8'));var controller=require(_0x4766('0x9'));router[_0x4766('0xa')]('/',auth['isAuthenticated'](),controller[_0x4766('0xb')]);router[_0x4766('0xa')](_0x4766('0xc'),auth[_0x4766('0xd')](),controller[_0x4766('0xe')]);router[_0x4766('0xa')](_0x4766('0xf'),auth[_0x4766('0xd')](),controller['show']);router['post']('/',auth[_0x4766('0xd')](),controller[_0x4766('0x10')]);router['put'](_0x4766('0xf'),auth[_0x4766('0xd')](),controller[_0x4766('0x11')]);router[_0x4766('0x12')](_0x4766('0xf'),auth[_0x4766('0xd')](),controller[_0x4766('0x13')]);module[_0x4766('0x14')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 76bcc0e..38d5b2e 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 _0xb582=['LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','diff','seconds','setDataValue','talk:[inbound,\x20outbound],\x20pause:[reason]','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE'];(function(_0x589aee,_0x140a03){var _0x2f5ed4=function(_0x3d224f){while(--_0x3d224f){_0x589aee['push'](_0x589aee['shift']());}};_0x2f5ed4(++_0x140a03);}(_0xb582,0x1e7));var _0x2b58=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xb582[_0x618414];return _0x21c19a;};'use strict';var Sequelize=require(_0x2b58('0x0'));var moment=require(_0x2b58('0x1'));module[_0x2b58('0x2')]={'channel':{'type':Sequelize[_0x2b58('0x3')]},'membername':{'type':Sequelize[_0x2b58('0x3')]},'interface':{'type':Sequelize[_0x2b58('0x3')]},'type':{'type':Sequelize[_0x2b58('0x3')],'defaultValue':_0x2b58('0x4'),'comment':_0x2b58('0x5')},'duration':{'type':Sequelize[_0x2b58('0x6')]},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x2b58('0x7')],'set':function(_0x3fcfd1){var _0x36bd74=moment(_0x3fcfd1);var _0x1dc05e=moment(this['getDataValue']('enterAt'));var _0x3cae2c=_0x36bd74[_0x2b58('0x8')](_0x1dc05e,_0x2b58('0x9'));this[_0x2b58('0xa')]('exitAt',_0x3fcfd1);this['setDataValue']('duration',_0x3cae2c>=0x0?_0x3cae2c:null);}},'data1':{'type':Sequelize['STRING'],'comment':_0x2b58('0xb')},'data2':{'type':Sequelize['STRING'],'comment':'talk:[start]'},'data3':{'type':Sequelize[_0x2b58('0x3')],'comment':'talk:[destination]'},'data4':{'type':Sequelize[_0x2b58('0x3')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize['STRING'],'comment':'talk:[queue]'},'role':{'type':Sequelize[_0x2b58('0x3')]},'internal':{'type':Sequelize[_0x2b58('0x6')]},'uniqueid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe4d6=['exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','sequelize','moment','exports','STRING','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','enterAt','seconds','setDataValue'];(function(_0x4f8e84,_0x36adc9){var _0x2ab68f=function(_0x637930){while(--_0x637930){_0x4f8e84['push'](_0x4f8e84['shift']());}};_0x2ab68f(++_0x36adc9);}(_0xe4d6,0xe6));var _0x6e4d=function(_0x6a022f,_0xd0600b){_0x6a022f=_0x6a022f-0x0;var _0xebb3b4=_0xe4d6[_0x6a022f];return _0xebb3b4;};'use strict';var Sequelize=require(_0x6e4d('0x0'));var moment=require(_0x6e4d('0x1'));module[_0x6e4d('0x2')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x6e4d('0x3')]},'interface':{'type':Sequelize[_0x6e4d('0x3')]},'type':{'type':Sequelize[_0x6e4d('0x3')],'defaultValue':'DEFAULT\x20PAUSE','comment':_0x6e4d('0x4')},'duration':{'type':Sequelize[_0x6e4d('0x5')]},'enterAt':{'type':Sequelize[_0x6e4d('0x6')]},'exitAt':{'type':Sequelize[_0x6e4d('0x6')],'set':function(_0x236357){var _0x5b57ab=moment(_0x236357);var _0x5bf2ae=moment(this['getDataValue'](_0x6e4d('0x7')));var _0x2641ce=_0x5b57ab['diff'](_0x5bf2ae,_0x6e4d('0x8'));this[_0x6e4d('0x9')](_0x6e4d('0xa'),_0x236357);this[_0x6e4d('0x9')](_0x6e4d('0xb'),_0x2641ce>=0x0?_0x2641ce:null);}},'data1':{'type':Sequelize[_0x6e4d('0x3')],'comment':_0x6e4d('0xc')},'data2':{'type':Sequelize[_0x6e4d('0x3')],'comment':_0x6e4d('0xd')},'data3':{'type':Sequelize[_0x6e4d('0x3')],'comment':_0x6e4d('0xe')},'data4':{'type':Sequelize[_0x6e4d('0x3')],'comment':_0x6e4d('0xf')},'data5':{'type':Sequelize[_0x6e4d('0x3')],'comment':'talk:[queue]'},'role':{'type':Sequelize[_0x6e4d('0x3')]},'internal':{'type':Sequelize[_0x6e4d('0x5')]},'uniqueid':{'type':Sequelize[_0x6e4d('0x3')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 7862c88..62ee71d 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(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0xedd9,0xfc));var _0x9edd=function(_0x2e3942,_0x175d6a){_0x2e3942=_0x2e3942-0x0;var _0x2bfb83=_0xedd9[_0x2e3942];return _0x2bfb83;};'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 _0x9957=['util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','MemberReport','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache'];(function(_0x2ee974,_0x1cceb5){var _0x20c5fb=function(_0xc54e84){while(--_0xc54e84){_0x2ee974['push'](_0x2ee974['shift']());}};_0x20c5fb(++_0x1cceb5);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['MemberReport']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['MemberReport'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['MemberReport'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x4ffc8a['params']['id']}})['then'](handleEntityNotFound(_0x19da63,null))['then'](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x4c')]=function(_0x4cf5db,_0x1cd85){return db[_0x7995('0x40')][_0x7995('0x4c')]()[_0x7995('0x26')](respondWithResult(_0x1cd85,null))[_0x7995('0x49')](handleError(_0x1cd85,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index fd9959d..45d126d 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 _0xc1e6=['bluebird','request-promise','path','rimraf','../../config/environment','./memberReport.attributes','exports','define','MemberReport','report_member','membername_interface','membername','interface','lodash','moment'];(function(_0x1f9440,_0x2f510b){var _0x5620a1=function(_0x223197){while(--_0x223197){_0x1f9440['push'](_0x1f9440['shift']());}};_0x5620a1(++_0x2f510b);}(_0xc1e6,0x12a));var _0x6c1e=function(_0x412eb2,_0x265ab7){_0x412eb2=_0x412eb2-0x0;var _0x19f1a8=_0xc1e6[_0x412eb2];return _0x19f1a8;};'use strict';var _=require(_0x6c1e('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x6c1e('0x1'));var BPromise=require(_0x6c1e('0x2'));var rp=require(_0x6c1e('0x3'));var fs=require('fs');var path=require(_0x6c1e('0x4'));var rimraf=require(_0x6c1e('0x5'));var config=require(_0x6c1e('0x6'));var attributes=require(_0x6c1e('0x7'));module[_0x6c1e('0x8')]=function(_0x52d0cc,_0x44dbac){return _0x52d0cc[_0x6c1e('0x9')](_0x6c1e('0xa'),attributes,{'tableName':_0x6c1e('0xb'),'paranoid':![],'indexes':[{'name':_0x6c1e('0xc'),'fields':[_0x6c1e('0xd'),_0x6c1e('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x503a=['membername','interface','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./memberReport.attributes','exports','define','MemberReport','membername_interface'];(function(_0x28b0a1,_0x99bd0a){var _0x21470c=function(_0x45bf01){while(--_0x45bf01){_0x28b0a1['push'](_0x28b0a1['shift']());}};_0x21470c(++_0x99bd0a);}(_0x503a,0x1b4));var _0xa503=function(_0x4d180c,_0x45c68e){_0x4d180c=_0x4d180c-0x0;var _0x49b57e=_0x503a[_0x4d180c];return _0x49b57e;};'use strict';var _=require('lodash');var util=require(_0xa503('0x0'));var logger=require(_0xa503('0x1'))('api');var moment=require(_0xa503('0x2'));var BPromise=require(_0xa503('0x3'));var rp=require(_0xa503('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa503('0x5'));var config=require(_0xa503('0x6'));var attributes=require(_0xa503('0x7'));module[_0xa503('0x8')]=function(_0x345a72,_0x5bc9a7){return _0x345a72[_0xa503('0x9')](_0xa503('0xa'),attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':_0xa503('0xb'),'fields':[_0xa503('0xc'),_0xa503('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index ec7564b..5a0183f 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 _0xa6b0=['message','result','catch','findAll','options','raw','attributes','limit','include','map','then','GetMemberReport','CreateMemberReport','MemberReport','create','body','UpdateMemberReport','update','where','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0xb8f6bd,_0x1a7952){var _0xaa0a8c=function(_0x58eaa5){while(--_0x58eaa5){_0xb8f6bd['push'](_0xb8f6bd['shift']());}};_0xaa0a8c(++_0x1a7952);}(_0xa6b0,0xaf));var _0x0a6b=function(_0x1cff6e,_0x37ae14){_0x1cff6e=_0x1cff6e-0x0;var _0x1a535e=_0xa6b0[_0x1cff6e];return _0x1a535e;};'use strict';var _=require(_0x0a6b('0x0'));var util=require(_0x0a6b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0a6b('0x2'));var fs=require('fs');var Redis=require(_0x0a6b('0x3'));var db=require(_0x0a6b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0a6b('0x5'))(_0x0a6b('0x6'));var config=require(_0x0a6b('0x7'));var jayson=require(_0x0a6b('0x8'));var client=jayson[_0x0a6b('0x9')][_0x0a6b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1b5fb5,_0xa908dd,_0x26f761){return new BPromise(function(_0x340a33,_0x8e89f){return client[_0x0a6b('0xb')](_0x1b5fb5,_0x26f761)['then'](function(_0x493948){logger[_0x0a6b('0xc')](_0x0a6b('0xd'),_0xa908dd,_0x0a6b('0xe'));logger[_0x0a6b('0xf')](_0x0a6b('0x10'),_0xa908dd,_0x0a6b('0xe'),JSON[_0x0a6b('0x11')](_0x493948));if(_0x493948[_0x0a6b('0x12')]){if(_0x493948[_0x0a6b('0x12')][_0x0a6b('0x13')]===0x1f4){logger[_0x0a6b('0x12')](_0x0a6b('0xd'),_0xa908dd,_0x493948[_0x0a6b('0x12')][_0x0a6b('0x14')]);return _0x8e89f(_0x493948['error']['message']);}logger[_0x0a6b('0x12')](_0x0a6b('0xd'),_0xa908dd,_0x493948[_0x0a6b('0x12')][_0x0a6b('0x14')]);return _0x340a33(_0x493948[_0x0a6b('0x12')][_0x0a6b('0x14')]);}else{logger[_0x0a6b('0xc')](_0x0a6b('0xd'),_0xa908dd,_0x0a6b('0xe'));_0x340a33(_0x493948[_0x0a6b('0x15')]['message']);}})[_0x0a6b('0x16')](function(_0x1538f4){logger['error'](_0x0a6b('0xd'),_0xa908dd,_0x1538f4);_0x8e89f(_0x1538f4);});});}exports['GetMemberReport']=function(_0xcb412){var _0x31f347=this;return new Promise(function(_0x2cb10b,_0x1ad45d){return db['MemberReport'][_0x0a6b('0x17')]({'raw':_0xcb412[_0x0a6b('0x18')]?_0xcb412['options'][_0x0a6b('0x19')]===undefined?!![]:![]:!![],'where':_0xcb412[_0x0a6b('0x18')]?_0xcb412[_0x0a6b('0x18')]['where']||null:null,'attributes':_0xcb412[_0x0a6b('0x18')]?_0xcb412[_0x0a6b('0x18')][_0x0a6b('0x1a')]||null:null,'limit':_0xcb412['options']?_0xcb412[_0x0a6b('0x18')][_0x0a6b('0x1b')]||null:null,'include':_0xcb412[_0x0a6b('0x18')]?_0xcb412[_0x0a6b('0x18')][_0x0a6b('0x1c')]?_['map'](_0xcb412[_0x0a6b('0x18')][_0x0a6b('0x1c')],function(_0x3d153f){return{'model':db[_0x3d153f['model']],'as':_0x3d153f['as'],'attributes':_0x3d153f[_0x0a6b('0x1a')],'include':_0x3d153f[_0x0a6b('0x1c')]?_[_0x0a6b('0x1d')](_0x3d153f[_0x0a6b('0x1c')],function(_0x3b12a2){return{'model':db[_0x3b12a2['model']],'as':_0x3b12a2['as'],'attributes':_0x3b12a2[_0x0a6b('0x1a')],'include':_0x3b12a2[_0x0a6b('0x1c')]?_[_0x0a6b('0x1d')](_0x3b12a2['include'],function(_0x3a9092){return{'model':db[_0x3a9092['model']],'as':_0x3a9092['as'],'attributes':_0x3a9092[_0x0a6b('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x0a6b('0x1e')](function(_0x45ae97){logger['info']('GetMemberReport',_0xcb412);logger[_0x0a6b('0xf')](_0x0a6b('0x1f'),_0xcb412,JSON[_0x0a6b('0x11')](_0x45ae97));_0x2cb10b(_0x45ae97);})[_0x0a6b('0x16')](function(_0x1935a3){logger[_0x0a6b('0x12')]('GetMemberReport',_0x1935a3[_0x0a6b('0x14')],_0xcb412);_0x1ad45d(_0x31f347[_0x0a6b('0x12')](0x1f4,_0x1935a3['message']));});});};exports[_0x0a6b('0x20')]=function(_0x554145){var _0x4eb516=this;return new Promise(function(_0xbf2f1a,_0x24e96a){return db[_0x0a6b('0x21')][_0x0a6b('0x22')](_0x554145[_0x0a6b('0x23')],{'raw':_0x554145['options']?_0x554145['options'][_0x0a6b('0x19')]===undefined?!![]:![]:!![]})[_0x0a6b('0x1e')](function(_0x235cc3){logger[_0x0a6b('0xc')]('CreateMemberReport',_0x554145);logger[_0x0a6b('0xf')](_0x0a6b('0x20'),_0x554145,JSON['stringify'](_0x235cc3));_0xbf2f1a(_0x235cc3);})['catch'](function(_0x28067f){logger[_0x0a6b('0x12')]('CreateMemberReport',_0x28067f[_0x0a6b('0x14')],_0x554145);_0x24e96a(_0x4eb516[_0x0a6b('0x12')](0x1f4,_0x28067f[_0x0a6b('0x14')]));});});};exports[_0x0a6b('0x24')]=function(_0x404161){var _0x311a2d=this;return new Promise(function(_0x1f6f82,_0x17bb41){return db[_0x0a6b('0x21')][_0x0a6b('0x25')](_0x404161[_0x0a6b('0x23')],{'raw':_0x404161[_0x0a6b('0x18')]?_0x404161['options'][_0x0a6b('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x404161[_0x0a6b('0x18')]?_0x404161['options'][_0x0a6b('0x26')]||null:null,'attributes':_0x404161[_0x0a6b('0x18')]?_0x404161[_0x0a6b('0x18')][_0x0a6b('0x1a')]||null:null,'limit':_0x404161[_0x0a6b('0x18')]?_0x404161[_0x0a6b('0x18')][_0x0a6b('0x1b')]||null:null})[_0x0a6b('0x1e')](function(_0x4cf002){logger['info'](_0x0a6b('0x24'),_0x404161);logger[_0x0a6b('0xf')](_0x0a6b('0x24'),_0x404161,JSON[_0x0a6b('0x11')](_0x4cf002));_0x1f6f82(_0x4cf002);})[_0x0a6b('0x16')](function(_0x3f2449){logger[_0x0a6b('0x12')](_0x0a6b('0x24'),_0x3f2449[_0x0a6b('0x14')],_0x404161);_0x17bb41(_0x311a2d['error'](0x1f4,_0x3f2449[_0x0a6b('0x14')]));});});}; \ No newline at end of file +var _0x965d=['where','limit','include','model','attributes','map','stringify','create','body','CreateMemberReport','UpdateMemberReport','MemberReport','update','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','request','then','info','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','code','error','message','MemberReport,\x20%s,\x20%s','result','GetMemberReport','options','raw'];(function(_0x2af8fd,_0xd0493e){var _0x17191c=function(_0x48c904){while(--_0x48c904){_0x2af8fd['push'](_0x2af8fd['shift']());}};_0x17191c(++_0xd0493e);}(_0x965d,0x1be));var _0xd965=function(_0x42588e,_0x391c4b){_0x42588e=_0x42588e-0x0;var _0x59e8e4=_0x965d[_0x42588e];return _0x59e8e4;};'use strict';var _=require(_0xd965('0x0'));var util=require(_0xd965('0x1'));var moment=require('moment');var BPromise=require(_0xd965('0x2'));var rs=require(_0xd965('0x3'));var fs=require('fs');var Redis=require(_0xd965('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd965('0x5'));var logger=require(_0xd965('0x6'))(_0xd965('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2f9b86,_0x368f36,_0x5772e3){return new BPromise(function(_0x427868,_0x563c33){return client[_0xd965('0x8')](_0x2f9b86,_0x5772e3)[_0xd965('0x9')](function(_0xa4f9f9){logger[_0xd965('0xa')]('MemberReport,\x20%s,\x20%s',_0x368f36,_0xd965('0xb'));logger[_0xd965('0xc')](_0xd965('0xd'),_0x368f36,'request\x20sent',JSON['stringify'](_0xa4f9f9));if(_0xa4f9f9['error']){if(_0xa4f9f9['error'][_0xd965('0xe')]===0x1f4){logger[_0xd965('0xf')]('MemberReport,\x20%s,\x20%s',_0x368f36,_0xa4f9f9[_0xd965('0xf')][_0xd965('0x10')]);return _0x563c33(_0xa4f9f9[_0xd965('0xf')][_0xd965('0x10')]);}logger[_0xd965('0xf')]('MemberReport,\x20%s,\x20%s',_0x368f36,_0xa4f9f9[_0xd965('0xf')][_0xd965('0x10')]);return _0x427868(_0xa4f9f9['error']['message']);}else{logger['info'](_0xd965('0x11'),_0x368f36,_0xd965('0xb'));_0x427868(_0xa4f9f9[_0xd965('0x12')][_0xd965('0x10')]);}})['catch'](function(_0x439eca){logger[_0xd965('0xf')](_0xd965('0x11'),_0x368f36,_0x439eca);_0x563c33(_0x439eca);});});}exports[_0xd965('0x13')]=function(_0x45f930){var _0x5dbaff=this;return new Promise(function(_0x1321c1,_0x5e4659){return db['MemberReport']['findAll']({'raw':_0x45f930[_0xd965('0x14')]?_0x45f930[_0xd965('0x14')][_0xd965('0x15')]===undefined?!![]:![]:!![],'where':_0x45f930[_0xd965('0x14')]?_0x45f930['options'][_0xd965('0x16')]||null:null,'attributes':_0x45f930[_0xd965('0x14')]?_0x45f930[_0xd965('0x14')]['attributes']||null:null,'limit':_0x45f930['options']?_0x45f930['options'][_0xd965('0x17')]||null:null,'include':_0x45f930['options']?_0x45f930[_0xd965('0x14')][_0xd965('0x18')]?_['map'](_0x45f930['options'][_0xd965('0x18')],function(_0x140000){return{'model':db[_0x140000[_0xd965('0x19')]],'as':_0x140000['as'],'attributes':_0x140000[_0xd965('0x1a')],'include':_0x140000[_0xd965('0x18')]?_[_0xd965('0x1b')](_0x140000[_0xd965('0x18')],function(_0x1a7367){return{'model':db[_0x1a7367[_0xd965('0x19')]],'as':_0x1a7367['as'],'attributes':_0x1a7367[_0xd965('0x1a')],'include':_0x1a7367[_0xd965('0x18')]?_[_0xd965('0x1b')](_0x1a7367['include'],function(_0x3d8899){return{'model':db[_0x3d8899[_0xd965('0x19')]],'as':_0x3d8899['as'],'attributes':_0x3d8899['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4d6a07){logger['info']('GetMemberReport',_0x45f930);logger[_0xd965('0xc')](_0xd965('0x13'),_0x45f930,JSON[_0xd965('0x1c')](_0x4d6a07));_0x1321c1(_0x4d6a07);})['catch'](function(_0x20b8b9){logger[_0xd965('0xf')](_0xd965('0x13'),_0x20b8b9['message'],_0x45f930);_0x5e4659(_0x5dbaff[_0xd965('0xf')](0x1f4,_0x20b8b9['message']));});});};exports['CreateMemberReport']=function(_0x5ac01e){var _0x26379d=this;return new Promise(function(_0x5d2d32,_0x29b600){return db['MemberReport'][_0xd965('0x1d')](_0x5ac01e[_0xd965('0x1e')],{'raw':_0x5ac01e[_0xd965('0x14')]?_0x5ac01e[_0xd965('0x14')]['raw']===undefined?!![]:![]:!![]})[_0xd965('0x9')](function(_0x1eb100){logger['info'](_0xd965('0x1f'),_0x5ac01e);logger[_0xd965('0xc')]('CreateMemberReport',_0x5ac01e,JSON[_0xd965('0x1c')](_0x1eb100));_0x5d2d32(_0x1eb100);})['catch'](function(_0x3c3246){logger[_0xd965('0xf')](_0xd965('0x1f'),_0x3c3246[_0xd965('0x10')],_0x5ac01e);_0x29b600(_0x26379d['error'](0x1f4,_0x3c3246[_0xd965('0x10')]));});});};exports[_0xd965('0x20')]=function(_0x4e974a){var _0x259543=this;return new Promise(function(_0x15286,_0x3dd72d){return db[_0xd965('0x21')][_0xd965('0x22')](_0x4e974a[_0xd965('0x1e')],{'raw':_0x4e974a['options']?_0x4e974a[_0xd965('0x14')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4e974a[_0xd965('0x14')]?_0x4e974a[_0xd965('0x14')]['where']||null:null,'attributes':_0x4e974a[_0xd965('0x14')]?_0x4e974a[_0xd965('0x14')][_0xd965('0x1a')]||null:null,'limit':_0x4e974a[_0xd965('0x14')]?_0x4e974a[_0xd965('0x14')][_0xd965('0x17')]||null:null})[_0xd965('0x9')](function(_0xdd22bb){logger[_0xd965('0xa')](_0xd965('0x20'),_0x4e974a);logger['debug'](_0xd965('0x20'),_0x4e974a,JSON[_0xd965('0x1c')](_0xdd22bb));_0x15286(_0xdd22bb);})[_0xd965('0x23')](function(_0x48115b){logger['error']('UpdateMemberReport',_0x48115b[_0xd965('0x10')],_0x4e974a);_0x3dd72d(_0x259543[_0xd965('0xf')](0x1f4,_0x48115b[_0xd965('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index fd62415..8f88a02 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 _0x78e0=['fs-extra','../../components/auth/service','./migration.controller','get','index','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x35eb2b,_0x5b49b5){var _0x1c3a03=function(_0x364146){while(--_0x364146){_0x35eb2b['push'](_0x35eb2b['shift']());}};_0x1c3a03(++_0x5b49b5);}(_0x78e0,0x13e));var _0x078e=function(_0x59ee91,_0x5ca1ef){_0x59ee91=_0x59ee91-0x0;var _0x51b0b7=_0x78e0[_0x59ee91];return _0x51b0b7;};'use strict';var multer=require(_0x078e('0x0'));var util=require(_0x078e('0x1'));var path=require(_0x078e('0x2'));var timeout=require(_0x078e('0x3'));var express=require(_0x078e('0x4'));var router=express[_0x078e('0x5')]();var fs_extra=require(_0x078e('0x6'));var auth=require(_0x078e('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x078e('0x8'));router[_0x078e('0x9')]('/',controller[_0x078e('0xa')]);module[_0x078e('0xb')]=router; \ No newline at end of file +var _0xf2d7=['../../config/environment','get','multer','path','connect-timeout','express','Router'];(function(_0x317d6f,_0x1eb629){var _0x7f8a7=function(_0x46cb30){while(--_0x46cb30){_0x317d6f['push'](_0x317d6f['shift']());}};_0x7f8a7(++_0x1eb629);}(_0xf2d7,0x121));var _0x7f2d=function(_0x4f70f8,_0x88d889){_0x4f70f8=_0x4f70f8-0x0;var _0x28164f=_0xf2d7[_0x4f70f8];return _0x28164f;};'use strict';var multer=require(_0x7f2d('0x0'));var util=require('util');var path=require(_0x7f2d('0x1'));var timeout=require(_0x7f2d('0x2'));var express=require(_0x7f2d('0x3'));var router=express[_0x7f2d('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7f2d('0x5'));var controller=require('./migration.controller');router[_0x7f2d('0x6')]('/',controller['index']);module['exports']=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 233481c..60d624e 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 _0x0c7d=['version','exports','STRING'];(function(_0x5d5e8b,_0xb51c9d){var _0x16e45a=function(_0x17d601){while(--_0x17d601){_0x5d5e8b['push'](_0x5d5e8b['shift']());}};_0x16e45a(++_0xb51c9d);}(_0x0c7d,0x130));var _0xd0c7=function(_0x14dd10,_0x4900d6){_0x14dd10=_0x14dd10-0x0;var _0x5cb641=_0x0c7d[_0x14dd10];return _0x5cb641;};'use strict';var Sequelize=require('sequelize');module[_0xd0c7('0x0')]={'version':{'type':Sequelize[_0xd0c7('0x1')],'unique':_0xd0c7('0x2')}}; \ No newline at end of file +var _0x3b1f=['STRING','sequelize','exports'];(function(_0x3653a6,_0x58c1ec){var _0x3c7d2a=function(_0x19b69d){while(--_0x19b69d){_0x3653a6['push'](_0x3653a6['shift']());}};_0x3c7d2a(++_0x58c1ec);}(_0x3b1f,0x181));var _0xf3b1=function(_0x492576,_0x385125){_0x492576=_0x492576-0x0;var _0x54d23c=_0x3b1f[_0x492576];return _0x54d23c;};'use strict';var Sequelize=require(_0xf3b1('0x0'));module[_0xf3b1('0x1')]={'version':{'type':Sequelize[_0xf3b1('0x2')],'unique':'version'}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 63f14b6..125591e 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 _0x4331=['filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','type','VIRTUAL','filter','merge','includeAll','include','findAll','catch','eml-format','rimraf','request-promise','moment','bluebird','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','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','map','Migration','rawAttributes','fieldName','key','model','keys'];(function(_0x21f4f1,_0x2accb8){var _0x675c84=function(_0x55659e){while(--_0x55659e){_0x21f4f1['push'](_0x21f4f1['shift']());}};_0x675c84(++_0x2accb8);}(_0x4331,0x1b2));var _0x1433=function(_0x57091a,_0x914cdd){_0x57091a=_0x57091a-0x0;var _0x5f2641=_0x4331[_0x57091a];return _0x5f2641;};'use strict';var emlformat=require(_0x1433('0x0'));var rimraf=require(_0x1433('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1433('0x2'));var moment=require(_0x1433('0x3'));var BPromise=require(_0x1433('0x4'));var Mustache=require('mustache');var util=require(_0x1433('0x5'));var path=require(_0x1433('0x6'));var sox=require(_0x1433('0x7'));var csv=require(_0x1433('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1433('0x9'));var _=require(_0x1433('0xa'));var squel=require(_0x1433('0xb'));var crypto=require(_0x1433('0xc'));var jsforce=require(_0x1433('0xd'));var deskjs=require(_0x1433('0xe'));var toCsv=require(_0x1433('0x8'));var querystring=require('querystring');var Papa=require(_0x1433('0xf'));var Redis=require('ioredis');var authService=require(_0x1433('0x10'));var qs=require(_0x1433('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1433('0x12'));var logger=require(_0x1433('0x13'))('api');var utils=require(_0x1433('0x14'));var config=require(_0x1433('0x15'));var licenseUtil=require(_0x1433('0x16'));var db=require(_0x1433('0x17'))['db'];function respondWithStatusCode(_0xc78622,_0x478698){_0x478698=_0x478698||0xcc;return function(_0x44249c){if(_0x44249c){return _0xc78622[_0x1433('0x18')](_0x478698);}return _0xc78622[_0x1433('0x19')](_0x478698)[_0x1433('0x1a')]();};}function respondWithResult(_0x131925,_0x41de15){_0x41de15=_0x41de15||0xc8;return function(_0x31e825){if(_0x31e825){return _0x131925['status'](_0x41de15)['json'](_0x31e825);}};}function respondWithFilteredResult(_0x5d2ac4,_0x400632){return function(_0x9def7f){if(_0x9def7f){var _0x533981=typeof _0x400632[_0x1433('0x1b')]===_0x1433('0x1c')&&typeof _0x400632[_0x1433('0x1d')]===_0x1433('0x1c');var _0xa765a2=_0x9def7f[_0x1433('0x1e')];var _0x218d13=_0x533981?0x0:_0x400632[_0x1433('0x1b')];var _0x3e0af7=_0x533981?_0x9def7f[_0x1433('0x1e')]:_0x400632[_0x1433('0x1b')]+_0x400632[_0x1433('0x1d')];var _0xd996ee;if(_0x3e0af7>=_0xa765a2){_0x3e0af7=_0xa765a2;_0xd996ee=0xc8;}else{_0xd996ee=0xce;}_0x5d2ac4[_0x1433('0x19')](_0xd996ee);return _0x5d2ac4[_0x1433('0x1f')](_0x1433('0x20'),_0x218d13+'-'+_0x3e0af7+'/'+_0xa765a2)['json'](_0x9def7f);}return null;};}function patchUpdates(_0x1daf43){return function(_0x1c9823){try{jsonpatch[_0x1433('0x21')](_0x1c9823,_0x1daf43,!![]);}catch(_0x5392bf){return BPromise[_0x1433('0x22')](_0x5392bf);}return _0x1c9823[_0x1433('0x23')]();};}function saveUpdates(_0x51a18d,_0x105e2a){return function(_0x2a8f64){if(_0x2a8f64){return _0x2a8f64[_0x1433('0x24')](_0x51a18d)[_0x1433('0x25')](function(_0x169e51){return _0x169e51;});}return null;};}function removeEntity(_0x12ca13,_0x3dba62){return function(_0x49f94a){if(_0x49f94a){return _0x49f94a[_0x1433('0x26')]()[_0x1433('0x25')](function(){_0x12ca13[_0x1433('0x19')](0xcc)[_0x1433('0x1a')]();});}};}function handleEntityNotFound(_0x23e1cb,_0x561bca){return function(_0x33a993){if(!_0x33a993){_0x23e1cb['sendStatus'](0x194);}return _0x33a993;};}function handleError(_0x29ef53,_0x583d9e){_0x583d9e=_0x583d9e||0x1f4;return function(_0x254426){logger['error'](_0x254426[_0x1433('0x27')]);if(_0x254426[_0x1433('0x28')]){delete _0x254426['name'];}_0x29ef53[_0x1433('0x19')](_0x583d9e)[_0x1433('0x29')](_0x254426);};}exports['index']=function(_0xcd8082,_0x22d803){var _0x4076ec={},_0x90c41b={},_0x5795c2={'count':0x0,'rows':[]};var _0x19244=_[_0x1433('0x2a')](db[_0x1433('0x2b')][_0x1433('0x2c')],function(_0x15e9a0){return{'name':_0x15e9a0[_0x1433('0x2d')],'type':_0x15e9a0['type'][_0x1433('0x2e')]};});_0x90c41b[_0x1433('0x2f')]=_['map'](_0x19244,_0x1433('0x28'));_0x90c41b['query']=_[_0x1433('0x30')](_0xcd8082['query']);_0x90c41b[_0x1433('0x31')]=_['intersection'](_0x90c41b[_0x1433('0x2f')],_0x90c41b[_0x1433('0x32')]);_0x4076ec[_0x1433('0x33')]=_[_0x1433('0x34')](_0x90c41b[_0x1433('0x2f')],qs[_0x1433('0x35')](_0xcd8082[_0x1433('0x32')][_0x1433('0x35')]));_0x4076ec[_0x1433('0x33')]=_0x4076ec[_0x1433('0x33')][_0x1433('0x36')]?_0x4076ec['attributes']:_0x90c41b[_0x1433('0x2f')];if(!_0xcd8082[_0x1433('0x32')][_0x1433('0x37')](_0x1433('0x38'))){_0x4076ec[_0x1433('0x1d')]=qs[_0x1433('0x1d')](_0xcd8082['query'][_0x1433('0x1d')]);_0x4076ec[_0x1433('0x1b')]=qs[_0x1433('0x1b')](_0xcd8082[_0x1433('0x32')][_0x1433('0x1b')]);}_0x4076ec[_0x1433('0x39')]=qs[_0x1433('0x3a')](_0xcd8082['query'][_0x1433('0x3a')]);_0x4076ec[_0x1433('0x3b')]=qs[_0x1433('0x31')](_[_0x1433('0x3c')](_0xcd8082['query'],_0x90c41b['filters']),_0x19244);if(_0xcd8082[_0x1433('0x32')]['filter']){_0x4076ec[_0x1433('0x3b')]=_['merge'](_0x4076ec[_0x1433('0x3b')],{'$or':_[_0x1433('0x2a')](_0x19244,function(_0x70f572){if(_0x70f572[_0x1433('0x3d')]!==_0x1433('0x3e')){var _0x4e4b67={};_0x4e4b67[_0x70f572['name']]={'$like':'%'+_0xcd8082[_0x1433('0x32')][_0x1433('0x3f')]+'%'};return _0x4e4b67;}})});}_0x4076ec=_[_0x1433('0x40')]({},_0x4076ec,_0xcd8082['options']);var _0x422cb7={'where':_0x4076ec[_0x1433('0x3b')]};return db['Migration']['count'](_0x422cb7)[_0x1433('0x25')](function(_0x3ff4f8){_0x5795c2['count']=_0x3ff4f8;if(_0xcd8082[_0x1433('0x32')][_0x1433('0x41')]){_0x4076ec[_0x1433('0x42')]=[{'all':!![]}];}return db[_0x1433('0x2b')][_0x1433('0x43')](_0x4076ec);})[_0x1433('0x25')](function(_0xa56809){_0x5795c2['rows']=_0xa56809;return _0x5795c2;})[_0x1433('0x25')](respondWithFilteredResult(_0x22d803,_0x4076ec))[_0x1433('0x44')](handleError(_0x22d803,null));}; \ No newline at end of file +var _0x0578=['sox','ejs','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','error','stack','name','send','Migration','fieldName','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','includeAll','rows','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path'];(function(_0x1b603b,_0x52fb4a){var _0x29bb9e=function(_0xb50bff){while(--_0xb50bff){_0x1b603b['push'](_0x1b603b['shift']());}};_0x29bb9e(++_0x52fb4a);}(_0x0578,0x1b8));var _0x8057=function(_0x3d0de1,_0x3b9b78){_0x3d0de1=_0x3d0de1-0x0;var _0xb4f66c=_0x0578[_0x3d0de1];return _0xb4f66c;};'use strict';var emlformat=require(_0x8057('0x0'));var rimraf=require(_0x8057('0x1'));var zipdir=require(_0x8057('0x2'));var jsonpatch=require(_0x8057('0x3'));var rp=require(_0x8057('0x4'));var moment=require('moment');var BPromise=require(_0x8057('0x5'));var Mustache=require(_0x8057('0x6'));var util=require('util');var path=require(_0x8057('0x7'));var sox=require(_0x8057('0x8'));var csv=require('to-csv');var ejs=require(_0x8057('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8057('0xa'));var squel=require(_0x8057('0xb'));var crypto=require('crypto');var jsforce=require(_0x8057('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x8057('0xd'));var querystring=require(_0x8057('0xe'));var Papa=require(_0x8057('0xf'));var Redis=require(_0x8057('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8057('0x11'));var logger=require(_0x8057('0x12'))(_0x8057('0x13'));var utils=require(_0x8057('0x14'));var config=require(_0x8057('0x15'));var licenseUtil=require(_0x8057('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x47337f,_0x27635d){_0x27635d=_0x27635d||0xcc;return function(_0x511aa1){if(_0x511aa1){return _0x47337f[_0x8057('0x17')](_0x27635d);}return _0x47337f[_0x8057('0x18')](_0x27635d)['end']();};}function respondWithResult(_0x1915c6,_0x826189){_0x826189=_0x826189||0xc8;return function(_0x4c9507){if(_0x4c9507){return _0x1915c6[_0x8057('0x18')](_0x826189)[_0x8057('0x19')](_0x4c9507);}};}function respondWithFilteredResult(_0x70a8a7,_0x582fd5){return function(_0x3b9dbf){if(_0x3b9dbf){var _0x44a708=typeof _0x582fd5[_0x8057('0x1a')]===_0x8057('0x1b')&&typeof _0x582fd5[_0x8057('0x1c')]===_0x8057('0x1b');var _0xa97fd0=_0x3b9dbf[_0x8057('0x1d')];var _0x39d555=_0x44a708?0x0:_0x582fd5[_0x8057('0x1a')];var _0x55ad72=_0x44a708?_0x3b9dbf[_0x8057('0x1d')]:_0x582fd5[_0x8057('0x1a')]+_0x582fd5[_0x8057('0x1c')];var _0x36a340;if(_0x55ad72>=_0xa97fd0){_0x55ad72=_0xa97fd0;_0x36a340=0xc8;}else{_0x36a340=0xce;}_0x70a8a7['status'](_0x36a340);return _0x70a8a7[_0x8057('0x1e')](_0x8057('0x1f'),_0x39d555+'-'+_0x55ad72+'/'+_0xa97fd0)[_0x8057('0x19')](_0x3b9dbf);}return null;};}function patchUpdates(_0x3e2230){return function(_0x3f3d36){try{jsonpatch[_0x8057('0x20')](_0x3f3d36,_0x3e2230,!![]);}catch(_0x7dcae9){return BPromise[_0x8057('0x21')](_0x7dcae9);}return _0x3f3d36[_0x8057('0x22')]();};}function saveUpdates(_0x6e8b75,_0x3d6d9d){return function(_0x23b50c){if(_0x23b50c){return _0x23b50c['update'](_0x6e8b75)[_0x8057('0x23')](function(_0x34c4c1){return _0x34c4c1;});}return null;};}function removeEntity(_0x597341,_0xef3504){return function(_0x1d74d1){if(_0x1d74d1){return _0x1d74d1['destroy']()[_0x8057('0x23')](function(){_0x597341[_0x8057('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3084b1,_0xb5462){return function(_0x4ed0a0){if(!_0x4ed0a0){_0x3084b1[_0x8057('0x17')](0x194);}return _0x4ed0a0;};}function handleError(_0x59f42a,_0x5e5f74){_0x5e5f74=_0x5e5f74||0x1f4;return function(_0x29699b){logger[_0x8057('0x24')](_0x29699b[_0x8057('0x25')]);if(_0x29699b['name']){delete _0x29699b[_0x8057('0x26')];}_0x59f42a[_0x8057('0x18')](_0x5e5f74)[_0x8057('0x27')](_0x29699b);};}exports['index']=function(_0x1402b6,_0x34e319){var _0x255a8c={},_0x4c1c14={},_0x640284={'count':0x0,'rows':[]};var _0x497bd7=_['map'](db[_0x8057('0x28')]['rawAttributes'],function(_0x50d3e0){return{'name':_0x50d3e0[_0x8057('0x29')],'type':_0x50d3e0['type'][_0x8057('0x2a')]};});_0x4c1c14['model']=_[_0x8057('0x2b')](_0x497bd7,'name');_0x4c1c14[_0x8057('0x2c')]=_[_0x8057('0x2d')](_0x1402b6[_0x8057('0x2c')]);_0x4c1c14[_0x8057('0x2e')]=_[_0x8057('0x2f')](_0x4c1c14[_0x8057('0x30')],_0x4c1c14['query']);_0x255a8c[_0x8057('0x31')]=_[_0x8057('0x2f')](_0x4c1c14[_0x8057('0x30')],qs['fields'](_0x1402b6[_0x8057('0x2c')][_0x8057('0x32')]));_0x255a8c[_0x8057('0x31')]=_0x255a8c['attributes'][_0x8057('0x33')]?_0x255a8c[_0x8057('0x31')]:_0x4c1c14['model'];if(!_0x1402b6['query'][_0x8057('0x34')](_0x8057('0x35'))){_0x255a8c[_0x8057('0x1c')]=qs[_0x8057('0x1c')](_0x1402b6[_0x8057('0x2c')][_0x8057('0x1c')]);_0x255a8c[_0x8057('0x1a')]=qs[_0x8057('0x1a')](_0x1402b6[_0x8057('0x2c')][_0x8057('0x1a')]);}_0x255a8c[_0x8057('0x36')]=qs[_0x8057('0x37')](_0x1402b6['query'][_0x8057('0x37')]);_0x255a8c[_0x8057('0x38')]=qs[_0x8057('0x2e')](_[_0x8057('0x39')](_0x1402b6[_0x8057('0x2c')],_0x4c1c14[_0x8057('0x2e')]),_0x497bd7);if(_0x1402b6[_0x8057('0x2c')][_0x8057('0x3a')]){_0x255a8c[_0x8057('0x38')]=_[_0x8057('0x3b')](_0x255a8c[_0x8057('0x38')],{'$or':_['map'](_0x497bd7,function(_0x1e1c4b){if(_0x1e1c4b[_0x8057('0x3c')]!=='VIRTUAL'){var _0x191288={};_0x191288[_0x1e1c4b[_0x8057('0x26')]]={'$like':'%'+_0x1402b6[_0x8057('0x2c')][_0x8057('0x3a')]+'%'};return _0x191288;}})});}_0x255a8c=_[_0x8057('0x3b')]({},_0x255a8c,_0x1402b6['options']);var _0x3736f6={'where':_0x255a8c['where']};return db['Migration']['count'](_0x3736f6)['then'](function(_0x9a4dde){_0x640284[_0x8057('0x1d')]=_0x9a4dde;if(_0x1402b6[_0x8057('0x2c')][_0x8057('0x3d')]){_0x255a8c['include']=[{'all':!![]}];}return db['Migration']['findAll'](_0x255a8c);})[_0x8057('0x23')](function(_0xf604e5){_0x640284[_0x8057('0x3e')]=_0xf604e5;return _0x640284;})[_0x8057('0x23')](respondWithFilteredResult(_0x34e319,_0x255a8c))[_0x8057('0x3f')](handleError(_0x34e319,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 7b65dbe..30ccbf3 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 _0xd9bb=['path','../../config/environment','./migration.attributes','exports','define','migrations','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd9bb,0x1f2));var _0xbd9b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd9bb[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xbd9b('0x0'));var util=require(_0xbd9b('0x1'));var logger=require(_0xbd9b('0x2'))(_0xbd9b('0x3'));var moment=require(_0xbd9b('0x4'));var BPromise=require('bluebird');var rp=require(_0xbd9b('0x5'));var fs=require('fs');var path=require(_0xbd9b('0x6'));var rimraf=require('rimraf');var config=require(_0xbd9b('0x7'));var attributes=require(_0xbd9b('0x8'));module[_0xbd9b('0x9')]=function(_0x6e29fa,_0x5a097c){return _0x6e29fa[_0xbd9b('0xa')]('Migration',attributes,{'tableName':_0xbd9b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb36c=['migrations','../../config/logger','api','request-promise','rimraf','../../config/environment','./migration.attributes','exports','define'];(function(_0xa2c0a3,_0x5bbac0){var _0x52c618=function(_0x20f7fd){while(--_0x20f7fd){_0xa2c0a3['push'](_0xa2c0a3['shift']());}};_0x52c618(++_0x5bbac0);}(_0xb36c,0x14e));var _0xcb36=function(_0x3216d5,_0x23f814){_0x3216d5=_0x3216d5-0x0;var _0x1a759d=_0xb36c[_0x3216d5];return _0x1a759d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xcb36('0x0'))(_0xcb36('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xcb36('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcb36('0x3'));var config=require(_0xcb36('0x4'));var attributes=require(_0xcb36('0x5'));module[_0xcb36('0x6')]=function(_0x1bab5d,_0x53a72a){return _0x1bab5d[_0xcb36('0x7')]('Migration',attributes,{'tableName':_0xcb36('0x8'),'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 25e8783..e74b1fa 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 _0xc36d=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','Migration,\x20%s,\x20%s','message','lodash'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0xc36d,0x7d));var _0xdc36=function(_0x1f78cb,_0x58e9f3){_0x1f78cb=_0x1f78cb-0x0;var _0x2cf6b8=_0xc36d[_0x1f78cb];return _0x2cf6b8;};'use strict';var _=require(_0xdc36('0x0'));var util=require(_0xdc36('0x1'));var moment=require(_0xdc36('0x2'));var BPromise=require(_0xdc36('0x3'));var rs=require(_0xdc36('0x4'));var fs=require('fs');var Redis=require(_0xdc36('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xdc36('0x6'));var logger=require(_0xdc36('0x7'))('rpc');var config=require(_0xdc36('0x8'));var jayson=require(_0xdc36('0x9'));var client=jayson[_0xdc36('0xa')][_0xdc36('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x6e4753,_0x571311,_0x20ba02){return new BPromise(function(_0x456897,_0x2a0087){return client[_0xdc36('0xc')](_0x6e4753,_0x20ba02)['then'](function(_0x20d00a){logger[_0xdc36('0xd')]('Migration,\x20%s,\x20%s',_0x571311,_0xdc36('0xe'));logger[_0xdc36('0xf')](_0xdc36('0x10'),_0x571311,'request\x20sent',JSON[_0xdc36('0x11')](_0x20d00a));if(_0x20d00a[_0xdc36('0x12')]){if(_0x20d00a['error']['code']===0x1f4){logger[_0xdc36('0x12')](_0xdc36('0x13'),_0x571311,_0x20d00a[_0xdc36('0x12')][_0xdc36('0x14')]);return _0x2a0087(_0x20d00a['error'][_0xdc36('0x14')]);}logger[_0xdc36('0x12')](_0xdc36('0x13'),_0x571311,_0x20d00a[_0xdc36('0x12')][_0xdc36('0x14')]);return _0x456897(_0x20d00a[_0xdc36('0x12')][_0xdc36('0x14')]);}else{logger[_0xdc36('0xd')]('Migration,\x20%s,\x20%s',_0x571311,_0xdc36('0xe'));_0x456897(_0x20d00a['result']['message']);}})['catch'](function(_0x64f61e){logger[_0xdc36('0x12')]('Migration,\x20%s,\x20%s',_0x571311,_0x64f61e);_0x2a0087(_0x64f61e);});});} \ No newline at end of file +var _0xfd07=['client','http','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','../../mysqldb','../../config/utils','../../config/logger','jayson/promise'];(function(_0x49c653,_0x390195){var _0x31e169=function(_0x3684ac){while(--_0x3684ac){_0x49c653['push'](_0x49c653['shift']());}};_0x31e169(++_0x390195);}(_0xfd07,0x104));var _0x7fd0=function(_0x32ce61,_0x2ba733){_0x32ce61=_0x32ce61-0x0;var _0x28eded=_0xfd07[_0x32ce61];return _0x28eded;};'use strict';var _=require(_0x7fd0('0x0'));var util=require(_0x7fd0('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7fd0('0x2'))['db'];var utils=require(_0x7fd0('0x3'));var logger=require(_0x7fd0('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7fd0('0x5'));var client=jayson[_0x7fd0('0x6')][_0x7fd0('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x34eca6,_0x4fa939,_0x288561){return new BPromise(function(_0x3407b6,_0x40c634){return client['request'](_0x34eca6,_0x288561)['then'](function(_0x27aa04){logger['info'](_0x7fd0('0x8'),_0x4fa939,_0x7fd0('0x9'));logger[_0x7fd0('0xa')](_0x7fd0('0xb'),_0x4fa939,_0x7fd0('0x9'),JSON[_0x7fd0('0xc')](_0x27aa04));if(_0x27aa04[_0x7fd0('0xd')]){if(_0x27aa04[_0x7fd0('0xd')][_0x7fd0('0xe')]===0x1f4){logger['error']('Migration,\x20%s,\x20%s',_0x4fa939,_0x27aa04[_0x7fd0('0xd')][_0x7fd0('0xf')]);return _0x40c634(_0x27aa04[_0x7fd0('0xd')][_0x7fd0('0xf')]);}logger[_0x7fd0('0xd')](_0x7fd0('0x8'),_0x4fa939,_0x27aa04[_0x7fd0('0xd')]['message']);return _0x3407b6(_0x27aa04[_0x7fd0('0xd')][_0x7fd0('0xf')]);}else{logger[_0x7fd0('0x10')](_0x7fd0('0x8'),_0x4fa939,_0x7fd0('0x9'));_0x3407b6(_0x27aa04[_0x7fd0('0x11')][_0x7fd0('0xf')]);}})[_0x7fd0('0x12')](function(_0x5ca99d){logger[_0x7fd0('0xd')](_0x7fd0('0x8'),_0x4fa939,_0x5ca99d);_0x40c634(_0x5ca99d);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index da28737..71c1b5f 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 _0x6d11=['util','path','express','fs-extra','../../components/auth/service','./network.controller','get','isAuthenticated','index','/:id','create','put','delete','destroy','exports','multer'];(function(_0x306d20,_0x3168ca){var _0x5730a2=function(_0x3f0c55){while(--_0x3f0c55){_0x306d20['push'](_0x306d20['shift']());}};_0x5730a2(++_0x3168ca);}(_0x6d11,0xbf));var _0x16d1=function(_0x1a5b7e,_0x5465d6){_0x1a5b7e=_0x1a5b7e-0x0;var _0x47c1f3=_0x6d11[_0x1a5b7e];return _0x47c1f3;};'use strict';var multer=require(_0x16d1('0x0'));var util=require(_0x16d1('0x1'));var path=require(_0x16d1('0x2'));var timeout=require('connect-timeout');var express=require(_0x16d1('0x3'));var router=express['Router']();var fs_extra=require(_0x16d1('0x4'));var auth=require(_0x16d1('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x16d1('0x6'));router[_0x16d1('0x7')]('/',auth[_0x16d1('0x8')](),controller[_0x16d1('0x9')]);router[_0x16d1('0x7')](_0x16d1('0xa'),auth[_0x16d1('0x8')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x16d1('0xb')]);router[_0x16d1('0xc')](_0x16d1('0xa'),auth[_0x16d1('0x8')](),controller['update']);router[_0x16d1('0xd')](_0x16d1('0xa'),auth[_0x16d1('0x8')](),controller[_0x16d1('0xe')]);module[_0x16d1('0xf')]=router; \ No newline at end of file +var _0xcedf=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','get','index','/:id','post','isAuthenticated'];(function(_0x3c6d92,_0xcc61de){var _0x7b1fb=function(_0x4847bc){while(--_0x4847bc){_0x3c6d92['push'](_0x3c6d92['shift']());}};_0x7b1fb(++_0xcc61de);}(_0xcedf,0x1b6));var _0xfced=function(_0x2ec548,_0x18bd4e){_0x2ec548=_0x2ec548-0x0;var _0x52587f=_0xcedf[_0x2ec548];return _0x52587f;};'use strict';var multer=require(_0xfced('0x0'));var util=require(_0xfced('0x1'));var path=require(_0xfced('0x2'));var timeout=require(_0xfced('0x3'));var express=require('express');var router=express[_0xfced('0x4')]();var fs_extra=require(_0xfced('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xfced('0x6'));var controller=require('./network.controller');router[_0xfced('0x7')]('/',auth['isAuthenticated'](),controller[_0xfced('0x8')]);router['get'](_0xfced('0x9'),auth['isAuthenticated'](),controller['show']);router[_0xfced('0xa')]('/',auth[_0xfced('0xb')](),controller[_0xfced('0xc')]);router[_0xfced('0xd')]('/:id',auth[_0xfced('0xb')](),controller[_0xfced('0xe')]);router[_0xfced('0xf')](_0xfced('0x9'),auth[_0xfced('0xb')](),controller[_0xfced('0x10')]);module[_0xfced('0x11')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 6c6e992..8068390 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 _0x2868=['STRING','sequelize','exports','ENUM','localnet','stun','turn'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0x2868,0x1ba));var _0x8286=function(_0x795440,_0x5b473f){_0x795440=_0x795440-0x0;var _0x4f3aee=_0x2868[_0x795440];return _0x4f3aee;};'use strict';var Sequelize=require(_0x8286('0x0'));module[_0x8286('0x1')]={'type':{'type':Sequelize[_0x8286('0x2')](_0x8286('0x3'),'externip',_0x8286('0x4'),_0x8286('0x5'))},'value':{'type':Sequelize[_0x8286('0x6')]},'username':{'type':Sequelize[_0x8286('0x6')]},'password':{'type':Sequelize[_0x8286('0x6')]}}; \ No newline at end of file +var _0xa92d=['sequelize','ENUM','externip','stun','turn','STRING'];(function(_0x517d19,_0x213455){var _0x104566=function(_0x439c21){while(--_0x439c21){_0x517d19['push'](_0x517d19['shift']());}};_0x104566(++_0x213455);}(_0xa92d,0x162));var _0xda92=function(_0x220ce7,_0x38be87){_0x220ce7=_0x220ce7-0x0;var _0x45cca0=_0xa92d[_0x220ce7];return _0x45cca0;};'use strict';var Sequelize=require(_0xda92('0x0'));module['exports']={'type':{'type':Sequelize[_0xda92('0x1')]('localnet',_0xda92('0x2'),_0xda92('0x3'),_0xda92('0x4'))},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xda92('0x5')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index defe772..12236ee 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 _0x53e5=['undefined','limit','count','offset','set','Content-Range','json','update','destroy','sendStatus','stack','name','send','index','map','Network','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','rawAttributes','include','find','catch','create','body','toUpperCase','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','res_stun_monitor.so','TURN','server/files/templates/turn_multiple.ejs','Reload','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','/etc/asterisk/turn_xcally.conf','params','util','path','ejs','lodash','../../components/parsers/qs','../../config/environment','../../mysqldb','client','request','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','message','result','status'];(function(_0xa1e3d2,_0x2f202b){var _0x58c2ad=function(_0x1d2fe2){while(--_0x1d2fe2){_0xa1e3d2['push'](_0xa1e3d2['shift']());}};_0x58c2ad(++_0x2f202b);}(_0x53e5,0x9a));var _0x553e=function(_0x5b4767,_0x18919c){_0x5b4767=_0x5b4767-0x0;var _0x4ba53e=_0x53e5[_0x5b4767];return _0x4ba53e;};'use strict';var util=require(_0x553e('0x0'));var path=require(_0x553e('0x1'));var ejs=require(_0x553e('0x2'));var fs=require('fs');var _=require(_0x553e('0x3'));var qs=require(_0x553e('0x4'));var logger=require('../../config/logger')('api');var config=require(_0x553e('0x5'));var db=require(_0x553e('0x6'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x553e('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x14dc9e,_0x4cf1d2,_0x3a5f82,_0x1666d9){return new Promise(function(_0x1a15d2,_0x4725ad){var _0x479990=_0x1666d9||client;return _0x479990[_0x553e('0x8')](_0x14dc9e,_0x3a5f82)[_0x553e('0x9')](function(_0x1d8a2a){logger[_0x553e('0xa')](_0x553e('0xb'),_0x4cf1d2,_0x553e('0xc'));logger[_0x553e('0xd')](_0x553e('0xe'),_0x4cf1d2,_0x553e('0xc'),JSON[_0x553e('0xf')](_0x1d8a2a));if(_0x1d8a2a[_0x553e('0x10')]){if(_0x1d8a2a[_0x553e('0x10')]['code']===0x1f4){logger[_0x553e('0x10')](_0x553e('0xb'),_0x4cf1d2,_0x1d8a2a[_0x553e('0x10')]['message']);return _0x4725ad(_0x1d8a2a[_0x553e('0x10')][_0x553e('0x11')]);}logger['error'](_0x553e('0xb'),_0x4cf1d2,_0x1d8a2a[_0x553e('0x10')]['message']);return _0x1a15d2(_0x1d8a2a[_0x553e('0x10')][_0x553e('0x11')]);}else{logger[_0x553e('0xa')]('Network,\x20%s,\x20%s',_0x4cf1d2,'request\x20sent');_0x1a15d2(_0x1d8a2a[_0x553e('0x12')][_0x553e('0x11')]);}})['catch'](function(_0x41353d){logger[_0x553e('0x10')](_0x553e('0xb'),_0x4cf1d2,_0x41353d);_0x4725ad(_0x41353d);});});}function respondWithResult(_0x58a64d,_0x1b3895){_0x1b3895=_0x1b3895||0xc8;return function(_0x1bb4e6){if(_0x1bb4e6){return _0x58a64d[_0x553e('0x13')](_0x1b3895)['json'](_0x1bb4e6);}};}function respondWithFilteredResult(_0x3cc05e,_0x58b7ae){return function(_0x4eebf0){if(_0x4eebf0){var _0x40492f=typeof _0x58b7ae['offset']===_0x553e('0x14')&&typeof _0x58b7ae[_0x553e('0x15')]==='undefined';var _0x54bfd4=_0x4eebf0[_0x553e('0x16')];var _0x59a5fc=_0x40492f?0x0:_0x58b7ae[_0x553e('0x17')];var _0x535f2f=_0x40492f?_0x4eebf0['count']:_0x58b7ae[_0x553e('0x17')]+_0x58b7ae[_0x553e('0x15')];var _0x1597e0;if(_0x535f2f>=_0x54bfd4){_0x535f2f=_0x54bfd4;_0x1597e0=0xc8;}else{_0x1597e0=0xce;}_0x3cc05e['status'](_0x1597e0);return _0x3cc05e[_0x553e('0x18')](_0x553e('0x19'),_0x59a5fc+'-'+_0x535f2f+'/'+_0x54bfd4)[_0x553e('0x1a')](_0x4eebf0);}return null;};}function saveUpdates(_0x61f25){return function(_0x40a552){if(_0x40a552){return _0x40a552[_0x553e('0x1b')](_0x61f25)['then'](function(_0x31593c){return _0x31593c;});}return null;};}function removeEntity(_0x215f8a){return function(_0x54d069){if(_0x54d069){return _0x54d069[_0x553e('0x1c')]()['then'](function(){_0x215f8a[_0x553e('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x238131){return function(_0x1b54a8){if(!_0x1b54a8){_0x238131[_0x553e('0x1d')](0x194);}return _0x1b54a8;};}function handleError(_0x3be67a,_0x4738cc){_0x4738cc=_0x4738cc||0x1f4;return function(_0x1b3ec9){logger[_0x553e('0x10')](_0x1b3ec9[_0x553e('0x1e')]);if(_0x1b3ec9[_0x553e('0x1f')]){delete _0x1b3ec9[_0x553e('0x1f')];}_0x3be67a['status'](_0x4738cc)[_0x553e('0x20')](_0x1b3ec9);};}exports[_0x553e('0x21')]=function(_0x320486,_0x4a7bc){var _0x53bf42={},_0x3ec754={},_0x52f855={'count':0x0,'rows':[]};var _0x3362aa=_[_0x553e('0x22')](db[_0x553e('0x23')]['rawAttributes'],function(_0x7ab3be){return{'name':_0x7ab3be[_0x553e('0x24')],'type':_0x7ab3be[_0x553e('0x25')][_0x553e('0x26')]};});_0x3ec754[_0x553e('0x27')]=_[_0x553e('0x22')](_0x3362aa,_0x553e('0x1f'));_0x3ec754[_0x553e('0x28')]=_[_0x553e('0x29')](_0x320486[_0x553e('0x28')]);_0x3ec754['filters']=_[_0x553e('0x2a')](_0x3ec754[_0x553e('0x27')],_0x3ec754[_0x553e('0x28')]);_0x53bf42[_0x553e('0x2b')]=_[_0x553e('0x2a')](_0x3ec754[_0x553e('0x27')],qs[_0x553e('0x2c')](_0x320486[_0x553e('0x28')][_0x553e('0x2c')]));_0x53bf42[_0x553e('0x2b')]=_0x53bf42[_0x553e('0x2b')][_0x553e('0x2d')]?_0x53bf42[_0x553e('0x2b')]:_0x3ec754[_0x553e('0x27')];if(!_0x320486[_0x553e('0x28')]['hasOwnProperty'](_0x553e('0x2e'))){_0x53bf42[_0x553e('0x15')]=qs['limit'](_0x320486['query'][_0x553e('0x15')]);_0x53bf42[_0x553e('0x17')]=qs[_0x553e('0x17')](_0x320486['query'][_0x553e('0x17')]);}_0x53bf42[_0x553e('0x2f')]=qs[_0x553e('0x30')](_0x320486['query']['sort']);_0x53bf42[_0x553e('0x31')]=qs[_0x553e('0x32')](_[_0x553e('0x33')](_0x320486[_0x553e('0x28')],_0x3ec754['filters']),_0x3362aa);if(_0x320486[_0x553e('0x28')][_0x553e('0x34')]){_0x53bf42[_0x553e('0x31')]=_[_0x553e('0x35')](_0x53bf42['where'],{'$or':_[_0x553e('0x22')](_0x3362aa,function(_0x55f3d7){if(_0x55f3d7['type']!==_0x553e('0x36')){var _0x22af6e={};_0x22af6e[_0x55f3d7[_0x553e('0x1f')]]={'$like':'%'+_0x320486[_0x553e('0x28')][_0x553e('0x34')]+'%'};return _0x22af6e;}})});}_0x53bf42=_[_0x553e('0x35')]({},_0x53bf42,_0x320486[_0x553e('0x37')]);var _0x22e044={'where':_0x53bf42[_0x553e('0x31')]};return db[_0x553e('0x23')][_0x553e('0x16')](_0x22e044)[_0x553e('0x9')](function(_0x272e0){_0x52f855[_0x553e('0x16')]=_0x272e0;if(_0x320486[_0x553e('0x28')][_0x553e('0x38')]){_0x53bf42['include']=[{'all':!![]}];}return db[_0x553e('0x23')][_0x553e('0x39')](_0x53bf42);})[_0x553e('0x9')](function(_0x105873){_0x52f855[_0x553e('0x3a')]=_0x105873;return _0x52f855;})[_0x553e('0x9')](respondWithFilteredResult(_0x4a7bc,_0x53bf42))['catch'](handleError(_0x4a7bc,null));};exports[_0x553e('0x3b')]=function(_0x5c0e48,_0x736bb0){var _0x1c1c97={'raw':!![],'where':{'id':_0x5c0e48['params']['id']}},_0x4e3039={};_0x4e3039[_0x553e('0x27')]=_[_0x553e('0x29')](db[_0x553e('0x23')][_0x553e('0x3c')]);_0x4e3039[_0x553e('0x28')]=_['keys'](_0x5c0e48[_0x553e('0x28')]);_0x4e3039[_0x553e('0x32')]=_[_0x553e('0x2a')](_0x4e3039[_0x553e('0x27')],_0x4e3039[_0x553e('0x28')]);_0x1c1c97['attributes']=_['intersection'](_0x4e3039[_0x553e('0x27')],qs[_0x553e('0x2c')](_0x5c0e48[_0x553e('0x28')][_0x553e('0x2c')]));_0x1c1c97[_0x553e('0x2b')]=_0x1c1c97[_0x553e('0x2b')]['length']?_0x1c1c97[_0x553e('0x2b')]:_0x4e3039[_0x553e('0x27')];if(_0x5c0e48[_0x553e('0x28')][_0x553e('0x38')]){_0x1c1c97[_0x553e('0x3d')]=[{'all':!![]}];}_0x1c1c97=_[_0x553e('0x35')]({},_0x1c1c97,_0x5c0e48[_0x553e('0x37')]);return db['Network'][_0x553e('0x3e')](_0x1c1c97)[_0x553e('0x9')](handleEntityNotFound(_0x736bb0,null))[_0x553e('0x9')](respondWithResult(_0x736bb0,null))[_0x553e('0x3f')](handleError(_0x736bb0,null));};exports[_0x553e('0x40')]=function(_0x2a406b,_0x3565ab){var _0x434404;return db[_0x553e('0x23')][_0x553e('0x40')](_0x2a406b[_0x553e('0x41')],{'raw':!![]})['then'](function(_0x1d207c){_0x434404=_0x1d207c;return db[_0x553e('0x23')]['findAll']({'where':{'type':_0x2a406b[_0x553e('0x41')][_0x553e('0x25')]},'raw':!![]});})[_0x553e('0x9')](function(_0x59ddae){if(_0x434404[_0x553e('0x25')][_0x553e('0x42')]()==_0x553e('0x43')){var _0x114ee5=fs[_0x553e('0x44')](path[_0x553e('0x45')](config[_0x553e('0x46')],_0x553e('0x47')),_0x553e('0x48'));var _0x204d4a=ejs[_0x553e('0x49')](_0x114ee5,{'networks':_0x59ddae||[]});fs[_0x553e('0x4a')](_0x553e('0x4b'),_0x204d4a);return respondWithRpcPromise('Reload','create',{'module':_0x553e('0x4c')});}else if(_0x434404[_0x553e('0x25')]['toUpperCase']()==_0x553e('0x4d')){var _0x2372e7=fs[_0x553e('0x44')](path[_0x553e('0x45')](config['root'],_0x553e('0x4e')),'utf8');var _0x26c993=ejs[_0x553e('0x49')](_0x2372e7,{'networks':_0x59ddae||[]});fs[_0x553e('0x4a')]('/etc/asterisk/turn_xcally.conf',_0x26c993);return respondWithRpcPromise(_0x553e('0x4f'),_0x553e('0x40'),{'module':_0x553e('0x4c')});}else{var _0x1ebcf6=fs[_0x553e('0x44')](path[_0x553e('0x45')](config[_0x553e('0x46')],_0x553e('0x50')),'utf8');var _0x1b7930=ejs[_0x553e('0x49')](_0x1ebcf6,{'networks':_0x59ddae||[]});fs[_0x553e('0x4a')](util[_0x553e('0x51')](_0x553e('0x52'),_0x2a406b[_0x553e('0x41')]['type'][_0x553e('0x53')]()),_0x1b7930);return respondWithRpcPromise('Reload',_0x553e('0x40'),{'module':_0x553e('0x54')});}})[_0x553e('0x9')](function(){return _0x434404;})['then'](respondWithResult(_0x3565ab,0xc9))['catch'](handleError(_0x3565ab,null));};exports[_0x553e('0x1b')]=function(_0x522c6f,_0x19decf){var _0x4a1a49;return db[_0x553e('0x23')][_0x553e('0x3e')]({'where':{'id':_0x522c6f['params']['id']}})[_0x553e('0x9')](handleEntityNotFound(_0x19decf,null))['then'](saveUpdates(_0x522c6f[_0x553e('0x41')],null))[_0x553e('0x9')](function(_0x52deb7){if(_0x52deb7){_0x4a1a49=_0x52deb7;return db[_0x553e('0x23')][_0x553e('0x39')]({'where':{'type':_0x4a1a49[_0x553e('0x25')]},'raw':!![]});}return null;})['then'](function(_0x485a1d){if(_0x4a1a49[_0x553e('0x25')][_0x553e('0x42')]()=='STUN'){var _0x991afe=fs[_0x553e('0x44')](path[_0x553e('0x45')](config[_0x553e('0x46')],_0x553e('0x47')),_0x553e('0x48'));var _0x668387=ejs[_0x553e('0x49')](_0x991afe,{'networks':_0x485a1d||[]});fs[_0x553e('0x4a')]('/etc/asterisk/stun_xcally.conf',_0x668387);return respondWithRpcPromise('Reload','update',{'module':_0x553e('0x4c')});}else if(_0x4a1a49[_0x553e('0x25')]['toUpperCase']()=='TURN'){var _0x296830=fs[_0x553e('0x44')](path['join'](config[_0x553e('0x46')],_0x553e('0x4e')),_0x553e('0x48'));var _0x3dda0c=ejs['render'](_0x296830,{'networks':_0x485a1d||[]});fs[_0x553e('0x4a')](_0x553e('0x55'),_0x3dda0c);return respondWithRpcPromise('Reload',_0x553e('0x1b'),{'module':_0x553e('0x4c')});}else{var _0x3f1be7=fs[_0x553e('0x44')](path[_0x553e('0x45')](config[_0x553e('0x46')],_0x553e('0x50')),'utf8');var _0x5c2d21=ejs['render'](_0x3f1be7,{'networks':_0x485a1d||[]});fs[_0x553e('0x4a')](util[_0x553e('0x51')](_0x553e('0x52'),_0x522c6f[_0x553e('0x41')][_0x553e('0x25')][_0x553e('0x53')]()),_0x5c2d21);return respondWithRpcPromise('Reload',_0x553e('0x1b'),{'module':_0x553e('0x54')});}})[_0x553e('0x9')](function(_0x3eff58){if(_0x3eff58){return _0x4a1a49;}return null;})[_0x553e('0x9')](respondWithResult(_0x19decf,null))['catch'](handleError(_0x19decf,null));};exports['destroy']=function(_0x575dd6,_0x1343ef){var _0x57bb67;return db[_0x553e('0x23')][_0x553e('0x3e')]({'where':{'id':_0x575dd6[_0x553e('0x56')]['id']}})[_0x553e('0x9')](function(_0xc2ffb5){_0x57bb67=_0xc2ffb5;return _0xc2ffb5;})[_0x553e('0x9')](handleEntityNotFound(_0x1343ef,null))[_0x553e('0x9')](removeEntity(_0x1343ef,null))[_0x553e('0x9')](function(){if(_0x57bb67){return db[_0x553e('0x23')][_0x553e('0x39')]({'where':{'type':_0x57bb67[_0x553e('0x25')]},'raw':!![]});}})[_0x553e('0x9')](function(_0x25219){if(_0x57bb67[_0x553e('0x25')]['toUpperCase']()==_0x553e('0x43')){var _0x271947=fs['readFileSync'](path[_0x553e('0x45')](config['root'],_0x553e('0x47')),_0x553e('0x48'));var _0x244c5e=ejs['render'](_0x271947,{'networks':_0x25219||[]});fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x244c5e);return respondWithRpcPromise(_0x553e('0x4f'),_0x553e('0x1c'),{'module':_0x553e('0x4c')});}else if(_0x57bb67[_0x553e('0x25')][_0x553e('0x42')]()==_0x553e('0x4d')){var _0x1969ae=fs[_0x553e('0x44')](path[_0x553e('0x45')](config[_0x553e('0x46')],_0x553e('0x4e')),'utf8');var _0x1c1c81=ejs['render'](_0x1969ae,{'networks':_0x25219||[]});fs[_0x553e('0x4a')](_0x553e('0x55'),_0x1c1c81);return respondWithRpcPromise('Reload',_0x553e('0x1c'),{'module':_0x553e('0x4c')});}else{var _0x22046b=fs[_0x553e('0x44')](path[_0x553e('0x45')](config[_0x553e('0x46')],'server/files/templates/network.ejs'),_0x553e('0x48'));var _0x153081=ejs[_0x553e('0x49')](_0x22046b,{'networks':_0x25219||[]});fs[_0x553e('0x4a')](util[_0x553e('0x51')]('/etc/asterisk/sip_xcally_%s.conf',_0x57bb67[_0x553e('0x25')][_0x553e('0x53')]()),_0x153081);return respondWithRpcPromise('Reload','destroy',{'module':_0x553e('0x54')});}})[_0x553e('0x3f')](handleError(_0x1343ef,null));}; \ No newline at end of file +var _0x6361=['debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','Network,\x20%s,\x20%s','message','info','result','catch','status','json','offset','undefined','count','set','Content-Range','update','destroy','end','name','map','Network','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','limit','order','sort','where','merge','VIRTUAL','options','include','findAll','rows','show','params','includeAll','find','create','body','toUpperCase','STUN','readFileSync','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','Reload','res_stun_monitor.so','TURN','join','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','/etc/asterisk/stun_xcally.conf','server/files/templates/turn_multiple.ejs','util','path','ejs','lodash','../../components/parsers/qs','../../config/logger','../../mysqldb','client','http','request','then','request\x20sent'];(function(_0x24505e,_0x30b0dc){var _0x2a3ee8=function(_0x4e0399){while(--_0x4e0399){_0x24505e['push'](_0x24505e['shift']());}};_0x2a3ee8(++_0x30b0dc);}(_0x6361,0x98));var _0x1636=function(_0xb1a399,_0x257f19){_0xb1a399=_0xb1a399-0x0;var _0x46bed9=_0x6361[_0xb1a399];return _0x46bed9;};'use strict';var util=require(_0x1636('0x0'));var path=require(_0x1636('0x1'));var ejs=require(_0x1636('0x2'));var fs=require('fs');var _=require(_0x1636('0x3'));var qs=require(_0x1636('0x4'));var logger=require(_0x1636('0x5'))('api');var config=require('../../config/environment');var db=require(_0x1636('0x6'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x1636('0x7')][_0x1636('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xd6712c,_0x72fbdb,_0x575a23,_0x62dc0d){return new Promise(function(_0x5a715d,_0x268a74){var _0x24db48=_0x62dc0d||client;return _0x24db48[_0x1636('0x9')](_0xd6712c,_0x575a23)[_0x1636('0xa')](function(_0x2bbf5a){logger['info']('Network,\x20%s,\x20%s',_0x72fbdb,_0x1636('0xb'));logger[_0x1636('0xc')](_0x1636('0xd'),_0x72fbdb,'request\x20sent',JSON[_0x1636('0xe')](_0x2bbf5a));if(_0x2bbf5a['error']){if(_0x2bbf5a[_0x1636('0xf')]['code']===0x1f4){logger[_0x1636('0xf')](_0x1636('0x10'),_0x72fbdb,_0x2bbf5a['error'][_0x1636('0x11')]);return _0x268a74(_0x2bbf5a[_0x1636('0xf')][_0x1636('0x11')]);}logger[_0x1636('0xf')](_0x1636('0x10'),_0x72fbdb,_0x2bbf5a[_0x1636('0xf')][_0x1636('0x11')]);return _0x5a715d(_0x2bbf5a[_0x1636('0xf')]['message']);}else{logger[_0x1636('0x12')](_0x1636('0x10'),_0x72fbdb,_0x1636('0xb'));_0x5a715d(_0x2bbf5a[_0x1636('0x13')]['message']);}})[_0x1636('0x14')](function(_0x5a03d0){logger['error'](_0x1636('0x10'),_0x72fbdb,_0x5a03d0);_0x268a74(_0x5a03d0);});});}function respondWithResult(_0x1ad1cf,_0xabe648){_0xabe648=_0xabe648||0xc8;return function(_0x2c89d4){if(_0x2c89d4){return _0x1ad1cf[_0x1636('0x15')](_0xabe648)[_0x1636('0x16')](_0x2c89d4);}};}function respondWithFilteredResult(_0x899838,_0x38cb7c){return function(_0x54692e){if(_0x54692e){var _0x250363=typeof _0x38cb7c[_0x1636('0x17')]===_0x1636('0x18')&&typeof _0x38cb7c['limit']===_0x1636('0x18');var _0x517542=_0x54692e[_0x1636('0x19')];var _0x53db8a=_0x250363?0x0:_0x38cb7c['offset'];var _0x17efc5=_0x250363?_0x54692e[_0x1636('0x19')]:_0x38cb7c['offset']+_0x38cb7c['limit'];var _0x1d555c;if(_0x17efc5>=_0x517542){_0x17efc5=_0x517542;_0x1d555c=0xc8;}else{_0x1d555c=0xce;}_0x899838[_0x1636('0x15')](_0x1d555c);return _0x899838[_0x1636('0x1a')](_0x1636('0x1b'),_0x53db8a+'-'+_0x17efc5+'/'+_0x517542)[_0x1636('0x16')](_0x54692e);}return null;};}function saveUpdates(_0x4c2187){return function(_0x25bb7){if(_0x25bb7){return _0x25bb7[_0x1636('0x1c')](_0x4c2187)[_0x1636('0xa')](function(_0x1b77fb){return _0x1b77fb;});}return null;};}function removeEntity(_0x4cc485){return function(_0x4ea433){if(_0x4ea433){return _0x4ea433[_0x1636('0x1d')]()[_0x1636('0xa')](function(){_0x4cc485[_0x1636('0x15')](0xcc)[_0x1636('0x1e')]();});}};}function handleEntityNotFound(_0x178ac4){return function(_0x334c7a){if(!_0x334c7a){_0x178ac4['sendStatus'](0x194);}return _0x334c7a;};}function handleError(_0x231214,_0x12298f){_0x12298f=_0x12298f||0x1f4;return function(_0x2764d1){logger['error'](_0x2764d1['stack']);if(_0x2764d1[_0x1636('0x1f')]){delete _0x2764d1[_0x1636('0x1f')];}_0x231214[_0x1636('0x15')](_0x12298f)['send'](_0x2764d1);};}exports['index']=function(_0x2c431d,_0x1a8825){var _0x228231={},_0x2d62bc={},_0x404018={'count':0x0,'rows':[]};var _0x2b0f22=_[_0x1636('0x20')](db[_0x1636('0x21')][_0x1636('0x22')],function(_0x2adace){return{'name':_0x2adace[_0x1636('0x23')],'type':_0x2adace[_0x1636('0x24')][_0x1636('0x25')]};});_0x2d62bc['model']=_[_0x1636('0x20')](_0x2b0f22,_0x1636('0x1f'));_0x2d62bc['query']=_[_0x1636('0x26')](_0x2c431d[_0x1636('0x27')]);_0x2d62bc[_0x1636('0x28')]=_[_0x1636('0x29')](_0x2d62bc[_0x1636('0x2a')],_0x2d62bc[_0x1636('0x27')]);_0x228231[_0x1636('0x2b')]=_[_0x1636('0x29')](_0x2d62bc['model'],qs[_0x1636('0x2c')](_0x2c431d['query']['fields']));_0x228231[_0x1636('0x2b')]=_0x228231['attributes']['length']?_0x228231[_0x1636('0x2b')]:_0x2d62bc[_0x1636('0x2a')];if(!_0x2c431d[_0x1636('0x27')][_0x1636('0x2d')]('nolimit')){_0x228231[_0x1636('0x2e')]=qs[_0x1636('0x2e')](_0x2c431d['query'][_0x1636('0x2e')]);_0x228231[_0x1636('0x17')]=qs[_0x1636('0x17')](_0x2c431d[_0x1636('0x27')][_0x1636('0x17')]);}_0x228231[_0x1636('0x2f')]=qs[_0x1636('0x30')](_0x2c431d[_0x1636('0x27')][_0x1636('0x30')]);_0x228231[_0x1636('0x31')]=qs['filters'](_['pick'](_0x2c431d[_0x1636('0x27')],_0x2d62bc[_0x1636('0x28')]),_0x2b0f22);if(_0x2c431d[_0x1636('0x27')]['filter']){_0x228231[_0x1636('0x31')]=_[_0x1636('0x32')](_0x228231[_0x1636('0x31')],{'$or':_[_0x1636('0x20')](_0x2b0f22,function(_0x3bb470){if(_0x3bb470['type']!==_0x1636('0x33')){var _0x5c99aa={};_0x5c99aa[_0x3bb470[_0x1636('0x1f')]]={'$like':'%'+_0x2c431d['query']['filter']+'%'};return _0x5c99aa;}})});}_0x228231=_[_0x1636('0x32')]({},_0x228231,_0x2c431d[_0x1636('0x34')]);var _0x322aa0={'where':_0x228231['where']};return db['Network'][_0x1636('0x19')](_0x322aa0)['then'](function(_0xf9d5d2){_0x404018[_0x1636('0x19')]=_0xf9d5d2;if(_0x2c431d[_0x1636('0x27')]['includeAll']){_0x228231[_0x1636('0x35')]=[{'all':!![]}];}return db[_0x1636('0x21')][_0x1636('0x36')](_0x228231);})['then'](function(_0x19249f){_0x404018[_0x1636('0x37')]=_0x19249f;return _0x404018;})[_0x1636('0xa')](respondWithFilteredResult(_0x1a8825,_0x228231))[_0x1636('0x14')](handleError(_0x1a8825,null));};exports[_0x1636('0x38')]=function(_0x1c80ec,_0x538e7d){var _0x208bc8={'raw':!![],'where':{'id':_0x1c80ec[_0x1636('0x39')]['id']}},_0x51e11b={};_0x51e11b[_0x1636('0x2a')]=_[_0x1636('0x26')](db[_0x1636('0x21')][_0x1636('0x22')]);_0x51e11b['query']=_[_0x1636('0x26')](_0x1c80ec[_0x1636('0x27')]);_0x51e11b[_0x1636('0x28')]=_[_0x1636('0x29')](_0x51e11b[_0x1636('0x2a')],_0x51e11b[_0x1636('0x27')]);_0x208bc8[_0x1636('0x2b')]=_[_0x1636('0x29')](_0x51e11b[_0x1636('0x2a')],qs[_0x1636('0x2c')](_0x1c80ec[_0x1636('0x27')][_0x1636('0x2c')]));_0x208bc8[_0x1636('0x2b')]=_0x208bc8[_0x1636('0x2b')]['length']?_0x208bc8[_0x1636('0x2b')]:_0x51e11b[_0x1636('0x2a')];if(_0x1c80ec[_0x1636('0x27')][_0x1636('0x3a')]){_0x208bc8[_0x1636('0x35')]=[{'all':!![]}];}_0x208bc8=_[_0x1636('0x32')]({},_0x208bc8,_0x1c80ec[_0x1636('0x34')]);return db[_0x1636('0x21')][_0x1636('0x3b')](_0x208bc8)[_0x1636('0xa')](handleEntityNotFound(_0x538e7d,null))[_0x1636('0xa')](respondWithResult(_0x538e7d,null))[_0x1636('0x14')](handleError(_0x538e7d,null));};exports[_0x1636('0x3c')]=function(_0x12fb66,_0x44b5d1){var _0x155aa4;return db[_0x1636('0x21')]['create'](_0x12fb66[_0x1636('0x3d')],{'raw':!![]})[_0x1636('0xa')](function(_0x4eb5f5){_0x155aa4=_0x4eb5f5;return db['Network'][_0x1636('0x36')]({'where':{'type':_0x12fb66[_0x1636('0x3d')][_0x1636('0x24')]},'raw':!![]});})[_0x1636('0xa')](function(_0x487c45){if(_0x155aa4[_0x1636('0x24')][_0x1636('0x3e')]()==_0x1636('0x3f')){var _0x33762b=fs[_0x1636('0x40')](path['join'](config[_0x1636('0x41')],_0x1636('0x42')),_0x1636('0x43'));var _0x5c53d9=ejs[_0x1636('0x44')](_0x33762b,{'networks':_0x487c45||[]});fs[_0x1636('0x45')]('/etc/asterisk/stun_xcally.conf',_0x5c53d9);return respondWithRpcPromise(_0x1636('0x46'),'create',{'module':_0x1636('0x47')});}else if(_0x155aa4[_0x1636('0x24')][_0x1636('0x3e')]()==_0x1636('0x48')){var _0x1a1cdb=fs[_0x1636('0x40')](path[_0x1636('0x49')](config[_0x1636('0x41')],'server/files/templates/turn_multiple.ejs'),'utf8');var _0x4038c2=ejs[_0x1636('0x44')](_0x1a1cdb,{'networks':_0x487c45||[]});fs[_0x1636('0x45')](_0x1636('0x4a'),_0x4038c2);return respondWithRpcPromise(_0x1636('0x46'),_0x1636('0x3c'),{'module':'res_stun_monitor.so'});}else{var _0x40be26=fs[_0x1636('0x40')](path[_0x1636('0x49')](config[_0x1636('0x41')],_0x1636('0x4b')),'utf8');var _0x556365=ejs[_0x1636('0x44')](_0x40be26,{'networks':_0x487c45||[]});fs[_0x1636('0x45')](util[_0x1636('0x4c')](_0x1636('0x4d'),_0x12fb66[_0x1636('0x3d')]['type'][_0x1636('0x4e')]()),_0x556365);return respondWithRpcPromise(_0x1636('0x46'),_0x1636('0x3c'),{'module':_0x1636('0x4f')});}})[_0x1636('0xa')](function(){return _0x155aa4;})[_0x1636('0xa')](respondWithResult(_0x44b5d1,0xc9))[_0x1636('0x14')](handleError(_0x44b5d1,null));};exports[_0x1636('0x1c')]=function(_0x4f5184,_0x44818f){var _0x2df6ee;return db[_0x1636('0x21')][_0x1636('0x3b')]({'where':{'id':_0x4f5184[_0x1636('0x39')]['id']}})[_0x1636('0xa')](handleEntityNotFound(_0x44818f,null))[_0x1636('0xa')](saveUpdates(_0x4f5184[_0x1636('0x3d')],null))[_0x1636('0xa')](function(_0x321753){if(_0x321753){_0x2df6ee=_0x321753;return db[_0x1636('0x21')][_0x1636('0x36')]({'where':{'type':_0x2df6ee['type']},'raw':!![]});}return null;})['then'](function(_0x4bb7d3){if(_0x2df6ee[_0x1636('0x24')][_0x1636('0x3e')]()=='STUN'){var _0x1ce8a2=fs[_0x1636('0x40')](path[_0x1636('0x49')](config[_0x1636('0x41')],_0x1636('0x42')),_0x1636('0x43'));var _0x39a8ec=ejs[_0x1636('0x44')](_0x1ce8a2,{'networks':_0x4bb7d3||[]});fs[_0x1636('0x45')](_0x1636('0x50'),_0x39a8ec);return respondWithRpcPromise('Reload','update',{'module':'res_stun_monitor.so'});}else if(_0x2df6ee[_0x1636('0x24')][_0x1636('0x3e')]()==_0x1636('0x48')){var _0x337e8e=fs[_0x1636('0x40')](path[_0x1636('0x49')](config['root'],'server/files/templates/turn_multiple.ejs'),_0x1636('0x43'));var _0x391ba1=ejs[_0x1636('0x44')](_0x337e8e,{'networks':_0x4bb7d3||[]});fs[_0x1636('0x45')](_0x1636('0x4a'),_0x391ba1);return respondWithRpcPromise(_0x1636('0x46'),_0x1636('0x1c'),{'module':_0x1636('0x47')});}else{var _0x425814=fs['readFileSync'](path[_0x1636('0x49')](config[_0x1636('0x41')],_0x1636('0x4b')),_0x1636('0x43'));var _0x41da12=ejs['render'](_0x425814,{'networks':_0x4bb7d3||[]});fs[_0x1636('0x45')](util[_0x1636('0x4c')]('/etc/asterisk/sip_xcally_%s.conf',_0x4f5184[_0x1636('0x3d')][_0x1636('0x24')][_0x1636('0x4e')]()),_0x41da12);return respondWithRpcPromise(_0x1636('0x46'),_0x1636('0x1c'),{'module':_0x1636('0x4f')});}})[_0x1636('0xa')](function(_0x2a1851){if(_0x2a1851){return _0x2df6ee;}return null;})[_0x1636('0xa')](respondWithResult(_0x44818f,null))[_0x1636('0x14')](handleError(_0x44818f,null));};exports[_0x1636('0x1d')]=function(_0x334e32,_0x3de7c8){var _0x201261;return db[_0x1636('0x21')][_0x1636('0x3b')]({'where':{'id':_0x334e32[_0x1636('0x39')]['id']}})[_0x1636('0xa')](function(_0x175c12){_0x201261=_0x175c12;return _0x175c12;})['then'](handleEntityNotFound(_0x3de7c8,null))['then'](removeEntity(_0x3de7c8,null))['then'](function(){if(_0x201261){return db[_0x1636('0x21')][_0x1636('0x36')]({'where':{'type':_0x201261[_0x1636('0x24')]},'raw':!![]});}})[_0x1636('0xa')](function(_0x5f48f2){if(_0x201261[_0x1636('0x24')][_0x1636('0x3e')]()==_0x1636('0x3f')){var _0x5b16c7=fs[_0x1636('0x40')](path['join'](config[_0x1636('0x41')],_0x1636('0x42')),_0x1636('0x43'));var _0x7b19ee=ejs[_0x1636('0x44')](_0x5b16c7,{'networks':_0x5f48f2||[]});fs[_0x1636('0x45')](_0x1636('0x50'),_0x7b19ee);return respondWithRpcPromise('Reload','destroy',{'module':_0x1636('0x47')});}else if(_0x201261[_0x1636('0x24')][_0x1636('0x3e')]()=='TURN'){var _0x57cdc7=fs['readFileSync'](path['join'](config[_0x1636('0x41')],_0x1636('0x51')),_0x1636('0x43'));var _0x44d5c5=ejs[_0x1636('0x44')](_0x57cdc7,{'networks':_0x5f48f2||[]});fs[_0x1636('0x45')](_0x1636('0x4a'),_0x44d5c5);return respondWithRpcPromise(_0x1636('0x46'),_0x1636('0x1d'),{'module':_0x1636('0x47')});}else{var _0x16bb92=fs[_0x1636('0x40')](path[_0x1636('0x49')](config[_0x1636('0x41')],_0x1636('0x4b')),_0x1636('0x43'));var _0x229b5b=ejs[_0x1636('0x44')](_0x16bb92,{'networks':_0x5f48f2||[]});fs[_0x1636('0x45')](util['format'](_0x1636('0x4d'),_0x201261[_0x1636('0x24')][_0x1636('0x4e')]()),_0x229b5b);return respondWithRpcPromise(_0x1636('0x46'),_0x1636('0x1d'),{'module':_0x1636('0x4f')});}})[_0x1636('0x14')](handleError(_0x3de7c8,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 91259cd..8a08b03 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 _0xb2b3=['network','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./network.attributes','exports','define','Network'];(function(_0xc753c8,_0x5627ff){var _0xd02f5c=function(_0xfb552e){while(--_0xfb552e){_0xc753c8['push'](_0xc753c8['shift']());}};_0xd02f5c(++_0x5627ff);}(_0xb2b3,0x71));var _0x3b2b=function(_0x5c87f5,_0x5255bd){_0x5c87f5=_0x5c87f5-0x0;var _0x4e1508=_0xb2b3[_0x5c87f5];return _0x4e1508;};'use strict';var _=require(_0x3b2b('0x0'));var util=require(_0x3b2b('0x1'));var logger=require(_0x3b2b('0x2'))(_0x3b2b('0x3'));var moment=require(_0x3b2b('0x4'));var BPromise=require(_0x3b2b('0x5'));var rp=require(_0x3b2b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3b2b('0x7'));var config=require(_0x3b2b('0x8'));var attributes=require(_0x3b2b('0x9'));module[_0x3b2b('0xa')]=function(_0x2581eb,_0xc53a84){return _0x2581eb[_0x3b2b('0xb')](_0x3b2b('0xc'),attributes,{'tableName':_0x3b2b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0fd9=['./network.attributes','exports','Network','util','../../config/logger','api','moment','path','rimraf','../../config/environment'];(function(_0x31d576,_0x1f9ba1){var _0x3ad3b3=function(_0x77823e){while(--_0x77823e){_0x31d576['push'](_0x31d576['shift']());}};_0x3ad3b3(++_0x1f9ba1);}(_0x0fd9,0xa3));var _0x90fd=function(_0x5774be,_0x2259d3){_0x5774be=_0x5774be-0x0;var _0x4914b4=_0x0fd9[_0x5774be];return _0x4914b4;};'use strict';var _=require('lodash');var util=require(_0x90fd('0x0'));var logger=require(_0x90fd('0x1'))(_0x90fd('0x2'));var moment=require(_0x90fd('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x90fd('0x4'));var rimraf=require(_0x90fd('0x5'));var config=require(_0x90fd('0x6'));var attributes=require(_0x90fd('0x7'));module[_0x90fd('0x8')]=function(_0x23e11b,_0x5e2107){return _0x23e11b['define'](_0x90fd('0x9'),attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js index 89bd07f..6e264f1 100644 --- a/server/api/network/network.rpc.js +++ b/server/api/network/network.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7a54,0x106));var _0x47a5=function(_0x415b4f,_0x3e2d1f){_0x415b4f=_0x415b4f-0x0;var _0x422dff=_0x7a54[_0x415b4f];return _0x422dff;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7a54,0x106));var _0x47a5=function(_0x564d78,_0x1ddd73){_0x564d78=_0x564d78-0x0;var _0x1c7a82=_0x7a54[_0x564d78];return _0x1c7a82;};'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 c9a5820..2aef168 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 _0xbba4=['exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelAccount.controller','get','isAuthenticated','/describe','describe','show','getDispositions','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents','post','create','addDisposition','addAnswer','/:id/notify','addApplications','addAgents','/:id/send','send','put','/:id','update','delete','destroy','/:id/dispositions','/:id/canned_answers','removeAnswers','removeAgents'];(function(_0x5b78e8,_0x55096b){var _0xf2c321=function(_0x4e0cff){while(--_0x4e0cff){_0x5b78e8['push'](_0x5b78e8['shift']());}};_0xf2c321(++_0x55096b);}(_0xbba4,0x141));var _0x4bba=function(_0x567496,_0x216e8d){_0x567496=_0x567496-0x0;var _0x45fa79=_0xbba4[_0x567496];return _0x45fa79;};'use strict';var multer=require(_0x4bba('0x0'));var util=require(_0x4bba('0x1'));var path=require(_0x4bba('0x2'));var timeout=require('connect-timeout');var express=require(_0x4bba('0x3'));var router=express['Router']();var fs_extra=require(_0x4bba('0x4'));var auth=require(_0x4bba('0x5'));var interaction=require(_0x4bba('0x6'));var config=require('../../config/environment');var controller=require(_0x4bba('0x7'));router[_0x4bba('0x8')]('/',auth[_0x4bba('0x9')](),controller['index']);router[_0x4bba('0x8')](_0x4bba('0xa'),auth['isAuthenticated'](),controller[_0x4bba('0xb')]);router[_0x4bba('0x8')]('/:id',auth[_0x4bba('0x9')](),controller[_0x4bba('0xc')]);router[_0x4bba('0x8')]('/:id/dispositions',auth[_0x4bba('0x9')](),controller[_0x4bba('0xd')]);router[_0x4bba('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x4bba('0xe')]);router[_0x4bba('0x8')](_0x4bba('0xf'),auth[_0x4bba('0x9')](),controller[_0x4bba('0x10')]);router[_0x4bba('0x8')](_0x4bba('0x11'),auth[_0x4bba('0x9')](),controller[_0x4bba('0x12')]);router[_0x4bba('0x8')](_0x4bba('0x13'),auth[_0x4bba('0x9')](),controller[_0x4bba('0x14')]);router[_0x4bba('0x15')]('/',auth[_0x4bba('0x9')](),controller[_0x4bba('0x16')]);router['post']('/:id/dispositions',auth['isAuthenticated'](),controller[_0x4bba('0x17')]);router[_0x4bba('0x15')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x4bba('0x18')]);router['post'](_0x4bba('0x19'),controller['notify']);router[_0x4bba('0x15')]('/:id/applications',auth[_0x4bba('0x9')](),controller[_0x4bba('0x1a')]);router[_0x4bba('0x15')](_0x4bba('0x13'),auth[_0x4bba('0x9')](),controller[_0x4bba('0x1b')]);router['post'](_0x4bba('0x1c'),auth[_0x4bba('0x9')](),controller[_0x4bba('0x1d')]);router[_0x4bba('0x1e')](_0x4bba('0x1f'),auth[_0x4bba('0x9')](),controller[_0x4bba('0x20')]);router[_0x4bba('0x21')]('/:id',auth[_0x4bba('0x9')](),controller[_0x4bba('0x22')]);router['delete'](_0x4bba('0x23'),auth[_0x4bba('0x9')](),controller['removeDispositions']);router[_0x4bba('0x21')](_0x4bba('0x24'),auth[_0x4bba('0x9')](),controller[_0x4bba('0x25')]);router[_0x4bba('0x21')](_0x4bba('0x13'),auth['isAuthenticated'](),controller[_0x4bba('0x26')]);module[_0x4bba('0x27')]=router; \ No newline at end of file +var _0x749a=['index','get','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/users','getAgents','post','create','addDisposition','addAnswer','/:id/notify','notify','addApplications','/:id/send','send','put','update','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','isAuthenticated'];(function(_0x27af84,_0x2a8fd0){var _0x519c6f=function(_0x145adc){while(--_0x145adc){_0x27af84['push'](_0x27af84['shift']());}};_0x519c6f(++_0x2a8fd0);}(_0x749a,0x11a));var _0xa749=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x749a[_0x4565bf];return _0x5610ba;};'use strict';var multer=require(_0xa749('0x0'));var util=require(_0xa749('0x1'));var path=require(_0xa749('0x2'));var timeout=require(_0xa749('0x3'));var express=require(_0xa749('0x4'));var router=express[_0xa749('0x5')]();var fs_extra=require(_0xa749('0x6'));var auth=require(_0xa749('0x7'));var interaction=require(_0xa749('0x8'));var config=require(_0xa749('0x9'));var controller=require(_0xa749('0xa'));router['get']('/',auth[_0xa749('0xb')](),controller[_0xa749('0xc')]);router[_0xa749('0xd')](_0xa749('0xe'),auth['isAuthenticated'](),controller[_0xa749('0xf')]);router['get'](_0xa749('0x10'),auth[_0xa749('0xb')](),controller[_0xa749('0x11')]);router[_0xa749('0xd')](_0xa749('0x12'),auth[_0xa749('0xb')](),controller[_0xa749('0x13')]);router[_0xa749('0xd')](_0xa749('0x14'),auth['isAuthenticated'](),controller[_0xa749('0x15')]);router[_0xa749('0xd')](_0xa749('0x16'),auth['isAuthenticated'](),controller[_0xa749('0x17')]);router['get']('/:id/interactions',auth['isAuthenticated'](),controller['getInteractions']);router[_0xa749('0xd')](_0xa749('0x18'),auth[_0xa749('0xb')](),controller[_0xa749('0x19')]);router[_0xa749('0x1a')]('/',auth[_0xa749('0xb')](),controller[_0xa749('0x1b')]);router[_0xa749('0x1a')](_0xa749('0x12'),auth['isAuthenticated'](),controller[_0xa749('0x1c')]);router[_0xa749('0x1a')]('/:id/canned_answers',auth[_0xa749('0xb')](),controller[_0xa749('0x1d')]);router['post'](_0xa749('0x1e'),controller[_0xa749('0x1f')]);router[_0xa749('0x1a')](_0xa749('0x16'),auth[_0xa749('0xb')](),controller[_0xa749('0x20')]);router['post'](_0xa749('0x18'),auth[_0xa749('0xb')](),controller['addAgents']);router[_0xa749('0x1a')](_0xa749('0x21'),auth['isAuthenticated'](),controller[_0xa749('0x22')]);router[_0xa749('0x23')](_0xa749('0x10'),auth[_0xa749('0xb')](),controller[_0xa749('0x24')]);router[_0xa749('0x25')]('/:id',auth[_0xa749('0xb')](),controller['destroy']);router[_0xa749('0x25')](_0xa749('0x12'),auth['isAuthenticated'](),controller[_0xa749('0x26')]);router[_0xa749('0x25')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xa749('0x27')]);router['delete'](_0xa749('0x18'),auth['isAuthenticated'](),controller[_0xa749('0x28')]);module[_0xa749('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 c5a6e69..af41fba 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 _0x6e73=['generate','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports','name','STRING'];(function(_0x3ba5a4,_0x1ab3a2){var _0x361851=function(_0x2711bb){while(--_0x2711bb){_0x3ba5a4['push'](_0x3ba5a4['shift']());}};_0x361851(++_0x1ab3a2);}(_0x6e73,0x193));var _0x36e7=function(_0x1a4c83,_0x434885){_0x1a4c83=_0x1a4c83-0x0;var _0x389ac2=_0x6e73[_0x1a4c83];return _0x389ac2;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x36e7('0x0'));module[_0x36e7('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x36e7('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x36e7('0x3')]},'token':{'type':Sequelize[_0x36e7('0x3')],'defaultValue':function(){return rs[_0x36e7('0x4')]();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x36e7('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x36e7('0x5')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x36e7('0x5')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x36e7('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x36e7('0x3')]},'queueTransfer':{'type':Sequelize[_0x36e7('0x5')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x36e7('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x36e7('0x5')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x36e7('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x36e7('0x6')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x36e7('0x5')],'defaultValue':![],'comment':_0x36e7('0x7'),'set':function(_0x2d5f90){if(!_0x2d5f90)this[_0x36e7('0x8')](_0x36e7('0x9'),null);this[_0x36e7('0x8')](_0x36e7('0xa'),_0x2d5f90);}}}; \ No newline at end of file +var _0x37d2=['STRING','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','randomstring','exports'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0x37d2,0x1c4));var _0x237d=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x37d2[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require(_0x237d('0x0'));var rs=require(_0x237d('0x1'));module[_0x237d('0x2')]={'name':{'type':Sequelize[_0x237d('0x3')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x237d('0x3')]},'token':{'type':Sequelize[_0x237d('0x3')],'defaultValue':function(){return rs[_0x237d('0x4')]();}},'replyUri':{'type':Sequelize[_0x237d('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x237d('0x5')],'defaultValue':function(){return _0x237d('0x6');}},'notificationSound':{'type':Sequelize[_0x237d('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x237d('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x237d('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x237d('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x237d('0x3')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x237d('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x237d('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x237d('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x237d('0x9')},'mandatoryDisposition':{'type':Sequelize[_0x237d('0x7')],'defaultValue':![],'comment':_0x237d('0xa'),'set':function(_0x3f428c){if(!_0x3f428c)this[_0x237d('0xb')]('mandatoryDispositionPauseId',null);this[_0x237d('0xb')](_0x237d('0xc'),_0x3f428c);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 5cef3f8..2f30187 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 _0x565f=['rows','catch','show','mandatoryDispositionPause','find','create','body','user','UserProfileSection','userProfileId','autoAssociation','params','describe','Disposition','getDispositions','findOne','nolimit','OpenchannelAccountId','removeDispositions','CannedAnswer','getAnswers','removeAnswers','ids','openchannel','CmContact','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','from','Sequelize','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','OpenchannelApplication','Applications','account','applications','list','orderBy','priority','asc','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','spread','messageId','interaction','created','autoclose','close','*,*,*,*','OpenchannelMessage','AttachmentId','User','UserId','unshift','agent','waitForTheAssignedAgent','queueId','OpenchannelQueue','queue','waitForTheAssignedQueue','Start','startRouting','EventManager','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','finally','send','getApplications','getInteractions','Contact','fullname','internal','Tags','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','getAgents','out','dataValues','Messages','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','fs-extra','squel','crypto','jsforce','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','client','http','then','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','OpenchannelAccount,\x20%s,\x20%s','message','info','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','get','OpenchannelAccounts','UserProfileResource','name','index','Pause','OpenchannelAccount','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll'];(function(_0x920cd8,_0x3cb9f6){var _0x466f69=function(_0x9dfefa){while(--_0x9dfefa){_0x920cd8['push'](_0x920cd8['shift']());}};_0x466f69(++_0x3cb9f6);}(_0x565f,0x68));var _0xf565=function(_0x386d2c,_0x5cd4e3){_0x386d2c=_0x386d2c-0x0;var _0x574e15=_0x565f[_0x386d2c];return _0x574e15;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf565('0x0'));var zipdir=require(_0xf565('0x1'));var jsonpatch=require(_0xf565('0x2'));var rp=require('request-promise');var moment=require(_0xf565('0x3'));var BPromise=require(_0xf565('0x4'));var Mustache=require(_0xf565('0x5'));var util=require(_0xf565('0x6'));var path=require(_0xf565('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf565('0x8'));var _=require('lodash');var squel=require(_0xf565('0x9'));var crypto=require(_0xf565('0xa'));var jsforce=require(_0xf565('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xf565('0xc'));var querystring=require('querystring');var Papa=require(_0xf565('0xd'));var Redis=require('ioredis');var authService=require(_0xf565('0xe'));var qs=require(_0xf565('0xf'));var as=require(_0xf565('0x10'));var hardwareService=require(_0xf565('0x11'));var logger=require(_0xf565('0x12'))(_0xf565('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf565('0x14'));var db=require(_0xf565('0x15'))['db'];config[_0xf565('0x16')]=_[_0xf565('0x17')](config[_0xf565('0x16')],{'host':_0xf565('0x18'),'port':0x18eb});var socket=require(_0xf565('0x19'))(new Redis(config[_0xf565('0x16')]));require(_0xf565('0x1a'))[_0xf565('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0xf565('0x1c')][_0xf565('0x1d')]({'port':0x232c});var client9002=jayson['client'][_0xf565('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x2cd6a8,_0x468d80,_0x46ee2e,_0x38e9d1){return new BPromise(function(_0x509ff4,_0x15c485){var _0x4e7abb=_0x38e9d1||client;return _0x4e7abb['request'](_0x2cd6a8,_0x46ee2e)[_0xf565('0x1e')](function(_0xfc92b8){logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x468d80,_0xf565('0x1f'));logger['debug'](_0xf565('0x20'),_0x468d80,_0xf565('0x1f'),JSON[_0xf565('0x21')](_0xfc92b8));if(_0xfc92b8['error']){if(_0xfc92b8['error'][_0xf565('0x22')]===0x1f4){logger[_0xf565('0x23')](_0xf565('0x24'),_0x468d80,_0xfc92b8[_0xf565('0x23')][_0xf565('0x25')]);return _0x15c485(_0xfc92b8['error'][_0xf565('0x25')]);}logger[_0xf565('0x23')](_0xf565('0x24'),_0x468d80,_0xfc92b8[_0xf565('0x23')][_0xf565('0x25')]);return _0x509ff4(_0xfc92b8[_0xf565('0x23')][_0xf565('0x25')]);}else{logger[_0xf565('0x26')](_0xf565('0x24'),_0x468d80,_0xf565('0x1f'));_0x509ff4(_0xfc92b8['result'][_0xf565('0x25')]);}})['catch'](function(_0x46da9b){logger[_0xf565('0x23')]('OpenchannelAccount,\x20%s,\x20%s',_0x468d80,_0x46da9b);_0x15c485(_0x46da9b);});});}function respondWithStatusCode(_0x385d8f,_0xe06651){_0xe06651=_0xe06651||0xcc;return function(_0x2e8f6b){if(_0x2e8f6b){return _0x385d8f[_0xf565('0x27')](_0xe06651);}return _0x385d8f[_0xf565('0x28')](_0xe06651)[_0xf565('0x29')]();};}function respondWithResult(_0x42d7ab,_0xf05b6b){_0xf05b6b=_0xf05b6b||0xc8;return function(_0x53d8b3){if(_0x53d8b3){return _0x42d7ab[_0xf565('0x28')](_0xf05b6b)[_0xf565('0x2a')](_0x53d8b3);}};}function respondWithFilteredResult(_0x18082a,_0x2e41e7){return function(_0x28f75d){if(_0x28f75d){var _0x5ecd01=typeof _0x2e41e7[_0xf565('0x2b')]===_0xf565('0x2c')&&typeof _0x2e41e7[_0xf565('0x2d')]===_0xf565('0x2c');var _0x233dca=_0x28f75d['count'];var _0x8887aa=_0x5ecd01?0x0:_0x2e41e7[_0xf565('0x2b')];var _0x3efca0=_0x5ecd01?_0x28f75d[_0xf565('0x2e')]:_0x2e41e7[_0xf565('0x2b')]+_0x2e41e7[_0xf565('0x2d')];var _0x5ac8d3;if(_0x3efca0>=_0x233dca){_0x3efca0=_0x233dca;_0x5ac8d3=0xc8;}else{_0x5ac8d3=0xce;}_0x18082a[_0xf565('0x28')](_0x5ac8d3);return _0x18082a[_0xf565('0x2f')]('Content-Range',_0x8887aa+'-'+_0x3efca0+'/'+_0x233dca)[_0xf565('0x2a')](_0x28f75d);}return null;};}function patchUpdates(_0x1fd422){return function(_0x111e80){try{jsonpatch[_0xf565('0x30')](_0x111e80,_0x1fd422,!![]);}catch(_0x10d22a){return BPromise[_0xf565('0x31')](_0x10d22a);}return _0x111e80[_0xf565('0x32')]();};}function saveUpdates(_0x195487,_0x4ec586){return function(_0x32b386){if(_0x32b386){return _0x32b386[_0xf565('0x33')](_0x195487)[_0xf565('0x1e')](function(_0x4842a3){return _0x4842a3;});}return null;};}function removeEntity(_0xb6a7a7,_0x3b1f2f){return function(_0x33e307){if(_0x33e307){return _0x33e307[_0xf565('0x34')]()[_0xf565('0x1e')](function(){var _0x59981a=_0x33e307[_0xf565('0x35')]({'plain':!![]});var _0x57e1ba=_0xf565('0x36');return db[_0xf565('0x37')]['destroy']({'where':{'type':_0x57e1ba,'resourceId':_0x59981a['id']}})['then'](function(){return _0x33e307;});})[_0xf565('0x1e')](function(){_0xb6a7a7[_0xf565('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x430427,_0x5c79b8){return function(_0x4dce84){if(!_0x4dce84){_0x430427['sendStatus'](0x194);}return _0x4dce84;};}function handleError(_0x5ab542,_0x3293f2){_0x3293f2=_0x3293f2||0x1f4;return function(_0x41961f){logger[_0xf565('0x23')](_0x41961f['stack']);if(_0x41961f[_0xf565('0x38')]){delete _0x41961f[_0xf565('0x38')];}_0x5ab542[_0xf565('0x28')](_0x3293f2)['send'](_0x41961f);};}exports[_0xf565('0x39')]=function(_0x47fd57,_0x2d09fb){var _0x3273ad={'include':[{'model':db[_0xf565('0x3a')],'as':'mandatoryDispositionPause'}]},_0xf806de={},_0x54bf2d={'count':0x0,'rows':[]};var _0x1da55c=_['map'](db[_0xf565('0x3b')][_0xf565('0x3c')],function(_0x4a3878){return{'name':_0x4a3878[_0xf565('0x3d')],'type':_0x4a3878[_0xf565('0x3e')][_0xf565('0x3f')]};});_0xf806de['model']=_[_0xf565('0x40')](_0x1da55c,'name');_0xf806de[_0xf565('0x41')]=_[_0xf565('0x42')](_0x47fd57[_0xf565('0x41')]);_0xf806de[_0xf565('0x43')]=_[_0xf565('0x44')](_0xf806de[_0xf565('0x45')],_0xf806de['query']);_0x3273ad['attributes']=_[_0xf565('0x44')](_0xf806de[_0xf565('0x45')],qs[_0xf565('0x46')](_0x47fd57[_0xf565('0x41')][_0xf565('0x46')]));_0x3273ad['attributes']=_0x3273ad[_0xf565('0x47')][_0xf565('0x48')]?_0x3273ad[_0xf565('0x47')]:_0xf806de[_0xf565('0x45')];if(!_0x47fd57['query'][_0xf565('0x49')]('nolimit')){_0x3273ad['limit']=qs[_0xf565('0x2d')](_0x47fd57[_0xf565('0x41')]['limit']);_0x3273ad['offset']=qs['offset'](_0x47fd57[_0xf565('0x41')][_0xf565('0x2b')]);}_0x3273ad[_0xf565('0x4a')]=qs[_0xf565('0x4b')](_0x47fd57[_0xf565('0x41')][_0xf565('0x4b')]);_0x3273ad[_0xf565('0x4c')]=qs[_0xf565('0x43')](_[_0xf565('0x4d')](_0x47fd57[_0xf565('0x41')],_0xf806de[_0xf565('0x43')]),_0x1da55c);if(_0x47fd57['query']['filter']){_0x3273ad['where']=_[_0xf565('0x4e')](_0x3273ad[_0xf565('0x4c')],{'$or':_[_0xf565('0x40')](_0x1da55c,function(_0x4a7b86){if(_0x4a7b86['type']!==_0xf565('0x4f')){var _0x225d7={};_0x225d7[_0x4a7b86[_0xf565('0x38')]]={'$like':'%'+_0x47fd57['query'][_0xf565('0x50')]+'%'};return _0x225d7;}})});}_0x3273ad=_[_0xf565('0x4e')]({},_0x3273ad,_0x47fd57[_0xf565('0x51')]);var _0x483632={'where':_0x3273ad['where']};return db[_0xf565('0x3b')]['count'](_0x483632)[_0xf565('0x1e')](function(_0x148e93){_0x54bf2d[_0xf565('0x2e')]=_0x148e93;if(_0x47fd57[_0xf565('0x41')][_0xf565('0x52')]){_0x3273ad[_0xf565('0x53')]=[{'all':!![]}];}return db[_0xf565('0x3b')][_0xf565('0x54')](_0x3273ad);})[_0xf565('0x1e')](function(_0x1a3751){_0x54bf2d[_0xf565('0x55')]=_0x1a3751;return _0x54bf2d;})[_0xf565('0x1e')](respondWithFilteredResult(_0x2d09fb,_0x3273ad))[_0xf565('0x56')](handleError(_0x2d09fb,null));};exports[_0xf565('0x57')]=function(_0x5a6779,_0x4a49de){var _0x3deb88={'raw':![],'where':{'id':_0x5a6779['params']['id']},'include':[{'model':db[_0xf565('0x3a')],'as':_0xf565('0x58')}]},_0x3048e3={};_0x3048e3['model']=_['keys'](db[_0xf565('0x3b')][_0xf565('0x3c')]);_0x3048e3[_0xf565('0x41')]=_[_0xf565('0x42')](_0x5a6779[_0xf565('0x41')]);_0x3048e3[_0xf565('0x43')]=_[_0xf565('0x44')](_0x3048e3[_0xf565('0x45')],_0x3048e3['query']);_0x3deb88[_0xf565('0x47')]=_['intersection'](_0x3048e3[_0xf565('0x45')],qs[_0xf565('0x46')](_0x5a6779['query']['fields']));_0x3deb88[_0xf565('0x47')]=_0x3deb88[_0xf565('0x47')][_0xf565('0x48')]?_0x3deb88[_0xf565('0x47')]:_0x3048e3['model'];if(_0x5a6779[_0xf565('0x41')][_0xf565('0x52')]){_0x3deb88[_0xf565('0x53')]=[{'all':!![]}];}_0x3deb88=_[_0xf565('0x4e')]({},_0x3deb88,_0x5a6779[_0xf565('0x51')]);return db['OpenchannelAccount'][_0xf565('0x59')](_0x3deb88)['then'](handleEntityNotFound(_0x4a49de,null))[_0xf565('0x1e')](respondWithResult(_0x4a49de,null))['catch'](handleError(_0x4a49de,null));};exports['create']=function(_0x3d0cdb,_0x4664d5){return db[_0xf565('0x3b')][_0xf565('0x5a')](_0x3d0cdb[_0xf565('0x5b')],{})[_0xf565('0x1e')](function(_0x4bc082){var _0x491b3a=_0x3d0cdb[_0xf565('0x5c')][_0xf565('0x35')]({'plain':!![]});if(!_0x491b3a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x491b3a['role']===_0xf565('0x5c')){var _0x1b928e=_0x4bc082[_0xf565('0x35')]({'plain':!![]});var _0x5757dd=_0xf565('0x36');return db[_0xf565('0x5d')][_0xf565('0x59')]({'where':{'name':_0x5757dd,'userProfileId':_0x491b3a[_0xf565('0x5e')]},'raw':!![]})['then'](function(_0x42ee65){if(_0x42ee65&&_0x42ee65[_0xf565('0x5f')]===0x0){return db['UserProfileResource'][_0xf565('0x5a')]({'name':_0x1b928e[_0xf565('0x38')],'resourceId':_0x1b928e['id'],'type':_0x42ee65['name'],'sectionId':_0x42ee65['id']},{})[_0xf565('0x1e')](function(){return _0x4bc082;});}else{return _0x4bc082;}})['catch'](function(_0x1a32ac){logger[_0xf565('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1a32ac);throw _0x1a32ac;});}return _0x4bc082;})[_0xf565('0x1e')](respondWithResult(_0x4664d5,0xc9))[_0xf565('0x56')](handleError(_0x4664d5,null));};exports[_0xf565('0x33')]=function(_0x6f3df3,_0x1de791){if(_0x6f3df3[_0xf565('0x5b')]['id']){delete _0x6f3df3[_0xf565('0x5b')]['id'];}return db['OpenchannelAccount'][_0xf565('0x59')]({'where':{'id':_0x6f3df3['params']['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0xf565('0x1e')](handleEntityNotFound(_0x1de791,null))[_0xf565('0x1e')](saveUpdates(_0x6f3df3[_0xf565('0x5b')],null))[_0xf565('0x1e')](respondWithResult(_0x1de791,null))[_0xf565('0x56')](handleError(_0x1de791,null));};exports[_0xf565('0x34')]=function(_0x9205d7,_0x37fc94){return db[_0xf565('0x3b')][_0xf565('0x59')]({'where':{'id':_0x9205d7[_0xf565('0x60')]['id']}})[_0xf565('0x1e')](handleEntityNotFound(_0x37fc94,null))[_0xf565('0x1e')](removeEntity(_0x37fc94,null))[_0xf565('0x56')](handleError(_0x37fc94,null));};exports[_0xf565('0x61')]=function(_0x13bd25,_0x59aff7){return db[_0xf565('0x3b')]['describe']()[_0xf565('0x1e')](respondWithResult(_0x59aff7,null))[_0xf565('0x56')](handleError(_0x59aff7,null));};exports['addDisposition']=function(_0x21defc,_0x114a42,_0x4b48ab){if(_0x21defc['body']['id']){delete _0x21defc[_0xf565('0x5b')]['id'];}return db['OpenchannelAccount'][_0xf565('0x59')]({'where':{'id':_0x21defc[_0xf565('0x60')]['id']}})['then'](handleEntityNotFound(_0x114a42,null))[_0xf565('0x1e')](function(_0x486009){if(_0x486009){_0x21defc[_0xf565('0x5b')]['OpenchannelAccountId']=_0x486009['id'];return db[_0xf565('0x62')][_0xf565('0x5a')](_0x21defc[_0xf565('0x5b')]);}})[_0xf565('0x1e')](respondWithResult(_0x114a42,null))[_0xf565('0x56')](handleError(_0x114a42,null));};exports[_0xf565('0x63')]=function(_0xe7e49,_0x3b7533,_0x3fe535){var _0x4992f3={'raw':![],'where':{}};var _0x203410={};var _0x25966f={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xf565('0x64')]({'where':{'id':_0xe7e49['params']['id']}})[_0xf565('0x1e')](handleEntityNotFound(_0x3b7533,null))[_0xf565('0x1e')](function(_0x161f17){if(_0x161f17){_0x203410[_0xf565('0x45')]=_['keys'](db[_0xf565('0x62')][_0xf565('0x3c')]);_0x203410['query']=_[_0xf565('0x42')](_0xe7e49['query']);_0x203410[_0xf565('0x43')]=_['intersection'](_0x203410[_0xf565('0x45')],_0x203410[_0xf565('0x41')]);_0x4992f3['attributes']=_['intersection'](_0x203410[_0xf565('0x45')],qs[_0xf565('0x46')](_0xe7e49['query']['fields']));_0x4992f3['attributes']=_0x4992f3[_0xf565('0x47')][_0xf565('0x48')]?_0x4992f3[_0xf565('0x47')]:_0x203410[_0xf565('0x45')];if(!_0xe7e49[_0xf565('0x41')][_0xf565('0x49')](_0xf565('0x65'))){_0x4992f3[_0xf565('0x2d')]=qs[_0xf565('0x2d')](_0xe7e49['query'][_0xf565('0x2d')]);_0x4992f3[_0xf565('0x2b')]=qs[_0xf565('0x2b')](_0xe7e49[_0xf565('0x41')][_0xf565('0x2b')]);}_0x4992f3['order']=qs['sort'](_0xe7e49[_0xf565('0x41')][_0xf565('0x4b')]);_0x4992f3['where']=qs[_0xf565('0x43')](_[_0xf565('0x4d')](_0xe7e49[_0xf565('0x41')],_0x203410[_0xf565('0x43')]));_0x4992f3['where'][_0xf565('0x66')]=_0x161f17['id'];if(_0xe7e49[_0xf565('0x41')][_0xf565('0x50')]){_0x4992f3[_0xf565('0x4c')]=_[_0xf565('0x4e')](_0x4992f3['where'],{'$or':_['map'](_0x4992f3[_0xf565('0x47')],function(_0x250c6d){var _0x33eaa2={};_0x33eaa2[_0x250c6d]={'$like':'%'+_0xe7e49[_0xf565('0x41')]['filter']+'%'};return _0x33eaa2;})});}_0x4992f3=_[_0xf565('0x4e')]({},_0x4992f3,_0xe7e49['options']);return db['Disposition'][_0xf565('0x2e')]({'where':_0x4992f3[_0xf565('0x4c')]})[_0xf565('0x1e')](function(_0x24bd81){_0x25966f[_0xf565('0x2e')]=_0x24bd81;if(_0xe7e49[_0xf565('0x41')][_0xf565('0x52')]){_0x4992f3['include']=[{'all':!![]}];}return db['Disposition']['findAll'](_0x4992f3);})['then'](function(_0x1cca21){_0x25966f[_0xf565('0x55')]=_0x1cca21;return _0x25966f;});}})[_0xf565('0x1e')](respondWithFilteredResult(_0x3b7533,_0x4992f3))['catch'](handleError(_0x3b7533,null));};exports[_0xf565('0x67')]=function(_0x5c17d7,_0x526ca4,_0x1212f3){return db[_0xf565('0x3b')]['find']({'where':{'id':_0x5c17d7[_0xf565('0x60')]['id']}})[_0xf565('0x1e')](handleEntityNotFound(_0x526ca4,null))[_0xf565('0x1e')](function(_0x4feaab){if(_0x4feaab){return _0x4feaab[_0xf565('0x67')](_0x5c17d7[_0xf565('0x41')]['ids']);}})[_0xf565('0x1e')](respondWithStatusCode(_0x526ca4,null))[_0xf565('0x56')](handleError(_0x526ca4,null));};exports['addAnswer']=function(_0x2b3f61,_0x4dc9c1,_0x22df77){if(_0x2b3f61[_0xf565('0x5b')]['id']){delete _0x2b3f61[_0xf565('0x5b')]['id'];}return db[_0xf565('0x3b')][_0xf565('0x59')]({'where':{'id':_0x2b3f61[_0xf565('0x60')]['id']}})[_0xf565('0x1e')](handleEntityNotFound(_0x4dc9c1,null))[_0xf565('0x1e')](function(_0x1aca90){if(_0x1aca90){_0x2b3f61['body'][_0xf565('0x66')]=_0x1aca90['id'];return db[_0xf565('0x68')]['create'](_0x2b3f61[_0xf565('0x5b')]);}})['then'](respondWithResult(_0x4dc9c1,null))['catch'](handleError(_0x4dc9c1,null));};exports[_0xf565('0x69')]=function(_0x2f2b56,_0x4726ff,_0x79d104){var _0x1357e9={'raw':![],'where':{}};var _0x59093b={};var _0x314d69={'count':0x0,'rows':[]};return db[_0xf565('0x3b')][_0xf565('0x64')]({'where':{'id':_0x2f2b56[_0xf565('0x60')]['id']}})[_0xf565('0x1e')](handleEntityNotFound(_0x4726ff,null))[_0xf565('0x1e')](function(_0x1688bc){if(_0x1688bc){_0x59093b[_0xf565('0x45')]=_['keys'](db[_0xf565('0x68')]['rawAttributes']);_0x59093b['query']=_['keys'](_0x2f2b56[_0xf565('0x41')]);_0x59093b[_0xf565('0x43')]=_['intersection'](_0x59093b[_0xf565('0x45')],_0x59093b[_0xf565('0x41')]);_0x1357e9[_0xf565('0x47')]=_[_0xf565('0x44')](_0x59093b[_0xf565('0x45')],qs[_0xf565('0x46')](_0x2f2b56[_0xf565('0x41')][_0xf565('0x46')]));_0x1357e9[_0xf565('0x47')]=_0x1357e9['attributes'][_0xf565('0x48')]?_0x1357e9[_0xf565('0x47')]:_0x59093b[_0xf565('0x45')];if(!_0x2f2b56['query'][_0xf565('0x49')]('nolimit')){_0x1357e9[_0xf565('0x2d')]=qs[_0xf565('0x2d')](_0x2f2b56[_0xf565('0x41')][_0xf565('0x2d')]);_0x1357e9[_0xf565('0x2b')]=qs['offset'](_0x2f2b56[_0xf565('0x41')][_0xf565('0x2b')]);}_0x1357e9['order']=qs['sort'](_0x2f2b56['query'][_0xf565('0x4b')]);_0x1357e9[_0xf565('0x4c')]=qs[_0xf565('0x43')](_[_0xf565('0x4d')](_0x2f2b56[_0xf565('0x41')],_0x59093b['filters']));_0x1357e9[_0xf565('0x4c')][_0xf565('0x66')]=_0x1688bc['id'];if(_0x2f2b56[_0xf565('0x41')][_0xf565('0x50')]){_0x1357e9[_0xf565('0x4c')]=_[_0xf565('0x4e')](_0x1357e9[_0xf565('0x4c')],{'$or':_[_0xf565('0x40')](_0x1357e9[_0xf565('0x47')],function(_0x3fa1a7){var _0x3126c1={};_0x3126c1[_0x3fa1a7]={'$like':'%'+_0x2f2b56['query'][_0xf565('0x50')]+'%'};return _0x3126c1;})});}_0x1357e9=_[_0xf565('0x4e')]({},_0x1357e9,_0x2f2b56[_0xf565('0x51')]);return db['CannedAnswer'][_0xf565('0x2e')]({'where':_0x1357e9['where']})['then'](function(_0x1aeda4){_0x314d69['count']=_0x1aeda4;if(_0x2f2b56[_0xf565('0x41')][_0xf565('0x52')]){_0x1357e9[_0xf565('0x53')]=[{'all':!![]}];}return db['CannedAnswer'][_0xf565('0x54')](_0x1357e9);})['then'](function(_0x35c451){_0x314d69['rows']=_0x35c451;return _0x314d69;});}})[_0xf565('0x1e')](respondWithFilteredResult(_0x4726ff,_0x1357e9))[_0xf565('0x56')](handleError(_0x4726ff,null));};exports[_0xf565('0x6a')]=function(_0x274d41,_0x44bc27,_0x29310b){return db[_0xf565('0x3b')]['find']({'where':{'id':_0x274d41[_0xf565('0x60')]['id']}})['then'](handleEntityNotFound(_0x44bc27,null))[_0xf565('0x1e')](function(_0x1ea264){if(_0x1ea264){return _0x1ea264[_0xf565('0x6a')](_0x274d41[_0xf565('0x41')][_0xf565('0x6b')]);}})[_0xf565('0x1e')](respondWithStatusCode(_0x44bc27,null))['catch'](handleError(_0x44bc27,null));};exports['notify']=function(_0x446b2e,_0x574602,_0x35242a){var _0x570923={'body':_0x446b2e[_0xf565('0x5b')],'channel':_0xf565('0x6c')};var _0x4519e1=[];var _0x51cef7=[];var _0x28e0ab={};var _0x18bc56=![];return db[_0xf565('0x6d')][_0xf565('0x61')]()[_0xf565('0x1e')](function(_0x5cd494){if(!_0x5cd494){throw new db['Sequelize'][(_0xf565('0x6e'))]('no\x20available\x20attributes');}_0x4519e1=_[_0xf565('0x6f')](_[_0xf565('0x42')](_0x5cd494),[_0xf565('0x70'),_0xf565('0x71')]);_0x51cef7=_[_0xf565('0x6f')](_['keys'](_0x5cd494),[_0xf565('0x70'),_0xf565('0x71'),_0xf565('0x72'),_0xf565('0x73')]);if(_0x446b2e[_0xf565('0x5b')]['id']){delete _0x446b2e[_0xf565('0x5b')]['id'];}if(_['isNil'](_0x446b2e[_0xf565('0x5b')][_0xf565('0x74')])){throw new db[(_0xf565('0x75'))][(_0xf565('0x6e'))](_0xf565('0x76'));}if(_[_0xf565('0x77')](_0x446b2e[_0xf565('0x5b')][_0xf565('0x5b')])||_0x446b2e['body'][_0xf565('0x5b')]===''){throw new db['Sequelize'][(_0xf565('0x6e'))](_0xf565('0x78'));}if(_[_0xf565('0x77')](_0x446b2e[_0xf565('0x5b')][_0xf565('0x79')])){throw new db[(_0xf565('0x75'))][(_0xf565('0x6e'))](_0xf565('0x7a')+_0x51cef7);}if(!_['includes'](_0x51cef7,_0x446b2e['body']['mapKey'])){throw new db[(_0xf565('0x75'))][(_0xf565('0x6e'))](_0xf565('0x7b')+_0x51cef7);}_0x28e0ab[_0x446b2e[_0xf565('0x5b')][_0xf565('0x79')]]=_0x446b2e['body']['from'];})[_0xf565('0x1e')](function(){return db[_0xf565('0x3b')]['find']({'where':{'id':_0x446b2e[_0xf565('0x60')]['id']},'include':[{'model':db[_0xf565('0x7c')],'as':_0xf565('0x7d'),'include':[{'model':db[_0xf565('0x6d')],'as':_0xf565('0x7e'),'where':_0x28e0ab,'limit':0x1,'order':[['updatedAt',_0xf565('0x7f')]]}]},{'model':db[_0xf565('0x80')],'as':_0xf565('0x81')}]});})['then'](handleEntityNotFound(_0x574602,null))[_0xf565('0x1e')](function(_0x31fab8){if(_0x31fab8&&_0x31fab8[_0xf565('0x7d')]){_0x570923[_0xf565('0x82')]=_0x31fab8;_0x570923[_0xf565('0x83')]=_0x31fab8[_0xf565('0x81')];_0x570923[_0xf565('0x84')]=_0x31fab8[_0xf565('0x7d')];_0x570923[_0xf565('0x83')]=_[_0xf565('0x85')](_0x570923[_0xf565('0x83')],[_0xf565('0x86')],[_0xf565('0x87')]);if(_0x570923[_0xf565('0x82')][_0xf565('0x81')]){delete _0x570923[_0xf565('0x82')]['Applications'];}if(_0x570923['account'][_0xf565('0x7d')]&&_0x570923['account'][_0xf565('0x7d')][_0xf565('0x7e')][_0xf565('0x48')]){return _0x570923[_0xf565('0x82')][_0xf565('0x7d')]['Contacts'][0x0];}var _0x15ba1e=_['defaults'](_0x446b2e['body'],{'firstName':_0x446b2e[_0xf565('0x5b')][_0xf565('0x74')],'ListId':_0x31fab8[_0xf565('0x73')]});_0x15ba1e[_0x446b2e[_0xf565('0x5b')]['mapKey']]=_0x446b2e[_0xf565('0x5b')][_0xf565('0x74')];return db[_0xf565('0x6d')][_0xf565('0x5a')](_0x15ba1e,{'fields':_0x4519e1,'raw':!![]});}})['then'](handleEntityNotFound(_0x574602,null))['then'](function(_0x65451c){_0x570923[_0xf565('0x88')]=_0x65451c;if(_0x65451c){var _0x59510f={'ContactId':_0x65451c['id'],'OpenchannelAccountId':_0x446b2e[_0xf565('0x60')]['id'],'from':(_0x65451c[_0xf565('0x89')]||'')+'\x20'+(_0x65451c[_0xf565('0x8a')]||'')};var _0x5983c3={'OpenchannelAccountId':_0x446b2e[_0xf565('0x60')]['id'],'closed':![]};if(_0x446b2e[_0xf565('0x5b')][_0xf565('0x8b')]){_0x5983c3['threadId']=_0x446b2e['body'][_0xf565('0x8b')];return db[_0xf565('0x8c')]['find']({'where':_0x5983c3})[_0xf565('0x1e')](function(_0x44dd0a){if(_0x44dd0a){return[_0x44dd0a,![]];}_0x59510f[_0xf565('0x8b')]=_0x446b2e['body'][_0xf565('0x8b')];_0x59510f[_0xf565('0x8d')]=_0x446b2e[_0xf565('0x5b')][_0xf565('0x8d')];return db[_0xf565('0x8c')]['create'](_0x59510f)['then'](function(_0x2d744d){return[_0x2d744d,!![]];});});}else{_0x5983c3[_0xf565('0x8b')]=null;}_0x5983c3['ContactId']=_0x65451c['id'];return db[_0xf565('0x8c')][_0xf565('0x59')]({'where':_0x5983c3})[_0xf565('0x1e')](function(_0x330ee9){if(_0x330ee9){return[_0x330ee9,![]];}return db[_0xf565('0x8c')][_0xf565('0x5a')](_0x59510f)[_0xf565('0x1e')](function(_0x6a193c){return[_0x6a193c,!![]];});});}})[_0xf565('0x8e')](function(_0x524247,_0x3c623f){if(_0x524247){_0x18bc56=_0x3c623f;if(!_0x3c623f){var _0x501ee2={'from':(_0x570923[_0xf565('0x88')][_0xf565('0x89')]||'')+'\x20'+(_0x570923[_0xf565('0x88')]['lastName']||'')};if(_0x446b2e[_0xf565('0x5b')][_0xf565('0x8b')]&&_0x446b2e[_0xf565('0x5b')][_0xf565('0x8f')]&&_0x446b2e['body'][_0xf565('0x8b')]!=_0x446b2e[_0xf565('0x5b')]['messageId']){_0x501ee2[_0xf565('0x8b')]=_0x446b2e['body'][_0xf565('0x8f')];}return _0x524247[_0xf565('0x33')](_0x501ee2);}else{return _0x524247;}}})[_0xf565('0x1e')](function(_0x47e038){_0x570923[_0xf565('0x90')]=_0x47e038[_0xf565('0x35')]({'plain':!![]});_0x570923[_0xf565('0x90')]['created']=_0x18bc56;if(_0x570923[_0xf565('0x90')][_0xf565('0x91')]){if(_0x570923[_0xf565('0x82')][_0xf565('0x92')]){_0x570923['applications']['push']({'id':0x0,'priority':_0x570923[_0xf565('0x83')]['length']+0x1,'app':_0xf565('0x93'),'appdata':'unmanaged','interval':_0xf565('0x94')});}}return db[_0xf565('0x95')][_0xf565('0x5a')]({'body':_0x446b2e[_0xf565('0x5b')][_0xf565('0x5b')],'OpenchannelAccountId':_0x446b2e[_0xf565('0x60')]['id'],'OpenchannelInteractionId':_0x47e038['id'],'direction':'in','ContactId':_0x570923['contact']['id'],'AttachmentId':_0x446b2e['body'][_0xf565('0x96')]});})[_0xf565('0x1e')](function(_0xd618ca){_0x570923['message']=_0xd618ca;if(!_0x570923['interaction']['UserId'])return;return db[_0xf565('0x97')][_0xf565('0x59')]({'attributes':['id',_0xf565('0x38')],'where':{'id':_0x570923[_0xf565('0x90')][_0xf565('0x98')]}});})['then'](function(_0xfd6ba3){if(_0xfd6ba3){_0x570923[_0xf565('0x83')][_0xf565('0x99')]({'id':0x0,'priority':0x0,'app':_0xf565('0x9a'),'appdata':_0xfd6ba3['name']+','+(_0x570923[_0xf565('0x82')][_0xf565('0x9b')]||0xa),'interval':_0xf565('0x94')});}if(!_0x570923[_0xf565('0x90')][_0xf565('0x9c')])return;return db[_0xf565('0x9d')][_0xf565('0x59')]({'attributes':['id',_0xf565('0x38')],'where':{'id':_0x570923[_0xf565('0x90')][_0xf565('0x9c')]}});})['then'](function(_0x582afb){if(_0x582afb){_0x570923[_0xf565('0x83')]['unshift']({'id':0x0,'priority':0x1,'app':_0xf565('0x9e'),'appdata':_0x582afb[_0xf565('0x38')]+','+(_0x570923[_0xf565('0x82')][_0xf565('0x9f')]||0x12c),'interval':_0xf565('0x94')});}return respondWithRpcPromise(_0xf565('0xa0'),_0xf565('0xa1'),_0x570923);})['then'](function(_0x4c8ab3){respondWithRpcPromise(_0xf565('0xa2'),_0xf565('0xa2'),{'event':'notify','message':_0x4c8ab3},client9002);return _0x4c8ab3;})['then'](respondWithResult(_0x574602,null))[_0xf565('0x56')](handleError(_0x574602,null));};exports[_0xf565('0xa3')]=function(_0x19deb2,_0x3ff578){var _0x487c0a=_0x19deb2[_0xf565('0x60')]['id'];var _0x5ebe50=_0x19deb2[_0xf565('0x5b')];var _0x242520=0xc8;var _0x44174a=null;return db[_0xf565('0xa4')][_0xf565('0xa5')]({'isolationLevel':db[_0xf565('0xa4')][_0xf565('0xa6')][_0xf565('0xa7')][_0xf565('0xa8')]},function(_0x3a7c1f){return db[_0xf565('0x3b')][_0xf565('0x64')]({'where':{'id':_0x487c0a},'transaction':_0x3a7c1f})['then'](function(_0x123e77){if(_0x123e77){return db['OpenchannelApplication'][_0xf565('0x34')]({'where':{'OpenchannelAccountId':_0x487c0a},'transaction':_0x3a7c1f})['then'](function(){var _0x474f73=_[_0xf565('0x40')](_0x5ebe50,function(_0xe011d6){_0xe011d6['OpenchannelAccountId']=_0x487c0a;return _0xe011d6;});return db[_0xf565('0x80')][_0xf565('0xa9')](_0x474f73,{'transaction':_0x3a7c1f});});}else{_0x242520=0x194;_0x44174a=[];}});})[_0xf565('0x1e')](function(){if(_0x242520!==0x194){return db['OpenchannelApplication'][_0xf565('0xaa')]({'where':{'OpenchannelAccountId':_0x487c0a},'order':_0xf565('0x86')})[_0xf565('0x1e')](function(_0x298850){_0x44174a=_0x298850;});}})[_0xf565('0x56')](function(_0x2041c3){_0x242520=0x1f4;logger[_0xf565('0x23')](_0x2041c3['stack']);if(_0x2041c3[_0xf565('0x38')]){delete _0x2041c3[_0xf565('0x38')];}_0x44174a=_0x2041c3;})[_0xf565('0xab')](function(){if(_0x44174a===null){_0x3ff578[_0xf565('0x27')](_0x242520);}else{if(_0x242520===0x1f4){_0x3ff578['status'](_0x242520)[_0xf565('0xac')](_0x44174a);}else{_0x3ff578[_0xf565('0x28')](_0x242520)[_0xf565('0x2a')](_0x44174a);}}});};exports[_0xf565('0xad')]=function(_0x1e0126,_0x301ae7,_0x292480){var _0x52b02f={};var _0x4641e2={};var _0x486587;var _0x1edf3c;return db[_0xf565('0x3b')][_0xf565('0x64')]({'where':{'id':_0x1e0126[_0xf565('0x60')]['id']}})[_0xf565('0x1e')](handleEntityNotFound(_0x301ae7,null))['then'](function(_0x21cd50){if(_0x21cd50){_0x486587=_0x21cd50;_0x4641e2[_0xf565('0x45')]=_[_0xf565('0x42')](db['OpenchannelApplication'][_0xf565('0x3c')]);_0x4641e2['query']=_[_0xf565('0x42')](_0x1e0126['query']);_0x4641e2[_0xf565('0x43')]=_[_0xf565('0x44')](_0x4641e2[_0xf565('0x45')],_0x4641e2['query']);_0x52b02f[_0xf565('0x47')]=_[_0xf565('0x44')](_0x4641e2[_0xf565('0x45')],qs[_0xf565('0x46')](_0x1e0126[_0xf565('0x41')][_0xf565('0x46')]));_0x52b02f[_0xf565('0x47')]=_0x52b02f[_0xf565('0x47')][_0xf565('0x48')]?_0x52b02f[_0xf565('0x47')]:_0x4641e2[_0xf565('0x45')];_0x52b02f[_0xf565('0x4a')]=qs[_0xf565('0x4b')](_0x1e0126[_0xf565('0x41')]['sort']);_0x52b02f['where']=qs['filters'](_[_0xf565('0x4d')](_0x1e0126[_0xf565('0x41')],_0x4641e2['filters']));if(_0x1e0126[_0xf565('0x41')]['filter']){_0x52b02f[_0xf565('0x4c')]=_['merge'](_0x52b02f[_0xf565('0x4c')],{'$or':_[_0xf565('0x40')](_0x52b02f[_0xf565('0x47')],function(_0x2c4a90){var _0x2ee374={};_0x2ee374[_0x2c4a90]={'$like':'%'+_0x1e0126[_0xf565('0x41')][_0xf565('0x50')]+'%'};return _0x2ee374;})});}_0x52b02f=_[_0xf565('0x4e')]({},_0x52b02f,_0x1e0126['options']);return _0x486587[_0xf565('0xad')](_0x52b02f);}})[_0xf565('0x1e')](function(_0x501055){if(_0x501055){_0x1edf3c=_0x501055[_0xf565('0x48')];if(!_0x1e0126[_0xf565('0x41')][_0xf565('0x49')]('nolimit')){_0x52b02f[_0xf565('0x2d')]=qs[_0xf565('0x2d')](_0x1e0126[_0xf565('0x41')][_0xf565('0x2d')]);_0x52b02f[_0xf565('0x2b')]=qs['offset'](_0x1e0126[_0xf565('0x41')]['offset']);}return _0x486587[_0xf565('0xad')](_0x52b02f);}})[_0xf565('0x1e')](function(_0x4f51d9){if(_0x4f51d9){return _0x4f51d9?{'count':_0x1edf3c,'rows':_0x4f51d9}:null;}})[_0xf565('0x1e')](respondWithResult(_0x301ae7,null))[_0xf565('0x56')](handleError(_0x301ae7,null));};exports[_0xf565('0xae')]=function(_0x268de1,_0x39f3ff,_0x501db6){var _0x2dad08={'raw':![],'where':{}};var _0x18d452={};var _0x3bb966={'count':0x0,'rows':[]};return db[_0xf565('0x3b')]['findOne']({'where':{'id':_0x268de1[_0xf565('0x60')]['id']}})['then'](handleEntityNotFound(_0x39f3ff,null))['then'](function(_0x48a69a){if(_0x48a69a){_0x18d452['model']=_[_0xf565('0x42')](db[_0xf565('0x8c')][_0xf565('0x3c')]);_0x18d452[_0xf565('0x41')]=_[_0xf565('0x42')](_0x268de1['query']);_0x18d452['filters']=_['intersection'](_0x18d452[_0xf565('0x45')],_0x18d452['query']);_0x2dad08[_0xf565('0x47')]=_[_0xf565('0x44')](_0x18d452[_0xf565('0x45')],qs[_0xf565('0x46')](_0x268de1[_0xf565('0x41')][_0xf565('0x46')]));_0x2dad08[_0xf565('0x47')]=_0x2dad08[_0xf565('0x47')][_0xf565('0x48')]?_0x2dad08[_0xf565('0x47')]:_0x18d452[_0xf565('0x45')];if(!_0x268de1[_0xf565('0x41')][_0xf565('0x49')]('nolimit')){_0x2dad08[_0xf565('0x2d')]=qs[_0xf565('0x2d')](_0x268de1[_0xf565('0x41')]['limit']);_0x2dad08['offset']=qs['offset'](_0x268de1['query'][_0xf565('0x2b')]);}_0x2dad08[_0xf565('0x4a')]=qs[_0xf565('0x4b')](_0x268de1[_0xf565('0x41')][_0xf565('0x4b')]);_0x2dad08[_0xf565('0x4c')]=qs[_0xf565('0x43')](_['pick'](_0x268de1[_0xf565('0x41')],_0x18d452[_0xf565('0x43')]));_0x2dad08[_0xf565('0x4c')]['OpenchannelAccountId']=_0x48a69a['id'];if(_0x268de1['query']['filter']){_0x2dad08[_0xf565('0x4c')]=_[_0xf565('0x4e')](_0x2dad08[_0xf565('0x4c')],{'$or':_['map'](_0x2dad08[_0xf565('0x47')],function(_0x211aad){var _0x4947ca={};_0x4947ca[_0x211aad]={'$like':'%'+_0x268de1['query']['filter']+'%'};return _0x4947ca;})});}_0x2dad08=_['merge']({},_0x2dad08,_0x268de1[_0xf565('0x51')]);return db[_0xf565('0x8c')][_0xf565('0x2e')]({'where':_0x2dad08['where']})[_0xf565('0x1e')](function(_0x38317f){_0x3bb966[_0xf565('0x2e')]=_0x38317f;if(_0x268de1[_0xf565('0x41')][_0xf565('0x52')]){_0x2dad08[_0xf565('0x53')]=[{'model':db[_0xf565('0x6d')],'as':_0xf565('0xaf'),'required':![]},{'model':db[_0xf565('0x97')],'as':'Owner','attributes':[_0xf565('0x38'),_0xf565('0xb0'),_0xf565('0xb1')],'required':![]},{'model':db['Tag'],'as':_0xf565('0xb2'),'attributes':['id','name','color'],'where':_0x268de1['query']['tag']?{'id':_0x268de1[_0xf565('0x41')][_0xf565('0xb3')]}:undefined,'required':_0x268de1[_0xf565('0x41')][_0xf565('0xb3')]?!![]:![]}];}return db[_0xf565('0x8c')][_0xf565('0x54')](_0x2dad08);})[_0xf565('0x1e')](function(_0x47d80d){_0x3bb966[_0xf565('0x55')]=_0x47d80d;return _0x3bb966;});}})[_0xf565('0x1e')](respondWithFilteredResult(_0x39f3ff,_0x2dad08))[_0xf565('0x56')](handleError(_0x39f3ff,null));};exports['addAgents']=function(_0x42d319,_0x494258,_0x20209f){return db['OpenchannelAccount'][_0xf565('0x59')]({'where':{'id':_0x42d319['params']['id']}})[_0xf565('0x1e')](handleEntityNotFound(_0x494258,null))[_0xf565('0x1e')](function(_0x5516f9){if(_0x5516f9){return _0x5516f9[_0xf565('0xb4')](_0x42d319[_0xf565('0x5b')]['ids'],_[_0xf565('0xb5')](_0x42d319[_0xf565('0x5b')],[_0xf565('0x6b'),'id'])||{})['spread'](function(_0x31975a){for(var _0x59db81=0x0;_0x59db81<_0x42d319['body'][_0xf565('0x6b')][_0xf565('0x48')];_0x59db81+=0x1){socket[_0xf565('0xb6')](_0xf565('0xb7'),{'UserId':Number(_0x42d319[_0xf565('0x5b')][_0xf565('0x6b')][_0x59db81]),'OpenchannelAccountId':Number(_0x42d319[_0xf565('0x60')]['id'])});}return _0x31975a;});}})[_0xf565('0x1e')](respondWithResult(_0x494258,null))[_0xf565('0x56')](handleError(_0x494258,null));};exports['removeAgents']=function(_0x393c0c,_0x1ad933,_0x1d4ea3){return db['OpenchannelAccount'][_0xf565('0x59')]({'where':{'id':_0x393c0c['params']['id']}})[_0xf565('0x1e')](handleEntityNotFound(_0x1ad933,null))['then'](function(_0x214db5){if(_0x214db5){return _0x214db5[_0xf565('0xb8')](_0x393c0c['query'][_0xf565('0x6b')])[_0xf565('0x1e')](function(){if(_['isArray'](_0x393c0c['query'][_0xf565('0x6b')])){for(var _0x57d268=0x0;_0x57d268<_0x393c0c[_0xf565('0x41')][_0xf565('0x6b')][_0xf565('0x48')];_0x57d268+=0x1){socket[_0xf565('0xb6')]('userOpenchannelAccount:remove',{'UserId':Number(_0x393c0c[_0xf565('0x41')][_0xf565('0x6b')][_0x57d268]),'OpenchannelAccountId':Number(_0x393c0c[_0xf565('0x60')]['id'])});}}else{socket[_0xf565('0xb6')]('userOpenchannelAccount:remove',{'UserId':Number(_0x393c0c[_0xf565('0x41')][_0xf565('0x6b')]),'OpenchannelAccountId':Number(_0x393c0c[_0xf565('0x60')]['id'])});}});}})[_0xf565('0x1e')](respondWithStatusCode(_0x1ad933,null))[_0xf565('0x56')](handleError(_0x1ad933,null));};exports[_0xf565('0xb9')]=function(_0xe5d2fb,_0x128936,_0xfec316){var _0x4eadf6={};var _0x2eea01={};var _0x29974f;var _0x21f3bd;return db[_0xf565('0x3b')][_0xf565('0x64')]({'where':{'id':_0xe5d2fb[_0xf565('0x60')]['id']}})['then'](handleEntityNotFound(_0x128936,null))[_0xf565('0x1e')](function(_0x93edea){if(_0x93edea){_0x29974f=_0x93edea;_0x2eea01['model']=_[_0xf565('0x42')](db['User'][_0xf565('0x3c')]);_0x2eea01[_0xf565('0x41')]=_[_0xf565('0x42')](_0xe5d2fb[_0xf565('0x41')]);_0x2eea01[_0xf565('0x43')]=_[_0xf565('0x44')](_0x2eea01['model'],_0x2eea01['query']);_0x4eadf6[_0xf565('0x47')]=_[_0xf565('0x44')](_0x2eea01[_0xf565('0x45')],qs[_0xf565('0x46')](_0xe5d2fb[_0xf565('0x41')][_0xf565('0x46')]));_0x4eadf6['attributes']=_0x4eadf6[_0xf565('0x47')][_0xf565('0x48')]?_0x4eadf6[_0xf565('0x47')]:_0x2eea01[_0xf565('0x45')];_0x4eadf6['order']=qs[_0xf565('0x4b')](_0xe5d2fb['query'][_0xf565('0x4b')]);_0x4eadf6[_0xf565('0x4c')]=qs[_0xf565('0x43')](_[_0xf565('0x4d')](_0xe5d2fb[_0xf565('0x41')],_0x2eea01[_0xf565('0x43')]));if(_0xe5d2fb[_0xf565('0x41')][_0xf565('0x50')]){_0x4eadf6[_0xf565('0x4c')]=_[_0xf565('0x4e')](_0x4eadf6[_0xf565('0x4c')],{'$or':_[_0xf565('0x40')](_0x4eadf6['attributes'],function(_0x25b35c){var _0x12479e={};_0x12479e[_0x25b35c]={'$like':'%'+_0xe5d2fb[_0xf565('0x41')][_0xf565('0x50')]+'%'};return _0x12479e;})});}_0x4eadf6=_[_0xf565('0x4e')]({},_0x4eadf6,_0xe5d2fb['options']);return _0x29974f[_0xf565('0xb9')](_0x4eadf6);}})[_0xf565('0x1e')](function(_0xa3ed8f){if(_0xa3ed8f){_0x21f3bd=_0xa3ed8f[_0xf565('0x48')];if(!_0xe5d2fb[_0xf565('0x41')][_0xf565('0x49')](_0xf565('0x65'))){_0x4eadf6['limit']=qs[_0xf565('0x2d')](_0xe5d2fb[_0xf565('0x41')]['limit']);_0x4eadf6[_0xf565('0x2b')]=qs[_0xf565('0x2b')](_0xe5d2fb[_0xf565('0x41')][_0xf565('0x2b')]);}return _0x29974f[_0xf565('0xb9')](_0x4eadf6);}})[_0xf565('0x1e')](function(_0x3f9cfe){if(_0x3f9cfe){return _0x3f9cfe?{'count':_0x21f3bd,'rows':_0x3f9cfe}:null;}})['then'](respondWithResult(_0x128936,null))['catch'](handleError(_0x128936,null));};exports[_0xf565('0xac')]=function(_0x10fe26,_0x159708,_0x148a1b){var _0x501486,_0x3344ee,_0x45ee12;if(_['isNil'](_0x10fe26[_0xf565('0x5b')][_0xf565('0x5b')])||_0x10fe26['body']['body']===''){throw new db['Sequelize'][(_0xf565('0x6e'))](_0xf565('0x78'));}if(_['isNil'](_0x10fe26[_0xf565('0x5b')]['to'])){}_0x501486=_0x10fe26[_0xf565('0x5b')]['to'];return db[_0xf565('0x3b')][_0xf565('0x64')]({'where':{'id':_0x10fe26['params']['id']}})[_0xf565('0x1e')](handleEntityNotFound(_0x159708,null))['then'](function(_0x2da1c2){if(_0x2da1c2){return db[_0xf565('0x3b')]['find']({'where':{'id':_0x2da1c2['id']},'include':[{'model':db[_0xf565('0x7c')],'as':_0xf565('0x7d'),'include':[{'model':db['CmContact'],'as':_0xf565('0x7e'),'where':{[_0x2da1c2[_0xf565('0x79')]]:_0x501486},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})[_0xf565('0x1e')](handleEntityNotFound(_0x159708,null))[_0xf565('0x1e')](function(_0x5e5651){if(_0x5e5651&&_0x5e5651[_0xf565('0x7d')]){_0x3344ee=_0x5e5651[_0xf565('0x35')]({'plain':!![]});if(_0x3344ee['List']&&_0x3344ee[_0xf565('0x7d')]['Contacts']['length']){return _0x3344ee[_0xf565('0x7d')]['Contacts'][0x0];}return db[_0xf565('0x6d')][_0xf565('0x5a')](_[_0xf565('0x17')](_0x10fe26[_0xf565('0x5b')],{'firstName':_0x501486,[_0x5e5651[_0xf565('0x79')]]:_0x501486,'phone':_0x501486,'ListId':_0x3344ee[_0xf565('0x73')]}));}})[_0xf565('0x1e')](handleEntityNotFound(_0x159708,null))[_0xf565('0x1e')](function(_0x1e997f){if(_0x1e997f){_0x45ee12=_0x1e997f;return db['OpenchannelInteraction']['find']({'where':{'ContactId':_0x45ee12['id'],'closed':![],'OpenchannelAccountId':_0x3344ee['id']}})[_0xf565('0x1e')](function(_0x12214d){if(_0x12214d){return[_0x12214d,![]];}return db[_0xf565('0x8c')][_0xf565('0x5a')]({'UserId':_0x10fe26['user']['id'],'ContactId':_0x45ee12['id'],'OpenchannelAccountId':_0x3344ee['id'],'lastMsgDirection':'out','firstMsgDirection':_0xf565('0xba'),'Messages':[_['merge'](_0x10fe26[_0xf565('0x5b')],{'read':![],'body':_0x10fe26[_0xf565('0x5b')][_0xf565('0x5b')],'OpenchannelAccountId':_0x3344ee['id'],'UserId':_0x10fe26[_0xf565('0x5c')]['id'],'ContactId':_0x45ee12['id']})]},{'include':[{'model':db[_0xf565('0x95')],'as':'Messages'}]})[_0xf565('0x1e')](function(_0x4b12f1){return[_0x4b12f1,!![]];});});}})[_0xf565('0x8e')](function(_0x3e8774,_0x306881){if(_0x306881){return _0x3e8774;}return db[_0xf565('0x95')][_0xf565('0x5a')](_[_0xf565('0x4e')](_0x10fe26[_0xf565('0x5b')],{'read':![],'body':_0x10fe26[_0xf565('0x5b')]['body'],'OpenchannelAccountId':_0x3344ee['id'],'OpenchannelInteractionId':_0x3e8774['id'],'UserId':_0x10fe26[_0xf565('0x5c')]['id'],'ContactId':_0x45ee12['id']}))[_0xf565('0x1e')](function(_0x339823){_0x3e8774[_0xf565('0xbb')][_0xf565('0xbc')]=[];_0x3e8774['dataValues'][_0xf565('0xbc')]['push'](_0x339823['dataValues']);return _0x3e8774;});});}})[_0xf565('0x1e')](respondWithResult(_0x159708,null))['catch'](handleError(_0x159708,null));}; \ No newline at end of file +var _0xf0b0=['Messages','push','dataValues','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/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','get','UserProfileResource','destroy','name','index','Pause','map','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','options','include','findAll','catch','mandatoryDispositionPause','keys','rawAttributes','OpenchannelAccount','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','OpenchannelAccounts','UserProfileSection','find','update','params','body','describe','addDisposition','OpenchannelAccountId','getDispositions','Disposition','filter','includeAll','rows','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','openchannel','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','difference','updatedAt','CompanyId','isNil','from','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','Applications','List','applications','list','orderBy','account','ListId','CmContact','firstName','threadId','OpenchannelInteraction','externalUrl','spread','contact','lastName','messageId','interaction','created','autoclose','close','unmanaged','OpenchannelMessage','AttachmentId','UserId','User','unshift','*,*,*,*','queueId','OpenchannelQueue','queue','waitForTheAssignedQueue','Start','EventManager','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','OpenchannelApplication','bulkCreate','priority','stack','finally','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','tag','addAgents','omit','userOpenchannelAccount:save','removeAgents','isArray','emit','userOpenchannelAccount:remove','getAgents','send','body\x20is\x20mandatory\x20and\x20not\x20empty','DESC','out'];(function(_0x131d75,_0x5dabc5){var _0x1f8083=function(_0x4b6e78){while(--_0x4b6e78){_0x131d75['push'](_0x131d75['shift']());}};_0x1f8083(++_0x5dabc5);}(_0xf0b0,0xc8));var _0x0f0b=function(_0xbddf0e,_0x1dbc49){_0xbddf0e=_0xbddf0e-0x0;var _0x3bc80e=_0xf0b0[_0xbddf0e];return _0x3bc80e;};'use strict';var emlformat=require(_0x0f0b('0x0'));var rimraf=require(_0x0f0b('0x1'));var zipdir=require(_0x0f0b('0x2'));var jsonpatch=require(_0x0f0b('0x3'));var rp=require(_0x0f0b('0x4'));var moment=require(_0x0f0b('0x5'));var BPromise=require(_0x0f0b('0x6'));var Mustache=require(_0x0f0b('0x7'));var util=require(_0x0f0b('0x8'));var path=require('path');var sox=require(_0x0f0b('0x9'));var csv=require('to-csv');var ejs=require(_0x0f0b('0xa'));var fs=require('fs');var fs_extra=require(_0x0f0b('0xb'));var _=require(_0x0f0b('0xc'));var squel=require(_0x0f0b('0xd'));var crypto=require(_0x0f0b('0xe'));var jsforce=require(_0x0f0b('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x0f0b('0x10'));var querystring=require(_0x0f0b('0x11'));var Papa=require(_0x0f0b('0x12'));var Redis=require(_0x0f0b('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x0f0b('0x14'));var as=require(_0x0f0b('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x0f0b('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x0f0b('0x17'));var db=require(_0x0f0b('0x18'))['db'];config['redis']=_[_0x0f0b('0x19')](config[_0x0f0b('0x1a')],{'host':_0x0f0b('0x1b'),'port':0x18eb});var socket=require(_0x0f0b('0x1c'))(new Redis(config[_0x0f0b('0x1a')]));require(_0x0f0b('0x1d'))[_0x0f0b('0x1e')](socket);var jayson=require(_0x0f0b('0x1f'));var client=jayson[_0x0f0b('0x20')][_0x0f0b('0x21')]({'port':0x232c});var client9002=jayson[_0x0f0b('0x20')][_0x0f0b('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x1b83e8,_0x45fd81,_0x5715e5,_0x145f49){return new BPromise(function(_0x2c406d,_0x98d74){var _0x27412f=_0x145f49||client;return _0x27412f[_0x0f0b('0x22')](_0x1b83e8,_0x5715e5)[_0x0f0b('0x23')](function(_0x36be02){logger[_0x0f0b('0x24')](_0x0f0b('0x25'),_0x45fd81,'request\x20sent');logger[_0x0f0b('0x26')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x45fd81,_0x0f0b('0x27'),JSON[_0x0f0b('0x28')](_0x36be02));if(_0x36be02[_0x0f0b('0x29')]){if(_0x36be02[_0x0f0b('0x29')][_0x0f0b('0x2a')]===0x1f4){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x45fd81,_0x36be02[_0x0f0b('0x29')]['message']);return _0x98d74(_0x36be02['error']['message']);}logger[_0x0f0b('0x29')](_0x0f0b('0x25'),_0x45fd81,_0x36be02[_0x0f0b('0x29')][_0x0f0b('0x2b')]);return _0x2c406d(_0x36be02[_0x0f0b('0x29')][_0x0f0b('0x2b')]);}else{logger[_0x0f0b('0x24')](_0x0f0b('0x25'),_0x45fd81,_0x0f0b('0x27'));_0x2c406d(_0x36be02['result']['message']);}})['catch'](function(_0xe86660){logger[_0x0f0b('0x29')](_0x0f0b('0x25'),_0x45fd81,_0xe86660);_0x98d74(_0xe86660);});});}function respondWithStatusCode(_0x34aad7,_0x188d53){_0x188d53=_0x188d53||0xcc;return function(_0x5c6883){if(_0x5c6883){return _0x34aad7['sendStatus'](_0x188d53);}return _0x34aad7[_0x0f0b('0x2c')](_0x188d53)[_0x0f0b('0x2d')]();};}function respondWithResult(_0x20841e,_0x46b9a7){_0x46b9a7=_0x46b9a7||0xc8;return function(_0x4dd3c1){if(_0x4dd3c1){return _0x20841e[_0x0f0b('0x2c')](_0x46b9a7)[_0x0f0b('0x2e')](_0x4dd3c1);}};}function respondWithFilteredResult(_0x2b6409,_0x280f69){return function(_0x75cc84){if(_0x75cc84){var _0x3ccbb7=typeof _0x280f69[_0x0f0b('0x2f')]===_0x0f0b('0x30')&&typeof _0x280f69[_0x0f0b('0x31')]===_0x0f0b('0x30');var _0x51203e=_0x75cc84['count'];var _0x12967e=_0x3ccbb7?0x0:_0x280f69[_0x0f0b('0x2f')];var _0x334713=_0x3ccbb7?_0x75cc84[_0x0f0b('0x32')]:_0x280f69[_0x0f0b('0x2f')]+_0x280f69['limit'];var _0x14e6e6;if(_0x334713>=_0x51203e){_0x334713=_0x51203e;_0x14e6e6=0xc8;}else{_0x14e6e6=0xce;}_0x2b6409['status'](_0x14e6e6);return _0x2b6409[_0x0f0b('0x33')](_0x0f0b('0x34'),_0x12967e+'-'+_0x334713+'/'+_0x51203e)[_0x0f0b('0x2e')](_0x75cc84);}return null;};}function patchUpdates(_0x3c99a3){return function(_0x2a18cc){try{jsonpatch['apply'](_0x2a18cc,_0x3c99a3,!![]);}catch(_0x2c77fb){return BPromise[_0x0f0b('0x35')](_0x2c77fb);}return _0x2a18cc[_0x0f0b('0x36')]();};}function saveUpdates(_0x3c5ff4,_0x5a4d76){return function(_0x4529c4){if(_0x4529c4){return _0x4529c4['update'](_0x3c5ff4)[_0x0f0b('0x23')](function(_0x4545d4){return _0x4545d4;});}return null;};}function removeEntity(_0x11fcc1,_0x5abe5c){return function(_0x1c68d7){if(_0x1c68d7){return _0x1c68d7['destroy']()[_0x0f0b('0x23')](function(){var _0x5962fa=_0x1c68d7[_0x0f0b('0x37')]({'plain':!![]});var _0x3d2da9='OpenchannelAccounts';return db[_0x0f0b('0x38')][_0x0f0b('0x39')]({'where':{'type':_0x3d2da9,'resourceId':_0x5962fa['id']}})[_0x0f0b('0x23')](function(){return _0x1c68d7;});})[_0x0f0b('0x23')](function(){_0x11fcc1[_0x0f0b('0x2c')](0xcc)[_0x0f0b('0x2d')]();});}};}function handleEntityNotFound(_0x5551e2,_0xfd79ff){return function(_0x1cd977){if(!_0x1cd977){_0x5551e2['sendStatus'](0x194);}return _0x1cd977;};}function handleError(_0x39efdd,_0x1de213){_0x1de213=_0x1de213||0x1f4;return function(_0x2a61e7){logger[_0x0f0b('0x29')](_0x2a61e7['stack']);if(_0x2a61e7[_0x0f0b('0x3a')]){delete _0x2a61e7[_0x0f0b('0x3a')];}_0x39efdd[_0x0f0b('0x2c')](_0x1de213)['send'](_0x2a61e7);};}exports[_0x0f0b('0x3b')]=function(_0x4fed7f,_0x118d5e){var _0x1fbdf1={'include':[{'model':db[_0x0f0b('0x3c')],'as':'mandatoryDispositionPause'}]},_0x5052a0={},_0x3239cb={'count':0x0,'rows':[]};var _0x3c591a=_[_0x0f0b('0x3d')](db['OpenchannelAccount']['rawAttributes'],function(_0x25137c){return{'name':_0x25137c[_0x0f0b('0x3e')],'type':_0x25137c[_0x0f0b('0x3f')][_0x0f0b('0x40')]};});_0x5052a0[_0x0f0b('0x41')]=_[_0x0f0b('0x3d')](_0x3c591a,_0x0f0b('0x3a'));_0x5052a0[_0x0f0b('0x42')]=_['keys'](_0x4fed7f['query']);_0x5052a0[_0x0f0b('0x43')]=_[_0x0f0b('0x44')](_0x5052a0[_0x0f0b('0x41')],_0x5052a0[_0x0f0b('0x42')]);_0x1fbdf1[_0x0f0b('0x45')]=_['intersection'](_0x5052a0[_0x0f0b('0x41')],qs[_0x0f0b('0x46')](_0x4fed7f[_0x0f0b('0x42')][_0x0f0b('0x46')]));_0x1fbdf1[_0x0f0b('0x45')]=_0x1fbdf1['attributes'][_0x0f0b('0x47')]?_0x1fbdf1[_0x0f0b('0x45')]:_0x5052a0[_0x0f0b('0x41')];if(!_0x4fed7f[_0x0f0b('0x42')][_0x0f0b('0x48')](_0x0f0b('0x49'))){_0x1fbdf1['limit']=qs[_0x0f0b('0x31')](_0x4fed7f[_0x0f0b('0x42')][_0x0f0b('0x31')]);_0x1fbdf1['offset']=qs[_0x0f0b('0x2f')](_0x4fed7f[_0x0f0b('0x42')]['offset']);}_0x1fbdf1[_0x0f0b('0x4a')]=qs[_0x0f0b('0x4b')](_0x4fed7f['query'][_0x0f0b('0x4b')]);_0x1fbdf1['where']=qs[_0x0f0b('0x43')](_[_0x0f0b('0x4c')](_0x4fed7f[_0x0f0b('0x42')],_0x5052a0[_0x0f0b('0x43')]),_0x3c591a);if(_0x4fed7f[_0x0f0b('0x42')]['filter']){_0x1fbdf1[_0x0f0b('0x4d')]=_[_0x0f0b('0x4e')](_0x1fbdf1[_0x0f0b('0x4d')],{'$or':_[_0x0f0b('0x3d')](_0x3c591a,function(_0x1c18c2){if(_0x1c18c2['type']!==_0x0f0b('0x4f')){var _0xb0385a={};_0xb0385a[_0x1c18c2['name']]={'$like':'%'+_0x4fed7f[_0x0f0b('0x42')]['filter']+'%'};return _0xb0385a;}})});}_0x1fbdf1=_[_0x0f0b('0x4e')]({},_0x1fbdf1,_0x4fed7f[_0x0f0b('0x50')]);var _0x512259={'where':_0x1fbdf1[_0x0f0b('0x4d')]};return db['OpenchannelAccount'][_0x0f0b('0x32')](_0x512259)[_0x0f0b('0x23')](function(_0x3db982){_0x3239cb[_0x0f0b('0x32')]=_0x3db982;if(_0x4fed7f[_0x0f0b('0x42')]['includeAll']){_0x1fbdf1[_0x0f0b('0x51')]=[{'all':!![]}];}return db['OpenchannelAccount'][_0x0f0b('0x52')](_0x1fbdf1);})[_0x0f0b('0x23')](function(_0xa2ec3a){_0x3239cb['rows']=_0xa2ec3a;return _0x3239cb;})[_0x0f0b('0x23')](respondWithFilteredResult(_0x118d5e,_0x1fbdf1))[_0x0f0b('0x53')](handleError(_0x118d5e,null));};exports['show']=function(_0x223f06,_0x7fa8c8){var _0xf8ca4={'raw':![],'where':{'id':_0x223f06['params']['id']},'include':[{'model':db['Pause'],'as':_0x0f0b('0x54')}]},_0x24ce89={};_0x24ce89[_0x0f0b('0x41')]=_[_0x0f0b('0x55')](db['OpenchannelAccount'][_0x0f0b('0x56')]);_0x24ce89[_0x0f0b('0x42')]=_[_0x0f0b('0x55')](_0x223f06['query']);_0x24ce89[_0x0f0b('0x43')]=_[_0x0f0b('0x44')](_0x24ce89[_0x0f0b('0x41')],_0x24ce89['query']);_0xf8ca4[_0x0f0b('0x45')]=_['intersection'](_0x24ce89[_0x0f0b('0x41')],qs['fields'](_0x223f06[_0x0f0b('0x42')][_0x0f0b('0x46')]));_0xf8ca4[_0x0f0b('0x45')]=_0xf8ca4[_0x0f0b('0x45')]['length']?_0xf8ca4[_0x0f0b('0x45')]:_0x24ce89[_0x0f0b('0x41')];if(_0x223f06['query']['includeAll']){_0xf8ca4[_0x0f0b('0x51')]=[{'all':!![]}];}_0xf8ca4=_[_0x0f0b('0x4e')]({},_0xf8ca4,_0x223f06['options']);return db[_0x0f0b('0x57')]['find'](_0xf8ca4)[_0x0f0b('0x23')](handleEntityNotFound(_0x7fa8c8,null))[_0x0f0b('0x23')](respondWithResult(_0x7fa8c8,null))[_0x0f0b('0x53')](handleError(_0x7fa8c8,null));};exports[_0x0f0b('0x58')]=function(_0x5ff9c6,_0x3750de){return db[_0x0f0b('0x57')]['create'](_0x5ff9c6['body'],{})['then'](function(_0xd1eaf5){var _0x271632=_0x5ff9c6[_0x0f0b('0x59')][_0x0f0b('0x37')]({'plain':!![]});if(!_0x271632)throw new Error(_0x0f0b('0x5a'));if(_0x271632['role']==='user'){var _0x56d3fd=_0xd1eaf5[_0x0f0b('0x37')]({'plain':!![]});var _0x3358db=_0x0f0b('0x5b');return db[_0x0f0b('0x5c')][_0x0f0b('0x5d')]({'where':{'name':_0x3358db,'userProfileId':_0x271632['userProfileId']},'raw':!![]})[_0x0f0b('0x23')](function(_0x1ffe9f){if(_0x1ffe9f&&_0x1ffe9f['autoAssociation']===0x0){return db[_0x0f0b('0x38')][_0x0f0b('0x58')]({'name':_0x56d3fd[_0x0f0b('0x3a')],'resourceId':_0x56d3fd['id'],'type':_0x1ffe9f[_0x0f0b('0x3a')],'sectionId':_0x1ffe9f['id']},{})[_0x0f0b('0x23')](function(){return _0xd1eaf5;});}else{return _0xd1eaf5;}})[_0x0f0b('0x53')](function(_0x4c41ee){logger[_0x0f0b('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4c41ee);throw _0x4c41ee;});}return _0xd1eaf5;})['then'](respondWithResult(_0x3750de,0xc9))[_0x0f0b('0x53')](handleError(_0x3750de,null));};exports[_0x0f0b('0x5e')]=function(_0x118f3a,_0x22109b){if(_0x118f3a['body']['id']){delete _0x118f3a['body']['id'];}return db[_0x0f0b('0x57')][_0x0f0b('0x5d')]({'where':{'id':_0x118f3a[_0x0f0b('0x5f')]['id']},'include':[{'model':db[_0x0f0b('0x3c')],'as':'mandatoryDispositionPause'}]})[_0x0f0b('0x23')](handleEntityNotFound(_0x22109b,null))[_0x0f0b('0x23')](saveUpdates(_0x118f3a[_0x0f0b('0x60')],null))[_0x0f0b('0x23')](respondWithResult(_0x22109b,null))[_0x0f0b('0x53')](handleError(_0x22109b,null));};exports[_0x0f0b('0x39')]=function(_0x51a8c3,_0x761049){return db[_0x0f0b('0x57')]['find']({'where':{'id':_0x51a8c3[_0x0f0b('0x5f')]['id']}})[_0x0f0b('0x23')](handleEntityNotFound(_0x761049,null))[_0x0f0b('0x23')](removeEntity(_0x761049,null))['catch'](handleError(_0x761049,null));};exports[_0x0f0b('0x61')]=function(_0x3bd42,_0x103781){return db[_0x0f0b('0x57')][_0x0f0b('0x61')]()[_0x0f0b('0x23')](respondWithResult(_0x103781,null))[_0x0f0b('0x53')](handleError(_0x103781,null));};exports[_0x0f0b('0x62')]=function(_0xf2de80,_0x1c5c81,_0x35d103){if(_0xf2de80[_0x0f0b('0x60')]['id']){delete _0xf2de80[_0x0f0b('0x60')]['id'];}return db['OpenchannelAccount'][_0x0f0b('0x5d')]({'where':{'id':_0xf2de80[_0x0f0b('0x5f')]['id']}})[_0x0f0b('0x23')](handleEntityNotFound(_0x1c5c81,null))['then'](function(_0x45e1bd){if(_0x45e1bd){_0xf2de80['body'][_0x0f0b('0x63')]=_0x45e1bd['id'];return db['Disposition'][_0x0f0b('0x58')](_0xf2de80[_0x0f0b('0x60')]);}})[_0x0f0b('0x23')](respondWithResult(_0x1c5c81,null))[_0x0f0b('0x53')](handleError(_0x1c5c81,null));};exports[_0x0f0b('0x64')]=function(_0x107a74,_0x2bc260,_0x3caf07){var _0x9be343={'raw':![],'where':{}};var _0x2dec79={};var _0x230c9a={'count':0x0,'rows':[]};return db[_0x0f0b('0x57')]['findOne']({'where':{'id':_0x107a74[_0x0f0b('0x5f')]['id']}})[_0x0f0b('0x23')](handleEntityNotFound(_0x2bc260,null))[_0x0f0b('0x23')](function(_0x415f9b){if(_0x415f9b){_0x2dec79[_0x0f0b('0x41')]=_['keys'](db[_0x0f0b('0x65')][_0x0f0b('0x56')]);_0x2dec79[_0x0f0b('0x42')]=_[_0x0f0b('0x55')](_0x107a74[_0x0f0b('0x42')]);_0x2dec79[_0x0f0b('0x43')]=_[_0x0f0b('0x44')](_0x2dec79['model'],_0x2dec79['query']);_0x9be343[_0x0f0b('0x45')]=_[_0x0f0b('0x44')](_0x2dec79[_0x0f0b('0x41')],qs[_0x0f0b('0x46')](_0x107a74[_0x0f0b('0x42')][_0x0f0b('0x46')]));_0x9be343[_0x0f0b('0x45')]=_0x9be343[_0x0f0b('0x45')]['length']?_0x9be343[_0x0f0b('0x45')]:_0x2dec79['model'];if(!_0x107a74[_0x0f0b('0x42')][_0x0f0b('0x48')](_0x0f0b('0x49'))){_0x9be343[_0x0f0b('0x31')]=qs['limit'](_0x107a74['query']['limit']);_0x9be343['offset']=qs[_0x0f0b('0x2f')](_0x107a74[_0x0f0b('0x42')][_0x0f0b('0x2f')]);}_0x9be343['order']=qs[_0x0f0b('0x4b')](_0x107a74[_0x0f0b('0x42')][_0x0f0b('0x4b')]);_0x9be343[_0x0f0b('0x4d')]=qs[_0x0f0b('0x43')](_['pick'](_0x107a74[_0x0f0b('0x42')],_0x2dec79['filters']));_0x9be343[_0x0f0b('0x4d')][_0x0f0b('0x63')]=_0x415f9b['id'];if(_0x107a74[_0x0f0b('0x42')][_0x0f0b('0x66')]){_0x9be343['where']=_[_0x0f0b('0x4e')](_0x9be343[_0x0f0b('0x4d')],{'$or':_[_0x0f0b('0x3d')](_0x9be343[_0x0f0b('0x45')],function(_0x350fda){var _0x3bfbd3={};_0x3bfbd3[_0x350fda]={'$like':'%'+_0x107a74[_0x0f0b('0x42')]['filter']+'%'};return _0x3bfbd3;})});}_0x9be343=_[_0x0f0b('0x4e')]({},_0x9be343,_0x107a74['options']);return db['Disposition']['count']({'where':_0x9be343[_0x0f0b('0x4d')]})[_0x0f0b('0x23')](function(_0x4a7af4){_0x230c9a[_0x0f0b('0x32')]=_0x4a7af4;if(_0x107a74[_0x0f0b('0x42')][_0x0f0b('0x67')]){_0x9be343[_0x0f0b('0x51')]=[{'all':!![]}];}return db[_0x0f0b('0x65')]['findAll'](_0x9be343);})[_0x0f0b('0x23')](function(_0x417ef4){_0x230c9a[_0x0f0b('0x68')]=_0x417ef4;return _0x230c9a;});}})[_0x0f0b('0x23')](respondWithFilteredResult(_0x2bc260,_0x9be343))[_0x0f0b('0x53')](handleError(_0x2bc260,null));};exports[_0x0f0b('0x69')]=function(_0xe26176,_0x2d9edd,_0x1fa2fc){return db['OpenchannelAccount'][_0x0f0b('0x5d')]({'where':{'id':_0xe26176[_0x0f0b('0x5f')]['id']}})[_0x0f0b('0x23')](handleEntityNotFound(_0x2d9edd,null))[_0x0f0b('0x23')](function(_0x50d9e7){if(_0x50d9e7){return _0x50d9e7[_0x0f0b('0x69')](_0xe26176[_0x0f0b('0x42')][_0x0f0b('0x6a')]);}})[_0x0f0b('0x23')](respondWithStatusCode(_0x2d9edd,null))[_0x0f0b('0x53')](handleError(_0x2d9edd,null));};exports[_0x0f0b('0x6b')]=function(_0x5f18c2,_0x1046e3,_0x55168c){if(_0x5f18c2[_0x0f0b('0x60')]['id']){delete _0x5f18c2['body']['id'];}return db[_0x0f0b('0x57')]['find']({'where':{'id':_0x5f18c2['params']['id']}})[_0x0f0b('0x23')](handleEntityNotFound(_0x1046e3,null))[_0x0f0b('0x23')](function(_0x4814ab){if(_0x4814ab){_0x5f18c2[_0x0f0b('0x60')][_0x0f0b('0x63')]=_0x4814ab['id'];return db['CannedAnswer']['create'](_0x5f18c2[_0x0f0b('0x60')]);}})[_0x0f0b('0x23')](respondWithResult(_0x1046e3,null))['catch'](handleError(_0x1046e3,null));};exports[_0x0f0b('0x6c')]=function(_0x4dec98,_0x45d4e9,_0x4710d5){var _0x3c075b={'raw':![],'where':{}};var _0x3cae3d={};var _0x1dabd7={'count':0x0,'rows':[]};return db[_0x0f0b('0x57')]['findOne']({'where':{'id':_0x4dec98[_0x0f0b('0x5f')]['id']}})['then'](handleEntityNotFound(_0x45d4e9,null))[_0x0f0b('0x23')](function(_0x477bbe){if(_0x477bbe){_0x3cae3d['model']=_[_0x0f0b('0x55')](db[_0x0f0b('0x6d')][_0x0f0b('0x56')]);_0x3cae3d[_0x0f0b('0x42')]=_['keys'](_0x4dec98[_0x0f0b('0x42')]);_0x3cae3d[_0x0f0b('0x43')]=_[_0x0f0b('0x44')](_0x3cae3d['model'],_0x3cae3d[_0x0f0b('0x42')]);_0x3c075b['attributes']=_['intersection'](_0x3cae3d[_0x0f0b('0x41')],qs['fields'](_0x4dec98[_0x0f0b('0x42')][_0x0f0b('0x46')]));_0x3c075b['attributes']=_0x3c075b[_0x0f0b('0x45')][_0x0f0b('0x47')]?_0x3c075b[_0x0f0b('0x45')]:_0x3cae3d[_0x0f0b('0x41')];if(!_0x4dec98[_0x0f0b('0x42')][_0x0f0b('0x48')](_0x0f0b('0x49'))){_0x3c075b['limit']=qs[_0x0f0b('0x31')](_0x4dec98[_0x0f0b('0x42')]['limit']);_0x3c075b[_0x0f0b('0x2f')]=qs[_0x0f0b('0x2f')](_0x4dec98[_0x0f0b('0x42')][_0x0f0b('0x2f')]);}_0x3c075b[_0x0f0b('0x4a')]=qs[_0x0f0b('0x4b')](_0x4dec98['query'][_0x0f0b('0x4b')]);_0x3c075b[_0x0f0b('0x4d')]=qs[_0x0f0b('0x43')](_[_0x0f0b('0x4c')](_0x4dec98[_0x0f0b('0x42')],_0x3cae3d['filters']));_0x3c075b['where']['OpenchannelAccountId']=_0x477bbe['id'];if(_0x4dec98[_0x0f0b('0x42')][_0x0f0b('0x66')]){_0x3c075b[_0x0f0b('0x4d')]=_[_0x0f0b('0x4e')](_0x3c075b[_0x0f0b('0x4d')],{'$or':_['map'](_0x3c075b[_0x0f0b('0x45')],function(_0x144b77){var _0x292375={};_0x292375[_0x144b77]={'$like':'%'+_0x4dec98[_0x0f0b('0x42')]['filter']+'%'};return _0x292375;})});}_0x3c075b=_['merge']({},_0x3c075b,_0x4dec98[_0x0f0b('0x50')]);return db[_0x0f0b('0x6d')][_0x0f0b('0x32')]({'where':_0x3c075b[_0x0f0b('0x4d')]})[_0x0f0b('0x23')](function(_0x24c067){_0x1dabd7[_0x0f0b('0x32')]=_0x24c067;if(_0x4dec98['query'][_0x0f0b('0x67')]){_0x3c075b[_0x0f0b('0x51')]=[{'all':!![]}];}return db[_0x0f0b('0x6d')][_0x0f0b('0x52')](_0x3c075b);})[_0x0f0b('0x23')](function(_0x46738a){_0x1dabd7[_0x0f0b('0x68')]=_0x46738a;return _0x1dabd7;});}})[_0x0f0b('0x23')](respondWithFilteredResult(_0x45d4e9,_0x3c075b))[_0x0f0b('0x53')](handleError(_0x45d4e9,null));};exports[_0x0f0b('0x6e')]=function(_0x5de1c7,_0x349df6,_0x467665){return db[_0x0f0b('0x57')][_0x0f0b('0x5d')]({'where':{'id':_0x5de1c7['params']['id']}})['then'](handleEntityNotFound(_0x349df6,null))['then'](function(_0x5465e4){if(_0x5465e4){return _0x5465e4[_0x0f0b('0x6e')](_0x5de1c7[_0x0f0b('0x42')][_0x0f0b('0x6a')]);}})[_0x0f0b('0x23')](respondWithStatusCode(_0x349df6,null))[_0x0f0b('0x53')](handleError(_0x349df6,null));};exports['notify']=function(_0xb0d7ad,_0x53e8ab,_0x303a1a){var _0x10d3e4={'body':_0xb0d7ad[_0x0f0b('0x60')],'channel':_0x0f0b('0x6f')};var _0x50986c=[];var _0x207b94=[];var _0x564828={};var _0x3d7149=![];return db['CmContact'][_0x0f0b('0x61')]()[_0x0f0b('0x23')](function(_0x2214b1){if(!_0x2214b1){throw new db[(_0x0f0b('0x70'))][(_0x0f0b('0x71'))](_0x0f0b('0x72'));}_0x50986c=_['difference'](_[_0x0f0b('0x55')](_0x2214b1),[_0x0f0b('0x73'),'updatedAt']);_0x207b94=_[_0x0f0b('0x74')](_['keys'](_0x2214b1),[_0x0f0b('0x73'),_0x0f0b('0x75'),_0x0f0b('0x76'),'ListId']);if(_0xb0d7ad[_0x0f0b('0x60')]['id']){delete _0xb0d7ad[_0x0f0b('0x60')]['id'];}if(_[_0x0f0b('0x77')](_0xb0d7ad[_0x0f0b('0x60')][_0x0f0b('0x78')])){throw new db[(_0x0f0b('0x70'))][(_0x0f0b('0x71'))](_0x0f0b('0x79'));}if(_[_0x0f0b('0x77')](_0xb0d7ad[_0x0f0b('0x60')][_0x0f0b('0x60')])||_0xb0d7ad['body'][_0x0f0b('0x60')]===''){throw new db['Sequelize'][(_0x0f0b('0x71'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x0f0b('0x77')](_0xb0d7ad[_0x0f0b('0x60')][_0x0f0b('0x7a')])){throw new db['Sequelize'][(_0x0f0b('0x71'))](_0x0f0b('0x7b')+_0x207b94);}if(!_[_0x0f0b('0x7c')](_0x207b94,_0xb0d7ad[_0x0f0b('0x60')]['mapKey'])){throw new db['Sequelize'][(_0x0f0b('0x71'))](_0x0f0b('0x7d')+_0x207b94);}_0x564828[_0xb0d7ad['body'][_0x0f0b('0x7a')]]=_0xb0d7ad[_0x0f0b('0x60')]['from'];})[_0x0f0b('0x23')](function(){return db['OpenchannelAccount'][_0x0f0b('0x5d')]({'where':{'id':_0xb0d7ad[_0x0f0b('0x5f')]['id']},'include':[{'model':db[_0x0f0b('0x7e')],'as':'List','include':[{'model':db['CmContact'],'as':_0x0f0b('0x7f'),'where':_0x564828,'limit':0x1,'order':[[_0x0f0b('0x75'),'DESC']]}]},{'model':db['OpenchannelApplication'],'as':_0x0f0b('0x80')}]});})['then'](handleEntityNotFound(_0x53e8ab,null))[_0x0f0b('0x23')](function(_0x51f690){if(_0x51f690&&_0x51f690[_0x0f0b('0x81')]){_0x10d3e4['account']=_0x51f690;_0x10d3e4[_0x0f0b('0x82')]=_0x51f690[_0x0f0b('0x80')];_0x10d3e4[_0x0f0b('0x83')]=_0x51f690[_0x0f0b('0x81')];_0x10d3e4['applications']=_[_0x0f0b('0x84')](_0x10d3e4[_0x0f0b('0x82')],['priority'],['asc']);if(_0x10d3e4['account']['Applications']){delete _0x10d3e4[_0x0f0b('0x85')][_0x0f0b('0x80')];}if(_0x10d3e4[_0x0f0b('0x85')][_0x0f0b('0x81')]&&_0x10d3e4[_0x0f0b('0x85')][_0x0f0b('0x81')]['Contacts'][_0x0f0b('0x47')]){return _0x10d3e4[_0x0f0b('0x85')]['List'][_0x0f0b('0x7f')][0x0];}var _0x457fed=_['defaults'](_0xb0d7ad[_0x0f0b('0x60')],{'firstName':_0xb0d7ad[_0x0f0b('0x60')][_0x0f0b('0x78')],'ListId':_0x51f690[_0x0f0b('0x86')]});_0x457fed[_0xb0d7ad['body']['mapKey']]=_0xb0d7ad[_0x0f0b('0x60')][_0x0f0b('0x78')];return db[_0x0f0b('0x87')][_0x0f0b('0x58')](_0x457fed,{'fields':_0x50986c,'raw':!![]});}})[_0x0f0b('0x23')](handleEntityNotFound(_0x53e8ab,null))[_0x0f0b('0x23')](function(_0x46720b){_0x10d3e4['contact']=_0x46720b;if(_0x46720b){var _0x3d985c={'ContactId':_0x46720b['id'],'OpenchannelAccountId':_0xb0d7ad['params']['id'],'from':(_0x46720b[_0x0f0b('0x88')]||'')+'\x20'+(_0x46720b['lastName']||'')};var _0x555290={'OpenchannelAccountId':_0xb0d7ad[_0x0f0b('0x5f')]['id'],'closed':![]};if(_0xb0d7ad[_0x0f0b('0x60')][_0x0f0b('0x89')]){_0x555290[_0x0f0b('0x89')]=_0xb0d7ad[_0x0f0b('0x60')][_0x0f0b('0x89')];return db[_0x0f0b('0x8a')]['find']({'where':_0x555290})[_0x0f0b('0x23')](function(_0x1d0a1a){if(_0x1d0a1a){return[_0x1d0a1a,![]];}_0x3d985c[_0x0f0b('0x89')]=_0xb0d7ad['body'][_0x0f0b('0x89')];_0x3d985c['externalUrl']=_0xb0d7ad[_0x0f0b('0x60')][_0x0f0b('0x8b')];return db['OpenchannelInteraction'][_0x0f0b('0x58')](_0x3d985c)[_0x0f0b('0x23')](function(_0x4c5c9a){return[_0x4c5c9a,!![]];});});}else{_0x555290['threadId']=null;}_0x555290['ContactId']=_0x46720b['id'];return db[_0x0f0b('0x8a')][_0x0f0b('0x5d')]({'where':_0x555290})[_0x0f0b('0x23')](function(_0x43cf0e){if(_0x43cf0e){return[_0x43cf0e,![]];}return db[_0x0f0b('0x8a')][_0x0f0b('0x58')](_0x3d985c)[_0x0f0b('0x23')](function(_0x1a9ea6){return[_0x1a9ea6,!![]];});});}})[_0x0f0b('0x8c')](function(_0x12c9e6,_0x7f2553){if(_0x12c9e6){_0x3d7149=_0x7f2553;if(!_0x7f2553){var _0x2cbeb3={'from':(_0x10d3e4[_0x0f0b('0x8d')][_0x0f0b('0x88')]||'')+'\x20'+(_0x10d3e4[_0x0f0b('0x8d')][_0x0f0b('0x8e')]||'')};if(_0xb0d7ad[_0x0f0b('0x60')]['threadId']&&_0xb0d7ad[_0x0f0b('0x60')][_0x0f0b('0x8f')]&&_0xb0d7ad[_0x0f0b('0x60')][_0x0f0b('0x89')]!=_0xb0d7ad['body']['messageId']){_0x2cbeb3['threadId']=_0xb0d7ad[_0x0f0b('0x60')]['messageId'];}return _0x12c9e6[_0x0f0b('0x5e')](_0x2cbeb3);}else{return _0x12c9e6;}}})[_0x0f0b('0x23')](function(_0x3cf0ca){_0x10d3e4['interaction']=_0x3cf0ca[_0x0f0b('0x37')]({'plain':!![]});_0x10d3e4[_0x0f0b('0x90')][_0x0f0b('0x91')]=_0x3d7149;if(_0x10d3e4['interaction'][_0x0f0b('0x91')]){if(_0x10d3e4['account'][_0x0f0b('0x92')]){_0x10d3e4[_0x0f0b('0x82')]['push']({'id':0x0,'priority':_0x10d3e4[_0x0f0b('0x82')][_0x0f0b('0x47')]+0x1,'app':_0x0f0b('0x93'),'appdata':_0x0f0b('0x94'),'interval':'*,*,*,*'});}}return db[_0x0f0b('0x95')][_0x0f0b('0x58')]({'body':_0xb0d7ad[_0x0f0b('0x60')]['body'],'OpenchannelAccountId':_0xb0d7ad[_0x0f0b('0x5f')]['id'],'OpenchannelInteractionId':_0x3cf0ca['id'],'direction':'in','ContactId':_0x10d3e4[_0x0f0b('0x8d')]['id'],'AttachmentId':_0xb0d7ad['body'][_0x0f0b('0x96')]});})[_0x0f0b('0x23')](function(_0x5ab208){_0x10d3e4['message']=_0x5ab208;if(!_0x10d3e4['interaction'][_0x0f0b('0x97')])return;return db[_0x0f0b('0x98')][_0x0f0b('0x5d')]({'attributes':['id',_0x0f0b('0x3a')],'where':{'id':_0x10d3e4[_0x0f0b('0x90')]['UserId']}});})['then'](function(_0x507827){if(_0x507827){_0x10d3e4['applications'][_0x0f0b('0x99')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x507827[_0x0f0b('0x3a')]+','+(_0x10d3e4['account']['waitForTheAssignedAgent']||0xa),'interval':_0x0f0b('0x9a')});}if(!_0x10d3e4['interaction'][_0x0f0b('0x9b')])return;return db[_0x0f0b('0x9c')][_0x0f0b('0x5d')]({'attributes':['id','name'],'where':{'id':_0x10d3e4[_0x0f0b('0x90')][_0x0f0b('0x9b')]}});})[_0x0f0b('0x23')](function(_0x334804){if(_0x334804){_0x10d3e4[_0x0f0b('0x82')]['unshift']({'id':0x0,'priority':0x1,'app':_0x0f0b('0x9d'),'appdata':_0x334804[_0x0f0b('0x3a')]+','+(_0x10d3e4[_0x0f0b('0x85')][_0x0f0b('0x9e')]||0x12c),'interval':_0x0f0b('0x9a')});}return respondWithRpcPromise(_0x0f0b('0x9f'),'startRouting',_0x10d3e4);})['then'](function(_0xc29a5c){respondWithRpcPromise(_0x0f0b('0xa0'),_0x0f0b('0xa0'),{'event':'notify','message':_0xc29a5c},client9002);return _0xc29a5c;})[_0x0f0b('0x23')](respondWithResult(_0x53e8ab,null))[_0x0f0b('0x53')](handleError(_0x53e8ab,null));};exports[_0x0f0b('0xa1')]=function(_0x35aa18,_0x12f2f9){var _0x3c81e5=_0x35aa18[_0x0f0b('0x5f')]['id'];var _0x427f8d=_0x35aa18['body'];var _0x61ed9f=0xc8;var _0x12ff24=null;return db[_0x0f0b('0xa2')][_0x0f0b('0xa3')]({'isolationLevel':db[_0x0f0b('0xa2')][_0x0f0b('0xa4')][_0x0f0b('0xa5')][_0x0f0b('0xa6')]},function(_0x1a02bc){return db[_0x0f0b('0x57')][_0x0f0b('0xa7')]({'where':{'id':_0x3c81e5},'transaction':_0x1a02bc})[_0x0f0b('0x23')](function(_0x351182){if(_0x351182){return db[_0x0f0b('0xa8')][_0x0f0b('0x39')]({'where':{'OpenchannelAccountId':_0x3c81e5},'transaction':_0x1a02bc})[_0x0f0b('0x23')](function(){var _0x1e802b=_[_0x0f0b('0x3d')](_0x427f8d,function(_0x457f34){_0x457f34[_0x0f0b('0x63')]=_0x3c81e5;return _0x457f34;});return db['OpenchannelApplication'][_0x0f0b('0xa9')](_0x1e802b,{'transaction':_0x1a02bc});});}else{_0x61ed9f=0x194;_0x12ff24=[];}});})[_0x0f0b('0x23')](function(){if(_0x61ed9f!==0x194){return db[_0x0f0b('0xa8')]['findAndCountAll']({'where':{'OpenchannelAccountId':_0x3c81e5},'order':_0x0f0b('0xaa')})[_0x0f0b('0x23')](function(_0x53371d){_0x12ff24=_0x53371d;});}})[_0x0f0b('0x53')](function(_0x4a0e4b){_0x61ed9f=0x1f4;logger['error'](_0x4a0e4b[_0x0f0b('0xab')]);if(_0x4a0e4b['name']){delete _0x4a0e4b['name'];}_0x12ff24=_0x4a0e4b;})[_0x0f0b('0xac')](function(){if(_0x12ff24===null){_0x12f2f9['sendStatus'](_0x61ed9f);}else{if(_0x61ed9f===0x1f4){_0x12f2f9[_0x0f0b('0x2c')](_0x61ed9f)['send'](_0x12ff24);}else{_0x12f2f9['status'](_0x61ed9f)['json'](_0x12ff24);}}});};exports['getApplications']=function(_0x44d737,_0x55d69c,_0xcad72f){var _0x3db634={};var _0x23c41a={};var _0x2f1629;var _0x582b19;return db[_0x0f0b('0x57')]['findOne']({'where':{'id':_0x44d737[_0x0f0b('0x5f')]['id']}})[_0x0f0b('0x23')](handleEntityNotFound(_0x55d69c,null))[_0x0f0b('0x23')](function(_0x2845fb){if(_0x2845fb){_0x2f1629=_0x2845fb;_0x23c41a[_0x0f0b('0x41')]=_[_0x0f0b('0x55')](db[_0x0f0b('0xa8')][_0x0f0b('0x56')]);_0x23c41a[_0x0f0b('0x42')]=_[_0x0f0b('0x55')](_0x44d737[_0x0f0b('0x42')]);_0x23c41a[_0x0f0b('0x43')]=_[_0x0f0b('0x44')](_0x23c41a['model'],_0x23c41a['query']);_0x3db634[_0x0f0b('0x45')]=_[_0x0f0b('0x44')](_0x23c41a['model'],qs[_0x0f0b('0x46')](_0x44d737['query'][_0x0f0b('0x46')]));_0x3db634['attributes']=_0x3db634['attributes']['length']?_0x3db634[_0x0f0b('0x45')]:_0x23c41a[_0x0f0b('0x41')];_0x3db634[_0x0f0b('0x4a')]=qs['sort'](_0x44d737[_0x0f0b('0x42')][_0x0f0b('0x4b')]);_0x3db634[_0x0f0b('0x4d')]=qs[_0x0f0b('0x43')](_['pick'](_0x44d737[_0x0f0b('0x42')],_0x23c41a[_0x0f0b('0x43')]));if(_0x44d737[_0x0f0b('0x42')]['filter']){_0x3db634[_0x0f0b('0x4d')]=_[_0x0f0b('0x4e')](_0x3db634[_0x0f0b('0x4d')],{'$or':_['map'](_0x3db634[_0x0f0b('0x45')],function(_0x1d69fe){var _0x5a91e3={};_0x5a91e3[_0x1d69fe]={'$like':'%'+_0x44d737[_0x0f0b('0x42')][_0x0f0b('0x66')]+'%'};return _0x5a91e3;})});}_0x3db634=_[_0x0f0b('0x4e')]({},_0x3db634,_0x44d737[_0x0f0b('0x50')]);return _0x2f1629[_0x0f0b('0xad')](_0x3db634);}})[_0x0f0b('0x23')](function(_0x273676){if(_0x273676){_0x582b19=_0x273676[_0x0f0b('0x47')];if(!_0x44d737[_0x0f0b('0x42')][_0x0f0b('0x48')](_0x0f0b('0x49'))){_0x3db634['limit']=qs[_0x0f0b('0x31')](_0x44d737[_0x0f0b('0x42')][_0x0f0b('0x31')]);_0x3db634[_0x0f0b('0x2f')]=qs[_0x0f0b('0x2f')](_0x44d737[_0x0f0b('0x42')][_0x0f0b('0x2f')]);}return _0x2f1629[_0x0f0b('0xad')](_0x3db634);}})[_0x0f0b('0x23')](function(_0x2f37c1){if(_0x2f37c1){return _0x2f37c1?{'count':_0x582b19,'rows':_0x2f37c1}:null;}})[_0x0f0b('0x23')](respondWithResult(_0x55d69c,null))[_0x0f0b('0x53')](handleError(_0x55d69c,null));};exports[_0x0f0b('0xae')]=function(_0x2616ab,_0x34319f,_0x34f4d4){var _0x246177={'raw':![],'where':{}};var _0x5e663c={};var _0x2bd7a6={'count':0x0,'rows':[]};return db[_0x0f0b('0x57')]['findOne']({'where':{'id':_0x2616ab[_0x0f0b('0x5f')]['id']}})[_0x0f0b('0x23')](handleEntityNotFound(_0x34319f,null))['then'](function(_0x2c5997){if(_0x2c5997){_0x5e663c[_0x0f0b('0x41')]=_[_0x0f0b('0x55')](db[_0x0f0b('0x8a')]['rawAttributes']);_0x5e663c[_0x0f0b('0x42')]=_[_0x0f0b('0x55')](_0x2616ab[_0x0f0b('0x42')]);_0x5e663c[_0x0f0b('0x43')]=_['intersection'](_0x5e663c['model'],_0x5e663c[_0x0f0b('0x42')]);_0x246177[_0x0f0b('0x45')]=_[_0x0f0b('0x44')](_0x5e663c[_0x0f0b('0x41')],qs['fields'](_0x2616ab[_0x0f0b('0x42')]['fields']));_0x246177[_0x0f0b('0x45')]=_0x246177['attributes']['length']?_0x246177[_0x0f0b('0x45')]:_0x5e663c[_0x0f0b('0x41')];if(!_0x2616ab[_0x0f0b('0x42')][_0x0f0b('0x48')](_0x0f0b('0x49'))){_0x246177[_0x0f0b('0x31')]=qs[_0x0f0b('0x31')](_0x2616ab[_0x0f0b('0x42')]['limit']);_0x246177[_0x0f0b('0x2f')]=qs[_0x0f0b('0x2f')](_0x2616ab[_0x0f0b('0x42')]['offset']);}_0x246177[_0x0f0b('0x4a')]=qs[_0x0f0b('0x4b')](_0x2616ab[_0x0f0b('0x42')]['sort']);_0x246177[_0x0f0b('0x4d')]=qs[_0x0f0b('0x43')](_[_0x0f0b('0x4c')](_0x2616ab[_0x0f0b('0x42')],_0x5e663c[_0x0f0b('0x43')]));_0x246177['where'][_0x0f0b('0x63')]=_0x2c5997['id'];if(_0x2616ab[_0x0f0b('0x42')]['filter']){_0x246177['where']=_[_0x0f0b('0x4e')](_0x246177[_0x0f0b('0x4d')],{'$or':_[_0x0f0b('0x3d')](_0x246177[_0x0f0b('0x45')],function(_0x3c012f){var _0x255f90={};_0x255f90[_0x3c012f]={'$like':'%'+_0x2616ab[_0x0f0b('0x42')]['filter']+'%'};return _0x255f90;})});}_0x246177=_[_0x0f0b('0x4e')]({},_0x246177,_0x2616ab[_0x0f0b('0x50')]);return db[_0x0f0b('0x8a')][_0x0f0b('0x32')]({'where':_0x246177[_0x0f0b('0x4d')]})[_0x0f0b('0x23')](function(_0xc263ed){_0x2bd7a6['count']=_0xc263ed;if(_0x2616ab['query']['includeAll']){_0x246177[_0x0f0b('0x51')]=[{'model':db['CmContact'],'as':_0x0f0b('0xaf'),'required':![]},{'model':db[_0x0f0b('0x98')],'as':_0x0f0b('0xb0'),'attributes':[_0x0f0b('0x3a'),_0x0f0b('0xb1'),_0x0f0b('0xb2')],'required':![]},{'model':db[_0x0f0b('0xb3')],'as':_0x0f0b('0xb4'),'attributes':['id',_0x0f0b('0x3a'),'color'],'where':_0x2616ab[_0x0f0b('0x42')][_0x0f0b('0xb5')]?{'id':_0x2616ab[_0x0f0b('0x42')]['tag']}:undefined,'required':_0x2616ab[_0x0f0b('0x42')]['tag']?!![]:![]}];}return db[_0x0f0b('0x8a')]['findAll'](_0x246177);})[_0x0f0b('0x23')](function(_0x18384c){_0x2bd7a6['rows']=_0x18384c;return _0x2bd7a6;});}})[_0x0f0b('0x23')](respondWithFilteredResult(_0x34319f,_0x246177))['catch'](handleError(_0x34319f,null));};exports[_0x0f0b('0xb6')]=function(_0x4753f5,_0xb60f20,_0x21fe7f){return db[_0x0f0b('0x57')][_0x0f0b('0x5d')]({'where':{'id':_0x4753f5[_0x0f0b('0x5f')]['id']}})['then'](handleEntityNotFound(_0xb60f20,null))[_0x0f0b('0x23')](function(_0x2958ef){if(_0x2958ef){return _0x2958ef[_0x0f0b('0xb6')](_0x4753f5[_0x0f0b('0x60')][_0x0f0b('0x6a')],_[_0x0f0b('0xb7')](_0x4753f5[_0x0f0b('0x60')],[_0x0f0b('0x6a'),'id'])||{})['spread'](function(_0x25af7a){for(var _0x41a11f=0x0;_0x41a11f<_0x4753f5[_0x0f0b('0x60')][_0x0f0b('0x6a')][_0x0f0b('0x47')];_0x41a11f+=0x1){socket['emit'](_0x0f0b('0xb8'),{'UserId':Number(_0x4753f5[_0x0f0b('0x60')][_0x0f0b('0x6a')][_0x41a11f]),'OpenchannelAccountId':Number(_0x4753f5[_0x0f0b('0x5f')]['id'])});}return _0x25af7a;});}})[_0x0f0b('0x23')](respondWithResult(_0xb60f20,null))['catch'](handleError(_0xb60f20,null));};exports[_0x0f0b('0xb9')]=function(_0x4f5cf9,_0x57b908,_0x428620){return db[_0x0f0b('0x57')][_0x0f0b('0x5d')]({'where':{'id':_0x4f5cf9[_0x0f0b('0x5f')]['id']}})['then'](handleEntityNotFound(_0x57b908,null))[_0x0f0b('0x23')](function(_0x409334){if(_0x409334){return _0x409334['removeAgents'](_0x4f5cf9['query'][_0x0f0b('0x6a')])[_0x0f0b('0x23')](function(){if(_[_0x0f0b('0xba')](_0x4f5cf9['query'][_0x0f0b('0x6a')])){for(var _0x8b341=0x0;_0x8b341<_0x4f5cf9['query']['ids'][_0x0f0b('0x47')];_0x8b341+=0x1){socket[_0x0f0b('0xbb')](_0x0f0b('0xbc'),{'UserId':Number(_0x4f5cf9[_0x0f0b('0x42')][_0x0f0b('0x6a')][_0x8b341]),'OpenchannelAccountId':Number(_0x4f5cf9[_0x0f0b('0x5f')]['id'])});}}else{socket['emit'](_0x0f0b('0xbc'),{'UserId':Number(_0x4f5cf9[_0x0f0b('0x42')]['ids']),'OpenchannelAccountId':Number(_0x4f5cf9[_0x0f0b('0x5f')]['id'])});}});}})[_0x0f0b('0x23')](respondWithStatusCode(_0x57b908,null))[_0x0f0b('0x53')](handleError(_0x57b908,null));};exports[_0x0f0b('0xbd')]=function(_0x64f82f,_0x1b3663,_0x331d73){var _0x716816={};var _0x48ef91={};var _0x3125b6;var _0x245622;return db[_0x0f0b('0x57')][_0x0f0b('0xa7')]({'where':{'id':_0x64f82f['params']['id']}})[_0x0f0b('0x23')](handleEntityNotFound(_0x1b3663,null))[_0x0f0b('0x23')](function(_0xb1bc71){if(_0xb1bc71){_0x3125b6=_0xb1bc71;_0x48ef91[_0x0f0b('0x41')]=_[_0x0f0b('0x55')](db['User'][_0x0f0b('0x56')]);_0x48ef91['query']=_[_0x0f0b('0x55')](_0x64f82f[_0x0f0b('0x42')]);_0x48ef91['filters']=_[_0x0f0b('0x44')](_0x48ef91[_0x0f0b('0x41')],_0x48ef91[_0x0f0b('0x42')]);_0x716816[_0x0f0b('0x45')]=_[_0x0f0b('0x44')](_0x48ef91['model'],qs[_0x0f0b('0x46')](_0x64f82f['query'][_0x0f0b('0x46')]));_0x716816[_0x0f0b('0x45')]=_0x716816[_0x0f0b('0x45')]['length']?_0x716816[_0x0f0b('0x45')]:_0x48ef91[_0x0f0b('0x41')];_0x716816[_0x0f0b('0x4a')]=qs[_0x0f0b('0x4b')](_0x64f82f[_0x0f0b('0x42')]['sort']);_0x716816[_0x0f0b('0x4d')]=qs[_0x0f0b('0x43')](_[_0x0f0b('0x4c')](_0x64f82f[_0x0f0b('0x42')],_0x48ef91[_0x0f0b('0x43')]));if(_0x64f82f[_0x0f0b('0x42')][_0x0f0b('0x66')]){_0x716816[_0x0f0b('0x4d')]=_['merge'](_0x716816['where'],{'$or':_[_0x0f0b('0x3d')](_0x716816[_0x0f0b('0x45')],function(_0x501b69){var _0x4e63eb={};_0x4e63eb[_0x501b69]={'$like':'%'+_0x64f82f[_0x0f0b('0x42')][_0x0f0b('0x66')]+'%'};return _0x4e63eb;})});}_0x716816=_['merge']({},_0x716816,_0x64f82f[_0x0f0b('0x50')]);return _0x3125b6['getAgents'](_0x716816);}})['then'](function(_0x29421c){if(_0x29421c){_0x245622=_0x29421c[_0x0f0b('0x47')];if(!_0x64f82f[_0x0f0b('0x42')][_0x0f0b('0x48')]('nolimit')){_0x716816[_0x0f0b('0x31')]=qs[_0x0f0b('0x31')](_0x64f82f[_0x0f0b('0x42')][_0x0f0b('0x31')]);_0x716816[_0x0f0b('0x2f')]=qs[_0x0f0b('0x2f')](_0x64f82f[_0x0f0b('0x42')][_0x0f0b('0x2f')]);}return _0x3125b6[_0x0f0b('0xbd')](_0x716816);}})[_0x0f0b('0x23')](function(_0x13b2f3){if(_0x13b2f3){return _0x13b2f3?{'count':_0x245622,'rows':_0x13b2f3}:null;}})[_0x0f0b('0x23')](respondWithResult(_0x1b3663,null))['catch'](handleError(_0x1b3663,null));};exports[_0x0f0b('0xbe')]=function(_0x24e0fa,_0x10db02,_0x1afba1){var _0x5e95f9,_0x2c62b3,_0x2bcaa7;if(_['isNil'](_0x24e0fa[_0x0f0b('0x60')][_0x0f0b('0x60')])||_0x24e0fa['body']['body']===''){throw new db[(_0x0f0b('0x70'))][(_0x0f0b('0x71'))](_0x0f0b('0xbf'));}if(_[_0x0f0b('0x77')](_0x24e0fa['body']['to'])){}_0x5e95f9=_0x24e0fa['body']['to'];return db['OpenchannelAccount'][_0x0f0b('0xa7')]({'where':{'id':_0x24e0fa[_0x0f0b('0x5f')]['id']}})[_0x0f0b('0x23')](handleEntityNotFound(_0x10db02,null))[_0x0f0b('0x23')](function(_0x3aad3f){if(_0x3aad3f){return db[_0x0f0b('0x57')][_0x0f0b('0x5d')]({'where':{'id':_0x3aad3f['id']},'include':[{'model':db[_0x0f0b('0x7e')],'as':_0x0f0b('0x81'),'include':[{'model':db[_0x0f0b('0x87')],'as':_0x0f0b('0x7f'),'where':{[_0x3aad3f[_0x0f0b('0x7a')]]:_0x5e95f9},'limit':0x1,'order':[[_0x0f0b('0x75'),_0x0f0b('0xc0')]]}]}]})['then'](handleEntityNotFound(_0x10db02,null))[_0x0f0b('0x23')](function(_0x667b37){if(_0x667b37&&_0x667b37[_0x0f0b('0x81')]){_0x2c62b3=_0x667b37[_0x0f0b('0x37')]({'plain':!![]});if(_0x2c62b3[_0x0f0b('0x81')]&&_0x2c62b3[_0x0f0b('0x81')][_0x0f0b('0x7f')][_0x0f0b('0x47')]){return _0x2c62b3['List'][_0x0f0b('0x7f')][0x0];}return db['CmContact'][_0x0f0b('0x58')](_[_0x0f0b('0x19')](_0x24e0fa[_0x0f0b('0x60')],{'firstName':_0x5e95f9,[_0x667b37[_0x0f0b('0x7a')]]:_0x5e95f9,'phone':_0x5e95f9,'ListId':_0x2c62b3[_0x0f0b('0x86')]}));}})[_0x0f0b('0x23')](handleEntityNotFound(_0x10db02,null))[_0x0f0b('0x23')](function(_0x2bd6b6){if(_0x2bd6b6){_0x2bcaa7=_0x2bd6b6;return db[_0x0f0b('0x8a')]['find']({'where':{'ContactId':_0x2bcaa7['id'],'closed':![],'OpenchannelAccountId':_0x2c62b3['id']}})['then'](function(_0x1ddb29){if(_0x1ddb29){return[_0x1ddb29,![]];}return db[_0x0f0b('0x8a')]['create']({'UserId':_0x24e0fa[_0x0f0b('0x59')]['id'],'ContactId':_0x2bcaa7['id'],'OpenchannelAccountId':_0x2c62b3['id'],'lastMsgDirection':_0x0f0b('0xc1'),'firstMsgDirection':_0x0f0b('0xc1'),'Messages':[_[_0x0f0b('0x4e')](_0x24e0fa[_0x0f0b('0x60')],{'read':![],'body':_0x24e0fa[_0x0f0b('0x60')][_0x0f0b('0x60')],'OpenchannelAccountId':_0x2c62b3['id'],'UserId':_0x24e0fa[_0x0f0b('0x59')]['id'],'ContactId':_0x2bcaa7['id']})]},{'include':[{'model':db[_0x0f0b('0x95')],'as':_0x0f0b('0xc2')}]})[_0x0f0b('0x23')](function(_0x49817b){return[_0x49817b,!![]];});});}})['spread'](function(_0x4c29bc,_0x3f371b){if(_0x3f371b){return _0x4c29bc;}return db[_0x0f0b('0x95')][_0x0f0b('0x58')](_[_0x0f0b('0x4e')](_0x24e0fa[_0x0f0b('0x60')],{'read':![],'body':_0x24e0fa[_0x0f0b('0x60')][_0x0f0b('0x60')],'OpenchannelAccountId':_0x2c62b3['id'],'OpenchannelInteractionId':_0x4c29bc['id'],'UserId':_0x24e0fa[_0x0f0b('0x59')]['id'],'ContactId':_0x2bcaa7['id']}))[_0x0f0b('0x23')](function(_0x13595e){_0x4c29bc['dataValues'][_0x0f0b('0xc2')]=[];_0x4c29bc['dataValues'][_0x0f0b('0xc2')][_0x0f0b('0xc3')](_0x13595e[_0x0f0b('0xc4')]);return _0x4c29bc;});});}})['then'](respondWithResult(_0x10db02,null))['catch'](handleError(_0x10db02,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 94d62bf..3fed7c6 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 _0xb43b=['events','../../mysqldb','setMaxListeners','save','update','hasOwnProperty','exports'];(function(_0x1d742c,_0x122bbb){var _0x628696=function(_0x20336a){while(--_0x20336a){_0x1d742c['push'](_0x1d742c['shift']());}};_0x628696(++_0x122bbb);}(_0xb43b,0x1b2));var _0xbb43=function(_0x1f8346,_0x41950d){_0x1f8346=_0x1f8346-0x0;var _0x258c27=_0xb43b[_0x1f8346];return _0x258c27;};'use strict';var EventEmitter=require(_0xbb43('0x0'));var OpenchannelAccount=require(_0xbb43('0x1'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xbb43('0x2')](0x0);var events={'afterCreate':_0xbb43('0x3'),'afterUpdate':_0xbb43('0x4'),'afterDestroy':'remove'};function emitEvent(_0x131e9e){return function(_0x41aff6,_0x351254,_0x16432a){OpenchannelAccountEvents['emit'](_0x131e9e+':'+_0x41aff6['id'],_0x41aff6);OpenchannelAccountEvents['emit'](_0x131e9e,_0x41aff6);_0x16432a(null);};}for(var e in events){if(events[_0xbb43('0x5')](e)){var event=events[e];OpenchannelAccount['hook'](e,emitEvent(event));}}module[_0xbb43('0x6')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x0bb5=['events','../../mysqldb','save','update','remove','emit','hook','exports'];(function(_0x513f27,_0x1cbc87){var _0xa316b7=function(_0x3b592d){while(--_0x3b592d){_0x513f27['push'](_0x513f27['shift']());}};_0xa316b7(++_0x1cbc87);}(_0x0bb5,0x148));var _0x50bb=function(_0x3355b5,_0x407bce){_0x3355b5=_0x3355b5-0x0;var _0x458a05=_0x0bb5[_0x3355b5];return _0x458a05;};'use strict';var EventEmitter=require(_0x50bb('0x0'));var OpenchannelAccount=require(_0x50bb('0x1'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x50bb('0x2'),'afterUpdate':_0x50bb('0x3'),'afterDestroy':_0x50bb('0x4')};function emitEvent(_0x117e36){return function(_0x29c72b,_0xfdc9d4,_0x451b4c){OpenchannelAccountEvents[_0x50bb('0x5')](_0x117e36+':'+_0x29c72b['id'],_0x29c72b);OpenchannelAccountEvents['emit'](_0x117e36,_0x29c72b);_0x451b4c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0x50bb('0x6')](e,emitEvent(event));}}module[_0x50bb('0x7')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index db373b3..e24af1a 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(_0x144e21,_0x21652c){var _0x39cd8c=function(_0x442bd3){while(--_0x442bd3){_0x144e21['push'](_0x144e21['shift']());}};_0x39cd8c(++_0x21652c);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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(_0x442097,_0x5d1f30){var _0x5f2d07=function(_0x5d9b8c){while(--_0x5d9b8c){_0x442097['push'](_0x442097['shift']());}};_0x5f2d07(++_0x5d1f30);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'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 d6fb301..9d78b75 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 _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(_0x15cbce,_0xda8402){var _0x257f29=function(_0x388132){while(--_0x388132){_0x15cbce['push'](_0x15cbce['shift']());}};_0x257f29(++_0xda8402);}(_0x2547,0x1cd));var _0x7254=function(_0x28b884,_0x5e77c3){_0x28b884=_0x28b884-0x0;var _0x99f2a4=_0x2547[_0x28b884];return _0x99f2a4;};'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 +var _0xa45c=['client','http','redis','localhost','socket.io-emitter','./openchannelAccount.socket','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','randomstring','../../mysqldb','../../config/logger','jayson/promise'];(function(_0x174bd5,_0xffd194){var _0x218719=function(_0xc49d8c){while(--_0xc49d8c){_0x174bd5['push'](_0x174bd5['shift']());}};_0x218719(++_0xffd194);}(_0xa45c,0x6d));var _0xca45=function(_0x7a6e42,_0x5126c7){_0x7a6e42=_0x7a6e42-0x0;var _0x1fd930=_0xa45c[_0x7a6e42];return _0x1fd930;};'use strict';var _=require(_0xca45('0x0'));var util=require(_0xca45('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xca45('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xca45('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xca45('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xca45('0x5'));var client=jayson[_0xca45('0x6')][_0xca45('0x7')]({'port':0x232a});config[_0xca45('0x8')]=_['defaults'](config[_0xca45('0x8')],{'host':_0xca45('0x9'),'port':0x18eb});var socket=require(_0xca45('0xa'))(new Redis(config[_0xca45('0x8')]));require(_0xca45('0xb'))['register'](socket);function respondWithRpcPromise(_0xeb0cd9,_0x342542,_0x32afdc){return new BPromise(function(_0x151691,_0x3a551){return client[_0xca45('0xc')](_0xeb0cd9,_0x32afdc)[_0xca45('0xd')](function(_0x4a8692){logger[_0xca45('0xe')](_0xca45('0xf'),_0x342542,_0xca45('0x10'));logger[_0xca45('0x11')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x342542,_0xca45('0x10'),JSON[_0xca45('0x12')](_0x4a8692));if(_0x4a8692[_0xca45('0x13')]){if(_0x4a8692['error'][_0xca45('0x14')]===0x1f4){logger['error'](_0xca45('0xf'),_0x342542,_0x4a8692[_0xca45('0x13')][_0xca45('0x15')]);return _0x3a551(_0x4a8692[_0xca45('0x13')][_0xca45('0x15')]);}logger[_0xca45('0x13')](_0xca45('0xf'),_0x342542,_0x4a8692['error'][_0xca45('0x15')]);return _0x151691(_0x4a8692['error']['message']);}else{logger[_0xca45('0xe')](_0xca45('0xf'),_0x342542,'request\x20sent');_0x151691(_0x4a8692[_0xca45('0x16')][_0xca45('0x15')]);}})['catch'](function(_0x40540f){logger[_0xca45('0x13')](_0xca45('0xf'),_0x342542,_0x40540f);_0x3a551(_0x40540f);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 782a929..19a1aa0 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 _0x50c1=['openchannelAccount:','./openchannelAccount.events','update','emit','removeListener','register'];(function(_0x5381fa,_0x5d7aa2){var _0x57503b=function(_0x1b234c){while(--_0x1b234c){_0x5381fa['push'](_0x5381fa['shift']());}};_0x57503b(++_0x5d7aa2);}(_0x50c1,0x1a5));var _0x150c=function(_0x10827b,_0x19f0aa){_0x10827b=_0x10827b-0x0;var _0x3075a0=_0x50c1[_0x10827b];return _0x3075a0;};'use strict';var OpenchannelAccountEvents=require(_0x150c('0x0'));var events=['save','remove',_0x150c('0x1')];function createListener(_0x292ace,_0xef6612){return function(_0x1f68cd){_0xef6612[_0x150c('0x2')](_0x292ace,_0x1f68cd);};}function removeListener(_0x18c0bd,_0x37cd57){return function(){OpenchannelAccountEvents[_0x150c('0x3')](_0x18c0bd,_0x37cd57);};}exports[_0x150c('0x4')]=function(_0x52f723){for(var _0x5c6089=0x0,_0x367215=events['length'];_0x5c6089<_0x367215;_0x5c6089++){var _0x5b10b4=events[_0x5c6089];var _0xb16344=createListener(_0x150c('0x5')+_0x5b10b4,_0x52f723);OpenchannelAccountEvents['on'](_0x5b10b4,_0xb16344);}}; \ No newline at end of file +var _0xf109=['remove','emit','removeListener','register','length','openchannelAccount:','./openchannelAccount.events','save'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xf109,0xce));var _0x9f10=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0xf109[_0x1589dd];return _0x1bddd1;};'use strict';var OpenchannelAccountEvents=require(_0x9f10('0x0'));var events=[_0x9f10('0x1'),_0x9f10('0x2'),'update'];function createListener(_0x5b381d,_0x4cbc7a){return function(_0x3659ce){_0x4cbc7a[_0x9f10('0x3')](_0x5b381d,_0x3659ce);};}function removeListener(_0x74d0ee,_0x26f01c){return function(){OpenchannelAccountEvents[_0x9f10('0x4')](_0x74d0ee,_0x26f01c);};}exports[_0x9f10('0x5')]=function(_0x408fe8){for(var _0xd3137b=0x0,_0x227a29=events[_0x9f10('0x6')];_0xd3137b<_0x227a29;_0xd3137b++){var _0x3fd82f=events[_0xd3137b];var _0x5c8719=createListener(_0x9f10('0x7')+_0x3fd82f,_0x408fe8);OpenchannelAccountEvents['on'](_0x3fd82f,_0x5c8719);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 9d00ce1..c1be088 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 _0x686f=['destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelApplication.controller','isAuthenticated','index','get','/:id','post','put','update','delete'];(function(_0x52991d,_0x429d72){var _0x5b9004=function(_0x4bfe0d){while(--_0x4bfe0d){_0x52991d['push'](_0x52991d['shift']());}};_0x5b9004(++_0x429d72);}(_0x686f,0x87));var _0xf686=function(_0x5dadff,_0x34f182){_0x5dadff=_0x5dadff-0x0;var _0x304ca1=_0x686f[_0x5dadff];return _0x304ca1;};'use strict';var multer=require(_0xf686('0x0'));var util=require('util');var path=require(_0xf686('0x1'));var timeout=require(_0xf686('0x2'));var express=require(_0xf686('0x3'));var router=express[_0xf686('0x4')]();var fs_extra=require(_0xf686('0x5'));var auth=require(_0xf686('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xf686('0x7'));var controller=require(_0xf686('0x8'));router['get']('/',auth[_0xf686('0x9')](),controller[_0xf686('0xa')]);router[_0xf686('0xb')](_0xf686('0xc'),auth[_0xf686('0x9')](),controller['show']);router[_0xf686('0xd')]('/',auth[_0xf686('0x9')](),controller['create']);router[_0xf686('0xe')](_0xf686('0xc'),auth[_0xf686('0x9')](),controller[_0xf686('0xf')]);router[_0xf686('0x10')](_0xf686('0xc'),auth[_0xf686('0x9')](),controller[_0xf686('0x11')]);module[_0xf686('0x12')]=router; \ No newline at end of file +var _0xb78a=['index','show','post','create','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated'];(function(_0x57782b,_0x544855){var _0x5db279=function(_0x3f16d4){while(--_0x3f16d4){_0x57782b['push'](_0x57782b['shift']());}};_0x5db279(++_0x544855);}(_0xb78a,0xf0));var _0xab78=function(_0x11f28f,_0x30ebf9){_0x11f28f=_0x11f28f-0x0;var _0x413f1a=_0xb78a[_0x11f28f];return _0x413f1a;};'use strict';var multer=require(_0xab78('0x0'));var util=require(_0xab78('0x1'));var path=require(_0xab78('0x2'));var timeout=require(_0xab78('0x3'));var express=require(_0xab78('0x4'));var router=express['Router']();var fs_extra=require(_0xab78('0x5'));var auth=require(_0xab78('0x6'));var interaction=require(_0xab78('0x7'));var config=require(_0xab78('0x8'));var controller=require(_0xab78('0x9'));router[_0xab78('0xa')]('/',auth[_0xab78('0xb')](),controller[_0xab78('0xc')]);router[_0xab78('0xa')]('/:id',auth[_0xab78('0xb')](),controller[_0xab78('0xd')]);router[_0xab78('0xe')]('/',auth[_0xab78('0xb')](),controller[_0xab78('0xf')]);router['put']('/:id',auth[_0xab78('0xb')](),controller[_0xab78('0x10')]);router[_0xab78('0x11')](_0xab78('0x12'),auth[_0xab78('0xb')](),controller[_0xab78('0x13')]);module[_0xab78('0x14')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 04f1e0e..f53d304 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 _0x1430=['INTEGER','STRING','noop','*,*,*,*','sequelize','exports'];(function(_0x4ea211,_0x16d55b){var _0x5b778d=function(_0x17f7e1){while(--_0x17f7e1){_0x4ea211['push'](_0x4ea211['shift']());}};_0x5b778d(++_0x16d55b);}(_0x1430,0xbe));var _0x0143=function(_0x550d2a,_0x3b1087){_0x550d2a=_0x550d2a-0x0;var _0x2009b4=_0x1430[_0x550d2a];return _0x2009b4;};'use strict';var Sequelize=require(_0x0143('0x0'));module[_0x0143('0x1')]={'priority':{'type':Sequelize[_0x0143('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x0143('0x3')],'allowNull':![],'defaultValue':_0x0143('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x0143('0x3')]},'interval':{'type':Sequelize[_0x0143('0x3')],'defaultValue':_0x0143('0x5')}}; \ No newline at end of file +var _0xcfe6=['STRING','noop','TEXT','sequelize','exports','INTEGER'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xcfe6,0x93));var _0x6cfe=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcfe6[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x6cfe('0x0'));module[_0x6cfe('0x1')]={'priority':{'type':Sequelize[_0x6cfe('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x6cfe('0x3')],'allowNull':![],'defaultValue':_0x6cfe('0x4')},'appdata':{'type':Sequelize[_0x6cfe('0x5')]()},'description':{'type':Sequelize[_0x6cfe('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index e1b47af..6fb36d2 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 _0xc92a=['update','then','stack','name','send','index','map','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','limit','order','sort','filters','filter','where','merge','VIRTUAL','options','OpenchannelApplication','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','count','set','Content-Range','apply','reject','save'];(function(_0xae4e69,_0x275632){var _0x20bceb=function(_0x21ffc8){while(--_0x21ffc8){_0xae4e69['push'](_0xae4e69['shift']());}};_0x20bceb(++_0x275632);}(_0xc92a,0x108));var _0xac92=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xc92a[_0x397e5f];return _0x5302b8;};'use strict';var emlformat=require(_0xac92('0x0'));var rimraf=require(_0xac92('0x1'));var zipdir=require(_0xac92('0x2'));var jsonpatch=require(_0xac92('0x3'));var rp=require(_0xac92('0x4'));var moment=require(_0xac92('0x5'));var BPromise=require(_0xac92('0x6'));var Mustache=require(_0xac92('0x7'));var util=require('util');var path=require('path');var sox=require(_0xac92('0x8'));var csv=require(_0xac92('0x9'));var ejs=require(_0xac92('0xa'));var fs=require('fs');var fs_extra=require(_0xac92('0xb'));var _=require(_0xac92('0xc'));var squel=require('squel');var crypto=require(_0xac92('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac92('0x9'));var querystring=require(_0xac92('0xe'));var Papa=require(_0xac92('0xf'));var Redis=require('ioredis');var authService=require(_0xac92('0x10'));var qs=require(_0xac92('0x11'));var as=require(_0xac92('0x12'));var hardwareService=require(_0xac92('0x13'));var logger=require(_0xac92('0x14'))(_0xac92('0x15'));var utils=require('../../config/utils');var config=require(_0xac92('0x16'));var licenseUtil=require(_0xac92('0x17'));var db=require(_0xac92('0x18'))['db'];function respondWithStatusCode(_0x14d640,_0x2e5846){_0x2e5846=_0x2e5846||0xcc;return function(_0xc74bf5){if(_0xc74bf5){return _0x14d640[_0xac92('0x19')](_0x2e5846);}return _0x14d640[_0xac92('0x1a')](_0x2e5846)[_0xac92('0x1b')]();};}function respondWithResult(_0x45bf20,_0x531179){_0x531179=_0x531179||0xc8;return function(_0x330c23){if(_0x330c23){return _0x45bf20[_0xac92('0x1a')](_0x531179)[_0xac92('0x1c')](_0x330c23);}};}function respondWithFilteredResult(_0x81bfde,_0x35f596){return function(_0x48ee27){if(_0x48ee27){var _0x32cccd=typeof _0x35f596[_0xac92('0x1d')]==='undefined'&&typeof _0x35f596['limit']==='undefined';var _0x166e11=_0x48ee27[_0xac92('0x1e')];var _0x543153=_0x32cccd?0x0:_0x35f596[_0xac92('0x1d')];var _0x367507=_0x32cccd?_0x48ee27['count']:_0x35f596[_0xac92('0x1d')]+_0x35f596['limit'];var _0x348799;if(_0x367507>=_0x166e11){_0x367507=_0x166e11;_0x348799=0xc8;}else{_0x348799=0xce;}_0x81bfde['status'](_0x348799);return _0x81bfde[_0xac92('0x1f')](_0xac92('0x20'),_0x543153+'-'+_0x367507+'/'+_0x166e11)['json'](_0x48ee27);}return null;};}function patchUpdates(_0x3f820f){return function(_0x5a93d4){try{jsonpatch[_0xac92('0x21')](_0x5a93d4,_0x3f820f,!![]);}catch(_0x7b3207){return BPromise[_0xac92('0x22')](_0x7b3207);}return _0x5a93d4[_0xac92('0x23')]();};}function saveUpdates(_0x32918b,_0xbca272){return function(_0x1ce032){if(_0x1ce032){return _0x1ce032[_0xac92('0x24')](_0x32918b)[_0xac92('0x25')](function(_0x1b05e0){return _0x1b05e0;});}return null;};}function removeEntity(_0x45a6bc,_0x5f3932){return function(_0x19974e){if(_0x19974e){return _0x19974e['destroy']()['then'](function(){_0x45a6bc[_0xac92('0x1a')](0xcc)[_0xac92('0x1b')]();});}};}function handleEntityNotFound(_0x1202db,_0x2d42ba){return function(_0x344cba){if(!_0x344cba){_0x1202db[_0xac92('0x19')](0x194);}return _0x344cba;};}function handleError(_0x686153,_0x19b36b){_0x19b36b=_0x19b36b||0x1f4;return function(_0x1c7127){logger['error'](_0x1c7127[_0xac92('0x26')]);if(_0x1c7127[_0xac92('0x27')]){delete _0x1c7127['name'];}_0x686153[_0xac92('0x1a')](_0x19b36b)[_0xac92('0x28')](_0x1c7127);};}exports[_0xac92('0x29')]=function(_0x543dd1,_0x35de58){var _0x2b0ae5={},_0x5cdef2={},_0x334b2c={'count':0x0,'rows':[]};var _0x20297c=_[_0xac92('0x2a')](db['OpenchannelApplication']['rawAttributes'],function(_0xce6355){return{'name':_0xce6355['fieldName'],'type':_0xce6355[_0xac92('0x2b')][_0xac92('0x2c')]};});_0x5cdef2[_0xac92('0x2d')]=_[_0xac92('0x2a')](_0x20297c,_0xac92('0x27'));_0x5cdef2[_0xac92('0x2e')]=_[_0xac92('0x2f')](_0x543dd1[_0xac92('0x2e')]);_0x5cdef2['filters']=_[_0xac92('0x30')](_0x5cdef2[_0xac92('0x2d')],_0x5cdef2['query']);_0x2b0ae5[_0xac92('0x31')]=_[_0xac92('0x30')](_0x5cdef2['model'],qs[_0xac92('0x32')](_0x543dd1[_0xac92('0x2e')][_0xac92('0x32')]));_0x2b0ae5[_0xac92('0x31')]=_0x2b0ae5['attributes'][_0xac92('0x33')]?_0x2b0ae5['attributes']:_0x5cdef2['model'];if(!_0x543dd1[_0xac92('0x2e')]['hasOwnProperty'](_0xac92('0x34'))){_0x2b0ae5[_0xac92('0x35')]=qs['limit'](_0x543dd1['query'][_0xac92('0x35')]);_0x2b0ae5[_0xac92('0x1d')]=qs[_0xac92('0x1d')](_0x543dd1['query']['offset']);}_0x2b0ae5[_0xac92('0x36')]=qs[_0xac92('0x37')](_0x543dd1[_0xac92('0x2e')][_0xac92('0x37')]);_0x2b0ae5['where']=qs[_0xac92('0x38')](_['pick'](_0x543dd1[_0xac92('0x2e')],_0x5cdef2[_0xac92('0x38')]),_0x20297c);if(_0x543dd1['query'][_0xac92('0x39')]){_0x2b0ae5[_0xac92('0x3a')]=_[_0xac92('0x3b')](_0x2b0ae5['where'],{'$or':_[_0xac92('0x2a')](_0x20297c,function(_0x1b5320){if(_0x1b5320[_0xac92('0x2b')]!==_0xac92('0x3c')){var _0xd161a6={};_0xd161a6[_0x1b5320[_0xac92('0x27')]]={'$like':'%'+_0x543dd1[_0xac92('0x2e')][_0xac92('0x39')]+'%'};return _0xd161a6;}})});}_0x2b0ae5=_[_0xac92('0x3b')]({},_0x2b0ae5,_0x543dd1[_0xac92('0x3d')]);var _0x6d6aa6={'where':_0x2b0ae5[_0xac92('0x3a')]};return db[_0xac92('0x3e')][_0xac92('0x1e')](_0x6d6aa6)[_0xac92('0x25')](function(_0x26f69e){_0x334b2c['count']=_0x26f69e;if(_0x543dd1[_0xac92('0x2e')][_0xac92('0x3f')]){_0x2b0ae5[_0xac92('0x40')]=[{'all':!![]}];}return db[_0xac92('0x3e')][_0xac92('0x41')](_0x2b0ae5);})['then'](function(_0x1c4bc6){_0x334b2c[_0xac92('0x42')]=_0x1c4bc6;return _0x334b2c;})['then'](respondWithFilteredResult(_0x35de58,_0x2b0ae5))[_0xac92('0x43')](handleError(_0x35de58,null));};exports[_0xac92('0x44')]=function(_0x50799a,_0x230cdb){var _0xa03abe={'raw':!![],'where':{'id':_0x50799a[_0xac92('0x45')]['id']}},_0x3c8607={};_0x3c8607[_0xac92('0x2d')]=_[_0xac92('0x2f')](db[_0xac92('0x3e')][_0xac92('0x46')]);_0x3c8607[_0xac92('0x2e')]=_[_0xac92('0x2f')](_0x50799a[_0xac92('0x2e')]);_0x3c8607['filters']=_['intersection'](_0x3c8607['model'],_0x3c8607[_0xac92('0x2e')]);_0xa03abe['attributes']=_[_0xac92('0x30')](_0x3c8607[_0xac92('0x2d')],qs[_0xac92('0x32')](_0x50799a[_0xac92('0x2e')][_0xac92('0x32')]));_0xa03abe[_0xac92('0x31')]=_0xa03abe[_0xac92('0x31')][_0xac92('0x33')]?_0xa03abe[_0xac92('0x31')]:_0x3c8607[_0xac92('0x2d')];if(_0x50799a[_0xac92('0x2e')][_0xac92('0x3f')]){_0xa03abe[_0xac92('0x40')]=[{'all':!![]}];}_0xa03abe=_[_0xac92('0x3b')]({},_0xa03abe,_0x50799a[_0xac92('0x3d')]);return db[_0xac92('0x3e')][_0xac92('0x47')](_0xa03abe)[_0xac92('0x25')](handleEntityNotFound(_0x230cdb,null))['then'](respondWithResult(_0x230cdb,null))['catch'](handleError(_0x230cdb,null));};exports[_0xac92('0x48')]=function(_0xc35722,_0x18f768){return db['OpenchannelApplication'][_0xac92('0x48')](_0xc35722[_0xac92('0x49')],{})['then'](respondWithResult(_0x18f768,0xc9))[_0xac92('0x43')](handleError(_0x18f768,null));};exports['update']=function(_0x983bcd,_0x1ecdd2){if(_0x983bcd['body']['id']){delete _0x983bcd[_0xac92('0x49')]['id'];}return db[_0xac92('0x3e')][_0xac92('0x47')]({'where':{'id':_0x983bcd[_0xac92('0x45')]['id']}})[_0xac92('0x25')](handleEntityNotFound(_0x1ecdd2,null))[_0xac92('0x25')](saveUpdates(_0x983bcd['body'],null))[_0xac92('0x25')](respondWithResult(_0x1ecdd2,null))[_0xac92('0x43')](handleError(_0x1ecdd2,null));};exports[_0xac92('0x4a')]=function(_0x3525f6,_0x413638){return db['OpenchannelApplication'][_0xac92('0x47')]({'where':{'id':_0x3525f6[_0xac92('0x45')]['id']}})[_0xac92('0x25')](handleEntityNotFound(_0x413638,null))[_0xac92('0x25')](removeEntity(_0x413638,null))[_0xac92('0x43')](handleError(_0x413638,null));}; \ No newline at end of file +var _0x8ed3=['map','type','key','model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','OpenchannelApplication','include','findAll','rows','catch','show','rawAttributes','length','includeAll','find','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x8ed3,0x15b));var _0x38ed=function(_0x2e2ce8,_0x436b78){_0x2e2ce8=_0x2e2ce8-0x0;var _0x1d92a7=_0x8ed3[_0x2e2ce8];return _0x1d92a7;};'use strict';var emlformat=require(_0x38ed('0x0'));var rimraf=require(_0x38ed('0x1'));var zipdir=require(_0x38ed('0x2'));var jsonpatch=require(_0x38ed('0x3'));var rp=require(_0x38ed('0x4'));var moment=require(_0x38ed('0x5'));var BPromise=require(_0x38ed('0x6'));var Mustache=require(_0x38ed('0x7'));var util=require(_0x38ed('0x8'));var path=require('path');var sox=require(_0x38ed('0x9'));var csv=require(_0x38ed('0xa'));var ejs=require(_0x38ed('0xb'));var fs=require('fs');var fs_extra=require(_0x38ed('0xc'));var _=require(_0x38ed('0xd'));var squel=require(_0x38ed('0xe'));var crypto=require(_0x38ed('0xf'));var jsforce=require(_0x38ed('0x10'));var deskjs=require(_0x38ed('0x11'));var toCsv=require(_0x38ed('0xa'));var querystring=require(_0x38ed('0x12'));var Papa=require(_0x38ed('0x13'));var Redis=require('ioredis');var authService=require(_0x38ed('0x14'));var qs=require(_0x38ed('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x38ed('0x16'));var logger=require(_0x38ed('0x17'))(_0x38ed('0x18'));var utils=require(_0x38ed('0x19'));var config=require(_0x38ed('0x1a'));var licenseUtil=require(_0x38ed('0x1b'));var db=require(_0x38ed('0x1c'))['db'];function respondWithStatusCode(_0x4cb7a4,_0x2dd3ff){_0x2dd3ff=_0x2dd3ff||0xcc;return function(_0xe6ff3b){if(_0xe6ff3b){return _0x4cb7a4['sendStatus'](_0x2dd3ff);}return _0x4cb7a4['status'](_0x2dd3ff)[_0x38ed('0x1d')]();};}function respondWithResult(_0x5eca58,_0x25ba58){_0x25ba58=_0x25ba58||0xc8;return function(_0x294bca){if(_0x294bca){return _0x5eca58[_0x38ed('0x1e')](_0x25ba58)[_0x38ed('0x1f')](_0x294bca);}};}function respondWithFilteredResult(_0x5e6d87,_0x5479ed){return function(_0x49134c){if(_0x49134c){var _0x290f66=typeof _0x5479ed['offset']===_0x38ed('0x20')&&typeof _0x5479ed[_0x38ed('0x21')]===_0x38ed('0x20');var _0x1fcb19=_0x49134c[_0x38ed('0x22')];var _0x3fdded=_0x290f66?0x0:_0x5479ed[_0x38ed('0x23')];var _0x1f7d21=_0x290f66?_0x49134c['count']:_0x5479ed['offset']+_0x5479ed[_0x38ed('0x21')];var _0x47170b;if(_0x1f7d21>=_0x1fcb19){_0x1f7d21=_0x1fcb19;_0x47170b=0xc8;}else{_0x47170b=0xce;}_0x5e6d87['status'](_0x47170b);return _0x5e6d87[_0x38ed('0x24')]('Content-Range',_0x3fdded+'-'+_0x1f7d21+'/'+_0x1fcb19)[_0x38ed('0x1f')](_0x49134c);}return null;};}function patchUpdates(_0x3e11c5){return function(_0x18e14a){try{jsonpatch[_0x38ed('0x25')](_0x18e14a,_0x3e11c5,!![]);}catch(_0x2336c5){return BPromise[_0x38ed('0x26')](_0x2336c5);}return _0x18e14a[_0x38ed('0x27')]();};}function saveUpdates(_0x2995c2,_0x514503){return function(_0x1be417){if(_0x1be417){return _0x1be417[_0x38ed('0x28')](_0x2995c2)[_0x38ed('0x29')](function(_0x339484){return _0x339484;});}return null;};}function removeEntity(_0x12af51,_0x3652fb){return function(_0x530c3f){if(_0x530c3f){return _0x530c3f[_0x38ed('0x2a')]()[_0x38ed('0x29')](function(){_0x12af51[_0x38ed('0x1e')](0xcc)[_0x38ed('0x1d')]();});}};}function handleEntityNotFound(_0x8bcaa0,_0x52ecc0){return function(_0x1259e1){if(!_0x1259e1){_0x8bcaa0[_0x38ed('0x2b')](0x194);}return _0x1259e1;};}function handleError(_0xbcc9f3,_0x3e4e5e){_0x3e4e5e=_0x3e4e5e||0x1f4;return function(_0x566dce){logger['error'](_0x566dce[_0x38ed('0x2c')]);if(_0x566dce['name']){delete _0x566dce[_0x38ed('0x2d')];}_0xbcc9f3[_0x38ed('0x1e')](_0x3e4e5e)[_0x38ed('0x2e')](_0x566dce);};}exports[_0x38ed('0x2f')]=function(_0x59ed07,_0x2a96f3){var _0x1191cc={},_0x5d936a={},_0x57be91={'count':0x0,'rows':[]};var _0xc97d14=_[_0x38ed('0x30')](db['OpenchannelApplication']['rawAttributes'],function(_0x1488a9){return{'name':_0x1488a9['fieldName'],'type':_0x1488a9[_0x38ed('0x31')][_0x38ed('0x32')]};});_0x5d936a[_0x38ed('0x33')]=_[_0x38ed('0x30')](_0xc97d14,_0x38ed('0x2d'));_0x5d936a[_0x38ed('0x34')]=_[_0x38ed('0x35')](_0x59ed07[_0x38ed('0x34')]);_0x5d936a[_0x38ed('0x36')]=_[_0x38ed('0x37')](_0x5d936a['model'],_0x5d936a['query']);_0x1191cc['attributes']=_[_0x38ed('0x37')](_0x5d936a[_0x38ed('0x33')],qs[_0x38ed('0x38')](_0x59ed07['query'][_0x38ed('0x38')]));_0x1191cc[_0x38ed('0x39')]=_0x1191cc[_0x38ed('0x39')]['length']?_0x1191cc[_0x38ed('0x39')]:_0x5d936a[_0x38ed('0x33')];if(!_0x59ed07['query']['hasOwnProperty'](_0x38ed('0x3a'))){_0x1191cc[_0x38ed('0x21')]=qs[_0x38ed('0x21')](_0x59ed07['query']['limit']);_0x1191cc[_0x38ed('0x23')]=qs[_0x38ed('0x23')](_0x59ed07['query'][_0x38ed('0x23')]);}_0x1191cc[_0x38ed('0x3b')]=qs[_0x38ed('0x3c')](_0x59ed07[_0x38ed('0x34')][_0x38ed('0x3c')]);_0x1191cc[_0x38ed('0x3d')]=qs['filters'](_[_0x38ed('0x3e')](_0x59ed07[_0x38ed('0x34')],_0x5d936a[_0x38ed('0x36')]),_0xc97d14);if(_0x59ed07['query'][_0x38ed('0x3f')]){_0x1191cc[_0x38ed('0x3d')]=_[_0x38ed('0x40')](_0x1191cc[_0x38ed('0x3d')],{'$or':_['map'](_0xc97d14,function(_0x4ca447){if(_0x4ca447[_0x38ed('0x31')]!==_0x38ed('0x41')){var _0x3b3f30={};_0x3b3f30[_0x4ca447[_0x38ed('0x2d')]]={'$like':'%'+_0x59ed07[_0x38ed('0x34')][_0x38ed('0x3f')]+'%'};return _0x3b3f30;}})});}_0x1191cc=_[_0x38ed('0x40')]({},_0x1191cc,_0x59ed07[_0x38ed('0x42')]);var _0x1b3a55={'where':_0x1191cc['where']};return db[_0x38ed('0x43')][_0x38ed('0x22')](_0x1b3a55)[_0x38ed('0x29')](function(_0x8a0d2f){_0x57be91[_0x38ed('0x22')]=_0x8a0d2f;if(_0x59ed07[_0x38ed('0x34')]['includeAll']){_0x1191cc[_0x38ed('0x44')]=[{'all':!![]}];}return db[_0x38ed('0x43')][_0x38ed('0x45')](_0x1191cc);})['then'](function(_0x2245dc){_0x57be91[_0x38ed('0x46')]=_0x2245dc;return _0x57be91;})[_0x38ed('0x29')](respondWithFilteredResult(_0x2a96f3,_0x1191cc))[_0x38ed('0x47')](handleError(_0x2a96f3,null));};exports[_0x38ed('0x48')]=function(_0x2d5193,_0x590873){var _0x37c5f7={'raw':!![],'where':{'id':_0x2d5193['params']['id']}},_0xf32ac5={};_0xf32ac5[_0x38ed('0x33')]=_[_0x38ed('0x35')](db['OpenchannelApplication'][_0x38ed('0x49')]);_0xf32ac5[_0x38ed('0x34')]=_[_0x38ed('0x35')](_0x2d5193[_0x38ed('0x34')]);_0xf32ac5['filters']=_[_0x38ed('0x37')](_0xf32ac5[_0x38ed('0x33')],_0xf32ac5['query']);_0x37c5f7[_0x38ed('0x39')]=_[_0x38ed('0x37')](_0xf32ac5[_0x38ed('0x33')],qs[_0x38ed('0x38')](_0x2d5193[_0x38ed('0x34')][_0x38ed('0x38')]));_0x37c5f7['attributes']=_0x37c5f7[_0x38ed('0x39')][_0x38ed('0x4a')]?_0x37c5f7[_0x38ed('0x39')]:_0xf32ac5[_0x38ed('0x33')];if(_0x2d5193[_0x38ed('0x34')][_0x38ed('0x4b')]){_0x37c5f7[_0x38ed('0x44')]=[{'all':!![]}];}_0x37c5f7=_[_0x38ed('0x40')]({},_0x37c5f7,_0x2d5193[_0x38ed('0x42')]);return db[_0x38ed('0x43')][_0x38ed('0x4c')](_0x37c5f7)[_0x38ed('0x29')](handleEntityNotFound(_0x590873,null))[_0x38ed('0x29')](respondWithResult(_0x590873,null))['catch'](handleError(_0x590873,null));};exports['create']=function(_0x3b1f16,_0x224e25){return db[_0x38ed('0x43')]['create'](_0x3b1f16[_0x38ed('0x4d')],{})['then'](respondWithResult(_0x224e25,0xc9))['catch'](handleError(_0x224e25,null));};exports[_0x38ed('0x28')]=function(_0x1acdbe,_0x925f04){if(_0x1acdbe[_0x38ed('0x4d')]['id']){delete _0x1acdbe['body']['id'];}return db['OpenchannelApplication']['find']({'where':{'id':_0x1acdbe[_0x38ed('0x4e')]['id']}})[_0x38ed('0x29')](handleEntityNotFound(_0x925f04,null))['then'](saveUpdates(_0x1acdbe[_0x38ed('0x4d')],null))[_0x38ed('0x29')](respondWithResult(_0x925f04,null))[_0x38ed('0x47')](handleError(_0x925f04,null));};exports['destroy']=function(_0x7861db,_0x4da615){return db[_0x38ed('0x43')][_0x38ed('0x4c')]({'where':{'id':_0x7861db[_0x38ed('0x4e')]['id']}})[_0x38ed('0x29')](handleEntityNotFound(_0x4da615,null))['then'](removeEntity(_0x4da615,null))[_0x38ed('0x47')](handleError(_0x4da615,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 437188d..47390a0 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 _0x3bcc=['util','../../config/logger','moment','rimraf','../../config/environment','./openchannelApplication.attributes','exports','define','OpenchannelApplication','openchannel_applications','utf8mb4_unicode_ci','lodash'];(function(_0xb3fe4b,_0x1bde5c){var _0x42027f=function(_0x25edf5){while(--_0x25edf5){_0xb3fe4b['push'](_0xb3fe4b['shift']());}};_0x42027f(++_0x1bde5c);}(_0x3bcc,0x17f));var _0xc3bc=function(_0x435313,_0x3efd28){_0x435313=_0x435313-0x0;var _0x3edbb5=_0x3bcc[_0x435313];return _0x3edbb5;};'use strict';var _=require(_0xc3bc('0x0'));var util=require(_0xc3bc('0x1'));var logger=require(_0xc3bc('0x2'))('api');var moment=require(_0xc3bc('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc3bc('0x4'));var config=require(_0xc3bc('0x5'));var attributes=require(_0xc3bc('0x6'));module[_0xc3bc('0x7')]=function(_0x4ce08e,_0x257a57){return _0x4ce08e[_0xc3bc('0x8')](_0xc3bc('0x9'),attributes,{'tableName':_0xc3bc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xc3bc('0xb')});}; \ No newline at end of file +var _0xb5c6=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./openchannelApplication.attributes','define','OpenchannelApplication','utf8mb4','utf8mb4_unicode_ci'];(function(_0x185011,_0x58149f){var _0x43ab43=function(_0x49336c){while(--_0x49336c){_0x185011['push'](_0x185011['shift']());}};_0x43ab43(++_0x58149f);}(_0xb5c6,0x12c));var _0x6b5c=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xb5c6[_0x501510];return _0x1e6ee5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6b5c('0x0'))(_0x6b5c('0x1'));var moment=require(_0x6b5c('0x2'));var BPromise=require(_0x6b5c('0x3'));var rp=require(_0x6b5c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6b5c('0x5'));var config=require(_0x6b5c('0x6'));var attributes=require(_0x6b5c('0x7'));module['exports']=function(_0x43ac68,_0x19ee84){return _0x43ac68[_0x6b5c('0x8')](_0x6b5c('0x9'),attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6b5c('0xa'),'collate':_0x6b5c('0xb')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 1b8a3f6..d332e46 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 _0x69fb=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','error','code','message','catch','UpdateOpenchannelApplication','OpenchannelApplication','options','raw','where','attributes','stringify'];(function(_0x30027a,_0x11545f){var _0x3b9f5e=function(_0x361da4){while(--_0x361da4){_0x30027a['push'](_0x30027a['shift']());}};_0x3b9f5e(++_0x11545f);}(_0x69fb,0xcb));var _0xb69f=function(_0x31d217,_0xa38636){_0x31d217=_0x31d217-0x0;var _0x3eaacb=_0x69fb[_0x31d217];return _0x3eaacb;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb69f('0x0'));var BPromise=require(_0xb69f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb69f('0x2'));var db=require(_0xb69f('0x3'))['db'];var utils=require(_0xb69f('0x4'));var logger=require(_0xb69f('0x5'))(_0xb69f('0x6'));var config=require(_0xb69f('0x7'));var jayson=require(_0xb69f('0x8'));var client=jayson[_0xb69f('0x9')][_0xb69f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x446221,_0x262311,_0x547ed6){return new BPromise(function(_0x14c8c8,_0x2578f3){return client[_0xb69f('0xb')](_0x446221,_0x547ed6)[_0xb69f('0xc')](function(_0x4af52c){logger[_0xb69f('0xd')](_0xb69f('0xe'),_0x262311,_0xb69f('0xf'));logger[_0xb69f('0x10')](_0xb69f('0x11'),_0x262311,_0xb69f('0xf'),JSON['stringify'](_0x4af52c));if(_0x4af52c[_0xb69f('0x12')]){if(_0x4af52c['error'][_0xb69f('0x13')]===0x1f4){logger[_0xb69f('0x12')](_0xb69f('0xe'),_0x262311,_0x4af52c[_0xb69f('0x12')][_0xb69f('0x14')]);return _0x2578f3(_0x4af52c['error'][_0xb69f('0x14')]);}logger[_0xb69f('0x12')](_0xb69f('0xe'),_0x262311,_0x4af52c['error'][_0xb69f('0x14')]);return _0x14c8c8(_0x4af52c[_0xb69f('0x12')][_0xb69f('0x14')]);}else{logger['info'](_0xb69f('0xe'),_0x262311,'request\x20sent');_0x14c8c8(_0x4af52c['result'][_0xb69f('0x14')]);}})[_0xb69f('0x15')](function(_0x390959){logger['error']('OpenchannelApplication,\x20%s,\x20%s',_0x262311,_0x390959);_0x2578f3(_0x390959);});});}exports[_0xb69f('0x16')]=function(_0x3aecbb){var _0x5f5523=this;return new Promise(function(_0x2df7ee,_0x5bc67c){return db[_0xb69f('0x17')]['update'](_0x3aecbb['body'],{'raw':_0x3aecbb['options']?_0x3aecbb[_0xb69f('0x18')][_0xb69f('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3aecbb[_0xb69f('0x18')]?_0x3aecbb[_0xb69f('0x18')][_0xb69f('0x1a')]||null:null,'attributes':_0x3aecbb[_0xb69f('0x18')]?_0x3aecbb[_0xb69f('0x18')][_0xb69f('0x1b')]||null:null,'limit':_0x3aecbb[_0xb69f('0x18')]?_0x3aecbb[_0xb69f('0x18')]['limit']||null:null})[_0xb69f('0xc')](function(_0x49190f){logger[_0xb69f('0xd')]('UpdateOpenchannelApplication',_0x3aecbb);logger[_0xb69f('0x10')](_0xb69f('0x16'),_0x3aecbb,JSON[_0xb69f('0x1c')](_0x49190f));_0x2df7ee(_0x49190f);})[_0xb69f('0x15')](function(_0x25c03f){logger[_0xb69f('0x12')](_0xb69f('0x16'),_0x25c03f['message'],_0x3aecbb);_0x5bc67c(_0x5f5523[_0xb69f('0x12')](0x1f4,_0x25c03f['message']));});});}; \ No newline at end of file +var _0x754e=['attributes','limit','then','debug','catch','lodash','util','moment','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','where'];(function(_0x1d0f9d,_0x181f71){var _0x4678a5=function(_0x1aaef0){while(--_0x1aaef0){_0x1d0f9d['push'](_0x1d0f9d['shift']());}};_0x4678a5(++_0x181f71);}(_0x754e,0x155));var _0xe754=function(_0x3f3934,_0x19c886){_0x3f3934=_0x3f3934-0x0;var _0x26c553=_0x754e[_0x3f3934];return _0x26c553;};'use strict';var _=require(_0xe754('0x0'));var util=require(_0xe754('0x1'));var moment=require(_0xe754('0x2'));var BPromise=require('bluebird');var rs=require(_0xe754('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe754('0x4'));var logger=require('../../config/logger')(_0xe754('0x5'));var config=require(_0xe754('0x6'));var jayson=require(_0xe754('0x7'));var client=jayson[_0xe754('0x8')][_0xe754('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1a8d35,_0x568b17,_0x296467){return new BPromise(function(_0x56d10d,_0x5c2218){return client[_0xe754('0xa')](_0x1a8d35,_0x296467)['then'](function(_0x243aa2){logger['info'](_0xe754('0xb'),_0x568b17,'request\x20sent');logger['debug']('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x568b17,_0xe754('0xc'),JSON[_0xe754('0xd')](_0x243aa2));if(_0x243aa2['error']){if(_0x243aa2['error'][_0xe754('0xe')]===0x1f4){logger['error']('OpenchannelApplication,\x20%s,\x20%s',_0x568b17,_0x243aa2[_0xe754('0xf')][_0xe754('0x10')]);return _0x5c2218(_0x243aa2[_0xe754('0xf')][_0xe754('0x10')]);}logger[_0xe754('0xf')](_0xe754('0xb'),_0x568b17,_0x243aa2[_0xe754('0xf')]['message']);return _0x56d10d(_0x243aa2['error']['message']);}else{logger['info'](_0xe754('0xb'),_0x568b17,_0xe754('0xc'));_0x56d10d(_0x243aa2['result']['message']);}})['catch'](function(_0x573c08){logger['error'](_0xe754('0xb'),_0x568b17,_0x573c08);_0x5c2218(_0x573c08);});});}exports[_0xe754('0x11')]=function(_0x2e737d){var _0x198698=this;return new Promise(function(_0x46c4b2,_0x4d64d4){return db[_0xe754('0x12')][_0xe754('0x13')](_0x2e737d[_0xe754('0x14')],{'raw':_0x2e737d['options']?_0x2e737d[_0xe754('0x15')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2e737d[_0xe754('0x15')]?_0x2e737d[_0xe754('0x15')][_0xe754('0x16')]||null:null,'attributes':_0x2e737d['options']?_0x2e737d[_0xe754('0x15')][_0xe754('0x17')]||null:null,'limit':_0x2e737d[_0xe754('0x15')]?_0x2e737d['options'][_0xe754('0x18')]||null:null})[_0xe754('0x19')](function(_0x1c143b){logger['info'](_0xe754('0x11'),_0x2e737d);logger[_0xe754('0x1a')](_0xe754('0x11'),_0x2e737d,JSON[_0xe754('0xd')](_0x1c143b));_0x46c4b2(_0x1c143b);})[_0xe754('0x1b')](function(_0x3d5042){logger[_0xe754('0xf')]('UpdateOpenchannelApplication',_0x3d5042[_0xe754('0x10')],_0x2e737d);_0x4d64d4(_0x198698['error'](0x1f4,_0x3d5042['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 01726b5..6889bcc 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 _0xfe37=['getMessages','/:id/download','create','post','addMessage','/:id/tags','tracked','openchannel','addTags','delete','removeTags','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','describe','/:id','show','/:id/messages'];(function(_0xf2682d,_0x48f012){var _0x53dea0=function(_0x47235e){while(--_0x47235e){_0xf2682d['push'](_0xf2682d['shift']());}};_0x53dea0(++_0x48f012);}(_0xfe37,0x12e));var _0x7fe3=function(_0xa62e73,_0x283a9e){_0xa62e73=_0xa62e73-0x0;var _0x58687d=_0xfe37[_0xa62e73];return _0x58687d;};'use strict';var multer=require(_0x7fe3('0x0'));var util=require(_0x7fe3('0x1'));var path=require('path');var timeout=require(_0x7fe3('0x2'));var express=require(_0x7fe3('0x3'));var router=express[_0x7fe3('0x4')]();var fs_extra=require(_0x7fe3('0x5'));var auth=require(_0x7fe3('0x6'));var interaction=require(_0x7fe3('0x7'));var config=require(_0x7fe3('0x8'));var controller=require(_0x7fe3('0x9'));router[_0x7fe3('0xa')]('/',auth[_0x7fe3('0xb')](),controller[_0x7fe3('0xc')]);router[_0x7fe3('0xa')]('/describe',auth[_0x7fe3('0xb')](),controller[_0x7fe3('0xd')]);router[_0x7fe3('0xa')](_0x7fe3('0xe'),auth[_0x7fe3('0xb')](),controller[_0x7fe3('0xf')]);router[_0x7fe3('0xa')](_0x7fe3('0x10'),auth[_0x7fe3('0xb')](),controller[_0x7fe3('0x11')]);router['get'](_0x7fe3('0x12'),auth['isAuthenticated'](),controller['download']);router['post']('/',auth[_0x7fe3('0xb')](),controller[_0x7fe3('0x13')]);router[_0x7fe3('0x14')](_0x7fe3('0x10'),auth[_0x7fe3('0xb')](),controller[_0x7fe3('0x15')]);router[_0x7fe3('0x14')](_0x7fe3('0x16'),auth[_0x7fe3('0xb')](),interaction[_0x7fe3('0x17')](_0x7fe3('0x18'),'openchannelinteraction:addtags'),controller[_0x7fe3('0x19')]);router['put'](_0x7fe3('0xe'),auth[_0x7fe3('0xb')](),interaction[_0x7fe3('0x17')](_0x7fe3('0x18'),'openchannelinteraction:update'),controller['update']);router[_0x7fe3('0x1a')]('/:id',auth[_0x7fe3('0xb')](),interaction[_0x7fe3('0x17')](_0x7fe3('0x18'),'openchannelinteraction:destroy'),controller['destroy']);router[_0x7fe3('0x1a')](_0x7fe3('0x16'),auth[_0x7fe3('0xb')](),controller[_0x7fe3('0x1b')]);module[_0x7fe3('0x1c')]=router; \ No newline at end of file +var _0x759c=['get','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','openchannelinteraction:addtags','tracked','openchannel','openchannelinteraction:update','delete','openchannelinteraction:destroy','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller'];(function(_0x2e2eb7,_0x1a7b54){var _0x42b073=function(_0x4a05ae){while(--_0x4a05ae){_0x2e2eb7['push'](_0x2e2eb7['shift']());}};_0x42b073(++_0x1a7b54);}(_0x759c,0xb0));var _0xc759=function(_0x240d5b,_0x2ed984){_0x240d5b=_0x240d5b-0x0;var _0x599466=_0x759c[_0x240d5b];return _0x599466;};'use strict';var multer=require(_0xc759('0x0'));var util=require(_0xc759('0x1'));var path=require(_0xc759('0x2'));var timeout=require('connect-timeout');var express=require(_0xc759('0x3'));var router=express[_0xc759('0x4')]();var fs_extra=require(_0xc759('0x5'));var auth=require(_0xc759('0x6'));var interaction=require(_0xc759('0x7'));var config=require(_0xc759('0x8'));var controller=require(_0xc759('0x9'));router[_0xc759('0xa')]('/',auth[_0xc759('0xb')](),controller['index']);router[_0xc759('0xa')]('/describe',auth[_0xc759('0xb')](),controller[_0xc759('0xc')]);router[_0xc759('0xa')](_0xc759('0xd'),auth['isAuthenticated'](),controller[_0xc759('0xe')]);router[_0xc759('0xa')](_0xc759('0xf'),auth[_0xc759('0xb')](),controller[_0xc759('0x10')]);router[_0xc759('0xa')](_0xc759('0x11'),auth[_0xc759('0xb')](),controller[_0xc759('0x12')]);router[_0xc759('0x13')]('/',auth[_0xc759('0xb')](),controller[_0xc759('0x14')]);router[_0xc759('0x13')]('/:id/messages',auth[_0xc759('0xb')](),controller[_0xc759('0x15')]);router[_0xc759('0x13')](_0xc759('0x16'),auth[_0xc759('0xb')](),interaction['tracked']('openchannel',_0xc759('0x17')),controller['addTags']);router['put'](_0xc759('0xd'),auth[_0xc759('0xb')](),interaction[_0xc759('0x18')](_0xc759('0x19'),_0xc759('0x1a')),controller['update']);router[_0xc759('0x1b')]('/:id',auth[_0xc759('0xb')](),interaction['tracked'](_0xc759('0x19'),_0xc759('0x1c')),controller[_0xc759('0x1d')]);router[_0xc759('0x1b')](_0xc759('0x16'),auth['isAuthenticated'](),controller['removeTags']);module[_0xc759('0x1e')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index eb9a750..da6df48 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 _0xe3d4=['ENUM','INTEGER','exports','BOOLEAN','DATE','STRING','out'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xe3d4,0xc6));var _0x4e3d=function(_0xa62163,_0x4a26fb){_0xa62163=_0xa62163-0x0;var _0x46b4fb=_0xe3d4[_0xa62163];return _0x46b4fb;};'use strict';var Sequelize=require('sequelize');module[_0x4e3d('0x0')]={'closed':{'type':Sequelize[_0x4e3d('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x4e3d('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x4e3d('0x3')]},'thirdDisposition':{'type':Sequelize[_0x4e3d('0x3')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x4e3d('0x2')]},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0x4e3d('0x3')]},'lastMsgAt':{'type':Sequelize[_0x4e3d('0x2')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x4e3d('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0x4e3d('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x4e3d('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0x4e3d('0x1')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x4e3d('0x6')]}}; \ No newline at end of file +var _0x9db7=['exports','BOOLEAN','DATE','STRING','ENUM','out','INTEGER','sequelize'];(function(_0x9ac2d9,_0x1a1366){var _0x2abdba=function(_0x2f0ed){while(--_0x2f0ed){_0x9ac2d9['push'](_0x9ac2d9['shift']());}};_0x2abdba(++_0x1a1366);}(_0x9db7,0x1bf));var _0x79db=function(_0x1959e5,_0x3d7496){_0x1959e5=_0x1959e5-0x0;var _0x1189a2=_0x9db7[_0x1959e5];return _0x1189a2;};'use strict';var Sequelize=require(_0x79db('0x0'));module[_0x79db('0x1')]={'closed':{'type':Sequelize[_0x79db('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x79db('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x79db('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x79db('0x4')]},'read1stAt':{'type':Sequelize[_0x79db('0x3')]},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0x79db('0x4')]},'lastMsgAt':{'type':Sequelize[_0x79db('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x79db('0x5')]('in',_0x79db('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0x79db('0x5')]('in',_0x79db('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x79db('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0x79db('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x79db('0x7')]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 41a78b2..7090c62 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 _0x1fcc=['Account','mkdirSync','Openchannel','Owner','createdAt','closedAt','disposition','threadId','Public','Private','basename','existsSync','createReadStream','pipe','System','out','value','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','rimraf','util','path','ejs','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','end','status','offset','undefined','count','set','Content-Range','json','update','then','destroy','error','index','map','OpenchannelInteraction','rawAttributes','fieldName','type','key','findAll','openchannel','query','user','show','from','model','keys','filters','intersection','fields','attributes','length','includeAll','include','find','create','body','catch','params','describe','addMessage','OpenchannelMessage','omit','ids','getMessages','hasOwnProperty','nolimit','limit','order','sort','where','pick','OpenchannelInteractionId','filter','merge','$gte','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','spread','Tag','name','color','emit','openchannelInteractionTags:save','removeTags','download','unix','toString','join','root','server','tmp','files','attachments','transcript-%d-%s.zip','push','User','fullname','CmContact','Contact','firstName','lastName','Attachment','Messages','direction','secret','read','OpenchannelAccount'];(function(_0x397326,_0x43fc7b){var _0x1e7764=function(_0x1dc328){while(--_0x1dc328){_0x397326['push'](_0x397326['shift']());}};_0x1e7764(++_0x43fc7b);}(_0x1fcc,0x99));var _0xc1fc=function(_0x2b5513,_0x3fe5cd){_0x2b5513=_0x2b5513-0x0;var _0x578fd2=_0x1fcc[_0x2b5513];return _0x578fd2;};'use strict';var rimraf=require(_0xc1fc('0x0'));var zipdir=require('zip-dir');var moment=require('moment');var util=require(_0xc1fc('0x1'));var path=require(_0xc1fc('0x2'));var ejs=require(_0xc1fc('0x3'));var fs=require('fs');var _=require(_0xc1fc('0x4'));var Redis=require(_0xc1fc('0x5'));var interaction=require('../../components/interaction/service');var qs=require(_0xc1fc('0x6'));var pdf=require('../../components/export/pdf');var logger=require(_0xc1fc('0x7'))(_0xc1fc('0x8'));var config=require(_0xc1fc('0x9'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0xc1fc('0xa')],{'host':_0xc1fc('0xb'),'port':0x18eb});var socket=require(_0xc1fc('0xc'))(new Redis(config[_0xc1fc('0xa')]));require(_0xc1fc('0xd'))[_0xc1fc('0xe')](socket);function respondWithStatusCode(_0x118fc3,_0x4ad1f6){_0x4ad1f6=_0x4ad1f6||0xcc;return function(_0x20ac81){if(_0x20ac81){return _0x118fc3[_0xc1fc('0xf')](_0x4ad1f6);}return _0x118fc3['status'](_0x4ad1f6)[_0xc1fc('0x10')]();};}function respondWithResult(_0x169dfe,_0x5afc4f){_0x5afc4f=_0x5afc4f||0xc8;return function(_0x3e5b6f){if(_0x3e5b6f){return _0x169dfe[_0xc1fc('0x11')](_0x5afc4f)['json'](_0x3e5b6f);}};}function respondWithFilteredResult(_0x5e4bb5,_0x5bb46d){return function(_0x53e753){if(_0x53e753){var _0x7b06a0=typeof _0x5bb46d[_0xc1fc('0x12')]===_0xc1fc('0x13')&&typeof _0x5bb46d['limit']===_0xc1fc('0x13');var _0x7573cc=_0x53e753[_0xc1fc('0x14')];var _0x3712ac=_0x7b06a0?0x0:_0x5bb46d['offset'];var _0x71ba01=_0x7b06a0?_0x53e753[_0xc1fc('0x14')]:_0x5bb46d[_0xc1fc('0x12')]+_0x5bb46d['limit'];var _0x4f5136;if(_0x71ba01>=_0x7573cc){_0x71ba01=_0x7573cc;_0x4f5136=0xc8;}else{_0x4f5136=0xce;}_0x5e4bb5['status'](_0x4f5136);return _0x5e4bb5[_0xc1fc('0x15')](_0xc1fc('0x16'),_0x3712ac+'-'+_0x71ba01+'/'+_0x7573cc)[_0xc1fc('0x17')](_0x53e753);}return null;};}function saveUpdates(_0x11cb32){return function(_0x517b2f){if(_0x517b2f){return _0x517b2f[_0xc1fc('0x18')](_0x11cb32)[_0xc1fc('0x19')](function(_0x5161a5){return _0x5161a5;});}return null;};}function removeEntity(_0x118d90){return function(_0x5ab9cc){if(_0x5ab9cc){return _0x5ab9cc[_0xc1fc('0x1a')]()[_0xc1fc('0x19')](function(){_0x118d90[_0xc1fc('0x11')](0xcc)[_0xc1fc('0x10')]();});}};}function handleEntityNotFound(_0x1e77a7){return function(_0x4e7d15){if(!_0x4e7d15){_0x1e77a7[_0xc1fc('0xf')](0x194);}return _0x4e7d15;};}function handleError(_0x29fa20,_0x566eed){_0x566eed=_0x566eed||0x1f4;return function(_0x20fe7c){logger[_0xc1fc('0x1b')](_0x20fe7c['stack']);if(_0x20fe7c['name']){delete _0x20fe7c['name'];}_0x29fa20[_0xc1fc('0x11')](_0x566eed)['send'](_0x20fe7c);};}exports[_0xc1fc('0x1c')]=function(_0x58a00f,_0x41bbd3){var _0x284d8a={};var _0x4acbda=_[_0xc1fc('0x1d')](db[_0xc1fc('0x1e')][_0xc1fc('0x1f')],function(_0x58eb16){return{'name':_0x58eb16[_0xc1fc('0x20')],'type':_0x58eb16[_0xc1fc('0x21')][_0xc1fc('0x22')]};});_0x284d8a=qs['getOptions'](_0x4acbda,_0x58a00f);return interaction[_0xc1fc('0x23')](_0xc1fc('0x24'),_0x58a00f[_0xc1fc('0x25')],_0x58a00f[_0xc1fc('0x26')],_0x284d8a,_0x4acbda)[_0xc1fc('0x19')](respondWithFilteredResult(_0x41bbd3,_0x284d8a))['catch'](handleError(_0x41bbd3,null));};exports[_0xc1fc('0x27')]=function(_0x4b98c1,_0x534198){var _0x4f44db={};if(_0x4b98c1['query'][_0xc1fc('0x21')]&&_0x4b98c1[_0xc1fc('0x25')][_0xc1fc('0x21')]===_0xc1fc('0x28')){_0x4f44db[_0xc1fc('0x28')]=_0x4b98c1['params']['id'];}else{_0x4f44db['id']=_0x4b98c1['params']['id'];}var _0x319e03={'raw':![],'where':_0x4f44db},_0x5e0a8b={};_0x5e0a8b[_0xc1fc('0x29')]=_[_0xc1fc('0x2a')](db['OpenchannelInteraction'][_0xc1fc('0x1f')]);_0x5e0a8b[_0xc1fc('0x25')]=_[_0xc1fc('0x2a')](_0x4b98c1[_0xc1fc('0x25')]);_0x5e0a8b[_0xc1fc('0x2b')]=_[_0xc1fc('0x2c')](_0x5e0a8b[_0xc1fc('0x29')],_0x5e0a8b[_0xc1fc('0x25')]);_0x319e03['attributes']=_[_0xc1fc('0x2c')](_0x5e0a8b[_0xc1fc('0x29')],qs['fields'](_0x4b98c1[_0xc1fc('0x25')][_0xc1fc('0x2d')]));_0x319e03['attributes']=_0x319e03[_0xc1fc('0x2e')][_0xc1fc('0x2f')]?_0x319e03[_0xc1fc('0x2e')]:_0x5e0a8b[_0xc1fc('0x29')];if(_0x4b98c1[_0xc1fc('0x25')][_0xc1fc('0x30')]){_0x319e03[_0xc1fc('0x31')]=[{'all':!![]}];}_0x319e03=_['merge']({},_0x319e03,_0x4b98c1['options']);return db[_0xc1fc('0x1e')][_0xc1fc('0x32')](_0x319e03)[_0xc1fc('0x19')](handleEntityNotFound(_0x534198,null))[_0xc1fc('0x19')](respondWithResult(_0x534198,null))['catch'](handleError(_0x534198,null));};exports[_0xc1fc('0x33')]=function(_0x4aeaaf,_0x3c88b7){return db[_0xc1fc('0x1e')]['create'](_0x4aeaaf[_0xc1fc('0x34')],{})[_0xc1fc('0x19')](respondWithResult(_0x3c88b7,0xc9))[_0xc1fc('0x35')](handleError(_0x3c88b7,null));};exports[_0xc1fc('0x18')]=function(_0x267634,_0x7d9210){if(_0x267634['body']['id']){delete _0x267634[_0xc1fc('0x34')]['id'];}return db['OpenchannelInteraction'][_0xc1fc('0x32')]({'where':{'id':_0x267634['params']['id']}})[_0xc1fc('0x19')](handleEntityNotFound(_0x7d9210,null))['then'](saveUpdates(_0x267634[_0xc1fc('0x34')],null))[_0xc1fc('0x19')](respondWithResult(_0x7d9210,null))[_0xc1fc('0x35')](handleError(_0x7d9210,null));};exports[_0xc1fc('0x1a')]=function(_0x4f8fe5,_0x473501){return db[_0xc1fc('0x1e')][_0xc1fc('0x32')]({'where':{'id':_0x4f8fe5[_0xc1fc('0x36')]['id']}})[_0xc1fc('0x19')](handleEntityNotFound(_0x473501,null))[_0xc1fc('0x19')](removeEntity(_0x473501,null))['catch'](handleError(_0x473501,null));};exports[_0xc1fc('0x37')]=function(_0x1e5e43,_0x50f3bd){return db[_0xc1fc('0x1e')][_0xc1fc('0x37')]()[_0xc1fc('0x19')](respondWithResult(_0x50f3bd,null))[_0xc1fc('0x35')](handleError(_0x50f3bd,null));};exports[_0xc1fc('0x38')]=function(_0x533178,_0x8a1a9f){return db[_0xc1fc('0x39')][_0xc1fc('0x32')]({'where':{'id':_0x533178[_0xc1fc('0x36')]['id']}})[_0xc1fc('0x19')](handleEntityNotFound(_0x8a1a9f,null))['then'](function(_0x589245){if(_0x589245){return _0x589245[_0xc1fc('0x38')](_0x533178[_0xc1fc('0x34')]['ids'],_[_0xc1fc('0x3a')](_0x533178[_0xc1fc('0x34')],[_0xc1fc('0x3b'),'id'])||{});}})[_0xc1fc('0x19')](respondWithResult(_0x8a1a9f,null))['catch'](handleError(_0x8a1a9f,null));};exports[_0xc1fc('0x3c')]=function(_0x13198e,_0x1cecf4){var _0x4db7cf={'raw':![],'where':{}};var _0x16aa21={};var _0x382f91={'count':0x0,'rows':[]};return db[_0xc1fc('0x1e')]['findOne']({'where':{'id':_0x13198e[_0xc1fc('0x36')]['id']}})['then'](handleEntityNotFound(_0x1cecf4,null))[_0xc1fc('0x19')](function(_0xf3798b){if(_0xf3798b){_0x16aa21[_0xc1fc('0x29')]=_[_0xc1fc('0x2a')](db[_0xc1fc('0x39')][_0xc1fc('0x1f')]);_0x16aa21[_0xc1fc('0x25')]=_[_0xc1fc('0x2a')](_0x13198e['query']);_0x16aa21['filters']=_[_0xc1fc('0x2c')](_0x16aa21[_0xc1fc('0x29')],_0x16aa21[_0xc1fc('0x25')]);_0x4db7cf[_0xc1fc('0x2e')]=_[_0xc1fc('0x2c')](_0x16aa21[_0xc1fc('0x29')],qs[_0xc1fc('0x2d')](_0x13198e[_0xc1fc('0x25')][_0xc1fc('0x2d')]));_0x4db7cf['attributes']=_0x4db7cf[_0xc1fc('0x2e')][_0xc1fc('0x2f')]?_0x4db7cf[_0xc1fc('0x2e')]:_0x16aa21['model'];if(!_0x13198e[_0xc1fc('0x25')][_0xc1fc('0x3d')](_0xc1fc('0x3e'))){_0x4db7cf[_0xc1fc('0x3f')]=qs[_0xc1fc('0x3f')](_0x13198e[_0xc1fc('0x25')][_0xc1fc('0x3f')]);_0x4db7cf[_0xc1fc('0x12')]=qs[_0xc1fc('0x12')](_0x13198e[_0xc1fc('0x25')][_0xc1fc('0x12')]);}_0x4db7cf[_0xc1fc('0x40')]=qs['sort'](_0x13198e[_0xc1fc('0x25')][_0xc1fc('0x41')]);_0x4db7cf[_0xc1fc('0x42')]=qs['filters'](_[_0xc1fc('0x43')](_0x13198e[_0xc1fc('0x25')],_0x16aa21['filters']));_0x4db7cf[_0xc1fc('0x42')][_0xc1fc('0x44')]=_0xf3798b['id'];if(_0x13198e[_0xc1fc('0x25')][_0xc1fc('0x45')]){_0x4db7cf[_0xc1fc('0x42')]=_[_0xc1fc('0x46')](_0x4db7cf['where'],{'$or':_[_0xc1fc('0x1d')](_0x4db7cf[_0xc1fc('0x2e')],function(_0x1bf33c){var _0x36b364={};_0x36b364[_0x1bf33c]={'$like':'%'+_0x13198e['query'][_0xc1fc('0x45')]+'%'};return _0x36b364;})});}if(_0x13198e['query'][_0xc1fc('0x47')]){var _0x4cd169=_0x13198e['query']['$gte']['split'](',');var _0x3f00a5={};_0x3f00a5[_0x4cd169[0x0]]={'$gte':moment(_0x4cd169[0x1])[_0xc1fc('0x48')](_0xc1fc('0x49'))};_0x4db7cf['where']=_[_0xc1fc('0x46')](_0x4db7cf['where'],_0x3f00a5);}_0x4db7cf=_[_0xc1fc('0x46')]({},_0x4db7cf,_0x13198e['options']);return db[_0xc1fc('0x39')][_0xc1fc('0x14')]({'where':_0x4db7cf[_0xc1fc('0x42')]})[_0xc1fc('0x19')](function(_0x15e819){_0x382f91[_0xc1fc('0x14')]=_0x15e819;if(_0x13198e['query'][_0xc1fc('0x30')]){_0x4db7cf[_0xc1fc('0x31')]=[{'all':!![]}];}return db[_0xc1fc('0x39')][_0xc1fc('0x23')](_0x4db7cf);})[_0xc1fc('0x19')](function(_0x1e59ae){_0x382f91[_0xc1fc('0x4a')]=_0x1e59ae;return _0x382f91;});}})[_0xc1fc('0x19')](respondWithFilteredResult(_0x1cecf4,_0x4db7cf))[_0xc1fc('0x35')](handleError(_0x1cecf4,null));};exports[_0xc1fc('0x4b')]=function(_0x1ef698,_0x1e8ad2){return db[_0xc1fc('0x1e')][_0xc1fc('0x32')]({'where':{'id':_0x1ef698[_0xc1fc('0x36')]['id']}})[_0xc1fc('0x19')](handleEntityNotFound(_0x1e8ad2,null))['then'](function(_0x3f9c38){if(_0x3f9c38){return _0x3f9c38[_0xc1fc('0x4c')](_0x1ef698[_0xc1fc('0x34')][_0xc1fc('0x3b')],_[_0xc1fc('0x3a')](_0x1ef698['body'],[_0xc1fc('0x3b'),'id'])||{})[_0xc1fc('0x4d')](function(){return db[_0xc1fc('0x4e')][_0xc1fc('0x23')]({'attributes':['id',_0xc1fc('0x4f'),_0xc1fc('0x50')],'where':{'id':_0x1ef698[_0xc1fc('0x34')]['ids']}});})[_0xc1fc('0x19')](function(_0x38fc31){socket[_0xc1fc('0x51')](_0xc1fc('0x52'),{'id':Number(_0x1ef698['params']['id']),'tags':_0x38fc31||[]});return{'id':Number(_0x1ef698[_0xc1fc('0x36')]['id']),'tags':_0x38fc31||[]};});}})[_0xc1fc('0x19')](respondWithResult(_0x1e8ad2,null))[_0xc1fc('0x35')](handleError(_0x1e8ad2,null));};exports['removeTags']=function(_0x5bcdd1,_0x328ddc){return db[_0xc1fc('0x1e')][_0xc1fc('0x32')]({'where':{'id':_0x5bcdd1['params']['id']}})[_0xc1fc('0x19')](handleEntityNotFound(_0x328ddc,null))[_0xc1fc('0x19')](function(_0x5778ab){if(_0x5778ab){return _0x5778ab[_0xc1fc('0x53')](_0x5bcdd1[_0xc1fc('0x25')][_0xc1fc('0x3b')]);}})[_0xc1fc('0x19')](respondWithStatusCode(_0x328ddc,null))[_0xc1fc('0x35')](handleError(_0x328ddc,null));};exports[_0xc1fc('0x54')]=function(_0x15d63d,_0xc5052b){var _0x4e9e33=moment()[_0xc1fc('0x55')]()[_0xc1fc('0x56')]();var _0x4f4fe5=path[_0xc1fc('0x57')](config[_0xc1fc('0x58')],_0xc1fc('0x59'),'files',_0xc1fc('0x5a'));var _0x3de0bb=path[_0xc1fc('0x57')](config[_0xc1fc('0x58')],_0xc1fc('0x59'),_0xc1fc('0x5b'),_0xc1fc('0x5c'));var _0x5d34a7=path[_0xc1fc('0x57')](_0x4f4fe5,_0x4e9e33);var _0x5995d7=util['format'](_0xc1fc('0x5d'),_0x15d63d['params']['id'],_0x4e9e33);var _0x2efbde=path['join'](_0x4f4fe5,_0x5995d7);var _0x2f1665=[];_0x2f1665[_0xc1fc('0x5e')]({'model':db[_0xc1fc('0x5f')],'as':_0xc1fc('0x5f'),'attributes':['id',_0xc1fc('0x60')],'raw':!![]});_0x2f1665[_0xc1fc('0x5e')]({'model':db[_0xc1fc('0x61')],'as':_0xc1fc('0x62'),'attributes':['id',_0xc1fc('0x63'),_0xc1fc('0x64')],'raw':!![]});if(_0x15d63d[_0xc1fc('0x25')]['attachments']){_0x2f1665[_0xc1fc('0x5e')]({'model':db[_0xc1fc('0x65')],'as':_0xc1fc('0x65'),'raw':!![]});}var _0x10ffc7=[{'model':db[_0xc1fc('0x39')],'as':_0xc1fc('0x66'),'attributes':['id',_0xc1fc('0x34'),'createdAt',_0xc1fc('0x67'),_0xc1fc('0x68'),_0xc1fc('0x69')],'include':_0x2f1665}];_0x10ffc7[_0xc1fc('0x5e')]({'model':db[_0xc1fc('0x6a')],'as':_0xc1fc('0x6b'),'attributes':['id',_0xc1fc('0x4f')]});_0x10ffc7[_0xc1fc('0x5e')]({'model':db['User'],'as':'Owner','attributes':['id',_0xc1fc('0x60')]});return db[_0xc1fc('0x1e')][_0xc1fc('0x32')]({'where':{'id':_0x15d63d[_0xc1fc('0x36')]['id']},'include':_0x10ffc7})[_0xc1fc('0x19')](handleEntityNotFound(_0xc5052b,null))[_0xc1fc('0x19')](function(_0x4b8273){if(_0x4b8273){var _0x31ad07=_0x4b8273['get']({'plain':!![]});fs[_0xc1fc('0x6c')](_0x5d34a7);var _0x6a3da8={'channel':_0xc1fc('0x6d'),'account':_0x31ad07['Account'][_0xc1fc('0x4f')],'agent':_0x31ad07[_0xc1fc('0x6e')]?_0x31ad07[_0xc1fc('0x6e')][_0xc1fc('0x60')]:'N.A.','createdAt':moment(_0x31ad07[_0xc1fc('0x6f')])[_0xc1fc('0x48')](_0xc1fc('0x49'))['toString'](),'closedAt':_0x31ad07['closed']?moment(_0x31ad07[_0xc1fc('0x70')])[_0xc1fc('0x48')](_0xc1fc('0x49'))[_0xc1fc('0x56')]():'','disposition':_0x31ad07[_0xc1fc('0x71')],'visibility':_0x31ad07[_0xc1fc('0x72')]?_0xc1fc('0x73'):_0xc1fc('0x74'),'messages':_(_0x31ad07['Messages'])['filter']({'secret':![]})[_0xc1fc('0x1d')](function(_0x2f8d74){if(_0x2f8d74[_0xc1fc('0x65')]){var _0x190012=path['join'](_0x3de0bb,_0x2f8d74[_0xc1fc('0x65')][_0xc1fc('0x75')]);if(fs[_0xc1fc('0x76')](_0x190012)){fs[_0xc1fc('0x77')](_0x190012)[_0xc1fc('0x78')](fs['createWriteStream'](path['join'](_0x5d34a7,_0x2f8d74[_0xc1fc('0x65')]['basename'])));}}return{'date':moment(_0x2f8d74['createdAt'])[_0xc1fc('0x48')](_0xc1fc('0x49'))[_0xc1fc('0x56')](),'sender':_0x2f8d74[_0xc1fc('0x67')]==='out'?_0x2f8d74['User']?_0x2f8d74[_0xc1fc('0x5f')]['fullname']:_0xc1fc('0x79'):_0x2f8d74['Contact'][_0xc1fc('0x63')]+(_0x2f8d74[_0xc1fc('0x62')][_0xc1fc('0x64')]?'\x20'+_0x2f8d74[_0xc1fc('0x62')]['lastName']:''),'body':_0x2f8d74[_0xc1fc('0x65')]?_0x2f8d74[_0xc1fc('0x65')][_0xc1fc('0x75')]:_0x2f8d74['body'],'direction':_0x2f8d74[_0xc1fc('0x67')]===_0xc1fc('0x7a')?'A':'C','secret':_0x2f8d74[_0xc1fc('0x68')],'read':_0x2f8d74[_0xc1fc('0x69')],'attachment':_0x2f8d74[_0xc1fc('0x65')]};})[_0xc1fc('0x7b')]()};return ejs['renderFile'](path['join'](config[_0xc1fc('0x58')],_0xc1fc('0x59'),'views',_0xc1fc('0x7c')),{'interaction':_0x6a3da8})[_0xc1fc('0x19')](function(_0x359781){var _0x6648dd=path[_0xc1fc('0x57')](_0x5d34a7,_0xc1fc('0x7d')+_0x31ad07['id']+'-'+_0x4e9e33+_0xc1fc('0x7e'));var _0x1726b0={'path':_0x6648dd,'channel':'Openchannel','interactionId':_0x31ad07['id']};return pdf[_0xc1fc('0x7f')](_0x359781,_0x1726b0);})[_0xc1fc('0x19')](function(){return new Promise(function(_0x218d6d,_0x19b805){zipdir(_0x5d34a7,{'saveTo':_0x2efbde},function(_0x151c2d,_0x1c07dc){if(_0x151c2d)return _0x19b805(_0x151c2d);return _0x218d6d(_0x1c07dc);});})[_0xc1fc('0x19')](function(){return new Promise(function(_0x259f01,_0x22dc43){rimraf(_0x5d34a7,function(_0x3a6c1f){if(_0x3a6c1f)_0x22dc43(_0x3a6c1f);return _0x259f01();});});})[_0xc1fc('0x19')](function(){return _0xc5052b[_0xc1fc('0x54')](_0x2efbde,_0x5995d7,function(_0x43f5e6){if(_0x43f5e6){logger[_0xc1fc('0x1b')](_0xc1fc('0x80'),_0x43f5e6);}else{fs[_0xc1fc('0x81')](_0x2efbde);}});});});}else{return _0xc5052b[_0xc1fc('0xf')](0xc8);}})[_0xc1fc('0x35')](handleError(_0xc5052b,null));}; \ No newline at end of file +var _0x73ae=['existsSync','createReadStream','pipe','createWriteStream','System','out','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','rimraf','zip-dir','path','ejs','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/environment','redis','defaults','localhost','socket.io-emitter','end','json','offset','undefined','limit','count','status','set','then','destroy','sendStatus','error','stack','name','send','index','map','OpenchannelInteraction','rawAttributes','fieldName','type','key','getOptions','openchannel','query','user','catch','from','params','model','keys','filters','attributes','intersection','fields','length','includeAll','find','create','body','describe','addMessage','ids','omit','getMessages','findOne','OpenchannelMessage','hasOwnProperty','nolimit','sort','where','pick','OpenchannelInteractionId','filter','merge','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','options','include','findAll','rows','addTags','setTags','spread','color','emit','removeTags','download','unix','toString','join','root','server','files','attachments','transcript-%d-%s.zip','User','fullname','CmContact','Contact','firstName','lastName','push','Attachment','createdAt','direction','secret','read','OpenchannelAccount','get','mkdirSync','Openchannel','Account','Owner','N.A.','closed','closedAt','disposition','threadId','Public','basename'];(function(_0x18bd49,_0x29f0df){var _0x3ae5a9=function(_0xe48a02){while(--_0xe48a02){_0x18bd49['push'](_0x18bd49['shift']());}};_0x3ae5a9(++_0x29f0df);}(_0x73ae,0x112));var _0xe73a=function(_0x3ea913,_0x255df2){_0x3ea913=_0x3ea913-0x0;var _0x2b4f28=_0x73ae[_0x3ea913];return _0x2b4f28;};'use strict';var rimraf=require(_0xe73a('0x0'));var zipdir=require(_0xe73a('0x1'));var moment=require('moment');var util=require('util');var path=require(_0xe73a('0x2'));var ejs=require(_0xe73a('0x3'));var fs=require('fs');var _=require('lodash');var Redis=require(_0xe73a('0x4'));var interaction=require(_0xe73a('0x5'));var qs=require(_0xe73a('0x6'));var pdf=require(_0xe73a('0x7'));var logger=require('../../config/logger')('api');var config=require(_0xe73a('0x8'));var db=require('../../mysqldb')['db'];config[_0xe73a('0x9')]=_[_0xe73a('0xa')](config[_0xe73a('0x9')],{'host':_0xe73a('0xb'),'port':0x18eb});var socket=require(_0xe73a('0xc'))(new Redis(config[_0xe73a('0x9')]));require('./openchannelInteraction.socket')['register'](socket);function respondWithStatusCode(_0x50e3dc,_0x2b0998){_0x2b0998=_0x2b0998||0xcc;return function(_0x41f859){if(_0x41f859){return _0x50e3dc['sendStatus'](_0x2b0998);}return _0x50e3dc['status'](_0x2b0998)[_0xe73a('0xd')]();};}function respondWithResult(_0x3d0b52,_0x4806f8){_0x4806f8=_0x4806f8||0xc8;return function(_0x52f309){if(_0x52f309){return _0x3d0b52['status'](_0x4806f8)[_0xe73a('0xe')](_0x52f309);}};}function respondWithFilteredResult(_0x4a6500,_0x411e4c){return function(_0x29de44){if(_0x29de44){var _0x2d5e12=typeof _0x411e4c[_0xe73a('0xf')]===_0xe73a('0x10')&&typeof _0x411e4c[_0xe73a('0x11')]===_0xe73a('0x10');var _0x330fda=_0x29de44[_0xe73a('0x12')];var _0x22fd8e=_0x2d5e12?0x0:_0x411e4c[_0xe73a('0xf')];var _0x17c38b=_0x2d5e12?_0x29de44['count']:_0x411e4c[_0xe73a('0xf')]+_0x411e4c[_0xe73a('0x11')];var _0x2a53da;if(_0x17c38b>=_0x330fda){_0x17c38b=_0x330fda;_0x2a53da=0xc8;}else{_0x2a53da=0xce;}_0x4a6500[_0xe73a('0x13')](_0x2a53da);return _0x4a6500[_0xe73a('0x14')]('Content-Range',_0x22fd8e+'-'+_0x17c38b+'/'+_0x330fda)['json'](_0x29de44);}return null;};}function saveUpdates(_0x17d0fb){return function(_0x32e5dd){if(_0x32e5dd){return _0x32e5dd['update'](_0x17d0fb)[_0xe73a('0x15')](function(_0x4cdd5d){return _0x4cdd5d;});}return null;};}function removeEntity(_0x4a119e){return function(_0x34c392){if(_0x34c392){return _0x34c392[_0xe73a('0x16')]()[_0xe73a('0x15')](function(){_0x4a119e[_0xe73a('0x13')](0xcc)[_0xe73a('0xd')]();});}};}function handleEntityNotFound(_0x6bbc75){return function(_0x1f98ef){if(!_0x1f98ef){_0x6bbc75[_0xe73a('0x17')](0x194);}return _0x1f98ef;};}function handleError(_0xcfca62,_0x4d3fc5){_0x4d3fc5=_0x4d3fc5||0x1f4;return function(_0x5b3410){logger[_0xe73a('0x18')](_0x5b3410[_0xe73a('0x19')]);if(_0x5b3410[_0xe73a('0x1a')]){delete _0x5b3410[_0xe73a('0x1a')];}_0xcfca62[_0xe73a('0x13')](_0x4d3fc5)[_0xe73a('0x1b')](_0x5b3410);};}exports[_0xe73a('0x1c')]=function(_0x97dc8d,_0x4bf422){var _0x5625c8={};var _0x31b6e8=_[_0xe73a('0x1d')](db[_0xe73a('0x1e')][_0xe73a('0x1f')],function(_0x4348dd){return{'name':_0x4348dd[_0xe73a('0x20')],'type':_0x4348dd[_0xe73a('0x21')][_0xe73a('0x22')]};});_0x5625c8=qs[_0xe73a('0x23')](_0x31b6e8,_0x97dc8d);return interaction['findAll'](_0xe73a('0x24'),_0x97dc8d[_0xe73a('0x25')],_0x97dc8d[_0xe73a('0x26')],_0x5625c8,_0x31b6e8)[_0xe73a('0x15')](respondWithFilteredResult(_0x4bf422,_0x5625c8))[_0xe73a('0x27')](handleError(_0x4bf422,null));};exports['show']=function(_0x3fe41b,_0x58c8de){var _0x321905={};if(_0x3fe41b[_0xe73a('0x25')][_0xe73a('0x21')]&&_0x3fe41b[_0xe73a('0x25')][_0xe73a('0x21')]===_0xe73a('0x28')){_0x321905[_0xe73a('0x28')]=_0x3fe41b[_0xe73a('0x29')]['id'];}else{_0x321905['id']=_0x3fe41b['params']['id'];}var _0x3ec2c8={'raw':![],'where':_0x321905},_0x5e103c={};_0x5e103c[_0xe73a('0x2a')]=_[_0xe73a('0x2b')](db[_0xe73a('0x1e')][_0xe73a('0x1f')]);_0x5e103c[_0xe73a('0x25')]=_[_0xe73a('0x2b')](_0x3fe41b[_0xe73a('0x25')]);_0x5e103c[_0xe73a('0x2c')]=_['intersection'](_0x5e103c[_0xe73a('0x2a')],_0x5e103c['query']);_0x3ec2c8[_0xe73a('0x2d')]=_[_0xe73a('0x2e')](_0x5e103c[_0xe73a('0x2a')],qs[_0xe73a('0x2f')](_0x3fe41b[_0xe73a('0x25')]['fields']));_0x3ec2c8[_0xe73a('0x2d')]=_0x3ec2c8[_0xe73a('0x2d')][_0xe73a('0x30')]?_0x3ec2c8[_0xe73a('0x2d')]:_0x5e103c['model'];if(_0x3fe41b[_0xe73a('0x25')][_0xe73a('0x31')]){_0x3ec2c8['include']=[{'all':!![]}];}_0x3ec2c8=_['merge']({},_0x3ec2c8,_0x3fe41b['options']);return db[_0xe73a('0x1e')][_0xe73a('0x32')](_0x3ec2c8)['then'](handleEntityNotFound(_0x58c8de,null))[_0xe73a('0x15')](respondWithResult(_0x58c8de,null))['catch'](handleError(_0x58c8de,null));};exports[_0xe73a('0x33')]=function(_0x44b59d,_0x59025d){return db['OpenchannelInteraction'][_0xe73a('0x33')](_0x44b59d[_0xe73a('0x34')],{})[_0xe73a('0x15')](respondWithResult(_0x59025d,0xc9))[_0xe73a('0x27')](handleError(_0x59025d,null));};exports['update']=function(_0x144c88,_0x1d9bef){if(_0x144c88['body']['id']){delete _0x144c88[_0xe73a('0x34')]['id'];}return db[_0xe73a('0x1e')][_0xe73a('0x32')]({'where':{'id':_0x144c88[_0xe73a('0x29')]['id']}})[_0xe73a('0x15')](handleEntityNotFound(_0x1d9bef,null))[_0xe73a('0x15')](saveUpdates(_0x144c88['body'],null))[_0xe73a('0x15')](respondWithResult(_0x1d9bef,null))[_0xe73a('0x27')](handleError(_0x1d9bef,null));};exports['destroy']=function(_0x3c1bf2,_0x187396){return db[_0xe73a('0x1e')][_0xe73a('0x32')]({'where':{'id':_0x3c1bf2[_0xe73a('0x29')]['id']}})['then'](handleEntityNotFound(_0x187396,null))[_0xe73a('0x15')](removeEntity(_0x187396,null))[_0xe73a('0x27')](handleError(_0x187396,null));};exports['describe']=function(_0x5750a2,_0x2b3a40){return db[_0xe73a('0x1e')][_0xe73a('0x35')]()[_0xe73a('0x15')](respondWithResult(_0x2b3a40,null))[_0xe73a('0x27')](handleError(_0x2b3a40,null));};exports[_0xe73a('0x36')]=function(_0x3cf4b0,_0x26d41a){return db['OpenchannelMessage']['find']({'where':{'id':_0x3cf4b0[_0xe73a('0x29')]['id']}})[_0xe73a('0x15')](handleEntityNotFound(_0x26d41a,null))['then'](function(_0x194259){if(_0x194259){return _0x194259[_0xe73a('0x36')](_0x3cf4b0['body'][_0xe73a('0x37')],_[_0xe73a('0x38')](_0x3cf4b0['body'],['ids','id'])||{});}})[_0xe73a('0x15')](respondWithResult(_0x26d41a,null))[_0xe73a('0x27')](handleError(_0x26d41a,null));};exports[_0xe73a('0x39')]=function(_0x47a01f,_0x32c159){var _0xdf8b77={'raw':![],'where':{}};var _0xee8708={};var _0x42a760={'count':0x0,'rows':[]};return db[_0xe73a('0x1e')][_0xe73a('0x3a')]({'where':{'id':_0x47a01f[_0xe73a('0x29')]['id']}})['then'](handleEntityNotFound(_0x32c159,null))[_0xe73a('0x15')](function(_0x435517){if(_0x435517){_0xee8708[_0xe73a('0x2a')]=_[_0xe73a('0x2b')](db[_0xe73a('0x3b')][_0xe73a('0x1f')]);_0xee8708['query']=_[_0xe73a('0x2b')](_0x47a01f['query']);_0xee8708[_0xe73a('0x2c')]=_[_0xe73a('0x2e')](_0xee8708[_0xe73a('0x2a')],_0xee8708[_0xe73a('0x25')]);_0xdf8b77['attributes']=_[_0xe73a('0x2e')](_0xee8708['model'],qs['fields'](_0x47a01f[_0xe73a('0x25')][_0xe73a('0x2f')]));_0xdf8b77[_0xe73a('0x2d')]=_0xdf8b77[_0xe73a('0x2d')][_0xe73a('0x30')]?_0xdf8b77[_0xe73a('0x2d')]:_0xee8708[_0xe73a('0x2a')];if(!_0x47a01f[_0xe73a('0x25')][_0xe73a('0x3c')](_0xe73a('0x3d'))){_0xdf8b77[_0xe73a('0x11')]=qs['limit'](_0x47a01f[_0xe73a('0x25')][_0xe73a('0x11')]);_0xdf8b77[_0xe73a('0xf')]=qs[_0xe73a('0xf')](_0x47a01f['query']['offset']);}_0xdf8b77['order']=qs['sort'](_0x47a01f['query'][_0xe73a('0x3e')]);_0xdf8b77[_0xe73a('0x3f')]=qs['filters'](_[_0xe73a('0x40')](_0x47a01f[_0xe73a('0x25')],_0xee8708[_0xe73a('0x2c')]));_0xdf8b77[_0xe73a('0x3f')][_0xe73a('0x41')]=_0x435517['id'];if(_0x47a01f['query'][_0xe73a('0x42')]){_0xdf8b77[_0xe73a('0x3f')]=_[_0xe73a('0x43')](_0xdf8b77[_0xe73a('0x3f')],{'$or':_['map'](_0xdf8b77['attributes'],function(_0x4829ed){var _0x29fb89={};_0x29fb89[_0x4829ed]={'$like':'%'+_0x47a01f['query'][_0xe73a('0x42')]+'%'};return _0x29fb89;})});}if(_0x47a01f[_0xe73a('0x25')][_0xe73a('0x44')]){var _0x4493a6=_0x47a01f[_0xe73a('0x25')][_0xe73a('0x44')][_0xe73a('0x45')](',');var _0x2d8d73={};_0x2d8d73[_0x4493a6[0x0]]={'$gte':moment(_0x4493a6[0x1])[_0xe73a('0x46')](_0xe73a('0x47'))};_0xdf8b77['where']=_[_0xe73a('0x43')](_0xdf8b77['where'],_0x2d8d73);}_0xdf8b77=_[_0xe73a('0x43')]({},_0xdf8b77,_0x47a01f[_0xe73a('0x48')]);return db[_0xe73a('0x3b')][_0xe73a('0x12')]({'where':_0xdf8b77['where']})[_0xe73a('0x15')](function(_0x1a75a7){_0x42a760[_0xe73a('0x12')]=_0x1a75a7;if(_0x47a01f[_0xe73a('0x25')][_0xe73a('0x31')]){_0xdf8b77[_0xe73a('0x49')]=[{'all':!![]}];}return db[_0xe73a('0x3b')][_0xe73a('0x4a')](_0xdf8b77);})[_0xe73a('0x15')](function(_0x9b39d4){_0x42a760[_0xe73a('0x4b')]=_0x9b39d4;return _0x42a760;});}})[_0xe73a('0x15')](respondWithFilteredResult(_0x32c159,_0xdf8b77))['catch'](handleError(_0x32c159,null));};exports[_0xe73a('0x4c')]=function(_0x393e0b,_0x5f0fd8){return db[_0xe73a('0x1e')][_0xe73a('0x32')]({'where':{'id':_0x393e0b[_0xe73a('0x29')]['id']}})['then'](handleEntityNotFound(_0x5f0fd8,null))[_0xe73a('0x15')](function(_0x5c3c0a){if(_0x5c3c0a){return _0x5c3c0a[_0xe73a('0x4d')](_0x393e0b[_0xe73a('0x34')][_0xe73a('0x37')],_[_0xe73a('0x38')](_0x393e0b[_0xe73a('0x34')],[_0xe73a('0x37'),'id'])||{})[_0xe73a('0x4e')](function(){return db['Tag']['findAll']({'attributes':['id',_0xe73a('0x1a'),_0xe73a('0x4f')],'where':{'id':_0x393e0b[_0xe73a('0x34')]['ids']}});})['then'](function(_0x18b0fb){socket[_0xe73a('0x50')]('openchannelInteractionTags:save',{'id':Number(_0x393e0b['params']['id']),'tags':_0x18b0fb||[]});return{'id':Number(_0x393e0b[_0xe73a('0x29')]['id']),'tags':_0x18b0fb||[]};});}})[_0xe73a('0x15')](respondWithResult(_0x5f0fd8,null))['catch'](handleError(_0x5f0fd8,null));};exports[_0xe73a('0x51')]=function(_0x4c3a5f,_0x25bf1c){return db[_0xe73a('0x1e')][_0xe73a('0x32')]({'where':{'id':_0x4c3a5f['params']['id']}})['then'](handleEntityNotFound(_0x25bf1c,null))['then'](function(_0x134f59){if(_0x134f59){return _0x134f59['removeTags'](_0x4c3a5f['query'][_0xe73a('0x37')]);}})[_0xe73a('0x15')](respondWithStatusCode(_0x25bf1c,null))[_0xe73a('0x27')](handleError(_0x25bf1c,null));};exports[_0xe73a('0x52')]=function(_0x17bd7e,_0x38e216){var _0x1b2bbb=moment()[_0xe73a('0x53')]()[_0xe73a('0x54')]();var _0x22c21c=path[_0xe73a('0x55')](config[_0xe73a('0x56')],_0xe73a('0x57'),'files','tmp');var _0x308990=path['join'](config[_0xe73a('0x56')],_0xe73a('0x57'),_0xe73a('0x58'),_0xe73a('0x59'));var _0x4d0005=path[_0xe73a('0x55')](_0x22c21c,_0x1b2bbb);var _0xde61ed=util[_0xe73a('0x46')](_0xe73a('0x5a'),_0x17bd7e[_0xe73a('0x29')]['id'],_0x1b2bbb);var _0x1a1ec8=path['join'](_0x22c21c,_0xde61ed);var _0x2e59ea=[];_0x2e59ea['push']({'model':db[_0xe73a('0x5b')],'as':'User','attributes':['id',_0xe73a('0x5c')],'raw':!![]});_0x2e59ea['push']({'model':db[_0xe73a('0x5d')],'as':_0xe73a('0x5e'),'attributes':['id',_0xe73a('0x5f'),_0xe73a('0x60')],'raw':!![]});if(_0x17bd7e[_0xe73a('0x25')][_0xe73a('0x59')]){_0x2e59ea[_0xe73a('0x61')]({'model':db[_0xe73a('0x62')],'as':_0xe73a('0x62'),'raw':!![]});}var _0x1127e0=[{'model':db[_0xe73a('0x3b')],'as':'Messages','attributes':['id','body',_0xe73a('0x63'),_0xe73a('0x64'),_0xe73a('0x65'),_0xe73a('0x66')],'include':_0x2e59ea}];_0x1127e0['push']({'model':db[_0xe73a('0x67')],'as':'Account','attributes':['id',_0xe73a('0x1a')]});_0x1127e0[_0xe73a('0x61')]({'model':db[_0xe73a('0x5b')],'as':'Owner','attributes':['id',_0xe73a('0x5c')]});return db[_0xe73a('0x1e')][_0xe73a('0x32')]({'where':{'id':_0x17bd7e[_0xe73a('0x29')]['id']},'include':_0x1127e0})['then'](handleEntityNotFound(_0x38e216,null))[_0xe73a('0x15')](function(_0xef61f){if(_0xef61f){var _0xaa7e51=_0xef61f[_0xe73a('0x68')]({'plain':!![]});fs[_0xe73a('0x69')](_0x4d0005);var _0x4d8767={'channel':_0xe73a('0x6a'),'account':_0xaa7e51[_0xe73a('0x6b')][_0xe73a('0x1a')],'agent':_0xaa7e51[_0xe73a('0x6c')]?_0xaa7e51[_0xe73a('0x6c')][_0xe73a('0x5c')]:_0xe73a('0x6d'),'createdAt':moment(_0xaa7e51[_0xe73a('0x63')])[_0xe73a('0x46')](_0xe73a('0x47'))[_0xe73a('0x54')](),'closedAt':_0xaa7e51[_0xe73a('0x6e')]?moment(_0xaa7e51[_0xe73a('0x6f')])[_0xe73a('0x46')](_0xe73a('0x47'))[_0xe73a('0x54')]():'','disposition':_0xaa7e51[_0xe73a('0x70')],'visibility':_0xaa7e51[_0xe73a('0x71')]?_0xe73a('0x72'):'Private','messages':_(_0xaa7e51['Messages'])[_0xe73a('0x42')]({'secret':![]})[_0xe73a('0x1d')](function(_0x1f4e66){if(_0x1f4e66[_0xe73a('0x62')]){var _0x11d84e=path[_0xe73a('0x55')](_0x308990,_0x1f4e66[_0xe73a('0x62')][_0xe73a('0x73')]);if(fs[_0xe73a('0x74')](_0x11d84e)){fs[_0xe73a('0x75')](_0x11d84e)[_0xe73a('0x76')](fs[_0xe73a('0x77')](path[_0xe73a('0x55')](_0x4d0005,_0x1f4e66[_0xe73a('0x62')][_0xe73a('0x73')])));}}return{'date':moment(_0x1f4e66['createdAt'])['format'](_0xe73a('0x47'))[_0xe73a('0x54')](),'sender':_0x1f4e66[_0xe73a('0x64')]==='out'?_0x1f4e66[_0xe73a('0x5b')]?_0x1f4e66['User']['fullname']:_0xe73a('0x78'):_0x1f4e66[_0xe73a('0x5e')]['firstName']+(_0x1f4e66[_0xe73a('0x5e')][_0xe73a('0x60')]?'\x20'+_0x1f4e66[_0xe73a('0x5e')][_0xe73a('0x60')]:''),'body':_0x1f4e66['Attachment']?_0x1f4e66[_0xe73a('0x62')][_0xe73a('0x73')]:_0x1f4e66[_0xe73a('0x34')],'direction':_0x1f4e66['direction']===_0xe73a('0x79')?'A':'C','secret':_0x1f4e66[_0xe73a('0x65')],'read':_0x1f4e66[_0xe73a('0x66')],'attachment':_0x1f4e66[_0xe73a('0x62')]};})[_0xe73a('0x7a')]()};return ejs[_0xe73a('0x7b')](path[_0xe73a('0x55')](config['root'],_0xe73a('0x57'),_0xe73a('0x7c'),_0xe73a('0x7d')),{'interaction':_0x4d8767})['then'](function(_0x4af29a){var _0xf98fe3=path['join'](_0x4d0005,_0xe73a('0x7e')+_0xaa7e51['id']+'-'+_0x1b2bbb+_0xe73a('0x7f'));var _0x3cec6b={'path':_0xf98fe3,'channel':_0xe73a('0x6a'),'interactionId':_0xaa7e51['id']};return pdf['createPdfFromHTML'](_0x4af29a,_0x3cec6b);})[_0xe73a('0x15')](function(){return new Promise(function(_0xc5ea64,_0x494a22){zipdir(_0x4d0005,{'saveTo':_0x1a1ec8},function(_0x3d099c,_0xae97e){if(_0x3d099c)return _0x494a22(_0x3d099c);return _0xc5ea64(_0xae97e);});})[_0xe73a('0x15')](function(){return new Promise(function(_0x5cdeb6,_0x45514e){rimraf(_0x4d0005,function(_0x3ff66c){if(_0x3ff66c)_0x45514e(_0x3ff66c);return _0x5cdeb6();});});})[_0xe73a('0x15')](function(){return _0x38e216[_0xe73a('0x52')](_0x1a1ec8,_0xde61ed,function(_0xa8d37){if(_0xa8d37){logger['error'](_0xe73a('0x80'),_0xa8d37);}else{fs[_0xe73a('0x81')](_0x1a1ec8);}});});});}else{return _0x38e216[_0xe73a('0x17')](0xc8);}})[_0xe73a('0x27')](handleError(_0x38e216,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index d44435a..4d7e544 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 _0x7dcb=['../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events'];(function(_0x27f58c,_0x479526){var _0x7a1550=function(_0x1bb6e6){while(--_0x1bb6e6){_0x27f58c['push'](_0x27f58c['shift']());}};_0x7a1550(++_0x479526);}(_0x7dcb,0x13f));var _0xb7dc=function(_0x11643a,_0x46c5ec){_0x11643a=_0x11643a-0x0;var _0x3f2ece=_0x7dcb[_0x11643a];return _0x3f2ece;};'use strict';var EventEmitter=require(_0xb7dc('0x0'));var OpenchannelInteraction=require(_0xb7dc('0x1'))['db'][_0xb7dc('0x2')];var OpenchannelMessage=require(_0xb7dc('0x1'))['db'][_0xb7dc('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xb7dc('0x4')](0x0);var events={'afterCreate':_0xb7dc('0x5'),'afterUpdate':_0xb7dc('0x6'),'afterDestroy':_0xb7dc('0x7')};function emitEvent(_0x25188d){return function(_0x367175,_0x46113a,_0x4157be){_0x367175[_0xb7dc('0x8')]({'attributes':['id'],'raw':!![]})[_0xb7dc('0x9')](function(_0x1a2a42){_0x367175[_0xb7dc('0xa')](_0xb7dc('0xb'),_0x1a2a42['map'](function(_0x43aeaf){return{'id':_0x43aeaf['id']};}));return OpenchannelMessage[_0xb7dc('0xc')]({'where':{'OpenchannelInteractionId':_0x367175['id'],'direction':'in','read':![]},'raw':!![]});})[_0xb7dc('0x9')](function(_0x226ec2){_0x367175[_0xb7dc('0xa')](_0xb7dc('0xd'),_0x226ec2[_0xb7dc('0xe')]);OpenchannelInteractionEvents[_0xb7dc('0xf')](_0x25188d+':'+_0x367175['id'],_0x367175);OpenchannelInteractionEvents[_0xb7dc('0xf')](_0x25188d,_0x367175);_0x4157be(null);})[_0xb7dc('0x10')](_0x4157be(null));};}for(var e in events){if(events[_0xb7dc('0x11')](e)){var event=events[e];OpenchannelInteraction[_0xb7dc('0x12')](e,emitEvent(event));}}module[_0xb7dc('0x13')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x8bf8=['catch','hasOwnProperty','exports','events','OpenchannelInteraction','../../mysqldb','OpenchannelMessage','setMaxListeners','save','update','remove','getUsers','then','findAll','setDataValue','unreadMessages','length','emit'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0x8bf8,0x18f));var _0x88bf=function(_0x5ec211,_0x2bcfdc){_0x5ec211=_0x5ec211-0x0;var _0x21773f=_0x8bf8[_0x5ec211];return _0x21773f;};'use strict';var EventEmitter=require(_0x88bf('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db'][_0x88bf('0x1')];var OpenchannelMessage=require(_0x88bf('0x2'))['db'][_0x88bf('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x88bf('0x4')](0x0);var events={'afterCreate':_0x88bf('0x5'),'afterUpdate':_0x88bf('0x6'),'afterDestroy':_0x88bf('0x7')};function emitEvent(_0x279618){return function(_0x3fc77c,_0x5b57b7,_0x3e051b){_0x3fc77c[_0x88bf('0x8')]({'attributes':['id'],'raw':!![]})[_0x88bf('0x9')](function(_0x4b22d1){_0x3fc77c['setDataValue']('Users',_0x4b22d1['map'](function(_0xbfd24e){return{'id':_0xbfd24e['id']};}));return OpenchannelMessage[_0x88bf('0xa')]({'where':{'OpenchannelInteractionId':_0x3fc77c['id'],'direction':'in','read':![]},'raw':!![]});})[_0x88bf('0x9')](function(_0x52fe51){_0x3fc77c[_0x88bf('0xb')](_0x88bf('0xc'),_0x52fe51[_0x88bf('0xd')]);OpenchannelInteractionEvents[_0x88bf('0xe')](_0x279618+':'+_0x3fc77c['id'],_0x3fc77c);OpenchannelInteractionEvents[_0x88bf('0xe')](_0x279618,_0x3fc77c);_0x3e051b(null);})[_0x88bf('0xf')](_0x3e051b(null));};}for(var e in events){if(events[_0x88bf('0x10')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module[_0x88bf('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 8034172..7fb8c11 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 _0x8601=['api','moment','request-promise','path','rimraf','./openchannelInteraction.attributes','OpenchannelInteraction','utf8mb4','utf8mb4_unicode_ci','changed','closed','format','lodash','util','../../config/logger'];(function(_0x4aef5c,_0x1f2fdb){var _0x5053a6=function(_0x15ae0){while(--_0x15ae0){_0x4aef5c['push'](_0x4aef5c['shift']());}};_0x5053a6(++_0x1f2fdb);}(_0x8601,0x183));var _0x1860=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x8601[_0x432682];return _0x463d05;};'use strict';var _=require(_0x1860('0x0'));var util=require(_0x1860('0x1'));var logger=require(_0x1860('0x2'))(_0x1860('0x3'));var moment=require(_0x1860('0x4'));var BPromise=require('bluebird');var rp=require(_0x1860('0x5'));var fs=require('fs');var path=require(_0x1860('0x6'));var rimraf=require(_0x1860('0x7'));var config=require('../../config/environment');var attributes=require(_0x1860('0x8'));module['exports']=function(_0x240648,_0x71a871){return _0x240648['define'](_0x1860('0x9'),attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1860('0xa'),'collate':_0x1860('0xb'),'hooks':{'beforeUpdate':function(_0x27539a,_0x390e2b,_0x971bd5){if(_0x27539a[_0x1860('0xc')](_0x1860('0xd'))){_0x27539a['closedAt']=moment()[_0x1860('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x971bd5(null,_0x27539a);}}});}; \ No newline at end of file +var _0x57b7=['request-promise','path','./openchannelInteraction.attributes','exports','OpenchannelInteraction','openchannel_interactions','utf8mb4','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','moment'];(function(_0x2601b4,_0x315e78){var _0x3e3661=function(_0x13b45b){while(--_0x13b45b){_0x2601b4['push'](_0x2601b4['shift']());}};_0x3e3661(++_0x315e78);}(_0x57b7,0x1dd));var _0x757b=function(_0x42f3ec,_0x216860){_0x42f3ec=_0x42f3ec-0x0;var _0x1aaa38=_0x57b7[_0x42f3ec];return _0x1aaa38;};'use strict';var _=require(_0x757b('0x0'));var util=require(_0x757b('0x1'));var logger=require('../../config/logger')(_0x757b('0x2'));var moment=require(_0x757b('0x3'));var BPromise=require('bluebird');var rp=require(_0x757b('0x4'));var fs=require('fs');var path=require(_0x757b('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x757b('0x6'));module[_0x757b('0x7')]=function(_0x988ab0,_0xa54b6b){return _0x988ab0['define'](_0x757b('0x8'),attributes,{'tableName':_0x757b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x757b('0xa'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x421103,_0x1ec1dc,_0x388cea){if(_0x421103['changed']('closed')){_0x421103[_0x757b('0xb')]=moment()['format'](_0x757b('0xc'));}_0x388cea(null,_0x421103);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 891c7b1..86c3b74 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 _0x6aa1=['addTags','ids','omit','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','then','info','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelInteraction,\x20%s,\x20%s','message','result','catch','OpenchannelInteraction','update','body','options','raw','where','attributes','limit','UpdateOpenchannelInteraction','AddTagsToOpenchannelInteraction'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6aa1,0x187));var _0x16aa=function(_0x5cd322,_0x310908){_0x5cd322=_0x5cd322-0x0;var _0x52df5c=_0x6aa1[_0x5cd322];return _0x52df5c;};'use strict';var _=require('lodash');var util=require(_0x16aa('0x0'));var moment=require(_0x16aa('0x1'));var BPromise=require(_0x16aa('0x2'));var rs=require(_0x16aa('0x3'));var fs=require('fs');var Redis=require(_0x16aa('0x4'));var db=require(_0x16aa('0x5'))['db'];var utils=require(_0x16aa('0x6'));var logger=require(_0x16aa('0x7'))(_0x16aa('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x16aa('0x9')][_0x16aa('0xa')]({'port':0x232a});config[_0x16aa('0xb')]=_[_0x16aa('0xc')](config[_0x16aa('0xb')],{'host':_0x16aa('0xd'),'port':0x18eb});var socket=require(_0x16aa('0xe'))(new Redis(config['redis']));require(_0x16aa('0xf'))[_0x16aa('0x10')](socket);function respondWithRpcPromise(_0x4f9a46,_0x97e88d,_0x1cf0df){return new BPromise(function(_0x3c2b24,_0x2085d4){return client[_0x16aa('0x11')](_0x4f9a46,_0x1cf0df)[_0x16aa('0x12')](function(_0x22453d){logger[_0x16aa('0x13')]('OpenchannelInteraction,\x20%s,\x20%s',_0x97e88d,_0x16aa('0x14'));logger[_0x16aa('0x15')](_0x16aa('0x16'),_0x97e88d,_0x16aa('0x14'),JSON[_0x16aa('0x17')](_0x22453d));if(_0x22453d['error']){if(_0x22453d['error']['code']===0x1f4){logger[_0x16aa('0x18')](_0x16aa('0x19'),_0x97e88d,_0x22453d['error'][_0x16aa('0x1a')]);return _0x2085d4(_0x22453d[_0x16aa('0x18')][_0x16aa('0x1a')]);}logger['error'](_0x16aa('0x19'),_0x97e88d,_0x22453d['error'][_0x16aa('0x1a')]);return _0x3c2b24(_0x22453d[_0x16aa('0x18')]['message']);}else{logger['info'](_0x16aa('0x19'),_0x97e88d,_0x16aa('0x14'));_0x3c2b24(_0x22453d[_0x16aa('0x1b')]['message']);}})[_0x16aa('0x1c')](function(_0x21b0b7){logger[_0x16aa('0x18')](_0x16aa('0x19'),_0x97e88d,_0x21b0b7);_0x2085d4(_0x21b0b7);});});}exports['UpdateOpenchannelInteraction']=function(_0x115314){var _0x19228d=this;return new Promise(function(_0x3ecf59,_0x228a2b){return db[_0x16aa('0x1d')][_0x16aa('0x1e')](_0x115314[_0x16aa('0x1f')],{'raw':_0x115314[_0x16aa('0x20')]?_0x115314[_0x16aa('0x20')][_0x16aa('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x115314['options']?_0x115314[_0x16aa('0x20')][_0x16aa('0x22')]||null:null,'attributes':_0x115314[_0x16aa('0x20')]?_0x115314[_0x16aa('0x20')][_0x16aa('0x23')]||null:null,'limit':_0x115314[_0x16aa('0x20')]?_0x115314[_0x16aa('0x20')][_0x16aa('0x24')]||null:null})['then'](function(_0x51e483){logger[_0x16aa('0x13')]('UpdateOpenchannelInteraction',_0x115314);logger[_0x16aa('0x15')](_0x16aa('0x25'),_0x115314,JSON[_0x16aa('0x17')](_0x51e483));_0x3ecf59(_0x51e483);})[_0x16aa('0x1c')](function(_0x277d70){logger[_0x16aa('0x18')](_0x16aa('0x25'),_0x277d70['message'],_0x115314);_0x228a2b(_0x19228d['error'](0x1f4,_0x277d70['message']));});});};exports[_0x16aa('0x26')]=function(_0x362ec3){return new Promise(function(_0x9805a5,_0x4085c5){return db[_0x16aa('0x1d')]['find']({'where':_0x362ec3['options']?_0x362ec3[_0x16aa('0x20')][_0x16aa('0x22')]||null:null})[_0x16aa('0x12')](function(_0x1b3a62){if(_0x1b3a62){return _0x1b3a62[_0x16aa('0x27')](_0x362ec3['body'][_0x16aa('0x28')],_[_0x16aa('0x29')](_0x362ec3['body'],['ids','id'])||{});}})['spread'](function(_0x540c43){logger[_0x16aa('0x13')](_0x16aa('0x2a'),_0x362ec3);logger['debug'](_0x16aa('0x2a'),_0x362ec3,JSON[_0x16aa('0x17')](_0x540c43));_0x9805a5(_0x540c43);})[_0x16aa('0x1c')](function(_0x51ddf5){logger[_0x16aa('0x18')](_0x16aa('0x2a'),_0x51ddf5[_0x16aa('0x1a')],_0x362ec3);_0x4085c5(_this[_0x16aa('0x18')](0x1f4,_0x51ddf5[_0x16aa('0x1a')]));});});}; \ No newline at end of file +var _0xb58e=['ids','omit','spread','AddTags','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','register','request','info','request\x20sent','debug','stringify','error','code','message','OpenchannelInteraction,\x20%s,\x20%s','catch','OpenchannelInteraction','body','options','raw','where','attributes','then','UpdateOpenchannelInteraction','AddTagsToOpenchannelInteraction','find','addTags'];(function(_0x5ced3b,_0x40399d){var _0x37e581=function(_0x393711){while(--_0x393711){_0x5ced3b['push'](_0x5ced3b['shift']());}};_0x37e581(++_0x40399d);}(_0xb58e,0xe8));var _0xeb58=function(_0x1cd4a9,_0x36274a){_0x1cd4a9=_0x1cd4a9-0x0;var _0x16433e=_0xb58e[_0x1cd4a9];return _0x16433e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xeb58('0x0'));var BPromise=require(_0xeb58('0x1'));var rs=require(_0xeb58('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xeb58('0x3'))['db'];var utils=require(_0xeb58('0x4'));var logger=require(_0xeb58('0x5'))('rpc');var config=require(_0xeb58('0x6'));var jayson=require(_0xeb58('0x7'));var client=jayson['client'][_0xeb58('0x8')]({'port':0x232a});config[_0xeb58('0x9')]=_['defaults'](config[_0xeb58('0x9')],{'host':_0xeb58('0xa'),'port':0x18eb});var socket=require(_0xeb58('0xb'))(new Redis(config['redis']));require('./openchannelInteraction.socket')[_0xeb58('0xc')](socket);function respondWithRpcPromise(_0x3a22d3,_0x52aa90,_0x53a924){return new BPromise(function(_0x5f05e0,_0x1c05c2){return client[_0xeb58('0xd')](_0x3a22d3,_0x53a924)['then'](function(_0x14ba66){logger[_0xeb58('0xe')]('OpenchannelInteraction,\x20%s,\x20%s',_0x52aa90,_0xeb58('0xf'));logger[_0xeb58('0x10')]('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x52aa90,_0xeb58('0xf'),JSON[_0xeb58('0x11')](_0x14ba66));if(_0x14ba66[_0xeb58('0x12')]){if(_0x14ba66[_0xeb58('0x12')][_0xeb58('0x13')]===0x1f4){logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x52aa90,_0x14ba66['error'][_0xeb58('0x14')]);return _0x1c05c2(_0x14ba66[_0xeb58('0x12')][_0xeb58('0x14')]);}logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x52aa90,_0x14ba66['error']['message']);return _0x5f05e0(_0x14ba66[_0xeb58('0x12')][_0xeb58('0x14')]);}else{logger['info'](_0xeb58('0x15'),_0x52aa90,_0xeb58('0xf'));_0x5f05e0(_0x14ba66['result'][_0xeb58('0x14')]);}})[_0xeb58('0x16')](function(_0xa6757e){logger[_0xeb58('0x12')](_0xeb58('0x15'),_0x52aa90,_0xa6757e);_0x1c05c2(_0xa6757e);});});}exports['UpdateOpenchannelInteraction']=function(_0x3747fa){var _0x9697a2=this;return new Promise(function(_0xe05b29,_0x2cfe71){return db[_0xeb58('0x17')]['update'](_0x3747fa[_0xeb58('0x18')],{'raw':_0x3747fa['options']?_0x3747fa[_0xeb58('0x19')][_0xeb58('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3747fa['options']?_0x3747fa[_0xeb58('0x19')][_0xeb58('0x1b')]||null:null,'attributes':_0x3747fa[_0xeb58('0x19')]?_0x3747fa[_0xeb58('0x19')][_0xeb58('0x1c')]||null:null,'limit':_0x3747fa[_0xeb58('0x19')]?_0x3747fa[_0xeb58('0x19')]['limit']||null:null})[_0xeb58('0x1d')](function(_0xfaaeae){logger['info'](_0xeb58('0x1e'),_0x3747fa);logger[_0xeb58('0x10')](_0xeb58('0x1e'),_0x3747fa,JSON[_0xeb58('0x11')](_0xfaaeae));_0xe05b29(_0xfaaeae);})[_0xeb58('0x16')](function(_0x537860){logger[_0xeb58('0x12')](_0xeb58('0x1e'),_0x537860[_0xeb58('0x14')],_0x3747fa);_0x2cfe71(_0x9697a2[_0xeb58('0x12')](0x1f4,_0x537860['message']));});});};exports[_0xeb58('0x1f')]=function(_0x3e492a){return new Promise(function(_0x25c85f,_0x5cdf00){return db[_0xeb58('0x17')][_0xeb58('0x20')]({'where':_0x3e492a[_0xeb58('0x19')]?_0x3e492a['options'][_0xeb58('0x1b')]||null:null})[_0xeb58('0x1d')](function(_0x5e716a){if(_0x5e716a){return _0x5e716a[_0xeb58('0x21')](_0x3e492a['body'][_0xeb58('0x22')],_[_0xeb58('0x23')](_0x3e492a['body'],['ids','id'])||{});}})[_0xeb58('0x24')](function(_0x1bd7d8){logger[_0xeb58('0xe')](_0xeb58('0x25'),_0x3e492a);logger['debug'](_0xeb58('0x25'),_0x3e492a,JSON['stringify'](_0x1bd7d8));_0x25c85f(_0x1bd7d8);})[_0xeb58('0x16')](function(_0x7392e4){logger[_0xeb58('0x12')](_0xeb58('0x25'),_0x7392e4[_0xeb58('0x14')],_0x3e492a);_0x5cdf00(_this[_0xeb58('0x12')](0x1f4,_0x7392e4[_0xeb58('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 96d6cdc..380b084 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 _0xf414=['update','emit','removeListener','register','length','openchannelInteraction:','./openchannelInteraction.events','save','remove'];(function(_0x2f9b6e,_0x1c87e7){var _0x608141=function(_0x3a6e90){while(--_0x3a6e90){_0x2f9b6e['push'](_0x2f9b6e['shift']());}};_0x608141(++_0x1c87e7);}(_0xf414,0xde));var _0x4f41=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0xf414[_0x4a53d];return _0x27410e;};'use strict';var OpenchannelInteractionEvents=require(_0x4f41('0x0'));var events=[_0x4f41('0x1'),_0x4f41('0x2'),_0x4f41('0x3')];function createListener(_0x209d5d,_0x2efbf1){return function(_0x48693a){_0x2efbf1[_0x4f41('0x4')](_0x209d5d,_0x48693a);};}function removeListener(_0x49eff1,_0x22fd9f){return function(){OpenchannelInteractionEvents[_0x4f41('0x5')](_0x49eff1,_0x22fd9f);};}exports[_0x4f41('0x6')]=function(_0x1183a0){for(var _0x51ab1d=0x0,_0x47a04a=events[_0x4f41('0x7')];_0x51ab1d<_0x47a04a;_0x51ab1d++){var _0x5bce9b=events[_0x51ab1d];var _0x3fd9d2=createListener(_0x4f41('0x8')+_0x5bce9b,_0x1183a0);OpenchannelInteractionEvents['on'](_0x5bce9b,_0x3fd9d2);}}; \ No newline at end of file +var _0x0a24=['save','remove','emit','removeListener','length','openchannelInteraction:','./openchannelInteraction.events'];(function(_0x97e076,_0x10ef7e){var _0x58287b=function(_0x55d38b){while(--_0x55d38b){_0x97e076['push'](_0x97e076['shift']());}};_0x58287b(++_0x10ef7e);}(_0x0a24,0x13a));var _0x40a2=function(_0x2c6464,_0x51817d){_0x2c6464=_0x2c6464-0x0;var _0x58e452=_0x0a24[_0x2c6464];return _0x58e452;};'use strict';var OpenchannelInteractionEvents=require(_0x40a2('0x0'));var events=[_0x40a2('0x1'),_0x40a2('0x2'),'update'];function createListener(_0x3eb21f,_0xd61b11){return function(_0x2884df){_0xd61b11[_0x40a2('0x3')](_0x3eb21f,_0x2884df);};}function removeListener(_0x488487,_0xee1a84){return function(){OpenchannelInteractionEvents[_0x40a2('0x4')](_0x488487,_0xee1a84);};}exports['register']=function(_0x49cfcd){for(var _0x50b22a=0x0,_0xc96260=events[_0x40a2('0x5')];_0x50b22a<_0xc96260;_0x50b22a++){var _0x1a002c=events[_0x50b22a];var _0x3c248=createListener(_0x40a2('0x6')+_0x1a002c,_0x49cfcd);OpenchannelInteractionEvents['on'](_0x1a002c,_0x3c248);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 3b05859..36e9146 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 _0x0713=['get','isAuthenticated','index','/describe','describe','/:id','post','tracked','openchannel','openchannelmessage:create','put','update','accept','/:id/reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelMessage.controller'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var controller=require(_0x3071('0x7'));router[_0x3071('0x8')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0xa')]);router[_0x3071('0x8')](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0xc')]);router[_0x3071('0x8')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller['show']);router[_0x3071('0xe')]('/',auth[_0x3071('0x9')](),interaction[_0x3071('0xf')](_0x3071('0x10'),_0x3071('0x11')),controller['create']);router[_0x3071('0x12')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller[_0x3071('0x13')]);router[_0x3071('0x12')]('/:id/accept',auth['isAuthenticated'](),controller[_0x3071('0x14')]);router['put'](_0x3071('0x15'),auth[_0x3071('0x9')](),controller['reject']);router[_0x3071('0x16')]('/:id',auth[_0x3071('0x9')](),controller[_0x3071('0x17')]);module[_0x3071('0x18')]=router; \ No newline at end of file +var _0xe706=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','openchannel','openchannelmessage:create','create','update','put','/:id/accept','accept','/:id/reject','exports','multer','util','path','express','Router'];(function(_0x3f47c0,_0x174f25){var _0x4bd7bc=function(_0x3d6090){while(--_0x3d6090){_0x3f47c0['push'](_0x3f47c0['shift']());}};_0x4bd7bc(++_0x174f25);}(_0xe706,0xa3));var _0x6e70=function(_0x26c10f,_0x5411be){_0x26c10f=_0x26c10f-0x0;var _0x17e0b8=_0xe706[_0x26c10f];return _0x17e0b8;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),interaction[_0x6e70('0x12')](_0x6e70('0x13'),_0x6e70('0x14')),controller[_0x6e70('0x15')]);router['put']('/:id',auth[_0x6e70('0xb')](),controller[_0x6e70('0x16')]);router[_0x6e70('0x17')](_0x6e70('0x18'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x19')]);router[_0x6e70('0x17')](_0x6e70('0x1a'),auth['isAuthenticated'](),controller['reject']);router['delete'](_0x6e70('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x6e70('0x1b')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 5f14fad..7be890d 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 _0xf846=['medium','BOOLEAN','ENUM','out','STRING','sequelize','exports','TEXT'];(function(_0x5ece84,_0xc06c9f){var _0x2a12c4=function(_0x133bf3){while(--_0x133bf3){_0x5ece84['push'](_0x5ece84['shift']());}};_0x2a12c4(++_0xc06c9f);}(_0xf846,0x85));var _0x6f84=function(_0x42b3d9,_0x5afc99){_0x42b3d9=_0x42b3d9-0x0;var _0xc65f3f=_0xf846[_0x42b3d9];return _0xc65f3f;};'use strict';var Sequelize=require(_0x6f84('0x0'));module[_0x6f84('0x1')]={'body':{'type':Sequelize[_0x6f84('0x2')](_0x6f84('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x6f84('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x6f84('0x5')]('in',_0x6f84('0x6')),'defaultValue':_0x6f84('0x6'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x6f84('0x7')]},'providerResponse':{'type':Sequelize[_0x6f84('0x2')]}}; \ No newline at end of file +var _0xe1e3=['DATE','STRING','TEXT','sequelize','exports','medium','ENUM','out'];(function(_0x15ba6d,_0x41c6bc){var _0x7ecdc7=function(_0x3fb88e){while(--_0x3fb88e){_0x15ba6d['push'](_0x15ba6d['shift']());}};_0x7ecdc7(++_0x41c6bc);}(_0xe1e3,0x1bb));var _0x3e1e=function(_0x2cfa56,_0x597d1e){_0x2cfa56=_0x2cfa56-0x0;var _0x546341=_0xe1e3[_0x2cfa56];return _0x546341;};'use strict';var Sequelize=require(_0x3e1e('0x0'));module[_0x3e1e('0x1')]={'body':{'type':Sequelize['TEXT'](_0x3e1e('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x3e1e('0x3')]('in','out'),'defaultValue':_0x3e1e('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x3e1e('0x5')]},'providerName':{'type':Sequelize[_0x3e1e('0x6')]},'providerResponse':{'type':Sequelize[_0x3e1e('0x7')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index c2dcd55..87ea736 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 _0xc4a6=['to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','redis','defaults','localhost','./openchannelMessage.socket','register','jayson/promise','client','http','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','sendStatus','status','offset','undefined','limit','count','set','json','apply','reject','save','update','end','stack','send','index','map','OpenchannelMessage','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','fields','options','find','create','body','destroy','params','describe','openchannel-interactions','accept','openchannel','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteraction','OpenchannelInteractionId','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','SELECT','contact','fullname','email','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','rejectMessage','ContactId','User','internal','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox'];(function(_0x49c73b,_0x4fe6e3){var _0x3cac41=function(_0x12efb9){while(--_0x12efb9){_0x49c73b['push'](_0x49c73b['shift']());}};_0x3cac41(++_0x4fe6e3);}(_0xc4a6,0x106));var _0x6c4a=function(_0x87239,_0x38c793){_0x87239=_0x87239-0x0;var _0x53af1e=_0xc4a6[_0x87239];return _0x53af1e;};'use strict';var emlformat=require(_0x6c4a('0x0'));var rimraf=require(_0x6c4a('0x1'));var zipdir=require(_0x6c4a('0x2'));var jsonpatch=require(_0x6c4a('0x3'));var rp=require(_0x6c4a('0x4'));var moment=require('moment');var BPromise=require(_0x6c4a('0x5'));var Mustache=require(_0x6c4a('0x6'));var util=require(_0x6c4a('0x7'));var path=require(_0x6c4a('0x8'));var sox=require(_0x6c4a('0x9'));var csv=require(_0x6c4a('0xa'));var ejs=require(_0x6c4a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6c4a('0xc'));var squel=require(_0x6c4a('0xd'));var crypto=require(_0x6c4a('0xe'));var jsforce=require(_0x6c4a('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x6c4a('0xa'));var querystring=require(_0x6c4a('0x10'));var Papa=require(_0x6c4a('0x11'));var Redis=require('ioredis');var authService=require(_0x6c4a('0x12'));var qs=require(_0x6c4a('0x13'));var as=require(_0x6c4a('0x14'));var hardwareService=require(_0x6c4a('0x15'));var logger=require(_0x6c4a('0x16'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6c4a('0x17'));var db=require('../../mysqldb')['db'];config[_0x6c4a('0x18')]=_[_0x6c4a('0x19')](config['redis'],{'host':_0x6c4a('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6c4a('0x18')]));require(_0x6c4a('0x1b'))[_0x6c4a('0x1c')](socket);var jayson=require(_0x6c4a('0x1d'));var client=jayson[_0x6c4a('0x1e')][_0x6c4a('0x1f')]({'port':0x232c});var client9002=jayson[_0x6c4a('0x1e')][_0x6c4a('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x148aa3,_0x124c66,_0x517cf8,_0x3d94a0){return new BPromise(function(_0x5b7b1f,_0x3243cb){var _0x1ece02=_0x3d94a0||client;return _0x1ece02[_0x6c4a('0x20')](_0x148aa3,_0x517cf8)[_0x6c4a('0x21')](function(_0x2249a7){logger[_0x6c4a('0x22')](_0x6c4a('0x23'),_0x124c66,_0x6c4a('0x24'));logger[_0x6c4a('0x25')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x124c66,_0x6c4a('0x24'),JSON['stringify'](_0x2249a7));if(_0x2249a7[_0x6c4a('0x26')]){if(_0x2249a7['error'][_0x6c4a('0x27')]===0x1f4){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x124c66,_0x2249a7[_0x6c4a('0x26')][_0x6c4a('0x28')]);return _0x3243cb(_0x2249a7[_0x6c4a('0x26')][_0x6c4a('0x28')]);}logger[_0x6c4a('0x26')](_0x6c4a('0x23'),_0x124c66,_0x2249a7[_0x6c4a('0x26')][_0x6c4a('0x28')]);return _0x5b7b1f(_0x2249a7[_0x6c4a('0x26')][_0x6c4a('0x28')]);}else{logger[_0x6c4a('0x22')](_0x6c4a('0x23'),_0x124c66,_0x6c4a('0x24'));_0x5b7b1f(_0x2249a7[_0x6c4a('0x29')]['message']);}})['catch'](function(_0x5eea0b){logger[_0x6c4a('0x26')](_0x6c4a('0x23'),_0x124c66,_0x5eea0b);_0x3243cb(_0x5eea0b);});});}function respondWithStatusCode(_0x3c5ce2,_0x5f3a50){_0x5f3a50=_0x5f3a50||0xcc;return function(_0x492fd2){if(_0x492fd2){return _0x3c5ce2[_0x6c4a('0x2a')](_0x5f3a50);}return _0x3c5ce2[_0x6c4a('0x2b')](_0x5f3a50)['end']();};}function respondWithResult(_0x3e71c2,_0x59557a){_0x59557a=_0x59557a||0xc8;return function(_0x1f246d){if(_0x1f246d){return _0x3e71c2[_0x6c4a('0x2b')](_0x59557a)['json'](_0x1f246d);}};}function respondWithFilteredResult(_0x446021,_0x4769a4){return function(_0x52885a){if(_0x52885a){var _0x318c2b=typeof _0x4769a4[_0x6c4a('0x2c')]===_0x6c4a('0x2d')&&typeof _0x4769a4[_0x6c4a('0x2e')]===_0x6c4a('0x2d');var _0x34ec03=_0x52885a[_0x6c4a('0x2f')];var _0xc03fcb=_0x318c2b?0x0:_0x4769a4[_0x6c4a('0x2c')];var _0x343e44=_0x318c2b?_0x52885a[_0x6c4a('0x2f')]:_0x4769a4[_0x6c4a('0x2c')]+_0x4769a4[_0x6c4a('0x2e')];var _0x2b1231;if(_0x343e44>=_0x34ec03){_0x343e44=_0x34ec03;_0x2b1231=0xc8;}else{_0x2b1231=0xce;}_0x446021[_0x6c4a('0x2b')](_0x2b1231);return _0x446021[_0x6c4a('0x30')]('Content-Range',_0xc03fcb+'-'+_0x343e44+'/'+_0x34ec03)[_0x6c4a('0x31')](_0x52885a);}return null;};}function patchUpdates(_0x5e8f71){return function(_0x1bdf72){try{jsonpatch[_0x6c4a('0x32')](_0x1bdf72,_0x5e8f71,!![]);}catch(_0x226aa8){return BPromise[_0x6c4a('0x33')](_0x226aa8);}return _0x1bdf72[_0x6c4a('0x34')]();};}function saveUpdates(_0x501716,_0x17eeca){return function(_0x827f0b){if(_0x827f0b){return _0x827f0b[_0x6c4a('0x35')](_0x501716)['then'](function(_0x2de9fe){return _0x2de9fe;});}return null;};}function removeEntity(_0x13bc86,_0x378aab){return function(_0x219ae3){if(_0x219ae3){return _0x219ae3['destroy']()[_0x6c4a('0x21')](function(){_0x13bc86[_0x6c4a('0x2b')](0xcc)[_0x6c4a('0x36')]();});}};}function handleEntityNotFound(_0x346dae,_0x2ff19e){return function(_0x33ae45){if(!_0x33ae45){_0x346dae['sendStatus'](0x194);}return _0x33ae45;};}function handleError(_0x128188,_0x242938){_0x242938=_0x242938||0x1f4;return function(_0x42a78a){logger[_0x6c4a('0x26')](_0x42a78a[_0x6c4a('0x37')]);if(_0x42a78a['name']){delete _0x42a78a['name'];}_0x128188[_0x6c4a('0x2b')](_0x242938)[_0x6c4a('0x38')](_0x42a78a);};}exports[_0x6c4a('0x39')]=function(_0x15d085,_0x35b75d){var _0x4e95e4={},_0x5c1193={},_0x2f4947={'count':0x0,'rows':[]};var _0x141c2f=_[_0x6c4a('0x3a')](db[_0x6c4a('0x3b')][_0x6c4a('0x3c')],function(_0x1283bc){return{'name':_0x1283bc[_0x6c4a('0x3d')],'type':_0x1283bc[_0x6c4a('0x3e')][_0x6c4a('0x3f')]};});_0x5c1193[_0x6c4a('0x40')]=_[_0x6c4a('0x3a')](_0x141c2f,_0x6c4a('0x41'));_0x5c1193[_0x6c4a('0x42')]=_[_0x6c4a('0x43')](_0x15d085[_0x6c4a('0x42')]);_0x5c1193[_0x6c4a('0x44')]=_[_0x6c4a('0x45')](_0x5c1193[_0x6c4a('0x40')],_0x5c1193['query']);_0x4e95e4['attributes']=_[_0x6c4a('0x45')](_0x5c1193['model'],qs['fields'](_0x15d085[_0x6c4a('0x42')]['fields']));_0x4e95e4[_0x6c4a('0x46')]=_0x4e95e4['attributes'][_0x6c4a('0x47')]?_0x4e95e4[_0x6c4a('0x46')]:_0x5c1193[_0x6c4a('0x40')];if(!_0x15d085[_0x6c4a('0x42')][_0x6c4a('0x48')](_0x6c4a('0x49'))){_0x4e95e4[_0x6c4a('0x2e')]=qs[_0x6c4a('0x2e')](_0x15d085[_0x6c4a('0x42')]['limit']);_0x4e95e4[_0x6c4a('0x2c')]=qs[_0x6c4a('0x2c')](_0x15d085['query']['offset']);}_0x4e95e4[_0x6c4a('0x4a')]=qs[_0x6c4a('0x4b')](_0x15d085[_0x6c4a('0x42')][_0x6c4a('0x4b')]);_0x4e95e4[_0x6c4a('0x4c')]=qs[_0x6c4a('0x44')](_[_0x6c4a('0x4d')](_0x15d085[_0x6c4a('0x42')],_0x5c1193['filters']),_0x141c2f);if(_0x15d085[_0x6c4a('0x42')][_0x6c4a('0x4e')]){_0x4e95e4[_0x6c4a('0x4c')]=_[_0x6c4a('0x4f')](_0x4e95e4['where'],{'$or':_['map'](_0x141c2f,function(_0x380f33){if(_0x380f33['type']!==_0x6c4a('0x50')){var _0x4cc8b6={};_0x4cc8b6[_0x380f33[_0x6c4a('0x41')]]={'$like':'%'+_0x15d085[_0x6c4a('0x42')][_0x6c4a('0x4e')]+'%'};return _0x4cc8b6;}})});}_0x4e95e4=_[_0x6c4a('0x4f')]({},_0x4e95e4,_0x15d085['options']);var _0x47b34e={'where':_0x4e95e4[_0x6c4a('0x4c')]};return db[_0x6c4a('0x3b')]['count'](_0x47b34e)[_0x6c4a('0x21')](function(_0x14d3ef){_0x2f4947['count']=_0x14d3ef;if(_0x15d085['query'][_0x6c4a('0x51')]){_0x4e95e4[_0x6c4a('0x52')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0x6c4a('0x53')](_0x4e95e4);})['then'](function(_0x352960){_0x2f4947[_0x6c4a('0x54')]=_0x352960;return _0x2f4947;})['then'](respondWithFilteredResult(_0x35b75d,_0x4e95e4))[_0x6c4a('0x55')](handleError(_0x35b75d,null));};exports[_0x6c4a('0x56')]=function(_0x4886c6,_0xda2c09){var _0x1e8822={'raw':!![],'where':{'id':_0x4886c6['params']['id']}},_0x4ec7d6={};_0x4ec7d6['model']=_['keys'](db['OpenchannelMessage'][_0x6c4a('0x3c')]);_0x4ec7d6[_0x6c4a('0x42')]=_[_0x6c4a('0x43')](_0x4886c6[_0x6c4a('0x42')]);_0x4ec7d6[_0x6c4a('0x44')]=_['intersection'](_0x4ec7d6[_0x6c4a('0x40')],_0x4ec7d6[_0x6c4a('0x42')]);_0x1e8822['attributes']=_[_0x6c4a('0x45')](_0x4ec7d6['model'],qs['fields'](_0x4886c6[_0x6c4a('0x42')][_0x6c4a('0x57')]));_0x1e8822[_0x6c4a('0x46')]=_0x1e8822[_0x6c4a('0x46')][_0x6c4a('0x47')]?_0x1e8822[_0x6c4a('0x46')]:_0x4ec7d6['model'];if(_0x4886c6[_0x6c4a('0x42')][_0x6c4a('0x51')]){_0x1e8822['include']=[{'all':!![]}];}_0x1e8822=_['merge']({},_0x1e8822,_0x4886c6[_0x6c4a('0x58')]);return db['OpenchannelMessage'][_0x6c4a('0x59')](_0x1e8822)[_0x6c4a('0x21')](handleEntityNotFound(_0xda2c09,null))[_0x6c4a('0x21')](respondWithResult(_0xda2c09,null))['catch'](handleError(_0xda2c09,null));};exports[_0x6c4a('0x5a')]=function(_0x5ad746,_0x40f053){return db[_0x6c4a('0x3b')]['create'](_0x5ad746[_0x6c4a('0x5b')],{})[_0x6c4a('0x21')](respondWithResult(_0x40f053,0xc9))[_0x6c4a('0x55')](handleError(_0x40f053,null));};exports['update']=function(_0x2cce5c,_0x4c8fa5){if(_0x2cce5c[_0x6c4a('0x5b')]['id']){delete _0x2cce5c[_0x6c4a('0x5b')]['id'];}return db['OpenchannelMessage'][_0x6c4a('0x59')]({'where':{'id':_0x2cce5c['params']['id']}})[_0x6c4a('0x21')](handleEntityNotFound(_0x4c8fa5,null))[_0x6c4a('0x21')](saveUpdates(_0x2cce5c['body'],null))[_0x6c4a('0x21')](respondWithResult(_0x4c8fa5,null))[_0x6c4a('0x55')](handleError(_0x4c8fa5,null));};exports[_0x6c4a('0x5c')]=function(_0x1d38ee,_0x1e24e5){return db[_0x6c4a('0x3b')][_0x6c4a('0x59')]({'where':{'id':_0x1d38ee[_0x6c4a('0x5d')]['id']}})[_0x6c4a('0x21')](handleEntityNotFound(_0x1e24e5,null))['then'](removeEntity(_0x1e24e5,null))[_0x6c4a('0x55')](handleError(_0x1e24e5,null));};exports[_0x6c4a('0x5e')]=function(_0x4ca14e,_0x35dabf){return db[_0x6c4a('0x3b')][_0x6c4a('0x5e')]()[_0x6c4a('0x21')](respondWithResult(_0x35dabf,null))[_0x6c4a('0x55')](handleError(_0x35dabf,null));};var interaction_log=require('../../config/logger')(_0x6c4a('0x5f'));exports[_0x6c4a('0x60')]=function(_0x2f4255,_0x35cf,_0x33723e){var _0x31feb9={'agent':{},'channel':_0x6c4a('0x61')};if(_0x2f4255[_0x6c4a('0x5b')]['id']){delete _0x2f4255[_0x6c4a('0x5b')]['id'];}_0x2f4255[_0x6c4a('0x5b')][_0x6c4a('0x62')]=!![];_0x2f4255[_0x6c4a('0x5b')]['readAt']=moment()[_0x6c4a('0x63')](_0x6c4a('0x64'));_0x2f4255[_0x6c4a('0x5b')][_0x6c4a('0x65')]=_0x2f4255[_0x6c4a('0x5b')][_0x6c4a('0x65')]||_0x2f4255[_0x6c4a('0x66')]['id'];_0x31feb9[_0x6c4a('0x67')]['id']=_0x2f4255[_0x6c4a('0x5b')]['UserId'];return db[_0x6c4a('0x3b')][_0x6c4a('0x59')]({'where':{'id':_0x2f4255[_0x6c4a('0x5d')]['id'],'UserId':null}})[_0x6c4a('0x21')](handleEntityNotFound(_0x35cf,null))['then'](saveUpdates(_0x2f4255[_0x6c4a('0x5b')],null))['then'](function(_0x4aad84){if(_0x4aad84){_0x31feb9['message']=_0x4aad84[_0x6c4a('0x68')]({'plain':!![]});return db[_0x6c4a('0x69')][_0x6c4a('0x59')]({'where':{'id':_0x4aad84[_0x6c4a('0x6a')]}});}return null;})['then'](handleEntityNotFound(_0x35cf,null))[_0x6c4a('0x21')](function(_0x3d9aea){if(_0x3d9aea){return _0x3d9aea[_0x6c4a('0x35')]({'UserId':_0x2f4255[_0x6c4a('0x5b')][_0x6c4a('0x65')],'read1stAt':_['isNil'](_0x3d9aea[_0x6c4a('0x6b')])?moment()[_0x6c4a('0x63')](_0x6c4a('0x64')):undefined});}return null;})[_0x6c4a('0x21')](function(_0x2859b2){if(_0x2859b2){_0x31feb9[_0x6c4a('0x6c')]=_0x2859b2[_0x6c4a('0x68')]({'plain':!![]});interaction_log[_0x6c4a('0x22')](_0x6c4a('0x6d'),_0x2f4255['user']['id'],_0x2f4255['user'][_0x6c4a('0x41')],_0x2f4255['user'][_0x6c4a('0x6e')],_0x31feb9['interaction']['id'],_0x2f4255['body']?JSON[_0x6c4a('0x6f')](_0x2f4255[_0x6c4a('0x5b')]):'null');return respondWithRpcPromise(_0x6c4a('0x70'),_0x6c4a('0x71'),_0x31feb9);}return null;})[_0x6c4a('0x21')](function(_0x149472){var _0x4609c3=_0x6c4a('0x72')+_0x149472[_0x6c4a('0x28')]['ContactId'];return db[_0x6c4a('0x73')][_0x6c4a('0x42')](_0x4609c3,{'type':db[_0x6c4a('0x74')]['QueryTypes'][_0x6c4a('0x75')],'raw':!![]})[_0x6c4a('0x21')](function(_0x3e1106){return _0x3e1106;});})[_0x6c4a('0x21')](function(_0x299c18){if(_0x299c18){_0x31feb9[_0x6c4a('0x28')][_0x6c4a('0x76')]=_0x299c18[0x0];if(!_0x2f4255[_0x6c4a('0x5b')]['UserId'])return;return db['User'][_0x6c4a('0x59')]({'where':{'id':_0x2f4255['body']['UserId'],'role':_0x6c4a('0x67')},'attributes':['id',_0x6c4a('0x41'),_0x6c4a('0x77'),_0x6c4a('0x78'),'internal'],'raw':!![]});}return null;})[_0x6c4a('0x21')](function(_0x23f6f9){if(!_0x23f6f9)return null;_0x31feb9['message'][_0x6c4a('0x67')]=_0x23f6f9;return _0x31feb9;})[_0x6c4a('0x21')](function(_0x510432){if(_0x510432){if(_0x2f4255['body'][_0x6c4a('0x79')]){_0x31feb9[_0x6c4a('0x28')][_0x6c4a('0x7a')]=util[_0x6c4a('0x63')](_0x6c4a('0x7b'),_0x2f4255[_0x6c4a('0x66')]['name']);_0x31feb9[_0x6c4a('0x28')][_0x6c4a('0x7c')]=_0x31feb9[_0x6c4a('0x7c')];_0x31feb9['message'][_0x6c4a('0x7d')]=_0x31feb9[_0x6c4a('0x7c')];_0x31feb9[_0x6c4a('0x28')][_0x6c4a('0x7e')]=_0x6c4a('0x60');return respondWithRpcPromise(_0x6c4a('0x7f'),_0x6c4a('0x7f'),{'event':_0x6c4a('0x80'),'message':_0x31feb9[_0x6c4a('0x28')]},client9002)['then'](function(){return _0x31feb9;});}return _0x31feb9;}return null;})[_0x6c4a('0x21')](respondWithResult(_0x35cf,null))[_0x6c4a('0x55')](handleError(_0x35cf,null));};var interaction_log=require(_0x6c4a('0x16'))(_0x6c4a('0x5f'));exports['reject']=function(_0x3aad12,_0x530d9f,_0x5e452f){var _0x5656ac={'agent':{},'channel':'openchannel'};if(_0x3aad12[_0x6c4a('0x5b')]['id']){delete _0x3aad12[_0x6c4a('0x5b')]['id'];}_0x3aad12[_0x6c4a('0x5b')][_0x6c4a('0x65')]=_0x3aad12['body'][_0x6c4a('0x65')]||_0x3aad12[_0x6c4a('0x66')]['id'];_0x5656ac['agent']['id']=_0x3aad12[_0x6c4a('0x5b')][_0x6c4a('0x65')];return db['OpenchannelMessage']['find']({'where':{'id':_0x3aad12[_0x6c4a('0x5d')]['id'],'UserId':null}})[_0x6c4a('0x21')](handleEntityNotFound(_0x530d9f,null))['then'](function(_0x16695c){if(_0x16695c){_0x5656ac[_0x6c4a('0x28')]=_0x16695c[_0x6c4a('0x68')]({'plain':!![]});return db[_0x6c4a('0x69')][_0x6c4a('0x59')]({'where':{'id':_0x16695c[_0x6c4a('0x6a')]}});}return null;})['then'](handleEntityNotFound(_0x530d9f,null))[_0x6c4a('0x21')](function(_0xf3414b){if(_0xf3414b){_0x5656ac[_0x6c4a('0x6c')]=_0xf3414b[_0x6c4a('0x68')]({'plain':!![]});interaction_log[_0x6c4a('0x22')](_0x6c4a('0x81'),_0x3aad12['user']['id'],_0x3aad12[_0x6c4a('0x66')]['name'],_0x3aad12[_0x6c4a('0x66')][_0x6c4a('0x6e')],_0x5656ac[_0x6c4a('0x6c')]['id'],_0x3aad12[_0x6c4a('0x5b')]?JSON[_0x6c4a('0x6f')](_0x3aad12[_0x6c4a('0x5b')]):_0x6c4a('0x82'));return respondWithRpcPromise('RejectMessage',_0x6c4a('0x83'),_0x5656ac);}return null;})['then'](function(_0x5be0c0){var _0x54ca42=_0x6c4a('0x72')+_0x5be0c0[_0x6c4a('0x28')][_0x6c4a('0x84')];return db[_0x6c4a('0x73')][_0x6c4a('0x42')](_0x54ca42,{'type':db['Sequelize']['QueryTypes'][_0x6c4a('0x75')],'raw':!![]})[_0x6c4a('0x21')](function(_0x311866){return _0x311866;});})[_0x6c4a('0x21')](function(_0x19f9b1){if(_0x19f9b1){_0x5656ac[_0x6c4a('0x28')]['contact']=_0x19f9b1[0x0];if(!_0x3aad12[_0x6c4a('0x5b')]['UserId'])return;return db[_0x6c4a('0x85')][_0x6c4a('0x59')]({'where':{'id':_0x3aad12[_0x6c4a('0x5b')][_0x6c4a('0x65')],'role':_0x6c4a('0x67')},'attributes':['id',_0x6c4a('0x41'),_0x6c4a('0x77'),_0x6c4a('0x78'),_0x6c4a('0x86')],'raw':!![]});}return null;})['then'](function(_0x23bc61){if(!_0x23bc61)return null;_0x5656ac[_0x6c4a('0x28')]['agent']=_0x23bc61;return _0x5656ac;})['then'](function(_0x394b07){if(_0x394b07){_0x394b07[_0x6c4a('0x28')][_0x6c4a('0x7a')]=util['format'](_0x6c4a('0x7b'),_0x3aad12[_0x6c4a('0x66')][_0x6c4a('0x41')]);_0x394b07[_0x6c4a('0x28')][_0x6c4a('0x7c')]=_0x5656ac[_0x6c4a('0x7c')];_0x394b07[_0x6c4a('0x28')][_0x6c4a('0x7d')]=_0x5656ac[_0x6c4a('0x7c')];_0x394b07['message'][_0x6c4a('0x7e')]=_0x6c4a('0x33');respondWithRpcPromise(_0x6c4a('0x7f'),_0x6c4a('0x7f'),{'event':_0x6c4a('0x87'),'message':_0x394b07[_0x6c4a('0x28')]},client9002);return _0x5656ac;}return null;})[_0x6c4a('0x21')](respondWithResult(_0x530d9f,null))[_0x6c4a('0x55')](handleError(_0x530d9f,null));}; \ No newline at end of file +var _0x82c1=['ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelMessage.socket','register','client','http','info','request\x20sent','debug','stringify','error','code','OpenchannelMessage,\x20%s,\x20%s','message','catch','sendStatus','status','offset','limit','count','set','Content-Range','json','apply','reject','destroy','then','end','stack','name','send','index','OpenchannelMessage','rawAttributes','fieldName','key','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','map','type','VIRTUAL','filter','options','includeAll','include','findAll','show','params','keys','find','create','body','openchannel-interactions','read','readAt','format','UserId','user','agent','OpenchannelInteraction','OpenchannelInteractionId','isNil','interaction','role','null','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','contact','fullname','email','internal','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','get','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','SELECT','User','rejectmessage','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x2bdcfd,_0x32697d){var _0x53a635=function(_0x5de676){while(--_0x5de676){_0x2bdcfd['push'](_0x2bdcfd['shift']());}};_0x53a635(++_0x32697d);}(_0x82c1,0x1f3));var _0x182c=function(_0x5add22,_0x274169){_0x5add22=_0x5add22-0x0;var _0x2aa3ab=_0x82c1[_0x5add22];return _0x2aa3ab;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x182c('0x0'));var jsonpatch=require(_0x182c('0x1'));var rp=require(_0x182c('0x2'));var moment=require(_0x182c('0x3'));var BPromise=require(_0x182c('0x4'));var Mustache=require(_0x182c('0x5'));var util=require(_0x182c('0x6'));var path=require(_0x182c('0x7'));var sox=require(_0x182c('0x8'));var csv=require('to-csv');var ejs=require(_0x182c('0x9'));var fs=require('fs');var fs_extra=require(_0x182c('0xa'));var _=require('lodash');var squel=require(_0x182c('0xb'));var crypto=require(_0x182c('0xc'));var jsforce=require(_0x182c('0xd'));var deskjs=require(_0x182c('0xe'));var toCsv=require(_0x182c('0xf'));var querystring=require('querystring');var Papa=require(_0x182c('0x10'));var Redis=require(_0x182c('0x11'));var authService=require(_0x182c('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x182c('0x13'));var hardwareService=require(_0x182c('0x14'));var logger=require(_0x182c('0x15'))(_0x182c('0x16'));var utils=require(_0x182c('0x17'));var config=require(_0x182c('0x18'));var licenseUtil=require(_0x182c('0x19'));var db=require(_0x182c('0x1a'))['db'];config[_0x182c('0x1b')]=_[_0x182c('0x1c')](config[_0x182c('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x182c('0x1d'))(new Redis(config[_0x182c('0x1b')]));require(_0x182c('0x1e'))[_0x182c('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson[_0x182c('0x20')][_0x182c('0x21')]({'port':0x232c});var client9002=jayson['client'][_0x182c('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x431dee,_0x2f79d4,_0x276e8f,_0x388bc2){return new BPromise(function(_0x45ae45,_0x52d886){var _0x17fdc7=_0x388bc2||client;return _0x17fdc7['request'](_0x431dee,_0x276e8f)['then'](function(_0x72d01e){logger[_0x182c('0x22')]('OpenchannelMessage,\x20%s,\x20%s',_0x2f79d4,_0x182c('0x23'));logger[_0x182c('0x24')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x2f79d4,'request\x20sent',JSON[_0x182c('0x25')](_0x72d01e));if(_0x72d01e[_0x182c('0x26')]){if(_0x72d01e['error'][_0x182c('0x27')]===0x1f4){logger[_0x182c('0x26')](_0x182c('0x28'),_0x2f79d4,_0x72d01e['error'][_0x182c('0x29')]);return _0x52d886(_0x72d01e['error']['message']);}logger[_0x182c('0x26')]('OpenchannelMessage,\x20%s,\x20%s',_0x2f79d4,_0x72d01e['error'][_0x182c('0x29')]);return _0x45ae45(_0x72d01e[_0x182c('0x26')]['message']);}else{logger[_0x182c('0x22')](_0x182c('0x28'),_0x2f79d4,_0x182c('0x23'));_0x45ae45(_0x72d01e['result'][_0x182c('0x29')]);}})[_0x182c('0x2a')](function(_0xf3a8b4){logger[_0x182c('0x26')]('OpenchannelMessage,\x20%s,\x20%s',_0x2f79d4,_0xf3a8b4);_0x52d886(_0xf3a8b4);});});}function respondWithStatusCode(_0x519714,_0x455b61){_0x455b61=_0x455b61||0xcc;return function(_0x917cda){if(_0x917cda){return _0x519714[_0x182c('0x2b')](_0x455b61);}return _0x519714[_0x182c('0x2c')](_0x455b61)['end']();};}function respondWithResult(_0x2bfb84,_0x2f97df){_0x2f97df=_0x2f97df||0xc8;return function(_0x140677){if(_0x140677){return _0x2bfb84[_0x182c('0x2c')](_0x2f97df)['json'](_0x140677);}};}function respondWithFilteredResult(_0x5395bb,_0x3fb8ce){return function(_0x18c4e2){if(_0x18c4e2){var _0xc00f16=typeof _0x3fb8ce[_0x182c('0x2d')]==='undefined'&&typeof _0x3fb8ce[_0x182c('0x2e')]==='undefined';var _0x290b71=_0x18c4e2[_0x182c('0x2f')];var _0x3362aa=_0xc00f16?0x0:_0x3fb8ce[_0x182c('0x2d')];var _0x1e9a32=_0xc00f16?_0x18c4e2[_0x182c('0x2f')]:_0x3fb8ce[_0x182c('0x2d')]+_0x3fb8ce[_0x182c('0x2e')];var _0x46741d;if(_0x1e9a32>=_0x290b71){_0x1e9a32=_0x290b71;_0x46741d=0xc8;}else{_0x46741d=0xce;}_0x5395bb[_0x182c('0x2c')](_0x46741d);return _0x5395bb[_0x182c('0x30')](_0x182c('0x31'),_0x3362aa+'-'+_0x1e9a32+'/'+_0x290b71)[_0x182c('0x32')](_0x18c4e2);}return null;};}function patchUpdates(_0x128567){return function(_0x116c0d){try{jsonpatch[_0x182c('0x33')](_0x116c0d,_0x128567,!![]);}catch(_0x2b0472){return BPromise[_0x182c('0x34')](_0x2b0472);}return _0x116c0d['save']();};}function saveUpdates(_0x56bbe4,_0x22a770){return function(_0x2d986b){if(_0x2d986b){return _0x2d986b['update'](_0x56bbe4)['then'](function(_0x50db96){return _0x50db96;});}return null;};}function removeEntity(_0x27a25c,_0x1e48c0){return function(_0x2acd63){if(_0x2acd63){return _0x2acd63[_0x182c('0x35')]()[_0x182c('0x36')](function(){_0x27a25c['status'](0xcc)[_0x182c('0x37')]();});}};}function handleEntityNotFound(_0x219bad,_0x5ca9d9){return function(_0x5664ba){if(!_0x5664ba){_0x219bad[_0x182c('0x2b')](0x194);}return _0x5664ba;};}function handleError(_0x5b55e5,_0x4d4e4f){_0x4d4e4f=_0x4d4e4f||0x1f4;return function(_0x5a9365){logger['error'](_0x5a9365[_0x182c('0x38')]);if(_0x5a9365['name']){delete _0x5a9365[_0x182c('0x39')];}_0x5b55e5[_0x182c('0x2c')](_0x4d4e4f)[_0x182c('0x3a')](_0x5a9365);};}exports[_0x182c('0x3b')]=function(_0x52b939,_0x1376e6){var _0x28b1f5={},_0x4b03c1={},_0x8507ad={'count':0x0,'rows':[]};var _0x500ffb=_['map'](db[_0x182c('0x3c')][_0x182c('0x3d')],function(_0x3cf854){return{'name':_0x3cf854[_0x182c('0x3e')],'type':_0x3cf854['type'][_0x182c('0x3f')]};});_0x4b03c1['model']=_['map'](_0x500ffb,'name');_0x4b03c1[_0x182c('0x40')]=_['keys'](_0x52b939[_0x182c('0x40')]);_0x4b03c1[_0x182c('0x41')]=_[_0x182c('0x42')](_0x4b03c1['model'],_0x4b03c1[_0x182c('0x40')]);_0x28b1f5[_0x182c('0x43')]=_[_0x182c('0x42')](_0x4b03c1[_0x182c('0x44')],qs[_0x182c('0x45')](_0x52b939[_0x182c('0x40')][_0x182c('0x45')]));_0x28b1f5['attributes']=_0x28b1f5[_0x182c('0x43')][_0x182c('0x46')]?_0x28b1f5[_0x182c('0x43')]:_0x4b03c1[_0x182c('0x44')];if(!_0x52b939[_0x182c('0x40')][_0x182c('0x47')](_0x182c('0x48'))){_0x28b1f5[_0x182c('0x2e')]=qs[_0x182c('0x2e')](_0x52b939[_0x182c('0x40')]['limit']);_0x28b1f5[_0x182c('0x2d')]=qs[_0x182c('0x2d')](_0x52b939['query'][_0x182c('0x2d')]);}_0x28b1f5[_0x182c('0x49')]=qs[_0x182c('0x4a')](_0x52b939['query'][_0x182c('0x4a')]);_0x28b1f5[_0x182c('0x4b')]=qs['filters'](_['pick'](_0x52b939[_0x182c('0x40')],_0x4b03c1['filters']),_0x500ffb);if(_0x52b939[_0x182c('0x40')]['filter']){_0x28b1f5['where']=_[_0x182c('0x4c')](_0x28b1f5[_0x182c('0x4b')],{'$or':_[_0x182c('0x4d')](_0x500ffb,function(_0x1b2430){if(_0x1b2430[_0x182c('0x4e')]!==_0x182c('0x4f')){var _0x562457={};_0x562457[_0x1b2430['name']]={'$like':'%'+_0x52b939[_0x182c('0x40')][_0x182c('0x50')]+'%'};return _0x562457;}})});}_0x28b1f5=_[_0x182c('0x4c')]({},_0x28b1f5,_0x52b939[_0x182c('0x51')]);var _0x419941={'where':_0x28b1f5[_0x182c('0x4b')]};return db['OpenchannelMessage'][_0x182c('0x2f')](_0x419941)[_0x182c('0x36')](function(_0x3a59cd){_0x8507ad[_0x182c('0x2f')]=_0x3a59cd;if(_0x52b939[_0x182c('0x40')][_0x182c('0x52')]){_0x28b1f5[_0x182c('0x53')]=[{'all':!![]}];}return db[_0x182c('0x3c')][_0x182c('0x54')](_0x28b1f5);})[_0x182c('0x36')](function(_0x2c23bd){_0x8507ad['rows']=_0x2c23bd;return _0x8507ad;})[_0x182c('0x36')](respondWithFilteredResult(_0x1376e6,_0x28b1f5))[_0x182c('0x2a')](handleError(_0x1376e6,null));};exports[_0x182c('0x55')]=function(_0x1700b0,_0x2f497a){var _0x2bc60d={'raw':!![],'where':{'id':_0x1700b0[_0x182c('0x56')]['id']}},_0x597d35={};_0x597d35[_0x182c('0x44')]=_['keys'](db[_0x182c('0x3c')][_0x182c('0x3d')]);_0x597d35[_0x182c('0x40')]=_[_0x182c('0x57')](_0x1700b0[_0x182c('0x40')]);_0x597d35['filters']=_[_0x182c('0x42')](_0x597d35['model'],_0x597d35[_0x182c('0x40')]);_0x2bc60d[_0x182c('0x43')]=_[_0x182c('0x42')](_0x597d35['model'],qs[_0x182c('0x45')](_0x1700b0[_0x182c('0x40')][_0x182c('0x45')]));_0x2bc60d['attributes']=_0x2bc60d[_0x182c('0x43')]['length']?_0x2bc60d[_0x182c('0x43')]:_0x597d35[_0x182c('0x44')];if(_0x1700b0['query'][_0x182c('0x52')]){_0x2bc60d[_0x182c('0x53')]=[{'all':!![]}];}_0x2bc60d=_[_0x182c('0x4c')]({},_0x2bc60d,_0x1700b0[_0x182c('0x51')]);return db[_0x182c('0x3c')][_0x182c('0x58')](_0x2bc60d)['then'](handleEntityNotFound(_0x2f497a,null))['then'](respondWithResult(_0x2f497a,null))['catch'](handleError(_0x2f497a,null));};exports['create']=function(_0x3e6510,_0x58dc6b){return db['OpenchannelMessage'][_0x182c('0x59')](_0x3e6510[_0x182c('0x5a')],{})[_0x182c('0x36')](respondWithResult(_0x58dc6b,0xc9))[_0x182c('0x2a')](handleError(_0x58dc6b,null));};exports['update']=function(_0x72ba45,_0x24b13d){if(_0x72ba45['body']['id']){delete _0x72ba45[_0x182c('0x5a')]['id'];}return db[_0x182c('0x3c')][_0x182c('0x58')]({'where':{'id':_0x72ba45[_0x182c('0x56')]['id']}})['then'](handleEntityNotFound(_0x24b13d,null))[_0x182c('0x36')](saveUpdates(_0x72ba45[_0x182c('0x5a')],null))[_0x182c('0x36')](respondWithResult(_0x24b13d,null))['catch'](handleError(_0x24b13d,null));};exports[_0x182c('0x35')]=function(_0xc43e6e,_0x1df13f){return db[_0x182c('0x3c')][_0x182c('0x58')]({'where':{'id':_0xc43e6e[_0x182c('0x56')]['id']}})['then'](handleEntityNotFound(_0x1df13f,null))['then'](removeEntity(_0x1df13f,null))[_0x182c('0x2a')](handleError(_0x1df13f,null));};exports['describe']=function(_0x15baef,_0x4e8095){return db[_0x182c('0x3c')]['describe']()[_0x182c('0x36')](respondWithResult(_0x4e8095,null))[_0x182c('0x2a')](handleError(_0x4e8095,null));};var interaction_log=require('../../config/logger')(_0x182c('0x5b'));exports['accept']=function(_0x551cc1,_0x533deb,_0x23274c){var _0x12f17a={'agent':{},'channel':'openchannel'};if(_0x551cc1[_0x182c('0x5a')]['id']){delete _0x551cc1[_0x182c('0x5a')]['id'];}_0x551cc1['body'][_0x182c('0x5c')]=!![];_0x551cc1[_0x182c('0x5a')][_0x182c('0x5d')]=moment()[_0x182c('0x5e')]('YYYY-MM-DD\x20HH:mm:ss');_0x551cc1[_0x182c('0x5a')][_0x182c('0x5f')]=_0x551cc1[_0x182c('0x5a')]['UserId']||_0x551cc1[_0x182c('0x60')]['id'];_0x12f17a[_0x182c('0x61')]['id']=_0x551cc1[_0x182c('0x5a')][_0x182c('0x5f')];return db[_0x182c('0x3c')][_0x182c('0x58')]({'where':{'id':_0x551cc1[_0x182c('0x56')]['id'],'UserId':null}})[_0x182c('0x36')](handleEntityNotFound(_0x533deb,null))['then'](saveUpdates(_0x551cc1[_0x182c('0x5a')],null))[_0x182c('0x36')](function(_0xe6d7d4){if(_0xe6d7d4){_0x12f17a[_0x182c('0x29')]=_0xe6d7d4['get']({'plain':!![]});return db[_0x182c('0x62')][_0x182c('0x58')]({'where':{'id':_0xe6d7d4[_0x182c('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x533deb,null))[_0x182c('0x36')](function(_0x4fdafa){if(_0x4fdafa){return _0x4fdafa['update']({'UserId':_0x551cc1['body'][_0x182c('0x5f')],'read1stAt':_[_0x182c('0x64')](_0x4fdafa['read1stAt'])?moment()[_0x182c('0x5e')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x1b47c3){if(_0x1b47c3){_0x12f17a[_0x182c('0x65')]=_0x1b47c3['get']({'plain':!![]});interaction_log[_0x182c('0x22')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x551cc1[_0x182c('0x60')]['id'],_0x551cc1[_0x182c('0x60')][_0x182c('0x39')],_0x551cc1['user'][_0x182c('0x66')],_0x12f17a[_0x182c('0x65')]['id'],_0x551cc1[_0x182c('0x5a')]?JSON[_0x182c('0x25')](_0x551cc1['body']):_0x182c('0x67'));return respondWithRpcPromise('AcceptMessage',_0x182c('0x68'),_0x12f17a);}return null;})['then'](function(_0x123e7a){var _0x3b87b0='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x123e7a[_0x182c('0x29')][_0x182c('0x69')];return db[_0x182c('0x6a')][_0x182c('0x40')](_0x3b87b0,{'type':db[_0x182c('0x6b')][_0x182c('0x6c')]['SELECT'],'raw':!![]})[_0x182c('0x36')](function(_0x357d76){return _0x357d76;});})[_0x182c('0x36')](function(_0x9e885f){if(_0x9e885f){_0x12f17a[_0x182c('0x29')][_0x182c('0x6d')]=_0x9e885f[0x0];if(!_0x551cc1[_0x182c('0x5a')][_0x182c('0x5f')])return;return db['User'][_0x182c('0x58')]({'where':{'id':_0x551cc1['body']['UserId'],'role':_0x182c('0x61')},'attributes':['id',_0x182c('0x39'),_0x182c('0x6e'),_0x182c('0x6f'),_0x182c('0x70')],'raw':!![]});}return null;})['then'](function(_0x32ece5){if(!_0x32ece5)return null;_0x12f17a['message'][_0x182c('0x61')]=_0x32ece5;return _0x12f17a;})[_0x182c('0x36')](function(_0x5dc45a){if(_0x5dc45a){if(_0x551cc1[_0x182c('0x5a')]['manual']){_0x12f17a[_0x182c('0x29')][_0x182c('0x71')]=util['format'](_0x182c('0x72'),_0x551cc1[_0x182c('0x60')][_0x182c('0x39')]);_0x12f17a[_0x182c('0x29')][_0x182c('0x73')]=_0x12f17a['channel'];_0x12f17a[_0x182c('0x29')][_0x182c('0x74')]=_0x12f17a[_0x182c('0x73')];_0x12f17a[_0x182c('0x29')][_0x182c('0x75')]='accept';return respondWithRpcPromise(_0x182c('0x76'),_0x182c('0x76'),{'event':_0x182c('0x77'),'message':_0x12f17a[_0x182c('0x29')]},client9002)[_0x182c('0x36')](function(){return _0x12f17a;});}return _0x12f17a;}return null;})['then'](respondWithResult(_0x533deb,null))[_0x182c('0x2a')](handleError(_0x533deb,null));};var interaction_log=require(_0x182c('0x15'))(_0x182c('0x5b'));exports[_0x182c('0x34')]=function(_0x237262,_0x4fb346,_0x2491ce){var _0x48db0d={'agent':{},'channel':'openchannel'};if(_0x237262[_0x182c('0x5a')]['id']){delete _0x237262[_0x182c('0x5a')]['id'];}_0x237262[_0x182c('0x5a')][_0x182c('0x5f')]=_0x237262['body'][_0x182c('0x5f')]||_0x237262[_0x182c('0x60')]['id'];_0x48db0d[_0x182c('0x61')]['id']=_0x237262['body']['UserId'];return db[_0x182c('0x3c')][_0x182c('0x58')]({'where':{'id':_0x237262[_0x182c('0x56')]['id'],'UserId':null}})[_0x182c('0x36')](handleEntityNotFound(_0x4fb346,null))[_0x182c('0x36')](function(_0xde4b93){if(_0xde4b93){_0x48db0d[_0x182c('0x29')]=_0xde4b93['get']({'plain':!![]});return db[_0x182c('0x62')][_0x182c('0x58')]({'where':{'id':_0xde4b93[_0x182c('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x4fb346,null))[_0x182c('0x36')](function(_0x4ac7ed){if(_0x4ac7ed){_0x48db0d['interaction']=_0x4ac7ed[_0x182c('0x78')]({'plain':!![]});interaction_log[_0x182c('0x22')](_0x182c('0x79'),_0x237262[_0x182c('0x60')]['id'],_0x237262['user'][_0x182c('0x39')],_0x237262[_0x182c('0x60')]['role'],_0x48db0d[_0x182c('0x65')]['id'],_0x237262[_0x182c('0x5a')]?JSON[_0x182c('0x25')](_0x237262[_0x182c('0x5a')]):'null');return respondWithRpcPromise('RejectMessage',_0x182c('0x7a'),_0x48db0d);}return null;})[_0x182c('0x36')](function(_0x2a02e3){var _0x48373d=_0x182c('0x7b')+_0x2a02e3[_0x182c('0x29')]['ContactId'];return db[_0x182c('0x6a')][_0x182c('0x40')](_0x48373d,{'type':db['Sequelize'][_0x182c('0x6c')][_0x182c('0x7c')],'raw':!![]})[_0x182c('0x36')](function(_0x2e02f1){return _0x2e02f1;});})[_0x182c('0x36')](function(_0x3bd1fe){if(_0x3bd1fe){_0x48db0d[_0x182c('0x29')][_0x182c('0x6d')]=_0x3bd1fe[0x0];if(!_0x237262[_0x182c('0x5a')][_0x182c('0x5f')])return;return db[_0x182c('0x7d')][_0x182c('0x58')]({'where':{'id':_0x237262[_0x182c('0x5a')][_0x182c('0x5f')],'role':_0x182c('0x61')},'attributes':['id',_0x182c('0x39'),'fullname',_0x182c('0x6f'),'internal'],'raw':!![]});}return null;})['then'](function(_0x1254d3){if(!_0x1254d3)return null;_0x48db0d[_0x182c('0x29')][_0x182c('0x61')]=_0x1254d3;return _0x48db0d;})[_0x182c('0x36')](function(_0x46bb5b){if(_0x46bb5b){_0x46bb5b[_0x182c('0x29')][_0x182c('0x71')]=util[_0x182c('0x5e')]('SIP/%s',_0x237262[_0x182c('0x60')][_0x182c('0x39')]);_0x46bb5b[_0x182c('0x29')][_0x182c('0x73')]=_0x48db0d['channel'];_0x46bb5b[_0x182c('0x29')][_0x182c('0x74')]=_0x48db0d[_0x182c('0x73')];_0x46bb5b['message']['event']=_0x182c('0x34');respondWithRpcPromise(_0x182c('0x76'),_0x182c('0x76'),{'event':_0x182c('0x7e'),'message':_0x46bb5b[_0x182c('0x29')]},client9002);return _0x48db0d;}return null;})[_0x182c('0x36')](respondWithResult(_0x4fb346,null))[_0x182c('0x2a')](handleError(_0x4fb346,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 2860281..00bda60 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 _0x55ec=['save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','OpenchannelMessage','setMaxListeners'];(function(_0x439609,_0x174594){var _0x1e508a=function(_0x1d83d1){while(--_0x1d83d1){_0x439609['push'](_0x439609['shift']());}};_0x1e508a(++_0x174594);}(_0x55ec,0xd8));var _0xc55e=function(_0x4e6eb2,_0x16a451){_0x4e6eb2=_0x4e6eb2-0x0;var _0x4e0c1c=_0x55ec[_0x4e6eb2];return _0x4e0c1c;};'use strict';var EventEmitter=require(_0xc55e('0x0'));var OpenchannelMessage=require(_0xc55e('0x1'))['db'][_0xc55e('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xc55e('0x3')](0x0);var events={'afterCreate':_0xc55e('0x4'),'afterUpdate':_0xc55e('0x5'),'afterDestroy':_0xc55e('0x6')};function emitEvent(_0x1fbc7){return function(_0x26b0ca,_0x4cc22e,_0x35d6ba){OpenchannelMessageEvents[_0xc55e('0x7')](_0x1fbc7+':'+_0x26b0ca['id'],_0x26b0ca);OpenchannelMessageEvents[_0xc55e('0x7')](_0x1fbc7,_0x26b0ca);_0x35d6ba(null);};}for(var e in events){if(events[_0xc55e('0x8')](e)){var event=events[e];OpenchannelMessage[_0xc55e('0x9')](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file +var _0x4691=['exports','events','OpenchannelMessage','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x26a3f0,_0x1e237b){var _0x289529=function(_0x2c2ea5){while(--_0x2c2ea5){_0x26a3f0['push'](_0x26a3f0['shift']());}};_0x289529(++_0x1e237b);}(_0x4691,0x191));var _0x1469=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x4691[_0x4b055c];return _0x4b62bb;};'use strict';var EventEmitter=require(_0x1469('0x0'));var OpenchannelMessage=require('../../mysqldb')['db'][_0x1469('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x1469('0x2')](0x0);var events={'afterCreate':_0x1469('0x3'),'afterUpdate':'update','afterDestroy':_0x1469('0x4')};function emitEvent(_0x4c73e4){return function(_0x102efe,_0x5a27d3,_0x4aea0f){OpenchannelMessageEvents['emit'](_0x4c73e4+':'+_0x102efe['id'],_0x102efe);OpenchannelMessageEvents[_0x1469('0x5')](_0x4c73e4,_0x102efe);_0x4aea0f(null);};}for(var e in events){if(events[_0x1469('0x6')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0x1469('0x7')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index e05dfcb..1d2cff7 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 _0xbe14=['path','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','UserId','OpenchannelInteraction','OpenchannelInteractionId','then','update','createdAt','catch','error','CmContact','describe','OpenchannelAccount','OpenchannelAccountId','Interactions','get','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','length','omit','method','GET','Message\x20%d\x20forwarded\x20to\x20%s','threadId','body','Interaction','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xbe14,0x15f));var _0x4be1=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xbe14[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0x4be1('0x0'));var util=require(_0x4be1('0x1'));var logger=require('../../config/logger')(_0x4be1('0x2'));var moment=require(_0x4be1('0x3'));var BPromise=require(_0x4be1('0x4'));var rp=require(_0x4be1('0x5'));var fs=require('fs');var path=require(_0x4be1('0x6'));var rimraf=require('rimraf');var config=require(_0x4be1('0x7'));var attributes=require(_0x4be1('0x8'));module[_0x4be1('0x9')]=function(_0x36b794,_0x44a98d){return _0x36b794[_0x4be1('0xa')](_0x4be1('0xb'),attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':'fti_openchannel_messages','fields':['body'],'type':_0x4be1('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x684f47,_0x54466f,_0x4f7797){var _0x58dd52=_0x36b794[_0x4be1('0xd')];var _0x48ad6b=_0x684f47['get']({'plain':!![]});if(_0x48ad6b[_0x4be1('0xe')][_0x4be1('0xf')]()==='in'||_0x48ad6b[_0x4be1('0xe')][_0x4be1('0xf')]()===_0x4be1('0x10')&&!_0x48ad6b[_0x4be1('0x11')]&&!_[_0x4be1('0x12')](_0x48ad6b[_0x4be1('0x13')])){_0x58dd52[_0x4be1('0x14')]['findOne']({'where':{'id':_0x48ad6b[_0x4be1('0x15')]}})[_0x4be1('0x16')](function(_0x14f2d5){if(_0x14f2d5){_0x14f2d5[_0x4be1('0x17')]({'lastMsgAt':_0x48ad6b[_0x4be1('0x18')],'lastMsgDirection':_0x48ad6b['direction'][_0x4be1('0xf')]()});}})[_0x4be1('0x19')](function(_0x5b91eb){console[_0x4be1('0x1a')](_0x5b91eb);});}if(_0x48ad6b[_0x4be1('0xe')]===_0x4be1('0x10')&&!_0x48ad6b[_0x4be1('0x11')]){var _0x5260e9;_0x58dd52[_0x4be1('0x1b')][_0x4be1('0x1c')]()[_0x4be1('0x16')](function(_0x557daa){return _0x58dd52[_0x4be1('0x1d')]['find']({'where':{'id':_0x48ad6b[_0x4be1('0x1e')]},'include':[{'model':_0x58dd52[_0x4be1('0x14')],'as':_0x4be1('0x1f'),'where':{'id':_0x48ad6b[_0x4be1('0x15')]},'limit':0x1,'include':[{'model':_0x58dd52['CmContact'],'as':'Contact','attributes':_['keys'](_0x557daa)}]}]});})[_0x4be1('0x16')](function(_0x12bb5b){_0x5260e9=_0x12bb5b[_0x4be1('0x20')]({'plain':!![]});if(_0x5260e9&&_0x5260e9[_0x4be1('0x21')]){logger[_0x4be1('0x22')](_0x4be1('0x23'),_0x4be1('0x24'),util[_0x4be1('0x25')](_0x4be1('0x26'),_0x48ad6b['id'],_0x5260e9[_0x4be1('0x21')]));if(_0x5260e9[_0x4be1('0x1f')]&&_0x5260e9['Interactions'][_0x4be1('0x27')]){_0x48ad6b['Interaction']=_[_0x4be1('0x28')](_0x5260e9[_0x4be1('0x1f')][0x0],'Contact');_0x48ad6b['Contact']=_0x5260e9[_0x4be1('0x1f')][0x0]['Contact'];}var _0x54466f={'method':'POST','uri':encodeURI(_0x5260e9[_0x4be1('0x21')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x54466f[_0x4be1('0x29')]){case _0x4be1('0x2a'):_0x54466f['qs']=_0x48ad6b;break;case'POST':_0x54466f['body']=_0x48ad6b;break;}return rp(_0x54466f)[_0x4be1('0x16')](function(_0x1c12d5){logger[_0x4be1('0x22')](_0x4be1('0x23'),'afterCreate',util[_0x4be1('0x25')](_0x4be1('0x2b'),_0x48ad6b['id'],_0x5260e9['replyUri']));if(_0x1c12d5['body'][_0x4be1('0x2c')]&&_0x1c12d5[_0x4be1('0x2d')][_0x4be1('0x2c')]!=_0x48ad6b[_0x4be1('0x2e')][_0x4be1('0x2c')]){return _0x58dd52['OpenchannelInteraction']['update']({'threadId':_0x1c12d5[_0x4be1('0x2d')][_0x4be1('0x2c')]},{'where':{'id':_0x48ad6b[_0x4be1('0x2e')]['id']}});}else{return;}})['then'](function(){return _0x684f47[_0x4be1('0x17')]({'read':!![]});})[_0x4be1('0x19')](function(_0x4b9e43){logger[_0x4be1('0x1a')](_0x4be1('0x23'),_0x4be1('0x24'),util[_0x4be1('0x2f')](_0x4b9e43,{'showHidden':![],'depth':null}));_0x4f7797();});}else{_0x4f7797();}})[_0x4be1('0x30')](function(){_0x4f7797();});}else{_0x4f7797();}}},'charset':_0x4be1('0x31'),'collate':_0x4be1('0x32')});}; \ No newline at end of file +var _0x01da=['replyUri','GET','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Message\x20%d\x20forwarded\x20to\x20%s','threadId','update','catch','inspect','utf8mb4','lodash','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','define','OpenchannelMessage','body','FULLTEXT','get','direction','toLowerCase','secret','isNil','UserId','OpenchannelInteraction','findOne','then','createdAt','error','out','CmContact','describe','OpenchannelAccount','find','OpenchannelAccountId','Interactions','OpenchannelInteractionId','keys','Forwarding\x20message\x20%d\x20to\x20%s','Interaction','omit','Contact'];(function(_0x4d10a3,_0x3a406e){var _0x24d02b=function(_0x5993bc){while(--_0x5993bc){_0x4d10a3['push'](_0x4d10a3['shift']());}};_0x24d02b(++_0x3a406e);}(_0x01da,0x95));var _0xa01d=function(_0x14e1b3,_0x2692a9){_0x14e1b3=_0x14e1b3-0x0;var _0x351805=_0x01da[_0x14e1b3];return _0x351805;};'use strict';var _=require(_0xa01d('0x0'));var util=require('util');var logger=require(_0xa01d('0x1'))(_0xa01d('0x2'));var moment=require('moment');var BPromise=require(_0xa01d('0x3'));var rp=require(_0xa01d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa01d('0x5'));var config=require(_0xa01d('0x6'));var attributes=require('./openchannelMessage.attributes');module['exports']=function(_0xd0cffc,_0x2ba471){return _0xd0cffc[_0xa01d('0x7')](_0xa01d('0x8'),attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':'fti_openchannel_messages','fields':[_0xa01d('0x9')],'type':_0xa01d('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x377e09,_0x327ca2,_0x351617){var _0x63aa32=_0xd0cffc['models'];var _0x3a89fb=_0x377e09[_0xa01d('0xb')]({'plain':!![]});if(_0x3a89fb[_0xa01d('0xc')][_0xa01d('0xd')]()==='in'||_0x3a89fb[_0xa01d('0xc')][_0xa01d('0xd')]()==='out'&&!_0x3a89fb[_0xa01d('0xe')]&&!_[_0xa01d('0xf')](_0x3a89fb[_0xa01d('0x10')])){_0x63aa32[_0xa01d('0x11')][_0xa01d('0x12')]({'where':{'id':_0x3a89fb['OpenchannelInteractionId']}})[_0xa01d('0x13')](function(_0xe078aa){if(_0xe078aa){_0xe078aa['update']({'lastMsgAt':_0x3a89fb[_0xa01d('0x14')],'lastMsgDirection':_0x3a89fb['direction'][_0xa01d('0xd')]()});}})['catch'](function(_0x62e116){console[_0xa01d('0x15')](_0x62e116);});}if(_0x3a89fb[_0xa01d('0xc')]===_0xa01d('0x16')&&!_0x3a89fb[_0xa01d('0xe')]){var _0x245c88;_0x63aa32[_0xa01d('0x17')][_0xa01d('0x18')]()['then'](function(_0x118b5a){return _0x63aa32[_0xa01d('0x19')][_0xa01d('0x1a')]({'where':{'id':_0x3a89fb[_0xa01d('0x1b')]},'include':[{'model':_0x63aa32[_0xa01d('0x11')],'as':_0xa01d('0x1c'),'where':{'id':_0x3a89fb[_0xa01d('0x1d')]},'limit':0x1,'include':[{'model':_0x63aa32[_0xa01d('0x17')],'as':'Contact','attributes':_[_0xa01d('0x1e')](_0x118b5a)}]}]});})['then'](function(_0x4f948c){_0x245c88=_0x4f948c[_0xa01d('0xb')]({'plain':!![]});if(_0x245c88&&_0x245c88['replyUri']){logger['info']('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util['format'](_0xa01d('0x1f'),_0x3a89fb['id'],_0x245c88['replyUri']));if(_0x245c88[_0xa01d('0x1c')]&&_0x245c88[_0xa01d('0x1c')]['length']){_0x3a89fb[_0xa01d('0x20')]=_[_0xa01d('0x21')](_0x245c88[_0xa01d('0x1c')][0x0],_0xa01d('0x22'));_0x3a89fb[_0xa01d('0x22')]=_0x245c88[_0xa01d('0x1c')][0x0][_0xa01d('0x22')];}var _0x327ca2={'method':'POST','uri':encodeURI(_0x245c88[_0xa01d('0x23')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x327ca2['method']){case _0xa01d('0x24'):_0x327ca2['qs']=_0x3a89fb;break;case'POST':_0x327ca2[_0xa01d('0x9')]=_0x3a89fb;break;}return rp(_0x327ca2)[_0xa01d('0x13')](function(_0x4e946e){logger['info'](_0xa01d('0x25'),_0xa01d('0x26'),util[_0xa01d('0x27')](_0xa01d('0x28'),_0x3a89fb['id'],_0x245c88['replyUri']));if(_0x4e946e[_0xa01d('0x9')][_0xa01d('0x29')]&&_0x4e946e[_0xa01d('0x9')][_0xa01d('0x29')]!=_0x3a89fb['Interaction'][_0xa01d('0x29')]){return _0x63aa32[_0xa01d('0x11')][_0xa01d('0x2a')]({'threadId':_0x4e946e[_0xa01d('0x9')][_0xa01d('0x29')]},{'where':{'id':_0x3a89fb[_0xa01d('0x20')]['id']}});}else{return;}})[_0xa01d('0x13')](function(){return _0x377e09[_0xa01d('0x2a')]({'read':!![]});})[_0xa01d('0x2b')](function(_0x5b5cd2){logger[_0xa01d('0x15')](_0xa01d('0x25'),_0xa01d('0x26'),util[_0xa01d('0x2c')](_0x5b5cd2,{'showHidden':![],'depth':null}));_0x351617();});}else{_0x351617();}})['finally'](function(){_0x351617();});}else{_0x351617();}}},'charset':_0xa01d('0x2d'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index e48fa51..545a761 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 _0xdb28=['then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateOpenchannelMessage','OpenchannelMessage','create','body','options','raw','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','request'];(function(_0x1da8f5,_0xc052c4){var _0x2973a4=function(_0x260e37){while(--_0x260e37){_0x1da8f5['push'](_0x1da8f5['shift']());}};_0x2973a4(++_0xc052c4);}(_0xdb28,0x106));var _0x8db2=function(_0x33838b,_0x17324b){_0x33838b=_0x33838b-0x0;var _0x254138=_0xdb28[_0x33838b];return _0x254138;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});config['redis']=_[_0x8db2('0xb')](config[_0x8db2('0xc')],{'host':_0x8db2('0xd'),'port':0x18eb});var socket=require(_0x8db2('0xe'))(new Redis(config[_0x8db2('0xc')]));require(_0x8db2('0xf'))[_0x8db2('0x10')](socket);function respondWithRpcPromise(_0x4ba340,_0x30dc90,_0x476216){return new BPromise(function(_0x1f62af,_0x57015f){return client[_0x8db2('0x11')](_0x4ba340,_0x476216)[_0x8db2('0x12')](function(_0x576475){logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));logger[_0x8db2('0x16')](_0x8db2('0x17'),_0x30dc90,'request\x20sent',JSON['stringify'](_0x576475));if(_0x576475[_0x8db2('0x18')]){if(_0x576475[_0x8db2('0x18')][_0x8db2('0x19')]===0x1f4){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x57015f(_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);}logger[_0x8db2('0x18')]('OpenchannelMessage,\x20%s,\x20%s',_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x1f62af(_0x576475['error'][_0x8db2('0x1a')]);}else{logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));_0x1f62af(_0x576475[_0x8db2('0x1b')][_0x8db2('0x1a')]);}})['catch'](function(_0x5df464){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x5df464);_0x57015f(_0x5df464);});});}exports[_0x8db2('0x1c')]=function(_0x1b64e4){var _0x58562e=this;return new Promise(function(_0x431d60,_0x36a9ff){return db[_0x8db2('0x1d')][_0x8db2('0x1e')](_0x1b64e4[_0x8db2('0x1f')],{'raw':_0x1b64e4['options']?_0x1b64e4[_0x8db2('0x20')][_0x8db2('0x21')]===undefined?!![]:![]:!![]})[_0x8db2('0x12')](function(_0x125be2){logger[_0x8db2('0x13')](_0x8db2('0x1c'),_0x1b64e4);logger[_0x8db2('0x16')]('CreateOpenchannelMessage',_0x1b64e4,JSON[_0x8db2('0x22')](_0x125be2));_0x431d60(_0x125be2);})['catch'](function(_0x5725f0){logger['error']('CreateOpenchannelMessage',_0x5725f0[_0x8db2('0x1a')],_0x1b64e4);_0x36a9ff(_0x58562e[_0x8db2('0x18')](0x1f4,_0x5725f0[_0x8db2('0x1a')]));});});}; \ No newline at end of file +var _0x5f2f=['OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','OpenchannelMessage','create','options','raw','CreateOpenchannelMessage','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x9e8e7a,_0x373eaf){var _0x3e5391=function(_0x7156f){while(--_0x7156f){_0x9e8e7a['push'](_0x9e8e7a['shift']());}};_0x3e5391(++_0x373eaf);}(_0x5f2f,0x73));var _0xf5f2=function(_0x285f72,_0x39f172){_0x285f72=_0x285f72-0x0;var _0x42a4ef=_0x5f2f[_0x285f72];return _0x42a4ef;};'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});config[_0xf5f2('0xc')]=_[_0xf5f2('0xd')](config['redis'],{'host':_0xf5f2('0xe'),'port':0x18eb});var socket=require(_0xf5f2('0xf'))(new Redis(config[_0xf5f2('0xc')]));require('./openchannelMessage.socket')[_0xf5f2('0x10')](socket);function respondWithRpcPromise(_0x15dd7c,_0x218ae3,_0x4e0e6b){return new BPromise(function(_0x977a59,_0x4ebbbe){return client['request'](_0x15dd7c,_0x4e0e6b)[_0xf5f2('0x11')](function(_0x151aba){logger['info'](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));logger[_0xf5f2('0x14')](_0xf5f2('0x15'),_0x218ae3,_0xf5f2('0x13'),JSON[_0xf5f2('0x16')](_0x151aba));if(_0x151aba['error']){if(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x18')]===0x1f4){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')]['message']);return _0x4ebbbe(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);return _0x977a59(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}else{logger[_0xf5f2('0x1a')](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));_0x977a59(_0x151aba[_0xf5f2('0x1b')][_0xf5f2('0x19')]);}})[_0xf5f2('0x1c')](function(_0x3cf5ea){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x3cf5ea);_0x4ebbbe(_0x3cf5ea);});});}exports['CreateOpenchannelMessage']=function(_0x34706d){var _0x47101e=this;return new Promise(function(_0x49dac2,_0x47acfc){return db[_0xf5f2('0x1d')][_0xf5f2('0x1e')](_0x34706d['body'],{'raw':_0x34706d[_0xf5f2('0x1f')]?_0x34706d[_0xf5f2('0x1f')][_0xf5f2('0x20')]===undefined?!![]:![]:!![]})[_0xf5f2('0x11')](function(_0x36f1cb){logger['info'](_0xf5f2('0x21'),_0x34706d);logger[_0xf5f2('0x14')](_0xf5f2('0x21'),_0x34706d,JSON[_0xf5f2('0x16')](_0x36f1cb));_0x49dac2(_0x36f1cb);})[_0xf5f2('0x1c')](function(_0x5bdf4a){logger['error'](_0xf5f2('0x21'),_0x5bdf4a[_0xf5f2('0x19')],_0x34706d);_0x47acfc(_0x47101e[_0xf5f2('0x17')](0x1f4,_0x5bdf4a[_0xf5f2('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index f8e56f2..e8da52f 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 _0x6dd4=['openchannelMessage:','./openchannelMessage.events','save','remove','update','emit','removeListener','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6dd4,0x129));var _0x46dd=function(_0x540c01,_0x5a6acd){_0x540c01=_0x540c01-0x0;var _0x4a1ea0=_0x6dd4[_0x540c01];return _0x4a1ea0;};'use strict';var OpenchannelMessageEvents=require(_0x46dd('0x0'));var events=[_0x46dd('0x1'),_0x46dd('0x2'),_0x46dd('0x3')];function createListener(_0x33d60d,_0x39647d){return function(_0xc888e6){_0x39647d[_0x46dd('0x4')](_0x33d60d,_0xc888e6);};}function removeListener(_0x328f16,_0x5a2220){return function(){OpenchannelMessageEvents[_0x46dd('0x5')](_0x328f16,_0x5a2220);};}exports['register']=function(_0x552502){for(var _0x4ed02e=0x0,_0x18b6d4=events[_0x46dd('0x6')];_0x4ed02e<_0x18b6d4;_0x4ed02e++){var _0x51297c=events[_0x4ed02e];var _0x3be461=createListener(_0x46dd('0x7')+_0x51297c,_0x552502);OpenchannelMessageEvents['on'](_0x51297c,_0x3be461);}}; \ No newline at end of file +var _0x2b95=['openchannelMessage:','./openchannelMessage.events','save','remove','update','emit','register','length'];(function(_0x186d17,_0x9fa8ef){var _0x5d4b89=function(_0x57bd70){while(--_0x57bd70){_0x186d17['push'](_0x186d17['shift']());}};_0x5d4b89(++_0x9fa8ef);}(_0x2b95,0x1f1));var _0x52b9=function(_0x1a9204,_0x1c9e00){_0x1a9204=_0x1a9204-0x0;var _0x17ca68=_0x2b95[_0x1a9204];return _0x17ca68;};'use strict';var OpenchannelMessageEvents=require(_0x52b9('0x0'));var events=[_0x52b9('0x1'),_0x52b9('0x2'),_0x52b9('0x3')];function createListener(_0xafb63f,_0x205690){return function(_0x333974){_0x205690[_0x52b9('0x4')](_0xafb63f,_0x333974);};}function removeListener(_0x3bd570,_0x9bc5fb){return function(){OpenchannelMessageEvents['removeListener'](_0x3bd570,_0x9bc5fb);};}exports[_0x52b9('0x5')]=function(_0x3165af){for(var _0x48fbd8=0x0,_0x1c2cd3=events[_0x52b9('0x6')];_0x48fbd8<_0x1c2cd3;_0x48fbd8++){var _0x3a9287=events[_0x48fbd8];var _0xe022f6=createListener(_0x52b9('0x7')+_0x3a9287,_0x3165af);OpenchannelMessageEvents['on'](_0x3a9287,_0xe022f6);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 3bd83d3..7c8d57a 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 _0x9343=['exports','multer','connect-timeout','express','../../components/interaction/service','./openchannelQueue.controller','get','index','/describe','isAuthenticated','/:id','show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','addTeams','update','destroy','delete','removeAgents'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x9343,0x143));var _0x3934=function(_0x28dba7,_0x4bed71){_0x28dba7=_0x28dba7-0x0;var _0x308bd0=_0x9343[_0x28dba7];return _0x308bd0;};'use strict';var multer=require(_0x3934('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3934('0x1'));var express=require(_0x3934('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x3934('0x3'));var config=require('../../config/environment');var controller=require(_0x3934('0x4'));router[_0x3934('0x5')]('/',auth['isAuthenticated'](),controller[_0x3934('0x6')]);router[_0x3934('0x5')](_0x3934('0x7'),auth[_0x3934('0x8')](),controller['describe']);router['get'](_0x3934('0x9'),auth[_0x3934('0x8')](),controller[_0x3934('0xa')]);router[_0x3934('0x5')](_0x3934('0xb'),auth[_0x3934('0x8')](),controller[_0x3934('0xc')]);router[_0x3934('0x5')](_0x3934('0xd'),auth[_0x3934('0x8')](),controller['getTeams']);router[_0x3934('0x5')](_0x3934('0xe'),auth[_0x3934('0x8')](),controller[_0x3934('0xf')]);router['post']('/',auth[_0x3934('0x8')](),controller['create']);router[_0x3934('0x10')]('/:id/teams',auth[_0x3934('0x8')](),controller[_0x3934('0x11')]);router[_0x3934('0x10')](_0x3934('0xe'),auth[_0x3934('0x8')](),controller['addAgents']);router['put'](_0x3934('0x9'),auth[_0x3934('0x8')](),controller[_0x3934('0x12')]);router['delete']('/:id',auth[_0x3934('0x8')](),controller[_0x3934('0x13')]);router[_0x3934('0x14')](_0x3934('0xd'),auth[_0x3934('0x8')](),controller['removeTeams']);router[_0x3934('0x14')](_0x3934('0xe'),auth[_0x3934('0x8')](),controller[_0x3934('0x15')]);module[_0x3934('0x16')]=router; \ No newline at end of file +var _0xe68f=['/:id','update','delete','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','index','isAuthenticated','describe','get','show','/:id/members','getMembers','getTeams','getAgents','post','create','/:id/teams','addTeams','/:id/users','put'];(function(_0x357a01,_0x1e57d0){var _0x252c1f=function(_0x53c71f){while(--_0x53c71f){_0x357a01['push'](_0x357a01['shift']());}};_0x252c1f(++_0x1e57d0);}(_0xe68f,0x15a));var _0xfe68=function(_0x19bd27,_0x1233a4){_0x19bd27=_0x19bd27-0x0;var _0x2ea381=_0xe68f[_0x19bd27];return _0x2ea381;};'use strict';var multer=require(_0xfe68('0x0'));var util=require(_0xfe68('0x1'));var path=require(_0xfe68('0x2'));var timeout=require(_0xfe68('0x3'));var express=require(_0xfe68('0x4'));var router=express[_0xfe68('0x5')]();var fs_extra=require(_0xfe68('0x6'));var auth=require(_0xfe68('0x7'));var interaction=require(_0xfe68('0x8'));var config=require(_0xfe68('0x9'));var controller=require(_0xfe68('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0xfe68('0xb')]);router['get']('/describe',auth[_0xfe68('0xc')](),controller[_0xfe68('0xd')]);router[_0xfe68('0xe')]('/:id',auth[_0xfe68('0xc')](),controller[_0xfe68('0xf')]);router[_0xfe68('0xe')](_0xfe68('0x10'),auth['isAuthenticated'](),controller[_0xfe68('0x11')]);router[_0xfe68('0xe')]('/:id/teams',auth[_0xfe68('0xc')](),controller[_0xfe68('0x12')]);router['get']('/:id/users',auth[_0xfe68('0xc')](),controller[_0xfe68('0x13')]);router[_0xfe68('0x14')]('/',auth[_0xfe68('0xc')](),controller[_0xfe68('0x15')]);router[_0xfe68('0x14')](_0xfe68('0x16'),auth[_0xfe68('0xc')](),controller[_0xfe68('0x17')]);router[_0xfe68('0x14')](_0xfe68('0x18'),auth['isAuthenticated'](),controller['addAgents']);router[_0xfe68('0x19')](_0xfe68('0x1a'),auth[_0xfe68('0xc')](),controller[_0xfe68('0x1b')]);router['delete'](_0xfe68('0x1a'),auth[_0xfe68('0xc')](),controller['destroy']);router[_0xfe68('0x1c')](_0xfe68('0x16'),auth[_0xfe68('0xc')](),controller['removeTeams']);router['delete'](_0xfe68('0x18'),auth[_0xfe68('0xc')](),controller[_0xfe68('0x1d')]);module[_0xfe68('0x1e')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 910bc1b..68d8815 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 _0x5744=['INTEGER','ENUM','rrmemory','roundrobin','exports','STRING'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0x5744,0xee));var _0x4574=function(_0x19dd9f,_0x38b866){_0x19dd9f=_0x19dd9f-0x0;var _0x368300=_0x5744[_0x19dd9f];return _0x368300;};'use strict';var Sequelize=require('sequelize');module[_0x4574('0x0')]={'name':{'type':Sequelize[_0x4574('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x4574('0x1')]},'timeout':{'type':Sequelize[_0x4574('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4574('0x3')](_0x4574('0x4'),'beepall',_0x4574('0x5'))}}; \ No newline at end of file +var _0xe660=['sequelize','STRING','name','INTEGER','rrmemory','beepall'];(function(_0x479746,_0x574758){var _0x36d2aa=function(_0x27e29d){while(--_0x27e29d){_0x479746['push'](_0x479746['shift']());}};_0x36d2aa(++_0x574758);}(_0xe660,0x1b6));var _0x0e66=function(_0x2e913b,_0x4b7071){_0x2e913b=_0x2e913b-0x0;var _0x173899=_0xe660[_0x2e913b];return _0x173899;};'use strict';var Sequelize=require(_0x0e66('0x0'));module['exports']={'name':{'type':Sequelize[_0x0e66('0x1')],'unique':_0x0e66('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x0e66('0x1')]},'timeout':{'type':Sequelize[_0x0e66('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x0e66('0x4'),_0x0e66('0x5'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index a479050..3dff2f4 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 _0x11ad=['SELECT','TeamId','includes','all','union','compact','ids','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','omit','spread','isArray','getAgents','bluebird','util','lodash','squel','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','update','then','get','UserProfileResource','destroy','stack','name','send','fieldName','type','key','getOptions','where','OpenchannelQueue','include','query','catch','params','keys','rawAttributes','intersection','model','attributes','fields','length','merge','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','error','find','describe','getMembers','UserOpenchannelQueue','filters','hasOwnProperty','nolimit','order','sort','pick','filter','findAll','User','findAndCountAll','map','UserId','agent','updatedAt','createdAt','rows','format','%s/%s','SIP','openchannelPause','getTeams','findOne','Team','addTeams','Agents','online','voicePause','flatMap','sequelize','transaction','each','findOrCreate','emit','userOpenchannelQueue:save','removeTeams','select','tq.TeamId','team_has_openchannel_queues','join','user_has_teams','OpenchannelQueueId\x20=\x20?','clone','push','toString'];(function(_0x1f5887,_0x2fa1f1){var _0x21774b=function(_0x48a7e5){while(--_0x48a7e5){_0x1f5887['push'](_0x1f5887['shift']());}};_0x21774b(++_0x2fa1f1);}(_0x11ad,0x1df));var _0xd11a=function(_0x261535,_0x28db46){_0x261535=_0x261535-0x0;var _0x49e0df=_0x11ad[_0x261535];return _0x49e0df;};'use strict';var BPromise=require(_0xd11a('0x0'));var util=require(_0xd11a('0x1'));var _=require(_0xd11a('0x2'));var squel=require(_0xd11a('0x3'));var Redis=require('ioredis');var qs=require(_0xd11a('0x4'));var logger=require(_0xd11a('0x5'))(_0xd11a('0x6'));var config=require(_0xd11a('0x7'));var db=require(_0xd11a('0x8'))['db'];config[_0xd11a('0x9')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xd11a('0xa'))(new Redis(config[_0xd11a('0x9')]));require(_0xd11a('0xb'))[_0xd11a('0xc')](socket);function respondWithStatusCode(_0x376f34,_0xf8ac74){_0xf8ac74=_0xf8ac74||0xcc;return function(_0x47f3f4){if(_0x47f3f4){return _0x376f34[_0xd11a('0xd')](_0xf8ac74);}return _0x376f34[_0xd11a('0xe')](_0xf8ac74)[_0xd11a('0xf')]();};}function respondWithResult(_0x42fad0,_0x4d1959){_0x4d1959=_0x4d1959||0xc8;return function(_0x2ce9b3){if(_0x2ce9b3){return _0x42fad0['status'](_0x4d1959)['json'](_0x2ce9b3);}};}function respondWithFilteredResult(_0x572370,_0x2eb3c3){return function(_0x2ec6c0){if(_0x2ec6c0){var _0x4a9e11=typeof _0x2eb3c3[_0xd11a('0x10')]===_0xd11a('0x11')&&typeof _0x2eb3c3[_0xd11a('0x12')]===_0xd11a('0x11');var _0x35f9a3=_0x2ec6c0[_0xd11a('0x13')];var _0x3be42a=_0x4a9e11?0x0:_0x2eb3c3[_0xd11a('0x10')];var _0x26d9ce=_0x4a9e11?_0x2ec6c0[_0xd11a('0x13')]:_0x2eb3c3[_0xd11a('0x10')]+_0x2eb3c3['limit'];var _0x115cd5;if(_0x26d9ce>=_0x35f9a3){_0x26d9ce=_0x35f9a3;_0x115cd5=0xc8;}else{_0x115cd5=0xce;}_0x572370['status'](_0x115cd5);return _0x572370[_0xd11a('0x14')]('Content-Range',_0x3be42a+'-'+_0x26d9ce+'/'+_0x35f9a3)['json'](_0x2ec6c0);}return null;};}function saveUpdates(_0x52adc4){return function(_0x38ee09){if(_0x38ee09){return _0x38ee09[_0xd11a('0x15')](_0x52adc4)[_0xd11a('0x16')](function(_0x4e3caa){return _0x4e3caa;});}return null;};}function removeEntity(_0x44eeec){return function(_0x45012c){if(_0x45012c){return _0x45012c['destroy']()[_0xd11a('0x16')](function(){var _0xbce565=_0x45012c[_0xd11a('0x17')]({'plain':!![]});var _0x4cf2b0='OpenchannelQueues';return db[_0xd11a('0x18')][_0xd11a('0x19')]({'where':{'type':_0x4cf2b0,'resourceId':_0xbce565['id']}})[_0xd11a('0x16')](function(){return _0x45012c;});})['then'](function(){_0x44eeec[_0xd11a('0xe')](0xcc)[_0xd11a('0xf')]();});}};}function handleEntityNotFound(_0x4f994b){return function(_0x275439){if(!_0x275439){_0x4f994b[_0xd11a('0xd')](0x194);}return _0x275439;};}function handleError(_0x1bdb61,_0x20de27){_0x20de27=_0x20de27||0x1f4;return function(_0x36902c){logger['error'](_0x36902c[_0xd11a('0x1a')]);if(_0x36902c[_0xd11a('0x1b')]){delete _0x36902c[_0xd11a('0x1b')];}_0x1bdb61[_0xd11a('0xe')](_0x20de27)[_0xd11a('0x1c')](_0x36902c);};}exports['index']=function(_0x2c4965,_0x1096f9){var _0x37129d={};var _0x46b92c={'count':0x0,'rows':[]};var _0x1d7c03=_['map'](db['OpenchannelQueue']['rawAttributes'],function(_0x4f43b4){return{'name':_0x4f43b4[_0xd11a('0x1d')],'type':_0x4f43b4[_0xd11a('0x1e')][_0xd11a('0x1f')]};});_0x37129d=qs[_0xd11a('0x20')](_0x1d7c03,_0x2c4965);var _0x44a6db={'where':_0x37129d[_0xd11a('0x21')]};return db[_0xd11a('0x22')]['count'](_0x44a6db)[_0xd11a('0x16')](function(_0x11b64b){_0x46b92c[_0xd11a('0x13')]=_0x11b64b;_0x37129d[_0xd11a('0x23')]=qs[_0xd11a('0x23')](_0x2c4965[_0xd11a('0x24')]);return db['OpenchannelQueue']['findAll'](_0x37129d);})[_0xd11a('0x16')](function(_0x2707c2){_0x46b92c['rows']=_0x2707c2;return _0x46b92c;})[_0xd11a('0x16')](respondWithFilteredResult(_0x1096f9,_0x37129d))[_0xd11a('0x25')](handleError(_0x1096f9,null));};exports['show']=function(_0x21f6b2,_0x38e07d){var _0x204769={'raw':!![],'where':{'id':_0x21f6b2[_0xd11a('0x26')]['id']}},_0x59b77c={};_0x59b77c['model']=_[_0xd11a('0x27')](db[_0xd11a('0x22')][_0xd11a('0x28')]);_0x59b77c[_0xd11a('0x24')]=_[_0xd11a('0x27')](_0x21f6b2[_0xd11a('0x24')]);_0x59b77c['filters']=_[_0xd11a('0x29')](_0x59b77c[_0xd11a('0x2a')],_0x59b77c[_0xd11a('0x24')]);_0x204769[_0xd11a('0x2b')]=_[_0xd11a('0x29')](_0x59b77c[_0xd11a('0x2a')],qs['fields'](_0x21f6b2[_0xd11a('0x24')][_0xd11a('0x2c')]));_0x204769[_0xd11a('0x2b')]=_0x204769[_0xd11a('0x2b')][_0xd11a('0x2d')]?_0x204769['attributes']:_0x59b77c['model'];if(_0x21f6b2['query']['includeAll']){_0x204769[_0xd11a('0x23')]=[{'all':!![]}];}_0x204769=_[_0xd11a('0x2e')]({},_0x204769,_0x21f6b2[_0xd11a('0x2f')]);return db[_0xd11a('0x22')]['find'](_0x204769)[_0xd11a('0x16')](handleEntityNotFound(_0x38e07d,null))[_0xd11a('0x16')](respondWithResult(_0x38e07d,null))[_0xd11a('0x25')](handleError(_0x38e07d,null));};exports['create']=function(_0x1b19d1,_0x597e35){return db[_0xd11a('0x22')][_0xd11a('0x30')](_0x1b19d1[_0xd11a('0x31')],{})[_0xd11a('0x16')](function(_0x5e88b8){var _0x3d5522=_0x1b19d1['user'][_0xd11a('0x17')]({'plain':!![]});if(!_0x3d5522)throw new Error(_0xd11a('0x32'));if(_0x3d5522['role']==='user'){var _0x491138=_0x5e88b8[_0xd11a('0x17')]({'plain':!![]});var _0x947ad='OpenchannelQueues';return db['UserProfileSection']['find']({'where':{'name':_0x947ad,'userProfileId':_0x3d5522[_0xd11a('0x33')]},'raw':!![]})[_0xd11a('0x16')](function(_0x43cdf0){if(_0x43cdf0&&_0x43cdf0['autoAssociation']===0x0){return db['UserProfileResource'][_0xd11a('0x30')]({'name':_0x491138['name'],'resourceId':_0x491138['id'],'type':_0x43cdf0[_0xd11a('0x1b')],'sectionId':_0x43cdf0['id']},{})[_0xd11a('0x16')](function(){return _0x5e88b8;});}else{return _0x5e88b8;}})[_0xd11a('0x25')](function(_0x37526f){logger[_0xd11a('0x34')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x37526f);throw _0x37526f;});}return _0x5e88b8;})[_0xd11a('0x16')](respondWithResult(_0x597e35,0xc9))[_0xd11a('0x25')](handleError(_0x597e35,null));};exports['update']=function(_0x32dd68,_0x373d59){if(_0x32dd68[_0xd11a('0x31')]['id']){delete _0x32dd68[_0xd11a('0x31')]['id'];}return db[_0xd11a('0x22')][_0xd11a('0x35')]({'where':{'id':_0x32dd68['params']['id']}})[_0xd11a('0x16')](handleEntityNotFound(_0x373d59,null))[_0xd11a('0x16')](saveUpdates(_0x32dd68[_0xd11a('0x31')],null))[_0xd11a('0x16')](respondWithResult(_0x373d59,null))[_0xd11a('0x25')](handleError(_0x373d59,null));};exports['destroy']=function(_0x28c6ca,_0x4f8742){return db[_0xd11a('0x22')][_0xd11a('0x35')]({'where':{'id':_0x28c6ca[_0xd11a('0x26')]['id']}})[_0xd11a('0x16')](handleEntityNotFound(_0x4f8742,null))[_0xd11a('0x16')](removeEntity(_0x4f8742,null))[_0xd11a('0x25')](handleError(_0x4f8742,null));};exports[_0xd11a('0x36')]=function(_0x3f26a5,_0x8063da){return db[_0xd11a('0x22')][_0xd11a('0x36')]()[_0xd11a('0x16')](respondWithResult(_0x8063da,null))[_0xd11a('0x25')](handleError(_0x8063da,null));};exports[_0xd11a('0x37')]=function(_0x40c16d,_0x2c2f48){var _0x343dff={'raw':!![],'where':{}},_0x47d4f4={},_0x2bbaf6;return db[_0xd11a('0x22')]['findOne']({'where':{'id':_0x40c16d[_0xd11a('0x26')]['id']}})['then'](handleEntityNotFound(_0x2c2f48,null))[_0xd11a('0x16')](function(_0x381b42){if(_0x381b42){_0x2bbaf6=_0x381b42[_0xd11a('0x17')]({'plain':!![]});_0x47d4f4[_0xd11a('0x2a')]=_[_0xd11a('0x27')](db[_0xd11a('0x38')][_0xd11a('0x28')]);_0x47d4f4[_0xd11a('0x24')]=_[_0xd11a('0x27')](_0x40c16d[_0xd11a('0x24')]);_0x47d4f4[_0xd11a('0x39')]=_[_0xd11a('0x29')](_0x47d4f4[_0xd11a('0x2a')],_0x47d4f4[_0xd11a('0x24')]);_0x343dff[_0xd11a('0x2b')]=_[_0xd11a('0x29')](_0x47d4f4[_0xd11a('0x2a')],qs[_0xd11a('0x2c')](_0x40c16d[_0xd11a('0x24')][_0xd11a('0x2c')]));_0x343dff['attributes']=_0x343dff[_0xd11a('0x2b')][_0xd11a('0x2d')]?_0x343dff[_0xd11a('0x2b')]:_0x47d4f4['model'];if(!_0x40c16d[_0xd11a('0x24')][_0xd11a('0x3a')](_0xd11a('0x3b'))){_0x343dff[_0xd11a('0x12')]=qs[_0xd11a('0x12')](_0x40c16d[_0xd11a('0x24')]['limit']);_0x343dff['offset']=qs[_0xd11a('0x10')](_0x40c16d[_0xd11a('0x24')][_0xd11a('0x10')]);}_0x343dff[_0xd11a('0x3c')]=qs['sort'](_0x40c16d[_0xd11a('0x24')][_0xd11a('0x3d')]);_0x343dff['where']=qs['filters'](_[_0xd11a('0x3e')](_0x40c16d[_0xd11a('0x24')],_0x47d4f4[_0xd11a('0x39')]));_0x343dff[_0xd11a('0x21')]['OpenchannelQueueId']=_0x381b42['id'];if(_0x40c16d[_0xd11a('0x24')][_0xd11a('0x3f')]){_0x343dff[_0xd11a('0x21')]=_[_0xd11a('0x2e')](_0x343dff[_0xd11a('0x21')],{'$or':_['map'](_0x343dff[_0xd11a('0x2b')],function(_0x58d572){var _0x2c570e={};_0x2c570e[_0x58d572]={'$like':'%'+_0x40c16d[_0xd11a('0x24')][_0xd11a('0x3f')]+'%'};return _0x2c570e;})});}_0x343dff=_[_0xd11a('0x2e')]({},_0x343dff,_0x40c16d[_0xd11a('0x2f')]);return db[_0xd11a('0x38')][_0xd11a('0x40')](_0x343dff);}})[_0xd11a('0x16')](function(_0x35ecc4){if(_0x35ecc4){return db[_0xd11a('0x41')][_0xd11a('0x42')]({'where':{'id':_[_0xd11a('0x43')](_0x35ecc4,_0xd11a('0x44')),'role':_0xd11a('0x45')},'attributes':['id','name','openchannelPause',_0xd11a('0x46'),_0xd11a('0x47')]});}})['then'](function(_0x21b1b0){if(_0x21b1b0){return{'count':_0x21b1b0[_0xd11a('0x13')],'rows':_[_0xd11a('0x43')](_0x21b1b0[_0xd11a('0x48')],function(_0x1f287d){return{'membername':_0x1f287d[_0xd11a('0x1b')],'UserId':_0x1f287d['id'],'queue_name':_0x2bbaf6['name'],'OpenchannelQueueId':_0x2bbaf6['id'],'interface':util[_0xd11a('0x49')](_0xd11a('0x4a'),_0xd11a('0x4b'),_0x1f287d[_0xd11a('0x1b')]),'penalty':0x0,'paused':_0x1f287d[_0xd11a('0x4c')],'createdAt':_0x1f287d[_0xd11a('0x47')],'updatedAt':_0x1f287d[_0xd11a('0x46')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xd11a('0x16')](respondWithFilteredResult(_0x2c2f48,_0x343dff))[_0xd11a('0x25')](handleError(_0x2c2f48,null));};exports[_0xd11a('0x4d')]=function(_0x5be4a2,_0x5df2f7){var _0x4f86e7={};var _0x3309b7={};var _0x1eb236;var _0x4b0baf;return db[_0xd11a('0x22')][_0xd11a('0x4e')]({'where':{'id':_0x5be4a2[_0xd11a('0x26')]['id']}})['then'](handleEntityNotFound(_0x5df2f7,null))[_0xd11a('0x16')](function(_0x5ef9b2){if(_0x5ef9b2){_0x1eb236=_0x5ef9b2;_0x3309b7[_0xd11a('0x2a')]=_['keys'](db[_0xd11a('0x4f')][_0xd11a('0x28')]);_0x3309b7[_0xd11a('0x24')]=_[_0xd11a('0x27')](_0x5be4a2['query']);_0x3309b7['filters']=_[_0xd11a('0x29')](_0x3309b7[_0xd11a('0x2a')],_0x3309b7[_0xd11a('0x24')]);_0x4f86e7[_0xd11a('0x2b')]=_[_0xd11a('0x29')](_0x3309b7[_0xd11a('0x2a')],qs[_0xd11a('0x2c')](_0x5be4a2[_0xd11a('0x24')][_0xd11a('0x2c')]));_0x4f86e7[_0xd11a('0x2b')]=_0x4f86e7['attributes'][_0xd11a('0x2d')]?_0x4f86e7['attributes']:_0x3309b7[_0xd11a('0x2a')];_0x4f86e7['order']=qs['sort'](_0x5be4a2[_0xd11a('0x24')]['sort']);_0x4f86e7[_0xd11a('0x21')]=qs[_0xd11a('0x39')](_['pick'](_0x5be4a2['query'],_0x3309b7['filters']));if(_0x5be4a2['query'][_0xd11a('0x3f')]){_0x4f86e7[_0xd11a('0x21')]=_[_0xd11a('0x2e')](_0x4f86e7['where'],{'$or':_[_0xd11a('0x43')](_0x4f86e7[_0xd11a('0x2b')],function(_0x3e0cab){var _0x590f39={};_0x590f39[_0x3e0cab]={'$like':'%'+_0x5be4a2['query'][_0xd11a('0x3f')]+'%'};return _0x590f39;})});}_0x4f86e7=_[_0xd11a('0x2e')]({},_0x4f86e7,_0x5be4a2[_0xd11a('0x2f')]);return _0x1eb236[_0xd11a('0x4d')](_0x4f86e7);}})['then'](function(_0x2b7a8a){if(_0x2b7a8a){_0x4b0baf=_0x2b7a8a[_0xd11a('0x2d')];if(!_0x5be4a2[_0xd11a('0x24')][_0xd11a('0x3a')]('nolimit')){_0x4f86e7[_0xd11a('0x12')]=qs[_0xd11a('0x12')](_0x5be4a2[_0xd11a('0x24')][_0xd11a('0x12')]);_0x4f86e7['offset']=qs[_0xd11a('0x10')](_0x5be4a2[_0xd11a('0x24')]['offset']);}return _0x1eb236[_0xd11a('0x4d')](_0x4f86e7);}})['then'](function(_0x5db64d){if(_0x5db64d){return _0x5db64d?{'count':_0x4b0baf,'rows':_0x5db64d}:null;}})[_0xd11a('0x16')](respondWithResult(_0x5df2f7,null))['catch'](handleError(_0x5df2f7,null));};exports[_0xd11a('0x50')]=function(_0x21f053,_0x2ad26d){var _0x371a94=_0x21f053[_0xd11a('0x31')]['ids'];return db[_0xd11a('0x4f')][_0xd11a('0x40')]({'where':{'id':_0x371a94},'attributes':['id'],'include':[{'model':db['User'],'as':_0xd11a('0x51'),'attributes':['id',_0xd11a('0x1b'),_0xd11a('0x52'),_0xd11a('0x53'),'interface'],'raw':!![]}]})[_0xd11a('0x16')](function(_0x1b24e0){if(_0x1b24e0){var _0xe37dc=_[_0xd11a('0x54')](_0x1b24e0,function(_0x260313){var _0x2f89b8=_0x260313[_0xd11a('0x17')]({'plain':!![]});return _0x2f89b8[_0xd11a('0x51')];});return db[_0xd11a('0x22')][_0xd11a('0x35')]({'where':{'id':_0x21f053[_0xd11a('0x26')]['id']}})[_0xd11a('0x16')](function(_0x469c38){return db[_0xd11a('0x55')][_0xd11a('0x56')](function(_0x4073c2){return _0x469c38[_0xd11a('0x50')](_0x371a94,{'transaction':_0x4073c2})['then'](function(){return BPromise[_0xd11a('0x57')](_0xe37dc,function(_0x322534){return db['UserOpenchannelQueue'][_0xd11a('0x58')]({'where':{'UserId':_0x322534['id'],'OpenchannelQueueId':_0x21f053[_0xd11a('0x26')]['id']},'transaction':_0x4073c2});});})['then'](function(){_0xe37dc['forEach'](function(_0x5567cc){socket[_0xd11a('0x59')](_0xd11a('0x5a'),{'UserId':_0x5567cc['id'],'OpenchannelQueueId':_0x469c38['id']});});});});});}})[_0xd11a('0x16')](respondWithStatusCode(_0x2ad26d,null))[_0xd11a('0x25')](handleError(_0x2ad26d,null));};exports[_0xd11a('0x5b')]=function(_0x10871,_0x302c53){return db[_0xd11a('0x4f')][_0xd11a('0x40')]({'where':{'id':_0x10871['query']['ids']},'attributes':['id'],'include':[{'model':db[_0xd11a('0x41')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xd11a('0x16')](handleEntityNotFound(_0x302c53,null))[_0xd11a('0x16')](function(_0x574a74){var _0x246a49=_['map'](_0x574a74,'id');var _0x11e307=[];var _0x346009=[];var _0x4edbd2=squel[_0xd11a('0x5c')]();_0x4edbd2['field'](_0xd11a('0x5d'))['from'](_0xd11a('0x5e'),'tq')[_0xd11a('0x5f')](_0xd11a('0x60'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xd11a('0x21')](_0xd11a('0x61'),_0x10871['params']['id']);for(var _0x48c183=0x0;_0x48c183<_0x574a74[_0xd11a('0x2d')];_0x48c183+=0x1){let _0x2ef33a=_0x574a74[_0x48c183];for(var _0x5ea1fe=0x0;_0x5ea1fe<_0x2ef33a[_0xd11a('0x51')][_0xd11a('0x2d')];_0x5ea1fe+=0x1){let _0x530945=_0x2ef33a[_0xd11a('0x51')][_0x5ea1fe];var _0x42aee6=_0x4edbd2[_0xd11a('0x62')]();_0x42aee6[_0xd11a('0x21')]('ut.UserId\x20=\x20?',_0x530945['id']);_0x346009[_0xd11a('0x63')](db['sequelize'][_0xd11a('0x24')](_0x42aee6[_0xd11a('0x64')](),{'type':db['sequelize']['QueryTypes'][_0xd11a('0x65')]})[_0xd11a('0x16')](function(_0x41f636){if(_0x41f636[_0xd11a('0x2d')]===0x1){return _0x530945['id'];}else{var _0x305514=_['every'](_[_0xd11a('0x43')](_0x41f636,_0xd11a('0x66')),function(_0x3733c0){return _[_0xd11a('0x67')](_0x246a49,_0x3733c0);});if(_0x305514){return _0x530945['id'];}}}));}}return BPromise[_0xd11a('0x68')](_0x346009)[_0xd11a('0x16')](function(_0x1a89e2){_0x11e307=_(_0x11e307)[_0xd11a('0x69')](_0x1a89e2)[_0xd11a('0x6a')]()['value']();return db[_0xd11a('0x22')][_0xd11a('0x35')]({'where':{'id':_0x10871[_0xd11a('0x26')]['id']}})[_0xd11a('0x16')](function(_0x4faa97){return db['sequelize'][_0xd11a('0x56')](function(_0x1a2cfc){return _0x4faa97[_0xd11a('0x5b')](_0x10871[_0xd11a('0x24')][_0xd11a('0x6b')],{'transaction':_0x1a2cfc})[_0xd11a('0x16')](function(){if(!_[_0xd11a('0x6c')](_0x11e307)){return _0x4faa97[_0xd11a('0x6d')](_0x11e307,{'transaction':_0x1a2cfc});}})[_0xd11a('0x16')](function(){_0x11e307['forEach'](function(_0x3b2364){socket[_0xd11a('0x59')](_0xd11a('0x6e'),{'UserId':_0x3b2364,'OpenchannelQueueId':_0x4faa97['id']});});});});});});})[_0xd11a('0x16')](respondWithStatusCode(_0x302c53,null))['catch'](handleError(_0x302c53,null));};exports['addAgents']=function(_0x129098,_0x13db30){return db[_0xd11a('0x22')]['find']({'where':{'id':_0x129098[_0xd11a('0x26')]['id']}})['then'](handleEntityNotFound(_0x13db30,null))['then'](function(_0x229792){if(_0x229792){return _0x229792[_0xd11a('0x6f')](_0x129098[_0xd11a('0x31')][_0xd11a('0x6b')],_[_0xd11a('0x70')](_0x129098[_0xd11a('0x31')],[_0xd11a('0x6b'),'id'])||{})[_0xd11a('0x71')](function(_0x407edc){for(var _0x496f40=0x0;_0x496f40<_0x129098['body'][_0xd11a('0x6b')][_0xd11a('0x2d')];_0x496f40+=0x1){socket[_0xd11a('0x59')](_0xd11a('0x5a'),{'UserId':Number(_0x129098[_0xd11a('0x31')][_0xd11a('0x6b')][_0x496f40]),'OpenchannelQueueId':Number(_0x129098[_0xd11a('0x26')]['id'])});}return _0x407edc;});}})['then'](respondWithResult(_0x13db30,null))[_0xd11a('0x25')](handleError(_0x13db30,null));};exports[_0xd11a('0x6d')]=function(_0x407e5,_0x553a9d){return db[_0xd11a('0x22')][_0xd11a('0x35')]({'where':{'id':_0x407e5['params']['id']}})[_0xd11a('0x16')](handleEntityNotFound(_0x553a9d,null))[_0xd11a('0x16')](function(_0x1bd52c){if(_0x1bd52c){return _0x1bd52c[_0xd11a('0x6d')](_0x407e5['query']['ids'])[_0xd11a('0x16')](function(){if(_[_0xd11a('0x72')](_0x407e5['query']['ids'])){for(var _0x331a88=0x0;_0x331a88<_0x407e5[_0xd11a('0x24')][_0xd11a('0x6b')][_0xd11a('0x2d')];_0x331a88+=0x1){socket[_0xd11a('0x59')]('userOpenchannelQueue:remove',{'UserId':Number(_0x407e5[_0xd11a('0x24')][_0xd11a('0x6b')][_0x331a88]),'OpenchannelQueueId':Number(_0x407e5[_0xd11a('0x26')]['id'])});}}else{socket['emit'](_0xd11a('0x6e'),{'UserId':Number(_0x407e5[_0xd11a('0x24')][_0xd11a('0x6b')]),'OpenchannelQueueId':Number(_0x407e5[_0xd11a('0x26')]['id'])});}});}})['then'](respondWithStatusCode(_0x553a9d,null))[_0xd11a('0x25')](handleError(_0x553a9d,null));};exports[_0xd11a('0x73')]=function(_0x2fc167,_0x28d743){var _0x2fe3e6={};var _0x1fc910={};var _0xa2f7b0;var _0x4d1935;return db['OpenchannelQueue'][_0xd11a('0x4e')]({'where':{'id':_0x2fc167[_0xd11a('0x26')]['id']}})[_0xd11a('0x16')](handleEntityNotFound(_0x28d743,null))[_0xd11a('0x16')](function(_0x33d7a9){if(_0x33d7a9){_0xa2f7b0=_0x33d7a9;_0x1fc910['model']=_['keys'](db[_0xd11a('0x41')][_0xd11a('0x28')]);_0x1fc910[_0xd11a('0x24')]=_['keys'](_0x2fc167['query']);_0x1fc910[_0xd11a('0x39')]=_[_0xd11a('0x29')](_0x1fc910[_0xd11a('0x2a')],_0x1fc910[_0xd11a('0x24')]);_0x2fe3e6[_0xd11a('0x2b')]=_[_0xd11a('0x29')](_0x1fc910['model'],qs[_0xd11a('0x2c')](_0x2fc167['query']['fields']));_0x2fe3e6[_0xd11a('0x2b')]=_0x2fe3e6[_0xd11a('0x2b')][_0xd11a('0x2d')]?_0x2fe3e6['attributes']:_0x1fc910['model'];_0x2fe3e6[_0xd11a('0x3c')]=qs[_0xd11a('0x3d')](_0x2fc167[_0xd11a('0x24')][_0xd11a('0x3d')]);_0x2fe3e6[_0xd11a('0x21')]=qs[_0xd11a('0x39')](_['pick'](_0x2fc167[_0xd11a('0x24')],_0x1fc910[_0xd11a('0x39')]));if(_0x2fc167['query']['filter']){_0x2fe3e6[_0xd11a('0x21')]=_['merge'](_0x2fe3e6[_0xd11a('0x21')],{'$or':_[_0xd11a('0x43')](_0x2fe3e6[_0xd11a('0x2b')],function(_0x5b44b7){var _0xab8c8a={};_0xab8c8a[_0x5b44b7]={'$like':'%'+_0x2fc167[_0xd11a('0x24')][_0xd11a('0x3f')]+'%'};return _0xab8c8a;})});}_0x2fe3e6=_['merge']({},_0x2fe3e6,_0x2fc167[_0xd11a('0x2f')]);return _0xa2f7b0[_0xd11a('0x73')](_0x2fe3e6);}})[_0xd11a('0x16')](function(_0x4a8155){if(_0x4a8155){_0x4d1935=_0x4a8155[_0xd11a('0x2d')];if(!_0x2fc167[_0xd11a('0x24')][_0xd11a('0x3a')](_0xd11a('0x3b'))){_0x2fe3e6[_0xd11a('0x12')]=qs[_0xd11a('0x12')](_0x2fc167[_0xd11a('0x24')]['limit']);_0x2fe3e6[_0xd11a('0x10')]=qs[_0xd11a('0x10')](_0x2fc167[_0xd11a('0x24')][_0xd11a('0x10')]);}return _0xa2f7b0['getAgents'](_0x2fe3e6);}})[_0xd11a('0x16')](function(_0x2dcc03){if(_0x2dcc03){return _0x2dcc03?{'count':_0x4d1935,'rows':_0x2dcc03}:null;}})[_0xd11a('0x16')](respondWithResult(_0x28d743,null))[_0xd11a('0x25')](handleError(_0x28d743,null));}; \ No newline at end of file +var _0x382d=['findAll','rows','catch','show','params','model','keys','OpenchannelQueue','rawAttributes','filters','intersection','attributes','fields','length','includeAll','merge','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserOpenchannelQueue','order','sort','pick','filter','User','map','UserId','openchannelPause','createdAt','SIP','updatedAt','getTeams','findOne','nolimit','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','removeTeams','Team','select','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','union','compact','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','omit','spread','userOpenchannelQueue:save','getAgents','bluebird','util','lodash','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','json','offset','limit','undefined','count','update','then','destroy','get','OpenchannelQueues','UserProfileResource','end','error','stack','name','send','index','fieldName','type','key','getOptions','where','include','query'];(function(_0x434010,_0x591dd5){var _0x37cab1=function(_0x4fab0b){while(--_0x4fab0b){_0x434010['push'](_0x434010['shift']());}};_0x37cab1(++_0x591dd5);}(_0x382d,0xcc));var _0xd382=function(_0x2c9c82,_0x99aa7){_0x2c9c82=_0x2c9c82-0x0;var _0x3978fa=_0x382d[_0x2c9c82];return _0x3978fa;};'use strict';var BPromise=require(_0xd382('0x0'));var util=require(_0xd382('0x1'));var _=require(_0xd382('0x2'));var squel=require('squel');var Redis=require(_0xd382('0x3'));var qs=require(_0xd382('0x4'));var logger=require('../../config/logger')(_0xd382('0x5'));var config=require(_0xd382('0x6'));var db=require(_0xd382('0x7'))['db'];config[_0xd382('0x8')]=_[_0xd382('0x9')](config['redis'],{'host':_0xd382('0xa'),'port':0x18eb});var socket=require(_0xd382('0xb'))(new Redis(config['redis']));require(_0xd382('0xc'))[_0xd382('0xd')](socket);function respondWithStatusCode(_0xc07dd3,_0x51d587){_0x51d587=_0x51d587||0xcc;return function(_0x1e9da2){if(_0x1e9da2){return _0xc07dd3[_0xd382('0xe')](_0x51d587);}return _0xc07dd3['status'](_0x51d587)['end']();};}function respondWithResult(_0x49fb09,_0x3d4a89){_0x3d4a89=_0x3d4a89||0xc8;return function(_0x25f3f3){if(_0x25f3f3){return _0x49fb09[_0xd382('0xf')](_0x3d4a89)[_0xd382('0x10')](_0x25f3f3);}};}function respondWithFilteredResult(_0x1354d9,_0x235f69){return function(_0x2b3778){if(_0x2b3778){var _0x54e985=typeof _0x235f69[_0xd382('0x11')]==='undefined'&&typeof _0x235f69[_0xd382('0x12')]===_0xd382('0x13');var _0x258a6d=_0x2b3778['count'];var _0x1d214b=_0x54e985?0x0:_0x235f69[_0xd382('0x11')];var _0x2b9fc2=_0x54e985?_0x2b3778[_0xd382('0x14')]:_0x235f69[_0xd382('0x11')]+_0x235f69[_0xd382('0x12')];var _0x80dcc3;if(_0x2b9fc2>=_0x258a6d){_0x2b9fc2=_0x258a6d;_0x80dcc3=0xc8;}else{_0x80dcc3=0xce;}_0x1354d9['status'](_0x80dcc3);return _0x1354d9['set']('Content-Range',_0x1d214b+'-'+_0x2b9fc2+'/'+_0x258a6d)[_0xd382('0x10')](_0x2b3778);}return null;};}function saveUpdates(_0x1d1c8f){return function(_0x3a80b3){if(_0x3a80b3){return _0x3a80b3[_0xd382('0x15')](_0x1d1c8f)[_0xd382('0x16')](function(_0x31e7e0){return _0x31e7e0;});}return null;};}function removeEntity(_0x55abf9){return function(_0x2a94c3){if(_0x2a94c3){return _0x2a94c3[_0xd382('0x17')]()['then'](function(){var _0x27b64c=_0x2a94c3[_0xd382('0x18')]({'plain':!![]});var _0x2b4930=_0xd382('0x19');return db[_0xd382('0x1a')][_0xd382('0x17')]({'where':{'type':_0x2b4930,'resourceId':_0x27b64c['id']}})[_0xd382('0x16')](function(){return _0x2a94c3;});})[_0xd382('0x16')](function(){_0x55abf9[_0xd382('0xf')](0xcc)[_0xd382('0x1b')]();});}};}function handleEntityNotFound(_0x1c642d){return function(_0x3a96c3){if(!_0x3a96c3){_0x1c642d['sendStatus'](0x194);}return _0x3a96c3;};}function handleError(_0x484c6a,_0x452f97){_0x452f97=_0x452f97||0x1f4;return function(_0x32ea45){logger[_0xd382('0x1c')](_0x32ea45[_0xd382('0x1d')]);if(_0x32ea45['name']){delete _0x32ea45[_0xd382('0x1e')];}_0x484c6a[_0xd382('0xf')](_0x452f97)[_0xd382('0x1f')](_0x32ea45);};}exports[_0xd382('0x20')]=function(_0xd5fbba,_0x77a2e1){var _0x1863e6={};var _0x48e120={'count':0x0,'rows':[]};var _0x39886b=_['map'](db['OpenchannelQueue']['rawAttributes'],function(_0x2be559){return{'name':_0x2be559[_0xd382('0x21')],'type':_0x2be559[_0xd382('0x22')][_0xd382('0x23')]};});_0x1863e6=qs[_0xd382('0x24')](_0x39886b,_0xd5fbba);var _0x101ab7={'where':_0x1863e6[_0xd382('0x25')]};return db['OpenchannelQueue'][_0xd382('0x14')](_0x101ab7)[_0xd382('0x16')](function(_0x13c0c){_0x48e120[_0xd382('0x14')]=_0x13c0c;_0x1863e6[_0xd382('0x26')]=qs['include'](_0xd5fbba[_0xd382('0x27')]);return db['OpenchannelQueue'][_0xd382('0x28')](_0x1863e6);})[_0xd382('0x16')](function(_0x42aeff){_0x48e120[_0xd382('0x29')]=_0x42aeff;return _0x48e120;})['then'](respondWithFilteredResult(_0x77a2e1,_0x1863e6))[_0xd382('0x2a')](handleError(_0x77a2e1,null));};exports[_0xd382('0x2b')]=function(_0x2fc5bf,_0x120512){var _0x256b19={'raw':!![],'where':{'id':_0x2fc5bf[_0xd382('0x2c')]['id']}},_0x1b9ce={};_0x1b9ce[_0xd382('0x2d')]=_[_0xd382('0x2e')](db[_0xd382('0x2f')][_0xd382('0x30')]);_0x1b9ce[_0xd382('0x27')]=_[_0xd382('0x2e')](_0x2fc5bf['query']);_0x1b9ce[_0xd382('0x31')]=_[_0xd382('0x32')](_0x1b9ce['model'],_0x1b9ce['query']);_0x256b19[_0xd382('0x33')]=_[_0xd382('0x32')](_0x1b9ce[_0xd382('0x2d')],qs[_0xd382('0x34')](_0x2fc5bf[_0xd382('0x27')][_0xd382('0x34')]));_0x256b19[_0xd382('0x33')]=_0x256b19[_0xd382('0x33')][_0xd382('0x35')]?_0x256b19[_0xd382('0x33')]:_0x1b9ce[_0xd382('0x2d')];if(_0x2fc5bf[_0xd382('0x27')][_0xd382('0x36')]){_0x256b19[_0xd382('0x26')]=[{'all':!![]}];}_0x256b19=_[_0xd382('0x37')]({},_0x256b19,_0x2fc5bf[_0xd382('0x38')]);return db[_0xd382('0x2f')]['find'](_0x256b19)['then'](handleEntityNotFound(_0x120512,null))[_0xd382('0x16')](respondWithResult(_0x120512,null))['catch'](handleError(_0x120512,null));};exports[_0xd382('0x39')]=function(_0x467d8f,_0xdad896){return db[_0xd382('0x2f')][_0xd382('0x39')](_0x467d8f[_0xd382('0x3a')],{})[_0xd382('0x16')](function(_0x1369ef){var _0x2178a8=_0x467d8f['user']['get']({'plain':!![]});if(!_0x2178a8)throw new Error(_0xd382('0x3b'));if(_0x2178a8[_0xd382('0x3c')]===_0xd382('0x3d')){var _0x4a1f5c=_0x1369ef[_0xd382('0x18')]({'plain':!![]});var _0x4e9c74=_0xd382('0x19');return db['UserProfileSection'][_0xd382('0x3e')]({'where':{'name':_0x4e9c74,'userProfileId':_0x2178a8[_0xd382('0x3f')]},'raw':!![]})[_0xd382('0x16')](function(_0x2f052a){if(_0x2f052a&&_0x2f052a[_0xd382('0x40')]===0x0){return db[_0xd382('0x1a')][_0xd382('0x39')]({'name':_0x4a1f5c['name'],'resourceId':_0x4a1f5c['id'],'type':_0x2f052a[_0xd382('0x1e')],'sectionId':_0x2f052a['id']},{})['then'](function(){return _0x1369ef;});}else{return _0x1369ef;}})[_0xd382('0x2a')](function(_0x5a3b1a){logger[_0xd382('0x1c')](_0xd382('0x41'),_0x5a3b1a);throw _0x5a3b1a;});}return _0x1369ef;})[_0xd382('0x16')](respondWithResult(_0xdad896,0xc9))[_0xd382('0x2a')](handleError(_0xdad896,null));};exports[_0xd382('0x15')]=function(_0x258401,_0x43d8ed){if(_0x258401[_0xd382('0x3a')]['id']){delete _0x258401['body']['id'];}return db['OpenchannelQueue'][_0xd382('0x3e')]({'where':{'id':_0x258401[_0xd382('0x2c')]['id']}})[_0xd382('0x16')](handleEntityNotFound(_0x43d8ed,null))[_0xd382('0x16')](saveUpdates(_0x258401['body'],null))['then'](respondWithResult(_0x43d8ed,null))[_0xd382('0x2a')](handleError(_0x43d8ed,null));};exports[_0xd382('0x17')]=function(_0xb688f5,_0x4f9cb9){return db[_0xd382('0x2f')][_0xd382('0x3e')]({'where':{'id':_0xb688f5[_0xd382('0x2c')]['id']}})[_0xd382('0x16')](handleEntityNotFound(_0x4f9cb9,null))[_0xd382('0x16')](removeEntity(_0x4f9cb9,null))[_0xd382('0x2a')](handleError(_0x4f9cb9,null));};exports[_0xd382('0x42')]=function(_0x11a84b,_0x4dd3a7){return db[_0xd382('0x2f')]['describe']()[_0xd382('0x16')](respondWithResult(_0x4dd3a7,null))[_0xd382('0x2a')](handleError(_0x4dd3a7,null));};exports[_0xd382('0x43')]=function(_0x5c3fe8,_0x104276){var _0x337f53={'raw':!![],'where':{}},_0x46cd59={},_0x544c44;return db[_0xd382('0x2f')]['findOne']({'where':{'id':_0x5c3fe8['params']['id']}})[_0xd382('0x16')](handleEntityNotFound(_0x104276,null))['then'](function(_0x5c632c){if(_0x5c632c){_0x544c44=_0x5c632c[_0xd382('0x18')]({'plain':!![]});_0x46cd59[_0xd382('0x2d')]=_[_0xd382('0x2e')](db[_0xd382('0x44')][_0xd382('0x30')]);_0x46cd59[_0xd382('0x27')]=_[_0xd382('0x2e')](_0x5c3fe8[_0xd382('0x27')]);_0x46cd59[_0xd382('0x31')]=_[_0xd382('0x32')](_0x46cd59[_0xd382('0x2d')],_0x46cd59['query']);_0x337f53['attributes']=_[_0xd382('0x32')](_0x46cd59[_0xd382('0x2d')],qs[_0xd382('0x34')](_0x5c3fe8[_0xd382('0x27')]['fields']));_0x337f53[_0xd382('0x33')]=_0x337f53[_0xd382('0x33')][_0xd382('0x35')]?_0x337f53[_0xd382('0x33')]:_0x46cd59['model'];if(!_0x5c3fe8[_0xd382('0x27')]['hasOwnProperty']('nolimit')){_0x337f53[_0xd382('0x12')]=qs[_0xd382('0x12')](_0x5c3fe8[_0xd382('0x27')]['limit']);_0x337f53[_0xd382('0x11')]=qs['offset'](_0x5c3fe8[_0xd382('0x27')][_0xd382('0x11')]);}_0x337f53[_0xd382('0x45')]=qs['sort'](_0x5c3fe8['query'][_0xd382('0x46')]);_0x337f53[_0xd382('0x25')]=qs[_0xd382('0x31')](_[_0xd382('0x47')](_0x5c3fe8['query'],_0x46cd59[_0xd382('0x31')]));_0x337f53[_0xd382('0x25')]['OpenchannelQueueId']=_0x5c632c['id'];if(_0x5c3fe8[_0xd382('0x27')][_0xd382('0x48')]){_0x337f53[_0xd382('0x25')]=_[_0xd382('0x37')](_0x337f53[_0xd382('0x25')],{'$or':_['map'](_0x337f53[_0xd382('0x33')],function(_0x6c7456){var _0x5d352d={};_0x5d352d[_0x6c7456]={'$like':'%'+_0x5c3fe8['query'][_0xd382('0x48')]+'%'};return _0x5d352d;})});}_0x337f53=_[_0xd382('0x37')]({},_0x337f53,_0x5c3fe8[_0xd382('0x38')]);return db[_0xd382('0x44')][_0xd382('0x28')](_0x337f53);}})[_0xd382('0x16')](function(_0x339507){if(_0x339507){return db[_0xd382('0x49')]['findAndCountAll']({'where':{'id':_[_0xd382('0x4a')](_0x339507,_0xd382('0x4b')),'role':'agent'},'attributes':['id','name',_0xd382('0x4c'),'updatedAt',_0xd382('0x4d')]});}})[_0xd382('0x16')](function(_0x3adc4d){if(_0x3adc4d){return{'count':_0x3adc4d['count'],'rows':_[_0xd382('0x4a')](_0x3adc4d[_0xd382('0x29')],function(_0x2af86f){return{'membername':_0x2af86f[_0xd382('0x1e')],'UserId':_0x2af86f['id'],'queue_name':_0x544c44[_0xd382('0x1e')],'OpenchannelQueueId':_0x544c44['id'],'interface':util['format']('%s/%s',_0xd382('0x4e'),_0x2af86f['name']),'penalty':0x0,'paused':_0x2af86f[_0xd382('0x4c')],'createdAt':_0x2af86f[_0xd382('0x4d')],'updatedAt':_0x2af86f[_0xd382('0x4f')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x104276,_0x337f53))[_0xd382('0x2a')](handleError(_0x104276,null));};exports[_0xd382('0x50')]=function(_0x128a65,_0x211f99){var _0xfaae7b={};var _0x750214={};var _0x595811;var _0x2f1bee;return db[_0xd382('0x2f')][_0xd382('0x51')]({'where':{'id':_0x128a65['params']['id']}})[_0xd382('0x16')](handleEntityNotFound(_0x211f99,null))[_0xd382('0x16')](function(_0x16c24a){if(_0x16c24a){_0x595811=_0x16c24a;_0x750214['model']=_[_0xd382('0x2e')](db['Team'][_0xd382('0x30')]);_0x750214[_0xd382('0x27')]=_[_0xd382('0x2e')](_0x128a65[_0xd382('0x27')]);_0x750214[_0xd382('0x31')]=_[_0xd382('0x32')](_0x750214[_0xd382('0x2d')],_0x750214[_0xd382('0x27')]);_0xfaae7b[_0xd382('0x33')]=_[_0xd382('0x32')](_0x750214['model'],qs['fields'](_0x128a65[_0xd382('0x27')][_0xd382('0x34')]));_0xfaae7b[_0xd382('0x33')]=_0xfaae7b[_0xd382('0x33')]['length']?_0xfaae7b[_0xd382('0x33')]:_0x750214[_0xd382('0x2d')];_0xfaae7b[_0xd382('0x45')]=qs[_0xd382('0x46')](_0x128a65['query']['sort']);_0xfaae7b[_0xd382('0x25')]=qs[_0xd382('0x31')](_[_0xd382('0x47')](_0x128a65[_0xd382('0x27')],_0x750214['filters']));if(_0x128a65[_0xd382('0x27')][_0xd382('0x48')]){_0xfaae7b[_0xd382('0x25')]=_[_0xd382('0x37')](_0xfaae7b[_0xd382('0x25')],{'$or':_[_0xd382('0x4a')](_0xfaae7b['attributes'],function(_0x4fcb07){var _0x13562b={};_0x13562b[_0x4fcb07]={'$like':'%'+_0x128a65[_0xd382('0x27')][_0xd382('0x48')]+'%'};return _0x13562b;})});}_0xfaae7b=_[_0xd382('0x37')]({},_0xfaae7b,_0x128a65[_0xd382('0x38')]);return _0x595811[_0xd382('0x50')](_0xfaae7b);}})[_0xd382('0x16')](function(_0x3741b0){if(_0x3741b0){_0x2f1bee=_0x3741b0[_0xd382('0x35')];if(!_0x128a65['query']['hasOwnProperty'](_0xd382('0x52'))){_0xfaae7b['limit']=qs[_0xd382('0x12')](_0x128a65[_0xd382('0x27')]['limit']);_0xfaae7b[_0xd382('0x11')]=qs['offset'](_0x128a65[_0xd382('0x27')][_0xd382('0x11')]);}return _0x595811[_0xd382('0x50')](_0xfaae7b);}})['then'](function(_0x2cc5e3){if(_0x2cc5e3){return _0x2cc5e3?{'count':_0x2f1bee,'rows':_0x2cc5e3}:null;}})[_0xd382('0x16')](respondWithResult(_0x211f99,null))[_0xd382('0x2a')](handleError(_0x211f99,null));};exports[_0xd382('0x53')]=function(_0x42edd4,_0xa51b33){var _0x2a3137=_0x42edd4[_0xd382('0x3a')][_0xd382('0x54')];return db['Team'][_0xd382('0x28')]({'where':{'id':_0x2a3137},'attributes':['id'],'include':[{'model':db[_0xd382('0x49')],'as':_0xd382('0x55'),'attributes':['id',_0xd382('0x1e'),_0xd382('0x56'),_0xd382('0x57'),_0xd382('0x58')],'raw':!![]}]})[_0xd382('0x16')](function(_0x3d5911){if(_0x3d5911){var _0x8d1d82=_[_0xd382('0x59')](_0x3d5911,function(_0x5ab337){var _0x56344d=_0x5ab337[_0xd382('0x18')]({'plain':!![]});return _0x56344d[_0xd382('0x55')];});return db[_0xd382('0x2f')]['find']({'where':{'id':_0x42edd4[_0xd382('0x2c')]['id']}})['then'](function(_0x18dfe3){return db[_0xd382('0x5a')][_0xd382('0x5b')](function(_0x331e42){return _0x18dfe3[_0xd382('0x53')](_0x2a3137,{'transaction':_0x331e42})[_0xd382('0x16')](function(){return BPromise[_0xd382('0x5c')](_0x8d1d82,function(_0x47bf35){return db[_0xd382('0x44')][_0xd382('0x5d')]({'where':{'UserId':_0x47bf35['id'],'OpenchannelQueueId':_0x42edd4['params']['id']},'transaction':_0x331e42});});})[_0xd382('0x16')](function(){_0x8d1d82[_0xd382('0x5e')](function(_0x361f64){socket[_0xd382('0x5f')]('userOpenchannelQueue:save',{'UserId':_0x361f64['id'],'OpenchannelQueueId':_0x18dfe3['id']});});});});});}})['then'](respondWithStatusCode(_0xa51b33,null))[_0xd382('0x2a')](handleError(_0xa51b33,null));};exports[_0xd382('0x60')]=function(_0x1c99bf,_0x22c884){return db[_0xd382('0x61')]['findAll']({'where':{'id':_0x1c99bf[_0xd382('0x27')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x22c884,null))[_0xd382('0x16')](function(_0x324540){var _0x3fce6b=_[_0xd382('0x4a')](_0x324540,'id');var _0x461601=[];var _0x3866cb=[];var _0x4726f5=squel[_0xd382('0x62')]();_0x4726f5['field'](_0xd382('0x63'))[_0xd382('0x64')](_0xd382('0x65'),'tq')[_0xd382('0x66')](_0xd382('0x67'),'ut',_0xd382('0x68'))[_0xd382('0x25')](_0xd382('0x69'),_0x1c99bf['params']['id']);for(var _0x4eb07d=0x0;_0x4eb07d<_0x324540[_0xd382('0x35')];_0x4eb07d+=0x1){let _0x352943=_0x324540[_0x4eb07d];for(var _0x2cc8d7=0x0;_0x2cc8d7<_0x352943['Agents'][_0xd382('0x35')];_0x2cc8d7+=0x1){let _0x5b9efa=_0x352943['Agents'][_0x2cc8d7];var _0x55ccdc=_0x4726f5['clone']();_0x55ccdc['where'](_0xd382('0x6a'),_0x5b9efa['id']);_0x3866cb[_0xd382('0x6b')](db['sequelize'][_0xd382('0x27')](_0x55ccdc[_0xd382('0x6c')](),{'type':db[_0xd382('0x5a')][_0xd382('0x6d')][_0xd382('0x6e')]})[_0xd382('0x16')](function(_0x29e8cb){if(_0x29e8cb[_0xd382('0x35')]===0x1){return _0x5b9efa['id'];}else{var _0x13ced9=_[_0xd382('0x6f')](_[_0xd382('0x4a')](_0x29e8cb,'TeamId'),function(_0x552079){return _['includes'](_0x3fce6b,_0x552079);});if(_0x13ced9){return _0x5b9efa['id'];}}}));}}return BPromise['all'](_0x3866cb)[_0xd382('0x16')](function(_0x2cf7d1){_0x461601=_(_0x461601)[_0xd382('0x70')](_0x2cf7d1)[_0xd382('0x71')]()['value']();return db['OpenchannelQueue'][_0xd382('0x3e')]({'where':{'id':_0x1c99bf[_0xd382('0x2c')]['id']}})[_0xd382('0x16')](function(_0x56bc0f){return db[_0xd382('0x5a')]['transaction'](function(_0x654cb4){return _0x56bc0f[_0xd382('0x60')](_0x1c99bf[_0xd382('0x27')][_0xd382('0x54')],{'transaction':_0x654cb4})[_0xd382('0x16')](function(){if(!_[_0xd382('0x72')](_0x461601)){return _0x56bc0f[_0xd382('0x73')](_0x461601,{'transaction':_0x654cb4});}})['then'](function(){_0x461601[_0xd382('0x5e')](function(_0x3d2841){socket['emit'](_0xd382('0x74'),{'UserId':_0x3d2841,'OpenchannelQueueId':_0x56bc0f['id']});});});});});});})[_0xd382('0x16')](respondWithStatusCode(_0x22c884,null))[_0xd382('0x2a')](handleError(_0x22c884,null));};exports[_0xd382('0x75')]=function(_0x44e830,_0x4573b5){return db['OpenchannelQueue'][_0xd382('0x3e')]({'where':{'id':_0x44e830[_0xd382('0x2c')]['id']}})[_0xd382('0x16')](handleEntityNotFound(_0x4573b5,null))[_0xd382('0x16')](function(_0x2d9d9d){if(_0x2d9d9d){return _0x2d9d9d[_0xd382('0x75')](_0x44e830[_0xd382('0x3a')][_0xd382('0x54')],_[_0xd382('0x76')](_0x44e830[_0xd382('0x3a')],['ids','id'])||{})[_0xd382('0x77')](function(_0x133310){for(var _0x21611d=0x0;_0x21611d<_0x44e830['body']['ids'][_0xd382('0x35')];_0x21611d+=0x1){socket[_0xd382('0x5f')](_0xd382('0x78'),{'UserId':Number(_0x44e830[_0xd382('0x3a')][_0xd382('0x54')][_0x21611d]),'OpenchannelQueueId':Number(_0x44e830[_0xd382('0x2c')]['id'])});}return _0x133310;});}})['then'](respondWithResult(_0x4573b5,null))['catch'](handleError(_0x4573b5,null));};exports[_0xd382('0x73')]=function(_0x193362,_0x504bff){return db[_0xd382('0x2f')]['find']({'where':{'id':_0x193362[_0xd382('0x2c')]['id']}})[_0xd382('0x16')](handleEntityNotFound(_0x504bff,null))[_0xd382('0x16')](function(_0x3e60d2){if(_0x3e60d2){return _0x3e60d2[_0xd382('0x73')](_0x193362[_0xd382('0x27')][_0xd382('0x54')])[_0xd382('0x16')](function(){if(_['isArray'](_0x193362[_0xd382('0x27')][_0xd382('0x54')])){for(var _0x1d9876=0x0;_0x1d9876<_0x193362[_0xd382('0x27')][_0xd382('0x54')][_0xd382('0x35')];_0x1d9876+=0x1){socket[_0xd382('0x5f')](_0xd382('0x74'),{'UserId':Number(_0x193362['query'][_0xd382('0x54')][_0x1d9876]),'OpenchannelQueueId':Number(_0x193362['params']['id'])});}}else{socket[_0xd382('0x5f')](_0xd382('0x74'),{'UserId':Number(_0x193362[_0xd382('0x27')]['ids']),'OpenchannelQueueId':Number(_0x193362[_0xd382('0x2c')]['id'])});}});}})[_0xd382('0x16')](respondWithStatusCode(_0x504bff,null))[_0xd382('0x2a')](handleError(_0x504bff,null));};exports[_0xd382('0x79')]=function(_0x3c1a1d,_0x59a127){var _0x2dcb35={};var _0x305116={};var _0x484843;var _0x553966;return db[_0xd382('0x2f')][_0xd382('0x51')]({'where':{'id':_0x3c1a1d[_0xd382('0x2c')]['id']}})[_0xd382('0x16')](handleEntityNotFound(_0x59a127,null))[_0xd382('0x16')](function(_0xa41cfe){if(_0xa41cfe){_0x484843=_0xa41cfe;_0x305116['model']=_['keys'](db[_0xd382('0x49')][_0xd382('0x30')]);_0x305116['query']=_[_0xd382('0x2e')](_0x3c1a1d[_0xd382('0x27')]);_0x305116[_0xd382('0x31')]=_[_0xd382('0x32')](_0x305116[_0xd382('0x2d')],_0x305116[_0xd382('0x27')]);_0x2dcb35[_0xd382('0x33')]=_[_0xd382('0x32')](_0x305116[_0xd382('0x2d')],qs['fields'](_0x3c1a1d[_0xd382('0x27')][_0xd382('0x34')]));_0x2dcb35[_0xd382('0x33')]=_0x2dcb35[_0xd382('0x33')][_0xd382('0x35')]?_0x2dcb35[_0xd382('0x33')]:_0x305116['model'];_0x2dcb35[_0xd382('0x45')]=qs[_0xd382('0x46')](_0x3c1a1d[_0xd382('0x27')]['sort']);_0x2dcb35[_0xd382('0x25')]=qs[_0xd382('0x31')](_[_0xd382('0x47')](_0x3c1a1d[_0xd382('0x27')],_0x305116[_0xd382('0x31')]));if(_0x3c1a1d[_0xd382('0x27')]['filter']){_0x2dcb35['where']=_[_0xd382('0x37')](_0x2dcb35['where'],{'$or':_[_0xd382('0x4a')](_0x2dcb35['attributes'],function(_0x2ba208){var _0x1afddf={};_0x1afddf[_0x2ba208]={'$like':'%'+_0x3c1a1d['query'][_0xd382('0x48')]+'%'};return _0x1afddf;})});}_0x2dcb35=_[_0xd382('0x37')]({},_0x2dcb35,_0x3c1a1d[_0xd382('0x38')]);return _0x484843[_0xd382('0x79')](_0x2dcb35);}})[_0xd382('0x16')](function(_0x483ef3){if(_0x483ef3){_0x553966=_0x483ef3['length'];if(!_0x3c1a1d['query']['hasOwnProperty']('nolimit')){_0x2dcb35['limit']=qs[_0xd382('0x12')](_0x3c1a1d['query'][_0xd382('0x12')]);_0x2dcb35[_0xd382('0x11')]=qs['offset'](_0x3c1a1d['query']['offset']);}return _0x484843[_0xd382('0x79')](_0x2dcb35);}})['then'](function(_0x37e4c8){if(_0x37e4c8){return _0x37e4c8?{'count':_0x553966,'rows':_0x37e4c8}:null;}})['then'](respondWithResult(_0x59a127,null))['catch'](handleError(_0x59a127,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index b4a0ba9..3333a85 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 _0x5b17=['save','update','emit','hook','exports','events','../../mysqldb','OpenchannelQueue'];(function(_0x72b07e,_0x29b69b){var _0x410e78=function(_0x32d2e5){while(--_0x32d2e5){_0x72b07e['push'](_0x72b07e['shift']());}};_0x410e78(++_0x29b69b);}(_0x5b17,0x18d));var _0x75b1=function(_0x13f91f,_0x4dded4){_0x13f91f=_0x13f91f-0x0;var _0x4dabed=_0x5b17[_0x13f91f];return _0x4dabed;};'use strict';var EventEmitter=require(_0x75b1('0x0'));var OpenchannelQueue=require(_0x75b1('0x1'))['db'][_0x75b1('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x75b1('0x3'),'afterUpdate':_0x75b1('0x4'),'afterDestroy':'remove'};function emitEvent(_0x532564){return function(_0x34d1e9,_0x939c11,_0x560176){OpenchannelQueueEvents[_0x75b1('0x5')](_0x532564+':'+_0x34d1e9['id'],_0x34d1e9);OpenchannelQueueEvents[_0x75b1('0x5')](_0x532564,_0x34d1e9);_0x560176(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue[_0x75b1('0x6')](e,emitEvent(event));}}module[_0x75b1('0x7')]=OpenchannelQueueEvents; \ No newline at end of file +var _0xfe3a=['../../mysqldb','OpenchannelQueue','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x19babd,_0x1d4ef7){var _0x314eaf=function(_0x24ea35){while(--_0x24ea35){_0x19babd['push'](_0x19babd['shift']());}};_0x314eaf(++_0x1d4ef7);}(_0xfe3a,0x183));var _0xafe3=function(_0x309fbd,_0x47450f){_0x309fbd=_0x309fbd-0x0;var _0x21373e=_0xfe3a[_0x309fbd];return _0x21373e;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0xafe3('0x0'))['db'][_0xafe3('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xafe3('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xafe3('0x3'),'afterDestroy':_0xafe3('0x4')};function emitEvent(_0x3d5650){return function(_0x444c55,_0x4849df,_0x227f34){OpenchannelQueueEvents[_0xafe3('0x5')](_0x3d5650+':'+_0x444c55['id'],_0x444c55);OpenchannelQueueEvents[_0xafe3('0x5')](_0x3d5650,_0x444c55);_0x227f34(null);};}for(var e in events){if(events[_0xafe3('0x6')](e)){var event=events[e];OpenchannelQueue[_0xafe3('0x7')](e,emitEvent(event));}}module[_0xafe3('0x8')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 051cbd2..612b14a 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 _0x5d52=['OpenchannelQueue','openchannel_queues','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueue.attributes','define'];(function(_0x45de50,_0x376018){var _0x5551e9=function(_0x594ee1){while(--_0x594ee1){_0x45de50['push'](_0x45de50['shift']());}};_0x5551e9(++_0x376018);}(_0x5d52,0xe6));var _0x25d5=function(_0x4843cf,_0x480cb5){_0x4843cf=_0x4843cf-0x0;var _0x52ad78=_0x5d52[_0x4843cf];return _0x52ad78;};'use strict';var _=require(_0x25d5('0x0'));var util=require(_0x25d5('0x1'));var logger=require(_0x25d5('0x2'))('api');var moment=require(_0x25d5('0x3'));var BPromise=require(_0x25d5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x25d5('0x5'));var rimraf=require(_0x25d5('0x6'));var config=require(_0x25d5('0x7'));var attributes=require(_0x25d5('0x8'));module['exports']=function(_0x43175e,_0xfe6a23){return _0x43175e[_0x25d5('0x9')](_0x25d5('0xa'),attributes,{'tableName':_0x25d5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x205c=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','OpenchannelQueue','openchannel_queues','util','../../config/logger','api','moment'];(function(_0x137815,_0x78dd4b){var _0x29ded1=function(_0x32d620){while(--_0x32d620){_0x137815['push'](_0x137815['shift']());}};_0x29ded1(++_0x78dd4b);}(_0x205c,0x11a));var _0xc205=function(_0x270adf,_0x1daaa3){_0x270adf=_0x270adf-0x0;var _0x29eda9=_0x205c[_0x270adf];return _0x29eda9;};'use strict';var _=require('lodash');var util=require(_0xc205('0x0'));var logger=require(_0xc205('0x1'))(_0xc205('0x2'));var moment=require(_0xc205('0x3'));var BPromise=require(_0xc205('0x4'));var rp=require(_0xc205('0x5'));var fs=require('fs');var path=require(_0xc205('0x6'));var rimraf=require(_0xc205('0x7'));var config=require(_0xc205('0x8'));var attributes=require('./openchannelQueue.attributes');module[_0xc205('0x9')]=function(_0x13af71,_0x2d3c52){return _0x13af71[_0xc205('0xa')](_0xc205('0xb'),attributes,{'tableName':_0xc205('0xc'),'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 73b2d6d..11827b2 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 _0xe965=['stringify','ShowOpenchannelQueue','find','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','client','defaults','socket.io-emitter','redis','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','limit','include','model','attributes','map'];(function(_0x424c29,_0x33bdfe){var _0x37b86f=function(_0x4b8725){while(--_0x4b8725){_0x424c29['push'](_0x424c29['shift']());}};_0x37b86f(++_0x33bdfe);}(_0xe965,0x16b));var _0x5e96=function(_0x25aa2b,_0x471a1b){_0x25aa2b=_0x25aa2b-0x0;var _0x1b3898=_0xe965[_0x25aa2b];return _0x1b3898;};'use strict';var _=require(_0x5e96('0x0'));var util=require(_0x5e96('0x1'));var moment=require(_0x5e96('0x2'));var BPromise=require('bluebird');var rs=require(_0x5e96('0x3'));var fs=require('fs');var Redis=require(_0x5e96('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5e96('0x5'));var logger=require(_0x5e96('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5e96('0x7')]['http']({'port':0x232a});config['redis']=_[_0x5e96('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x5e96('0x9'))(new Redis(config[_0x5e96('0xa')]));require('./openchannelQueue.socket')[_0x5e96('0xb')](socket);function respondWithRpcPromise(_0x3dd85a,_0x1d33c,_0x5e4850){return new BPromise(function(_0x53682b,_0x2e952f){return client[_0x5e96('0xc')](_0x3dd85a,_0x5e4850)[_0x5e96('0xd')](function(_0x2463fc){logger[_0x5e96('0xe')](_0x5e96('0xf'),_0x1d33c,_0x5e96('0x10'));logger[_0x5e96('0x11')]('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x1d33c,'request\x20sent',JSON['stringify'](_0x2463fc));if(_0x2463fc[_0x5e96('0x12')]){if(_0x2463fc[_0x5e96('0x12')][_0x5e96('0x13')]===0x1f4){logger[_0x5e96('0x12')]('OpenchannelQueue,\x20%s,\x20%s',_0x1d33c,_0x2463fc[_0x5e96('0x12')][_0x5e96('0x14')]);return _0x2e952f(_0x2463fc[_0x5e96('0x12')][_0x5e96('0x14')]);}logger[_0x5e96('0x12')](_0x5e96('0xf'),_0x1d33c,_0x2463fc[_0x5e96('0x12')]['message']);return _0x53682b(_0x2463fc['error'][_0x5e96('0x14')]);}else{logger['info'](_0x5e96('0xf'),_0x1d33c,'request\x20sent');_0x53682b(_0x2463fc['result'][_0x5e96('0x14')]);}})[_0x5e96('0x15')](function(_0x160d84){logger[_0x5e96('0x12')]('OpenchannelQueue,\x20%s,\x20%s',_0x1d33c,_0x160d84);_0x2e952f(_0x160d84);});});}exports[_0x5e96('0x16')]=function(_0x385051){var _0x45a96c=this;return new Promise(function(_0x237529,_0x3c40b7){return db[_0x5e96('0x17')][_0x5e96('0x18')]({'raw':_0x385051['options']?_0x385051[_0x5e96('0x19')][_0x5e96('0x1a')]===undefined?!![]:![]:!![],'where':_0x385051['options']?_0x385051['options'][_0x5e96('0x1b')]||null:null,'attributes':_0x385051[_0x5e96('0x19')]?_0x385051['options']['attributes']||null:null,'limit':_0x385051['options']?_0x385051[_0x5e96('0x19')][_0x5e96('0x1c')]||null:null,'include':_0x385051[_0x5e96('0x19')]?_0x385051[_0x5e96('0x19')][_0x5e96('0x1d')]?_['map'](_0x385051[_0x5e96('0x19')]['include'],function(_0x3c942d){return{'model':db[_0x3c942d[_0x5e96('0x1e')]],'as':_0x3c942d['as'],'attributes':_0x3c942d[_0x5e96('0x1f')],'include':_0x3c942d[_0x5e96('0x1d')]?_['map'](_0x3c942d['include'],function(_0x4087ea){return{'model':db[_0x4087ea[_0x5e96('0x1e')]],'as':_0x4087ea['as'],'attributes':_0x4087ea[_0x5e96('0x1f')],'include':_0x4087ea[_0x5e96('0x1d')]?_[_0x5e96('0x20')](_0x4087ea[_0x5e96('0x1d')],function(_0x340a4a){return{'model':db[_0x340a4a[_0x5e96('0x1e')]],'as':_0x340a4a['as'],'attributes':_0x340a4a[_0x5e96('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3955c8){logger[_0x5e96('0xe')](_0x5e96('0x16'),_0x385051);logger['debug'](_0x5e96('0x16'),_0x385051,JSON[_0x5e96('0x21')](_0x3955c8));_0x237529(_0x3955c8);})[_0x5e96('0x15')](function(_0x21c50d){logger[_0x5e96('0x12')]('GetOpenchannelQueue',_0x21c50d[_0x5e96('0x14')],_0x385051);_0x3c40b7(_0x45a96c['error'](0x1f4,_0x21c50d[_0x5e96('0x14')]));});});};exports[_0x5e96('0x22')]=function(_0x12a9ac){var _0x271f6d=this;return new Promise(function(_0x3b2cdd,_0x4ea3d8){return db[_0x5e96('0x17')][_0x5e96('0x23')]({'raw':_0x12a9ac['options']?_0x12a9ac[_0x5e96('0x19')][_0x5e96('0x1a')]===undefined?!![]:![]:!![],'where':_0x12a9ac[_0x5e96('0x19')]?_0x12a9ac[_0x5e96('0x19')][_0x5e96('0x1b')]||null:null,'attributes':_0x12a9ac[_0x5e96('0x19')]?_0x12a9ac[_0x5e96('0x19')][_0x5e96('0x1f')]||null:null,'include':_0x12a9ac[_0x5e96('0x19')]?_0x12a9ac[_0x5e96('0x19')][_0x5e96('0x1d')]?_[_0x5e96('0x20')](_0x12a9ac['options']['include'],function(_0xb81fcc){return{'model':db[_0xb81fcc[_0x5e96('0x1e')]],'as':_0xb81fcc['as'],'attributes':_0xb81fcc[_0x5e96('0x1f')],'include':_0xb81fcc[_0x5e96('0x1d')]?_[_0x5e96('0x20')](_0xb81fcc[_0x5e96('0x1d')],function(_0x300e2c){return{'model':db[_0x300e2c[_0x5e96('0x1e')]],'as':_0x300e2c['as'],'attributes':_0x300e2c['attributes'],'include':_0x300e2c['include']?_['map'](_0x300e2c['include'],function(_0x445daa){return{'model':db[_0x445daa['model']],'as':_0x445daa['as'],'attributes':_0x445daa[_0x5e96('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3bfca6){logger[_0x5e96('0xe')](_0x5e96('0x22'),_0x12a9ac);logger[_0x5e96('0x11')](_0x5e96('0x22'),_0x12a9ac,JSON[_0x5e96('0x21')](_0x3bfca6));_0x3b2cdd(_0x3bfca6);})[_0x5e96('0x15')](function(_0x3144ee){logger[_0x5e96('0x12')](_0x5e96('0x22'),_0x3144ee[_0x5e96('0x14')],_0x12a9ac);_0x4ea3d8(_0x271f6d[_0x5e96('0x12')](0x1f4,_0x3144ee['message']));});});}; \ No newline at end of file +var _0xeb6f=['request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','OpenchannelQueue','findAll','options','where','attributes','include','model','map','GetOpenchannelQueue','ShowOpenchannelQueue','find','raw','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register'];(function(_0x190dbd,_0x24a507){var _0x868d27=function(_0x253c6f){while(--_0x253c6f){_0x190dbd['push'](_0x190dbd['shift']());}};_0x868d27(++_0x24a507);}(_0xeb6f,0x1ec));var _0xfeb6=function(_0x3f8282,_0x11b607){_0x3f8282=_0x3f8282-0x0;var _0x50f918=_0xeb6f[_0x3f8282];return _0x50f918;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfeb6('0x0'));var BPromise=require(_0xfeb6('0x1'));var rs=require(_0xfeb6('0x2'));var fs=require('fs');var Redis=require(_0xfeb6('0x3'));var db=require(_0xfeb6('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xfeb6('0x5'))('rpc');var config=require(_0xfeb6('0x6'));var jayson=require(_0xfeb6('0x7'));var client=jayson['client'][_0xfeb6('0x8')]({'port':0x232a});config['redis']=_[_0xfeb6('0x9')](config[_0xfeb6('0xa')],{'host':_0xfeb6('0xb'),'port':0x18eb});var socket=require(_0xfeb6('0xc'))(new Redis(config[_0xfeb6('0xa')]));require(_0xfeb6('0xd'))[_0xfeb6('0xe')](socket);function respondWithRpcPromise(_0x4bc1e9,_0xe3279a,_0x3122ad){return new BPromise(function(_0x34371f,_0x1b0af6){return client[_0xfeb6('0xf')](_0x4bc1e9,_0x3122ad)[_0xfeb6('0x10')](function(_0xec8f7e){logger[_0xfeb6('0x11')](_0xfeb6('0x12'),_0xe3279a,_0xfeb6('0x13'));logger[_0xfeb6('0x14')](_0xfeb6('0x15'),_0xe3279a,'request\x20sent',JSON[_0xfeb6('0x16')](_0xec8f7e));if(_0xec8f7e[_0xfeb6('0x17')]){if(_0xec8f7e[_0xfeb6('0x17')][_0xfeb6('0x18')]===0x1f4){logger['error'](_0xfeb6('0x12'),_0xe3279a,_0xec8f7e[_0xfeb6('0x17')][_0xfeb6('0x19')]);return _0x1b0af6(_0xec8f7e[_0xfeb6('0x17')][_0xfeb6('0x19')]);}logger[_0xfeb6('0x17')](_0xfeb6('0x12'),_0xe3279a,_0xec8f7e[_0xfeb6('0x17')][_0xfeb6('0x19')]);return _0x34371f(_0xec8f7e['error'][_0xfeb6('0x19')]);}else{logger['info'](_0xfeb6('0x12'),_0xe3279a,_0xfeb6('0x13'));_0x34371f(_0xec8f7e['result'][_0xfeb6('0x19')]);}})[_0xfeb6('0x1a')](function(_0x139a63){logger[_0xfeb6('0x17')](_0xfeb6('0x12'),_0xe3279a,_0x139a63);_0x1b0af6(_0x139a63);});});}exports['GetOpenchannelQueue']=function(_0x55a35e){var _0x247eb6=this;return new Promise(function(_0x181d6a,_0x4a6d6f){return db[_0xfeb6('0x1b')][_0xfeb6('0x1c')]({'raw':_0x55a35e[_0xfeb6('0x1d')]?_0x55a35e['options']['raw']===undefined?!![]:![]:!![],'where':_0x55a35e['options']?_0x55a35e[_0xfeb6('0x1d')][_0xfeb6('0x1e')]||null:null,'attributes':_0x55a35e['options']?_0x55a35e[_0xfeb6('0x1d')][_0xfeb6('0x1f')]||null:null,'limit':_0x55a35e['options']?_0x55a35e[_0xfeb6('0x1d')]['limit']||null:null,'include':_0x55a35e[_0xfeb6('0x1d')]?_0x55a35e[_0xfeb6('0x1d')]['include']?_['map'](_0x55a35e['options'][_0xfeb6('0x20')],function(_0x14496c){return{'model':db[_0x14496c[_0xfeb6('0x21')]],'as':_0x14496c['as'],'attributes':_0x14496c[_0xfeb6('0x1f')],'include':_0x14496c[_0xfeb6('0x20')]?_['map'](_0x14496c[_0xfeb6('0x20')],function(_0x230f0e){return{'model':db[_0x230f0e[_0xfeb6('0x21')]],'as':_0x230f0e['as'],'attributes':_0x230f0e['attributes'],'include':_0x230f0e[_0xfeb6('0x20')]?_[_0xfeb6('0x22')](_0x230f0e[_0xfeb6('0x20')],function(_0x1380e0){return{'model':db[_0x1380e0['model']],'as':_0x1380e0['as'],'attributes':_0x1380e0[_0xfeb6('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xfeb6('0x10')](function(_0x432632){logger[_0xfeb6('0x11')](_0xfeb6('0x23'),_0x55a35e);logger[_0xfeb6('0x14')]('GetOpenchannelQueue',_0x55a35e,JSON[_0xfeb6('0x16')](_0x432632));_0x181d6a(_0x432632);})[_0xfeb6('0x1a')](function(_0x453196){logger['error']('GetOpenchannelQueue',_0x453196[_0xfeb6('0x19')],_0x55a35e);_0x4a6d6f(_0x247eb6[_0xfeb6('0x17')](0x1f4,_0x453196['message']));});});};exports[_0xfeb6('0x24')]=function(_0x39c4f3){var _0x290ad0=this;return new Promise(function(_0x1656e5,_0x1e5053){return db[_0xfeb6('0x1b')][_0xfeb6('0x25')]({'raw':_0x39c4f3[_0xfeb6('0x1d')]?_0x39c4f3[_0xfeb6('0x1d')][_0xfeb6('0x26')]===undefined?!![]:![]:!![],'where':_0x39c4f3[_0xfeb6('0x1d')]?_0x39c4f3[_0xfeb6('0x1d')][_0xfeb6('0x1e')]||null:null,'attributes':_0x39c4f3['options']?_0x39c4f3['options'][_0xfeb6('0x1f')]||null:null,'include':_0x39c4f3['options']?_0x39c4f3['options'][_0xfeb6('0x20')]?_['map'](_0x39c4f3[_0xfeb6('0x1d')]['include'],function(_0x35c6f2){return{'model':db[_0x35c6f2[_0xfeb6('0x21')]],'as':_0x35c6f2['as'],'attributes':_0x35c6f2[_0xfeb6('0x1f')],'include':_0x35c6f2[_0xfeb6('0x20')]?_['map'](_0x35c6f2[_0xfeb6('0x20')],function(_0x49f3e0){return{'model':db[_0x49f3e0[_0xfeb6('0x21')]],'as':_0x49f3e0['as'],'attributes':_0x49f3e0['attributes'],'include':_0x49f3e0[_0xfeb6('0x20')]?_[_0xfeb6('0x22')](_0x49f3e0[_0xfeb6('0x20')],function(_0x1756e2){return{'model':db[_0x1756e2[_0xfeb6('0x21')]],'as':_0x1756e2['as'],'attributes':_0x1756e2[_0xfeb6('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xfeb6('0x10')](function(_0x40b07d){logger[_0xfeb6('0x11')](_0xfeb6('0x24'),_0x39c4f3);logger[_0xfeb6('0x14')](_0xfeb6('0x24'),_0x39c4f3,JSON[_0xfeb6('0x16')](_0x40b07d));_0x1656e5(_0x40b07d);})[_0xfeb6('0x1a')](function(_0x1b5d7e){logger['error'](_0xfeb6('0x24'),_0x1b5d7e[_0xfeb6('0x19')],_0x39c4f3);_0x1e5053(_0x290ad0[_0xfeb6('0x17')](0x1f4,_0x1b5d7e['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 7227145..5773a90 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 _0xc20e=['save','update','emit','removeListener','register','length','openchannelQueue:','./openchannelQueue.events'];(function(_0xc20f22,_0x49698f){var _0x1535d5=function(_0x5ce3f3){while(--_0x5ce3f3){_0xc20f22['push'](_0xc20f22['shift']());}};_0x1535d5(++_0x49698f);}(_0xc20e,0x127));var _0xec20=function(_0x12d3eb,_0x2437ca){_0x12d3eb=_0x12d3eb-0x0;var _0x4731a3=_0xc20e[_0x12d3eb];return _0x4731a3;};'use strict';var OpenchannelQueueEvents=require(_0xec20('0x0'));var events=[_0xec20('0x1'),'remove',_0xec20('0x2')];function createListener(_0xbeee3f,_0x550e7d){return function(_0x58be21){_0x550e7d[_0xec20('0x3')](_0xbeee3f,_0x58be21);};}function removeListener(_0x132f43,_0x4cbbab){return function(){OpenchannelQueueEvents[_0xec20('0x4')](_0x132f43,_0x4cbbab);};}exports[_0xec20('0x5')]=function(_0x1c82de){for(var _0x3dab28=0x0,_0x6cf281=events[_0xec20('0x6')];_0x3dab28<_0x6cf281;_0x3dab28++){var _0x5ccc51=events[_0x3dab28];var _0x179b84=createListener(_0xec20('0x7')+_0x5ccc51,_0x1c82de);OpenchannelQueueEvents['on'](_0x5ccc51,_0x179b84);}}; \ No newline at end of file +var _0x2f68=['openchannelQueue:','./openchannelQueue.events','save','update','emit','removeListener','register','length'];(function(_0x257b00,_0x3658be){var _0x247e16=function(_0x4cf5e8){while(--_0x4cf5e8){_0x257b00['push'](_0x257b00['shift']());}};_0x247e16(++_0x3658be);}(_0x2f68,0x1a9));var _0x82f6=function(_0x1abee7,_0x3c3d7c){_0x1abee7=_0x1abee7-0x0;var _0x2c9f2f=_0x2f68[_0x1abee7];return _0x2c9f2f;};'use strict';var OpenchannelQueueEvents=require(_0x82f6('0x0'));var events=[_0x82f6('0x1'),'remove',_0x82f6('0x2')];function createListener(_0x37aa0c,_0x16b97d){return function(_0x5c829c){_0x16b97d[_0x82f6('0x3')](_0x37aa0c,_0x5c829c);};}function removeListener(_0x4dc238,_0x4e21f7){return function(){OpenchannelQueueEvents[_0x82f6('0x4')](_0x4dc238,_0x4e21f7);};}exports[_0x82f6('0x5')]=function(_0x18525f){for(var _0x2048e=0x0,_0x3d17e2=events[_0x82f6('0x6')];_0x2048e<_0x3d17e2;_0x2048e++){var _0x4b8a57=events[_0x2048e];var _0x4d7cf1=createListener(_0x82f6('0x7')+_0x4b8a57,_0x18525f);OpenchannelQueueEvents['on'](_0x4b8a57,_0x4d7cf1);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 3101d68..e5995f7 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 _0x193b=['destroy','exports','multer','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','isAuthenticated','get','/describe','/:id','show','post','create','put'];(function(_0x490401,_0x2935b9){var _0x516a83=function(_0x102181){while(--_0x102181){_0x490401['push'](_0x490401['shift']());}};_0x516a83(++_0x2935b9);}(_0x193b,0x19a));var _0xb193=function(_0x4008de,_0x15f2e9){_0x4008de=_0x4008de-0x0;var _0x596738=_0x193b[_0x4008de];return _0x596738;};'use strict';var multer=require(_0xb193('0x0'));var util=require('util');var path=require(_0xb193('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb193('0x2')]();var fs_extra=require(_0xb193('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xb193('0x4'));var config=require(_0xb193('0x5'));var controller=require(_0xb193('0x6'));router['get']('/',auth[_0xb193('0x7')](),controller['index']);router[_0xb193('0x8')](_0xb193('0x9'),auth[_0xb193('0x7')](),controller['describe']);router['get'](_0xb193('0xa'),auth[_0xb193('0x7')](),controller[_0xb193('0xb')]);router[_0xb193('0xc')]('/',auth[_0xb193('0x7')](),controller[_0xb193('0xd')]);router[_0xb193('0xe')](_0xb193('0xa'),auth[_0xb193('0x7')](),controller['update']);router['delete']('/:id',auth[_0xb193('0x7')](),controller[_0xb193('0xf')]);module[_0xb193('0x10')]=router; \ No newline at end of file +var _0x68ac=['show','post','create','put','update','delete','destroy','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelQueueReport.controller','get','isAuthenticated','index','/describe','/:id'];(function(_0x179615,_0x7796fa){var _0xa115d=function(_0x37e9e0){while(--_0x37e9e0){_0x179615['push'](_0x179615['shift']());}};_0xa115d(++_0x7796fa);}(_0x68ac,0x80));var _0xc68a=function(_0x542171,_0x22e421){_0x542171=_0x542171-0x0;var _0x278e45=_0x68ac[_0x542171];return _0x278e45;};'use strict';var multer=require('multer');var util=require(_0xc68a('0x0'));var path=require('path');var timeout=require(_0xc68a('0x1'));var express=require('express');var router=express[_0xc68a('0x2')]();var fs_extra=require(_0xc68a('0x3'));var auth=require(_0xc68a('0x4'));var interaction=require(_0xc68a('0x5'));var config=require('../../config/environment');var controller=require(_0xc68a('0x6'));router[_0xc68a('0x7')]('/',auth[_0xc68a('0x8')](),controller[_0xc68a('0x9')]);router['get'](_0xc68a('0xa'),auth[_0xc68a('0x8')](),controller['describe']);router['get'](_0xc68a('0xb'),auth['isAuthenticated'](),controller[_0xc68a('0xc')]);router[_0xc68a('0xd')]('/',auth['isAuthenticated'](),controller[_0xc68a('0xe')]);router[_0xc68a('0xf')](_0xc68a('0xb'),auth[_0xc68a('0x8')](),controller[_0xc68a('0x10')]);router[_0xc68a('0x11')]('/:id',auth[_0xc68a('0x8')](),controller[_0xc68a('0x12')]);module[_0xc68a('0x13')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 49b9af3..3c6fbb9 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 _0x0b8d=['STRING','DATE','sequelize','exports'];(function(_0x49243d,_0x42d551){var _0x21ab2a=function(_0x19125d){while(--_0x19125d){_0x49243d['push'](_0x49243d['shift']());}};_0x21ab2a(++_0x42d551);}(_0x0b8d,0x186));var _0xd0b8=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0x0b8d[_0x2d2c16];return _0x53f2fb;};'use strict';var moment=require('moment');var Sequelize=require(_0xd0b8('0x0'));module[_0xd0b8('0x1')]={'uniqueid':{'type':Sequelize[_0xd0b8('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xd0b8('0x2')]},'joinAt':{'type':Sequelize[_0xd0b8('0x3')]},'leaveAt':{'type':Sequelize[_0xd0b8('0x3')]},'acceptAt':{'type':Sequelize[_0xd0b8('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xd0b8('0x2')]}}; \ No newline at end of file +var _0x07fb=['DATE','moment','sequelize','exports','STRING'];(function(_0x5a79e2,_0x319b1a){var _0x266c45=function(_0x172478){while(--_0x172478){_0x5a79e2['push'](_0x5a79e2['shift']());}};_0x266c45(++_0x319b1a);}(_0x07fb,0x1e1));var _0xb07f=function(_0x5cc247,_0x1c0981){_0x5cc247=_0x5cc247-0x0;var _0x3a09ff=_0x07fb[_0x5cc247];return _0x3a09ff;};'use strict';var moment=require(_0xb07f('0x0'));var Sequelize=require(_0xb07f('0x1'));module[_0xb07f('0x2')]={'uniqueid':{'type':Sequelize[_0xb07f('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xb07f('0x3')]},'joinAt':{'type':Sequelize[_0xb07f('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xb07f('0x4')]},'exitAt':{'type':Sequelize[_0xb07f('0x4')]},'reason':{'type':Sequelize[_0xb07f('0x3')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 2555f28..1849997 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 _0x8ce8=['key','map','name','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','stack','send','index','OpenchannelQueueReport','rawAttributes','fieldName','type'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8ce8,0x157));var _0x88ce=function(_0x7ab6b6,_0x4f7b85){_0x7ab6b6=_0x7ab6b6-0x0;var _0x53569e=_0x8ce8[_0x7ab6b6];return _0x53569e;};'use strict';var emlformat=require(_0x88ce('0x0'));var rimraf=require(_0x88ce('0x1'));var zipdir=require(_0x88ce('0x2'));var jsonpatch=require(_0x88ce('0x3'));var rp=require(_0x88ce('0x4'));var moment=require('moment');var BPromise=require(_0x88ce('0x5'));var Mustache=require(_0x88ce('0x6'));var util=require('util');var path=require('path');var sox=require(_0x88ce('0x7'));var csv=require(_0x88ce('0x8'));var ejs=require(_0x88ce('0x9'));var fs=require('fs');var fs_extra=require(_0x88ce('0xa'));var _=require('lodash');var squel=require(_0x88ce('0xb'));var crypto=require(_0x88ce('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x88ce('0xd'));var toCsv=require(_0x88ce('0x8'));var querystring=require(_0x88ce('0xe'));var Papa=require('papaparse');var Redis=require(_0x88ce('0xf'));var authService=require(_0x88ce('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x88ce('0x11'));var hardwareService=require(_0x88ce('0x12'));var logger=require('../../config/logger')(_0x88ce('0x13'));var utils=require(_0x88ce('0x14'));var config=require(_0x88ce('0x15'));var licenseUtil=require(_0x88ce('0x16'));var db=require(_0x88ce('0x17'))['db'];function respondWithStatusCode(_0x1b0173,_0x23f49e){_0x23f49e=_0x23f49e||0xcc;return function(_0x167467){if(_0x167467){return _0x1b0173[_0x88ce('0x18')](_0x23f49e);}return _0x1b0173['status'](_0x23f49e)[_0x88ce('0x19')]();};}function respondWithResult(_0x5c6caf,_0x4a0212){_0x4a0212=_0x4a0212||0xc8;return function(_0x420305){if(_0x420305){return _0x5c6caf[_0x88ce('0x1a')](_0x4a0212)[_0x88ce('0x1b')](_0x420305);}};}function respondWithFilteredResult(_0x3e52cb,_0x25c227){return function(_0x2451ae){if(_0x2451ae){var _0x53579e=typeof _0x25c227['offset']===_0x88ce('0x1c')&&typeof _0x25c227[_0x88ce('0x1d')]===_0x88ce('0x1c');var _0x1bdcd8=_0x2451ae[_0x88ce('0x1e')];var _0x5ce6cb=_0x53579e?0x0:_0x25c227['offset'];var _0x1574b1=_0x53579e?_0x2451ae[_0x88ce('0x1e')]:_0x25c227[_0x88ce('0x1f')]+_0x25c227['limit'];var _0x2d425d;if(_0x1574b1>=_0x1bdcd8){_0x1574b1=_0x1bdcd8;_0x2d425d=0xc8;}else{_0x2d425d=0xce;}_0x3e52cb[_0x88ce('0x1a')](_0x2d425d);return _0x3e52cb[_0x88ce('0x20')](_0x88ce('0x21'),_0x5ce6cb+'-'+_0x1574b1+'/'+_0x1bdcd8)[_0x88ce('0x1b')](_0x2451ae);}return null;};}function patchUpdates(_0x421300){return function(_0x525aae){try{jsonpatch[_0x88ce('0x22')](_0x525aae,_0x421300,!![]);}catch(_0x1605fe){return BPromise[_0x88ce('0x23')](_0x1605fe);}return _0x525aae[_0x88ce('0x24')]();};}function saveUpdates(_0x552335,_0x29fae0){return function(_0x8cb5c6){if(_0x8cb5c6){return _0x8cb5c6[_0x88ce('0x25')](_0x552335)[_0x88ce('0x26')](function(_0x4e881b){return _0x4e881b;});}return null;};}function removeEntity(_0x282414,_0xf2649e){return function(_0x4baa23){if(_0x4baa23){return _0x4baa23[_0x88ce('0x27')]()['then'](function(){_0x282414['status'](0xcc)[_0x88ce('0x19')]();});}};}function handleEntityNotFound(_0x38ffa7,_0x15b9d7){return function(_0x29fccb){if(!_0x29fccb){_0x38ffa7['sendStatus'](0x194);}return _0x29fccb;};}function handleError(_0x4344cf,_0x321992){_0x321992=_0x321992||0x1f4;return function(_0x1505d7){logger['error'](_0x1505d7[_0x88ce('0x28')]);if(_0x1505d7['name']){delete _0x1505d7['name'];}_0x4344cf[_0x88ce('0x1a')](_0x321992)[_0x88ce('0x29')](_0x1505d7);};}exports[_0x88ce('0x2a')]=function(_0x4395f0,_0x556b3c){var _0x255d59={},_0x3b8772={},_0x3c9666={'count':0x0,'rows':[]};var _0xd3c73=_['map'](db[_0x88ce('0x2b')][_0x88ce('0x2c')],function(_0x222c02){return{'name':_0x222c02[_0x88ce('0x2d')],'type':_0x222c02[_0x88ce('0x2e')][_0x88ce('0x2f')]};});_0x3b8772['model']=_[_0x88ce('0x30')](_0xd3c73,_0x88ce('0x31'));_0x3b8772[_0x88ce('0x32')]=_[_0x88ce('0x33')](_0x4395f0['query']);_0x3b8772[_0x88ce('0x34')]=_[_0x88ce('0x35')](_0x3b8772[_0x88ce('0x36')],_0x3b8772[_0x88ce('0x32')]);_0x255d59['attributes']=_[_0x88ce('0x35')](_0x3b8772['model'],qs[_0x88ce('0x37')](_0x4395f0['query']['fields']));_0x255d59[_0x88ce('0x38')]=_0x255d59[_0x88ce('0x38')]['length']?_0x255d59[_0x88ce('0x38')]:_0x3b8772[_0x88ce('0x36')];if(!_0x4395f0[_0x88ce('0x32')][_0x88ce('0x39')](_0x88ce('0x3a'))){_0x255d59[_0x88ce('0x1d')]=qs[_0x88ce('0x1d')](_0x4395f0[_0x88ce('0x32')][_0x88ce('0x1d')]);_0x255d59[_0x88ce('0x1f')]=qs[_0x88ce('0x1f')](_0x4395f0[_0x88ce('0x32')][_0x88ce('0x1f')]);}_0x255d59[_0x88ce('0x3b')]=qs[_0x88ce('0x3c')](_0x4395f0[_0x88ce('0x32')][_0x88ce('0x3c')]);_0x255d59[_0x88ce('0x3d')]=qs[_0x88ce('0x34')](_['pick'](_0x4395f0[_0x88ce('0x32')],_0x3b8772['filters']),_0xd3c73);if(_0x4395f0['query']['filter']){_0x255d59['where']=_[_0x88ce('0x3e')](_0x255d59['where'],{'$or':_[_0x88ce('0x30')](_0xd3c73,function(_0x2bcbdb){if(_0x2bcbdb['type']!==_0x88ce('0x3f')){var _0x3afac5={};_0x3afac5[_0x2bcbdb[_0x88ce('0x31')]]={'$like':'%'+_0x4395f0[_0x88ce('0x32')][_0x88ce('0x40')]+'%'};return _0x3afac5;}})});}_0x255d59=_[_0x88ce('0x3e')]({},_0x255d59,_0x4395f0[_0x88ce('0x41')]);var _0x474838={'where':_0x255d59['where']};return db[_0x88ce('0x2b')][_0x88ce('0x1e')](_0x474838)[_0x88ce('0x26')](function(_0x524fc1){_0x3c9666[_0x88ce('0x1e')]=_0x524fc1;if(_0x4395f0[_0x88ce('0x32')][_0x88ce('0x42')]){_0x255d59[_0x88ce('0x43')]=[{'all':!![]}];}return db[_0x88ce('0x2b')][_0x88ce('0x44')](_0x255d59);})[_0x88ce('0x26')](function(_0x4d39f7){_0x3c9666[_0x88ce('0x45')]=_0x4d39f7;return _0x3c9666;})[_0x88ce('0x26')](respondWithFilteredResult(_0x556b3c,_0x255d59))[_0x88ce('0x46')](handleError(_0x556b3c,null));};exports[_0x88ce('0x47')]=function(_0x55a7f3,_0x2beeed){var _0x9377cd={'raw':!![],'where':{'id':_0x55a7f3[_0x88ce('0x48')]['id']}},_0x3a2ff8={};_0x3a2ff8[_0x88ce('0x36')]=_[_0x88ce('0x33')](db[_0x88ce('0x2b')][_0x88ce('0x2c')]);_0x3a2ff8['query']=_[_0x88ce('0x33')](_0x55a7f3[_0x88ce('0x32')]);_0x3a2ff8[_0x88ce('0x34')]=_['intersection'](_0x3a2ff8['model'],_0x3a2ff8[_0x88ce('0x32')]);_0x9377cd[_0x88ce('0x38')]=_[_0x88ce('0x35')](_0x3a2ff8[_0x88ce('0x36')],qs[_0x88ce('0x37')](_0x55a7f3[_0x88ce('0x32')][_0x88ce('0x37')]));_0x9377cd[_0x88ce('0x38')]=_0x9377cd['attributes'][_0x88ce('0x49')]?_0x9377cd[_0x88ce('0x38')]:_0x3a2ff8['model'];if(_0x55a7f3[_0x88ce('0x32')][_0x88ce('0x42')]){_0x9377cd[_0x88ce('0x43')]=[{'all':!![]}];}_0x9377cd=_[_0x88ce('0x3e')]({},_0x9377cd,_0x55a7f3[_0x88ce('0x41')]);return db[_0x88ce('0x2b')][_0x88ce('0x4a')](_0x9377cd)[_0x88ce('0x26')](handleEntityNotFound(_0x2beeed,null))[_0x88ce('0x26')](respondWithResult(_0x2beeed,null))['catch'](handleError(_0x2beeed,null));};exports[_0x88ce('0x4b')]=function(_0x3adfa8,_0xcc4370){return db[_0x88ce('0x2b')][_0x88ce('0x4b')](_0x3adfa8['body'],{})[_0x88ce('0x26')](respondWithResult(_0xcc4370,0xc9))['catch'](handleError(_0xcc4370,null));};exports[_0x88ce('0x25')]=function(_0x4631c8,_0x2ef840){if(_0x4631c8[_0x88ce('0x4c')]['id']){delete _0x4631c8[_0x88ce('0x4c')]['id'];}return db[_0x88ce('0x2b')][_0x88ce('0x4a')]({'where':{'id':_0x4631c8[_0x88ce('0x48')]['id']}})[_0x88ce('0x26')](handleEntityNotFound(_0x2ef840,null))[_0x88ce('0x26')](saveUpdates(_0x4631c8['body'],null))[_0x88ce('0x26')](respondWithResult(_0x2ef840,null))[_0x88ce('0x46')](handleError(_0x2ef840,null));};exports[_0x88ce('0x27')]=function(_0x399bfb,_0x176454){return db[_0x88ce('0x2b')][_0x88ce('0x4a')]({'where':{'id':_0x399bfb['params']['id']}})[_0x88ce('0x26')](handleEntityNotFound(_0x176454,null))[_0x88ce('0x26')](removeEntity(_0x176454,null))[_0x88ce('0x46')](handleError(_0x176454,null));};exports['describe']=function(_0x41156e,_0x7d895e){return db[_0x88ce('0x2b')][_0x88ce('0x4d')]()[_0x88ce('0x26')](respondWithResult(_0x7d895e,null))[_0x88ce('0x46')](handleError(_0x7d895e,null));}; \ No newline at end of file +var _0xa5d5=['describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','where','pick','filter','merge','VIRTUAL','includeAll','findAll','params','include','options','catch','create','body','find'];(function(_0xf32da9,_0x36eaa7){var _0x3f5e5c=function(_0x565589){while(--_0x565589){_0xf32da9['push'](_0xf32da9['shift']());}};_0x3f5e5c(++_0x36eaa7);}(_0xa5d5,0x119));var _0x5a5d=function(_0x199579,_0x53529b){_0x199579=_0x199579-0x0;var _0x50d8a7=_0xa5d5[_0x199579];return _0x50d8a7;};'use strict';var emlformat=require(_0x5a5d('0x0'));var rimraf=require(_0x5a5d('0x1'));var zipdir=require(_0x5a5d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5a5d('0x3'));var moment=require(_0x5a5d('0x4'));var BPromise=require(_0x5a5d('0x5'));var Mustache=require(_0x5a5d('0x6'));var util=require(_0x5a5d('0x7'));var path=require(_0x5a5d('0x8'));var sox=require('sox');var csv=require(_0x5a5d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5a5d('0xa'));var squel=require(_0x5a5d('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5a5d('0xc'));var toCsv=require(_0x5a5d('0x9'));var querystring=require(_0x5a5d('0xd'));var Papa=require(_0x5a5d('0xe'));var Redis=require(_0x5a5d('0xf'));var authService=require(_0x5a5d('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5a5d('0x11'));var logger=require(_0x5a5d('0x12'))('api');var utils=require(_0x5a5d('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5a5d('0x14'))['db'];function respondWithStatusCode(_0x361a96,_0x4c89ad){_0x4c89ad=_0x4c89ad||0xcc;return function(_0x3e8964){if(_0x3e8964){return _0x361a96[_0x5a5d('0x15')](_0x4c89ad);}return _0x361a96[_0x5a5d('0x16')](_0x4c89ad)[_0x5a5d('0x17')]();};}function respondWithResult(_0x62d3ed,_0xd7398e){_0xd7398e=_0xd7398e||0xc8;return function(_0x1d03f9){if(_0x1d03f9){return _0x62d3ed[_0x5a5d('0x16')](_0xd7398e)[_0x5a5d('0x18')](_0x1d03f9);}};}function respondWithFilteredResult(_0x4b48d0,_0x38c145){return function(_0x3f4f79){if(_0x3f4f79){var _0x7bcbe=typeof _0x38c145[_0x5a5d('0x19')]===_0x5a5d('0x1a')&&typeof _0x38c145[_0x5a5d('0x1b')]==='undefined';var _0x5cbcba=_0x3f4f79[_0x5a5d('0x1c')];var _0x3dfb42=_0x7bcbe?0x0:_0x38c145[_0x5a5d('0x19')];var _0x373f59=_0x7bcbe?_0x3f4f79[_0x5a5d('0x1c')]:_0x38c145[_0x5a5d('0x19')]+_0x38c145['limit'];var _0x421fc1;if(_0x373f59>=_0x5cbcba){_0x373f59=_0x5cbcba;_0x421fc1=0xc8;}else{_0x421fc1=0xce;}_0x4b48d0['status'](_0x421fc1);return _0x4b48d0[_0x5a5d('0x1d')]('Content-Range',_0x3dfb42+'-'+_0x373f59+'/'+_0x5cbcba)[_0x5a5d('0x18')](_0x3f4f79);}return null;};}function patchUpdates(_0x23c249){return function(_0x1ac226){try{jsonpatch[_0x5a5d('0x1e')](_0x1ac226,_0x23c249,!![]);}catch(_0x4af6e8){return BPromise[_0x5a5d('0x1f')](_0x4af6e8);}return _0x1ac226[_0x5a5d('0x20')]();};}function saveUpdates(_0x409166,_0x227b06){return function(_0x4da6d5){if(_0x4da6d5){return _0x4da6d5[_0x5a5d('0x21')](_0x409166)[_0x5a5d('0x22')](function(_0x33e76b){return _0x33e76b;});}return null;};}function removeEntity(_0x4a7f31,_0x3aaf8d){return function(_0xf0e2f6){if(_0xf0e2f6){return _0xf0e2f6[_0x5a5d('0x23')]()[_0x5a5d('0x22')](function(){_0x4a7f31['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x44f18d,_0x44aab0){return function(_0x522a60){if(!_0x522a60){_0x44f18d['sendStatus'](0x194);}return _0x522a60;};}function handleError(_0x16ff61,_0x228395){_0x228395=_0x228395||0x1f4;return function(_0x43c415){logger[_0x5a5d('0x24')](_0x43c415[_0x5a5d('0x25')]);if(_0x43c415['name']){delete _0x43c415[_0x5a5d('0x26')];}_0x16ff61[_0x5a5d('0x16')](_0x228395)[_0x5a5d('0x27')](_0x43c415);};}exports['index']=function(_0x6e37f3,_0x4a4b01){var _0x40ea8a={},_0x3ed74c={},_0x47e40b={'count':0x0,'rows':[]};var _0x397460=_[_0x5a5d('0x28')](db[_0x5a5d('0x29')][_0x5a5d('0x2a')],function(_0x2dc74d){return{'name':_0x2dc74d[_0x5a5d('0x2b')],'type':_0x2dc74d[_0x5a5d('0x2c')][_0x5a5d('0x2d')]};});_0x3ed74c['model']=_['map'](_0x397460,_0x5a5d('0x26'));_0x3ed74c[_0x5a5d('0x2e')]=_[_0x5a5d('0x2f')](_0x6e37f3[_0x5a5d('0x2e')]);_0x3ed74c[_0x5a5d('0x30')]=_[_0x5a5d('0x31')](_0x3ed74c[_0x5a5d('0x32')],_0x3ed74c['query']);_0x40ea8a[_0x5a5d('0x33')]=_[_0x5a5d('0x31')](_0x3ed74c['model'],qs[_0x5a5d('0x34')](_0x6e37f3['query']['fields']));_0x40ea8a['attributes']=_0x40ea8a[_0x5a5d('0x33')][_0x5a5d('0x35')]?_0x40ea8a[_0x5a5d('0x33')]:_0x3ed74c['model'];if(!_0x6e37f3['query'][_0x5a5d('0x36')]('nolimit')){_0x40ea8a[_0x5a5d('0x1b')]=qs[_0x5a5d('0x1b')](_0x6e37f3[_0x5a5d('0x2e')][_0x5a5d('0x1b')]);_0x40ea8a[_0x5a5d('0x19')]=qs[_0x5a5d('0x19')](_0x6e37f3[_0x5a5d('0x2e')][_0x5a5d('0x19')]);}_0x40ea8a['order']=qs['sort'](_0x6e37f3[_0x5a5d('0x2e')]['sort']);_0x40ea8a[_0x5a5d('0x37')]=qs['filters'](_[_0x5a5d('0x38')](_0x6e37f3['query'],_0x3ed74c[_0x5a5d('0x30')]),_0x397460);if(_0x6e37f3[_0x5a5d('0x2e')][_0x5a5d('0x39')]){_0x40ea8a[_0x5a5d('0x37')]=_[_0x5a5d('0x3a')](_0x40ea8a[_0x5a5d('0x37')],{'$or':_[_0x5a5d('0x28')](_0x397460,function(_0x5178e5){if(_0x5178e5[_0x5a5d('0x2c')]!==_0x5a5d('0x3b')){var _0xe1f700={};_0xe1f700[_0x5178e5['name']]={'$like':'%'+_0x6e37f3[_0x5a5d('0x2e')][_0x5a5d('0x39')]+'%'};return _0xe1f700;}})});}_0x40ea8a=_['merge']({},_0x40ea8a,_0x6e37f3['options']);var _0x284d5e={'where':_0x40ea8a[_0x5a5d('0x37')]};return db[_0x5a5d('0x29')]['count'](_0x284d5e)[_0x5a5d('0x22')](function(_0x451c34){_0x47e40b[_0x5a5d('0x1c')]=_0x451c34;if(_0x6e37f3[_0x5a5d('0x2e')][_0x5a5d('0x3c')]){_0x40ea8a['include']=[{'all':!![]}];}return db['OpenchannelQueueReport'][_0x5a5d('0x3d')](_0x40ea8a);})['then'](function(_0x31655c){_0x47e40b['rows']=_0x31655c;return _0x47e40b;})[_0x5a5d('0x22')](respondWithFilteredResult(_0x4a4b01,_0x40ea8a))['catch'](handleError(_0x4a4b01,null));};exports['show']=function(_0x1d0b0b,_0x3084dd){var _0x2c093a={'raw':!![],'where':{'id':_0x1d0b0b[_0x5a5d('0x3e')]['id']}},_0x215bf6={};_0x215bf6[_0x5a5d('0x32')]=_[_0x5a5d('0x2f')](db[_0x5a5d('0x29')][_0x5a5d('0x2a')]);_0x215bf6[_0x5a5d('0x2e')]=_[_0x5a5d('0x2f')](_0x1d0b0b[_0x5a5d('0x2e')]);_0x215bf6[_0x5a5d('0x30')]=_[_0x5a5d('0x31')](_0x215bf6[_0x5a5d('0x32')],_0x215bf6[_0x5a5d('0x2e')]);_0x2c093a['attributes']=_['intersection'](_0x215bf6[_0x5a5d('0x32')],qs[_0x5a5d('0x34')](_0x1d0b0b['query'][_0x5a5d('0x34')]));_0x2c093a[_0x5a5d('0x33')]=_0x2c093a[_0x5a5d('0x33')][_0x5a5d('0x35')]?_0x2c093a[_0x5a5d('0x33')]:_0x215bf6[_0x5a5d('0x32')];if(_0x1d0b0b[_0x5a5d('0x2e')][_0x5a5d('0x3c')]){_0x2c093a[_0x5a5d('0x3f')]=[{'all':!![]}];}_0x2c093a=_[_0x5a5d('0x3a')]({},_0x2c093a,_0x1d0b0b[_0x5a5d('0x40')]);return db[_0x5a5d('0x29')]['find'](_0x2c093a)[_0x5a5d('0x22')](handleEntityNotFound(_0x3084dd,null))[_0x5a5d('0x22')](respondWithResult(_0x3084dd,null))[_0x5a5d('0x41')](handleError(_0x3084dd,null));};exports[_0x5a5d('0x42')]=function(_0x2073d6,_0x2b4375){return db[_0x5a5d('0x29')]['create'](_0x2073d6[_0x5a5d('0x43')],{})['then'](respondWithResult(_0x2b4375,0xc9))['catch'](handleError(_0x2b4375,null));};exports['update']=function(_0xf3b7da,_0x3e87a9){if(_0xf3b7da[_0x5a5d('0x43')]['id']){delete _0xf3b7da['body']['id'];}return db[_0x5a5d('0x29')][_0x5a5d('0x44')]({'where':{'id':_0xf3b7da[_0x5a5d('0x3e')]['id']}})['then'](handleEntityNotFound(_0x3e87a9,null))['then'](saveUpdates(_0xf3b7da[_0x5a5d('0x43')],null))[_0x5a5d('0x22')](respondWithResult(_0x3e87a9,null))[_0x5a5d('0x41')](handleError(_0x3e87a9,null));};exports['destroy']=function(_0x319e85,_0x402f32){return db[_0x5a5d('0x29')][_0x5a5d('0x44')]({'where':{'id':_0x319e85['params']['id']}})[_0x5a5d('0x22')](handleEntityNotFound(_0x402f32,null))[_0x5a5d('0x22')](removeEntity(_0x402f32,null))[_0x5a5d('0x41')](handleError(_0x402f32,null));};exports['describe']=function(_0xa0988f,_0x2d6443){return db['OpenchannelQueueReport'][_0x5a5d('0x45')]()[_0x5a5d('0x22')](respondWithResult(_0x2d6443,null))[_0x5a5d('0x41')](handleError(_0x2d6443,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index a655c22..4353af0 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.model.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1261=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','define','report_openchannel_queue','uniqueid','util'];(function(_0x41a22a,_0x1b4c00){var _0x361098=function(_0x192894){while(--_0x192894){_0x41a22a['push'](_0x41a22a['shift']());}};_0x361098(++_0x1b4c00);}(_0x1261,0x144));var _0x1126=function(_0x48a928,_0x430727){_0x48a928=_0x48a928-0x0;var _0x11c1e9=_0x1261[_0x48a928];return _0x11c1e9;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var logger=require(_0x1126('0x1'))(_0x1126('0x2'));var moment=require(_0x1126('0x3'));var BPromise=require(_0x1126('0x4'));var rp=require(_0x1126('0x5'));var fs=require('fs');var path=require(_0x1126('0x6'));var rimraf=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var attributes=require(_0x1126('0x9'));module['exports']=function(_0x5c68c8,_0x40ba58){return _0x5c68c8[_0x1126('0xa')]('OpenchannelQueueReport',attributes,{'tableName':_0x1126('0xb'),'paranoid':![],'indexes':[{'name':_0x1126('0xc'),'fields':[_0x1126('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1261=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','define','report_openchannel_queue','uniqueid','util'];(function(_0x5ac0d2,_0x37562d){var _0x10d2a6=function(_0x5ef07b){while(--_0x5ef07b){_0x5ac0d2['push'](_0x5ac0d2['shift']());}};_0x10d2a6(++_0x37562d);}(_0x1261,0x144));var _0x1126=function(_0x270dba,_0x1817d2){_0x270dba=_0x270dba-0x0;var _0x36b83b=_0x1261[_0x270dba];return _0x36b83b;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var logger=require(_0x1126('0x1'))(_0x1126('0x2'));var moment=require(_0x1126('0x3'));var BPromise=require(_0x1126('0x4'));var rp=require(_0x1126('0x5'));var fs=require('fs');var path=require(_0x1126('0x6'));var rimraf=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var attributes=require(_0x1126('0x9'));module['exports']=function(_0x5c68c8,_0x40ba58){return _0x5c68c8[_0x1126('0xa')]('OpenchannelQueueReport',attributes,{'tableName':_0x1126('0xb'),'paranoid':![],'indexes':[{'name':_0x1126('0xc'),'fields':[_0x1126('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 33775ae..8f2c70d 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 _0xd290=['OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','raw','UpdateOpenchannelQueueReport','update','where','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','debug'];(function(_0x4dee82,_0x111880){var _0x5b8229=function(_0x257504){while(--_0x257504){_0x4dee82['push'](_0x4dee82['shift']());}};_0x5b8229(++_0x111880);}(_0xd290,0x165));var _0x0d29=function(_0x5e9201,_0x40ab9b){_0x5e9201=_0x5e9201-0x0;var _0x10b536=_0xd290[_0x5e9201];return _0x10b536;};'use strict';var _=require(_0x0d29('0x0'));var util=require(_0x0d29('0x1'));var moment=require('moment');var BPromise=require(_0x0d29('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0d29('0x3'))['db'];var utils=require(_0x0d29('0x4'));var logger=require(_0x0d29('0x5'))(_0x0d29('0x6'));var config=require(_0x0d29('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0d29('0x8')][_0x0d29('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x151d32,_0x376d19,_0x276aeb){return new BPromise(function(_0x4edfcd,_0x3ee63c){return client[_0x0d29('0xa')](_0x151d32,_0x276aeb)[_0x0d29('0xb')](function(_0x4b876e){logger[_0x0d29('0xc')](_0x0d29('0xd'),_0x376d19,'request\x20sent');logger[_0x0d29('0xe')](_0x0d29('0xf'),_0x376d19,'request\x20sent',JSON[_0x0d29('0x10')](_0x4b876e));if(_0x4b876e['error']){if(_0x4b876e[_0x0d29('0x11')][_0x0d29('0x12')]===0x1f4){logger[_0x0d29('0x11')](_0x0d29('0xd'),_0x376d19,_0x4b876e[_0x0d29('0x11')]['message']);return _0x3ee63c(_0x4b876e[_0x0d29('0x11')][_0x0d29('0x13')]);}logger[_0x0d29('0x11')](_0x0d29('0xd'),_0x376d19,_0x4b876e[_0x0d29('0x11')]['message']);return _0x4edfcd(_0x4b876e['error']['message']);}else{logger[_0x0d29('0xc')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x376d19,_0x0d29('0x14'));_0x4edfcd(_0x4b876e['result'][_0x0d29('0x13')]);}})[_0x0d29('0x15')](function(_0x2a04d6){logger[_0x0d29('0x11')](_0x0d29('0xd'),_0x376d19,_0x2a04d6);_0x3ee63c(_0x2a04d6);});});}exports[_0x0d29('0x16')]=function(_0x488fa2){var _0x319a36=this;return new Promise(function(_0x2600b3,_0xca30af){return db[_0x0d29('0x17')][_0x0d29('0x18')](_0x488fa2[_0x0d29('0x19')],{'raw':_0x488fa2[_0x0d29('0x1a')]?_0x488fa2['options'][_0x0d29('0x1b')]===undefined?!![]:![]:!![]})[_0x0d29('0xb')](function(_0x215cd7){logger[_0x0d29('0xc')](_0x0d29('0x16'),_0x488fa2);logger[_0x0d29('0xe')](_0x0d29('0x16'),_0x488fa2,JSON[_0x0d29('0x10')](_0x215cd7));_0x2600b3(_0x215cd7);})[_0x0d29('0x15')](function(_0xed8228){logger[_0x0d29('0x11')](_0x0d29('0x16'),_0xed8228[_0x0d29('0x13')],_0x488fa2);_0xca30af(_0x319a36['error'](0x1f4,_0xed8228[_0x0d29('0x13')]));});});};exports[_0x0d29('0x1c')]=function(_0x2f0fe2){var _0xd3afa0=this;return new Promise(function(_0x4adc85,_0x249205){return db[_0x0d29('0x17')][_0x0d29('0x1d')](_0x2f0fe2[_0x0d29('0x19')],{'raw':_0x2f0fe2[_0x0d29('0x1a')]?_0x2f0fe2[_0x0d29('0x1a')][_0x0d29('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2f0fe2['options']?_0x2f0fe2['options'][_0x0d29('0x1e')]||null:null,'attributes':_0x2f0fe2['options']?_0x2f0fe2[_0x0d29('0x1a')]['attributes']||null:null,'limit':_0x2f0fe2['options']?_0x2f0fe2[_0x0d29('0x1a')]['limit']||null:null})[_0x0d29('0xb')](function(_0x5c197f){logger[_0x0d29('0xc')](_0x0d29('0x1c'),_0x2f0fe2);logger['debug'](_0x0d29('0x1c'),_0x2f0fe2,JSON[_0x0d29('0x10')](_0x5c197f));_0x4adc85(_0x5c197f);})[_0x0d29('0x15')](function(_0x58caa6){logger[_0x0d29('0x11')](_0x0d29('0x1c'),_0x58caa6[_0x0d29('0x13')],_0x2f0fe2);_0x249205(_0xd3afa0[_0x0d29('0x11')](0x1f4,_0x58caa6[_0x0d29('0x13')]));});});}; \ No newline at end of file +var _0xa30a=['body','debug','catch','UpdateOpenchannelQueueReport','OpenchannelQueueReport','update','options','raw','where','attributes','limit','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','CreateOpenchannelQueueReport','create'];(function(_0x5326e0,_0x4d28d9){var _0x474f1e=function(_0x2711c8){while(--_0x2711c8){_0x5326e0['push'](_0x5326e0['shift']());}};_0x474f1e(++_0x4d28d9);}(_0xa30a,0xd7));var _0xaa30=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa30a[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xaa30('0x0'));var util=require(_0xaa30('0x1'));var moment=require(_0xaa30('0x2'));var BPromise=require('bluebird');var rs=require(_0xaa30('0x3'));var fs=require('fs');var Redis=require(_0xaa30('0x4'));var db=require(_0xaa30('0x5'))['db'];var utils=require(_0xaa30('0x6'));var logger=require(_0xaa30('0x7'))(_0xaa30('0x8'));var config=require(_0xaa30('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa30('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8af448,_0x14fe09,_0x42dc22){return new BPromise(function(_0x5d076a,_0xedbc45){return client[_0xaa30('0xb')](_0x8af448,_0x42dc22)[_0xaa30('0xc')](function(_0x59d028){logger[_0xaa30('0xd')](_0xaa30('0xe'),_0x14fe09,'request\x20sent');logger['debug'](_0xaa30('0xf'),_0x14fe09,'request\x20sent',JSON[_0xaa30('0x10')](_0x59d028));if(_0x59d028[_0xaa30('0x11')]){if(_0x59d028[_0xaa30('0x11')][_0xaa30('0x12')]===0x1f4){logger['error'](_0xaa30('0xe'),_0x14fe09,_0x59d028[_0xaa30('0x11')][_0xaa30('0x13')]);return _0xedbc45(_0x59d028['error'][_0xaa30('0x13')]);}logger[_0xaa30('0x11')](_0xaa30('0xe'),_0x14fe09,_0x59d028[_0xaa30('0x11')][_0xaa30('0x13')]);return _0x5d076a(_0x59d028[_0xaa30('0x11')][_0xaa30('0x13')]);}else{logger[_0xaa30('0xd')](_0xaa30('0xe'),_0x14fe09,_0xaa30('0x14'));_0x5d076a(_0x59d028['result'][_0xaa30('0x13')]);}})['catch'](function(_0x5eb356){logger[_0xaa30('0x11')](_0xaa30('0xe'),_0x14fe09,_0x5eb356);_0xedbc45(_0x5eb356);});});}exports[_0xaa30('0x15')]=function(_0x540e36){var _0x54fa49=this;return new Promise(function(_0x53f9fd,_0x23ad3b){return db['OpenchannelQueueReport'][_0xaa30('0x16')](_0x540e36[_0xaa30('0x17')],{'raw':_0x540e36['options']?_0x540e36['options']['raw']===undefined?!![]:![]:!![]})[_0xaa30('0xc')](function(_0x3e4f1d){logger[_0xaa30('0xd')](_0xaa30('0x15'),_0x540e36);logger[_0xaa30('0x18')]('CreateOpenchannelQueueReport',_0x540e36,JSON[_0xaa30('0x10')](_0x3e4f1d));_0x53f9fd(_0x3e4f1d);})[_0xaa30('0x19')](function(_0x2e16e7){logger[_0xaa30('0x11')](_0xaa30('0x15'),_0x2e16e7['message'],_0x540e36);_0x23ad3b(_0x54fa49[_0xaa30('0x11')](0x1f4,_0x2e16e7[_0xaa30('0x13')]));});});};exports[_0xaa30('0x1a')]=function(_0x326f84){var _0x57d1ca=this;return new Promise(function(_0x14d7fa,_0x1be54c){return db[_0xaa30('0x1b')][_0xaa30('0x1c')](_0x326f84[_0xaa30('0x17')],{'raw':_0x326f84[_0xaa30('0x1d')]?_0x326f84['options'][_0xaa30('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x326f84[_0xaa30('0x1d')]?_0x326f84['options'][_0xaa30('0x1f')]||null:null,'attributes':_0x326f84['options']?_0x326f84[_0xaa30('0x1d')][_0xaa30('0x20')]||null:null,'limit':_0x326f84[_0xaa30('0x1d')]?_0x326f84[_0xaa30('0x1d')][_0xaa30('0x21')]||null:null})[_0xaa30('0xc')](function(_0x6ff09a){logger[_0xaa30('0xd')](_0xaa30('0x1a'),_0x326f84);logger[_0xaa30('0x18')](_0xaa30('0x1a'),_0x326f84,JSON[_0xaa30('0x10')](_0x6ff09a));_0x14d7fa(_0x6ff09a);})[_0xaa30('0x19')](function(_0x46abb9){logger[_0xaa30('0x11')](_0xaa30('0x1a'),_0x46abb9[_0xaa30('0x13')],_0x326f84);_0x1be54c(_0x57d1ca[_0xaa30('0x11')](0x1f4,_0x46abb9['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 7d89e1c..2446a35 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 _0xa6de=['delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','index','describe','/:id','show','create','put'];(function(_0x1d50f2,_0x3c3ec6){var _0x3769b8=function(_0x50926a){while(--_0x50926a){_0x1d50f2['push'](_0x1d50f2['shift']());}};_0x3769b8(++_0x3c3ec6);}(_0xa6de,0x129));var _0xea6d=function(_0x517ad3,_0x6181f5){_0x517ad3=_0x517ad3-0x0;var _0x4dbff4=_0xa6de[_0x517ad3];return _0x4dbff4;};'use strict';var multer=require(_0xea6d('0x0'));var util=require('util');var path=require(_0xea6d('0x1'));var timeout=require(_0xea6d('0x2'));var express=require(_0xea6d('0x3'));var router=express[_0xea6d('0x4')]();var fs_extra=require(_0xea6d('0x5'));var auth=require(_0xea6d('0x6'));var interaction=require(_0xea6d('0x7'));var config=require(_0xea6d('0x8'));var controller=require(_0xea6d('0x9'));router[_0xea6d('0xa')]('/',auth[_0xea6d('0xb')](),controller[_0xea6d('0xc')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xea6d('0xd')]);router[_0xea6d('0xa')](_0xea6d('0xe'),auth[_0xea6d('0xb')](),controller[_0xea6d('0xf')]);router['post']('/',auth[_0xea6d('0xb')](),controller[_0xea6d('0x10')]);router[_0xea6d('0x11')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xea6d('0x12')](_0xea6d('0xe'),auth[_0xea6d('0xb')](),controller[_0xea6d('0x13')]);module[_0xea6d('0x14')]=router; \ No newline at end of file +var _0xea90=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','put','update','delete','exports','util','path'];(function(_0xa28352,_0x576035){var _0x5bc21d=function(_0x1e5c0b){while(--_0x1e5c0b){_0xa28352['push'](_0xa28352['shift']());}};_0x5bc21d(++_0x576035);}(_0xea90,0xf5));var _0x0ea9=function(_0x500149,_0x71bbc8){_0x500149=_0x500149-0x0;var _0x3ff783=_0xea90[_0x500149];return _0x3ff783;};'use strict';var multer=require('multer');var util=require(_0x0ea9('0x0'));var path=require(_0x0ea9('0x1'));var timeout=require(_0x0ea9('0x2'));var express=require('express');var router=express[_0x0ea9('0x3')]();var fs_extra=require(_0x0ea9('0x4'));var auth=require(_0x0ea9('0x5'));var interaction=require(_0x0ea9('0x6'));var config=require(_0x0ea9('0x7'));var controller=require('./openchannelTransferReport.controller');router['get']('/',auth[_0x0ea9('0x8')](),controller[_0x0ea9('0x9')]);router[_0x0ea9('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x0ea9('0xb')]);router[_0x0ea9('0xa')](_0x0ea9('0xc'),auth[_0x0ea9('0x8')](),controller[_0x0ea9('0xd')]);router[_0x0ea9('0xe')]('/',auth[_0x0ea9('0x8')](),controller['create']);router[_0x0ea9('0xf')](_0x0ea9('0xc'),auth[_0x0ea9('0x8')](),controller[_0x0ea9('0x10')]);router[_0x0ea9('0x11')](_0x0ea9('0xc'),auth[_0x0ea9('0x8')](),controller['destroy']);module[_0x0ea9('0x12')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 67bde3a..25f7c99 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 _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x4e0b16,_0x48b813){var _0x4d38d5=function(_0x3b585b){while(--_0x3b585b){_0x4e0b16['push'](_0x4e0b16['shift']());}};_0x4d38d5(++_0x48b813);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x15ea09,_0x2f30ab){_0x15ea09=_0x15ea09-0x0;var _0x3e9c78=_0xcb91[_0x15ea09];return _0x3e9c78;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}}; \ No newline at end of file +var _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x2bea35,_0x3f7baf){var _0x8477cb=function(_0x2ff3ee){while(--_0x2ff3ee){_0x2bea35['push'](_0x2bea35['shift']());}};_0x8477cb(++_0x3f7baf);}(_0x34e8,0x12c));var _0x834e=function(_0x2b53ab,_0xaa438f){_0x2b53ab=_0x2b53ab-0x0;var _0xec2cbe=_0x34e8[_0x2b53ab];return _0xec2cbe;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index f708116..ef36d38 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 _0x2be3=['reject','save','update','then','error','stack','send','index','map','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','OpenchannelTransferReport','count','includeAll','include','params','find','catch','create','body','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','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','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply'];(function(_0x525d35,_0xe67489){var _0x4813d2=function(_0x4a6dc8){while(--_0x4a6dc8){_0x525d35['push'](_0x525d35['shift']());}};_0x4813d2(++_0xe67489);}(_0x2be3,0x77));var _0x32be=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x2be3[_0x5c351c];return _0x26f3b3;};'use strict';var emlformat=require(_0x32be('0x0'));var rimraf=require(_0x32be('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x32be('0x2'));var rp=require(_0x32be('0x3'));var moment=require(_0x32be('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x32be('0x5'));var util=require(_0x32be('0x6'));var path=require(_0x32be('0x7'));var sox=require(_0x32be('0x8'));var csv=require(_0x32be('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32be('0xa'));var squel=require('squel');var crypto=require(_0x32be('0xb'));var jsforce=require(_0x32be('0xc'));var deskjs=require(_0x32be('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x32be('0xe'));var Redis=require(_0x32be('0xf'));var authService=require(_0x32be('0x10'));var qs=require(_0x32be('0x11'));var as=require(_0x32be('0x12'));var hardwareService=require(_0x32be('0x13'));var logger=require(_0x32be('0x14'))('api');var utils=require(_0x32be('0x15'));var config=require(_0x32be('0x16'));var licenseUtil=require(_0x32be('0x17'));var db=require(_0x32be('0x18'))['db'];function respondWithStatusCode(_0xf15c1,_0x3b116a){_0x3b116a=_0x3b116a||0xcc;return function(_0x4feffd){if(_0x4feffd){return _0xf15c1[_0x32be('0x19')](_0x3b116a);}return _0xf15c1['status'](_0x3b116a)[_0x32be('0x1a')]();};}function respondWithResult(_0x59eee1,_0x43e5bd){_0x43e5bd=_0x43e5bd||0xc8;return function(_0x1d9b96){if(_0x1d9b96){return _0x59eee1[_0x32be('0x1b')](_0x43e5bd)[_0x32be('0x1c')](_0x1d9b96);}};}function respondWithFilteredResult(_0xb5c38e,_0x2f3ec7){return function(_0x14c47b){if(_0x14c47b){var _0x195d94=typeof _0x2f3ec7[_0x32be('0x1d')]===_0x32be('0x1e')&&typeof _0x2f3ec7['limit']==='undefined';var _0x31bbf6=_0x14c47b['count'];var _0x123646=_0x195d94?0x0:_0x2f3ec7[_0x32be('0x1d')];var _0xdf16db=_0x195d94?_0x14c47b['count']:_0x2f3ec7[_0x32be('0x1d')]+_0x2f3ec7[_0x32be('0x1f')];var _0x51eedf;if(_0xdf16db>=_0x31bbf6){_0xdf16db=_0x31bbf6;_0x51eedf=0xc8;}else{_0x51eedf=0xce;}_0xb5c38e[_0x32be('0x1b')](_0x51eedf);return _0xb5c38e[_0x32be('0x20')](_0x32be('0x21'),_0x123646+'-'+_0xdf16db+'/'+_0x31bbf6)[_0x32be('0x1c')](_0x14c47b);}return null;};}function patchUpdates(_0x444d1d){return function(_0x5a0de4){try{jsonpatch[_0x32be('0x22')](_0x5a0de4,_0x444d1d,!![]);}catch(_0x3881b6){return BPromise[_0x32be('0x23')](_0x3881b6);}return _0x5a0de4[_0x32be('0x24')]();};}function saveUpdates(_0x59bb0c,_0x21742c){return function(_0x3cd1e3){if(_0x3cd1e3){return _0x3cd1e3[_0x32be('0x25')](_0x59bb0c)[_0x32be('0x26')](function(_0x3d9827){return _0x3d9827;});}return null;};}function removeEntity(_0x10c65e,_0x2a0983){return function(_0x3b9383){if(_0x3b9383){return _0x3b9383['destroy']()[_0x32be('0x26')](function(){_0x10c65e[_0x32be('0x1b')](0xcc)[_0x32be('0x1a')]();});}};}function handleEntityNotFound(_0x511993,_0x48fc00){return function(_0x199869){if(!_0x199869){_0x511993['sendStatus'](0x194);}return _0x199869;};}function handleError(_0x33d54e,_0x514392){_0x514392=_0x514392||0x1f4;return function(_0x49fba5){logger[_0x32be('0x27')](_0x49fba5[_0x32be('0x28')]);if(_0x49fba5['name']){delete _0x49fba5['name'];}_0x33d54e[_0x32be('0x1b')](_0x514392)[_0x32be('0x29')](_0x49fba5);};}exports[_0x32be('0x2a')]=function(_0x5cde84,_0x1bdfbd){var _0x420c99={},_0xb56350={},_0x385f8e={'count':0x0,'rows':[]};var _0x148e06=_[_0x32be('0x2b')](db['OpenchannelTransferReport'][_0x32be('0x2c')],function(_0x78a141){return{'name':_0x78a141[_0x32be('0x2d')],'type':_0x78a141[_0x32be('0x2e')][_0x32be('0x2f')]};});_0xb56350[_0x32be('0x30')]=_[_0x32be('0x2b')](_0x148e06,_0x32be('0x31'));_0xb56350[_0x32be('0x32')]=_[_0x32be('0x33')](_0x5cde84[_0x32be('0x32')]);_0xb56350[_0x32be('0x34')]=_[_0x32be('0x35')](_0xb56350[_0x32be('0x30')],_0xb56350[_0x32be('0x32')]);_0x420c99[_0x32be('0x36')]=_[_0x32be('0x35')](_0xb56350[_0x32be('0x30')],qs[_0x32be('0x37')](_0x5cde84[_0x32be('0x32')][_0x32be('0x37')]));_0x420c99[_0x32be('0x36')]=_0x420c99[_0x32be('0x36')][_0x32be('0x38')]?_0x420c99[_0x32be('0x36')]:_0xb56350[_0x32be('0x30')];if(!_0x5cde84[_0x32be('0x32')][_0x32be('0x39')](_0x32be('0x3a'))){_0x420c99[_0x32be('0x1f')]=qs[_0x32be('0x1f')](_0x5cde84[_0x32be('0x32')][_0x32be('0x1f')]);_0x420c99['offset']=qs[_0x32be('0x1d')](_0x5cde84['query'][_0x32be('0x1d')]);}_0x420c99['order']=qs[_0x32be('0x3b')](_0x5cde84[_0x32be('0x32')][_0x32be('0x3b')]);_0x420c99[_0x32be('0x3c')]=qs[_0x32be('0x34')](_[_0x32be('0x3d')](_0x5cde84[_0x32be('0x32')],_0xb56350[_0x32be('0x34')]),_0x148e06);if(_0x5cde84['query'][_0x32be('0x3e')]){_0x420c99[_0x32be('0x3c')]=_[_0x32be('0x3f')](_0x420c99[_0x32be('0x3c')],{'$or':_[_0x32be('0x2b')](_0x148e06,function(_0x448227){if(_0x448227['type']!==_0x32be('0x40')){var _0x10dae9={};_0x10dae9[_0x448227['name']]={'$like':'%'+_0x5cde84[_0x32be('0x32')]['filter']+'%'};return _0x10dae9;}})});}_0x420c99=_[_0x32be('0x3f')]({},_0x420c99,_0x5cde84[_0x32be('0x41')]);var _0x1bc8a9={'where':_0x420c99[_0x32be('0x3c')]};return db[_0x32be('0x42')][_0x32be('0x43')](_0x1bc8a9)['then'](function(_0x4799a0){_0x385f8e[_0x32be('0x43')]=_0x4799a0;if(_0x5cde84[_0x32be('0x32')][_0x32be('0x44')]){_0x420c99[_0x32be('0x45')]=[{'all':!![]}];}return db['OpenchannelTransferReport']['findAll'](_0x420c99);})[_0x32be('0x26')](function(_0x599e6d){_0x385f8e['rows']=_0x599e6d;return _0x385f8e;})[_0x32be('0x26')](respondWithFilteredResult(_0x1bdfbd,_0x420c99))['catch'](handleError(_0x1bdfbd,null));};exports['show']=function(_0x286b5c,_0x1ab6e8){var _0x28c7c7={'raw':!![],'where':{'id':_0x286b5c[_0x32be('0x46')]['id']}},_0x404290={};_0x404290[_0x32be('0x30')]=_[_0x32be('0x33')](db[_0x32be('0x42')][_0x32be('0x2c')]);_0x404290[_0x32be('0x32')]=_['keys'](_0x286b5c[_0x32be('0x32')]);_0x404290[_0x32be('0x34')]=_['intersection'](_0x404290[_0x32be('0x30')],_0x404290[_0x32be('0x32')]);_0x28c7c7[_0x32be('0x36')]=_[_0x32be('0x35')](_0x404290['model'],qs[_0x32be('0x37')](_0x286b5c[_0x32be('0x32')][_0x32be('0x37')]));_0x28c7c7[_0x32be('0x36')]=_0x28c7c7[_0x32be('0x36')][_0x32be('0x38')]?_0x28c7c7[_0x32be('0x36')]:_0x404290[_0x32be('0x30')];if(_0x286b5c[_0x32be('0x32')][_0x32be('0x44')]){_0x28c7c7['include']=[{'all':!![]}];}_0x28c7c7=_['merge']({},_0x28c7c7,_0x286b5c[_0x32be('0x41')]);return db[_0x32be('0x42')][_0x32be('0x47')](_0x28c7c7)['then'](handleEntityNotFound(_0x1ab6e8,null))[_0x32be('0x26')](respondWithResult(_0x1ab6e8,null))[_0x32be('0x48')](handleError(_0x1ab6e8,null));};exports[_0x32be('0x49')]=function(_0x395b1a,_0x4eb490){return db['OpenchannelTransferReport']['create'](_0x395b1a[_0x32be('0x4a')],{})[_0x32be('0x26')](respondWithResult(_0x4eb490,0xc9))[_0x32be('0x48')](handleError(_0x4eb490,null));};exports[_0x32be('0x25')]=function(_0x432c55,_0x3a628d){if(_0x432c55[_0x32be('0x4a')]['id']){delete _0x432c55['body']['id'];}return db[_0x32be('0x42')][_0x32be('0x47')]({'where':{'id':_0x432c55[_0x32be('0x46')]['id']}})[_0x32be('0x26')](handleEntityNotFound(_0x3a628d,null))['then'](saveUpdates(_0x432c55[_0x32be('0x4a')],null))['then'](respondWithResult(_0x3a628d,null))[_0x32be('0x48')](handleError(_0x3a628d,null));};exports[_0x32be('0x4b')]=function(_0x14dc18,_0x40be32){return db[_0x32be('0x42')][_0x32be('0x47')]({'where':{'id':_0x14dc18[_0x32be('0x46')]['id']}})[_0x32be('0x26')](handleEntityNotFound(_0x40be32,null))[_0x32be('0x26')](removeEntity(_0x40be32,null))[_0x32be('0x48')](handleError(_0x40be32,null));};exports[_0x32be('0x4c')]=function(_0x31495c,_0x42772b){return db[_0x32be('0x42')][_0x32be('0x4c')]()['then'](respondWithResult(_0x42772b,null))[_0x32be('0x48')](handleError(_0x42772b,null));}; \ No newline at end of file +var _0x86f7=['squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','reject','save','then','destroy','error','stack','name','send','index','OpenchannelTransferReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','pick','filter','where','type','VIRTUAL','options','include','findAll','catch','show','includeAll','merge','find','update','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','lodash'];(function(_0x8a30cf,_0x40f19b){var _0x20f439=function(_0x157a5d){while(--_0x157a5d){_0x8a30cf['push'](_0x8a30cf['shift']());}};_0x20f439(++_0x40f19b);}(_0x86f7,0x1bc));var _0x786f=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x86f7[_0x2c91e9];return _0x13f0ff;};'use strict';var emlformat=require(_0x786f('0x0'));var rimraf=require(_0x786f('0x1'));var zipdir=require(_0x786f('0x2'));var jsonpatch=require(_0x786f('0x3'));var rp=require(_0x786f('0x4'));var moment=require('moment');var BPromise=require(_0x786f('0x5'));var Mustache=require(_0x786f('0x6'));var util=require('util');var path=require(_0x786f('0x7'));var sox=require(_0x786f('0x8'));var csv=require(_0x786f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x786f('0xa'));var _=require(_0x786f('0xb'));var squel=require(_0x786f('0xc'));var crypto=require(_0x786f('0xd'));var jsforce=require(_0x786f('0xe'));var deskjs=require(_0x786f('0xf'));var toCsv=require(_0x786f('0x9'));var querystring=require('querystring');var Papa=require(_0x786f('0x10'));var Redis=require(_0x786f('0x11'));var authService=require(_0x786f('0x12'));var qs=require(_0x786f('0x13'));var as=require(_0x786f('0x14'));var hardwareService=require(_0x786f('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x786f('0x16'));var config=require(_0x786f('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x786f('0x18'))['db'];function respondWithStatusCode(_0x9e92f6,_0x3f7cf0){_0x3f7cf0=_0x3f7cf0||0xcc;return function(_0x9eb351){if(_0x9eb351){return _0x9e92f6[_0x786f('0x19')](_0x3f7cf0);}return _0x9e92f6[_0x786f('0x1a')](_0x3f7cf0)[_0x786f('0x1b')]();};}function respondWithResult(_0x3c2684,_0x537af9){_0x537af9=_0x537af9||0xc8;return function(_0x26b2f1){if(_0x26b2f1){return _0x3c2684[_0x786f('0x1a')](_0x537af9)['json'](_0x26b2f1);}};}function respondWithFilteredResult(_0x2d9f96,_0x5cc4cc){return function(_0x575fb3){if(_0x575fb3){var _0xe4e18=typeof _0x5cc4cc[_0x786f('0x1c')]===_0x786f('0x1d')&&typeof _0x5cc4cc['limit']===_0x786f('0x1d');var _0x577c53=_0x575fb3[_0x786f('0x1e')];var _0x5e1798=_0xe4e18?0x0:_0x5cc4cc[_0x786f('0x1c')];var _0x571eb3=_0xe4e18?_0x575fb3[_0x786f('0x1e')]:_0x5cc4cc[_0x786f('0x1c')]+_0x5cc4cc[_0x786f('0x1f')];var _0x52b0da;if(_0x571eb3>=_0x577c53){_0x571eb3=_0x577c53;_0x52b0da=0xc8;}else{_0x52b0da=0xce;}_0x2d9f96[_0x786f('0x1a')](_0x52b0da);return _0x2d9f96[_0x786f('0x20')](_0x786f('0x21'),_0x5e1798+'-'+_0x571eb3+'/'+_0x577c53)[_0x786f('0x22')](_0x575fb3);}return null;};}function patchUpdates(_0x442243){return function(_0x65220a){try{jsonpatch['apply'](_0x65220a,_0x442243,!![]);}catch(_0xa84fea){return BPromise[_0x786f('0x23')](_0xa84fea);}return _0x65220a[_0x786f('0x24')]();};}function saveUpdates(_0x94b957,_0x271dd3){return function(_0x1d09d8){if(_0x1d09d8){return _0x1d09d8['update'](_0x94b957)[_0x786f('0x25')](function(_0x531e0c){return _0x531e0c;});}return null;};}function removeEntity(_0x1df491,_0x33bdb3){return function(_0x20e7f5){if(_0x20e7f5){return _0x20e7f5[_0x786f('0x26')]()[_0x786f('0x25')](function(){_0x1df491[_0x786f('0x1a')](0xcc)[_0x786f('0x1b')]();});}};}function handleEntityNotFound(_0x33cbd8,_0x322b11){return function(_0x424ca4){if(!_0x424ca4){_0x33cbd8[_0x786f('0x19')](0x194);}return _0x424ca4;};}function handleError(_0x419cdd,_0x3e1339){_0x3e1339=_0x3e1339||0x1f4;return function(_0x2336c1){logger[_0x786f('0x27')](_0x2336c1[_0x786f('0x28')]);if(_0x2336c1['name']){delete _0x2336c1[_0x786f('0x29')];}_0x419cdd[_0x786f('0x1a')](_0x3e1339)[_0x786f('0x2a')](_0x2336c1);};}exports[_0x786f('0x2b')]=function(_0x592d97,_0x4ee519){var _0x1e08a4={},_0xdc0dbc={},_0x5c868b={'count':0x0,'rows':[]};var _0xe82d5b=_['map'](db[_0x786f('0x2c')][_0x786f('0x2d')],function(_0x35656c){return{'name':_0x35656c[_0x786f('0x2e')],'type':_0x35656c['type'][_0x786f('0x2f')]};});_0xdc0dbc[_0x786f('0x30')]=_[_0x786f('0x31')](_0xe82d5b,_0x786f('0x29'));_0xdc0dbc[_0x786f('0x32')]=_[_0x786f('0x33')](_0x592d97[_0x786f('0x32')]);_0xdc0dbc[_0x786f('0x34')]=_[_0x786f('0x35')](_0xdc0dbc[_0x786f('0x30')],_0xdc0dbc[_0x786f('0x32')]);_0x1e08a4[_0x786f('0x36')]=_['intersection'](_0xdc0dbc['model'],qs[_0x786f('0x37')](_0x592d97[_0x786f('0x32')]['fields']));_0x1e08a4['attributes']=_0x1e08a4['attributes'][_0x786f('0x38')]?_0x1e08a4[_0x786f('0x36')]:_0xdc0dbc[_0x786f('0x30')];if(!_0x592d97['query'][_0x786f('0x39')]('nolimit')){_0x1e08a4['limit']=qs[_0x786f('0x1f')](_0x592d97[_0x786f('0x32')][_0x786f('0x1f')]);_0x1e08a4[_0x786f('0x1c')]=qs[_0x786f('0x1c')](_0x592d97[_0x786f('0x32')][_0x786f('0x1c')]);}_0x1e08a4['order']=qs['sort'](_0x592d97['query'][_0x786f('0x3a')]);_0x1e08a4['where']=qs[_0x786f('0x34')](_[_0x786f('0x3b')](_0x592d97[_0x786f('0x32')],_0xdc0dbc['filters']),_0xe82d5b);if(_0x592d97[_0x786f('0x32')][_0x786f('0x3c')]){_0x1e08a4[_0x786f('0x3d')]=_['merge'](_0x1e08a4[_0x786f('0x3d')],{'$or':_[_0x786f('0x31')](_0xe82d5b,function(_0x4aebdf){if(_0x4aebdf[_0x786f('0x3e')]!==_0x786f('0x3f')){var _0x35c2d2={};_0x35c2d2[_0x4aebdf[_0x786f('0x29')]]={'$like':'%'+_0x592d97[_0x786f('0x32')][_0x786f('0x3c')]+'%'};return _0x35c2d2;}})});}_0x1e08a4=_['merge']({},_0x1e08a4,_0x592d97[_0x786f('0x40')]);var _0x5914bf={'where':_0x1e08a4['where']};return db[_0x786f('0x2c')][_0x786f('0x1e')](_0x5914bf)[_0x786f('0x25')](function(_0x391821){_0x5c868b[_0x786f('0x1e')]=_0x391821;if(_0x592d97['query']['includeAll']){_0x1e08a4[_0x786f('0x41')]=[{'all':!![]}];}return db[_0x786f('0x2c')][_0x786f('0x42')](_0x1e08a4);})['then'](function(_0x413d08){_0x5c868b['rows']=_0x413d08;return _0x5c868b;})[_0x786f('0x25')](respondWithFilteredResult(_0x4ee519,_0x1e08a4))[_0x786f('0x43')](handleError(_0x4ee519,null));};exports[_0x786f('0x44')]=function(_0xbd3ade,_0x16e895){var _0x5ca446={'raw':!![],'where':{'id':_0xbd3ade['params']['id']}},_0x1e2192={};_0x1e2192[_0x786f('0x30')]=_[_0x786f('0x33')](db[_0x786f('0x2c')][_0x786f('0x2d')]);_0x1e2192['query']=_[_0x786f('0x33')](_0xbd3ade[_0x786f('0x32')]);_0x1e2192[_0x786f('0x34')]=_[_0x786f('0x35')](_0x1e2192[_0x786f('0x30')],_0x1e2192['query']);_0x5ca446[_0x786f('0x36')]=_[_0x786f('0x35')](_0x1e2192[_0x786f('0x30')],qs[_0x786f('0x37')](_0xbd3ade[_0x786f('0x32')][_0x786f('0x37')]));_0x5ca446['attributes']=_0x5ca446[_0x786f('0x36')][_0x786f('0x38')]?_0x5ca446[_0x786f('0x36')]:_0x1e2192[_0x786f('0x30')];if(_0xbd3ade[_0x786f('0x32')][_0x786f('0x45')]){_0x5ca446[_0x786f('0x41')]=[{'all':!![]}];}_0x5ca446=_[_0x786f('0x46')]({},_0x5ca446,_0xbd3ade[_0x786f('0x40')]);return db[_0x786f('0x2c')][_0x786f('0x47')](_0x5ca446)['then'](handleEntityNotFound(_0x16e895,null))[_0x786f('0x25')](respondWithResult(_0x16e895,null))[_0x786f('0x43')](handleError(_0x16e895,null));};exports['create']=function(_0x20d917,_0x59d7b9){return db['OpenchannelTransferReport']['create'](_0x20d917['body'],{})[_0x786f('0x25')](respondWithResult(_0x59d7b9,0xc9))['catch'](handleError(_0x59d7b9,null));};exports[_0x786f('0x48')]=function(_0x1cd050,_0xc33ae8){if(_0x1cd050[_0x786f('0x49')]['id']){delete _0x1cd050['body']['id'];}return db[_0x786f('0x2c')][_0x786f('0x47')]({'where':{'id':_0x1cd050[_0x786f('0x4a')]['id']}})[_0x786f('0x25')](handleEntityNotFound(_0xc33ae8,null))[_0x786f('0x25')](saveUpdates(_0x1cd050[_0x786f('0x49')],null))[_0x786f('0x25')](respondWithResult(_0xc33ae8,null))[_0x786f('0x43')](handleError(_0xc33ae8,null));};exports['destroy']=function(_0x16ed93,_0x3faffc){return db[_0x786f('0x2c')][_0x786f('0x47')]({'where':{'id':_0x16ed93['params']['id']}})[_0x786f('0x25')](handleEntityNotFound(_0x3faffc,null))['then'](removeEntity(_0x3faffc,null))[_0x786f('0x43')](handleError(_0x3faffc,null));};exports[_0x786f('0x4b')]=function(_0x3ae874,_0x3d2de2){return db['OpenchannelTransferReport'][_0x786f('0x4b')]()[_0x786f('0x25')](respondWithResult(_0x3d2de2,null))[_0x786f('0x43')](handleError(_0x3d2de2,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 5008608..9f0a4e8 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 _0x54fa=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','OpenchannelTransferReport','uniqueid'];(function(_0x1a812f,_0x2349bb){var _0x47b5be=function(_0xf4e0d9){while(--_0xf4e0d9){_0x1a812f['push'](_0x1a812f['shift']());}};_0x47b5be(++_0x2349bb);}(_0x54fa,0x1ba));var _0xa54f=function(_0x316efa,_0x20a1e1){_0x316efa=_0x316efa-0x0;var _0x4d96cc=_0x54fa[_0x316efa];return _0x4d96cc;};'use strict';var _=require(_0xa54f('0x0'));var util=require(_0xa54f('0x1'));var logger=require(_0xa54f('0x2'))(_0xa54f('0x3'));var moment=require(_0xa54f('0x4'));var BPromise=require(_0xa54f('0x5'));var rp=require(_0xa54f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa54f('0x7'));var config=require(_0xa54f('0x8'));var attributes=require(_0xa54f('0x9'));module[_0xa54f('0xa')]=function(_0x378591,_0x38ba82){return _0x378591['define'](_0xa54f('0xb'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0xa54f('0xc'),'fields':[_0xa54f('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x73f2=['../../config/environment','exports','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','../../config/logger','api','request-promise','path','rimraf'];(function(_0x4b7b4d,_0x592860){var _0x46a6df=function(_0x12e747){while(--_0x12e747){_0x4b7b4d['push'](_0x4b7b4d['shift']());}};_0x46a6df(++_0x592860);}(_0x73f2,0xff));var _0x273f=function(_0x2f751f,_0x26bbc6){_0x2f751f=_0x2f751f-0x0;var _0x4c6dd9=_0x73f2[_0x2f751f];return _0x4c6dd9;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x273f('0x0'))(_0x273f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x273f('0x2'));var fs=require('fs');var path=require(_0x273f('0x3'));var rimraf=require(_0x273f('0x4'));var config=require(_0x273f('0x5'));var attributes=require('./openchannelTransferReport.attributes');module[_0x273f('0x6')]=function(_0x505243,_0x5bea34){return _0x505243['define'](_0x273f('0x7'),attributes,{'tableName':_0x273f('0x8'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x273f('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index fc85e8e..e1c40a2 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 _0x8c32=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelTransferReport,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird'];(function(_0x47fed3,_0x3c2c1f){var _0x2d73dd=function(_0x30cb8b){while(--_0x30cb8b){_0x47fed3['push'](_0x47fed3['shift']());}};_0x2d73dd(++_0x3c2c1f);}(_0x8c32,0x130));var _0x28c3=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x8c32[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x28c3('0x0'));var util=require(_0x28c3('0x1'));var moment=require(_0x28c3('0x2'));var BPromise=require(_0x28c3('0x3'));var rs=require(_0x28c3('0x4'));var fs=require('fs');var Redis=require(_0x28c3('0x5'));var db=require(_0x28c3('0x6'))['db'];var utils=require(_0x28c3('0x7'));var logger=require(_0x28c3('0x8'))(_0x28c3('0x9'));var config=require(_0x28c3('0xa'));var jayson=require(_0x28c3('0xb'));var client=jayson['client'][_0x28c3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4ed515,_0x2ce6c1,_0x482952){return new BPromise(function(_0xbaee6f,_0x2fb4cb){return client['request'](_0x4ed515,_0x482952)[_0x28c3('0xd')](function(_0x37bda3){logger['info']('OpenchannelTransferReport,\x20%s,\x20%s',_0x2ce6c1,'request\x20sent');logger[_0x28c3('0xe')](_0x28c3('0xf'),_0x2ce6c1,'request\x20sent',JSON[_0x28c3('0x10')](_0x37bda3));if(_0x37bda3[_0x28c3('0x11')]){if(_0x37bda3[_0x28c3('0x11')]['code']===0x1f4){logger[_0x28c3('0x11')](_0x28c3('0x12'),_0x2ce6c1,_0x37bda3[_0x28c3('0x11')][_0x28c3('0x13')]);return _0x2fb4cb(_0x37bda3[_0x28c3('0x11')]['message']);}logger[_0x28c3('0x11')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x2ce6c1,_0x37bda3[_0x28c3('0x11')]['message']);return _0xbaee6f(_0x37bda3[_0x28c3('0x11')]['message']);}else{logger[_0x28c3('0x14')](_0x28c3('0x12'),_0x2ce6c1,'request\x20sent');_0xbaee6f(_0x37bda3[_0x28c3('0x15')]['message']);}})['catch'](function(_0x58e2b9){logger[_0x28c3('0x11')](_0x28c3('0x12'),_0x2ce6c1,_0x58e2b9);_0x2fb4cb(_0x58e2b9);});});} \ No newline at end of file +var _0xb66c=['../../config/environment','jayson/promise','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x3f2c33,_0x422ae3){var _0x2ff0fd=function(_0x511aad){while(--_0x511aad){_0x3f2c33['push'](_0x3f2c33['shift']());}};_0x2ff0fd(++_0x422ae3);}(_0xb66c,0x175));var _0xcb66=function(_0x1d3646,_0x36f18e){_0x1d3646=_0x1d3646-0x0;var _0x4a7b9c=_0xb66c[_0x1d3646];return _0x4a7b9c;};'use strict';var _=require(_0xcb66('0x0'));var util=require('util');var moment=require(_0xcb66('0x1'));var BPromise=require('bluebird');var rs=require(_0xcb66('0x2'));var fs=require('fs');var Redis=require(_0xcb66('0x3'));var db=require(_0xcb66('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xcb66('0x5'))(_0xcb66('0x6'));var config=require(_0xcb66('0x7'));var jayson=require(_0xcb66('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19adf5,_0x1b6852,_0xa3993){return new BPromise(function(_0x439f3d,_0xf7bc39){return client['request'](_0x19adf5,_0xa3993)[_0xcb66('0x9')](function(_0x3047f7){logger[_0xcb66('0xa')](_0xcb66('0xb'),_0x1b6852,_0xcb66('0xc'));logger['debug'](_0xcb66('0xd'),_0x1b6852,_0xcb66('0xc'),JSON[_0xcb66('0xe')](_0x3047f7));if(_0x3047f7[_0xcb66('0xf')]){if(_0x3047f7['error'][_0xcb66('0x10')]===0x1f4){logger[_0xcb66('0xf')](_0xcb66('0xb'),_0x1b6852,_0x3047f7[_0xcb66('0xf')]['message']);return _0xf7bc39(_0x3047f7[_0xcb66('0xf')][_0xcb66('0x11')]);}logger[_0xcb66('0xf')](_0xcb66('0xb'),_0x1b6852,_0x3047f7['error'][_0xcb66('0x11')]);return _0x439f3d(_0x3047f7['error'][_0xcb66('0x11')]);}else{logger['info'](_0xcb66('0xb'),_0x1b6852,'request\x20sent');_0x439f3d(_0x3047f7['result'][_0xcb66('0x11')]);}})[_0xcb66('0x12')](function(_0x681ce3){logger[_0xcb66('0xf')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x1b6852,_0x681ce3);_0xf7bc39(_0x681ce3);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 0172df8..4281d12 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 _0xfb00=['isAuthenticated','index','post','put','/:id','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./pause.controller'];(function(_0x2a2b50,_0x39b1ac){var _0x537054=function(_0xe2d5bd){while(--_0xe2d5bd){_0x2a2b50['push'](_0x2a2b50['shift']());}};_0x537054(++_0x39b1ac);}(_0xfb00,0x167));var _0x0fb0=function(_0xb2a4d1,_0x328b4e){_0xb2a4d1=_0xb2a4d1-0x0;var _0x13a6d0=_0xfb00[_0xb2a4d1];return _0x13a6d0;};'use strict';var multer=require(_0x0fb0('0x0'));var util=require('util');var path=require(_0x0fb0('0x1'));var timeout=require(_0x0fb0('0x2'));var express=require(_0x0fb0('0x3'));var router=express[_0x0fb0('0x4')]();var fs_extra=require(_0x0fb0('0x5'));var auth=require(_0x0fb0('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x0fb0('0x7'));var controller=require(_0x0fb0('0x8'));router['get']('/',auth[_0x0fb0('0x9')](),controller[_0x0fb0('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x0fb0('0xb')]('/',auth[_0x0fb0('0x9')](),controller['create']);router[_0x0fb0('0xc')](_0x0fb0('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x0fb0('0xe')](_0x0fb0('0xd'),auth[_0x0fb0('0x9')](),controller[_0x0fb0('0xf')]);module['exports']=router; \ No newline at end of file +var _0x3a46=['./pause.controller','get','index','/:id','isAuthenticated','show','post','create','put','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x3a46,0x137));var _0x63a4=function(_0x50fb58,_0x382ecf){_0x50fb58=_0x50fb58-0x0;var _0x1728d3=_0x3a46[_0x50fb58];return _0x1728d3;};'use strict';var multer=require(_0x63a4('0x0'));var util=require(_0x63a4('0x1'));var path=require(_0x63a4('0x2'));var timeout=require(_0x63a4('0x3'));var express=require(_0x63a4('0x4'));var router=express[_0x63a4('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x63a4('0x6'));var interaction=require(_0x63a4('0x7'));var config=require(_0x63a4('0x8'));var controller=require(_0x63a4('0x9'));router[_0x63a4('0xa')]('/',auth['isAuthenticated'](),controller[_0x63a4('0xb')]);router['get'](_0x63a4('0xc'),auth[_0x63a4('0xd')](),controller[_0x63a4('0xe')]);router[_0x63a4('0xf')]('/',auth['isAuthenticated'](),controller[_0x63a4('0x10')]);router[_0x63a4('0x11')](_0x63a4('0xc'),auth[_0x63a4('0xd')](),controller['update']);router[_0x63a4('0x12')](_0x63a4('0xc'),auth[_0x63a4('0xd')](),controller['destroy']);module[_0x63a4('0x13')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index e145467..15b7dbe 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 _0x01b4=['exports','STRING','name','sequelize'];(function(_0x49af49,_0xe06a4c){var _0x52da19=function(_0x11ebda){while(--_0x11ebda){_0x49af49['push'](_0x49af49['shift']());}};_0x52da19(++_0xe06a4c);}(_0x01b4,0xab));var _0x401b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x01b4[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x401b('0x0'));module[_0x401b('0x1')]={'name':{'type':Sequelize[_0x401b('0x2')],'unique':_0x401b('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xedc4=['name','exports','STRING'];(function(_0x16b992,_0x43d74c){var _0x385c78=function(_0x5c904){while(--_0x5c904){_0x16b992['push'](_0x16b992['shift']());}};_0x385c78(++_0x43d74c);}(_0xedc4,0x1f0));var _0x4edc=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xedc4[_0x432682];return _0x463d05;};'use strict';var Sequelize=require('sequelize');module[_0x4edc('0x0')]={'name':{'type':Sequelize[_0x4edc('0x1')],'unique':_0x4edc('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x4edc('0x1')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 4660df8..f96e78b 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 _0xe2d9=['../../config/environment','../../config/license/util','end','status','offset','undefined','limit','Content-Range','apply','reject','save','update','then','get','UserProfileResource','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','Pause','count','includeAll','include','rows','show','keys','find','catch','create','body','user','Pauses','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api'];(function(_0x5af5ec,_0x425d6c){var _0x3fa966=function(_0x1dba72){while(--_0x1dba72){_0x5af5ec['push'](_0x5af5ec['shift']());}};_0x3fa966(++_0x425d6c);}(_0xe2d9,0x137));var _0x9e2d=function(_0x293ea7,_0xd9b261){_0x293ea7=_0x293ea7-0x0;var _0x4923c1=_0xe2d9[_0x293ea7];return _0x4923c1;};'use strict';var emlformat=require(_0x9e2d('0x0'));var rimraf=require(_0x9e2d('0x1'));var zipdir=require(_0x9e2d('0x2'));var jsonpatch=require(_0x9e2d('0x3'));var rp=require(_0x9e2d('0x4'));var moment=require(_0x9e2d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9e2d('0x6'));var util=require(_0x9e2d('0x7'));var path=require(_0x9e2d('0x8'));var sox=require(_0x9e2d('0x9'));var csv=require(_0x9e2d('0xa'));var ejs=require(_0x9e2d('0xb'));var fs=require('fs');var fs_extra=require(_0x9e2d('0xc'));var _=require(_0x9e2d('0xd'));var squel=require(_0x9e2d('0xe'));var crypto=require(_0x9e2d('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x9e2d('0x10'));var toCsv=require('to-csv');var querystring=require(_0x9e2d('0x11'));var Papa=require(_0x9e2d('0x12'));var Redis=require(_0x9e2d('0x13'));var authService=require(_0x9e2d('0x14'));var qs=require(_0x9e2d('0x15'));var as=require(_0x9e2d('0x16'));var hardwareService=require(_0x9e2d('0x17'));var logger=require('../../config/logger')(_0x9e2d('0x18'));var utils=require('../../config/utils');var config=require(_0x9e2d('0x19'));var licenseUtil=require(_0x9e2d('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1460b9,_0xc2d828){_0xc2d828=_0xc2d828||0xcc;return function(_0x7c3f38){if(_0x7c3f38){return _0x1460b9['sendStatus'](_0xc2d828);}return _0x1460b9['status'](_0xc2d828)[_0x9e2d('0x1b')]();};}function respondWithResult(_0x2c495c,_0x3b4e6c){_0x3b4e6c=_0x3b4e6c||0xc8;return function(_0x5dc2d0){if(_0x5dc2d0){return _0x2c495c[_0x9e2d('0x1c')](_0x3b4e6c)['json'](_0x5dc2d0);}};}function respondWithFilteredResult(_0x395ccb,_0x2e3eb6){return function(_0x335df5){if(_0x335df5){var _0x35ae0d=typeof _0x2e3eb6[_0x9e2d('0x1d')]==='undefined'&&typeof _0x2e3eb6['limit']===_0x9e2d('0x1e');var _0x1fdb36=_0x335df5['count'];var _0x29daaf=_0x35ae0d?0x0:_0x2e3eb6[_0x9e2d('0x1d')];var _0x2451a2=_0x35ae0d?_0x335df5['count']:_0x2e3eb6[_0x9e2d('0x1d')]+_0x2e3eb6[_0x9e2d('0x1f')];var _0x33fbef;if(_0x2451a2>=_0x1fdb36){_0x2451a2=_0x1fdb36;_0x33fbef=0xc8;}else{_0x33fbef=0xce;}_0x395ccb[_0x9e2d('0x1c')](_0x33fbef);return _0x395ccb['set'](_0x9e2d('0x20'),_0x29daaf+'-'+_0x2451a2+'/'+_0x1fdb36)['json'](_0x335df5);}return null;};}function patchUpdates(_0x3addc8){return function(_0x2e2fbb){try{jsonpatch[_0x9e2d('0x21')](_0x2e2fbb,_0x3addc8,!![]);}catch(_0x36c871){return BPromise[_0x9e2d('0x22')](_0x36c871);}return _0x2e2fbb[_0x9e2d('0x23')]();};}function saveUpdates(_0x1e6c1f,_0x5260f2){return function(_0x5c7e7b){if(_0x5c7e7b){return _0x5c7e7b[_0x9e2d('0x24')](_0x1e6c1f)[_0x9e2d('0x25')](function(_0x379129){return _0x379129;});}return null;};}function removeEntity(_0x137990,_0x120dfc){return function(_0x1cee49){if(_0x1cee49){return _0x1cee49['destroy']()[_0x9e2d('0x25')](function(){var _0x5f17aa=_0x1cee49[_0x9e2d('0x26')]({'plain':!![]});var _0x1eb5a0='Pauses';return db[_0x9e2d('0x27')]['destroy']({'where':{'type':_0x1eb5a0,'resourceId':_0x5f17aa['id']}})[_0x9e2d('0x25')](function(){return _0x1cee49;});})['then'](function(){_0x137990[_0x9e2d('0x1c')](0xcc)[_0x9e2d('0x1b')]();});}};}function handleEntityNotFound(_0x3999d3,_0x160648){return function(_0x331e9a){if(!_0x331e9a){_0x3999d3['sendStatus'](0x194);}return _0x331e9a;};}function handleError(_0x1674d3,_0x4f7564){_0x4f7564=_0x4f7564||0x1f4;return function(_0x2ec3db){logger['error'](_0x2ec3db[_0x9e2d('0x28')]);if(_0x2ec3db[_0x9e2d('0x29')]){delete _0x2ec3db[_0x9e2d('0x29')];}_0x1674d3['status'](_0x4f7564)[_0x9e2d('0x2a')](_0x2ec3db);};}exports[_0x9e2d('0x2b')]=function(_0x5285f6,_0x3a5a21){var _0x53e9e3={},_0x2cea94={},_0x5b495b={'count':0x0,'rows':[]};var _0x79d3f1=_[_0x9e2d('0x2c')](db['Pause'][_0x9e2d('0x2d')],function(_0x211bc0){return{'name':_0x211bc0[_0x9e2d('0x2e')],'type':_0x211bc0[_0x9e2d('0x2f')][_0x9e2d('0x30')]};});_0x2cea94[_0x9e2d('0x31')]=_[_0x9e2d('0x2c')](_0x79d3f1,_0x9e2d('0x29'));_0x2cea94[_0x9e2d('0x32')]=_['keys'](_0x5285f6[_0x9e2d('0x32')]);_0x2cea94[_0x9e2d('0x33')]=_[_0x9e2d('0x34')](_0x2cea94['model'],_0x2cea94[_0x9e2d('0x32')]);_0x53e9e3[_0x9e2d('0x35')]=_[_0x9e2d('0x34')](_0x2cea94[_0x9e2d('0x31')],qs[_0x9e2d('0x36')](_0x5285f6[_0x9e2d('0x32')][_0x9e2d('0x36')]));_0x53e9e3[_0x9e2d('0x35')]=_0x53e9e3['attributes'][_0x9e2d('0x37')]?_0x53e9e3[_0x9e2d('0x35')]:_0x2cea94[_0x9e2d('0x31')];if(!_0x5285f6[_0x9e2d('0x32')][_0x9e2d('0x38')](_0x9e2d('0x39'))){_0x53e9e3[_0x9e2d('0x1f')]=qs[_0x9e2d('0x1f')](_0x5285f6[_0x9e2d('0x32')][_0x9e2d('0x1f')]);_0x53e9e3[_0x9e2d('0x1d')]=qs[_0x9e2d('0x1d')](_0x5285f6[_0x9e2d('0x32')][_0x9e2d('0x1d')]);}_0x53e9e3[_0x9e2d('0x3a')]=qs[_0x9e2d('0x3b')](_0x5285f6[_0x9e2d('0x32')][_0x9e2d('0x3b')]);_0x53e9e3['where']=qs[_0x9e2d('0x33')](_[_0x9e2d('0x3c')](_0x5285f6['query'],_0x2cea94[_0x9e2d('0x33')]),_0x79d3f1);if(_0x5285f6[_0x9e2d('0x32')][_0x9e2d('0x3d')]){_0x53e9e3[_0x9e2d('0x3e')]=_['merge'](_0x53e9e3[_0x9e2d('0x3e')],{'$or':_[_0x9e2d('0x2c')](_0x79d3f1,function(_0x4d0730){if(_0x4d0730[_0x9e2d('0x2f')]!==_0x9e2d('0x3f')){var _0x191770={};_0x191770[_0x4d0730[_0x9e2d('0x29')]]={'$like':'%'+_0x5285f6[_0x9e2d('0x32')]['filter']+'%'};return _0x191770;}})});}_0x53e9e3=_[_0x9e2d('0x40')]({},_0x53e9e3,_0x5285f6['options']);var _0x15de0c={'where':_0x53e9e3[_0x9e2d('0x3e')]};return db[_0x9e2d('0x41')][_0x9e2d('0x42')](_0x15de0c)[_0x9e2d('0x25')](function(_0x12235c){_0x5b495b[_0x9e2d('0x42')]=_0x12235c;if(_0x5285f6[_0x9e2d('0x32')][_0x9e2d('0x43')]){_0x53e9e3[_0x9e2d('0x44')]=[{'all':!![]}];}return db[_0x9e2d('0x41')]['findAll'](_0x53e9e3);})[_0x9e2d('0x25')](function(_0x5b1ab9){_0x5b495b[_0x9e2d('0x45')]=_0x5b1ab9;return _0x5b495b;})[_0x9e2d('0x25')](respondWithFilteredResult(_0x3a5a21,_0x53e9e3))['catch'](handleError(_0x3a5a21,null));};exports[_0x9e2d('0x46')]=function(_0x8994f1,_0x43ab37){var _0x5c831b={'raw':!![],'where':{'id':_0x8994f1['params']['id']}},_0x4b1e17={};_0x4b1e17[_0x9e2d('0x31')]=_[_0x9e2d('0x47')](db[_0x9e2d('0x41')]['rawAttributes']);_0x4b1e17[_0x9e2d('0x32')]=_[_0x9e2d('0x47')](_0x8994f1[_0x9e2d('0x32')]);_0x4b1e17['filters']=_[_0x9e2d('0x34')](_0x4b1e17['model'],_0x4b1e17['query']);_0x5c831b[_0x9e2d('0x35')]=_['intersection'](_0x4b1e17[_0x9e2d('0x31')],qs[_0x9e2d('0x36')](_0x8994f1[_0x9e2d('0x32')][_0x9e2d('0x36')]));_0x5c831b[_0x9e2d('0x35')]=_0x5c831b[_0x9e2d('0x35')]['length']?_0x5c831b[_0x9e2d('0x35')]:_0x4b1e17[_0x9e2d('0x31')];if(_0x8994f1[_0x9e2d('0x32')][_0x9e2d('0x43')]){_0x5c831b[_0x9e2d('0x44')]=[{'all':!![]}];}_0x5c831b=_[_0x9e2d('0x40')]({},_0x5c831b,_0x8994f1['options']);return db[_0x9e2d('0x41')][_0x9e2d('0x48')](_0x5c831b)['then'](handleEntityNotFound(_0x43ab37,null))[_0x9e2d('0x25')](respondWithResult(_0x43ab37,null))[_0x9e2d('0x49')](handleError(_0x43ab37,null));};exports[_0x9e2d('0x4a')]=function(_0x147c1b,_0x3f6b02){return db[_0x9e2d('0x41')][_0x9e2d('0x4a')](_0x147c1b[_0x9e2d('0x4b')],{})[_0x9e2d('0x25')](function(_0x435950){var _0x2f73f5=_0x147c1b[_0x9e2d('0x4c')][_0x9e2d('0x26')]({'plain':!![]});if(!_0x2f73f5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2f73f5['role']===_0x9e2d('0x4c')){var _0x272303=_0x435950[_0x9e2d('0x26')]({'plain':!![]});var _0x362f67=_0x9e2d('0x4d');return db[_0x9e2d('0x4e')]['find']({'where':{'name':_0x362f67,'userProfileId':_0x2f73f5[_0x9e2d('0x4f')]},'raw':!![]})[_0x9e2d('0x25')](function(_0x485358){if(_0x485358&&_0x485358[_0x9e2d('0x50')]===0x0){return db['UserProfileResource'][_0x9e2d('0x4a')]({'name':_0x272303[_0x9e2d('0x29')],'resourceId':_0x272303['id'],'type':_0x485358['name'],'sectionId':_0x485358['id']},{})[_0x9e2d('0x25')](function(){return _0x435950;});}else{return _0x435950;}})[_0x9e2d('0x49')](function(_0x1cc200){logger[_0x9e2d('0x51')](_0x9e2d('0x52'),_0x1cc200);throw _0x1cc200;});}return _0x435950;})['then'](respondWithResult(_0x3f6b02,0xc9))['catch'](handleError(_0x3f6b02,null));};exports[_0x9e2d('0x24')]=function(_0x531c8c,_0x2f4c56){if(_0x531c8c['body']['id']){delete _0x531c8c[_0x9e2d('0x4b')]['id'];}return db[_0x9e2d('0x41')][_0x9e2d('0x48')]({'where':{'id':_0x531c8c[_0x9e2d('0x53')]['id']}})[_0x9e2d('0x25')](handleEntityNotFound(_0x2f4c56,null))[_0x9e2d('0x25')](saveUpdates(_0x531c8c[_0x9e2d('0x4b')],null))[_0x9e2d('0x25')](respondWithResult(_0x2f4c56,null))['catch'](handleError(_0x2f4c56,null));};exports['destroy']=function(_0x1f05dc,_0x18617f){return db[_0x9e2d('0x41')][_0x9e2d('0x48')]({'where':{'id':_0x1f05dc[_0x9e2d('0x53')]['id']}})[_0x9e2d('0x25')](handleEntityNotFound(_0x18617f,null))[_0x9e2d('0x25')](removeEntity(_0x18617f,null))[_0x9e2d('0x49')](handleError(_0x18617f,null));}; \ No newline at end of file +var _0x7c64=['count','offset','Content-Range','apply','reject','destroy','get','Pauses','then','end','stack','name','send','index','map','Pause','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','params','options','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','autoAssociation','error','update','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','sendStatus','status','json','undefined','limit'];(function(_0x3eb63b,_0x2824ea){var _0x108d39=function(_0x369ba2){while(--_0x369ba2){_0x3eb63b['push'](_0x3eb63b['shift']());}};_0x108d39(++_0x2824ea);}(_0x7c64,0xd7));var _0x47c6=function(_0x28cc3c,_0xeb8964){_0x28cc3c=_0x28cc3c-0x0;var _0x323cb1=_0x7c64[_0x28cc3c];return _0x323cb1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x47c6('0x0'));var zipdir=require(_0x47c6('0x1'));var jsonpatch=require(_0x47c6('0x2'));var rp=require(_0x47c6('0x3'));var moment=require(_0x47c6('0x4'));var BPromise=require(_0x47c6('0x5'));var Mustache=require(_0x47c6('0x6'));var util=require(_0x47c6('0x7'));var path=require('path');var sox=require(_0x47c6('0x8'));var csv=require(_0x47c6('0x9'));var ejs=require(_0x47c6('0xa'));var fs=require('fs');var fs_extra=require(_0x47c6('0xb'));var _=require('lodash');var squel=require(_0x47c6('0xc'));var crypto=require(_0x47c6('0xd'));var jsforce=require(_0x47c6('0xe'));var deskjs=require(_0x47c6('0xf'));var toCsv=require(_0x47c6('0x9'));var querystring=require(_0x47c6('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x47c6('0x11'));var qs=require(_0x47c6('0x12'));var as=require(_0x47c6('0x13'));var hardwareService=require(_0x47c6('0x14'));var logger=require(_0x47c6('0x15'))(_0x47c6('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x130572,_0x3c5a8e){_0x3c5a8e=_0x3c5a8e||0xcc;return function(_0x15b00f){if(_0x15b00f){return _0x130572[_0x47c6('0x17')](_0x3c5a8e);}return _0x130572['status'](_0x3c5a8e)['end']();};}function respondWithResult(_0x2cc4cc,_0x507621){_0x507621=_0x507621||0xc8;return function(_0x1c905f){if(_0x1c905f){return _0x2cc4cc[_0x47c6('0x18')](_0x507621)[_0x47c6('0x19')](_0x1c905f);}};}function respondWithFilteredResult(_0x12045b,_0x3d54b6){return function(_0x23b73c){if(_0x23b73c){var _0x50d598=typeof _0x3d54b6['offset']===_0x47c6('0x1a')&&typeof _0x3d54b6[_0x47c6('0x1b')]===_0x47c6('0x1a');var _0x1ac971=_0x23b73c[_0x47c6('0x1c')];var _0x307a9a=_0x50d598?0x0:_0x3d54b6[_0x47c6('0x1d')];var _0x3c9039=_0x50d598?_0x23b73c[_0x47c6('0x1c')]:_0x3d54b6[_0x47c6('0x1d')]+_0x3d54b6[_0x47c6('0x1b')];var _0x116bc6;if(_0x3c9039>=_0x1ac971){_0x3c9039=_0x1ac971;_0x116bc6=0xc8;}else{_0x116bc6=0xce;}_0x12045b[_0x47c6('0x18')](_0x116bc6);return _0x12045b['set'](_0x47c6('0x1e'),_0x307a9a+'-'+_0x3c9039+'/'+_0x1ac971)[_0x47c6('0x19')](_0x23b73c);}return null;};}function patchUpdates(_0x378ff5){return function(_0x26ee69){try{jsonpatch[_0x47c6('0x1f')](_0x26ee69,_0x378ff5,!![]);}catch(_0x14d37b){return BPromise[_0x47c6('0x20')](_0x14d37b);}return _0x26ee69['save']();};}function saveUpdates(_0x573834,_0x382e7e){return function(_0x387952){if(_0x387952){return _0x387952['update'](_0x573834)['then'](function(_0x1627d2){return _0x1627d2;});}return null;};}function removeEntity(_0x273a49,_0x88cda6){return function(_0x598ed6){if(_0x598ed6){return _0x598ed6[_0x47c6('0x21')]()['then'](function(){var _0x5ca10a=_0x598ed6[_0x47c6('0x22')]({'plain':!![]});var _0x2198f2=_0x47c6('0x23');return db['UserProfileResource'][_0x47c6('0x21')]({'where':{'type':_0x2198f2,'resourceId':_0x5ca10a['id']}})[_0x47c6('0x24')](function(){return _0x598ed6;});})[_0x47c6('0x24')](function(){_0x273a49['status'](0xcc)[_0x47c6('0x25')]();});}};}function handleEntityNotFound(_0x5eb80b,_0x173887){return function(_0x31a48a){if(!_0x31a48a){_0x5eb80b[_0x47c6('0x17')](0x194);}return _0x31a48a;};}function handleError(_0x1747e7,_0x16ba11){_0x16ba11=_0x16ba11||0x1f4;return function(_0x578fea){logger['error'](_0x578fea[_0x47c6('0x26')]);if(_0x578fea[_0x47c6('0x27')]){delete _0x578fea[_0x47c6('0x27')];}_0x1747e7['status'](_0x16ba11)[_0x47c6('0x28')](_0x578fea);};}exports[_0x47c6('0x29')]=function(_0x32f72d,_0x1aa14b){var _0x2169b9={},_0xb594d2={},_0x368894={'count':0x0,'rows':[]};var _0x54ff12=_[_0x47c6('0x2a')](db[_0x47c6('0x2b')][_0x47c6('0x2c')],function(_0x4853fe){return{'name':_0x4853fe[_0x47c6('0x2d')],'type':_0x4853fe[_0x47c6('0x2e')][_0x47c6('0x2f')]};});_0xb594d2[_0x47c6('0x30')]=_[_0x47c6('0x2a')](_0x54ff12,_0x47c6('0x27'));_0xb594d2[_0x47c6('0x31')]=_[_0x47c6('0x32')](_0x32f72d[_0x47c6('0x31')]);_0xb594d2['filters']=_[_0x47c6('0x33')](_0xb594d2[_0x47c6('0x30')],_0xb594d2[_0x47c6('0x31')]);_0x2169b9[_0x47c6('0x34')]=_[_0x47c6('0x33')](_0xb594d2[_0x47c6('0x30')],qs[_0x47c6('0x35')](_0x32f72d['query']['fields']));_0x2169b9[_0x47c6('0x34')]=_0x2169b9[_0x47c6('0x34')][_0x47c6('0x36')]?_0x2169b9[_0x47c6('0x34')]:_0xb594d2['model'];if(!_0x32f72d[_0x47c6('0x31')][_0x47c6('0x37')](_0x47c6('0x38'))){_0x2169b9['limit']=qs[_0x47c6('0x1b')](_0x32f72d[_0x47c6('0x31')][_0x47c6('0x1b')]);_0x2169b9[_0x47c6('0x1d')]=qs[_0x47c6('0x1d')](_0x32f72d[_0x47c6('0x31')][_0x47c6('0x1d')]);}_0x2169b9[_0x47c6('0x39')]=qs[_0x47c6('0x3a')](_0x32f72d['query'][_0x47c6('0x3a')]);_0x2169b9[_0x47c6('0x3b')]=qs[_0x47c6('0x3c')](_['pick'](_0x32f72d[_0x47c6('0x31')],_0xb594d2[_0x47c6('0x3c')]),_0x54ff12);if(_0x32f72d[_0x47c6('0x31')][_0x47c6('0x3d')]){_0x2169b9[_0x47c6('0x3b')]=_[_0x47c6('0x3e')](_0x2169b9['where'],{'$or':_[_0x47c6('0x2a')](_0x54ff12,function(_0x5c782c){if(_0x5c782c['type']!==_0x47c6('0x3f')){var _0xc6d9f6={};_0xc6d9f6[_0x5c782c[_0x47c6('0x27')]]={'$like':'%'+_0x32f72d[_0x47c6('0x31')][_0x47c6('0x3d')]+'%'};return _0xc6d9f6;}})});}_0x2169b9=_[_0x47c6('0x3e')]({},_0x2169b9,_0x32f72d['options']);var _0x30e1ce={'where':_0x2169b9[_0x47c6('0x3b')]};return db['Pause'][_0x47c6('0x1c')](_0x30e1ce)['then'](function(_0x325790){_0x368894[_0x47c6('0x1c')]=_0x325790;if(_0x32f72d[_0x47c6('0x31')][_0x47c6('0x40')]){_0x2169b9[_0x47c6('0x41')]=[{'all':!![]}];}return db[_0x47c6('0x2b')]['findAll'](_0x2169b9);})['then'](function(_0x7b0822){_0x368894[_0x47c6('0x42')]=_0x7b0822;return _0x368894;})['then'](respondWithFilteredResult(_0x1aa14b,_0x2169b9))[_0x47c6('0x43')](handleError(_0x1aa14b,null));};exports[_0x47c6('0x44')]=function(_0x172ff5,_0x449f2c){var _0x13bb8f={'raw':!![],'where':{'id':_0x172ff5[_0x47c6('0x45')]['id']}},_0xf6ccb3={};_0xf6ccb3[_0x47c6('0x30')]=_[_0x47c6('0x32')](db[_0x47c6('0x2b')][_0x47c6('0x2c')]);_0xf6ccb3[_0x47c6('0x31')]=_['keys'](_0x172ff5['query']);_0xf6ccb3[_0x47c6('0x3c')]=_[_0x47c6('0x33')](_0xf6ccb3[_0x47c6('0x30')],_0xf6ccb3[_0x47c6('0x31')]);_0x13bb8f[_0x47c6('0x34')]=_[_0x47c6('0x33')](_0xf6ccb3[_0x47c6('0x30')],qs[_0x47c6('0x35')](_0x172ff5[_0x47c6('0x31')][_0x47c6('0x35')]));_0x13bb8f[_0x47c6('0x34')]=_0x13bb8f['attributes'][_0x47c6('0x36')]?_0x13bb8f[_0x47c6('0x34')]:_0xf6ccb3[_0x47c6('0x30')];if(_0x172ff5[_0x47c6('0x31')][_0x47c6('0x40')]){_0x13bb8f['include']=[{'all':!![]}];}_0x13bb8f=_[_0x47c6('0x3e')]({},_0x13bb8f,_0x172ff5[_0x47c6('0x46')]);return db[_0x47c6('0x2b')]['find'](_0x13bb8f)[_0x47c6('0x24')](handleEntityNotFound(_0x449f2c,null))[_0x47c6('0x24')](respondWithResult(_0x449f2c,null))['catch'](handleError(_0x449f2c,null));};exports[_0x47c6('0x47')]=function(_0x54816c,_0x4b30ba){return db[_0x47c6('0x2b')][_0x47c6('0x47')](_0x54816c['body'],{})[_0x47c6('0x24')](function(_0x97cc96){var _0x38668c=_0x54816c['user'][_0x47c6('0x22')]({'plain':!![]});if(!_0x38668c)throw new Error(_0x47c6('0x48'));if(_0x38668c[_0x47c6('0x49')]===_0x47c6('0x4a')){var _0x3ec4a9=_0x97cc96[_0x47c6('0x22')]({'plain':!![]});var _0x5557cd=_0x47c6('0x23');return db[_0x47c6('0x4b')][_0x47c6('0x4c')]({'where':{'name':_0x5557cd,'userProfileId':_0x38668c['userProfileId']},'raw':!![]})['then'](function(_0x514a53){if(_0x514a53&&_0x514a53[_0x47c6('0x4d')]===0x0){return db['UserProfileResource'][_0x47c6('0x47')]({'name':_0x3ec4a9[_0x47c6('0x27')],'resourceId':_0x3ec4a9['id'],'type':_0x514a53[_0x47c6('0x27')],'sectionId':_0x514a53['id']},{})[_0x47c6('0x24')](function(){return _0x97cc96;});}else{return _0x97cc96;}})[_0x47c6('0x43')](function(_0xbc767d){logger[_0x47c6('0x4e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xbc767d);throw _0xbc767d;});}return _0x97cc96;})[_0x47c6('0x24')](respondWithResult(_0x4b30ba,0xc9))['catch'](handleError(_0x4b30ba,null));};exports[_0x47c6('0x4f')]=function(_0x2309c0,_0x465f36){if(_0x2309c0[_0x47c6('0x50')]['id']){delete _0x2309c0[_0x47c6('0x50')]['id'];}return db[_0x47c6('0x2b')][_0x47c6('0x4c')]({'where':{'id':_0x2309c0[_0x47c6('0x45')]['id']}})[_0x47c6('0x24')](handleEntityNotFound(_0x465f36,null))['then'](saveUpdates(_0x2309c0[_0x47c6('0x50')],null))[_0x47c6('0x24')](respondWithResult(_0x465f36,null))[_0x47c6('0x43')](handleError(_0x465f36,null));};exports[_0x47c6('0x21')]=function(_0x23e099,_0x4d6338){return db[_0x47c6('0x2b')][_0x47c6('0x4c')]({'where':{'id':_0x23e099['params']['id']}})[_0x47c6('0x24')](handleEntityNotFound(_0x4d6338,null))[_0x47c6('0x24')](removeEntity(_0x4d6338,null))['catch'](handleError(_0x4d6338,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index e58588b..4c51e80 100644 --- a/server/api/pause/pause.model.js +++ b/server/api/pause/pause.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1cb9=['./pause.attributes','exports','define','Pause','lodash','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x1a7072,_0x23c98a){var _0x226ece=function(_0x60a4f8){while(--_0x60a4f8){_0x1a7072['push'](_0x1a7072['shift']());}};_0x226ece(++_0x23c98a);}(_0x1cb9,0x14e));var _0x91cb=function(_0x3a5541,_0x5efcbd){_0x3a5541=_0x3a5541-0x0;var _0xf5a4f2=_0x1cb9[_0x3a5541];return _0xf5a4f2;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var logger=require(_0x91cb('0x1'))(_0x91cb('0x2'));var moment=require(_0x91cb('0x3'));var BPromise=require(_0x91cb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x91cb('0x5'));var rimraf=require(_0x91cb('0x6'));var config=require('../../config/environment');var attributes=require(_0x91cb('0x7'));module[_0x91cb('0x8')]=function(_0x186dc3,_0x28543e){return _0x186dc3[_0x91cb('0x9')](_0x91cb('0xa'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x53ec=['bluebird','path','../../config/environment','./pause.attributes','define','Pause','lodash','util','../../config/logger','api','moment'];(function(_0x577c11,_0x302156){var _0x3ce84b=function(_0x83d1bd){while(--_0x83d1bd){_0x577c11['push'](_0x577c11['shift']());}};_0x3ce84b(++_0x302156);}(_0x53ec,0x192));var _0xc53e=function(_0x25e214,_0x42a13e){_0x25e214=_0x25e214-0x0;var _0x48ca06=_0x53ec[_0x25e214];return _0x48ca06;};'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':'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 20cee77..b67cdaa 100644 --- a/server/api/pause/pause.rpc.js +++ b/server/api/pause/pause.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x1d0f94,_0x35ef7a){var _0x260c3e=function(_0x48969a){while(--_0x48969a){_0x1d0f94['push'](_0x1d0f94['shift']());}};_0x260c3e(++_0x35ef7a);}(_0x7a54,0x106));var _0x47a5=function(_0x4caf38,_0x80280b){_0x4caf38=_0x4caf38-0x0;var _0xc6d7e9=_0x7a54[_0x4caf38];return _0xc6d7e9;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x5f067b,_0x4ccb79){var _0x1c1200=function(_0x2e830f){while(--_0x2e830f){_0x5f067b['push'](_0x5f067b['shift']());}};_0x1c1200(++_0x4ccb79);}(_0xb10b,0x12a));var _0xbb10=function(_0x2d8efc,_0x58e635){_0x2d8efc=_0x2d8efc-0x0;var _0x4a7f2d=_0xb10b[_0x2d8efc];return _0x4a7f2d;};'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 33192ae..7a300b5 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 _0x3667=['download','diskStorage','join','root','server/files/plugins','originalname','replace','format','%s-%s%s','basename','extname','now','post','single','file','upload','webhookPost','put','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./plugin.controller','get','isAuthenticated','index','/webhook','webhookGet','/:id','show','/:id/download'];(function(_0x56bf94,_0x16e5f0){var _0x369780=function(_0xd955f6){while(--_0xd955f6){_0x56bf94['push'](_0x56bf94['shift']());}};_0x369780(++_0x16e5f0);}(_0x3667,0xcd));var _0x7366=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3667[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x7366('0x0'));var util=require(_0x7366('0x1'));var path=require(_0x7366('0x2'));var timeout=require(_0x7366('0x3'));var express=require(_0x7366('0x4'));var router=express['Router']();var fs_extra=require(_0x7366('0x5'));var auth=require(_0x7366('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7366('0x7'));var controller=require(_0x7366('0x8'));router[_0x7366('0x9')]('/',auth[_0x7366('0xa')](),controller[_0x7366('0xb')]);router['get'](_0x7366('0xc'),controller[_0x7366('0xd')]);router[_0x7366('0x9')](_0x7366('0xe'),auth[_0x7366('0xa')](),controller[_0x7366('0xf')]);router[_0x7366('0x9')](_0x7366('0x10'),auth[_0x7366('0xa')](),controller[_0x7366('0x11')]);var upload=multer({'storage':multer[_0x7366('0x12')]({'destination':function(_0x2d7e38,_0x57ea7f,_0x425ee4){_0x425ee4(null,path[_0x7366('0x13')](config[_0x7366('0x14')],_0x7366('0x15')));},'filename':function(_0x25a565,_0xd5bac8,_0x3e3a73){_0xd5bac8[_0x7366('0x16')]=_0xd5bac8[_0x7366('0x16')][_0x7366('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3e3a73(null,util[_0x7366('0x18')](_0x7366('0x19'),path[_0x7366('0x1a')](_0xd5bac8[_0x7366('0x16')],path[_0x7366('0x1b')](_0xd5bac8['originalname'])),Date[_0x7366('0x1c')](),path[_0x7366('0x1b')](_0xd5bac8[_0x7366('0x16')])));}})});router[_0x7366('0x1d')]('/',upload[_0x7366('0x1e')](_0x7366('0x1f')),controller[_0x7366('0x20')]);router[_0x7366('0x1d')](_0x7366('0xc'),controller[_0x7366('0x21')]);router[_0x7366('0x22')]('/:id',auth[_0x7366('0xa')](),controller['update']);router[_0x7366('0x23')](_0x7366('0xe'),auth[_0x7366('0xa')](),controller['delete']);module[_0x7366('0x24')]=router; \ No newline at end of file +var _0xb821=['upload','post','update','delete','exports','util','path','Router','../../components/interaction/service','../../config/environment','./plugin.controller','get','index','/webhook','webhookGet','/:id','isAuthenticated','show','download','diskStorage','join','root','originalname','replace','basename','extname','single'];(function(_0x39d836,_0x53dcb7){var _0x4bc4f4=function(_0x595a4d){while(--_0x595a4d){_0x39d836['push'](_0x39d836['shift']());}};_0x4bc4f4(++_0x53dcb7);}(_0xb821,0xa7));var _0x1b82=function(_0x5746c2,_0x5a6714){_0x5746c2=_0x5746c2-0x0;var _0x30aa1d=_0xb821[_0x5746c2];return _0x30aa1d;};'use strict';var multer=require('multer');var util=require(_0x1b82('0x0'));var path=require(_0x1b82('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1b82('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1b82('0x3'));var config=require(_0x1b82('0x4'));var controller=require(_0x1b82('0x5'));router[_0x1b82('0x6')]('/',auth['isAuthenticated'](),controller[_0x1b82('0x7')]);router[_0x1b82('0x6')](_0x1b82('0x8'),controller[_0x1b82('0x9')]);router[_0x1b82('0x6')](_0x1b82('0xa'),auth[_0x1b82('0xb')](),controller[_0x1b82('0xc')]);router[_0x1b82('0x6')]('/:id/download',auth[_0x1b82('0xb')](),controller[_0x1b82('0xd')]);var upload=multer({'storage':multer[_0x1b82('0xe')]({'destination':function(_0x14c57a,_0xcffb87,_0x17a96b){_0x17a96b(null,path[_0x1b82('0xf')](config[_0x1b82('0x10')],'server/files/plugins'));},'filename':function(_0x46007e,_0x241d11,_0x2391f5){_0x241d11[_0x1b82('0x11')]=_0x241d11['originalname'][_0x1b82('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2391f5(null,util['format']('%s-%s%s',path[_0x1b82('0x13')](_0x241d11['originalname'],path[_0x1b82('0x14')](_0x241d11[_0x1b82('0x11')])),Date['now'](),path[_0x1b82('0x14')](_0x241d11['originalname'])));}})});router['post']('/',upload[_0x1b82('0x15')]('file'),controller[_0x1b82('0x16')]);router[_0x1b82('0x17')](_0x1b82('0x8'),controller['webhookPost']);router['put'](_0x1b82('0xa'),auth['isAuthenticated'](),controller[_0x1b82('0x18')]);router[_0x1b82('0x19')](_0x1b82('0xa'),auth['isAuthenticated'](),controller[_0x1b82('0x19')]);module[_0x1b82('0x1a')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 96a6a22..fda4e56 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 _0x53ec=['TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','agentOnly','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','ENUM','html','script'];(function(_0x130fe6,_0x3450e5){var _0x5c61b9=function(_0x3993aa){while(--_0x3993aa){_0x130fe6['push'](_0x130fe6['shift']());}};_0x5c61b9(++_0x3450e5);}(_0x53ec,0x192));var _0xc53e=function(_0x3e754a,_0x6d4db5){_0x3e754a=_0x3e754a-0x0;var _0x12325b=_0x53ec[_0x3e754a];return _0x12325b;};'use strict';var Sequelize=require(_0xc53e('0x0'));module[_0xc53e('0x1')]={'name':{'type':Sequelize[_0xc53e('0x2')]},'type':{'type':Sequelize[_0xc53e('0x3')](_0xc53e('0x4'),_0xc53e('0x5'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0xc53e('0x6')]},'path':{'type':Sequelize['STRING'],'comment':_0xc53e('0x7')},'active':{'type':Sequelize[_0xc53e('0x8')],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize[_0xc53e('0x3')]('adminOnly',_0xc53e('0x9'),_0xc53e('0xa'),'never'),'defaultValue':_0xc53e('0xa'),'comment':_0xc53e('0xb')},'icon':{'type':Sequelize[_0xc53e('0x2')]},'adminUrl':{'type':Sequelize[_0xc53e('0x2')]},'agentUrl':{'type':Sequelize[_0xc53e('0x2')]},'scriptName':{'type':Sequelize[_0xc53e('0x2')]},'scriptPath':{'type':Sequelize[_0xc53e('0x2')]}}; \ No newline at end of file +var _0x6924=['sequelize','STRING','html','script','TEXT','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','never'];(function(_0x256b67,_0x14e47b){var _0x3e2d99=function(_0x4a4c5f){while(--_0x4a4c5f){_0x256b67['push'](_0x256b67['shift']());}};_0x3e2d99(++_0x14e47b);}(_0x6924,0x1ef));var _0x4692=function(_0x368166,_0x54a51f){_0x368166=_0x368166-0x0;var _0x75091f=_0x6924[_0x368166];return _0x75091f;};'use strict';var Sequelize=require(_0x4692('0x0'));module['exports']={'name':{'type':Sequelize[_0x4692('0x1')]},'type':{'type':Sequelize['ENUM'](_0x4692('0x2'),_0x4692('0x3'))},'description':{'type':Sequelize[_0x4692('0x4')]},'version':{'type':Sequelize[_0x4692('0x4')]},'path':{'type':Sequelize[_0x4692('0x1')],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize[_0x4692('0x5')],'defaultValue':0x0,'comment':_0x4692('0x6')},'sidebar':{'type':Sequelize['ENUM'](_0x4692('0x7'),_0x4692('0x8'),_0x4692('0x9'),_0x4692('0xa')),'defaultValue':_0x4692('0x9'),'comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize[_0x4692('0x1')]},'adminUrl':{'type':Sequelize[_0x4692('0x1')]},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0x4692('0x1')]},'scriptPath':{'type':Sequelize[_0x4692('0x1')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 5d71841..6ecd2c5 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 _0xf6ca=['Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','test','plugins','scriptPath','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','UserProfileSection','Plugins','autoAssociation','create','send','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','update','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','status','offset','limit','undefined','set','json','apply','reject','then','destroy','UserProfileResource','end','error','stack','name','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','Plugin','count','includeAll','include','findAll','rows','catch','show','params','keys','length','find','download','join','server/files/plugins','format','%s.zip','basename','zip','warning','code','ENOENT','Error\x20while\x20generating\x20the\x20zip\x20archive','Sequelize','Error','pipe','glob','**/*','root','dirname','node_modules/**/*','finalize','existsSync','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','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','parameters','admin','agent','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','Invalid\x20manifest:\x20script\x20path\x20missing'];(function(_0x1e393b,_0x355f6b){var _0x3d0bfe=function(_0x320830){while(--_0x320830){_0x1e393b['push'](_0x1e393b['shift']());}};_0x3d0bfe(++_0x355f6b);}(_0xf6ca,0x183));var _0xaf6c=function(_0x24c2eb,_0x361b49){_0x24c2eb=_0x24c2eb-0x0;var _0x582aee=_0xf6ca[_0x24c2eb];return _0x582aee;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xaf6c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaf6c('0x1'));var rp=require(_0xaf6c('0x2'));var moment=require(_0xaf6c('0x3'));var BPromise=require(_0xaf6c('0x4'));var Mustache=require(_0xaf6c('0x5'));var util=require(_0xaf6c('0x6'));var path=require(_0xaf6c('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xaf6c('0x8'));var _=require(_0xaf6c('0x9'));var squel=require(_0xaf6c('0xa'));var crypto=require(_0xaf6c('0xb'));var jsforce=require(_0xaf6c('0xc'));var deskjs=require(_0xaf6c('0xd'));var toCsv=require(_0xaf6c('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var extract=require('extract-zip');var rimraf=require('rimraf');var archiver=require(_0xaf6c('0xf'));var Redis=require(_0xaf6c('0x10'));var authService=require(_0xaf6c('0x11'));var qs=require(_0xaf6c('0x12'));var as=require(_0xaf6c('0x13'));var hardwareService=require(_0xaf6c('0x14'));var logger=require(_0xaf6c('0x15'))(_0xaf6c('0x16'));var utils=require(_0xaf6c('0x17'));var config=require(_0xaf6c('0x18'));var licenseUtil=require(_0xaf6c('0x19'));var db=require(_0xaf6c('0x1a'))['db'];config[_0xaf6c('0x1b')]=_[_0xaf6c('0x1c')](config[_0xaf6c('0x1b')],{'host':_0xaf6c('0x1d'),'port':0x18eb});var socket=require(_0xaf6c('0x1e'))(new Redis(config[_0xaf6c('0x1b')]));require(_0xaf6c('0x1f'))[_0xaf6c('0x20')](socket);function respondWithStatusCode(_0x448fc7,_0x1815d0){_0x1815d0=_0x1815d0||0xcc;return function(_0x3f7173){if(_0x3f7173){return _0x448fc7[_0xaf6c('0x21')](_0x1815d0);}return _0x448fc7[_0xaf6c('0x22')](_0x1815d0)['end']();};}function respondWithResult(_0x35df1b,_0x3a44a4){_0x3a44a4=_0x3a44a4||0xc8;return function(_0x13b5cb){if(_0x13b5cb){return _0x35df1b['status'](_0x3a44a4)['json'](_0x13b5cb);}};}function respondWithFilteredResult(_0x34e248,_0x1cc51a){return function(_0x2ae612){if(_0x2ae612){var _0x2deabb=typeof _0x1cc51a[_0xaf6c('0x23')]==='undefined'&&typeof _0x1cc51a[_0xaf6c('0x24')]===_0xaf6c('0x25');var _0x492c19=_0x2ae612['count'];var _0x47f149=_0x2deabb?0x0:_0x1cc51a[_0xaf6c('0x23')];var _0x3dcd38=_0x2deabb?_0x2ae612['count']:_0x1cc51a['offset']+_0x1cc51a[_0xaf6c('0x24')];var _0x55fc68;if(_0x3dcd38>=_0x492c19){_0x3dcd38=_0x492c19;_0x55fc68=0xc8;}else{_0x55fc68=0xce;}_0x34e248[_0xaf6c('0x22')](_0x55fc68);return _0x34e248[_0xaf6c('0x26')]('Content-Range',_0x47f149+'-'+_0x3dcd38+'/'+_0x492c19)[_0xaf6c('0x27')](_0x2ae612);}return null;};}function patchUpdates(_0x5a940e){return function(_0x59ecdc){try{jsonpatch[_0xaf6c('0x28')](_0x59ecdc,_0x5a940e,!![]);}catch(_0x42a5a0){return BPromise[_0xaf6c('0x29')](_0x42a5a0);}return _0x59ecdc['save']();};}function saveUpdates(_0x47157a,_0x5b3670){return function(_0x3367a6){if(_0x3367a6){return _0x3367a6['update'](_0x47157a)[_0xaf6c('0x2a')](function(_0x1fdafb){return _0x1fdafb;});}return null;};}function removeEntity(_0x574270,_0x423841){return function(_0x149f4c){if(_0x149f4c){return _0x149f4c[_0xaf6c('0x2b')]()[_0xaf6c('0x2a')](function(){var _0x18cb7c=_0x149f4c['get']({'plain':!![]});var _0x1d8ef8='Plugins';return db[_0xaf6c('0x2c')][_0xaf6c('0x2b')]({'where':{'type':_0x1d8ef8,'resourceId':_0x18cb7c['id']}})[_0xaf6c('0x2a')](function(){return _0x149f4c;});})[_0xaf6c('0x2a')](function(){_0x574270[_0xaf6c('0x22')](0xcc)[_0xaf6c('0x2d')]();});}};}function handleEntityNotFound(_0x1d0d6d,_0x562c41){return function(_0x4ac793){if(!_0x4ac793){_0x1d0d6d[_0xaf6c('0x21')](0x194);}return _0x4ac793;};}function handleError(_0x5979d1,_0x196fdb){_0x196fdb=_0x196fdb||0x1f4;return function(_0x38d5be){logger[_0xaf6c('0x2e')](_0x38d5be[_0xaf6c('0x2f')]);if(_0x38d5be[_0xaf6c('0x30')]){delete _0x38d5be['name'];}_0x5979d1[_0xaf6c('0x22')](_0x196fdb)['send'](_0x38d5be);};}exports['index']=function(_0x5f5a05,_0x4244ff){var _0x94c30e={},_0x3f11ec={},_0x11358b={'count':0x0,'rows':[]};var _0x2c3351=_[_0xaf6c('0x31')](db['Plugin'][_0xaf6c('0x32')],function(_0x26e65a){return{'name':_0x26e65a[_0xaf6c('0x33')],'type':_0x26e65a[_0xaf6c('0x34')][_0xaf6c('0x35')]};});_0x3f11ec[_0xaf6c('0x36')]=_[_0xaf6c('0x31')](_0x2c3351,_0xaf6c('0x30'));_0x3f11ec[_0xaf6c('0x37')]=_['keys'](_0x5f5a05[_0xaf6c('0x37')]);_0x3f11ec[_0xaf6c('0x38')]=_[_0xaf6c('0x39')](_0x3f11ec[_0xaf6c('0x36')],_0x3f11ec[_0xaf6c('0x37')]);_0x94c30e[_0xaf6c('0x3a')]=_[_0xaf6c('0x39')](_0x3f11ec[_0xaf6c('0x36')],qs[_0xaf6c('0x3b')](_0x5f5a05[_0xaf6c('0x37')][_0xaf6c('0x3b')]));_0x94c30e['attributes']=_0x94c30e[_0xaf6c('0x3a')]['length']?_0x94c30e[_0xaf6c('0x3a')]:_0x3f11ec[_0xaf6c('0x36')];if(!_0x5f5a05[_0xaf6c('0x37')][_0xaf6c('0x3c')]('nolimit')){_0x94c30e[_0xaf6c('0x24')]=qs[_0xaf6c('0x24')](_0x5f5a05[_0xaf6c('0x37')][_0xaf6c('0x24')]);_0x94c30e[_0xaf6c('0x23')]=qs['offset'](_0x5f5a05[_0xaf6c('0x37')]['offset']);}_0x94c30e[_0xaf6c('0x3d')]=qs[_0xaf6c('0x3e')](_0x5f5a05[_0xaf6c('0x37')][_0xaf6c('0x3e')]);_0x94c30e[_0xaf6c('0x3f')]=qs[_0xaf6c('0x38')](_['pick'](_0x5f5a05[_0xaf6c('0x37')],_0x3f11ec['filters']),_0x2c3351);if(_0x5f5a05[_0xaf6c('0x37')][_0xaf6c('0x40')]){_0x94c30e[_0xaf6c('0x3f')]=_[_0xaf6c('0x41')](_0x94c30e[_0xaf6c('0x3f')],{'$or':_[_0xaf6c('0x31')](_0x2c3351,function(_0x12dcf0){if(_0x12dcf0[_0xaf6c('0x34')]!==_0xaf6c('0x42')){var _0xa4f5e6={};_0xa4f5e6[_0x12dcf0[_0xaf6c('0x30')]]={'$like':'%'+_0x5f5a05[_0xaf6c('0x37')][_0xaf6c('0x40')]+'%'};return _0xa4f5e6;}})});}_0x94c30e=_[_0xaf6c('0x41')]({},_0x94c30e,_0x5f5a05[_0xaf6c('0x43')]);var _0x927788={'where':_0x94c30e['where']};return db[_0xaf6c('0x44')][_0xaf6c('0x45')](_0x927788)['then'](function(_0x327d14){_0x11358b[_0xaf6c('0x45')]=_0x327d14;if(_0x5f5a05[_0xaf6c('0x37')][_0xaf6c('0x46')]){_0x94c30e[_0xaf6c('0x47')]=[{'all':!![]}];}return db[_0xaf6c('0x44')][_0xaf6c('0x48')](_0x94c30e);})[_0xaf6c('0x2a')](function(_0x4cc5d3){_0x11358b[_0xaf6c('0x49')]=_0x4cc5d3;return _0x11358b;})[_0xaf6c('0x2a')](respondWithFilteredResult(_0x4244ff,_0x94c30e))[_0xaf6c('0x4a')](handleError(_0x4244ff,null));};exports[_0xaf6c('0x4b')]=function(_0x42aa5f,_0x4e23ca){var _0x422536={'raw':!![],'where':{'id':_0x42aa5f[_0xaf6c('0x4c')]['id']}},_0x583d13={};_0x583d13['model']=_[_0xaf6c('0x4d')](db[_0xaf6c('0x44')]['rawAttributes']);_0x583d13[_0xaf6c('0x37')]=_[_0xaf6c('0x4d')](_0x42aa5f[_0xaf6c('0x37')]);_0x583d13[_0xaf6c('0x38')]=_[_0xaf6c('0x39')](_0x583d13['model'],_0x583d13['query']);_0x422536[_0xaf6c('0x3a')]=_[_0xaf6c('0x39')](_0x583d13['model'],qs[_0xaf6c('0x3b')](_0x42aa5f[_0xaf6c('0x37')]['fields']));_0x422536[_0xaf6c('0x3a')]=_0x422536[_0xaf6c('0x3a')][_0xaf6c('0x4e')]?_0x422536[_0xaf6c('0x3a')]:_0x583d13[_0xaf6c('0x36')];if(_0x42aa5f['query'][_0xaf6c('0x46')]){_0x422536['include']=[{'all':!![]}];}_0x422536=_[_0xaf6c('0x41')]({},_0x422536,_0x42aa5f[_0xaf6c('0x43')]);return db['Plugin'][_0xaf6c('0x4f')](_0x422536)['then'](handleEntityNotFound(_0x4e23ca,null))[_0xaf6c('0x2a')](respondWithResult(_0x4e23ca,null))[_0xaf6c('0x4a')](handleError(_0x4e23ca,null));};exports[_0xaf6c('0x50')]=function(_0x555074,_0x242f10,_0x5ef074){return db['Plugin'][_0xaf6c('0x4f')]({'where':{'id':_0x555074[_0xaf6c('0x4c')]['id']},'attributes':[_0xaf6c('0x30'),_0xaf6c('0x7')],'raw':!![]})['then'](handleEntityNotFound(_0x242f10,null))['then'](function(_0x205c7c){if(_0x205c7c){var _0x551d1d=path[_0xaf6c('0x51')](config['root'],_0xaf6c('0x52'),util[_0xaf6c('0x53')](_0xaf6c('0x54'),path[_0xaf6c('0x55')](_0x205c7c[_0xaf6c('0x7')])));var _0x5cb173=fs['createWriteStream'](_0x551d1d);var _0xee9d81=archiver(_0xaf6c('0x56'),{'zlib':{'level':0x9}});_0xee9d81['on'](_0xaf6c('0x57'),function(_0x28e575){if(_0x28e575[_0xaf6c('0x58')]===_0xaf6c('0x59')){logger['error'](_0x28e575);}else{throw new db['Sequelize']['Error'](_0xaf6c('0x5a'));}});_0xee9d81['on'](_0xaf6c('0x2e'),function(_0xc411b9){throw new db[(_0xaf6c('0x5b'))][(_0xaf6c('0x5c'))](_0xaf6c('0x5a'));});_0xee9d81[_0xaf6c('0x5d')](_0x5cb173);_0xee9d81[_0xaf6c('0x5e')](_0xaf6c('0x5f'),{'cwd':path[_0xaf6c('0x51')](config[_0xaf6c('0x60')],_0xaf6c('0x52'),path[_0xaf6c('0x61')](_0x205c7c['path'])),'ignore':[path[_0xaf6c('0x51')](path[_0xaf6c('0x55')](_0x205c7c[_0xaf6c('0x7')]),_0xaf6c('0x62')),path['join'](path[_0xaf6c('0x55')](_0x205c7c[_0xaf6c('0x7')]),'attachments/**/*')],'nodir':!![]})[_0xaf6c('0x63')]();_0x5cb173['on']('close',function(){if(!fs[_0xaf6c('0x64')](_0x551d1d)){throw new db['Sequelize'][(_0xaf6c('0x5c'))]('Plugin\x20not\x20found');}return _0x242f10[_0xaf6c('0x50')](_0x551d1d,util[_0xaf6c('0x53')]('%s.zip',path[_0xaf6c('0x55')](_0x205c7c[_0xaf6c('0x7')])),function(_0x71052c){if(_0x71052c){throw new db['Sequelize'][(_0xaf6c('0x5c'))](_0xaf6c('0x65'));}fs[_0xaf6c('0x66')](_0x551d1d);logger[_0xaf6c('0x67')](_0xaf6c('0x68'));logger[_0xaf6c('0x67')](_0xaf6c('0x69'));});});}return null;})[_0xaf6c('0x4a')](handleError(_0x242f10,null));};exports[_0xaf6c('0x6a')]=function(_0x2b8cc7,_0x59e171,_0x3ff6e9){var _0x5a995b=path[_0xaf6c('0x55')](_0x2b8cc7[_0xaf6c('0x6b')][_0xaf6c('0x6c')],path['extname'](_0x2b8cc7['file']['filename']));var _0x57beb0=path['join'](config[_0xaf6c('0x60')],'server/files/plugins',_0x2b8cc7[_0xaf6c('0x6b')][_0xaf6c('0x6c')]);var _0x113f15=path[_0xaf6c('0x51')](config['root'],_0xaf6c('0x52'),_0x5a995b);logger['info'](_0xaf6c('0x6d'),_0x57beb0);logger[_0xaf6c('0x67')](_0xaf6c('0x6e'),_0x113f15);try{fs[_0xaf6c('0x6f')](_0x57beb0,parseInt('0777',0x8));extract(_0x57beb0,{'dir':_0x113f15},function(_0xcb81bb){if(_0xcb81bb){logger[_0xaf6c('0x2e')](_0xcb81bb);handleError(_0xcb81bb,!![]);};var _0x2a05c9=fs[_0xaf6c('0x70')](_0x113f15);if(_0x2a05c9[_0xaf6c('0x4e')]>0x1){removeReferences(_0x57beb0,_0x113f15);logger[_0xaf6c('0x2e')](_0xaf6c('0x71'));return _0x3ff6e9(new Error(_0xaf6c('0x71')));}var _0x335da0=fs[_0xaf6c('0x72')](path[_0xaf6c('0x51')](_0x113f15,_0x2a05c9[0x0]));if(_0x335da0[_0xaf6c('0x73')]()){removeReferences(_0x57beb0,_0x113f15);logger['error'](_0xaf6c('0x71'));return _0x3ff6e9(new Error('Invalid\x20plugin\x20structure'));}if(_0x335da0['isDirectory']()){var _0x426da9=fs[_0xaf6c('0x70')](path[_0xaf6c('0x51')](_0x113f15,_0x2a05c9[0x0]));if(_0x426da9[_0xaf6c('0x4e')]===0x0){removeReferences(_0x57beb0,_0x113f15);logger[_0xaf6c('0x2e')](_0xaf6c('0x71'));return _0x3ff6e9(new Error(_0xaf6c('0x71')));}var _0x174edf=_0x426da9[_0xaf6c('0x74')](function(_0x2991d5){return _0x2991d5===_0xaf6c('0x75');});if(!_0x174edf){return _0x3ff6e9(new Error(_0xaf6c('0x76')));}var _0x12c56b=fs[_0xaf6c('0x77')](path['join'](_0x113f15,_0x2a05c9[0x0],'manifest.json'));var _0x253a31=JSON[_0xaf6c('0x78')](_0x12c56b);if('undefined'==typeof _0x253a31[_0xaf6c('0x30')]){return _0x3ff6e9(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0xaf6c('0x25')==typeof _0x253a31[_0xaf6c('0x34')]){return _0x3ff6e9(new Error(_0xaf6c('0x79')));}if('undefined'==typeof _0x253a31[_0xaf6c('0x7a')]){return _0x3ff6e9(new Error(_0xaf6c('0x7b')));}if(_0xaf6c('0x25')==typeof _0x253a31['parameters']){return _0x3ff6e9(new Error(_0xaf6c('0x7c')));}if(_0x253a31[_0xaf6c('0x34')]===_0xaf6c('0x7d')){if('undefined'==typeof _0x253a31['parameters'][_0xaf6c('0x7e')]){return _0x3ff6e9(new Error(_0xaf6c('0x7f')));}if(_0xaf6c('0x25')==typeof _0x253a31[_0xaf6c('0x80')][_0xaf6c('0x7e')][_0xaf6c('0x81')]&&_0xaf6c('0x25')==typeof _0x253a31['parameters'][_0xaf6c('0x7e')][_0xaf6c('0x82')]){return _0x3ff6e9(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x253a31['type']===_0xaf6c('0x83')){if(_0xaf6c('0x25')==typeof _0x253a31[_0xaf6c('0x80')][_0xaf6c('0x84')]){return _0x3ff6e9(new Error(_0xaf6c('0x85')));}if(_0xaf6c('0x25')==typeof _0x253a31[_0xaf6c('0x80')]['scriptPath']){return _0x3ff6e9(new Error(_0xaf6c('0x86')));}}else{return _0x3ff6e9(new Error(_0xaf6c('0x87')));}var _0x2ae023=_0x253a31['name'];var _0x265ba1=_0x253a31[_0xaf6c('0x88')];var _0x4f31c5=_0x253a31[_0xaf6c('0x34')];var _0x1415ea=_0x253a31[_0xaf6c('0x89')]?_0x253a31[_0xaf6c('0x89')]:_0xaf6c('0x8a');var _0xcf37c5=_0x253a31['icon']?_0x253a31[_0xaf6c('0x8b')]:_0xaf6c('0x8c');var _0x4e1a11='';var _0x2b9a7e='';var _0x4ea683='';var _0x4ba05b='';var _0x2371d7=_0x253a31['version'];if(_0x4f31c5==='html'){if(_0xaf6c('0x25')!=typeof _0x253a31['parameters'][_0xaf6c('0x7e')][_0xaf6c('0x81')]){var _0x40f306=_0x253a31['parameters'][_0xaf6c('0x7e')][_0xaf6c('0x81')];if(!/^(f|ht)tps?:\/\//i[_0xaf6c('0x8d')](_0x40f306)){_0x4e1a11=path[_0xaf6c('0x51')](_0xaf6c('0x8e'),_0x5a995b,_0x2a05c9[0x0],_0x40f306);}else{_0x4e1a11=_0x40f306;}}else{logger[_0xaf6c('0x67')]('Warning:\x20admin\x20view\x20not\x20specified');}if(_0xaf6c('0x25')!=typeof _0x253a31[_0xaf6c('0x80')][_0xaf6c('0x7e')][_0xaf6c('0x82')]){var _0x28579c=_0x253a31[_0xaf6c('0x80')][_0xaf6c('0x7e')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0xaf6c('0x8d')](_0x28579c)){_0x2b9a7e=path[_0xaf6c('0x51')](_0xaf6c('0x8e'),_0x5a995b,_0x2a05c9[0x0],_0x28579c);}else{_0x2b9a7e=_0x28579c;}}else{logger[_0xaf6c('0x67')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x4f31c5===_0xaf6c('0x83')){_0x4ea683=_0x253a31[_0xaf6c('0x80')]['scriptName'];_0x4ba05b=_0x253a31[_0xaf6c('0x80')][_0xaf6c('0x8f')];if(_0xaf6c('0x25')!=typeof _0x253a31[_0xaf6c('0x80')][_0xaf6c('0x7e')]){if(_0xaf6c('0x25')!=typeof _0x253a31[_0xaf6c('0x80')][_0xaf6c('0x7e')][_0xaf6c('0x81')]){var _0x40f306=_0x253a31[_0xaf6c('0x80')][_0xaf6c('0x7e')][_0xaf6c('0x81')];if(!/^(f|ht)tps?:\/\//i[_0xaf6c('0x8d')](_0x40f306)){_0x4e1a11=path[_0xaf6c('0x51')](_0xaf6c('0x8e'),_0x5a995b,_0x2a05c9[0x0],_0x40f306);}else{_0x4e1a11=_0x40f306;}}if(_0xaf6c('0x25')!=typeof _0x253a31['parameters'][_0xaf6c('0x7e')][_0xaf6c('0x82')]){var _0x28579c=_0x253a31[_0xaf6c('0x80')]['views'][_0xaf6c('0x82')];if(!/^(f|ht)tps?:\/\//i[_0xaf6c('0x8d')](_0x28579c)){_0x2b9a7e=path[_0xaf6c('0x51')](_0xaf6c('0x8e'),_0x5a995b,_0x2a05c9[0x0],_0x28579c);}else{_0x2b9a7e=_0x28579c;}}}}var _0x49a1f8={'name':_0x2ae023,'description':_0x265ba1,'path':path[_0xaf6c('0x51')](_0x5a995b,_0x2a05c9[0x0]),'type':_0x4f31c5,'sidebar':_0x1415ea,'icon':_0xcf37c5,'adminUrl':_0x4e1a11,'agentUrl':_0x2b9a7e,'scriptName':_0x4ea683,'scriptPath':_0x4ba05b,'version':_0x2371d7};removeReferences(_0x57beb0,null);return db[_0xaf6c('0x44')]['create'](_0x49a1f8)[_0xaf6c('0x2a')](function(_0x202e70){var _0x53c9b7={'role':_0x2b8cc7[_0xaf6c('0x90')][_0xaf6c('0x91')],'userProfileId':_0x2b8cc7['body'][_0xaf6c('0x92')]};if(!_0x53c9b7)throw new Error(_0xaf6c('0x93'));if(_0x53c9b7['role']===_0xaf6c('0x94')){var _0x2f4347=_0x202e70[_0xaf6c('0x95')]({'plain':!![]});return db[_0xaf6c('0x96')][_0xaf6c('0x4f')]({'where':{'name':_0xaf6c('0x97'),'userProfileId':_0x53c9b7[_0xaf6c('0x92')]},'raw':!![]})[_0xaf6c('0x2a')](function(_0x694a5a){if(_0x694a5a&&_0x694a5a[_0xaf6c('0x98')]===0x0){return db['UserProfileResource'][_0xaf6c('0x99')]({'name':_0x2f4347[_0xaf6c('0x30')],'resourceId':_0x2f4347['id'],'type':_0x694a5a[_0xaf6c('0x30')],'sectionId':_0x694a5a['id']},{})[_0xaf6c('0x2a')](function(){return _0x202e70;});}else{return _0x202e70;}})['catch'](function(_0x32868b){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x32868b);throw _0x32868b;});}return _0x202e70;})[_0xaf6c('0x2a')](respondWithResult(_0x59e171,null))[_0xaf6c('0x4a')](handleError(_0x59e171,null));}});}catch(_0x4fb93d){_0x59e171[_0xaf6c('0x22')](0x1f4)[_0xaf6c('0x9a')](_0x4fb93d);}};function removeReferences(_0x33bd97,_0x1e06e1){try{if(_0x33bd97){fs[_0xaf6c('0x66')](_0x33bd97);logger[_0xaf6c('0x67')](_0xaf6c('0x9b'));}if(_0x1e06e1){rimraf(_0x1e06e1,function(){});logger[_0xaf6c('0x67')](_0xaf6c('0x9c'));}}catch(_0x54492d){logger['error'](_0x54492d);}}exports[_0xaf6c('0x9d')]=function(_0x438d04,_0x1ea982,_0x516f60){return db['Plugin'][_0xaf6c('0x4f')]({'where':{'id':_0x438d04[_0xaf6c('0x4c')]['id']}})[_0xaf6c('0x2a')](handleEntityNotFound(_0x1ea982,null))[_0xaf6c('0x2a')](saveUpdates(_0x438d04[_0xaf6c('0x90')],null))[_0xaf6c('0x2a')](respondWithResult(_0x1ea982,null))[_0xaf6c('0x4a')](handleError(_0x1ea982,null));};exports[_0xaf6c('0x9e')]=function(_0x4e51cb,_0x1193ea,_0x28952e){return db[_0xaf6c('0x44')][_0xaf6c('0x4f')]({'where':{'id':_0x4e51cb['params']['id']}})[_0xaf6c('0x2a')](function(_0x1819ff){if(_0x1819ff){return _0x1819ff['destroy']();}})[_0xaf6c('0x2a')](function(_0x10d56e){rimraf(path[_0xaf6c('0x51')](config[_0xaf6c('0x60')],'server/files/plugins',path[_0xaf6c('0x61')](_0x10d56e['path'])),function(){});return _0x10d56e;})[_0xaf6c('0x2a')](handleEntityNotFound(_0x1193ea,null))['then'](respondWithStatusCode(_0x1193ea,null))[_0xaf6c('0x4a')](handleError(_0x1193ea,null));};exports[_0xaf6c('0x9f')]=function(_0x5cfd90,_0x3b1200,_0x5cd51c){return BPromise[_0xaf6c('0xa0')]()[_0xaf6c('0x2a')](function(){if(!_0x5cfd90[_0xaf6c('0x37')][_0xaf6c('0x7')]){throw new Error(_0xaf6c('0xa1'));}if(!_0x5cfd90[_0xaf6c('0x37')][_0xaf6c('0xa2')]){throw new Error(_0xaf6c('0xa3'));}var _0x5b5c8=_0x5cfd90[_0xaf6c('0x37')][_0xaf6c('0xa4')]?_0x5cfd90[_0xaf6c('0x37')][_0xaf6c('0xa4')]+':'+_0x5cfd90[_0xaf6c('0x37')][_0xaf6c('0xa2')]:_0xaf6c('0xa5')+_0x5cfd90[_0xaf6c('0x37')][_0xaf6c('0xa2')];var _0x1d2cd4=_0x5cfd90[_0xaf6c('0x37')][_0xaf6c('0x27')]?_0x5cfd90[_0xaf6c('0x37')][_0xaf6c('0x27')]:!![];var _0x39548b=_0x5cfd90[_0xaf6c('0x37')][_0xaf6c('0xa6')]?_0x5cfd90[_0xaf6c('0x37')][_0xaf6c('0xa6')]:null;var _0x71440a={'method':_0x5cfd90[_0xaf6c('0xa7')],'uri':util[_0xaf6c('0x53')](_0xaf6c('0xa8'),_0x5b5c8,_0x5cfd90['query']['path']),'json':_0x1d2cd4,'resolveWithFullResponse':!![],'encoding':_0x39548b,'qs':_0x5cfd90[_0xaf6c('0x37')]};if(_0x5cfd90[_0xaf6c('0xa9')]){_0x71440a['headers']=_0x5cfd90[_0xaf6c('0xa9')];if(_0x71440a[_0xaf6c('0xa9')]['content-length']){delete _0x71440a[_0xaf6c('0xa9')][_0xaf6c('0xaa')];}}if(_0x71440a['headers'][_0xaf6c('0xab')]){delete _0x71440a[_0xaf6c('0xa9')]['content-type'];}return rp(_0x71440a);})[_0xaf6c('0x2a')](function(_0x35f2a3){if(_0x35f2a3){_0x3b1200[_0xaf6c('0x26')](_0x35f2a3['headers']);logger[_0xaf6c('0x67')](_0x35f2a3[_0xaf6c('0x90')]);if(_[_0xaf6c('0xac')](_0x5cfd90[_0xaf6c('0x37')][_0xaf6c('0x7')],_0xaf6c('0x50'))&&_0x35f2a3[_0xaf6c('0xad')]==0x1f4){return _0x3b1200[_0xaf6c('0x21')](_0x35f2a3[_0xaf6c('0xad')]);}else{return _0x3b1200['status'](_0x35f2a3['statusCode'])[_0xaf6c('0x9a')](_0x35f2a3[_0xaf6c('0x90')]);}}else{return _0x3b1200['sendStatus'](0xc8);}})[_0xaf6c('0x4a')](handleError(_0x3b1200,null));};exports['webhookPost']=function(_0x25cf12,_0x51bda0,_0x5e81b2){return BPromise[_0xaf6c('0xa0')]()[_0xaf6c('0x2a')](function(){if(!_0x25cf12[_0xaf6c('0x37')][_0xaf6c('0x7')]){throw new Error(_0xaf6c('0xa1'));}if(!_0x25cf12[_0xaf6c('0x37')][_0xaf6c('0xa2')]){throw new Error(_0xaf6c('0xa3'));}var _0x27cada=_0x25cf12[_0xaf6c('0x37')][_0xaf6c('0xa4')]?_0x25cf12[_0xaf6c('0x37')][_0xaf6c('0xa4')]+':'+_0x25cf12[_0xaf6c('0x37')][_0xaf6c('0xa2')]:'http://localhost:'+_0x25cf12[_0xaf6c('0x37')]['port'];var _0x571cc4=_0x25cf12['query'][_0xaf6c('0x27')]?_0x25cf12[_0xaf6c('0x37')][_0xaf6c('0x27')]:!![];var _0x369f8a=_0x25cf12[_0xaf6c('0x37')][_0xaf6c('0xa6')]?_0x25cf12[_0xaf6c('0x37')][_0xaf6c('0xa6')]:null;var _0x5a30fd={'method':_0x25cf12[_0xaf6c('0xa7')],'uri':util[_0xaf6c('0x53')](_0xaf6c('0xa8'),_0x27cada,_0x25cf12[_0xaf6c('0x37')][_0xaf6c('0x7')]),'json':_0x571cc4,'resolveWithFullResponse':!![],'encoding':_0x369f8a,'body':_0x25cf12['body']};if(_0x25cf12[_0xaf6c('0xa9')]){_0x5a30fd[_0xaf6c('0xa9')]=_0x25cf12[_0xaf6c('0xa9')];if(_0x5a30fd[_0xaf6c('0xa9')][_0xaf6c('0xaa')]){delete _0x5a30fd['headers'][_0xaf6c('0xaa')];}}if(_0x5a30fd[_0xaf6c('0xa9')][_0xaf6c('0xab')]){delete _0x5a30fd[_0xaf6c('0xa9')][_0xaf6c('0xab')];}return rp(_0x5a30fd);})[_0xaf6c('0x2a')](function(_0x35c393){if(_0x35c393){_0x51bda0[_0xaf6c('0x26')](_0x35c393['headers']);logger[_0xaf6c('0x67')](_0x35c393['body']);return _0x51bda0[_0xaf6c('0x22')](_0x35c393[_0xaf6c('0xad')])[_0xaf6c('0x9a')](_0x35c393[_0xaf6c('0x90')]);}else{return _0x51bda0['sendStatus'](0xc8);}})['catch'](handleError(_0x51bda0,null));}; \ No newline at end of file +var _0x1977=['attachments/**/*','close','existsSync','Plugin\x20not\x20found','download','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Temporary\x20file\x20removed','upload','file','filename','extname','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isDirectory','some','Plugin\x20manifest\x20missing','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','Invalid\x20manifest:\x20version\x20not\x20specified','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','admin','parameters','Invalid\x20manifest:\x20no\x20view\x20specified','Invalid\x20manifest:\x20script\x20name\x20missing','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','version','test','Warning:\x20admin\x20view\x20not\x20specified','agent','plugins','Warning:\x20agent\x20view\x20not\x20specified','script','scriptName','scriptPath','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','send','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','destroy','resolve','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','format','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','set','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','rimraf','archiver','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','end','json','offset','undefined','limit','count','Content-Range','reject','update','then','Plugins','UserProfileResource','status','sendStatus','stack','name','map','Plugin','rawAttributes','fieldName','type','keys','model','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','includeAll','include','findAll','rows','params','intersection','options','catch','find','join','root','server/files/plugins','%s.zip','basename','createWriteStream','zip','error','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','**/*','dirname','path'];(function(_0x417e6a,_0x39ef8b){var _0x445dff=function(_0x4fe104){while(--_0x4fe104){_0x417e6a['push'](_0x417e6a['shift']());}};_0x445dff(++_0x39ef8b);}(_0x1977,0x1a1));var _0x7197=function(_0x5b7b8a,_0x141e50){_0x5b7b8a=_0x5b7b8a-0x0;var _0x3be577=_0x1977[_0x5b7b8a];return _0x3be577;};'use strict';var emlformat=require(_0x7197('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7197('0x1'));var jsonpatch=require(_0x7197('0x2'));var rp=require('request-promise');var moment=require(_0x7197('0x3'));var BPromise=require(_0x7197('0x4'));var Mustache=require(_0x7197('0x5'));var util=require(_0x7197('0x6'));var path=require('path');var sox=require(_0x7197('0x7'));var csv=require(_0x7197('0x8'));var ejs=require(_0x7197('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x7197('0xa'));var crypto=require(_0x7197('0xb'));var jsforce=require(_0x7197('0xc'));var deskjs=require(_0x7197('0xd'));var toCsv=require(_0x7197('0x8'));var querystring=require(_0x7197('0xe'));var Papa=require(_0x7197('0xf'));var extract=require('extract-zip');var rimraf=require(_0x7197('0x10'));var archiver=require(_0x7197('0x11'));var Redis=require(_0x7197('0x12'));var authService=require(_0x7197('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7197('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7197('0x15'));var utils=require(_0x7197('0x16'));var config=require(_0x7197('0x17'));var licenseUtil=require(_0x7197('0x18'));var db=require('../../mysqldb')['db'];config[_0x7197('0x19')]=_[_0x7197('0x1a')](config[_0x7197('0x19')],{'host':_0x7197('0x1b'),'port':0x18eb});var socket=require(_0x7197('0x1c'))(new Redis(config['redis']));require('./plugin.socket')[_0x7197('0x1d')](socket);function respondWithStatusCode(_0x150263,_0x2b8e55){_0x2b8e55=_0x2b8e55||0xcc;return function(_0x108b80){if(_0x108b80){return _0x150263['sendStatus'](_0x2b8e55);}return _0x150263['status'](_0x2b8e55)[_0x7197('0x1e')]();};}function respondWithResult(_0x50a1b6,_0x5726d7){_0x5726d7=_0x5726d7||0xc8;return function(_0x459367){if(_0x459367){return _0x50a1b6['status'](_0x5726d7)[_0x7197('0x1f')](_0x459367);}};}function respondWithFilteredResult(_0x340a01,_0x2a85aa){return function(_0x4c57ae){if(_0x4c57ae){var _0x3896d6=typeof _0x2a85aa[_0x7197('0x20')]===_0x7197('0x21')&&typeof _0x2a85aa[_0x7197('0x22')]===_0x7197('0x21');var _0x1da8e0=_0x4c57ae[_0x7197('0x23')];var _0x2f7da0=_0x3896d6?0x0:_0x2a85aa[_0x7197('0x20')];var _0x61fcc1=_0x3896d6?_0x4c57ae['count']:_0x2a85aa[_0x7197('0x20')]+_0x2a85aa[_0x7197('0x22')];var _0x2357da;if(_0x61fcc1>=_0x1da8e0){_0x61fcc1=_0x1da8e0;_0x2357da=0xc8;}else{_0x2357da=0xce;}_0x340a01['status'](_0x2357da);return _0x340a01['set'](_0x7197('0x24'),_0x2f7da0+'-'+_0x61fcc1+'/'+_0x1da8e0)[_0x7197('0x1f')](_0x4c57ae);}return null;};}function patchUpdates(_0x24430f){return function(_0x748373){try{jsonpatch['apply'](_0x748373,_0x24430f,!![]);}catch(_0xcbf93){return BPromise[_0x7197('0x25')](_0xcbf93);}return _0x748373['save']();};}function saveUpdates(_0xeddca1,_0x11bfbc){return function(_0x2ffd3b){if(_0x2ffd3b){return _0x2ffd3b[_0x7197('0x26')](_0xeddca1)[_0x7197('0x27')](function(_0x3cb64f){return _0x3cb64f;});}return null;};}function removeEntity(_0x29df7d,_0x5277a4){return function(_0x1ad2ad){if(_0x1ad2ad){return _0x1ad2ad['destroy']()[_0x7197('0x27')](function(){var _0x3b9ae7=_0x1ad2ad['get']({'plain':!![]});var _0x1e7925=_0x7197('0x28');return db[_0x7197('0x29')]['destroy']({'where':{'type':_0x1e7925,'resourceId':_0x3b9ae7['id']}})[_0x7197('0x27')](function(){return _0x1ad2ad;});})[_0x7197('0x27')](function(){_0x29df7d[_0x7197('0x2a')](0xcc)[_0x7197('0x1e')]();});}};}function handleEntityNotFound(_0xcfb220,_0x584832){return function(_0x20de8b){if(!_0x20de8b){_0xcfb220[_0x7197('0x2b')](0x194);}return _0x20de8b;};}function handleError(_0x5e3560,_0x1bfdfa){_0x1bfdfa=_0x1bfdfa||0x1f4;return function(_0x29550d){logger['error'](_0x29550d[_0x7197('0x2c')]);if(_0x29550d[_0x7197('0x2d')]){delete _0x29550d[_0x7197('0x2d')];}_0x5e3560[_0x7197('0x2a')](_0x1bfdfa)['send'](_0x29550d);};}exports['index']=function(_0x3dd1aa,_0x4f0db5){var _0x1e308e={},_0x1f1d88={},_0x4e8b09={'count':0x0,'rows':[]};var _0x4eff5b=_[_0x7197('0x2e')](db[_0x7197('0x2f')][_0x7197('0x30')],function(_0x14e7b5){return{'name':_0x14e7b5[_0x7197('0x31')],'type':_0x14e7b5[_0x7197('0x32')]['key']};});_0x1f1d88['model']=_[_0x7197('0x2e')](_0x4eff5b,'name');_0x1f1d88['query']=_[_0x7197('0x33')](_0x3dd1aa['query']);_0x1f1d88['filters']=_['intersection'](_0x1f1d88[_0x7197('0x34')],_0x1f1d88[_0x7197('0x35')]);_0x1e308e[_0x7197('0x36')]=_['intersection'](_0x1f1d88[_0x7197('0x34')],qs[_0x7197('0x37')](_0x3dd1aa[_0x7197('0x35')][_0x7197('0x37')]));_0x1e308e[_0x7197('0x36')]=_0x1e308e['attributes'][_0x7197('0x38')]?_0x1e308e[_0x7197('0x36')]:_0x1f1d88[_0x7197('0x34')];if(!_0x3dd1aa['query'][_0x7197('0x39')](_0x7197('0x3a'))){_0x1e308e[_0x7197('0x22')]=qs[_0x7197('0x22')](_0x3dd1aa['query']['limit']);_0x1e308e[_0x7197('0x20')]=qs[_0x7197('0x20')](_0x3dd1aa[_0x7197('0x35')][_0x7197('0x20')]);}_0x1e308e[_0x7197('0x3b')]=qs[_0x7197('0x3c')](_0x3dd1aa['query']['sort']);_0x1e308e[_0x7197('0x3d')]=qs['filters'](_[_0x7197('0x3e')](_0x3dd1aa['query'],_0x1f1d88[_0x7197('0x3f')]),_0x4eff5b);if(_0x3dd1aa['query'][_0x7197('0x40')]){_0x1e308e[_0x7197('0x3d')]=_[_0x7197('0x41')](_0x1e308e['where'],{'$or':_[_0x7197('0x2e')](_0x4eff5b,function(_0x29f133){if(_0x29f133[_0x7197('0x32')]!=='VIRTUAL'){var _0x5c3125={};_0x5c3125[_0x29f133[_0x7197('0x2d')]]={'$like':'%'+_0x3dd1aa[_0x7197('0x35')][_0x7197('0x40')]+'%'};return _0x5c3125;}})});}_0x1e308e=_['merge']({},_0x1e308e,_0x3dd1aa['options']);var _0x5c3941={'where':_0x1e308e[_0x7197('0x3d')]};return db[_0x7197('0x2f')]['count'](_0x5c3941)['then'](function(_0x7c8b6e){_0x4e8b09[_0x7197('0x23')]=_0x7c8b6e;if(_0x3dd1aa[_0x7197('0x35')][_0x7197('0x42')]){_0x1e308e[_0x7197('0x43')]=[{'all':!![]}];}return db[_0x7197('0x2f')][_0x7197('0x44')](_0x1e308e);})[_0x7197('0x27')](function(_0x492fe0){_0x4e8b09[_0x7197('0x45')]=_0x492fe0;return _0x4e8b09;})[_0x7197('0x27')](respondWithFilteredResult(_0x4f0db5,_0x1e308e))['catch'](handleError(_0x4f0db5,null));};exports['show']=function(_0x175b7a,_0x24e123){var _0x89fd47={'raw':!![],'where':{'id':_0x175b7a[_0x7197('0x46')]['id']}},_0x121ff7={};_0x121ff7[_0x7197('0x34')]=_['keys'](db[_0x7197('0x2f')][_0x7197('0x30')]);_0x121ff7[_0x7197('0x35')]=_['keys'](_0x175b7a[_0x7197('0x35')]);_0x121ff7[_0x7197('0x3f')]=_[_0x7197('0x47')](_0x121ff7['model'],_0x121ff7[_0x7197('0x35')]);_0x89fd47[_0x7197('0x36')]=_[_0x7197('0x47')](_0x121ff7[_0x7197('0x34')],qs[_0x7197('0x37')](_0x175b7a[_0x7197('0x35')][_0x7197('0x37')]));_0x89fd47[_0x7197('0x36')]=_0x89fd47['attributes'][_0x7197('0x38')]?_0x89fd47['attributes']:_0x121ff7['model'];if(_0x175b7a[_0x7197('0x35')][_0x7197('0x42')]){_0x89fd47['include']=[{'all':!![]}];}_0x89fd47=_[_0x7197('0x41')]({},_0x89fd47,_0x175b7a[_0x7197('0x48')]);return db['Plugin']['find'](_0x89fd47)[_0x7197('0x27')](handleEntityNotFound(_0x24e123,null))[_0x7197('0x27')](respondWithResult(_0x24e123,null))[_0x7197('0x49')](handleError(_0x24e123,null));};exports['download']=function(_0x193a1f,_0x10d979,_0x40e14d){return db[_0x7197('0x2f')][_0x7197('0x4a')]({'where':{'id':_0x193a1f[_0x7197('0x46')]['id']},'attributes':[_0x7197('0x2d'),'path'],'raw':!![]})[_0x7197('0x27')](handleEntityNotFound(_0x10d979,null))[_0x7197('0x27')](function(_0xe8aaa5){if(_0xe8aaa5){var _0x2dbfec=path[_0x7197('0x4b')](config[_0x7197('0x4c')],_0x7197('0x4d'),util['format'](_0x7197('0x4e'),path[_0x7197('0x4f')](_0xe8aaa5['path'])));var _0x14428e=fs[_0x7197('0x50')](_0x2dbfec);var _0x3114fa=archiver(_0x7197('0x51'),{'zlib':{'level':0x9}});_0x3114fa['on']('warning',function(_0x2987ce){if(_0x2987ce['code']==='ENOENT'){logger[_0x7197('0x52')](_0x2987ce);}else{throw new db[(_0x7197('0x53'))][(_0x7197('0x54'))](_0x7197('0x55'));}});_0x3114fa['on']('error',function(_0x5ce2cb){throw new db['Sequelize']['Error'](_0x7197('0x55'));});_0x3114fa[_0x7197('0x56')](_0x14428e);_0x3114fa['glob'](_0x7197('0x57'),{'cwd':path['join'](config[_0x7197('0x4c')],_0x7197('0x4d'),path[_0x7197('0x58')](_0xe8aaa5['path'])),'ignore':[path[_0x7197('0x4b')](path['basename'](_0xe8aaa5[_0x7197('0x59')]),'node_modules/**/*'),path[_0x7197('0x4b')](path[_0x7197('0x4f')](_0xe8aaa5['path']),_0x7197('0x5a'))],'nodir':!![]})['finalize']();_0x14428e['on'](_0x7197('0x5b'),function(){if(!fs[_0x7197('0x5c')](_0x2dbfec)){throw new db[(_0x7197('0x53'))][(_0x7197('0x54'))](_0x7197('0x5d'));}return _0x10d979[_0x7197('0x5e')](_0x2dbfec,util['format'](_0x7197('0x4e'),path[_0x7197('0x4f')](_0xe8aaa5[_0x7197('0x59')])),function(_0x20ab3a){if(_0x20ab3a){throw new db[(_0x7197('0x53'))][(_0x7197('0x54'))](_0x7197('0x5f'));}fs[_0x7197('0x60')](_0x2dbfec);logger[_0x7197('0x61')]('Download\x20completed');logger['info'](_0x7197('0x62'));});});}return null;})['catch'](handleError(_0x10d979,null));};exports[_0x7197('0x63')]=function(_0x99c6d6,_0x5e57f6,_0x536cd7){var _0x2a9ed5=path['basename'](_0x99c6d6[_0x7197('0x64')][_0x7197('0x65')],path[_0x7197('0x66')](_0x99c6d6[_0x7197('0x64')]['filename']));var _0x180788=path[_0x7197('0x4b')](config[_0x7197('0x4c')],_0x7197('0x4d'),_0x99c6d6[_0x7197('0x64')][_0x7197('0x65')]);var _0x1d98df=path[_0x7197('0x4b')](config[_0x7197('0x4c')],_0x7197('0x4d'),_0x2a9ed5);logger[_0x7197('0x61')]('Plugin\x20upload\x20filepath:\x20%s',_0x180788);logger[_0x7197('0x61')]('Plugin\x20upload\x20destination:\x20%s',_0x1d98df);try{fs[_0x7197('0x67')](_0x180788,parseInt(_0x7197('0x68'),0x8));extract(_0x180788,{'dir':_0x1d98df},function(_0x38f8be){if(_0x38f8be){logger[_0x7197('0x52')](_0x38f8be);handleError(_0x38f8be,!![]);};var _0x4d8f33=fs[_0x7197('0x69')](_0x1d98df);if(_0x4d8f33[_0x7197('0x38')]>0x1){removeReferences(_0x180788,_0x1d98df);logger[_0x7197('0x52')](_0x7197('0x6a'));return _0x536cd7(new Error(_0x7197('0x6a')));}var _0x4e175d=fs[_0x7197('0x6b')](path[_0x7197('0x4b')](_0x1d98df,_0x4d8f33[0x0]));if(_0x4e175d['isFile']()){removeReferences(_0x180788,_0x1d98df);logger['error']('Invalid\x20plugin\x20structure');return _0x536cd7(new Error(_0x7197('0x6a')));}if(_0x4e175d[_0x7197('0x6c')]()){var _0x219079=fs['readdirSync'](path[_0x7197('0x4b')](_0x1d98df,_0x4d8f33[0x0]));if(_0x219079[_0x7197('0x38')]===0x0){removeReferences(_0x180788,_0x1d98df);logger[_0x7197('0x52')]('Invalid\x20plugin\x20structure');return _0x536cd7(new Error(_0x7197('0x6a')));}var _0x451d72=_0x219079[_0x7197('0x6d')](function(_0x3910c8){return _0x3910c8==='manifest.json';});if(!_0x451d72){return _0x536cd7(new Error(_0x7197('0x6e')));}var _0x257b9f=fs['readFileSync'](path[_0x7197('0x4b')](_0x1d98df,_0x4d8f33[0x0],'manifest.json'));var _0x16e196=JSON['parse'](_0x257b9f);if('undefined'==typeof _0x16e196[_0x7197('0x2d')]){return _0x536cd7(new Error(_0x7197('0x6f')));}if(_0x7197('0x21')==typeof _0x16e196[_0x7197('0x32')]){return _0x536cd7(new Error(_0x7197('0x70')));}if(_0x7197('0x21')==typeof _0x16e196['version']){return _0x536cd7(new Error(_0x7197('0x71')));}if(_0x7197('0x21')==typeof _0x16e196['parameters']){return _0x536cd7(new Error(_0x7197('0x72')));}if(_0x16e196[_0x7197('0x32')]===_0x7197('0x73')){if(_0x7197('0x21')==typeof _0x16e196['parameters'][_0x7197('0x74')]){return _0x536cd7(new Error(_0x7197('0x75')));}if(_0x7197('0x21')==typeof _0x16e196['parameters'][_0x7197('0x74')][_0x7197('0x76')]&&_0x7197('0x21')==typeof _0x16e196[_0x7197('0x77')][_0x7197('0x74')]['agent']){return _0x536cd7(new Error(_0x7197('0x78')));}}else if(_0x16e196['type']==='script'){if(_0x7197('0x21')==typeof _0x16e196[_0x7197('0x77')]['scriptName']){return _0x536cd7(new Error(_0x7197('0x79')));}if(_0x7197('0x21')==typeof _0x16e196[_0x7197('0x77')]['scriptPath']){return _0x536cd7(new Error(_0x7197('0x7a')));}}else{return _0x536cd7(new Error(_0x7197('0x7b')));}var _0x316894=_0x16e196[_0x7197('0x2d')];var _0x2b42e9=_0x16e196[_0x7197('0x7c')];var _0x140dbc=_0x16e196[_0x7197('0x32')];var _0x3e9b5b=_0x16e196[_0x7197('0x7d')]?_0x16e196[_0x7197('0x7d')]:_0x7197('0x7e');var _0x1ce1a9=_0x16e196[_0x7197('0x7f')]?_0x16e196[_0x7197('0x7f')]:_0x7197('0x80');var _0x248bc0='';var _0x14cbc6='';var _0x2d077b='';var _0x51a355='';var _0x8b69a7=_0x16e196[_0x7197('0x81')];if(_0x140dbc===_0x7197('0x73')){if(_0x7197('0x21')!=typeof _0x16e196[_0x7197('0x77')][_0x7197('0x74')][_0x7197('0x76')]){var _0x5be6e6=_0x16e196[_0x7197('0x77')][_0x7197('0x74')][_0x7197('0x76')];if(!/^(f|ht)tps?:\/\//i[_0x7197('0x82')](_0x5be6e6)){_0x248bc0=path[_0x7197('0x4b')]('plugins',_0x2a9ed5,_0x4d8f33[0x0],_0x5be6e6);}else{_0x248bc0=_0x5be6e6;}}else{logger[_0x7197('0x61')](_0x7197('0x83'));}if(_0x7197('0x21')!=typeof _0x16e196[_0x7197('0x77')][_0x7197('0x74')][_0x7197('0x84')]){var _0xd9e24e=_0x16e196['parameters'][_0x7197('0x74')][_0x7197('0x84')];if(!/^(f|ht)tps?:\/\//i[_0x7197('0x82')](_0xd9e24e)){_0x14cbc6=path[_0x7197('0x4b')](_0x7197('0x85'),_0x2a9ed5,_0x4d8f33[0x0],_0xd9e24e);}else{_0x14cbc6=_0xd9e24e;}}else{logger['info'](_0x7197('0x86'));}}else if(_0x140dbc===_0x7197('0x87')){_0x2d077b=_0x16e196['parameters'][_0x7197('0x88')];_0x51a355=_0x16e196[_0x7197('0x77')][_0x7197('0x89')];if(_0x7197('0x21')!=typeof _0x16e196[_0x7197('0x77')]['views']){if(_0x7197('0x21')!=typeof _0x16e196[_0x7197('0x77')][_0x7197('0x74')][_0x7197('0x76')]){var _0x5be6e6=_0x16e196[_0x7197('0x77')][_0x7197('0x74')]['admin'];if(!/^(f|ht)tps?:\/\//i['test'](_0x5be6e6)){_0x248bc0=path[_0x7197('0x4b')]('plugins',_0x2a9ed5,_0x4d8f33[0x0],_0x5be6e6);}else{_0x248bc0=_0x5be6e6;}}if('undefined'!=typeof _0x16e196[_0x7197('0x77')][_0x7197('0x74')][_0x7197('0x84')]){var _0xd9e24e=_0x16e196[_0x7197('0x77')]['views'][_0x7197('0x84')];if(!/^(f|ht)tps?:\/\//i[_0x7197('0x82')](_0xd9e24e)){_0x14cbc6=path[_0x7197('0x4b')](_0x7197('0x85'),_0x2a9ed5,_0x4d8f33[0x0],_0xd9e24e);}else{_0x14cbc6=_0xd9e24e;}}}}var _0x1f46d9={'name':_0x316894,'description':_0x2b42e9,'path':path[_0x7197('0x4b')](_0x2a9ed5,_0x4d8f33[0x0]),'type':_0x140dbc,'sidebar':_0x3e9b5b,'icon':_0x1ce1a9,'adminUrl':_0x248bc0,'agentUrl':_0x14cbc6,'scriptName':_0x2d077b,'scriptPath':_0x51a355,'version':_0x8b69a7};removeReferences(_0x180788,null);return db[_0x7197('0x2f')][_0x7197('0x8a')](_0x1f46d9)['then'](function(_0x5c8c17){var _0x2a26d7={'role':_0x99c6d6[_0x7197('0x8b')][_0x7197('0x8c')],'userProfileId':_0x99c6d6[_0x7197('0x8b')][_0x7197('0x8d')]};if(!_0x2a26d7)throw new Error(_0x7197('0x8e'));if(_0x2a26d7[_0x7197('0x8c')]===_0x7197('0x8f')){var _0x418645=_0x5c8c17[_0x7197('0x90')]({'plain':!![]});return db[_0x7197('0x91')]['find']({'where':{'name':_0x7197('0x28'),'userProfileId':_0x2a26d7['userProfileId']},'raw':!![]})[_0x7197('0x27')](function(_0x5f0364){if(_0x5f0364&&_0x5f0364[_0x7197('0x92')]===0x0){return db[_0x7197('0x29')][_0x7197('0x8a')]({'name':_0x418645['name'],'resourceId':_0x418645['id'],'type':_0x5f0364[_0x7197('0x2d')],'sectionId':_0x5f0364['id']},{})[_0x7197('0x27')](function(){return _0x5c8c17;});}else{return _0x5c8c17;}})[_0x7197('0x49')](function(_0x1d1c24){logger[_0x7197('0x52')](_0x7197('0x93'),_0x1d1c24);throw _0x1d1c24;});}return _0x5c8c17;})[_0x7197('0x27')](respondWithResult(_0x5e57f6,null))['catch'](handleError(_0x5e57f6,null));}});}catch(_0x4cf7c3){_0x5e57f6[_0x7197('0x2a')](0x1f4)[_0x7197('0x94')](_0x4cf7c3);}};function removeReferences(_0x1c46e0,_0x49b8a3){try{if(_0x1c46e0){fs['unlinkSync'](_0x1c46e0);logger[_0x7197('0x61')](_0x7197('0x95'));}if(_0x49b8a3){rimraf(_0x49b8a3,function(){});logger[_0x7197('0x61')](_0x7197('0x96'));}}catch(_0x53eb14){logger[_0x7197('0x52')](_0x53eb14);}}exports[_0x7197('0x26')]=function(_0x44b21c,_0x478ae6,_0x44ecf1){return db[_0x7197('0x2f')]['find']({'where':{'id':_0x44b21c[_0x7197('0x46')]['id']}})['then'](handleEntityNotFound(_0x478ae6,null))[_0x7197('0x27')](saveUpdates(_0x44b21c[_0x7197('0x8b')],null))[_0x7197('0x27')](respondWithResult(_0x478ae6,null))[_0x7197('0x49')](handleError(_0x478ae6,null));};exports[_0x7197('0x97')]=function(_0x560073,_0x10d01a,_0x5bd824){return db[_0x7197('0x2f')][_0x7197('0x4a')]({'where':{'id':_0x560073[_0x7197('0x46')]['id']}})[_0x7197('0x27')](function(_0x3e806a){if(_0x3e806a){return _0x3e806a[_0x7197('0x98')]();}})[_0x7197('0x27')](function(_0x11f8a6){rimraf(path[_0x7197('0x4b')](config['root'],'server/files/plugins',path[_0x7197('0x58')](_0x11f8a6[_0x7197('0x59')])),function(){});return _0x11f8a6;})['then'](handleEntityNotFound(_0x10d01a,null))[_0x7197('0x27')](respondWithStatusCode(_0x10d01a,null))[_0x7197('0x49')](handleError(_0x10d01a,null));};exports['webhookGet']=function(_0x2a35a7,_0x4d5a18,_0x2d74b0){return BPromise[_0x7197('0x99')]()[_0x7197('0x27')](function(){if(!_0x2a35a7[_0x7197('0x35')][_0x7197('0x59')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x2a35a7[_0x7197('0x35')][_0x7197('0x9a')]){throw new Error(_0x7197('0x9b'));}var _0x2b9d7f=_0x2a35a7[_0x7197('0x35')][_0x7197('0x9c')]?_0x2a35a7[_0x7197('0x35')]['hostname']+':'+_0x2a35a7[_0x7197('0x35')][_0x7197('0x9a')]:_0x7197('0x9d')+_0x2a35a7[_0x7197('0x35')]['port'];var _0x3c559d=_0x2a35a7['query']['json']?_0x2a35a7['query']['json']:!![];var _0x4343c8=_0x2a35a7[_0x7197('0x35')]['encoding']?_0x2a35a7[_0x7197('0x35')][_0x7197('0x9e')]:null;var _0x56372c={'method':_0x2a35a7[_0x7197('0x9f')],'uri':util[_0x7197('0xa0')](_0x7197('0xa1'),_0x2b9d7f,_0x2a35a7[_0x7197('0x35')][_0x7197('0x59')]),'json':_0x3c559d,'resolveWithFullResponse':!![],'encoding':_0x4343c8,'qs':_0x2a35a7['query']};if(_0x2a35a7[_0x7197('0xa2')]){_0x56372c[_0x7197('0xa2')]=_0x2a35a7[_0x7197('0xa2')];if(_0x56372c[_0x7197('0xa2')][_0x7197('0xa3')]){delete _0x56372c[_0x7197('0xa2')][_0x7197('0xa3')];}}if(_0x56372c[_0x7197('0xa2')]['content-type']){delete _0x56372c[_0x7197('0xa2')][_0x7197('0xa4')];}return rp(_0x56372c);})[_0x7197('0x27')](function(_0x42e511){if(_0x42e511){_0x4d5a18['set'](_0x42e511['headers']);logger['info'](_0x42e511[_0x7197('0x8b')]);if(_[_0x7197('0xa5')](_0x2a35a7[_0x7197('0x35')]['path'],_0x7197('0x5e'))&&_0x42e511[_0x7197('0xa6')]==0x1f4){return _0x4d5a18['sendStatus'](_0x42e511[_0x7197('0xa6')]);}else{return _0x4d5a18['status'](_0x42e511['statusCode'])['send'](_0x42e511[_0x7197('0x8b')]);}}else{return _0x4d5a18[_0x7197('0x2b')](0xc8);}})[_0x7197('0x49')](handleError(_0x4d5a18,null));};exports[_0x7197('0xa7')]=function(_0x2d461b,_0x59ebba,_0x399e1e){return BPromise[_0x7197('0x99')]()[_0x7197('0x27')](function(){if(!_0x2d461b[_0x7197('0x35')][_0x7197('0x59')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x2d461b[_0x7197('0x35')][_0x7197('0x9a')]){throw new Error(_0x7197('0x9b'));}var _0x524981=_0x2d461b['query'][_0x7197('0x9c')]?_0x2d461b['query']['hostname']+':'+_0x2d461b[_0x7197('0x35')]['port']:_0x7197('0x9d')+_0x2d461b[_0x7197('0x35')][_0x7197('0x9a')];var _0xd216e5=_0x2d461b[_0x7197('0x35')][_0x7197('0x1f')]?_0x2d461b[_0x7197('0x35')]['json']:!![];var _0x9f6642=_0x2d461b[_0x7197('0x35')][_0x7197('0x9e')]?_0x2d461b[_0x7197('0x35')][_0x7197('0x9e')]:null;var _0x405710={'method':_0x2d461b[_0x7197('0x9f')],'uri':util['format']('%s%s',_0x524981,_0x2d461b[_0x7197('0x35')][_0x7197('0x59')]),'json':_0xd216e5,'resolveWithFullResponse':!![],'encoding':_0x9f6642,'body':_0x2d461b[_0x7197('0x8b')]};if(_0x2d461b[_0x7197('0xa2')]){_0x405710['headers']=_0x2d461b[_0x7197('0xa2')];if(_0x405710[_0x7197('0xa2')][_0x7197('0xa3')]){delete _0x405710[_0x7197('0xa2')]['content-length'];}}if(_0x405710[_0x7197('0xa2')][_0x7197('0xa4')]){delete _0x405710[_0x7197('0xa2')]['content-type'];}return rp(_0x405710);})[_0x7197('0x27')](function(_0x1e1768){if(_0x1e1768){_0x59ebba[_0x7197('0xa8')](_0x1e1768[_0x7197('0xa2')]);logger[_0x7197('0x61')](_0x1e1768[_0x7197('0x8b')]);return _0x59ebba[_0x7197('0x2a')](_0x1e1768[_0x7197('0xa6')])[_0x7197('0x94')](_0x1e1768[_0x7197('0x8b')]);}else{return _0x59ebba[_0x7197('0x2b')](0xc8);}})[_0x7197('0x49')](handleError(_0x59ebba,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 6305405..26a6100 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 _0xfcf0=['hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x4a0fca,_0xba7712){var _0x332687=function(_0x5bdb33){while(--_0x5bdb33){_0x4a0fca['push'](_0x4a0fca['shift']());}};_0x332687(++_0xba7712);}(_0xfcf0,0x138));var _0x0fcf=function(_0x1663ae,_0x10484a){_0x1663ae=_0x1663ae-0x0;var _0x30ffb8=_0xfcf0[_0x1663ae];return _0x30ffb8;};'use strict';var EventEmitter=require(_0x0fcf('0x0'));var Plugin=require(_0x0fcf('0x1'))['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents[_0x0fcf('0x2')](0x0);var events={'afterCreate':_0x0fcf('0x3'),'afterUpdate':_0x0fcf('0x4'),'afterDestroy':_0x0fcf('0x5')};function emitEvent(_0x5c865e){return function(_0x2fe6d8,_0x265968,_0x3bd34d){PluginEvents[_0x0fcf('0x6')](_0x5c865e+':'+_0x2fe6d8['id'],_0x2fe6d8);PluginEvents[_0x0fcf('0x6')](_0x5c865e,_0x2fe6d8);_0x3bd34d(null);};}for(var e in events){if(events[_0x0fcf('0x7')](e)){var event=events[e];Plugin[_0x0fcf('0x8')](e,emitEvent(event));}}module[_0x0fcf('0x9')]=PluginEvents; \ No newline at end of file +var _0x16ce=['exports','../../mysqldb','Plugin','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x32ba56,_0x52162b){var _0x5e1414=function(_0x1c5f4e){while(--_0x1c5f4e){_0x32ba56['push'](_0x32ba56['shift']());}};_0x5e1414(++_0x52162b);}(_0x16ce,0xfb));var _0xe16c=function(_0x304360,_0x38cfd9){_0x304360=_0x304360-0x0;var _0x4f361f=_0x16ce[_0x304360];return _0x4f361f;};'use strict';var EventEmitter=require('events');var Plugin=require(_0xe16c('0x0'))['db'][_0xe16c('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0xe16c('0x2')](0x0);var events={'afterCreate':_0xe16c('0x3'),'afterUpdate':_0xe16c('0x4'),'afterDestroy':_0xe16c('0x5')};function emitEvent(_0x546ed6){return function(_0x55c37e,_0x4a5fc8,_0x884769){PluginEvents['emit'](_0x546ed6+':'+_0x55c37e['id'],_0x55c37e);PluginEvents[_0xe16c('0x6')](_0x546ed6,_0x55c37e);_0x884769(null);};}for(var e in events){if(events[_0xe16c('0x7')](e)){var event=events[e];Plugin[_0xe16c('0x8')](e,emitEvent(event));}}module[_0xe16c('0x9')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index a021bc1..c1a0777 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 _0xcdc8=['../../config/environment','./plugin.attributes','exports','define','plugins','util','api','bluebird','request-promise','path'];(function(_0x1cc0e0,_0x945c3a){var _0x5c6d62=function(_0x502836){while(--_0x502836){_0x1cc0e0['push'](_0x1cc0e0['shift']());}};_0x5c6d62(++_0x945c3a);}(_0xcdc8,0x1a9));var _0x8cdc=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0xcdc8[_0x23e7c1];return _0x1add43;};'use strict';var _=require('lodash');var util=require(_0x8cdc('0x0'));var logger=require('../../config/logger')(_0x8cdc('0x1'));var moment=require('moment');var BPromise=require(_0x8cdc('0x2'));var rp=require(_0x8cdc('0x3'));var fs=require('fs');var path=require(_0x8cdc('0x4'));var rimraf=require('rimraf');var config=require(_0x8cdc('0x5'));var attributes=require(_0x8cdc('0x6'));module[_0x8cdc('0x7')]=function(_0x359634,_0x349eb){return _0x359634[_0x8cdc('0x8')]('Plugin',attributes,{'tableName':_0x8cdc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbe52=['../../config/environment','./plugin.attributes','exports','define','Plugin','plugins','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x11445a,_0x536c5f){var _0x69563f=function(_0x377651){while(--_0x377651){_0x11445a['push'](_0x11445a['shift']());}};_0x69563f(++_0x536c5f);}(_0xbe52,0x164));var _0x2be5=function(_0x559458,_0x25d092){_0x559458=_0x559458-0x0;var _0x5462e9=_0xbe52[_0x559458];return _0x5462e9;};'use strict';var _=require(_0x2be5('0x0'));var util=require(_0x2be5('0x1'));var logger=require(_0x2be5('0x2'))(_0x2be5('0x3'));var moment=require(_0x2be5('0x4'));var BPromise=require('bluebird');var rp=require(_0x2be5('0x5'));var fs=require('fs');var path=require(_0x2be5('0x6'));var rimraf=require(_0x2be5('0x7'));var config=require(_0x2be5('0x8'));var attributes=require(_0x2be5('0x9'));module[_0x2be5('0xa')]=function(_0x39dc18,_0x13fadf){return _0x39dc18[_0x2be5('0xb')](_0x2be5('0xc'),attributes,{'tableName':_0x2be5('0xd'),'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 d1092af..f1f2c9e 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 _0xd803=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./plugin.socket','request','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','error','code','Plugin,\x20%s,\x20%s','message','info','result','catch','CreatePlugin','Plugin','options','raw','then'];(function(_0x23ab6a,_0x1755ee){var _0xd8c822=function(_0x1b9836){while(--_0x1b9836){_0x23ab6a['push'](_0x23ab6a['shift']());}};_0xd8c822(++_0x1755ee);}(_0xd803,0x129));var _0x3d80=function(_0x3be793,_0x592814){_0x3be793=_0x3be793-0x0;var _0x41b54f=_0xd803[_0x3be793];return _0x41b54f;};'use strict';var _=require('lodash');var util=require(_0x3d80('0x0'));var moment=require(_0x3d80('0x1'));var BPromise=require(_0x3d80('0x2'));var rs=require(_0x3d80('0x3'));var fs=require('fs');var Redis=require(_0x3d80('0x4'));var db=require(_0x3d80('0x5'))['db'];var utils=require(_0x3d80('0x6'));var logger=require(_0x3d80('0x7'))('rpc');var config=require(_0x3d80('0x8'));var jayson=require(_0x3d80('0x9'));var client=jayson[_0x3d80('0xa')][_0x3d80('0xb')]({'port':0x232a});config[_0x3d80('0xc')]=_[_0x3d80('0xd')](config[_0x3d80('0xc')],{'host':_0x3d80('0xe'),'port':0x18eb});var socket=require(_0x3d80('0xf'))(new Redis(config[_0x3d80('0xc')]));require(_0x3d80('0x10'))['register'](socket);function respondWithRpcPromise(_0x42ab7b,_0x4d9e3f,_0x4fa9ff){return new BPromise(function(_0x51866c,_0x3ed934){return client[_0x3d80('0x11')](_0x42ab7b,_0x4fa9ff)['then'](function(_0x3434cd){logger['info']('Plugin,\x20%s,\x20%s',_0x4d9e3f,_0x3d80('0x12'));logger[_0x3d80('0x13')](_0x3d80('0x14'),_0x4d9e3f,'request\x20sent',JSON['stringify'](_0x3434cd));if(_0x3434cd['error']){if(_0x3434cd[_0x3d80('0x15')][_0x3d80('0x16')]===0x1f4){logger[_0x3d80('0x15')](_0x3d80('0x17'),_0x4d9e3f,_0x3434cd[_0x3d80('0x15')][_0x3d80('0x18')]);return _0x3ed934(_0x3434cd[_0x3d80('0x15')][_0x3d80('0x18')]);}logger[_0x3d80('0x15')](_0x3d80('0x17'),_0x4d9e3f,_0x3434cd[_0x3d80('0x15')][_0x3d80('0x18')]);return _0x51866c(_0x3434cd[_0x3d80('0x15')][_0x3d80('0x18')]);}else{logger[_0x3d80('0x19')]('Plugin,\x20%s,\x20%s',_0x4d9e3f,'request\x20sent');_0x51866c(_0x3434cd[_0x3d80('0x1a')][_0x3d80('0x18')]);}})[_0x3d80('0x1b')](function(_0x324114){logger['error']('Plugin,\x20%s,\x20%s',_0x4d9e3f,_0x324114);_0x3ed934(_0x324114);});});}exports[_0x3d80('0x1c')]=function(_0xd87612){var _0x1bd5fc=this;return new Promise(function(_0x23c466,_0x1eaecd){return db[_0x3d80('0x1d')]['create'](_0xd87612['body'],{'raw':_0xd87612[_0x3d80('0x1e')]?_0xd87612[_0x3d80('0x1e')][_0x3d80('0x1f')]===undefined?!![]:![]:!![]})[_0x3d80('0x20')](function(_0x6669c1){logger['info'](_0x3d80('0x1c'),_0xd87612);logger[_0x3d80('0x13')](_0x3d80('0x1c'),_0xd87612,JSON['stringify'](_0x6669c1));_0x23c466(_0x6669c1);})['catch'](function(_0x32f2ff){logger[_0x3d80('0x15')]('CreatePlugin',_0x32f2ff[_0x3d80('0x18')],_0xd87612);_0x1eaecd(_0x1bd5fc[_0x3d80('0x15')](0x1f4,_0x32f2ff[_0x3d80('0x18')]));});});}; \ No newline at end of file +var _0x7cfd=['defaults','./plugin.socket','register','then','info','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','code','error','Plugin,\x20%s,\x20%s','message','create','body','options','CreatePlugin','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis'];(function(_0x51383f,_0x251f4d){var _0x2cfd7a=function(_0x425512){while(--_0x425512){_0x51383f['push'](_0x51383f['shift']());}};_0x2cfd7a(++_0x251f4d);}(_0x7cfd,0x10e));var _0xd7cf=function(_0x2beff5,_0x1f3d8a){_0x2beff5=_0x2beff5-0x0;var _0x1b40fa=_0x7cfd[_0x2beff5];return _0x1b40fa;};'use strict';var _=require(_0xd7cf('0x0'));var util=require(_0xd7cf('0x1'));var moment=require('moment');var BPromise=require(_0xd7cf('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd7cf('0x3'))['db'];var utils=require(_0xd7cf('0x4'));var logger=require(_0xd7cf('0x5'))(_0xd7cf('0x6'));var config=require('../../config/environment');var jayson=require(_0xd7cf('0x7'));var client=jayson['client'][_0xd7cf('0x8')]({'port':0x232a});config[_0xd7cf('0x9')]=_[_0xd7cf('0xa')](config[_0xd7cf('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd7cf('0x9')]));require(_0xd7cf('0xb'))[_0xd7cf('0xc')](socket);function respondWithRpcPromise(_0x51c031,_0xfd6b3e,_0x275198){return new BPromise(function(_0x372345,_0x5b8027){return client['request'](_0x51c031,_0x275198)[_0xd7cf('0xd')](function(_0x287230){logger[_0xd7cf('0xe')]('Plugin,\x20%s,\x20%s',_0xfd6b3e,_0xd7cf('0xf'));logger[_0xd7cf('0x10')](_0xd7cf('0x11'),_0xfd6b3e,_0xd7cf('0xf'),JSON[_0xd7cf('0x12')](_0x287230));if(_0x287230['error']){if(_0x287230['error'][_0xd7cf('0x13')]===0x1f4){logger[_0xd7cf('0x14')](_0xd7cf('0x15'),_0xfd6b3e,_0x287230[_0xd7cf('0x14')][_0xd7cf('0x16')]);return _0x5b8027(_0x287230[_0xd7cf('0x14')][_0xd7cf('0x16')]);}logger['error'](_0xd7cf('0x15'),_0xfd6b3e,_0x287230['error']['message']);return _0x372345(_0x287230['error'][_0xd7cf('0x16')]);}else{logger[_0xd7cf('0xe')](_0xd7cf('0x15'),_0xfd6b3e,'request\x20sent');_0x372345(_0x287230['result']['message']);}})['catch'](function(_0x2c7350){logger[_0xd7cf('0x14')](_0xd7cf('0x15'),_0xfd6b3e,_0x2c7350);_0x5b8027(_0x2c7350);});});}exports['CreatePlugin']=function(_0x4ccb2b){var _0x5babdf=this;return new Promise(function(_0xc5a639,_0x5d4e03){return db['Plugin'][_0xd7cf('0x17')](_0x4ccb2b[_0xd7cf('0x18')],{'raw':_0x4ccb2b[_0xd7cf('0x19')]?_0x4ccb2b[_0xd7cf('0x19')]['raw']===undefined?!![]:![]:!![]})[_0xd7cf('0xd')](function(_0x1b3428){logger[_0xd7cf('0xe')](_0xd7cf('0x1a'),_0x4ccb2b);logger[_0xd7cf('0x10')](_0xd7cf('0x1a'),_0x4ccb2b,JSON[_0xd7cf('0x12')](_0x1b3428));_0xc5a639(_0x1b3428);})[_0xd7cf('0x1b')](function(_0x562940){logger[_0xd7cf('0x14')](_0xd7cf('0x1a'),_0x562940['message'],_0x4ccb2b);_0x5d4e03(_0x5babdf[_0xd7cf('0x14')](0x1f4,_0x562940[_0xd7cf('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 33fe8e6..d9e2fa4 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 _0x8c37=['emit','length','./plugin.events','save','remove'];(function(_0x2271fa,_0x35c0ab){var _0x2a1976=function(_0x2b44da){while(--_0x2b44da){_0x2271fa['push'](_0x2271fa['shift']());}};_0x2a1976(++_0x35c0ab);}(_0x8c37,0xd4));var _0x78c3=function(_0x3545c7,_0x517832){_0x3545c7=_0x3545c7-0x0;var _0x7a4602=_0x8c37[_0x3545c7];return _0x7a4602;};'use strict';var PluginEvents=require(_0x78c3('0x0'));var events=[_0x78c3('0x1'),_0x78c3('0x2'),'update'];function createListener(_0x1bdf9d,_0x5707f5){return function(_0x4d8197){_0x5707f5[_0x78c3('0x3')](_0x1bdf9d,_0x4d8197);};}function removeListener(_0x379082,_0x1ae088){return function(){PluginEvents['removeListener'](_0x379082,_0x1ae088);};}exports['register']=function(_0x2ad662){for(var _0xbad19b=0x0,_0x3be54f=events[_0x78c3('0x4')];_0xbad19b<_0x3be54f;_0xbad19b++){var _0x4c5302=events[_0xbad19b];var _0xd9d4e4=createListener('plugin:'+_0x4c5302,_0x2ad662);PluginEvents['on'](_0x4c5302,_0xd9d4e4);}}; \ No newline at end of file +var _0xa91f=['length','plugin:','./plugin.events','remove','update','removeListener','register'];(function(_0x30c9bd,_0x161bfb){var _0x3d0166=function(_0x2879f1){while(--_0x2879f1){_0x30c9bd['push'](_0x30c9bd['shift']());}};_0x3d0166(++_0x161bfb);}(_0xa91f,0x6b));var _0xfa91=function(_0x36c3aa,_0x10854c){_0x36c3aa=_0x36c3aa-0x0;var _0x4f4f40=_0xa91f[_0x36c3aa];return _0x4f4f40;};'use strict';var PluginEvents=require(_0xfa91('0x0'));var events=['save',_0xfa91('0x1'),_0xfa91('0x2')];function createListener(_0x4b89ce,_0x557787){return function(_0x4400f6){_0x557787['emit'](_0x4b89ce,_0x4400f6);};}function removeListener(_0x29401a,_0x41d8f4){return function(){PluginEvents[_0xfa91('0x3')](_0x29401a,_0x41d8f4);};}exports[_0xfa91('0x4')]=function(_0x50fda2){for(var _0x5c4aca=0x0,_0x46bcf4=events[_0xfa91('0x5')];_0x5c4aca<_0x46bcf4;_0x5c4aca++){var _0x479a6b=events[_0x5c4aca];var _0x1dc304=createListener(_0xfa91('0x6')+_0x479a6b,_0x50fda2);PluginEvents['on'](_0x479a6b,_0x1dc304);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 149a366..6d38fe7 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(_0x3b89fe,_0x5239c3){var _0x7898b4=function(_0x3e5e0d){while(--_0x3e5e0d){_0x3b89fe['push'](_0x3b89fe['shift']());}};_0x7898b4(++_0x5239c3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'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(_0x172361,_0x2141f0){var _0x294766=function(_0x244107){while(--_0x244107){_0x172361['push'](_0x172361['shift']());}};_0x294766(++_0x2141f0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'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 a516891..a051072 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 _0x39cb=['create','body','join','../../files/plugins','cwd','chdir','start','send','Missing\x20name\x20and/or\x20path','restart','hasOwnProperty','Unknown\x20status','destroy','delete','dump','Unknown\x20id','../../config/pm2','../../config/logger','path','child_process','bluebird','sendStatus','status','json','error','stack','name','npm\x20install','info','index','then','reject','express','motion2','length','catch','show','describe','params'];(function(_0x41151c,_0x528255){var _0x2d8b0e=function(_0x21293b){while(--_0x21293b){_0x41151c['push'](_0x41151c['shift']());}};_0x2d8b0e(++_0x528255);}(_0x39cb,0x1bd));var _0xb39c=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x39cb[_0x42cae2];return _0x5f256f;};'use strict';var _=require('lodash');var pm2=require(_0xb39c('0x0'));var logger=require(_0xb39c('0x1'))('api');var path=require(_0xb39c('0x2'));var exec=require(_0xb39c('0x3'))['exec'];var BPromise=require(_0xb39c('0x4'));function handleEntityNotFound(_0x285eca,_0x398d07){return function(_0x2bca14){if(!_0x2bca14){_0x285eca[_0xb39c('0x5')](0x194);;}return _0x2bca14;};}function respondWithResult(_0x4ae4cf,_0x32cdcd){_0x32cdcd=_0x32cdcd||0xc8;return function(_0x2fc868){if(_0x2fc868){return _0x4ae4cf[_0xb39c('0x6')](_0x32cdcd)[_0xb39c('0x7')](_0x2fc868);}return null;};}function handleError(_0x47d6d7,_0x5ae14a){_0x5ae14a=_0x5ae14a||0x1f4;return function(_0x41557b){logger[_0xb39c('0x8')](_0x41557b[_0xb39c('0x9')]);if(_0x41557b[_0xb39c('0xa')]){delete _0x41557b['name'];}_0x47d6d7['status'](_0x5ae14a)['send'](_0x41557b);};}function execChildProcess(){return new BPromise(function(_0x1de94f,_0x497ffc){exec(_0xb39c('0xb'),function(_0x1088ee,_0x433ee8,_0x340622){logger[_0xb39c('0xc')](_0x433ee8);logger[_0xb39c('0xc')](_0x340622);if(_0x1088ee){logger['error'](_0x1088ee);return _0x497ffc(_0x1088ee);}return _0x1de94f(_0x433ee8);});});}exports[_0xb39c('0xd')]=function(_0x468995,_0x2620cd){return pm2['list']()[_0xb39c('0xe')](function(_0x40a6d3){if(_0x40a6d3){var _0x42a203=_[_0xb39c('0xf')](_0x40a6d3,function(_0x469fa9){return _0x469fa9[_0xb39c('0xa')]===_0xb39c('0x10')||_0x469fa9['name']===_0xb39c('0x11');});return{'rows':_0x42a203,'count':_0x42a203[_0xb39c('0x12')]};}return null;})[_0xb39c('0xe')](respondWithResult(_0x2620cd,null))[_0xb39c('0x13')](handleError(_0x2620cd,null));};exports[_0xb39c('0x14')]=function(_0x3b7fad,_0x1a2f48){return pm2[_0xb39c('0x15')](_0x3b7fad[_0xb39c('0x16')]['id'])[_0xb39c('0xe')](respondWithResult(_0x1a2f48,null))['then'](handleEntityNotFound(_0x1a2f48,null))[_0xb39c('0x13')](handleError(_0x1a2f48,null));};exports[_0xb39c('0x17')]=function(_0x28bbe1,_0x447352){if(_0x28bbe1['body'][_0xb39c('0xa')]&&_0x28bbe1[_0xb39c('0x18')]['script']){var _0x2d8e93=path[_0xb39c('0x19')](__dirname,_0xb39c('0x1a'),_0x28bbe1['body']['script']);var _0x2789fd=process[_0xb39c('0x1b')]();process[_0xb39c('0x1c')](path['dirname'](_0x2d8e93));return execChildProcess()[_0xb39c('0xe')](function(_0x438207){process[_0xb39c('0x1c')](_0x2789fd);return pm2[_0xb39c('0x1d')]({'name':_0x28bbe1[_0xb39c('0x18')]['name'],'script':_0x2d8e93});})[_0xb39c('0xe')](function(_0xbeab7e){pm2['dump']();return _0xbeab7e[0x0];})[_0xb39c('0xe')](respondWithResult(_0x447352,0xc9))[_0xb39c('0x13')](handleError(_0x447352,null));}else{return _0x447352[_0xb39c('0x6')](0x1f4)[_0xb39c('0x1e')]({'message':_0xb39c('0x1f')});}};exports['update']=function(_0x23a2f1,_0x299c27){if(_0x23a2f1[_0xb39c('0x18')]['id']){delete _0x23a2f1['body']['id'];}var _0x41fff2={'online':_0xb39c('0x20'),'stopped':'stop'};if(_0x41fff2[_0xb39c('0x21')](_0x23a2f1[_0xb39c('0x18')][_0xb39c('0x6')])){return pm2[_0x41fff2[_0x23a2f1['body'][_0xb39c('0x6')]]](_0x23a2f1[_0xb39c('0x16')]['id'])['then'](respondWithResult(_0x299c27,0xc8))[_0xb39c('0x13')](handleError(_0x299c27,null));}else{return _0x299c27['status'](0x1f4)[_0xb39c('0x1e')]({'message':_0xb39c('0x22')});}};exports[_0xb39c('0x23')]=function(_0x7339b4,_0x17eb7b){if(_0x7339b4['body']['id']){delete _0x7339b4[_0xb39c('0x18')]['id'];}if(_0x7339b4['params']['id']){return pm2[_0xb39c('0x24')](_0x7339b4['params']['id'])[_0xb39c('0xe')](function(_0xe2111a){pm2[_0xb39c('0x25')]();return _0xe2111a[0x0];})[_0xb39c('0xe')](respondWithResult(_0x17eb7b,null))['catch'](handleError(_0x17eb7b,null));}else{return _0x17eb7b['status'](0x1f4)[_0xb39c('0x1e')]({'message':_0xb39c('0x26')});}}; \ No newline at end of file +var _0x5ff3=['Unknown\x20id','../../config/pm2','api','child_process','exec','bluebird','sendStatus','json','error','name','status','send','npm\x20install','info','index','list','then','reject','express','motion2','length','catch','show','describe','params','create','body','join','../../files/plugins','chdir','dirname','start','Missing\x20name\x20and/or\x20path','update','restart','hasOwnProperty','Unknown\x20status','delete'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x5ff3,0x17d));var _0x35ff=function(_0x2fdf44,_0x64d681){_0x2fdf44=_0x2fdf44-0x0;var _0x1c3b44=_0x5ff3[_0x2fdf44];return _0x1c3b44;};'use strict';var _=require('lodash');var pm2=require(_0x35ff('0x0'));var logger=require('../../config/logger')(_0x35ff('0x1'));var path=require('path');var exec=require(_0x35ff('0x2'))[_0x35ff('0x3')];var BPromise=require(_0x35ff('0x4'));function handleEntityNotFound(_0xd0846d,_0x551514){return function(_0x2fcb74){if(!_0x2fcb74){_0xd0846d[_0x35ff('0x5')](0x194);;}return _0x2fcb74;};}function respondWithResult(_0x2e9873,_0x11e738){_0x11e738=_0x11e738||0xc8;return function(_0x30c3ff){if(_0x30c3ff){return _0x2e9873['status'](_0x11e738)[_0x35ff('0x6')](_0x30c3ff);}return null;};}function handleError(_0x4c9fab,_0x2e7470){_0x2e7470=_0x2e7470||0x1f4;return function(_0xfcec34){logger[_0x35ff('0x7')](_0xfcec34['stack']);if(_0xfcec34[_0x35ff('0x8')]){delete _0xfcec34['name'];}_0x4c9fab[_0x35ff('0x9')](_0x2e7470)[_0x35ff('0xa')](_0xfcec34);};}function execChildProcess(){return new BPromise(function(_0x57ad20,_0x5c3131){exec(_0x35ff('0xb'),function(_0x574c81,_0x592295,_0x567080){logger[_0x35ff('0xc')](_0x592295);logger[_0x35ff('0xc')](_0x567080);if(_0x574c81){logger[_0x35ff('0x7')](_0x574c81);return _0x5c3131(_0x574c81);}return _0x57ad20(_0x592295);});});}exports[_0x35ff('0xd')]=function(_0x559e33,_0x33154f){return pm2[_0x35ff('0xe')]()[_0x35ff('0xf')](function(_0x4d1d41){if(_0x4d1d41){var _0xff8ac=_[_0x35ff('0x10')](_0x4d1d41,function(_0x254975){return _0x254975[_0x35ff('0x8')]===_0x35ff('0x11')||_0x254975[_0x35ff('0x8')]===_0x35ff('0x12');});return{'rows':_0xff8ac,'count':_0xff8ac[_0x35ff('0x13')]};}return null;})[_0x35ff('0xf')](respondWithResult(_0x33154f,null))[_0x35ff('0x14')](handleError(_0x33154f,null));};exports[_0x35ff('0x15')]=function(_0x3430e2,_0x37ea06){return pm2[_0x35ff('0x16')](_0x3430e2[_0x35ff('0x17')]['id'])['then'](respondWithResult(_0x37ea06,null))[_0x35ff('0xf')](handleEntityNotFound(_0x37ea06,null))[_0x35ff('0x14')](handleError(_0x37ea06,null));};exports[_0x35ff('0x18')]=function(_0x1c0d8c,_0x567bcb){if(_0x1c0d8c['body'][_0x35ff('0x8')]&&_0x1c0d8c[_0x35ff('0x19')]['script']){var _0x238f65=path[_0x35ff('0x1a')](__dirname,_0x35ff('0x1b'),_0x1c0d8c[_0x35ff('0x19')]['script']);var _0x3d60b4=process['cwd']();process[_0x35ff('0x1c')](path[_0x35ff('0x1d')](_0x238f65));return execChildProcess()[_0x35ff('0xf')](function(_0x16a5a0){process[_0x35ff('0x1c')](_0x3d60b4);return pm2[_0x35ff('0x1e')]({'name':_0x1c0d8c[_0x35ff('0x19')]['name'],'script':_0x238f65});})[_0x35ff('0xf')](function(_0x2ffcb){pm2['dump']();return _0x2ffcb[0x0];})[_0x35ff('0xf')](respondWithResult(_0x567bcb,0xc9))['catch'](handleError(_0x567bcb,null));}else{return _0x567bcb['status'](0x1f4)[_0x35ff('0xa')]({'message':_0x35ff('0x1f')});}};exports[_0x35ff('0x20')]=function(_0x11a5eb,_0x302d5a){if(_0x11a5eb['body']['id']){delete _0x11a5eb[_0x35ff('0x19')]['id'];}var _0x412873={'online':_0x35ff('0x21'),'stopped':'stop'};if(_0x412873[_0x35ff('0x22')](_0x11a5eb[_0x35ff('0x19')][_0x35ff('0x9')])){return pm2[_0x412873[_0x11a5eb[_0x35ff('0x19')][_0x35ff('0x9')]]](_0x11a5eb[_0x35ff('0x17')]['id'])[_0x35ff('0xf')](respondWithResult(_0x302d5a,0xc8))[_0x35ff('0x14')](handleError(_0x302d5a,null));}else{return _0x302d5a[_0x35ff('0x9')](0x1f4)['send']({'message':_0x35ff('0x23')});}};exports['destroy']=function(_0x1cb370,_0x257501){if(_0x1cb370[_0x35ff('0x19')]['id']){delete _0x1cb370[_0x35ff('0x19')]['id'];}if(_0x1cb370['params']['id']){return pm2[_0x35ff('0x24')](_0x1cb370['params']['id'])[_0x35ff('0xf')](function(_0xf88865){pm2['dump']();return _0xf88865[0x0];})['then'](respondWithResult(_0x257501,null))[_0x35ff('0x14')](handleError(_0x257501,null));}else{return _0x257501[_0x35ff('0x9')](0x1f4)['send']({'message':_0x35ff('0x25')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index f9fb949..ad68d66 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 _0xc30c=['../../components/auth/service','get','/agents','isAuthenticated','getAgents','/queues','getQueues','exports','express','Router'];(function(_0x15cae3,_0x458cb9){var _0x20596f=function(_0x1ad3e6){while(--_0x1ad3e6){_0x15cae3['push'](_0x15cae3['shift']());}};_0x20596f(++_0x458cb9);}(_0xc30c,0x8a));var _0xcc30=function(_0x22b824,_0x54e2cb){_0x22b824=_0x22b824-0x0;var _0x573452=_0xc30c[_0x22b824];return _0x573452;};'use strict';var express=require(_0xcc30('0x0'));var router=express[_0xcc30('0x1')]();var auth=require(_0xcc30('0x2'));var controller=require('./realtime.controller');router[_0xcc30('0x3')](_0xcc30('0x4'),auth[_0xcc30('0x5')](),controller[_0xcc30('0x6')]);router['get'](_0xcc30('0x7'),auth['isAuthenticated'](),controller[_0xcc30('0x8')]);module[_0xcc30('0x9')]=router; \ No newline at end of file +var _0xa3a8=['../../components/auth/service','./realtime.controller','getAgents','get','/queues','isAuthenticated','getQueues','exports','express','Router'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xa3a8,0x1c0));var _0x8a3a=function(_0x28bc88,_0x519ee8){_0x28bc88=_0x28bc88-0x0;var _0x405c93=_0xa3a8[_0x28bc88];return _0x405c93;};'use strict';var express=require(_0x8a3a('0x0'));var router=express[_0x8a3a('0x1')]();var auth=require(_0x8a3a('0x2'));var controller=require(_0x8a3a('0x3'));router['get']('/agents',auth['isAuthenticated'](),controller[_0x8a3a('0x4')]);router[_0x8a3a('0x5')](_0x8a3a('0x6'),auth[_0x8a3a('0x7')](),controller[_0x8a3a('0x8')]);module[_0x8a3a('0x9')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index 949b19a..7a350d9 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 _0xa9e0=['pause','resolve','then','channel','isValidChannel','format','Channel\x20parameter\x20%s\x20is\x20invalid','toLowerCase','sort','includes','globalStatus','validateSortParameter','getUpdatedSortOptions','fields','join','order','getAgentIdsByQueues','rows','getSortedAgentsIdsByStatus','getAgentIdsByStatus','map','User','rawAttributes','fieldName','type','key','role','agent','getOptions','raw','push','literal','FIELD(id,','forEach','*pause','Pause','merge','user','userProfileId','Agents','extraQueryConditions','assign','getResources','findAndCountAll','filterAgentAttributes','voice','talking','voiceStatus','Status','sortAgentsByStatus','pick','catch','getQueues','startCase','Queue','name','outbound','Queues','filter','UserProfile','lodash','util','../../components/realtime/agents','../../config/utils','../../errors/api','APIBadRequestError','handleError','offset','undefined','count','limit','json','getAgents','getChannels','query','globalStatusFilter','pauseTypeFilter'];(function(_0x108437,_0xc01413){var _0x101be0=function(_0x1ec318){while(--_0x1ec318){_0x108437['push'](_0x108437['shift']());}};_0x101be0(++_0xc01413);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var rta=require(_0x0a9e('0x2'));var rtq=require('../../components/realtime/queues');var qs=require('../../components/parsers/qs');var utils=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var APIBadRequestError=require(_0x0a9e('0x4'))[_0x0a9e('0x5')];var APIHandleError=require(_0x0a9e('0x4'))[_0x0a9e('0x6')];function respondWithFilteredResult(_0x981158,_0x57b080){return function(_0x219af0){if(_0x219af0){var _0x441e3a=typeof _0x57b080[_0x0a9e('0x7')]==='undefined'&&typeof _0x57b080['limit']===_0x0a9e('0x8');var _0x56465b=_0x219af0['count'];var _0x39753a=_0x441e3a?0x0:_0x57b080[_0x0a9e('0x7')];var _0x307b3e=_0x441e3a?_0x219af0[_0x0a9e('0x9')]:_0x57b080[_0x0a9e('0x7')]+_0x57b080[_0x0a9e('0xa')];var _0x4a4c56;if(_0x307b3e>=_0x56465b){_0x307b3e=_0x56465b;_0x4a4c56=0xc8;}else{_0x4a4c56=0xce;}_0x981158['status'](_0x4a4c56);return _0x981158['set']('Content-Range',_0x39753a+'-'+_0x307b3e+'/'+_0x56465b)[_0x0a9e('0xb')](_0x219af0);}return null;};}exports[_0x0a9e('0xc')]=function(_0xd5b662,_0x26d672){var _0x32d742={'count':0x0,'rows':[]};var _0x69aeb7={};var _0x5db4b0;var _0x4283ce=utils[_0x0a9e('0xd')]();var _0x2b4227;var _0x281129;var _0x44dcfd=_0xd5b662[_0x0a9e('0xe')]['globalQueueFilter'];var _0x22dccb=_0xd5b662['query'][_0x0a9e('0xf')];var _0x519dfd=_0xd5b662[_0x0a9e('0xe')][_0x0a9e('0x10')];var _0x48f32d=_0x22dccb===_0x0a9e('0x11')||_0x22dccb==='*pause'?!![]:![];var _0x459eb1=[];var _0x478723;var _0x106033;Promise[_0x0a9e('0x12')]()[_0x0a9e('0x13')](function(){if(_0xd5b662[_0x0a9e('0xe')][_0x0a9e('0x14')]){if(!utils[_0x0a9e('0x15')](_0xd5b662[_0x0a9e('0xe')][_0x0a9e('0x14')])){throw new APIBadRequestError(util[_0x0a9e('0x16')](_0x0a9e('0x17'),_0xd5b662['query'][_0x0a9e('0x14')]));}_0x5db4b0=_0xd5b662[_0x0a9e('0xe')]['channel'][_0x0a9e('0x18')]();}if(!_0xd5b662['query']['sort']||!_0xd5b662[_0x0a9e('0xe')][_0x0a9e('0x19')][_0x0a9e('0x1a')](_0x0a9e('0x1b'))){_0xd5b662['query'][_0x0a9e('0x19')]=rta[_0x0a9e('0x1c')](_0xd5b662[_0x0a9e('0xe')][_0x0a9e('0x19')]);return;}var _0x370d86=rta[_0x0a9e('0x1d')](_0xd5b662[_0x0a9e('0xe')]['sort']);_0xd5b662['query'][_0x0a9e('0x19')]=_0x370d86[_0x0a9e('0x1e')][_0x0a9e('0x1f')](',');_0x478723=_0x370d86[_0x0a9e('0x20')];})['then'](function(){if(!_0x44dcfd){return[];}return rta[_0x0a9e('0x21')](_0x44dcfd,_0x5db4b0);})['then'](function(_0x45a1e7){_0x459eb1=_0x45a1e7;return rta['getRealtimeAgents']();})[_0x0a9e('0x13')](function(_0x34dc65){_0x281129=_0x34dc65[_0x0a9e('0x22')];if((!_0x22dccb||_0x48f32d)&&!_0x478723){return _0x459eb1;}if(_0x478723&&!_0x22dccb){return rta[_0x0a9e('0x23')](_0x281129,_0x459eb1,_0x478723);}else{return rta[_0x0a9e('0x24')](_0x281129,_0x459eb1,_0x22dccb);}})[_0x0a9e('0x13')](function(_0x11c3b6){_0x459eb1=_0x11c3b6;var _0x14de77=![];if(_0x459eb1['length']===0x0){if(_0x44dcfd||_0x22dccb){_0x14de77=!![];}if(_0x48f32d){_0x14de77=![];}}if(_0x14de77){return _0x32d742;}var _0x3652a7=_[_0x0a9e('0x25')](db[_0x0a9e('0x26')][_0x0a9e('0x27')],function(_0x5c877d){return{'name':_0x5c877d[_0x0a9e('0x28')],'type':_0x5c877d[_0x0a9e('0x29')][_0x0a9e('0x2a')]};});_0xd5b662[_0x0a9e('0xe')][_0x0a9e('0x2b')]=_0x0a9e('0x2c');_0x69aeb7=qs[_0x0a9e('0x2d')](_0x3652a7,_0xd5b662);_0x69aeb7[_0x0a9e('0x2e')]=!![];var _0x1dbde2=[];if(_0x459eb1['length']>0x0){_0x1dbde2[_0x0a9e('0x2f')]({'id':{'$in':_0x459eb1}});if(_0x478723&&!_0x22dccb){_0x106033=[db['sequelize'][_0x0a9e('0x30')](_0x0a9e('0x31')+_0x459eb1+')')];_0x69aeb7[_0x0a9e('0x20')]=_0x106033;}}if(_0x48f32d){_0x4283ce[_0x0a9e('0x32')](function(_0x25ce3a){var _0x5180f1=!![];if(_0x22dccb===_0x0a9e('0x33')&&_0x5db4b0!==_0x25ce3a){_0x5180f1=![];}_0x1dbde2[_0x0a9e('0x2f')]({[_0x25ce3a+_0x0a9e('0x34')]:_0x5180f1});});if(_0x519dfd){_0x1dbde2[_0x0a9e('0x2f')]({'pauseType':_0x519dfd});}}else if(_0x22dccb){_0x4283ce[_0x0a9e('0x32')](function(_0x409319){_0x1dbde2[_0x0a9e('0x2f')]({[_0x409319+_0x0a9e('0x34')]:![]});});}_0x69aeb7['where']=_[_0x0a9e('0x35')](_0x69aeb7['where'],{'$and':_0x1dbde2});if(_0xd5b662[_0x0a9e('0x36')][_0x0a9e('0x2b')]===_0x0a9e('0x36')){var _0x3f3d41={'params':{'id':_0xd5b662['user'][_0x0a9e('0x37')]},'query':{'section':_0x0a9e('0x38'),'role':_0x0a9e('0x2c'),'online':_0xd5b662[_0x0a9e('0xe')]['online']===!![]?!![]:![],'raw':!![],'ids':_0x459eb1,'customSorting':_0x106033}};if(_0x48f32d){_0x3f3d41['query'][_0x0a9e('0x39')]=_0x1dbde2;}_0x3f3d41['query']=Object[_0x0a9e('0x3a')](_0x3f3d41[_0x0a9e('0xe')],_0xd5b662[_0x0a9e('0xe')]);delete _0x3f3d41[_0x0a9e('0xe')]['id'];return db['UserProfile'][_0x0a9e('0x3b')](_0x3f3d41);}return db[_0x0a9e('0x26')][_0x0a9e('0x3c')](_0x69aeb7);})['then'](function(_0x1dbf74){_0x32d742[_0x0a9e('0x9')]=_0x1dbf74[_0x0a9e('0x9')];_0x2b4227=_0x1dbf74['rows'];return _0x2b4227['map'](function(_0x11b61d){var _0x40d766=_['find'](_0x281129,['id',_0x11b61d['id']]);if(_0x40d766){var _0x2b814e=rta[_0x0a9e('0x3d')](_0x40d766);_[_0x0a9e('0x35')](_0x11b61d,_0x2b814e);}_0x11b61d[_0x0a9e('0x1b')]=rta['getAgentStatus'](_0x11b61d);if(_0x11b61d['globalStatus'][_0x0a9e('0x1a')](_0x0a9e('0x11'))){_0x4283ce['forEach'](function(_0x183991){if(_0x11b61d[_0x183991+_0x0a9e('0x34')]){if(_0x183991===_0x0a9e('0x3e')){if(_0x11b61d['voiceStatus']!==_0x0a9e('0x3f')){_0x11b61d[_0x0a9e('0x40')]=_0x0a9e('0x11');}}else{_0x11b61d[_0x183991+_0x0a9e('0x41')]=_0x0a9e('0x11');}}});}return _0x11b61d;});})[_0x0a9e('0x13')](function(_0x2881b3){if(!_0x478723||_0x106033){return _0x2881b3;}return rta[_0x0a9e('0x42')](_0x2881b3,_0x478723);})[_0x0a9e('0x13')](function(_0x3da2cd){var _0x2c3711=null;if(_0xd5b662[_0x0a9e('0xe')][_0x0a9e('0x1e')]){var _0x11ca30=_0xd5b662[_0x0a9e('0xe')]['fields']['split'](',');_0x2c3711=_0x3da2cd[_0x0a9e('0x25')](function(_0xb3795a){return _[_0x0a9e('0x43')](_0xb3795a,_0x11ca30);});}_0x32d742[_0x0a9e('0x22')]=_0x2c3711||_0x3da2cd;return _0x32d742;})[_0x0a9e('0x13')](respondWithFilteredResult(_0x26d672,_0x69aeb7))[_0x0a9e('0x44')](APIHandleError(_0x26d672));};exports[_0x0a9e('0x45')]=function(_0x445e25,_0x432fcc){var _0x25c6e6={'count':0x0,'rows':[]};var _0x2c2cb0={};var _0x35ed4a;var _0x5026aa;var _0x117c99;Promise[_0x0a9e('0x12')]()[_0x0a9e('0x13')](function(){if(_0x445e25[_0x0a9e('0xe')][_0x0a9e('0x14')]){if(!utils[_0x0a9e('0x15')](_0x445e25[_0x0a9e('0xe')][_0x0a9e('0x14')])){throw new APIBadRequestError(util['format'](_0x0a9e('0x17'),_0x445e25['query'][_0x0a9e('0x14')]));}_0x35ed4a=_0x445e25[_0x0a9e('0xe')][_0x0a9e('0x14')]['toLowerCase']();}var _0x14bec2=_[_0x0a9e('0x46')](_0x35ed4a)+_0x0a9e('0x47');var _0x34aa5a=_[_0x0a9e('0x25')](db[_0x14bec2][_0x0a9e('0x27')],function(_0x45bf7f){return{'name':_0x45bf7f['fieldName'],'type':_0x45bf7f[_0x0a9e('0x29')][_0x0a9e('0x2a')]};});if(!_0x445e25[_0x0a9e('0xe')][_0x0a9e('0x1e')]){var _0x409789=['id',_0x0a9e('0x48')];if(_0x35ed4a===_0x0a9e('0x3e')){_0x409789[_0x0a9e('0x2f')](_0x0a9e('0x29'));if(_0x445e25['query'][_0x0a9e('0x29')]===_0x0a9e('0x49')){_0x409789['push'](['dialActive','dialMethod']);}}_0x445e25[_0x0a9e('0xe')][_0x0a9e('0x1e')]=_0x409789[_0x0a9e('0x1f')](',');}_0x2c2cb0=qs[_0x0a9e('0x2d')](_0x34aa5a,_0x445e25);if(_0x445e25[_0x0a9e('0x36')][_0x0a9e('0x2b')]===_0x0a9e('0x36')){var _0x375c18={'params':{'id':_0x445e25['user']['userProfileId']},'query':{'section':_0x35ed4a==='voice'&&_0x445e25[_0x0a9e('0xe')][_0x0a9e('0x29')]===_0x0a9e('0x49')?'QueueCampaigns':_[_0x0a9e('0x46')](_0x35ed4a)+_0x0a9e('0x4a'),'type':_0x445e25['query']['type'],'nolimit':!![],'sort':_0x0a9e('0x48'),'filter':_0x445e25['query'][_0x0a9e('0x4b')]}};_0x375c18['query']=Object[_0x0a9e('0x3a')](_0x375c18[_0x0a9e('0xe')],_0x445e25[_0x0a9e('0xe')]);delete _0x375c18['query']['id'];return db[_0x0a9e('0x4c')][_0x0a9e('0x3b')](_0x375c18);}return db[_0x14bec2]['findAndCountAll'](_0x2c2cb0);})['then'](function(_0x128aa6){_0x25c6e6[_0x0a9e('0x9')]=_0x128aa6['count'];_0x5026aa=_0x128aa6[_0x0a9e('0x22')];return rtq['getRealtimeQueues'](_0x445e25,_0x35ed4a);})[_0x0a9e('0x13')](function(_0x523cd2){_0x117c99=_0x523cd2[_0x0a9e('0x22')];return rtq['initializeQueues'](_0x5026aa,_0x117c99,_0x35ed4a,_0x445e25['query']['type']);})[_0x0a9e('0x13')](function(_0x47de4c){_0x25c6e6[_0x0a9e('0x22')]=_0x47de4c;return _0x25c6e6;})[_0x0a9e('0x13')](respondWithFilteredResult(_0x432fcc,_0x2c2cb0))[_0x0a9e('0x44')](APIHandleError(_0x432fcc));}; \ No newline at end of file +var _0xa9e0=['pause','resolve','then','channel','isValidChannel','format','Channel\x20parameter\x20%s\x20is\x20invalid','toLowerCase','sort','includes','globalStatus','validateSortParameter','getUpdatedSortOptions','fields','join','order','getAgentIdsByQueues','rows','getSortedAgentsIdsByStatus','getAgentIdsByStatus','map','User','rawAttributes','fieldName','type','key','role','agent','getOptions','raw','push','literal','FIELD(id,','forEach','*pause','Pause','merge','user','userProfileId','Agents','extraQueryConditions','assign','getResources','findAndCountAll','filterAgentAttributes','voice','talking','voiceStatus','Status','sortAgentsByStatus','pick','catch','getQueues','startCase','Queue','name','outbound','Queues','filter','UserProfile','lodash','util','../../components/realtime/agents','../../config/utils','../../errors/api','APIBadRequestError','handleError','offset','undefined','count','limit','json','getAgents','getChannels','query','globalStatusFilter','pauseTypeFilter'];(function(_0x29c1c0,_0x4b9049){var _0x31f4ac=function(_0x468580){while(--_0x468580){_0x29c1c0['push'](_0x29c1c0['shift']());}};_0x31f4ac(++_0x4b9049);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var rta=require(_0x0a9e('0x2'));var rtq=require('../../components/realtime/queues');var qs=require('../../components/parsers/qs');var utils=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var APIBadRequestError=require(_0x0a9e('0x4'))[_0x0a9e('0x5')];var APIHandleError=require(_0x0a9e('0x4'))[_0x0a9e('0x6')];function respondWithFilteredResult(_0x981158,_0x57b080){return function(_0x219af0){if(_0x219af0){var _0x441e3a=typeof _0x57b080[_0x0a9e('0x7')]==='undefined'&&typeof _0x57b080['limit']===_0x0a9e('0x8');var _0x56465b=_0x219af0['count'];var _0x39753a=_0x441e3a?0x0:_0x57b080[_0x0a9e('0x7')];var _0x307b3e=_0x441e3a?_0x219af0[_0x0a9e('0x9')]:_0x57b080[_0x0a9e('0x7')]+_0x57b080[_0x0a9e('0xa')];var _0x4a4c56;if(_0x307b3e>=_0x56465b){_0x307b3e=_0x56465b;_0x4a4c56=0xc8;}else{_0x4a4c56=0xce;}_0x981158['status'](_0x4a4c56);return _0x981158['set']('Content-Range',_0x39753a+'-'+_0x307b3e+'/'+_0x56465b)[_0x0a9e('0xb')](_0x219af0);}return null;};}exports[_0x0a9e('0xc')]=function(_0xd5b662,_0x26d672){var _0x32d742={'count':0x0,'rows':[]};var _0x69aeb7={};var _0x5db4b0;var _0x4283ce=utils[_0x0a9e('0xd')]();var _0x2b4227;var _0x281129;var _0x44dcfd=_0xd5b662[_0x0a9e('0xe')]['globalQueueFilter'];var _0x22dccb=_0xd5b662['query'][_0x0a9e('0xf')];var _0x519dfd=_0xd5b662[_0x0a9e('0xe')][_0x0a9e('0x10')];var _0x48f32d=_0x22dccb===_0x0a9e('0x11')||_0x22dccb==='*pause'?!![]:![];var _0x459eb1=[];var _0x478723;var _0x106033;Promise[_0x0a9e('0x12')]()[_0x0a9e('0x13')](function(){if(_0xd5b662[_0x0a9e('0xe')][_0x0a9e('0x14')]){if(!utils[_0x0a9e('0x15')](_0xd5b662[_0x0a9e('0xe')][_0x0a9e('0x14')])){throw new APIBadRequestError(util[_0x0a9e('0x16')](_0x0a9e('0x17'),_0xd5b662['query'][_0x0a9e('0x14')]));}_0x5db4b0=_0xd5b662[_0x0a9e('0xe')]['channel'][_0x0a9e('0x18')]();}if(!_0xd5b662['query']['sort']||!_0xd5b662[_0x0a9e('0xe')][_0x0a9e('0x19')][_0x0a9e('0x1a')](_0x0a9e('0x1b'))){_0xd5b662['query'][_0x0a9e('0x19')]=rta[_0x0a9e('0x1c')](_0xd5b662[_0x0a9e('0xe')][_0x0a9e('0x19')]);return;}var _0x370d86=rta[_0x0a9e('0x1d')](_0xd5b662[_0x0a9e('0xe')]['sort']);_0xd5b662['query'][_0x0a9e('0x19')]=_0x370d86[_0x0a9e('0x1e')][_0x0a9e('0x1f')](',');_0x478723=_0x370d86[_0x0a9e('0x20')];})['then'](function(){if(!_0x44dcfd){return[];}return rta[_0x0a9e('0x21')](_0x44dcfd,_0x5db4b0);})['then'](function(_0x45a1e7){_0x459eb1=_0x45a1e7;return rta['getRealtimeAgents']();})[_0x0a9e('0x13')](function(_0x34dc65){_0x281129=_0x34dc65[_0x0a9e('0x22')];if((!_0x22dccb||_0x48f32d)&&!_0x478723){return _0x459eb1;}if(_0x478723&&!_0x22dccb){return rta[_0x0a9e('0x23')](_0x281129,_0x459eb1,_0x478723);}else{return rta[_0x0a9e('0x24')](_0x281129,_0x459eb1,_0x22dccb);}})[_0x0a9e('0x13')](function(_0x11c3b6){_0x459eb1=_0x11c3b6;var _0x14de77=![];if(_0x459eb1['length']===0x0){if(_0x44dcfd||_0x22dccb){_0x14de77=!![];}if(_0x48f32d){_0x14de77=![];}}if(_0x14de77){return _0x32d742;}var _0x3652a7=_[_0x0a9e('0x25')](db[_0x0a9e('0x26')][_0x0a9e('0x27')],function(_0x5c877d){return{'name':_0x5c877d[_0x0a9e('0x28')],'type':_0x5c877d[_0x0a9e('0x29')][_0x0a9e('0x2a')]};});_0xd5b662[_0x0a9e('0xe')][_0x0a9e('0x2b')]=_0x0a9e('0x2c');_0x69aeb7=qs[_0x0a9e('0x2d')](_0x3652a7,_0xd5b662);_0x69aeb7[_0x0a9e('0x2e')]=!![];var _0x1dbde2=[];if(_0x459eb1['length']>0x0){_0x1dbde2[_0x0a9e('0x2f')]({'id':{'$in':_0x459eb1}});if(_0x478723&&!_0x22dccb){_0x106033=[db['sequelize'][_0x0a9e('0x30')](_0x0a9e('0x31')+_0x459eb1+')')];_0x69aeb7[_0x0a9e('0x20')]=_0x106033;}}if(_0x48f32d){_0x4283ce[_0x0a9e('0x32')](function(_0x25ce3a){var _0x5180f1=!![];if(_0x22dccb===_0x0a9e('0x33')&&_0x5db4b0!==_0x25ce3a){_0x5180f1=![];}_0x1dbde2[_0x0a9e('0x2f')]({[_0x25ce3a+_0x0a9e('0x34')]:_0x5180f1});});if(_0x519dfd){_0x1dbde2[_0x0a9e('0x2f')]({'pauseType':_0x519dfd});}}else if(_0x22dccb){_0x4283ce[_0x0a9e('0x32')](function(_0x409319){_0x1dbde2[_0x0a9e('0x2f')]({[_0x409319+_0x0a9e('0x34')]:![]});});}_0x69aeb7['where']=_[_0x0a9e('0x35')](_0x69aeb7['where'],{'$and':_0x1dbde2});if(_0xd5b662[_0x0a9e('0x36')][_0x0a9e('0x2b')]===_0x0a9e('0x36')){var _0x3f3d41={'params':{'id':_0xd5b662['user'][_0x0a9e('0x37')]},'query':{'section':_0x0a9e('0x38'),'role':_0x0a9e('0x2c'),'online':_0xd5b662[_0x0a9e('0xe')]['online']===!![]?!![]:![],'raw':!![],'ids':_0x459eb1,'customSorting':_0x106033}};if(_0x48f32d){_0x3f3d41['query'][_0x0a9e('0x39')]=_0x1dbde2;}_0x3f3d41['query']=Object[_0x0a9e('0x3a')](_0x3f3d41[_0x0a9e('0xe')],_0xd5b662[_0x0a9e('0xe')]);delete _0x3f3d41[_0x0a9e('0xe')]['id'];return db['UserProfile'][_0x0a9e('0x3b')](_0x3f3d41);}return db[_0x0a9e('0x26')][_0x0a9e('0x3c')](_0x69aeb7);})['then'](function(_0x1dbf74){_0x32d742[_0x0a9e('0x9')]=_0x1dbf74[_0x0a9e('0x9')];_0x2b4227=_0x1dbf74['rows'];return _0x2b4227['map'](function(_0x11b61d){var _0x40d766=_['find'](_0x281129,['id',_0x11b61d['id']]);if(_0x40d766){var _0x2b814e=rta[_0x0a9e('0x3d')](_0x40d766);_[_0x0a9e('0x35')](_0x11b61d,_0x2b814e);}_0x11b61d[_0x0a9e('0x1b')]=rta['getAgentStatus'](_0x11b61d);if(_0x11b61d['globalStatus'][_0x0a9e('0x1a')](_0x0a9e('0x11'))){_0x4283ce['forEach'](function(_0x183991){if(_0x11b61d[_0x183991+_0x0a9e('0x34')]){if(_0x183991===_0x0a9e('0x3e')){if(_0x11b61d['voiceStatus']!==_0x0a9e('0x3f')){_0x11b61d[_0x0a9e('0x40')]=_0x0a9e('0x11');}}else{_0x11b61d[_0x183991+_0x0a9e('0x41')]=_0x0a9e('0x11');}}});}return _0x11b61d;});})[_0x0a9e('0x13')](function(_0x2881b3){if(!_0x478723||_0x106033){return _0x2881b3;}return rta[_0x0a9e('0x42')](_0x2881b3,_0x478723);})[_0x0a9e('0x13')](function(_0x3da2cd){var _0x2c3711=null;if(_0xd5b662[_0x0a9e('0xe')][_0x0a9e('0x1e')]){var _0x11ca30=_0xd5b662[_0x0a9e('0xe')]['fields']['split'](',');_0x2c3711=_0x3da2cd[_0x0a9e('0x25')](function(_0xb3795a){return _[_0x0a9e('0x43')](_0xb3795a,_0x11ca30);});}_0x32d742[_0x0a9e('0x22')]=_0x2c3711||_0x3da2cd;return _0x32d742;})[_0x0a9e('0x13')](respondWithFilteredResult(_0x26d672,_0x69aeb7))[_0x0a9e('0x44')](APIHandleError(_0x26d672));};exports[_0x0a9e('0x45')]=function(_0x445e25,_0x432fcc){var _0x25c6e6={'count':0x0,'rows':[]};var _0x2c2cb0={};var _0x35ed4a;var _0x5026aa;var _0x117c99;Promise[_0x0a9e('0x12')]()[_0x0a9e('0x13')](function(){if(_0x445e25[_0x0a9e('0xe')][_0x0a9e('0x14')]){if(!utils[_0x0a9e('0x15')](_0x445e25[_0x0a9e('0xe')][_0x0a9e('0x14')])){throw new APIBadRequestError(util['format'](_0x0a9e('0x17'),_0x445e25['query'][_0x0a9e('0x14')]));}_0x35ed4a=_0x445e25[_0x0a9e('0xe')][_0x0a9e('0x14')]['toLowerCase']();}var _0x14bec2=_[_0x0a9e('0x46')](_0x35ed4a)+_0x0a9e('0x47');var _0x34aa5a=_[_0x0a9e('0x25')](db[_0x14bec2][_0x0a9e('0x27')],function(_0x45bf7f){return{'name':_0x45bf7f['fieldName'],'type':_0x45bf7f[_0x0a9e('0x29')][_0x0a9e('0x2a')]};});if(!_0x445e25[_0x0a9e('0xe')][_0x0a9e('0x1e')]){var _0x409789=['id',_0x0a9e('0x48')];if(_0x35ed4a===_0x0a9e('0x3e')){_0x409789[_0x0a9e('0x2f')](_0x0a9e('0x29'));if(_0x445e25['query'][_0x0a9e('0x29')]===_0x0a9e('0x49')){_0x409789['push'](['dialActive','dialMethod']);}}_0x445e25[_0x0a9e('0xe')][_0x0a9e('0x1e')]=_0x409789[_0x0a9e('0x1f')](',');}_0x2c2cb0=qs[_0x0a9e('0x2d')](_0x34aa5a,_0x445e25);if(_0x445e25[_0x0a9e('0x36')][_0x0a9e('0x2b')]===_0x0a9e('0x36')){var _0x375c18={'params':{'id':_0x445e25['user']['userProfileId']},'query':{'section':_0x35ed4a==='voice'&&_0x445e25[_0x0a9e('0xe')][_0x0a9e('0x29')]===_0x0a9e('0x49')?'QueueCampaigns':_[_0x0a9e('0x46')](_0x35ed4a)+_0x0a9e('0x4a'),'type':_0x445e25['query']['type'],'nolimit':!![],'sort':_0x0a9e('0x48'),'filter':_0x445e25['query'][_0x0a9e('0x4b')]}};_0x375c18['query']=Object[_0x0a9e('0x3a')](_0x375c18[_0x0a9e('0xe')],_0x445e25[_0x0a9e('0xe')]);delete _0x375c18['query']['id'];return db[_0x0a9e('0x4c')][_0x0a9e('0x3b')](_0x375c18);}return db[_0x14bec2]['findAndCountAll'](_0x2c2cb0);})['then'](function(_0x128aa6){_0x25c6e6[_0x0a9e('0x9')]=_0x128aa6['count'];_0x5026aa=_0x128aa6[_0x0a9e('0x22')];return rtq['getRealtimeQueues'](_0x445e25,_0x35ed4a);})[_0x0a9e('0x13')](function(_0x523cd2){_0x117c99=_0x523cd2[_0x0a9e('0x22')];return rtq['initializeQueues'](_0x5026aa,_0x117c99,_0x35ed4a,_0x445e25['query']['type']);})[_0x0a9e('0x13')](function(_0x47de4c){_0x25c6e6[_0x0a9e('0x22')]=_0x47de4c;return _0x25c6e6;})[_0x0a9e('0x13')](respondWithFilteredResult(_0x432fcc,_0x2c2cb0))[_0x0a9e('0x44')](APIHandleError(_0x432fcc));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 1d56c77..ec2b10d 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(_0x231751,_0x73e501){var _0x3d6d05=function(_0x2197b5){while(--_0x2197b5){_0x231751['push'](_0x231751['shift']());}};_0x3d6d05(++_0x73e501);}(_0x70e0,0x17b));var _0x070e=function(_0x78799f,_0xef51f2){_0x78799f=_0x78799f-0x0;var _0x5904ea=_0x70e0[_0x78799f];return _0x5904ea;};'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(_0x1d1f8f,_0x503031){var _0x2243a2=function(_0x4063be){while(--_0x4063be){_0x1d1f8f['push'](_0x1d1f8f['shift']());}};_0x2243a2(++_0x503031);}(_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 9290426..f44c62f 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 _0x5e11=['INTEGER','STRING','DATE','sequelize'];(function(_0x4fdd33,_0xc613e4){var _0x393a24=function(_0x29982e){while(--_0x29982e){_0x4fdd33['push'](_0x4fdd33['shift']());}};_0x393a24(++_0xc613e4);}(_0x5e11,0x1c3));var _0x15e1=function(_0x54a9e3,_0x4a3813){_0x54a9e3=_0x54a9e3-0x0;var _0x247cce=_0x5e11[_0x54a9e3];return _0x247cce;};'use strict';var Sequelize=require(_0x15e1('0x0'));module['exports']={'state':{'type':Sequelize[_0x15e1('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x15e1('0x2')]},'scheduledat':{'type':Sequelize[_0x15e1('0x3')]},'uniqueid':{'type':Sequelize[_0x15e1('0x2')]},'starttime':{'type':Sequelize[_0x15e1('0x3')]},'responsetime':{'type':Sequelize[_0x15e1('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x15e1('0x2')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x15e1('0x2')]}}; \ No newline at end of file +var _0xb0df=['DATE','exports','INTEGER','STRING'];(function(_0x397cfb,_0xb8f317){var _0x15fed9=function(_0x3eba43){while(--_0x3eba43){_0x397cfb['push'](_0x397cfb['shift']());}};_0x15fed9(++_0xb8f317);}(_0xb0df,0x85));var _0xfb0d=function(_0xa3fadc,_0xd1e16){_0xa3fadc=_0xa3fadc-0x0;var _0x23ecb8=_0xb0df[_0xa3fadc];return _0x23ecb8;};'use strict';var Sequelize=require('sequelize');module[_0xfb0d('0x0')]={'state':{'type':Sequelize[_0xfb0d('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xfb0d('0x2')]},'scheduledat':{'type':Sequelize[_0xfb0d('0x3')]},'uniqueid':{'type':Sequelize[_0xfb0d('0x2')]},'starttime':{'type':Sequelize[_0xfb0d('0x3')]},'responsetime':{'type':Sequelize[_0xfb0d('0x3')]},'ringtime':{'type':Sequelize[_0xfb0d('0x1')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xfb0d('0x2')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xfb0d('0x2')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index af3f39b..a13d62c 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 _0x4c4b=['path','rimraf','../../config/environment','./reportAgentPreview.attributes','define','report_agent_preview','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x2f23cd,_0xc6a258){var _0x3156a5=function(_0x4ef51f){while(--_0x4ef51f){_0x2f23cd['push'](_0x2f23cd['shift']());}};_0x3156a5(++_0xc6a258);}(_0x4c4b,0x126));var _0xb4c4=function(_0xee2e7a,_0x58354d){_0xee2e7a=_0xee2e7a-0x0;var _0x319dd3=_0x4c4b[_0xee2e7a];return _0x319dd3;};'use strict';var _=require(_0xb4c4('0x0'));var util=require(_0xb4c4('0x1'));var logger=require(_0xb4c4('0x2'))(_0xb4c4('0x3'));var moment=require(_0xb4c4('0x4'));var BPromise=require(_0xb4c4('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb4c4('0x6'));var rimraf=require(_0xb4c4('0x7'));var config=require(_0xb4c4('0x8'));var attributes=require(_0xb4c4('0x9'));module['exports']=function(_0x5dfcc9,_0x39c8fa){return _0x5dfcc9[_0xb4c4('0xa')]('ReportAgentPreview',attributes,{'tableName':_0xb4c4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xae56=['bluebird','request-promise','path','../../config/environment','exports','define','ReportAgentPreview','report_agent_preview','lodash','../../config/logger','moment'];(function(_0x212d95,_0x5ed711){var _0x7da972=function(_0x588aa0){while(--_0x588aa0){_0x212d95['push'](_0x212d95['shift']());}};_0x7da972(++_0x5ed711);}(_0xae56,0xc3));var _0x6ae5=function(_0x57a872,_0x3cc7f4){_0x57a872=_0x57a872-0x0;var _0x2d12ac=_0xae56[_0x57a872];return _0x2d12ac;};'use strict';var _=require(_0x6ae5('0x0'));var util=require('util');var logger=require(_0x6ae5('0x1'))('api');var moment=require(_0x6ae5('0x2'));var BPromise=require(_0x6ae5('0x3'));var rp=require(_0x6ae5('0x4'));var fs=require('fs');var path=require(_0x6ae5('0x5'));var rimraf=require('rimraf');var config=require(_0x6ae5('0x6'));var attributes=require('./reportAgentPreview.attributes');module[_0x6ae5('0x7')]=function(_0x36aa19,_0x205e47){return _0x36aa19[_0x6ae5('0x8')](_0x6ae5('0x9'),attributes,{'tableName':_0x6ae5('0xa'),'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 840f0d5..253a71b 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 _0xf22c=['debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CreateReportAgentPreview','ReportAgentPreview','create','options','info','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','client','http','request','then','ReportAgentPreview,\x20%s,\x20%s','request\x20sent'];(function(_0x10756f,_0x632019){var _0x5d9542=function(_0x4e87d4){while(--_0x4e87d4){_0x10756f['push'](_0x10756f['shift']());}};_0x5d9542(++_0x632019);}(_0xf22c,0x88));var _0xcf22=function(_0x39ee75,_0x3227ca){_0x39ee75=_0x39ee75-0x0;var _0x100cfd=_0xf22c[_0x39ee75];return _0x100cfd;};'use strict';var _=require(_0xcf22('0x0'));var util=require(_0xcf22('0x1'));var moment=require(_0xcf22('0x2'));var BPromise=require(_0xcf22('0x3'));var rs=require(_0xcf22('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xcf22('0x5'))(_0xcf22('0x6'));var config=require(_0xcf22('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xcf22('0x8')][_0xcf22('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xb0b377,_0x2b85f1,_0xd5f5a7){return new BPromise(function(_0x465376,_0x25581c){return client[_0xcf22('0xa')](_0xb0b377,_0xd5f5a7)[_0xcf22('0xb')](function(_0xbbf3de){logger['info'](_0xcf22('0xc'),_0x2b85f1,_0xcf22('0xd'));logger[_0xcf22('0xe')](_0xcf22('0xf'),_0x2b85f1,'request\x20sent',JSON[_0xcf22('0x10')](_0xbbf3de));if(_0xbbf3de['error']){if(_0xbbf3de[_0xcf22('0x11')]['code']===0x1f4){logger[_0xcf22('0x11')](_0xcf22('0xc'),_0x2b85f1,_0xbbf3de[_0xcf22('0x11')][_0xcf22('0x12')]);return _0x25581c(_0xbbf3de['error']['message']);}logger['error'](_0xcf22('0xc'),_0x2b85f1,_0xbbf3de[_0xcf22('0x11')]['message']);return _0x465376(_0xbbf3de['error']['message']);}else{logger['info'](_0xcf22('0xc'),_0x2b85f1,_0xcf22('0xd'));_0x465376(_0xbbf3de[_0xcf22('0x13')]['message']);}})['catch'](function(_0x10940e){logger[_0xcf22('0x11')]('ReportAgentPreview,\x20%s,\x20%s',_0x2b85f1,_0x10940e);_0x25581c(_0x10940e);});});}exports[_0xcf22('0x14')]=function(_0x46e5e3){var _0x3dd687=this;return new Promise(function(_0x4ee918,_0x3fa154){return db[_0xcf22('0x15')][_0xcf22('0x16')](_0x46e5e3['body'],{'raw':_0x46e5e3[_0xcf22('0x17')]?_0x46e5e3['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4d390c){logger[_0xcf22('0x18')](_0xcf22('0x14'),_0x46e5e3);logger[_0xcf22('0xe')](_0xcf22('0x14'),_0x46e5e3,JSON[_0xcf22('0x10')](_0x4d390c));_0x4ee918(_0x4d390c);})['catch'](function(_0x3e3ff9){logger[_0xcf22('0x11')](_0xcf22('0x14'),_0x3e3ff9['message'],_0x46e5e3);_0x3fa154(_0x3dd687['error'](0x1f4,_0x3e3ff9['message']));});});}; \ No newline at end of file +var _0xe61b=['../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','ReportAgentPreview,\x20%s,\x20%s','ReportAgentPreview,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','result','catch','CreateReportAgentPreview','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0xe61b,0xb6));var _0xbe61=function(_0x43aee5,_0x11268b){_0x43aee5=_0x43aee5-0x0;var _0x76d1d0=_0xe61b[_0x43aee5];return _0x76d1d0;};'use strict';var _=require(_0xbe61('0x0'));var util=require(_0xbe61('0x1'));var moment=require(_0xbe61('0x2'));var BPromise=require(_0xbe61('0x3'));var rs=require(_0xbe61('0x4'));var fs=require('fs');var Redis=require(_0xbe61('0x5'));var db=require(_0xbe61('0x6'))['db'];var utils=require(_0xbe61('0x7'));var logger=require(_0xbe61('0x8'))(_0xbe61('0x9'));var config=require(_0xbe61('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xbe61('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x45f001,_0x188b2c,_0xc61e8d){return new BPromise(function(_0x145d33,_0x4bdd46){return client[_0xbe61('0xc')](_0x45f001,_0xc61e8d)[_0xbe61('0xd')](function(_0x17e93e){logger['info'](_0xbe61('0xe'),_0x188b2c,'request\x20sent');logger['debug'](_0xbe61('0xf'),_0x188b2c,_0xbe61('0x10'),JSON['stringify'](_0x17e93e));if(_0x17e93e[_0xbe61('0x11')]){if(_0x17e93e[_0xbe61('0x11')]['code']===0x1f4){logger[_0xbe61('0x11')]('ReportAgentPreview,\x20%s,\x20%s',_0x188b2c,_0x17e93e[_0xbe61('0x11')][_0xbe61('0x12')]);return _0x4bdd46(_0x17e93e[_0xbe61('0x11')][_0xbe61('0x12')]);}logger['error'](_0xbe61('0xe'),_0x188b2c,_0x17e93e['error'][_0xbe61('0x12')]);return _0x145d33(_0x17e93e[_0xbe61('0x11')][_0xbe61('0x12')]);}else{logger[_0xbe61('0x13')](_0xbe61('0xe'),_0x188b2c,_0xbe61('0x10'));_0x145d33(_0x17e93e[_0xbe61('0x14')][_0xbe61('0x12')]);}})[_0xbe61('0x15')](function(_0x43ac67){logger[_0xbe61('0x11')](_0xbe61('0xe'),_0x188b2c,_0x43ac67);_0x4bdd46(_0x43ac67);});});}exports[_0xbe61('0x16')]=function(_0x2fa207){var _0x5be65f=this;return new Promise(function(_0x2e2476,_0x130528){return db['ReportAgentPreview'][_0xbe61('0x17')](_0x2fa207[_0xbe61('0x18')],{'raw':_0x2fa207[_0xbe61('0x19')]?_0x2fa207[_0xbe61('0x19')][_0xbe61('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x297cd8){logger[_0xbe61('0x13')](_0xbe61('0x16'),_0x2fa207);logger['debug'](_0xbe61('0x16'),_0x2fa207,JSON['stringify'](_0x297cd8));_0x2e2476(_0x297cd8);})['catch'](function(_0x14afcf){logger[_0xbe61('0x11')]('CreateReportAgentPreview',_0x14afcf[_0xbe61('0x12')],_0x2fa207);_0x130528(_0x5be65f[_0xbe61('0x11')](0x1f4,_0x14afcf[_0xbe61('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 4b09744..52f317e 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 _0x05e2=['Router','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/queues','voiceQueues','/chat/queues','mailQueues','mailAccounts','/openchannel/queues','openchannelQueues','smsQueues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','put','updateVoiceQueue','/outbound','outbound','/outbound/channels','outboundChannels','/agents','/agents/:id/capacity','/telephones','telephones','/trunks','trunks','campaigns','/fax/accounts','faxAccounts','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','queueNotify','mail','/mail/queues/:id','showMailQueues','post','chat','/chat/queues/:id','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','/whatsapp/queues/:id/notify','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','multer','util','path','express'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x05e2,0xe0));var _0x205e=function(_0x2db12b,_0x30ab1d){_0x2db12b=_0x2db12b-0x0;var _0x20990b=_0x05e2[_0x2db12b];return _0x20990b;};'use strict';var multer=require(_0x205e('0x0'));var util=require(_0x205e('0x1'));var path=require(_0x205e('0x2'));var express=require(_0x205e('0x3'));var router=express[_0x205e('0x4')]();var auth=require(_0x205e('0x5'));var controller=require(_0x205e('0x6'));router[_0x205e('0x7')](_0x205e('0x8'),auth[_0x205e('0x9')](),controller[_0x205e('0xa')]);router[_0x205e('0x7')](_0x205e('0xb'),auth[_0x205e('0x9')](),controller[_0x205e('0xc')]);router[_0x205e('0x7')]('/voice/channels/:uniqueid/stopmixmonitor',auth[_0x205e('0x9')](),controller['voiceChannelStopMixMonitor']);router[_0x205e('0x7')](_0x205e('0xd'),auth['isAuthenticated'](),controller[_0x205e('0xe')]);router[_0x205e('0x7')](_0x205e('0xf'),auth[_0x205e('0x9')](),controller['chatQueues']);router[_0x205e('0x7')]('/mail/queues',auth[_0x205e('0x9')](),controller[_0x205e('0x10')]);router[_0x205e('0x7')]('/mail/accounts',auth['isAuthenticated'](),controller[_0x205e('0x11')]);router['get'](_0x205e('0x12'),auth['isAuthenticated'](),controller[_0x205e('0x13')]);router[_0x205e('0x7')]('/sms/queues',auth[_0x205e('0x9')](),controller[_0x205e('0x14')]);router[_0x205e('0x7')]('/whatsapp/queues',auth[_0x205e('0x9')](),controller[_0x205e('0x15')]);router[_0x205e('0x7')](_0x205e('0x16'),auth[_0x205e('0x9')](),controller[_0x205e('0x17')]);router[_0x205e('0x7')](_0x205e('0x18'),auth[_0x205e('0x9')](),controller['voiceQueuesPreview']);router[_0x205e('0x7')](_0x205e('0x19'),auth[_0x205e('0x9')](),controller[_0x205e('0x1a')]);router[_0x205e('0x7')](_0x205e('0x1b'),auth[_0x205e('0x9')](),controller[_0x205e('0x1c')]);router[_0x205e('0x7')](_0x205e('0x1d'),auth[_0x205e('0x9')](),controller[_0x205e('0x1e')]);router[_0x205e('0x7')](_0x205e('0x1f'),auth['isAuthenticated'](),controller[_0x205e('0x20')]);router[_0x205e('0x7')](_0x205e('0x21'),auth[_0x205e('0x9')](),controller['showVoiceQueues']);router[_0x205e('0x22')](_0x205e('0x21'),auth['isAuthenticated'](),controller[_0x205e('0x23')]);router['get'](_0x205e('0x24'),auth[_0x205e('0x9')](),controller[_0x205e('0x25')]);router[_0x205e('0x7')](_0x205e('0x26'),auth[_0x205e('0x9')](),controller[_0x205e('0x27')]);router['get'](_0x205e('0x28'),auth[_0x205e('0x9')](),controller['agents']);router[_0x205e('0x22')](_0x205e('0x29'),auth[_0x205e('0x9')](),controller['agentCapacity']);router[_0x205e('0x7')](_0x205e('0x2a'),auth[_0x205e('0x9')](),controller[_0x205e('0x2b')]);router[_0x205e('0x7')](_0x205e('0x2c'),auth[_0x205e('0x9')](),controller[_0x205e('0x2d')]);router[_0x205e('0x7')]('/campaigns',auth[_0x205e('0x9')](),controller[_0x205e('0x2e')]);router[_0x205e('0x7')](_0x205e('0x2f'),auth['isAuthenticated'](),controller[_0x205e('0x30')]);router['get']('/chat/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0x205e('0x31')]);router[_0x205e('0x7')](_0x205e('0x32'),auth[_0x205e('0x9')](),controller['mailQueuesWaitingInteractions']);router[_0x205e('0x7')]('/openchannel/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0x205e('0x33')]);router[_0x205e('0x7')]('/openchannel/queues/:id/waitinginteractions',auth[_0x205e('0x9')](),controller['openchannelQueuesIdWaitingInteractions']);router[_0x205e('0x7')]('/sms/queues/waitinginteractions',auth[_0x205e('0x9')](),controller['smsQueuesWaitingInteractions']);router[_0x205e('0x7')](_0x205e('0x34'),auth[_0x205e('0x9')](),controller['whatsappQueuesWaitingInteractions']);router[_0x205e('0x7')](_0x205e('0x35'),auth[_0x205e('0x9')](),controller[_0x205e('0x36')]);router['post']('/mail/queues/:id/notify',auth[_0x205e('0x9')](),controller[_0x205e('0x37')](_0x205e('0x38')));router[_0x205e('0x7')](_0x205e('0x39'),auth['isAuthenticated'](),controller[_0x205e('0x3a')]);router[_0x205e('0x3b')]('/chat/queues/:id/notify',auth[_0x205e('0x9')](),controller[_0x205e('0x37')](_0x205e('0x3c')));router['get'](_0x205e('0x3d'),auth['isAuthenticated'](),controller['showChatQueues']);router[_0x205e('0x3b')]('/fax/queues/:id/notify',auth['isAuthenticated'](),controller['queueNotify']('fax'));router[_0x205e('0x7')](_0x205e('0x3e'),auth[_0x205e('0x9')](),controller[_0x205e('0x3f')]);router[_0x205e('0x3b')](_0x205e('0x40'),auth[_0x205e('0x9')](),controller[_0x205e('0x37')]('openchannel'));router[_0x205e('0x7')](_0x205e('0x41'),auth[_0x205e('0x9')](),controller[_0x205e('0x42')]);router[_0x205e('0x3b')](_0x205e('0x43'),auth[_0x205e('0x9')](),controller[_0x205e('0x37')]('sms'));router['post'](_0x205e('0x44'),auth[_0x205e('0x9')](),controller[_0x205e('0x37')]('whatsapp'));router['get'](_0x205e('0x45'),auth['isAuthenticated'](),controller[_0x205e('0x46')]);router[_0x205e('0x7')](_0x205e('0x47'),auth[_0x205e('0x9')](),controller[_0x205e('0x48')]);router[_0x205e('0x3b')](_0x205e('0x49'),auth[_0x205e('0x9')](),controller[_0x205e('0x4a')]);module[_0x205e('0x4b')]=router; \ No newline at end of file +var _0xb91a=['/whatsapp/queues/:id','showWhatsappQueues','agentNotify','exports','util','path','express','Router','./rpc.controller','get','isAuthenticated','/voice/channels/:uniqueid/mixmonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/chat/queues','chatQueues','/mail/queues','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','showVoiceQueues','put','updateVoiceQueue','/outbound','/outbound/channels','outboundChannels','/agents','agents','/agents/:id/capacity','agentCapacity','telephones','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','/fax/queues/waitinginteractions','/mail/queues/:id/notify','mail','showMailQueues','post','/chat/queues/:id/notify','queueNotify','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','/fax/queues/:id','openchannel','showOpenchannelQueues','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues'];(function(_0x2efcd4,_0x49b7b6){var _0x4c1175=function(_0x44812e){while(--_0x44812e){_0x2efcd4['push'](_0x2efcd4['shift']());}};_0x4c1175(++_0x49b7b6);}(_0xb91a,0xe5));var _0xab91=function(_0x3f8507,_0x297a61){_0x3f8507=_0x3f8507-0x0;var _0x3376e7=_0xb91a[_0x3f8507];return _0x3376e7;};'use strict';var multer=require('multer');var util=require(_0xab91('0x0'));var path=require(_0xab91('0x1'));var express=require(_0xab91('0x2'));var router=express[_0xab91('0x3')]();var auth=require('../../components/auth/service');var controller=require(_0xab91('0x4'));router[_0xab91('0x5')]('/voice/channels',auth[_0xab91('0x6')](),controller['voiceChannels']);router['get'](_0xab91('0x7'),auth[_0xab91('0x6')](),controller['voiceChannelMixMonitor']);router[_0xab91('0x5')](_0xab91('0x8'),auth['isAuthenticated'](),controller[_0xab91('0x9')]);router[_0xab91('0x5')]('/voice/queues',auth['isAuthenticated'](),controller['voiceQueues']);router[_0xab91('0x5')](_0xab91('0xa'),auth[_0xab91('0x6')](),controller[_0xab91('0xb')]);router['get'](_0xab91('0xc'),auth[_0xab91('0x6')](),controller['mailQueues']);router[_0xab91('0x5')]('/mail/accounts',auth[_0xab91('0x6')](),controller['mailAccounts']);router['get'](_0xab91('0xd'),auth['isAuthenticated'](),controller[_0xab91('0xe')]);router[_0xab91('0x5')](_0xab91('0xf'),auth[_0xab91('0x6')](),controller[_0xab91('0x10')]);router[_0xab91('0x5')]('/whatsapp/queues',auth[_0xab91('0x6')](),controller['whatsappQueues']);router[_0xab91('0x5')](_0xab91('0x11'),auth[_0xab91('0x6')](),controller[_0xab91('0x12')]);router['get'](_0xab91('0x13'),auth[_0xab91('0x6')](),controller[_0xab91('0x14')]);router['get']('/voice/queues/channels',auth[_0xab91('0x6')](),controller[_0xab91('0x15')]);router[_0xab91('0x5')](_0xab91('0x16'),auth[_0xab91('0x6')](),controller[_0xab91('0x17')]);router[_0xab91('0x5')](_0xab91('0x18'),auth[_0xab91('0x6')](),controller[_0xab91('0x19')]);router['get'](_0xab91('0x1a'),auth[_0xab91('0x6')](),controller[_0xab91('0x1b')]);router['get']('/voice/queues/:id',auth[_0xab91('0x6')](),controller[_0xab91('0x1c')]);router[_0xab91('0x1d')]('/voice/queues/:id',auth['isAuthenticated'](),controller[_0xab91('0x1e')]);router['get'](_0xab91('0x1f'),auth['isAuthenticated'](),controller['outbound']);router[_0xab91('0x5')](_0xab91('0x20'),auth[_0xab91('0x6')](),controller[_0xab91('0x21')]);router[_0xab91('0x5')](_0xab91('0x22'),auth[_0xab91('0x6')](),controller[_0xab91('0x23')]);router['put'](_0xab91('0x24'),auth[_0xab91('0x6')](),controller[_0xab91('0x25')]);router[_0xab91('0x5')]('/telephones',auth[_0xab91('0x6')](),controller[_0xab91('0x26')]);router['get']('/trunks',auth[_0xab91('0x6')](),controller[_0xab91('0x27')]);router[_0xab91('0x5')](_0xab91('0x28'),auth[_0xab91('0x6')](),controller[_0xab91('0x29')]);router[_0xab91('0x5')](_0xab91('0x2a'),auth[_0xab91('0x6')](),controller[_0xab91('0x2b')]);router[_0xab91('0x5')]('/chat/queues/waitinginteractions',auth[_0xab91('0x6')](),controller[_0xab91('0x2c')]);router['get'](_0xab91('0x2d'),auth[_0xab91('0x6')](),controller[_0xab91('0x2e')]);router['get'](_0xab91('0x2f'),auth['isAuthenticated'](),controller[_0xab91('0x30')]);router[_0xab91('0x5')]('/openchannel/queues/:id/waitinginteractions',auth[_0xab91('0x6')](),controller[_0xab91('0x31')]);router['get'](_0xab91('0x32'),auth[_0xab91('0x6')](),controller[_0xab91('0x33')]);router['get'](_0xab91('0x34'),auth[_0xab91('0x6')](),controller['whatsappQueuesWaitingInteractions']);router[_0xab91('0x5')](_0xab91('0x35'),auth[_0xab91('0x6')](),controller['faxQueuesWaitingInteractions']);router['post'](_0xab91('0x36'),auth['isAuthenticated'](),controller['queueNotify'](_0xab91('0x37')));router[_0xab91('0x5')]('/mail/queues/:id',auth[_0xab91('0x6')](),controller[_0xab91('0x38')]);router[_0xab91('0x39')](_0xab91('0x3a'),auth[_0xab91('0x6')](),controller[_0xab91('0x3b')]('chat'));router[_0xab91('0x5')](_0xab91('0x3c'),auth[_0xab91('0x6')](),controller[_0xab91('0x3d')]);router[_0xab91('0x39')](_0xab91('0x3e'),auth[_0xab91('0x6')](),controller['queueNotify']('fax'));router[_0xab91('0x5')](_0xab91('0x3f'),auth['isAuthenticated'](),controller['showFaxQueues']);router[_0xab91('0x39')]('/openchannel/queues/:id/notify',auth[_0xab91('0x6')](),controller['queueNotify'](_0xab91('0x40')));router[_0xab91('0x5')]('/openchannel/queues/:id',auth['isAuthenticated'](),controller[_0xab91('0x41')]);router[_0xab91('0x39')]('/sms/queues/:id/notify',auth['isAuthenticated'](),controller['queueNotify'](_0xab91('0x42')));router[_0xab91('0x39')](_0xab91('0x43'),auth['isAuthenticated'](),controller[_0xab91('0x3b')](_0xab91('0x44')));router[_0xab91('0x5')](_0xab91('0x45'),auth[_0xab91('0x6')](),controller[_0xab91('0x46')]);router[_0xab91('0x5')](_0xab91('0x47'),auth[_0xab91('0x6')](),controller[_0xab91('0x48')]);router[_0xab91('0x39')]('/agents/:id/notify',auth[_0xab91('0x6')](),controller[_0xab91('0x49')]);module[_0xab91('0x4a')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 7102e2b..0707f12 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 _0xcbc8=['internal','AgentCapacity','capacity','telephones','Telephones','Trunks','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','MailAccounts','OpenchannelQueues','smsQueues','WhatsappQueues','showWhatsappQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','queue_id','uniq','filter','smsQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','Message','Interaction','\x20Message\x20not\x20found','update','MessageId','From','QueueId','TransferReport','create','Start','queue','queueTransferTimeout','*,*,*,*','agentNotify','Channel\x20field\x20is\x20mandatory','capitalize','chat','Agent\x20not\x20found','InteractionId','bluebird','moment','lodash','../../mysqldb','../../config/logger','api','jayson/promise','client','http','then','error','message','result','catch','status','json','stack','name','send','isNil','rows','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','voiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','OutboundChannels','agents','Agents','agentCapacity','body','interaction','user','hasOwnProperty','findAll','length','interface','format','SIP/%s','INTERACTION','YYYY-MM-DD\x20HH:mm:ss','agent'];(function(_0x91efec,_0x3a6c3c){var _0x294608=function(_0x525fd6){while(--_0x525fd6){_0x91efec['push'](_0x91efec['shift']());}};_0x294608(++_0x3a6c3c);}(_0xcbc8,0x128));var _0x8cbc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcbc8[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0x8cbc('0x0'));var moment=require(_0x8cbc('0x1'));var _=require(_0x8cbc('0x2'));var util=require('util');var db=require(_0x8cbc('0x3'))['db'];var logger=require(_0x8cbc('0x4'))(_0x8cbc('0x5'));var jayson=require(_0x8cbc('0x6'));var amiClient=jayson[_0x8cbc('0x7')][_0x8cbc('0x8')]({'port':0x232a});var mailClient=jayson[_0x8cbc('0x7')][_0x8cbc('0x8')]({'port':0x232b});var routingClient=jayson[_0x8cbc('0x7')][_0x8cbc('0x8')]({'port':0x232c});function respondWithRpcPromise(_0x4e88fe,_0x1a6158,_0x2d3186){return new BPromise(function(_0x5967d6,_0x43500a){var _0x3d1cb2=_0x2d3186?_0x2d3186:amiClient;return _0x3d1cb2['request'](_0x4e88fe,_0x1a6158)[_0x8cbc('0x9')](function(_0x2559ae){if(_0x2559ae[_0x8cbc('0xa')]){if(_0x2559ae[_0x8cbc('0xa')]['code']===0x1f4){return _0x43500a(_0x2559ae[_0x8cbc('0xa')][_0x8cbc('0xb')]);}return _0x5967d6(_0x2559ae[_0x8cbc('0xa')][_0x8cbc('0xb')]);}else{_0x5967d6(_0x2559ae[_0x8cbc('0xc')]);}})[_0x8cbc('0xd')](function(_0x12f40e){_0x43500a(_0x12f40e);});});}function respondWithResult(_0x19cf0e,_0x24e112){_0x24e112=_0x24e112||0xc8;return function(_0x4b852b){if(_0x4b852b){return _0x19cf0e[_0x8cbc('0xe')](_0x24e112)[_0x8cbc('0xf')](_0x4b852b);}return _0x19cf0e['sendStatus'](0x194);};}function handleError(_0x2cd302,_0x209b90){_0x209b90=_0x209b90||0x1f4;return function(_0x173690){logger[_0x8cbc('0xa')](_0x173690[_0x8cbc('0x10')]);if(_0x173690[_0x8cbc('0x11')]){delete _0x173690['name'];}_0x2cd302[_0x8cbc('0xe')](_0x209b90)[_0x8cbc('0x12')](_0x173690);};}function findById(_0x4841cd){return function(_0x2ab13b){if(!_[_0x8cbc('0x13')](_0x4841cd)&&!_[_0x8cbc('0x13')](_0x2ab13b)&&!_[_0x8cbc('0x13')](_0x2ab13b[_0x8cbc('0x14')])){return _[_0x8cbc('0x15')](_0x2ab13b[_0x8cbc('0x14')],function(_0x45206d){return _0x45206d['id']==_0x4841cd;});}return null;};}exports[_0x8cbc('0x16')]=function(_0x1e4fa3,_0x4bbbff){return respondWithRpcPromise(_0x8cbc('0x17'),_0x1e4fa3[_0x8cbc('0x18')])[_0x8cbc('0x9')](respondWithResult(_0x4bbbff,null))[_0x8cbc('0xd')](handleError(_0x4bbbff,null));};exports[_0x8cbc('0x19')]=function(_0x337bcd,_0x5795af){return respondWithRpcPromise(_0x8cbc('0x1a'),_[_0x8cbc('0x1b')](_0x337bcd[_0x8cbc('0x18')],_0x337bcd[_0x8cbc('0x1c')]))[_0x8cbc('0x9')](respondWithResult(_0x5795af,null))['catch'](handleError(_0x5795af,null));};exports[_0x8cbc('0x1d')]=function(_0x5e661d,_0x38b5e4){return respondWithRpcPromise(_0x8cbc('0x1e'),_[_0x8cbc('0x1b')](_0x5e661d['query'],_0x5e661d[_0x8cbc('0x1c')]))[_0x8cbc('0x9')](respondWithResult(_0x38b5e4,null))[_0x8cbc('0xd')](handleError(_0x38b5e4,null));};exports['voiceQueues']=function(_0x4b0ec3,_0x4c4d60){return respondWithRpcPromise(_0x8cbc('0x1f'),_0x4b0ec3['query'])['then'](respondWithResult(_0x4c4d60,null))[_0x8cbc('0xd')](handleError(_0x4c4d60,null));};exports[_0x8cbc('0x20')]=function(_0x19d4de,_0x484623){return respondWithRpcPromise(_0x8cbc('0x1f'),_0x19d4de[_0x8cbc('0x18')])['then'](findById(_0x19d4de[_0x8cbc('0x1c')]['id']))[_0x8cbc('0x9')](respondWithResult(_0x484623,null))[_0x8cbc('0xd')](handleError(_0x484623,null));};exports['updateVoiceQueue']=function(_0x1cdfc8,_0x4802f5){return respondWithRpcPromise(_0x8cbc('0x21'),_['merge'](_0x1cdfc8['body'],_0x1cdfc8[_0x8cbc('0x1c')]))[_0x8cbc('0x9')](respondWithResult(_0x4802f5,null))[_0x8cbc('0xd')](handleError(_0x4802f5,null));};exports[_0x8cbc('0x22')]=function(_0x4f5f38,_0x62fefc){return respondWithRpcPromise('VoiceQueuesPreview',_['merge'](_0x4f5f38[_0x8cbc('0x18')],_0x4f5f38[_0x8cbc('0x1c')]))['then'](respondWithResult(_0x62fefc,null))['catch'](handleError(_0x62fefc,null));};exports[_0x8cbc('0x23')]=function(_0x2a8571,_0x20b8e1){return respondWithRpcPromise(_0x8cbc('0x24'),_0x2a8571[_0x8cbc('0x18')])[_0x8cbc('0x9')](respondWithResult(_0x20b8e1,null))[_0x8cbc('0xd')](handleError(_0x20b8e1,null));};exports[_0x8cbc('0x25')]=function(_0x5887a7,_0x2e25dc){return respondWithRpcPromise('VoiceQueuesChannel',_[_0x8cbc('0x1b')](_0x5887a7['query'],_0x5887a7[_0x8cbc('0x1c')]))[_0x8cbc('0x9')](respondWithResult(_0x2e25dc,null))[_0x8cbc('0xd')](handleError(_0x2e25dc,null));};exports['voiceQueuesChannelHangup']=function(_0x2c9cd2,_0x3c464a){return respondWithRpcPromise(_0x8cbc('0x26'),_[_0x8cbc('0x1b')](_0x2c9cd2[_0x8cbc('0x18')],_0x2c9cd2[_0x8cbc('0x1c')]))['then'](respondWithResult(_0x3c464a,null))[_0x8cbc('0xd')](handleError(_0x3c464a,null));};exports[_0x8cbc('0x27')]=function(_0x4a74a5,_0x573af3){return respondWithRpcPromise(_0x8cbc('0x28'),_[_0x8cbc('0x1b')](_0x4a74a5[_0x8cbc('0x18')],_0x4a74a5[_0x8cbc('0x1c')]))[_0x8cbc('0x9')](respondWithResult(_0x573af3,null))['catch'](handleError(_0x573af3,null));};exports[_0x8cbc('0x29')]=function(_0x1a8cbc,_0x485ad8){return respondWithRpcPromise('Outbound',_0x1a8cbc[_0x8cbc('0x18')])[_0x8cbc('0x9')](respondWithResult(_0x485ad8,null))['catch'](handleError(_0x485ad8,null));};exports['outboundChannels']=function(_0x15a62a,_0x23e5fa){return respondWithRpcPromise(_0x8cbc('0x2a'),_0x15a62a[_0x8cbc('0x18')])['then'](respondWithResult(_0x23e5fa,null))['catch'](handleError(_0x23e5fa,null));};exports[_0x8cbc('0x2b')]=function(_0x5aee1f,_0x4b2724){var _0x8ee466;return respondWithRpcPromise(_0x8cbc('0x2c'),_0x5aee1f['query'])[_0x8cbc('0x9')](function(_0x5da792){_0x8ee466=_0x5da792;return respondWithRpcPromise(_0x8cbc('0x2c'),_0x5aee1f[_0x8cbc('0x18')],routingClient);})[_0x8cbc('0x9')](function(_0x15b180){return _[_0x8cbc('0x1b')]({},_0x15b180,_0x8ee466);})[_0x8cbc('0x9')](respondWithResult(_0x4b2724,null))[_0x8cbc('0xd')](handleError(_0x4b2724,null));};exports[_0x8cbc('0x2d')]=function(_0x5cdecf,_0x2aaf58){if(_0x5cdecf[_0x8cbc('0x2e')]&&_0x5cdecf[_0x8cbc('0x2e')][_0x8cbc('0x2f')]&&_0x5cdecf[_0x8cbc('0x30')]&&_0x5cdecf['user'][_0x8cbc('0x11')]){for(var _0x598e4b in _0x5cdecf['body']['interaction']){if(_0x5cdecf['body'][_0x8cbc('0x2f')][_0x8cbc('0x31')](_0x598e4b)){db['MemberReport'][_0x8cbc('0x32')]({'where':{'channel':_0x598e4b,'membername':_0x5cdecf[_0x8cbc('0x30')][_0x8cbc('0x11')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x5cdecf[_0x8cbc('0x2e')][_0x8cbc('0x2f')][_0x598e4b]&&_0x5cdecf['body'][_0x8cbc('0x2f')][_0x598e4b][_0x8cbc('0x33')]?{'$notIn':_0x5cdecf[_0x8cbc('0x2e')][_0x8cbc('0x2f')][_0x598e4b]}:{'$ne':null}}})[_0x8cbc('0x9')](function(_0x290d02){var _0xfa0ab8=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');for(var _0xc7176f=0x0,_0x33e25b=_0x290d02[_0x8cbc('0x33')];_0xc7176f<_0x33e25b;_0xc7176f+=0x1){_0x290d02[_0xc7176f]['updateAttributes']({'exitAt':_0xfa0ab8});}});for(var _0x20b34a=0x0;_0x20b34a<_0x5cdecf['body'][_0x8cbc('0x2f')][_0x598e4b][_0x8cbc('0x33')];_0x20b34a+=0x1){db['MemberReport']['findOrCreate']({'where':{'channel':_0x598e4b,'membername':_0x5cdecf[_0x8cbc('0x30')][_0x8cbc('0x11')],'type':'INTERACTION','uniqueid':_0x5cdecf[_0x8cbc('0x2e')][_0x8cbc('0x2f')][_0x598e4b][_0x20b34a],'exitAt':null},'defaults':{'channel':_0x598e4b,'membername':_0x5cdecf['user']['name'],'interface':_['isNil'](_0x5cdecf['user'][_0x8cbc('0x34')])?util[_0x8cbc('0x35')](_0x8cbc('0x36'),_0x5cdecf[_0x8cbc('0x30')][_0x8cbc('0x11')]):_0x5cdecf[_0x8cbc('0x30')][_0x8cbc('0x34')],'type':_0x8cbc('0x37'),'enterAt':moment()[_0x8cbc('0x35')](_0x8cbc('0x38')),'role':_0x8cbc('0x39'),'internal':_0x5cdecf[_0x8cbc('0x30')][_0x8cbc('0x3a')],'uniqueid':_0x5cdecf[_0x8cbc('0x2e')][_0x8cbc('0x2f')][_0x598e4b][_0x20b34a]}});}}}}return respondWithRpcPromise(_0x8cbc('0x3b'),{'id':_0x5cdecf[_0x8cbc('0x1c')]['id'],'capacity':_0x5cdecf['body'][_0x8cbc('0x3c')]},routingClient)[_0x8cbc('0x9')](respondWithResult(_0x2aaf58,null))[_0x8cbc('0xd')](handleError(_0x2aaf58,null));};exports[_0x8cbc('0x3d')]=function(_0x5b7abc,_0x4b8ed7){return respondWithRpcPromise(_0x8cbc('0x3e'),_0x5b7abc[_0x8cbc('0x18')])[_0x8cbc('0x9')](respondWithResult(_0x4b8ed7,null))[_0x8cbc('0xd')](handleError(_0x4b8ed7,null));};exports['trunks']=function(_0x46a3db,_0x5245b5){return respondWithRpcPromise(_0x8cbc('0x3f'),_0x46a3db['query'])[_0x8cbc('0x9')](respondWithResult(_0x5245b5,null))['catch'](handleError(_0x5245b5,null));};exports['campaigns']=function(_0x25f59e,_0x4befe2){return respondWithRpcPromise('Campaigns',_0x25f59e[_0x8cbc('0x18')])[_0x8cbc('0x9')](respondWithResult(_0x4befe2,null))[_0x8cbc('0xd')](handleError(_0x4befe2,null));};exports[_0x8cbc('0x40')]=function(_0x990383,_0x5cf205){return respondWithRpcPromise(_0x8cbc('0x41'),_0x990383[_0x8cbc('0x18')],routingClient)[_0x8cbc('0x9')](respondWithResult(_0x5cf205,null))[_0x8cbc('0xd')](handleError(_0x5cf205,null));};exports[_0x8cbc('0x42')]=function(_0x55d95c,_0x56b722){return respondWithRpcPromise('ChatQueues',_0x55d95c['query'],routingClient)[_0x8cbc('0x9')](findById(_0x55d95c[_0x8cbc('0x1c')]['id']))[_0x8cbc('0x9')](respondWithResult(_0x56b722,null))[_0x8cbc('0xd')](handleError(_0x56b722,null));};exports[_0x8cbc('0x43')]=function(_0x39ad27,_0x13aae6){return respondWithRpcPromise(_0x8cbc('0x44'),_0x39ad27['query'],routingClient)['then'](respondWithResult(_0x13aae6,null))[_0x8cbc('0xd')](handleError(_0x13aae6,null));};exports[_0x8cbc('0x45')]=function(_0x1ccfa7,_0x4fdf57){return respondWithRpcPromise(_0x8cbc('0x44'),_0x1ccfa7[_0x8cbc('0x18')],routingClient)[_0x8cbc('0x9')](findById(_0x1ccfa7[_0x8cbc('0x1c')]['id']))[_0x8cbc('0x9')](respondWithResult(_0x4fdf57,null))['catch'](handleError(_0x4fdf57,null));};exports['mailAccounts']=function(_0x59f1a2,_0xdb48f){return respondWithRpcPromise(_0x8cbc('0x46'),_0x59f1a2[_0x8cbc('0x18')],mailClient)[_0x8cbc('0x9')](respondWithResult(_0xdb48f,null))[_0x8cbc('0xd')](handleError(_0xdb48f,null));};exports['openchannelQueues']=function(_0x37e205,_0x204448){return respondWithRpcPromise(_0x8cbc('0x47'),_0x37e205[_0x8cbc('0x18')],routingClient)[_0x8cbc('0x9')](respondWithResult(_0x204448,null))[_0x8cbc('0xd')](handleError(_0x204448,null));};exports['showOpenchannelQueues']=function(_0x43c3ba,_0x42118e){return respondWithRpcPromise('OpenchannelQueues',_0x43c3ba['query'],routingClient)[_0x8cbc('0x9')](findById(_0x43c3ba[_0x8cbc('0x1c')]['id']))[_0x8cbc('0x9')](respondWithResult(_0x42118e,null))[_0x8cbc('0xd')](handleError(_0x42118e,null));};exports[_0x8cbc('0x48')]=function(_0x152b7a,_0x359ffc){return respondWithRpcPromise('SmsQueues',_0x152b7a[_0x8cbc('0x18')],routingClient)[_0x8cbc('0x9')](respondWithResult(_0x359ffc,null))['catch'](handleError(_0x359ffc,null));};exports['showSmsQueues']=function(_0x38c558,_0x418a4b){return respondWithRpcPromise('SmsQueues',_0x38c558[_0x8cbc('0x18')],routingClient)['then'](findById(_0x38c558[_0x8cbc('0x1c')]['id']))[_0x8cbc('0x9')](respondWithResult(_0x418a4b,null))[_0x8cbc('0xd')](handleError(_0x418a4b,null));};exports['whatsappQueues']=function(_0xc913fb,_0x142811){return respondWithRpcPromise(_0x8cbc('0x49'),_0xc913fb[_0x8cbc('0x18')],routingClient)[_0x8cbc('0x9')](respondWithResult(_0x142811,null))['catch'](handleError(_0x142811,null));};exports[_0x8cbc('0x4a')]=function(_0x5f55d4,_0x198afa){return respondWithRpcPromise(_0x8cbc('0x49'),_0x5f55d4[_0x8cbc('0x18')],routingClient)[_0x8cbc('0x9')](findById(_0x5f55d4[_0x8cbc('0x1c')]['id']))[_0x8cbc('0x9')](respondWithResult(_0x198afa,null))[_0x8cbc('0xd')](handleError(_0x198afa,null));};exports['faxQueues']=function(_0x36bc9f,_0x52bef6){return respondWithRpcPromise(_0x8cbc('0x4b'),_0x36bc9f[_0x8cbc('0x18')],routingClient)[_0x8cbc('0x9')](respondWithResult(_0x52bef6,null))[_0x8cbc('0xd')](handleError(_0x52bef6,null));};exports[_0x8cbc('0x4c')]=function(_0x1f239d,_0x4e5816){return respondWithRpcPromise(_0x8cbc('0x4b'),_0x1f239d[_0x8cbc('0x18')],routingClient)['then'](findById(_0x1f239d[_0x8cbc('0x1c')]['id']))[_0x8cbc('0x9')](respondWithResult(_0x4e5816,null))[_0x8cbc('0xd')](handleError(_0x4e5816,null));};exports[_0x8cbc('0x4d')]=function(_0x2337a0,_0x244e5f){return respondWithRpcPromise(_0x8cbc('0x4e'),_0x2337a0[_0x8cbc('0x18')])[_0x8cbc('0x9')](respondWithResult(_0x244e5f,null))['catch'](handleError(_0x244e5f,null));};exports[_0x8cbc('0x4f')]=function(_0x4cc380,_0x528af8){return respondWithRpcPromise(_0x8cbc('0x50'),_0x4cc380[_0x8cbc('0x18')],routingClient)[_0x8cbc('0x9')](respondWithResult(_0x528af8,null))[_0x8cbc('0xd')](handleError(_0x528af8,null));};exports[_0x8cbc('0x51')]=function(_0xa7e38e,_0x51e3e0){return respondWithRpcPromise(_0x8cbc('0x52'),_0xa7e38e['query'],routingClient)[_0x8cbc('0x9')](respondWithResult(_0x51e3e0,null))[_0x8cbc('0xd')](handleError(_0x51e3e0,null));};exports[_0x8cbc('0x53')]=function(_0x420182,_0x5bd5a1){return respondWithRpcPromise(_0x8cbc('0x54'),_0x420182[_0x8cbc('0x18')],routingClient)[_0x8cbc('0x9')](respondWithResult(_0x5bd5a1,null))[_0x8cbc('0xd')](handleError(_0x5bd5a1,null));};exports[_0x8cbc('0x55')]=function(_0x225e35,_0x300d6b){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x225e35[_0x8cbc('0x18')],routingClient)['then'](function(_0x28425c){if(_0x225e35[_0x8cbc('0x18')][_0x8cbc('0x56')]!==undefined){var _0x2839dd=_(_0x28425c['rows'])['filter']([_0x225e35[_0x8cbc('0x18')][_0x8cbc('0x56')],_0x225e35[_0x8cbc('0x1c')]['id']])['map'](_0x8cbc('0x57'))[_0x8cbc('0x58')]()['value']();return _0x28425c[_0x8cbc('0x14')]['filter'](function(_0x12a42b){return _0x2839dd['indexOf'](_0x12a42b['queue_id'])>-0x1;});}else{return _0x28425c[_0x8cbc('0x14')][_0x8cbc('0x59')](function(_0x1cb7a1){return _0x1cb7a1['queue_id']===parseInt(_0x225e35['params']['id']);});}})[_0x8cbc('0x9')](respondWithResult(_0x300d6b,null))[_0x8cbc('0xd')](handleError(_0x300d6b,null));};exports[_0x8cbc('0x5a')]=function(_0x462ce7,_0x1fc463){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x462ce7['query'],routingClient)[_0x8cbc('0x9')](respondWithResult(_0x1fc463,null))[_0x8cbc('0xd')](handleError(_0x1fc463,null));};exports['whatsappQueuesWaitingInteractions']=function(_0x4572ac,_0x328975){return respondWithRpcPromise(_0x8cbc('0x5b'),_0x4572ac[_0x8cbc('0x18')],routingClient)['then'](respondWithResult(_0x328975,null))[_0x8cbc('0xd')](handleError(_0x328975,null));};exports[_0x8cbc('0x5c')]=function(_0x474426,_0x578378){return respondWithRpcPromise(_0x8cbc('0x5d'),_0x474426['query'],routingClient)[_0x8cbc('0x9')](respondWithResult(_0x578378,null))[_0x8cbc('0xd')](handleError(_0x578378,null));};exports['queueNotify']=function(_0x20fd80){return function(_0x13662c,_0x19a14e){var _0x54426d,_0x351487;var _0x2577b4=_['capitalize'](_0x20fd80);var _0x3e1f95=_0x20fd80==='chat'?_0x8cbc('0x5e'):_0x8cbc('0x5f');return db[_0x2577b4+_0x8cbc('0x60')][_0x8cbc('0x61')]({'raw':!![],'where':{'id':_0x13662c[_0x8cbc('0x1c')]['id']}})['then'](function(_0x2f6213){if(_[_0x8cbc('0x13')](_0x2f6213)){throw new Error(_0x2577b4+_0x8cbc('0x62'));}_0x54426d=_0x2f6213;return db[_0x2577b4+_0x8cbc('0x63')][_0x8cbc('0x61')]({'where':{'id':_0x13662c[_0x8cbc('0x2e')]['messageId']},'include':[{'model':db[_0x2577b4+_0x8cbc('0x64')],'as':_0x8cbc('0x64')},{'model':db[_0x2577b4+_0x3e1f95],'as':'Account'}]});})[_0x8cbc('0x9')](function(_0x323884){if(_[_0x8cbc('0x13')](_0x323884)){throw new Error(_0x2577b4+_0x8cbc('0x65'));}_0x351487=_0x323884;return _0x323884[_0x8cbc('0x66')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x29be05={'uniqueid':_0x20fd80+'.'+_0x351487['id']+'.'+_0x351487[_0x8cbc('0x64')]['id'],'FromUserId':_0x13662c[_0x8cbc('0x30')]['id'],'type':'queue'};_0x29be05[_0x2577b4+_0x8cbc('0x67')]=_0x351487['id'];_0x29be05[_0x2577b4+'InteractionId']=_0x351487[_0x8cbc('0x64')]['id'];_0x29be05[_0x8cbc('0x68')+_0x2577b4+_0x3e1f95+'Id']=_0x351487[_0x8cbc('0x5f')]['id'];_0x29be05['To'+_0x2577b4+_0x8cbc('0x69')]=_0x54426d['id'];return db[_0x2577b4+_0x8cbc('0x6a')][_0x8cbc('0x6b')](_0x29be05);})[_0x8cbc('0x9')](function(){return respondWithRpcPromise(_0x8cbc('0x6c'),{'channel':_0x20fd80,'interaction':_0x351487[_0x8cbc('0x64')],'message':_0x351487,'account':_0x351487[_0x8cbc('0x5f')],'applications':[{'id':0x0,'priority':0x1,'app':_0x8cbc('0x6d'),'appdata':_0x54426d[_0x8cbc('0x11')]+','+(_0x351487['Account'][_0x8cbc('0x6e')]||0x12c),'interval':_0x8cbc('0x6f')}]},routingClient);})['then'](respondWithResult(_0x19a14e,null))['catch'](handleError(_0x19a14e,null));};};exports[_0x8cbc('0x70')]=function(_0x477b1f,_0x4f2a46){var _0x3b7693,_0x46d570;if(_[_0x8cbc('0x13')](_0x477b1f[_0x8cbc('0x2e')]['channel'])){throw new Error(_0x8cbc('0x71'));}var _0xbac2c4=_0x477b1f[_0x8cbc('0x2e')]['channel'];var _0xd03ce2=_[_0x8cbc('0x72')](_0xbac2c4);var _0x38775f=_0xbac2c4===_0x8cbc('0x73')?_0x8cbc('0x5e'):_0x8cbc('0x5f');return db['User']['findOne']({'raw':!![],'where':{'id':_0x477b1f[_0x8cbc('0x1c')]['id'],'role':_0x8cbc('0x39')}})[_0x8cbc('0x9')](function(_0x43cc93){if(_[_0x8cbc('0x13')](_0x43cc93)){throw new Error(_0x8cbc('0x74'));}_0x3b7693=_0x43cc93;return db[_0xd03ce2+'Message'][_0x8cbc('0x61')]({'where':{'id':_0x477b1f[_0x8cbc('0x2e')]['messageId']},'include':[{'model':db[_0xd03ce2+'Interaction'],'as':_0x8cbc('0x64')},{'model':db[_0xd03ce2+_0x38775f],'as':_0x8cbc('0x5f')}]});})['then'](function(_0x3c8666){if(_['isNil'](_0x3c8666)){throw new Error(_0xd03ce2+_0x8cbc('0x65'));}_0x46d570=_0x3c8666;return _0x3c8666[_0x8cbc('0x66')]({'read':0x0,'readAt':null,'UserId':null});})[_0x8cbc('0x9')](function(){var _0x59f11e={'uniqueid':_0xbac2c4+'.'+_0x46d570['id']+'.'+_0x46d570[_0x8cbc('0x64')]['id'],'FromUserId':_0x477b1f[_0x8cbc('0x30')]['id'],'type':'agent','ToUserId':_0x3b7693['id']};_0x59f11e[_0xd03ce2+_0x8cbc('0x67')]=_0x46d570['id'];_0x59f11e[_0xd03ce2+_0x8cbc('0x75')]=_0x46d570[_0x8cbc('0x64')]['id'];_0x59f11e[_0x8cbc('0x68')+_0xd03ce2+_0x38775f+'Id']=_0x46d570[_0x8cbc('0x5f')]['id'];return db[_0xd03ce2+'TransferReport'][_0x8cbc('0x6b')](_0x59f11e);})['then'](function(){return respondWithRpcPromise(_0x8cbc('0x6c'),{'channel':_0xbac2c4,'interaction':_0x46d570[_0x8cbc('0x64')],'message':_0x46d570,'account':_0x46d570[_0x8cbc('0x5f')],'applications':[{'id':0x0,'priority':0x1,'app':_0x8cbc('0x39'),'appdata':_0x3b7693['name']+','+(_0x46d570[_0x8cbc('0x5f')]['agentTransferTimeout']||0x12c),'interval':_0x8cbc('0x6f')}]},routingClient);})['then'](respondWithResult(_0x4f2a46,null))[_0x8cbc('0xd')](handleError(_0x4f2a46,null));}; \ No newline at end of file +var _0xe706=['indexOf','queue_id','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','Website','Queue','\x20Queue\x20not\x20found','Message','findOne','Interaction','Account','update','queue','MessageId','InteractionId','TransferReport','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','chat','User','Agent\x20not\x20found','messageId','\x20Message\x20not\x20found','From','create','Start','agentTransferTimeout','bluebird','moment','lodash','../../mysqldb','../../config/logger','api','jayson/promise','client','http','request','then','error','code','message','result','catch','status','json','name','send','isNil','rows','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','user','hasOwnProperty','MemberReport','findAll','INTERACTION','interaction','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','SIP/%s','interface','agent','internal','capacity','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','OpenchannelQueues','showOpenchannelQueues','showSmsQueues','SmsQueues','whatsappQueues','WhatsappQueues','faxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','uniq'];(function(_0x23cbf8,_0x5c7d95){var _0x220d78=function(_0x4dee59){while(--_0x4dee59){_0x23cbf8['push'](_0x23cbf8['shift']());}};_0x220d78(++_0x5c7d95);}(_0xe706,0xa3));var _0x6e70=function(_0x1075b8,_0xd606e2){_0x1075b8=_0x1075b8-0x0;var _0x5d047f=_0xe706[_0x1075b8];return _0x5d047f;};'use strict';var BPromise=require(_0x6e70('0x0'));var moment=require(_0x6e70('0x1'));var _=require(_0x6e70('0x2'));var util=require('util');var db=require(_0x6e70('0x3'))['db'];var logger=require(_0x6e70('0x4'))(_0x6e70('0x5'));var jayson=require(_0x6e70('0x6'));var amiClient=jayson[_0x6e70('0x7')][_0x6e70('0x8')]({'port':0x232a});var mailClient=jayson[_0x6e70('0x7')][_0x6e70('0x8')]({'port':0x232b});var routingClient=jayson[_0x6e70('0x7')][_0x6e70('0x8')]({'port':0x232c});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){var _0x449b48=_0x45a2d4?_0x45a2d4:amiClient;return _0x449b48[_0x6e70('0x9')](_0x36357b,_0x293ce7)[_0x6e70('0xa')](function(_0x100eb7){if(_0x100eb7[_0x6e70('0xb')]){if(_0x100eb7[_0x6e70('0xb')][_0x6e70('0xc')]===0x1f4){return _0x3c4843(_0x100eb7[_0x6e70('0xb')][_0x6e70('0xd')]);}return _0x188ed3(_0x100eb7['error']['message']);}else{_0x188ed3(_0x100eb7[_0x6e70('0xe')]);}})[_0x6e70('0xf')](function(_0x18cf27){_0x3c4843(_0x18cf27);});});}function respondWithResult(_0x27dd9b,_0x3b38f3){_0x3b38f3=_0x3b38f3||0xc8;return function(_0x310eb7){if(_0x310eb7){return _0x27dd9b[_0x6e70('0x10')](_0x3b38f3)[_0x6e70('0x11')](_0x310eb7);}return _0x27dd9b['sendStatus'](0x194);};}function handleError(_0x52737e,_0x48bc72){_0x48bc72=_0x48bc72||0x1f4;return function(_0x257e81){logger['error'](_0x257e81['stack']);if(_0x257e81[_0x6e70('0x12')]){delete _0x257e81[_0x6e70('0x12')];}_0x52737e['status'](_0x48bc72)[_0x6e70('0x13')](_0x257e81);};}function findById(_0x5c3fe7){return function(_0x2efc0f){if(!_[_0x6e70('0x14')](_0x5c3fe7)&&!_['isNil'](_0x2efc0f)&&!_['isNil'](_0x2efc0f[_0x6e70('0x15')])){return _['find'](_0x2efc0f[_0x6e70('0x15')],function(_0x173afe){return _0x173afe['id']==_0x5c3fe7;});}return null;};}exports['voiceChannels']=function(_0x497d61,_0xc238ba){return respondWithRpcPromise(_0x6e70('0x16'),_0x497d61[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0xc238ba,null))[_0x6e70('0xf')](handleError(_0xc238ba,null));};exports[_0x6e70('0x18')]=function(_0x1b2453,_0x44a49f){return respondWithRpcPromise(_0x6e70('0x19'),_[_0x6e70('0x1a')](_0x1b2453['query'],_0x1b2453[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x44a49f,null))[_0x6e70('0xf')](handleError(_0x44a49f,null));};exports['voiceChannelStopMixMonitor']=function(_0x3ccd87,_0xa5d49){return respondWithRpcPromise(_0x6e70('0x1c'),_['merge'](_0x3ccd87[_0x6e70('0x17')],_0x3ccd87['params']))['then'](respondWithResult(_0xa5d49,null))['catch'](handleError(_0xa5d49,null));};exports[_0x6e70('0x1d')]=function(_0x19c5ae,_0x51d292){return respondWithRpcPromise(_0x6e70('0x1e'),_0x19c5ae[_0x6e70('0x17')])['then'](respondWithResult(_0x51d292,null))[_0x6e70('0xf')](handleError(_0x51d292,null));};exports[_0x6e70('0x1f')]=function(_0x2bb231,_0x4a67ac){return respondWithRpcPromise('VoiceQueues',_0x2bb231[_0x6e70('0x17')])[_0x6e70('0xa')](findById(_0x2bb231[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x4a67ac,null))[_0x6e70('0xf')](handleError(_0x4a67ac,null));};exports['updateVoiceQueue']=function(_0x1952ea,_0x406f29){return respondWithRpcPromise(_0x6e70('0x20'),_[_0x6e70('0x1a')](_0x1952ea[_0x6e70('0x21')],_0x1952ea[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x406f29,null))[_0x6e70('0xf')](handleError(_0x406f29,null));};exports[_0x6e70('0x22')]=function(_0x3a5d30,_0x4b1229){return respondWithRpcPromise(_0x6e70('0x23'),_['merge'](_0x3a5d30[_0x6e70('0x17')],_0x3a5d30['params']))[_0x6e70('0xa')](respondWithResult(_0x4b1229,null))[_0x6e70('0xf')](handleError(_0x4b1229,null));};exports[_0x6e70('0x24')]=function(_0x56f6f7,_0x38c40d){return respondWithRpcPromise(_0x6e70('0x25'),_0x56f6f7['query'])[_0x6e70('0xa')](respondWithResult(_0x38c40d,null))[_0x6e70('0xf')](handleError(_0x38c40d,null));};exports['voiceQueuesChannel']=function(_0x10d8f6,_0x3665a1){return respondWithRpcPromise(_0x6e70('0x26'),_[_0x6e70('0x1a')](_0x10d8f6[_0x6e70('0x17')],_0x10d8f6[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x3665a1,null))[_0x6e70('0xf')](handleError(_0x3665a1,null));};exports[_0x6e70('0x27')]=function(_0x419a41,_0x4d32d8){return respondWithRpcPromise(_0x6e70('0x28'),_['merge'](_0x419a41[_0x6e70('0x17')],_0x419a41[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x4d32d8,null))[_0x6e70('0xf')](handleError(_0x4d32d8,null));};exports[_0x6e70('0x29')]=function(_0x989b80,_0x2440be){return respondWithRpcPromise(_0x6e70('0x2a'),_[_0x6e70('0x1a')](_0x989b80[_0x6e70('0x17')],_0x989b80[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x2440be,null))[_0x6e70('0xf')](handleError(_0x2440be,null));};exports['outbound']=function(_0x5446a2,_0x5424eb){return respondWithRpcPromise(_0x6e70('0x2b'),_0x5446a2[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x5424eb,null))[_0x6e70('0xf')](handleError(_0x5424eb,null));};exports[_0x6e70('0x2c')]=function(_0x3bdd87,_0x572a71){return respondWithRpcPromise(_0x6e70('0x2d'),_0x3bdd87[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x572a71,null))[_0x6e70('0xf')](handleError(_0x572a71,null));};exports[_0x6e70('0x2e')]=function(_0x37bf46,_0x246e61){var _0x16fc7d;return respondWithRpcPromise('Agents',_0x37bf46[_0x6e70('0x17')])[_0x6e70('0xa')](function(_0x22fce9){_0x16fc7d=_0x22fce9;return respondWithRpcPromise(_0x6e70('0x2f'),_0x37bf46[_0x6e70('0x17')],routingClient);})[_0x6e70('0xa')](function(_0x21b0e7){return _['merge']({},_0x21b0e7,_0x16fc7d);})['then'](respondWithResult(_0x246e61,null))['catch'](handleError(_0x246e61,null));};exports[_0x6e70('0x30')]=function(_0x2b63cc,_0x83847b){if(_0x2b63cc[_0x6e70('0x21')]&&_0x2b63cc[_0x6e70('0x21')]['interaction']&&_0x2b63cc[_0x6e70('0x31')]&&_0x2b63cc[_0x6e70('0x31')][_0x6e70('0x12')]){for(var _0x52b197 in _0x2b63cc['body']['interaction']){if(_0x2b63cc[_0x6e70('0x21')]['interaction'][_0x6e70('0x32')](_0x52b197)){db[_0x6e70('0x33')][_0x6e70('0x34')]({'where':{'channel':_0x52b197,'membername':_0x2b63cc[_0x6e70('0x31')]['name'],'type':_0x6e70('0x35'),'exitAt':null,'uniqueid':_0x2b63cc['body'][_0x6e70('0x36')][_0x52b197]&&_0x2b63cc[_0x6e70('0x21')][_0x6e70('0x36')][_0x52b197][_0x6e70('0x37')]?{'$notIn':_0x2b63cc['body'][_0x6e70('0x36')][_0x52b197]}:{'$ne':null}}})[_0x6e70('0xa')](function(_0x3d39c3){var _0xac87d6=moment()[_0x6e70('0x38')](_0x6e70('0x39'));for(var _0x3d9c5=0x0,_0x552e7e=_0x3d39c3[_0x6e70('0x37')];_0x3d9c5<_0x552e7e;_0x3d9c5+=0x1){_0x3d39c3[_0x3d9c5][_0x6e70('0x3a')]({'exitAt':_0xac87d6});}});for(var _0x10de2a=0x0;_0x10de2a<_0x2b63cc[_0x6e70('0x21')][_0x6e70('0x36')][_0x52b197][_0x6e70('0x37')];_0x10de2a+=0x1){db[_0x6e70('0x33')]['findOrCreate']({'where':{'channel':_0x52b197,'membername':_0x2b63cc[_0x6e70('0x31')]['name'],'type':_0x6e70('0x35'),'uniqueid':_0x2b63cc[_0x6e70('0x21')]['interaction'][_0x52b197][_0x10de2a],'exitAt':null},'defaults':{'channel':_0x52b197,'membername':_0x2b63cc['user'][_0x6e70('0x12')],'interface':_[_0x6e70('0x14')](_0x2b63cc[_0x6e70('0x31')]['interface'])?util['format'](_0x6e70('0x3b'),_0x2b63cc[_0x6e70('0x31')][_0x6e70('0x12')]):_0x2b63cc[_0x6e70('0x31')][_0x6e70('0x3c')],'type':_0x6e70('0x35'),'enterAt':moment()['format'](_0x6e70('0x39')),'role':_0x6e70('0x3d'),'internal':_0x2b63cc[_0x6e70('0x31')][_0x6e70('0x3e')],'uniqueid':_0x2b63cc[_0x6e70('0x21')]['interaction'][_0x52b197][_0x10de2a]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x2b63cc[_0x6e70('0x1b')]['id'],'capacity':_0x2b63cc[_0x6e70('0x21')][_0x6e70('0x3f')]},routingClient)[_0x6e70('0xa')](respondWithResult(_0x83847b,null))[_0x6e70('0xf')](handleError(_0x83847b,null));};exports['telephones']=function(_0x41bd0b,_0x232366){return respondWithRpcPromise(_0x6e70('0x40'),_0x41bd0b[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x232366,null))['catch'](handleError(_0x232366,null));};exports[_0x6e70('0x41')]=function(_0x1dd242,_0x2c20d3){return respondWithRpcPromise(_0x6e70('0x42'),_0x1dd242[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x2c20d3,null))['catch'](handleError(_0x2c20d3,null));};exports[_0x6e70('0x43')]=function(_0x8d425d,_0x5c2396){return respondWithRpcPromise(_0x6e70('0x44'),_0x8d425d[_0x6e70('0x17')])['then'](respondWithResult(_0x5c2396,null))[_0x6e70('0xf')](handleError(_0x5c2396,null));};exports[_0x6e70('0x45')]=function(_0x2134c4,_0x46d536){return respondWithRpcPromise(_0x6e70('0x46'),_0x2134c4['query'],routingClient)[_0x6e70('0xa')](respondWithResult(_0x46d536,null))[_0x6e70('0xf')](handleError(_0x46d536,null));};exports[_0x6e70('0x47')]=function(_0x13be81,_0x1c02d7){return respondWithRpcPromise(_0x6e70('0x46'),_0x13be81[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](findById(_0x13be81[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x1c02d7,null))[_0x6e70('0xf')](handleError(_0x1c02d7,null));};exports[_0x6e70('0x48')]=function(_0xb8f78,_0x1fd9a6){return respondWithRpcPromise(_0x6e70('0x49'),_0xb8f78[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x1fd9a6,null))[_0x6e70('0xf')](handleError(_0x1fd9a6,null));};exports[_0x6e70('0x4a')]=function(_0x1c7dca,_0x4c6aab){return respondWithRpcPromise(_0x6e70('0x49'),_0x1c7dca[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](findById(_0x1c7dca[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x4c6aab,null))[_0x6e70('0xf')](handleError(_0x4c6aab,null));};exports['mailAccounts']=function(_0x42bd85,_0x6cabf0){return respondWithRpcPromise('MailAccounts',_0x42bd85[_0x6e70('0x17')],mailClient)[_0x6e70('0xa')](respondWithResult(_0x6cabf0,null))[_0x6e70('0xf')](handleError(_0x6cabf0,null));};exports['openchannelQueues']=function(_0x51f268,_0x2f9be4){return respondWithRpcPromise(_0x6e70('0x4b'),_0x51f268[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x2f9be4,null))[_0x6e70('0xf')](handleError(_0x2f9be4,null));};exports[_0x6e70('0x4c')]=function(_0x30cd88,_0x57bfe5){return respondWithRpcPromise('OpenchannelQueues',_0x30cd88[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](findById(_0x30cd88[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x57bfe5,null))['catch'](handleError(_0x57bfe5,null));};exports['smsQueues']=function(_0x2e972b,_0x4e5545){return respondWithRpcPromise('SmsQueues',_0x2e972b['query'],routingClient)[_0x6e70('0xa')](respondWithResult(_0x4e5545,null))['catch'](handleError(_0x4e5545,null));};exports[_0x6e70('0x4d')]=function(_0x23900b,_0x3b4da0){return respondWithRpcPromise(_0x6e70('0x4e'),_0x23900b[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](findById(_0x23900b[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x3b4da0,null))['catch'](handleError(_0x3b4da0,null));};exports[_0x6e70('0x4f')]=function(_0x6a560f,_0x22c836){return respondWithRpcPromise(_0x6e70('0x50'),_0x6a560f[_0x6e70('0x17')],routingClient)['then'](respondWithResult(_0x22c836,null))['catch'](handleError(_0x22c836,null));};exports['showWhatsappQueues']=function(_0x1bb338,_0xd91b9){return respondWithRpcPromise(_0x6e70('0x50'),_0x1bb338['query'],routingClient)['then'](findById(_0x1bb338[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0xd91b9,null))[_0x6e70('0xf')](handleError(_0xd91b9,null));};exports[_0x6e70('0x51')]=function(_0x2285f1,_0x32b884){return respondWithRpcPromise('FaxQueues',_0x2285f1[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x32b884,null))[_0x6e70('0xf')](handleError(_0x32b884,null));};exports[_0x6e70('0x52')]=function(_0x515c0c,_0xce964b){return respondWithRpcPromise('FaxQueues',_0x515c0c['query'],routingClient)[_0x6e70('0xa')](findById(_0x515c0c[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0xce964b,null))[_0x6e70('0xf')](handleError(_0xce964b,null));};exports[_0x6e70('0x53')]=function(_0x2be0fc,_0x4b5b19){return respondWithRpcPromise(_0x6e70('0x54'),_0x2be0fc[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x4b5b19,null))[_0x6e70('0xf')](handleError(_0x4b5b19,null));};exports[_0x6e70('0x55')]=function(_0x13c092,_0x363722){return respondWithRpcPromise(_0x6e70('0x56'),_0x13c092[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x363722,null))['catch'](handleError(_0x363722,null));};exports[_0x6e70('0x57')]=function(_0x303c5a,_0x577c3b){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x303c5a['query'],routingClient)[_0x6e70('0xa')](respondWithResult(_0x577c3b,null))[_0x6e70('0xf')](handleError(_0x577c3b,null));};exports[_0x6e70('0x58')]=function(_0x14bb74,_0x5a3dcb){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x14bb74['query'],routingClient)[_0x6e70('0xa')](respondWithResult(_0x5a3dcb,null))[_0x6e70('0xf')](handleError(_0x5a3dcb,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x58666a,_0x1c7c5f){return respondWithRpcPromise(_0x6e70('0x59'),_0x58666a[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](function(_0x44bf96){if(_0x58666a[_0x6e70('0x17')][_0x6e70('0x5a')]!==undefined){var _0x3650e9=_(_0x44bf96[_0x6e70('0x15')])[_0x6e70('0x5b')]([_0x58666a[_0x6e70('0x17')][_0x6e70('0x5a')],_0x58666a[_0x6e70('0x1b')]['id']])['map']('queue_id')[_0x6e70('0x5c')]()['value']();return _0x44bf96[_0x6e70('0x15')]['filter'](function(_0x5b5471){return _0x3650e9[_0x6e70('0x5d')](_0x5b5471['queue_id'])>-0x1;});}else{return _0x44bf96['rows'][_0x6e70('0x5b')](function(_0x21e4c2){return _0x21e4c2[_0x6e70('0x5e')]===parseInt(_0x58666a['params']['id']);});}})['then'](respondWithResult(_0x1c7c5f,null))['catch'](handleError(_0x1c7c5f,null));};exports[_0x6e70('0x5f')]=function(_0x512b0a,_0x2e8ed3){return respondWithRpcPromise(_0x6e70('0x60'),_0x512b0a[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x2e8ed3,null))[_0x6e70('0xf')](handleError(_0x2e8ed3,null));};exports[_0x6e70('0x61')]=function(_0x214a8f,_0x50046a){return respondWithRpcPromise(_0x6e70('0x62'),_0x214a8f[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x50046a,null))['catch'](handleError(_0x50046a,null));};exports[_0x6e70('0x63')]=function(_0x227d94,_0x11a615){return respondWithRpcPromise(_0x6e70('0x64'),_0x227d94[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x11a615,null))[_0x6e70('0xf')](handleError(_0x11a615,null));};exports[_0x6e70('0x65')]=function(_0x461ec0){return function(_0x48f6fd,_0x463eed){var _0x39e6db,_0x53acc8;var _0x252f07=_[_0x6e70('0x66')](_0x461ec0);var _0x51be27=_0x461ec0==='chat'?_0x6e70('0x67'):'Account';return db[_0x252f07+_0x6e70('0x68')]['findOne']({'raw':!![],'where':{'id':_0x48f6fd[_0x6e70('0x1b')]['id']}})[_0x6e70('0xa')](function(_0x106f32){if(_[_0x6e70('0x14')](_0x106f32)){throw new Error(_0x252f07+_0x6e70('0x69'));}_0x39e6db=_0x106f32;return db[_0x252f07+_0x6e70('0x6a')][_0x6e70('0x6b')]({'where':{'id':_0x48f6fd['body']['messageId']},'include':[{'model':db[_0x252f07+_0x6e70('0x6c')],'as':'Interaction'},{'model':db[_0x252f07+_0x51be27],'as':_0x6e70('0x6d')}]});})[_0x6e70('0xa')](function(_0x28e5b1){if(_[_0x6e70('0x14')](_0x28e5b1)){throw new Error(_0x252f07+'\x20Message\x20not\x20found');}_0x53acc8=_0x28e5b1;return _0x28e5b1[_0x6e70('0x6e')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x260dfa={'uniqueid':_0x461ec0+'.'+_0x53acc8['id']+'.'+_0x53acc8[_0x6e70('0x6c')]['id'],'FromUserId':_0x48f6fd[_0x6e70('0x31')]['id'],'type':_0x6e70('0x6f')};_0x260dfa[_0x252f07+_0x6e70('0x70')]=_0x53acc8['id'];_0x260dfa[_0x252f07+_0x6e70('0x71')]=_0x53acc8[_0x6e70('0x6c')]['id'];_0x260dfa['From'+_0x252f07+_0x51be27+'Id']=_0x53acc8[_0x6e70('0x6d')]['id'];_0x260dfa['To'+_0x252f07+'QueueId']=_0x39e6db['id'];return db[_0x252f07+_0x6e70('0x72')]['create'](_0x260dfa);})['then'](function(){return respondWithRpcPromise('Start',{'channel':_0x461ec0,'interaction':_0x53acc8[_0x6e70('0x6c')],'message':_0x53acc8,'account':_0x53acc8[_0x6e70('0x6d')],'applications':[{'id':0x0,'priority':0x1,'app':_0x6e70('0x6f'),'appdata':_0x39e6db[_0x6e70('0x12')]+','+(_0x53acc8[_0x6e70('0x6d')]['queueTransferTimeout']||0x12c),'interval':_0x6e70('0x73')}],'transfer':!![]},routingClient);})[_0x6e70('0xa')](respondWithResult(_0x463eed,null))['catch'](handleError(_0x463eed,null));};};exports[_0x6e70('0x74')]=function(_0x50e494,_0x17d3a4){var _0x5d0585,_0x4a87e2;if(_[_0x6e70('0x14')](_0x50e494[_0x6e70('0x21')][_0x6e70('0x75')])){throw new Error(_0x6e70('0x76'));}var _0x3e6661=_0x50e494[_0x6e70('0x21')][_0x6e70('0x75')];var _0x5c0276=_[_0x6e70('0x66')](_0x3e6661);var _0x4f4a16=_0x3e6661===_0x6e70('0x77')?_0x6e70('0x67'):_0x6e70('0x6d');return db[_0x6e70('0x78')][_0x6e70('0x6b')]({'raw':!![],'where':{'id':_0x50e494[_0x6e70('0x1b')]['id'],'role':_0x6e70('0x3d')}})['then'](function(_0x4466f0){if(_['isNil'](_0x4466f0)){throw new Error(_0x6e70('0x79'));}_0x5d0585=_0x4466f0;return db[_0x5c0276+_0x6e70('0x6a')][_0x6e70('0x6b')]({'where':{'id':_0x50e494[_0x6e70('0x21')][_0x6e70('0x7a')]},'include':[{'model':db[_0x5c0276+_0x6e70('0x6c')],'as':_0x6e70('0x6c')},{'model':db[_0x5c0276+_0x4f4a16],'as':_0x6e70('0x6d')}]});})[_0x6e70('0xa')](function(_0x162bc3){if(_['isNil'](_0x162bc3)){throw new Error(_0x5c0276+_0x6e70('0x7b'));}_0x4a87e2=_0x162bc3;return _0x162bc3[_0x6e70('0x6e')]({'read':0x0,'readAt':null,'UserId':null});})[_0x6e70('0xa')](function(){var _0x181802={'uniqueid':_0x3e6661+'.'+_0x4a87e2['id']+'.'+_0x4a87e2[_0x6e70('0x6c')]['id'],'FromUserId':_0x50e494['user']['id'],'type':'agent','ToUserId':_0x5d0585['id']};_0x181802[_0x5c0276+'MessageId']=_0x4a87e2['id'];_0x181802[_0x5c0276+_0x6e70('0x71')]=_0x4a87e2[_0x6e70('0x6c')]['id'];_0x181802[_0x6e70('0x7c')+_0x5c0276+_0x4f4a16+'Id']=_0x4a87e2[_0x6e70('0x6d')]['id'];return db[_0x5c0276+_0x6e70('0x72')][_0x6e70('0x7d')](_0x181802);})[_0x6e70('0xa')](function(){return respondWithRpcPromise(_0x6e70('0x7e'),{'channel':_0x3e6661,'interaction':_0x4a87e2[_0x6e70('0x6c')],'message':_0x4a87e2,'account':_0x4a87e2[_0x6e70('0x6d')],'applications':[{'id':0x0,'priority':0x1,'app':_0x6e70('0x3d'),'appdata':_0x5d0585[_0x6e70('0x12')]+','+(_0x4a87e2[_0x6e70('0x6d')][_0x6e70('0x7f')]||0x12c),'interval':_0x6e70('0x73')}],'transfer':!![]},routingClient);})['then'](respondWithResult(_0x17d3a4,null))[_0x6e70('0xf')](handleError(_0x17d3a4,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 2916b59..ffcf149 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 _0x8da8=['destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated','index','/:id','show','/:id/run','post','create','put','delete'];(function(_0x1e0888,_0x3e1030){var _0x4b5a30=function(_0x4d92de){while(--_0x4d92de){_0x1e0888['push'](_0x1e0888['shift']());}};_0x4b5a30(++_0x3e1030);}(_0x8da8,0x1a5));var _0x88da=function(_0x3ff0af,_0x1a3b24){_0x3ff0af=_0x3ff0af-0x0;var _0x38a28b=_0x8da8[_0x3ff0af];return _0x38a28b;};'use strict';var multer=require(_0x88da('0x0'));var util=require(_0x88da('0x1'));var path=require(_0x88da('0x2'));var timeout=require(_0x88da('0x3'));var express=require(_0x88da('0x4'));var router=express['Router']();var fs_extra=require(_0x88da('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x88da('0x6'));var config=require(_0x88da('0x7'));var controller=require(_0x88da('0x8'));router[_0x88da('0x9')]('/',auth[_0x88da('0xa')](),controller[_0x88da('0xb')]);router['get'](_0x88da('0xc'),auth[_0x88da('0xa')](),controller[_0x88da('0xd')]);router[_0x88da('0x9')](_0x88da('0xe'),auth['isAuthenticated'](),controller['run']);router[_0x88da('0xf')]('/',auth[_0x88da('0xa')](),controller[_0x88da('0x10')]);router[_0x88da('0x11')]('/:id',auth[_0x88da('0xa')](),controller['update']);router[_0x88da('0x12')]('/:id',auth[_0x88da('0xa')](),controller[_0x88da('0x13')]);module['exports']=router; \ No newline at end of file +var _0xce03=['../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated','/:id','show','/:id/run','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x48ebe8,_0x300832){var _0x5c65fb=function(_0x55a95b){while(--_0x55a95b){_0x48ebe8['push'](_0x48ebe8['shift']());}};_0x5c65fb(++_0x300832);}(_0xce03,0x66));var _0x3ce0=function(_0x32b0e4,_0x4e8687){_0x32b0e4=_0x32b0e4-0x0;var _0x39d13d=_0xce03[_0x32b0e4];return _0x39d13d;};'use strict';var multer=require(_0x3ce0('0x0'));var util=require(_0x3ce0('0x1'));var path=require(_0x3ce0('0x2'));var timeout=require(_0x3ce0('0x3'));var express=require(_0x3ce0('0x4'));var router=express[_0x3ce0('0x5')]();var fs_extra=require(_0x3ce0('0x6'));var auth=require(_0x3ce0('0x7'));var interaction=require(_0x3ce0('0x8'));var config=require(_0x3ce0('0x9'));var controller=require(_0x3ce0('0xa'));router[_0x3ce0('0xb')]('/',auth[_0x3ce0('0xc')](),controller['index']);router[_0x3ce0('0xb')](_0x3ce0('0xd'),auth[_0x3ce0('0xc')](),controller[_0x3ce0('0xe')]);router['get'](_0x3ce0('0xf'),auth[_0x3ce0('0xc')](),controller['run']);router[_0x3ce0('0x10')]('/',auth['isAuthenticated'](),controller[_0x3ce0('0x11')]);router[_0x3ce0('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x3ce0('0x13')]);router['delete']('/:id',auth[_0x3ce0('0xc')](),controller[_0x3ce0('0x14')]);module[_0x3ce0('0x15')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 7464838..0e9e7fd 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 _0xc4fe=['hours','minutes','csv','pdf','xlsx','custom','default','TEXT','sequelize','exports','STRING','BOOLEAN','DATE','INTEGER','ENUM','years','quarters','weeks','days'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xc4fe,0xc6));var _0xec4f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc4fe[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xec4f('0x0'));module[_0xec4f('0x1')]={'name':{'type':Sequelize[_0xec4f('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xec4f('0x2')]},'active':{'type':Sequelize[_0xec4f('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize[_0xec4f('0x4')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xec4f('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xec4f('0x6')](_0xec4f('0x7'),_0xec4f('0x8'),'months',_0xec4f('0x9'),_0xec4f('0xa'),_0xec4f('0xb'),_0xec4f('0xc')),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize[_0xec4f('0x6')](_0xec4f('0xd'),_0xec4f('0xe'),_0xec4f('0xf')),'allowNull':![],'defaultValue':_0xec4f('0xd')},'type':{'type':Sequelize[_0xec4f('0x6')](_0xec4f('0x10'),_0xec4f('0x11')),'allowNull':![],'defaultValue':_0xec4f('0x10')},'sendMail':{'type':Sequelize[_0xec4f('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0xec4f('0x2')]},'cc':{'type':Sequelize[_0xec4f('0x12')]},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize[_0xec4f('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0xa7a3=['0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','quarters','weeks','days','hours','csv','custom','default','TEXT','BOOLEAN','sequelize','exports','STRING'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa7a3,0x96));var _0x3a7a=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0xa7a3[_0x1203f];return _0x365f0a;};'use strict';var Sequelize=require(_0x3a7a('0x0'));module[_0x3a7a('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x3a7a('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x3a7a('0x2')],'allowNull':![],'defaultValue':_0x3a7a('0x3')},'startAt':{'type':Sequelize[_0x3a7a('0x4')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x3a7a('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x3a7a('0x6')](_0x3a7a('0x7'),_0x3a7a('0x8'),'months',_0x3a7a('0x9'),_0x3a7a('0xa'),_0x3a7a('0xb'),'minutes'),'allowNull':![],'defaultValue':_0x3a7a('0xa')},'output':{'type':Sequelize[_0x3a7a('0x6')](_0x3a7a('0xc'),'pdf','xlsx'),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize['ENUM'](_0x3a7a('0xd'),_0x3a7a('0xe')),'allowNull':![],'defaultValue':_0x3a7a('0xd')},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x3a7a('0xf')]},'bcc':{'type':Sequelize[_0x3a7a('0xf')]},'sendIfEmpty':{'type':Sequelize[_0x3a7a('0x10')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 90309ea..3b545f1 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 _0xe1bc=['fs-extra','lodash','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','then','get','Scheduler','UserProfileResource','destroy','sendStatus','error','stack','name','index','map','Schedule','rawAttributes','fieldName','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','options','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','run','../../config/schedule','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs'];(function(_0x4c9810,_0x38bd0f){var _0xe8bd92=function(_0xf80f35){while(--_0xf80f35){_0x4c9810['push'](_0x4c9810['shift']());}};_0xe8bd92(++_0x38bd0f);}(_0xe1bc,0xe4));var _0xce1b=function(_0x20da66,_0x3c0691){_0x20da66=_0x20da66-0x0;var _0x32cfbb=_0xe1bc[_0x20da66];return _0x32cfbb;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xce1b('0x0'));var jsonpatch=require(_0xce1b('0x1'));var rp=require(_0xce1b('0x2'));var moment=require(_0xce1b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xce1b('0x4'));var util=require(_0xce1b('0x5'));var path=require(_0xce1b('0x6'));var sox=require('sox');var csv=require(_0xce1b('0x7'));var ejs=require(_0xce1b('0x8'));var fs=require('fs');var fs_extra=require(_0xce1b('0x9'));var _=require(_0xce1b('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xce1b('0x7'));var querystring=require(_0xce1b('0xb'));var Papa=require(_0xce1b('0xc'));var Redis=require(_0xce1b('0xd'));var authService=require(_0xce1b('0xe'));var qs=require(_0xce1b('0xf'));var as=require(_0xce1b('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xce1b('0x11'))(_0xce1b('0x12'));var utils=require(_0xce1b('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xce1b('0x14'))['db'];function respondWithStatusCode(_0x16a618,_0x2cb877){_0x2cb877=_0x2cb877||0xcc;return function(_0x511e9f){if(_0x511e9f){return _0x16a618['sendStatus'](_0x2cb877);}return _0x16a618['status'](_0x2cb877)[_0xce1b('0x15')]();};}function respondWithResult(_0x23fc73,_0x124ff0){_0x124ff0=_0x124ff0||0xc8;return function(_0x370621){if(_0x370621){return _0x23fc73['status'](_0x124ff0)[_0xce1b('0x16')](_0x370621);}};}function respondWithFilteredResult(_0x51e789,_0x46410a){return function(_0x277a81){if(_0x277a81){var _0x294ce1=typeof _0x46410a[_0xce1b('0x17')]===_0xce1b('0x18')&&typeof _0x46410a[_0xce1b('0x19')]==='undefined';var _0x460587=_0x277a81[_0xce1b('0x1a')];var _0x1d5cde=_0x294ce1?0x0:_0x46410a[_0xce1b('0x17')];var _0x1a069a=_0x294ce1?_0x277a81[_0xce1b('0x1a')]:_0x46410a[_0xce1b('0x17')]+_0x46410a[_0xce1b('0x19')];var _0x4270bb;if(_0x1a069a>=_0x460587){_0x1a069a=_0x460587;_0x4270bb=0xc8;}else{_0x4270bb=0xce;}_0x51e789[_0xce1b('0x1b')](_0x4270bb);return _0x51e789[_0xce1b('0x1c')](_0xce1b('0x1d'),_0x1d5cde+'-'+_0x1a069a+'/'+_0x460587)['json'](_0x277a81);}return null;};}function patchUpdates(_0x1807f6){return function(_0x21eef7){try{jsonpatch[_0xce1b('0x1e')](_0x21eef7,_0x1807f6,!![]);}catch(_0x174b1e){return BPromise[_0xce1b('0x1f')](_0x174b1e);}return _0x21eef7[_0xce1b('0x20')]();};}function saveUpdates(_0x598da9,_0x3889d6){return function(_0x100f81){if(_0x100f81){return _0x100f81['update'](_0x598da9)[_0xce1b('0x21')](function(_0x3129da){return _0x3129da;});}return null;};}function removeEntity(_0x5ad4a7,_0x2f6dd3){return function(_0x36a52f){if(_0x36a52f){return _0x36a52f['destroy']()[_0xce1b('0x21')](function(){var _0x215498=_0x36a52f[_0xce1b('0x22')]({'plain':!![]});var _0x2a277a=_0xce1b('0x23');return db[_0xce1b('0x24')][_0xce1b('0x25')]({'where':{'type':_0x2a277a,'resourceId':_0x215498['id']}})['then'](function(){return _0x36a52f;});})['then'](function(){_0x5ad4a7[_0xce1b('0x1b')](0xcc)[_0xce1b('0x15')]();});}};}function handleEntityNotFound(_0x2a8c94,_0x8c3088){return function(_0x1052c6){if(!_0x1052c6){_0x2a8c94[_0xce1b('0x26')](0x194);}return _0x1052c6;};}function handleError(_0x32e8d4,_0x316638){_0x316638=_0x316638||0x1f4;return function(_0x212d08){logger[_0xce1b('0x27')](_0x212d08[_0xce1b('0x28')]);if(_0x212d08[_0xce1b('0x29')]){delete _0x212d08[_0xce1b('0x29')];}_0x32e8d4[_0xce1b('0x1b')](_0x316638)['send'](_0x212d08);};}exports[_0xce1b('0x2a')]=function(_0x42f976,_0x2ca9a6){var _0x2ed4d4={},_0x485f28={},_0x2b2e8d={'count':0x0,'rows':[]};var _0x29f9e7=_[_0xce1b('0x2b')](db[_0xce1b('0x2c')][_0xce1b('0x2d')],function(_0x2685c4){return{'name':_0x2685c4[_0xce1b('0x2e')],'type':_0x2685c4['type'][_0xce1b('0x2f')]};});_0x485f28['model']=_[_0xce1b('0x2b')](_0x29f9e7,_0xce1b('0x29'));_0x485f28[_0xce1b('0x30')]=_[_0xce1b('0x31')](_0x42f976[_0xce1b('0x30')]);_0x485f28[_0xce1b('0x32')]=_['intersection'](_0x485f28[_0xce1b('0x33')],_0x485f28[_0xce1b('0x30')]);_0x2ed4d4[_0xce1b('0x34')]=_[_0xce1b('0x35')](_0x485f28[_0xce1b('0x33')],qs[_0xce1b('0x36')](_0x42f976[_0xce1b('0x30')][_0xce1b('0x36')]));_0x2ed4d4['attributes']=_0x2ed4d4[_0xce1b('0x34')][_0xce1b('0x37')]?_0x2ed4d4['attributes']:_0x485f28[_0xce1b('0x33')];if(!_0x42f976[_0xce1b('0x30')][_0xce1b('0x38')](_0xce1b('0x39'))){_0x2ed4d4['limit']=qs[_0xce1b('0x19')](_0x42f976[_0xce1b('0x30')][_0xce1b('0x19')]);_0x2ed4d4[_0xce1b('0x17')]=qs[_0xce1b('0x17')](_0x42f976['query'][_0xce1b('0x17')]);}_0x2ed4d4[_0xce1b('0x3a')]=qs[_0xce1b('0x3b')](_0x42f976['query'][_0xce1b('0x3b')]);_0x2ed4d4[_0xce1b('0x3c')]=qs[_0xce1b('0x32')](_[_0xce1b('0x3d')](_0x42f976[_0xce1b('0x30')],_0x485f28[_0xce1b('0x32')]),_0x29f9e7);if(_0x42f976['query']['filter']){_0x2ed4d4[_0xce1b('0x3c')]=_['merge'](_0x2ed4d4['where'],{'$or':_['map'](_0x29f9e7,function(_0x44705e){if(_0x44705e['type']!=='VIRTUAL'){var _0x2034a8={};_0x2034a8[_0x44705e[_0xce1b('0x29')]]={'$like':'%'+_0x42f976[_0xce1b('0x30')][_0xce1b('0x3e')]+'%'};return _0x2034a8;}})});}_0x2ed4d4=_[_0xce1b('0x3f')]({},_0x2ed4d4,_0x42f976['options']);var _0x35c1d2={'where':_0x2ed4d4[_0xce1b('0x3c')]};return db[_0xce1b('0x2c')]['count'](_0x35c1d2)[_0xce1b('0x21')](function(_0x26d7cf){_0x2b2e8d[_0xce1b('0x1a')]=_0x26d7cf;if(_0x42f976[_0xce1b('0x30')][_0xce1b('0x40')]){_0x2ed4d4[_0xce1b('0x41')]=[{'all':!![]}];}return db['Schedule'][_0xce1b('0x42')](_0x2ed4d4);})[_0xce1b('0x21')](function(_0xc99839){_0x2b2e8d[_0xce1b('0x43')]=_0xc99839;return _0x2b2e8d;})['then'](respondWithFilteredResult(_0x2ca9a6,_0x2ed4d4))[_0xce1b('0x44')](handleError(_0x2ca9a6,null));};exports['show']=function(_0x4b8731,_0x304ef1){var _0x5ec231={'raw':![],'where':{'id':_0x4b8731['params']['id']}},_0x5ad3d6={};_0x5ad3d6[_0xce1b('0x33')]=_['keys'](db[_0xce1b('0x2c')][_0xce1b('0x2d')]);_0x5ad3d6[_0xce1b('0x30')]=_['keys'](_0x4b8731['query']);_0x5ad3d6[_0xce1b('0x32')]=_[_0xce1b('0x35')](_0x5ad3d6[_0xce1b('0x33')],_0x5ad3d6['query']);_0x5ec231[_0xce1b('0x34')]=_[_0xce1b('0x35')](_0x5ad3d6[_0xce1b('0x33')],qs[_0xce1b('0x36')](_0x4b8731['query'][_0xce1b('0x36')]));_0x5ec231[_0xce1b('0x34')]=_0x5ec231[_0xce1b('0x34')][_0xce1b('0x37')]?_0x5ec231[_0xce1b('0x34')]:_0x5ad3d6[_0xce1b('0x33')];if(_0x4b8731[_0xce1b('0x30')][_0xce1b('0x40')]){_0x5ec231[_0xce1b('0x41')]=[{'all':!![]}];}_0x5ec231=_['merge']({},_0x5ec231,_0x4b8731[_0xce1b('0x45')]);return db[_0xce1b('0x2c')][_0xce1b('0x46')](_0x5ec231)[_0xce1b('0x21')](handleEntityNotFound(_0x304ef1,null))[_0xce1b('0x21')](respondWithResult(_0x304ef1,null))['catch'](handleError(_0x304ef1,null));};exports['create']=function(_0x4ac249,_0x2cd0c6){return db[_0xce1b('0x2c')]['create'](_0x4ac249[_0xce1b('0x47')],{})[_0xce1b('0x21')](function(_0x5bf802){var _0x826647=_0x4ac249[_0xce1b('0x48')][_0xce1b('0x22')]({'plain':!![]});if(!_0x826647)throw new Error(_0xce1b('0x49'));if(_0x826647[_0xce1b('0x4a')]===_0xce1b('0x48')){var _0x1d7329=_0x5bf802[_0xce1b('0x22')]({'plain':!![]});var _0x453b8c=_0xce1b('0x23');return db['UserProfileSection']['find']({'where':{'name':_0x453b8c,'userProfileId':_0x826647['userProfileId']},'raw':!![]})['then'](function(_0x7077a2){if(_0x7077a2&&_0x7077a2['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x1d7329[_0xce1b('0x29')],'resourceId':_0x1d7329['id'],'type':_0x7077a2[_0xce1b('0x29')],'sectionId':_0x7077a2['id']},{})[_0xce1b('0x21')](function(){return _0x5bf802;});}else{return _0x5bf802;}})[_0xce1b('0x44')](function(_0x38e78d){logger[_0xce1b('0x27')](_0xce1b('0x4b'),_0x38e78d);throw _0x38e78d;});}return _0x5bf802;})[_0xce1b('0x21')](respondWithResult(_0x2cd0c6,0xc9))['catch'](handleError(_0x2cd0c6,null));};exports['update']=function(_0x39e37a,_0xa7eb8b){if(_0x39e37a[_0xce1b('0x47')]['id']){delete _0x39e37a[_0xce1b('0x47')]['id'];}return db[_0xce1b('0x2c')][_0xce1b('0x46')]({'where':{'id':_0x39e37a[_0xce1b('0x4c')]['id']}})[_0xce1b('0x21')](handleEntityNotFound(_0xa7eb8b,null))[_0xce1b('0x21')](saveUpdates(_0x39e37a[_0xce1b('0x47')],null))[_0xce1b('0x21')](respondWithResult(_0xa7eb8b,null))[_0xce1b('0x44')](handleError(_0xa7eb8b,null));};exports[_0xce1b('0x25')]=function(_0x8a5926,_0xd253b9){return db[_0xce1b('0x2c')]['find']({'where':{'id':_0x8a5926[_0xce1b('0x4c')]['id']}})[_0xce1b('0x21')](handleEntityNotFound(_0xd253b9,null))[_0xce1b('0x21')](removeEntity(_0xd253b9,null))[_0xce1b('0x44')](handleError(_0xd253b9,null));};exports[_0xce1b('0x4d')]=function(_0x302905,_0x5d5dfc,_0x2f2801){var _0x15aac9=require(_0xce1b('0x4e'));return db[_0xce1b('0x2c')]['find']({'where':{'id':_0x302905[_0xce1b('0x4c')]['id']},'raw':!![]})[_0xce1b('0x21')](handleEntityNotFound(_0x5d5dfc,null))[_0xce1b('0x21')](function(){_0x15aac9[_0xce1b('0x4d')](_0x302905[_0xce1b('0x4c')]['id']);})[_0xce1b('0x21')](respondWithStatusCode(_0x5d5dfc,null))[_0xce1b('0x44')](handleError(_0x5d5dfc,null));}; \ No newline at end of file +var _0xd995=['undefined','limit','count','offset','status','set','Content-Range','json','apply','reject','save','then','destroy','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','Schedule','includeAll','include','findAll','rows','catch','show','params','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Scheduler','UserProfileSection','userProfileId','../../config/schedule','run','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x3f407c,_0x3784e5){var _0x48492e=function(_0x5e29e5){while(--_0x5e29e5){_0x3f407c['push'](_0x3f407c['shift']());}};_0x48492e(++_0x3784e5);}(_0xd995,0xe8));var _0x5d99=function(_0x2d7f62,_0x448750){_0x2d7f62=_0x2d7f62-0x0;var _0x22b0d7=_0xd995[_0x2d7f62];return _0x22b0d7;};'use strict';var emlformat=require(_0x5d99('0x0'));var rimraf=require(_0x5d99('0x1'));var zipdir=require(_0x5d99('0x2'));var jsonpatch=require(_0x5d99('0x3'));var rp=require(_0x5d99('0x4'));var moment=require(_0x5d99('0x5'));var BPromise=require(_0x5d99('0x6'));var Mustache=require('mustache');var util=require(_0x5d99('0x7'));var path=require(_0x5d99('0x8'));var sox=require('sox');var csv=require(_0x5d99('0x9'));var ejs=require(_0x5d99('0xa'));var fs=require('fs');var fs_extra=require(_0x5d99('0xb'));var _=require(_0x5d99('0xc'));var squel=require(_0x5d99('0xd'));var crypto=require('crypto');var jsforce=require(_0x5d99('0xe'));var deskjs=require(_0x5d99('0xf'));var toCsv=require(_0x5d99('0x9'));var querystring=require('querystring');var Papa=require(_0x5d99('0x10'));var Redis=require(_0x5d99('0x11'));var authService=require(_0x5d99('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x5d99('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5d99('0x14'))(_0x5d99('0x15'));var utils=require('../../config/utils');var config=require(_0x5d99('0x16'));var licenseUtil=require(_0x5d99('0x17'));var db=require(_0x5d99('0x18'))['db'];function respondWithStatusCode(_0x4fa5b0,_0x574b0d){_0x574b0d=_0x574b0d||0xcc;return function(_0x5ddad7){if(_0x5ddad7){return _0x4fa5b0[_0x5d99('0x19')](_0x574b0d);}return _0x4fa5b0['status'](_0x574b0d)['end']();};}function respondWithResult(_0xc82fe1,_0x363018){_0x363018=_0x363018||0xc8;return function(_0xf32019){if(_0xf32019){return _0xc82fe1['status'](_0x363018)['json'](_0xf32019);}};}function respondWithFilteredResult(_0x16dfb9,_0x25d524){return function(_0x29ca81){if(_0x29ca81){var _0x1e3035=typeof _0x25d524['offset']===_0x5d99('0x1a')&&typeof _0x25d524[_0x5d99('0x1b')]===_0x5d99('0x1a');var _0x161e01=_0x29ca81[_0x5d99('0x1c')];var _0x3b7a64=_0x1e3035?0x0:_0x25d524[_0x5d99('0x1d')];var _0x1b0918=_0x1e3035?_0x29ca81['count']:_0x25d524[_0x5d99('0x1d')]+_0x25d524[_0x5d99('0x1b')];var _0x5a56f4;if(_0x1b0918>=_0x161e01){_0x1b0918=_0x161e01;_0x5a56f4=0xc8;}else{_0x5a56f4=0xce;}_0x16dfb9[_0x5d99('0x1e')](_0x5a56f4);return _0x16dfb9[_0x5d99('0x1f')](_0x5d99('0x20'),_0x3b7a64+'-'+_0x1b0918+'/'+_0x161e01)[_0x5d99('0x21')](_0x29ca81);}return null;};}function patchUpdates(_0x4c8398){return function(_0x4ca354){try{jsonpatch[_0x5d99('0x22')](_0x4ca354,_0x4c8398,!![]);}catch(_0x2f1844){return BPromise[_0x5d99('0x23')](_0x2f1844);}return _0x4ca354[_0x5d99('0x24')]();};}function saveUpdates(_0x1c7f31,_0x1e3713){return function(_0x57ae4e){if(_0x57ae4e){return _0x57ae4e['update'](_0x1c7f31)[_0x5d99('0x25')](function(_0x59bb61){return _0x59bb61;});}return null;};}function removeEntity(_0x3281ef,_0x14a816){return function(_0x5059ba){if(_0x5059ba){return _0x5059ba[_0x5d99('0x26')]()[_0x5d99('0x25')](function(){var _0x25368e=_0x5059ba['get']({'plain':!![]});var _0x4009bd='Scheduler';return db[_0x5d99('0x27')][_0x5d99('0x26')]({'where':{'type':_0x4009bd,'resourceId':_0x25368e['id']}})[_0x5d99('0x25')](function(){return _0x5059ba;});})[_0x5d99('0x25')](function(){_0x3281ef['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x185dd4,_0x1f6ba2){return function(_0x1d4bcd){if(!_0x1d4bcd){_0x185dd4['sendStatus'](0x194);}return _0x1d4bcd;};}function handleError(_0x596faa,_0x28a04f){_0x28a04f=_0x28a04f||0x1f4;return function(_0x44478c){logger[_0x5d99('0x28')](_0x44478c[_0x5d99('0x29')]);if(_0x44478c[_0x5d99('0x2a')]){delete _0x44478c['name'];}_0x596faa['status'](_0x28a04f)[_0x5d99('0x2b')](_0x44478c);};}exports[_0x5d99('0x2c')]=function(_0x5c7085,_0x365a33){var _0x5071a0={},_0x29b406={},_0x319363={'count':0x0,'rows':[]};var _0xccb313=_[_0x5d99('0x2d')](db['Schedule'][_0x5d99('0x2e')],function(_0x27f372){return{'name':_0x27f372[_0x5d99('0x2f')],'type':_0x27f372['type'][_0x5d99('0x30')]};});_0x29b406[_0x5d99('0x31')]=_[_0x5d99('0x2d')](_0xccb313,'name');_0x29b406['query']=_[_0x5d99('0x32')](_0x5c7085[_0x5d99('0x33')]);_0x29b406[_0x5d99('0x34')]=_[_0x5d99('0x35')](_0x29b406['model'],_0x29b406[_0x5d99('0x33')]);_0x5071a0[_0x5d99('0x36')]=_[_0x5d99('0x35')](_0x29b406[_0x5d99('0x31')],qs[_0x5d99('0x37')](_0x5c7085['query'][_0x5d99('0x37')]));_0x5071a0[_0x5d99('0x36')]=_0x5071a0[_0x5d99('0x36')][_0x5d99('0x38')]?_0x5071a0['attributes']:_0x29b406['model'];if(!_0x5c7085[_0x5d99('0x33')][_0x5d99('0x39')](_0x5d99('0x3a'))){_0x5071a0[_0x5d99('0x1b')]=qs[_0x5d99('0x1b')](_0x5c7085[_0x5d99('0x33')][_0x5d99('0x1b')]);_0x5071a0[_0x5d99('0x1d')]=qs[_0x5d99('0x1d')](_0x5c7085[_0x5d99('0x33')][_0x5d99('0x1d')]);}_0x5071a0[_0x5d99('0x3b')]=qs[_0x5d99('0x3c')](_0x5c7085[_0x5d99('0x33')][_0x5d99('0x3c')]);_0x5071a0[_0x5d99('0x3d')]=qs[_0x5d99('0x34')](_[_0x5d99('0x3e')](_0x5c7085[_0x5d99('0x33')],_0x29b406[_0x5d99('0x34')]),_0xccb313);if(_0x5c7085[_0x5d99('0x33')][_0x5d99('0x3f')]){_0x5071a0[_0x5d99('0x3d')]=_[_0x5d99('0x40')](_0x5071a0[_0x5d99('0x3d')],{'$or':_[_0x5d99('0x2d')](_0xccb313,function(_0x5a6f54){if(_0x5a6f54['type']!=='VIRTUAL'){var _0x55131a={};_0x55131a[_0x5a6f54[_0x5d99('0x2a')]]={'$like':'%'+_0x5c7085[_0x5d99('0x33')]['filter']+'%'};return _0x55131a;}})});}_0x5071a0=_['merge']({},_0x5071a0,_0x5c7085[_0x5d99('0x41')]);var _0x47a368={'where':_0x5071a0[_0x5d99('0x3d')]};return db[_0x5d99('0x42')][_0x5d99('0x1c')](_0x47a368)['then'](function(_0x414494){_0x319363[_0x5d99('0x1c')]=_0x414494;if(_0x5c7085[_0x5d99('0x33')][_0x5d99('0x43')]){_0x5071a0[_0x5d99('0x44')]=[{'all':!![]}];}return db[_0x5d99('0x42')][_0x5d99('0x45')](_0x5071a0);})[_0x5d99('0x25')](function(_0x593657){_0x319363[_0x5d99('0x46')]=_0x593657;return _0x319363;})[_0x5d99('0x25')](respondWithFilteredResult(_0x365a33,_0x5071a0))[_0x5d99('0x47')](handleError(_0x365a33,null));};exports[_0x5d99('0x48')]=function(_0x479a55,_0x40ed7b){var _0x5496ed={'raw':![],'where':{'id':_0x479a55[_0x5d99('0x49')]['id']}},_0x2633da={};_0x2633da['model']=_[_0x5d99('0x32')](db['Schedule']['rawAttributes']);_0x2633da[_0x5d99('0x33')]=_[_0x5d99('0x32')](_0x479a55[_0x5d99('0x33')]);_0x2633da[_0x5d99('0x34')]=_['intersection'](_0x2633da[_0x5d99('0x31')],_0x2633da[_0x5d99('0x33')]);_0x5496ed[_0x5d99('0x36')]=_[_0x5d99('0x35')](_0x2633da['model'],qs[_0x5d99('0x37')](_0x479a55[_0x5d99('0x33')][_0x5d99('0x37')]));_0x5496ed[_0x5d99('0x36')]=_0x5496ed['attributes'][_0x5d99('0x38')]?_0x5496ed[_0x5d99('0x36')]:_0x2633da[_0x5d99('0x31')];if(_0x479a55['query'][_0x5d99('0x43')]){_0x5496ed['include']=[{'all':!![]}];}_0x5496ed=_[_0x5d99('0x40')]({},_0x5496ed,_0x479a55['options']);return db['Schedule'][_0x5d99('0x4a')](_0x5496ed)[_0x5d99('0x25')](handleEntityNotFound(_0x40ed7b,null))[_0x5d99('0x25')](respondWithResult(_0x40ed7b,null))[_0x5d99('0x47')](handleError(_0x40ed7b,null));};exports[_0x5d99('0x4b')]=function(_0x36a904,_0x2faa4d){return db['Schedule'][_0x5d99('0x4b')](_0x36a904[_0x5d99('0x4c')],{})[_0x5d99('0x25')](function(_0x3a63b3){var _0x21660f=_0x36a904['user'][_0x5d99('0x4d')]({'plain':!![]});if(!_0x21660f)throw new Error(_0x5d99('0x4e'));if(_0x21660f[_0x5d99('0x4f')]===_0x5d99('0x50')){var _0x1b44b6=_0x3a63b3[_0x5d99('0x4d')]({'plain':!![]});var _0x192f3e=_0x5d99('0x51');return db[_0x5d99('0x52')]['find']({'where':{'name':_0x192f3e,'userProfileId':_0x21660f[_0x5d99('0x53')]},'raw':!![]})[_0x5d99('0x25')](function(_0xd5c50d){if(_0xd5c50d&&_0xd5c50d['autoAssociation']===0x0){return db[_0x5d99('0x27')][_0x5d99('0x4b')]({'name':_0x1b44b6[_0x5d99('0x2a')],'resourceId':_0x1b44b6['id'],'type':_0xd5c50d[_0x5d99('0x2a')],'sectionId':_0xd5c50d['id']},{})['then'](function(){return _0x3a63b3;});}else{return _0x3a63b3;}})[_0x5d99('0x47')](function(_0x116467){logger[_0x5d99('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x116467);throw _0x116467;});}return _0x3a63b3;})[_0x5d99('0x25')](respondWithResult(_0x2faa4d,0xc9))['catch'](handleError(_0x2faa4d,null));};exports['update']=function(_0x133f34,_0xc99c8c){if(_0x133f34['body']['id']){delete _0x133f34[_0x5d99('0x4c')]['id'];}return db[_0x5d99('0x42')][_0x5d99('0x4a')]({'where':{'id':_0x133f34[_0x5d99('0x49')]['id']}})[_0x5d99('0x25')](handleEntityNotFound(_0xc99c8c,null))[_0x5d99('0x25')](saveUpdates(_0x133f34[_0x5d99('0x4c')],null))[_0x5d99('0x25')](respondWithResult(_0xc99c8c,null))[_0x5d99('0x47')](handleError(_0xc99c8c,null));};exports[_0x5d99('0x26')]=function(_0x31c215,_0x91e7d8){return db['Schedule'][_0x5d99('0x4a')]({'where':{'id':_0x31c215[_0x5d99('0x49')]['id']}})[_0x5d99('0x25')](handleEntityNotFound(_0x91e7d8,null))[_0x5d99('0x25')](removeEntity(_0x91e7d8,null))[_0x5d99('0x47')](handleError(_0x91e7d8,null));};exports['run']=function(_0x1eabf8,_0x47cb72,_0x5bc300){var _0x4338d1=require(_0x5d99('0x54'));return db[_0x5d99('0x42')][_0x5d99('0x4a')]({'where':{'id':_0x1eabf8[_0x5d99('0x49')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x47cb72,null))['then'](function(){_0x4338d1[_0x5d99('0x55')](_0x1eabf8[_0x5d99('0x49')]['id']);})[_0x5d99('0x25')](respondWithStatusCode(_0x47cb72,null))[_0x5d99('0x47')](handleError(_0x47cb72,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 3c15a55..7f3a5cf 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 _0x8104=['./schedule.attributes','exports','tools_schedules','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2caaa5,_0xa633c0){var _0x54681d=function(_0x4536b6){while(--_0x4536b6){_0x2caaa5['push'](_0x2caaa5['shift']());}};_0x54681d(++_0xa633c0);}(_0x8104,0x177));var _0x4810=function(_0x3def58,_0x55270e){_0x3def58=_0x3def58-0x0;var _0x4d745d=_0x8104[_0x3def58];return _0x4d745d;};'use strict';var _=require(_0x4810('0x0'));var util=require(_0x4810('0x1'));var logger=require('../../config/logger')(_0x4810('0x2'));var moment=require(_0x4810('0x3'));var BPromise=require(_0x4810('0x4'));var rp=require(_0x4810('0x5'));var fs=require('fs');var path=require(_0x4810('0x6'));var rimraf=require(_0x4810('0x7'));var config=require(_0x4810('0x8'));var attributes=require(_0x4810('0x9'));module[_0x4810('0xa')]=function(_0x38f0c0,_0xa350e2){return _0x38f0c0['define']('Schedule',attributes,{'tableName':_0x4810('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1815=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./schedule.attributes','exports','define','Schedule'];(function(_0x1486e5,_0x39684f){var _0x29d89b=function(_0x4a0a80){while(--_0x4a0a80){_0x1486e5['push'](_0x1486e5['shift']());}};_0x29d89b(++_0x39684f);}(_0x1815,0x168));var _0x5181=function(_0x34947e,_0x45c404){_0x34947e=_0x34947e-0x0;var _0x87404f=_0x1815[_0x34947e];return _0x87404f;};'use strict';var _=require('lodash');var util=require(_0x5181('0x0'));var logger=require(_0x5181('0x1'))(_0x5181('0x2'));var moment=require(_0x5181('0x3'));var BPromise=require('bluebird');var rp=require(_0x5181('0x4'));var fs=require('fs');var path=require(_0x5181('0x5'));var rimraf=require(_0x5181('0x6'));var config=require(_0x5181('0x7'));var attributes=require(_0x5181('0x8'));module[_0x5181('0x9')]=function(_0x6c6ad6,_0x169e18){return _0x6c6ad6[_0x5181('0xa')](_0x5181('0xb'),attributes,{'tableName':'tools_schedules','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 1be41f6..d0b3ef8 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 _0xb125=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','Schedule,\x20%s,\x20%s','debug','Schedule,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird'];(function(_0x87f273,_0x321f97){var _0x1f6e0e=function(_0x4ab0c9){while(--_0x4ab0c9){_0x87f273['push'](_0x87f273['shift']());}};_0x1f6e0e(++_0x321f97);}(_0xb125,0x9d));var _0x5b12=function(_0x5a772c,_0x18c785){_0x5a772c=_0x5a772c-0x0;var _0x5c67cd=_0xb125[_0x5a772c];return _0x5c67cd;};'use strict';var _=require(_0x5b12('0x0'));var util=require(_0x5b12('0x1'));var moment=require(_0x5b12('0x2'));var BPromise=require(_0x5b12('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5b12('0x4'));var db=require(_0x5b12('0x5'))['db'];var utils=require(_0x5b12('0x6'));var logger=require(_0x5b12('0x7'))('rpc');var config=require(_0x5b12('0x8'));var jayson=require(_0x5b12('0x9'));var client=jayson[_0x5b12('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x21c680,_0xacafde,_0xdaef18){return new BPromise(function(_0x63c7d5,_0x10ae93){return client[_0x5b12('0xb')](_0x21c680,_0xdaef18)[_0x5b12('0xc')](function(_0x23601c){logger[_0x5b12('0xd')](_0x5b12('0xe'),_0xacafde,'request\x20sent');logger[_0x5b12('0xf')](_0x5b12('0x10'),_0xacafde,_0x5b12('0x11'),JSON[_0x5b12('0x12')](_0x23601c));if(_0x23601c[_0x5b12('0x13')]){if(_0x23601c['error'][_0x5b12('0x14')]===0x1f4){logger['error'](_0x5b12('0xe'),_0xacafde,_0x23601c[_0x5b12('0x13')][_0x5b12('0x15')]);return _0x10ae93(_0x23601c[_0x5b12('0x13')][_0x5b12('0x15')]);}logger[_0x5b12('0x13')](_0x5b12('0xe'),_0xacafde,_0x23601c[_0x5b12('0x13')]['message']);return _0x63c7d5(_0x23601c['error'][_0x5b12('0x15')]);}else{logger['info'](_0x5b12('0xe'),_0xacafde,_0x5b12('0x11'));_0x63c7d5(_0x23601c['result'][_0x5b12('0x15')]);}})[_0x5b12('0x16')](function(_0x1af891){logger['error']('Schedule,\x20%s,\x20%s',_0xacafde,_0x1af891);_0x10ae93(_0x1af891);});});} \ No newline at end of file +var _0x6d75=['rpc','../../config/environment','jayson/promise','client','http','request','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x94e8c6,_0x327e4e){var _0x58e982=function(_0x1b6989){while(--_0x1b6989){_0x94e8c6['push'](_0x94e8c6['shift']());}};_0x58e982(++_0x327e4e);}(_0x6d75,0x16e));var _0x56d7=function(_0x59ab65,_0x410a52){_0x59ab65=_0x59ab65-0x0;var _0x57db9b=_0x6d75[_0x59ab65];return _0x57db9b;};'use strict';var _=require(_0x56d7('0x0'));var util=require(_0x56d7('0x1'));var moment=require(_0x56d7('0x2'));var BPromise=require(_0x56d7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x56d7('0x4'));var db=require(_0x56d7('0x5'))['db'];var utils=require(_0x56d7('0x6'));var logger=require(_0x56d7('0x7'))(_0x56d7('0x8'));var config=require(_0x56d7('0x9'));var jayson=require(_0x56d7('0xa'));var client=jayson[_0x56d7('0xb')][_0x56d7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5472b4,_0x3777ee,_0x1e498e){return new BPromise(function(_0x404b5c,_0x503f4b){return client[_0x56d7('0xd')](_0x5472b4,_0x1e498e)['then'](function(_0x234156){logger['info'](_0x56d7('0xe'),_0x3777ee,_0x56d7('0xf'));logger[_0x56d7('0x10')](_0x56d7('0x11'),_0x3777ee,_0x56d7('0xf'),JSON[_0x56d7('0x12')](_0x234156));if(_0x234156['error']){if(_0x234156['error']['code']===0x1f4){logger[_0x56d7('0x13')](_0x56d7('0xe'),_0x3777ee,_0x234156[_0x56d7('0x13')][_0x56d7('0x14')]);return _0x503f4b(_0x234156[_0x56d7('0x13')][_0x56d7('0x14')]);}logger['error'](_0x56d7('0xe'),_0x3777ee,_0x234156[_0x56d7('0x13')][_0x56d7('0x14')]);return _0x404b5c(_0x234156[_0x56d7('0x13')][_0x56d7('0x14')]);}else{logger['info'](_0x56d7('0xe'),_0x3777ee,_0x56d7('0xf'));_0x404b5c(_0x234156['result'][_0x56d7('0x14')]);}})[_0x56d7('0x15')](function(_0x22178a){logger[_0x56d7('0x13')]('Schedule,\x20%s,\x20%s',_0x3777ee,_0x22178a);_0x503f4b(_0x22178a);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 988e6cc..eb91d3d 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 _0x5d17=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./screenRecording.controller','get','isAuthenticated','/:id','download','create','destroy','exports','multer','util','path'];(function(_0x2a527e,_0x5f53a2){var _0x49c244=function(_0x4e15e5){while(--_0x4e15e5){_0x2a527e['push'](_0x2a527e['shift']());}};_0x49c244(++_0x5f53a2);}(_0x5d17,0xb8));var _0x75d1=function(_0x42a584,_0x2d9ee3){_0x42a584=_0x42a584-0x0;var _0x56be59=_0x5d17[_0x42a584];return _0x56be59;};'use strict';var multer=require(_0x75d1('0x0'));var util=require(_0x75d1('0x1'));var path=require(_0x75d1('0x2'));var timeout=require(_0x75d1('0x3'));var express=require(_0x75d1('0x4'));var router=express[_0x75d1('0x5')]();var fs_extra=require(_0x75d1('0x6'));var auth=require(_0x75d1('0x7'));var interaction=require(_0x75d1('0x8'));var config=require('../../config/environment');var controller=require(_0x75d1('0x9'));router[_0x75d1('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x75d1('0xa')]('/describe',auth[_0x75d1('0xb')](),controller['describe']);router[_0x75d1('0xa')](_0x75d1('0xc'),auth[_0x75d1('0xb')](),controller['show']);router[_0x75d1('0xa')]('/:id/download',auth[_0x75d1('0xb')](),controller[_0x75d1('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x75d1('0xe')]);router['put'](_0x75d1('0xc'),auth[_0x75d1('0xb')](),controller['update']);router['delete'](_0x75d1('0xc'),auth['isAuthenticated'](),controller[_0x75d1('0xf')]);module[_0x75d1('0x10')]=router; \ No newline at end of file +var _0x9b1b=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','isAuthenticated','index','get','/describe','/:id','/:id/download','download','post','create','put','update','delete'];(function(_0x311842,_0x29c60a){var _0x2453d2=function(_0x4bb404){while(--_0x4bb404){_0x311842['push'](_0x311842['shift']());}};_0x2453d2(++_0x29c60a);}(_0x9b1b,0x66));var _0xb9b1=function(_0x2a80b1,_0x4e3d7d){_0x2a80b1=_0x2a80b1-0x0;var _0x38a081=_0x9b1b[_0x2a80b1];return _0x38a081;};'use strict';var multer=require(_0xb9b1('0x0'));var util=require(_0xb9b1('0x1'));var path=require(_0xb9b1('0x2'));var timeout=require(_0xb9b1('0x3'));var express=require(_0xb9b1('0x4'));var router=express[_0xb9b1('0x5')]();var fs_extra=require(_0xb9b1('0x6'));var auth=require(_0xb9b1('0x7'));var interaction=require(_0xb9b1('0x8'));var config=require(_0xb9b1('0x9'));var controller=require(_0xb9b1('0xa'));router['get']('/',auth[_0xb9b1('0xb')](),controller[_0xb9b1('0xc')]);router[_0xb9b1('0xd')](_0xb9b1('0xe'),auth[_0xb9b1('0xb')](),controller['describe']);router[_0xb9b1('0xd')](_0xb9b1('0xf'),auth[_0xb9b1('0xb')](),controller['show']);router['get'](_0xb9b1('0x10'),auth['isAuthenticated'](),controller[_0xb9b1('0x11')]);router[_0xb9b1('0x12')]('/',auth[_0xb9b1('0xb')](),controller[_0xb9b1('0x13')]);router[_0xb9b1('0x14')](_0xb9b1('0xf'),auth['isAuthenticated'](),controller[_0xb9b1('0x15')]);router[_0xb9b1('0x16')](_0xb9b1('0xf'),auth['isAuthenticated'](),controller[_0xb9b1('0x17')]);module[_0xb9b1('0x18')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 7a05d25..eccd346 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 _0x160f=['replace','INTEGER','setDataValue','startedAt','closedAt','duration','format','MM-DD-YYYY\x20HH:mm','toString','DATE','createdAt','updatedAt','sequelize','moment','path','../../config/environment','VIRTUAL','getDataValue','value','extname','STRING'];(function(_0x5c6244,_0x112ab8){var _0x5800ce=function(_0x304e3d){while(--_0x304e3d){_0x5c6244['push'](_0x5c6244['shift']());}};_0x5800ce(++_0x112ab8);}(_0x160f,0x1ef));var _0xf160=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x160f[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xf160('0x0'));var moment=require(_0xf160('0x1'));var path=require(_0xf160('0x2'));var config=require(_0xf160('0x3'));module['exports']={'format':{'type':Sequelize[_0xf160('0x4')],'get':function(){return this[_0xf160('0x5')](_0xf160('0x6'))?path[_0xf160('0x7')](this[_0xf160('0x5')](_0xf160('0x6'))):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xf160('0x8')]},'value':{'type':Sequelize[_0xf160('0x8')],'set':function(_0x49fe49){var _0x59440e=_0x49fe49[_0xf160('0x9')](/\\/g,'/');this['setDataValue']('value',_0x59440e);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xf160('0xa')],'set':function(_0x90608){this[_0xf160('0xb')](_0xf160('0xc'),moment()['subtract'](_0x90608,'ms'));this['setDataValue'](_0xf160('0xd'),moment());this[_0xf160('0xb')](_0xf160('0xe'),_0x90608);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xf160('0x5')](_0xf160('0xc')))[_0xf160('0xf')](_0xf160('0x10'))[_0xf160('0x11')]();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xf160('0x5')]('closedAt'))[_0xf160('0xf')](_0xf160('0x10'))[_0xf160('0x11')]();}},'createdAt':{'type':Sequelize[_0xf160('0x12')],'get':function(){return moment(this[_0xf160('0x5')](_0xf160('0x13')))[_0xf160('0xf')](_0xf160('0x10'))[_0xf160('0x11')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xf160('0x5')](_0xf160('0x14')))[_0xf160('0xf')](_0xf160('0x10'))['toString']();}}}; \ No newline at end of file +var _0x2581=['value','extname','STRING','replace','setDataValue','INTEGER','subtract','closedAt','DATE','startedAt','format','toString','MM-DD-YYYY\x20HH:mm','sequelize','moment','path','../../config/environment','exports','getDataValue'];(function(_0x222d30,_0x4eca61){var _0x518b4b=function(_0x36e32b){while(--_0x36e32b){_0x222d30['push'](_0x222d30['shift']());}};_0x518b4b(++_0x4eca61);}(_0x2581,0xcb));var _0x1258=function(_0x3c21c4,_0x2c2911){_0x3c21c4=_0x3c21c4-0x0;var _0x4930c6=_0x2581[_0x3c21c4];return _0x4930c6;};'use strict';var Sequelize=require(_0x1258('0x0'));var moment=require(_0x1258('0x1'));var path=require(_0x1258('0x2'));var config=require(_0x1258('0x3'));module[_0x1258('0x4')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x1258('0x5')](_0x1258('0x6'))?path[_0x1258('0x7')](this[_0x1258('0x5')](_0x1258('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0x1258('0x8')]},'channel':{'type':Sequelize[_0x1258('0x8')]},'value':{'type':Sequelize[_0x1258('0x8')],'set':function(_0x582ed7){var _0x3e1044=_0x582ed7[_0x1258('0x9')](/\\/g,'/');this[_0x1258('0xa')](_0x1258('0x6'),_0x3e1044);}},'rating':{'type':Sequelize[_0x1258('0xb')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x1258('0xb')],'set':function(_0x429efc){this['setDataValue']('startedAt',moment()[_0x1258('0xc')](_0x429efc,'ms'));this[_0x1258('0xa')](_0x1258('0xd'),moment());this[_0x1258('0xa')]('duration',_0x429efc);}},'startedAt':{'type':Sequelize[_0x1258('0xe')],'get':function(){return moment(this[_0x1258('0x5')](_0x1258('0xf')))[_0x1258('0x10')]('MM-DD-YYYY\x20HH:mm')[_0x1258('0x11')]();}},'closedAt':{'type':Sequelize[_0x1258('0xe')],'get':function(){return moment(this[_0x1258('0x5')](_0x1258('0xd')))[_0x1258('0x10')](_0x1258('0x12'))[_0x1258('0x11')]();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x1258('0x5')]('createdAt'))[_0x1258('0x10')](_0x1258('0x12'))[_0x1258('0x11')]();}},'updatedAt':{'type':Sequelize[_0x1258('0xe')],'get':function(){return moment(this[_0x1258('0x5')]('updatedAt'))[_0x1258('0x10')](_0x1258('0x12'))[_0x1258('0x11')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 21b3ed6..7f9693b 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 _0x9957=['sort','pick','filter','where','merge','map','VIRTUAL','options','ScreenRecording','includeAll','include','catch','show','rawAttributes','find','create','body','duration','closedAt','params','describe','download','uniqueid','value','join','root','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','secrets','Sequelize','filename','extname','unlink','message','ScreenRecording\x20not\x20found','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','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','index','fieldName','type','key','model','differenceBy','format','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order'];(function(_0x7733ca,_0x495bef){var _0x43595a=function(_0x311aa9){while(--_0x311aa9){_0x7733ca['push'](_0x7733ca['shift']());}};_0x43595a(++_0x495bef);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ScreenRecording']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_['map'](_0x4253e5,'name'),[_0x7995('0x31')]);_0x456a28['query']=_[_0x7995('0x32')](_0x4b6f99[_0x7995('0x33')]);_0x456a28[_0x7995('0x34')]=_[_0x7995('0x35')](_0x456a28[_0x7995('0x2f')],_0x456a28['query']);_0x514445[_0x7995('0x36')]=_[_0x7995('0x35')](_0x456a28['model'],qs['fields'](_0x4b6f99['query'][_0x7995('0x37')]));_0x514445[_0x7995('0x36')]=_0x514445['attributes'][_0x7995('0x38')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99[_0x7995('0x33')][_0x7995('0x39')]('nolimit')){_0x514445['limit']=qs[_0x7995('0x21')](_0x4b6f99['query']['limit']);_0x514445[_0x7995('0x20')]=qs[_0x7995('0x20')](_0x4b6f99['query'][_0x7995('0x20')]);}_0x514445[_0x7995('0x3a')]=qs[_0x7995('0x3b')](_0x4b6f99[_0x7995('0x33')][_0x7995('0x3b')]);_0x514445['where']=qs[_0x7995('0x34')](_[_0x7995('0x3c')](_0x4b6f99[_0x7995('0x33')],_0x456a28[_0x7995('0x34')]),_0x4253e5);if(_0x4b6f99['query'][_0x7995('0x3d')]){_0x514445[_0x7995('0x3e')]=_[_0x7995('0x3f')](_0x514445[_0x7995('0x3e')],{'$or':_[_0x7995('0x40')](_0x4253e5,function(_0x1035dc){if(_0x1035dc['type']!==_0x7995('0x41')){var _0x3be298={};_0x3be298[_0x1035dc[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x33')][_0x7995('0x3d')]+'%'};return _0x3be298;}})});}_0x514445=_[_0x7995('0x3f')]({},_0x514445,_0x4b6f99[_0x7995('0x42')]);var _0x270c0e={'where':_0x514445[_0x7995('0x3e')]};return db[_0x7995('0x43')][_0x7995('0x1f')](_0x270c0e)[_0x7995('0x26')](function(_0x7b4e67){_0x3250e0['count']=_0x7b4e67;if(_0x4b6f99['query'][_0x7995('0x44')]){_0x514445[_0x7995('0x45')]=[{'all':!![]}];}return db['ScreenRecording']['findAll'](_0x514445);})[_0x7995('0x26')](function(_0x4a9fef){_0x3250e0['rows']=_0x4a9fef;return _0x3250e0;})[_0x7995('0x26')](respondWithFilteredResult(_0x9b2a15,_0x514445))[_0x7995('0x46')](handleError(_0x9b2a15,null));};exports[_0x7995('0x47')]=function(_0x576b96,_0x46ac4f){var _0x5e85b9={'raw':![],'where':{'id':_0x576b96['params']['id']}},_0x3993b5={};_0x3993b5['model']=_[_0x7995('0x32')](db[_0x7995('0x43')][_0x7995('0x48')]);_0x3993b5[_0x7995('0x33')]=_['keys'](_0x576b96[_0x7995('0x33')]);_0x3993b5[_0x7995('0x34')]=_[_0x7995('0x35')](_0x3993b5[_0x7995('0x2f')],_0x3993b5['query']);_0x5e85b9['attributes']=_[_0x7995('0x35')](_0x3993b5['model'],qs[_0x7995('0x37')](_0x576b96['query'][_0x7995('0x37')]));_0x5e85b9['attributes']=_0x5e85b9[_0x7995('0x36')][_0x7995('0x38')]?_0x5e85b9['attributes']:_0x3993b5[_0x7995('0x2f')];if(_0x576b96[_0x7995('0x33')][_0x7995('0x44')]){_0x5e85b9[_0x7995('0x45')]=[{'all':!![]}];}_0x5e85b9=_['merge']({},_0x5e85b9,_0x576b96[_0x7995('0x42')]);return db[_0x7995('0x43')][_0x7995('0x49')](_0x5e85b9)['then'](handleEntityNotFound(_0x46ac4f,null))[_0x7995('0x26')](respondWithResult(_0x46ac4f,null))[_0x7995('0x46')](handleError(_0x46ac4f,null));};exports[_0x7995('0x4a')]=function(_0x3d8ae3,_0x255313){return db['ScreenRecording'][_0x7995('0x4a')](_0x3d8ae3[_0x7995('0x4b')],{})['then'](respondWithResult(_0x255313,0xc9))[_0x7995('0x46')](handleError(_0x255313,null));};exports['update']=function(_0x1d87f9,_0x187735){if(_0x1d87f9[_0x7995('0x4b')]['id']){delete _0x1d87f9[_0x7995('0x4b')]['id'];}delete _0x1d87f9[_0x7995('0x4b')][_0x7995('0x4c')];delete _0x1d87f9[_0x7995('0x4b')]['createdAt'];delete _0x1d87f9[_0x7995('0x4b')][_0x7995('0x4d')];delete _0x1d87f9[_0x7995('0x4b')]['value'];return db[_0x7995('0x43')][_0x7995('0x49')]({'where':{'id':_0x1d87f9[_0x7995('0x4e')]['id']}})['then'](handleEntityNotFound(_0x187735,null))['then'](saveUpdates(_0x1d87f9['body'],null))[_0x7995('0x26')](respondWithResult(_0x187735,null))[_0x7995('0x46')](handleError(_0x187735,null));};exports['describe']=function(_0x1cd85,_0x29f300){return db[_0x7995('0x43')][_0x7995('0x4f')]()[_0x7995('0x26')](respondWithResult(_0x29f300,null))['catch'](handleError(_0x29f300,null));};exports[_0x7995('0x50')]=function(_0x4ab09f,_0x14fe7f,_0x33c801){var _0x206d2a=require('../../components/encryptor');var _0x5e1f34=![];var _0x54e2b1={};if(_0x4ab09f['query'][_0x7995('0x2d')]&&_0x4ab09f[_0x7995('0x33')][_0x7995('0x2d')]===_0x7995('0x51')){_0x54e2b1[_0x7995('0x51')]=_0x4ab09f[_0x7995('0x4e')]['id'];}else{_0x54e2b1['id']=_0x4ab09f[_0x7995('0x4e')]['id'];}return db[_0x7995('0x43')][_0x7995('0x49')]({'where':_0x54e2b1,'attributes':['id',_0x7995('0x52')],'raw':!![]})[_0x7995('0x26')](handleEntityNotFound(_0x14fe7f,null))[_0x7995('0x26')](function(_0x3da72b){if(_0x3da72b){var _0x35bea3=path[_0x7995('0x53')](config[_0x7995('0x54')],_0x7995('0x55'),_0x3da72b[_0x7995('0x52')]);var _0x45e86e=util['format'](_0x7995('0x56'),_0x35bea3);if(fs[_0x7995('0x57')](_0x45e86e)){_0x5e1f34=!![];return _0x206d2a[_0x7995('0x58')](_0x45e86e,_0x35bea3,config[_0x7995('0x59')]['recording'])['then'](function(){return _0x3da72b;});}return _0x3da72b;}})[_0x7995('0x26')](function(_0x197b52){if(_0x197b52){var _0x5b9467=path[_0x7995('0x53')](config['root'],_0x7995('0x55'),_0x197b52[_0x7995('0x52')]);if(!fs[_0x7995('0x57')](_0x5b9467)){throw new db[(_0x7995('0x5a'))]['ValidationError']('ScreenRecording\x20not\x20found');}if(_0x197b52[_0x7995('0x5b')]){return _0x14fe7f[_0x7995('0x50')](_0x5b9467,_0x197b52[_0x7995('0x5b')]+path[_0x7995('0x5c')](_0x5b9467),function(){if(_0x5e1f34){fs[_0x7995('0x5d')](_0x5b9467);}});}else{return _0x14fe7f[_0x7995('0x50')](_0x5b9467,function(_0x1d4689){if(_0x5e1f34){fs[_0x7995('0x5d')](_0x5b9467);}});}}})[_0x7995('0x46')](function(_0x50caf5){if(_0x50caf5[_0x7995('0x5e')]===_0x7995('0x5f')){_0x14fe7f[_0x7995('0x1c')](0x194)[_0x7995('0x2a')]('Not\x20found');}else{return handleError(_0x14fe7f,null);}});};exports['destroy']=function(_0x3053fd,_0xebb5c8){return db['ScreenRecording'][_0x7995('0x49')]({'where':{'id':_0x3053fd[_0x7995('0x4e')]['id']}})[_0x7995('0x26')](function(_0x57727e){if(_[_0x7995('0x60')](_0x57727e)){throw new ReferenceError('Entity\x20not\x20found');}return _0x57727e;})[_0x7995('0x26')](function(_0x564fca){var _0x3e0a46=path[_0x7995('0x53')](config[_0x7995('0x54')],_0x7995('0x55'),_0x564fca[_0x7995('0x52')]);logger[_0x7995('0x61')](_0x7995('0x62'),_0x3e0a46);if(!_[_0x7995('0x60')](_0x564fca[_0x7995('0x52')])&&fs[_0x7995('0x57')](_0x3e0a46)){logger[_0x7995('0x61')](_0x7995('0x63')+_0x3e0a46+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x7995('0x64')](_0x3e0a46);}_0x3e0a46=_0x3e0a46+_0x7995('0x65');if(!_[_0x7995('0x60')](_0x564fca[_0x7995('0x52')])&&fs[_0x7995('0x57')](_0x3e0a46)){logger['info']('File:\x20\x22'+_0x3e0a46+_0x7995('0x66'));fs[_0x7995('0x64')](_0x3e0a46);}return _0x564fca;})[_0x7995('0x26')](function(_0xae6166){if(!_0xae6166)throw new InternalError();return _0xae6166['destroy']();})[_0x7995('0x26')](function(){_0xebb5c8['status'](0xcc)['end']();})[_0x7995('0x46')](handleError(_0xebb5c8,null));}; \ No newline at end of file +var _0xabce=['sendStatus','error','name','send','index','map','ScreenRecording','rawAttributes','type','model','differenceBy','format','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','where','merge','options','include','rows','includeAll','find','catch','create','body','createdAt','closedAt','value','params','describe','download','../../components/encryptor','uniqueid','%s.cypher','existsSync','decryptFile','recording','join','root','server/files/screen_recordings','Sequelize','ValidationError','ScreenRecording\x20not\x20found','unlink','Not\x20found','destroy','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','count','offset','Content-Range','apply','reject','save','update','then'];(function(_0x59ab65,_0x410a52){var _0x57db9b=function(_0x19dc31){while(--_0x19dc31){_0x59ab65['push'](_0x59ab65['shift']());}};_0x57db9b(++_0x410a52);}(_0xabce,0x103));var _0xeabc=function(_0x54d4a8,_0x585a59){_0x54d4a8=_0x54d4a8-0x0;var _0x3b321b=_0xabce[_0x54d4a8];return _0x3b321b;};'use strict';var emlformat=require(_0xeabc('0x0'));var rimraf=require(_0xeabc('0x1'));var zipdir=require(_0xeabc('0x2'));var jsonpatch=require(_0xeabc('0x3'));var rp=require(_0xeabc('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xeabc('0x5'));var util=require(_0xeabc('0x6'));var path=require(_0xeabc('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xeabc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeabc('0x9'));var squel=require('squel');var crypto=require(_0xeabc('0xa'));var jsforce=require(_0xeabc('0xb'));var deskjs=require(_0xeabc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xeabc('0xd'));var Papa=require(_0xeabc('0xe'));var Redis=require(_0xeabc('0xf'));var authService=require(_0xeabc('0x10'));var qs=require(_0xeabc('0x11'));var as=require(_0xeabc('0x12'));var hardwareService=require(_0xeabc('0x13'));var logger=require(_0xeabc('0x14'))(_0xeabc('0x15'));var utils=require(_0xeabc('0x16'));var config=require(_0xeabc('0x17'));var licenseUtil=require(_0xeabc('0x18'));var db=require(_0xeabc('0x19'))['db'];function respondWithStatusCode(_0x3fd0b5,_0x36a92e){_0x36a92e=_0x36a92e||0xcc;return function(_0xcfbf06){if(_0xcfbf06){return _0x3fd0b5['sendStatus'](_0x36a92e);}return _0x3fd0b5[_0xeabc('0x1a')](_0x36a92e)[_0xeabc('0x1b')]();};}function respondWithResult(_0x3251c6,_0x55f0de){_0x55f0de=_0x55f0de||0xc8;return function(_0x5f4ee8){if(_0x5f4ee8){return _0x3251c6[_0xeabc('0x1a')](_0x55f0de)[_0xeabc('0x1c')](_0x5f4ee8);}};}function respondWithFilteredResult(_0x326bac,_0x53d5cb){return function(_0xf913d7){if(_0xf913d7){var _0x638976=typeof _0x53d5cb['offset']==='undefined'&&typeof _0x53d5cb[_0xeabc('0x1d')]==='undefined';var _0x3d0e21=_0xf913d7[_0xeabc('0x1e')];var _0x58a3c0=_0x638976?0x0:_0x53d5cb[_0xeabc('0x1f')];var _0x31dd53=_0x638976?_0xf913d7[_0xeabc('0x1e')]:_0x53d5cb[_0xeabc('0x1f')]+_0x53d5cb[_0xeabc('0x1d')];var _0x5d92e5;if(_0x31dd53>=_0x3d0e21){_0x31dd53=_0x3d0e21;_0x5d92e5=0xc8;}else{_0x5d92e5=0xce;}_0x326bac[_0xeabc('0x1a')](_0x5d92e5);return _0x326bac['set'](_0xeabc('0x20'),_0x58a3c0+'-'+_0x31dd53+'/'+_0x3d0e21)[_0xeabc('0x1c')](_0xf913d7);}return null;};}function patchUpdates(_0x502947){return function(_0x28063a){try{jsonpatch[_0xeabc('0x21')](_0x28063a,_0x502947,!![]);}catch(_0x254590){return BPromise[_0xeabc('0x22')](_0x254590);}return _0x28063a[_0xeabc('0x23')]();};}function saveUpdates(_0x4e99a4,_0xecdbf){return function(_0x10c675){if(_0x10c675){return _0x10c675[_0xeabc('0x24')](_0x4e99a4)['then'](function(_0x457f27){return _0x457f27;});}return null;};}function removeEntity(_0x3854d2,_0x214953){return function(_0x319119){if(_0x319119){return _0x319119['destroy']()[_0xeabc('0x25')](function(){_0x3854d2['status'](0xcc)[_0xeabc('0x1b')]();});}};}function handleEntityNotFound(_0x4d4e29,_0x811f0d){return function(_0x12acbd){if(!_0x12acbd){_0x4d4e29[_0xeabc('0x26')](0x194);}return _0x12acbd;};}function handleError(_0x3f194e,_0x3a1a04){_0x3a1a04=_0x3a1a04||0x1f4;return function(_0x137293){logger[_0xeabc('0x27')](_0x137293['stack']);if(_0x137293['name']){delete _0x137293[_0xeabc('0x28')];}_0x3f194e['status'](_0x3a1a04)[_0xeabc('0x29')](_0x137293);};}exports[_0xeabc('0x2a')]=function(_0x48fb52,_0x2163e6){var _0x38572d={},_0x2b568f={},_0x2f8633={'count':0x0,'rows':[]};var _0x149170=_[_0xeabc('0x2b')](db[_0xeabc('0x2c')][_0xeabc('0x2d')],function(_0x2915c1){return{'name':_0x2915c1['fieldName'],'type':_0x2915c1[_0xeabc('0x2e')]['key']};});_0x2b568f[_0xeabc('0x2f')]=_[_0xeabc('0x30')](_[_0xeabc('0x2b')](_0x149170,_0xeabc('0x28')),[_0xeabc('0x31')]);_0x2b568f[_0xeabc('0x32')]=_[_0xeabc('0x33')](_0x48fb52['query']);_0x2b568f[_0xeabc('0x34')]=_[_0xeabc('0x35')](_0x2b568f[_0xeabc('0x2f')],_0x2b568f['query']);_0x38572d[_0xeabc('0x36')]=_[_0xeabc('0x35')](_0x2b568f[_0xeabc('0x2f')],qs['fields'](_0x48fb52[_0xeabc('0x32')][_0xeabc('0x37')]));_0x38572d[_0xeabc('0x36')]=_0x38572d['attributes'][_0xeabc('0x38')]?_0x38572d[_0xeabc('0x36')]:_0x2b568f['model'];if(!_0x48fb52['query'][_0xeabc('0x39')](_0xeabc('0x3a'))){_0x38572d['limit']=qs[_0xeabc('0x1d')](_0x48fb52[_0xeabc('0x32')][_0xeabc('0x1d')]);_0x38572d[_0xeabc('0x1f')]=qs[_0xeabc('0x1f')](_0x48fb52['query'][_0xeabc('0x1f')]);}_0x38572d['order']=qs[_0xeabc('0x3b')](_0x48fb52[_0xeabc('0x32')][_0xeabc('0x3b')]);_0x38572d['where']=qs['filters'](_[_0xeabc('0x3c')](_0x48fb52['query'],_0x2b568f[_0xeabc('0x34')]),_0x149170);if(_0x48fb52['query']['filter']){_0x38572d['where']=_['merge'](_0x38572d[_0xeabc('0x3d')],{'$or':_['map'](_0x149170,function(_0x257fe8){if(_0x257fe8[_0xeabc('0x2e')]!=='VIRTUAL'){var _0xe8fa6e={};_0xe8fa6e[_0x257fe8['name']]={'$like':'%'+_0x48fb52[_0xeabc('0x32')]['filter']+'%'};return _0xe8fa6e;}})});}_0x38572d=_[_0xeabc('0x3e')]({},_0x38572d,_0x48fb52[_0xeabc('0x3f')]);var _0xeeef02={'where':_0x38572d['where']};return db['ScreenRecording']['count'](_0xeeef02)[_0xeabc('0x25')](function(_0x23fb33){_0x2f8633[_0xeabc('0x1e')]=_0x23fb33;if(_0x48fb52['query']['includeAll']){_0x38572d[_0xeabc('0x40')]=[{'all':!![]}];}return db[_0xeabc('0x2c')]['findAll'](_0x38572d);})[_0xeabc('0x25')](function(_0x5e0b78){_0x2f8633[_0xeabc('0x41')]=_0x5e0b78;return _0x2f8633;})['then'](respondWithFilteredResult(_0x2163e6,_0x38572d))['catch'](handleError(_0x2163e6,null));};exports['show']=function(_0x25958b,_0x37c926){var _0xd03226={'raw':![],'where':{'id':_0x25958b['params']['id']}},_0x3eeeb5={};_0x3eeeb5[_0xeabc('0x2f')]=_['keys'](db[_0xeabc('0x2c')][_0xeabc('0x2d')]);_0x3eeeb5[_0xeabc('0x32')]=_[_0xeabc('0x33')](_0x25958b[_0xeabc('0x32')]);_0x3eeeb5['filters']=_['intersection'](_0x3eeeb5[_0xeabc('0x2f')],_0x3eeeb5['query']);_0xd03226[_0xeabc('0x36')]=_[_0xeabc('0x35')](_0x3eeeb5['model'],qs[_0xeabc('0x37')](_0x25958b[_0xeabc('0x32')][_0xeabc('0x37')]));_0xd03226[_0xeabc('0x36')]=_0xd03226[_0xeabc('0x36')][_0xeabc('0x38')]?_0xd03226[_0xeabc('0x36')]:_0x3eeeb5['model'];if(_0x25958b[_0xeabc('0x32')][_0xeabc('0x42')]){_0xd03226[_0xeabc('0x40')]=[{'all':!![]}];}_0xd03226=_[_0xeabc('0x3e')]({},_0xd03226,_0x25958b[_0xeabc('0x3f')]);return db[_0xeabc('0x2c')][_0xeabc('0x43')](_0xd03226)[_0xeabc('0x25')](handleEntityNotFound(_0x37c926,null))[_0xeabc('0x25')](respondWithResult(_0x37c926,null))[_0xeabc('0x44')](handleError(_0x37c926,null));};exports['create']=function(_0x38356c,_0x2e6efb){return db[_0xeabc('0x2c')][_0xeabc('0x45')](_0x38356c[_0xeabc('0x46')],{})[_0xeabc('0x25')](respondWithResult(_0x2e6efb,0xc9))[_0xeabc('0x44')](handleError(_0x2e6efb,null));};exports['update']=function(_0x766743,_0x32e09b){if(_0x766743[_0xeabc('0x46')]['id']){delete _0x766743[_0xeabc('0x46')]['id'];}delete _0x766743[_0xeabc('0x46')]['duration'];delete _0x766743[_0xeabc('0x46')][_0xeabc('0x47')];delete _0x766743[_0xeabc('0x46')][_0xeabc('0x48')];delete _0x766743['body'][_0xeabc('0x49')];return db[_0xeabc('0x2c')]['find']({'where':{'id':_0x766743[_0xeabc('0x4a')]['id']}})['then'](handleEntityNotFound(_0x32e09b,null))[_0xeabc('0x25')](saveUpdates(_0x766743['body'],null))[_0xeabc('0x25')](respondWithResult(_0x32e09b,null))[_0xeabc('0x44')](handleError(_0x32e09b,null));};exports[_0xeabc('0x4b')]=function(_0x1524c3,_0x1ee837){return db[_0xeabc('0x2c')][_0xeabc('0x4b')]()[_0xeabc('0x25')](respondWithResult(_0x1ee837,null))[_0xeabc('0x44')](handleError(_0x1ee837,null));};exports[_0xeabc('0x4c')]=function(_0x48a13f,_0x180a14,_0x2537ab){var _0x4072cb=require(_0xeabc('0x4d'));var _0x555d6b=![];var _0x1cef45={};if(_0x48a13f[_0xeabc('0x32')][_0xeabc('0x2e')]&&_0x48a13f[_0xeabc('0x32')]['type']===_0xeabc('0x4e')){_0x1cef45[_0xeabc('0x4e')]=_0x48a13f[_0xeabc('0x4a')]['id'];}else{_0x1cef45['id']=_0x48a13f[_0xeabc('0x4a')]['id'];}return db[_0xeabc('0x2c')][_0xeabc('0x43')]({'where':_0x1cef45,'attributes':['id',_0xeabc('0x49')],'raw':!![]})[_0xeabc('0x25')](handleEntityNotFound(_0x180a14,null))[_0xeabc('0x25')](function(_0x58ab08){if(_0x58ab08){var _0x4546c4=path['join'](config['root'],'server/files/screen_recordings',_0x58ab08[_0xeabc('0x49')]);var _0x8d4cca=util[_0xeabc('0x31')](_0xeabc('0x4f'),_0x4546c4);if(fs[_0xeabc('0x50')](_0x8d4cca)){_0x555d6b=!![];return _0x4072cb[_0xeabc('0x51')](_0x8d4cca,_0x4546c4,config['secrets'][_0xeabc('0x52')])[_0xeabc('0x25')](function(){return _0x58ab08;});}return _0x58ab08;}})[_0xeabc('0x25')](function(_0x104c1e){if(_0x104c1e){var _0x2ddc53=path[_0xeabc('0x53')](config[_0xeabc('0x54')],_0xeabc('0x55'),_0x104c1e['value']);if(!fs['existsSync'](_0x2ddc53)){throw new db[(_0xeabc('0x56'))][(_0xeabc('0x57'))](_0xeabc('0x58'));}if(_0x104c1e['filename']){return _0x180a14[_0xeabc('0x4c')](_0x2ddc53,_0x104c1e['filename']+path['extname'](_0x2ddc53),function(){if(_0x555d6b){fs[_0xeabc('0x59')](_0x2ddc53);}});}else{return _0x180a14[_0xeabc('0x4c')](_0x2ddc53,function(_0x13f04f){if(_0x555d6b){fs[_0xeabc('0x59')](_0x2ddc53);}});}}})[_0xeabc('0x44')](function(_0xc2ef0c){if(_0xc2ef0c['message']===_0xeabc('0x58')){_0x180a14[_0xeabc('0x1a')](0x194)[_0xeabc('0x29')](_0xeabc('0x5a'));}else{return handleError(_0x180a14,null);}});};exports[_0xeabc('0x5b')]=function(_0x514787,_0x5c61b4){return db[_0xeabc('0x2c')][_0xeabc('0x43')]({'where':{'id':_0x514787[_0xeabc('0x4a')]['id']}})[_0xeabc('0x25')](function(_0x1b61a8){if(_[_0xeabc('0x5c')](_0x1b61a8)){throw new ReferenceError(_0xeabc('0x5d'));}return _0x1b61a8;})[_0xeabc('0x25')](function(_0x3f829b){var _0x54d2b3=path[_0xeabc('0x53')](config['root'],_0xeabc('0x55'),_0x3f829b[_0xeabc('0x49')]);logger[_0xeabc('0x5e')](_0xeabc('0x5f'),_0x54d2b3);if(!_[_0xeabc('0x5c')](_0x3f829b[_0xeabc('0x49')])&&fs[_0xeabc('0x50')](_0x54d2b3)){logger[_0xeabc('0x5e')](_0xeabc('0x60')+_0x54d2b3+_0xeabc('0x61'));fs['unlinkSync'](_0x54d2b3);}_0x54d2b3=_0x54d2b3+_0xeabc('0x62');if(!_[_0xeabc('0x5c')](_0x3f829b[_0xeabc('0x49')])&&fs[_0xeabc('0x50')](_0x54d2b3)){logger['info'](_0xeabc('0x60')+_0x54d2b3+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x54d2b3);}return _0x3f829b;})[_0xeabc('0x25')](function(_0x11bc62){if(!_0x11bc62)throw new InternalError();return _0x11bc62[_0xeabc('0x5b')]();})[_0xeabc('0x25')](function(){_0x5c61b4['status'](0xcc)['end']();})[_0xeabc('0x44')](handleError(_0x5c61b4,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index ac31e7d..25bac52 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 _0xfd97=['interactionid','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','ScreenRecording','screen_recordings'];(function(_0x44afa4,_0x5be27b){var _0xcad289=function(_0x206272){while(--_0x206272){_0x44afa4['push'](_0x44afa4['shift']());}};_0xcad289(++_0x5be27b);}(_0xfd97,0x146));var _0x7fd9=function(_0x2d2ec8,_0x3f04b1){_0x2d2ec8=_0x2d2ec8-0x0;var _0x30e4e9=_0xfd97[_0x2d2ec8];return _0x30e4e9;};'use strict';var _=require(_0x7fd9('0x0'));var util=require('util');var logger=require(_0x7fd9('0x1'))(_0x7fd9('0x2'));var moment=require(_0x7fd9('0x3'));var BPromise=require('bluebird');var rp=require(_0x7fd9('0x4'));var fs=require('fs');var path=require(_0x7fd9('0x5'));var rimraf=require(_0x7fd9('0x6'));var config=require(_0x7fd9('0x7'));var attributes=require('./screenRecording.attributes');module[_0x7fd9('0x8')]=function(_0x4acb19,_0x15c2c0){return _0x4acb19[_0x7fd9('0x9')](_0x7fd9('0xa'),attributes,{'tableName':_0x7fd9('0xb'),'paranoid':![],'indexes':[{'name':_0x7fd9('0xc'),'fields':[_0x7fd9('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1f86=['define','ScreenRecording','screen_recordings','interactionid','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./screenRecording.attributes','exports'];(function(_0x3c67dc,_0x4bf23e){var _0x355a37=function(_0x44f88b){while(--_0x44f88b){_0x3c67dc['push'](_0x3c67dc['shift']());}};_0x355a37(++_0x4bf23e);}(_0x1f86,0x108));var _0x61f8=function(_0x420866,_0x6334ad){_0x420866=_0x420866-0x0;var _0x1b5087=_0x1f86[_0x420866];return _0x1b5087;};'use strict';var _=require('lodash');var util=require(_0x61f8('0x0'));var logger=require(_0x61f8('0x1'))(_0x61f8('0x2'));var moment=require(_0x61f8('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x61f8('0x4'));var rimraf=require(_0x61f8('0x5'));var config=require(_0x61f8('0x6'));var attributes=require(_0x61f8('0x7'));module[_0x61f8('0x8')]=function(_0x70aa00,_0x51b149){return _0x70aa00[_0x61f8('0x9')](_0x61f8('0xa'),attributes,{'tableName':_0x61f8('0xb'),'paranoid':![],'indexes':[{'name':_0x61f8('0xc'),'fields':[_0x61f8('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 0f42808..4f1cd8d 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 _0x0f1e=['rpc','../../config/environment','jayson/promise','request','info','ScreenRecording,\x20%s,\x20%s','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/logger'];(function(_0x4daebe,_0x5bd7a0){var _0xf9668a=function(_0x5f3b7a){while(--_0x5f3b7a){_0x4daebe['push'](_0x4daebe['shift']());}};_0xf9668a(++_0x5bd7a0);}(_0x0f1e,0x73));var _0xe0f1=function(_0x2098ba,_0x156221){_0x2098ba=_0x2098ba-0x0;var _0xff6685=_0x0f1e[_0x2098ba];return _0xff6685;};'use strict';var _=require(_0xe0f1('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xe0f1('0x1'));var rs=require(_0xe0f1('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe0f1('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xe0f1('0x4'))(_0xe0f1('0x5'));var config=require(_0xe0f1('0x6'));var jayson=require(_0xe0f1('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xfca767,_0x2a29a7,_0x29d7de){return new BPromise(function(_0x147dce,_0x1188e5){return client[_0xe0f1('0x8')](_0xfca767,_0x29d7de)['then'](function(_0x128e20){logger[_0xe0f1('0x9')](_0xe0f1('0xa'),_0x2a29a7,'request\x20sent');logger[_0xe0f1('0xb')](_0xe0f1('0xc'),_0x2a29a7,_0xe0f1('0xd'),JSON[_0xe0f1('0xe')](_0x128e20));if(_0x128e20['error']){if(_0x128e20[_0xe0f1('0xf')][_0xe0f1('0x10')]===0x1f4){logger['error'](_0xe0f1('0xa'),_0x2a29a7,_0x128e20['error']['message']);return _0x1188e5(_0x128e20[_0xe0f1('0xf')][_0xe0f1('0x11')]);}logger[_0xe0f1('0xf')](_0xe0f1('0xa'),_0x2a29a7,_0x128e20['error'][_0xe0f1('0x11')]);return _0x147dce(_0x128e20['error'][_0xe0f1('0x11')]);}else{logger['info'](_0xe0f1('0xa'),_0x2a29a7,_0xe0f1('0xd'));_0x147dce(_0x128e20[_0xe0f1('0x12')][_0xe0f1('0x11')]);}})[_0xe0f1('0x13')](function(_0x2aa110){logger[_0xe0f1('0xf')](_0xe0f1('0xa'),_0x2a29a7,_0x2aa110);_0x1188e5(_0x2aa110);});});} \ No newline at end of file +var _0xcc8f=['util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','request','then','info','request\x20sent','error','ScreenRecording,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x2876a0,_0x5a09e3){var _0x5c4aae=function(_0x499cd2){while(--_0x499cd2){_0x2876a0['push'](_0x2876a0['shift']());}};_0x5c4aae(++_0x5a09e3);}(_0xcc8f,0x167));var _0xfcc8=function(_0x490527,_0x283412){_0x490527=_0x490527-0x0;var _0x18ef10=_0xcc8f[_0x490527];return _0x18ef10;};'use strict';var _=require(_0xfcc8('0x0'));var util=require(_0xfcc8('0x1'));var moment=require(_0xfcc8('0x2'));var BPromise=require(_0xfcc8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfcc8('0x4'));var db=require(_0xfcc8('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xfcc8('0x6'))(_0xfcc8('0x7'));var config=require('../../config/environment');var jayson=require(_0xfcc8('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5cc01e,_0x4a4a60,_0xa8d8f2){return new BPromise(function(_0x15f4a9,_0x17e723){return client[_0xfcc8('0x9')](_0x5cc01e,_0xa8d8f2)[_0xfcc8('0xa')](function(_0x44dfcb){logger[_0xfcc8('0xb')]('ScreenRecording,\x20%s,\x20%s',_0x4a4a60,_0xfcc8('0xc'));logger['debug']('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x4a4a60,'request\x20sent',JSON['stringify'](_0x44dfcb));if(_0x44dfcb[_0xfcc8('0xd')]){if(_0x44dfcb[_0xfcc8('0xd')]['code']===0x1f4){logger[_0xfcc8('0xd')](_0xfcc8('0xe'),_0x4a4a60,_0x44dfcb[_0xfcc8('0xd')][_0xfcc8('0xf')]);return _0x17e723(_0x44dfcb['error'][_0xfcc8('0xf')]);}logger[_0xfcc8('0xd')](_0xfcc8('0xe'),_0x4a4a60,_0x44dfcb['error'][_0xfcc8('0xf')]);return _0x15f4a9(_0x44dfcb[_0xfcc8('0xd')]['message']);}else{logger['info']('ScreenRecording,\x20%s,\x20%s',_0x4a4a60,_0xfcc8('0xc'));_0x15f4a9(_0x44dfcb[_0xfcc8('0x10')][_0xfcc8('0xf')]);}})[_0xfcc8('0x11')](function(_0x20d849){logger[_0xfcc8('0xd')](_0xfcc8('0xe'),_0x4a4a60,_0x20d849);_0x17e723(_0x20d849);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index fadb4e7..051c1d5 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 _0x1171=['getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','join','server/files/images/logos/','format','%s%s','logo','extname','originalname','single','file','addLogo','root','post','addLogoLogin','preferred','addPreferred','addFavicon','put','isAuthenticated','update','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/now','getDate','/:id','/:id/logo','getLogo','/:id/logo_login'];(function(_0x2e4efc,_0x45c6fd){var _0x5b3da3=function(_0x2e37f5){while(--_0x2e37f5){_0x2e4efc['push'](_0x2e4efc['shift']());}};_0x5b3da3(++_0x45c6fd);}(_0x1171,0x174));var _0x1117=function(_0x313dab,_0x53179c){_0x313dab=_0x313dab-0x0;var _0x18ee37=_0x1171[_0x313dab];return _0x18ee37;};'use strict';var multer=require(_0x1117('0x0'));var util=require(_0x1117('0x1'));var path=require(_0x1117('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1117('0x3')]();var fs_extra=require(_0x1117('0x4'));var auth=require(_0x1117('0x5'));var interaction=require(_0x1117('0x6'));var config=require(_0x1117('0x7'));var controller=require('./setting.controller');router[_0x1117('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1117('0x8')](_0x1117('0x9'),controller[_0x1117('0xa')]);router['get'](_0x1117('0xb'),controller['show']);router[_0x1117('0x8')](_0x1117('0xc'),controller[_0x1117('0xd')]);router[_0x1117('0x8')](_0x1117('0xe'),controller[_0x1117('0xf')]);router['get'](_0x1117('0x10'),controller[_0x1117('0x11')]);router['get'](_0x1117('0x12'),controller[_0x1117('0x13')]);router[_0x1117('0x8')](_0x1117('0x14'),controller[_0x1117('0x15')]);var upload=multer({'storage':multer[_0x1117('0x16')]({'destination':function(_0x4dd211,_0x297880,_0x2e5800){_0x2e5800(null,path[_0x1117('0x17')](config['root'],_0x1117('0x18')));},'filename':function(_0x120c36,_0x408e30,_0x34f6f3){_0x34f6f3(null,util[_0x1117('0x19')](_0x1117('0x1a'),_0x1117('0x1b'),path[_0x1117('0x1c')](_0x408e30[_0x1117('0x1d')])));}})});router['post'](_0x1117('0xc'),upload[_0x1117('0x1e')](_0x1117('0x1f')),controller[_0x1117('0x20')]);var upload=multer({'storage':multer[_0x1117('0x16')]({'destination':function(_0x5cd663,_0x1c164a,_0x4fac91){_0x4fac91(null,path[_0x1117('0x17')](config[_0x1117('0x21')],_0x1117('0x18')));},'filename':function(_0x258b5d,_0x5822b1,_0x54dacb){_0x54dacb(null,util[_0x1117('0x19')](_0x1117('0x1a'),'logologin',path['extname'](_0x5822b1[_0x1117('0x1d')])));}})});router[_0x1117('0x22')](_0x1117('0xe'),upload['single'](_0x1117('0x1f')),controller[_0x1117('0x23')]);var upload=multer({'storage':multer[_0x1117('0x16')]({'destination':function(_0x26e47c,_0x1b56e8,_0x526132){_0x526132(null,path[_0x1117('0x17')](config[_0x1117('0x21')],'server/files/images/logos/'));},'filename':function(_0x5ce964,_0x240229,_0x5379cc){_0x5379cc(null,util['format'](_0x1117('0x1a'),_0x1117('0x24'),path['extname'](_0x240229['originalname'])));}})});router[_0x1117('0x22')](_0x1117('0x12'),upload[_0x1117('0x1e')]('file'),controller[_0x1117('0x25')]);var upload=multer({'storage':multer[_0x1117('0x16')]({'destination':function(_0x1244ef,_0x21dea8,_0x1c4f8c){_0x1c4f8c(null,path[_0x1117('0x17')](config['root'],_0x1117('0x18')));},'filename':function(_0x151f09,_0x1c3b54,_0x1a029c){_0x1a029c(null,util[_0x1117('0x19')](_0x1117('0x1a'),'favicon',path[_0x1117('0x1c')](_0x1c3b54[_0x1117('0x1d')])));}})});router[_0x1117('0x22')]('/:id/favicon',upload['single']('file'),controller[_0x1117('0x26')]);router[_0x1117('0x27')](_0x1117('0xb'),auth[_0x1117('0x28')](),controller[_0x1117('0x29')]);module[_0x1117('0x2a')]=router; \ No newline at end of file +var _0xf760=['express','fs-extra','../../components/auth/service','get','index','/now','getDate','/:id','show','getLogo','/:id/logo_login','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','join','root','server/files/images/logos/','logo','extname','originalname','post','/:id/logo','single','file','format','%s%s','logologin','preferred','addPreferred','addFavicon','put','isAuthenticated','update','exports','multer','util','path','connect-timeout'];(function(_0x1cec84,_0x101ec2){var _0x12b7d3=function(_0x9679d8){while(--_0x9679d8){_0x1cec84['push'](_0x1cec84['shift']());}};_0x12b7d3(++_0x101ec2);}(_0xf760,0x7a));var _0x0f76=function(_0x1bd676,_0x1a7f97){_0x1bd676=_0x1bd676-0x0;var _0x5b77c5=_0xf760[_0x1bd676];return _0x5b77c5;};'use strict';var multer=require(_0x0f76('0x0'));var util=require(_0x0f76('0x1'));var path=require(_0x0f76('0x2'));var timeout=require(_0x0f76('0x3'));var express=require(_0x0f76('0x4'));var router=express['Router']();var fs_extra=require(_0x0f76('0x5'));var auth=require(_0x0f76('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./setting.controller');router[_0x0f76('0x7')]('/',auth['isAuthenticated'](),controller[_0x0f76('0x8')]);router[_0x0f76('0x7')](_0x0f76('0x9'),controller[_0x0f76('0xa')]);router[_0x0f76('0x7')](_0x0f76('0xb'),controller[_0x0f76('0xc')]);router['get']('/:id/logo',controller[_0x0f76('0xd')]);router[_0x0f76('0x7')](_0x0f76('0xe'),controller['getLogoLogin']);router[_0x0f76('0x7')](_0x0f76('0xf'),controller[_0x0f76('0x10')]);router[_0x0f76('0x7')](_0x0f76('0x11'),controller[_0x0f76('0x12')]);router[_0x0f76('0x7')](_0x0f76('0x13'),controller[_0x0f76('0x14')]);var upload=multer({'storage':multer[_0x0f76('0x15')]({'destination':function(_0x301d27,_0x2db83c,_0x22be63){_0x22be63(null,path[_0x0f76('0x16')](config[_0x0f76('0x17')],_0x0f76('0x18')));},'filename':function(_0x51406e,_0x165d82,_0x473617){_0x473617(null,util['format']('%s%s',_0x0f76('0x19'),path[_0x0f76('0x1a')](_0x165d82[_0x0f76('0x1b')])));}})});router[_0x0f76('0x1c')](_0x0f76('0x1d'),upload[_0x0f76('0x1e')](_0x0f76('0x1f')),controller['addLogo']);var upload=multer({'storage':multer[_0x0f76('0x15')]({'destination':function(_0x5d7027,_0x4a1f30,_0x460e67){_0x460e67(null,path[_0x0f76('0x16')](config['root'],'server/files/images/logos/'));},'filename':function(_0x8e6496,_0x3feffa,_0x1971d9){_0x1971d9(null,util[_0x0f76('0x20')](_0x0f76('0x21'),_0x0f76('0x22'),path[_0x0f76('0x1a')](_0x3feffa[_0x0f76('0x1b')])));}})});router[_0x0f76('0x1c')](_0x0f76('0xe'),upload[_0x0f76('0x1e')](_0x0f76('0x1f')),controller['addLogoLogin']);var upload=multer({'storage':multer[_0x0f76('0x15')]({'destination':function(_0x18748c,_0x1bc590,_0xdf9105){_0xdf9105(null,path[_0x0f76('0x16')](config[_0x0f76('0x17')],'server/files/images/logos/'));},'filename':function(_0xa7955,_0x3c56cf,_0x3edb1e){_0x3edb1e(null,util[_0x0f76('0x20')]('%s%s',_0x0f76('0x23'),path['extname'](_0x3c56cf[_0x0f76('0x1b')])));}})});router[_0x0f76('0x1c')](_0x0f76('0x11'),upload[_0x0f76('0x1e')](_0x0f76('0x1f')),controller[_0x0f76('0x24')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4aca54,_0x268bad,_0x161301){_0x161301(null,path[_0x0f76('0x16')](config[_0x0f76('0x17')],_0x0f76('0x18')));},'filename':function(_0x31e9a2,_0x5dff21,_0x52a7b8){_0x52a7b8(null,util['format'](_0x0f76('0x21'),'favicon',path[_0x0f76('0x1a')](_0x5dff21[_0x0f76('0x1b')])));}})});router[_0x0f76('0x1c')]('/:id/favicon',upload[_0x0f76('0x1e')](_0x0f76('0x1f')),controller[_0x0f76('0x25')]);router[_0x0f76('0x26')](_0x0f76('0xb'),auth[_0x0f76('0x27')](),controller[_0x0f76('0x28')]);module[_0x0f76('0x29')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 7076f4c..1c1b32d 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(_0xdec068,_0x5e7332){var _0x167391=function(_0x122327){while(--_0x122327){_0xdec068['push'](_0xdec068['shift']());}};_0x167391(++_0x5e7332);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'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(_0x235fed,_0xafbed9){var _0x3d36b0=function(_0x17c432){while(--_0x17c432){_0x235fed['push'](_0x235fed['shift']());}};_0x3d36b0(++_0xafbed9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'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 3a0c162..688c85a 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 _0x7f90=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','client','http','request','info','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','map','Setting','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','body','find','addLogo','filename','logo','file','addLogoLogin','../../config/license/util','getLogo','server/files/images/logos','getLicense','loginLogo','preferred','defaultLogo','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','default','upperFirst','default_logo.svg','Sequelize','ValidationError','\x20not\x20found','download','getLogoLogin','favicon','defaultLoginLogo','default_loginLogo.svg','custom','gdpr','addPreferred','default_preferred.png','getFavicon','default_favicon.ico','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS'];(function(_0x38081d,_0x703340){var _0x436e64=function(_0x1ba57e){while(--_0x1ba57e){_0x38081d['push'](_0x38081d['shift']());}};_0x436e64(++_0x703340);}(_0x7f90,0xf4));var _0x07f9=function(_0x53d7ae,_0x179ce9){_0x53d7ae=_0x53d7ae-0x0;var _0x4473ae=_0x7f90[_0x53d7ae];return _0x4473ae;};'use strict';var emlformat=require(_0x07f9('0x0'));var rimraf=require(_0x07f9('0x1'));var zipdir=require(_0x07f9('0x2'));var jsonpatch=require(_0x07f9('0x3'));var rp=require(_0x07f9('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x07f9('0x5'));var util=require(_0x07f9('0x6'));var path=require('path');var sox=require(_0x07f9('0x7'));var csv=require(_0x07f9('0x8'));var ejs=require(_0x07f9('0x9'));var fs=require('fs');var fs_extra=require(_0x07f9('0xa'));var _=require(_0x07f9('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x07f9('0xc'));var deskjs=require(_0x07f9('0xd'));var toCsv=require('to-csv');var querystring=require(_0x07f9('0xe'));var Papa=require('papaparse');var Redis=require(_0x07f9('0xf'));var authService=require(_0x07f9('0x10'));var qs=require(_0x07f9('0x11'));var as=require(_0x07f9('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x07f9('0x13'))(_0x07f9('0x14'));var utils=require(_0x07f9('0x15'));var config=require(_0x07f9('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x07f9('0x17'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x07f9('0x18')][_0x07f9('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x3273a3,_0x74cc61,_0x32719c,_0x5daa9c){return new BPromise(function(_0x43f759,_0x3869b6){var _0x555fce=_0x5daa9c||client;return _0x555fce[_0x07f9('0x1a')](_0x3273a3,_0x32719c)['then'](function(_0x2c2a72){logger[_0x07f9('0x1b')]('Setting,\x20%s,\x20%s',_0x74cc61,_0x07f9('0x1c'));logger[_0x07f9('0x1d')](_0x07f9('0x1e'),_0x74cc61,_0x07f9('0x1c'),JSON['stringify'](_0x2c2a72));if(_0x2c2a72[_0x07f9('0x1f')]){if(_0x2c2a72[_0x07f9('0x1f')][_0x07f9('0x20')]===0x1f4){logger[_0x07f9('0x1f')]('Setting,\x20%s,\x20%s',_0x74cc61,_0x2c2a72[_0x07f9('0x1f')][_0x07f9('0x21')]);return _0x3869b6(_0x2c2a72[_0x07f9('0x1f')][_0x07f9('0x21')]);}logger[_0x07f9('0x1f')]('Setting,\x20%s,\x20%s',_0x74cc61,_0x2c2a72[_0x07f9('0x1f')][_0x07f9('0x21')]);return _0x43f759(_0x2c2a72[_0x07f9('0x1f')][_0x07f9('0x21')]);}else{logger[_0x07f9('0x1b')]('Setting,\x20%s,\x20%s',_0x74cc61,'request\x20sent');_0x43f759(_0x2c2a72[_0x07f9('0x22')][_0x07f9('0x21')]);}})[_0x07f9('0x23')](function(_0x11d2ee){logger[_0x07f9('0x1f')]('Setting,\x20%s,\x20%s',_0x74cc61,_0x11d2ee);_0x3869b6(_0x11d2ee);});});}function respondWithStatusCode(_0x68c886,_0x3354fb){_0x3354fb=_0x3354fb||0xcc;return function(_0x30d1eb){if(_0x30d1eb){return _0x68c886[_0x07f9('0x24')](_0x3354fb);}return _0x68c886[_0x07f9('0x25')](_0x3354fb)[_0x07f9('0x26')]();};}function respondWithResult(_0x372d2c,_0x30de7d){_0x30de7d=_0x30de7d||0xc8;return function(_0x3f33de){if(_0x3f33de){return _0x372d2c['status'](_0x30de7d)[_0x07f9('0x27')](_0x3f33de);}};}function respondWithFilteredResult(_0xe02a83,_0x4b6f5e){return function(_0x2c90d0){if(_0x2c90d0){var _0x263d8c=typeof _0x4b6f5e[_0x07f9('0x28')]===_0x07f9('0x29')&&typeof _0x4b6f5e[_0x07f9('0x2a')]===_0x07f9('0x29');var _0x11c171=_0x2c90d0[_0x07f9('0x2b')];var _0x2fe558=_0x263d8c?0x0:_0x4b6f5e[_0x07f9('0x28')];var _0x4c2c5c=_0x263d8c?_0x2c90d0[_0x07f9('0x2b')]:_0x4b6f5e['offset']+_0x4b6f5e['limit'];var _0x92e400;if(_0x4c2c5c>=_0x11c171){_0x4c2c5c=_0x11c171;_0x92e400=0xc8;}else{_0x92e400=0xce;}_0xe02a83[_0x07f9('0x25')](_0x92e400);return _0xe02a83[_0x07f9('0x2c')](_0x07f9('0x2d'),_0x2fe558+'-'+_0x4c2c5c+'/'+_0x11c171)[_0x07f9('0x27')](_0x2c90d0);}return null;};}function patchUpdates(_0x596e74){return function(_0x55e732){try{jsonpatch[_0x07f9('0x2e')](_0x55e732,_0x596e74,!![]);}catch(_0x1df6ea){return BPromise[_0x07f9('0x2f')](_0x1df6ea);}return _0x55e732[_0x07f9('0x30')]();};}function saveUpdates(_0x142fe7,_0x354108){return function(_0x9a27f5){if(_0x9a27f5){return _0x9a27f5[_0x07f9('0x31')](_0x142fe7)[_0x07f9('0x32')](function(_0x11e38c){return _0x11e38c;});}return null;};}function removeEntity(_0x4dac05,_0x495e17){return function(_0x1d7443){if(_0x1d7443){return _0x1d7443[_0x07f9('0x33')]()[_0x07f9('0x32')](function(){_0x4dac05['status'](0xcc)[_0x07f9('0x26')]();});}};}function handleEntityNotFound(_0x30b699,_0x30bf39){return function(_0x9ca655){if(!_0x9ca655){_0x30b699[_0x07f9('0x24')](0x194);}return _0x9ca655;};}function handleError(_0x506ed5,_0x95eb15){_0x95eb15=_0x95eb15||0x1f4;return function(_0x842233){logger['error'](_0x842233[_0x07f9('0x34')]);if(_0x842233[_0x07f9('0x35')]){delete _0x842233[_0x07f9('0x35')];}_0x506ed5[_0x07f9('0x25')](_0x95eb15)[_0x07f9('0x36')](_0x842233);};}exports['index']=function(_0x4dacdd,_0x3b1e57){var _0x3d1ed3={},_0x5ad0df={},_0x5387f4={'count':0x0,'rows':[]};var _0x33876b=_[_0x07f9('0x37')](db[_0x07f9('0x38')][_0x07f9('0x39')],function(_0x239884){return{'name':_0x239884[_0x07f9('0x3a')],'type':_0x239884[_0x07f9('0x3b')]['key']};});_0x5ad0df[_0x07f9('0x3c')]=_[_0x07f9('0x37')](_0x33876b,_0x07f9('0x35'));_0x5ad0df[_0x07f9('0x3d')]=_[_0x07f9('0x3e')](_0x4dacdd[_0x07f9('0x3d')]);_0x5ad0df[_0x07f9('0x3f')]=_[_0x07f9('0x40')](_0x5ad0df['model'],_0x5ad0df[_0x07f9('0x3d')]);_0x3d1ed3[_0x07f9('0x41')]=_[_0x07f9('0x40')](_0x5ad0df[_0x07f9('0x3c')],qs[_0x07f9('0x42')](_0x4dacdd['query'][_0x07f9('0x42')]));_0x3d1ed3[_0x07f9('0x41')]=_0x3d1ed3[_0x07f9('0x41')][_0x07f9('0x43')]?_0x3d1ed3['attributes']:_0x5ad0df['model'];if(!_0x4dacdd[_0x07f9('0x3d')]['hasOwnProperty'](_0x07f9('0x44'))){_0x3d1ed3[_0x07f9('0x2a')]=qs[_0x07f9('0x2a')](_0x4dacdd[_0x07f9('0x3d')][_0x07f9('0x2a')]);_0x3d1ed3[_0x07f9('0x28')]=qs[_0x07f9('0x28')](_0x4dacdd[_0x07f9('0x3d')][_0x07f9('0x28')]);}_0x3d1ed3['order']=qs[_0x07f9('0x45')](_0x4dacdd[_0x07f9('0x3d')][_0x07f9('0x45')]);_0x3d1ed3[_0x07f9('0x46')]=qs[_0x07f9('0x3f')](_[_0x07f9('0x47')](_0x4dacdd[_0x07f9('0x3d')],_0x5ad0df[_0x07f9('0x3f')]),_0x33876b);if(_0x4dacdd[_0x07f9('0x3d')][_0x07f9('0x48')]){_0x3d1ed3[_0x07f9('0x46')]=_[_0x07f9('0x49')](_0x3d1ed3[_0x07f9('0x46')],{'$or':_[_0x07f9('0x37')](_0x33876b,function(_0x5f01b5){if(_0x5f01b5[_0x07f9('0x3b')]!==_0x07f9('0x4a')){var _0x22fd5f={};_0x22fd5f[_0x5f01b5['name']]={'$like':'%'+_0x4dacdd[_0x07f9('0x3d')][_0x07f9('0x48')]+'%'};return _0x22fd5f;}})});}_0x3d1ed3=_[_0x07f9('0x49')]({},_0x3d1ed3,_0x4dacdd[_0x07f9('0x4b')]);var _0xe4e8a5={'where':_0x3d1ed3[_0x07f9('0x46')]};return db[_0x07f9('0x38')][_0x07f9('0x2b')](_0xe4e8a5)[_0x07f9('0x32')](function(_0x1c23a8){_0x5387f4[_0x07f9('0x2b')]=_0x1c23a8;if(_0x4dacdd['query'][_0x07f9('0x4c')]){_0x3d1ed3[_0x07f9('0x4d')]=[{'all':!![]}];}return db[_0x07f9('0x38')]['findAll'](_0x3d1ed3);})[_0x07f9('0x32')](function(_0x48e464){_0x5387f4[_0x07f9('0x4e')]=_0x48e464;return _0x5387f4;})[_0x07f9('0x32')](respondWithFilteredResult(_0x3b1e57,_0x3d1ed3))['catch'](handleError(_0x3b1e57,null));};exports[_0x07f9('0x4f')]=function(_0x858785,_0x344893){var _0x5b984c={'raw':![],'where':{'id':_0x858785[_0x07f9('0x50')]['id']}},_0x338484={};_0x338484['model']=_[_0x07f9('0x3e')](db['Setting'][_0x07f9('0x39')]);_0x338484[_0x07f9('0x3d')]=_[_0x07f9('0x3e')](_0x858785[_0x07f9('0x3d')]);_0x338484[_0x07f9('0x3f')]=_[_0x07f9('0x40')](_0x338484[_0x07f9('0x3c')],_0x338484[_0x07f9('0x3d')]);_0x5b984c['attributes']=_[_0x07f9('0x40')](_0x338484[_0x07f9('0x3c')],qs['fields'](_0x858785[_0x07f9('0x3d')][_0x07f9('0x42')]));_0x5b984c['attributes']=_0x5b984c['attributes'][_0x07f9('0x43')]?_0x5b984c[_0x07f9('0x41')]:_0x338484['model'];if(_0x858785[_0x07f9('0x3d')]['includeAll']){_0x5b984c[_0x07f9('0x4d')]=[{'all':!![]}];}_0x5b984c=_[_0x07f9('0x49')]({},_0x5b984c,_0x858785[_0x07f9('0x4b')]);return db['Setting']['find'](_0x5b984c)[_0x07f9('0x32')](handleEntityNotFound(_0x344893,null))[_0x07f9('0x32')](respondWithResult(_0x344893,null))[_0x07f9('0x23')](handleError(_0x344893,null));};exports[_0x07f9('0x31')]=function(_0x35f987,_0x1e9931){if(_0x35f987[_0x07f9('0x51')]['id']){delete _0x35f987[_0x07f9('0x51')]['id'];}return db[_0x07f9('0x38')][_0x07f9('0x52')]({'where':{'id':_0x35f987[_0x07f9('0x50')]['id']}})[_0x07f9('0x32')](handleEntityNotFound(_0x1e9931,null))[_0x07f9('0x32')](saveUpdates(_0x35f987['body'],null))[_0x07f9('0x32')](respondWithResult(_0x1e9931,null))[_0x07f9('0x23')](handleError(_0x1e9931,null));};exports[_0x07f9('0x53')]=function(_0x34b7aa,_0x2fb0dd,_0x34acbd){if(_0x34b7aa['file']&&_0x34b7aa['file'][_0x07f9('0x54')]){_0x34b7aa[_0x07f9('0x51')][_0x07f9('0x55')]=_0x34b7aa[_0x07f9('0x56')][_0x07f9('0x54')];}return db['Setting']['find']({'where':{'id':_0x34b7aa['params']['id']}})[_0x07f9('0x32')](handleEntityNotFound(_0x2fb0dd,null))[_0x07f9('0x32')](saveUpdates(_0x34b7aa['body'],null))[_0x07f9('0x32')](respondWithResult(_0x2fb0dd,null))[_0x07f9('0x23')](handleError(_0x2fb0dd,null));};exports[_0x07f9('0x57')]=function(_0x1e0de1,_0x40092c,_0x30665a){if(_0x1e0de1[_0x07f9('0x56')]&&_0x1e0de1[_0x07f9('0x56')][_0x07f9('0x54')]){_0x1e0de1[_0x07f9('0x51')]['loginLogo']=_0x1e0de1[_0x07f9('0x56')][_0x07f9('0x54')];}return db['Setting'][_0x07f9('0x52')]({'where':{'id':_0x1e0de1[_0x07f9('0x50')]['id']}})['then'](handleEntityNotFound(_0x40092c,null))[_0x07f9('0x32')](saveUpdates(_0x1e0de1[_0x07f9('0x51')],null))['then'](respondWithResult(_0x40092c,null))[_0x07f9('0x23')](handleError(_0x40092c,null));};var utilLicense=require(_0x07f9('0x58'));exports[_0x07f9('0x59')]=function(_0x770d37,_0xd1d3dc,_0x43af44){var _0x457499=_0x07f9('0x5a');var _0x2fb193={'custom':![]};return utilLicense[_0x07f9('0x5b')]()['then'](function(_0x5cd1a1){if(_0x5cd1a1){_0x2fb193=_0x5cd1a1;}return db[_0x07f9('0x38')][_0x07f9('0x52')]({'where':{'id':_0x770d37[_0x07f9('0x50')]['id']},'attributes':[_0x07f9('0x55'),_0x07f9('0x5c'),_0x07f9('0x5d'),'favicon',_0x07f9('0x5e'),'defaultLoginLogo',_0x07f9('0x5f'),_0x07f9('0x60')],'raw':!![]});})[_0x07f9('0x32')](handleEntityNotFound(_0xd1d3dc,null))[_0x07f9('0x32')](function(_0x88a345){if(_0x88a345){var _0x3136e9=_0x88a345[_0x07f9('0x55')]&&fs[_0x07f9('0x61')](path[_0x07f9('0x62')](config[_0x07f9('0x63')],_0x457499,_[_0x07f9('0x64')](_0x88a345[_0x07f9('0x55')])))?path[_0x07f9('0x62')](config[_0x07f9('0x63')],_0x457499,_[_0x07f9('0x64')](_0x88a345[_0x07f9('0x55')])):path[_0x07f9('0x62')](config[_0x07f9('0x63')],_0x457499,_[_0x07f9('0x64')]('default_logo.svg'));var _0x4c82c5=_0x07f9('0x65')+_[_0x07f9('0x66')](_0x07f9('0x55'));if(_0x88a345[_0x4c82c5]||!_0x2fb193['custom']){_0x3136e9=path[_0x07f9('0x62')](config[_0x07f9('0x63')],_0x457499,_[_0x07f9('0x64')](_0x07f9('0x67')));}if(!fs[_0x07f9('0x61')](_0x3136e9)){throw new db[(_0x07f9('0x68'))][(_0x07f9('0x69'))](_['upperFirst'](_0x07f9('0x55'))+_0x07f9('0x6a'));}return _0xd1d3dc[_0x07f9('0x6b')](_0x3136e9);}})['catch'](handleError(_0xd1d3dc,null));};var utilLicense=require(_0x07f9('0x58'));exports[_0x07f9('0x6c')]=function(_0x2f0b02,_0x3fca33,_0x2a00a3){var _0x3640dd=_0x07f9('0x5a');var _0x4541bb={'custom':![]};return utilLicense['getLicense']()[_0x07f9('0x32')](function(_0x5f02da){if(_0x5f02da){_0x4541bb=_0x5f02da;}return db['Setting'][_0x07f9('0x52')]({'where':{'id':_0x2f0b02[_0x07f9('0x50')]['id']},'attributes':['logo',_0x07f9('0x5c'),_0x07f9('0x5d'),_0x07f9('0x6d'),_0x07f9('0x5e'),_0x07f9('0x6e'),_0x07f9('0x5f'),'defaultFavicon'],'raw':!![]});})[_0x07f9('0x32')](handleEntityNotFound(_0x3fca33,null))['then'](function(_0x591534){if(_0x591534){var _0x5831dd=_0x591534['loginLogo']&&fs['existsSync'](path[_0x07f9('0x62')](config[_0x07f9('0x63')],_0x3640dd,_[_0x07f9('0x64')](_0x591534['loginLogo'])))?path[_0x07f9('0x62')](config[_0x07f9('0x63')],_0x3640dd,_[_0x07f9('0x64')](_0x591534[_0x07f9('0x5c')])):path[_0x07f9('0x62')](config['root'],_0x3640dd,_[_0x07f9('0x64')](_0x07f9('0x6f')));var _0x4cf8d5='default'+_[_0x07f9('0x66')](_0x07f9('0x5c'));if(_0x591534[_0x4cf8d5]||!_0x4541bb[_0x07f9('0x70')]){_0x5831dd=path[_0x07f9('0x62')](config['root'],_0x3640dd,_[_0x07f9('0x64')](_0x07f9('0x6f')));}if(!fs[_0x07f9('0x61')](_0x5831dd)){throw new db[(_0x07f9('0x68'))][(_0x07f9('0x69'))](_[_0x07f9('0x66')](_0x07f9('0x5c'))+_0x07f9('0x6a'));}return _0x3fca33['download'](_0x5831dd);}})['catch'](handleError(_0x3fca33,null));};exports[_0x07f9('0x71')]=function(_0x1f59ef,_0x54b0b2){return db[_0x07f9('0x38')][_0x07f9('0x52')]({'where':{'id':_0x1f59ef['params']['id']},'attributes':['securePassword']})[_0x07f9('0x32')](respondWithResult(_0x54b0b2,null))[_0x07f9('0x23')](handleError(_0x54b0b2,null));};exports[_0x07f9('0x72')]=function(_0x13c907,_0x30905a,_0x2afda7){if(_0x13c907['file']&&_0x13c907['file'][_0x07f9('0x54')]){_0x13c907[_0x07f9('0x51')][_0x07f9('0x5d')]=_0x13c907[_0x07f9('0x56')]['filename'];}return db[_0x07f9('0x38')][_0x07f9('0x52')]({'where':{'id':_0x13c907[_0x07f9('0x50')]['id']}})[_0x07f9('0x32')](handleEntityNotFound(_0x30905a,null))[_0x07f9('0x32')](saveUpdates(_0x13c907[_0x07f9('0x51')],null))[_0x07f9('0x32')](respondWithResult(_0x30905a,null))[_0x07f9('0x23')](handleError(_0x30905a,null));};var utilLicense=require(_0x07f9('0x58'));exports['getPreferred']=function(_0x4b9d94,_0xff20ed,_0x4b45dc){var _0x46f77a=_0x07f9('0x5a');var _0x5cd655={'custom':![]};return utilLicense[_0x07f9('0x5b')]()[_0x07f9('0x32')](function(_0x432339){if(_0x432339){_0x5cd655=_0x432339;}return db[_0x07f9('0x38')][_0x07f9('0x52')]({'where':{'id':_0x4b9d94['params']['id']},'attributes':[_0x07f9('0x55'),_0x07f9('0x5c'),_0x07f9('0x5d'),_0x07f9('0x6d'),_0x07f9('0x5e'),'defaultLoginLogo',_0x07f9('0x5f'),_0x07f9('0x60')],'raw':!![]});})['then'](handleEntityNotFound(_0xff20ed,null))[_0x07f9('0x32')](function(_0x5d56d1){if(_0x5d56d1){var _0x52b4ec=_0x5d56d1[_0x07f9('0x5d')]&&fs['existsSync'](path[_0x07f9('0x62')](config[_0x07f9('0x63')],_0x46f77a,_[_0x07f9('0x64')](_0x5d56d1[_0x07f9('0x5d')])))?path['join'](config[_0x07f9('0x63')],_0x46f77a,_[_0x07f9('0x64')](_0x5d56d1[_0x07f9('0x5d')])):path[_0x07f9('0x62')](config[_0x07f9('0x63')],_0x46f77a,_[_0x07f9('0x64')](_0x07f9('0x73')));var _0x152eb0=_0x07f9('0x65')+_[_0x07f9('0x66')]('preferred');if(_0x5d56d1[_0x152eb0]||!_0x5cd655[_0x07f9('0x70')]||!_0x5cd655[_0x07f9('0x5d')]){_0x52b4ec=path[_0x07f9('0x62')](config[_0x07f9('0x63')],_0x46f77a,_[_0x07f9('0x64')](_0x07f9('0x73')));}if(!fs[_0x07f9('0x61')](_0x52b4ec)){throw new db[(_0x07f9('0x68'))]['ValidationError'](_[_0x07f9('0x66')](_0x07f9('0x5d'))+_0x07f9('0x6a'));}return _0xff20ed['download'](_0x52b4ec);}})[_0x07f9('0x23')](handleError(_0xff20ed,null));};exports['addFavicon']=function(_0x459198,_0xe2085c,_0x129427){if(_0x459198['file']&&_0x459198[_0x07f9('0x56')][_0x07f9('0x54')]){_0x459198[_0x07f9('0x51')][_0x07f9('0x6d')]=_0x459198['file'][_0x07f9('0x54')];}return db['Setting'][_0x07f9('0x52')]({'where':{'id':_0x459198[_0x07f9('0x50')]['id']}})[_0x07f9('0x32')](handleEntityNotFound(_0xe2085c,null))[_0x07f9('0x32')](saveUpdates(_0x459198[_0x07f9('0x51')],null))[_0x07f9('0x32')](respondWithResult(_0xe2085c,null))['catch'](handleError(_0xe2085c,null));};var utilLicense=require(_0x07f9('0x58'));exports[_0x07f9('0x74')]=function(_0x5e79c4,_0x41c507,_0x30314b){var _0xc8d598=_0x07f9('0x5a');var _0x4fe612={'custom':![]};return utilLicense['getLicense']()[_0x07f9('0x32')](function(_0x4dded2){if(_0x4dded2){_0x4fe612=_0x4dded2;}return db[_0x07f9('0x38')]['find']({'where':{'id':_0x5e79c4[_0x07f9('0x50')]['id']},'attributes':[_0x07f9('0x55'),_0x07f9('0x5c'),_0x07f9('0x5d'),'favicon','defaultLogo','defaultLoginLogo','defaultPreferred',_0x07f9('0x60')],'raw':!![]});})['then'](handleEntityNotFound(_0x41c507,null))['then'](function(_0x42f96d){if(_0x42f96d){var _0x2115ce=_0x42f96d[_0x07f9('0x6d')]&&fs[_0x07f9('0x61')](path['join'](config[_0x07f9('0x63')],_0xc8d598,_['toLower'](_0x42f96d[_0x07f9('0x6d')])))?path[_0x07f9('0x62')](config['root'],_0xc8d598,_[_0x07f9('0x64')](_0x42f96d[_0x07f9('0x6d')])):path[_0x07f9('0x62')](config['root'],_0xc8d598,_[_0x07f9('0x64')](_0x07f9('0x75')));var _0x5c5639=_0x07f9('0x65')+_[_0x07f9('0x66')](_0x07f9('0x6d'));if(_0x42f96d[_0x5c5639]||!_0x4fe612[_0x07f9('0x70')]){_0x2115ce=path[_0x07f9('0x62')](config['root'],_0xc8d598,_[_0x07f9('0x64')](_0x07f9('0x75')));}if(!fs[_0x07f9('0x61')](_0x2115ce)){throw new db[(_0x07f9('0x68'))][(_0x07f9('0x69'))](_[_0x07f9('0x66')](_0x07f9('0x6d'))+_0x07f9('0x6a'));}return _0x41c507[_0x07f9('0x6b')](_0x2115ce);}})[_0x07f9('0x23')](handleError(_0x41c507,null));};exports['getDate']=function(_0x55e2db,_0x3c00e8){var _0x19a7e7={'offset':moment()[_0x07f9('0x76')]()};_0x19a7e7[_0x07f9('0x77')]=moment()[_0x07f9('0x76')](_0x19a7e7[_0x07f9('0x28')])[_0x07f9('0x78')](_0x07f9('0x79'));return _0x3c00e8[_0x07f9('0x25')](0xc8)[_0x07f9('0x36')](_0x19a7e7);}; \ No newline at end of file +var _0x914c=['hasOwnProperty','nolimit','sort','where','filters','merge','VIRTUAL','options','includeAll','include','Setting','params','rawAttributes','intersection','find','catch','body','file','filename','loginLogo','getLogo','server/files/images/logos','logo','favicon','defaultLogo','defaultPreferred','defaultFavicon','existsSync','join','toLower','root','default_logo.svg','default','upperFirst','custom','Sequelize','download','getLicense','preferred','defaultLoginLogo','default_loginLogo.svg','ValidationError','\x20not\x20found','securePassword','addPreferred','getPreferred','default_preferred.png','getFavicon','default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','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','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','name','send','fieldName','type','key','model','map','query','keys','attributes','fields','length'];(function(_0x8bf471,_0x2e9da0){var _0x3d93d7=function(_0x14b46f){while(--_0x14b46f){_0x8bf471['push'](_0x8bf471['shift']());}};_0x3d93d7(++_0x2e9da0);}(_0x914c,0x122));var _0xc914=function(_0x3f578f,_0x51f172){_0x3f578f=_0x3f578f-0x0;var _0x32c754=_0x914c[_0x3f578f];return _0x32c754;};'use strict';var emlformat=require(_0xc914('0x0'));var rimraf=require(_0xc914('0x1'));var zipdir=require(_0xc914('0x2'));var jsonpatch=require(_0xc914('0x3'));var rp=require(_0xc914('0x4'));var moment=require(_0xc914('0x5'));var BPromise=require(_0xc914('0x6'));var Mustache=require(_0xc914('0x7'));var util=require(_0xc914('0x8'));var path=require(_0xc914('0x9'));var sox=require(_0xc914('0xa'));var csv=require('to-csv');var ejs=require(_0xc914('0xb'));var fs=require('fs');var fs_extra=require(_0xc914('0xc'));var _=require('lodash');var squel=require(_0xc914('0xd'));var crypto=require('crypto');var jsforce=require(_0xc914('0xe'));var deskjs=require(_0xc914('0xf'));var toCsv=require(_0xc914('0x10'));var querystring=require(_0xc914('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc914('0x12'));var as=require(_0xc914('0x13'));var hardwareService=require(_0xc914('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xc914('0x15'));var config=require(_0xc914('0x16'));var licenseUtil=require(_0xc914('0x17'));var db=require(_0xc914('0x18'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xc914('0x19')][_0xc914('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x59c752,_0x34d15b,_0x22bd8a,_0x2fed6c){return new BPromise(function(_0x2440ca,_0x34889a){var _0x594712=_0x2fed6c||client;return _0x594712[_0xc914('0x1b')](_0x59c752,_0x22bd8a)[_0xc914('0x1c')](function(_0x109109){logger[_0xc914('0x1d')](_0xc914('0x1e'),_0x34d15b,_0xc914('0x1f'));logger[_0xc914('0x20')]('Setting,\x20%s,\x20%s,\x20%s',_0x34d15b,_0xc914('0x1f'),JSON[_0xc914('0x21')](_0x109109));if(_0x109109[_0xc914('0x22')]){if(_0x109109[_0xc914('0x22')][_0xc914('0x23')]===0x1f4){logger[_0xc914('0x22')](_0xc914('0x1e'),_0x34d15b,_0x109109[_0xc914('0x22')][_0xc914('0x24')]);return _0x34889a(_0x109109[_0xc914('0x22')]['message']);}logger[_0xc914('0x22')](_0xc914('0x1e'),_0x34d15b,_0x109109[_0xc914('0x22')][_0xc914('0x24')]);return _0x2440ca(_0x109109[_0xc914('0x22')][_0xc914('0x24')]);}else{logger[_0xc914('0x1d')](_0xc914('0x1e'),_0x34d15b,_0xc914('0x1f'));_0x2440ca(_0x109109[_0xc914('0x25')][_0xc914('0x24')]);}})['catch'](function(_0xc2729b){logger[_0xc914('0x22')](_0xc914('0x1e'),_0x34d15b,_0xc2729b);_0x34889a(_0xc2729b);});});}function respondWithStatusCode(_0x22649d,_0x14a910){_0x14a910=_0x14a910||0xcc;return function(_0x5b9985){if(_0x5b9985){return _0x22649d[_0xc914('0x26')](_0x14a910);}return _0x22649d['status'](_0x14a910)['end']();};}function respondWithResult(_0x5a61a5,_0x5c4ea4){_0x5c4ea4=_0x5c4ea4||0xc8;return function(_0xb5549c){if(_0xb5549c){return _0x5a61a5[_0xc914('0x27')](_0x5c4ea4)['json'](_0xb5549c);}};}function respondWithFilteredResult(_0x37ac30,_0x5bf976){return function(_0x5207eb){if(_0x5207eb){var _0x39a2c5=typeof _0x5bf976[_0xc914('0x28')]===_0xc914('0x29')&&typeof _0x5bf976[_0xc914('0x2a')]===_0xc914('0x29');var _0x4eac4a=_0x5207eb[_0xc914('0x2b')];var _0x3a3169=_0x39a2c5?0x0:_0x5bf976[_0xc914('0x28')];var _0x2c0722=_0x39a2c5?_0x5207eb[_0xc914('0x2b')]:_0x5bf976[_0xc914('0x28')]+_0x5bf976[_0xc914('0x2a')];var _0x466544;if(_0x2c0722>=_0x4eac4a){_0x2c0722=_0x4eac4a;_0x466544=0xc8;}else{_0x466544=0xce;}_0x37ac30[_0xc914('0x27')](_0x466544);return _0x37ac30[_0xc914('0x2c')](_0xc914('0x2d'),_0x3a3169+'-'+_0x2c0722+'/'+_0x4eac4a)[_0xc914('0x2e')](_0x5207eb);}return null;};}function patchUpdates(_0x56a03c){return function(_0x101263){try{jsonpatch[_0xc914('0x2f')](_0x101263,_0x56a03c,!![]);}catch(_0x3fd5e0){return BPromise[_0xc914('0x30')](_0x3fd5e0);}return _0x101263[_0xc914('0x31')]();};}function saveUpdates(_0x277bd6,_0x434a71){return function(_0x274d33){if(_0x274d33){return _0x274d33[_0xc914('0x32')](_0x277bd6)[_0xc914('0x1c')](function(_0x121a64){return _0x121a64;});}return null;};}function removeEntity(_0xe571b4,_0xe9a72f){return function(_0x468931){if(_0x468931){return _0x468931[_0xc914('0x33')]()[_0xc914('0x1c')](function(){_0xe571b4[_0xc914('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x308071,_0x4d4442){return function(_0x4013bb){if(!_0x4013bb){_0x308071[_0xc914('0x26')](0x194);}return _0x4013bb;};}function handleError(_0x18b36f,_0xb60ad4){_0xb60ad4=_0xb60ad4||0x1f4;return function(_0x1b59eb){logger[_0xc914('0x22')](_0x1b59eb['stack']);if(_0x1b59eb[_0xc914('0x34')]){delete _0x1b59eb[_0xc914('0x34')];}_0x18b36f[_0xc914('0x27')](_0xb60ad4)[_0xc914('0x35')](_0x1b59eb);};}exports['index']=function(_0x188b54,_0x3d444d){var _0x4253e8={},_0x473ad6={},_0x3d2a81={'count':0x0,'rows':[]};var _0x5770cb=_['map'](db['Setting']['rawAttributes'],function(_0xd340ba){return{'name':_0xd340ba[_0xc914('0x36')],'type':_0xd340ba[_0xc914('0x37')][_0xc914('0x38')]};});_0x473ad6[_0xc914('0x39')]=_[_0xc914('0x3a')](_0x5770cb,'name');_0x473ad6[_0xc914('0x3b')]=_[_0xc914('0x3c')](_0x188b54[_0xc914('0x3b')]);_0x473ad6['filters']=_['intersection'](_0x473ad6['model'],_0x473ad6[_0xc914('0x3b')]);_0x4253e8[_0xc914('0x3d')]=_['intersection'](_0x473ad6[_0xc914('0x39')],qs['fields'](_0x188b54[_0xc914('0x3b')][_0xc914('0x3e')]));_0x4253e8[_0xc914('0x3d')]=_0x4253e8[_0xc914('0x3d')][_0xc914('0x3f')]?_0x4253e8[_0xc914('0x3d')]:_0x473ad6[_0xc914('0x39')];if(!_0x188b54[_0xc914('0x3b')][_0xc914('0x40')](_0xc914('0x41'))){_0x4253e8['limit']=qs[_0xc914('0x2a')](_0x188b54[_0xc914('0x3b')][_0xc914('0x2a')]);_0x4253e8[_0xc914('0x28')]=qs[_0xc914('0x28')](_0x188b54[_0xc914('0x3b')][_0xc914('0x28')]);}_0x4253e8['order']=qs[_0xc914('0x42')](_0x188b54['query'][_0xc914('0x42')]);_0x4253e8[_0xc914('0x43')]=qs[_0xc914('0x44')](_['pick'](_0x188b54['query'],_0x473ad6[_0xc914('0x44')]),_0x5770cb);if(_0x188b54[_0xc914('0x3b')]['filter']){_0x4253e8['where']=_[_0xc914('0x45')](_0x4253e8[_0xc914('0x43')],{'$or':_['map'](_0x5770cb,function(_0x2c9af2){if(_0x2c9af2['type']!==_0xc914('0x46')){var _0x4d139f={};_0x4d139f[_0x2c9af2[_0xc914('0x34')]]={'$like':'%'+_0x188b54['query']['filter']+'%'};return _0x4d139f;}})});}_0x4253e8=_[_0xc914('0x45')]({},_0x4253e8,_0x188b54[_0xc914('0x47')]);var _0x2833db={'where':_0x4253e8[_0xc914('0x43')]};return db['Setting'][_0xc914('0x2b')](_0x2833db)['then'](function(_0x3d6c82){_0x3d2a81['count']=_0x3d6c82;if(_0x188b54['query'][_0xc914('0x48')]){_0x4253e8[_0xc914('0x49')]=[{'all':!![]}];}return db[_0xc914('0x4a')]['findAll'](_0x4253e8);})['then'](function(_0x440fc9){_0x3d2a81['rows']=_0x440fc9;return _0x3d2a81;})[_0xc914('0x1c')](respondWithFilteredResult(_0x3d444d,_0x4253e8))['catch'](handleError(_0x3d444d,null));};exports['show']=function(_0x206141,_0x132158){var _0x2ed02e={'raw':![],'where':{'id':_0x206141[_0xc914('0x4b')]['id']}},_0x53d1cf={};_0x53d1cf['model']=_[_0xc914('0x3c')](db[_0xc914('0x4a')][_0xc914('0x4c')]);_0x53d1cf[_0xc914('0x3b')]=_[_0xc914('0x3c')](_0x206141['query']);_0x53d1cf[_0xc914('0x44')]=_[_0xc914('0x4d')](_0x53d1cf[_0xc914('0x39')],_0x53d1cf[_0xc914('0x3b')]);_0x2ed02e[_0xc914('0x3d')]=_[_0xc914('0x4d')](_0x53d1cf[_0xc914('0x39')],qs[_0xc914('0x3e')](_0x206141[_0xc914('0x3b')]['fields']));_0x2ed02e[_0xc914('0x3d')]=_0x2ed02e['attributes']['length']?_0x2ed02e[_0xc914('0x3d')]:_0x53d1cf[_0xc914('0x39')];if(_0x206141['query'][_0xc914('0x48')]){_0x2ed02e[_0xc914('0x49')]=[{'all':!![]}];}_0x2ed02e=_['merge']({},_0x2ed02e,_0x206141[_0xc914('0x47')]);return db['Setting'][_0xc914('0x4e')](_0x2ed02e)[_0xc914('0x1c')](handleEntityNotFound(_0x132158,null))['then'](respondWithResult(_0x132158,null))[_0xc914('0x4f')](handleError(_0x132158,null));};exports[_0xc914('0x32')]=function(_0x24795d,_0x4adbeb){if(_0x24795d[_0xc914('0x50')]['id']){delete _0x24795d['body']['id'];}return db[_0xc914('0x4a')][_0xc914('0x4e')]({'where':{'id':_0x24795d[_0xc914('0x4b')]['id']}})[_0xc914('0x1c')](handleEntityNotFound(_0x4adbeb,null))[_0xc914('0x1c')](saveUpdates(_0x24795d[_0xc914('0x50')],null))[_0xc914('0x1c')](respondWithResult(_0x4adbeb,null))[_0xc914('0x4f')](handleError(_0x4adbeb,null));};exports['addLogo']=function(_0x1a5473,_0x3c8876,_0x5b9350){if(_0x1a5473[_0xc914('0x51')]&&_0x1a5473[_0xc914('0x51')][_0xc914('0x52')]){_0x1a5473[_0xc914('0x50')]['logo']=_0x1a5473[_0xc914('0x51')][_0xc914('0x52')];}return db[_0xc914('0x4a')][_0xc914('0x4e')]({'where':{'id':_0x1a5473['params']['id']}})[_0xc914('0x1c')](handleEntityNotFound(_0x3c8876,null))[_0xc914('0x1c')](saveUpdates(_0x1a5473[_0xc914('0x50')],null))[_0xc914('0x1c')](respondWithResult(_0x3c8876,null))[_0xc914('0x4f')](handleError(_0x3c8876,null));};exports['addLogoLogin']=function(_0x144067,_0x3b1b21,_0xe6181a){if(_0x144067[_0xc914('0x51')]&&_0x144067['file'][_0xc914('0x52')]){_0x144067['body'][_0xc914('0x53')]=_0x144067[_0xc914('0x51')][_0xc914('0x52')];}return db['Setting'][_0xc914('0x4e')]({'where':{'id':_0x144067[_0xc914('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3b1b21,null))[_0xc914('0x1c')](saveUpdates(_0x144067[_0xc914('0x50')],null))[_0xc914('0x1c')](respondWithResult(_0x3b1b21,null))[_0xc914('0x4f')](handleError(_0x3b1b21,null));};var utilLicense=require(_0xc914('0x17'));exports[_0xc914('0x54')]=function(_0x4dbb32,_0x4d910e,_0x57a13a){var _0xc59ed2=_0xc914('0x55');var _0x408095={'custom':![]};return utilLicense['getLicense']()[_0xc914('0x1c')](function(_0x5a6dc7){if(_0x5a6dc7){_0x408095=_0x5a6dc7;}return db[_0xc914('0x4a')][_0xc914('0x4e')]({'where':{'id':_0x4dbb32[_0xc914('0x4b')]['id']},'attributes':[_0xc914('0x56'),_0xc914('0x53'),'preferred',_0xc914('0x57'),_0xc914('0x58'),'defaultLoginLogo',_0xc914('0x59'),_0xc914('0x5a')],'raw':!![]});})['then'](handleEntityNotFound(_0x4d910e,null))['then'](function(_0x1eb286){if(_0x1eb286){var _0xb36997=_0x1eb286[_0xc914('0x56')]&&fs[_0xc914('0x5b')](path[_0xc914('0x5c')](config['root'],_0xc59ed2,_[_0xc914('0x5d')](_0x1eb286['logo'])))?path[_0xc914('0x5c')](config['root'],_0xc59ed2,_[_0xc914('0x5d')](_0x1eb286[_0xc914('0x56')])):path[_0xc914('0x5c')](config[_0xc914('0x5e')],_0xc59ed2,_[_0xc914('0x5d')](_0xc914('0x5f')));var _0x4d14f6=_0xc914('0x60')+_[_0xc914('0x61')](_0xc914('0x56'));if(_0x1eb286[_0x4d14f6]||!_0x408095[_0xc914('0x62')]){_0xb36997=path[_0xc914('0x5c')](config[_0xc914('0x5e')],_0xc59ed2,_[_0xc914('0x5d')](_0xc914('0x5f')));}if(!fs[_0xc914('0x5b')](_0xb36997)){throw new db[(_0xc914('0x63'))]['ValidationError'](_[_0xc914('0x61')]('logo')+'\x20not\x20found');}return _0x4d910e[_0xc914('0x64')](_0xb36997);}})['catch'](handleError(_0x4d910e,null));};var utilLicense=require(_0xc914('0x17'));exports['getLogoLogin']=function(_0x33f2ef,_0x436612,_0x3bcf73){var _0x14353f=_0xc914('0x55');var _0x9c4837={'custom':![]};return utilLicense[_0xc914('0x65')]()[_0xc914('0x1c')](function(_0xa8c296){if(_0xa8c296){_0x9c4837=_0xa8c296;}return db[_0xc914('0x4a')][_0xc914('0x4e')]({'where':{'id':_0x33f2ef[_0xc914('0x4b')]['id']},'attributes':[_0xc914('0x56'),'loginLogo',_0xc914('0x66'),'favicon',_0xc914('0x58'),_0xc914('0x67'),_0xc914('0x59'),_0xc914('0x5a')],'raw':!![]});})[_0xc914('0x1c')](handleEntityNotFound(_0x436612,null))[_0xc914('0x1c')](function(_0x10f4c7){if(_0x10f4c7){var _0x522724=_0x10f4c7[_0xc914('0x53')]&&fs['existsSync'](path[_0xc914('0x5c')](config[_0xc914('0x5e')],_0x14353f,_['toLower'](_0x10f4c7['loginLogo'])))?path[_0xc914('0x5c')](config['root'],_0x14353f,_[_0xc914('0x5d')](_0x10f4c7['loginLogo'])):path[_0xc914('0x5c')](config[_0xc914('0x5e')],_0x14353f,_[_0xc914('0x5d')](_0xc914('0x68')));var _0xdcbddc=_0xc914('0x60')+_[_0xc914('0x61')]('loginLogo');if(_0x10f4c7[_0xdcbddc]||!_0x9c4837[_0xc914('0x62')]){_0x522724=path[_0xc914('0x5c')](config['root'],_0x14353f,_[_0xc914('0x5d')](_0xc914('0x68')));}if(!fs['existsSync'](_0x522724)){throw new db[(_0xc914('0x63'))][(_0xc914('0x69'))](_[_0xc914('0x61')](_0xc914('0x53'))+_0xc914('0x6a'));}return _0x436612[_0xc914('0x64')](_0x522724);}})[_0xc914('0x4f')](handleError(_0x436612,null));};exports['gdpr']=function(_0x70887b,_0x522089){return db[_0xc914('0x4a')][_0xc914('0x4e')]({'where':{'id':_0x70887b[_0xc914('0x4b')]['id']},'attributes':[_0xc914('0x6b')]})[_0xc914('0x1c')](respondWithResult(_0x522089,null))[_0xc914('0x4f')](handleError(_0x522089,null));};exports[_0xc914('0x6c')]=function(_0x32f081,_0x91ad80,_0x2e4410){if(_0x32f081[_0xc914('0x51')]&&_0x32f081[_0xc914('0x51')][_0xc914('0x52')]){_0x32f081[_0xc914('0x50')][_0xc914('0x66')]=_0x32f081[_0xc914('0x51')][_0xc914('0x52')];}return db[_0xc914('0x4a')][_0xc914('0x4e')]({'where':{'id':_0x32f081['params']['id']}})[_0xc914('0x1c')](handleEntityNotFound(_0x91ad80,null))[_0xc914('0x1c')](saveUpdates(_0x32f081[_0xc914('0x50')],null))[_0xc914('0x1c')](respondWithResult(_0x91ad80,null))[_0xc914('0x4f')](handleError(_0x91ad80,null));};var utilLicense=require(_0xc914('0x17'));exports[_0xc914('0x6d')]=function(_0x3e9e6f,_0x1cb61f,_0x1dda78){var _0x20882b='server/files/images/logos';var _0x4a6556={'custom':![]};return utilLicense['getLicense']()[_0xc914('0x1c')](function(_0x241b54){if(_0x241b54){_0x4a6556=_0x241b54;}return db[_0xc914('0x4a')][_0xc914('0x4e')]({'where':{'id':_0x3e9e6f[_0xc914('0x4b')]['id']},'attributes':[_0xc914('0x56'),'loginLogo',_0xc914('0x66'),_0xc914('0x57'),_0xc914('0x58'),_0xc914('0x67'),_0xc914('0x59'),_0xc914('0x5a')],'raw':!![]});})[_0xc914('0x1c')](handleEntityNotFound(_0x1cb61f,null))[_0xc914('0x1c')](function(_0x98d9c1){if(_0x98d9c1){var _0x2733d8=_0x98d9c1[_0xc914('0x66')]&&fs[_0xc914('0x5b')](path[_0xc914('0x5c')](config[_0xc914('0x5e')],_0x20882b,_['toLower'](_0x98d9c1[_0xc914('0x66')])))?path[_0xc914('0x5c')](config[_0xc914('0x5e')],_0x20882b,_[_0xc914('0x5d')](_0x98d9c1[_0xc914('0x66')])):path[_0xc914('0x5c')](config[_0xc914('0x5e')],_0x20882b,_[_0xc914('0x5d')](_0xc914('0x6e')));var _0xb4abe4=_0xc914('0x60')+_['upperFirst'](_0xc914('0x66'));if(_0x98d9c1[_0xb4abe4]||!_0x4a6556[_0xc914('0x62')]||!_0x4a6556['preferred']){_0x2733d8=path[_0xc914('0x5c')](config[_0xc914('0x5e')],_0x20882b,_[_0xc914('0x5d')]('default_preferred.png'));}if(!fs['existsSync'](_0x2733d8)){throw new db['Sequelize']['ValidationError'](_[_0xc914('0x61')]('preferred')+'\x20not\x20found');}return _0x1cb61f[_0xc914('0x64')](_0x2733d8);}})[_0xc914('0x4f')](handleError(_0x1cb61f,null));};exports['addFavicon']=function(_0x2ab841,_0x4b1139,_0x520f53){if(_0x2ab841['file']&&_0x2ab841[_0xc914('0x51')][_0xc914('0x52')]){_0x2ab841[_0xc914('0x50')]['favicon']=_0x2ab841['file'][_0xc914('0x52')];}return db[_0xc914('0x4a')][_0xc914('0x4e')]({'where':{'id':_0x2ab841[_0xc914('0x4b')]['id']}})[_0xc914('0x1c')](handleEntityNotFound(_0x4b1139,null))[_0xc914('0x1c')](saveUpdates(_0x2ab841[_0xc914('0x50')],null))['then'](respondWithResult(_0x4b1139,null))['catch'](handleError(_0x4b1139,null));};var utilLicense=require('../../config/license/util');exports[_0xc914('0x6f')]=function(_0x368df3,_0x38f4f5,_0x212d52){var _0x216775=_0xc914('0x55');var _0x2fae30={'custom':![]};return utilLicense[_0xc914('0x65')]()[_0xc914('0x1c')](function(_0x47362f){if(_0x47362f){_0x2fae30=_0x47362f;}return db[_0xc914('0x4a')]['find']({'where':{'id':_0x368df3[_0xc914('0x4b')]['id']},'attributes':[_0xc914('0x56'),'loginLogo',_0xc914('0x66'),_0xc914('0x57'),_0xc914('0x58'),_0xc914('0x67'),'defaultPreferred',_0xc914('0x5a')],'raw':!![]});})['then'](handleEntityNotFound(_0x38f4f5,null))[_0xc914('0x1c')](function(_0x4552fc){if(_0x4552fc){var _0xd5d80e=_0x4552fc[_0xc914('0x57')]&&fs[_0xc914('0x5b')](path[_0xc914('0x5c')](config[_0xc914('0x5e')],_0x216775,_['toLower'](_0x4552fc[_0xc914('0x57')])))?path['join'](config[_0xc914('0x5e')],_0x216775,_['toLower'](_0x4552fc[_0xc914('0x57')])):path[_0xc914('0x5c')](config['root'],_0x216775,_['toLower']('default_favicon.ico'));var _0x4920e2=_0xc914('0x60')+_['upperFirst'](_0xc914('0x57'));if(_0x4552fc[_0x4920e2]||!_0x2fae30['custom']){_0xd5d80e=path['join'](config[_0xc914('0x5e')],_0x216775,_[_0xc914('0x5d')](_0xc914('0x70')));}if(!fs[_0xc914('0x5b')](_0xd5d80e)){throw new db[(_0xc914('0x63'))][(_0xc914('0x69'))](_[_0xc914('0x61')](_0xc914('0x57'))+'\x20not\x20found');}return _0x38f4f5[_0xc914('0x64')](_0xd5d80e);}})['catch'](handleError(_0x38f4f5,null));};exports[_0xc914('0x71')]=function(_0x341069,_0x3c6cd3){var _0xa2291={'offset':moment()[_0xc914('0x72')]()};_0xa2291[_0xc914('0x73')]=moment()['utcOffset'](_0xa2291[_0xc914('0x28')])[_0xc914('0x74')](_0xc914('0x75'));return _0x3c6cd3[_0xc914('0x27')](0xc8)[_0xc914('0x35')](_0xa2291);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index e00352f..c67f65b 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 _0x9957=['exports','define','Setting','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./setting.attributes'];(function(_0x44946b,_0xf874ec){var _0x249bc4=function(_0x40a23e){while(--_0x40a23e){_0x44946b['push'](_0x44946b['shift']());}};_0x249bc4(++_0xf874ec);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'settings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7217=['../../config/environment','./setting.attributes','exports','define','Setting','settings','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2c96f6,_0x877207){var _0x6d4808=function(_0x567e0c){while(--_0x567e0c){_0x2c96f6['push'](_0x2c96f6['shift']());}};_0x6d4808(++_0x877207);}(_0x7217,0x19e));var _0x7721=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0x7217[_0x3c4737];return _0x2bb926;};'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':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index 2c22f72..3589be1 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 _0x4974=['client','http','request','then','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','ShowSetting','Setting','find','options','include','model','attributes','map','lodash','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2d8d5a,_0x17c9cb){var _0x2e57ca=function(_0x42cc8f){while(--_0x42cc8f){_0x2d8d5a['push'](_0x2d8d5a['shift']());}};_0x2e57ca(++_0x17c9cb);}(_0x4974,0x69));var _0x4497=function(_0x1c35b4,_0x3d2d9e){_0x1c35b4=_0x1c35b4-0x0;var _0x58f7a8=_0x4974[_0x1c35b4];return _0x58f7a8;};'use strict';var _=require(_0x4497('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4497('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4497('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x4497('0x3'))(_0x4497('0x4'));var config=require(_0x4497('0x5'));var jayson=require(_0x4497('0x6'));var client=jayson[_0x4497('0x7')][_0x4497('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x49ec2d,_0x531b70,_0x3a10ec){return new BPromise(function(_0x1e5162,_0x17306b){return client[_0x4497('0x9')](_0x49ec2d,_0x3a10ec)[_0x4497('0xa')](function(_0x9ace7f){logger['info'](_0x4497('0xb'),_0x531b70,_0x4497('0xc'));logger[_0x4497('0xd')](_0x4497('0xe'),_0x531b70,'request\x20sent',JSON['stringify'](_0x9ace7f));if(_0x9ace7f[_0x4497('0xf')]){if(_0x9ace7f[_0x4497('0xf')][_0x4497('0x10')]===0x1f4){logger['error'](_0x4497('0xb'),_0x531b70,_0x9ace7f[_0x4497('0xf')][_0x4497('0x11')]);return _0x17306b(_0x9ace7f[_0x4497('0xf')][_0x4497('0x11')]);}logger[_0x4497('0xf')](_0x4497('0xb'),_0x531b70,_0x9ace7f[_0x4497('0xf')][_0x4497('0x11')]);return _0x1e5162(_0x9ace7f[_0x4497('0xf')][_0x4497('0x11')]);}else{logger[_0x4497('0x12')]('Setting,\x20%s,\x20%s',_0x531b70,'request\x20sent');_0x1e5162(_0x9ace7f['result']['message']);}})[_0x4497('0x13')](function(_0x214cb2){logger['error']('Setting,\x20%s,\x20%s',_0x531b70,_0x214cb2);_0x17306b(_0x214cb2);});});}exports[_0x4497('0x14')]=function(_0x4dfeed){var _0x3e0eab=this;return new Promise(function(_0x3f8d8d,_0x5d4aea){return db[_0x4497('0x15')][_0x4497('0x16')]({'raw':_0x4dfeed[_0x4497('0x17')]?_0x4dfeed[_0x4497('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x4dfeed[_0x4497('0x17')]?_0x4dfeed['options']['where']||null:null,'attributes':_0x4dfeed[_0x4497('0x17')]?_0x4dfeed[_0x4497('0x17')]['attributes']||null:null,'include':_0x4dfeed[_0x4497('0x17')]?_0x4dfeed[_0x4497('0x17')][_0x4497('0x18')]?_['map'](_0x4dfeed[_0x4497('0x17')]['include'],function(_0x88a58a){return{'model':db[_0x88a58a[_0x4497('0x19')]],'as':_0x88a58a['as'],'attributes':_0x88a58a[_0x4497('0x1a')],'include':_0x88a58a[_0x4497('0x18')]?_[_0x4497('0x1b')](_0x88a58a['include'],function(_0x5d8670){return{'model':db[_0x5d8670['model']],'as':_0x5d8670['as'],'attributes':_0x5d8670[_0x4497('0x1a')],'include':_0x5d8670['include']?_['map'](_0x5d8670[_0x4497('0x18')],function(_0xa5da9){return{'model':db[_0xa5da9['model']],'as':_0xa5da9['as'],'attributes':_0xa5da9[_0x4497('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x4497('0xa')](function(_0x53fc0f){logger[_0x4497('0x12')](_0x4497('0x14'),_0x4dfeed);logger[_0x4497('0xd')](_0x4497('0x14'),_0x4dfeed,JSON['stringify'](_0x53fc0f));_0x3f8d8d(_0x53fc0f);})[_0x4497('0x13')](function(_0x1700d5){logger[_0x4497('0xf')](_0x4497('0x14'),_0x1700d5['message'],_0x4dfeed);_0x5d4aea(_0x3e0eab[_0x4497('0xf')](0x1f4,_0x1700d5['message']));});});}; \ No newline at end of file +var _0xce85=['error','code','message','result','catch','Setting','options','attributes','map','include','model','ShowSetting','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xce85,0x66));var _0x5ce8=function(_0xb6a965,_0x5c5ace){_0xb6a965=_0xb6a965-0x0;var _0x51d37d=_0xce85[_0xb6a965];return _0x51d37d;};'use strict';var _=require(_0x5ce8('0x0'));var util=require('util');var moment=require(_0x5ce8('0x1'));var BPromise=require(_0x5ce8('0x2'));var rs=require(_0x5ce8('0x3'));var fs=require('fs');var Redis=require(_0x5ce8('0x4'));var db=require(_0x5ce8('0x5'))['db'];var utils=require(_0x5ce8('0x6'));var logger=require(_0x5ce8('0x7'))(_0x5ce8('0x8'));var config=require('../../config/environment');var jayson=require(_0x5ce8('0x9'));var client=jayson[_0x5ce8('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2d9b32,_0x16ac0b,_0x19401b){return new BPromise(function(_0x2b1625,_0x95d0d0){return client[_0x5ce8('0xb')](_0x2d9b32,_0x19401b)['then'](function(_0x3d5bec){logger[_0x5ce8('0xc')](_0x5ce8('0xd'),_0x16ac0b,_0x5ce8('0xe'));logger[_0x5ce8('0xf')](_0x5ce8('0x10'),_0x16ac0b,_0x5ce8('0xe'),JSON[_0x5ce8('0x11')](_0x3d5bec));if(_0x3d5bec[_0x5ce8('0x12')]){if(_0x3d5bec[_0x5ce8('0x12')][_0x5ce8('0x13')]===0x1f4){logger['error'](_0x5ce8('0xd'),_0x16ac0b,_0x3d5bec[_0x5ce8('0x12')][_0x5ce8('0x14')]);return _0x95d0d0(_0x3d5bec[_0x5ce8('0x12')][_0x5ce8('0x14')]);}logger['error'](_0x5ce8('0xd'),_0x16ac0b,_0x3d5bec[_0x5ce8('0x12')][_0x5ce8('0x14')]);return _0x2b1625(_0x3d5bec['error'][_0x5ce8('0x14')]);}else{logger[_0x5ce8('0xc')](_0x5ce8('0xd'),_0x16ac0b,'request\x20sent');_0x2b1625(_0x3d5bec[_0x5ce8('0x15')]['message']);}})[_0x5ce8('0x16')](function(_0x992220){logger['error'](_0x5ce8('0xd'),_0x16ac0b,_0x992220);_0x95d0d0(_0x992220);});});}exports['ShowSetting']=function(_0x53e293){var _0x290a64=this;return new Promise(function(_0x366172,_0x3205ee){return db[_0x5ce8('0x17')]['find']({'raw':_0x53e293[_0x5ce8('0x18')]?_0x53e293[_0x5ce8('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x53e293['options']?_0x53e293[_0x5ce8('0x18')]['where']||null:null,'attributes':_0x53e293[_0x5ce8('0x18')]?_0x53e293['options'][_0x5ce8('0x19')]||null:null,'include':_0x53e293['options']?_0x53e293[_0x5ce8('0x18')]['include']?_[_0x5ce8('0x1a')](_0x53e293['options'][_0x5ce8('0x1b')],function(_0x442622){return{'model':db[_0x442622[_0x5ce8('0x1c')]],'as':_0x442622['as'],'attributes':_0x442622[_0x5ce8('0x19')],'include':_0x442622[_0x5ce8('0x1b')]?_[_0x5ce8('0x1a')](_0x442622[_0x5ce8('0x1b')],function(_0xcb22fc){return{'model':db[_0xcb22fc[_0x5ce8('0x1c')]],'as':_0xcb22fc['as'],'attributes':_0xcb22fc['attributes'],'include':_0xcb22fc[_0x5ce8('0x1b')]?_[_0x5ce8('0x1a')](_0xcb22fc[_0x5ce8('0x1b')],function(_0x55fa3a){return{'model':db[_0x55fa3a['model']],'as':_0x55fa3a['as'],'attributes':_0x55fa3a['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x38921f){logger[_0x5ce8('0xc')](_0x5ce8('0x1d'),_0x53e293);logger[_0x5ce8('0xf')](_0x5ce8('0x1d'),_0x53e293,JSON[_0x5ce8('0x11')](_0x38921f));_0x366172(_0x38921f);})['catch'](function(_0x1b5d56){logger[_0x5ce8('0x12')]('ShowSetting',_0x1b5d56[_0x5ce8('0x14')],_0x53e293);_0x3205ee(_0x290a64[_0x5ce8('0x12')](0x1f4,_0x1b5d56[_0x5ce8('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index d2d1118..062e770 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 _0x7a54=['getInteractions','/:id/status','statusGet','/:id/users','post','create','addAnswer','/:id/notify','notify','addApplications','send','status','addAgents','put','/:id','update','delete','destroy','/:id/canned_answers','removeAnswers','removeAgents','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','index','/describe','isAuthenticated','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications'];(function(_0x1250f5,_0x403164){var _0x3d1a70=function(_0x52da22){while(--_0x52da22){_0x1250f5['push'](_0x1250f5['shift']());}};_0x3d1a70(++_0x403164);}(_0x7a54,0x106));var _0x47a5=function(_0x52a646,_0x188b01){_0x52a646=_0x52a646-0x0;var _0x539d8e=_0x7a54[_0x52a646];return _0x539d8e;};'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('0x9')](_0x47a5('0xd'),auth['isAuthenticated'](),controller[_0x47a5('0xe')]);router['get']('/:id/canned_answers',auth[_0x47a5('0xc')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x9')](_0x47a5('0x10'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);router[_0x47a5('0x9')]('/:id/interactions',auth[_0x47a5('0xc')](),controller[_0x47a5('0x12')]);router[_0x47a5('0x9')](_0x47a5('0x13'),controller[_0x47a5('0x14')]);router[_0x47a5('0x9')](_0x47a5('0x15'),auth[_0x47a5('0xc')](),controller['getAgents']);router[_0x47a5('0x16')]('/',auth[_0x47a5('0xc')](),controller[_0x47a5('0x17')]);router[_0x47a5('0x16')](_0x47a5('0xd'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x47a5('0x16')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x47a5('0x18')]);router[_0x47a5('0x16')](_0x47a5('0x19'),controller[_0x47a5('0x1a')]);router[_0x47a5('0x16')](_0x47a5('0x10'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x1b')]);router[_0x47a5('0x16')]('/:id/send',auth[_0x47a5('0xc')](),controller[_0x47a5('0x1c')]);router['post'](_0x47a5('0x13'),controller[_0x47a5('0x1d')]);router[_0x47a5('0x16')]('/:id/users',auth[_0x47a5('0xc')](),controller[_0x47a5('0x1e')]);router[_0x47a5('0x1f')](_0x47a5('0x20'),auth['isAuthenticated'](),controller[_0x47a5('0x21')]);router[_0x47a5('0x22')]('/:id',auth[_0x47a5('0xc')](),controller[_0x47a5('0x23')]);router[_0x47a5('0x22')](_0x47a5('0xd'),auth[_0x47a5('0xc')](),controller['removeDispositions']);router['delete'](_0x47a5('0x24'),auth['isAuthenticated'](),controller[_0x47a5('0x25')]);router['delete'](_0x47a5('0x15'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x26')]);module[_0x47a5('0x27')]=router; \ No newline at end of file +var _0x7a54=['getInteractions','/:id/status','statusGet','/:id/users','post','create','addAnswer','/:id/notify','notify','addApplications','send','status','addAgents','put','/:id','update','delete','destroy','/:id/canned_answers','removeAnswers','removeAgents','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','index','/describe','isAuthenticated','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications'];(function(_0x416173,_0x3045b4){var _0x15338b=function(_0x503d10){while(--_0x503d10){_0x416173['push'](_0x416173['shift']());}};_0x15338b(++_0x3045b4);}(_0x7a54,0x106));var _0x47a5=function(_0x26f2a3,_0x1da4b2){_0x26f2a3=_0x26f2a3-0x0;var _0x4bc46b=_0x7a54[_0x26f2a3];return _0x4bc46b;};'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('0x9')](_0x47a5('0xd'),auth['isAuthenticated'](),controller[_0x47a5('0xe')]);router['get']('/:id/canned_answers',auth[_0x47a5('0xc')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x9')](_0x47a5('0x10'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);router[_0x47a5('0x9')]('/:id/interactions',auth[_0x47a5('0xc')](),controller[_0x47a5('0x12')]);router[_0x47a5('0x9')](_0x47a5('0x13'),controller[_0x47a5('0x14')]);router[_0x47a5('0x9')](_0x47a5('0x15'),auth[_0x47a5('0xc')](),controller['getAgents']);router[_0x47a5('0x16')]('/',auth[_0x47a5('0xc')](),controller[_0x47a5('0x17')]);router[_0x47a5('0x16')](_0x47a5('0xd'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x47a5('0x16')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x47a5('0x18')]);router[_0x47a5('0x16')](_0x47a5('0x19'),controller[_0x47a5('0x1a')]);router[_0x47a5('0x16')](_0x47a5('0x10'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x1b')]);router[_0x47a5('0x16')]('/:id/send',auth[_0x47a5('0xc')](),controller[_0x47a5('0x1c')]);router['post'](_0x47a5('0x13'),controller[_0x47a5('0x1d')]);router[_0x47a5('0x16')]('/:id/users',auth[_0x47a5('0xc')](),controller[_0x47a5('0x1e')]);router[_0x47a5('0x1f')](_0x47a5('0x20'),auth['isAuthenticated'](),controller[_0x47a5('0x21')]);router[_0x47a5('0x22')]('/:id',auth[_0x47a5('0xc')](),controller[_0x47a5('0x23')]);router[_0x47a5('0x22')](_0x47a5('0xd'),auth[_0x47a5('0xc')](),controller['removeDispositions']);router['delete'](_0x47a5('0x24'),auth['isAuthenticated'](),controller[_0x47a5('0x25')]);router['delete'](_0x47a5('0x15'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x26')]);module[_0x47a5('0x27')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index a911364..b811cc4 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 _0x0cf2=['BOOLEAN','TEXT','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','sequelize','exports','STRING','generate','ENUM','twilio','connectel','clicksend','clickatell','bandwidth','csc','infobip','intelepeer'];(function(_0x1c6a78,_0x3edd58){var _0x304b4f=function(_0x3cd6af){while(--_0x3cd6af){_0x1c6a78['push'](_0x1c6a78['shift']());}};_0x304b4f(++_0x3edd58);}(_0x0cf2,0x17f));var _0x20cf=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0x0cf2[_0x187ee1];return _0x388160;};'use strict';var Sequelize=require(_0x20cf('0x0'));var rs=require('randomstring');module[_0x20cf('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0x20cf('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x20cf('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x20cf('0x2')],'defaultValue':function(){return rs[_0x20cf('0x3')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x20cf('0x4')](_0x20cf('0x5'),'skebby',_0x20cf('0x6'),_0x20cf('0x7'),'plivo',_0x20cf('0x8'),_0x20cf('0x9'),_0x20cf('0xa'),_0x20cf('0xb'),_0x20cf('0xc'))},'accountSid':{'type':Sequelize[_0x20cf('0x2')]},'authId':{'type':Sequelize[_0x20cf('0x2')]},'authToken':{'type':Sequelize[_0x20cf('0x2')]},'smsMethod':{'type':Sequelize[_0x20cf('0x4')]('SI','TI','GP')},'username':{'type':Sequelize[_0x20cf('0x2')]},'password':{'type':Sequelize[_0x20cf('0x2')]},'apiKey':{'type':Sequelize[_0x20cf('0x2')]},'applicationId':{'type':Sequelize[_0x20cf('0x2')]},'accountId':{'type':Sequelize[_0x20cf('0x2')]},'senderString':{'type':Sequelize[_0x20cf('0x2')]},'deliveryReport':{'type':Sequelize[_0x20cf('0xd')],'defaultValue':![]},'description':{'type':Sequelize[_0x20cf('0x2')]},'notificationTemplate':{'type':Sequelize[_0x20cf('0xe')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x20cf('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x20cf('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x20cf('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x20cf('0xd')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x20cf('0xd')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x20cf('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x20cf('0xf')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x20cf('0x10'),'set':function(_0x3cdcb4){if(!_0x3cdcb4)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0x20cf('0x11')]('mandatoryDisposition',_0x3cdcb4);}}}; \ No newline at end of file +var _0x8f5c=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports','STRING','name','twilio','skebby','connectel','clickatell','bandwidth','infobip','intelepeer','TEXT','BOOLEAN','INTEGER'];(function(_0x1aab47,_0x4804e3){var _0x756ce1=function(_0x1c73f3){while(--_0x1c73f3){_0x1aab47['push'](_0x1aab47['shift']());}};_0x756ce1(++_0x4804e3);}(_0x8f5c,0x15b));var _0xc8f5=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x8f5c[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xc8f5('0x0'));module[_0xc8f5('0x1')]={'name':{'type':Sequelize[_0xc8f5('0x2')],'unique':_0xc8f5('0x3'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0xc8f5('0x2')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0xc8f5('0x2')]},'type':{'type':Sequelize['ENUM'](_0xc8f5('0x4'),_0xc8f5('0x5'),_0xc8f5('0x6'),'clicksend','plivo',_0xc8f5('0x7'),_0xc8f5('0x8'),'csc',_0xc8f5('0x9'),_0xc8f5('0xa'))},'accountSid':{'type':Sequelize[_0xc8f5('0x2')]},'authId':{'type':Sequelize[_0xc8f5('0x2')]},'authToken':{'type':Sequelize[_0xc8f5('0x2')]},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xc8f5('0x2')]},'apiKey':{'type':Sequelize[_0xc8f5('0x2')]},'applicationId':{'type':Sequelize['STRING']},'accountId':{'type':Sequelize[_0xc8f5('0x2')]},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0xc8f5('0x2')]},'notificationTemplate':{'type':Sequelize[_0xc8f5('0xb')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xc8f5('0xc')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xc8f5('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xc8f5('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xc8f5('0xc')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xc8f5('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xc8f5('0xc')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xc8f5('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xc8f5('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xc8f5('0xe')},'mandatoryDisposition':{'type':Sequelize[_0xc8f5('0xc')],'defaultValue':![],'comment':_0xc8f5('0xf'),'set':function(_0x1dfffb){if(!_0x1dfffb)this[_0xc8f5('0x10')](_0xc8f5('0x11'),null);this[_0xc8f5('0x10')](_0xc8f5('0x12'),_0x1dfffb);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index f634a50..86aae59 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 _0x445e=['getInteractions','Contact','Owner','fullname','internal','Tag','Tags','tag','to\x20is\x20mandatory','List','out','dataValues','Messages','debug','received\x20delivery\x20report\x20from','skebby_dispatch_id','connectel','requestid','statusInt','status_code','groupName','DELIVERED','bandwidth','intelepeer','redif','skebby','clicksend','error_code','inspect','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','ACCEPTD','statusGet','message-id','state','addAgents','emit','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','./smsAccount.socket','register','client','http','then','info','SmsAccount,\x20%s,\x20%s','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','destroy','get','UserProfileResource','stack','name','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','Pause','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','SmsAccounts','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','getDispositions','Disposition','ids','addAnswer','SmsAccountId','CannedAnswer','getAnswers','findOne','findAll','removeAnswers','notify','SmsApplication','account','applications','orderBy','Applications','asc','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','mobile','twilio','from','From','messageId','MessageSid','sender','text','message_id','plivo','Text','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','refid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','Sequelize','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','ListId','Contacts','DESC','list','omit','defaults','contact','SmsInteraction','spread','interaction','created','autoclose','unmanaged','*,*,*,*','SmsMessage','ContactId','AttachmentId','User','unshift','agent','waitForTheAssignedAgent','queueId','SmsQueue','waitForTheAssignedQueue','Start','startRouting','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','send','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','priority'];(function(_0xbc4560,_0x4020b8){var _0x298cfb=function(_0x254423){while(--_0x254423){_0xbc4560['push'](_0xbc4560['shift']());}};_0x298cfb(++_0x4020b8);}(_0x445e,0x114));var _0xe445=function(_0x40d53b,_0x96e75f){_0x40d53b=_0x40d53b-0x0;var _0x6dce9e=_0x445e[_0x40d53b];return _0x6dce9e;};'use strict';var emlformat=require(_0xe445('0x0'));var rimraf=require(_0xe445('0x1'));var zipdir=require(_0xe445('0x2'));var jsonpatch=require(_0xe445('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe445('0x4'));var util=require(_0xe445('0x5'));var path=require(_0xe445('0x6'));var sox=require(_0xe445('0x7'));var csv=require(_0xe445('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe445('0x9'));var squel=require('squel');var crypto=require(_0xe445('0xa'));var jsforce=require(_0xe445('0xb'));var deskjs=require(_0xe445('0xc'));var toCsv=require(_0xe445('0x8'));var querystring=require(_0xe445('0xd'));var Papa=require(_0xe445('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe445('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe445('0x10'));var logger=require('../../config/logger')(_0xe445('0x11'));var utils=require(_0xe445('0x12'));var config=require(_0xe445('0x13'));var licenseUtil=require(_0xe445('0x14'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0xe445('0x15')],{'host':_0xe445('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe445('0x15')]));require(_0xe445('0x17'))[_0xe445('0x18')](socket);var jayson=require('jayson/promise');var client=jayson[_0xe445('0x19')][_0xe445('0x1a')]({'port':0x232c});function respondWithRpcPromise(_0x21ae7e,_0x36493d,_0x120971,_0x3eab6d){return new BPromise(function(_0x3ca781,_0x382bed){var _0x4ad60d=_0x3eab6d||client;return _0x4ad60d['request'](_0x21ae7e,_0x120971)[_0xe445('0x1b')](function(_0x35a1f2){logger[_0xe445('0x1c')](_0xe445('0x1d'),_0x36493d,'request\x20sent');logger['debug'](_0xe445('0x1e'),_0x36493d,_0xe445('0x1f'),JSON[_0xe445('0x20')](_0x35a1f2));if(_0x35a1f2[_0xe445('0x21')]){if(_0x35a1f2['error'][_0xe445('0x22')]===0x1f4){logger[_0xe445('0x21')](_0xe445('0x1d'),_0x36493d,_0x35a1f2['error']['message']);return _0x382bed(_0x35a1f2['error'][_0xe445('0x23')]);}logger[_0xe445('0x21')](_0xe445('0x1d'),_0x36493d,_0x35a1f2['error'][_0xe445('0x23')]);return _0x3ca781(_0x35a1f2['error'][_0xe445('0x23')]);}else{logger['info']('SmsAccount,\x20%s,\x20%s',_0x36493d,'request\x20sent');_0x3ca781(_0x35a1f2[_0xe445('0x24')][_0xe445('0x23')]);}})[_0xe445('0x25')](function(_0x4628f9){logger['error'](_0xe445('0x1d'),_0x36493d,_0x4628f9);_0x382bed(_0x4628f9);});});}function respondWithStatusCode(_0x109d59,_0xace526){_0xace526=_0xace526||0xcc;return function(_0x5bf4fb){if(_0x5bf4fb){return _0x109d59[_0xe445('0x26')](_0xace526);}return _0x109d59[_0xe445('0x27')](_0xace526)[_0xe445('0x28')]();};}function respondWithResult(_0x53ff5f,_0x21ddaa){_0x21ddaa=_0x21ddaa||0xc8;return function(_0x2c827a){if(_0x2c827a){return _0x53ff5f[_0xe445('0x27')](_0x21ddaa)[_0xe445('0x29')](_0x2c827a);}};}function respondWithFilteredResult(_0x42692d,_0x3e9774){return function(_0x3f092e){if(_0x3f092e){var _0x1fcae0=typeof _0x3e9774[_0xe445('0x2a')]==='undefined'&&typeof _0x3e9774[_0xe445('0x2b')]===_0xe445('0x2c');var _0x5b2e47=_0x3f092e[_0xe445('0x2d')];var _0x384aac=_0x1fcae0?0x0:_0x3e9774[_0xe445('0x2a')];var _0xe01170=_0x1fcae0?_0x3f092e[_0xe445('0x2d')]:_0x3e9774[_0xe445('0x2a')]+_0x3e9774[_0xe445('0x2b')];var _0x1c6f35;if(_0xe01170>=_0x5b2e47){_0xe01170=_0x5b2e47;_0x1c6f35=0xc8;}else{_0x1c6f35=0xce;}_0x42692d[_0xe445('0x27')](_0x1c6f35);return _0x42692d[_0xe445('0x2e')](_0xe445('0x2f'),_0x384aac+'-'+_0xe01170+'/'+_0x5b2e47)[_0xe445('0x29')](_0x3f092e);}return null;};}function patchUpdates(_0x3d12d8){return function(_0x2fd017){try{jsonpatch[_0xe445('0x30')](_0x2fd017,_0x3d12d8,!![]);}catch(_0x264add){return BPromise['reject'](_0x264add);}return _0x2fd017[_0xe445('0x31')]();};}function saveUpdates(_0x1b261d,_0x27f9c5){return function(_0x3892db){if(_0x3892db){return _0x3892db[_0xe445('0x32')](_0x1b261d)[_0xe445('0x1b')](function(_0x36fe72){return _0x36fe72;});}return null;};}function removeEntity(_0x134f31,_0x2796c9){return function(_0x3510fa){if(_0x3510fa){return _0x3510fa[_0xe445('0x33')]()[_0xe445('0x1b')](function(){var _0x10b5df=_0x3510fa[_0xe445('0x34')]({'plain':!![]});var _0x32cfde='SmsAccounts';return db[_0xe445('0x35')]['destroy']({'where':{'type':_0x32cfde,'resourceId':_0x10b5df['id']}})[_0xe445('0x1b')](function(){return _0x3510fa;});})[_0xe445('0x1b')](function(){_0x134f31[_0xe445('0x27')](0xcc)[_0xe445('0x28')]();});}};}function handleEntityNotFound(_0x50a65c,_0xf9fda2){return function(_0xe6f065){if(!_0xe6f065){_0x50a65c['sendStatus'](0x194);}return _0xe6f065;};}function handleError(_0x38f42a,_0x4bfbe6){_0x4bfbe6=_0x4bfbe6||0x1f4;return function(_0x106d87){logger[_0xe445('0x21')](_0x106d87[_0xe445('0x36')]);if(_0x106d87[_0xe445('0x37')]){delete _0x106d87[_0xe445('0x37')];}_0x38f42a[_0xe445('0x27')](_0x4bfbe6)['send'](_0x106d87);};}exports['index']=function(_0x5916cd,_0x44ed88){var _0x2e79cf={'include':[{'model':db['Pause'],'as':_0xe445('0x38')}]},_0x1c42a9={},_0x444403={'count':0x0,'rows':[]};var _0x5d139c=_[_0xe445('0x39')](db[_0xe445('0x3a')][_0xe445('0x3b')],function(_0x34b534){return{'name':_0x34b534[_0xe445('0x3c')],'type':_0x34b534[_0xe445('0x3d')][_0xe445('0x3e')]};});_0x1c42a9[_0xe445('0x3f')]=_[_0xe445('0x39')](_0x5d139c,_0xe445('0x37'));_0x1c42a9[_0xe445('0x40')]=_[_0xe445('0x41')](_0x5916cd[_0xe445('0x40')]);_0x1c42a9[_0xe445('0x42')]=_[_0xe445('0x43')](_0x1c42a9[_0xe445('0x3f')],_0x1c42a9['query']);_0x2e79cf[_0xe445('0x44')]=_[_0xe445('0x43')](_0x1c42a9[_0xe445('0x3f')],qs[_0xe445('0x45')](_0x5916cd[_0xe445('0x40')][_0xe445('0x45')]));_0x2e79cf[_0xe445('0x44')]=_0x2e79cf[_0xe445('0x44')][_0xe445('0x46')]?_0x2e79cf['attributes']:_0x1c42a9[_0xe445('0x3f')];if(!_0x5916cd[_0xe445('0x40')][_0xe445('0x47')](_0xe445('0x48'))){_0x2e79cf['limit']=qs[_0xe445('0x2b')](_0x5916cd[_0xe445('0x40')]['limit']);_0x2e79cf['offset']=qs[_0xe445('0x2a')](_0x5916cd[_0xe445('0x40')]['offset']);}_0x2e79cf[_0xe445('0x49')]=qs[_0xe445('0x4a')](_0x5916cd[_0xe445('0x40')][_0xe445('0x4a')]);_0x2e79cf[_0xe445('0x4b')]=qs[_0xe445('0x42')](_[_0xe445('0x4c')](_0x5916cd[_0xe445('0x40')],_0x1c42a9[_0xe445('0x42')]),_0x5d139c);if(_0x5916cd[_0xe445('0x40')][_0xe445('0x4d')]){_0x2e79cf[_0xe445('0x4b')]=_[_0xe445('0x4e')](_0x2e79cf[_0xe445('0x4b')],{'$or':_[_0xe445('0x39')](_0x5d139c,function(_0x167918){if(_0x167918[_0xe445('0x3d')]!==_0xe445('0x4f')){var _0x53af75={};_0x53af75[_0x167918[_0xe445('0x37')]]={'$like':'%'+_0x5916cd['query'][_0xe445('0x4d')]+'%'};return _0x53af75;}})});}_0x2e79cf=_[_0xe445('0x4e')]({},_0x2e79cf,_0x5916cd[_0xe445('0x50')]);var _0x2ee7fb={'where':_0x2e79cf[_0xe445('0x4b')]};return db[_0xe445('0x3a')][_0xe445('0x2d')](_0x2ee7fb)[_0xe445('0x1b')](function(_0x34190c){_0x444403[_0xe445('0x2d')]=_0x34190c;if(_0x5916cd[_0xe445('0x40')][_0xe445('0x51')]){_0x2e79cf[_0xe445('0x52')]=[{'all':!![]}];}return db[_0xe445('0x3a')]['findAll'](_0x2e79cf);})[_0xe445('0x1b')](function(_0x23e107){_0x444403[_0xe445('0x53')]=_0x23e107;return _0x444403;})[_0xe445('0x1b')](respondWithFilteredResult(_0x44ed88,_0x2e79cf))[_0xe445('0x25')](handleError(_0x44ed88,null));};exports[_0xe445('0x54')]=function(_0x3c43c6,_0x3960c2){var _0x11ebbb={'raw':![],'where':{'id':_0x3c43c6[_0xe445('0x55')]['id']},'include':[{'model':db[_0xe445('0x56')],'as':'mandatoryDispositionPause'}]},_0x379000={};_0x379000[_0xe445('0x3f')]=_[_0xe445('0x41')](db[_0xe445('0x3a')][_0xe445('0x3b')]);_0x379000[_0xe445('0x40')]=_[_0xe445('0x41')](_0x3c43c6[_0xe445('0x40')]);_0x379000[_0xe445('0x42')]=_['intersection'](_0x379000[_0xe445('0x3f')],_0x379000[_0xe445('0x40')]);_0x11ebbb[_0xe445('0x44')]=_['intersection'](_0x379000[_0xe445('0x3f')],qs[_0xe445('0x45')](_0x3c43c6[_0xe445('0x40')][_0xe445('0x45')]));_0x11ebbb[_0xe445('0x44')]=_0x11ebbb[_0xe445('0x44')][_0xe445('0x46')]?_0x11ebbb['attributes']:_0x379000[_0xe445('0x3f')];if(_0x3c43c6[_0xe445('0x40')]['includeAll']){_0x11ebbb[_0xe445('0x52')]=[{'all':!![]}];}_0x11ebbb=_[_0xe445('0x4e')]({},_0x11ebbb,_0x3c43c6[_0xe445('0x50')]);return db[_0xe445('0x3a')][_0xe445('0x57')](_0x11ebbb)[_0xe445('0x1b')](handleEntityNotFound(_0x3960c2,null))[_0xe445('0x1b')](respondWithResult(_0x3960c2,null))[_0xe445('0x25')](handleError(_0x3960c2,null));};exports[_0xe445('0x58')]=function(_0xaf3e0a,_0x1be5b9){return db['SmsAccount'][_0xe445('0x58')](_0xaf3e0a['body'],{})[_0xe445('0x1b')](function(_0x452dde){var _0x3602c7=_0xaf3e0a['user'][_0xe445('0x34')]({'plain':!![]});if(!_0x3602c7)throw new Error(_0xe445('0x59'));if(_0x3602c7[_0xe445('0x5a')]===_0xe445('0x5b')){var _0xc7a321=_0x452dde['get']({'plain':!![]});var _0x5beb4f=_0xe445('0x5c');return db[_0xe445('0x5d')][_0xe445('0x57')]({'where':{'name':_0x5beb4f,'userProfileId':_0x3602c7[_0xe445('0x5e')]},'raw':!![]})[_0xe445('0x1b')](function(_0x214ef0){if(_0x214ef0&&_0x214ef0[_0xe445('0x5f')]===0x0){return db[_0xe445('0x35')][_0xe445('0x58')]({'name':_0xc7a321[_0xe445('0x37')],'resourceId':_0xc7a321['id'],'type':_0x214ef0[_0xe445('0x37')],'sectionId':_0x214ef0['id']},{})['then'](function(){return _0x452dde;});}else{return _0x452dde;}})[_0xe445('0x25')](function(_0x20e488){logger[_0xe445('0x21')](_0xe445('0x60'),_0x20e488);throw _0x20e488;});}return _0x452dde;})[_0xe445('0x1b')](respondWithResult(_0x1be5b9,0xc9))[_0xe445('0x25')](handleError(_0x1be5b9,null));};exports[_0xe445('0x32')]=function(_0x2f9471,_0x7cae5){if(_0x2f9471[_0xe445('0x61')]['id']){delete _0x2f9471[_0xe445('0x61')]['id'];}return db[_0xe445('0x3a')][_0xe445('0x57')]({'where':{'id':_0x2f9471[_0xe445('0x55')]['id']},'include':[{'model':db[_0xe445('0x56')],'as':'mandatoryDispositionPause'}]})[_0xe445('0x1b')](handleEntityNotFound(_0x7cae5,null))[_0xe445('0x1b')](saveUpdates(_0x2f9471[_0xe445('0x61')],null))[_0xe445('0x1b')](respondWithResult(_0x7cae5,null))[_0xe445('0x25')](handleError(_0x7cae5,null));};exports[_0xe445('0x33')]=function(_0x219114,_0x2c628c){return db[_0xe445('0x3a')][_0xe445('0x57')]({'where':{'id':_0x219114[_0xe445('0x55')]['id']}})['then'](handleEntityNotFound(_0x2c628c,null))[_0xe445('0x1b')](removeEntity(_0x2c628c,null))[_0xe445('0x25')](handleError(_0x2c628c,null));};exports['describe']=function(_0x42f5b8,_0x3c836e){return db[_0xe445('0x3a')][_0xe445('0x62')]()['then'](respondWithResult(_0x3c836e,null))[_0xe445('0x25')](handleError(_0x3c836e,null));};exports[_0xe445('0x63')]=function(_0x5cb1f2,_0xa88565,_0x5e107d){if(_0x5cb1f2[_0xe445('0x61')]['id']){delete _0x5cb1f2['body']['id'];}return db['SmsAccount'][_0xe445('0x57')]({'where':{'id':_0x5cb1f2[_0xe445('0x55')]['id']}})[_0xe445('0x1b')](handleEntityNotFound(_0xa88565,null))[_0xe445('0x1b')](function(_0x466d47){if(_0x466d47){_0x5cb1f2[_0xe445('0x61')]['SmsAccountId']=_0x466d47['id'];return db['Disposition'][_0xe445('0x58')](_0x5cb1f2[_0xe445('0x61')]);}})[_0xe445('0x1b')](respondWithResult(_0xa88565,null))[_0xe445('0x25')](handleError(_0xa88565,null));};exports[_0xe445('0x64')]=function(_0x13a638,_0xb3b5ad,_0x3a8b7d){var _0x17b69f={'raw':![],'where':{}};var _0x3159d8={};var _0x1b9d3e={'count':0x0,'rows':[]};return db[_0xe445('0x3a')]['findOne']({'where':{'id':_0x13a638[_0xe445('0x55')]['id']}})['then'](handleEntityNotFound(_0xb3b5ad,null))[_0xe445('0x1b')](function(_0x4c838a){if(_0x4c838a){_0x3159d8[_0xe445('0x3f')]=_['keys'](db['Disposition'][_0xe445('0x3b')]);_0x3159d8[_0xe445('0x40')]=_[_0xe445('0x41')](_0x13a638['query']);_0x3159d8[_0xe445('0x42')]=_['intersection'](_0x3159d8['model'],_0x3159d8['query']);_0x17b69f[_0xe445('0x44')]=_[_0xe445('0x43')](_0x3159d8[_0xe445('0x3f')],qs[_0xe445('0x45')](_0x13a638[_0xe445('0x40')]['fields']));_0x17b69f[_0xe445('0x44')]=_0x17b69f[_0xe445('0x44')]['length']?_0x17b69f[_0xe445('0x44')]:_0x3159d8[_0xe445('0x3f')];if(!_0x13a638[_0xe445('0x40')][_0xe445('0x47')](_0xe445('0x48'))){_0x17b69f['limit']=qs[_0xe445('0x2b')](_0x13a638['query'][_0xe445('0x2b')]);_0x17b69f[_0xe445('0x2a')]=qs[_0xe445('0x2a')](_0x13a638[_0xe445('0x40')][_0xe445('0x2a')]);}_0x17b69f[_0xe445('0x49')]=qs[_0xe445('0x4a')](_0x13a638[_0xe445('0x40')][_0xe445('0x4a')]);_0x17b69f[_0xe445('0x4b')]=qs[_0xe445('0x42')](_[_0xe445('0x4c')](_0x13a638[_0xe445('0x40')],_0x3159d8[_0xe445('0x42')]));_0x17b69f[_0xe445('0x4b')]['SmsAccountId']=_0x4c838a['id'];if(_0x13a638['query'][_0xe445('0x4d')]){_0x17b69f[_0xe445('0x4b')]=_[_0xe445('0x4e')](_0x17b69f[_0xe445('0x4b')],{'$or':_[_0xe445('0x39')](_0x17b69f['attributes'],function(_0x19445b){var _0x43ffd8={};_0x43ffd8[_0x19445b]={'$like':'%'+_0x13a638[_0xe445('0x40')][_0xe445('0x4d')]+'%'};return _0x43ffd8;})});}_0x17b69f=_[_0xe445('0x4e')]({},_0x17b69f,_0x13a638[_0xe445('0x50')]);return db[_0xe445('0x65')][_0xe445('0x2d')]({'where':_0x17b69f[_0xe445('0x4b')]})[_0xe445('0x1b')](function(_0x5d6e7b){_0x1b9d3e['count']=_0x5d6e7b;if(_0x13a638[_0xe445('0x40')][_0xe445('0x51')]){_0x17b69f[_0xe445('0x52')]=[{'all':!![]}];}return db[_0xe445('0x65')]['findAll'](_0x17b69f);})[_0xe445('0x1b')](function(_0x5bd544){_0x1b9d3e[_0xe445('0x53')]=_0x5bd544;return _0x1b9d3e;});}})[_0xe445('0x1b')](respondWithFilteredResult(_0xb3b5ad,_0x17b69f))[_0xe445('0x25')](handleError(_0xb3b5ad,null));};exports['removeDispositions']=function(_0x52019b,_0x4b6302,_0x54e0d7){return db[_0xe445('0x3a')]['find']({'where':{'id':_0x52019b[_0xe445('0x55')]['id']}})[_0xe445('0x1b')](handleEntityNotFound(_0x4b6302,null))[_0xe445('0x1b')](function(_0x2bc88d){if(_0x2bc88d){return _0x2bc88d['removeDispositions'](_0x52019b[_0xe445('0x40')][_0xe445('0x66')]);}})[_0xe445('0x1b')](respondWithStatusCode(_0x4b6302,null))[_0xe445('0x25')](handleError(_0x4b6302,null));};exports[_0xe445('0x67')]=function(_0x384b12,_0x3d2b44,_0x270685){if(_0x384b12[_0xe445('0x61')]['id']){delete _0x384b12[_0xe445('0x61')]['id'];}return db[_0xe445('0x3a')][_0xe445('0x57')]({'where':{'id':_0x384b12[_0xe445('0x55')]['id']}})[_0xe445('0x1b')](handleEntityNotFound(_0x3d2b44,null))[_0xe445('0x1b')](function(_0x3cd61e){if(_0x3cd61e){_0x384b12['body'][_0xe445('0x68')]=_0x3cd61e['id'];return db[_0xe445('0x69')][_0xe445('0x58')](_0x384b12[_0xe445('0x61')]);}})[_0xe445('0x1b')](respondWithResult(_0x3d2b44,null))[_0xe445('0x25')](handleError(_0x3d2b44,null));};exports[_0xe445('0x6a')]=function(_0x41a04f,_0x5f4425,_0x804e4c){var _0x49d759={'raw':![],'where':{}};var _0x2ed38a={};var _0xba79e9={'count':0x0,'rows':[]};return db[_0xe445('0x3a')][_0xe445('0x6b')]({'where':{'id':_0x41a04f[_0xe445('0x55')]['id']}})[_0xe445('0x1b')](handleEntityNotFound(_0x5f4425,null))[_0xe445('0x1b')](function(_0x167eee){if(_0x167eee){_0x2ed38a['model']=_['keys'](db['CannedAnswer'][_0xe445('0x3b')]);_0x2ed38a[_0xe445('0x40')]=_[_0xe445('0x41')](_0x41a04f[_0xe445('0x40')]);_0x2ed38a['filters']=_[_0xe445('0x43')](_0x2ed38a['model'],_0x2ed38a[_0xe445('0x40')]);_0x49d759[_0xe445('0x44')]=_[_0xe445('0x43')](_0x2ed38a[_0xe445('0x3f')],qs['fields'](_0x41a04f['query']['fields']));_0x49d759[_0xe445('0x44')]=_0x49d759[_0xe445('0x44')][_0xe445('0x46')]?_0x49d759[_0xe445('0x44')]:_0x2ed38a[_0xe445('0x3f')];if(!_0x41a04f['query'][_0xe445('0x47')](_0xe445('0x48'))){_0x49d759[_0xe445('0x2b')]=qs[_0xe445('0x2b')](_0x41a04f['query'][_0xe445('0x2b')]);_0x49d759[_0xe445('0x2a')]=qs[_0xe445('0x2a')](_0x41a04f['query']['offset']);}_0x49d759[_0xe445('0x49')]=qs[_0xe445('0x4a')](_0x41a04f[_0xe445('0x40')][_0xe445('0x4a')]);_0x49d759[_0xe445('0x4b')]=qs[_0xe445('0x42')](_[_0xe445('0x4c')](_0x41a04f[_0xe445('0x40')],_0x2ed38a[_0xe445('0x42')]));_0x49d759[_0xe445('0x4b')][_0xe445('0x68')]=_0x167eee['id'];if(_0x41a04f[_0xe445('0x40')][_0xe445('0x4d')]){_0x49d759[_0xe445('0x4b')]=_['merge'](_0x49d759[_0xe445('0x4b')],{'$or':_[_0xe445('0x39')](_0x49d759[_0xe445('0x44')],function(_0x5715cb){var _0x4a805e={};_0x4a805e[_0x5715cb]={'$like':'%'+_0x41a04f[_0xe445('0x40')]['filter']+'%'};return _0x4a805e;})});}_0x49d759=_[_0xe445('0x4e')]({},_0x49d759,_0x41a04f['options']);return db['CannedAnswer'][_0xe445('0x2d')]({'where':_0x49d759['where']})[_0xe445('0x1b')](function(_0x186773){_0xba79e9['count']=_0x186773;if(_0x41a04f[_0xe445('0x40')][_0xe445('0x51')]){_0x49d759[_0xe445('0x52')]=[{'all':!![]}];}return db[_0xe445('0x69')][_0xe445('0x6c')](_0x49d759);})['then'](function(_0x5224b3){_0xba79e9[_0xe445('0x53')]=_0x5224b3;return _0xba79e9;});}})[_0xe445('0x1b')](respondWithFilteredResult(_0x5f4425,_0x49d759))[_0xe445('0x25')](handleError(_0x5f4425,null));};exports[_0xe445('0x6d')]=function(_0x28879d,_0x43e872,_0x4775e2){return db[_0xe445('0x3a')][_0xe445('0x57')]({'where':{'id':_0x28879d[_0xe445('0x55')]['id']}})[_0xe445('0x1b')](handleEntityNotFound(_0x43e872,null))[_0xe445('0x1b')](function(_0x2c0f21){if(_0x2c0f21){return _0x2c0f21[_0xe445('0x6d')](_0x28879d[_0xe445('0x40')][_0xe445('0x66')]);}})[_0xe445('0x1b')](respondWithStatusCode(_0x43e872,null))[_0xe445('0x25')](handleError(_0x43e872,null));};exports[_0xe445('0x6e')]=function(_0x5d8bb1,_0x28faef,_0x4e2979){var _0x2a8fa9={'channel':'sms'};var _0x1b7e81=[];var _0x31673b=[];var _0x292f7f={};return db[_0xe445('0x3a')][_0xe445('0x57')]({'where':{'id':_0x5d8bb1[_0xe445('0x55')]['id']},'include':[{'model':db[_0xe445('0x6f')],'as':'Applications'}]})[_0xe445('0x1b')](handleEntityNotFound(_0x28faef,null))[_0xe445('0x1b')](function(_0x3ef560){_0x2a8fa9[_0xe445('0x70')]=_0x3ef560;_0x2a8fa9[_0xe445('0x71')]=_[_0xe445('0x72')](_0x3ef560[_0xe445('0x73')],['priority'],[_0xe445('0x74')]);if(_0x2a8fa9['account'][_0xe445('0x73')]){delete _0x2a8fa9[_0xe445('0x70')]['Applications'];}return db[_0xe445('0x75')][_0xe445('0x62')]();})[_0xe445('0x1b')](function(_0x1bb5c5){if(!_0x1bb5c5){throw new db['Sequelize'][(_0xe445('0x76'))](_0xe445('0x77'));}_0x1b7e81=_[_0xe445('0x78')](_[_0xe445('0x41')](_0x1bb5c5),[_0xe445('0x79'),_0xe445('0x7a')]);_0x31673b=_[_0xe445('0x78')](_[_0xe445('0x41')](_0x1bb5c5),['createdAt','updatedAt',_0xe445('0x7b'),'ListId']);_0x2a8fa9[_0xe445('0x61')]={'mapKey':_0xe445('0x7c')};if(_0x2a8fa9['account'][_0xe445('0x3d')]){switch(_0x2a8fa9[_0xe445('0x70')][_0xe445('0x3d')]){case _0xe445('0x7d'):_0x2a8fa9[_0xe445('0x61')][_0xe445('0x7e')]=_0x5d8bb1[_0xe445('0x61')][_0xe445('0x7f')];_0x2a8fa9[_0xe445('0x61')][_0xe445('0x61')]=_0x5d8bb1['body']['Body'];_0x2a8fa9['body'][_0xe445('0x80')]=_0x5d8bb1[_0xe445('0x61')][_0xe445('0x81')];break;case'skebby':_0x2a8fa9[_0xe445('0x61')][_0xe445('0x7e')]='+'+_0x5d8bb1[_0xe445('0x61')][_0xe445('0x82')];_0x2a8fa9[_0xe445('0x61')][_0xe445('0x61')]=_0x5d8bb1[_0xe445('0x61')][_0xe445('0x83')];break;case'connectel':_0x2a8fa9[_0xe445('0x61')][_0xe445('0x7e')]=_0x5d8bb1[_0xe445('0x61')][_0xe445('0x7e')];_0x2a8fa9['body'][_0xe445('0x61')]=_0x5d8bb1[_0xe445('0x61')][_0xe445('0x23')];break;case'clicksend':_0x2a8fa9[_0xe445('0x61')][_0xe445('0x7e')]=_0x5d8bb1[_0xe445('0x61')][_0xe445('0x7e')];_0x2a8fa9[_0xe445('0x61')]['body']=_0x5d8bb1[_0xe445('0x61')][_0xe445('0x61')];_0x2a8fa9[_0xe445('0x61')][_0xe445('0x80')]=_0x5d8bb1['body'][_0xe445('0x84')];break;case _0xe445('0x85'):_0x2a8fa9[_0xe445('0x61')][_0xe445('0x7e')]=_0x5d8bb1[_0xe445('0x61')]['From'];_0x2a8fa9['body']['body']=_0x5d8bb1['body'][_0xe445('0x86')];_0x2a8fa9['body'][_0xe445('0x80')]=_0x5d8bb1[_0xe445('0x61')]['MessageUUID'];break;case _0xe445('0x87'):_0x2a8fa9[_0xe445('0x61')][_0xe445('0x7e')]='+'+_0x5d8bb1[_0xe445('0x61')]['results'][0x0]['from'];_0x2a8fa9[_0xe445('0x61')][_0xe445('0x61')]=_0x5d8bb1[_0xe445('0x61')][_0xe445('0x88')][0x0][_0xe445('0x83')];_0x2a8fa9['body']['messageId']=_0x5d8bb1[_0xe445('0x61')][_0xe445('0x88')][0x0]['messageId'];break;case _0xe445('0x89'):_0x2a8fa9['body'][_0xe445('0x7e')]=_0x5d8bb1[_0xe445('0x61')][_0xe445('0x8a')];_0x2a8fa9['body'][_0xe445('0x61')]=_0x5d8bb1[_0xe445('0x61')][_0xe445('0x8b')][_0xe445('0x23')];break;case _0xe445('0x8c'):_0x2a8fa9[_0xe445('0x61')][_0xe445('0x7e')]=_0x5d8bb1[_0xe445('0x61')][_0xe445('0x8d')];_0x2a8fa9[_0xe445('0x61')][_0xe445('0x61')]=_0x5d8bb1[_0xe445('0x61')][_0xe445('0x83')];_0x2a8fa9[_0xe445('0x61')][_0xe445('0x80')]=_0x5d8bb1[_0xe445('0x61')]['replyMessageId'];break;case'bandwidth':_0x2a8fa9[_0xe445('0x61')][_0xe445('0x80')]=_0x5d8bb1[_0xe445('0x61')][0x0][_0xe445('0x23')]['id'];_0x2a8fa9['body']['from']=_0x5d8bb1[_0xe445('0x61')][0x0][_0xe445('0x23')]['from'];_0x2a8fa9[_0xe445('0x61')]['body']=_0x5d8bb1[_0xe445('0x61')][0x0][_0xe445('0x23')]['text'];break;case'intelepeer':_0x2a8fa9['body']['from']=_0x5d8bb1['body'][_0xe445('0x7e')];_0x2a8fa9['body']['body']=_0x5d8bb1['body'][_0xe445('0x23')];_0x2a8fa9[_0xe445('0x61')][_0xe445('0x80')]=_0x5d8bb1[_0xe445('0x61')][_0xe445('0x8e')];break;}}if(_0x2a8fa9['body']['id']){delete _0x2a8fa9['body']['id'];}if(_[_0xe445('0x8f')](_0x2a8fa9[_0xe445('0x61')][_0xe445('0x7e')])){throw new db['Sequelize']['ValidationError'](_0xe445('0x90'));}if(_[_0xe445('0x8f')](_0x2a8fa9['body'][_0xe445('0x61')])||_0x2a8fa9[_0xe445('0x61')][_0xe445('0x61')]===''){throw new db['Sequelize'][(_0xe445('0x76'))](_0xe445('0x91'));}if(_[_0xe445('0x8f')](_0x2a8fa9[_0xe445('0x61')]['mapKey'])){throw new db['Sequelize'][(_0xe445('0x76'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x31673b);}if(!_[_0xe445('0x92')](_0x31673b,_0x2a8fa9[_0xe445('0x61')][_0xe445('0x93')])){throw new db[(_0xe445('0x94'))]['ValidationError'](_0xe445('0x95')+_0x31673b);}_0x292f7f[_0x2a8fa9[_0xe445('0x61')][_0xe445('0x93')]]=_0x2a8fa9[_0xe445('0x61')][_0xe445('0x7e')];return db[_0xe445('0x96')][_0xe445('0x57')]({'where':{'id':_0x2a8fa9['account'][_0xe445('0x97')]},'include':[{'model':db['CmContact'],'as':_0xe445('0x98'),'where':_0x292f7f,'limit':0x1,'order':[[_0xe445('0x7a'),_0xe445('0x99')]]}]});})[_0xe445('0x1b')](handleEntityNotFound(_0x28faef,null))[_0xe445('0x1b')](function(_0x41553f){if(_0x41553f){_0x2a8fa9[_0xe445('0x9a')]=_[_0xe445('0x9b')](_0x41553f,[_0xe445('0x98')]);if(_0x41553f[_0xe445('0x98')][_0xe445('0x46')]){return _0x41553f[_0xe445('0x98')][0x0];}var _0x2c5c69=_[_0xe445('0x9c')](_0x2a8fa9[_0xe445('0x61')],{'firstName':_0x2a8fa9[_0xe445('0x61')]['from'],'ListId':_0x41553f['id']});_0x2c5c69[_0x2a8fa9[_0xe445('0x61')][_0xe445('0x93')]]=_0x2a8fa9[_0xe445('0x61')][_0xe445('0x7e')];return db[_0xe445('0x75')][_0xe445('0x58')](_0x2c5c69,{'fields':_0x1b7e81,'raw':!![]});}})['then'](handleEntityNotFound(_0x28faef,null))[_0xe445('0x1b')](function(_0x11c88c){if(_0x11c88c){_0x2a8fa9[_0xe445('0x9d')]=_0x11c88c;var _0x584628={'ContactId':_0x11c88c['id'],'phone':_0x2a8fa9[_0xe445('0x61')][_0xe445('0x7e')],'SmsAccountId':_0x5d8bb1[_0xe445('0x55')]['id']};var _0x50c525={'ContactId':_0x11c88c['id'],'SmsAccountId':_0x5d8bb1[_0xe445('0x55')]['id'],'closed':![]};return db['SmsInteraction']['find']({'where':_0x50c525})[_0xe445('0x1b')](function(_0x3c4f4a){if(_0x3c4f4a){return[_0x3c4f4a,![]];}return db[_0xe445('0x9e')][_0xe445('0x58')](_0x584628)['then'](function(_0x23fb4e){return[_0x23fb4e,!![]];});});}})[_0xe445('0x9f')](function(_0x1fc55e,_0x5bdfe6){_0x2a8fa9[_0xe445('0xa0')]=_0x1fc55e[_0xe445('0x34')]({'plain':!![]});_0x2a8fa9[_0xe445('0xa0')][_0xe445('0xa1')]=![];if(_0x5bdfe6){if(_0x2a8fa9[_0xe445('0x70')][_0xe445('0xa2')]){_0x2a8fa9['applications']['push']({'id':0x0,'priority':_0x2a8fa9[_0xe445('0x71')][_0xe445('0x46')]+0x1,'app':'close','appdata':_0xe445('0xa3'),'interval':_0xe445('0xa4')});}_0x2a8fa9[_0xe445('0xa0')]['created']=!![];}return db[_0xe445('0xa5')]['create']({'phone':_0x2a8fa9[_0xe445('0x61')][_0xe445('0x7e')],'messageId':_0x2a8fa9[_0xe445('0x61')][_0xe445('0x80')],'body':_0x2a8fa9[_0xe445('0x61')]['body'],'SmsAccountId':_0x5d8bb1[_0xe445('0x55')]['id'],'SmsInteractionId':_0x1fc55e['id'],'direction':'in','ContactId':_0x1fc55e[_0xe445('0xa6')],'AttachmentId':_0x2a8fa9[_0xe445('0x61')][_0xe445('0xa7')]});})[_0xe445('0x1b')](function(_0x3bf162){_0x2a8fa9[_0xe445('0x23')]=_0x3bf162;if(!_0x2a8fa9['interaction']['UserId'])return;return db[_0xe445('0xa8')]['find']({'attributes':['id','name'],'where':{'id':_0x2a8fa9[_0xe445('0xa0')]['UserId']}});})[_0xe445('0x1b')](function(_0x52d57d){if(_0x52d57d){_0x2a8fa9['applications'][_0xe445('0xa9')]({'id':0x0,'priority':0x0,'app':_0xe445('0xaa'),'appdata':_0x52d57d[_0xe445('0x37')]+','+(_0x2a8fa9[_0xe445('0x70')][_0xe445('0xab')]||0xa),'interval':'*,*,*,*'});}if(!_0x2a8fa9[_0xe445('0xa0')][_0xe445('0xac')])return;return db[_0xe445('0xad')][_0xe445('0x57')]({'attributes':['id',_0xe445('0x37')],'where':{'id':_0x2a8fa9[_0xe445('0xa0')][_0xe445('0xac')]}});})[_0xe445('0x1b')](function(_0x22a27b){if(_0x22a27b){_0x2a8fa9[_0xe445('0x71')][_0xe445('0xa9')]({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x22a27b['name']+','+(_0x2a8fa9[_0xe445('0x70')][_0xe445('0xae')]||0x12c),'interval':_0xe445('0xa4')});}return respondWithRpcPromise(_0xe445('0xaf'),_0xe445('0xb0'),_0x2a8fa9);})['then'](function(_0xd02359){if(_0xd02359){var _0x45b064=0xc8;var _0x173fd0=_0xe445('0xb1');logger[_0xe445('0x1c')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x173fd0,_0x45b064,'entity\x20found');logger['debug'](_0xe445('0xb2'),_0x173fd0,_0x45b064,'entity\x20found',JSON['stringify'](_0xd02359));if(_0x2a8fa9[_0xe445('0x70')]['type']===_0xe445('0x7d')){return _0x28faef[_0xe445('0x27')](_0x45b064)[_0xe445('0x2e')](_0xe445('0xb3'),_0xe445('0xb4'))[_0xe445('0xb5')]('\x0a');}else{return _0x28faef[_0xe445('0x27')](_0x45b064)['json'](_0xd02359);}}})[_0xe445('0x25')](handleError(_0x28faef,null));};exports[_0xe445('0xb6')]=function(_0xfdd699,_0x33a1d9){var _0x318a0d=_0xfdd699[_0xe445('0x55')]['id'];var _0x57b7eb=_0xfdd699['body'];var _0x56205e=0xc8;var _0x295c64=null;return db[_0xe445('0xb7')][_0xe445('0xb8')]({'isolationLevel':db['sequelize'][_0xe445('0xb9')][_0xe445('0xba')][_0xe445('0xbb')]},function(_0x23eb1f){return db[_0xe445('0x3a')][_0xe445('0x6b')]({'where':{'id':_0x318a0d},'transaction':_0x23eb1f})['then'](function(_0x42c730){if(_0x42c730){return db[_0xe445('0x6f')][_0xe445('0x33')]({'where':{'SmsAccountId':_0x318a0d},'transaction':_0x23eb1f})[_0xe445('0x1b')](function(){var _0x4a26af=_['map'](_0x57b7eb,function(_0x3b74c4){_0x3b74c4[_0xe445('0x68')]=_0x318a0d;return _0x3b74c4;});return db[_0xe445('0x6f')]['bulkCreate'](_0x4a26af,{'transaction':_0x23eb1f});});}else{_0x56205e=0x194;_0x295c64=[];}});})[_0xe445('0x1b')](function(){if(_0x56205e!==0x194){return db[_0xe445('0x6f')][_0xe445('0xbc')]({'where':{'SmsAccountId':_0x318a0d},'order':_0xe445('0xbd')})[_0xe445('0x1b')](function(_0x2b28bb){_0x295c64=_0x2b28bb;});}})[_0xe445('0x25')](function(_0x3a0f4f){_0x56205e=0x1f4;logger['error'](_0x3a0f4f[_0xe445('0x36')]);if(_0x3a0f4f[_0xe445('0x37')]){delete _0x3a0f4f[_0xe445('0x37')];}_0x295c64=_0x3a0f4f;})['finally'](function(){if(_0x295c64===null){_0x33a1d9['sendStatus'](_0x56205e);}else{if(_0x56205e===0x1f4){_0x33a1d9[_0xe445('0x27')](_0x56205e)['send'](_0x295c64);}else{_0x33a1d9[_0xe445('0x27')](_0x56205e)[_0xe445('0x29')](_0x295c64);}}});};exports['getApplications']=function(_0x372c65,_0x3a57e1,_0x5cbd3d){var _0x18bae0={};var _0x5c5bbf={};var _0x375ea8;var _0x28953a;return db[_0xe445('0x3a')][_0xe445('0x6b')]({'where':{'id':_0x372c65[_0xe445('0x55')]['id']}})[_0xe445('0x1b')](handleEntityNotFound(_0x3a57e1,null))['then'](function(_0xd0cbea){if(_0xd0cbea){_0x375ea8=_0xd0cbea;_0x5c5bbf[_0xe445('0x3f')]=_['keys'](db[_0xe445('0x6f')][_0xe445('0x3b')]);_0x5c5bbf[_0xe445('0x40')]=_[_0xe445('0x41')](_0x372c65[_0xe445('0x40')]);_0x5c5bbf['filters']=_[_0xe445('0x43')](_0x5c5bbf['model'],_0x5c5bbf[_0xe445('0x40')]);_0x18bae0['attributes']=_[_0xe445('0x43')](_0x5c5bbf[_0xe445('0x3f')],qs[_0xe445('0x45')](_0x372c65[_0xe445('0x40')][_0xe445('0x45')]));_0x18bae0[_0xe445('0x44')]=_0x18bae0['attributes'][_0xe445('0x46')]?_0x18bae0[_0xe445('0x44')]:_0x5c5bbf['model'];_0x18bae0[_0xe445('0x49')]=qs[_0xe445('0x4a')](_0x372c65[_0xe445('0x40')][_0xe445('0x4a')]);_0x18bae0['where']=qs[_0xe445('0x42')](_['pick'](_0x372c65[_0xe445('0x40')],_0x5c5bbf[_0xe445('0x42')]));if(_0x372c65['query'][_0xe445('0x4d')]){_0x18bae0[_0xe445('0x4b')]=_['merge'](_0x18bae0[_0xe445('0x4b')],{'$or':_[_0xe445('0x39')](_0x18bae0[_0xe445('0x44')],function(_0x53cafa){var _0x137984={};_0x137984[_0x53cafa]={'$like':'%'+_0x372c65[_0xe445('0x40')][_0xe445('0x4d')]+'%'};return _0x137984;})});}_0x18bae0=_['merge']({},_0x18bae0,_0x372c65['options']);return _0x375ea8['getApplications'](_0x18bae0);}})[_0xe445('0x1b')](function(_0x45ae16){if(_0x45ae16){_0x28953a=_0x45ae16[_0xe445('0x46')];if(!_0x372c65['query'][_0xe445('0x47')]('nolimit')){_0x18bae0[_0xe445('0x2b')]=qs[_0xe445('0x2b')](_0x372c65[_0xe445('0x40')][_0xe445('0x2b')]);_0x18bae0[_0xe445('0x2a')]=qs[_0xe445('0x2a')](_0x372c65[_0xe445('0x40')][_0xe445('0x2a')]);}return _0x375ea8['getApplications'](_0x18bae0);}})[_0xe445('0x1b')](function(_0x5d09d){if(_0x5d09d){return _0x5d09d?{'count':_0x28953a,'rows':_0x5d09d}:null;}})[_0xe445('0x1b')](respondWithResult(_0x3a57e1,null))[_0xe445('0x25')](handleError(_0x3a57e1,null));};exports[_0xe445('0xbe')]=function(_0xfa2a09,_0x2f21ec,_0x36db8a){var _0x1804bb={'raw':![],'where':{}};var _0x371635={};var _0x3ce806={'count':0x0,'rows':[]};return db[_0xe445('0x3a')][_0xe445('0x6b')]({'where':{'id':_0xfa2a09[_0xe445('0x55')]['id']}})[_0xe445('0x1b')](handleEntityNotFound(_0x2f21ec,null))['then'](function(_0xcf7a9f){if(_0xcf7a9f){_0x371635['model']=_[_0xe445('0x41')](db[_0xe445('0x9e')][_0xe445('0x3b')]);_0x371635['query']=_[_0xe445('0x41')](_0xfa2a09[_0xe445('0x40')]);_0x371635[_0xe445('0x42')]=_[_0xe445('0x43')](_0x371635[_0xe445('0x3f')],_0x371635[_0xe445('0x40')]);_0x1804bb['attributes']=_[_0xe445('0x43')](_0x371635[_0xe445('0x3f')],qs['fields'](_0xfa2a09[_0xe445('0x40')][_0xe445('0x45')]));_0x1804bb[_0xe445('0x44')]=_0x1804bb[_0xe445('0x44')][_0xe445('0x46')]?_0x1804bb[_0xe445('0x44')]:_0x371635[_0xe445('0x3f')];if(!_0xfa2a09[_0xe445('0x40')]['hasOwnProperty'](_0xe445('0x48'))){_0x1804bb['limit']=qs['limit'](_0xfa2a09[_0xe445('0x40')][_0xe445('0x2b')]);_0x1804bb['offset']=qs[_0xe445('0x2a')](_0xfa2a09[_0xe445('0x40')][_0xe445('0x2a')]);}_0x1804bb[_0xe445('0x49')]=qs[_0xe445('0x4a')](_0xfa2a09[_0xe445('0x40')][_0xe445('0x4a')]);_0x1804bb['where']=qs[_0xe445('0x42')](_[_0xe445('0x4c')](_0xfa2a09[_0xe445('0x40')],_0x371635[_0xe445('0x42')]));_0x1804bb[_0xe445('0x4b')]['SmsAccountId']=_0xcf7a9f['id'];if(_0xfa2a09[_0xe445('0x40')]['filter']){_0x1804bb[_0xe445('0x4b')]=_['merge'](_0x1804bb[_0xe445('0x4b')],{'$or':_[_0xe445('0x39')](_0x1804bb[_0xe445('0x44')],function(_0x4be71f){var _0x386ead={};_0x386ead[_0x4be71f]={'$like':'%'+_0xfa2a09[_0xe445('0x40')]['filter']+'%'};return _0x386ead;})});}_0x1804bb=_[_0xe445('0x4e')]({},_0x1804bb,_0xfa2a09[_0xe445('0x50')]);return db['SmsInteraction'][_0xe445('0x2d')]({'where':_0x1804bb[_0xe445('0x4b')]})[_0xe445('0x1b')](function(_0x50dbae){_0x3ce806[_0xe445('0x2d')]=_0x50dbae;if(_0xfa2a09['query']['includeAll']){_0x1804bb[_0xe445('0x52')]=[{'model':db[_0xe445('0x75')],'as':_0xe445('0xbf'),'required':![]},{'model':db[_0xe445('0xa8')],'as':_0xe445('0xc0'),'attributes':[_0xe445('0x37'),_0xe445('0xc1'),_0xe445('0xc2')],'required':![]},{'model':db[_0xe445('0xc3')],'as':_0xe445('0xc4'),'attributes':['id',_0xe445('0x37'),'color'],'where':_0xfa2a09[_0xe445('0x40')][_0xe445('0xc5')]?{'id':_0xfa2a09[_0xe445('0x40')][_0xe445('0xc5')]}:undefined,'required':_0xfa2a09['query'][_0xe445('0xc5')]?!![]:![]}];}return db[_0xe445('0x9e')][_0xe445('0x6c')](_0x1804bb);})[_0xe445('0x1b')](function(_0x571608){_0x3ce806[_0xe445('0x53')]=_0x571608;return _0x3ce806;});}})['then'](respondWithFilteredResult(_0x2f21ec,_0x1804bb))['catch'](handleError(_0x2f21ec,null));};exports[_0xe445('0xb5')]=function(_0x3caf69,_0x16d293,_0x31245c){var _0x317168,_0x42ad0b,_0x251bc8;if(_[_0xe445('0x8f')](_0x3caf69['body'][_0xe445('0x61')])||_0x3caf69[_0xe445('0x61')][_0xe445('0x61')]===''){throw new db[(_0xe445('0x94'))][(_0xe445('0x76'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xe445('0x8f')](_0x3caf69[_0xe445('0x61')]['to'])){throw new db[(_0xe445('0x94'))][(_0xe445('0x76'))](_0xe445('0xc6'));}_0x317168=_0x3caf69[_0xe445('0x61')]['to'];return db['SmsAccount']['find']({'where':{'id':_0x3caf69['params']['id']},'include':[{'model':db[_0xe445('0x96')],'as':_0xe445('0xc7'),'include':[{'model':db['CmContact'],'as':_0xe445('0x98'),'where':{'mobile':_0x317168},'limit':0x1,'order':[[_0xe445('0x7a'),'DESC']]}]}]})[_0xe445('0x1b')](handleEntityNotFound(_0x16d293,null))['then'](function(_0x3fcad6){if(_0x3fcad6&&_0x3fcad6[_0xe445('0xc7')]){_0x42ad0b=_0x3fcad6['get']({'plain':!![]});if(_0x42ad0b['List']&&_0x42ad0b[_0xe445('0xc7')]['Contacts'][_0xe445('0x46')]){return _0x42ad0b[_0xe445('0xc7')]['Contacts'][0x0];}return db[_0xe445('0x75')][_0xe445('0x58')](_[_0xe445('0x9c')](_0x3caf69[_0xe445('0x61')],{'firstName':_0x317168,'mobile':_0x317168,'phone':_0x317168,'ListId':_0x42ad0b[_0xe445('0x97')]}));}})[_0xe445('0x1b')](handleEntityNotFound(_0x16d293,null))[_0xe445('0x1b')](function(_0x48fc79){if(_0x48fc79){_0x251bc8=_0x48fc79;return db['SmsInteraction'][_0xe445('0x57')]({'where':{'ContactId':_0x251bc8['id'],'closed':![],'SmsAccountId':_0x42ad0b['id']}})[_0xe445('0x1b')](function(_0x465022){if(_0x465022){return[_0x465022,![]];}return db[_0xe445('0x9e')][_0xe445('0x58')]({'UserId':_0x3caf69[_0xe445('0x5b')]['id'],'ContactId':_0x251bc8['id'],'SmsAccountId':_0x42ad0b['id'],'phone':_0x317168,'firstMsgDirection':_0xe445('0xc8'),'Messages':[_[_0xe445('0x4e')](_0x3caf69[_0xe445('0x61')],{'read':![],'body':_0x3caf69[_0xe445('0x61')][_0xe445('0x61')],'phone':_0x317168,'SmsAccountId':_0x42ad0b['id'],'UserId':_0x3caf69[_0xe445('0x5b')]['id'],'ContactId':_0x251bc8['id']})]},{'include':[{'model':db['SmsMessage'],'as':'Messages'}]})[_0xe445('0x1b')](function(_0x40f3a7){return[_0x40f3a7,!![]];});});}})[_0xe445('0x9f')](function(_0x312e99,_0x14da86){if(_0x14da86){return _0x312e99;}return db[_0xe445('0xa5')][_0xe445('0x58')](_[_0xe445('0x4e')](_0x3caf69[_0xe445('0x61')],{'read':![],'body':_0x3caf69[_0xe445('0x61')][_0xe445('0x61')],'phone':_0x317168,'SmsAccountId':_0x42ad0b['id'],'SmsInteractionId':_0x312e99['id'],'UserId':_0x3caf69[_0xe445('0x5b')]['id'],'ContactId':_0x251bc8['id']}))['then'](function(_0x21c0c8){_0x312e99[_0xe445('0xc9')][_0xe445('0xca')]=[];_0x312e99[_0xe445('0xc9')]['Messages']['push'](_0x21c0c8[_0xe445('0xc9')]);return _0x312e99;});})[_0xe445('0x1b')](respondWithResult(_0x16d293,null))[_0xe445('0x25')](handleError(_0x16d293,null));};exports['status']=function(_0x323479,_0x5091bf,_0x58d969){if(_0x323479[_0xe445('0x61')]['id']){delete _0x323479[_0xe445('0x61')]['id'];}var _0x166785,_0x50d72f,_0x373ad9;return db[_0xe445('0x3a')][_0xe445('0x57')]({'where':{'id':_0x323479[_0xe445('0x55')]['id']}})[_0xe445('0x1b')](handleEntityNotFound(_0x5091bf,null))[_0xe445('0x1b')](function(_0x1bc237){if(_0x1bc237){_0x373ad9=_0x1bc237;logger[_0xe445('0xcb')](_0xe445('0x1e'),_0xe445('0x27'),_0xe445('0xcc'),_0x1bc237[_0xe445('0x3d')],util['inspect'](_0x323479[_0xe445('0x61')],{'showHidden':![],'depth':null}));switch(_0x1bc237[_0xe445('0x3d')]){case'skebby':if(_0x323479[_0xe445('0x61')][_0xe445('0xcd')]&&_0x323479[_0xe445('0x61')][_0xe445('0x27')]){_0x50d72f=_0x323479[_0xe445('0x61')]['status'];return db[_0xe445('0xa5')][_0xe445('0x57')]({'where':{'messageId':_0x323479['body'][_0xe445('0xcd')]}});}break;case _0xe445('0xce'):if(_0x323479[_0xe445('0x61')][_0xe445('0xcf')]&&_0x323479[_0xe445('0x61')][_0xe445('0xd0')]){_0x50d72f=_0x323479[_0xe445('0x61')][_0xe445('0xd0')];return db[_0xe445('0xa5')][_0xe445('0x57')]({'where':{'messageId':_0x323479['body'][_0xe445('0xcf')]}});}break;case'clicksend':if(_0x323479['body'][_0xe445('0x84')]&&_0x323479[_0xe445('0x61')][_0xe445('0xd1')]){_0x50d72f=_0x323479[_0xe445('0x61')][_0xe445('0xd1')];return db[_0xe445('0xa5')][_0xe445('0x57')]({'where':{'messageId':_0x323479[_0xe445('0x61')][_0xe445('0x84')]}});}break;case _0xe445('0x87'):var _0x4d2685=_0x323479['body'][_0xe445('0x88')][0x0];if(_0x4d2685[_0xe445('0x80')]&&_0x4d2685['status'][_0xe445('0xd2')]===_0xe445('0xd3')){_0x50d72f=_0x4d2685[_0xe445('0x27')][_0xe445('0xd2')];return db['SmsMessage']['find']({'where':{'messageId':_0x4d2685['messageId']}});}break;case _0xe445('0x8c'):if(_0x323479[_0xe445('0x61')]['messageId']&&_0x323479[_0xe445('0x61')][_0xe445('0x27')]){_0x50d72f=_0x323479[_0xe445('0x61')][_0xe445('0x27')];return db[_0xe445('0xa5')][_0xe445('0x57')]({'where':{'messageId':_0x323479[_0xe445('0x61')][_0xe445('0x80')]}});}break;case _0xe445('0xd4'):if(_0x323479['body'][0x0][_0xe445('0x23')]['id']){_0x50d72f=_0x323479[_0xe445('0x61')][0x0][_0xe445('0x3d')];return db[_0xe445('0xa5')]['find']({'where':{'messageId':_0x323479[_0xe445('0x61')][0x0]['message']['id']}});}break;case _0xe445('0xd5'):if(_0x323479[_0xe445('0x61')][_0xe445('0xd6')]&&_0x323479['body'][_0xe445('0x27')]){_0x50d72f=_0x323479[_0xe445('0x61')][_0xe445('0x27')];return db['SmsMessage'][_0xe445('0x57')]({'where':{'messageId':_0x323479[_0xe445('0x61')][_0xe445('0xd6')]}});}break;}}})[_0xe445('0x1b')](handleEntityNotFound(_0x5091bf,null))[_0xe445('0x1b')](function(_0x4051b2){if(_0x4051b2){_0x166785=_0x4051b2;switch(_0x373ad9[_0xe445('0x3d')]){case'skebby':if(_0x50d72f===_0xe445('0xd3')){return _0x166785[_0xe445('0x32')]({'read':!![]});}else{logger[_0xe445('0x21')](_0xe445('0x1e'),'status',_0xe445('0xd7'),util['inspect'](_0x323479[_0xe445('0x61')],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x50d72f==='1'){return _0x166785[_0xe445('0x32')]({'read':!![]});}else{logger[_0xe445('0x21')](_0xe445('0x1e'),_0xe445('0x27'),_0xe445('0xd7'),util['inspect'](_0x323479[_0xe445('0x61')],{'showHidden':![],'depth':null}));}break;case _0xe445('0xd8'):if(!_0x323479[_0xe445('0x61')][_0xe445('0xd9')]&&_0x50d72f>=0xc8&&_0x50d72f<=0xce){return _0x166785['update']({'read':!![]});}else{logger[_0xe445('0x21')](_0xe445('0x1e'),_0xe445('0x27'),_0xe445('0xd8'),util[_0xe445('0xda')](_0x323479[_0xe445('0x61')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x475d10=_0x323479[_0xe445('0x61')]['results'][0x0];if(_0x475d10['status'][_0xe445('0xd2')]===_0xe445('0xd3')){return _0x166785[_0xe445('0x32')]({'read':!![]});}else{logger[_0xe445('0x21')](_0xe445('0x1e'),_0xe445('0x27'),_0xe445('0x87'),util['inspect'](_0x323479['body'],{'showHidden':![],'depth':null}));}break;case _0xe445('0x8c'):if(_0x50d72f==_0xe445('0xdb')||_0x50d72f==_0xe445('0xdc')){return _0x166785[_0xe445('0x32')]({'read':!![]});}else{logger[_0xe445('0x21')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xe445('0x8c'),util[_0xe445('0xda')](_0x323479[_0xe445('0x61')],{'showHidden':![],'depth':null}));}break;case _0xe445('0xd4'):if(_0x50d72f==_0xe445('0xdd')){return _0x166785[_0xe445('0x32')]({'read':!![]});}else{logger[_0xe445('0x21')](_0xe445('0x1e'),'status',_0xe445('0xd4'),util[_0xe445('0xda')](_0x323479[_0xe445('0x61')],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x50d72f===_0xe445('0xde')||_0x50d72f===_0xe445('0xdf')){return _0x166785['update']({'read':!![]});}else{logger[_0xe445('0x21')](_0xe445('0x1e'),_0xe445('0x27'),_0xe445('0xd5'),util[_0xe445('0xda')](_0x323479[_0xe445('0x61')],{'showHidden':![],'depth':null}));}break;}return _0x166785;}})['then'](respondWithResult(_0x5091bf,null))[_0xe445('0x25')](handleError(_0x5091bf,null));};exports[_0xe445('0xe0')]=function(_0x23e4ea,_0xc63612,_0x2f8109){var _0x451a89,_0xda2913,_0x6ede51;return db[_0xe445('0x3a')]['find']({'where':{'id':_0x23e4ea[_0xe445('0x55')]['id']}})[_0xe445('0x1b')](handleEntityNotFound(_0xc63612,null))['then'](function(_0x251da9){if(_0x251da9){_0x6ede51=_0x251da9;logger[_0xe445('0xcb')](_0xe445('0x1e'),_0xe445('0x27'),'received\x20delivery\x20report\x20from',_0x251da9[_0xe445('0x3d')],util[_0xe445('0xda')](_0x23e4ea[_0xe445('0x40')],{'showHidden':![],'depth':null}));switch(_0x251da9[_0xe445('0x3d')]){case _0xe445('0x89'):if(_0x23e4ea[_0xe445('0x40')][_0xe445('0xe1')]&&_0x23e4ea[_0xe445('0x40')][_0xe445('0xe2')]){_0xda2913=_0x23e4ea['query']['state'];return db[_0xe445('0xa5')][_0xe445('0x57')]({'where':{'messageId':_0x23e4ea[_0xe445('0x40')][_0xe445('0xe1')]}});}break;}}})['then'](handleEntityNotFound(_0xc63612,null))[_0xe445('0x1b')](function(_0x258083){if(_0x258083){_0x451a89=_0x258083;switch(_0x6ede51[_0xe445('0x3d')]){case _0xe445('0x89'):if(_0xda2913==='2'||_0xda2913==='6'){return _0x451a89['update']({'read':!![]});}else{logger[_0xe445('0x21')](_0xe445('0x1e'),_0xe445('0x27'),_0xe445('0x89'),util['inspect'](_0x23e4ea[_0xe445('0x40')],{'showHidden':![],'depth':null}));};break;}return _0x451a89;}})['then'](respondWithResult(_0xc63612,null))[_0xe445('0x25')](handleError(_0xc63612,null));};exports[_0xe445('0xe3')]=function(_0xfed3a7,_0x278065,_0x5065d4){return db['SmsAccount'][_0xe445('0x57')]({'where':{'id':_0xfed3a7[_0xe445('0x55')]['id']}})['then'](handleEntityNotFound(_0x278065,null))['then'](function(_0x1b6ed4){if(_0x1b6ed4){return _0x1b6ed4['addAgents'](_0xfed3a7[_0xe445('0x61')][_0xe445('0x66')],_[_0xe445('0x9b')](_0xfed3a7[_0xe445('0x61')],['ids','id'])||{})[_0xe445('0x9f')](function(_0x38b0cc){for(var _0x5bd9d0=0x0;_0x5bd9d0<_0xfed3a7['body'][_0xe445('0x66')][_0xe445('0x46')];_0x5bd9d0+=0x1){socket[_0xe445('0xe4')]('userSmsAccount:save',{'UserId':Number(_0xfed3a7[_0xe445('0x61')]['ids'][_0x5bd9d0]),'SmsAccountId':Number(_0xfed3a7[_0xe445('0x55')]['id'])});}return _0x38b0cc;});}})[_0xe445('0x1b')](respondWithResult(_0x278065,null))[_0xe445('0x25')](handleError(_0x278065,null));};exports[_0xe445('0xe5')]=function(_0x34658c,_0x4d199b,_0x1e985d){return db[_0xe445('0x3a')][_0xe445('0x57')]({'where':{'id':_0x34658c[_0xe445('0x55')]['id']}})['then'](handleEntityNotFound(_0x4d199b,null))[_0xe445('0x1b')](function(_0x58a617){if(_0x58a617){return _0x58a617[_0xe445('0xe5')](_0x34658c[_0xe445('0x40')][_0xe445('0x66')])['then'](function(){if(_[_0xe445('0xe6')](_0x34658c[_0xe445('0x40')][_0xe445('0x66')])){for(var _0x1fcac1=0x0;_0x1fcac1<_0x34658c[_0xe445('0x40')]['ids'][_0xe445('0x46')];_0x1fcac1+=0x1){socket[_0xe445('0xe4')](_0xe445('0xe7'),{'UserId':Number(_0x34658c[_0xe445('0x40')][_0xe445('0x66')][_0x1fcac1]),'SmsAccountId':Number(_0x34658c[_0xe445('0x55')]['id'])});}}else{socket['emit'](_0xe445('0xe7'),{'UserId':Number(_0x34658c[_0xe445('0x40')][_0xe445('0x66')]),'SmsAccountId':Number(_0x34658c[_0xe445('0x55')]['id'])});}});}})[_0xe445('0x1b')](respondWithStatusCode(_0x4d199b,null))[_0xe445('0x25')](handleError(_0x4d199b,null));};exports[_0xe445('0xe8')]=function(_0x161b61,_0x3cb481,_0x20fb2f){var _0x127ba4={};var _0x372d63={};var _0x412357;var _0x2abdd7;return db[_0xe445('0x3a')][_0xe445('0x6b')]({'where':{'id':_0x161b61[_0xe445('0x55')]['id']}})[_0xe445('0x1b')](handleEntityNotFound(_0x3cb481,null))[_0xe445('0x1b')](function(_0x9a5109){if(_0x9a5109){_0x412357=_0x9a5109;_0x372d63[_0xe445('0x3f')]=_[_0xe445('0x41')](db[_0xe445('0xa8')][_0xe445('0x3b')]);_0x372d63[_0xe445('0x40')]=_[_0xe445('0x41')](_0x161b61['query']);_0x372d63[_0xe445('0x42')]=_[_0xe445('0x43')](_0x372d63[_0xe445('0x3f')],_0x372d63['query']);_0x127ba4['attributes']=_[_0xe445('0x43')](_0x372d63[_0xe445('0x3f')],qs[_0xe445('0x45')](_0x161b61[_0xe445('0x40')][_0xe445('0x45')]));_0x127ba4['attributes']=_0x127ba4[_0xe445('0x44')]['length']?_0x127ba4[_0xe445('0x44')]:_0x372d63[_0xe445('0x3f')];_0x127ba4[_0xe445('0x49')]=qs[_0xe445('0x4a')](_0x161b61['query'][_0xe445('0x4a')]);_0x127ba4[_0xe445('0x4b')]=qs['filters'](_['pick'](_0x161b61[_0xe445('0x40')],_0x372d63[_0xe445('0x42')]));if(_0x161b61['query'][_0xe445('0x4d')]){_0x127ba4[_0xe445('0x4b')]=_[_0xe445('0x4e')](_0x127ba4[_0xe445('0x4b')],{'$or':_[_0xe445('0x39')](_0x127ba4[_0xe445('0x44')],function(_0x8d47e7){var _0x10b411={};_0x10b411[_0x8d47e7]={'$like':'%'+_0x161b61[_0xe445('0x40')]['filter']+'%'};return _0x10b411;})});}_0x127ba4=_['merge']({},_0x127ba4,_0x161b61['options']);return _0x412357[_0xe445('0xe8')](_0x127ba4);}})['then'](function(_0x3114b0){if(_0x3114b0){_0x2abdd7=_0x3114b0[_0xe445('0x46')];if(!_0x161b61[_0xe445('0x40')][_0xe445('0x47')](_0xe445('0x48'))){_0x127ba4[_0xe445('0x2b')]=qs[_0xe445('0x2b')](_0x161b61[_0xe445('0x40')][_0xe445('0x2b')]);_0x127ba4[_0xe445('0x2a')]=qs[_0xe445('0x2a')](_0x161b61[_0xe445('0x40')][_0xe445('0x2a')]);}return _0x412357[_0xe445('0xe8')](_0x127ba4);}})[_0xe445('0x1b')](function(_0x2bc961){if(_0x2bc961){return _0x2bc961?{'count':_0x2abdd7,'rows':_0x2bc961}:null;}})[_0xe445('0x1b')](respondWithResult(_0x3cb481,null))[_0xe445('0x25')](handleError(_0x3cb481,null));}; \ No newline at end of file +var _0xc410=['statusGet','message-id','state','addAgents','spread','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','http','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','destroy','get','SmsAccounts','UserProfileResource','stack','send','index','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','length','order','sort','where','pick','filter','merge','VIRTUAL','name','includeAll','include','findAll','rows','params','fields','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','hasOwnProperty','nolimit','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','SmsApplication','Applications','account','applications','priority','CmContact','ValidationError','no\x20available\x20attributes','createdAt','difference','updatedAt','CompanyId','ListId','mobile','twilio','from','Body','messageId','MessageSid','skebby','sender','text','clicksend','message_id','plivo','infobip','results','csc','segmentedMessage','clickatell','fromNumber','replyMessageId','intelepeer','isNil','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','CmList','Contacts','DESC','list','omit','contact','SmsInteraction','interaction','created','autoclose','push','close','ContactId','AttachmentId','UserId','User','unshift','*,*,*,*','queueId','SmsQueue','queue','waitForTheAssignedQueue','Start','startRouting','entity\x20found','debug','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','stringify','\x0a','addApplications','sequelize','Transaction','READ_COMMITTED','bulkCreate','findAndCountAll','getApplications','getInteractions','Owner','fullname','internal','Tag','Tags','tag','List','Messages','SmsMessage','dataValues','received\x20delivery\x20report\x20from','skebby_dispatch_id','requestid','statusInt','status_code','groupName','DELIVERED','bandwidth','redif','connectel','inspect','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','ACCEPTD'];(function(_0x2e078b,_0x65460c){var _0x12d915=function(_0x2cb2bd){while(--_0x2cb2bd){_0x2e078b['push'](_0x2e078b['shift']());}};_0x12d915(++_0x65460c);}(_0xc410,0x1d5));var _0x0c41=function(_0x335bb1,_0x5aa97e){_0x335bb1=_0x335bb1-0x0;var _0x4c2fc7=_0xc410[_0x335bb1];return _0x4c2fc7;};'use strict';var emlformat=require(_0x0c41('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0c41('0x1'));var jsonpatch=require(_0x0c41('0x2'));var rp=require(_0x0c41('0x3'));var moment=require(_0x0c41('0x4'));var BPromise=require(_0x0c41('0x5'));var Mustache=require(_0x0c41('0x6'));var util=require(_0x0c41('0x7'));var path=require(_0x0c41('0x8'));var sox=require('sox');var csv=require(_0x0c41('0x9'));var ejs=require(_0x0c41('0xa'));var fs=require('fs');var fs_extra=require(_0x0c41('0xb'));var _=require(_0x0c41('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0c41('0xd'));var toCsv=require('to-csv');var querystring=require(_0x0c41('0xe'));var Papa=require(_0x0c41('0xf'));var Redis=require(_0x0c41('0x10'));var authService=require(_0x0c41('0x11'));var qs=require(_0x0c41('0x12'));var as=require(_0x0c41('0x13'));var hardwareService=require(_0x0c41('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x0c41('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0c41('0x16'))['db'];config[_0x0c41('0x17')]=_[_0x0c41('0x18')](config[_0x0c41('0x17')],{'host':_0x0c41('0x19'),'port':0x18eb});var socket=require(_0x0c41('0x1a'))(new Redis(config[_0x0c41('0x17')]));require(_0x0c41('0x1b'))[_0x0c41('0x1c')](socket);var jayson=require(_0x0c41('0x1d'));var client=jayson[_0x0c41('0x1e')][_0x0c41('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x51f458,_0x6bbd7a,_0xa8bd1f,_0x191352){return new BPromise(function(_0x266f9c,_0x371379){var _0x2e456a=_0x191352||client;return _0x2e456a[_0x0c41('0x20')](_0x51f458,_0xa8bd1f)[_0x0c41('0x21')](function(_0x342cc9){logger[_0x0c41('0x22')](_0x0c41('0x23'),_0x6bbd7a,_0x0c41('0x24'));logger['debug'](_0x0c41('0x25'),_0x6bbd7a,'request\x20sent',JSON['stringify'](_0x342cc9));if(_0x342cc9[_0x0c41('0x26')]){if(_0x342cc9[_0x0c41('0x26')][_0x0c41('0x27')]===0x1f4){logger[_0x0c41('0x26')](_0x0c41('0x23'),_0x6bbd7a,_0x342cc9[_0x0c41('0x26')]['message']);return _0x371379(_0x342cc9[_0x0c41('0x26')][_0x0c41('0x28')]);}logger[_0x0c41('0x26')](_0x0c41('0x23'),_0x6bbd7a,_0x342cc9[_0x0c41('0x26')]['message']);return _0x266f9c(_0x342cc9['error'][_0x0c41('0x28')]);}else{logger[_0x0c41('0x22')](_0x0c41('0x23'),_0x6bbd7a,'request\x20sent');_0x266f9c(_0x342cc9[_0x0c41('0x29')][_0x0c41('0x28')]);}})[_0x0c41('0x2a')](function(_0x314d8d){logger[_0x0c41('0x26')]('SmsAccount,\x20%s,\x20%s',_0x6bbd7a,_0x314d8d);_0x371379(_0x314d8d);});});}function respondWithStatusCode(_0x59443b,_0x1d52b3){_0x1d52b3=_0x1d52b3||0xcc;return function(_0x132070){if(_0x132070){return _0x59443b[_0x0c41('0x2b')](_0x1d52b3);}return _0x59443b[_0x0c41('0x2c')](_0x1d52b3)[_0x0c41('0x2d')]();};}function respondWithResult(_0x28c585,_0x347274){_0x347274=_0x347274||0xc8;return function(_0xda51c5){if(_0xda51c5){return _0x28c585[_0x0c41('0x2c')](_0x347274)[_0x0c41('0x2e')](_0xda51c5);}};}function respondWithFilteredResult(_0x2c891a,_0x1e5167){return function(_0x421568){if(_0x421568){var _0x393ea7=typeof _0x1e5167[_0x0c41('0x2f')]==='undefined'&&typeof _0x1e5167[_0x0c41('0x30')]===_0x0c41('0x31');var _0x22041d=_0x421568[_0x0c41('0x32')];var _0x945b07=_0x393ea7?0x0:_0x1e5167[_0x0c41('0x2f')];var _0x1153e1=_0x393ea7?_0x421568[_0x0c41('0x32')]:_0x1e5167['offset']+_0x1e5167[_0x0c41('0x30')];var _0x50f692;if(_0x1153e1>=_0x22041d){_0x1153e1=_0x22041d;_0x50f692=0xc8;}else{_0x50f692=0xce;}_0x2c891a[_0x0c41('0x2c')](_0x50f692);return _0x2c891a['set'](_0x0c41('0x33'),_0x945b07+'-'+_0x1153e1+'/'+_0x22041d)[_0x0c41('0x2e')](_0x421568);}return null;};}function patchUpdates(_0x23ecbf){return function(_0x5a0c5f){try{jsonpatch[_0x0c41('0x34')](_0x5a0c5f,_0x23ecbf,!![]);}catch(_0x435fde){return BPromise[_0x0c41('0x35')](_0x435fde);}return _0x5a0c5f[_0x0c41('0x36')]();};}function saveUpdates(_0x2888d4,_0x900d37){return function(_0x2c633c){if(_0x2c633c){return _0x2c633c[_0x0c41('0x37')](_0x2888d4)[_0x0c41('0x21')](function(_0x5d8560){return _0x5d8560;});}return null;};}function removeEntity(_0x5a42c2,_0x37dbac){return function(_0x174fc8){if(_0x174fc8){return _0x174fc8[_0x0c41('0x38')]()[_0x0c41('0x21')](function(){var _0x585d10=_0x174fc8[_0x0c41('0x39')]({'plain':!![]});var _0x19209b=_0x0c41('0x3a');return db[_0x0c41('0x3b')][_0x0c41('0x38')]({'where':{'type':_0x19209b,'resourceId':_0x585d10['id']}})[_0x0c41('0x21')](function(){return _0x174fc8;});})[_0x0c41('0x21')](function(){_0x5a42c2[_0x0c41('0x2c')](0xcc)[_0x0c41('0x2d')]();});}};}function handleEntityNotFound(_0x1bcaa5,_0x4f05df){return function(_0x4b9e4f){if(!_0x4b9e4f){_0x1bcaa5[_0x0c41('0x2b')](0x194);}return _0x4b9e4f;};}function handleError(_0x4970f2,_0x454cf6){_0x454cf6=_0x454cf6||0x1f4;return function(_0x32d15c){logger[_0x0c41('0x26')](_0x32d15c[_0x0c41('0x3c')]);if(_0x32d15c['name']){delete _0x32d15c['name'];}_0x4970f2[_0x0c41('0x2c')](_0x454cf6)[_0x0c41('0x3d')](_0x32d15c);};}exports[_0x0c41('0x3e')]=function(_0x4a0d73,_0x43805f){var _0x1fd4dc={'include':[{'model':db[_0x0c41('0x3f')],'as':_0x0c41('0x40')}]},_0x13462f={},_0x42e70e={'count':0x0,'rows':[]};var _0x5104bb=_[_0x0c41('0x41')](db[_0x0c41('0x42')][_0x0c41('0x43')],function(_0x23852e){return{'name':_0x23852e[_0x0c41('0x44')],'type':_0x23852e[_0x0c41('0x45')][_0x0c41('0x46')]};});_0x13462f[_0x0c41('0x47')]=_[_0x0c41('0x41')](_0x5104bb,'name');_0x13462f[_0x0c41('0x48')]=_[_0x0c41('0x49')](_0x4a0d73['query']);_0x13462f[_0x0c41('0x4a')]=_['intersection'](_0x13462f['model'],_0x13462f[_0x0c41('0x48')]);_0x1fd4dc[_0x0c41('0x4b')]=_[_0x0c41('0x4c')](_0x13462f[_0x0c41('0x47')],qs['fields'](_0x4a0d73[_0x0c41('0x48')]['fields']));_0x1fd4dc[_0x0c41('0x4b')]=_0x1fd4dc[_0x0c41('0x4b')][_0x0c41('0x4d')]?_0x1fd4dc[_0x0c41('0x4b')]:_0x13462f['model'];if(!_0x4a0d73[_0x0c41('0x48')]['hasOwnProperty']('nolimit')){_0x1fd4dc['limit']=qs[_0x0c41('0x30')](_0x4a0d73['query'][_0x0c41('0x30')]);_0x1fd4dc[_0x0c41('0x2f')]=qs[_0x0c41('0x2f')](_0x4a0d73[_0x0c41('0x48')]['offset']);}_0x1fd4dc[_0x0c41('0x4e')]=qs['sort'](_0x4a0d73[_0x0c41('0x48')][_0x0c41('0x4f')]);_0x1fd4dc[_0x0c41('0x50')]=qs['filters'](_[_0x0c41('0x51')](_0x4a0d73[_0x0c41('0x48')],_0x13462f[_0x0c41('0x4a')]),_0x5104bb);if(_0x4a0d73[_0x0c41('0x48')][_0x0c41('0x52')]){_0x1fd4dc['where']=_[_0x0c41('0x53')](_0x1fd4dc[_0x0c41('0x50')],{'$or':_[_0x0c41('0x41')](_0x5104bb,function(_0xdf5f4a){if(_0xdf5f4a[_0x0c41('0x45')]!==_0x0c41('0x54')){var _0x54287d={};_0x54287d[_0xdf5f4a[_0x0c41('0x55')]]={'$like':'%'+_0x4a0d73['query'][_0x0c41('0x52')]+'%'};return _0x54287d;}})});}_0x1fd4dc=_[_0x0c41('0x53')]({},_0x1fd4dc,_0x4a0d73['options']);var _0x60ea99={'where':_0x1fd4dc[_0x0c41('0x50')]};return db[_0x0c41('0x42')]['count'](_0x60ea99)[_0x0c41('0x21')](function(_0x387587){_0x42e70e['count']=_0x387587;if(_0x4a0d73['query'][_0x0c41('0x56')]){_0x1fd4dc[_0x0c41('0x57')]=[{'all':!![]}];}return db[_0x0c41('0x42')][_0x0c41('0x58')](_0x1fd4dc);})[_0x0c41('0x21')](function(_0x3a8eb3){_0x42e70e[_0x0c41('0x59')]=_0x3a8eb3;return _0x42e70e;})[_0x0c41('0x21')](respondWithFilteredResult(_0x43805f,_0x1fd4dc))['catch'](handleError(_0x43805f,null));};exports['show']=function(_0x226319,_0xa7511f){var _0x6fc0d3={'raw':![],'where':{'id':_0x226319[_0x0c41('0x5a')]['id']},'include':[{'model':db['Pause'],'as':_0x0c41('0x40')}]},_0x4e0f1f={};_0x4e0f1f['model']=_[_0x0c41('0x49')](db[_0x0c41('0x42')]['rawAttributes']);_0x4e0f1f['query']=_['keys'](_0x226319['query']);_0x4e0f1f[_0x0c41('0x4a')]=_[_0x0c41('0x4c')](_0x4e0f1f[_0x0c41('0x47')],_0x4e0f1f[_0x0c41('0x48')]);_0x6fc0d3['attributes']=_[_0x0c41('0x4c')](_0x4e0f1f[_0x0c41('0x47')],qs[_0x0c41('0x5b')](_0x226319[_0x0c41('0x48')]['fields']));_0x6fc0d3[_0x0c41('0x4b')]=_0x6fc0d3[_0x0c41('0x4b')][_0x0c41('0x4d')]?_0x6fc0d3[_0x0c41('0x4b')]:_0x4e0f1f[_0x0c41('0x47')];if(_0x226319[_0x0c41('0x48')]['includeAll']){_0x6fc0d3[_0x0c41('0x57')]=[{'all':!![]}];}_0x6fc0d3=_[_0x0c41('0x53')]({},_0x6fc0d3,_0x226319[_0x0c41('0x5c')]);return db['SmsAccount'][_0x0c41('0x5d')](_0x6fc0d3)[_0x0c41('0x21')](handleEntityNotFound(_0xa7511f,null))['then'](respondWithResult(_0xa7511f,null))['catch'](handleError(_0xa7511f,null));};exports[_0x0c41('0x5e')]=function(_0x5e646c,_0x1d061e){return db[_0x0c41('0x42')][_0x0c41('0x5e')](_0x5e646c['body'],{})[_0x0c41('0x21')](function(_0xb852f8){var _0x518545=_0x5e646c[_0x0c41('0x5f')]['get']({'plain':!![]});if(!_0x518545)throw new Error(_0x0c41('0x60'));if(_0x518545['role']==='user'){var _0x5bd736=_0xb852f8[_0x0c41('0x39')]({'plain':!![]});var _0x1391bc=_0x0c41('0x3a');return db[_0x0c41('0x61')][_0x0c41('0x5d')]({'where':{'name':_0x1391bc,'userProfileId':_0x518545['userProfileId']},'raw':!![]})[_0x0c41('0x21')](function(_0x5f4bad){if(_0x5f4bad&&_0x5f4bad[_0x0c41('0x62')]===0x0){return db[_0x0c41('0x3b')][_0x0c41('0x5e')]({'name':_0x5bd736[_0x0c41('0x55')],'resourceId':_0x5bd736['id'],'type':_0x5f4bad[_0x0c41('0x55')],'sectionId':_0x5f4bad['id']},{})[_0x0c41('0x21')](function(){return _0xb852f8;});}else{return _0xb852f8;}})['catch'](function(_0x4a5a21){logger[_0x0c41('0x26')](_0x0c41('0x63'),_0x4a5a21);throw _0x4a5a21;});}return _0xb852f8;})[_0x0c41('0x21')](respondWithResult(_0x1d061e,0xc9))['catch'](handleError(_0x1d061e,null));};exports[_0x0c41('0x37')]=function(_0x2e8114,_0x267ee2){if(_0x2e8114[_0x0c41('0x64')]['id']){delete _0x2e8114[_0x0c41('0x64')]['id'];}return db[_0x0c41('0x42')][_0x0c41('0x5d')]({'where':{'id':_0x2e8114['params']['id']},'include':[{'model':db[_0x0c41('0x3f')],'as':_0x0c41('0x40')}]})[_0x0c41('0x21')](handleEntityNotFound(_0x267ee2,null))[_0x0c41('0x21')](saveUpdates(_0x2e8114[_0x0c41('0x64')],null))[_0x0c41('0x21')](respondWithResult(_0x267ee2,null))[_0x0c41('0x2a')](handleError(_0x267ee2,null));};exports[_0x0c41('0x38')]=function(_0x240472,_0x1e2611){return db[_0x0c41('0x42')][_0x0c41('0x5d')]({'where':{'id':_0x240472[_0x0c41('0x5a')]['id']}})[_0x0c41('0x21')](handleEntityNotFound(_0x1e2611,null))['then'](removeEntity(_0x1e2611,null))[_0x0c41('0x2a')](handleError(_0x1e2611,null));};exports[_0x0c41('0x65')]=function(_0x3e0ef2,_0x5ed77b){return db[_0x0c41('0x42')][_0x0c41('0x65')]()['then'](respondWithResult(_0x5ed77b,null))['catch'](handleError(_0x5ed77b,null));};exports[_0x0c41('0x66')]=function(_0x54b611,_0x3bfe68,_0x5ae367){if(_0x54b611[_0x0c41('0x64')]['id']){delete _0x54b611[_0x0c41('0x64')]['id'];}return db[_0x0c41('0x42')][_0x0c41('0x5d')]({'where':{'id':_0x54b611[_0x0c41('0x5a')]['id']}})[_0x0c41('0x21')](handleEntityNotFound(_0x3bfe68,null))[_0x0c41('0x21')](function(_0x31d2e7){if(_0x31d2e7){_0x54b611[_0x0c41('0x64')][_0x0c41('0x67')]=_0x31d2e7['id'];return db[_0x0c41('0x68')][_0x0c41('0x5e')](_0x54b611['body']);}})[_0x0c41('0x21')](respondWithResult(_0x3bfe68,null))['catch'](handleError(_0x3bfe68,null));};exports[_0x0c41('0x69')]=function(_0x4abca9,_0x10071e,_0x3ce91d){var _0x2145cd={'raw':![],'where':{}};var _0x1ac5a4={};var _0x23aac5={'count':0x0,'rows':[]};return db[_0x0c41('0x42')][_0x0c41('0x6a')]({'where':{'id':_0x4abca9[_0x0c41('0x5a')]['id']}})[_0x0c41('0x21')](handleEntityNotFound(_0x10071e,null))['then'](function(_0x5415b3){if(_0x5415b3){_0x1ac5a4[_0x0c41('0x47')]=_['keys'](db[_0x0c41('0x68')][_0x0c41('0x43')]);_0x1ac5a4['query']=_['keys'](_0x4abca9[_0x0c41('0x48')]);_0x1ac5a4['filters']=_[_0x0c41('0x4c')](_0x1ac5a4['model'],_0x1ac5a4[_0x0c41('0x48')]);_0x2145cd[_0x0c41('0x4b')]=_[_0x0c41('0x4c')](_0x1ac5a4[_0x0c41('0x47')],qs[_0x0c41('0x5b')](_0x4abca9[_0x0c41('0x48')][_0x0c41('0x5b')]));_0x2145cd[_0x0c41('0x4b')]=_0x2145cd[_0x0c41('0x4b')][_0x0c41('0x4d')]?_0x2145cd[_0x0c41('0x4b')]:_0x1ac5a4[_0x0c41('0x47')];if(!_0x4abca9['query'][_0x0c41('0x6b')](_0x0c41('0x6c'))){_0x2145cd[_0x0c41('0x30')]=qs['limit'](_0x4abca9[_0x0c41('0x48')][_0x0c41('0x30')]);_0x2145cd['offset']=qs['offset'](_0x4abca9[_0x0c41('0x48')]['offset']);}_0x2145cd['order']=qs[_0x0c41('0x4f')](_0x4abca9[_0x0c41('0x48')][_0x0c41('0x4f')]);_0x2145cd[_0x0c41('0x50')]=qs[_0x0c41('0x4a')](_[_0x0c41('0x51')](_0x4abca9[_0x0c41('0x48')],_0x1ac5a4[_0x0c41('0x4a')]));_0x2145cd['where']['SmsAccountId']=_0x5415b3['id'];if(_0x4abca9[_0x0c41('0x48')]['filter']){_0x2145cd[_0x0c41('0x50')]=_[_0x0c41('0x53')](_0x2145cd[_0x0c41('0x50')],{'$or':_['map'](_0x2145cd[_0x0c41('0x4b')],function(_0x452c87){var _0x35c907={};_0x35c907[_0x452c87]={'$like':'%'+_0x4abca9[_0x0c41('0x48')][_0x0c41('0x52')]+'%'};return _0x35c907;})});}_0x2145cd=_['merge']({},_0x2145cd,_0x4abca9[_0x0c41('0x5c')]);return db['Disposition'][_0x0c41('0x32')]({'where':_0x2145cd[_0x0c41('0x50')]})[_0x0c41('0x21')](function(_0x3bd1b4){_0x23aac5[_0x0c41('0x32')]=_0x3bd1b4;if(_0x4abca9[_0x0c41('0x48')][_0x0c41('0x56')]){_0x2145cd[_0x0c41('0x57')]=[{'all':!![]}];}return db[_0x0c41('0x68')][_0x0c41('0x58')](_0x2145cd);})['then'](function(_0x255b0f){_0x23aac5[_0x0c41('0x59')]=_0x255b0f;return _0x23aac5;});}})[_0x0c41('0x21')](respondWithFilteredResult(_0x10071e,_0x2145cd))['catch'](handleError(_0x10071e,null));};exports[_0x0c41('0x6d')]=function(_0x18fa30,_0x38e20b,_0x1287d5){return db[_0x0c41('0x42')][_0x0c41('0x5d')]({'where':{'id':_0x18fa30[_0x0c41('0x5a')]['id']}})[_0x0c41('0x21')](handleEntityNotFound(_0x38e20b,null))[_0x0c41('0x21')](function(_0xe61134){if(_0xe61134){return _0xe61134[_0x0c41('0x6d')](_0x18fa30['query'][_0x0c41('0x6e')]);}})[_0x0c41('0x21')](respondWithStatusCode(_0x38e20b,null))[_0x0c41('0x2a')](handleError(_0x38e20b,null));};exports[_0x0c41('0x6f')]=function(_0x4f0636,_0x22ad36,_0x43333a){if(_0x4f0636[_0x0c41('0x64')]['id']){delete _0x4f0636[_0x0c41('0x64')]['id'];}return db[_0x0c41('0x42')][_0x0c41('0x5d')]({'where':{'id':_0x4f0636[_0x0c41('0x5a')]['id']}})[_0x0c41('0x21')](handleEntityNotFound(_0x22ad36,null))['then'](function(_0x1004f2){if(_0x1004f2){_0x4f0636['body'][_0x0c41('0x67')]=_0x1004f2['id'];return db[_0x0c41('0x70')][_0x0c41('0x5e')](_0x4f0636['body']);}})['then'](respondWithResult(_0x22ad36,null))[_0x0c41('0x2a')](handleError(_0x22ad36,null));};exports[_0x0c41('0x71')]=function(_0x5d14b5,_0x5e51d7,_0x57d3a6){var _0x27d3d3={'raw':![],'where':{}};var _0x576a0b={};var _0x3a9361={'count':0x0,'rows':[]};return db[_0x0c41('0x42')][_0x0c41('0x6a')]({'where':{'id':_0x5d14b5[_0x0c41('0x5a')]['id']}})[_0x0c41('0x21')](handleEntityNotFound(_0x5e51d7,null))[_0x0c41('0x21')](function(_0x1c67aa){if(_0x1c67aa){_0x576a0b['model']=_[_0x0c41('0x49')](db[_0x0c41('0x70')]['rawAttributes']);_0x576a0b['query']=_[_0x0c41('0x49')](_0x5d14b5[_0x0c41('0x48')]);_0x576a0b[_0x0c41('0x4a')]=_[_0x0c41('0x4c')](_0x576a0b[_0x0c41('0x47')],_0x576a0b[_0x0c41('0x48')]);_0x27d3d3[_0x0c41('0x4b')]=_[_0x0c41('0x4c')](_0x576a0b[_0x0c41('0x47')],qs[_0x0c41('0x5b')](_0x5d14b5[_0x0c41('0x48')][_0x0c41('0x5b')]));_0x27d3d3['attributes']=_0x27d3d3['attributes'][_0x0c41('0x4d')]?_0x27d3d3[_0x0c41('0x4b')]:_0x576a0b['model'];if(!_0x5d14b5[_0x0c41('0x48')]['hasOwnProperty']('nolimit')){_0x27d3d3['limit']=qs[_0x0c41('0x30')](_0x5d14b5[_0x0c41('0x48')][_0x0c41('0x30')]);_0x27d3d3[_0x0c41('0x2f')]=qs[_0x0c41('0x2f')](_0x5d14b5['query'][_0x0c41('0x2f')]);}_0x27d3d3[_0x0c41('0x4e')]=qs[_0x0c41('0x4f')](_0x5d14b5[_0x0c41('0x48')][_0x0c41('0x4f')]);_0x27d3d3[_0x0c41('0x50')]=qs[_0x0c41('0x4a')](_[_0x0c41('0x51')](_0x5d14b5[_0x0c41('0x48')],_0x576a0b[_0x0c41('0x4a')]));_0x27d3d3[_0x0c41('0x50')][_0x0c41('0x67')]=_0x1c67aa['id'];if(_0x5d14b5[_0x0c41('0x48')]['filter']){_0x27d3d3[_0x0c41('0x50')]=_[_0x0c41('0x53')](_0x27d3d3['where'],{'$or':_[_0x0c41('0x41')](_0x27d3d3[_0x0c41('0x4b')],function(_0x5d1081){var _0x13142f={};_0x13142f[_0x5d1081]={'$like':'%'+_0x5d14b5[_0x0c41('0x48')][_0x0c41('0x52')]+'%'};return _0x13142f;})});}_0x27d3d3=_['merge']({},_0x27d3d3,_0x5d14b5[_0x0c41('0x5c')]);return db['CannedAnswer'][_0x0c41('0x32')]({'where':_0x27d3d3['where']})['then'](function(_0x1acfe3){_0x3a9361[_0x0c41('0x32')]=_0x1acfe3;if(_0x5d14b5[_0x0c41('0x48')][_0x0c41('0x56')]){_0x27d3d3['include']=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x27d3d3);})[_0x0c41('0x21')](function(_0x33f4fb){_0x3a9361[_0x0c41('0x59')]=_0x33f4fb;return _0x3a9361;});}})[_0x0c41('0x21')](respondWithFilteredResult(_0x5e51d7,_0x27d3d3))[_0x0c41('0x2a')](handleError(_0x5e51d7,null));};exports[_0x0c41('0x72')]=function(_0x4170a5,_0x36cd43,_0x2c49d1){return db[_0x0c41('0x42')][_0x0c41('0x5d')]({'where':{'id':_0x4170a5['params']['id']}})[_0x0c41('0x21')](handleEntityNotFound(_0x36cd43,null))['then'](function(_0x5214d5){if(_0x5214d5){return _0x5214d5[_0x0c41('0x72')](_0x4170a5[_0x0c41('0x48')][_0x0c41('0x6e')]);}})[_0x0c41('0x21')](respondWithStatusCode(_0x36cd43,null))[_0x0c41('0x2a')](handleError(_0x36cd43,null));};exports[_0x0c41('0x73')]=function(_0x1f557e,_0x496aad,_0x13b294){var _0x34ae3a={'channel':'sms'};var _0x289c8f=[];var _0x3eee8b=[];var _0x4370b4={};return db[_0x0c41('0x42')]['find']({'where':{'id':_0x1f557e[_0x0c41('0x5a')]['id']},'include':[{'model':db[_0x0c41('0x74')],'as':_0x0c41('0x75')}]})[_0x0c41('0x21')](handleEntityNotFound(_0x496aad,null))['then'](function(_0x490695){_0x34ae3a[_0x0c41('0x76')]=_0x490695;_0x34ae3a[_0x0c41('0x77')]=_['orderBy'](_0x490695[_0x0c41('0x75')],[_0x0c41('0x78')],['asc']);if(_0x34ae3a['account']['Applications']){delete _0x34ae3a['account']['Applications'];}return db[_0x0c41('0x79')][_0x0c41('0x65')]();})[_0x0c41('0x21')](function(_0x4e1c0c){if(!_0x4e1c0c){throw new db['Sequelize'][(_0x0c41('0x7a'))](_0x0c41('0x7b'));}_0x289c8f=_['difference'](_[_0x0c41('0x49')](_0x4e1c0c),[_0x0c41('0x7c'),'updatedAt']);_0x3eee8b=_[_0x0c41('0x7d')](_[_0x0c41('0x49')](_0x4e1c0c),[_0x0c41('0x7c'),_0x0c41('0x7e'),_0x0c41('0x7f'),_0x0c41('0x80')]);_0x34ae3a[_0x0c41('0x64')]={'mapKey':_0x0c41('0x81')};if(_0x34ae3a['account'][_0x0c41('0x45')]){switch(_0x34ae3a[_0x0c41('0x76')]['type']){case _0x0c41('0x82'):_0x34ae3a[_0x0c41('0x64')][_0x0c41('0x83')]=_0x1f557e[_0x0c41('0x64')]['From'];_0x34ae3a[_0x0c41('0x64')][_0x0c41('0x64')]=_0x1f557e['body'][_0x0c41('0x84')];_0x34ae3a[_0x0c41('0x64')][_0x0c41('0x85')]=_0x1f557e['body'][_0x0c41('0x86')];break;case _0x0c41('0x87'):_0x34ae3a[_0x0c41('0x64')][_0x0c41('0x83')]='+'+_0x1f557e[_0x0c41('0x64')][_0x0c41('0x88')];_0x34ae3a[_0x0c41('0x64')][_0x0c41('0x64')]=_0x1f557e[_0x0c41('0x64')][_0x0c41('0x89')];break;case'connectel':_0x34ae3a[_0x0c41('0x64')][_0x0c41('0x83')]=_0x1f557e['body'][_0x0c41('0x83')];_0x34ae3a[_0x0c41('0x64')][_0x0c41('0x64')]=_0x1f557e['body'][_0x0c41('0x28')];break;case _0x0c41('0x8a'):_0x34ae3a['body'][_0x0c41('0x83')]=_0x1f557e[_0x0c41('0x64')][_0x0c41('0x83')];_0x34ae3a['body'][_0x0c41('0x64')]=_0x1f557e[_0x0c41('0x64')]['body'];_0x34ae3a[_0x0c41('0x64')][_0x0c41('0x85')]=_0x1f557e[_0x0c41('0x64')][_0x0c41('0x8b')];break;case _0x0c41('0x8c'):_0x34ae3a[_0x0c41('0x64')][_0x0c41('0x83')]=_0x1f557e['body']['From'];_0x34ae3a[_0x0c41('0x64')][_0x0c41('0x64')]=_0x1f557e['body']['Text'];_0x34ae3a[_0x0c41('0x64')]['messageId']=_0x1f557e[_0x0c41('0x64')]['MessageUUID'];break;case _0x0c41('0x8d'):_0x34ae3a[_0x0c41('0x64')]['from']='+'+_0x1f557e[_0x0c41('0x64')][_0x0c41('0x8e')][0x0][_0x0c41('0x83')];_0x34ae3a[_0x0c41('0x64')][_0x0c41('0x64')]=_0x1f557e['body']['results'][0x0][_0x0c41('0x89')];_0x34ae3a[_0x0c41('0x64')][_0x0c41('0x85')]=_0x1f557e[_0x0c41('0x64')][_0x0c41('0x8e')][0x0]['messageId'];break;case _0x0c41('0x8f'):_0x34ae3a[_0x0c41('0x64')]['from']=_0x1f557e[_0x0c41('0x64')]['originatingAddress'];_0x34ae3a[_0x0c41('0x64')][_0x0c41('0x64')]=_0x1f557e[_0x0c41('0x64')][_0x0c41('0x90')][_0x0c41('0x28')];break;case _0x0c41('0x91'):_0x34ae3a[_0x0c41('0x64')][_0x0c41('0x83')]=_0x1f557e[_0x0c41('0x64')][_0x0c41('0x92')];_0x34ae3a[_0x0c41('0x64')]['body']=_0x1f557e['body']['text'];_0x34ae3a[_0x0c41('0x64')][_0x0c41('0x85')]=_0x1f557e[_0x0c41('0x64')][_0x0c41('0x93')];break;case'bandwidth':_0x34ae3a[_0x0c41('0x64')][_0x0c41('0x85')]=_0x1f557e['body'][0x0][_0x0c41('0x28')]['id'];_0x34ae3a[_0x0c41('0x64')][_0x0c41('0x83')]=_0x1f557e[_0x0c41('0x64')][0x0][_0x0c41('0x28')][_0x0c41('0x83')];_0x34ae3a[_0x0c41('0x64')][_0x0c41('0x64')]=_0x1f557e[_0x0c41('0x64')][0x0][_0x0c41('0x28')]['text'];break;case _0x0c41('0x94'):_0x34ae3a[_0x0c41('0x64')][_0x0c41('0x83')]=_0x1f557e[_0x0c41('0x64')][_0x0c41('0x83')];_0x34ae3a[_0x0c41('0x64')][_0x0c41('0x64')]=_0x1f557e['body'][_0x0c41('0x28')];_0x34ae3a[_0x0c41('0x64')][_0x0c41('0x85')]=_0x1f557e[_0x0c41('0x64')]['refid'];break;}}if(_0x34ae3a['body']['id']){delete _0x34ae3a[_0x0c41('0x64')]['id'];}if(_[_0x0c41('0x95')](_0x34ae3a[_0x0c41('0x64')][_0x0c41('0x83')])){throw new db[(_0x0c41('0x96'))][(_0x0c41('0x7a'))](_0x0c41('0x97'));}if(_[_0x0c41('0x95')](_0x34ae3a[_0x0c41('0x64')][_0x0c41('0x64')])||_0x34ae3a[_0x0c41('0x64')][_0x0c41('0x64')]===''){throw new db['Sequelize'][(_0x0c41('0x7a'))](_0x0c41('0x98'));}if(_[_0x0c41('0x95')](_0x34ae3a[_0x0c41('0x64')]['mapKey'])){throw new db[(_0x0c41('0x96'))][(_0x0c41('0x7a'))](_0x0c41('0x99')+_0x3eee8b);}if(!_['includes'](_0x3eee8b,_0x34ae3a[_0x0c41('0x64')]['mapKey'])){throw new db[(_0x0c41('0x96'))][(_0x0c41('0x7a'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3eee8b);}_0x4370b4[_0x34ae3a['body'][_0x0c41('0x9a')]]=_0x34ae3a[_0x0c41('0x64')][_0x0c41('0x83')];return db[_0x0c41('0x9b')][_0x0c41('0x5d')]({'where':{'id':_0x34ae3a['account'][_0x0c41('0x80')]},'include':[{'model':db[_0x0c41('0x79')],'as':_0x0c41('0x9c'),'where':_0x4370b4,'limit':0x1,'order':[[_0x0c41('0x7e'),_0x0c41('0x9d')]]}]});})['then'](handleEntityNotFound(_0x496aad,null))[_0x0c41('0x21')](function(_0x2c7e3e){if(_0x2c7e3e){_0x34ae3a[_0x0c41('0x9e')]=_[_0x0c41('0x9f')](_0x2c7e3e,['Contacts']);if(_0x2c7e3e[_0x0c41('0x9c')][_0x0c41('0x4d')]){return _0x2c7e3e[_0x0c41('0x9c')][0x0];}var _0x428c4f=_[_0x0c41('0x18')](_0x34ae3a['body'],{'firstName':_0x34ae3a[_0x0c41('0x64')][_0x0c41('0x83')],'ListId':_0x2c7e3e['id']});_0x428c4f[_0x34ae3a[_0x0c41('0x64')]['mapKey']]=_0x34ae3a[_0x0c41('0x64')][_0x0c41('0x83')];return db[_0x0c41('0x79')][_0x0c41('0x5e')](_0x428c4f,{'fields':_0x289c8f,'raw':!![]});}})['then'](handleEntityNotFound(_0x496aad,null))[_0x0c41('0x21')](function(_0x278b94){if(_0x278b94){_0x34ae3a[_0x0c41('0xa0')]=_0x278b94;var _0x4bbe50={'ContactId':_0x278b94['id'],'phone':_0x34ae3a['body']['from'],'SmsAccountId':_0x1f557e[_0x0c41('0x5a')]['id']};var _0x4462c6={'ContactId':_0x278b94['id'],'SmsAccountId':_0x1f557e[_0x0c41('0x5a')]['id'],'closed':![]};return db[_0x0c41('0xa1')][_0x0c41('0x5d')]({'where':_0x4462c6})[_0x0c41('0x21')](function(_0x1e0dc7){if(_0x1e0dc7){return[_0x1e0dc7,![]];}return db[_0x0c41('0xa1')][_0x0c41('0x5e')](_0x4bbe50)[_0x0c41('0x21')](function(_0x1a7324){return[_0x1a7324,!![]];});});}})['spread'](function(_0x2b808c,_0x45bce9){_0x34ae3a[_0x0c41('0xa2')]=_0x2b808c[_0x0c41('0x39')]({'plain':!![]});_0x34ae3a[_0x0c41('0xa2')][_0x0c41('0xa3')]=![];if(_0x45bce9){if(_0x34ae3a[_0x0c41('0x76')][_0x0c41('0xa4')]){_0x34ae3a['applications'][_0x0c41('0xa5')]({'id':0x0,'priority':_0x34ae3a[_0x0c41('0x77')][_0x0c41('0x4d')]+0x1,'app':_0x0c41('0xa6'),'appdata':'unmanaged','interval':'*,*,*,*'});}_0x34ae3a['interaction'][_0x0c41('0xa3')]=!![];}return db['SmsMessage']['create']({'phone':_0x34ae3a['body'][_0x0c41('0x83')],'messageId':_0x34ae3a[_0x0c41('0x64')][_0x0c41('0x85')],'body':_0x34ae3a['body'][_0x0c41('0x64')],'SmsAccountId':_0x1f557e[_0x0c41('0x5a')]['id'],'SmsInteractionId':_0x2b808c['id'],'direction':'in','ContactId':_0x2b808c[_0x0c41('0xa7')],'AttachmentId':_0x34ae3a[_0x0c41('0x64')][_0x0c41('0xa8')]});})[_0x0c41('0x21')](function(_0x215256){_0x34ae3a[_0x0c41('0x28')]=_0x215256;if(!_0x34ae3a[_0x0c41('0xa2')][_0x0c41('0xa9')])return;return db[_0x0c41('0xaa')][_0x0c41('0x5d')]({'attributes':['id','name'],'where':{'id':_0x34ae3a[_0x0c41('0xa2')][_0x0c41('0xa9')]}});})['then'](function(_0xa1e29b){if(_0xa1e29b){_0x34ae3a['applications'][_0x0c41('0xab')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0xa1e29b[_0x0c41('0x55')]+','+(_0x34ae3a['account']['waitForTheAssignedAgent']||0xa),'interval':_0x0c41('0xac')});}if(!_0x34ae3a['interaction'][_0x0c41('0xad')])return;return db[_0x0c41('0xae')][_0x0c41('0x5d')]({'attributes':['id','name'],'where':{'id':_0x34ae3a[_0x0c41('0xa2')][_0x0c41('0xad')]}});})['then'](function(_0x2fa328){if(_0x2fa328){_0x34ae3a[_0x0c41('0x77')][_0x0c41('0xab')]({'id':0x0,'priority':0x1,'app':_0x0c41('0xaf'),'appdata':_0x2fa328['name']+','+(_0x34ae3a[_0x0c41('0x76')][_0x0c41('0xb0')]||0x12c),'interval':_0x0c41('0xac')});}return respondWithRpcPromise(_0x0c41('0xb1'),_0x0c41('0xb2'),_0x34ae3a);})[_0x0c41('0x21')](function(_0x3f368a){if(_0x3f368a){var _0x20f1e1=0xc8;var _0x5f1d99='receiveMessage';logger[_0x0c41('0x22')](_0x0c41('0x25'),_0x5f1d99,_0x20f1e1,_0x0c41('0xb3'));logger[_0x0c41('0xb4')](_0x0c41('0xb5'),_0x5f1d99,_0x20f1e1,_0x0c41('0xb3'),JSON[_0x0c41('0xb6')](_0x3f368a));if(_0x34ae3a[_0x0c41('0x76')][_0x0c41('0x45')]===_0x0c41('0x82')){return _0x496aad[_0x0c41('0x2c')](_0x20f1e1)['set']('Content-Type','text/xml')['send'](_0x0c41('0xb7'));}else{return _0x496aad[_0x0c41('0x2c')](_0x20f1e1)[_0x0c41('0x2e')](_0x3f368a);}}})[_0x0c41('0x2a')](handleError(_0x496aad,null));};exports[_0x0c41('0xb8')]=function(_0x2bcc4a,_0x10d5de){var _0x4ffb75=_0x2bcc4a[_0x0c41('0x5a')]['id'];var _0x3299a5=_0x2bcc4a['body'];var _0xd9c7ed=0xc8;var _0x193c22=null;return db[_0x0c41('0xb9')]['transaction']({'isolationLevel':db[_0x0c41('0xb9')][_0x0c41('0xba')]['ISOLATION_LEVELS'][_0x0c41('0xbb')]},function(_0x215f23){return db[_0x0c41('0x42')][_0x0c41('0x6a')]({'where':{'id':_0x4ffb75},'transaction':_0x215f23})[_0x0c41('0x21')](function(_0xbdba92){if(_0xbdba92){return db[_0x0c41('0x74')]['destroy']({'where':{'SmsAccountId':_0x4ffb75},'transaction':_0x215f23})['then'](function(){var _0xbee118=_[_0x0c41('0x41')](_0x3299a5,function(_0x47b7bc){_0x47b7bc['SmsAccountId']=_0x4ffb75;return _0x47b7bc;});return db[_0x0c41('0x74')][_0x0c41('0xbc')](_0xbee118,{'transaction':_0x215f23});});}else{_0xd9c7ed=0x194;_0x193c22=[];}});})[_0x0c41('0x21')](function(){if(_0xd9c7ed!==0x194){return db['SmsApplication'][_0x0c41('0xbd')]({'where':{'SmsAccountId':_0x4ffb75},'order':_0x0c41('0x78')})['then'](function(_0xe41763){_0x193c22=_0xe41763;});}})['catch'](function(_0x5803b2){_0xd9c7ed=0x1f4;logger['error'](_0x5803b2[_0x0c41('0x3c')]);if(_0x5803b2[_0x0c41('0x55')]){delete _0x5803b2['name'];}_0x193c22=_0x5803b2;})['finally'](function(){if(_0x193c22===null){_0x10d5de['sendStatus'](_0xd9c7ed);}else{if(_0xd9c7ed===0x1f4){_0x10d5de[_0x0c41('0x2c')](_0xd9c7ed)['send'](_0x193c22);}else{_0x10d5de[_0x0c41('0x2c')](_0xd9c7ed)['json'](_0x193c22);}}});};exports[_0x0c41('0xbe')]=function(_0x67d4e0,_0x4a5449,_0x5c1699){var _0x3d0882={};var _0x1d94ab={};var _0x1174cd;var _0x1be6f7;return db[_0x0c41('0x42')][_0x0c41('0x6a')]({'where':{'id':_0x67d4e0[_0x0c41('0x5a')]['id']}})['then'](handleEntityNotFound(_0x4a5449,null))[_0x0c41('0x21')](function(_0x321035){if(_0x321035){_0x1174cd=_0x321035;_0x1d94ab[_0x0c41('0x47')]=_['keys'](db[_0x0c41('0x74')][_0x0c41('0x43')]);_0x1d94ab[_0x0c41('0x48')]=_[_0x0c41('0x49')](_0x67d4e0[_0x0c41('0x48')]);_0x1d94ab[_0x0c41('0x4a')]=_['intersection'](_0x1d94ab['model'],_0x1d94ab[_0x0c41('0x48')]);_0x3d0882['attributes']=_[_0x0c41('0x4c')](_0x1d94ab[_0x0c41('0x47')],qs[_0x0c41('0x5b')](_0x67d4e0['query'][_0x0c41('0x5b')]));_0x3d0882[_0x0c41('0x4b')]=_0x3d0882['attributes']['length']?_0x3d0882[_0x0c41('0x4b')]:_0x1d94ab[_0x0c41('0x47')];_0x3d0882[_0x0c41('0x4e')]=qs['sort'](_0x67d4e0[_0x0c41('0x48')][_0x0c41('0x4f')]);_0x3d0882[_0x0c41('0x50')]=qs[_0x0c41('0x4a')](_[_0x0c41('0x51')](_0x67d4e0[_0x0c41('0x48')],_0x1d94ab[_0x0c41('0x4a')]));if(_0x67d4e0['query'][_0x0c41('0x52')]){_0x3d0882[_0x0c41('0x50')]=_['merge'](_0x3d0882[_0x0c41('0x50')],{'$or':_[_0x0c41('0x41')](_0x3d0882[_0x0c41('0x4b')],function(_0x366b75){var _0x4e5497={};_0x4e5497[_0x366b75]={'$like':'%'+_0x67d4e0['query'][_0x0c41('0x52')]+'%'};return _0x4e5497;})});}_0x3d0882=_[_0x0c41('0x53')]({},_0x3d0882,_0x67d4e0['options']);return _0x1174cd[_0x0c41('0xbe')](_0x3d0882);}})[_0x0c41('0x21')](function(_0x5925ef){if(_0x5925ef){_0x1be6f7=_0x5925ef[_0x0c41('0x4d')];if(!_0x67d4e0[_0x0c41('0x48')]['hasOwnProperty'](_0x0c41('0x6c'))){_0x3d0882[_0x0c41('0x30')]=qs[_0x0c41('0x30')](_0x67d4e0[_0x0c41('0x48')][_0x0c41('0x30')]);_0x3d0882[_0x0c41('0x2f')]=qs[_0x0c41('0x2f')](_0x67d4e0['query']['offset']);}return _0x1174cd[_0x0c41('0xbe')](_0x3d0882);}})[_0x0c41('0x21')](function(_0x364b0b){if(_0x364b0b){return _0x364b0b?{'count':_0x1be6f7,'rows':_0x364b0b}:null;}})[_0x0c41('0x21')](respondWithResult(_0x4a5449,null))['catch'](handleError(_0x4a5449,null));};exports[_0x0c41('0xbf')]=function(_0x2b9e93,_0x14c382,_0x4e1dfa){var _0x23f5b1={'raw':![],'where':{}};var _0x4e8485={};var _0x5f1acf={'count':0x0,'rows':[]};return db[_0x0c41('0x42')]['findOne']({'where':{'id':_0x2b9e93[_0x0c41('0x5a')]['id']}})[_0x0c41('0x21')](handleEntityNotFound(_0x14c382,null))[_0x0c41('0x21')](function(_0x2b787a){if(_0x2b787a){_0x4e8485[_0x0c41('0x47')]=_[_0x0c41('0x49')](db[_0x0c41('0xa1')][_0x0c41('0x43')]);_0x4e8485['query']=_[_0x0c41('0x49')](_0x2b9e93[_0x0c41('0x48')]);_0x4e8485['filters']=_[_0x0c41('0x4c')](_0x4e8485['model'],_0x4e8485['query']);_0x23f5b1[_0x0c41('0x4b')]=_['intersection'](_0x4e8485[_0x0c41('0x47')],qs['fields'](_0x2b9e93[_0x0c41('0x48')][_0x0c41('0x5b')]));_0x23f5b1[_0x0c41('0x4b')]=_0x23f5b1[_0x0c41('0x4b')]['length']?_0x23f5b1[_0x0c41('0x4b')]:_0x4e8485[_0x0c41('0x47')];if(!_0x2b9e93['query']['hasOwnProperty'](_0x0c41('0x6c'))){_0x23f5b1['limit']=qs[_0x0c41('0x30')](_0x2b9e93['query'][_0x0c41('0x30')]);_0x23f5b1[_0x0c41('0x2f')]=qs[_0x0c41('0x2f')](_0x2b9e93[_0x0c41('0x48')][_0x0c41('0x2f')]);}_0x23f5b1[_0x0c41('0x4e')]=qs[_0x0c41('0x4f')](_0x2b9e93['query']['sort']);_0x23f5b1[_0x0c41('0x50')]=qs[_0x0c41('0x4a')](_[_0x0c41('0x51')](_0x2b9e93[_0x0c41('0x48')],_0x4e8485['filters']));_0x23f5b1['where']['SmsAccountId']=_0x2b787a['id'];if(_0x2b9e93[_0x0c41('0x48')][_0x0c41('0x52')]){_0x23f5b1[_0x0c41('0x50')]=_['merge'](_0x23f5b1[_0x0c41('0x50')],{'$or':_[_0x0c41('0x41')](_0x23f5b1['attributes'],function(_0x1654ef){var _0x2852e7={};_0x2852e7[_0x1654ef]={'$like':'%'+_0x2b9e93['query'][_0x0c41('0x52')]+'%'};return _0x2852e7;})});}_0x23f5b1=_[_0x0c41('0x53')]({},_0x23f5b1,_0x2b9e93['options']);return db[_0x0c41('0xa1')][_0x0c41('0x32')]({'where':_0x23f5b1[_0x0c41('0x50')]})[_0x0c41('0x21')](function(_0x4d5b61){_0x5f1acf[_0x0c41('0x32')]=_0x4d5b61;if(_0x2b9e93[_0x0c41('0x48')][_0x0c41('0x56')]){_0x23f5b1[_0x0c41('0x57')]=[{'model':db[_0x0c41('0x79')],'as':'Contact','required':![]},{'model':db['User'],'as':_0x0c41('0xc0'),'attributes':[_0x0c41('0x55'),_0x0c41('0xc1'),_0x0c41('0xc2')],'required':![]},{'model':db[_0x0c41('0xc3')],'as':_0x0c41('0xc4'),'attributes':['id','name','color'],'where':_0x2b9e93['query'][_0x0c41('0xc5')]?{'id':_0x2b9e93['query'][_0x0c41('0xc5')]}:undefined,'required':_0x2b9e93[_0x0c41('0x48')][_0x0c41('0xc5')]?!![]:![]}];}return db[_0x0c41('0xa1')][_0x0c41('0x58')](_0x23f5b1);})[_0x0c41('0x21')](function(_0x3cb233){_0x5f1acf[_0x0c41('0x59')]=_0x3cb233;return _0x5f1acf;});}})['then'](respondWithFilteredResult(_0x14c382,_0x23f5b1))['catch'](handleError(_0x14c382,null));};exports[_0x0c41('0x3d')]=function(_0x34f65a,_0x240015,_0x553376){var _0x4c80d7,_0x360eea,_0x464046;if(_[_0x0c41('0x95')](_0x34f65a['body'][_0x0c41('0x64')])||_0x34f65a[_0x0c41('0x64')]['body']===''){throw new db[(_0x0c41('0x96'))][(_0x0c41('0x7a'))](_0x0c41('0x98'));}if(_[_0x0c41('0x95')](_0x34f65a[_0x0c41('0x64')]['to'])){throw new db[(_0x0c41('0x96'))][(_0x0c41('0x7a'))]('to\x20is\x20mandatory');}_0x4c80d7=_0x34f65a[_0x0c41('0x64')]['to'];return db['SmsAccount'][_0x0c41('0x5d')]({'where':{'id':_0x34f65a[_0x0c41('0x5a')]['id']},'include':[{'model':db['CmList'],'as':_0x0c41('0xc6'),'include':[{'model':db[_0x0c41('0x79')],'as':_0x0c41('0x9c'),'where':{'mobile':_0x4c80d7},'limit':0x1,'order':[[_0x0c41('0x7e'),'DESC']]}]}]})[_0x0c41('0x21')](handleEntityNotFound(_0x240015,null))[_0x0c41('0x21')](function(_0x324d47){if(_0x324d47&&_0x324d47[_0x0c41('0xc6')]){_0x360eea=_0x324d47['get']({'plain':!![]});if(_0x360eea['List']&&_0x360eea[_0x0c41('0xc6')]['Contacts'][_0x0c41('0x4d')]){return _0x360eea[_0x0c41('0xc6')]['Contacts'][0x0];}return db[_0x0c41('0x79')]['create'](_['defaults'](_0x34f65a[_0x0c41('0x64')],{'firstName':_0x4c80d7,'mobile':_0x4c80d7,'phone':_0x4c80d7,'ListId':_0x360eea[_0x0c41('0x80')]}));}})[_0x0c41('0x21')](handleEntityNotFound(_0x240015,null))[_0x0c41('0x21')](function(_0x1ea42a){if(_0x1ea42a){_0x464046=_0x1ea42a;return db[_0x0c41('0xa1')][_0x0c41('0x5d')]({'where':{'ContactId':_0x464046['id'],'closed':![],'SmsAccountId':_0x360eea['id']}})[_0x0c41('0x21')](function(_0x36f501){if(_0x36f501){return[_0x36f501,![]];}return db['SmsInteraction'][_0x0c41('0x5e')]({'UserId':_0x34f65a['user']['id'],'ContactId':_0x464046['id'],'SmsAccountId':_0x360eea['id'],'phone':_0x4c80d7,'firstMsgDirection':'out','Messages':[_[_0x0c41('0x53')](_0x34f65a[_0x0c41('0x64')],{'read':![],'body':_0x34f65a[_0x0c41('0x64')][_0x0c41('0x64')],'phone':_0x4c80d7,'SmsAccountId':_0x360eea['id'],'UserId':_0x34f65a[_0x0c41('0x5f')]['id'],'ContactId':_0x464046['id']})]},{'include':[{'model':db['SmsMessage'],'as':_0x0c41('0xc7')}]})[_0x0c41('0x21')](function(_0x4844fc){return[_0x4844fc,!![]];});});}})['spread'](function(_0x2e0996,_0x53bc00){if(_0x53bc00){return _0x2e0996;}return db[_0x0c41('0xc8')][_0x0c41('0x5e')](_[_0x0c41('0x53')](_0x34f65a[_0x0c41('0x64')],{'read':![],'body':_0x34f65a[_0x0c41('0x64')][_0x0c41('0x64')],'phone':_0x4c80d7,'SmsAccountId':_0x360eea['id'],'SmsInteractionId':_0x2e0996['id'],'UserId':_0x34f65a[_0x0c41('0x5f')]['id'],'ContactId':_0x464046['id']}))['then'](function(_0x34aa48){_0x2e0996[_0x0c41('0xc9')][_0x0c41('0xc7')]=[];_0x2e0996[_0x0c41('0xc9')]['Messages'][_0x0c41('0xa5')](_0x34aa48[_0x0c41('0xc9')]);return _0x2e0996;});})[_0x0c41('0x21')](respondWithResult(_0x240015,null))[_0x0c41('0x2a')](handleError(_0x240015,null));};exports['status']=function(_0x5dea2e,_0x13e6ca,_0x59b8a7){if(_0x5dea2e['body']['id']){delete _0x5dea2e[_0x0c41('0x64')]['id'];}var _0x296e06,_0x2cd49a,_0x2cc5c9;return db['SmsAccount'][_0x0c41('0x5d')]({'where':{'id':_0x5dea2e['params']['id']}})[_0x0c41('0x21')](handleEntityNotFound(_0x13e6ca,null))[_0x0c41('0x21')](function(_0x47951f){if(_0x47951f){_0x2cc5c9=_0x47951f;logger['debug'](_0x0c41('0x25'),_0x0c41('0x2c'),_0x0c41('0xca'),_0x47951f[_0x0c41('0x45')],util['inspect'](_0x5dea2e[_0x0c41('0x64')],{'showHidden':![],'depth':null}));switch(_0x47951f['type']){case'skebby':if(_0x5dea2e[_0x0c41('0x64')][_0x0c41('0xcb')]&&_0x5dea2e[_0x0c41('0x64')][_0x0c41('0x2c')]){_0x2cd49a=_0x5dea2e[_0x0c41('0x64')][_0x0c41('0x2c')];return db[_0x0c41('0xc8')][_0x0c41('0x5d')]({'where':{'messageId':_0x5dea2e[_0x0c41('0x64')]['skebby_dispatch_id']}});}break;case'connectel':if(_0x5dea2e[_0x0c41('0x64')][_0x0c41('0xcc')]&&_0x5dea2e[_0x0c41('0x64')]['statusInt']){_0x2cd49a=_0x5dea2e[_0x0c41('0x64')][_0x0c41('0xcd')];return db[_0x0c41('0xc8')]['find']({'where':{'messageId':_0x5dea2e[_0x0c41('0x64')]['requestid']}});}break;case _0x0c41('0x8a'):if(_0x5dea2e['body'][_0x0c41('0x8b')]&&_0x5dea2e[_0x0c41('0x64')][_0x0c41('0xce')]){_0x2cd49a=_0x5dea2e[_0x0c41('0x64')][_0x0c41('0xce')];return db['SmsMessage'][_0x0c41('0x5d')]({'where':{'messageId':_0x5dea2e[_0x0c41('0x64')]['message_id']}});}break;case _0x0c41('0x8d'):var _0x27100b=_0x5dea2e[_0x0c41('0x64')][_0x0c41('0x8e')][0x0];if(_0x27100b[_0x0c41('0x85')]&&_0x27100b[_0x0c41('0x2c')][_0x0c41('0xcf')]===_0x0c41('0xd0')){_0x2cd49a=_0x27100b['status'][_0x0c41('0xcf')];return db[_0x0c41('0xc8')][_0x0c41('0x5d')]({'where':{'messageId':_0x27100b[_0x0c41('0x85')]}});}break;case'clickatell':if(_0x5dea2e[_0x0c41('0x64')][_0x0c41('0x85')]&&_0x5dea2e[_0x0c41('0x64')][_0x0c41('0x2c')]){_0x2cd49a=_0x5dea2e[_0x0c41('0x64')][_0x0c41('0x2c')];return db['SmsMessage'][_0x0c41('0x5d')]({'where':{'messageId':_0x5dea2e[_0x0c41('0x64')][_0x0c41('0x85')]}});}break;case _0x0c41('0xd1'):if(_0x5dea2e['body'][0x0][_0x0c41('0x28')]['id']){_0x2cd49a=_0x5dea2e['body'][0x0][_0x0c41('0x45')];return db[_0x0c41('0xc8')][_0x0c41('0x5d')]({'where':{'messageId':_0x5dea2e['body'][0x0]['message']['id']}});}break;case _0x0c41('0x94'):if(_0x5dea2e['body'][_0x0c41('0xd2')]&&_0x5dea2e['body'][_0x0c41('0x2c')]){_0x2cd49a=_0x5dea2e[_0x0c41('0x64')]['status'];return db[_0x0c41('0xc8')]['find']({'where':{'messageId':_0x5dea2e[_0x0c41('0x64')][_0x0c41('0xd2')]}});}break;}}})[_0x0c41('0x21')](handleEntityNotFound(_0x13e6ca,null))[_0x0c41('0x21')](function(_0xc6e1d4){if(_0xc6e1d4){_0x296e06=_0xc6e1d4;switch(_0x2cc5c9[_0x0c41('0x45')]){case _0x0c41('0x87'):if(_0x2cd49a===_0x0c41('0xd0')){return _0x296e06[_0x0c41('0x37')]({'read':!![]});}else{logger['error'](_0x0c41('0x25'),'status',_0x0c41('0x87'),util['inspect'](_0x5dea2e[_0x0c41('0x64')],{'showHidden':![],'depth':null}));}break;case _0x0c41('0xd3'):if(_0x2cd49a==='1'){return _0x296e06[_0x0c41('0x37')]({'read':!![]});}else{logger['error'](_0x0c41('0x25'),'status',_0x0c41('0x87'),util[_0x0c41('0xd4')](_0x5dea2e[_0x0c41('0x64')],{'showHidden':![],'depth':null}));}break;case _0x0c41('0x8a'):if(!_0x5dea2e[_0x0c41('0x64')]['error_code']&&_0x2cd49a>=0xc8&&_0x2cd49a<=0xce){return _0x296e06[_0x0c41('0x37')]({'read':!![]});}else{logger[_0x0c41('0x26')](_0x0c41('0x25'),'status',_0x0c41('0x8a'),util[_0x0c41('0xd4')](_0x5dea2e['body'],{'showHidden':![],'depth':null}));}break;case _0x0c41('0x8d'):var _0x55e4c0=_0x5dea2e[_0x0c41('0x64')][_0x0c41('0x8e')][0x0];if(_0x55e4c0[_0x0c41('0x2c')][_0x0c41('0xcf')]==='DELIVERED'){return _0x296e06[_0x0c41('0x37')]({'read':!![]});}else{logger['error'](_0x0c41('0x25'),_0x0c41('0x2c'),'infobip',util[_0x0c41('0xd4')](_0x5dea2e[_0x0c41('0x64')],{'showHidden':![],'depth':null}));}break;case _0x0c41('0x91'):if(_0x2cd49a==_0x0c41('0xd5')||_0x2cd49a==_0x0c41('0xd6')){return _0x296e06['update']({'read':!![]});}else{logger[_0x0c41('0x26')](_0x0c41('0x25'),_0x0c41('0x2c'),'clickatell',util[_0x0c41('0xd4')](_0x5dea2e[_0x0c41('0x64')],{'showHidden':![],'depth':null}));}break;case _0x0c41('0xd1'):if(_0x2cd49a==_0x0c41('0xd7')){return _0x296e06[_0x0c41('0x37')]({'read':!![]});}else{logger[_0x0c41('0x26')](_0x0c41('0x25'),_0x0c41('0x2c'),_0x0c41('0xd1'),util[_0x0c41('0xd4')](_0x5dea2e[_0x0c41('0x64')],{'showHidden':![],'depth':null}));}break;case _0x0c41('0x94'):if(_0x2cd49a===_0x0c41('0xd8')||_0x2cd49a===_0x0c41('0xd9')){return _0x296e06[_0x0c41('0x37')]({'read':!![]});}else{logger[_0x0c41('0x26')](_0x0c41('0x25'),_0x0c41('0x2c'),_0x0c41('0x94'),util[_0x0c41('0xd4')](_0x5dea2e[_0x0c41('0x64')],{'showHidden':![],'depth':null}));}break;}return _0x296e06;}})['then'](respondWithResult(_0x13e6ca,null))[_0x0c41('0x2a')](handleError(_0x13e6ca,null));};exports[_0x0c41('0xda')]=function(_0x243f87,_0x40669b,_0x202336){var _0x4c174a,_0x3e0b21,_0x5dfc29;return db['SmsAccount'][_0x0c41('0x5d')]({'where':{'id':_0x243f87[_0x0c41('0x5a')]['id']}})[_0x0c41('0x21')](handleEntityNotFound(_0x40669b,null))[_0x0c41('0x21')](function(_0x1bc5e7){if(_0x1bc5e7){_0x5dfc29=_0x1bc5e7;logger[_0x0c41('0xb4')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x0c41('0x2c'),_0x0c41('0xca'),_0x1bc5e7['type'],util[_0x0c41('0xd4')](_0x243f87[_0x0c41('0x48')],{'showHidden':![],'depth':null}));switch(_0x1bc5e7[_0x0c41('0x45')]){case _0x0c41('0x8f'):if(_0x243f87[_0x0c41('0x48')][_0x0c41('0xdb')]&&_0x243f87[_0x0c41('0x48')][_0x0c41('0xdc')]){_0x3e0b21=_0x243f87[_0x0c41('0x48')]['state'];return db['SmsMessage'][_0x0c41('0x5d')]({'where':{'messageId':_0x243f87[_0x0c41('0x48')][_0x0c41('0xdb')]}});}break;}}})['then'](handleEntityNotFound(_0x40669b,null))['then'](function(_0x2476f6){if(_0x2476f6){_0x4c174a=_0x2476f6;switch(_0x5dfc29[_0x0c41('0x45')]){case'csc':if(_0x3e0b21==='2'||_0x3e0b21==='6'){return _0x4c174a[_0x0c41('0x37')]({'read':!![]});}else{logger[_0x0c41('0x26')](_0x0c41('0x25'),_0x0c41('0x2c'),_0x0c41('0x8f'),util['inspect'](_0x243f87[_0x0c41('0x48')],{'showHidden':![],'depth':null}));};break;}return _0x4c174a;}})[_0x0c41('0x21')](respondWithResult(_0x40669b,null))[_0x0c41('0x2a')](handleError(_0x40669b,null));};exports['addAgents']=function(_0x2bbb39,_0x2a1346,_0x2f2517){return db[_0x0c41('0x42')][_0x0c41('0x5d')]({'where':{'id':_0x2bbb39['params']['id']}})[_0x0c41('0x21')](handleEntityNotFound(_0x2a1346,null))[_0x0c41('0x21')](function(_0x2c0ff0){if(_0x2c0ff0){return _0x2c0ff0[_0x0c41('0xdd')](_0x2bbb39[_0x0c41('0x64')][_0x0c41('0x6e')],_[_0x0c41('0x9f')](_0x2bbb39['body'],[_0x0c41('0x6e'),'id'])||{})[_0x0c41('0xde')](function(_0x43759f){for(var _0x31f01b=0x0;_0x31f01b<_0x2bbb39[_0x0c41('0x64')][_0x0c41('0x6e')][_0x0c41('0x4d')];_0x31f01b+=0x1){socket[_0x0c41('0xdf')](_0x0c41('0xe0'),{'UserId':Number(_0x2bbb39['body']['ids'][_0x31f01b]),'SmsAccountId':Number(_0x2bbb39[_0x0c41('0x5a')]['id'])});}return _0x43759f;});}})[_0x0c41('0x21')](respondWithResult(_0x2a1346,null))[_0x0c41('0x2a')](handleError(_0x2a1346,null));};exports[_0x0c41('0xe1')]=function(_0x552cb1,_0x10dcd2,_0x9b15dd){return db[_0x0c41('0x42')]['find']({'where':{'id':_0x552cb1[_0x0c41('0x5a')]['id']}})['then'](handleEntityNotFound(_0x10dcd2,null))[_0x0c41('0x21')](function(_0x53ce09){if(_0x53ce09){return _0x53ce09[_0x0c41('0xe1')](_0x552cb1[_0x0c41('0x48')][_0x0c41('0x6e')])[_0x0c41('0x21')](function(){if(_[_0x0c41('0xe2')](_0x552cb1['query'][_0x0c41('0x6e')])){for(var _0x523abe=0x0;_0x523abe<_0x552cb1[_0x0c41('0x48')][_0x0c41('0x6e')][_0x0c41('0x4d')];_0x523abe+=0x1){socket['emit'](_0x0c41('0xe3'),{'UserId':Number(_0x552cb1[_0x0c41('0x48')][_0x0c41('0x6e')][_0x523abe]),'SmsAccountId':Number(_0x552cb1['params']['id'])});}}else{socket[_0x0c41('0xdf')](_0x0c41('0xe3'),{'UserId':Number(_0x552cb1[_0x0c41('0x48')][_0x0c41('0x6e')]),'SmsAccountId':Number(_0x552cb1['params']['id'])});}});}})['then'](respondWithStatusCode(_0x10dcd2,null))[_0x0c41('0x2a')](handleError(_0x10dcd2,null));};exports[_0x0c41('0xe4')]=function(_0x454233,_0x49257c,_0x5a2f8c){var _0x36c90c={};var _0x194081={};var _0x1f55b2;var _0x5e7cdb;return db[_0x0c41('0x42')]['findOne']({'where':{'id':_0x454233[_0x0c41('0x5a')]['id']}})[_0x0c41('0x21')](handleEntityNotFound(_0x49257c,null))['then'](function(_0x50c7e9){if(_0x50c7e9){_0x1f55b2=_0x50c7e9;_0x194081[_0x0c41('0x47')]=_[_0x0c41('0x49')](db[_0x0c41('0xaa')][_0x0c41('0x43')]);_0x194081[_0x0c41('0x48')]=_[_0x0c41('0x49')](_0x454233[_0x0c41('0x48')]);_0x194081[_0x0c41('0x4a')]=_[_0x0c41('0x4c')](_0x194081[_0x0c41('0x47')],_0x194081[_0x0c41('0x48')]);_0x36c90c[_0x0c41('0x4b')]=_[_0x0c41('0x4c')](_0x194081[_0x0c41('0x47')],qs['fields'](_0x454233[_0x0c41('0x48')]['fields']));_0x36c90c[_0x0c41('0x4b')]=_0x36c90c['attributes'][_0x0c41('0x4d')]?_0x36c90c['attributes']:_0x194081[_0x0c41('0x47')];_0x36c90c['order']=qs[_0x0c41('0x4f')](_0x454233[_0x0c41('0x48')][_0x0c41('0x4f')]);_0x36c90c[_0x0c41('0x50')]=qs[_0x0c41('0x4a')](_[_0x0c41('0x51')](_0x454233[_0x0c41('0x48')],_0x194081[_0x0c41('0x4a')]));if(_0x454233['query'][_0x0c41('0x52')]){_0x36c90c['where']=_[_0x0c41('0x53')](_0x36c90c[_0x0c41('0x50')],{'$or':_['map'](_0x36c90c[_0x0c41('0x4b')],function(_0xffa72c){var _0x5f4dfa={};_0x5f4dfa[_0xffa72c]={'$like':'%'+_0x454233[_0x0c41('0x48')][_0x0c41('0x52')]+'%'};return _0x5f4dfa;})});}_0x36c90c=_[_0x0c41('0x53')]({},_0x36c90c,_0x454233[_0x0c41('0x5c')]);return _0x1f55b2[_0x0c41('0xe4')](_0x36c90c);}})[_0x0c41('0x21')](function(_0x5e6f93){if(_0x5e6f93){_0x5e7cdb=_0x5e6f93['length'];if(!_0x454233[_0x0c41('0x48')][_0x0c41('0x6b')](_0x0c41('0x6c'))){_0x36c90c['limit']=qs[_0x0c41('0x30')](_0x454233[_0x0c41('0x48')][_0x0c41('0x30')]);_0x36c90c['offset']=qs[_0x0c41('0x2f')](_0x454233[_0x0c41('0x48')]['offset']);}return _0x1f55b2[_0x0c41('0xe4')](_0x36c90c);}})['then'](function(_0x509aee){if(_0x509aee){return _0x509aee?{'count':_0x5e7cdb,'rows':_0x509aee}:null;}})['then'](respondWithResult(_0x49257c,null))[_0x0c41('0x2a')](handleError(_0x49257c,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 8ca155c..4fbcc8a 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 _0x37a7=['hook','events','../../mysqldb','SmsAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x3cc590,_0x2d99cf){var _0x1de2fb=function(_0x108981){while(--_0x108981){_0x3cc590['push'](_0x3cc590['shift']());}};_0x1de2fb(++_0x2d99cf);}(_0x37a7,0x19b));var _0x737a=function(_0x4cfdd8,_0x2fd2ea){_0x4cfdd8=_0x4cfdd8-0x0;var _0x2541ae=_0x37a7[_0x4cfdd8];return _0x2541ae;};'use strict';var EventEmitter=require(_0x737a('0x0'));var SmsAccount=require(_0x737a('0x1'))['db'][_0x737a('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x737a('0x3')](0x0);var events={'afterCreate':_0x737a('0x4'),'afterUpdate':_0x737a('0x5'),'afterDestroy':_0x737a('0x6')};function emitEvent(_0x3c0a60){return function(_0x317488,_0x40292e,_0x44ac9a){SmsAccountEvents['emit'](_0x3c0a60+':'+_0x317488['id'],_0x317488);SmsAccountEvents[_0x737a('0x7')](_0x3c0a60,_0x317488);_0x44ac9a(null);};}for(var e in events){if(events[_0x737a('0x8')](e)){var event=events[e];SmsAccount[_0x737a('0x9')](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file +var _0xfc6c=['../../mysqldb','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x599ca0,_0x400eaf){var _0x1cf34f=function(_0x515781){while(--_0x515781){_0x599ca0['push'](_0x599ca0['shift']());}};_0x1cf34f(++_0x400eaf);}(_0xfc6c,0xb7));var _0xcfc6=function(_0x422bce,_0x1df9ca){_0x422bce=_0x422bce-0x0;var _0x1c0077=_0xfc6c[_0x422bce];return _0x1c0077;};'use strict';var EventEmitter=require(_0xcfc6('0x0'));var SmsAccount=require(_0xcfc6('0x1'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xcfc6('0x2'),'afterUpdate':_0xcfc6('0x3'),'afterDestroy':_0xcfc6('0x4')};function emitEvent(_0x265d89){return function(_0x61aa8c,_0x24b36d,_0x570f6d){SmsAccountEvents[_0xcfc6('0x5')](_0x265d89+':'+_0x61aa8c['id'],_0x61aa8c);SmsAccountEvents['emit'](_0x265d89,_0x61aa8c);_0x570f6d(null);};}for(var e in events){if(events[_0xcfc6('0x6')](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0xcfc6('0x7')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 46a2c51..7edf98f 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 _0x6b7b=['exports','define','sms_accounts','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','./smsAccount.attributes'];(function(_0x4549ff,_0x325d38){var _0xaef207=function(_0x164408){while(--_0x164408){_0x4549ff['push'](_0x4549ff['shift']());}};_0xaef207(++_0x325d38);}(_0x6b7b,0x16e));var _0xb6b7=function(_0x15b4f9,_0x5cd369){_0x15b4f9=_0x15b4f9-0x0;var _0x43679b=_0x6b7b[_0x15b4f9];return _0x43679b;};'use strict';var _=require(_0xb6b7('0x0'));var util=require('util');var logger=require(_0xb6b7('0x1'))(_0xb6b7('0x2'));var moment=require('moment');var BPromise=require(_0xb6b7('0x3'));var rp=require(_0xb6b7('0x4'));var fs=require('fs');var path=require(_0xb6b7('0x5'));var rimraf=require(_0xb6b7('0x6'));var config=require('../../config/environment');var attributes=require(_0xb6b7('0x7'));module[_0xb6b7('0x8')]=function(_0x529dfd,_0x52e0d6){return _0x529dfd[_0xb6b7('0x9')]('SmsAccount',attributes,{'tableName':_0xb6b7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb05a=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./smsAccount.attributes','SmsAccount','sms_accounts','lodash','util'];(function(_0x264da6,_0x4d8d9f){var _0x4051db=function(_0x2efdd5){while(--_0x2efdd5){_0x264da6['push'](_0x264da6['shift']());}};_0x4051db(++_0x4d8d9f);}(_0xb05a,0x17e));var _0xab05=function(_0x18c08a,_0x46e340){_0x18c08a=_0x18c08a-0x0;var _0x388429=_0xb05a[_0x18c08a];return _0x388429;};'use strict';var _=require(_0xab05('0x0'));var util=require(_0xab05('0x1'));var logger=require(_0xab05('0x2'))(_0xab05('0x3'));var moment=require(_0xab05('0x4'));var BPromise=require(_0xab05('0x5'));var rp=require(_0xab05('0x6'));var fs=require('fs');var path=require(_0xab05('0x7'));var rimraf=require(_0xab05('0x8'));var config=require('../../config/environment');var attributes=require(_0xab05('0x9'));module['exports']=function(_0x4e6ac1,_0x3e1f0a){return _0x4e6ac1['define'](_0xab05('0xa'),attributes,{'tableName':_0xab05('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 f25169e..7544006 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 _0x1726=['register','request','then','SmsAccount,\x20%s,\x20%s','debug','stringify','error','message','info','request\x20sent','result','ShowSmsAccount','SmsAccount','find','options','where','attributes','include','map','model','catch','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket'];(function(_0x5ef75d,_0x3dbf12){var _0x1b0f1e=function(_0xf13c34){while(--_0xf13c34){_0x5ef75d['push'](_0x5ef75d['shift']());}};_0x1b0f1e(++_0x3dbf12);}(_0x1726,0xc4));var _0x6172=function(_0x27c068,_0x342981){_0x27c068=_0x27c068-0x0;var _0xe5a67f=_0x1726[_0x27c068];return _0xe5a67f;};'use strict';var _=require('lodash');var util=require(_0x6172('0x0'));var moment=require(_0x6172('0x1'));var BPromise=require('bluebird');var rs=require(_0x6172('0x2'));var fs=require('fs');var Redis=require(_0x6172('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x6172('0x4'));var logger=require(_0x6172('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6172('0x6'));var client=jayson[_0x6172('0x7')][_0x6172('0x8')]({'port':0x232a});config[_0x6172('0x9')]=_[_0x6172('0xa')](config[_0x6172('0x9')],{'host':_0x6172('0xb'),'port':0x18eb});var socket=require(_0x6172('0xc'))(new Redis(config['redis']));require(_0x6172('0xd'))[_0x6172('0xe')](socket);function respondWithRpcPromise(_0x2d97ce,_0x2838de,_0x3ebcd4){return new BPromise(function(_0x4e0d16,_0x31478c){return client[_0x6172('0xf')](_0x2d97ce,_0x3ebcd4)[_0x6172('0x10')](function(_0x6af61c){logger['info'](_0x6172('0x11'),_0x2838de,'request\x20sent');logger[_0x6172('0x12')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x2838de,'request\x20sent',JSON[_0x6172('0x13')](_0x6af61c));if(_0x6af61c[_0x6172('0x14')]){if(_0x6af61c['error']['code']===0x1f4){logger['error']('SmsAccount,\x20%s,\x20%s',_0x2838de,_0x6af61c['error'][_0x6172('0x15')]);return _0x31478c(_0x6af61c['error'][_0x6172('0x15')]);}logger[_0x6172('0x14')](_0x6172('0x11'),_0x2838de,_0x6af61c[_0x6172('0x14')][_0x6172('0x15')]);return _0x4e0d16(_0x6af61c[_0x6172('0x14')][_0x6172('0x15')]);}else{logger[_0x6172('0x16')](_0x6172('0x11'),_0x2838de,_0x6172('0x17'));_0x4e0d16(_0x6af61c[_0x6172('0x18')][_0x6172('0x15')]);}})['catch'](function(_0x3f23b5){logger['error'](_0x6172('0x11'),_0x2838de,_0x3f23b5);_0x31478c(_0x3f23b5);});});}exports[_0x6172('0x19')]=function(_0x272322){var _0x44bca5=this;return new Promise(function(_0x5904a1,_0x14458b){return db[_0x6172('0x1a')][_0x6172('0x1b')]({'raw':_0x272322['options']?_0x272322[_0x6172('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x272322[_0x6172('0x1c')]?_0x272322['options'][_0x6172('0x1d')]||null:null,'attributes':_0x272322[_0x6172('0x1c')]?_0x272322[_0x6172('0x1c')][_0x6172('0x1e')]||null:null,'include':_0x272322[_0x6172('0x1c')]?_0x272322[_0x6172('0x1c')][_0x6172('0x1f')]?_[_0x6172('0x20')](_0x272322[_0x6172('0x1c')]['include'],function(_0x4421f3){return{'model':db[_0x4421f3[_0x6172('0x21')]],'as':_0x4421f3['as'],'attributes':_0x4421f3[_0x6172('0x1e')],'include':_0x4421f3[_0x6172('0x1f')]?_[_0x6172('0x20')](_0x4421f3['include'],function(_0x5c0441){return{'model':db[_0x5c0441['model']],'as':_0x5c0441['as'],'attributes':_0x5c0441[_0x6172('0x1e')],'include':_0x5c0441[_0x6172('0x1f')]?_[_0x6172('0x20')](_0x5c0441[_0x6172('0x1f')],function(_0x59fbf0){return{'model':db[_0x59fbf0['model']],'as':_0x59fbf0['as'],'attributes':_0x59fbf0['attributes']};}):[]};}):[]};}):[]:[]})[_0x6172('0x10')](function(_0x36afca){logger[_0x6172('0x16')](_0x6172('0x19'),_0x272322);logger[_0x6172('0x12')](_0x6172('0x19'),_0x272322,JSON[_0x6172('0x13')](_0x36afca));_0x5904a1(_0x36afca);})[_0x6172('0x22')](function(_0x4e4580){logger['error']('ShowSmsAccount',_0x4e4580[_0x6172('0x15')],_0x272322);_0x14458b(_0x44bca5[_0x6172('0x14')](0x1f4,_0x4e4580['message']));});});}; \ No newline at end of file +var _0x998c=['ShowSmsAccount','SmsAccount','find','options','where','include','map','model','attributes','then','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','defaults','socket.io-emitter','./smsAccount.socket','register','request','debug','request\x20sent','stringify','error','code','message','info','SmsAccount,\x20%s,\x20%s','result','catch'];(function(_0x1881a9,_0x4348d5){var _0x1e5241=function(_0x437624){while(--_0x437624){_0x1881a9['push'](_0x1881a9['shift']());}};_0x1e5241(++_0x4348d5);}(_0x998c,0x15e));var _0xc998=function(_0x47ad1a,_0x467d68){_0x47ad1a=_0x47ad1a-0x0;var _0x586211=_0x998c[_0x47ad1a];return _0x586211;};'use strict';var _=require(_0xc998('0x0'));var util=require('util');var moment=require(_0xc998('0x1'));var BPromise=require('bluebird');var rs=require(_0xc998('0x2'));var fs=require('fs');var Redis=require(_0xc998('0x3'));var db=require(_0xc998('0x4'))['db'];var utils=require(_0xc998('0x5'));var logger=require(_0xc998('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc998('0x7')][_0xc998('0x8')]({'port':0x232a});config['redis']=_[_0xc998('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xc998('0xa'))(new Redis(config['redis']));require(_0xc998('0xb'))[_0xc998('0xc')](socket);function respondWithRpcPromise(_0x24c0e8,_0x25ecf9,_0x1753fe){return new BPromise(function(_0x52aebc,_0x111798){return client[_0xc998('0xd')](_0x24c0e8,_0x1753fe)['then'](function(_0x4d5a96){logger['info']('SmsAccount,\x20%s,\x20%s',_0x25ecf9,'request\x20sent');logger[_0xc998('0xe')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x25ecf9,_0xc998('0xf'),JSON[_0xc998('0x10')](_0x4d5a96));if(_0x4d5a96[_0xc998('0x11')]){if(_0x4d5a96[_0xc998('0x11')][_0xc998('0x12')]===0x1f4){logger[_0xc998('0x11')]('SmsAccount,\x20%s,\x20%s',_0x25ecf9,_0x4d5a96[_0xc998('0x11')]['message']);return _0x111798(_0x4d5a96[_0xc998('0x11')]['message']);}logger[_0xc998('0x11')]('SmsAccount,\x20%s,\x20%s',_0x25ecf9,_0x4d5a96[_0xc998('0x11')]['message']);return _0x52aebc(_0x4d5a96[_0xc998('0x11')][_0xc998('0x13')]);}else{logger[_0xc998('0x14')](_0xc998('0x15'),_0x25ecf9,_0xc998('0xf'));_0x52aebc(_0x4d5a96[_0xc998('0x16')]['message']);}})[_0xc998('0x17')](function(_0x38566d){logger[_0xc998('0x11')](_0xc998('0x15'),_0x25ecf9,_0x38566d);_0x111798(_0x38566d);});});}exports[_0xc998('0x18')]=function(_0x5eef85){var _0x3f7100=this;return new Promise(function(_0x2b45e7,_0x40d988){return db[_0xc998('0x19')][_0xc998('0x1a')]({'raw':_0x5eef85[_0xc998('0x1b')]?_0x5eef85[_0xc998('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x5eef85['options']?_0x5eef85[_0xc998('0x1b')][_0xc998('0x1c')]||null:null,'attributes':_0x5eef85[_0xc998('0x1b')]?_0x5eef85[_0xc998('0x1b')]['attributes']||null:null,'include':_0x5eef85['options']?_0x5eef85[_0xc998('0x1b')][_0xc998('0x1d')]?_[_0xc998('0x1e')](_0x5eef85[_0xc998('0x1b')]['include'],function(_0x52591d){return{'model':db[_0x52591d[_0xc998('0x1f')]],'as':_0x52591d['as'],'attributes':_0x52591d[_0xc998('0x20')],'include':_0x52591d[_0xc998('0x1d')]?_[_0xc998('0x1e')](_0x52591d[_0xc998('0x1d')],function(_0x4715b7){return{'model':db[_0x4715b7[_0xc998('0x1f')]],'as':_0x4715b7['as'],'attributes':_0x4715b7[_0xc998('0x20')],'include':_0x4715b7[_0xc998('0x1d')]?_[_0xc998('0x1e')](_0x4715b7['include'],function(_0x5c772b){return{'model':db[_0x5c772b[_0xc998('0x1f')]],'as':_0x5c772b['as'],'attributes':_0x5c772b[_0xc998('0x20')]};}):[]};}):[]};}):[]:[]})[_0xc998('0x21')](function(_0x4785c9){logger[_0xc998('0x14')](_0xc998('0x18'),_0x5eef85);logger[_0xc998('0xe')](_0xc998('0x18'),_0x5eef85,JSON[_0xc998('0x10')](_0x4785c9));_0x2b45e7(_0x4785c9);})[_0xc998('0x17')](function(_0xad347a){logger[_0xc998('0x11')](_0xc998('0x18'),_0xad347a[_0xc998('0x13')],_0x5eef85);_0x40d988(_0x3f7100['error'](0x1f4,_0xad347a[_0xc998('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index bbcd405..d685779 100644 --- a/server/api/smsAccount/smsAccount.socket.js +++ b/server/api/smsAccount/smsAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'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(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'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 c662f2b..0359ebe 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 _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(_0x2e3d2f,_0x144d88){var _0x21b632=function(_0xfc9a06){while(--_0xfc9a06){_0x2e3d2f['push'](_0x2e3d2f['shift']());}};_0x21b632(++_0x144d88);}(_0xedd9,0xfc));var _0x9edd=function(_0x2e8da3,_0x362e51){_0x2e8da3=_0x2e8da3-0x0;var _0x3630dc=_0xedd9[_0x2e8da3];return _0x3630dc;};'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 +var _0x34e8=['../../config/environment','./smsApplication.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x58ca7d,_0x27f5ea){var _0x152c4c=function(_0x1b9c99){while(--_0x1b9c99){_0x58ca7d['push'](_0x58ca7d['shift']());}};_0x152c4c(++_0x27f5ea);}(_0x34e8,0x12c));var _0x834e=function(_0x5b308f,_0x4fc75a){_0x5b308f=_0x5b308f-0x0;var _0x39f149=_0x34e8[_0x5b308f];return _0x39f149;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var fs_extra=require(_0x834e('0x5'));var auth=require(_0x834e('0x6'));var interaction=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var controller=require(_0x834e('0x9'));router[_0x834e('0xa')]('/',auth['isAuthenticated'](),controller[_0x834e('0xb')]);router['get'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0xe')]);router[_0x834e('0xf')]('/',auth[_0x834e('0xd')](),controller[_0x834e('0x10')]);router[_0x834e('0x11')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x12')]);router[_0x834e('0x13')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x14')]);module[_0x834e('0x15')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 3955b89..1b9793b 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 _0x89d9=['STRING','noop','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x622ec8,_0x57bcf9){var _0x259dd7=function(_0x29d61f){while(--_0x29d61f){_0x622ec8['push'](_0x622ec8['shift']());}};_0x259dd7(++_0x57bcf9);}(_0x89d9,0xa5));var _0x989d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x89d9[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x989d('0x0'));module[_0x989d('0x1')]={'priority':{'type':Sequelize[_0x989d('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x989d('0x3')],'allowNull':![],'defaultValue':_0x989d('0x4')},'appdata':{'type':Sequelize[_0x989d('0x5')]()},'description':{'type':Sequelize[_0x989d('0x3')]},'interval':{'type':Sequelize[_0x989d('0x3')],'defaultValue':_0x989d('0x6')}}; \ No newline at end of file +var _0x0ab7=['STRING','noop','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x5870c1,_0x173ba3){var _0x344685=function(_0x1984be){while(--_0x1984be){_0x5870c1['push'](_0x5870c1['shift']());}};_0x344685(++_0x173ba3);}(_0x0ab7,0x100));var _0x70ab=function(_0x25b44f,_0x345247){_0x25b44f=_0x25b44f-0x0;var _0x4cb449=_0x0ab7[_0x25b44f];return _0x4cb449;};'use strict';var Sequelize=require(_0x70ab('0x0'));module[_0x70ab('0x1')]={'priority':{'type':Sequelize[_0x70ab('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x70ab('0x3')],'allowNull':![],'defaultValue':_0x70ab('0x4')},'appdata':{'type':Sequelize[_0x70ab('0x5')]()},'description':{'type':Sequelize[_0x70ab('0x3')]},'interval':{'type':Sequelize[_0x70ab('0x3')],'defaultValue':_0x70ab('0x6')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 0a01860..a146407 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 _0x5902=['sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','then','destroy','error','stack','name','send','map','SmsApplication','rawAttributes','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where','pick','merge','filter','options','include','rows','catch','show','params','find','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path'];(function(_0x33d1ae,_0x14679f){var _0x3ff9f6=function(_0x159267){while(--_0x159267){_0x33d1ae['push'](_0x33d1ae['shift']());}};_0x3ff9f6(++_0x14679f);}(_0x5902,0x87));var _0x2590=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x5902[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0x2590('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2590('0x1'));var jsonpatch=require(_0x2590('0x2'));var rp=require(_0x2590('0x3'));var moment=require(_0x2590('0x4'));var BPromise=require(_0x2590('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2590('0x6'));var sox=require(_0x2590('0x7'));var csv=require(_0x2590('0x8'));var ejs=require(_0x2590('0x9'));var fs=require('fs');var fs_extra=require(_0x2590('0xa'));var _=require(_0x2590('0xb'));var squel=require(_0x2590('0xc'));var crypto=require(_0x2590('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x2590('0xe'));var toCsv=require(_0x2590('0x8'));var querystring=require(_0x2590('0xf'));var Papa=require('papaparse');var Redis=require(_0x2590('0x10'));var authService=require(_0x2590('0x11'));var qs=require(_0x2590('0x12'));var as=require(_0x2590('0x13'));var hardwareService=require(_0x2590('0x14'));var logger=require(_0x2590('0x15'))(_0x2590('0x16'));var utils=require(_0x2590('0x17'));var config=require(_0x2590('0x18'));var licenseUtil=require(_0x2590('0x19'));var db=require(_0x2590('0x1a'))['db'];function respondWithStatusCode(_0x1aa042,_0x5c42aa){_0x5c42aa=_0x5c42aa||0xcc;return function(_0x3589da){if(_0x3589da){return _0x1aa042['sendStatus'](_0x5c42aa);}return _0x1aa042['status'](_0x5c42aa)[_0x2590('0x1b')]();};}function respondWithResult(_0x571d5f,_0x441fea){_0x441fea=_0x441fea||0xc8;return function(_0x2d0011){if(_0x2d0011){return _0x571d5f[_0x2590('0x1c')](_0x441fea)[_0x2590('0x1d')](_0x2d0011);}};}function respondWithFilteredResult(_0x56da70,_0x573e6a){return function(_0x4c2af3){if(_0x4c2af3){var _0x2a7977=typeof _0x573e6a[_0x2590('0x1e')]===_0x2590('0x1f')&&typeof _0x573e6a[_0x2590('0x20')]==='undefined';var _0x1dba43=_0x4c2af3[_0x2590('0x21')];var _0xe3ef0e=_0x2a7977?0x0:_0x573e6a['offset'];var _0x5054fc=_0x2a7977?_0x4c2af3[_0x2590('0x21')]:_0x573e6a['offset']+_0x573e6a['limit'];var _0x43bac7;if(_0x5054fc>=_0x1dba43){_0x5054fc=_0x1dba43;_0x43bac7=0xc8;}else{_0x43bac7=0xce;}_0x56da70['status'](_0x43bac7);return _0x56da70['set'](_0x2590('0x22'),_0xe3ef0e+'-'+_0x5054fc+'/'+_0x1dba43)['json'](_0x4c2af3);}return null;};}function patchUpdates(_0x57a236){return function(_0xf60644){try{jsonpatch[_0x2590('0x23')](_0xf60644,_0x57a236,!![]);}catch(_0x23b3b8){return BPromise[_0x2590('0x24')](_0x23b3b8);}return _0xf60644['save']();};}function saveUpdates(_0x2a2c22,_0x56f547){return function(_0x5d22ea){if(_0x5d22ea){return _0x5d22ea['update'](_0x2a2c22)[_0x2590('0x25')](function(_0x116d68){return _0x116d68;});}return null;};}function removeEntity(_0x5347e8,_0x51c760){return function(_0xdcc45e){if(_0xdcc45e){return _0xdcc45e[_0x2590('0x26')]()[_0x2590('0x25')](function(){_0x5347e8[_0x2590('0x1c')](0xcc)[_0x2590('0x1b')]();});}};}function handleEntityNotFound(_0x99c332,_0x2baeca){return function(_0x1b4009){if(!_0x1b4009){_0x99c332['sendStatus'](0x194);}return _0x1b4009;};}function handleError(_0x4b613c,_0x425a0e){_0x425a0e=_0x425a0e||0x1f4;return function(_0x4600cf){logger[_0x2590('0x27')](_0x4600cf[_0x2590('0x28')]);if(_0x4600cf['name']){delete _0x4600cf[_0x2590('0x29')];}_0x4b613c['status'](_0x425a0e)[_0x2590('0x2a')](_0x4600cf);};}exports['index']=function(_0x485b72,_0x303415){var _0x3c2ab9={},_0x553846={},_0x214fbf={'count':0x0,'rows':[]};var _0x30f694=_[_0x2590('0x2b')](db[_0x2590('0x2c')][_0x2590('0x2d')],function(_0x4ea5c0){return{'name':_0x4ea5c0['fieldName'],'type':_0x4ea5c0[_0x2590('0x2e')][_0x2590('0x2f')]};});_0x553846['model']=_[_0x2590('0x2b')](_0x30f694,_0x2590('0x29'));_0x553846[_0x2590('0x30')]=_[_0x2590('0x31')](_0x485b72[_0x2590('0x30')]);_0x553846[_0x2590('0x32')]=_[_0x2590('0x33')](_0x553846['model'],_0x553846[_0x2590('0x30')]);_0x3c2ab9[_0x2590('0x34')]=_[_0x2590('0x33')](_0x553846[_0x2590('0x35')],qs[_0x2590('0x36')](_0x485b72['query'][_0x2590('0x36')]));_0x3c2ab9[_0x2590('0x34')]=_0x3c2ab9[_0x2590('0x34')][_0x2590('0x37')]?_0x3c2ab9[_0x2590('0x34')]:_0x553846[_0x2590('0x35')];if(!_0x485b72['query'][_0x2590('0x38')]('nolimit')){_0x3c2ab9['limit']=qs[_0x2590('0x20')](_0x485b72['query'][_0x2590('0x20')]);_0x3c2ab9[_0x2590('0x1e')]=qs[_0x2590('0x1e')](_0x485b72[_0x2590('0x30')][_0x2590('0x1e')]);}_0x3c2ab9[_0x2590('0x39')]=qs[_0x2590('0x3a')](_0x485b72[_0x2590('0x30')][_0x2590('0x3a')]);_0x3c2ab9[_0x2590('0x3b')]=qs[_0x2590('0x32')](_[_0x2590('0x3c')](_0x485b72[_0x2590('0x30')],_0x553846[_0x2590('0x32')]),_0x30f694);if(_0x485b72[_0x2590('0x30')]['filter']){_0x3c2ab9[_0x2590('0x3b')]=_[_0x2590('0x3d')](_0x3c2ab9[_0x2590('0x3b')],{'$or':_[_0x2590('0x2b')](_0x30f694,function(_0x35831d){if(_0x35831d[_0x2590('0x2e')]!=='VIRTUAL'){var _0x102c6d={};_0x102c6d[_0x35831d[_0x2590('0x29')]]={'$like':'%'+_0x485b72[_0x2590('0x30')][_0x2590('0x3e')]+'%'};return _0x102c6d;}})});}_0x3c2ab9=_['merge']({},_0x3c2ab9,_0x485b72[_0x2590('0x3f')]);var _0x12e5af={'where':_0x3c2ab9[_0x2590('0x3b')]};return db[_0x2590('0x2c')][_0x2590('0x21')](_0x12e5af)[_0x2590('0x25')](function(_0x40cb2c){_0x214fbf[_0x2590('0x21')]=_0x40cb2c;if(_0x485b72[_0x2590('0x30')]['includeAll']){_0x3c2ab9[_0x2590('0x40')]=[{'all':!![]}];}return db[_0x2590('0x2c')]['findAll'](_0x3c2ab9);})[_0x2590('0x25')](function(_0x394a36){_0x214fbf[_0x2590('0x41')]=_0x394a36;return _0x214fbf;})[_0x2590('0x25')](respondWithFilteredResult(_0x303415,_0x3c2ab9))[_0x2590('0x42')](handleError(_0x303415,null));};exports[_0x2590('0x43')]=function(_0x409dea,_0x217f52){var _0x2de15b={'raw':!![],'where':{'id':_0x409dea[_0x2590('0x44')]['id']}},_0x2f357f={};_0x2f357f['model']=_['keys'](db[_0x2590('0x2c')]['rawAttributes']);_0x2f357f['query']=_[_0x2590('0x31')](_0x409dea[_0x2590('0x30')]);_0x2f357f[_0x2590('0x32')]=_[_0x2590('0x33')](_0x2f357f[_0x2590('0x35')],_0x2f357f['query']);_0x2de15b[_0x2590('0x34')]=_['intersection'](_0x2f357f[_0x2590('0x35')],qs[_0x2590('0x36')](_0x409dea[_0x2590('0x30')][_0x2590('0x36')]));_0x2de15b[_0x2590('0x34')]=_0x2de15b[_0x2590('0x34')][_0x2590('0x37')]?_0x2de15b[_0x2590('0x34')]:_0x2f357f[_0x2590('0x35')];if(_0x409dea['query']['includeAll']){_0x2de15b[_0x2590('0x40')]=[{'all':!![]}];}_0x2de15b=_['merge']({},_0x2de15b,_0x409dea[_0x2590('0x3f')]);return db[_0x2590('0x2c')][_0x2590('0x45')](_0x2de15b)[_0x2590('0x25')](handleEntityNotFound(_0x217f52,null))[_0x2590('0x25')](respondWithResult(_0x217f52,null))[_0x2590('0x42')](handleError(_0x217f52,null));};exports['create']=function(_0x4ebd12,_0x4988c4){return db['SmsApplication']['create'](_0x4ebd12['body'],{})['then'](respondWithResult(_0x4988c4,0xc9))['catch'](handleError(_0x4988c4,null));};exports['update']=function(_0x5688cd,_0x30ca77){if(_0x5688cd[_0x2590('0x46')]['id']){delete _0x5688cd[_0x2590('0x46')]['id'];}return db[_0x2590('0x2c')][_0x2590('0x45')]({'where':{'id':_0x5688cd['params']['id']}})['then'](handleEntityNotFound(_0x30ca77,null))[_0x2590('0x25')](saveUpdates(_0x5688cd['body'],null))[_0x2590('0x25')](respondWithResult(_0x30ca77,null))[_0x2590('0x42')](handleError(_0x30ca77,null));};exports[_0x2590('0x26')]=function(_0x1a046f,_0x3fb546){return db[_0x2590('0x2c')][_0x2590('0x45')]({'where':{'id':_0x1a046f[_0x2590('0x44')]['id']}})[_0x2590('0x25')](handleEntityNotFound(_0x3fb546,null))[_0x2590('0x25')](removeEntity(_0x3fb546,null))['catch'](handleError(_0x3fb546,null));}; \ No newline at end of file +var _0xc4a9=['findAll','rows','catch','show','params','attributes','merge','find','create','body','destroy','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','error','stack','name','send','map','SmsApplication','rawAttributes','fieldName','type','model','query','keys','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','VIRTUAL','options','includeAll','include'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xc4a9,0x16e));var _0x9c4a=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0xc4a9[_0x16d10f];return _0x50c823;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9c4a('0x0'));var zipdir=require(_0x9c4a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9c4a('0x2'));var moment=require(_0x9c4a('0x3'));var BPromise=require(_0x9c4a('0x4'));var Mustache=require(_0x9c4a('0x5'));var util=require(_0x9c4a('0x6'));var path=require('path');var sox=require(_0x9c4a('0x7'));var csv=require(_0x9c4a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9c4a('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x9c4a('0xa'));var jsforce=require(_0x9c4a('0xb'));var deskjs=require(_0x9c4a('0xc'));var toCsv=require(_0x9c4a('0x8'));var querystring=require(_0x9c4a('0xd'));var Papa=require(_0x9c4a('0xe'));var Redis=require(_0x9c4a('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9c4a('0x10'));var hardwareService=require(_0x9c4a('0x11'));var logger=require('../../config/logger')(_0x9c4a('0x12'));var utils=require(_0x9c4a('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9c4a('0x14'))['db'];function respondWithStatusCode(_0xdf928c,_0x1a9581){_0x1a9581=_0x1a9581||0xcc;return function(_0x115b58){if(_0x115b58){return _0xdf928c[_0x9c4a('0x15')](_0x1a9581);}return _0xdf928c['status'](_0x1a9581)[_0x9c4a('0x16')]();};}function respondWithResult(_0x138cca,_0x1b6841){_0x1b6841=_0x1b6841||0xc8;return function(_0x3a1b52){if(_0x3a1b52){return _0x138cca[_0x9c4a('0x17')](_0x1b6841)[_0x9c4a('0x18')](_0x3a1b52);}};}function respondWithFilteredResult(_0x31afb2,_0x3dec90){return function(_0x2debd4){if(_0x2debd4){var _0x1a5dd0=typeof _0x3dec90['offset']===_0x9c4a('0x19')&&typeof _0x3dec90[_0x9c4a('0x1a')]===_0x9c4a('0x19');var _0x5a5f08=_0x2debd4[_0x9c4a('0x1b')];var _0xbdd52b=_0x1a5dd0?0x0:_0x3dec90[_0x9c4a('0x1c')];var _0x4b2dbc=_0x1a5dd0?_0x2debd4[_0x9c4a('0x1b')]:_0x3dec90[_0x9c4a('0x1c')]+_0x3dec90[_0x9c4a('0x1a')];var _0x3ecb65;if(_0x4b2dbc>=_0x5a5f08){_0x4b2dbc=_0x5a5f08;_0x3ecb65=0xc8;}else{_0x3ecb65=0xce;}_0x31afb2[_0x9c4a('0x17')](_0x3ecb65);return _0x31afb2[_0x9c4a('0x1d')](_0x9c4a('0x1e'),_0xbdd52b+'-'+_0x4b2dbc+'/'+_0x5a5f08)[_0x9c4a('0x18')](_0x2debd4);}return null;};}function patchUpdates(_0x418d0e){return function(_0x6b78f6){try{jsonpatch['apply'](_0x6b78f6,_0x418d0e,!![]);}catch(_0x2523a6){return BPromise[_0x9c4a('0x1f')](_0x2523a6);}return _0x6b78f6[_0x9c4a('0x20')]();};}function saveUpdates(_0x39e375,_0x4cc2ee){return function(_0x2f9d16){if(_0x2f9d16){return _0x2f9d16[_0x9c4a('0x21')](_0x39e375)[_0x9c4a('0x22')](function(_0x159e57){return _0x159e57;});}return null;};}function removeEntity(_0x351332,_0x3fc4d7){return function(_0x11bd90){if(_0x11bd90){return _0x11bd90['destroy']()[_0x9c4a('0x22')](function(){_0x351332[_0x9c4a('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0xeb5f03,_0x2b088a){return function(_0xcbad8a){if(!_0xcbad8a){_0xeb5f03['sendStatus'](0x194);}return _0xcbad8a;};}function handleError(_0x4e8496,_0x1e091e){_0x1e091e=_0x1e091e||0x1f4;return function(_0x36a461){logger[_0x9c4a('0x23')](_0x36a461[_0x9c4a('0x24')]);if(_0x36a461[_0x9c4a('0x25')]){delete _0x36a461[_0x9c4a('0x25')];}_0x4e8496[_0x9c4a('0x17')](_0x1e091e)[_0x9c4a('0x26')](_0x36a461);};}exports['index']=function(_0x382de0,_0x50b009){var _0x3383e0={},_0x15f59f={},_0x35c5ef={'count':0x0,'rows':[]};var _0x3cc728=_[_0x9c4a('0x27')](db[_0x9c4a('0x28')][_0x9c4a('0x29')],function(_0x4a7979){return{'name':_0x4a7979[_0x9c4a('0x2a')],'type':_0x4a7979[_0x9c4a('0x2b')]['key']};});_0x15f59f[_0x9c4a('0x2c')]=_[_0x9c4a('0x27')](_0x3cc728,'name');_0x15f59f[_0x9c4a('0x2d')]=_[_0x9c4a('0x2e')](_0x382de0[_0x9c4a('0x2d')]);_0x15f59f['filters']=_[_0x9c4a('0x2f')](_0x15f59f[_0x9c4a('0x2c')],_0x15f59f[_0x9c4a('0x2d')]);_0x3383e0['attributes']=_[_0x9c4a('0x2f')](_0x15f59f[_0x9c4a('0x2c')],qs['fields'](_0x382de0[_0x9c4a('0x2d')][_0x9c4a('0x30')]));_0x3383e0['attributes']=_0x3383e0['attributes'][_0x9c4a('0x31')]?_0x3383e0['attributes']:_0x15f59f[_0x9c4a('0x2c')];if(!_0x382de0[_0x9c4a('0x2d')][_0x9c4a('0x32')](_0x9c4a('0x33'))){_0x3383e0['limit']=qs[_0x9c4a('0x1a')](_0x382de0['query'][_0x9c4a('0x1a')]);_0x3383e0[_0x9c4a('0x1c')]=qs[_0x9c4a('0x1c')](_0x382de0[_0x9c4a('0x2d')]['offset']);}_0x3383e0['order']=qs[_0x9c4a('0x34')](_0x382de0[_0x9c4a('0x2d')][_0x9c4a('0x34')]);_0x3383e0[_0x9c4a('0x35')]=qs[_0x9c4a('0x36')](_['pick'](_0x382de0[_0x9c4a('0x2d')],_0x15f59f[_0x9c4a('0x36')]),_0x3cc728);if(_0x382de0['query'][_0x9c4a('0x37')]){_0x3383e0[_0x9c4a('0x35')]=_['merge'](_0x3383e0[_0x9c4a('0x35')],{'$or':_[_0x9c4a('0x27')](_0x3cc728,function(_0xaa4e00){if(_0xaa4e00[_0x9c4a('0x2b')]!==_0x9c4a('0x38')){var _0x3a7550={};_0x3a7550[_0xaa4e00['name']]={'$like':'%'+_0x382de0['query'][_0x9c4a('0x37')]+'%'};return _0x3a7550;}})});}_0x3383e0=_['merge']({},_0x3383e0,_0x382de0[_0x9c4a('0x39')]);var _0x4ac21a={'where':_0x3383e0[_0x9c4a('0x35')]};return db[_0x9c4a('0x28')]['count'](_0x4ac21a)[_0x9c4a('0x22')](function(_0x38a084){_0x35c5ef['count']=_0x38a084;if(_0x382de0[_0x9c4a('0x2d')][_0x9c4a('0x3a')]){_0x3383e0[_0x9c4a('0x3b')]=[{'all':!![]}];}return db[_0x9c4a('0x28')][_0x9c4a('0x3c')](_0x3383e0);})[_0x9c4a('0x22')](function(_0x323b80){_0x35c5ef[_0x9c4a('0x3d')]=_0x323b80;return _0x35c5ef;})[_0x9c4a('0x22')](respondWithFilteredResult(_0x50b009,_0x3383e0))[_0x9c4a('0x3e')](handleError(_0x50b009,null));};exports[_0x9c4a('0x3f')]=function(_0x52d85d,_0xf6396f){var _0x119b90={'raw':!![],'where':{'id':_0x52d85d[_0x9c4a('0x40')]['id']}},_0x3cb0bc={};_0x3cb0bc[_0x9c4a('0x2c')]=_[_0x9c4a('0x2e')](db[_0x9c4a('0x28')][_0x9c4a('0x29')]);_0x3cb0bc[_0x9c4a('0x2d')]=_[_0x9c4a('0x2e')](_0x52d85d['query']);_0x3cb0bc[_0x9c4a('0x36')]=_[_0x9c4a('0x2f')](_0x3cb0bc[_0x9c4a('0x2c')],_0x3cb0bc[_0x9c4a('0x2d')]);_0x119b90['attributes']=_[_0x9c4a('0x2f')](_0x3cb0bc[_0x9c4a('0x2c')],qs[_0x9c4a('0x30')](_0x52d85d[_0x9c4a('0x2d')][_0x9c4a('0x30')]));_0x119b90[_0x9c4a('0x41')]=_0x119b90[_0x9c4a('0x41')]['length']?_0x119b90[_0x9c4a('0x41')]:_0x3cb0bc[_0x9c4a('0x2c')];if(_0x52d85d[_0x9c4a('0x2d')][_0x9c4a('0x3a')]){_0x119b90[_0x9c4a('0x3b')]=[{'all':!![]}];}_0x119b90=_[_0x9c4a('0x42')]({},_0x119b90,_0x52d85d[_0x9c4a('0x39')]);return db[_0x9c4a('0x28')][_0x9c4a('0x43')](_0x119b90)['then'](handleEntityNotFound(_0xf6396f,null))[_0x9c4a('0x22')](respondWithResult(_0xf6396f,null))[_0x9c4a('0x3e')](handleError(_0xf6396f,null));};exports[_0x9c4a('0x44')]=function(_0x87fb95,_0x13f38f){return db[_0x9c4a('0x28')][_0x9c4a('0x44')](_0x87fb95['body'],{})['then'](respondWithResult(_0x13f38f,0xc9))[_0x9c4a('0x3e')](handleError(_0x13f38f,null));};exports['update']=function(_0x2a0342,_0x5b2e16){if(_0x2a0342['body']['id']){delete _0x2a0342['body']['id'];}return db[_0x9c4a('0x28')][_0x9c4a('0x43')]({'where':{'id':_0x2a0342[_0x9c4a('0x40')]['id']}})[_0x9c4a('0x22')](handleEntityNotFound(_0x5b2e16,null))['then'](saveUpdates(_0x2a0342[_0x9c4a('0x45')],null))[_0x9c4a('0x22')](respondWithResult(_0x5b2e16,null))[_0x9c4a('0x3e')](handleError(_0x5b2e16,null));};exports[_0x9c4a('0x46')]=function(_0x15be26,_0x1f7dc9){return db[_0x9c4a('0x28')][_0x9c4a('0x43')]({'where':{'id':_0x15be26[_0x9c4a('0x40')]['id']}})[_0x9c4a('0x22')](handleEntityNotFound(_0x1f7dc9,null))['then'](removeEntity(_0x1f7dc9,null))['catch'](handleError(_0x1f7dc9,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 57e6583..2d5d58a 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 _0x4cc6=['SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./smsApplication.attributes','exports','define'];(function(_0xcf2962,_0x1acbed){var _0x5d3089=function(_0xb19998){while(--_0xb19998){_0xcf2962['push'](_0xcf2962['shift']());}};_0x5d3089(++_0x1acbed);}(_0x4cc6,0x164));var _0x64cc=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x4cc6[_0xb0f7c3];return _0x28ea68;};'use strict';var _=require(_0x64cc('0x0'));var util=require(_0x64cc('0x1'));var logger=require(_0x64cc('0x2'))(_0x64cc('0x3'));var moment=require(_0x64cc('0x4'));var BPromise=require(_0x64cc('0x5'));var rp=require(_0x64cc('0x6'));var fs=require('fs');var path=require(_0x64cc('0x7'));var rimraf=require('rimraf');var config=require(_0x64cc('0x8'));var attributes=require(_0x64cc('0x9'));module[_0x64cc('0xa')]=function(_0x1eb3ad,_0x1bfe37){return _0x1eb3ad[_0x64cc('0xb')](_0x64cc('0xc'),attributes,{'tableName':_0x64cc('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x64cc('0xe'),'collate':_0x64cc('0xf')});}; \ No newline at end of file +var _0x2229=['exports','sms_applications','utf8mb4_unicode_ci','lodash','util','moment','request-promise','path','rimraf','../../config/environment','./smsApplication.attributes'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2229,0x163));var _0x9222=function(_0x44769c,_0x4b2cc6){_0x44769c=_0x44769c-0x0;var _0x216eb5=_0x2229[_0x44769c];return _0x216eb5;};'use strict';var _=require(_0x9222('0x0'));var util=require(_0x9222('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x9222('0x2'));var BPromise=require('bluebird');var rp=require(_0x9222('0x3'));var fs=require('fs');var path=require(_0x9222('0x4'));var rimraf=require(_0x9222('0x5'));var config=require(_0x9222('0x6'));var attributes=require(_0x9222('0x7'));module[_0x9222('0x8')]=function(_0x1646ee,_0x510af8){return _0x1646ee['define']('SmsApplication',attributes,{'tableName':_0x9222('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x9222('0xa')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 1cdb08e..c2509b1 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 _0x014c=['bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','util'];(function(_0x5ec432,_0x494071){var _0x3c3239=function(_0x1d2869){while(--_0x1d2869){_0x5ec432['push'](_0x5ec432['shift']());}};_0x3c3239(++_0x494071);}(_0x014c,0x17b));var _0xc014=function(_0x1b5a05,_0x2c80de){_0x1b5a05=_0x1b5a05-0x0;var _0x347931=_0x014c[_0x1b5a05];return _0x347931;};'use strict';var _=require('lodash');var util=require(_0xc014('0x0'));var moment=require('moment');var BPromise=require(_0xc014('0x1'));var rs=require(_0xc014('0x2'));var fs=require('fs');var Redis=require(_0xc014('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc014('0x4'))(_0xc014('0x5'));var config=require(_0xc014('0x6'));var jayson=require(_0xc014('0x7'));var client=jayson[_0xc014('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x398960,_0x367c5c,_0x5785d1){return new BPromise(function(_0x175bdb,_0x52139f){return client[_0xc014('0x9')](_0x398960,_0x5785d1)[_0xc014('0xa')](function(_0x5701db){logger['info'](_0xc014('0xb'),_0x367c5c,_0xc014('0xc'));logger[_0xc014('0xd')](_0xc014('0xe'),_0x367c5c,'request\x20sent',JSON[_0xc014('0xf')](_0x5701db));if(_0x5701db['error']){if(_0x5701db[_0xc014('0x10')]['code']===0x1f4){logger[_0xc014('0x10')](_0xc014('0xb'),_0x367c5c,_0x5701db[_0xc014('0x10')][_0xc014('0x11')]);return _0x52139f(_0x5701db['error'][_0xc014('0x11')]);}logger[_0xc014('0x10')](_0xc014('0xb'),_0x367c5c,_0x5701db['error'][_0xc014('0x11')]);return _0x175bdb(_0x5701db['error'][_0xc014('0x11')]);}else{logger[_0xc014('0x12')](_0xc014('0xb'),_0x367c5c,_0xc014('0xc'));_0x175bdb(_0x5701db[_0xc014('0x13')][_0xc014('0x11')]);}})['catch'](function(_0x462650){logger[_0xc014('0x10')](_0xc014('0xb'),_0x367c5c,_0x462650);_0x52139f(_0x462650);});});} \ No newline at end of file +var _0xb1ef=['info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then'];(function(_0x7417ac,_0x29f486){var _0x24407e=function(_0x5a8e25){while(--_0x5a8e25){_0x7417ac['push'](_0x7417ac['shift']());}};_0x24407e(++_0x29f486);}(_0xb1ef,0x93));var _0xfb1e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb1ef[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xfb1e('0x0'));var util=require(_0xfb1e('0x1'));var moment=require('moment');var BPromise=require(_0xfb1e('0x2'));var rs=require(_0xfb1e('0x3'));var fs=require('fs');var Redis=require(_0xfb1e('0x4'));var db=require(_0xfb1e('0x5'))['db'];var utils=require(_0xfb1e('0x6'));var logger=require(_0xfb1e('0x7'))(_0xfb1e('0x8'));var config=require(_0xfb1e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xfb1e('0xa')][_0xfb1e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1455fa,_0xccf70,_0x502d8e){return new BPromise(function(_0x5eadcc,_0x3c7643){return client[_0xfb1e('0xc')](_0x1455fa,_0x502d8e)[_0xfb1e('0xd')](function(_0x1ac2dd){logger[_0xfb1e('0xe')](_0xfb1e('0xf'),_0xccf70,_0xfb1e('0x10'));logger[_0xfb1e('0x11')]('SmsApplication,\x20%s,\x20%s,\x20%s',_0xccf70,_0xfb1e('0x10'),JSON[_0xfb1e('0x12')](_0x1ac2dd));if(_0x1ac2dd[_0xfb1e('0x13')]){if(_0x1ac2dd[_0xfb1e('0x13')][_0xfb1e('0x14')]===0x1f4){logger[_0xfb1e('0x13')](_0xfb1e('0xf'),_0xccf70,_0x1ac2dd['error'][_0xfb1e('0x15')]);return _0x3c7643(_0x1ac2dd[_0xfb1e('0x13')]['message']);}logger[_0xfb1e('0x13')](_0xfb1e('0xf'),_0xccf70,_0x1ac2dd[_0xfb1e('0x13')][_0xfb1e('0x15')]);return _0x5eadcc(_0x1ac2dd[_0xfb1e('0x13')]['message']);}else{logger[_0xfb1e('0xe')](_0xfb1e('0xf'),_0xccf70,_0xfb1e('0x10'));_0x5eadcc(_0x1ac2dd[_0xfb1e('0x16')][_0xfb1e('0x15')]);}})['catch'](function(_0x2f3d7e){logger[_0xfb1e('0x13')](_0xfb1e('0xf'),_0xccf70,_0x2f3d7e);_0x3c7643(_0x2f3d7e);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 042e74e..4d10259 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 _0x13f6=['isAuthenticated','index','get','/:id','show','/:id/messages','getMessages','/:id/download','download','create','addMessage','post','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','update','delete','smsinteraction:destroy','destroy','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsInteraction.controller'];(function(_0xcefeee,_0x4374b5){var _0x1d7f3b=function(_0x47ef29){while(--_0x47ef29){_0xcefeee['push'](_0xcefeee['shift']());}};_0x1d7f3b(++_0x4374b5);}(_0x13f6,0x124));var _0x613f=function(_0x6a7eb3,_0x2401b0){_0x6a7eb3=_0x6a7eb3-0x0;var _0x4b58a4=_0x13f6[_0x6a7eb3];return _0x4b58a4;};'use strict';var multer=require(_0x613f('0x0'));var util=require(_0x613f('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x613f('0x2'));var router=express[_0x613f('0x3')]();var fs_extra=require(_0x613f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x613f('0x5'));var config=require(_0x613f('0x6'));var controller=require(_0x613f('0x7'));router['get']('/',auth[_0x613f('0x8')](),controller[_0x613f('0x9')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x613f('0xa')](_0x613f('0xb'),auth[_0x613f('0x8')](),controller[_0x613f('0xc')]);router['get'](_0x613f('0xd'),auth[_0x613f('0x8')](),controller[_0x613f('0xe')]);router['get'](_0x613f('0xf'),auth[_0x613f('0x8')](),controller[_0x613f('0x10')]);router['post']('/',auth[_0x613f('0x8')](),controller[_0x613f('0x11')]);router['post']('/:id/messages',auth['isAuthenticated'](),controller[_0x613f('0x12')]);router[_0x613f('0x13')](_0x613f('0x14'),auth[_0x613f('0x8')](),interaction[_0x613f('0x15')](_0x613f('0x16'),_0x613f('0x17')),controller[_0x613f('0x18')]);router[_0x613f('0x19')](_0x613f('0xb'),auth['isAuthenticated'](),interaction[_0x613f('0x15')]('sms','smsinteraction:update'),controller[_0x613f('0x1a')]);router[_0x613f('0x1b')]('/:id',auth[_0x613f('0x8')](),interaction['tracked'](_0x613f('0x16'),_0x613f('0x1c')),controller[_0x613f('0x1d')]);router[_0x613f('0x1b')](_0x613f('0x14'),auth[_0x613f('0x8')](),controller['removeTags']);module['exports']=router; \ No newline at end of file +var _0x757a=['smsinteraction:update','delete','smsinteraction:destroy','destroy','/:id/tags','removeTags','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','index','isAuthenticated','describe','/:id','/:id/messages','getMessages','/:id/download','post','tracked','sms','smsinteraction:addtags','addTags','put'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x757a,0xde));var _0xa757=function(_0x3d508b,_0x145f0f){_0x3d508b=_0x3d508b-0x0;var _0x193e60=_0x757a[_0x3d508b];return _0x193e60;};'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')]('/describe',auth[_0xa757('0x9')](),controller[_0xa757('0xa')]);router[_0xa757('0x7')](_0xa757('0xb'),auth[_0xa757('0x9')](),controller['show']);router[_0xa757('0x7')](_0xa757('0xc'),auth[_0xa757('0x9')](),controller[_0xa757('0xd')]);router[_0xa757('0x7')](_0xa757('0xe'),auth[_0xa757('0x9')](),controller['download']);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xa757('0xc'),auth['isAuthenticated'](),controller['addMessage']);router[_0xa757('0xf')]('/:id/tags',auth['isAuthenticated'](),interaction[_0xa757('0x10')](_0xa757('0x11'),_0xa757('0x12')),controller[_0xa757('0x13')]);router[_0xa757('0x14')](_0xa757('0xb'),auth[_0xa757('0x9')](),interaction[_0xa757('0x10')](_0xa757('0x11'),_0xa757('0x15')),controller['update']);router[_0xa757('0x16')](_0xa757('0xb'),auth[_0xa757('0x9')](),interaction['tracked']('sms',_0xa757('0x17')),controller[_0xa757('0x18')]);router[_0xa757('0x16')](_0xa757('0x19'),auth[_0xa757('0x9')](),controller[_0xa757('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 9ad2603..1d92aaf 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 _0x88c7=['STRING','ENUM','INTEGER','sequelize','BOOLEAN','DATE'];(function(_0x57456d,_0x178cde){var _0x97377b=function(_0x2f5260){while(--_0x2f5260){_0x57456d['push'](_0x57456d['shift']());}};_0x97377b(++_0x178cde);}(_0x88c7,0x6f));var _0x788c=function(_0x32349a,_0x5d92df){_0x32349a=_0x32349a-0x0;var _0x2aa9f0=_0x88c7[_0x32349a];return _0x2aa9f0;};'use strict';var Sequelize=require(_0x788c('0x0'));var moment=require('moment');module['exports']={'closed':{'type':Sequelize[_0x788c('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x788c('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x788c('0x3')]},'note':{'type':Sequelize[_0x788c('0x3')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x788c('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x788c('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x788c('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x788c('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize[_0x788c('0x5')]}}; \ No newline at end of file +var _0x9458=['out','BOOLEAN','exports','STRING','DATE','ENUM'];(function(_0x36b7fd,_0xf6ba68){var _0x351006=function(_0x462656){while(--_0x462656){_0x36b7fd['push'](_0x36b7fd['shift']());}};_0x351006(++_0xf6ba68);}(_0x9458,0x1b8));var _0x8945=function(_0x3efad4,_0x34794c){_0x3efad4=_0x3efad4-0x0;var _0x5343ac=_0x9458[_0x3efad4];return _0x5343ac;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x8945('0x0')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x8945('0x1')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x8945('0x1')]},'note':{'type':Sequelize[_0x8945('0x1')]},'phone':{'type':Sequelize[_0x8945('0x1')]},'read1stAt':{'type':Sequelize[_0x8945('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x8945('0x3')]('in',_0x8945('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x8945('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x8945('0x3')]('in',_0x8945('0x4')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x8945('0x5')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 7b3e223..d0df81b 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 _0x6c14=['redis','defaults','socket.io-emitter','./smsInteraction.socket','register','status','end','offset','undefined','limit','count','json','sendStatus','error','name','map','rawAttributes','fieldName','getOptions','findAll','user','then','catch','show','params','model','query','filters','intersection','attributes','fields','includeAll','include','merge','options','SmsInteraction','find','create','body','destroy','describe','addMessage','omit','ids','getMessages','keys','SmsMessage','length','hasOwnProperty','order','sort','where','pick','filter','$gte','split','rows','addTags','setTags','spread','smsInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','tmp','format','transcript-%d-%s.zip','User','fullname','push','Contact','firstName','createdAt','direction','secret','read','Account','Owner','get','mkdirSync','Sms','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','disposition','System','value','renderFile','views','.pdf','createPdfFromHTML','log','err','unlinkSync','rimraf','zip-dir','moment','bluebird','lodash','ioredis','../../components/interaction/service','../../config/logger','api','../../config/environment','../../mysqldb'];(function(_0x2424c2,_0x31d785){var _0x38dc80=function(_0x318ef2){while(--_0x318ef2){_0x2424c2['push'](_0x2424c2['shift']());}};_0x38dc80(++_0x31d785);}(_0x6c14,0x13f));var _0x46c1=function(_0x3f6e47,_0x2aef2d){_0x3f6e47=_0x3f6e47-0x0;var _0x4bd2a8=_0x6c14[_0x3f6e47];return _0x4bd2a8;};'use strict';var rimraf=require(_0x46c1('0x0'));var zipdir=require(_0x46c1('0x1'));var moment=require(_0x46c1('0x2'));var BPromise=require(_0x46c1('0x3'));var util=require('util');var path=require('path');var ejs=require('ejs');var fs=require('fs');var _=require(_0x46c1('0x4'));var Redis=require(_0x46c1('0x5'));var interaction=require(_0x46c1('0x6'));var qs=require('../../components/parsers/qs');var pdf=require('../../components/export/pdf');var logger=require(_0x46c1('0x7'))(_0x46c1('0x8'));var config=require(_0x46c1('0x9'));var db=require(_0x46c1('0xa'))['db'];config[_0x46c1('0xb')]=_[_0x46c1('0xc')](config[_0x46c1('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x46c1('0xd'))(new Redis(config['redis']));require(_0x46c1('0xe'))[_0x46c1('0xf')](socket);function respondWithStatusCode(_0x4c3d27,_0x50ea2a){_0x50ea2a=_0x50ea2a||0xcc;return function(_0x33b1eb){if(_0x33b1eb){return _0x4c3d27['sendStatus'](_0x50ea2a);}return _0x4c3d27[_0x46c1('0x10')](_0x50ea2a)[_0x46c1('0x11')]();};}function respondWithResult(_0x3f7dc5,_0x48f812){_0x48f812=_0x48f812||0xc8;return function(_0x23284e){if(_0x23284e){return _0x3f7dc5['status'](_0x48f812)['json'](_0x23284e);}};}function respondWithFilteredResult(_0x2832ee,_0x27a700){return function(_0xf8be65){if(_0xf8be65){var _0x26eebe=typeof _0x27a700[_0x46c1('0x12')]===_0x46c1('0x13')&&typeof _0x27a700[_0x46c1('0x14')]===_0x46c1('0x13');var _0x29ea4a=_0xf8be65[_0x46c1('0x15')];var _0x297403=_0x26eebe?0x0:_0x27a700[_0x46c1('0x12')];var _0x4a4e55=_0x26eebe?_0xf8be65[_0x46c1('0x15')]:_0x27a700[_0x46c1('0x12')]+_0x27a700[_0x46c1('0x14')];var _0x2c07fd;if(_0x4a4e55>=_0x29ea4a){_0x4a4e55=_0x29ea4a;_0x2c07fd=0xc8;}else{_0x2c07fd=0xce;}_0x2832ee[_0x46c1('0x10')](_0x2c07fd);return _0x2832ee['set']('Content-Range',_0x297403+'-'+_0x4a4e55+'/'+_0x29ea4a)[_0x46c1('0x16')](_0xf8be65);}return null;};}function saveUpdates(_0x4ad95b){return function(_0x1afcf4){if(_0x1afcf4){return _0x1afcf4['update'](_0x4ad95b)['then'](function(_0x590716){return _0x590716;});}return null;};}function removeEntity(_0x2c9a7c){return function(_0x4b8947){if(_0x4b8947){return _0x4b8947['destroy']()['then'](function(){_0x2c9a7c[_0x46c1('0x10')](0xcc)[_0x46c1('0x11')]();});}};}function handleEntityNotFound(_0x116062){return function(_0x3210c8){if(!_0x3210c8){_0x116062[_0x46c1('0x17')](0x194);}return _0x3210c8;};}function handleError(_0x4e4083,_0x27fedd){_0x27fedd=_0x27fedd||0x1f4;return function(_0x598122){logger[_0x46c1('0x18')](_0x598122['stack']);if(_0x598122[_0x46c1('0x19')]){delete _0x598122[_0x46c1('0x19')];}_0x4e4083[_0x46c1('0x10')](_0x27fedd)['send'](_0x598122);};}exports['index']=function(_0x1dd9e9,_0x4ba832){var _0x282d4f={};var _0x2cc5f6=_[_0x46c1('0x1a')](db['SmsInteraction'][_0x46c1('0x1b')],function(_0x1499a9){return{'name':_0x1499a9[_0x46c1('0x1c')],'type':_0x1499a9['type']['key']};});_0x282d4f=qs[_0x46c1('0x1d')](_0x2cc5f6,_0x1dd9e9);return interaction[_0x46c1('0x1e')]('sms',_0x1dd9e9['query'],_0x1dd9e9[_0x46c1('0x1f')],_0x282d4f,_0x2cc5f6)[_0x46c1('0x20')](respondWithFilteredResult(_0x4ba832,_0x282d4f))[_0x46c1('0x21')](handleError(_0x4ba832,null));};exports[_0x46c1('0x22')]=function(_0x6d5a19,_0x572907){var _0x550cb1={'raw':![],'where':{'id':_0x6d5a19[_0x46c1('0x23')]['id']}},_0x116b3f={};_0x116b3f[_0x46c1('0x24')]=_['keys'](db['SmsInteraction'][_0x46c1('0x1b')]);_0x116b3f[_0x46c1('0x25')]=_['keys'](_0x6d5a19[_0x46c1('0x25')]);_0x116b3f[_0x46c1('0x26')]=_[_0x46c1('0x27')](_0x116b3f[_0x46c1('0x24')],_0x116b3f['query']);_0x550cb1[_0x46c1('0x28')]=_[_0x46c1('0x27')](_0x116b3f['model'],qs[_0x46c1('0x29')](_0x6d5a19['query'][_0x46c1('0x29')]));_0x550cb1[_0x46c1('0x28')]=_0x550cb1[_0x46c1('0x28')]['length']?_0x550cb1[_0x46c1('0x28')]:_0x116b3f['model'];if(_0x6d5a19['query'][_0x46c1('0x2a')]){_0x550cb1[_0x46c1('0x2b')]=[{'all':!![]}];}_0x550cb1=_[_0x46c1('0x2c')]({},_0x550cb1,_0x6d5a19[_0x46c1('0x2d')]);return db[_0x46c1('0x2e')][_0x46c1('0x2f')](_0x550cb1)['then'](handleEntityNotFound(_0x572907,null))[_0x46c1('0x20')](respondWithResult(_0x572907,null))['catch'](handleError(_0x572907,null));};exports[_0x46c1('0x30')]=function(_0x2cdacc,_0x80c764){return db[_0x46c1('0x2e')][_0x46c1('0x30')](_0x2cdacc['body'],{})[_0x46c1('0x20')](respondWithResult(_0x80c764,0xc9))['catch'](handleError(_0x80c764,null));};exports['update']=function(_0x29ab72,_0x5232aa){if(_0x29ab72[_0x46c1('0x31')]['id']){delete _0x29ab72[_0x46c1('0x31')]['id'];}return db['SmsInteraction']['find']({'where':{'id':_0x29ab72[_0x46c1('0x23')]['id']}})[_0x46c1('0x20')](handleEntityNotFound(_0x5232aa,null))[_0x46c1('0x20')](saveUpdates(_0x29ab72[_0x46c1('0x31')],null))['then'](respondWithResult(_0x5232aa,null))['catch'](handleError(_0x5232aa,null));};exports[_0x46c1('0x32')]=function(_0x317bdd,_0x3bc65e){return db[_0x46c1('0x2e')][_0x46c1('0x2f')]({'where':{'id':_0x317bdd[_0x46c1('0x23')]['id']}})['then'](handleEntityNotFound(_0x3bc65e,null))[_0x46c1('0x20')](removeEntity(_0x3bc65e,null))[_0x46c1('0x21')](handleError(_0x3bc65e,null));};exports[_0x46c1('0x33')]=function(_0x3c9c13,_0x3ff2a1){return db['SmsInteraction'][_0x46c1('0x33')]()[_0x46c1('0x20')](respondWithResult(_0x3ff2a1,null))[_0x46c1('0x21')](handleError(_0x3ff2a1,null));};exports[_0x46c1('0x34')]=function(_0x7d227f,_0x3fd849){return db['SmsMessage'][_0x46c1('0x2f')]({'where':{'id':_0x7d227f[_0x46c1('0x23')]['id']}})['then'](handleEntityNotFound(_0x3fd849,null))[_0x46c1('0x20')](function(_0x1476b7){if(_0x1476b7){return _0x1476b7[_0x46c1('0x34')](_0x7d227f[_0x46c1('0x31')]['ids'],_[_0x46c1('0x35')](_0x7d227f[_0x46c1('0x31')],[_0x46c1('0x36'),'id'])||{});}})[_0x46c1('0x20')](respondWithResult(_0x3fd849,null))[_0x46c1('0x21')](handleError(_0x3fd849,null));};exports[_0x46c1('0x37')]=function(_0x4952f3,_0x7f747c){var _0x75936={'raw':![],'where':{}};var _0x3c8a3c={};var _0x54da43={'count':0x0,'rows':[]};return db[_0x46c1('0x2e')]['findOne']({'where':{'id':_0x4952f3['params']['id']}})[_0x46c1('0x20')](handleEntityNotFound(_0x7f747c,null))[_0x46c1('0x20')](function(_0x3eceb8){if(_0x3eceb8){_0x3c8a3c[_0x46c1('0x24')]=_[_0x46c1('0x38')](db[_0x46c1('0x39')]['rawAttributes']);_0x3c8a3c[_0x46c1('0x25')]=_[_0x46c1('0x38')](_0x4952f3[_0x46c1('0x25')]);_0x3c8a3c['filters']=_[_0x46c1('0x27')](_0x3c8a3c[_0x46c1('0x24')],_0x3c8a3c[_0x46c1('0x25')]);_0x75936['attributes']=_['intersection'](_0x3c8a3c[_0x46c1('0x24')],qs[_0x46c1('0x29')](_0x4952f3['query'][_0x46c1('0x29')]));_0x75936[_0x46c1('0x28')]=_0x75936[_0x46c1('0x28')][_0x46c1('0x3a')]?_0x75936[_0x46c1('0x28')]:_0x3c8a3c[_0x46c1('0x24')];if(!_0x4952f3[_0x46c1('0x25')][_0x46c1('0x3b')]('nolimit')){_0x75936[_0x46c1('0x14')]=qs[_0x46c1('0x14')](_0x4952f3['query']['limit']);_0x75936[_0x46c1('0x12')]=qs[_0x46c1('0x12')](_0x4952f3[_0x46c1('0x25')][_0x46c1('0x12')]);}_0x75936[_0x46c1('0x3c')]=qs[_0x46c1('0x3d')](_0x4952f3[_0x46c1('0x25')]['sort']);_0x75936[_0x46c1('0x3e')]=qs[_0x46c1('0x26')](_[_0x46c1('0x3f')](_0x4952f3[_0x46c1('0x25')],_0x3c8a3c['filters']));_0x75936[_0x46c1('0x3e')]['SmsInteractionId']=_0x3eceb8['id'];if(_0x4952f3[_0x46c1('0x25')][_0x46c1('0x40')]){_0x75936['where']=_['merge'](_0x75936[_0x46c1('0x3e')],{'$or':_[_0x46c1('0x1a')](_0x75936[_0x46c1('0x28')],function(_0x360226){var _0x7e3731={};_0x7e3731[_0x360226]={'$like':'%'+_0x4952f3[_0x46c1('0x25')][_0x46c1('0x40')]+'%'};return _0x7e3731;})});}if(_0x4952f3['query']['$gte']){var _0x5356b1=_0x4952f3[_0x46c1('0x25')][_0x46c1('0x41')][_0x46c1('0x42')](',');var _0x179d02={};_0x179d02[_0x5356b1[0x0]]={'$gte':moment(_0x5356b1[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x75936[_0x46c1('0x3e')]=_[_0x46c1('0x2c')](_0x75936[_0x46c1('0x3e')],_0x179d02);}_0x75936=_[_0x46c1('0x2c')]({},_0x75936,_0x4952f3[_0x46c1('0x2d')]);return db[_0x46c1('0x39')][_0x46c1('0x15')]({'where':_0x75936[_0x46c1('0x3e')]})[_0x46c1('0x20')](function(_0x38de89){_0x54da43[_0x46c1('0x15')]=_0x38de89;if(_0x4952f3[_0x46c1('0x25')][_0x46c1('0x2a')]){_0x75936[_0x46c1('0x2b')]=[{'all':!![]}];}return db[_0x46c1('0x39')][_0x46c1('0x1e')](_0x75936);})['then'](function(_0x53e48f){_0x54da43[_0x46c1('0x43')]=_0x53e48f;return _0x54da43;});}})[_0x46c1('0x20')](respondWithFilteredResult(_0x7f747c,_0x75936))['catch'](handleError(_0x7f747c,null));};exports[_0x46c1('0x44')]=function(_0x128a1e,_0x40420c){return db[_0x46c1('0x2e')][_0x46c1('0x2f')]({'where':{'id':_0x128a1e[_0x46c1('0x23')]['id']}})[_0x46c1('0x20')](handleEntityNotFound(_0x40420c,null))[_0x46c1('0x20')](function(_0xd71674){if(_0xd71674){return _0xd71674[_0x46c1('0x45')](_0x128a1e['body']['ids'],_[_0x46c1('0x35')](_0x128a1e[_0x46c1('0x31')],[_0x46c1('0x36'),'id'])||{})[_0x46c1('0x46')](function(){return db['Tag']['findAll']({'attributes':['id',_0x46c1('0x19'),'color'],'where':{'id':_0x128a1e[_0x46c1('0x31')][_0x46c1('0x36')]}});})[_0x46c1('0x20')](function(_0x585490){socket['emit'](_0x46c1('0x47'),{'id':Number(_0x128a1e[_0x46c1('0x23')]['id']),'tags':_0x585490||[]});return{'id':Number(_0x128a1e[_0x46c1('0x23')]['id']),'tags':_0x585490||[]};});}})[_0x46c1('0x20')](respondWithResult(_0x40420c,null))[_0x46c1('0x21')](handleError(_0x40420c,null));};exports[_0x46c1('0x48')]=function(_0x59d639,_0x7c0bff){return db['SmsInteraction'][_0x46c1('0x2f')]({'where':{'id':_0x59d639[_0x46c1('0x23')]['id']}})['then'](handleEntityNotFound(_0x7c0bff,null))[_0x46c1('0x20')](function(_0x2860b7){if(_0x2860b7){return _0x2860b7[_0x46c1('0x48')](_0x59d639[_0x46c1('0x25')][_0x46c1('0x36')]);}})['then'](respondWithStatusCode(_0x7c0bff,null))[_0x46c1('0x21')](handleError(_0x7c0bff,null));};exports[_0x46c1('0x49')]=function(_0x25aa5a,_0x5a499e){var _0x10dc3a=moment()[_0x46c1('0x4a')]()[_0x46c1('0x4b')]();var _0x3acd73=path[_0x46c1('0x4c')](config[_0x46c1('0x4d')],_0x46c1('0x4e'),_0x46c1('0x4f'),_0x46c1('0x50'));var _0x2401fd=path[_0x46c1('0x4c')](_0x3acd73,_0x10dc3a);var _0x220293=util[_0x46c1('0x51')](_0x46c1('0x52'),_0x25aa5a[_0x46c1('0x23')]['id'],_0x10dc3a);var _0x42ff5c=path[_0x46c1('0x4c')](_0x3acd73,_0x220293);var _0x367a27=[];_0x367a27['push']({'model':db[_0x46c1('0x53')],'as':_0x46c1('0x53'),'attributes':['id',_0x46c1('0x54')],'raw':!![]});_0x367a27[_0x46c1('0x55')]({'model':db['CmContact'],'as':_0x46c1('0x56'),'attributes':['id',_0x46c1('0x57'),'lastName'],'raw':!![]});var _0x142663=[{'model':db[_0x46c1('0x39')],'as':'Messages','attributes':['id',_0x46c1('0x31'),_0x46c1('0x58'),_0x46c1('0x59'),_0x46c1('0x5a'),_0x46c1('0x5b')],'include':_0x367a27}];_0x142663[_0x46c1('0x55')]({'model':db['SmsAccount'],'as':_0x46c1('0x5c'),'attributes':['id',_0x46c1('0x19')]});_0x142663[_0x46c1('0x55')]({'model':db[_0x46c1('0x53')],'as':_0x46c1('0x5d'),'attributes':['id',_0x46c1('0x54')]});return db[_0x46c1('0x2e')]['find']({'where':{'id':_0x25aa5a[_0x46c1('0x23')]['id']},'include':_0x142663})['then'](handleEntityNotFound(_0x5a499e,null))[_0x46c1('0x20')](function(_0x3020a4){if(_0x3020a4){var _0x5c918c=_0x3020a4[_0x46c1('0x5e')]({'plain':!![]});fs[_0x46c1('0x5f')](_0x2401fd);var _0x2d339d={'channel':_0x46c1('0x60'),'account':_0x5c918c[_0x46c1('0x5c')]['name'],'agent':_0x5c918c[_0x46c1('0x5d')]?_0x5c918c[_0x46c1('0x5d')][_0x46c1('0x54')]:'N.A.','createdAt':moment(_0x5c918c[_0x46c1('0x58')])[_0x46c1('0x51')]('YYYY-MM-DD\x20HH:mm:ss')[_0x46c1('0x4b')](),'closedAt':_0x5c918c[_0x46c1('0x61')]?moment(_0x5c918c[_0x46c1('0x62')])['format'](_0x46c1('0x63'))[_0x46c1('0x4b')]():'','disposition':_0x5c918c[_0x46c1('0x64')],'messages':_(_0x5c918c['Messages'])['filter']({'secret':![]})[_0x46c1('0x1a')](function(_0x4c18c1){return{'date':moment(_0x4c18c1[_0x46c1('0x58')])[_0x46c1('0x51')](_0x46c1('0x63'))['toString'](),'sender':_0x4c18c1[_0x46c1('0x59')]==='out'?_0x4c18c1[_0x46c1('0x53')]?_0x4c18c1[_0x46c1('0x53')][_0x46c1('0x54')]:_0x46c1('0x65'):_0x4c18c1[_0x46c1('0x56')]['firstName']+(_0x4c18c1['Contact']['lastName']?'\x20'+_0x4c18c1[_0x46c1('0x56')]['lastName']:''),'body':_0x4c18c1[_0x46c1('0x31')],'direction':_0x4c18c1[_0x46c1('0x59')]==='out'?'A':'C','secret':_0x4c18c1[_0x46c1('0x5a')],'read':_0x4c18c1['read']};})[_0x46c1('0x66')]()};return ejs[_0x46c1('0x67')](path[_0x46c1('0x4c')](config['root'],_0x46c1('0x4e'),_0x46c1('0x68'),'downloadInteraction.ejs'),{'interaction':_0x2d339d})[_0x46c1('0x20')](function(_0x3544f4){var _0x3f59ef=path[_0x46c1('0x4c')](_0x2401fd,'transcript-'+_0x5c918c['id']+'-'+_0x10dc3a+_0x46c1('0x69'));var _0x315122={'path':_0x3f59ef,'channel':_0x46c1('0x60'),'interactionId':_0x5c918c['id']};return pdf[_0x46c1('0x6a')](_0x3544f4,_0x315122);})[_0x46c1('0x20')](function(){return new BPromise(function(_0x1022d0,_0x112689){zipdir(_0x2401fd,{'saveTo':_0x42ff5c},function(_0x436f31,_0x206955){if(_0x436f31)return _0x112689(_0x436f31);return _0x1022d0(_0x206955);});})['then'](function(){return new BPromise(function(_0x3463a4,_0x523249){rimraf(_0x2401fd,function(_0x595380){if(_0x595380)_0x523249(_0x595380);return _0x3463a4();});});})[_0x46c1('0x20')](function(){return _0x5a499e[_0x46c1('0x49')](_0x42ff5c,_0x220293,function(_0x3c88f1){if(_0x3c88f1){console[_0x46c1('0x6b')](_0x46c1('0x6c'),_0x3c88f1);}else{fs[_0x46c1('0x6d')](_0x42ff5c);}});});});}else{return _0x5a499e[_0x46c1('0x17')](0xc8);}})['catch'](handleError(_0x5a499e,null));}; \ No newline at end of file +var _0x76dd=['api','../../mysqldb','redis','defaults','./smsInteraction.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','update','then','error','stack','name','send','index','map','SmsInteraction','rawAttributes','findAll','sms','user','catch','show','params','model','query','filters','attributes','fields','length','includeAll','include','merge','options','find','create','body','destroy','describe','SmsMessage','ids','getMessages','findOne','keys','intersection','hasOwnProperty','nolimit','order','sort','where','SmsInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','omit','color','emit','smsInteractionTags:save','removeTags','download','unix','toString','root','server','files','tmp','join','User','fullname','CmContact','firstName','Messages','createdAt','direction','read','SmsAccount','Account','push','Owner','mkdirSync','N.A.','closedAt','out','System','Contact','lastName','secret','value','renderFile','transcript-','.pdf','Sms','createPdfFromHTML','log','err','rimraf','moment','bluebird','util','path','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger'];(function(_0x64aff8,_0x106082){var _0x5488a3=function(_0x36969c){while(--_0x36969c){_0x64aff8['push'](_0x64aff8['shift']());}};_0x5488a3(++_0x106082);}(_0x76dd,0x1c2));var _0xd76d=function(_0x28ad6,_0x367cb9){_0x28ad6=_0x28ad6-0x0;var _0x184469=_0x76dd[_0x28ad6];return _0x184469;};'use strict';var rimraf=require(_0xd76d('0x0'));var zipdir=require('zip-dir');var moment=require(_0xd76d('0x1'));var BPromise=require(_0xd76d('0x2'));var util=require(_0xd76d('0x3'));var path=require(_0xd76d('0x4'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var Redis=require(_0xd76d('0x5'));var interaction=require(_0xd76d('0x6'));var qs=require(_0xd76d('0x7'));var pdf=require(_0xd76d('0x8'));var logger=require(_0xd76d('0x9'))(_0xd76d('0xa'));var config=require('../../config/environment');var db=require(_0xd76d('0xb'))['db'];config[_0xd76d('0xc')]=_[_0xd76d('0xd')](config[_0xd76d('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd76d('0xc')]));require(_0xd76d('0xe'))['register'](socket);function respondWithStatusCode(_0x847972,_0x16b9fb){_0x16b9fb=_0x16b9fb||0xcc;return function(_0x292935){if(_0x292935){return _0x847972[_0xd76d('0xf')](_0x16b9fb);}return _0x847972[_0xd76d('0x10')](_0x16b9fb)[_0xd76d('0x11')]();};}function respondWithResult(_0x15663c,_0x14e49d){_0x14e49d=_0x14e49d||0xc8;return function(_0x34ad1c){if(_0x34ad1c){return _0x15663c[_0xd76d('0x10')](_0x14e49d)[_0xd76d('0x12')](_0x34ad1c);}};}function respondWithFilteredResult(_0x5447dd,_0x6ac280){return function(_0x5becf3){if(_0x5becf3){var _0x3d9217=typeof _0x6ac280[_0xd76d('0x13')]===_0xd76d('0x14')&&typeof _0x6ac280[_0xd76d('0x15')]===_0xd76d('0x14');var _0x1197ff=_0x5becf3[_0xd76d('0x16')];var _0x4073ac=_0x3d9217?0x0:_0x6ac280['offset'];var _0x2344f0=_0x3d9217?_0x5becf3['count']:_0x6ac280[_0xd76d('0x13')]+_0x6ac280['limit'];var _0x218666;if(_0x2344f0>=_0x1197ff){_0x2344f0=_0x1197ff;_0x218666=0xc8;}else{_0x218666=0xce;}_0x5447dd[_0xd76d('0x10')](_0x218666);return _0x5447dd[_0xd76d('0x17')]('Content-Range',_0x4073ac+'-'+_0x2344f0+'/'+_0x1197ff)[_0xd76d('0x12')](_0x5becf3);}return null;};}function saveUpdates(_0x101a3d){return function(_0x59bb01){if(_0x59bb01){return _0x59bb01[_0xd76d('0x18')](_0x101a3d)[_0xd76d('0x19')](function(_0x51cf44){return _0x51cf44;});}return null;};}function removeEntity(_0x5b8db3){return function(_0x3be3cb){if(_0x3be3cb){return _0x3be3cb['destroy']()['then'](function(){_0x5b8db3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x24d1c2){return function(_0x509ee5){if(!_0x509ee5){_0x24d1c2[_0xd76d('0xf')](0x194);}return _0x509ee5;};}function handleError(_0x29296a,_0x3bb4f2){_0x3bb4f2=_0x3bb4f2||0x1f4;return function(_0x470a81){logger[_0xd76d('0x1a')](_0x470a81[_0xd76d('0x1b')]);if(_0x470a81[_0xd76d('0x1c')]){delete _0x470a81[_0xd76d('0x1c')];}_0x29296a[_0xd76d('0x10')](_0x3bb4f2)[_0xd76d('0x1d')](_0x470a81);};}exports[_0xd76d('0x1e')]=function(_0x423237,_0x49a450){var _0x222071={};var _0x302a1d=_[_0xd76d('0x1f')](db[_0xd76d('0x20')][_0xd76d('0x21')],function(_0x3d78ce){return{'name':_0x3d78ce['fieldName'],'type':_0x3d78ce['type']['key']};});_0x222071=qs['getOptions'](_0x302a1d,_0x423237);return interaction[_0xd76d('0x22')](_0xd76d('0x23'),_0x423237['query'],_0x423237[_0xd76d('0x24')],_0x222071,_0x302a1d)[_0xd76d('0x19')](respondWithFilteredResult(_0x49a450,_0x222071))[_0xd76d('0x25')](handleError(_0x49a450,null));};exports[_0xd76d('0x26')]=function(_0x1f0ffc,_0x3323fa){var _0x187bbe={'raw':![],'where':{'id':_0x1f0ffc[_0xd76d('0x27')]['id']}},_0x3c6ed2={};_0x3c6ed2[_0xd76d('0x28')]=_['keys'](db[_0xd76d('0x20')]['rawAttributes']);_0x3c6ed2[_0xd76d('0x29')]=_['keys'](_0x1f0ffc[_0xd76d('0x29')]);_0x3c6ed2[_0xd76d('0x2a')]=_['intersection'](_0x3c6ed2[_0xd76d('0x28')],_0x3c6ed2['query']);_0x187bbe[_0xd76d('0x2b')]=_['intersection'](_0x3c6ed2[_0xd76d('0x28')],qs[_0xd76d('0x2c')](_0x1f0ffc['query'][_0xd76d('0x2c')]));_0x187bbe[_0xd76d('0x2b')]=_0x187bbe['attributes'][_0xd76d('0x2d')]?_0x187bbe[_0xd76d('0x2b')]:_0x3c6ed2[_0xd76d('0x28')];if(_0x1f0ffc[_0xd76d('0x29')][_0xd76d('0x2e')]){_0x187bbe[_0xd76d('0x2f')]=[{'all':!![]}];}_0x187bbe=_[_0xd76d('0x30')]({},_0x187bbe,_0x1f0ffc[_0xd76d('0x31')]);return db[_0xd76d('0x20')][_0xd76d('0x32')](_0x187bbe)['then'](handleEntityNotFound(_0x3323fa,null))['then'](respondWithResult(_0x3323fa,null))[_0xd76d('0x25')](handleError(_0x3323fa,null));};exports['create']=function(_0x317fb0,_0x2003e3){return db['SmsInteraction'][_0xd76d('0x33')](_0x317fb0['body'],{})[_0xd76d('0x19')](respondWithResult(_0x2003e3,0xc9))[_0xd76d('0x25')](handleError(_0x2003e3,null));};exports[_0xd76d('0x18')]=function(_0x1215ef,_0x6fa90b){if(_0x1215ef['body']['id']){delete _0x1215ef[_0xd76d('0x34')]['id'];}return db[_0xd76d('0x20')][_0xd76d('0x32')]({'where':{'id':_0x1215ef[_0xd76d('0x27')]['id']}})[_0xd76d('0x19')](handleEntityNotFound(_0x6fa90b,null))['then'](saveUpdates(_0x1215ef[_0xd76d('0x34')],null))[_0xd76d('0x19')](respondWithResult(_0x6fa90b,null))['catch'](handleError(_0x6fa90b,null));};exports[_0xd76d('0x35')]=function(_0x303c80,_0x4f6c0c){return db['SmsInteraction'][_0xd76d('0x32')]({'where':{'id':_0x303c80['params']['id']}})['then'](handleEntityNotFound(_0x4f6c0c,null))[_0xd76d('0x19')](removeEntity(_0x4f6c0c,null))[_0xd76d('0x25')](handleError(_0x4f6c0c,null));};exports[_0xd76d('0x36')]=function(_0x2f69f8,_0x1de472){return db[_0xd76d('0x20')]['describe']()[_0xd76d('0x19')](respondWithResult(_0x1de472,null))['catch'](handleError(_0x1de472,null));};exports['addMessage']=function(_0x2bd579,_0x1eff80){return db[_0xd76d('0x37')][_0xd76d('0x32')]({'where':{'id':_0x2bd579[_0xd76d('0x27')]['id']}})[_0xd76d('0x19')](handleEntityNotFound(_0x1eff80,null))['then'](function(_0x37c117){if(_0x37c117){return _0x37c117['addMessage'](_0x2bd579['body']['ids'],_['omit'](_0x2bd579[_0xd76d('0x34')],[_0xd76d('0x38'),'id'])||{});}})[_0xd76d('0x19')](respondWithResult(_0x1eff80,null))['catch'](handleError(_0x1eff80,null));};exports[_0xd76d('0x39')]=function(_0x3d1c41,_0x204c4d){var _0x2da1e3={'raw':![],'where':{}};var _0x429e5d={};var _0x1fd2ef={'count':0x0,'rows':[]};return db['SmsInteraction'][_0xd76d('0x3a')]({'where':{'id':_0x3d1c41['params']['id']}})[_0xd76d('0x19')](handleEntityNotFound(_0x204c4d,null))[_0xd76d('0x19')](function(_0x1e33c9){if(_0x1e33c9){_0x429e5d[_0xd76d('0x28')]=_[_0xd76d('0x3b')](db[_0xd76d('0x37')][_0xd76d('0x21')]);_0x429e5d[_0xd76d('0x29')]=_[_0xd76d('0x3b')](_0x3d1c41['query']);_0x429e5d[_0xd76d('0x2a')]=_[_0xd76d('0x3c')](_0x429e5d[_0xd76d('0x28')],_0x429e5d[_0xd76d('0x29')]);_0x2da1e3[_0xd76d('0x2b')]=_[_0xd76d('0x3c')](_0x429e5d[_0xd76d('0x28')],qs[_0xd76d('0x2c')](_0x3d1c41[_0xd76d('0x29')][_0xd76d('0x2c')]));_0x2da1e3['attributes']=_0x2da1e3[_0xd76d('0x2b')]['length']?_0x2da1e3[_0xd76d('0x2b')]:_0x429e5d[_0xd76d('0x28')];if(!_0x3d1c41[_0xd76d('0x29')][_0xd76d('0x3d')](_0xd76d('0x3e'))){_0x2da1e3[_0xd76d('0x15')]=qs[_0xd76d('0x15')](_0x3d1c41['query'][_0xd76d('0x15')]);_0x2da1e3[_0xd76d('0x13')]=qs['offset'](_0x3d1c41[_0xd76d('0x29')][_0xd76d('0x13')]);}_0x2da1e3[_0xd76d('0x3f')]=qs[_0xd76d('0x40')](_0x3d1c41[_0xd76d('0x29')][_0xd76d('0x40')]);_0x2da1e3[_0xd76d('0x41')]=qs['filters'](_['pick'](_0x3d1c41[_0xd76d('0x29')],_0x429e5d[_0xd76d('0x2a')]));_0x2da1e3[_0xd76d('0x41')][_0xd76d('0x42')]=_0x1e33c9['id'];if(_0x3d1c41['query']['filter']){_0x2da1e3[_0xd76d('0x41')]=_[_0xd76d('0x30')](_0x2da1e3['where'],{'$or':_['map'](_0x2da1e3[_0xd76d('0x2b')],function(_0x14c079){var _0x130ba1={};_0x130ba1[_0x14c079]={'$like':'%'+_0x3d1c41[_0xd76d('0x29')][_0xd76d('0x43')]+'%'};return _0x130ba1;})});}if(_0x3d1c41[_0xd76d('0x29')][_0xd76d('0x44')]){var _0x2215c4=_0x3d1c41['query'][_0xd76d('0x44')][_0xd76d('0x45')](',');var _0x19676e={};_0x19676e[_0x2215c4[0x0]]={'$gte':moment(_0x2215c4[0x1])[_0xd76d('0x46')](_0xd76d('0x47'))};_0x2da1e3[_0xd76d('0x41')]=_['merge'](_0x2da1e3[_0xd76d('0x41')],_0x19676e);}_0x2da1e3=_[_0xd76d('0x30')]({},_0x2da1e3,_0x3d1c41[_0xd76d('0x31')]);return db[_0xd76d('0x37')][_0xd76d('0x16')]({'where':_0x2da1e3[_0xd76d('0x41')]})[_0xd76d('0x19')](function(_0x369eef){_0x1fd2ef[_0xd76d('0x16')]=_0x369eef;if(_0x3d1c41[_0xd76d('0x29')][_0xd76d('0x2e')]){_0x2da1e3[_0xd76d('0x2f')]=[{'all':!![]}];}return db['SmsMessage'][_0xd76d('0x22')](_0x2da1e3);})[_0xd76d('0x19')](function(_0x23798b){_0x1fd2ef[_0xd76d('0x48')]=_0x23798b;return _0x1fd2ef;});}})[_0xd76d('0x19')](respondWithFilteredResult(_0x204c4d,_0x2da1e3))[_0xd76d('0x25')](handleError(_0x204c4d,null));};exports[_0xd76d('0x49')]=function(_0x153b51,_0x178137){return db['SmsInteraction']['find']({'where':{'id':_0x153b51[_0xd76d('0x27')]['id']}})[_0xd76d('0x19')](handleEntityNotFound(_0x178137,null))[_0xd76d('0x19')](function(_0x321a0e){if(_0x321a0e){return _0x321a0e['setTags'](_0x153b51[_0xd76d('0x34')][_0xd76d('0x38')],_[_0xd76d('0x4a')](_0x153b51[_0xd76d('0x34')],[_0xd76d('0x38'),'id'])||{})['spread'](function(){return db['Tag'][_0xd76d('0x22')]({'attributes':['id',_0xd76d('0x1c'),_0xd76d('0x4b')],'where':{'id':_0x153b51['body'][_0xd76d('0x38')]}});})['then'](function(_0x7581af){socket[_0xd76d('0x4c')](_0xd76d('0x4d'),{'id':Number(_0x153b51[_0xd76d('0x27')]['id']),'tags':_0x7581af||[]});return{'id':Number(_0x153b51[_0xd76d('0x27')]['id']),'tags':_0x7581af||[]};});}})[_0xd76d('0x19')](respondWithResult(_0x178137,null))[_0xd76d('0x25')](handleError(_0x178137,null));};exports[_0xd76d('0x4e')]=function(_0x467552,_0x19af1b){return db[_0xd76d('0x20')][_0xd76d('0x32')]({'where':{'id':_0x467552[_0xd76d('0x27')]['id']}})[_0xd76d('0x19')](handleEntityNotFound(_0x19af1b,null))[_0xd76d('0x19')](function(_0x221b69){if(_0x221b69){return _0x221b69[_0xd76d('0x4e')](_0x467552[_0xd76d('0x29')][_0xd76d('0x38')]);}})[_0xd76d('0x19')](respondWithStatusCode(_0x19af1b,null))[_0xd76d('0x25')](handleError(_0x19af1b,null));};exports[_0xd76d('0x4f')]=function(_0x29b806,_0x4aac31){var _0xfc3f08=moment()[_0xd76d('0x50')]()[_0xd76d('0x51')]();var _0xdc60a8=path['join'](config[_0xd76d('0x52')],_0xd76d('0x53'),_0xd76d('0x54'),_0xd76d('0x55'));var _0x3ef4bd=path[_0xd76d('0x56')](_0xdc60a8,_0xfc3f08);var _0x268599=util[_0xd76d('0x46')]('transcript-%d-%s.zip',_0x29b806[_0xd76d('0x27')]['id'],_0xfc3f08);var _0x329e0e=path['join'](_0xdc60a8,_0x268599);var _0x3f9ef8=[];_0x3f9ef8['push']({'model':db[_0xd76d('0x57')],'as':'User','attributes':['id',_0xd76d('0x58')],'raw':!![]});_0x3f9ef8['push']({'model':db[_0xd76d('0x59')],'as':'Contact','attributes':['id',_0xd76d('0x5a'),'lastName'],'raw':!![]});var _0x5cd944=[{'model':db['SmsMessage'],'as':_0xd76d('0x5b'),'attributes':['id',_0xd76d('0x34'),_0xd76d('0x5c'),_0xd76d('0x5d'),'secret',_0xd76d('0x5e')],'include':_0x3f9ef8}];_0x5cd944['push']({'model':db[_0xd76d('0x5f')],'as':_0xd76d('0x60'),'attributes':['id','name']});_0x5cd944[_0xd76d('0x61')]({'model':db[_0xd76d('0x57')],'as':_0xd76d('0x62'),'attributes':['id',_0xd76d('0x58')]});return db[_0xd76d('0x20')]['find']({'where':{'id':_0x29b806['params']['id']},'include':_0x5cd944})['then'](handleEntityNotFound(_0x4aac31,null))[_0xd76d('0x19')](function(_0x209f98){if(_0x209f98){var _0x59abb1=_0x209f98['get']({'plain':!![]});fs[_0xd76d('0x63')](_0x3ef4bd);var _0x10dd38={'channel':'Sms','account':_0x59abb1[_0xd76d('0x60')][_0xd76d('0x1c')],'agent':_0x59abb1[_0xd76d('0x62')]?_0x59abb1['Owner'][_0xd76d('0x58')]:_0xd76d('0x64'),'createdAt':moment(_0x59abb1[_0xd76d('0x5c')])[_0xd76d('0x46')](_0xd76d('0x47'))[_0xd76d('0x51')](),'closedAt':_0x59abb1['closed']?moment(_0x59abb1[_0xd76d('0x65')])[_0xd76d('0x46')](_0xd76d('0x47'))[_0xd76d('0x51')]():'','disposition':_0x59abb1['disposition'],'messages':_(_0x59abb1[_0xd76d('0x5b')])[_0xd76d('0x43')]({'secret':![]})['map'](function(_0x49a138){return{'date':moment(_0x49a138['createdAt'])[_0xd76d('0x46')](_0xd76d('0x47'))[_0xd76d('0x51')](),'sender':_0x49a138[_0xd76d('0x5d')]===_0xd76d('0x66')?_0x49a138[_0xd76d('0x57')]?_0x49a138['User'][_0xd76d('0x58')]:_0xd76d('0x67'):_0x49a138[_0xd76d('0x68')][_0xd76d('0x5a')]+(_0x49a138['Contact'][_0xd76d('0x69')]?'\x20'+_0x49a138[_0xd76d('0x68')]['lastName']:''),'body':_0x49a138[_0xd76d('0x34')],'direction':_0x49a138[_0xd76d('0x5d')]===_0xd76d('0x66')?'A':'C','secret':_0x49a138[_0xd76d('0x6a')],'read':_0x49a138[_0xd76d('0x5e')]};})[_0xd76d('0x6b')]()};return ejs[_0xd76d('0x6c')](path[_0xd76d('0x56')](config[_0xd76d('0x52')],'server','views','downloadInteraction.ejs'),{'interaction':_0x10dd38})[_0xd76d('0x19')](function(_0x3f3117){var _0x2d6207=path['join'](_0x3ef4bd,_0xd76d('0x6d')+_0x59abb1['id']+'-'+_0xfc3f08+_0xd76d('0x6e'));var _0x14a8d9={'path':_0x2d6207,'channel':_0xd76d('0x6f'),'interactionId':_0x59abb1['id']};return pdf[_0xd76d('0x70')](_0x3f3117,_0x14a8d9);})[_0xd76d('0x19')](function(){return new BPromise(function(_0x33393b,_0xa11a39){zipdir(_0x3ef4bd,{'saveTo':_0x329e0e},function(_0x401d4c,_0x448f4c){if(_0x401d4c)return _0xa11a39(_0x401d4c);return _0x33393b(_0x448f4c);});})[_0xd76d('0x19')](function(){return new BPromise(function(_0xb4b237,_0x53353d){rimraf(_0x3ef4bd,function(_0x4055a2){if(_0x4055a2)_0x53353d(_0x4055a2);return _0xb4b237();});});})[_0xd76d('0x19')](function(){return _0x4aac31[_0xd76d('0x4f')](_0x329e0e,_0x268599,function(_0x3938f7){if(_0x3938f7){console[_0xd76d('0x71')](_0xd76d('0x72'),_0x3938f7);}else{fs['unlinkSync'](_0x329e0e);}});});});}else{return _0x4aac31[_0xd76d('0xf')](0xc8);}})[_0xd76d('0x25')](handleError(_0x4aac31,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 716a6c4..d34de20 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 _0x77e6=['findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','update','then','Users','map'];(function(_0x57411a,_0x59328f){var _0xd487ba=function(_0x2fb456){while(--_0x2fb456){_0x57411a['push'](_0x57411a['shift']());}};_0xd487ba(++_0x59328f);}(_0x77e6,0x1a6));var _0x677e=function(_0x39539d,_0x37680f){_0x39539d=_0x39539d-0x0;var _0x42a87b=_0x77e6[_0x39539d];return _0x42a87b;};'use strict';var EventEmitter=require(_0x677e('0x0'));var SmsInteraction=require(_0x677e('0x1'))['db'][_0x677e('0x2')];var SmsMessage=require(_0x677e('0x1'))['db'][_0x677e('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x677e('0x4')](0x0);var events={'afterCreate':_0x677e('0x5'),'afterUpdate':_0x677e('0x6'),'afterDestroy':'remove'};function emitEvent(_0x2f0307){return function(_0x2560a6,_0x52e3f9,_0x18c5e1){_0x2560a6['getUsers']({'attributes':['id'],'raw':!![]})[_0x677e('0x7')](function(_0x4d1a57){_0x2560a6['setDataValue'](_0x677e('0x8'),_0x4d1a57[_0x677e('0x9')](function(_0x28d41e){return{'id':_0x28d41e['id']};}));return SmsMessage[_0x677e('0xa')]({'where':{'SmsInteractionId':_0x2560a6['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x206305){_0x2560a6['setDataValue'](_0x677e('0xb'),_0x206305[_0x677e('0xc')]);SmsInteractionEvents[_0x677e('0xd')](_0x2f0307+':'+_0x2560a6['id'],_0x2560a6);SmsInteractionEvents[_0x677e('0xd')](_0x2f0307,_0x2560a6);_0x18c5e1(null);})[_0x677e('0xe')](_0x18c5e1(null));};}for(var e in events){if(events[_0x677e('0xf')](e)){var event=events[e];SmsInteraction[_0x677e('0x10')](e,emitEvent(event));}}module[_0x677e('0x11')]=SmsInteractionEvents; \ No newline at end of file +var _0x160f=['events','../../mysqldb','SmsInteraction','setMaxListeners','save','update','remove','getUsers','setDataValue','findAll','then','emit','catch','hook','exports'];(function(_0x15c485,_0x25706f){var _0x386a00=function(_0xc87701){while(--_0xc87701){_0x15c485['push'](_0x15c485['shift']());}};_0x386a00(++_0x25706f);}(_0x160f,0x1ef));var _0xf160=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x160f[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xf160('0x0'));var SmsInteraction=require(_0xf160('0x1'))['db'][_0xf160('0x2')];var SmsMessage=require(_0xf160('0x1'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xf160('0x3')](0x0);var events={'afterCreate':_0xf160('0x4'),'afterUpdate':_0xf160('0x5'),'afterDestroy':_0xf160('0x6')};function emitEvent(_0x194331){return function(_0xfdbd72,_0x4a6f3d,_0x311d63){_0xfdbd72[_0xf160('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x59440e){_0xfdbd72[_0xf160('0x8')]('Users',_0x59440e['map'](function(_0x496014){return{'id':_0x496014['id']};}));return SmsMessage[_0xf160('0x9')]({'where':{'SmsInteractionId':_0xfdbd72['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf160('0xa')](function(_0x393f70){_0xfdbd72[_0xf160('0x8')]('unreadMessages',_0x393f70['length']);SmsInteractionEvents[_0xf160('0xb')](_0x194331+':'+_0xfdbd72['id'],_0xfdbd72);SmsInteractionEvents[_0xf160('0xb')](_0x194331,_0xfdbd72);_0x311d63(null);})[_0xf160('0xc')](_0x311d63(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0xf160('0xd')](e,emitEvent(event));}}module[_0xf160('0xe')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 6a941e0..fa7f016 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 _0x8507=['format','lodash','util','../../config/logger','moment','bluebird','path','../../config/environment','SmsInteraction','sms_interactions','changed','closed'];(function(_0x24c70a,_0x1adcc2){var _0x2136e6=function(_0x3bb6bd){while(--_0x3bb6bd){_0x24c70a['push'](_0x24c70a['shift']());}};_0x2136e6(++_0x1adcc2);}(_0x8507,0x139));var _0x7850=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8507[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x7850('0x0'));var util=require(_0x7850('0x1'));var logger=require(_0x7850('0x2'))('api');var moment=require(_0x7850('0x3'));var BPromise=require(_0x7850('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7850('0x5'));var rimraf=require('rimraf');var config=require(_0x7850('0x6'));var attributes=require('./smsInteraction.attributes');module['exports']=function(_0x83ded0,_0x278c58){return _0x83ded0['define'](_0x7850('0x7'),attributes,{'tableName':_0x7850('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x11db65,_0x1ef79,_0x53e7ed){if(_0x11db65[_0x7850('0x9')](_0x7850('0xa'))){_0x11db65['closedAt']=moment()[_0x7850('0xb')]('YYYY-MM-DD\x20HH:mm:ss');}_0x53e7ed(null,_0x11db65);}}});}; \ No newline at end of file +var _0xa1c1=['SmsInteraction','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x5559d4,_0x55943e){var _0x54b781=function(_0x3f73f9){while(--_0x3f73f9){_0x5559d4['push'](_0x5559d4['shift']());}};_0x54b781(++_0x55943e);}(_0xa1c1,0x19a));var _0x1a1c=function(_0x5831e6,_0x50bf1e){_0x5831e6=_0x5831e6-0x0;var _0x11ba60=_0xa1c1[_0x5831e6];return _0x11ba60;};'use strict';var _=require(_0x1a1c('0x0'));var util=require(_0x1a1c('0x1'));var logger=require(_0x1a1c('0x2'))('api');var moment=require('moment');var BPromise=require(_0x1a1c('0x3'));var rp=require(_0x1a1c('0x4'));var fs=require('fs');var path=require(_0x1a1c('0x5'));var rimraf=require(_0x1a1c('0x6'));var config=require(_0x1a1c('0x7'));var attributes=require('./smsInteraction.attributes');module[_0x1a1c('0x8')]=function(_0x476daf,_0x53bb93){return _0x476daf[_0x1a1c('0x9')](_0x1a1c('0xa'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xcbc378,_0x1b5e5f,_0x412215){if(_0xcbc378['changed'](_0x1a1c('0xb'))){_0xcbc378[_0x1a1c('0xc')]=moment()[_0x1a1c('0xd')](_0x1a1c('0xe'));}_0x412215(null,_0xcbc378);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index f67fff5..63a5e00 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 _0x7523=['AddTagsToSmsInteraction','find','omit','ids','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','UpdateSmsInteraction','SmsInteraction','body','options','raw','where','limit','then','catch'];(function(_0x4cb4a3,_0x3936e6){var _0x504ab9=function(_0x58d969){while(--_0x58d969){_0x4cb4a3['push'](_0x4cb4a3['shift']());}};_0x504ab9(++_0x3936e6);}(_0x7523,0x189));var _0x3752=function(_0x6db207,_0x5bd4db){_0x6db207=_0x6db207-0x0;var _0xb4a627=_0x7523[_0x6db207];return _0xb4a627;};'use strict';var _=require(_0x3752('0x0'));var util=require(_0x3752('0x1'));var moment=require(_0x3752('0x2'));var BPromise=require('bluebird');var rs=require(_0x3752('0x3'));var fs=require('fs');var Redis=require(_0x3752('0x4'));var db=require(_0x3752('0x5'))['db'];var utils=require(_0x3752('0x6'));var logger=require(_0x3752('0x7'))(_0x3752('0x8'));var config=require(_0x3752('0x9'));var jayson=require(_0x3752('0xa'));var client=jayson[_0x3752('0xb')][_0x3752('0xc')]({'port':0x232a});config[_0x3752('0xd')]=_[_0x3752('0xe')](config[_0x3752('0xd')],{'host':_0x3752('0xf'),'port':0x18eb});var socket=require(_0x3752('0x10'))(new Redis(config['redis']));require('./smsInteraction.socket')[_0x3752('0x11')](socket);function respondWithRpcPromise(_0x4f664c,_0x33216a,_0x3d818f){return new BPromise(function(_0x479c46,_0x42a1fa){return client[_0x3752('0x12')](_0x4f664c,_0x3d818f)['then'](function(_0x33b8af){logger['info'](_0x3752('0x13'),_0x33216a,_0x3752('0x14'));logger[_0x3752('0x15')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x33216a,'request\x20sent',JSON[_0x3752('0x16')](_0x33b8af));if(_0x33b8af[_0x3752('0x17')]){if(_0x33b8af['error'][_0x3752('0x18')]===0x1f4){logger[_0x3752('0x17')](_0x3752('0x13'),_0x33216a,_0x33b8af[_0x3752('0x17')][_0x3752('0x19')]);return _0x42a1fa(_0x33b8af[_0x3752('0x17')]['message']);}logger[_0x3752('0x17')](_0x3752('0x13'),_0x33216a,_0x33b8af[_0x3752('0x17')]['message']);return _0x479c46(_0x33b8af['error'][_0x3752('0x19')]);}else{logger[_0x3752('0x1a')](_0x3752('0x13'),_0x33216a,_0x3752('0x14'));_0x479c46(_0x33b8af[_0x3752('0x1b')]['message']);}})['catch'](function(_0x2edbba){logger[_0x3752('0x17')](_0x3752('0x13'),_0x33216a,_0x2edbba);_0x42a1fa(_0x2edbba);});});}exports[_0x3752('0x1c')]=function(_0x56581c){var _0x1dcb4b=this;return new Promise(function(_0x422bd8,_0x289ff8){return db[_0x3752('0x1d')]['update'](_0x56581c[_0x3752('0x1e')],{'raw':_0x56581c[_0x3752('0x1f')]?_0x56581c[_0x3752('0x1f')][_0x3752('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x56581c[_0x3752('0x1f')]?_0x56581c[_0x3752('0x1f')][_0x3752('0x21')]||null:null,'attributes':_0x56581c[_0x3752('0x1f')]?_0x56581c[_0x3752('0x1f')]['attributes']||null:null,'limit':_0x56581c[_0x3752('0x1f')]?_0x56581c[_0x3752('0x1f')][_0x3752('0x22')]||null:null})[_0x3752('0x23')](function(_0x9c3085){logger['info'](_0x3752('0x1c'),_0x56581c);logger[_0x3752('0x15')]('UpdateSmsInteraction',_0x56581c,JSON[_0x3752('0x16')](_0x9c3085));_0x422bd8(_0x9c3085);})[_0x3752('0x24')](function(_0xc8515){logger[_0x3752('0x17')](_0x3752('0x1c'),_0xc8515[_0x3752('0x19')],_0x56581c);_0x289ff8(_0x1dcb4b['error'](0x1f4,_0xc8515['message']));});});};exports[_0x3752('0x25')]=function(_0x26958e){return new Promise(function(_0x4c7efd,_0x25d705){return db[_0x3752('0x1d')][_0x3752('0x26')]({'where':_0x26958e[_0x3752('0x1f')]?_0x26958e[_0x3752('0x1f')][_0x3752('0x21')]||null:null})['then'](function(_0x106864){if(_0x106864){return _0x106864['addTags'](_0x26958e['body']['ids'],_[_0x3752('0x27')](_0x26958e['body'],[_0x3752('0x28'),'id'])||{});}})[_0x3752('0x29')](function(_0x5d085a){logger[_0x3752('0x1a')](_0x3752('0x2a'),_0x26958e);logger[_0x3752('0x15')]('AddTags',_0x26958e,JSON[_0x3752('0x16')](_0x5d085a));_0x4c7efd(_0x5d085a);})[_0x3752('0x24')](function(_0x150f03){logger[_0x3752('0x17')](_0x3752('0x2a'),_0x150f03[_0x3752('0x19')],_0x26958e);_0x25d705(_this[_0x3752('0x17')](0x1f4,_0x150f03[_0x3752('0x19')]));});});}; \ No newline at end of file +var _0xb8f7=['bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','redis','defaults','localhost','socket.io-emitter','register','request','info','SmsInteraction,\x20%s,\x20%s','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','update','body','options','raw','where','attributes','then','UpdateSmsInteraction','addTags','ids','omit','spread','AddTags','moment'];(function(_0x21a08a,_0x51be75){var _0x4be79e=function(_0x19c77e){while(--_0x19c77e){_0x21a08a['push'](_0x21a08a['shift']());}};_0x4be79e(++_0x51be75);}(_0xb8f7,0x102));var _0x7b8f=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0xb8f7[_0x1ccdf7];return _0x52a0ae;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7b8f('0x0'));var BPromise=require(_0x7b8f('0x1'));var rs=require(_0x7b8f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7b8f('0x3'))['db'];var utils=require(_0x7b8f('0x4'));var logger=require('../../config/logger')(_0x7b8f('0x5'));var config=require('../../config/environment');var jayson=require(_0x7b8f('0x6'));var client=jayson['client']['http']({'port':0x232a});config[_0x7b8f('0x7')]=_[_0x7b8f('0x8')](config[_0x7b8f('0x7')],{'host':_0x7b8f('0x9'),'port':0x18eb});var socket=require(_0x7b8f('0xa'))(new Redis(config[_0x7b8f('0x7')]));require('./smsInteraction.socket')[_0x7b8f('0xb')](socket);function respondWithRpcPromise(_0xdaf8e3,_0x2be335,_0x1fd4e0){return new BPromise(function(_0x55a535,_0x35f04a){return client[_0x7b8f('0xc')](_0xdaf8e3,_0x1fd4e0)['then'](function(_0x201b23){logger[_0x7b8f('0xd')](_0x7b8f('0xe'),_0x2be335,'request\x20sent');logger[_0x7b8f('0xf')](_0x7b8f('0x10'),_0x2be335,'request\x20sent',JSON[_0x7b8f('0x11')](_0x201b23));if(_0x201b23[_0x7b8f('0x12')]){if(_0x201b23[_0x7b8f('0x12')][_0x7b8f('0x13')]===0x1f4){logger[_0x7b8f('0x12')]('SmsInteraction,\x20%s,\x20%s',_0x2be335,_0x201b23[_0x7b8f('0x12')][_0x7b8f('0x14')]);return _0x35f04a(_0x201b23[_0x7b8f('0x12')][_0x7b8f('0x14')]);}logger[_0x7b8f('0x12')]('SmsInteraction,\x20%s,\x20%s',_0x2be335,_0x201b23[_0x7b8f('0x12')][_0x7b8f('0x14')]);return _0x55a535(_0x201b23[_0x7b8f('0x12')]['message']);}else{logger['info']('SmsInteraction,\x20%s,\x20%s',_0x2be335,_0x7b8f('0x15'));_0x55a535(_0x201b23[_0x7b8f('0x16')][_0x7b8f('0x14')]);}})[_0x7b8f('0x17')](function(_0x13c60d){logger[_0x7b8f('0x12')]('SmsInteraction,\x20%s,\x20%s',_0x2be335,_0x13c60d);_0x35f04a(_0x13c60d);});});}exports['UpdateSmsInteraction']=function(_0x47df9d){var _0x57db88=this;return new Promise(function(_0x22dde4,_0x3a7212){return db['SmsInteraction'][_0x7b8f('0x18')](_0x47df9d[_0x7b8f('0x19')],{'raw':_0x47df9d[_0x7b8f('0x1a')]?_0x47df9d[_0x7b8f('0x1a')][_0x7b8f('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x47df9d['options']?_0x47df9d['options'][_0x7b8f('0x1c')]||null:null,'attributes':_0x47df9d[_0x7b8f('0x1a')]?_0x47df9d[_0x7b8f('0x1a')][_0x7b8f('0x1d')]||null:null,'limit':_0x47df9d[_0x7b8f('0x1a')]?_0x47df9d[_0x7b8f('0x1a')]['limit']||null:null})[_0x7b8f('0x1e')](function(_0x5d3f27){logger[_0x7b8f('0xd')](_0x7b8f('0x1f'),_0x47df9d);logger[_0x7b8f('0xf')](_0x7b8f('0x1f'),_0x47df9d,JSON['stringify'](_0x5d3f27));_0x22dde4(_0x5d3f27);})[_0x7b8f('0x17')](function(_0x3fd63e){logger[_0x7b8f('0x12')](_0x7b8f('0x1f'),_0x3fd63e[_0x7b8f('0x14')],_0x47df9d);_0x3a7212(_0x57db88[_0x7b8f('0x12')](0x1f4,_0x3fd63e[_0x7b8f('0x14')]));});});};exports['AddTagsToSmsInteraction']=function(_0x229a86){return new Promise(function(_0x3200d6,_0x15a1cd){return db['SmsInteraction']['find']({'where':_0x229a86['options']?_0x229a86[_0x7b8f('0x1a')][_0x7b8f('0x1c')]||null:null})[_0x7b8f('0x1e')](function(_0x14998b){if(_0x14998b){return _0x14998b[_0x7b8f('0x20')](_0x229a86[_0x7b8f('0x19')][_0x7b8f('0x21')],_[_0x7b8f('0x22')](_0x229a86['body'],['ids','id'])||{});}})[_0x7b8f('0x23')](function(_0x294882){logger[_0x7b8f('0xd')]('AddTags',_0x229a86);logger[_0x7b8f('0xf')](_0x7b8f('0x24'),_0x229a86,JSON[_0x7b8f('0x11')](_0x294882));_0x3200d6(_0x294882);})[_0x7b8f('0x17')](function(_0x3a33a7){logger[_0x7b8f('0x12')](_0x7b8f('0x24'),_0x3a33a7[_0x7b8f('0x14')],_0x229a86);_0x15a1cd(_this['error'](0x1f4,_0x3a33a7[_0x7b8f('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 0a61730..79fda6d 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 _0x63bc=['save','remove','removeListener','register','smsInteraction:'];(function(_0x3ed9bb,_0x2c4813){var _0x4169aa=function(_0x490539){while(--_0x490539){_0x3ed9bb['push'](_0x3ed9bb['shift']());}};_0x4169aa(++_0x2c4813);}(_0x63bc,0x19a));var _0xc63b=function(_0x1e3a68,_0x324337){_0x1e3a68=_0x1e3a68-0x0;var _0x58a501=_0x63bc[_0x1e3a68];return _0x58a501;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0xc63b('0x0'),_0xc63b('0x1'),'update'];function createListener(_0x4edd2f,_0x46f374){return function(_0x146a59){_0x46f374['emit'](_0x4edd2f,_0x146a59);};}function removeListener(_0x5bf152,_0x131a67){return function(){SmsInteractionEvents[_0xc63b('0x2')](_0x5bf152,_0x131a67);};}exports[_0xc63b('0x3')]=function(_0x5e5e23){for(var _0x2c759f=0x0,_0x5ab51e=events['length'];_0x2c759f<_0x5ab51e;_0x2c759f++){var _0x5f462d=events[_0x2c759f];var _0x15b63d=createListener(_0xc63b('0x4')+_0x5f462d,_0x5e5e23);SmsInteractionEvents['on'](_0x5f462d,_0x15b63d);}}; \ No newline at end of file +var _0x46f5=['length','smsInteraction:','save','remove','removeListener','register'];(function(_0x3af7ec,_0xe7b366){var _0x51aadb=function(_0x204c86){while(--_0x204c86){_0x3af7ec['push'](_0x3af7ec['shift']());}};_0x51aadb(++_0xe7b366);}(_0x46f5,0x1e8));var _0x546f=function(_0x399952,_0x4b61a8){_0x399952=_0x399952-0x0;var _0x111355=_0x46f5[_0x399952];return _0x111355;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0x546f('0x0'),_0x546f('0x1'),'update'];function createListener(_0xb408ed,_0x37b33a){return function(_0x4c92c8){_0x37b33a['emit'](_0xb408ed,_0x4c92c8);};}function removeListener(_0x4613f3,_0xf2b71){return function(){SmsInteractionEvents[_0x546f('0x2')](_0x4613f3,_0xf2b71);};}exports[_0x546f('0x3')]=function(_0x4810ad){for(var _0x2a85aa=0x0,_0x5685b7=events[_0x546f('0x4')];_0x2a85aa<_0x5685b7;_0x2a85aa++){var _0x5cfc53=events[_0x2a85aa];var _0x5041ba=createListener(_0x546f('0x5')+_0x5cfc53,_0x4810ad);SmsInteractionEvents['on'](_0x5cfc53,_0x5041ba);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index aa7f82c..7d85d0e 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 _0x17f8=['express','fs-extra','../../components/interaction/service','../../config/environment','get','/describe','describe','/:id','isAuthenticated','show','post','tracked','sms','smsmessage:create','create','/:id/status','status','put','update','/:id/accept','accept','/:id/reject','reject','util','path','connect-timeout'];(function(_0x260ce2,_0x2e22b8){var _0x16b105=function(_0x260a06){while(--_0x260a06){_0x260ce2['push'](_0x260ce2['shift']());}};_0x16b105(++_0x2e22b8);}(_0x17f8,0x11b));var _0x817f=function(_0x2ab688,_0x206b54){_0x2ab688=_0x2ab688-0x0;var _0x352100=_0x17f8[_0x2ab688];return _0x352100;};'use strict';var multer=require('multer');var util=require(_0x817f('0x0'));var path=require(_0x817f('0x1'));var timeout=require(_0x817f('0x2'));var express=require(_0x817f('0x3'));var router=express['Router']();var fs_extra=require(_0x817f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x817f('0x5'));var config=require(_0x817f('0x6'));var controller=require('./smsMessage.controller');router[_0x817f('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x817f('0x7')](_0x817f('0x8'),auth['isAuthenticated'](),controller[_0x817f('0x9')]);router[_0x817f('0x7')](_0x817f('0xa'),auth[_0x817f('0xb')](),controller[_0x817f('0xc')]);router[_0x817f('0xd')]('/',auth[_0x817f('0xb')](),interaction[_0x817f('0xe')](_0x817f('0xf'),_0x817f('0x10')),controller[_0x817f('0x11')]);router['post'](_0x817f('0x12'),controller[_0x817f('0x13')]);router[_0x817f('0x14')](_0x817f('0xa'),auth['isAuthenticated'](),controller[_0x817f('0x15')]);router['put'](_0x817f('0x16'),auth[_0x817f('0xb')](),controller[_0x817f('0x17')]);router[_0x817f('0x14')](_0x817f('0x18'),auth['isAuthenticated'](),controller[_0x817f('0x19')]);router['delete'](_0x817f('0xa'),auth[_0x817f('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xe547=['../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','index','describe','/:id','show','post','tracked','sms','smsmessage:create','create','/:id/status','status','update','/:id/accept','accept','put','/:id/reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra'];(function(_0x53f55c,_0x3b2889){var _0x332c7d=function(_0x4d757d){while(--_0x4d757d){_0x53f55c['push'](_0x53f55c['shift']());}};_0x332c7d(++_0x3b2889);}(_0xe547,0x191));var _0x7e54=function(_0x2845ba,_0x222f5e){_0x2845ba=_0x2845ba-0x0;var _0x4fc159=_0xe547[_0x2845ba];return _0x4fc159;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7e54('0x0'));var timeout=require(_0x7e54('0x1'));var express=require(_0x7e54('0x2'));var router=express[_0x7e54('0x3')]();var fs_extra=require(_0x7e54('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x7e54('0x5'));var config=require(_0x7e54('0x6'));var controller=require(_0x7e54('0x7'));router[_0x7e54('0x8')]('/',auth[_0x7e54('0x9')](),controller[_0x7e54('0xa')]);router[_0x7e54('0x8')]('/describe',auth[_0x7e54('0x9')](),controller[_0x7e54('0xb')]);router[_0x7e54('0x8')](_0x7e54('0xc'),auth[_0x7e54('0x9')](),controller[_0x7e54('0xd')]);router[_0x7e54('0xe')]('/',auth[_0x7e54('0x9')](),interaction[_0x7e54('0xf')](_0x7e54('0x10'),_0x7e54('0x11')),controller[_0x7e54('0x12')]);router[_0x7e54('0xe')](_0x7e54('0x13'),controller[_0x7e54('0x14')]);router['put'](_0x7e54('0xc'),auth[_0x7e54('0x9')](),controller[_0x7e54('0x15')]);router['put'](_0x7e54('0x16'),auth[_0x7e54('0x9')](),controller[_0x7e54('0x17')]);router[_0x7e54('0x18')](_0x7e54('0x19'),auth['isAuthenticated'](),controller['reject']);router[_0x7e54('0x1a')]('/:id',auth[_0x7e54('0x9')](),controller[_0x7e54('0x1b')]);module[_0x7e54('0x1c')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index a0054b7..d3f8779 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 _0x9dcb=['DATE','TEXT','sequelize','exports','medium','BOOLEAN','out','STRING'];(function(_0x2ed3ff,_0x4d3041){var _0x2ece12=function(_0x5a9f1d){while(--_0x5a9f1d){_0x2ed3ff['push'](_0x2ed3ff['shift']());}};_0x2ece12(++_0x4d3041);}(_0x9dcb,0x172));var _0xb9dc=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9dcb[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require(_0xb9dc('0x0'));module[_0xb9dc('0x1')]={'body':{'type':Sequelize['TEXT'](_0xb9dc('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xb9dc('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xb9dc('0x4')),'defaultValue':_0xb9dc('0x4'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0xb9dc('0x5')]},'readAt':{'type':Sequelize[_0xb9dc('0x6')]},'secret':{'type':Sequelize[_0xb9dc('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xb9dc('0x5')]},'providerResponse':{'type':Sequelize[_0xb9dc('0x7')]}}; \ No newline at end of file +var _0xa74d=['out','STRING','TEXT','sequelize','exports','medium','BOOLEAN','ENUM'];(function(_0x419710,_0x29532d){var _0x9751d7=function(_0x46b0fd){while(--_0x46b0fd){_0x419710['push'](_0x419710['shift']());}};_0x9751d7(++_0x29532d);}(_0xa74d,0x193));var _0xda74=function(_0x22754d,_0x3ffa6b){_0x22754d=_0x22754d-0x0;var _0x4e2724=_0xa74d[_0x22754d];return _0x4e2724;};'use strict';var Sequelize=require(_0xda74('0x0'));module[_0xda74('0x1')]={'body':{'type':Sequelize['TEXT'](_0xda74('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xda74('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xda74('0x4')]('in',_0xda74('0x5')),'defaultValue':_0xda74('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0xda74('0x6')](0xbe)},'phone':{'type':Sequelize[_0xda74('0x6')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0xda74('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xda74('0x7')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index e132baf..2e34472 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 _0x83d4=['status','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','sendStatus','name','send','SmsMessage','rawAttributes','type','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','offset','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','catch','params','find','create','body','destroy','describe','sms-interactions','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','SmsInteraction','SmsInteractionId','isNil','interaction','get','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','stringify','null','acceptMessage','ContactId','sequelize','QueryTypes','SELECT','contact','User','agent','fullname','manual','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','../../config/logger','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','Sequelize','email','internal','rejectmessage','SmsAccount','SmsAccountId','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','inspect','plivo','MessageUUID','delivered','Status','plivio','infobip','results','DELIVERED','eml-format','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','then','info','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','SmsMessage,\x20%s,\x20%s','message','end'];(function(_0x5ed116,_0x11c160){var _0x576192=function(_0x1d4178){while(--_0x1d4178){_0x5ed116['push'](_0x5ed116['shift']());}};_0x576192(++_0x11c160);}(_0x83d4,0xf1));var _0x483d=function(_0x281823,_0x25bdeb){_0x281823=_0x281823-0x0;var _0x579cd3=_0x83d4[_0x281823];return _0x579cd3;};'use strict';var emlformat=require(_0x483d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x483d('0x1'));var rp=require('request-promise');var moment=require(_0x483d('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x483d('0x3'));var util=require(_0x483d('0x4'));var path=require(_0x483d('0x5'));var sox=require(_0x483d('0x6'));var csv=require(_0x483d('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x483d('0x8'));var _=require(_0x483d('0x9'));var squel=require(_0x483d('0xa'));var crypto=require(_0x483d('0xb'));var jsforce=require(_0x483d('0xc'));var deskjs=require(_0x483d('0xd'));var toCsv=require(_0x483d('0x7'));var querystring=require(_0x483d('0xe'));var Papa=require(_0x483d('0xf'));var Redis=require('ioredis');var authService=require(_0x483d('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x483d('0x11'));var hardwareService=require(_0x483d('0x12'));var logger=require('../../config/logger')(_0x483d('0x13'));var utils=require(_0x483d('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x483d('0x15')]=_['defaults'](config[_0x483d('0x15')],{'host':_0x483d('0x16'),'port':0x18eb});var socket=require(_0x483d('0x17'))(new Redis(config[_0x483d('0x15')]));require('./smsMessage.socket')[_0x483d('0x18')](socket);var jayson=require(_0x483d('0x19'));var client=jayson[_0x483d('0x1a')][_0x483d('0x1b')]({'port':0x232c});var client9002=jayson['client'][_0x483d('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x659927,_0x51d4e0,_0x572926,_0x4969b4){return new BPromise(function(_0x2b8b7f,_0x2f25e5){var _0x4306ab=_0x4969b4||client;return _0x4306ab['request'](_0x659927,_0x572926)[_0x483d('0x1c')](function(_0x258293){logger[_0x483d('0x1d')]('SmsMessage,\x20%s,\x20%s',_0x51d4e0,'request\x20sent');logger[_0x483d('0x1e')](_0x483d('0x1f'),_0x51d4e0,'request\x20sent',JSON['stringify'](_0x258293));if(_0x258293[_0x483d('0x20')]){if(_0x258293[_0x483d('0x20')][_0x483d('0x21')]===0x1f4){logger[_0x483d('0x20')](_0x483d('0x22'),_0x51d4e0,_0x258293[_0x483d('0x20')][_0x483d('0x23')]);return _0x2f25e5(_0x258293[_0x483d('0x20')][_0x483d('0x23')]);}logger['error']('SmsMessage,\x20%s,\x20%s',_0x51d4e0,_0x258293['error']['message']);return _0x2b8b7f(_0x258293[_0x483d('0x20')][_0x483d('0x23')]);}else{logger[_0x483d('0x1d')](_0x483d('0x22'),_0x51d4e0,'request\x20sent');_0x2b8b7f(_0x258293['result'][_0x483d('0x23')]);}})['catch'](function(_0x1bf9dc){logger[_0x483d('0x20')](_0x483d('0x22'),_0x51d4e0,_0x1bf9dc);_0x2f25e5(_0x1bf9dc);});});}function respondWithStatusCode(_0x1311cf,_0x1cfd27){_0x1cfd27=_0x1cfd27||0xcc;return function(_0x2e2204){if(_0x2e2204){return _0x1311cf['sendStatus'](_0x1cfd27);}return _0x1311cf['status'](_0x1cfd27)[_0x483d('0x24')]();};}function respondWithResult(_0x446472,_0x5f1841){_0x5f1841=_0x5f1841||0xc8;return function(_0x25a078){if(_0x25a078){return _0x446472[_0x483d('0x25')](_0x5f1841)[_0x483d('0x26')](_0x25a078);}};}function respondWithFilteredResult(_0x5310e7,_0x402e66){return function(_0x3976b5){if(_0x3976b5){var _0x24435a=typeof _0x402e66['offset']===_0x483d('0x27')&&typeof _0x402e66[_0x483d('0x28')]===_0x483d('0x27');var _0x474a83=_0x3976b5[_0x483d('0x29')];var _0x5ac9ef=_0x24435a?0x0:_0x402e66['offset'];var _0x41ffb6=_0x24435a?_0x3976b5[_0x483d('0x29')]:_0x402e66['offset']+_0x402e66[_0x483d('0x28')];var _0x3a4d01;if(_0x41ffb6>=_0x474a83){_0x41ffb6=_0x474a83;_0x3a4d01=0xc8;}else{_0x3a4d01=0xce;}_0x5310e7['status'](_0x3a4d01);return _0x5310e7[_0x483d('0x2a')](_0x483d('0x2b'),_0x5ac9ef+'-'+_0x41ffb6+'/'+_0x474a83)[_0x483d('0x26')](_0x3976b5);}return null;};}function patchUpdates(_0x5c0c4e){return function(_0x544f2d){try{jsonpatch[_0x483d('0x2c')](_0x544f2d,_0x5c0c4e,!![]);}catch(_0x2cb94d){return BPromise[_0x483d('0x2d')](_0x2cb94d);}return _0x544f2d[_0x483d('0x2e')]();};}function saveUpdates(_0x343347,_0x391234){return function(_0x2780dc){if(_0x2780dc){return _0x2780dc[_0x483d('0x2f')](_0x343347)[_0x483d('0x1c')](function(_0x349c17){return _0x349c17;});}return null;};}function removeEntity(_0x429235,_0xcc2f10){return function(_0x22b06e){if(_0x22b06e){return _0x22b06e['destroy']()[_0x483d('0x1c')](function(){_0x429235[_0x483d('0x25')](0xcc)[_0x483d('0x24')]();});}};}function handleEntityNotFound(_0x2a457c,_0x1938f9){return function(_0x4dbe84){if(!_0x4dbe84){_0x2a457c[_0x483d('0x30')](0x194);}return _0x4dbe84;};}function handleError(_0x2d1554,_0x2f0a2e){_0x2f0a2e=_0x2f0a2e||0x1f4;return function(_0x8bbeeb){logger[_0x483d('0x20')](_0x8bbeeb['stack']);if(_0x8bbeeb[_0x483d('0x31')]){delete _0x8bbeeb['name'];}_0x2d1554['status'](_0x2f0a2e)[_0x483d('0x32')](_0x8bbeeb);};}exports['index']=function(_0xcaf80d,_0x53cb1a){var _0x9e6754={},_0x2ba5d4={},_0x58026e={'count':0x0,'rows':[]};var _0x1a70a3=_['map'](db[_0x483d('0x33')][_0x483d('0x34')],function(_0x3b61d4){return{'name':_0x3b61d4['fieldName'],'type':_0x3b61d4[_0x483d('0x35')]['key']};});_0x2ba5d4[_0x483d('0x36')]=_[_0x483d('0x37')](_0x1a70a3,_0x483d('0x31'));_0x2ba5d4[_0x483d('0x38')]=_[_0x483d('0x39')](_0xcaf80d[_0x483d('0x38')]);_0x2ba5d4[_0x483d('0x3a')]=_[_0x483d('0x3b')](_0x2ba5d4[_0x483d('0x36')],_0x2ba5d4[_0x483d('0x38')]);_0x9e6754[_0x483d('0x3c')]=_[_0x483d('0x3b')](_0x2ba5d4[_0x483d('0x36')],qs[_0x483d('0x3d')](_0xcaf80d['query'][_0x483d('0x3d')]));_0x9e6754[_0x483d('0x3c')]=_0x9e6754[_0x483d('0x3c')][_0x483d('0x3e')]?_0x9e6754[_0x483d('0x3c')]:_0x2ba5d4[_0x483d('0x36')];if(!_0xcaf80d[_0x483d('0x38')]['hasOwnProperty'](_0x483d('0x3f'))){_0x9e6754['limit']=qs[_0x483d('0x28')](_0xcaf80d[_0x483d('0x38')]['limit']);_0x9e6754[_0x483d('0x40')]=qs[_0x483d('0x40')](_0xcaf80d[_0x483d('0x38')][_0x483d('0x40')]);}_0x9e6754['order']=qs[_0x483d('0x41')](_0xcaf80d[_0x483d('0x38')][_0x483d('0x41')]);_0x9e6754[_0x483d('0x42')]=qs[_0x483d('0x3a')](_[_0x483d('0x43')](_0xcaf80d[_0x483d('0x38')],_0x2ba5d4[_0x483d('0x3a')]),_0x1a70a3);if(_0xcaf80d['query']['filter']){_0x9e6754[_0x483d('0x42')]=_[_0x483d('0x44')](_0x9e6754[_0x483d('0x42')],{'$or':_[_0x483d('0x37')](_0x1a70a3,function(_0x2ce341){if(_0x2ce341['type']!==_0x483d('0x45')){var _0x2545b1={};_0x2545b1[_0x2ce341['name']]={'$like':'%'+_0xcaf80d[_0x483d('0x38')][_0x483d('0x46')]+'%'};return _0x2545b1;}})});}_0x9e6754=_[_0x483d('0x44')]({},_0x9e6754,_0xcaf80d[_0x483d('0x47')]);var _0x3c80f2={'where':_0x9e6754[_0x483d('0x42')]};return db[_0x483d('0x33')][_0x483d('0x29')](_0x3c80f2)[_0x483d('0x1c')](function(_0x5c2cfa){_0x58026e[_0x483d('0x29')]=_0x5c2cfa;if(_0xcaf80d[_0x483d('0x38')][_0x483d('0x48')]){_0x9e6754[_0x483d('0x49')]=[{'all':!![]}];}return db[_0x483d('0x33')]['findAll'](_0x9e6754);})[_0x483d('0x1c')](function(_0x14e1df){_0x58026e['rows']=_0x14e1df;return _0x58026e;})[_0x483d('0x1c')](respondWithFilteredResult(_0x53cb1a,_0x9e6754))[_0x483d('0x4a')](handleError(_0x53cb1a,null));};exports['show']=function(_0x5273bd,_0x32056f){var _0x418438={'raw':!![],'where':{'id':_0x5273bd[_0x483d('0x4b')]['id']}},_0x582b75={};_0x582b75[_0x483d('0x36')]=_[_0x483d('0x39')](db[_0x483d('0x33')][_0x483d('0x34')]);_0x582b75[_0x483d('0x38')]=_['keys'](_0x5273bd[_0x483d('0x38')]);_0x582b75[_0x483d('0x3a')]=_['intersection'](_0x582b75[_0x483d('0x36')],_0x582b75[_0x483d('0x38')]);_0x418438['attributes']=_[_0x483d('0x3b')](_0x582b75[_0x483d('0x36')],qs['fields'](_0x5273bd[_0x483d('0x38')]['fields']));_0x418438[_0x483d('0x3c')]=_0x418438[_0x483d('0x3c')]['length']?_0x418438[_0x483d('0x3c')]:_0x582b75[_0x483d('0x36')];if(_0x5273bd[_0x483d('0x38')][_0x483d('0x48')]){_0x418438['include']=[{'all':!![]}];}_0x418438=_[_0x483d('0x44')]({},_0x418438,_0x5273bd[_0x483d('0x47')]);return db[_0x483d('0x33')][_0x483d('0x4c')](_0x418438)['then'](handleEntityNotFound(_0x32056f,null))[_0x483d('0x1c')](respondWithResult(_0x32056f,null))[_0x483d('0x4a')](handleError(_0x32056f,null));};exports[_0x483d('0x4d')]=function(_0x3c9b28,_0x2b6e08){return db['SmsMessage'][_0x483d('0x4d')](_0x3c9b28[_0x483d('0x4e')],{})['then'](respondWithResult(_0x2b6e08,0xc9))[_0x483d('0x4a')](handleError(_0x2b6e08,null));};exports[_0x483d('0x2f')]=function(_0x3c501c,_0x36abda){if(_0x3c501c[_0x483d('0x4e')]['id']){delete _0x3c501c[_0x483d('0x4e')]['id'];}return db[_0x483d('0x33')][_0x483d('0x4c')]({'where':{'id':_0x3c501c[_0x483d('0x4b')]['id']}})[_0x483d('0x1c')](handleEntityNotFound(_0x36abda,null))['then'](saveUpdates(_0x3c501c[_0x483d('0x4e')],null))[_0x483d('0x1c')](respondWithResult(_0x36abda,null))[_0x483d('0x4a')](handleError(_0x36abda,null));};exports[_0x483d('0x4f')]=function(_0x329bc0,_0x2dc9f9){return db['SmsMessage']['find']({'where':{'id':_0x329bc0[_0x483d('0x4b')]['id']}})[_0x483d('0x1c')](handleEntityNotFound(_0x2dc9f9,null))[_0x483d('0x1c')](removeEntity(_0x2dc9f9,null))[_0x483d('0x4a')](handleError(_0x2dc9f9,null));};exports['describe']=function(_0x4ac1fd,_0x3806e0){return db[_0x483d('0x33')][_0x483d('0x50')]()[_0x483d('0x1c')](respondWithResult(_0x3806e0,null))[_0x483d('0x4a')](handleError(_0x3806e0,null));};var interaction_log=require('../../config/logger')(_0x483d('0x51'));exports['accept']=function(_0x3fdd84,_0x53736b,_0x269c31){var _0x50a46c={'agent':{},'channel':_0x483d('0x52')};if(_0x3fdd84[_0x483d('0x4e')]['id']){delete _0x3fdd84[_0x483d('0x4e')]['id'];}_0x3fdd84[_0x483d('0x4e')][_0x483d('0x53')]=!![];_0x3fdd84[_0x483d('0x4e')][_0x483d('0x54')]=moment()[_0x483d('0x55')](_0x483d('0x56'));_0x3fdd84[_0x483d('0x4e')][_0x483d('0x57')]=_0x3fdd84[_0x483d('0x4e')]['UserId']||_0x3fdd84['user']['id'];_0x50a46c['agent']['id']=_0x3fdd84[_0x483d('0x4e')][_0x483d('0x57')];return db['SmsMessage'][_0x483d('0x4c')]({'where':{'id':_0x3fdd84[_0x483d('0x4b')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x53736b,null))[_0x483d('0x1c')](saveUpdates(_0x3fdd84['body'],null))[_0x483d('0x1c')](function(_0x59d6d9){if(_0x59d6d9){_0x50a46c[_0x483d('0x23')]=_0x59d6d9['get']({'plain':!![]});return db[_0x483d('0x58')]['find']({'where':{'id':_0x59d6d9[_0x483d('0x59')]}});}return null;})[_0x483d('0x1c')](handleEntityNotFound(_0x53736b,null))[_0x483d('0x1c')](function(_0x103067){if(_0x103067){return _0x103067['update']({'UserId':_0x3fdd84['body'][_0x483d('0x57')],'read1stAt':_[_0x483d('0x5a')](_0x103067['read1stAt'])?moment()[_0x483d('0x55')](_0x483d('0x56')):undefined});}return null;})['then'](function(_0x350ab9){if(_0x350ab9){_0x50a46c[_0x483d('0x5b')]=_0x350ab9[_0x483d('0x5c')]({'plain':!![]});interaction_log[_0x483d('0x1d')](_0x483d('0x5d'),_0x3fdd84['user']['id'],_0x3fdd84[_0x483d('0x5e')][_0x483d('0x31')],_0x3fdd84[_0x483d('0x5e')]['role'],_0x50a46c[_0x483d('0x5b')]['id'],_0x3fdd84[_0x483d('0x4e')]?JSON[_0x483d('0x5f')](_0x3fdd84[_0x483d('0x4e')]):_0x483d('0x60'));return respondWithRpcPromise('AcceptMessage',_0x483d('0x61'),_0x50a46c);}return null;})['then'](function(_0x4a33a8){var _0x355dbd='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4a33a8[_0x483d('0x23')][_0x483d('0x62')];return db[_0x483d('0x63')]['query'](_0x355dbd,{'type':db['Sequelize'][_0x483d('0x64')][_0x483d('0x65')],'raw':!![]})[_0x483d('0x1c')](function(_0x1773b0){return _0x1773b0;});})[_0x483d('0x1c')](function(_0x45421d){if(_0x45421d){_0x50a46c[_0x483d('0x23')][_0x483d('0x66')]=_0x45421d[0x0];if(!_0x3fdd84[_0x483d('0x4e')][_0x483d('0x57')])return;return db[_0x483d('0x67')][_0x483d('0x4c')]({'where':{'id':_0x3fdd84[_0x483d('0x4e')][_0x483d('0x57')],'role':_0x483d('0x68')},'attributes':['id',_0x483d('0x31'),_0x483d('0x69'),'email','internal'],'raw':!![]});}return null;})[_0x483d('0x1c')](function(_0x39458e){if(!_0x39458e)return null;_0x50a46c['message'][_0x483d('0x68')]=_0x39458e;return _0x50a46c;})[_0x483d('0x1c')](function(_0xeb1b1d){if(_0xeb1b1d){if(_0x3fdd84[_0x483d('0x4e')][_0x483d('0x6a')]){_0x50a46c['message'][_0x483d('0x6b')]=util[_0x483d('0x55')](_0x483d('0x6c'),_0x3fdd84[_0x483d('0x5e')]['name']);_0x50a46c['message'][_0x483d('0x6d')]=_0x50a46c[_0x483d('0x6d')];_0x50a46c[_0x483d('0x23')][_0x483d('0x6e')]=_0x50a46c[_0x483d('0x6d')];_0x50a46c[_0x483d('0x23')][_0x483d('0x6f')]=_0x483d('0x70');return respondWithRpcPromise(_0x483d('0x71'),_0x483d('0x71'),{'event':_0x483d('0x72'),'message':_0x50a46c['message']},client9002)[_0x483d('0x1c')](function(){return _0x50a46c;});}return _0x50a46c;}return null;})['then'](respondWithResult(_0x53736b,null))[_0x483d('0x4a')](handleError(_0x53736b,null));};var interaction_log=require(_0x483d('0x73'))(_0x483d('0x51'));exports[_0x483d('0x2d')]=function(_0x4a53b5,_0x13ba5a,_0x1e99c7){var _0x4301ae={'agent':{},'channel':_0x483d('0x52')};if(_0x4a53b5[_0x483d('0x4e')]['id']){delete _0x4a53b5[_0x483d('0x4e')]['id'];}_0x4a53b5[_0x483d('0x4e')][_0x483d('0x57')]=_0x4a53b5[_0x483d('0x4e')]['UserId']||_0x4a53b5[_0x483d('0x5e')]['id'];_0x4301ae[_0x483d('0x68')]['id']=_0x4a53b5[_0x483d('0x4e')][_0x483d('0x57')];return db[_0x483d('0x33')][_0x483d('0x4c')]({'where':{'id':_0x4a53b5[_0x483d('0x4b')]['id'],'UserId':null}})[_0x483d('0x1c')](handleEntityNotFound(_0x13ba5a,null))[_0x483d('0x1c')](function(_0x55d418){if(_0x55d418){_0x4301ae['message']=_0x55d418[_0x483d('0x5c')]({'plain':!![]});return db['SmsInteraction'][_0x483d('0x4c')]({'where':{'id':_0x55d418[_0x483d('0x59')]}});}return null;})[_0x483d('0x1c')](handleEntityNotFound(_0x13ba5a,null))['then'](function(_0x1b45fe){if(_0x1b45fe){_0x4301ae[_0x483d('0x5b')]=_0x1b45fe[_0x483d('0x5c')]({'plain':!![]});interaction_log[_0x483d('0x1d')](_0x483d('0x74'),_0x4a53b5[_0x483d('0x5e')]['id'],_0x4a53b5['user']['name'],_0x4a53b5[_0x483d('0x5e')][_0x483d('0x75')],_0x4301ae['interaction']['id'],_0x4a53b5['body']?JSON[_0x483d('0x5f')](_0x4a53b5[_0x483d('0x4e')]):_0x483d('0x60'));return respondWithRpcPromise(_0x483d('0x76'),_0x483d('0x77'),_0x4301ae);}return null;})[_0x483d('0x1c')](function(_0x4e8790){var _0x1029fc='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4e8790['message'][_0x483d('0x62')];return db[_0x483d('0x63')][_0x483d('0x38')](_0x1029fc,{'type':db[_0x483d('0x78')]['QueryTypes']['SELECT'],'raw':!![]})[_0x483d('0x1c')](function(_0x11eacc){return _0x11eacc;});})[_0x483d('0x1c')](function(_0x415c06){if(_0x415c06){_0x4301ae[_0x483d('0x23')][_0x483d('0x66')]=_0x415c06[0x0];if(!_0x4a53b5[_0x483d('0x4e')]['UserId'])return;return db[_0x483d('0x67')]['find']({'where':{'id':_0x4a53b5[_0x483d('0x4e')][_0x483d('0x57')],'role':'agent'},'attributes':['id',_0x483d('0x31'),'fullname',_0x483d('0x79'),_0x483d('0x7a')],'raw':!![]});}return null;})['then'](function(_0x202d22){if(!_0x202d22)return null;_0x4301ae[_0x483d('0x23')][_0x483d('0x68')]=_0x202d22;return _0x4301ae;})[_0x483d('0x1c')](function(_0x1ad03c){if(_0x1ad03c){_0x1ad03c[_0x483d('0x23')]['interface']=util[_0x483d('0x55')](_0x483d('0x6c'),_0x4a53b5['user'][_0x483d('0x31')]);_0x1ad03c['message']['channel']=_0x4301ae['channel'];_0x1ad03c[_0x483d('0x23')][_0x483d('0x6e')]=_0x4301ae[_0x483d('0x6d')];_0x1ad03c[_0x483d('0x23')][_0x483d('0x6f')]=_0x483d('0x2d');respondWithRpcPromise(_0x483d('0x71'),_0x483d('0x71'),{'event':_0x483d('0x7b'),'message':_0x1ad03c['message']},client9002);return _0x4301ae;}return null;})[_0x483d('0x1c')](respondWithResult(_0x13ba5a,null))[_0x483d('0x4a')](handleError(_0x13ba5a,null));};exports[_0x483d('0x25')]=function(_0xc147d8,_0x2fa9b6,_0x106f0c){if(_0xc147d8[_0x483d('0x4e')]['id']){delete _0xc147d8[_0x483d('0x4e')]['id'];}var _0x372aed;return db[_0x483d('0x33')][_0x483d('0x4c')]({'where':{'id':_0xc147d8[_0x483d('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2fa9b6,null))[_0x483d('0x1c')](function(_0x253cd3){if(_0x253cd3){_0x372aed=_0x253cd3;return db[_0x483d('0x7c')][_0x483d('0x4c')]({'where':{'id':_0x253cd3[_0x483d('0x7d')]}});}})[_0x483d('0x1c')](handleEntityNotFound(_0x2fa9b6,null))[_0x483d('0x1c')](function(_0x371e23){if(_0x371e23){logger[_0x483d('0x1e')](_0x483d('0x1f'),_0x483d('0x25'),'received\x20delivery\x20report\x20from',_0x371e23[_0x483d('0x35')],util['inspect'](_0xc147d8[_0x483d('0x4e')],{'showHidden':![],'depth':null}));switch(_0x371e23['type']){case _0x483d('0x7e'):if(_0xc147d8['body'][_0x483d('0x7f')]&&_0xc147d8[_0x483d('0x4e')]['MessageSid']===_0x372aed[_0x483d('0x80')]){return _0x372aed[_0x483d('0x2f')]({'read':!![]});}else{logger['error'](_0x483d('0x81'),_0x483d('0x25'),_0x483d('0x7e'),util[_0x483d('0x82')](_0xc147d8[_0x483d('0x4e')],{'showHidden':![],'depth':null}));}break;case _0x483d('0x83'):if(_0xc147d8['body'][_0x483d('0x84')]&&_0xc147d8[_0x483d('0x4e')][_0x483d('0x84')]===_0x372aed[_0x483d('0x80')]&&_['indexOf'](['sent',_0x483d('0x85')],_0xc147d8[_0x483d('0x4e')][_0x483d('0x86')])>=0x0){return _0x372aed[_0x483d('0x2f')]({'read':!![]});}else{logger[_0x483d('0x20')](_0x483d('0x81'),_0x483d('0x25'),_0x483d('0x87'),util[_0x483d('0x82')](_0xc147d8['body'],{'showHidden':![],'depth':null}));}break;case _0x483d('0x88'):var _0x27f519=_0xc147d8['body'][_0x483d('0x89')][0x0];if(_0x27f519['status']['groupName']===_0x483d('0x8a')){return _0x372aed['update']({'read':!![]});}else{logger[_0x483d('0x20')](_0x483d('0x81'),_0x483d('0x25'),'infobip',util[_0x483d('0x82')](_0xc147d8['body'],{'showHidden':![],'depth':null}));}break;}return _0x372aed;}})[_0x483d('0x1c')](respondWithResult(_0x2fa9b6,null))[_0x483d('0x4a')](handleError(_0x2fa9b6,null));}; \ No newline at end of file +var _0xbbaf=['null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','QueryTypes','SELECT','contact','User','internal','interface','SIP/%s','channel','motionChannel','accept','EventManager','sms','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','ContactId','sequelize','fullname','email','event','rejectmessage','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','inspect','MessageSid','MessageUUID','messageId','indexOf','sent','delivered','Status','plivio','infobip','results','groupName','DELIVERED','SmsAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','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','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./smsMessage.socket','jayson/promise','client','http','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','sendStatus','name','send','index','map','SmsMessage','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','describe','../../config/logger','sms-interactions','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteraction','SmsInteractionId','isNil','format','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role'];(function(_0x3039e0,_0x155469){var _0x3d817f=function(_0x4ed810){while(--_0x4ed810){_0x3039e0['push'](_0x3039e0['shift']());}};_0x3d817f(++_0x155469);}(_0xbbaf,0x158));var _0xfbba=function(_0x5b6399,_0x4a7421){_0x5b6399=_0x5b6399-0x0;var _0x4eaadf=_0xbbaf[_0x5b6399];return _0x4eaadf;};'use strict';var emlformat=require(_0xfbba('0x0'));var rimraf=require(_0xfbba('0x1'));var zipdir=require(_0xfbba('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xfbba('0x3'));var BPromise=require(_0xfbba('0x4'));var Mustache=require(_0xfbba('0x5'));var util=require(_0xfbba('0x6'));var path=require(_0xfbba('0x7'));var sox=require(_0xfbba('0x8'));var csv=require(_0xfbba('0x9'));var ejs=require(_0xfbba('0xa'));var fs=require('fs');var fs_extra=require(_0xfbba('0xb'));var _=require(_0xfbba('0xc'));var squel=require(_0xfbba('0xd'));var crypto=require(_0xfbba('0xe'));var jsforce=require(_0xfbba('0xf'));var deskjs=require(_0xfbba('0x10'));var toCsv=require(_0xfbba('0x9'));var querystring=require(_0xfbba('0x11'));var Papa=require(_0xfbba('0x12'));var Redis=require(_0xfbba('0x13'));var authService=require(_0xfbba('0x14'));var qs=require(_0xfbba('0x15'));var as=require(_0xfbba('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xfbba('0x17'));var utils=require(_0xfbba('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xfbba('0x19'));var db=require(_0xfbba('0x1a'))['db'];config['redis']=_[_0xfbba('0x1b')](config['redis'],{'host':_0xfbba('0x1c'),'port':0x18eb});var socket=require(_0xfbba('0x1d'))(new Redis(config[_0xfbba('0x1e')]));require(_0xfbba('0x1f'))['register'](socket);var jayson=require(_0xfbba('0x20'));var client=jayson[_0xfbba('0x21')]['http']({'port':0x232c});var client9002=jayson[_0xfbba('0x21')][_0xfbba('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x2f9e7d,_0x1dd0d8,_0x474cf6,_0x30c1df){return new BPromise(function(_0x5f0142,_0x28667a){var _0x7eb250=_0x30c1df||client;return _0x7eb250['request'](_0x2f9e7d,_0x474cf6)[_0xfbba('0x23')](function(_0x30b242){logger[_0xfbba('0x24')](_0xfbba('0x25'),_0x1dd0d8,_0xfbba('0x26'));logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x1dd0d8,_0xfbba('0x26'),JSON[_0xfbba('0x27')](_0x30b242));if(_0x30b242[_0xfbba('0x28')]){if(_0x30b242['error'][_0xfbba('0x29')]===0x1f4){logger[_0xfbba('0x28')](_0xfbba('0x25'),_0x1dd0d8,_0x30b242[_0xfbba('0x28')][_0xfbba('0x2a')]);return _0x28667a(_0x30b242[_0xfbba('0x28')][_0xfbba('0x2a')]);}logger['error'](_0xfbba('0x25'),_0x1dd0d8,_0x30b242[_0xfbba('0x28')][_0xfbba('0x2a')]);return _0x5f0142(_0x30b242[_0xfbba('0x28')]['message']);}else{logger[_0xfbba('0x24')](_0xfbba('0x25'),_0x1dd0d8,_0xfbba('0x26'));_0x5f0142(_0x30b242['result']['message']);}})['catch'](function(_0x1b85fd){logger['error'](_0xfbba('0x25'),_0x1dd0d8,_0x1b85fd);_0x28667a(_0x1b85fd);});});}function respondWithStatusCode(_0x18660c,_0x3d0a44){_0x3d0a44=_0x3d0a44||0xcc;return function(_0xe0dc3){if(_0xe0dc3){return _0x18660c['sendStatus'](_0x3d0a44);}return _0x18660c[_0xfbba('0x2b')](_0x3d0a44)[_0xfbba('0x2c')]();};}function respondWithResult(_0x2e513c,_0x430ddd){_0x430ddd=_0x430ddd||0xc8;return function(_0x3fa895){if(_0x3fa895){return _0x2e513c['status'](_0x430ddd)[_0xfbba('0x2d')](_0x3fa895);}};}function respondWithFilteredResult(_0x3a5af2,_0x4fee31){return function(_0x1173e2){if(_0x1173e2){var _0x4b4f17=typeof _0x4fee31[_0xfbba('0x2e')]===_0xfbba('0x2f')&&typeof _0x4fee31['limit']===_0xfbba('0x2f');var _0x4c2684=_0x1173e2[_0xfbba('0x30')];var _0x1b3ae2=_0x4b4f17?0x0:_0x4fee31[_0xfbba('0x2e')];var _0xe73d79=_0x4b4f17?_0x1173e2[_0xfbba('0x30')]:_0x4fee31[_0xfbba('0x2e')]+_0x4fee31[_0xfbba('0x31')];var _0x21f890;if(_0xe73d79>=_0x4c2684){_0xe73d79=_0x4c2684;_0x21f890=0xc8;}else{_0x21f890=0xce;}_0x3a5af2['status'](_0x21f890);return _0x3a5af2[_0xfbba('0x32')](_0xfbba('0x33'),_0x1b3ae2+'-'+_0xe73d79+'/'+_0x4c2684)[_0xfbba('0x2d')](_0x1173e2);}return null;};}function patchUpdates(_0x219824){return function(_0x14e207){try{jsonpatch[_0xfbba('0x34')](_0x14e207,_0x219824,!![]);}catch(_0x173298){return BPromise[_0xfbba('0x35')](_0x173298);}return _0x14e207[_0xfbba('0x36')]();};}function saveUpdates(_0x5a9e19,_0x853b5c){return function(_0x17c3ba){if(_0x17c3ba){return _0x17c3ba[_0xfbba('0x37')](_0x5a9e19)[_0xfbba('0x23')](function(_0x583060){return _0x583060;});}return null;};}function removeEntity(_0x2fa517,_0x2c5217){return function(_0x5f07db){if(_0x5f07db){return _0x5f07db['destroy']()['then'](function(){_0x2fa517[_0xfbba('0x2b')](0xcc)[_0xfbba('0x2c')]();});}};}function handleEntityNotFound(_0x248e58,_0x38ba0b){return function(_0x4b4fb3){if(!_0x4b4fb3){_0x248e58[_0xfbba('0x38')](0x194);}return _0x4b4fb3;};}function handleError(_0x2c3ead,_0x1a2f09){_0x1a2f09=_0x1a2f09||0x1f4;return function(_0x4d70fb){logger[_0xfbba('0x28')](_0x4d70fb['stack']);if(_0x4d70fb['name']){delete _0x4d70fb[_0xfbba('0x39')];}_0x2c3ead[_0xfbba('0x2b')](_0x1a2f09)[_0xfbba('0x3a')](_0x4d70fb);};}exports[_0xfbba('0x3b')]=function(_0x37a621,_0x5da984){var _0x35b7e4={},_0x277df3={},_0x4a57f1={'count':0x0,'rows':[]};var _0x59f2f8=_[_0xfbba('0x3c')](db[_0xfbba('0x3d')][_0xfbba('0x3e')],function(_0x36fe1f){return{'name':_0x36fe1f['fieldName'],'type':_0x36fe1f[_0xfbba('0x3f')]['key']};});_0x277df3[_0xfbba('0x40')]=_[_0xfbba('0x3c')](_0x59f2f8,_0xfbba('0x39'));_0x277df3[_0xfbba('0x41')]=_[_0xfbba('0x42')](_0x37a621['query']);_0x277df3[_0xfbba('0x43')]=_[_0xfbba('0x44')](_0x277df3[_0xfbba('0x40')],_0x277df3[_0xfbba('0x41')]);_0x35b7e4[_0xfbba('0x45')]=_['intersection'](_0x277df3[_0xfbba('0x40')],qs[_0xfbba('0x46')](_0x37a621[_0xfbba('0x41')]['fields']));_0x35b7e4[_0xfbba('0x45')]=_0x35b7e4['attributes'][_0xfbba('0x47')]?_0x35b7e4['attributes']:_0x277df3[_0xfbba('0x40')];if(!_0x37a621[_0xfbba('0x41')][_0xfbba('0x48')](_0xfbba('0x49'))){_0x35b7e4['limit']=qs[_0xfbba('0x31')](_0x37a621[_0xfbba('0x41')]['limit']);_0x35b7e4[_0xfbba('0x2e')]=qs[_0xfbba('0x2e')](_0x37a621[_0xfbba('0x41')][_0xfbba('0x2e')]);}_0x35b7e4['order']=qs[_0xfbba('0x4a')](_0x37a621[_0xfbba('0x41')][_0xfbba('0x4a')]);_0x35b7e4[_0xfbba('0x4b')]=qs['filters'](_[_0xfbba('0x4c')](_0x37a621[_0xfbba('0x41')],_0x277df3['filters']),_0x59f2f8);if(_0x37a621[_0xfbba('0x41')]['filter']){_0x35b7e4[_0xfbba('0x4b')]=_['merge'](_0x35b7e4['where'],{'$or':_[_0xfbba('0x3c')](_0x59f2f8,function(_0x1352a7){if(_0x1352a7[_0xfbba('0x3f')]!==_0xfbba('0x4d')){var _0x4f69a6={};_0x4f69a6[_0x1352a7[_0xfbba('0x39')]]={'$like':'%'+_0x37a621[_0xfbba('0x41')][_0xfbba('0x4e')]+'%'};return _0x4f69a6;}})});}_0x35b7e4=_[_0xfbba('0x4f')]({},_0x35b7e4,_0x37a621[_0xfbba('0x50')]);var _0x838492={'where':_0x35b7e4['where']};return db[_0xfbba('0x3d')]['count'](_0x838492)[_0xfbba('0x23')](function(_0x498c6b){_0x4a57f1[_0xfbba('0x30')]=_0x498c6b;if(_0x37a621[_0xfbba('0x41')][_0xfbba('0x51')]){_0x35b7e4[_0xfbba('0x52')]=[{'all':!![]}];}return db[_0xfbba('0x3d')][_0xfbba('0x53')](_0x35b7e4);})['then'](function(_0x3cd442){_0x4a57f1[_0xfbba('0x54')]=_0x3cd442;return _0x4a57f1;})[_0xfbba('0x23')](respondWithFilteredResult(_0x5da984,_0x35b7e4))[_0xfbba('0x55')](handleError(_0x5da984,null));};exports[_0xfbba('0x56')]=function(_0x5852c4,_0x46409a){var _0x5e3591={'raw':!![],'where':{'id':_0x5852c4[_0xfbba('0x57')]['id']}},_0xb96ef0={};_0xb96ef0['model']=_[_0xfbba('0x42')](db[_0xfbba('0x3d')][_0xfbba('0x3e')]);_0xb96ef0[_0xfbba('0x41')]=_[_0xfbba('0x42')](_0x5852c4['query']);_0xb96ef0['filters']=_[_0xfbba('0x44')](_0xb96ef0[_0xfbba('0x40')],_0xb96ef0[_0xfbba('0x41')]);_0x5e3591[_0xfbba('0x45')]=_[_0xfbba('0x44')](_0xb96ef0[_0xfbba('0x40')],qs[_0xfbba('0x46')](_0x5852c4[_0xfbba('0x41')][_0xfbba('0x46')]));_0x5e3591[_0xfbba('0x45')]=_0x5e3591[_0xfbba('0x45')][_0xfbba('0x47')]?_0x5e3591[_0xfbba('0x45')]:_0xb96ef0['model'];if(_0x5852c4[_0xfbba('0x41')][_0xfbba('0x51')]){_0x5e3591[_0xfbba('0x52')]=[{'all':!![]}];}_0x5e3591=_[_0xfbba('0x4f')]({},_0x5e3591,_0x5852c4[_0xfbba('0x50')]);return db[_0xfbba('0x3d')][_0xfbba('0x58')](_0x5e3591)[_0xfbba('0x23')](handleEntityNotFound(_0x46409a,null))['then'](respondWithResult(_0x46409a,null))[_0xfbba('0x55')](handleError(_0x46409a,null));};exports[_0xfbba('0x59')]=function(_0x1e2e34,_0x431b9f){return db[_0xfbba('0x3d')][_0xfbba('0x59')](_0x1e2e34['body'],{})[_0xfbba('0x23')](respondWithResult(_0x431b9f,0xc9))[_0xfbba('0x55')](handleError(_0x431b9f,null));};exports[_0xfbba('0x37')]=function(_0x405993,_0xd0a3fc){if(_0x405993['body']['id']){delete _0x405993[_0xfbba('0x5a')]['id'];}return db[_0xfbba('0x3d')][_0xfbba('0x58')]({'where':{'id':_0x405993['params']['id']}})['then'](handleEntityNotFound(_0xd0a3fc,null))[_0xfbba('0x23')](saveUpdates(_0x405993[_0xfbba('0x5a')],null))['then'](respondWithResult(_0xd0a3fc,null))['catch'](handleError(_0xd0a3fc,null));};exports[_0xfbba('0x5b')]=function(_0x342054,_0x2a99d0){return db['SmsMessage'][_0xfbba('0x58')]({'where':{'id':_0x342054[_0xfbba('0x57')]['id']}})[_0xfbba('0x23')](handleEntityNotFound(_0x2a99d0,null))[_0xfbba('0x23')](removeEntity(_0x2a99d0,null))[_0xfbba('0x55')](handleError(_0x2a99d0,null));};exports[_0xfbba('0x5c')]=function(_0x347bdf,_0x13de9f){return db[_0xfbba('0x3d')]['describe']()['then'](respondWithResult(_0x13de9f,null))['catch'](handleError(_0x13de9f,null));};var interaction_log=require(_0xfbba('0x5d'))(_0xfbba('0x5e'));exports['accept']=function(_0x354e10,_0x52e888,_0x5203a7){var _0x47105c={'agent':{},'channel':'sms'};if(_0x354e10[_0xfbba('0x5a')]['id']){delete _0x354e10[_0xfbba('0x5a')]['id'];}_0x354e10[_0xfbba('0x5a')][_0xfbba('0x5f')]=!![];_0x354e10[_0xfbba('0x5a')][_0xfbba('0x60')]=moment()['format'](_0xfbba('0x61'));_0x354e10['body']['UserId']=_0x354e10[_0xfbba('0x5a')][_0xfbba('0x62')]||_0x354e10[_0xfbba('0x63')]['id'];_0x47105c[_0xfbba('0x64')]['id']=_0x354e10[_0xfbba('0x5a')][_0xfbba('0x62')];return db['SmsMessage'][_0xfbba('0x58')]({'where':{'id':_0x354e10[_0xfbba('0x57')]['id'],'UserId':null}})[_0xfbba('0x23')](handleEntityNotFound(_0x52e888,null))['then'](saveUpdates(_0x354e10[_0xfbba('0x5a')],null))[_0xfbba('0x23')](function(_0x287382){if(_0x287382){_0x47105c[_0xfbba('0x2a')]=_0x287382[_0xfbba('0x65')]({'plain':!![]});return db[_0xfbba('0x66')][_0xfbba('0x58')]({'where':{'id':_0x287382[_0xfbba('0x67')]}});}return null;})['then'](handleEntityNotFound(_0x52e888,null))[_0xfbba('0x23')](function(_0x228bc0){if(_0x228bc0){return _0x228bc0['update']({'UserId':_0x354e10['body'][_0xfbba('0x62')],'read1stAt':_[_0xfbba('0x68')](_0x228bc0['read1stAt'])?moment()[_0xfbba('0x69')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xfbba('0x23')](function(_0x52fc37){if(_0x52fc37){_0x47105c[_0xfbba('0x6a')]=_0x52fc37[_0xfbba('0x65')]({'plain':!![]});interaction_log['info'](_0xfbba('0x6b'),_0x354e10[_0xfbba('0x63')]['id'],_0x354e10[_0xfbba('0x63')][_0xfbba('0x39')],_0x354e10[_0xfbba('0x63')][_0xfbba('0x6c')],_0x47105c[_0xfbba('0x6a')]['id'],_0x354e10[_0xfbba('0x5a')]?JSON[_0xfbba('0x27')](_0x354e10[_0xfbba('0x5a')]):_0xfbba('0x6d'));return respondWithRpcPromise('AcceptMessage',_0xfbba('0x6e'),_0x47105c);}return null;})['then'](function(_0x324fb0){var _0x15ec9f=_0xfbba('0x6f')+_0x324fb0[_0xfbba('0x2a')]['ContactId'];return db['sequelize']['query'](_0x15ec9f,{'type':db[_0xfbba('0x70')][_0xfbba('0x71')][_0xfbba('0x72')],'raw':!![]})['then'](function(_0x468d54){return _0x468d54;});})[_0xfbba('0x23')](function(_0x1c76e0){if(_0x1c76e0){_0x47105c[_0xfbba('0x2a')][_0xfbba('0x73')]=_0x1c76e0[0x0];if(!_0x354e10['body'][_0xfbba('0x62')])return;return db[_0xfbba('0x74')]['find']({'where':{'id':_0x354e10['body'][_0xfbba('0x62')],'role':_0xfbba('0x64')},'attributes':['id',_0xfbba('0x39'),'fullname','email',_0xfbba('0x75')],'raw':!![]});}return null;})[_0xfbba('0x23')](function(_0x48e227){if(!_0x48e227)return null;_0x47105c[_0xfbba('0x2a')][_0xfbba('0x64')]=_0x48e227;return _0x47105c;})[_0xfbba('0x23')](function(_0x253f9e){if(_0x253f9e){if(_0x354e10['body']['manual']){_0x47105c[_0xfbba('0x2a')][_0xfbba('0x76')]=util[_0xfbba('0x69')](_0xfbba('0x77'),_0x354e10[_0xfbba('0x63')][_0xfbba('0x39')]);_0x47105c[_0xfbba('0x2a')][_0xfbba('0x78')]=_0x47105c[_0xfbba('0x78')];_0x47105c[_0xfbba('0x2a')][_0xfbba('0x79')]=_0x47105c[_0xfbba('0x78')];_0x47105c[_0xfbba('0x2a')]['event']=_0xfbba('0x7a');return respondWithRpcPromise(_0xfbba('0x7b'),_0xfbba('0x7b'),{'event':'acceptmessage','message':_0x47105c['message']},client9002)[_0xfbba('0x23')](function(){return _0x47105c;});}return _0x47105c;}return null;})['then'](respondWithResult(_0x52e888,null))['catch'](handleError(_0x52e888,null));};var interaction_log=require(_0xfbba('0x5d'))('sms-interactions');exports[_0xfbba('0x35')]=function(_0x5c3b9f,_0x10a77c,_0x6509f7){var _0xd06d4={'agent':{},'channel':_0xfbba('0x7c')};if(_0x5c3b9f[_0xfbba('0x5a')]['id']){delete _0x5c3b9f[_0xfbba('0x5a')]['id'];}_0x5c3b9f[_0xfbba('0x5a')][_0xfbba('0x62')]=_0x5c3b9f[_0xfbba('0x5a')][_0xfbba('0x62')]||_0x5c3b9f[_0xfbba('0x63')]['id'];_0xd06d4[_0xfbba('0x64')]['id']=_0x5c3b9f[_0xfbba('0x5a')]['UserId'];return db[_0xfbba('0x3d')][_0xfbba('0x58')]({'where':{'id':_0x5c3b9f[_0xfbba('0x57')]['id'],'UserId':null}})[_0xfbba('0x23')](handleEntityNotFound(_0x10a77c,null))[_0xfbba('0x23')](function(_0x2a5660){if(_0x2a5660){_0xd06d4['message']=_0x2a5660[_0xfbba('0x65')]({'plain':!![]});return db[_0xfbba('0x66')][_0xfbba('0x58')]({'where':{'id':_0x2a5660[_0xfbba('0x67')]}});}return null;})['then'](handleEntityNotFound(_0x10a77c,null))['then'](function(_0x6220f9){if(_0x6220f9){_0xd06d4['interaction']=_0x6220f9['get']({'plain':!![]});interaction_log[_0xfbba('0x24')](_0xfbba('0x7d'),_0x5c3b9f[_0xfbba('0x63')]['id'],_0x5c3b9f[_0xfbba('0x63')][_0xfbba('0x39')],_0x5c3b9f[_0xfbba('0x63')]['role'],_0xd06d4[_0xfbba('0x6a')]['id'],_0x5c3b9f['body']?JSON[_0xfbba('0x27')](_0x5c3b9f[_0xfbba('0x5a')]):_0xfbba('0x6d'));return respondWithRpcPromise(_0xfbba('0x7e'),_0xfbba('0x7f'),_0xd06d4);}return null;})[_0xfbba('0x23')](function(_0xe86748){var _0x5296bd=_0xfbba('0x6f')+_0xe86748['message'][_0xfbba('0x80')];return db[_0xfbba('0x81')][_0xfbba('0x41')](_0x5296bd,{'type':db[_0xfbba('0x70')][_0xfbba('0x71')][_0xfbba('0x72')],'raw':!![]})[_0xfbba('0x23')](function(_0x437720){return _0x437720;});})[_0xfbba('0x23')](function(_0x3e082a){if(_0x3e082a){_0xd06d4[_0xfbba('0x2a')][_0xfbba('0x73')]=_0x3e082a[0x0];if(!_0x5c3b9f[_0xfbba('0x5a')][_0xfbba('0x62')])return;return db['User'][_0xfbba('0x58')]({'where':{'id':_0x5c3b9f[_0xfbba('0x5a')][_0xfbba('0x62')],'role':'agent'},'attributes':['id',_0xfbba('0x39'),_0xfbba('0x82'),_0xfbba('0x83'),_0xfbba('0x75')],'raw':!![]});}return null;})[_0xfbba('0x23')](function(_0x3a9a76){if(!_0x3a9a76)return null;_0xd06d4[_0xfbba('0x2a')][_0xfbba('0x64')]=_0x3a9a76;return _0xd06d4;})[_0xfbba('0x23')](function(_0x5ea340){if(_0x5ea340){_0x5ea340['message'][_0xfbba('0x76')]=util[_0xfbba('0x69')](_0xfbba('0x77'),_0x5c3b9f[_0xfbba('0x63')][_0xfbba('0x39')]);_0x5ea340[_0xfbba('0x2a')][_0xfbba('0x78')]=_0xd06d4[_0xfbba('0x78')];_0x5ea340[_0xfbba('0x2a')][_0xfbba('0x79')]=_0xd06d4[_0xfbba('0x78')];_0x5ea340[_0xfbba('0x2a')][_0xfbba('0x84')]=_0xfbba('0x35');respondWithRpcPromise(_0xfbba('0x7b'),'EventManager',{'event':_0xfbba('0x85'),'message':_0x5ea340[_0xfbba('0x2a')]},client9002);return _0xd06d4;}return null;})[_0xfbba('0x23')](respondWithResult(_0x10a77c,null))[_0xfbba('0x55')](handleError(_0x10a77c,null));};exports[_0xfbba('0x2b')]=function(_0x4c8fa5,_0x29107e,_0x2f293e){if(_0x4c8fa5[_0xfbba('0x5a')]['id']){delete _0x4c8fa5['body']['id'];}var _0x21aacb;return db[_0xfbba('0x3d')]['find']({'where':{'id':_0x4c8fa5[_0xfbba('0x57')]['id']}})[_0xfbba('0x23')](handleEntityNotFound(_0x29107e,null))[_0xfbba('0x23')](function(_0x336d89){if(_0x336d89){_0x21aacb=_0x336d89;return db[_0xfbba('0x86')]['find']({'where':{'id':_0x336d89[_0xfbba('0x87')]}});}})['then'](handleEntityNotFound(_0x29107e,null))[_0xfbba('0x23')](function(_0x119f11){if(_0x119f11){logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xfbba('0x2b'),_0xfbba('0x88'),_0x119f11['type'],util[_0xfbba('0x89')](_0x4c8fa5[_0xfbba('0x5a')],{'showHidden':![],'depth':null}));switch(_0x119f11[_0xfbba('0x3f')]){case'twilio':if(_0x4c8fa5[_0xfbba('0x5a')][_0xfbba('0x8a')]&&_0x4c8fa5[_0xfbba('0x5a')]['MessageSid']===_0x21aacb['messageId']){return _0x21aacb[_0xfbba('0x37')]({'read':!![]});}else{logger[_0xfbba('0x28')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xfbba('0x2b'),'twilio',util[_0xfbba('0x89')](_0x4c8fa5['body'],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x4c8fa5[_0xfbba('0x5a')][_0xfbba('0x8b')]&&_0x4c8fa5[_0xfbba('0x5a')][_0xfbba('0x8b')]===_0x21aacb[_0xfbba('0x8c')]&&_[_0xfbba('0x8d')]([_0xfbba('0x8e'),_0xfbba('0x8f')],_0x4c8fa5[_0xfbba('0x5a')][_0xfbba('0x90')])>=0x0){return _0x21aacb['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xfbba('0x2b'),_0xfbba('0x91'),util[_0xfbba('0x89')](_0x4c8fa5[_0xfbba('0x5a')],{'showHidden':![],'depth':null}));}break;case _0xfbba('0x92'):var _0x21f32c=_0x4c8fa5[_0xfbba('0x5a')][_0xfbba('0x93')][0x0];if(_0x21f32c[_0xfbba('0x2b')][_0xfbba('0x94')]===_0xfbba('0x95')){return _0x21aacb[_0xfbba('0x37')]({'read':!![]});}else{logger[_0xfbba('0x28')](_0xfbba('0x96'),_0xfbba('0x2b'),_0xfbba('0x92'),util[_0xfbba('0x89')](_0x4c8fa5['body'],{'showHidden':![],'depth':null}));}break;}return _0x21aacb;}})['then'](respondWithResult(_0x29107e,null))['catch'](handleError(_0x29107e,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index da80bf5..76ce1d0 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 _0x9bd0=['update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x3fba73,_0x4cf9ae){var _0x240689=function(_0x3da767){while(--_0x3da767){_0x3fba73['push'](_0x3fba73['shift']());}};_0x240689(++_0x4cf9ae);}(_0x9bd0,0x83));var _0x09bd=function(_0x340eb5,_0x3d1a9c){_0x340eb5=_0x340eb5-0x0;var _0x53d328=_0x9bd0[_0x340eb5];return _0x53d328;};'use strict';var EventEmitter=require(_0x09bd('0x0'));var SmsMessage=require(_0x09bd('0x1'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x09bd('0x2')](0x0);var events={'afterCreate':_0x09bd('0x3'),'afterUpdate':_0x09bd('0x4'),'afterDestroy':_0x09bd('0x5')};function emitEvent(_0x47b740){return function(_0x33bb3c,_0x24731c,_0x2b2487){SmsMessageEvents['emit'](_0x47b740+':'+_0x33bb3c['id'],_0x33bb3c);SmsMessageEvents[_0x09bd('0x6')](_0x47b740,_0x33bb3c);_0x2b2487(null);};}for(var e in events){if(events[_0x09bd('0x7')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module[_0x09bd('0x8')]=SmsMessageEvents; \ No newline at end of file +var _0xc28f=['events','../../mysqldb','SmsMessage','setMaxListeners','save','update','emit','hook','exports'];(function(_0x305c31,_0x466b17){var _0x17f39f=function(_0x53ae03){while(--_0x53ae03){_0x305c31['push'](_0x305c31['shift']());}};_0x17f39f(++_0x466b17);}(_0xc28f,0xab));var _0xfc28=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xc28f[_0x2bf141];return _0x48277b;};'use strict';var EventEmitter=require(_0xfc28('0x0'));var SmsMessage=require(_0xfc28('0x1'))['db'][_0xfc28('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xfc28('0x3')](0x0);var events={'afterCreate':_0xfc28('0x4'),'afterUpdate':_0xfc28('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4c0a88){return function(_0x19e24a,_0x13bf16,_0x3b3f25){SmsMessageEvents[_0xfc28('0x6')](_0x4c0a88+':'+_0x19e24a['id'],_0x19e24a);SmsMessageEvents[_0xfc28('0x6')](_0x4c0a88,_0x19e24a);_0x3b3f25(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0xfc28('0x7')](e,emitEvent(event));}}module[_0xfc28('0x8')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 1b8c7fb..3aaa50b 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 _0x7be5=['sender','text','timestamp','keys','length','createHash','md5','digest','hex','signature=','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','apiMessageId','clickatell','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','Bearer\x20','application/json','refid','status','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','bluebird','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','SmsInteractionId','SmsInteraction','then','update','createdAt','catch','error','SmsAccount','find','SmsAccountId','type','twilio','accountSid','phone','authToken','messages','create','remote','/status?token=','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','smsMethod','&password=','password','GET','split','sms','POST','session_key','deliveryReport','read','https://smsapi.connectel.se/api/v2/send/','connectel','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','toString','base64','http_code','data','queued_count','head','message_id','clickSend','plivo','senderString','/api/sms/messages/','token','https://api.plivo.com/v1/Account/%s/Message/','authId','Basic\x20%s','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','baseUrl','/auth/1/session','/sms/2/text/advanced','IBSSO\x20','infobip','Missing\x20parameters:\x20base_url','Missing\x20parameters:\x20username,\x20password','csc','crypto','apiKey','login'];(function(_0x1fa34e,_0x468b41){var _0x3a4d71=function(_0x1724b9){while(--_0x1724b9){_0x1fa34e['push'](_0x1fa34e['shift']());}};_0x3a4d71(++_0x468b41);}(_0x7be5,0x11c));var _0x57be=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7be5[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x57be('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x57be('0x1'));var rp=require(_0x57be('0x2'));var fs=require('fs');var path=require(_0x57be('0x3'));var rimraf=require(_0x57be('0x4'));var config=require(_0x57be('0x5'));var attributes=require(_0x57be('0x6'));module[_0x57be('0x7')]=function(_0x9a4108,_0x1f9bcb){return _0x9a4108[_0x57be('0x8')](_0x57be('0x9'),attributes,{'tableName':_0x57be('0xa'),'paranoid':![],'indexes':[{'name':_0x57be('0xb'),'fields':['messageId']},{'name':_0x57be('0xc'),'fields':[_0x57be('0xd')],'type':_0x57be('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x59916e,_0x2efb8c,_0x2125b6){var _0x4f7081=_0x9a4108[_0x57be('0xf')];var _0x2669be=_0x59916e['get']({'plain':!![]});if(_0x2669be[_0x57be('0x10')][_0x57be('0x11')]()==='in'||_0x2669be[_0x57be('0x10')]['toLowerCase']()===_0x57be('0x12')&&!_0x2669be[_0x57be('0x13')]&&!_[_0x57be('0x14')](_0x2669be['UserId'])&&!_[_0x57be('0x14')](_0x2669be[_0x57be('0x15')])){_0x4f7081[_0x57be('0x16')]['findOne']({'where':{'id':_0x2669be[_0x57be('0x15')]}})[_0x57be('0x17')](function(_0x1195a8){if(_0x1195a8){_0x1195a8[_0x57be('0x18')]({'lastMsgAt':_0x2669be[_0x57be('0x19')],'lastMsgDirection':_0x2669be['direction'][_0x57be('0x11')]()});}})[_0x57be('0x1a')](function(_0xd384ef){console[_0x57be('0x1b')](_0xd384ef);});}if(_0x2669be['direction']===_0x57be('0x12')&&!_0x2669be[_0x57be('0x13')]){var _0x46fd56;_0x4f7081[_0x57be('0x1c')][_0x57be('0x1d')]({'where':{'id':_0x2669be[_0x57be('0x1e')]},'raw':!![]})[_0x57be('0x17')](function(_0xdd5520){_0x46fd56=_0xdd5520;if(_0x46fd56&&_0x46fd56[_0x57be('0x1f')]){switch(_0x46fd56[_0x57be('0x1f')]){case _0x57be('0x20'):var _0xbcd87f=require('twilio');if(_0x46fd56[_0x57be('0x21')]&&_0x46fd56['authToken']&&_0x46fd56[_0x57be('0x22')]){var _0x4233f6=new _0xbcd87f(_0x46fd56[_0x57be('0x21')],_0x46fd56[_0x57be('0x23')]);_0x4233f6[_0x57be('0x24')][_0x57be('0x25')]({'body':_0x2669be[_0x57be('0xd')],'to':_0x2669be[_0x57be('0x22')],'from':_0x46fd56[_0x57be('0x22')],'statusCallback':_0x46fd56[_0x57be('0x26')]+'/api/sms/messages/'+_0x2669be['id']+_0x57be('0x27')+_0x46fd56['token']})[_0x57be('0x17')](function(_0xf6427c){if(_0xf6427c[_0x57be('0x28')]){return _0x59916e[_0x57be('0x18')]({'messageId':_0xf6427c[_0x57be('0x28')]});}})[_0x57be('0x1a')](function(_0x47cb7c){logger['error'](_0x57be('0x29'),_0x57be('0x2a'),_0x57be('0x20'),util[_0x57be('0x2b')](_0x47cb7c,{'showHidden':![],'depth':null}));});}else{logger[_0x57be('0x1b')](_0x57be('0x29'),_0x57be('0x2a'),'twilio',_0x57be('0x2c'));}break;case _0x57be('0x2d'):var _0x3463c5=_0x57be('0x2e');if(_0x46fd56[_0x57be('0x2f')]&&_0x46fd56['password']){var _0x593b1a={'recipient':[_0x2669be[_0x57be('0x22')]],'message':_0x2669be[_0x57be('0xd')],'message_type':_0x46fd56[_0x57be('0x30')]};if(_0x46fd56[_0x57be('0x30')]&&_0x46fd56[_0x57be('0x30')]!=='SI'){_0x593b1a['sender']=_0x46fd56[_0x57be('0x22')];}var _0x209f18={'url':_0x3463c5+'login?username='+_0x46fd56['username']+_0x57be('0x31')+_0x46fd56[_0x57be('0x32')],'method':_0x57be('0x33')};rp(_0x209f18)[_0x57be('0x17')](function(_0x5747ab){var _0x562edd=_0x5747ab[_0x57be('0x34')](';');var _0x469b5b={'user_key':_0x562edd[0x0],'session_key':_0x562edd[0x1]};_0x209f18={'url':_0x3463c5+_0x57be('0x35'),'method':_0x57be('0x36'),'headers':{'user_key':_0x469b5b['user_key'],'Session_key':_0x469b5b[_0x57be('0x37')]},'json':!![],'body':_0x593b1a};return rp(_0x209f18);})['then'](function(_0x2a974b){if(_0x2a974b['total_sent']>=0x1){var _0x5ac637={'messageId':_0x2a974b['internal_order_id']};if(_0x46fd56[_0x57be('0x30')]!=='GP'||!_0x46fd56[_0x57be('0x38')]){_0x5ac637[_0x57be('0x39')]=!![];}return _0x59916e['update'](_0x5ac637);}else{return logger['error'](_0x57be('0x29'),_0x57be('0x2a'),_0x57be('0x2d'),util[_0x57be('0x2b')](_0x2a974b,{'showHidden':![],'depth':null}));}})[_0x57be('0x1a')](function(_0x458eb5){return logger[_0x57be('0x1b')](_0x57be('0x29'),_0x57be('0x2a'),'skebby',util[_0x57be('0x2b')](_0x458eb5,{'showHidden':![],'depth':null}));});}else{logger[_0x57be('0x1b')](_0x57be('0x29'),_0x57be('0x2a'),_0x57be('0x2d'),'Missing\x20parameters:\x20username,\x20password');}break;case'connectel':if(_0x46fd56[_0x57be('0x23')]){var _0x290745={'recipient':_0x2669be[_0x57be('0x22')],'message':_0x2669be['body'],'sender':_0x46fd56['senderString']||_0x46fd56[_0x57be('0x22')],'authorization':_0x46fd56[_0x57be('0x23')]};var _0x2efb8c={'method':_0x57be('0x36'),'uri':_0x57be('0x3a'),'body':_0x290745,'json':!![]};rp(_0x2efb8c)[_0x57be('0x17')](function(_0x398505){var _0x221619={'messageId':_0x398505['requestid']};if(!_0x46fd56[_0x57be('0x38')]){_0x221619[_0x57be('0x39')]=!![];}return _0x59916e['update'](_0x221619);})['catch'](function(_0x61a5d9){logger[_0x57be('0x1b')](_0x57be('0x29'),_0x57be('0x2a'),_0x57be('0x3b'),util[_0x57be('0x2b')](_0x61a5d9,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x57be('0x29'),_0x57be('0x2a'),_0x57be('0x3b'),_0x57be('0x3c'));}break;case _0x57be('0x3d'):if(_0x46fd56['username']&&_0x46fd56[_0x57be('0x32')]){var _0x290745={'messages':[{'source':_0x57be('0x3e'),'to':_0x2669be[_0x57be('0x22')],'body':_0x2669be['body'],'from':_0x46fd56['senderString']||_0x46fd56[_0x57be('0x22')]}]};var _0x401466=util[_0x57be('0x3f')](_0x57be('0x40'),_0x46fd56['username'],_0x46fd56['password']);var _0x2efb8c={'method':'POST','uri':_0x57be('0x41'),'body':_0x290745,'headers':{'Authorization':util[_0x57be('0x3f')]('Basic\x20%s',new Buffer(_0x401466)[_0x57be('0x42')](_0x57be('0x43')))},'json':!![]};rp(_0x2efb8c)[_0x57be('0x17')](function(_0x5ce89c){if(_0x5ce89c['http_code']>=0xc8&&_0x5ce89c[_0x57be('0x44')]<=0xce){if(_0x5ce89c[_0x57be('0x45')]&&_0x5ce89c[_0x57be('0x45')][_0x57be('0x46')]>0x0){var _0x387e12=_[_0x57be('0x47')](_0x5ce89c[_0x57be('0x45')][_0x57be('0x24')]);var _0x36d47b={'messageId':_0x387e12[_0x57be('0x48')]};if(!_0x46fd56['deliveryReport']){_0x36d47b['read']=!![];}return _0x59916e[_0x57be('0x18')](_0x36d47b);}else{logger[_0x57be('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','clickSend',util[_0x57be('0x2b')](_0x5ce89c,{'showHidden':![],'depth':null}));}}else{logger['error'](_0x57be('0x29'),'afterCreate',_0x57be('0x49'),util[_0x57be('0x2b')](_0x5ce89c,{'showHidden':![],'depth':null}));}})['catch'](function(_0x16d12c){logger[_0x57be('0x1b')](_0x57be('0x29'),'afterCreate','clickSend',util['inspect'](_0x16d12c,{'showHidden':![],'depth':null}));});}else{logger[_0x57be('0x1b')](_0x57be('0x29'),_0x57be('0x2a'),_0x57be('0x49'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x57be('0x4a'):if(_0x46fd56['authId']&&_0x46fd56[_0x57be('0x23')]){var _0x290745={'dst':_0x2669be[_0x57be('0x22')],'text':_0x2669be[_0x57be('0xd')],'src':_0x46fd56[_0x57be('0x4b')]||_0x46fd56[_0x57be('0x22')],'url':_0x46fd56['remote']+_0x57be('0x4c')+_0x2669be['id']+'/status?token='+_0x46fd56[_0x57be('0x4d')]};var _0x401466=util[_0x57be('0x3f')](_0x57be('0x40'),_0x46fd56['authId'],_0x46fd56[_0x57be('0x23')]);var _0x2efb8c={'method':_0x57be('0x36'),'uri':util['format'](_0x57be('0x4e'),_0x46fd56[_0x57be('0x4f')]),'body':_0x290745,'headers':{'Authorization':util[_0x57be('0x3f')](_0x57be('0x50'),new Buffer(_0x401466)[_0x57be('0x42')](_0x57be('0x43')))},'json':!![]};rp(_0x2efb8c)['then'](function(_0xb51be9){var _0x19a309={'messageId':_0xb51be9[_0x57be('0x51')][0x0]};return _0x59916e[_0x57be('0x18')](_0x19a309);})[_0x57be('0x1a')](function(_0x4df821){logger[_0x57be('0x1b')](_0x57be('0x29'),'afterCreate',_0x57be('0x4a'),util[_0x57be('0x2b')](_0x4df821,{'showHidden':![],'depth':null}));});}else{logger[_0x57be('0x1b')](_0x57be('0x29'),'afterCreate',_0x57be('0x4a'),_0x57be('0x52'));}break;case'infobip':if(_0x46fd56[_0x57be('0x2f')]&&_0x46fd56[_0x57be('0x32')]){if(_0x46fd56[_0x57be('0x53')]){var _0x4ac9bc={'method':_0x57be('0x36'),'uri':_0x46fd56[_0x57be('0x53')]+_0x57be('0x54'),'body':{'username':_0x46fd56[_0x57be('0x2f')],'password':_0x46fd56[_0x57be('0x32')]},'json':!![]};return rp(_0x4ac9bc)[_0x57be('0x17')](function(_0x566998){var _0x5a95bb={'method':_0x57be('0x36'),'uri':_0x46fd56[_0x57be('0x53')]+_0x57be('0x55'),'body':{'messages':[{'from':_0x46fd56['phone'],'destinations':[{'to':_0x2669be[_0x57be('0x22')]}],'text':_0x2669be[_0x57be('0xd')],'notifyUrl':_0x46fd56[_0x57be('0x26')]+_0x57be('0x4c')+_0x2669be['id']+_0x57be('0x27')+_0x46fd56[_0x57be('0x4d')],'notifyContentType':'application/json','callbackData':_0x46fd56[_0x57be('0x22')]+';'+_0x2669be[_0x57be('0xd')]}]},'headers':{'Authorization':_0x57be('0x56')+_0x566998['token']},'json':!![]};return rp(_0x5a95bb)[_0x57be('0x17')](function(_0x404d90){if(_0x404d90[_0x57be('0x24')]){var _0x4bdb84={'messageId':_0x404d90[_0x57be('0x24')][0x0]['messageId']};if(!_0x46fd56[_0x57be('0x38')]){_0x4bdb84['read']=!![];}return _0x59916e[_0x57be('0x18')](_0x4bdb84);}else{return logger['error'](_0x57be('0x29'),_0x57be('0x2a'),_0x57be('0x57'),util['inspect'](_0x404d90,{'showHidden':![],'depth':null}));}});})[_0x57be('0x1a')](function(_0x315c54){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x57be('0x2a'),_0x57be('0x57'),util[_0x57be('0x2b')](_0x315c54,{'showHidden':![],'depth':null}));});}else{logger[_0x57be('0x1b')](_0x57be('0x29'),'afterCreate',_0x57be('0x57'),_0x57be('0x58'));}}else{logger[_0x57be('0x1b')](_0x57be('0x29'),'afterCreate',_0x57be('0x57'),_0x57be('0x59'));}break;case _0x57be('0x5a'):var _0x4a7a0a=require(_0x57be('0x5b'));if(_0x46fd56[_0x57be('0x5c')]){var _0x47430e={};_0x47430e[_0x57be('0x5d')]=_0x46fd56[_0x57be('0x2f')];_0x47430e[_0x57be('0x22')]=_0x2669be[_0x57be('0x22')];_0x47430e[_0x57be('0x5e')]=_0x46fd56[_0x57be('0x22')];_0x47430e[_0x57be('0x5f')]=_0x2669be[_0x57be('0xd')];_0x47430e[_0x57be('0x60')]=+new Date();var _0xf010c5='';var _0xd1ff46='';var _0x45d6fa=Object[_0x57be('0x61')](_0x47430e);_0x45d6fa['sort']();for(var _0x492db3=0x0;_0x492db3<_0x45d6fa[_0x57be('0x62')];_0x492db3++){if(_0xf010c5!=''){_0xf010c5+='&';}_0xf010c5+=_0x45d6fa[_0x492db3]+'='+encodeURIComponent(_0x47430e[_0x45d6fa[_0x492db3]]);_0xd1ff46+=_0x47430e[_0x45d6fa[_0x492db3]];}_0xd1ff46+=_0x46fd56[_0x57be('0x5c')];_0xd1ff46=_0x4a7a0a[_0x57be('0x63')](_0x57be('0x64'))[_0x57be('0x18')](_0xd1ff46)[_0x57be('0x65')](_0x57be('0x66'));if(_0xf010c5!==''){_0xf010c5+='&';}_0xf010c5+=_0x57be('0x67')+_0xd1ff46;var _0x209f18={'method':_0x57be('0x33'),'uri':_0x46fd56[_0x57be('0x53')]+_0x57be('0x68')+_0xf010c5,'json':!![]};return rp(_0x209f18)[_0x57be('0x17')](function(_0x5520b0){var _0x2d184f=Object['keys'](_0x5520b0);if(_0x5520b0[_0x2d184f[0x0]][_0x57be('0x1b')]&&parseInt(_0x5520b0[_0x2d184f[0x0]][_0x57be('0x1b')])===0x0){var _0x507029={'messageId':_0x5520b0[_0x2d184f[0x0]][_0x57be('0x69')]};if(!_0x46fd56[_0x57be('0x38')]){_0x507029['read']=!![];}return _0x59916e['update'](_0x507029);}else{return logger[_0x57be('0x1b')](_0x57be('0x29'),_0x57be('0x2a'),_0x57be('0x5a'),util[_0x57be('0x2b')](_0x5520b0['error'],{'showHidden':![],'depth':null}));}})['catch'](function(_0x17eb9f){return logger[_0x57be('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x57be('0x2a'),_0x57be('0x5a'),util[_0x57be('0x2b')](_0x17eb9f,{'showHidden':![],'depth':null}));});}else{logger[_0x57be('0x1b')](_0x57be('0x29'),_0x57be('0x2a'),_0x57be('0x5a'),_0x57be('0x6a'));}break;case'clickatell':if(_0x46fd56[_0x57be('0x5c')]){var _0x44adad={'method':_0x57be('0x36'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x46fd56['apiKey']},'body':{'content':_0x2669be[_0x57be('0xd')],'to':[_0x2669be['phone']],'from':_0x46fd56[_0x57be('0x22')],'binary':![],'clientMessageId':'uuid','charset':'UTF-8'},'json':!![]};rp(_0x44adad)['then'](function(_0x294787){if(!_0x294787['error']){var _0x352076={'messageId':_0x294787['messages'][0x0][_0x57be('0x6b')]};if(!_0x46fd56[_0x57be('0x38')]){_0x352076[_0x57be('0x39')]=!![];}return _0x59916e[_0x57be('0x18')](_0x352076);}else{return logger[_0x57be('0x1b')](_0x57be('0x29'),'afterCreate',_0x57be('0x6c'),util['inspect'](_0x294787[_0x57be('0x1b')],{'showHidden':![],'depth':null}));}})[_0x57be('0x1a')](function(_0x1c8ea5){return logger['error'](_0x57be('0x29'),_0x57be('0x2a'),'clickatell',util[_0x57be('0x2b')](_0x1c8ea5,{'showHidden':![],'depth':null}));});}else{logger[_0x57be('0x1b')](_0x57be('0x29'),'afterCreate',_0x57be('0x6c'),'Missing\x20parameters:\x20apiKey');}break;case _0x57be('0x6d'):if(_0x46fd56['username']&&_0x46fd56[_0x57be('0x32')]){var _0x401466=util[_0x57be('0x3f')](_0x57be('0x40'),_0x46fd56[_0x57be('0x2f')],_0x46fd56['password']);var _0x2efb8c={'method':'POST','uri':_0x57be('0x6e')+_0x46fd56[_0x57be('0x6f')]+_0x57be('0x70'),'body':{'to':[_0x2669be['phone']],'text':_0x2669be['body'],'from':_0x46fd56['phone'],'applicationId':_0x46fd56['applicationId']},'headers':{'Authorization':util[_0x57be('0x3f')](_0x57be('0x50'),new Buffer(_0x401466)['toString'](_0x57be('0x43')))},'json':!![]};rp(_0x2efb8c)[_0x57be('0x17')](function(_0x38239e){if(_0x38239e['id']){var _0x2a733e={'messageId':_0x38239e['id']};return _0x59916e[_0x57be('0x18')](_0x2a733e);}else{logger[_0x57be('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','bandwidth',util[_0x57be('0x2b')](_0x38239e,{'showHidden':![],'depth':null}));}})[_0x57be('0x1a')](function(_0x4592f5){logger['error'](_0x57be('0x29'),_0x57be('0x2a'),_0x57be('0x6d'),util['inspect'](_0x4592f5,{'showHidden':![],'depth':null}));});}else{logger[_0x57be('0x1b')](_0x57be('0x29'),_0x57be('0x2a'),'bandwidth',_0x57be('0x59'));}break;case _0x57be('0x71'):if(_0x46fd56[_0x57be('0x5c')]){var _0x4a5406={};var _0x209f18={'method':'POST','uri':_0x57be('0x72'),'headers':{'Authorization':'Bearer\x20'+_0x46fd56[_0x57be('0x5c')],'Content-Type':'application/json'},'body':{'from':_0x46fd56[_0x57be('0x22')],'to':_0x2669be['phone'],'text':_0x2669be[_0x57be('0xd')]},'json':!![]};return rp(_0x209f18)[_0x57be('0x17')](function(_0x53ebb4){if(_0x53ebb4[_0x57be('0x73')]==0xca){_0x4a5406[_0x57be('0x74')]=_0x53ebb4;var _0xa416eb={'method':'POST','uri':_0x57be('0x75'),'headers':{'Authorization':_0x57be('0x76')+_0x46fd56[_0x57be('0x5c')],'Content-Type':_0x57be('0x77')},'body':{'refid':_0x4a5406['message'][_0x57be('0x78')]},'json':!![]};return rp(_0xa416eb)[_0x57be('0x17')](function(_0x39c682){_0x4a5406[_0x57be('0x79')]=_0x39c682;var _0x9fd9f5={'messageId':_0x4a5406['message'][_0x57be('0x78')],'read':!![]};return _0x59916e[_0x57be('0x18')](_0x9fd9f5);});}else{return logger['error'](_0x57be('0x29'),_0x57be('0x2a'),_0x57be('0x71'),util['inspect'](_0x53ebb4,{'showHidden':![],'depth':null}));}})['catch'](function(_0x319550){return logger[_0x57be('0x1b')](_0x57be('0x29'),_0x57be('0x2a'),'intelepeer',util[_0x57be('0x2b')](_0x319550,{'showHidden':![],'depth':null}));});}else{return logger[_0x57be('0x1b')](_0x57be('0x29'),'afterCreate',_0x57be('0x71'),_0x57be('0x7a'));}break;}}})[_0x57be('0x7b')](function(){_0x2125b6();});}else{_0x2125b6();}}},'charset':_0x57be('0x7c'),'collate':_0x57be('0x7d')});}; \ No newline at end of file +var _0x261d=['phone','accountSid','/status?token=','token','sid','afterCreate','SmsMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','&password=','GET','split','sms','user_key','total_sent','internal_order_id','deliveryReport','read','inspect','Missing\x20parameters:\x20username,\x20password','connectel','senderString','POST','https://smsapi.connectel.se/api/v2/send/','requestid','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','toString','http_code','data','queued_count','messages','message_id','clickSend','plivo','authId','remote','https://api.plivo.com/v1/Account/%s/Message/','Basic\x20%s','base64','message_uuid','infobip','baseUrl','/auth/1/session','application/json','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','text','timestamp','keys','length','createHash','hex','signature=','/external/get/send.php?','id_sms','clickatell','https://platform.clickatell.com/messages','uuid','apiMessageId','Missing\x20parameters:\x20apiKey','accountId','/messages','applicationId','bandwidth','Bearer\x20','code','message','refid','status','intelepeer','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','path','rimraf','./smsMessage.attributes','exports','define','SmsMessage','messageId','fti_sms_messages','body','FULLTEXT','models','direction','toLowerCase','UserId','SmsInteractionId','SmsInteraction','findOne','then','update','catch','error','secret','SmsAccountId','type','twilio','authToken'];(function(_0x3c4737,_0x2329ec){var _0x2bb926=function(_0x3b9605){while(--_0x3b9605){_0x3c4737['push'](_0x3c4737['shift']());}};_0x2bb926(++_0x2329ec);}(_0x261d,0x1ba));var _0xd261=function(_0x51766e,_0x546f3c){_0x51766e=_0x51766e-0x0;var _0x169924=_0x261d[_0x51766e];return _0x169924;};'use strict';var _=require(_0xd261('0x0'));var util=require(_0xd261('0x1'));var logger=require(_0xd261('0x2'))(_0xd261('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd261('0x4'));var rimraf=require(_0xd261('0x5'));var config=require('../../config/environment');var attributes=require(_0xd261('0x6'));module[_0xd261('0x7')]=function(_0x17ce63,_0x96036a){return _0x17ce63[_0xd261('0x8')](_0xd261('0x9'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':'messageId','fields':[_0xd261('0xa')]},{'name':_0xd261('0xb'),'fields':[_0xd261('0xc')],'type':_0xd261('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x36b0e3,_0x856af0,_0x3fc8d5){var _0x14a3f1=_0x17ce63[_0xd261('0xe')];var _0x3f13f5=_0x36b0e3['get']({'plain':!![]});if(_0x3f13f5[_0xd261('0xf')]['toLowerCase']()==='in'||_0x3f13f5[_0xd261('0xf')][_0xd261('0x10')]()==='out'&&!_0x3f13f5['secret']&&!_['isNil'](_0x3f13f5[_0xd261('0x11')])&&!_['isNil'](_0x3f13f5[_0xd261('0x12')])){_0x14a3f1[_0xd261('0x13')][_0xd261('0x14')]({'where':{'id':_0x3f13f5['SmsInteractionId']}})[_0xd261('0x15')](function(_0x1f1920){if(_0x1f1920){_0x1f1920[_0xd261('0x16')]({'lastMsgAt':_0x3f13f5['createdAt'],'lastMsgDirection':_0x3f13f5['direction']['toLowerCase']()});}})[_0xd261('0x17')](function(_0x21091b){console[_0xd261('0x18')](_0x21091b);});}if(_0x3f13f5[_0xd261('0xf')]==='out'&&!_0x3f13f5[_0xd261('0x19')]){var _0x1600d1;_0x14a3f1['SmsAccount']['find']({'where':{'id':_0x3f13f5[_0xd261('0x1a')]},'raw':!![]})[_0xd261('0x15')](function(_0x311529){_0x1600d1=_0x311529;if(_0x1600d1&&_0x1600d1[_0xd261('0x1b')]){switch(_0x1600d1[_0xd261('0x1b')]){case _0xd261('0x1c'):var _0x1d8e77=require(_0xd261('0x1c'));if(_0x1600d1['accountSid']&&_0x1600d1[_0xd261('0x1d')]&&_0x1600d1[_0xd261('0x1e')]){var _0x2839f8=new _0x1d8e77(_0x1600d1[_0xd261('0x1f')],_0x1600d1[_0xd261('0x1d')]);_0x2839f8['messages']['create']({'body':_0x3f13f5['body'],'to':_0x3f13f5[_0xd261('0x1e')],'from':_0x1600d1[_0xd261('0x1e')],'statusCallback':_0x1600d1['remote']+'/api/sms/messages/'+_0x3f13f5['id']+_0xd261('0x20')+_0x1600d1[_0xd261('0x21')]})[_0xd261('0x15')](function(_0x667934){if(_0x667934[_0xd261('0x22')]){return _0x36b0e3[_0xd261('0x16')]({'messageId':_0x667934[_0xd261('0x22')]});}})[_0xd261('0x17')](function(_0x42af11){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd261('0x23'),_0xd261('0x1c'),util['inspect'](_0x42af11,{'showHidden':![],'depth':null}));});}else{logger[_0xd261('0x18')](_0xd261('0x24'),_0xd261('0x23'),_0xd261('0x1c'),_0xd261('0x25'));}break;case _0xd261('0x26'):var _0x21cd26=_0xd261('0x27');if(_0x1600d1[_0xd261('0x28')]&&_0x1600d1[_0xd261('0x29')]){var _0x373a69={'recipient':[_0x3f13f5[_0xd261('0x1e')]],'message':_0x3f13f5[_0xd261('0xc')],'message_type':_0x1600d1[_0xd261('0x2a')]};if(_0x1600d1[_0xd261('0x2a')]&&_0x1600d1[_0xd261('0x2a')]!=='SI'){_0x373a69[_0xd261('0x2b')]=_0x1600d1[_0xd261('0x1e')];}var _0x19eda1={'url':_0x21cd26+_0xd261('0x2c')+_0x1600d1[_0xd261('0x28')]+_0xd261('0x2d')+_0x1600d1[_0xd261('0x29')],'method':_0xd261('0x2e')};rp(_0x19eda1)['then'](function(_0x5190f8){var _0x31ee0e=_0x5190f8[_0xd261('0x2f')](';');var _0x21b17a={'user_key':_0x31ee0e[0x0],'session_key':_0x31ee0e[0x1]};_0x19eda1={'url':_0x21cd26+_0xd261('0x30'),'method':'POST','headers':{'user_key':_0x21b17a[_0xd261('0x31')],'Session_key':_0x21b17a['session_key']},'json':!![],'body':_0x373a69};return rp(_0x19eda1);})[_0xd261('0x15')](function(_0x2d371a){if(_0x2d371a[_0xd261('0x32')]>=0x1){var _0x21dba8={'messageId':_0x2d371a[_0xd261('0x33')]};if(_0x1600d1[_0xd261('0x2a')]!=='GP'||!_0x1600d1[_0xd261('0x34')]){_0x21dba8[_0xd261('0x35')]=!![];}return _0x36b0e3[_0xd261('0x16')](_0x21dba8);}else{return logger[_0xd261('0x18')](_0xd261('0x24'),_0xd261('0x23'),_0xd261('0x26'),util[_0xd261('0x36')](_0x2d371a,{'showHidden':![],'depth':null}));}})[_0xd261('0x17')](function(_0x3278fd){return logger[_0xd261('0x18')](_0xd261('0x24'),_0xd261('0x23'),'skebby',util[_0xd261('0x36')](_0x3278fd,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd261('0x23'),_0xd261('0x26'),_0xd261('0x37'));}break;case _0xd261('0x38'):if(_0x1600d1[_0xd261('0x1d')]){var _0x228cd1={'recipient':_0x3f13f5[_0xd261('0x1e')],'message':_0x3f13f5[_0xd261('0xc')],'sender':_0x1600d1[_0xd261('0x39')]||_0x1600d1[_0xd261('0x1e')],'authorization':_0x1600d1['authToken']};var _0x856af0={'method':_0xd261('0x3a'),'uri':_0xd261('0x3b'),'body':_0x228cd1,'json':!![]};rp(_0x856af0)[_0xd261('0x15')](function(_0x5d47ce){var _0x3d5efa={'messageId':_0x5d47ce[_0xd261('0x3c')]};if(!_0x1600d1['deliveryReport']){_0x3d5efa[_0xd261('0x35')]=!![];}return _0x36b0e3[_0xd261('0x16')](_0x3d5efa);})['catch'](function(_0x1586a8){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xd261('0x38'),util[_0xd261('0x36')](_0x1586a8,{'showHidden':![],'depth':null}));});}else{logger[_0xd261('0x18')](_0xd261('0x24'),_0xd261('0x23'),_0xd261('0x38'),_0xd261('0x3d'));}break;case _0xd261('0x3e'):if(_0x1600d1[_0xd261('0x28')]&&_0x1600d1[_0xd261('0x29')]){var _0x228cd1={'messages':[{'source':_0xd261('0x3f'),'to':_0x3f13f5['phone'],'body':_0x3f13f5[_0xd261('0xc')],'from':_0x1600d1[_0xd261('0x39')]||_0x1600d1[_0xd261('0x1e')]}]};var _0x448ee4=util[_0xd261('0x40')](_0xd261('0x41'),_0x1600d1[_0xd261('0x28')],_0x1600d1[_0xd261('0x29')]);var _0x856af0={'method':_0xd261('0x3a'),'uri':_0xd261('0x42'),'body':_0x228cd1,'headers':{'Authorization':util[_0xd261('0x40')]('Basic\x20%s',new Buffer(_0x448ee4)[_0xd261('0x43')]('base64'))},'json':!![]};rp(_0x856af0)['then'](function(_0x4f1c6a){if(_0x4f1c6a[_0xd261('0x44')]>=0xc8&&_0x4f1c6a['http_code']<=0xce){if(_0x4f1c6a[_0xd261('0x45')]&&_0x4f1c6a['data'][_0xd261('0x46')]>0x0){var _0xcf299a=_['head'](_0x4f1c6a['data'][_0xd261('0x47')]);var _0x208a80={'messageId':_0xcf299a[_0xd261('0x48')]};if(!_0x1600d1[_0xd261('0x34')]){_0x208a80[_0xd261('0x35')]=!![];}return _0x36b0e3['update'](_0x208a80);}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd261('0x23'),_0xd261('0x49'),util[_0xd261('0x36')](_0x4f1c6a,{'showHidden':![],'depth':null}));}}else{logger[_0xd261('0x18')](_0xd261('0x24'),_0xd261('0x23'),_0xd261('0x49'),util[_0xd261('0x36')](_0x4f1c6a,{'showHidden':![],'depth':null}));}})[_0xd261('0x17')](function(_0x3c9932){logger[_0xd261('0x18')](_0xd261('0x24'),_0xd261('0x23'),'clickSend',util[_0xd261('0x36')](_0x3c9932,{'showHidden':![],'depth':null}));});}else{logger[_0xd261('0x18')](_0xd261('0x24'),_0xd261('0x23'),_0xd261('0x49'),_0xd261('0x37'));}break;case _0xd261('0x4a'):if(_0x1600d1[_0xd261('0x4b')]&&_0x1600d1[_0xd261('0x1d')]){var _0x228cd1={'dst':_0x3f13f5['phone'],'text':_0x3f13f5[_0xd261('0xc')],'src':_0x1600d1[_0xd261('0x39')]||_0x1600d1[_0xd261('0x1e')],'url':_0x1600d1[_0xd261('0x4c')]+'/api/sms/messages/'+_0x3f13f5['id']+_0xd261('0x20')+_0x1600d1[_0xd261('0x21')]};var _0x448ee4=util[_0xd261('0x40')]('%s:%s',_0x1600d1['authId'],_0x1600d1[_0xd261('0x1d')]);var _0x856af0={'method':'POST','uri':util[_0xd261('0x40')](_0xd261('0x4d'),_0x1600d1[_0xd261('0x4b')]),'body':_0x228cd1,'headers':{'Authorization':util['format'](_0xd261('0x4e'),new Buffer(_0x448ee4)[_0xd261('0x43')](_0xd261('0x4f')))},'json':!![]};rp(_0x856af0)[_0xd261('0x15')](function(_0x5e2481){var _0x18cab6={'messageId':_0x5e2481[_0xd261('0x50')][0x0]};return _0x36b0e3[_0xd261('0x16')](_0x18cab6);})[_0xd261('0x17')](function(_0x293fb7){logger[_0xd261('0x18')](_0xd261('0x24'),_0xd261('0x23'),'plivo',util[_0xd261('0x36')](_0x293fb7,{'showHidden':![],'depth':null}));});}else{logger[_0xd261('0x18')](_0xd261('0x24'),_0xd261('0x23'),_0xd261('0x4a'),'Missing\x20parameters:\x20authId,\x20authToken');}break;case _0xd261('0x51'):if(_0x1600d1['username']&&_0x1600d1[_0xd261('0x29')]){if(_0x1600d1['baseUrl']){var _0x39eb4b={'method':_0xd261('0x3a'),'uri':_0x1600d1[_0xd261('0x52')]+_0xd261('0x53'),'body':{'username':_0x1600d1[_0xd261('0x28')],'password':_0x1600d1['password']},'json':!![]};return rp(_0x39eb4b)[_0xd261('0x15')](function(_0x29491b){var _0x3e50f1={'method':_0xd261('0x3a'),'uri':_0x1600d1[_0xd261('0x52')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0x1600d1[_0xd261('0x1e')],'destinations':[{'to':_0x3f13f5['phone']}],'text':_0x3f13f5[_0xd261('0xc')],'notifyUrl':_0x1600d1[_0xd261('0x4c')]+'/api/sms/messages/'+_0x3f13f5['id']+'/status?token='+_0x1600d1['token'],'notifyContentType':_0xd261('0x54'),'callbackData':_0x1600d1[_0xd261('0x1e')]+';'+_0x3f13f5[_0xd261('0xc')]}]},'headers':{'Authorization':'IBSSO\x20'+_0x29491b[_0xd261('0x21')]},'json':!![]};return rp(_0x3e50f1)[_0xd261('0x15')](function(_0x17aaaa){if(_0x17aaaa[_0xd261('0x47')]){var _0x357894={'messageId':_0x17aaaa['messages'][0x0]['messageId']};if(!_0x1600d1[_0xd261('0x34')]){_0x357894[_0xd261('0x35')]=!![];}return _0x36b0e3['update'](_0x357894);}else{return logger[_0xd261('0x18')](_0xd261('0x24'),_0xd261('0x23'),'infobip',util[_0xd261('0x36')](_0x17aaaa,{'showHidden':![],'depth':null}));}});})[_0xd261('0x17')](function(_0x5068bf){return logger[_0xd261('0x18')](_0xd261('0x24'),_0xd261('0x23'),_0xd261('0x51'),util['inspect'](_0x5068bf,{'showHidden':![],'depth':null}));});}else{logger[_0xd261('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd261('0x23'),_0xd261('0x51'),_0xd261('0x55'));}}else{logger[_0xd261('0x18')](_0xd261('0x24'),_0xd261('0x23'),_0xd261('0x51'),_0xd261('0x37'));}break;case _0xd261('0x56'):var _0x1ceeaa=require(_0xd261('0x57'));if(_0x1600d1[_0xd261('0x58')]){var _0x876f0a={};_0x876f0a[_0xd261('0x59')]=_0x1600d1[_0xd261('0x28')];_0x876f0a['phone']=_0x3f13f5[_0xd261('0x1e')];_0x876f0a[_0xd261('0x2b')]=_0x1600d1[_0xd261('0x1e')];_0x876f0a[_0xd261('0x5a')]=_0x3f13f5[_0xd261('0xc')];_0x876f0a[_0xd261('0x5b')]=+new Date();var _0x18b7b5='';var _0x5ae900='';var _0x5f1294=Object[_0xd261('0x5c')](_0x876f0a);_0x5f1294['sort']();for(var _0x13e2e0=0x0;_0x13e2e0<_0x5f1294[_0xd261('0x5d')];_0x13e2e0++){if(_0x18b7b5!=''){_0x18b7b5+='&';}_0x18b7b5+=_0x5f1294[_0x13e2e0]+'='+encodeURIComponent(_0x876f0a[_0x5f1294[_0x13e2e0]]);_0x5ae900+=_0x876f0a[_0x5f1294[_0x13e2e0]];}_0x5ae900+=_0x1600d1['apiKey'];_0x5ae900=_0x1ceeaa[_0xd261('0x5e')]('md5')['update'](_0x5ae900)['digest'](_0xd261('0x5f'));if(_0x18b7b5!==''){_0x18b7b5+='&';}_0x18b7b5+=_0xd261('0x60')+_0x5ae900;var _0x19eda1={'method':'GET','uri':_0x1600d1[_0xd261('0x52')]+_0xd261('0x61')+_0x18b7b5,'json':!![]};return rp(_0x19eda1)['then'](function(_0x491ee4){var _0xe90fd1=Object[_0xd261('0x5c')](_0x491ee4);if(_0x491ee4[_0xe90fd1[0x0]][_0xd261('0x18')]&&parseInt(_0x491ee4[_0xe90fd1[0x0]][_0xd261('0x18')])===0x0){var _0x1e2e4d={'messageId':_0x491ee4[_0xe90fd1[0x0]][_0xd261('0x62')]};if(!_0x1600d1[_0xd261('0x34')]){_0x1e2e4d[_0xd261('0x35')]=!![];}return _0x36b0e3[_0xd261('0x16')](_0x1e2e4d);}else{return logger[_0xd261('0x18')](_0xd261('0x24'),_0xd261('0x23'),'csc',util[_0xd261('0x36')](_0x491ee4[_0xd261('0x18')],{'showHidden':![],'depth':null}));}})[_0xd261('0x17')](function(_0x24e8d6){return logger[_0xd261('0x18')](_0xd261('0x24'),_0xd261('0x23'),'csc',util[_0xd261('0x36')](_0x24e8d6,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd261('0x23'),_0xd261('0x56'),'Missing\x20parameters:\x20apiKey');}break;case _0xd261('0x63'):if(_0x1600d1[_0xd261('0x58')]){var _0x49be75={'method':_0xd261('0x3a'),'uri':_0xd261('0x64'),'headers':{'Authorization':_0x1600d1['apiKey']},'body':{'content':_0x3f13f5[_0xd261('0xc')],'to':[_0x3f13f5['phone']],'from':_0x1600d1[_0xd261('0x1e')],'binary':![],'clientMessageId':_0xd261('0x65'),'charset':'UTF-8'},'json':!![]};rp(_0x49be75)[_0xd261('0x15')](function(_0x54122f){if(!_0x54122f[_0xd261('0x18')]){var _0x1b9cf5={'messageId':_0x54122f[_0xd261('0x47')][0x0][_0xd261('0x66')]};if(!_0x1600d1['deliveryReport']){_0x1b9cf5['read']=!![];}return _0x36b0e3[_0xd261('0x16')](_0x1b9cf5);}else{return logger[_0xd261('0x18')](_0xd261('0x24'),'afterCreate',_0xd261('0x63'),util[_0xd261('0x36')](_0x54122f['error'],{'showHidden':![],'depth':null}));}})[_0xd261('0x17')](function(_0xc4447d){return logger['error'](_0xd261('0x24'),'afterCreate','clickatell',util[_0xd261('0x36')](_0xc4447d,{'showHidden':![],'depth':null}));});}else{logger[_0xd261('0x18')](_0xd261('0x24'),_0xd261('0x23'),'clickatell',_0xd261('0x67'));}break;case'bandwidth':if(_0x1600d1[_0xd261('0x28')]&&_0x1600d1[_0xd261('0x29')]){var _0x448ee4=util[_0xd261('0x40')]('%s:%s',_0x1600d1[_0xd261('0x28')],_0x1600d1[_0xd261('0x29')]);var _0x856af0={'method':_0xd261('0x3a'),'uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x1600d1[_0xd261('0x68')]+_0xd261('0x69'),'body':{'to':[_0x3f13f5[_0xd261('0x1e')]],'text':_0x3f13f5[_0xd261('0xc')],'from':_0x1600d1[_0xd261('0x1e')],'applicationId':_0x1600d1[_0xd261('0x6a')]},'headers':{'Authorization':util[_0xd261('0x40')](_0xd261('0x4e'),new Buffer(_0x448ee4)[_0xd261('0x43')](_0xd261('0x4f')))},'json':!![]};rp(_0x856af0)[_0xd261('0x15')](function(_0x140eaa){if(_0x140eaa['id']){var _0x3e5855={'messageId':_0x140eaa['id']};return _0x36b0e3[_0xd261('0x16')](_0x3e5855);}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xd261('0x6b'),util['inspect'](_0x140eaa,{'showHidden':![],'depth':null}));}})[_0xd261('0x17')](function(_0x2f48d0){logger[_0xd261('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd261('0x23'),'bandwidth',util[_0xd261('0x36')](_0x2f48d0,{'showHidden':![],'depth':null}));});}else{logger[_0xd261('0x18')](_0xd261('0x24'),_0xd261('0x23'),'bandwidth',_0xd261('0x37'));}break;case'intelepeer':if(_0x1600d1[_0xd261('0x58')]){var _0x43add1={};var _0x19eda1={'method':_0xd261('0x3a'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':_0xd261('0x6c')+_0x1600d1[_0xd261('0x58')],'Content-Type':_0xd261('0x54')},'body':{'from':_0x1600d1[_0xd261('0x1e')],'to':_0x3f13f5[_0xd261('0x1e')],'text':_0x3f13f5[_0xd261('0xc')]},'json':!![]};return rp(_0x19eda1)[_0xd261('0x15')](function(_0x30cb23){if(_0x30cb23[_0xd261('0x6d')]==0xca){_0x43add1[_0xd261('0x6e')]=_0x30cb23;var _0x661723={'method':_0xd261('0x3a'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':'Bearer\x20'+_0x1600d1[_0xd261('0x58')],'Content-Type':'application/json'},'body':{'refid':_0x43add1[_0xd261('0x6e')][_0xd261('0x6f')]},'json':!![]};return rp(_0x661723)['then'](function(_0x4ca0aa){_0x43add1[_0xd261('0x70')]=_0x4ca0aa;var _0x27ee64={'messageId':_0x43add1['message']['refid'],'read':!![]};return _0x36b0e3['update'](_0x27ee64);});}else{return logger['error'](_0xd261('0x24'),_0xd261('0x23'),'intelepeer',util[_0xd261('0x36')](_0x30cb23,{'showHidden':![],'depth':null}));}})[_0xd261('0x17')](function(_0x8f2a3){return logger[_0xd261('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd261('0x23'),_0xd261('0x71'),util[_0xd261('0x36')](_0x8f2a3,{'showHidden':![],'depth':null}));});}else{return logger[_0xd261('0x18')](_0xd261('0x24'),_0xd261('0x23'),'intelepeer',_0xd261('0x72'));}break;}}})[_0xd261('0x73')](function(){_0x3fc8d5();});}else{_0x3fc8d5();}}},'charset':_0xd261('0x74'),'collate':_0xd261('0x75')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 7b02d83..ee9e6c9 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 _0x59da=['defaults','localhost','redis','./smsMessage.socket','register','request','then','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateSmsMessage','SmsMessage','create','options','raw','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http'];(function(_0x28e72b,_0x5e16ab){var _0x77418f=function(_0xe6d89d){while(--_0xe6d89d){_0x28e72b['push'](_0x28e72b['shift']());}};_0x77418f(++_0x5e16ab);}(_0x59da,0xfe));var _0xa59d=function(_0x3f68be,_0x5c084e){_0x3f68be=_0x3f68be-0x0;var _0x5a1e47=_0x59da[_0x3f68be];return _0x5a1e47;};'use strict';var _=require('lodash');var util=require(_0xa59d('0x0'));var moment=require(_0xa59d('0x1'));var BPromise=require(_0xa59d('0x2'));var rs=require(_0xa59d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa59d('0x4'))['db'];var utils=require(_0xa59d('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xa59d('0x6'));var jayson=require(_0xa59d('0x7'));var client=jayson[_0xa59d('0x8')][_0xa59d('0x9')]({'port':0x232a});config['redis']=_[_0xa59d('0xa')](config['redis'],{'host':_0xa59d('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa59d('0xc')]));require(_0xa59d('0xd'))[_0xa59d('0xe')](socket);function respondWithRpcPromise(_0x38f69d,_0xdb6f33,_0x587d60){return new BPromise(function(_0x192507,_0xb1b845){return client[_0xa59d('0xf')](_0x38f69d,_0x587d60)[_0xa59d('0x10')](function(_0x2d0dc){logger['info'](_0xa59d('0x11'),_0xdb6f33,_0xa59d('0x12'));logger[_0xa59d('0x13')](_0xa59d('0x14'),_0xdb6f33,'request\x20sent',JSON[_0xa59d('0x15')](_0x2d0dc));if(_0x2d0dc[_0xa59d('0x16')]){if(_0x2d0dc['error'][_0xa59d('0x17')]===0x1f4){logger['error'](_0xa59d('0x11'),_0xdb6f33,_0x2d0dc['error'][_0xa59d('0x18')]);return _0xb1b845(_0x2d0dc[_0xa59d('0x16')][_0xa59d('0x18')]);}logger[_0xa59d('0x16')](_0xa59d('0x11'),_0xdb6f33,_0x2d0dc['error'][_0xa59d('0x18')]);return _0x192507(_0x2d0dc[_0xa59d('0x16')][_0xa59d('0x18')]);}else{logger[_0xa59d('0x19')]('SmsMessage,\x20%s,\x20%s',_0xdb6f33,_0xa59d('0x12'));_0x192507(_0x2d0dc[_0xa59d('0x1a')][_0xa59d('0x18')]);}})[_0xa59d('0x1b')](function(_0x190194){logger['error'](_0xa59d('0x11'),_0xdb6f33,_0x190194);_0xb1b845(_0x190194);});});}exports[_0xa59d('0x1c')]=function(_0x324830){var _0x4513a6=this;return new Promise(function(_0x342a38,_0x4a206b){return db[_0xa59d('0x1d')][_0xa59d('0x1e')](_0x324830['body'],{'raw':_0x324830[_0xa59d('0x1f')]?_0x324830[_0xa59d('0x1f')][_0xa59d('0x20')]===undefined?!![]:![]:!![]})[_0xa59d('0x10')](function(_0x11faad){logger['info'](_0xa59d('0x1c'),_0x324830);logger['debug'](_0xa59d('0x1c'),_0x324830,JSON[_0xa59d('0x15')](_0x11faad));_0x342a38(_0x11faad);})['catch'](function(_0x38303b){logger[_0xa59d('0x16')](_0xa59d('0x1c'),_0x38303b[_0xa59d('0x18')],_0x324830);_0x4a206b(_0x4513a6[_0xa59d('0x16')](0x1f4,_0x38303b['message']));});});}; \ No newline at end of file +var _0x8b1b=['SmsMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','SmsMessage','create','body','options','raw','info','CreateSmsMessage','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./smsMessage.socket','register','request'];(function(_0x488b85,_0x10ec23){var _0x59d07d=function(_0x16838b){while(--_0x16838b){_0x488b85['push'](_0x488b85['shift']());}};_0x59d07d(++_0x10ec23);}(_0x8b1b,0xb5));var _0xb8b1=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x8b1b[_0x5f1391];return _0x50ebe3;};'use strict';var _=require(_0xb8b1('0x0'));var util=require(_0xb8b1('0x1'));var moment=require(_0xb8b1('0x2'));var BPromise=require('bluebird');var rs=require(_0xb8b1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb8b1('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb8b1('0x5'))(_0xb8b1('0x6'));var config=require(_0xb8b1('0x7'));var jayson=require(_0xb8b1('0x8'));var client=jayson[_0xb8b1('0x9')][_0xb8b1('0xa')]({'port':0x232a});config[_0xb8b1('0xb')]=_['defaults'](config[_0xb8b1('0xb')],{'host':_0xb8b1('0xc'),'port':0x18eb});var socket=require(_0xb8b1('0xd'))(new Redis(config['redis']));require(_0xb8b1('0xe'))[_0xb8b1('0xf')](socket);function respondWithRpcPromise(_0x577454,_0x2b7ffe,_0x477899){return new BPromise(function(_0x284061,_0x5bdd27){return client[_0xb8b1('0x10')](_0x577454,_0x477899)['then'](function(_0x2448fa){logger['info'](_0xb8b1('0x11'),_0x2b7ffe,'request\x20sent');logger[_0xb8b1('0x12')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2b7ffe,_0xb8b1('0x13'),JSON[_0xb8b1('0x14')](_0x2448fa));if(_0x2448fa[_0xb8b1('0x15')]){if(_0x2448fa[_0xb8b1('0x15')][_0xb8b1('0x16')]===0x1f4){logger['error']('SmsMessage,\x20%s,\x20%s',_0x2b7ffe,_0x2448fa['error']['message']);return _0x5bdd27(_0x2448fa[_0xb8b1('0x15')]['message']);}logger['error'](_0xb8b1('0x11'),_0x2b7ffe,_0x2448fa['error'][_0xb8b1('0x17')]);return _0x284061(_0x2448fa['error'][_0xb8b1('0x17')]);}else{logger['info']('SmsMessage,\x20%s,\x20%s',_0x2b7ffe,_0xb8b1('0x13'));_0x284061(_0x2448fa[_0xb8b1('0x18')][_0xb8b1('0x17')]);}})[_0xb8b1('0x19')](function(_0x4f181f){logger[_0xb8b1('0x15')](_0xb8b1('0x11'),_0x2b7ffe,_0x4f181f);_0x5bdd27(_0x4f181f);});});}exports['CreateSmsMessage']=function(_0x37e694){var _0x4c8f2f=this;return new Promise(function(_0xe21b3b,_0x9936b8){return db[_0xb8b1('0x1a')][_0xb8b1('0x1b')](_0x37e694[_0xb8b1('0x1c')],{'raw':_0x37e694[_0xb8b1('0x1d')]?_0x37e694['options'][_0xb8b1('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x1acb48){logger[_0xb8b1('0x1f')]('CreateSmsMessage',_0x37e694);logger[_0xb8b1('0x12')](_0xb8b1('0x20'),_0x37e694,JSON[_0xb8b1('0x14')](_0x1acb48));_0xe21b3b(_0x1acb48);})[_0xb8b1('0x19')](function(_0x2a1d8c){logger[_0xb8b1('0x15')]('CreateSmsMessage',_0x2a1d8c[_0xb8b1('0x17')],_0x37e694);_0x9936b8(_0x4c8f2f['error'](0x1f4,_0x2a1d8c[_0xb8b1('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 923e42b..93aad33 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 _0xe86a=['./smsMessage.events','save','update','emit','removeListener','register','length'];(function(_0x39d544,_0x35c14f){var _0x5a5ff2=function(_0x2271fb){while(--_0x2271fb){_0x39d544['push'](_0x39d544['shift']());}};_0x5a5ff2(++_0x35c14f);}(_0xe86a,0x1ab));var _0xae86=function(_0xd0cc13,_0x25ad07){_0xd0cc13=_0xd0cc13-0x0;var _0x504acb=_0xe86a[_0xd0cc13];return _0x504acb;};'use strict';var SmsMessageEvents=require(_0xae86('0x0'));var events=[_0xae86('0x1'),'remove',_0xae86('0x2')];function createListener(_0x2e3ab5,_0x2adc63){return function(_0x178336){_0x2adc63[_0xae86('0x3')](_0x2e3ab5,_0x178336);};}function removeListener(_0x3408bb,_0x1e8493){return function(){SmsMessageEvents[_0xae86('0x4')](_0x3408bb,_0x1e8493);};}exports[_0xae86('0x5')]=function(_0x28118f){for(var _0xeae460=0x0,_0x2fa149=events[_0xae86('0x6')];_0xeae460<_0x2fa149;_0xeae460++){var _0x43cdd5=events[_0xeae460];var _0x2defd0=createListener('smsMessage:'+_0x43cdd5,_0x28118f);SmsMessageEvents['on'](_0x43cdd5,_0x2defd0);}}; \ No newline at end of file +var _0x2bf2=['remove','update','emit','register','length','smsMessage:'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x2bf2,0xf0));var _0x22bf=function(_0xda6ad8,_0x102e5e){_0xda6ad8=_0xda6ad8-0x0;var _0x513b3f=_0x2bf2[_0xda6ad8];return _0x513b3f;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=['save',_0x22bf('0x0'),_0x22bf('0x1')];function createListener(_0x3dd44d,_0x33e3fd){return function(_0x3c16d3){_0x33e3fd[_0x22bf('0x2')](_0x3dd44d,_0x3c16d3);};}function removeListener(_0xfc15fb,_0x57bef1){return function(){SmsMessageEvents['removeListener'](_0xfc15fb,_0x57bef1);};}exports[_0x22bf('0x3')]=function(_0x40c3dc){for(var _0x50ed2a=0x0,_0x1f6d74=events[_0x22bf('0x4')];_0x50ed2a<_0x1f6d74;_0x50ed2a++){var _0x4f1512=events[_0x50ed2a];var _0x2c8560=createListener(_0x22bf('0x5')+_0x4f1512,_0x40c3dc);SmsMessageEvents['on'](_0x4f1512,_0x2c8560);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 61075d2..b5d65a1 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 _0x1888=['removeTeams','removeAgents','exports','multer','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','index','describe','/:id','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','put','destroy','delete'];(function(_0x277d3b,_0x409552){var _0x343fa4=function(_0x442808){while(--_0x442808){_0x277d3b['push'](_0x277d3b['shift']());}};_0x343fa4(++_0x409552);}(_0x1888,0x6b));var _0x8188=function(_0x32c798,_0xd2fe15){_0x32c798=_0x32c798-0x0;var _0x429dbf=_0x1888[_0x32c798];return _0x429dbf;};'use strict';var multer=require(_0x8188('0x0'));var util=require(_0x8188('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8188('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x8188('0x3'));var interaction=require(_0x8188('0x4'));var config=require(_0x8188('0x5'));var controller=require(_0x8188('0x6'));router[_0x8188('0x7')]('/',auth[_0x8188('0x8')](),controller[_0x8188('0x9')]);router[_0x8188('0x7')]('/describe',auth[_0x8188('0x8')](),controller[_0x8188('0xa')]);router[_0x8188('0x7')](_0x8188('0xb'),auth[_0x8188('0x8')](),controller['show']);router['get'](_0x8188('0xc'),auth['isAuthenticated'](),controller['getMembers']);router[_0x8188('0x7')](_0x8188('0xd'),auth['isAuthenticated'](),controller[_0x8188('0xe')]);router['get'](_0x8188('0xf'),auth['isAuthenticated'](),controller[_0x8188('0x10')]);router[_0x8188('0x11')]('/',auth[_0x8188('0x8')](),controller[_0x8188('0x12')]);router['post'](_0x8188('0xd'),auth[_0x8188('0x8')](),controller[_0x8188('0x13')]);router[_0x8188('0x11')](_0x8188('0xf'),auth[_0x8188('0x8')](),controller['addAgents']);router[_0x8188('0x14')](_0x8188('0xb'),auth[_0x8188('0x8')](),controller['update']);router['delete'](_0x8188('0xb'),auth[_0x8188('0x8')](),controller[_0x8188('0x15')]);router[_0x8188('0x16')](_0x8188('0xd'),auth[_0x8188('0x8')](),controller[_0x8188('0x17')]);router['delete'](_0x8188('0xf'),auth[_0x8188('0x8')](),controller[_0x8188('0x18')]);module[_0x8188('0x19')]=router; \ No newline at end of file +var _0x0a04=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','index','get','/describe','isAuthenticated','describe','/:id','/:id/members','/:id/teams','getTeams','/:id/users','post','create','addTeams','addAgents','put','delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x0a04,0x1db));var _0x40a0=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x0a04[_0x263a74];return _0x2aa86c;};'use strict';var multer=require(_0x40a0('0x0'));var util=require(_0x40a0('0x1'));var path=require(_0x40a0('0x2'));var timeout=require(_0x40a0('0x3'));var express=require(_0x40a0('0x4'));var router=express[_0x40a0('0x5')]();var fs_extra=require(_0x40a0('0x6'));var auth=require(_0x40a0('0x7'));var interaction=require(_0x40a0('0x8'));var config=require(_0x40a0('0x9'));var controller=require(_0x40a0('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0x40a0('0xb')]);router[_0x40a0('0xc')](_0x40a0('0xd'),auth[_0x40a0('0xe')](),controller[_0x40a0('0xf')]);router[_0x40a0('0xc')](_0x40a0('0x10'),auth[_0x40a0('0xe')](),controller['show']);router[_0x40a0('0xc')](_0x40a0('0x11'),auth[_0x40a0('0xe')](),controller['getMembers']);router[_0x40a0('0xc')](_0x40a0('0x12'),auth[_0x40a0('0xe')](),controller[_0x40a0('0x13')]);router[_0x40a0('0xc')](_0x40a0('0x14'),auth['isAuthenticated'](),controller['getAgents']);router[_0x40a0('0x15')]('/',auth[_0x40a0('0xe')](),controller[_0x40a0('0x16')]);router[_0x40a0('0x15')](_0x40a0('0x12'),auth[_0x40a0('0xe')](),controller[_0x40a0('0x17')]);router[_0x40a0('0x15')](_0x40a0('0x14'),auth[_0x40a0('0xe')](),controller[_0x40a0('0x18')]);router[_0x40a0('0x19')](_0x40a0('0x10'),auth['isAuthenticated'](),controller['update']);router[_0x40a0('0x1a')]('/:id',auth[_0x40a0('0xe')](),controller['destroy']);router[_0x40a0('0x1a')]('/:id/teams',auth[_0x40a0('0xe')](),controller[_0x40a0('0x1b')]);router[_0x40a0('0x1a')](_0x40a0('0x14'),auth[_0x40a0('0xe')](),controller[_0x40a0('0x1c')]);module[_0x40a0('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 08cbfc6..6f9eb03 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 _0x579f=['rrmemory','roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM'];(function(_0x261872,_0x3eaeb5){var _0x5074f3=function(_0x460e48){while(--_0x460e48){_0x261872['push'](_0x261872['shift']());}};_0x5074f3(++_0x3eaeb5);}(_0x579f,0x142));var _0xf579=function(_0x2572b4,_0xdcd1b8){_0x2572b4=_0x2572b4-0x0;var _0x3b2fa=_0x579f[_0x2572b4];return _0x3b2fa;};'use strict';var Sequelize=require(_0xf579('0x0'));module[_0xf579('0x1')]={'name':{'type':Sequelize[_0xf579('0x2')],'unique':_0xf579('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xf579('0x2')]},'timeout':{'type':Sequelize[_0xf579('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xf579('0x5')](_0xf579('0x6'),'beepall',_0xf579('0x7'))}}; \ No newline at end of file +var _0x2bbd=['name','ENUM','rrmemory','beepall','roundrobin','sequelize','STRING'];(function(_0x532c8f,_0x524d2c){var _0x3030ba=function(_0x160b87){while(--_0x160b87){_0x532c8f['push'](_0x532c8f['shift']());}};_0x3030ba(++_0x524d2c);}(_0x2bbd,0xd7));var _0xd2bb=function(_0x1a2ffa,_0x4a20e1){_0x1a2ffa=_0x1a2ffa-0x0;var _0x2f7dbf=_0x2bbd[_0x1a2ffa];return _0x2f7dbf;};'use strict';var Sequelize=require(_0xd2bb('0x0'));module['exports']={'name':{'type':Sequelize[_0xd2bb('0x1')],'unique':_0xd2bb('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xd2bb('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xd2bb('0x3')](_0xd2bb('0x4'),_0xd2bb('0x5'),_0xd2bb('0x6'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index e4bfb7c..9b3fc56 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 _0xdb28=['userSmsQueue:save','removeTeams','select','field','from','team_has_sms_queues','join','SmsQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','QueryTypes','TeamId','includes','all','union','value','isEmpty','removeAgents','forEach','addAgents','omit','spread','userSmsQueue:remove','getAgents','bluebird','util','lodash','squel','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','./smsQueue.socket','register','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','update','then','get','SmsQueues','destroy','error','stack','name','map','SmsQueue','fieldName','type','key','where','include','rows','show','keys','query','filters','intersection','model','attributes','fields','length','includeAll','merge','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','catch','body','params','describe','getMembers','findOne','UserSmsQueue','rawAttributes','hasOwnProperty','nolimit','order','sort','SmsQueueId','filter','findAll','User','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','format','%s/%s','getTeams','Team','pick','ids','Agents','online','voicePause','interface','sequelize','transaction','addTeams','each','emit'];(function(_0x2b6397,_0x1110fc){var _0x57d6a3=function(_0x483073){while(--_0x483073){_0x2b6397['push'](_0x2b6397['shift']());}};_0x57d6a3(++_0x1110fc);}(_0xdb28,0x106));var _0x8db2=function(_0x25e614,_0x1144d4){_0x25e614=_0x25e614-0x0;var _0x427b77=_0xdb28[_0x25e614];return _0x427b77;};'use strict';var BPromise=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var _=require(_0x8db2('0x2'));var squel=require(_0x8db2('0x3'));var Redis=require('ioredis');var qs=require(_0x8db2('0x4'));var logger=require(_0x8db2('0x5'))(_0x8db2('0x6'));var config=require(_0x8db2('0x7'));var db=require(_0x8db2('0x8'))['db'];config['redis']=_[_0x8db2('0x9')](config[_0x8db2('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8db2('0xa')]));require(_0x8db2('0xb'))[_0x8db2('0xc')](socket);function respondWithStatusCode(_0x29f698,_0x2f3f2f){_0x2f3f2f=_0x2f3f2f||0xcc;return function(_0x1ff362){if(_0x1ff362){return _0x29f698[_0x8db2('0xd')](_0x2f3f2f);}return _0x29f698['status'](_0x2f3f2f)[_0x8db2('0xe')]();};}function respondWithResult(_0x476216,_0x1f62af){_0x1f62af=_0x1f62af||0xc8;return function(_0x57015f){if(_0x57015f){return _0x476216[_0x8db2('0xf')](_0x1f62af)[_0x8db2('0x10')](_0x57015f);}};}function respondWithFilteredResult(_0x576475,_0x41beda){return function(_0x3b2faa){if(_0x3b2faa){var _0x1349f6=typeof _0x41beda[_0x8db2('0x11')]===_0x8db2('0x12')&&typeof _0x41beda['limit']==='undefined';var _0x15070d=_0x3b2faa[_0x8db2('0x13')];var _0x350d61=_0x1349f6?0x0:_0x41beda[_0x8db2('0x11')];var _0x227355=_0x1349f6?_0x3b2faa[_0x8db2('0x13')]:_0x41beda[_0x8db2('0x11')]+_0x41beda[_0x8db2('0x14')];var _0x131252;if(_0x227355>=_0x15070d){_0x227355=_0x15070d;_0x131252=0xc8;}else{_0x131252=0xce;}_0x576475[_0x8db2('0xf')](_0x131252);return _0x576475['set'](_0x8db2('0x15'),_0x350d61+'-'+_0x227355+'/'+_0x15070d)[_0x8db2('0x10')](_0x3b2faa);}return null;};}function saveUpdates(_0x48101e){return function(_0x2b3f73){if(_0x2b3f73){return _0x2b3f73[_0x8db2('0x16')](_0x48101e)[_0x8db2('0x17')](function(_0x3fddc2){return _0x3fddc2;});}return null;};}function removeEntity(_0x2efd06){return function(_0x46ce14){if(_0x46ce14){return _0x46ce14['destroy']()['then'](function(){var _0x77789=_0x46ce14[_0x8db2('0x18')]({'plain':!![]});var _0x1310d3=_0x8db2('0x19');return db['UserProfileResource'][_0x8db2('0x1a')]({'where':{'type':_0x1310d3,'resourceId':_0x77789['id']}})[_0x8db2('0x17')](function(){return _0x46ce14;});})[_0x8db2('0x17')](function(){_0x2efd06[_0x8db2('0xf')](0xcc)[_0x8db2('0xe')]();});}};}function handleEntityNotFound(_0x597260){return function(_0x124467){if(!_0x124467){_0x597260[_0x8db2('0xd')](0x194);}return _0x124467;};}function handleError(_0x18f69c,_0x125be2){_0x125be2=_0x125be2||0x1f4;return function(_0x2260d8){logger[_0x8db2('0x1b')](_0x2260d8[_0x8db2('0x1c')]);if(_0x2260d8['name']){delete _0x2260d8[_0x8db2('0x1d')];}_0x18f69c['status'](_0x125be2)['send'](_0x2260d8);};}exports['index']=function(_0x4d923c,_0xec8cd2){var _0x29b5cd={};var _0x3be281={'count':0x0,'rows':[]};var _0x2baed0=_[_0x8db2('0x1e')](db[_0x8db2('0x1f')]['rawAttributes'],function(_0x3544ba){return{'name':_0x3544ba[_0x8db2('0x20')],'type':_0x3544ba[_0x8db2('0x21')][_0x8db2('0x22')]};});_0x29b5cd=qs['getOptions'](_0x2baed0,_0x4d923c);var _0x2e0691={'where':_0x29b5cd[_0x8db2('0x23')]};return db[_0x8db2('0x1f')][_0x8db2('0x13')](_0x2e0691)[_0x8db2('0x17')](function(_0x21bae5){_0x3be281[_0x8db2('0x13')]=_0x21bae5;_0x29b5cd[_0x8db2('0x24')]=qs[_0x8db2('0x24')](_0x4d923c['query']);return db[_0x8db2('0x1f')]['findAll'](_0x29b5cd);})['then'](function(_0x302188){_0x3be281[_0x8db2('0x25')]=_0x302188;return _0x3be281;})[_0x8db2('0x17')](respondWithFilteredResult(_0xec8cd2,_0x29b5cd))['catch'](handleError(_0xec8cd2,null));};exports[_0x8db2('0x26')]=function(_0x56b71a,_0x3f7aac){var _0x2b653b={'raw':!![],'where':{'id':_0x56b71a['params']['id']}},_0x14bd12={};_0x14bd12['model']=_[_0x8db2('0x27')](db[_0x8db2('0x1f')]['rawAttributes']);_0x14bd12['query']=_[_0x8db2('0x27')](_0x56b71a[_0x8db2('0x28')]);_0x14bd12[_0x8db2('0x29')]=_[_0x8db2('0x2a')](_0x14bd12[_0x8db2('0x2b')],_0x14bd12[_0x8db2('0x28')]);_0x2b653b[_0x8db2('0x2c')]=_[_0x8db2('0x2a')](_0x14bd12[_0x8db2('0x2b')],qs[_0x8db2('0x2d')](_0x56b71a['query'][_0x8db2('0x2d')]));_0x2b653b[_0x8db2('0x2c')]=_0x2b653b['attributes'][_0x8db2('0x2e')]?_0x2b653b[_0x8db2('0x2c')]:_0x14bd12['model'];if(_0x56b71a['query'][_0x8db2('0x2f')]){_0x2b653b['include']=[{'all':!![]}];}_0x2b653b=_[_0x8db2('0x30')]({},_0x2b653b,_0x56b71a[_0x8db2('0x31')]);return db[_0x8db2('0x1f')][_0x8db2('0x32')](_0x2b653b)['then'](handleEntityNotFound(_0x3f7aac,null))[_0x8db2('0x17')](respondWithResult(_0x3f7aac,null))['catch'](handleError(_0x3f7aac,null));};exports[_0x8db2('0x33')]=function(_0xd550ae,_0x2c8bc9){return db[_0x8db2('0x1f')]['create'](_0xd550ae['body'],{})[_0x8db2('0x17')](function(_0x2c0507){var _0x5dc2b4=_0xd550ae[_0x8db2('0x34')][_0x8db2('0x18')]({'plain':!![]});if(!_0x5dc2b4)throw new Error(_0x8db2('0x35'));if(_0x5dc2b4['role']===_0x8db2('0x34')){var _0x149186=_0x2c0507[_0x8db2('0x18')]({'plain':!![]});var _0x279e74=_0x8db2('0x19');return db[_0x8db2('0x36')][_0x8db2('0x32')]({'where':{'name':_0x279e74,'userProfileId':_0x5dc2b4[_0x8db2('0x37')]},'raw':!![]})[_0x8db2('0x17')](function(_0x63c561){if(_0x63c561&&_0x63c561[_0x8db2('0x38')]===0x0){return db[_0x8db2('0x39')][_0x8db2('0x33')]({'name':_0x149186['name'],'resourceId':_0x149186['id'],'type':_0x63c561[_0x8db2('0x1d')],'sectionId':_0x63c561['id']},{})[_0x8db2('0x17')](function(){return _0x2c0507;});}else{return _0x2c0507;}})['catch'](function(_0x49a7ae){logger[_0x8db2('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x49a7ae);throw _0x49a7ae;});}return _0x2c0507;})[_0x8db2('0x17')](respondWithResult(_0x2c8bc9,0xc9))[_0x8db2('0x3a')](handleError(_0x2c8bc9,null));};exports[_0x8db2('0x16')]=function(_0x307783,_0xb4fe2c){if(_0x307783[_0x8db2('0x3b')]['id']){delete _0x307783[_0x8db2('0x3b')]['id'];}return db['SmsQueue'][_0x8db2('0x32')]({'where':{'id':_0x307783[_0x8db2('0x3c')]['id']}})[_0x8db2('0x17')](handleEntityNotFound(_0xb4fe2c,null))[_0x8db2('0x17')](saveUpdates(_0x307783['body'],null))[_0x8db2('0x17')](respondWithResult(_0xb4fe2c,null))[_0x8db2('0x3a')](handleError(_0xb4fe2c,null));};exports[_0x8db2('0x1a')]=function(_0x2c47cc,_0x5427af){return db[_0x8db2('0x1f')]['find']({'where':{'id':_0x2c47cc[_0x8db2('0x3c')]['id']}})[_0x8db2('0x17')](handleEntityNotFound(_0x5427af,null))[_0x8db2('0x17')](removeEntity(_0x5427af,null))['catch'](handleError(_0x5427af,null));};exports['describe']=function(_0x1ec3d0,_0x47c556){return db[_0x8db2('0x1f')][_0x8db2('0x3d')]()[_0x8db2('0x17')](respondWithResult(_0x47c556,null))[_0x8db2('0x3a')](handleError(_0x47c556,null));};exports[_0x8db2('0x3e')]=function(_0x40c6e6,_0x4355e2){var _0xab6bdd={'raw':!![],'where':{}},_0x4291e3={},_0x12a1ef;return db[_0x8db2('0x1f')][_0x8db2('0x3f')]({'where':{'id':_0x40c6e6['params']['id']}})[_0x8db2('0x17')](handleEntityNotFound(_0x4355e2,null))[_0x8db2('0x17')](function(_0xdbba64){if(_0xdbba64){_0x12a1ef=_0xdbba64[_0x8db2('0x18')]({'plain':!![]});_0x4291e3['model']=_['keys'](db[_0x8db2('0x40')][_0x8db2('0x41')]);_0x4291e3[_0x8db2('0x28')]=_['keys'](_0x40c6e6['query']);_0x4291e3['filters']=_[_0x8db2('0x2a')](_0x4291e3[_0x8db2('0x2b')],_0x4291e3[_0x8db2('0x28')]);_0xab6bdd[_0x8db2('0x2c')]=_[_0x8db2('0x2a')](_0x4291e3[_0x8db2('0x2b')],qs[_0x8db2('0x2d')](_0x40c6e6['query']['fields']));_0xab6bdd[_0x8db2('0x2c')]=_0xab6bdd[_0x8db2('0x2c')][_0x8db2('0x2e')]?_0xab6bdd[_0x8db2('0x2c')]:_0x4291e3[_0x8db2('0x2b')];if(!_0x40c6e6[_0x8db2('0x28')][_0x8db2('0x42')](_0x8db2('0x43'))){_0xab6bdd[_0x8db2('0x14')]=qs[_0x8db2('0x14')](_0x40c6e6[_0x8db2('0x28')][_0x8db2('0x14')]);_0xab6bdd[_0x8db2('0x11')]=qs[_0x8db2('0x11')](_0x40c6e6[_0x8db2('0x28')]['offset']);}_0xab6bdd[_0x8db2('0x44')]=qs[_0x8db2('0x45')](_0x40c6e6['query'][_0x8db2('0x45')]);_0xab6bdd[_0x8db2('0x23')]=qs[_0x8db2('0x29')](_['pick'](_0x40c6e6[_0x8db2('0x28')],_0x4291e3[_0x8db2('0x29')]));_0xab6bdd[_0x8db2('0x23')][_0x8db2('0x46')]=_0xdbba64['id'];if(_0x40c6e6[_0x8db2('0x28')]['filter']){_0xab6bdd[_0x8db2('0x23')]=_[_0x8db2('0x30')](_0xab6bdd[_0x8db2('0x23')],{'$or':_['map'](_0xab6bdd[_0x8db2('0x2c')],function(_0x18cc13){var _0x33dddd={};_0x33dddd[_0x18cc13]={'$like':'%'+_0x40c6e6[_0x8db2('0x28')][_0x8db2('0x47')]+'%'};return _0x33dddd;})});}_0xab6bdd=_[_0x8db2('0x30')]({},_0xab6bdd,_0x40c6e6[_0x8db2('0x31')]);return db['UserSmsQueue'][_0x8db2('0x48')](_0xab6bdd);}})[_0x8db2('0x17')](function(_0x4d3c19){if(_0x4d3c19){return db[_0x8db2('0x49')][_0x8db2('0x4a')]({'where':{'id':_['map'](_0x4d3c19,_0x8db2('0x4b')),'role':_0x8db2('0x4c')},'attributes':['id',_0x8db2('0x1d'),_0x8db2('0x4d'),_0x8db2('0x4e'),_0x8db2('0x4f')]});}})[_0x8db2('0x17')](function(_0x33a600){if(_0x33a600){return{'count':_0x33a600[_0x8db2('0x13')],'rows':_[_0x8db2('0x1e')](_0x33a600[_0x8db2('0x25')],function(_0x447a47){return{'membername':_0x447a47[_0x8db2('0x1d')],'UserId':_0x447a47['id'],'queue_name':_0x12a1ef[_0x8db2('0x1d')],'SmsQueueId':_0x12a1ef['id'],'interface':util[_0x8db2('0x50')](_0x8db2('0x51'),'SIP',_0x447a47[_0x8db2('0x1d')]),'penalty':0x0,'paused':_0x447a47[_0x8db2('0x4d')],'createdAt':_0x447a47[_0x8db2('0x4f')],'updatedAt':_0x447a47[_0x8db2('0x4e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8db2('0x17')](respondWithFilteredResult(_0x4355e2,_0xab6bdd))['catch'](handleError(_0x4355e2,null));};exports[_0x8db2('0x52')]=function(_0x2c3087,_0x3ab670){var _0x1e1c0d={};var _0x2ad70f={};var _0x348da8;var _0x17341d;return db[_0x8db2('0x1f')][_0x8db2('0x3f')]({'where':{'id':_0x2c3087[_0x8db2('0x3c')]['id']}})[_0x8db2('0x17')](handleEntityNotFound(_0x3ab670,null))[_0x8db2('0x17')](function(_0x170a72){if(_0x170a72){_0x348da8=_0x170a72;_0x2ad70f[_0x8db2('0x2b')]=_[_0x8db2('0x27')](db[_0x8db2('0x53')][_0x8db2('0x41')]);_0x2ad70f[_0x8db2('0x28')]=_['keys'](_0x2c3087[_0x8db2('0x28')]);_0x2ad70f['filters']=_[_0x8db2('0x2a')](_0x2ad70f['model'],_0x2ad70f[_0x8db2('0x28')]);_0x1e1c0d[_0x8db2('0x2c')]=_[_0x8db2('0x2a')](_0x2ad70f[_0x8db2('0x2b')],qs[_0x8db2('0x2d')](_0x2c3087['query']['fields']));_0x1e1c0d[_0x8db2('0x2c')]=_0x1e1c0d[_0x8db2('0x2c')][_0x8db2('0x2e')]?_0x1e1c0d[_0x8db2('0x2c')]:_0x2ad70f[_0x8db2('0x2b')];_0x1e1c0d[_0x8db2('0x44')]=qs[_0x8db2('0x45')](_0x2c3087[_0x8db2('0x28')]['sort']);_0x1e1c0d[_0x8db2('0x23')]=qs[_0x8db2('0x29')](_[_0x8db2('0x54')](_0x2c3087[_0x8db2('0x28')],_0x2ad70f[_0x8db2('0x29')]));if(_0x2c3087[_0x8db2('0x28')][_0x8db2('0x47')]){_0x1e1c0d[_0x8db2('0x23')]=_['merge'](_0x1e1c0d['where'],{'$or':_[_0x8db2('0x1e')](_0x1e1c0d[_0x8db2('0x2c')],function(_0x1d2dfc){var _0x27f4cd={};_0x27f4cd[_0x1d2dfc]={'$like':'%'+_0x2c3087[_0x8db2('0x28')]['filter']+'%'};return _0x27f4cd;})});}_0x1e1c0d=_['merge']({},_0x1e1c0d,_0x2c3087[_0x8db2('0x31')]);return _0x348da8[_0x8db2('0x52')](_0x1e1c0d);}})['then'](function(_0xa698bd){if(_0xa698bd){_0x17341d=_0xa698bd[_0x8db2('0x2e')];if(!_0x2c3087[_0x8db2('0x28')]['hasOwnProperty'](_0x8db2('0x43'))){_0x1e1c0d[_0x8db2('0x14')]=qs[_0x8db2('0x14')](_0x2c3087['query'][_0x8db2('0x14')]);_0x1e1c0d[_0x8db2('0x11')]=qs[_0x8db2('0x11')](_0x2c3087[_0x8db2('0x28')][_0x8db2('0x11')]);}return _0x348da8['getTeams'](_0x1e1c0d);}})[_0x8db2('0x17')](function(_0x3023fe){if(_0x3023fe){return _0x3023fe?{'count':_0x17341d,'rows':_0x3023fe}:null;}})[_0x8db2('0x17')](respondWithResult(_0x3ab670,null))['catch'](handleError(_0x3ab670,null));};exports['addTeams']=function(_0x2cdf3c,_0xbe05ca){var _0x487dcb=_0x2cdf3c[_0x8db2('0x3b')][_0x8db2('0x55')];return db[_0x8db2('0x53')][_0x8db2('0x48')]({'where':{'id':_0x487dcb},'attributes':['id'],'include':[{'model':db[_0x8db2('0x49')],'as':_0x8db2('0x56'),'attributes':['id',_0x8db2('0x1d'),_0x8db2('0x57'),_0x8db2('0x58'),_0x8db2('0x59')],'raw':!![]}]})[_0x8db2('0x17')](function(_0x3e1478){if(_0x3e1478){var _0x24a52d=_['flatMap'](_0x3e1478,function(_0x2ba42d){var _0x4f29f1=_0x2ba42d[_0x8db2('0x18')]({'plain':!![]});return _0x4f29f1[_0x8db2('0x56')];});return db['SmsQueue'][_0x8db2('0x32')]({'where':{'id':_0x2cdf3c[_0x8db2('0x3c')]['id']}})['then'](function(_0x2159c4){return db[_0x8db2('0x5a')][_0x8db2('0x5b')](function(_0x25a3ab){return _0x2159c4[_0x8db2('0x5c')](_0x487dcb,{'transaction':_0x25a3ab})[_0x8db2('0x17')](function(){return BPromise[_0x8db2('0x5d')](_0x24a52d,function(_0x3ac0fa){return db[_0x8db2('0x40')]['findOrCreate']({'where':{'UserId':_0x3ac0fa['id'],'SmsQueueId':_0x2cdf3c['params']['id']},'transaction':_0x25a3ab});});})[_0x8db2('0x17')](function(){_0x24a52d['forEach'](function(_0xf8afa5){socket[_0x8db2('0x5e')](_0x8db2('0x5f'),{'UserId':_0xf8afa5['id'],'SmsQueueId':_0x2159c4['id']});});});});});}})['then'](respondWithStatusCode(_0xbe05ca,null))[_0x8db2('0x3a')](handleError(_0xbe05ca,null));};exports[_0x8db2('0x60')]=function(_0x3e37e7,_0x591c5d){return db[_0x8db2('0x53')][_0x8db2('0x48')]({'where':{'id':_0x3e37e7[_0x8db2('0x28')][_0x8db2('0x55')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x8db2('0x56'),'attributes':['id'],'raw':!![]}]})[_0x8db2('0x17')](handleEntityNotFound(_0x591c5d,null))[_0x8db2('0x17')](function(_0x1edb1a){var _0xcf1c42=_[_0x8db2('0x1e')](_0x1edb1a,'id');var _0x1aadfb=[];var _0x3682bf=[];var _0x358f48=squel[_0x8db2('0x61')]();_0x358f48[_0x8db2('0x62')]('tq.TeamId')[_0x8db2('0x63')](_0x8db2('0x64'),'tq')[_0x8db2('0x65')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x8db2('0x66'),_0x3e37e7[_0x8db2('0x3c')]['id']);for(var _0x3191c8=0x0;_0x3191c8<_0x1edb1a[_0x8db2('0x2e')];_0x3191c8+=0x1){let _0x2ad024=_0x1edb1a[_0x3191c8];for(var _0x313918=0x0;_0x313918<_0x2ad024[_0x8db2('0x56')][_0x8db2('0x2e')];_0x313918+=0x1){let _0x3b1929=_0x2ad024[_0x8db2('0x56')][_0x313918];var _0x46eb80=_0x358f48['clone']();_0x46eb80[_0x8db2('0x23')](_0x8db2('0x67'),_0x3b1929['id']);_0x3682bf[_0x8db2('0x68')](db[_0x8db2('0x5a')]['query'](_0x46eb80['toString'](),{'type':db[_0x8db2('0x5a')][_0x8db2('0x69')]['SELECT']})[_0x8db2('0x17')](function(_0x121f31){if(_0x121f31[_0x8db2('0x2e')]===0x1){return _0x3b1929['id'];}else{var _0x5f2ece=_['every'](_['map'](_0x121f31,_0x8db2('0x6a')),function(_0x18b4a6){return _[_0x8db2('0x6b')](_0xcf1c42,_0x18b4a6);});if(_0x5f2ece){return _0x3b1929['id'];}}}));}}return BPromise[_0x8db2('0x6c')](_0x3682bf)[_0x8db2('0x17')](function(_0x4e8aac){_0x1aadfb=_(_0x1aadfb)[_0x8db2('0x6d')](_0x4e8aac)['compact']()[_0x8db2('0x6e')]();return db[_0x8db2('0x1f')][_0x8db2('0x32')]({'where':{'id':_0x3e37e7[_0x8db2('0x3c')]['id']}})[_0x8db2('0x17')](function(_0x5d5380){return db['sequelize'][_0x8db2('0x5b')](function(_0x51afcf){return _0x5d5380[_0x8db2('0x60')](_0x3e37e7[_0x8db2('0x28')][_0x8db2('0x55')],{'transaction':_0x51afcf})[_0x8db2('0x17')](function(){if(!_[_0x8db2('0x6f')](_0x1aadfb)){return _0x5d5380[_0x8db2('0x70')](_0x1aadfb,{'transaction':_0x51afcf});}})['then'](function(){_0x1aadfb[_0x8db2('0x71')](function(_0x222ea2){socket[_0x8db2('0x5e')]('userSmsQueue:remove',{'UserId':_0x222ea2,'SmsQueueId':_0x5d5380['id']});});});});});});})[_0x8db2('0x17')](respondWithStatusCode(_0x591c5d,null))[_0x8db2('0x3a')](handleError(_0x591c5d,null));};exports['addAgents']=function(_0x2d7abf,_0x7cb97d){return db[_0x8db2('0x1f')][_0x8db2('0x32')]({'where':{'id':_0x2d7abf[_0x8db2('0x3c')]['id']}})[_0x8db2('0x17')](handleEntityNotFound(_0x7cb97d,null))[_0x8db2('0x17')](function(_0x19e25b){if(_0x19e25b){return _0x19e25b[_0x8db2('0x72')](_0x2d7abf['body'][_0x8db2('0x55')],_[_0x8db2('0x73')](_0x2d7abf[_0x8db2('0x3b')],[_0x8db2('0x55'),'id'])||{})[_0x8db2('0x74')](function(_0x345ff9){for(var _0x16d1c5=0x0;_0x16d1c5<_0x2d7abf[_0x8db2('0x3b')][_0x8db2('0x55')][_0x8db2('0x2e')];_0x16d1c5+=0x1){socket['emit'](_0x8db2('0x5f'),{'UserId':Number(_0x2d7abf[_0x8db2('0x3b')][_0x8db2('0x55')][_0x16d1c5]),'SmsQueueId':Number(_0x2d7abf[_0x8db2('0x3c')]['id'])});}return _0x345ff9;});}})['then'](respondWithResult(_0x7cb97d,null))[_0x8db2('0x3a')](handleError(_0x7cb97d,null));};exports[_0x8db2('0x70')]=function(_0x46476e,_0x4f653e){return db['SmsQueue'][_0x8db2('0x32')]({'where':{'id':_0x46476e[_0x8db2('0x3c')]['id']}})[_0x8db2('0x17')](handleEntityNotFound(_0x4f653e,null))[_0x8db2('0x17')](function(_0x4f9ce4){if(_0x4f9ce4){return _0x4f9ce4[_0x8db2('0x70')](_0x46476e[_0x8db2('0x28')][_0x8db2('0x55')])[_0x8db2('0x17')](function(){if(_['isArray'](_0x46476e[_0x8db2('0x28')][_0x8db2('0x55')])){for(var _0x3e7b24=0x0;_0x3e7b24<_0x46476e['query']['ids']['length'];_0x3e7b24+=0x1){socket[_0x8db2('0x5e')](_0x8db2('0x75'),{'UserId':Number(_0x46476e[_0x8db2('0x28')][_0x8db2('0x55')][_0x3e7b24]),'SmsQueueId':Number(_0x46476e['params']['id'])});}}else{socket['emit'](_0x8db2('0x75'),{'UserId':Number(_0x46476e[_0x8db2('0x28')][_0x8db2('0x55')]),'SmsQueueId':Number(_0x46476e[_0x8db2('0x3c')]['id'])});}});}})[_0x8db2('0x17')](respondWithStatusCode(_0x4f653e,null))[_0x8db2('0x3a')](handleError(_0x4f653e,null));};exports['getAgents']=function(_0x2942eb,_0x5f32ce){var _0x432780={};var _0x23457b={};var _0x1ef898;var _0x39f2d3;return db[_0x8db2('0x1f')]['findOne']({'where':{'id':_0x2942eb[_0x8db2('0x3c')]['id']}})[_0x8db2('0x17')](handleEntityNotFound(_0x5f32ce,null))['then'](function(_0x28beec){if(_0x28beec){_0x1ef898=_0x28beec;_0x23457b[_0x8db2('0x2b')]=_[_0x8db2('0x27')](db[_0x8db2('0x49')]['rawAttributes']);_0x23457b[_0x8db2('0x28')]=_['keys'](_0x2942eb['query']);_0x23457b[_0x8db2('0x29')]=_[_0x8db2('0x2a')](_0x23457b[_0x8db2('0x2b')],_0x23457b[_0x8db2('0x28')]);_0x432780[_0x8db2('0x2c')]=_[_0x8db2('0x2a')](_0x23457b[_0x8db2('0x2b')],qs['fields'](_0x2942eb[_0x8db2('0x28')]['fields']));_0x432780['attributes']=_0x432780[_0x8db2('0x2c')]['length']?_0x432780['attributes']:_0x23457b[_0x8db2('0x2b')];_0x432780[_0x8db2('0x44')]=qs[_0x8db2('0x45')](_0x2942eb['query'][_0x8db2('0x45')]);_0x432780[_0x8db2('0x23')]=qs[_0x8db2('0x29')](_['pick'](_0x2942eb[_0x8db2('0x28')],_0x23457b[_0x8db2('0x29')]));if(_0x2942eb[_0x8db2('0x28')][_0x8db2('0x47')]){_0x432780[_0x8db2('0x23')]=_[_0x8db2('0x30')](_0x432780[_0x8db2('0x23')],{'$or':_[_0x8db2('0x1e')](_0x432780['attributes'],function(_0xa7b208){var _0x3cb456={};_0x3cb456[_0xa7b208]={'$like':'%'+_0x2942eb[_0x8db2('0x28')][_0x8db2('0x47')]+'%'};return _0x3cb456;})});}_0x432780=_[_0x8db2('0x30')]({},_0x432780,_0x2942eb[_0x8db2('0x31')]);return _0x1ef898[_0x8db2('0x76')](_0x432780);}})[_0x8db2('0x17')](function(_0x3a53e2){if(_0x3a53e2){_0x39f2d3=_0x3a53e2[_0x8db2('0x2e')];if(!_0x2942eb[_0x8db2('0x28')]['hasOwnProperty'](_0x8db2('0x43'))){_0x432780[_0x8db2('0x14')]=qs[_0x8db2('0x14')](_0x2942eb['query'][_0x8db2('0x14')]);_0x432780[_0x8db2('0x11')]=qs[_0x8db2('0x11')](_0x2942eb['query']['offset']);}return _0x1ef898[_0x8db2('0x76')](_0x432780);}})[_0x8db2('0x17')](function(_0x296966){if(_0x296966){return _0x296966?{'count':_0x39f2d3,'rows':_0x296966}:null;}})[_0x8db2('0x17')](respondWithResult(_0x5f32ce,null))[_0x8db2('0x3a')](handleError(_0x5f32ce,null));}; \ No newline at end of file +var _0x5f2f=['redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','get','SmsQueues','UserProfileResource','error','stack','name','map','SmsQueue','rawAttributes','type','key','getOptions','where','include','findAll','rows','show','params','model','keys','query','filters','intersection','attributes','fields','includeAll','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserSmsQueue','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','User','Agents','online','voicePause','interface','flatMap','findOrCreate','forEach','emit','userSmsQueue:save','removeTeams','field','SmsQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','sequelize','transaction','isEmpty','removeAgents','addAgents','omit','spread','isArray','userSmsQueue:remove','getAgents','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api'];(function(_0x581af1,_0x4f02c5){var _0x54c22e=function(_0x5a7a5a){while(--_0x5a7a5a){_0x581af1['push'](_0x581af1['shift']());}};_0x54c22e(++_0x4f02c5);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1541a3,_0xec95b6){_0x1541a3=_0x1541a3-0x0;var _0x5be16c=_0x5f2f[_0x1541a3];return _0x5be16c;};'use strict';var BPromise=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var _=require(_0xf5f2('0x2'));var squel=require(_0xf5f2('0x3'));var Redis=require(_0xf5f2('0x4'));var qs=require(_0xf5f2('0x5'));var logger=require(_0xf5f2('0x6'))(_0xf5f2('0x7'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xf5f2('0x8')]=_[_0xf5f2('0x9')](config[_0xf5f2('0x8')],{'host':_0xf5f2('0xa'),'port':0x18eb});var socket=require(_0xf5f2('0xb'))(new Redis(config[_0xf5f2('0x8')]));require('./smsQueue.socket')[_0xf5f2('0xc')](socket);function respondWithStatusCode(_0x46cd9c,_0x2ec345){_0x2ec345=_0x2ec345||0xcc;return function(_0x56a69f){if(_0x56a69f){return _0x46cd9c[_0xf5f2('0xd')](_0x2ec345);}return _0x46cd9c[_0xf5f2('0xe')](_0x2ec345)[_0xf5f2('0xf')]();};}function respondWithResult(_0x4e0e6b,_0x977a59){_0x977a59=_0x977a59||0xc8;return function(_0x4ebbbe){if(_0x4ebbbe){return _0x4e0e6b['status'](_0x977a59)[_0xf5f2('0x10')](_0x4ebbbe);}};}function respondWithFilteredResult(_0x151aba,_0x4b78cd){return function(_0x336f6b){if(_0x336f6b){var _0x14b51f=typeof _0x4b78cd[_0xf5f2('0x11')]===_0xf5f2('0x12')&&typeof _0x4b78cd[_0xf5f2('0x13')]===_0xf5f2('0x12');var _0x5c01b8=_0x336f6b[_0xf5f2('0x14')];var _0xea612c=_0x14b51f?0x0:_0x4b78cd[_0xf5f2('0x11')];var _0x1c1a5c=_0x14b51f?_0x336f6b[_0xf5f2('0x14')]:_0x4b78cd['offset']+_0x4b78cd[_0xf5f2('0x13')];var _0x286197;if(_0x1c1a5c>=_0x5c01b8){_0x1c1a5c=_0x5c01b8;_0x286197=0xc8;}else{_0x286197=0xce;}_0x151aba[_0xf5f2('0xe')](_0x286197);return _0x151aba[_0xf5f2('0x15')](_0xf5f2('0x16'),_0xea612c+'-'+_0x1c1a5c+'/'+_0x5c01b8)[_0xf5f2('0x10')](_0x336f6b);}return null;};}function saveUpdates(_0xdb61b3){return function(_0x395a5a){if(_0x395a5a){return _0x395a5a[_0xf5f2('0x17')](_0xdb61b3)[_0xf5f2('0x18')](function(_0x20fccd){return _0x20fccd;});}return null;};}function removeEntity(_0x28e097){return function(_0x4ff59b){if(_0x4ff59b){return _0x4ff59b[_0xf5f2('0x19')]()[_0xf5f2('0x18')](function(){var _0x626999=_0x4ff59b[_0xf5f2('0x1a')]({'plain':!![]});var _0x56acc5=_0xf5f2('0x1b');return db[_0xf5f2('0x1c')]['destroy']({'where':{'type':_0x56acc5,'resourceId':_0x626999['id']}})['then'](function(){return _0x4ff59b;});})[_0xf5f2('0x18')](function(){_0x28e097[_0xf5f2('0xe')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45b74f){return function(_0x170042){if(!_0x170042){_0x45b74f[_0xf5f2('0xd')](0x194);}return _0x170042;};}function handleError(_0x39c024,_0x36f1cb){_0x36f1cb=_0x36f1cb||0x1f4;return function(_0x4c691a){logger[_0xf5f2('0x1d')](_0x4c691a[_0xf5f2('0x1e')]);if(_0x4c691a[_0xf5f2('0x1f')]){delete _0x4c691a[_0xf5f2('0x1f')];}_0x39c024[_0xf5f2('0xe')](_0x36f1cb)['send'](_0x4c691a);};}exports['index']=function(_0x5f1124,_0x3f79d5){var _0x13da6f={};var _0x1a5bb3={'count':0x0,'rows':[]};var _0xf6c58d=_[_0xf5f2('0x20')](db[_0xf5f2('0x21')][_0xf5f2('0x22')],function(_0x294414){return{'name':_0x294414['fieldName'],'type':_0x294414[_0xf5f2('0x23')][_0xf5f2('0x24')]};});_0x13da6f=qs[_0xf5f2('0x25')](_0xf6c58d,_0x5f1124);var _0x31bfcb={'where':_0x13da6f[_0xf5f2('0x26')]};return db[_0xf5f2('0x21')]['count'](_0x31bfcb)['then'](function(_0x22c826){_0x1a5bb3[_0xf5f2('0x14')]=_0x22c826;_0x13da6f[_0xf5f2('0x27')]=qs['include'](_0x5f1124['query']);return db[_0xf5f2('0x21')][_0xf5f2('0x28')](_0x13da6f);})[_0xf5f2('0x18')](function(_0x153924){_0x1a5bb3[_0xf5f2('0x29')]=_0x153924;return _0x1a5bb3;})['then'](respondWithFilteredResult(_0x3f79d5,_0x13da6f))['catch'](handleError(_0x3f79d5,null));};exports[_0xf5f2('0x2a')]=function(_0x4e19cb,_0xb744b9){var _0x58a4df={'raw':!![],'where':{'id':_0x4e19cb[_0xf5f2('0x2b')]['id']}},_0x45b643={};_0x45b643[_0xf5f2('0x2c')]=_[_0xf5f2('0x2d')](db[_0xf5f2('0x21')][_0xf5f2('0x22')]);_0x45b643[_0xf5f2('0x2e')]=_[_0xf5f2('0x2d')](_0x4e19cb['query']);_0x45b643[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x45b643[_0xf5f2('0x2c')],_0x45b643[_0xf5f2('0x2e')]);_0x58a4df[_0xf5f2('0x31')]=_[_0xf5f2('0x30')](_0x45b643[_0xf5f2('0x2c')],qs['fields'](_0x4e19cb[_0xf5f2('0x2e')][_0xf5f2('0x32')]));_0x58a4df['attributes']=_0x58a4df[_0xf5f2('0x31')]['length']?_0x58a4df[_0xf5f2('0x31')]:_0x45b643[_0xf5f2('0x2c')];if(_0x4e19cb[_0xf5f2('0x2e')][_0xf5f2('0x33')]){_0x58a4df['include']=[{'all':!![]}];}_0x58a4df=_['merge']({},_0x58a4df,_0x4e19cb[_0xf5f2('0x34')]);return db[_0xf5f2('0x21')][_0xf5f2('0x35')](_0x58a4df)['then'](handleEntityNotFound(_0xb744b9,null))[_0xf5f2('0x18')](respondWithResult(_0xb744b9,null))['catch'](handleError(_0xb744b9,null));};exports[_0xf5f2('0x36')]=function(_0x566c47,_0x46f464){return db[_0xf5f2('0x21')]['create'](_0x566c47[_0xf5f2('0x37')],{})[_0xf5f2('0x18')](function(_0x5a4441){var _0x35f738=_0x566c47['user']['get']({'plain':!![]});if(!_0x35f738)throw new Error(_0xf5f2('0x38'));if(_0x35f738[_0xf5f2('0x39')]===_0xf5f2('0x3a')){var _0x2d4400=_0x5a4441[_0xf5f2('0x1a')]({'plain':!![]});var _0xe62b57=_0xf5f2('0x1b');return db['UserProfileSection'][_0xf5f2('0x35')]({'where':{'name':_0xe62b57,'userProfileId':_0x35f738[_0xf5f2('0x3b')]},'raw':!![]})['then'](function(_0xc6a1ae){if(_0xc6a1ae&&_0xc6a1ae[_0xf5f2('0x3c')]===0x0){return db[_0xf5f2('0x1c')][_0xf5f2('0x36')]({'name':_0x2d4400[_0xf5f2('0x1f')],'resourceId':_0x2d4400['id'],'type':_0xc6a1ae[_0xf5f2('0x1f')],'sectionId':_0xc6a1ae['id']},{})[_0xf5f2('0x18')](function(){return _0x5a4441;});}else{return _0x5a4441;}})[_0xf5f2('0x3d')](function(_0x574f24){logger[_0xf5f2('0x1d')](_0xf5f2('0x3e'),_0x574f24);throw _0x574f24;});}return _0x5a4441;})[_0xf5f2('0x18')](respondWithResult(_0x46f464,0xc9))['catch'](handleError(_0x46f464,null));};exports['update']=function(_0x59eb00,_0x76d21b){if(_0x59eb00[_0xf5f2('0x37')]['id']){delete _0x59eb00['body']['id'];}return db[_0xf5f2('0x21')][_0xf5f2('0x35')]({'where':{'id':_0x59eb00[_0xf5f2('0x2b')]['id']}})[_0xf5f2('0x18')](handleEntityNotFound(_0x76d21b,null))[_0xf5f2('0x18')](saveUpdates(_0x59eb00[_0xf5f2('0x37')],null))[_0xf5f2('0x18')](respondWithResult(_0x76d21b,null))[_0xf5f2('0x3d')](handleError(_0x76d21b,null));};exports[_0xf5f2('0x19')]=function(_0x106062,_0x444317){return db[_0xf5f2('0x21')][_0xf5f2('0x35')]({'where':{'id':_0x106062[_0xf5f2('0x2b')]['id']}})['then'](handleEntityNotFound(_0x444317,null))[_0xf5f2('0x18')](removeEntity(_0x444317,null))['catch'](handleError(_0x444317,null));};exports[_0xf5f2('0x3f')]=function(_0xc04f44,_0x218def){return db[_0xf5f2('0x21')][_0xf5f2('0x3f')]()[_0xf5f2('0x18')](respondWithResult(_0x218def,null))['catch'](handleError(_0x218def,null));};exports[_0xf5f2('0x40')]=function(_0x2e7193,_0x1c1497){var _0x29b108={'raw':!![],'where':{}},_0x12124d={},_0x10753a;return db[_0xf5f2('0x21')][_0xf5f2('0x41')]({'where':{'id':_0x2e7193['params']['id']}})[_0xf5f2('0x18')](handleEntityNotFound(_0x1c1497,null))[_0xf5f2('0x18')](function(_0x45db9a){if(_0x45db9a){_0x10753a=_0x45db9a['get']({'plain':!![]});_0x12124d[_0xf5f2('0x2c')]=_[_0xf5f2('0x2d')](db[_0xf5f2('0x42')]['rawAttributes']);_0x12124d['query']=_[_0xf5f2('0x2d')](_0x2e7193[_0xf5f2('0x2e')]);_0x12124d['filters']=_[_0xf5f2('0x30')](_0x12124d['model'],_0x12124d[_0xf5f2('0x2e')]);_0x29b108['attributes']=_[_0xf5f2('0x30')](_0x12124d['model'],qs[_0xf5f2('0x32')](_0x2e7193[_0xf5f2('0x2e')][_0xf5f2('0x32')]));_0x29b108[_0xf5f2('0x31')]=_0x29b108['attributes'][_0xf5f2('0x43')]?_0x29b108[_0xf5f2('0x31')]:_0x12124d['model'];if(!_0x2e7193['query'][_0xf5f2('0x44')](_0xf5f2('0x45'))){_0x29b108['limit']=qs[_0xf5f2('0x13')](_0x2e7193[_0xf5f2('0x2e')][_0xf5f2('0x13')]);_0x29b108[_0xf5f2('0x11')]=qs['offset'](_0x2e7193['query'][_0xf5f2('0x11')]);}_0x29b108[_0xf5f2('0x46')]=qs['sort'](_0x2e7193[_0xf5f2('0x2e')][_0xf5f2('0x47')]);_0x29b108[_0xf5f2('0x26')]=qs[_0xf5f2('0x2f')](_[_0xf5f2('0x48')](_0x2e7193[_0xf5f2('0x2e')],_0x12124d[_0xf5f2('0x2f')]));_0x29b108['where']['SmsQueueId']=_0x45db9a['id'];if(_0x2e7193[_0xf5f2('0x2e')][_0xf5f2('0x49')]){_0x29b108[_0xf5f2('0x26')]=_[_0xf5f2('0x4a')](_0x29b108[_0xf5f2('0x26')],{'$or':_['map'](_0x29b108[_0xf5f2('0x31')],function(_0x20ba91){var _0x18b124={};_0x18b124[_0x20ba91]={'$like':'%'+_0x2e7193['query'][_0xf5f2('0x49')]+'%'};return _0x18b124;})});}_0x29b108=_['merge']({},_0x29b108,_0x2e7193[_0xf5f2('0x34')]);return db[_0xf5f2('0x42')][_0xf5f2('0x28')](_0x29b108);}})[_0xf5f2('0x18')](function(_0x4afa4d){if(_0x4afa4d){return db['User'][_0xf5f2('0x4b')]({'where':{'id':_['map'](_0x4afa4d,_0xf5f2('0x4c')),'role':_0xf5f2('0x4d')},'attributes':['id','name',_0xf5f2('0x4e'),_0xf5f2('0x4f'),_0xf5f2('0x50')]});}})['then'](function(_0x397b99){if(_0x397b99){return{'count':_0x397b99[_0xf5f2('0x14')],'rows':_[_0xf5f2('0x20')](_0x397b99[_0xf5f2('0x29')],function(_0x51fa7e){return{'membername':_0x51fa7e[_0xf5f2('0x1f')],'UserId':_0x51fa7e['id'],'queue_name':_0x10753a['name'],'SmsQueueId':_0x10753a['id'],'interface':util[_0xf5f2('0x51')](_0xf5f2('0x52'),_0xf5f2('0x53'),_0x51fa7e[_0xf5f2('0x1f')]),'penalty':0x0,'paused':_0x51fa7e[_0xf5f2('0x4e')],'createdAt':_0x51fa7e['createdAt'],'updatedAt':_0x51fa7e[_0xf5f2('0x4f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xf5f2('0x18')](respondWithFilteredResult(_0x1c1497,_0x29b108))[_0xf5f2('0x3d')](handleError(_0x1c1497,null));};exports[_0xf5f2('0x54')]=function(_0x2c5733,_0x5359b5){var _0x31e16b={};var _0x5ee6bc={};var _0x4c96ee;var _0xd4f6ef;return db['SmsQueue'][_0xf5f2('0x41')]({'where':{'id':_0x2c5733[_0xf5f2('0x2b')]['id']}})[_0xf5f2('0x18')](handleEntityNotFound(_0x5359b5,null))[_0xf5f2('0x18')](function(_0x5767fc){if(_0x5767fc){_0x4c96ee=_0x5767fc;_0x5ee6bc[_0xf5f2('0x2c')]=_[_0xf5f2('0x2d')](db[_0xf5f2('0x55')][_0xf5f2('0x22')]);_0x5ee6bc[_0xf5f2('0x2e')]=_[_0xf5f2('0x2d')](_0x2c5733[_0xf5f2('0x2e')]);_0x5ee6bc['filters']=_[_0xf5f2('0x30')](_0x5ee6bc[_0xf5f2('0x2c')],_0x5ee6bc[_0xf5f2('0x2e')]);_0x31e16b[_0xf5f2('0x31')]=_['intersection'](_0x5ee6bc[_0xf5f2('0x2c')],qs['fields'](_0x2c5733[_0xf5f2('0x2e')][_0xf5f2('0x32')]));_0x31e16b['attributes']=_0x31e16b[_0xf5f2('0x31')][_0xf5f2('0x43')]?_0x31e16b[_0xf5f2('0x31')]:_0x5ee6bc[_0xf5f2('0x2c')];_0x31e16b[_0xf5f2('0x46')]=qs['sort'](_0x2c5733[_0xf5f2('0x2e')][_0xf5f2('0x47')]);_0x31e16b[_0xf5f2('0x26')]=qs[_0xf5f2('0x2f')](_[_0xf5f2('0x48')](_0x2c5733[_0xf5f2('0x2e')],_0x5ee6bc['filters']));if(_0x2c5733[_0xf5f2('0x2e')][_0xf5f2('0x49')]){_0x31e16b['where']=_[_0xf5f2('0x4a')](_0x31e16b[_0xf5f2('0x26')],{'$or':_[_0xf5f2('0x20')](_0x31e16b['attributes'],function(_0x551cc9){var _0x4f3df6={};_0x4f3df6[_0x551cc9]={'$like':'%'+_0x2c5733[_0xf5f2('0x2e')][_0xf5f2('0x49')]+'%'};return _0x4f3df6;})});}_0x31e16b=_[_0xf5f2('0x4a')]({},_0x31e16b,_0x2c5733[_0xf5f2('0x34')]);return _0x4c96ee[_0xf5f2('0x54')](_0x31e16b);}})['then'](function(_0x278b76){if(_0x278b76){_0xd4f6ef=_0x278b76[_0xf5f2('0x43')];if(!_0x2c5733[_0xf5f2('0x2e')][_0xf5f2('0x44')](_0xf5f2('0x45'))){_0x31e16b[_0xf5f2('0x13')]=qs[_0xf5f2('0x13')](_0x2c5733[_0xf5f2('0x2e')][_0xf5f2('0x13')]);_0x31e16b[_0xf5f2('0x11')]=qs[_0xf5f2('0x11')](_0x2c5733['query']['offset']);}return _0x4c96ee['getTeams'](_0x31e16b);}})[_0xf5f2('0x18')](function(_0xafba8e){if(_0xafba8e){return _0xafba8e?{'count':_0xd4f6ef,'rows':_0xafba8e}:null;}})[_0xf5f2('0x18')](respondWithResult(_0x5359b5,null))[_0xf5f2('0x3d')](handleError(_0x5359b5,null));};exports[_0xf5f2('0x56')]=function(_0x5c6959,_0x9d943f){var _0x43c732=_0x5c6959[_0xf5f2('0x37')][_0xf5f2('0x57')];return db[_0xf5f2('0x55')]['findAll']({'where':{'id':_0x43c732},'attributes':['id'],'include':[{'model':db[_0xf5f2('0x58')],'as':_0xf5f2('0x59'),'attributes':['id','name',_0xf5f2('0x5a'),_0xf5f2('0x5b'),_0xf5f2('0x5c')],'raw':!![]}]})[_0xf5f2('0x18')](function(_0x588434){if(_0x588434){var _0x40b36e=_[_0xf5f2('0x5d')](_0x588434,function(_0x19602d){var _0x2adeb4=_0x19602d[_0xf5f2('0x1a')]({'plain':!![]});return _0x2adeb4['Agents'];});return db['SmsQueue'][_0xf5f2('0x35')]({'where':{'id':_0x5c6959[_0xf5f2('0x2b')]['id']}})[_0xf5f2('0x18')](function(_0xe3ea1e){return db['sequelize']['transaction'](function(_0x16048e){return _0xe3ea1e['addTeams'](_0x43c732,{'transaction':_0x16048e})['then'](function(){return BPromise['each'](_0x40b36e,function(_0x57cb18){return db[_0xf5f2('0x42')][_0xf5f2('0x5e')]({'where':{'UserId':_0x57cb18['id'],'SmsQueueId':_0x5c6959[_0xf5f2('0x2b')]['id']},'transaction':_0x16048e});});})[_0xf5f2('0x18')](function(){_0x40b36e[_0xf5f2('0x5f')](function(_0x9f941e){socket[_0xf5f2('0x60')](_0xf5f2('0x61'),{'UserId':_0x9f941e['id'],'SmsQueueId':_0xe3ea1e['id']});});});});});}})[_0xf5f2('0x18')](respondWithStatusCode(_0x9d943f,null))[_0xf5f2('0x3d')](handleError(_0x9d943f,null));};exports[_0xf5f2('0x62')]=function(_0x2afeac,_0x1ba503){return db[_0xf5f2('0x55')][_0xf5f2('0x28')]({'where':{'id':_0x2afeac[_0xf5f2('0x2e')][_0xf5f2('0x57')]},'attributes':['id'],'include':[{'model':db[_0xf5f2('0x58')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xf5f2('0x18')](handleEntityNotFound(_0x1ba503,null))[_0xf5f2('0x18')](function(_0x21043b){var _0x2811ad=_[_0xf5f2('0x20')](_0x21043b,'id');var _0x308220=[];var _0x16491c=[];var _0xcf48eb=squel['select']();_0xcf48eb[_0xf5f2('0x63')]('tq.TeamId')['from']('team_has_sms_queues','tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0xf5f2('0x26')](_0xf5f2('0x64'),_0x2afeac[_0xf5f2('0x2b')]['id']);for(var _0x375bc9=0x0;_0x375bc9<_0x21043b[_0xf5f2('0x43')];_0x375bc9+=0x1){let _0x3cf857=_0x21043b[_0x375bc9];for(var _0x5dc63f=0x0;_0x5dc63f<_0x3cf857['Agents'][_0xf5f2('0x43')];_0x5dc63f+=0x1){let _0x578a22=_0x3cf857[_0xf5f2('0x59')][_0x5dc63f];var _0x186fdd=_0xcf48eb['clone']();_0x186fdd['where'](_0xf5f2('0x65'),_0x578a22['id']);_0x16491c[_0xf5f2('0x66')](db['sequelize'][_0xf5f2('0x2e')](_0x186fdd[_0xf5f2('0x67')](),{'type':db['sequelize'][_0xf5f2('0x68')][_0xf5f2('0x69')]})[_0xf5f2('0x18')](function(_0x4c1678){if(_0x4c1678[_0xf5f2('0x43')]===0x1){return _0x578a22['id'];}else{var _0xc28adc=_[_0xf5f2('0x6a')](_[_0xf5f2('0x20')](_0x4c1678,_0xf5f2('0x6b')),function(_0x3e0288){return _[_0xf5f2('0x6c')](_0x2811ad,_0x3e0288);});if(_0xc28adc){return _0x578a22['id'];}}}));}}return BPromise[_0xf5f2('0x6d')](_0x16491c)[_0xf5f2('0x18')](function(_0x3a6f60){_0x308220=_(_0x308220)[_0xf5f2('0x6e')](_0x3a6f60)[_0xf5f2('0x6f')]()[_0xf5f2('0x70')]();return db[_0xf5f2('0x21')][_0xf5f2('0x35')]({'where':{'id':_0x2afeac[_0xf5f2('0x2b')]['id']}})[_0xf5f2('0x18')](function(_0x29a9d4){return db[_0xf5f2('0x71')][_0xf5f2('0x72')](function(_0x800f42){return _0x29a9d4['removeTeams'](_0x2afeac[_0xf5f2('0x2e')][_0xf5f2('0x57')],{'transaction':_0x800f42})['then'](function(){if(!_[_0xf5f2('0x73')](_0x308220)){return _0x29a9d4[_0xf5f2('0x74')](_0x308220,{'transaction':_0x800f42});}})['then'](function(){_0x308220[_0xf5f2('0x5f')](function(_0x2f54eb){socket[_0xf5f2('0x60')]('userSmsQueue:remove',{'UserId':_0x2f54eb,'SmsQueueId':_0x29a9d4['id']});});});});});});})['then'](respondWithStatusCode(_0x1ba503,null))[_0xf5f2('0x3d')](handleError(_0x1ba503,null));};exports[_0xf5f2('0x75')]=function(_0x213ade,_0x5ba275){return db['SmsQueue'][_0xf5f2('0x35')]({'where':{'id':_0x213ade[_0xf5f2('0x2b')]['id']}})[_0xf5f2('0x18')](handleEntityNotFound(_0x5ba275,null))['then'](function(_0x4cde64){if(_0x4cde64){return _0x4cde64['addAgents'](_0x213ade['body']['ids'],_[_0xf5f2('0x76')](_0x213ade['body'],[_0xf5f2('0x57'),'id'])||{})[_0xf5f2('0x77')](function(_0xec3c35){for(var _0x43a167=0x0;_0x43a167<_0x213ade[_0xf5f2('0x37')][_0xf5f2('0x57')][_0xf5f2('0x43')];_0x43a167+=0x1){socket[_0xf5f2('0x60')](_0xf5f2('0x61'),{'UserId':Number(_0x213ade[_0xf5f2('0x37')][_0xf5f2('0x57')][_0x43a167]),'SmsQueueId':Number(_0x213ade[_0xf5f2('0x2b')]['id'])});}return _0xec3c35;});}})[_0xf5f2('0x18')](respondWithResult(_0x5ba275,null))['catch'](handleError(_0x5ba275,null));};exports[_0xf5f2('0x74')]=function(_0x2a4fed,_0x5783e2){return db[_0xf5f2('0x21')][_0xf5f2('0x35')]({'where':{'id':_0x2a4fed['params']['id']}})[_0xf5f2('0x18')](handleEntityNotFound(_0x5783e2,null))[_0xf5f2('0x18')](function(_0x281f61){if(_0x281f61){return _0x281f61['removeAgents'](_0x2a4fed[_0xf5f2('0x2e')][_0xf5f2('0x57')])['then'](function(){if(_[_0xf5f2('0x78')](_0x2a4fed[_0xf5f2('0x2e')][_0xf5f2('0x57')])){for(var _0x517aa8=0x0;_0x517aa8<_0x2a4fed[_0xf5f2('0x2e')]['ids'][_0xf5f2('0x43')];_0x517aa8+=0x1){socket['emit'](_0xf5f2('0x79'),{'UserId':Number(_0x2a4fed[_0xf5f2('0x2e')][_0xf5f2('0x57')][_0x517aa8]),'SmsQueueId':Number(_0x2a4fed[_0xf5f2('0x2b')]['id'])});}}else{socket['emit'](_0xf5f2('0x79'),{'UserId':Number(_0x2a4fed['query']['ids']),'SmsQueueId':Number(_0x2a4fed['params']['id'])});}});}})[_0xf5f2('0x18')](respondWithStatusCode(_0x5783e2,null))[_0xf5f2('0x3d')](handleError(_0x5783e2,null));};exports['getAgents']=function(_0x3c8a1b,_0x15025d){var _0x35790b={};var _0x3962b2={};var _0x28873e;var _0x1fc5ae;return db['SmsQueue'][_0xf5f2('0x41')]({'where':{'id':_0x3c8a1b[_0xf5f2('0x2b')]['id']}})['then'](handleEntityNotFound(_0x15025d,null))[_0xf5f2('0x18')](function(_0x19cbff){if(_0x19cbff){_0x28873e=_0x19cbff;_0x3962b2['model']=_[_0xf5f2('0x2d')](db[_0xf5f2('0x58')][_0xf5f2('0x22')]);_0x3962b2[_0xf5f2('0x2e')]=_[_0xf5f2('0x2d')](_0x3c8a1b[_0xf5f2('0x2e')]);_0x3962b2['filters']=_[_0xf5f2('0x30')](_0x3962b2[_0xf5f2('0x2c')],_0x3962b2[_0xf5f2('0x2e')]);_0x35790b[_0xf5f2('0x31')]=_[_0xf5f2('0x30')](_0x3962b2[_0xf5f2('0x2c')],qs[_0xf5f2('0x32')](_0x3c8a1b[_0xf5f2('0x2e')][_0xf5f2('0x32')]));_0x35790b['attributes']=_0x35790b[_0xf5f2('0x31')][_0xf5f2('0x43')]?_0x35790b[_0xf5f2('0x31')]:_0x3962b2[_0xf5f2('0x2c')];_0x35790b[_0xf5f2('0x46')]=qs[_0xf5f2('0x47')](_0x3c8a1b[_0xf5f2('0x2e')][_0xf5f2('0x47')]);_0x35790b[_0xf5f2('0x26')]=qs[_0xf5f2('0x2f')](_['pick'](_0x3c8a1b['query'],_0x3962b2[_0xf5f2('0x2f')]));if(_0x3c8a1b[_0xf5f2('0x2e')][_0xf5f2('0x49')]){_0x35790b[_0xf5f2('0x26')]=_['merge'](_0x35790b[_0xf5f2('0x26')],{'$or':_[_0xf5f2('0x20')](_0x35790b[_0xf5f2('0x31')],function(_0x3d7f53){var _0x456a1e={};_0x456a1e[_0x3d7f53]={'$like':'%'+_0x3c8a1b['query'][_0xf5f2('0x49')]+'%'};return _0x456a1e;})});}_0x35790b=_[_0xf5f2('0x4a')]({},_0x35790b,_0x3c8a1b['options']);return _0x28873e[_0xf5f2('0x7a')](_0x35790b);}})[_0xf5f2('0x18')](function(_0x2563fa){if(_0x2563fa){_0x1fc5ae=_0x2563fa[_0xf5f2('0x43')];if(!_0x3c8a1b['query'][_0xf5f2('0x44')](_0xf5f2('0x45'))){_0x35790b[_0xf5f2('0x13')]=qs['limit'](_0x3c8a1b['query'][_0xf5f2('0x13')]);_0x35790b[_0xf5f2('0x11')]=qs[_0xf5f2('0x11')](_0x3c8a1b[_0xf5f2('0x2e')][_0xf5f2('0x11')]);}return _0x28873e[_0xf5f2('0x7a')](_0x35790b);}})['then'](function(_0x39dee8){if(_0x39dee8){return _0x39dee8?{'count':_0x1fc5ae,'rows':_0x39dee8}:null;}})['then'](respondWithResult(_0x15025d,null))[_0xf5f2('0x3d')](handleError(_0x15025d,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index b8dc8c3..0b57c20 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 _0x1db7=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','SmsQueue','setMaxListeners','save','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1db7,0x13a));var _0x71db=function(_0x366b96,_0x5203e4){_0x366b96=_0x366b96-0x0;var _0x289c3b=_0x1db7[_0x366b96];return _0x289c3b;};'use strict';var EventEmitter=require(_0x71db('0x0'));var SmsQueue=require(_0x71db('0x1'))['db'][_0x71db('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x71db('0x3')](0x0);var events={'afterCreate':_0x71db('0x4'),'afterUpdate':_0x71db('0x5'),'afterDestroy':_0x71db('0x6')};function emitEvent(_0x5463c0){return function(_0x47c54a,_0x20af2b,_0x447a42){SmsQueueEvents[_0x71db('0x7')](_0x5463c0+':'+_0x47c54a['id'],_0x47c54a);SmsQueueEvents[_0x71db('0x7')](_0x5463c0,_0x47c54a);_0x447a42(null);};}for(var e in events){if(events[_0x71db('0x8')](e)){var event=events[e];SmsQueue[_0x71db('0x9')](e,emitEvent(event));}}module['exports']=SmsQueueEvents; \ No newline at end of file +var _0xf8a8=['exports','events','../../mysqldb','SmsQueue','save','update','remove','emit','hook'];(function(_0x396883,_0x5851ff){var _0x3b64d4=function(_0x3f271f){while(--_0x3f271f){_0x396883['push'](_0x396883['shift']());}};_0x3b64d4(++_0x5851ff);}(_0xf8a8,0x184));var _0x8f8a=function(_0x266618,_0x18f637){_0x266618=_0x266618-0x0;var _0x54dbf5=_0xf8a8[_0x266618];return _0x54dbf5;};'use strict';var EventEmitter=require(_0x8f8a('0x0'));var SmsQueue=require(_0x8f8a('0x1'))['db'][_0x8f8a('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8f8a('0x3'),'afterUpdate':_0x8f8a('0x4'),'afterDestroy':_0x8f8a('0x5')};function emitEvent(_0x18dd05){return function(_0x390615,_0x447de2,_0x4a30ef){SmsQueueEvents[_0x8f8a('0x6')](_0x18dd05+':'+_0x390615['id'],_0x390615);SmsQueueEvents[_0x8f8a('0x6')](_0x18dd05,_0x390615);_0x4a30ef(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0x8f8a('0x7')](e,emitEvent(event));}}module[_0x8f8a('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 95e4bbb..a41c80c 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 _0x836f=['../../config/logger','api','moment','request-promise','../../config/environment','./smsQueue.attributes','SmsQueue','sms_queues','lodash','util'];(function(_0x4f69b2,_0x3e0422){var _0x339d3c=function(_0x7a741d){while(--_0x7a741d){_0x4f69b2['push'](_0x4f69b2['shift']());}};_0x339d3c(++_0x3e0422);}(_0x836f,0x1ac));var _0xf836=function(_0x5635a8,_0x415003){_0x5635a8=_0x5635a8-0x0;var _0x545545=_0x836f[_0x5635a8];return _0x545545;};'use strict';var _=require(_0xf836('0x0'));var util=require(_0xf836('0x1'));var logger=require(_0xf836('0x2'))(_0xf836('0x3'));var moment=require(_0xf836('0x4'));var BPromise=require('bluebird');var rp=require(_0xf836('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf836('0x6'));var attributes=require(_0xf836('0x7'));module['exports']=function(_0x591833,_0xf570fd){return _0x591833['define'](_0xf836('0x8'),attributes,{'tableName':_0xf836('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd75e=['./smsQueue.attributes','exports','define','SmsQueue','sms_queues','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment'];(function(_0x342abf,_0x51499b){var _0x4a11d5=function(_0x35b18b){while(--_0x35b18b){_0x342abf['push'](_0x342abf['shift']());}};_0x4a11d5(++_0x51499b);}(_0xd75e,0x94));var _0xed75=function(_0xe4df2,_0x152dd3){_0xe4df2=_0xe4df2-0x0;var _0x4759da=_0xd75e[_0xe4df2];return _0x4759da;};'use strict';var _=require(_0xed75('0x0'));var util=require(_0xed75('0x1'));var logger=require(_0xed75('0x2'))(_0xed75('0x3'));var moment=require(_0xed75('0x4'));var BPromise=require(_0xed75('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xed75('0x6'));var config=require(_0xed75('0x7'));var attributes=require(_0xed75('0x8'));module[_0xed75('0x9')]=function(_0x2e0664,_0x180453){return _0x2e0664[_0xed75('0xa')](_0xed75('0xb'),attributes,{'tableName':_0xed75('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 f3064f5..f1b504d 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 _0x954b=['then','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','SmsQueue,\x20%s,\x20%s','message','info','result','catch','GetSmsQueue','SmsQueue','findAll','options','raw','attributes','limit','include','map','model','ShowSmsQueue','find','where','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','redis','defaults','socket.io-emitter','./smsQueue.socket','register'];(function(_0x1795df,_0xcb261e){var _0x3f13c0=function(_0x52c5cf){while(--_0x52c5cf){_0x1795df['push'](_0x1795df['shift']());}};_0x3f13c0(++_0xcb261e);}(_0x954b,0x122));var _0xb954=function(_0x4257b6,_0x2348c7){_0x4257b6=_0x4257b6-0x0;var _0x4ad68c=_0x954b[_0x4257b6];return _0x4ad68c;};'use strict';var _=require(_0xb954('0x0'));var util=require('util');var moment=require(_0xb954('0x1'));var BPromise=require(_0xb954('0x2'));var rs=require(_0xb954('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb954('0x4'))['db'];var utils=require(_0xb954('0x5'));var logger=require(_0xb954('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb954('0x7'));var client=jayson['client'][_0xb954('0x8')]({'port':0x232a});config[_0xb954('0x9')]=_[_0xb954('0xa')](config[_0xb954('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xb954('0xb'))(new Redis(config[_0xb954('0x9')]));require(_0xb954('0xc'))[_0xb954('0xd')](socket);function respondWithRpcPromise(_0x16b0c3,_0x270212,_0x2edaab){return new BPromise(function(_0x2e9f65,_0x4e6d19){return client['request'](_0x16b0c3,_0x2edaab)[_0xb954('0xe')](function(_0x20d55e){logger['info']('SmsQueue,\x20%s,\x20%s',_0x270212,_0xb954('0xf'));logger[_0xb954('0x10')](_0xb954('0x11'),_0x270212,'request\x20sent',JSON[_0xb954('0x12')](_0x20d55e));if(_0x20d55e[_0xb954('0x13')]){if(_0x20d55e['error']['code']===0x1f4){logger[_0xb954('0x13')](_0xb954('0x14'),_0x270212,_0x20d55e['error'][_0xb954('0x15')]);return _0x4e6d19(_0x20d55e['error']['message']);}logger[_0xb954('0x13')]('SmsQueue,\x20%s,\x20%s',_0x270212,_0x20d55e[_0xb954('0x13')][_0xb954('0x15')]);return _0x2e9f65(_0x20d55e[_0xb954('0x13')][_0xb954('0x15')]);}else{logger[_0xb954('0x16')]('SmsQueue,\x20%s,\x20%s',_0x270212,'request\x20sent');_0x2e9f65(_0x20d55e[_0xb954('0x17')]['message']);}})[_0xb954('0x18')](function(_0x139c3f){logger[_0xb954('0x13')](_0xb954('0x14'),_0x270212,_0x139c3f);_0x4e6d19(_0x139c3f);});});}exports[_0xb954('0x19')]=function(_0x5c9a6d){var _0x25b55a=this;return new Promise(function(_0x30e2dd,_0x5ee224){return db[_0xb954('0x1a')][_0xb954('0x1b')]({'raw':_0x5c9a6d[_0xb954('0x1c')]?_0x5c9a6d[_0xb954('0x1c')][_0xb954('0x1d')]===undefined?!![]:![]:!![],'where':_0x5c9a6d[_0xb954('0x1c')]?_0x5c9a6d['options']['where']||null:null,'attributes':_0x5c9a6d[_0xb954('0x1c')]?_0x5c9a6d[_0xb954('0x1c')][_0xb954('0x1e')]||null:null,'limit':_0x5c9a6d[_0xb954('0x1c')]?_0x5c9a6d['options'][_0xb954('0x1f')]||null:null,'include':_0x5c9a6d[_0xb954('0x1c')]?_0x5c9a6d[_0xb954('0x1c')][_0xb954('0x20')]?_[_0xb954('0x21')](_0x5c9a6d[_0xb954('0x1c')][_0xb954('0x20')],function(_0x27934d){return{'model':db[_0x27934d['model']],'as':_0x27934d['as'],'attributes':_0x27934d[_0xb954('0x1e')],'include':_0x27934d[_0xb954('0x20')]?_[_0xb954('0x21')](_0x27934d[_0xb954('0x20')],function(_0x126d04){return{'model':db[_0x126d04[_0xb954('0x22')]],'as':_0x126d04['as'],'attributes':_0x126d04[_0xb954('0x1e')],'include':_0x126d04[_0xb954('0x20')]?_[_0xb954('0x21')](_0x126d04[_0xb954('0x20')],function(_0x47b6d1){return{'model':db[_0x47b6d1['model']],'as':_0x47b6d1['as'],'attributes':_0x47b6d1[_0xb954('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xb954('0xe')](function(_0x4ef847){logger['info'](_0xb954('0x19'),_0x5c9a6d);logger['debug'](_0xb954('0x19'),_0x5c9a6d,JSON[_0xb954('0x12')](_0x4ef847));_0x30e2dd(_0x4ef847);})[_0xb954('0x18')](function(_0x26ecc2){logger[_0xb954('0x13')](_0xb954('0x19'),_0x26ecc2[_0xb954('0x15')],_0x5c9a6d);_0x5ee224(_0x25b55a[_0xb954('0x13')](0x1f4,_0x26ecc2[_0xb954('0x15')]));});});};exports[_0xb954('0x23')]=function(_0x5552f4){var _0x248ec8=this;return new Promise(function(_0x55a059,_0x51857f){return db[_0xb954('0x1a')][_0xb954('0x24')]({'raw':_0x5552f4[_0xb954('0x1c')]?_0x5552f4['options'][_0xb954('0x1d')]===undefined?!![]:![]:!![],'where':_0x5552f4[_0xb954('0x1c')]?_0x5552f4[_0xb954('0x1c')][_0xb954('0x25')]||null:null,'attributes':_0x5552f4[_0xb954('0x1c')]?_0x5552f4[_0xb954('0x1c')][_0xb954('0x1e')]||null:null,'include':_0x5552f4[_0xb954('0x1c')]?_0x5552f4[_0xb954('0x1c')][_0xb954('0x20')]?_[_0xb954('0x21')](_0x5552f4['options']['include'],function(_0x25b38a){return{'model':db[_0x25b38a[_0xb954('0x22')]],'as':_0x25b38a['as'],'attributes':_0x25b38a['attributes'],'include':_0x25b38a[_0xb954('0x20')]?_[_0xb954('0x21')](_0x25b38a[_0xb954('0x20')],function(_0x51718e){return{'model':db[_0x51718e['model']],'as':_0x51718e['as'],'attributes':_0x51718e['attributes'],'include':_0x51718e[_0xb954('0x20')]?_[_0xb954('0x21')](_0x51718e[_0xb954('0x20')],function(_0x24484a){return{'model':db[_0x24484a[_0xb954('0x22')]],'as':_0x24484a['as'],'attributes':_0x24484a['attributes']};}):[]};}):[]};}):[]:[]})[_0xb954('0xe')](function(_0x5d7088){logger[_0xb954('0x16')](_0xb954('0x23'),_0x5552f4);logger[_0xb954('0x10')](_0xb954('0x23'),_0x5552f4,JSON[_0xb954('0x12')](_0x5d7088));_0x55a059(_0x5d7088);})[_0xb954('0x18')](function(_0x3f5158){logger[_0xb954('0x13')](_0xb954('0x23'),_0x3f5158[_0xb954('0x15')],_0x5552f4);_0x51857f(_0x248ec8[_0xb954('0x13')](0x1f4,_0x3f5158[_0xb954('0x15')]));});});}; \ No newline at end of file +var _0xbbeb=['code','SmsQueue,\x20%s,\x20%s','message','info','catch','GetSmsQueue','SmsQueue','findAll','options','raw','limit','map','include','model','attributes','ShowSmsQueue','find','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','defaults','redis','localhost','socket.io-emitter','./smsQueue.socket','register','then','request\x20sent','debug','stringify','error'];(function(_0x3b9d5f,_0x2e9039){var _0x39924e=function(_0x5752ee){while(--_0x5752ee){_0x3b9d5f['push'](_0x3b9d5f['shift']());}};_0x39924e(++_0x2e9039);}(_0xbbeb,0x86));var _0xbbbe=function(_0x102243,_0x2b4dde){_0x102243=_0x102243-0x0;var _0x1d302c=_0xbbeb[_0x102243];return _0x1d302c;};'use strict';var _=require(_0xbbbe('0x0'));var util=require('util');var moment=require(_0xbbbe('0x1'));var BPromise=require(_0xbbbe('0x2'));var rs=require(_0xbbbe('0x3'));var fs=require('fs');var Redis=require(_0xbbbe('0x4'));var db=require(_0xbbbe('0x5'))['db'];var utils=require(_0xbbbe('0x6'));var logger=require(_0xbbbe('0x7'))(_0xbbbe('0x8'));var config=require(_0xbbbe('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xbbbe('0xa')]['http']({'port':0x232a});config['redis']=_[_0xbbbe('0xb')](config[_0xbbbe('0xc')],{'host':_0xbbbe('0xd'),'port':0x18eb});var socket=require(_0xbbbe('0xe'))(new Redis(config['redis']));require(_0xbbbe('0xf'))[_0xbbbe('0x10')](socket);function respondWithRpcPromise(_0x124cfb,_0x356b6f,_0x247fe6){return new BPromise(function(_0xb8553a,_0x14412b){return client['request'](_0x124cfb,_0x247fe6)[_0xbbbe('0x11')](function(_0xaf1121){logger['info']('SmsQueue,\x20%s,\x20%s',_0x356b6f,_0xbbbe('0x12'));logger[_0xbbbe('0x13')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x356b6f,_0xbbbe('0x12'),JSON[_0xbbbe('0x14')](_0xaf1121));if(_0xaf1121['error']){if(_0xaf1121[_0xbbbe('0x15')][_0xbbbe('0x16')]===0x1f4){logger[_0xbbbe('0x15')](_0xbbbe('0x17'),_0x356b6f,_0xaf1121[_0xbbbe('0x15')]['message']);return _0x14412b(_0xaf1121[_0xbbbe('0x15')][_0xbbbe('0x18')]);}logger[_0xbbbe('0x15')](_0xbbbe('0x17'),_0x356b6f,_0xaf1121['error'][_0xbbbe('0x18')]);return _0xb8553a(_0xaf1121['error'][_0xbbbe('0x18')]);}else{logger[_0xbbbe('0x19')](_0xbbbe('0x17'),_0x356b6f,_0xbbbe('0x12'));_0xb8553a(_0xaf1121['result']['message']);}})[_0xbbbe('0x1a')](function(_0x3c59d7){logger[_0xbbbe('0x15')](_0xbbbe('0x17'),_0x356b6f,_0x3c59d7);_0x14412b(_0x3c59d7);});});}exports[_0xbbbe('0x1b')]=function(_0x354caa){var _0x35a5d6=this;return new Promise(function(_0x2d5ce1,_0x115445){return db[_0xbbbe('0x1c')][_0xbbbe('0x1d')]({'raw':_0x354caa['options']?_0x354caa[_0xbbbe('0x1e')][_0xbbbe('0x1f')]===undefined?!![]:![]:!![],'where':_0x354caa[_0xbbbe('0x1e')]?_0x354caa[_0xbbbe('0x1e')]['where']||null:null,'attributes':_0x354caa[_0xbbbe('0x1e')]?_0x354caa[_0xbbbe('0x1e')]['attributes']||null:null,'limit':_0x354caa[_0xbbbe('0x1e')]?_0x354caa['options'][_0xbbbe('0x20')]||null:null,'include':_0x354caa[_0xbbbe('0x1e')]?_0x354caa['options']['include']?_[_0xbbbe('0x21')](_0x354caa[_0xbbbe('0x1e')][_0xbbbe('0x22')],function(_0xa9cafc){return{'model':db[_0xa9cafc[_0xbbbe('0x23')]],'as':_0xa9cafc['as'],'attributes':_0xa9cafc[_0xbbbe('0x24')],'include':_0xa9cafc[_0xbbbe('0x22')]?_['map'](_0xa9cafc['include'],function(_0x2c5fcd){return{'model':db[_0x2c5fcd[_0xbbbe('0x23')]],'as':_0x2c5fcd['as'],'attributes':_0x2c5fcd[_0xbbbe('0x24')],'include':_0x2c5fcd[_0xbbbe('0x22')]?_[_0xbbbe('0x21')](_0x2c5fcd[_0xbbbe('0x22')],function(_0x2a9b7c){return{'model':db[_0x2a9b7c[_0xbbbe('0x23')]],'as':_0x2a9b7c['as'],'attributes':_0x2a9b7c['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x102461){logger[_0xbbbe('0x19')](_0xbbbe('0x1b'),_0x354caa);logger[_0xbbbe('0x13')](_0xbbbe('0x1b'),_0x354caa,JSON[_0xbbbe('0x14')](_0x102461));_0x2d5ce1(_0x102461);})[_0xbbbe('0x1a')](function(_0x248f24){logger[_0xbbbe('0x15')](_0xbbbe('0x1b'),_0x248f24[_0xbbbe('0x18')],_0x354caa);_0x115445(_0x35a5d6['error'](0x1f4,_0x248f24[_0xbbbe('0x18')]));});});};exports[_0xbbbe('0x25')]=function(_0x2390b4){var _0x58c7c1=this;return new Promise(function(_0x18b104,_0x3322d9){return db[_0xbbbe('0x1c')][_0xbbbe('0x26')]({'raw':_0x2390b4[_0xbbbe('0x1e')]?_0x2390b4[_0xbbbe('0x1e')][_0xbbbe('0x1f')]===undefined?!![]:![]:!![],'where':_0x2390b4['options']?_0x2390b4[_0xbbbe('0x1e')]['where']||null:null,'attributes':_0x2390b4[_0xbbbe('0x1e')]?_0x2390b4[_0xbbbe('0x1e')]['attributes']||null:null,'include':_0x2390b4[_0xbbbe('0x1e')]?_0x2390b4['options'][_0xbbbe('0x22')]?_[_0xbbbe('0x21')](_0x2390b4[_0xbbbe('0x1e')][_0xbbbe('0x22')],function(_0x2e1f8f){return{'model':db[_0x2e1f8f[_0xbbbe('0x23')]],'as':_0x2e1f8f['as'],'attributes':_0x2e1f8f[_0xbbbe('0x24')],'include':_0x2e1f8f[_0xbbbe('0x22')]?_['map'](_0x2e1f8f[_0xbbbe('0x22')],function(_0x5cb7a3){return{'model':db[_0x5cb7a3['model']],'as':_0x5cb7a3['as'],'attributes':_0x5cb7a3['attributes'],'include':_0x5cb7a3[_0xbbbe('0x22')]?_[_0xbbbe('0x21')](_0x5cb7a3[_0xbbbe('0x22')],function(_0x7b0e5e){return{'model':db[_0x7b0e5e[_0xbbbe('0x23')]],'as':_0x7b0e5e['as'],'attributes':_0x7b0e5e['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1531fc){logger['info'](_0xbbbe('0x25'),_0x2390b4);logger['debug'](_0xbbbe('0x25'),_0x2390b4,JSON[_0xbbbe('0x14')](_0x1531fc));_0x18b104(_0x1531fc);})[_0xbbbe('0x1a')](function(_0x5b82d5){logger[_0xbbbe('0x15')](_0xbbbe('0x25'),_0x5b82d5[_0xbbbe('0x18')],_0x2390b4);_0x3322d9(_0x58c7c1[_0xbbbe('0x15')](0x1f4,_0x5b82d5[_0xbbbe('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index a0b2a89..5acf414 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 _0x646b=['length','smsQueue:','./smsQueue.events','save','remove','emit','removeListener','register'];(function(_0x52c209,_0x2cbc7f){var _0x2b0a37=function(_0x1398e7){while(--_0x1398e7){_0x52c209['push'](_0x52c209['shift']());}};_0x2b0a37(++_0x2cbc7f);}(_0x646b,0x9a));var _0xb646=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x646b[_0x4c12ec];return _0x3ae42c;};'use strict';var SmsQueueEvents=require(_0xb646('0x0'));var events=[_0xb646('0x1'),_0xb646('0x2'),'update'];function createListener(_0x45111f,_0x58c835){return function(_0x311ad2){_0x58c835[_0xb646('0x3')](_0x45111f,_0x311ad2);};}function removeListener(_0x72ae69,_0xfcdc7c){return function(){SmsQueueEvents[_0xb646('0x4')](_0x72ae69,_0xfcdc7c);};}exports[_0xb646('0x5')]=function(_0x4527df){for(var _0xb3e6c=0x0,_0x1ce3af=events[_0xb646('0x6')];_0xb3e6c<_0x1ce3af;_0xb3e6c++){var _0x15efe1=events[_0xb3e6c];var _0x37f21e=createListener(_0xb646('0x7')+_0x15efe1,_0x4527df);SmsQueueEvents['on'](_0x15efe1,_0x37f21e);}}; \ No newline at end of file +var _0x9b84=['smsQueue:','save','remove','update','emit','removeListener','length'];(function(_0x45d01a,_0x359596){var _0x5f2704=function(_0x44f295){while(--_0x44f295){_0x45d01a['push'](_0x45d01a['shift']());}};_0x5f2704(++_0x359596);}(_0x9b84,0x1ac));var _0x49b8=function(_0x5d6e30,_0xc21d51){_0x5d6e30=_0x5d6e30-0x0;var _0x3d3f3b=_0x9b84[_0x5d6e30];return _0x3d3f3b;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0x49b8('0x0'),_0x49b8('0x1'),_0x49b8('0x2')];function createListener(_0x29a9fa,_0x1fedb9){return function(_0x24907f){_0x1fedb9[_0x49b8('0x3')](_0x29a9fa,_0x24907f);};}function removeListener(_0x21a02d,_0x3ff106){return function(){SmsQueueEvents[_0x49b8('0x4')](_0x21a02d,_0x3ff106);};}exports['register']=function(_0x26b932){for(var _0x593ee7=0x0,_0xc0d4f4=events[_0x49b8('0x5')];_0x593ee7<_0xc0d4f4;_0x593ee7++){var _0x3138c7=events[_0x593ee7];var _0x3388fa=createListener(_0x49b8('0x6')+_0x3138c7,_0x26b932);SmsQueueEvents['on'](_0x3138c7,_0x3388fa);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index d67e81f..1fa7dfb 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 _0x30cb=['../../components/auth/service','../../config/environment','get','isAuthenticated','describe','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra'];(function(_0x90acbd,_0x5cf096){var _0x3d06e9=function(_0x5b4822){while(--_0x5b4822){_0x90acbd['push'](_0x90acbd['shift']());}};_0x3d06e9(++_0x5cf096);}(_0x30cb,0xb8));var _0xb30c=function(_0x13c265,_0x524cc5){_0x13c265=_0x13c265-0x0;var _0x1bf813=_0x30cb[_0x13c265];return _0x1bf813;};'use strict';var multer=require(_0xb30c('0x0'));var util=require(_0xb30c('0x1'));var path=require(_0xb30c('0x2'));var timeout=require('connect-timeout');var express=require(_0xb30c('0x3'));var router=express[_0xb30c('0x4')]();var fs_extra=require(_0xb30c('0x5'));var auth=require(_0xb30c('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb30c('0x7'));var controller=require('./smsQueueReport.controller');router[_0xb30c('0x8')]('/',auth[_0xb30c('0x9')](),controller['index']);router[_0xb30c('0x8')]('/describe',auth[_0xb30c('0x9')](),controller[_0xb30c('0xa')]);router['get'](_0xb30c('0xb'),auth['isAuthenticated'](),controller[_0xb30c('0xc')]);router[_0xb30c('0xd')]('/',auth[_0xb30c('0x9')](),controller[_0xb30c('0xe')]);router['put'](_0xb30c('0xb'),auth[_0xb30c('0x9')](),controller[_0xb30c('0xf')]);router[_0xb30c('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xb30c('0x11')]);module[_0xb30c('0x12')]=router; \ No newline at end of file +var _0x170d=['post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./smsQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x42e459,_0x3f7a62){var _0x5eb3ae=function(_0x10092d){while(--_0x10092d){_0x42e459['push'](_0x42e459['shift']());}};_0x5eb3ae(++_0x3f7a62);}(_0x170d,0x13b));var _0xd170=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x170d[_0x19950b];return _0x3c6b41;};'use strict';var multer=require(_0xd170('0x0'));var util=require(_0xd170('0x1'));var path=require(_0xd170('0x2'));var timeout=require(_0xd170('0x3'));var express=require(_0xd170('0x4'));var router=express[_0xd170('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd170('0x6'));var config=require('../../config/environment');var controller=require(_0xd170('0x7'));router[_0xd170('0x8')]('/',auth[_0xd170('0x9')](),controller[_0xd170('0xa')]);router[_0xd170('0x8')](_0xd170('0xb'),auth['isAuthenticated'](),controller[_0xd170('0xc')]);router[_0xd170('0x8')](_0xd170('0xd'),auth[_0xd170('0x9')](),controller[_0xd170('0xe')]);router[_0xd170('0xf')]('/',auth[_0xd170('0x9')](),controller[_0xd170('0x10')]);router[_0xd170('0x11')](_0xd170('0xd'),auth[_0xd170('0x9')](),controller[_0xd170('0x12')]);router[_0xd170('0x13')](_0xd170('0xd'),auth[_0xd170('0x9')](),controller[_0xd170('0x14')]);module[_0xd170('0x15')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 6877144..dc82704 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 _0xd0e2=['exports','STRING','DATE','moment','sequelize'];(function(_0x30b734,_0x42b215){var _0x46ee2e=function(_0x11eccb){while(--_0x11eccb){_0x30b734['push'](_0x30b734['shift']());}};_0x46ee2e(++_0x42b215);}(_0xd0e2,0xb7));var _0x2d0e=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xd0e2[_0x17d9e3];return _0x14192d;};'use strict';var moment=require(_0x2d0e('0x0'));var Sequelize=require(_0x2d0e('0x1'));module[_0x2d0e('0x2')]={'uniqueid':{'type':Sequelize[_0x2d0e('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x2d0e('0x3')]},'joinAt':{'type':Sequelize[_0x2d0e('0x4')]},'leaveAt':{'type':Sequelize[_0x2d0e('0x4')]},'acceptAt':{'type':Sequelize[_0x2d0e('0x4')]},'exitAt':{'type':Sequelize[_0x2d0e('0x4')]},'reason':{'type':Sequelize[_0x2d0e('0x3')]}}; \ No newline at end of file +var _0x307b=['moment','exports','STRING','DATE'];(function(_0x3ad9e7,_0x3dac1b){var _0x583f60=function(_0x19a55f){while(--_0x19a55f){_0x3ad9e7['push'](_0x3ad9e7['shift']());}};_0x583f60(++_0x3dac1b);}(_0x307b,0x108));var _0xb307=function(_0x352940,_0x4f7419){_0x352940=_0x352940-0x0;var _0x6f9331=_0x307b[_0x352940];return _0x6f9331;};'use strict';var moment=require(_0xb307('0x0'));var Sequelize=require('sequelize');module[_0xb307('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xb307('0x2')]},'joinAt':{'type':Sequelize[_0xb307('0x3')]},'leaveAt':{'type':Sequelize[_0xb307('0x3')]},'acceptAt':{'type':Sequelize[_0xb307('0x3')]},'exitAt':{'type':Sequelize[_0xb307('0x3')]},'reason':{'type':Sequelize[_0xb307('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 1a6927a..56789cf 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 _0xf074=['error','stack','name','send','index','map','SmsQueueReport','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','catch','rawAttributes','find','create','body','params','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','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','offset','limit','count','set','Content-Range','reject','save','update','then','destroy'];(function(_0x13651c,_0x1b81c5){var _0xc6ea66=function(_0x47c20d){while(--_0x47c20d){_0x13651c['push'](_0x13651c['shift']());}};_0xc6ea66(++_0x1b81c5);}(_0xf074,0xb7));var _0x4f07=function(_0x668dfe,_0x49c31b){_0x668dfe=_0x668dfe-0x0;var _0x32d759=_0xf074[_0x668dfe];return _0x32d759;};'use strict';var emlformat=require(_0x4f07('0x0'));var rimraf=require(_0x4f07('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4f07('0x2'));var rp=require('request-promise');var moment=require(_0x4f07('0x3'));var BPromise=require(_0x4f07('0x4'));var Mustache=require(_0x4f07('0x5'));var util=require('util');var path=require(_0x4f07('0x6'));var sox=require(_0x4f07('0x7'));var csv=require('to-csv');var ejs=require(_0x4f07('0x8'));var fs=require('fs');var fs_extra=require(_0x4f07('0x9'));var _=require(_0x4f07('0xa'));var squel=require(_0x4f07('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4f07('0xc'));var toCsv=require(_0x4f07('0xd'));var querystring=require(_0x4f07('0xe'));var Papa=require(_0x4f07('0xf'));var Redis=require(_0x4f07('0x10'));var authService=require(_0x4f07('0x11'));var qs=require(_0x4f07('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4f07('0x13'));var logger=require(_0x4f07('0x14'))(_0x4f07('0x15'));var utils=require(_0x4f07('0x16'));var config=require(_0x4f07('0x17'));var licenseUtil=require(_0x4f07('0x18'));var db=require(_0x4f07('0x19'))['db'];function respondWithStatusCode(_0x332877,_0x258260){_0x258260=_0x258260||0xcc;return function(_0x4e70a7){if(_0x4e70a7){return _0x332877[_0x4f07('0x1a')](_0x258260);}return _0x332877[_0x4f07('0x1b')](_0x258260)[_0x4f07('0x1c')]();};}function respondWithResult(_0x1e6c07,_0x3fbe33){_0x3fbe33=_0x3fbe33||0xc8;return function(_0x2e75ba){if(_0x2e75ba){return _0x1e6c07[_0x4f07('0x1b')](_0x3fbe33)['json'](_0x2e75ba);}};}function respondWithFilteredResult(_0x50ee51,_0x13c37e){return function(_0x3459f4){if(_0x3459f4){var _0x5a41a9=typeof _0x13c37e[_0x4f07('0x1d')]==='undefined'&&typeof _0x13c37e[_0x4f07('0x1e')]==='undefined';var _0x57a2b1=_0x3459f4[_0x4f07('0x1f')];var _0x2a042b=_0x5a41a9?0x0:_0x13c37e[_0x4f07('0x1d')];var _0x152518=_0x5a41a9?_0x3459f4[_0x4f07('0x1f')]:_0x13c37e[_0x4f07('0x1d')]+_0x13c37e[_0x4f07('0x1e')];var _0xaf4402;if(_0x152518>=_0x57a2b1){_0x152518=_0x57a2b1;_0xaf4402=0xc8;}else{_0xaf4402=0xce;}_0x50ee51['status'](_0xaf4402);return _0x50ee51[_0x4f07('0x20')](_0x4f07('0x21'),_0x2a042b+'-'+_0x152518+'/'+_0x57a2b1)['json'](_0x3459f4);}return null;};}function patchUpdates(_0x4394bd){return function(_0x4a2efa){try{jsonpatch['apply'](_0x4a2efa,_0x4394bd,!![]);}catch(_0x47a8ad){return BPromise[_0x4f07('0x22')](_0x47a8ad);}return _0x4a2efa[_0x4f07('0x23')]();};}function saveUpdates(_0x1435de,_0x3fa032){return function(_0x300698){if(_0x300698){return _0x300698[_0x4f07('0x24')](_0x1435de)[_0x4f07('0x25')](function(_0x2c345f){return _0x2c345f;});}return null;};}function removeEntity(_0x4035e5,_0x152ad2){return function(_0x4857bb){if(_0x4857bb){return _0x4857bb[_0x4f07('0x26')]()[_0x4f07('0x25')](function(){_0x4035e5[_0x4f07('0x1b')](0xcc)[_0x4f07('0x1c')]();});}};}function handleEntityNotFound(_0x46d153,_0x7abc54){return function(_0x196785){if(!_0x196785){_0x46d153[_0x4f07('0x1a')](0x194);}return _0x196785;};}function handleError(_0x5cc171,_0x55114c){_0x55114c=_0x55114c||0x1f4;return function(_0xc735ab){logger[_0x4f07('0x27')](_0xc735ab[_0x4f07('0x28')]);if(_0xc735ab['name']){delete _0xc735ab[_0x4f07('0x29')];}_0x5cc171[_0x4f07('0x1b')](_0x55114c)[_0x4f07('0x2a')](_0xc735ab);};}exports[_0x4f07('0x2b')]=function(_0x342737,_0x79dad0){var _0x4a09d1={},_0x17a54a={},_0x2b8702={'count':0x0,'rows':[]};var _0xd5ab1a=_[_0x4f07('0x2c')](db[_0x4f07('0x2d')]['rawAttributes'],function(_0x45d782){return{'name':_0x45d782[_0x4f07('0x2e')],'type':_0x45d782[_0x4f07('0x2f')]['key']};});_0x17a54a[_0x4f07('0x30')]=_[_0x4f07('0x2c')](_0xd5ab1a,'name');_0x17a54a[_0x4f07('0x31')]=_[_0x4f07('0x32')](_0x342737[_0x4f07('0x31')]);_0x17a54a[_0x4f07('0x33')]=_[_0x4f07('0x34')](_0x17a54a[_0x4f07('0x30')],_0x17a54a[_0x4f07('0x31')]);_0x4a09d1[_0x4f07('0x35')]=_[_0x4f07('0x34')](_0x17a54a[_0x4f07('0x30')],qs[_0x4f07('0x36')](_0x342737[_0x4f07('0x31')][_0x4f07('0x36')]));_0x4a09d1[_0x4f07('0x35')]=_0x4a09d1[_0x4f07('0x35')][_0x4f07('0x37')]?_0x4a09d1[_0x4f07('0x35')]:_0x17a54a[_0x4f07('0x30')];if(!_0x342737[_0x4f07('0x31')][_0x4f07('0x38')](_0x4f07('0x39'))){_0x4a09d1[_0x4f07('0x1e')]=qs[_0x4f07('0x1e')](_0x342737['query'][_0x4f07('0x1e')]);_0x4a09d1['offset']=qs['offset'](_0x342737[_0x4f07('0x31')][_0x4f07('0x1d')]);}_0x4a09d1['order']=qs['sort'](_0x342737['query']['sort']);_0x4a09d1[_0x4f07('0x3a')]=qs['filters'](_[_0x4f07('0x3b')](_0x342737[_0x4f07('0x31')],_0x17a54a[_0x4f07('0x33')]),_0xd5ab1a);if(_0x342737[_0x4f07('0x31')][_0x4f07('0x3c')]){_0x4a09d1[_0x4f07('0x3a')]=_['merge'](_0x4a09d1['where'],{'$or':_[_0x4f07('0x2c')](_0xd5ab1a,function(_0x19da50){if(_0x19da50[_0x4f07('0x2f')]!==_0x4f07('0x3d')){var _0xb090ac={};_0xb090ac[_0x19da50[_0x4f07('0x29')]]={'$like':'%'+_0x342737['query'][_0x4f07('0x3c')]+'%'};return _0xb090ac;}})});}_0x4a09d1=_[_0x4f07('0x3e')]({},_0x4a09d1,_0x342737[_0x4f07('0x3f')]);var _0x56ca6a={'where':_0x4a09d1['where']};return db[_0x4f07('0x2d')][_0x4f07('0x1f')](_0x56ca6a)[_0x4f07('0x25')](function(_0x29bbcb){_0x2b8702[_0x4f07('0x1f')]=_0x29bbcb;if(_0x342737[_0x4f07('0x31')]['includeAll']){_0x4a09d1[_0x4f07('0x40')]=[{'all':!![]}];}return db['SmsQueueReport'][_0x4f07('0x41')](_0x4a09d1);})[_0x4f07('0x25')](function(_0x174116){_0x2b8702[_0x4f07('0x42')]=_0x174116;return _0x2b8702;})[_0x4f07('0x25')](respondWithFilteredResult(_0x79dad0,_0x4a09d1))[_0x4f07('0x43')](handleError(_0x79dad0,null));};exports['show']=function(_0x118600,_0x263010){var _0x293994={'raw':!![],'where':{'id':_0x118600['params']['id']}},_0x4ba8b7={};_0x4ba8b7['model']=_[_0x4f07('0x32')](db[_0x4f07('0x2d')][_0x4f07('0x44')]);_0x4ba8b7['query']=_[_0x4f07('0x32')](_0x118600[_0x4f07('0x31')]);_0x4ba8b7['filters']=_[_0x4f07('0x34')](_0x4ba8b7[_0x4f07('0x30')],_0x4ba8b7[_0x4f07('0x31')]);_0x293994['attributes']=_[_0x4f07('0x34')](_0x4ba8b7[_0x4f07('0x30')],qs['fields'](_0x118600[_0x4f07('0x31')][_0x4f07('0x36')]));_0x293994[_0x4f07('0x35')]=_0x293994[_0x4f07('0x35')][_0x4f07('0x37')]?_0x293994['attributes']:_0x4ba8b7[_0x4f07('0x30')];if(_0x118600['query']['includeAll']){_0x293994['include']=[{'all':!![]}];}_0x293994=_[_0x4f07('0x3e')]({},_0x293994,_0x118600['options']);return db[_0x4f07('0x2d')][_0x4f07('0x45')](_0x293994)[_0x4f07('0x25')](handleEntityNotFound(_0x263010,null))['then'](respondWithResult(_0x263010,null))[_0x4f07('0x43')](handleError(_0x263010,null));};exports[_0x4f07('0x46')]=function(_0x39e57e,_0x9f6736){return db[_0x4f07('0x2d')][_0x4f07('0x46')](_0x39e57e['body'],{})[_0x4f07('0x25')](respondWithResult(_0x9f6736,0xc9))[_0x4f07('0x43')](handleError(_0x9f6736,null));};exports[_0x4f07('0x24')]=function(_0x28d31d,_0x5d62e2){if(_0x28d31d[_0x4f07('0x47')]['id']){delete _0x28d31d[_0x4f07('0x47')]['id'];}return db[_0x4f07('0x2d')]['find']({'where':{'id':_0x28d31d[_0x4f07('0x48')]['id']}})[_0x4f07('0x25')](handleEntityNotFound(_0x5d62e2,null))[_0x4f07('0x25')](saveUpdates(_0x28d31d[_0x4f07('0x47')],null))[_0x4f07('0x25')](respondWithResult(_0x5d62e2,null))[_0x4f07('0x43')](handleError(_0x5d62e2,null));};exports['destroy']=function(_0x47b802,_0xcfdad6){return db['SmsQueueReport'][_0x4f07('0x45')]({'where':{'id':_0x47b802[_0x4f07('0x48')]['id']}})[_0x4f07('0x25')](handleEntityNotFound(_0xcfdad6,null))[_0x4f07('0x25')](removeEntity(_0xcfdad6,null))['catch'](handleError(_0xcfdad6,null));};exports['describe']=function(_0x3b7e71,_0x4bff7b){return db[_0x4f07('0x2d')][_0x4f07('0x49')]()[_0x4f07('0x25')](respondWithResult(_0x4bff7b,null))[_0x4f07('0x43')](handleError(_0x4bff7b,null));}; \ No newline at end of file +var _0xbf08=['error','stack','name','index','SmsQueueReport','rawAttributes','fieldName','key','model','map','query','keys','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','type','filter','options','includeAll','include','findAll','rows','show','params','merge','find','create','body','catch','update','destroy','describe','eml-format','rimraf','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','then','end'];(function(_0x180c5f,_0x43ad9d){var _0x45f3c0=function(_0x33d48e){while(--_0x33d48e){_0x180c5f['push'](_0x180c5f['shift']());}};_0x45f3c0(++_0x43ad9d);}(_0xbf08,0x1dc));var _0x8bf0=function(_0x363342,_0x35e71e){_0x363342=_0x363342-0x0;var _0xe5b38c=_0xbf08[_0x363342];return _0xe5b38c;};'use strict';var emlformat=require(_0x8bf0('0x0'));var rimraf=require(_0x8bf0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8bf0('0x2'));var moment=require(_0x8bf0('0x3'));var BPromise=require(_0x8bf0('0x4'));var Mustache=require('mustache');var util=require(_0x8bf0('0x5'));var path=require(_0x8bf0('0x6'));var sox=require('sox');var csv=require(_0x8bf0('0x7'));var ejs=require(_0x8bf0('0x8'));var fs=require('fs');var fs_extra=require(_0x8bf0('0x9'));var _=require('lodash');var squel=require(_0x8bf0('0xa'));var crypto=require(_0x8bf0('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x8bf0('0xc'));var toCsv=require(_0x8bf0('0x7'));var querystring=require(_0x8bf0('0xd'));var Papa=require(_0x8bf0('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8bf0('0xf'));var as=require(_0x8bf0('0x10'));var hardwareService=require(_0x8bf0('0x11'));var logger=require('../../config/logger')(_0x8bf0('0x12'));var utils=require(_0x8bf0('0x13'));var config=require(_0x8bf0('0x14'));var licenseUtil=require(_0x8bf0('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d3e00,_0x1b4f34){_0x1b4f34=_0x1b4f34||0xcc;return function(_0x57d5bd){if(_0x57d5bd){return _0x3d3e00[_0x8bf0('0x16')](_0x1b4f34);}return _0x3d3e00['status'](_0x1b4f34)['end']();};}function respondWithResult(_0x433071,_0x1c1316){_0x1c1316=_0x1c1316||0xc8;return function(_0x7bbab4){if(_0x7bbab4){return _0x433071[_0x8bf0('0x17')](_0x1c1316)[_0x8bf0('0x18')](_0x7bbab4);}};}function respondWithFilteredResult(_0x510493,_0x568115){return function(_0x15fde4){if(_0x15fde4){var _0x4d1172=typeof _0x568115[_0x8bf0('0x19')]===_0x8bf0('0x1a')&&typeof _0x568115['limit']===_0x8bf0('0x1a');var _0x42bede=_0x15fde4[_0x8bf0('0x1b')];var _0xf92a28=_0x4d1172?0x0:_0x568115[_0x8bf0('0x19')];var _0x58aaf8=_0x4d1172?_0x15fde4['count']:_0x568115['offset']+_0x568115[_0x8bf0('0x1c')];var _0x4859c5;if(_0x58aaf8>=_0x42bede){_0x58aaf8=_0x42bede;_0x4859c5=0xc8;}else{_0x4859c5=0xce;}_0x510493[_0x8bf0('0x17')](_0x4859c5);return _0x510493[_0x8bf0('0x1d')](_0x8bf0('0x1e'),_0xf92a28+'-'+_0x58aaf8+'/'+_0x42bede)[_0x8bf0('0x18')](_0x15fde4);}return null;};}function patchUpdates(_0x1edb74){return function(_0x216185){try{jsonpatch[_0x8bf0('0x1f')](_0x216185,_0x1edb74,!![]);}catch(_0x3c0ff5){return BPromise[_0x8bf0('0x20')](_0x3c0ff5);}return _0x216185['save']();};}function saveUpdates(_0x4bdd8e,_0x134f7d){return function(_0x520bdb){if(_0x520bdb){return _0x520bdb['update'](_0x4bdd8e)[_0x8bf0('0x21')](function(_0x78d8ba){return _0x78d8ba;});}return null;};}function removeEntity(_0x5780cb,_0x3e65bd){return function(_0x2662ac){if(_0x2662ac){return _0x2662ac['destroy']()[_0x8bf0('0x21')](function(){_0x5780cb[_0x8bf0('0x17')](0xcc)[_0x8bf0('0x22')]();});}};}function handleEntityNotFound(_0x2d5857,_0x425334){return function(_0x317316){if(!_0x317316){_0x2d5857[_0x8bf0('0x16')](0x194);}return _0x317316;};}function handleError(_0x2a4106,_0x1da880){_0x1da880=_0x1da880||0x1f4;return function(_0x425368){logger[_0x8bf0('0x23')](_0x425368[_0x8bf0('0x24')]);if(_0x425368['name']){delete _0x425368[_0x8bf0('0x25')];}_0x2a4106[_0x8bf0('0x17')](_0x1da880)['send'](_0x425368);};}exports[_0x8bf0('0x26')]=function(_0x357a35,_0x2cc1e7){var _0x13fa0c={},_0x1a5250={},_0x135182={'count':0x0,'rows':[]};var _0x5909c1=_['map'](db[_0x8bf0('0x27')][_0x8bf0('0x28')],function(_0x5cf73a){return{'name':_0x5cf73a[_0x8bf0('0x29')],'type':_0x5cf73a['type'][_0x8bf0('0x2a')]};});_0x1a5250[_0x8bf0('0x2b')]=_[_0x8bf0('0x2c')](_0x5909c1,_0x8bf0('0x25'));_0x1a5250[_0x8bf0('0x2d')]=_[_0x8bf0('0x2e')](_0x357a35[_0x8bf0('0x2d')]);_0x1a5250['filters']=_[_0x8bf0('0x2f')](_0x1a5250['model'],_0x1a5250[_0x8bf0('0x2d')]);_0x13fa0c[_0x8bf0('0x30')]=_['intersection'](_0x1a5250[_0x8bf0('0x2b')],qs[_0x8bf0('0x31')](_0x357a35[_0x8bf0('0x2d')][_0x8bf0('0x31')]));_0x13fa0c[_0x8bf0('0x30')]=_0x13fa0c[_0x8bf0('0x30')][_0x8bf0('0x32')]?_0x13fa0c['attributes']:_0x1a5250['model'];if(!_0x357a35['query']['hasOwnProperty'](_0x8bf0('0x33'))){_0x13fa0c[_0x8bf0('0x1c')]=qs[_0x8bf0('0x1c')](_0x357a35[_0x8bf0('0x2d')][_0x8bf0('0x1c')]);_0x13fa0c['offset']=qs[_0x8bf0('0x19')](_0x357a35[_0x8bf0('0x2d')][_0x8bf0('0x19')]);}_0x13fa0c['order']=qs[_0x8bf0('0x34')](_0x357a35[_0x8bf0('0x2d')]['sort']);_0x13fa0c[_0x8bf0('0x35')]=qs[_0x8bf0('0x36')](_[_0x8bf0('0x37')](_0x357a35[_0x8bf0('0x2d')],_0x1a5250['filters']),_0x5909c1);if(_0x357a35[_0x8bf0('0x2d')]['filter']){_0x13fa0c[_0x8bf0('0x35')]=_['merge'](_0x13fa0c[_0x8bf0('0x35')],{'$or':_[_0x8bf0('0x2c')](_0x5909c1,function(_0x2eb981){if(_0x2eb981[_0x8bf0('0x38')]!=='VIRTUAL'){var _0x5b4cb6={};_0x5b4cb6[_0x2eb981[_0x8bf0('0x25')]]={'$like':'%'+_0x357a35[_0x8bf0('0x2d')][_0x8bf0('0x39')]+'%'};return _0x5b4cb6;}})});}_0x13fa0c=_['merge']({},_0x13fa0c,_0x357a35[_0x8bf0('0x3a')]);var _0x404173={'where':_0x13fa0c[_0x8bf0('0x35')]};return db['SmsQueueReport'][_0x8bf0('0x1b')](_0x404173)[_0x8bf0('0x21')](function(_0x52787f){_0x135182[_0x8bf0('0x1b')]=_0x52787f;if(_0x357a35[_0x8bf0('0x2d')][_0x8bf0('0x3b')]){_0x13fa0c[_0x8bf0('0x3c')]=[{'all':!![]}];}return db[_0x8bf0('0x27')][_0x8bf0('0x3d')](_0x13fa0c);})['then'](function(_0x1c2147){_0x135182[_0x8bf0('0x3e')]=_0x1c2147;return _0x135182;})[_0x8bf0('0x21')](respondWithFilteredResult(_0x2cc1e7,_0x13fa0c))['catch'](handleError(_0x2cc1e7,null));};exports[_0x8bf0('0x3f')]=function(_0x2f9a44,_0x1c0b95){var _0x479f5b={'raw':!![],'where':{'id':_0x2f9a44[_0x8bf0('0x40')]['id']}},_0x2500b2={};_0x2500b2['model']=_['keys'](db[_0x8bf0('0x27')][_0x8bf0('0x28')]);_0x2500b2[_0x8bf0('0x2d')]=_[_0x8bf0('0x2e')](_0x2f9a44['query']);_0x2500b2['filters']=_[_0x8bf0('0x2f')](_0x2500b2[_0x8bf0('0x2b')],_0x2500b2['query']);_0x479f5b[_0x8bf0('0x30')]=_[_0x8bf0('0x2f')](_0x2500b2[_0x8bf0('0x2b')],qs[_0x8bf0('0x31')](_0x2f9a44[_0x8bf0('0x2d')][_0x8bf0('0x31')]));_0x479f5b['attributes']=_0x479f5b['attributes'][_0x8bf0('0x32')]?_0x479f5b['attributes']:_0x2500b2[_0x8bf0('0x2b')];if(_0x2f9a44['query'][_0x8bf0('0x3b')]){_0x479f5b['include']=[{'all':!![]}];}_0x479f5b=_[_0x8bf0('0x41')]({},_0x479f5b,_0x2f9a44[_0x8bf0('0x3a')]);return db[_0x8bf0('0x27')][_0x8bf0('0x42')](_0x479f5b)[_0x8bf0('0x21')](handleEntityNotFound(_0x1c0b95,null))['then'](respondWithResult(_0x1c0b95,null))['catch'](handleError(_0x1c0b95,null));};exports[_0x8bf0('0x43')]=function(_0xe1130e,_0xdfbbf9){return db['SmsQueueReport'][_0x8bf0('0x43')](_0xe1130e[_0x8bf0('0x44')],{})[_0x8bf0('0x21')](respondWithResult(_0xdfbbf9,0xc9))[_0x8bf0('0x45')](handleError(_0xdfbbf9,null));};exports[_0x8bf0('0x46')]=function(_0x338afa,_0x1ea3a5){if(_0x338afa['body']['id']){delete _0x338afa['body']['id'];}return db[_0x8bf0('0x27')][_0x8bf0('0x42')]({'where':{'id':_0x338afa[_0x8bf0('0x40')]['id']}})[_0x8bf0('0x21')](handleEntityNotFound(_0x1ea3a5,null))[_0x8bf0('0x21')](saveUpdates(_0x338afa[_0x8bf0('0x44')],null))[_0x8bf0('0x21')](respondWithResult(_0x1ea3a5,null))[_0x8bf0('0x45')](handleError(_0x1ea3a5,null));};exports[_0x8bf0('0x47')]=function(_0x1f498e,_0xbb013b){return db[_0x8bf0('0x27')][_0x8bf0('0x42')]({'where':{'id':_0x1f498e[_0x8bf0('0x40')]['id']}})[_0x8bf0('0x21')](handleEntityNotFound(_0xbb013b,null))[_0x8bf0('0x21')](removeEntity(_0xbb013b,null))[_0x8bf0('0x45')](handleError(_0xbb013b,null));};exports[_0x8bf0('0x48')]=function(_0x177f06,_0x244cd7){return db['SmsQueueReport'][_0x8bf0('0x48')]()[_0x8bf0('0x21')](respondWithResult(_0x244cd7,null))[_0x8bf0('0x45')](handleError(_0x244cd7,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 625fd97..399f492 100644 --- a/server/api/smsQueueReport/smsQueueReport.model.js +++ b/server/api/smsQueueReport/smsQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid'];(function(_0x3f6b1b,_0x58d3d6){var _0x4a3d2b=function(_0x5648f0){while(--_0x5648f0){_0x3f6b1b['push'](_0x3f6b1b['shift']());}};_0x4a3d2b(++_0x58d3d6);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid','lodash','util'];(function(_0x6eb02d,_0x20bdf5){var _0xb756de=function(_0x18fef2){while(--_0x18fef2){_0x6eb02d['push'](_0x6eb02d['shift']());}};_0xb756de(++_0x20bdf5);}(_0xe706,0xa3));var _0x6e70=function(_0x2e067a,_0xab528c){_0x2e067a=_0x2e067a-0x0;var _0xc64976=_0xe706[_0x2e067a];return _0xc64976;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 3931438..21b6302 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 _0x627b=['error','code','message','info','CreateSmsQueueReport','SmsQueueReport','create','body','options','raw','stringify','catch','update','attributes','limit','then','UpdateSmsQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s'];(function(_0x2722d2,_0x29f141){var _0xda8299=function(_0x2af70d){while(--_0x2af70d){_0x2722d2['push'](_0x2722d2['shift']());}};_0xda8299(++_0x29f141);}(_0x627b,0x10d));var _0xb627=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x627b[_0x1d9aa0];return _0x226868;};'use strict';var _=require(_0xb627('0x0'));var util=require(_0xb627('0x1'));var moment=require(_0xb627('0x2'));var BPromise=require(_0xb627('0x3'));var rs=require(_0xb627('0x4'));var fs=require('fs');var Redis=require(_0xb627('0x5'));var db=require(_0xb627('0x6'))['db'];var utils=require(_0xb627('0x7'));var logger=require(_0xb627('0x8'))(_0xb627('0x9'));var config=require(_0xb627('0xa'));var jayson=require(_0xb627('0xb'));var client=jayson[_0xb627('0xc')][_0xb627('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4e7065,_0x577473,_0x47b352){return new BPromise(function(_0x30183e,_0x5b1979){return client[_0xb627('0xe')](_0x4e7065,_0x47b352)['then'](function(_0x16ae38){logger['info'](_0xb627('0xf'),_0x577473,_0xb627('0x10'));logger[_0xb627('0x11')](_0xb627('0x12'),_0x577473,'request\x20sent',JSON['stringify'](_0x16ae38));if(_0x16ae38['error']){if(_0x16ae38[_0xb627('0x13')][_0xb627('0x14')]===0x1f4){logger['error'](_0xb627('0xf'),_0x577473,_0x16ae38[_0xb627('0x13')][_0xb627('0x15')]);return _0x5b1979(_0x16ae38['error'][_0xb627('0x15')]);}logger[_0xb627('0x13')](_0xb627('0xf'),_0x577473,_0x16ae38[_0xb627('0x13')][_0xb627('0x15')]);return _0x30183e(_0x16ae38[_0xb627('0x13')][_0xb627('0x15')]);}else{logger[_0xb627('0x16')]('SmsQueueReport,\x20%s,\x20%s',_0x577473,_0xb627('0x10'));_0x30183e(_0x16ae38['result'][_0xb627('0x15')]);}})['catch'](function(_0x27a48a){logger[_0xb627('0x13')](_0xb627('0xf'),_0x577473,_0x27a48a);_0x5b1979(_0x27a48a);});});}exports[_0xb627('0x17')]=function(_0x1ba695){var _0x62bb7b=this;return new Promise(function(_0x1a5355,_0x208d27){return db[_0xb627('0x18')][_0xb627('0x19')](_0x1ba695[_0xb627('0x1a')],{'raw':_0x1ba695[_0xb627('0x1b')]?_0x1ba695[_0xb627('0x1b')][_0xb627('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0xc082e2){logger[_0xb627('0x16')](_0xb627('0x17'),_0x1ba695);logger[_0xb627('0x11')](_0xb627('0x17'),_0x1ba695,JSON[_0xb627('0x1d')](_0xc082e2));_0x1a5355(_0xc082e2);})[_0xb627('0x1e')](function(_0x1b07e1){logger[_0xb627('0x13')]('CreateSmsQueueReport',_0x1b07e1[_0xb627('0x15')],_0x1ba695);_0x208d27(_0x62bb7b[_0xb627('0x13')](0x1f4,_0x1b07e1[_0xb627('0x15')]));});});};exports['UpdateSmsQueueReport']=function(_0xcbd1b4){var _0x563a2e=this;return new Promise(function(_0x197fc4,_0xab01a){return db[_0xb627('0x18')][_0xb627('0x1f')](_0xcbd1b4['body'],{'raw':_0xcbd1b4[_0xb627('0x1b')]?_0xcbd1b4[_0xb627('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xcbd1b4['options']?_0xcbd1b4['options']['where']||null:null,'attributes':_0xcbd1b4['options']?_0xcbd1b4[_0xb627('0x1b')][_0xb627('0x20')]||null:null,'limit':_0xcbd1b4[_0xb627('0x1b')]?_0xcbd1b4[_0xb627('0x1b')][_0xb627('0x21')]||null:null})[_0xb627('0x22')](function(_0x4c8ef7){logger[_0xb627('0x16')]('UpdateSmsQueueReport',_0xcbd1b4);logger[_0xb627('0x11')](_0xb627('0x23'),_0xcbd1b4,JSON[_0xb627('0x1d')](_0x4c8ef7));_0x197fc4(_0x4c8ef7);})[_0xb627('0x1e')](function(_0x5c2e69){logger[_0xb627('0x13')](_0xb627('0x23'),_0x5c2e69['message'],_0xcbd1b4);_0xab01a(_0x563a2e['error'](0x1f4,_0x5c2e69[_0xb627('0x15')]));});});}; \ No newline at end of file +var _0x326b=['create','options','raw','UpdateSmsQueueReport','SmsQueueReport','update','body','where','limit','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','CreateSmsQueueReport'];(function(_0x20714a,_0x7de591){var _0x15e877=function(_0x3f9f8d){while(--_0x3f9f8d){_0x20714a['push'](_0x20714a['shift']());}};_0x15e877(++_0x7de591);}(_0x326b,0x17d));var _0xb326=function(_0x14d896,_0x53578b){_0x14d896=_0x14d896-0x0;var _0x28679a=_0x326b[_0x14d896];return _0x28679a;};'use strict';var _=require(_0xb326('0x0'));var util=require(_0xb326('0x1'));var moment=require(_0xb326('0x2'));var BPromise=require('bluebird');var rs=require(_0xb326('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb326('0x4'))['db'];var utils=require(_0xb326('0x5'));var logger=require(_0xb326('0x6'))(_0xb326('0x7'));var config=require(_0xb326('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb326('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5ba8b5,_0x5f8baa,_0x2da4a4){return new BPromise(function(_0x1cc299,_0x7e81d7){return client[_0xb326('0xa')](_0x5ba8b5,_0x2da4a4)[_0xb326('0xb')](function(_0x3ddced){logger[_0xb326('0xc')](_0xb326('0xd'),_0x5f8baa,_0xb326('0xe'));logger[_0xb326('0xf')]('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x5f8baa,_0xb326('0xe'),JSON[_0xb326('0x10')](_0x3ddced));if(_0x3ddced['error']){if(_0x3ddced['error']['code']===0x1f4){logger[_0xb326('0x11')](_0xb326('0xd'),_0x5f8baa,_0x3ddced['error'][_0xb326('0x12')]);return _0x7e81d7(_0x3ddced[_0xb326('0x11')][_0xb326('0x12')]);}logger[_0xb326('0x11')](_0xb326('0xd'),_0x5f8baa,_0x3ddced[_0xb326('0x11')][_0xb326('0x12')]);return _0x1cc299(_0x3ddced[_0xb326('0x11')]['message']);}else{logger['info'](_0xb326('0xd'),_0x5f8baa,'request\x20sent');_0x1cc299(_0x3ddced[_0xb326('0x13')][_0xb326('0x12')]);}})[_0xb326('0x14')](function(_0x4ed883){logger[_0xb326('0x11')](_0xb326('0xd'),_0x5f8baa,_0x4ed883);_0x7e81d7(_0x4ed883);});});}exports[_0xb326('0x15')]=function(_0x394b03){var _0x3a87b2=this;return new Promise(function(_0x387ab9,_0x54087b){return db['SmsQueueReport'][_0xb326('0x16')](_0x394b03['body'],{'raw':_0x394b03[_0xb326('0x17')]?_0x394b03[_0xb326('0x17')][_0xb326('0x18')]===undefined?!![]:![]:!![]})[_0xb326('0xb')](function(_0x2e2548){logger['info'](_0xb326('0x15'),_0x394b03);logger[_0xb326('0xf')](_0xb326('0x15'),_0x394b03,JSON['stringify'](_0x2e2548));_0x387ab9(_0x2e2548);})[_0xb326('0x14')](function(_0x22dee5){logger[_0xb326('0x11')](_0xb326('0x15'),_0x22dee5['message'],_0x394b03);_0x54087b(_0x3a87b2[_0xb326('0x11')](0x1f4,_0x22dee5[_0xb326('0x12')]));});});};exports[_0xb326('0x19')]=function(_0x3a2c00){var _0x2827ca=this;return new Promise(function(_0x521f28,_0x4441ff){return db[_0xb326('0x1a')][_0xb326('0x1b')](_0x3a2c00[_0xb326('0x1c')],{'raw':_0x3a2c00[_0xb326('0x17')]?_0x3a2c00[_0xb326('0x17')][_0xb326('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3a2c00[_0xb326('0x17')]?_0x3a2c00[_0xb326('0x17')][_0xb326('0x1d')]||null:null,'attributes':_0x3a2c00[_0xb326('0x17')]?_0x3a2c00[_0xb326('0x17')]['attributes']||null:null,'limit':_0x3a2c00[_0xb326('0x17')]?_0x3a2c00['options'][_0xb326('0x1e')]||null:null})[_0xb326('0xb')](function(_0x35a124){logger[_0xb326('0xc')](_0xb326('0x19'),_0x3a2c00);logger[_0xb326('0xf')](_0xb326('0x19'),_0x3a2c00,JSON[_0xb326('0x10')](_0x35a124));_0x521f28(_0x35a124);})[_0xb326('0x14')](function(_0x1fcb83){logger[_0xb326('0x11')](_0xb326('0x19'),_0x1fcb83['message'],_0x3a2c00);_0x4441ff(_0x2827ca['error'](0x1f4,_0x1fcb83[_0xb326('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index f4f9508..b4e311b 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 _0xe107=['/describe','isAuthenticated','describe','create','put','/:id','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../config/environment','./smsTransferReport.controller','get'];(function(_0x1452a8,_0x5318fd){var _0x45e353=function(_0xe561b5){while(--_0xe561b5){_0x1452a8['push'](_0x1452a8['shift']());}};_0x45e353(++_0x5318fd);}(_0xe107,0xb3));var _0x7e10=function(_0xeb2474,_0x1d4285){_0xeb2474=_0xeb2474-0x0;var _0x3db583=_0xe107[_0xeb2474];return _0x3db583;};'use strict';var multer=require(_0x7e10('0x0'));var util=require('util');var path=require(_0x7e10('0x1'));var timeout=require(_0x7e10('0x2'));var express=require(_0x7e10('0x3'));var router=express['Router']();var fs_extra=require(_0x7e10('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7e10('0x5'));var controller=require(_0x7e10('0x6'));router[_0x7e10('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7e10('0x7')](_0x7e10('0x8'),auth[_0x7e10('0x9')](),controller[_0x7e10('0xa')]);router['get']('/:id',auth[_0x7e10('0x9')](),controller['show']);router['post']('/',auth[_0x7e10('0x9')](),controller[_0x7e10('0xb')]);router[_0x7e10('0xc')](_0x7e10('0xd'),auth[_0x7e10('0x9')](),controller['update']);router[_0x7e10('0xe')]('/:id',auth[_0x7e10('0x9')](),controller[_0x7e10('0xf')]);module[_0x7e10('0x10')]=router; \ No newline at end of file +var _0x5c12=['./smsTransferReport.controller','isAuthenticated','index','get','describe','/:id','show','create','put','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x36909d,_0x2795f1){var _0x1fd29d=function(_0x27d0fa){while(--_0x27d0fa){_0x36909d['push'](_0x36909d['shift']());}};_0x1fd29d(++_0x2795f1);}(_0x5c12,0x188));var _0x25c1=function(_0x5d860f,_0x467498){_0x5d860f=_0x5d860f-0x0;var _0x236490=_0x5c12[_0x5d860f];return _0x236490;};'use strict';var multer=require('multer');var util=require(_0x25c1('0x0'));var path=require(_0x25c1('0x1'));var timeout=require('connect-timeout');var express=require(_0x25c1('0x2'));var router=express[_0x25c1('0x3')]();var fs_extra=require(_0x25c1('0x4'));var auth=require(_0x25c1('0x5'));var interaction=require(_0x25c1('0x6'));var config=require(_0x25c1('0x7'));var controller=require(_0x25c1('0x8'));router['get']('/',auth[_0x25c1('0x9')](),controller[_0x25c1('0xa')]);router[_0x25c1('0xb')]('/describe',auth['isAuthenticated'](),controller[_0x25c1('0xc')]);router[_0x25c1('0xb')](_0x25c1('0xd'),auth[_0x25c1('0x9')](),controller[_0x25c1('0xe')]);router['post']('/',auth[_0x25c1('0x9')](),controller[_0x25c1('0xf')]);router[_0x25c1('0x10')](_0x25c1('0xd'),auth[_0x25c1('0x9')](),controller['update']);router[_0x25c1('0x11')](_0x25c1('0xd'),auth['isAuthenticated'](),controller[_0x25c1('0x12')]);module[_0x25c1('0x13')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 2b5856a..2611c76 100644 --- a/server/api/smsTransferReport/smsTransferReport.attributes.js +++ b/server/api/smsTransferReport/smsTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0xcce84a,_0x148a0a){var _0x273e9d=function(_0x318266){while(--_0x318266){_0xcce84a['push'](_0xcce84a['shift']());}};_0x273e9d(++_0x148a0a);}(_0x34e8,0x12c));var _0x834e=function(_0x255b48,_0x11bac0){_0x255b48=_0x255b48-0x0;var _0x62a2b1=_0x34e8[_0x255b48];return _0x62a2b1;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}}; \ No newline at end of file +var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x481e73,_0x3307bc){var _0x5273a6=function(_0x2b560c){while(--_0x2b560c){_0x481e73['push'](_0x481e73['shift']());}};_0x5273a6(++_0x3307bc);}(_0xedd9,0xfc));var _0x9edd=function(_0x3638db,_0x12e712){_0x3638db=_0x3638db-0x0;var _0x3b88ef=_0xedd9[_0x3638db];return _0x3b88ef;};'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/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index c8db077..5e1729c 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 _0x4377=['keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','catch','show','params','length','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','apply','reject','save','update','destroy','then','end','stack','send','index','map','SmsTransferReport','rawAttributes','type','key','model','name','query'];(function(_0x4f950e,_0xd8da7e){var _0x3a8691=function(_0x6be750){while(--_0x6be750){_0x4f950e['push'](_0x4f950e['shift']());}};_0x3a8691(++_0xd8da7e);}(_0x4377,0xfc));var _0x7437=function(_0x3c6471,_0x585535){_0x3c6471=_0x3c6471-0x0;var _0x45d8d8=_0x4377[_0x3c6471];return _0x45d8d8;};'use strict';var emlformat=require(_0x7437('0x0'));var rimraf=require(_0x7437('0x1'));var zipdir=require(_0x7437('0x2'));var jsonpatch=require(_0x7437('0x3'));var rp=require('request-promise');var moment=require(_0x7437('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7437('0x5'));var util=require(_0x7437('0x6'));var path=require(_0x7437('0x7'));var sox=require('sox');var csv=require(_0x7437('0x8'));var ejs=require(_0x7437('0x9'));var fs=require('fs');var fs_extra=require(_0x7437('0xa'));var _=require(_0x7437('0xb'));var squel=require(_0x7437('0xc'));var crypto=require(_0x7437('0xd'));var jsforce=require(_0x7437('0xe'));var deskjs=require(_0x7437('0xf'));var toCsv=require(_0x7437('0x8'));var querystring=require('querystring');var Papa=require(_0x7437('0x10'));var Redis=require(_0x7437('0x11'));var authService=require(_0x7437('0x12'));var qs=require(_0x7437('0x13'));var as=require(_0x7437('0x14'));var hardwareService=require(_0x7437('0x15'));var logger=require(_0x7437('0x16'))(_0x7437('0x17'));var utils=require('../../config/utils');var config=require(_0x7437('0x18'));var licenseUtil=require(_0x7437('0x19'));var db=require(_0x7437('0x1a'))['db'];function respondWithStatusCode(_0x7eeff7,_0x3e1e72){_0x3e1e72=_0x3e1e72||0xcc;return function(_0x231b81){if(_0x231b81){return _0x7eeff7[_0x7437('0x1b')](_0x3e1e72);}return _0x7eeff7[_0x7437('0x1c')](_0x3e1e72)['end']();};}function respondWithResult(_0x297d2d,_0x1e67cd){_0x1e67cd=_0x1e67cd||0xc8;return function(_0x57a1ff){if(_0x57a1ff){return _0x297d2d[_0x7437('0x1c')](_0x1e67cd)[_0x7437('0x1d')](_0x57a1ff);}};}function respondWithFilteredResult(_0x26ce47,_0x1f2b3f){return function(_0x18811b){if(_0x18811b){var _0x3ddb49=typeof _0x1f2b3f[_0x7437('0x1e')]==='undefined'&&typeof _0x1f2b3f[_0x7437('0x1f')]===_0x7437('0x20');var _0x39f328=_0x18811b[_0x7437('0x21')];var _0x6790af=_0x3ddb49?0x0:_0x1f2b3f[_0x7437('0x1e')];var _0x30bb14=_0x3ddb49?_0x18811b[_0x7437('0x21')]:_0x1f2b3f[_0x7437('0x1e')]+_0x1f2b3f[_0x7437('0x1f')];var _0x19e286;if(_0x30bb14>=_0x39f328){_0x30bb14=_0x39f328;_0x19e286=0xc8;}else{_0x19e286=0xce;}_0x26ce47[_0x7437('0x1c')](_0x19e286);return _0x26ce47['set']('Content-Range',_0x6790af+'-'+_0x30bb14+'/'+_0x39f328)[_0x7437('0x1d')](_0x18811b);}return null;};}function patchUpdates(_0xe55cd2){return function(_0x10e0fd){try{jsonpatch[_0x7437('0x22')](_0x10e0fd,_0xe55cd2,!![]);}catch(_0x3a57eb){return BPromise[_0x7437('0x23')](_0x3a57eb);}return _0x10e0fd[_0x7437('0x24')]();};}function saveUpdates(_0x3d7ed7,_0x538393){return function(_0x10e711){if(_0x10e711){return _0x10e711[_0x7437('0x25')](_0x3d7ed7)['then'](function(_0x2839a4){return _0x2839a4;});}return null;};}function removeEntity(_0x2a10a5,_0x4447e8){return function(_0x206355){if(_0x206355){return _0x206355[_0x7437('0x26')]()[_0x7437('0x27')](function(){_0x2a10a5['status'](0xcc)[_0x7437('0x28')]();});}};}function handleEntityNotFound(_0x34123f,_0x4582cb){return function(_0x376dcb){if(!_0x376dcb){_0x34123f['sendStatus'](0x194);}return _0x376dcb;};}function handleError(_0xa88659,_0x4d7919){_0x4d7919=_0x4d7919||0x1f4;return function(_0x2ed06c){logger['error'](_0x2ed06c[_0x7437('0x29')]);if(_0x2ed06c['name']){delete _0x2ed06c['name'];}_0xa88659[_0x7437('0x1c')](_0x4d7919)[_0x7437('0x2a')](_0x2ed06c);};}exports[_0x7437('0x2b')]=function(_0x264188,_0x25fab4){var _0x1ee9b1={},_0x1c7a9a={},_0x7469be={'count':0x0,'rows':[]};var _0x5d2298=_[_0x7437('0x2c')](db[_0x7437('0x2d')][_0x7437('0x2e')],function(_0x51435d){return{'name':_0x51435d['fieldName'],'type':_0x51435d[_0x7437('0x2f')][_0x7437('0x30')]};});_0x1c7a9a[_0x7437('0x31')]=_[_0x7437('0x2c')](_0x5d2298,_0x7437('0x32'));_0x1c7a9a[_0x7437('0x33')]=_[_0x7437('0x34')](_0x264188[_0x7437('0x33')]);_0x1c7a9a[_0x7437('0x35')]=_['intersection'](_0x1c7a9a['model'],_0x1c7a9a[_0x7437('0x33')]);_0x1ee9b1['attributes']=_[_0x7437('0x36')](_0x1c7a9a[_0x7437('0x31')],qs['fields'](_0x264188[_0x7437('0x33')][_0x7437('0x37')]));_0x1ee9b1['attributes']=_0x1ee9b1[_0x7437('0x38')]['length']?_0x1ee9b1[_0x7437('0x38')]:_0x1c7a9a[_0x7437('0x31')];if(!_0x264188[_0x7437('0x33')][_0x7437('0x39')]('nolimit')){_0x1ee9b1[_0x7437('0x1f')]=qs[_0x7437('0x1f')](_0x264188[_0x7437('0x33')][_0x7437('0x1f')]);_0x1ee9b1[_0x7437('0x1e')]=qs[_0x7437('0x1e')](_0x264188[_0x7437('0x33')][_0x7437('0x1e')]);}_0x1ee9b1[_0x7437('0x3a')]=qs[_0x7437('0x3b')](_0x264188[_0x7437('0x33')][_0x7437('0x3b')]);_0x1ee9b1['where']=qs['filters'](_[_0x7437('0x3c')](_0x264188[_0x7437('0x33')],_0x1c7a9a[_0x7437('0x35')]),_0x5d2298);if(_0x264188[_0x7437('0x33')]['filter']){_0x1ee9b1[_0x7437('0x3d')]=_[_0x7437('0x3e')](_0x1ee9b1[_0x7437('0x3d')],{'$or':_[_0x7437('0x2c')](_0x5d2298,function(_0xc37ca1){if(_0xc37ca1[_0x7437('0x2f')]!==_0x7437('0x3f')){var _0x161956={};_0x161956[_0xc37ca1['name']]={'$like':'%'+_0x264188[_0x7437('0x33')][_0x7437('0x40')]+'%'};return _0x161956;}})});}_0x1ee9b1=_[_0x7437('0x3e')]({},_0x1ee9b1,_0x264188[_0x7437('0x41')]);var _0x206e75={'where':_0x1ee9b1[_0x7437('0x3d')]};return db[_0x7437('0x2d')][_0x7437('0x21')](_0x206e75)[_0x7437('0x27')](function(_0x26c678){_0x7469be[_0x7437('0x21')]=_0x26c678;if(_0x264188['query'][_0x7437('0x42')]){_0x1ee9b1[_0x7437('0x43')]=[{'all':!![]}];}return db['SmsTransferReport']['findAll'](_0x1ee9b1);})[_0x7437('0x27')](function(_0xfeeb1e){_0x7469be['rows']=_0xfeeb1e;return _0x7469be;})[_0x7437('0x27')](respondWithFilteredResult(_0x25fab4,_0x1ee9b1))[_0x7437('0x44')](handleError(_0x25fab4,null));};exports[_0x7437('0x45')]=function(_0x546a96,_0x5ae9e5){var _0x348681={'raw':!![],'where':{'id':_0x546a96[_0x7437('0x46')]['id']}},_0x327cd9={};_0x327cd9['model']=_['keys'](db[_0x7437('0x2d')]['rawAttributes']);_0x327cd9[_0x7437('0x33')]=_[_0x7437('0x34')](_0x546a96[_0x7437('0x33')]);_0x327cd9[_0x7437('0x35')]=_[_0x7437('0x36')](_0x327cd9[_0x7437('0x31')],_0x327cd9['query']);_0x348681['attributes']=_[_0x7437('0x36')](_0x327cd9['model'],qs['fields'](_0x546a96[_0x7437('0x33')]['fields']));_0x348681[_0x7437('0x38')]=_0x348681[_0x7437('0x38')][_0x7437('0x47')]?_0x348681[_0x7437('0x38')]:_0x327cd9[_0x7437('0x31')];if(_0x546a96[_0x7437('0x33')]['includeAll']){_0x348681[_0x7437('0x43')]=[{'all':!![]}];}_0x348681=_[_0x7437('0x3e')]({},_0x348681,_0x546a96[_0x7437('0x41')]);return db['SmsTransferReport'][_0x7437('0x48')](_0x348681)[_0x7437('0x27')](handleEntityNotFound(_0x5ae9e5,null))[_0x7437('0x27')](respondWithResult(_0x5ae9e5,null))[_0x7437('0x44')](handleError(_0x5ae9e5,null));};exports[_0x7437('0x49')]=function(_0x21162c,_0x14c664){return db[_0x7437('0x2d')]['create'](_0x21162c['body'],{})[_0x7437('0x27')](respondWithResult(_0x14c664,0xc9))['catch'](handleError(_0x14c664,null));};exports[_0x7437('0x25')]=function(_0xbf82b8,_0x18451c){if(_0xbf82b8[_0x7437('0x4a')]['id']){delete _0xbf82b8[_0x7437('0x4a')]['id'];}return db[_0x7437('0x2d')][_0x7437('0x48')]({'where':{'id':_0xbf82b8[_0x7437('0x46')]['id']}})['then'](handleEntityNotFound(_0x18451c,null))[_0x7437('0x27')](saveUpdates(_0xbf82b8[_0x7437('0x4a')],null))[_0x7437('0x27')](respondWithResult(_0x18451c,null))[_0x7437('0x44')](handleError(_0x18451c,null));};exports['destroy']=function(_0x5c85aa,_0xe8ddbb){return db['SmsTransferReport'][_0x7437('0x48')]({'where':{'id':_0x5c85aa[_0x7437('0x46')]['id']}})[_0x7437('0x27')](handleEntityNotFound(_0xe8ddbb,null))['then'](removeEntity(_0xe8ddbb,null))['catch'](handleError(_0xe8ddbb,null));};exports['describe']=function(_0x3885a4,_0x5ab97c){return db[_0x7437('0x2d')][_0x7437('0x4b')]()[_0x7437('0x27')](respondWithResult(_0x5ab97c,null))[_0x7437('0x44')](handleError(_0x5ab97c,null));}; \ No newline at end of file +var _0x25fc=['sendStatus','error','stack','name','index','map','SmsTransferReport','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','offset','undefined','limit','count','set','Content-Range','json','apply','update','then','end'];(function(_0x5e5c4c,_0x21abba){var _0x176148=function(_0x59522a){while(--_0x59522a){_0x5e5c4c['push'](_0x5e5c4c['shift']());}};_0x176148(++_0x21abba);}(_0x25fc,0x14f));var _0xc25f=function(_0x3c1f33,_0x10a7f2){_0x3c1f33=_0x3c1f33-0x0;var _0x4f87c5=_0x25fc[_0x3c1f33];return _0x4f87c5;};'use strict';var emlformat=require(_0xc25f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc25f('0x1'));var jsonpatch=require(_0xc25f('0x2'));var rp=require(_0xc25f('0x3'));var moment=require(_0xc25f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc25f('0x5'));var util=require('util');var path=require(_0xc25f('0x6'));var sox=require(_0xc25f('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc25f('0x8'));var _=require('lodash');var squel=require(_0xc25f('0x9'));var crypto=require(_0xc25f('0xa'));var jsforce=require(_0xc25f('0xb'));var deskjs=require(_0xc25f('0xc'));var toCsv=require(_0xc25f('0xd'));var querystring=require('querystring');var Papa=require(_0xc25f('0xe'));var Redis=require(_0xc25f('0xf'));var authService=require(_0xc25f('0x10'));var qs=require(_0xc25f('0x11'));var as=require(_0xc25f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc25f('0x13'))('api');var utils=require(_0xc25f('0x14'));var config=require(_0xc25f('0x15'));var licenseUtil=require(_0xc25f('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x50efac,_0x14551e){_0x14551e=_0x14551e||0xcc;return function(_0x34cdc1){if(_0x34cdc1){return _0x50efac['sendStatus'](_0x14551e);}return _0x50efac['status'](_0x14551e)['end']();};}function respondWithResult(_0xf2d8cc,_0x47a650){_0x47a650=_0x47a650||0xc8;return function(_0xd94f8a){if(_0xd94f8a){return _0xf2d8cc[_0xc25f('0x17')](_0x47a650)['json'](_0xd94f8a);}};}function respondWithFilteredResult(_0x5cb18c,_0xab2d1a){return function(_0x6d1974){if(_0x6d1974){var _0x5231a1=typeof _0xab2d1a[_0xc25f('0x18')]===_0xc25f('0x19')&&typeof _0xab2d1a[_0xc25f('0x1a')]==='undefined';var _0x3d57ed=_0x6d1974['count'];var _0x5cbfd9=_0x5231a1?0x0:_0xab2d1a[_0xc25f('0x18')];var _0x28dc6e=_0x5231a1?_0x6d1974[_0xc25f('0x1b')]:_0xab2d1a[_0xc25f('0x18')]+_0xab2d1a[_0xc25f('0x1a')];var _0x8b2f6f;if(_0x28dc6e>=_0x3d57ed){_0x28dc6e=_0x3d57ed;_0x8b2f6f=0xc8;}else{_0x8b2f6f=0xce;}_0x5cb18c['status'](_0x8b2f6f);return _0x5cb18c[_0xc25f('0x1c')](_0xc25f('0x1d'),_0x5cbfd9+'-'+_0x28dc6e+'/'+_0x3d57ed)[_0xc25f('0x1e')](_0x6d1974);}return null;};}function patchUpdates(_0x5645ae){return function(_0x172c75){try{jsonpatch[_0xc25f('0x1f')](_0x172c75,_0x5645ae,!![]);}catch(_0x1ac4f9){return BPromise['reject'](_0x1ac4f9);}return _0x172c75['save']();};}function saveUpdates(_0x40e6dc,_0x244126){return function(_0x3799d8){if(_0x3799d8){return _0x3799d8[_0xc25f('0x20')](_0x40e6dc)[_0xc25f('0x21')](function(_0xb593d1){return _0xb593d1;});}return null;};}function removeEntity(_0x4edd66,_0x18aba0){return function(_0x9845ea){if(_0x9845ea){return _0x9845ea['destroy']()[_0xc25f('0x21')](function(){_0x4edd66[_0xc25f('0x17')](0xcc)[_0xc25f('0x22')]();});}};}function handleEntityNotFound(_0x3c23bb,_0x36c217){return function(_0x42ba89){if(!_0x42ba89){_0x3c23bb[_0xc25f('0x23')](0x194);}return _0x42ba89;};}function handleError(_0x255cec,_0xa1bb2c){_0xa1bb2c=_0xa1bb2c||0x1f4;return function(_0x539d78){logger[_0xc25f('0x24')](_0x539d78[_0xc25f('0x25')]);if(_0x539d78[_0xc25f('0x26')]){delete _0x539d78[_0xc25f('0x26')];}_0x255cec[_0xc25f('0x17')](_0xa1bb2c)['send'](_0x539d78);};}exports[_0xc25f('0x27')]=function(_0x267c3f,_0x3f83b1){var _0x1101d0={},_0x49d2fa={},_0x5610a4={'count':0x0,'rows':[]};var _0x2f671a=_[_0xc25f('0x28')](db[_0xc25f('0x29')][_0xc25f('0x2a')],function(_0x5af4d0){return{'name':_0x5af4d0[_0xc25f('0x2b')],'type':_0x5af4d0[_0xc25f('0x2c')][_0xc25f('0x2d')]};});_0x49d2fa[_0xc25f('0x2e')]=_[_0xc25f('0x28')](_0x2f671a,_0xc25f('0x26'));_0x49d2fa['query']=_[_0xc25f('0x2f')](_0x267c3f[_0xc25f('0x30')]);_0x49d2fa[_0xc25f('0x31')]=_['intersection'](_0x49d2fa[_0xc25f('0x2e')],_0x49d2fa['query']);_0x1101d0[_0xc25f('0x32')]=_[_0xc25f('0x33')](_0x49d2fa['model'],qs['fields'](_0x267c3f[_0xc25f('0x30')][_0xc25f('0x34')]));_0x1101d0[_0xc25f('0x32')]=_0x1101d0[_0xc25f('0x32')][_0xc25f('0x35')]?_0x1101d0['attributes']:_0x49d2fa[_0xc25f('0x2e')];if(!_0x267c3f[_0xc25f('0x30')]['hasOwnProperty'](_0xc25f('0x36'))){_0x1101d0[_0xc25f('0x1a')]=qs[_0xc25f('0x1a')](_0x267c3f[_0xc25f('0x30')][_0xc25f('0x1a')]);_0x1101d0[_0xc25f('0x18')]=qs[_0xc25f('0x18')](_0x267c3f[_0xc25f('0x30')][_0xc25f('0x18')]);}_0x1101d0[_0xc25f('0x37')]=qs[_0xc25f('0x38')](_0x267c3f[_0xc25f('0x30')][_0xc25f('0x38')]);_0x1101d0['where']=qs[_0xc25f('0x31')](_[_0xc25f('0x39')](_0x267c3f[_0xc25f('0x30')],_0x49d2fa[_0xc25f('0x31')]),_0x2f671a);if(_0x267c3f['query'][_0xc25f('0x3a')]){_0x1101d0[_0xc25f('0x3b')]=_['merge'](_0x1101d0[_0xc25f('0x3b')],{'$or':_[_0xc25f('0x28')](_0x2f671a,function(_0x2930f7){if(_0x2930f7[_0xc25f('0x2c')]!==_0xc25f('0x3c')){var _0x2bf14f={};_0x2bf14f[_0x2930f7[_0xc25f('0x26')]]={'$like':'%'+_0x267c3f[_0xc25f('0x30')][_0xc25f('0x3a')]+'%'};return _0x2bf14f;}})});}_0x1101d0=_[_0xc25f('0x3d')]({},_0x1101d0,_0x267c3f[_0xc25f('0x3e')]);var _0x7b0c84={'where':_0x1101d0['where']};return db[_0xc25f('0x29')][_0xc25f('0x1b')](_0x7b0c84)[_0xc25f('0x21')](function(_0x30aaa5){_0x5610a4[_0xc25f('0x1b')]=_0x30aaa5;if(_0x267c3f['query'][_0xc25f('0x3f')]){_0x1101d0[_0xc25f('0x40')]=[{'all':!![]}];}return db[_0xc25f('0x29')][_0xc25f('0x41')](_0x1101d0);})['then'](function(_0x124883){_0x5610a4[_0xc25f('0x42')]=_0x124883;return _0x5610a4;})['then'](respondWithFilteredResult(_0x3f83b1,_0x1101d0))[_0xc25f('0x43')](handleError(_0x3f83b1,null));};exports[_0xc25f('0x44')]=function(_0x405525,_0x1f9c53){var _0x2c2a3a={'raw':!![],'where':{'id':_0x405525[_0xc25f('0x45')]['id']}},_0x1b806f={};_0x1b806f[_0xc25f('0x2e')]=_[_0xc25f('0x2f')](db['SmsTransferReport'][_0xc25f('0x2a')]);_0x1b806f[_0xc25f('0x30')]=_[_0xc25f('0x2f')](_0x405525['query']);_0x1b806f[_0xc25f('0x31')]=_[_0xc25f('0x33')](_0x1b806f[_0xc25f('0x2e')],_0x1b806f[_0xc25f('0x30')]);_0x2c2a3a[_0xc25f('0x32')]=_['intersection'](_0x1b806f['model'],qs[_0xc25f('0x34')](_0x405525[_0xc25f('0x30')]['fields']));_0x2c2a3a[_0xc25f('0x32')]=_0x2c2a3a[_0xc25f('0x32')][_0xc25f('0x35')]?_0x2c2a3a['attributes']:_0x1b806f[_0xc25f('0x2e')];if(_0x405525[_0xc25f('0x30')][_0xc25f('0x3f')]){_0x2c2a3a[_0xc25f('0x40')]=[{'all':!![]}];}_0x2c2a3a=_[_0xc25f('0x3d')]({},_0x2c2a3a,_0x405525['options']);return db[_0xc25f('0x29')]['find'](_0x2c2a3a)[_0xc25f('0x21')](handleEntityNotFound(_0x1f9c53,null))[_0xc25f('0x21')](respondWithResult(_0x1f9c53,null))[_0xc25f('0x43')](handleError(_0x1f9c53,null));};exports[_0xc25f('0x46')]=function(_0x416aa2,_0x32738f){return db[_0xc25f('0x29')]['create'](_0x416aa2[_0xc25f('0x47')],{})['then'](respondWithResult(_0x32738f,0xc9))[_0xc25f('0x43')](handleError(_0x32738f,null));};exports[_0xc25f('0x20')]=function(_0x3148a4,_0x59eb1d){if(_0x3148a4[_0xc25f('0x47')]['id']){delete _0x3148a4[_0xc25f('0x47')]['id'];}return db[_0xc25f('0x29')][_0xc25f('0x48')]({'where':{'id':_0x3148a4[_0xc25f('0x45')]['id']}})['then'](handleEntityNotFound(_0x59eb1d,null))['then'](saveUpdates(_0x3148a4[_0xc25f('0x47')],null))['then'](respondWithResult(_0x59eb1d,null))[_0xc25f('0x43')](handleError(_0x59eb1d,null));};exports[_0xc25f('0x49')]=function(_0x54a842,_0x3c9967){return db[_0xc25f('0x29')]['find']({'where':{'id':_0x54a842[_0xc25f('0x45')]['id']}})[_0xc25f('0x21')](handleEntityNotFound(_0x3c9967,null))['then'](removeEntity(_0x3c9967,null))[_0xc25f('0x43')](handleError(_0x3c9967,null));};exports['describe']=function(_0x7b7e98,_0x5df4ee){return db[_0xc25f('0x29')]['describe']()[_0xc25f('0x21')](respondWithResult(_0x5df4ee,null))['catch'](handleError(_0x5df4ee,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 34d276f..d45e219 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 _0x569b=['rimraf','./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash','util','api','moment','bluebird','path'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x569b,0x173));var _0xb569=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x569b[_0x178e48];return _0x440d7e;};'use strict';var _=require(_0xb569('0x0'));var util=require(_0xb569('0x1'));var logger=require('../../config/logger')(_0xb569('0x2'));var moment=require(_0xb569('0x3'));var BPromise=require(_0xb569('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb569('0x5'));var rimraf=require(_0xb569('0x6'));var config=require('../../config/environment');var attributes=require(_0xb569('0x7'));module[_0xb569('0x8')]=function(_0x1730b2,_0x4ab4e4){return _0x1730b2[_0xb569('0x9')](_0xb569('0xa'),attributes,{'tableName':_0xb569('0xb'),'paranoid':![],'indexes':[{'name':_0xb569('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xa181=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SmsTransferReport','report_sms_transfer','uniqueid'];(function(_0xae0c01,_0x449c99){var _0x913e86=function(_0x421e87){while(--_0x421e87){_0xae0c01['push'](_0xae0c01['shift']());}};_0x913e86(++_0x449c99);}(_0xa181,0x10a));var _0x1a18=function(_0x1ea418,_0x1953b7){_0x1ea418=_0x1ea418-0x0;var _0x2c96cf=_0xa181[_0x1ea418];return _0x2c96cf;};'use strict';var _=require(_0x1a18('0x0'));var util=require(_0x1a18('0x1'));var logger=require(_0x1a18('0x2'))('api');var moment=require(_0x1a18('0x3'));var BPromise=require(_0x1a18('0x4'));var rp=require(_0x1a18('0x5'));var fs=require('fs');var path=require(_0x1a18('0x6'));var rimraf=require(_0x1a18('0x7'));var config=require(_0x1a18('0x8'));var attributes=require('./smsTransferReport.attributes');module[_0x1a18('0x9')]=function(_0x501ea2,_0x246a4e){return _0x501ea2[_0x1a18('0xa')](_0x1a18('0xb'),attributes,{'tableName':_0x1a18('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x1a18('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index d84642b..c80853f 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 _0x0734=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird'];(function(_0x4e8c7f,_0x5c760f){var _0x2a05f3=function(_0x2f0a04){while(--_0x2f0a04){_0x4e8c7f['push'](_0x4e8c7f['shift']());}};_0x2a05f3(++_0x5c760f);}(_0x0734,0xba));var _0x4073=function(_0xd3476d,_0x5808c4){_0xd3476d=_0xd3476d-0x0;var _0x1d7e69=_0x0734[_0xd3476d];return _0x1d7e69;};'use strict';var _=require(_0x4073('0x0'));var util=require(_0x4073('0x1'));var moment=require(_0x4073('0x2'));var BPromise=require(_0x4073('0x3'));var rs=require(_0x4073('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4073('0x5'))['db'];var utils=require(_0x4073('0x6'));var logger=require(_0x4073('0x7'))(_0x4073('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4073('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2c3c14,_0x2195e0,_0x1251bd){return new BPromise(function(_0x22a33d,_0x51515d){return client[_0x4073('0xa')](_0x2c3c14,_0x1251bd)['then'](function(_0x5432c4){logger[_0x4073('0xb')](_0x4073('0xc'),_0x2195e0,_0x4073('0xd'));logger['debug']('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x2195e0,_0x4073('0xd'),JSON[_0x4073('0xe')](_0x5432c4));if(_0x5432c4['error']){if(_0x5432c4[_0x4073('0xf')]['code']===0x1f4){logger[_0x4073('0xf')](_0x4073('0xc'),_0x2195e0,_0x5432c4[_0x4073('0xf')][_0x4073('0x10')]);return _0x51515d(_0x5432c4['error'][_0x4073('0x10')]);}logger[_0x4073('0xf')]('SmsTransferReport,\x20%s,\x20%s',_0x2195e0,_0x5432c4[_0x4073('0xf')][_0x4073('0x10')]);return _0x22a33d(_0x5432c4[_0x4073('0xf')][_0x4073('0x10')]);}else{logger[_0x4073('0xb')](_0x4073('0xc'),_0x2195e0,'request\x20sent');_0x22a33d(_0x5432c4[_0x4073('0x11')]['message']);}})[_0x4073('0x12')](function(_0x38ea09){logger['error'](_0x4073('0xc'),_0x2195e0,_0x38ea09);_0x51515d(_0x38ea09);});});} \ No newline at end of file +var _0x7579=['message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x17925d,_0x46543f){var _0x5492b7=function(_0x413f0b){while(--_0x413f0b){_0x17925d['push'](_0x17925d['shift']());}};_0x5492b7(++_0x46543f);}(_0x7579,0x1e2));var _0x9757=function(_0xa99993,_0xeaee02){_0xa99993=_0xa99993-0x0;var _0x4cba3d=_0x7579[_0xa99993];return _0x4cba3d;};'use strict';var _=require(_0x9757('0x0'));var util=require(_0x9757('0x1'));var moment=require(_0x9757('0x2'));var BPromise=require(_0x9757('0x3'));var rs=require(_0x9757('0x4'));var fs=require('fs');var Redis=require(_0x9757('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x9757('0x6'));var logger=require(_0x9757('0x7'))(_0x9757('0x8'));var config=require(_0x9757('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9757('0xa')][_0x9757('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4757e9,_0x4b5446,_0x28a14a){return new BPromise(function(_0x51a1c8,_0x2d65dd){return client[_0x9757('0xc')](_0x4757e9,_0x28a14a)[_0x9757('0xd')](function(_0x5b5749){logger[_0x9757('0xe')](_0x9757('0xf'),_0x4b5446,_0x9757('0x10'));logger[_0x9757('0x11')](_0x9757('0x12'),_0x4b5446,_0x9757('0x10'),JSON[_0x9757('0x13')](_0x5b5749));if(_0x5b5749[_0x9757('0x14')]){if(_0x5b5749[_0x9757('0x14')][_0x9757('0x15')]===0x1f4){logger[_0x9757('0x14')]('SmsTransferReport,\x20%s,\x20%s',_0x4b5446,_0x5b5749[_0x9757('0x14')][_0x9757('0x16')]);return _0x2d65dd(_0x5b5749[_0x9757('0x14')]['message']);}logger[_0x9757('0x14')](_0x9757('0xf'),_0x4b5446,_0x5b5749[_0x9757('0x14')][_0x9757('0x16')]);return _0x51a1c8(_0x5b5749[_0x9757('0x14')][_0x9757('0x16')]);}else{logger[_0x9757('0xe')]('SmsTransferReport,\x20%s,\x20%s',_0x4b5446,_0x9757('0x10'));_0x51a1c8(_0x5b5749['result'][_0x9757('0x16')]);}})[_0x9757('0x17')](function(_0xad2a22){logger[_0x9757('0x14')](_0x9757('0xf'),_0x4b5446,_0xad2a22);_0x2d65dd(_0xad2a22);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 6120c2e..8aa653b 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 _0x7be7=['show','download','root','originalname','replace','format','basename','extname','post','single','file','create','delete','exports','multer','util','fs-extra','../../components/interaction/service','./sound.controller','get','isAuthenticated','index','/:id'];(function(_0x5e75f2,_0x1962db){var _0x12fa92=function(_0x51e0f9){while(--_0x51e0f9){_0x5e75f2['push'](_0x5e75f2['shift']());}};_0x12fa92(++_0x1962db);}(_0x7be7,0x1da));var _0x77be=function(_0x4895c4,_0xde5115){_0x4895c4=_0x4895c4-0x0;var _0x177c0c=_0x7be7[_0x4895c4];return _0x177c0c;};'use strict';var multer=require(_0x77be('0x0'));var util=require(_0x77be('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x77be('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x77be('0x3'));var config=require('../../config/environment');var controller=require(_0x77be('0x4'));router[_0x77be('0x5')]('/',auth[_0x77be('0x6')](),controller[_0x77be('0x7')]);router[_0x77be('0x5')](_0x77be('0x8'),auth[_0x77be('0x6')](),controller[_0x77be('0x9')]);router['get']('/:id/download',auth[_0x77be('0x6')](),controller[_0x77be('0xa')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x43533b,_0x2c864d,_0x99a49c){_0x99a49c(null,path['join'](config[_0x77be('0xb')],'server/files/sounds/original/'));},'filename':function(_0x2060bd,_0x5ca335,_0x48095a){_0x5ca335[_0x77be('0xc')]=_0x5ca335[_0x77be('0xc')][_0x77be('0xd')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x48095a(null,util[_0x77be('0xe')]('%s-%s%s',path[_0x77be('0xf')](_0x5ca335['originalname'],path[_0x77be('0x10')](_0x5ca335[_0x77be('0xc')])),Date['now'](),path[_0x77be('0x10')](_0x5ca335[_0x77be('0xc')])));}})});router[_0x77be('0x11')]('/',upload[_0x77be('0x12')](_0x77be('0x13')),controller[_0x77be('0x14')]);router['put']('/:id',auth[_0x77be('0x6')](),controller['update']);router[_0x77be('0x15')](_0x77be('0x8'),auth[_0x77be('0x6')](),controller[_0x77be('0x15')]);module[_0x77be('0x16')]=router; \ No newline at end of file +var _0x3e17=['../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','index','download','diskStorage','join','root','originalname','replace','format','basename','extname','now','post','create','put','/:id','delete','exports','multer','util','path','Router','fs-extra','../../components/auth/service'];(function(_0x59bb70,_0x2e6b53){var _0x3a75b6=function(_0x50337d){while(--_0x50337d){_0x59bb70['push'](_0x59bb70['shift']());}};_0x3a75b6(++_0x2e6b53);}(_0x3e17,0x1d6));var _0x73e1=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x3e17[_0x4565bf];return _0x5610ba;};'use strict';var multer=require(_0x73e1('0x0'));var util=require(_0x73e1('0x1'));var path=require(_0x73e1('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x73e1('0x3')]();var fs_extra=require(_0x73e1('0x4'));var auth=require(_0x73e1('0x5'));var interaction=require(_0x73e1('0x6'));var config=require(_0x73e1('0x7'));var controller=require(_0x73e1('0x8'));router[_0x73e1('0x9')]('/',auth[_0x73e1('0xa')](),controller[_0x73e1('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router['get']('/:id/download',auth[_0x73e1('0xa')](),controller[_0x73e1('0xc')]);var upload=multer({'storage':multer[_0x73e1('0xd')]({'destination':function(_0x16f96d,_0x36cc2f,_0x1e4de7){_0x1e4de7(null,path[_0x73e1('0xe')](config[_0x73e1('0xf')],'server/files/sounds/original/'));},'filename':function(_0x799258,_0x84d8b5,_0x1399a0){_0x84d8b5['originalname']=_0x84d8b5[_0x73e1('0x10')][_0x73e1('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1399a0(null,util[_0x73e1('0x12')]('%s-%s%s',path[_0x73e1('0x13')](_0x84d8b5[_0x73e1('0x10')],path[_0x73e1('0x14')](_0x84d8b5[_0x73e1('0x10')])),Date[_0x73e1('0x15')](),path['extname'](_0x84d8b5[_0x73e1('0x10')])));}})});router[_0x73e1('0x16')]('/',upload['single']('file'),controller[_0x73e1('0x17')]);router[_0x73e1('0x18')](_0x73e1('0x19'),auth[_0x73e1('0xa')](),controller['update']);router['delete']('/:id',auth[_0x73e1('0xa')](),controller[_0x73e1('0x1a')]);module[_0x73e1('0x1b')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 15e8bf6..20f2e7b 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 _0xd1ef=['FLOAT','BIGINT','INTEGER','sequelize','exports','STRING','name'];(function(_0x13b124,_0x1523e1){var _0x38f79f=function(_0x4970cf){while(--_0x4970cf){_0x13b124['push'](_0x13b124['shift']());}};_0x38f79f(++_0x1523e1);}(_0xd1ef,0x8f));var _0xfd1e=function(_0x422ed2,_0x538e3b){_0x422ed2=_0x422ed2-0x0;var _0x4e170e=_0xd1ef[_0x422ed2];return _0x4e170e;};'use strict';var Sequelize=require(_0xfd1e('0x0'));module[_0xfd1e('0x1')]={'name':{'type':Sequelize[_0xfd1e('0x2')],'unique':_0xfd1e('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0xfd1e('0x2')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0xfd1e('0x2')]},'original_duration':{'type':Sequelize[_0xfd1e('0x4')]},'original_sampleCount':{'type':Sequelize[_0xfd1e('0x5')]},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize[_0xfd1e('0x5')]},'original_sampleRate':{'type':Sequelize[_0xfd1e('0x6')]},'converted_format':{'type':Sequelize[_0xfd1e('0x2')]},'converted_duration':{'type':Sequelize[_0xfd1e('0x4')]},'converted_sampleCount':{'type':Sequelize[_0xfd1e('0x5')]},'converted_channelCount':{'type':Sequelize[_0xfd1e('0x6')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0xfd1e('0x6')]}}; \ No newline at end of file +var _0x7aa6=['name','STRING','BIGINT','INTEGER','FLOAT','sequelize','exports'];(function(_0x4b7b69,_0x3ab075){var _0x173b4c=function(_0x234d5f){while(--_0x234d5f){_0x4b7b69['push'](_0x4b7b69['shift']());}};_0x173b4c(++_0x3ab075);}(_0x7aa6,0x163));var _0x67aa=function(_0xbd7194,_0x4a5e9d){_0xbd7194=_0xbd7194-0x0;var _0x135dcc=_0x7aa6[_0xbd7194];return _0x135dcc;};'use strict';var Sequelize=require(_0x67aa('0x0'));module[_0x67aa('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x67aa('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0x67aa('0x3')]},'display_name':{'type':Sequelize[_0x67aa('0x3')],'defaultValue':''},'description':{'type':Sequelize[_0x67aa('0x3')]},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize[_0x67aa('0x4')]},'original_channelCount':{'type':Sequelize[_0x67aa('0x5')]},'original_bitRate':{'type':Sequelize[_0x67aa('0x4')]},'original_sampleRate':{'type':Sequelize[_0x67aa('0x5')]},'converted_format':{'type':Sequelize[_0x67aa('0x3')]},'converted_duration':{'type':Sequelize[_0x67aa('0x6')]},'converted_sampleCount':{'type':Sequelize[_0x67aa('0x4')]},'converted_channelCount':{'type':Sequelize[_0x67aa('0x5')]},'converted_bitRate':{'type':Sequelize[_0x67aa('0x4')]},'converted_sampleRate':{'type':Sequelize[_0x67aa('0x5')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index b813b49..51008ee 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 _0x9f69=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','update','then','destroy','get','Sounds','UserProfileResource','stack','name','index','map','Sound','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','download','save_name','converted_format','existsSync','join','root','Sequelize','ValidationError','Sound\x20not\x20found','server/files/sounds/converted','format','%s.%s','file','originalname','basename','filename','extname','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20destination:\x20%s','transcode','error','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','chmodSync','create','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','description','delete','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse'];(function(_0x56d259,_0x88968d){var _0x5a65bb=function(_0x402f4f){while(--_0x402f4f){_0x56d259['push'](_0x56d259['shift']());}};_0x5a65bb(++_0x88968d);}(_0x9f69,0x169));var _0x99f6=function(_0x407399,_0x28a31f){_0x407399=_0x407399-0x0;var _0x5e9ae9=_0x9f69[_0x407399];return _0x5e9ae9;};'use strict';var emlformat=require(_0x99f6('0x0'));var rimraf=require(_0x99f6('0x1'));var zipdir=require(_0x99f6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x99f6('0x3'));var moment=require(_0x99f6('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x99f6('0x5'));var util=require(_0x99f6('0x6'));var path=require(_0x99f6('0x7'));var sox=require(_0x99f6('0x8'));var csv=require(_0x99f6('0x9'));var ejs=require(_0x99f6('0xa'));var fs=require('fs');var fs_extra=require(_0x99f6('0xb'));var _=require('lodash');var squel=require(_0x99f6('0xc'));var crypto=require(_0x99f6('0xd'));var jsforce=require(_0x99f6('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x99f6('0x9'));var querystring=require(_0x99f6('0xf'));var Papa=require(_0x99f6('0x10'));var Redis=require(_0x99f6('0x11'));var authService=require(_0x99f6('0x12'));var qs=require(_0x99f6('0x13'));var as=require(_0x99f6('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x99f6('0x15'))(_0x99f6('0x16'));var utils=require(_0x99f6('0x17'));var config=require(_0x99f6('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x99f6('0x19'))['db'];function respondWithStatusCode(_0x4cb3c2,_0x58af98){_0x58af98=_0x58af98||0xcc;return function(_0x5508d5){if(_0x5508d5){return _0x4cb3c2[_0x99f6('0x1a')](_0x58af98);}return _0x4cb3c2[_0x99f6('0x1b')](_0x58af98)[_0x99f6('0x1c')]();};}function respondWithResult(_0xde07bf,_0x23b12d){_0x23b12d=_0x23b12d||0xc8;return function(_0x3d172c){if(_0x3d172c){return _0xde07bf[_0x99f6('0x1b')](_0x23b12d)[_0x99f6('0x1d')](_0x3d172c);}};}function respondWithFilteredResult(_0x4eddde,_0x454905){return function(_0x21192b){if(_0x21192b){var _0x56d256=typeof _0x454905[_0x99f6('0x1e')]===_0x99f6('0x1f')&&typeof _0x454905['limit']===_0x99f6('0x1f');var _0x3bff91=_0x21192b[_0x99f6('0x20')];var _0x2f5854=_0x56d256?0x0:_0x454905[_0x99f6('0x1e')];var _0x3767a8=_0x56d256?_0x21192b['count']:_0x454905[_0x99f6('0x1e')]+_0x454905[_0x99f6('0x21')];var _0x121386;if(_0x3767a8>=_0x3bff91){_0x3767a8=_0x3bff91;_0x121386=0xc8;}else{_0x121386=0xce;}_0x4eddde[_0x99f6('0x1b')](_0x121386);return _0x4eddde['set'](_0x99f6('0x22'),_0x2f5854+'-'+_0x3767a8+'/'+_0x3bff91)[_0x99f6('0x1d')](_0x21192b);}return null;};}function patchUpdates(_0x56b996){return function(_0x3cdfc4){try{jsonpatch[_0x99f6('0x23')](_0x3cdfc4,_0x56b996,!![]);}catch(_0x470a4c){return BPromise[_0x99f6('0x24')](_0x470a4c);}return _0x3cdfc4['save']();};}function saveUpdates(_0x514986,_0x538f72){return function(_0x469b41){if(_0x469b41){return _0x469b41[_0x99f6('0x25')](_0x514986)[_0x99f6('0x26')](function(_0x3525be){return _0x3525be;});}return null;};}function removeEntity(_0xf1473a,_0x539ba6){return function(_0x5655ea){if(_0x5655ea){return _0x5655ea[_0x99f6('0x27')]()[_0x99f6('0x26')](function(){var _0x2de871=_0x5655ea[_0x99f6('0x28')]({'plain':!![]});var _0x25a539=_0x99f6('0x29');return db[_0x99f6('0x2a')][_0x99f6('0x27')]({'where':{'type':_0x25a539,'resourceId':_0x2de871['id']}})[_0x99f6('0x26')](function(){return _0x5655ea;});})[_0x99f6('0x26')](function(){_0xf1473a[_0x99f6('0x1b')](0xcc)[_0x99f6('0x1c')]();});}};}function handleEntityNotFound(_0x194620,_0x9ef021){return function(_0x188514){if(!_0x188514){_0x194620['sendStatus'](0x194);}return _0x188514;};}function handleError(_0x1873a1,_0x5b7286){_0x5b7286=_0x5b7286||0x1f4;return function(_0x414898){logger['error'](_0x414898[_0x99f6('0x2b')]);if(_0x414898[_0x99f6('0x2c')]){delete _0x414898[_0x99f6('0x2c')];}_0x1873a1[_0x99f6('0x1b')](_0x5b7286)['send'](_0x414898);};}exports[_0x99f6('0x2d')]=function(_0x15cbca,_0x5a1557){var _0xeab9ce={},_0x5ea8ff={},_0x4cd758={'count':0x0,'rows':[]};var _0x175fa9=_[_0x99f6('0x2e')](db[_0x99f6('0x2f')][_0x99f6('0x30')],function(_0x2a9850){return{'name':_0x2a9850['fieldName'],'type':_0x2a9850[_0x99f6('0x31')][_0x99f6('0x32')]};});_0x5ea8ff['model']=_[_0x99f6('0x2e')](_0x175fa9,'name');_0x5ea8ff[_0x99f6('0x33')]=_[_0x99f6('0x34')](_0x15cbca[_0x99f6('0x33')]);_0x5ea8ff[_0x99f6('0x35')]=_[_0x99f6('0x36')](_0x5ea8ff[_0x99f6('0x37')],_0x5ea8ff[_0x99f6('0x33')]);_0xeab9ce[_0x99f6('0x38')]=_[_0x99f6('0x36')](_0x5ea8ff[_0x99f6('0x37')],qs[_0x99f6('0x39')](_0x15cbca[_0x99f6('0x33')][_0x99f6('0x39')]));_0xeab9ce['attributes']=_0xeab9ce[_0x99f6('0x38')]['length']?_0xeab9ce[_0x99f6('0x38')]:_0x5ea8ff['model'];if(!_0x15cbca[_0x99f6('0x33')]['hasOwnProperty'](_0x99f6('0x3a'))){_0xeab9ce['limit']=qs[_0x99f6('0x21')](_0x15cbca[_0x99f6('0x33')][_0x99f6('0x21')]);_0xeab9ce[_0x99f6('0x1e')]=qs[_0x99f6('0x1e')](_0x15cbca['query'][_0x99f6('0x1e')]);}_0xeab9ce[_0x99f6('0x3b')]=qs[_0x99f6('0x3c')](_0x15cbca['query'][_0x99f6('0x3c')]);_0xeab9ce[_0x99f6('0x3d')]=qs[_0x99f6('0x35')](_[_0x99f6('0x3e')](_0x15cbca[_0x99f6('0x33')],_0x5ea8ff['filters']),_0x175fa9);if(_0x15cbca['query'][_0x99f6('0x3f')]){_0xeab9ce[_0x99f6('0x3d')]=_[_0x99f6('0x40')](_0xeab9ce[_0x99f6('0x3d')],{'$or':_[_0x99f6('0x2e')](_0x175fa9,function(_0x449f33){if(_0x449f33[_0x99f6('0x31')]!==_0x99f6('0x41')){var _0x1cc043={};_0x1cc043[_0x449f33[_0x99f6('0x2c')]]={'$like':'%'+_0x15cbca['query'][_0x99f6('0x3f')]+'%'};return _0x1cc043;}})});}_0xeab9ce=_[_0x99f6('0x40')]({},_0xeab9ce,_0x15cbca[_0x99f6('0x42')]);var _0xf5f2b9={'where':_0xeab9ce['where']};return db['Sound'][_0x99f6('0x20')](_0xf5f2b9)[_0x99f6('0x26')](function(_0x5ca9b3){_0x4cd758[_0x99f6('0x20')]=_0x5ca9b3;if(_0x15cbca[_0x99f6('0x33')][_0x99f6('0x43')]){_0xeab9ce[_0x99f6('0x44')]=[{'all':!![]}];}return db['Sound'][_0x99f6('0x45')](_0xeab9ce);})['then'](function(_0x3372c2){_0x4cd758[_0x99f6('0x46')]=_0x3372c2;return _0x4cd758;})[_0x99f6('0x26')](respondWithFilteredResult(_0x5a1557,_0xeab9ce))[_0x99f6('0x47')](handleError(_0x5a1557,null));};exports[_0x99f6('0x48')]=function(_0x3fdc45,_0x41c523){var _0x4a611f={'raw':!![],'where':{'id':_0x3fdc45[_0x99f6('0x49')]['id']}},_0x47e83d={};_0x47e83d[_0x99f6('0x37')]=_[_0x99f6('0x34')](db[_0x99f6('0x2f')][_0x99f6('0x30')]);_0x47e83d[_0x99f6('0x33')]=_[_0x99f6('0x34')](_0x3fdc45[_0x99f6('0x33')]);_0x47e83d[_0x99f6('0x35')]=_['intersection'](_0x47e83d['model'],_0x47e83d[_0x99f6('0x33')]);_0x4a611f[_0x99f6('0x38')]=_['intersection'](_0x47e83d[_0x99f6('0x37')],qs['fields'](_0x3fdc45['query'][_0x99f6('0x39')]));_0x4a611f[_0x99f6('0x38')]=_0x4a611f['attributes'][_0x99f6('0x4a')]?_0x4a611f[_0x99f6('0x38')]:_0x47e83d['model'];if(_0x3fdc45[_0x99f6('0x33')]['includeAll']){_0x4a611f[_0x99f6('0x44')]=[{'all':!![]}];}_0x4a611f=_[_0x99f6('0x40')]({},_0x4a611f,_0x3fdc45['options']);return db[_0x99f6('0x2f')][_0x99f6('0x4b')](_0x4a611f)[_0x99f6('0x26')](handleEntityNotFound(_0x41c523,null))[_0x99f6('0x26')](respondWithResult(_0x41c523,null))['catch'](handleError(_0x41c523,null));};exports[_0x99f6('0x4c')]=function(_0x175329,_0x313fbb,_0x12779d){return db['Sound'][_0x99f6('0x4b')]({'where':{'id':_0x175329[_0x99f6('0x49')]['id']},'attributes':[_0x99f6('0x2c'),_0x99f6('0x4d'),_0x99f6('0x4e')],'raw':!![]})[_0x99f6('0x26')](handleEntityNotFound(_0x313fbb,null))[_0x99f6('0x26')](function(_0x388d03){if(_0x388d03){if(!fs[_0x99f6('0x4f')](path[_0x99f6('0x50')](config[_0x99f6('0x51')],'server/files/sounds/converted',_0x388d03['save_name']+'.'+_0x388d03[_0x99f6('0x4e')]))){throw new db[(_0x99f6('0x52'))][(_0x99f6('0x53'))](_0x99f6('0x54'));}return _0x313fbb['download'](path[_0x99f6('0x50')](config[_0x99f6('0x51')],_0x99f6('0x55'),util[_0x99f6('0x56')](_0x99f6('0x57'),_0x388d03[_0x99f6('0x4d')],_0x388d03['converted_format'])),util['format'](_0x99f6('0x57'),_0x388d03[_0x99f6('0x2c')],_0x388d03['converted_format']));}return null;})[_0x99f6('0x47')](handleError(_0x313fbb,null));};exports['create']=function(_0xce3623,_0x133dd4,_0x105a2b){var _0x41a5dd={'name':path['basename'](_0xce3623[_0x99f6('0x58')]['originalname'],path['extname'](_0xce3623[_0x99f6('0x58')][_0x99f6('0x59')])),'save_name':path[_0x99f6('0x5a')](_0xce3623[_0x99f6('0x58')][_0x99f6('0x5b')],path[_0x99f6('0x5c')](_0xce3623[_0x99f6('0x58')][_0x99f6('0x5b')])),'original_format':path['extname'](_0xce3623[_0x99f6('0x58')]['originalname'])[_0x99f6('0x5d')](0x1),'converted_format':_0x99f6('0x5e')};var _0x5b1e9f=path[_0x99f6('0x50')](config[_0x99f6('0x51')],_0x99f6('0x5f'),_0xce3623[_0x99f6('0x58')][_0x99f6('0x5b')]);var _0x55658a=path['join'](config[_0x99f6('0x51')],_0x99f6('0x55'),util[_0x99f6('0x56')](_0x99f6('0x57'),path[_0x99f6('0x5a')](_0xce3623[_0x99f6('0x58')][_0x99f6('0x5b')],path[_0x99f6('0x5c')](_0xce3623[_0x99f6('0x58')][_0x99f6('0x5b')])),_0x41a5dd['converted_format']));logger['info']('Sound\x20upload\x20filepath:\x20%s',_0x5b1e9f);logger[_0x99f6('0x60')](_0x99f6('0x61'),_0x55658a);try{fs['chmodSync'](_0x5b1e9f,parseInt('0777',0x8));var _0x318703=sox[_0x99f6('0x62')](_0x5b1e9f,_0x55658a,{'sampleRate':0x1f40,'format':_0x99f6('0x5e'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x318703['on'](_0x99f6('0x63'),function(_0x1300e1){fs[_0x99f6('0x64')](_0x5b1e9f);_0x133dd4[_0x99f6('0x1b')](0x1f4)['send'](_0x1300e1);});_0x318703['on'](_0x99f6('0x65'),function(_0x22db33){_0x41a5dd[_0x99f6('0x66')]=isNaN(_0x22db33[_0x99f6('0x67')])?null:_0x22db33[_0x99f6('0x67')]*0x3e8;_0x41a5dd[_0x99f6('0x68')]=isNaN(_0x22db33[_0x99f6('0x69')])?null:_0x22db33['sampleCount'];_0x41a5dd[_0x99f6('0x6a')]=isNaN(_0x22db33[_0x99f6('0x6b')])?null:_0x22db33[_0x99f6('0x6b')];_0x41a5dd['original_bitRate']=isNaN(_0x22db33[_0x99f6('0x6c')])?null:_0x22db33['bitRate'];_0x41a5dd[_0x99f6('0x6d')]=isNaN(_0x22db33['sampleRate'])?null:_0x22db33[_0x99f6('0x6e')];});_0x318703['on'](_0x99f6('0x6f'),function(_0x336f5c){_0x41a5dd[_0x99f6('0x70')]=isNaN(_0x336f5c['duration'])?null:_0x336f5c[_0x99f6('0x67')]*0x3e8;_0x41a5dd[_0x99f6('0x71')]=isNaN(_0x336f5c[_0x99f6('0x69')])?null:_0x336f5c[_0x99f6('0x69')];_0x41a5dd[_0x99f6('0x72')]=isNaN(_0x336f5c[_0x99f6('0x6b')])?null:_0x336f5c[_0x99f6('0x6b')];_0x41a5dd['converted_bitRate']=isNaN(_0x336f5c[_0x99f6('0x6c')])?null:_0x336f5c[_0x99f6('0x6c')];_0x41a5dd['converted_sampleRate']=isNaN(_0x336f5c[_0x99f6('0x6e')])?null:_0x336f5c['sampleRate'];});_0x318703['on'](_0x99f6('0x1c'),function(){fs[_0x99f6('0x73')](_0x55658a,parseInt('0777',0x8));return db[_0x99f6('0x2f')][_0x99f6('0x74')](_0x41a5dd)[_0x99f6('0x26')](function(_0x3854ce){var _0x5e5b0f={'role':_0xce3623['body'][_0x99f6('0x75')],'userProfileId':_0xce3623['body']['userProfileId']};if(!_0x5e5b0f)throw new Error(_0x99f6('0x76'));if(_0x5e5b0f['role']==='user'){var _0x2fd084=_0x3854ce[_0x99f6('0x28')]({'plain':!![]});return db[_0x99f6('0x77')][_0x99f6('0x4b')]({'where':{'name':'Sounds','userProfileId':_0x5e5b0f[_0x99f6('0x78')]},'raw':!![]})[_0x99f6('0x26')](function(_0x16b439){if(_0x16b439&&_0x16b439[_0x99f6('0x79')]===0x0){return db['UserProfileResource'][_0x99f6('0x74')]({'name':_0x2fd084[_0x99f6('0x2c')],'resourceId':_0x2fd084['id'],'type':_0x16b439[_0x99f6('0x2c')],'sectionId':_0x16b439['id']},{})[_0x99f6('0x26')](function(){return _0x3854ce;});}else{return _0x3854ce;}})['catch'](function(_0x5a047c){logger[_0x99f6('0x63')](_0x99f6('0x7a'),_0x5a047c);throw _0x5a047c;});}return _0x3854ce;})[_0x99f6('0x26')](respondWithResult(_0x133dd4,null))[_0x99f6('0x47')](handleError(_0x133dd4,null));});_0x318703['start']();}catch(_0x59e9db){_0x133dd4[_0x99f6('0x1b')](0x1f4)['send'](_0x59e9db);}};exports[_0x99f6('0x25')]=function(_0xe5a610,_0x4dc635,_0x5c316d){return db[_0x99f6('0x2f')][_0x99f6('0x4b')]({'where':{'id':_0xe5a610['params']['id']}})['then'](handleEntityNotFound(_0x4dc635,null))[_0x99f6('0x26')](saveUpdates(_[_0x99f6('0x3e')](_0xe5a610[_0x99f6('0x7b')],[_0x99f6('0x2c'),_0x99f6('0x7c')]),null))['then'](respondWithResult(_0x4dc635,null))[_0x99f6('0x47')](handleError(_0x4dc635,null));};exports[_0x99f6('0x7d')]=function(_0x1c434c,_0x246d5d,_0x329b3a){return db[_0x99f6('0x2f')]['find']({'where':{'id':_0x1c434c[_0x99f6('0x49')]['id']}})[_0x99f6('0x26')](function(_0x12af65){if(_0x12af65){return _0x12af65['destroy']();}})[_0x99f6('0x26')](function(_0x271662){var _0x3c86ba=path['join'](config[_0x99f6('0x51')],'server/files/sounds/original',util[_0x99f6('0x56')](_0x99f6('0x57'),_0x271662['save_name'],_0x271662['original_format']));var _0x30fe41=path['join'](config[_0x99f6('0x51')],_0x99f6('0x55'),util[_0x99f6('0x56')](_0x99f6('0x57'),_0x271662[_0x99f6('0x4d')],_0x271662[_0x99f6('0x4e')]));fs['unlinkSync'](_0x3c86ba);fs[_0x99f6('0x64')](_0x30fe41);return _0x271662;})[_0x99f6('0x26')](function(_0x3fcd97){if(_0x3fcd97){return _0x246d5d[_0x99f6('0x1b')](0xcc)[_0x99f6('0x1c')]();}})[_0x99f6('0x26')](handleEntityNotFound(_0x246d5d,null))[_0x99f6('0x47')](handleError(_0x246d5d,null));}; \ No newline at end of file +var _0xc352=['basename','file','originalname','filename','extname','substring','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','wav','unlinkSync','src','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','dest','converted_duration','converted_channelCount','converted_bitRate','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','pick','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','get','Sounds','destroy','error','stack','name','send','index','map','Sound','rawAttributes','type','key','model','keys','query','intersection','attributes','fields','order','sort','where','filters','filter','merge','VIRTUAL','options','catch','show','length','include','download','find','params','existsSync','join','server/files/sounds/converted','save_name','Sequelize','ValidationError','Sound\x20not\x20found','root','format','%s.%s','converted_format'];(function(_0x421196,_0x1cbd94){var _0x2738af=function(_0xc956ff){while(--_0xc956ff){_0x421196['push'](_0x421196['shift']());}};_0x2738af(++_0x1cbd94);}(_0xc352,0x194));var _0x2c35=function(_0x59e821,_0x86c723){_0x59e821=_0x59e821-0x0;var _0x5333f6=_0xc352[_0x59e821];return _0x5333f6;};'use strict';var emlformat=require(_0x2c35('0x0'));var rimraf=require(_0x2c35('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2c35('0x2'));var rp=require(_0x2c35('0x3'));var moment=require(_0x2c35('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2c35('0x5'));var util=require(_0x2c35('0x6'));var path=require(_0x2c35('0x7'));var sox=require(_0x2c35('0x8'));var csv=require('to-csv');var ejs=require(_0x2c35('0x9'));var fs=require('fs');var fs_extra=require(_0x2c35('0xa'));var _=require('lodash');var squel=require(_0x2c35('0xb'));var crypto=require('crypto');var jsforce=require(_0x2c35('0xc'));var deskjs=require(_0x2c35('0xd'));var toCsv=require(_0x2c35('0xe'));var querystring=require('querystring');var Papa=require(_0x2c35('0xf'));var Redis=require(_0x2c35('0x10'));var authService=require(_0x2c35('0x11'));var qs=require(_0x2c35('0x12'));var as=require(_0x2c35('0x13'));var hardwareService=require(_0x2c35('0x14'));var logger=require(_0x2c35('0x15'))(_0x2c35('0x16'));var utils=require(_0x2c35('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2c35('0x18'))['db'];function respondWithStatusCode(_0x2643ab,_0x4f991c){_0x4f991c=_0x4f991c||0xcc;return function(_0x2c0517){if(_0x2c0517){return _0x2643ab[_0x2c35('0x19')](_0x4f991c);}return _0x2643ab[_0x2c35('0x1a')](_0x4f991c)[_0x2c35('0x1b')]();};}function respondWithResult(_0x4c8e08,_0x1dba84){_0x1dba84=_0x1dba84||0xc8;return function(_0x5ca8d3){if(_0x5ca8d3){return _0x4c8e08[_0x2c35('0x1a')](_0x1dba84)[_0x2c35('0x1c')](_0x5ca8d3);}};}function respondWithFilteredResult(_0x5bb5b4,_0x239050){return function(_0x19b866){if(_0x19b866){var _0x66d1ec=typeof _0x239050[_0x2c35('0x1d')]==='undefined'&&typeof _0x239050['limit']===_0x2c35('0x1e');var _0x43ed68=_0x19b866[_0x2c35('0x1f')];var _0x9e7146=_0x66d1ec?0x0:_0x239050[_0x2c35('0x1d')];var _0x118d90=_0x66d1ec?_0x19b866[_0x2c35('0x1f')]:_0x239050[_0x2c35('0x1d')]+_0x239050[_0x2c35('0x20')];var _0x1b908b;if(_0x118d90>=_0x43ed68){_0x118d90=_0x43ed68;_0x1b908b=0xc8;}else{_0x1b908b=0xce;}_0x5bb5b4[_0x2c35('0x1a')](_0x1b908b);return _0x5bb5b4['set'](_0x2c35('0x21'),_0x9e7146+'-'+_0x118d90+'/'+_0x43ed68)['json'](_0x19b866);}return null;};}function patchUpdates(_0x531a2d){return function(_0x22a8ce){try{jsonpatch[_0x2c35('0x22')](_0x22a8ce,_0x531a2d,!![]);}catch(_0x226760){return BPromise[_0x2c35('0x23')](_0x226760);}return _0x22a8ce[_0x2c35('0x24')]();};}function saveUpdates(_0x3d28ba,_0x550810){return function(_0x552c32){if(_0x552c32){return _0x552c32[_0x2c35('0x25')](_0x3d28ba)[_0x2c35('0x26')](function(_0x420a77){return _0x420a77;});}return null;};}function removeEntity(_0x3f93ba,_0x2e7f24){return function(_0x81bd82){if(_0x81bd82){return _0x81bd82['destroy']()[_0x2c35('0x26')](function(){var _0x149af5=_0x81bd82[_0x2c35('0x27')]({'plain':!![]});var _0x38cd62=_0x2c35('0x28');return db['UserProfileResource'][_0x2c35('0x29')]({'where':{'type':_0x38cd62,'resourceId':_0x149af5['id']}})[_0x2c35('0x26')](function(){return _0x81bd82;});})['then'](function(){_0x3f93ba[_0x2c35('0x1a')](0xcc)[_0x2c35('0x1b')]();});}};}function handleEntityNotFound(_0x595eda,_0xcd7a2d){return function(_0x296df8){if(!_0x296df8){_0x595eda['sendStatus'](0x194);}return _0x296df8;};}function handleError(_0x5a9d36,_0x175307){_0x175307=_0x175307||0x1f4;return function(_0x3b1233){logger[_0x2c35('0x2a')](_0x3b1233[_0x2c35('0x2b')]);if(_0x3b1233[_0x2c35('0x2c')]){delete _0x3b1233[_0x2c35('0x2c')];}_0x5a9d36[_0x2c35('0x1a')](_0x175307)[_0x2c35('0x2d')](_0x3b1233);};}exports[_0x2c35('0x2e')]=function(_0xe415e,_0x564faa){var _0x19fae={},_0x5e54e2={},_0x2a0910={'count':0x0,'rows':[]};var _0x4723a3=_[_0x2c35('0x2f')](db[_0x2c35('0x30')][_0x2c35('0x31')],function(_0x26865a){return{'name':_0x26865a['fieldName'],'type':_0x26865a[_0x2c35('0x32')][_0x2c35('0x33')]};});_0x5e54e2[_0x2c35('0x34')]=_[_0x2c35('0x2f')](_0x4723a3,_0x2c35('0x2c'));_0x5e54e2['query']=_[_0x2c35('0x35')](_0xe415e[_0x2c35('0x36')]);_0x5e54e2['filters']=_[_0x2c35('0x37')](_0x5e54e2[_0x2c35('0x34')],_0x5e54e2['query']);_0x19fae[_0x2c35('0x38')]=_[_0x2c35('0x37')](_0x5e54e2[_0x2c35('0x34')],qs[_0x2c35('0x39')](_0xe415e[_0x2c35('0x36')][_0x2c35('0x39')]));_0x19fae[_0x2c35('0x38')]=_0x19fae[_0x2c35('0x38')]['length']?_0x19fae[_0x2c35('0x38')]:_0x5e54e2[_0x2c35('0x34')];if(!_0xe415e[_0x2c35('0x36')]['hasOwnProperty']('nolimit')){_0x19fae[_0x2c35('0x20')]=qs['limit'](_0xe415e[_0x2c35('0x36')][_0x2c35('0x20')]);_0x19fae['offset']=qs[_0x2c35('0x1d')](_0xe415e[_0x2c35('0x36')][_0x2c35('0x1d')]);}_0x19fae[_0x2c35('0x3a')]=qs[_0x2c35('0x3b')](_0xe415e['query'][_0x2c35('0x3b')]);_0x19fae[_0x2c35('0x3c')]=qs[_0x2c35('0x3d')](_['pick'](_0xe415e[_0x2c35('0x36')],_0x5e54e2[_0x2c35('0x3d')]),_0x4723a3);if(_0xe415e[_0x2c35('0x36')][_0x2c35('0x3e')]){_0x19fae[_0x2c35('0x3c')]=_[_0x2c35('0x3f')](_0x19fae[_0x2c35('0x3c')],{'$or':_['map'](_0x4723a3,function(_0x4d384c){if(_0x4d384c['type']!==_0x2c35('0x40')){var _0x378eb8={};_0x378eb8[_0x4d384c[_0x2c35('0x2c')]]={'$like':'%'+_0xe415e[_0x2c35('0x36')][_0x2c35('0x3e')]+'%'};return _0x378eb8;}})});}_0x19fae=_[_0x2c35('0x3f')]({},_0x19fae,_0xe415e[_0x2c35('0x41')]);var _0x483062={'where':_0x19fae['where']};return db[_0x2c35('0x30')][_0x2c35('0x1f')](_0x483062)['then'](function(_0x1c8e18){_0x2a0910['count']=_0x1c8e18;if(_0xe415e['query']['includeAll']){_0x19fae['include']=[{'all':!![]}];}return db[_0x2c35('0x30')]['findAll'](_0x19fae);})[_0x2c35('0x26')](function(_0x3cacea){_0x2a0910['rows']=_0x3cacea;return _0x2a0910;})['then'](respondWithFilteredResult(_0x564faa,_0x19fae))[_0x2c35('0x42')](handleError(_0x564faa,null));};exports[_0x2c35('0x43')]=function(_0x9778ed,_0x39ef2e){var _0x3b9058={'raw':!![],'where':{'id':_0x9778ed['params']['id']}},_0x328f18={};_0x328f18['model']=_['keys'](db['Sound'][_0x2c35('0x31')]);_0x328f18[_0x2c35('0x36')]=_[_0x2c35('0x35')](_0x9778ed[_0x2c35('0x36')]);_0x328f18[_0x2c35('0x3d')]=_['intersection'](_0x328f18[_0x2c35('0x34')],_0x328f18[_0x2c35('0x36')]);_0x3b9058['attributes']=_[_0x2c35('0x37')](_0x328f18[_0x2c35('0x34')],qs['fields'](_0x9778ed[_0x2c35('0x36')][_0x2c35('0x39')]));_0x3b9058[_0x2c35('0x38')]=_0x3b9058[_0x2c35('0x38')][_0x2c35('0x44')]?_0x3b9058[_0x2c35('0x38')]:_0x328f18['model'];if(_0x9778ed[_0x2c35('0x36')]['includeAll']){_0x3b9058[_0x2c35('0x45')]=[{'all':!![]}];}_0x3b9058=_[_0x2c35('0x3f')]({},_0x3b9058,_0x9778ed[_0x2c35('0x41')]);return db['Sound']['find'](_0x3b9058)[_0x2c35('0x26')](handleEntityNotFound(_0x39ef2e,null))[_0x2c35('0x26')](respondWithResult(_0x39ef2e,null))['catch'](handleError(_0x39ef2e,null));};exports[_0x2c35('0x46')]=function(_0x63c153,_0x4d07ac,_0x69dd30){return db[_0x2c35('0x30')][_0x2c35('0x47')]({'where':{'id':_0x63c153[_0x2c35('0x48')]['id']},'attributes':[_0x2c35('0x2c'),'save_name','converted_format'],'raw':!![]})[_0x2c35('0x26')](handleEntityNotFound(_0x4d07ac,null))[_0x2c35('0x26')](function(_0x2ea307){if(_0x2ea307){if(!fs[_0x2c35('0x49')](path[_0x2c35('0x4a')](config['root'],_0x2c35('0x4b'),_0x2ea307[_0x2c35('0x4c')]+'.'+_0x2ea307['converted_format']))){throw new db[(_0x2c35('0x4d'))][(_0x2c35('0x4e'))](_0x2c35('0x4f'));}return _0x4d07ac[_0x2c35('0x46')](path['join'](config[_0x2c35('0x50')],_0x2c35('0x4b'),util[_0x2c35('0x51')](_0x2c35('0x52'),_0x2ea307[_0x2c35('0x4c')],_0x2ea307[_0x2c35('0x53')])),util['format']('%s.%s',_0x2ea307['name'],_0x2ea307['converted_format']));}return null;})[_0x2c35('0x42')](handleError(_0x4d07ac,null));};exports['create']=function(_0xa627b2,_0x10c1fa,_0x36995b){var _0x20dbbf={'name':path[_0x2c35('0x54')](_0xa627b2[_0x2c35('0x55')]['originalname'],path['extname'](_0xa627b2[_0x2c35('0x55')][_0x2c35('0x56')])),'save_name':path[_0x2c35('0x54')](_0xa627b2[_0x2c35('0x55')][_0x2c35('0x57')],path[_0x2c35('0x58')](_0xa627b2[_0x2c35('0x55')][_0x2c35('0x57')])),'original_format':path['extname'](_0xa627b2[_0x2c35('0x55')]['originalname'])[_0x2c35('0x59')](0x1),'converted_format':'wav'};var _0x238e3c=path[_0x2c35('0x4a')](config[_0x2c35('0x50')],_0x2c35('0x5a'),_0xa627b2['file'][_0x2c35('0x57')]);var _0x14dd5c=path[_0x2c35('0x4a')](config['root'],'server/files/sounds/converted',util[_0x2c35('0x51')]('%s.%s',path[_0x2c35('0x54')](_0xa627b2['file']['filename'],path[_0x2c35('0x58')](_0xa627b2['file']['filename'])),_0x20dbbf[_0x2c35('0x53')]));logger[_0x2c35('0x5b')](_0x2c35('0x5c'),_0x238e3c);logger[_0x2c35('0x5b')](_0x2c35('0x5d'),_0x14dd5c);try{fs[_0x2c35('0x5e')](_0x238e3c,parseInt(_0x2c35('0x5f'),0x8));var _0x5858b2=sox[_0x2c35('0x60')](_0x238e3c,_0x14dd5c,{'sampleRate':0x1f40,'format':_0x2c35('0x61'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x5858b2['on'](_0x2c35('0x2a'),function(_0x131a1f){fs[_0x2c35('0x62')](_0x238e3c);_0x10c1fa[_0x2c35('0x1a')](0x1f4)[_0x2c35('0x2d')](_0x131a1f);});_0x5858b2['on'](_0x2c35('0x63'),function(_0x27f04b){_0x20dbbf['original_duration']=isNaN(_0x27f04b[_0x2c35('0x64')])?null:_0x27f04b[_0x2c35('0x64')]*0x3e8;_0x20dbbf[_0x2c35('0x65')]=isNaN(_0x27f04b[_0x2c35('0x66')])?null:_0x27f04b[_0x2c35('0x66')];_0x20dbbf[_0x2c35('0x67')]=isNaN(_0x27f04b[_0x2c35('0x68')])?null:_0x27f04b['channelCount'];_0x20dbbf[_0x2c35('0x69')]=isNaN(_0x27f04b[_0x2c35('0x6a')])?null:_0x27f04b[_0x2c35('0x6a')];_0x20dbbf[_0x2c35('0x6b')]=isNaN(_0x27f04b['sampleRate'])?null:_0x27f04b['sampleRate'];});_0x5858b2['on'](_0x2c35('0x6c'),function(_0x5cb07a){_0x20dbbf[_0x2c35('0x6d')]=isNaN(_0x5cb07a[_0x2c35('0x64')])?null:_0x5cb07a[_0x2c35('0x64')]*0x3e8;_0x20dbbf['converted_sampleCount']=isNaN(_0x5cb07a[_0x2c35('0x66')])?null:_0x5cb07a['sampleCount'];_0x20dbbf[_0x2c35('0x6e')]=isNaN(_0x5cb07a[_0x2c35('0x68')])?null:_0x5cb07a[_0x2c35('0x68')];_0x20dbbf[_0x2c35('0x6f')]=isNaN(_0x5cb07a[_0x2c35('0x6a')])?null:_0x5cb07a[_0x2c35('0x6a')];_0x20dbbf['converted_sampleRate']=isNaN(_0x5cb07a['sampleRate'])?null:_0x5cb07a['sampleRate'];});_0x5858b2['on']('end',function(){fs['chmodSync'](_0x14dd5c,parseInt(_0x2c35('0x5f'),0x8));return db['Sound']['create'](_0x20dbbf)[_0x2c35('0x26')](function(_0x19e6f8){var _0x49ef59={'role':_0xa627b2[_0x2c35('0x70')][_0x2c35('0x71')],'userProfileId':_0xa627b2[_0x2c35('0x70')][_0x2c35('0x72')]};if(!_0x49ef59)throw new Error(_0x2c35('0x73'));if(_0x49ef59['role']==='user'){var _0x5e0d2e=_0x19e6f8[_0x2c35('0x27')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x2c35('0x28'),'userProfileId':_0x49ef59[_0x2c35('0x72')]},'raw':!![]})[_0x2c35('0x26')](function(_0x8fa6b5){if(_0x8fa6b5&&_0x8fa6b5[_0x2c35('0x74')]===0x0){return db[_0x2c35('0x75')][_0x2c35('0x76')]({'name':_0x5e0d2e[_0x2c35('0x2c')],'resourceId':_0x5e0d2e['id'],'type':_0x8fa6b5['name'],'sectionId':_0x8fa6b5['id']},{})[_0x2c35('0x26')](function(){return _0x19e6f8;});}else{return _0x19e6f8;}})[_0x2c35('0x42')](function(_0x109b9){logger[_0x2c35('0x2a')](_0x2c35('0x77'),_0x109b9);throw _0x109b9;});}return _0x19e6f8;})[_0x2c35('0x26')](respondWithResult(_0x10c1fa,null))[_0x2c35('0x42')](handleError(_0x10c1fa,null));});_0x5858b2[_0x2c35('0x78')]();}catch(_0x681544){_0x10c1fa[_0x2c35('0x1a')](0x1f4)['send'](_0x681544);}};exports[_0x2c35('0x25')]=function(_0x296266,_0x215dd2,_0x923e6b){return db[_0x2c35('0x30')]['find']({'where':{'id':_0x296266[_0x2c35('0x48')]['id']}})['then'](handleEntityNotFound(_0x215dd2,null))[_0x2c35('0x26')](saveUpdates(_[_0x2c35('0x79')](_0x296266[_0x2c35('0x70')],[_0x2c35('0x2c'),'description']),null))[_0x2c35('0x26')](respondWithResult(_0x215dd2,null))[_0x2c35('0x42')](handleError(_0x215dd2,null));};exports['delete']=function(_0x5b6545,_0x36abfc,_0x5d7f17){return db[_0x2c35('0x30')][_0x2c35('0x47')]({'where':{'id':_0x5b6545[_0x2c35('0x48')]['id']}})[_0x2c35('0x26')](function(_0x4a8123){if(_0x4a8123){return _0x4a8123[_0x2c35('0x29')]();}})['then'](function(_0x4c7d63){var _0x432590=path[_0x2c35('0x4a')](config[_0x2c35('0x50')],_0x2c35('0x5a'),util[_0x2c35('0x51')](_0x2c35('0x52'),_0x4c7d63['save_name'],_0x4c7d63['original_format']));var _0x5ba329=path[_0x2c35('0x4a')](config['root'],_0x2c35('0x4b'),util[_0x2c35('0x51')](_0x2c35('0x52'),_0x4c7d63[_0x2c35('0x4c')],_0x4c7d63['converted_format']));fs['unlinkSync'](_0x432590);fs[_0x2c35('0x62')](_0x5ba329);return _0x4c7d63;})['then'](function(_0x181e45){if(_0x181e45){return _0x36abfc[_0x2c35('0x1a')](0xcc)[_0x2c35('0x1b')]();}})[_0x2c35('0x26')](handleEntityNotFound(_0x36abfc,null))[_0x2c35('0x42')](handleError(_0x36abfc,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 640e0ca..adf903d 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 _0x06db=['bluebird','path','rimraf','./sound.attributes','define','Sound','tools_sounds','lodash','../../config/logger','api'];(function(_0x15a08d,_0x5b7052){var _0x4bb915=function(_0x3d2d6c){while(--_0x3d2d6c){_0x15a08d['push'](_0x15a08d['shift']());}};_0x4bb915(++_0x5b7052);}(_0x06db,0x115));var _0xb06d=function(_0xe420a0,_0x1b3c60){_0xe420a0=_0xe420a0-0x0;var _0x6963c9=_0x06db[_0xe420a0];return _0x6963c9;};'use strict';var _=require(_0xb06d('0x0'));var util=require('util');var logger=require(_0xb06d('0x1'))(_0xb06d('0x2'));var moment=require('moment');var BPromise=require(_0xb06d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb06d('0x4'));var rimraf=require(_0xb06d('0x5'));var config=require('../../config/environment');var attributes=require(_0xb06d('0x6'));module['exports']=function(_0x58a0e2,_0x1fa436){return _0x58a0e2[_0xb06d('0x7')](_0xb06d('0x8'),attributes,{'tableName':_0xb06d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc3ef=['Sound','tools_sounds','lodash','../../config/logger','api','moment','rimraf','../../config/environment','./sound.attributes','define'];(function(_0x3a4cd9,_0x2dd87a){var _0x5ee630=function(_0x40a4b1){while(--_0x40a4b1){_0x3a4cd9['push'](_0x3a4cd9['shift']());}};_0x5ee630(++_0x2dd87a);}(_0xc3ef,0x1ba));var _0xfc3e=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xc3ef[_0x1d1779];return _0x2377e9;};'use strict';var _=require(_0xfc3e('0x0'));var util=require('util');var logger=require(_0xfc3e('0x1'))(_0xfc3e('0x2'));var moment=require(_0xfc3e('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xfc3e('0x4'));var config=require(_0xfc3e('0x5'));var attributes=require(_0xfc3e('0x6'));module['exports']=function(_0x18d7fa,_0x345d1c){return _0x18d7fa[_0xfc3e('0x7')](_0xfc3e('0x8'),attributes,{'tableName':_0xfc3e('0x9'),'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 35ef601..ce2681e 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 _0x493d=['client','http','then','info','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','Sound,\x20%s,\x20%s','message','catch','ShowSound','Sound','find','options','raw','where','attributes','include','model','map','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x5e2a54,_0x424ad7){var _0x1c8b6b=function(_0x718a9b){while(--_0x718a9b){_0x5e2a54['push'](_0x5e2a54['shift']());}};_0x1c8b6b(++_0x424ad7);}(_0x493d,0x161));var _0xd493=function(_0x4e215b,_0x597fbc){_0x4e215b=_0x4e215b-0x0;var _0x56d77a=_0x493d[_0x4e215b];return _0x56d77a;};'use strict';var _=require(_0xd493('0x0'));var util=require(_0xd493('0x1'));var moment=require(_0xd493('0x2'));var BPromise=require('bluebird');var rs=require(_0xd493('0x3'));var fs=require('fs');var Redis=require(_0xd493('0x4'));var db=require(_0xd493('0x5'))['db'];var utils=require(_0xd493('0x6'));var logger=require(_0xd493('0x7'))(_0xd493('0x8'));var config=require(_0xd493('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xd493('0xa')][_0xd493('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x39405c,_0x3348ea,_0x3d457d){return new BPromise(function(_0x27acf9,_0x4c3831){return client['request'](_0x39405c,_0x3d457d)[_0xd493('0xc')](function(_0x1c3dba){logger[_0xd493('0xd')]('Sound,\x20%s,\x20%s',_0x3348ea,_0xd493('0xe'));logger[_0xd493('0xf')](_0xd493('0x10'),_0x3348ea,'request\x20sent',JSON[_0xd493('0x11')](_0x1c3dba));if(_0x1c3dba[_0xd493('0x12')]){if(_0x1c3dba[_0xd493('0x12')][_0xd493('0x13')]===0x1f4){logger[_0xd493('0x12')](_0xd493('0x14'),_0x3348ea,_0x1c3dba[_0xd493('0x12')][_0xd493('0x15')]);return _0x4c3831(_0x1c3dba[_0xd493('0x12')]['message']);}logger[_0xd493('0x12')](_0xd493('0x14'),_0x3348ea,_0x1c3dba[_0xd493('0x12')]['message']);return _0x27acf9(_0x1c3dba['error']['message']);}else{logger[_0xd493('0xd')](_0xd493('0x14'),_0x3348ea,_0xd493('0xe'));_0x27acf9(_0x1c3dba['result'][_0xd493('0x15')]);}})[_0xd493('0x16')](function(_0x18570f){logger[_0xd493('0x12')](_0xd493('0x14'),_0x3348ea,_0x18570f);_0x4c3831(_0x18570f);});});}exports[_0xd493('0x17')]=function(_0x3d722d){var _0x5099e7=this;return new Promise(function(_0x1addda,_0x2674e4){return db[_0xd493('0x18')][_0xd493('0x19')]({'raw':_0x3d722d['options']?_0x3d722d[_0xd493('0x1a')][_0xd493('0x1b')]===undefined?!![]:![]:!![],'where':_0x3d722d[_0xd493('0x1a')]?_0x3d722d[_0xd493('0x1a')][_0xd493('0x1c')]||null:null,'attributes':_0x3d722d[_0xd493('0x1a')]?_0x3d722d[_0xd493('0x1a')][_0xd493('0x1d')]||null:null,'include':_0x3d722d[_0xd493('0x1a')]?_0x3d722d[_0xd493('0x1a')][_0xd493('0x1e')]?_['map'](_0x3d722d[_0xd493('0x1a')][_0xd493('0x1e')],function(_0x1e3c46){return{'model':db[_0x1e3c46[_0xd493('0x1f')]],'as':_0x1e3c46['as'],'attributes':_0x1e3c46[_0xd493('0x1d')],'include':_0x1e3c46[_0xd493('0x1e')]?_[_0xd493('0x20')](_0x1e3c46[_0xd493('0x1e')],function(_0x5e04df){return{'model':db[_0x5e04df['model']],'as':_0x5e04df['as'],'attributes':_0x5e04df[_0xd493('0x1d')],'include':_0x5e04df[_0xd493('0x1e')]?_[_0xd493('0x20')](_0x5e04df[_0xd493('0x1e')],function(_0x29bc18){return{'model':db[_0x29bc18[_0xd493('0x1f')]],'as':_0x29bc18['as'],'attributes':_0x29bc18[_0xd493('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xd493('0xc')](function(_0x3c4bc7){logger[_0xd493('0xd')](_0xd493('0x17'),_0x3d722d);logger[_0xd493('0xf')](_0xd493('0x17'),_0x3d722d,JSON[_0xd493('0x11')](_0x3c4bc7));_0x1addda(_0x3c4bc7);})[_0xd493('0x16')](function(_0x10e804){logger[_0xd493('0x12')](_0xd493('0x17'),_0x10e804[_0xd493('0x15')],_0x3d722d);_0x2674e4(_0x5099e7['error'](0x1f4,_0x10e804[_0xd493('0x15')]));});});}; \ No newline at end of file +var _0x8da4=['catch','Sound','options','raw','where','attributes','include','map','model','ShowSound','lodash','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','request','then','info','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','Sound,\x20%s,\x20%s','message','request\x20sent'];(function(_0x4422bb,_0x253cc4){var _0x5b1161=function(_0x46e839){while(--_0x46e839){_0x4422bb['push'](_0x4422bb['shift']());}};_0x5b1161(++_0x253cc4);}(_0x8da4,0x183));var _0x48da=function(_0x30bc77,_0x2aab62){_0x30bc77=_0x30bc77-0x0;var _0x75bc26=_0x8da4[_0x30bc77];return _0x75bc26;};'use strict';var _=require(_0x48da('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x48da('0x1'));var rs=require(_0x48da('0x2'));var fs=require('fs');var Redis=require(_0x48da('0x3'));var db=require(_0x48da('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x48da('0x5'));var config=require('../../config/environment');var jayson=require(_0x48da('0x6'));var client=jayson[_0x48da('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x15dddc,_0x3564cd,_0xed984){return new BPromise(function(_0x446858,_0x245665){return client[_0x48da('0x8')](_0x15dddc,_0xed984)[_0x48da('0x9')](function(_0x4ef9db){logger[_0x48da('0xa')]('Sound,\x20%s,\x20%s',_0x3564cd,'request\x20sent');logger[_0x48da('0xb')](_0x48da('0xc'),_0x3564cd,'request\x20sent',JSON[_0x48da('0xd')](_0x4ef9db));if(_0x4ef9db[_0x48da('0xe')]){if(_0x4ef9db[_0x48da('0xe')][_0x48da('0xf')]===0x1f4){logger['error'](_0x48da('0x10'),_0x3564cd,_0x4ef9db[_0x48da('0xe')]['message']);return _0x245665(_0x4ef9db[_0x48da('0xe')][_0x48da('0x11')]);}logger[_0x48da('0xe')](_0x48da('0x10'),_0x3564cd,_0x4ef9db[_0x48da('0xe')][_0x48da('0x11')]);return _0x446858(_0x4ef9db[_0x48da('0xe')][_0x48da('0x11')]);}else{logger['info'](_0x48da('0x10'),_0x3564cd,_0x48da('0x12'));_0x446858(_0x4ef9db['result'][_0x48da('0x11')]);}})[_0x48da('0x13')](function(_0x34fc31){logger[_0x48da('0xe')](_0x48da('0x10'),_0x3564cd,_0x34fc31);_0x245665(_0x34fc31);});});}exports['ShowSound']=function(_0x3418ae){var _0x4fb27b=this;return new Promise(function(_0x315d06,_0x425f38){return db[_0x48da('0x14')]['find']({'raw':_0x3418ae[_0x48da('0x15')]?_0x3418ae[_0x48da('0x15')][_0x48da('0x16')]===undefined?!![]:![]:!![],'where':_0x3418ae['options']?_0x3418ae['options'][_0x48da('0x17')]||null:null,'attributes':_0x3418ae['options']?_0x3418ae[_0x48da('0x15')][_0x48da('0x18')]||null:null,'include':_0x3418ae[_0x48da('0x15')]?_0x3418ae[_0x48da('0x15')][_0x48da('0x19')]?_[_0x48da('0x1a')](_0x3418ae[_0x48da('0x15')][_0x48da('0x19')],function(_0x58c6d2){return{'model':db[_0x58c6d2[_0x48da('0x1b')]],'as':_0x58c6d2['as'],'attributes':_0x58c6d2[_0x48da('0x18')],'include':_0x58c6d2['include']?_[_0x48da('0x1a')](_0x58c6d2[_0x48da('0x19')],function(_0x5e8bfb){return{'model':db[_0x5e8bfb[_0x48da('0x1b')]],'as':_0x5e8bfb['as'],'attributes':_0x5e8bfb['attributes'],'include':_0x5e8bfb[_0x48da('0x19')]?_[_0x48da('0x1a')](_0x5e8bfb[_0x48da('0x19')],function(_0x5bf11c){return{'model':db[_0x5bf11c[_0x48da('0x1b')]],'as':_0x5bf11c['as'],'attributes':_0x5bf11c[_0x48da('0x18')]};}):[]};}):[]};}):[]:[]})[_0x48da('0x9')](function(_0x4c606f){logger['info'](_0x48da('0x1c'),_0x3418ae);logger['debug']('ShowSound',_0x3418ae,JSON['stringify'](_0x4c606f));_0x315d06(_0x4c606f);})[_0x48da('0x13')](function(_0x3347ad){logger['error']('ShowSound',_0x3347ad[_0x48da('0x11')],_0x3418ae);_0x425f38(_0x4fb27b[_0x48da('0xe')](0x1f4,_0x3347ad[_0x48da('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index af149bb..787c5e2 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 _0x0b0e=['./squareMessage.controller','get','isAuthenticated','index','show','post','create','/:id','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1f535b,_0xc42523){var _0x5bb329=function(_0xcaa78d){while(--_0xcaa78d){_0x1f535b['push'](_0x1f535b['shift']());}};_0x5bb329(++_0xc42523);}(_0x0b0e,0x187));var _0xe0b0=function(_0x4a93bb,_0x495404){_0x4a93bb=_0x4a93bb-0x0;var _0x208468=_0x0b0e[_0x4a93bb];return _0x208468;};'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('0xd')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xe')]);router['put'](_0xe0b0('0xf'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x10')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x11')]);module[_0xe0b0('0x12')]=router; \ No newline at end of file +var _0x9ffd=['util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./squareMessage.controller','isAuthenticated','index','get','/:id','show','post','create','delete','destroy','exports','multer'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x695bef,_0x23872b){_0x695bef=_0x695bef-0x0;var _0x10444c=_0x9ffd[_0x695bef];return _0x10444c;};'use strict';var multer=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var path=require(_0xd9ff('0x2'));var timeout=require('connect-timeout');var express=require(_0xd9ff('0x3'));var router=express[_0xd9ff('0x4')]();var fs_extra=require(_0xd9ff('0x5'));var auth=require(_0xd9ff('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd9ff('0x7'));var controller=require(_0xd9ff('0x8'));router['get']('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xa')]);router[_0xd9ff('0xb')](_0xd9ff('0xc'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xd')]);router[_0xd9ff('0xe')]('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xd9ff('0x10')](_0xd9ff('0xc'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0x11')]);module[_0xd9ff('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 80ee9b7..ccf9703 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 _0x893a=['TEXT','medium','out','sequelize','exports','STRING'];(function(_0x1092c6,_0x469738){var _0x1e3337=function(_0x1b0254){while(--_0x1b0254){_0x1092c6['push'](_0x1092c6['shift']());}};_0x1e3337(++_0x469738);}(_0x893a,0x16b));var _0xa893=function(_0x7fd249,_0x546923){_0x7fd249=_0x7fd249-0x0;var _0x43b4e3=_0x893a[_0x7fd249];return _0x43b4e3;};'use strict';var Sequelize=require(_0xa893('0x0'));module[_0xa893('0x1')]={'uniqueid':{'type':Sequelize[_0xa893('0x2')]},'body':{'type':Sequelize[_0xa893('0x3')](_0xa893('0x4')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0xa893('0x5'),'allowNull':![]},'providerName':{'type':Sequelize[_0xa893('0x2')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xaacc=['TEXT','medium','ENUM','out','exports','STRING'];(function(_0x28622b,_0x416e04){var _0x57a00e=function(_0x11374b){while(--_0x11374b){_0x28622b['push'](_0x28622b['shift']());}};_0x57a00e(++_0x416e04);}(_0xaacc,0x1c6));var _0xcaac=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0xaacc[_0x263a74];return _0x2aa86c;};'use strict';var Sequelize=require('sequelize');module[_0xcaac('0x0')]={'uniqueid':{'type':Sequelize[_0xcaac('0x1')]},'body':{'type':Sequelize[_0xcaac('0x2')](_0xcaac('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0xcaac('0x4')]('in',_0xcaac('0x5')),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xcaac('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 43445c6..a5a2a96 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 _0x7d8a=['send','map','rawAttributes','key','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','SquareMessage','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','end'];(function(_0xe7dfa7,_0x3d17ee){var _0x1a9fbf=function(_0x2ef98a){while(--_0x2ef98a){_0xe7dfa7['push'](_0xe7dfa7['shift']());}};_0x1a9fbf(++_0x3d17ee);}(_0x7d8a,0x1ca));var _0xa7d8=function(_0x5cc8,_0x1faa02){_0x5cc8=_0x5cc8-0x0;var _0x450661=_0x7d8a[_0x5cc8];return _0x450661;};'use strict';var emlformat=require(_0xa7d8('0x0'));var rimraf=require(_0xa7d8('0x1'));var zipdir=require(_0xa7d8('0x2'));var jsonpatch=require(_0xa7d8('0x3'));var rp=require(_0xa7d8('0x4'));var moment=require(_0xa7d8('0x5'));var BPromise=require(_0xa7d8('0x6'));var Mustache=require(_0xa7d8('0x7'));var util=require(_0xa7d8('0x8'));var path=require(_0xa7d8('0x9'));var sox=require(_0xa7d8('0xa'));var csv=require(_0xa7d8('0xb'));var ejs=require(_0xa7d8('0xc'));var fs=require('fs');var fs_extra=require(_0xa7d8('0xd'));var _=require('lodash');var squel=require(_0xa7d8('0xe'));var crypto=require(_0xa7d8('0xf'));var jsforce=require(_0xa7d8('0x10'));var deskjs=require(_0xa7d8('0x11'));var toCsv=require(_0xa7d8('0xb'));var querystring=require('querystring');var Papa=require(_0xa7d8('0x12'));var Redis=require('ioredis');var authService=require(_0xa7d8('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xa7d8('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa7d8('0x15'))(_0xa7d8('0x16'));var utils=require('../../config/utils');var config=require(_0xa7d8('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xa7d8('0x18'))['db'];function respondWithStatusCode(_0x161829,_0x133a94){_0x133a94=_0x133a94||0xcc;return function(_0x47c76b){if(_0x47c76b){return _0x161829[_0xa7d8('0x19')](_0x133a94);}return _0x161829[_0xa7d8('0x1a')](_0x133a94)['end']();};}function respondWithResult(_0x5bfb1a,_0x5080d6){_0x5080d6=_0x5080d6||0xc8;return function(_0x379f6c){if(_0x379f6c){return _0x5bfb1a[_0xa7d8('0x1a')](_0x5080d6)[_0xa7d8('0x1b')](_0x379f6c);}};}function respondWithFilteredResult(_0x2d126b,_0x3452d0){return function(_0x2ae530){if(_0x2ae530){var _0x2bbaf4=typeof _0x3452d0[_0xa7d8('0x1c')]===_0xa7d8('0x1d')&&typeof _0x3452d0[_0xa7d8('0x1e')]===_0xa7d8('0x1d');var _0x5624d3=_0x2ae530[_0xa7d8('0x1f')];var _0x50d6a6=_0x2bbaf4?0x0:_0x3452d0[_0xa7d8('0x1c')];var _0x3af212=_0x2bbaf4?_0x2ae530['count']:_0x3452d0[_0xa7d8('0x1c')]+_0x3452d0[_0xa7d8('0x1e')];var _0x1236d9;if(_0x3af212>=_0x5624d3){_0x3af212=_0x5624d3;_0x1236d9=0xc8;}else{_0x1236d9=0xce;}_0x2d126b[_0xa7d8('0x1a')](_0x1236d9);return _0x2d126b['set'](_0xa7d8('0x20'),_0x50d6a6+'-'+_0x3af212+'/'+_0x5624d3)['json'](_0x2ae530);}return null;};}function patchUpdates(_0x33f117){return function(_0xa6614a){try{jsonpatch['apply'](_0xa6614a,_0x33f117,!![]);}catch(_0x381fca){return BPromise[_0xa7d8('0x21')](_0x381fca);}return _0xa6614a[_0xa7d8('0x22')]();};}function saveUpdates(_0x426a20,_0x46d9a9){return function(_0x488f7e){if(_0x488f7e){return _0x488f7e[_0xa7d8('0x23')](_0x426a20)[_0xa7d8('0x24')](function(_0x5e8acb){return _0x5e8acb;});}return null;};}function removeEntity(_0x2c33f8,_0x31afb8){return function(_0x4a3fd6){if(_0x4a3fd6){return _0x4a3fd6[_0xa7d8('0x25')]()[_0xa7d8('0x24')](function(){_0x2c33f8[_0xa7d8('0x1a')](0xcc)[_0xa7d8('0x26')]();});}};}function handleEntityNotFound(_0x1f49f6,_0x3f7bd7){return function(_0x2d3f0d){if(!_0x2d3f0d){_0x1f49f6['sendStatus'](0x194);}return _0x2d3f0d;};}function handleError(_0x2aed5b,_0x4a325b){_0x4a325b=_0x4a325b||0x1f4;return function(_0x1dcb71){logger['error'](_0x1dcb71['stack']);if(_0x1dcb71['name']){delete _0x1dcb71['name'];}_0x2aed5b[_0xa7d8('0x1a')](_0x4a325b)[_0xa7d8('0x27')](_0x1dcb71);};}exports['index']=function(_0x3fb24f,_0x23ca78){var _0x31b73d={},_0x54676b={},_0x4ea479={'count':0x0,'rows':[]};var _0xceee5a=_[_0xa7d8('0x28')](db['SquareMessage'][_0xa7d8('0x29')],function(_0x35b5e2){return{'name':_0x35b5e2['fieldName'],'type':_0x35b5e2['type'][_0xa7d8('0x2a')]};});_0x54676b[_0xa7d8('0x2b')]=_[_0xa7d8('0x28')](_0xceee5a,'name');_0x54676b['query']=_['keys'](_0x3fb24f[_0xa7d8('0x2c')]);_0x54676b[_0xa7d8('0x2d')]=_['intersection'](_0x54676b[_0xa7d8('0x2b')],_0x54676b['query']);_0x31b73d[_0xa7d8('0x2e')]=_['intersection'](_0x54676b[_0xa7d8('0x2b')],qs[_0xa7d8('0x2f')](_0x3fb24f[_0xa7d8('0x2c')]['fields']));_0x31b73d[_0xa7d8('0x2e')]=_0x31b73d[_0xa7d8('0x2e')][_0xa7d8('0x30')]?_0x31b73d[_0xa7d8('0x2e')]:_0x54676b[_0xa7d8('0x2b')];if(!_0x3fb24f[_0xa7d8('0x2c')][_0xa7d8('0x31')](_0xa7d8('0x32'))){_0x31b73d[_0xa7d8('0x1e')]=qs[_0xa7d8('0x1e')](_0x3fb24f[_0xa7d8('0x2c')]['limit']);_0x31b73d[_0xa7d8('0x1c')]=qs[_0xa7d8('0x1c')](_0x3fb24f[_0xa7d8('0x2c')][_0xa7d8('0x1c')]);}_0x31b73d[_0xa7d8('0x33')]=qs['sort'](_0x3fb24f[_0xa7d8('0x2c')][_0xa7d8('0x34')]);_0x31b73d[_0xa7d8('0x35')]=qs[_0xa7d8('0x2d')](_[_0xa7d8('0x36')](_0x3fb24f[_0xa7d8('0x2c')],_0x54676b[_0xa7d8('0x2d')]),_0xceee5a);if(_0x3fb24f[_0xa7d8('0x2c')][_0xa7d8('0x37')]){_0x31b73d[_0xa7d8('0x35')]=_[_0xa7d8('0x38')](_0x31b73d[_0xa7d8('0x35')],{'$or':_['map'](_0xceee5a,function(_0x5d5e73){if(_0x5d5e73[_0xa7d8('0x39')]!=='VIRTUAL'){var _0x25875b={};_0x25875b[_0x5d5e73['name']]={'$like':'%'+_0x3fb24f[_0xa7d8('0x2c')][_0xa7d8('0x37')]+'%'};return _0x25875b;}})});}_0x31b73d=_[_0xa7d8('0x38')]({},_0x31b73d,_0x3fb24f[_0xa7d8('0x3a')]);var _0x177164={'where':_0x31b73d['where']};return db[_0xa7d8('0x3b')]['count'](_0x177164)[_0xa7d8('0x24')](function(_0x53c436){_0x4ea479[_0xa7d8('0x1f')]=_0x53c436;if(_0x3fb24f[_0xa7d8('0x2c')][_0xa7d8('0x3c')]){_0x31b73d[_0xa7d8('0x3d')]=[{'all':!![]}];}return db[_0xa7d8('0x3b')][_0xa7d8('0x3e')](_0x31b73d);})[_0xa7d8('0x24')](function(_0x1b5e33){_0x4ea479[_0xa7d8('0x3f')]=_0x1b5e33;return _0x4ea479;})[_0xa7d8('0x24')](respondWithFilteredResult(_0x23ca78,_0x31b73d))[_0xa7d8('0x40')](handleError(_0x23ca78,null));};exports[_0xa7d8('0x41')]=function(_0x2a322f,_0x5181a9){var _0x506efa={'raw':!![],'where':{'id':_0x2a322f[_0xa7d8('0x42')]['id']}},_0x1e8896={};_0x1e8896[_0xa7d8('0x2b')]=_[_0xa7d8('0x43')](db[_0xa7d8('0x3b')]['rawAttributes']);_0x1e8896[_0xa7d8('0x2c')]=_[_0xa7d8('0x43')](_0x2a322f[_0xa7d8('0x2c')]);_0x1e8896[_0xa7d8('0x2d')]=_['intersection'](_0x1e8896['model'],_0x1e8896['query']);_0x506efa[_0xa7d8('0x2e')]=_['intersection'](_0x1e8896[_0xa7d8('0x2b')],qs[_0xa7d8('0x2f')](_0x2a322f[_0xa7d8('0x2c')]['fields']));_0x506efa['attributes']=_0x506efa[_0xa7d8('0x2e')][_0xa7d8('0x30')]?_0x506efa[_0xa7d8('0x2e')]:_0x1e8896[_0xa7d8('0x2b')];if(_0x2a322f[_0xa7d8('0x2c')][_0xa7d8('0x3c')]){_0x506efa[_0xa7d8('0x3d')]=[{'all':!![]}];}_0x506efa=_[_0xa7d8('0x38')]({},_0x506efa,_0x2a322f[_0xa7d8('0x3a')]);return db[_0xa7d8('0x3b')][_0xa7d8('0x44')](_0x506efa)[_0xa7d8('0x24')](handleEntityNotFound(_0x5181a9,null))['then'](respondWithResult(_0x5181a9,null))[_0xa7d8('0x40')](handleError(_0x5181a9,null));};exports['create']=function(_0xd09bfd,_0x5666e6){return db[_0xa7d8('0x3b')][_0xa7d8('0x45')](_0xd09bfd[_0xa7d8('0x46')],{})[_0xa7d8('0x24')](respondWithResult(_0x5666e6,0xc9))[_0xa7d8('0x40')](handleError(_0x5666e6,null));};exports[_0xa7d8('0x23')]=function(_0x5e1f8d,_0x193e54){if(_0x5e1f8d[_0xa7d8('0x46')]['id']){delete _0x5e1f8d['body']['id'];}return db['SquareMessage']['find']({'where':{'id':_0x5e1f8d['params']['id']}})[_0xa7d8('0x24')](handleEntityNotFound(_0x193e54,null))['then'](saveUpdates(_0x5e1f8d[_0xa7d8('0x46')],null))[_0xa7d8('0x24')](respondWithResult(_0x193e54,null))[_0xa7d8('0x40')](handleError(_0x193e54,null));};exports['destroy']=function(_0x5c164d,_0x5c3ee3){return db[_0xa7d8('0x3b')][_0xa7d8('0x44')]({'where':{'id':_0x5c164d[_0xa7d8('0x42')]['id']}})[_0xa7d8('0x24')](handleEntityNotFound(_0x5c3ee3,null))[_0xa7d8('0x24')](removeEntity(_0x5c3ee3,null))[_0xa7d8('0x40')](handleError(_0x5c3ee3,null));}; \ No newline at end of file +var _0x383b=['jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','save','then','destroy','error','stack','name','send','index','map','SquareMessage','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','filters','filter','merge','VIRTUAL','includeAll','findAll','show','params','include','find','catch','create','body','update','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto'];(function(_0x5847ea,_0x59852f){var _0x37dd31=function(_0x17e746){while(--_0x17e746){_0x5847ea['push'](_0x5847ea['shift']());}};_0x37dd31(++_0x59852f);}(_0x383b,0x89));var _0xb383=function(_0x967587,_0xca265d){_0x967587=_0x967587-0x0;var _0x1e7ad0=_0x383b[_0x967587];return _0x1e7ad0;};'use strict';var emlformat=require(_0xb383('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb383('0x1'));var jsonpatch=require(_0xb383('0x2'));var rp=require(_0xb383('0x3'));var moment=require('moment');var BPromise=require(_0xb383('0x4'));var Mustache=require('mustache');var util=require(_0xb383('0x5'));var path=require(_0xb383('0x6'));var sox=require(_0xb383('0x7'));var csv=require(_0xb383('0x8'));var ejs=require(_0xb383('0x9'));var fs=require('fs');var fs_extra=require(_0xb383('0xa'));var _=require('lodash');var squel=require(_0xb383('0xb'));var crypto=require(_0xb383('0xc'));var jsforce=require(_0xb383('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb383('0xe'));var Papa=require(_0xb383('0xf'));var Redis=require(_0xb383('0x10'));var authService=require(_0xb383('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xb383('0x12'));var hardwareService=require(_0xb383('0x13'));var logger=require(_0xb383('0x14'))(_0xb383('0x15'));var utils=require(_0xb383('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xb383('0x17'));var db=require(_0xb383('0x18'))['db'];function respondWithStatusCode(_0x590783,_0x22001f){_0x22001f=_0x22001f||0xcc;return function(_0x16091f){if(_0x16091f){return _0x590783[_0xb383('0x19')](_0x22001f);}return _0x590783[_0xb383('0x1a')](_0x22001f)[_0xb383('0x1b')]();};}function respondWithResult(_0x1e8107,_0x41f716){_0x41f716=_0x41f716||0xc8;return function(_0x5f1c6e){if(_0x5f1c6e){return _0x1e8107[_0xb383('0x1a')](_0x41f716)[_0xb383('0x1c')](_0x5f1c6e);}};}function respondWithFilteredResult(_0x1cdcb7,_0xfbc68f){return function(_0x4b3cb5){if(_0x4b3cb5){var _0x41cf3f=typeof _0xfbc68f[_0xb383('0x1d')]===_0xb383('0x1e')&&typeof _0xfbc68f['limit']===_0xb383('0x1e');var _0x24a72e=_0x4b3cb5[_0xb383('0x1f')];var _0x11d0ed=_0x41cf3f?0x0:_0xfbc68f[_0xb383('0x1d')];var _0x421a36=_0x41cf3f?_0x4b3cb5['count']:_0xfbc68f[_0xb383('0x1d')]+_0xfbc68f['limit'];var _0x151642;if(_0x421a36>=_0x24a72e){_0x421a36=_0x24a72e;_0x151642=0xc8;}else{_0x151642=0xce;}_0x1cdcb7[_0xb383('0x1a')](_0x151642);return _0x1cdcb7[_0xb383('0x20')](_0xb383('0x21'),_0x11d0ed+'-'+_0x421a36+'/'+_0x24a72e)[_0xb383('0x1c')](_0x4b3cb5);}return null;};}function patchUpdates(_0x58bedb){return function(_0x1c9b4f){try{jsonpatch[_0xb383('0x22')](_0x1c9b4f,_0x58bedb,!![]);}catch(_0x1c0246){return BPromise['reject'](_0x1c0246);}return _0x1c9b4f[_0xb383('0x23')]();};}function saveUpdates(_0x45158e,_0x3c354c){return function(_0x571f83){if(_0x571f83){return _0x571f83['update'](_0x45158e)[_0xb383('0x24')](function(_0x127d1b){return _0x127d1b;});}return null;};}function removeEntity(_0x306dd7,_0x38d029){return function(_0xb0d2a8){if(_0xb0d2a8){return _0xb0d2a8[_0xb383('0x25')]()[_0xb383('0x24')](function(){_0x306dd7[_0xb383('0x1a')](0xcc)[_0xb383('0x1b')]();});}};}function handleEntityNotFound(_0x48ceef,_0x30f704){return function(_0x509ea6){if(!_0x509ea6){_0x48ceef[_0xb383('0x19')](0x194);}return _0x509ea6;};}function handleError(_0xbab0f6,_0xa5c39a){_0xa5c39a=_0xa5c39a||0x1f4;return function(_0x39f1fb){logger[_0xb383('0x26')](_0x39f1fb[_0xb383('0x27')]);if(_0x39f1fb[_0xb383('0x28')]){delete _0x39f1fb['name'];}_0xbab0f6[_0xb383('0x1a')](_0xa5c39a)[_0xb383('0x29')](_0x39f1fb);};}exports[_0xb383('0x2a')]=function(_0x2d304c,_0x4daf45){var _0x3797b7={},_0x10ea31={},_0x4ccb9c={'count':0x0,'rows':[]};var _0x1178db=_[_0xb383('0x2b')](db[_0xb383('0x2c')][_0xb383('0x2d')],function(_0x5d0a58){return{'name':_0x5d0a58[_0xb383('0x2e')],'type':_0x5d0a58[_0xb383('0x2f')]['key']};});_0x10ea31[_0xb383('0x30')]=_[_0xb383('0x2b')](_0x1178db,_0xb383('0x28'));_0x10ea31[_0xb383('0x31')]=_[_0xb383('0x32')](_0x2d304c[_0xb383('0x31')]);_0x10ea31['filters']=_[_0xb383('0x33')](_0x10ea31[_0xb383('0x30')],_0x10ea31[_0xb383('0x31')]);_0x3797b7[_0xb383('0x34')]=_[_0xb383('0x33')](_0x10ea31[_0xb383('0x30')],qs[_0xb383('0x35')](_0x2d304c[_0xb383('0x31')]['fields']));_0x3797b7[_0xb383('0x34')]=_0x3797b7[_0xb383('0x34')][_0xb383('0x36')]?_0x3797b7['attributes']:_0x10ea31[_0xb383('0x30')];if(!_0x2d304c[_0xb383('0x31')]['hasOwnProperty'](_0xb383('0x37'))){_0x3797b7[_0xb383('0x38')]=qs[_0xb383('0x38')](_0x2d304c['query'][_0xb383('0x38')]);_0x3797b7[_0xb383('0x1d')]=qs[_0xb383('0x1d')](_0x2d304c[_0xb383('0x31')][_0xb383('0x1d')]);}_0x3797b7[_0xb383('0x39')]=qs['sort'](_0x2d304c[_0xb383('0x31')][_0xb383('0x3a')]);_0x3797b7[_0xb383('0x3b')]=qs['filters'](_[_0xb383('0x3c')](_0x2d304c[_0xb383('0x31')],_0x10ea31[_0xb383('0x3d')]),_0x1178db);if(_0x2d304c[_0xb383('0x31')][_0xb383('0x3e')]){_0x3797b7[_0xb383('0x3b')]=_[_0xb383('0x3f')](_0x3797b7['where'],{'$or':_['map'](_0x1178db,function(_0x354295){if(_0x354295[_0xb383('0x2f')]!==_0xb383('0x40')){var _0x9fa900={};_0x9fa900[_0x354295[_0xb383('0x28')]]={'$like':'%'+_0x2d304c[_0xb383('0x31')][_0xb383('0x3e')]+'%'};return _0x9fa900;}})});}_0x3797b7=_[_0xb383('0x3f')]({},_0x3797b7,_0x2d304c['options']);var _0x232598={'where':_0x3797b7[_0xb383('0x3b')]};return db[_0xb383('0x2c')][_0xb383('0x1f')](_0x232598)['then'](function(_0x20c0c4){_0x4ccb9c[_0xb383('0x1f')]=_0x20c0c4;if(_0x2d304c['query'][_0xb383('0x41')]){_0x3797b7['include']=[{'all':!![]}];}return db[_0xb383('0x2c')][_0xb383('0x42')](_0x3797b7);})[_0xb383('0x24')](function(_0x1d50ea){_0x4ccb9c['rows']=_0x1d50ea;return _0x4ccb9c;})[_0xb383('0x24')](respondWithFilteredResult(_0x4daf45,_0x3797b7))['catch'](handleError(_0x4daf45,null));};exports[_0xb383('0x43')]=function(_0x4bb0ee,_0x282fd2){var _0x118b25={'raw':!![],'where':{'id':_0x4bb0ee[_0xb383('0x44')]['id']}},_0x272b35={};_0x272b35[_0xb383('0x30')]=_[_0xb383('0x32')](db[_0xb383('0x2c')][_0xb383('0x2d')]);_0x272b35[_0xb383('0x31')]=_[_0xb383('0x32')](_0x4bb0ee[_0xb383('0x31')]);_0x272b35['filters']=_[_0xb383('0x33')](_0x272b35[_0xb383('0x30')],_0x272b35[_0xb383('0x31')]);_0x118b25['attributes']=_[_0xb383('0x33')](_0x272b35[_0xb383('0x30')],qs[_0xb383('0x35')](_0x4bb0ee['query']['fields']));_0x118b25[_0xb383('0x34')]=_0x118b25[_0xb383('0x34')]['length']?_0x118b25[_0xb383('0x34')]:_0x272b35[_0xb383('0x30')];if(_0x4bb0ee[_0xb383('0x31')][_0xb383('0x41')]){_0x118b25[_0xb383('0x45')]=[{'all':!![]}];}_0x118b25=_[_0xb383('0x3f')]({},_0x118b25,_0x4bb0ee['options']);return db[_0xb383('0x2c')][_0xb383('0x46')](_0x118b25)['then'](handleEntityNotFound(_0x282fd2,null))['then'](respondWithResult(_0x282fd2,null))[_0xb383('0x47')](handleError(_0x282fd2,null));};exports['create']=function(_0x43cd23,_0x10d814){return db['SquareMessage'][_0xb383('0x48')](_0x43cd23[_0xb383('0x49')],{})[_0xb383('0x24')](respondWithResult(_0x10d814,0xc9))[_0xb383('0x47')](handleError(_0x10d814,null));};exports[_0xb383('0x4a')]=function(_0x4292c4,_0x4d7ddd){if(_0x4292c4['body']['id']){delete _0x4292c4[_0xb383('0x49')]['id'];}return db['SquareMessage'][_0xb383('0x46')]({'where':{'id':_0x4292c4[_0xb383('0x44')]['id']}})['then'](handleEntityNotFound(_0x4d7ddd,null))[_0xb383('0x24')](saveUpdates(_0x4292c4['body'],null))['then'](respondWithResult(_0x4d7ddd,null))['catch'](handleError(_0x4d7ddd,null));};exports[_0xb383('0x25')]=function(_0x4e2b7c,_0x451947){return db['SquareMessage'][_0xb383('0x46')]({'where':{'id':_0x4e2b7c[_0xb383('0x44')]['id']}})['then'](handleEntityNotFound(_0x451947,null))['then'](removeEntity(_0x451947,null))[_0xb383('0x47')](handleError(_0x451947,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index c436bcd..c1222f1 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 _0xa147=['./squareMessage.attributes','exports','define','square_messages','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa147,0x190));var _0x7a14=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xa147[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7a14('0x0'))(_0x7a14('0x1'));var moment=require(_0x7a14('0x2'));var BPromise=require(_0x7a14('0x3'));var rp=require(_0x7a14('0x4'));var fs=require('fs');var path=require(_0x7a14('0x5'));var rimraf=require('rimraf');var config=require(_0x7a14('0x6'));var attributes=require(_0x7a14('0x7'));module[_0x7a14('0x8')]=function(_0x17cc3b,_0x45343d){return _0x17cc3b[_0x7a14('0x9')]('SquareMessage',attributes,{'tableName':_0x7a14('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9cf1=['exports','define','SquareMessage','square_messages','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./squareMessage.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9cf1,0x7c));var _0x19cf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9cf1[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x19cf('0x0'));var logger=require(_0x19cf('0x1'))(_0x19cf('0x2'));var moment=require(_0x19cf('0x3'));var BPromise=require(_0x19cf('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x19cf('0x5'));var rimraf=require('rimraf');var config=require(_0x19cf('0x6'));var attributes=require(_0x19cf('0x7'));module[_0x19cf('0x8')]=function(_0x430c96,_0x16763c){return _0x430c96[_0x19cf('0x9')](_0x19cf('0xa'),attributes,{'tableName':_0x19cf('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.rpc.js b/server/api/squareMessage/squareMessage.rpc.js index aab3244..c312781 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 _0x5bde=['catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','CreateSquareMessage','SquareMessage','create','body','options','raw'];(function(_0x200ba2,_0x518aec){var _0xc9d1f6=function(_0x508867){while(--_0x508867){_0x200ba2['push'](_0x200ba2['shift']());}};_0xc9d1f6(++_0x518aec);}(_0x5bde,0x1dd));var _0xe5bd=function(_0x18d222,_0x1e9183){_0x18d222=_0x18d222-0x0;var _0x1c5c03=_0x5bde[_0x18d222];return _0x1c5c03;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe5bd('0x0'));var BPromise=require(_0xe5bd('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe5bd('0x2'));var db=require(_0xe5bd('0x3'))['db'];var utils=require(_0xe5bd('0x4'));var logger=require(_0xe5bd('0x5'))(_0xe5bd('0x6'));var config=require('../../config/environment');var jayson=require(_0xe5bd('0x7'));var client=jayson[_0xe5bd('0x8')][_0xe5bd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4c6696,_0x38cfd6,_0x120f22){return new BPromise(function(_0x2e7f03,_0x4df9cc){return client[_0xe5bd('0xa')](_0x4c6696,_0x120f22)[_0xe5bd('0xb')](function(_0x5c5046){logger['info'](_0xe5bd('0xc'),_0x38cfd6,_0xe5bd('0xd'));logger[_0xe5bd('0xe')](_0xe5bd('0xf'),_0x38cfd6,_0xe5bd('0xd'),JSON[_0xe5bd('0x10')](_0x5c5046));if(_0x5c5046[_0xe5bd('0x11')]){if(_0x5c5046[_0xe5bd('0x11')]['code']===0x1f4){logger[_0xe5bd('0x11')](_0xe5bd('0xc'),_0x38cfd6,_0x5c5046[_0xe5bd('0x11')][_0xe5bd('0x12')]);return _0x4df9cc(_0x5c5046[_0xe5bd('0x11')][_0xe5bd('0x12')]);}logger['error'](_0xe5bd('0xc'),_0x38cfd6,_0x5c5046[_0xe5bd('0x11')][_0xe5bd('0x12')]);return _0x2e7f03(_0x5c5046[_0xe5bd('0x11')][_0xe5bd('0x12')]);}else{logger[_0xe5bd('0x13')](_0xe5bd('0xc'),_0x38cfd6,_0xe5bd('0xd'));_0x2e7f03(_0x5c5046[_0xe5bd('0x14')][_0xe5bd('0x12')]);}})['catch'](function(_0xecc5b2){logger[_0xe5bd('0x11')](_0xe5bd('0xc'),_0x38cfd6,_0xecc5b2);_0x4df9cc(_0xecc5b2);});});}exports[_0xe5bd('0x15')]=function(_0x351cba){var _0x1fc97f=this;return new Promise(function(_0x15dd0b,_0xb01b0d){return db[_0xe5bd('0x16')][_0xe5bd('0x17')](_0x351cba[_0xe5bd('0x18')],{'raw':_0x351cba[_0xe5bd('0x19')]?_0x351cba['options'][_0xe5bd('0x1a')]===undefined?!![]:![]:!![]})[_0xe5bd('0xb')](function(_0x20569f){logger[_0xe5bd('0x13')](_0xe5bd('0x15'),_0x351cba);logger[_0xe5bd('0xe')](_0xe5bd('0x15'),_0x351cba,JSON[_0xe5bd('0x10')](_0x20569f));_0x15dd0b(_0x20569f);})[_0xe5bd('0x1b')](function(_0x5e75b5){logger[_0xe5bd('0x11')](_0xe5bd('0x15'),_0x5e75b5['message'],_0x351cba);_0xb01b0d(_0x1fc97f[_0xe5bd('0x11')](0x1f4,_0x5e75b5[_0xe5bd('0x12')]));});});}; \ No newline at end of file +var _0x6a0b=['../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','SquareMessage,\x20%s,\x20%s','SquareMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateSquareMessage','create','body','options','raw','then','info','debug','stringify','lodash','randomstring','ioredis'];(function(_0x27bc05,_0x1934f7){var _0x35e10a=function(_0x556cc7){while(--_0x556cc7){_0x27bc05['push'](_0x27bc05['shift']());}};_0x35e10a(++_0x1934f7);}(_0x6a0b,0xb3));var _0xb6a0=function(_0x4d616a,_0x1350fc){_0x4d616a=_0x4d616a-0x0;var _0x2281c8=_0x6a0b[_0x4d616a];return _0x2281c8;};'use strict';var _=require(_0xb6a0('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb6a0('0x1'));var fs=require('fs');var Redis=require(_0xb6a0('0x2'));var db=require(_0xb6a0('0x3'))['db'];var utils=require(_0xb6a0('0x4'));var logger=require(_0xb6a0('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb6a0('0x6'));var client=jayson[_0xb6a0('0x7')][_0xb6a0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5e7ec4,_0x2b4e16,_0x100e49){return new BPromise(function(_0x5afe0d,_0x4720b2){return client[_0xb6a0('0x9')](_0x5e7ec4,_0x100e49)['then'](function(_0x12ae72){logger['info'](_0xb6a0('0xa'),_0x2b4e16,'request\x20sent');logger['debug'](_0xb6a0('0xb'),_0x2b4e16,'request\x20sent',JSON['stringify'](_0x12ae72));if(_0x12ae72[_0xb6a0('0xc')]){if(_0x12ae72['error'][_0xb6a0('0xd')]===0x1f4){logger['error']('SquareMessage,\x20%s,\x20%s',_0x2b4e16,_0x12ae72[_0xb6a0('0xc')][_0xb6a0('0xe')]);return _0x4720b2(_0x12ae72[_0xb6a0('0xc')][_0xb6a0('0xe')]);}logger['error'](_0xb6a0('0xa'),_0x2b4e16,_0x12ae72[_0xb6a0('0xc')][_0xb6a0('0xe')]);return _0x5afe0d(_0x12ae72[_0xb6a0('0xc')][_0xb6a0('0xe')]);}else{logger['info'](_0xb6a0('0xa'),_0x2b4e16,'request\x20sent');_0x5afe0d(_0x12ae72[_0xb6a0('0xf')]['message']);}})[_0xb6a0('0x10')](function(_0x3f351f){logger['error'](_0xb6a0('0xa'),_0x2b4e16,_0x3f351f);_0x4720b2(_0x3f351f);});});}exports[_0xb6a0('0x11')]=function(_0x58f58c){var _0xe64ae3=this;return new Promise(function(_0x1cfce7,_0x26d9d1){return db['SquareMessage'][_0xb6a0('0x12')](_0x58f58c[_0xb6a0('0x13')],{'raw':_0x58f58c[_0xb6a0('0x14')]?_0x58f58c[_0xb6a0('0x14')][_0xb6a0('0x15')]===undefined?!![]:![]:!![]})[_0xb6a0('0x16')](function(_0x55d296){logger[_0xb6a0('0x17')](_0xb6a0('0x11'),_0x58f58c);logger[_0xb6a0('0x18')](_0xb6a0('0x11'),_0x58f58c,JSON[_0xb6a0('0x19')](_0x55d296));_0x1cfce7(_0x55d296);})['catch'](function(_0x4b4aaf){logger[_0xb6a0('0xc')](_0xb6a0('0x11'),_0x4b4aaf[_0xb6a0('0xe')],_0x58f58c);_0x26d9d1(_0xe64ae3['error'](0x1f4,_0x4b4aaf[_0xb6a0('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index c621a90..4ce116d 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 _0x2a68=['15s','post','create','put','update','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','/:id/test'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2a68,0x16d));var _0x82a6=function(_0x31ae77,_0x1c0eab){_0x31ae77=_0x31ae77-0x0;var _0x4f5294=_0x2a68[_0x31ae77];return _0x4f5294;};'use strict';var multer=require(_0x82a6('0x0'));var util=require('util');var path=require(_0x82a6('0x1'));var timeout=require(_0x82a6('0x2'));var express=require(_0x82a6('0x3'));var router=express['Router']();var fs_extra=require(_0x82a6('0x4'));var auth=require(_0x82a6('0x5'));var interaction=require(_0x82a6('0x6'));var config=require(_0x82a6('0x7'));var controller=require('./squareOdbc.controller');router[_0x82a6('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x82a6('0x8')](_0x82a6('0x9'),auth[_0x82a6('0xa')](),controller[_0x82a6('0xb')]);router[_0x82a6('0x8')](_0x82a6('0xc'),auth[_0x82a6('0xa')](),timeout(_0x82a6('0xd')),controller['test']);router[_0x82a6('0xe')]('/',auth[_0x82a6('0xa')](),controller[_0x82a6('0xf')]);router[_0x82a6('0x10')](_0x82a6('0x9'),auth[_0x82a6('0xa')](),controller[_0x82a6('0x11')]);router['delete']('/:id',auth[_0x82a6('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xfb30=['../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','show','/:id/test','test','post','create','put','/:id','delete','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x342e46,_0x201a75){var _0x36e5f3=function(_0x1318a9){while(--_0x1318a9){_0x342e46['push'](_0x342e46['shift']());}};_0x36e5f3(++_0x201a75);}(_0xfb30,0x8d));var _0x0fb3=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xfb30[_0x432682];return _0x463d05;};'use strict';var multer=require('multer');var util=require(_0x0fb3('0x0'));var path=require(_0x0fb3('0x1'));var timeout=require(_0x0fb3('0x2'));var express=require('express');var router=express[_0x0fb3('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0fb3('0x4'));var interaction=require(_0x0fb3('0x5'));var config=require(_0x0fb3('0x6'));var controller=require(_0x0fb3('0x7'));router[_0x0fb3('0x8')]('/',auth[_0x0fb3('0x9')](),controller[_0x0fb3('0xa')]);router['get']('/:id',auth[_0x0fb3('0x9')](),controller[_0x0fb3('0xb')]);router[_0x0fb3('0x8')](_0x0fb3('0xc'),auth['isAuthenticated'](),timeout('15s'),controller[_0x0fb3('0xd')]);router[_0x0fb3('0xe')]('/',auth[_0x0fb3('0x9')](),controller[_0x0fb3('0xf')]);router[_0x0fb3('0x10')](_0x0fb3('0x11'),auth[_0x0fb3('0x9')](),controller['update']);router[_0x0fb3('0x12')](_0x0fb3('0x11'),auth[_0x0fb3('0x9')](),controller[_0x0fb3('0x13')]);module[_0x0fb3('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 0492c33..8a36498 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 _0x23dd=['STRING','name'];(function(_0x432556,_0x55f363){var _0x1ee9ae=function(_0x363250){while(--_0x363250){_0x432556['push'](_0x432556['shift']());}};_0x1ee9ae(++_0x55f363);}(_0x23dd,0xac));var _0xd23d=function(_0x14edd1,_0x44b77f){_0x14edd1=_0x14edd1-0x0;var _0x41ffd7=_0x23dd[_0x14edd1];return _0x41ffd7;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xd23d('0x0')],'unique':_0xd23d('0x1'),'allowNull':![]},'dsn':{'type':Sequelize[_0xd23d('0x0')]},'description':{'type':Sequelize[_0xd23d('0x0')]}}; \ No newline at end of file +var _0xfa70=['sequelize','exports','STRING'];(function(_0x38577a,_0x221009){var _0x302303=function(_0x4132e7){while(--_0x4132e7){_0x38577a['push'](_0x38577a['shift']());}};_0x302303(++_0x221009);}(_0xfa70,0x156));var _0x0fa7=function(_0x118749,_0x50e848){_0x118749=_0x118749-0x0;var _0x20d489=_0xfa70[_0x118749];return _0x20d489;};'use strict';var Sequelize=require(_0x0fa7('0x0'));module[_0x0fa7('0x1')]={'name':{'type':Sequelize[_0x0fa7('0x2')],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 64b62dc..8406910 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 _0x540c=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','get','UserProfileResource','error','name','send','index','map','SquareOdbc','rawAttributes','fieldName','key','query','filters','model','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','test','dsn','odbc','openSync','closeSync','eml-format','rimraf','fast-json-patch','mustache','util','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x154192,_0x2d360f){var _0x3c2792=function(_0x2e257b){while(--_0x2e257b){_0x154192['push'](_0x154192['shift']());}};_0x3c2792(++_0x2d360f);}(_0x540c,0xee));var _0xc540=function(_0xeb25d2,_0x45bfb1){_0xeb25d2=_0xeb25d2-0x0;var _0x20dc84=_0x540c[_0xeb25d2];return _0x20dc84;};'use strict';var emlformat=require(_0xc540('0x0'));var rimraf=require(_0xc540('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc540('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc540('0x3'));var util=require(_0xc540('0x4'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc540('0x5'));var fs=require('fs');var fs_extra=require(_0xc540('0x6'));var _=require(_0xc540('0x7'));var squel=require(_0xc540('0x8'));var crypto=require(_0xc540('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc540('0xa'));var querystring=require(_0xc540('0xb'));var Papa=require(_0xc540('0xc'));var Redis=require(_0xc540('0xd'));var authService=require(_0xc540('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xc540('0xf'));var hardwareService=require(_0xc540('0x10'));var logger=require(_0xc540('0x11'))(_0xc540('0x12'));var utils=require(_0xc540('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xc540('0x14'));var db=require(_0xc540('0x15'))['db'];function respondWithStatusCode(_0x5e762a,_0x42e568){_0x42e568=_0x42e568||0xcc;return function(_0x34dbe9){if(_0x34dbe9){return _0x5e762a[_0xc540('0x16')](_0x42e568);}return _0x5e762a[_0xc540('0x17')](_0x42e568)[_0xc540('0x18')]();};}function respondWithResult(_0x18d43b,_0x2f50dc){_0x2f50dc=_0x2f50dc||0xc8;return function(_0x561824){if(_0x561824){return _0x18d43b['status'](_0x2f50dc)[_0xc540('0x19')](_0x561824);}};}function respondWithFilteredResult(_0x1c7ef2,_0x54e444){return function(_0x27fd92){if(_0x27fd92){var _0x4e4da3=typeof _0x54e444[_0xc540('0x1a')]===_0xc540('0x1b')&&typeof _0x54e444['limit']===_0xc540('0x1b');var _0x1c11c4=_0x27fd92[_0xc540('0x1c')];var _0x19632a=_0x4e4da3?0x0:_0x54e444[_0xc540('0x1a')];var _0x499594=_0x4e4da3?_0x27fd92[_0xc540('0x1c')]:_0x54e444[_0xc540('0x1a')]+_0x54e444[_0xc540('0x1d')];var _0x355a80;if(_0x499594>=_0x1c11c4){_0x499594=_0x1c11c4;_0x355a80=0xc8;}else{_0x355a80=0xce;}_0x1c7ef2[_0xc540('0x17')](_0x355a80);return _0x1c7ef2['set'](_0xc540('0x1e'),_0x19632a+'-'+_0x499594+'/'+_0x1c11c4)[_0xc540('0x19')](_0x27fd92);}return null;};}function patchUpdates(_0x588dd2){return function(_0x6039ce){try{jsonpatch[_0xc540('0x1f')](_0x6039ce,_0x588dd2,!![]);}catch(_0x2b8706){return BPromise[_0xc540('0x20')](_0x2b8706);}return _0x6039ce[_0xc540('0x21')]();};}function saveUpdates(_0x2f8ab2,_0x4ea59c){return function(_0x14f976){if(_0x14f976){return _0x14f976[_0xc540('0x22')](_0x2f8ab2)['then'](function(_0x38f19c){return _0x38f19c;});}return null;};}function removeEntity(_0x5d0237,_0xfd747a){return function(_0x4dac1f){if(_0x4dac1f){return _0x4dac1f['destroy']()[_0xc540('0x23')](function(){var _0x540a38=_0x4dac1f[_0xc540('0x24')]({'plain':!![]});var _0x188ca='ODBC';return db[_0xc540('0x25')]['destroy']({'where':{'type':_0x188ca,'resourceId':_0x540a38['id']}})[_0xc540('0x23')](function(){return _0x4dac1f;});})[_0xc540('0x23')](function(){_0x5d0237[_0xc540('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x514d3b,_0x5f2653){return function(_0x533e37){if(!_0x533e37){_0x514d3b[_0xc540('0x16')](0x194);}return _0x533e37;};}function handleError(_0x257650,_0x2831f2){_0x2831f2=_0x2831f2||0x1f4;return function(_0x2537f8){logger[_0xc540('0x26')](_0x2537f8['stack']);if(_0x2537f8[_0xc540('0x27')]){delete _0x2537f8['name'];}_0x257650[_0xc540('0x17')](_0x2831f2)[_0xc540('0x28')](_0x2537f8);};}exports[_0xc540('0x29')]=function(_0x1f6866,_0xf645d5){var _0x27e0b9={},_0xf1463f={},_0x32f53e={'count':0x0,'rows':[]};var _0x40121c=_[_0xc540('0x2a')](db[_0xc540('0x2b')][_0xc540('0x2c')],function(_0x236cc4){return{'name':_0x236cc4[_0xc540('0x2d')],'type':_0x236cc4['type'][_0xc540('0x2e')]};});_0xf1463f['model']=_[_0xc540('0x2a')](_0x40121c,_0xc540('0x27'));_0xf1463f[_0xc540('0x2f')]=_['keys'](_0x1f6866[_0xc540('0x2f')]);_0xf1463f[_0xc540('0x30')]=_['intersection'](_0xf1463f[_0xc540('0x31')],_0xf1463f[_0xc540('0x2f')]);_0x27e0b9[_0xc540('0x32')]=_[_0xc540('0x33')](_0xf1463f[_0xc540('0x31')],qs['fields'](_0x1f6866[_0xc540('0x2f')][_0xc540('0x34')]));_0x27e0b9[_0xc540('0x32')]=_0x27e0b9[_0xc540('0x32')][_0xc540('0x35')]?_0x27e0b9[_0xc540('0x32')]:_0xf1463f['model'];if(!_0x1f6866[_0xc540('0x2f')]['hasOwnProperty'](_0xc540('0x36'))){_0x27e0b9[_0xc540('0x1d')]=qs[_0xc540('0x1d')](_0x1f6866[_0xc540('0x2f')][_0xc540('0x1d')]);_0x27e0b9[_0xc540('0x1a')]=qs[_0xc540('0x1a')](_0x1f6866[_0xc540('0x2f')][_0xc540('0x1a')]);}_0x27e0b9[_0xc540('0x37')]=qs['sort'](_0x1f6866[_0xc540('0x2f')][_0xc540('0x38')]);_0x27e0b9[_0xc540('0x39')]=qs[_0xc540('0x30')](_[_0xc540('0x3a')](_0x1f6866[_0xc540('0x2f')],_0xf1463f[_0xc540('0x30')]),_0x40121c);if(_0x1f6866[_0xc540('0x2f')][_0xc540('0x3b')]){_0x27e0b9[_0xc540('0x39')]=_['merge'](_0x27e0b9[_0xc540('0x39')],{'$or':_[_0xc540('0x2a')](_0x40121c,function(_0x510184){if(_0x510184[_0xc540('0x3c')]!==_0xc540('0x3d')){var _0x2efa8a={};_0x2efa8a[_0x510184[_0xc540('0x27')]]={'$like':'%'+_0x1f6866[_0xc540('0x2f')][_0xc540('0x3b')]+'%'};return _0x2efa8a;}})});}_0x27e0b9=_['merge']({},_0x27e0b9,_0x1f6866[_0xc540('0x3e')]);var _0x4a90fb={'where':_0x27e0b9[_0xc540('0x39')]};return db['SquareOdbc'][_0xc540('0x1c')](_0x4a90fb)[_0xc540('0x23')](function(_0x1118b4){_0x32f53e[_0xc540('0x1c')]=_0x1118b4;if(_0x1f6866[_0xc540('0x2f')][_0xc540('0x3f')]){_0x27e0b9['include']=[{'all':!![]}];}return db[_0xc540('0x2b')][_0xc540('0x40')](_0x27e0b9);})['then'](function(_0x4ad921){_0x32f53e[_0xc540('0x41')]=_0x4ad921;return _0x32f53e;})['then'](respondWithFilteredResult(_0xf645d5,_0x27e0b9))[_0xc540('0x42')](handleError(_0xf645d5,null));};exports[_0xc540('0x43')]=function(_0x5026ca,_0x3ecc4a){var _0x6ebf8b={'raw':!![],'where':{'id':_0x5026ca[_0xc540('0x44')]['id']}},_0x58abb1={};_0x58abb1['model']=_[_0xc540('0x45')](db[_0xc540('0x2b')][_0xc540('0x2c')]);_0x58abb1['query']=_[_0xc540('0x45')](_0x5026ca[_0xc540('0x2f')]);_0x58abb1['filters']=_['intersection'](_0x58abb1['model'],_0x58abb1[_0xc540('0x2f')]);_0x6ebf8b['attributes']=_[_0xc540('0x33')](_0x58abb1[_0xc540('0x31')],qs[_0xc540('0x34')](_0x5026ca['query'][_0xc540('0x34')]));_0x6ebf8b['attributes']=_0x6ebf8b[_0xc540('0x32')]['length']?_0x6ebf8b['attributes']:_0x58abb1[_0xc540('0x31')];if(_0x5026ca[_0xc540('0x2f')][_0xc540('0x3f')]){_0x6ebf8b['include']=[{'all':!![]}];}_0x6ebf8b=_[_0xc540('0x46')]({},_0x6ebf8b,_0x5026ca[_0xc540('0x3e')]);return db[_0xc540('0x2b')][_0xc540('0x47')](_0x6ebf8b)[_0xc540('0x23')](handleEntityNotFound(_0x3ecc4a,null))[_0xc540('0x23')](respondWithResult(_0x3ecc4a,null))['catch'](handleError(_0x3ecc4a,null));};exports[_0xc540('0x48')]=function(_0x3a2895,_0x34e5ef){return db[_0xc540('0x2b')][_0xc540('0x48')](_0x3a2895[_0xc540('0x49')],{})[_0xc540('0x23')](function(_0xacc9bb){var _0x483e90=_0x3a2895[_0xc540('0x4a')][_0xc540('0x24')]({'plain':!![]});if(!_0x483e90)throw new Error(_0xc540('0x4b'));if(_0x483e90['role']===_0xc540('0x4a')){var _0x3386a3=_0xacc9bb['get']({'plain':!![]});var _0x740de0='ODBC';return db[_0xc540('0x4c')][_0xc540('0x47')]({'where':{'name':_0x740de0,'userProfileId':_0x483e90[_0xc540('0x4d')]},'raw':!![]})['then'](function(_0x27c16){if(_0x27c16&&_0x27c16[_0xc540('0x4e')]===0x0){return db[_0xc540('0x25')][_0xc540('0x48')]({'name':_0x3386a3[_0xc540('0x27')],'resourceId':_0x3386a3['id'],'type':_0x27c16[_0xc540('0x27')],'sectionId':_0x27c16['id']},{})[_0xc540('0x23')](function(){return _0xacc9bb;});}else{return _0xacc9bb;}})[_0xc540('0x42')](function(_0x7b1407){logger[_0xc540('0x26')](_0xc540('0x4f'),_0x7b1407);throw _0x7b1407;});}return _0xacc9bb;})[_0xc540('0x23')](respondWithResult(_0x34e5ef,0xc9))[_0xc540('0x42')](handleError(_0x34e5ef,null));};exports[_0xc540('0x22')]=function(_0x32045b,_0x5eacad){if(_0x32045b[_0xc540('0x49')]['id']){delete _0x32045b[_0xc540('0x49')]['id'];}return db[_0xc540('0x2b')][_0xc540('0x47')]({'where':{'id':_0x32045b[_0xc540('0x44')]['id']}})['then'](handleEntityNotFound(_0x5eacad,null))[_0xc540('0x23')](saveUpdates(_0x32045b[_0xc540('0x49')],null))[_0xc540('0x23')](respondWithResult(_0x5eacad,null))[_0xc540('0x42')](handleError(_0x5eacad,null));};exports[_0xc540('0x50')]=function(_0x11542a,_0x261217){return db[_0xc540('0x2b')][_0xc540('0x47')]({'where':{'id':_0x11542a[_0xc540('0x44')]['id']}})[_0xc540('0x23')](handleEntityNotFound(_0x261217,null))[_0xc540('0x23')](removeEntity(_0x261217,null))[_0xc540('0x42')](handleError(_0x261217,null));};exports[_0xc540('0x51')]=function(_0x2a652d,_0x36090d,_0x26c44){var _0x59c4f6;return db['SquareOdbc'][_0xc540('0x47')]({'where':{'id':_0x2a652d['params']['id']},'attributes':['id',_0xc540('0x52')]})[_0xc540('0x23')](handleEntityNotFound(_0x36090d,null))['then'](function(_0x164afa){if(_0x164afa){var _0xa52fcc=require(_0xc540('0x53'))();_0xa52fcc[_0xc540('0x54')](_0x164afa[_0xc540('0x52')]);_0xa52fcc[_0xc540('0x55')]();return _0x164afa;}})[_0xc540('0x23')](respondWithResult(_0x36090d,null))['catch'](handleError(_0x36090d,null));}; \ No newline at end of file +var _0xaad4=['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','limit','Content-Range','apply','reject','save','update','then','get','UserProfileResource','stack','name','index','map','SquareOdbc','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','options','includeAll','include','catch','show','params','length','find','create','user','role','ODBC','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','test','dsn','closeSync','eml-format','zip-dir','fast-json-patch','moment','bluebird','path','to-csv','ejs','fs-extra','squel'];(function(_0x36d018,_0x55bdaa){var _0x3ccf30=function(_0x3f376b){while(--_0x3f376b){_0x36d018['push'](_0x36d018['shift']());}};_0x3ccf30(++_0x55bdaa);}(_0xaad4,0x9c));var _0x4aad=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xaad4[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require(_0x4aad('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4aad('0x1'));var jsonpatch=require(_0x4aad('0x2'));var rp=require('request-promise');var moment=require(_0x4aad('0x3'));var BPromise=require(_0x4aad('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4aad('0x5'));var sox=require('sox');var csv=require(_0x4aad('0x6'));var ejs=require(_0x4aad('0x7'));var fs=require('fs');var fs_extra=require(_0x4aad('0x8'));var _=require('lodash');var squel=require(_0x4aad('0x9'));var crypto=require('crypto');var jsforce=require(_0x4aad('0xa'));var deskjs=require(_0x4aad('0xb'));var toCsv=require(_0x4aad('0x6'));var querystring=require('querystring');var Papa=require(_0x4aad('0xc'));var Redis=require('ioredis');var authService=require(_0x4aad('0xd'));var qs=require(_0x4aad('0xe'));var as=require(_0x4aad('0xf'));var hardwareService=require(_0x4aad('0x10'));var logger=require(_0x4aad('0x11'))(_0x4aad('0x12'));var utils=require(_0x4aad('0x13'));var config=require(_0x4aad('0x14'));var licenseUtil=require(_0x4aad('0x15'));var db=require(_0x4aad('0x16'))['db'];function respondWithStatusCode(_0x7a51b9,_0x3063b1){_0x3063b1=_0x3063b1||0xcc;return function(_0x51f622){if(_0x51f622){return _0x7a51b9[_0x4aad('0x17')](_0x3063b1);}return _0x7a51b9[_0x4aad('0x18')](_0x3063b1)[_0x4aad('0x19')]();};}function respondWithResult(_0x6cc4dd,_0x4a1d50){_0x4a1d50=_0x4a1d50||0xc8;return function(_0x3904de){if(_0x3904de){return _0x6cc4dd[_0x4aad('0x18')](_0x4a1d50)['json'](_0x3904de);}};}function respondWithFilteredResult(_0x172381,_0x59b815){return function(_0xd4d53e){if(_0xd4d53e){var _0x58441d=typeof _0x59b815[_0x4aad('0x1a')]===_0x4aad('0x1b')&&typeof _0x59b815['limit']===_0x4aad('0x1b');var _0x5e4a92=_0xd4d53e[_0x4aad('0x1c')];var _0x34cf08=_0x58441d?0x0:_0x59b815[_0x4aad('0x1a')];var _0x1e5b6c=_0x58441d?_0xd4d53e[_0x4aad('0x1c')]:_0x59b815[_0x4aad('0x1a')]+_0x59b815[_0x4aad('0x1d')];var _0x6560ab;if(_0x1e5b6c>=_0x5e4a92){_0x1e5b6c=_0x5e4a92;_0x6560ab=0xc8;}else{_0x6560ab=0xce;}_0x172381['status'](_0x6560ab);return _0x172381['set'](_0x4aad('0x1e'),_0x34cf08+'-'+_0x1e5b6c+'/'+_0x5e4a92)['json'](_0xd4d53e);}return null;};}function patchUpdates(_0x120db4){return function(_0x1da564){try{jsonpatch[_0x4aad('0x1f')](_0x1da564,_0x120db4,!![]);}catch(_0x1d43a3){return BPromise[_0x4aad('0x20')](_0x1d43a3);}return _0x1da564[_0x4aad('0x21')]();};}function saveUpdates(_0x5abb41,_0xea9840){return function(_0x5d4a78){if(_0x5d4a78){return _0x5d4a78[_0x4aad('0x22')](_0x5abb41)[_0x4aad('0x23')](function(_0xd6c99){return _0xd6c99;});}return null;};}function removeEntity(_0x12e0cf,_0x285ff1){return function(_0x32861c){if(_0x32861c){return _0x32861c['destroy']()['then'](function(){var _0x2cf595=_0x32861c[_0x4aad('0x24')]({'plain':!![]});var _0x1f8206='ODBC';return db[_0x4aad('0x25')]['destroy']({'where':{'type':_0x1f8206,'resourceId':_0x2cf595['id']}})[_0x4aad('0x23')](function(){return _0x32861c;});})[_0x4aad('0x23')](function(){_0x12e0cf[_0x4aad('0x18')](0xcc)[_0x4aad('0x19')]();});}};}function handleEntityNotFound(_0x2a3781,_0x3fa70c){return function(_0x113494){if(!_0x113494){_0x2a3781['sendStatus'](0x194);}return _0x113494;};}function handleError(_0x436786,_0x140260){_0x140260=_0x140260||0x1f4;return function(_0x455780){logger['error'](_0x455780[_0x4aad('0x26')]);if(_0x455780['name']){delete _0x455780[_0x4aad('0x27')];}_0x436786[_0x4aad('0x18')](_0x140260)['send'](_0x455780);};}exports[_0x4aad('0x28')]=function(_0x2c6e02,_0xff4cff){var _0x33932b={},_0x1b3057={},_0x3ac9e7={'count':0x0,'rows':[]};var _0x221655=_[_0x4aad('0x29')](db[_0x4aad('0x2a')][_0x4aad('0x2b')],function(_0x49465a){return{'name':_0x49465a[_0x4aad('0x2c')],'type':_0x49465a[_0x4aad('0x2d')]['key']};});_0x1b3057[_0x4aad('0x2e')]=_[_0x4aad('0x29')](_0x221655,_0x4aad('0x27'));_0x1b3057[_0x4aad('0x2f')]=_[_0x4aad('0x30')](_0x2c6e02['query']);_0x1b3057['filters']=_[_0x4aad('0x31')](_0x1b3057[_0x4aad('0x2e')],_0x1b3057[_0x4aad('0x2f')]);_0x33932b[_0x4aad('0x32')]=_[_0x4aad('0x31')](_0x1b3057[_0x4aad('0x2e')],qs[_0x4aad('0x33')](_0x2c6e02['query'][_0x4aad('0x33')]));_0x33932b[_0x4aad('0x32')]=_0x33932b['attributes']['length']?_0x33932b['attributes']:_0x1b3057['model'];if(!_0x2c6e02[_0x4aad('0x2f')][_0x4aad('0x34')](_0x4aad('0x35'))){_0x33932b[_0x4aad('0x1d')]=qs[_0x4aad('0x1d')](_0x2c6e02[_0x4aad('0x2f')][_0x4aad('0x1d')]);_0x33932b['offset']=qs[_0x4aad('0x1a')](_0x2c6e02[_0x4aad('0x2f')]['offset']);}_0x33932b[_0x4aad('0x36')]=qs[_0x4aad('0x37')](_0x2c6e02[_0x4aad('0x2f')]['sort']);_0x33932b[_0x4aad('0x38')]=qs['filters'](_['pick'](_0x2c6e02[_0x4aad('0x2f')],_0x1b3057[_0x4aad('0x39')]),_0x221655);if(_0x2c6e02[_0x4aad('0x2f')]['filter']){_0x33932b['where']=_[_0x4aad('0x3a')](_0x33932b['where'],{'$or':_[_0x4aad('0x29')](_0x221655,function(_0xdc2c9f){if(_0xdc2c9f[_0x4aad('0x2d')]!==_0x4aad('0x3b')){var _0x5e0379={};_0x5e0379[_0xdc2c9f['name']]={'$like':'%'+_0x2c6e02[_0x4aad('0x2f')][_0x4aad('0x3c')]+'%'};return _0x5e0379;}})});}_0x33932b=_[_0x4aad('0x3a')]({},_0x33932b,_0x2c6e02[_0x4aad('0x3d')]);var _0x3cac47={'where':_0x33932b[_0x4aad('0x38')]};return db['SquareOdbc'][_0x4aad('0x1c')](_0x3cac47)[_0x4aad('0x23')](function(_0x3e750e){_0x3ac9e7[_0x4aad('0x1c')]=_0x3e750e;if(_0x2c6e02[_0x4aad('0x2f')][_0x4aad('0x3e')]){_0x33932b[_0x4aad('0x3f')]=[{'all':!![]}];}return db['SquareOdbc']['findAll'](_0x33932b);})[_0x4aad('0x23')](function(_0x262368){_0x3ac9e7['rows']=_0x262368;return _0x3ac9e7;})[_0x4aad('0x23')](respondWithFilteredResult(_0xff4cff,_0x33932b))[_0x4aad('0x40')](handleError(_0xff4cff,null));};exports[_0x4aad('0x41')]=function(_0x3a58bf,_0x57c326){var _0x16d245={'raw':!![],'where':{'id':_0x3a58bf[_0x4aad('0x42')]['id']}},_0x4b5f10={};_0x4b5f10['model']=_['keys'](db[_0x4aad('0x2a')][_0x4aad('0x2b')]);_0x4b5f10['query']=_[_0x4aad('0x30')](_0x3a58bf[_0x4aad('0x2f')]);_0x4b5f10[_0x4aad('0x39')]=_[_0x4aad('0x31')](_0x4b5f10['model'],_0x4b5f10[_0x4aad('0x2f')]);_0x16d245[_0x4aad('0x32')]=_[_0x4aad('0x31')](_0x4b5f10[_0x4aad('0x2e')],qs['fields'](_0x3a58bf[_0x4aad('0x2f')][_0x4aad('0x33')]));_0x16d245['attributes']=_0x16d245[_0x4aad('0x32')][_0x4aad('0x43')]?_0x16d245['attributes']:_0x4b5f10[_0x4aad('0x2e')];if(_0x3a58bf[_0x4aad('0x2f')][_0x4aad('0x3e')]){_0x16d245[_0x4aad('0x3f')]=[{'all':!![]}];}_0x16d245=_['merge']({},_0x16d245,_0x3a58bf[_0x4aad('0x3d')]);return db['SquareOdbc'][_0x4aad('0x44')](_0x16d245)['then'](handleEntityNotFound(_0x57c326,null))['then'](respondWithResult(_0x57c326,null))[_0x4aad('0x40')](handleError(_0x57c326,null));};exports['create']=function(_0x216c45,_0x25fcc3){return db[_0x4aad('0x2a')][_0x4aad('0x45')](_0x216c45['body'],{})['then'](function(_0x323bfb){var _0x30b078=_0x216c45[_0x4aad('0x46')][_0x4aad('0x24')]({'plain':!![]});if(!_0x30b078)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x30b078[_0x4aad('0x47')]==='user'){var _0x31a4e2=_0x323bfb[_0x4aad('0x24')]({'plain':!![]});var _0x3ec8bc=_0x4aad('0x48');return db[_0x4aad('0x49')][_0x4aad('0x44')]({'where':{'name':_0x3ec8bc,'userProfileId':_0x30b078[_0x4aad('0x4a')]},'raw':!![]})[_0x4aad('0x23')](function(_0x5581fa){if(_0x5581fa&&_0x5581fa[_0x4aad('0x4b')]===0x0){return db['UserProfileResource'][_0x4aad('0x45')]({'name':_0x31a4e2['name'],'resourceId':_0x31a4e2['id'],'type':_0x5581fa[_0x4aad('0x27')],'sectionId':_0x5581fa['id']},{})[_0x4aad('0x23')](function(){return _0x323bfb;});}else{return _0x323bfb;}})[_0x4aad('0x40')](function(_0x2bbcca){logger[_0x4aad('0x4c')](_0x4aad('0x4d'),_0x2bbcca);throw _0x2bbcca;});}return _0x323bfb;})[_0x4aad('0x23')](respondWithResult(_0x25fcc3,0xc9))[_0x4aad('0x40')](handleError(_0x25fcc3,null));};exports[_0x4aad('0x22')]=function(_0xa1133d,_0x403d87){if(_0xa1133d['body']['id']){delete _0xa1133d[_0x4aad('0x4e')]['id'];}return db[_0x4aad('0x2a')]['find']({'where':{'id':_0xa1133d[_0x4aad('0x42')]['id']}})[_0x4aad('0x23')](handleEntityNotFound(_0x403d87,null))[_0x4aad('0x23')](saveUpdates(_0xa1133d[_0x4aad('0x4e')],null))['then'](respondWithResult(_0x403d87,null))['catch'](handleError(_0x403d87,null));};exports[_0x4aad('0x4f')]=function(_0xdb3dc,_0x465e90){return db[_0x4aad('0x2a')][_0x4aad('0x44')]({'where':{'id':_0xdb3dc[_0x4aad('0x42')]['id']}})[_0x4aad('0x23')](handleEntityNotFound(_0x465e90,null))[_0x4aad('0x23')](removeEntity(_0x465e90,null))['catch'](handleError(_0x465e90,null));};exports[_0x4aad('0x50')]=function(_0x4dcefb,_0x510bc2,_0x5a2600){var _0x2b2940;return db['SquareOdbc']['find']({'where':{'id':_0x4dcefb['params']['id']},'attributes':['id','dsn']})[_0x4aad('0x23')](handleEntityNotFound(_0x510bc2,null))[_0x4aad('0x23')](function(_0x448a92){if(_0x448a92){var _0x39ff5f=require('odbc')();_0x39ff5f['openSync'](_0x448a92[_0x4aad('0x51')]);_0x39ff5f[_0x4aad('0x52')]();return _0x448a92;}})[_0x4aad('0x23')](respondWithResult(_0x510bc2,null))[_0x4aad('0x40')](handleError(_0x510bc2,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 4d1f52c..8e4ff2a 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 _0xf207=['define','SquareOdbc','square_odbc','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./squareOdbc.attributes'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xf207,0x13b));var _0x7f20=function(_0x2bcd1f,_0x4f1972){_0x2bcd1f=_0x2bcd1f-0x0;var _0x2381ca=_0xf207[_0x2bcd1f];return _0x2381ca;};'use strict';var _=require(_0x7f20('0x0'));var util=require('util');var logger=require(_0x7f20('0x1'))(_0x7f20('0x2'));var moment=require('moment');var BPromise=require(_0x7f20('0x3'));var rp=require(_0x7f20('0x4'));var fs=require('fs');var path=require(_0x7f20('0x5'));var rimraf=require(_0x7f20('0x6'));var config=require(_0x7f20('0x7'));var attributes=require(_0x7f20('0x8'));module['exports']=function(_0x3367ec,_0x150f07){return _0x3367ec[_0x7f20('0x9')](_0x7f20('0xa'),attributes,{'tableName':_0x7f20('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb94f=['util','api','moment','bluebird','rimraf','../../config/environment','./squareOdbc.attributes','exports','define','square_odbc','lodash'];(function(_0x2d67fa,_0x4edc78){var _0x350f91=function(_0x46eeeb){while(--_0x46eeeb){_0x2d67fa['push'](_0x2d67fa['shift']());}};_0x350f91(++_0x4edc78);}(_0xb94f,0x112));var _0xfb94=function(_0x880aed,_0x16597b){_0x880aed=_0x880aed-0x0;var _0x40df37=_0xb94f[_0x880aed];return _0x40df37;};'use strict';var _=require(_0xfb94('0x0'));var util=require(_0xfb94('0x1'));var logger=require('../../config/logger')(_0xfb94('0x2'));var moment=require(_0xfb94('0x3'));var BPromise=require(_0xfb94('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xfb94('0x5'));var config=require(_0xfb94('0x6'));var attributes=require(_0xfb94('0x7'));module[_0xfb94('0x8')]=function(_0x1e714b,_0xfa6a62){return _0x1e714b[_0xfb94('0x9')]('SquareOdbc',attributes,{'tableName':_0xfb94('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.rpc.js b/server/api/squareOdbc/squareOdbc.rpc.js index 1ce14e9..c958709 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 _0xf0b9=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','error','code','SquareOdbc,\x20%s,\x20%s','message','result','catch','find','options','raw','where','attributes','include','model','map','ShowSquareOdbc','stringify','lodash','moment','bluebird'];(function(_0x3d5167,_0x396b5f){var _0x46c612=function(_0x32c3c4){while(--_0x32c3c4){_0x3d5167['push'](_0x3d5167['shift']());}};_0x46c612(++_0x396b5f);}(_0xf0b9,0x10b));var _0x9f0b=function(_0x24b479,_0x2c4b52){_0x24b479=_0x24b479-0x0;var _0x4c14b4=_0xf0b9[_0x24b479];return _0x4c14b4;};'use strict';var _=require(_0x9f0b('0x0'));var util=require('util');var moment=require(_0x9f0b('0x1'));var BPromise=require(_0x9f0b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9f0b('0x3'))['db'];var utils=require(_0x9f0b('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x9f0b('0x5'));var jayson=require(_0x9f0b('0x6'));var client=jayson[_0x9f0b('0x7')][_0x9f0b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4fca74,_0x377d8c,_0x2c4097){return new BPromise(function(_0x2f7b11,_0x4c0f96){return client[_0x9f0b('0x9')](_0x4fca74,_0x2c4097)[_0x9f0b('0xa')](function(_0x344a2b){logger[_0x9f0b('0xb')]('SquareOdbc,\x20%s,\x20%s',_0x377d8c,_0x9f0b('0xc'));logger[_0x9f0b('0xd')]('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x377d8c,_0x9f0b('0xc'),JSON['stringify'](_0x344a2b));if(_0x344a2b[_0x9f0b('0xe')]){if(_0x344a2b['error'][_0x9f0b('0xf')]===0x1f4){logger[_0x9f0b('0xe')](_0x9f0b('0x10'),_0x377d8c,_0x344a2b[_0x9f0b('0xe')][_0x9f0b('0x11')]);return _0x4c0f96(_0x344a2b[_0x9f0b('0xe')][_0x9f0b('0x11')]);}logger[_0x9f0b('0xe')](_0x9f0b('0x10'),_0x377d8c,_0x344a2b['error']['message']);return _0x2f7b11(_0x344a2b[_0x9f0b('0xe')][_0x9f0b('0x11')]);}else{logger[_0x9f0b('0xb')](_0x9f0b('0x10'),_0x377d8c,'request\x20sent');_0x2f7b11(_0x344a2b[_0x9f0b('0x12')]['message']);}})[_0x9f0b('0x13')](function(_0x3df4c1){logger[_0x9f0b('0xe')](_0x9f0b('0x10'),_0x377d8c,_0x3df4c1);_0x4c0f96(_0x3df4c1);});});}exports['ShowSquareOdbc']=function(_0x3275be){var _0x49e392=this;return new Promise(function(_0x290f89,_0x1bb80b){return db['SquareOdbc'][_0x9f0b('0x14')]({'raw':_0x3275be['options']?_0x3275be[_0x9f0b('0x15')][_0x9f0b('0x16')]===undefined?!![]:![]:!![],'where':_0x3275be['options']?_0x3275be[_0x9f0b('0x15')][_0x9f0b('0x17')]||null:null,'attributes':_0x3275be[_0x9f0b('0x15')]?_0x3275be[_0x9f0b('0x15')][_0x9f0b('0x18')]||null:null,'include':_0x3275be[_0x9f0b('0x15')]?_0x3275be['options'][_0x9f0b('0x19')]?_['map'](_0x3275be[_0x9f0b('0x15')][_0x9f0b('0x19')],function(_0xdf024f){return{'model':db[_0xdf024f[_0x9f0b('0x1a')]],'as':_0xdf024f['as'],'attributes':_0xdf024f[_0x9f0b('0x18')],'include':_0xdf024f[_0x9f0b('0x19')]?_[_0x9f0b('0x1b')](_0xdf024f[_0x9f0b('0x19')],function(_0x4dda33){return{'model':db[_0x4dda33[_0x9f0b('0x1a')]],'as':_0x4dda33['as'],'attributes':_0x4dda33['attributes'],'include':_0x4dda33['include']?_[_0x9f0b('0x1b')](_0x4dda33[_0x9f0b('0x19')],function(_0x4f1107){return{'model':db[_0x4f1107['model']],'as':_0x4f1107['as'],'attributes':_0x4f1107[_0x9f0b('0x18')]};}):[]};}):[]};}):[]:[]})[_0x9f0b('0xa')](function(_0x3f685f){logger['info'](_0x9f0b('0x1c'),_0x3275be);logger['debug']('ShowSquareOdbc',_0x3275be,JSON[_0x9f0b('0x1d')](_0x3f685f));_0x290f89(_0x3f685f);})['catch'](function(_0x2833dd){logger[_0x9f0b('0xe')](_0x9f0b('0x1c'),_0x2833dd['message'],_0x3275be);_0x1bb80b(_0x49e392[_0x9f0b('0xe')](0x1f4,_0x2833dd[_0x9f0b('0x11')]));});});}; \ No newline at end of file +var _0xd2df=['rpc','../../config/environment','http','then','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','error','code','SquareOdbc,\x20%s,\x20%s','message','info','result','catch','options','raw','where','attributes','include','map','model','ShowSquareOdbc','stringify','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x2fb897,_0x31fc63){var _0x2d0678=function(_0x591aaf){while(--_0x591aaf){_0x2fb897['push'](_0x2fb897['shift']());}};_0x2d0678(++_0x31fc63);}(_0xd2df,0x1bb));var _0xfd2d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd2df[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xfd2d('0x0'));var moment=require(_0xfd2d('0x1'));var BPromise=require(_0xfd2d('0x2'));var rs=require(_0xfd2d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfd2d('0x4'))['db'];var utils=require(_0xfd2d('0x5'));var logger=require(_0xfd2d('0x6'))(_0xfd2d('0x7'));var config=require(_0xfd2d('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xfd2d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x309ab1,_0x482685,_0x50bbdc){return new BPromise(function(_0x2a9e13,_0x32d168){return client['request'](_0x309ab1,_0x50bbdc)[_0xfd2d('0xa')](function(_0x2a678b){logger['info']('SquareOdbc,\x20%s,\x20%s',_0x482685,_0xfd2d('0xb'));logger[_0xfd2d('0xc')](_0xfd2d('0xd'),_0x482685,'request\x20sent',JSON['stringify'](_0x2a678b));if(_0x2a678b[_0xfd2d('0xe')]){if(_0x2a678b[_0xfd2d('0xe')][_0xfd2d('0xf')]===0x1f4){logger['error'](_0xfd2d('0x10'),_0x482685,_0x2a678b[_0xfd2d('0xe')]['message']);return _0x32d168(_0x2a678b['error']['message']);}logger[_0xfd2d('0xe')](_0xfd2d('0x10'),_0x482685,_0x2a678b['error']['message']);return _0x2a9e13(_0x2a678b[_0xfd2d('0xe')][_0xfd2d('0x11')]);}else{logger[_0xfd2d('0x12')](_0xfd2d('0x10'),_0x482685,_0xfd2d('0xb'));_0x2a9e13(_0x2a678b[_0xfd2d('0x13')][_0xfd2d('0x11')]);}})[_0xfd2d('0x14')](function(_0x3dc1ba){logger[_0xfd2d('0xe')](_0xfd2d('0x10'),_0x482685,_0x3dc1ba);_0x32d168(_0x3dc1ba);});});}exports['ShowSquareOdbc']=function(_0x3047a8){var _0x315690=this;return new Promise(function(_0x7caf62,_0x23f3c0){return db['SquareOdbc']['find']({'raw':_0x3047a8[_0xfd2d('0x15')]?_0x3047a8[_0xfd2d('0x15')][_0xfd2d('0x16')]===undefined?!![]:![]:!![],'where':_0x3047a8[_0xfd2d('0x15')]?_0x3047a8['options'][_0xfd2d('0x17')]||null:null,'attributes':_0x3047a8[_0xfd2d('0x15')]?_0x3047a8[_0xfd2d('0x15')][_0xfd2d('0x18')]||null:null,'include':_0x3047a8['options']?_0x3047a8[_0xfd2d('0x15')][_0xfd2d('0x19')]?_[_0xfd2d('0x1a')](_0x3047a8[_0xfd2d('0x15')][_0xfd2d('0x19')],function(_0x97809c){return{'model':db[_0x97809c[_0xfd2d('0x1b')]],'as':_0x97809c['as'],'attributes':_0x97809c[_0xfd2d('0x18')],'include':_0x97809c[_0xfd2d('0x19')]?_[_0xfd2d('0x1a')](_0x97809c[_0xfd2d('0x19')],function(_0x6241cf){return{'model':db[_0x6241cf[_0xfd2d('0x1b')]],'as':_0x6241cf['as'],'attributes':_0x6241cf['attributes'],'include':_0x6241cf[_0xfd2d('0x19')]?_['map'](_0x6241cf[_0xfd2d('0x19')],function(_0x284a8){return{'model':db[_0x284a8[_0xfd2d('0x1b')]],'as':_0x284a8['as'],'attributes':_0x284a8[_0xfd2d('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x7a4e9b){logger[_0xfd2d('0x12')](_0xfd2d('0x1c'),_0x3047a8);logger[_0xfd2d('0xc')](_0xfd2d('0x1c'),_0x3047a8,JSON[_0xfd2d('0x1d')](_0x7a4e9b));_0x7caf62(_0x7a4e9b);})['catch'](function(_0x49e452){logger[_0xfd2d('0xe')](_0xfd2d('0x1c'),_0x49e452[_0xfd2d('0x11')],_0x3047a8);_0x23f3c0(_0x315690['error'](0x1f4,_0x49e452[_0xfd2d('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 44dddc3..97545fd 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 _0x2735=['delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./squareProject.controller','isAuthenticated','/:id','show','create','update'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x2735,0x124));var _0x5273=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0x2735[_0x3899d1];return _0xeb4a7d;};'use strict';var multer=require(_0x5273('0x0'));var util=require(_0x5273('0x1'));var path=require(_0x5273('0x2'));var timeout=require(_0x5273('0x3'));var express=require(_0x5273('0x4'));var router=express['Router']();var fs_extra=require(_0x5273('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x5273('0x6'));var config=require(_0x5273('0x7'));var controller=require(_0x5273('0x8'));router['get']('/',auth[_0x5273('0x9')](),controller['index']);router['get'](_0x5273('0xa'),auth[_0x5273('0x9')](),controller[_0x5273('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x5273('0xc')]);router['put'](_0x5273('0xa'),auth[_0x5273('0x9')](),controller[_0x5273('0xd')]);router[_0x5273('0xe')](_0x5273('0xa'),auth['isAuthenticated'](),controller[_0x5273('0xf')]);module[_0x5273('0x10')]=router; \ No newline at end of file +var _0x126e=['multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./squareProject.controller','index','/:id','isAuthenticated','show','put','delete','destroy','exports'];(function(_0x592abe,_0x82a200){var _0x43ca7c=function(_0x4d0691){while(--_0x4d0691){_0x592abe['push'](_0x592abe['shift']());}};_0x43ca7c(++_0x82a200);}(_0x126e,0x1cb));var _0xe126=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x126e[_0x42245d];return _0x4b211a;};'use strict';var multer=require(_0xe126('0x0'));var util=require(_0xe126('0x1'));var path=require(_0xe126('0x2'));var timeout=require(_0xe126('0x3'));var express=require(_0xe126('0x4'));var router=express['Router']();var fs_extra=require(_0xe126('0x5'));var auth=require(_0xe126('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe126('0x7'));var controller=require(_0xe126('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xe126('0x9')]);router['get'](_0xe126('0xa'),auth[_0xe126('0xb')](),controller[_0xe126('0xc')]);router['post']('/',auth[_0xe126('0xb')](),controller['create']);router[_0xe126('0xd')]('/:id',auth[_0xe126('0xb')](),controller['update']);router[_0xe126('0xe')]('/:id',auth[_0xe126('0xb')](),controller[_0xe126('0xf')]);module[_0xe126('0x10')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 4e1dcd9..a4be1c0 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 _0x50e4=['TEXT','BLOB','long','preproduction','toString','utf8','getDataValue','production','DATE','sequelize','exports','STRING'];(function(_0x4d7c86,_0x9b62a6){var _0x59443d=function(_0x5af971){while(--_0x5af971){_0x4d7c86['push'](_0x4d7c86['shift']());}};_0x59443d(++_0x9b62a6);}(_0x50e4,0x1c5));var _0x450e=function(_0x2261ce,_0x9ed8b6){_0x2261ce=_0x2261ce-0x0;var _0x524640=_0x50e4[_0x2261ce];return _0x524640;};'use strict';var Sequelize=require(_0x450e('0x0'));module[_0x450e('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x450e('0x2')]},'notes':{'type':Sequelize[_0x450e('0x3')]},'preproduction':{'type':Sequelize[_0x450e('0x4')](_0x450e('0x5')),'get':function(){if(this['getDataValue'](_0x450e('0x6'))){return this['getDataValue'](_0x450e('0x6'))[_0x450e('0x7')](_0x450e('0x8'));}}},'production':{'type':Sequelize[_0x450e('0x4')](_0x450e('0x5')),'get':function(){if(this[_0x450e('0x9')](_0x450e('0xa'))){return this['getDataValue'](_0x450e('0xa'))[_0x450e('0x7')](_0x450e('0x8'));}}},'savedAt':{'type':Sequelize[_0x450e('0xb')]},'publishedAt':{'type':Sequelize[_0x450e('0xb')]}}; \ No newline at end of file +var _0x3383=['preproduction','toString','BLOB','production','utf8','DATE','sequelize','exports','name','STRING','TEXT','long','getDataValue'];(function(_0x36fd67,_0xbad9f4){var _0x1fee13=function(_0x4e4940){while(--_0x4e4940){_0x36fd67['push'](_0x36fd67['shift']());}};_0x1fee13(++_0xbad9f4);}(_0x3383,0x1cd));var _0x3338=function(_0x480c79,_0x202db4){_0x480c79=_0x480c79-0x0;var _0x179407=_0x3383[_0x480c79];return _0x179407;};'use strict';var Sequelize=require(_0x3338('0x0'));module[_0x3338('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x3338('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x3338('0x3')]},'notes':{'type':Sequelize[_0x3338('0x4')]},'preproduction':{'type':Sequelize['BLOB'](_0x3338('0x5')),'get':function(){if(this[_0x3338('0x6')](_0x3338('0x7'))){return this['getDataValue'](_0x3338('0x7'))[_0x3338('0x8')]('utf8');}}},'production':{'type':Sequelize[_0x3338('0x9')](_0x3338('0x5')),'get':function(){if(this[_0x3338('0x6')](_0x3338('0xa'))){return this[_0x3338('0x6')](_0x3338('0xa'))[_0x3338('0x8')](_0x3338('0xb'));}}},'savedAt':{'type':Sequelize[_0x3338('0xc')]},'publishedAt':{'type':Sequelize[_0x3338('0xc')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index b8fb9da..4217681 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 _0x8459=['publish','agi','stringify','end','error','stack','name','map','SquareProject','fieldName','type','model','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','fields','length','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','SquareProjects','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','pick','production','lodash','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','socket.io-emitter','./squareProject.socket','register','status','offset','limit','undefined','count','set','json','update','then','destroy','UserProfileResource'];(function(_0x13591a,_0x176681){var _0x561caf=function(_0x3bc114){while(--_0x3bc114){_0x13591a['push'](_0x13591a['shift']());}};_0x561caf(++_0x176681);}(_0x8459,0x77));var _0x9845=function(_0x3901be,_0x3b2af4){_0x3901be=_0x3901be-0x0;var _0x1970e0=_0x8459[_0x3901be];return _0x1970e0;};'use strict';var _=require(_0x9845('0x0'));var Redis=require(_0x9845('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0x9845('0x2'))(_0x9845('0x3'));var config=require(_0x9845('0x4'));var db=require(_0x9845('0x5'))['db'];config['redis']=_['defaults'](config[_0x9845('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0x9845('0x7'))(new Redis(config[_0x9845('0x6')]));require(_0x9845('0x8'))[_0x9845('0x9')](socket);function respondWithResult(_0x2dd501,_0x27affc){_0x27affc=_0x27affc||0xc8;return function(_0x309e53){if(_0x309e53){return _0x2dd501[_0x9845('0xa')](_0x27affc)['json'](_0x309e53);}};}function respondWithFilteredResult(_0x312520,_0x3b1b40){return function(_0x1af544){if(_0x1af544){var _0x1eb065=typeof _0x3b1b40[_0x9845('0xb')]==='undefined'&&typeof _0x3b1b40[_0x9845('0xc')]===_0x9845('0xd');var _0xd19e73=_0x1af544[_0x9845('0xe')];var _0x53497b=_0x1eb065?0x0:_0x3b1b40[_0x9845('0xb')];var _0x4fd322=_0x1eb065?_0x1af544[_0x9845('0xe')]:_0x3b1b40[_0x9845('0xb')]+_0x3b1b40['limit'];var _0x310889;if(_0x4fd322>=_0xd19e73){_0x4fd322=_0xd19e73;_0x310889=0xc8;}else{_0x310889=0xce;}_0x312520[_0x9845('0xa')](_0x310889);return _0x312520[_0x9845('0xf')]('Content-Range',_0x53497b+'-'+_0x4fd322+'/'+_0xd19e73)[_0x9845('0x10')](_0x1af544);}return null;};}function saveUpdates(_0x4ec805){return function(_0x155186){if(_0x155186){return _0x155186[_0x9845('0x11')](_0x4ec805)[_0x9845('0x12')](function(_0x348bda){return _0x348bda;});}return null;};}function removeEntity(_0x3ebc4d){return function(_0x11d7b7){if(_0x11d7b7){return _0x11d7b7[_0x9845('0x13')]()[_0x9845('0x12')](function(){var _0x1d5321=_0x11d7b7['get']({'plain':!![]});var _0x250380='SquareProjects';return db[_0x9845('0x14')]['destroy']({'where':{'type':_0x250380,'resourceId':_0x1d5321['id']}})[_0x9845('0x12')](function(){return _0x11d7b7;});})['then'](function(){var _0x5733e3=new Redis(config[_0x9845('0x6')]);_0x5733e3[_0x9845('0x15')](_0x9845('0x16'),JSON[_0x9845('0x17')]({'id':_0x11d7b7['id'],'deleted':!![]}));})[_0x9845('0x12')](function(){_0x3ebc4d[_0x9845('0xa')](0xcc)[_0x9845('0x18')]();});}};}function handleEntityNotFound(_0x993144){return function(_0x257776){if(!_0x257776){_0x993144['sendStatus'](0x194);}return _0x257776;};}function handleError(_0x1622c3,_0x2b5da2){_0x2b5da2=_0x2b5da2||0x1f4;return function(_0x2f2215){logger[_0x9845('0x19')](_0x2f2215[_0x9845('0x1a')]);if(_0x2f2215[_0x9845('0x1b')]){delete _0x2f2215[_0x9845('0x1b')];}_0x1622c3[_0x9845('0xa')](_0x2b5da2)['send'](_0x2f2215);};}exports['index']=function(_0x512a12,_0x916b27){var _0x557924={},_0x38d3d5={},_0x10288f={'count':0x0,'rows':[]};var _0x2e4528=_[_0x9845('0x1c')](db[_0x9845('0x1d')]['rawAttributes'],function(_0x94d39f){return{'name':_0x94d39f[_0x9845('0x1e')],'type':_0x94d39f[_0x9845('0x1f')]['key']};});_0x38d3d5[_0x9845('0x20')]=_[_0x9845('0x1c')](_0x2e4528,_0x9845('0x1b'));_0x38d3d5[_0x9845('0x21')]=_['keys'](_0x512a12[_0x9845('0x21')]);_0x38d3d5[_0x9845('0x22')]=_[_0x9845('0x23')](_0x38d3d5[_0x9845('0x20')],_0x38d3d5[_0x9845('0x21')]);_0x557924[_0x9845('0x24')]=_[_0x9845('0x23')](_0x38d3d5['model'],qs['fields'](_0x512a12['query']['fields']));_0x557924[_0x9845('0x24')]=_0x557924['attributes']['length']?_0x557924[_0x9845('0x24')]:_0x38d3d5[_0x9845('0x20')];if(!_0x512a12[_0x9845('0x21')][_0x9845('0x25')](_0x9845('0x26'))){_0x557924['limit']=qs[_0x9845('0xc')](_0x512a12[_0x9845('0x21')][_0x9845('0xc')]);_0x557924[_0x9845('0xb')]=qs[_0x9845('0xb')](_0x512a12[_0x9845('0x21')]['offset']);}_0x557924[_0x9845('0x27')]=qs[_0x9845('0x28')](_0x512a12[_0x9845('0x21')][_0x9845('0x28')]);_0x557924[_0x9845('0x29')]=qs[_0x9845('0x22')](_['pick'](_0x512a12[_0x9845('0x21')],_0x38d3d5[_0x9845('0x22')]),_0x2e4528);if(_0x512a12[_0x9845('0x21')][_0x9845('0x2a')]){_0x557924['where']=_['merge'](_0x557924[_0x9845('0x29')],{'$or':_[_0x9845('0x1c')](_0x2e4528,function(_0x2e570c){if(_0x2e570c[_0x9845('0x1f')]!=='VIRTUAL'){var _0x3738d0={};_0x3738d0[_0x2e570c[_0x9845('0x1b')]]={'$like':'%'+_0x512a12[_0x9845('0x21')][_0x9845('0x2a')]+'%'};return _0x3738d0;}})});}_0x557924=_[_0x9845('0x2b')]({},_0x557924,_0x512a12['options']);var _0x1f863e={'where':_0x557924[_0x9845('0x29')]};return db['SquareProject'][_0x9845('0xe')](_0x1f863e)['then'](function(_0x1ec716){_0x10288f[_0x9845('0xe')]=_0x1ec716;if(_0x512a12['query'][_0x9845('0x2c')]){_0x557924[_0x9845('0x2d')]=[{'all':!![]}];}return db[_0x9845('0x1d')][_0x9845('0x2e')](_0x557924);})[_0x9845('0x12')](function(_0x39d7e1){_0x10288f[_0x9845('0x2f')]=_0x39d7e1;return _0x10288f;})['then'](respondWithFilteredResult(_0x916b27,_0x557924))[_0x9845('0x30')](handleError(_0x916b27,null));};exports[_0x9845('0x31')]=function(_0x38d503,_0x43483a){var _0x532c0d={'raw':![],'where':{'id':_0x38d503[_0x9845('0x32')]['id']}},_0x2c6455={};_0x2c6455[_0x9845('0x20')]=_[_0x9845('0x33')](db[_0x9845('0x1d')][_0x9845('0x34')]);_0x2c6455['query']=_[_0x9845('0x33')](_0x38d503[_0x9845('0x21')]);_0x2c6455[_0x9845('0x22')]=_[_0x9845('0x23')](_0x2c6455[_0x9845('0x20')],_0x2c6455[_0x9845('0x21')]);_0x532c0d[_0x9845('0x24')]=_['intersection'](_0x2c6455[_0x9845('0x20')],qs[_0x9845('0x35')](_0x38d503[_0x9845('0x21')][_0x9845('0x35')]));_0x532c0d['attributes']=_0x532c0d[_0x9845('0x24')][_0x9845('0x36')]?_0x532c0d[_0x9845('0x24')]:_0x2c6455[_0x9845('0x20')];if(_0x38d503[_0x9845('0x21')][_0x9845('0x2c')]){_0x532c0d[_0x9845('0x2d')]=[{'all':!![]}];}_0x532c0d=_[_0x9845('0x2b')]({},_0x532c0d,_0x38d503[_0x9845('0x37')]);return db['SquareProject'][_0x9845('0x38')](_0x532c0d)['then'](handleEntityNotFound(_0x43483a,null))[_0x9845('0x12')](respondWithResult(_0x43483a,null))['catch'](handleError(_0x43483a,null));};exports[_0x9845('0x39')]=function(_0x24ec98,_0x1261c6){return db['SquareProject'][_0x9845('0x39')](_0x24ec98[_0x9845('0x3a')],{})['then'](function(_0x3d8e32){var _0x5b3cb=_0x24ec98[_0x9845('0x3b')]['get']({'plain':!![]});if(!_0x5b3cb)throw new Error(_0x9845('0x3c'));if(_0x5b3cb[_0x9845('0x3d')]===_0x9845('0x3b')){var _0x46625f=_0x3d8e32[_0x9845('0x3e')]({'plain':!![]});var _0x5109a3=_0x9845('0x3f');return db[_0x9845('0x40')][_0x9845('0x38')]({'where':{'name':_0x5109a3,'userProfileId':_0x5b3cb[_0x9845('0x41')]},'raw':!![]})[_0x9845('0x12')](function(_0x13c379){if(_0x13c379&&_0x13c379[_0x9845('0x42')]===0x0){return db[_0x9845('0x14')][_0x9845('0x39')]({'name':_0x46625f[_0x9845('0x1b')],'resourceId':_0x46625f['id'],'type':_0x13c379[_0x9845('0x1b')],'sectionId':_0x13c379['id']},{})[_0x9845('0x12')](function(){return _0x3d8e32;});}else{return _0x3d8e32;}})['catch'](function(_0x47eb3d){logger[_0x9845('0x19')](_0x9845('0x43'),_0x47eb3d);throw _0x47eb3d;});}return _0x3d8e32;})['then'](respondWithResult(_0x1261c6,0xc9))['catch'](handleError(_0x1261c6,null));};exports[_0x9845('0x11')]=function(_0x220ed2,_0xb79fc4){if(_0x220ed2[_0x9845('0x3a')]['id']){delete _0x220ed2[_0x9845('0x3a')]['id'];}return db[_0x9845('0x1d')][_0x9845('0x38')]({'where':{'id':_0x220ed2[_0x9845('0x32')]['id']}})['then'](handleEntityNotFound(_0xb79fc4,null))[_0x9845('0x12')](saveUpdates(_0x220ed2[_0x9845('0x3a')],null))[_0x9845('0x12')](function(_0x2b1132){if(!_0x2b1132)return;var _0x3bd060=_0x2b1132['get']({'plain':!![]});return _0x3bd060;})[_0x9845('0x12')](function(_0x5cb690){var _0x55da00=new Redis(config[_0x9845('0x6')]);_0x55da00[_0x9845('0x15')]('agi',JSON[_0x9845('0x17')](_[_0x9845('0x44')](_0x5cb690,['id','name',_0x9845('0x45')])));return _0x5cb690;})[_0x9845('0x12')](respondWithResult(_0xb79fc4,null))[_0x9845('0x30')](handleError(_0xb79fc4,null));};exports['destroy']=function(_0x150c99,_0x2c21fa){return db[_0x9845('0x1d')][_0x9845('0x38')]({'where':{'id':_0x150c99[_0x9845('0x32')]['id']}})['then'](handleEntityNotFound(_0x2c21fa,null))['then'](removeEntity(_0x2c21fa,null))[_0x9845('0x30')](handleError(_0x2c21fa,null));}; \ No newline at end of file +var _0xd62a=['redis','defaults','localhost','socket.io-emitter','./squareProject.socket','status','json','offset','limit','undefined','count','set','Content-Range','then','get','SquareProjects','UserProfileResource','publish','end','sendStatus','error','stack','name','send','index','map','SquareProject','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','production','destroy','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment'];(function(_0x1eee2b,_0x21cbda){var _0x56b953=function(_0x441c21){while(--_0x441c21){_0x1eee2b['push'](_0x1eee2b['shift']());}};_0x56b953(++_0x21cbda);}(_0xd62a,0x112));var _0xad62=function(_0xa92809,_0x14d5c8){_0xa92809=_0xa92809-0x0;var _0x36aa76=_0xd62a[_0xa92809];return _0x36aa76;};'use strict';var _=require(_0xad62('0x0'));var Redis=require(_0xad62('0x1'));var qs=require(_0xad62('0x2'));var logger=require(_0xad62('0x3'))(_0xad62('0x4'));var config=require(_0xad62('0x5'));var db=require('../../mysqldb')['db'];config[_0xad62('0x6')]=_[_0xad62('0x7')](config[_0xad62('0x6')],{'host':_0xad62('0x8'),'port':0x18eb});var socket=require(_0xad62('0x9'))(new Redis(config[_0xad62('0x6')]));require(_0xad62('0xa'))['register'](socket);function respondWithResult(_0x13c506,_0x158a30){_0x158a30=_0x158a30||0xc8;return function(_0x3ba027){if(_0x3ba027){return _0x13c506[_0xad62('0xb')](_0x158a30)[_0xad62('0xc')](_0x3ba027);}};}function respondWithFilteredResult(_0x2d0aa6,_0x33033e){return function(_0x426e34){if(_0x426e34){var _0x5d0e2e=typeof _0x33033e[_0xad62('0xd')]==='undefined'&&typeof _0x33033e[_0xad62('0xe')]===_0xad62('0xf');var _0x556ae9=_0x426e34[_0xad62('0x10')];var _0x3220be=_0x5d0e2e?0x0:_0x33033e[_0xad62('0xd')];var _0x3d2e4d=_0x5d0e2e?_0x426e34['count']:_0x33033e['offset']+_0x33033e[_0xad62('0xe')];var _0x4f2cfa;if(_0x3d2e4d>=_0x556ae9){_0x3d2e4d=_0x556ae9;_0x4f2cfa=0xc8;}else{_0x4f2cfa=0xce;}_0x2d0aa6[_0xad62('0xb')](_0x4f2cfa);return _0x2d0aa6[_0xad62('0x11')](_0xad62('0x12'),_0x3220be+'-'+_0x3d2e4d+'/'+_0x556ae9)[_0xad62('0xc')](_0x426e34);}return null;};}function saveUpdates(_0x40ee17){return function(_0x4a324d){if(_0x4a324d){return _0x4a324d['update'](_0x40ee17)[_0xad62('0x13')](function(_0x1cb11a){return _0x1cb11a;});}return null;};}function removeEntity(_0x2c9cfc){return function(_0x532468){if(_0x532468){return _0x532468['destroy']()[_0xad62('0x13')](function(){var _0x987e19=_0x532468[_0xad62('0x14')]({'plain':!![]});var _0x2c5b17=_0xad62('0x15');return db[_0xad62('0x16')]['destroy']({'where':{'type':_0x2c5b17,'resourceId':_0x987e19['id']}})[_0xad62('0x13')](function(){return _0x532468;});})[_0xad62('0x13')](function(){var _0x1e72d6=new Redis(config[_0xad62('0x6')]);_0x1e72d6[_0xad62('0x17')]('agi',JSON['stringify']({'id':_0x532468['id'],'deleted':!![]}));})[_0xad62('0x13')](function(){_0x2c9cfc[_0xad62('0xb')](0xcc)[_0xad62('0x18')]();});}};}function handleEntityNotFound(_0x41cebb){return function(_0x4d6b47){if(!_0x4d6b47){_0x41cebb[_0xad62('0x19')](0x194);}return _0x4d6b47;};}function handleError(_0x285fde,_0x354d0f){_0x354d0f=_0x354d0f||0x1f4;return function(_0x4ef5da){logger[_0xad62('0x1a')](_0x4ef5da[_0xad62('0x1b')]);if(_0x4ef5da[_0xad62('0x1c')]){delete _0x4ef5da['name'];}_0x285fde['status'](_0x354d0f)[_0xad62('0x1d')](_0x4ef5da);};}exports[_0xad62('0x1e')]=function(_0x1e4bbf,_0x82ed25){var _0x52e44a={},_0x38db84={},_0x3127f7={'count':0x0,'rows':[]};var _0x5b42b9=_[_0xad62('0x1f')](db[_0xad62('0x20')][_0xad62('0x21')],function(_0x379a75){return{'name':_0x379a75[_0xad62('0x22')],'type':_0x379a75[_0xad62('0x23')]['key']};});_0x38db84['model']=_[_0xad62('0x1f')](_0x5b42b9,_0xad62('0x1c'));_0x38db84[_0xad62('0x24')]=_[_0xad62('0x25')](_0x1e4bbf[_0xad62('0x24')]);_0x38db84[_0xad62('0x26')]=_[_0xad62('0x27')](_0x38db84[_0xad62('0x28')],_0x38db84[_0xad62('0x24')]);_0x52e44a[_0xad62('0x29')]=_[_0xad62('0x27')](_0x38db84['model'],qs[_0xad62('0x2a')](_0x1e4bbf[_0xad62('0x24')][_0xad62('0x2a')]));_0x52e44a['attributes']=_0x52e44a['attributes'][_0xad62('0x2b')]?_0x52e44a[_0xad62('0x29')]:_0x38db84[_0xad62('0x28')];if(!_0x1e4bbf[_0xad62('0x24')][_0xad62('0x2c')]('nolimit')){_0x52e44a['limit']=qs['limit'](_0x1e4bbf['query']['limit']);_0x52e44a[_0xad62('0xd')]=qs['offset'](_0x1e4bbf['query']['offset']);}_0x52e44a[_0xad62('0x2d')]=qs[_0xad62('0x2e')](_0x1e4bbf['query'][_0xad62('0x2e')]);_0x52e44a[_0xad62('0x2f')]=qs[_0xad62('0x26')](_[_0xad62('0x30')](_0x1e4bbf[_0xad62('0x24')],_0x38db84['filters']),_0x5b42b9);if(_0x1e4bbf[_0xad62('0x24')][_0xad62('0x31')]){_0x52e44a[_0xad62('0x2f')]=_[_0xad62('0x32')](_0x52e44a[_0xad62('0x2f')],{'$or':_[_0xad62('0x1f')](_0x5b42b9,function(_0x38b310){if(_0x38b310[_0xad62('0x23')]!==_0xad62('0x33')){var _0x28f899={};_0x28f899[_0x38b310[_0xad62('0x1c')]]={'$like':'%'+_0x1e4bbf['query'][_0xad62('0x31')]+'%'};return _0x28f899;}})});}_0x52e44a=_[_0xad62('0x32')]({},_0x52e44a,_0x1e4bbf['options']);var _0x38f244={'where':_0x52e44a[_0xad62('0x2f')]};return db['SquareProject']['count'](_0x38f244)[_0xad62('0x13')](function(_0x2b9852){_0x3127f7['count']=_0x2b9852;if(_0x1e4bbf[_0xad62('0x24')][_0xad62('0x34')]){_0x52e44a[_0xad62('0x35')]=[{'all':!![]}];}return db[_0xad62('0x20')]['findAll'](_0x52e44a);})[_0xad62('0x13')](function(_0x104d44){_0x3127f7[_0xad62('0x36')]=_0x104d44;return _0x3127f7;})[_0xad62('0x13')](respondWithFilteredResult(_0x82ed25,_0x52e44a))[_0xad62('0x37')](handleError(_0x82ed25,null));};exports[_0xad62('0x38')]=function(_0x2f11a2,_0x28764d){var _0x39b27f={'raw':![],'where':{'id':_0x2f11a2[_0xad62('0x39')]['id']}},_0x43ca51={};_0x43ca51[_0xad62('0x28')]=_['keys'](db['SquareProject'][_0xad62('0x21')]);_0x43ca51[_0xad62('0x24')]=_[_0xad62('0x25')](_0x2f11a2['query']);_0x43ca51[_0xad62('0x26')]=_['intersection'](_0x43ca51[_0xad62('0x28')],_0x43ca51['query']);_0x39b27f[_0xad62('0x29')]=_['intersection'](_0x43ca51[_0xad62('0x28')],qs[_0xad62('0x2a')](_0x2f11a2['query'][_0xad62('0x2a')]));_0x39b27f['attributes']=_0x39b27f[_0xad62('0x29')][_0xad62('0x2b')]?_0x39b27f[_0xad62('0x29')]:_0x43ca51['model'];if(_0x2f11a2[_0xad62('0x24')][_0xad62('0x34')]){_0x39b27f[_0xad62('0x35')]=[{'all':!![]}];}_0x39b27f=_[_0xad62('0x32')]({},_0x39b27f,_0x2f11a2['options']);return db[_0xad62('0x20')][_0xad62('0x3a')](_0x39b27f)[_0xad62('0x13')](handleEntityNotFound(_0x28764d,null))[_0xad62('0x13')](respondWithResult(_0x28764d,null))[_0xad62('0x37')](handleError(_0x28764d,null));};exports['create']=function(_0x4d4923,_0x575f51){return db[_0xad62('0x20')][_0xad62('0x3b')](_0x4d4923['body'],{})[_0xad62('0x13')](function(_0x549cc6){var _0x1650b5=_0x4d4923[_0xad62('0x3c')][_0xad62('0x14')]({'plain':!![]});if(!_0x1650b5)throw new Error(_0xad62('0x3d'));if(_0x1650b5[_0xad62('0x3e')]===_0xad62('0x3c')){var _0x2cc011=_0x549cc6['get']({'plain':!![]});var _0x3dd033=_0xad62('0x15');return db[_0xad62('0x3f')][_0xad62('0x3a')]({'where':{'name':_0x3dd033,'userProfileId':_0x1650b5['userProfileId']},'raw':!![]})[_0xad62('0x13')](function(_0x121dba){if(_0x121dba&&_0x121dba[_0xad62('0x40')]===0x0){return db[_0xad62('0x16')]['create']({'name':_0x2cc011[_0xad62('0x1c')],'resourceId':_0x2cc011['id'],'type':_0x121dba[_0xad62('0x1c')],'sectionId':_0x121dba['id']},{})[_0xad62('0x13')](function(){return _0x549cc6;});}else{return _0x549cc6;}})[_0xad62('0x37')](function(_0x40f769){logger[_0xad62('0x1a')](_0xad62('0x41'),_0x40f769);throw _0x40f769;});}return _0x549cc6;})['then'](respondWithResult(_0x575f51,0xc9))[_0xad62('0x37')](handleError(_0x575f51,null));};exports[_0xad62('0x42')]=function(_0x30d9bf,_0x4eb38b){if(_0x30d9bf[_0xad62('0x43')]['id']){delete _0x30d9bf[_0xad62('0x43')]['id'];}return db[_0xad62('0x20')]['find']({'where':{'id':_0x30d9bf[_0xad62('0x39')]['id']}})[_0xad62('0x13')](handleEntityNotFound(_0x4eb38b,null))[_0xad62('0x13')](saveUpdates(_0x30d9bf[_0xad62('0x43')],null))['then'](function(_0x123b64){if(!_0x123b64)return;var _0x1af1b4=_0x123b64[_0xad62('0x14')]({'plain':!![]});return _0x1af1b4;})['then'](function(_0x3ce06b){var _0x1a663d=new Redis(config[_0xad62('0x6')]);_0x1a663d['publish']('agi',JSON['stringify'](_[_0xad62('0x30')](_0x3ce06b,['id',_0xad62('0x1c'),_0xad62('0x44')])));return _0x3ce06b;})['then'](respondWithResult(_0x4eb38b,null))[_0xad62('0x37')](handleError(_0x4eb38b,null));};exports[_0xad62('0x45')]=function(_0x3b8216,_0x4c9340){return db[_0xad62('0x20')][_0xad62('0x3a')]({'where':{'id':_0x3b8216[_0xad62('0x39')]['id']}})[_0xad62('0x13')](handleEntityNotFound(_0x4c9340,null))['then'](removeEntity(_0x4c9340,null))[_0xad62('0x37')](handleError(_0x4c9340,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 7bc8102..c8a579d 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 _0xb2a8=['SquareProject','setMaxListeners','save','update','remove','emit','hook','exports','../../mysqldb'];(function(_0x4327fe,_0x4f8040){var _0x138651=function(_0x418acc){while(--_0x418acc){_0x4327fe['push'](_0x4327fe['shift']());}};_0x138651(++_0x4f8040);}(_0xb2a8,0xfb));var _0x8b2a=function(_0x1476fb,_0x467d01){_0x1476fb=_0x1476fb-0x0;var _0x44f57e=_0xb2a8[_0x1476fb];return _0x44f57e;};'use strict';var EventEmitter=require('events');var SquareProject=require(_0x8b2a('0x0'))['db'][_0x8b2a('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x8b2a('0x2')](0x0);var events={'afterCreate':_0x8b2a('0x3'),'afterUpdate':_0x8b2a('0x4'),'afterDestroy':_0x8b2a('0x5')};function emitEvent(_0xaeb2e9){return function(_0x507149,_0xd95b84,_0x10216f){SquareProjectEvents['emit'](_0xaeb2e9+':'+_0x507149['id'],_0x507149);SquareProjectEvents[_0x8b2a('0x6')](_0xaeb2e9,_0x507149);_0x10216f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0x8b2a('0x7')](e,emitEvent(event));}}module[_0x8b2a('0x8')]=SquareProjectEvents; \ No newline at end of file +var _0xace7=['remove','emit','hasOwnProperty','events','../../mysqldb','SquareProject','setMaxListeners','save','update'];(function(_0x30af67,_0xdfe695){var _0x168b00=function(_0x4788cf){while(--_0x4788cf){_0x30af67['push'](_0x30af67['shift']());}};_0x168b00(++_0xdfe695);}(_0xace7,0x78));var _0x7ace=function(_0x547160,_0x537a78){_0x547160=_0x547160-0x0;var _0x3f7b71=_0xace7[_0x547160];return _0x3f7b71;};'use strict';var EventEmitter=require(_0x7ace('0x0'));var SquareProject=require(_0x7ace('0x1'))['db'][_0x7ace('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x7ace('0x3')](0x0);var events={'afterCreate':_0x7ace('0x4'),'afterUpdate':_0x7ace('0x5'),'afterDestroy':_0x7ace('0x6')};function emitEvent(_0x4777d8){return function(_0x3e2641,_0x551fbd,_0x220808){SquareProjectEvents[_0x7ace('0x7')](_0x4777d8+':'+_0x3e2641['id'],_0x3e2641);SquareProjectEvents[_0x7ace('0x7')](_0x4777d8,_0x3e2641);_0x220808(null);};}for(var e in events){if(events[_0x7ace('0x8')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module['exports']=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index a588200..fa908f3 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 _0x45fc=['square_projects','preproduction','savedAt','YYYY-MM-DD\x20HH:mm:ss','changed','publishedAt','format','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./squareProject.attributes','exports','SquareProject'];(function(_0x42204b,_0x22dd98){var _0x5ca1bc=function(_0x1cdfcf){while(--_0x1cdfcf){_0x42204b['push'](_0x42204b['shift']());}};_0x5ca1bc(++_0x22dd98);}(_0x45fc,0x183));var _0xc45f=function(_0x1c6c2e,_0x56744b){_0x1c6c2e=_0x1c6c2e-0x0;var _0x11d516=_0x45fc[_0x1c6c2e];return _0x11d516;};'use strict';var _=require(_0xc45f('0x0'));var util=require(_0xc45f('0x1'));var logger=require(_0xc45f('0x2'))(_0xc45f('0x3'));var moment=require(_0xc45f('0x4'));var BPromise=require(_0xc45f('0x5'));var rp=require(_0xc45f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc45f('0x7'));var config=require(_0xc45f('0x8'));var attributes=require(_0xc45f('0x9'));module[_0xc45f('0xa')]=function(_0x42fe97,_0x403fa0){return _0x42fe97['define'](_0xc45f('0xb'),attributes,{'tableName':_0xc45f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x527b4a,_0x36a1fc,_0x53633c){if(_0x527b4a['changed'](_0xc45f('0xd'))){_0x527b4a[_0xc45f('0xe')]=moment()['format'](_0xc45f('0xf'));}if(_0x527b4a[_0xc45f('0x10')]('production')){_0x527b4a[_0xc45f('0x11')]=moment()[_0xc45f('0x12')]('YYYY-MM-DD\x20HH:mm:ss');}_0x53633c(null,_0x527b4a);}}});}; \ No newline at end of file +var _0xc6e5=['lodash','util','api','moment','request-promise','path','../../config/environment','./squareProject.attributes','define','square_projects','changed','preproduction','savedAt','format','production','publishedAt','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x37a7ce,_0xeb36f9){var _0x3890c0=function(_0x170312){while(--_0x170312){_0x37a7ce['push'](_0x37a7ce['shift']());}};_0x3890c0(++_0xeb36f9);}(_0xc6e5,0x1ba));var _0x5c6e=function(_0x3e258c,_0x1fecc1){_0x3e258c=_0x3e258c-0x0;var _0x4786ea=_0xc6e5[_0x3e258c];return _0x4786ea;};'use strict';var _=require(_0x5c6e('0x0'));var util=require(_0x5c6e('0x1'));var logger=require('../../config/logger')(_0x5c6e('0x2'));var moment=require(_0x5c6e('0x3'));var BPromise=require('bluebird');var rp=require(_0x5c6e('0x4'));var fs=require('fs');var path=require(_0x5c6e('0x5'));var rimraf=require('rimraf');var config=require(_0x5c6e('0x6'));var attributes=require(_0x5c6e('0x7'));module['exports']=function(_0x10ff8c,_0x52ed21){return _0x10ff8c[_0x5c6e('0x8')]('SquareProject',attributes,{'tableName':_0x5c6e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4b8d9b,_0x36702d,_0x54f63f){if(_0x4b8d9b[_0x5c6e('0xa')](_0x5c6e('0xb'))){_0x4b8d9b[_0x5c6e('0xc')]=moment()[_0x5c6e('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x4b8d9b[_0x5c6e('0xa')](_0x5c6e('0xe'))){_0x4b8d9b[_0x5c6e('0xf')]=moment()['format'](_0x5c6e('0x10'));}_0x54f63f(null,_0x4b8d9b);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 5ddfbb1..86d21b7 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 _0x1e87=['options','raw','where','attributes','map','include','model','debug','stringify','error','message','then','info','ShowSquareProject','catch','lodash','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','defaults','redis','localhost','socket.io-emitter','./squareProject.socket','register','GetSquareProjects','SquareProject'];(function(_0x1e55d9,_0x5ce14a){var _0x6dc799=function(_0x383e7b){while(--_0x383e7b){_0x1e55d9['push'](_0x1e55d9['shift']());}};_0x6dc799(++_0x5ce14a);}(_0x1e87,0xf7));var _0x71e8=function(_0x3a9e73,_0x567a70){_0x3a9e73=_0x3a9e73-0x0;var _0x5af67a=_0x1e87[_0x3a9e73];return _0x5af67a;};'use strict';var _=require(_0x71e8('0x0'));var Redis=require(_0x71e8('0x1'));var db=require(_0x71e8('0x2'))['db'];var logger=require(_0x71e8('0x3'))(_0x71e8('0x4'));var config=require(_0x71e8('0x5'));config['redis']=_[_0x71e8('0x6')](config[_0x71e8('0x7')],{'host':_0x71e8('0x8'),'port':0x18eb});var socket=require(_0x71e8('0x9'))(new Redis(config['redis']));require(_0x71e8('0xa'))[_0x71e8('0xb')](socket);exports[_0x71e8('0xc')]=function(_0x2cf6d6){var _0xdba9db=this;return new Promise(function(_0x1af2ed,_0x2d412c){return db[_0x71e8('0xd')]['findAll']({'raw':_0x2cf6d6['options']?_0x2cf6d6[_0x71e8('0xe')][_0x71e8('0xf')]===undefined?!![]:![]:!![],'where':_0x2cf6d6[_0x71e8('0xe')]?_0x2cf6d6['options'][_0x71e8('0x10')]||null:null,'attributes':_0x2cf6d6['options']?_0x2cf6d6[_0x71e8('0xe')][_0x71e8('0x11')]||null:null,'limit':_0x2cf6d6[_0x71e8('0xe')]?_0x2cf6d6['options']['limit']||null:null,'include':_0x2cf6d6['options']?_0x2cf6d6['options']['include']?_[_0x71e8('0x12')](_0x2cf6d6[_0x71e8('0xe')][_0x71e8('0x13')],function(_0x391416){return{'model':db[_0x391416[_0x71e8('0x14')]],'as':_0x391416['as'],'attributes':_0x391416[_0x71e8('0x11')],'include':_0x391416[_0x71e8('0x13')]?_[_0x71e8('0x12')](_0x391416[_0x71e8('0x13')],function(_0x4b4e4e){return{'model':db[_0x4b4e4e[_0x71e8('0x14')]],'as':_0x4b4e4e['as'],'attributes':_0x4b4e4e[_0x71e8('0x11')],'include':_0x4b4e4e['include']?_['map'](_0x4b4e4e[_0x71e8('0x13')],function(_0x19a1be){return{'model':db[_0x19a1be[_0x71e8('0x14')]],'as':_0x19a1be['as'],'attributes':_0x19a1be[_0x71e8('0x11')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x587cb6){logger['info'](_0x71e8('0xc'),_0x2cf6d6);logger[_0x71e8('0x15')]('GetSquareProjects',_0x2cf6d6,JSON[_0x71e8('0x16')](_0x587cb6));_0x1af2ed(_0x587cb6);})['catch'](function(_0x421529){logger[_0x71e8('0x17')](_0x71e8('0xc'),_0x421529[_0x71e8('0x18')],_0x2cf6d6);_0x2d412c(_0xdba9db[_0x71e8('0x17')](0x1f4,_0x421529['message']));});});};exports['ShowSquareProject']=function(_0x2b198a){var _0xd531fd=this;return new Promise(function(_0x4a7084,_0x29a716){return db[_0x71e8('0xd')]['find']({'raw':_0x2b198a['options']?_0x2b198a['options'][_0x71e8('0xf')]===undefined?!![]:![]:!![],'where':_0x2b198a[_0x71e8('0xe')]?_0x2b198a['options'][_0x71e8('0x10')]||null:null,'attributes':_0x2b198a[_0x71e8('0xe')]?_0x2b198a[_0x71e8('0xe')][_0x71e8('0x11')]||null:null,'include':_0x2b198a[_0x71e8('0xe')]?_0x2b198a[_0x71e8('0xe')][_0x71e8('0x13')]?_[_0x71e8('0x12')](_0x2b198a[_0x71e8('0xe')][_0x71e8('0x13')],function(_0xd498b5){return{'model':db[_0xd498b5[_0x71e8('0x14')]],'as':_0xd498b5['as'],'attributes':_0xd498b5[_0x71e8('0x11')],'include':_0xd498b5[_0x71e8('0x13')]?_[_0x71e8('0x12')](_0xd498b5[_0x71e8('0x13')],function(_0x5af88b){return{'model':db[_0x5af88b['model']],'as':_0x5af88b['as'],'attributes':_0x5af88b['attributes'],'include':_0x5af88b['include']?_[_0x71e8('0x12')](_0x5af88b[_0x71e8('0x13')],function(_0x547baa){return{'model':db[_0x547baa[_0x71e8('0x14')]],'as':_0x547baa['as'],'attributes':_0x547baa[_0x71e8('0x11')]};}):[]};}):[]};}):[]:[]})[_0x71e8('0x19')](function(_0x5c88f4){logger[_0x71e8('0x1a')]('ShowSquareProject',_0x2b198a);logger['debug'](_0x71e8('0x1b'),_0x2b198a,JSON[_0x71e8('0x16')](_0x5c88f4));_0x4a7084(_0x5c88f4);})[_0x71e8('0x1c')](function(_0x105d69){logger[_0x71e8('0x17')](_0x71e8('0x1b'),_0x105d69[_0x71e8('0x18')],_0x2b198a);_0x29a716(_0xd531fd[_0x71e8('0x17')](0x1f4,_0x105d69['message']));});});}; \ No newline at end of file +var _0xd602=['findAll','options','attributes','limit','include','map','model','info','GetSquareProjects','debug','stringify','error','message','ShowSquareProject','find','raw','where','then','catch','lodash','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','SquareProject'];(function(_0x4f6f97,_0x1de0b6){var _0x44b012=function(_0x58cae7){while(--_0x58cae7){_0x4f6f97['push'](_0x4f6f97['shift']());}};_0x44b012(++_0x1de0b6);}(_0xd602,0x173));var _0x2d60=function(_0xfcb63c,_0x1f99d2){_0xfcb63c=_0xfcb63c-0x0;var _0x1093eb=_0xd602[_0xfcb63c];return _0x1093eb;};'use strict';var _=require(_0x2d60('0x0'));var Redis=require(_0x2d60('0x1'));var db=require(_0x2d60('0x2'))['db'];var logger=require(_0x2d60('0x3'))(_0x2d60('0x4'));var config=require(_0x2d60('0x5'));config[_0x2d60('0x6')]=_[_0x2d60('0x7')](config[_0x2d60('0x6')],{'host':_0x2d60('0x8'),'port':0x18eb});var socket=require(_0x2d60('0x9'))(new Redis(config['redis']));require(_0x2d60('0xa'))[_0x2d60('0xb')](socket);exports['GetSquareProjects']=function(_0x1b4b14){var _0x4c99f6=this;return new Promise(function(_0x16410e,_0x488c06){return db[_0x2d60('0xc')][_0x2d60('0xd')]({'raw':_0x1b4b14[_0x2d60('0xe')]?_0x1b4b14[_0x2d60('0xe')]['raw']===undefined?!![]:![]:!![],'where':_0x1b4b14[_0x2d60('0xe')]?_0x1b4b14[_0x2d60('0xe')]['where']||null:null,'attributes':_0x1b4b14['options']?_0x1b4b14[_0x2d60('0xe')][_0x2d60('0xf')]||null:null,'limit':_0x1b4b14[_0x2d60('0xe')]?_0x1b4b14[_0x2d60('0xe')][_0x2d60('0x10')]||null:null,'include':_0x1b4b14[_0x2d60('0xe')]?_0x1b4b14[_0x2d60('0xe')][_0x2d60('0x11')]?_[_0x2d60('0x12')](_0x1b4b14[_0x2d60('0xe')][_0x2d60('0x11')],function(_0x52d550){return{'model':db[_0x52d550['model']],'as':_0x52d550['as'],'attributes':_0x52d550[_0x2d60('0xf')],'include':_0x52d550['include']?_['map'](_0x52d550[_0x2d60('0x11')],function(_0x4ba9f6){return{'model':db[_0x4ba9f6['model']],'as':_0x4ba9f6['as'],'attributes':_0x4ba9f6[_0x2d60('0xf')],'include':_0x4ba9f6[_0x2d60('0x11')]?_[_0x2d60('0x12')](_0x4ba9f6[_0x2d60('0x11')],function(_0x5d222e){return{'model':db[_0x5d222e[_0x2d60('0x13')]],'as':_0x5d222e['as'],'attributes':_0x5d222e['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x72eb94){logger[_0x2d60('0x14')](_0x2d60('0x15'),_0x1b4b14);logger[_0x2d60('0x16')](_0x2d60('0x15'),_0x1b4b14,JSON[_0x2d60('0x17')](_0x72eb94));_0x16410e(_0x72eb94);})['catch'](function(_0x4ab76e){logger[_0x2d60('0x18')](_0x2d60('0x15'),_0x4ab76e[_0x2d60('0x19')],_0x1b4b14);_0x488c06(_0x4c99f6[_0x2d60('0x18')](0x1f4,_0x4ab76e['message']));});});};exports[_0x2d60('0x1a')]=function(_0x78b31a){var _0x3da502=this;return new Promise(function(_0x29494f,_0x1c87d3){return db['SquareProject'][_0x2d60('0x1b')]({'raw':_0x78b31a[_0x2d60('0xe')]?_0x78b31a[_0x2d60('0xe')][_0x2d60('0x1c')]===undefined?!![]:![]:!![],'where':_0x78b31a['options']?_0x78b31a[_0x2d60('0xe')][_0x2d60('0x1d')]||null:null,'attributes':_0x78b31a['options']?_0x78b31a[_0x2d60('0xe')]['attributes']||null:null,'include':_0x78b31a[_0x2d60('0xe')]?_0x78b31a[_0x2d60('0xe')][_0x2d60('0x11')]?_[_0x2d60('0x12')](_0x78b31a['options'][_0x2d60('0x11')],function(_0x4d024b){return{'model':db[_0x4d024b[_0x2d60('0x13')]],'as':_0x4d024b['as'],'attributes':_0x4d024b['attributes'],'include':_0x4d024b['include']?_['map'](_0x4d024b[_0x2d60('0x11')],function(_0x2bd5bf){return{'model':db[_0x2bd5bf[_0x2d60('0x13')]],'as':_0x2bd5bf['as'],'attributes':_0x2bd5bf[_0x2d60('0xf')],'include':_0x2bd5bf[_0x2d60('0x11')]?_['map'](_0x2bd5bf[_0x2d60('0x11')],function(_0x2a5e26){return{'model':db[_0x2a5e26['model']],'as':_0x2a5e26['as'],'attributes':_0x2a5e26[_0x2d60('0xf')]};}):[]};}):[]};}):[]:[]})[_0x2d60('0x1e')](function(_0x4929bd){logger[_0x2d60('0x14')](_0x2d60('0x1a'),_0x78b31a);logger['debug'](_0x2d60('0x1a'),_0x78b31a,JSON[_0x2d60('0x17')](_0x4929bd));_0x29494f(_0x4929bd);})[_0x2d60('0x1f')](function(_0x553cd5){logger[_0x2d60('0x18')](_0x2d60('0x1a'),_0x553cd5[_0x2d60('0x19')],_0x78b31a);_0x1c87d3(_0x3da502['error'](0x1f4,_0x553cd5[_0x2d60('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 3b79cc3..2ffb732 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 _0x06be=['remove','update','removeListener','length','squareProject:','save'];(function(_0x135573,_0x479526){var _0x13ea56=function(_0x49c990){while(--_0x49c990){_0x135573['push'](_0x135573['shift']());}};_0x13ea56(++_0x479526);}(_0x06be,0x9b));var _0xe06b=function(_0x54e2d7,_0x1eb293){_0x54e2d7=_0x54e2d7-0x0;var _0x367cf0=_0x06be[_0x54e2d7];return _0x367cf0;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=[_0xe06b('0x0'),_0xe06b('0x1'),_0xe06b('0x2')];function createListener(_0x56d82a,_0xbf228f){return function(_0x1b231f){_0xbf228f['emit'](_0x56d82a,_0x1b231f);};}function removeListener(_0x9eec6b,_0x58d154){return function(){SquareProjectEvents[_0xe06b('0x3')](_0x9eec6b,_0x58d154);};}exports['register']=function(_0x2f5e58){for(var _0x280554=0x0,_0x3e4f29=events[_0xe06b('0x4')];_0x280554<_0x3e4f29;_0x280554++){var _0x2d7039=events[_0x280554];var _0x418bcb=createListener(_0xe06b('0x5')+_0x2d7039,_0x2f5e58);SquareProjectEvents['on'](_0x2d7039,_0x418bcb);}}; \ No newline at end of file +var _0x0177=['emit','removeListener','length','update'];(function(_0x4d0579,_0x35546c){var _0x19df89=function(_0x2e523a){while(--_0x2e523a){_0x4d0579['push'](_0x4d0579['shift']());}};_0x19df89(++_0x35546c);}(_0x0177,0xc3));var _0x7017=function(_0x3555fd,_0x5e1ffd){_0x3555fd=_0x3555fd-0x0;var _0x4f0ec2=_0x0177[_0x3555fd];return _0x4f0ec2;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=['save','remove',_0x7017('0x0')];function createListener(_0x444c20,_0x923b55){return function(_0x48b6fe){_0x923b55[_0x7017('0x1')](_0x444c20,_0x48b6fe);};}function removeListener(_0x54ef91,_0x300882){return function(){SquareProjectEvents[_0x7017('0x2')](_0x54ef91,_0x300882);};}exports['register']=function(_0x1ceed0){for(var _0x329efc=0x0,_0x5e4aa4=events[_0x7017('0x3')];_0x329efc<_0x5e4aa4;_0x329efc++){var _0x2dace7=events[_0x329efc];var _0x4669f9=createListener('squareProject:'+_0x2dace7,_0x1ceed0);SquareProjectEvents['on'](_0x2dace7,_0x4669f9);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 116fbf4..281c360 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 _0xf494=['../../config/environment','./squareRecording.controller','get','isAuthenticated','index','show','/:id/download','download','post','create','/:id','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2a2f00,_0x2a53ab){var _0x141aa4=function(_0xd30321){while(--_0xd30321){_0x2a2f00['push'](_0x2a2f00['shift']());}};_0x141aa4(++_0x2a53ab);}(_0xf494,0x1c6));var _0x4f49=function(_0x420eec,_0x551dd9){_0x420eec=_0x420eec-0x0;var _0x227765=_0xf494[_0x420eec];return _0x227765;};'use strict';var multer=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var path=require(_0x4f49('0x2'));var timeout=require('connect-timeout');var express=require(_0x4f49('0x3'));var router=express[_0x4f49('0x4')]();var fs_extra=require(_0x4f49('0x5'));var auth=require(_0x4f49('0x6'));var interaction=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var controller=require(_0x4f49('0x9'));router[_0x4f49('0xa')]('/',auth[_0x4f49('0xb')](),controller[_0x4f49('0xc')]);router[_0x4f49('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x4f49('0xd')]);router[_0x4f49('0xa')](_0x4f49('0xe'),auth[_0x4f49('0xb')](),controller[_0x4f49('0xf')]);router[_0x4f49('0x10')]('/',auth[_0x4f49('0xb')](),controller[_0x4f49('0x11')]);router['put'](_0x4f49('0x12'),auth[_0x4f49('0xb')](),controller['update']);router[_0x4f49('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x4f49('0x14')]);module[_0x4f49('0x15')]=router; \ No newline at end of file +var _0xc4aa=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./squareRecording.controller','get','isAuthenticated','index','/:id','/:id/download','download','create','put','delete'];(function(_0x1fbc51,_0x1fa916){var _0x23b41f=function(_0x344dbf){while(--_0x344dbf){_0x1fbc51['push'](_0x1fbc51['shift']());}};_0x23b41f(++_0x1fa916);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0xc4aa[_0x3d42d8];return _0x27fc41;};'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['show']);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xd')]);router['post']('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xe')]);router[_0xac4a('0xf')]('/:id',auth[_0xac4a('0x9')](),controller['update']);router[_0xac4a('0x10')]('/:id',auth[_0xac4a('0x9')](),controller[_0xac4a('0x11')]);module[_0xac4a('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index d32fe5b..fc17eab 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 _0x46ed=['sequelize','exports','STRING','VIRTUAL','getDataValue','savePath','substring','lastIndexOf'];(function(_0x38baac,_0x2772b3){var _0x47baf1=function(_0x5646a8){while(--_0x5646a8){_0x38baac['push'](_0x38baac['shift']());}};_0x47baf1(++_0x2772b3);}(_0x46ed,0x168));var _0xd46e=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x46ed[_0x19950b];return _0x3c6b41;};'use strict';var Sequelize=require(_0xd46e('0x0'));module[_0xd46e('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xd46e('0x2')]},'calleridname':{'type':Sequelize[_0xd46e('0x2')]},'context':{'type':Sequelize[_0xd46e('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xd46e('0x2')]},'accountcode':{'type':Sequelize[_0xd46e('0x2')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0xd46e('0x2')]},'saveName':{'type':Sequelize[_0xd46e('0x2')]},'filename':{'type':Sequelize[_0xd46e('0x2')]},'savePath':{'type':Sequelize[_0xd46e('0x2')]},'format':{'type':Sequelize[_0xd46e('0x3')],'get':function(){var _0x855f24='';var _0x437ea0=this[_0xd46e('0x4')](_0xd46e('0x5'));if(_0x437ea0){_0x855f24=_0x437ea0[_0xd46e('0x6')](_0x437ea0[_0xd46e('0x7')]('.'));}return _0x855f24;}}}; \ No newline at end of file +var _0x7da7=['VIRTUAL','getDataValue','savePath','substring','lastIndexOf','sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7da7,0x10d));var _0x77da=function(_0x2d8d69,_0x8e47ff){_0x2d8d69=_0x2d8d69-0x0;var _0x39ae22=_0x7da7[_0x2d8d69];return _0x39ae22;};'use strict';var Sequelize=require(_0x77da('0x0'));module[_0x77da('0x1')]={'uniqueid':{'type':Sequelize[_0x77da('0x2')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x77da('0x2')]},'extension':{'type':Sequelize[_0x77da('0x2')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x77da('0x2')]},'dnid':{'type':Sequelize[_0x77da('0x2')]},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize[_0x77da('0x2')]},'filename':{'type':Sequelize[_0x77da('0x2')]},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x77da('0x3')],'get':function(){var _0x47cf1d='';var _0x1191de=this[_0x77da('0x4')](_0x77da('0x5'));if(_0x1191de){_0x47cf1d=_0x1191de[_0x77da('0x6')](_0x1191de[_0x77da('0x7')]('.'));}return _0x47cf1d;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index c4a380a..ba0e67b 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 _0x4717=['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','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','then','error','stack','index','map','SquareRecording','rawAttributes','fieldName','type','key','model','name','query','keys','fields','attributes','length','hasOwnProperty','nolimit','order','filters','filter','where','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','intersection','options','find','create','body','update','../../components/encryptor','savePath','%s.cypher','existsSync','secrets','recording','Sequelize','SquareRecording\x20not\x20found','filename','download','extname','unlink','message','send','destroy'];(function(_0xc6b2ff,_0x1558d7){var _0x47f7a4=function(_0x1241f7){while(--_0x1241f7){_0xc6b2ff['push'](_0xc6b2ff['shift']());}};_0x47f7a4(++_0x1558d7);}(_0x4717,0x1de));var _0x7471=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0x4717[_0x2d8fc2];return _0x3a9e53;};'use strict';var emlformat=require(_0x7471('0x0'));var rimraf=require(_0x7471('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7471('0x2'));var rp=require(_0x7471('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7471('0x4'));var util=require(_0x7471('0x5'));var path=require(_0x7471('0x6'));var sox=require(_0x7471('0x7'));var csv=require(_0x7471('0x8'));var ejs=require(_0x7471('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7471('0xa'));var squel=require(_0x7471('0xb'));var crypto=require('crypto');var jsforce=require(_0x7471('0xc'));var deskjs=require(_0x7471('0xd'));var toCsv=require(_0x7471('0x8'));var querystring=require(_0x7471('0xe'));var Papa=require(_0x7471('0xf'));var Redis=require('ioredis');var authService=require(_0x7471('0x10'));var qs=require(_0x7471('0x11'));var as=require(_0x7471('0x12'));var hardwareService=require(_0x7471('0x13'));var logger=require(_0x7471('0x14'))('api');var utils=require(_0x7471('0x15'));var config=require(_0x7471('0x16'));var licenseUtil=require(_0x7471('0x17'));var db=require(_0x7471('0x18'))['db'];function respondWithStatusCode(_0x5b8376,_0x38d6dd){_0x38d6dd=_0x38d6dd||0xcc;return function(_0x2c06ca){if(_0x2c06ca){return _0x5b8376[_0x7471('0x19')](_0x38d6dd);}return _0x5b8376[_0x7471('0x1a')](_0x38d6dd)[_0x7471('0x1b')]();};}function respondWithResult(_0x440c96,_0x252a2c){_0x252a2c=_0x252a2c||0xc8;return function(_0x1b0f9d){if(_0x1b0f9d){return _0x440c96[_0x7471('0x1a')](_0x252a2c)[_0x7471('0x1c')](_0x1b0f9d);}};}function respondWithFilteredResult(_0x2a1506,_0x3bf5c3){return function(_0x3976aa){if(_0x3976aa){var _0x5d6ee7=typeof _0x3bf5c3[_0x7471('0x1d')]===_0x7471('0x1e')&&typeof _0x3bf5c3[_0x7471('0x1f')]===_0x7471('0x1e');var _0x32905e=_0x3976aa[_0x7471('0x20')];var _0x57965a=_0x5d6ee7?0x0:_0x3bf5c3[_0x7471('0x1d')];var _0x3d6c5c=_0x5d6ee7?_0x3976aa['count']:_0x3bf5c3['offset']+_0x3bf5c3[_0x7471('0x1f')];var _0x46eb79;if(_0x3d6c5c>=_0x32905e){_0x3d6c5c=_0x32905e;_0x46eb79=0xc8;}else{_0x46eb79=0xce;}_0x2a1506['status'](_0x46eb79);return _0x2a1506['set']('Content-Range',_0x57965a+'-'+_0x3d6c5c+'/'+_0x32905e)['json'](_0x3976aa);}return null;};}function patchUpdates(_0x10356f){return function(_0x39d5be){try{jsonpatch[_0x7471('0x21')](_0x39d5be,_0x10356f,!![]);}catch(_0x4aeb97){return BPromise['reject'](_0x4aeb97);}return _0x39d5be['save']();};}function saveUpdates(_0x24da9a,_0x178526){return function(_0x4b5823){if(_0x4b5823){return _0x4b5823['update'](_0x24da9a)[_0x7471('0x22')](function(_0x3b3a43){return _0x3b3a43;});}return null;};}function removeEntity(_0x2dcbed,_0x4dfe93){return function(_0x40d440){if(_0x40d440){return _0x40d440['destroy']()['then'](function(){_0x2dcbed[_0x7471('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x473c07,_0x357744){return function(_0x2ce164){if(!_0x2ce164){_0x473c07['sendStatus'](0x194);}return _0x2ce164;};}function handleError(_0x48ebc3,_0x45af0d){_0x45af0d=_0x45af0d||0x1f4;return function(_0x551ed9){logger[_0x7471('0x23')](_0x551ed9[_0x7471('0x24')]);if(_0x551ed9['name']){delete _0x551ed9['name'];}_0x48ebc3[_0x7471('0x1a')](_0x45af0d)['send'](_0x551ed9);};}exports[_0x7471('0x25')]=function(_0x473152,_0x191242){var _0x59212a={},_0x56bdbd={},_0x44e85d={'count':0x0,'rows':[]};var _0x2360fe=_[_0x7471('0x26')](db[_0x7471('0x27')][_0x7471('0x28')],function(_0x1e825c){return{'name':_0x1e825c[_0x7471('0x29')],'type':_0x1e825c[_0x7471('0x2a')][_0x7471('0x2b')]};});_0x56bdbd[_0x7471('0x2c')]=_[_0x7471('0x26')](_0x2360fe,_0x7471('0x2d'));_0x56bdbd[_0x7471('0x2e')]=_[_0x7471('0x2f')](_0x473152[_0x7471('0x2e')]);_0x56bdbd['filters']=_['intersection'](_0x56bdbd[_0x7471('0x2c')],_0x56bdbd[_0x7471('0x2e')]);_0x59212a['attributes']=_['intersection'](_0x56bdbd[_0x7471('0x2c')],qs[_0x7471('0x30')](_0x473152[_0x7471('0x2e')]['fields']));_0x59212a[_0x7471('0x31')]=_0x59212a[_0x7471('0x31')][_0x7471('0x32')]?_0x59212a[_0x7471('0x31')]:_0x56bdbd[_0x7471('0x2c')];if(!_0x473152['query'][_0x7471('0x33')](_0x7471('0x34'))){_0x59212a[_0x7471('0x1f')]=qs[_0x7471('0x1f')](_0x473152[_0x7471('0x2e')][_0x7471('0x1f')]);_0x59212a['offset']=qs[_0x7471('0x1d')](_0x473152[_0x7471('0x2e')][_0x7471('0x1d')]);}_0x59212a[_0x7471('0x35')]=qs['sort'](_0x473152[_0x7471('0x2e')]['sort']);_0x59212a['where']=qs[_0x7471('0x36')](_['pick'](_0x473152[_0x7471('0x2e')],_0x56bdbd[_0x7471('0x36')]),_0x2360fe);if(_0x473152['query'][_0x7471('0x37')]){_0x59212a[_0x7471('0x38')]=_[_0x7471('0x39')](_0x59212a[_0x7471('0x38')],{'$or':_[_0x7471('0x26')](_0x2360fe,function(_0x52e325){if(_0x52e325['type']!==_0x7471('0x3a')){var _0x36ae59={};_0x36ae59[_0x52e325[_0x7471('0x2d')]]={'$like':'%'+_0x473152[_0x7471('0x2e')]['filter']+'%'};return _0x36ae59;}})});}_0x59212a=_[_0x7471('0x39')]({},_0x59212a,_0x473152['options']);var _0x214d3e={'where':_0x59212a[_0x7471('0x38')]};return db[_0x7471('0x27')][_0x7471('0x20')](_0x214d3e)[_0x7471('0x22')](function(_0x1cb70c){_0x44e85d[_0x7471('0x20')]=_0x1cb70c;if(_0x473152[_0x7471('0x2e')][_0x7471('0x3b')]){_0x59212a[_0x7471('0x3c')]=[{'all':!![]}];}return db[_0x7471('0x27')][_0x7471('0x3d')](_0x59212a);})['then'](function(_0x42e2c0){_0x44e85d['rows']=_0x42e2c0;return _0x44e85d;})[_0x7471('0x22')](respondWithFilteredResult(_0x191242,_0x59212a))[_0x7471('0x3e')](handleError(_0x191242,null));};exports[_0x7471('0x3f')]=function(_0x5b2475,_0x2b5229){var _0x28635d={'raw':!![],'where':{'id':_0x5b2475[_0x7471('0x40')]['id']}},_0x4a0e40={};_0x4a0e40[_0x7471('0x2c')]=_[_0x7471('0x2f')](db['SquareRecording'][_0x7471('0x28')]);_0x4a0e40[_0x7471('0x2e')]=_[_0x7471('0x2f')](_0x5b2475[_0x7471('0x2e')]);_0x4a0e40[_0x7471('0x36')]=_[_0x7471('0x41')](_0x4a0e40[_0x7471('0x2c')],_0x4a0e40[_0x7471('0x2e')]);_0x28635d['attributes']=_[_0x7471('0x41')](_0x4a0e40['model'],qs[_0x7471('0x30')](_0x5b2475[_0x7471('0x2e')][_0x7471('0x30')]));_0x28635d['attributes']=_0x28635d[_0x7471('0x31')][_0x7471('0x32')]?_0x28635d['attributes']:_0x4a0e40['model'];if(_0x5b2475[_0x7471('0x2e')][_0x7471('0x3b')]){_0x28635d['include']=[{'all':!![]}];}_0x28635d=_[_0x7471('0x39')]({},_0x28635d,_0x5b2475[_0x7471('0x42')]);return db['SquareRecording'][_0x7471('0x43')](_0x28635d)[_0x7471('0x22')](handleEntityNotFound(_0x2b5229,null))[_0x7471('0x22')](respondWithResult(_0x2b5229,null))[_0x7471('0x3e')](handleError(_0x2b5229,null));};exports[_0x7471('0x44')]=function(_0x431b3a,_0x2a9d7d){return db[_0x7471('0x27')][_0x7471('0x44')](_0x431b3a[_0x7471('0x45')],{})[_0x7471('0x22')](respondWithResult(_0x2a9d7d,0xc9))[_0x7471('0x3e')](handleError(_0x2a9d7d,null));};exports[_0x7471('0x46')]=function(_0x1a8ad6,_0x194c88){if(_0x1a8ad6[_0x7471('0x45')]['id']){delete _0x1a8ad6[_0x7471('0x45')]['id'];}return db[_0x7471('0x27')]['find']({'where':{'id':_0x1a8ad6[_0x7471('0x40')]['id']}})[_0x7471('0x22')](handleEntityNotFound(_0x194c88,null))[_0x7471('0x22')](saveUpdates(_0x1a8ad6['body'],null))[_0x7471('0x22')](respondWithResult(_0x194c88,null))[_0x7471('0x3e')](handleError(_0x194c88,null));};exports['download']=function(_0x225260,_0x1b3629,_0x7e18b4){var _0x16faf9=require(_0x7471('0x47'));var _0x5ef537=![];var _0x545ed9={};if(_0x225260[_0x7471('0x2e')]['type']&&_0x225260[_0x7471('0x2e')][_0x7471('0x2a')]==='uniqueid'){_0x545ed9['uniqueid']=_0x225260['params']['id'];}else{_0x545ed9['id']=_0x225260[_0x7471('0x40')]['id'];}return db[_0x7471('0x27')][_0x7471('0x43')]({'where':_0x545ed9,'attributes':['id',_0x7471('0x48'),'filename'],'raw':!![]})[_0x7471('0x22')](handleEntityNotFound(_0x1b3629,null))['then'](function(_0x504d4e){if(_0x504d4e){var _0x3a1407=_0x504d4e[_0x7471('0x48')];var _0x3b60a0=util['format'](_0x7471('0x49'),_0x3a1407);if(fs[_0x7471('0x4a')](_0x3b60a0)){_0x5ef537=!![];return _0x16faf9['decryptFile'](_0x3b60a0,_0x3a1407,config[_0x7471('0x4b')][_0x7471('0x4c')])[_0x7471('0x22')](function(){return _0x504d4e;});}return _0x504d4e;}})[_0x7471('0x22')](function(_0x31bb43){if(_0x31bb43){var _0x1fe0cf=_0x31bb43['savePath'];if(!fs[_0x7471('0x4a')](_0x1fe0cf)){throw new db[(_0x7471('0x4d'))]['ValidationError'](_0x7471('0x4e'));}if(_0x31bb43[_0x7471('0x4f')]){return _0x1b3629[_0x7471('0x50')](_0x1fe0cf,_0x31bb43['filename']+path[_0x7471('0x51')](_0x1fe0cf),function(){if(_0x5ef537){fs[_0x7471('0x52')](_0x1fe0cf);}});}else{return _0x1b3629[_0x7471('0x50')](_0x1fe0cf,function(_0x476c73){if(_0x5ef537){fs['unlink'](_0x1fe0cf);}});}}})[_0x7471('0x3e')](function(_0x1083ec){if(_0x1083ec[_0x7471('0x53')]===_0x7471('0x4e')){_0x1b3629[_0x7471('0x1a')](0x194)[_0x7471('0x54')]('Not\x20found');}else{return handleError(_0x1b3629,null);}});};exports[_0x7471('0x55')]=function(_0x1db851,_0x480ba3){return db[_0x7471('0x27')][_0x7471('0x43')]({'where':{'id':_0x1db851[_0x7471('0x40')]['id']}})[_0x7471('0x22')](function(_0x459f84){if(_[_0x7471('0x56')](_0x459f84)){throw new ReferenceError(_0x7471('0x57'));}return _0x459f84;})[_0x7471('0x22')](function(_0x291168){var _0x53d6ee=_0x291168[_0x7471('0x48')];logger[_0x7471('0x58')](_0x7471('0x59'),_0x53d6ee);if(!_[_0x7471('0x56')](_0x291168['savePath'])&&fs[_0x7471('0x4a')](_0x53d6ee)){logger[_0x7471('0x58')](_0x7471('0x5a')+_0x53d6ee+_0x7471('0x5b'));fs[_0x7471('0x5c')](_0x53d6ee);}_0x53d6ee=_0x53d6ee+_0x7471('0x5d');if(!_[_0x7471('0x56')](_0x291168[_0x7471('0x48')])&&fs[_0x7471('0x4a')](_0x53d6ee)){logger[_0x7471('0x58')](_0x7471('0x5a')+_0x53d6ee+_0x7471('0x5b'));fs[_0x7471('0x5c')](_0x53d6ee);}return _0x291168;})[_0x7471('0x22')](function(_0x29a37a){if(!_0x29a37a)throw new InternalError();return _0x29a37a['destroy']();})[_0x7471('0x22')](function(){_0x480ba3[_0x7471('0x1a')](0xcc)[_0x7471('0x1b')]();})[_0x7471('0x3e')](handleError(_0x480ba3,null));}; \ No newline at end of file +var _0x701d=['Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','SquareRecording','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','length','find','create','body','../../components/encryptor','uniqueid','savePath','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','filename','extname','unlink','Not\x20found','isNil','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','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'];(function(_0x363ef8,_0x4ecb1a){var _0x148822=function(_0x232634){while(--_0x232634){_0x363ef8['push'](_0x363ef8['shift']());}};_0x148822(++_0x4ecb1a);}(_0x701d,0xa8));var _0xd701=function(_0x54b141,_0x270c14){_0x54b141=_0x54b141-0x0;var _0x2122c1=_0x701d[_0x54b141];return _0x2122c1;};'use strict';var emlformat=require(_0xd701('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd701('0x1'));var jsonpatch=require(_0xd701('0x2'));var rp=require(_0xd701('0x3'));var moment=require(_0xd701('0x4'));var BPromise=require(_0xd701('0x5'));var Mustache=require('mustache');var util=require(_0xd701('0x6'));var path=require(_0xd701('0x7'));var sox=require(_0xd701('0x8'));var csv=require(_0xd701('0x9'));var ejs=require(_0xd701('0xa'));var fs=require('fs');var fs_extra=require(_0xd701('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd701('0xc'));var deskjs=require(_0xd701('0xd'));var toCsv=require(_0xd701('0x9'));var querystring=require(_0xd701('0xe'));var Papa=require('papaparse');var Redis=require(_0xd701('0xf'));var authService=require(_0xd701('0x10'));var qs=require(_0xd701('0x11'));var as=require(_0xd701('0x12'));var hardwareService=require(_0xd701('0x13'));var logger=require('../../config/logger')(_0xd701('0x14'));var utils=require(_0xd701('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xd701('0x16'));var db=require(_0xd701('0x17'))['db'];function respondWithStatusCode(_0x3c386a,_0x56e392){_0x56e392=_0x56e392||0xcc;return function(_0x319b5e){if(_0x319b5e){return _0x3c386a[_0xd701('0x18')](_0x56e392);}return _0x3c386a[_0xd701('0x19')](_0x56e392)[_0xd701('0x1a')]();};}function respondWithResult(_0x50d40e,_0x1ef7e7){_0x1ef7e7=_0x1ef7e7||0xc8;return function(_0xcb6c49){if(_0xcb6c49){return _0x50d40e['status'](_0x1ef7e7)[_0xd701('0x1b')](_0xcb6c49);}};}function respondWithFilteredResult(_0x4ffc18,_0xf64e87){return function(_0xf5d39a){if(_0xf5d39a){var _0x11d426=typeof _0xf64e87[_0xd701('0x1c')]===_0xd701('0x1d')&&typeof _0xf64e87[_0xd701('0x1e')]===_0xd701('0x1d');var _0x2be98d=_0xf5d39a['count'];var _0x5c55e4=_0x11d426?0x0:_0xf64e87[_0xd701('0x1c')];var _0xcb02f4=_0x11d426?_0xf5d39a[_0xd701('0x1f')]:_0xf64e87['offset']+_0xf64e87[_0xd701('0x1e')];var _0x518573;if(_0xcb02f4>=_0x2be98d){_0xcb02f4=_0x2be98d;_0x518573=0xc8;}else{_0x518573=0xce;}_0x4ffc18[_0xd701('0x19')](_0x518573);return _0x4ffc18['set'](_0xd701('0x20'),_0x5c55e4+'-'+_0xcb02f4+'/'+_0x2be98d)['json'](_0xf5d39a);}return null;};}function patchUpdates(_0x67215c){return function(_0x517111){try{jsonpatch[_0xd701('0x21')](_0x517111,_0x67215c,!![]);}catch(_0x3efea7){return BPromise[_0xd701('0x22')](_0x3efea7);}return _0x517111[_0xd701('0x23')]();};}function saveUpdates(_0x3168c8,_0x2d4e22){return function(_0x56e4a1){if(_0x56e4a1){return _0x56e4a1[_0xd701('0x24')](_0x3168c8)[_0xd701('0x25')](function(_0x2b846d){return _0x2b846d;});}return null;};}function removeEntity(_0xd92394,_0x4b5fc1){return function(_0xba835e){if(_0xba835e){return _0xba835e[_0xd701('0x26')]()['then'](function(){_0xd92394[_0xd701('0x19')](0xcc)[_0xd701('0x1a')]();});}};}function handleEntityNotFound(_0x1ae468,_0x4fe5cd){return function(_0x3f0433){if(!_0x3f0433){_0x1ae468[_0xd701('0x18')](0x194);}return _0x3f0433;};}function handleError(_0x11c12,_0x353fc8){_0x353fc8=_0x353fc8||0x1f4;return function(_0x3718d9){logger[_0xd701('0x27')](_0x3718d9[_0xd701('0x28')]);if(_0x3718d9[_0xd701('0x29')]){delete _0x3718d9[_0xd701('0x29')];}_0x11c12[_0xd701('0x19')](_0x353fc8)[_0xd701('0x2a')](_0x3718d9);};}exports[_0xd701('0x2b')]=function(_0x46810b,_0x2be46d){var _0x46857a={},_0xe0b861={},_0x1a70f5={'count':0x0,'rows':[]};var _0x51b140=_[_0xd701('0x2c')](db['SquareRecording']['rawAttributes'],function(_0x2613c6){return{'name':_0x2613c6[_0xd701('0x2d')],'type':_0x2613c6[_0xd701('0x2e')][_0xd701('0x2f')]};});_0xe0b861[_0xd701('0x30')]=_['map'](_0x51b140,_0xd701('0x29'));_0xe0b861[_0xd701('0x31')]=_['keys'](_0x46810b[_0xd701('0x31')]);_0xe0b861[_0xd701('0x32')]=_[_0xd701('0x33')](_0xe0b861[_0xd701('0x30')],_0xe0b861[_0xd701('0x31')]);_0x46857a[_0xd701('0x34')]=_[_0xd701('0x33')](_0xe0b861[_0xd701('0x30')],qs[_0xd701('0x35')](_0x46810b['query'][_0xd701('0x35')]));_0x46857a[_0xd701('0x34')]=_0x46857a[_0xd701('0x34')]['length']?_0x46857a[_0xd701('0x34')]:_0xe0b861[_0xd701('0x30')];if(!_0x46810b['query'][_0xd701('0x36')](_0xd701('0x37'))){_0x46857a['limit']=qs[_0xd701('0x1e')](_0x46810b[_0xd701('0x31')][_0xd701('0x1e')]);_0x46857a['offset']=qs[_0xd701('0x1c')](_0x46810b[_0xd701('0x31')][_0xd701('0x1c')]);}_0x46857a['order']=qs[_0xd701('0x38')](_0x46810b[_0xd701('0x31')][_0xd701('0x38')]);_0x46857a['where']=qs['filters'](_[_0xd701('0x39')](_0x46810b[_0xd701('0x31')],_0xe0b861[_0xd701('0x32')]),_0x51b140);if(_0x46810b[_0xd701('0x31')][_0xd701('0x3a')]){_0x46857a[_0xd701('0x3b')]=_[_0xd701('0x3c')](_0x46857a[_0xd701('0x3b')],{'$or':_[_0xd701('0x2c')](_0x51b140,function(_0x24ad9b){if(_0x24ad9b[_0xd701('0x2e')]!==_0xd701('0x3d')){var _0x4e4889={};_0x4e4889[_0x24ad9b[_0xd701('0x29')]]={'$like':'%'+_0x46810b[_0xd701('0x31')][_0xd701('0x3a')]+'%'};return _0x4e4889;}})});}_0x46857a=_[_0xd701('0x3c')]({},_0x46857a,_0x46810b[_0xd701('0x3e')]);var _0xc924f2={'where':_0x46857a[_0xd701('0x3b')]};return db[_0xd701('0x3f')][_0xd701('0x1f')](_0xc924f2)[_0xd701('0x25')](function(_0xa625e){_0x1a70f5[_0xd701('0x1f')]=_0xa625e;if(_0x46810b[_0xd701('0x31')][_0xd701('0x40')]){_0x46857a[_0xd701('0x41')]=[{'all':!![]}];}return db[_0xd701('0x3f')][_0xd701('0x42')](_0x46857a);})['then'](function(_0x51f1eb){_0x1a70f5[_0xd701('0x43')]=_0x51f1eb;return _0x1a70f5;})['then'](respondWithFilteredResult(_0x2be46d,_0x46857a))[_0xd701('0x44')](handleError(_0x2be46d,null));};exports[_0xd701('0x45')]=function(_0x1e60b3,_0x1302ec){var _0x3d7f9b={'raw':!![],'where':{'id':_0x1e60b3[_0xd701('0x46')]['id']}},_0x5ac0ba={};_0x5ac0ba[_0xd701('0x30')]=_[_0xd701('0x47')](db[_0xd701('0x3f')][_0xd701('0x48')]);_0x5ac0ba[_0xd701('0x31')]=_[_0xd701('0x47')](_0x1e60b3[_0xd701('0x31')]);_0x5ac0ba[_0xd701('0x32')]=_[_0xd701('0x33')](_0x5ac0ba['model'],_0x5ac0ba[_0xd701('0x31')]);_0x3d7f9b[_0xd701('0x34')]=_[_0xd701('0x33')](_0x5ac0ba[_0xd701('0x30')],qs[_0xd701('0x35')](_0x1e60b3[_0xd701('0x31')][_0xd701('0x35')]));_0x3d7f9b[_0xd701('0x34')]=_0x3d7f9b[_0xd701('0x34')][_0xd701('0x49')]?_0x3d7f9b[_0xd701('0x34')]:_0x5ac0ba[_0xd701('0x30')];if(_0x1e60b3['query']['includeAll']){_0x3d7f9b[_0xd701('0x41')]=[{'all':!![]}];}_0x3d7f9b=_['merge']({},_0x3d7f9b,_0x1e60b3[_0xd701('0x3e')]);return db[_0xd701('0x3f')][_0xd701('0x4a')](_0x3d7f9b)[_0xd701('0x25')](handleEntityNotFound(_0x1302ec,null))[_0xd701('0x25')](respondWithResult(_0x1302ec,null))[_0xd701('0x44')](handleError(_0x1302ec,null));};exports['create']=function(_0x21caa0,_0x26b0b4){return db[_0xd701('0x3f')][_0xd701('0x4b')](_0x21caa0['body'],{})[_0xd701('0x25')](respondWithResult(_0x26b0b4,0xc9))['catch'](handleError(_0x26b0b4,null));};exports['update']=function(_0x25b44f,_0x22baeb){if(_0x25b44f[_0xd701('0x4c')]['id']){delete _0x25b44f[_0xd701('0x4c')]['id'];}return db[_0xd701('0x3f')][_0xd701('0x4a')]({'where':{'id':_0x25b44f[_0xd701('0x46')]['id']}})[_0xd701('0x25')](handleEntityNotFound(_0x22baeb,null))[_0xd701('0x25')](saveUpdates(_0x25b44f[_0xd701('0x4c')],null))[_0xd701('0x25')](respondWithResult(_0x22baeb,null))['catch'](handleError(_0x22baeb,null));};exports['download']=function(_0x2e066d,_0x1fb7c9,_0x1898fe){var _0x4f49cd=require(_0xd701('0x4d'));var _0x14aded=![];var _0x2486a7={};if(_0x2e066d[_0xd701('0x31')][_0xd701('0x2e')]&&_0x2e066d[_0xd701('0x31')][_0xd701('0x2e')]===_0xd701('0x4e')){_0x2486a7['uniqueid']=_0x2e066d[_0xd701('0x46')]['id'];}else{_0x2486a7['id']=_0x2e066d[_0xd701('0x46')]['id'];}return db[_0xd701('0x3f')][_0xd701('0x4a')]({'where':_0x2486a7,'attributes':['id',_0xd701('0x4f'),'filename'],'raw':!![]})['then'](handleEntityNotFound(_0x1fb7c9,null))[_0xd701('0x25')](function(_0x28212c){if(_0x28212c){var _0x28af5f=_0x28212c[_0xd701('0x4f')];var _0xbe0a56=util[_0xd701('0x50')](_0xd701('0x51'),_0x28af5f);if(fs[_0xd701('0x52')](_0xbe0a56)){_0x14aded=!![];return _0x4f49cd[_0xd701('0x53')](_0xbe0a56,_0x28af5f,config[_0xd701('0x54')][_0xd701('0x55')])[_0xd701('0x25')](function(){return _0x28212c;});}return _0x28212c;}})['then'](function(_0x1bd0bc){if(_0x1bd0bc){var _0x414fac=_0x1bd0bc[_0xd701('0x4f')];if(!fs[_0xd701('0x52')](_0x414fac)){throw new db[(_0xd701('0x56'))][(_0xd701('0x57'))](_0xd701('0x58'));}if(_0x1bd0bc[_0xd701('0x59')]){return _0x1fb7c9['download'](_0x414fac,_0x1bd0bc[_0xd701('0x59')]+path[_0xd701('0x5a')](_0x414fac),function(){if(_0x14aded){fs['unlink'](_0x414fac);}});}else{return _0x1fb7c9['download'](_0x414fac,function(_0x3cea7d){if(_0x14aded){fs[_0xd701('0x5b')](_0x414fac);}});}}})[_0xd701('0x44')](function(_0x149756){if(_0x149756['message']===_0xd701('0x58')){_0x1fb7c9[_0xd701('0x19')](0x194)[_0xd701('0x2a')](_0xd701('0x5c'));}else{return handleError(_0x1fb7c9,null);}});};exports[_0xd701('0x26')]=function(_0x7b307,_0xe5f521){return db['SquareRecording'][_0xd701('0x4a')]({'where':{'id':_0x7b307[_0xd701('0x46')]['id']}})[_0xd701('0x25')](function(_0x111068){if(_[_0xd701('0x5d')](_0x111068)){throw new ReferenceError(_0xd701('0x5e'));}return _0x111068;})['then'](function(_0x156305){var _0x182aff=_0x156305[_0xd701('0x4f')];logger['info'](_0xd701('0x5f'),_0x182aff);if(!_[_0xd701('0x5d')](_0x156305[_0xd701('0x4f')])&&fs[_0xd701('0x52')](_0x182aff)){logger[_0xd701('0x60')](_0xd701('0x61')+_0x182aff+_0xd701('0x62'));fs[_0xd701('0x63')](_0x182aff);}_0x182aff=_0x182aff+'.cypher';if(!_[_0xd701('0x5d')](_0x156305[_0xd701('0x4f')])&&fs[_0xd701('0x52')](_0x182aff)){logger[_0xd701('0x60')]('File:\x20\x22'+_0x182aff+_0xd701('0x62'));fs[_0xd701('0x63')](_0x182aff);}return _0x156305;})['then'](function(_0x4708c8){if(!_0x4708c8)throw new InternalError();return _0x4708c8['destroy']();})[_0xd701('0x25')](function(){_0xe5f521['status'](0xcc)[_0xd701('0x1a')]();})['catch'](handleError(_0xe5f521,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index c381641..03ad72c 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 _0x1228=['exports','define','SquareRecording','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0xd506b6,_0x2617ad){var _0x4a89db=function(_0x146055){while(--_0x146055){_0xd506b6['push'](_0xd506b6['shift']());}};_0x4a89db(++_0x2617ad);}(_0x1228,0x12f));var _0x8122=function(_0x3c09c9,_0x486fb2){_0x3c09c9=_0x3c09c9-0x0;var _0x506356=_0x1228[_0x3c09c9];return _0x506356;};'use strict';var _=require(_0x8122('0x0'));var util=require('util');var logger=require(_0x8122('0x1'))('api');var moment=require(_0x8122('0x2'));var BPromise=require(_0x8122('0x3'));var rp=require(_0x8122('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8122('0x5'));var config=require(_0x8122('0x6'));var attributes=require('./squareRecording.attributes');module[_0x8122('0x7')]=function(_0x130959,_0x4e3b94){return _0x130959[_0x8122('0x8')](_0x8122('0x9'),attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5353=['./squareRecording.attributes','exports','SquareRecording','square_recordings','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x56ee82,_0x287804){var _0x524d6d=function(_0x2ccde3){while(--_0x2ccde3){_0x56ee82['push'](_0x56ee82['shift']());}};_0x524d6d(++_0x287804);}(_0x5353,0x12f));var _0x3535=function(_0x3fb843,_0x18b211){_0x3fb843=_0x3fb843-0x0;var _0x2ffa8b=_0x5353[_0x3fb843];return _0x2ffa8b;};'use strict';var _=require(_0x3535('0x0'));var util=require('util');var logger=require(_0x3535('0x1'))(_0x3535('0x2'));var moment=require(_0x3535('0x3'));var BPromise=require(_0x3535('0x4'));var rp=require(_0x3535('0x5'));var fs=require('fs');var path=require(_0x3535('0x6'));var rimraf=require(_0x3535('0x7'));var config=require(_0x3535('0x8'));var attributes=require(_0x3535('0x9'));module[_0x3535('0xa')]=function(_0x5e8c6d,_0x22e925){return _0x5e8c6d['define'](_0x3535('0xb'),attributes,{'tableName':_0x3535('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index 356dc00..687b3f8 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 _0xc073=['SquareRecording','create','body','options','raw','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateSquareRecording'];(function(_0x5e9dc0,_0x1e9439){var _0xb2e7bd=function(_0x4a7bdd){while(--_0x4a7bdd){_0x5e9dc0['push'](_0x5e9dc0['shift']());}};_0xb2e7bd(++_0x1e9439);}(_0xc073,0x127));var _0x3c07=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc073[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3c07('0x0'));var util=require(_0x3c07('0x1'));var moment=require('moment');var BPromise=require(_0x3c07('0x2'));var rs=require(_0x3c07('0x3'));var fs=require('fs');var Redis=require(_0x3c07('0x4'));var db=require(_0x3c07('0x5'))['db'];var utils=require(_0x3c07('0x6'));var logger=require(_0x3c07('0x7'))('rpc');var config=require(_0x3c07('0x8'));var jayson=require(_0x3c07('0x9'));var client=jayson[_0x3c07('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1bb724,_0x2ef4c3,_0x3e64d9){return new BPromise(function(_0x56e16a,_0xf91e1c){return client[_0x3c07('0xb')](_0x1bb724,_0x3e64d9)[_0x3c07('0xc')](function(_0x176cbd){logger[_0x3c07('0xd')](_0x3c07('0xe'),_0x2ef4c3,_0x3c07('0xf'));logger[_0x3c07('0x10')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0x2ef4c3,'request\x20sent',JSON[_0x3c07('0x11')](_0x176cbd));if(_0x176cbd[_0x3c07('0x12')]){if(_0x176cbd['error'][_0x3c07('0x13')]===0x1f4){logger[_0x3c07('0x12')]('SquareRecording,\x20%s,\x20%s',_0x2ef4c3,_0x176cbd['error'][_0x3c07('0x14')]);return _0xf91e1c(_0x176cbd['error'][_0x3c07('0x14')]);}logger[_0x3c07('0x12')](_0x3c07('0xe'),_0x2ef4c3,_0x176cbd[_0x3c07('0x12')][_0x3c07('0x14')]);return _0x56e16a(_0x176cbd[_0x3c07('0x12')][_0x3c07('0x14')]);}else{logger[_0x3c07('0xd')](_0x3c07('0xe'),_0x2ef4c3,'request\x20sent');_0x56e16a(_0x176cbd[_0x3c07('0x15')][_0x3c07('0x14')]);}})[_0x3c07('0x16')](function(_0x40487a){logger[_0x3c07('0x12')](_0x3c07('0xe'),_0x2ef4c3,_0x40487a);_0xf91e1c(_0x40487a);});});}exports[_0x3c07('0x17')]=function(_0x2dcea0){var _0x30893f=this;return new Promise(function(_0x29ba9a,_0x526b21){return db[_0x3c07('0x18')][_0x3c07('0x19')](_0x2dcea0[_0x3c07('0x1a')],{'raw':_0x2dcea0[_0x3c07('0x1b')]?_0x2dcea0['options'][_0x3c07('0x1c')]===undefined?!![]:![]:!![]})[_0x3c07('0xc')](function(_0x593a7f){logger[_0x3c07('0xd')]('CreateSquareRecording',_0x2dcea0);logger['debug'](_0x3c07('0x17'),_0x2dcea0,JSON[_0x3c07('0x11')](_0x593a7f));_0x29ba9a(_0x593a7f);})[_0x3c07('0x16')](function(_0x283003){logger['error'](_0x3c07('0x17'),_0x283003[_0x3c07('0x14')],_0x2dcea0);_0x526b21(_0x30893f[_0x3c07('0x12')](0x1f4,_0x283003[_0x3c07('0x14')]));});});}; \ No newline at end of file +var _0x72d5=['then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateSquareRecording','SquareRecording','create','body','options','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x4a8184,_0x5a195a){var _0x426cf9=function(_0x5a7b1f){while(--_0x5a7b1f){_0x4a8184['push'](_0x4a8184['shift']());}};_0x426cf9(++_0x5a195a);}(_0x72d5,0x160));var _0x572d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x72d5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x572d('0x0'));var util=require(_0x572d('0x1'));var moment=require(_0x572d('0x2'));var BPromise=require(_0x572d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x572d('0x4'));var db=require(_0x572d('0x5'))['db'];var utils=require(_0x572d('0x6'));var logger=require(_0x572d('0x7'))(_0x572d('0x8'));var config=require(_0x572d('0x9'));var jayson=require(_0x572d('0xa'));var client=jayson['client'][_0x572d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x244c9f,_0x506249,_0x12998c){return new BPromise(function(_0x24f17f,_0x211011){return client['request'](_0x244c9f,_0x12998c)[_0x572d('0xc')](function(_0x10ac2c){logger[_0x572d('0xd')](_0x572d('0xe'),_0x506249,_0x572d('0xf'));logger[_0x572d('0x10')](_0x572d('0x11'),_0x506249,_0x572d('0xf'),JSON[_0x572d('0x12')](_0x10ac2c));if(_0x10ac2c[_0x572d('0x13')]){if(_0x10ac2c[_0x572d('0x13')][_0x572d('0x14')]===0x1f4){logger[_0x572d('0x13')](_0x572d('0xe'),_0x506249,_0x10ac2c[_0x572d('0x13')]['message']);return _0x211011(_0x10ac2c[_0x572d('0x13')][_0x572d('0x15')]);}logger[_0x572d('0x13')](_0x572d('0xe'),_0x506249,_0x10ac2c[_0x572d('0x13')]['message']);return _0x24f17f(_0x10ac2c[_0x572d('0x13')][_0x572d('0x15')]);}else{logger[_0x572d('0xd')]('SquareRecording,\x20%s,\x20%s',_0x506249,'request\x20sent');_0x24f17f(_0x10ac2c['result'][_0x572d('0x15')]);}})[_0x572d('0x16')](function(_0x3fa3ec){logger['error'](_0x572d('0xe'),_0x506249,_0x3fa3ec);_0x211011(_0x3fa3ec);});});}exports[_0x572d('0x17')]=function(_0x49ec76){var _0xb910e2=this;return new Promise(function(_0x2d0bee,_0x2651a6){return db[_0x572d('0x18')][_0x572d('0x19')](_0x49ec76[_0x572d('0x1a')],{'raw':_0x49ec76[_0x572d('0x1b')]?_0x49ec76[_0x572d('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x572d('0xc')](function(_0x51a8c5){logger[_0x572d('0xd')](_0x572d('0x17'),_0x49ec76);logger['debug'](_0x572d('0x17'),_0x49ec76,JSON[_0x572d('0x12')](_0x51a8c5));_0x2d0bee(_0x51a8c5);})['catch'](function(_0x9e7f79){logger[_0x572d('0x13')](_0x572d('0x17'),_0x9e7f79[_0x572d('0x15')],_0x49ec76);_0x2651a6(_0xb910e2[_0x572d('0x13')](0x1f4,_0x9e7f79[_0x572d('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index bd4857f..8af5b8d 100644 --- a/server/api/squareReport/index.js +++ b/server/api/squareReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['/describe','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index'];(function(_0x134b0a,_0x30deb8){var _0xc59b70=function(_0x4e1acb){while(--_0x4e1acb){_0x134b0a['push'](_0x134b0a['shift']());}};_0xc59b70(++_0x30deb8);}(_0xe706,0xa3));var _0x6e70=function(_0x2786ea,_0x16c3c3){_0x2786ea=_0x2786ea-0x0;var _0x5c38e5=_0xe706[_0x2786ea];return _0x5c38e5;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller['update']);router['delete'](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x14')]);module[_0x6e70('0x15')]=router; \ No newline at end of file +var _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(_0x4227f7,_0x5e2633){var _0x4d394e=function(_0x1d7676){while(--_0x1d7676){_0x4227f7['push'](_0x4227f7['shift']());}};_0x4d394e(++_0x5e2633);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./squareReport.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 098d2f7..6c01249 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 _0x6633=['STRING','DATE','BOOLEAN','sequelize','exports'];(function(_0x8073f5,_0xff152b){var _0x226a35=function(_0x40091e){while(--_0x40091e){_0x8073f5['push'](_0x8073f5['shift']());}};_0x226a35(++_0xff152b);}(_0x6633,0xfd));var _0x3663=function(_0x5986b5,_0x3e5444){_0x5986b5=_0x5986b5-0x0;var _0x4d8e00=_0x6633[_0x5986b5];return _0x4d8e00;};'use strict';var Sequelize=require(_0x3663('0x0'));module[_0x3663('0x1')]={'network':{'type':Sequelize[_0x3663('0x2')]},'network_script':{'type':Sequelize[_0x3663('0x2')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x3663('0x2')]},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x3663('0x2')]},'version':{'type':Sequelize[_0x3663('0x2')]},'callerid':{'type':Sequelize[_0x3663('0x2')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0x3663('0x2')]},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x3663('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x3663('0x2')]},'enhanced':{'type':Sequelize[_0x3663('0x2')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0x3663('0x2')]},'project_name':{'type':Sequelize[_0x3663('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x3663('0x3')]},'bot':{'type':Sequelize[_0x3663('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x976a=['exports','STRING','DATE','BOOLEAN','sequelize'];(function(_0x2a3c0a,_0x163f5c){var _0x1703a2=function(_0x471dfe){while(--_0x471dfe){_0x2a3c0a['push'](_0x2a3c0a['shift']());}};_0x1703a2(++_0x163f5c);}(_0x976a,0x6d));var _0xa976=function(_0x1a3255,_0xd1c5bd){_0x1a3255=_0x1a3255-0x0;var _0x44dcf9=_0x976a[_0x1a3255];return _0x44dcf9;};'use strict';var Sequelize=require(_0xa976('0x0'));module[_0xa976('0x1')]={'network':{'type':Sequelize[_0xa976('0x2')]},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xa976('0x2')]},'language':{'type':Sequelize[_0xa976('0x2')]},'type':{'type':Sequelize[_0xa976('0x2')]},'uniqueid':{'type':Sequelize[_0xa976('0x2')]},'version':{'type':Sequelize[_0xa976('0x2')]},'callerid':{'type':Sequelize[_0xa976('0x2')]},'calleridname':{'type':Sequelize[_0xa976('0x2')]},'callingpres':{'type':Sequelize[_0xa976('0x2')]},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize[_0xa976('0x2')]},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize[_0xa976('0x2')]},'context':{'type':Sequelize[_0xa976('0x2')]},'extension':{'type':Sequelize[_0xa976('0x2')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0xa976('0x2')]},'accountcode':{'type':Sequelize[_0xa976('0x2')]},'threadid':{'type':Sequelize[_0xa976('0x2')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xa976('0x3')]},'leaveAt':{'type':Sequelize[_0xa976('0x3')]},'bot':{'type':Sequelize[_0xa976('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 96928ad..c9741f2 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 _0xf918=['../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','then','destroy','end','error','stack','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','filter','VIRTUAL','merge','SquareReport','includeAll','include','rows','catch','show','params','options','find','create','update','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils'];(function(_0x5c5836,_0x15735b){var _0x2fa3a5=function(_0x265d1f){while(--_0x265d1f){_0x5c5836['push'](_0x5c5836['shift']());}};_0x2fa3a5(++_0x15735b);}(_0xf918,0x19a));var _0x8f91=function(_0xaf25ae,_0x2001c1){_0xaf25ae=_0xaf25ae-0x0;var _0x49732d=_0xf918[_0xaf25ae];return _0x49732d;};'use strict';var emlformat=require(_0x8f91('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8f91('0x1'));var jsonpatch=require(_0x8f91('0x2'));var rp=require(_0x8f91('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8f91('0x4'));var path=require(_0x8f91('0x5'));var sox=require(_0x8f91('0x6'));var csv=require(_0x8f91('0x7'));var ejs=require(_0x8f91('0x8'));var fs=require('fs');var fs_extra=require(_0x8f91('0x9'));var _=require(_0x8f91('0xa'));var squel=require(_0x8f91('0xb'));var crypto=require(_0x8f91('0xc'));var jsforce=require(_0x8f91('0xd'));var deskjs=require(_0x8f91('0xe'));var toCsv=require(_0x8f91('0x7'));var querystring=require(_0x8f91('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8f91('0x10'));var qs=require(_0x8f91('0x11'));var as=require(_0x8f91('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8f91('0x13'))(_0x8f91('0x14'));var utils=require(_0x8f91('0x15'));var config=require(_0x8f91('0x16'));var licenseUtil=require(_0x8f91('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5dfdca,_0x365e41){_0x365e41=_0x365e41||0xcc;return function(_0x2e043e){if(_0x2e043e){return _0x5dfdca[_0x8f91('0x18')](_0x365e41);}return _0x5dfdca[_0x8f91('0x19')](_0x365e41)['end']();};}function respondWithResult(_0x5aedf2,_0x23f552){_0x23f552=_0x23f552||0xc8;return function(_0x3aef17){if(_0x3aef17){return _0x5aedf2[_0x8f91('0x19')](_0x23f552)[_0x8f91('0x1a')](_0x3aef17);}};}function respondWithFilteredResult(_0x7b81d,_0x4649fc){return function(_0x485e5d){if(_0x485e5d){var _0x35f11a=typeof _0x4649fc[_0x8f91('0x1b')]===_0x8f91('0x1c')&&typeof _0x4649fc[_0x8f91('0x1d')]===_0x8f91('0x1c');var _0x32eaf1=_0x485e5d['count'];var _0x579d9f=_0x35f11a?0x0:_0x4649fc[_0x8f91('0x1b')];var _0x4a1f73=_0x35f11a?_0x485e5d[_0x8f91('0x1e')]:_0x4649fc[_0x8f91('0x1b')]+_0x4649fc['limit'];var _0x3e5281;if(_0x4a1f73>=_0x32eaf1){_0x4a1f73=_0x32eaf1;_0x3e5281=0xc8;}else{_0x3e5281=0xce;}_0x7b81d[_0x8f91('0x19')](_0x3e5281);return _0x7b81d[_0x8f91('0x1f')](_0x8f91('0x20'),_0x579d9f+'-'+_0x4a1f73+'/'+_0x32eaf1)[_0x8f91('0x1a')](_0x485e5d);}return null;};}function patchUpdates(_0x58a1df){return function(_0x533985){try{jsonpatch[_0x8f91('0x21')](_0x533985,_0x58a1df,!![]);}catch(_0x321c06){return BPromise['reject'](_0x321c06);}return _0x533985['save']();};}function saveUpdates(_0x463af9,_0xbf6a89){return function(_0xfc3088){if(_0xfc3088){return _0xfc3088['update'](_0x463af9)[_0x8f91('0x22')](function(_0x3cbb27){return _0x3cbb27;});}return null;};}function removeEntity(_0x583936,_0xaf2a25){return function(_0x485b82){if(_0x485b82){return _0x485b82[_0x8f91('0x23')]()['then'](function(){_0x583936[_0x8f91('0x19')](0xcc)[_0x8f91('0x24')]();});}};}function handleEntityNotFound(_0x40d207,_0x355417){return function(_0x14766c){if(!_0x14766c){_0x40d207[_0x8f91('0x18')](0x194);}return _0x14766c;};}function handleError(_0x1c9e3b,_0x5701f6){_0x5701f6=_0x5701f6||0x1f4;return function(_0x4fdc24){logger[_0x8f91('0x25')](_0x4fdc24[_0x8f91('0x26')]);if(_0x4fdc24['name']){delete _0x4fdc24['name'];}_0x1c9e3b[_0x8f91('0x19')](_0x5701f6)['send'](_0x4fdc24);};}exports[_0x8f91('0x27')]=function(_0x1efab3,_0x4ee703){var _0x51b0d2={},_0xc3a76f={},_0x9fab79={'count':0x0,'rows':[]};var _0x36a552=_[_0x8f91('0x28')](db['SquareReport'][_0x8f91('0x29')],function(_0x35906a){return{'name':_0x35906a[_0x8f91('0x2a')],'type':_0x35906a[_0x8f91('0x2b')][_0x8f91('0x2c')]};});_0xc3a76f[_0x8f91('0x2d')]=_[_0x8f91('0x28')](_0x36a552,'name');_0xc3a76f[_0x8f91('0x2e')]=_[_0x8f91('0x2f')](_0x1efab3[_0x8f91('0x2e')]);_0xc3a76f['filters']=_[_0x8f91('0x30')](_0xc3a76f[_0x8f91('0x2d')],_0xc3a76f[_0x8f91('0x2e')]);_0x51b0d2[_0x8f91('0x31')]=_['intersection'](_0xc3a76f['model'],qs[_0x8f91('0x32')](_0x1efab3[_0x8f91('0x2e')][_0x8f91('0x32')]));_0x51b0d2[_0x8f91('0x31')]=_0x51b0d2[_0x8f91('0x31')][_0x8f91('0x33')]?_0x51b0d2[_0x8f91('0x31')]:_0xc3a76f[_0x8f91('0x2d')];if(!_0x1efab3[_0x8f91('0x2e')][_0x8f91('0x34')]('nolimit')){_0x51b0d2['limit']=qs[_0x8f91('0x1d')](_0x1efab3[_0x8f91('0x2e')][_0x8f91('0x1d')]);_0x51b0d2[_0x8f91('0x1b')]=qs[_0x8f91('0x1b')](_0x1efab3[_0x8f91('0x2e')][_0x8f91('0x1b')]);}_0x51b0d2['order']=qs[_0x8f91('0x35')](_0x1efab3[_0x8f91('0x2e')][_0x8f91('0x35')]);_0x51b0d2[_0x8f91('0x36')]=qs[_0x8f91('0x37')](_['pick'](_0x1efab3[_0x8f91('0x2e')],_0xc3a76f['filters']),_0x36a552);if(_0x1efab3[_0x8f91('0x2e')][_0x8f91('0x38')]){_0x51b0d2[_0x8f91('0x36')]=_['merge'](_0x51b0d2[_0x8f91('0x36')],{'$or':_[_0x8f91('0x28')](_0x36a552,function(_0x3356ff){if(_0x3356ff[_0x8f91('0x2b')]!==_0x8f91('0x39')){var _0x4ed8a6={};_0x4ed8a6[_0x3356ff['name']]={'$like':'%'+_0x1efab3['query']['filter']+'%'};return _0x4ed8a6;}})});}_0x51b0d2=_[_0x8f91('0x3a')]({},_0x51b0d2,_0x1efab3['options']);var _0xf011ce={'where':_0x51b0d2[_0x8f91('0x36')]};return db[_0x8f91('0x3b')][_0x8f91('0x1e')](_0xf011ce)[_0x8f91('0x22')](function(_0x2c290f){_0x9fab79[_0x8f91('0x1e')]=_0x2c290f;if(_0x1efab3[_0x8f91('0x2e')][_0x8f91('0x3c')]){_0x51b0d2[_0x8f91('0x3d')]=[{'all':!![]}];}return db[_0x8f91('0x3b')]['findAll'](_0x51b0d2);})[_0x8f91('0x22')](function(_0x111577){_0x9fab79[_0x8f91('0x3e')]=_0x111577;return _0x9fab79;})[_0x8f91('0x22')](respondWithFilteredResult(_0x4ee703,_0x51b0d2))[_0x8f91('0x3f')](handleError(_0x4ee703,null));};exports[_0x8f91('0x40')]=function(_0x4898bd,_0x429f66){var _0xbb8bf4={'raw':!![],'where':{'id':_0x4898bd[_0x8f91('0x41')]['id']}},_0x22c927={};_0x22c927['model']=_[_0x8f91('0x2f')](db[_0x8f91('0x3b')]['rawAttributes']);_0x22c927[_0x8f91('0x2e')]=_[_0x8f91('0x2f')](_0x4898bd[_0x8f91('0x2e')]);_0x22c927[_0x8f91('0x37')]=_[_0x8f91('0x30')](_0x22c927[_0x8f91('0x2d')],_0x22c927[_0x8f91('0x2e')]);_0xbb8bf4[_0x8f91('0x31')]=_[_0x8f91('0x30')](_0x22c927[_0x8f91('0x2d')],qs[_0x8f91('0x32')](_0x4898bd[_0x8f91('0x2e')][_0x8f91('0x32')]));_0xbb8bf4[_0x8f91('0x31')]=_0xbb8bf4[_0x8f91('0x31')][_0x8f91('0x33')]?_0xbb8bf4['attributes']:_0x22c927['model'];if(_0x4898bd['query']['includeAll']){_0xbb8bf4[_0x8f91('0x3d')]=[{'all':!![]}];}_0xbb8bf4=_[_0x8f91('0x3a')]({},_0xbb8bf4,_0x4898bd[_0x8f91('0x42')]);return db[_0x8f91('0x3b')][_0x8f91('0x43')](_0xbb8bf4)[_0x8f91('0x22')](handleEntityNotFound(_0x429f66,null))[_0x8f91('0x22')](respondWithResult(_0x429f66,null))[_0x8f91('0x3f')](handleError(_0x429f66,null));};exports[_0x8f91('0x44')]=function(_0x1ea858,_0x215488){return db[_0x8f91('0x3b')][_0x8f91('0x44')](_0x1ea858['body'],{})[_0x8f91('0x22')](respondWithResult(_0x215488,0xc9))[_0x8f91('0x3f')](handleError(_0x215488,null));};exports[_0x8f91('0x45')]=function(_0x4bad51,_0x1371c8){if(_0x4bad51[_0x8f91('0x46')]['id']){delete _0x4bad51['body']['id'];}return db[_0x8f91('0x3b')][_0x8f91('0x43')]({'where':{'id':_0x4bad51[_0x8f91('0x41')]['id']}})[_0x8f91('0x22')](handleEntityNotFound(_0x1371c8,null))['then'](saveUpdates(_0x4bad51[_0x8f91('0x46')],null))['then'](respondWithResult(_0x1371c8,null))[_0x8f91('0x3f')](handleError(_0x1371c8,null));};exports[_0x8f91('0x23')]=function(_0x5262ce,_0x15783a){return db[_0x8f91('0x3b')][_0x8f91('0x43')]({'where':{'id':_0x5262ce[_0x8f91('0x41')]['id']}})[_0x8f91('0x22')](handleEntityNotFound(_0x15783a,null))[_0x8f91('0x22')](removeEntity(_0x15783a,null))[_0x8f91('0x3f')](handleError(_0x15783a,null));};exports[_0x8f91('0x47')]=function(_0x1bf6bf,_0xdf6127){return db['SquareReport'][_0x8f91('0x47')]()['then'](respondWithResult(_0xdf6127,null))[_0x8f91('0x3f')](handleError(_0xdf6127,null));}; \ No newline at end of file +var _0x4dbb=['../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','destroy','then','sendStatus','error','name','send','index','map','SquareReport','type','key','model','keys','intersection','query','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','options','includeAll','findAll','rows','show','rawAttributes','length','include','merge','find','catch','create','body','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','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'];(function(_0x31257c,_0x524919){var _0x4dec33=function(_0x177cae){while(--_0x177cae){_0x31257c['push'](_0x31257c['shift']());}};_0x4dec33(++_0x524919);}(_0x4dbb,0x88));var _0xb4db=function(_0x13e758,_0x317d23){_0x13e758=_0x13e758-0x0;var _0x5b53c3=_0x4dbb[_0x13e758];return _0x5b53c3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb4db('0x0'));var zipdir=require(_0xb4db('0x1'));var jsonpatch=require(_0xb4db('0x2'));var rp=require(_0xb4db('0x3'));var moment=require(_0xb4db('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb4db('0x5'));var util=require(_0xb4db('0x6'));var path=require('path');var sox=require(_0xb4db('0x7'));var csv=require('to-csv');var ejs=require(_0xb4db('0x8'));var fs=require('fs');var fs_extra=require(_0xb4db('0x9'));var _=require('lodash');var squel=require(_0xb4db('0xa'));var crypto=require(_0xb4db('0xb'));var jsforce=require(_0xb4db('0xc'));var deskjs=require(_0xb4db('0xd'));var toCsv=require(_0xb4db('0xe'));var querystring=require(_0xb4db('0xf'));var Papa=require(_0xb4db('0x10'));var Redis=require(_0xb4db('0x11'));var authService=require(_0xb4db('0x12'));var qs=require(_0xb4db('0x13'));var as=require(_0xb4db('0x14'));var hardwareService=require(_0xb4db('0x15'));var logger=require(_0xb4db('0x16'))(_0xb4db('0x17'));var utils=require(_0xb4db('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb4db('0x19'))['db'];function respondWithStatusCode(_0x7729b,_0x320c49){_0x320c49=_0x320c49||0xcc;return function(_0x646ac6){if(_0x646ac6){return _0x7729b['sendStatus'](_0x320c49);}return _0x7729b[_0xb4db('0x1a')](_0x320c49)[_0xb4db('0x1b')]();};}function respondWithResult(_0x46b224,_0x9b2033){_0x9b2033=_0x9b2033||0xc8;return function(_0x462b20){if(_0x462b20){return _0x46b224[_0xb4db('0x1a')](_0x9b2033)[_0xb4db('0x1c')](_0x462b20);}};}function respondWithFilteredResult(_0x1294e3,_0x611bb5){return function(_0x37491e){if(_0x37491e){var _0x2ec703=typeof _0x611bb5[_0xb4db('0x1d')]==='undefined'&&typeof _0x611bb5[_0xb4db('0x1e')]===_0xb4db('0x1f');var _0x1b6c1c=_0x37491e['count'];var _0x483b10=_0x2ec703?0x0:_0x611bb5[_0xb4db('0x1d')];var _0x13b798=_0x2ec703?_0x37491e[_0xb4db('0x20')]:_0x611bb5[_0xb4db('0x1d')]+_0x611bb5['limit'];var _0x163069;if(_0x13b798>=_0x1b6c1c){_0x13b798=_0x1b6c1c;_0x163069=0xc8;}else{_0x163069=0xce;}_0x1294e3[_0xb4db('0x1a')](_0x163069);return _0x1294e3[_0xb4db('0x21')](_0xb4db('0x22'),_0x483b10+'-'+_0x13b798+'/'+_0x1b6c1c)[_0xb4db('0x1c')](_0x37491e);}return null;};}function patchUpdates(_0x373424){return function(_0x4513a0){try{jsonpatch[_0xb4db('0x23')](_0x4513a0,_0x373424,!![]);}catch(_0x3e0638){return BPromise[_0xb4db('0x24')](_0x3e0638);}return _0x4513a0['save']();};}function saveUpdates(_0x248318,_0x260a77){return function(_0x1897e9){if(_0x1897e9){return _0x1897e9[_0xb4db('0x25')](_0x248318)['then'](function(_0x35d3b3){return _0x35d3b3;});}return null;};}function removeEntity(_0x242376,_0x1b2040){return function(_0xafa87f){if(_0xafa87f){return _0xafa87f[_0xb4db('0x26')]()[_0xb4db('0x27')](function(){_0x242376[_0xb4db('0x1a')](0xcc)[_0xb4db('0x1b')]();});}};}function handleEntityNotFound(_0x57c3ea,_0x154910){return function(_0x177853){if(!_0x177853){_0x57c3ea[_0xb4db('0x28')](0x194);}return _0x177853;};}function handleError(_0x70eddf,_0x1f1d79){_0x1f1d79=_0x1f1d79||0x1f4;return function(_0x1685b3){logger[_0xb4db('0x29')](_0x1685b3['stack']);if(_0x1685b3[_0xb4db('0x2a')]){delete _0x1685b3[_0xb4db('0x2a')];}_0x70eddf[_0xb4db('0x1a')](_0x1f1d79)[_0xb4db('0x2b')](_0x1685b3);};}exports[_0xb4db('0x2c')]=function(_0x49a720,_0x35f6f3){var _0x3cdcec={},_0x10458a={},_0x21ec74={'count':0x0,'rows':[]};var _0x7e7c1b=_[_0xb4db('0x2d')](db[_0xb4db('0x2e')]['rawAttributes'],function(_0x25b67b){return{'name':_0x25b67b['fieldName'],'type':_0x25b67b[_0xb4db('0x2f')][_0xb4db('0x30')]};});_0x10458a[_0xb4db('0x31')]=_[_0xb4db('0x2d')](_0x7e7c1b,_0xb4db('0x2a'));_0x10458a['query']=_[_0xb4db('0x32')](_0x49a720['query']);_0x10458a['filters']=_[_0xb4db('0x33')](_0x10458a[_0xb4db('0x31')],_0x10458a[_0xb4db('0x34')]);_0x3cdcec['attributes']=_[_0xb4db('0x33')](_0x10458a[_0xb4db('0x31')],qs[_0xb4db('0x35')](_0x49a720[_0xb4db('0x34')][_0xb4db('0x35')]));_0x3cdcec[_0xb4db('0x36')]=_0x3cdcec[_0xb4db('0x36')]['length']?_0x3cdcec[_0xb4db('0x36')]:_0x10458a[_0xb4db('0x31')];if(!_0x49a720['query'][_0xb4db('0x37')](_0xb4db('0x38'))){_0x3cdcec[_0xb4db('0x1e')]=qs['limit'](_0x49a720[_0xb4db('0x34')][_0xb4db('0x1e')]);_0x3cdcec['offset']=qs[_0xb4db('0x1d')](_0x49a720[_0xb4db('0x34')]['offset']);}_0x3cdcec[_0xb4db('0x39')]=qs['sort'](_0x49a720[_0xb4db('0x34')][_0xb4db('0x3a')]);_0x3cdcec[_0xb4db('0x3b')]=qs[_0xb4db('0x3c')](_[_0xb4db('0x3d')](_0x49a720[_0xb4db('0x34')],_0x10458a[_0xb4db('0x3c')]),_0x7e7c1b);if(_0x49a720[_0xb4db('0x34')][_0xb4db('0x3e')]){_0x3cdcec['where']=_['merge'](_0x3cdcec[_0xb4db('0x3b')],{'$or':_[_0xb4db('0x2d')](_0x7e7c1b,function(_0x161362){if(_0x161362[_0xb4db('0x2f')]!==_0xb4db('0x3f')){var _0x6a647e={};_0x6a647e[_0x161362[_0xb4db('0x2a')]]={'$like':'%'+_0x49a720[_0xb4db('0x34')][_0xb4db('0x3e')]+'%'};return _0x6a647e;}})});}_0x3cdcec=_['merge']({},_0x3cdcec,_0x49a720[_0xb4db('0x40')]);var _0x3a45a9={'where':_0x3cdcec['where']};return db['SquareReport']['count'](_0x3a45a9)[_0xb4db('0x27')](function(_0x31673c){_0x21ec74['count']=_0x31673c;if(_0x49a720[_0xb4db('0x34')][_0xb4db('0x41')]){_0x3cdcec['include']=[{'all':!![]}];}return db['SquareReport'][_0xb4db('0x42')](_0x3cdcec);})[_0xb4db('0x27')](function(_0x3f1fb0){_0x21ec74[_0xb4db('0x43')]=_0x3f1fb0;return _0x21ec74;})['then'](respondWithFilteredResult(_0x35f6f3,_0x3cdcec))['catch'](handleError(_0x35f6f3,null));};exports[_0xb4db('0x44')]=function(_0x481c9b,_0x20fbe8){var _0x40963a={'raw':!![],'where':{'id':_0x481c9b['params']['id']}},_0x8285c8={};_0x8285c8[_0xb4db('0x31')]=_[_0xb4db('0x32')](db[_0xb4db('0x2e')][_0xb4db('0x45')]);_0x8285c8[_0xb4db('0x34')]=_[_0xb4db('0x32')](_0x481c9b['query']);_0x8285c8[_0xb4db('0x3c')]=_['intersection'](_0x8285c8[_0xb4db('0x31')],_0x8285c8['query']);_0x40963a[_0xb4db('0x36')]=_[_0xb4db('0x33')](_0x8285c8[_0xb4db('0x31')],qs[_0xb4db('0x35')](_0x481c9b[_0xb4db('0x34')]['fields']));_0x40963a['attributes']=_0x40963a['attributes'][_0xb4db('0x46')]?_0x40963a['attributes']:_0x8285c8['model'];if(_0x481c9b[_0xb4db('0x34')]['includeAll']){_0x40963a[_0xb4db('0x47')]=[{'all':!![]}];}_0x40963a=_[_0xb4db('0x48')]({},_0x40963a,_0x481c9b[_0xb4db('0x40')]);return db[_0xb4db('0x2e')][_0xb4db('0x49')](_0x40963a)[_0xb4db('0x27')](handleEntityNotFound(_0x20fbe8,null))[_0xb4db('0x27')](respondWithResult(_0x20fbe8,null))[_0xb4db('0x4a')](handleError(_0x20fbe8,null));};exports['create']=function(_0x1e0072,_0x10abbd){return db['SquareReport'][_0xb4db('0x4b')](_0x1e0072['body'],{})[_0xb4db('0x27')](respondWithResult(_0x10abbd,0xc9))[_0xb4db('0x4a')](handleError(_0x10abbd,null));};exports['update']=function(_0x3578b2,_0x4d9923){if(_0x3578b2[_0xb4db('0x4c')]['id']){delete _0x3578b2[_0xb4db('0x4c')]['id'];}return db[_0xb4db('0x2e')][_0xb4db('0x49')]({'where':{'id':_0x3578b2[_0xb4db('0x4d')]['id']}})[_0xb4db('0x27')](handleEntityNotFound(_0x4d9923,null))[_0xb4db('0x27')](saveUpdates(_0x3578b2['body'],null))['then'](respondWithResult(_0x4d9923,null))['catch'](handleError(_0x4d9923,null));};exports[_0xb4db('0x26')]=function(_0x4e5eb8,_0x1a8a53){return db['SquareReport'][_0xb4db('0x49')]({'where':{'id':_0x4e5eb8['params']['id']}})[_0xb4db('0x27')](handleEntityNotFound(_0x1a8a53,null))['then'](removeEntity(_0x1a8a53,null))[_0xb4db('0x4a')](handleError(_0x1a8a53,null));};exports[_0xb4db('0x4e')]=function(_0x3cd343,_0x38e9f6){return db[_0xb4db('0x2e')][_0xb4db('0x4e')]()['then'](respondWithResult(_0x38e9f6,null))[_0xb4db('0x4a')](handleError(_0x38e9f6,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 7dc0fbf..04dacc5 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 _0x9cf4=['SquareReport','report_square','uniqueid','project_name','leaveAt','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./squareReport.attributes','exports','define'];(function(_0x138d06,_0x33edf2){var _0x1a01eb=function(_0x387acb){while(--_0x387acb){_0x138d06['push'](_0x138d06['shift']());}};_0x1a01eb(++_0x33edf2);}(_0x9cf4,0x195));var _0x49cf=function(_0x261bf1,_0x1502a0){_0x261bf1=_0x261bf1-0x0;var _0x5de720=_0x9cf4[_0x261bf1];return _0x5de720;};'use strict';var _=require(_0x49cf('0x0'));var util=require(_0x49cf('0x1'));var logger=require(_0x49cf('0x2'))(_0x49cf('0x3'));var moment=require(_0x49cf('0x4'));var BPromise=require(_0x49cf('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x49cf('0x6'));var config=require(_0x49cf('0x7'));var attributes=require(_0x49cf('0x8'));module[_0x49cf('0x9')]=function(_0x2d3d8c,_0x2b61f){return _0x2d3d8c[_0x49cf('0xa')](_0x49cf('0xb'),attributes,{'tableName':_0x49cf('0xc'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':[_0x49cf('0xd'),_0x49cf('0xe')]},{'name':'leaveAt','fields':[_0x49cf('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x03e5=['leaveAt','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','uid_pname','project_name'];(function(_0xd241b4,_0x511bf0){var _0x596e6a=function(_0x2581e4){while(--_0x2581e4){_0xd241b4['push'](_0xd241b4['shift']());}};_0x596e6a(++_0x511bf0);}(_0x03e5,0x90));var _0x503e=function(_0x5bc4cb,_0x1545df){_0x5bc4cb=_0x5bc4cb-0x0;var _0x66a06e=_0x03e5[_0x5bc4cb];return _0x66a06e;};'use strict';var _=require('lodash');var util=require(_0x503e('0x0'));var logger=require('../../config/logger')(_0x503e('0x1'));var moment=require(_0x503e('0x2'));var BPromise=require(_0x503e('0x3'));var rp=require(_0x503e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x503e('0x5'));var config=require(_0x503e('0x6'));var attributes=require('./squareReport.attributes');module[_0x503e('0x7')]=function(_0x4bd5f8,_0x1df6cb){return _0x4bd5f8['define']('SquareReport',attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0x503e('0x8'),'fields':['uniqueid',_0x503e('0x9')]},{'name':'leaveAt','fields':[_0x503e('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 8c9c3d2..c6b06d1 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 _0x482c=['body','options','info','CreateSquareReport','UpdateSquareReport','update','raw','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','debug','request\x20sent','stringify','error','SquareReport,\x20%s,\x20%s','message','result','catch','SquareReport'];(function(_0x1bb59a,_0x169876){var _0x5e051b=function(_0x137f75){while(--_0x137f75){_0x1bb59a['push'](_0x1bb59a['shift']());}};_0x5e051b(++_0x169876);}(_0x482c,0x8e));var _0xc482=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x482c[_0xb0f7c3];return _0x28ea68;};'use strict';var _=require(_0xc482('0x0'));var util=require(_0xc482('0x1'));var moment=require(_0xc482('0x2'));var BPromise=require(_0xc482('0x3'));var rs=require(_0xc482('0x4'));var fs=require('fs');var Redis=require(_0xc482('0x5'));var db=require(_0xc482('0x6'))['db'];var utils=require(_0xc482('0x7'));var logger=require(_0xc482('0x8'))(_0xc482('0x9'));var config=require(_0xc482('0xa'));var jayson=require(_0xc482('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x17009f,_0x1d99d3,_0x28d906){return new BPromise(function(_0x363371,_0x10a0bf){return client[_0xc482('0xc')](_0x17009f,_0x28d906)[_0xc482('0xd')](function(_0x27bfbc){logger['info']('SquareReport,\x20%s,\x20%s',_0x1d99d3,'request\x20sent');logger[_0xc482('0xe')]('SquareReport,\x20%s,\x20%s,\x20%s',_0x1d99d3,_0xc482('0xf'),JSON[_0xc482('0x10')](_0x27bfbc));if(_0x27bfbc[_0xc482('0x11')]){if(_0x27bfbc['error']['code']===0x1f4){logger[_0xc482('0x11')](_0xc482('0x12'),_0x1d99d3,_0x27bfbc[_0xc482('0x11')][_0xc482('0x13')]);return _0x10a0bf(_0x27bfbc[_0xc482('0x11')][_0xc482('0x13')]);}logger[_0xc482('0x11')](_0xc482('0x12'),_0x1d99d3,_0x27bfbc['error'][_0xc482('0x13')]);return _0x363371(_0x27bfbc[_0xc482('0x11')][_0xc482('0x13')]);}else{logger['info'](_0xc482('0x12'),_0x1d99d3,_0xc482('0xf'));_0x363371(_0x27bfbc[_0xc482('0x14')][_0xc482('0x13')]);}})[_0xc482('0x15')](function(_0x341d8f){logger[_0xc482('0x11')](_0xc482('0x12'),_0x1d99d3,_0x341d8f);_0x10a0bf(_0x341d8f);});});}exports['CreateSquareReport']=function(_0x2127ee){var _0x46cf7c=this;return new Promise(function(_0x23423a,_0x2d7f2c){return db[_0xc482('0x16')]['create'](_0x2127ee[_0xc482('0x17')],{'raw':_0x2127ee['options']?_0x2127ee[_0xc482('0x18')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x563629){logger[_0xc482('0x19')](_0xc482('0x1a'),_0x2127ee);logger[_0xc482('0xe')](_0xc482('0x1a'),_0x2127ee,JSON[_0xc482('0x10')](_0x563629));_0x23423a(_0x563629);})[_0xc482('0x15')](function(_0x222dee){logger[_0xc482('0x11')](_0xc482('0x1a'),_0x222dee['message'],_0x2127ee);_0x2d7f2c(_0x46cf7c['error'](0x1f4,_0x222dee['message']));});});};exports[_0xc482('0x1b')]=function(_0x5a0080){var _0x5c9445=this;return new Promise(function(_0x3dee43,_0x1f6fe0){return db[_0xc482('0x16')][_0xc482('0x1c')](_0x5a0080[_0xc482('0x17')],{'raw':_0x5a0080[_0xc482('0x18')]?_0x5a0080['options'][_0xc482('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5a0080['options']?_0x5a0080[_0xc482('0x18')][_0xc482('0x1e')]||null:null,'attributes':_0x5a0080[_0xc482('0x18')]?_0x5a0080[_0xc482('0x18')][_0xc482('0x1f')]||null:null,'limit':_0x5a0080[_0xc482('0x18')]?_0x5a0080[_0xc482('0x18')][_0xc482('0x20')]||null:null})[_0xc482('0xd')](function(_0x3bc9af){logger[_0xc482('0x19')]('UpdateSquareReport',_0x5a0080);logger[_0xc482('0xe')]('UpdateSquareReport',_0x5a0080,JSON[_0xc482('0x10')](_0x3bc9af));_0x3dee43(_0x3bc9af);})[_0xc482('0x15')](function(_0x12e4cc){logger[_0xc482('0x11')](_0xc482('0x1b'),_0x12e4cc[_0xc482('0x13')],_0x5a0080);_0x1f6fe0(_0x5c9445['error'](0x1f4,_0x12e4cc[_0xc482('0x13')]));});});}; \ No newline at end of file +var _0xa1fa=['bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateSquareReport','SquareReport','create','body','options','then','UpdateSquareReport','update','raw','where','limit','lodash','util','moment'];(function(_0xce9195,_0x1963e1){var _0x530fe6=function(_0x1b8055){while(--_0x1b8055){_0xce9195['push'](_0xce9195['shift']());}};_0x530fe6(++_0x1963e1);}(_0xa1fa,0xed));var _0xaa1f=function(_0xd31938,_0x48a0ce){_0xd31938=_0xd31938-0x0;var _0x40bed8=_0xa1fa[_0xd31938];return _0x40bed8;};'use strict';var _=require(_0xaa1f('0x0'));var util=require(_0xaa1f('0x1'));var moment=require(_0xaa1f('0x2'));var BPromise=require(_0xaa1f('0x3'));var rs=require(_0xaa1f('0x4'));var fs=require('fs');var Redis=require(_0xaa1f('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xaa1f('0x6'))('rpc');var config=require(_0xaa1f('0x7'));var jayson=require(_0xaa1f('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5d8cb0,_0x33519d,_0x1de59e){return new BPromise(function(_0x2b8b53,_0x4f4ff9){return client['request'](_0x5d8cb0,_0x1de59e)['then'](function(_0x507eb9){logger[_0xaa1f('0x9')](_0xaa1f('0xa'),_0x33519d,_0xaa1f('0xb'));logger[_0xaa1f('0xc')](_0xaa1f('0xd'),_0x33519d,_0xaa1f('0xb'),JSON[_0xaa1f('0xe')](_0x507eb9));if(_0x507eb9[_0xaa1f('0xf')]){if(_0x507eb9['error'][_0xaa1f('0x10')]===0x1f4){logger[_0xaa1f('0xf')](_0xaa1f('0xa'),_0x33519d,_0x507eb9[_0xaa1f('0xf')]['message']);return _0x4f4ff9(_0x507eb9[_0xaa1f('0xf')]['message']);}logger[_0xaa1f('0xf')](_0xaa1f('0xa'),_0x33519d,_0x507eb9[_0xaa1f('0xf')][_0xaa1f('0x11')]);return _0x2b8b53(_0x507eb9[_0xaa1f('0xf')]['message']);}else{logger[_0xaa1f('0x9')](_0xaa1f('0xa'),_0x33519d,_0xaa1f('0xb'));_0x2b8b53(_0x507eb9[_0xaa1f('0x12')]['message']);}})['catch'](function(_0x21fd7a){logger['error'](_0xaa1f('0xa'),_0x33519d,_0x21fd7a);_0x4f4ff9(_0x21fd7a);});});}exports[_0xaa1f('0x13')]=function(_0x1aafa1){var _0xe4c444=this;return new Promise(function(_0x3843d2,_0x2f3e0f){return db[_0xaa1f('0x14')][_0xaa1f('0x15')](_0x1aafa1[_0xaa1f('0x16')],{'raw':_0x1aafa1[_0xaa1f('0x17')]?_0x1aafa1[_0xaa1f('0x17')]['raw']===undefined?!![]:![]:!![]})[_0xaa1f('0x18')](function(_0x3fc731){logger['info'](_0xaa1f('0x13'),_0x1aafa1);logger[_0xaa1f('0xc')](_0xaa1f('0x13'),_0x1aafa1,JSON[_0xaa1f('0xe')](_0x3fc731));_0x3843d2(_0x3fc731);})['catch'](function(_0xb59b01){logger[_0xaa1f('0xf')](_0xaa1f('0x13'),_0xb59b01[_0xaa1f('0x11')],_0x1aafa1);_0x2f3e0f(_0xe4c444[_0xaa1f('0xf')](0x1f4,_0xb59b01['message']));});});};exports[_0xaa1f('0x19')]=function(_0x3212d3){var _0x29e4a6=this;return new Promise(function(_0x35337b,_0x49f86d){return db[_0xaa1f('0x14')][_0xaa1f('0x1a')](_0x3212d3[_0xaa1f('0x16')],{'raw':_0x3212d3['options']?_0x3212d3[_0xaa1f('0x17')][_0xaa1f('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3212d3['options']?_0x3212d3[_0xaa1f('0x17')][_0xaa1f('0x1c')]||null:null,'attributes':_0x3212d3[_0xaa1f('0x17')]?_0x3212d3['options']['attributes']||null:null,'limit':_0x3212d3[_0xaa1f('0x17')]?_0x3212d3[_0xaa1f('0x17')][_0xaa1f('0x1d')]||null:null})[_0xaa1f('0x18')](function(_0x14b311){logger[_0xaa1f('0x9')](_0xaa1f('0x19'),_0x3212d3);logger['debug'](_0xaa1f('0x19'),_0x3212d3,JSON['stringify'](_0x14b311));_0x35337b(_0x14b311);})['catch'](function(_0x583a53){logger[_0xaa1f('0xf')]('UpdateSquareReport',_0x583a53[_0xaa1f('0x11')],_0x3212d3);_0x49f86d(_0x29e4a6[_0xaa1f('0xf')](0x1f4,_0x583a53[_0xaa1f('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 1c1c771..8ddc579 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 _0xa66e=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','create','delete','destroy','exports','multer','util'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xa66e,0x1ca));var _0xea66=function(_0x32cbcb,_0x24f783){_0x32cbcb=_0x32cbcb-0x0;var _0x34817b=_0xa66e[_0x32cbcb];return _0x34817b;};'use strict';var multer=require(_0xea66('0x0'));var util=require(_0xea66('0x1'));var path=require(_0xea66('0x2'));var timeout=require(_0xea66('0x3'));var express=require(_0xea66('0x4'));var router=express[_0xea66('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xea66('0x6'));var interaction=require(_0xea66('0x7'));var config=require(_0xea66('0x8'));var controller=require('./squareReportDetail.controller');router[_0xea66('0x9')]('/',auth[_0xea66('0xa')](),controller[_0xea66('0xb')]);router[_0xea66('0x9')](_0xea66('0xc'),auth[_0xea66('0xa')](),controller[_0xea66('0xd')]);router['get'](_0xea66('0xe'),auth[_0xea66('0xa')](),controller[_0xea66('0xf')]);router['post']('/',auth[_0xea66('0xa')](),controller[_0xea66('0x10')]);router['put'](_0xea66('0xe'),auth[_0xea66('0xa')](),controller['update']);router[_0xea66('0x11')](_0xea66('0xe'),auth['isAuthenticated'](),controller[_0xea66('0x12')]);module[_0xea66('0x13')]=router; \ No newline at end of file +var _0x3e0a=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./squareReportDetail.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','update','delete','destroy','util','path','connect-timeout'];(function(_0x254cdf,_0x43e605){var _0x4da778=function(_0x2e16e8){while(--_0x2e16e8){_0x254cdf['push'](_0x254cdf['shift']());}};_0x4da778(++_0x43e605);}(_0x3e0a,0x123));var _0xa3e0=function(_0x4a8bad,_0x4bfb2f){_0x4a8bad=_0x4a8bad-0x0;var _0x30cf32=_0x3e0a[_0x4a8bad];return _0x30cf32;};'use strict';var multer=require('multer');var util=require(_0xa3e0('0x0'));var path=require(_0xa3e0('0x1'));var timeout=require(_0xa3e0('0x2'));var express=require(_0xa3e0('0x3'));var router=express[_0xa3e0('0x4')]();var fs_extra=require(_0xa3e0('0x5'));var auth=require(_0xa3e0('0x6'));var interaction=require(_0xa3e0('0x7'));var config=require('../../config/environment');var controller=require(_0xa3e0('0x8'));router[_0xa3e0('0x9')]('/',auth[_0xa3e0('0xa')](),controller[_0xa3e0('0xb')]);router['get']('/describe',auth[_0xa3e0('0xa')](),controller[_0xa3e0('0xc')]);router['get'](_0xa3e0('0xd'),auth[_0xa3e0('0xa')](),controller[_0xa3e0('0xe')]);router[_0xa3e0('0xf')]('/',auth[_0xa3e0('0xa')](),controller[_0xa3e0('0x10')]);router[_0xa3e0('0x11')]('/:id',auth[_0xa3e0('0xa')](),controller[_0xa3e0('0x12')]);router[_0xa3e0('0x13')](_0xa3e0('0xd'),auth[_0xa3e0('0xa')](),controller[_0xa3e0('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 8ca9ca3..646270f 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 _0xd727=['TEXT','sequelize','exports','STRING'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xd727,0x13d));var _0x7d72=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd727[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x7d72('0x0'));module[_0x7d72('0x1')]={'uniqueid':{'type':Sequelize[_0x7d72('0x2')]},'node':{'type':Sequelize[_0x7d72('0x2')]},'application':{'type':Sequelize[_0x7d72('0x2')]},'data':{'type':Sequelize[_0x7d72('0x3')]},'project_name':{'type':Sequelize[_0x7d72('0x2')]},'callerid':{'type':Sequelize[_0x7d72('0x2')]}}; \ No newline at end of file +var _0x1c24=['sequelize','exports','STRING','TEXT'];(function(_0x22959f,_0x4dad09){var _0x5c4070=function(_0xdd7e51){while(--_0xdd7e51){_0x22959f['push'](_0x22959f['shift']());}};_0x5c4070(++_0x4dad09);}(_0x1c24,0x1ac));var _0x41c2=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x1c24[_0x122096];return _0x3d1966;};'use strict';var Sequelize=require(_0x41c2('0x0'));module[_0x41c2('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0x41c2('0x2')]},'application':{'type':Sequelize[_0x41c2('0x2')]},'data':{'type':Sequelize[_0x41c2('0x3')]},'project_name':{'type':Sequelize[_0x41c2('0x2')]},'callerid':{'type':Sequelize[_0x41c2('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 9160ec8..cd6d1c6 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 _0x684a=['include','findAll','catch','show','options','find','create','body','params','destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','save','update','then','stack','name','send','map','SquareDetailsReport','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','VIRTUAL','merge','count','includeAll'];(function(_0x1b2255,_0x3de34f){var _0x33e57d=function(_0x2f9cce){while(--_0x2f9cce){_0x1b2255['push'](_0x1b2255['shift']());}};_0x33e57d(++_0x3de34f);}(_0x684a,0x133));var _0xa684=function(_0x2e639a,_0x5745e7){_0x2e639a=_0x2e639a-0x0;var _0xad8aa5=_0x684a[_0x2e639a];return _0xad8aa5;};'use strict';var emlformat=require(_0xa684('0x0'));var rimraf=require(_0xa684('0x1'));var zipdir=require(_0xa684('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa684('0x3'));var moment=require(_0xa684('0x4'));var BPromise=require(_0xa684('0x5'));var Mustache=require(_0xa684('0x6'));var util=require(_0xa684('0x7'));var path=require(_0xa684('0x8'));var sox=require('sox');var csv=require(_0xa684('0x9'));var ejs=require(_0xa684('0xa'));var fs=require('fs');var fs_extra=require(_0xa684('0xb'));var _=require(_0xa684('0xc'));var squel=require('squel');var crypto=require(_0xa684('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa684('0x9'));var querystring=require(_0xa684('0xe'));var Papa=require('papaparse');var Redis=require(_0xa684('0xf'));var authService=require(_0xa684('0x10'));var qs=require(_0xa684('0x11'));var as=require(_0xa684('0x12'));var hardwareService=require(_0xa684('0x13'));var logger=require(_0xa684('0x14'))(_0xa684('0x15'));var utils=require(_0xa684('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa684('0x17'))['db'];function respondWithStatusCode(_0x48e19d,_0x16472a){_0x16472a=_0x16472a||0xcc;return function(_0xb8434c){if(_0xb8434c){return _0x48e19d[_0xa684('0x18')](_0x16472a);}return _0x48e19d[_0xa684('0x19')](_0x16472a)[_0xa684('0x1a')]();};}function respondWithResult(_0x2cec72,_0x30203c){_0x30203c=_0x30203c||0xc8;return function(_0x2f4b1c){if(_0x2f4b1c){return _0x2cec72[_0xa684('0x19')](_0x30203c)[_0xa684('0x1b')](_0x2f4b1c);}};}function respondWithFilteredResult(_0x241392,_0x64bbed){return function(_0x286256){if(_0x286256){var _0x3e90e1=typeof _0x64bbed[_0xa684('0x1c')]===_0xa684('0x1d')&&typeof _0x64bbed[_0xa684('0x1e')]===_0xa684('0x1d');var _0x290243=_0x286256['count'];var _0x11565c=_0x3e90e1?0x0:_0x64bbed[_0xa684('0x1c')];var _0x44c61c=_0x3e90e1?_0x286256['count']:_0x64bbed[_0xa684('0x1c')]+_0x64bbed['limit'];var _0x5b1483;if(_0x44c61c>=_0x290243){_0x44c61c=_0x290243;_0x5b1483=0xc8;}else{_0x5b1483=0xce;}_0x241392[_0xa684('0x19')](_0x5b1483);return _0x241392[_0xa684('0x1f')](_0xa684('0x20'),_0x11565c+'-'+_0x44c61c+'/'+_0x290243)[_0xa684('0x1b')](_0x286256);}return null;};}function patchUpdates(_0x727d4f){return function(_0x9515b6){try{jsonpatch[_0xa684('0x21')](_0x9515b6,_0x727d4f,!![]);}catch(_0x50b765){return BPromise['reject'](_0x50b765);}return _0x9515b6[_0xa684('0x22')]();};}function saveUpdates(_0x4e6f2e,_0x4bd0a5){return function(_0x29cf3d){if(_0x29cf3d){return _0x29cf3d[_0xa684('0x23')](_0x4e6f2e)[_0xa684('0x24')](function(_0x1b1c4b){return _0x1b1c4b;});}return null;};}function removeEntity(_0x28782c,_0x27e64b){return function(_0x1a028f){if(_0x1a028f){return _0x1a028f['destroy']()[_0xa684('0x24')](function(){_0x28782c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xf70cd6,_0x5020cc){return function(_0x549c68){if(!_0x549c68){_0xf70cd6[_0xa684('0x18')](0x194);}return _0x549c68;};}function handleError(_0x3db6d2,_0x26295e){_0x26295e=_0x26295e||0x1f4;return function(_0x2762ba){logger['error'](_0x2762ba[_0xa684('0x25')]);if(_0x2762ba[_0xa684('0x26')]){delete _0x2762ba[_0xa684('0x26')];}_0x3db6d2[_0xa684('0x19')](_0x26295e)[_0xa684('0x27')](_0x2762ba);};}exports['index']=function(_0x3ab1ae,_0x42d529){var _0x27bac5={},_0x4506a7={},_0x3ae1a0={'count':0x0,'rows':[]};var _0x35158a=_[_0xa684('0x28')](db[_0xa684('0x29')][_0xa684('0x2a')],function(_0x4e338e){return{'name':_0x4e338e['fieldName'],'type':_0x4e338e[_0xa684('0x2b')][_0xa684('0x2c')]};});_0x4506a7[_0xa684('0x2d')]=_[_0xa684('0x28')](_0x35158a,_0xa684('0x26'));_0x4506a7[_0xa684('0x2e')]=_[_0xa684('0x2f')](_0x3ab1ae['query']);_0x4506a7['filters']=_[_0xa684('0x30')](_0x4506a7[_0xa684('0x2d')],_0x4506a7[_0xa684('0x2e')]);_0x27bac5[_0xa684('0x31')]=_[_0xa684('0x30')](_0x4506a7[_0xa684('0x2d')],qs[_0xa684('0x32')](_0x3ab1ae[_0xa684('0x2e')][_0xa684('0x32')]));_0x27bac5[_0xa684('0x31')]=_0x27bac5['attributes'][_0xa684('0x33')]?_0x27bac5[_0xa684('0x31')]:_0x4506a7[_0xa684('0x2d')];if(!_0x3ab1ae['query'][_0xa684('0x34')](_0xa684('0x35'))){_0x27bac5[_0xa684('0x1e')]=qs[_0xa684('0x1e')](_0x3ab1ae[_0xa684('0x2e')]['limit']);_0x27bac5[_0xa684('0x1c')]=qs[_0xa684('0x1c')](_0x3ab1ae[_0xa684('0x2e')][_0xa684('0x1c')]);}_0x27bac5['order']=qs[_0xa684('0x36')](_0x3ab1ae[_0xa684('0x2e')][_0xa684('0x36')]);_0x27bac5[_0xa684('0x37')]=qs[_0xa684('0x38')](_[_0xa684('0x39')](_0x3ab1ae['query'],_0x4506a7['filters']),_0x35158a);if(_0x3ab1ae[_0xa684('0x2e')][_0xa684('0x3a')]){_0x27bac5[_0xa684('0x37')]=_['merge'](_0x27bac5['where'],{'$or':_[_0xa684('0x28')](_0x35158a,function(_0x61779c){if(_0x61779c[_0xa684('0x2b')]!==_0xa684('0x3b')){var _0x451863={};_0x451863[_0x61779c[_0xa684('0x26')]]={'$like':'%'+_0x3ab1ae['query'][_0xa684('0x3a')]+'%'};return _0x451863;}})});}_0x27bac5=_[_0xa684('0x3c')]({},_0x27bac5,_0x3ab1ae['options']);var _0x1d969e={'where':_0x27bac5['where']};return db[_0xa684('0x29')][_0xa684('0x3d')](_0x1d969e)['then'](function(_0x3f6a8f){_0x3ae1a0[_0xa684('0x3d')]=_0x3f6a8f;if(_0x3ab1ae[_0xa684('0x2e')][_0xa684('0x3e')]){_0x27bac5[_0xa684('0x3f')]=[{'all':!![]}];}return db[_0xa684('0x29')][_0xa684('0x40')](_0x27bac5);})[_0xa684('0x24')](function(_0x4b7b07){_0x3ae1a0['rows']=_0x4b7b07;return _0x3ae1a0;})[_0xa684('0x24')](respondWithFilteredResult(_0x42d529,_0x27bac5))[_0xa684('0x41')](handleError(_0x42d529,null));};exports[_0xa684('0x42')]=function(_0x4cbec3,_0x3e07f4){var _0x38bf97={'raw':!![],'where':{'id':_0x4cbec3['params']['id']}},_0xa1c84e={};_0xa1c84e['model']=_[_0xa684('0x2f')](db['SquareDetailsReport'][_0xa684('0x2a')]);_0xa1c84e[_0xa684('0x2e')]=_['keys'](_0x4cbec3['query']);_0xa1c84e[_0xa684('0x38')]=_[_0xa684('0x30')](_0xa1c84e[_0xa684('0x2d')],_0xa1c84e[_0xa684('0x2e')]);_0x38bf97[_0xa684('0x31')]=_[_0xa684('0x30')](_0xa1c84e[_0xa684('0x2d')],qs[_0xa684('0x32')](_0x4cbec3[_0xa684('0x2e')][_0xa684('0x32')]));_0x38bf97[_0xa684('0x31')]=_0x38bf97[_0xa684('0x31')][_0xa684('0x33')]?_0x38bf97[_0xa684('0x31')]:_0xa1c84e[_0xa684('0x2d')];if(_0x4cbec3[_0xa684('0x2e')][_0xa684('0x3e')]){_0x38bf97['include']=[{'all':!![]}];}_0x38bf97=_[_0xa684('0x3c')]({},_0x38bf97,_0x4cbec3[_0xa684('0x43')]);return db[_0xa684('0x29')][_0xa684('0x44')](_0x38bf97)[_0xa684('0x24')](handleEntityNotFound(_0x3e07f4,null))[_0xa684('0x24')](respondWithResult(_0x3e07f4,null))[_0xa684('0x41')](handleError(_0x3e07f4,null));};exports[_0xa684('0x45')]=function(_0x84e734,_0x14af69){return db[_0xa684('0x29')]['create'](_0x84e734[_0xa684('0x46')],{})[_0xa684('0x24')](respondWithResult(_0x14af69,0xc9))['catch'](handleError(_0x14af69,null));};exports[_0xa684('0x23')]=function(_0x4d5b1d,_0x55d7e7){if(_0x4d5b1d[_0xa684('0x46')]['id']){delete _0x4d5b1d[_0xa684('0x46')]['id'];}return db[_0xa684('0x29')]['find']({'where':{'id':_0x4d5b1d[_0xa684('0x47')]['id']}})['then'](handleEntityNotFound(_0x55d7e7,null))[_0xa684('0x24')](saveUpdates(_0x4d5b1d['body'],null))[_0xa684('0x24')](respondWithResult(_0x55d7e7,null))[_0xa684('0x41')](handleError(_0x55d7e7,null));};exports[_0xa684('0x48')]=function(_0xa6d376,_0x26ec2e){return db['SquareDetailsReport'][_0xa684('0x44')]({'where':{'id':_0xa6d376[_0xa684('0x47')]['id']}})[_0xa684('0x24')](handleEntityNotFound(_0x26ec2e,null))[_0xa684('0x24')](removeEntity(_0x26ec2e,null))[_0xa684('0x41')](handleError(_0x26ec2e,null));};exports[_0xa684('0x49')]=function(_0x2e4b72,_0x370acc){return db[_0xa684('0x29')]['describe']()[_0xa684('0x24')](respondWithResult(_0x370acc,null))[_0xa684('0x41')](handleError(_0x370acc,null));}; \ No newline at end of file +var _0x91e1=['name','send','index','map','SquareDetailsReport','type','keys','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','findAll','catch','show','params','rawAttributes','includeAll','include','find','create','body','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','querystring','papaparse','../../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','reject','save','update','then','end','error','stack'];(function(_0x5625e4,_0x211bb2){var _0x16b519=function(_0x5dcf93){while(--_0x5dcf93){_0x5625e4['push'](_0x5625e4['shift']());}};_0x16b519(++_0x211bb2);}(_0x91e1,0xfe));var _0x191e=function(_0xda92bd,_0x4dd451){_0xda92bd=_0xda92bd-0x0;var _0x253efe=_0x91e1[_0xda92bd];return _0x253efe;};'use strict';var emlformat=require(_0x191e('0x0'));var rimraf=require(_0x191e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x191e('0x2'));var rp=require(_0x191e('0x3'));var moment=require(_0x191e('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x191e('0x5'));var sox=require(_0x191e('0x6'));var csv=require(_0x191e('0x7'));var ejs=require(_0x191e('0x8'));var fs=require('fs');var fs_extra=require(_0x191e('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x191e('0x7'));var querystring=require(_0x191e('0xa'));var Papa=require(_0x191e('0xb'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x191e('0xc'));var as=require(_0x191e('0xd'));var hardwareService=require(_0x191e('0xe'));var logger=require(_0x191e('0xf'))(_0x191e('0x10'));var utils=require(_0x191e('0x11'));var config=require(_0x191e('0x12'));var licenseUtil=require(_0x191e('0x13'));var db=require(_0x191e('0x14'))['db'];function respondWithStatusCode(_0xbb454e,_0x1a062e){_0x1a062e=_0x1a062e||0xcc;return function(_0x3a7305){if(_0x3a7305){return _0xbb454e[_0x191e('0x15')](_0x1a062e);}return _0xbb454e[_0x191e('0x16')](_0x1a062e)['end']();};}function respondWithResult(_0xbf5505,_0x2e2999){_0x2e2999=_0x2e2999||0xc8;return function(_0x49bdd8){if(_0x49bdd8){return _0xbf5505[_0x191e('0x16')](_0x2e2999)[_0x191e('0x17')](_0x49bdd8);}};}function respondWithFilteredResult(_0x463743,_0x3f78b4){return function(_0x483bf6){if(_0x483bf6){var _0x71f49a=typeof _0x3f78b4['offset']===_0x191e('0x18')&&typeof _0x3f78b4[_0x191e('0x19')]===_0x191e('0x18');var _0x1ecc96=_0x483bf6[_0x191e('0x1a')];var _0x4b2ab7=_0x71f49a?0x0:_0x3f78b4[_0x191e('0x1b')];var _0x2c17f0=_0x71f49a?_0x483bf6[_0x191e('0x1a')]:_0x3f78b4[_0x191e('0x1b')]+_0x3f78b4['limit'];var _0x58a0eb;if(_0x2c17f0>=_0x1ecc96){_0x2c17f0=_0x1ecc96;_0x58a0eb=0xc8;}else{_0x58a0eb=0xce;}_0x463743[_0x191e('0x16')](_0x58a0eb);return _0x463743[_0x191e('0x1c')](_0x191e('0x1d'),_0x4b2ab7+'-'+_0x2c17f0+'/'+_0x1ecc96)[_0x191e('0x17')](_0x483bf6);}return null;};}function patchUpdates(_0x376e39){return function(_0x53dfe7){try{jsonpatch[_0x191e('0x1e')](_0x53dfe7,_0x376e39,!![]);}catch(_0x5d9fbc){return BPromise[_0x191e('0x1f')](_0x5d9fbc);}return _0x53dfe7[_0x191e('0x20')]();};}function saveUpdates(_0x45cb2e,_0x3ffbdd){return function(_0x4e74b6){if(_0x4e74b6){return _0x4e74b6[_0x191e('0x21')](_0x45cb2e)[_0x191e('0x22')](function(_0x2629b3){return _0x2629b3;});}return null;};}function removeEntity(_0x310118,_0x5294c7){return function(_0x102255){if(_0x102255){return _0x102255['destroy']()[_0x191e('0x22')](function(){_0x310118['status'](0xcc)[_0x191e('0x23')]();});}};}function handleEntityNotFound(_0x5d3be6,_0x54a51c){return function(_0x13b465){if(!_0x13b465){_0x5d3be6['sendStatus'](0x194);}return _0x13b465;};}function handleError(_0x4ef0e4,_0xfa4ef2){_0xfa4ef2=_0xfa4ef2||0x1f4;return function(_0x2aec02){logger[_0x191e('0x24')](_0x2aec02[_0x191e('0x25')]);if(_0x2aec02[_0x191e('0x26')]){delete _0x2aec02['name'];}_0x4ef0e4[_0x191e('0x16')](_0xfa4ef2)[_0x191e('0x27')](_0x2aec02);};}exports[_0x191e('0x28')]=function(_0x4aa6a1,_0x5caace){var _0x519f5c={},_0x4c8245={},_0x3ab404={'count':0x0,'rows':[]};var _0x47c77b=_[_0x191e('0x29')](db[_0x191e('0x2a')]['rawAttributes'],function(_0x295dc3){return{'name':_0x295dc3['fieldName'],'type':_0x295dc3[_0x191e('0x2b')]['key']};});_0x4c8245['model']=_[_0x191e('0x29')](_0x47c77b,_0x191e('0x26'));_0x4c8245['query']=_[_0x191e('0x2c')](_0x4aa6a1[_0x191e('0x2d')]);_0x4c8245[_0x191e('0x2e')]=_[_0x191e('0x2f')](_0x4c8245[_0x191e('0x30')],_0x4c8245[_0x191e('0x2d')]);_0x519f5c[_0x191e('0x31')]=_[_0x191e('0x2f')](_0x4c8245[_0x191e('0x30')],qs['fields'](_0x4aa6a1['query'][_0x191e('0x32')]));_0x519f5c[_0x191e('0x31')]=_0x519f5c[_0x191e('0x31')][_0x191e('0x33')]?_0x519f5c[_0x191e('0x31')]:_0x4c8245[_0x191e('0x30')];if(!_0x4aa6a1[_0x191e('0x2d')]['hasOwnProperty'](_0x191e('0x34'))){_0x519f5c[_0x191e('0x19')]=qs[_0x191e('0x19')](_0x4aa6a1[_0x191e('0x2d')]['limit']);_0x519f5c[_0x191e('0x1b')]=qs[_0x191e('0x1b')](_0x4aa6a1[_0x191e('0x2d')]['offset']);}_0x519f5c[_0x191e('0x35')]=qs[_0x191e('0x36')](_0x4aa6a1[_0x191e('0x2d')]['sort']);_0x519f5c['where']=qs[_0x191e('0x2e')](_[_0x191e('0x37')](_0x4aa6a1['query'],_0x4c8245['filters']),_0x47c77b);if(_0x4aa6a1[_0x191e('0x2d')][_0x191e('0x38')]){_0x519f5c[_0x191e('0x39')]=_[_0x191e('0x3a')](_0x519f5c[_0x191e('0x39')],{'$or':_[_0x191e('0x29')](_0x47c77b,function(_0x1c1e93){if(_0x1c1e93[_0x191e('0x2b')]!==_0x191e('0x3b')){var _0x41dba4={};_0x41dba4[_0x1c1e93[_0x191e('0x26')]]={'$like':'%'+_0x4aa6a1['query']['filter']+'%'};return _0x41dba4;}})});}_0x519f5c=_[_0x191e('0x3a')]({},_0x519f5c,_0x4aa6a1[_0x191e('0x3c')]);var _0x5d70a7={'where':_0x519f5c[_0x191e('0x39')]};return db[_0x191e('0x2a')][_0x191e('0x1a')](_0x5d70a7)['then'](function(_0x123b54){_0x3ab404[_0x191e('0x1a')]=_0x123b54;if(_0x4aa6a1[_0x191e('0x2d')]['includeAll']){_0x519f5c['include']=[{'all':!![]}];}return db[_0x191e('0x2a')][_0x191e('0x3d')](_0x519f5c);})['then'](function(_0x5269c4){_0x3ab404['rows']=_0x5269c4;return _0x3ab404;})['then'](respondWithFilteredResult(_0x5caace,_0x519f5c))[_0x191e('0x3e')](handleError(_0x5caace,null));};exports[_0x191e('0x3f')]=function(_0x3bb61f,_0x5e9e40){var _0x5f3aba={'raw':!![],'where':{'id':_0x3bb61f[_0x191e('0x40')]['id']}},_0x4c0820={};_0x4c0820[_0x191e('0x30')]=_[_0x191e('0x2c')](db['SquareDetailsReport'][_0x191e('0x41')]);_0x4c0820['query']=_[_0x191e('0x2c')](_0x3bb61f[_0x191e('0x2d')]);_0x4c0820[_0x191e('0x2e')]=_['intersection'](_0x4c0820[_0x191e('0x30')],_0x4c0820['query']);_0x5f3aba[_0x191e('0x31')]=_[_0x191e('0x2f')](_0x4c0820['model'],qs[_0x191e('0x32')](_0x3bb61f['query']['fields']));_0x5f3aba[_0x191e('0x31')]=_0x5f3aba[_0x191e('0x31')]['length']?_0x5f3aba[_0x191e('0x31')]:_0x4c0820['model'];if(_0x3bb61f[_0x191e('0x2d')][_0x191e('0x42')]){_0x5f3aba[_0x191e('0x43')]=[{'all':!![]}];}_0x5f3aba=_[_0x191e('0x3a')]({},_0x5f3aba,_0x3bb61f[_0x191e('0x3c')]);return db[_0x191e('0x2a')][_0x191e('0x44')](_0x5f3aba)[_0x191e('0x22')](handleEntityNotFound(_0x5e9e40,null))[_0x191e('0x22')](respondWithResult(_0x5e9e40,null))[_0x191e('0x3e')](handleError(_0x5e9e40,null));};exports['create']=function(_0x413ab1,_0x367fbe){return db[_0x191e('0x2a')][_0x191e('0x45')](_0x413ab1[_0x191e('0x46')],{})[_0x191e('0x22')](respondWithResult(_0x367fbe,0xc9))[_0x191e('0x3e')](handleError(_0x367fbe,null));};exports[_0x191e('0x21')]=function(_0x593c49,_0x383068){if(_0x593c49[_0x191e('0x46')]['id']){delete _0x593c49[_0x191e('0x46')]['id'];}return db[_0x191e('0x2a')][_0x191e('0x44')]({'where':{'id':_0x593c49[_0x191e('0x40')]['id']}})[_0x191e('0x22')](handleEntityNotFound(_0x383068,null))[_0x191e('0x22')](saveUpdates(_0x593c49[_0x191e('0x46')],null))['then'](respondWithResult(_0x383068,null))[_0x191e('0x3e')](handleError(_0x383068,null));};exports[_0x191e('0x47')]=function(_0x4452a5,_0x218b9a){return db[_0x191e('0x2a')][_0x191e('0x44')]({'where':{'id':_0x4452a5[_0x191e('0x40')]['id']}})[_0x191e('0x22')](handleEntityNotFound(_0x218b9a,null))[_0x191e('0x22')](removeEntity(_0x218b9a,null))[_0x191e('0x3e')](handleError(_0x218b9a,null));};exports[_0x191e('0x48')]=function(_0x1f1189,_0x7d0921){return db[_0x191e('0x2a')][_0x191e('0x48')]()[_0x191e('0x22')](respondWithResult(_0x7d0921,null))['catch'](handleError(_0x7d0921,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 9a17a61..fb9609d 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 _0x4f32=['SquareDetailsReport','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x24c23d,_0x35e3ef){var _0x14f083=function(_0xff0a2f){while(--_0xff0a2f){_0x24c23d['push'](_0x24c23d['shift']());}};_0x14f083(++_0x35e3ef);}(_0x4f32,0xb1));var _0x24f3=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x4f32[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0x24f3('0x0'));var util=require(_0x24f3('0x1'));var logger=require(_0x24f3('0x2'))(_0x24f3('0x3'));var moment=require(_0x24f3('0x4'));var BPromise=require(_0x24f3('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x24f3('0x6'));var rimraf=require(_0x24f3('0x7'));var config=require(_0x24f3('0x8'));var attributes=require('./squareReportDetail.attributes');module[_0x24f3('0x9')]=function(_0x311304,_0x1fe7dc){return _0x311304['define'](_0x24f3('0xa'),attributes,{'tableName':'report_square_details','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfcb5=['api','moment','bluebird','request-promise','path','exports','define','report_square_details','util','../../config/logger'];(function(_0x4e0a03,_0x5eb6b0){var _0x2478fc=function(_0x59afcc){while(--_0x59afcc){_0x4e0a03['push'](_0x4e0a03['shift']());}};_0x2478fc(++_0x5eb6b0);}(_0xfcb5,0x1a2));var _0x5fcb=function(_0x57c50c,_0x72065c){_0x57c50c=_0x57c50c-0x0;var _0x1423d9=_0xfcb5[_0x57c50c];return _0x1423d9;};'use strict';var _=require('lodash');var util=require(_0x5fcb('0x0'));var logger=require(_0x5fcb('0x1'))(_0x5fcb('0x2'));var moment=require(_0x5fcb('0x3'));var BPromise=require(_0x5fcb('0x4'));var rp=require(_0x5fcb('0x5'));var fs=require('fs');var path=require(_0x5fcb('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./squareReportDetail.attributes');module[_0x5fcb('0x7')]=function(_0x29877f,_0x822996){return _0x29877f[_0x5fcb('0x8')]('SquareDetailsReport',attributes,{'tableName':_0x5fcb('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.rpc.js b/server/api/squareReportDetail/squareReportDetail.rpc.js index 6f40055..fd5a7b3 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 _0x32b6=['request','then','debug','request\x20sent','stringify','error','code','SquareDetailsReport,\x20%s,\x20%s','message','info','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','catch','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x32b6,0x1d1));var _0x632b=function(_0x58f2b1,_0x1c68cf){_0x58f2b1=_0x58f2b1-0x0;var _0x270937=_0x32b6[_0x58f2b1];return _0x270937;};'use strict';var _=require(_0x632b('0x0'));var util=require(_0x632b('0x1'));var moment=require('moment');var BPromise=require(_0x632b('0x2'));var rs=require(_0x632b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x632b('0x4'));var logger=require(_0x632b('0x5'))(_0x632b('0x6'));var config=require(_0x632b('0x7'));var jayson=require(_0x632b('0x8'));var client=jayson[_0x632b('0x9')][_0x632b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x10458a,_0x3bbf43,_0x43d6c7){return new BPromise(function(_0x5128f5,_0x33d711){return client[_0x632b('0xb')](_0x10458a,_0x43d6c7)[_0x632b('0xc')](function(_0x174201){logger['info']('SquareDetailsReport,\x20%s,\x20%s',_0x3bbf43,'request\x20sent');logger[_0x632b('0xd')]('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x3bbf43,_0x632b('0xe'),JSON[_0x632b('0xf')](_0x174201));if(_0x174201[_0x632b('0x10')]){if(_0x174201[_0x632b('0x10')][_0x632b('0x11')]===0x1f4){logger[_0x632b('0x10')](_0x632b('0x12'),_0x3bbf43,_0x174201[_0x632b('0x10')][_0x632b('0x13')]);return _0x33d711(_0x174201['error'][_0x632b('0x13')]);}logger[_0x632b('0x10')](_0x632b('0x12'),_0x3bbf43,_0x174201['error'][_0x632b('0x13')]);return _0x5128f5(_0x174201[_0x632b('0x10')][_0x632b('0x13')]);}else{logger[_0x632b('0x14')](_0x632b('0x12'),_0x3bbf43,_0x632b('0xe'));_0x5128f5(_0x174201['result'][_0x632b('0x13')]);}})['catch'](function(_0x4fdef2){logger[_0x632b('0x10')]('SquareDetailsReport,\x20%s,\x20%s',_0x3bbf43,_0x4fdef2);_0x33d711(_0x4fdef2);});});}exports[_0x632b('0x15')]=function(_0x3bb27f){var _0x28c472=this;return new Promise(function(_0x51c894,_0x2f3e88){return db[_0x632b('0x16')][_0x632b('0x17')](_0x3bb27f[_0x632b('0x18')],{'raw':_0x3bb27f['options']?_0x3bb27f[_0x632b('0x19')][_0x632b('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x116f62){logger['info']('CreateSquareDetailsReport',_0x3bb27f);logger[_0x632b('0xd')]('CreateSquareDetailsReport',_0x3bb27f,JSON[_0x632b('0xf')](_0x116f62));_0x51c894(_0x116f62);})[_0x632b('0x1b')](function(_0x2a6833){logger['error'](_0x632b('0x15'),_0x2a6833[_0x632b('0x13')],_0x3bb27f);_0x2f3e88(_0x28c472['error'](0x1f4,_0x2a6833[_0x632b('0x13')]));});});}; \ No newline at end of file +var _0x0490=['options','catch','util','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateSquareDetailsReport','SquareDetailsReport','create'];(function(_0x296144,_0x26bbbf){var _0x5329b1=function(_0x5d321b){while(--_0x5d321b){_0x296144['push'](_0x296144['shift']());}};_0x5329b1(++_0x26bbbf);}(_0x0490,0x147));var _0x0049=function(_0x1fcb65,_0x5daac8){_0x1fcb65=_0x1fcb65-0x0;var _0x23358d=_0x0490[_0x1fcb65];return _0x23358d;};'use strict';var _=require('lodash');var util=require(_0x0049('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0049('0x1'))['db'];var utils=require(_0x0049('0x2'));var logger=require(_0x0049('0x3'))(_0x0049('0x4'));var config=require(_0x0049('0x5'));var jayson=require(_0x0049('0x6'));var client=jayson[_0x0049('0x7')][_0x0049('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x28c8d2,_0x57fca5,_0x18bff7){return new BPromise(function(_0xe091c4,_0x154219){return client['request'](_0x28c8d2,_0x18bff7)[_0x0049('0x9')](function(_0x3f2ca1){logger[_0x0049('0xa')](_0x0049('0xb'),_0x57fca5,_0x0049('0xc'));logger[_0x0049('0xd')](_0x0049('0xe'),_0x57fca5,_0x0049('0xc'),JSON[_0x0049('0xf')](_0x3f2ca1));if(_0x3f2ca1['error']){if(_0x3f2ca1[_0x0049('0x10')][_0x0049('0x11')]===0x1f4){logger[_0x0049('0x10')]('SquareDetailsReport,\x20%s,\x20%s',_0x57fca5,_0x3f2ca1['error'][_0x0049('0x12')]);return _0x154219(_0x3f2ca1[_0x0049('0x10')][_0x0049('0x12')]);}logger[_0x0049('0x10')](_0x0049('0xb'),_0x57fca5,_0x3f2ca1['error'][_0x0049('0x12')]);return _0xe091c4(_0x3f2ca1[_0x0049('0x10')]['message']);}else{logger[_0x0049('0xa')](_0x0049('0xb'),_0x57fca5,_0x0049('0xc'));_0xe091c4(_0x3f2ca1[_0x0049('0x13')]['message']);}})['catch'](function(_0x4315b5){logger[_0x0049('0x10')](_0x0049('0xb'),_0x57fca5,_0x4315b5);_0x154219(_0x4315b5);});});}exports[_0x0049('0x14')]=function(_0x102b40){var _0x4592ad=this;return new Promise(function(_0x191a20,_0x21691){return db[_0x0049('0x15')][_0x0049('0x16')](_0x102b40['body'],{'raw':_0x102b40[_0x0049('0x17')]?_0x102b40[_0x0049('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x0049('0x9')](function(_0x4624ff){logger[_0x0049('0xa')](_0x0049('0x14'),_0x102b40);logger[_0x0049('0xd')]('CreateSquareDetailsReport',_0x102b40,JSON[_0x0049('0xf')](_0x4624ff));_0x191a20(_0x4624ff);})[_0x0049('0x18')](function(_0x49c00b){logger[_0x0049('0x10')](_0x0049('0x14'),_0x49c00b[_0x0049('0x12')],_0x102b40);_0x21691(_0x4592ad[_0x0049('0x10')](0x1f4,_0x49c00b[_0x0049('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 3428859..4e5b700 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 _0x3679=['isAuthenticated','index','/process/:pid/kill','killProcess','exports','express','Router','../../components/auth/service'];(function(_0x208dd3,_0x1499a9){var _0x3bb966=function(_0xfddc27){while(--_0xfddc27){_0x208dd3['push'](_0x208dd3['shift']());}};_0x3bb966(++_0x1499a9);}(_0x3679,0x12d));var _0x9367=function(_0x5eee2d,_0x580e31){_0x5eee2d=_0x5eee2d-0x0;var _0x157ccf=_0x3679[_0x5eee2d];return _0x157ccf;};'use strict';var express=require(_0x9367('0x0'));var router=express[_0x9367('0x1')]();var auth=require(_0x9367('0x2'));var controller=require('./system.controller');router['get']('/',auth[_0x9367('0x3')](),controller[_0x9367('0x4')]);router['get'](_0x9367('0x5'),auth[_0x9367('0x3')](),controller[_0x9367('0x6')]);module[_0x9367('0x7')]=router; \ No newline at end of file +var _0xf7df=['exports','express','Router','../../components/auth/service','./system.controller','get','index','/process/:pid/kill','killProcess'];(function(_0x5cade0,_0x5e5eef){var _0x10d5ff=function(_0x1d0f8f){while(--_0x1d0f8f){_0x5cade0['push'](_0x5cade0['shift']());}};_0x10d5ff(++_0x5e5eef);}(_0xf7df,0x1f0));var _0xff7d=function(_0x1a3ac3,_0x736ab1){_0x1a3ac3=_0x1a3ac3-0x0;var _0x37d182=_0xf7df[_0x1a3ac3];return _0x37d182;};'use strict';var express=require(_0xff7d('0x0'));var router=express[_0xff7d('0x1')]();var auth=require(_0xff7d('0x2'));var controller=require(_0xff7d('0x3'));router[_0xff7d('0x4')]('/',auth['isAuthenticated'](),controller[_0xff7d('0x5')]);router[_0xff7d('0x4')](_0xff7d('0x6'),auth['isAuthenticated'](),controller[_0xff7d('0x7')]);module[_0xff7d('0x8')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 6031845..0e4d560 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 _0x5160=['catch','killProcess','components/import/cm','params','split','length','indexOf','format','pid','kill','json','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','exec','../../config/logger','api','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','status','send','index','getAllData','then'];(function(_0x2801e8,_0x401535){var _0x2d676e=function(_0x969b05){while(--_0x969b05){_0x2801e8['push'](_0x2801e8['shift']());}};_0x2d676e(++_0x401535);}(_0x5160,0x194));var _0x0516=function(_0xed1912,_0x79a282){_0xed1912=_0xed1912-0x0;var _0x5526d8=_0x5160[_0xed1912];return _0x5526d8;};'use strict';var info=require(_0x0516('0x0'));var exec=require(_0x0516('0x1'))[_0x0516('0x2')];var logger=require(_0x0516('0x3'))(_0x0516('0x4'));var util=require(_0x0516('0x5'));var BPromise=require(_0x0516('0x6'));var _=require(_0x0516('0x7'));function handleError(_0x2e83d6,_0x2fffce,_0x482e88){_0x2fffce=_0x2fffce||0x1f4;return function(_0x1b50d9){logger[_0x0516('0x8')](_0x0516('0x9'),_0x482e88,_0x2fffce,util[_0x0516('0xa')](_0x1b50d9,{'showHidden':![],'depth':null}));delete _0x1b50d9['name'];_0x2e83d6[_0x0516('0xb')](_0x2fffce)[_0x0516('0xc')](_0x1b50d9);};}exports[_0x0516('0xd')]=function(_0x28dda4,_0x56cee4){return info[_0x0516('0xe')]()[_0x0516('0xf')](function(_0x2bc27e){return _0x56cee4[_0x0516('0xb')](0xc8)['json'](_0x2bc27e);})[_0x0516('0x10')](function(_0x487e04){return _0x56cee4[_0x0516('0xb')](0x1f4)['json'](_0x487e04);});};exports[_0x0516('0x11')]=function(_0x268f58,_0x26706c){var _0x1144ae=[_0x0516('0x12')];return new BPromise(function(_0x2c8e38,_0x458d17){return exec(util['format']('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x268f58[_0x0516('0x13')]['pid']),function(_0x19bdf8,_0x1a91c1,_0x1b5ee3){if(_0x19bdf8){return _0x458d17(_0x19bdf8);}return _0x2c8e38(_0x1a91c1);});})[_0x0516('0xf')](function(_0x816512){var _0x43eeae=![];var _0x41067d=_0x816512[_0x0516('0x14')](/\n/);for(var _0x988d60=0x0,_0x9181ac=_0x1144ae[_0x0516('0x15')];_0x988d60<_0x9181ac,_0x43eeae===![];_0x988d60+=0x1){if(_0x816512[_0x0516('0x16')](_0x1144ae[_0x988d60])>=0x0){_0x43eeae=!![];}}if(!_0x43eeae){throw new Error(util[_0x0516('0x17')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x268f58[_0x0516('0x13')][_0x0516('0x18')]));}process[_0x0516('0x19')](_0x268f58['params'][_0x0516('0x18')],'SIGINT');return _0x26706c[_0x0516('0xb')](0xc8)[_0x0516('0x1a')]({'message':util['format'](_0x0516('0x1b'),_0x268f58['params']['pid'])});})['catch'](handleError(_0x26706c,null,'killProcess'));}; \ No newline at end of file +var _0x32e0=['killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','pid','split','length','Process\x20with\x20pid\x20%s\x20not\x20found!','params','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','catch','systeminformation','exec','../../config/logger','api','bluebird','lodash','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','status','then','json'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x32e0,0x145));var _0x032e=function(_0x4884a7,_0x18e38a){_0x4884a7=_0x4884a7-0x0;var _0x56b60e=_0x32e0[_0x4884a7];return _0x56b60e;};'use strict';var info=require(_0x032e('0x0'));var exec=require('child_process')[_0x032e('0x1')];var logger=require(_0x032e('0x2'))(_0x032e('0x3'));var util=require('util');var BPromise=require(_0x032e('0x4'));var _=require(_0x032e('0x5'));function handleError(_0x4aad94,_0x65668a,_0x985a1f){_0x65668a=_0x65668a||0x1f4;return function(_0x8657ec){logger['error'](_0x032e('0x6'),_0x985a1f,_0x65668a,util[_0x032e('0x7')](_0x8657ec,{'showHidden':![],'depth':null}));delete _0x8657ec['name'];_0x4aad94[_0x032e('0x8')](_0x65668a)['send'](_0x8657ec);};}exports['index']=function(_0x4acee0,_0xda725){return info['getAllData']()[_0x032e('0x9')](function(_0x332048){return _0xda725[_0x032e('0x8')](0xc8)[_0x032e('0xa')](_0x332048);})['catch'](function(_0x1be6ba){return _0xda725['status'](0x1f4)[_0x032e('0xa')](_0x1be6ba);});};exports[_0x032e('0xb')]=function(_0x59b2be,_0x356351){var _0x1df58a=[_0x032e('0xc')];return new BPromise(function(_0x52f41b,_0x24dcc0){return exec(util[_0x032e('0xd')](_0x032e('0xe'),_0x59b2be['params'][_0x032e('0xf')]),function(_0x4208b0,_0x25159e,_0x3d19a3){if(_0x4208b0){return _0x24dcc0(_0x4208b0);}return _0x52f41b(_0x25159e);});})[_0x032e('0x9')](function(_0x2344d4){var _0x44f7ee=![];var _0x521527=_0x2344d4[_0x032e('0x10')](/\n/);for(var _0x4f3c53=0x0,_0xeb0068=_0x1df58a[_0x032e('0x11')];_0x4f3c53<_0xeb0068,_0x44f7ee===![];_0x4f3c53+=0x1){if(_0x2344d4['indexOf'](_0x1df58a[_0x4f3c53])>=0x0){_0x44f7ee=!![];}}if(!_0x44f7ee){throw new Error(util[_0x032e('0xd')](_0x032e('0x12'),_0x59b2be[_0x032e('0x13')][_0x032e('0xf')]));}process[_0x032e('0x14')](_0x59b2be[_0x032e('0x13')]['pid'],_0x032e('0x15'));return _0x356351['status'](0xc8)[_0x032e('0xa')]({'message':util[_0x032e('0xd')](_0x032e('0x16'),_0x59b2be[_0x032e('0x13')][_0x032e('0xf')])});})[_0x032e('0x17')](handleError(_0x356351,null,_0x032e('0xb')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 5a1f307..ff4819d 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 _0xc434=['isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./tag.controller','get'];(function(_0xc0ed05,_0xf64bb7){var _0x534764=function(_0x3746f0){while(--_0x3746f0){_0xc0ed05['push'](_0xc0ed05['shift']());}};_0x534764(++_0xf64bb7);}(_0xc434,0x16b));var _0x4c43=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0xc434[_0x2112d4];return _0x434972;};'use strict';var multer=require(_0x4c43('0x0'));var util=require(_0x4c43('0x1'));var path=require(_0x4c43('0x2'));var timeout=require(_0x4c43('0x3'));var express=require(_0x4c43('0x4'));var router=express[_0x4c43('0x5')]();var fs_extra=require(_0x4c43('0x6'));var auth=require(_0x4c43('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x4c43('0x8'));var controller=require(_0x4c43('0x9'));router[_0x4c43('0xa')]('/',auth[_0x4c43('0xb')](),controller[_0x4c43('0xc')]);router[_0x4c43('0xa')](_0x4c43('0xd'),auth[_0x4c43('0xb')](),controller[_0x4c43('0xe')]);router[_0x4c43('0xf')]('/',auth['isAuthenticated'](),controller[_0x4c43('0x10')]);router[_0x4c43('0x11')](_0x4c43('0xd'),auth['isAuthenticated'](),controller[_0x4c43('0x12')]);router[_0x4c43('0x13')](_0x4c43('0xd'),auth[_0x4c43('0xb')](),controller[_0x4c43('0x14')]);module[_0x4c43('0x15')]=router; \ No newline at end of file +var _0x4dee=['isAuthenticated','index','get','/:id','show','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller'];(function(_0x649cfc,_0x483d35){var _0x1104f4=function(_0x67a01d){while(--_0x67a01d){_0x649cfc['push'](_0x649cfc['shift']());}};_0x1104f4(++_0x483d35);}(_0x4dee,0x172));var _0xe4de=function(_0x556c4f,_0x3f0fcd){_0x556c4f=_0x556c4f-0x0;var _0x2059f3=_0x4dee[_0x556c4f];return _0x2059f3;};'use strict';var multer=require(_0xe4de('0x0'));var util=require(_0xe4de('0x1'));var path=require(_0xe4de('0x2'));var timeout=require(_0xe4de('0x3'));var express=require(_0xe4de('0x4'));var router=express[_0xe4de('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xe4de('0x6'));var interaction=require(_0xe4de('0x7'));var config=require(_0xe4de('0x8'));var controller=require(_0xe4de('0x9'));router['get']('/',auth[_0xe4de('0xa')](),controller[_0xe4de('0xb')]);router[_0xe4de('0xc')](_0xe4de('0xd'),auth['isAuthenticated'](),controller[_0xe4de('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xe4de('0xd'),auth[_0xe4de('0xa')](),controller[_0xe4de('0xf')]);router[_0xe4de('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xe4de('0x11')]);module[_0xe4de('0x12')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 5715938..39850ea 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 _0xa8b1=['#0091EA','sequelize','exports','STRING','name'];(function(_0x194102,_0x496a1b){var _0x1e406f=function(_0x3635a9){while(--_0x3635a9){_0x194102['push'](_0x194102['shift']());}};_0x1e406f(++_0x496a1b);}(_0xa8b1,0x182));var _0x1a8b=function(_0x138683,_0x58690b){_0x138683=_0x138683-0x0;var _0x1a4fcd=_0xa8b1[_0x138683];return _0x1a4fcd;};'use strict';var Sequelize=require(_0x1a8b('0x0'));module[_0x1a8b('0x1')]={'name':{'type':Sequelize[_0x1a8b('0x2')],'unique':_0x1a8b('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x1a8b('0x2')],'defaultValue':_0x1a8b('0x4')},'description':{'type':Sequelize[_0x1a8b('0x2')]}}; \ No newline at end of file +var _0x1f75=['exports','STRING','name','#0091EA'];(function(_0x253460,_0x25fa45){var _0x3efb9f=function(_0x2cd698){while(--_0x2cd698){_0x253460['push'](_0x253460['shift']());}};_0x3efb9f(++_0x25fa45);}(_0x1f75,0x13c));var _0x51f7=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x1f75[_0x33032e];return _0x13316b;};'use strict';var Sequelize=require('sequelize');module[_0x51f7('0x0')]={'name':{'type':Sequelize[_0x51f7('0x1')],'unique':_0x51f7('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x51f7('0x1')],'defaultValue':_0x51f7('0x3')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index c91a9cc..a3851e4 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 _0x073e=['save','update','then','destroy','stack','name','send','index','Tag','fieldName','type','map','keys','query','filters','model','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','rawAttributes','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Tags','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','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','../../mysqldb','sendStatus','end','status','json','offset','count','limit','set','Content-Range','apply','reject'];(function(_0x11dae1,_0x3efd21){var _0x2b441a=function(_0xce2109){while(--_0xce2109){_0x11dae1['push'](_0x11dae1['shift']());}};_0x2b441a(++_0x3efd21);}(_0x073e,0x181));var _0xe073=function(_0x2ffbb1,_0x17cd1b){_0x2ffbb1=_0x2ffbb1-0x0;var _0xde0895=_0x073e[_0x2ffbb1];return _0xde0895;};'use strict';var emlformat=require(_0xe073('0x0'));var rimraf=require(_0xe073('0x1'));var zipdir=require(_0xe073('0x2'));var jsonpatch=require(_0xe073('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe073('0x4'));var util=require(_0xe073('0x5'));var path=require(_0xe073('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe073('0x7'));var _=require(_0xe073('0x8'));var squel=require(_0xe073('0x9'));var crypto=require(_0xe073('0xa'));var jsforce=require(_0xe073('0xb'));var deskjs=require(_0xe073('0xc'));var toCsv=require('to-csv');var querystring=require(_0xe073('0xd'));var Papa=require(_0xe073('0xe'));var Redis=require(_0xe073('0xf'));var authService=require(_0xe073('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xe073('0x11'));var hardwareService=require(_0xe073('0x12'));var logger=require(_0xe073('0x13'))(_0xe073('0x14'));var utils=require(_0xe073('0x15'));var config=require(_0xe073('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe073('0x17'))['db'];function respondWithStatusCode(_0x56e3f5,_0x3dedf7){_0x3dedf7=_0x3dedf7||0xcc;return function(_0x5d2f2f){if(_0x5d2f2f){return _0x56e3f5[_0xe073('0x18')](_0x3dedf7);}return _0x56e3f5['status'](_0x3dedf7)[_0xe073('0x19')]();};}function respondWithResult(_0x27d34,_0x47828d){_0x47828d=_0x47828d||0xc8;return function(_0x2ce92d){if(_0x2ce92d){return _0x27d34[_0xe073('0x1a')](_0x47828d)[_0xe073('0x1b')](_0x2ce92d);}};}function respondWithFilteredResult(_0x2f4b36,_0xfb28f5){return function(_0x208f2e){if(_0x208f2e){var _0x26f3d3=typeof _0xfb28f5[_0xe073('0x1c')]==='undefined'&&typeof _0xfb28f5['limit']==='undefined';var _0x4c578c=_0x208f2e[_0xe073('0x1d')];var _0x10486c=_0x26f3d3?0x0:_0xfb28f5[_0xe073('0x1c')];var _0x4f9c8e=_0x26f3d3?_0x208f2e[_0xe073('0x1d')]:_0xfb28f5[_0xe073('0x1c')]+_0xfb28f5[_0xe073('0x1e')];var _0x54c10e;if(_0x4f9c8e>=_0x4c578c){_0x4f9c8e=_0x4c578c;_0x54c10e=0xc8;}else{_0x54c10e=0xce;}_0x2f4b36[_0xe073('0x1a')](_0x54c10e);return _0x2f4b36[_0xe073('0x1f')](_0xe073('0x20'),_0x10486c+'-'+_0x4f9c8e+'/'+_0x4c578c)[_0xe073('0x1b')](_0x208f2e);}return null;};}function patchUpdates(_0x43668e){return function(_0x17dd4b){try{jsonpatch[_0xe073('0x21')](_0x17dd4b,_0x43668e,!![]);}catch(_0x1d7a13){return BPromise[_0xe073('0x22')](_0x1d7a13);}return _0x17dd4b[_0xe073('0x23')]();};}function saveUpdates(_0x5143fa,_0x4405fd){return function(_0x21f9c2){if(_0x21f9c2){return _0x21f9c2[_0xe073('0x24')](_0x5143fa)[_0xe073('0x25')](function(_0x39bcb4){return _0x39bcb4;});}return null;};}function removeEntity(_0x275aa8,_0x504c26){return function(_0x4c76ef){if(_0x4c76ef){return _0x4c76ef[_0xe073('0x26')]()['then'](function(){var _0x5e3b16=_0x4c76ef['get']({'plain':!![]});var _0x5c4137='Tags';return db['UserProfileResource'][_0xe073('0x26')]({'where':{'type':_0x5c4137,'resourceId':_0x5e3b16['id']}})[_0xe073('0x25')](function(){return _0x4c76ef;});})['then'](function(){_0x275aa8[_0xe073('0x1a')](0xcc)[_0xe073('0x19')]();});}};}function handleEntityNotFound(_0x436c34,_0x5a5b2b){return function(_0x10f5ba){if(!_0x10f5ba){_0x436c34['sendStatus'](0x194);}return _0x10f5ba;};}function handleError(_0x255d91,_0x2e5fac){_0x2e5fac=_0x2e5fac||0x1f4;return function(_0x599972){logger['error'](_0x599972[_0xe073('0x27')]);if(_0x599972[_0xe073('0x28')]){delete _0x599972[_0xe073('0x28')];}_0x255d91[_0xe073('0x1a')](_0x2e5fac)[_0xe073('0x29')](_0x599972);};}exports[_0xe073('0x2a')]=function(_0x4f60dd,_0x2a206a){var _0x5c04fe={},_0x1baa0a={},_0x1cdcb0={'count':0x0,'rows':[]};var _0x4a6884=_['map'](db[_0xe073('0x2b')]['rawAttributes'],function(_0x3f6564){return{'name':_0x3f6564[_0xe073('0x2c')],'type':_0x3f6564[_0xe073('0x2d')]['key']};});_0x1baa0a['model']=_[_0xe073('0x2e')](_0x4a6884,_0xe073('0x28'));_0x1baa0a['query']=_[_0xe073('0x2f')](_0x4f60dd[_0xe073('0x30')]);_0x1baa0a[_0xe073('0x31')]=_['intersection'](_0x1baa0a[_0xe073('0x32')],_0x1baa0a['query']);_0x5c04fe['attributes']=_[_0xe073('0x33')](_0x1baa0a[_0xe073('0x32')],qs[_0xe073('0x34')](_0x4f60dd['query'][_0xe073('0x34')]));_0x5c04fe[_0xe073('0x35')]=_0x5c04fe[_0xe073('0x35')]['length']?_0x5c04fe[_0xe073('0x35')]:_0x1baa0a[_0xe073('0x32')];if(!_0x4f60dd[_0xe073('0x30')][_0xe073('0x36')](_0xe073('0x37'))){_0x5c04fe[_0xe073('0x1e')]=qs['limit'](_0x4f60dd[_0xe073('0x30')][_0xe073('0x1e')]);_0x5c04fe[_0xe073('0x1c')]=qs['offset'](_0x4f60dd[_0xe073('0x30')][_0xe073('0x1c')]);}_0x5c04fe[_0xe073('0x38')]=qs[_0xe073('0x39')](_0x4f60dd[_0xe073('0x30')]['sort']);_0x5c04fe[_0xe073('0x3a')]=qs['filters'](_[_0xe073('0x3b')](_0x4f60dd[_0xe073('0x30')],_0x1baa0a[_0xe073('0x31')]),_0x4a6884);if(_0x4f60dd[_0xe073('0x30')][_0xe073('0x3c')]){_0x5c04fe[_0xe073('0x3a')]=_[_0xe073('0x3d')](_0x5c04fe[_0xe073('0x3a')],{'$or':_[_0xe073('0x2e')](_0x4a6884,function(_0x3d29e5){if(_0x3d29e5[_0xe073('0x2d')]!==_0xe073('0x3e')){var _0x16be1a={};_0x16be1a[_0x3d29e5['name']]={'$like':'%'+_0x4f60dd[_0xe073('0x30')]['filter']+'%'};return _0x16be1a;}})});}_0x5c04fe=_[_0xe073('0x3d')]({},_0x5c04fe,_0x4f60dd[_0xe073('0x3f')]);var _0x5a4e19={'where':_0x5c04fe[_0xe073('0x3a')]};return db['Tag'][_0xe073('0x1d')](_0x5a4e19)[_0xe073('0x25')](function(_0x93852a){_0x1cdcb0[_0xe073('0x1d')]=_0x93852a;if(_0x4f60dd[_0xe073('0x30')]['includeAll']){_0x5c04fe[_0xe073('0x40')]=[{'all':!![]}];}return db['Tag'][_0xe073('0x41')](_0x5c04fe);})[_0xe073('0x25')](function(_0x125d1f){_0x1cdcb0[_0xe073('0x42')]=_0x125d1f;return _0x1cdcb0;})[_0xe073('0x25')](respondWithFilteredResult(_0x2a206a,_0x5c04fe))[_0xe073('0x43')](handleError(_0x2a206a,null));};exports[_0xe073('0x44')]=function(_0x2f4939,_0x1b50c5){var _0x2d3ffe={'raw':!![],'where':{'id':_0x2f4939['params']['id']}},_0x2c312b={};_0x2c312b['model']=_[_0xe073('0x2f')](db[_0xe073('0x2b')][_0xe073('0x45')]);_0x2c312b[_0xe073('0x30')]=_[_0xe073('0x2f')](_0x2f4939['query']);_0x2c312b[_0xe073('0x31')]=_[_0xe073('0x33')](_0x2c312b[_0xe073('0x32')],_0x2c312b[_0xe073('0x30')]);_0x2d3ffe[_0xe073('0x35')]=_['intersection'](_0x2c312b[_0xe073('0x32')],qs['fields'](_0x2f4939['query'][_0xe073('0x34')]));_0x2d3ffe[_0xe073('0x35')]=_0x2d3ffe['attributes']['length']?_0x2d3ffe[_0xe073('0x35')]:_0x2c312b[_0xe073('0x32')];if(_0x2f4939[_0xe073('0x30')][_0xe073('0x46')]){_0x2d3ffe[_0xe073('0x40')]=[{'all':!![]}];}_0x2d3ffe=_[_0xe073('0x3d')]({},_0x2d3ffe,_0x2f4939[_0xe073('0x3f')]);return db['Tag'][_0xe073('0x47')](_0x2d3ffe)['then'](handleEntityNotFound(_0x1b50c5,null))[_0xe073('0x25')](respondWithResult(_0x1b50c5,null))[_0xe073('0x43')](handleError(_0x1b50c5,null));};exports[_0xe073('0x48')]=function(_0x4e1f1d,_0x4d5bcd){return db[_0xe073('0x2b')][_0xe073('0x48')](_0x4e1f1d[_0xe073('0x49')],{})['then'](function(_0x151035){var _0x338557=_0x4e1f1d[_0xe073('0x4a')][_0xe073('0x4b')]({'plain':!![]});if(!_0x338557)throw new Error(_0xe073('0x4c'));if(_0x338557[_0xe073('0x4d')]===_0xe073('0x4a')){var _0x307541=_0x151035[_0xe073('0x4b')]({'plain':!![]});var _0x5626d4=_0xe073('0x4e');return db['UserProfileSection'][_0xe073('0x47')]({'where':{'name':_0x5626d4,'userProfileId':_0x338557['userProfileId']},'raw':!![]})[_0xe073('0x25')](function(_0x202687){if(_0x202687&&_0x202687[_0xe073('0x4f')]===0x0){return db[_0xe073('0x50')]['create']({'name':_0x307541[_0xe073('0x28')],'resourceId':_0x307541['id'],'type':_0x202687[_0xe073('0x28')],'sectionId':_0x202687['id']},{})[_0xe073('0x25')](function(){return _0x151035;});}else{return _0x151035;}})['catch'](function(_0x5503c2){logger[_0xe073('0x51')](_0xe073('0x52'),_0x5503c2);throw _0x5503c2;});}return _0x151035;})[_0xe073('0x25')](respondWithResult(_0x4d5bcd,0xc9))[_0xe073('0x43')](handleError(_0x4d5bcd,null));};exports[_0xe073('0x24')]=function(_0x5212d5,_0x197c42){if(_0x5212d5[_0xe073('0x49')]['id']){delete _0x5212d5[_0xe073('0x49')]['id'];}return db[_0xe073('0x2b')][_0xe073('0x47')]({'where':{'id':_0x5212d5[_0xe073('0x53')]['id']}})[_0xe073('0x25')](handleEntityNotFound(_0x197c42,null))[_0xe073('0x25')](saveUpdates(_0x5212d5[_0xe073('0x49')],null))[_0xe073('0x25')](respondWithResult(_0x197c42,null))['catch'](handleError(_0x197c42,null));};exports[_0xe073('0x26')]=function(_0x582007,_0x5825eb){return db[_0xe073('0x2b')][_0xe073('0x47')]({'where':{'id':_0x582007[_0xe073('0x53')]['id']}})['then'](handleEntityNotFound(_0x5825eb,null))[_0xe073('0x25')](removeEntity(_0x5825eb,null))[_0xe073('0x43')](handleError(_0x5825eb,null));}; \ No newline at end of file +var _0xb205=['fast-json-patch','request-promise','mustache','path','sox','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','offset','limit','undefined','count','set','json','reject','update','destroy','then','get','UserProfileResource','end','stack','name','send','map','Tag','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Tags','UserProfileSection','userProfileId','autoAssociation','error','eml-format','rimraf','zip-dir'];(function(_0x463764,_0x4f79e7){var _0x11d7e3=function(_0x4f6220){while(--_0x4f6220){_0x463764['push'](_0x463764['shift']());}};_0x11d7e3(++_0x4f79e7);}(_0xb205,0xf0));var _0x5b20=function(_0x528981,_0x46fa28){_0x528981=_0x528981-0x0;var _0x3e63ea=_0xb205[_0x528981];return _0x3e63ea;};'use strict';var emlformat=require(_0x5b20('0x0'));var rimraf=require(_0x5b20('0x1'));var zipdir=require(_0x5b20('0x2'));var jsonpatch=require(_0x5b20('0x3'));var rp=require(_0x5b20('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5b20('0x5'));var util=require('util');var path=require(_0x5b20('0x6'));var sox=require(_0x5b20('0x7'));var csv=require('to-csv');var ejs=require(_0x5b20('0x8'));var fs=require('fs');var fs_extra=require(_0x5b20('0x9'));var _=require(_0x5b20('0xa'));var squel=require('squel');var crypto=require(_0x5b20('0xb'));var jsforce=require(_0x5b20('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5b20('0xd'));var Papa=require(_0x5b20('0xe'));var Redis=require(_0x5b20('0xf'));var authService=require(_0x5b20('0x10'));var qs=require(_0x5b20('0x11'));var as=require(_0x5b20('0x12'));var hardwareService=require(_0x5b20('0x13'));var logger=require('../../config/logger')(_0x5b20('0x14'));var utils=require(_0x5b20('0x15'));var config=require(_0x5b20('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a13ac,_0x374632){_0x374632=_0x374632||0xcc;return function(_0xf721a0){if(_0xf721a0){return _0x2a13ac[_0x5b20('0x17')](_0x374632);}return _0x2a13ac[_0x5b20('0x18')](_0x374632)['end']();};}function respondWithResult(_0x42fbb0,_0x32c2df){_0x32c2df=_0x32c2df||0xc8;return function(_0x180185){if(_0x180185){return _0x42fbb0[_0x5b20('0x18')](_0x32c2df)['json'](_0x180185);}};}function respondWithFilteredResult(_0x5247f9,_0x25b9ab){return function(_0x47e80f){if(_0x47e80f){var _0x5ac9db=typeof _0x25b9ab[_0x5b20('0x19')]==='undefined'&&typeof _0x25b9ab[_0x5b20('0x1a')]===_0x5b20('0x1b');var _0x3b9e74=_0x47e80f['count'];var _0x44ac15=_0x5ac9db?0x0:_0x25b9ab[_0x5b20('0x19')];var _0x3e37ef=_0x5ac9db?_0x47e80f[_0x5b20('0x1c')]:_0x25b9ab['offset']+_0x25b9ab[_0x5b20('0x1a')];var _0x55ae4d;if(_0x3e37ef>=_0x3b9e74){_0x3e37ef=_0x3b9e74;_0x55ae4d=0xc8;}else{_0x55ae4d=0xce;}_0x5247f9[_0x5b20('0x18')](_0x55ae4d);return _0x5247f9[_0x5b20('0x1d')]('Content-Range',_0x44ac15+'-'+_0x3e37ef+'/'+_0x3b9e74)[_0x5b20('0x1e')](_0x47e80f);}return null;};}function patchUpdates(_0x54cdf3){return function(_0x3b7aea){try{jsonpatch['apply'](_0x3b7aea,_0x54cdf3,!![]);}catch(_0x28fd12){return BPromise[_0x5b20('0x1f')](_0x28fd12);}return _0x3b7aea['save']();};}function saveUpdates(_0x2d404f,_0x52e27f){return function(_0x4f291e){if(_0x4f291e){return _0x4f291e[_0x5b20('0x20')](_0x2d404f)['then'](function(_0x4b4076){return _0x4b4076;});}return null;};}function removeEntity(_0x37ab76,_0x18f555){return function(_0x9301c7){if(_0x9301c7){return _0x9301c7[_0x5b20('0x21')]()[_0x5b20('0x22')](function(){var _0xb0f07e=_0x9301c7[_0x5b20('0x23')]({'plain':!![]});var _0x3bcee0='Tags';return db[_0x5b20('0x24')][_0x5b20('0x21')]({'where':{'type':_0x3bcee0,'resourceId':_0xb0f07e['id']}})[_0x5b20('0x22')](function(){return _0x9301c7;});})[_0x5b20('0x22')](function(){_0x37ab76[_0x5b20('0x18')](0xcc)[_0x5b20('0x25')]();});}};}function handleEntityNotFound(_0x50d335,_0x16ff2d){return function(_0x49a15d){if(!_0x49a15d){_0x50d335[_0x5b20('0x17')](0x194);}return _0x49a15d;};}function handleError(_0x1b8965,_0x1d4c46){_0x1d4c46=_0x1d4c46||0x1f4;return function(_0x516f16){logger['error'](_0x516f16[_0x5b20('0x26')]);if(_0x516f16[_0x5b20('0x27')]){delete _0x516f16['name'];}_0x1b8965['status'](_0x1d4c46)[_0x5b20('0x28')](_0x516f16);};}exports['index']=function(_0x3aee17,_0x13d302){var _0x3f599c={},_0x344688={},_0x5549a3={'count':0x0,'rows':[]};var _0x349abc=_[_0x5b20('0x29')](db[_0x5b20('0x2a')][_0x5b20('0x2b')],function(_0x5ce609){return{'name':_0x5ce609[_0x5b20('0x2c')],'type':_0x5ce609[_0x5b20('0x2d')][_0x5b20('0x2e')]};});_0x344688[_0x5b20('0x2f')]=_[_0x5b20('0x29')](_0x349abc,_0x5b20('0x27'));_0x344688[_0x5b20('0x30')]=_[_0x5b20('0x31')](_0x3aee17[_0x5b20('0x30')]);_0x344688[_0x5b20('0x32')]=_[_0x5b20('0x33')](_0x344688[_0x5b20('0x2f')],_0x344688[_0x5b20('0x30')]);_0x3f599c[_0x5b20('0x34')]=_[_0x5b20('0x33')](_0x344688['model'],qs['fields'](_0x3aee17['query'][_0x5b20('0x35')]));_0x3f599c[_0x5b20('0x34')]=_0x3f599c[_0x5b20('0x34')][_0x5b20('0x36')]?_0x3f599c[_0x5b20('0x34')]:_0x344688['model'];if(!_0x3aee17[_0x5b20('0x30')][_0x5b20('0x37')](_0x5b20('0x38'))){_0x3f599c[_0x5b20('0x1a')]=qs[_0x5b20('0x1a')](_0x3aee17[_0x5b20('0x30')][_0x5b20('0x1a')]);_0x3f599c['offset']=qs['offset'](_0x3aee17['query'][_0x5b20('0x19')]);}_0x3f599c[_0x5b20('0x39')]=qs[_0x5b20('0x3a')](_0x3aee17[_0x5b20('0x30')][_0x5b20('0x3a')]);_0x3f599c[_0x5b20('0x3b')]=qs['filters'](_['pick'](_0x3aee17[_0x5b20('0x30')],_0x344688[_0x5b20('0x32')]),_0x349abc);if(_0x3aee17['query'][_0x5b20('0x3c')]){_0x3f599c[_0x5b20('0x3b')]=_[_0x5b20('0x3d')](_0x3f599c[_0x5b20('0x3b')],{'$or':_[_0x5b20('0x29')](_0x349abc,function(_0x1899e1){if(_0x1899e1[_0x5b20('0x2d')]!==_0x5b20('0x3e')){var _0xce0cec={};_0xce0cec[_0x1899e1[_0x5b20('0x27')]]={'$like':'%'+_0x3aee17[_0x5b20('0x30')][_0x5b20('0x3c')]+'%'};return _0xce0cec;}})});}_0x3f599c=_['merge']({},_0x3f599c,_0x3aee17[_0x5b20('0x3f')]);var _0x14a9a0={'where':_0x3f599c[_0x5b20('0x3b')]};return db[_0x5b20('0x2a')][_0x5b20('0x1c')](_0x14a9a0)[_0x5b20('0x22')](function(_0x452560){_0x5549a3[_0x5b20('0x1c')]=_0x452560;if(_0x3aee17[_0x5b20('0x30')][_0x5b20('0x40')]){_0x3f599c[_0x5b20('0x41')]=[{'all':!![]}];}return db[_0x5b20('0x2a')][_0x5b20('0x42')](_0x3f599c);})[_0x5b20('0x22')](function(_0x831edd){_0x5549a3[_0x5b20('0x43')]=_0x831edd;return _0x5549a3;})[_0x5b20('0x22')](respondWithFilteredResult(_0x13d302,_0x3f599c))[_0x5b20('0x44')](handleError(_0x13d302,null));};exports[_0x5b20('0x45')]=function(_0x106c62,_0x3c90e2){var _0xa30aba={'raw':!![],'where':{'id':_0x106c62[_0x5b20('0x46')]['id']}},_0x13326e={};_0x13326e[_0x5b20('0x2f')]=_[_0x5b20('0x31')](db[_0x5b20('0x2a')]['rawAttributes']);_0x13326e[_0x5b20('0x30')]=_[_0x5b20('0x31')](_0x106c62[_0x5b20('0x30')]);_0x13326e[_0x5b20('0x32')]=_[_0x5b20('0x33')](_0x13326e[_0x5b20('0x2f')],_0x13326e[_0x5b20('0x30')]);_0xa30aba['attributes']=_[_0x5b20('0x33')](_0x13326e[_0x5b20('0x2f')],qs[_0x5b20('0x35')](_0x106c62[_0x5b20('0x30')][_0x5b20('0x35')]));_0xa30aba[_0x5b20('0x34')]=_0xa30aba[_0x5b20('0x34')]['length']?_0xa30aba[_0x5b20('0x34')]:_0x13326e[_0x5b20('0x2f')];if(_0x106c62['query'][_0x5b20('0x40')]){_0xa30aba[_0x5b20('0x41')]=[{'all':!![]}];}_0xa30aba=_['merge']({},_0xa30aba,_0x106c62[_0x5b20('0x3f')]);return db[_0x5b20('0x2a')][_0x5b20('0x47')](_0xa30aba)[_0x5b20('0x22')](handleEntityNotFound(_0x3c90e2,null))[_0x5b20('0x22')](respondWithResult(_0x3c90e2,null))[_0x5b20('0x44')](handleError(_0x3c90e2,null));};exports[_0x5b20('0x48')]=function(_0x36c204,_0x58bd13){return db[_0x5b20('0x2a')][_0x5b20('0x48')](_0x36c204[_0x5b20('0x49')],{})[_0x5b20('0x22')](function(_0x27c4d1){var _0x380d76=_0x36c204['user'][_0x5b20('0x23')]({'plain':!![]});if(!_0x380d76)throw new Error(_0x5b20('0x4a'));if(_0x380d76['role']===_0x5b20('0x4b')){var _0x48d5f2=_0x27c4d1[_0x5b20('0x23')]({'plain':!![]});var _0x3c224d=_0x5b20('0x4c');return db[_0x5b20('0x4d')]['find']({'where':{'name':_0x3c224d,'userProfileId':_0x380d76[_0x5b20('0x4e')]},'raw':!![]})[_0x5b20('0x22')](function(_0x1bcead){if(_0x1bcead&&_0x1bcead[_0x5b20('0x4f')]===0x0){return db[_0x5b20('0x24')][_0x5b20('0x48')]({'name':_0x48d5f2[_0x5b20('0x27')],'resourceId':_0x48d5f2['id'],'type':_0x1bcead['name'],'sectionId':_0x1bcead['id']},{})['then'](function(){return _0x27c4d1;});}else{return _0x27c4d1;}})[_0x5b20('0x44')](function(_0x31d8b2){logger[_0x5b20('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x31d8b2);throw _0x31d8b2;});}return _0x27c4d1;})[_0x5b20('0x22')](respondWithResult(_0x58bd13,0xc9))[_0x5b20('0x44')](handleError(_0x58bd13,null));};exports[_0x5b20('0x20')]=function(_0x5ab93d,_0x33ec01){if(_0x5ab93d[_0x5b20('0x49')]['id']){delete _0x5ab93d[_0x5b20('0x49')]['id'];}return db['Tag'][_0x5b20('0x47')]({'where':{'id':_0x5ab93d['params']['id']}})[_0x5b20('0x22')](handleEntityNotFound(_0x33ec01,null))[_0x5b20('0x22')](saveUpdates(_0x5ab93d[_0x5b20('0x49')],null))[_0x5b20('0x22')](respondWithResult(_0x33ec01,null))['catch'](handleError(_0x33ec01,null));};exports[_0x5b20('0x21')]=function(_0x5416ab,_0x15e8a1){return db['Tag']['find']({'where':{'id':_0x5416ab[_0x5b20('0x46')]['id']}})[_0x5b20('0x22')](handleEntityNotFound(_0x15e8a1,null))[_0x5b20('0x22')](removeEntity(_0x15e8a1,null))[_0x5b20('0x44')](handleError(_0x15e8a1,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 37b4eb4..9201412 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 _0x907a=['rimraf','../../config/environment','./tag.attributes','Tag','tools_tags','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5871f9,_0x28ccb7){var _0x8fd1c0=function(_0x510060){while(--_0x510060){_0x5871f9['push'](_0x5871f9['shift']());}};_0x8fd1c0(++_0x28ccb7);}(_0x907a,0xe9));var _0xa907=function(_0x1ce1e2,_0x1e00ea){_0x1ce1e2=_0x1ce1e2-0x0;var _0xfeba07=_0x907a[_0x1ce1e2];return _0xfeba07;};'use strict';var _=require('lodash');var util=require(_0xa907('0x0'));var logger=require(_0xa907('0x1'))(_0xa907('0x2'));var moment=require(_0xa907('0x3'));var BPromise=require(_0xa907('0x4'));var rp=require(_0xa907('0x5'));var fs=require('fs');var path=require(_0xa907('0x6'));var rimraf=require(_0xa907('0x7'));var config=require(_0xa907('0x8'));var attributes=require(_0xa907('0x9'));module['exports']=function(_0xb92172,_0x54936e){return _0xb92172['define'](_0xa907('0xa'),attributes,{'tableName':_0xa907('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa94c=['Tag','tools_tags','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./tag.attributes','exports','define'];(function(_0x1d8c86,_0x35919a){var _0x47c8a5=function(_0x39346d){while(--_0x39346d){_0x1d8c86['push'](_0x1d8c86['shift']());}};_0x47c8a5(++_0x35919a);}(_0xa94c,0x154));var _0xca94=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0xa94c[_0x3ab9ee];return _0x82ee88;};'use strict';var _=require(_0xca94('0x0'));var util=require(_0xca94('0x1'));var logger=require(_0xca94('0x2'))(_0xca94('0x3'));var moment=require(_0xca94('0x4'));var BPromise=require('bluebird');var rp=require(_0xca94('0x5'));var fs=require('fs');var path=require(_0xca94('0x6'));var rimraf=require(_0xca94('0x7'));var config=require('../../config/environment');var attributes=require(_0xca94('0x8'));module[_0xca94('0x9')]=function(_0x1d2231,_0x3f6036){return _0x1d2231[_0xca94('0xa')](_0xca94('0xb'),attributes,{'tableName':_0xca94('0xc'),'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 6c17865..f4c851d 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 _0x4c4e=['result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x1b580e,_0x55766a){var _0x5b0378=function(_0x2a8bb6){while(--_0x2a8bb6){_0x1b580e['push'](_0x1b580e['shift']());}};_0x5b0378(++_0x55766a);}(_0x4c4e,0x152));var _0xe4c4=function(_0xba85e6,_0x15c6e0){_0xba85e6=_0xba85e6-0x0;var _0x424321=_0x4c4e[_0xba85e6];return _0x424321;};'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')]('Tag,\x20%s,\x20%s',_0xad105,_0x589b2e[_0xe4c4('0x10')][_0xe4c4('0x12')]);return _0x28a42e(_0x589b2e['error'][_0xe4c4('0x12')]);}logger[_0xe4c4('0x10')]('Tag,\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 _0x9649=['bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','debug','Tag,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Tag,\x20%s,\x20%s','message','catch','lodash','util','moment'];(function(_0xbf7ef0,_0x7105be){var _0x6362f3=function(_0x1fe5bd){while(--_0x1fe5bd){_0xbf7ef0['push'](_0xbf7ef0['shift']());}};_0x6362f3(++_0x7105be);}(_0x9649,0x19f));var _0x9964=function(_0x3e237b,_0x41ff17){_0x3e237b=_0x3e237b-0x0;var _0x22f65f=_0x9649[_0x3e237b];return _0x22f65f;};'use strict';var _=require(_0x9964('0x0'));var util=require(_0x9964('0x1'));var moment=require(_0x9964('0x2'));var BPromise=require(_0x9964('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9964('0x4'));var db=require(_0x9964('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9964('0x6'))('rpc');var config=require(_0x9964('0x7'));var jayson=require(_0x9964('0x8'));var client=jayson[_0x9964('0x9')][_0x9964('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x40c60b,_0x1338e7,_0x3fa639){return new BPromise(function(_0x4bec88,_0x45dda7){return client[_0x9964('0xb')](_0x40c60b,_0x3fa639)['then'](function(_0x10b88b){logger[_0x9964('0xc')]('Tag,\x20%s,\x20%s',_0x1338e7,'request\x20sent');logger[_0x9964('0xd')](_0x9964('0xe'),_0x1338e7,_0x9964('0xf'),JSON[_0x9964('0x10')](_0x10b88b));if(_0x10b88b[_0x9964('0x11')]){if(_0x10b88b['error'][_0x9964('0x12')]===0x1f4){logger['error'](_0x9964('0x13'),_0x1338e7,_0x10b88b[_0x9964('0x11')]['message']);return _0x45dda7(_0x10b88b[_0x9964('0x11')][_0x9964('0x14')]);}logger['error'](_0x9964('0x13'),_0x1338e7,_0x10b88b[_0x9964('0x11')][_0x9964('0x14')]);return _0x4bec88(_0x10b88b[_0x9964('0x11')][_0x9964('0x14')]);}else{logger['info'](_0x9964('0x13'),_0x1338e7,_0x9964('0xf'));_0x4bec88(_0x10b88b['result'][_0x9964('0x14')]);}})[_0x9964('0x15')](function(_0x57fe55){logger[_0x9964('0x11')](_0x9964('0x13'),_0x1338e7,_0x57fe55);_0x45dda7(_0x57fe55);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 66c1c22..a40e86c 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(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router; \ No newline at end of file +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(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'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 db77377..ccefe8d 100644 --- a/server/api/team/team.attributes.js +++ b/server/api/team/team.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['name','sequelize','STRING'];(function(_0x25ce5b,_0x4941d6){var _0x2f41fd=function(_0x4d8e95){while(--_0x4d8e95){_0x25ce5b['push'](_0x25ce5b['shift']());}};_0x2f41fd(++_0x4941d6);}(_0xb10b,0x12a));var _0xbb10=function(_0x11280c,_0x4e8f92){_0x11280c=_0x11280c-0x0;var _0x5999ac=_0xb10b[_0x11280c];return _0x5999ac;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2')},'description':{'type':Sequelize[_0xbb10('0x1')]}}; \ No newline at end of file +var _0xb7e7=['STRING','sequelize'];(function(_0x231e16,_0x67347b){var _0x570a7c=function(_0x2c35b4){while(--_0x2c35b4){_0x231e16['push'](_0x231e16['shift']());}};_0x570a7c(++_0x67347b);}(_0xb7e7,0x121));var _0x7b7e=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0xb7e7[_0x4d8ed9];return _0x1e2140;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x7b7e('0x1')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index e3df9ee..39fb827 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 _0x5fdd=['add','ids','removeQueues','remove','isArray','Voice','Chat','Mail','Openchannel','Whatsapp','QueueId','User','findOrCreate','Queue:save','findAll','online','voicePause','interface','upsert','isNil','format','TeamVoiceQueue','penalty','all','TeamVoicePrefix','addAgents','spread','removeAgents','Sms','Fax','Queue:remove','UserVoiceQueueRt','getAgents','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./team.socket','register','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','sendStatus','error','index','fieldName','type','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','map','VIRTUAL','name','options','then','includeAll','include','Team','rows','catch','show','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','transaction','QueryTypes','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','sequelize','VoiceQueueId','UserVoiceQueue','Sequelize','MailQueueId','destroy','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','UserChatQueue','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','UserVoicePrefix','VoicePrefixId','Teams','getQueues','findOne','channel','isValidChannel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','rawAttributes','Queues','addQueues'];(function(_0x182baf,_0x1375fb){var _0x4d10f1=function(_0x1e0dde){while(--_0x1e0dde){_0x182baf['push'](_0x182baf['shift']());}};_0x4d10f1(++_0x1375fb);}(_0x5fdd,0x1ea));var _0xd5fd=function(_0x11a55c,_0x4eced9){_0x11a55c=_0x11a55c-0x0;var _0x26c390=_0x5fdd[_0x11a55c];return _0x26c390;};'use strict';var emlformat=require(_0xd5fd('0x0'));var rimraf=require(_0xd5fd('0x1'));var zipdir=require(_0xd5fd('0x2'));var jsonpatch=require(_0xd5fd('0x3'));var rp=require(_0xd5fd('0x4'));var moment=require(_0xd5fd('0x5'));var BPromise=require(_0xd5fd('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd5fd('0x7'));var sox=require('sox');var csv=require(_0xd5fd('0x8'));var ejs=require(_0xd5fd('0x9'));var fs=require('fs');var fs_extra=require(_0xd5fd('0xa'));var _=require(_0xd5fd('0xb'));var squel=require(_0xd5fd('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd5fd('0x8'));var querystring=require(_0xd5fd('0xd'));var Papa=require(_0xd5fd('0xe'));var Redis=require(_0xd5fd('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xd5fd('0x10'));var as=require(_0xd5fd('0x11'));var hardwareService=require(_0xd5fd('0x12'));var logger=require('../../config/logger')(_0xd5fd('0x13'));var utils=require(_0xd5fd('0x14'));var config=require(_0xd5fd('0x15'));var licenseUtil=require(_0xd5fd('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xd5fd('0x17')](config[_0xd5fd('0x18')],{'host':_0xd5fd('0x19'),'port':0x18eb});var socket=require(_0xd5fd('0x1a'))(new Redis(config[_0xd5fd('0x18')]));require(_0xd5fd('0x1b'))[_0xd5fd('0x1c')](socket);function respondWithStatusCode(_0x5d8290,_0x4fb9ca){_0x4fb9ca=_0x4fb9ca||0xcc;return function(_0x3dce20){if(_0x3dce20){return _0x5d8290['sendStatus'](_0x4fb9ca);}return _0x5d8290[_0xd5fd('0x1d')](_0x4fb9ca)['end']();};}function respondWithResult(_0x2ecfa5,_0x422ce1){_0x422ce1=_0x422ce1||0xc8;return function(_0xc504f6){if(_0xc504f6){return _0x2ecfa5['status'](_0x422ce1)['json'](_0xc504f6);}};}function respondWithFilteredResult(_0x43d9db,_0x53ec7d){return function(_0x386d5a){if(_0x386d5a){var _0x1ff921=typeof _0x53ec7d[_0xd5fd('0x1e')]===_0xd5fd('0x1f')&&typeof _0x53ec7d[_0xd5fd('0x20')]==='undefined';var _0x44c475=_0x386d5a[_0xd5fd('0x21')];var _0x51cadd=_0x1ff921?0x0:_0x53ec7d[_0xd5fd('0x1e')];var _0x1e5b12=_0x1ff921?_0x386d5a[_0xd5fd('0x21')]:_0x53ec7d[_0xd5fd('0x1e')]+_0x53ec7d[_0xd5fd('0x20')];var _0x11dfd7;if(_0x1e5b12>=_0x44c475){_0x1e5b12=_0x44c475;_0x11dfd7=0xc8;}else{_0x11dfd7=0xce;}_0x43d9db[_0xd5fd('0x1d')](_0x11dfd7);return _0x43d9db[_0xd5fd('0x22')](_0xd5fd('0x23'),_0x51cadd+'-'+_0x1e5b12+'/'+_0x44c475)[_0xd5fd('0x24')](_0x386d5a);}return null;};}function patchUpdates(_0x410eaa){return function(_0x4057d1){try{jsonpatch[_0xd5fd('0x25')](_0x4057d1,_0x410eaa,!![]);}catch(_0x5ccf18){return BPromise['reject'](_0x5ccf18);}return _0x4057d1[_0xd5fd('0x26')]();};}function saveUpdates(_0x4e155a,_0x2eb986){return function(_0x58facc){if(_0x58facc){return _0x58facc[_0xd5fd('0x27')](_0x4e155a)['then'](function(_0x14991a){return _0x14991a;});}return null;};}function handleEntityNotFound(_0x3165d5,_0x19d0ff){return function(_0x55ff19){if(!_0x55ff19){_0x3165d5[_0xd5fd('0x28')](0x194);}return _0x55ff19;};}function handleError(_0x9fc98,_0x441a00){_0x441a00=_0x441a00||0x1f4;return function(_0x1de92a){logger[_0xd5fd('0x29')](_0x1de92a['stack']);if(_0x1de92a['name']){delete _0x1de92a['name'];}_0x9fc98[_0xd5fd('0x1d')](_0x441a00)['send'](_0x1de92a);};}exports[_0xd5fd('0x2a')]=function(_0x1c9104,_0x5cb8a9){var _0x23f956={},_0xedffb6={},_0x218f89={'count':0x0,'rows':[]};var _0xffe1d3=_['map'](db['Team']['rawAttributes'],function(_0x1a0d70){return{'name':_0x1a0d70[_0xd5fd('0x2b')],'type':_0x1a0d70[_0xd5fd('0x2c')]['key']};});_0xedffb6[_0xd5fd('0x2d')]=_['map'](_0xffe1d3,'name');_0xedffb6['query']=_[_0xd5fd('0x2e')](_0x1c9104[_0xd5fd('0x2f')]);_0xedffb6[_0xd5fd('0x30')]=_[_0xd5fd('0x31')](_0xedffb6[_0xd5fd('0x2d')],_0xedffb6[_0xd5fd('0x2f')]);_0x23f956['attributes']=_[_0xd5fd('0x31')](_0xedffb6['model'],qs['fields'](_0x1c9104[_0xd5fd('0x2f')][_0xd5fd('0x32')]));_0x23f956['attributes']=_0x23f956[_0xd5fd('0x33')][_0xd5fd('0x34')]?_0x23f956[_0xd5fd('0x33')]:_0xedffb6[_0xd5fd('0x2d')];if(!_0x1c9104[_0xd5fd('0x2f')][_0xd5fd('0x35')]('nolimit')){_0x23f956[_0xd5fd('0x20')]=qs[_0xd5fd('0x20')](_0x1c9104[_0xd5fd('0x2f')]['limit']);_0x23f956[_0xd5fd('0x1e')]=qs[_0xd5fd('0x1e')](_0x1c9104[_0xd5fd('0x2f')][_0xd5fd('0x1e')]);}_0x23f956[_0xd5fd('0x36')]=qs[_0xd5fd('0x37')](_0x1c9104[_0xd5fd('0x2f')][_0xd5fd('0x37')]);_0x23f956['where']=qs[_0xd5fd('0x30')](_[_0xd5fd('0x38')](_0x1c9104[_0xd5fd('0x2f')],_0xedffb6[_0xd5fd('0x30')]),_0xffe1d3);if(_0x1c9104['query'][_0xd5fd('0x39')]){_0x23f956[_0xd5fd('0x3a')]=_[_0xd5fd('0x3b')](_0x23f956[_0xd5fd('0x3a')],{'$or':_[_0xd5fd('0x3c')](_0xffe1d3,function(_0x57ed2a){if(_0x57ed2a[_0xd5fd('0x2c')]!==_0xd5fd('0x3d')){var _0x5b202e={};_0x5b202e[_0x57ed2a[_0xd5fd('0x3e')]]={'$like':'%'+_0x1c9104['query'][_0xd5fd('0x39')]+'%'};return _0x5b202e;}})});}_0x23f956=_[_0xd5fd('0x3b')]({},_0x23f956,_0x1c9104[_0xd5fd('0x3f')]);var _0x4029e8={'where':_0x23f956[_0xd5fd('0x3a')]};return db['Team'][_0xd5fd('0x21')](_0x4029e8)[_0xd5fd('0x40')](function(_0x51ee06){_0x218f89[_0xd5fd('0x21')]=_0x51ee06;if(_0x1c9104[_0xd5fd('0x2f')][_0xd5fd('0x41')]){_0x23f956[_0xd5fd('0x42')]=[{'all':!![]}];}return db[_0xd5fd('0x43')]['findAll'](_0x23f956);})[_0xd5fd('0x40')](function(_0x4ee3b9){_0x218f89[_0xd5fd('0x44')]=_0x4ee3b9;return _0x218f89;})[_0xd5fd('0x40')](respondWithFilteredResult(_0x5cb8a9,_0x23f956))[_0xd5fd('0x45')](handleError(_0x5cb8a9,null));};exports[_0xd5fd('0x46')]=function(_0xaeb822,_0x4ff8c0){var _0x376508={'raw':![],'where':{'id':_0xaeb822['params']['id']}},_0x32d2c5={};_0x32d2c5[_0xd5fd('0x2d')]=_[_0xd5fd('0x2e')](db[_0xd5fd('0x43')]['rawAttributes']);_0x32d2c5[_0xd5fd('0x2f')]=_[_0xd5fd('0x2e')](_0xaeb822[_0xd5fd('0x2f')]);_0x32d2c5['filters']=_[_0xd5fd('0x31')](_0x32d2c5['model'],_0x32d2c5[_0xd5fd('0x2f')]);_0x376508[_0xd5fd('0x33')]=_[_0xd5fd('0x31')](_0x32d2c5['model'],qs[_0xd5fd('0x32')](_0xaeb822['query'][_0xd5fd('0x32')]));_0x376508[_0xd5fd('0x33')]=_0x376508[_0xd5fd('0x33')][_0xd5fd('0x34')]?_0x376508[_0xd5fd('0x33')]:_0x32d2c5[_0xd5fd('0x2d')];if(_0xaeb822[_0xd5fd('0x2f')][_0xd5fd('0x41')]){_0x376508[_0xd5fd('0x42')]=[{'all':!![]}];}_0x376508=_[_0xd5fd('0x3b')]({},_0x376508,_0xaeb822[_0xd5fd('0x3f')]);return db[_0xd5fd('0x43')][_0xd5fd('0x47')](_0x376508)[_0xd5fd('0x40')](handleEntityNotFound(_0x4ff8c0,null))[_0xd5fd('0x40')](respondWithResult(_0x4ff8c0,null))[_0xd5fd('0x45')](handleError(_0x4ff8c0,null));};exports['create']=function(_0x1c1596,_0x44bd45){return db['Team'][_0xd5fd('0x48')](_0x1c1596[_0xd5fd('0x49')],{})[_0xd5fd('0x40')](function(_0x35f12a){var _0x49f83e=_0x1c1596[_0xd5fd('0x4a')][_0xd5fd('0x4b')]({'plain':!![]});if(!_0x49f83e)throw new Error(_0xd5fd('0x4c'));if(_0x49f83e['role']==='user'){var _0x206a40=_0x35f12a[_0xd5fd('0x4b')]({'plain':!![]});var _0x4e5b9a='Teams';return db[_0xd5fd('0x4d')]['find']({'where':{'name':_0x4e5b9a,'userProfileId':_0x49f83e['userProfileId']},'raw':!![]})[_0xd5fd('0x40')](function(_0x1739c9){if(_0x1739c9&&_0x1739c9['autoAssociation']===0x0){return db[_0xd5fd('0x4e')][_0xd5fd('0x48')]({'name':_0x206a40['name'],'resourceId':_0x206a40['id'],'type':_0x1739c9[_0xd5fd('0x3e')],'sectionId':_0x1739c9['id']},{})[_0xd5fd('0x40')](function(){return _0x35f12a;});}else{return _0x35f12a;}})[_0xd5fd('0x45')](function(_0x3566a1){logger['error'](_0xd5fd('0x4f'),_0x3566a1);throw _0x3566a1;});}return _0x35f12a;})[_0xd5fd('0x40')](respondWithResult(_0x44bd45,0xc9))[_0xd5fd('0x45')](handleError(_0x44bd45,null));};exports[_0xd5fd('0x27')]=function(_0x316d2c,_0x221d4c){if(_0x316d2c[_0xd5fd('0x49')]['id']){delete _0x316d2c['body']['id'];}return db['Team'][_0xd5fd('0x47')]({'where':{'id':_0x316d2c[_0xd5fd('0x50')]['id']}})[_0xd5fd('0x40')](handleEntityNotFound(_0x221d4c,null))[_0xd5fd('0x40')](saveUpdates(_0x316d2c['body'],null))[_0xd5fd('0x40')](respondWithResult(_0x221d4c,null))[_0xd5fd('0x45')](handleError(_0x221d4c,null));};exports['destroy']=function(_0x5b6731,_0x58ac28){var _0x2442be=_0x5b6731[_0xd5fd('0x50')]['id'];var _0x1807b2=[];return db['sequelize'][_0xd5fd('0x51')](function(_0x2f83ad){var _0x5c51f8='SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20'+_0x2442be;return db['sequelize'][_0xd5fd('0x2f')](_0x5c51f8,{'type':db['Sequelize'][_0xd5fd('0x52')][_0xd5fd('0x53')],'raw':!![],'transaction':_0x2f83ad})[_0xd5fd('0x40')](function(_0x2ebe8b){_0x1807b2=_[_0xd5fd('0x3c')](_0x2ebe8b,function(_0x4eddb8){return Number(_0x4eddb8[_0xd5fd('0x54')]);});})[_0xd5fd('0x40')](function(){var _0x42bb91=_0xd5fd('0x55')+_0x2442be;return db[_0xd5fd('0x56')][_0xd5fd('0x2f')](_0x42bb91,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x2f83ad});})[_0xd5fd('0x40')](function(_0x32b06f){var _0x337ec1=_[_0xd5fd('0x3c')](_0x32b06f,function(_0x5a852a){return Number(_0x5a852a[_0xd5fd('0x57')]);});return db[_0xd5fd('0x58')]['destroy']({'where':{'UserId':{'$in':_0x1807b2},'VoiceQueueId':{'$in':_0x337ec1}},'transaction':_0x2f83ad});})[_0xd5fd('0x40')](function(){var _0x3b905c='SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20'+_0x2442be;return db[_0xd5fd('0x56')][_0xd5fd('0x2f')](_0x3b905c,{'type':db[_0xd5fd('0x59')]['QueryTypes'][_0xd5fd('0x53')],'raw':!![],'transaction':_0x2f83ad});})[_0xd5fd('0x40')](function(_0x839ceb){var _0x497e1d=_[_0xd5fd('0x3c')](_0x839ceb,function(_0x2c47b7){return Number(_0x2c47b7[_0xd5fd('0x5a')]);});return db['UserMailQueue'][_0xd5fd('0x5b')]({'where':{'UserId':{'$in':_0x1807b2},'MailQueueId':{'$in':_0x497e1d}},'transaction':_0x2f83ad});})[_0xd5fd('0x40')](function(){var _0x63f6d6=_0xd5fd('0x5c')+_0x2442be;return db[_0xd5fd('0x56')][_0xd5fd('0x2f')](_0x63f6d6,{'type':db[_0xd5fd('0x59')][_0xd5fd('0x52')]['SELECT'],'raw':!![],'transaction':_0x2f83ad});})[_0xd5fd('0x40')](function(_0x5e06a7){var _0x4ba0aa=_[_0xd5fd('0x3c')](_0x5e06a7,function(_0x1f1b02){return Number(_0x1f1b02['SmsQueueId']);});return db[_0xd5fd('0x5d')][_0xd5fd('0x5b')]({'where':{'UserId':{'$in':_0x1807b2},'SmsQueueId':{'$in':_0x4ba0aa}},'transaction':_0x2f83ad});})[_0xd5fd('0x40')](function(){var _0x837cdf=_0xd5fd('0x5e')+_0x2442be;return db['sequelize']['query'](_0x837cdf,{'type':db[_0xd5fd('0x59')][_0xd5fd('0x52')]['SELECT'],'raw':!![],'transaction':_0x2f83ad});})[_0xd5fd('0x40')](function(_0x5565e3){var _0x1ccb66=_[_0xd5fd('0x3c')](_0x5565e3,function(_0x1d0c84){return Number(_0x1d0c84['ChatQueueId']);});return db[_0xd5fd('0x5f')][_0xd5fd('0x5b')]({'where':{'UserId':{'$in':_0x1807b2},'ChatQueueId':{'$in':_0x1ccb66}},'transaction':_0x2f83ad});})[_0xd5fd('0x40')](function(){var _0x4b0c39='SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20'+_0x2442be;return db[_0xd5fd('0x56')][_0xd5fd('0x2f')](_0x4b0c39,{'type':db[_0xd5fd('0x59')][_0xd5fd('0x52')][_0xd5fd('0x53')],'raw':!![],'transaction':_0x2f83ad});})[_0xd5fd('0x40')](function(_0x566117){var _0x371a69=_[_0xd5fd('0x3c')](_0x566117,function(_0x52963a){return Number(_0x52963a[_0xd5fd('0x60')]);});return db[_0xd5fd('0x61')][_0xd5fd('0x5b')]({'where':{'UserId':{'$in':_0x1807b2},'FaxQueueId':{'$in':_0x371a69}},'transaction':_0x2f83ad});})[_0xd5fd('0x40')](function(){var _0x9b4c5f=_0xd5fd('0x62')+_0x2442be;return db[_0xd5fd('0x56')][_0xd5fd('0x2f')](_0x9b4c5f,{'type':db['Sequelize']['QueryTypes'][_0xd5fd('0x53')],'raw':!![],'transaction':_0x2f83ad});})[_0xd5fd('0x40')](function(_0x454d1c){var _0x47172f=_[_0xd5fd('0x3c')](_0x454d1c,function(_0x2b1d2d){return Number(_0x2b1d2d[_0xd5fd('0x63')]);});return db['UserOpenchannelQueue'][_0xd5fd('0x5b')]({'where':{'UserId':{'$in':_0x1807b2},'OpenchannelQueueId':{'$in':_0x47172f}},'transaction':_0x2f83ad});})[_0xd5fd('0x40')](function(){var _0x2da66a=_0xd5fd('0x64')+_0x2442be;return db[_0xd5fd('0x56')][_0xd5fd('0x2f')](_0x2da66a,{'type':db[_0xd5fd('0x59')]['QueryTypes'][_0xd5fd('0x53')],'raw':!![],'transaction':_0x2f83ad});})[_0xd5fd('0x40')](function(_0x372536){var _0x50ad1e=_[_0xd5fd('0x3c')](_0x372536,function(_0x43bee2){return Number(_0x43bee2[_0xd5fd('0x65')]);});return db[_0xd5fd('0x66')]['destroy']({'where':{'UserId':{'$in':_0x1807b2},'WhatsappQueueId':{'$in':_0x50ad1e}},'transaction':_0x2f83ad});})['then'](function(){return db['TeamVoicePrefix']['find']({'where':{'TeamId':_0x2442be}});})[_0xd5fd('0x40')](function(_0x1c4060){if(_0x1c4060===null){return;}return db[_0xd5fd('0x67')][_0xd5fd('0x5b')]({'where':{'UserId':{'$in':_0x1807b2},'VoicePrefixId':_0x1c4060[_0xd5fd('0x68')]},'transaction':_0x2f83ad});})[_0xd5fd('0x40')](function(){return db[_0xd5fd('0x43')]['destroy']({'where':{'id':_0x2442be},'cascade':!![],'transaction':_0x2f83ad});})[_0xd5fd('0x40')](function(_0x267df8){if(_0x267df8===0x0){_0x58ac28[_0xd5fd('0x28')](0x194);}else{return db[_0xd5fd('0x4e')][_0xd5fd('0x5b')]({'where':{'type':_0xd5fd('0x69'),'resourceId':_0x2442be},'cascade':!![],'transaction':_0x2f83ad})[_0xd5fd('0x40')](function(){_0x58ac28['status'](0xcc)['end']();});}})['catch'](function(_0x55be56){_0x58ac28[_0xd5fd('0x1d')](0x1f4)['send'](_0x55be56);});});};exports[_0xd5fd('0x6a')]=function(_0x5a79cd,_0xa7c1d,_0x192f6c){return db[_0xd5fd('0x43')][_0xd5fd('0x6b')]({'where':{'id':_0x5a79cd[_0xd5fd('0x50')]['id']}})[_0xd5fd('0x40')](handleEntityNotFound(_0xa7c1d,null))[_0xd5fd('0x40')](function(_0x20c192){if(!_0x5a79cd[_0xd5fd('0x2f')][_0xd5fd('0x6c')]||!utils[_0xd5fd('0x6d')](_0x5a79cd[_0xd5fd('0x2f')][_0xd5fd('0x6c')])){throw new db['Sequelize'][(_0xd5fd('0x6e'))](_0xd5fd('0x6f'));}var _0x1b597f={};var _0x23be9c={};_0x23be9c[_0xd5fd('0x2d')]=_['keys'](db[_[_0xd5fd('0x70')](_0x5a79cd[_0xd5fd('0x2f')][_0xd5fd('0x6c')][_0xd5fd('0x71')]())+_0xd5fd('0x72')][_0xd5fd('0x73')]);_0x23be9c['query']=_[_0xd5fd('0x2e')](_0x5a79cd[_0xd5fd('0x2f')]);_0x23be9c[_0xd5fd('0x30')]=_[_0xd5fd('0x31')](_0x23be9c[_0xd5fd('0x2d')],_0x23be9c['query']);_0x1b597f['attributes']=_[_0xd5fd('0x31')](_0x23be9c['model'],qs[_0xd5fd('0x32')](_0x5a79cd[_0xd5fd('0x2f')][_0xd5fd('0x32')]));_0x1b597f['attributes']=_0x1b597f[_0xd5fd('0x33')][_0xd5fd('0x34')]?_0x1b597f[_0xd5fd('0x33')]:_0x23be9c[_0xd5fd('0x2d')];_0x1b597f[_0xd5fd('0x20')]=qs['limit'](_0x5a79cd[_0xd5fd('0x2f')][_0xd5fd('0x20')]);_0x1b597f['offset']=qs[_0xd5fd('0x1e')](_0x5a79cd['query'][_0xd5fd('0x1e')]);_0x1b597f[_0xd5fd('0x36')]=qs[_0xd5fd('0x37')](_0x5a79cd['query']['sort']);_0x1b597f[_0xd5fd('0x3a')]=qs[_0xd5fd('0x30')](_[_0xd5fd('0x38')](_0x5a79cd[_0xd5fd('0x2f')],_0x23be9c[_0xd5fd('0x30')]));_0x1b597f=_[_0xd5fd('0x3b')]({},_0x1b597f,_0x5a79cd['options']);return _0x20c192[_0xd5fd('0x4b')+_[_0xd5fd('0x70')](_0x5a79cd['query']['channel']['toLowerCase']())+_0xd5fd('0x74')](_0x1b597f);})[_0xd5fd('0x40')](respondWithResult(_0xa7c1d,null))['catch'](handleError(_0xa7c1d,null));};exports[_0xd5fd('0x75')]=function(_0x133cbf,_0x26875d,_0x22aaac){return db[_0xd5fd('0x43')]['findOne']({'where':{'id':_0x133cbf[_0xd5fd('0x50')]['id']}})[_0xd5fd('0x40')](function(_0x5ecad7){if(_0x5ecad7){if(!_0x133cbf[_0xd5fd('0x49')][_0xd5fd('0x6c')]||!utils[_0xd5fd('0x6d')](_0x133cbf['body'][_0xd5fd('0x6c')])){throw new db['Sequelize'][(_0xd5fd('0x6e'))]('Unknown\x20channel');}return _0x5ecad7[_0xd5fd('0x76')+_[_0xd5fd('0x70')](_0x133cbf['body']['channel']['toLowerCase']())+_0xd5fd('0x74')](_0x133cbf[_0xd5fd('0x49')][_0xd5fd('0x77')]);}return null;})['then'](handleEntityNotFound(_0x26875d,null))[_0xd5fd('0x40')](respondWithStatusCode(_0x26875d,null))[_0xd5fd('0x45')](handleError(_0x26875d,null));};exports[_0xd5fd('0x78')]=function(_0x417c8c,_0x254304,_0x5d9177){return db[_0xd5fd('0x43')][_0xd5fd('0x6b')]({'where':{'id':_0x417c8c[_0xd5fd('0x50')]['id']}})[_0xd5fd('0x40')](function(_0x15b332){if(_0x15b332){if(!_0x417c8c[_0xd5fd('0x2f')][_0xd5fd('0x6c')]||!utils[_0xd5fd('0x6d')](_0x417c8c[_0xd5fd('0x2f')][_0xd5fd('0x6c')])){throw new db[(_0xd5fd('0x59'))][(_0xd5fd('0x6e'))](_0xd5fd('0x6f'));}return _0x15b332[_0xd5fd('0x79')+_[_0xd5fd('0x70')](_0x417c8c[_0xd5fd('0x2f')]['channel'][_0xd5fd('0x71')]())+'Queues'](_0x417c8c['query'][_0xd5fd('0x77')]);}return null;})[_0xd5fd('0x40')](handleEntityNotFound(_0x254304,null))[_0xd5fd('0x40')](respondWithStatusCode(_0x254304,null))[_0xd5fd('0x45')](handleError(_0x254304,null));};exports['addAgents']=function(_0x270e5c,_0x289006){var _0x17f673=_[_0xd5fd('0x7a')](_0x270e5c[_0xd5fd('0x49')]['ids'])?_0x270e5c[_0xd5fd('0x49')][_0xd5fd('0x77')]:[_0x270e5c['body'][_0xd5fd('0x77')]];var _0x7137f6=_0x270e5c['params']['id'];return db[_0xd5fd('0x43')][_0xd5fd('0x47')]({'where':{'id':_0x7137f6}})[_0xd5fd('0x40')](handleEntityNotFound(_0x289006,null))[_0xd5fd('0x40')](function(_0x5da409){if(_0x5da409){var _0x19f085=[_0xd5fd('0x7b'),_0xd5fd('0x7c'),_0xd5fd('0x7d'),'Sms','Fax',_0xd5fd('0x7e'),_0xd5fd('0x7f')];return db['sequelize'][_0xd5fd('0x51')](function(_0x43f2f0){var _0x3afd42=_['map'](_0x19f085,function(_0x431e11){var _0x1469d6={'attributes':['id',_0xd5fd('0x3e')]};if(_0x431e11===_0xd5fd('0x7b')){_0x1469d6['through']={'attributes':['penalty']};}return _0x5da409['get'+_0x431e11+_0xd5fd('0x74')](_0x1469d6)['then'](function(_0x49c1b9){var _0x1b6a8d=_['map'](_0x49c1b9,function(_0x82f6ed){var _0x4978b0=_[_0xd5fd('0x3c')](_0x17f673,function(_0x3c5157){var _0x510d2b={'where':{'UserId':_0x3c5157,[_0x431e11+_0xd5fd('0x80')]:_0x82f6ed['id']},'transaction':_0x43f2f0};if(_0x431e11==='Voice'){_0x510d2b['defaults']={'penalty':_0x82f6ed['TeamVoiceQueue']['penalty']};}return db[_0xd5fd('0x81')+_0x431e11+'Queue'][_0xd5fd('0x82')](_0x510d2b)[_0xd5fd('0x40')](function(){socket['emit'](_0xd5fd('0x4a')+_0x431e11+_0xd5fd('0x83'),{'UserId':_0x3c5157,[_0x431e11+'QueueId']:_0x82f6ed['id']});if(_0x431e11!=='Voice'){return;}return db[_0xd5fd('0x81')][_0xd5fd('0x84')]({'where':{'id':_0x17f673,'online':0x1},'attributes':['id',_0xd5fd('0x3e'),_0xd5fd('0x85'),_0xd5fd('0x86'),_0xd5fd('0x87')],'raw':!![]})['then'](function(_0x35646e){var _0x1aa4c8=_[_0xd5fd('0x3c')](_0x35646e,function(_0x59dce9){return db['UserVoiceQueueRt'][_0xd5fd('0x88')]({'membername':_0x59dce9[_0xd5fd('0x3e')],'UserId':_0x59dce9['id'],'queue_name':_0x82f6ed[_0xd5fd('0x3e')],'VoiceQueueId':_0x82f6ed['id'],'interface':_[_0xd5fd('0x89')](_0x59dce9['interface'])?util[_0xd5fd('0x8a')]('SIP/%s',_0x59dce9[_0xd5fd('0x3e')]):_0x59dce9[_0xd5fd('0x87')],'paused':_0x59dce9[_0xd5fd('0x86')]||![],'penalty':_0x82f6ed[_0xd5fd('0x8b')][_0xd5fd('0x8c')]},{'transaction':_0x43f2f0});});return Promise[_0xd5fd('0x8d')](_0x1aa4c8);});});});return Promise[_0xd5fd('0x8d')](_0x4978b0);});return Promise['all'](_0x1b6a8d);})['then'](function(){return db[_0xd5fd('0x8e')][_0xd5fd('0x6b')]({'where':{'teamId':_0x7137f6}})[_0xd5fd('0x40')](function(_0x3a5335){if(_0x3a5335){var _0x56932e=_[_0xd5fd('0x3c')](_0x17f673,function(_0x4b5b20){db['UserVoicePrefix'][_0xd5fd('0x88')]({'UserId':_0x4b5b20,'VoicePrefixId':_0x3a5335[_0xd5fd('0x68')]});});return Promise[_0xd5fd('0x8d')](_0x56932e);}});});});return Promise[_0xd5fd('0x8d')](_0x3afd42)[_0xd5fd('0x40')](function(){return _0x5da409[_0xd5fd('0x8f')](_0x17f673,{'transaction':_0x43f2f0})[_0xd5fd('0x90')](function(_0xccb15f){return _0xccb15f;});});});}})[_0xd5fd('0x40')](respondWithResult(_0x289006,null))[_0xd5fd('0x45')](handleError(_0x289006,null));};exports[_0xd5fd('0x91')]=function(_0x1f5abd,_0x3faf98){var _0x7e2632=_[_0xd5fd('0x7a')](_0x1f5abd[_0xd5fd('0x2f')]['ids'])?_0x1f5abd[_0xd5fd('0x2f')]['ids']:[_0x1f5abd['query'][_0xd5fd('0x77')]];var _0x471895=_0x1f5abd[_0xd5fd('0x50')]['id'];return db[_0xd5fd('0x43')][_0xd5fd('0x47')]({'where':{'id':_0x471895}})['then'](handleEntityNotFound(_0x3faf98,null))['then'](function(_0x4c24fb){if(_0x4c24fb){var _0x3b3204=['Voice',_0xd5fd('0x7c'),_0xd5fd('0x7d'),_0xd5fd('0x92'),_0xd5fd('0x93'),_0xd5fd('0x7e'),_0xd5fd('0x7f')];return db[_0xd5fd('0x56')][_0xd5fd('0x51')](function(_0xf53070){var _0x5cf89c=_[_0xd5fd('0x3c')](_0x3b3204,function(_0x34d549){var _0xa7a10b={'attributes':['id',_0xd5fd('0x3e')]};return _0x4c24fb[_0xd5fd('0x4b')+_0x34d549+'Queues'](_0xa7a10b)['then'](function(_0x46ae5c){var _0x15eb5c=_[_0xd5fd('0x3c')](_0x46ae5c,function(_0x44306c){return _0x44306c[_0xd5fd('0x91')](_0x7e2632,{'transaction':_0xf53070})[_0xd5fd('0x40')](function(){var _0x5c2e72=_[_0xd5fd('0x3c')](_0x7e2632,function(_0x479d70){socket['emit']('user'+_0x34d549+_0xd5fd('0x94'),{'UserId':Number(_0x479d70),[_0x34d549+_0xd5fd('0x80')]:_0x44306c['id']});if(_0x34d549!==_0xd5fd('0x7b')){return;}return db[_0xd5fd('0x95')]['destroy']({'where':{'VoiceQueueId':_0x44306c['id'],'UserId':_0x479d70},'transaction':_0xf53070});});return Promise[_0xd5fd('0x8d')](_0x5c2e72);});});return Promise['all'](_0x15eb5c);});});return Promise[_0xd5fd('0x8d')](_0x5cf89c)[_0xd5fd('0x40')](function(){return _0x4c24fb[_0xd5fd('0x91')](_0x7e2632,{'transaction':_0xf53070});})[_0xd5fd('0x40')](function(){return db['TeamVoicePrefix'][_0xd5fd('0x6b')]({'where':{'teamId':_0x471895}})[_0xd5fd('0x40')](function(_0x27c109){if(_0x27c109){var _0x4a9e9b=_[_0xd5fd('0x3c')](_0x7e2632,function(_0x149977){db[_0xd5fd('0x67')][_0xd5fd('0x5b')]({'where':{'UserId':_0x149977,'VoicePrefixId':_0x27c109['VoicePrefixId']}});});return Promise[_0xd5fd('0x8d')](_0x4a9e9b);}});});});}})[_0xd5fd('0x40')](respondWithStatusCode(_0x3faf98,null))[_0xd5fd('0x45')](handleError(_0x3faf98,null));};exports['getAgents']=function(_0x3bc5e9,_0x3d1ca8,_0x226583){var _0x13b649={};var _0x3189ed={};var _0x351efd;var _0x52111f;return db[_0xd5fd('0x43')][_0xd5fd('0x6b')]({'where':{'id':_0x3bc5e9[_0xd5fd('0x50')]['id']}})[_0xd5fd('0x40')](handleEntityNotFound(_0x3d1ca8,null))[_0xd5fd('0x40')](function(_0x220f23){if(_0x220f23){_0x351efd=_0x220f23;_0x3189ed[_0xd5fd('0x2d')]=_[_0xd5fd('0x2e')](db[_0xd5fd('0x81')][_0xd5fd('0x73')]);_0x3189ed[_0xd5fd('0x2f')]=_[_0xd5fd('0x2e')](_0x3bc5e9[_0xd5fd('0x2f')]);_0x3189ed['filters']=_['intersection'](_0x3189ed[_0xd5fd('0x2d')],_0x3189ed[_0xd5fd('0x2f')]);_0x13b649['attributes']=_[_0xd5fd('0x31')](_0x3189ed['model'],qs[_0xd5fd('0x32')](_0x3bc5e9[_0xd5fd('0x2f')]['fields']));_0x13b649[_0xd5fd('0x33')]=_0x13b649['attributes']['length']?_0x13b649[_0xd5fd('0x33')]:_0x3189ed['model'];_0x13b649[_0xd5fd('0x36')]=qs[_0xd5fd('0x37')](_0x3bc5e9[_0xd5fd('0x2f')][_0xd5fd('0x37')]);_0x13b649[_0xd5fd('0x3a')]=qs[_0xd5fd('0x30')](_[_0xd5fd('0x38')](_0x3bc5e9[_0xd5fd('0x2f')],_0x3189ed['filters']));if(_0x3bc5e9[_0xd5fd('0x2f')][_0xd5fd('0x39')]){_0x13b649[_0xd5fd('0x3a')]=_['merge'](_0x13b649[_0xd5fd('0x3a')],{'$or':_[_0xd5fd('0x3c')](_0x13b649[_0xd5fd('0x33')],function(_0x59307c){var _0x2c0a84={};_0x2c0a84[_0x59307c]={'$like':'%'+_0x3bc5e9[_0xd5fd('0x2f')][_0xd5fd('0x39')]+'%'};return _0x2c0a84;})});}_0x13b649=_[_0xd5fd('0x3b')]({},_0x13b649,_0x3bc5e9[_0xd5fd('0x3f')]);return _0x351efd[_0xd5fd('0x96')](_0x13b649);}})['then'](function(_0x1fcafe){if(_0x1fcafe){_0x52111f=_0x1fcafe[_0xd5fd('0x34')];if(!_0x3bc5e9['query'][_0xd5fd('0x35')](_0xd5fd('0x97'))){_0x13b649[_0xd5fd('0x20')]=qs['limit'](_0x3bc5e9[_0xd5fd('0x2f')][_0xd5fd('0x20')]);_0x13b649[_0xd5fd('0x1e')]=qs['offset'](_0x3bc5e9[_0xd5fd('0x2f')]['offset']);}return _0x351efd['getAgents'](_0x13b649);}})[_0xd5fd('0x40')](function(_0x4ed577){if(_0x4ed577){return _0x4ed577?{'count':_0x52111f,'rows':_0x4ed577}:null;}})['then'](respondWithResult(_0x3d1ca8,null))[_0xd5fd('0x45')](handleError(_0x3d1ca8,null));}; \ No newline at end of file +var _0xea0c=['all','TeamVoicePrefix','spread','removeAgents','Whatsapp','Queue:remove','getAgents','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./team.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filter','merge','VIRTUAL','Team','includeAll','include','findAll','rows','show','params','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','destroy','sequelize','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','QueryTypes','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','Sequelize','VoiceQueueId','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','OpenchannelQueueId','UserOpenchannelQueue','UserWhatsappQueue','UserVoicePrefix','VoicePrefixId','Teams','getQueues','findOne','channel','isValidChannel','Unknown\x20channel','capitalize','toLowerCase','Queue','sort','pick','options','addQueues','ids','removeQueues','ValidationError','remove','addAgents','isArray','Voice','Chat','Mail','Sms','Fax','Openchannel','transaction','through','penalty','Queues','TeamVoiceQueue','User','emit','QueueId','voicePause','interface','UserVoiceQueueRt','upsert','format','SIP/%s'];(function(_0xff2d47,_0x189e5c){var _0x5d450=function(_0x5537c8){while(--_0x5537c8){_0xff2d47['push'](_0xff2d47['shift']());}};_0x5d450(++_0x189e5c);}(_0xea0c,0x13d));var _0xcea0=function(_0x64ec9f,_0x1308d9){_0x64ec9f=_0x64ec9f-0x0;var _0x1acec9=_0xea0c[_0x64ec9f];return _0x1acec9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcea0('0x0'));var zipdir=require(_0xcea0('0x1'));var jsonpatch=require(_0xcea0('0x2'));var rp=require('request-promise');var moment=require(_0xcea0('0x3'));var BPromise=require(_0xcea0('0x4'));var Mustache=require(_0xcea0('0x5'));var util=require(_0xcea0('0x6'));var path=require(_0xcea0('0x7'));var sox=require(_0xcea0('0x8'));var csv=require(_0xcea0('0x9'));var ejs=require(_0xcea0('0xa'));var fs=require('fs');var fs_extra=require(_0xcea0('0xb'));var _=require(_0xcea0('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xcea0('0xd'));var deskjs=require(_0xcea0('0xe'));var toCsv=require(_0xcea0('0x9'));var querystring=require(_0xcea0('0xf'));var Papa=require('papaparse');var Redis=require(_0xcea0('0x10'));var authService=require(_0xcea0('0x11'));var qs=require(_0xcea0('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcea0('0x13'));var logger=require(_0xcea0('0x14'))(_0xcea0('0x15'));var utils=require('../../config/utils');var config=require(_0xcea0('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xcea0('0x17'))['db'];config[_0xcea0('0x18')]=_[_0xcea0('0x19')](config[_0xcea0('0x18')],{'host':_0xcea0('0x1a'),'port':0x18eb});var socket=require(_0xcea0('0x1b'))(new Redis(config[_0xcea0('0x18')]));require(_0xcea0('0x1c'))[_0xcea0('0x1d')](socket);function respondWithStatusCode(_0x118824,_0x54c4be){_0x54c4be=_0x54c4be||0xcc;return function(_0x4d5811){if(_0x4d5811){return _0x118824[_0xcea0('0x1e')](_0x54c4be);}return _0x118824[_0xcea0('0x1f')](_0x54c4be)[_0xcea0('0x20')]();};}function respondWithResult(_0x358d3a,_0x5c86be){_0x5c86be=_0x5c86be||0xc8;return function(_0x1ea944){if(_0x1ea944){return _0x358d3a[_0xcea0('0x1f')](_0x5c86be)[_0xcea0('0x21')](_0x1ea944);}};}function respondWithFilteredResult(_0xbaa48b,_0x8ebc7f){return function(_0x182f89){if(_0x182f89){var _0x2d4c44=typeof _0x8ebc7f[_0xcea0('0x22')]==='undefined'&&typeof _0x8ebc7f[_0xcea0('0x23')]===_0xcea0('0x24');var _0x26f6bd=_0x182f89[_0xcea0('0x25')];var _0x597325=_0x2d4c44?0x0:_0x8ebc7f[_0xcea0('0x22')];var _0x55c5c6=_0x2d4c44?_0x182f89['count']:_0x8ebc7f[_0xcea0('0x22')]+_0x8ebc7f[_0xcea0('0x23')];var _0x241c57;if(_0x55c5c6>=_0x26f6bd){_0x55c5c6=_0x26f6bd;_0x241c57=0xc8;}else{_0x241c57=0xce;}_0xbaa48b['status'](_0x241c57);return _0xbaa48b['set'](_0xcea0('0x26'),_0x597325+'-'+_0x55c5c6+'/'+_0x26f6bd)[_0xcea0('0x21')](_0x182f89);}return null;};}function patchUpdates(_0x70e33f){return function(_0x55b416){try{jsonpatch[_0xcea0('0x27')](_0x55b416,_0x70e33f,!![]);}catch(_0x3d8ea6){return BPromise[_0xcea0('0x28')](_0x3d8ea6);}return _0x55b416[_0xcea0('0x29')]();};}function saveUpdates(_0x3bb244,_0x304879){return function(_0x3a7b29){if(_0x3a7b29){return _0x3a7b29[_0xcea0('0x2a')](_0x3bb244)[_0xcea0('0x2b')](function(_0x13f66e){return _0x13f66e;});}return null;};}function handleEntityNotFound(_0x2c6728,_0x3e9fae){return function(_0x3dd0a3){if(!_0x3dd0a3){_0x2c6728[_0xcea0('0x1e')](0x194);}return _0x3dd0a3;};}function handleError(_0x515831,_0x345f92){_0x345f92=_0x345f92||0x1f4;return function(_0x3fd771){logger[_0xcea0('0x2c')](_0x3fd771[_0xcea0('0x2d')]);if(_0x3fd771[_0xcea0('0x2e')]){delete _0x3fd771[_0xcea0('0x2e')];}_0x515831[_0xcea0('0x1f')](_0x345f92)[_0xcea0('0x2f')](_0x3fd771);};}exports[_0xcea0('0x30')]=function(_0x1468ea,_0x51a188){var _0x546aa2={},_0xc79130={},_0x8aa433={'count':0x0,'rows':[]};var _0x11f30a=_[_0xcea0('0x31')](db['Team'][_0xcea0('0x32')],function(_0x4ca4b2){return{'name':_0x4ca4b2[_0xcea0('0x33')],'type':_0x4ca4b2[_0xcea0('0x34')]['key']};});_0xc79130[_0xcea0('0x35')]=_[_0xcea0('0x31')](_0x11f30a,'name');_0xc79130[_0xcea0('0x36')]=_[_0xcea0('0x37')](_0x1468ea['query']);_0xc79130[_0xcea0('0x38')]=_[_0xcea0('0x39')](_0xc79130[_0xcea0('0x35')],_0xc79130[_0xcea0('0x36')]);_0x546aa2[_0xcea0('0x3a')]=_[_0xcea0('0x39')](_0xc79130['model'],qs[_0xcea0('0x3b')](_0x1468ea[_0xcea0('0x36')][_0xcea0('0x3b')]));_0x546aa2[_0xcea0('0x3a')]=_0x546aa2['attributes'][_0xcea0('0x3c')]?_0x546aa2[_0xcea0('0x3a')]:_0xc79130['model'];if(!_0x1468ea[_0xcea0('0x36')][_0xcea0('0x3d')](_0xcea0('0x3e'))){_0x546aa2[_0xcea0('0x23')]=qs[_0xcea0('0x23')](_0x1468ea[_0xcea0('0x36')][_0xcea0('0x23')]);_0x546aa2[_0xcea0('0x22')]=qs[_0xcea0('0x22')](_0x1468ea[_0xcea0('0x36')][_0xcea0('0x22')]);}_0x546aa2[_0xcea0('0x3f')]=qs['sort'](_0x1468ea[_0xcea0('0x36')]['sort']);_0x546aa2[_0xcea0('0x40')]=qs[_0xcea0('0x38')](_['pick'](_0x1468ea[_0xcea0('0x36')],_0xc79130[_0xcea0('0x38')]),_0x11f30a);if(_0x1468ea[_0xcea0('0x36')][_0xcea0('0x41')]){_0x546aa2[_0xcea0('0x40')]=_[_0xcea0('0x42')](_0x546aa2['where'],{'$or':_[_0xcea0('0x31')](_0x11f30a,function(_0x5f1df1){if(_0x5f1df1[_0xcea0('0x34')]!==_0xcea0('0x43')){var _0x25b63f={};_0x25b63f[_0x5f1df1[_0xcea0('0x2e')]]={'$like':'%'+_0x1468ea['query'][_0xcea0('0x41')]+'%'};return _0x25b63f;}})});}_0x546aa2=_[_0xcea0('0x42')]({},_0x546aa2,_0x1468ea['options']);var _0x5e0da9={'where':_0x546aa2[_0xcea0('0x40')]};return db[_0xcea0('0x44')]['count'](_0x5e0da9)[_0xcea0('0x2b')](function(_0x27cc69){_0x8aa433['count']=_0x27cc69;if(_0x1468ea[_0xcea0('0x36')][_0xcea0('0x45')]){_0x546aa2[_0xcea0('0x46')]=[{'all':!![]}];}return db[_0xcea0('0x44')][_0xcea0('0x47')](_0x546aa2);})['then'](function(_0x4a039d){_0x8aa433[_0xcea0('0x48')]=_0x4a039d;return _0x8aa433;})[_0xcea0('0x2b')](respondWithFilteredResult(_0x51a188,_0x546aa2))['catch'](handleError(_0x51a188,null));};exports[_0xcea0('0x49')]=function(_0x536874,_0x329a59){var _0x2aa6a9={'raw':![],'where':{'id':_0x536874[_0xcea0('0x4a')]['id']}},_0x47bbaa={};_0x47bbaa['model']=_[_0xcea0('0x37')](db['Team'][_0xcea0('0x32')]);_0x47bbaa[_0xcea0('0x36')]=_[_0xcea0('0x37')](_0x536874[_0xcea0('0x36')]);_0x47bbaa[_0xcea0('0x38')]=_[_0xcea0('0x39')](_0x47bbaa['model'],_0x47bbaa[_0xcea0('0x36')]);_0x2aa6a9[_0xcea0('0x3a')]=_['intersection'](_0x47bbaa[_0xcea0('0x35')],qs['fields'](_0x536874['query'][_0xcea0('0x3b')]));_0x2aa6a9['attributes']=_0x2aa6a9[_0xcea0('0x3a')][_0xcea0('0x3c')]?_0x2aa6a9[_0xcea0('0x3a')]:_0x47bbaa[_0xcea0('0x35')];if(_0x536874['query'][_0xcea0('0x45')]){_0x2aa6a9[_0xcea0('0x46')]=[{'all':!![]}];}_0x2aa6a9=_[_0xcea0('0x42')]({},_0x2aa6a9,_0x536874['options']);return db[_0xcea0('0x44')][_0xcea0('0x4b')](_0x2aa6a9)[_0xcea0('0x2b')](handleEntityNotFound(_0x329a59,null))['then'](respondWithResult(_0x329a59,null))['catch'](handleError(_0x329a59,null));};exports[_0xcea0('0x4c')]=function(_0x515e2f,_0x15acfb){return db[_0xcea0('0x44')][_0xcea0('0x4c')](_0x515e2f[_0xcea0('0x4d')],{})['then'](function(_0x59c8a7){var _0x372b39=_0x515e2f['user'][_0xcea0('0x4e')]({'plain':!![]});if(!_0x372b39)throw new Error(_0xcea0('0x4f'));if(_0x372b39['role']===_0xcea0('0x50')){var _0x2776b8=_0x59c8a7[_0xcea0('0x4e')]({'plain':!![]});var _0x5880b0='Teams';return db[_0xcea0('0x51')][_0xcea0('0x4b')]({'where':{'name':_0x5880b0,'userProfileId':_0x372b39[_0xcea0('0x52')]},'raw':!![]})[_0xcea0('0x2b')](function(_0x2dfd5e){if(_0x2dfd5e&&_0x2dfd5e[_0xcea0('0x53')]===0x0){return db[_0xcea0('0x54')][_0xcea0('0x4c')]({'name':_0x2776b8['name'],'resourceId':_0x2776b8['id'],'type':_0x2dfd5e[_0xcea0('0x2e')],'sectionId':_0x2dfd5e['id']},{})['then'](function(){return _0x59c8a7;});}else{return _0x59c8a7;}})['catch'](function(_0x58a891){logger['error'](_0xcea0('0x55'),_0x58a891);throw _0x58a891;});}return _0x59c8a7;})['then'](respondWithResult(_0x15acfb,0xc9))[_0xcea0('0x56')](handleError(_0x15acfb,null));};exports[_0xcea0('0x2a')]=function(_0x241c65,_0x56d368){if(_0x241c65[_0xcea0('0x4d')]['id']){delete _0x241c65[_0xcea0('0x4d')]['id'];}return db[_0xcea0('0x44')][_0xcea0('0x4b')]({'where':{'id':_0x241c65['params']['id']}})[_0xcea0('0x2b')](handleEntityNotFound(_0x56d368,null))[_0xcea0('0x2b')](saveUpdates(_0x241c65['body'],null))[_0xcea0('0x2b')](respondWithResult(_0x56d368,null))[_0xcea0('0x56')](handleError(_0x56d368,null));};exports[_0xcea0('0x57')]=function(_0x5511eb,_0x3f435a){var _0xe9f9c7=_0x5511eb[_0xcea0('0x4a')]['id'];var _0x2bd395=[];return db[_0xcea0('0x58')]['transaction'](function(_0x413f0c){var _0xf8d768=_0xcea0('0x59')+_0xe9f9c7;return db[_0xcea0('0x58')][_0xcea0('0x36')](_0xf8d768,{'type':db['Sequelize'][_0xcea0('0x5a')][_0xcea0('0x5b')],'raw':!![],'transaction':_0x413f0c})[_0xcea0('0x2b')](function(_0x2f2346){_0x2bd395=_[_0xcea0('0x31')](_0x2f2346,function(_0x592989){return Number(_0x592989[_0xcea0('0x5c')]);});})[_0xcea0('0x2b')](function(){var _0x4a1e49=_0xcea0('0x5d')+_0xe9f9c7;return db[_0xcea0('0x58')][_0xcea0('0x36')](_0x4a1e49,{'type':db[_0xcea0('0x5e')]['QueryTypes'][_0xcea0('0x5b')],'raw':!![],'transaction':_0x413f0c});})[_0xcea0('0x2b')](function(_0x112f53){var _0x4fb90a=_[_0xcea0('0x31')](_0x112f53,function(_0x3d233d){return Number(_0x3d233d[_0xcea0('0x5f')]);});return db['UserVoiceQueue'][_0xcea0('0x57')]({'where':{'UserId':{'$in':_0x2bd395},'VoiceQueueId':{'$in':_0x4fb90a}},'transaction':_0x413f0c});})[_0xcea0('0x2b')](function(){var _0xa47afb=_0xcea0('0x60')+_0xe9f9c7;return db[_0xcea0('0x58')][_0xcea0('0x36')](_0xa47afb,{'type':db[_0xcea0('0x5e')][_0xcea0('0x5a')][_0xcea0('0x5b')],'raw':!![],'transaction':_0x413f0c});})[_0xcea0('0x2b')](function(_0x14bdc0){var _0x3374bb=_[_0xcea0('0x31')](_0x14bdc0,function(_0x5f455e){return Number(_0x5f455e[_0xcea0('0x61')]);});return db['UserMailQueue'][_0xcea0('0x57')]({'where':{'UserId':{'$in':_0x2bd395},'MailQueueId':{'$in':_0x3374bb}},'transaction':_0x413f0c});})['then'](function(){var _0x5d10f5=_0xcea0('0x62')+_0xe9f9c7;return db['sequelize'][_0xcea0('0x36')](_0x5d10f5,{'type':db[_0xcea0('0x5e')][_0xcea0('0x5a')][_0xcea0('0x5b')],'raw':!![],'transaction':_0x413f0c});})[_0xcea0('0x2b')](function(_0x3dff7e){var _0x31d954=_[_0xcea0('0x31')](_0x3dff7e,function(_0x76ba34){return Number(_0x76ba34[_0xcea0('0x63')]);});return db[_0xcea0('0x64')][_0xcea0('0x57')]({'where':{'UserId':{'$in':_0x2bd395},'SmsQueueId':{'$in':_0x31d954}},'transaction':_0x413f0c});})['then'](function(){var _0x1c8c0f=_0xcea0('0x65')+_0xe9f9c7;return db[_0xcea0('0x58')]['query'](_0x1c8c0f,{'type':db[_0xcea0('0x5e')]['QueryTypes'][_0xcea0('0x5b')],'raw':!![],'transaction':_0x413f0c});})[_0xcea0('0x2b')](function(_0x33cb65){var _0x3e51aa=_[_0xcea0('0x31')](_0x33cb65,function(_0x112226){return Number(_0x112226[_0xcea0('0x66')]);});return db[_0xcea0('0x67')][_0xcea0('0x57')]({'where':{'UserId':{'$in':_0x2bd395},'ChatQueueId':{'$in':_0x3e51aa}},'transaction':_0x413f0c});})[_0xcea0('0x2b')](function(){var _0x3102f3='SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20'+_0xe9f9c7;return db[_0xcea0('0x58')][_0xcea0('0x36')](_0x3102f3,{'type':db[_0xcea0('0x5e')][_0xcea0('0x5a')]['SELECT'],'raw':!![],'transaction':_0x413f0c});})[_0xcea0('0x2b')](function(_0x2a7c7e){var _0x49c13c=_[_0xcea0('0x31')](_0x2a7c7e,function(_0x31d48d){return Number(_0x31d48d['FaxQueueId']);});return db['UserFaxQueue']['destroy']({'where':{'UserId':{'$in':_0x2bd395},'FaxQueueId':{'$in':_0x49c13c}},'transaction':_0x413f0c});})[_0xcea0('0x2b')](function(){var _0x8ae92='SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20'+_0xe9f9c7;return db['sequelize']['query'](_0x8ae92,{'type':db[_0xcea0('0x5e')]['QueryTypes'][_0xcea0('0x5b')],'raw':!![],'transaction':_0x413f0c});})[_0xcea0('0x2b')](function(_0x427a99){var _0x4aec84=_[_0xcea0('0x31')](_0x427a99,function(_0x22f66c){return Number(_0x22f66c[_0xcea0('0x68')]);});return db[_0xcea0('0x69')][_0xcea0('0x57')]({'where':{'UserId':{'$in':_0x2bd395},'OpenchannelQueueId':{'$in':_0x4aec84}},'transaction':_0x413f0c});})['then'](function(){var _0x4f4a38='SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20'+_0xe9f9c7;return db[_0xcea0('0x58')][_0xcea0('0x36')](_0x4f4a38,{'type':db[_0xcea0('0x5e')][_0xcea0('0x5a')]['SELECT'],'raw':!![],'transaction':_0x413f0c});})[_0xcea0('0x2b')](function(_0x56a128){var _0x1fa43c=_[_0xcea0('0x31')](_0x56a128,function(_0x5c412d){return Number(_0x5c412d['WhatsappQueueId']);});return db[_0xcea0('0x6a')][_0xcea0('0x57')]({'where':{'UserId':{'$in':_0x2bd395},'WhatsappQueueId':{'$in':_0x1fa43c}},'transaction':_0x413f0c});})[_0xcea0('0x2b')](function(){return db['TeamVoicePrefix'][_0xcea0('0x4b')]({'where':{'TeamId':_0xe9f9c7}});})[_0xcea0('0x2b')](function(_0x87a629){if(_0x87a629===null){return;}return db[_0xcea0('0x6b')][_0xcea0('0x57')]({'where':{'UserId':{'$in':_0x2bd395},'VoicePrefixId':_0x87a629[_0xcea0('0x6c')]},'transaction':_0x413f0c});})[_0xcea0('0x2b')](function(){return db[_0xcea0('0x44')][_0xcea0('0x57')]({'where':{'id':_0xe9f9c7},'cascade':!![],'transaction':_0x413f0c});})[_0xcea0('0x2b')](function(_0x428b11){if(_0x428b11===0x0){_0x3f435a[_0xcea0('0x1e')](0x194);}else{return db[_0xcea0('0x54')][_0xcea0('0x57')]({'where':{'type':_0xcea0('0x6d'),'resourceId':_0xe9f9c7},'cascade':!![],'transaction':_0x413f0c})[_0xcea0('0x2b')](function(){_0x3f435a[_0xcea0('0x1f')](0xcc)[_0xcea0('0x20')]();});}})[_0xcea0('0x56')](function(_0x25d3e4){_0x3f435a[_0xcea0('0x1f')](0x1f4)[_0xcea0('0x2f')](_0x25d3e4);});});};exports[_0xcea0('0x6e')]=function(_0x2db5a4,_0xeb834f,_0x5ef647){return db[_0xcea0('0x44')][_0xcea0('0x6f')]({'where':{'id':_0x2db5a4[_0xcea0('0x4a')]['id']}})['then'](handleEntityNotFound(_0xeb834f,null))[_0xcea0('0x2b')](function(_0x5595f8){if(!_0x2db5a4['query'][_0xcea0('0x70')]||!utils[_0xcea0('0x71')](_0x2db5a4[_0xcea0('0x36')]['channel'])){throw new db[(_0xcea0('0x5e'))]['ValidationError'](_0xcea0('0x72'));}var _0x130700={};var _0x1ac303={};_0x1ac303[_0xcea0('0x35')]=_[_0xcea0('0x37')](db[_[_0xcea0('0x73')](_0x2db5a4['query']['channel'][_0xcea0('0x74')]())+_0xcea0('0x75')][_0xcea0('0x32')]);_0x1ac303[_0xcea0('0x36')]=_[_0xcea0('0x37')](_0x2db5a4['query']);_0x1ac303[_0xcea0('0x38')]=_[_0xcea0('0x39')](_0x1ac303[_0xcea0('0x35')],_0x1ac303[_0xcea0('0x36')]);_0x130700[_0xcea0('0x3a')]=_[_0xcea0('0x39')](_0x1ac303[_0xcea0('0x35')],qs['fields'](_0x2db5a4[_0xcea0('0x36')][_0xcea0('0x3b')]));_0x130700[_0xcea0('0x3a')]=_0x130700[_0xcea0('0x3a')][_0xcea0('0x3c')]?_0x130700[_0xcea0('0x3a')]:_0x1ac303[_0xcea0('0x35')];_0x130700['limit']=qs['limit'](_0x2db5a4['query']['limit']);_0x130700[_0xcea0('0x22')]=qs[_0xcea0('0x22')](_0x2db5a4['query'][_0xcea0('0x22')]);_0x130700['order']=qs[_0xcea0('0x76')](_0x2db5a4[_0xcea0('0x36')][_0xcea0('0x76')]);_0x130700['where']=qs[_0xcea0('0x38')](_[_0xcea0('0x77')](_0x2db5a4[_0xcea0('0x36')],_0x1ac303[_0xcea0('0x38')]));_0x130700=_['merge']({},_0x130700,_0x2db5a4[_0xcea0('0x78')]);return _0x5595f8['get'+_[_0xcea0('0x73')](_0x2db5a4['query']['channel'][_0xcea0('0x74')]())+'Queues'](_0x130700);})[_0xcea0('0x2b')](respondWithResult(_0xeb834f,null))[_0xcea0('0x56')](handleError(_0xeb834f,null));};exports[_0xcea0('0x79')]=function(_0x1bc1eb,_0xe204a9,_0x1e49d5){return db['Team'][_0xcea0('0x6f')]({'where':{'id':_0x1bc1eb[_0xcea0('0x4a')]['id']}})[_0xcea0('0x2b')](function(_0x50e1ab){if(_0x50e1ab){if(!_0x1bc1eb[_0xcea0('0x4d')][_0xcea0('0x70')]||!utils[_0xcea0('0x71')](_0x1bc1eb[_0xcea0('0x4d')][_0xcea0('0x70')])){throw new db['Sequelize']['ValidationError'](_0xcea0('0x72'));}return _0x50e1ab['add'+_[_0xcea0('0x73')](_0x1bc1eb[_0xcea0('0x4d')]['channel'][_0xcea0('0x74')]())+'Queues'](_0x1bc1eb[_0xcea0('0x4d')][_0xcea0('0x7a')]);}return null;})[_0xcea0('0x2b')](handleEntityNotFound(_0xe204a9,null))[_0xcea0('0x2b')](respondWithStatusCode(_0xe204a9,null))[_0xcea0('0x56')](handleError(_0xe204a9,null));};exports[_0xcea0('0x7b')]=function(_0x639466,_0x4c43f6,_0x1c39c2){return db[_0xcea0('0x44')][_0xcea0('0x6f')]({'where':{'id':_0x639466['params']['id']}})[_0xcea0('0x2b')](function(_0x15b756){if(_0x15b756){if(!_0x639466[_0xcea0('0x36')][_0xcea0('0x70')]||!utils[_0xcea0('0x71')](_0x639466[_0xcea0('0x36')][_0xcea0('0x70')])){throw new db[(_0xcea0('0x5e'))][(_0xcea0('0x7c'))](_0xcea0('0x72'));}return _0x15b756[_0xcea0('0x7d')+_[_0xcea0('0x73')](_0x639466[_0xcea0('0x36')]['channel']['toLowerCase']())+'Queues'](_0x639466[_0xcea0('0x36')][_0xcea0('0x7a')]);}return null;})[_0xcea0('0x2b')](handleEntityNotFound(_0x4c43f6,null))[_0xcea0('0x2b')](respondWithStatusCode(_0x4c43f6,null))[_0xcea0('0x56')](handleError(_0x4c43f6,null));};exports[_0xcea0('0x7e')]=function(_0x18104d,_0x24ebd7){var _0x58f8aa=_[_0xcea0('0x7f')](_0x18104d[_0xcea0('0x4d')][_0xcea0('0x7a')])?_0x18104d[_0xcea0('0x4d')][_0xcea0('0x7a')]:[_0x18104d['body'][_0xcea0('0x7a')]];var _0x3d1b06=_0x18104d['params']['id'];return db[_0xcea0('0x44')]['find']({'where':{'id':_0x3d1b06}})[_0xcea0('0x2b')](handleEntityNotFound(_0x24ebd7,null))[_0xcea0('0x2b')](function(_0x302345){if(_0x302345){var _0x3cf1a7=[_0xcea0('0x80'),_0xcea0('0x81'),_0xcea0('0x82'),_0xcea0('0x83'),_0xcea0('0x84'),_0xcea0('0x85'),'Whatsapp'];return db[_0xcea0('0x58')][_0xcea0('0x86')](function(_0x57d1c3){var _0x86a473=_['map'](_0x3cf1a7,function(_0x1d649b){var _0xf33e45={'attributes':['id',_0xcea0('0x2e')]};if(_0x1d649b===_0xcea0('0x80')){_0xf33e45[_0xcea0('0x87')]={'attributes':[_0xcea0('0x88')]};}return _0x302345[_0xcea0('0x4e')+_0x1d649b+_0xcea0('0x89')](_0xf33e45)[_0xcea0('0x2b')](function(_0x2be92c){var _0x5db903=_[_0xcea0('0x31')](_0x2be92c,function(_0x65e6f5){var _0x45e0cf=_[_0xcea0('0x31')](_0x58f8aa,function(_0x50e1fe){var _0x4f6566={'where':{'UserId':_0x50e1fe,[_0x1d649b+'QueueId']:_0x65e6f5['id']},'transaction':_0x57d1c3};if(_0x1d649b===_0xcea0('0x80')){_0x4f6566[_0xcea0('0x19')]={'penalty':_0x65e6f5[_0xcea0('0x8a')][_0xcea0('0x88')]};}return db[_0xcea0('0x8b')+_0x1d649b+_0xcea0('0x75')]['findOrCreate'](_0x4f6566)['then'](function(){socket[_0xcea0('0x8c')](_0xcea0('0x50')+_0x1d649b+'Queue:save',{'UserId':_0x50e1fe,[_0x1d649b+_0xcea0('0x8d')]:_0x65e6f5['id']});if(_0x1d649b!==_0xcea0('0x80')){return;}return db[_0xcea0('0x8b')]['findAll']({'where':{'id':_0x58f8aa,'online':0x1},'attributes':['id',_0xcea0('0x2e'),'online',_0xcea0('0x8e'),_0xcea0('0x8f')],'raw':!![]})[_0xcea0('0x2b')](function(_0x2b2e51){var _0x3523ee=_[_0xcea0('0x31')](_0x2b2e51,function(_0x12bd94){return db[_0xcea0('0x90')][_0xcea0('0x91')]({'membername':_0x12bd94[_0xcea0('0x2e')],'UserId':_0x12bd94['id'],'queue_name':_0x65e6f5[_0xcea0('0x2e')],'VoiceQueueId':_0x65e6f5['id'],'interface':_['isNil'](_0x12bd94['interface'])?util[_0xcea0('0x92')](_0xcea0('0x93'),_0x12bd94[_0xcea0('0x2e')]):_0x12bd94[_0xcea0('0x8f')],'paused':_0x12bd94[_0xcea0('0x8e')]||![],'penalty':_0x65e6f5[_0xcea0('0x8a')][_0xcea0('0x88')]},{'transaction':_0x57d1c3});});return Promise[_0xcea0('0x94')](_0x3523ee);});});});return Promise[_0xcea0('0x94')](_0x45e0cf);});return Promise[_0xcea0('0x94')](_0x5db903);})['then'](function(){return db[_0xcea0('0x95')][_0xcea0('0x6f')]({'where':{'teamId':_0x3d1b06}})[_0xcea0('0x2b')](function(_0x28072a){if(_0x28072a){var _0x1eccf1=_[_0xcea0('0x31')](_0x58f8aa,function(_0x2d7163){db[_0xcea0('0x6b')]['upsert']({'UserId':_0x2d7163,'VoicePrefixId':_0x28072a['VoicePrefixId']});});return Promise['all'](_0x1eccf1);}});});});return Promise['all'](_0x86a473)[_0xcea0('0x2b')](function(){return _0x302345[_0xcea0('0x7e')](_0x58f8aa,{'transaction':_0x57d1c3})[_0xcea0('0x96')](function(_0x4259bd){return _0x4259bd;});});});}})[_0xcea0('0x2b')](respondWithResult(_0x24ebd7,null))[_0xcea0('0x56')](handleError(_0x24ebd7,null));};exports[_0xcea0('0x97')]=function(_0x16a507,_0xf024b2){var _0x293fa2=_['isArray'](_0x16a507[_0xcea0('0x36')][_0xcea0('0x7a')])?_0x16a507[_0xcea0('0x36')]['ids']:[_0x16a507[_0xcea0('0x36')]['ids']];var _0x4168df=_0x16a507['params']['id'];return db['Team'][_0xcea0('0x4b')]({'where':{'id':_0x4168df}})[_0xcea0('0x2b')](handleEntityNotFound(_0xf024b2,null))[_0xcea0('0x2b')](function(_0xdf8f7){if(_0xdf8f7){var _0x1ca542=['Voice',_0xcea0('0x81'),_0xcea0('0x82'),_0xcea0('0x83'),'Fax',_0xcea0('0x85'),_0xcea0('0x98')];return db[_0xcea0('0x58')][_0xcea0('0x86')](function(_0x4495f4){var _0xc65fc5=_['map'](_0x1ca542,function(_0x5c3305){var _0x21fcc4={'attributes':['id',_0xcea0('0x2e')]};return _0xdf8f7[_0xcea0('0x4e')+_0x5c3305+_0xcea0('0x89')](_0x21fcc4)[_0xcea0('0x2b')](function(_0x21609c){var _0x10c7a6=_['map'](_0x21609c,function(_0x1317df){return _0x1317df[_0xcea0('0x97')](_0x293fa2,{'transaction':_0x4495f4})[_0xcea0('0x2b')](function(){var _0x2fd710=_['map'](_0x293fa2,function(_0x4e0a4f){socket[_0xcea0('0x8c')](_0xcea0('0x50')+_0x5c3305+_0xcea0('0x99'),{'UserId':Number(_0x4e0a4f),[_0x5c3305+_0xcea0('0x8d')]:_0x1317df['id']});if(_0x5c3305!=='Voice'){return;}return db[_0xcea0('0x90')][_0xcea0('0x57')]({'where':{'VoiceQueueId':_0x1317df['id'],'UserId':_0x4e0a4f},'transaction':_0x4495f4});});return Promise['all'](_0x2fd710);});});return Promise[_0xcea0('0x94')](_0x10c7a6);});});return Promise[_0xcea0('0x94')](_0xc65fc5)[_0xcea0('0x2b')](function(){return _0xdf8f7[_0xcea0('0x97')](_0x293fa2,{'transaction':_0x4495f4});})[_0xcea0('0x2b')](function(){return db[_0xcea0('0x95')][_0xcea0('0x6f')]({'where':{'teamId':_0x4168df}})[_0xcea0('0x2b')](function(_0x325b9c){if(_0x325b9c){var _0x5a0657=_[_0xcea0('0x31')](_0x293fa2,function(_0x21dc7a){db[_0xcea0('0x6b')]['destroy']({'where':{'UserId':_0x21dc7a,'VoicePrefixId':_0x325b9c[_0xcea0('0x6c')]}});});return Promise['all'](_0x5a0657);}});});});}})[_0xcea0('0x2b')](respondWithStatusCode(_0xf024b2,null))[_0xcea0('0x56')](handleError(_0xf024b2,null));};exports['getAgents']=function(_0x27d37c,_0x3e09d1,_0x447061){var _0x183cfb={};var _0x43bfb4={};var _0x490a98;var _0x46974a;return db[_0xcea0('0x44')][_0xcea0('0x6f')]({'where':{'id':_0x27d37c[_0xcea0('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3e09d1,null))[_0xcea0('0x2b')](function(_0x552fd3){if(_0x552fd3){_0x490a98=_0x552fd3;_0x43bfb4[_0xcea0('0x35')]=_['keys'](db['User'][_0xcea0('0x32')]);_0x43bfb4[_0xcea0('0x36')]=_[_0xcea0('0x37')](_0x27d37c['query']);_0x43bfb4[_0xcea0('0x38')]=_[_0xcea0('0x39')](_0x43bfb4['model'],_0x43bfb4['query']);_0x183cfb['attributes']=_[_0xcea0('0x39')](_0x43bfb4[_0xcea0('0x35')],qs[_0xcea0('0x3b')](_0x27d37c[_0xcea0('0x36')][_0xcea0('0x3b')]));_0x183cfb[_0xcea0('0x3a')]=_0x183cfb['attributes']['length']?_0x183cfb[_0xcea0('0x3a')]:_0x43bfb4['model'];_0x183cfb[_0xcea0('0x3f')]=qs[_0xcea0('0x76')](_0x27d37c['query']['sort']);_0x183cfb[_0xcea0('0x40')]=qs[_0xcea0('0x38')](_[_0xcea0('0x77')](_0x27d37c[_0xcea0('0x36')],_0x43bfb4[_0xcea0('0x38')]));if(_0x27d37c[_0xcea0('0x36')][_0xcea0('0x41')]){_0x183cfb[_0xcea0('0x40')]=_[_0xcea0('0x42')](_0x183cfb[_0xcea0('0x40')],{'$or':_[_0xcea0('0x31')](_0x183cfb[_0xcea0('0x3a')],function(_0x4acc06){var _0x1b0988={};_0x1b0988[_0x4acc06]={'$like':'%'+_0x27d37c[_0xcea0('0x36')][_0xcea0('0x41')]+'%'};return _0x1b0988;})});}_0x183cfb=_[_0xcea0('0x42')]({},_0x183cfb,_0x27d37c['options']);return _0x490a98[_0xcea0('0x9a')](_0x183cfb);}})[_0xcea0('0x2b')](function(_0x38bf7a){if(_0x38bf7a){_0x46974a=_0x38bf7a[_0xcea0('0x3c')];if(!_0x27d37c[_0xcea0('0x36')]['hasOwnProperty']('nolimit')){_0x183cfb['limit']=qs['limit'](_0x27d37c[_0xcea0('0x36')]['limit']);_0x183cfb[_0xcea0('0x22')]=qs['offset'](_0x27d37c[_0xcea0('0x36')]['offset']);}return _0x490a98[_0xcea0('0x9a')](_0x183cfb);}})[_0xcea0('0x2b')](function(_0x79cb8){if(_0x79cb8){return _0x79cb8?{'count':_0x46974a,'rows':_0x79cb8}:null;}})[_0xcea0('0x2b')](respondWithResult(_0x3e09d1,null))[_0xcea0('0x56')](handleError(_0x3e09d1,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index a8ee537..ceb930a 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 _0x86b4=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','Team','save','remove'];(function(_0x3f66dc,_0x4955ec){var _0xd32776=function(_0x20c568){while(--_0x20c568){_0x3f66dc['push'](_0x3f66dc['shift']());}};_0xd32776(++_0x4955ec);}(_0x86b4,0xc1));var _0x486b=function(_0x537e9b,_0x4dcba1){_0x537e9b=_0x537e9b-0x0;var _0x224e04=_0x86b4[_0x537e9b];return _0x224e04;};'use strict';var EventEmitter=require(_0x486b('0x0'));var Team=require(_0x486b('0x1'))['db'][_0x486b('0x2')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x486b('0x3'),'afterUpdate':'update','afterDestroy':_0x486b('0x4')};function emitEvent(_0x2949ee){return function(_0x382e72,_0x495e6f,_0x5cbcac){TeamEvents[_0x486b('0x5')](_0x2949ee+':'+_0x382e72['id'],_0x382e72);TeamEvents[_0x486b('0x5')](_0x2949ee,_0x382e72);_0x5cbcac(null);};}for(var e in events){if(events[_0x486b('0x6')](e)){var event=events[e];Team[_0x486b('0x7')](e,emitEvent(event));}}module[_0x486b('0x8')]=TeamEvents; \ No newline at end of file +var _0x3216=['exports','../../mysqldb','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x272eed,_0x3e63a0){var _0x4a3f4a=function(_0x42cd23){while(--_0x42cd23){_0x272eed['push'](_0x272eed['shift']());}};_0x4a3f4a(++_0x3e63a0);}(_0x3216,0x1b1));var _0x6321=function(_0x72895a,_0x433607){_0x72895a=_0x72895a-0x0;var _0x5226d5=_0x3216[_0x72895a];return _0x5226d5;};'use strict';var EventEmitter=require('events');var Team=require(_0x6321('0x0'))['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents[_0x6321('0x1')](0x0);var events={'afterCreate':_0x6321('0x2'),'afterUpdate':_0x6321('0x3'),'afterDestroy':'remove'};function emitEvent(_0x50646a){return function(_0x31c6c2,_0x59d773,_0x14c68c){TeamEvents[_0x6321('0x4')](_0x50646a+':'+_0x31c6c2['id'],_0x31c6c2);TeamEvents[_0x6321('0x4')](_0x50646a,_0x31c6c2);_0x14c68c(null);};}for(var e in events){if(events[_0x6321('0x5')](e)){var event=events[e];Team[_0x6321('0x6')](e,emitEvent(event));}}module[_0x6321('0x7')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 3001aa5..215fbeb 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 _0xf3f5=['Whatsapp','then','all','./team.attributes','get','Queues','setDataValue','channel','catch','exports','define','Team','teams','Chat','Fax','Mail','Openchannel','Sms','Voice'];(function(_0x43f6bb,_0x5d3a4b){var _0xa4a42f=function(_0x356ffd){while(--_0x356ffd){_0x43f6bb['push'](_0x43f6bb['shift']());}};_0xa4a42f(++_0x5d3a4b);}(_0xf3f5,0x120));var _0x5f3f=function(_0x316ec5,_0x307962){_0x316ec5=_0x316ec5-0x0;var _0xfc3637=_0xf3f5[_0x316ec5];return _0xfc3637;};'use strict';var _=require('lodash');var attributes=require(_0x5f3f('0x0'));function getQueuesByChannel(_0x5e4540,_0x3ef032){var _0x4cac8d=_0x5f3f('0x1')+_0x3ef032+_0x5f3f('0x2');return _0x5e4540[_0x4cac8d]()['then'](function(_0x14cf24){return _['map'](_0x14cf24,function(_0xa0173b){_0xa0173b[_0x5f3f('0x3')](_0x5f3f('0x4'),_0x3ef032);return _0xa0173b;});})[_0x5f3f('0x5')](function(_0x390361){throw _0x390361;});}module[_0x5f3f('0x6')]=function(_0x3a268d){return _0x3a268d[_0x5f3f('0x7')](_0x5f3f('0x8'),attributes,{'tableName':_0x5f3f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x3d7dc4=this;var _0x43072e=[_0x5f3f('0xa'),_0x5f3f('0xb'),_0x5f3f('0xc'),_0x5f3f('0xd'),_0x5f3f('0xe'),_0x5f3f('0xf'),_0x5f3f('0x10')];return Promise['resolve']()[_0x5f3f('0x11')](function(){var _0x687542=_['map'](_0x43072e,function(_0x8327e9){return getQueuesByChannel(_0x3d7dc4,_0x8327e9);});return Promise[_0x5f3f('0x12')](_0x687542);})[_0x5f3f('0x5')](function(_0x32d314){throw _0x32d314;});}}});}; \ No newline at end of file +var _0xa282=['Voice','Whatsapp','all','./team.attributes','get','Queues','map','channel','catch','exports','Team','teams','Chat','Fax'];(function(_0x146a85,_0x529b52){var _0x1b59bf=function(_0x4af0fd){while(--_0x4af0fd){_0x146a85['push'](_0x146a85['shift']());}};_0x1b59bf(++_0x529b52);}(_0xa282,0x161));var _0x2a28=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0xa282[_0x68c979];return _0x4f0001;};'use strict';var _=require('lodash');var attributes=require(_0x2a28('0x0'));function getQueuesByChannel(_0x191fa3,_0x1ea684){var _0x10ac4a=_0x2a28('0x1')+_0x1ea684+_0x2a28('0x2');return _0x191fa3[_0x10ac4a]()['then'](function(_0x205a56){return _[_0x2a28('0x3')](_0x205a56,function(_0x7f2a47){_0x7f2a47['setDataValue'](_0x2a28('0x4'),_0x1ea684);return _0x7f2a47;});})[_0x2a28('0x5')](function(_0x37963f){throw _0x37963f;});}module[_0x2a28('0x6')]=function(_0x5d3142){return _0x5d3142['define'](_0x2a28('0x7'),attributes,{'tableName':_0x2a28('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x440399=this;var _0x55e1c1=[_0x2a28('0x9'),_0x2a28('0xa'),'Mail','Openchannel','Sms',_0x2a28('0xb'),_0x2a28('0xc')];return Promise['resolve']()['then'](function(){var _0x4ceb65=_[_0x2a28('0x3')](_0x55e1c1,function(_0x2100fc){return getQueuesByChannel(_0x440399,_0x2100fc);});return Promise[_0x2a28('0xd')](_0x4ceb65);})[_0x2a28('0x5')](function(_0x50ecce){throw _0x50ecce;});}}});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 1adceb8..b5184c8 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 _0xff52=['jayson/promise','http','redis','defaults','register','request','then','info','request\x20sent','debug','stringify','error','Team,\x20%s,\x20%s','message','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x5d6d72,_0x421be5){var _0x4f5983=function(_0x5aeb8f){while(--_0x5aeb8f){_0x5d6d72['push'](_0x5d6d72['shift']());}};_0x4f5983(++_0x421be5);}(_0xff52,0x1a7));var _0x2ff5=function(_0x5f0d94,_0x5618be){_0x5f0d94=_0x5f0d94-0x0;var _0x4fe50d=_0xff52[_0x5f0d94];return _0x4fe50d;};'use strict';var _=require(_0x2ff5('0x0'));var util=require(_0x2ff5('0x1'));var moment=require('moment');var BPromise=require(_0x2ff5('0x2'));var rs=require(_0x2ff5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2ff5('0x4'))['db'];var utils=require(_0x2ff5('0x5'));var logger=require(_0x2ff5('0x6'))(_0x2ff5('0x7'));var config=require(_0x2ff5('0x8'));var jayson=require(_0x2ff5('0x9'));var client=jayson['client'][_0x2ff5('0xa')]({'port':0x232a});config[_0x2ff5('0xb')]=_[_0x2ff5('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2ff5('0xb')]));require('./team.socket')[_0x2ff5('0xd')](socket);function respondWithRpcPromise(_0x158b8a,_0x2bd157,_0x3a9fc9){return new BPromise(function(_0x1e385b,_0x4c747d){return client[_0x2ff5('0xe')](_0x158b8a,_0x3a9fc9)[_0x2ff5('0xf')](function(_0x15c408){logger[_0x2ff5('0x10')]('Team,\x20%s,\x20%s',_0x2bd157,_0x2ff5('0x11'));logger[_0x2ff5('0x12')]('Team,\x20%s,\x20%s,\x20%s',_0x2bd157,_0x2ff5('0x11'),JSON[_0x2ff5('0x13')](_0x15c408));if(_0x15c408[_0x2ff5('0x14')]){if(_0x15c408[_0x2ff5('0x14')]['code']===0x1f4){logger[_0x2ff5('0x14')](_0x2ff5('0x15'),_0x2bd157,_0x15c408[_0x2ff5('0x14')]['message']);return _0x4c747d(_0x15c408[_0x2ff5('0x14')]['message']);}logger['error'](_0x2ff5('0x15'),_0x2bd157,_0x15c408[_0x2ff5('0x14')]['message']);return _0x1e385b(_0x15c408[_0x2ff5('0x14')][_0x2ff5('0x16')]);}else{logger[_0x2ff5('0x10')](_0x2ff5('0x15'),_0x2bd157,'request\x20sent');_0x1e385b(_0x15c408['result'][_0x2ff5('0x16')]);}})[_0x2ff5('0x17')](function(_0x527d6f){logger[_0x2ff5('0x14')](_0x2ff5('0x15'),_0x2bd157,_0x527d6f);_0x4c747d(_0x527d6f);});});} \ No newline at end of file +var _0x07aa=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','localhost','./team.socket','request','then','Team,\x20%s,\x20%s','request\x20sent','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x3e5264,_0x14f026){var _0x42f75c=function(_0x3858a0){while(--_0x3858a0){_0x3e5264['push'](_0x3e5264['shift']());}};_0x42f75c(++_0x14f026);}(_0x07aa,0x1f2));var _0xa07a=function(_0x3b69ae,_0x1b7525){_0x3b69ae=_0x3b69ae-0x0;var _0x59ec5e=_0x07aa[_0x3b69ae];return _0x59ec5e;};'use strict';var _=require(_0xa07a('0x0'));var util=require(_0xa07a('0x1'));var moment=require(_0xa07a('0x2'));var BPromise=require(_0xa07a('0x3'));var rs=require(_0xa07a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa07a('0x5'))['db'];var utils=require(_0xa07a('0x6'));var logger=require(_0xa07a('0x7'))(_0xa07a('0x8'));var config=require(_0xa07a('0x9'));var jayson=require(_0xa07a('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0xa07a('0xb')]=_['defaults'](config[_0xa07a('0xb')],{'host':_0xa07a('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa07a('0xb')]));require(_0xa07a('0xd'))['register'](socket);function respondWithRpcPromise(_0x24d514,_0xfa1975,_0x30975a){return new BPromise(function(_0x28008a,_0x54b024){return client[_0xa07a('0xe')](_0x24d514,_0x30975a)[_0xa07a('0xf')](function(_0x74530){logger['info'](_0xa07a('0x10'),_0xfa1975,_0xa07a('0x11'));logger['debug'](_0xa07a('0x12'),_0xfa1975,_0xa07a('0x11'),JSON[_0xa07a('0x13')](_0x74530));if(_0x74530[_0xa07a('0x14')]){if(_0x74530['error'][_0xa07a('0x15')]===0x1f4){logger[_0xa07a('0x14')](_0xa07a('0x10'),_0xfa1975,_0x74530[_0xa07a('0x14')][_0xa07a('0x16')]);return _0x54b024(_0x74530['error'][_0xa07a('0x16')]);}logger[_0xa07a('0x14')](_0xa07a('0x10'),_0xfa1975,_0x74530['error']['message']);return _0x28008a(_0x74530[_0xa07a('0x14')][_0xa07a('0x16')]);}else{logger['info'](_0xa07a('0x10'),_0xfa1975,'request\x20sent');_0x28008a(_0x74530[_0xa07a('0x17')][_0xa07a('0x16')]);}})[_0xa07a('0x18')](function(_0x28e6d3){logger['error'](_0xa07a('0x10'),_0xfa1975,_0x28e6d3);_0x54b024(_0x28e6d3);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 4b333c4..22bee69 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 _0x51c5=['save','remove','update','removeListener','register','length','team:','./team.events'];(function(_0x30ba92,_0x3e8227){var _0x3eb360=function(_0x465659){while(--_0x465659){_0x30ba92['push'](_0x30ba92['shift']());}};_0x3eb360(++_0x3e8227);}(_0x51c5,0x8f));var _0x551c=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x51c5[_0x40a045];return _0x1a687c;};'use strict';var TeamEvents=require(_0x551c('0x0'));var events=[_0x551c('0x1'),_0x551c('0x2'),_0x551c('0x3')];function createListener(_0x3b6f53,_0x2279a3){return function(_0xe03709){_0x2279a3['emit'](_0x3b6f53,_0xe03709);};}function removeListener(_0x230657,_0x1639d0){return function(){TeamEvents[_0x551c('0x4')](_0x230657,_0x1639d0);};}exports[_0x551c('0x5')]=function(_0xe0272c){for(var _0x1aa8df=0x0,_0x21dfa1=events[_0x551c('0x6')];_0x1aa8df<_0x21dfa1;_0x1aa8df++){var _0x4f3a0a=events[_0x1aa8df];var _0x414edb=createListener(_0x551c('0x7')+_0x4f3a0a,_0xe0272c);TeamEvents['on'](_0x4f3a0a,_0x414edb);}}; \ No newline at end of file +var _0xaa53=['register','length','./team.events','save','remove','removeListener'];(function(_0x2d5805,_0x21954e){var _0x1cae4f=function(_0x53ff24){while(--_0x53ff24){_0x2d5805['push'](_0x2d5805['shift']());}};_0x1cae4f(++_0x21954e);}(_0xaa53,0xb0));var _0x3aa5=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xaa53[_0x14add3];return _0x4a174f;};'use strict';var TeamEvents=require(_0x3aa5('0x0'));var events=[_0x3aa5('0x1'),_0x3aa5('0x2'),'update'];function createListener(_0x5cd585,_0x3a6840){return function(_0x25478e){_0x3a6840['emit'](_0x5cd585,_0x25478e);};}function removeListener(_0xd7a500,_0x4869e6){return function(){TeamEvents[_0x3aa5('0x3')](_0xd7a500,_0x4869e6);};}exports[_0x3aa5('0x4')]=function(_0x2c0962){for(var _0xe00d41=0x0,_0x3a2b89=events[_0x3aa5('0x5')];_0xe00d41<_0x3a2b89;_0xe00d41++){var _0x458361=events[_0xe00d41];var _0x4215b1=createListener('team:'+_0x458361,_0x2c0962);TeamEvents['on'](_0x458361,_0x4215b1);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 42af06c..968e762 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 _0x1599=['exports','INTEGER','sequelize'];(function(_0x4b66de,_0x2e204d){var _0x5e6392=function(_0x3996d9){while(--_0x3996d9){_0x4b66de['push'](_0x4b66de['shift']());}};_0x5e6392(++_0x2e204d);}(_0x1599,0xaa));var _0x9159=function(_0x324f62,_0x2d0b1c){_0x324f62=_0x324f62-0x0;var _0x2b82cd=_0x1599[_0x324f62];return _0x2b82cd;};'use strict';var Sequelize=require(_0x9159('0x0'));module[_0x9159('0x1')]={'TeamId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0x9159('0x2')]}}; \ No newline at end of file +var _0xdeee=['exports','INTEGER'];(function(_0x327027,_0x554b7e){var _0x4a9067=function(_0x49c73c){while(--_0x49c73c){_0x327027['push'](_0x327027['shift']());}};_0x4a9067(++_0x554b7e);}(_0xdeee,0x10a));var _0xedee=function(_0x1a47ef,_0x355e08){_0x1a47ef=_0x1a47ef-0x0;var _0x17cd01=_0xdeee[_0x1a47ef];return _0x17cd01;};'use strict';var Sequelize=require('sequelize');module[_0xedee('0x0')]={'TeamId':{'type':Sequelize[_0xedee('0x1')]},'VoicePrefixId':{'type':Sequelize[_0xedee('0x1')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index 6c5a0c4..ff694d4 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 _0x349e=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./teamVoicePrefix.attributes','TeamVoicePrefix','team_has_voice_prefixes','lodash'];(function(_0x59733d,_0x266cbe){var _0x4d8e4d=function(_0xa373a4){while(--_0xa373a4){_0x59733d['push'](_0x59733d['shift']());}};_0x4d8e4d(++_0x266cbe);}(_0x349e,0xcb));var _0xe349=function(_0x5242af,_0x45c990){_0x5242af=_0x5242af-0x0;var _0x39ce20=_0x349e[_0x5242af];return _0x39ce20;};'use strict';var _=require(_0xe349('0x0'));var util=require(_0xe349('0x1'));var logger=require(_0xe349('0x2'))(_0xe349('0x3'));var moment=require(_0xe349('0x4'));var BPromise=require(_0xe349('0x5'));var rp=require(_0xe349('0x6'));var fs=require('fs');var path=require(_0xe349('0x7'));var rimraf=require(_0xe349('0x8'));var config=require('../../config/environment');var attributes=require(_0xe349('0x9'));module['exports']=function(_0x55aae6,_0xb21068){return _0x55aae6['define'](_0xe349('0xa'),attributes,{'tableName':_0xe349('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeb74=['rimraf','../../config/environment','./teamVoicePrefix.attributes','exports','define','team_has_voice_prefixes','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x56e8f3,_0x197598){var _0x509f61=function(_0x441125){while(--_0x441125){_0x56e8f3['push'](_0x56e8f3['shift']());}};_0x509f61(++_0x197598);}(_0xeb74,0xe3));var _0x4eb7=function(_0x393ff0,_0x407e32){_0x393ff0=_0x393ff0-0x0;var _0x12208e=_0xeb74[_0x393ff0];return _0x12208e;};'use strict';var _=require(_0x4eb7('0x0'));var util=require(_0x4eb7('0x1'));var logger=require(_0x4eb7('0x2'))(_0x4eb7('0x3'));var moment=require(_0x4eb7('0x4'));var BPromise=require(_0x4eb7('0x5'));var rp=require(_0x4eb7('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4eb7('0x7'));var config=require(_0x4eb7('0x8'));var attributes=require(_0x4eb7('0x9'));module[_0x4eb7('0xa')]=function(_0xa6e086,_0x563d6e){return _0xa6e086[_0x4eb7('0xb')]('TeamVoicePrefix',attributes,{'tableName':_0x4eb7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index a06c627..673b9cf 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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x4b93e1,_0x388f8f){var _0x685e10=function(_0x27520c){while(--_0x27520c){_0x4b93e1['push'](_0x4b93e1['shift']());}};_0x685e10(++_0x388f8f);}(_0xedd9,0xfc));var _0x9edd=function(_0xd9bde1,_0x5efeef){_0xd9bde1=_0xd9bde1-0x0;var _0xf30000=_0xedd9[_0xd9bde1];return _0xf30000;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x32aa7c,_0x4280f7){var _0xbbacae=function(_0x556c6f){while(--_0x556c6f){_0x32aa7c['push'](_0x32aa7c['shift']());}};_0xbbacae(++_0x4280f7);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 075ea6a..1f9cb04 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 _0x19a5=['sequelize','exports'];(function(_0x513047,_0x2199c5){var _0x15b779=function(_0x412fd5){while(--_0x412fd5){_0x513047['push'](_0x513047['shift']());}};_0x15b779(++_0x2199c5);}(_0x19a5,0x1cc));var _0x519a=function(_0x37a0bc,_0x3c4053){_0x37a0bc=_0x37a0bc-0x0;var _0x1aecc0=_0x19a5[_0x37a0bc];return _0x1aecc0;};'use strict';var Sequelize=require(_0x519a('0x0'));module[_0x519a('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x0096=['INTEGER'];(function(_0x212b5f,_0x373289){var _0x8ebd67=function(_0x4bfcd4){while(--_0x4bfcd4){_0x212b5f['push'](_0x212b5f['shift']());}};_0x8ebd67(++_0x373289);}(_0x0096,0x11c));var _0x6009=function(_0x4c184d,_0x4278ab){_0x4c184d=_0x4c184d-0x0;var _0x23d997=_0x0096[_0x4c184d];return _0x23d997;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x6009('0x0')],'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 ec9ddd4..2cbc202 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 _0xa739=['request-promise','path','rimraf','./teamVoiceQueue.attributes','exports','define','TeamVoiceQueue','team_has_voice_queues','util','api','moment'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xa739,0x1e1));var _0x9a73=function(_0x5e0f17,_0x1905d5){_0x5e0f17=_0x5e0f17-0x0;var _0x5b0173=_0xa739[_0x5e0f17];return _0x5b0173;};'use strict';var _=require('lodash');var util=require(_0x9a73('0x0'));var logger=require('../../config/logger')(_0x9a73('0x1'));var moment=require(_0x9a73('0x2'));var BPromise=require('bluebird');var rp=require(_0x9a73('0x3'));var fs=require('fs');var path=require(_0x9a73('0x4'));var rimraf=require(_0x9a73('0x5'));var config=require('../../config/environment');var attributes=require(_0x9a73('0x6'));module[_0x9a73('0x7')]=function(_0xcb4e9e,_0x65115e){return _0xcb4e9e[_0x9a73('0x8')](_0x9a73('0x9'),attributes,{'tableName':_0x9a73('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4350=['../../config/environment','./teamVoiceQueue.attributes','exports','team_has_voice_queues','lodash','util','api','bluebird','request-promise','rimraf'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x4350,0x1d0));var _0x0435=function(_0x2c05ed,_0x53cdb5){_0x2c05ed=_0x2c05ed-0x0;var _0x35be75=_0x4350[_0x2c05ed];return _0x35be75;};'use strict';var _=require(_0x0435('0x0'));var util=require(_0x0435('0x1'));var logger=require('../../config/logger')(_0x0435('0x2'));var moment=require('moment');var BPromise=require(_0x0435('0x3'));var rp=require(_0x0435('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0435('0x5'));var config=require(_0x0435('0x6'));var attributes=require(_0x0435('0x7'));module[_0x0435('0x8')]=function(_0x58a62d,_0x580eeb){return _0x58a62d['define']('TeamVoiceQueue',attributes,{'tableName':_0x0435('0x9'),'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 1f6431c..e7ece25 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 _0x3a8a=['request','then','TeamVoiceQueue,\x20%s,\x20%s','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x3ec333,_0x26bcbe){var _0x15ccb8=function(_0x2c4d0c){while(--_0x2c4d0c){_0x3ec333['push'](_0x3ec333['shift']());}};_0x15ccb8(++_0x26bcbe);}(_0x3a8a,0xed));var _0xa3a8=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x3a8a[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0xa3a8('0x0'));var util=require(_0xa3a8('0x1'));var moment=require(_0xa3a8('0x2'));var BPromise=require(_0xa3a8('0x3'));var rs=require(_0xa3a8('0x4'));var fs=require('fs');var Redis=require(_0xa3a8('0x5'));var db=require(_0xa3a8('0x6'))['db'];var utils=require(_0xa3a8('0x7'));var logger=require('../../config/logger')(_0xa3a8('0x8'));var config=require(_0xa3a8('0x9'));var jayson=require(_0xa3a8('0xa'));var client=jayson[_0xa3a8('0xb')][_0xa3a8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xc93e6,_0x31962e,_0x1a5009){return new BPromise(function(_0x2e878f,_0x2113ce){return client[_0xa3a8('0xd')](_0xc93e6,_0x1a5009)[_0xa3a8('0xe')](function(_0x1e1d5a){logger['info'](_0xa3a8('0xf'),_0x31962e,'request\x20sent');logger[_0xa3a8('0x10')](_0xa3a8('0x11'),_0x31962e,_0xa3a8('0x12'),JSON[_0xa3a8('0x13')](_0x1e1d5a));if(_0x1e1d5a[_0xa3a8('0x14')]){if(_0x1e1d5a['error']['code']===0x1f4){logger[_0xa3a8('0x14')]('TeamVoiceQueue,\x20%s,\x20%s',_0x31962e,_0x1e1d5a[_0xa3a8('0x14')][_0xa3a8('0x15')]);return _0x2113ce(_0x1e1d5a[_0xa3a8('0x14')][_0xa3a8('0x15')]);}logger[_0xa3a8('0x14')](_0xa3a8('0xf'),_0x31962e,_0x1e1d5a['error'][_0xa3a8('0x15')]);return _0x2e878f(_0x1e1d5a[_0xa3a8('0x14')][_0xa3a8('0x15')]);}else{logger[_0xa3a8('0x16')](_0xa3a8('0xf'),_0x31962e,'request\x20sent');_0x2e878f(_0x1e1d5a[_0xa3a8('0x17')]['message']);}})[_0xa3a8('0x18')](function(_0xfd3b1c){logger['error']('TeamVoiceQueue,\x20%s,\x20%s',_0x31962e,_0xfd3b1c);_0x2113ce(_0xfd3b1c);});});} \ No newline at end of file +var _0x35a9=['util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','TeamVoiceQueue,\x20%s,\x20%s','message','result','catch'];(function(_0xf4e5c1,_0x14be3d){var _0x40f260=function(_0x510d56){while(--_0x510d56){_0xf4e5c1['push'](_0xf4e5c1['shift']());}};_0x40f260(++_0x14be3d);}(_0x35a9,0x73));var _0x935a=function(_0x1d50b0,_0x2d5f1e){_0x1d50b0=_0x1d50b0-0x0;var _0x500ee0=_0x35a9[_0x1d50b0];return _0x500ee0;};'use strict';var _=require('lodash');var util=require(_0x935a('0x0'));var moment=require(_0x935a('0x1'));var BPromise=require(_0x935a('0x2'));var rs=require(_0x935a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x935a('0x4'));var logger=require('../../config/logger')(_0x935a('0x5'));var config=require(_0x935a('0x6'));var jayson=require(_0x935a('0x7'));var client=jayson[_0x935a('0x8')][_0x935a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xca82cf,_0xa3490c,_0x16a5c2){return new BPromise(function(_0x534830,_0x78e624){return client[_0x935a('0xa')](_0xca82cf,_0x16a5c2)[_0x935a('0xb')](function(_0x1d82bb){logger[_0x935a('0xc')]('TeamVoiceQueue,\x20%s,\x20%s',_0xa3490c,_0x935a('0xd'));logger[_0x935a('0xe')](_0x935a('0xf'),_0xa3490c,'request\x20sent',JSON[_0x935a('0x10')](_0x1d82bb));if(_0x1d82bb['error']){if(_0x1d82bb['error'][_0x935a('0x11')]===0x1f4){logger[_0x935a('0x12')](_0x935a('0x13'),_0xa3490c,_0x1d82bb[_0x935a('0x12')][_0x935a('0x14')]);return _0x78e624(_0x1d82bb[_0x935a('0x12')][_0x935a('0x14')]);}logger[_0x935a('0x12')]('TeamVoiceQueue,\x20%s,\x20%s',_0xa3490c,_0x1d82bb[_0x935a('0x12')][_0x935a('0x14')]);return _0x534830(_0x1d82bb[_0x935a('0x12')][_0x935a('0x14')]);}else{logger[_0x935a('0xc')](_0x935a('0x13'),_0xa3490c,_0x935a('0xd'));_0x534830(_0x1d82bb[_0x935a('0x15')][_0x935a('0x14')]);}})[_0x935a('0x16')](function(_0x4dbf52){logger[_0x935a('0x12')](_0x935a('0x13'),_0xa3490c,_0x4dbf52);_0x78e624(_0x4dbf52);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index ae72d9f..604c126 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 _0x4732=['delete','/:id','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','isAuthenticated','index','show','post','create','put'];(function(_0x475a34,_0x851f1e){var _0x366636=function(_0x2c3690){while(--_0x2c3690){_0x475a34['push'](_0x475a34['shift']());}};_0x366636(++_0x851f1e);}(_0x4732,0x17d));var _0x2473=function(_0xfb9aaa,_0x37935d){_0xfb9aaa=_0xfb9aaa-0x0;var _0x103bf7=_0x4732[_0xfb9aaa];return _0x103bf7;};'use strict';var multer=require(_0x2473('0x0'));var util=require('util');var path=require(_0x2473('0x1'));var timeout=require('connect-timeout');var express=require(_0x2473('0x2'));var router=express[_0x2473('0x3')]();var fs_extra=require(_0x2473('0x4'));var auth=require(_0x2473('0x5'));var interaction=require(_0x2473('0x6'));var config=require(_0x2473('0x7'));var controller=require(_0x2473('0x8'));router['get']('/',auth[_0x2473('0x9')](),controller[_0x2473('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x2473('0xb')]);router[_0x2473('0xc')]('/',auth[_0x2473('0x9')](),controller[_0x2473('0xd')]);router[_0x2473('0xe')]('/:id',auth[_0x2473('0x9')](),controller['update']);router[_0x2473('0xf')](_0x2473('0x10'),auth['isAuthenticated'](),controller['destroy']);module[_0x2473('0x11')]=router; \ No newline at end of file +var _0x3f35=['/:id','show','put','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./template.controller','isAuthenticated','index','get'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x3f35,0x1ae));var _0x53f3=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0x3f35[_0x2f3848];return _0x102668;};'use strict';var multer=require(_0x53f3('0x0'));var util=require(_0x53f3('0x1'));var path=require(_0x53f3('0x2'));var timeout=require(_0x53f3('0x3'));var express=require(_0x53f3('0x4'));var router=express[_0x53f3('0x5')]();var fs_extra=require(_0x53f3('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x53f3('0x7'));var config=require('../../config/environment');var controller=require(_0x53f3('0x8'));router['get']('/',auth[_0x53f3('0x9')](),controller[_0x53f3('0xa')]);router[_0x53f3('0xb')](_0x53f3('0xc'),auth['isAuthenticated'](),controller[_0x53f3('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x53f3('0xe')](_0x53f3('0xc'),auth[_0x53f3('0x9')](),controller[_0x53f3('0xf')]);router['delete']('/:id',auth[_0x53f3('0x9')](),controller[_0x53f3('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index ff95635..d74d588 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 _0xa6e5=['exports','STRING','TEXT','sequelize'];(function(_0x42b17a,_0x589f30){var _0x1a55eb=function(_0x4a6dd1){while(--_0x4a6dd1){_0x42b17a['push'](_0x42b17a['shift']());}};_0x1a55eb(++_0x589f30);}(_0xa6e5,0x18b));var _0x5a6e=function(_0x33ea19,_0x1a450f){_0x33ea19=_0x33ea19-0x0;var _0x3dacd8=_0xa6e5[_0x33ea19];return _0x3dacd8;};'use strict';var Sequelize=require(_0x5a6e('0x0'));module[_0x5a6e('0x1')]={'name':{'type':Sequelize[_0x5a6e('0x2')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0x5a6e('0x3')]}}; \ No newline at end of file +var _0x5753=['exports','STRING','TEXT','sequelize'];(function(_0x391193,_0x171c0c){var _0x591ed4=function(_0x513ef6){while(--_0x513ef6){_0x391193['push'](_0x391193['shift']());}};_0x591ed4(++_0x171c0c);}(_0x5753,0x1af));var _0x3575=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x5753[_0x167cc1];return _0x10bc4b;};'use strict';var Sequelize=require(_0x3575('0x0'));module[_0x3575('0x1')]={'name':{'type':Sequelize[_0x3575('0x2')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0x3575('0x3')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 3349460..54eb0e5 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 _0xb966=['filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','Template','includeAll','include','rows','catch','show','params','options','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','destroy','then','get','Templates','UserProfileResource','sendStatus','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys'];(function(_0x5656ed,_0x502d38){var _0x71e543=function(_0x3b7cc3){while(--_0x3b7cc3){_0x5656ed['push'](_0x5656ed['shift']());}};_0x71e543(++_0x502d38);}(_0xb966,0x74));var _0x6b96=function(_0x203b20,_0x516062){_0x203b20=_0x203b20-0x0;var _0x27e097=_0xb966[_0x203b20];return _0x27e097;};'use strict';var emlformat=require(_0x6b96('0x0'));var rimraf=require(_0x6b96('0x1'));var zipdir=require(_0x6b96('0x2'));var jsonpatch=require(_0x6b96('0x3'));var rp=require('request-promise');var moment=require(_0x6b96('0x4'));var BPromise=require(_0x6b96('0x5'));var Mustache=require(_0x6b96('0x6'));var util=require(_0x6b96('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6b96('0x8'));var fs=require('fs');var fs_extra=require(_0x6b96('0x9'));var _=require(_0x6b96('0xa'));var squel=require(_0x6b96('0xb'));var crypto=require(_0x6b96('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x6b96('0xd'));var toCsv=require(_0x6b96('0xe'));var querystring=require(_0x6b96('0xf'));var Papa=require(_0x6b96('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6b96('0x11'));var as=require(_0x6b96('0x12'));var hardwareService=require(_0x6b96('0x13'));var logger=require(_0x6b96('0x14'))('api');var utils=require(_0x6b96('0x15'));var config=require(_0x6b96('0x16'));var licenseUtil=require(_0x6b96('0x17'));var db=require(_0x6b96('0x18'))['db'];function respondWithStatusCode(_0x1bd5bc,_0x404504){_0x404504=_0x404504||0xcc;return function(_0x3a7815){if(_0x3a7815){return _0x1bd5bc['sendStatus'](_0x404504);}return _0x1bd5bc[_0x6b96('0x19')](_0x404504)[_0x6b96('0x1a')]();};}function respondWithResult(_0x5d53d6,_0x529228){_0x529228=_0x529228||0xc8;return function(_0x2b681f){if(_0x2b681f){return _0x5d53d6[_0x6b96('0x19')](_0x529228)['json'](_0x2b681f);}};}function respondWithFilteredResult(_0x4e03c5,_0x56333b){return function(_0x396058){if(_0x396058){var _0x3af98f=typeof _0x56333b[_0x6b96('0x1b')]===_0x6b96('0x1c')&&typeof _0x56333b[_0x6b96('0x1d')]===_0x6b96('0x1c');var _0x3b70d9=_0x396058['count'];var _0x470caa=_0x3af98f?0x0:_0x56333b['offset'];var _0x362e6c=_0x3af98f?_0x396058[_0x6b96('0x1e')]:_0x56333b['offset']+_0x56333b[_0x6b96('0x1d')];var _0x3b8558;if(_0x362e6c>=_0x3b70d9){_0x362e6c=_0x3b70d9;_0x3b8558=0xc8;}else{_0x3b8558=0xce;}_0x4e03c5[_0x6b96('0x19')](_0x3b8558);return _0x4e03c5[_0x6b96('0x1f')](_0x6b96('0x20'),_0x470caa+'-'+_0x362e6c+'/'+_0x3b70d9)[_0x6b96('0x21')](_0x396058);}return null;};}function patchUpdates(_0x24887b){return function(_0x26793f){try{jsonpatch[_0x6b96('0x22')](_0x26793f,_0x24887b,!![]);}catch(_0x4394ab){return BPromise[_0x6b96('0x23')](_0x4394ab);}return _0x26793f['save']();};}function saveUpdates(_0x46b6d8,_0x5c5e83){return function(_0x8ab49b){if(_0x8ab49b){return _0x8ab49b[_0x6b96('0x24')](_0x46b6d8)['then'](function(_0x24cb8c){return _0x24cb8c;});}return null;};}function removeEntity(_0x43518c,_0x2e0b21){return function(_0x14f9b2){if(_0x14f9b2){return _0x14f9b2[_0x6b96('0x25')]()[_0x6b96('0x26')](function(){var _0x5ced00=_0x14f9b2[_0x6b96('0x27')]({'plain':!![]});var _0x2d8bf4=_0x6b96('0x28');return db[_0x6b96('0x29')][_0x6b96('0x25')]({'where':{'type':_0x2d8bf4,'resourceId':_0x5ced00['id']}})[_0x6b96('0x26')](function(){return _0x14f9b2;});})[_0x6b96('0x26')](function(){_0x43518c[_0x6b96('0x19')](0xcc)[_0x6b96('0x1a')]();});}};}function handleEntityNotFound(_0x543c6d,_0x4e754d){return function(_0x34ddbb){if(!_0x34ddbb){_0x543c6d[_0x6b96('0x2a')](0x194);}return _0x34ddbb;};}function handleError(_0x41160d,_0xb3643d){_0xb3643d=_0xb3643d||0x1f4;return function(_0x2747cc){logger['error'](_0x2747cc[_0x6b96('0x2b')]);if(_0x2747cc[_0x6b96('0x2c')]){delete _0x2747cc[_0x6b96('0x2c')];}_0x41160d[_0x6b96('0x19')](_0xb3643d)['send'](_0x2747cc);};}exports[_0x6b96('0x2d')]=function(_0x39e528,_0x33f473){var _0x59b953={},_0x18a985={},_0x52f7fc={'count':0x0,'rows':[]};var _0x5b3ddd=_[_0x6b96('0x2e')](db['Template'][_0x6b96('0x2f')],function(_0x8c1026){return{'name':_0x8c1026[_0x6b96('0x30')],'type':_0x8c1026[_0x6b96('0x31')][_0x6b96('0x32')]};});_0x18a985[_0x6b96('0x33')]=_[_0x6b96('0x2e')](_0x5b3ddd,_0x6b96('0x2c'));_0x18a985[_0x6b96('0x34')]=_[_0x6b96('0x35')](_0x39e528['query']);_0x18a985[_0x6b96('0x36')]=_[_0x6b96('0x37')](_0x18a985[_0x6b96('0x33')],_0x18a985[_0x6b96('0x34')]);_0x59b953[_0x6b96('0x38')]=_[_0x6b96('0x37')](_0x18a985[_0x6b96('0x33')],qs[_0x6b96('0x39')](_0x39e528['query'][_0x6b96('0x39')]));_0x59b953['attributes']=_0x59b953[_0x6b96('0x38')][_0x6b96('0x3a')]?_0x59b953[_0x6b96('0x38')]:_0x18a985['model'];if(!_0x39e528['query'][_0x6b96('0x3b')](_0x6b96('0x3c'))){_0x59b953[_0x6b96('0x1d')]=qs['limit'](_0x39e528['query'][_0x6b96('0x1d')]);_0x59b953[_0x6b96('0x1b')]=qs[_0x6b96('0x1b')](_0x39e528[_0x6b96('0x34')]['offset']);}_0x59b953[_0x6b96('0x3d')]=qs[_0x6b96('0x3e')](_0x39e528[_0x6b96('0x34')]['sort']);_0x59b953[_0x6b96('0x3f')]=qs['filters'](_[_0x6b96('0x40')](_0x39e528[_0x6b96('0x34')],_0x18a985[_0x6b96('0x36')]),_0x5b3ddd);if(_0x39e528[_0x6b96('0x34')][_0x6b96('0x41')]){_0x59b953[_0x6b96('0x3f')]=_[_0x6b96('0x42')](_0x59b953['where'],{'$or':_[_0x6b96('0x2e')](_0x5b3ddd,function(_0x182780){if(_0x182780[_0x6b96('0x31')]!=='VIRTUAL'){var _0x521d0c={};_0x521d0c[_0x182780['name']]={'$like':'%'+_0x39e528[_0x6b96('0x34')][_0x6b96('0x41')]+'%'};return _0x521d0c;}})});}_0x59b953=_[_0x6b96('0x42')]({},_0x59b953,_0x39e528['options']);var _0x5313b2={'where':_0x59b953[_0x6b96('0x3f')]};return db[_0x6b96('0x43')][_0x6b96('0x1e')](_0x5313b2)[_0x6b96('0x26')](function(_0x292750){_0x52f7fc[_0x6b96('0x1e')]=_0x292750;if(_0x39e528[_0x6b96('0x34')][_0x6b96('0x44')]){_0x59b953[_0x6b96('0x45')]=[{'all':!![]}];}return db[_0x6b96('0x43')]['findAll'](_0x59b953);})[_0x6b96('0x26')](function(_0x48ae86){_0x52f7fc[_0x6b96('0x46')]=_0x48ae86;return _0x52f7fc;})[_0x6b96('0x26')](respondWithFilteredResult(_0x33f473,_0x59b953))[_0x6b96('0x47')](handleError(_0x33f473,null));};exports[_0x6b96('0x48')]=function(_0x24c68f,_0x3a416a){var _0x2b96b9={'raw':!![],'where':{'id':_0x24c68f[_0x6b96('0x49')]['id']}},_0x8cedc5={};_0x8cedc5[_0x6b96('0x33')]=_[_0x6b96('0x35')](db['Template']['rawAttributes']);_0x8cedc5['query']=_['keys'](_0x24c68f[_0x6b96('0x34')]);_0x8cedc5[_0x6b96('0x36')]=_[_0x6b96('0x37')](_0x8cedc5[_0x6b96('0x33')],_0x8cedc5[_0x6b96('0x34')]);_0x2b96b9[_0x6b96('0x38')]=_['intersection'](_0x8cedc5['model'],qs[_0x6b96('0x39')](_0x24c68f['query'][_0x6b96('0x39')]));_0x2b96b9[_0x6b96('0x38')]=_0x2b96b9[_0x6b96('0x38')][_0x6b96('0x3a')]?_0x2b96b9[_0x6b96('0x38')]:_0x8cedc5[_0x6b96('0x33')];if(_0x24c68f['query'][_0x6b96('0x44')]){_0x2b96b9['include']=[{'all':!![]}];}_0x2b96b9=_[_0x6b96('0x42')]({},_0x2b96b9,_0x24c68f[_0x6b96('0x4a')]);return db[_0x6b96('0x43')]['find'](_0x2b96b9)['then'](handleEntityNotFound(_0x3a416a,null))[_0x6b96('0x26')](respondWithResult(_0x3a416a,null))[_0x6b96('0x47')](handleError(_0x3a416a,null));};exports['create']=function(_0x252b70,_0x39f845){return db['Template'][_0x6b96('0x4b')](_0x252b70['body'],{})[_0x6b96('0x26')](function(_0x3279d1){var _0x3758bd=_0x252b70[_0x6b96('0x4c')][_0x6b96('0x27')]({'plain':!![]});if(!_0x3758bd)throw new Error(_0x6b96('0x4d'));if(_0x3758bd[_0x6b96('0x4e')]===_0x6b96('0x4c')){var _0x336b83=_0x3279d1[_0x6b96('0x27')]({'plain':!![]});var _0x5d8281='Templates';return db['UserProfileSection'][_0x6b96('0x4f')]({'where':{'name':_0x5d8281,'userProfileId':_0x3758bd[_0x6b96('0x50')]},'raw':!![]})['then'](function(_0x35b568){if(_0x35b568&&_0x35b568[_0x6b96('0x51')]===0x0){return db['UserProfileResource']['create']({'name':_0x336b83['name'],'resourceId':_0x336b83['id'],'type':_0x35b568['name'],'sectionId':_0x35b568['id']},{})[_0x6b96('0x26')](function(){return _0x3279d1;});}else{return _0x3279d1;}})[_0x6b96('0x47')](function(_0x59c1ab){logger[_0x6b96('0x52')](_0x6b96('0x53'),_0x59c1ab);throw _0x59c1ab;});}return _0x3279d1;})[_0x6b96('0x26')](respondWithResult(_0x39f845,0xc9))[_0x6b96('0x47')](handleError(_0x39f845,null));};exports[_0x6b96('0x24')]=function(_0x3e5bde,_0x125836){if(_0x3e5bde['body']['id']){delete _0x3e5bde[_0x6b96('0x54')]['id'];}return db[_0x6b96('0x43')]['find']({'where':{'id':_0x3e5bde[_0x6b96('0x49')]['id']}})[_0x6b96('0x26')](handleEntityNotFound(_0x125836,null))[_0x6b96('0x26')](saveUpdates(_0x3e5bde['body'],null))[_0x6b96('0x26')](respondWithResult(_0x125836,null))[_0x6b96('0x47')](handleError(_0x125836,null));};exports[_0x6b96('0x25')]=function(_0x1f29d7,_0x4b5c24){return db[_0x6b96('0x43')][_0x6b96('0x4f')]({'where':{'id':_0x1f29d7[_0x6b96('0x49')]['id']}})[_0x6b96('0x26')](handleEntityNotFound(_0x4b5c24,null))[_0x6b96('0x26')](removeEntity(_0x4b5c24,null))[_0x6b96('0x47')](handleError(_0x4b5c24,null));}; \ No newline at end of file +var _0xd77d=['bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','set','apply','reject','update','destroy','Templates','UserProfileResource','then','end','sendStatus','error','stack','name','map','Template','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','pick','filter','where','VIRTUAL','merge','options','include','catch','show','includeAll','create','body','user','get','role','UserProfileSection','find','userProfileId','params','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x2db055,_0x5bde11){var _0xb2f3a4=function(_0x4719b8){while(--_0x4719b8){_0x2db055['push'](_0x2db055['shift']());}};_0xb2f3a4(++_0x5bde11);}(_0xd77d,0xe9));var _0xdd77=function(_0x43538d,_0x524533){_0x43538d=_0x43538d-0x0;var _0x4249cb=_0xd77d[_0x43538d];return _0x4249cb;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xdd77('0x0'));var jsonpatch=require(_0xdd77('0x1'));var rp=require(_0xdd77('0x2'));var moment=require(_0xdd77('0x3'));var BPromise=require(_0xdd77('0x4'));var Mustache=require('mustache');var util=require(_0xdd77('0x5'));var path=require(_0xdd77('0x6'));var sox=require(_0xdd77('0x7'));var csv=require(_0xdd77('0x8'));var ejs=require(_0xdd77('0x9'));var fs=require('fs');var fs_extra=require(_0xdd77('0xa'));var _=require(_0xdd77('0xb'));var squel=require(_0xdd77('0xc'));var crypto=require(_0xdd77('0xd'));var jsforce=require(_0xdd77('0xe'));var deskjs=require(_0xdd77('0xf'));var toCsv=require('to-csv');var querystring=require(_0xdd77('0x10'));var Papa=require(_0xdd77('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xdd77('0x12'));var as=require(_0xdd77('0x13'));var hardwareService=require(_0xdd77('0x14'));var logger=require('../../config/logger')(_0xdd77('0x15'));var utils=require('../../config/utils');var config=require(_0xdd77('0x16'));var licenseUtil=require(_0xdd77('0x17'));var db=require(_0xdd77('0x18'))['db'];function respondWithStatusCode(_0x4a23f5,_0xea8cc4){_0xea8cc4=_0xea8cc4||0xcc;return function(_0x430be9){if(_0x430be9){return _0x4a23f5['sendStatus'](_0xea8cc4);}return _0x4a23f5[_0xdd77('0x19')](_0xea8cc4)['end']();};}function respondWithResult(_0x3f0692,_0x1fec1e){_0x1fec1e=_0x1fec1e||0xc8;return function(_0x2afb64){if(_0x2afb64){return _0x3f0692[_0xdd77('0x19')](_0x1fec1e)[_0xdd77('0x1a')](_0x2afb64);}};}function respondWithFilteredResult(_0xd22aa4,_0x5f30c1){return function(_0x19ec6e){if(_0x19ec6e){var _0xa760dd=typeof _0x5f30c1[_0xdd77('0x1b')]===_0xdd77('0x1c')&&typeof _0x5f30c1['limit']==='undefined';var _0x230a11=_0x19ec6e[_0xdd77('0x1d')];var _0x1f420b=_0xa760dd?0x0:_0x5f30c1[_0xdd77('0x1b')];var _0x151c35=_0xa760dd?_0x19ec6e[_0xdd77('0x1d')]:_0x5f30c1[_0xdd77('0x1b')]+_0x5f30c1['limit'];var _0x36a451;if(_0x151c35>=_0x230a11){_0x151c35=_0x230a11;_0x36a451=0xc8;}else{_0x36a451=0xce;}_0xd22aa4[_0xdd77('0x19')](_0x36a451);return _0xd22aa4[_0xdd77('0x1e')]('Content-Range',_0x1f420b+'-'+_0x151c35+'/'+_0x230a11)['json'](_0x19ec6e);}return null;};}function patchUpdates(_0x37a214){return function(_0x2128fb){try{jsonpatch[_0xdd77('0x1f')](_0x2128fb,_0x37a214,!![]);}catch(_0x4a5415){return BPromise[_0xdd77('0x20')](_0x4a5415);}return _0x2128fb['save']();};}function saveUpdates(_0x20a752,_0x2c4dde){return function(_0x4e699a){if(_0x4e699a){return _0x4e699a[_0xdd77('0x21')](_0x20a752)['then'](function(_0x7eab37){return _0x7eab37;});}return null;};}function removeEntity(_0x59462e,_0x46f333){return function(_0x3b6be0){if(_0x3b6be0){return _0x3b6be0[_0xdd77('0x22')]()['then'](function(){var _0x4f4e9e=_0x3b6be0['get']({'plain':!![]});var _0x15ea08=_0xdd77('0x23');return db[_0xdd77('0x24')]['destroy']({'where':{'type':_0x15ea08,'resourceId':_0x4f4e9e['id']}})[_0xdd77('0x25')](function(){return _0x3b6be0;});})['then'](function(){_0x59462e[_0xdd77('0x19')](0xcc)[_0xdd77('0x26')]();});}};}function handleEntityNotFound(_0xaec24e,_0x277684){return function(_0x4fceb2){if(!_0x4fceb2){_0xaec24e[_0xdd77('0x27')](0x194);}return _0x4fceb2;};}function handleError(_0x3d6606,_0x2bcc93){_0x2bcc93=_0x2bcc93||0x1f4;return function(_0xaf5a7c){logger[_0xdd77('0x28')](_0xaf5a7c[_0xdd77('0x29')]);if(_0xaf5a7c[_0xdd77('0x2a')]){delete _0xaf5a7c[_0xdd77('0x2a')];}_0x3d6606['status'](_0x2bcc93)['send'](_0xaf5a7c);};}exports['index']=function(_0x503fdf,_0x4b8662){var _0x56db44={},_0x59351a={},_0x321abd={'count':0x0,'rows':[]};var _0x49b911=_[_0xdd77('0x2b')](db[_0xdd77('0x2c')][_0xdd77('0x2d')],function(_0x5a543f){return{'name':_0x5a543f['fieldName'],'type':_0x5a543f[_0xdd77('0x2e')][_0xdd77('0x2f')]};});_0x59351a[_0xdd77('0x30')]=_[_0xdd77('0x2b')](_0x49b911,_0xdd77('0x2a'));_0x59351a[_0xdd77('0x31')]=_[_0xdd77('0x32')](_0x503fdf['query']);_0x59351a[_0xdd77('0x33')]=_[_0xdd77('0x34')](_0x59351a[_0xdd77('0x30')],_0x59351a['query']);_0x56db44[_0xdd77('0x35')]=_[_0xdd77('0x34')](_0x59351a[_0xdd77('0x30')],qs[_0xdd77('0x36')](_0x503fdf[_0xdd77('0x31')][_0xdd77('0x36')]));_0x56db44[_0xdd77('0x35')]=_0x56db44[_0xdd77('0x35')][_0xdd77('0x37')]?_0x56db44[_0xdd77('0x35')]:_0x59351a[_0xdd77('0x30')];if(!_0x503fdf[_0xdd77('0x31')]['hasOwnProperty'](_0xdd77('0x38'))){_0x56db44[_0xdd77('0x39')]=qs[_0xdd77('0x39')](_0x503fdf[_0xdd77('0x31')][_0xdd77('0x39')]);_0x56db44[_0xdd77('0x1b')]=qs[_0xdd77('0x1b')](_0x503fdf[_0xdd77('0x31')][_0xdd77('0x1b')]);}_0x56db44[_0xdd77('0x3a')]=qs[_0xdd77('0x3b')](_0x503fdf[_0xdd77('0x31')][_0xdd77('0x3b')]);_0x56db44['where']=qs[_0xdd77('0x33')](_[_0xdd77('0x3c')](_0x503fdf[_0xdd77('0x31')],_0x59351a[_0xdd77('0x33')]),_0x49b911);if(_0x503fdf[_0xdd77('0x31')][_0xdd77('0x3d')]){_0x56db44[_0xdd77('0x3e')]=_['merge'](_0x56db44[_0xdd77('0x3e')],{'$or':_[_0xdd77('0x2b')](_0x49b911,function(_0x1ae9f3){if(_0x1ae9f3[_0xdd77('0x2e')]!==_0xdd77('0x3f')){var _0x1cdd25={};_0x1cdd25[_0x1ae9f3[_0xdd77('0x2a')]]={'$like':'%'+_0x503fdf[_0xdd77('0x31')][_0xdd77('0x3d')]+'%'};return _0x1cdd25;}})});}_0x56db44=_[_0xdd77('0x40')]({},_0x56db44,_0x503fdf[_0xdd77('0x41')]);var _0xab333d={'where':_0x56db44[_0xdd77('0x3e')]};return db[_0xdd77('0x2c')]['count'](_0xab333d)[_0xdd77('0x25')](function(_0x506a94){_0x321abd[_0xdd77('0x1d')]=_0x506a94;if(_0x503fdf[_0xdd77('0x31')]['includeAll']){_0x56db44[_0xdd77('0x42')]=[{'all':!![]}];}return db[_0xdd77('0x2c')]['findAll'](_0x56db44);})[_0xdd77('0x25')](function(_0x5ba3f9){_0x321abd['rows']=_0x5ba3f9;return _0x321abd;})[_0xdd77('0x25')](respondWithFilteredResult(_0x4b8662,_0x56db44))[_0xdd77('0x43')](handleError(_0x4b8662,null));};exports[_0xdd77('0x44')]=function(_0x256b9d,_0xecacd7){var _0xf7216f={'raw':!![],'where':{'id':_0x256b9d['params']['id']}},_0x324d94={};_0x324d94[_0xdd77('0x30')]=_[_0xdd77('0x32')](db[_0xdd77('0x2c')]['rawAttributes']);_0x324d94[_0xdd77('0x31')]=_[_0xdd77('0x32')](_0x256b9d[_0xdd77('0x31')]);_0x324d94[_0xdd77('0x33')]=_['intersection'](_0x324d94[_0xdd77('0x30')],_0x324d94[_0xdd77('0x31')]);_0xf7216f[_0xdd77('0x35')]=_[_0xdd77('0x34')](_0x324d94['model'],qs[_0xdd77('0x36')](_0x256b9d[_0xdd77('0x31')][_0xdd77('0x36')]));_0xf7216f[_0xdd77('0x35')]=_0xf7216f['attributes'][_0xdd77('0x37')]?_0xf7216f['attributes']:_0x324d94['model'];if(_0x256b9d[_0xdd77('0x31')][_0xdd77('0x45')]){_0xf7216f[_0xdd77('0x42')]=[{'all':!![]}];}_0xf7216f=_['merge']({},_0xf7216f,_0x256b9d[_0xdd77('0x41')]);return db[_0xdd77('0x2c')]['find'](_0xf7216f)[_0xdd77('0x25')](handleEntityNotFound(_0xecacd7,null))['then'](respondWithResult(_0xecacd7,null))[_0xdd77('0x43')](handleError(_0xecacd7,null));};exports['create']=function(_0x592379,_0x1c68a3){return db['Template'][_0xdd77('0x46')](_0x592379[_0xdd77('0x47')],{})['then'](function(_0x49d3cd){var _0x2f5d8e=_0x592379[_0xdd77('0x48')][_0xdd77('0x49')]({'plain':!![]});if(!_0x2f5d8e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2f5d8e[_0xdd77('0x4a')]===_0xdd77('0x48')){var _0x4860b7=_0x49d3cd[_0xdd77('0x49')]({'plain':!![]});var _0x5496da=_0xdd77('0x23');return db[_0xdd77('0x4b')][_0xdd77('0x4c')]({'where':{'name':_0x5496da,'userProfileId':_0x2f5d8e[_0xdd77('0x4d')]},'raw':!![]})[_0xdd77('0x25')](function(_0x167717){if(_0x167717&&_0x167717['autoAssociation']===0x0){return db['UserProfileResource'][_0xdd77('0x46')]({'name':_0x4860b7[_0xdd77('0x2a')],'resourceId':_0x4860b7['id'],'type':_0x167717[_0xdd77('0x2a')],'sectionId':_0x167717['id']},{})[_0xdd77('0x25')](function(){return _0x49d3cd;});}else{return _0x49d3cd;}})[_0xdd77('0x43')](function(_0x31cf4a){logger[_0xdd77('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x31cf4a);throw _0x31cf4a;});}return _0x49d3cd;})['then'](respondWithResult(_0x1c68a3,0xc9))[_0xdd77('0x43')](handleError(_0x1c68a3,null));};exports[_0xdd77('0x21')]=function(_0x1cd1c1,_0x261d2b){if(_0x1cd1c1[_0xdd77('0x47')]['id']){delete _0x1cd1c1['body']['id'];}return db[_0xdd77('0x2c')][_0xdd77('0x4c')]({'where':{'id':_0x1cd1c1['params']['id']}})[_0xdd77('0x25')](handleEntityNotFound(_0x261d2b,null))['then'](saveUpdates(_0x1cd1c1[_0xdd77('0x47')],null))['then'](respondWithResult(_0x261d2b,null))[_0xdd77('0x43')](handleError(_0x261d2b,null));};exports['destroy']=function(_0x227423,_0x5676fc){return db[_0xdd77('0x2c')][_0xdd77('0x4c')]({'where':{'id':_0x227423[_0xdd77('0x4e')]['id']}})[_0xdd77('0x25')](handleEntityNotFound(_0x5676fc,null))[_0xdd77('0x25')](removeEntity(_0x5676fc,null))[_0xdd77('0x43')](handleError(_0x5676fc,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 131cfb9..0338884 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 _0x6921=['request-promise','../../config/environment','./template.attributes','exports','define','Template','tools_templates','../../config/logger','api','moment','bluebird'];(function(_0x4c1ec2,_0x4f42b7){var _0x3f6f1c=function(_0xc82652){while(--_0xc82652){_0x4c1ec2['push'](_0x4c1ec2['shift']());}};_0x3f6f1c(++_0x4f42b7);}(_0x6921,0xc2));var _0x1692=function(_0x2b3e8f,_0x2e0085){_0x2b3e8f=_0x2b3e8f-0x0;var _0x26cda3=_0x6921[_0x2b3e8f];return _0x26cda3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1692('0x0'))(_0x1692('0x1'));var moment=require(_0x1692('0x2'));var BPromise=require(_0x1692('0x3'));var rp=require(_0x1692('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1692('0x5'));var attributes=require(_0x1692('0x6'));module[_0x1692('0x7')]=function(_0x55c9b8,_0x3ddd54){return _0x55c9b8[_0x1692('0x8')](_0x1692('0x9'),attributes,{'tableName':_0x1692('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7ad2=['request-promise','path','../../config/environment','./template.attributes','exports','define','tools_templates','lodash','util','../../config/logger','bluebird'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7ad2,0x15c));var _0x27ad=function(_0x1e4f2f,_0x35edfa){_0x1e4f2f=_0x1e4f2f-0x0;var _0xccea89=_0x7ad2[_0x1e4f2f];return _0xccea89;};'use strict';var _=require(_0x27ad('0x0'));var util=require(_0x27ad('0x1'));var logger=require(_0x27ad('0x2'))('api');var moment=require('moment');var BPromise=require(_0x27ad('0x3'));var rp=require(_0x27ad('0x4'));var fs=require('fs');var path=require(_0x27ad('0x5'));var rimraf=require('rimraf');var config=require(_0x27ad('0x6'));var attributes=require(_0x27ad('0x7'));module[_0x27ad('0x8')]=function(_0x129c45,_0x26d682){return _0x129c45[_0x27ad('0x9')]('Template',attributes,{'tableName':_0x27ad('0xa'),'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 988f7ae..dc8eb59 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 _0xfa76=['options','raw','where','attributes','include','map','model','info','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','then','Template,\x20%s,\x20%s','Template,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetTemplate','Template','findAll'];(function(_0x596f6e,_0x3f8857){var _0x1e0803=function(_0x31f91f){while(--_0x31f91f){_0x596f6e['push'](_0x596f6e['shift']());}};_0x1e0803(++_0x3f8857);}(_0xfa76,0x116));var _0x6fa7=function(_0x389e52,_0x34f69b){_0x389e52=_0x389e52-0x0;var _0x4fd089=_0xfa76[_0x389e52];return _0x4fd089;};'use strict';var _=require(_0x6fa7('0x0'));var util=require('util');var moment=require(_0x6fa7('0x1'));var BPromise=require(_0x6fa7('0x2'));var rs=require(_0x6fa7('0x3'));var fs=require('fs');var Redis=require(_0x6fa7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6fa7('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x6fa7('0x6'));var jayson=require(_0x6fa7('0x7'));var client=jayson[_0x6fa7('0x8')][_0x6fa7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x550bea,_0x5b9d02,_0x404b1a){return new BPromise(function(_0x5267d2,_0xfca322){return client['request'](_0x550bea,_0x404b1a)[_0x6fa7('0xa')](function(_0x33b147){logger['info'](_0x6fa7('0xb'),_0x5b9d02,'request\x20sent');logger['debug'](_0x6fa7('0xc'),_0x5b9d02,_0x6fa7('0xd'),JSON[_0x6fa7('0xe')](_0x33b147));if(_0x33b147[_0x6fa7('0xf')]){if(_0x33b147[_0x6fa7('0xf')]['code']===0x1f4){logger[_0x6fa7('0xf')]('Template,\x20%s,\x20%s',_0x5b9d02,_0x33b147['error'][_0x6fa7('0x10')]);return _0xfca322(_0x33b147[_0x6fa7('0xf')][_0x6fa7('0x10')]);}logger[_0x6fa7('0xf')](_0x6fa7('0xb'),_0x5b9d02,_0x33b147['error'][_0x6fa7('0x10')]);return _0x5267d2(_0x33b147[_0x6fa7('0xf')][_0x6fa7('0x10')]);}else{logger['info']('Template,\x20%s,\x20%s',_0x5b9d02,_0x6fa7('0xd'));_0x5267d2(_0x33b147[_0x6fa7('0x11')][_0x6fa7('0x10')]);}})[_0x6fa7('0x12')](function(_0x39e2a9){logger['error']('Template,\x20%s,\x20%s',_0x5b9d02,_0x39e2a9);_0xfca322(_0x39e2a9);});});}exports[_0x6fa7('0x13')]=function(_0x54def2){var _0x4b281c=this;return new Promise(function(_0x36a555,_0x19e3f1){return db[_0x6fa7('0x14')][_0x6fa7('0x15')]({'raw':_0x54def2[_0x6fa7('0x16')]?_0x54def2['options'][_0x6fa7('0x17')]===undefined?!![]:![]:!![],'where':_0x54def2[_0x6fa7('0x16')]?_0x54def2[_0x6fa7('0x16')][_0x6fa7('0x18')]||null:null,'attributes':_0x54def2['options']?_0x54def2[_0x6fa7('0x16')][_0x6fa7('0x19')]||null:null,'limit':_0x54def2['options']?_0x54def2['options']['limit']||null:null,'include':_0x54def2[_0x6fa7('0x16')]?_0x54def2[_0x6fa7('0x16')][_0x6fa7('0x1a')]?_[_0x6fa7('0x1b')](_0x54def2[_0x6fa7('0x16')][_0x6fa7('0x1a')],function(_0x4e11b9){return{'model':db[_0x4e11b9['model']],'as':_0x4e11b9['as'],'attributes':_0x4e11b9[_0x6fa7('0x19')],'include':_0x4e11b9[_0x6fa7('0x1a')]?_[_0x6fa7('0x1b')](_0x4e11b9[_0x6fa7('0x1a')],function(_0x15282a){return{'model':db[_0x15282a['model']],'as':_0x15282a['as'],'attributes':_0x15282a[_0x6fa7('0x19')],'include':_0x15282a[_0x6fa7('0x1a')]?_[_0x6fa7('0x1b')](_0x15282a[_0x6fa7('0x1a')],function(_0x2ca789){return{'model':db[_0x2ca789[_0x6fa7('0x1c')]],'as':_0x2ca789['as'],'attributes':_0x2ca789[_0x6fa7('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x989a06){logger[_0x6fa7('0x1d')](_0x6fa7('0x13'),_0x54def2);logger['debug']('GetTemplate',_0x54def2,JSON[_0x6fa7('0xe')](_0x989a06));_0x36a555(_0x989a06);})[_0x6fa7('0x12')](function(_0x1c9cda){logger['error'](_0x6fa7('0x13'),_0x1c9cda[_0x6fa7('0x10')],_0x54def2);_0x19e3f1(_0x4b281c['error'](0x1f4,_0x1c9cda[_0x6fa7('0x10')]));});});}; \ No newline at end of file +var _0xbd7b=['code','message','result','Template','findAll','raw','options','where','attributes','limit','include','map','model','then','GetTemplate','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3e7ba0,_0x4a0c61){var _0x41be5e=function(_0x10ea4){while(--_0x10ea4){_0x3e7ba0['push'](_0x3e7ba0['shift']());}};_0x41be5e(++_0x4a0c61);}(_0xbd7b,0x1ec));var _0xbbd7=function(_0x187f72,_0x32f589){_0x187f72=_0x187f72-0x0;var _0x5b6b49=_0xbd7b[_0x187f72];return _0x5b6b49;};'use strict';var _=require('lodash');var util=require(_0xbbd7('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbbd7('0x1'));var fs=require('fs');var Redis=require(_0xbbd7('0x2'));var db=require(_0xbbd7('0x3'))['db'];var utils=require(_0xbbd7('0x4'));var logger=require(_0xbbd7('0x5'))(_0xbbd7('0x6'));var config=require('../../config/environment');var jayson=require(_0xbbd7('0x7'));var client=jayson[_0xbbd7('0x8')][_0xbbd7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x41d1f3,_0xd52a6d,_0x13a6f6){return new BPromise(function(_0x2846e4,_0x2ffaaf){return client[_0xbbd7('0xa')](_0x41d1f3,_0x13a6f6)['then'](function(_0x313998){logger[_0xbbd7('0xb')](_0xbbd7('0xc'),_0xd52a6d,_0xbbd7('0xd'));logger[_0xbbd7('0xe')](_0xbbd7('0xf'),_0xd52a6d,_0xbbd7('0xd'),JSON[_0xbbd7('0x10')](_0x313998));if(_0x313998['error']){if(_0x313998[_0xbbd7('0x11')][_0xbbd7('0x12')]===0x1f4){logger[_0xbbd7('0x11')](_0xbbd7('0xc'),_0xd52a6d,_0x313998[_0xbbd7('0x11')][_0xbbd7('0x13')]);return _0x2ffaaf(_0x313998[_0xbbd7('0x11')][_0xbbd7('0x13')]);}logger[_0xbbd7('0x11')]('Template,\x20%s,\x20%s',_0xd52a6d,_0x313998[_0xbbd7('0x11')][_0xbbd7('0x13')]);return _0x2846e4(_0x313998[_0xbbd7('0x11')]['message']);}else{logger['info'](_0xbbd7('0xc'),_0xd52a6d,_0xbbd7('0xd'));_0x2846e4(_0x313998[_0xbbd7('0x14')][_0xbbd7('0x13')]);}})['catch'](function(_0x132b73){logger['error'](_0xbbd7('0xc'),_0xd52a6d,_0x132b73);_0x2ffaaf(_0x132b73);});});}exports['GetTemplate']=function(_0x203a0c){var _0x242293=this;return new Promise(function(_0xf4e511,_0x39d202){return db[_0xbbd7('0x15')][_0xbbd7('0x16')]({'raw':_0x203a0c['options']?_0x203a0c['options'][_0xbbd7('0x17')]===undefined?!![]:![]:!![],'where':_0x203a0c[_0xbbd7('0x18')]?_0x203a0c[_0xbbd7('0x18')][_0xbbd7('0x19')]||null:null,'attributes':_0x203a0c['options']?_0x203a0c[_0xbbd7('0x18')][_0xbbd7('0x1a')]||null:null,'limit':_0x203a0c[_0xbbd7('0x18')]?_0x203a0c[_0xbbd7('0x18')][_0xbbd7('0x1b')]||null:null,'include':_0x203a0c['options']?_0x203a0c[_0xbbd7('0x18')][_0xbbd7('0x1c')]?_[_0xbbd7('0x1d')](_0x203a0c[_0xbbd7('0x18')][_0xbbd7('0x1c')],function(_0x553e62){return{'model':db[_0x553e62[_0xbbd7('0x1e')]],'as':_0x553e62['as'],'attributes':_0x553e62[_0xbbd7('0x1a')],'include':_0x553e62['include']?_[_0xbbd7('0x1d')](_0x553e62[_0xbbd7('0x1c')],function(_0x2608cb){return{'model':db[_0x2608cb[_0xbbd7('0x1e')]],'as':_0x2608cb['as'],'attributes':_0x2608cb['attributes'],'include':_0x2608cb['include']?_[_0xbbd7('0x1d')](_0x2608cb[_0xbbd7('0x1c')],function(_0x5a30e1){return{'model':db[_0x5a30e1['model']],'as':_0x5a30e1['as'],'attributes':_0x5a30e1[_0xbbd7('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xbbd7('0x1f')](function(_0x3bce38){logger[_0xbbd7('0xb')](_0xbbd7('0x20'),_0x203a0c);logger['debug'](_0xbbd7('0x20'),_0x203a0c,JSON[_0xbbd7('0x10')](_0x3bce38));_0xf4e511(_0x3bce38);})[_0xbbd7('0x21')](function(_0x36cb34){logger[_0xbbd7('0x11')](_0xbbd7('0x20'),_0x36cb34[_0xbbd7('0x13')],_0x203a0c);_0x39d202(_0x242293[_0xbbd7('0x11')](0x1f4,_0x36cb34[_0xbbd7('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 77cc16f..7ee330b 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 _0x5e60=['destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','get','/:id','isAuthenticated','show','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','post','create','/:id/all_conditions','addAllCondition','addAnyCondition','addAction','put','delete'];(function(_0x4ee7ce,_0xdbfe2a){var _0x29b130=function(_0x4e365d){while(--_0x4e365d){_0x4ee7ce['push'](_0x4ee7ce['shift']());}};_0x29b130(++_0xdbfe2a);}(_0x5e60,0x179));var _0x05e6=function(_0x53fd56,_0x33b932){_0x53fd56=_0x53fd56-0x0;var _0x297719=_0x5e60[_0x53fd56];return _0x297719;};'use strict';var multer=require('multer');var util=require(_0x05e6('0x0'));var path=require(_0x05e6('0x1'));var timeout=require(_0x05e6('0x2'));var express=require('express');var router=express[_0x05e6('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x05e6('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x05e6('0x5'));var controller=require('./trigger.controller');router[_0x05e6('0x6')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x05e6('0x7'),auth[_0x05e6('0x8')](),controller[_0x05e6('0x9')]);router[_0x05e6('0x6')]('/:id/all_conditions',auth[_0x05e6('0x8')](),controller[_0x05e6('0xa')]);router[_0x05e6('0x6')](_0x05e6('0xb'),auth[_0x05e6('0x8')](),controller[_0x05e6('0xc')]);router[_0x05e6('0x6')](_0x05e6('0xd'),auth[_0x05e6('0x8')](),controller[_0x05e6('0xe')]);router[_0x05e6('0xf')]('/',auth[_0x05e6('0x8')](),controller[_0x05e6('0x10')]);router[_0x05e6('0xf')](_0x05e6('0x11'),auth[_0x05e6('0x8')](),controller[_0x05e6('0x12')]);router['post']('/:id/any_conditions',auth[_0x05e6('0x8')](),controller[_0x05e6('0x13')]);router[_0x05e6('0xf')](_0x05e6('0xd'),auth[_0x05e6('0x8')](),controller[_0x05e6('0x14')]);router[_0x05e6('0x15')](_0x05e6('0x7'),auth[_0x05e6('0x8')](),controller['update']);router[_0x05e6('0x16')](_0x05e6('0x7'),auth[_0x05e6('0x8')](),controller[_0x05e6('0x17')]);module[_0x05e6('0x18')]=router; \ No newline at end of file +var _0xbd23=['/:id','show','/:id/all_conditions','getAllConditions','get','getAnyConditions','/:id/actions','post','create','/:id/any_conditions','addAnyCondition','addAction','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','isAuthenticated','index'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xbd23,0x7b));var _0x3bd2=function(_0x5aa889,_0x4de735){_0x5aa889=_0x5aa889-0x0;var _0x353653=_0xbd23[_0x5aa889];return _0x353653;};'use strict';var multer=require(_0x3bd2('0x0'));var util=require(_0x3bd2('0x1'));var path=require(_0x3bd2('0x2'));var timeout=require('connect-timeout');var express=require(_0x3bd2('0x3'));var router=express[_0x3bd2('0x4')]();var fs_extra=require(_0x3bd2('0x5'));var auth=require(_0x3bd2('0x6'));var interaction=require(_0x3bd2('0x7'));var config=require(_0x3bd2('0x8'));var controller=require(_0x3bd2('0x9'));router['get']('/',auth[_0x3bd2('0xa')](),controller[_0x3bd2('0xb')]);router['get'](_0x3bd2('0xc'),auth[_0x3bd2('0xa')](),controller[_0x3bd2('0xd')]);router['get'](_0x3bd2('0xe'),auth[_0x3bd2('0xa')](),controller[_0x3bd2('0xf')]);router[_0x3bd2('0x10')]('/:id/any_conditions',auth['isAuthenticated'](),controller[_0x3bd2('0x11')]);router[_0x3bd2('0x10')](_0x3bd2('0x12'),auth[_0x3bd2('0xa')](),controller['getActions']);router[_0x3bd2('0x13')]('/',auth[_0x3bd2('0xa')](),controller[_0x3bd2('0x14')]);router[_0x3bd2('0x13')]('/:id/all_conditions',auth[_0x3bd2('0xa')](),controller['addAllCondition']);router[_0x3bd2('0x13')](_0x3bd2('0x15'),auth['isAuthenticated'](),controller[_0x3bd2('0x16')]);router[_0x3bd2('0x13')](_0x3bd2('0x12'),auth[_0x3bd2('0xa')](),controller[_0x3bd2('0x17')]);router['put'](_0x3bd2('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x3bd2('0x18')](_0x3bd2('0xc'),auth[_0x3bd2('0xa')](),controller[_0x3bd2('0x19')]);module[_0x3bd2('0x1a')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index f7a310c..9322612 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 _0xb958=['sequelize','STRING','BOOLEAN'];(function(_0x22b028,_0x5e2090){var _0x128ebd=function(_0x2c4e2f){while(--_0x2c4e2f){_0x22b028['push'](_0x22b028['shift']());}};_0x128ebd(++_0x5e2090);}(_0xb958,0x105));var _0x8b95=function(_0x53e787,_0x4298e6){_0x53e787=_0x53e787-0x0;var _0x2781a0=_0xb958[_0x53e787];return _0x2781a0;};'use strict';var Sequelize=require(_0x8b95('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x8b95('0x1')]},'description':{'type':Sequelize[_0x8b95('0x1')]},'status':{'type':Sequelize[_0x8b95('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x8733=['BOOLEAN','STRING'];(function(_0x54b396,_0x3612ee){var _0x532e6d=function(_0xc8286e){while(--_0xc8286e){_0x54b396['push'](_0x54b396['shift']());}};_0x532e6d(++_0x3612ee);}(_0x8733,0xd7));var _0x3873=function(_0x1e2f5b,_0x60bf47){_0x1e2f5b=_0x1e2f5b-0x0;var _0x2bb7bc=_0x8733[_0x1e2f5b];return _0x2bb7bc;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3873('0x0')]},'channel':{'type':Sequelize[_0x3873('0x0')]},'description':{'type':Sequelize[_0x3873('0x0')]},'status':{'type':Sequelize[_0x3873('0x1')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index 43b1e1f..f6a12e7 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 _0x89dc=['TriggerAnyId','Condition','findOne','merge','hasOwnProperty','getAllConditions','getAnyConditions','addAction','Action','getActions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','Triggers','UserProfileResource','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','map','VIRTUAL','options','includeAll','show','params','Trigger','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','TriggerAllId','addAnyCondition'];(function(_0x3f8da1,_0x3087be){var _0x1c2dc3=function(_0x182709){while(--_0x182709){_0x3f8da1['push'](_0x3f8da1['shift']());}};_0x1c2dc3(++_0x3087be);}(_0x89dc,0xcc));var _0xc89d=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0x89dc[_0x4b7b62];return _0x2280df;};'use strict';var emlformat=require(_0xc89d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc89d('0x1'));var jsonpatch=require(_0xc89d('0x2'));var rp=require(_0xc89d('0x3'));var moment=require(_0xc89d('0x4'));var BPromise=require(_0xc89d('0x5'));var Mustache=require(_0xc89d('0x6'));var util=require(_0xc89d('0x7'));var path=require(_0xc89d('0x8'));var sox=require(_0xc89d('0x9'));var csv=require(_0xc89d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc89d('0xb'));var _=require(_0xc89d('0xc'));var squel=require(_0xc89d('0xd'));var crypto=require(_0xc89d('0xe'));var jsforce=require(_0xc89d('0xf'));var deskjs=require(_0xc89d('0x10'));var toCsv=require(_0xc89d('0xa'));var querystring=require(_0xc89d('0x11'));var Papa=require('papaparse');var Redis=require(_0xc89d('0x12'));var authService=require(_0xc89d('0x13'));var qs=require(_0xc89d('0x14'));var as=require(_0xc89d('0x15'));var hardwareService=require(_0xc89d('0x16'));var logger=require(_0xc89d('0x17'))('api');var utils=require(_0xc89d('0x18'));var config=require(_0xc89d('0x19'));var licenseUtil=require(_0xc89d('0x1a'));var db=require(_0xc89d('0x1b'))['db'];function respondWithStatusCode(_0x268322,_0x2f0da5){_0x2f0da5=_0x2f0da5||0xcc;return function(_0x4dd799){if(_0x4dd799){return _0x268322[_0xc89d('0x1c')](_0x2f0da5);}return _0x268322[_0xc89d('0x1d')](_0x2f0da5)[_0xc89d('0x1e')]();};}function respondWithResult(_0x349166,_0x53720d){_0x53720d=_0x53720d||0xc8;return function(_0xfb805){if(_0xfb805){return _0x349166[_0xc89d('0x1d')](_0x53720d)[_0xc89d('0x1f')](_0xfb805);}};}function respondWithFilteredResult(_0x2ff1f4,_0xc920b6){return function(_0x38cce8){if(_0x38cce8){var _0x2efebd=typeof _0xc920b6['offset']===_0xc89d('0x20')&&typeof _0xc920b6[_0xc89d('0x21')]===_0xc89d('0x20');var _0x2b476f=_0x38cce8[_0xc89d('0x22')];var _0x3fd503=_0x2efebd?0x0:_0xc920b6[_0xc89d('0x23')];var _0x4a04be=_0x2efebd?_0x38cce8['count']:_0xc920b6[_0xc89d('0x23')]+_0xc920b6[_0xc89d('0x21')];var _0x4bcbfb;if(_0x4a04be>=_0x2b476f){_0x4a04be=_0x2b476f;_0x4bcbfb=0xc8;}else{_0x4bcbfb=0xce;}_0x2ff1f4[_0xc89d('0x1d')](_0x4bcbfb);return _0x2ff1f4[_0xc89d('0x24')](_0xc89d('0x25'),_0x3fd503+'-'+_0x4a04be+'/'+_0x2b476f)['json'](_0x38cce8);}return null;};}function patchUpdates(_0x5ae534){return function(_0x1411ea){try{jsonpatch[_0xc89d('0x26')](_0x1411ea,_0x5ae534,!![]);}catch(_0x4a853b){return BPromise[_0xc89d('0x27')](_0x4a853b);}return _0x1411ea[_0xc89d('0x28')]();};}function saveUpdates(_0x28e039,_0x86c5ad){return function(_0x34ff3b){if(_0x34ff3b){return _0x34ff3b[_0xc89d('0x29')](_0x28e039)[_0xc89d('0x2a')](function(_0x1d5953){return _0x1d5953;});}return null;};}function removeEntity(_0x153aab,_0x2eb521){return function(_0xfdc8f7){if(_0xfdc8f7){return _0xfdc8f7[_0xc89d('0x2b')]()[_0xc89d('0x2a')](function(){var _0x470e78=_0xfdc8f7[_0xc89d('0x2c')]({'plain':!![]});var _0x5de03b=_0xc89d('0x2d');return db[_0xc89d('0x2e')][_0xc89d('0x2b')]({'where':{'type':_0x5de03b,'resourceId':_0x470e78['id']}})[_0xc89d('0x2a')](function(){return _0xfdc8f7;});})[_0xc89d('0x2a')](function(){_0x153aab['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e5d77,_0x20c97f){return function(_0x1dbd66){if(!_0x1dbd66){_0x5e5d77['sendStatus'](0x194);}return _0x1dbd66;};}function handleError(_0x15ae28,_0x1914e1){_0x1914e1=_0x1914e1||0x1f4;return function(_0xb2782a){logger[_0xc89d('0x2f')](_0xb2782a[_0xc89d('0x30')]);if(_0xb2782a[_0xc89d('0x31')]){delete _0xb2782a[_0xc89d('0x31')];}_0x15ae28['status'](_0x1914e1)[_0xc89d('0x32')](_0xb2782a);};}exports[_0xc89d('0x33')]=function(_0x5397ef,_0x3b4807){var _0x3253c8={},_0x199497={},_0x495529={'count':0x0,'rows':[]};var _0x117683=_['map'](db['Trigger'][_0xc89d('0x34')],function(_0x5ccbe2){return{'name':_0x5ccbe2[_0xc89d('0x35')],'type':_0x5ccbe2[_0xc89d('0x36')][_0xc89d('0x37')]};});_0x199497[_0xc89d('0x38')]=_['map'](_0x117683,_0xc89d('0x31'));_0x199497[_0xc89d('0x39')]=_[_0xc89d('0x3a')](_0x5397ef['query']);_0x199497[_0xc89d('0x3b')]=_[_0xc89d('0x3c')](_0x199497[_0xc89d('0x38')],_0x199497[_0xc89d('0x39')]);_0x3253c8[_0xc89d('0x3d')]=_[_0xc89d('0x3c')](_0x199497[_0xc89d('0x38')],qs[_0xc89d('0x3e')](_0x5397ef['query']['fields']));_0x3253c8['attributes']=_0x3253c8[_0xc89d('0x3d')][_0xc89d('0x3f')]?_0x3253c8[_0xc89d('0x3d')]:_0x199497[_0xc89d('0x38')];if(!_0x5397ef[_0xc89d('0x39')]['hasOwnProperty'](_0xc89d('0x40'))){_0x3253c8['limit']=qs[_0xc89d('0x21')](_0x5397ef['query'][_0xc89d('0x21')]);_0x3253c8[_0xc89d('0x23')]=qs[_0xc89d('0x23')](_0x5397ef[_0xc89d('0x39')][_0xc89d('0x23')]);}_0x3253c8[_0xc89d('0x41')]=qs[_0xc89d('0x42')](_0x5397ef[_0xc89d('0x39')][_0xc89d('0x42')]);_0x3253c8[_0xc89d('0x43')]=qs[_0xc89d('0x3b')](_[_0xc89d('0x44')](_0x5397ef[_0xc89d('0x39')],_0x199497['filters']),_0x117683);if(_0x5397ef['query'][_0xc89d('0x45')]){_0x3253c8['where']=_['merge'](_0x3253c8['where'],{'$or':_[_0xc89d('0x46')](_0x117683,function(_0x52ea20){if(_0x52ea20['type']!==_0xc89d('0x47')){var _0xafd34e={};_0xafd34e[_0x52ea20[_0xc89d('0x31')]]={'$like':'%'+_0x5397ef['query'][_0xc89d('0x45')]+'%'};return _0xafd34e;}})});}_0x3253c8=_['merge']({},_0x3253c8,_0x5397ef[_0xc89d('0x48')]);var _0x385b12={'where':_0x3253c8[_0xc89d('0x43')]};return db['Trigger'][_0xc89d('0x22')](_0x385b12)[_0xc89d('0x2a')](function(_0xa94c5){_0x495529[_0xc89d('0x22')]=_0xa94c5;if(_0x5397ef['query'][_0xc89d('0x49')]){_0x3253c8['include']=[{'all':!![]}];}return db['Trigger']['findAll'](_0x3253c8);})[_0xc89d('0x2a')](function(_0x3dee43){_0x495529['rows']=_0x3dee43;return _0x495529;})['then'](respondWithFilteredResult(_0x3b4807,_0x3253c8))['catch'](handleError(_0x3b4807,null));};exports[_0xc89d('0x4a')]=function(_0x5726b4,_0x542b93){var _0x5afb20={'raw':![],'where':{'id':_0x5726b4[_0xc89d('0x4b')]['id']}},_0x4e5ca8={};_0x4e5ca8[_0xc89d('0x38')]=_[_0xc89d('0x3a')](db[_0xc89d('0x4c')][_0xc89d('0x34')]);_0x4e5ca8[_0xc89d('0x39')]=_[_0xc89d('0x3a')](_0x5726b4[_0xc89d('0x39')]);_0x4e5ca8[_0xc89d('0x3b')]=_[_0xc89d('0x3c')](_0x4e5ca8[_0xc89d('0x38')],_0x4e5ca8[_0xc89d('0x39')]);_0x5afb20['attributes']=_[_0xc89d('0x3c')](_0x4e5ca8['model'],qs[_0xc89d('0x3e')](_0x5726b4[_0xc89d('0x39')][_0xc89d('0x3e')]));_0x5afb20['attributes']=_0x5afb20['attributes']['length']?_0x5afb20[_0xc89d('0x3d')]:_0x4e5ca8['model'];if(_0x5726b4['query'][_0xc89d('0x49')]){_0x5afb20['include']=[{'all':!![]}];}_0x5afb20=_['merge']({},_0x5afb20,_0x5726b4[_0xc89d('0x48')]);return db[_0xc89d('0x4c')][_0xc89d('0x4d')](_0x5afb20)[_0xc89d('0x2a')](handleEntityNotFound(_0x542b93,null))['then'](respondWithResult(_0x542b93,null))[_0xc89d('0x4e')](handleError(_0x542b93,null));};exports['create']=function(_0x36ed63,_0x2a8300){return db[_0xc89d('0x4c')][_0xc89d('0x4f')](_0x36ed63[_0xc89d('0x50')],{})['then'](function(_0x5bf4a2){var _0x1e8b48=_0x36ed63[_0xc89d('0x51')][_0xc89d('0x2c')]({'plain':!![]});if(!_0x1e8b48)throw new Error(_0xc89d('0x52'));if(_0x1e8b48['role']==='user'){var _0x586047=_0x5bf4a2['get']({'plain':!![]});var _0xc9c7e1='Triggers';return db['UserProfileSection'][_0xc89d('0x4d')]({'where':{'name':_0xc9c7e1,'userProfileId':_0x1e8b48[_0xc89d('0x53')]},'raw':!![]})[_0xc89d('0x2a')](function(_0x2accd9){if(_0x2accd9&&_0x2accd9[_0xc89d('0x54')]===0x0){return db[_0xc89d('0x2e')]['create']({'name':_0x586047['name'],'resourceId':_0x586047['id'],'type':_0x2accd9[_0xc89d('0x31')],'sectionId':_0x2accd9['id']},{})[_0xc89d('0x2a')](function(){return _0x5bf4a2;});}else{return _0x5bf4a2;}})[_0xc89d('0x4e')](function(_0x1642a6){logger[_0xc89d('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1642a6);throw _0x1642a6;});}return _0x5bf4a2;})[_0xc89d('0x2a')](respondWithResult(_0x2a8300,0xc9))[_0xc89d('0x4e')](handleError(_0x2a8300,null));};exports['update']=function(_0x1a250e,_0x176532){if(_0x1a250e[_0xc89d('0x50')]['id']){delete _0x1a250e[_0xc89d('0x50')]['id'];}return db[_0xc89d('0x4c')][_0xc89d('0x4d')]({'where':{'id':_0x1a250e['params']['id']}})['then'](handleEntityNotFound(_0x176532,null))[_0xc89d('0x2a')](saveUpdates(_0x1a250e['body'],null))[_0xc89d('0x2a')](respondWithResult(_0x176532,null))[_0xc89d('0x4e')](handleError(_0x176532,null));};exports[_0xc89d('0x2b')]=function(_0x5980f8,_0x39014a){return db['Trigger'][_0xc89d('0x4d')]({'where':{'id':_0x5980f8[_0xc89d('0x4b')]['id']}})[_0xc89d('0x2a')](handleEntityNotFound(_0x39014a,null))[_0xc89d('0x2a')](removeEntity(_0x39014a,null))[_0xc89d('0x4e')](handleError(_0x39014a,null));};exports['addAllCondition']=function(_0x1d88d3,_0x13d9ec,_0x5a42d8){if(_0x1d88d3['body']['id']){delete _0x1d88d3[_0xc89d('0x50')]['id'];}return db[_0xc89d('0x4c')][_0xc89d('0x4d')]({'where':{'id':_0x1d88d3['params']['id']}})['then'](handleEntityNotFound(_0x13d9ec,null))['then'](function(_0x312a39){if(_0x312a39){_0x1d88d3['body'][_0xc89d('0x55')]=_0x312a39['id'];return db['Condition'][_0xc89d('0x4f')](_0x1d88d3[_0xc89d('0x50')]);}})[_0xc89d('0x2a')](respondWithResult(_0x13d9ec,null))[_0xc89d('0x4e')](handleError(_0x13d9ec,null));};exports[_0xc89d('0x56')]=function(_0xbe8f3a,_0xb4d7c5,_0x3a0166){if(_0xbe8f3a[_0xc89d('0x50')]['id']){delete _0xbe8f3a[_0xc89d('0x50')]['id'];}return db['Trigger'][_0xc89d('0x4d')]({'where':{'id':_0xbe8f3a['params']['id']}})[_0xc89d('0x2a')](handleEntityNotFound(_0xb4d7c5,null))[_0xc89d('0x2a')](function(_0x4429fd){if(_0x4429fd){_0xbe8f3a['body'][_0xc89d('0x57')]=_0x4429fd['id'];return db[_0xc89d('0x58')][_0xc89d('0x4f')](_0xbe8f3a[_0xc89d('0x50')]);}})[_0xc89d('0x2a')](respondWithResult(_0xb4d7c5,null))['catch'](handleError(_0xb4d7c5,null));};exports['getAllConditions']=function(_0x778c05,_0x380be6,_0x3539a0){var _0x4bef6f={};var _0x51d3f6={};var _0x6da101;var _0x3c919d;return db[_0xc89d('0x4c')][_0xc89d('0x59')]({'where':{'id':_0x778c05[_0xc89d('0x4b')]['id']}})['then'](handleEntityNotFound(_0x380be6,null))[_0xc89d('0x2a')](function(_0x3b32fc){if(_0x3b32fc){_0x6da101=_0x3b32fc;_0x51d3f6[_0xc89d('0x38')]=_[_0xc89d('0x3a')](db['Condition'][_0xc89d('0x34')]);_0x51d3f6[_0xc89d('0x39')]=_[_0xc89d('0x3a')](_0x778c05[_0xc89d('0x39')]);_0x51d3f6['filters']=_[_0xc89d('0x3c')](_0x51d3f6['model'],_0x51d3f6[_0xc89d('0x39')]);_0x4bef6f[_0xc89d('0x3d')]=_[_0xc89d('0x3c')](_0x51d3f6['model'],qs[_0xc89d('0x3e')](_0x778c05[_0xc89d('0x39')]['fields']));_0x4bef6f[_0xc89d('0x3d')]=_0x4bef6f[_0xc89d('0x3d')]['length']?_0x4bef6f['attributes']:_0x51d3f6[_0xc89d('0x38')];_0x4bef6f['order']=qs[_0xc89d('0x42')](_0x778c05['query'][_0xc89d('0x42')]);_0x4bef6f[_0xc89d('0x43')]=qs[_0xc89d('0x3b')](_['pick'](_0x778c05[_0xc89d('0x39')],_0x51d3f6[_0xc89d('0x3b')]));if(_0x778c05[_0xc89d('0x39')][_0xc89d('0x45')]){_0x4bef6f[_0xc89d('0x43')]=_[_0xc89d('0x5a')](_0x4bef6f['where'],{'$or':_[_0xc89d('0x46')](_0x4bef6f[_0xc89d('0x3d')],function(_0x3b6ecc){var _0x5f0fb1={};_0x5f0fb1[_0x3b6ecc]={'$like':'%'+_0x778c05[_0xc89d('0x39')][_0xc89d('0x45')]+'%'};return _0x5f0fb1;})});}_0x4bef6f=_[_0xc89d('0x5a')]({},_0x4bef6f,_0x778c05[_0xc89d('0x48')]);return _0x6da101['getAllConditions'](_0x4bef6f);}})[_0xc89d('0x2a')](function(_0x54d2be){if(_0x54d2be){_0x3c919d=_0x54d2be['length'];if(!_0x778c05[_0xc89d('0x39')][_0xc89d('0x5b')](_0xc89d('0x40'))){_0x4bef6f[_0xc89d('0x21')]=qs[_0xc89d('0x21')](_0x778c05[_0xc89d('0x39')][_0xc89d('0x21')]);_0x4bef6f[_0xc89d('0x23')]=qs[_0xc89d('0x23')](_0x778c05[_0xc89d('0x39')][_0xc89d('0x23')]);}return _0x6da101[_0xc89d('0x5c')](_0x4bef6f);}})[_0xc89d('0x2a')](function(_0x1892a5){if(_0x1892a5){return _0x1892a5?{'count':_0x3c919d,'rows':_0x1892a5}:null;}})[_0xc89d('0x2a')](respondWithResult(_0x380be6,null))['catch'](handleError(_0x380be6,null));};exports['getAnyConditions']=function(_0x450516,_0x3b59ce,_0x8820e7){var _0xa2f0eb={};var _0x2e5917={};var _0x28aee1;var _0x2aee65;return db[_0xc89d('0x4c')][_0xc89d('0x59')]({'where':{'id':_0x450516[_0xc89d('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3b59ce,null))[_0xc89d('0x2a')](function(_0x5b15dd){if(_0x5b15dd){_0x28aee1=_0x5b15dd;_0x2e5917['model']=_[_0xc89d('0x3a')](db[_0xc89d('0x58')][_0xc89d('0x34')]);_0x2e5917[_0xc89d('0x39')]=_[_0xc89d('0x3a')](_0x450516[_0xc89d('0x39')]);_0x2e5917['filters']=_[_0xc89d('0x3c')](_0x2e5917['model'],_0x2e5917[_0xc89d('0x39')]);_0xa2f0eb[_0xc89d('0x3d')]=_[_0xc89d('0x3c')](_0x2e5917['model'],qs[_0xc89d('0x3e')](_0x450516[_0xc89d('0x39')][_0xc89d('0x3e')]));_0xa2f0eb['attributes']=_0xa2f0eb[_0xc89d('0x3d')][_0xc89d('0x3f')]?_0xa2f0eb[_0xc89d('0x3d')]:_0x2e5917[_0xc89d('0x38')];_0xa2f0eb['order']=qs[_0xc89d('0x42')](_0x450516[_0xc89d('0x39')][_0xc89d('0x42')]);_0xa2f0eb[_0xc89d('0x43')]=qs['filters'](_[_0xc89d('0x44')](_0x450516[_0xc89d('0x39')],_0x2e5917[_0xc89d('0x3b')]));if(_0x450516[_0xc89d('0x39')][_0xc89d('0x45')]){_0xa2f0eb[_0xc89d('0x43')]=_['merge'](_0xa2f0eb[_0xc89d('0x43')],{'$or':_[_0xc89d('0x46')](_0xa2f0eb[_0xc89d('0x3d')],function(_0x3a1345){var _0x371449={};_0x371449[_0x3a1345]={'$like':'%'+_0x450516[_0xc89d('0x39')][_0xc89d('0x45')]+'%'};return _0x371449;})});}_0xa2f0eb=_['merge']({},_0xa2f0eb,_0x450516['options']);return _0x28aee1[_0xc89d('0x5d')](_0xa2f0eb);}})[_0xc89d('0x2a')](function(_0x11b07d){if(_0x11b07d){_0x2aee65=_0x11b07d['length'];if(!_0x450516[_0xc89d('0x39')][_0xc89d('0x5b')](_0xc89d('0x40'))){_0xa2f0eb['limit']=qs[_0xc89d('0x21')](_0x450516['query'][_0xc89d('0x21')]);_0xa2f0eb[_0xc89d('0x23')]=qs[_0xc89d('0x23')](_0x450516['query'][_0xc89d('0x23')]);}return _0x28aee1['getAnyConditions'](_0xa2f0eb);}})[_0xc89d('0x2a')](function(_0x302d14){if(_0x302d14){return _0x302d14?{'count':_0x2aee65,'rows':_0x302d14}:null;}})['then'](respondWithResult(_0x3b59ce,null))[_0xc89d('0x4e')](handleError(_0x3b59ce,null));};exports[_0xc89d('0x5e')]=function(_0x2ac1f7,_0x4418c8,_0x3a01c6){if(_0x2ac1f7[_0xc89d('0x50')]['id']){delete _0x2ac1f7['body']['id'];}return db['Trigger'][_0xc89d('0x4d')]({'where':{'id':_0x2ac1f7[_0xc89d('0x4b')]['id']}})[_0xc89d('0x2a')](handleEntityNotFound(_0x4418c8,null))[_0xc89d('0x2a')](function(_0x598c00){if(_0x598c00){_0x2ac1f7['body']['TriggerId']=_0x598c00['id'];return db[_0xc89d('0x5f')][_0xc89d('0x4f')](_0x2ac1f7[_0xc89d('0x50')]);}})['then'](respondWithResult(_0x4418c8,null))['catch'](handleError(_0x4418c8,null));};exports[_0xc89d('0x60')]=function(_0x15ae6c,_0x25a4ec,_0x26e556){var _0x43f8fe={};var _0x180381={};var _0x17bc8d;var _0x4788e5;return db[_0xc89d('0x4c')][_0xc89d('0x59')]({'where':{'id':_0x15ae6c[_0xc89d('0x4b')]['id']}})['then'](handleEntityNotFound(_0x25a4ec,null))[_0xc89d('0x2a')](function(_0x330b8e){if(_0x330b8e){_0x17bc8d=_0x330b8e;_0x180381['model']=_[_0xc89d('0x3a')](db['Action']['rawAttributes']);_0x180381[_0xc89d('0x39')]=_[_0xc89d('0x3a')](_0x15ae6c['query']);_0x180381[_0xc89d('0x3b')]=_['intersection'](_0x180381[_0xc89d('0x38')],_0x180381['query']);_0x43f8fe['attributes']=_[_0xc89d('0x3c')](_0x180381[_0xc89d('0x38')],qs[_0xc89d('0x3e')](_0x15ae6c[_0xc89d('0x39')][_0xc89d('0x3e')]));_0x43f8fe[_0xc89d('0x3d')]=_0x43f8fe['attributes'][_0xc89d('0x3f')]?_0x43f8fe[_0xc89d('0x3d')]:_0x180381[_0xc89d('0x38')];_0x43f8fe[_0xc89d('0x41')]=qs[_0xc89d('0x42')](_0x15ae6c['query'][_0xc89d('0x42')]);_0x43f8fe[_0xc89d('0x43')]=qs[_0xc89d('0x3b')](_[_0xc89d('0x44')](_0x15ae6c[_0xc89d('0x39')],_0x180381[_0xc89d('0x3b')]));if(_0x15ae6c['query'][_0xc89d('0x45')]){_0x43f8fe[_0xc89d('0x43')]=_[_0xc89d('0x5a')](_0x43f8fe[_0xc89d('0x43')],{'$or':_[_0xc89d('0x46')](_0x43f8fe['attributes'],function(_0x2ed0bd){var _0x31f067={};_0x31f067[_0x2ed0bd]={'$like':'%'+_0x15ae6c[_0xc89d('0x39')][_0xc89d('0x45')]+'%'};return _0x31f067;})});}_0x43f8fe=_[_0xc89d('0x5a')]({},_0x43f8fe,_0x15ae6c[_0xc89d('0x48')]);return _0x17bc8d[_0xc89d('0x60')](_0x43f8fe);}})[_0xc89d('0x2a')](function(_0x4d66a6){if(_0x4d66a6){_0x4788e5=_0x4d66a6['length'];if(!_0x15ae6c['query'][_0xc89d('0x5b')](_0xc89d('0x40'))){_0x43f8fe[_0xc89d('0x21')]=qs[_0xc89d('0x21')](_0x15ae6c[_0xc89d('0x39')][_0xc89d('0x21')]);_0x43f8fe[_0xc89d('0x23')]=qs[_0xc89d('0x23')](_0x15ae6c[_0xc89d('0x39')][_0xc89d('0x23')]);}return _0x17bc8d[_0xc89d('0x60')](_0x43f8fe);}})[_0xc89d('0x2a')](function(_0x5e0737){if(_0x5e0737){return _0x5e0737?{'count':_0x4788e5,'rows':_0x5e0737}:null;}})[_0xc89d('0x2a')](respondWithResult(_0x25a4ec,null))[_0xc89d('0x4e')](handleError(_0x25a4ec,null));}; \ No newline at end of file +var _0x4db8=['TriggerAllId','Condition','addAnyCondition','getAllConditions','findOne','hasOwnProperty','getAnyConditions','map','addAction','TriggerId','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','update','then','get','Triggers','UserProfileResource','stack','name','send','Trigger','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','find','params','destroy'];(function(_0x212fcc,_0x1a8867){var _0x4d8190=function(_0x347f7b){while(--_0x347f7b){_0x212fcc['push'](_0x212fcc['shift']());}};_0x4d8190(++_0x1a8867);}(_0x4db8,0x66));var _0x84db=function(_0x4e1015,_0x4225a5){_0x4e1015=_0x4e1015-0x0;var _0x3371dd=_0x4db8[_0x4e1015];return _0x3371dd;};'use strict';var emlformat=require(_0x84db('0x0'));var rimraf=require(_0x84db('0x1'));var zipdir=require(_0x84db('0x2'));var jsonpatch=require(_0x84db('0x3'));var rp=require(_0x84db('0x4'));var moment=require('moment');var BPromise=require(_0x84db('0x5'));var Mustache=require('mustache');var util=require(_0x84db('0x6'));var path=require('path');var sox=require(_0x84db('0x7'));var csv=require(_0x84db('0x8'));var ejs=require(_0x84db('0x9'));var fs=require('fs');var fs_extra=require(_0x84db('0xa'));var _=require(_0x84db('0xb'));var squel=require(_0x84db('0xc'));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(_0x84db('0xd'));var Redis=require('ioredis');var authService=require(_0x84db('0xe'));var qs=require(_0x84db('0xf'));var as=require(_0x84db('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x84db('0x11'))(_0x84db('0x12'));var utils=require('../../config/utils');var config=require(_0x84db('0x13'));var licenseUtil=require(_0x84db('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x38c4f5,_0x3e1d32){_0x3e1d32=_0x3e1d32||0xcc;return function(_0x1c032c){if(_0x1c032c){return _0x38c4f5[_0x84db('0x15')](_0x3e1d32);}return _0x38c4f5[_0x84db('0x16')](_0x3e1d32)[_0x84db('0x17')]();};}function respondWithResult(_0x5a3b7b,_0x1053f6){_0x1053f6=_0x1053f6||0xc8;return function(_0x5aefc7){if(_0x5aefc7){return _0x5a3b7b[_0x84db('0x16')](_0x1053f6)[_0x84db('0x18')](_0x5aefc7);}};}function respondWithFilteredResult(_0x11d77f,_0xfc40b4){return function(_0x59066a){if(_0x59066a){var _0x1dff3c=typeof _0xfc40b4[_0x84db('0x19')]==='undefined'&&typeof _0xfc40b4['limit']===_0x84db('0x1a');var _0x3c86b8=_0x59066a[_0x84db('0x1b')];var _0x45fe1a=_0x1dff3c?0x0:_0xfc40b4[_0x84db('0x19')];var _0x337aa3=_0x1dff3c?_0x59066a[_0x84db('0x1b')]:_0xfc40b4['offset']+_0xfc40b4[_0x84db('0x1c')];var _0x1ae17b;if(_0x337aa3>=_0x3c86b8){_0x337aa3=_0x3c86b8;_0x1ae17b=0xc8;}else{_0x1ae17b=0xce;}_0x11d77f['status'](_0x1ae17b);return _0x11d77f[_0x84db('0x1d')]('Content-Range',_0x45fe1a+'-'+_0x337aa3+'/'+_0x3c86b8)[_0x84db('0x18')](_0x59066a);}return null;};}function patchUpdates(_0x518c0a){return function(_0x12fb86){try{jsonpatch[_0x84db('0x1e')](_0x12fb86,_0x518c0a,!![]);}catch(_0x577035){return BPromise[_0x84db('0x1f')](_0x577035);}return _0x12fb86['save']();};}function saveUpdates(_0x34b0e7,_0x34542e){return function(_0x2e2360){if(_0x2e2360){return _0x2e2360[_0x84db('0x20')](_0x34b0e7)[_0x84db('0x21')](function(_0xc9c8a){return _0xc9c8a;});}return null;};}function removeEntity(_0x50e2dd,_0x1628a2){return function(_0x16e6fc){if(_0x16e6fc){return _0x16e6fc['destroy']()[_0x84db('0x21')](function(){var _0x53f277=_0x16e6fc[_0x84db('0x22')]({'plain':!![]});var _0x2d086a=_0x84db('0x23');return db[_0x84db('0x24')]['destroy']({'where':{'type':_0x2d086a,'resourceId':_0x53f277['id']}})[_0x84db('0x21')](function(){return _0x16e6fc;});})[_0x84db('0x21')](function(){_0x50e2dd[_0x84db('0x16')](0xcc)[_0x84db('0x17')]();});}};}function handleEntityNotFound(_0xc25f8e,_0x4400eb){return function(_0x2777b4){if(!_0x2777b4){_0xc25f8e[_0x84db('0x15')](0x194);}return _0x2777b4;};}function handleError(_0x3edf57,_0x5cb9e9){_0x5cb9e9=_0x5cb9e9||0x1f4;return function(_0x1f7648){logger['error'](_0x1f7648[_0x84db('0x25')]);if(_0x1f7648[_0x84db('0x26')]){delete _0x1f7648[_0x84db('0x26')];}_0x3edf57[_0x84db('0x16')](_0x5cb9e9)[_0x84db('0x27')](_0x1f7648);};}exports['index']=function(_0x406ca3,_0x110190){var _0x20e079={},_0x464ed7={},_0xb71640={'count':0x0,'rows':[]};var _0x39c939=_['map'](db[_0x84db('0x28')][_0x84db('0x29')],function(_0xba2be5){return{'name':_0xba2be5[_0x84db('0x2a')],'type':_0xba2be5[_0x84db('0x2b')]['key']};});_0x464ed7[_0x84db('0x2c')]=_['map'](_0x39c939,_0x84db('0x26'));_0x464ed7[_0x84db('0x2d')]=_[_0x84db('0x2e')](_0x406ca3[_0x84db('0x2d')]);_0x464ed7[_0x84db('0x2f')]=_[_0x84db('0x30')](_0x464ed7[_0x84db('0x2c')],_0x464ed7[_0x84db('0x2d')]);_0x20e079['attributes']=_[_0x84db('0x30')](_0x464ed7[_0x84db('0x2c')],qs[_0x84db('0x31')](_0x406ca3[_0x84db('0x2d')][_0x84db('0x31')]));_0x20e079[_0x84db('0x32')]=_0x20e079[_0x84db('0x32')][_0x84db('0x33')]?_0x20e079[_0x84db('0x32')]:_0x464ed7[_0x84db('0x2c')];if(!_0x406ca3[_0x84db('0x2d')]['hasOwnProperty'](_0x84db('0x34'))){_0x20e079[_0x84db('0x1c')]=qs[_0x84db('0x1c')](_0x406ca3[_0x84db('0x2d')][_0x84db('0x1c')]);_0x20e079[_0x84db('0x19')]=qs[_0x84db('0x19')](_0x406ca3['query'][_0x84db('0x19')]);}_0x20e079[_0x84db('0x35')]=qs[_0x84db('0x36')](_0x406ca3[_0x84db('0x2d')][_0x84db('0x36')]);_0x20e079[_0x84db('0x37')]=qs[_0x84db('0x2f')](_[_0x84db('0x38')](_0x406ca3[_0x84db('0x2d')],_0x464ed7['filters']),_0x39c939);if(_0x406ca3[_0x84db('0x2d')][_0x84db('0x39')]){_0x20e079['where']=_[_0x84db('0x3a')](_0x20e079[_0x84db('0x37')],{'$or':_['map'](_0x39c939,function(_0x54129b){if(_0x54129b[_0x84db('0x2b')]!==_0x84db('0x3b')){var _0x4208f9={};_0x4208f9[_0x54129b[_0x84db('0x26')]]={'$like':'%'+_0x406ca3[_0x84db('0x2d')][_0x84db('0x39')]+'%'};return _0x4208f9;}})});}_0x20e079=_['merge']({},_0x20e079,_0x406ca3[_0x84db('0x3c')]);var _0x57fc53={'where':_0x20e079['where']};return db['Trigger'][_0x84db('0x1b')](_0x57fc53)[_0x84db('0x21')](function(_0x4d2002){_0xb71640['count']=_0x4d2002;if(_0x406ca3[_0x84db('0x2d')]['includeAll']){_0x20e079[_0x84db('0x3d')]=[{'all':!![]}];}return db[_0x84db('0x28')][_0x84db('0x3e')](_0x20e079);})[_0x84db('0x21')](function(_0x30583d){_0xb71640[_0x84db('0x3f')]=_0x30583d;return _0xb71640;})[_0x84db('0x21')](respondWithFilteredResult(_0x110190,_0x20e079))[_0x84db('0x40')](handleError(_0x110190,null));};exports[_0x84db('0x41')]=function(_0x3e3535,_0x5ef94e){var _0x5aab28={'raw':![],'where':{'id':_0x3e3535['params']['id']}},_0x58bba3={};_0x58bba3['model']=_['keys'](db[_0x84db('0x28')]['rawAttributes']);_0x58bba3['query']=_[_0x84db('0x2e')](_0x3e3535[_0x84db('0x2d')]);_0x58bba3[_0x84db('0x2f')]=_[_0x84db('0x30')](_0x58bba3[_0x84db('0x2c')],_0x58bba3[_0x84db('0x2d')]);_0x5aab28[_0x84db('0x32')]=_[_0x84db('0x30')](_0x58bba3[_0x84db('0x2c')],qs[_0x84db('0x31')](_0x3e3535[_0x84db('0x2d')][_0x84db('0x31')]));_0x5aab28[_0x84db('0x32')]=_0x5aab28[_0x84db('0x32')][_0x84db('0x33')]?_0x5aab28[_0x84db('0x32')]:_0x58bba3[_0x84db('0x2c')];if(_0x3e3535[_0x84db('0x2d')][_0x84db('0x42')]){_0x5aab28['include']=[{'all':!![]}];}_0x5aab28=_[_0x84db('0x3a')]({},_0x5aab28,_0x3e3535[_0x84db('0x3c')]);return db[_0x84db('0x28')]['find'](_0x5aab28)[_0x84db('0x21')](handleEntityNotFound(_0x5ef94e,null))[_0x84db('0x21')](respondWithResult(_0x5ef94e,null))[_0x84db('0x40')](handleError(_0x5ef94e,null));};exports[_0x84db('0x43')]=function(_0x20ed4a,_0x26bd85){return db[_0x84db('0x28')][_0x84db('0x43')](_0x20ed4a[_0x84db('0x44')],{})[_0x84db('0x21')](function(_0x30802a){var _0x2dbf4d=_0x20ed4a[_0x84db('0x45')][_0x84db('0x22')]({'plain':!![]});if(!_0x2dbf4d)throw new Error(_0x84db('0x46'));if(_0x2dbf4d[_0x84db('0x47')]===_0x84db('0x45')){var _0x56206b=_0x30802a[_0x84db('0x22')]({'plain':!![]});var _0x1a1d78=_0x84db('0x23');return db[_0x84db('0x48')]['find']({'where':{'name':_0x1a1d78,'userProfileId':_0x2dbf4d[_0x84db('0x49')]},'raw':!![]})[_0x84db('0x21')](function(_0x459bce){if(_0x459bce&&_0x459bce['autoAssociation']===0x0){return db[_0x84db('0x24')][_0x84db('0x43')]({'name':_0x56206b[_0x84db('0x26')],'resourceId':_0x56206b['id'],'type':_0x459bce[_0x84db('0x26')],'sectionId':_0x459bce['id']},{})[_0x84db('0x21')](function(){return _0x30802a;});}else{return _0x30802a;}})[_0x84db('0x40')](function(_0x326285){logger[_0x84db('0x4a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x326285);throw _0x326285;});}return _0x30802a;})[_0x84db('0x21')](respondWithResult(_0x26bd85,0xc9))[_0x84db('0x40')](handleError(_0x26bd85,null));};exports[_0x84db('0x20')]=function(_0x5995f5,_0x5c9ecf){if(_0x5995f5['body']['id']){delete _0x5995f5[_0x84db('0x44')]['id'];}return db[_0x84db('0x28')][_0x84db('0x4b')]({'where':{'id':_0x5995f5[_0x84db('0x4c')]['id']}})[_0x84db('0x21')](handleEntityNotFound(_0x5c9ecf,null))[_0x84db('0x21')](saveUpdates(_0x5995f5[_0x84db('0x44')],null))['then'](respondWithResult(_0x5c9ecf,null))[_0x84db('0x40')](handleError(_0x5c9ecf,null));};exports[_0x84db('0x4d')]=function(_0x49e0ac,_0x46723f){return db[_0x84db('0x28')][_0x84db('0x4b')]({'where':{'id':_0x49e0ac['params']['id']}})[_0x84db('0x21')](handleEntityNotFound(_0x46723f,null))[_0x84db('0x21')](removeEntity(_0x46723f,null))['catch'](handleError(_0x46723f,null));};exports['addAllCondition']=function(_0x31fc11,_0x1705ad,_0x26e5a8){if(_0x31fc11[_0x84db('0x44')]['id']){delete _0x31fc11['body']['id'];}return db['Trigger'][_0x84db('0x4b')]({'where':{'id':_0x31fc11[_0x84db('0x4c')]['id']}})[_0x84db('0x21')](handleEntityNotFound(_0x1705ad,null))[_0x84db('0x21')](function(_0x1dee0b){if(_0x1dee0b){_0x31fc11['body'][_0x84db('0x4e')]=_0x1dee0b['id'];return db[_0x84db('0x4f')][_0x84db('0x43')](_0x31fc11[_0x84db('0x44')]);}})[_0x84db('0x21')](respondWithResult(_0x1705ad,null))[_0x84db('0x40')](handleError(_0x1705ad,null));};exports[_0x84db('0x50')]=function(_0x13bc3b,_0x3a862d,_0x3f4099){if(_0x13bc3b[_0x84db('0x44')]['id']){delete _0x13bc3b['body']['id'];}return db[_0x84db('0x28')][_0x84db('0x4b')]({'where':{'id':_0x13bc3b[_0x84db('0x4c')]['id']}})[_0x84db('0x21')](handleEntityNotFound(_0x3a862d,null))['then'](function(_0x494316){if(_0x494316){_0x13bc3b[_0x84db('0x44')]['TriggerAnyId']=_0x494316['id'];return db[_0x84db('0x4f')][_0x84db('0x43')](_0x13bc3b[_0x84db('0x44')]);}})[_0x84db('0x21')](respondWithResult(_0x3a862d,null))[_0x84db('0x40')](handleError(_0x3a862d,null));};exports[_0x84db('0x51')]=function(_0xca77f,_0x562f9a,_0x41e2b0){var _0x4c0cde={};var _0x798250={};var _0x6e16f3;var _0x33242c;return db[_0x84db('0x28')][_0x84db('0x52')]({'where':{'id':_0xca77f[_0x84db('0x4c')]['id']}})[_0x84db('0x21')](handleEntityNotFound(_0x562f9a,null))['then'](function(_0x3ca79f){if(_0x3ca79f){_0x6e16f3=_0x3ca79f;_0x798250[_0x84db('0x2c')]=_[_0x84db('0x2e')](db[_0x84db('0x4f')]['rawAttributes']);_0x798250[_0x84db('0x2d')]=_[_0x84db('0x2e')](_0xca77f['query']);_0x798250[_0x84db('0x2f')]=_[_0x84db('0x30')](_0x798250[_0x84db('0x2c')],_0x798250[_0x84db('0x2d')]);_0x4c0cde['attributes']=_['intersection'](_0x798250[_0x84db('0x2c')],qs[_0x84db('0x31')](_0xca77f[_0x84db('0x2d')][_0x84db('0x31')]));_0x4c0cde[_0x84db('0x32')]=_0x4c0cde[_0x84db('0x32')][_0x84db('0x33')]?_0x4c0cde['attributes']:_0x798250[_0x84db('0x2c')];_0x4c0cde[_0x84db('0x35')]=qs['sort'](_0xca77f['query'][_0x84db('0x36')]);_0x4c0cde[_0x84db('0x37')]=qs['filters'](_[_0x84db('0x38')](_0xca77f['query'],_0x798250['filters']));if(_0xca77f[_0x84db('0x2d')][_0x84db('0x39')]){_0x4c0cde[_0x84db('0x37')]=_[_0x84db('0x3a')](_0x4c0cde[_0x84db('0x37')],{'$or':_['map'](_0x4c0cde[_0x84db('0x32')],function(_0x1fd119){var _0x3a089c={};_0x3a089c[_0x1fd119]={'$like':'%'+_0xca77f['query']['filter']+'%'};return _0x3a089c;})});}_0x4c0cde=_['merge']({},_0x4c0cde,_0xca77f[_0x84db('0x3c')]);return _0x6e16f3[_0x84db('0x51')](_0x4c0cde);}})[_0x84db('0x21')](function(_0x4a9779){if(_0x4a9779){_0x33242c=_0x4a9779[_0x84db('0x33')];if(!_0xca77f['query'][_0x84db('0x53')](_0x84db('0x34'))){_0x4c0cde['limit']=qs[_0x84db('0x1c')](_0xca77f['query'][_0x84db('0x1c')]);_0x4c0cde[_0x84db('0x19')]=qs['offset'](_0xca77f[_0x84db('0x2d')][_0x84db('0x19')]);}return _0x6e16f3[_0x84db('0x51')](_0x4c0cde);}})[_0x84db('0x21')](function(_0x3a73a9){if(_0x3a73a9){return _0x3a73a9?{'count':_0x33242c,'rows':_0x3a73a9}:null;}})[_0x84db('0x21')](respondWithResult(_0x562f9a,null))[_0x84db('0x40')](handleError(_0x562f9a,null));};exports[_0x84db('0x54')]=function(_0x4dbdc6,_0x32805a,_0x423d24){var _0xffce59={};var _0x36b377={};var _0x44dd68;var _0x4c56bf;return db[_0x84db('0x28')][_0x84db('0x52')]({'where':{'id':_0x4dbdc6[_0x84db('0x4c')]['id']}})[_0x84db('0x21')](handleEntityNotFound(_0x32805a,null))[_0x84db('0x21')](function(_0x473d72){if(_0x473d72){_0x44dd68=_0x473d72;_0x36b377[_0x84db('0x2c')]=_['keys'](db[_0x84db('0x4f')]['rawAttributes']);_0x36b377[_0x84db('0x2d')]=_[_0x84db('0x2e')](_0x4dbdc6['query']);_0x36b377[_0x84db('0x2f')]=_[_0x84db('0x30')](_0x36b377[_0x84db('0x2c')],_0x36b377[_0x84db('0x2d')]);_0xffce59[_0x84db('0x32')]=_['intersection'](_0x36b377[_0x84db('0x2c')],qs[_0x84db('0x31')](_0x4dbdc6[_0x84db('0x2d')][_0x84db('0x31')]));_0xffce59[_0x84db('0x32')]=_0xffce59[_0x84db('0x32')][_0x84db('0x33')]?_0xffce59[_0x84db('0x32')]:_0x36b377[_0x84db('0x2c')];_0xffce59[_0x84db('0x35')]=qs['sort'](_0x4dbdc6[_0x84db('0x2d')][_0x84db('0x36')]);_0xffce59['where']=qs[_0x84db('0x2f')](_[_0x84db('0x38')](_0x4dbdc6[_0x84db('0x2d')],_0x36b377[_0x84db('0x2f')]));if(_0x4dbdc6['query'][_0x84db('0x39')]){_0xffce59['where']=_[_0x84db('0x3a')](_0xffce59[_0x84db('0x37')],{'$or':_[_0x84db('0x55')](_0xffce59[_0x84db('0x32')],function(_0x48da32){var _0x52af20={};_0x52af20[_0x48da32]={'$like':'%'+_0x4dbdc6['query'][_0x84db('0x39')]+'%'};return _0x52af20;})});}_0xffce59=_['merge']({},_0xffce59,_0x4dbdc6[_0x84db('0x3c')]);return _0x44dd68[_0x84db('0x54')](_0xffce59);}})['then'](function(_0x5df439){if(_0x5df439){_0x4c56bf=_0x5df439[_0x84db('0x33')];if(!_0x4dbdc6['query'][_0x84db('0x53')](_0x84db('0x34'))){_0xffce59[_0x84db('0x1c')]=qs[_0x84db('0x1c')](_0x4dbdc6[_0x84db('0x2d')][_0x84db('0x1c')]);_0xffce59[_0x84db('0x19')]=qs[_0x84db('0x19')](_0x4dbdc6['query'][_0x84db('0x19')]);}return _0x44dd68[_0x84db('0x54')](_0xffce59);}})[_0x84db('0x21')](function(_0x1f740a){if(_0x1f740a){return _0x1f740a?{'count':_0x4c56bf,'rows':_0x1f740a}:null;}})[_0x84db('0x21')](respondWithResult(_0x32805a,null))['catch'](handleError(_0x32805a,null));};exports[_0x84db('0x56')]=function(_0x45f999,_0xd53b68,_0x18c539){if(_0x45f999[_0x84db('0x44')]['id']){delete _0x45f999[_0x84db('0x44')]['id'];}return db['Trigger']['find']({'where':{'id':_0x45f999[_0x84db('0x4c')]['id']}})[_0x84db('0x21')](handleEntityNotFound(_0xd53b68,null))[_0x84db('0x21')](function(_0x1f708e){if(_0x1f708e){_0x45f999[_0x84db('0x44')][_0x84db('0x57')]=_0x1f708e['id'];return db[_0x84db('0x58')][_0x84db('0x43')](_0x45f999[_0x84db('0x44')]);}})['then'](respondWithResult(_0xd53b68,null))[_0x84db('0x40')](handleError(_0xd53b68,null));};exports['getActions']=function(_0x40967f,_0x262e1e,_0x6fcf75){var _0x4afd11={};var _0x1f3114={};var _0x54bdeb;var _0x195712;return db[_0x84db('0x28')][_0x84db('0x52')]({'where':{'id':_0x40967f[_0x84db('0x4c')]['id']}})[_0x84db('0x21')](handleEntityNotFound(_0x262e1e,null))[_0x84db('0x21')](function(_0x147818){if(_0x147818){_0x54bdeb=_0x147818;_0x1f3114['model']=_[_0x84db('0x2e')](db['Action'][_0x84db('0x29')]);_0x1f3114['query']=_[_0x84db('0x2e')](_0x40967f[_0x84db('0x2d')]);_0x1f3114[_0x84db('0x2f')]=_[_0x84db('0x30')](_0x1f3114[_0x84db('0x2c')],_0x1f3114['query']);_0x4afd11['attributes']=_['intersection'](_0x1f3114[_0x84db('0x2c')],qs[_0x84db('0x31')](_0x40967f[_0x84db('0x2d')][_0x84db('0x31')]));_0x4afd11[_0x84db('0x32')]=_0x4afd11[_0x84db('0x32')][_0x84db('0x33')]?_0x4afd11['attributes']:_0x1f3114[_0x84db('0x2c')];_0x4afd11[_0x84db('0x35')]=qs[_0x84db('0x36')](_0x40967f[_0x84db('0x2d')][_0x84db('0x36')]);_0x4afd11[_0x84db('0x37')]=qs['filters'](_['pick'](_0x40967f['query'],_0x1f3114['filters']));if(_0x40967f[_0x84db('0x2d')][_0x84db('0x39')]){_0x4afd11[_0x84db('0x37')]=_[_0x84db('0x3a')](_0x4afd11[_0x84db('0x37')],{'$or':_['map'](_0x4afd11['attributes'],function(_0x15b15a){var _0x1c7fd8={};_0x1c7fd8[_0x15b15a]={'$like':'%'+_0x40967f[_0x84db('0x2d')][_0x84db('0x39')]+'%'};return _0x1c7fd8;})});}_0x4afd11=_[_0x84db('0x3a')]({},_0x4afd11,_0x40967f[_0x84db('0x3c')]);return _0x54bdeb[_0x84db('0x59')](_0x4afd11);}})[_0x84db('0x21')](function(_0x29df9f){if(_0x29df9f){_0x195712=_0x29df9f['length'];if(!_0x40967f[_0x84db('0x2d')]['hasOwnProperty']('nolimit')){_0x4afd11[_0x84db('0x1c')]=qs[_0x84db('0x1c')](_0x40967f[_0x84db('0x2d')][_0x84db('0x1c')]);_0x4afd11['offset']=qs[_0x84db('0x19')](_0x40967f[_0x84db('0x2d')][_0x84db('0x19')]);}return _0x54bdeb[_0x84db('0x59')](_0x4afd11);}})['then'](function(_0x44fadf){if(_0x44fadf){return _0x44fadf?{'count':_0x195712,'rows':_0x44fadf}:null;}})[_0x84db('0x21')](respondWithResult(_0x262e1e,null))['catch'](handleError(_0x262e1e,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 32b30a9..e98ba0a 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 _0xb717=['exports','define','Trigger','tools_triggers','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./trigger.attributes'];(function(_0x440580,_0x333f55){var _0x5217a1=function(_0x3ab943){while(--_0x3ab943){_0x440580['push'](_0x440580['shift']());}};_0x5217a1(++_0x333f55);}(_0xb717,0x1b4));var _0x7b71=function(_0x105797,_0x22c2d6){_0x105797=_0x105797-0x0;var _0xf51b78=_0xb717[_0x105797];return _0xf51b78;};'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':!![]});}; \ No newline at end of file +var _0x9a19=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./trigger.attributes','exports','define'];(function(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0x9a19,0x114));var _0x99a1=function(_0x1b4b23,_0x5dd6d6){_0x1b4b23=_0x1b4b23-0x0;var _0x2a325b=_0x9a19[_0x1b4b23];return _0x2a325b;};'use strict';var _=require(_0x99a1('0x0'));var util=require(_0x99a1('0x1'));var logger=require(_0x99a1('0x2'))('api');var moment=require(_0x99a1('0x3'));var BPromise=require(_0x99a1('0x4'));var rp=require(_0x99a1('0x5'));var fs=require('fs');var path=require(_0x99a1('0x6'));var rimraf=require(_0x99a1('0x7'));var config=require(_0x99a1('0x8'));var attributes=require(_0x99a1('0x9'));module[_0x99a1('0xa')]=function(_0x3eff4a,_0xff0240){return _0x3eff4a[_0x99a1('0xb')]('Trigger',attributes,{'tableName':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trigger/trigger.rpc.js b/server/api/trigger/trigger.rpc.js index c2ec63c..03bf93a 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 _0x7237=['request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetTrigger','Trigger','findAll','options','where','limit','include','model','attributes','map','ShowTrigger','find','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Trigger,\x20%s,\x20%s'];(function(_0x5d1b2c,_0x24983e){var _0x648c12=function(_0x57077c){while(--_0x57077c){_0x5d1b2c['push'](_0x5d1b2c['shift']());}};_0x648c12(++_0x24983e);}(_0x7237,0x7d));var _0x7723=function(_0x24a2b0,_0x264053){_0x24a2b0=_0x24a2b0-0x0;var _0x477d85=_0x7237[_0x24a2b0];return _0x477d85;};'use strict';var _=require(_0x7723('0x0'));var util=require(_0x7723('0x1'));var moment=require(_0x7723('0x2'));var BPromise=require('bluebird');var rs=require(_0x7723('0x3'));var fs=require('fs');var Redis=require(_0x7723('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7723('0x5'));var logger=require(_0x7723('0x6'))('rpc');var config=require(_0x7723('0x7'));var jayson=require(_0x7723('0x8'));var client=jayson[_0x7723('0x9')][_0x7723('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2905ce,_0x1df237,_0x5c0c83){return new BPromise(function(_0x2f77b9,_0x252167){return client[_0x7723('0xb')](_0x2905ce,_0x5c0c83)[_0x7723('0xc')](function(_0x16b0fd){logger[_0x7723('0xd')](_0x7723('0xe'),_0x1df237,_0x7723('0xf'));logger[_0x7723('0x10')](_0x7723('0x11'),_0x1df237,'request\x20sent',JSON[_0x7723('0x12')](_0x16b0fd));if(_0x16b0fd[_0x7723('0x13')]){if(_0x16b0fd[_0x7723('0x13')][_0x7723('0x14')]===0x1f4){logger[_0x7723('0x13')](_0x7723('0xe'),_0x1df237,_0x16b0fd[_0x7723('0x13')][_0x7723('0x15')]);return _0x252167(_0x16b0fd[_0x7723('0x13')]['message']);}logger[_0x7723('0x13')](_0x7723('0xe'),_0x1df237,_0x16b0fd['error'][_0x7723('0x15')]);return _0x2f77b9(_0x16b0fd['error'][_0x7723('0x15')]);}else{logger[_0x7723('0xd')]('Trigger,\x20%s,\x20%s',_0x1df237,_0x7723('0xf'));_0x2f77b9(_0x16b0fd['result'][_0x7723('0x15')]);}})[_0x7723('0x16')](function(_0x21d92a){logger[_0x7723('0x13')](_0x7723('0xe'),_0x1df237,_0x21d92a);_0x252167(_0x21d92a);});});}exports[_0x7723('0x17')]=function(_0x2bee33){var _0x4a944a=this;return new Promise(function(_0x49674a,_0x5dceef){return db[_0x7723('0x18')][_0x7723('0x19')]({'raw':_0x2bee33['options']?_0x2bee33[_0x7723('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x2bee33[_0x7723('0x1a')]?_0x2bee33['options'][_0x7723('0x1b')]||null:null,'attributes':_0x2bee33[_0x7723('0x1a')]?_0x2bee33[_0x7723('0x1a')]['attributes']||null:null,'limit':_0x2bee33[_0x7723('0x1a')]?_0x2bee33[_0x7723('0x1a')][_0x7723('0x1c')]||null:null,'include':_0x2bee33[_0x7723('0x1a')]?_0x2bee33[_0x7723('0x1a')][_0x7723('0x1d')]?_['map'](_0x2bee33[_0x7723('0x1a')][_0x7723('0x1d')],function(_0xe7d8d6){return{'model':db[_0xe7d8d6[_0x7723('0x1e')]],'as':_0xe7d8d6['as'],'attributes':_0xe7d8d6[_0x7723('0x1f')],'include':_0xe7d8d6[_0x7723('0x1d')]?_[_0x7723('0x20')](_0xe7d8d6[_0x7723('0x1d')],function(_0x5afc52){return{'model':db[_0x5afc52[_0x7723('0x1e')]],'as':_0x5afc52['as'],'attributes':_0x5afc52['attributes'],'include':_0x5afc52['include']?_[_0x7723('0x20')](_0x5afc52[_0x7723('0x1d')],function(_0x47ccac){return{'model':db[_0x47ccac[_0x7723('0x1e')]],'as':_0x47ccac['as'],'attributes':_0x47ccac['attributes']};}):[]};}):[]};}):[]:[]})[_0x7723('0xc')](function(_0x549f3c){logger[_0x7723('0xd')]('GetTrigger',_0x2bee33);logger['debug'](_0x7723('0x17'),_0x2bee33,JSON['stringify'](_0x549f3c));_0x49674a(_0x549f3c);})['catch'](function(_0x337f27){logger['error'](_0x7723('0x17'),_0x337f27[_0x7723('0x15')],_0x2bee33);_0x5dceef(_0x4a944a[_0x7723('0x13')](0x1f4,_0x337f27['message']));});});};exports[_0x7723('0x21')]=function(_0x4c7d3){var _0x50ce2e=this;return new Promise(function(_0x28ea99,_0x2a9acb){return db[_0x7723('0x18')][_0x7723('0x22')]({'raw':_0x4c7d3[_0x7723('0x1a')]?_0x4c7d3['options']['raw']===undefined?!![]:![]:!![],'where':_0x4c7d3['options']?_0x4c7d3[_0x7723('0x1a')][_0x7723('0x1b')]||null:null,'attributes':_0x4c7d3['options']?_0x4c7d3[_0x7723('0x1a')][_0x7723('0x1f')]||null:null,'include':_0x4c7d3[_0x7723('0x1a')]?_0x4c7d3['options'][_0x7723('0x1d')]?_[_0x7723('0x20')](_0x4c7d3[_0x7723('0x1a')][_0x7723('0x1d')],function(_0x2242f0){return{'model':db[_0x2242f0[_0x7723('0x1e')]],'as':_0x2242f0['as'],'attributes':_0x2242f0[_0x7723('0x1f')],'include':_0x2242f0['include']?_['map'](_0x2242f0[_0x7723('0x1d')],function(_0x41137a){return{'model':db[_0x41137a[_0x7723('0x1e')]],'as':_0x41137a['as'],'attributes':_0x41137a[_0x7723('0x1f')],'include':_0x41137a[_0x7723('0x1d')]?_[_0x7723('0x20')](_0x41137a[_0x7723('0x1d')],function(_0xdf3c22){return{'model':db[_0xdf3c22[_0x7723('0x1e')]],'as':_0xdf3c22['as'],'attributes':_0xdf3c22[_0x7723('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x7723('0xc')](function(_0x4e9385){logger['info'](_0x7723('0x21'),_0x4c7d3);logger[_0x7723('0x10')]('ShowTrigger',_0x4c7d3,JSON['stringify'](_0x4e9385));_0x28ea99(_0x4e9385);})[_0x7723('0x16')](function(_0x11a8ef){logger['error'](_0x7723('0x21'),_0x11a8ef[_0x7723('0x15')],_0x4c7d3);_0x2a9acb(_0x50ce2e[_0x7723('0x13')](0x1f4,_0x11a8ef[_0x7723('0x15')]));});});}; \ No newline at end of file +var _0x8d8b=['options','raw','attributes','limit','include','map','model','then','ShowTrigger','Trigger','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','Trigger,\x20%s,\x20%s','debug','stringify','error','message','info','request\x20sent','result','catch','GetTrigger','findAll'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8d8b,0xd0));var _0xb8d8=function(_0x55d14e,_0x4608e5){_0x55d14e=_0x55d14e-0x0;var _0x26cf70=_0x8d8b[_0x55d14e];return _0x26cf70;};'use strict';var _=require(_0xb8d8('0x0'));var util=require(_0xb8d8('0x1'));var moment=require('moment');var BPromise=require(_0xb8d8('0x2'));var rs=require(_0xb8d8('0x3'));var fs=require('fs');var Redis=require(_0xb8d8('0x4'));var db=require(_0xb8d8('0x5'))['db'];var utils=require(_0xb8d8('0x6'));var logger=require(_0xb8d8('0x7'))('rpc');var config=require(_0xb8d8('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb8d8('0x9')][_0xb8d8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x35ced8,_0x3fdcfa,_0x1812d1){return new BPromise(function(_0x49b43a,_0x2c8651){return client[_0xb8d8('0xb')](_0x35ced8,_0x1812d1)['then'](function(_0x5d2f85){logger['info'](_0xb8d8('0xc'),_0x3fdcfa,'request\x20sent');logger[_0xb8d8('0xd')]('Trigger,\x20%s,\x20%s,\x20%s',_0x3fdcfa,'request\x20sent',JSON[_0xb8d8('0xe')](_0x5d2f85));if(_0x5d2f85['error']){if(_0x5d2f85[_0xb8d8('0xf')]['code']===0x1f4){logger['error']('Trigger,\x20%s,\x20%s',_0x3fdcfa,_0x5d2f85[_0xb8d8('0xf')][_0xb8d8('0x10')]);return _0x2c8651(_0x5d2f85[_0xb8d8('0xf')][_0xb8d8('0x10')]);}logger['error'](_0xb8d8('0xc'),_0x3fdcfa,_0x5d2f85[_0xb8d8('0xf')][_0xb8d8('0x10')]);return _0x49b43a(_0x5d2f85[_0xb8d8('0xf')][_0xb8d8('0x10')]);}else{logger[_0xb8d8('0x11')]('Trigger,\x20%s,\x20%s',_0x3fdcfa,_0xb8d8('0x12'));_0x49b43a(_0x5d2f85[_0xb8d8('0x13')]['message']);}})[_0xb8d8('0x14')](function(_0x4cea5a){logger[_0xb8d8('0xf')](_0xb8d8('0xc'),_0x3fdcfa,_0x4cea5a);_0x2c8651(_0x4cea5a);});});}exports[_0xb8d8('0x15')]=function(_0x4015e4){var _0x5a4cfa=this;return new Promise(function(_0x2e99cc,_0x36b866){return db['Trigger'][_0xb8d8('0x16')]({'raw':_0x4015e4['options']?_0x4015e4[_0xb8d8('0x17')][_0xb8d8('0x18')]===undefined?!![]:![]:!![],'where':_0x4015e4[_0xb8d8('0x17')]?_0x4015e4[_0xb8d8('0x17')]['where']||null:null,'attributes':_0x4015e4['options']?_0x4015e4[_0xb8d8('0x17')][_0xb8d8('0x19')]||null:null,'limit':_0x4015e4[_0xb8d8('0x17')]?_0x4015e4[_0xb8d8('0x17')][_0xb8d8('0x1a')]||null:null,'include':_0x4015e4['options']?_0x4015e4[_0xb8d8('0x17')][_0xb8d8('0x1b')]?_[_0xb8d8('0x1c')](_0x4015e4['options'][_0xb8d8('0x1b')],function(_0x4bcae2){return{'model':db[_0x4bcae2[_0xb8d8('0x1d')]],'as':_0x4bcae2['as'],'attributes':_0x4bcae2[_0xb8d8('0x19')],'include':_0x4bcae2['include']?_[_0xb8d8('0x1c')](_0x4bcae2[_0xb8d8('0x1b')],function(_0x4a223b){return{'model':db[_0x4a223b['model']],'as':_0x4a223b['as'],'attributes':_0x4a223b[_0xb8d8('0x19')],'include':_0x4a223b[_0xb8d8('0x1b')]?_[_0xb8d8('0x1c')](_0x4a223b[_0xb8d8('0x1b')],function(_0x2bf1fd){return{'model':db[_0x2bf1fd[_0xb8d8('0x1d')]],'as':_0x2bf1fd['as'],'attributes':_0x2bf1fd[_0xb8d8('0x19')]};}):[]};}):[]};}):[]:[]})[_0xb8d8('0x1e')](function(_0x5020f5){logger[_0xb8d8('0x11')](_0xb8d8('0x15'),_0x4015e4);logger[_0xb8d8('0xd')](_0xb8d8('0x15'),_0x4015e4,JSON[_0xb8d8('0xe')](_0x5020f5));_0x2e99cc(_0x5020f5);})[_0xb8d8('0x14')](function(_0x717049){logger[_0xb8d8('0xf')](_0xb8d8('0x15'),_0x717049[_0xb8d8('0x10')],_0x4015e4);_0x36b866(_0x5a4cfa[_0xb8d8('0xf')](0x1f4,_0x717049[_0xb8d8('0x10')]));});});};exports[_0xb8d8('0x1f')]=function(_0x10e02f){var _0x151a48=this;return new Promise(function(_0x3b0e41,_0x1996d6){return db[_0xb8d8('0x20')]['find']({'raw':_0x10e02f[_0xb8d8('0x17')]?_0x10e02f[_0xb8d8('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x10e02f[_0xb8d8('0x17')]?_0x10e02f[_0xb8d8('0x17')]['where']||null:null,'attributes':_0x10e02f[_0xb8d8('0x17')]?_0x10e02f[_0xb8d8('0x17')][_0xb8d8('0x19')]||null:null,'include':_0x10e02f['options']?_0x10e02f[_0xb8d8('0x17')]['include']?_[_0xb8d8('0x1c')](_0x10e02f[_0xb8d8('0x17')]['include'],function(_0x1a04dd){return{'model':db[_0x1a04dd['model']],'as':_0x1a04dd['as'],'attributes':_0x1a04dd['attributes'],'include':_0x1a04dd[_0xb8d8('0x1b')]?_[_0xb8d8('0x1c')](_0x1a04dd[_0xb8d8('0x1b')],function(_0x19fe10){return{'model':db[_0x19fe10[_0xb8d8('0x1d')]],'as':_0x19fe10['as'],'attributes':_0x19fe10[_0xb8d8('0x19')],'include':_0x19fe10['include']?_[_0xb8d8('0x1c')](_0x19fe10[_0xb8d8('0x1b')],function(_0x389cb2){return{'model':db[_0x389cb2[_0xb8d8('0x1d')]],'as':_0x389cb2['as'],'attributes':_0x389cb2[_0xb8d8('0x19')]};}):[]};}):[]};}):[]:[]})[_0xb8d8('0x1e')](function(_0x184e78){logger[_0xb8d8('0x11')](_0xb8d8('0x1f'),_0x10e02f);logger[_0xb8d8('0xd')](_0xb8d8('0x1f'),_0x10e02f,JSON[_0xb8d8('0xe')](_0x184e78));_0x3b0e41(_0x184e78);})['catch'](function(_0x47fd58){logger[_0xb8d8('0xf')](_0xb8d8('0x1f'),_0x47fd58[_0xb8d8('0x10')],_0x10e02f);_0x1996d6(_0x151a48[_0xb8d8('0xf')](0x1f4,_0x47fd58[_0xb8d8('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 174c4d3..6553dc5 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 _0x5cc2=['isAuthenticated','show','post','/:id/clone','clone','create','update','delete','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','get','index','/:id'];(function(_0x2073d4,_0xb06852){var _0x41d787=function(_0x56447b){while(--_0x56447b){_0x2073d4['push'](_0x2073d4['shift']());}};_0x41d787(++_0xb06852);}(_0x5cc2,0x1ac));var _0x25cc=function(_0xf8c2fc,_0x217282){_0xf8c2fc=_0xf8c2fc-0x0;var _0x8559d3=_0x5cc2[_0xf8c2fc];return _0x8559d3;};'use strict';var multer=require(_0x25cc('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x25cc('0x1'));var express=require(_0x25cc('0x2'));var router=express[_0x25cc('0x3')]();var fs_extra=require(_0x25cc('0x4'));var auth=require(_0x25cc('0x5'));var interaction=require(_0x25cc('0x6'));var config=require(_0x25cc('0x7'));var controller=require(_0x25cc('0x8'));router[_0x25cc('0x9')]('/',auth['isAuthenticated'](),controller[_0x25cc('0xa')]);router[_0x25cc('0x9')](_0x25cc('0xb'),auth[_0x25cc('0xc')](),controller[_0x25cc('0xd')]);router[_0x25cc('0xe')](_0x25cc('0xf'),auth[_0x25cc('0xc')](),controller[_0x25cc('0x10')]);router[_0x25cc('0xe')]('/',auth[_0x25cc('0xc')](),controller[_0x25cc('0x11')]);router['put'](_0x25cc('0xb'),auth[_0x25cc('0xc')](),controller[_0x25cc('0x12')]);router[_0x25cc('0x13')](_0x25cc('0xb'),auth[_0x25cc('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x325d=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','isAuthenticated','index','get','/:id','show','post','/:id/clone','clone','create','put','update','delete','destroy','exports','multer','util','path','express'];(function(_0xbb36a0,_0x1cb1e4){var _0x306db2=function(_0xc63ad3){while(--_0xc63ad3){_0xbb36a0['push'](_0xbb36a0['shift']());}};_0x306db2(++_0x1cb1e4);}(_0x325d,0x6f));var _0xd325=function(_0x5964ea,_0x43e1d0){_0x5964ea=_0x5964ea-0x0;var _0x36f6da=_0x325d[_0x5964ea];return _0x36f6da;};'use strict';var multer=require(_0xd325('0x0'));var util=require(_0xd325('0x1'));var path=require(_0xd325('0x2'));var timeout=require('connect-timeout');var express=require(_0xd325('0x3'));var router=express[_0xd325('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd325('0x5'));var interaction=require(_0xd325('0x6'));var config=require(_0xd325('0x7'));var controller=require(_0xd325('0x8'));router['get']('/',auth[_0xd325('0x9')](),controller[_0xd325('0xa')]);router[_0xd325('0xb')](_0xd325('0xc'),auth[_0xd325('0x9')](),controller[_0xd325('0xd')]);router[_0xd325('0xe')](_0xd325('0xf'),auth[_0xd325('0x9')](),controller[_0xd325('0x10')]);router['post']('/',auth[_0xd325('0x9')](),controller[_0xd325('0x11')]);router[_0xd325('0x12')](_0xd325('0xc'),auth[_0xd325('0x9')](),controller[_0xd325('0x13')]);router[_0xd325('0x14')](_0xd325('0xc'),auth[_0xd325('0x9')](),controller[_0xd325('0x15')]);module[_0xd325('0x16')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 3692a18..5d59cca 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 _0xea45=['join','getDataValue','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','always','accept','refuse','originate','uac','uas','pai','fingerprint','certificate','dynamic','update,nonat','BOOLEAN','sequelize','exports','STRING','name','user','from-voip-provider','ENUM','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','transport'];(function(_0x9c3c56,_0x169b56){var _0x2dd782=function(_0x386962){while(--_0x386962){_0x9c3c56['push'](_0x9c3c56['shift']());}};_0x2dd782(++_0x169b56);}(_0xea45,0x85));var _0x5ea4=function(_0x834746,_0x369c54){_0x834746=_0x834746-0x0;var _0x516edc=_0xea45[_0x834746];return _0x516edc;};'use strict';var Sequelize=require(_0x5ea4('0x0'));module[_0x5ea4('0x1')]={'name':{'type':Sequelize[_0x5ea4('0x2')],'allowNull':![],'unique':_0x5ea4('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM']('friend',_0x5ea4('0x4'),'peer'),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x5ea4('0x2')],'allowNull':![],'defaultValue':_0x5ea4('0x5')},'callingpres':{'type':Sequelize[_0x5ea4('0x6')](_0x5ea4('0x7'),_0x5ea4('0x8'),_0x5ea4('0x9'),'ALLOWED',_0x5ea4('0xa'),_0x5ea4('0xb'),_0x5ea4('0xc'),_0x5ea4('0xd'))},'deny':{'type':Sequelize[_0x5ea4('0x2')]},'permit':{'type':Sequelize[_0x5ea4('0x2')]},'secret':{'type':Sequelize[_0x5ea4('0x2')]},'md5secret':{'type':Sequelize[_0x5ea4('0x2')]},'remotesecret':{'type':Sequelize[_0x5ea4('0x2')]},'transport':{'type':Sequelize['STRING'],'defaultValue':_0x5ea4('0xe'),'set':function(_0x4370ad){this[_0x5ea4('0xf')](_0x5ea4('0x10'),_0x4370ad?_0x4370ad[_0x5ea4('0x11')](','):null);},'get':function(){return this[_0x5ea4('0x12')](_0x5ea4('0x10'))?this[_0x5ea4('0x12')](_0x5ea4('0x10'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x5ea4('0x6')](_0x5ea4('0x13'),_0x5ea4('0x14'),_0x5ea4('0x15'),_0x5ea4('0x16'),_0x5ea4('0x17')),'defaultValue':_0x5ea4('0x13')},'directmedia':{'type':Sequelize[_0x5ea4('0x6')](_0x5ea4('0x18'),'no',_0x5ea4('0x19'),_0x5ea4('0x1a'),_0x5ea4('0x1b')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x5ea4('0x2')]},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0x5ea4('0x2')],'defaultValue':_0x5ea4('0x1c'),'set':function(_0x43a396){this[_0x5ea4('0xf')](_0x5ea4('0x1d'),_0x43a396?_0x43a396[_0x5ea4('0x11')](','):null);},'get':function(){return this['getDataValue'](_0x5ea4('0x1d'))?this['getDataValue'](_0x5ea4('0x1d'))[_0x5ea4('0x1e')](','):null;},'comment':_0x5ea4('0x1f')},'callgroup':{'type':Sequelize[_0x5ea4('0x2')]},'namedcallgroup':{'type':Sequelize[_0x5ea4('0x2')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x5ea4('0x2')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x5ea4('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x5ea4('0x2')],'defaultValue':'all'},'allow':{'type':Sequelize[_0x5ea4('0x2')],'allowNull':![],'defaultValue':_0x5ea4('0x20'),'set':function(_0x556306){this['setDataValue'](_0x5ea4('0x21'),_0x556306?_0x556306['join'](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x5ea4('0x12')](_0x5ea4('0x21'))?this[_0x5ea4('0x12')](_0x5ea4('0x21'))[_0x5ea4('0x1e')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize[_0x5ea4('0x6')](_0x5ea4('0x18'),'no')},'insecure':{'type':Sequelize[_0x5ea4('0x2')],'defaultValue':'port,invite','set':function(_0x3cbcdb){this[_0x5ea4('0xf')]('insecure',_0x3cbcdb?_0x3cbcdb[_0x5ea4('0x11')](','):null);},'get':function(){return this[_0x5ea4('0x12')](_0x5ea4('0x22'))?this[_0x5ea4('0x12')](_0x5ea4('0x22'))[_0x5ea4('0x1e')](','):null;},'comment':_0x5ea4('0x23')},'trustrpid':{'type':Sequelize[_0x5ea4('0x6')](_0x5ea4('0x18'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x5ea4('0x6')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x5ea4('0x18'),'no',_0x5ea4('0x24'))},'promiscredir':{'type':Sequelize[_0x5ea4('0x6')](_0x5ea4('0x18'),'no')},'useclientcode':{'type':Sequelize['ENUM'](_0x5ea4('0x18'),'no')},'accountcode':{'type':Sequelize[_0x5ea4('0x25')](0xb)},'setvar':{'type':Sequelize[_0x5ea4('0x2')]},'callerid':{'type':Sequelize[_0x5ea4('0x2')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x5ea4('0x2')]},'callcounter':{'type':Sequelize[_0x5ea4('0x6')]('yes','no'),'defaultValue':_0x5ea4('0x18')},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize['ENUM']('yes','no')},'allowsubscribe':{'type':Sequelize[_0x5ea4('0x6')](_0x5ea4('0x18'),'no')},'allowtransfer':{'type':Sequelize[_0x5ea4('0x6')](_0x5ea4('0x18'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x5ea4('0x18'),'no')},'subscribecontext':{'type':Sequelize[_0x5ea4('0x2')]},'template':{'type':Sequelize[_0x5ea4('0x2')]},'videosupport':{'type':Sequelize['ENUM'](_0x5ea4('0x18'),'no',_0x5ea4('0x26')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize[_0x5ea4('0x6')](_0x5ea4('0x18'),'no')},'mailbox':{'type':Sequelize[_0x5ea4('0x2')]},'session_timers':{'type':Sequelize[_0x5ea4('0x6')](_0x5ea4('0x27'),_0x5ea4('0x28'),_0x5ea4('0x29'))},'session_expires':{'type':Sequelize[_0x5ea4('0x25')](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize[_0x5ea4('0x6')](_0x5ea4('0x2a'),_0x5ea4('0x2b')),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x5ea4('0x2')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0x5ea4('0x2')]},'fromuser':{'type':Sequelize[_0x5ea4('0x2')]},'port':{'type':Sequelize[_0x5ea4('0x25')](0x5)},'qualify':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x5ea4('0x18')},'keepalive':{'type':Sequelize[_0x5ea4('0x25')](0xb)},'defaultip':{'type':Sequelize[_0x5ea4('0x2')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize[_0x5ea4('0x25')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x5ea4('0x25')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x5ea4('0x25')](0xb)},'sendrpid':{'type':Sequelize[_0x5ea4('0x6')](_0x5ea4('0x18'),'no',_0x5ea4('0x2c')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x5ea4('0x2')]},'callbackextension':{'type':Sequelize[_0x5ea4('0x2')]},'timert1':{'type':Sequelize[_0x5ea4('0x25')](0xb)},'timerb':{'type':Sequelize[_0x5ea4('0x25')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0x5ea4('0x2')]},'contactdeny':{'type':Sequelize[_0x5ea4('0x2')]},'contactacl':{'type':Sequelize[_0x5ea4('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0x5ea4('0x2')]},'use_q850_reason':{'type':Sequelize[_0x5ea4('0x2')]},'maxforwards':{'type':Sequelize[_0x5ea4('0x25')](0xb)},'encryption':{'type':Sequelize[_0x5ea4('0x6')](_0x5ea4('0x18'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x5ea4('0x18'),'no')},'force_avp':{'type':Sequelize[_0x5ea4('0x6')]('yes','no')},'icesupport':{'type':Sequelize[_0x5ea4('0x6')]('yes','no')},'dtlsenable':{'type':Sequelize[_0x5ea4('0x6')](_0x5ea4('0x18'),'no')},'dtlsverify':{'type':Sequelize[_0x5ea4('0x6')](_0x5ea4('0x18'),'no',_0x5ea4('0x2d'),_0x5ea4('0x2e'))},'dtlsrekey':{'type':Sequelize[_0x5ea4('0x25')](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize[_0x5ea4('0x2')]},'dtlscipher':{'type':Sequelize[_0x5ea4('0x2')]},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0x5ea4('0x6')]('active','passive','actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize['ENUM'](_0x5ea4('0x18'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0x5ea4('0x2')]},'call_limit':{'type':Sequelize[_0x5ea4('0x25')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x5ea4('0x6')](_0x5ea4('0x18'),'no')},'subscribemwi':{'type':Sequelize[_0x5ea4('0x6')](_0x5ea4('0x18'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0x5ea4('0x2')]},'mohsuggest':{'type':Sequelize[_0x5ea4('0x2')]},'parkinglot':{'type':Sequelize[_0x5ea4('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x5ea4('0x2')],'defaultValue':_0x5ea4('0x2f')},'canreinvite':{'type':Sequelize[_0x5ea4('0x6')](_0x5ea4('0x18'),'no','nonat',_0x5ea4('0x1a'),_0x5ea4('0x30')),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0x5ea4('0x2')]},'active':{'type':Sequelize[_0x5ea4('0x31')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}}; \ No newline at end of file +var _0x9234=['outgoing','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','INTEGER','always','accept','refuse','uac','uas','pai','fingerprint','certificate','passive','actpass','dynamic','update','update,nonat','BOOLEAN','sequelize','exports','STRING','name','ENUM','friend','user','peer','from-voip-provider','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','udp','setDataValue','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','shortinfo','inband','yes','nonat'];(function(_0x307997,_0x474a15){var _0x25adf3=function(_0x4ffa34){while(--_0x4ffa34){_0x307997['push'](_0x307997['shift']());}};_0x25adf3(++_0x474a15);}(_0x9234,0xe4));var _0x4923=function(_0x4206f5,_0x21f338){_0x4206f5=_0x4206f5-0x0;var _0xa29cf3=_0x9234[_0x4206f5];return _0xa29cf3;};'use strict';var Sequelize=require(_0x4923('0x0'));module[_0x4923('0x1')]={'name':{'type':Sequelize[_0x4923('0x2')],'allowNull':![],'unique':_0x4923('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x4923('0x4')](_0x4923('0x5'),_0x4923('0x6'),_0x4923('0x7')),'allowNull':![],'defaultValue':_0x4923('0x5')},'context':{'type':Sequelize[_0x4923('0x2')],'allowNull':![],'defaultValue':_0x4923('0x8')},'callingpres':{'type':Sequelize['ENUM']('ALLOWED_NOT_SCREENED',_0x4923('0x9'),_0x4923('0xa'),_0x4923('0xb'),_0x4923('0xc'),_0x4923('0xd'),'PROHIB_FAILED_SCREEN',_0x4923('0xe'))},'deny':{'type':Sequelize[_0x4923('0x2')]},'permit':{'type':Sequelize[_0x4923('0x2')]},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize[_0x4923('0x2')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize[_0x4923('0x2')],'defaultValue':_0x4923('0xf'),'set':function(_0x2938c){this[_0x4923('0x10')](_0x4923('0x11'),_0x2938c?_0x2938c[_0x4923('0x12')](','):null);},'get':function(){return this[_0x4923('0x13')]('transport')?this[_0x4923('0x13')]('transport')[_0x4923('0x14')](','):null;},'comment':_0x4923('0x15')},'dtmfmode':{'type':Sequelize[_0x4923('0x4')](_0x4923('0x16'),'info',_0x4923('0x17'),_0x4923('0x18'),'auto'),'defaultValue':_0x4923('0x16')},'directmedia':{'type':Sequelize[_0x4923('0x4')](_0x4923('0x19'),'no',_0x4923('0x1a'),'update',_0x4923('0x1b')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x4923('0x4')](_0x4923('0x19'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x4923('0x2')]},'directmediadeny':{'type':Sequelize[_0x4923('0x2')]},'nat':{'type':Sequelize['STRING'],'defaultValue':'force_rport,comedia','set':function(_0x4a3db5){this['setDataValue'](_0x4923('0x1c'),_0x4a3db5?_0x4a3db5['join'](','):null);},'get':function(){return this[_0x4923('0x13')](_0x4923('0x1c'))?this['getDataValue']('nat')[_0x4923('0x14')](','):null;},'comment':_0x4923('0x1d')},'callgroup':{'type':Sequelize[_0x4923('0x2')]},'namedcallgroup':{'type':Sequelize[_0x4923('0x2')]},'pickupgroup':{'type':Sequelize[_0x4923('0x2')]},'namedpickupgroup':{'type':Sequelize[_0x4923('0x2')]},'language':{'type':Sequelize[_0x4923('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':_0x4923('0x1e')},'allow':{'type':Sequelize[_0x4923('0x2')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x301c96){this[_0x4923('0x10')]('allow',_0x301c96?_0x301c96[_0x4923('0x12')](';'):_0x4923('0x1f'));},'get':function(){return this[_0x4923('0x13')]('allow')?this[_0x4923('0x13')](_0x4923('0x20'))['split'](';'):null;},'comment':_0x4923('0x21')},'autoframing':{'type':Sequelize[_0x4923('0x4')](_0x4923('0x19'),'no')},'insecure':{'type':Sequelize[_0x4923('0x2')],'defaultValue':'port,invite','set':function(_0x1be44a){this[_0x4923('0x10')]('insecure',_0x1be44a?_0x1be44a['join'](','):null);},'get':function(){return this[_0x4923('0x13')](_0x4923('0x22'))?this[_0x4923('0x13')]('insecure')[_0x4923('0x14')](','):null;},'comment':_0x4923('0x23')},'trustrpid':{'type':Sequelize[_0x4923('0x4')](_0x4923('0x19'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x4923('0x19'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x4923('0x4')]('yes','no','never')},'promiscredir':{'type':Sequelize[_0x4923('0x4')](_0x4923('0x19'),'no')},'useclientcode':{'type':Sequelize[_0x4923('0x4')]('yes','no')},'accountcode':{'type':Sequelize[_0x4923('0x24')](0xb)},'setvar':{'type':Sequelize[_0x4923('0x2')]},'callerid':{'type':Sequelize[_0x4923('0x2')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x4923('0x2')]},'callcounter':{'type':Sequelize[_0x4923('0x4')](_0x4923('0x19'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x4923('0x24')](0xb)},'allowoverlap':{'type':Sequelize[_0x4923('0x4')]('yes','no')},'allowsubscribe':{'type':Sequelize[_0x4923('0x4')](_0x4923('0x19'),'no')},'allowtransfer':{'type':Sequelize['ENUM'](_0x4923('0x19'),'no')},'ignoresdpversion':{'type':Sequelize[_0x4923('0x4')](_0x4923('0x19'),'no')},'subscribecontext':{'type':Sequelize[_0x4923('0x2')]},'template':{'type':Sequelize[_0x4923('0x2')]},'videosupport':{'type':Sequelize[_0x4923('0x4')](_0x4923('0x19'),'no',_0x4923('0x25')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x4923('0x24')](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x4923('0x19'),'no')},'mailbox':{'type':Sequelize[_0x4923('0x2')]},'session_timers':{'type':Sequelize['ENUM'](_0x4923('0x26'),_0x4923('0x27'),'originate')},'session_expires':{'type':Sequelize[_0x4923('0x24')](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize[_0x4923('0x4')](_0x4923('0x28'),_0x4923('0x29')),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x4923('0x2')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0x4923('0x2')]},'fromuser':{'type':Sequelize[_0x4923('0x2')]},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize[_0x4923('0x4')](_0x4923('0x19'),'no'),'defaultValue':_0x4923('0x19')},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0x4923('0x2')]},'defaultuser':{'type':Sequelize[_0x4923('0x2')]},'rtptimeout':{'type':Sequelize[_0x4923('0x24')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x4923('0x24')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x4923('0x24')](0xb)},'sendrpid':{'type':Sequelize['ENUM'](_0x4923('0x19'),'no',_0x4923('0x2a')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x4923('0x2')]},'callbackextension':{'type':Sequelize[_0x4923('0x2')]},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize[_0x4923('0x24')](0xb)},'qualifyfreq':{'type':Sequelize[_0x4923('0x24')](0xb)},'contactpermit':{'type':Sequelize[_0x4923('0x2')]},'contactdeny':{'type':Sequelize[_0x4923('0x2')]},'contactacl':{'type':Sequelize[_0x4923('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0x4923('0x2')]},'use_q850_reason':{'type':Sequelize[_0x4923('0x2')]},'maxforwards':{'type':Sequelize[_0x4923('0x24')](0xb)},'encryption':{'type':Sequelize[_0x4923('0x4')](_0x4923('0x19'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x4923('0x4')]('yes','no')},'force_avp':{'type':Sequelize[_0x4923('0x4')](_0x4923('0x19'),'no')},'icesupport':{'type':Sequelize[_0x4923('0x4')](_0x4923('0x19'),'no')},'dtlsenable':{'type':Sequelize[_0x4923('0x4')](_0x4923('0x19'),'no')},'dtlsverify':{'type':Sequelize[_0x4923('0x4')]('yes','no',_0x4923('0x2b'),_0x4923('0x2c'))},'dtlsrekey':{'type':Sequelize[_0x4923('0x24')](0xb)},'dtlscertfile':{'type':Sequelize[_0x4923('0x2')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize[_0x4923('0x2')]},'dtlssetup':{'type':Sequelize[_0x4923('0x4')]('active',_0x4923('0x2d'),_0x4923('0x2e')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x4923('0x2')]},'usereqphone':{'type':Sequelize['ENUM'](_0x4923('0x19'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x4923('0x2')]},'recordofffeature':{'type':Sequelize[_0x4923('0x2')]},'call_limit':{'type':Sequelize[_0x4923('0x24')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x4923('0x4')]('yes','no')},'subscribemwi':{'type':Sequelize[_0x4923('0x4')]('yes','no')},'vmexten':{'type':Sequelize[_0x4923('0x2')]},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize[_0x4923('0x2')]},'parkinglot':{'type':Sequelize[_0x4923('0x2')]},'description':{'type':Sequelize[_0x4923('0x2')]},'host':{'type':Sequelize[_0x4923('0x2')],'defaultValue':_0x4923('0x2f')},'canreinvite':{'type':Sequelize[_0x4923('0x4')](_0x4923('0x19'),'no',_0x4923('0x1a'),_0x4923('0x30'),_0x4923('0x31')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x4923('0x2')]},'otherFields':{'type':Sequelize[_0x4923('0x2')]},'active':{'type':Sequelize[_0x4923('0x32')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x4923('0x2')],'defaultValue':'no'}}; \ No newline at end of file diff --git a/server/api/trunk/trunk.controller.js b/server/api/trunk/trunk.controller.js index 5c0e5a3..72dc386 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 _0x00bb=['includeAll','findAll','rows','params','find','clone','rawAttributes','include','omit','createdAt','body','updatedAt','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','server/files/templates/trunk.ejs','utf8','root','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','Reload','chan_sip.so','/etc/asterisk/sip_xcally_registers.conf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','jayson/promise','client','http','request','info','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','Trunk,\x20%s,\x20%s','result','catch','sendStatus','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','get','Trunks','UserProfileResource','status','stack','name','index','map','Trunk','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options'];(function(_0x478695,_0x278a98){var _0x4cb65f=function(_0xbc265c){while(--_0xbc265c){_0x478695['push'](_0x478695['shift']());}};_0x4cb65f(++_0x278a98);}(_0x00bb,0x1d8));var _0xb00b=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x00bb[_0x550d12];return _0x12103d;};'use strict';var emlformat=require(_0xb00b('0x0'));var rimraf=require(_0xb00b('0x1'));var zipdir=require(_0xb00b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb00b('0x3'));var moment=require('moment');var BPromise=require(_0xb00b('0x4'));var Mustache=require(_0xb00b('0x5'));var util=require('util');var path=require(_0xb00b('0x6'));var sox=require(_0xb00b('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb00b('0x8'));var squel=require(_0xb00b('0x9'));var crypto=require(_0xb00b('0xa'));var jsforce=require(_0xb00b('0xb'));var deskjs=require(_0xb00b('0xc'));var toCsv=require(_0xb00b('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb00b('0xe'));var authService=require(_0xb00b('0xf'));var qs=require(_0xb00b('0x10'));var as=require(_0xb00b('0x11'));var hardwareService=require(_0xb00b('0x12'));var logger=require('../../config/logger')(_0xb00b('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb00b('0x14'))['db'];var jayson=require(_0xb00b('0x15'));var client=jayson[_0xb00b('0x16')][_0xb00b('0x17')]({'port':0x232a});function respondWithRpcPromise(_0xef5d52,_0x1f1c1d,_0x4ada81,_0x218de2){return new BPromise(function(_0xb0d42e,_0x482fe6){var _0x88d95e=_0x218de2||client;return _0x88d95e[_0xb00b('0x18')](_0xef5d52,_0x4ada81)['then'](function(_0x5da36b){logger[_0xb00b('0x19')]('Trunk,\x20%s,\x20%s',_0x1f1c1d,'request\x20sent');logger[_0xb00b('0x1a')](_0xb00b('0x1b'),_0x1f1c1d,_0xb00b('0x1c'),JSON[_0xb00b('0x1d')](_0x5da36b));if(_0x5da36b['error']){if(_0x5da36b[_0xb00b('0x1e')]['code']===0x1f4){logger[_0xb00b('0x1e')]('Trunk,\x20%s,\x20%s',_0x1f1c1d,_0x5da36b[_0xb00b('0x1e')]['message']);return _0x482fe6(_0x5da36b[_0xb00b('0x1e')][_0xb00b('0x1f')]);}logger['error']('Trunk,\x20%s,\x20%s',_0x1f1c1d,_0x5da36b[_0xb00b('0x1e')]['message']);return _0xb0d42e(_0x5da36b[_0xb00b('0x1e')][_0xb00b('0x1f')]);}else{logger[_0xb00b('0x19')](_0xb00b('0x20'),_0x1f1c1d,'request\x20sent');_0xb0d42e(_0x5da36b[_0xb00b('0x21')]['message']);}})[_0xb00b('0x22')](function(_0x121ec7){logger['error'](_0xb00b('0x20'),_0x1f1c1d,_0x121ec7);_0x482fe6(_0x121ec7);});});}function respondWithStatusCode(_0x2896d1,_0x520444){_0x520444=_0x520444||0xcc;return function(_0x3ab3cc){if(_0x3ab3cc){return _0x2896d1[_0xb00b('0x23')](_0x520444);}return _0x2896d1['status'](_0x520444)[_0xb00b('0x24')]();};}function respondWithResult(_0x243fdb,_0x3c9500){_0x3c9500=_0x3c9500||0xc8;return function(_0x8caadf){if(_0x8caadf){return _0x243fdb['status'](_0x3c9500)['json'](_0x8caadf);}};}function respondWithFilteredResult(_0x3785e9,_0x490380){return function(_0x550587){if(_0x550587){var _0x4a635e=typeof _0x490380[_0xb00b('0x25')]===_0xb00b('0x26')&&typeof _0x490380[_0xb00b('0x27')]===_0xb00b('0x26');var _0x1f14fa=_0x550587[_0xb00b('0x28')];var _0x15d3b9=_0x4a635e?0x0:_0x490380['offset'];var _0x22c22d=_0x4a635e?_0x550587['count']:_0x490380[_0xb00b('0x25')]+_0x490380[_0xb00b('0x27')];var _0x5424ca;if(_0x22c22d>=_0x1f14fa){_0x22c22d=_0x1f14fa;_0x5424ca=0xc8;}else{_0x5424ca=0xce;}_0x3785e9['status'](_0x5424ca);return _0x3785e9[_0xb00b('0x29')](_0xb00b('0x2a'),_0x15d3b9+'-'+_0x22c22d+'/'+_0x1f14fa)[_0xb00b('0x2b')](_0x550587);}return null;};}function patchUpdates(_0x183233){return function(_0x303625){try{jsonpatch[_0xb00b('0x2c')](_0x303625,_0x183233,!![]);}catch(_0x2e160a){return BPromise[_0xb00b('0x2d')](_0x2e160a);}return _0x303625[_0xb00b('0x2e')]();};}function saveUpdates(_0x54e247,_0x2b5f41){return function(_0x44918d){if(_0x44918d){return _0x44918d['update'](_0x54e247)[_0xb00b('0x2f')](function(_0x2f3b37){return _0x2f3b37;});}return null;};}function removeEntity(_0x5a5e5a,_0x456241){return function(_0x4d2ee5){if(_0x4d2ee5){return _0x4d2ee5[_0xb00b('0x30')]()[_0xb00b('0x2f')](function(){var _0x322879=_0x4d2ee5[_0xb00b('0x31')]({'plain':!![]});var _0x338864=_0xb00b('0x32');return db[_0xb00b('0x33')]['destroy']({'where':{'type':_0x338864,'resourceId':_0x322879['id']}})['then'](function(){return _0x4d2ee5;});})['then'](function(){_0x5a5e5a[_0xb00b('0x34')](0xcc)[_0xb00b('0x24')]();});}};}function handleEntityNotFound(_0x45dcda,_0x2589cb){return function(_0x5cfa60){if(!_0x5cfa60){_0x45dcda[_0xb00b('0x23')](0x194);}return _0x5cfa60;};}function handleError(_0x266f8e,_0x341f46){_0x341f46=_0x341f46||0x1f4;return function(_0x1c7a9f){logger[_0xb00b('0x1e')](_0x1c7a9f[_0xb00b('0x35')]);if(_0x1c7a9f[_0xb00b('0x36')]){delete _0x1c7a9f[_0xb00b('0x36')];}_0x266f8e['status'](_0x341f46)['send'](_0x1c7a9f);};}exports[_0xb00b('0x37')]=function(_0x56022e,_0x1c8258){var _0x1c5400={},_0x29579b={},_0x45ca74={'count':0x0,'rows':[]};var _0x37c017=_[_0xb00b('0x38')](db[_0xb00b('0x39')]['rawAttributes'],function(_0x35f1ca){return{'name':_0x35f1ca[_0xb00b('0x3a')],'type':_0x35f1ca[_0xb00b('0x3b')][_0xb00b('0x3c')]};});_0x29579b[_0xb00b('0x3d')]=_[_0xb00b('0x38')](_0x37c017,'name');_0x29579b[_0xb00b('0x3e')]=_[_0xb00b('0x3f')](_0x56022e['query']);_0x29579b[_0xb00b('0x40')]=_[_0xb00b('0x41')](_0x29579b[_0xb00b('0x3d')],_0x29579b[_0xb00b('0x3e')]);_0x1c5400[_0xb00b('0x42')]=_['intersection'](_0x29579b[_0xb00b('0x3d')],qs[_0xb00b('0x43')](_0x56022e[_0xb00b('0x3e')][_0xb00b('0x43')]));_0x1c5400['attributes']=_0x1c5400['attributes'][_0xb00b('0x44')]?_0x1c5400[_0xb00b('0x42')]:_0x29579b[_0xb00b('0x3d')];if(!_0x56022e[_0xb00b('0x3e')][_0xb00b('0x45')](_0xb00b('0x46'))){_0x1c5400[_0xb00b('0x27')]=qs['limit'](_0x56022e[_0xb00b('0x3e')][_0xb00b('0x27')]);_0x1c5400[_0xb00b('0x25')]=qs[_0xb00b('0x25')](_0x56022e[_0xb00b('0x3e')][_0xb00b('0x25')]);}_0x1c5400[_0xb00b('0x47')]=qs[_0xb00b('0x48')](_0x56022e[_0xb00b('0x3e')][_0xb00b('0x48')]);_0x1c5400[_0xb00b('0x49')]=qs[_0xb00b('0x40')](_['pick'](_0x56022e[_0xb00b('0x3e')],_0x29579b[_0xb00b('0x40')]),_0x37c017);if(_0x56022e[_0xb00b('0x3e')][_0xb00b('0x4a')]){_0x1c5400[_0xb00b('0x49')]=_[_0xb00b('0x4b')](_0x1c5400[_0xb00b('0x49')],{'$or':_[_0xb00b('0x38')](_0x37c017,function(_0x10ba60){if(_0x10ba60[_0xb00b('0x3b')]!==_0xb00b('0x4c')){var _0x3b3031={};_0x3b3031[_0x10ba60['name']]={'$like':'%'+_0x56022e['query']['filter']+'%'};return _0x3b3031;}})});}_0x1c5400=_[_0xb00b('0x4b')]({},_0x1c5400,_0x56022e[_0xb00b('0x4d')]);var _0x481154={'where':_0x1c5400[_0xb00b('0x49')]};return db[_0xb00b('0x39')][_0xb00b('0x28')](_0x481154)[_0xb00b('0x2f')](function(_0x4b62b3){_0x45ca74['count']=_0x4b62b3;if(_0x56022e[_0xb00b('0x3e')][_0xb00b('0x4e')]){_0x1c5400['include']=[{'all':!![]}];}return db['Trunk'][_0xb00b('0x4f')](_0x1c5400);})[_0xb00b('0x2f')](function(_0x4e0be4){_0x45ca74[_0xb00b('0x50')]=_0x4e0be4;return _0x45ca74;})['then'](respondWithFilteredResult(_0x1c8258,_0x1c5400))['catch'](handleError(_0x1c8258,null));};exports['show']=function(_0x465d90,_0x481515){var _0x1f7b86={'raw':![],'where':{'id':_0x465d90[_0xb00b('0x51')]['id']}},_0x3178aa={};_0x3178aa[_0xb00b('0x3d')]=_[_0xb00b('0x3f')](db[_0xb00b('0x39')]['rawAttributes']);_0x3178aa['query']=_[_0xb00b('0x3f')](_0x465d90[_0xb00b('0x3e')]);_0x3178aa['filters']=_[_0xb00b('0x41')](_0x3178aa[_0xb00b('0x3d')],_0x3178aa['query']);_0x1f7b86[_0xb00b('0x42')]=_[_0xb00b('0x41')](_0x3178aa[_0xb00b('0x3d')],qs['fields'](_0x465d90['query'][_0xb00b('0x43')]));_0x1f7b86[_0xb00b('0x42')]=_0x1f7b86[_0xb00b('0x42')][_0xb00b('0x44')]?_0x1f7b86['attributes']:_0x3178aa[_0xb00b('0x3d')];if(_0x465d90[_0xb00b('0x3e')]['includeAll']){_0x1f7b86['include']=[{'all':!![]}];}_0x1f7b86=_[_0xb00b('0x4b')]({},_0x1f7b86,_0x465d90['options']);return db[_0xb00b('0x39')][_0xb00b('0x52')](_0x1f7b86)[_0xb00b('0x2f')](handleEntityNotFound(_0x481515,null))[_0xb00b('0x2f')](respondWithResult(_0x481515,null))[_0xb00b('0x22')](handleError(_0x481515,null));};exports[_0xb00b('0x53')]=function(_0x5a3b85,_0x5d52a5){var _0x51c9e3={'where':{'id':_0x5a3b85[_0xb00b('0x51')]['id']}},_0x37d4d2={};_0x37d4d2[_0xb00b('0x3d')]=_['keys'](db[_0xb00b('0x39')][_0xb00b('0x54')]);_0x51c9e3[_0xb00b('0x42')]=_['intersection'](_0x37d4d2[_0xb00b('0x3d')],qs[_0xb00b('0x43')](_0x5a3b85[_0xb00b('0x3e')][_0xb00b('0x43')]));_0x51c9e3[_0xb00b('0x42')]=_0x51c9e3[_0xb00b('0x42')][_0xb00b('0x44')]?_0x51c9e3[_0xb00b('0x42')]:_0x37d4d2['model'];if(_0x5a3b85[_0xb00b('0x3e')][_0xb00b('0x4e')]){_0x51c9e3[_0xb00b('0x55')]=[{'all':!![]}];}_0x51c9e3=_['merge']({},_0x51c9e3,_0x5a3b85[_0xb00b('0x4d')]);return db[_0xb00b('0x39')][_0xb00b('0x52')](_0x51c9e3)[_0xb00b('0x2f')](handleEntityNotFound(_0x5d52a5,null))[_0xb00b('0x2f')](function(_0x4bfe0b){if(_0x4bfe0b){var _0xfd4ecc=_0x4bfe0b[_0xb00b('0x31')]({'plain':!![]});_0xfd4ecc=qs[_0xb00b('0x56')](_0xfd4ecc,['id',_0xb00b('0x57'),'updatedAt']);_0x5a3b85[_0xb00b('0x58')]=_[_0xb00b('0x56')](_0x5a3b85[_0xb00b('0x58')],['id',_0xb00b('0x57'),_0xb00b('0x59')]);return db[_0xb00b('0x39')][_0xb00b('0x5a')](_['merge'](_0xfd4ecc,_0x5a3b85[_0xb00b('0x58')]),{'include':_0x5a3b85['query'][_0xb00b('0x4e')]?[{'all':!![]}]:undefined})['then'](function(_0x3b3272){var _0x530d4a=_0x5a3b85[_0xb00b('0x5b')]['get']({'plain':!![]});if(!_0x530d4a)throw new Error(_0xb00b('0x5c'));if(_0x530d4a[_0xb00b('0x5d')]===_0xb00b('0x5b')){var _0x4d1cec=_0x3b3272['get']({'plain':!![]});var _0x4f7a59=_0xb00b('0x32');return db[_0xb00b('0x5e')][_0xb00b('0x52')]({'where':{'name':_0x4f7a59,'userProfileId':_0x530d4a['userProfileId']},'raw':!![]})[_0xb00b('0x2f')](function(_0x37ae88){if(_0x37ae88&&_0x37ae88[_0xb00b('0x5f')]===0x0){return db[_0xb00b('0x33')][_0xb00b('0x5a')]({'name':_0x4d1cec['name'],'resourceId':_0x4d1cec['id'],'type':_0x37ae88[_0xb00b('0x36')],'sectionId':_0x37ae88['id']},{})[_0xb00b('0x2f')](function(){return _0x3b3272;});}else{return _0x3b3272;}})['catch'](function(_0xe1316d){logger[_0xb00b('0x1e')](_0xb00b('0x60'),_0xe1316d);throw _0xe1316d;});}return _0x3b3272;});}})['then'](respondWithResult(_0x5d52a5,0xc9))['catch'](handleError(_0x5d52a5,null));};exports[_0xb00b('0x5a')]=function(_0x188da7,_0x23762e,_0x49f0a2){var _0x5aac5f;return db['Trunk']['create'](_0x188da7[_0xb00b('0x58')],{'raw':!![]})['then'](function(_0x2434a0){_0x5aac5f=_0x2434a0;return db[_0xb00b('0x39')]['findAll']({'raw':!![]});})[_0xb00b('0x2f')](function(_0x1e7f3a){var _0x2d21ec=fs[_0xb00b('0x61')](path[_0xb00b('0x62')](config['root'],_0xb00b('0x63')),_0xb00b('0x64'));var _0x3d4482=fs[_0xb00b('0x61')](path[_0xb00b('0x62')](config[_0xb00b('0x65')],_0xb00b('0x66')),'utf8');var _0x27b3ae=ejs[_0xb00b('0x67')](_0x2d21ec,{'trunks':_0x1e7f3a||[]});fs[_0xb00b('0x68')](_0xb00b('0x69'),_0x27b3ae);if(_0x5aac5f[_0xb00b('0x6a')]){var _0x432b68=ejs[_0xb00b('0x67')](_0x3d4482,{'trunks':_0x1e7f3a||[]});fs[_0xb00b('0x68')]('/etc/asterisk/sip_xcally_registers.conf',_0x432b68);}})[_0xb00b('0x2f')](function(){return respondWithRpcPromise(_0xb00b('0x6b'),_0xb00b('0x5a'),{'module':_0xb00b('0x6c')});})[_0xb00b('0x2f')](function(){var _0xfb2b68=_0x188da7[_0xb00b('0x5b')][_0xb00b('0x31')]({'plain':!![]});if(!_0xfb2b68)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xfb2b68[_0xb00b('0x5d')]===_0xb00b('0x5b')){var _0x7803a0=_0x5aac5f[_0xb00b('0x31')]({'plain':!![]});return db[_0xb00b('0x5e')][_0xb00b('0x52')]({'where':{'name':_0xb00b('0x32'),'userProfileId':_0xfb2b68['userProfileId']},'raw':!![]})[_0xb00b('0x2f')](function(_0x37a4c0){if(_0x37a4c0&&_0x37a4c0[_0xb00b('0x5f')]===0x0){return db[_0xb00b('0x33')][_0xb00b('0x5a')]({'name':_0x7803a0[_0xb00b('0x36')],'resourceId':_0x7803a0['id'],'type':_0x37a4c0['name'],'sectionId':_0x37a4c0['id']},{})[_0xb00b('0x2f')](function(){return _0x5aac5f;});}else{return _0x5aac5f;}})['catch'](function(_0x135cbf){logger['error'](_0xb00b('0x60'),_0x135cbf);throw _0x135cbf;});}return _0x5aac5f;})[_0xb00b('0x2f')](respondWithResult(_0x23762e,0xc9))[_0xb00b('0x22')](handleError(_0x23762e,null));};exports['update']=function(_0x5287cc,_0x9ad1c6,_0x3c4850){var _0x33a483;return db[_0xb00b('0x39')][_0xb00b('0x52')]({'where':{'id':_0x5287cc[_0xb00b('0x51')]['id']}})[_0xb00b('0x2f')](handleEntityNotFound(_0x9ad1c6,null))[_0xb00b('0x2f')](saveUpdates(_0x5287cc[_0xb00b('0x58')],null))[_0xb00b('0x2f')](function(_0x257430){if(_0x257430){_0x33a483=_0x257430;return db[_0xb00b('0x39')][_0xb00b('0x4f')]({'raw':!![]});}})[_0xb00b('0x2f')](function(_0x4eb17d){if(_0x4eb17d){var _0x59503c=fs[_0xb00b('0x61')](path[_0xb00b('0x62')](config['root'],'server/files/templates/trunk.ejs'),_0xb00b('0x64'));var _0x391e98=fs[_0xb00b('0x61')](path['join'](config[_0xb00b('0x65')],_0xb00b('0x66')),_0xb00b('0x64'));var _0x45c9cd=ejs[_0xb00b('0x67')](_0x59503c,{'trunks':_0x4eb17d||[]});fs[_0xb00b('0x68')](_0xb00b('0x69'),_0x45c9cd);var _0x4a9125=ejs[_0xb00b('0x67')](_0x391e98,{'trunks':_0x4eb17d||[]});fs['writeFileSync'](_0xb00b('0x6d'),_0x4a9125);return respondWithRpcPromise(_0xb00b('0x6b'),'update',{'module':_0xb00b('0x6c')});}return null;})[_0xb00b('0x2f')](function(_0xe80a21){if(_0xe80a21){return _0x33a483;}})[_0xb00b('0x2f')](respondWithResult(_0x9ad1c6,null))[_0xb00b('0x22')](handleError(_0x9ad1c6,null));};exports[_0xb00b('0x30')]=function(_0xc41c1f,_0x2423b2,_0x36ba5c){var _0x383d16;return db[_0xb00b('0x39')][_0xb00b('0x52')]({'where':{'id':_0xc41c1f['params']['id']}})[_0xb00b('0x2f')](handleEntityNotFound(_0x2423b2,null))[_0xb00b('0x2f')](removeEntity(_0x2423b2,null))[_0xb00b('0x2f')](function(){return db[_0xb00b('0x39')]['findAll']({'raw':!![]});})[_0xb00b('0x2f')](function(_0x17503d){var _0x32508b=fs[_0xb00b('0x61')](path[_0xb00b('0x62')](config['root'],_0xb00b('0x63')),_0xb00b('0x64'));var _0xa4fe1e=fs[_0xb00b('0x61')](path['join'](config[_0xb00b('0x65')],'server/files/templates/registry.ejs'),_0xb00b('0x64'));var _0x202d5f=ejs[_0xb00b('0x67')](_0x32508b,{'trunks':_0x17503d});var _0x165442=ejs[_0xb00b('0x67')](_0xa4fe1e,{'trunks':_0x17503d});fs[_0xb00b('0x68')](_0xb00b('0x69'),_0x202d5f);fs[_0xb00b('0x68')](_0xb00b('0x6d'),_0x165442);return respondWithRpcPromise(_0xb00b('0x6b'),_0xb00b('0x30'),{'module':'chan_sip.so'});})[_0xb00b('0x22')](handleError(_0x2423b2,null));}; \ No newline at end of file +var _0xe5b3=['then','info','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Trunk,\x20%s,\x20%s','request\x20sent','result','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','destroy','get','Trunks','UserProfileResource','stack','name','index','map','Trunk','rawAttributes','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','catch','clone','find','omit','createdAt','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','Reload','chan_sip.so','/etc/asterisk/sip_xcally_registers.conf','update','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request'];(function(_0x4c3ece,_0x57053e){var _0x409c1d=function(_0x411a3b){while(--_0x411a3b){_0x4c3ece['push'](_0x4c3ece['shift']());}};_0x409c1d(++_0x57053e);}(_0xe5b3,0x133));var _0x3e5b=function(_0x3424e9,_0x2b2ced){_0x3424e9=_0x3424e9-0x0;var _0x1dde58=_0xe5b3[_0x3424e9];return _0x1dde58;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3e5b('0x0'));var zipdir=require(_0x3e5b('0x1'));var jsonpatch=require(_0x3e5b('0x2'));var rp=require(_0x3e5b('0x3'));var moment=require(_0x3e5b('0x4'));var BPromise=require(_0x3e5b('0x5'));var Mustache=require(_0x3e5b('0x6'));var util=require(_0x3e5b('0x7'));var path=require(_0x3e5b('0x8'));var sox=require(_0x3e5b('0x9'));var csv=require(_0x3e5b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3e5b('0xb'));var _=require(_0x3e5b('0xc'));var squel=require('squel');var crypto=require(_0x3e5b('0xd'));var jsforce=require(_0x3e5b('0xe'));var deskjs=require(_0x3e5b('0xf'));var toCsv=require(_0x3e5b('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3e5b('0x10'));var authService=require(_0x3e5b('0x11'));var qs=require(_0x3e5b('0x12'));var as=require(_0x3e5b('0x13'));var hardwareService=require(_0x3e5b('0x14'));var logger=require('../../config/logger')(_0x3e5b('0x15'));var utils=require('../../config/utils');var config=require(_0x3e5b('0x16'));var licenseUtil=require(_0x3e5b('0x17'));var db=require(_0x3e5b('0x18'))['db'];var jayson=require(_0x3e5b('0x19'));var client=jayson[_0x3e5b('0x1a')][_0x3e5b('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x405e70,_0x560010,_0x39a2a1,_0x5f2f9c){return new BPromise(function(_0x51a188,_0x4d71a3){var _0x3754e3=_0x5f2f9c||client;return _0x3754e3[_0x3e5b('0x1c')](_0x405e70,_0x39a2a1)[_0x3e5b('0x1d')](function(_0x4fb471){logger[_0x3e5b('0x1e')]('Trunk,\x20%s,\x20%s',_0x560010,'request\x20sent');logger[_0x3e5b('0x1f')](_0x3e5b('0x20'),_0x560010,'request\x20sent',JSON[_0x3e5b('0x21')](_0x4fb471));if(_0x4fb471[_0x3e5b('0x22')]){if(_0x4fb471['error'][_0x3e5b('0x23')]===0x1f4){logger[_0x3e5b('0x22')]('Trunk,\x20%s,\x20%s',_0x560010,_0x4fb471['error'][_0x3e5b('0x24')]);return _0x4d71a3(_0x4fb471[_0x3e5b('0x22')][_0x3e5b('0x24')]);}logger[_0x3e5b('0x22')](_0x3e5b('0x25'),_0x560010,_0x4fb471[_0x3e5b('0x22')][_0x3e5b('0x24')]);return _0x51a188(_0x4fb471[_0x3e5b('0x22')][_0x3e5b('0x24')]);}else{logger[_0x3e5b('0x1e')](_0x3e5b('0x25'),_0x560010,_0x3e5b('0x26'));_0x51a188(_0x4fb471[_0x3e5b('0x27')][_0x3e5b('0x24')]);}})['catch'](function(_0x433f9c){logger[_0x3e5b('0x22')](_0x3e5b('0x25'),_0x560010,_0x433f9c);_0x4d71a3(_0x433f9c);});});}function respondWithStatusCode(_0x150674,_0x50039b){_0x50039b=_0x50039b||0xcc;return function(_0x1eb80f){if(_0x1eb80f){return _0x150674['sendStatus'](_0x50039b);}return _0x150674[_0x3e5b('0x28')](_0x50039b)[_0x3e5b('0x29')]();};}function respondWithResult(_0x4d5e61,_0x41b684){_0x41b684=_0x41b684||0xc8;return function(_0x2f6368){if(_0x2f6368){return _0x4d5e61[_0x3e5b('0x28')](_0x41b684)[_0x3e5b('0x2a')](_0x2f6368);}};}function respondWithFilteredResult(_0x3bb749,_0x26c7f2){return function(_0x160e87){if(_0x160e87){var _0x2ddf57=typeof _0x26c7f2['offset']===_0x3e5b('0x2b')&&typeof _0x26c7f2['limit']===_0x3e5b('0x2b');var _0x4fd64b=_0x160e87[_0x3e5b('0x2c')];var _0x1f6473=_0x2ddf57?0x0:_0x26c7f2[_0x3e5b('0x2d')];var _0x475b39=_0x2ddf57?_0x160e87[_0x3e5b('0x2c')]:_0x26c7f2[_0x3e5b('0x2d')]+_0x26c7f2[_0x3e5b('0x2e')];var _0x9c2123;if(_0x475b39>=_0x4fd64b){_0x475b39=_0x4fd64b;_0x9c2123=0xc8;}else{_0x9c2123=0xce;}_0x3bb749[_0x3e5b('0x28')](_0x9c2123);return _0x3bb749[_0x3e5b('0x2f')](_0x3e5b('0x30'),_0x1f6473+'-'+_0x475b39+'/'+_0x4fd64b)['json'](_0x160e87);}return null;};}function patchUpdates(_0x21bc10){return function(_0x1882aa){try{jsonpatch[_0x3e5b('0x31')](_0x1882aa,_0x21bc10,!![]);}catch(_0x2a14eb){return BPromise[_0x3e5b('0x32')](_0x2a14eb);}return _0x1882aa[_0x3e5b('0x33')]();};}function saveUpdates(_0x345927,_0x4c4e01){return function(_0x33f089){if(_0x33f089){return _0x33f089['update'](_0x345927)['then'](function(_0x32c6b0){return _0x32c6b0;});}return null;};}function removeEntity(_0x78d68a,_0x51ea0d){return function(_0x40e37d){if(_0x40e37d){return _0x40e37d[_0x3e5b('0x34')]()[_0x3e5b('0x1d')](function(){var _0x33e356=_0x40e37d[_0x3e5b('0x35')]({'plain':!![]});var _0x26f842=_0x3e5b('0x36');return db[_0x3e5b('0x37')][_0x3e5b('0x34')]({'where':{'type':_0x26f842,'resourceId':_0x33e356['id']}})[_0x3e5b('0x1d')](function(){return _0x40e37d;});})[_0x3e5b('0x1d')](function(){_0x78d68a[_0x3e5b('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x141b7e,_0xec45c5){return function(_0x53caa2){if(!_0x53caa2){_0x141b7e['sendStatus'](0x194);}return _0x53caa2;};}function handleError(_0x471196,_0x56d7ef){_0x56d7ef=_0x56d7ef||0x1f4;return function(_0x2939da){logger[_0x3e5b('0x22')](_0x2939da[_0x3e5b('0x38')]);if(_0x2939da[_0x3e5b('0x39')]){delete _0x2939da['name'];}_0x471196[_0x3e5b('0x28')](_0x56d7ef)['send'](_0x2939da);};}exports[_0x3e5b('0x3a')]=function(_0x5ec841,_0x47f7c8){var _0x48f414={},_0x10c202={},_0x174ebf={'count':0x0,'rows':[]};var _0x2eaa30=_[_0x3e5b('0x3b')](db[_0x3e5b('0x3c')][_0x3e5b('0x3d')],function(_0x5466ac){return{'name':_0x5466ac['fieldName'],'type':_0x5466ac['type']['key']};});_0x10c202['model']=_['map'](_0x2eaa30,'name');_0x10c202[_0x3e5b('0x3e')]=_[_0x3e5b('0x3f')](_0x5ec841[_0x3e5b('0x3e')]);_0x10c202[_0x3e5b('0x40')]=_[_0x3e5b('0x41')](_0x10c202[_0x3e5b('0x42')],_0x10c202[_0x3e5b('0x3e')]);_0x48f414[_0x3e5b('0x43')]=_[_0x3e5b('0x41')](_0x10c202[_0x3e5b('0x42')],qs[_0x3e5b('0x44')](_0x5ec841['query'][_0x3e5b('0x44')]));_0x48f414[_0x3e5b('0x43')]=_0x48f414[_0x3e5b('0x43')][_0x3e5b('0x45')]?_0x48f414[_0x3e5b('0x43')]:_0x10c202[_0x3e5b('0x42')];if(!_0x5ec841[_0x3e5b('0x3e')][_0x3e5b('0x46')](_0x3e5b('0x47'))){_0x48f414[_0x3e5b('0x2e')]=qs[_0x3e5b('0x2e')](_0x5ec841['query']['limit']);_0x48f414['offset']=qs['offset'](_0x5ec841[_0x3e5b('0x3e')][_0x3e5b('0x2d')]);}_0x48f414[_0x3e5b('0x48')]=qs[_0x3e5b('0x49')](_0x5ec841[_0x3e5b('0x3e')][_0x3e5b('0x49')]);_0x48f414[_0x3e5b('0x4a')]=qs[_0x3e5b('0x40')](_[_0x3e5b('0x4b')](_0x5ec841[_0x3e5b('0x3e')],_0x10c202['filters']),_0x2eaa30);if(_0x5ec841[_0x3e5b('0x3e')][_0x3e5b('0x4c')]){_0x48f414[_0x3e5b('0x4a')]=_[_0x3e5b('0x4d')](_0x48f414[_0x3e5b('0x4a')],{'$or':_['map'](_0x2eaa30,function(_0x588ee7){if(_0x588ee7['type']!==_0x3e5b('0x4e')){var _0x20af6a={};_0x20af6a[_0x588ee7[_0x3e5b('0x39')]]={'$like':'%'+_0x5ec841['query']['filter']+'%'};return _0x20af6a;}})});}_0x48f414=_[_0x3e5b('0x4d')]({},_0x48f414,_0x5ec841[_0x3e5b('0x4f')]);var _0x123947={'where':_0x48f414['where']};return db['Trunk'][_0x3e5b('0x2c')](_0x123947)['then'](function(_0x14b62a){_0x174ebf[_0x3e5b('0x2c')]=_0x14b62a;if(_0x5ec841[_0x3e5b('0x3e')][_0x3e5b('0x50')]){_0x48f414[_0x3e5b('0x51')]=[{'all':!![]}];}return db[_0x3e5b('0x3c')][_0x3e5b('0x52')](_0x48f414);})[_0x3e5b('0x1d')](function(_0x339852){_0x174ebf['rows']=_0x339852;return _0x174ebf;})[_0x3e5b('0x1d')](respondWithFilteredResult(_0x47f7c8,_0x48f414))['catch'](handleError(_0x47f7c8,null));};exports[_0x3e5b('0x53')]=function(_0x2e7047,_0x26e11e){var _0x3d51fa={'raw':![],'where':{'id':_0x2e7047[_0x3e5b('0x54')]['id']}},_0x291e4d={};_0x291e4d[_0x3e5b('0x42')]=_[_0x3e5b('0x3f')](db[_0x3e5b('0x3c')][_0x3e5b('0x3d')]);_0x291e4d[_0x3e5b('0x3e')]=_[_0x3e5b('0x3f')](_0x2e7047[_0x3e5b('0x3e')]);_0x291e4d['filters']=_[_0x3e5b('0x41')](_0x291e4d[_0x3e5b('0x42')],_0x291e4d[_0x3e5b('0x3e')]);_0x3d51fa[_0x3e5b('0x43')]=_[_0x3e5b('0x41')](_0x291e4d[_0x3e5b('0x42')],qs['fields'](_0x2e7047[_0x3e5b('0x3e')][_0x3e5b('0x44')]));_0x3d51fa[_0x3e5b('0x43')]=_0x3d51fa[_0x3e5b('0x43')][_0x3e5b('0x45')]?_0x3d51fa[_0x3e5b('0x43')]:_0x291e4d[_0x3e5b('0x42')];if(_0x2e7047[_0x3e5b('0x3e')]['includeAll']){_0x3d51fa[_0x3e5b('0x51')]=[{'all':!![]}];}_0x3d51fa=_['merge']({},_0x3d51fa,_0x2e7047['options']);return db[_0x3e5b('0x3c')]['find'](_0x3d51fa)[_0x3e5b('0x1d')](handleEntityNotFound(_0x26e11e,null))[_0x3e5b('0x1d')](respondWithResult(_0x26e11e,null))[_0x3e5b('0x55')](handleError(_0x26e11e,null));};exports[_0x3e5b('0x56')]=function(_0x4a492b,_0x5ddeee){var _0x545712={'where':{'id':_0x4a492b[_0x3e5b('0x54')]['id']}},_0x581b94={};_0x581b94[_0x3e5b('0x42')]=_[_0x3e5b('0x3f')](db[_0x3e5b('0x3c')][_0x3e5b('0x3d')]);_0x545712['attributes']=_['intersection'](_0x581b94[_0x3e5b('0x42')],qs[_0x3e5b('0x44')](_0x4a492b[_0x3e5b('0x3e')][_0x3e5b('0x44')]));_0x545712[_0x3e5b('0x43')]=_0x545712['attributes']['length']?_0x545712['attributes']:_0x581b94['model'];if(_0x4a492b[_0x3e5b('0x3e')][_0x3e5b('0x50')]){_0x545712[_0x3e5b('0x51')]=[{'all':!![]}];}_0x545712=_[_0x3e5b('0x4d')]({},_0x545712,_0x4a492b[_0x3e5b('0x4f')]);return db[_0x3e5b('0x3c')][_0x3e5b('0x57')](_0x545712)[_0x3e5b('0x1d')](handleEntityNotFound(_0x5ddeee,null))['then'](function(_0x285db6){if(_0x285db6){var _0x29897b=_0x285db6[_0x3e5b('0x35')]({'plain':!![]});_0x29897b=qs[_0x3e5b('0x58')](_0x29897b,['id',_0x3e5b('0x59'),'updatedAt']);_0x4a492b[_0x3e5b('0x5a')]=_['omit'](_0x4a492b[_0x3e5b('0x5a')],['id',_0x3e5b('0x59'),'updatedAt']);return db['Trunk']['create'](_[_0x3e5b('0x4d')](_0x29897b,_0x4a492b['body']),{'include':_0x4a492b[_0x3e5b('0x3e')][_0x3e5b('0x50')]?[{'all':!![]}]:undefined})[_0x3e5b('0x1d')](function(_0x40197c){var _0x14f187=_0x4a492b['user']['get']({'plain':!![]});if(!_0x14f187)throw new Error(_0x3e5b('0x5b'));if(_0x14f187[_0x3e5b('0x5c')]===_0x3e5b('0x5d')){var _0x4dfb45=_0x40197c[_0x3e5b('0x35')]({'plain':!![]});var _0x3c5293=_0x3e5b('0x36');return db[_0x3e5b('0x5e')][_0x3e5b('0x57')]({'where':{'name':_0x3c5293,'userProfileId':_0x14f187[_0x3e5b('0x5f')]},'raw':!![]})[_0x3e5b('0x1d')](function(_0x4a1ce3){if(_0x4a1ce3&&_0x4a1ce3[_0x3e5b('0x60')]===0x0){return db[_0x3e5b('0x37')][_0x3e5b('0x61')]({'name':_0x4dfb45[_0x3e5b('0x39')],'resourceId':_0x4dfb45['id'],'type':_0x4a1ce3[_0x3e5b('0x39')],'sectionId':_0x4a1ce3['id']},{})[_0x3e5b('0x1d')](function(){return _0x40197c;});}else{return _0x40197c;}})[_0x3e5b('0x55')](function(_0x2411c3){logger[_0x3e5b('0x22')](_0x3e5b('0x62'),_0x2411c3);throw _0x2411c3;});}return _0x40197c;});}})['then'](respondWithResult(_0x5ddeee,0xc9))[_0x3e5b('0x55')](handleError(_0x5ddeee,null));};exports[_0x3e5b('0x61')]=function(_0x5af305,_0x177144,_0x31ef31){var _0x561c78;return db['Trunk']['create'](_0x5af305[_0x3e5b('0x5a')],{'raw':!![]})[_0x3e5b('0x1d')](function(_0x498e6d){_0x561c78=_0x498e6d;return db[_0x3e5b('0x3c')][_0x3e5b('0x52')]({'raw':!![]});})['then'](function(_0x3d3bf2){var _0x17f60f=fs[_0x3e5b('0x63')](path[_0x3e5b('0x64')](config[_0x3e5b('0x65')],_0x3e5b('0x66')),_0x3e5b('0x67'));var _0x410c7a=fs[_0x3e5b('0x63')](path['join'](config[_0x3e5b('0x65')],_0x3e5b('0x68')),_0x3e5b('0x67'));var _0x40103e=ejs[_0x3e5b('0x69')](_0x17f60f,{'trunks':_0x3d3bf2||[]});fs[_0x3e5b('0x6a')](_0x3e5b('0x6b'),_0x40103e);if(_0x561c78['registry']){var _0x590f0c=ejs[_0x3e5b('0x69')](_0x410c7a,{'trunks':_0x3d3bf2||[]});fs[_0x3e5b('0x6a')]('/etc/asterisk/sip_xcally_registers.conf',_0x590f0c);}})[_0x3e5b('0x1d')](function(){return respondWithRpcPromise(_0x3e5b('0x6c'),_0x3e5b('0x61'),{'module':_0x3e5b('0x6d')});})[_0x3e5b('0x1d')](function(){var _0x9deb09=_0x5af305[_0x3e5b('0x5d')]['get']({'plain':!![]});if(!_0x9deb09)throw new Error(_0x3e5b('0x5b'));if(_0x9deb09[_0x3e5b('0x5c')]==='user'){var _0x577747=_0x561c78['get']({'plain':!![]});return db[_0x3e5b('0x5e')][_0x3e5b('0x57')]({'where':{'name':_0x3e5b('0x36'),'userProfileId':_0x9deb09[_0x3e5b('0x5f')]},'raw':!![]})[_0x3e5b('0x1d')](function(_0x1ba550){if(_0x1ba550&&_0x1ba550['autoAssociation']===0x0){return db[_0x3e5b('0x37')][_0x3e5b('0x61')]({'name':_0x577747['name'],'resourceId':_0x577747['id'],'type':_0x1ba550[_0x3e5b('0x39')],'sectionId':_0x1ba550['id']},{})['then'](function(){return _0x561c78;});}else{return _0x561c78;}})['catch'](function(_0x211e73){logger[_0x3e5b('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x211e73);throw _0x211e73;});}return _0x561c78;})[_0x3e5b('0x1d')](respondWithResult(_0x177144,0xc9))[_0x3e5b('0x55')](handleError(_0x177144,null));};exports['update']=function(_0x2e36af,_0x185640,_0x14baa9){var _0x1425eb;return db[_0x3e5b('0x3c')][_0x3e5b('0x57')]({'where':{'id':_0x2e36af['params']['id']}})['then'](handleEntityNotFound(_0x185640,null))[_0x3e5b('0x1d')](saveUpdates(_0x2e36af['body'],null))['then'](function(_0x25d3d8){if(_0x25d3d8){_0x1425eb=_0x25d3d8;return db[_0x3e5b('0x3c')][_0x3e5b('0x52')]({'raw':!![]});}})['then'](function(_0x2e5fa3){if(_0x2e5fa3){var _0x4b8d19=fs[_0x3e5b('0x63')](path['join'](config[_0x3e5b('0x65')],_0x3e5b('0x66')),_0x3e5b('0x67'));var _0xdf2677=fs['readFileSync'](path[_0x3e5b('0x64')](config['root'],_0x3e5b('0x68')),_0x3e5b('0x67'));var _0x58ccf3=ejs[_0x3e5b('0x69')](_0x4b8d19,{'trunks':_0x2e5fa3||[]});fs[_0x3e5b('0x6a')](_0x3e5b('0x6b'),_0x58ccf3);var _0x5ad011=ejs[_0x3e5b('0x69')](_0xdf2677,{'trunks':_0x2e5fa3||[]});fs[_0x3e5b('0x6a')](_0x3e5b('0x6e'),_0x5ad011);return respondWithRpcPromise('Reload',_0x3e5b('0x6f'),{'module':_0x3e5b('0x6d')});}return null;})['then'](function(_0xd9d941){if(_0xd9d941){return _0x1425eb;}})[_0x3e5b('0x1d')](respondWithResult(_0x185640,null))[_0x3e5b('0x55')](handleError(_0x185640,null));};exports['destroy']=function(_0x3b3306,_0x30e079,_0x352f7e){var _0x1d7c05;return db['Trunk'][_0x3e5b('0x57')]({'where':{'id':_0x3b3306['params']['id']}})[_0x3e5b('0x1d')](handleEntityNotFound(_0x30e079,null))['then'](removeEntity(_0x30e079,null))[_0x3e5b('0x1d')](function(){return db[_0x3e5b('0x3c')]['findAll']({'raw':!![]});})[_0x3e5b('0x1d')](function(_0x2299b9){var _0x56ff9d=fs[_0x3e5b('0x63')](path[_0x3e5b('0x64')](config[_0x3e5b('0x65')],_0x3e5b('0x66')),'utf8');var _0x53328b=fs[_0x3e5b('0x63')](path[_0x3e5b('0x64')](config[_0x3e5b('0x65')],_0x3e5b('0x68')),_0x3e5b('0x67'));var _0x3d1193=ejs['render'](_0x56ff9d,{'trunks':_0x2299b9});var _0x5d6aae=ejs[_0x3e5b('0x69')](_0x53328b,{'trunks':_0x2299b9});fs[_0x3e5b('0x6a')](_0x3e5b('0x6b'),_0x3d1193);fs[_0x3e5b('0x6a')](_0x3e5b('0x6e'),_0x5d6aae);return respondWithRpcPromise(_0x3e5b('0x6c'),_0x3e5b('0x34'),{'module':_0x3e5b('0x6d')});})['catch'](handleError(_0x30e079,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 68bec12..640b522 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 _0xb5f9=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./trunk.attributes','exports','Trunk','tools_trunks','lodash'];(function(_0x985e,_0x4c4de4){var _0x39912b=function(_0x1e5d4f){while(--_0x1e5d4f){_0x985e['push'](_0x985e['shift']());}};_0x39912b(++_0x4c4de4);}(_0xb5f9,0x110));var _0x9b5f=function(_0x1bfb73,_0x44807f){_0x1bfb73=_0x1bfb73-0x0;var _0x347b43=_0xb5f9[_0x1bfb73];return _0x347b43;};'use strict';var _=require(_0x9b5f('0x0'));var util=require(_0x9b5f('0x1'));var logger=require(_0x9b5f('0x2'))(_0x9b5f('0x3'));var moment=require('moment');var BPromise=require(_0x9b5f('0x4'));var rp=require(_0x9b5f('0x5'));var fs=require('fs');var path=require(_0x9b5f('0x6'));var rimraf=require(_0x9b5f('0x7'));var config=require(_0x9b5f('0x8'));var attributes=require(_0x9b5f('0x9'));module[_0x9b5f('0xa')]=function(_0x18c4aa,_0x3eae7b){return _0x18c4aa['define'](_0x9b5f('0xb'),attributes,{'tableName':_0x9b5f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xee3e=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./trunk.attributes','exports','define','Trunk','lodash','util','../../config/logger','api'];(function(_0x2d092f,_0xc59614){var _0x181480=function(_0x52dfb5){while(--_0x52dfb5){_0x2d092f['push'](_0x2d092f['shift']());}};_0x181480(++_0xc59614);}(_0xee3e,0x1bc));var _0xeee3=function(_0x5dd009,_0x50876e){_0x5dd009=_0x5dd009-0x0;var _0x2cc96b=_0xee3e[_0x5dd009];return _0x2cc96b;};'use strict';var _=require(_0xeee3('0x0'));var util=require(_0xeee3('0x1'));var logger=require(_0xeee3('0x2'))(_0xeee3('0x3'));var moment=require(_0xeee3('0x4'));var BPromise=require(_0xeee3('0x5'));var rp=require(_0xeee3('0x6'));var fs=require('fs');var path=require(_0xeee3('0x7'));var rimraf=require(_0xeee3('0x8'));var config=require(_0xeee3('0x9'));var attributes=require(_0xeee3('0xa'));module[_0xeee3('0xb')]=function(_0x5e0891,_0x90085b){return _0x5e0891[_0xeee3('0xc')](_0xeee3('0xd'),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 a5a4f87..3c1b05c 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 _0x0f24=['rpc','../../config/environment','jayson/promise','http','request','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','GetTrunk','Trunk','options','raw','where','attributes','limit','include','model','map','find','ShowTrunk','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x581aae,_0x96d7c8){var _0x145a5f=function(_0x4fe5a9){while(--_0x4fe5a9){_0x581aae['push'](_0x581aae['shift']());}};_0x145a5f(++_0x96d7c8);}(_0x0f24,0x191));var _0x40f2=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0f24[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x40f2('0x0'));var util=require(_0x40f2('0x1'));var moment=require(_0x40f2('0x2'));var BPromise=require(_0x40f2('0x3'));var rs=require(_0x40f2('0x4'));var fs=require('fs');var Redis=require(_0x40f2('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x40f2('0x6'));var logger=require('../../config/logger')(_0x40f2('0x7'));var config=require(_0x40f2('0x8'));var jayson=require(_0x40f2('0x9'));var client=jayson['client'][_0x40f2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x14d801,_0x9155ba,_0x35a4b5){return new BPromise(function(_0x2f360c,_0x4b57bd){return client[_0x40f2('0xb')](_0x14d801,_0x35a4b5)['then'](function(_0x309b28){logger['info'](_0x40f2('0xc'),_0x9155ba,_0x40f2('0xd'));logger[_0x40f2('0xe')](_0x40f2('0xf'),_0x9155ba,_0x40f2('0xd'),JSON[_0x40f2('0x10')](_0x309b28));if(_0x309b28[_0x40f2('0x11')]){if(_0x309b28['error']['code']===0x1f4){logger[_0x40f2('0x11')]('Trunk,\x20%s,\x20%s',_0x9155ba,_0x309b28['error'][_0x40f2('0x12')]);return _0x4b57bd(_0x309b28['error']['message']);}logger['error'](_0x40f2('0xc'),_0x9155ba,_0x309b28[_0x40f2('0x11')][_0x40f2('0x12')]);return _0x2f360c(_0x309b28[_0x40f2('0x11')][_0x40f2('0x12')]);}else{logger[_0x40f2('0x13')](_0x40f2('0xc'),_0x9155ba,_0x40f2('0xd'));_0x2f360c(_0x309b28[_0x40f2('0x14')][_0x40f2('0x12')]);}})[_0x40f2('0x15')](function(_0x1590c5){logger['error'](_0x40f2('0xc'),_0x9155ba,_0x1590c5);_0x4b57bd(_0x1590c5);});});}exports[_0x40f2('0x16')]=function(_0xaa13c7){var _0x517953=this;return new Promise(function(_0x1c392c,_0x215dbb){return db[_0x40f2('0x17')]['findAll']({'raw':_0xaa13c7[_0x40f2('0x18')]?_0xaa13c7[_0x40f2('0x18')][_0x40f2('0x19')]===undefined?!![]:![]:!![],'where':_0xaa13c7[_0x40f2('0x18')]?_0xaa13c7[_0x40f2('0x18')][_0x40f2('0x1a')]||null:null,'attributes':_0xaa13c7[_0x40f2('0x18')]?_0xaa13c7[_0x40f2('0x18')][_0x40f2('0x1b')]||null:null,'limit':_0xaa13c7[_0x40f2('0x18')]?_0xaa13c7[_0x40f2('0x18')][_0x40f2('0x1c')]||null:null,'include':_0xaa13c7[_0x40f2('0x18')]?_0xaa13c7[_0x40f2('0x18')][_0x40f2('0x1d')]?_['map'](_0xaa13c7[_0x40f2('0x18')][_0x40f2('0x1d')],function(_0x5e47e0){return{'model':db[_0x5e47e0[_0x40f2('0x1e')]],'as':_0x5e47e0['as'],'attributes':_0x5e47e0[_0x40f2('0x1b')],'include':_0x5e47e0[_0x40f2('0x1d')]?_[_0x40f2('0x1f')](_0x5e47e0['include'],function(_0x144e05){return{'model':db[_0x144e05['model']],'as':_0x144e05['as'],'attributes':_0x144e05[_0x40f2('0x1b')],'include':_0x144e05[_0x40f2('0x1d')]?_['map'](_0x144e05[_0x40f2('0x1d')],function(_0x48ad0b){return{'model':db[_0x48ad0b[_0x40f2('0x1e')]],'as':_0x48ad0b['as'],'attributes':_0x48ad0b[_0x40f2('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x549a0b){logger[_0x40f2('0x13')]('GetTrunk',_0xaa13c7);logger[_0x40f2('0xe')](_0x40f2('0x16'),_0xaa13c7,JSON[_0x40f2('0x10')](_0x549a0b));_0x1c392c(_0x549a0b);})[_0x40f2('0x15')](function(_0x362cbf){logger['error'](_0x40f2('0x16'),_0x362cbf[_0x40f2('0x12')],_0xaa13c7);_0x215dbb(_0x517953[_0x40f2('0x11')](0x1f4,_0x362cbf[_0x40f2('0x12')]));});});};exports['ShowTrunk']=function(_0x50f178){var _0x420897=this;return new Promise(function(_0x522196,_0x7a63ce){return db[_0x40f2('0x17')][_0x40f2('0x20')]({'raw':_0x50f178[_0x40f2('0x18')]?_0x50f178[_0x40f2('0x18')][_0x40f2('0x19')]===undefined?!![]:![]:!![],'where':_0x50f178['options']?_0x50f178[_0x40f2('0x18')][_0x40f2('0x1a')]||null:null,'attributes':_0x50f178[_0x40f2('0x18')]?_0x50f178['options'][_0x40f2('0x1b')]||null:null,'include':_0x50f178[_0x40f2('0x18')]?_0x50f178[_0x40f2('0x18')][_0x40f2('0x1d')]?_[_0x40f2('0x1f')](_0x50f178[_0x40f2('0x18')]['include'],function(_0x389ba2){return{'model':db[_0x389ba2['model']],'as':_0x389ba2['as'],'attributes':_0x389ba2[_0x40f2('0x1b')],'include':_0x389ba2['include']?_[_0x40f2('0x1f')](_0x389ba2['include'],function(_0x235f84){return{'model':db[_0x235f84['model']],'as':_0x235f84['as'],'attributes':_0x235f84[_0x40f2('0x1b')],'include':_0x235f84[_0x40f2('0x1d')]?_[_0x40f2('0x1f')](_0x235f84[_0x40f2('0x1d')],function(_0x3b01eb){return{'model':db[_0x3b01eb['model']],'as':_0x3b01eb['as'],'attributes':_0x3b01eb[_0x40f2('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x553b39){logger[_0x40f2('0x13')](_0x40f2('0x21'),_0x50f178);logger[_0x40f2('0xe')]('ShowTrunk',_0x50f178,JSON[_0x40f2('0x10')](_0x553b39));_0x522196(_0x553b39);})[_0x40f2('0x15')](function(_0x2f408d){logger['error'](_0x40f2('0x21'),_0x2f408d[_0x40f2('0x12')],_0x50f178);_0x7a63ce(_0x420897['error'](0x1f4,_0x2f408d[_0x40f2('0x12')]));});});}; \ No newline at end of file +var _0xc8dc=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','info','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Trunk,\x20%s,\x20%s','message','catch','GetTrunk','findAll','options','raw','where','attributes','limit','include','map','model','Trunk','find','ShowTrunk','lodash','util','moment'];(function(_0x4fb540,_0x29418f){var _0x58f641=function(_0x47f989){while(--_0x47f989){_0x4fb540['push'](_0x4fb540['shift']());}};_0x58f641(++_0x29418f);}(_0xc8dc,0xcf));var _0xcc8d=function(_0x20cb5d,_0x5b6ec7){_0x20cb5d=_0x20cb5d-0x0;var _0x33dd23=_0xc8dc[_0x20cb5d];return _0x33dd23;};'use strict';var _=require(_0xcc8d('0x0'));var util=require(_0xcc8d('0x1'));var moment=require(_0xcc8d('0x2'));var BPromise=require(_0xcc8d('0x3'));var rs=require(_0xcc8d('0x4'));var fs=require('fs');var Redis=require(_0xcc8d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xcc8d('0x6'));var logger=require(_0xcc8d('0x7'))(_0xcc8d('0x8'));var config=require('../../config/environment');var jayson=require(_0xcc8d('0x9'));var client=jayson['client'][_0xcc8d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x12a3b2,_0x4674b6,_0x5de7ef){return new BPromise(function(_0x1b0121,_0x5ba95e){return client['request'](_0x12a3b2,_0x5de7ef)[_0xcc8d('0xb')](function(_0x59d5c1){logger[_0xcc8d('0xc')]('Trunk,\x20%s,\x20%s',_0x4674b6,'request\x20sent');logger[_0xcc8d('0xd')](_0xcc8d('0xe'),_0x4674b6,_0xcc8d('0xf'),JSON[_0xcc8d('0x10')](_0x59d5c1));if(_0x59d5c1[_0xcc8d('0x11')]){if(_0x59d5c1[_0xcc8d('0x11')][_0xcc8d('0x12')]===0x1f4){logger[_0xcc8d('0x11')](_0xcc8d('0x13'),_0x4674b6,_0x59d5c1['error'][_0xcc8d('0x14')]);return _0x5ba95e(_0x59d5c1[_0xcc8d('0x11')][_0xcc8d('0x14')]);}logger[_0xcc8d('0x11')](_0xcc8d('0x13'),_0x4674b6,_0x59d5c1[_0xcc8d('0x11')]['message']);return _0x1b0121(_0x59d5c1['error']['message']);}else{logger[_0xcc8d('0xc')](_0xcc8d('0x13'),_0x4674b6,_0xcc8d('0xf'));_0x1b0121(_0x59d5c1['result']['message']);}})[_0xcc8d('0x15')](function(_0x78ca98){logger['error'](_0xcc8d('0x13'),_0x4674b6,_0x78ca98);_0x5ba95e(_0x78ca98);});});}exports[_0xcc8d('0x16')]=function(_0x4dc9d6){var _0x4abbbe=this;return new Promise(function(_0x5e2075,_0x2319fb){return db['Trunk'][_0xcc8d('0x17')]({'raw':_0x4dc9d6['options']?_0x4dc9d6[_0xcc8d('0x18')][_0xcc8d('0x19')]===undefined?!![]:![]:!![],'where':_0x4dc9d6[_0xcc8d('0x18')]?_0x4dc9d6['options'][_0xcc8d('0x1a')]||null:null,'attributes':_0x4dc9d6[_0xcc8d('0x18')]?_0x4dc9d6[_0xcc8d('0x18')][_0xcc8d('0x1b')]||null:null,'limit':_0x4dc9d6[_0xcc8d('0x18')]?_0x4dc9d6[_0xcc8d('0x18')][_0xcc8d('0x1c')]||null:null,'include':_0x4dc9d6[_0xcc8d('0x18')]?_0x4dc9d6[_0xcc8d('0x18')][_0xcc8d('0x1d')]?_[_0xcc8d('0x1e')](_0x4dc9d6['options']['include'],function(_0x37a56f){return{'model':db[_0x37a56f[_0xcc8d('0x1f')]],'as':_0x37a56f['as'],'attributes':_0x37a56f[_0xcc8d('0x1b')],'include':_0x37a56f[_0xcc8d('0x1d')]?_[_0xcc8d('0x1e')](_0x37a56f[_0xcc8d('0x1d')],function(_0x1e0da7){return{'model':db[_0x1e0da7[_0xcc8d('0x1f')]],'as':_0x1e0da7['as'],'attributes':_0x1e0da7['attributes'],'include':_0x1e0da7['include']?_[_0xcc8d('0x1e')](_0x1e0da7[_0xcc8d('0x1d')],function(_0x205a73){return{'model':db[_0x205a73[_0xcc8d('0x1f')]],'as':_0x205a73['as'],'attributes':_0x205a73['attributes']};}):[]};}):[]};}):[]:[]})[_0xcc8d('0xb')](function(_0x1fad71){logger[_0xcc8d('0xc')](_0xcc8d('0x16'),_0x4dc9d6);logger[_0xcc8d('0xd')](_0xcc8d('0x16'),_0x4dc9d6,JSON[_0xcc8d('0x10')](_0x1fad71));_0x5e2075(_0x1fad71);})['catch'](function(_0x4d1e3f){logger[_0xcc8d('0x11')](_0xcc8d('0x16'),_0x4d1e3f['message'],_0x4dc9d6);_0x2319fb(_0x4abbbe['error'](0x1f4,_0x4d1e3f[_0xcc8d('0x14')]));});});};exports['ShowTrunk']=function(_0x52d10){var _0x4f5d99=this;return new Promise(function(_0x214915,_0x4d3125){return db[_0xcc8d('0x20')][_0xcc8d('0x21')]({'raw':_0x52d10['options']?_0x52d10[_0xcc8d('0x18')][_0xcc8d('0x19')]===undefined?!![]:![]:!![],'where':_0x52d10[_0xcc8d('0x18')]?_0x52d10[_0xcc8d('0x18')][_0xcc8d('0x1a')]||null:null,'attributes':_0x52d10[_0xcc8d('0x18')]?_0x52d10[_0xcc8d('0x18')][_0xcc8d('0x1b')]||null:null,'include':_0x52d10[_0xcc8d('0x18')]?_0x52d10[_0xcc8d('0x18')][_0xcc8d('0x1d')]?_['map'](_0x52d10[_0xcc8d('0x18')][_0xcc8d('0x1d')],function(_0x5a066c){return{'model':db[_0x5a066c[_0xcc8d('0x1f')]],'as':_0x5a066c['as'],'attributes':_0x5a066c[_0xcc8d('0x1b')],'include':_0x5a066c[_0xcc8d('0x1d')]?_[_0xcc8d('0x1e')](_0x5a066c['include'],function(_0x1fe9f4){return{'model':db[_0x1fe9f4['model']],'as':_0x1fe9f4['as'],'attributes':_0x1fe9f4[_0xcc8d('0x1b')],'include':_0x1fe9f4[_0xcc8d('0x1d')]?_['map'](_0x1fe9f4[_0xcc8d('0x1d')],function(_0x25c40e){return{'model':db[_0x25c40e[_0xcc8d('0x1f')]],'as':_0x25c40e['as'],'attributes':_0x25c40e[_0xcc8d('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xcc8d('0xb')](function(_0x2b59b8){logger[_0xcc8d('0xc')](_0xcc8d('0x22'),_0x52d10);logger[_0xcc8d('0xd')](_0xcc8d('0x22'),_0x52d10,JSON[_0xcc8d('0x10')](_0x2b59b8));_0x214915(_0x2b59b8);})[_0xcc8d('0x15')](function(_0xe7e5fe){logger[_0xcc8d('0x11')](_0xcc8d('0x22'),_0xe7e5fe[_0xcc8d('0x14')],_0x52d10);_0x4d3125(_0x4f5d99[_0xcc8d('0x11')](0x1f4,_0xe7e5fe[_0xcc8d('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index 0b030fa..9912b8a 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 _0xeae9=['put','isAuthenticated','update','../../components/auth/service','./user-setting.controller'];(function(_0x37c6c3,_0x95ace){var _0xf87ee2=function(_0x16d7f9){while(--_0x16d7f9){_0x37c6c3['push'](_0x37c6c3['shift']());}};_0xf87ee2(++_0x95ace);}(_0xeae9,0xad));var _0x9eae=function(_0x24f19c,_0x31ea9a){_0x24f19c=_0x24f19c-0x0;var _0x18645f=_0xeae9[_0x24f19c];return _0x18645f;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0x9eae('0x0'));var controller=require(_0x9eae('0x1'));router[_0x9eae('0x2')]('/:id',auth[_0x9eae('0x3')](),controller[_0x9eae('0x4')]);module['exports']=router; \ No newline at end of file +var _0x1d7a=['Router','../../components/auth/service','./user-setting.controller','put','/:id','isAuthenticated','express'];(function(_0x442d46,_0x3ee227){var _0xb5e39a=function(_0x152efd){while(--_0x152efd){_0x442d46['push'](_0x442d46['shift']());}};_0xb5e39a(++_0x3ee227);}(_0x1d7a,0x19c));var _0xa1d7=function(_0x3330b8,_0x19b32a){_0x3330b8=_0x3330b8-0x0;var _0x191799=_0x1d7a[_0x3330b8];return _0x191799;};'use strict';var express=require(_0xa1d7('0x0'));var router=express[_0xa1d7('0x1')]();var auth=require(_0xa1d7('0x2'));var controller=require(_0xa1d7('0x3'));router[_0xa1d7('0x4')](_0xa1d7('0x5'),auth[_0xa1d7('0x6')](),controller['update']);module['exports']=router; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.attributes.js b/server/api/user-setting/user-setting.attributes.js index eb46de4..c3b2dc5 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 _0x3297=['error','info','exports','ENUM','BOOLEAN','DATE','INTEGER','UserId','sequelize'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x3297,0x1af));var _0x7329=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0x3297[_0x4baae2];return _0x1a2285;};'use strict';var Sequelize=require(_0x7329('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0x7329('0x1'),'warning',_0x7329('0x2'),'debug'];module[_0x7329('0x3')]={'clientSideLoggingLevel':{'type':Sequelize[_0x7329('0x4')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x7329('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x7329('0x5')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize['TEXT'],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x7329('0x6')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x7329('0x7')],'unique':_0x7329('0x8')}}; \ No newline at end of file +var _0x8455=['DATE','UserId','error','warning','info','debug','exports','BOOLEAN','TEXT'];(function(_0x569f7a,_0x33aff2){var _0x2358e6=function(_0x5f2173){while(--_0x5f2173){_0x569f7a['push'](_0x569f7a['shift']());}};_0x2358e6(++_0x33aff2);}(_0x8455,0x1f1));var _0x5845=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8455[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');const CLIENT_SIDE_LOG_LEVELS=[_0x5845('0x0'),_0x5845('0x1'),_0x5845('0x2'),_0x5845('0x3')];module[_0x5845('0x4')]={'clientSideLoggingLevel':{'type':Sequelize['ENUM'](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x5845('0x0'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x5845('0x5')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0x5845('0x6')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x5845('0x7')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize['INTEGER'],'unique':_0x5845('0x8')}}; \ 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 47ae591..b7a3fd7 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 _0x6a24=['body','catch','lodash','ioredis','api','../../config/environment','../../mysqldb','socket.io-emitter','redis','register','localhost','status','update','sendStatus','error','name','user','role','admin','Unauthorized','params','find','then'];(function(_0x590a3a,_0xd9db9){var _0x49017f=function(_0x1d92e9){while(--_0x1d92e9){_0x590a3a['push'](_0x590a3a['shift']());}};_0x49017f(++_0xd9db9);}(_0x6a24,0xd1));var _0x46a2=function(_0x451b83,_0x1d66e6){_0x451b83=_0x451b83-0x0;var _0xe72d93=_0x6a24[_0x451b83];return _0xe72d93;};'use strict';var _=require(_0x46a2('0x0'));var Redis=require(_0x46a2('0x1'));var logger=require('../../config/logger')(_0x46a2('0x2'));var config=require(_0x46a2('0x3'));var db=require(_0x46a2('0x4'))['db'];var socket=require(_0x46a2('0x5'))(new Redis(config[_0x46a2('0x6')]));require('./user-setting.socket')[_0x46a2('0x7')](socket);config[_0x46a2('0x6')]=_['defaults'](config[_0x46a2('0x6')],{'host':_0x46a2('0x8'),'port':0x18eb});function respondWithResult(_0x506698,_0x49870f){_0x49870f=_0x49870f||0xc8;return function(_0x2092f3){if(_0x2092f3){return _0x506698[_0x46a2('0x9')](_0x49870f)['json'](_0x2092f3);}};}function saveUpdates(_0xafeea5){return function(_0x5db4d0){if(_0x5db4d0){return _0x5db4d0[_0x46a2('0xa')](_0xafeea5)['then'](function(_0x34c0cf){return _0x34c0cf;});}return null;};}function handleEntityNotFound(_0x6e22ae){return function(_0x21d1f3){if(!_0x21d1f3){_0x6e22ae[_0x46a2('0xb')](0x194);}return _0x21d1f3;};}function handleError(_0x35e6d9,_0x40ef63){_0x40ef63=_0x40ef63||0x1f4;return function(_0x1f9449){logger[_0x46a2('0xc')](_0x1f9449['stack']);if(_0x1f9449['name']){delete _0x1f9449[_0x46a2('0xd')];}_0x35e6d9[_0x46a2('0x9')](_0x40ef63)['send'](_0x1f9449);};}exports[_0x46a2('0xa')]=function(_0x2fd601,_0x44cacb){if(_0x2fd601[_0x46a2('0xe')][_0x46a2('0xf')]!==_0x46a2('0x10'))throw new Error(_0x46a2('0x11'));if(isNaN(Number(_0x2fd601[_0x46a2('0x12')]['id'])))throw new Error('Invalid\x20user\x20setting\x20id');return db['UserSetting'][_0x46a2('0x13')]({'where':{'id':_0x2fd601[_0x46a2('0x12')]['id']}})['then'](handleEntityNotFound(_0x44cacb,null))[_0x46a2('0x14')](saveUpdates(_0x2fd601[_0x46a2('0x15')],null))['then'](respondWithResult(_0x44cacb,null))[_0x46a2('0x16')](handleError(_0x44cacb,null));}; \ No newline at end of file +var _0x192f=['error','stack','name','send','user','role','admin','Unauthorized','params','Invalid\x20user\x20setting\x20id','find','then','body','catch','lodash','../../config/logger','../../config/environment','redis','./user-setting.socket','register','defaults','status','json','update','sendStatus'];(function(_0x393dfe,_0x1665b7){var _0x31d2e8=function(_0x587712){while(--_0x587712){_0x393dfe['push'](_0x393dfe['shift']());}};_0x31d2e8(++_0x1665b7);}(_0x192f,0xd6));var _0xf192=function(_0x1e43e9,_0x33cd0b){_0x1e43e9=_0x1e43e9-0x0;var _0x2e26d0=_0x192f[_0x1e43e9];return _0x2e26d0;};'use strict';var _=require(_0xf192('0x0'));var Redis=require('ioredis');var logger=require(_0xf192('0x1'))('api');var config=require(_0xf192('0x2'));var db=require('../../mysqldb')['db'];var socket=require('socket.io-emitter')(new Redis(config[_0xf192('0x3')]));require(_0xf192('0x4'))[_0xf192('0x5')](socket);config[_0xf192('0x3')]=_[_0xf192('0x6')](config[_0xf192('0x3')],{'host':'localhost','port':0x18eb});function respondWithResult(_0x38dcbf,_0x4171d9){_0x4171d9=_0x4171d9||0xc8;return function(_0x5743c9){if(_0x5743c9){return _0x38dcbf[_0xf192('0x7')](_0x4171d9)[_0xf192('0x8')](_0x5743c9);}};}function saveUpdates(_0x18fc0e){return function(_0x24398d){if(_0x24398d){return _0x24398d[_0xf192('0x9')](_0x18fc0e)['then'](function(_0x4c9d03){return _0x4c9d03;});}return null;};}function handleEntityNotFound(_0x3004d1){return function(_0x3389aa){if(!_0x3389aa){_0x3004d1[_0xf192('0xa')](0x194);}return _0x3389aa;};}function handleError(_0x2cb4b2,_0x2ef3e8){_0x2ef3e8=_0x2ef3e8||0x1f4;return function(_0xd855ea){logger[_0xf192('0xb')](_0xd855ea[_0xf192('0xc')]);if(_0xd855ea['name']){delete _0xd855ea[_0xf192('0xd')];}_0x2cb4b2[_0xf192('0x7')](_0x2ef3e8)[_0xf192('0xe')](_0xd855ea);};}exports[_0xf192('0x9')]=function(_0x321c6b,_0x20bbcf){if(_0x321c6b[_0xf192('0xf')][_0xf192('0x10')]!==_0xf192('0x11'))throw new Error(_0xf192('0x12'));if(isNaN(Number(_0x321c6b[_0xf192('0x13')]['id'])))throw new Error(_0xf192('0x14'));return db['UserSetting'][_0xf192('0x15')]({'where':{'id':_0x321c6b[_0xf192('0x13')]['id']}})['then'](handleEntityNotFound(_0x20bbcf,null))[_0xf192('0x16')](saveUpdates(_0x321c6b[_0xf192('0x17')],null))[_0xf192('0x16')](respondWithResult(_0x20bbcf,null))[_0xf192('0x18')](handleError(_0x20bbcf,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 540e0e6..8e67e12 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 _0x44b4=['setMaxListeners','save','update','hasOwnProperty','exports','events'];(function(_0x652561,_0x370b69){var _0x1d6933=function(_0xfed5){while(--_0xfed5){_0x652561['push'](_0x652561['shift']());}};_0x1d6933(++_0x370b69);}(_0x44b4,0x155));var _0x444b=function(_0x28ef4e,_0x202aa3){_0x28ef4e=_0x28ef4e-0x0;var _0x1aa097=_0x44b4[_0x28ef4e];return _0x1aa097;};'use strict';var EventEmitter=require(_0x444b('0x0'));var UserSetting=require('../../mysqldb')['db']['UserSetting'];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x444b('0x1')](0x0);var events={'afterCreate':_0x444b('0x2'),'afterUpdate':_0x444b('0x3'),'afterDestroy':'remove'};function emitEvent(_0x616e80){return function(_0x3f5050,_0x45a83b,_0x4c7bcd){UserSettingEvents['emit'](_0x616e80+':'+_0x3f5050['id'],_0x3f5050);UserSettingEvents['emit'](_0x616e80,_0x3f5050);_0x4c7bcd(null);};}for(var e in events){if(events[_0x444b('0x4')](e)){var event=events[e];UserSetting['hook'](e,emitEvent(event));}}module[_0x444b('0x5')]=UserSettingEvents; \ No newline at end of file +var _0x1736=['save','update','remove','emit','hook','exports','events','../../mysqldb','UserSetting'];(function(_0x17294a,_0x5f5663){var _0x24002b=function(_0x5a854c){while(--_0x5a854c){_0x17294a['push'](_0x17294a['shift']());}};_0x24002b(++_0x5f5663);}(_0x1736,0x180));var _0x6173=function(_0x1b080f,_0x446fe5){_0x1b080f=_0x1b080f-0x0;var _0x2af5fb=_0x1736[_0x1b080f];return _0x2af5fb;};'use strict';var EventEmitter=require(_0x6173('0x0'));var UserSetting=require(_0x6173('0x1'))['db'][_0x6173('0x2')];var UserSettingEvents=new EventEmitter();UserSettingEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6173('0x3'),'afterUpdate':_0x6173('0x4'),'afterDestroy':_0x6173('0x5')};function emitEvent(_0x973902){return function(_0x645aed,_0x5e908d,_0x4fbff8){UserSettingEvents[_0x6173('0x6')](_0x973902+':'+_0x645aed['id'],_0x645aed);UserSettingEvents[_0x6173('0x6')](_0x973902,_0x645aed);_0x4fbff8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserSetting[_0x6173('0x7')](e,emitEvent(event));}}module[_0x6173('0x8')]=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 2d5db84..2196823 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 _0x2964=['define','UserSetting','user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes','exports'];(function(_0x315932,_0x2fd8f5){var _0x1d0e14=function(_0x35dc03){while(--_0x35dc03){_0x315932['push'](_0x315932['shift']());}};_0x1d0e14(++_0x2fd8f5);}(_0x2964,0x108));var _0x4296=function(_0x26f947,_0x1a2088){_0x26f947=_0x26f947-0x0;var _0x20d59e=_0x2964[_0x26f947];return _0x20d59e;};'use strict';var attributes=require(_0x4296('0x0'));module[_0x4296('0x1')]=function(_0x31be5e){return _0x31be5e[_0x4296('0x2')](_0x4296('0x3'),attributes,{'tableName':_0x4296('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xb24db7){if(!_0xb24db7[_0x4296('0x5')])_0xb24db7[_0x4296('0x6')]=null;else if(_0xb24db7['clientSideLoggingEnabledSince']===null)_0xb24db7[_0x4296('0x6')]=new Date();}}});}; \ No newline at end of file +var _0x04b8=['exports','define','UserSetting','clientSideLoggingEnabled','clientSideLoggingEnabledSince'];(function(_0xc5a8f7,_0x17c727){var _0x15763c=function(_0x3bb1ee){while(--_0x3bb1ee){_0xc5a8f7['push'](_0xc5a8f7['shift']());}};_0x15763c(++_0x17c727);}(_0x04b8,0x159));var _0x804b=function(_0x381c37,_0xa5e426){_0x381c37=_0x381c37-0x0;var _0x432b5c=_0x04b8[_0x381c37];return _0x432b5c;};'use strict';var attributes=require('./user-setting.attributes');module[_0x804b('0x0')]=function(_0x49c1b2){return _0x49c1b2[_0x804b('0x1')](_0x804b('0x2'),attributes,{'tableName':'user_settings','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1a52ec){if(!_0x1a52ec[_0x804b('0x3')])_0x1a52ec['clientSideLoggingEnabledSince']=null;else if(_0x1a52ec[_0x804b('0x4')]===null)_0x1a52ec[_0x804b('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 20b9497..c602dd0 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 _0x9d0f=['./user-setting.events','save','update','emit','user-setting:update','user-setting:update:user-','UserId','register','length','user-setting:'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9d0f,0x1a4));var _0xf9d0=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x9d0f[_0x432682];return _0x463d05;};'use strict';var UserSettingEvents=require(_0xf9d0('0x0'));var events=[_0xf9d0('0x1'),'remove',_0xf9d0('0x2')];function createListener(_0x5624c2,_0x112d45){return function(_0x176115){_0x112d45[_0xf9d0('0x3')](_0x5624c2,_0x176115);if(_0x5624c2===_0xf9d0('0x4')){_0x112d45[_0xf9d0('0x3')](_0xf9d0('0x5')+_0x176115[_0xf9d0('0x6')],_0x176115);}};}exports[_0xf9d0('0x7')]=function(_0x59f26f){for(var _0x2ee03b=0x0,_0x1cbb13=events[_0xf9d0('0x8')];_0x2ee03b<_0x1cbb13;_0x2ee03b++){var _0x19a779=events[_0x2ee03b];var _0x7c0b41=createListener(_0xf9d0('0x9')+_0x19a779,_0x59f26f);UserSettingEvents['on'](_0x19a779,_0x7c0b41);}}; \ No newline at end of file +var _0x76c8=['register','user-setting:','remove','update','emit','user-setting:update','user-setting:update:user-','UserId'];(function(_0x289dc2,_0x2a5810){var _0x527c0c=function(_0x471ab0){while(--_0x471ab0){_0x289dc2['push'](_0x289dc2['shift']());}};_0x527c0c(++_0x2a5810);}(_0x76c8,0x92));var _0x876c=function(_0x182a7e,_0x3edb53){_0x182a7e=_0x182a7e-0x0;var _0x4f468e=_0x76c8[_0x182a7e];return _0x4f468e;};'use strict';var UserSettingEvents=require('./user-setting.events');var events=['save',_0x876c('0x0'),_0x876c('0x1')];function createListener(_0x3b134e,_0x2ea8f8){return function(_0x214896){_0x2ea8f8[_0x876c('0x2')](_0x3b134e,_0x214896);if(_0x3b134e===_0x876c('0x3')){_0x2ea8f8['emit'](_0x876c('0x4')+_0x214896[_0x876c('0x5')],_0x214896);}};}exports[_0x876c('0x6')]=function(_0x33c1e9){for(var _0x993be=0x0,_0x2a1adb=events['length'];_0x993be<_0x2a1adb;_0x993be++){var _0xf3e8f=events[_0x993be];var _0x22ecb6=createListener(_0x876c('0x7')+_0xf3e8f,_0x33c1e9);UserSettingEvents['on'](_0xf3e8f,_0x22ecb6);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index d6d6704..227225f 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 _0x70af=['format','%s-%s','originalname','single','file','addAvatar','/:id/login','login','/:id/logout','logout','/:id/pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','addWhatsappInteractions','addFaxAccounts','/:id/mail_accounts','addMailAccounts','addOpenchannelAccounts','/:id/sms_accounts','addSmsAccounts','/:id/chat_websites','addChatWebsites','addWhatsappAccounts','createApiKey','put','update','changePassword','delete','removeTeams','destroy','removeChatInteractions','/:id/mail_interactions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeMailAccounts','/:id/openchannel_accounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeApiKey','/:id/messengerSoundNotification','messengerSoundNotification','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','index','/describe','describe','/whoami','whoami','/presence','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','/:id/screen_recordings','getScreenRecordings','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/sms/interactions','getSmsInteractions','getFaxInteractions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','getMailAccounts','getSmsAccounts','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/scheduled_calls','/:id/api_key','post','/:id/contacts','bulkCreate','addQueues','diskStorage','join'];(function(_0x3c23f2,_0x55c799){var _0xb4b444=function(_0x1c0337){while(--_0x1c0337){_0x3c23f2['push'](_0x3c23f2['shift']());}};_0xb4b444(++_0x55c799);}(_0x70af,0xa9));var _0xf70a=function(_0x3cad05,_0x27f01f){_0x3cad05=_0x3cad05-0x0;var _0x4a3897=_0x70af[_0x3cad05];return _0x4a3897;};'use strict';var multer=require(_0xf70a('0x0'));var util=require(_0xf70a('0x1'));var path=require(_0xf70a('0x2'));var timeout=require(_0xf70a('0x3'));var express=require(_0xf70a('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf70a('0x5'));var config=require(_0xf70a('0x6'));var controller=require(_0xf70a('0x7'));router[_0xf70a('0x8')]('/',auth[_0xf70a('0x9')](),controller[_0xf70a('0xa')]);router[_0xf70a('0x8')](_0xf70a('0xb'),auth[_0xf70a('0x9')](),controller[_0xf70a('0xc')]);router['get'](_0xf70a('0xd'),auth['isAuthenticated'](),controller[_0xf70a('0xe')]);router[_0xf70a('0x8')](_0xf70a('0xf'),auth[_0xf70a('0x9')](),controller['getPresence']);router[_0xf70a('0x8')](_0xf70a('0x10'),auth[_0xf70a('0x9')](),controller[_0xf70a('0x11')]);router[_0xf70a('0x8')](_0xf70a('0x12'),controller[_0xf70a('0x13')]);router[_0xf70a('0x8')](_0xf70a('0x14'),auth[_0xf70a('0x9')](),controller[_0xf70a('0x15')]);router[_0xf70a('0x8')]('/:id/contacts',auth[_0xf70a('0x9')](),controller[_0xf70a('0x16')]);router['get'](_0xf70a('0x17'),auth[_0xf70a('0x9')](),controller[_0xf70a('0x18')]);router['get'](_0xf70a('0x19'),auth[_0xf70a('0x9')](),controller[_0xf70a('0x1a')]);router[_0xf70a('0x8')](_0xf70a('0x1b'),auth['isAuthenticated'](),controller[_0xf70a('0x1c')]);router[_0xf70a('0x8')](_0xf70a('0x1d'),auth[_0xf70a('0x9')](),controller['getRecordings']);router['get'](_0xf70a('0x1e'),auth[_0xf70a('0x9')](),controller[_0xf70a('0x1f')]);router['get']('/:id/chat/interactions',auth[_0xf70a('0x9')](),controller['getChatInteractions']);router[_0xf70a('0x8')](_0xf70a('0x20'),auth[_0xf70a('0x9')](),controller[_0xf70a('0x21')]);router[_0xf70a('0x8')]('/:id/mail/interactions',auth['isAuthenticated'](),controller['getMailInteractions']);router['get'](_0xf70a('0x22'),auth[_0xf70a('0x9')](),controller[_0xf70a('0x23')]);router['get']('/:id/fax/interactions',auth[_0xf70a('0x9')](),controller[_0xf70a('0x24')]);router['get']('/:id/whatsapp/interactions',auth['isAuthenticated'](),controller[_0xf70a('0x25')]);router[_0xf70a('0x8')](_0xf70a('0x26'),auth[_0xf70a('0x9')](),controller[_0xf70a('0x27')]);router['get'](_0xf70a('0x28'),auth[_0xf70a('0x9')](),controller[_0xf70a('0x29')]);router[_0xf70a('0x8')](_0xf70a('0x2a'),auth[_0xf70a('0x9')](),controller[_0xf70a('0x2b')]);router['get'](_0xf70a('0x2c'),auth[_0xf70a('0x9')](),controller[_0xf70a('0x2d')]);router[_0xf70a('0x8')](_0xf70a('0x2e'),auth['isAuthenticated'](),controller[_0xf70a('0x2f')]);router[_0xf70a('0x8')]('/:id/mail_accounts',auth[_0xf70a('0x9')](),controller[_0xf70a('0x30')]);router[_0xf70a('0x8')]('/:id/openchannel_accounts',auth['isAuthenticated'](),controller['getOpenchannelAccounts']);router[_0xf70a('0x8')]('/:id/sms_accounts',auth[_0xf70a('0x9')](),controller[_0xf70a('0x31')]);router['get']('/:id/chat_websites',auth[_0xf70a('0x9')](),controller[_0xf70a('0x32')]);router['get'](_0xf70a('0x33'),auth[_0xf70a('0x9')](),controller[_0xf70a('0x34')]);router[_0xf70a('0x8')](_0xf70a('0x35'),auth[_0xf70a('0x9')](),controller['getScheduledCalls']);router['get'](_0xf70a('0x36'),auth[_0xf70a('0x9')](),controller['getApiKey']);router[_0xf70a('0x37')](_0xf70a('0x38'),auth[_0xf70a('0x9')](),controller['addContacts']);router[_0xf70a('0x37')]('/',auth[_0xf70a('0x9')](),controller['create']);router['post']('/create_many',auth['isAuthenticated'](),controller[_0xf70a('0x39')]);router[_0xf70a('0x37')](_0xf70a('0x17'),auth[_0xf70a('0x9')](),controller[_0xf70a('0x3a')]);var upload=multer({'storage':multer[_0xf70a('0x3b')]({'destination':function(_0x13ee4c,_0x54399d,_0x4e1bc3){_0x4e1bc3(null,path[_0xf70a('0x3c')](config['root'],'server/files/images/'));},'filename':function(_0x12989c,_0x2d75fc,_0x32bdbf){_0x32bdbf(null,util[_0xf70a('0x3d')](_0xf70a('0x3e'),Date['now'](),_0x2d75fc[_0xf70a('0x3f')]));}})});router[_0xf70a('0x37')]('/:id/avatar',upload[_0xf70a('0x40')](_0xf70a('0x41')),controller[_0xf70a('0x42')]);router['post'](_0xf70a('0x43'),auth[_0xf70a('0x9')](),controller[_0xf70a('0x44')]);router[_0xf70a('0x37')](_0xf70a('0x45'),auth[_0xf70a('0x9')](),controller[_0xf70a('0x46')]);router[_0xf70a('0x37')](_0xf70a('0x47'),auth[_0xf70a('0x9')](),controller['pause']);router[_0xf70a('0x37')](_0xf70a('0x48'),auth['isAuthenticated'](),controller[_0xf70a('0x49')]);router[_0xf70a('0x37')](_0xf70a('0x26'),auth[_0xf70a('0x9')](),controller[_0xf70a('0x4a')]);router[_0xf70a('0x37')](_0xf70a('0x4b'),auth[_0xf70a('0x9')](),controller['addChatInteractions']);router[_0xf70a('0x37')]('/:id/mail_interactions',auth['isAuthenticated'](),controller['addMailInteractions']);router['post'](_0xf70a('0x4c'),auth[_0xf70a('0x9')](),controller[_0xf70a('0x4d')]);router['post'](_0xf70a('0x4e'),auth['isAuthenticated'](),controller[_0xf70a('0x4f')]);router['post'](_0xf70a('0x50'),auth[_0xf70a('0x9')](),controller[_0xf70a('0x51')]);router[_0xf70a('0x37')]('/:id/whatsapp_interactions',auth[_0xf70a('0x9')](),controller[_0xf70a('0x52')]);router[_0xf70a('0x37')](_0xf70a('0x2e'),auth[_0xf70a('0x9')](),controller[_0xf70a('0x53')]);router[_0xf70a('0x37')](_0xf70a('0x54'),auth[_0xf70a('0x9')](),controller[_0xf70a('0x55')]);router[_0xf70a('0x37')]('/:id/openchannel_accounts',auth[_0xf70a('0x9')](),controller[_0xf70a('0x56')]);router['post'](_0xf70a('0x57'),auth[_0xf70a('0x9')](),controller[_0xf70a('0x58')]);router[_0xf70a('0x37')](_0xf70a('0x59'),auth[_0xf70a('0x9')](),controller[_0xf70a('0x5a')]);router[_0xf70a('0x37')]('/:id/whatsapp_accounts',auth[_0xf70a('0x9')](),controller[_0xf70a('0x5b')]);router['post'](_0xf70a('0x36'),auth[_0xf70a('0x9')](),controller[_0xf70a('0x5c')]);router[_0xf70a('0x5d')](_0xf70a('0x10'),auth[_0xf70a('0x9')](),controller[_0xf70a('0x5e')]);router[_0xf70a('0x5d')]('/:id/password',auth['isAuthenticated'](),controller[_0xf70a('0x5f')]);router[_0xf70a('0x60')](_0xf70a('0x17'),auth[_0xf70a('0x9')](),controller['removeQueues']);router[_0xf70a('0x60')](_0xf70a('0x26'),auth[_0xf70a('0x9')](),controller[_0xf70a('0x61')]);router['delete'](_0xf70a('0x10'),auth[_0xf70a('0x9')](),controller[_0xf70a('0x62')]);router[_0xf70a('0x60')]('/:id/chat_interactions',auth[_0xf70a('0x9')](),controller[_0xf70a('0x63')]);router[_0xf70a('0x60')](_0xf70a('0x64'),auth['isAuthenticated'](),controller[_0xf70a('0x65')]);router[_0xf70a('0x60')]('/:id/fax_interactions',auth[_0xf70a('0x9')](),controller[_0xf70a('0x66')]);router[_0xf70a('0x60')](_0xf70a('0x4e'),auth[_0xf70a('0x9')](),controller[_0xf70a('0x67')]);router[_0xf70a('0x60')](_0xf70a('0x50'),auth['isAuthenticated'](),controller[_0xf70a('0x68')]);router[_0xf70a('0x60')]('/:id/whatsapp_interactions',auth[_0xf70a('0x9')](),controller['removeWhatsappInteractions']);router[_0xf70a('0x60')]('/:id/fax_accounts',auth[_0xf70a('0x9')](),controller['removeFaxAccounts']);router['delete'](_0xf70a('0x54'),auth[_0xf70a('0x9')](),controller[_0xf70a('0x69')]);router[_0xf70a('0x60')](_0xf70a('0x6a'),auth[_0xf70a('0x9')](),controller[_0xf70a('0x6b')]);router[_0xf70a('0x60')](_0xf70a('0x57'),auth['isAuthenticated'](),controller[_0xf70a('0x6c')]);router[_0xf70a('0x60')](_0xf70a('0x59'),auth[_0xf70a('0x9')](),controller[_0xf70a('0x6d')]);router[_0xf70a('0x60')]('/:id/whatsapp_accounts',auth['isAuthenticated'](),controller[_0xf70a('0x6e')]);router[_0xf70a('0x60')](_0xf70a('0x36'),auth[_0xf70a('0x9')](),controller[_0xf70a('0x6f')]);router[_0xf70a('0x37')](_0xf70a('0x70'),auth[_0xf70a('0x9')](),controller[_0xf70a('0x71')]);module[_0xf70a('0x72')]=router; \ No newline at end of file +var _0x7647=['getFaxAccounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','getWhatsappAccounts','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','addContacts','create','post','/create_many','bulkCreate','diskStorage','join','root','server/files/images/','now','originalname','file','addAvatar','login','/:id/logout','logout','/:id/pause','pause','unpause','addTeams','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','addSmsInteractions','/:id/openchannel_interactions','addWhatsappInteractions','addFaxAccounts','/:id/mail_accounts','addOpenchannelAccounts','/:id/sms_accounts','addChatWebsites','/:id/whatsapp_accounts','addWhatsappAccounts','createApiKey','put','/:id','update','/:id/password','delete','removeQueues','removeTeams','destroy','removeMailInteractions','removeFaxInteractions','/:id/sms_interactions','removeSmsInteractions','removeOpenchannelInteractions','/:id/whatsapp_interactions','removeWhatsappInteractions','removeMailAccounts','removeOpenchannelAccounts','removeChatWebsites','removeApiKey','/:id/messengerSoundNotification','messengerSoundNotification','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','index','/describe','describe','whoami','/presence','getPresence','show','/:id/avatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','getChatInteractions','/:id/openchannel/interactions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','getFaxInteractions','getWhatsappInteractions','/:id/teams','getTeams','getLists','getAgents','getVoicePrefixes','/:id/fax_accounts'];(function(_0x310984,_0x52fa62){var _0x1fe48c=function(_0x14f63c){while(--_0x14f63c){_0x310984['push'](_0x310984['shift']());}};_0x1fe48c(++_0x52fa62);}(_0x7647,0x12d));var _0x7764=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x7647[_0x8c43de];return _0xa6591b;};'use strict';var multer=require(_0x7764('0x0'));var util=require(_0x7764('0x1'));var path=require(_0x7764('0x2'));var timeout=require(_0x7764('0x3'));var express=require(_0x7764('0x4'));var router=express[_0x7764('0x5')]();var fs_extra=require(_0x7764('0x6'));var auth=require(_0x7764('0x7'));var interaction=require(_0x7764('0x8'));var config=require(_0x7764('0x9'));var controller=require(_0x7764('0xa'));router[_0x7764('0xb')]('/',auth[_0x7764('0xc')](),controller[_0x7764('0xd')]);router[_0x7764('0xb')](_0x7764('0xe'),auth[_0x7764('0xc')](),controller[_0x7764('0xf')]);router[_0x7764('0xb')]('/whoami',auth[_0x7764('0xc')](),controller[_0x7764('0x10')]);router[_0x7764('0xb')](_0x7764('0x11'),auth[_0x7764('0xc')](),controller[_0x7764('0x12')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x7764('0x13')]);router[_0x7764('0xb')](_0x7764('0x14'),controller['getAvatar']);router['get'](_0x7764('0x15'),auth[_0x7764('0xc')](),controller[_0x7764('0x16')]);router['get'](_0x7764('0x17'),auth['isAuthenticated'](),controller[_0x7764('0x18')]);router[_0x7764('0xb')](_0x7764('0x19'),auth[_0x7764('0xc')](),controller[_0x7764('0x1a')]);router[_0x7764('0xb')](_0x7764('0x1b'),auth[_0x7764('0xc')](),controller[_0x7764('0x1c')]);router[_0x7764('0xb')]('/:id/groups',auth[_0x7764('0xc')](),controller['getGroups']);router[_0x7764('0xb')](_0x7764('0x1d'),auth[_0x7764('0xc')](),controller[_0x7764('0x1e')]);router['get'](_0x7764('0x1f'),auth['isAuthenticated'](),controller[_0x7764('0x20')]);router[_0x7764('0xb')]('/:id/chat/interactions',auth[_0x7764('0xc')](),controller[_0x7764('0x21')]);router[_0x7764('0xb')](_0x7764('0x22'),auth['isAuthenticated'](),controller['getOpenchannelInteractions']);router[_0x7764('0xb')](_0x7764('0x23'),auth['isAuthenticated'](),controller[_0x7764('0x24')]);router[_0x7764('0xb')](_0x7764('0x25'),auth[_0x7764('0xc')](),controller[_0x7764('0x26')]);router[_0x7764('0xb')]('/:id/fax/interactions',auth[_0x7764('0xc')](),controller[_0x7764('0x27')]);router[_0x7764('0xb')]('/:id/whatsapp/interactions',auth[_0x7764('0xc')](),controller[_0x7764('0x28')]);router[_0x7764('0xb')](_0x7764('0x29'),auth[_0x7764('0xc')](),controller[_0x7764('0x2a')]);router[_0x7764('0xb')]('/:id/lists',auth[_0x7764('0xc')](),controller[_0x7764('0x2b')]);router['get']('/:id/agents',auth['isAuthenticated'](),controller[_0x7764('0x2c')]);router[_0x7764('0xb')]('/:id/prefixes',auth[_0x7764('0xc')](),controller[_0x7764('0x2d')]);router[_0x7764('0xb')](_0x7764('0x2e'),auth[_0x7764('0xc')](),controller[_0x7764('0x2f')]);router['get']('/:id/mail_accounts',auth[_0x7764('0xc')](),controller[_0x7764('0x30')]);router[_0x7764('0xb')](_0x7764('0x31'),auth[_0x7764('0xc')](),controller[_0x7764('0x32')]);router['get']('/:id/sms_accounts',auth[_0x7764('0xc')](),controller[_0x7764('0x33')]);router[_0x7764('0xb')](_0x7764('0x34'),auth[_0x7764('0xc')](),controller[_0x7764('0x35')]);router[_0x7764('0xb')]('/:id/whatsapp_accounts',auth[_0x7764('0xc')](),controller[_0x7764('0x36')]);router[_0x7764('0xb')](_0x7764('0x37'),auth['isAuthenticated'](),controller[_0x7764('0x38')]);router[_0x7764('0xb')](_0x7764('0x39'),auth['isAuthenticated'](),controller[_0x7764('0x3a')]);router['post'](_0x7764('0x17'),auth[_0x7764('0xc')](),controller[_0x7764('0x3b')]);router['post']('/',auth[_0x7764('0xc')](),controller[_0x7764('0x3c')]);router[_0x7764('0x3d')](_0x7764('0x3e'),auth[_0x7764('0xc')](),controller[_0x7764('0x3f')]);router[_0x7764('0x3d')]('/:id/queues',auth[_0x7764('0xc')](),controller['addQueues']);var upload=multer({'storage':multer[_0x7764('0x40')]({'destination':function(_0x1ee9e8,_0xf5c701,_0x1c1735){_0x1c1735(null,path[_0x7764('0x41')](config[_0x7764('0x42')],_0x7764('0x43')));},'filename':function(_0x5d30ae,_0x20818c,_0x17844a){_0x17844a(null,util['format']('%s-%s',Date[_0x7764('0x44')](),_0x20818c[_0x7764('0x45')]));}})});router[_0x7764('0x3d')](_0x7764('0x14'),upload['single'](_0x7764('0x46')),controller[_0x7764('0x47')]);router[_0x7764('0x3d')]('/:id/login',auth[_0x7764('0xc')](),controller[_0x7764('0x48')]);router['post'](_0x7764('0x49'),auth[_0x7764('0xc')](),controller[_0x7764('0x4a')]);router['post'](_0x7764('0x4b'),auth[_0x7764('0xc')](),controller[_0x7764('0x4c')]);router[_0x7764('0x3d')]('/:id/unpause',auth[_0x7764('0xc')](),controller[_0x7764('0x4d')]);router[_0x7764('0x3d')]('/:id/teams',auth[_0x7764('0xc')](),controller[_0x7764('0x4e')]);router[_0x7764('0x3d')]('/:id/chat_interactions',auth['isAuthenticated'](),controller['addChatInteractions']);router[_0x7764('0x3d')](_0x7764('0x4f'),auth[_0x7764('0xc')](),controller[_0x7764('0x50')]);router['post'](_0x7764('0x51'),auth[_0x7764('0xc')](),controller[_0x7764('0x52')]);router[_0x7764('0x3d')]('/:id/sms_interactions',auth[_0x7764('0xc')](),controller[_0x7764('0x53')]);router['post'](_0x7764('0x54'),auth[_0x7764('0xc')](),controller['addOpenchannelInteractions']);router[_0x7764('0x3d')]('/:id/whatsapp_interactions',auth[_0x7764('0xc')](),controller[_0x7764('0x55')]);router[_0x7764('0x3d')](_0x7764('0x2e'),auth[_0x7764('0xc')](),controller[_0x7764('0x56')]);router[_0x7764('0x3d')](_0x7764('0x57'),auth[_0x7764('0xc')](),controller['addMailAccounts']);router['post'](_0x7764('0x31'),auth[_0x7764('0xc')](),controller[_0x7764('0x58')]);router[_0x7764('0x3d')](_0x7764('0x59'),auth[_0x7764('0xc')](),controller['addSmsAccounts']);router[_0x7764('0x3d')](_0x7764('0x34'),auth[_0x7764('0xc')](),controller[_0x7764('0x5a')]);router[_0x7764('0x3d')](_0x7764('0x5b'),auth[_0x7764('0xc')](),controller[_0x7764('0x5c')]);router['post']('/:id/api_key',auth[_0x7764('0xc')](),controller[_0x7764('0x5d')]);router[_0x7764('0x5e')](_0x7764('0x5f'),auth[_0x7764('0xc')](),controller[_0x7764('0x60')]);router[_0x7764('0x5e')](_0x7764('0x61'),auth['isAuthenticated'](),controller['changePassword']);router[_0x7764('0x62')](_0x7764('0x19'),auth['isAuthenticated'](),controller[_0x7764('0x63')]);router[_0x7764('0x62')](_0x7764('0x29'),auth[_0x7764('0xc')](),controller[_0x7764('0x64')]);router[_0x7764('0x62')](_0x7764('0x5f'),auth[_0x7764('0xc')](),controller[_0x7764('0x65')]);router[_0x7764('0x62')]('/:id/chat_interactions',auth[_0x7764('0xc')](),controller['removeChatInteractions']);router[_0x7764('0x62')](_0x7764('0x4f'),auth[_0x7764('0xc')](),controller[_0x7764('0x66')]);router['delete'](_0x7764('0x51'),auth['isAuthenticated'](),controller[_0x7764('0x67')]);router[_0x7764('0x62')](_0x7764('0x68'),auth['isAuthenticated'](),controller[_0x7764('0x69')]);router[_0x7764('0x62')](_0x7764('0x54'),auth[_0x7764('0xc')](),controller[_0x7764('0x6a')]);router[_0x7764('0x62')](_0x7764('0x6b'),auth['isAuthenticated'](),controller[_0x7764('0x6c')]);router['delete'](_0x7764('0x2e'),auth['isAuthenticated'](),controller['removeFaxAccounts']);router[_0x7764('0x62')]('/:id/mail_accounts',auth[_0x7764('0xc')](),controller[_0x7764('0x6d')]);router[_0x7764('0x62')](_0x7764('0x31'),auth[_0x7764('0xc')](),controller[_0x7764('0x6e')]);router[_0x7764('0x62')](_0x7764('0x59'),auth['isAuthenticated'](),controller['removeSmsAccounts']);router[_0x7764('0x62')](_0x7764('0x34'),auth[_0x7764('0xc')](),controller[_0x7764('0x6f')]);router[_0x7764('0x62')](_0x7764('0x5b'),auth[_0x7764('0xc')](),controller['removeWhatsappAccounts']);router['delete'](_0x7764('0x39'),auth[_0x7764('0xc')](),controller[_0x7764('0x70')]);router[_0x7764('0x3d')](_0x7764('0x71'),auth['isAuthenticated'](),controller[_0x7764('0x72')]);module[_0x7764('0x73')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index c14ec7a..dfdf311 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 _0x9062=['internal','email','toLowerCase','ENUM','admin','user','agent','telephone','INTEGER','accountcode','callerid','format','BOOLEAN','DATE','DEFAULT\x20PAUSE','dynamic','friend','peer','from-sip','ALLOWED_PASSED_SCREEN','PROHIB_NOT_SCREENED','PROHIB','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','inband','auto','nonat','update','outgoing','yes','force_rport,comedia','nat','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','always','accept','originate','uac','uas','fingerprint','certificate','active','passive','actpass','update,nonat','TEXT','showWebBar','get','isArray','udp','wss','encryption','avpf','force_avp','icesupport','dtlsenable','dtlsverify','dtlscertfile','rtcp_mux','dtlssetup','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','permissions','map','VIRTUAL','string','screenrecording','blocked','blockedAt','loginAttempts','UNSIGNED','sequelize','lodash','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','\x22%s\x22\x20<%s>','getDataValue'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x9062,0x1bc));var _0x2906=function(_0x1f5e34,_0x4ab2d8){_0x1f5e34=_0x1f5e34-0x0;var _0x47c734=_0x9062[_0x1f5e34];return _0x47c734;};'use strict';var Sequelize=require(_0x2906('0x0'));var moment=require('moment');var util=require('util');var _=require(_0x2906('0x1'));module[_0x2906('0x2')]={'name':{'type':Sequelize[_0x2906('0x3')],'allowNull':![],'unique':_0x2906('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0xe694e2){this[_0x2906('0x5')](_0x2906('0x4'),_0xe694e2);this['setDataValue'](_0x2906('0x6'),_0xe694e2);},'comment':_0x2906('0x7')},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x2d88ef){this['setDataValue'](_0x2906('0x8'),_0x2d88ef);this[_0x2906('0x5')]('callerid',util['format'](_0x2906('0x9'),_0x2d88ef,this[_0x2906('0xa')](_0x2906('0xb'))));}},'alias':{'type':Sequelize[_0x2906('0x3')]},'email':{'type':Sequelize[_0x2906('0x3')],'allowNull':![],'unique':_0x2906('0xc'),'validate':{'isEmail':!![]},'set':function(_0x5dfbec){if(_0x5dfbec){this[_0x2906('0x5')](_0x2906('0xc'),_0x5dfbec[_0x2906('0xd')]());}}},'role':{'type':Sequelize[_0x2906('0xe')](_0x2906('0xf'),_0x2906('0x10'),_0x2906('0x11'),_0x2906('0x12')),'allowNull':![]},'password':{'type':Sequelize[_0x2906('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':'local'},'internal':{'type':Sequelize[_0x2906('0x13')](0xb),'allowNull':![],'unique':_0x2906('0xb'),'set':function(_0x1d2cc8){this[_0x2906('0x5')]('internal',_0x1d2cc8);this[_0x2906('0x5')](_0x2906('0x14'),_0x1d2cc8);this[_0x2906('0x5')](_0x2906('0x15'),util[_0x2906('0x16')](_0x2906('0x9'),this['getDataValue'](_0x2906('0x8')),_0x1d2cc8));}},'salt':{'type':Sequelize[_0x2906('0x3')]},'phone':{'type':Sequelize[_0x2906('0x3')]},'mobile':{'type':Sequelize[_0x2906('0x3')]},'address':{'type':Sequelize[_0x2906('0x3')]},'zipcode':{'type':Sequelize[_0x2906('0x3')]},'userpic':{'type':Sequelize[_0x2906('0x3')]},'city':{'type':Sequelize[_0x2906('0x3')]},'country':{'type':Sequelize[_0x2906('0x3')]},'online':{'type':Sequelize[_0x2906('0x17')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x2906('0x18')]},'voicePause':{'type':Sequelize[_0x2906('0x17')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x2906('0x17')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x2906('0x17')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x2906('0x17')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x2906('0x17')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x2906('0x17')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x2906('0x3')],'defaultValue':_0x2906('0x19')},'lastPauseAt':{'type':Sequelize[_0x2906('0x18')]},'chatCapacity':{'type':Sequelize[_0x2906('0x13')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x2906('0x13')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x2906('0x13')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x2906('0x13')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x2906('0x13')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x2906('0x13')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x2906('0x13')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x2906('0x17')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x2906('0x13')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x2906('0x17')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x2906('0x17')],'defaultValue':![]},'description':{'type':Sequelize[_0x2906('0x3')],'allowNull':!![]},'host':{'type':Sequelize[_0x2906('0x3')],'allowNull':!![],'defaultValue':_0x2906('0x1a')},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize[_0x2906('0x13')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x2906('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x2906('0x3')],'allowNull':!![]},'useragent':{'type':Sequelize['STRING'],'allowNull':!![]},'lastms':{'type':Sequelize[_0x2906('0x13')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x2906('0xe')](_0x2906('0x1b'),_0x2906('0x10'),_0x2906('0x1c')),'allowNull':!![],'defaultValue':_0x2906('0x1b')},'context':{'type':Sequelize[_0x2906('0x3')],'allowNull':!![],'defaultValue':_0x2906('0x1d')},'callingpres':{'type':Sequelize['ENUM']('ALLOWED_NOT_SCREENED',_0x2906('0x1e'),'ALLOWED_FAILED_SCREEN','ALLOWED',_0x2906('0x1f'),'PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN',_0x2906('0x20')),'allowNull':!![]},'deny':{'type':Sequelize[_0x2906('0x3')],'allowNull':!![]},'permit':{'type':Sequelize[_0x2906('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x2906('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x2906('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x2906('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0x2906('0x3')],'allowNull':!![],'defaultValue':'udp','set':function(_0x1159d1){this[_0x2906('0x5')](_0x2906('0x21'),_0x1159d1?_0x1159d1['join'](','):null);},'get':function(){return this['getDataValue'](_0x2906('0x21'))?this[_0x2906('0xa')]('transport')[_0x2906('0x22')](','):null;},'comment':_0x2906('0x23')},'dtmfmode':{'type':Sequelize[_0x2906('0xe')](_0x2906('0x24'),_0x2906('0x25'),'shortinfo',_0x2906('0x26'),_0x2906('0x27')),'allowNull':!![],'defaultValue':_0x2906('0x24')},'directmedia':{'type':Sequelize['ENUM']('yes','no',_0x2906('0x28'),_0x2906('0x29'),_0x2906('0x2a')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x2906('0xe')](_0x2906('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x2906('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize['STRING'],'allowNull':!![]},'nat':{'type':Sequelize[_0x2906('0x3')],'allowNull':!![],'defaultValue':_0x2906('0x2c'),'set':function(_0x5a233a){this[_0x2906('0x5')](_0x2906('0x2d'),_0x5a233a?_0x5a233a[_0x2906('0x2e')](','):null);},'get':function(){return this['getDataValue'](_0x2906('0x2d'))?this[_0x2906('0xa')](_0x2906('0x2d'))['split'](','):null;},'comment':_0x2906('0x2f')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x2906('0x3')]},'namedpickupgroup':{'type':Sequelize[_0x2906('0x3')]},'language':{'type':Sequelize[_0x2906('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x2906('0x3')]},'disallow':{'type':Sequelize[_0x2906('0x3')],'allowNull':![],'defaultValue':_0x2906('0x30')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2906('0x31'),'set':function(_0x1770fe){this[_0x2906('0x5')](_0x2906('0x32'),_0x1770fe?_0x1770fe[_0x2906('0x2e')](';'):_0x2906('0x31'));},'get':function(){return this['getDataValue'](_0x2906('0x32'))?this[_0x2906('0xa')](_0x2906('0x32'))[_0x2906('0x22')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize[_0x2906('0xe')](_0x2906('0x2b'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize['STRING'],'allowNull':!![],'set':function(_0x1ecbfc){this[_0x2906('0x5')](_0x2906('0x33'),_0x1ecbfc?_0x1ecbfc['join'](','):null);},'get':function(){return this[_0x2906('0xa')]('insecure')?this['getDataValue']('insecure')[_0x2906('0x22')](','):null;},'comment':_0x2906('0x34')},'trustrpid':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x2906('0xe')](_0x2906('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x2906('0x2b'),'no',_0x2906('0x35')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x2906('0xe')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x2906('0xe')]('yes','no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x2906('0x13')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x2906('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x2906('0x3')],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x2906('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x2906('0xe')](_0x2906('0x2b'),'no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x2906('0x13')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x2906('0xe')](_0x2906('0x2b'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x2906('0xe')](_0x2906('0x2b'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x2906('0xe')](_0x2906('0x2b'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x2906('0xe')](_0x2906('0x2b'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize['STRING'],'allowNull':!![]},'template':{'type':Sequelize[_0x2906('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x2906('0xe')]('yes','no',_0x2906('0x36')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x2906('0x13')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x2906('0xe')]('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x2906('0xe')](_0x2906('0x37'),'refuse',_0x2906('0x38')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x2906('0x13')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x2906('0x13')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x2906('0xe')](_0x2906('0x39'),_0x2906('0x3a')),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize[_0x2906('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x2906('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x2906('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x2906('0xe')]('yes','no'),'allowNull':!![],'defaultValue':_0x2906('0x2b')},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x2906('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x2906('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x2906('0x13')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x2906('0x13')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x2906('0x13')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x2906('0xe')](_0x2906('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x2906('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x2906('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x2906('0x13')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x2906('0x13')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x2906('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x2906('0x3')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x2906('0x3')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x2906('0x13')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x2906('0xe')](_0x2906('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x2906('0xe')](_0x2906('0x2b'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x2906('0xe')](_0x2906('0x2b'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x2906('0xe')](_0x2906('0x2b'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x2906('0xe')](_0x2906('0x2b'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x2906('0xe')](_0x2906('0x2b'),'no',_0x2906('0x3b'),_0x2906('0x3c')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x2906('0x13')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x2906('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x2906('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x2906('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x2906('0xe')](_0x2906('0x3d'),_0x2906('0x3e'),_0x2906('0x3f')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x2906('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x2906('0xe')](_0x2906('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x2906('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x2906('0x13')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x2906('0xe')](_0x2906('0x2b'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize['ENUM'](_0x2906('0x2b'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x2906('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x2906('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x2906('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM'](_0x2906('0x2b'),'no',_0x2906('0x28'),_0x2906('0x29'),_0x2906('0x40')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x2906('0x17')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize[_0x2906('0x18')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x2906('0x41')]},'showWebBar':{'type':Sequelize[_0x2906('0x13')],'defaultValue':0x0,'set':function(_0xa803ab){this[_0x2906('0x5')](_0x2906('0x42'),_0xa803ab);var _0x6d3c17=this[_0x2906('0x43')]({'plain':!![]});switch(_0xa803ab){case 0x0:case 0x1:var _0x13dd9e=_0x6d3c17[_0x2906('0x21')]?_[_0x2906('0x44')](_0x6d3c17['transport'])?_0x6d3c17[_0x2906('0x21')][_0x2906('0x2e')]():_0x6d3c17[_0x2906('0x21')]:_0x2906('0x45');if(_0x13dd9e===_0x2906('0x46')){_0x13dd9e=_0x2906('0x45');}this[_0x2906('0x5')]('transport',_0x13dd9e);this[_0x2906('0x5')](_0x2906('0x47'),'no');this['setDataValue'](_0x2906('0x48'),null);this[_0x2906('0x5')](_0x2906('0x49'),null);this[_0x2906('0x5')](_0x2906('0x4a'),null);this['setDataValue'](_0x2906('0x4b'),null);this[_0x2906('0x5')](_0x2906('0x4c'),null);this['setDataValue']('dtlssetup',null);this[_0x2906('0x5')](_0x2906('0x4d'),null);this[_0x2906('0x5')]('dtlsprivatekey',null);this[_0x2906('0x5')](_0x2906('0x4e'),'no');break;case 0x2:this[_0x2906('0x5')](_0x2906('0x21'),_0x2906('0x46'));this[_0x2906('0x5')]('encryption',_0x2906('0x2b'));this['setDataValue']('avpf',_0x2906('0x2b'));this['setDataValue'](_0x2906('0x49'),_0x2906('0x2b'));this['setDataValue']('icesupport','yes');this[_0x2906('0x5')]('dtlsenable',_0x2906('0x2b'));this[_0x2906('0x5')]('dtlsverify','no');this[_0x2906('0x5')](_0x2906('0x4f'),_0x2906('0x3f'));this[_0x2906('0x5')](_0x2906('0x4d'),_0x6d3c17['dtlscertfile']||_0x2906('0x50'));this[_0x2906('0x5')](_0x2906('0x51'),_0x6d3c17[_0x2906('0x51')]||'/etc/pki/tls/private/motion.key');this['setDataValue']('rtcp_mux',_0x2906('0x2b'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x346889){this[_0x2906('0x5')](_0x2906('0x52'),_0x346889?_0x346889[_0x2906('0x2e')](','):[]);},'get':function(){return this[_0x2906('0xa')](_0x2906('0x52'))?_[_0x2906('0x53')](this[_0x2906('0xa')](_0x2906('0x52'))[_0x2906('0x22')](','),function(_0x1a3ca7){return parseInt(_0x1a3ca7,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x2906('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x2906('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x2906('0x3')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x2906('0x17')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x2906('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x2906('0x17')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x2906('0x17')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x2906('0x17')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x2906('0x13')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x2906('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x2906('0x13')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x2906('0xe')]('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x2906('0x17')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x2906('0x3')]},'phoneBarEnableJaws':{'type':Sequelize[_0x2906('0x17')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x2906('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x2906('0x54')],'get':function(){return this['getDataValue']('phoneBarEnableScreenRecordingByAgent')?this['getDataValue']('phoneBarEnableScreenRecordingByAgent'):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x2906('0x17')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x2906('0x17')],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0x2906('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x2906('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x2906('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x2906('0x17')],'defaultValue':![],'set':function(_0x2a73f5){if(typeof _0x2a73f5===_0x2906('0x55')){var _0x23a3b0=_0x2a73f5==='1'?!![]:_0x2a73f5==='0'?![]:_0x2a73f5==='true'?!![]:_0x2a73f5==='false'?![]:![];this[_0x2906('0x5')](_0x2906('0x56'),_0x23a3b0);}else{this[_0x2906('0x5')]('screenrecording',_0x2a73f5);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x56a8f1){this[_0x2906('0x5')](_0x2906('0x57'),_0x56a8f1);if(_0x56a8f1===!![]){this[_0x2906('0x5')](_0x2906('0x58'),moment());this['setDataValue'](_0x2906('0x59'),0x0);}else{this[_0x2906('0x5')](_0x2906('0x58'),null);}}},'blockedAt':{'type':Sequelize[_0x2906('0x18')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x2906('0x13')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x2906('0x17')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x2906('0x17')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x2906('0x13')](0x5)[_0x2906('0x5a')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x2906('0x17')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x2906('0x17')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x2906('0x17')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x2906('0x17')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x2906('0x17')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x2906('0x17')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x2906('0x13')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x2906('0x17')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x2906('0x13')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x2906('0x17')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x2906('0x13')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x2906('0x17')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x2906('0x17')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x2906('0x13')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x2906('0x17')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'messengerSoundNotification':{'type':Sequelize[_0x2906('0x17')],'defaultValue':![]}}; \ No newline at end of file +var _0x6917=['admin','user','local','INTEGER','accountcode','getDataValue','BOOLEAN','DATE','dynamic','friend','from-sip','ENUM','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','udp','transport','join','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','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]','never','accept','refuse','originate','uac','uas','certificate','passive','actpass','update,nonat','showWebBar','get','isArray','encryption','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlsprivatekey','wss','avpf','force_avp','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','rtcp_mux','permissions','map','phoneBarEnableScreenRecordingByAgent','true','screenrecording','blocked','blockedAt','loginAttempts','sequelize','moment','lodash','STRING','name','defaultuser','The\x20name\x20of\x20the\x20user','setDataValue','fullname','callerid','format','\x22%s\x22\x20<%s>','internal','email','toLowerCase'];(function(_0x539f6a,_0x5b46ae){var _0x3cff26=function(_0x344632){while(--_0x344632){_0x539f6a['push'](_0x539f6a['shift']());}};_0x3cff26(++_0x5b46ae);}(_0x6917,0xf3));var _0x7691=function(_0x46361e,_0x243aaf){_0x46361e=_0x46361e-0x0;var _0x14e302=_0x6917[_0x46361e];return _0x14e302;};'use strict';var Sequelize=require(_0x7691('0x0'));var moment=require(_0x7691('0x1'));var util=require('util');var _=require(_0x7691('0x2'));module['exports']={'name':{'type':Sequelize[_0x7691('0x3')],'allowNull':![],'unique':_0x7691('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x122667){this['setDataValue'](_0x7691('0x4'),_0x122667);this['setDataValue'](_0x7691('0x5'),_0x122667);},'comment':_0x7691('0x6')},'fullname':{'type':Sequelize[_0x7691('0x3')],'allowNull':![],'set':function(_0xc40c24){this[_0x7691('0x7')](_0x7691('0x8'),_0xc40c24);this[_0x7691('0x7')](_0x7691('0x9'),util[_0x7691('0xa')](_0x7691('0xb'),_0xc40c24,this['getDataValue'](_0x7691('0xc'))));}},'alias':{'type':Sequelize[_0x7691('0x3')]},'email':{'type':Sequelize[_0x7691('0x3')],'allowNull':![],'unique':_0x7691('0xd'),'validate':{'isEmail':!![]},'set':function(_0x4cfb49){if(_0x4cfb49){this[_0x7691('0x7')](_0x7691('0xd'),_0x4cfb49[_0x7691('0xe')]());}}},'role':{'type':Sequelize['ENUM'](_0x7691('0xf'),_0x7691('0x10'),'agent','telephone'),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x7691('0x3')],'defaultValue':_0x7691('0x11')},'internal':{'type':Sequelize[_0x7691('0x12')](0xb),'allowNull':![],'unique':_0x7691('0xc'),'set':function(_0x6e72fa){this['setDataValue'](_0x7691('0xc'),_0x6e72fa);this['setDataValue'](_0x7691('0x13'),_0x6e72fa);this[_0x7691('0x7')]('callerid',util['format'](_0x7691('0xb'),this[_0x7691('0x14')](_0x7691('0x8')),_0x6e72fa));}},'salt':{'type':Sequelize[_0x7691('0x3')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x7691('0x3')]},'address':{'type':Sequelize[_0x7691('0x3')]},'zipcode':{'type':Sequelize[_0x7691('0x3')]},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x7691('0x3')]},'country':{'type':Sequelize[_0x7691('0x3')]},'online':{'type':Sequelize[_0x7691('0x15')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x7691('0x16')]},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x7691('0x15')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x7691('0x15')],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x7691('0x15')],'defaultValue':![]},'whatsappPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x7691('0x15')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x7691('0x3')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0x7691('0x16')]},'chatCapacity':{'type':Sequelize[_0x7691('0x12')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x7691('0x12')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x7691('0x12')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x7691('0x12')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x7691('0x12')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x7691('0x12')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x7691('0x15')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x7691('0x15')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x7691('0x15')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x7691('0x15')],'defaultValue':![]},'description':{'type':Sequelize[_0x7691('0x3')],'allowNull':!![]},'host':{'type':Sequelize[_0x7691('0x3')],'allowNull':!![],'defaultValue':_0x7691('0x17')},'ipaddr':{'type':Sequelize[_0x7691('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0x7691('0x12')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x7691('0x12')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x7691('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x7691('0x3')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x7691('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x7691('0x12')](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM'](_0x7691('0x18'),_0x7691('0x10'),'peer'),'allowNull':!![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x7691('0x3')],'allowNull':!![],'defaultValue':_0x7691('0x19')},'callingpres':{'type':Sequelize[_0x7691('0x1a')]('ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN',_0x7691('0x1b'),_0x7691('0x1c'),_0x7691('0x1d'),_0x7691('0x1e'),'PROHIB_FAILED_SCREEN','PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0x7691('0x3')],'allowNull':!![]},'permit':{'type':Sequelize[_0x7691('0x3')],'allowNull':!![]},'secret':{'type':Sequelize['STRING'],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x7691('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x7691('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0x7691('0x3')],'allowNull':!![],'defaultValue':_0x7691('0x1f'),'set':function(_0x24d080){this[_0x7691('0x7')](_0x7691('0x20'),_0x24d080?_0x24d080[_0x7691('0x21')](','):null);},'get':function(){return this[_0x7691('0x14')](_0x7691('0x20'))?this[_0x7691('0x14')](_0x7691('0x20'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x7691('0x1a')](_0x7691('0x22'),_0x7691('0x23'),_0x7691('0x24'),_0x7691('0x25'),_0x7691('0x26')),'allowNull':!![],'defaultValue':_0x7691('0x22')},'directmedia':{'type':Sequelize['ENUM'](_0x7691('0x27'),'no',_0x7691('0x28'),_0x7691('0x29'),_0x7691('0x2a')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0x7691('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x7691('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x7691('0x3')],'allowNull':!![]},'nat':{'type':Sequelize[_0x7691('0x3')],'allowNull':!![],'defaultValue':_0x7691('0x2b'),'set':function(_0x2e4bfb){this[_0x7691('0x7')](_0x7691('0x2c'),_0x2e4bfb?_0x2e4bfb[_0x7691('0x21')](','):null);},'get':function(){return this['getDataValue'](_0x7691('0x2c'))?this[_0x7691('0x14')](_0x7691('0x2c'))[_0x7691('0x2d')](','):null;},'comment':_0x7691('0x2e')},'callgroup':{'type':Sequelize[_0x7691('0x3')]},'namedcallgroup':{'type':Sequelize[_0x7691('0x3')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x7691('0x3')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x7691('0x3')]},'disallow':{'type':Sequelize[_0x7691('0x3')],'allowNull':![],'defaultValue':_0x7691('0x2f')},'allow':{'type':Sequelize[_0x7691('0x3')],'allowNull':![],'defaultValue':_0x7691('0x30'),'set':function(_0x3b45ff){this['setDataValue'](_0x7691('0x31'),_0x3b45ff?_0x3b45ff[_0x7691('0x21')](';'):_0x7691('0x30'));},'get':function(){return this[_0x7691('0x14')](_0x7691('0x31'))?this[_0x7691('0x14')]('allow')[_0x7691('0x2d')](';'):null;},'comment':_0x7691('0x32')},'autoframing':{'type':Sequelize[_0x7691('0x1a')](_0x7691('0x27'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x7691('0x3')],'allowNull':!![],'set':function(_0x3fb717){this[_0x7691('0x7')](_0x7691('0x33'),_0x3fb717?_0x3fb717[_0x7691('0x21')](','):null);},'get':function(){return this['getDataValue'](_0x7691('0x33'))?this[_0x7691('0x14')](_0x7691('0x33'))[_0x7691('0x2d')](','):null;},'comment':_0x7691('0x34')},'trustrpid':{'type':Sequelize[_0x7691('0x1a')](_0x7691('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x7691('0x1a')](_0x7691('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x7691('0x1a')](_0x7691('0x27'),'no',_0x7691('0x35')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x7691('0x1a')](_0x7691('0x27'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x7691('0x1a')](_0x7691('0x27'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x7691('0x12')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x7691('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x7691('0x3')],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM'](_0x7691('0x27'),'no'),'allowNull':!![],'defaultValue':_0x7691('0x27')},'busylevel':{'type':Sequelize[_0x7691('0x12')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x7691('0x1a')]('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x7691('0x27'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize['ENUM'](_0x7691('0x27'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x7691('0x1a')](_0x7691('0x27'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize['STRING'],'allowNull':!![]},'template':{'type':Sequelize[_0x7691('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x7691('0x1a')](_0x7691('0x27'),'no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x7691('0x12')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x7691('0x1a')](_0x7691('0x27'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x7691('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0x7691('0x36'),_0x7691('0x37'),_0x7691('0x38')),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize['ENUM'](_0x7691('0x39'),_0x7691('0x3a')),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize['STRING'],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x7691('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x7691('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x7691('0x1a')]('yes','no'),'allowNull':!![],'defaultValue':_0x7691('0x27')},'keepalive':{'type':Sequelize[_0x7691('0x12')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x7691('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x7691('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x7691('0x12')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x7691('0x1a')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x7691('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x7691('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x7691('0x12')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x7691('0x12')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x7691('0x12')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x7691('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x7691('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x7691('0x3')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x7691('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x7691('0x3')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x7691('0x12')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x7691('0x1a')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x7691('0x27'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x7691('0x1a')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x7691('0x1a')](_0x7691('0x27'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x7691('0x27'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM']('yes','no','fingerprint',_0x7691('0x3b')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x7691('0x12')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x7691('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x7691('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x7691('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x7691('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x7691('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x7691('0x1a')]('active',_0x7691('0x3c'),_0x7691('0x3d')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x7691('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x7691('0x1a')](_0x7691('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x7691('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x7691('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x7691('0x12')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x7691('0x1a')]('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x7691('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize['STRING'],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x7691('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x7691('0x1a')](_0x7691('0x27'),'no',_0x7691('0x28'),_0x7691('0x29'),_0x7691('0x3e')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x7691('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x7691('0x3')]},'resetPasswordExpires':{'type':Sequelize[_0x7691('0x16')]},'passwordResetAt':{'type':Sequelize[_0x7691('0x16')],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize[_0x7691('0x12')],'defaultValue':0x0,'set':function(_0x14ed3f){this[_0x7691('0x7')](_0x7691('0x3f'),_0x14ed3f);var _0x374bd9=this[_0x7691('0x40')]({'plain':!![]});switch(_0x14ed3f){case 0x0:case 0x1:var _0x464b8a=_0x374bd9[_0x7691('0x20')]?_[_0x7691('0x41')](_0x374bd9[_0x7691('0x20')])?_0x374bd9['transport']['join']():_0x374bd9[_0x7691('0x20')]:'udp';if(_0x464b8a==='wss'){_0x464b8a=_0x7691('0x1f');}this[_0x7691('0x7')](_0x7691('0x20'),_0x464b8a);this[_0x7691('0x7')](_0x7691('0x42'),'no');this[_0x7691('0x7')]('avpf',null);this[_0x7691('0x7')]('force_avp',null);this[_0x7691('0x7')](_0x7691('0x43'),null);this[_0x7691('0x7')](_0x7691('0x44'),null);this[_0x7691('0x7')](_0x7691('0x45'),null);this['setDataValue'](_0x7691('0x46'),null);this[_0x7691('0x7')]('dtlscertfile',null);this[_0x7691('0x7')](_0x7691('0x47'),null);this[_0x7691('0x7')]('rtcp_mux','no');break;case 0x2:this['setDataValue']('transport',_0x7691('0x48'));this['setDataValue'](_0x7691('0x42'),_0x7691('0x27'));this[_0x7691('0x7')](_0x7691('0x49'),_0x7691('0x27'));this[_0x7691('0x7')](_0x7691('0x4a'),_0x7691('0x27'));this['setDataValue'](_0x7691('0x43'),_0x7691('0x27'));this['setDataValue'](_0x7691('0x44'),'yes');this[_0x7691('0x7')](_0x7691('0x45'),'no');this[_0x7691('0x7')]('dtlssetup','actpass');this[_0x7691('0x7')]('dtlscertfile',_0x374bd9['dtlscertfile']||_0x7691('0x4b'));this[_0x7691('0x7')](_0x7691('0x47'),_0x374bd9[_0x7691('0x47')]||_0x7691('0x4c'));this[_0x7691('0x7')](_0x7691('0x4d'),_0x7691('0x27'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x15b8a7){this[_0x7691('0x7')](_0x7691('0x4e'),_0x15b8a7?_0x15b8a7[_0x7691('0x21')](','):[]);},'get':function(){return this['getDataValue']('permissions')?_[_0x7691('0x4f')](this[_0x7691('0x14')](_0x7691('0x4e'))[_0x7691('0x2d')](','),function(_0x1b47e2){return parseInt(_0x1b47e2,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize[_0x7691('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x7691('0x15')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x7691('0x15')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x7691('0x15')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x7691('0x15')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x7691('0x15')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x7691('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x7691('0x12')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x7691('0x15')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x7691('0x3')]},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x7691('0x15')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x7691('0x14')]('phoneBarEnableScreenRecordingByAgent')?this['getDataValue'](_0x7691('0x50')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x7691('0x15')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x7691('0x15')],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0x7691('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x7691('0x15')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x7691('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x7691('0x15')],'defaultValue':![],'set':function(_0x3b53fd){if(typeof _0x3b53fd==='string'){var _0x42d5f5=_0x3b53fd==='1'?!![]:_0x3b53fd==='0'?![]:_0x3b53fd===_0x7691('0x51')?!![]:_0x3b53fd==='false'?![]:![];this[_0x7691('0x7')]('screenrecording',_0x42d5f5);}else{this['setDataValue'](_0x7691('0x52'),_0x3b53fd);}}},'blocked':{'type':Sequelize[_0x7691('0x15')],'defaultValue':![],'set':function(_0x1e71c2){this[_0x7691('0x7')](_0x7691('0x53'),_0x1e71c2);if(_0x1e71c2===!![]){this['setDataValue'](_0x7691('0x54'),moment());this[_0x7691('0x7')](_0x7691('0x55'),0x0);}else{this[_0x7691('0x7')](_0x7691('0x54'),null);}}},'blockedAt':{'type':Sequelize[_0x7691('0x16')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x7691('0x12')](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x7691('0x15')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x7691('0x15')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x7691('0x15')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x7691('0x15')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x7691('0x15')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x7691('0x12')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x7691('0x12')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x7691('0x15')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x7691('0x12')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x7691('0x15')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x7691('0x15')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'messengerSoundNotification':{'type':Sequelize[_0x7691('0x15')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 9bcfe3a..47889ab 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 _0x2501=['pick','Unknown\x20role','getVoiceQueuesRt','keys','getGroups','ChatGroup','nolimit','getRecordings','VoiceRecording','UserId','getScreenRecordings','ScreenRecording','getChatInteractions','ChatInteraction','getOpenchannelInteractions','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','FaxInteraction','getWhatsappInteractions','WhatsappInteraction','login','phone','mobile','loginInPause','LOCAL/%s@from-sip/n','SIP/%s','intrf','user:%s','user:forcelogout','headers','x-forwarded-for','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','MemberReport','forEach','getChannels','YYYY-MM-DD\x20HH:mm:ss','LOGIN','device','LOGININPAUSE','isMiddleware','logout','pause','PAUSE','updateAttributes','DEFAULT\x20PAUSE','unpause','Channel\x20parameter\x20%s\x20is\x20invalid','mailPause','openchannelPause','pauseType','lastPauseAt','getTeams','Team','addTeams','resolve','transaction','getAssociatedQueues','flattenDeep','addAgent','Voice','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','getDataValue','removeTeams','Query\x20parameter\x20\x27ids\x27\x20is\x20required','Queue:remove','getLists','values','You\x20can\x27t\x20delete\x20yourself','CmHopper','addChatInteractions','user_has_chat_interactions:save','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','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','removeWhatsappInteractions','getVoicePrefixes','getFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','addChatWebsites','removeChatWebsites','WhatsappAccount','getWhatsappAccounts','addWhatsappAccounts','removeWhatsappAccounts','getScheduledCalls','$and','$or','$gt','$gte','$lt','$ne','$eq','$not','$notBetween','$in','$like','$notLike','$notILike','$overlap','$any','firstName','Contact','VoiceQueue','getApiKey','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','generateApiKey','nonce','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','Unable\x20to\x20retrieve\x20the\x20current\x20user','getPresence','idle','unknown','queues','getAgents','toString','col','asc','substring','uniqBy','orderBy','getRealtimeAgents','offline','voiceStatus','busy','slice','toUpperCase','field','ui.','InteractionId','ui.createdAt','user_has_','_interactions','OpenTabs','messengerSoundNotification','enabled','moment','lodash','squel','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/license/util','../../errors/api','APIBadRequestError','APINotFoundError','handleError','../../mysqldb','socket.io-emitter','redis','./user.socket','register','defaults','sendStatus','status','json','offset','undefined','limit','count','set','update','then','role','emit','userNotification:recalc:','destroy','get','Agents','agent','Telephones','filter','ignore','map','value','includes','find','UserProfileResource','end','error','send','rawAttributes','fieldName','type','key','password','salt','previousPasswords','resetPasswordToken','resetPasswordExpires','md5secret','name','index','where','User','query','includeAll','userSetting','true','UserSetting','attributes','push','openTabs','rows','length','dataValues','mail','openchannel','whatsapp','all','catch','show','getOptions','include','merge','options','chat','sms','body','params','describe','addContacts','omit','ids','internal','findById','validatePasswordPattern','max','min_internal','sequelize','QueryTypes','SELECT','isNil','from','voicemail','mailbox','VoiceMail','fullname','email','permissions','101','102','103','105','107','108','109','111','create','user','Unauthorized','admin','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','checkUserLimits','settingsEnabled','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','telephone','UserProfileSection','findAll','isEmpty','compact','changePassword','oldPassword','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','Sequelize','Wrong\x20credentials','newPassword','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Setting','securePassword','enforcePasswordHistory','validatePasswordHistory','passwordHistoryLimit','updatePasswordsHistory','addQueues','channel','online','voicePause','interface','isValidChannel','Unknown\x20channel','add','capitalize','toLowerCase','Queues','spread','QueueId','Queue:save','voice','format','penalty','UserVoiceQueueRt','upsert','removeQueues','remove','isArray','file','filename','getAvatar','join','server/files/images/logos/default_profile.png','userpic','download','existsSync','root','server/files/images/','fax','createdAt','FaxOpenTabs','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','concat','findOne','User\x20with\x20id\x20%s\x20not\x20found','hasOwnProperty','CmList','List','Tag','Tags','tag','getQueues','Queue','filters','intersection','model','fields','order','sort'];(function(_0x3e44e8,_0xf37c9b){var _0xe928ee=function(_0x508852){while(--_0x508852){_0x3e44e8['push'](_0x3e44e8['shift']());}};_0xe928ee(++_0xf37c9b);}(_0x2501,0xae));var _0x1250=function(_0x4d86e8,_0x10594a){_0x4d86e8=_0x4d86e8-0x0;var _0x535054=_0x2501[_0x4d86e8];return _0x535054;};'use strict';var moment=require(_0x1250('0x0'));var util=require('util');var path=require('path');var fs=require('fs');var _=require(_0x1250('0x1'));var squel=require(_0x1250('0x2'));var Redis=require(_0x1250('0x3'));var authService=require(_0x1250('0x4'));var contacts=require('../../components/contacts');var qs=require('../../components/parsers/qs');var rta=require('../../components/realtime/agents');var logger=require(_0x1250('0x5'))(_0x1250('0x6'));var utils=require(_0x1250('0x7'));var config=require('../../config/environment');var licenseUtil=require(_0x1250('0x8'));var APIBadRequestError=require(_0x1250('0x9'))[_0x1250('0xa')];var APINotFoundError=require(_0x1250('0x9'))[_0x1250('0xb')];var APIForbiddenError=require(_0x1250('0x9'))['APIForbiddenrror'];var APIHandleError=require(_0x1250('0x9'))[_0x1250('0xc')];var db=require(_0x1250('0xd'))['db'];var socket=require(_0x1250('0xe'))(new Redis(config[_0x1250('0xf')]));require(_0x1250('0x10'))[_0x1250('0x11')](socket);config[_0x1250('0xf')]=_[_0x1250('0x12')](config['redis'],{'host':'localhost','port':0x18eb});var values;function respondWithStatusCode(_0x22891e,_0x2d6f4b){_0x2d6f4b=_0x2d6f4b||0xcc;return function(_0x307e4a){if(_0x307e4a){return _0x22891e[_0x1250('0x13')](_0x2d6f4b);}return _0x22891e['status'](_0x2d6f4b)['end']();};}function respondWithResult(_0x57f618,_0x1dcce0){_0x1dcce0=_0x1dcce0||0xc8;return function(_0x39e4cb){if(_0x39e4cb){return _0x57f618[_0x1250('0x14')](_0x1dcce0)[_0x1250('0x15')](_0x39e4cb);}};}function respondWithFilteredResult(_0x411b30,_0xb86f3a){return function(_0x51d821){if(_0x51d821){var _0x15facc=typeof _0xb86f3a[_0x1250('0x16')]===_0x1250('0x17')&&typeof _0xb86f3a[_0x1250('0x18')]===_0x1250('0x17');var _0x319421=_0x51d821[_0x1250('0x19')];var _0x32cd7b=_0x15facc?0x0:_0xb86f3a['offset'];var _0x15b369=_0x15facc?_0x51d821[_0x1250('0x19')]:_0xb86f3a[_0x1250('0x16')]+_0xb86f3a[_0x1250('0x18')];var _0x3e80b3;if(_0x15b369>=_0x319421){_0x15b369=_0x319421;_0x3e80b3=0xc8;}else{_0x3e80b3=0xce;}_0x411b30['status'](_0x3e80b3);return _0x411b30[_0x1250('0x1a')]('Content-Range',_0x32cd7b+'-'+_0x15b369+'/'+_0x319421)['json'](_0x51d821);}return null;};}function saveUpdates(_0xa0286c){return function(_0x5c34fb){if(_0x5c34fb){return _0x5c34fb[_0x1250('0x1b')](_0xa0286c)[_0x1250('0x1c')](function(_0x465730){if(_0x465730[_0x1250('0x1d')]==='agent'){socket[_0x1250('0x1e')](_0x1250('0x1f')+_0x465730['id'],_0x465730);}return _0x465730;});}return null;};}function removeEntity(_0x1eca50,_0x347798){return function(_0x2e37c0){if(_0x2e37c0){return _0x2e37c0[_0x1250('0x20')]({'transaction':_0x347798})[_0x1250('0x1c')](function(){var _0xbcd010=_0x2e37c0[_0x1250('0x21')]({'plain':!![]});if(_0xbcd010['role']==='admin')return;var _0xa9c90=[{'name':'Users','value':'user','ignore':!![]},{'name':_0x1250('0x22'),'value':_0x1250('0x23'),'ignore':![]},{'name':_0x1250('0x24'),'value':'telephone','ignore':![]}];var _0x1fec62=_(_0xa9c90)[_0x1250('0x25')](_0x1250('0x26'))[_0x1250('0x27')](_0x1250('0x28'))['value']();if(_[_0x1250('0x29')](_0x1fec62,_0xbcd010[_0x1250('0x1d')])){return;}var _0x41d5f6=_[_0x1250('0x2a')](_0xa9c90,[_0x1250('0x28'),_0xbcd010[_0x1250('0x1d')]])['name'];return db[_0x1250('0x2b')][_0x1250('0x20')]({'where':{'type':_0x41d5f6,'resourceId':_0xbcd010['id']},'transaction':_0x347798})[_0x1250('0x1c')](function(){return _0x2e37c0;});})[_0x1250('0x1c')](function(){_0x1eca50[_0x1250('0x14')](0xcc)[_0x1250('0x2c')]();});}};}function handleEntityNotFound(_0x50fdcd){return function(_0x1ddb40){if(!_0x1ddb40){_0x50fdcd['sendStatus'](0x194);}return _0x1ddb40;};}function handleError(_0x466c51,_0x24a006){_0x24a006=_0x24a006||0x1f4;return function(_0x362012){logger[_0x1250('0x2d')](_0x362012['stack']);if(_0x362012['name']){delete _0x362012['name'];}_0x466c51[_0x1250('0x14')](_0x24a006)[_0x1250('0x2e')](_0x362012);};}function getUserAttributes(){return _(db['User'][_0x1250('0x2f')])[_0x1250('0x27')](function(_0x2844a9){return{'name':_0x2844a9[_0x1250('0x30')],'type':_0x2844a9[_0x1250('0x31')][_0x1250('0x32')]};})[_0x1250('0x25')](function(_0x2a3719){return![_0x1250('0x33'),_0x1250('0x34'),_0x1250('0x35'),_0x1250('0x36'),_0x1250('0x37'),_0x1250('0x38')][_0x1250('0x29')](_0x2a3719[_0x1250('0x39')]);})[_0x1250('0x28')]();}exports[_0x1250('0x3a')]=function(_0x18a63c,_0x1d649b){var _0x426f5d={},_0x34668e={'count':0x0,'rows':[]};var _0x4f5081=getUserAttributes();_0x426f5d=qs['getOptions'](_0x4f5081,_0x18a63c);var _0x26d03b={'where':_0x426f5d[_0x1250('0x3b')]};return db[_0x1250('0x3c')][_0x1250('0x19')](_0x26d03b)['then'](function(_0x2ec900){_0x34668e['count']=_0x2ec900;if(_0x18a63c[_0x1250('0x3d')][_0x1250('0x3e')]){_0x426f5d['include']=[{'all':!![]}];}if(_0x18a63c[_0x1250('0x3d')][_0x1250('0x3f')]===_0x1250('0x40')){_0x426f5d['include']=[{'model':db[_0x1250('0x41')],'as':_0x1250('0x3f')}];}if(!_[_0x1250('0x29')](_0x426f5d[_0x1250('0x42')],'id')){_0x426f5d[_0x1250('0x42')][_0x1250('0x43')]('id');}return db['User']['findAll'](_0x426f5d);})[_0x1250('0x1c')](function(_0x5a6a87){_0x34668e['rows']=_0x5a6a87;if(_0x18a63c[_0x1250('0x3d')][_0x1250('0x44')]==='true'){var _0x1df7f9=[];for(var _0x4cfb9e=0x0;_0x4cfb9e<_0x34668e[_0x1250('0x45')][_0x1250('0x46')];_0x4cfb9e++){_0x1df7f9['push'](get_open_tabs('chat',_0x34668e['rows'][_0x4cfb9e][_0x1250('0x47')]));_0x1df7f9[_0x1250('0x43')](get_open_tabs('sms',_0x34668e[_0x1250('0x45')][_0x4cfb9e][_0x1250('0x47')]));_0x1df7f9[_0x1250('0x43')](get_open_tabs('fax',_0x34668e[_0x1250('0x45')][_0x4cfb9e]['dataValues']));_0x1df7f9['push'](get_open_tabs(_0x1250('0x48'),_0x34668e['rows'][_0x4cfb9e][_0x1250('0x47')]));_0x1df7f9['push'](get_open_tabs(_0x1250('0x49'),_0x34668e['rows'][_0x4cfb9e][_0x1250('0x47')]));_0x1df7f9[_0x1250('0x43')](get_open_tabs(_0x1250('0x4a'),_0x34668e[_0x1250('0x45')][_0x4cfb9e][_0x1250('0x47')]));}return Promise[_0x1250('0x4b')](_0x1df7f9)[_0x1250('0x1c')](function(){return _0x34668e;});}else{return _0x34668e;}})[_0x1250('0x1c')](respondWithFilteredResult(_0x1d649b,_0x426f5d))[_0x1250('0x4c')](handleError(_0x1d649b,null));};exports[_0x1250('0x4d')]=function(_0x3e5101,_0x1f32da){var _0x5bcbcd=getUserAttributes();_0x3e5101[_0x1250('0x3d')]['id']=_0x3e5101['params']['id'];var _0x28799e=qs[_0x1250('0x4e')](_0x5bcbcd,_0x3e5101);if(_0x3e5101[_0x1250('0x3d')]['includeAll']){_0x28799e[_0x1250('0x4f')]=[{'all':!![]}];}if(_0x3e5101[_0x1250('0x3d')]['userSetting']===_0x1250('0x40')){_0x28799e['include']=[{'model':db[_0x1250('0x41')],'as':'userSetting'}];}_0x28799e=_[_0x1250('0x50')]({},_0x28799e,_0x3e5101[_0x1250('0x51')]);if(!_[_0x1250('0x29')](_0x28799e['attributes'],'id')){_0x28799e[_0x1250('0x42')][_0x1250('0x43')]('id');}return db[_0x1250('0x3c')][_0x1250('0x2a')](_0x28799e)[_0x1250('0x1c')](handleEntityNotFound(_0x1f32da,null))[_0x1250('0x1c')](function(_0x26d426){var _0x7b60d4=[];values=_0x26d426;if(_0x3e5101['query'][_0x1250('0x44')]===_0x1250('0x40')){_0x7b60d4[_0x1250('0x43')](get_open_tabs(_0x1250('0x52'),_0x26d426[_0x1250('0x47')]));_0x7b60d4[_0x1250('0x43')](get_open_tabs(_0x1250('0x53'),_0x26d426[_0x1250('0x47')]));_0x7b60d4[_0x1250('0x43')](get_open_tabs('openchannel',_0x26d426[_0x1250('0x47')]));_0x7b60d4[_0x1250('0x43')](get_open_tabs('whatsapp',_0x26d426[_0x1250('0x47')]));_0x7b60d4[_0x1250('0x43')](get_open_tabs('fax',_0x26d426['dataValues']));_0x7b60d4[_0x1250('0x43')](get_open_tabs(_0x1250('0x48'),_0x26d426[_0x1250('0x47')]));return Promise[_0x1250('0x4b')](_0x7b60d4);}else{return values;}})[_0x1250('0x1c')](function(){return values;})[_0x1250('0x1c')](respondWithResult(_0x1f32da,null))['catch'](handleError(_0x1f32da,null));};exports[_0x1250('0x1b')]=function(_0x9efecb,_0x4238fc){if(_0x9efecb[_0x1250('0x54')]['id']){delete _0x9efecb[_0x1250('0x54')]['id'];}delete _0x9efecb[_0x1250('0x54')][_0x1250('0x1d')];return db['User']['find']({'where':{'id':_0x9efecb[_0x1250('0x55')]['id']}})[_0x1250('0x1c')](handleEntityNotFound(_0x4238fc,null))[_0x1250('0x1c')](saveUpdates(_0x9efecb[_0x1250('0x54')],null))[_0x1250('0x1c')](respondWithResult(_0x4238fc,null))[_0x1250('0x4c')](handleError(_0x4238fc,null));};exports[_0x1250('0x56')]=function(_0x16ecbd,_0x579500){return db['User'][_0x1250('0x56')]()[_0x1250('0x1c')](respondWithResult(_0x579500,null))[_0x1250('0x4c')](handleError(_0x579500,null));};exports[_0x1250('0x57')]=function(_0x424d5e,_0x33378c){return db['User']['find']({'where':{'id':_0x424d5e['params']['id']}})['then'](handleEntityNotFound(_0x33378c,null))[_0x1250('0x1c')](function(_0x518188){if(_0x518188){return _0x518188['addContacts'](_0x424d5e['body']['ids'],_[_0x1250('0x58')](_0x424d5e[_0x1250('0x54')],[_0x1250('0x59'),'id'])||{});}})[_0x1250('0x1c')](respondWithResult(_0x33378c,null))[_0x1250('0x4c')](handleError(_0x33378c,null));};function validateUser(_0x494682){return new Promise(function(_0x26511e,_0x4f8146){if(_0x494682[_0x1250('0x5a')])return _0x26511e(_0x494682);return db['Setting'][_0x1250('0x5b')](0x1)['then'](function(_0x220530){if(_0x220530['securePassword'])authService[_0x1250('0x5c')](_0x494682[_0x1250('0x33')]);db['User'][_0x1250('0x5d')](_0x1250('0x5a'))[_0x1250('0x1c')](function(_0x472312){if(_['isNil'](_0x472312)){_0x494682['internal']=_0x220530[_0x1250('0x5e')]||0x1;return;}if(_['isNil'](_0x220530[_0x1250('0x5e')])||_0x220530[_0x1250('0x5e')]===_0x472312){_0x494682[_0x1250('0x5a')]=_0x472312+0x1;return;}if(_0x220530[_0x1250('0x5e')]>_0x472312){_0x494682[_0x1250('0x5a')]=_0x220530[_0x1250('0x5e')];return;}return db['sequelize']['query']('select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)',{'type':db[_0x1250('0x5f')][_0x1250('0x60')][_0x1250('0x61')]})[_0x1250('0x1c')](function(_0x4134d5){if(_0x4134d5&&_0x4134d5[_0x1250('0x46')]){for(var _0x3f9e19=0x0,_0x610e4a=_0x4134d5['length'];_0x3f9e19<_0x610e4a&&_[_0x1250('0x62')](_0x494682[_0x1250('0x5a')]);_0x3f9e19++){if(_0x220530[_0x1250('0x5e')]<=_0x4134d5[_0x3f9e19][_0x1250('0x63')]){_0x494682[_0x1250('0x5a')]=_0x4134d5[_0x3f9e19][_0x1250('0x63')];}else if(_0x220530[_0x1250('0x5e')]>_0x4134d5[_0x3f9e19][_0x1250('0x63')]&&_0x220530[_0x1250('0x5e')]<=_0x4134d5[_0x3f9e19]['to']){_0x494682[_0x1250('0x5a')]=_0x220530[_0x1250('0x5e')];}}}if(_[_0x1250('0x62')](_0x494682[_0x1250('0x5a')])){_0x494682[_0x1250('0x5a')]=_0x472312+0x1;}return _0x26511e(_0x494682);});});})['catch'](function(_0x59a503){_0x4f8146(_0x59a503);});});}function updateUser(_0x2d6be9){return new Promise(function(_0xff1dfa,_0x2b44b4){try{if(_0x2d6be9[_0x1250('0x64')]){_0x2d6be9[_0x1250('0x65')]=_0x2d6be9['internal'];_0x2d6be9[_0x1250('0x66')]={'mailbox':_0x2d6be9[_0x1250('0x5a')],'password':_0x2d6be9['password'],'fullname':_0x2d6be9[_0x1250('0x67')],'email':_0x2d6be9[_0x1250('0x68')]};}if(_0x2d6be9['role']==='agent'){if(!_0x2d6be9[_0x1250('0x69')])_0x2d6be9['permissions']=[_0x1250('0x6a'),_0x1250('0x6b'),_0x1250('0x6c'),'113','110','104',_0x1250('0x6d'),'106',_0x1250('0x6e'),_0x1250('0x6f'),_0x1250('0x70'),'100',_0x1250('0x71'),'114','115'];}_0xff1dfa(_0x2d6be9);}catch(_0x39bf66){_0x2b44b4(_0x39bf66);}});}exports[_0x1250('0x72')]=function(_0x587884,_0x2856ad){if(_0x587884[_0x1250('0x73')]['role']===_0x1250('0x23'))throw new Error(_0x1250('0x74'));if(_0x587884[_0x1250('0x54')][_0x1250('0x1d')]===_0x1250('0x73')&&_0x587884[_0x1250('0x73')][_0x1250('0x1d')]!==_0x1250('0x75')){throw new Error(_0x1250('0x76'));}if(_0x587884['body'][_0x1250('0x1d')]===_0x1250('0x75')&&_0x587884[_0x1250('0x73')][_0x1250('0x1d')]!==_0x1250('0x75')){throw new Error(_0x1250('0x77'));}return licenseUtil[_0x1250('0x78')]([_0x587884[_0x1250('0x54')]])['then'](function(){return validateUser(_0x587884[_0x1250('0x54')]);})[_0x1250('0x1c')](function(_0x3efa3a){return updateUser(_0x3efa3a)[_0x1250('0x1c')](function(_0x46bbd7){if(_0x46bbd7['role']===_0x1250('0x75')){_0x46bbd7[_0x1250('0x79')]=_0x587884['user']['settingsEnabled'];delete _0x46bbd7[_0x1250('0x7a')];}return _0x46bbd7;});})[_0x1250('0x1c')](function(_0x3aa3fb){return db[_0x1250('0x3c')][_0x1250('0x72')](_0x3aa3fb,{'include':[{'model':db[_0x1250('0x66')],'as':_0x1250('0x66')}]});})['then'](function(_0x442045){if(_0x587884['body'][_0x1250('0x1d')]===_0x1250('0x73'))return _0x442045;if(_0x587884['user']['role']!==_0x1250('0x73'))return _0x442045;return db['UserProfileSection'][_0x1250('0x2a')]({'where':{'name':_0x442045[_0x1250('0x1d')]===_0x1250('0x23')?_0x1250('0x22'):_0x1250('0x24'),'userProfileId':_0x587884[_0x1250('0x73')]['userProfileId']},'raw':!![]})[_0x1250('0x1c')](function(_0x1cdd5f){if(!_0x1cdd5f||_0x1cdd5f[_0x1250('0x7b')]!=0x0)return _0x442045;return db['UserProfileResource']['create']({'name':_0x442045[_0x1250('0x39')],'resourceId':_0x442045['id'],'type':_0x1cdd5f['name'],'sectionId':_0x1cdd5f['id']},{})[_0x1250('0x1c')](function(){return _0x442045;});})[_0x1250('0x4c')](function(_0x185201){logger[_0x1250('0x2d')](_0x1250('0x7c'),_0x185201);throw _0x185201;});})[_0x1250('0x1c')](respondWithResult(_0x2856ad,0xc9))[_0x1250('0x4c')](handleError(_0x2856ad,null));};exports[_0x1250('0x7d')]=function(_0x4db3a3,_0x328789){var _0x43b2f1=_0x4db3a3[_0x1250('0x54')];var _0x1d0d4a=[];if(_0x4db3a3['user'][_0x1250('0x1d')]===_0x1250('0x23'))throw new Error('Unauthorized');if(_[_0x1250('0x7e')](_0x43b2f1,['role',_0x1250('0x73')])&&_0x4db3a3[_0x1250('0x73')][_0x1250('0x1d')]!=='admin'){throw new Error(_0x1250('0x76'));}if(_[_0x1250('0x7e')](_0x43b2f1,[_0x1250('0x1d'),'admin'])&&_0x4db3a3[_0x1250('0x73')]['role']!==_0x1250('0x75')){throw new Error(_0x1250('0x7f'));}return licenseUtil['checkUserLimits'](_0x43b2f1)[_0x1250('0x1c')](function(){return validateUser(_0x43b2f1[0x0]);})['then'](function(){for(var _0x508424=0x1;_0x508424<_0x43b2f1[_0x1250('0x46')];_0x508424++){var _0x1e6b93=_0x43b2f1[_0x508424-0x1][_0x1250('0x5a')];if(!_0x43b2f1[_0x508424][_0x1250('0x5a')])_0x43b2f1[_0x508424]['internal']=_0x1e6b93+0x1;_0x1d0d4a[_0x1250('0x43')](validateUser(_0x43b2f1[_0x508424]));}return Promise[_0x1250('0x4b')](_0x1d0d4a);})[_0x1250('0x1c')](function(){_0x1d0d4a=[];for(var _0x2dde4e=0x0;_0x2dde4e<_0x43b2f1[_0x1250('0x46')];_0x2dde4e++){_0x1d0d4a[_0x1250('0x43')](updateUser(_0x43b2f1[_0x2dde4e]));}return Promise[_0x1250('0x4b')](_0x1d0d4a);})['then'](function(){_0x1d0d4a=_0x43b2f1['map'](function(_0x57d933){return db[_0x1250('0x3c')][_0x1250('0x72')](_0x57d933,{'include':[{'model':db[_0x1250('0x66')],'as':_0x1250('0x66')}]})[_0x1250('0x1c')](function(_0x218318){_0x57d933['id']=_0x218318['id'];return _0x57d933;});});return Promise['all'](_0x1d0d4a);})[_0x1250('0x1c')](function(_0xafcfdb){if(_0x4db3a3['body']['role']==='user')return _0xafcfdb;if(_0x4db3a3[_0x1250('0x73')]['role']!=='user')return _0xafcfdb;var _0x5a5af3=_[_0x1250('0x7e')](_0xafcfdb,function(_0x48c032){return _0x48c032[_0x1250('0x1d')]===_0x1250('0x23')||_0x48c032['role']===_0x1250('0x80');});if(!_0x5a5af3)return _0xafcfdb;return db[_0x1250('0x81')][_0x1250('0x82')]({'where':{'name':{'$or':[_0x1250('0x22'),_0x1250('0x24')]},'userProfileId':_0x4db3a3[_0x1250('0x73')][_0x1250('0x7a')]},'raw':!![]})[_0x1250('0x1c')](function(_0x5354ce){if(_[_0x1250('0x83')](_0x5354ce)||!_['some'](_0x5354ce,[_0x1250('0x7b'),0x0]))return _0xafcfdb;_0x1d0d4a=[];var _0xece498=_(_0x5354ce)[_0x1250('0x27')](function(_0x45b9c8){if(_0x45b9c8['autoAssociation']===0x1)return;return _0x45b9c8[_0x1250('0x39')]==='Agents'?'agent':'telephone';})[_0x1250('0x84')]()[_0x1250('0x28')]();for(var _0x4f818f=0x0;_0x4f818f<_0xafcfdb[_0x1250('0x46')];_0x4f818f++){if(!_[_0x1250('0x29')](_0xece498,_0xafcfdb[_0x4f818f][_0x1250('0x1d')]))return;var _0x301f45=_0xafcfdb[_0x4f818f][_0x1250('0x1d')]===_0x1250('0x23')?_0x1250('0x22'):_0x1250('0x24');_0x1d0d4a[_0x1250('0x43')](db[_0x1250('0x2b')]['create']({'name':_0xafcfdb[_0x4f818f]['name'],'resourceId':_0xafcfdb[_0x4f818f]['id'],'type':_0x301f45,'sectionId':_[_0x1250('0x2a')](_0x5354ce,[_0x1250('0x39'),_0x301f45])['id']},{}));}return Promise[_0x1250('0x4b')](_0x1d0d4a);});})[_0x1250('0x1c')](respondWithResult(_0x328789,0xc9))[_0x1250('0x4c')](handleError(_0x328789,null));};exports[_0x1250('0x85')]=function(_0x1e7b52,_0x3afc53){if(_0x1e7b52[_0x1250('0x54')]['id']){delete _0x1e7b52['body']['id'];}return db[_0x1250('0x3c')][_0x1250('0x2a')]({'where':{'id':_0x1e7b52[_0x1250('0x55')]['id']}})[_0x1250('0x1c')](function(_0xcbda54){if(!_0xcbda54)return null;if(_0xcbda54['id']===_0x1e7b52[_0x1250('0x73')]['id']){if(!_0x1e7b52['body'][_0x1250('0x86')]||!_0x1e7b52[_0x1250('0x54')]['newPassword']){throw new db['Sequelize'][(_0x1250('0x87'))](_0x1250('0x88'));}if(!_0xcbda54[_0x1250('0x89')](_0x1e7b52[_0x1250('0x54')][_0x1250('0x86')])){throw new db[(_0x1250('0x8a'))][(_0x1250('0x87'))](_0x1250('0x8b'));}if(_0x1e7b52[_0x1250('0x54')][_0x1250('0x86')]===_0x1e7b52[_0x1250('0x54')][_0x1250('0x8c')]){throw new db['Sequelize'][(_0x1250('0x87'))](_0x1250('0x8d'));}}else if(_0x1e7b52[_0x1250('0x73')]['role']===_0x1250('0x75')){if(!_0x1e7b52[_0x1250('0x54')][_0x1250('0x8c')]){throw new db[(_0x1250('0x8a'))][(_0x1250('0x87'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0x1e7b52[_0x1250('0x73')]['role']==='user'){if(!_0x1e7b52[_0x1250('0x54')][_0x1250('0x8c')]){throw new db['Sequelize'][(_0x1250('0x87'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0xcbda54['role']!==_0x1250('0x23')){throw new db['Sequelize']['ValidationError'](_0x1250('0x74'));}}else{throw new db[(_0x1250('0x8a'))][(_0x1250('0x87'))](_0x1250('0x74'));}return _0xcbda54;})[_0x1250('0x1c')](handleEntityNotFound(_0x3afc53,null))['then'](function(_0x39ce09){return db[_0x1250('0x8e')]['findOne']({'attributes':['id',_0x1250('0x8f'),_0x1250('0x90'),'passwordHistoryLimit']})[_0x1250('0x1c')](function(_0x1fcb72){if(_0x1fcb72['securePassword'])authService[_0x1250('0x5c')](_0x1e7b52['body'][_0x1250('0x8c')]);if(!_0x1fcb72[_0x1250('0x90')]||!_0x39ce09['previousPasswords'])return _0x39ce09;authService[_0x1250('0x91')](_0x1e7b52[_0x1250('0x54')][_0x1250('0x8c')],_0x39ce09[_0x1250('0x35')],_0x1fcb72[_0x1250('0x92')]);return _0x39ce09;})[_0x1250('0x1c')](saveUpdates({'password':_0x1e7b52[_0x1250('0x54')]['newPassword'],'passwordResetAt':_0x1e7b52['user']['id']==_0x1e7b52[_0x1250('0x55')]['id']?moment():null,'previousPasswords':authService[_0x1250('0x93')](_0x1e7b52[_0x1250('0x54')][_0x1250('0x8c')],_0x39ce09[_0x1250('0x35')])},null));})[_0x1250('0x1c')](respondWithResult(_0x3afc53,null))[_0x1250('0x4c')](handleError(_0x3afc53,null));};exports[_0x1250('0x94')]=function(_0x4da7f5,_0xd08c84){var _0x43f592=_0x4da7f5[_0x1250('0x54')][_0x1250('0x95')];return db[_0x1250('0x3c')][_0x1250('0x2a')]({'where':{'id':_0x4da7f5[_0x1250('0x55')]['id']},'attributes':['id','name',_0x1250('0x1d'),_0x1250('0x96'),'loginInPause',_0x1250('0x97'),_0x1250('0x98')]})[_0x1250('0x1c')](handleEntityNotFound(_0xd08c84,null))[_0x1250('0x1c')](function(_0x3f84de){if(_0x3f84de){if(!utils[_0x1250('0x99')](_0x43f592)){throw new db[(_0x1250('0x8a'))]['ValidationError'](_0x1250('0x9a'));}return _0x3f84de[_0x1250('0x9b')+_[_0x1250('0x9c')](_0x43f592[_0x1250('0x9d')]())+_0x1250('0x9e')](_0x4da7f5[_0x1250('0x54')][_0x1250('0x59')],{'penalty':_0x4da7f5['body']['penalty']||0x0})[_0x1250('0x9f')](function(_0x4601f7){for(var _0x3b47d1=0x0;_0x3b47d1<_0x4da7f5['body'][_0x1250('0x59')][_0x1250('0x46')];_0x3b47d1+=0x1){var _0x4625fd={'UserId':Number(_0x4da7f5[_0x1250('0x55')]['id'])};_0x4625fd[_[_0x1250('0x9c')](_0x43f592['toLowerCase']())+_0x1250('0xa0')]=Number(_0x4da7f5[_0x1250('0x54')][_0x1250('0x59')][_0x3b47d1]);socket[_0x1250('0x1e')]('user'+_[_0x1250('0x9c')](_0x43f592[_0x1250('0x9d')]())+_0x1250('0xa1'),_0x4625fd);}return _0x4601f7;})[_0x1250('0x1c')](function(){if(_0x43f592===_0x1250('0xa2')){return db['VoiceQueue']['findAll']({'where':{'id':_0x4da7f5['body'][_0x1250('0x59')]||[]},'raw':!![],'attributes':['id',_0x1250('0x39')]});}})[_0x1250('0x1c')](function(_0x41073d){var _0x2e689d=_0x3f84de[_0x1250('0x21')]({'plain':!![]});var _0x39738a=[];if(_0x43f592===_0x1250('0xa2')&&_0x2e689d[_0x1250('0x1d')]===_0x1250('0x23')&&_0x2e689d[_0x1250('0x96')]){for(let _0x5bc66b=0x0;_0x5bc66b<_0x41073d['length'];_0x5bc66b+=0x1){_0x39738a[_0x1250('0x43')]({'membername':_0x2e689d[_0x1250('0x39')],'UserId':_0x2e689d['id'],'queue_name':_0x41073d[_0x5bc66b][_0x1250('0x39')],'VoiceQueueId':_0x41073d[_0x5bc66b]['id'],'interface':_[_0x1250('0x62')](_0x2e689d[_0x1250('0x98')])?util[_0x1250('0xa3')]('SIP/%s',_0x2e689d[_0x1250('0x39')]):_0x2e689d[_0x1250('0x98')],'paused':_0x2e689d[_0x1250('0x97')]||![],'penalty':_0x4da7f5['body'][_0x1250('0xa4')]||0x0});}return Promise[_0x1250('0x4b')](_0x39738a[_0x1250('0x27')](function(_0x24198f){return db[_0x1250('0xa5')][_0x1250('0xa6')](_0x24198f);}));}return _0x3f84de;});}})[_0x1250('0x1c')](respondWithStatusCode(_0xd08c84,null))[_0x1250('0x4c')](handleError(_0xd08c84,null));};exports[_0x1250('0xa7')]=function(_0x5b2ef7,_0x587e3d){var _0xc5b503,_0x2a6a93;return db['User'][_0x1250('0x2a')]({'where':{'id':_0x5b2ef7[_0x1250('0x55')]['id']},'attributes':['id',_0x1250('0x39'),_0x1250('0x1d')]})['then'](handleEntityNotFound(_0x587e3d,null))['then'](function(_0x3944fe){if(_0x3944fe){_0xc5b503=_0x3944fe;if(!_0x5b2ef7[_0x1250('0x3d')][_0x1250('0x95')]||!utils[_0x1250('0x99')](_0x5b2ef7[_0x1250('0x3d')][_0x1250('0x95')])){throw new db[(_0x1250('0x8a'))][(_0x1250('0x87'))](_0x1250('0x9a'));}return _0x3944fe[_0x1250('0xa8')+_[_0x1250('0x9c')](_0x5b2ef7[_0x1250('0x3d')]['channel'][_0x1250('0x9d')]())+_0x1250('0x9e')](_0x5b2ef7[_0x1250('0x3d')][_0x1250('0x59')]);}})[_0x1250('0x1c')](function(_0x3f46c8){if(_[_0x1250('0xa9')](_0x5b2ef7[_0x1250('0x3d')][_0x1250('0x59')])){for(var _0x488567=0x0;_0x488567<_0x5b2ef7[_0x1250('0x3d')][_0x1250('0x59')][_0x1250('0x46')];_0x488567+=0x1){_0x2a6a93={'UserId':Number(_0x5b2ef7[_0x1250('0x55')]['id'])};_0x2a6a93[_[_0x1250('0x9c')](_0x5b2ef7[_0x1250('0x3d')]['channel']['toLowerCase']())+'QueueId']=Number(_0x5b2ef7[_0x1250('0x3d')][_0x1250('0x59')][_0x488567]);socket['emit'](_0x1250('0x73')+_[_0x1250('0x9c')](_0x5b2ef7[_0x1250('0x3d')][_0x1250('0x95')]['toLowerCase']())+'Queue:remove',_0x2a6a93);}}else{_0x2a6a93={'UserId':Number(_0x5b2ef7[_0x1250('0x55')]['id'])};_0x2a6a93[_[_0x1250('0x9c')](_0x5b2ef7[_0x1250('0x3d')][_0x1250('0x95')]['toLowerCase']())+_0x1250('0xa0')]=Number(_0x5b2ef7['query'][_0x1250('0x59')]);socket[_0x1250('0x1e')](_0x1250('0x73')+_[_0x1250('0x9c')](_0x5b2ef7['query'][_0x1250('0x95')][_0x1250('0x9d')]())+'Queue:remove',_0x2a6a93);}return _0x3f46c8;})['then'](function(){if(_0x5b2ef7[_0x1250('0x3d')][_0x1250('0x95')]===_0x1250('0xa2')){return db['UserVoiceQueueRt']['destroy']({'where':{'UserId':_0x5b2ef7['params']['id'],'VoiceQueueId':_0x5b2ef7[_0x1250('0x3d')][_0x1250('0x59')]},'individualHooks':!![]})[_0x1250('0x1c')](function(){return _0xc5b503;});}return _0xc5b503;})[_0x1250('0x1c')](respondWithStatusCode(_0x587e3d,null))[_0x1250('0x4c')](handleError(_0x587e3d,null));};exports['addAvatar']=function(_0x1bfc11,_0xef2666){_0x1bfc11['body']['userpic']=_0x1bfc11[_0x1250('0xaa')][_0x1250('0xab')];return db['User']['find']({'where':{'id':_0x1bfc11[_0x1250('0x55')]['id']}})[_0x1250('0x1c')](handleEntityNotFound(_0xef2666,null))['then'](saveUpdates(_0x1bfc11['body'],null))[_0x1250('0x1c')](respondWithResult(_0xef2666,null))[_0x1250('0x4c')](handleError(_0xef2666,null));};exports[_0x1250('0xac')]=function(_0x127d45,_0x17fe05){var _0x5eea1d=path[_0x1250('0xad')](config['root'],_0x1250('0xae'));return db[_0x1250('0x3c')]['find']({'where':{'id':_0x127d45[_0x1250('0x55')]['id']},'attributes':['id',_0x1250('0xaf')],'raw':!![]})[_0x1250('0x1c')](handleEntityNotFound(_0x17fe05,null))[_0x1250('0x1c')](function(_0x35c2e1){if(_0x35c2e1){if(_[_0x1250('0x62')](_0x35c2e1[_0x1250('0xaf')])){return _0x17fe05[_0x1250('0xb0')](_0x5eea1d);}else{if(!fs[_0x1250('0xb1')](path[_0x1250('0xad')](config[_0x1250('0xb2')],_0x1250('0xb3'),_0x35c2e1[_0x1250('0xaf')]))){return _0x17fe05[_0x1250('0xb0')](_0x5eea1d);}return _0x17fe05[_0x1250('0xb0')](path[_0x1250('0xad')](config[_0x1250('0xb2')],_0x1250('0xb3'),_0x35c2e1['userpic']));}}})['catch'](handleError(_0x17fe05,null));};exports['getOpenTabs']=function(_0x122ba6,_0x149273){return db[_0x1250('0x3c')][_0x1250('0x2a')]({'where':{'id':_0x122ba6['params']['id']},'attributes':['id']})['then'](handleEntityNotFound(_0x149273,null))[_0x1250('0x1c')](function(_0x1b6321){var _0x22808a=[];values=_0x1b6321[_0x1250('0x47')];_0x22808a[_0x1250('0x43')](get_open_tabs(_0x1250('0x52'),_0x1b6321[_0x1250('0x47')]));_0x22808a[_0x1250('0x43')](get_open_tabs('sms',_0x1b6321[_0x1250('0x47')]));_0x22808a[_0x1250('0x43')](get_open_tabs('openchannel',_0x1b6321[_0x1250('0x47')]));_0x22808a[_0x1250('0x43')](get_open_tabs('whatsapp',_0x1b6321['dataValues']));_0x22808a['push'](get_open_tabs(_0x1250('0xb4'),_0x1b6321[_0x1250('0x47')]));_0x22808a['push'](get_open_tabs('mail',_0x1b6321[_0x1250('0x47')]));return Promise['all'](_0x22808a);})[_0x1250('0x1c')](function(_0x30b887){if(_0x30b887){var _0x12d22b=_[_0x1250('0x27')](values['ChatOpenTabs'],function(_0xcf194d){return{'channel':'CHAT','id':_0xcf194d['id'],'createdAt':_0xcf194d[_0x1250('0xb5')]};});var _0x2f7fae=_[_0x1250('0x27')](values[_0x1250('0xb6')],function(_0x367e4e){return{'channel':'FAX','id':_0x367e4e['id'],'createdAt':_0x367e4e[_0x1250('0xb5')]};});var _0x2b659c=_[_0x1250('0x27')](values[_0x1250('0xb7')],function(_0x14771a){return{'channel':_0x1250('0xb8'),'id':_0x14771a['id'],'createdAt':_0x14771a[_0x1250('0xb5')]};});var _0x4d2345=_[_0x1250('0x27')](values[_0x1250('0xb9')],function(_0x3d0e87){return{'channel':'MAIL','id':_0x3d0e87['id'],'createdAt':_0x3d0e87[_0x1250('0xb5')]};});var _0x7809fb=_[_0x1250('0x27')](values[_0x1250('0xba')],function(_0x422f0f){return{'channel':_0x1250('0xbb'),'id':_0x422f0f['id'],'createdAt':_0x422f0f[_0x1250('0xb5')]};});var _0x5e88a3=_[_0x1250('0x27')](values[_0x1250('0xbc')],function(_0x382f6f){return{'channel':_0x1250('0xbd'),'id':_0x382f6f['id'],'createdAt':_0x382f6f[_0x1250('0xb5')]};});var _0x4164ab=_[_0x1250('0xbe')](_0x12d22b,_0x2f7fae,_0x2b659c,_0x4d2345,_0x7809fb,_0x5e88a3);var _0x281087={'count':_0x4164ab[_0x1250('0x46')],'rows':_0x4164ab};return _0x281087;}else return null;})['then'](respondWithResult(_0x149273,null))['catch'](handleError(_0x149273,null));};exports['getContacts']=function(_0x52a66c,_0x398107){var _0x485db2={};return db[_0x1250('0x3c')][_0x1250('0xbf')]({'where':{'id':_0x52a66c['params']['id']}})['then'](function(_0x3b6e8c){if(!_0x3b6e8c){throw new APINotFoundError(util[_0x1250('0xa3')](_0x1250('0xc0'),_0x52a66c['params']['id']));}return contacts['describe']();})[_0x1250('0x1c')](function(_0x4ac04d){_0x52a66c[_0x1250('0x3d')][_0x1250('0x3c')]=_0x52a66c[_0x1250('0x55')]['id'];_0x485db2=qs[_0x1250('0x4e')](_0x4ac04d,_0x52a66c);if(_0x52a66c[_0x1250('0x3d')][_0x1250('0xc1')](_0x1250('0x3e'))){_0x485db2['include']=[{'model':db[_0x1250('0xc2')],'as':_0x1250('0xc3'),'required':![]},{'model':db[_0x1250('0xc4')],'as':_0x1250('0xc5'),'attributes':['id','name','color'],'where':_0x52a66c[_0x1250('0x3d')][_0x1250('0xc6')]?{'id':_0x52a66c['query'][_0x1250('0xc6')]}:undefined,'required':_0x52a66c[_0x1250('0x3d')]['tag']?!![]:![]}];}return contacts[_0x1250('0x82')](_0x52a66c[_0x1250('0x3d')],_0x52a66c[_0x1250('0x73')],_0x485db2,_0x4ac04d);})[_0x1250('0x1c')](respondWithFilteredResult(_0x398107,_0x485db2))[_0x1250('0x4c')](APIHandleError(_0x398107));};exports[_0x1250('0xc7')]=function(_0x2908e7,_0x41d48b){var _0x37902e;var _0x2a3915={};var _0x52f189;return db[_0x1250('0x3c')][_0x1250('0xbf')]({'where':{'id':_0x2908e7[_0x1250('0x55')]['id']},'attributes':['id','name','role']})['then'](handleEntityNotFound(_0x41d48b,null))[_0x1250('0x1c')](function(_0x589105){if(!utils[_0x1250('0x99')](_0x2908e7[_0x1250('0x3d')][_0x1250('0x95')])){throw new db['Sequelize']['ValidationError']('Unknown\x20channel');}_0x37902e=_0x589105;var _0x5bc69d={};_0x5bc69d['model']=_['keys'](db[_[_0x1250('0x9c')](_0x2908e7[_0x1250('0x3d')]['channel'])+_0x1250('0xc8')]['rawAttributes']);_0x5bc69d['query']=_['keys'](_0x2908e7[_0x1250('0x3d')]);_0x5bc69d[_0x1250('0xc9')]=_[_0x1250('0xca')](_0x5bc69d[_0x1250('0xcb')],_0x5bc69d[_0x1250('0x3d')]);_0x2a3915[_0x1250('0x42')]=_[_0x1250('0xca')](_0x5bc69d[_0x1250('0xcb')],qs['fields'](_0x2908e7[_0x1250('0x3d')][_0x1250('0xcc')]));_0x2a3915[_0x1250('0x42')]=_0x2a3915[_0x1250('0x42')][_0x1250('0x46')]?_0x2a3915[_0x1250('0x42')]:_0x5bc69d[_0x1250('0xcb')];_0x2a3915[_0x1250('0xcd')]=qs[_0x1250('0xce')](_0x2908e7[_0x1250('0x3d')]['sort']);_0x2a3915[_0x1250('0x3b')]=qs['filters'](_[_0x1250('0xcf')](_0x2908e7['query'],_0x5bc69d[_0x1250('0xc9')]));if(_0x2908e7['query'][_0x1250('0x25')]){_0x2a3915[_0x1250('0x3b')]=_[_0x1250('0x50')](_0x2a3915['where'],{'$or':_['map'](_0x2a3915[_0x1250('0x42')],function(_0x14080d){var _0x4078ba={};_0x4078ba[_0x14080d]={'$like':'%'+_0x2908e7[_0x1250('0x3d')][_0x1250('0x25')]+'%'};return _0x4078ba;})});}_0x2a3915=_[_0x1250('0x50')]({},_0x2a3915,_0x2908e7[_0x1250('0x51')]);switch(_0x37902e['role']){case _0x1250('0x75'):return db[_['capitalize'](_0x2908e7[_0x1250('0x3d')][_0x1250('0x95')])+_0x1250('0xc8')][_0x1250('0x82')](_0x2a3915);case _0x1250('0x73'):case _0x1250('0x23'):return _0x37902e['get'+_[_0x1250('0x9c')](_0x2908e7[_0x1250('0x3d')][_0x1250('0x95')])+_0x1250('0x9e')](_0x2a3915);default:throw new db[(_0x1250('0x8a'))]['ValidationError'](_0x1250('0xd0'));}})[_0x1250('0x1c')](function(_0x17bce4){_0x52f189=_0x17bce4['length'];if(!_0x2908e7[_0x1250('0x3d')][_0x1250('0xc1')]('nolimit')){_0x2a3915[_0x1250('0x18')]=qs[_0x1250('0x18')](_0x2908e7[_0x1250('0x3d')]['limit']);_0x2a3915['offset']=qs[_0x1250('0x16')](_0x2908e7[_0x1250('0x3d')][_0x1250('0x16')]);}switch(_0x37902e['role']){case _0x1250('0x75'):return db[_[_0x1250('0x9c')](_0x2908e7[_0x1250('0x3d')][_0x1250('0x95')])+_0x1250('0xc8')][_0x1250('0x82')](_0x2a3915);case'user':case _0x1250('0x23'):return _0x37902e['get'+_['capitalize'](_0x2908e7['query']['channel'])+_0x1250('0x9e')](_0x2a3915);}})[_0x1250('0x1c')](function(_0x171388){return{'count':_0x52f189,'rows':_0x171388};})[_0x1250('0x1c')](respondWithResult(_0x41d48b,null))[_0x1250('0x4c')](handleError(_0x41d48b,null));};exports[_0x1250('0xd1')]=function(_0x1dbe63,_0x2eaad1){var _0x3ef2b9={};var _0x4fd791={};var _0x93eff4;var _0x194382;return db[_0x1250('0x3c')][_0x1250('0xbf')]({'where':{'id':_0x1dbe63[_0x1250('0x55')]['id']}})['then'](handleEntityNotFound(_0x2eaad1,null))['then'](function(_0x417d26){if(_0x417d26){_0x93eff4=_0x417d26;_0x4fd791[_0x1250('0xcb')]=_[_0x1250('0xd2')](db[_0x1250('0xa5')][_0x1250('0x2f')]);_0x4fd791[_0x1250('0x3d')]=_['keys'](_0x1dbe63[_0x1250('0x3d')]);_0x4fd791[_0x1250('0xc9')]=_[_0x1250('0xca')](_0x4fd791[_0x1250('0xcb')],_0x4fd791['query']);_0x3ef2b9['attributes']=_[_0x1250('0xca')](_0x4fd791[_0x1250('0xcb')],qs['fields'](_0x1dbe63[_0x1250('0x3d')]['fields']));_0x3ef2b9['attributes']=_0x3ef2b9[_0x1250('0x42')]['length']?_0x3ef2b9[_0x1250('0x42')]:_0x4fd791['model'];_0x3ef2b9[_0x1250('0xcd')]=qs[_0x1250('0xce')](_0x1dbe63['query']['sort']);_0x3ef2b9[_0x1250('0x3b')]=qs['filters'](_[_0x1250('0xcf')](_0x1dbe63[_0x1250('0x3d')],_0x4fd791[_0x1250('0xc9')]));if(_0x1dbe63['query'][_0x1250('0x25')]){_0x3ef2b9[_0x1250('0x3b')]=_[_0x1250('0x50')](_0x3ef2b9['where'],{'$or':_[_0x1250('0x27')](_0x3ef2b9[_0x1250('0x42')],function(_0xb7b6e7){var _0x304638={};_0x304638[_0xb7b6e7]={'$like':'%'+_0x1dbe63[_0x1250('0x3d')]['filter']+'%'};return _0x304638;})});}_0x3ef2b9=_['merge']({},_0x3ef2b9,_0x1dbe63[_0x1250('0x51')]);return _0x93eff4['getVoiceQueuesRt'](_0x3ef2b9);}})[_0x1250('0x1c')](function(_0x3d3440){if(_0x3d3440){_0x194382=_0x3d3440['length'];if(!_0x1dbe63[_0x1250('0x3d')][_0x1250('0xc1')]('nolimit')){_0x3ef2b9[_0x1250('0x18')]=qs[_0x1250('0x18')](_0x1dbe63['query'][_0x1250('0x18')]);_0x3ef2b9[_0x1250('0x16')]=qs[_0x1250('0x16')](_0x1dbe63[_0x1250('0x3d')][_0x1250('0x16')]);}return _0x93eff4[_0x1250('0xd1')](_0x3ef2b9);}})[_0x1250('0x1c')](function(_0x4632fb){if(_0x4632fb){return _0x4632fb?{'count':_0x194382,'rows':_0x4632fb}:null;}})[_0x1250('0x1c')](respondWithResult(_0x2eaad1,null))[_0x1250('0x4c')](handleError(_0x2eaad1,null));};exports[_0x1250('0xd3')]=function(_0x523d81,_0x4f0d54){var _0x313285={};var _0xeb3a49={};var _0x209d9f;var _0xdef58;return db[_0x1250('0x3c')]['findOne']({'where':{'id':_0x523d81[_0x1250('0x55')]['id']}})[_0x1250('0x1c')](handleEntityNotFound(_0x4f0d54,null))[_0x1250('0x1c')](function(_0x50b028){if(_0x50b028){_0x209d9f=_0x50b028;_0xeb3a49[_0x1250('0xcb')]=_['keys'](db[_0x1250('0xd4')][_0x1250('0x2f')]);_0xeb3a49['query']=_['keys'](_0x523d81[_0x1250('0x3d')]);_0xeb3a49['filters']=_[_0x1250('0xca')](_0xeb3a49[_0x1250('0xcb')],_0xeb3a49['query']);_0x313285[_0x1250('0x42')]=_[_0x1250('0xca')](_0xeb3a49[_0x1250('0xcb')],qs[_0x1250('0xcc')](_0x523d81['query']['fields']));_0x313285[_0x1250('0x42')]=_0x313285[_0x1250('0x42')]['length']?_0x313285['attributes']:_0xeb3a49[_0x1250('0xcb')];_0x313285[_0x1250('0xcd')]=qs[_0x1250('0xce')](_0x523d81[_0x1250('0x3d')][_0x1250('0xce')]);_0x313285[_0x1250('0x3b')]=qs[_0x1250('0xc9')](_[_0x1250('0xcf')](_0x523d81[_0x1250('0x3d')],_0xeb3a49[_0x1250('0xc9')]));if(_0x523d81[_0x1250('0x3d')][_0x1250('0x25')]){_0x313285[_0x1250('0x3b')]=_[_0x1250('0x50')](_0x313285[_0x1250('0x3b')],{'$or':_[_0x1250('0x27')](_0x313285['attributes'],function(_0x1f25ed){var _0xad48f2={};_0xad48f2[_0x1f25ed]={'$like':'%'+_0x523d81[_0x1250('0x3d')][_0x1250('0x25')]+'%'};return _0xad48f2;})});}_0x313285=_[_0x1250('0x50')]({},_0x313285,_0x523d81[_0x1250('0x51')]);return _0x209d9f[_0x1250('0xd3')](_0x313285);}})[_0x1250('0x1c')](function(_0xb37b33){if(_0xb37b33){_0xdef58=_0xb37b33[_0x1250('0x46')];if(!_0x523d81[_0x1250('0x3d')][_0x1250('0xc1')](_0x1250('0xd5'))){_0x313285['limit']=qs[_0x1250('0x18')](_0x523d81['query'][_0x1250('0x18')]);_0x313285[_0x1250('0x16')]=qs[_0x1250('0x16')](_0x523d81[_0x1250('0x3d')][_0x1250('0x16')]);}return _0x209d9f[_0x1250('0xd3')](_0x313285);}})['then'](function(_0x5d9a2d){if(_0x5d9a2d){return _0x5d9a2d?{'count':_0xdef58,'rows':_0x5d9a2d}:null;}})[_0x1250('0x1c')](respondWithResult(_0x4f0d54,null))['catch'](handleError(_0x4f0d54,null));};exports[_0x1250('0xd6')]=function(_0xde2e77,_0x329f96){var _0x3138e9={'raw':!![],'where':{}};var _0x4162c5={};var _0x4d900d={'count':0x0,'rows':[]};return db['User'][_0x1250('0xbf')]({'where':{'id':_0xde2e77[_0x1250('0x55')]['id']}})[_0x1250('0x1c')](handleEntityNotFound(_0x329f96,null))[_0x1250('0x1c')](function(_0x2e39a3){if(_0x2e39a3){_0x4162c5['model']=_['keys'](db[_0x1250('0xd7')][_0x1250('0x2f')]);_0x4162c5[_0x1250('0x3d')]=_[_0x1250('0xd2')](_0xde2e77[_0x1250('0x3d')]);_0x4162c5['filters']=_['intersection'](_0x4162c5['model'],_0x4162c5[_0x1250('0x3d')]);_0x3138e9[_0x1250('0x42')]=_[_0x1250('0xca')](_0x4162c5[_0x1250('0xcb')],qs[_0x1250('0xcc')](_0xde2e77[_0x1250('0x3d')][_0x1250('0xcc')]));_0x3138e9[_0x1250('0x42')]=_0x3138e9['attributes'][_0x1250('0x46')]?_0x3138e9[_0x1250('0x42')]:_0x4162c5[_0x1250('0xcb')];if(!_0xde2e77['query']['hasOwnProperty'](_0x1250('0xd5'))){_0x3138e9[_0x1250('0x18')]=qs[_0x1250('0x18')](_0xde2e77['query'][_0x1250('0x18')]);_0x3138e9[_0x1250('0x16')]=qs[_0x1250('0x16')](_0xde2e77['query'][_0x1250('0x16')]);}_0x3138e9[_0x1250('0xcd')]=qs[_0x1250('0xce')](_0xde2e77[_0x1250('0x3d')]['sort']);_0x3138e9[_0x1250('0x3b')]=qs[_0x1250('0xc9')](_[_0x1250('0xcf')](_0xde2e77[_0x1250('0x3d')],_0x4162c5[_0x1250('0xc9')]));_0x3138e9[_0x1250('0x3b')][_0x1250('0xd8')]=_0x2e39a3['id'];if(_0xde2e77[_0x1250('0x3d')][_0x1250('0x25')]){_0x3138e9['where']=_[_0x1250('0x50')](_0x3138e9['where'],{'$or':_[_0x1250('0x27')](_0x3138e9[_0x1250('0x42')],function(_0x1d095d){var _0x1327f9={};_0x1327f9[_0x1d095d]={'$like':'%'+_0xde2e77[_0x1250('0x3d')][_0x1250('0x25')]+'%'};return _0x1327f9;})});}_0x3138e9=_[_0x1250('0x50')]({},_0x3138e9,_0xde2e77[_0x1250('0x51')]);return db['VoiceRecording'][_0x1250('0x19')]({'where':_0x3138e9[_0x1250('0x3b')]})[_0x1250('0x1c')](function(_0x338d4a){_0x4d900d['count']=_0x338d4a;if(_0xde2e77[_0x1250('0x3d')][_0x1250('0x3e')]){_0x3138e9[_0x1250('0x4f')]=[{'all':!![]}];}return db[_0x1250('0xd7')]['findAll'](_0x3138e9);})[_0x1250('0x1c')](function(_0x6f36f5){_0x4d900d['rows']=_0x6f36f5;return _0x4d900d;});}})[_0x1250('0x1c')](respondWithFilteredResult(_0x329f96,_0x3138e9))[_0x1250('0x4c')](handleError(_0x329f96,null));};exports[_0x1250('0xd9')]=function(_0x4ff4a4,_0x22e531){var _0x9bf202={'raw':!![],'where':{}};var _0x592b98={};var _0x57730a={'count':0x0,'rows':[]};return db[_0x1250('0x3c')]['findOne']({'where':{'id':_0x4ff4a4[_0x1250('0x55')]['id']}})[_0x1250('0x1c')](handleEntityNotFound(_0x22e531,null))[_0x1250('0x1c')](function(_0x194317){if(_0x194317){_0x592b98['model']=_[_0x1250('0xd2')](db[_0x1250('0xda')][_0x1250('0x2f')]);_0x592b98[_0x1250('0x3d')]=_[_0x1250('0xd2')](_0x4ff4a4[_0x1250('0x3d')]);_0x592b98['filters']=_['intersection'](_0x592b98[_0x1250('0xcb')],_0x592b98[_0x1250('0x3d')]);_0x9bf202[_0x1250('0x42')]=_[_0x1250('0xca')](_0x592b98[_0x1250('0xcb')],qs['fields'](_0x4ff4a4[_0x1250('0x3d')][_0x1250('0xcc')]));_0x9bf202[_0x1250('0x42')]=_0x9bf202['attributes'][_0x1250('0x46')]?_0x9bf202[_0x1250('0x42')]:_0x592b98[_0x1250('0xcb')];if(!_0x4ff4a4[_0x1250('0x3d')]['hasOwnProperty'](_0x1250('0xd5'))){_0x9bf202['limit']=qs[_0x1250('0x18')](_0x4ff4a4[_0x1250('0x3d')][_0x1250('0x18')]);_0x9bf202['offset']=qs[_0x1250('0x16')](_0x4ff4a4['query'][_0x1250('0x16')]);}_0x9bf202['order']=qs[_0x1250('0xce')](_0x4ff4a4[_0x1250('0x3d')][_0x1250('0xce')]);_0x9bf202[_0x1250('0x3b')]=qs['filters'](_[_0x1250('0xcf')](_0x4ff4a4[_0x1250('0x3d')],_0x592b98['filters']));_0x9bf202[_0x1250('0x3b')][_0x1250('0xd8')]=_0x194317['id'];if(_0x4ff4a4[_0x1250('0x3d')]['filter']){_0x9bf202[_0x1250('0x3b')]=_[_0x1250('0x50')](_0x9bf202['where'],{'$or':_['map'](_0x9bf202['attributes'],function(_0x1ae434){var _0x1a05cd={};_0x1a05cd[_0x1ae434]={'$like':'%'+_0x4ff4a4[_0x1250('0x3d')]['filter']+'%'};return _0x1a05cd;})});}_0x9bf202=_['merge']({},_0x9bf202,_0x4ff4a4[_0x1250('0x51')]);return db[_0x1250('0xda')][_0x1250('0x19')]({'where':_0x9bf202['where']})[_0x1250('0x1c')](function(_0xb8943){_0x57730a['count']=_0xb8943;if(_0x4ff4a4['query'][_0x1250('0x3e')]){_0x9bf202[_0x1250('0x4f')]=[{'all':!![]}];}return db[_0x1250('0xda')]['findAll'](_0x9bf202);})['then'](function(_0x149b92){_0x57730a[_0x1250('0x45')]=_0x149b92;return _0x57730a;});}})[_0x1250('0x1c')](respondWithFilteredResult(_0x22e531,_0x9bf202))[_0x1250('0x4c')](handleError(_0x22e531,null));};exports[_0x1250('0xdb')]=function(_0xb0cb0f,_0x222880){var _0xd61619={};var _0x217720={};var _0x4f9dd5;var _0x18f78b;return db[_0x1250('0x3c')]['findOne']({'where':{'id':_0xb0cb0f['params']['id']}})['then'](handleEntityNotFound(_0x222880,null))[_0x1250('0x1c')](function(_0x4c2505){if(_0x4c2505){_0x4f9dd5=_0x4c2505;_0x217720[_0x1250('0xcb')]=_['keys'](db[_0x1250('0xdc')][_0x1250('0x2f')]);_0x217720['query']=_[_0x1250('0xd2')](_0xb0cb0f['query']);_0x217720[_0x1250('0xc9')]=_[_0x1250('0xca')](_0x217720[_0x1250('0xcb')],_0x217720[_0x1250('0x3d')]);_0xd61619[_0x1250('0x42')]=_[_0x1250('0xca')](_0x217720[_0x1250('0xcb')],qs[_0x1250('0xcc')](_0xb0cb0f[_0x1250('0x3d')][_0x1250('0xcc')]));_0xd61619[_0x1250('0x42')]=_0xd61619['attributes'][_0x1250('0x46')]?_0xd61619[_0x1250('0x42')]:_0x217720[_0x1250('0xcb')];_0xd61619[_0x1250('0xcd')]=qs['sort'](_0xb0cb0f[_0x1250('0x3d')][_0x1250('0xce')]);_0xd61619[_0x1250('0x3b')]=qs[_0x1250('0xc9')](_['pick'](_0xb0cb0f[_0x1250('0x3d')],_0x217720[_0x1250('0xc9')]));if(_0xb0cb0f[_0x1250('0x3d')][_0x1250('0x25')]){_0xd61619[_0x1250('0x3b')]=_[_0x1250('0x50')](_0xd61619['where'],{'$or':_[_0x1250('0x27')](_0xd61619[_0x1250('0x42')],function(_0x57220d){var _0x1594e2={};_0x1594e2[_0x57220d]={'$like':'%'+_0xb0cb0f[_0x1250('0x3d')]['filter']+'%'};return _0x1594e2;})});}_0xd61619=_[_0x1250('0x50')]({},_0xd61619,_0xb0cb0f['options']);return _0x4f9dd5[_0x1250('0xdb')](_0xd61619);}})[_0x1250('0x1c')](function(_0x20f46f){if(_0x20f46f){_0x18f78b=_0x20f46f[_0x1250('0x46')];if(!_0xb0cb0f[_0x1250('0x3d')][_0x1250('0xc1')](_0x1250('0xd5'))){_0xd61619['limit']=qs[_0x1250('0x18')](_0xb0cb0f['query'][_0x1250('0x18')]);_0xd61619[_0x1250('0x16')]=qs['offset'](_0xb0cb0f[_0x1250('0x3d')][_0x1250('0x16')]);}return _0x4f9dd5['getChatInteractions'](_0xd61619);}})[_0x1250('0x1c')](function(_0x4eebfe){if(_0x4eebfe){return _0x4eebfe?{'count':_0x18f78b,'rows':_0x4eebfe}:null;}})[_0x1250('0x1c')](respondWithResult(_0x222880,null))[_0x1250('0x4c')](handleError(_0x222880,null));};exports[_0x1250('0xdd')]=function(_0xdb29f7,_0x34cca6){var _0x1cd782={};var _0x32e46f={};var _0x50b950;var _0x46a4f8;return db[_0x1250('0x3c')][_0x1250('0xbf')]({'where':{'id':_0xdb29f7[_0x1250('0x55')]['id']}})['then'](handleEntityNotFound(_0x34cca6,null))[_0x1250('0x1c')](function(_0x4a1af2){if(_0x4a1af2){_0x50b950=_0x4a1af2;_0x32e46f[_0x1250('0xcb')]=_['keys'](db['OpenchannelInteraction'][_0x1250('0x2f')]);_0x32e46f[_0x1250('0x3d')]=_[_0x1250('0xd2')](_0xdb29f7[_0x1250('0x3d')]);_0x32e46f[_0x1250('0xc9')]=_[_0x1250('0xca')](_0x32e46f['model'],_0x32e46f[_0x1250('0x3d')]);_0x1cd782[_0x1250('0x42')]=_[_0x1250('0xca')](_0x32e46f[_0x1250('0xcb')],qs[_0x1250('0xcc')](_0xdb29f7[_0x1250('0x3d')][_0x1250('0xcc')]));_0x1cd782[_0x1250('0x42')]=_0x1cd782[_0x1250('0x42')]['length']?_0x1cd782['attributes']:_0x32e46f[_0x1250('0xcb')];_0x1cd782[_0x1250('0xcd')]=qs['sort'](_0xdb29f7[_0x1250('0x3d')]['sort']);_0x1cd782['where']=qs[_0x1250('0xc9')](_[_0x1250('0xcf')](_0xdb29f7[_0x1250('0x3d')],_0x32e46f[_0x1250('0xc9')]));if(_0xdb29f7[_0x1250('0x3d')]['filter']){_0x1cd782['where']=_[_0x1250('0x50')](_0x1cd782[_0x1250('0x3b')],{'$or':_[_0x1250('0x27')](_0x1cd782[_0x1250('0x42')],function(_0xe8f056){var _0x2d54fc={};_0x2d54fc[_0xe8f056]={'$like':'%'+_0xdb29f7[_0x1250('0x3d')][_0x1250('0x25')]+'%'};return _0x2d54fc;})});}_0x1cd782=_[_0x1250('0x50')]({},_0x1cd782,_0xdb29f7[_0x1250('0x51')]);return _0x50b950[_0x1250('0xdd')](_0x1cd782);}})[_0x1250('0x1c')](function(_0x4a84f9){if(_0x4a84f9){_0x46a4f8=_0x4a84f9['length'];if(!_0xdb29f7[_0x1250('0x3d')]['hasOwnProperty'](_0x1250('0xd5'))){_0x1cd782[_0x1250('0x18')]=qs[_0x1250('0x18')](_0xdb29f7[_0x1250('0x3d')]['limit']);_0x1cd782['offset']=qs['offset'](_0xdb29f7[_0x1250('0x3d')][_0x1250('0x16')]);}return _0x50b950[_0x1250('0xdd')](_0x1cd782);}})['then'](function(_0x5a1d5c){if(_0x5a1d5c){return _0x5a1d5c?{'count':_0x46a4f8,'rows':_0x5a1d5c}:null;}})[_0x1250('0x1c')](respondWithResult(_0x34cca6,null))[_0x1250('0x4c')](handleError(_0x34cca6,null));};exports[_0x1250('0xde')]=function(_0x32ad63,_0x28496d){var _0x1c3da0={'raw':!![],'where':{}};var _0x140f9={};var _0x2fc29d={'count':0x0,'rows':[]};return db[_0x1250('0x3c')][_0x1250('0xbf')]({'where':{'id':_0x32ad63[_0x1250('0x55')]['id']}})[_0x1250('0x1c')](handleEntityNotFound(_0x28496d,null))[_0x1250('0x1c')](function(_0xadf9c9){if(_0xadf9c9){_0x140f9[_0x1250('0xcb')]=_['keys'](db[_0x1250('0xdf')]['rawAttributes']);_0x140f9[_0x1250('0x3d')]=_[_0x1250('0xd2')](_0x32ad63[_0x1250('0x3d')]);_0x140f9[_0x1250('0xc9')]=_[_0x1250('0xca')](_0x140f9['model'],_0x140f9[_0x1250('0x3d')]);_0x1c3da0[_0x1250('0x42')]=_['intersection'](_0x140f9[_0x1250('0xcb')],qs[_0x1250('0xcc')](_0x32ad63[_0x1250('0x3d')][_0x1250('0xcc')]));_0x1c3da0[_0x1250('0x42')]=_0x1c3da0[_0x1250('0x42')][_0x1250('0x46')]?_0x1c3da0[_0x1250('0x42')]:_0x140f9['model'];if(!_0x32ad63[_0x1250('0x3d')][_0x1250('0xc1')]('nolimit')){_0x1c3da0[_0x1250('0x18')]=qs[_0x1250('0x18')](_0x32ad63[_0x1250('0x3d')][_0x1250('0x18')]);_0x1c3da0[_0x1250('0x16')]=qs[_0x1250('0x16')](_0x32ad63[_0x1250('0x3d')]['offset']);}_0x1c3da0[_0x1250('0xcd')]=qs[_0x1250('0xce')](_0x32ad63[_0x1250('0x3d')][_0x1250('0xce')]);_0x1c3da0[_0x1250('0x3b')]=qs[_0x1250('0xc9')](_[_0x1250('0xcf')](_0x32ad63['query'],_0x140f9['filters']));_0x1c3da0['where']['UserId']=_0xadf9c9['id'];if(_0x32ad63[_0x1250('0x3d')][_0x1250('0x25')]){_0x1c3da0[_0x1250('0x3b')]=_[_0x1250('0x50')](_0x1c3da0[_0x1250('0x3b')],{'$or':_[_0x1250('0x27')](_0x1c3da0[_0x1250('0x42')],function(_0x1663b5){var _0x1d42a3={};_0x1d42a3[_0x1663b5]={'$like':'%'+_0x32ad63[_0x1250('0x3d')][_0x1250('0x25')]+'%'};return _0x1d42a3;})});}_0x1c3da0=_[_0x1250('0x50')]({},_0x1c3da0,_0x32ad63[_0x1250('0x51')]);return db['MailInteraction']['count']({'where':_0x1c3da0['where']})['then'](function(_0x56797c){_0x2fc29d['count']=_0x56797c;if(_0x32ad63[_0x1250('0x3d')][_0x1250('0x3e')]){_0x1c3da0[_0x1250('0x4f')]=[{'all':!![]}];}return db[_0x1250('0xdf')]['findAll'](_0x1c3da0);})[_0x1250('0x1c')](function(_0x2db023){_0x2fc29d[_0x1250('0x45')]=_0x2db023;return _0x2fc29d;});}})[_0x1250('0x1c')](respondWithFilteredResult(_0x28496d,_0x1c3da0))['catch'](handleError(_0x28496d,null));};exports[_0x1250('0xe0')]=function(_0x239f38,_0x116695){var _0x2c59cd={};var _0x13976a={};var _0x95cb32;var _0x40334e;return db[_0x1250('0x3c')]['findOne']({'where':{'id':_0x239f38[_0x1250('0x55')]['id']}})[_0x1250('0x1c')](handleEntityNotFound(_0x116695,null))[_0x1250('0x1c')](function(_0x33ef65){if(_0x33ef65){_0x95cb32=_0x33ef65;_0x13976a[_0x1250('0xcb')]=_[_0x1250('0xd2')](db[_0x1250('0xe1')][_0x1250('0x2f')]);_0x13976a['query']=_['keys'](_0x239f38['query']);_0x13976a['filters']=_[_0x1250('0xca')](_0x13976a[_0x1250('0xcb')],_0x13976a[_0x1250('0x3d')]);_0x2c59cd[_0x1250('0x42')]=_[_0x1250('0xca')](_0x13976a[_0x1250('0xcb')],qs['fields'](_0x239f38[_0x1250('0x3d')][_0x1250('0xcc')]));_0x2c59cd['attributes']=_0x2c59cd[_0x1250('0x42')][_0x1250('0x46')]?_0x2c59cd[_0x1250('0x42')]:_0x13976a['model'];_0x2c59cd[_0x1250('0xcd')]=qs[_0x1250('0xce')](_0x239f38[_0x1250('0x3d')]['sort']);_0x2c59cd['where']=qs['filters'](_[_0x1250('0xcf')](_0x239f38[_0x1250('0x3d')],_0x13976a['filters']));if(_0x239f38[_0x1250('0x3d')][_0x1250('0x25')]){_0x2c59cd[_0x1250('0x3b')]=_[_0x1250('0x50')](_0x2c59cd[_0x1250('0x3b')],{'$or':_['map'](_0x2c59cd['attributes'],function(_0x5695b7){var _0x76ef99={};_0x76ef99[_0x5695b7]={'$like':'%'+_0x239f38[_0x1250('0x3d')]['filter']+'%'};return _0x76ef99;})});}_0x2c59cd=_[_0x1250('0x50')]({},_0x2c59cd,_0x239f38[_0x1250('0x51')]);return _0x95cb32[_0x1250('0xe0')](_0x2c59cd);}})[_0x1250('0x1c')](function(_0xafbf94){if(_0xafbf94){_0x40334e=_0xafbf94[_0x1250('0x46')];if(!_0x239f38[_0x1250('0x3d')][_0x1250('0xc1')](_0x1250('0xd5'))){_0x2c59cd[_0x1250('0x18')]=qs['limit'](_0x239f38[_0x1250('0x3d')][_0x1250('0x18')]);_0x2c59cd[_0x1250('0x16')]=qs[_0x1250('0x16')](_0x239f38[_0x1250('0x3d')][_0x1250('0x16')]);}return _0x95cb32[_0x1250('0xe0')](_0x2c59cd);}})[_0x1250('0x1c')](function(_0x41e1ab){if(_0x41e1ab){return _0x41e1ab?{'count':_0x40334e,'rows':_0x41e1ab}:null;}})[_0x1250('0x1c')](respondWithResult(_0x116695,null))[_0x1250('0x4c')](handleError(_0x116695,null));};exports[_0x1250('0xe2')]=function(_0x42a546,_0x4863ef){var _0x3ef493={};var _0x4808f1={};var _0x19d8c5;var _0x3f0f7b;return db[_0x1250('0x3c')]['findOne']({'where':{'id':_0x42a546[_0x1250('0x55')]['id']}})[_0x1250('0x1c')](handleEntityNotFound(_0x4863ef,null))[_0x1250('0x1c')](function(_0x1a78dc){if(_0x1a78dc){_0x19d8c5=_0x1a78dc;_0x4808f1[_0x1250('0xcb')]=_[_0x1250('0xd2')](db[_0x1250('0xe3')][_0x1250('0x2f')]);_0x4808f1['query']=_[_0x1250('0xd2')](_0x42a546[_0x1250('0x3d')]);_0x4808f1[_0x1250('0xc9')]=_[_0x1250('0xca')](_0x4808f1['model'],_0x4808f1[_0x1250('0x3d')]);_0x3ef493['attributes']=_[_0x1250('0xca')](_0x4808f1[_0x1250('0xcb')],qs['fields'](_0x42a546[_0x1250('0x3d')][_0x1250('0xcc')]));_0x3ef493[_0x1250('0x42')]=_0x3ef493[_0x1250('0x42')]['length']?_0x3ef493[_0x1250('0x42')]:_0x4808f1[_0x1250('0xcb')];_0x3ef493[_0x1250('0xcd')]=qs['sort'](_0x42a546[_0x1250('0x3d')]['sort']);_0x3ef493[_0x1250('0x3b')]=qs['filters'](_[_0x1250('0xcf')](_0x42a546[_0x1250('0x3d')],_0x4808f1[_0x1250('0xc9')]));if(_0x42a546[_0x1250('0x3d')]['filter']){_0x3ef493[_0x1250('0x3b')]=_[_0x1250('0x50')](_0x3ef493[_0x1250('0x3b')],{'$or':_[_0x1250('0x27')](_0x3ef493[_0x1250('0x42')],function(_0x4a9efa){var _0x160229={};_0x160229[_0x4a9efa]={'$like':'%'+_0x42a546[_0x1250('0x3d')][_0x1250('0x25')]+'%'};return _0x160229;})});}_0x3ef493=_[_0x1250('0x50')]({},_0x3ef493,_0x42a546[_0x1250('0x51')]);return _0x19d8c5[_0x1250('0xe2')](_0x3ef493);}})[_0x1250('0x1c')](function(_0x43c0ff){if(_0x43c0ff){_0x3f0f7b=_0x43c0ff[_0x1250('0x46')];if(!_0x42a546[_0x1250('0x3d')]['hasOwnProperty'](_0x1250('0xd5'))){_0x3ef493[_0x1250('0x18')]=qs[_0x1250('0x18')](_0x42a546[_0x1250('0x3d')]['limit']);_0x3ef493[_0x1250('0x16')]=qs['offset'](_0x42a546[_0x1250('0x3d')][_0x1250('0x16')]);}return _0x19d8c5[_0x1250('0xe2')](_0x3ef493);}})['then'](function(_0x505f43){if(_0x505f43){return _0x505f43?{'count':_0x3f0f7b,'rows':_0x505f43}:null;}})[_0x1250('0x1c')](respondWithResult(_0x4863ef,null))[_0x1250('0x4c')](handleError(_0x4863ef,null));};exports[_0x1250('0xe4')]=function(_0x1b0916,_0x5404cc){var _0x3a1139={};var _0x2c9ee9={};var _0x8e360f;var _0x172909;return db[_0x1250('0x3c')][_0x1250('0xbf')]({'where':{'id':_0x1b0916[_0x1250('0x55')]['id']}})[_0x1250('0x1c')](handleEntityNotFound(_0x5404cc,null))['then'](function(_0x2d0ee2){if(_0x2d0ee2){_0x8e360f=_0x2d0ee2;_0x2c9ee9[_0x1250('0xcb')]=_['keys'](db[_0x1250('0xe5')]['rawAttributes']);_0x2c9ee9['query']=_['keys'](_0x1b0916[_0x1250('0x3d')]);_0x2c9ee9['filters']=_[_0x1250('0xca')](_0x2c9ee9['model'],_0x2c9ee9[_0x1250('0x3d')]);_0x3a1139['attributes']=_['intersection'](_0x2c9ee9[_0x1250('0xcb')],qs[_0x1250('0xcc')](_0x1b0916['query'][_0x1250('0xcc')]));_0x3a1139[_0x1250('0x42')]=_0x3a1139['attributes'][_0x1250('0x46')]?_0x3a1139['attributes']:_0x2c9ee9[_0x1250('0xcb')];_0x3a1139[_0x1250('0xcd')]=qs[_0x1250('0xce')](_0x1b0916[_0x1250('0x3d')][_0x1250('0xce')]);_0x3a1139[_0x1250('0x3b')]=qs[_0x1250('0xc9')](_[_0x1250('0xcf')](_0x1b0916['query'],_0x2c9ee9[_0x1250('0xc9')]));if(_0x1b0916[_0x1250('0x3d')]['filter']){_0x3a1139[_0x1250('0x3b')]=_[_0x1250('0x50')](_0x3a1139['where'],{'$or':_[_0x1250('0x27')](_0x3a1139[_0x1250('0x42')],function(_0xf4f9c5){var _0x47c7b5={};_0x47c7b5[_0xf4f9c5]={'$like':'%'+_0x1b0916['query'][_0x1250('0x25')]+'%'};return _0x47c7b5;})});}_0x3a1139=_['merge']({},_0x3a1139,_0x1b0916[_0x1250('0x51')]);return _0x8e360f['getWhatsappInteractions'](_0x3a1139);}})[_0x1250('0x1c')](function(_0x103e1e){if(_0x103e1e){_0x172909=_0x103e1e[_0x1250('0x46')];if(!_0x1b0916[_0x1250('0x3d')][_0x1250('0xc1')](_0x1250('0xd5'))){_0x3a1139[_0x1250('0x18')]=qs[_0x1250('0x18')](_0x1b0916[_0x1250('0x3d')][_0x1250('0x18')]);_0x3a1139[_0x1250('0x16')]=qs[_0x1250('0x16')](_0x1b0916['query'][_0x1250('0x16')]);}return _0x8e360f['getWhatsappInteractions'](_0x3a1139);}})[_0x1250('0x1c')](function(_0x1164c0){if(_0x1164c0){return _0x1164c0?{'count':_0x172909,'rows':_0x1164c0}:null;}})[_0x1250('0x1c')](respondWithResult(_0x5404cc,null))[_0x1250('0x4c')](handleError(_0x5404cc,null));};exports[_0x1250('0xe6')]=function(_0x500bb2,_0x38ac2c,_0x2d694e){var _0x30f264;var _0x21f3ef;var _0x155e65;var _0x5095e1=!_['isNil'](_0x500bb2[_0x1250('0x55')]['id'])?_0x500bb2[_0x1250('0x55')]['id']:!_[_0x1250('0x62')](_0x500bb2['user']['id'])?_0x500bb2[_0x1250('0x73')]['id']:null;return db[_0x1250('0x3c')][_0x1250('0x2a')]({'where':{'id':_0x5095e1,'role':{'$or':[_0x1250('0x75'),_0x1250('0x73'),_0x1250('0x23')]}},'attributes':['id',_0x1250('0x39'),_0x1250('0xe7'),_0x1250('0xe8'),_0x1250('0x1d'),_0x1250('0x5a'),_0x1250('0xe9')]})[_0x1250('0x1c')](function(_0x4cf436){if(_0x4cf436){if(_0x4cf436[_0x1250('0x1d')]===_0x1250('0x23')){_0x30f264=_0x4cf436;if(_0x500bb2[_0x1250('0x54')][_0x1250('0x98')]){_0x155e65=util['format'](_0x1250('0xea'),_0x30f264[_0x500bb2['body'][_0x1250('0x98')]]);}else if(_0x500bb2['body']['intrf']){_0x155e65=util['format'](_0x1250('0xeb'),_0x500bb2[_0x1250('0x54')][_0x1250('0xec')]);}else{_0x155e65=util[_0x1250('0xa3')](_0x1250('0xeb'),_0x30f264[_0x1250('0x39')]);}socket['to'](util['format'](_0x1250('0xed'),_0x30f264[_0x1250('0x39')]))[_0x1250('0x1e')](_0x1250('0xee'),{'user':{'id':_0x30f264['id'],'name':_0x30f264[_0x1250('0x39')]},'ip':_0x500bb2[_0x1250('0xef')][_0x1250('0xf0')]||_0x500bb2[_0x1250('0xf1')][_0x1250('0xf2')]||_0x500bb2[_0x1250('0xf3')][_0x1250('0xf2')]||_0x500bb2[_0x1250('0xf1')][_0x1250('0xf3')]['remoteAddress']});return db[_0x1250('0xa5')][_0x1250('0x20')]({'where':{'membername':_0x30f264[_0x1250('0x39')]},'individualHooks':!![]});}}else{throw new db['Sequelize'][(_0x1250('0x87'))](_0x1250('0xf4'));}})[_0x1250('0x1c')](function(){if(_0x30f264){return _0x30f264[_0x1250('0xf5')]({'raw':!![]});}})[_0x1250('0x1c')](function(_0xe0dd47){if(_0x30f264){if(_0xe0dd47){_0x21f3ef=_0xe0dd47;if(_0x21f3ef[_0x1250('0x46')]){var _0x40475e=_0x21f3ef[_0x1250('0x27')](function(_0x186e8f){var _0x76f26a={'membername':_0x30f264[_0x1250('0x39')],'UserId':_0x30f264['id'],'queue_name':_0x186e8f[_0x1250('0x39')],'VoiceQueueId':_0x186e8f['id'],'interface':_0x155e65,'paused':_0x30f264[_0x1250('0xe9')]||![],'penalty':_0x186e8f['UserVoiceQueue.penalty']||0x0};return db['UserVoiceQueueRt'][_0x1250('0xa6')](_0x76f26a);});return Promise[_0x1250('0x4b')](_0x40475e);}}}})[_0x1250('0x1c')](function(){if(_0x30f264){return db[_0x1250('0xf6')][_0x1250('0x82')]({'where':{'membername':_0x30f264[_0x1250('0x39')],'exitAt':null}});}})[_0x1250('0x1c')](function(_0x11545c){if(_0x30f264){var _0x109648=[];_0x11545c[_0x1250('0xf7')](function(_0x19dfa5){_0x109648['push'](_0x19dfa5[_0x1250('0x1b')]({'exitAt':moment()[_0x1250('0xa3')]('YYYY-MM-DD\x20HH:mm:ss')}));});return Promise[_0x1250('0x4b')](_0x109648);}})[_0x1250('0x1c')](function(){if(_0x30f264){var _0x5894f8=[];var _0x4ea56f=[];var _0x2e63bf=utils[_0x1250('0xf8')]();var _0x20d1f6={'membername':_0x30f264[_0x1250('0x39')],'interface':_0x155e65,'enterAt':moment()['format'](_0x1250('0xf9')),'role':_0x30f264[_0x1250('0x1d')],'internal':_0x30f264['internal']};_0x2e63bf[_0x1250('0xf7')](function(_0x38f333){_0x5894f8[_0x1250('0x43')](_[_0x1250('0x50')]({'channel':_0x38f333,'type':_0x1250('0xfa'),'data1':_0x500bb2['body'][_0x1250('0xfb')],'data2':_0x155e65},_0x20d1f6));if(_0x30f264[_0x1250('0xe9')]){_0x4ea56f[_0x1250('0x43')](_[_0x1250('0x50')]({'channel':_0x38f333,'type':'PAUSE','data1':_0x1250('0xfc')},_0x20d1f6));}});return db[_0x1250('0xf6')][_0x1250('0x7d')](_0x5894f8[_0x1250('0xbe')](_0x4ea56f),{'individualHooks':!![]});}})[_0x1250('0x1c')](function(){if(_0x30f264){return _0x30f264[_0x1250('0x1b')]({'online':!![],'lastLoginAt':moment()[_0x1250('0xa3')](_0x1250('0xf9')),'voicePause':_0x30f264[_0x1250('0xe9')]||![],'mailPause':_0x30f264['loginInPause']||![],'chatPause':_0x30f264[_0x1250('0xe9')]||![],'faxPause':_0x30f264[_0x1250('0xe9')]||![],'smsPause':_0x30f264['loginInPause']||![],'openchannelPause':_0x30f264[_0x1250('0xe9')]||![],'whatsappPause':_0x30f264['loginInPause']||![],'pauseType':_0x30f264[_0x1250('0xe9')]?_0x1250('0xfc'):null,'interface':_0x155e65,'lastPauseAt':moment()[_0x1250('0xa3')](_0x1250('0xf9'))});}})[_0x1250('0x1c')](function(_0x1056db){if(_0x500bb2[_0x1250('0xfd')]){return _0x2d694e();}else{return Promise['resolve'](_0x1056db)[_0x1250('0x1c')](respondWithResult(_0x38ac2c,null));}})[_0x1250('0x4c')](handleError(_0x38ac2c,null));};exports[_0x1250('0xfe')]=function(_0x305f4b,_0x10b2a1){var _0x2865f9;return db[_0x1250('0x3c')][_0x1250('0x2a')]({'where':{'id':_0x305f4b['params']['id'],'role':_0x1250('0x23')},'attributes':['id',_0x1250('0x39'),_0x1250('0x1d')]})[_0x1250('0x1c')](handleEntityNotFound(_0x10b2a1,null))[_0x1250('0x1c')](function(_0x2ddd57){if(_0x2ddd57){_0x2865f9=_0x2ddd57;return db[_0x1250('0xa5')][_0x1250('0x20')]({'where':{'membername':_0x2865f9[_0x1250('0x39')]},'individualHooks':!![]});}})['then'](function(){return db[_0x1250('0xf6')][_0x1250('0x82')]({'where':{'membername':_0x2865f9[_0x1250('0x39')],'exitAt':null}});})[_0x1250('0x1c')](function(_0xba551a){var _0x436e81=[];_0xba551a[_0x1250('0xf7')](function(_0x7feb67){_0x436e81[_0x1250('0x43')](_0x7feb67[_0x1250('0x1b')]({'exitAt':moment()[_0x1250('0xa3')](_0x1250('0xf9'))}));});return Promise['all'](_0x436e81);})[_0x1250('0x1c')](function(){return _0x2865f9[_0x1250('0x1b')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x1250('0x1c')](respondWithResult(_0x10b2a1,null))[_0x1250('0x4c')](handleError(_0x10b2a1,null));};exports[_0x1250('0xff')]=function(_0x3e0abd,_0x4fe6ca){var _0x468bc7;return db['UserVoiceQueueRt'][_0x1250('0x1b')]({'paused':0x1},{'where':{'UserId':_0x3e0abd[_0x1250('0x55')]['id']},'individualHooks':!![]})[_0x1250('0x1c')](function(){return db[_0x1250('0x3c')][_0x1250('0x2a')]({'where':{'id':_0x3e0abd['params']['id'],'role':_0x1250('0x23')},'attributes':['id',_0x1250('0x39'),'role',_0x1250('0x5a'),_0x1250('0x98'),'online']});})[_0x1250('0x1c')](handleEntityNotFound(_0x4fe6ca,null))['then'](function(_0x2e52e4){if(_0x2e52e4){_0x468bc7=_0x2e52e4;return db[_0x1250('0xf6')][_0x1250('0x82')]({'where':{'membername':_0x468bc7[_0x1250('0x39')],'type':_0x1250('0x100'),'exitAt':null}});}})[_0x1250('0x1c')](function(_0x2cfef6){if(_0x2cfef6[_0x1250('0x46')]){var _0x375348=moment()['format'](_0x1250('0xf9'));for(var _0x49e8a7=0x0,_0x5a7693=_0x2cfef6['length'];_0x49e8a7<_0x5a7693;_0x49e8a7++){_0x2cfef6[_0x49e8a7][_0x1250('0x101')]({'exitAt':_0x375348});}}})['then'](function(){var _0x4cd4d2=[];var _0x19e940=utils[_0x1250('0xf8')]();_0x19e940[_0x1250('0xf7')](function(_0xd94908){_0x4cd4d2[_0x1250('0x43')]({'channel':_0xd94908,'membername':_0x468bc7[_0x1250('0x39')],'interface':_[_0x1250('0x62')](_0x468bc7[_0x1250('0x98')])?util[_0x1250('0xa3')](_0x1250('0xeb'),_0x468bc7[_0x1250('0x39')]):_0x468bc7[_0x1250('0x98')],'type':_0x1250('0x100'),'enterAt':moment()[_0x1250('0xa3')](_0x1250('0xf9')),'data1':_0x3e0abd[_0x1250('0x54')][_0x1250('0x31')]||_0x1250('0x102'),'role':_0x468bc7[_0x1250('0x1d')],'internal':_0x468bc7[_0x1250('0x5a')]});});return db['MemberReport'][_0x1250('0x7d')](_0x4cd4d2,{'individualHooks':!![]});})[_0x1250('0x1c')](function(){return _0x468bc7[_0x1250('0x1b')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x3e0abd[_0x1250('0x54')][_0x1250('0x31')]||_0x1250('0x102'),'lastPauseAt':moment()[_0x1250('0xa3')](_0x1250('0xf9'))});})['then'](respondWithResult(_0x4fe6ca,null))['catch'](handleError(_0x4fe6ca,null));};exports[_0x1250('0x103')]=function(_0x27ca11,_0x417b73){if(_0x27ca11[_0x1250('0x54')][_0x1250('0x95')]&&!utils[_0x1250('0x99')](_0x27ca11[_0x1250('0x54')][_0x1250('0x95')])){throw new APIBadRequestError(util[_0x1250('0xa3')](_0x1250('0x104'),_0x27ca11[_0x1250('0x54')]['channel']));}return db[_0x1250('0x3c')]['find']({'where':{'id':_0x27ca11[_0x1250('0x55')]['id']},'attributes':['id',_0x1250('0x39'),_0x1250('0x1d'),_0x1250('0x5a'),_0x1250('0x98'),'online',_0x1250('0x97'),_0x1250('0x105'),'chatPause','faxPause',_0x1250('0x106'),'smsPause','whatsappPause',_0x1250('0x107'),_0x1250('0x108')]})['then'](function(_0x25087d){if(!_0x25087d){throw new APINotFoundError(util[_0x1250('0xa3')](_0x1250('0xc0'),_0x27ca11[_0x1250('0x55')]['id']));}return _0x25087d[_0x1250('0x103')](_0x27ca11['body']['channel']);})[_0x1250('0x1c')](respondWithResult(_0x417b73,null))['catch'](APIHandleError(_0x417b73));};exports[_0x1250('0x109')]=function(_0x31a73a,_0x1ac7f7){var _0x2a0382={};var _0x4d7af1={};var _0x4f2823;var _0x52c11b;return db[_0x1250('0x3c')][_0x1250('0xbf')]({'where':{'id':_0x31a73a['params']['id']}})['then'](handleEntityNotFound(_0x1ac7f7,null))[_0x1250('0x1c')](function(_0x54d51a){if(_0x54d51a){_0x4f2823=_0x54d51a;_0x4d7af1[_0x1250('0xcb')]=_[_0x1250('0xd2')](db[_0x1250('0x10a')]['rawAttributes']);_0x4d7af1['query']=_['keys'](_0x31a73a[_0x1250('0x3d')]);_0x4d7af1[_0x1250('0xc9')]=_[_0x1250('0xca')](_0x4d7af1[_0x1250('0xcb')],_0x4d7af1[_0x1250('0x3d')]);_0x2a0382['attributes']=_[_0x1250('0xca')](_0x4d7af1[_0x1250('0xcb')],qs[_0x1250('0xcc')](_0x31a73a[_0x1250('0x3d')][_0x1250('0xcc')]));_0x2a0382[_0x1250('0x42')]=_0x2a0382[_0x1250('0x42')][_0x1250('0x46')]?_0x2a0382[_0x1250('0x42')]:_0x4d7af1[_0x1250('0xcb')];_0x2a0382['order']=qs[_0x1250('0xce')](_0x31a73a[_0x1250('0x3d')][_0x1250('0xce')]);_0x2a0382[_0x1250('0x3b')]=qs['filters'](_[_0x1250('0xcf')](_0x31a73a[_0x1250('0x3d')],_0x4d7af1[_0x1250('0xc9')]));if(_0x31a73a[_0x1250('0x3d')][_0x1250('0x25')]){_0x2a0382[_0x1250('0x3b')]=_[_0x1250('0x50')](_0x2a0382[_0x1250('0x3b')],{'$or':_['map'](_0x2a0382[_0x1250('0x42')],function(_0x5223e1){var _0x5aad72={};_0x5aad72[_0x5223e1]={'$like':'%'+_0x31a73a['query']['filter']+'%'};return _0x5aad72;})});}_0x2a0382=_[_0x1250('0x50')]({},_0x2a0382,_0x31a73a['options']);return _0x4f2823[_0x1250('0x109')](_0x2a0382);}})[_0x1250('0x1c')](function(_0x421950){if(_0x421950){_0x52c11b=_0x421950[_0x1250('0x46')];if(!_0x31a73a[_0x1250('0x3d')][_0x1250('0xc1')](_0x1250('0xd5'))){_0x2a0382[_0x1250('0x18')]=qs[_0x1250('0x18')](_0x31a73a[_0x1250('0x3d')][_0x1250('0x18')]);_0x2a0382[_0x1250('0x16')]=qs['offset'](_0x31a73a[_0x1250('0x3d')][_0x1250('0x16')]);}return _0x4f2823['getTeams'](_0x2a0382);}})[_0x1250('0x1c')](function(_0x2ab303){if(_0x2ab303){return _0x2ab303?{'count':_0x52c11b,'rows':_0x2ab303}:null;}})[_0x1250('0x1c')](respondWithResult(_0x1ac7f7,null))[_0x1250('0x4c')](handleError(_0x1ac7f7,null));};exports[_0x1250('0x10b')]=function(_0x3f6ba1,_0x3b23e2){var _0x410924=_0x3f6ba1['params']['id'];var _0x55e703=_0x3f6ba1['body']?_0x3f6ba1['body'][_0x1250('0x59')]:null;var _0x3d2bd3=[];return Promise[_0x1250('0x10c')]()[_0x1250('0x1c')](function(){if(!_0x55e703)throw new APIBadRequestError('Body\x20parameter\x20\x27ids\x27\x20is\x20required');})[_0x1250('0x1c')](function(){return db[_0x1250('0x3c')]['findOne']({'where':{'id':_0x410924}});})[_0x1250('0x1c')](function(_0x28f5b5){if(!_0x28f5b5)throw new APINotFoundError(util[_0x1250('0xa3')](_0x1250('0xc0'),_0x3f6ba1[_0x1250('0x55')]['id']));return db[_0x1250('0x5f')][_0x1250('0x10d')](function(_0x2c89ed){return _0x28f5b5[_0x1250('0x10b')](_0x55e703,{'transaction':_0x2c89ed})['then'](function(){return db[_0x1250('0x10a')][_0x1250('0x82')]({'where':{'id':{'$in':_0x55e703}}});})['then'](function(_0x3f8a1d){var _0x2c1885=_['map'](_0x3f8a1d,function(_0x1d7184){return _0x1d7184[_0x1250('0x10e')]();});return Promise[_0x1250('0x4b')](_0x2c1885);})[_0x1250('0x1c')](function(_0x4b6143){_0x3d2bd3=_[_0x1250('0x10f')](_0x4b6143);var _0x164808=_[_0x1250('0x27')](_0x3d2bd3,function(_0x2b8a61){return _0x2b8a61[_0x1250('0x110')](_0x28f5b5['id'],{'transaction':_0x2c89ed});});return Promise[_0x1250('0x4b')](_0x164808);})[_0x1250('0x1c')](function(){if(!_0x28f5b5['online'])return;var _0x162ec1=_[_0x1250('0x25')](_0x3d2bd3,function(_0x501037){return _0x501037['getDataValue'](_0x1250('0x95'))===_0x1250('0x111');});var _0x10ae91=_['map'](_0x162ec1,function(_0x410c99){return db[_0x1250('0xa5')][_0x1250('0xa6')]({'membername':_0x28f5b5['name'],'UserId':_0x28f5b5['id'],'queue_name':_0x410c99[_0x1250('0x39')],'VoiceQueueId':_0x410c99['id'],'interface':_[_0x1250('0x62')](_0x28f5b5[_0x1250('0x98')])?util[_0x1250('0xa3')](_0x1250('0xeb'),_0x28f5b5[_0x1250('0x39')]):_0x28f5b5[_0x1250('0x98')],'paused':_0x28f5b5[_0x1250('0x97')]||![],'penalty':_0x28f5b5[_0x1250('0xa4')]},{'transaction':_0x2c89ed});});return Promise[_0x1250('0x4b')](_0x10ae91);})[_0x1250('0x1c')](function(){return db[_0x1250('0x112')][_0x1250('0x82')]({'where':{'teamId':{'$in':_0x55e703}}});})['then'](function(_0x270495){var _0x37d26f=_['map'](_0x270495,function(_0x3b4401){return db[_0x1250('0x113')][_0x1250('0x72')]({'UserId':_0x28f5b5['id'],'VoicePrefixId':_0x3b4401[_0x1250('0x114')]},{'transaction':_0x2c89ed});});return Promise[_0x1250('0x4b')](_0x37d26f);});});})[_0x1250('0x1c')](function(){for(var _0x46da31=0x0;_0x46da31<_0x3d2bd3[_0x1250('0x46')];_0x46da31++){var _0x45c776=_0x3d2bd3[_0x46da31][_0x1250('0x115')](_0x1250('0x95'));var _0x22b48e=_0x45c776+'QueueId';socket[_0x1250('0x1e')](_0x1250('0x73')+_0x45c776+'Queue:save',{'UserId':_0x410924,['queueField']:_0x3d2bd3[_0x46da31]['id']});}})[_0x1250('0x1c')](respondWithStatusCode(_0x3b23e2,null))[_0x1250('0x4c')](APIHandleError(_0x3b23e2));};exports[_0x1250('0x116')]=function(_0x4d4885,_0x45b2c2){var _0x538505=_0x4d4885['params']['id'];var _0x245788=null;if(_0x4d4885[_0x1250('0x3d')][_0x1250('0x59')]){_0x245788=_['isArray'](_0x4d4885[_0x1250('0x3d')][_0x1250('0x59')])?_0x4d4885['query'][_0x1250('0x59')]:[_0x4d4885[_0x1250('0x3d')][_0x1250('0x59')]];}var _0x4d0da5=[];return Promise['resolve']()[_0x1250('0x1c')](function(){if(!_0x245788)throw new APIBadRequestError(_0x1250('0x117'));})[_0x1250('0x1c')](function(){return db[_0x1250('0x3c')][_0x1250('0xbf')]({'where':{'id':_0x538505}});})['then'](function(_0x35e0e9){if(!_0x35e0e9)throw new APINotFoundError(util[_0x1250('0xa3')](_0x1250('0xc0'),_0x4d4885['params']['id']));return db['sequelize'][_0x1250('0x10d')](function(_0x546462){return _0x35e0e9[_0x1250('0x116')](_0x245788,{'transaction':_0x546462})[_0x1250('0x1c')](function(){return db[_0x1250('0x10a')]['findAll']({'where':{'id':{'$in':_0x245788}}});})[_0x1250('0x1c')](function(_0x1668b9){var _0x29fa40=_[_0x1250('0x27')](_0x1668b9,function(_0x42061a){return _0x42061a['getAssociatedQueues']();});return Promise[_0x1250('0x4b')](_0x29fa40);})[_0x1250('0x1c')](function(_0x49a0cd){_0x4d0da5=_['flattenDeep'](_0x49a0cd);var _0x24e171=_[_0x1250('0x27')](_0x4d0da5,function(_0x5f0615){return _0x5f0615['removeAgent'](_0x35e0e9['id'],{'transaction':_0x546462});});return Promise[_0x1250('0x4b')](_0x24e171);})[_0x1250('0x1c')](function(){if(!_0x35e0e9[_0x1250('0x96')])return;var _0x2c8b23=_[_0x1250('0x25')](_0x4d0da5,function(_0x480cce){return _0x480cce[_0x1250('0x115')]('channel')===_0x1250('0x111');});var _0xacf293=_[_0x1250('0x27')](_0x2c8b23,function(_0x744f95){return db[_0x1250('0xa5')][_0x1250('0x20')]({'where':{'VoiceQueueId':_0x744f95['id'],'UserId':_0x35e0e9['id']},'transaction':_0x546462});});return Promise[_0x1250('0x4b')](_0xacf293);})[_0x1250('0x1c')](function(){return db[_0x1250('0x112')][_0x1250('0x82')]({'where':{'teamId':{'$in':_0x245788}}});})[_0x1250('0x1c')](function(_0x1f7c64){var _0x200253=_[_0x1250('0x27')](_0x1f7c64,function(_0x31047f){return db[_0x1250('0x113')][_0x1250('0x20')]({'where':{'UserId':_0x35e0e9['id'],'VoicePrefixId':_0x31047f[_0x1250('0x114')]}},{'transaction':_0x546462});});return Promise[_0x1250('0x4b')](_0x200253);});});})['then'](function(){for(var _0x3af171=0x0;_0x3af171<_0x4d0da5[_0x1250('0x46')];_0x3af171++){var _0x2bef06=_0x4d0da5[_0x3af171][_0x1250('0x115')](_0x1250('0x95'));var _0x211d92=_0x2bef06+_0x1250('0xa0');socket[_0x1250('0x1e')](_0x1250('0x73')+_0x2bef06+_0x1250('0x118'),{'UserId':_0x538505,['queueField']:_0x4d0da5[_0x3af171]['id']});}})[_0x1250('0x1c')](respondWithStatusCode(_0x45b2c2,null))[_0x1250('0x4c')](APIHandleError(_0x45b2c2));};exports['getLists']=function(_0x338e3b,_0x2d5c8c){var _0xb14ee1={};var _0x3ad7fb={};var _0x3a5fd9;var _0x3863dd;return db[_0x1250('0x3c')]['findOne']({'where':{'id':_0x338e3b['params']['id']}})['then'](handleEntityNotFound(_0x2d5c8c,null))[_0x1250('0x1c')](function(_0x4da979){if(_0x4da979){_0x3a5fd9=_0x4da979;_0x3ad7fb[_0x1250('0xcb')]=_['keys'](db['CmList'][_0x1250('0x2f')]);_0x3ad7fb[_0x1250('0x3d')]=_[_0x1250('0xd2')](_0x338e3b[_0x1250('0x3d')]);_0x3ad7fb[_0x1250('0xc9')]=_['intersection'](_0x3ad7fb[_0x1250('0xcb')],_0x3ad7fb[_0x1250('0x3d')]);_0xb14ee1[_0x1250('0x42')]=_[_0x1250('0xca')](_0x3ad7fb['model'],qs[_0x1250('0xcc')](_0x338e3b[_0x1250('0x3d')]['fields']));_0xb14ee1['attributes']=_0xb14ee1[_0x1250('0x42')][_0x1250('0x46')]?_0xb14ee1[_0x1250('0x42')]:_0x3ad7fb[_0x1250('0xcb')];_0xb14ee1[_0x1250('0xcd')]=qs['sort'](_0x338e3b[_0x1250('0x3d')][_0x1250('0xce')]);_0xb14ee1['where']=qs[_0x1250('0xc9')](_[_0x1250('0xcf')](_0x338e3b[_0x1250('0x3d')],_0x3ad7fb[_0x1250('0xc9')]));if(_0x338e3b[_0x1250('0x3d')][_0x1250('0x25')]){_0xb14ee1[_0x1250('0x3b')]=_[_0x1250('0x50')](_0xb14ee1[_0x1250('0x3b')],{'$or':_[_0x1250('0x27')](_0xb14ee1[_0x1250('0x42')],function(_0x582065){var _0x466f12={};_0x466f12[_0x582065]={'$like':'%'+_0x338e3b[_0x1250('0x3d')][_0x1250('0x25')]+'%'};return _0x466f12;})});}_0xb14ee1=_['merge']({},_0xb14ee1,_0x338e3b[_0x1250('0x51')]);return _0x3a5fd9[_0x1250('0x119')](_0xb14ee1);}})[_0x1250('0x1c')](function(_0x9589c8){if(_0x9589c8){_0x3863dd=_0x9589c8[_0x1250('0x46')];if(!_0x338e3b[_0x1250('0x3d')]['hasOwnProperty']('nolimit')){_0xb14ee1['limit']=qs['limit'](_0x338e3b[_0x1250('0x3d')][_0x1250('0x18')]);_0xb14ee1[_0x1250('0x16')]=qs[_0x1250('0x16')](_0x338e3b[_0x1250('0x3d')][_0x1250('0x16')]);}return _0x3a5fd9[_0x1250('0x119')](_0xb14ee1);}})['then'](function(_0x4b9bee){if(_0x4b9bee){return _0x4b9bee?{'count':_0x3863dd,'rows':_0x4b9bee}:null;}})[_0x1250('0x1c')](respondWithResult(_0x2d5c8c,null))[_0x1250('0x4c')](handleError(_0x2d5c8c,null));};exports['getAgents']=function(_0x199083,_0x599c2a){var _0x315320={};var _0x4101e8={};var _0x425e56;return db['User'][_0x1250('0xbf')]({'where':{'id':_0x199083[_0x1250('0x55')]['id']}})[_0x1250('0x1c')](handleEntityNotFound(_0x599c2a,null))[_0x1250('0x1c')](function(_0x3b19ed){if(_0x3b19ed){_0x425e56=_0x3b19ed;_0x4101e8[_0x1250('0xcb')]=_[_0x1250('0xd2')](db['User'][_0x1250('0x2f')]);_0x4101e8[_0x1250('0x3d')]=_[_0x1250('0xd2')](_0x199083[_0x1250('0x3d')]);_0x4101e8[_0x1250('0xc9')]=_[_0x1250('0xca')](_0x4101e8[_0x1250('0xcb')],_0x4101e8['query']);_0x315320['attributes']=_['intersection'](_0x4101e8[_0x1250('0xcb')],qs[_0x1250('0xcc')](_0x199083['query'][_0x1250('0xcc')]));_0x315320[_0x1250('0x42')]=_0x315320[_0x1250('0x42')]['length']?_0x315320[_0x1250('0x42')]:_0x4101e8[_0x1250('0xcb')];_0x315320[_0x1250('0xcd')]=qs[_0x1250('0xce')](_0x199083['query'][_0x1250('0xce')]);_0x315320['where']=qs[_0x1250('0xc9')](_[_0x1250('0xcf')](_0x199083[_0x1250('0x3d')],_0x4101e8['filters']));if(_0x199083[_0x1250('0x3d')][_0x1250('0x25')]){_0x315320[_0x1250('0x3b')]=_[_0x1250('0x50')](_0x315320[_0x1250('0x3b')],{'$or':_[_0x1250('0x27')](_0x315320[_0x1250('0x42')],function(_0x24179d){var _0x10d7ad={};_0x10d7ad[_0x24179d]={'$like':'%'+_0x199083[_0x1250('0x3d')][_0x1250('0x25')]+'%'};return _0x10d7ad;})});}_0x315320[_0x1250('0xcb')]=db[_0x1250('0x3c')];_0x315320['as']=_0x1250('0x22');_0x315320=_['merge']({},_0x315320,_0x199083[_0x1250('0x51')]);return _0x425e56[_0x1250('0xf5')]({'include':[_0x315320]});}})[_0x1250('0x1c')](function(_0x239976){if(_0x239976){var _0x3b293f={},_0x29e1cd=[];for(var _0x2d11a5=0x0;_0x2d11a5<_0x239976[_0x1250('0x46')];_0x2d11a5+=0x1){for(var _0x346998=0x0,_0xe7302;_0x346998<_0x239976[_0x2d11a5][_0x1250('0x22')][_0x1250('0x46')];_0x346998+=0x1){_0xe7302=_0x239976[_0x2d11a5]['Agents'][_0x346998][_0x1250('0x21')]({'plain':!![]});_0x3b293f[_0xe7302['id']]=_0xe7302;}}_0x3b293f=_[_0x1250('0x11a')](_0x3b293f);for(var _0x3e245a=qs[_0x1250('0x16')](_0x199083[_0x1250('0x3d')][_0x1250('0x16')]);_0x3e245a<_0x3b293f['length']&&_0x29e1cd[_0x1250('0x46')]=_0x4dfafd){_0x492cb0=_0x4dfafd;_0xf72960=0xc8;}else{_0xf72960=0xce;}_0x4818e8[_0x5c1f('0x17')](_0xf72960);return _0x4818e8[_0x5c1f('0x1e')](_0x5c1f('0x1f'),_0x223c50+'-'+_0x492cb0+'/'+_0x4dfafd)['json'](_0x45b8cf);}return null;};}function saveUpdates(_0x1aa109){return function(_0x264400){if(_0x264400){return _0x264400['update'](_0x1aa109)['then'](function(_0x10a181){if(_0x10a181[_0x5c1f('0x20')]===_0x5c1f('0x21')){socket[_0x5c1f('0x22')](_0x5c1f('0x23')+_0x10a181['id'],_0x10a181);}return _0x10a181;});}return null;};}function removeEntity(_0x44cd54){return function(_0x21afc8){if(_0x21afc8){return _0x21afc8['destroy']()[_0x5c1f('0x24')](function(){var _0x27e671=_0x21afc8[_0x5c1f('0x25')]({'plain':!![]});if(_0x27e671[_0x5c1f('0x20')]===_0x5c1f('0x26'))return;var _0x2c6df9=[{'name':_0x5c1f('0x27'),'value':'user','ignore':!![]},{'name':_0x5c1f('0x28'),'value':_0x5c1f('0x21'),'ignore':![]},{'name':'Telephones','value':_0x5c1f('0x29'),'ignore':![]}];var _0x2905de=_(_0x2c6df9)[_0x5c1f('0x2a')]('ignore')[_0x5c1f('0x2b')](_0x5c1f('0x2c'))['value']();if(_['includes'](_0x2905de,_0x27e671[_0x5c1f('0x20')])){return;}var _0x1a22b7=_[_0x5c1f('0x2d')](_0x2c6df9,[_0x5c1f('0x2c'),_0x27e671['role']])[_0x5c1f('0x2e')];return db['UserProfileResource']['destroy']({'where':{'type':_0x1a22b7,'resourceId':_0x27e671['id']}})['then'](function(){return _0x21afc8;});})[_0x5c1f('0x24')](function(){_0x44cd54[_0x5c1f('0x17')](0xcc)[_0x5c1f('0x18')]();});}};}function handleEntityNotFound(_0x5dad1d){return function(_0x506168){if(!_0x506168){_0x5dad1d[_0x5c1f('0x16')](0x194);}return _0x506168;};}function handleError(_0x44c017,_0x311ac8){_0x311ac8=_0x311ac8||0x1f4;return function(_0x4165c5){logger[_0x5c1f('0x2f')](_0x4165c5['stack']);if(_0x4165c5[_0x5c1f('0x2e')]){delete _0x4165c5['name'];}_0x44c017[_0x5c1f('0x17')](_0x311ac8)[_0x5c1f('0x30')](_0x4165c5);};}function getUserAttributes(){return _(db['User'][_0x5c1f('0x31')])[_0x5c1f('0x2b')](function(_0x4f8851){return{'name':_0x4f8851['fieldName'],'type':_0x4f8851[_0x5c1f('0x32')][_0x5c1f('0x33')]};})[_0x5c1f('0x2a')](function(_0x2efd19){return![_0x5c1f('0x34'),_0x5c1f('0x35'),_0x5c1f('0x36'),_0x5c1f('0x37'),'resetPasswordExpires',_0x5c1f('0x38')][_0x5c1f('0x39')](_0x2efd19['name']);})[_0x5c1f('0x2c')]();}exports[_0x5c1f('0x3a')]=function(_0x11aba0,_0x389788){var _0x5dc669={},_0x2a98aa={'count':0x0,'rows':[]};var _0x12f835=getUserAttributes();_0x5dc669=qs[_0x5c1f('0x3b')](_0x12f835,_0x11aba0);var _0xc439cf={'where':_0x5dc669[_0x5c1f('0x3c')]};return db['User'][_0x5c1f('0x1d')](_0xc439cf)['then'](function(_0x5209b1){_0x2a98aa['count']=_0x5209b1;if(_0x11aba0['query'][_0x5c1f('0x3d')]){_0x5dc669['include']=[{'all':!![]}];}if(_0x11aba0['query'][_0x5c1f('0x3e')]===_0x5c1f('0x3f')){_0x5dc669[_0x5c1f('0x40')]=[{'model':db[_0x5c1f('0x41')],'as':_0x5c1f('0x3e')}];}if(!_[_0x5c1f('0x39')](_0x5dc669[_0x5c1f('0x42')],'id')){_0x5dc669[_0x5c1f('0x42')][_0x5c1f('0x43')]('id');}return db['User'][_0x5c1f('0x44')](_0x5dc669);})[_0x5c1f('0x24')](function(_0x45581d){_0x2a98aa[_0x5c1f('0x45')]=_0x45581d;if(_0x11aba0[_0x5c1f('0x46')][_0x5c1f('0x47')]==='true'){var _0x3a5348=[];for(var _0x344c69=0x0;_0x344c69<_0x2a98aa['rows'][_0x5c1f('0x48')];_0x344c69++){_0x3a5348['push'](get_open_tabs(_0x5c1f('0x49'),_0x2a98aa[_0x5c1f('0x45')][_0x344c69][_0x5c1f('0x4a')]));_0x3a5348[_0x5c1f('0x43')](get_open_tabs(_0x5c1f('0x4b'),_0x2a98aa['rows'][_0x344c69][_0x5c1f('0x4a')]));_0x3a5348[_0x5c1f('0x43')](get_open_tabs(_0x5c1f('0x4c'),_0x2a98aa['rows'][_0x344c69]['dataValues']));_0x3a5348[_0x5c1f('0x43')](get_open_tabs(_0x5c1f('0x4d'),_0x2a98aa[_0x5c1f('0x45')][_0x344c69][_0x5c1f('0x4a')]));_0x3a5348[_0x5c1f('0x43')](get_open_tabs(_0x5c1f('0x4e'),_0x2a98aa[_0x5c1f('0x45')][_0x344c69]['dataValues']));_0x3a5348[_0x5c1f('0x43')](get_open_tabs(_0x5c1f('0x4f'),_0x2a98aa[_0x5c1f('0x45')][_0x344c69]['dataValues']));}return Promise['all'](_0x3a5348)[_0x5c1f('0x24')](function(){return _0x2a98aa;});}else{return _0x2a98aa;}})['then'](respondWithFilteredResult(_0x389788,_0x5dc669))[_0x5c1f('0x50')](handleError(_0x389788,null));};exports[_0x5c1f('0x51')]=function(_0x35e120,_0x67291){var _0x791c36=getUserAttributes();_0x35e120['query']['id']=_0x35e120[_0x5c1f('0x52')]['id'];var _0x154597=qs[_0x5c1f('0x3b')](_0x791c36,_0x35e120);if(_0x35e120[_0x5c1f('0x46')][_0x5c1f('0x3d')]){_0x154597[_0x5c1f('0x40')]=[{'all':!![]}];}if(_0x35e120['query'][_0x5c1f('0x3e')]==='true'){_0x154597['include']=[{'model':db['UserSetting'],'as':_0x5c1f('0x3e')}];}_0x154597=_[_0x5c1f('0x53')]({},_0x154597,_0x35e120['options']);if(!_[_0x5c1f('0x39')](_0x154597['attributes'],'id')){_0x154597[_0x5c1f('0x42')][_0x5c1f('0x43')]('id');}return db[_0x5c1f('0x54')][_0x5c1f('0x2d')](_0x154597)[_0x5c1f('0x24')](handleEntityNotFound(_0x67291,null))['then'](function(_0x247f35){var _0x2c8a12=[];values=_0x247f35;if(_0x35e120[_0x5c1f('0x46')][_0x5c1f('0x47')]===_0x5c1f('0x3f')){_0x2c8a12[_0x5c1f('0x43')](get_open_tabs(_0x5c1f('0x49'),_0x247f35[_0x5c1f('0x4a')]));_0x2c8a12[_0x5c1f('0x43')](get_open_tabs(_0x5c1f('0x4b'),_0x247f35[_0x5c1f('0x4a')]));_0x2c8a12[_0x5c1f('0x43')](get_open_tabs(_0x5c1f('0x4e'),_0x247f35[_0x5c1f('0x4a')]));_0x2c8a12[_0x5c1f('0x43')](get_open_tabs('whatsapp',_0x247f35['dataValues']));_0x2c8a12[_0x5c1f('0x43')](get_open_tabs(_0x5c1f('0x4c'),_0x247f35['dataValues']));_0x2c8a12[_0x5c1f('0x43')](get_open_tabs(_0x5c1f('0x4d'),_0x247f35[_0x5c1f('0x4a')]));return Promise[_0x5c1f('0x55')](_0x2c8a12);}else{return values;}})['then'](function(){return values;})[_0x5c1f('0x24')](respondWithResult(_0x67291,null))[_0x5c1f('0x50')](handleError(_0x67291,null));};exports[_0x5c1f('0x56')]=function(_0x15ad07,_0x1f3e23){if(_0x15ad07[_0x5c1f('0x57')]['id']){delete _0x15ad07[_0x5c1f('0x57')]['id'];}delete _0x15ad07[_0x5c1f('0x57')][_0x5c1f('0x20')];return db[_0x5c1f('0x54')][_0x5c1f('0x2d')]({'where':{'id':_0x15ad07[_0x5c1f('0x52')]['id']}})[_0x5c1f('0x24')](handleEntityNotFound(_0x1f3e23,null))[_0x5c1f('0x24')](saveUpdates(_0x15ad07[_0x5c1f('0x57')],null))[_0x5c1f('0x24')](respondWithResult(_0x1f3e23,null))[_0x5c1f('0x50')](handleError(_0x1f3e23,null));};exports[_0x5c1f('0x58')]=function(_0x2154ff,_0x2e25f5){return db[_0x5c1f('0x54')]['describe']()[_0x5c1f('0x24')](respondWithResult(_0x2e25f5,null))[_0x5c1f('0x50')](handleError(_0x2e25f5,null));};exports[_0x5c1f('0x59')]=function(_0x4b3be6,_0x131d86){return db['User'][_0x5c1f('0x2d')]({'where':{'id':_0x4b3be6['params']['id']}})['then'](handleEntityNotFound(_0x131d86,null))[_0x5c1f('0x24')](function(_0x2c9a74){if(_0x2c9a74){return _0x2c9a74[_0x5c1f('0x59')](_0x4b3be6[_0x5c1f('0x57')]['ids'],_[_0x5c1f('0x5a')](_0x4b3be6[_0x5c1f('0x57')],[_0x5c1f('0x5b'),'id'])||{});}})['then'](respondWithResult(_0x131d86,null))[_0x5c1f('0x50')](handleError(_0x131d86,null));};function validateUser(_0x2a6b39){return new Promise(function(_0x1781c6,_0x59a0bc){if(_0x2a6b39[_0x5c1f('0x5c')])return _0x1781c6(_0x2a6b39);return db[_0x5c1f('0x5d')]['findById'](0x1)[_0x5c1f('0x24')](function(_0x4c2ef8){if(_0x4c2ef8['securePassword'])authService[_0x5c1f('0x5e')](_0x2a6b39['password']);db['User']['max'](_0x5c1f('0x5c'))[_0x5c1f('0x24')](function(_0x841c70){if(_[_0x5c1f('0x5f')](_0x841c70)){_0x2a6b39['internal']=_0x4c2ef8[_0x5c1f('0x60')]||0x1;return;}if(_['isNil'](_0x4c2ef8[_0x5c1f('0x60')])||_0x4c2ef8[_0x5c1f('0x60')]===_0x841c70){_0x2a6b39[_0x5c1f('0x5c')]=_0x841c70+0x1;return;}if(_0x4c2ef8['min_internal']>_0x841c70){_0x2a6b39[_0x5c1f('0x5c')]=_0x4c2ef8['min_internal'];return;}return db['sequelize'][_0x5c1f('0x46')](_0x5c1f('0x61'),{'type':db[_0x5c1f('0x62')][_0x5c1f('0x63')][_0x5c1f('0x64')]})[_0x5c1f('0x24')](function(_0xc11283){if(_0xc11283&&_0xc11283['length']){for(var _0xf021c0=0x0,_0x23cdb9=_0xc11283[_0x5c1f('0x48')];_0xf021c0<_0x23cdb9&&_[_0x5c1f('0x5f')](_0x2a6b39['internal']);_0xf021c0++){if(_0x4c2ef8[_0x5c1f('0x60')]<=_0xc11283[_0xf021c0][_0x5c1f('0x65')]){_0x2a6b39[_0x5c1f('0x5c')]=_0xc11283[_0xf021c0][_0x5c1f('0x65')];}else if(_0x4c2ef8[_0x5c1f('0x60')]>_0xc11283[_0xf021c0][_0x5c1f('0x65')]&&_0x4c2ef8[_0x5c1f('0x60')]<=_0xc11283[_0xf021c0]['to']){_0x2a6b39[_0x5c1f('0x5c')]=_0x4c2ef8['min_internal'];}}}if(_['isNil'](_0x2a6b39[_0x5c1f('0x5c')])){_0x2a6b39[_0x5c1f('0x5c')]=_0x841c70+0x1;}return _0x1781c6(_0x2a6b39);});});})[_0x5c1f('0x50')](function(_0x32abc6){_0x59a0bc(_0x32abc6);});});}function updateUser(_0x4bb42d){return new Promise(function(_0x199164,_0x377370){try{if(_0x4bb42d[_0x5c1f('0x66')]){_0x4bb42d[_0x5c1f('0x67')]=_0x4bb42d['internal'];_0x4bb42d[_0x5c1f('0x68')]={'mailbox':_0x4bb42d[_0x5c1f('0x5c')],'password':_0x4bb42d[_0x5c1f('0x34')],'fullname':_0x4bb42d[_0x5c1f('0x69')],'email':_0x4bb42d[_0x5c1f('0x6a')]};}if(_0x4bb42d['role']==='agent'){if(!_0x4bb42d['permissions'])_0x4bb42d[_0x5c1f('0x6b')]=[_0x5c1f('0x6c'),_0x5c1f('0x6d'),_0x5c1f('0x6e'),_0x5c1f('0x6f'),'110',_0x5c1f('0x70'),'105',_0x5c1f('0x71'),'107',_0x5c1f('0x72'),_0x5c1f('0x73'),_0x5c1f('0x74'),_0x5c1f('0x75'),_0x5c1f('0x76'),_0x5c1f('0x77')];}_0x199164(_0x4bb42d);}catch(_0x27ec4c){_0x377370(_0x27ec4c);}});}exports['create']=function(_0xe22446,_0x2f36c3){if(_0xe22446[_0x5c1f('0x78')]['role']==='agent')throw new Error('Unauthorized');if(_0xe22446[_0x5c1f('0x57')][_0x5c1f('0x20')]===_0x5c1f('0x78')&&_0xe22446[_0x5c1f('0x78')][_0x5c1f('0x20')]!==_0x5c1f('0x26')){throw new Error(_0x5c1f('0x79'));}if(_0xe22446[_0x5c1f('0x57')][_0x5c1f('0x20')]===_0x5c1f('0x26')&&_0xe22446[_0x5c1f('0x78')][_0x5c1f('0x20')]!==_0x5c1f('0x26')){throw new Error(_0x5c1f('0x7a'));}return licenseUtil[_0x5c1f('0x7b')]([_0xe22446[_0x5c1f('0x57')]])[_0x5c1f('0x24')](function(){return validateUser(_0xe22446['body']);})['then'](function(_0xbbb6b5){return updateUser(_0xbbb6b5)[_0x5c1f('0x24')](function(_0x207fd1){if(_0x207fd1[_0x5c1f('0x20')]===_0x5c1f('0x26')){_0x207fd1[_0x5c1f('0x7c')]=_0xe22446[_0x5c1f('0x78')]['settingsEnabled'];delete _0x207fd1[_0x5c1f('0x7d')];}return _0x207fd1;});})['then'](function(_0x4531f7){return db[_0x5c1f('0x54')]['create'](_0x4531f7,{'include':[{'model':db[_0x5c1f('0x68')],'as':_0x5c1f('0x68')}]});})[_0x5c1f('0x24')](function(_0x5b588c){if(_0xe22446[_0x5c1f('0x57')][_0x5c1f('0x20')]==='user')return _0x5b588c;if(_0xe22446[_0x5c1f('0x78')][_0x5c1f('0x20')]!==_0x5c1f('0x78'))return _0x5b588c;return db[_0x5c1f('0x7e')][_0x5c1f('0x2d')]({'where':{'name':_0x5b588c[_0x5c1f('0x20')]===_0x5c1f('0x21')?'Agents':_0x5c1f('0x7f'),'userProfileId':_0xe22446[_0x5c1f('0x78')][_0x5c1f('0x7d')]},'raw':!![]})[_0x5c1f('0x24')](function(_0x2062e5){if(!_0x2062e5||_0x2062e5[_0x5c1f('0x80')]!=0x0)return _0x5b588c;return db[_0x5c1f('0x81')][_0x5c1f('0x82')]({'name':_0x5b588c[_0x5c1f('0x2e')],'resourceId':_0x5b588c['id'],'type':_0x2062e5[_0x5c1f('0x2e')],'sectionId':_0x2062e5['id']},{})[_0x5c1f('0x24')](function(){return _0x5b588c;});})[_0x5c1f('0x50')](function(_0x25e5ba){logger['error'](_0x5c1f('0x83'),_0x25e5ba);throw _0x25e5ba;});})[_0x5c1f('0x24')](respondWithResult(_0x2f36c3,0xc9))[_0x5c1f('0x50')](handleError(_0x2f36c3,null));};exports['bulkCreate']=function(_0x2d94c9,_0x3460d2){var _0x56429e=_0x2d94c9[_0x5c1f('0x57')];var _0x507e1a=[];if(_0x2d94c9['user']['role']===_0x5c1f('0x21'))throw new Error('Unauthorized');if(_[_0x5c1f('0x84')](_0x56429e,[_0x5c1f('0x20'),'user'])&&_0x2d94c9['user'][_0x5c1f('0x20')]!==_0x5c1f('0x26')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_['some'](_0x56429e,[_0x5c1f('0x20'),_0x5c1f('0x26')])&&_0x2d94c9[_0x5c1f('0x78')][_0x5c1f('0x20')]!==_0x5c1f('0x26')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator');}return licenseUtil['checkUserLimits'](_0x56429e)['then'](function(){return validateUser(_0x56429e[0x0]);})[_0x5c1f('0x24')](function(){for(var _0x39c8c5=0x1;_0x39c8c5<_0x56429e['length'];_0x39c8c5++){var _0xa58a1a=_0x56429e[_0x39c8c5-0x1][_0x5c1f('0x5c')];if(!_0x56429e[_0x39c8c5][_0x5c1f('0x5c')])_0x56429e[_0x39c8c5][_0x5c1f('0x5c')]=_0xa58a1a+0x1;_0x507e1a[_0x5c1f('0x43')](validateUser(_0x56429e[_0x39c8c5]));}return Promise[_0x5c1f('0x55')](_0x507e1a);})[_0x5c1f('0x24')](function(){_0x507e1a=[];for(var _0x1cf645=0x0;_0x1cf645<_0x56429e[_0x5c1f('0x48')];_0x1cf645++){_0x507e1a[_0x5c1f('0x43')](updateUser(_0x56429e[_0x1cf645]));}return Promise['all'](_0x507e1a);})['then'](function(){_0x507e1a=_0x56429e[_0x5c1f('0x2b')](function(_0x3dad4c){return db[_0x5c1f('0x54')]['create'](_0x3dad4c,{'include':[{'model':db[_0x5c1f('0x68')],'as':'VoiceMail'}]})[_0x5c1f('0x24')](function(_0x2f0dee){_0x3dad4c['id']=_0x2f0dee['id'];return _0x3dad4c;});});return Promise[_0x5c1f('0x55')](_0x507e1a);})[_0x5c1f('0x24')](function(_0x46b908){if(_0x2d94c9[_0x5c1f('0x57')]['role']===_0x5c1f('0x78'))return _0x46b908;if(_0x2d94c9[_0x5c1f('0x78')][_0x5c1f('0x20')]!==_0x5c1f('0x78'))return _0x46b908;var _0x5c86fb=_[_0x5c1f('0x84')](_0x46b908,function(_0x381c86){return _0x381c86[_0x5c1f('0x20')]==='agent'||_0x381c86['role']==='telephone';});if(!_0x5c86fb)return _0x46b908;return db[_0x5c1f('0x7e')][_0x5c1f('0x44')]({'where':{'name':{'$or':[_0x5c1f('0x28'),_0x5c1f('0x7f')]},'userProfileId':_0x2d94c9[_0x5c1f('0x78')]['userProfileId']},'raw':!![]})['then'](function(_0x44e713){if(_[_0x5c1f('0x85')](_0x44e713)||!_['some'](_0x44e713,[_0x5c1f('0x80'),0x0]))return _0x46b908;_0x507e1a=[];var _0x531cdf=_(_0x44e713)[_0x5c1f('0x2b')](function(_0x36c779){if(_0x36c779[_0x5c1f('0x80')]===0x1)return;return _0x36c779['name']===_0x5c1f('0x28')?_0x5c1f('0x21'):_0x5c1f('0x29');})['compact']()['value']();for(var _0x200657=0x0;_0x200657<_0x46b908[_0x5c1f('0x48')];_0x200657++){if(!_[_0x5c1f('0x39')](_0x531cdf,_0x46b908[_0x200657]['role']))return;var _0x1c78e1=_0x46b908[_0x200657]['role']===_0x5c1f('0x21')?_0x5c1f('0x28'):_0x5c1f('0x7f');_0x507e1a[_0x5c1f('0x43')](db[_0x5c1f('0x81')][_0x5c1f('0x82')]({'name':_0x46b908[_0x200657][_0x5c1f('0x2e')],'resourceId':_0x46b908[_0x200657]['id'],'type':_0x1c78e1,'sectionId':_[_0x5c1f('0x2d')](_0x44e713,[_0x5c1f('0x2e'),_0x1c78e1])['id']},{}));}return Promise['all'](_0x507e1a);});})[_0x5c1f('0x24')](respondWithResult(_0x3460d2,0xc9))[_0x5c1f('0x50')](handleError(_0x3460d2,null));};exports[_0x5c1f('0x86')]=function(_0x2eaafa,_0x18cfea){if(_0x2eaafa[_0x5c1f('0x57')]['id']){delete _0x2eaafa[_0x5c1f('0x57')]['id'];}return db['User'][_0x5c1f('0x2d')]({'where':{'id':_0x2eaafa[_0x5c1f('0x52')]['id']}})[_0x5c1f('0x24')](function(_0x1f2979){if(!_0x1f2979)return null;if(_0x1f2979['id']===_0x2eaafa[_0x5c1f('0x78')]['id']){if(!_0x2eaafa[_0x5c1f('0x57')][_0x5c1f('0x87')]||!_0x2eaafa[_0x5c1f('0x57')][_0x5c1f('0x88')]){throw new db['Sequelize'][(_0x5c1f('0x89'))](_0x5c1f('0x8a'));}if(!_0x1f2979[_0x5c1f('0x8b')](_0x2eaafa[_0x5c1f('0x57')][_0x5c1f('0x87')])){throw new db[(_0x5c1f('0x8c'))][(_0x5c1f('0x89'))]('Wrong\x20credentials');}if(_0x2eaafa['body'][_0x5c1f('0x87')]===_0x2eaafa[_0x5c1f('0x57')][_0x5c1f('0x88')]){throw new db[(_0x5c1f('0x8c'))][(_0x5c1f('0x89'))](_0x5c1f('0x8d'));}}else if(_0x2eaafa['user']['role']===_0x5c1f('0x26')){if(!_0x2eaafa[_0x5c1f('0x57')][_0x5c1f('0x88')]){throw new db['Sequelize'][(_0x5c1f('0x89'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0x2eaafa[_0x5c1f('0x78')]['role']===_0x5c1f('0x78')){if(!_0x2eaafa['body'][_0x5c1f('0x88')]){throw new db['Sequelize'][(_0x5c1f('0x89'))](_0x5c1f('0x8e'));}if(_0x1f2979[_0x5c1f('0x20')]!==_0x5c1f('0x21')){throw new db[(_0x5c1f('0x8c'))][(_0x5c1f('0x89'))](_0x5c1f('0x8f'));}}else{throw new db[(_0x5c1f('0x8c'))][(_0x5c1f('0x89'))](_0x5c1f('0x8f'));}return _0x1f2979;})['then'](handleEntityNotFound(_0x18cfea,null))[_0x5c1f('0x24')](function(_0x1090d7){return db[_0x5c1f('0x5d')]['findOne']({'attributes':['id',_0x5c1f('0x90'),_0x5c1f('0x91'),_0x5c1f('0x92')]})[_0x5c1f('0x24')](function(_0x1500f7){if(_0x1500f7['securePassword'])authService['validatePasswordPattern'](_0x2eaafa[_0x5c1f('0x57')][_0x5c1f('0x88')]);if(!_0x1500f7[_0x5c1f('0x91')]||!_0x1090d7['previousPasswords'])return _0x1090d7;authService['validatePasswordHistory'](_0x2eaafa['body'][_0x5c1f('0x88')],_0x1090d7[_0x5c1f('0x36')],_0x1500f7[_0x5c1f('0x92')]);return _0x1090d7;})['then'](saveUpdates({'password':_0x2eaafa[_0x5c1f('0x57')][_0x5c1f('0x88')],'passwordResetAt':_0x2eaafa[_0x5c1f('0x78')]['id']==_0x2eaafa[_0x5c1f('0x52')]['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0x2eaafa[_0x5c1f('0x57')][_0x5c1f('0x88')],_0x1090d7[_0x5c1f('0x36')])},null));})[_0x5c1f('0x24')](respondWithResult(_0x18cfea,null))[_0x5c1f('0x50')](handleError(_0x18cfea,null));};exports['addQueues']=function(_0x295b71,_0x159550){var _0x352e85=_0x295b71['body'][_0x5c1f('0x93')];return db[_0x5c1f('0x54')][_0x5c1f('0x2d')]({'where':{'id':_0x295b71[_0x5c1f('0x52')]['id']},'attributes':['id',_0x5c1f('0x2e'),_0x5c1f('0x20'),'online',_0x5c1f('0x94'),_0x5c1f('0x95'),_0x5c1f('0x96')]})[_0x5c1f('0x24')](handleEntityNotFound(_0x159550,null))[_0x5c1f('0x24')](function(_0x4c37f3){if(_0x4c37f3){if(!utils[_0x5c1f('0x97')](_0x352e85)){throw new db[(_0x5c1f('0x8c'))][(_0x5c1f('0x89'))](_0x5c1f('0x98'));}return _0x4c37f3[_0x5c1f('0x99')+_[_0x5c1f('0x9a')](_0x352e85[_0x5c1f('0x9b')]())+_0x5c1f('0x9c')](_0x295b71[_0x5c1f('0x57')]['ids'],{'penalty':_0x295b71['body'][_0x5c1f('0x9d')]||0x0})[_0x5c1f('0x9e')](function(_0x26ea10){for(var _0x2c7140=0x0;_0x2c7140<_0x295b71['body'][_0x5c1f('0x5b')][_0x5c1f('0x48')];_0x2c7140+=0x1){var _0x176a5d={'UserId':Number(_0x295b71[_0x5c1f('0x52')]['id'])};_0x176a5d[_[_0x5c1f('0x9a')](_0x352e85['toLowerCase']())+_0x5c1f('0x9f')]=Number(_0x295b71[_0x5c1f('0x57')][_0x5c1f('0x5b')][_0x2c7140]);socket[_0x5c1f('0x22')](_0x5c1f('0x78')+_[_0x5c1f('0x9a')](_0x352e85[_0x5c1f('0x9b')]())+_0x5c1f('0xa0'),_0x176a5d);}return _0x26ea10;})[_0x5c1f('0x24')](function(){if(_0x352e85===_0x5c1f('0xa1')){return db[_0x5c1f('0xa2')][_0x5c1f('0x44')]({'where':{'id':_0x295b71['body'][_0x5c1f('0x5b')]||[]},'raw':!![],'attributes':['id','name']});}})[_0x5c1f('0x24')](function(_0xf57992){var _0x4bec29=_0x4c37f3[_0x5c1f('0x25')]({'plain':!![]});var _0xd4bf31=[];if(_0x352e85===_0x5c1f('0xa1')&&_0x4bec29[_0x5c1f('0x20')]===_0x5c1f('0x21')&&_0x4bec29[_0x5c1f('0xa3')]){for(let _0x11752d=0x0;_0x11752d<_0xf57992[_0x5c1f('0x48')];_0x11752d+=0x1){_0xd4bf31[_0x5c1f('0x43')]({'membername':_0x4bec29[_0x5c1f('0x2e')],'UserId':_0x4bec29['id'],'queue_name':_0xf57992[_0x11752d][_0x5c1f('0x2e')],'VoiceQueueId':_0xf57992[_0x11752d]['id'],'interface':_[_0x5c1f('0x5f')](_0x4bec29['interface'])?util['format'](_0x5c1f('0xa4'),_0x4bec29[_0x5c1f('0x2e')]):_0x4bec29[_0x5c1f('0x96')],'paused':_0x4bec29[_0x5c1f('0x95')]||![],'penalty':_0x295b71[_0x5c1f('0x57')][_0x5c1f('0x9d')]||0x0});}return Promise[_0x5c1f('0x55')](_0xd4bf31[_0x5c1f('0x2b')](function(_0x5e86a8){return db['UserVoiceQueueRt'][_0x5c1f('0xa5')](_0x5e86a8);}));}return _0x4c37f3;});}})['then'](respondWithStatusCode(_0x159550,null))[_0x5c1f('0x50')](handleError(_0x159550,null));};exports[_0x5c1f('0xa6')]=function(_0x166077,_0x49964f){var _0xbc197,_0x4d1f2;return db['User'][_0x5c1f('0x2d')]({'where':{'id':_0x166077[_0x5c1f('0x52')]['id']},'attributes':['id',_0x5c1f('0x2e'),_0x5c1f('0x20')]})[_0x5c1f('0x24')](handleEntityNotFound(_0x49964f,null))['then'](function(_0x261b9e){if(_0x261b9e){_0xbc197=_0x261b9e;if(!_0x166077[_0x5c1f('0x46')]['channel']||!utils['isValidChannel'](_0x166077[_0x5c1f('0x46')][_0x5c1f('0x93')])){throw new db[(_0x5c1f('0x8c'))][(_0x5c1f('0x89'))](_0x5c1f('0x98'));}return _0x261b9e[_0x5c1f('0xa7')+_[_0x5c1f('0x9a')](_0x166077[_0x5c1f('0x46')][_0x5c1f('0x93')]['toLowerCase']())+'Queues'](_0x166077[_0x5c1f('0x46')][_0x5c1f('0x5b')]);}})[_0x5c1f('0x24')](function(_0x2bc9d7){if(_[_0x5c1f('0xa8')](_0x166077['query']['ids'])){for(var _0x4805b6=0x0;_0x4805b6<_0x166077[_0x5c1f('0x46')][_0x5c1f('0x5b')]['length'];_0x4805b6+=0x1){_0x4d1f2={'UserId':Number(_0x166077['params']['id'])};_0x4d1f2[_['capitalize'](_0x166077[_0x5c1f('0x46')][_0x5c1f('0x93')][_0x5c1f('0x9b')]())+_0x5c1f('0x9f')]=Number(_0x166077[_0x5c1f('0x46')][_0x5c1f('0x5b')][_0x4805b6]);socket['emit'](_0x5c1f('0x78')+_[_0x5c1f('0x9a')](_0x166077[_0x5c1f('0x46')][_0x5c1f('0x93')][_0x5c1f('0x9b')]())+'Queue:remove',_0x4d1f2);}}else{_0x4d1f2={'UserId':Number(_0x166077['params']['id'])};_0x4d1f2[_[_0x5c1f('0x9a')](_0x166077['query']['channel'][_0x5c1f('0x9b')]())+_0x5c1f('0x9f')]=Number(_0x166077[_0x5c1f('0x46')][_0x5c1f('0x5b')]);socket[_0x5c1f('0x22')](_0x5c1f('0x78')+_[_0x5c1f('0x9a')](_0x166077[_0x5c1f('0x46')][_0x5c1f('0x93')]['toLowerCase']())+'Queue:remove',_0x4d1f2);}return _0x2bc9d7;})['then'](function(){if(_0x166077['query'][_0x5c1f('0x93')]===_0x5c1f('0xa1')){return db[_0x5c1f('0xa9')][_0x5c1f('0xaa')]({'where':{'UserId':_0x166077[_0x5c1f('0x52')]['id'],'VoiceQueueId':_0x166077['query'][_0x5c1f('0x5b')]},'individualHooks':!![]})[_0x5c1f('0x24')](function(){return _0xbc197;});}return _0xbc197;})['then'](respondWithStatusCode(_0x49964f,null))[_0x5c1f('0x50')](handleError(_0x49964f,null));};exports[_0x5c1f('0xab')]=function(_0x356fc0,_0x5f1914){_0x356fc0['body'][_0x5c1f('0xac')]=_0x356fc0[_0x5c1f('0xad')][_0x5c1f('0xae')];return db[_0x5c1f('0x54')][_0x5c1f('0x2d')]({'where':{'id':_0x356fc0['params']['id']}})[_0x5c1f('0x24')](handleEntityNotFound(_0x5f1914,null))[_0x5c1f('0x24')](saveUpdates(_0x356fc0[_0x5c1f('0x57')],null))[_0x5c1f('0x24')](respondWithResult(_0x5f1914,null))[_0x5c1f('0x50')](handleError(_0x5f1914,null));};exports[_0x5c1f('0xaf')]=function(_0xfae2b3,_0x3c30b2){var _0x43938c=path[_0x5c1f('0xb0')](config[_0x5c1f('0xb1')],_0x5c1f('0xb2'));return db[_0x5c1f('0x54')][_0x5c1f('0x2d')]({'where':{'id':_0xfae2b3[_0x5c1f('0x52')]['id']},'attributes':['id',_0x5c1f('0xac')],'raw':!![]})[_0x5c1f('0x24')](handleEntityNotFound(_0x3c30b2,null))['then'](function(_0x302d5d){if(_0x302d5d){if(_[_0x5c1f('0x5f')](_0x302d5d[_0x5c1f('0xac')])){return _0x3c30b2[_0x5c1f('0xb3')](_0x43938c);}else{if(!fs[_0x5c1f('0xb4')](path[_0x5c1f('0xb0')](config[_0x5c1f('0xb1')],_0x5c1f('0xb5'),_0x302d5d[_0x5c1f('0xac')]))){return _0x3c30b2[_0x5c1f('0xb3')](_0x43938c);}return _0x3c30b2[_0x5c1f('0xb3')](path[_0x5c1f('0xb0')](config[_0x5c1f('0xb1')],_0x5c1f('0xb5'),_0x302d5d[_0x5c1f('0xac')]));}}})['catch'](handleError(_0x3c30b2,null));};exports[_0x5c1f('0xb6')]=function(_0x1ff74c,_0x5349bd){return db[_0x5c1f('0x54')][_0x5c1f('0x2d')]({'where':{'id':_0x1ff74c[_0x5c1f('0x52')]['id']},'attributes':['id']})[_0x5c1f('0x24')](handleEntityNotFound(_0x5349bd,null))[_0x5c1f('0x24')](function(_0x35f90d){var _0x3eee23=[];values=_0x35f90d[_0x5c1f('0x4a')];_0x3eee23[_0x5c1f('0x43')](get_open_tabs(_0x5c1f('0x49'),_0x35f90d['dataValues']));_0x3eee23['push'](get_open_tabs('sms',_0x35f90d[_0x5c1f('0x4a')]));_0x3eee23[_0x5c1f('0x43')](get_open_tabs(_0x5c1f('0x4e'),_0x35f90d[_0x5c1f('0x4a')]));_0x3eee23[_0x5c1f('0x43')](get_open_tabs(_0x5c1f('0x4f'),_0x35f90d['dataValues']));_0x3eee23['push'](get_open_tabs('fax',_0x35f90d[_0x5c1f('0x4a')]));_0x3eee23[_0x5c1f('0x43')](get_open_tabs('mail',_0x35f90d[_0x5c1f('0x4a')]));return Promise[_0x5c1f('0x55')](_0x3eee23);})[_0x5c1f('0x24')](function(_0x21a5be){if(_0x21a5be){var _0x51b4f5=_[_0x5c1f('0x2b')](values[_0x5c1f('0xb7')],function(_0x15ac70){return{'channel':_0x5c1f('0xb8'),'id':_0x15ac70['id'],'createdAt':_0x15ac70[_0x5c1f('0xb9')]};});var _0x2f59dc=_[_0x5c1f('0x2b')](values['FaxOpenTabs'],function(_0x21b387){return{'channel':_0x5c1f('0xba'),'id':_0x21b387['id'],'createdAt':_0x21b387[_0x5c1f('0xb9')]};});var _0x15d1a7=_[_0x5c1f('0x2b')](values[_0x5c1f('0xbb')],function(_0x32f967){return{'channel':_0x5c1f('0xbc'),'id':_0x32f967['id'],'createdAt':_0x32f967[_0x5c1f('0xb9')]};});var _0x3863eb=_[_0x5c1f('0x2b')](values[_0x5c1f('0xbd')],function(_0xac34d9){return{'channel':_0x5c1f('0xbe'),'id':_0xac34d9['id'],'createdAt':_0xac34d9[_0x5c1f('0xb9')]};});var _0x3e844b=_[_0x5c1f('0x2b')](values[_0x5c1f('0xbf')],function(_0x5082bb){return{'channel':_0x5c1f('0xc0'),'id':_0x5082bb['id'],'createdAt':_0x5082bb[_0x5c1f('0xb9')]};});var _0x3adb43=_[_0x5c1f('0x2b')](values[_0x5c1f('0xc1')],function(_0x33255e){return{'channel':_0x5c1f('0xc2'),'id':_0x33255e['id'],'createdAt':_0x33255e[_0x5c1f('0xb9')]};});var _0x3d2ac5=_[_0x5c1f('0xc3')](_0x51b4f5,_0x2f59dc,_0x15d1a7,_0x3863eb,_0x3e844b,_0x3adb43);var _0x2fec1e={'count':_0x3d2ac5[_0x5c1f('0x48')],'rows':_0x3d2ac5};return _0x2fec1e;}else return null;})[_0x5c1f('0x24')](respondWithResult(_0x5349bd,null))[_0x5c1f('0x50')](handleError(_0x5349bd,null));};exports['getContacts']=function(_0x1c28df,_0x45e0a0){var _0x3f3300={};return db[_0x5c1f('0x54')][_0x5c1f('0xc4')]({'where':{'id':_0x1c28df[_0x5c1f('0x52')]['id']}})['then'](function(_0x119138){if(!_0x119138){throw new APINotFoundError(util[_0x5c1f('0xc5')](_0x5c1f('0xc6'),_0x1c28df[_0x5c1f('0x52')]['id']));}return contacts[_0x5c1f('0x58')]();})[_0x5c1f('0x24')](function(_0x105a5c){_0x1c28df['query'][_0x5c1f('0x54')]=_0x1c28df[_0x5c1f('0x52')]['id'];_0x3f3300=qs[_0x5c1f('0x3b')](_0x105a5c,_0x1c28df);if(_0x1c28df[_0x5c1f('0x46')][_0x5c1f('0xc7')](_0x5c1f('0x3d'))){_0x3f3300[_0x5c1f('0x40')]=[{'model':db[_0x5c1f('0xc8')],'as':_0x5c1f('0xc9'),'required':![]},{'model':db[_0x5c1f('0xca')],'as':_0x5c1f('0xcb'),'attributes':['id',_0x5c1f('0x2e'),'color'],'where':_0x1c28df[_0x5c1f('0x46')][_0x5c1f('0xcc')]?{'id':_0x1c28df[_0x5c1f('0x46')][_0x5c1f('0xcc')]}:undefined,'required':_0x1c28df[_0x5c1f('0x46')][_0x5c1f('0xcc')]?!![]:![]}];}return contacts[_0x5c1f('0x44')](_0x1c28df[_0x5c1f('0x46')],_0x1c28df[_0x5c1f('0x78')],_0x3f3300,_0x105a5c);})[_0x5c1f('0x24')](respondWithFilteredResult(_0x45e0a0,_0x3f3300))[_0x5c1f('0x50')](APIHandleError(_0x45e0a0));};exports[_0x5c1f('0xcd')]=function(_0x2cf7f0,_0x32d601){var _0x44be1d;var _0x95f36={};var _0x230faf;return db[_0x5c1f('0x54')][_0x5c1f('0xc4')]({'where':{'id':_0x2cf7f0[_0x5c1f('0x52')]['id']},'attributes':['id',_0x5c1f('0x2e'),_0x5c1f('0x20')]})[_0x5c1f('0x24')](handleEntityNotFound(_0x32d601,null))[_0x5c1f('0x24')](function(_0x28a5fe){if(!utils['isValidChannel'](_0x2cf7f0[_0x5c1f('0x46')]['channel'])){throw new db[(_0x5c1f('0x8c'))][(_0x5c1f('0x89'))](_0x5c1f('0x98'));}_0x44be1d=_0x28a5fe;var _0x7987c1={};_0x7987c1[_0x5c1f('0xce')]=_[_0x5c1f('0xcf')](db[_['capitalize'](_0x2cf7f0['query']['channel'])+_0x5c1f('0xd0')][_0x5c1f('0x31')]);_0x7987c1[_0x5c1f('0x46')]=_['keys'](_0x2cf7f0[_0x5c1f('0x46')]);_0x7987c1['filters']=_[_0x5c1f('0xd1')](_0x7987c1[_0x5c1f('0xce')],_0x7987c1[_0x5c1f('0x46')]);_0x95f36[_0x5c1f('0x42')]=_[_0x5c1f('0xd1')](_0x7987c1['model'],qs[_0x5c1f('0xd2')](_0x2cf7f0['query'][_0x5c1f('0xd2')]));_0x95f36[_0x5c1f('0x42')]=_0x95f36[_0x5c1f('0x42')][_0x5c1f('0x48')]?_0x95f36[_0x5c1f('0x42')]:_0x7987c1[_0x5c1f('0xce')];_0x95f36[_0x5c1f('0xd3')]=qs[_0x5c1f('0xd4')](_0x2cf7f0[_0x5c1f('0x46')]['sort']);_0x95f36['where']=qs['filters'](_[_0x5c1f('0xd5')](_0x2cf7f0[_0x5c1f('0x46')],_0x7987c1[_0x5c1f('0xd6')]));if(_0x2cf7f0['query'][_0x5c1f('0x2a')]){_0x95f36[_0x5c1f('0x3c')]=_['merge'](_0x95f36['where'],{'$or':_[_0x5c1f('0x2b')](_0x95f36[_0x5c1f('0x42')],function(_0x4ef6b7){var _0x3ba11f={};_0x3ba11f[_0x4ef6b7]={'$like':'%'+_0x2cf7f0['query']['filter']+'%'};return _0x3ba11f;})});}_0x95f36=_[_0x5c1f('0x53')]({},_0x95f36,_0x2cf7f0[_0x5c1f('0xd7')]);switch(_0x44be1d[_0x5c1f('0x20')]){case'admin':return db[_['capitalize'](_0x2cf7f0[_0x5c1f('0x46')][_0x5c1f('0x93')])+_0x5c1f('0xd0')][_0x5c1f('0x44')](_0x95f36);case _0x5c1f('0x78'):case _0x5c1f('0x21'):return _0x44be1d[_0x5c1f('0x25')+_[_0x5c1f('0x9a')](_0x2cf7f0['query'][_0x5c1f('0x93')])+_0x5c1f('0x9c')](_0x95f36);default:throw new db[(_0x5c1f('0x8c'))][(_0x5c1f('0x89'))](_0x5c1f('0xd8'));}})[_0x5c1f('0x24')](function(_0x4f3365){_0x230faf=_0x4f3365[_0x5c1f('0x48')];if(!_0x2cf7f0[_0x5c1f('0x46')][_0x5c1f('0xc7')](_0x5c1f('0xd9'))){_0x95f36[_0x5c1f('0x1c')]=qs[_0x5c1f('0x1c')](_0x2cf7f0[_0x5c1f('0x46')]['limit']);_0x95f36[_0x5c1f('0x1a')]=qs[_0x5c1f('0x1a')](_0x2cf7f0[_0x5c1f('0x46')][_0x5c1f('0x1a')]);}switch(_0x44be1d['role']){case _0x5c1f('0x26'):return db[_[_0x5c1f('0x9a')](_0x2cf7f0['query'][_0x5c1f('0x93')])+_0x5c1f('0xd0')][_0x5c1f('0x44')](_0x95f36);case _0x5c1f('0x78'):case'agent':return _0x44be1d[_0x5c1f('0x25')+_[_0x5c1f('0x9a')](_0x2cf7f0[_0x5c1f('0x46')][_0x5c1f('0x93')])+_0x5c1f('0x9c')](_0x95f36);}})[_0x5c1f('0x24')](function(_0x185144){return{'count':_0x230faf,'rows':_0x185144};})[_0x5c1f('0x24')](respondWithResult(_0x32d601,null))[_0x5c1f('0x50')](handleError(_0x32d601,null));};exports[_0x5c1f('0xda')]=function(_0x4002d9,_0x2060c0){var _0x349266={};var _0x17d379={};var _0xf5dc09;var _0x5d2a93;return db['User']['findOne']({'where':{'id':_0x4002d9[_0x5c1f('0x52')]['id']}})['then'](handleEntityNotFound(_0x2060c0,null))[_0x5c1f('0x24')](function(_0x4b4149){if(_0x4b4149){_0xf5dc09=_0x4b4149;_0x17d379['model']=_[_0x5c1f('0xcf')](db[_0x5c1f('0xa9')]['rawAttributes']);_0x17d379[_0x5c1f('0x46')]=_[_0x5c1f('0xcf')](_0x4002d9[_0x5c1f('0x46')]);_0x17d379[_0x5c1f('0xd6')]=_[_0x5c1f('0xd1')](_0x17d379[_0x5c1f('0xce')],_0x17d379[_0x5c1f('0x46')]);_0x349266[_0x5c1f('0x42')]=_['intersection'](_0x17d379['model'],qs[_0x5c1f('0xd2')](_0x4002d9[_0x5c1f('0x46')][_0x5c1f('0xd2')]));_0x349266[_0x5c1f('0x42')]=_0x349266[_0x5c1f('0x42')][_0x5c1f('0x48')]?_0x349266[_0x5c1f('0x42')]:_0x17d379[_0x5c1f('0xce')];_0x349266[_0x5c1f('0xd3')]=qs[_0x5c1f('0xd4')](_0x4002d9[_0x5c1f('0x46')][_0x5c1f('0xd4')]);_0x349266['where']=qs[_0x5c1f('0xd6')](_[_0x5c1f('0xd5')](_0x4002d9['query'],_0x17d379[_0x5c1f('0xd6')]));if(_0x4002d9['query'][_0x5c1f('0x2a')]){_0x349266['where']=_[_0x5c1f('0x53')](_0x349266['where'],{'$or':_['map'](_0x349266[_0x5c1f('0x42')],function(_0x15be18){var _0x2497ac={};_0x2497ac[_0x15be18]={'$like':'%'+_0x4002d9['query'][_0x5c1f('0x2a')]+'%'};return _0x2497ac;})});}_0x349266=_[_0x5c1f('0x53')]({},_0x349266,_0x4002d9['options']);return _0xf5dc09['getVoiceQueuesRt'](_0x349266);}})[_0x5c1f('0x24')](function(_0x3cb0eb){if(_0x3cb0eb){_0x5d2a93=_0x3cb0eb[_0x5c1f('0x48')];if(!_0x4002d9['query'][_0x5c1f('0xc7')](_0x5c1f('0xd9'))){_0x349266['limit']=qs[_0x5c1f('0x1c')](_0x4002d9[_0x5c1f('0x46')][_0x5c1f('0x1c')]);_0x349266[_0x5c1f('0x1a')]=qs[_0x5c1f('0x1a')](_0x4002d9['query']['offset']);}return _0xf5dc09[_0x5c1f('0xda')](_0x349266);}})[_0x5c1f('0x24')](function(_0x37dfa5){if(_0x37dfa5){return _0x37dfa5?{'count':_0x5d2a93,'rows':_0x37dfa5}:null;}})[_0x5c1f('0x24')](respondWithResult(_0x2060c0,null))[_0x5c1f('0x50')](handleError(_0x2060c0,null));};exports[_0x5c1f('0xdb')]=function(_0x3ecfb0,_0x2f914a){var _0x111d1e={};var _0x1e09bb={};var _0x26225c;var _0x3e6dc5;return db[_0x5c1f('0x54')][_0x5c1f('0xc4')]({'where':{'id':_0x3ecfb0[_0x5c1f('0x52')]['id']}})['then'](handleEntityNotFound(_0x2f914a,null))[_0x5c1f('0x24')](function(_0x3e343c){if(_0x3e343c){_0x26225c=_0x3e343c;_0x1e09bb[_0x5c1f('0xce')]=_['keys'](db[_0x5c1f('0xdc')][_0x5c1f('0x31')]);_0x1e09bb[_0x5c1f('0x46')]=_['keys'](_0x3ecfb0[_0x5c1f('0x46')]);_0x1e09bb[_0x5c1f('0xd6')]=_[_0x5c1f('0xd1')](_0x1e09bb[_0x5c1f('0xce')],_0x1e09bb[_0x5c1f('0x46')]);_0x111d1e[_0x5c1f('0x42')]=_[_0x5c1f('0xd1')](_0x1e09bb[_0x5c1f('0xce')],qs[_0x5c1f('0xd2')](_0x3ecfb0[_0x5c1f('0x46')][_0x5c1f('0xd2')]));_0x111d1e[_0x5c1f('0x42')]=_0x111d1e[_0x5c1f('0x42')][_0x5c1f('0x48')]?_0x111d1e['attributes']:_0x1e09bb[_0x5c1f('0xce')];_0x111d1e[_0x5c1f('0xd3')]=qs[_0x5c1f('0xd4')](_0x3ecfb0[_0x5c1f('0x46')][_0x5c1f('0xd4')]);_0x111d1e[_0x5c1f('0x3c')]=qs[_0x5c1f('0xd6')](_[_0x5c1f('0xd5')](_0x3ecfb0['query'],_0x1e09bb[_0x5c1f('0xd6')]));if(_0x3ecfb0['query'][_0x5c1f('0x2a')]){_0x111d1e[_0x5c1f('0x3c')]=_[_0x5c1f('0x53')](_0x111d1e[_0x5c1f('0x3c')],{'$or':_['map'](_0x111d1e['attributes'],function(_0x8c5388){var _0x46e189={};_0x46e189[_0x8c5388]={'$like':'%'+_0x3ecfb0[_0x5c1f('0x46')][_0x5c1f('0x2a')]+'%'};return _0x46e189;})});}_0x111d1e=_[_0x5c1f('0x53')]({},_0x111d1e,_0x3ecfb0['options']);return _0x26225c['getGroups'](_0x111d1e);}})['then'](function(_0x58638d){if(_0x58638d){_0x3e6dc5=_0x58638d[_0x5c1f('0x48')];if(!_0x3ecfb0[_0x5c1f('0x46')][_0x5c1f('0xc7')](_0x5c1f('0xd9'))){_0x111d1e[_0x5c1f('0x1c')]=qs['limit'](_0x3ecfb0[_0x5c1f('0x46')][_0x5c1f('0x1c')]);_0x111d1e[_0x5c1f('0x1a')]=qs[_0x5c1f('0x1a')](_0x3ecfb0[_0x5c1f('0x46')]['offset']);}return _0x26225c[_0x5c1f('0xdb')](_0x111d1e);}})[_0x5c1f('0x24')](function(_0x321a3d){if(_0x321a3d){return _0x321a3d?{'count':_0x3e6dc5,'rows':_0x321a3d}:null;}})[_0x5c1f('0x24')](respondWithResult(_0x2f914a,null))[_0x5c1f('0x50')](handleError(_0x2f914a,null));};exports['getRecordings']=function(_0x5b6009,_0x330bf1){var _0x56ab7d={'raw':!![],'where':{}};var _0x80ac13={};var _0x3997d0={'count':0x0,'rows':[]};return db['User'][_0x5c1f('0xc4')]({'where':{'id':_0x5b6009['params']['id']}})[_0x5c1f('0x24')](handleEntityNotFound(_0x330bf1,null))[_0x5c1f('0x24')](function(_0x4373e4){if(_0x4373e4){_0x80ac13['model']=_[_0x5c1f('0xcf')](db[_0x5c1f('0xdd')]['rawAttributes']);_0x80ac13['query']=_['keys'](_0x5b6009[_0x5c1f('0x46')]);_0x80ac13['filters']=_[_0x5c1f('0xd1')](_0x80ac13[_0x5c1f('0xce')],_0x80ac13[_0x5c1f('0x46')]);_0x56ab7d[_0x5c1f('0x42')]=_[_0x5c1f('0xd1')](_0x80ac13[_0x5c1f('0xce')],qs['fields'](_0x5b6009[_0x5c1f('0x46')][_0x5c1f('0xd2')]));_0x56ab7d['attributes']=_0x56ab7d[_0x5c1f('0x42')][_0x5c1f('0x48')]?_0x56ab7d[_0x5c1f('0x42')]:_0x80ac13[_0x5c1f('0xce')];if(!_0x5b6009[_0x5c1f('0x46')]['hasOwnProperty'](_0x5c1f('0xd9'))){_0x56ab7d['limit']=qs[_0x5c1f('0x1c')](_0x5b6009[_0x5c1f('0x46')][_0x5c1f('0x1c')]);_0x56ab7d[_0x5c1f('0x1a')]=qs['offset'](_0x5b6009[_0x5c1f('0x46')][_0x5c1f('0x1a')]);}_0x56ab7d[_0x5c1f('0xd3')]=qs[_0x5c1f('0xd4')](_0x5b6009[_0x5c1f('0x46')][_0x5c1f('0xd4')]);_0x56ab7d[_0x5c1f('0x3c')]=qs[_0x5c1f('0xd6')](_[_0x5c1f('0xd5')](_0x5b6009['query'],_0x80ac13[_0x5c1f('0xd6')]));_0x56ab7d[_0x5c1f('0x3c')]['UserId']=_0x4373e4['id'];if(_0x5b6009[_0x5c1f('0x46')][_0x5c1f('0x2a')]){_0x56ab7d[_0x5c1f('0x3c')]=_['merge'](_0x56ab7d[_0x5c1f('0x3c')],{'$or':_['map'](_0x56ab7d['attributes'],function(_0x3794bf){var _0x2e80d0={};_0x2e80d0[_0x3794bf]={'$like':'%'+_0x5b6009[_0x5c1f('0x46')]['filter']+'%'};return _0x2e80d0;})});}_0x56ab7d=_['merge']({},_0x56ab7d,_0x5b6009[_0x5c1f('0xd7')]);return db[_0x5c1f('0xdd')][_0x5c1f('0x1d')]({'where':_0x56ab7d['where']})[_0x5c1f('0x24')](function(_0x562eff){_0x3997d0[_0x5c1f('0x1d')]=_0x562eff;if(_0x5b6009['query'][_0x5c1f('0x3d')]){_0x56ab7d[_0x5c1f('0x40')]=[{'all':!![]}];}return db[_0x5c1f('0xdd')]['findAll'](_0x56ab7d);})['then'](function(_0x3249ba){_0x3997d0[_0x5c1f('0x45')]=_0x3249ba;return _0x3997d0;});}})['then'](respondWithFilteredResult(_0x330bf1,_0x56ab7d))[_0x5c1f('0x50')](handleError(_0x330bf1,null));};exports[_0x5c1f('0xde')]=function(_0x46260e,_0x133f19){var _0xbfa86={'raw':!![],'where':{}};var _0x14ae62={};var _0x3103c8={'count':0x0,'rows':[]};return db[_0x5c1f('0x54')]['findOne']({'where':{'id':_0x46260e[_0x5c1f('0x52')]['id']}})[_0x5c1f('0x24')](handleEntityNotFound(_0x133f19,null))[_0x5c1f('0x24')](function(_0x46061){if(_0x46061){_0x14ae62['model']=_['keys'](db[_0x5c1f('0xdf')][_0x5c1f('0x31')]);_0x14ae62[_0x5c1f('0x46')]=_['keys'](_0x46260e[_0x5c1f('0x46')]);_0x14ae62[_0x5c1f('0xd6')]=_[_0x5c1f('0xd1')](_0x14ae62[_0x5c1f('0xce')],_0x14ae62['query']);_0xbfa86[_0x5c1f('0x42')]=_[_0x5c1f('0xd1')](_0x14ae62[_0x5c1f('0xce')],qs[_0x5c1f('0xd2')](_0x46260e[_0x5c1f('0x46')][_0x5c1f('0xd2')]));_0xbfa86[_0x5c1f('0x42')]=_0xbfa86['attributes']['length']?_0xbfa86[_0x5c1f('0x42')]:_0x14ae62[_0x5c1f('0xce')];if(!_0x46260e[_0x5c1f('0x46')][_0x5c1f('0xc7')]('nolimit')){_0xbfa86['limit']=qs['limit'](_0x46260e[_0x5c1f('0x46')]['limit']);_0xbfa86['offset']=qs['offset'](_0x46260e[_0x5c1f('0x46')][_0x5c1f('0x1a')]);}_0xbfa86[_0x5c1f('0xd3')]=qs[_0x5c1f('0xd4')](_0x46260e['query'][_0x5c1f('0xd4')]);_0xbfa86[_0x5c1f('0x3c')]=qs[_0x5c1f('0xd6')](_[_0x5c1f('0xd5')](_0x46260e[_0x5c1f('0x46')],_0x14ae62['filters']));_0xbfa86[_0x5c1f('0x3c')]['UserId']=_0x46061['id'];if(_0x46260e[_0x5c1f('0x46')][_0x5c1f('0x2a')]){_0xbfa86[_0x5c1f('0x3c')]=_['merge'](_0xbfa86[_0x5c1f('0x3c')],{'$or':_[_0x5c1f('0x2b')](_0xbfa86[_0x5c1f('0x42')],function(_0x57437d){var _0x4ac795={};_0x4ac795[_0x57437d]={'$like':'%'+_0x46260e[_0x5c1f('0x46')][_0x5c1f('0x2a')]+'%'};return _0x4ac795;})});}_0xbfa86=_[_0x5c1f('0x53')]({},_0xbfa86,_0x46260e[_0x5c1f('0xd7')]);return db['ScreenRecording'][_0x5c1f('0x1d')]({'where':_0xbfa86[_0x5c1f('0x3c')]})[_0x5c1f('0x24')](function(_0x306b56){_0x3103c8[_0x5c1f('0x1d')]=_0x306b56;if(_0x46260e[_0x5c1f('0x46')]['includeAll']){_0xbfa86[_0x5c1f('0x40')]=[{'all':!![]}];}return db[_0x5c1f('0xdf')][_0x5c1f('0x44')](_0xbfa86);})[_0x5c1f('0x24')](function(_0x3eddad){_0x3103c8['rows']=_0x3eddad;return _0x3103c8;});}})[_0x5c1f('0x24')](respondWithFilteredResult(_0x133f19,_0xbfa86))[_0x5c1f('0x50')](handleError(_0x133f19,null));};exports[_0x5c1f('0xe0')]=function(_0x5af2e0,_0x5ca2cc){var _0x394e2a={};var _0x4c6cd8={};var _0x4a8644;var _0x2cc7af;return db[_0x5c1f('0x54')]['findOne']({'where':{'id':_0x5af2e0[_0x5c1f('0x52')]['id']}})[_0x5c1f('0x24')](handleEntityNotFound(_0x5ca2cc,null))[_0x5c1f('0x24')](function(_0x522980){if(_0x522980){_0x4a8644=_0x522980;_0x4c6cd8['model']=_['keys'](db[_0x5c1f('0xe1')][_0x5c1f('0x31')]);_0x4c6cd8[_0x5c1f('0x46')]=_['keys'](_0x5af2e0[_0x5c1f('0x46')]);_0x4c6cd8[_0x5c1f('0xd6')]=_['intersection'](_0x4c6cd8[_0x5c1f('0xce')],_0x4c6cd8[_0x5c1f('0x46')]);_0x394e2a[_0x5c1f('0x42')]=_['intersection'](_0x4c6cd8[_0x5c1f('0xce')],qs[_0x5c1f('0xd2')](_0x5af2e0['query'][_0x5c1f('0xd2')]));_0x394e2a[_0x5c1f('0x42')]=_0x394e2a[_0x5c1f('0x42')][_0x5c1f('0x48')]?_0x394e2a[_0x5c1f('0x42')]:_0x4c6cd8['model'];_0x394e2a[_0x5c1f('0xd3')]=qs[_0x5c1f('0xd4')](_0x5af2e0['query'][_0x5c1f('0xd4')]);_0x394e2a['where']=qs['filters'](_[_0x5c1f('0xd5')](_0x5af2e0[_0x5c1f('0x46')],_0x4c6cd8[_0x5c1f('0xd6')]));if(_0x5af2e0[_0x5c1f('0x46')][_0x5c1f('0x2a')]){_0x394e2a[_0x5c1f('0x3c')]=_[_0x5c1f('0x53')](_0x394e2a[_0x5c1f('0x3c')],{'$or':_[_0x5c1f('0x2b')](_0x394e2a['attributes'],function(_0x5ac37c){var _0x15625b={};_0x15625b[_0x5ac37c]={'$like':'%'+_0x5af2e0[_0x5c1f('0x46')][_0x5c1f('0x2a')]+'%'};return _0x15625b;})});}_0x394e2a=_[_0x5c1f('0x53')]({},_0x394e2a,_0x5af2e0[_0x5c1f('0xd7')]);return _0x4a8644[_0x5c1f('0xe0')](_0x394e2a);}})[_0x5c1f('0x24')](function(_0x4a9ae7){if(_0x4a9ae7){_0x2cc7af=_0x4a9ae7['length'];if(!_0x5af2e0['query']['hasOwnProperty'](_0x5c1f('0xd9'))){_0x394e2a[_0x5c1f('0x1c')]=qs[_0x5c1f('0x1c')](_0x5af2e0['query'][_0x5c1f('0x1c')]);_0x394e2a[_0x5c1f('0x1a')]=qs[_0x5c1f('0x1a')](_0x5af2e0['query'][_0x5c1f('0x1a')]);}return _0x4a8644['getChatInteractions'](_0x394e2a);}})[_0x5c1f('0x24')](function(_0x3c42fe){if(_0x3c42fe){return _0x3c42fe?{'count':_0x2cc7af,'rows':_0x3c42fe}:null;}})[_0x5c1f('0x24')](respondWithResult(_0x5ca2cc,null))[_0x5c1f('0x50')](handleError(_0x5ca2cc,null));};exports[_0x5c1f('0xe2')]=function(_0x16c778,_0x1bc892){var _0x2a5c24={};var _0x41a517={};var _0x39b98c;var _0x1a5921;return db[_0x5c1f('0x54')][_0x5c1f('0xc4')]({'where':{'id':_0x16c778[_0x5c1f('0x52')]['id']}})[_0x5c1f('0x24')](handleEntityNotFound(_0x1bc892,null))[_0x5c1f('0x24')](function(_0x4158f0){if(_0x4158f0){_0x39b98c=_0x4158f0;_0x41a517[_0x5c1f('0xce')]=_[_0x5c1f('0xcf')](db[_0x5c1f('0xe3')]['rawAttributes']);_0x41a517[_0x5c1f('0x46')]=_[_0x5c1f('0xcf')](_0x16c778[_0x5c1f('0x46')]);_0x41a517[_0x5c1f('0xd6')]=_[_0x5c1f('0xd1')](_0x41a517[_0x5c1f('0xce')],_0x41a517[_0x5c1f('0x46')]);_0x2a5c24[_0x5c1f('0x42')]=_[_0x5c1f('0xd1')](_0x41a517[_0x5c1f('0xce')],qs['fields'](_0x16c778[_0x5c1f('0x46')]['fields']));_0x2a5c24[_0x5c1f('0x42')]=_0x2a5c24['attributes']['length']?_0x2a5c24[_0x5c1f('0x42')]:_0x41a517['model'];_0x2a5c24['order']=qs['sort'](_0x16c778['query'][_0x5c1f('0xd4')]);_0x2a5c24[_0x5c1f('0x3c')]=qs[_0x5c1f('0xd6')](_[_0x5c1f('0xd5')](_0x16c778[_0x5c1f('0x46')],_0x41a517[_0x5c1f('0xd6')]));if(_0x16c778[_0x5c1f('0x46')]['filter']){_0x2a5c24[_0x5c1f('0x3c')]=_[_0x5c1f('0x53')](_0x2a5c24[_0x5c1f('0x3c')],{'$or':_[_0x5c1f('0x2b')](_0x2a5c24[_0x5c1f('0x42')],function(_0x3492ed){var _0x4826f1={};_0x4826f1[_0x3492ed]={'$like':'%'+_0x16c778[_0x5c1f('0x46')][_0x5c1f('0x2a')]+'%'};return _0x4826f1;})});}_0x2a5c24=_['merge']({},_0x2a5c24,_0x16c778[_0x5c1f('0xd7')]);return _0x39b98c[_0x5c1f('0xe2')](_0x2a5c24);}})['then'](function(_0x380fb6){if(_0x380fb6){_0x1a5921=_0x380fb6['length'];if(!_0x16c778['query'][_0x5c1f('0xc7')]('nolimit')){_0x2a5c24[_0x5c1f('0x1c')]=qs['limit'](_0x16c778[_0x5c1f('0x46')][_0x5c1f('0x1c')]);_0x2a5c24['offset']=qs[_0x5c1f('0x1a')](_0x16c778[_0x5c1f('0x46')][_0x5c1f('0x1a')]);}return _0x39b98c[_0x5c1f('0xe2')](_0x2a5c24);}})['then'](function(_0x1b9a43){if(_0x1b9a43){return _0x1b9a43?{'count':_0x1a5921,'rows':_0x1b9a43}:null;}})[_0x5c1f('0x24')](respondWithResult(_0x1bc892,null))[_0x5c1f('0x50')](handleError(_0x1bc892,null));};exports[_0x5c1f('0xe4')]=function(_0x2ed9ed,_0x546b12){var _0x24f909={'raw':!![],'where':{}};var _0x56c1f3={};var _0x524baa={'count':0x0,'rows':[]};return db[_0x5c1f('0x54')][_0x5c1f('0xc4')]({'where':{'id':_0x2ed9ed['params']['id']}})[_0x5c1f('0x24')](handleEntityNotFound(_0x546b12,null))['then'](function(_0xcae153){if(_0xcae153){_0x56c1f3['model']=_['keys'](db['MailInteraction']['rawAttributes']);_0x56c1f3['query']=_[_0x5c1f('0xcf')](_0x2ed9ed[_0x5c1f('0x46')]);_0x56c1f3[_0x5c1f('0xd6')]=_['intersection'](_0x56c1f3[_0x5c1f('0xce')],_0x56c1f3['query']);_0x24f909[_0x5c1f('0x42')]=_[_0x5c1f('0xd1')](_0x56c1f3[_0x5c1f('0xce')],qs['fields'](_0x2ed9ed[_0x5c1f('0x46')][_0x5c1f('0xd2')]));_0x24f909[_0x5c1f('0x42')]=_0x24f909['attributes'][_0x5c1f('0x48')]?_0x24f909['attributes']:_0x56c1f3[_0x5c1f('0xce')];if(!_0x2ed9ed[_0x5c1f('0x46')][_0x5c1f('0xc7')]('nolimit')){_0x24f909[_0x5c1f('0x1c')]=qs['limit'](_0x2ed9ed[_0x5c1f('0x46')][_0x5c1f('0x1c')]);_0x24f909[_0x5c1f('0x1a')]=qs[_0x5c1f('0x1a')](_0x2ed9ed[_0x5c1f('0x46')][_0x5c1f('0x1a')]);}_0x24f909[_0x5c1f('0xd3')]=qs['sort'](_0x2ed9ed[_0x5c1f('0x46')][_0x5c1f('0xd4')]);_0x24f909['where']=qs[_0x5c1f('0xd6')](_['pick'](_0x2ed9ed['query'],_0x56c1f3['filters']));_0x24f909[_0x5c1f('0x3c')]['UserId']=_0xcae153['id'];if(_0x2ed9ed['query'][_0x5c1f('0x2a')]){_0x24f909[_0x5c1f('0x3c')]=_[_0x5c1f('0x53')](_0x24f909[_0x5c1f('0x3c')],{'$or':_[_0x5c1f('0x2b')](_0x24f909['attributes'],function(_0x3bb996){var _0x9db33c={};_0x9db33c[_0x3bb996]={'$like':'%'+_0x2ed9ed['query'][_0x5c1f('0x2a')]+'%'};return _0x9db33c;})});}_0x24f909=_[_0x5c1f('0x53')]({},_0x24f909,_0x2ed9ed[_0x5c1f('0xd7')]);return db[_0x5c1f('0xe5')][_0x5c1f('0x1d')]({'where':_0x24f909['where']})['then'](function(_0x1bf5b3){_0x524baa[_0x5c1f('0x1d')]=_0x1bf5b3;if(_0x2ed9ed[_0x5c1f('0x46')][_0x5c1f('0x3d')]){_0x24f909[_0x5c1f('0x40')]=[{'all':!![]}];}return db[_0x5c1f('0xe5')][_0x5c1f('0x44')](_0x24f909);})[_0x5c1f('0x24')](function(_0x549883){_0x524baa[_0x5c1f('0x45')]=_0x549883;return _0x524baa;});}})[_0x5c1f('0x24')](respondWithFilteredResult(_0x546b12,_0x24f909))[_0x5c1f('0x50')](handleError(_0x546b12,null));};exports[_0x5c1f('0xe6')]=function(_0x23440c,_0x19a442){var _0x131f7e={};var _0x387988={};var _0x4ded84;var _0x54d0fe;return db[_0x5c1f('0x54')]['findOne']({'where':{'id':_0x23440c[_0x5c1f('0x52')]['id']}})[_0x5c1f('0x24')](handleEntityNotFound(_0x19a442,null))[_0x5c1f('0x24')](function(_0x41a417){if(_0x41a417){_0x4ded84=_0x41a417;_0x387988[_0x5c1f('0xce')]=_[_0x5c1f('0xcf')](db['SmsInteraction'][_0x5c1f('0x31')]);_0x387988[_0x5c1f('0x46')]=_['keys'](_0x23440c[_0x5c1f('0x46')]);_0x387988['filters']=_[_0x5c1f('0xd1')](_0x387988[_0x5c1f('0xce')],_0x387988[_0x5c1f('0x46')]);_0x131f7e[_0x5c1f('0x42')]=_[_0x5c1f('0xd1')](_0x387988[_0x5c1f('0xce')],qs[_0x5c1f('0xd2')](_0x23440c[_0x5c1f('0x46')][_0x5c1f('0xd2')]));_0x131f7e[_0x5c1f('0x42')]=_0x131f7e['attributes'][_0x5c1f('0x48')]?_0x131f7e[_0x5c1f('0x42')]:_0x387988[_0x5c1f('0xce')];_0x131f7e[_0x5c1f('0xd3')]=qs[_0x5c1f('0xd4')](_0x23440c[_0x5c1f('0x46')][_0x5c1f('0xd4')]);_0x131f7e[_0x5c1f('0x3c')]=qs['filters'](_[_0x5c1f('0xd5')](_0x23440c[_0x5c1f('0x46')],_0x387988[_0x5c1f('0xd6')]));if(_0x23440c[_0x5c1f('0x46')][_0x5c1f('0x2a')]){_0x131f7e[_0x5c1f('0x3c')]=_[_0x5c1f('0x53')](_0x131f7e[_0x5c1f('0x3c')],{'$or':_[_0x5c1f('0x2b')](_0x131f7e['attributes'],function(_0x1ef12f){var _0x30db10={};_0x30db10[_0x1ef12f]={'$like':'%'+_0x23440c[_0x5c1f('0x46')]['filter']+'%'};return _0x30db10;})});}_0x131f7e=_[_0x5c1f('0x53')]({},_0x131f7e,_0x23440c['options']);return _0x4ded84[_0x5c1f('0xe6')](_0x131f7e);}})[_0x5c1f('0x24')](function(_0x46291e){if(_0x46291e){_0x54d0fe=_0x46291e['length'];if(!_0x23440c[_0x5c1f('0x46')][_0x5c1f('0xc7')]('nolimit')){_0x131f7e['limit']=qs[_0x5c1f('0x1c')](_0x23440c['query'][_0x5c1f('0x1c')]);_0x131f7e[_0x5c1f('0x1a')]=qs[_0x5c1f('0x1a')](_0x23440c[_0x5c1f('0x46')][_0x5c1f('0x1a')]);}return _0x4ded84[_0x5c1f('0xe6')](_0x131f7e);}})['then'](function(_0x384ed6){if(_0x384ed6){return _0x384ed6?{'count':_0x54d0fe,'rows':_0x384ed6}:null;}})[_0x5c1f('0x24')](respondWithResult(_0x19a442,null))[_0x5c1f('0x50')](handleError(_0x19a442,null));};exports[_0x5c1f('0xe7')]=function(_0x3e7a35,_0x3d260e){var _0x577ce4={};var _0x38ca68={};var _0x4f9562;var _0x2ee034;return db['User'][_0x5c1f('0xc4')]({'where':{'id':_0x3e7a35[_0x5c1f('0x52')]['id']}})['then'](handleEntityNotFound(_0x3d260e,null))[_0x5c1f('0x24')](function(_0x2803ef){if(_0x2803ef){_0x4f9562=_0x2803ef;_0x38ca68[_0x5c1f('0xce')]=_[_0x5c1f('0xcf')](db[_0x5c1f('0xe8')][_0x5c1f('0x31')]);_0x38ca68[_0x5c1f('0x46')]=_[_0x5c1f('0xcf')](_0x3e7a35[_0x5c1f('0x46')]);_0x38ca68[_0x5c1f('0xd6')]=_['intersection'](_0x38ca68[_0x5c1f('0xce')],_0x38ca68[_0x5c1f('0x46')]);_0x577ce4[_0x5c1f('0x42')]=_[_0x5c1f('0xd1')](_0x38ca68[_0x5c1f('0xce')],qs[_0x5c1f('0xd2')](_0x3e7a35['query']['fields']));_0x577ce4[_0x5c1f('0x42')]=_0x577ce4['attributes'][_0x5c1f('0x48')]?_0x577ce4['attributes']:_0x38ca68[_0x5c1f('0xce')];_0x577ce4['order']=qs['sort'](_0x3e7a35['query']['sort']);_0x577ce4[_0x5c1f('0x3c')]=qs[_0x5c1f('0xd6')](_[_0x5c1f('0xd5')](_0x3e7a35[_0x5c1f('0x46')],_0x38ca68[_0x5c1f('0xd6')]));if(_0x3e7a35[_0x5c1f('0x46')][_0x5c1f('0x2a')]){_0x577ce4['where']=_['merge'](_0x577ce4['where'],{'$or':_[_0x5c1f('0x2b')](_0x577ce4[_0x5c1f('0x42')],function(_0x2fd981){var _0x44b6d7={};_0x44b6d7[_0x2fd981]={'$like':'%'+_0x3e7a35['query']['filter']+'%'};return _0x44b6d7;})});}_0x577ce4=_[_0x5c1f('0x53')]({},_0x577ce4,_0x3e7a35[_0x5c1f('0xd7')]);return _0x4f9562['getFaxInteractions'](_0x577ce4);}})['then'](function(_0x5abf91){if(_0x5abf91){_0x2ee034=_0x5abf91[_0x5c1f('0x48')];if(!_0x3e7a35[_0x5c1f('0x46')][_0x5c1f('0xc7')]('nolimit')){_0x577ce4[_0x5c1f('0x1c')]=qs[_0x5c1f('0x1c')](_0x3e7a35[_0x5c1f('0x46')]['limit']);_0x577ce4[_0x5c1f('0x1a')]=qs[_0x5c1f('0x1a')](_0x3e7a35['query'][_0x5c1f('0x1a')]);}return _0x4f9562[_0x5c1f('0xe7')](_0x577ce4);}})[_0x5c1f('0x24')](function(_0x5b10ce){if(_0x5b10ce){return _0x5b10ce?{'count':_0x2ee034,'rows':_0x5b10ce}:null;}})[_0x5c1f('0x24')](respondWithResult(_0x3d260e,null))[_0x5c1f('0x50')](handleError(_0x3d260e,null));};exports[_0x5c1f('0xe9')]=function(_0xdc4eb6,_0x8d8bdf){var _0x2009aa={};var _0x5de12f={};var _0x58009d;var _0x17955c;return db['User'][_0x5c1f('0xc4')]({'where':{'id':_0xdc4eb6[_0x5c1f('0x52')]['id']}})[_0x5c1f('0x24')](handleEntityNotFound(_0x8d8bdf,null))[_0x5c1f('0x24')](function(_0x20d474){if(_0x20d474){_0x58009d=_0x20d474;_0x5de12f[_0x5c1f('0xce')]=_[_0x5c1f('0xcf')](db[_0x5c1f('0xea')][_0x5c1f('0x31')]);_0x5de12f[_0x5c1f('0x46')]=_['keys'](_0xdc4eb6['query']);_0x5de12f[_0x5c1f('0xd6')]=_['intersection'](_0x5de12f[_0x5c1f('0xce')],_0x5de12f[_0x5c1f('0x46')]);_0x2009aa[_0x5c1f('0x42')]=_[_0x5c1f('0xd1')](_0x5de12f[_0x5c1f('0xce')],qs[_0x5c1f('0xd2')](_0xdc4eb6[_0x5c1f('0x46')][_0x5c1f('0xd2')]));_0x2009aa[_0x5c1f('0x42')]=_0x2009aa['attributes'][_0x5c1f('0x48')]?_0x2009aa[_0x5c1f('0x42')]:_0x5de12f[_0x5c1f('0xce')];_0x2009aa[_0x5c1f('0xd3')]=qs[_0x5c1f('0xd4')](_0xdc4eb6[_0x5c1f('0x46')][_0x5c1f('0xd4')]);_0x2009aa[_0x5c1f('0x3c')]=qs['filters'](_[_0x5c1f('0xd5')](_0xdc4eb6['query'],_0x5de12f[_0x5c1f('0xd6')]));if(_0xdc4eb6[_0x5c1f('0x46')][_0x5c1f('0x2a')]){_0x2009aa[_0x5c1f('0x3c')]=_[_0x5c1f('0x53')](_0x2009aa['where'],{'$or':_[_0x5c1f('0x2b')](_0x2009aa['attributes'],function(_0x39f5dc){var _0x42d149={};_0x42d149[_0x39f5dc]={'$like':'%'+_0xdc4eb6[_0x5c1f('0x46')][_0x5c1f('0x2a')]+'%'};return _0x42d149;})});}_0x2009aa=_['merge']({},_0x2009aa,_0xdc4eb6[_0x5c1f('0xd7')]);return _0x58009d['getWhatsappInteractions'](_0x2009aa);}})['then'](function(_0x5abe60){if(_0x5abe60){_0x17955c=_0x5abe60[_0x5c1f('0x48')];if(!_0xdc4eb6['query'][_0x5c1f('0xc7')](_0x5c1f('0xd9'))){_0x2009aa[_0x5c1f('0x1c')]=qs['limit'](_0xdc4eb6[_0x5c1f('0x46')][_0x5c1f('0x1c')]);_0x2009aa[_0x5c1f('0x1a')]=qs[_0x5c1f('0x1a')](_0xdc4eb6['query'][_0x5c1f('0x1a')]);}return _0x58009d[_0x5c1f('0xe9')](_0x2009aa);}})[_0x5c1f('0x24')](function(_0x3bf010){if(_0x3bf010){return _0x3bf010?{'count':_0x17955c,'rows':_0x3bf010}:null;}})[_0x5c1f('0x24')](respondWithResult(_0x8d8bdf,null))[_0x5c1f('0x50')](handleError(_0x8d8bdf,null));};exports[_0x5c1f('0xeb')]=function(_0x5313d5,_0x57678f,_0x5b03d8){var _0x436ebd;var _0x320786;var _0x1a24a9;var _0x3eacfd=!_[_0x5c1f('0x5f')](_0x5313d5[_0x5c1f('0x52')]['id'])?_0x5313d5[_0x5c1f('0x52')]['id']:!_[_0x5c1f('0x5f')](_0x5313d5[_0x5c1f('0x78')]['id'])?_0x5313d5['user']['id']:null;return db[_0x5c1f('0x54')][_0x5c1f('0x2d')]({'where':{'id':_0x3eacfd,'role':{'$or':['admin',_0x5c1f('0x78'),'agent']}},'attributes':['id',_0x5c1f('0x2e'),_0x5c1f('0xec'),_0x5c1f('0xed'),_0x5c1f('0x20'),_0x5c1f('0x5c'),_0x5c1f('0x94')]})[_0x5c1f('0x24')](function(_0x3c303c){if(_0x3c303c){if(_0x3c303c['role']===_0x5c1f('0x21')){_0x436ebd=_0x3c303c;if(_0x5313d5[_0x5c1f('0x57')][_0x5c1f('0x96')]){_0x1a24a9=util[_0x5c1f('0xc5')]('LOCAL/%s@from-sip/n',_0x436ebd[_0x5313d5[_0x5c1f('0x57')]['interface']]);}else if(_0x5313d5[_0x5c1f('0x57')][_0x5c1f('0xee')]){_0x1a24a9=util[_0x5c1f('0xc5')](_0x5c1f('0xa4'),_0x5313d5[_0x5c1f('0x57')]['intrf']);}else{_0x1a24a9=util[_0x5c1f('0xc5')]('SIP/%s',_0x436ebd[_0x5c1f('0x2e')]);}socket['to'](util[_0x5c1f('0xc5')]('user:%s',_0x436ebd[_0x5c1f('0x2e')]))[_0x5c1f('0x22')](_0x5c1f('0xef'),{'user':{'id':_0x436ebd['id'],'name':_0x436ebd[_0x5c1f('0x2e')]},'ip':_0x5313d5['headers']['x-forwarded-for']||_0x5313d5[_0x5c1f('0xf0')][_0x5c1f('0xf1')]||_0x5313d5['socket'][_0x5c1f('0xf1')]||_0x5313d5['connection'][_0x5c1f('0xf2')][_0x5c1f('0xf1')]});return db[_0x5c1f('0xa9')][_0x5c1f('0xaa')]({'where':{'membername':_0x436ebd[_0x5c1f('0x2e')]},'individualHooks':!![]});}}else{throw new db[(_0x5c1f('0x8c'))][(_0x5c1f('0x89'))](_0x5c1f('0xf3'));}})[_0x5c1f('0x24')](function(){if(_0x436ebd){return _0x436ebd[_0x5c1f('0xf4')]({'raw':!![]});}})[_0x5c1f('0x24')](function(_0x2d4444){if(_0x436ebd){if(_0x2d4444){_0x320786=_0x2d4444;if(_0x320786[_0x5c1f('0x48')]){var _0x1f8b01=_0x320786[_0x5c1f('0x2b')](function(_0x22e9c5){var _0x461cc3={'membername':_0x436ebd[_0x5c1f('0x2e')],'UserId':_0x436ebd['id'],'queue_name':_0x22e9c5[_0x5c1f('0x2e')],'VoiceQueueId':_0x22e9c5['id'],'interface':_0x1a24a9,'paused':_0x436ebd['loginInPause']||![],'penalty':_0x22e9c5[_0x5c1f('0xf5')]||0x0};return db['UserVoiceQueueRt']['upsert'](_0x461cc3);});return Promise[_0x5c1f('0x55')](_0x1f8b01);}}}})[_0x5c1f('0x24')](function(){if(_0x436ebd){return db[_0x5c1f('0xf6')]['findAll']({'where':{'membername':_0x436ebd[_0x5c1f('0x2e')],'exitAt':null}});}})[_0x5c1f('0x24')](function(_0x2818ec){if(_0x436ebd){var _0x4174da=[];_0x2818ec[_0x5c1f('0xf7')](function(_0x397758){_0x4174da['push'](_0x397758[_0x5c1f('0x56')]({'exitAt':moment()['format'](_0x5c1f('0xf8'))}));});return Promise[_0x5c1f('0x55')](_0x4174da);}})[_0x5c1f('0x24')](function(){if(_0x436ebd){var _0x43c0ac=[];var _0x4ff280=[];var _0x475a12=utils['getChannels']();var _0x122294={'membername':_0x436ebd[_0x5c1f('0x2e')],'interface':_0x1a24a9,'enterAt':moment()[_0x5c1f('0xc5')](_0x5c1f('0xf8')),'role':_0x436ebd['role'],'internal':_0x436ebd[_0x5c1f('0x5c')]};_0x475a12[_0x5c1f('0xf7')](function(_0x56cfaa){_0x43c0ac[_0x5c1f('0x43')](_[_0x5c1f('0x53')]({'channel':_0x56cfaa,'type':_0x5c1f('0xf9'),'data1':_0x5313d5['body'][_0x5c1f('0xfa')],'data2':_0x1a24a9},_0x122294));if(_0x436ebd[_0x5c1f('0x94')]){_0x4ff280[_0x5c1f('0x43')](_[_0x5c1f('0x53')]({'channel':_0x56cfaa,'type':_0x5c1f('0xfb'),'data1':'LOGININPAUSE'},_0x122294));}});return db[_0x5c1f('0xf6')][_0x5c1f('0xfc')](_0x43c0ac[_0x5c1f('0xc3')](_0x4ff280),{'individualHooks':!![]});}})[_0x5c1f('0x24')](function(){if(_0x436ebd){return _0x436ebd['update']({'online':!![],'lastLoginAt':moment()[_0x5c1f('0xc5')](_0x5c1f('0xf8')),'voicePause':_0x436ebd[_0x5c1f('0x94')]||![],'mailPause':_0x436ebd[_0x5c1f('0x94')]||![],'chatPause':_0x436ebd[_0x5c1f('0x94')]||![],'faxPause':_0x436ebd['loginInPause']||![],'smsPause':_0x436ebd[_0x5c1f('0x94')]||![],'openchannelPause':_0x436ebd[_0x5c1f('0x94')]||![],'whatsappPause':_0x436ebd[_0x5c1f('0x94')]||![],'pauseType':_0x436ebd[_0x5c1f('0x94')]?_0x5c1f('0xfd'):null,'interface':_0x1a24a9,'lastPauseAt':moment()[_0x5c1f('0xc5')]('YYYY-MM-DD\x20HH:mm:ss')});}})[_0x5c1f('0x24')](function(_0x460a5b){if(_0x5313d5['isMiddleware']){return _0x5b03d8();}else{return Promise[_0x5c1f('0xfe')](_0x460a5b)[_0x5c1f('0x24')](respondWithResult(_0x57678f,null));}})[_0x5c1f('0x50')](handleError(_0x57678f,null));};exports[_0x5c1f('0xff')]=function(_0x5ec864,_0x47d1d9){var _0x1c35df;return db[_0x5c1f('0x54')]['find']({'where':{'id':_0x5ec864[_0x5c1f('0x52')]['id'],'role':_0x5c1f('0x21')},'attributes':['id',_0x5c1f('0x2e'),_0x5c1f('0x20')]})[_0x5c1f('0x24')](handleEntityNotFound(_0x47d1d9,null))[_0x5c1f('0x24')](function(_0x1bfead){if(_0x1bfead){_0x1c35df=_0x1bfead;return db[_0x5c1f('0xa9')]['destroy']({'where':{'membername':_0x1c35df[_0x5c1f('0x2e')]},'individualHooks':!![]});}})[_0x5c1f('0x24')](function(){return db[_0x5c1f('0xf6')]['findAll']({'where':{'membername':_0x1c35df[_0x5c1f('0x2e')],'exitAt':null}});})[_0x5c1f('0x24')](function(_0x31ee0d){var _0x56a4ae=[];_0x31ee0d[_0x5c1f('0xf7')](function(_0x295d4c){_0x56a4ae[_0x5c1f('0x43')](_0x295d4c[_0x5c1f('0x56')]({'exitAt':moment()[_0x5c1f('0xc5')](_0x5c1f('0xf8'))}));});return Promise[_0x5c1f('0x55')](_0x56a4ae);})[_0x5c1f('0x24')](function(){return _0x1c35df[_0x5c1f('0x56')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x5c1f('0x24')](respondWithResult(_0x47d1d9,null))[_0x5c1f('0x50')](handleError(_0x47d1d9,null));};exports['pause']=function(_0x40ae3e,_0x11f1d1){var _0x3ecc52;return db[_0x5c1f('0xa9')][_0x5c1f('0x56')]({'paused':0x1},{'where':{'UserId':_0x40ae3e[_0x5c1f('0x52')]['id']},'individualHooks':!![]})[_0x5c1f('0x24')](function(){return db[_0x5c1f('0x54')][_0x5c1f('0x2d')]({'where':{'id':_0x40ae3e[_0x5c1f('0x52')]['id'],'role':'agent'},'attributes':['id','name',_0x5c1f('0x20'),_0x5c1f('0x5c'),'interface',_0x5c1f('0xa3')]});})[_0x5c1f('0x24')](handleEntityNotFound(_0x11f1d1,null))[_0x5c1f('0x24')](function(_0x178e24){if(_0x178e24){_0x3ecc52=_0x178e24;return db['MemberReport']['findAll']({'where':{'membername':_0x3ecc52[_0x5c1f('0x2e')],'type':_0x5c1f('0xfb'),'exitAt':null}});}})[_0x5c1f('0x24')](function(_0x4a25f9){if(_0x4a25f9[_0x5c1f('0x48')]){var _0x37823c=moment()[_0x5c1f('0xc5')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x1c4856=0x0,_0x3dad00=_0x4a25f9[_0x5c1f('0x48')];_0x1c4856<_0x3dad00;_0x1c4856++){_0x4a25f9[_0x1c4856][_0x5c1f('0x100')]({'exitAt':_0x37823c});}}})['then'](function(){var _0x53d568=[];var _0x1b27b8=utils[_0x5c1f('0x101')]();_0x1b27b8['forEach'](function(_0x58bde6){_0x53d568[_0x5c1f('0x43')]({'channel':_0x58bde6,'membername':_0x3ecc52['name'],'interface':_[_0x5c1f('0x5f')](_0x3ecc52[_0x5c1f('0x96')])?util[_0x5c1f('0xc5')](_0x5c1f('0xa4'),_0x3ecc52[_0x5c1f('0x2e')]):_0x3ecc52[_0x5c1f('0x96')],'type':_0x5c1f('0xfb'),'enterAt':moment()[_0x5c1f('0xc5')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x40ae3e['body'][_0x5c1f('0x32')]||'DEFAULT\x20PAUSE','role':_0x3ecc52['role'],'internal':_0x3ecc52[_0x5c1f('0x5c')]});});return db[_0x5c1f('0xf6')][_0x5c1f('0xfc')](_0x53d568,{'individualHooks':!![]});})[_0x5c1f('0x24')](function(){return _0x3ecc52['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x40ae3e['body'][_0x5c1f('0x32')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0x5c1f('0xc5')](_0x5c1f('0xf8'))});})[_0x5c1f('0x24')](respondWithResult(_0x11f1d1,null))[_0x5c1f('0x50')](handleError(_0x11f1d1,null));};exports[_0x5c1f('0x102')]=function(_0xa3c57a,_0x4899c4){if(_0xa3c57a[_0x5c1f('0x57')]['channel']&&!utils[_0x5c1f('0x97')](_0xa3c57a[_0x5c1f('0x57')][_0x5c1f('0x93')])){throw new APIBadRequestError(util[_0x5c1f('0xc5')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0xa3c57a['body']['channel']));}return db[_0x5c1f('0x54')][_0x5c1f('0x2d')]({'where':{'id':_0xa3c57a['params']['id']},'attributes':['id',_0x5c1f('0x2e'),_0x5c1f('0x20'),'internal','interface',_0x5c1f('0xa3'),_0x5c1f('0x95'),_0x5c1f('0x103'),_0x5c1f('0x104'),_0x5c1f('0x105'),_0x5c1f('0x106'),_0x5c1f('0x107'),_0x5c1f('0x108'),'pauseType',_0x5c1f('0x109')]})[_0x5c1f('0x24')](function(_0x4e4136){if(!_0x4e4136){throw new APINotFoundError(util[_0x5c1f('0xc5')](_0x5c1f('0xc6'),_0xa3c57a[_0x5c1f('0x52')]['id']));}return _0x4e4136['unpause'](_0xa3c57a['body'][_0x5c1f('0x93')]);})[_0x5c1f('0x24')](respondWithResult(_0x4899c4,null))[_0x5c1f('0x50')](APIHandleError(_0x4899c4));};exports[_0x5c1f('0x10a')]=function(_0x1df20d,_0x401d92){var _0x25c71e={};var _0x5aaf8f={};var _0xba9a66;var _0x599c29;return db[_0x5c1f('0x54')][_0x5c1f('0xc4')]({'where':{'id':_0x1df20d[_0x5c1f('0x52')]['id']}})[_0x5c1f('0x24')](handleEntityNotFound(_0x401d92,null))[_0x5c1f('0x24')](function(_0xe1928c){if(_0xe1928c){_0xba9a66=_0xe1928c;_0x5aaf8f[_0x5c1f('0xce')]=_[_0x5c1f('0xcf')](db[_0x5c1f('0x10b')][_0x5c1f('0x31')]);_0x5aaf8f['query']=_[_0x5c1f('0xcf')](_0x1df20d[_0x5c1f('0x46')]);_0x5aaf8f[_0x5c1f('0xd6')]=_[_0x5c1f('0xd1')](_0x5aaf8f[_0x5c1f('0xce')],_0x5aaf8f[_0x5c1f('0x46')]);_0x25c71e['attributes']=_[_0x5c1f('0xd1')](_0x5aaf8f[_0x5c1f('0xce')],qs['fields'](_0x1df20d[_0x5c1f('0x46')][_0x5c1f('0xd2')]));_0x25c71e[_0x5c1f('0x42')]=_0x25c71e[_0x5c1f('0x42')][_0x5c1f('0x48')]?_0x25c71e[_0x5c1f('0x42')]:_0x5aaf8f[_0x5c1f('0xce')];_0x25c71e[_0x5c1f('0xd3')]=qs[_0x5c1f('0xd4')](_0x1df20d['query'][_0x5c1f('0xd4')]);_0x25c71e['where']=qs[_0x5c1f('0xd6')](_[_0x5c1f('0xd5')](_0x1df20d['query'],_0x5aaf8f[_0x5c1f('0xd6')]));if(_0x1df20d[_0x5c1f('0x46')][_0x5c1f('0x2a')]){_0x25c71e[_0x5c1f('0x3c')]=_[_0x5c1f('0x53')](_0x25c71e[_0x5c1f('0x3c')],{'$or':_[_0x5c1f('0x2b')](_0x25c71e[_0x5c1f('0x42')],function(_0x3381bb){var _0x4a9d64={};_0x4a9d64[_0x3381bb]={'$like':'%'+_0x1df20d[_0x5c1f('0x46')][_0x5c1f('0x2a')]+'%'};return _0x4a9d64;})});}_0x25c71e=_[_0x5c1f('0x53')]({},_0x25c71e,_0x1df20d['options']);return _0xba9a66[_0x5c1f('0x10a')](_0x25c71e);}})[_0x5c1f('0x24')](function(_0x2d9fca){if(_0x2d9fca){_0x599c29=_0x2d9fca['length'];if(!_0x1df20d['query'][_0x5c1f('0xc7')](_0x5c1f('0xd9'))){_0x25c71e[_0x5c1f('0x1c')]=qs[_0x5c1f('0x1c')](_0x1df20d[_0x5c1f('0x46')]['limit']);_0x25c71e[_0x5c1f('0x1a')]=qs[_0x5c1f('0x1a')](_0x1df20d[_0x5c1f('0x46')][_0x5c1f('0x1a')]);}return _0xba9a66[_0x5c1f('0x10a')](_0x25c71e);}})['then'](function(_0x27565f){if(_0x27565f){return _0x27565f?{'count':_0x599c29,'rows':_0x27565f}:null;}})['then'](respondWithResult(_0x401d92,null))[_0x5c1f('0x50')](handleError(_0x401d92,null));};exports[_0x5c1f('0x10c')]=function(_0xf524a4,_0x2f2a4a){var _0x279b44=_0xf524a4[_0x5c1f('0x52')]['id'];var _0x424be2=_0xf524a4[_0x5c1f('0x57')]?_0xf524a4['body'][_0x5c1f('0x5b')]:null;var _0x4ad423=[];return Promise[_0x5c1f('0xfe')]()[_0x5c1f('0x24')](function(){if(!_0x424be2)throw new APIBadRequestError(_0x5c1f('0x10d'));})['then'](function(){return db[_0x5c1f('0x54')][_0x5c1f('0xc4')]({'where':{'id':_0x279b44}});})[_0x5c1f('0x24')](function(_0x319f35){if(!_0x319f35)throw new APINotFoundError(util[_0x5c1f('0xc5')]('User\x20with\x20id\x20%s\x20not\x20found',_0xf524a4[_0x5c1f('0x52')]['id']));return db[_0x5c1f('0x62')][_0x5c1f('0x10e')](function(_0x2e5441){return _0x319f35[_0x5c1f('0x10c')](_0x424be2,{'transaction':_0x2e5441})[_0x5c1f('0x24')](function(){return db[_0x5c1f('0x10b')][_0x5c1f('0x44')]({'where':{'id':{'$in':_0x424be2}}});})[_0x5c1f('0x24')](function(_0x293e92){var _0x190ac8=_['map'](_0x293e92,function(_0x52a448){return _0x52a448['getAssociatedQueues']();});return Promise[_0x5c1f('0x55')](_0x190ac8);})[_0x5c1f('0x24')](function(_0x4d34b3){_0x4ad423=_[_0x5c1f('0x10f')](_0x4d34b3);var _0x1e170b=_[_0x5c1f('0x2b')](_0x4ad423,function(_0x54aa10){return _0x54aa10[_0x5c1f('0x110')](_0x319f35['id'],{'transaction':_0x2e5441});});return Promise['all'](_0x1e170b);})['then'](function(){if(!_0x319f35['online'])return;var _0x5a2385=_[_0x5c1f('0x2a')](_0x4ad423,function(_0x3af697){return _0x3af697[_0x5c1f('0x111')](_0x5c1f('0x93'))===_0x5c1f('0x112');});var _0x59bc28=_[_0x5c1f('0x2b')](_0x5a2385,function(_0x343437){return db['UserVoiceQueueRt'][_0x5c1f('0xa5')]({'membername':_0x319f35['name'],'UserId':_0x319f35['id'],'queue_name':_0x343437[_0x5c1f('0x2e')],'VoiceQueueId':_0x343437['id'],'interface':_[_0x5c1f('0x5f')](_0x319f35['interface'])?util[_0x5c1f('0xc5')](_0x5c1f('0xa4'),_0x319f35[_0x5c1f('0x2e')]):_0x319f35[_0x5c1f('0x96')],'paused':_0x319f35[_0x5c1f('0x95')]||![],'penalty':_0x319f35['penalty']},{'transaction':_0x2e5441});});return Promise['all'](_0x59bc28);})[_0x5c1f('0x24')](function(){return db[_0x5c1f('0x113')][_0x5c1f('0x44')]({'where':{'teamId':{'$in':_0x424be2}}});})[_0x5c1f('0x24')](function(_0x19eb26){var _0x298d55=_[_0x5c1f('0x2b')](_0x19eb26,function(_0x4a5c76){return db['UserVoicePrefix']['create']({'UserId':_0x319f35['id'],'VoicePrefixId':_0x4a5c76[_0x5c1f('0x114')]},{'transaction':_0x2e5441});});return Promise[_0x5c1f('0x55')](_0x298d55);});});})[_0x5c1f('0x24')](function(){for(var _0x3bda8f=0x0;_0x3bda8f<_0x4ad423[_0x5c1f('0x48')];_0x3bda8f++){var _0x58ef5b=_0x4ad423[_0x3bda8f]['getDataValue'](_0x5c1f('0x93'));var _0x2fed94=_0x58ef5b+'QueueId';socket['emit'](_0x5c1f('0x78')+_0x58ef5b+_0x5c1f('0xa0'),{'UserId':_0x279b44,['queueField']:_0x4ad423[_0x3bda8f]['id']});}})[_0x5c1f('0x24')](respondWithStatusCode(_0x2f2a4a,null))[_0x5c1f('0x50')](APIHandleError(_0x2f2a4a));};exports[_0x5c1f('0x115')]=function(_0x5150ce,_0x508cf8){var _0x40b18c=_0x5150ce[_0x5c1f('0x52')]['id'];var _0x24a332=null;if(_0x5150ce[_0x5c1f('0x46')][_0x5c1f('0x5b')]){_0x24a332=_[_0x5c1f('0xa8')](_0x5150ce[_0x5c1f('0x46')]['ids'])?_0x5150ce['query'][_0x5c1f('0x5b')]:[_0x5150ce[_0x5c1f('0x46')][_0x5c1f('0x5b')]];}var _0x130118=[];return Promise['resolve']()[_0x5c1f('0x24')](function(){if(!_0x24a332)throw new APIBadRequestError(_0x5c1f('0x116'));})['then'](function(){return db[_0x5c1f('0x54')][_0x5c1f('0xc4')]({'where':{'id':_0x40b18c}});})['then'](function(_0x5be233){if(!_0x5be233)throw new APINotFoundError(util[_0x5c1f('0xc5')](_0x5c1f('0xc6'),_0x5150ce[_0x5c1f('0x52')]['id']));return db['sequelize'][_0x5c1f('0x10e')](function(_0x1adc88){return _0x5be233[_0x5c1f('0x115')](_0x24a332,{'transaction':_0x1adc88})[_0x5c1f('0x24')](function(){return db[_0x5c1f('0x10b')]['findAll']({'where':{'id':{'$in':_0x24a332}}});})[_0x5c1f('0x24')](function(_0x29cfda){var _0x47c740=_[_0x5c1f('0x2b')](_0x29cfda,function(_0x1d668d){return _0x1d668d[_0x5c1f('0x117')]();});return Promise[_0x5c1f('0x55')](_0x47c740);})[_0x5c1f('0x24')](function(_0x100581){_0x130118=_['flattenDeep'](_0x100581);var _0x570c61=_[_0x5c1f('0x2b')](_0x130118,function(_0x57d8b7){return _0x57d8b7[_0x5c1f('0x118')](_0x5be233['id'],{'transaction':_0x1adc88});});return Promise['all'](_0x570c61);})[_0x5c1f('0x24')](function(){if(!_0x5be233[_0x5c1f('0xa3')])return;var _0x1fdde5=_[_0x5c1f('0x2a')](_0x130118,function(_0x490fe2){return _0x490fe2['getDataValue']('channel')==='Voice';});var _0x14edda=_[_0x5c1f('0x2b')](_0x1fdde5,function(_0x2f1db3){return db['UserVoiceQueueRt'][_0x5c1f('0xaa')]({'where':{'VoiceQueueId':_0x2f1db3['id'],'UserId':_0x5be233['id']},'transaction':_0x1adc88});});return Promise[_0x5c1f('0x55')](_0x14edda);})[_0x5c1f('0x24')](function(){return db[_0x5c1f('0x113')]['findAll']({'where':{'teamId':{'$in':_0x24a332}}});})[_0x5c1f('0x24')](function(_0xd351df){var _0x2d5300=_[_0x5c1f('0x2b')](_0xd351df,function(_0x230525){return db['UserVoicePrefix'][_0x5c1f('0xaa')]({'where':{'UserId':_0x5be233['id'],'VoicePrefixId':_0x230525[_0x5c1f('0x114')]}},{'transaction':_0x1adc88});});return Promise[_0x5c1f('0x55')](_0x2d5300);});});})[_0x5c1f('0x24')](function(){for(var _0x36a585=0x0;_0x36a585<_0x130118['length'];_0x36a585++){var _0x146430=_0x130118[_0x36a585]['getDataValue'](_0x5c1f('0x93'));var _0x538218=_0x146430+_0x5c1f('0x9f');socket[_0x5c1f('0x22')](_0x5c1f('0x78')+_0x146430+_0x5c1f('0x119'),{'UserId':_0x40b18c,['queueField']:_0x130118[_0x36a585]['id']});}})[_0x5c1f('0x24')](respondWithStatusCode(_0x508cf8,null))[_0x5c1f('0x50')](APIHandleError(_0x508cf8));};exports[_0x5c1f('0x11a')]=function(_0x33b4df,_0x51fabf){var _0x14fc71={};var _0x3138f7={};var _0x2f23e0;var _0x49e7ae;return db['User'][_0x5c1f('0xc4')]({'where':{'id':_0x33b4df['params']['id']}})[_0x5c1f('0x24')](handleEntityNotFound(_0x51fabf,null))[_0x5c1f('0x24')](function(_0x27dcc4){if(_0x27dcc4){_0x2f23e0=_0x27dcc4;_0x3138f7[_0x5c1f('0xce')]=_[_0x5c1f('0xcf')](db[_0x5c1f('0xc8')][_0x5c1f('0x31')]);_0x3138f7[_0x5c1f('0x46')]=_[_0x5c1f('0xcf')](_0x33b4df[_0x5c1f('0x46')]);_0x3138f7[_0x5c1f('0xd6')]=_[_0x5c1f('0xd1')](_0x3138f7[_0x5c1f('0xce')],_0x3138f7[_0x5c1f('0x46')]);_0x14fc71[_0x5c1f('0x42')]=_['intersection'](_0x3138f7[_0x5c1f('0xce')],qs[_0x5c1f('0xd2')](_0x33b4df[_0x5c1f('0x46')][_0x5c1f('0xd2')]));_0x14fc71[_0x5c1f('0x42')]=_0x14fc71['attributes'][_0x5c1f('0x48')]?_0x14fc71['attributes']:_0x3138f7[_0x5c1f('0xce')];_0x14fc71['order']=qs[_0x5c1f('0xd4')](_0x33b4df[_0x5c1f('0x46')][_0x5c1f('0xd4')]);_0x14fc71[_0x5c1f('0x3c')]=qs['filters'](_['pick'](_0x33b4df[_0x5c1f('0x46')],_0x3138f7['filters']));if(_0x33b4df['query'][_0x5c1f('0x2a')]){_0x14fc71[_0x5c1f('0x3c')]=_['merge'](_0x14fc71[_0x5c1f('0x3c')],{'$or':_['map'](_0x14fc71[_0x5c1f('0x42')],function(_0x38d4cf){var _0x44c200={};_0x44c200[_0x38d4cf]={'$like':'%'+_0x33b4df[_0x5c1f('0x46')]['filter']+'%'};return _0x44c200;})});}_0x14fc71=_[_0x5c1f('0x53')]({},_0x14fc71,_0x33b4df[_0x5c1f('0xd7')]);return _0x2f23e0['getLists'](_0x14fc71);}})['then'](function(_0x5e981d){if(_0x5e981d){_0x49e7ae=_0x5e981d['length'];if(!_0x33b4df['query'][_0x5c1f('0xc7')](_0x5c1f('0xd9'))){_0x14fc71[_0x5c1f('0x1c')]=qs[_0x5c1f('0x1c')](_0x33b4df[_0x5c1f('0x46')][_0x5c1f('0x1c')]);_0x14fc71[_0x5c1f('0x1a')]=qs[_0x5c1f('0x1a')](_0x33b4df[_0x5c1f('0x46')][_0x5c1f('0x1a')]);}return _0x2f23e0[_0x5c1f('0x11a')](_0x14fc71);}})[_0x5c1f('0x24')](function(_0x2ec4ba){if(_0x2ec4ba){return _0x2ec4ba?{'count':_0x49e7ae,'rows':_0x2ec4ba}:null;}})[_0x5c1f('0x24')](respondWithResult(_0x51fabf,null))[_0x5c1f('0x50')](handleError(_0x51fabf,null));};exports['getAgents']=function(_0x3ae16f,_0x5be5d1){var _0x2ff1b0={};var _0x38a10d={};var _0x4ffccb;return db[_0x5c1f('0x54')]['findOne']({'where':{'id':_0x3ae16f[_0x5c1f('0x52')]['id']}})['then'](handleEntityNotFound(_0x5be5d1,null))['then'](function(_0x404107){if(_0x404107){_0x4ffccb=_0x404107;_0x38a10d[_0x5c1f('0xce')]=_[_0x5c1f('0xcf')](db[_0x5c1f('0x54')][_0x5c1f('0x31')]);_0x38a10d[_0x5c1f('0x46')]=_[_0x5c1f('0xcf')](_0x3ae16f[_0x5c1f('0x46')]);_0x38a10d[_0x5c1f('0xd6')]=_[_0x5c1f('0xd1')](_0x38a10d['model'],_0x38a10d[_0x5c1f('0x46')]);_0x2ff1b0['attributes']=_['intersection'](_0x38a10d[_0x5c1f('0xce')],qs['fields'](_0x3ae16f[_0x5c1f('0x46')]['fields']));_0x2ff1b0['attributes']=_0x2ff1b0['attributes'][_0x5c1f('0x48')]?_0x2ff1b0[_0x5c1f('0x42')]:_0x38a10d[_0x5c1f('0xce')];_0x2ff1b0[_0x5c1f('0xd3')]=qs[_0x5c1f('0xd4')](_0x3ae16f['query'][_0x5c1f('0xd4')]);_0x2ff1b0[_0x5c1f('0x3c')]=qs[_0x5c1f('0xd6')](_[_0x5c1f('0xd5')](_0x3ae16f[_0x5c1f('0x46')],_0x38a10d[_0x5c1f('0xd6')]));if(_0x3ae16f['query'][_0x5c1f('0x2a')]){_0x2ff1b0[_0x5c1f('0x3c')]=_[_0x5c1f('0x53')](_0x2ff1b0['where'],{'$or':_['map'](_0x2ff1b0[_0x5c1f('0x42')],function(_0x441364){var _0x195067={};_0x195067[_0x441364]={'$like':'%'+_0x3ae16f[_0x5c1f('0x46')][_0x5c1f('0x2a')]+'%'};return _0x195067;})});}_0x2ff1b0[_0x5c1f('0xce')]=db[_0x5c1f('0x54')];_0x2ff1b0['as']=_0x5c1f('0x28');_0x2ff1b0=_[_0x5c1f('0x53')]({},_0x2ff1b0,_0x3ae16f[_0x5c1f('0xd7')]);return _0x4ffccb[_0x5c1f('0xf4')]({'include':[_0x2ff1b0]});}})[_0x5c1f('0x24')](function(_0x5a52df){if(_0x5a52df){var _0x1083d8={},_0x57e024=[];for(var _0x542cbe=0x0;_0x542cbe<_0x5a52df['length'];_0x542cbe+=0x1){for(var _0x14c721=0x0,_0x2c33c8;_0x14c721<_0x5a52df[_0x542cbe][_0x5c1f('0x28')][_0x5c1f('0x48')];_0x14c721+=0x1){_0x2c33c8=_0x5a52df[_0x542cbe][_0x5c1f('0x28')][_0x14c721][_0x5c1f('0x25')]({'plain':!![]});_0x1083d8[_0x2c33c8['id']]=_0x2c33c8;}}_0x1083d8=_['values'](_0x1083d8);for(var _0x583ed7=qs['offset'](_0x3ae16f[_0x5c1f('0x46')][_0x5c1f('0x1a')]);_0x583ed7<_0x1083d8[_0x5c1f('0x48')]&&_0x57e024[_0x5c1f('0x48')]=_0x52c45b[_0x6f9e('0x51')]){throw new Error(_0x6f9e('0x52'));}})[_0x6f9e('0x18')](function(){if(_0x32fd0c){return db['UserVoiceQueueRt'][_0x6f9e('0x47')]({'where':{'membername':_0x32fd0c['name']},'individualHooks':!![]});}})['then'](function(){if(_0x32fd0c){return _0x32fd0c[_0x6f9e('0x53')]({'raw':!![]});}})['then'](function(_0x1ac85e){if(_0x32fd0c){if(_0x1ac85e){var _0x5d0242=[];_0x1a9d3d=_0x1ac85e;if(_0x1a9d3d[_0x6f9e('0x2a')]){for(var _0x1ba3ba=0x0;_0x1ba3ba<_0x1a9d3d[_0x6f9e('0x2a')];_0x1ba3ba++){_0x5d0242[_0x6f9e('0x48')](db[_0x6f9e('0x27')][_0x6f9e('0x54')]({'membername':_0x32fd0c[_0x6f9e('0x3b')],'UserId':_0x32fd0c['id'],'queue_name':_0x1a9d3d[_0x1ba3ba][_0x6f9e('0x3b')],'VoiceQueueId':_0x1a9d3d[_0x1ba3ba]['id'],'interface':_0x39a1dc,'paused':_0x32fd0c['loginInPause']||![],'penalty':_0x1a9d3d[_0x1ba3ba]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0x6f9e('0x4a')](_0x5d0242);}}}})[_0x6f9e('0x18')](function(){if(_0x32fd0c){return db[_0x6f9e('0x28')]['findAll']({'where':{'membername':_0x32fd0c[_0x6f9e('0x3b')],'exitAt':null}});}})['then'](function(_0x67715b){if(_0x32fd0c){if(_0x67715b&&_0x67715b[_0x6f9e('0x2a')]){var _0x18edcc=[];_0x67715b['forEach'](function(_0x432b0c){_0x18edcc[_0x6f9e('0x48')](_0x432b0c[_0x6f9e('0x49')]({'exitAt':moment()[_0x6f9e('0x2b')](_0x6f9e('0x2c'))}));});return BPromise['all'](_0x18edcc);}}})[_0x6f9e('0x18')](function(){if(_0x32fd0c){var _0x381aa2=[];var _0x56ed97=[];var _0x24b303=utils[_0x6f9e('0x55')]();var _0x12f164={'membername':_0x32fd0c['name'],'interface':_0x39a1dc,'enterAt':moment()['format'](_0x6f9e('0x2c')),'role':_0x32fd0c[_0x6f9e('0x22')],'internal':_0x32fd0c[_0x6f9e('0x23')]};_0x24b303[_0x6f9e('0x2e')](function(_0x28c735){_0x381aa2[_0x6f9e('0x48')](_['merge']({'channel':_0x28c735,'type':_0x6f9e('0x56'),'data1':_0x6f9e('0x57'),'data2':_0x39a1dc},_0x12f164));if(_0x32fd0c['loginInPause']){_0x56ed97[_0x6f9e('0x48')](_[_0x6f9e('0x58')]({'channel':_0x28c735,'type':'PAUSE','data1':_0x6f9e('0x59')},_0x12f164));}});return db[_0x6f9e('0x28')][_0x6f9e('0x34')](_0x381aa2['concat'](_0x56ed97),{'individualHooks':!![]});}})['then'](function(){if(_0x32fd0c){return _0x32fd0c[_0x6f9e('0x49')]({'online':!![],'lastLoginAt':moment()[_0x6f9e('0x2b')](_0x6f9e('0x2c')),'voicePause':_0x32fd0c[_0x6f9e('0x5a')]||![],'mailPause':_0x32fd0c[_0x6f9e('0x5a')]||![],'chatPause':_0x32fd0c[_0x6f9e('0x5a')]||![],'faxPause':_0x32fd0c[_0x6f9e('0x5a')]||![],'smsPause':_0x32fd0c[_0x6f9e('0x5a')]||![],'openchannelPause':_0x32fd0c[_0x6f9e('0x5a')]||![],'pauseType':_0x32fd0c[_0x6f9e('0x5a')]?_0x6f9e('0x59'):null,'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x39a1dc});}})[_0x6f9e('0x18')](function(_0x57e670){_0xf0fa73(_0x57e670);})['catch'](function(_0x1a698f){_0x150da0(_0xdb209c[_0x6f9e('0x20')](0x1f4,_0x1a698f['message']));});});}; \ No newline at end of file +var _0xf76d=['smsPause','lastPauseAt','User\x20with\x20id\x20%s\x20not\x20found','unpause','system','LogoutUser','destroy','all','LoginUser','mobile','phone','loginInPause','count','agent','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert','merge','LOGIN','callysquare','LOGININPAUSE','moment','ioredis','../../config/logger','rpc','redis','localhost','socket.io-emitter','register','GetUser','User','options','where','attributes','limit','include','map','model','then','info','stringify','catch','error','message','find','raw','ShowUser','debug','role','internal','format','params','UserVoiceQueueRt','MemberReport','findAll','name','PAUSE','length','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','getChannels','forEach','push','isNil','interface','SIP/%s','body','type','DEFAULT\x20PAUSE','uniqueid','bulkCreate','update','UnpauseUser','resolve','isValidChannel','Channel\x20parameter\x20%s\x20is\x20invalid','channel','findOne','mailPause','chatPause','faxPause','openchannelPause'];(function(_0x58c20f,_0x4cdb1b){var _0x3b0318=function(_0x36fa84){while(--_0x36fa84){_0x58c20f['push'](_0x58c20f['shift']());}};_0x3b0318(++_0x4cdb1b);}(_0xf76d,0x113));var _0xdf76=function(_0x29aefc,_0x4dcf53){_0x29aefc=_0x29aefc-0x0;var _0x11be36=_0xf76d[_0x29aefc];return _0x11be36;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xdf76('0x0'));var BPromise=require('bluebird');var Redis=require(_0xdf76('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xdf76('0x2'))(_0xdf76('0x3'));var config=require('../../config/environment');config[_0xdf76('0x4')]=_['defaults'](config[_0xdf76('0x4')],{'host':_0xdf76('0x5'),'port':0x18eb});var socket=require(_0xdf76('0x6'))(new Redis(config[_0xdf76('0x4')]));require('./user.socket')[_0xdf76('0x7')](socket);exports[_0xdf76('0x8')]=function(_0x2c7c9c){var _0x265caa=this;return new Promise(function(_0x49bc24,_0x23c91f){return db[_0xdf76('0x9')]['findAll']({'raw':_0x2c7c9c[_0xdf76('0xa')]?_0x2c7c9c['options']['raw']===undefined?!![]:![]:!![],'where':_0x2c7c9c[_0xdf76('0xa')]?_0x2c7c9c[_0xdf76('0xa')][_0xdf76('0xb')]||null:null,'attributes':_0x2c7c9c['options']?_0x2c7c9c[_0xdf76('0xa')][_0xdf76('0xc')]||null:null,'limit':_0x2c7c9c[_0xdf76('0xa')]?_0x2c7c9c[_0xdf76('0xa')][_0xdf76('0xd')]||null:null,'include':_0x2c7c9c[_0xdf76('0xa')]?_0x2c7c9c[_0xdf76('0xa')][_0xdf76('0xe')]?_[_0xdf76('0xf')](_0x2c7c9c[_0xdf76('0xa')][_0xdf76('0xe')],function(_0x2a91c9){return{'model':db[_0x2a91c9[_0xdf76('0x10')]],'as':_0x2a91c9['as'],'attributes':_0x2a91c9[_0xdf76('0xc')],'include':_0x2a91c9[_0xdf76('0xe')]?_['map'](_0x2a91c9[_0xdf76('0xe')],function(_0x4c2339){return{'model':db[_0x4c2339[_0xdf76('0x10')]],'as':_0x4c2339['as'],'attributes':_0x4c2339[_0xdf76('0xc')],'include':_0x4c2339['include']?_[_0xdf76('0xf')](_0x4c2339['include'],function(_0x30ce19){return{'model':db[_0x30ce19[_0xdf76('0x10')]],'as':_0x30ce19['as'],'attributes':_0x30ce19[_0xdf76('0xc')]};}):[]};}):[]};}):[]:[]})[_0xdf76('0x11')](function(_0x3571b1){logger[_0xdf76('0x12')](_0xdf76('0x8'),_0x2c7c9c);logger['debug']('GetUser',_0x2c7c9c,JSON[_0xdf76('0x13')](_0x3571b1));_0x49bc24(_0x3571b1);})[_0xdf76('0x14')](function(_0x270d6f){logger[_0xdf76('0x15')](_0xdf76('0x8'),_0x270d6f[_0xdf76('0x16')],_0x2c7c9c);_0x23c91f(_0x265caa[_0xdf76('0x15')](0x1f4,_0x270d6f[_0xdf76('0x16')]));});});};exports['ShowUser']=function(_0x34a837){var _0x5ef1a4=this;return new Promise(function(_0x2fb2e3,_0x5a72a9){return db[_0xdf76('0x9')][_0xdf76('0x17')]({'raw':_0x34a837[_0xdf76('0xa')]?_0x34a837[_0xdf76('0xa')][_0xdf76('0x18')]===undefined?!![]:![]:!![],'where':_0x34a837['options']?_0x34a837[_0xdf76('0xa')][_0xdf76('0xb')]||null:null,'attributes':_0x34a837[_0xdf76('0xa')]?_0x34a837['options'][_0xdf76('0xc')]||null:null,'include':_0x34a837[_0xdf76('0xa')]?_0x34a837['options'][_0xdf76('0xe')]?_[_0xdf76('0xf')](_0x34a837[_0xdf76('0xa')]['include'],function(_0x4aa4cc){return{'model':db[_0x4aa4cc[_0xdf76('0x10')]],'as':_0x4aa4cc['as'],'attributes':_0x4aa4cc[_0xdf76('0xc')],'include':_0x4aa4cc[_0xdf76('0xe')]?_[_0xdf76('0xf')](_0x4aa4cc['include'],function(_0x4e7d7e){return{'model':db[_0x4e7d7e[_0xdf76('0x10')]],'as':_0x4e7d7e['as'],'attributes':_0x4e7d7e[_0xdf76('0xc')],'include':_0x4e7d7e[_0xdf76('0xe')]?_[_0xdf76('0xf')](_0x4e7d7e[_0xdf76('0xe')],function(_0x42ec3b){return{'model':db[_0x42ec3b[_0xdf76('0x10')]],'as':_0x42ec3b['as'],'attributes':_0x42ec3b[_0xdf76('0xc')]};}):[]};}):[]};}):[]:[]})[_0xdf76('0x11')](function(_0x414a3f){logger['info'](_0xdf76('0x19'),_0x34a837);logger[_0xdf76('0x1a')](_0xdf76('0x19'),_0x34a837,JSON[_0xdf76('0x13')](_0x414a3f));_0x2fb2e3(_0x414a3f);})[_0xdf76('0x14')](function(_0x1a6bf2){logger[_0xdf76('0x15')](_0xdf76('0x19'),_0x1a6bf2[_0xdf76('0x16')],_0x34a837);_0x5a72a9(_0x5ef1a4['error'](0x1f4,_0x1a6bf2['message']));});});};exports['PauseUser']=function(_0x132503){var _0x4e9831;return db[_0xdf76('0x9')][_0xdf76('0x17')]({'where':_0x132503[_0xdf76('0xa')][_0xdf76('0xb')]||{},'attributes':['id','name',_0xdf76('0x1b'),_0xdf76('0x1c'),'interface']})[_0xdf76('0x11')](function(_0x24bb16){if(!_0x24bb16){throw new Error(util[_0xdf76('0x1d')]('User\x20with\x20id\x20%s\x20not\x20found',_0x132503[_0xdf76('0x1e')]['id']));}_0x4e9831=_0x24bb16;return db[_0xdf76('0x1f')]['update']({'paused':0x1},{'where':{'UserId':_0x4e9831['id']},'individualHooks':!![]});})[_0xdf76('0x11')](function(){return db[_0xdf76('0x20')][_0xdf76('0x21')]({'where':{'membername':_0x4e9831[_0xdf76('0x22')],'type':_0xdf76('0x23'),'exitAt':null}});})[_0xdf76('0x11')](function(_0x5e455e){if(_0x5e455e&&_0x5e455e[_0xdf76('0x24')]){var _0x18afcf=moment()['format'](_0xdf76('0x25'));for(var _0x75a83e=0x0,_0x25baa6=_0x5e455e['length'];_0x75a83e<_0x25baa6;_0x75a83e++){_0x5e455e[_0x75a83e][_0xdf76('0x26')]({'exitAt':_0x18afcf});}}})[_0xdf76('0x11')](function(){var _0x106d5e=[];var _0x5b84e7=utils[_0xdf76('0x27')]();_0x5b84e7[_0xdf76('0x28')](function(_0x3835bb){_0x106d5e[_0xdf76('0x29')]({'channel':_0x3835bb,'membername':_0x4e9831[_0xdf76('0x22')],'interface':_[_0xdf76('0x2a')](_0x4e9831[_0xdf76('0x2b')])?util[_0xdf76('0x1d')](_0xdf76('0x2c'),_0x4e9831[_0xdf76('0x22')]):_0x4e9831[_0xdf76('0x2b')],'type':_0xdf76('0x23'),'enterAt':moment()[_0xdf76('0x1d')](_0xdf76('0x25')),'data1':_0x132503[_0xdf76('0x2d')][_0xdf76('0x2e')]||_0xdf76('0x2f'),'role':_0x4e9831[_0xdf76('0x1b')],'internal':_0x4e9831[_0xdf76('0x1c')],'uniqueid':_0x132503[_0xdf76('0x2d')][_0xdf76('0x30')]||null});});return db['MemberReport'][_0xdf76('0x31')](_0x106d5e,{'individualHooks':!![]});})[_0xdf76('0x11')](function(){return _0x4e9831[_0xdf76('0x32')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x132503[_0xdf76('0x2d')]['type']||'DEFAULT\x20PAUSE','lastPauseAt':moment()['format'](_0xdf76('0x25'))});})[_0xdf76('0x14')](function(_0x3144cb){throw _0x3144cb;});};exports[_0xdf76('0x33')]=function(_0xc89946){return Promise[_0xdf76('0x34')]()['then'](function(){if(_0xc89946[_0xdf76('0x2d')]['channel']&&!utils[_0xdf76('0x35')](_0xc89946[_0xdf76('0x2d')]['channel'])){throw new Error(util[_0xdf76('0x1d')](_0xdf76('0x36'),_0xc89946[_0xdf76('0x2d')][_0xdf76('0x37')]));}return db[_0xdf76('0x9')][_0xdf76('0x38')]({'where':_0xc89946[_0xdf76('0xa')]['where']||{},'attributes':['id',_0xdf76('0x22'),_0xdf76('0x1b'),_0xdf76('0x1c'),'interface','online','voicePause',_0xdf76('0x39'),_0xdf76('0x3a'),_0xdf76('0x3b'),_0xdf76('0x3c'),_0xdf76('0x3d'),'whatsappPause','pauseType',_0xdf76('0x3e')]});})[_0xdf76('0x11')](function(_0x4044ff){if(!_0x4044ff){throw new Error(util['format'](_0xdf76('0x3f'),_0xc89946[_0xdf76('0x1e')]['id']));}return _0x4044ff[_0xdf76('0x40')](_0xc89946[_0xdf76('0x2d')][_0xdf76('0x37')],_0xdf76('0x41'));})[_0xdf76('0x14')](function(_0x3430ab){throw _0x3430ab;});};exports[_0xdf76('0x42')]=function(_0x200ae1){var _0x53a7d5=this;return new Promise(function(_0x2f5705,_0x112e97){var _0xc23a3f;return db[_0xdf76('0x9')][_0xdf76('0x38')]({'where':_0x200ae1[_0xdf76('0xa')][_0xdf76('0xb')]||{},'attributes':['id','name']})['then'](function(_0x51f8e4){if(_0x51f8e4){_0xc23a3f=_0x51f8e4;return db['UserVoiceQueueRt'][_0xdf76('0x43')]({'where':{'membername':_0xc23a3f[_0xdf76('0x22')]},'individualHooks':!![]});}})[_0xdf76('0x11')](function(){if(_0xc23a3f){return db['MemberReport'][_0xdf76('0x21')]({'where':{'membername':_0xc23a3f[_0xdf76('0x22')],'exitAt':null}});}})['then'](function(_0x3e088c){if(_0xc23a3f){if(_0x3e088c&&_0x3e088c['length']){var _0x3328e3=[];_0x3e088c[_0xdf76('0x28')](function(_0x161121){_0x3328e3['push'](_0x161121[_0xdf76('0x32')]({'exitAt':moment()['format'](_0xdf76('0x25'))}));});return BPromise[_0xdf76('0x44')](_0x3328e3);}}})[_0xdf76('0x11')](function(){if(_0xc23a3f){return _0xc23a3f['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})['then'](function(_0x7334f5){_0x2f5705(_0x7334f5);})[_0xdf76('0x14')](function(_0x4343f2){_0x112e97(_0x53a7d5[_0xdf76('0x15')](0x1f4,_0x4343f2[_0xdf76('0x16')]));});});};exports[_0xdf76('0x45')]=function(_0x232066){var _0x527a0c=this;return new Promise(function(_0x15a13a,_0x85d763){var _0x2ea872;var _0x4c2773;var _0xf94b6b;var _0x51e7bc;return db[_0xdf76('0x9')]['findOne']({'where':_0x232066[_0xdf76('0xa')][_0xdf76('0xb')]||{},'attributes':['id','name','role',_0xdf76('0x46'),_0xdf76('0x47'),'internal',_0xdf76('0x48'),_0xdf76('0x2b')]})[_0xdf76('0x11')](function(_0x28a506){if(_0x28a506){_0x2ea872=_0x28a506;_0x51e7bc=_0x232066[_0xdf76('0x2d')]['interface']?_0x232066[_0xdf76('0x2d')][_0xdf76('0x2b')]:util['format'](_0xdf76('0x2c'),_0x2ea872[_0xdf76('0x22')]);return db[_0xdf76('0x9')][_0xdf76('0x49')]({'where':{'role':_0xdf76('0x4a'),'online':!![],'id':{'$ne':_0x2ea872['id']}}});}})['then'](function(_0x4fd019){if(_0x4fd019){_0xf94b6b=_0x4fd019;return require('../../config/license/util')[_0xdf76('0x4b')]();}})[_0xdf76('0x11')](function(_0x5d07a8){if(_0x5d07a8&&_0x5d07a8[_0xdf76('0x4c')]&&_0xf94b6b>=_0x5d07a8[_0xdf76('0x4c')]){throw new Error(_0xdf76('0x4d'));}})[_0xdf76('0x11')](function(){if(_0x2ea872){return db[_0xdf76('0x1f')][_0xdf76('0x43')]({'where':{'membername':_0x2ea872[_0xdf76('0x22')]},'individualHooks':!![]});}})['then'](function(){if(_0x2ea872){return _0x2ea872[_0xdf76('0x4e')]({'raw':!![]});}})[_0xdf76('0x11')](function(_0x51b4d7){if(_0x2ea872){if(_0x51b4d7){var _0x8eceb1=[];_0x4c2773=_0x51b4d7;if(_0x4c2773[_0xdf76('0x24')]){for(var _0x4320c3=0x0;_0x4320c3<_0x4c2773[_0xdf76('0x24')];_0x4320c3++){_0x8eceb1[_0xdf76('0x29')](db[_0xdf76('0x1f')][_0xdf76('0x4f')]({'membername':_0x2ea872[_0xdf76('0x22')],'UserId':_0x2ea872['id'],'queue_name':_0x4c2773[_0x4320c3][_0xdf76('0x22')],'VoiceQueueId':_0x4c2773[_0x4320c3]['id'],'interface':_0x51e7bc,'paused':_0x2ea872[_0xdf76('0x48')]||![],'penalty':_0x4c2773[_0x4320c3]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0xdf76('0x44')](_0x8eceb1);}}}})[_0xdf76('0x11')](function(){if(_0x2ea872){return db[_0xdf76('0x20')][_0xdf76('0x21')]({'where':{'membername':_0x2ea872['name'],'exitAt':null}});}})[_0xdf76('0x11')](function(_0x2f4d2d){if(_0x2ea872){if(_0x2f4d2d&&_0x2f4d2d[_0xdf76('0x24')]){var _0x3f0428=[];_0x2f4d2d[_0xdf76('0x28')](function(_0x3c04a9){_0x3f0428[_0xdf76('0x29')](_0x3c04a9[_0xdf76('0x32')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0xdf76('0x44')](_0x3f0428);}}})[_0xdf76('0x11')](function(){if(_0x2ea872){var _0x4d96a8=[];var _0x57af2c=[];var _0x413f4a=utils['getChannels']();var _0x25fe07={'membername':_0x2ea872[_0xdf76('0x22')],'interface':_0x51e7bc,'enterAt':moment()[_0xdf76('0x1d')](_0xdf76('0x25')),'role':_0x2ea872[_0xdf76('0x1b')],'internal':_0x2ea872[_0xdf76('0x1c')]};_0x413f4a['forEach'](function(_0x3e3be2){_0x4d96a8[_0xdf76('0x29')](_[_0xdf76('0x50')]({'channel':_0x3e3be2,'type':_0xdf76('0x51'),'data1':_0xdf76('0x52'),'data2':_0x51e7bc},_0x25fe07));if(_0x2ea872[_0xdf76('0x48')]){_0x57af2c[_0xdf76('0x29')](_[_0xdf76('0x50')]({'channel':_0x3e3be2,'type':'PAUSE','data1':_0xdf76('0x53')},_0x25fe07));}});return db['MemberReport'][_0xdf76('0x31')](_0x4d96a8['concat'](_0x57af2c),{'individualHooks':!![]});}})[_0xdf76('0x11')](function(){if(_0x2ea872){return _0x2ea872[_0xdf76('0x32')]({'online':!![],'lastLoginAt':moment()[_0xdf76('0x1d')](_0xdf76('0x25')),'voicePause':_0x2ea872[_0xdf76('0x48')]||![],'mailPause':_0x2ea872[_0xdf76('0x48')]||![],'chatPause':_0x2ea872[_0xdf76('0x48')]||![],'faxPause':_0x2ea872[_0xdf76('0x48')]||![],'smsPause':_0x2ea872[_0xdf76('0x48')]||![],'openchannelPause':_0x2ea872[_0xdf76('0x48')]||![],'pauseType':_0x2ea872[_0xdf76('0x48')]?'LOGININPAUSE':null,'lastPauseAt':moment()[_0xdf76('0x1d')]('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x51e7bc});}})[_0xdf76('0x11')](function(_0x4ef046){_0x15a13a(_0x4ef046);})[_0xdf76('0x14')](function(_0x252953){_0x85d763(_0x527a0c[_0xdf76('0x15')](0x1f4,_0x252953[_0xdf76('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 1f7843b..c62d120 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 _0x92b9=['removeListener','register','user:','./user.events','save','remove','update','emit'];(function(_0x146fc9,_0x462848){var _0x13921f=function(_0x17ea99){while(--_0x17ea99){_0x146fc9['push'](_0x146fc9['shift']());}};_0x13921f(++_0x462848);}(_0x92b9,0x19b));var _0x992b=function(_0x4c65fd,_0x2ba5cc){_0x4c65fd=_0x4c65fd-0x0;var _0x315e4b=_0x92b9[_0x4c65fd];return _0x315e4b;};'use strict';var UserEvents=require(_0x992b('0x0'));var events=[_0x992b('0x1'),_0x992b('0x2'),_0x992b('0x3')];function createListener(_0x2947be,_0x55b478){return function(_0x402656){_0x55b478[_0x992b('0x4')](_0x2947be,_0x402656);};}function removeListener(_0x31cd50,_0x34f47d){return function(){UserEvents[_0x992b('0x5')](_0x31cd50,_0x34f47d);};}exports[_0x992b('0x6')]=function(_0x44b4a2){for(var _0x4fb2e3=0x0,_0x3f4c83=events['length'];_0x4fb2e3<_0x3f4c83;_0x4fb2e3++){var _0x520045=events[_0x4fb2e3];var _0x33412a=createListener(_0x992b('0x7')+_0x520045,_0x44b4a2);UserEvents['on'](_0x520045,_0x33412a);}}; \ No newline at end of file +var _0x8978=['remove','emit','removeListener','length','user:','./user.events','save'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x8978,0xde));var _0x8897=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x8978[_0x1ac595];return _0x455fff;};'use strict';var UserEvents=require(_0x8897('0x0'));var events=[_0x8897('0x1'),_0x8897('0x2'),'update'];function createListener(_0x43c8c3,_0x55a404){return function(_0x2b81b1){_0x55a404[_0x8897('0x3')](_0x43c8c3,_0x2b81b1);};}function removeListener(_0x2661d6,_0x4f7ec8){return function(){UserEvents[_0x8897('0x4')](_0x2661d6,_0x4f7ec8);};}exports['register']=function(_0x5b8cde){for(var _0x11eaec=0x0,_0x5a9d90=events[_0x8897('0x5')];_0x11eaec<_0x5a9d90;_0x11eaec++){var _0x2f5183=events[_0x11eaec];var _0xb51d93=createListener(_0x8897('0x6')+_0x2f5183,_0x5b8cde);UserEvents['on'](_0x2f5183,_0xb51d93);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index fddffb6..e3f3b04 100644 --- a/server/api/userChatQueue/index.js +++ b/server/api/userChatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x5cbf8a,_0xc887b8){var _0x22a5fa=function(_0x3a5b03){while(--_0x3a5b03){_0x5cbf8a['push'](_0x5cbf8a['shift']());}};_0x22a5fa(++_0xc887b8);}(_0xe706,0xa3));var _0x6e70=function(_0x258d86,_0x2ac3f3){_0x258d86=_0x258d86-0x0;var _0x46ff28=_0xe706[_0x258d86];return _0x46ff28;};'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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0xf5fa0d,_0x17485e){var _0x2633e3=function(_0x593a2f){while(--_0x593a2f){_0xf5fa0d['push'](_0xf5fa0d['shift']());}};_0x2633e3(++_0x17485e);}(_0x9c44,0x178));var _0x49c4=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x9c44[_0x3d42d8];return _0x27fc41;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 4be3110..2c5863f 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 _0x72b1=['INTEGER','sequelize','exports'];(function(_0x88f701,_0x5ed538){var _0x53bf89=function(_0x31756e){while(--_0x31756e){_0x88f701['push'](_0x88f701['shift']());}};_0x53bf89(++_0x5ed538);}(_0x72b1,0x103));var _0x172b=function(_0x40ac69,_0x49c81a){_0x40ac69=_0x40ac69-0x0;var _0x3796c1=_0x72b1[_0x40ac69];return _0x3796c1;};'use strict';var Sequelize=require(_0x172b('0x0'));module[_0x172b('0x1')]={'penalty':{'type':Sequelize[_0x172b('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x5ab9=['exports','INTEGER','sequelize'];(function(_0x423a7d,_0x22d7bd){var _0x1982b3=function(_0xdeefab){while(--_0xdeefab){_0x423a7d['push'](_0x423a7d['shift']());}};_0x1982b3(++_0x22d7bd);}(_0x5ab9,0x1c7));var _0x95ab=function(_0x3a9468,_0x2b6266){_0x3a9468=_0x3a9468-0x0;var _0x1d2345=_0x5ab9[_0x3a9468];return _0x1d2345;};'use strict';var Sequelize=require(_0x95ab('0x0'));module[_0x95ab('0x1')]={'penalty':{'type':Sequelize[_0x95ab('0x2')],'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 9fe0fae..9fa5a70 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 _0xb9b7=['request-promise','path','rimraf','../../config/environment','./userChatQueue.attributes','exports','define','UserChatQueue','user_has_chat_queues','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x474f25,_0x49624f){var _0x397ebc=function(_0x12d273){while(--_0x12d273){_0x474f25['push'](_0x474f25['shift']());}};_0x397ebc(++_0x49624f);}(_0xb9b7,0x144));var _0x7b9b=function(_0x4bb694,_0x2b9c2d){_0x4bb694=_0x4bb694-0x0;var _0xe1d0f8=_0xb9b7[_0x4bb694];return _0xe1d0f8;};'use strict';var _=require(_0x7b9b('0x0'));var util=require(_0x7b9b('0x1'));var logger=require(_0x7b9b('0x2'))(_0x7b9b('0x3'));var moment=require(_0x7b9b('0x4'));var BPromise=require(_0x7b9b('0x5'));var rp=require(_0x7b9b('0x6'));var fs=require('fs');var path=require(_0x7b9b('0x7'));var rimraf=require(_0x7b9b('0x8'));var config=require(_0x7b9b('0x9'));var attributes=require(_0x7b9b('0xa'));module[_0x7b9b('0xb')]=function(_0xfb5dd8,_0x26cb05){return _0xfb5dd8[_0x7b9b('0xc')](_0x7b9b('0xd'),attributes,{'tableName':_0x7b9b('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3c7d=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./userChatQueue.attributes','exports','define','UserChatQueue'];(function(_0x28b072,_0xbf8b6){var _0x39fce7=function(_0x336cc9){while(--_0x336cc9){_0x28b072['push'](_0x28b072['shift']());}};_0x39fce7(++_0xbf8b6);}(_0x3c7d,0x1e1));var _0xd3c7=function(_0x4c440b,_0x3ea627){_0x4c440b=_0x4c440b-0x0;var _0x2d48cf=_0x3c7d[_0x4c440b];return _0x2d48cf;};'use strict';var _=require(_0xd3c7('0x0'));var util=require(_0xd3c7('0x1'));var logger=require(_0xd3c7('0x2'))(_0xd3c7('0x3'));var moment=require(_0xd3c7('0x4'));var BPromise=require(_0xd3c7('0x5'));var rp=require(_0xd3c7('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd3c7('0x7'));var config=require(_0xd3c7('0x8'));var attributes=require(_0xd3c7('0x9'));module[_0xd3c7('0xa')]=function(_0x442e9a,_0x4c0e2c){return _0x442e9a[_0xd3c7('0xb')](_0xd3c7('0xc'),attributes,{'tableName':'user_has_chat_queues','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 0346f15..8ee3381 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 _0x6548=['../../config/environment','jayson/promise','client','request','then','info','UserChatQueue,\x20%s,\x20%s','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','moment','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x6548,0x112));var _0x8654=function(_0x4de958,_0x5b760e){_0x4de958=_0x4de958-0x0;var _0x6c13ff=_0x6548[_0x4de958];return _0x6c13ff;};'use strict';var _=require(_0x8654('0x0'));var util=require('util');var moment=require(_0x8654('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8654('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x8654('0x3'));var logger=require(_0x8654('0x4'))(_0x8654('0x5'));var config=require(_0x8654('0x6'));var jayson=require(_0x8654('0x7'));var client=jayson[_0x8654('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x44f3a3,_0x1a1847,_0x47463f){return new BPromise(function(_0x57f119,_0x15f9e4){return client[_0x8654('0x9')](_0x44f3a3,_0x47463f)[_0x8654('0xa')](function(_0x339700){logger[_0x8654('0xb')](_0x8654('0xc'),_0x1a1847,'request\x20sent');logger[_0x8654('0xd')](_0x8654('0xe'),_0x1a1847,_0x8654('0xf'),JSON['stringify'](_0x339700));if(_0x339700[_0x8654('0x10')]){if(_0x339700[_0x8654('0x10')][_0x8654('0x11')]===0x1f4){logger['error'](_0x8654('0xc'),_0x1a1847,_0x339700[_0x8654('0x10')][_0x8654('0x12')]);return _0x15f9e4(_0x339700[_0x8654('0x10')]['message']);}logger['error'](_0x8654('0xc'),_0x1a1847,_0x339700['error']['message']);return _0x57f119(_0x339700[_0x8654('0x10')][_0x8654('0x12')]);}else{logger[_0x8654('0xb')](_0x8654('0xc'),_0x1a1847,'request\x20sent');_0x57f119(_0x339700[_0x8654('0x13')][_0x8654('0x12')]);}})['catch'](function(_0x4742a8){logger[_0x8654('0x10')]('UserChatQueue,\x20%s,\x20%s',_0x1a1847,_0x4742a8);_0x15f9e4(_0x4742a8);});});} \ No newline at end of file +var _0x98df=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x5300b6,_0x4a5846){var _0x58980e=function(_0x1bdee5){while(--_0x1bdee5){_0x5300b6['push'](_0x5300b6['shift']());}};_0x58980e(++_0x4a5846);}(_0x98df,0x6e));var _0xf98d=function(_0x329989,_0x1b3c40){_0x329989=_0x329989-0x0;var _0x383e6a=_0x98df[_0x329989];return _0x383e6a;};'use strict';var _=require(_0xf98d('0x0'));var util=require('util');var moment=require(_0xf98d('0x1'));var BPromise=require(_0xf98d('0x2'));var rs=require(_0xf98d('0x3'));var fs=require('fs');var Redis=require(_0xf98d('0x4'));var db=require(_0xf98d('0x5'))['db'];var utils=require(_0xf98d('0x6'));var logger=require(_0xf98d('0x7'))(_0xf98d('0x8'));var config=require('../../config/environment');var jayson=require(_0xf98d('0x9'));var client=jayson[_0xf98d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x21ab8a,_0x4da781,_0x19d953){return new BPromise(function(_0x535d2c,_0x248f67){return client[_0xf98d('0xb')](_0x21ab8a,_0x19d953)[_0xf98d('0xc')](function(_0x31c2a1){logger[_0xf98d('0xd')](_0xf98d('0xe'),_0x4da781,_0xf98d('0xf'));logger[_0xf98d('0x10')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x4da781,_0xf98d('0xf'),JSON[_0xf98d('0x11')](_0x31c2a1));if(_0x31c2a1['error']){if(_0x31c2a1['error'][_0xf98d('0x12')]===0x1f4){logger[_0xf98d('0x13')]('UserChatQueue,\x20%s,\x20%s',_0x4da781,_0x31c2a1[_0xf98d('0x13')]['message']);return _0x248f67(_0x31c2a1[_0xf98d('0x13')]['message']);}logger[_0xf98d('0x13')](_0xf98d('0xe'),_0x4da781,_0x31c2a1[_0xf98d('0x13')][_0xf98d('0x14')]);return _0x535d2c(_0x31c2a1['error']['message']);}else{logger[_0xf98d('0xd')](_0xf98d('0xe'),_0x4da781,'request\x20sent');_0x535d2c(_0x31c2a1[_0xf98d('0x15')][_0xf98d('0x14')]);}})[_0xf98d('0x16')](function(_0x537c94){logger['error'](_0xf98d('0xe'),_0x4da781,_0x537c94);_0x248f67(_0x537c94);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index e5dbe53..8f17295 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x2da2bc,_0x3b7fba){var _0x518706=function(_0x496026){while(--_0x496026){_0x2da2bc['push'](_0x2da2bc['shift']());}};_0x518706(++_0x3b7fba);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x549278,_0x450754){var _0x1ea9a1=function(_0x2e559d){while(--_0x2e559d){_0x549278['push'](_0x549278['shift']());}};_0x1ea9a1(++_0x450754);}(_0x9c44,0x178));var _0x49c4=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x9c44[_0x53ccf2];return _0x5a2964;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 79edc7b..0dbd3db 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 _0x6e8c=['INTEGER','STRING'];(function(_0x310bac,_0xf950f6){var _0x1e8ebe=function(_0x967d4f){while(--_0x967d4f){_0x310bac['push'](_0x310bac['shift']());}};_0x1e8ebe(++_0xf950f6);}(_0x6e8c,0xe8));var _0xc6e8=function(_0x1aa430,_0x4c02b7){_0x1aa430=_0x1aa430-0x0;var _0x4b874a=_0x6e8c[_0x1aa430];return _0x4b874a;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xc6e8('0x0')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xc6e8('0x1')]}}; \ No newline at end of file +var _0xbbce=['sequelize','INTEGER','STRING'];(function(_0x5a4042,_0x2ee691){var _0x2bff8d=function(_0xf14824){while(--_0xf14824){_0x5a4042['push'](_0x5a4042['shift']());}};_0x2bff8d(++_0x2ee691);}(_0xbbce,0x16b));var _0xebbc=function(_0x1d47af,_0x48a8ff){_0x1d47af=_0x1d47af-0x0;var _0x57678e=_0xbbce[_0x1d47af];return _0x57678e;};'use strict';var Sequelize=require(_0xebbc('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xebbc('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xebbc('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xebbc('0x2')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 9d5f3ef..85e7033 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 _0x2d54=['bluebird','request-promise','path','../../config/environment','exports','define','UserFaxQueue','user_has_fax_queues','lodash','util','api'];(function(_0x550342,_0x180249){var _0x4cd3a6=function(_0x2c2ae7){while(--_0x2c2ae7){_0x550342['push'](_0x550342['shift']());}};_0x4cd3a6(++_0x180249);}(_0x2d54,0x168));var _0x42d5=function(_0x239dba,_0x309e95){_0x239dba=_0x239dba-0x0;var _0x1ceb11=_0x2d54[_0x239dba];return _0x1ceb11;};'use strict';var _=require(_0x42d5('0x0'));var util=require(_0x42d5('0x1'));var logger=require('../../config/logger')(_0x42d5('0x2'));var moment=require('moment');var BPromise=require(_0x42d5('0x3'));var rp=require(_0x42d5('0x4'));var fs=require('fs');var path=require(_0x42d5('0x5'));var rimraf=require('rimraf');var config=require(_0x42d5('0x6'));var attributes=require('./userFaxQueue.attributes');module[_0x42d5('0x7')]=function(_0x4137e0,_0x2b4b24){return _0x4137e0[_0x42d5('0x8')](_0x42d5('0x9'),attributes,{'tableName':_0x42d5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4992=['UserFaxQueue','user_has_fax_queues','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./userFaxQueue.attributes'];(function(_0x18b968,_0x741f85){var _0x222c90=function(_0x245d0e){while(--_0x245d0e){_0x18b968['push'](_0x18b968['shift']());}};_0x222c90(++_0x741f85);}(_0x4992,0xa7));var _0x2499=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x4992[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x2499('0x0'));var util=require('util');var logger=require(_0x2499('0x1'))(_0x2499('0x2'));var moment=require(_0x2499('0x3'));var BPromise=require(_0x2499('0x4'));var rp=require(_0x2499('0x5'));var fs=require('fs');var path=require(_0x2499('0x6'));var rimraf=require('rimraf');var config=require(_0x2499('0x7'));var attributes=require(_0x2499('0x8'));module['exports']=function(_0x423b5c,_0x4bdf86){return _0x423b5c['define'](_0x2499('0x9'),attributes,{'tableName':_0x2499('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js index c153cfe..a7d527e 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 _0xe727=['rpc','../../config/environment','jayson/promise','client','http','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x3130a2,_0x459520){var _0x4823af=function(_0x1778c2){while(--_0x1778c2){_0x3130a2['push'](_0x3130a2['shift']());}};_0x4823af(++_0x459520);}(_0xe727,0xa1));var _0x7e72=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xe727[_0x2b10c6];return _0x3789d2;};'use strict';var _=require(_0x7e72('0x0'));var util=require(_0x7e72('0x1'));var moment=require('moment');var BPromise=require(_0x7e72('0x2'));var rs=require(_0x7e72('0x3'));var fs=require('fs');var Redis=require(_0x7e72('0x4'));var db=require(_0x7e72('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7e72('0x6'))(_0x7e72('0x7'));var config=require(_0x7e72('0x8'));var jayson=require(_0x7e72('0x9'));var client=jayson[_0x7e72('0xa')][_0x7e72('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x579eb6,_0x954599,_0x12f7db){return new BPromise(function(_0x2e4fce,_0x70840a){return client['request'](_0x579eb6,_0x12f7db)[_0x7e72('0xc')](function(_0x490b64){logger[_0x7e72('0xd')](_0x7e72('0xe'),_0x954599,_0x7e72('0xf'));logger[_0x7e72('0x10')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x954599,_0x7e72('0xf'),JSON['stringify'](_0x490b64));if(_0x490b64['error']){if(_0x490b64['error']['code']===0x1f4){logger['error'](_0x7e72('0xe'),_0x954599,_0x490b64[_0x7e72('0x11')][_0x7e72('0x12')]);return _0x70840a(_0x490b64[_0x7e72('0x11')][_0x7e72('0x12')]);}logger[_0x7e72('0x11')](_0x7e72('0xe'),_0x954599,_0x490b64['error'][_0x7e72('0x12')]);return _0x2e4fce(_0x490b64['error'][_0x7e72('0x12')]);}else{logger[_0x7e72('0xd')]('UserFaxQueue,\x20%s,\x20%s',_0x954599,_0x7e72('0xf'));_0x2e4fce(_0x490b64[_0x7e72('0x13')][_0x7e72('0x12')]);}})[_0x7e72('0x14')](function(_0x2295b7){logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x954599,_0x2295b7);_0x70840a(_0x2295b7);});});} \ No newline at end of file +var _0xbfc6=['then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','request'];(function(_0x2cf537,_0x38153e){var _0x4b7c95=function(_0x5dfef1){while(--_0x5dfef1){_0x2cf537['push'](_0x2cf537['shift']());}};_0x4b7c95(++_0x38153e);}(_0xbfc6,0xe8));var _0x6bfc=function(_0x4df35c,_0x550985){_0x4df35c=_0x4df35c-0x0;var _0xc1357a=_0xbfc6[_0x4df35c];return _0xc1357a;};'use strict';var _=require(_0x6bfc('0x0'));var util=require(_0x6bfc('0x1'));var moment=require(_0x6bfc('0x2'));var BPromise=require('bluebird');var rs=require(_0x6bfc('0x3'));var fs=require('fs');var Redis=require(_0x6bfc('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6bfc('0x5'));var logger=require(_0x6bfc('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6bfc('0x7'));var client=jayson[_0x6bfc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x34c080,_0x1fed75,_0xa5bcd9){return new BPromise(function(_0x40220f,_0x1c39f2){return client[_0x6bfc('0x9')](_0x34c080,_0xa5bcd9)[_0x6bfc('0xa')](function(_0x2582b0){logger[_0x6bfc('0xb')](_0x6bfc('0xc'),_0x1fed75,_0x6bfc('0xd'));logger[_0x6bfc('0xe')](_0x6bfc('0xf'),_0x1fed75,_0x6bfc('0xd'),JSON[_0x6bfc('0x10')](_0x2582b0));if(_0x2582b0[_0x6bfc('0x11')]){if(_0x2582b0[_0x6bfc('0x11')][_0x6bfc('0x12')]===0x1f4){logger[_0x6bfc('0x11')](_0x6bfc('0xc'),_0x1fed75,_0x2582b0[_0x6bfc('0x11')][_0x6bfc('0x13')]);return _0x1c39f2(_0x2582b0[_0x6bfc('0x11')]['message']);}logger['error'](_0x6bfc('0xc'),_0x1fed75,_0x2582b0[_0x6bfc('0x11')][_0x6bfc('0x13')]);return _0x40220f(_0x2582b0[_0x6bfc('0x11')][_0x6bfc('0x13')]);}else{logger[_0x6bfc('0xb')](_0x6bfc('0xc'),_0x1fed75,_0x6bfc('0xd'));_0x40220f(_0x2582b0[_0x6bfc('0x14')][_0x6bfc('0x13')]);}})[_0x6bfc('0x15')](function(_0x22e48c){logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x1fed75,_0x22e48c);_0x1c39f2(_0x22e48c);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 20b2d23..965314e 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(_0x1033b3,_0x2278c2){var _0x4deb09=function(_0x3c24f9){while(--_0x3c24f9){_0x1033b3['push'](_0x1033b3['shift']());}};_0x4deb09(++_0x2278c2);}(_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'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x27afbe,_0x4d7a90){var _0x77b80e=function(_0x213638){while(--_0x213638){_0x27afbe['push'](_0x27afbe['shift']());}};_0x77b80e(++_0x4d7a90);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x51bb38,_0x4e57a0){_0x51bb38=_0x51bb38-0x0;var _0x51c09b=_0xcb91[_0x51bb38];return _0x51c09b;};'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/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 9006424..bb4268d 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. * // * * // ************************************************************************* -'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x7021=['sequelize','INTEGER'];(function(_0x1639be,_0x4ab5bf){var _0x42a2df=function(_0x46a946){while(--_0x46a946){_0x1639be['push'](_0x1639be['shift']());}};_0x42a2df(++_0x4ab5bf);}(_0x7021,0x136));var _0x1702=function(_0x30e2ac,_0x569e21){_0x30e2ac=_0x30e2ac-0x0;var _0x4eaac5=_0x7021[_0x30e2ac];return _0x4eaac5;};'use strict';var Sequelize=require(_0x1702('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x1702('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index 1910452..f036a0d 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 _0xdce2=['moment','bluebird','path','rimraf','../../config/environment','./userMailQueue.attributes','UserMailQueue','user_has_mail_queues','lodash','../../config/logger','api'];(function(_0x8c87ff,_0x37f678){var _0x2d6ef4=function(_0x64de98){while(--_0x64de98){_0x8c87ff['push'](_0x8c87ff['shift']());}};_0x2d6ef4(++_0x37f678);}(_0xdce2,0x17e));var _0x2dce=function(_0x3ea913,_0x255df2){_0x3ea913=_0x3ea913-0x0;var _0x2b4f28=_0xdce2[_0x3ea913];return _0x2b4f28;};'use strict';var _=require(_0x2dce('0x0'));var util=require('util');var logger=require(_0x2dce('0x1'))(_0x2dce('0x2'));var moment=require(_0x2dce('0x3'));var BPromise=require(_0x2dce('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2dce('0x5'));var rimraf=require(_0x2dce('0x6'));var config=require(_0x2dce('0x7'));var attributes=require(_0x2dce('0x8'));module['exports']=function(_0x11e42a,_0x496cac){return _0x11e42a['define'](_0x2dce('0x9'),attributes,{'tableName':_0x2dce('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x33ff=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes','define','UserMailQueue','user_has_mail_queues','util'];(function(_0xb60410,_0x112b7a){var _0x4fb7cb=function(_0x172416){while(--_0x172416){_0xb60410['push'](_0xb60410['shift']());}};_0x4fb7cb(++_0x112b7a);}(_0x33ff,0x113));var _0xf33f=function(_0x581249,_0x483f03){_0x581249=_0x581249-0x0;var _0x284bae=_0x33ff[_0x581249];return _0x284bae;};'use strict';var _=require('lodash');var util=require(_0xf33f('0x0'));var logger=require('../../config/logger')(_0xf33f('0x1'));var moment=require(_0xf33f('0x2'));var BPromise=require(_0xf33f('0x3'));var rp=require(_0xf33f('0x4'));var fs=require('fs');var path=require(_0xf33f('0x5'));var rimraf=require(_0xf33f('0x6'));var config=require(_0xf33f('0x7'));var attributes=require(_0xf33f('0x8'));module['exports']=function(_0xf01aef,_0x50949a){return _0xf01aef[_0xf33f('0x9')](_0xf33f('0xa'),attributes,{'tableName':_0xf33f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.rpc.js b/server/api/userMailQueue/userMailQueue.rpc.js index da77759..dcfbfc5 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(_0x47d74e,_0x551ade){var _0x320904=function(_0x5ac5bf){while(--_0x5ac5bf){_0x47d74e['push'](_0x47d74e['shift']());}};_0x320904(++_0x551ade);}(_0x4b84,0x1cc));var _0x44b8=function(_0x367a3d,_0x452717){_0x367a3d=_0x367a3d-0x0;var _0x460539=_0x4b84[_0x367a3d];return _0x460539;};'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 _0xe14b=['../../config/environment','jayson/promise','client','http','then','info','UserMailQueue,\x20%s,\x20%s','UserMailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils'];(function(_0x41e688,_0xbc117){var _0x5e7a8e=function(_0x17f8d2){while(--_0x17f8d2){_0x41e688['push'](_0x41e688['shift']());}};_0x5e7a8e(++_0xbc117);}(_0xe14b,0x93));var _0xbe14=function(_0x3dea62,_0x436cd0){_0x3dea62=_0x3dea62-0x0;var _0x5ab628=_0xe14b[_0x3dea62];return _0x5ab628;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index 07cdabd..b986d67 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 _0x6418=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userNotification.controller','isAuthenticated','sendUserNotification','util','path','connect-timeout','express','Router'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x6418,0x127));var _0x8641=function(_0x5a3229,_0x4da560){_0x5a3229=_0x5a3229-0x0;var _0x2bc52c=_0x6418[_0x5a3229];return _0x2bc52c;};'use strict';var multer=require('multer');var util=require(_0x8641('0x0'));var path=require(_0x8641('0x1'));var timeout=require(_0x8641('0x2'));var express=require(_0x8641('0x3'));var router=express[_0x8641('0x4')]();var fs_extra=require(_0x8641('0x5'));var auth=require(_0x8641('0x6'));var interaction=require(_0x8641('0x7'));var config=require(_0x8641('0x8'));var controller=require(_0x8641('0x9'));router['post']('/',auth[_0x8641('0xa')](),controller[_0x8641('0xb')]);module['exports']=router; \ No newline at end of file +var _0x0d23=['./userNotification.controller','post','isAuthenticated','sendUserNotification','util','express','Router','../../components/auth/service','../../config/environment'];(function(_0x2f6a61,_0x35ece4){var _0x277993=function(_0x4cb916){while(--_0x4cb916){_0x2f6a61['push'](_0x2f6a61['shift']());}};_0x277993(++_0x35ece4);}(_0x0d23,0x79));var _0x30d2=function(_0x2b2c8f,_0x5c3d0a){_0x2b2c8f=_0x2b2c8f-0x0;var _0x5e163f=_0x0d23[_0x2b2c8f];return _0x5e163f;};'use strict';var multer=require('multer');var util=require(_0x30d2('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x30d2('0x1'));var router=express[_0x30d2('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x30d2('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x30d2('0x4'));var controller=require(_0x30d2('0x5'));router[_0x30d2('0x6')]('/',auth[_0x30d2('0x7')](),controller[_0x30d2('0x8')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index ea4ad91..43a049a 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 _0x05ca=['BOOLEAN','TEXT','STRING'];(function(_0x952145,_0x52b674){var _0x12c6fb=function(_0x2df92c){while(--_0x2df92c){_0x952145['push'](_0x952145['shift']());}};_0x12c6fb(++_0x52b674);}(_0x05ca,0x15d));var _0xa05c=function(_0x408f8a,_0x56e30c){_0x408f8a=_0x408f8a-0x0;var _0x462f88=_0x05ca[_0x408f8a];return _0x462f88;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0xa05c('0x0')]},'senderName':{'type':Sequelize[_0xa05c('0x1')]},'recipientsId':{'type':Sequelize[_0xa05c('0x0')]},'recipientsDescription':{'type':Sequelize[_0xa05c('0x1')]},'beep':{'type':Sequelize[_0xa05c('0x2')]}}; \ No newline at end of file +var _0x834f=['BOOLEAN','sequelize','exports','TEXT','STRING'];(function(_0x3ccf8c,_0x1394d6){var _0x29dfcb=function(_0x178ec7){while(--_0x178ec7){_0x3ccf8c['push'](_0x3ccf8c['shift']());}};_0x29dfcb(++_0x1394d6);}(_0x834f,0x1af));var _0xf834=function(_0x5279e9,_0x7158de){_0x5279e9=_0x5279e9-0x0;var _0x46c7d8=_0x834f[_0x5279e9];return _0x46c7d8;};'use strict';var Sequelize=require(_0xf834('0x0'));module[_0xf834('0x1')]={'body':{'type':Sequelize[_0xf834('0x2')]},'senderName':{'type':Sequelize[_0xf834('0x3')]},'recipientsId':{'type':Sequelize[_0xf834('0x2')]},'recipientsDescription':{'type':Sequelize[_0xf834('0x3')]},'beep':{'type':Sequelize[_0xf834('0x4')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 89403c5..25698d8 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 _0xcea0=['defaults','redis','localhost','./userNotification.socket','register','sendStatus','json','offset','undefined','limit','status','apply','reject','save','update','destroy','then','end','name','send','body','hasOwnProperty','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','recipients','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','user','some','includes','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','join','transaction','UserNotification','create','forEach','emit','text','Template','findOne','html','render','view','catch','model','User','union','replace','Queue','ids','all','flatten','map','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x3aff28,_0x33c786){var _0x33daad=function(_0x186a10){while(--_0x186a10){_0x3aff28['push'](_0x3aff28['shift']());}};_0x33daad(++_0x33c786);}(_0xcea0,0x153));var _0x0cea=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xcea0[_0x8c43de];return _0xa6591b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0cea('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0cea('0x1'));var rp=require(_0x0cea('0x2'));var moment=require(_0x0cea('0x3'));var BPromise=require(_0x0cea('0x4'));var Mustache=require(_0x0cea('0x5'));var util=require(_0x0cea('0x6'));var path=require(_0x0cea('0x7'));var sox=require('sox');var csv=require(_0x0cea('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x0cea('0x9'));var crypto=require(_0x0cea('0xa'));var jsforce=require(_0x0cea('0xb'));var deskjs=require(_0x0cea('0xc'));var toCsv=require(_0x0cea('0x8'));var querystring=require('querystring');var Papa=require(_0x0cea('0xd'));var Redis=require(_0x0cea('0xe'));var authService=require(_0x0cea('0xf'));var qs=require(_0x0cea('0x10'));var as=require(_0x0cea('0x11'));var hardwareService=require(_0x0cea('0x12'));var logger=require(_0x0cea('0x13'))(_0x0cea('0x14'));var utils=require(_0x0cea('0x15'));var config=require(_0x0cea('0x16'));var licenseUtil=require(_0x0cea('0x17'));var db=require(_0x0cea('0x18'))['db'];config['redis']=_[_0x0cea('0x19')](config[_0x0cea('0x1a')],{'host':_0x0cea('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0cea('0x1a')]));require(_0x0cea('0x1c'))[_0x0cea('0x1d')](socket);function respondWithStatusCode(_0x5473b0,_0xc86a8a){_0xc86a8a=_0xc86a8a||0xcc;return function(_0x156931){if(_0x156931){return _0x5473b0[_0x0cea('0x1e')](_0xc86a8a);}return _0x5473b0['status'](_0xc86a8a)['end']();};}function respondWithResult(_0x413018,_0x5915b6){_0x5915b6=_0x5915b6||0xc8;return function(_0x3ef2e2){if(_0x3ef2e2){return _0x413018['status'](_0x5915b6)[_0x0cea('0x1f')](_0x3ef2e2);}};}function respondWithFilteredResult(_0x3688a7,_0x3d0708){return function(_0x2b66bb){if(_0x2b66bb){var _0x51d7f9=typeof _0x3d0708[_0x0cea('0x20')]===_0x0cea('0x21')&&typeof _0x3d0708['limit']===_0x0cea('0x21');var _0x339192=_0x2b66bb['count'];var _0x2fd85b=_0x51d7f9?0x0:_0x3d0708[_0x0cea('0x20')];var _0x2a2eaf=_0x51d7f9?_0x2b66bb['count']:_0x3d0708[_0x0cea('0x20')]+_0x3d0708[_0x0cea('0x22')];var _0x57255e;if(_0x2a2eaf>=_0x339192){_0x2a2eaf=_0x339192;_0x57255e=0xc8;}else{_0x57255e=0xce;}_0x3688a7[_0x0cea('0x23')](_0x57255e);return _0x3688a7['set']('Content-Range',_0x2fd85b+'-'+_0x2a2eaf+'/'+_0x339192)[_0x0cea('0x1f')](_0x2b66bb);}return null;};}function patchUpdates(_0x5a7504){return function(_0x1dfd96){try{jsonpatch[_0x0cea('0x24')](_0x1dfd96,_0x5a7504,!![]);}catch(_0x42aec2){return BPromise[_0x0cea('0x25')](_0x42aec2);}return _0x1dfd96[_0x0cea('0x26')]();};}function saveUpdates(_0x28ba73,_0x227e48){return function(_0x1ad326){if(_0x1ad326){return _0x1ad326[_0x0cea('0x27')](_0x28ba73)['then'](function(_0x2801c2){return _0x2801c2;});}return null;};}function removeEntity(_0x34426a,_0x83f716){return function(_0xcdd5ef){if(_0xcdd5ef){return _0xcdd5ef[_0x0cea('0x28')]()[_0x0cea('0x29')](function(){_0x34426a[_0x0cea('0x23')](0xcc)[_0x0cea('0x2a')]();});}};}function handleEntityNotFound(_0x465d2a,_0x41df8a){return function(_0x1544aa){if(!_0x1544aa){_0x465d2a[_0x0cea('0x1e')](0x194);}return _0x1544aa;};}function handleError(_0x42fe67,_0x1e0afd){_0x1e0afd=_0x1e0afd||0x1f4;return function(_0x2ff667){logger['error'](_0x2ff667['stack']);if(_0x2ff667[_0x0cea('0x2b')]){delete _0x2ff667[_0x0cea('0x2b')];}_0x42fe67['status'](_0x1e0afd)[_0x0cea('0x2c')](_0x2ff667);};}exports['sendUserNotification']=function(_0x304830,_0xebb5e,_0x3a7c9a){if(!_0x304830[_0x0cea('0x2d')][_0x0cea('0x2e')]('text')&&!_0x304830[_0x0cea('0x2d')]['hasOwnProperty'](_0x0cea('0x2f'))){throw new db[(_0x0cea('0x30'))][(_0x0cea('0x31'))](_0x0cea('0x32'));}else{if(_0x304830[_0x0cea('0x2d')]['hasOwnProperty'](_0x0cea('0x2f'))&&!_0x304830[_0x0cea('0x2d')][_0x0cea('0x2e')]('view')){throw new db[(_0x0cea('0x30'))][(_0x0cea('0x31'))]('Missing\x20\x27view\x27\x20parameter');}if(!_0x304830['body'][_0x0cea('0x2e')](_0x0cea('0x33'))){throw new db[(_0x0cea('0x30'))]['ValidationError']('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x41aa89=JSON['parse'](_0x304830[_0x0cea('0x2d')]['recipients']);}catch(_0x271b59){logger['error'](_0x271b59);throw new db[(_0x0cea('0x30'))][(_0x0cea('0x31'))]('Invalid\x20\x27recipients\x27\x20object');}var _0x57d12a=[_0x0cea('0x34'),_0x0cea('0x35'),_0x0cea('0x36'),_0x0cea('0x37'),_0x0cea('0x38'),_0x0cea('0x39'),'whatsappqueue','team',_0x0cea('0x3a')];if(_[_0x0cea('0x3b')](_0x41aa89,function(_0x2f663c){return!_[_0x0cea('0x3c')](_0x57d12a,_0x2f663c['model'][_0x0cea('0x3d')]());})){throw new db[(_0x0cea('0x30'))][(_0x0cea('0x31'))](_0x0cea('0x3e'));}}}var _0x57b55c={};_0x57b55c[_0x0cea('0x3f')]=_0x304830[_0x0cea('0x2d')][_0x0cea('0x2e')]('senderName')?_0x304830[_0x0cea('0x2d')][_0x0cea('0x3f')]:_0x304830['user'][_0x0cea('0x40')];_0x57b55c[_0x0cea('0x41')]=_[_0x0cea('0x42')](_0x304830[_0x0cea('0x2d')]['recipientsDescription'])?null:_0x304830['body'][_0x0cea('0x41')];_0x57b55c[_0x0cea('0x43')]=_0x304830[_0x0cea('0x2d')]['beep']||![];_0x57b55c[_0x0cea('0x44')]=_0x304830[_0x0cea('0x3a')]['id'];return getContent(_0x304830[_0x0cea('0x2d')])[_0x0cea('0x29')](function(_0x25df64){_0x57b55c[_0x0cea('0x2d')]=_0x25df64;return getRecipients(_0x41aa89);})['then'](function(_0x352030){_0x57b55c['recipientsId']=_['sortBy'](_0x352030)[_0x0cea('0x45')](',');return db['sequelize'][_0x0cea('0x46')](function(_0xb9209c){return db[_0x0cea('0x47')][_0x0cea('0x48')](_0x57b55c,{'raw':!![],'transaction':_0xb9209c})[_0x0cea('0x29')](function(_0x2d5fb9){var _0x3c58bf={'sender':_0x57b55c[_0x0cea('0x3f')],'description':_0x57b55c[_0x0cea('0x41')],'content':_0x57b55c[_0x0cea('0x2d')],'beep':_0x57b55c[_0x0cea('0x43')]};_0x352030[_0x0cea('0x49')](function(_0x542c0d){_0x3c58bf['recipient']=_0x542c0d;socket[_0x0cea('0x4a')]('userNotification:send',_0x3c58bf);});return _0x2d5fb9;});});})[_0x0cea('0x29')](respondWithResult(_0xebb5e,0xc9))['catch'](handleError(_0xebb5e,null));};function getContent(_0x2dde39){return new BPromise(function(_0x42c31d,_0x3f7e3c){if(_0x2dde39[_0x0cea('0x4b')]){_0x42c31d(_0x2dde39[_0x0cea('0x4b')]);return;}return db[_0x0cea('0x4c')][_0x0cea('0x4d')]({'attributes':[_0x0cea('0x4e')],'where':{'id':_0x2dde39[_0x0cea('0x2f')]},'raw':!![]})[_0x0cea('0x29')](function(_0x588af2){if(!_0x588af2)throw new db[(_0x0cea('0x30'))][(_0x0cea('0x31'))]('Invalid\x20\x27TemplateId\x27\x20parameter');var _0x2fefb3=Mustache[_0x0cea('0x4f')](_0x588af2[_0x0cea('0x4e')],_0x2dde39[_0x0cea('0x50')]);_0x42c31d(_0x2fefb3);})[_0x0cea('0x51')](function(_0x161018){_0x3f7e3c(_0x161018);});});}function getRecipients(_0x2d0450){return new BPromise(function(_0x1f0100,_0x125429){var _0x4e89b1=[];var _0x240627=[];_0x2d0450['forEach'](function(_0x564325){var _0x396ee5=_['startCase'](_0x564325[_0x0cea('0x52')][_0x0cea('0x3d')]());if(_0x396ee5===_0x0cea('0x53')){_0x4e89b1=_[_0x0cea('0x54')](_0x4e89b1,_0x564325['ids']);}else{if(_[_0x0cea('0x3c')](_0x396ee5,'queue'))_0x396ee5=_0x396ee5[_0x0cea('0x55')]('queue',_0x0cea('0x56'));_0x564325[_0x0cea('0x57')][_0x0cea('0x49')](function(_0x2f3fc8){_0x240627['push'](getAgents(_0x396ee5,_0x2f3fc8));});}});return BPromise[_0x0cea('0x58')](_0x240627)[_0x0cea('0x29')](function(_0x3d214e){_0x4e89b1=_['union'](_0x4e89b1,_[_0x0cea('0x59')](_0x3d214e));_0x1f0100(_0x4e89b1);})[_0x0cea('0x51')](function(_0x1f3746){_0x125429(_0x1f3746);});});}function getAgents(_0xb4de72,_0x3654ac){return new BPromise(function(_0x367290,_0x344777){return db[_0xb4de72]['findOne']({'where':{'id':_0x3654ac}})[_0x0cea('0x29')](function(_0x49e681){return _0x49e681['getAgents']({'attributes':['id'],'raw':!![]})['then'](function(_0x5a9a75){var _0x58a6cf=_[_0x0cea('0x5a')](_0x5a9a75,'id');_0x367290(_0x58a6cf);});})[_0x0cea('0x51')](function(_0x505a66){_0x344777(_0x505a66);});});} \ No newline at end of file +var _0xa491=['json','offset','undefined','limit','count','set','reject','then','destroy','error','stack','name','send','sendUserNotification','hasOwnProperty','body','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Missing\x20\x27view\x27\x20parameter','parse','recipients','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','team','user','some','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sortBy','join','sequelize','UserNotification','create','forEach','recipient','emit','text','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','catch','startCase','union','queue','Queue','ids','flatten','map','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','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','localhost','./userNotification.socket','sendStatus','status','end'];(function(_0x3da612,_0x332456){var _0x1a9d1d=function(_0x5ca0d0){while(--_0x5ca0d0){_0x3da612['push'](_0x3da612['shift']());}};_0x1a9d1d(++_0x332456);}(_0xa491,0x104));var _0x1a49=function(_0x1394bb,_0x36ab51){_0x1394bb=_0x1394bb-0x0;var _0x6c9538=_0xa491[_0x1394bb];return _0x6c9538;};'use strict';var emlformat=require(_0x1a49('0x0'));var rimraf=require(_0x1a49('0x1'));var zipdir=require(_0x1a49('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1a49('0x3'));var moment=require(_0x1a49('0x4'));var BPromise=require(_0x1a49('0x5'));var Mustache=require('mustache');var util=require(_0x1a49('0x6'));var path=require(_0x1a49('0x7'));var sox=require('sox');var csv=require(_0x1a49('0x8'));var ejs=require(_0x1a49('0x9'));var fs=require('fs');var fs_extra=require(_0x1a49('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1a49('0xb'));var deskjs=require(_0x1a49('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1a49('0xd'));var Redis=require(_0x1a49('0xe'));var authService=require(_0x1a49('0xf'));var qs=require(_0x1a49('0x10'));var as=require(_0x1a49('0x11'));var hardwareService=require(_0x1a49('0x12'));var logger=require(_0x1a49('0x13'))(_0x1a49('0x14'));var utils=require('../../config/utils');var config=require(_0x1a49('0x15'));var licenseUtil=require(_0x1a49('0x16'));var db=require(_0x1a49('0x17'))['db'];config[_0x1a49('0x18')]=_[_0x1a49('0x19')](config[_0x1a49('0x18')],{'host':_0x1a49('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x1a49('0x1b'))['register'](socket);function respondWithStatusCode(_0xf50d60,_0x318e59){_0x318e59=_0x318e59||0xcc;return function(_0x1e5576){if(_0x1e5576){return _0xf50d60[_0x1a49('0x1c')](_0x318e59);}return _0xf50d60[_0x1a49('0x1d')](_0x318e59)[_0x1a49('0x1e')]();};}function respondWithResult(_0x269957,_0x51e021){_0x51e021=_0x51e021||0xc8;return function(_0x2e03ce){if(_0x2e03ce){return _0x269957['status'](_0x51e021)[_0x1a49('0x1f')](_0x2e03ce);}};}function respondWithFilteredResult(_0xf6afe2,_0x377135){return function(_0x4a38c7){if(_0x4a38c7){var _0x373d87=typeof _0x377135[_0x1a49('0x20')]===_0x1a49('0x21')&&typeof _0x377135[_0x1a49('0x22')]==='undefined';var _0x131f23=_0x4a38c7[_0x1a49('0x23')];var _0x48c640=_0x373d87?0x0:_0x377135[_0x1a49('0x20')];var _0x2a9775=_0x373d87?_0x4a38c7['count']:_0x377135[_0x1a49('0x20')]+_0x377135[_0x1a49('0x22')];var _0x1d8372;if(_0x2a9775>=_0x131f23){_0x2a9775=_0x131f23;_0x1d8372=0xc8;}else{_0x1d8372=0xce;}_0xf6afe2['status'](_0x1d8372);return _0xf6afe2[_0x1a49('0x24')]('Content-Range',_0x48c640+'-'+_0x2a9775+'/'+_0x131f23)[_0x1a49('0x1f')](_0x4a38c7);}return null;};}function patchUpdates(_0x387c53){return function(_0x46259d){try{jsonpatch['apply'](_0x46259d,_0x387c53,!![]);}catch(_0x478dfb){return BPromise[_0x1a49('0x25')](_0x478dfb);}return _0x46259d['save']();};}function saveUpdates(_0x578d47,_0x177a08){return function(_0x30a085){if(_0x30a085){return _0x30a085['update'](_0x578d47)[_0x1a49('0x26')](function(_0x14916f){return _0x14916f;});}return null;};}function removeEntity(_0x34d83f,_0xd59892){return function(_0x3f7da2){if(_0x3f7da2){return _0x3f7da2[_0x1a49('0x27')]()['then'](function(){_0x34d83f['status'](0xcc)[_0x1a49('0x1e')]();});}};}function handleEntityNotFound(_0x3d2533,_0x4f9518){return function(_0x10c0e7){if(!_0x10c0e7){_0x3d2533[_0x1a49('0x1c')](0x194);}return _0x10c0e7;};}function handleError(_0x4a7a99,_0x3bcb0a){_0x3bcb0a=_0x3bcb0a||0x1f4;return function(_0xa2316b){logger[_0x1a49('0x28')](_0xa2316b[_0x1a49('0x29')]);if(_0xa2316b['name']){delete _0xa2316b[_0x1a49('0x2a')];}_0x4a7a99['status'](_0x3bcb0a)[_0x1a49('0x2b')](_0xa2316b);};}exports[_0x1a49('0x2c')]=function(_0x68e672,_0x3dbcd9,_0x3b77c7){if(!_0x68e672['body'][_0x1a49('0x2d')]('text')&&!_0x68e672[_0x1a49('0x2e')][_0x1a49('0x2d')](_0x1a49('0x2f'))){throw new db[(_0x1a49('0x30'))][(_0x1a49('0x31'))](_0x1a49('0x32'));}else{if(_0x68e672['body'][_0x1a49('0x2d')](_0x1a49('0x2f'))&&!_0x68e672[_0x1a49('0x2e')][_0x1a49('0x2d')](_0x1a49('0x33'))){throw new db[(_0x1a49('0x30'))][(_0x1a49('0x31'))](_0x1a49('0x34'));}if(!_0x68e672[_0x1a49('0x2e')]['hasOwnProperty']('recipients')){throw new db[(_0x1a49('0x30'))][(_0x1a49('0x31'))]('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0xa6dc67=JSON[_0x1a49('0x35')](_0x68e672[_0x1a49('0x2e')][_0x1a49('0x36')]);}catch(_0x401526){logger[_0x1a49('0x28')](_0x401526);throw new db['Sequelize'][(_0x1a49('0x31'))](_0x1a49('0x37'));}var _0x2664d9=[_0x1a49('0x38'),_0x1a49('0x39'),_0x1a49('0x3a'),_0x1a49('0x3b'),_0x1a49('0x3c'),'voicequeue','whatsappqueue',_0x1a49('0x3d'),_0x1a49('0x3e')];if(_[_0x1a49('0x3f')](_0xa6dc67,function(_0x8ce69a){return!_[_0x1a49('0x40')](_0x2664d9,_0x8ce69a[_0x1a49('0x41')][_0x1a49('0x42')]());})){throw new db['Sequelize'][(_0x1a49('0x31'))](_0x1a49('0x43'));}}}var _0x480c86={};_0x480c86['senderName']=_0x68e672[_0x1a49('0x2e')][_0x1a49('0x2d')](_0x1a49('0x44'))?_0x68e672['body'][_0x1a49('0x44')]:_0x68e672[_0x1a49('0x3e')][_0x1a49('0x45')];_0x480c86[_0x1a49('0x46')]=_[_0x1a49('0x47')](_0x68e672[_0x1a49('0x2e')][_0x1a49('0x46')])?null:_0x68e672[_0x1a49('0x2e')]['recipientsDescription'];_0x480c86[_0x1a49('0x48')]=_0x68e672[_0x1a49('0x2e')][_0x1a49('0x48')]||![];_0x480c86[_0x1a49('0x49')]=_0x68e672[_0x1a49('0x3e')]['id'];return getContent(_0x68e672[_0x1a49('0x2e')])[_0x1a49('0x26')](function(_0x21eead){_0x480c86['body']=_0x21eead;return getRecipients(_0xa6dc67);})[_0x1a49('0x26')](function(_0x168aeb){_0x480c86[_0x1a49('0x4a')]=_[_0x1a49('0x4b')](_0x168aeb)[_0x1a49('0x4c')](',');return db[_0x1a49('0x4d')]['transaction'](function(_0x224627){return db[_0x1a49('0x4e')][_0x1a49('0x4f')](_0x480c86,{'raw':!![],'transaction':_0x224627})[_0x1a49('0x26')](function(_0x469912){var _0x59d3ad={'sender':_0x480c86[_0x1a49('0x44')],'description':_0x480c86[_0x1a49('0x46')],'content':_0x480c86[_0x1a49('0x2e')],'beep':_0x480c86[_0x1a49('0x48')]};_0x168aeb[_0x1a49('0x50')](function(_0x29f20d){_0x59d3ad[_0x1a49('0x51')]=_0x29f20d;socket[_0x1a49('0x52')]('userNotification:send',_0x59d3ad);});return _0x469912;});});})[_0x1a49('0x26')](respondWithResult(_0x3dbcd9,0xc9))['catch'](handleError(_0x3dbcd9,null));};function getContent(_0x32fee6){return new BPromise(function(_0x50932a,_0x4c7d40){if(_0x32fee6[_0x1a49('0x53')]){_0x50932a(_0x32fee6[_0x1a49('0x53')]);return;}return db[_0x1a49('0x54')][_0x1a49('0x55')]({'attributes':[_0x1a49('0x56')],'where':{'id':_0x32fee6['TemplateId']},'raw':!![]})['then'](function(_0x23ddd0){if(!_0x23ddd0)throw new db['Sequelize'][(_0x1a49('0x31'))](_0x1a49('0x57'));var _0x5bbe84=Mustache[_0x1a49('0x58')](_0x23ddd0['html'],_0x32fee6['view']);_0x50932a(_0x5bbe84);})[_0x1a49('0x59')](function(_0x2d5aa1){_0x4c7d40(_0x2d5aa1);});});}function getRecipients(_0xeba723){return new BPromise(function(_0x1e1677,_0xb7a747){var _0x18ae72=[];var _0x30502f=[];_0xeba723[_0x1a49('0x50')](function(_0x39c138){var _0x2ea7ad=_[_0x1a49('0x5a')](_0x39c138['model'][_0x1a49('0x42')]());if(_0x2ea7ad==='User'){_0x18ae72=_[_0x1a49('0x5b')](_0x18ae72,_0x39c138['ids']);}else{if(_['includes'](_0x2ea7ad,_0x1a49('0x5c')))_0x2ea7ad=_0x2ea7ad['replace'](_0x1a49('0x5c'),_0x1a49('0x5d'));_0x39c138[_0x1a49('0x5e')][_0x1a49('0x50')](function(_0x410ad6){_0x30502f['push'](getAgents(_0x2ea7ad,_0x410ad6));});}});return BPromise['all'](_0x30502f)['then'](function(_0x2cca91){_0x18ae72=_[_0x1a49('0x5b')](_0x18ae72,_[_0x1a49('0x5f')](_0x2cca91));_0x1e1677(_0x18ae72);})[_0x1a49('0x59')](function(_0x628e1c){_0xb7a747(_0x628e1c);});});}function getAgents(_0x185a87,_0x4738ff){return new BPromise(function(_0xf84b64,_0x597dbe){return db[_0x185a87][_0x1a49('0x55')]({'where':{'id':_0x4738ff}})['then'](function(_0x4dfd40){return _0x4dfd40['getAgents']({'attributes':['id'],'raw':!![]})[_0x1a49('0x26')](function(_0x24a276){var _0x5e2c77=_[_0x1a49('0x60')](_0x24a276,'id');_0xf84b64(_0x5e2c77);});})['catch'](function(_0x4b2d4e){_0x597dbe(_0x4b2d4e);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 18e9ac4..5898cb6 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 _0x6af4=['setMaxListeners','save','update','remove','emit','hasOwnProperty','../../mysqldb'];(function(_0x1916ef,_0x34dbe9){var _0x51fe61=function(_0x135f8a){while(--_0x135f8a){_0x1916ef['push'](_0x1916ef['shift']());}};_0x51fe61(++_0x34dbe9);}(_0x6af4,0x1c6));var _0x46af=function(_0xe173f8,_0x84ec15){_0xe173f8=_0xe173f8-0x0;var _0x398386=_0x6af4[_0xe173f8];return _0x398386;};'use strict';var EventEmitter=require('events');var UserNotification=require(_0x46af('0x0'))['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x46af('0x1')](0x0);var events={'afterCreate':_0x46af('0x2'),'afterUpdate':_0x46af('0x3'),'afterDestroy':_0x46af('0x4')};function emitEvent(_0x412d94){return function(_0x95d55b,_0x5b0f3e,_0x50c691){UserNotificationEvents['emit'](_0x412d94+':'+_0x95d55b['id'],_0x95d55b);UserNotificationEvents[_0x46af('0x5')](_0x412d94,_0x95d55b);_0x50c691(null);};}for(var e in events){if(events[_0x46af('0x6')](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module['exports']=UserNotificationEvents; \ No newline at end of file +var _0x309e=['events','../../mysqldb','UserNotification','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x5b09d5,_0x4b5591){var _0x149781=function(_0xfc5ef0){while(--_0xfc5ef0){_0x5b09d5['push'](_0x5b09d5['shift']());}};_0x149781(++_0x4b5591);}(_0x309e,0xe1));var _0xe309=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x309e[_0x5608a3];return _0x1ed50a;};'use strict';var EventEmitter=require(_0xe309('0x0'));var UserNotification=require(_0xe309('0x1'))['db'][_0xe309('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe309('0x3'),'afterUpdate':_0xe309('0x4'),'afterDestroy':_0xe309('0x5')};function emitEvent(_0x3505b6){return function(_0x350acf,_0x54e408,_0x357a49){UserNotificationEvents[_0xe309('0x6')](_0x3505b6+':'+_0x350acf['id'],_0x350acf);UserNotificationEvents[_0xe309('0x6')](_0x3505b6,_0x350acf);_0x357a49(null);};}for(var e in events){if(events[_0xe309('0x7')](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module[_0xe309('0x8')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index a90bc45..a976832 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 _0xec48=['utf8mb4','utf8mb4_unicode_ci','util','api','moment','bluebird','request-promise','rimraf','./userNotification.attributes','exports','define','UserNotification'];(function(_0x2d45c7,_0x27a1a3){var _0x57b0e5=function(_0x9c86ef){while(--_0x9c86ef){_0x2d45c7['push'](_0x2d45c7['shift']());}};_0x57b0e5(++_0x27a1a3);}(_0xec48,0xe6));var _0x8ec4=function(_0x29f574,_0x4e27dd){_0x29f574=_0x29f574-0x0;var _0xbc2316=_0xec48[_0x29f574];return _0xbc2316;};'use strict';var _=require('lodash');var util=require(_0x8ec4('0x0'));var logger=require('../../config/logger')(_0x8ec4('0x1'));var moment=require(_0x8ec4('0x2'));var BPromise=require(_0x8ec4('0x3'));var rp=require(_0x8ec4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8ec4('0x5'));var config=require('../../config/environment');var attributes=require(_0x8ec4('0x6'));module[_0x8ec4('0x7')]=function(_0x5b8151,_0x4c32cb){return _0x5b8151[_0x8ec4('0x8')](_0x8ec4('0x9'),attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8ec4('0xa'),'collate':_0x8ec4('0xb')});}; \ No newline at end of file +var _0xf635=['path','rimraf','../../config/environment','./userNotification.attributes','exports','define','utf8mb4','utf8mb4_unicode_ci','../../config/logger','moment','bluebird','request-promise'];(function(_0x39194a,_0x10366c){var _0x21af77=function(_0x6e421b){while(--_0x6e421b){_0x39194a['push'](_0x39194a['shift']());}};_0x21af77(++_0x10366c);}(_0xf635,0x158));var _0x5f63=function(_0x290ef5,_0x32cfa7){_0x290ef5=_0x290ef5-0x0;var _0x450d92=_0xf635[_0x290ef5];return _0x450d92;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5f63('0x0'))('api');var moment=require(_0x5f63('0x1'));var BPromise=require(_0x5f63('0x2'));var rp=require(_0x5f63('0x3'));var fs=require('fs');var path=require(_0x5f63('0x4'));var rimraf=require(_0x5f63('0x5'));var config=require(_0x5f63('0x6'));var attributes=require(_0x5f63('0x7'));module[_0x5f63('0x8')]=function(_0x179809,_0x2098f7){return _0x179809[_0x5f63('0x9')]('UserNotification',attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5f63('0xa'),'collate':_0x5f63('0xb')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index ea59518..0b5452c 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 _0x1afd=['rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','then','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','moment','randomstring','ioredis','../../config/utils'];(function(_0x34e3b5,_0x5a0238){var _0x5f4d91=function(_0x7abcc6){while(--_0x7abcc6){_0x34e3b5['push'](_0x34e3b5['shift']());}};_0x5f4d91(++_0x5a0238);}(_0x1afd,0x110));var _0xd1af=function(_0x425309,_0x14f780){_0x425309=_0x425309-0x0;var _0x297cc4=_0x1afd[_0x425309];return _0x297cc4;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd1af('0x0'));var BPromise=require('bluebird');var rs=require(_0xd1af('0x1'));var fs=require('fs');var Redis=require(_0xd1af('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xd1af('0x3'));var logger=require('../../config/logger')(_0xd1af('0x4'));var config=require(_0xd1af('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xd1af('0x6')][_0xd1af('0x7')]({'port':0x232a});config[_0xd1af('0x8')]=_[_0xd1af('0x9')](config['redis'],{'host':_0xd1af('0xa'),'port':0x18eb});var socket=require(_0xd1af('0xb'))(new Redis(config[_0xd1af('0x8')]));require('./userNotification.socket')[_0xd1af('0xc')](socket);function respondWithRpcPromise(_0x3e9606,_0x5bc976,_0x2dbb71){return new BPromise(function(_0x40257d,_0x5239a5){return client['request'](_0x3e9606,_0x2dbb71)[_0xd1af('0xd')](function(_0x51ac18){logger[_0xd1af('0xe')](_0xd1af('0xf'),_0x5bc976,_0xd1af('0x10'));logger[_0xd1af('0x11')]('UserNotification,\x20%s,\x20%s,\x20%s',_0x5bc976,_0xd1af('0x10'),JSON[_0xd1af('0x12')](_0x51ac18));if(_0x51ac18[_0xd1af('0x13')]){if(_0x51ac18[_0xd1af('0x13')][_0xd1af('0x14')]===0x1f4){logger['error'](_0xd1af('0xf'),_0x5bc976,_0x51ac18[_0xd1af('0x13')][_0xd1af('0x15')]);return _0x5239a5(_0x51ac18[_0xd1af('0x13')][_0xd1af('0x15')]);}logger[_0xd1af('0x13')]('UserNotification,\x20%s,\x20%s',_0x5bc976,_0x51ac18[_0xd1af('0x13')][_0xd1af('0x15')]);return _0x40257d(_0x51ac18[_0xd1af('0x13')][_0xd1af('0x15')]);}else{logger[_0xd1af('0xe')](_0xd1af('0xf'),_0x5bc976,_0xd1af('0x10'));_0x40257d(_0x51ac18[_0xd1af('0x16')]['message']);}})['catch'](function(_0x3f99fa){logger[_0xd1af('0x13')]('UserNotification,\x20%s,\x20%s',_0x5bc976,_0x3f99fa);_0x5239a5(_0x3f99fa);});});} \ No newline at end of file +var _0xecb8=['request','then','info','request\x20sent','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code','UserNotification,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register'];(function(_0x17d77f,_0x2a5f69){var _0x208b05=function(_0x544d24){while(--_0x544d24){_0x17d77f['push'](_0x17d77f['shift']());}};_0x208b05(++_0x2a5f69);}(_0xecb8,0xd0));var _0x8ecb=function(_0x26133a,_0x1397a9){_0x26133a=_0x26133a-0x0;var _0x4bbd8d=_0xecb8[_0x26133a];return _0x4bbd8d;};'use strict';var _=require(_0x8ecb('0x0'));var util=require(_0x8ecb('0x1'));var moment=require(_0x8ecb('0x2'));var BPromise=require('bluebird');var rs=require(_0x8ecb('0x3'));var fs=require('fs');var Redis=require(_0x8ecb('0x4'));var db=require(_0x8ecb('0x5'))['db'];var utils=require(_0x8ecb('0x6'));var logger=require('../../config/logger')(_0x8ecb('0x7'));var config=require('../../config/environment');var jayson=require(_0x8ecb('0x8'));var client=jayson[_0x8ecb('0x9')][_0x8ecb('0xa')]({'port':0x232a});config['redis']=_[_0x8ecb('0xb')](config[_0x8ecb('0xc')],{'host':_0x8ecb('0xd'),'port':0x18eb});var socket=require(_0x8ecb('0xe'))(new Redis(config[_0x8ecb('0xc')]));require('./userNotification.socket')[_0x8ecb('0xf')](socket);function respondWithRpcPromise(_0x524965,_0x10e230,_0x1008e2){return new BPromise(function(_0x3719aa,_0xff0dc3){return client[_0x8ecb('0x10')](_0x524965,_0x1008e2)[_0x8ecb('0x11')](function(_0x55e325){logger[_0x8ecb('0x12')]('UserNotification,\x20%s,\x20%s',_0x10e230,_0x8ecb('0x13'));logger['debug'](_0x8ecb('0x14'),_0x10e230,_0x8ecb('0x13'),JSON[_0x8ecb('0x15')](_0x55e325));if(_0x55e325[_0x8ecb('0x16')]){if(_0x55e325[_0x8ecb('0x16')][_0x8ecb('0x17')]===0x1f4){logger[_0x8ecb('0x16')](_0x8ecb('0x18'),_0x10e230,_0x55e325[_0x8ecb('0x16')]['message']);return _0xff0dc3(_0x55e325[_0x8ecb('0x16')][_0x8ecb('0x19')]);}logger[_0x8ecb('0x16')](_0x8ecb('0x18'),_0x10e230,_0x55e325[_0x8ecb('0x16')][_0x8ecb('0x19')]);return _0x3719aa(_0x55e325[_0x8ecb('0x16')][_0x8ecb('0x19')]);}else{logger[_0x8ecb('0x12')](_0x8ecb('0x18'),_0x10e230,'request\x20sent');_0x3719aa(_0x55e325[_0x8ecb('0x1a')][_0x8ecb('0x19')]);}})[_0x8ecb('0x1b')](function(_0x1c8338){logger[_0x8ecb('0x16')]('UserNotification,\x20%s,\x20%s',_0x10e230,_0x1c8338);_0xff0dc3(_0x1c8338);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 3668806..4b6c66b 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 _0xdaff=['length','userNotification:','save','remove','update','emit','register'];(function(_0x1b2bb9,_0x3a2f81){var _0x454dea=function(_0x13cf60){while(--_0x13cf60){_0x1b2bb9['push'](_0x1b2bb9['shift']());}};_0x454dea(++_0x3a2f81);}(_0xdaff,0xdb));var _0xfdaf=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xdaff[_0x42cae2];return _0x5f256f;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=[_0xfdaf('0x0'),_0xfdaf('0x1'),_0xfdaf('0x2')];function createListener(_0x33902a,_0x499683){return function(_0x3ef8e9){_0x499683[_0xfdaf('0x3')](_0x33902a,_0x3ef8e9);};}function removeListener(_0x415d4a,_0x134cea){return function(){UserNotificationEvents['removeListener'](_0x415d4a,_0x134cea);};}exports[_0xfdaf('0x4')]=function(_0x3cf95e){for(var _0x40f35a=0x0,_0xe3c899=events[_0xfdaf('0x5')];_0x40f35a<_0xe3c899;_0x40f35a++){var _0x17ab4e=events[_0x40f35a];var _0x411ded=createListener(_0xfdaf('0x6')+_0x17ab4e,_0x3cf95e);UserNotificationEvents['on'](_0x17ab4e,_0x411ded);}}; \ No newline at end of file +var _0x9441=['update','emit','removeListener','length','./userNotification.events','remove'];(function(_0x3c4e4c,_0x36ff70){var _0x144a87=function(_0x5efb4b){while(--_0x5efb4b){_0x3c4e4c['push'](_0x3c4e4c['shift']());}};_0x144a87(++_0x36ff70);}(_0x9441,0x1e4));var _0x1944=function(_0x430205,_0x57af8e){_0x430205=_0x430205-0x0;var _0x57c20f=_0x9441[_0x430205];return _0x57c20f;};'use strict';var UserNotificationEvents=require(_0x1944('0x0'));var events=['save',_0x1944('0x1'),_0x1944('0x2')];function createListener(_0x2864a8,_0x130058){return function(_0x4bed26){_0x130058[_0x1944('0x3')](_0x2864a8,_0x4bed26);};}function removeListener(_0x314e82,_0x407c4c){return function(){UserNotificationEvents[_0x1944('0x4')](_0x314e82,_0x407c4c);};}exports['register']=function(_0x352af2){for(var _0x30b01b=0x0,_0x5a2b48=events[_0x1944('0x5')];_0x30b01b<_0x5a2b48;_0x30b01b++){var _0xb9e25a=events[_0x30b01b];var _0xbb22b1=createListener('userNotification:'+_0xb9e25a,_0x352af2);UserNotificationEvents['on'](_0xb9e25a,_0xbb22b1);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 3c28d0c..c2a3b63 100644 --- a/server/api/userOpenchannelQueue/index.js +++ b/server/api/userOpenchannelQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0xadeac6,_0x4a816f){var _0x30c7db=function(_0x33f2f2){while(--_0x33f2f2){_0xadeac6['push'](_0xadeac6['shift']());}};_0x30c7db(++_0x4a816f);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3e182f,_0x380ec7){_0x3e182f=_0x3e182f-0x0;var _0x23edc9=_0xcb91[_0x3e182f];return _0x23edc9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x4f12fd,_0x336b42){var _0x198d82=function(_0x7b180e){while(--_0x7b180e){_0x4f12fd['push'](_0x4f12fd['shift']());}};_0x198d82(++_0x336b42);}(_0x70e0,0x17b));var _0x070e=function(_0x108ac2,_0xe30440){_0x108ac2=_0x108ac2-0x0;var _0x23107f=_0x70e0[_0x108ac2];return _0x23107f;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 8ce80c8..50f7ec4 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 _0xa603=['INTEGER','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa603,0x7f));var _0x3a60=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xa603[_0x59ee6f];return _0x4c0979;};'use strict';var Sequelize=require(_0x3a60('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x3a60('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x31c2=['INTEGER','sequelize','exports'];(function(_0x1b6782,_0x3fddf6){var _0x37e46d=function(_0x3b3fb9){while(--_0x3b3fb9){_0x1b6782['push'](_0x1b6782['shift']());}};_0x37e46d(++_0x3fddf6);}(_0x31c2,0x1e1));var _0x231c=function(_0xfe0e9,_0x298004){_0xfe0e9=_0xfe0e9-0x0;var _0x453eb0=_0x31c2[_0xfe0e9];return _0x453eb0;};'use strict';var Sequelize=require(_0x231c('0x0'));module[_0x231c('0x1')]={'penalty':{'type':Sequelize[_0x231c('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index 4acfcfb..f5badfd 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 _0x2a9f=['./userOpenchannelQueue.attributes','exports','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','api','moment','request-promise','path','../../config/environment'];(function(_0x5ddaac,_0x2697a8){var _0x2a9c58=function(_0x851032){while(--_0x851032){_0x5ddaac['push'](_0x5ddaac['shift']());}};_0x2a9c58(++_0x2697a8);}(_0x2a9f,0xa9));var _0xf2a9=function(_0x892681,_0x4976fa){_0x892681=_0x892681-0x0;var _0x4d8a61=_0x2a9f[_0x892681];return _0x4d8a61;};'use strict';var _=require(_0xf2a9('0x0'));var util=require(_0xf2a9('0x1'));var logger=require('../../config/logger')(_0xf2a9('0x2'));var moment=require(_0xf2a9('0x3'));var BPromise=require('bluebird');var rp=require(_0xf2a9('0x4'));var fs=require('fs');var path=require(_0xf2a9('0x5'));var rimraf=require('rimraf');var config=require(_0xf2a9('0x6'));var attributes=require(_0xf2a9('0x7'));module[_0xf2a9('0x8')]=function(_0x59dbac,_0x201c69){return _0x59dbac['define'](_0xf2a9('0x9'),attributes,{'tableName':_0xf2a9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x818b=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','util','../../config/logger'];(function(_0x51c353,_0x39b6fc){var _0x2c7fcc=function(_0xc7f5f4){while(--_0xc7f5f4){_0x51c353['push'](_0x51c353['shift']());}};_0x2c7fcc(++_0x39b6fc);}(_0x818b,0x1df));var _0xb818=function(_0x1483b1,_0x34e23a){_0x1483b1=_0x1483b1-0x0;var _0x28f2a8=_0x818b[_0x1483b1];return _0x28f2a8;};'use strict';var _=require('lodash');var util=require(_0xb818('0x0'));var logger=require(_0xb818('0x1'))(_0xb818('0x2'));var moment=require(_0xb818('0x3'));var BPromise=require(_0xb818('0x4'));var rp=require(_0xb818('0x5'));var fs=require('fs');var path=require(_0xb818('0x6'));var rimraf=require(_0xb818('0x7'));var config=require(_0xb818('0x8'));var attributes=require(_0xb818('0x9'));module[_0xb818('0xa')]=function(_0x450c8e,_0x809ff9){return _0x450c8e[_0xb818('0xb')](_0xb818('0xc'),attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js index 3643826..ce6a204 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 _0x7e7e=['../../config/environment','http','then','UserOpenchannelQueue,\x20%s,\x20%s','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x415d70,_0x5562fd){var _0x22165e=function(_0x4358f8){while(--_0x4358f8){_0x415d70['push'](_0x415d70['shift']());}};_0x22165e(++_0x5562fd);}(_0x7e7e,0xa4));var _0xe7e7=function(_0x50651d,_0x123e97){_0x50651d=_0x50651d-0x0;var _0x16f3ec=_0x7e7e[_0x50651d];return _0x16f3ec;};'use strict';var _=require('lodash');var util=require(_0xe7e7('0x0'));var moment=require('moment');var BPromise=require(_0xe7e7('0x1'));var rs=require(_0xe7e7('0x2'));var fs=require('fs');var Redis=require(_0xe7e7('0x3'));var db=require(_0xe7e7('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe7e7('0x5'))(_0xe7e7('0x6'));var config=require(_0xe7e7('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe7e7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x271b09,_0x5e560f,_0x4eee77){return new BPromise(function(_0x489c7f,_0x5106f0){return client['request'](_0x271b09,_0x4eee77)[_0xe7e7('0x9')](function(_0x1393dc){logger['info'](_0xe7e7('0xa'),_0x5e560f,'request\x20sent');logger[_0xe7e7('0xb')](_0xe7e7('0xc'),_0x5e560f,_0xe7e7('0xd'),JSON[_0xe7e7('0xe')](_0x1393dc));if(_0x1393dc[_0xe7e7('0xf')]){if(_0x1393dc[_0xe7e7('0xf')][_0xe7e7('0x10')]===0x1f4){logger[_0xe7e7('0xf')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x5e560f,_0x1393dc[_0xe7e7('0xf')][_0xe7e7('0x11')]);return _0x5106f0(_0x1393dc[_0xe7e7('0xf')][_0xe7e7('0x11')]);}logger[_0xe7e7('0xf')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x5e560f,_0x1393dc[_0xe7e7('0xf')][_0xe7e7('0x11')]);return _0x489c7f(_0x1393dc[_0xe7e7('0xf')][_0xe7e7('0x11')]);}else{logger['info'](_0xe7e7('0xa'),_0x5e560f,'request\x20sent');_0x489c7f(_0x1393dc['result']['message']);}})[_0xe7e7('0x12')](function(_0x33f093){logger[_0xe7e7('0xf')](_0xe7e7('0xa'),_0x5e560f,_0x33f093);_0x5106f0(_0x33f093);});});} \ No newline at end of file +var _0x4df9=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','UserOpenchannelQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x4df9,0x9c));var _0x94df=function(_0x5b5762,_0x2f05e1){_0x5b5762=_0x5b5762-0x0;var _0x80948f=_0x4df9[_0x5b5762];return _0x80948f;};'use strict';var _=require(_0x94df('0x0'));var util=require(_0x94df('0x1'));var moment=require(_0x94df('0x2'));var BPromise=require(_0x94df('0x3'));var rs=require(_0x94df('0x4'));var fs=require('fs');var Redis=require(_0x94df('0x5'));var db=require(_0x94df('0x6'))['db'];var utils=require(_0x94df('0x7'));var logger=require(_0x94df('0x8'))(_0x94df('0x9'));var config=require(_0x94df('0xa'));var jayson=require(_0x94df('0xb'));var client=jayson[_0x94df('0xc')][_0x94df('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x3f9449,_0x7c0110,_0x3f8467){return new BPromise(function(_0x1da32f,_0x517766){return client['request'](_0x3f9449,_0x3f8467)['then'](function(_0x3096ec){logger[_0x94df('0xe')](_0x94df('0xf'),_0x7c0110,'request\x20sent');logger[_0x94df('0x10')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x7c0110,_0x94df('0x11'),JSON[_0x94df('0x12')](_0x3096ec));if(_0x3096ec[_0x94df('0x13')]){if(_0x3096ec[_0x94df('0x13')][_0x94df('0x14')]===0x1f4){logger[_0x94df('0x13')](_0x94df('0xf'),_0x7c0110,_0x3096ec[_0x94df('0x13')]['message']);return _0x517766(_0x3096ec[_0x94df('0x13')][_0x94df('0x15')]);}logger[_0x94df('0x13')](_0x94df('0xf'),_0x7c0110,_0x3096ec[_0x94df('0x13')][_0x94df('0x15')]);return _0x1da32f(_0x3096ec[_0x94df('0x13')][_0x94df('0x15')]);}else{logger['info'](_0x94df('0xf'),_0x7c0110,_0x94df('0x11'));_0x1da32f(_0x3096ec['result']['message']);}})[_0x94df('0x16')](function(_0x1ca52d){logger['error'](_0x94df('0xf'),_0x7c0110,_0x1ca52d);_0x517766(_0x1ca52d);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index f5127f7..245fe5b 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 _0xcdff=['/:id/clone','clone','addSections','addResources','put','delete','destroy','removeSections','removeResources','exports','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/sections','/:id/resources','getResources','create','post'];(function(_0x5782d3,_0x5d6b90){var _0x49df53=function(_0x5c2f6c){while(--_0x5c2f6c){_0x5782d3['push'](_0x5782d3['shift']());}};_0x49df53(++_0x5d6b90);}(_0xcdff,0x169));var _0xfcdf=function(_0x5574a3,_0x461d22){_0x5574a3=_0x5574a3-0x0;var _0x57540a=_0xcdff[_0x5574a3];return _0x57540a;};'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[_0xfcdf('0x0')]();var fs_extra=require(_0xfcdf('0x1'));var auth=require(_0xfcdf('0x2'));var interaction=require(_0xfcdf('0x3'));var config=require(_0xfcdf('0x4'));var controller=require(_0xfcdf('0x5'));router[_0xfcdf('0x6')]('/',auth[_0xfcdf('0x7')](),controller[_0xfcdf('0x8')]);router[_0xfcdf('0x6')](_0xfcdf('0x9'),auth[_0xfcdf('0x7')](),controller['describe']);router[_0xfcdf('0x6')](_0xfcdf('0xa'),auth[_0xfcdf('0x7')](),controller[_0xfcdf('0xb')]);router[_0xfcdf('0x6')](_0xfcdf('0xc'),auth['isAuthenticated'](),controller['getSections']);router[_0xfcdf('0x6')](_0xfcdf('0xd'),auth[_0xfcdf('0x7')](),controller[_0xfcdf('0xe')]);router['post']('/',auth[_0xfcdf('0x7')](),controller[_0xfcdf('0xf')]);router[_0xfcdf('0x10')](_0xfcdf('0x11'),auth[_0xfcdf('0x7')](),controller[_0xfcdf('0x12')]);router[_0xfcdf('0x10')](_0xfcdf('0xc'),auth[_0xfcdf('0x7')](),controller[_0xfcdf('0x13')]);router[_0xfcdf('0x10')]('/:id/resources',auth[_0xfcdf('0x7')](),controller[_0xfcdf('0x14')]);router[_0xfcdf('0x15')](_0xfcdf('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xfcdf('0x16')](_0xfcdf('0xa'),auth[_0xfcdf('0x7')](),controller[_0xfcdf('0x17')]);router[_0xfcdf('0x16')]('/:id/sections',auth[_0xfcdf('0x7')](),controller[_0xfcdf('0x18')]);router[_0xfcdf('0x16')](_0xfcdf('0xd'),auth[_0xfcdf('0x7')](),controller[_0xfcdf('0x19')]);module[_0xfcdf('0x1a')]=router; \ No newline at end of file +var _0x47c2=['/:id','show','getSections','/:id/resources','getResources','post','create','clone','/:id/sections','addSections','addResources','put','update','delete','destroy','removeSections','removeResources','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x4e514c,_0x1c4dcf){var _0x5075c0=function(_0x2961b0){while(--_0x2961b0){_0x4e514c['push'](_0x4e514c['shift']());}};_0x5075c0(++_0x1c4dcf);}(_0x47c2,0x19e));var _0x247c=function(_0x5cc9a4,_0x22b494){_0x5cc9a4=_0x5cc9a4-0x0;var _0x51f941=_0x47c2[_0x5cc9a4];return _0x51f941;};'use strict';var multer=require(_0x247c('0x0'));var util=require(_0x247c('0x1'));var path=require('path');var timeout=require(_0x247c('0x2'));var express=require(_0x247c('0x3'));var router=express[_0x247c('0x4')]();var fs_extra=require(_0x247c('0x5'));var auth=require(_0x247c('0x6'));var interaction=require(_0x247c('0x7'));var config=require(_0x247c('0x8'));var controller=require(_0x247c('0x9'));router[_0x247c('0xa')]('/',auth[_0x247c('0xb')](),controller[_0x247c('0xc')]);router['get'](_0x247c('0xd'),auth[_0x247c('0xb')](),controller[_0x247c('0xe')]);router[_0x247c('0xa')](_0x247c('0xf'),auth[_0x247c('0xb')](),controller[_0x247c('0x10')]);router[_0x247c('0xa')]('/:id/sections',auth[_0x247c('0xb')](),controller[_0x247c('0x11')]);router[_0x247c('0xa')](_0x247c('0x12'),auth['isAuthenticated'](),controller[_0x247c('0x13')]);router[_0x247c('0x14')]('/',auth['isAuthenticated'](),controller[_0x247c('0x15')]);router[_0x247c('0x14')]('/:id/clone',auth[_0x247c('0xb')](),controller[_0x247c('0x16')]);router['post'](_0x247c('0x17'),auth[_0x247c('0xb')](),controller[_0x247c('0x18')]);router['post']('/:id/resources',auth[_0x247c('0xb')](),controller[_0x247c('0x19')]);router[_0x247c('0x1a')](_0x247c('0xf'),auth['isAuthenticated'](),controller[_0x247c('0x1b')]);router[_0x247c('0x1c')](_0x247c('0xf'),auth[_0x247c('0xb')](),controller[_0x247c('0x1d')]);router[_0x247c('0x1c')](_0x247c('0x17'),auth[_0x247c('0xb')](),controller[_0x247c('0x1e')]);router['delete'](_0x247c('0x12'),auth[_0x247c('0xb')](),controller[_0x247c('0x1f')]);module[_0x247c('0x20')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index aeb7a74..2d95fca 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 _0x8fcf=['crudPermissions','split','BOOLEAN','sequelize','STRING','name','setDataValue','join','getDataValue'];(function(_0x3e438f,_0x4439e7){var _0x35f7ff=function(_0x5c643a){while(--_0x5c643a){_0x3e438f['push'](_0x3e438f['shift']());}};_0x35f7ff(++_0x4439e7);}(_0x8fcf,0x1aa));var _0xf8fc=function(_0x2f7927,_0x1e3fca){_0x2f7927=_0x2f7927-0x0;var _0x4feabe=_0x8fcf[_0x2f7927];return _0x4feabe;};'use strict';var Sequelize=require(_0xf8fc('0x0'));module['exports']={'name':{'type':Sequelize[_0xf8fc('0x1')],'allowNull':![],'unique':_0xf8fc('0x2')},'crudPermissions':{'type':Sequelize[_0xf8fc('0x1')],'set':function(_0x19f816){this[_0xf8fc('0x3')]('crudPermissions',_0x19f816?_0x19f816[_0xf8fc('0x4')](''):[]);},'get':function(){return this[_0xf8fc('0x5')](_0xf8fc('0x6'))?this[_0xf8fc('0x5')](_0xf8fc('0x6'))[_0xf8fc('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xf8fc('0x1')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xf8fc('0x8')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xf8fc('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xf8fc('0x8')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xf8fc('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xf8fc('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xf8fc('0x8')],'defaultValue':!![]}}; \ No newline at end of file +var _0xfbc8=['exports','STRING','name','setDataValue','getDataValue','crudPermissions','split','BOOLEAN'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xfbc8,0x160));var _0x8fbc=function(_0x5cd7a3,_0x1aa14f){_0x5cd7a3=_0x5cd7a3-0x0;var _0x21235d=_0xfbc8[_0x5cd7a3];return _0x21235d;};'use strict';var Sequelize=require('sequelize');module[_0x8fbc('0x0')]={'name':{'type':Sequelize[_0x8fbc('0x1')],'allowNull':![],'unique':_0x8fbc('0x2')},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x23d5b9){this[_0x8fbc('0x3')]('crudPermissions',_0x23d5b9?_0x23d5b9['join'](''):[]);},'get':function(){return this[_0x8fbc('0x4')](_0x8fbc('0x5'))?this['getDataValue'](_0x8fbc('0x5'))[_0x8fbc('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x8fbc('0x1')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x8fbc('0x7')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x8fbc('0x7')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x8fbc('0x7')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x8fbc('0x7')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x8fbc('0x7')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x8fbc('0x7')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x8fbc('0x7')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 0e816f3..732c904 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 _0x8435=['Plugin','resourceId','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','nolimit','No\x20User\x20Profile\x20found\x20for\x20id\x20','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','status','json','offset','undefined','count','set','Content-Range','save','then','destroy','end','error','name','send','index','map','UserProfile','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','find','create','clone','get','omit','createdAt','updatedAt','body','sequelize','transaction','UserProfileSection','findAll','each','autoAssociation','UserProfileResource','sectionId','Resources','describe','addSections','userProfileId','push','removeSections','ids','isEmpty','includes','subsections','enabled','concat','findOne','Dashboard','forEach'];(function(_0x71af84,_0x5f514d){var _0x1d550d=function(_0x17f9f4){while(--_0x17f9f4){_0x71af84['push'](_0x71af84['shift']());}};_0x1d550d(++_0x5f514d);}(_0x8435,0x1d5));var _0x5843=function(_0x2f6b90,_0x5afe8f){_0x2f6b90=_0x2f6b90-0x0;var _0x3e6ff2=_0x8435[_0x2f6b90];return _0x3e6ff2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5843('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5843('0x1'));var rp=require('request-promise');var moment=require(_0x5843('0x2'));var BPromise=require(_0x5843('0x3'));var Mustache=require(_0x5843('0x4'));var util=require(_0x5843('0x5'));var path=require(_0x5843('0x6'));var sox=require(_0x5843('0x7'));var csv=require(_0x5843('0x8'));var ejs=require(_0x5843('0x9'));var fs=require('fs');var fs_extra=require(_0x5843('0xa'));var _=require('lodash');var squel=require(_0x5843('0xb'));var crypto=require('crypto');var jsforce=require(_0x5843('0xc'));var deskjs=require(_0x5843('0xd'));var toCsv=require(_0x5843('0x8'));var querystring=require(_0x5843('0xe'));var Papa=require(_0x5843('0xf'));var Redis=require('ioredis');var authService=require(_0x5843('0x10'));var qs=require(_0x5843('0x11'));var as=require(_0x5843('0x12'));var hardwareService=require(_0x5843('0x13'));var logger=require('../../config/logger')(_0x5843('0x14'));var utils=require(_0x5843('0x15'));var config=require(_0x5843('0x16'));var licenseUtil=require(_0x5843('0x17'));var db=require('../../mysqldb')['db'];config[_0x5843('0x18')]=_[_0x5843('0x19')](config[_0x5843('0x18')],{'host':_0x5843('0x1a'),'port':0x18eb});var socket=require(_0x5843('0x1b'))(new Redis(config[_0x5843('0x18')]));require(_0x5843('0x1c'))[_0x5843('0x1d')](socket);function respondWithStatusCode(_0x4cb52c,_0x5e88f5){_0x5e88f5=_0x5e88f5||0xcc;return function(_0x5bb00f){if(_0x5bb00f){return _0x4cb52c[_0x5843('0x1e')](_0x5e88f5);}return _0x4cb52c[_0x5843('0x1f')](_0x5e88f5)['end']();};}function respondWithResult(_0x1145d1,_0x5f2a95){_0x5f2a95=_0x5f2a95||0xc8;return function(_0x2a4b97){if(_0x2a4b97){return _0x1145d1[_0x5843('0x1f')](_0x5f2a95)[_0x5843('0x20')](_0x2a4b97);}};}function respondWithFilteredResult(_0x2b763e,_0x5b0b95){return function(_0x1a504e){if(_0x1a504e){var _0x13bd51=typeof _0x5b0b95[_0x5843('0x21')]===_0x5843('0x22')&&typeof _0x5b0b95['limit']===_0x5843('0x22');var _0x809d46=_0x1a504e[_0x5843('0x23')];var _0xdfcf01=_0x13bd51?0x0:_0x5b0b95['offset'];var _0x3fb872=_0x13bd51?_0x1a504e[_0x5843('0x23')]:_0x5b0b95[_0x5843('0x21')]+_0x5b0b95['limit'];var _0x1d59e5;if(_0x3fb872>=_0x809d46){_0x3fb872=_0x809d46;_0x1d59e5=0xc8;}else{_0x1d59e5=0xce;}_0x2b763e[_0x5843('0x1f')](_0x1d59e5);return _0x2b763e[_0x5843('0x24')](_0x5843('0x25'),_0xdfcf01+'-'+_0x3fb872+'/'+_0x809d46)[_0x5843('0x20')](_0x1a504e);}return null;};}function patchUpdates(_0x1feade){return function(_0x43f77f){try{jsonpatch['apply'](_0x43f77f,_0x1feade,!![]);}catch(_0x4e0421){return BPromise['reject'](_0x4e0421);}return _0x43f77f[_0x5843('0x26')]();};}function saveUpdates(_0x6907a9,_0x4b7b01){return function(_0x325fe0){if(_0x325fe0){return _0x325fe0['update'](_0x6907a9)[_0x5843('0x27')](function(_0x2b3f03){return _0x2b3f03;});}return null;};}function removeEntity(_0x56c86d,_0x21cd62){return function(_0x18a2e7){if(_0x18a2e7){return _0x18a2e7[_0x5843('0x28')]()[_0x5843('0x27')](function(){_0x56c86d[_0x5843('0x1f')](0xcc)[_0x5843('0x29')]();});}};}function handleEntityNotFound(_0x5e5f3c,_0x5c7c46){return function(_0x3d649d){if(!_0x3d649d){_0x5e5f3c['sendStatus'](0x194);}return _0x3d649d;};}function handleError(_0x4e1709,_0x65ee88){_0x65ee88=_0x65ee88||0x1f4;return function(_0xefb106){logger[_0x5843('0x2a')](_0xefb106['stack']);if(_0xefb106[_0x5843('0x2b')]){delete _0xefb106['name'];}_0x4e1709[_0x5843('0x1f')](_0x65ee88)[_0x5843('0x2c')](_0xefb106);};}exports[_0x5843('0x2d')]=function(_0x3724ba,_0x236e96){var _0x5524a9={},_0x2e03b0={},_0x446b9c={'count':0x0,'rows':[]};var _0x319016=_[_0x5843('0x2e')](db[_0x5843('0x2f')][_0x5843('0x30')],function(_0x37888a){return{'name':_0x37888a['fieldName'],'type':_0x37888a[_0x5843('0x31')][_0x5843('0x32')]};});_0x2e03b0[_0x5843('0x33')]=_['map'](_0x319016,_0x5843('0x2b'));_0x2e03b0[_0x5843('0x34')]=_[_0x5843('0x35')](_0x3724ba[_0x5843('0x34')]);_0x2e03b0[_0x5843('0x36')]=_[_0x5843('0x37')](_0x2e03b0[_0x5843('0x33')],_0x2e03b0[_0x5843('0x34')]);_0x5524a9[_0x5843('0x38')]=_[_0x5843('0x37')](_0x2e03b0[_0x5843('0x33')],qs[_0x5843('0x39')](_0x3724ba[_0x5843('0x34')][_0x5843('0x39')]));_0x5524a9[_0x5843('0x38')]=_0x5524a9['attributes'][_0x5843('0x3a')]?_0x5524a9[_0x5843('0x38')]:_0x2e03b0[_0x5843('0x33')];if(!_0x3724ba[_0x5843('0x34')][_0x5843('0x3b')]('nolimit')){_0x5524a9['limit']=qs[_0x5843('0x3c')](_0x3724ba[_0x5843('0x34')]['limit']);_0x5524a9[_0x5843('0x21')]=qs[_0x5843('0x21')](_0x3724ba[_0x5843('0x34')]['offset']);}_0x5524a9[_0x5843('0x3d')]=qs[_0x5843('0x3e')](_0x3724ba[_0x5843('0x34')][_0x5843('0x3e')]);_0x5524a9[_0x5843('0x3f')]=qs['filters'](_[_0x5843('0x40')](_0x3724ba[_0x5843('0x34')],_0x2e03b0[_0x5843('0x36')]),_0x319016);if(_0x3724ba[_0x5843('0x34')]['filter']){_0x5524a9['where']=_[_0x5843('0x41')](_0x5524a9[_0x5843('0x3f')],{'$or':_[_0x5843('0x2e')](_0x319016,function(_0x285525){if(_0x285525[_0x5843('0x31')]!==_0x5843('0x42')){var _0x36b092={};_0x36b092[_0x285525['name']]={'$like':'%'+_0x3724ba[_0x5843('0x34')][_0x5843('0x43')]+'%'};return _0x36b092;}})});}_0x5524a9=_['merge']({},_0x5524a9,_0x3724ba[_0x5843('0x44')]);var _0x2731fe={'where':_0x5524a9[_0x5843('0x3f')]};return db[_0x5843('0x2f')][_0x5843('0x23')](_0x2731fe)[_0x5843('0x27')](function(_0x2e32ef){_0x446b9c[_0x5843('0x23')]=_0x2e32ef;if(_0x3724ba['query'][_0x5843('0x45')]){_0x5524a9[_0x5843('0x46')]=[{'all':!![]}];}return db['UserProfile']['findAll'](_0x5524a9);})[_0x5843('0x27')](function(_0x232cd3){_0x446b9c[_0x5843('0x47')]=_0x232cd3;return _0x446b9c;})[_0x5843('0x27')](respondWithFilteredResult(_0x236e96,_0x5524a9))[_0x5843('0x48')](handleError(_0x236e96,null));};exports[_0x5843('0x49')]=function(_0x7ec688,_0x3bd7e5){var _0x3d9c21={'raw':![],'where':{'id':_0x7ec688[_0x5843('0x4a')]['id']}},_0x4e1ca6={};_0x4e1ca6[_0x5843('0x33')]=_[_0x5843('0x35')](db[_0x5843('0x2f')][_0x5843('0x30')]);_0x4e1ca6[_0x5843('0x34')]=_[_0x5843('0x35')](_0x7ec688[_0x5843('0x34')]);_0x4e1ca6[_0x5843('0x36')]=_[_0x5843('0x37')](_0x4e1ca6[_0x5843('0x33')],_0x4e1ca6['query']);_0x3d9c21[_0x5843('0x38')]=_[_0x5843('0x37')](_0x4e1ca6[_0x5843('0x33')],qs['fields'](_0x7ec688[_0x5843('0x34')][_0x5843('0x39')]));_0x3d9c21[_0x5843('0x38')]=_0x3d9c21[_0x5843('0x38')][_0x5843('0x3a')]?_0x3d9c21[_0x5843('0x38')]:_0x4e1ca6['model'];if(_0x7ec688['query']['includeAll']){_0x3d9c21[_0x5843('0x46')]=[{'all':!![]}];}_0x3d9c21=_['merge']({},_0x3d9c21,_0x7ec688[_0x5843('0x44')]);return db['UserProfile'][_0x5843('0x4b')](_0x3d9c21)[_0x5843('0x27')](handleEntityNotFound(_0x3bd7e5,null))[_0x5843('0x27')](respondWithResult(_0x3bd7e5,null))['catch'](handleError(_0x3bd7e5,null));};exports[_0x5843('0x4c')]=function(_0x97b701,_0xe7a2ed){return db[_0x5843('0x2f')][_0x5843('0x4c')](_0x97b701['body'],{})[_0x5843('0x27')](respondWithResult(_0xe7a2ed,0xc9))[_0x5843('0x48')](handleError(_0xe7a2ed,null));};exports[_0x5843('0x4d')]=function(_0x2e9196,_0x3d7f89){var _0x1b602a={'where':{'id':_0x2e9196[_0x5843('0x4a')]['id']}},_0x2ee6e2={};_0x2ee6e2['model']=_['keys'](db[_0x5843('0x2f')][_0x5843('0x30')]);_0x1b602a['attributes']=_[_0x5843('0x37')](_0x2ee6e2[_0x5843('0x33')],qs[_0x5843('0x39')](_0x2e9196['query'][_0x5843('0x39')]));_0x1b602a[_0x5843('0x38')]=_0x1b602a['attributes'][_0x5843('0x3a')]?_0x1b602a[_0x5843('0x38')]:_0x2ee6e2[_0x5843('0x33')];if(_0x2e9196[_0x5843('0x34')][_0x5843('0x45')]){_0x1b602a[_0x5843('0x46')]=[{'all':!![]}];}_0x1b602a=_['merge']({},_0x1b602a,_0x2e9196['options']);return db[_0x5843('0x2f')][_0x5843('0x4b')](_0x1b602a)[_0x5843('0x27')](handleEntityNotFound(_0x3d7f89,null))[_0x5843('0x27')](function(_0x51290d){if(_0x51290d){var _0x4c1a56=_0x51290d[_0x5843('0x4e')]({'plain':!![]});_0x4c1a56=qs[_0x5843('0x4f')](_0x4c1a56,['id',_0x5843('0x50'),_0x5843('0x51'),'crudPermissions']);_0x2e9196[_0x5843('0x52')]=_[_0x5843('0x4f')](_0x2e9196[_0x5843('0x52')],['id',_0x5843('0x50'),_0x5843('0x51')]);return db[_0x5843('0x53')][_0x5843('0x54')](function(_0x301125){return db[_0x5843('0x2f')][_0x5843('0x4c')](_[_0x5843('0x41')](_0x4c1a56,_0x2e9196['body']),{'include':_0x2e9196[_0x5843('0x34')][_0x5843('0x45')]?[{'all':!![]}]:undefined,'transaction':_0x301125})[_0x5843('0x27')](function(_0x3c6d1c){var _0x1a711f=_0x3c6d1c[_0x5843('0x4e')]({'plain':!![]});return db[_0x5843('0x55')][_0x5843('0x56')]({'where':{'userProfileId':_0x2e9196['params']['id']},'raw':!![]})[_0x5843('0x27')](function(_0x3cf97c){if(_0x3cf97c){return BPromise[_0x5843('0x57')](_0x3cf97c,function(_0x1189c5){return new BPromise(function(_0x3f21f9,_0x1ede72){if(_0x1189c5[_0x5843('0x58')]===null||_0x1189c5[_0x5843('0x58')]===0x1)_0x3f21f9(null);return db[_0x5843('0x59')][_0x5843('0x56')]({'where':{'sectionId':_0x1189c5['id']},'raw':!![]})['then'](function(_0x33175c){var _0x17f56c=_[_0x5843('0x2e')](_0x33175c,function(_0x4d19d8){return qs['omit'](_0x4d19d8,['id',_0x5843('0x50'),_0x5843('0x51'),_0x5843('0x5a')]);});_0x3f21f9(_0x17f56c);})[_0x5843('0x48')](function(_0x41b57b){_0x1ede72(_0x41b57b);});})[_0x5843('0x27')](function(_0x5ce4a5){var _0x54d52e=qs['omit'](_0x1189c5,['id',_0x5843('0x50'),_0x5843('0x51')]);_0x54d52e['userProfileId']=_0x1a711f['id'];if(_0x5ce4a5)_0x54d52e[_0x5843('0x5b')]=_0x5ce4a5;return _0x54d52e;})[_0x5843('0x27')](function(_0x11014e){return db[_0x5843('0x55')][_0x5843('0x4c')](_0x11014e,{'include':[{'model':db['UserProfileResource'],'as':'Resources'}],'raw':!![],'transaction':_0x301125});});})[_0x5843('0x27')](function(){return _0x1a711f;});}});});});}})[_0x5843('0x27')](respondWithResult(_0x3d7f89,0xc9))[_0x5843('0x48')](handleError(_0x3d7f89,null));};exports['update']=function(_0x11f3bb,_0x4081d9){if(_0x11f3bb[_0x5843('0x52')]['id']){delete _0x11f3bb[_0x5843('0x52')]['id'];}return db[_0x5843('0x2f')][_0x5843('0x4b')]({'where':{'id':_0x11f3bb['params']['id']}})['then'](handleEntityNotFound(_0x4081d9,null))['then'](saveUpdates(_0x11f3bb[_0x5843('0x52')],null))[_0x5843('0x27')](respondWithResult(_0x4081d9,null))[_0x5843('0x48')](handleError(_0x4081d9,null));};exports['destroy']=function(_0x294a9b,_0x581329){return db[_0x5843('0x2f')]['find']({'where':{'id':_0x294a9b[_0x5843('0x4a')]['id']}})['then'](handleEntityNotFound(_0x581329,null))['then'](removeEntity(_0x581329,null))['catch'](handleError(_0x581329,null));};exports[_0x5843('0x5c')]=function(_0x538f62,_0x4cb733){return db[_0x5843('0x2f')]['describe']()['then'](respondWithResult(_0x4cb733,null))[_0x5843('0x48')](handleError(_0x4cb733,null));};exports[_0x5843('0x5d')]=function(_0xf5276c,_0x4e354f){var _0xc3ba2b=_0xf5276c[_0x5843('0x52')];return db[_0x5843('0x2f')][_0x5843('0x4b')]({'where':{'id':_0xf5276c[_0x5843('0x4a')]['id']}})[_0x5843('0x27')](handleEntityNotFound(_0x4e354f,null))[_0x5843('0x27')](function(_0x26dfa2){if(_0x26dfa2){return db[_0x5843('0x53')][_0x5843('0x54')](function(_0x1dc64c){return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0xf5276c[_0x5843('0x4a')]['id'],'sectionId':_[_0x5843('0x2e')](_0xc3ba2b,function(_0x49d4ab){return _0x49d4ab['sectionId'];})},'transaction':_0x1dc64c})['then'](function(){var _0x22ba43=_[_0x5843('0x2e')](_0xc3ba2b,function(_0x1dab18){_0x1dab18[_0x5843('0x5e')]=_0xf5276c[_0x5843('0x4a')]['id'];return _0x1dab18;});var _0x92e425=[];return BPromise['each'](_0x22ba43,function(_0x8a68a8){return db[_0x5843('0x55')]['create'](_0x8a68a8,{'include':[{'model':db[_0x5843('0x59')],'as':_0x5843('0x5b')}],'raw':!![],'transaction':_0x1dc64c})[_0x5843('0x27')](function(_0x3af061){_0x92e425[_0x5843('0x5f')](_0x3af061[_0x5843('0x4e')]({'plain':!![]}));});})[_0x5843('0x27')](function(){return _0x92e425;});});});}})[_0x5843('0x27')](function(_0x2ee31e){return _0x2ee31e;})[_0x5843('0x27')](respondWithResult(_0x4e354f,null))['catch'](handleError(_0x4e354f,null));};exports[_0x5843('0x60')]=function(_0x471988,_0x175baf){var _0x886025;return db[_0x5843('0x2f')]['find']({'where':{'id':_0x471988['params']['id']},'attributes':['id','name']})[_0x5843('0x27')](handleEntityNotFound(_0x175baf,null))['then'](function(_0x45f911){if(_0x45f911){_0x886025=_0x45f911;return db[_0x5843('0x55')][_0x5843('0x28')]({'where':{'userProfileId':_0x471988[_0x5843('0x4a')]['id'],'sectionId':_0x471988['query'][_0x5843('0x61')]}});}})[_0x5843('0x27')](function(){return _0x886025;})[_0x5843('0x27')](respondWithStatusCode(_0x175baf,null))[_0x5843('0x48')](handleError(_0x175baf,null));};exports['getSections']=function(_0x41a325,_0x5ec53a){var _0x4bc2e8=[];var _0x44e449=[];return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x41a325[_0x5843('0x4a')]['id']},'raw':!![]})['then'](function(_0xfb2405){_0x4bc2e8=_[_0x5843('0x43')](_0xfb2405,function(_0x4a03fd){return _0x4a03fd['enabled']===0x1||_['includes']([0x3eb,0x709],_0x4a03fd['sectionId']);});if(!_[_0x5843('0x62')](_0x4bc2e8)){return _['map'](_0x4bc2e8,function(_0x1428d9){return _0x1428d9[_0x5843('0x5a')];});}else{return;}})[_0x5843('0x27')](function(_0x7534e0){if(_0x7534e0)_0x44e449=_0x7534e0;if(_[_0x5843('0x63')](_0x44e449,0x64)){var _0x42c603=_['find'](_0x4bc2e8,{'sectionId':0x64});return hasDefaultDashboard(_0x42c603)[_0x5843('0x27')](function(_0x443249){return _['map'](_0x4bc2e8,function(_0x3bda91){if(_0x3bda91[_0x5843('0x5a')]===0x64){_0x3bda91[_0x5843('0x64')]=_0x443249;}return _0x3bda91;});});}else{return;}})[_0x5843('0x27')](function(_0x5931b1){if(_0x5931b1)_0x4bc2e8=_0x5931b1;if(_['includes'](_0x44e449,0x3eb)){var _0x543d40=_[_0x5843('0x4b')](_0x4bc2e8,{'sectionId':0x3eb});return getCustomDashboards(_0x543d40)[_0x5843('0x27')](function(_0x4a300f){return _[_0x5843('0x2e')](_0x4bc2e8,function(_0x5059e2){if(_0x543d40[_0x5843('0x65')]){if(_0x5059e2[_0x5843('0x5a')]===0x3eb){_0x5059e2[_0x5843('0x64')]=_0x4a300f;}}else{if(_0x5059e2[_0x5843('0x5a')]===0x64){if(!_0x5059e2[_0x5843('0x64')]){_0x5059e2[_0x5843('0x64')]=[];}_0x5059e2['subsections']=_0x5059e2[_0x5843('0x64')][_0x5843('0x66')](_0x4a300f);}}return _0x5059e2;});});}else{return;}})['then'](function(_0x3e67f1){if(_0x3e67f1)_0x4bc2e8=_0x3e67f1;if(_[_0x5843('0x63')](_0x44e449,0x709)){var _0xd14b91=_[_0x5843('0x4b')](_0x4bc2e8,{'sectionId':0x709});return getPlugins(_0xd14b91)[_0x5843('0x27')](function(_0x107f6c){if(_0xd14b91[_0x5843('0x65')]){return _[_0x5843('0x2e')](_0x4bc2e8,function(_0x1da00d){if(_0x1da00d['sectionId']===0x709){_0x1da00d[_0x5843('0x64')]=_0x107f6c;}return _0x1da00d;});}else{var _0x15a33c={'sectionId':0x76c,'enabled':0x1,'subsections':_0x107f6c};var _0x32ba14=_[_0x5843('0x2e')](_0x4bc2e8);_0x32ba14['push'](_0x15a33c);return _0x32ba14;}});}else{return;}})[_0x5843('0x27')](function(_0x442f5e){if(_0x442f5e)_0x4bc2e8=_0x442f5e;return _[_0x5843('0x43')](_0x4bc2e8,[_0x5843('0x65'),0x1]);})['then'](respondWithResult(_0x5ec53a,null))['catch'](handleError(_0x5ec53a,null));};function hasDefaultDashboard(_0x17a501){var _0x5032fd=[0x65];return new BPromise(function(_0x3ba468,_0x499e94){try{if(_0x17a501[_0x5843('0x58')]){_0x3ba468(_0x5032fd);}else{return db[_0x5843('0x59')][_0x5843('0x67')]({'where':{'sectionId':_0x17a501['id']},'raw':!![]})['then'](function(_0x2e2d87){_0x2e2d87?_0x3ba468(_0x5032fd):_0x3ba468();});}}catch(_0x216d39){_0x499e94(_0x216d39);}});}function getCustomDashboards(_0x199f32){var _0x18f8af=[];return new BPromise(function(_0x4289a3,_0x45d51b){try{if(_0x199f32['autoAssociation']){return db[_0x5843('0x68')][_0x5843('0x56')]({'raw':!![]})[_0x5843('0x27')](function(_0x557227){_0x557227[_0x5843('0x69')](function(_0x346c89){_0x18f8af[_0x5843('0x5f')](_0x346c89['id']+0x1869f);});_0x4289a3(_0x18f8af);});}else{return db[_0x5843('0x59')][_0x5843('0x56')]({'where':{'sectionId':_0x199f32['id']},'raw':!![]})[_0x5843('0x27')](function(_0x2ab8d3){_0x2ab8d3['forEach'](function(_0xb4f01e){_0x18f8af['push'](_0xb4f01e['resourceId']+0x1869f);});_0x4289a3(_0x18f8af);});}}catch(_0x58b7e4){_0x45d51b(_0x58b7e4);}});}function getPlugins(_0x4170cc){var _0x55766e=[];return new BPromise(function(_0xb20e59,_0x146d2c){try{if(_0x4170cc[_0x5843('0x58')]){return db[_0x5843('0x6a')]['findAll']({'raw':!![]})[_0x5843('0x27')](function(_0x35ae2f){_0x35ae2f['forEach'](function(_0x1ad77f){_0x55766e['push'](_0x1ad77f['id']+0x15b38);});_0xb20e59(_0x55766e);});}else{return db[_0x5843('0x59')][_0x5843('0x56')]({'where':{'sectionId':_0x4170cc['id']},'raw':!![]})[_0x5843('0x27')](function(_0x2b5ef9){_0x2b5ef9['forEach'](function(_0xd0df8f){_0x55766e[_0x5843('0x5f')](_0xd0df8f[_0x5843('0x6b')]+0x15b38);});_0xb20e59(_0x55766e);});}}catch(_0x196f39){_0x146d2c(_0x196f39);}});}exports['addResources']=function(_0x350035,_0x34c05e){return db['UserProfile']['find']({'where':{'id':_0x350035[_0x5843('0x4a')]['id']}})[_0x5843('0x27')](handleEntityNotFound(_0x34c05e,null))[_0x5843('0x27')](function(_0x498f84){if(_0x498f84){return db['sequelize']['transaction'](function(_0x4ce452){return db[_0x5843('0x55')][_0x5843('0x56')]({'where':{'userProfileId':_0x350035[_0x5843('0x4a')]['id']},'attributes':['id'],'raw':!![]})[_0x5843('0x27')](function(_0x20053f){if(_0x20053f){return db[_0x5843('0x55')][_0x5843('0x28')]({'where':{'userProfileId':_0x350035[_0x5843('0x4a')]['id'],'id':_['map'](_0x20053f,function(_0x31b052){return _0x31b052['id'];})},'transaction':_0x4ce452});}})[_0x5843('0x27')](function(_0x535f42){var _0x50e70b=_[_0x5843('0x2e')](_0x350035[_0x5843('0x52')],function(_0x2ef024){_0x2ef024[_0x5843('0x5e')]=_0x350035['params']['id'];return _0x2ef024;});return db['UserProfileSection'][_0x5843('0x6c')](_0x50e70b,{'raw':!![],'transaction':_0x4ce452});})[_0x5843('0x27')](function(_0x361196){var _0x6e3d5=_[_0x5843('0x43')](_['map'](_0x361196,function(_0xa1a216){return _0xa1a216[_0x5843('0x4e')]({'plain':!![]});}),{'includeAll':![]});if(_0x6e3d5){return db[_0x5843('0x55')][_0x5843('0x56')]({'where':{'userProfileId':_0x350035[_0x5843('0x4a')]['id'],'sectionId':_['map'](_0x6e3d5,function(_0x22952c){return _0x22952c[_0x5843('0x5a')];})},'attributes':['id',_0x5843('0x5a')],'raw':!![]})[_0x5843('0x27')](function(_0x5d8f88){var _0x329881=_['map'](_0x350035[_0x5843('0x52')],function(_0x2851ce){_0x2851ce[_0x5843('0x5e')]=_0x350035[_0x5843('0x4a')]['id'];return _0x2851ce;});return db[_0x5843('0x59')][_0x5843('0x6c')](_0x329881,{'raw':!![],'transaction':_0x4ce452});});}})['catch'](handleError(_0x34c05e,null));});}})[_0x5843('0x27')](function(_0x2a4e00){var _0x8ebfc6=_['map'](_0x2a4e00,function(_0x21b79d){return _0x21b79d[_0x5843('0x4e')]({'plain':!![]});});})[_0x5843('0x27')](respondWithResult(_0x34c05e,null))[_0x5843('0x48')](handleError(_0x34c05e,null));};exports[_0x5843('0x6d')]=function(_0x2d4b30,_0x517176,_0x1df92f){return db['UserProfile'][_0x5843('0x4b')]({'where':{'id':_0x2d4b30['params']['id']}})[_0x5843('0x27')](handleEntityNotFound(_0x517176,null))[_0x5843('0x27')](function(_0x577dd7){if(_0x577dd7){return _0x577dd7[_0x5843('0x6d')](_0x2d4b30[_0x5843('0x34')][_0x5843('0x61')]);}})[_0x5843('0x27')](respondWithStatusCode(_0x517176,null))[_0x5843('0x48')](handleError(_0x517176,null));};exports[_0x5843('0x6e')]=function(_0x2aba6d,_0x369016){var _0x2fdd18={};if(!_0x2aba6d[_0x5843('0x34')][_0x5843('0x6f')])throw new Error(_0x5843('0x70'));if(!_0x2aba6d[_0x5843('0x34')][_0x5843('0x3b')](_0x5843('0x71'))){_0x2fdd18[_0x5843('0x3c')]=qs['limit'](_0x2aba6d[_0x5843('0x34')][_0x5843('0x3c')]);_0x2fdd18[_0x5843('0x21')]=qs['offset'](_0x2aba6d[_0x5843('0x34')][_0x5843('0x21')]);}return db[_0x5843('0x2f')]['find']({'where':{'id':_0x2aba6d[_0x5843('0x4a')]['id']}})['then'](function(_0x3e7e8c){if(!_0x3e7e8c)throw new Error(_0x5843('0x72')+_0x2aba6d['params']['id']);return db[_0x5843('0x2f')]['getResources'](_0x2aba6d);})[_0x5843('0x27')](respondWithFilteredResult(_0x369016,_0x2fdd18))[_0x5843('0x48')](handleError(_0x369016,null));}; \ No newline at end of file +var _0xf4ed=['push','removeSections','ids','getSections','enabled','includes','isEmpty','subsections','findOne','Dashboard','forEach','resourceId','addResources','bulkCreate','removeResources','getResources','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','fs-extra','squel','jsforce','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','./userProfile.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','destroy','then','error','stack','name','send','map','UserProfile','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','filter','where','merge','options','includeAll','findAll','rows','catch','show','params','length','include','find','create','get','omit','createdAt','updatedAt','crudPermissions','body','transaction','autoAssociation','sectionId','userProfileId','Resources','UserProfileSection','UserProfileResource','describe','sequelize','each'];(function(_0x158e6d,_0x538a8d){var _0x470231=function(_0x469c68){while(--_0x469c68){_0x158e6d['push'](_0x158e6d['shift']());}};_0x470231(++_0x538a8d);}(_0xf4ed,0x152));var _0xdf4e=function(_0x5c6c2e,_0x86e980){_0x5c6c2e=_0x5c6c2e-0x0;var _0xd262ac=_0xf4ed[_0x5c6c2e];return _0xd262ac;};'use strict';var emlformat=require(_0xdf4e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdf4e('0x1'));var jsonpatch=require(_0xdf4e('0x2'));var rp=require('request-promise');var moment=require(_0xdf4e('0x3'));var BPromise=require(_0xdf4e('0x4'));var Mustache=require(_0xdf4e('0x5'));var util=require('util');var path=require(_0xdf4e('0x6'));var sox=require(_0xdf4e('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdf4e('0x8'));var _=require('lodash');var squel=require(_0xdf4e('0x9'));var crypto=require('crypto');var jsforce=require(_0xdf4e('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xdf4e('0xb'));var querystring=require(_0xdf4e('0xc'));var Papa=require(_0xdf4e('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xdf4e('0xe'));var as=require(_0xdf4e('0xf'));var hardwareService=require(_0xdf4e('0x10'));var logger=require(_0xdf4e('0x11'))(_0xdf4e('0x12'));var utils=require(_0xdf4e('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xdf4e('0x14'));var db=require(_0xdf4e('0x15'))['db'];config[_0xdf4e('0x16')]=_[_0xdf4e('0x17')](config[_0xdf4e('0x16')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xdf4e('0x18'))[_0xdf4e('0x19')](socket);function respondWithStatusCode(_0x1ab888,_0x39102b){_0x39102b=_0x39102b||0xcc;return function(_0x1f012b){if(_0x1f012b){return _0x1ab888[_0xdf4e('0x1a')](_0x39102b);}return _0x1ab888[_0xdf4e('0x1b')](_0x39102b)[_0xdf4e('0x1c')]();};}function respondWithResult(_0x3bdeb2,_0x5f564b){_0x5f564b=_0x5f564b||0xc8;return function(_0x1442a0){if(_0x1442a0){return _0x3bdeb2[_0xdf4e('0x1b')](_0x5f564b)['json'](_0x1442a0);}};}function respondWithFilteredResult(_0x333548,_0x104861){return function(_0x25d23f){if(_0x25d23f){var _0x1a08af=typeof _0x104861[_0xdf4e('0x1d')]===_0xdf4e('0x1e')&&typeof _0x104861[_0xdf4e('0x1f')]===_0xdf4e('0x1e');var _0x4b07cc=_0x25d23f[_0xdf4e('0x20')];var _0x4ccce8=_0x1a08af?0x0:_0x104861[_0xdf4e('0x1d')];var _0x5a85ab=_0x1a08af?_0x25d23f[_0xdf4e('0x20')]:_0x104861[_0xdf4e('0x1d')]+_0x104861[_0xdf4e('0x1f')];var _0xe7b585;if(_0x5a85ab>=_0x4b07cc){_0x5a85ab=_0x4b07cc;_0xe7b585=0xc8;}else{_0xe7b585=0xce;}_0x333548['status'](_0xe7b585);return _0x333548[_0xdf4e('0x21')]('Content-Range',_0x4ccce8+'-'+_0x5a85ab+'/'+_0x4b07cc)[_0xdf4e('0x22')](_0x25d23f);}return null;};}function patchUpdates(_0x491720){return function(_0x4510d8){try{jsonpatch[_0xdf4e('0x23')](_0x4510d8,_0x491720,!![]);}catch(_0x17e46a){return BPromise[_0xdf4e('0x24')](_0x17e46a);}return _0x4510d8[_0xdf4e('0x25')]();};}function saveUpdates(_0x5a280c,_0x2cb9d0){return function(_0xb8587e){if(_0xb8587e){return _0xb8587e[_0xdf4e('0x26')](_0x5a280c)['then'](function(_0x442f1a){return _0x442f1a;});}return null;};}function removeEntity(_0x1042f5,_0x58b246){return function(_0x24a7b2){if(_0x24a7b2){return _0x24a7b2[_0xdf4e('0x27')]()[_0xdf4e('0x28')](function(){_0x1042f5[_0xdf4e('0x1b')](0xcc)[_0xdf4e('0x1c')]();});}};}function handleEntityNotFound(_0x2ba29d,_0x4f706d){return function(_0x2118f2){if(!_0x2118f2){_0x2ba29d[_0xdf4e('0x1a')](0x194);}return _0x2118f2;};}function handleError(_0x328d36,_0x4fd82b){_0x4fd82b=_0x4fd82b||0x1f4;return function(_0x72e149){logger[_0xdf4e('0x29')](_0x72e149[_0xdf4e('0x2a')]);if(_0x72e149[_0xdf4e('0x2b')]){delete _0x72e149['name'];}_0x328d36[_0xdf4e('0x1b')](_0x4fd82b)[_0xdf4e('0x2c')](_0x72e149);};}exports['index']=function(_0x188661,_0x29d525){var _0xa70d69={},_0x555102={},_0x2c7123={'count':0x0,'rows':[]};var _0x24d6e6=_[_0xdf4e('0x2d')](db[_0xdf4e('0x2e')][_0xdf4e('0x2f')],function(_0x582cfa){return{'name':_0x582cfa['fieldName'],'type':_0x582cfa[_0xdf4e('0x30')][_0xdf4e('0x31')]};});_0x555102[_0xdf4e('0x32')]=_['map'](_0x24d6e6,'name');_0x555102[_0xdf4e('0x33')]=_[_0xdf4e('0x34')](_0x188661['query']);_0x555102[_0xdf4e('0x35')]=_[_0xdf4e('0x36')](_0x555102[_0xdf4e('0x32')],_0x555102['query']);_0xa70d69[_0xdf4e('0x37')]=_[_0xdf4e('0x36')](_0x555102[_0xdf4e('0x32')],qs[_0xdf4e('0x38')](_0x188661[_0xdf4e('0x33')][_0xdf4e('0x38')]));_0xa70d69[_0xdf4e('0x37')]=_0xa70d69['attributes']['length']?_0xa70d69[_0xdf4e('0x37')]:_0x555102[_0xdf4e('0x32')];if(!_0x188661[_0xdf4e('0x33')][_0xdf4e('0x39')]('nolimit')){_0xa70d69['limit']=qs[_0xdf4e('0x1f')](_0x188661[_0xdf4e('0x33')][_0xdf4e('0x1f')]);_0xa70d69[_0xdf4e('0x1d')]=qs['offset'](_0x188661[_0xdf4e('0x33')]['offset']);}_0xa70d69[_0xdf4e('0x3a')]=qs['sort'](_0x188661[_0xdf4e('0x33')][_0xdf4e('0x3b')]);_0xa70d69['where']=qs['filters'](_['pick'](_0x188661[_0xdf4e('0x33')],_0x555102[_0xdf4e('0x35')]),_0x24d6e6);if(_0x188661[_0xdf4e('0x33')][_0xdf4e('0x3c')]){_0xa70d69[_0xdf4e('0x3d')]=_[_0xdf4e('0x3e')](_0xa70d69[_0xdf4e('0x3d')],{'$or':_[_0xdf4e('0x2d')](_0x24d6e6,function(_0x16bce6){if(_0x16bce6[_0xdf4e('0x30')]!=='VIRTUAL'){var _0x314d11={};_0x314d11[_0x16bce6[_0xdf4e('0x2b')]]={'$like':'%'+_0x188661[_0xdf4e('0x33')][_0xdf4e('0x3c')]+'%'};return _0x314d11;}})});}_0xa70d69=_[_0xdf4e('0x3e')]({},_0xa70d69,_0x188661[_0xdf4e('0x3f')]);var _0x22a4aa={'where':_0xa70d69[_0xdf4e('0x3d')]};return db[_0xdf4e('0x2e')]['count'](_0x22a4aa)[_0xdf4e('0x28')](function(_0x531fc3){_0x2c7123[_0xdf4e('0x20')]=_0x531fc3;if(_0x188661[_0xdf4e('0x33')][_0xdf4e('0x40')]){_0xa70d69['include']=[{'all':!![]}];}return db['UserProfile'][_0xdf4e('0x41')](_0xa70d69);})[_0xdf4e('0x28')](function(_0x56c40){_0x2c7123[_0xdf4e('0x42')]=_0x56c40;return _0x2c7123;})[_0xdf4e('0x28')](respondWithFilteredResult(_0x29d525,_0xa70d69))[_0xdf4e('0x43')](handleError(_0x29d525,null));};exports[_0xdf4e('0x44')]=function(_0x462686,_0x4fbd1d){var _0x216d5a={'raw':![],'where':{'id':_0x462686[_0xdf4e('0x45')]['id']}},_0x14b719={};_0x14b719[_0xdf4e('0x32')]=_[_0xdf4e('0x34')](db[_0xdf4e('0x2e')]['rawAttributes']);_0x14b719['query']=_[_0xdf4e('0x34')](_0x462686[_0xdf4e('0x33')]);_0x14b719[_0xdf4e('0x35')]=_[_0xdf4e('0x36')](_0x14b719[_0xdf4e('0x32')],_0x14b719[_0xdf4e('0x33')]);_0x216d5a[_0xdf4e('0x37')]=_['intersection'](_0x14b719[_0xdf4e('0x32')],qs[_0xdf4e('0x38')](_0x462686[_0xdf4e('0x33')][_0xdf4e('0x38')]));_0x216d5a[_0xdf4e('0x37')]=_0x216d5a['attributes'][_0xdf4e('0x46')]?_0x216d5a['attributes']:_0x14b719[_0xdf4e('0x32')];if(_0x462686[_0xdf4e('0x33')][_0xdf4e('0x40')]){_0x216d5a[_0xdf4e('0x47')]=[{'all':!![]}];}_0x216d5a=_['merge']({},_0x216d5a,_0x462686[_0xdf4e('0x3f')]);return db[_0xdf4e('0x2e')][_0xdf4e('0x48')](_0x216d5a)[_0xdf4e('0x28')](handleEntityNotFound(_0x4fbd1d,null))['then'](respondWithResult(_0x4fbd1d,null))[_0xdf4e('0x43')](handleError(_0x4fbd1d,null));};exports[_0xdf4e('0x49')]=function(_0x23e60c,_0x5b5634){return db[_0xdf4e('0x2e')][_0xdf4e('0x49')](_0x23e60c['body'],{})[_0xdf4e('0x28')](respondWithResult(_0x5b5634,0xc9))[_0xdf4e('0x43')](handleError(_0x5b5634,null));};exports['clone']=function(_0x46af33,_0x35cf39){var _0x23b641={'where':{'id':_0x46af33[_0xdf4e('0x45')]['id']}},_0x5884d4={};_0x5884d4['model']=_[_0xdf4e('0x34')](db[_0xdf4e('0x2e')]['rawAttributes']);_0x23b641['attributes']=_[_0xdf4e('0x36')](_0x5884d4[_0xdf4e('0x32')],qs['fields'](_0x46af33['query']['fields']));_0x23b641['attributes']=_0x23b641[_0xdf4e('0x37')][_0xdf4e('0x46')]?_0x23b641[_0xdf4e('0x37')]:_0x5884d4[_0xdf4e('0x32')];if(_0x46af33[_0xdf4e('0x33')]['includeAll']){_0x23b641[_0xdf4e('0x47')]=[{'all':!![]}];}_0x23b641=_['merge']({},_0x23b641,_0x46af33[_0xdf4e('0x3f')]);return db[_0xdf4e('0x2e')][_0xdf4e('0x48')](_0x23b641)[_0xdf4e('0x28')](handleEntityNotFound(_0x35cf39,null))['then'](function(_0x16b271){if(_0x16b271){var _0x111fe0=_0x16b271[_0xdf4e('0x4a')]({'plain':!![]});_0x111fe0=qs[_0xdf4e('0x4b')](_0x111fe0,['id',_0xdf4e('0x4c'),_0xdf4e('0x4d'),_0xdf4e('0x4e')]);_0x46af33[_0xdf4e('0x4f')]=_['omit'](_0x46af33['body'],['id',_0xdf4e('0x4c'),'updatedAt']);return db['sequelize'][_0xdf4e('0x50')](function(_0x4a60f2){return db['UserProfile'][_0xdf4e('0x49')](_[_0xdf4e('0x3e')](_0x111fe0,_0x46af33[_0xdf4e('0x4f')]),{'include':_0x46af33[_0xdf4e('0x33')][_0xdf4e('0x40')]?[{'all':!![]}]:undefined,'transaction':_0x4a60f2})[_0xdf4e('0x28')](function(_0xec824d){var _0x5c72a0=_0xec824d['get']({'plain':!![]});return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x46af33[_0xdf4e('0x45')]['id']},'raw':!![]})['then'](function(_0x23820c){if(_0x23820c){return BPromise['each'](_0x23820c,function(_0x324c6e){return new BPromise(function(_0x3d7e84,_0xf1227d){if(_0x324c6e['autoAssociation']===null||_0x324c6e[_0xdf4e('0x51')]===0x1)_0x3d7e84(null);return db['UserProfileResource'][_0xdf4e('0x41')]({'where':{'sectionId':_0x324c6e['id']},'raw':!![]})[_0xdf4e('0x28')](function(_0x3eda03){var _0x412d2c=_[_0xdf4e('0x2d')](_0x3eda03,function(_0x1c283d){return qs[_0xdf4e('0x4b')](_0x1c283d,['id',_0xdf4e('0x4c'),_0xdf4e('0x4d'),_0xdf4e('0x52')]);});_0x3d7e84(_0x412d2c);})[_0xdf4e('0x43')](function(_0xa72a79){_0xf1227d(_0xa72a79);});})['then'](function(_0x590ca5){var _0x17dba2=qs['omit'](_0x324c6e,['id',_0xdf4e('0x4c'),_0xdf4e('0x4d')]);_0x17dba2[_0xdf4e('0x53')]=_0x5c72a0['id'];if(_0x590ca5)_0x17dba2[_0xdf4e('0x54')]=_0x590ca5;return _0x17dba2;})[_0xdf4e('0x28')](function(_0x3a6408){return db[_0xdf4e('0x55')][_0xdf4e('0x49')](_0x3a6408,{'include':[{'model':db[_0xdf4e('0x56')],'as':_0xdf4e('0x54')}],'raw':!![],'transaction':_0x4a60f2});});})[_0xdf4e('0x28')](function(){return _0x5c72a0;});}});});});}})['then'](respondWithResult(_0x35cf39,0xc9))[_0xdf4e('0x43')](handleError(_0x35cf39,null));};exports[_0xdf4e('0x26')]=function(_0x106b92,_0x23b4f6){if(_0x106b92[_0xdf4e('0x4f')]['id']){delete _0x106b92[_0xdf4e('0x4f')]['id'];}return db[_0xdf4e('0x2e')][_0xdf4e('0x48')]({'where':{'id':_0x106b92[_0xdf4e('0x45')]['id']}})[_0xdf4e('0x28')](handleEntityNotFound(_0x23b4f6,null))['then'](saveUpdates(_0x106b92[_0xdf4e('0x4f')],null))[_0xdf4e('0x28')](respondWithResult(_0x23b4f6,null))[_0xdf4e('0x43')](handleError(_0x23b4f6,null));};exports['destroy']=function(_0x517dfd,_0x203dd3){return db[_0xdf4e('0x2e')][_0xdf4e('0x48')]({'where':{'id':_0x517dfd[_0xdf4e('0x45')]['id']}})[_0xdf4e('0x28')](handleEntityNotFound(_0x203dd3,null))[_0xdf4e('0x28')](removeEntity(_0x203dd3,null))[_0xdf4e('0x43')](handleError(_0x203dd3,null));};exports[_0xdf4e('0x57')]=function(_0x3f7d92,_0x453830){return db[_0xdf4e('0x2e')][_0xdf4e('0x57')]()[_0xdf4e('0x28')](respondWithResult(_0x453830,null))['catch'](handleError(_0x453830,null));};exports['addSections']=function(_0x5dde03,_0x5e6985){var _0x5759b8=_0x5dde03[_0xdf4e('0x4f')];return db[_0xdf4e('0x2e')][_0xdf4e('0x48')]({'where':{'id':_0x5dde03[_0xdf4e('0x45')]['id']}})['then'](handleEntityNotFound(_0x5e6985,null))['then'](function(_0x58b9a0){if(_0x58b9a0){return db[_0xdf4e('0x58')][_0xdf4e('0x50')](function(_0x348f2b){return db[_0xdf4e('0x55')]['destroy']({'where':{'userProfileId':_0x5dde03[_0xdf4e('0x45')]['id'],'sectionId':_[_0xdf4e('0x2d')](_0x5759b8,function(_0x3bded4){return _0x3bded4[_0xdf4e('0x52')];})},'transaction':_0x348f2b})[_0xdf4e('0x28')](function(){var _0x385de3=_[_0xdf4e('0x2d')](_0x5759b8,function(_0x225f37){_0x225f37[_0xdf4e('0x53')]=_0x5dde03['params']['id'];return _0x225f37;});var _0x2b1423=[];return BPromise[_0xdf4e('0x59')](_0x385de3,function(_0x45fb05){return db['UserProfileSection']['create'](_0x45fb05,{'include':[{'model':db['UserProfileResource'],'as':_0xdf4e('0x54')}],'raw':!![],'transaction':_0x348f2b})[_0xdf4e('0x28')](function(_0xeb2f05){_0x2b1423[_0xdf4e('0x5a')](_0xeb2f05['get']({'plain':!![]}));});})[_0xdf4e('0x28')](function(){return _0x2b1423;});});});}})[_0xdf4e('0x28')](function(_0x892524){return _0x892524;})[_0xdf4e('0x28')](respondWithResult(_0x5e6985,null))[_0xdf4e('0x43')](handleError(_0x5e6985,null));};exports[_0xdf4e('0x5b')]=function(_0x5e7d92,_0x16afce){var _0x150d05;return db[_0xdf4e('0x2e')][_0xdf4e('0x48')]({'where':{'id':_0x5e7d92[_0xdf4e('0x45')]['id']},'attributes':['id',_0xdf4e('0x2b')]})[_0xdf4e('0x28')](handleEntityNotFound(_0x16afce,null))['then'](function(_0x5a9995){if(_0x5a9995){_0x150d05=_0x5a9995;return db[_0xdf4e('0x55')]['destroy']({'where':{'userProfileId':_0x5e7d92['params']['id'],'sectionId':_0x5e7d92[_0xdf4e('0x33')][_0xdf4e('0x5c')]}});}})[_0xdf4e('0x28')](function(){return _0x150d05;})[_0xdf4e('0x28')](respondWithStatusCode(_0x16afce,null))['catch'](handleError(_0x16afce,null));};exports[_0xdf4e('0x5d')]=function(_0x5caa09,_0x22133f){var _0x5f1876=[];var _0x1c326f=[];return db[_0xdf4e('0x55')]['findAll']({'where':{'userProfileId':_0x5caa09[_0xdf4e('0x45')]['id']},'raw':!![]})[_0xdf4e('0x28')](function(_0x29d0a5){_0x5f1876=_[_0xdf4e('0x3c')](_0x29d0a5,function(_0x3a4ce7){return _0x3a4ce7[_0xdf4e('0x5e')]===0x1||_[_0xdf4e('0x5f')]([0x3eb,0x709],_0x3a4ce7[_0xdf4e('0x52')]);});if(!_[_0xdf4e('0x60')](_0x5f1876)){return _['map'](_0x5f1876,function(_0x1ef7ea){return _0x1ef7ea[_0xdf4e('0x52')];});}else{return;}})[_0xdf4e('0x28')](function(_0x9775ef){if(_0x9775ef)_0x1c326f=_0x9775ef;if(_[_0xdf4e('0x5f')](_0x1c326f,0x64)){var _0x542acc=_[_0xdf4e('0x48')](_0x5f1876,{'sectionId':0x64});return hasDefaultDashboard(_0x542acc)[_0xdf4e('0x28')](function(_0x25d072){return _[_0xdf4e('0x2d')](_0x5f1876,function(_0x6859e1){if(_0x6859e1[_0xdf4e('0x52')]===0x64){_0x6859e1[_0xdf4e('0x61')]=_0x25d072;}return _0x6859e1;});});}else{return;}})[_0xdf4e('0x28')](function(_0x20ce15){if(_0x20ce15)_0x5f1876=_0x20ce15;if(_[_0xdf4e('0x5f')](_0x1c326f,0x3eb)){var _0xc6a545=_[_0xdf4e('0x48')](_0x5f1876,{'sectionId':0x3eb});return getCustomDashboards(_0xc6a545)[_0xdf4e('0x28')](function(_0x3cde14){return _['map'](_0x5f1876,function(_0x44fb1e){if(_0xc6a545[_0xdf4e('0x5e')]){if(_0x44fb1e[_0xdf4e('0x52')]===0x3eb){_0x44fb1e[_0xdf4e('0x61')]=_0x3cde14;}}else{if(_0x44fb1e['sectionId']===0x64){if(!_0x44fb1e[_0xdf4e('0x61')]){_0x44fb1e[_0xdf4e('0x61')]=[];}_0x44fb1e[_0xdf4e('0x61')]=_0x44fb1e[_0xdf4e('0x61')]['concat'](_0x3cde14);}}return _0x44fb1e;});});}else{return;}})[_0xdf4e('0x28')](function(_0x318813){if(_0x318813)_0x5f1876=_0x318813;if(_[_0xdf4e('0x5f')](_0x1c326f,0x709)){var _0x4a5d49=_[_0xdf4e('0x48')](_0x5f1876,{'sectionId':0x709});return getPlugins(_0x4a5d49)[_0xdf4e('0x28')](function(_0x5c82d7){if(_0x4a5d49[_0xdf4e('0x5e')]){return _[_0xdf4e('0x2d')](_0x5f1876,function(_0x14a6bc){if(_0x14a6bc[_0xdf4e('0x52')]===0x709){_0x14a6bc['subsections']=_0x5c82d7;}return _0x14a6bc;});}else{var _0x42ae91={'sectionId':0x76c,'enabled':0x1,'subsections':_0x5c82d7};var _0x5c0140=_[_0xdf4e('0x2d')](_0x5f1876);_0x5c0140[_0xdf4e('0x5a')](_0x42ae91);return _0x5c0140;}});}else{return;}})[_0xdf4e('0x28')](function(_0x5bf8a6){if(_0x5bf8a6)_0x5f1876=_0x5bf8a6;return _[_0xdf4e('0x3c')](_0x5f1876,[_0xdf4e('0x5e'),0x1]);})[_0xdf4e('0x28')](respondWithResult(_0x22133f,null))[_0xdf4e('0x43')](handleError(_0x22133f,null));};function hasDefaultDashboard(_0x1688de){var _0x4bbc4d=[0x65];return new BPromise(function(_0x1afa69,_0x7f8b4c){try{if(_0x1688de[_0xdf4e('0x51')]){_0x1afa69(_0x4bbc4d);}else{return db[_0xdf4e('0x56')][_0xdf4e('0x62')]({'where':{'sectionId':_0x1688de['id']},'raw':!![]})[_0xdf4e('0x28')](function(_0x4978de){_0x4978de?_0x1afa69(_0x4bbc4d):_0x1afa69();});}}catch(_0x8d8ca2){_0x7f8b4c(_0x8d8ca2);}});}function getCustomDashboards(_0x73356b){var _0x5799c5=[];return new BPromise(function(_0x4d646d,_0x16a1e6){try{if(_0x73356b[_0xdf4e('0x51')]){return db[_0xdf4e('0x63')]['findAll']({'raw':!![]})['then'](function(_0x1db745){_0x1db745[_0xdf4e('0x64')](function(_0x4cac76){_0x5799c5[_0xdf4e('0x5a')](_0x4cac76['id']+0x1869f);});_0x4d646d(_0x5799c5);});}else{return db[_0xdf4e('0x56')]['findAll']({'where':{'sectionId':_0x73356b['id']},'raw':!![]})[_0xdf4e('0x28')](function(_0x335a52){_0x335a52['forEach'](function(_0x326749){_0x5799c5[_0xdf4e('0x5a')](_0x326749[_0xdf4e('0x65')]+0x1869f);});_0x4d646d(_0x5799c5);});}}catch(_0x30fca5){_0x16a1e6(_0x30fca5);}});}function getPlugins(_0x19b669){var _0x46daf2=[];return new BPromise(function(_0x45ecc3,_0x22daee){try{if(_0x19b669['autoAssociation']){return db['Plugin'][_0xdf4e('0x41')]({'raw':!![]})[_0xdf4e('0x28')](function(_0x3a6057){_0x3a6057['forEach'](function(_0x460670){_0x46daf2['push'](_0x460670['id']+0x15b38);});_0x45ecc3(_0x46daf2);});}else{return db[_0xdf4e('0x56')][_0xdf4e('0x41')]({'where':{'sectionId':_0x19b669['id']},'raw':!![]})[_0xdf4e('0x28')](function(_0x1937f5){_0x1937f5[_0xdf4e('0x64')](function(_0x4877c7){_0x46daf2['push'](_0x4877c7[_0xdf4e('0x65')]+0x15b38);});_0x45ecc3(_0x46daf2);});}}catch(_0x478035){_0x22daee(_0x478035);}});}exports[_0xdf4e('0x66')]=function(_0x27333d,_0x145b31){return db[_0xdf4e('0x2e')][_0xdf4e('0x48')]({'where':{'id':_0x27333d['params']['id']}})[_0xdf4e('0x28')](handleEntityNotFound(_0x145b31,null))['then'](function(_0x43716a){if(_0x43716a){return db[_0xdf4e('0x58')]['transaction'](function(_0x224e25){return db[_0xdf4e('0x55')][_0xdf4e('0x41')]({'where':{'userProfileId':_0x27333d['params']['id']},'attributes':['id'],'raw':!![]})[_0xdf4e('0x28')](function(_0x13bd64){if(_0x13bd64){return db[_0xdf4e('0x55')]['destroy']({'where':{'userProfileId':_0x27333d[_0xdf4e('0x45')]['id'],'id':_[_0xdf4e('0x2d')](_0x13bd64,function(_0x282ac4){return _0x282ac4['id'];})},'transaction':_0x224e25});}})['then'](function(_0x273c3a){var _0x2ec8a1=_['map'](_0x27333d[_0xdf4e('0x4f')],function(_0x1fc67f){_0x1fc67f[_0xdf4e('0x53')]=_0x27333d[_0xdf4e('0x45')]['id'];return _0x1fc67f;});return db['UserProfileSection'][_0xdf4e('0x67')](_0x2ec8a1,{'raw':!![],'transaction':_0x224e25});})['then'](function(_0x175e1c){var _0x4b1107=_[_0xdf4e('0x3c')](_['map'](_0x175e1c,function(_0x41b6d9){return _0x41b6d9[_0xdf4e('0x4a')]({'plain':!![]});}),{'includeAll':![]});if(_0x4b1107){return db[_0xdf4e('0x55')][_0xdf4e('0x41')]({'where':{'userProfileId':_0x27333d[_0xdf4e('0x45')]['id'],'sectionId':_[_0xdf4e('0x2d')](_0x4b1107,function(_0x4f3918){return _0x4f3918[_0xdf4e('0x52')];})},'attributes':['id','sectionId'],'raw':!![]})['then'](function(_0x4c8330){var _0x22a72c=_[_0xdf4e('0x2d')](_0x27333d[_0xdf4e('0x4f')],function(_0x2e0f45){_0x2e0f45[_0xdf4e('0x53')]=_0x27333d[_0xdf4e('0x45')]['id'];return _0x2e0f45;});return db[_0xdf4e('0x56')]['bulkCreate'](_0x22a72c,{'raw':!![],'transaction':_0x224e25});});}})[_0xdf4e('0x43')](handleError(_0x145b31,null));});}})[_0xdf4e('0x28')](function(_0x191565){var _0x4ade05=_[_0xdf4e('0x2d')](_0x191565,function(_0x10b13f){return _0x10b13f['get']({'plain':!![]});});})[_0xdf4e('0x28')](respondWithResult(_0x145b31,null))[_0xdf4e('0x43')](handleError(_0x145b31,null));};exports[_0xdf4e('0x68')]=function(_0x107b7d,_0x15a5d1,_0x4afa33){return db['UserProfile'][_0xdf4e('0x48')]({'where':{'id':_0x107b7d[_0xdf4e('0x45')]['id']}})[_0xdf4e('0x28')](handleEntityNotFound(_0x15a5d1,null))[_0xdf4e('0x28')](function(_0x20e33f){if(_0x20e33f){return _0x20e33f[_0xdf4e('0x68')](_0x107b7d[_0xdf4e('0x33')][_0xdf4e('0x5c')]);}})[_0xdf4e('0x28')](respondWithStatusCode(_0x15a5d1,null))[_0xdf4e('0x43')](handleError(_0x15a5d1,null));};exports[_0xdf4e('0x69')]=function(_0xc111f4,_0x5bb6ad){var _0x4305d0={};if(!_0xc111f4['query']['section'])throw new Error('Missing\x20section\x20parameter');if(!_0xc111f4['query'][_0xdf4e('0x39')]('nolimit')){_0x4305d0[_0xdf4e('0x1f')]=qs[_0xdf4e('0x1f')](_0xc111f4['query'][_0xdf4e('0x1f')]);_0x4305d0['offset']=qs[_0xdf4e('0x1d')](_0xc111f4[_0xdf4e('0x33')][_0xdf4e('0x1d')]);}return db['UserProfile'][_0xdf4e('0x48')]({'where':{'id':_0xc111f4[_0xdf4e('0x45')]['id']}})[_0xdf4e('0x28')](function(_0x59d6cd){if(!_0x59d6cd)throw new Error(_0xdf4e('0x6a')+_0xc111f4[_0xdf4e('0x45')]['id']);return db['UserProfile'][_0xdf4e('0x69')](_0xc111f4);})[_0xdf4e('0x28')](respondWithFilteredResult(_0x5bb6ad,_0x4305d0))[_0xdf4e('0x43')](handleError(_0x5bb6ad,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 42a0e66..a36408b 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 _0x47c5=['setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserProfile'];(function(_0x458897,_0x4aac86){var _0xbc7b62=function(_0x50e2b1){while(--_0x50e2b1){_0x458897['push'](_0x458897['shift']());}};_0xbc7b62(++_0x4aac86);}(_0x47c5,0x165));var _0x547c=function(_0x17b1c0,_0x5f48f5){_0x17b1c0=_0x17b1c0-0x0;var _0x5b0ff5=_0x47c5[_0x17b1c0];return _0x5b0ff5;};'use strict';var EventEmitter=require(_0x547c('0x0'));var UserProfile=require(_0x547c('0x1'))['db'][_0x547c('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x547c('0x3')](0x0);var events={'afterCreate':_0x547c('0x4'),'afterUpdate':_0x547c('0x5'),'afterDestroy':'remove'};function emitEvent(_0xddb439){return function(_0x16f4db,_0x5b48c9,_0x3e827e){UserProfileEvents[_0x547c('0x6')](_0xddb439+':'+_0x16f4db['id'],_0x16f4db);UserProfileEvents['emit'](_0xddb439,_0x16f4db);_0x3e827e(null);};}for(var e in events){if(events[_0x547c('0x7')](e)){var event=events[e];UserProfile[_0x547c('0x8')](e,emitEvent(event));}}module[_0x547c('0x9')]=UserProfileEvents; \ No newline at end of file +var _0x5fab=['../../mysqldb','setMaxListeners','save','update','remove','emit','exports','events'];(function(_0x37f9ff,_0x2cab8a){var _0x53157d=function(_0x4748d0){while(--_0x4748d0){_0x37f9ff['push'](_0x37f9ff['shift']());}};_0x53157d(++_0x2cab8a);}(_0x5fab,0x177));var _0xb5fa=function(_0x37dc1d,_0xbf91ef){_0x37dc1d=_0x37dc1d-0x0;var _0x4ac931=_0x5fab[_0x37dc1d];return _0x4ac931;};'use strict';var EventEmitter=require(_0xb5fa('0x0'));var UserProfile=require(_0xb5fa('0x1'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xb5fa('0x2')](0x0);var events={'afterCreate':_0xb5fa('0x3'),'afterUpdate':_0xb5fa('0x4'),'afterDestroy':_0xb5fa('0x5')};function emitEvent(_0x67e8e8){return function(_0x595d8b,_0x29390a,_0x4341d3){UserProfileEvents[_0xb5fa('0x6')](_0x67e8e8+':'+_0x595d8b['id'],_0x595d8b);UserProfileEvents[_0xb5fa('0x6')](_0x67e8e8,_0x595d8b);_0x4341d3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0xb5fa('0x7')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 9a6ce45..fe93ef6 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 _0x9086=['mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','OpenchannelAccount','smsqueues','SmsAccount','whatsappqueues','whatsappaccounts','teams','Team','VoiceQueues','users','agents','telephones','Users','admin','Telephones','salesforceaccounts','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','dispositions','Disposition','customdashboards','intervals','Interval','pauses','Pause','scheduler','Schedule','sounds','Tag','Template','triggers','Trigger','Trunk','variables','Variable','plugins','Plugin','extractedreports','reportId','metrics','AnalyticMetric','toUpperCase','slice','Sequelize','SELECT','select','from','user_has_','_interactions','where','ui.UserId\x20=\x20?','query','OpenTabs','define','user_profiles','../../components/parsers/qs','raw','section','Invalid\x20section\x20\x27','isEmpty','length','push','find','all','ignore','union','autoAssociation','rawAttributes','keys','filters','intersection','fields','attributes','nolimit','limit','offset','order','sort','pick','merge','key','VIRTUAL','foreignKey','options','includeAll','include','default','custom','CustomReports','count','rows','ids','customSorting','extraQueryConditions','color','tag','openTabs','true','chat','dataValues','sms','fax','mail','openchannel','whatsapp','./userProfile.attributes','squel','exports','models','filter','field','value','findAll','then','associatedResources','map','catch','model','name','resolve','AnalyticExtractedReport','resourceId','type','toLowerCase','childModel','odbc','SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projectName','projects','JscriptyProject','CmContact','Lists','ListId','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','inboundroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','VoiceMail','voicerecordings','VoiceRecording','Agents','membername','User','role','telephone','VoiceQueue','inbound','QueueCampaigns','outbound','musiconholds','VoiceMusicOnHold','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign'];(function(_0x39217e,_0x9b12ee){var _0x542781=function(_0x5a8be8){while(--_0x5a8be8){_0x39217e['push'](_0x39217e['shift']());}};_0x542781(++_0x9b12ee);}(_0x9086,0x76));var _0x6908=function(_0x443b1e,_0xf7ffe9){_0x443b1e=_0x443b1e-0x0;var _0x3beb6f=_0x9086[_0x443b1e];return _0x3beb6f;};'use strict';var _=require('lodash');var attributes=require(_0x6908('0x0'));var squel=require(_0x6908('0x1'));module[_0x6908('0x2')]=function(_0x370f5d){var _0x702dc1=_0x370f5d[_0x6908('0x3')];function _0x18611a(_0x57787f,_0x55e869){return new Promise(function(_0x3d352c,_0x1aa67c){if(!_0x55e869)return _0x3d352c(null);var _0x587a34=_0x55e869[_0x6908('0x4')]?{[_0x55e869['filter'][_0x6908('0x5')]]:_0x55e869[_0x6908('0x4')][_0x6908('0x6')]}:undefined;return _0x702dc1[_0x57787f][_0x6908('0x7')]({'where':_0x587a34,'raw':!![]})[_0x6908('0x8')](function(_0x548f44){_0x55e869[_0x6908('0x9')]=_[_0x6908('0xa')](_0x548f44,'id');_0x3d352c(_0x55e869);})[_0x6908('0xb')](function(_0x4981f0){_0x1aa67c(_0x4981f0);});});}function _0x5c8ddc(_0x482ba9,_0x5cded1){return new Promise(function(_0x2aeb9c,_0x2de2a1){var _0x51d481=_0x482ba9[_0x6908('0x4')]?{[_0x482ba9[_0x6908('0x4')]['field']]:_0x482ba9[_0x6908('0x4')][_0x6908('0x6')]}:undefined;return _0x702dc1[_0x482ba9[_0x6908('0xc')]][_0x6908('0x7')]({'where':_0x51d481,'raw':!![]})[_0x6908('0x8')](function(_0x424693){_0x5cded1[_0x6908('0x9')]=_[_0x6908('0xa')](_0x424693,function(_0x15c48e){return _0x15c48e[_0x6908('0xd')];});_0x2aeb9c(_0x5cded1);})[_0x6908('0xb')](function(_0x261556){_0x2de2a1(_0x261556);});});}function _0x37c1d8(_0x137221,_0x5938b4,_0x4ef619){if(!_0x5938b4)return Promise[_0x6908('0xe')](null);return new Promise(function(_0x5b7bbb,_0x614774){return _0x702dc1['UserProfileResource'][_0x6908('0x7')]({'where':{'sectionId':_0x5938b4['id']},'raw':!![]})['then'](function(_0x43986b){if(_0x137221['field']&&_0x137221['field']!=='id'){_0x5938b4[_0x6908('0x9')]=_[_0x6908('0xa')](_0x43986b,function(_0x5066dd){return _0x5066dd[_0x137221[_0x6908('0x5')]];});}else{if(_0x4ef619===_0x6908('0xf')){_0x5938b4[_0x6908('0x9')]=_['map'](_0x43986b,function(_0x2d12f3){return{'id':_0x2d12f3[_0x6908('0x10')],'type':_0x2d12f3[_0x6908('0x11')]};});}else{_0x5938b4[_0x6908('0x9')]=_[_0x6908('0xa')](_0x43986b,function(_0x1201d2){return _0x1201d2[_0x6908('0x10')];});}}_0x5b7bbb(_0x5938b4);})[_0x6908('0xb')](function(_0x4b55d6){_0x614774(_0x4b55d6);});});}function _0x45a3b1(_0x4bfcf5,_0x1ef92c){var _0x14b74b={'parentSections':[]};switch(_0x4bfcf5[_0x6908('0x12')]()){case'squareprojects':_0x14b74b[_0x6908('0x13')]='SquareProject';break;case _0x6908('0x14'):_0x14b74b['childModel']=_0x6908('0x15');break;case _0x6908('0x16'):_0x14b74b['childModel']=_0x6908('0x17');_0x14b74b[_0x6908('0x18')]=[{'name':_0x6908('0x19'),'field':_0x6908('0xd'),'foreignKey':_0x6908('0x1a')}];break;case _0x6908('0x1b'):_0x14b74b[_0x6908('0x13')]=_0x6908('0x1c');break;case'contacts':_0x14b74b[_0x6908('0x13')]=_0x6908('0x1d');_0x14b74b[_0x6908('0x18')]=[{'name':_0x6908('0x1e'),'field':'id','foreignKey':_0x6908('0x1f')}];break;case _0x6908('0x20'):_0x14b74b[_0x6908('0x13')]=_0x6908('0x21');break;case _0x6908('0x22'):_0x14b74b[_0x6908('0x13')]=_0x6908('0x23');break;case _0x6908('0x24'):_0x14b74b['childModel']=_0x6908('0x25');break;case _0x6908('0x26'):_0x14b74b[_0x6908('0x13')]=_0x6908('0x27');break;case _0x6908('0x28'):_0x14b74b['childModel']=_0x6908('0x29');break;case _0x6908('0x2a'):_0x14b74b['childModel']=_0x6908('0x2b');break;case'faxaccounts':_0x14b74b[_0x6908('0x13')]='FaxAccount';break;case _0x6908('0x2c'):case'internalroutes':case _0x6908('0x2d'):_0x14b74b[_0x6908('0x13')]=_0x6908('0x2e');break;case _0x6908('0x2f'):_0x14b74b[_0x6908('0x13')]=_0x6908('0x30');break;case'voicemails':_0x14b74b[_0x6908('0x13')]=_0x6908('0x31');break;case _0x6908('0x32'):_0x14b74b[_0x6908('0x13')]=_0x6908('0x33');_0x14b74b[_0x6908('0x18')]=[{'name':_0x6908('0x34'),'field':_0x6908('0xd'),'foreignKey':_0x6908('0x35'),'model':_0x6908('0x36'),'filter':{'field':_0x6908('0x37'),'value':['agent']}},{'name':'Telephones','field':_0x6908('0xd'),'foreignKey':_0x6908('0x35'),'model':_0x6908('0x36'),'filter':{'field':_0x6908('0x37'),'value':[_0x6908('0x38')]}},{'name':'VoiceQueues','field':_0x6908('0xd'),'foreignKey':'queue','model':_0x6908('0x39'),'filter':{'field':'type','value':[_0x6908('0x3a')]}},{'name':_0x6908('0x3b'),'field':_0x6908('0xd'),'foreignKey':'queue','model':_0x6908('0x39'),'filter':{'field':_0x6908('0x11'),'value':[_0x6908('0x3c')]}}];break;case _0x6908('0x3d'):_0x14b74b[_0x6908('0x13')]=_0x6908('0x3e');break;case'chanspies':_0x14b74b['childModel']=_0x6908('0x3f');break;case _0x6908('0x40'):_0x14b74b['childModel']=_0x6908('0x41');break;case _0x6908('0x42'):_0x14b74b[_0x6908('0x13')]=_0x6908('0x43');break;case _0x6908('0x44'):_0x14b74b[_0x6908('0x13')]=_0x6908('0x45');break;case _0x6908('0x46'):_0x14b74b[_0x6908('0x13')]=_0x6908('0x47');break;case _0x6908('0x48'):_0x14b74b[_0x6908('0x13')]=_0x6908('0x49');break;case _0x6908('0x4a'):_0x14b74b[_0x6908('0x13')]=_0x6908('0x4b');break;case'openchannelaccounts':_0x14b74b[_0x6908('0x13')]=_0x6908('0x4c');break;case _0x6908('0x4d'):_0x14b74b[_0x6908('0x13')]='SmsQueue';break;case'smsaccounts':_0x14b74b[_0x6908('0x13')]=_0x6908('0x4e');break;case _0x6908('0x4f'):_0x14b74b[_0x6908('0x13')]='WhatsappQueue';break;case _0x6908('0x50'):_0x14b74b['childModel']='WhatsappAccount';break;case _0x6908('0x51'):_0x14b74b[_0x6908('0x13')]=_0x6908('0x52');break;case'voicequeues':case'queuecampaigns':_0x14b74b[_0x6908('0x13')]=_0x6908('0x39');if(_0x1ef92c){_0x14b74b[_0x6908('0x18')]=[{'name':_0x6908('0x53')},{'name':_0x6908('0x3b')}];}break;case _0x6908('0x54'):case _0x6908('0x55'):case _0x6908('0x56'):_0x14b74b[_0x6908('0x13')]='User';if(_0x1ef92c){_0x14b74b[_0x6908('0x18')]=[{'name':_0x6908('0x57'),'filter':{'field':'role','value':[_0x6908('0x58'),'user']},'ignore':!![]},{'name':_0x6908('0x34')},{'name':_0x6908('0x59')}];}break;case'zendeskaccounts':_0x14b74b[_0x6908('0x13')]='ZendeskAccount';break;case _0x6908('0x5a'):_0x14b74b[_0x6908('0x13')]='SalesforceAccount';break;case _0x6908('0x5b'):_0x14b74b[_0x6908('0x13')]=_0x6908('0x5c');break;case _0x6908('0x5d'):_0x14b74b[_0x6908('0x13')]=_0x6908('0x5e');break;case'deskaccounts':_0x14b74b[_0x6908('0x13')]=_0x6908('0x5f');break;case _0x6908('0x60'):_0x14b74b['childModel']=_0x6908('0x61');break;case _0x6908('0x62'):_0x14b74b['childModel']=_0x6908('0x36');break;case'cannedanswers':_0x14b74b[_0x6908('0x13')]='CannedAnswer';break;case _0x6908('0x63'):_0x14b74b[_0x6908('0x13')]=_0x6908('0x64');break;case _0x6908('0x65'):_0x14b74b[_0x6908('0x13')]='Dashboard';break;case _0x6908('0x66'):_0x14b74b[_0x6908('0x13')]=_0x6908('0x67');break;case _0x6908('0x68'):_0x14b74b[_0x6908('0x13')]=_0x6908('0x69');break;case _0x6908('0x6a'):_0x14b74b[_0x6908('0x13')]=_0x6908('0x6b');break;case _0x6908('0x6c'):_0x14b74b[_0x6908('0x13')]='Sound';break;case'tags':_0x14b74b[_0x6908('0x13')]=_0x6908('0x6d');break;case'templates':_0x14b74b[_0x6908('0x13')]=_0x6908('0x6e');break;case _0x6908('0x6f'):_0x14b74b[_0x6908('0x13')]=_0x6908('0x70');break;case'trunks':_0x14b74b[_0x6908('0x13')]=_0x6908('0x71');break;case _0x6908('0x72'):_0x14b74b[_0x6908('0x13')]=_0x6908('0x73');break;case _0x6908('0x74'):_0x14b74b[_0x6908('0x13')]=_0x6908('0x75');break;case _0x6908('0x76'):_0x14b74b[_0x6908('0x13')]='AnalyticExtractedReport';_0x14b74b[_0x6908('0x18')]=[{'name':'Reports','field':'id','foreignKey':_0x6908('0x77')}];break;case _0x6908('0x78'):_0x14b74b[_0x6908('0x13')]=_0x6908('0x79');break;}return _0x14b74b;}function _0x3a79dd(_0x13a556,_0x866ce4){var _0x465818=_0x13a556['charAt'](0x0)[_0x6908('0x7a')]()+_0x13a556[_0x6908('0x7b')](0x1);var _0x1bf9cc={'type':_0x702dc1[_0x6908('0x7c')]['QueryTypes'][_0x6908('0x7d')],'raw':!![]};return new Promise(function(_0x1bffb3,_0x10f284){var _0x2e4d11=squel[_0x6908('0x7e')]()['field']('ui.'+_0x465818+'InteractionId','id')[_0x6908('0x5')]('ui.createdAt')[_0x6908('0x7f')](_0x6908('0x80')+_0x13a556+_0x6908('0x81'),'ui')[_0x6908('0x82')](_0x6908('0x83'),_0x866ce4['id']);return _0x702dc1['sequelize'][_0x6908('0x84')](_0x2e4d11['toString'](),_0x1bf9cc)[_0x6908('0x8')](function(_0x2b0577){_0x866ce4[_0x465818+_0x6908('0x85')]=_0x2b0577;_0x1bffb3(_0x2b0577);})[_0x6908('0xb')](function(_0xae0d01){_0x10f284(_0xae0d01);});});}return _0x370f5d[_0x6908('0x86')]('UserProfile',attributes,{'tableName':_0x6908('0x87'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x42ce31){var _0x3f0d7f=require(_0x6908('0x88'));var _0x40ed1f={'raw':_0x42ce31['query'][_0x6908('0x89')],'where':{}};var _0x5edb10={};var _0x50de5b={'count':0x0,'rows':[]};var _0x18ce58=_0x42ce31[_0x6908('0x84')][_0x6908('0x8a')];var _0x4283f2=_0x42ce31['query']['mergeResources']||![];var _0x212a12=_0x45a3b1(_0x18ce58,_0x4283f2);if(!_0x212a12[_0x6908('0x13')])throw new Error(_0x6908('0x8b')+_0x18ce58+'\x27');var _0x46b4c0=[{'name':_0x18ce58}];if(!_[_0x6908('0x8c')](_0x212a12[_0x6908('0x18')]))_0x46b4c0=_0x212a12[_0x6908('0x18')];var _0x798bcc=[];for(var _0x19e65f=0x0;_0x19e65f<_0x46b4c0[_0x6908('0x8d')];_0x19e65f++){_0x798bcc[_0x6908('0x8e')](_0x702dc1['UserProfileSection'][_0x6908('0x8f')]({'where':{'userProfileId':_0x42ce31['params']['id'],'name':_0x46b4c0[_0x19e65f][_0x6908('0xd')]},'raw':!![]}));}return Promise[_0x6908('0x90')](_0x798bcc)[_0x6908('0x8')](function(_0x2a54f0){var _0x14e2ff=_[_0x6908('0x4')](_0x2a54f0,function(_0x3ce8d2){return _0x3ce8d2?_0x3ce8d2:undefined;});var _0x185f12=_['filter'](_0x46b4c0,[_0x6908('0x91'),!![]]);var _0x28e8a6=_['isEmpty'](_0x14e2ff)&&_['isEmpty'](_0x185f12)?null:_[_0x6908('0x92')](_0x185f12,_0x14e2ff);if(!_0x28e8a6)return null;var _0x565545=[];for(var _0x5dd222=0x0;_0x5dd222<_0x28e8a6[_0x6908('0x8d')];_0x5dd222++){var _0x1dd457=_[_0x6908('0x8f')](_0x46b4c0,function(_0x4a774e){return _0x28e8a6[_0x5dd222]?_0x4a774e['name']===_0x28e8a6[_0x5dd222]['name']:null;});if(_0x1dd457){if(_0x28e8a6[_0x5dd222][_0x6908('0x91')]){_0x565545[_0x6908('0x8e')](_0x18611a(_0x212a12[_0x6908('0x13')],_0x28e8a6[_0x5dd222]));}else{if(!_0x28e8a6[_0x5dd222][_0x6908('0x93')]){_0x565545[_0x6908('0x8e')](_0x37c1d8(_0x1dd457,_0x28e8a6[_0x5dd222],_0x212a12[_0x6908('0x13')]));}else{if(_0x1dd457[_0x6908('0xc')]){_0x565545[_0x6908('0x8e')](_0x5c8ddc(_0x1dd457,_0x28e8a6[_0x5dd222]));}}}}}return Promise[_0x6908('0x90')](_0x565545);})[_0x6908('0x8')](function(_0x561119){var _0x3d0c4c=_0x561119;var _0x1689ae=null;if(_0x3d0c4c){_0x1689ae=_0x3d0c4c[_0x6908('0x8d')]===0x1?_0x3d0c4c[0x0]:null;}if(!_0x1689ae&&!_0x3d0c4c)return _0x50de5b;var _0x21176e=_0x702dc1[_0x212a12[_0x6908('0x13')]][_0x6908('0x94')];_0x5edb10[_0x6908('0xc')]=_[_0x6908('0x95')](_0x21176e);_0x5edb10[_0x6908('0x84')]=_[_0x6908('0x95')](_0x42ce31[_0x6908('0x84')]);_0x5edb10[_0x6908('0x96')]=_[_0x6908('0x97')](_0x5edb10[_0x6908('0xc')],_0x5edb10[_0x6908('0x84')]);_0x40ed1f['attributes']=_[_0x6908('0x97')](_0x5edb10[_0x6908('0xc')],_0x3f0d7f[_0x6908('0x98')](_0x42ce31[_0x6908('0x84')][_0x6908('0x98')]));_0x40ed1f[_0x6908('0x99')]=_0x40ed1f['attributes']['length']?_0x40ed1f[_0x6908('0x99')]:_0x5edb10[_0x6908('0xc')];if(!_0x42ce31[_0x6908('0x84')]['hasOwnProperty'](_0x6908('0x9a'))){_0x40ed1f[_0x6908('0x9b')]=_0x3f0d7f[_0x6908('0x9b')](_0x42ce31['query'][_0x6908('0x9b')]);_0x40ed1f[_0x6908('0x9c')]=_0x3f0d7f[_0x6908('0x9c')](_0x42ce31[_0x6908('0x84')]['offset']);}_0x40ed1f[_0x6908('0x9d')]=_0x3f0d7f[_0x6908('0x9e')](_0x42ce31[_0x6908('0x84')]['sort']);_0x40ed1f[_0x6908('0x82')]=_0x3f0d7f[_0x6908('0x96')](_[_0x6908('0x9f')](_0x42ce31['query'],_0x5edb10[_0x6908('0x96')]));if(_0x42ce31[_0x6908('0x84')][_0x6908('0x4')]){_0x40ed1f[_0x6908('0x82')]=_[_0x6908('0xa0')](_0x40ed1f[_0x6908('0x82')],{'$or':_['map'](_0x21176e,function(_0xc54d35){if(_0xc54d35[_0x6908('0x11')][_0x6908('0xa1')]!==_0x6908('0xa2')){var _0x58881b={};_0x58881b[_0xc54d35[_0x6908('0x5')]]={'$like':'%'+_0x42ce31[_0x6908('0x84')]['filter']+'%'};return _0x58881b;}})});}var _0x5ee11b=[];var _0x4aae01=null;var _0x4bbb16={};if(_0x1689ae){_0x4aae01=_[_0x6908('0x8f')](_0x46b4c0,[_0x6908('0xd'),_0x1689ae['name']]);if(_0x4aae01['field']){_0x4bbb16={};if(_0x212a12[_0x6908('0x13')]===_0x6908('0xf')){_0x4bbb16[_0x4aae01[_0x6908('0xa3')]]=_['map'](_0x1689ae['associatedResources'],'id');}else{_0x4bbb16[_0x4aae01['foreignKey']]=_0x1689ae['associatedResources'];}_0x5ee11b['push'](_0x4bbb16);}else{_0x40ed1f[_0x6908('0x82')]['id']=_0x1689ae[_0x6908('0x9')];}}else{for(var _0x29fbfe=0x0;_0x29fbfe<_0x3d0c4c['length'];_0x29fbfe++){_0x4aae01=_[_0x6908('0x8f')](_0x46b4c0,[_0x6908('0xd'),_0x3d0c4c[_0x29fbfe][_0x6908('0xd')]]);if(_0x4aae01[_0x6908('0x5')]){_0x4bbb16={};_0x4bbb16[_0x4aae01[_0x6908('0xa3')]]=_0x3d0c4c[_0x29fbfe]['associatedResources'];_0x5ee11b[_0x6908('0x8e')](_0x4bbb16);}else{if(!_0x40ed1f[_0x6908('0x82')]['id'])_0x40ed1f[_0x6908('0x82')]['id']=[];_0x3d0c4c[_0x29fbfe][_0x6908('0x9')]['forEach'](function(_0x24b452){_0x40ed1f['where']['id'][_0x6908('0x8e')](_0x24b452);});}}}if(!_[_0x6908('0x8c')](_0x5ee11b)){_0x40ed1f['where']=_[_0x6908('0xa0')](_0x40ed1f[_0x6908('0x82')],{'$and':{'$or':_0x5ee11b}});}_0x40ed1f=_['merge']({},_0x40ed1f,_0x42ce31[_0x6908('0xa4')]);if(_0x1689ae&&!_0x1689ae[_0x6908('0x93')]&&_0x212a12['childModel']===_0x6908('0xf')){if(_0x42ce31[_0x6908('0x84')][_0x6908('0xa5')]){_0x40ed1f[_0x6908('0xa6')]=[{'all':!![]}];}return _0x702dc1[_0x212a12[_0x6908('0x13')]]['findAll'](_0x40ed1f)[_0x6908('0x8')](function(_0x33fcca){var _0x3f7a33=[];_0x33fcca['forEach'](function(_0x1f13ce){var _0x4bf3ec;switch(_0x1f13ce['reportType']){case _0x6908('0xa7'):_0x4bf3ec=_[_0x6908('0x8f')](_0x1689ae[_0x6908('0x9')],function(_0x5df349){return _0x5df349['id']===_0x1f13ce[_0x6908('0x77')]&&_0x5df349[_0x6908('0x11')]==='DefaultReports';});break;case _0x6908('0xa8'):_0x4bf3ec=_[_0x6908('0x8f')](_0x1689ae[_0x6908('0x9')],function(_0x3c7c79){return _0x3c7c79['id']===_0x1f13ce[_0x6908('0x77')]&&_0x3c7c79['type']===_0x6908('0xa9');});break;}if(_0x4bf3ec)_0x3f7a33[_0x6908('0x8e')](_0x1f13ce);});_0x50de5b[_0x6908('0xaa')]=_0x3f7a33[_0x6908('0x8d')];_0x50de5b[_0x6908('0xab')]=_0x3f7a33;return _0x50de5b;});}else{if(!_[_0x6908('0x8c')](_0x42ce31[_0x6908('0x84')][_0x6908('0xac')])){_0x40ed1f['where']['id']=_0x40ed1f[_0x6908('0x82')]['id']?_['intersection'](_0x40ed1f[_0x6908('0x82')]['id'],_0x42ce31[_0x6908('0x84')][_0x6908('0xac')]):_0x42ce31['query'][_0x6908('0xac')];if(_0x42ce31[_0x6908('0x84')]['customSorting']){_0x40ed1f[_0x6908('0x9d')]=_0x42ce31[_0x6908('0x84')][_0x6908('0xad')];}}if(_0x42ce31[_0x6908('0x84')][_0x6908('0xae')]){_0x40ed1f[_0x6908('0x82')]=_['merge'](_0x40ed1f[_0x6908('0x82')],{'$and':_0x42ce31[_0x6908('0x84')][_0x6908('0xae')]});}return _0x702dc1[_0x212a12[_0x6908('0x13')]][_0x6908('0xaa')]({'where':_0x40ed1f[_0x6908('0x82')]})['then'](function(_0x28b95e){_0x50de5b[_0x6908('0xaa')]=_0x28b95e;if(_0x42ce31[_0x6908('0x84')][_0x6908('0xa5')]){if(_0x212a12[_0x6908('0x13')]===_0x6908('0x1d')){_0x40ed1f['include']=[{'model':_0x702dc1[_0x6908('0x6d')],'as':'Tags','attributes':['id',_0x6908('0xd'),_0x6908('0xaf')],'required':_0x42ce31['query']['tag']?!![]:![]},{'model':_0x702dc1[_0x6908('0x6d')],'as':'ThroughTags','attributes':['id',_0x6908('0xd'),_0x6908('0xaf')],'through':_0x42ce31['query'][_0x6908('0xb0')]?{'attributes':[],'where':{'TagId':_0x42ce31[_0x6908('0x84')][_0x6908('0xb0')]||undefined}}:{},'required':_0x42ce31['query'][_0x6908('0xb0')]?!![]:![]}];}else{_0x40ed1f[_0x6908('0xa6')]=[{'all':!![]}];}}return _0x702dc1[_0x212a12[_0x6908('0x13')]][_0x6908('0x7')](_0x40ed1f);})['then'](function(_0x1308df){_0x50de5b['rows']=_0x1308df;if(_0x18ce58===_0x6908('0x34')&&_0x42ce31[_0x6908('0x84')][_0x6908('0xb1')]===_0x6908('0xb2')){var _0xcdbe2=[];for(var _0x5d5154=0x0;_0x5d5154<_0x50de5b[_0x6908('0xab')][_0x6908('0x8d')];_0x5d5154++){_0xcdbe2[_0x6908('0x8e')](_0x3a79dd(_0x6908('0xb3'),_0x50de5b[_0x6908('0xab')][_0x5d5154][_0x6908('0xb4')]));_0xcdbe2[_0x6908('0x8e')](_0x3a79dd(_0x6908('0xb5'),_0x50de5b[_0x6908('0xab')][_0x5d5154][_0x6908('0xb4')]));_0xcdbe2[_0x6908('0x8e')](_0x3a79dd(_0x6908('0xb6'),_0x50de5b[_0x6908('0xab')][_0x5d5154][_0x6908('0xb4')]));_0xcdbe2[_0x6908('0x8e')](_0x3a79dd(_0x6908('0xb7'),_0x50de5b[_0x6908('0xab')][_0x5d5154][_0x6908('0xb4')]));_0xcdbe2[_0x6908('0x8e')](_0x3a79dd(_0x6908('0xb8'),_0x50de5b[_0x6908('0xab')][_0x5d5154][_0x6908('0xb4')]));_0xcdbe2[_0x6908('0x8e')](_0x3a79dd(_0x6908('0xb9'),_0x50de5b['rows'][_0x5d5154][_0x6908('0xb4')]));}return Promise['all'](_0xcdbe2)[_0x6908('0x8')](function(){return _0x50de5b;});}return _0x50de5b;});}});}}});}; \ No newline at end of file +var _0x7667=['Trunk','variables','Variable','plugins','Plugin','extractedreports','Reports','metrics','toUpperCase','slice','Sequelize','QueryTypes','ui.','ui.createdAt','user_has_','_interactions','where','ui.UserId\x20=\x20?','sequelize','query','toString','OpenTabs','define','UserProfile','user_profiles','../../components/parsers/qs','mergeResources','isEmpty','push','UserProfileSection','find','params','all','ignore','union','length','autoAssociation','rawAttributes','keys','filters','attributes','intersection','fields','hasOwnProperty','limit','offset','order','pick','merge','key','VIRTUAL','foreignKey','forEach','options','include','reportType','default','reportId','DefaultReports','custom','CustomReports','count','rows','ids','customSorting','extraQueryConditions','includeAll','CmContact','Tags','color','tag','ThroughTags','true','chat','dataValues','fax','whatsapp','./userProfile.attributes','squel','exports','models','field','filter','value','findAll','then','associatedResources','map','catch','model','name','AnalyticExtractedReport','resourceId','type','toLowerCase','squareprojects','childModel','SquareProject','squarerecordings','SquareProjects','projectName','projects','JscriptyProject','parentSections','Lists','ListId','CmList','companies','CmCompany','globalcustomfields','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','membername','User','role','agent','Telephones','telephone','queue','VoiceQueue','inbound','QueueCampaigns','outbound','musiconholds','VoiceMusicOnHold','chanspies','ivrcampaigns','Campaign','mailqueues','MailQueue','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','WhatsappQueue','teams','Team','voicequeues','queuecampaigns','VoiceQueues','telephones','admin','user','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','intervals','Interval','pauses','Pause','scheduler','Schedule','sounds','Sound','tags','Tag','templates','triggers','Trigger','trunks'];(function(_0x42163d,_0x3c8d23){var _0x5c79e0=function(_0x2c9127){while(--_0x2c9127){_0x42163d['push'](_0x42163d['shift']());}};_0x5c79e0(++_0x3c8d23);}(_0x7667,0x112));var _0x7766=function(_0x11e25a,_0x22fa00){_0x11e25a=_0x11e25a-0x0;var _0x376f1e=_0x7667[_0x11e25a];return _0x376f1e;};'use strict';var _=require('lodash');var attributes=require(_0x7766('0x0'));var squel=require(_0x7766('0x1'));module[_0x7766('0x2')]=function(_0x588f1b){var _0x51ca5a=_0x588f1b[_0x7766('0x3')];function _0x443e35(_0x76c6a9,_0x45599c){return new Promise(function(_0x31000c,_0x3fbf9a){if(!_0x45599c)return _0x31000c(null);var _0xeae963=_0x45599c['filter']?{[_0x45599c['filter'][_0x7766('0x4')]]:_0x45599c[_0x7766('0x5')][_0x7766('0x6')]}:undefined;return _0x51ca5a[_0x76c6a9][_0x7766('0x7')]({'where':_0xeae963,'raw':!![]})[_0x7766('0x8')](function(_0x1e8ce5){_0x45599c[_0x7766('0x9')]=_[_0x7766('0xa')](_0x1e8ce5,'id');_0x31000c(_0x45599c);})[_0x7766('0xb')](function(_0x2a8105){_0x3fbf9a(_0x2a8105);});});}function _0x308314(_0x5ddff8,_0x8900ef){return new Promise(function(_0x52fcd9,_0x588a5e){var _0x69f00d=_0x5ddff8[_0x7766('0x5')]?{[_0x5ddff8[_0x7766('0x5')][_0x7766('0x4')]]:_0x5ddff8[_0x7766('0x5')][_0x7766('0x6')]}:undefined;return _0x51ca5a[_0x5ddff8[_0x7766('0xc')]][_0x7766('0x7')]({'where':_0x69f00d,'raw':!![]})['then'](function(_0x124fc0){_0x8900ef[_0x7766('0x9')]=_[_0x7766('0xa')](_0x124fc0,function(_0x35e560){return _0x35e560[_0x7766('0xd')];});_0x52fcd9(_0x8900ef);})[_0x7766('0xb')](function(_0x3ef912){_0x588a5e(_0x3ef912);});});}function _0x123ec0(_0x501e48,_0x290911,_0x1bdbf4){if(!_0x290911)return Promise['resolve'](null);return new Promise(function(_0x3dd0a5,_0x1e0e41){return _0x51ca5a['UserProfileResource']['findAll']({'where':{'sectionId':_0x290911['id']},'raw':!![]})['then'](function(_0x45f159){if(_0x501e48[_0x7766('0x4')]&&_0x501e48[_0x7766('0x4')]!=='id'){_0x290911['associatedResources']=_[_0x7766('0xa')](_0x45f159,function(_0xc35f94){return _0xc35f94[_0x501e48[_0x7766('0x4')]];});}else{if(_0x1bdbf4===_0x7766('0xe')){_0x290911[_0x7766('0x9')]=_['map'](_0x45f159,function(_0x1dfbbc){return{'id':_0x1dfbbc[_0x7766('0xf')],'type':_0x1dfbbc[_0x7766('0x10')]};});}else{_0x290911[_0x7766('0x9')]=_[_0x7766('0xa')](_0x45f159,function(_0x397a08){return _0x397a08[_0x7766('0xf')];});}}_0x3dd0a5(_0x290911);})[_0x7766('0xb')](function(_0x570b2b){_0x1e0e41(_0x570b2b);});});}function _0x4d8068(_0x4f6a4d,_0x517245){var _0x572c69={'parentSections':[]};switch(_0x4f6a4d[_0x7766('0x11')]()){case _0x7766('0x12'):_0x572c69[_0x7766('0x13')]=_0x7766('0x14');break;case'odbc':_0x572c69[_0x7766('0x13')]='SquareOdbc';break;case _0x7766('0x15'):_0x572c69[_0x7766('0x13')]='SquareRecording';_0x572c69['parentSections']=[{'name':_0x7766('0x16'),'field':_0x7766('0xd'),'foreignKey':_0x7766('0x17')}];break;case _0x7766('0x18'):_0x572c69['childModel']=_0x7766('0x19');break;case'contacts':_0x572c69[_0x7766('0x13')]='CmContact';_0x572c69[_0x7766('0x1a')]=[{'name':_0x7766('0x1b'),'field':'id','foreignKey':_0x7766('0x1c')}];break;case'lists':_0x572c69['childModel']=_0x7766('0x1d');break;case _0x7766('0x1e'):_0x572c69[_0x7766('0x13')]=_0x7766('0x1f');break;case _0x7766('0x20'):_0x572c69[_0x7766('0x13')]='CmCustomField';break;case _0x7766('0x21'):_0x572c69['childModel']=_0x7766('0x22');break;case _0x7766('0x23'):_0x572c69['childModel']=_0x7766('0x24');break;case _0x7766('0x25'):_0x572c69[_0x7766('0x13')]=_0x7766('0x26');break;case'faxaccounts':_0x572c69[_0x7766('0x13')]=_0x7766('0x27');break;case _0x7766('0x28'):case _0x7766('0x29'):case _0x7766('0x2a'):_0x572c69['childModel']=_0x7766('0x2b');break;case _0x7766('0x2c'):_0x572c69['childModel']=_0x7766('0x2d');break;case _0x7766('0x2e'):_0x572c69[_0x7766('0x13')]=_0x7766('0x2f');break;case _0x7766('0x30'):_0x572c69[_0x7766('0x13')]=_0x7766('0x31');_0x572c69['parentSections']=[{'name':_0x7766('0x32'),'field':_0x7766('0xd'),'foreignKey':_0x7766('0x33'),'model':_0x7766('0x34'),'filter':{'field':_0x7766('0x35'),'value':[_0x7766('0x36')]}},{'name':_0x7766('0x37'),'field':_0x7766('0xd'),'foreignKey':'membername','model':_0x7766('0x34'),'filter':{'field':_0x7766('0x35'),'value':[_0x7766('0x38')]}},{'name':'VoiceQueues','field':_0x7766('0xd'),'foreignKey':_0x7766('0x39'),'model':_0x7766('0x3a'),'filter':{'field':_0x7766('0x10'),'value':[_0x7766('0x3b')]}},{'name':_0x7766('0x3c'),'field':_0x7766('0xd'),'foreignKey':_0x7766('0x39'),'model':_0x7766('0x3a'),'filter':{'field':'type','value':[_0x7766('0x3d')]}}];break;case _0x7766('0x3e'):_0x572c69[_0x7766('0x13')]=_0x7766('0x3f');break;case _0x7766('0x40'):_0x572c69[_0x7766('0x13')]='VoiceChanSpy';break;case'voiceprefixes':_0x572c69[_0x7766('0x13')]='VoicePrefix';break;case _0x7766('0x41'):_0x572c69[_0x7766('0x13')]=_0x7766('0x42');break;case _0x7766('0x43'):_0x572c69[_0x7766('0x13')]=_0x7766('0x44');break;case'mailaccounts':_0x572c69['childModel']=_0x7766('0x45');break;case _0x7766('0x46'):_0x572c69['childModel']=_0x7766('0x47');break;case _0x7766('0x48'):_0x572c69['childModel']=_0x7766('0x49');break;case _0x7766('0x4a'):_0x572c69[_0x7766('0x13')]=_0x7766('0x4b');break;case _0x7766('0x4c'):_0x572c69[_0x7766('0x13')]=_0x7766('0x4d');break;case _0x7766('0x4e'):_0x572c69[_0x7766('0x13')]=_0x7766('0x4f');break;case'whatsappqueues':_0x572c69['childModel']=_0x7766('0x50');break;case'whatsappaccounts':_0x572c69[_0x7766('0x13')]='WhatsappAccount';break;case _0x7766('0x51'):_0x572c69[_0x7766('0x13')]=_0x7766('0x52');break;case _0x7766('0x53'):case _0x7766('0x54'):_0x572c69[_0x7766('0x13')]=_0x7766('0x3a');if(_0x517245){_0x572c69[_0x7766('0x1a')]=[{'name':_0x7766('0x55')},{'name':_0x7766('0x3c')}];}break;case'users':case'agents':case _0x7766('0x56'):_0x572c69[_0x7766('0x13')]=_0x7766('0x34');if(_0x517245){_0x572c69[_0x7766('0x1a')]=[{'name':'Users','filter':{'field':_0x7766('0x35'),'value':[_0x7766('0x57'),_0x7766('0x58')]},'ignore':!![]},{'name':_0x7766('0x32')},{'name':_0x7766('0x37')}];}break;case'zendeskaccounts':_0x572c69['childModel']='ZendeskAccount';break;case _0x7766('0x59'):_0x572c69['childModel']=_0x7766('0x5a');break;case _0x7766('0x5b'):_0x572c69[_0x7766('0x13')]=_0x7766('0x5c');break;case _0x7766('0x5d'):_0x572c69[_0x7766('0x13')]=_0x7766('0x5e');break;case _0x7766('0x5f'):_0x572c69['childModel']=_0x7766('0x60');break;case _0x7766('0x61'):_0x572c69[_0x7766('0x13')]=_0x7766('0x62');break;case _0x7766('0x63'):_0x572c69[_0x7766('0x13')]=_0x7766('0x34');break;case _0x7766('0x64'):_0x572c69[_0x7766('0x13')]=_0x7766('0x65');break;case _0x7766('0x66'):_0x572c69[_0x7766('0x13')]=_0x7766('0x67');break;case _0x7766('0x68'):_0x572c69[_0x7766('0x13')]=_0x7766('0x69');break;case _0x7766('0x6a'):_0x572c69[_0x7766('0x13')]=_0x7766('0x6b');break;case _0x7766('0x6c'):_0x572c69[_0x7766('0x13')]=_0x7766('0x6d');break;case _0x7766('0x6e'):_0x572c69[_0x7766('0x13')]=_0x7766('0x6f');break;case _0x7766('0x70'):_0x572c69['childModel']=_0x7766('0x71');break;case _0x7766('0x72'):_0x572c69['childModel']=_0x7766('0x73');break;case _0x7766('0x74'):_0x572c69[_0x7766('0x13')]='Template';break;case _0x7766('0x75'):_0x572c69[_0x7766('0x13')]=_0x7766('0x76');break;case _0x7766('0x77'):_0x572c69[_0x7766('0x13')]=_0x7766('0x78');break;case _0x7766('0x79'):_0x572c69[_0x7766('0x13')]=_0x7766('0x7a');break;case _0x7766('0x7b'):_0x572c69[_0x7766('0x13')]=_0x7766('0x7c');break;case _0x7766('0x7d'):_0x572c69['childModel']='AnalyticExtractedReport';_0x572c69['parentSections']=[{'name':_0x7766('0x7e'),'field':'id','foreignKey':'reportId'}];break;case _0x7766('0x7f'):_0x572c69[_0x7766('0x13')]='AnalyticMetric';break;}return _0x572c69;}function _0x178570(_0x4c6fdc,_0x141858){var _0x4a5e24=_0x4c6fdc['charAt'](0x0)[_0x7766('0x80')]()+_0x4c6fdc[_0x7766('0x81')](0x1);var _0x1c518b={'type':_0x51ca5a[_0x7766('0x82')][_0x7766('0x83')]['SELECT'],'raw':!![]};return new Promise(function(_0x6a750f,_0x1d4a93){var _0x5d73cb=squel['select']()['field'](_0x7766('0x84')+_0x4a5e24+'InteractionId','id')[_0x7766('0x4')](_0x7766('0x85'))['from'](_0x7766('0x86')+_0x4c6fdc+_0x7766('0x87'),'ui')[_0x7766('0x88')](_0x7766('0x89'),_0x141858['id']);return _0x51ca5a[_0x7766('0x8a')][_0x7766('0x8b')](_0x5d73cb[_0x7766('0x8c')](),_0x1c518b)[_0x7766('0x8')](function(_0x411bb4){_0x141858[_0x4a5e24+_0x7766('0x8d')]=_0x411bb4;_0x6a750f(_0x411bb4);})['catch'](function(_0x4c23d3){_0x1d4a93(_0x4c23d3);});});}return _0x588f1b[_0x7766('0x8e')](_0x7766('0x8f'),attributes,{'tableName':_0x7766('0x90'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x4e3ccb){var _0x4301eb=require(_0x7766('0x91'));var _0x4e3ad9={'raw':_0x4e3ccb[_0x7766('0x8b')]['raw'],'where':{}};var _0x134db4={};var _0x38de7f={'count':0x0,'rows':[]};var _0x1ff556=_0x4e3ccb[_0x7766('0x8b')]['section'];var _0x4a4a1d=_0x4e3ccb[_0x7766('0x8b')][_0x7766('0x92')]||![];var _0x394a98=_0x4d8068(_0x1ff556,_0x4a4a1d);if(!_0x394a98[_0x7766('0x13')])throw new Error('Invalid\x20section\x20\x27'+_0x1ff556+'\x27');var _0x494278=[{'name':_0x1ff556}];if(!_[_0x7766('0x93')](_0x394a98['parentSections']))_0x494278=_0x394a98[_0x7766('0x1a')];var _0x4ac609=[];for(var _0x267cdb=0x0;_0x267cdb<_0x494278['length'];_0x267cdb++){_0x4ac609[_0x7766('0x94')](_0x51ca5a[_0x7766('0x95')][_0x7766('0x96')]({'where':{'userProfileId':_0x4e3ccb[_0x7766('0x97')]['id'],'name':_0x494278[_0x267cdb][_0x7766('0xd')]},'raw':!![]}));}return Promise[_0x7766('0x98')](_0x4ac609)[_0x7766('0x8')](function(_0x5c2b82){var _0x49692a=_[_0x7766('0x5')](_0x5c2b82,function(_0xd02c4c){return _0xd02c4c?_0xd02c4c:undefined;});var _0x15cca2=_[_0x7766('0x5')](_0x494278,[_0x7766('0x99'),!![]]);var _0xc17fce=_[_0x7766('0x93')](_0x49692a)&&_[_0x7766('0x93')](_0x15cca2)?null:_[_0x7766('0x9a')](_0x15cca2,_0x49692a);if(!_0xc17fce)return null;var _0x123ffd=[];for(var _0x181fad=0x0;_0x181fad<_0xc17fce[_0x7766('0x9b')];_0x181fad++){var _0x2dc301=_[_0x7766('0x96')](_0x494278,function(_0x30add5){return _0xc17fce[_0x181fad]?_0x30add5['name']===_0xc17fce[_0x181fad][_0x7766('0xd')]:null;});if(_0x2dc301){if(_0xc17fce[_0x181fad][_0x7766('0x99')]){_0x123ffd[_0x7766('0x94')](_0x443e35(_0x394a98[_0x7766('0x13')],_0xc17fce[_0x181fad]));}else{if(!_0xc17fce[_0x181fad][_0x7766('0x9c')]){_0x123ffd[_0x7766('0x94')](_0x123ec0(_0x2dc301,_0xc17fce[_0x181fad],_0x394a98[_0x7766('0x13')]));}else{if(_0x2dc301['model']){_0x123ffd[_0x7766('0x94')](_0x308314(_0x2dc301,_0xc17fce[_0x181fad]));}}}}}return Promise[_0x7766('0x98')](_0x123ffd);})[_0x7766('0x8')](function(_0x500e5d){var _0x328330=_0x500e5d;var _0x389659=null;if(_0x328330){_0x389659=_0x328330[_0x7766('0x9b')]===0x1?_0x328330[0x0]:null;}if(!_0x389659&&!_0x328330)return _0x38de7f;var _0x133018=_0x51ca5a[_0x394a98['childModel']][_0x7766('0x9d')];_0x134db4[_0x7766('0xc')]=_[_0x7766('0x9e')](_0x133018);_0x134db4[_0x7766('0x8b')]=_[_0x7766('0x9e')](_0x4e3ccb[_0x7766('0x8b')]);_0x134db4[_0x7766('0x9f')]=_['intersection'](_0x134db4[_0x7766('0xc')],_0x134db4[_0x7766('0x8b')]);_0x4e3ad9[_0x7766('0xa0')]=_[_0x7766('0xa1')](_0x134db4[_0x7766('0xc')],_0x4301eb['fields'](_0x4e3ccb[_0x7766('0x8b')][_0x7766('0xa2')]));_0x4e3ad9['attributes']=_0x4e3ad9[_0x7766('0xa0')][_0x7766('0x9b')]?_0x4e3ad9[_0x7766('0xa0')]:_0x134db4[_0x7766('0xc')];if(!_0x4e3ccb['query'][_0x7766('0xa3')]('nolimit')){_0x4e3ad9[_0x7766('0xa4')]=_0x4301eb[_0x7766('0xa4')](_0x4e3ccb[_0x7766('0x8b')][_0x7766('0xa4')]);_0x4e3ad9['offset']=_0x4301eb[_0x7766('0xa5')](_0x4e3ccb[_0x7766('0x8b')][_0x7766('0xa5')]);}_0x4e3ad9[_0x7766('0xa6')]=_0x4301eb['sort'](_0x4e3ccb['query']['sort']);_0x4e3ad9[_0x7766('0x88')]=_0x4301eb['filters'](_[_0x7766('0xa7')](_0x4e3ccb[_0x7766('0x8b')],_0x134db4[_0x7766('0x9f')]));if(_0x4e3ccb[_0x7766('0x8b')][_0x7766('0x5')]){_0x4e3ad9[_0x7766('0x88')]=_[_0x7766('0xa8')](_0x4e3ad9[_0x7766('0x88')],{'$or':_[_0x7766('0xa')](_0x133018,function(_0x4e3d1b){if(_0x4e3d1b[_0x7766('0x10')][_0x7766('0xa9')]!==_0x7766('0xaa')){var _0x14e4db={};_0x14e4db[_0x4e3d1b['field']]={'$like':'%'+_0x4e3ccb[_0x7766('0x8b')][_0x7766('0x5')]+'%'};return _0x14e4db;}})});}var _0x598bde=[];var _0x2f6762=null;var _0x5b7220={};if(_0x389659){_0x2f6762=_[_0x7766('0x96')](_0x494278,['name',_0x389659[_0x7766('0xd')]]);if(_0x2f6762[_0x7766('0x4')]){_0x5b7220={};if(_0x394a98[_0x7766('0x13')]===_0x7766('0xe')){_0x5b7220[_0x2f6762[_0x7766('0xab')]]=_[_0x7766('0xa')](_0x389659[_0x7766('0x9')],'id');}else{_0x5b7220[_0x2f6762[_0x7766('0xab')]]=_0x389659[_0x7766('0x9')];}_0x598bde[_0x7766('0x94')](_0x5b7220);}else{_0x4e3ad9['where']['id']=_0x389659['associatedResources'];}}else{for(var _0x2d68b6=0x0;_0x2d68b6<_0x328330[_0x7766('0x9b')];_0x2d68b6++){_0x2f6762=_[_0x7766('0x96')](_0x494278,[_0x7766('0xd'),_0x328330[_0x2d68b6]['name']]);if(_0x2f6762[_0x7766('0x4')]){_0x5b7220={};_0x5b7220[_0x2f6762[_0x7766('0xab')]]=_0x328330[_0x2d68b6][_0x7766('0x9')];_0x598bde[_0x7766('0x94')](_0x5b7220);}else{if(!_0x4e3ad9[_0x7766('0x88')]['id'])_0x4e3ad9[_0x7766('0x88')]['id']=[];_0x328330[_0x2d68b6][_0x7766('0x9')][_0x7766('0xac')](function(_0x5a746f){_0x4e3ad9[_0x7766('0x88')]['id']['push'](_0x5a746f);});}}}if(!_[_0x7766('0x93')](_0x598bde)){_0x4e3ad9[_0x7766('0x88')]=_['merge'](_0x4e3ad9[_0x7766('0x88')],{'$and':{'$or':_0x598bde}});}_0x4e3ad9=_[_0x7766('0xa8')]({},_0x4e3ad9,_0x4e3ccb[_0x7766('0xad')]);if(_0x389659&&!_0x389659[_0x7766('0x9c')]&&_0x394a98[_0x7766('0x13')]==='AnalyticExtractedReport'){if(_0x4e3ccb['query']['includeAll']){_0x4e3ad9[_0x7766('0xae')]=[{'all':!![]}];}return _0x51ca5a[_0x394a98[_0x7766('0x13')]][_0x7766('0x7')](_0x4e3ad9)['then'](function(_0x1cd670){var _0x21c5c0=[];_0x1cd670['forEach'](function(_0x7849f1){var _0x117616;switch(_0x7849f1[_0x7766('0xaf')]){case _0x7766('0xb0'):_0x117616=_['find'](_0x389659[_0x7766('0x9')],function(_0x30c3c6){return _0x30c3c6['id']===_0x7849f1[_0x7766('0xb1')]&&_0x30c3c6[_0x7766('0x10')]===_0x7766('0xb2');});break;case _0x7766('0xb3'):_0x117616=_[_0x7766('0x96')](_0x389659[_0x7766('0x9')],function(_0x20e608){return _0x20e608['id']===_0x7849f1[_0x7766('0xb1')]&&_0x20e608['type']===_0x7766('0xb4');});break;}if(_0x117616)_0x21c5c0[_0x7766('0x94')](_0x7849f1);});_0x38de7f[_0x7766('0xb5')]=_0x21c5c0[_0x7766('0x9b')];_0x38de7f[_0x7766('0xb6')]=_0x21c5c0;return _0x38de7f;});}else{if(!_[_0x7766('0x93')](_0x4e3ccb[_0x7766('0x8b')]['ids'])){_0x4e3ad9[_0x7766('0x88')]['id']=_0x4e3ad9[_0x7766('0x88')]['id']?_['intersection'](_0x4e3ad9[_0x7766('0x88')]['id'],_0x4e3ccb[_0x7766('0x8b')][_0x7766('0xb7')]):_0x4e3ccb[_0x7766('0x8b')]['ids'];if(_0x4e3ccb[_0x7766('0x8b')]['customSorting']){_0x4e3ad9[_0x7766('0xa6')]=_0x4e3ccb[_0x7766('0x8b')][_0x7766('0xb8')];}}if(_0x4e3ccb[_0x7766('0x8b')][_0x7766('0xb9')]){_0x4e3ad9[_0x7766('0x88')]=_[_0x7766('0xa8')](_0x4e3ad9[_0x7766('0x88')],{'$and':_0x4e3ccb[_0x7766('0x8b')][_0x7766('0xb9')]});}return _0x51ca5a[_0x394a98['childModel']][_0x7766('0xb5')]({'where':_0x4e3ad9[_0x7766('0x88')]})[_0x7766('0x8')](function(_0xacc26f){_0x38de7f[_0x7766('0xb5')]=_0xacc26f;if(_0x4e3ccb[_0x7766('0x8b')][_0x7766('0xba')]){if(_0x394a98[_0x7766('0x13')]===_0x7766('0xbb')){_0x4e3ad9[_0x7766('0xae')]=[{'model':_0x51ca5a[_0x7766('0x73')],'as':_0x7766('0xbc'),'attributes':['id',_0x7766('0xd'),_0x7766('0xbd')],'required':_0x4e3ccb[_0x7766('0x8b')][_0x7766('0xbe')]?!![]:![]},{'model':_0x51ca5a[_0x7766('0x73')],'as':_0x7766('0xbf'),'attributes':['id','name',_0x7766('0xbd')],'through':_0x4e3ccb[_0x7766('0x8b')][_0x7766('0xbe')]?{'attributes':[],'where':{'TagId':_0x4e3ccb[_0x7766('0x8b')][_0x7766('0xbe')]||undefined}}:{},'required':_0x4e3ccb[_0x7766('0x8b')][_0x7766('0xbe')]?!![]:![]}];}else{_0x4e3ad9[_0x7766('0xae')]=[{'all':!![]}];}}return _0x51ca5a[_0x394a98[_0x7766('0x13')]][_0x7766('0x7')](_0x4e3ad9);})['then'](function(_0x17741c){_0x38de7f[_0x7766('0xb6')]=_0x17741c;if(_0x1ff556===_0x7766('0x32')&&_0x4e3ccb[_0x7766('0x8b')]['openTabs']===_0x7766('0xc0')){var _0x2b3e6d=[];for(var _0x53374d=0x0;_0x53374d<_0x38de7f[_0x7766('0xb6')][_0x7766('0x9b')];_0x53374d++){_0x2b3e6d[_0x7766('0x94')](_0x178570(_0x7766('0xc1'),_0x38de7f[_0x7766('0xb6')][_0x53374d][_0x7766('0xc2')]));_0x2b3e6d[_0x7766('0x94')](_0x178570('sms',_0x38de7f[_0x7766('0xb6')][_0x53374d][_0x7766('0xc2')]));_0x2b3e6d['push'](_0x178570(_0x7766('0xc3'),_0x38de7f[_0x7766('0xb6')][_0x53374d][_0x7766('0xc2')]));_0x2b3e6d[_0x7766('0x94')](_0x178570('mail',_0x38de7f[_0x7766('0xb6')][_0x53374d][_0x7766('0xc2')]));_0x2b3e6d[_0x7766('0x94')](_0x178570('openchannel',_0x38de7f[_0x7766('0xb6')][_0x53374d]['dataValues']));_0x2b3e6d[_0x7766('0x94')](_0x178570(_0x7766('0xc4'),_0x38de7f[_0x7766('0xb6')][_0x53374d][_0x7766('0xc2')]));}return Promise['all'](_0x2b3e6d)[_0x7766('0x8')](function(){return _0x38de7f;});}return _0x38de7f;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index ee4d058..3b28a00 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 _0x3cb7=['http','redis','defaults','localhost','./userProfile.socket','register','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x528342,_0x17a981){var _0x27dd91=function(_0x20bed6){while(--_0x20bed6){_0x528342['push'](_0x528342['shift']());}};_0x27dd91(++_0x17a981);}(_0x3cb7,0xcf));var _0x73cb=function(_0x1e393b,_0x355f6b){_0x1e393b=_0x1e393b-0x0;var _0x3d0bfe=_0x3cb7[_0x1e393b];return _0x3d0bfe;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x73cb('0x0'));var BPromise=require('bluebird');var rs=require(_0x73cb('0x1'));var fs=require('fs');var Redis=require(_0x73cb('0x2'));var db=require(_0x73cb('0x3'))['db'];var utils=require(_0x73cb('0x4'));var logger=require(_0x73cb('0x5'))(_0x73cb('0x6'));var config=require(_0x73cb('0x7'));var jayson=require(_0x73cb('0x8'));var client=jayson['client'][_0x73cb('0x9')]({'port':0x232a});config[_0x73cb('0xa')]=_[_0x73cb('0xb')](config[_0x73cb('0xa')],{'host':_0x73cb('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x73cb('0xa')]));require(_0x73cb('0xd'))[_0x73cb('0xe')](socket);function respondWithRpcPromise(_0x29deae,_0x1826dd,_0xc1a63e){return new BPromise(function(_0x43eab2,_0x501542){return client[_0x73cb('0xf')](_0x29deae,_0xc1a63e)[_0x73cb('0x10')](function(_0x35900e){logger[_0x73cb('0x11')](_0x73cb('0x12'),_0x1826dd,_0x73cb('0x13'));logger['debug'](_0x73cb('0x14'),_0x1826dd,_0x73cb('0x13'),JSON[_0x73cb('0x15')](_0x35900e));if(_0x35900e[_0x73cb('0x16')]){if(_0x35900e[_0x73cb('0x16')][_0x73cb('0x17')]===0x1f4){logger[_0x73cb('0x16')](_0x73cb('0x12'),_0x1826dd,_0x35900e[_0x73cb('0x16')][_0x73cb('0x18')]);return _0x501542(_0x35900e['error']['message']);}logger['error'](_0x73cb('0x12'),_0x1826dd,_0x35900e[_0x73cb('0x16')][_0x73cb('0x18')]);return _0x43eab2(_0x35900e[_0x73cb('0x16')][_0x73cb('0x18')]);}else{logger['info'](_0x73cb('0x12'),_0x1826dd,_0x73cb('0x13'));_0x43eab2(_0x35900e[_0x73cb('0x19')][_0x73cb('0x18')]);}})[_0x73cb('0x1a')](function(_0x28ee3b){logger[_0x73cb('0x16')](_0x73cb('0x12'),_0x1826dd,_0x28ee3b);_0x501542(_0x28ee3b);});});} \ No newline at end of file +var _0x1a38=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','request','then','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','../../mysqldb'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x1a38,0xb0));var _0x81a3=function(_0x4eaa4c,_0x2f7422){_0x4eaa4c=_0x4eaa4c-0x0;var _0x15aec6=_0x1a38[_0x4eaa4c];return _0x15aec6;};'use strict';var _=require(_0x81a3('0x0'));var util=require(_0x81a3('0x1'));var moment=require(_0x81a3('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x81a3('0x3'))['db'];var utils=require(_0x81a3('0x4'));var logger=require(_0x81a3('0x5'))(_0x81a3('0x6'));var config=require(_0x81a3('0x7'));var jayson=require(_0x81a3('0x8'));var client=jayson[_0x81a3('0x9')][_0x81a3('0xa')]({'port':0x232a});config[_0x81a3('0xb')]=_[_0x81a3('0xc')](config[_0x81a3('0xb')],{'host':_0x81a3('0xd'),'port':0x18eb});var socket=require(_0x81a3('0xe'))(new Redis(config['redis']));require(_0x81a3('0xf'))[_0x81a3('0x10')](socket);function respondWithRpcPromise(_0x3ece9a,_0x10f4c5,_0x3fd4fe){return new BPromise(function(_0x4a7f3a,_0xeef25e){return client[_0x81a3('0x11')](_0x3ece9a,_0x3fd4fe)[_0x81a3('0x12')](function(_0x516492){logger['info'](_0x81a3('0x13'),_0x10f4c5,_0x81a3('0x14'));logger[_0x81a3('0x15')](_0x81a3('0x16'),_0x10f4c5,_0x81a3('0x14'),JSON[_0x81a3('0x17')](_0x516492));if(_0x516492[_0x81a3('0x18')]){if(_0x516492[_0x81a3('0x18')][_0x81a3('0x19')]===0x1f4){logger[_0x81a3('0x18')](_0x81a3('0x13'),_0x10f4c5,_0x516492[_0x81a3('0x18')]['message']);return _0xeef25e(_0x516492[_0x81a3('0x18')][_0x81a3('0x1a')]);}logger[_0x81a3('0x18')](_0x81a3('0x13'),_0x10f4c5,_0x516492['error'][_0x81a3('0x1a')]);return _0x4a7f3a(_0x516492[_0x81a3('0x18')]['message']);}else{logger[_0x81a3('0x1b')]('UserProfile,\x20%s,\x20%s',_0x10f4c5,'request\x20sent');_0x4a7f3a(_0x516492[_0x81a3('0x1c')][_0x81a3('0x1a')]);}})[_0x81a3('0x1d')](function(_0x18c316){logger[_0x81a3('0x18')](_0x81a3('0x13'),_0x10f4c5,_0x18c316);_0xeef25e(_0x18c316);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index ae0306e..e4ddf42 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 _0xc319=['./userProfile.events','save','update','removeListener','length'];(function(_0x1a5b2b,_0x5c2965){var _0x2735c5=function(_0x15ac13){while(--_0x15ac13){_0x1a5b2b['push'](_0x1a5b2b['shift']());}};_0x2735c5(++_0x5c2965);}(_0xc319,0xc8));var _0x9c31=function(_0x57f199,_0x4463a8){_0x57f199=_0x57f199-0x0;var _0x436d54=_0xc319[_0x57f199];return _0x436d54;};'use strict';var UserProfileEvents=require(_0x9c31('0x0'));var events=[_0x9c31('0x1'),'remove',_0x9c31('0x2')];function createListener(_0x28984a,_0x3a8311){return function(_0x6c9fe1){_0x3a8311['emit'](_0x28984a,_0x6c9fe1);};}function removeListener(_0x5eb741,_0x44d7ca){return function(){UserProfileEvents[_0x9c31('0x3')](_0x5eb741,_0x44d7ca);};}exports['register']=function(_0x44e5f4){for(var _0x5912e0=0x0,_0x15d2f6=events[_0x9c31('0x4')];_0x5912e0<_0x15d2f6;_0x5912e0++){var _0x208def=events[_0x5912e0];var _0x54b5c1=createListener('userProfile:'+_0x208def,_0x44e5f4);UserProfileEvents['on'](_0x208def,_0x54b5c1);}}; \ No newline at end of file +var _0x40db=['userProfile:','./userProfile.events','save','remove','update','emit','length'];(function(_0x4f6efd,_0x587db0){var _0x5ddd3d=function(_0x3c2363){while(--_0x3c2363){_0x4f6efd['push'](_0x4f6efd['shift']());}};_0x5ddd3d(++_0x587db0);}(_0x40db,0xd3));var _0xb40d=function(_0x370ff0,_0x24ad5d){_0x370ff0=_0x370ff0-0x0;var _0x162f8b=_0x40db[_0x370ff0];return _0x162f8b;};'use strict';var UserProfileEvents=require(_0xb40d('0x0'));var events=[_0xb40d('0x1'),_0xb40d('0x2'),_0xb40d('0x3')];function createListener(_0x354ca3,_0x22301d){return function(_0x295347){_0x22301d[_0xb40d('0x4')](_0x354ca3,_0x295347);};}function removeListener(_0x1ebf1b,_0x101b35){return function(){UserProfileEvents['removeListener'](_0x1ebf1b,_0x101b35);};}exports['register']=function(_0x58ea0d){for(var _0x1ce19d=0x0,_0x1e8679=events[_0xb40d('0x5')];_0x1ce19d<_0x1e8679;_0x1ce19d++){var _0x17eee4=events[_0x1ce19d];var _0x19f9a3=createListener(_0xb40d('0x6')+_0x17eee4,_0x58ea0d);UserProfileEvents['on'](_0x17eee4,_0x19f9a3);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 0dde787..e5e2939 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 _0xd91e=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','destroy','exports','multer','util'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xd91e,0x88));var _0xed91=function(_0x2e14b0,_0xa3ca8c){_0x2e14b0=_0x2e14b0-0x0;var _0x48be68=_0xd91e[_0x2e14b0];return _0x48be68;};'use strict';var multer=require(_0xed91('0x0'));var util=require(_0xed91('0x1'));var path=require(_0xed91('0x2'));var timeout=require(_0xed91('0x3'));var express=require(_0xed91('0x4'));var router=express[_0xed91('0x5')]();var fs_extra=require(_0xed91('0x6'));var auth=require(_0xed91('0x7'));var interaction=require(_0xed91('0x8'));var config=require(_0xed91('0x9'));var controller=require('./userProfileResource.controller');router[_0xed91('0xa')]('/',auth['isAuthenticated'](),controller[_0xed91('0xb')]);router['get'](_0xed91('0xc'),auth[_0xed91('0xd')](),controller[_0xed91('0xe')]);router[_0xed91('0xa')](_0xed91('0xf'),auth['isAuthenticated'](),controller[_0xed91('0x10')]);router[_0xed91('0x11')]('/',auth[_0xed91('0xd')](),controller[_0xed91('0x12')]);router[_0xed91('0x13')]('/:id',auth[_0xed91('0xd')](),controller[_0xed91('0x14')]);router['delete'](_0xed91('0xf'),auth[_0xed91('0xd')](),controller[_0xed91('0x15')]);module[_0xed91('0x16')]=router; \ No newline at end of file +var _0xd748=['fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','get','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x37d9b5,_0x47922c){var _0xfa0f46=function(_0x12b6b8){while(--_0x12b6b8){_0x37d9b5['push'](_0x37d9b5['shift']());}};_0xfa0f46(++_0x47922c);}(_0xd748,0xd6));var _0x8d74=function(_0x3e0dc4,_0x13971b){_0x3e0dc4=_0x3e0dc4-0x0;var _0x586111=_0xd748[_0x3e0dc4];return _0x586111;};'use strict';var multer=require(_0x8d74('0x0'));var util=require(_0x8d74('0x1'));var path=require(_0x8d74('0x2'));var timeout=require(_0x8d74('0x3'));var express=require(_0x8d74('0x4'));var router=express[_0x8d74('0x5')]();var fs_extra=require(_0x8d74('0x6'));var auth=require(_0x8d74('0x7'));var interaction=require(_0x8d74('0x8'));var config=require('../../config/environment');var controller=require('./userProfileResource.controller');router['get']('/',auth[_0x8d74('0x9')](),controller['index']);router[_0x8d74('0xa')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x8d74('0xa')](_0x8d74('0xb'),auth['isAuthenticated'](),controller[_0x8d74('0xc')]);router[_0x8d74('0xd')]('/',auth['isAuthenticated'](),controller[_0x8d74('0xe')]);router[_0x8d74('0xf')](_0x8d74('0xb'),auth[_0x8d74('0x9')](),controller[_0x8d74('0x10')]);router[_0x8d74('0x11')](_0x8d74('0xb'),auth['isAuthenticated'](),controller[_0x8d74('0x12')]);module[_0x8d74('0x13')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 61a7b74..27172c8 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 _0xb534=['INTEGER','sequelize','exports','STRING'];(function(_0x134153,_0x205b75){var _0x3db4b7=function(_0x3f2790){while(--_0x3f2790){_0x134153['push'](_0x134153['shift']());}};_0x3db4b7(++_0x205b75);}(_0xb534,0xad));var _0x4b53=function(_0x5ecb27,_0x4ad46d){_0x5ecb27=_0x5ecb27-0x0;var _0x338e69=_0xb534[_0x5ecb27];return _0x338e69;};'use strict';var Sequelize=require(_0x4b53('0x0'));module[_0x4b53('0x1')]={'name':{'type':Sequelize[_0x4b53('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x4b53('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x4b53('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x02ba=['STRING','INTEGER','exports'];(function(_0x3b6948,_0xde53fe){var _0x18806e=function(_0x4d77ee){while(--_0x4d77ee){_0x3b6948['push'](_0x3b6948['shift']());}};_0x18806e(++_0xde53fe);}(_0x02ba,0x113));var _0xa02b=function(_0x225721,_0x3f26d2){_0x225721=_0x225721-0x0;var _0x160053=_0x02ba[_0x225721];return _0x160053;};'use strict';var Sequelize=require('sequelize');module[_0xa02b('0x0')]={'name':{'type':Sequelize[_0xa02b('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0xa02b('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xa02b('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index c0b650e..7dd5f8b 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 _0x7a54=['set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','UserProfileResource','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','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'];(function(_0x194acc,_0x16a88a){var _0x2b7aab=function(_0x52944f){while(--_0x52944f){_0x194acc['push'](_0x194acc['shift']());}};_0x2b7aab(++_0x16a88a);}(_0x7a54,0x106));var _0x47a5=function(_0x5e0d26,_0x21dfca){_0x5e0d26=_0x5e0d26-0x0;var _0x2fd91d=_0x7a54[_0x5e0d26];return _0x2fd91d;};'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['UserProfileResource'][_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['UserProfileResource']['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['UserProfileResource']['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('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x48')]=function(_0x1c9a62,_0x5f6a){return db['UserProfileResource'][_0x47a5('0x48')]()['then'](respondWithResult(_0x5f6a,null))[_0x47a5('0x46')](handleError(_0x5f6a,null));}; \ No newline at end of file +var _0x5fab=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','end','sendStatus','name','send','index','map','UserProfileResource','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','includeAll','include','findAll','then','rows','show','params','intersection','fields','options','find','catch','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0x5fab,0x177));var _0xb5fa=function(_0xbc8177,_0x4d1cfd){_0xbc8177=_0xbc8177-0x0;var _0x91d12f=_0x5fab[_0xbc8177];return _0x91d12f;};'use strict';var emlformat=require(_0xb5fa('0x0'));var rimraf=require(_0xb5fa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb5fa('0x2'));var rp=require(_0xb5fa('0x3'));var moment=require(_0xb5fa('0x4'));var BPromise=require(_0xb5fa('0x5'));var Mustache=require(_0xb5fa('0x6'));var util=require(_0xb5fa('0x7'));var path=require(_0xb5fa('0x8'));var sox=require(_0xb5fa('0x9'));var csv=require(_0xb5fa('0xa'));var ejs=require(_0xb5fa('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb5fa('0xc'));var crypto=require(_0xb5fa('0xd'));var jsforce=require(_0xb5fa('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb5fa('0xa'));var querystring=require(_0xb5fa('0xf'));var Papa=require(_0xb5fa('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb5fa('0x11'));var as=require(_0xb5fa('0x12'));var hardwareService=require(_0xb5fa('0x13'));var logger=require(_0xb5fa('0x14'))(_0xb5fa('0x15'));var utils=require(_0xb5fa('0x16'));var config=require(_0xb5fa('0x17'));var licenseUtil=require(_0xb5fa('0x18'));var db=require(_0xb5fa('0x19'))['db'];function respondWithStatusCode(_0x4d3576,_0x2ad830){_0x2ad830=_0x2ad830||0xcc;return function(_0x3dad4d){if(_0x3dad4d){return _0x4d3576['sendStatus'](_0x2ad830);}return _0x4d3576[_0xb5fa('0x1a')](_0x2ad830)['end']();};}function respondWithResult(_0x265992,_0x3fc372){_0x3fc372=_0x3fc372||0xc8;return function(_0x40c914){if(_0x40c914){return _0x265992[_0xb5fa('0x1a')](_0x3fc372)[_0xb5fa('0x1b')](_0x40c914);}};}function respondWithFilteredResult(_0x5371cf,_0x567f31){return function(_0x38e964){if(_0x38e964){var _0x587043=typeof _0x567f31[_0xb5fa('0x1c')]===_0xb5fa('0x1d')&&typeof _0x567f31['limit']==='undefined';var _0x451a55=_0x38e964[_0xb5fa('0x1e')];var _0x32e9e5=_0x587043?0x0:_0x567f31[_0xb5fa('0x1c')];var _0x324ba5=_0x587043?_0x38e964[_0xb5fa('0x1e')]:_0x567f31[_0xb5fa('0x1c')]+_0x567f31[_0xb5fa('0x1f')];var _0xc14dc4;if(_0x324ba5>=_0x451a55){_0x324ba5=_0x451a55;_0xc14dc4=0xc8;}else{_0xc14dc4=0xce;}_0x5371cf[_0xb5fa('0x1a')](_0xc14dc4);return _0x5371cf[_0xb5fa('0x20')](_0xb5fa('0x21'),_0x32e9e5+'-'+_0x324ba5+'/'+_0x451a55)['json'](_0x38e964);}return null;};}function patchUpdates(_0x432bfa){return function(_0x519e20){try{jsonpatch[_0xb5fa('0x22')](_0x519e20,_0x432bfa,!![]);}catch(_0x4a6c04){return BPromise[_0xb5fa('0x23')](_0x4a6c04);}return _0x519e20[_0xb5fa('0x24')]();};}function saveUpdates(_0x4e05c0,_0x40dfdf){return function(_0x3a2ab9){if(_0x3a2ab9){return _0x3a2ab9[_0xb5fa('0x25')](_0x4e05c0)['then'](function(_0x32a85c){return _0x32a85c;});}return null;};}function removeEntity(_0xec108f,_0x444237){return function(_0x542348){if(_0x542348){return _0x542348[_0xb5fa('0x26')]()['then'](function(){_0xec108f[_0xb5fa('0x1a')](0xcc)[_0xb5fa('0x27')]();});}};}function handleEntityNotFound(_0x11053a,_0x543edf){return function(_0x2dbd22){if(!_0x2dbd22){_0x11053a[_0xb5fa('0x28')](0x194);}return _0x2dbd22;};}function handleError(_0x6a455c,_0x20d649){_0x20d649=_0x20d649||0x1f4;return function(_0x568870){logger['error'](_0x568870['stack']);if(_0x568870['name']){delete _0x568870[_0xb5fa('0x29')];}_0x6a455c[_0xb5fa('0x1a')](_0x20d649)[_0xb5fa('0x2a')](_0x568870);};}exports[_0xb5fa('0x2b')]=function(_0x534884,_0x3506a4){var _0x358549={},_0x353314={},_0x409af9={'count':0x0,'rows':[]};var _0x2a5690=_[_0xb5fa('0x2c')](db[_0xb5fa('0x2d')][_0xb5fa('0x2e')],function(_0x1f4380){return{'name':_0x1f4380[_0xb5fa('0x2f')],'type':_0x1f4380[_0xb5fa('0x30')][_0xb5fa('0x31')]};});_0x353314[_0xb5fa('0x32')]=_[_0xb5fa('0x2c')](_0x2a5690,_0xb5fa('0x29'));_0x353314[_0xb5fa('0x33')]=_[_0xb5fa('0x34')](_0x534884[_0xb5fa('0x33')]);_0x353314[_0xb5fa('0x35')]=_['intersection'](_0x353314[_0xb5fa('0x32')],_0x353314['query']);_0x358549['attributes']=_['intersection'](_0x353314[_0xb5fa('0x32')],qs['fields'](_0x534884[_0xb5fa('0x33')]['fields']));_0x358549['attributes']=_0x358549[_0xb5fa('0x36')][_0xb5fa('0x37')]?_0x358549['attributes']:_0x353314['model'];if(!_0x534884[_0xb5fa('0x33')][_0xb5fa('0x38')](_0xb5fa('0x39'))){_0x358549['limit']=qs[_0xb5fa('0x1f')](_0x534884[_0xb5fa('0x33')]['limit']);_0x358549[_0xb5fa('0x1c')]=qs[_0xb5fa('0x1c')](_0x534884[_0xb5fa('0x33')]['offset']);}_0x358549[_0xb5fa('0x3a')]=qs[_0xb5fa('0x3b')](_0x534884[_0xb5fa('0x33')]['sort']);_0x358549[_0xb5fa('0x3c')]=qs[_0xb5fa('0x35')](_[_0xb5fa('0x3d')](_0x534884[_0xb5fa('0x33')],_0x353314['filters']),_0x2a5690);if(_0x534884['query']['filter']){_0x358549['where']=_['merge'](_0x358549['where'],{'$or':_[_0xb5fa('0x2c')](_0x2a5690,function(_0x4c0a4d){if(_0x4c0a4d[_0xb5fa('0x30')]!==_0xb5fa('0x3e')){var _0x36db1a={};_0x36db1a[_0x4c0a4d[_0xb5fa('0x29')]]={'$like':'%'+_0x534884[_0xb5fa('0x33')][_0xb5fa('0x3f')]+'%'};return _0x36db1a;}})});}_0x358549=_['merge']({},_0x358549,_0x534884['options']);var _0x4c4bf0={'where':_0x358549[_0xb5fa('0x3c')]};return db['UserProfileResource'][_0xb5fa('0x1e')](_0x4c4bf0)['then'](function(_0x58aa97){_0x409af9[_0xb5fa('0x1e')]=_0x58aa97;if(_0x534884[_0xb5fa('0x33')][_0xb5fa('0x40')]){_0x358549[_0xb5fa('0x41')]=[{'all':!![]}];}return db[_0xb5fa('0x2d')][_0xb5fa('0x42')](_0x358549);})[_0xb5fa('0x43')](function(_0x83df0b){_0x409af9[_0xb5fa('0x44')]=_0x83df0b;return _0x409af9;})[_0xb5fa('0x43')](respondWithFilteredResult(_0x3506a4,_0x358549))['catch'](handleError(_0x3506a4,null));};exports[_0xb5fa('0x45')]=function(_0x4bc9df,_0x233f90){var _0x39aac3={'raw':![],'where':{'id':_0x4bc9df[_0xb5fa('0x46')]['id']}},_0x2c7c5f={};_0x2c7c5f[_0xb5fa('0x32')]=_[_0xb5fa('0x34')](db[_0xb5fa('0x2d')][_0xb5fa('0x2e')]);_0x2c7c5f['query']=_[_0xb5fa('0x34')](_0x4bc9df[_0xb5fa('0x33')]);_0x2c7c5f['filters']=_[_0xb5fa('0x47')](_0x2c7c5f['model'],_0x2c7c5f[_0xb5fa('0x33')]);_0x39aac3[_0xb5fa('0x36')]=_['intersection'](_0x2c7c5f['model'],qs[_0xb5fa('0x48')](_0x4bc9df[_0xb5fa('0x33')][_0xb5fa('0x48')]));_0x39aac3[_0xb5fa('0x36')]=_0x39aac3[_0xb5fa('0x36')][_0xb5fa('0x37')]?_0x39aac3[_0xb5fa('0x36')]:_0x2c7c5f[_0xb5fa('0x32')];if(_0x4bc9df['query'][_0xb5fa('0x40')]){_0x39aac3[_0xb5fa('0x41')]=[{'all':!![]}];}_0x39aac3=_['merge']({},_0x39aac3,_0x4bc9df[_0xb5fa('0x49')]);return db[_0xb5fa('0x2d')][_0xb5fa('0x4a')](_0x39aac3)[_0xb5fa('0x43')](handleEntityNotFound(_0x233f90,null))[_0xb5fa('0x43')](respondWithResult(_0x233f90,null))[_0xb5fa('0x4b')](handleError(_0x233f90,null));};exports[_0xb5fa('0x4c')]=function(_0x33eb2c,_0x20f5f5){return db[_0xb5fa('0x2d')][_0xb5fa('0x4c')](_0x33eb2c[_0xb5fa('0x4d')],{})[_0xb5fa('0x43')](respondWithResult(_0x20f5f5,0xc9))[_0xb5fa('0x4b')](handleError(_0x20f5f5,null));};exports[_0xb5fa('0x25')]=function(_0x3a39f2,_0x52f5d8){if(_0x3a39f2['body']['id']){delete _0x3a39f2[_0xb5fa('0x4d')]['id'];}return db['UserProfileResource'][_0xb5fa('0x4a')]({'where':{'id':_0x3a39f2[_0xb5fa('0x46')]['id']}})['then'](handleEntityNotFound(_0x52f5d8,null))[_0xb5fa('0x43')](saveUpdates(_0x3a39f2[_0xb5fa('0x4d')],null))[_0xb5fa('0x43')](respondWithResult(_0x52f5d8,null))[_0xb5fa('0x4b')](handleError(_0x52f5d8,null));};exports[_0xb5fa('0x26')]=function(_0x3ffee0,_0x51d5f7){return db[_0xb5fa('0x2d')]['find']({'where':{'id':_0x3ffee0[_0xb5fa('0x46')]['id']}})[_0xb5fa('0x43')](handleEntityNotFound(_0x51d5f7,null))[_0xb5fa('0x43')](removeEntity(_0x51d5f7,null))['catch'](handleError(_0x51d5f7,null));};exports[_0xb5fa('0x4e')]=function(_0x130a0d,_0x4dea87){return db['UserProfileResource'][_0xb5fa('0x4e')]()[_0xb5fa('0x43')](respondWithResult(_0x4dea87,null))[_0xb5fa('0x4b')](handleError(_0x4dea87,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index ada03ae..7e5d040 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 _0x89c9=['bluebird','request-promise','path','rimraf','./userProfileResource.attributes','define','UserProfileResource','user_profile_has_resources','compositeIndex','resourceId','sectionId','lodash','../../config/logger','api'];(function(_0x29f0a6,_0x52f6b8){var _0x441e9d=function(_0x45f438){while(--_0x45f438){_0x29f0a6['push'](_0x29f0a6['shift']());}};_0x441e9d(++_0x52f6b8);}(_0x89c9,0xc1));var _0x989c=function(_0x4fa738,_0x2a491c){_0x4fa738=_0x4fa738-0x0;var _0x55bf55=_0x89c9[_0x4fa738];return _0x55bf55;};'use strict';var _=require(_0x989c('0x0'));var util=require('util');var logger=require(_0x989c('0x1'))(_0x989c('0x2'));var moment=require('moment');var BPromise=require(_0x989c('0x3'));var rp=require(_0x989c('0x4'));var fs=require('fs');var path=require(_0x989c('0x5'));var rimraf=require(_0x989c('0x6'));var config=require('../../config/environment');var attributes=require(_0x989c('0x7'));module['exports']=function(_0x4e0b4d,_0x3dea3d){return _0x4e0b4d[_0x989c('0x8')](_0x989c('0x9'),attributes,{'tableName':_0x989c('0xa'),'paranoid':![],'indexes':[{'name':_0x989c('0xb'),'fields':[_0x989c('0xc'),_0x989c('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x207c=['lodash','util','api','bluebird','path','rimraf','../../config/environment','./userProfileResource.attributes','exports','UserProfileResource','user_profile_has_resources','compositeIndex','resourceId','sectionId'];(function(_0x9a4dd9,_0x231c82){var _0x57b167=function(_0x7711d9){while(--_0x7711d9){_0x9a4dd9['push'](_0x9a4dd9['shift']());}};_0x57b167(++_0x231c82);}(_0x207c,0x17a));var _0xc207=function(_0x2179f2,_0x2dff7c){_0x2179f2=_0x2179f2-0x0;var _0x236d1b=_0x207c[_0x2179f2];return _0x236d1b;};'use strict';var _=require(_0xc207('0x0'));var util=require(_0xc207('0x1'));var logger=require('../../config/logger')(_0xc207('0x2'));var moment=require('moment');var BPromise=require(_0xc207('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc207('0x4'));var rimraf=require(_0xc207('0x5'));var config=require(_0xc207('0x6'));var attributes=require(_0xc207('0x7'));module[_0xc207('0x8')]=function(_0x8614ee,_0x57e5b3){return _0x8614ee['define'](_0xc207('0x9'),attributes,{'tableName':_0xc207('0xa'),'paranoid':![],'indexes':[{'name':_0xc207('0xb'),'fields':[_0xc207('0xc'),_0xc207('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 4295338..0e7446d 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 _0xe6a7=['lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','UserProfileResource,\x20%s,\x20%s','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe6a7,0x6e));var _0x7e6a=function(_0x733404,_0x5c9baf){_0x733404=_0x733404-0x0;var _0x41dd6f=_0xe6a7[_0x733404];return _0x41dd6f;};'use strict';var _=require(_0x7e6a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x7e6a('0x1'));var rs=require(_0x7e6a('0x2'));var fs=require('fs');var Redis=require(_0x7e6a('0x3'));var db=require(_0x7e6a('0x4'))['db'];var utils=require(_0x7e6a('0x5'));var logger=require(_0x7e6a('0x6'))('rpc');var config=require(_0x7e6a('0x7'));var jayson=require(_0x7e6a('0x8'));var client=jayson[_0x7e6a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x59087a,_0x1c2b42,_0x111dfe){return new BPromise(function(_0x1f5f60,_0x18d384){return client[_0x7e6a('0xa')](_0x59087a,_0x111dfe)[_0x7e6a('0xb')](function(_0x8aa94e){logger[_0x7e6a('0xc')](_0x7e6a('0xd'),_0x1c2b42,'request\x20sent');logger[_0x7e6a('0xe')](_0x7e6a('0xf'),_0x1c2b42,_0x7e6a('0x10'),JSON[_0x7e6a('0x11')](_0x8aa94e));if(_0x8aa94e[_0x7e6a('0x12')]){if(_0x8aa94e['error'][_0x7e6a('0x13')]===0x1f4){logger['error'](_0x7e6a('0xd'),_0x1c2b42,_0x8aa94e['error']['message']);return _0x18d384(_0x8aa94e[_0x7e6a('0x12')][_0x7e6a('0x14')]);}logger[_0x7e6a('0x12')]('UserProfileResource,\x20%s,\x20%s',_0x1c2b42,_0x8aa94e[_0x7e6a('0x12')][_0x7e6a('0x14')]);return _0x1f5f60(_0x8aa94e[_0x7e6a('0x12')][_0x7e6a('0x14')]);}else{logger[_0x7e6a('0xc')](_0x7e6a('0xd'),_0x1c2b42,_0x7e6a('0x10'));_0x1f5f60(_0x8aa94e['result'][_0x7e6a('0x14')]);}})[_0x7e6a('0x15')](function(_0x1e6dd5){logger[_0x7e6a('0x12')](_0x7e6a('0xd'),_0x1c2b42,_0x1e6dd5);_0x18d384(_0x1e6dd5);});});} \ No newline at end of file +var _0x2221=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserProfileResource,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','ioredis'];(function(_0x55a793,_0x50d7a9){var _0x135bdc=function(_0x1acc5a){while(--_0x1acc5a){_0x55a793['push'](_0x55a793['shift']());}};_0x135bdc(++_0x50d7a9);}(_0x2221,0x96));var _0x1222=function(_0x671369,_0x433da5){_0x671369=_0x671369-0x0;var _0x33f2b4=_0x2221[_0x671369];return _0x33f2b4;};'use strict';var _=require(_0x1222('0x0'));var util=require(_0x1222('0x1'));var moment=require(_0x1222('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1222('0x3'));var db=require(_0x1222('0x4'))['db'];var utils=require(_0x1222('0x5'));var logger=require('../../config/logger')(_0x1222('0x6'));var config=require(_0x1222('0x7'));var jayson=require(_0x1222('0x8'));var client=jayson[_0x1222('0x9')][_0x1222('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1330c1,_0x385a30,_0x198d16){return new BPromise(function(_0x4bfda0,_0x48e33f){return client[_0x1222('0xb')](_0x1330c1,_0x198d16)[_0x1222('0xc')](function(_0x2adb8a){logger[_0x1222('0xd')](_0x1222('0xe'),_0x385a30,'request\x20sent');logger[_0x1222('0xf')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x385a30,_0x1222('0x10'),JSON[_0x1222('0x11')](_0x2adb8a));if(_0x2adb8a[_0x1222('0x12')]){if(_0x2adb8a['error']['code']===0x1f4){logger[_0x1222('0x12')](_0x1222('0xe'),_0x385a30,_0x2adb8a[_0x1222('0x12')][_0x1222('0x13')]);return _0x48e33f(_0x2adb8a[_0x1222('0x12')][_0x1222('0x13')]);}logger[_0x1222('0x12')](_0x1222('0xe'),_0x385a30,_0x2adb8a[_0x1222('0x12')][_0x1222('0x13')]);return _0x4bfda0(_0x2adb8a[_0x1222('0x12')]['message']);}else{logger[_0x1222('0xd')](_0x1222('0xe'),_0x385a30,_0x1222('0x10'));_0x4bfda0(_0x2adb8a[_0x1222('0x14')]['message']);}})[_0x1222('0x15')](function(_0x57f4a7){logger[_0x1222('0x12')](_0x1222('0xe'),_0x385a30,_0x57f4a7);_0x48e33f(_0x57f4a7);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 3f8b1c3..2f5208c 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 _0x7313=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','put','delete','destroy','exports','multer'];(function(_0xba96b0,_0x36e8f8){var _0xdad969=function(_0x5226b4){while(--_0x5226b4){_0xba96b0['push'](_0xba96b0['shift']());}};_0xdad969(++_0x36e8f8);}(_0x7313,0x175));var _0x3731=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x7313[_0x42245d];return _0x4b211a;};'use strict';var multer=require(_0x3731('0x0'));var util=require(_0x3731('0x1'));var path=require(_0x3731('0x2'));var timeout=require(_0x3731('0x3'));var express=require(_0x3731('0x4'));var router=express[_0x3731('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x3731('0x6'));var interaction=require(_0x3731('0x7'));var config=require(_0x3731('0x8'));var controller=require(_0x3731('0x9'));router['get']('/',auth[_0x3731('0xa')](),controller[_0x3731('0xb')]);router[_0x3731('0xc')](_0x3731('0xd'),auth[_0x3731('0xa')](),controller[_0x3731('0xe')]);router[_0x3731('0xc')](_0x3731('0xf'),auth[_0x3731('0xa')](),controller[_0x3731('0x10')]);router[_0x3731('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3731('0x12')](_0x3731('0xf'),auth[_0x3731('0xa')](),controller['update']);router[_0x3731('0x13')](_0x3731('0xf'),auth[_0x3731('0xa')](),controller[_0x3731('0x14')]);module[_0x3731('0x15')]=router; \ No newline at end of file +var _0xbdab=['../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','isAuthenticated','index','/describe','describe','get','/:id','create','put','update','delete','destroy','exports','multer','util','connect-timeout','fs-extra'];(function(_0x180416,_0x16fadf){var _0x17ff28=function(_0x2865f9){while(--_0x2865f9){_0x180416['push'](_0x180416['shift']());}};_0x17ff28(++_0x16fadf);}(_0xbdab,0x18c));var _0xbbda=function(_0x246e86,_0x3e4b20){_0x246e86=_0x246e86-0x0;var _0x321336=_0xbdab[_0x246e86];return _0x321336;};'use strict';var multer=require(_0xbbda('0x0'));var util=require(_0xbbda('0x1'));var path=require('path');var timeout=require(_0xbbda('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xbbda('0x3'));var auth=require(_0xbbda('0x4'));var interaction=require(_0xbbda('0x5'));var config=require(_0xbbda('0x6'));var controller=require(_0xbbda('0x7'));router['get']('/',auth[_0xbbda('0x8')](),controller[_0xbbda('0x9')]);router['get'](_0xbbda('0xa'),auth[_0xbbda('0x8')](),controller[_0xbbda('0xb')]);router[_0xbbda('0xc')](_0xbbda('0xd'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xbbda('0x8')](),controller[_0xbbda('0xe')]);router[_0xbbda('0xf')](_0xbbda('0xd'),auth[_0xbbda('0x8')](),controller[_0xbbda('0x10')]);router[_0xbbda('0x11')](_0xbbda('0xd'),auth[_0xbbda('0x8')](),controller[_0xbbda('0x12')]);module[_0xbbda('0x13')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 8122503..c7aefb3 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 _0xed3c=['join','getDataValue','sequelize','exports','STRING','BOOLEAN','crudPermissions'];(function(_0xf49353,_0x35d0b9){var _0x5e06a7=function(_0x140ae8){while(--_0x140ae8){_0xf49353['push'](_0xf49353['shift']());}};_0x5e06a7(++_0x35d0b9);}(_0xed3c,0x1a6));var _0xced3=function(_0x538fd8,_0x24ed11){_0x538fd8=_0x538fd8-0x0;var _0x279fb4=_0xed3c[_0x538fd8];return _0x279fb4;};'use strict';var Sequelize=require(_0xced3('0x0'));module[_0xced3('0x1')]={'name':{'type':Sequelize[_0xced3('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0xced3('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0xced3('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xced3('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xced3('0x2')],'set':function(_0x5f03e0){this['setDataValue'](_0xced3('0x4'),_0x5f03e0?_0x5f03e0[_0xced3('0x5')](''):[]);},'get':function(){return this[_0xced3('0x6')](_0xced3('0x4'))?this['getDataValue']('crudPermissions')['split'](''):[];}}}; \ No newline at end of file +var _0xed3c=['join','getDataValue','sequelize','exports','STRING','BOOLEAN','crudPermissions'];(function(_0x2ca4b7,_0x21738d){var _0x3ffbc3=function(_0x56f873){while(--_0x56f873){_0x2ca4b7['push'](_0x2ca4b7['shift']());}};_0x3ffbc3(++_0x21738d);}(_0xed3c,0x1a6));var _0xced3=function(_0x4bf814,_0x431c38){_0x4bf814=_0x4bf814-0x0;var _0xd4452c=_0xed3c[_0x4bf814];return _0xd4452c;};'use strict';var Sequelize=require(_0xced3('0x0'));module[_0xced3('0x1')]={'name':{'type':Sequelize[_0xced3('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0xced3('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0xced3('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xced3('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xced3('0x2')],'set':function(_0x5f03e0){this['setDataValue'](_0xced3('0x4'),_0x5f03e0?_0x5f03e0[_0xced3('0x5')](''):[]);},'get':function(){return this[_0xced3('0x6')](_0xced3('0x4'))?this['getDataValue']('crudPermissions')['split'](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 6304688..4689528 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 _0xb722=['fieldName','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','find','create','body','params','destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','end','stack','name','send','index','UserProfileSection'];(function(_0x52fb27,_0x125bf0){var _0x40c706=function(_0x327747){while(--_0x327747){_0x52fb27['push'](_0x52fb27['shift']());}};_0x40c706(++_0x125bf0);}(_0xb722,0x198));var _0x2b72=function(_0x458800,_0x38e233){_0x458800=_0x458800-0x0;var _0x389cc6=_0xb722[_0x458800];return _0x389cc6;};'use strict';var emlformat=require(_0x2b72('0x0'));var rimraf=require(_0x2b72('0x1'));var zipdir=require(_0x2b72('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2b72('0x3'));var moment=require(_0x2b72('0x4'));var BPromise=require(_0x2b72('0x5'));var Mustache=require(_0x2b72('0x6'));var util=require(_0x2b72('0x7'));var path=require(_0x2b72('0x8'));var sox=require(_0x2b72('0x9'));var csv=require(_0x2b72('0xa'));var ejs=require(_0x2b72('0xb'));var fs=require('fs');var fs_extra=require(_0x2b72('0xc'));var _=require(_0x2b72('0xd'));var squel=require(_0x2b72('0xe'));var crypto=require('crypto');var jsforce=require(_0x2b72('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x2b72('0xa'));var querystring=require('querystring');var Papa=require(_0x2b72('0x10'));var Redis=require('ioredis');var authService=require(_0x2b72('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x2b72('0x12'));var hardwareService=require(_0x2b72('0x13'));var logger=require('../../config/logger')(_0x2b72('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2b72('0x15'));var db=require(_0x2b72('0x16'))['db'];function respondWithStatusCode(_0x10158f,_0x41fe44){_0x41fe44=_0x41fe44||0xcc;return function(_0x5bf287){if(_0x5bf287){return _0x10158f[_0x2b72('0x17')](_0x41fe44);}return _0x10158f[_0x2b72('0x18')](_0x41fe44)['end']();};}function respondWithResult(_0xc3c8ea,_0x41e699){_0x41e699=_0x41e699||0xc8;return function(_0x3ca389){if(_0x3ca389){return _0xc3c8ea[_0x2b72('0x18')](_0x41e699)[_0x2b72('0x19')](_0x3ca389);}};}function respondWithFilteredResult(_0x348a93,_0x187b7e){return function(_0x1e9543){if(_0x1e9543){var _0x1ed1ae=typeof _0x187b7e['offset']===_0x2b72('0x1a')&&typeof _0x187b7e[_0x2b72('0x1b')]==='undefined';var _0x3d07dc=_0x1e9543[_0x2b72('0x1c')];var _0x29415f=_0x1ed1ae?0x0:_0x187b7e[_0x2b72('0x1d')];var _0x1c1214=_0x1ed1ae?_0x1e9543[_0x2b72('0x1c')]:_0x187b7e[_0x2b72('0x1d')]+_0x187b7e['limit'];var _0x5494a2;if(_0x1c1214>=_0x3d07dc){_0x1c1214=_0x3d07dc;_0x5494a2=0xc8;}else{_0x5494a2=0xce;}_0x348a93[_0x2b72('0x18')](_0x5494a2);return _0x348a93['set'](_0x2b72('0x1e'),_0x29415f+'-'+_0x1c1214+'/'+_0x3d07dc)[_0x2b72('0x19')](_0x1e9543);}return null;};}function patchUpdates(_0x472251){return function(_0x10abc5){try{jsonpatch[_0x2b72('0x1f')](_0x10abc5,_0x472251,!![]);}catch(_0x4c7396){return BPromise[_0x2b72('0x20')](_0x4c7396);}return _0x10abc5[_0x2b72('0x21')]();};}function saveUpdates(_0x1509d1,_0x3f8de8){return function(_0x42cf68){if(_0x42cf68){return _0x42cf68[_0x2b72('0x22')](_0x1509d1)[_0x2b72('0x23')](function(_0x1fc6ac){return _0x1fc6ac;});}return null;};}function removeEntity(_0x114c68,_0x140322){return function(_0x2fe9d3){if(_0x2fe9d3){return _0x2fe9d3['destroy']()[_0x2b72('0x23')](function(){_0x114c68[_0x2b72('0x18')](0xcc)[_0x2b72('0x24')]();});}};}function handleEntityNotFound(_0x4f3fac,_0x38c5e5){return function(_0x1c1e8a){if(!_0x1c1e8a){_0x4f3fac[_0x2b72('0x17')](0x194);}return _0x1c1e8a;};}function handleError(_0x3ae020,_0x314050){_0x314050=_0x314050||0x1f4;return function(_0x240e57){logger['error'](_0x240e57[_0x2b72('0x25')]);if(_0x240e57[_0x2b72('0x26')]){delete _0x240e57[_0x2b72('0x26')];}_0x3ae020[_0x2b72('0x18')](_0x314050)[_0x2b72('0x27')](_0x240e57);};}exports[_0x2b72('0x28')]=function(_0xc735e2,_0x23eaa7){var _0x514a35={},_0x41a33a={},_0x46f67f={'count':0x0,'rows':[]};var _0xb3a33c=_['map'](db[_0x2b72('0x29')]['rawAttributes'],function(_0x1a4efa){return{'name':_0x1a4efa[_0x2b72('0x2a')],'type':_0x1a4efa['type'][_0x2b72('0x2b')]};});_0x41a33a['model']=_[_0x2b72('0x2c')](_0xb3a33c,_0x2b72('0x26'));_0x41a33a[_0x2b72('0x2d')]=_[_0x2b72('0x2e')](_0xc735e2[_0x2b72('0x2d')]);_0x41a33a[_0x2b72('0x2f')]=_[_0x2b72('0x30')](_0x41a33a[_0x2b72('0x31')],_0x41a33a[_0x2b72('0x2d')]);_0x514a35[_0x2b72('0x32')]=_[_0x2b72('0x30')](_0x41a33a[_0x2b72('0x31')],qs[_0x2b72('0x33')](_0xc735e2[_0x2b72('0x2d')]['fields']));_0x514a35[_0x2b72('0x32')]=_0x514a35[_0x2b72('0x32')][_0x2b72('0x34')]?_0x514a35[_0x2b72('0x32')]:_0x41a33a[_0x2b72('0x31')];if(!_0xc735e2['query'][_0x2b72('0x35')](_0x2b72('0x36'))){_0x514a35[_0x2b72('0x1b')]=qs['limit'](_0xc735e2['query'][_0x2b72('0x1b')]);_0x514a35[_0x2b72('0x1d')]=qs[_0x2b72('0x1d')](_0xc735e2[_0x2b72('0x2d')][_0x2b72('0x1d')]);}_0x514a35[_0x2b72('0x37')]=qs[_0x2b72('0x38')](_0xc735e2['query'][_0x2b72('0x38')]);_0x514a35[_0x2b72('0x39')]=qs['filters'](_[_0x2b72('0x3a')](_0xc735e2['query'],_0x41a33a[_0x2b72('0x2f')]),_0xb3a33c);if(_0xc735e2[_0x2b72('0x2d')]['filter']){_0x514a35[_0x2b72('0x39')]=_[_0x2b72('0x3b')](_0x514a35[_0x2b72('0x39')],{'$or':_[_0x2b72('0x2c')](_0xb3a33c,function(_0x50e550){if(_0x50e550[_0x2b72('0x3c')]!==_0x2b72('0x3d')){var _0xdbdc1={};_0xdbdc1[_0x50e550['name']]={'$like':'%'+_0xc735e2[_0x2b72('0x2d')][_0x2b72('0x3e')]+'%'};return _0xdbdc1;}})});}_0x514a35=_[_0x2b72('0x3b')]({},_0x514a35,_0xc735e2[_0x2b72('0x3f')]);var _0x24fced={'where':_0x514a35[_0x2b72('0x39')]};return db[_0x2b72('0x29')][_0x2b72('0x1c')](_0x24fced)[_0x2b72('0x23')](function(_0x3f03ab){_0x46f67f['count']=_0x3f03ab;if(_0xc735e2[_0x2b72('0x2d')][_0x2b72('0x40')]){_0x514a35[_0x2b72('0x41')]=[{'all':!![]}];}return db[_0x2b72('0x29')][_0x2b72('0x42')](_0x514a35);})['then'](function(_0x227123){_0x46f67f[_0x2b72('0x43')]=_0x227123;return _0x46f67f;})[_0x2b72('0x23')](respondWithFilteredResult(_0x23eaa7,_0x514a35))[_0x2b72('0x44')](handleError(_0x23eaa7,null));};exports['show']=function(_0x2c3c52,_0x14c30a){var _0x5741df={'raw':![],'where':{'id':_0x2c3c52['params']['id']}},_0xacf161={};_0xacf161[_0x2b72('0x31')]=_[_0x2b72('0x2e')](db[_0x2b72('0x29')]['rawAttributes']);_0xacf161['query']=_[_0x2b72('0x2e')](_0x2c3c52[_0x2b72('0x2d')]);_0xacf161[_0x2b72('0x2f')]=_[_0x2b72('0x30')](_0xacf161[_0x2b72('0x31')],_0xacf161[_0x2b72('0x2d')]);_0x5741df[_0x2b72('0x32')]=_['intersection'](_0xacf161[_0x2b72('0x31')],qs[_0x2b72('0x33')](_0x2c3c52[_0x2b72('0x2d')][_0x2b72('0x33')]));_0x5741df[_0x2b72('0x32')]=_0x5741df[_0x2b72('0x32')][_0x2b72('0x34')]?_0x5741df[_0x2b72('0x32')]:_0xacf161[_0x2b72('0x31')];if(_0x2c3c52[_0x2b72('0x2d')][_0x2b72('0x40')]){_0x5741df[_0x2b72('0x41')]=[{'all':!![]}];}_0x5741df=_['merge']({},_0x5741df,_0x2c3c52['options']);return db[_0x2b72('0x29')][_0x2b72('0x45')](_0x5741df)['then'](handleEntityNotFound(_0x14c30a,null))['then'](respondWithResult(_0x14c30a,null))[_0x2b72('0x44')](handleError(_0x14c30a,null));};exports['create']=function(_0x23e668,_0x3e59f7){return db[_0x2b72('0x29')][_0x2b72('0x46')](_0x23e668[_0x2b72('0x47')],{})[_0x2b72('0x23')](respondWithResult(_0x3e59f7,0xc9))[_0x2b72('0x44')](handleError(_0x3e59f7,null));};exports['update']=function(_0x8a9891,_0x7985c1){if(_0x8a9891[_0x2b72('0x47')]['id']){delete _0x8a9891[_0x2b72('0x47')]['id'];}return db[_0x2b72('0x29')]['find']({'where':{'id':_0x8a9891[_0x2b72('0x48')]['id']}})[_0x2b72('0x23')](handleEntityNotFound(_0x7985c1,null))[_0x2b72('0x23')](saveUpdates(_0x8a9891[_0x2b72('0x47')],null))[_0x2b72('0x23')](respondWithResult(_0x7985c1,null))[_0x2b72('0x44')](handleError(_0x7985c1,null));};exports[_0x2b72('0x49')]=function(_0x39ec13,_0x327d7d){return db['UserProfileSection']['find']({'where':{'id':_0x39ec13[_0x2b72('0x48')]['id']}})[_0x2b72('0x23')](handleEntityNotFound(_0x327d7d,null))['then'](removeEntity(_0x327d7d,null))[_0x2b72('0x44')](handleError(_0x327d7d,null));};exports['describe']=function(_0x3b4849,_0x2d6d1e){return db[_0x2b72('0x29')][_0x2b72('0x4a')]()['then'](respondWithResult(_0x2d6d1e,null))[_0x2b72('0x44')](handleError(_0x2d6d1e,null));}; \ No newline at end of file +var _0x39d9=['find','create','body','params','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','destroy','sendStatus','name','UserProfileSection','fieldName','key','map','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','keys','rawAttributes','fields'];(function(_0x21db4a,_0x32c04c){var _0x28e277=function(_0x26b3d8){while(--_0x26b3d8){_0x21db4a['push'](_0x21db4a['shift']());}};_0x28e277(++_0x32c04c);}(_0x39d9,0x168));var _0x939d=function(_0x592181,_0x11318e){_0x592181=_0x592181-0x0;var _0x5ec95c=_0x39d9[_0x592181];return _0x5ec95c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x939d('0x0'));var zipdir=require(_0x939d('0x1'));var jsonpatch=require(_0x939d('0x2'));var rp=require('request-promise');var moment=require(_0x939d('0x3'));var BPromise=require(_0x939d('0x4'));var Mustache=require(_0x939d('0x5'));var util=require(_0x939d('0x6'));var path=require(_0x939d('0x7'));var sox=require(_0x939d('0x8'));var csv=require(_0x939d('0x9'));var ejs=require(_0x939d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x939d('0xb'));var squel=require(_0x939d('0xc'));var crypto=require(_0x939d('0xd'));var jsforce=require(_0x939d('0xe'));var deskjs=require(_0x939d('0xf'));var toCsv=require(_0x939d('0x9'));var querystring=require(_0x939d('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x939d('0x11'));var logger=require(_0x939d('0x12'))(_0x939d('0x13'));var utils=require(_0x939d('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x939d('0x15'))['db'];function respondWithStatusCode(_0x13439e,_0xf4d01f){_0xf4d01f=_0xf4d01f||0xcc;return function(_0x1ccbf0){if(_0x1ccbf0){return _0x13439e['sendStatus'](_0xf4d01f);}return _0x13439e[_0x939d('0x16')](_0xf4d01f)[_0x939d('0x17')]();};}function respondWithResult(_0x3e6a35,_0x203477){_0x203477=_0x203477||0xc8;return function(_0x458de8){if(_0x458de8){return _0x3e6a35[_0x939d('0x16')](_0x203477)[_0x939d('0x18')](_0x458de8);}};}function respondWithFilteredResult(_0x59a23c,_0x3b45e7){return function(_0x2300b2){if(_0x2300b2){var _0x52430e=typeof _0x3b45e7['offset']===_0x939d('0x19')&&typeof _0x3b45e7[_0x939d('0x1a')]===_0x939d('0x19');var _0x4457e6=_0x2300b2[_0x939d('0x1b')];var _0x1e1073=_0x52430e?0x0:_0x3b45e7[_0x939d('0x1c')];var _0x4e3f6f=_0x52430e?_0x2300b2['count']:_0x3b45e7['offset']+_0x3b45e7[_0x939d('0x1a')];var _0x163ff6;if(_0x4e3f6f>=_0x4457e6){_0x4e3f6f=_0x4457e6;_0x163ff6=0xc8;}else{_0x163ff6=0xce;}_0x59a23c[_0x939d('0x16')](_0x163ff6);return _0x59a23c[_0x939d('0x1d')](_0x939d('0x1e'),_0x1e1073+'-'+_0x4e3f6f+'/'+_0x4457e6)[_0x939d('0x18')](_0x2300b2);}return null;};}function patchUpdates(_0x103a9f){return function(_0x5dec2c){try{jsonpatch[_0x939d('0x1f')](_0x5dec2c,_0x103a9f,!![]);}catch(_0x42574c){return BPromise['reject'](_0x42574c);}return _0x5dec2c['save']();};}function saveUpdates(_0x52eb36,_0x2b9f18){return function(_0x53f176){if(_0x53f176){return _0x53f176[_0x939d('0x20')](_0x52eb36)[_0x939d('0x21')](function(_0x35e265){return _0x35e265;});}return null;};}function removeEntity(_0x398017,_0x3a4bdf){return function(_0x21634d){if(_0x21634d){return _0x21634d[_0x939d('0x22')]()[_0x939d('0x21')](function(){_0x398017[_0x939d('0x16')](0xcc)[_0x939d('0x17')]();});}};}function handleEntityNotFound(_0x3f3c27,_0x1e7d98){return function(_0x200161){if(!_0x200161){_0x3f3c27[_0x939d('0x23')](0x194);}return _0x200161;};}function handleError(_0x5697e1,_0x3a3feb){_0x3a3feb=_0x3a3feb||0x1f4;return function(_0x3b555e){logger['error'](_0x3b555e['stack']);if(_0x3b555e[_0x939d('0x24')]){delete _0x3b555e[_0x939d('0x24')];}_0x5697e1[_0x939d('0x16')](_0x3a3feb)['send'](_0x3b555e);};}exports['index']=function(_0x234b18,_0xde36f0){var _0x11222f={},_0x4ce9f2={},_0x118f2a={'count':0x0,'rows':[]};var _0x547e51=_['map'](db[_0x939d('0x25')]['rawAttributes'],function(_0x17e9e2){return{'name':_0x17e9e2[_0x939d('0x26')],'type':_0x17e9e2['type'][_0x939d('0x27')]};});_0x4ce9f2['model']=_[_0x939d('0x28')](_0x547e51,_0x939d('0x24'));_0x4ce9f2[_0x939d('0x29')]=_['keys'](_0x234b18[_0x939d('0x29')]);_0x4ce9f2[_0x939d('0x2a')]=_[_0x939d('0x2b')](_0x4ce9f2[_0x939d('0x2c')],_0x4ce9f2[_0x939d('0x29')]);_0x11222f[_0x939d('0x2d')]=_['intersection'](_0x4ce9f2[_0x939d('0x2c')],qs['fields'](_0x234b18[_0x939d('0x29')]['fields']));_0x11222f[_0x939d('0x2d')]=_0x11222f[_0x939d('0x2d')][_0x939d('0x2e')]?_0x11222f[_0x939d('0x2d')]:_0x4ce9f2[_0x939d('0x2c')];if(!_0x234b18[_0x939d('0x29')][_0x939d('0x2f')](_0x939d('0x30'))){_0x11222f[_0x939d('0x1a')]=qs['limit'](_0x234b18[_0x939d('0x29')][_0x939d('0x1a')]);_0x11222f[_0x939d('0x1c')]=qs[_0x939d('0x1c')](_0x234b18['query']['offset']);}_0x11222f[_0x939d('0x31')]=qs[_0x939d('0x32')](_0x234b18[_0x939d('0x29')][_0x939d('0x32')]);_0x11222f[_0x939d('0x33')]=qs[_0x939d('0x2a')](_[_0x939d('0x34')](_0x234b18[_0x939d('0x29')],_0x4ce9f2['filters']),_0x547e51);if(_0x234b18[_0x939d('0x29')]['filter']){_0x11222f[_0x939d('0x33')]=_[_0x939d('0x35')](_0x11222f[_0x939d('0x33')],{'$or':_[_0x939d('0x28')](_0x547e51,function(_0x41542f){if(_0x41542f[_0x939d('0x36')]!==_0x939d('0x37')){var _0x5d3e20={};_0x5d3e20[_0x41542f[_0x939d('0x24')]]={'$like':'%'+_0x234b18[_0x939d('0x29')][_0x939d('0x38')]+'%'};return _0x5d3e20;}})});}_0x11222f=_['merge']({},_0x11222f,_0x234b18[_0x939d('0x39')]);var _0x4daa1b={'where':_0x11222f[_0x939d('0x33')]};return db[_0x939d('0x25')][_0x939d('0x1b')](_0x4daa1b)[_0x939d('0x21')](function(_0x510c20){_0x118f2a[_0x939d('0x1b')]=_0x510c20;if(_0x234b18[_0x939d('0x29')][_0x939d('0x3a')]){_0x11222f['include']=[{'all':!![]}];}return db['UserProfileSection'][_0x939d('0x3b')](_0x11222f);})[_0x939d('0x21')](function(_0x2e89c6){_0x118f2a[_0x939d('0x3c')]=_0x2e89c6;return _0x118f2a;})['then'](respondWithFilteredResult(_0xde36f0,_0x11222f))[_0x939d('0x3d')](handleError(_0xde36f0,null));};exports[_0x939d('0x3e')]=function(_0x5b5b00,_0x341f5b){var _0x5380c3={'raw':![],'where':{'id':_0x5b5b00['params']['id']}},_0x23d5cd={};_0x23d5cd[_0x939d('0x2c')]=_[_0x939d('0x3f')](db[_0x939d('0x25')][_0x939d('0x40')]);_0x23d5cd['query']=_[_0x939d('0x3f')](_0x5b5b00[_0x939d('0x29')]);_0x23d5cd[_0x939d('0x2a')]=_[_0x939d('0x2b')](_0x23d5cd[_0x939d('0x2c')],_0x23d5cd[_0x939d('0x29')]);_0x5380c3[_0x939d('0x2d')]=_['intersection'](_0x23d5cd['model'],qs[_0x939d('0x41')](_0x5b5b00['query'][_0x939d('0x41')]));_0x5380c3[_0x939d('0x2d')]=_0x5380c3['attributes']['length']?_0x5380c3[_0x939d('0x2d')]:_0x23d5cd[_0x939d('0x2c')];if(_0x5b5b00[_0x939d('0x29')]['includeAll']){_0x5380c3['include']=[{'all':!![]}];}_0x5380c3=_['merge']({},_0x5380c3,_0x5b5b00[_0x939d('0x39')]);return db[_0x939d('0x25')][_0x939d('0x42')](_0x5380c3)[_0x939d('0x21')](handleEntityNotFound(_0x341f5b,null))[_0x939d('0x21')](respondWithResult(_0x341f5b,null))[_0x939d('0x3d')](handleError(_0x341f5b,null));};exports[_0x939d('0x43')]=function(_0x4e16d7,_0x337050){return db[_0x939d('0x25')][_0x939d('0x43')](_0x4e16d7['body'],{})[_0x939d('0x21')](respondWithResult(_0x337050,0xc9))[_0x939d('0x3d')](handleError(_0x337050,null));};exports['update']=function(_0x5c4f80,_0x5a8da0){if(_0x5c4f80[_0x939d('0x44')]['id']){delete _0x5c4f80[_0x939d('0x44')]['id'];}return db[_0x939d('0x25')][_0x939d('0x42')]({'where':{'id':_0x5c4f80['params']['id']}})[_0x939d('0x21')](handleEntityNotFound(_0x5a8da0,null))[_0x939d('0x21')](saveUpdates(_0x5c4f80['body'],null))[_0x939d('0x21')](respondWithResult(_0x5a8da0,null))[_0x939d('0x3d')](handleError(_0x5a8da0,null));};exports['destroy']=function(_0x18d5ae,_0x3f8650){return db[_0x939d('0x25')][_0x939d('0x42')]({'where':{'id':_0x18d5ae[_0x939d('0x45')]['id']}})[_0x939d('0x21')](handleEntityNotFound(_0x3f8650,null))[_0x939d('0x21')](removeEntity(_0x3f8650,null))[_0x939d('0x3d')](handleError(_0x3f8650,null));};exports[_0x939d('0x46')]=function(_0x1269b5,_0x4e899a){return db[_0x939d('0x25')][_0x939d('0x46')]()[_0x939d('0x21')](respondWithResult(_0x4e899a,null))[_0x939d('0x3d')](handleError(_0x4e899a,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index c5d5cf4..3ac0cad 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 _0x6aed=['path','rimraf','../../config/environment','./userProfileSection.attributes','define','UserProfileSection','user_profile_has_sections','userProfileId','../../config/logger','api','bluebird'];(function(_0x57195c,_0x4b7ac6){var _0x2d1fe8=function(_0x12050a){while(--_0x12050a){_0x57195c['push'](_0x57195c['shift']());}};_0x2d1fe8(++_0x4b7ac6);}(_0x6aed,0x81));var _0xd6ae=function(_0x4faa5f,_0x336d48){_0x4faa5f=_0x4faa5f-0x0;var _0xad3fcb=_0x6aed[_0x4faa5f];return _0xad3fcb;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd6ae('0x0'))(_0xd6ae('0x1'));var moment=require('moment');var BPromise=require(_0xd6ae('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd6ae('0x3'));var rimraf=require(_0xd6ae('0x4'));var config=require(_0xd6ae('0x5'));var attributes=require(_0xd6ae('0x6'));module['exports']=function(_0x40d8c7,_0x446683){return _0x40d8c7[_0xd6ae('0x7')](_0xd6ae('0x8'),attributes,{'tableName':_0xd6ae('0x9'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':['sectionId',_0xd6ae('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0c40=['userProfileId','util','api','moment','bluebird','rimraf','../../config/environment','exports','define','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId'];(function(_0x46b0f6,_0x5db43b){var _0x5cfdad=function(_0x92fbb8){while(--_0x92fbb8){_0x46b0f6['push'](_0x46b0f6['shift']());}};_0x5cfdad(++_0x5db43b);}(_0x0c40,0x1ef));var _0x00c4=function(_0x52e2f8,_0x4f22bd){_0x52e2f8=_0x52e2f8-0x0;var _0x587362=_0x0c40[_0x52e2f8];return _0x587362;};'use strict';var _=require('lodash');var util=require(_0x00c4('0x0'));var logger=require('../../config/logger')(_0x00c4('0x1'));var moment=require(_0x00c4('0x2'));var BPromise=require(_0x00c4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x00c4('0x4'));var config=require(_0x00c4('0x5'));var attributes=require('./userProfileSection.attributes');module[_0x00c4('0x6')]=function(_0x1ae347,_0x3161d3){return _0x1ae347[_0x00c4('0x7')](_0x00c4('0x8'),attributes,{'tableName':_0x00c4('0x9'),'paranoid':![],'indexes':[{'name':_0x00c4('0xa'),'fields':[_0x00c4('0xb'),_0x00c4('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index e2cd6c7..f72d364 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 _0xe680=['UserProfileSection,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','UserProfileSection,\x20%s,\x20%s','request\x20sent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe680,0xcf));var _0x0e68=function(_0x259dbe,_0x1cb9f4){_0x259dbe=_0x259dbe-0x0;var _0x2e0f46=_0xe680[_0x259dbe];return _0x2e0f46;};'use strict';var _=require('lodash');var util=require(_0x0e68('0x0'));var moment=require(_0x0e68('0x1'));var BPromise=require(_0x0e68('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0e68('0x3'))['db'];var utils=require(_0x0e68('0x4'));var logger=require(_0x0e68('0x5'))(_0x0e68('0x6'));var config=require(_0x0e68('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0e68('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xb11dc5,_0x439022,_0x175653){return new BPromise(function(_0x3b2099,_0x215917){return client[_0x0e68('0x9')](_0xb11dc5,_0x175653)[_0x0e68('0xa')](function(_0x5da3df){logger['info'](_0x0e68('0xb'),_0x439022,_0x0e68('0xc'));logger['debug'](_0x0e68('0xd'),_0x439022,_0x0e68('0xc'),JSON['stringify'](_0x5da3df));if(_0x5da3df['error']){if(_0x5da3df[_0x0e68('0xe')][_0x0e68('0xf')]===0x1f4){logger[_0x0e68('0xe')](_0x0e68('0xb'),_0x439022,_0x5da3df[_0x0e68('0xe')][_0x0e68('0x10')]);return _0x215917(_0x5da3df['error'][_0x0e68('0x10')]);}logger[_0x0e68('0xe')]('UserProfileSection,\x20%s,\x20%s',_0x439022,_0x5da3df[_0x0e68('0xe')][_0x0e68('0x10')]);return _0x3b2099(_0x5da3df['error'][_0x0e68('0x10')]);}else{logger[_0x0e68('0x11')](_0x0e68('0xb'),_0x439022,_0x0e68('0xc'));_0x3b2099(_0x5da3df[_0x0e68('0x12')][_0x0e68('0x10')]);}})[_0x0e68('0x13')](function(_0x33beaa){logger[_0x0e68('0xe')](_0x0e68('0xb'),_0x439022,_0x33beaa);_0x215917(_0x33beaa);});});} \ No newline at end of file +var _0xf5fd=['UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','UserProfileSection,\x20%s,\x20%s','request\x20sent'];(function(_0x2d6922,_0x54fb27){var _0x3963a1=function(_0x18760a){while(--_0x18760a){_0x2d6922['push'](_0x2d6922['shift']());}};_0x3963a1(++_0x54fb27);}(_0xf5fd,0xbe));var _0xdf5f=function(_0x17406a,_0x1e2320){_0x17406a=_0x17406a-0x0;var _0x1501ff=_0xf5fd[_0x17406a];return _0x1501ff;};'use strict';var _=require(_0xdf5f('0x0'));var util=require('util');var moment=require(_0xdf5f('0x1'));var BPromise=require(_0xdf5f('0x2'));var rs=require(_0xdf5f('0x3'));var fs=require('fs');var Redis=require(_0xdf5f('0x4'));var db=require(_0xdf5f('0x5'))['db'];var utils=require(_0xdf5f('0x6'));var logger=require(_0xdf5f('0x7'))(_0xdf5f('0x8'));var config=require(_0xdf5f('0x9'));var jayson=require(_0xdf5f('0xa'));var client=jayson[_0xdf5f('0xb')][_0xdf5f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x283e6f,_0x497a42,_0x135b2a){return new BPromise(function(_0x31a792,_0x46c4ef){return client[_0xdf5f('0xd')](_0x283e6f,_0x135b2a)[_0xdf5f('0xe')](function(_0x4bab66){logger['info'](_0xdf5f('0xf'),_0x497a42,_0xdf5f('0x10'));logger['debug'](_0xdf5f('0x11'),_0x497a42,_0xdf5f('0x10'),JSON[_0xdf5f('0x12')](_0x4bab66));if(_0x4bab66[_0xdf5f('0x13')]){if(_0x4bab66[_0xdf5f('0x13')]['code']===0x1f4){logger[_0xdf5f('0x13')](_0xdf5f('0xf'),_0x497a42,_0x4bab66[_0xdf5f('0x13')][_0xdf5f('0x14')]);return _0x46c4ef(_0x4bab66[_0xdf5f('0x13')][_0xdf5f('0x14')]);}logger['error'](_0xdf5f('0xf'),_0x497a42,_0x4bab66[_0xdf5f('0x13')][_0xdf5f('0x14')]);return _0x31a792(_0x4bab66['error'][_0xdf5f('0x14')]);}else{logger[_0xdf5f('0x15')](_0xdf5f('0xf'),_0x497a42,_0xdf5f('0x10'));_0x31a792(_0x4bab66['result'][_0xdf5f('0x14')]);}})[_0xdf5f('0x16')](function(_0x29c268){logger['error'](_0xdf5f('0xf'),_0x497a42,_0x29c268);_0x46c4ef(_0x29c268);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 3115a1a..4013eda 100644 --- a/server/api/userSmsQueue/index.js +++ b/server/api/userSmsQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x3ee4d1,_0x35cbfd){var _0x24b28a=function(_0x5a60d4){while(--_0x5a60d4){_0x3ee4d1['push'](_0x3ee4d1['shift']());}};_0x24b28a(++_0x35cbfd);}(_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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x524e23,_0x1e2aa7){var _0x231413=function(_0x22ac35){while(--_0x22ac35){_0x524e23['push'](_0x524e23['shift']());}};_0x231413(++_0x1e2aa7);}(_0x9c44,0x178));var _0x49c4=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x9c44[_0x1d9aa0];return _0x226868;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index a38a432..1bf5328 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 _0xb22e=['sequelize','exports','INTEGER'];(function(_0x4be8ba,_0x5d10ba){var _0x1af822=function(_0x40ed8a){while(--_0x40ed8a){_0x4be8ba['push'](_0x4be8ba['shift']());}};_0x1af822(++_0x5d10ba);}(_0xb22e,0x81));var _0xeb22=function(_0x40a2a3,_0x22774d){_0x40a2a3=_0x40a2a3-0x0;var _0x5d9c32=_0xb22e[_0x40a2a3];return _0x5d9c32;};'use strict';var Sequelize=require(_0xeb22('0x0'));module[_0xeb22('0x1')]={'penalty':{'type':Sequelize[_0xeb22('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x34aa=['INTEGER','sequelize'];(function(_0x2b4efb,_0x1a8626){var _0x5ca6ac=function(_0x386c28){while(--_0x386c28){_0x2b4efb['push'](_0x2b4efb['shift']());}};_0x5ca6ac(++_0x1a8626);}(_0x34aa,0x171));var _0xa34a=function(_0x29df9a,_0x42aff3){_0x29df9a=_0x29df9a-0x0;var _0x3a8e96=_0x34aa[_0x29df9a];return _0x3a8e96;};'use strict';var Sequelize=require(_0xa34a('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xa34a('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index efe4251..9712cff 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 _0xe3da=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userSmsQueue.attributes','exports','define','UserSmsQueue','lodash'];(function(_0x1d291d,_0x17314a){var _0x44cc4e=function(_0x38d29f){while(--_0x38d29f){_0x1d291d['push'](_0x1d291d['shift']());}};_0x44cc4e(++_0x17314a);}(_0xe3da,0x1cd));var _0xae3d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe3da[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xae3d('0x0'));var util=require(_0xae3d('0x1'));var logger=require(_0xae3d('0x2'))(_0xae3d('0x3'));var moment=require(_0xae3d('0x4'));var BPromise=require(_0xae3d('0x5'));var rp=require(_0xae3d('0x6'));var fs=require('fs');var path=require(_0xae3d('0x7'));var rimraf=require(_0xae3d('0x8'));var config=require(_0xae3d('0x9'));var attributes=require(_0xae3d('0xa'));module[_0xae3d('0xb')]=function(_0xa9a1a,_0xa54808){return _0xa9a1a[_0xae3d('0xc')](_0xae3d('0xd'),attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa46e=['api','moment','bluebird','path','../../config/environment','exports','define','user_has_sms_queues','lodash','util'];(function(_0x51c52b,_0x147712){var _0x581ce3=function(_0x2e61a0){while(--_0x2e61a0){_0x51c52b['push'](_0x51c52b['shift']());}};_0x581ce3(++_0x147712);}(_0xa46e,0x8a));var _0xea46=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0xa46e[_0x160c73];return _0xd9302;};'use strict';var _=require(_0xea46('0x0'));var util=require(_0xea46('0x1'));var logger=require('../../config/logger')(_0xea46('0x2'));var moment=require(_0xea46('0x3'));var BPromise=require(_0xea46('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xea46('0x5'));var rimraf=require('rimraf');var config=require(_0xea46('0x6'));var attributes=require('./userSmsQueue.attributes');module[_0xea46('0x7')]=function(_0x528404,_0x10bee5){return _0x528404[_0xea46('0x8')]('UserSmsQueue',attributes,{'tableName':_0xea46('0x9'),'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 2fab709..90d7ec1 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 _0x9a92=['message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserSmsQueue,\x20%s,\x20%s'];(function(_0x3d8701,_0x23be11){var _0x4928fd=function(_0x28a0d9){while(--_0x28a0d9){_0x3d8701['push'](_0x3d8701['shift']());}};_0x4928fd(++_0x23be11);}(_0x9a92,0x16a));var _0x29a9=function(_0x3878e0,_0xec1dcf){_0x3878e0=_0x3878e0-0x0;var _0x171b25=_0x9a92[_0x3878e0];return _0x171b25;};'use strict';var _=require(_0x29a9('0x0'));var util=require('util');var moment=require(_0x29a9('0x1'));var BPromise=require(_0x29a9('0x2'));var rs=require(_0x29a9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x29a9('0x4'))['db'];var utils=require(_0x29a9('0x5'));var logger=require(_0x29a9('0x6'))(_0x29a9('0x7'));var config=require(_0x29a9('0x8'));var jayson=require(_0x29a9('0x9'));var client=jayson[_0x29a9('0xa')][_0x29a9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x46a0b7,_0x386092,_0x536d96){return new BPromise(function(_0x16bef3,_0x46ebe2){return client[_0x29a9('0xc')](_0x46a0b7,_0x536d96)[_0x29a9('0xd')](function(_0x979b6b){logger[_0x29a9('0xe')]('UserSmsQueue,\x20%s,\x20%s',_0x386092,_0x29a9('0xf'));logger[_0x29a9('0x10')](_0x29a9('0x11'),_0x386092,_0x29a9('0xf'),JSON[_0x29a9('0x12')](_0x979b6b));if(_0x979b6b[_0x29a9('0x13')]){if(_0x979b6b[_0x29a9('0x13')][_0x29a9('0x14')]===0x1f4){logger[_0x29a9('0x13')](_0x29a9('0x15'),_0x386092,_0x979b6b[_0x29a9('0x13')][_0x29a9('0x16')]);return _0x46ebe2(_0x979b6b[_0x29a9('0x13')][_0x29a9('0x16')]);}logger[_0x29a9('0x13')](_0x29a9('0x15'),_0x386092,_0x979b6b[_0x29a9('0x13')][_0x29a9('0x16')]);return _0x16bef3(_0x979b6b['error'][_0x29a9('0x16')]);}else{logger[_0x29a9('0xe')]('UserSmsQueue,\x20%s,\x20%s',_0x386092,_0x29a9('0xf'));_0x16bef3(_0x979b6b[_0x29a9('0x17')][_0x29a9('0x16')]);}})['catch'](function(_0x1f7606){logger[_0x29a9('0x13')](_0x29a9('0x15'),_0x386092,_0x1f7606);_0x46ebe2(_0x1f7606);});});} \ No newline at end of file +var _0x5f0b=['../../config/logger','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','error','UserSmsQueue,\x20%s,\x20%s','message','info','lodash','moment','ioredis','../../mysqldb','../../config/utils'];(function(_0x814d50,_0x2cd605){var _0x211d4d=function(_0x239538){while(--_0x239538){_0x814d50['push'](_0x814d50['shift']());}};_0x211d4d(++_0x2cd605);}(_0x5f0b,0x13e));var _0xb5f0=function(_0x2566e0,_0x18cbc8){_0x2566e0=_0x2566e0-0x0;var _0x4edbaa=_0x5f0b[_0x2566e0];return _0x4edbaa;};'use strict';var _=require(_0xb5f0('0x0'));var util=require('util');var moment=require(_0xb5f0('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb5f0('0x2'));var db=require(_0xb5f0('0x3'))['db'];var utils=require(_0xb5f0('0x4'));var logger=require(_0xb5f0('0x5'))('rpc');var config=require(_0xb5f0('0x6'));var jayson=require(_0xb5f0('0x7'));var client=jayson[_0xb5f0('0x8')][_0xb5f0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4ca487,_0x207938,_0x1925c4){return new BPromise(function(_0x4dadac,_0x5e7202){return client[_0xb5f0('0xa')](_0x4ca487,_0x1925c4)[_0xb5f0('0xb')](function(_0x547646){logger['info']('UserSmsQueue,\x20%s,\x20%s',_0x207938,_0xb5f0('0xc'));logger[_0xb5f0('0xd')](_0xb5f0('0xe'),_0x207938,'request\x20sent',JSON['stringify'](_0x547646));if(_0x547646[_0xb5f0('0xf')]){if(_0x547646[_0xb5f0('0xf')]['code']===0x1f4){logger[_0xb5f0('0xf')](_0xb5f0('0x10'),_0x207938,_0x547646['error'][_0xb5f0('0x11')]);return _0x5e7202(_0x547646[_0xb5f0('0xf')][_0xb5f0('0x11')]);}logger[_0xb5f0('0xf')]('UserSmsQueue,\x20%s,\x20%s',_0x207938,_0x547646[_0xb5f0('0xf')]['message']);return _0x4dadac(_0x547646['error']['message']);}else{logger[_0xb5f0('0x12')]('UserSmsQueue,\x20%s,\x20%s',_0x207938,_0xb5f0('0xc'));_0x4dadac(_0x547646['result'][_0xb5f0('0x11')]);}})['catch'](function(_0x57a731){logger[_0xb5f0('0xf')](_0xb5f0('0x10'),_0x207938,_0x57a731);_0x5e7202(_0x57a731);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index c86c0ca..b95a4aa 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 _0x8743=['INTEGER','sequelize','exports'];(function(_0x484494,_0x471d0e){var _0x5a2f91=function(_0x229a93){while(--_0x229a93){_0x484494['push'](_0x484494['shift']());}};_0x5a2f91(++_0x471d0e);}(_0x8743,0xa3));var _0x3874=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x8743[_0xc6be3a];return _0x56a310;};'use strict';var Sequelize=require(_0x3874('0x0'));module[_0x3874('0x1')]={'UserId':{'type':Sequelize[_0x3874('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x3874('0x2')]}}; \ No newline at end of file +var _0x37cb=['sequelize'];(function(_0x28b839,_0x3160e8){var _0x489368=function(_0x482f19){while(--_0x482f19){_0x28b839['push'](_0x28b839['shift']());}};_0x489368(++_0x3160e8);}(_0x37cb,0x1b1));var _0xb37c=function(_0x87b0ff,_0x314389){_0x87b0ff=_0x87b0ff-0x0;var _0x3bc0b2=_0x37cb[_0x87b0ff];return _0x3bc0b2;};'use strict';var Sequelize=require(_0xb37c('0x0'));module['exports']={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index 5f8f615..d735719 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(_0x1f5b7f,_0x121acb){var _0x656c72=function(_0x3792b0){while(--_0x3792b0){_0x1f5b7f['push'](_0x1f5b7f['shift']());}};_0x656c72(++_0x121acb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xa9e0[_0x3a6efd];return _0x487b9a;};'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(_0x4657e5,_0xc2375d){var _0x117e1d=function(_0x1dc646){while(--_0x1dc646){_0x4657e5['push'](_0x4657e5['shift']());}};_0x117e1d(++_0xc2375d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 89b7fc1..7b7a0a3 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x2efcd3,_0x5c3bb2){var _0x3c1e3f=function(_0x598bec){while(--_0x598bec){_0x2efcd3['push'](_0x2efcd3['shift']());}};_0x3c1e3f(++_0x5c3bb2);}(_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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x177284,_0xbe383c){var _0x105090=function(_0x17b2d5){while(--_0x17b2d5){_0x177284['push'](_0x177284['shift']());}};_0x105090(++_0xbe383c);}(_0xedd9,0xfc));var _0x9edd=function(_0x58c418,_0x27ba8c){_0x58c418=_0x58c418-0x0;var _0x2d6c32=_0xedd9[_0x58c418];return _0x2d6c32;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index e1d90b7..18183f5 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 _0x33b4=['sequelize','exports','INTEGER'];(function(_0x286a24,_0x7c9872){var _0x5057a2=function(_0x52799b){while(--_0x52799b){_0x286a24['push'](_0x286a24['shift']());}};_0x5057a2(++_0x7c9872);}(_0x33b4,0x81));var _0x433b=function(_0x355a52,_0x536036){_0x355a52=_0x355a52-0x0;var _0xbb3fa=_0x33b4[_0x355a52];return _0xbb3fa;};'use strict';var Sequelize=require(_0x433b('0x0'));module[_0x433b('0x1')]={'penalty':{'type':Sequelize[_0x433b('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd837=['exports'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xd837,0x1a1));var _0x7d83=function(_0x240261,_0x4fe66c){_0x240261=_0x240261-0x0;var _0x45c332=_0xd837[_0x240261];return _0x45c332;};'use strict';var Sequelize=require('sequelize');module[_0x7d83('0x0')]={'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 df86ecf..254d746 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 _0x2b19=['util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define','user_has_voice_queues','lodash'];(function(_0x11b55e,_0x47f1ff){var _0x268a13=function(_0x3dc694){while(--_0x3dc694){_0x11b55e['push'](_0x11b55e['shift']());}};_0x268a13(++_0x47f1ff);}(_0x2b19,0xef));var _0x92b1=function(_0x2f4a21,_0x400a43){_0x2f4a21=_0x2f4a21-0x0;var _0x5497bd=_0x2b19[_0x2f4a21];return _0x5497bd;};'use strict';var _=require(_0x92b1('0x0'));var util=require(_0x92b1('0x1'));var logger=require(_0x92b1('0x2'))('api');var moment=require(_0x92b1('0x3'));var BPromise=require(_0x92b1('0x4'));var rp=require(_0x92b1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x92b1('0x6'));var config=require(_0x92b1('0x7'));var attributes=require(_0x92b1('0x8'));module[_0x92b1('0x9')]=function(_0x138d19,_0x2ad1b7){return _0x138d19[_0x92b1('0xa')]('UserVoiceQueue',attributes,{'tableName':_0x92b1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd246=['bluebird','path','rimraf','../../config/environment','./userVoiceQueue.attributes','UserVoiceQueue','lodash','../../config/logger','api','moment'];(function(_0x1c83c9,_0x2a0efc){var _0x49c840=function(_0x2945e2){while(--_0x2945e2){_0x1c83c9['push'](_0x1c83c9['shift']());}};_0x49c840(++_0x2a0efc);}(_0xd246,0x11e));var _0x6d24=function(_0x259aaf,_0x5dbec1){_0x259aaf=_0x259aaf-0x0;var _0x366663=_0xd246[_0x259aaf];return _0x366663;};'use strict';var _=require(_0x6d24('0x0'));var util=require('util');var logger=require(_0x6d24('0x1'))(_0x6d24('0x2'));var moment=require(_0x6d24('0x3'));var BPromise=require(_0x6d24('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6d24('0x5'));var rimraf=require(_0x6d24('0x6'));var config=require(_0x6d24('0x7'));var attributes=require(_0x6d24('0x8'));module['exports']=function(_0x4fb38d,_0x593baf){return _0x4fb38d['define'](_0x6d24('0x9'),attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.rpc.js b/server/api/userVoiceQueue/userVoiceQueue.rpc.js index aaa54ff..1c0ed5d 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 _0xd90c=['../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x503c8c,_0x45cb2d){var _0x5cd6a3=function(_0x1f4c13){while(--_0x1f4c13){_0x503c8c['push'](_0x503c8c['shift']());}};_0x5cd6a3(++_0x45cb2d);}(_0xd90c,0x8b));var _0xcd90=function(_0x1d537c,_0x2b834d){_0x1d537c=_0x1d537c-0x0;var _0x184fb9=_0xd90c[_0x1d537c];return _0x184fb9;};'use strict';var _=require('lodash');var util=require(_0xcd90('0x0'));var moment=require(_0xcd90('0x1'));var BPromise=require(_0xcd90('0x2'));var rs=require(_0xcd90('0x3'));var fs=require('fs');var Redis=require(_0xcd90('0x4'));var db=require(_0xcd90('0x5'))['db'];var utils=require(_0xcd90('0x6'));var logger=require('../../config/logger')(_0xcd90('0x7'));var config=require(_0xcd90('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xcd90('0x9')][_0xcd90('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3dd2e8,_0x599e4f,_0x3eee65){return new BPromise(function(_0x1f3c09,_0x4be22b){return client[_0xcd90('0xb')](_0x3dd2e8,_0x3eee65)[_0xcd90('0xc')](function(_0xaddb04){logger[_0xcd90('0xd')](_0xcd90('0xe'),_0x599e4f,_0xcd90('0xf'));logger[_0xcd90('0x10')](_0xcd90('0x11'),_0x599e4f,_0xcd90('0xf'),JSON[_0xcd90('0x12')](_0xaddb04));if(_0xaddb04['error']){if(_0xaddb04[_0xcd90('0x13')][_0xcd90('0x14')]===0x1f4){logger['error'](_0xcd90('0xe'),_0x599e4f,_0xaddb04[_0xcd90('0x13')]['message']);return _0x4be22b(_0xaddb04[_0xcd90('0x13')]['message']);}logger[_0xcd90('0x13')](_0xcd90('0xe'),_0x599e4f,_0xaddb04[_0xcd90('0x13')][_0xcd90('0x15')]);return _0x1f3c09(_0xaddb04['error'][_0xcd90('0x15')]);}else{logger['info'](_0xcd90('0xe'),_0x599e4f,_0xcd90('0xf'));_0x1f3c09(_0xaddb04[_0xcd90('0x16')][_0xcd90('0x15')]);}})[_0xcd90('0x17')](function(_0x281897){logger[_0xcd90('0x13')]('UserVoiceQueue,\x20%s,\x20%s',_0x599e4f,_0x281897);_0x4be22b(_0x281897);});});} \ No newline at end of file +var _0xfee7=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x5056fc,_0x4c6291){var _0x3085d0=function(_0x189def){while(--_0x189def){_0x5056fc['push'](_0x5056fc['shift']());}};_0x3085d0(++_0x4c6291);}(_0xfee7,0x7d));var _0x7fee=function(_0x54a98f,_0x46583a){_0x54a98f=_0x54a98f-0x0;var _0x55df9d=_0xfee7[_0x54a98f];return _0x55df9d;};'use strict';var _=require(_0x7fee('0x0'));var util=require('util');var moment=require(_0x7fee('0x1'));var BPromise=require(_0x7fee('0x2'));var rs=require(_0x7fee('0x3'));var fs=require('fs');var Redis=require(_0x7fee('0x4'));var db=require(_0x7fee('0x5'))['db'];var utils=require(_0x7fee('0x6'));var logger=require(_0x7fee('0x7'))(_0x7fee('0x8'));var config=require(_0x7fee('0x9'));var jayson=require(_0x7fee('0xa'));var client=jayson[_0x7fee('0xb')][_0x7fee('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x570029,_0x210742,_0x15f834){return new BPromise(function(_0x26fd4d,_0x1d8394){return client[_0x7fee('0xd')](_0x570029,_0x15f834)[_0x7fee('0xe')](function(_0x281b7f){logger['info'](_0x7fee('0xf'),_0x210742,_0x7fee('0x10'));logger[_0x7fee('0x11')](_0x7fee('0x12'),_0x210742,'request\x20sent',JSON[_0x7fee('0x13')](_0x281b7f));if(_0x281b7f[_0x7fee('0x14')]){if(_0x281b7f[_0x7fee('0x14')][_0x7fee('0x15')]===0x1f4){logger['error'](_0x7fee('0xf'),_0x210742,_0x281b7f[_0x7fee('0x14')][_0x7fee('0x16')]);return _0x1d8394(_0x281b7f[_0x7fee('0x14')][_0x7fee('0x16')]);}logger[_0x7fee('0x14')]('UserVoiceQueue,\x20%s,\x20%s',_0x210742,_0x281b7f[_0x7fee('0x14')][_0x7fee('0x16')]);return _0x26fd4d(_0x281b7f['error'][_0x7fee('0x16')]);}else{logger[_0x7fee('0x17')](_0x7fee('0xf'),_0x210742,'request\x20sent');_0x26fd4d(_0x281b7f[_0x7fee('0x18')][_0x7fee('0x16')]);}})[_0x7fee('0x19')](function(_0x1c01ba){logger['error'](_0x7fee('0xf'),_0x210742,_0x1c01ba);_0x1d8394(_0x1c01ba);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 6e9f397..c1639e9 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x354258,_0x31eb5e){var _0x1cd051=function(_0x476534){while(--_0x476534){_0x354258['push'](_0x354258['shift']());}};_0x1cd051(++_0x31eb5e);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3c4e4c,_0x36ff70){_0x3c4e4c=_0x3c4e4c-0x0;var _0x144a87=_0xcb91[_0x3c4e4c];return _0x144a87;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x35de68,_0x165ef8){var _0xf70815=function(_0x731b8e){while(--_0x731b8e){_0x35de68['push'](_0x35de68['shift']());}};_0xf70815(++_0x165ef8);}(_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/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index a6c3b78..5b11721 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 _0x9670=['sequelize','INTEGER','Required\x20by\x20Asterisk','STRING'];(function(_0x5016b0,_0x2797c3){var _0x519205=function(_0x43daaa){while(--_0x43daaa){_0x5016b0['push'](_0x5016b0['shift']());}};_0x519205(++_0x2797c3);}(_0x9670,0x164));var _0x0967=function(_0x593cd0,_0x1feb0a){_0x593cd0=_0x593cd0-0x0;var _0x435e10=_0x9670[_0x593cd0];return _0x435e10;};'use strict';var Sequelize=require(_0x0967('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x0967('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x0967('0x2')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0x0967('0x2')},'UserId':{'type':Sequelize[_0x0967('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x0967('0x3')],'allowNull':![],'unique':'queue_interface','comment':_0x0967('0x2')},'VoiceQueueId':{'type':Sequelize[_0x0967('0x1')],'allowNull':![]},'interface':{'type':Sequelize[_0x0967('0x3')],'allowNull':![],'unique':'queue_interface','comment':_0x0967('0x2')},'penalty':{'type':Sequelize[_0x0967('0x1')](0xb),'defaultValue':0x0,'comment':_0x0967('0x2')},'paused':{'type':Sequelize[_0x0967('0x1')](0xb),'defaultValue':0x0,'comment':_0x0967('0x2')}}; \ No newline at end of file +var _0x531f=['STRING','queue_interface','sequelize','exports','INTEGER','Required\x20by\x20Asterisk'];(function(_0x3bcf9e,_0x148a5d){var _0x1bb37c=function(_0xcaf5da){while(--_0xcaf5da){_0x3bcf9e['push'](_0x3bcf9e['shift']());}};_0x1bb37c(++_0x148a5d);}(_0x531f,0x16a));var _0xf531=function(_0x4fe496,_0x1d8673){_0x4fe496=_0x4fe496-0x0;var _0x422b24=_0x531f[_0x4fe496];return _0x422b24;};'use strict';var Sequelize=require(_0xf531('0x0'));module[_0xf531('0x1')]={'uniqueid':{'type':Sequelize[_0xf531('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xf531('0x3')},'membername':{'type':Sequelize[_0xf531('0x4')],'allowNull':![],'comment':_0xf531('0x3')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0xf531('0x4')],'allowNull':![],'unique':_0xf531('0x5'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0xf531('0x4')],'allowNull':![],'unique':_0xf531('0x5'),'comment':_0xf531('0x3')},'penalty':{'type':Sequelize[_0xf531('0x2')](0xb),'defaultValue':0x0,'comment':_0xf531('0x3')},'paused':{'type':Sequelize[_0xf531('0x2')](0xb),'defaultValue':0x0,'comment':_0xf531('0x3')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index a658fb4..b1352d7 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 _0xe2ce=['hook','exports','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x28d252,_0x160cb9){var _0x48d8cb=function(_0x2946b4){while(--_0x2946b4){_0x28d252['push'](_0x28d252['shift']());}};_0x48d8cb(++_0x160cb9);}(_0xe2ce,0x1c4));var _0xee2c=function(_0x26b8b5,_0xf5c2c1){_0x26b8b5=_0x26b8b5-0x0;var _0x2150a9=_0xe2ce[_0x26b8b5];return _0x2150a9;};'use strict';var EventEmitter=require(_0xee2c('0x0'));var UserVoiceQueueRt=require(_0xee2c('0x1'))['db'][_0xee2c('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xee2c('0x3')](0x0);var events={'afterCreate':_0xee2c('0x4'),'afterUpdate':_0xee2c('0x5'),'afterDestroy':'remove'};function emitEvent(_0x1f092e){return function(_0x2db98f,_0x1f3ae1,_0x1f9141){UserVoiceQueueRtEvents['emit'](_0x1f092e+':'+_0x2db98f['id'],_0x2db98f);UserVoiceQueueRtEvents[_0xee2c('0x6')](_0x1f092e,_0x2db98f);_0x1f9141(null);};}for(var e in events){if(events[_0xee2c('0x7')](e)){var event=events[e];UserVoiceQueueRt[_0xee2c('0x8')](e,emitEvent(event));}}module[_0xee2c('0x9')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x7676=['save','remove','emit','hasOwnProperty','hook','../../mysqldb','UserVoiceQueueRt','setMaxListeners'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7676,0x1ad));var _0x6767=function(_0x3bba7f,_0x958fc5){_0x3bba7f=_0x3bba7f-0x0;var _0xaa5433=_0x7676[_0x3bba7f];return _0xaa5433;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0x6767('0x0'))['db'][_0x6767('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x6767('0x2')](0x0);var events={'afterCreate':_0x6767('0x3'),'afterUpdate':'update','afterDestroy':_0x6767('0x4')};function emitEvent(_0x51dc38){return function(_0x5e41b2,_0x52537c,_0x35ef37){UserVoiceQueueRtEvents[_0x6767('0x5')](_0x51dc38+':'+_0x5e41b2['id'],_0x5e41b2);UserVoiceQueueRtEvents[_0x6767('0x5')](_0x51dc38,_0x5e41b2);_0x35ef37(null);};}for(var e in events){if(events[_0x6767('0x6')](e)){var event=events[e];UserVoiceQueueRt[_0x6767('0x7')](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 31b9589..aa70917 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 _0xec30=['./userVoiceQueueRt.attributes','user_has_voice_queues_rt','util','../../config/logger','api','bluebird','path'];(function(_0x27c45c,_0x4e243b){var _0x248a28=function(_0x50bc68){while(--_0x50bc68){_0x27c45c['push'](_0x27c45c['shift']());}};_0x248a28(++_0x4e243b);}(_0xec30,0x1c9));var _0x0ec3=function(_0xc4f906,_0x2076b0){_0xc4f906=_0xc4f906-0x0;var _0xed62b8=_0xec30[_0xc4f906];return _0xed62b8;};'use strict';var _=require('lodash');var util=require(_0x0ec3('0x0'));var logger=require(_0x0ec3('0x1'))(_0x0ec3('0x2'));var moment=require('moment');var BPromise=require(_0x0ec3('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0ec3('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0ec3('0x5'));module['exports']=function(_0x6df60a,_0x2f1b63){return _0x6df60a['define']('UserVoiceQueueRt',attributes,{'tableName':_0x0ec3('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4017=['rimraf','../../config/environment','exports','define','user_has_voice_queues_rt','lodash','util','../../config/logger','api','request-promise','path'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x4017,0x1b2));var _0x7401=function(_0xd8e69b,_0x71e33d){_0xd8e69b=_0xd8e69b-0x0;var _0x9a185a=_0x4017[_0xd8e69b];return _0x9a185a;};'use strict';var _=require(_0x7401('0x0'));var util=require(_0x7401('0x1'));var logger=require(_0x7401('0x2'))(_0x7401('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7401('0x4'));var fs=require('fs');var path=require(_0x7401('0x5'));var rimraf=require(_0x7401('0x6'));var config=require(_0x7401('0x7'));var attributes=require('./userVoiceQueueRt.attributes');module[_0x7401('0x8')]=function(_0x2af62a,_0x13e4d1){return _0x2af62a[_0x7401('0x9')]('UserVoiceQueueRt',attributes,{'tableName':_0x7401('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js index 46ef19e..d04f29b 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 _0x356c=['socket.io-emitter','./userVoiceQueueRt.socket','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','where','sequelize','COUNT','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost'];(function(_0x5734e1,_0x3e1d75){var _0x22c784=function(_0x4fe1eb){while(--_0x4fe1eb){_0x5734e1['push'](_0x5734e1['shift']());}};_0x22c784(++_0x3e1d75);}(_0x356c,0xd0));var _0xc356=function(_0x3a1c94,_0x361f97){_0x3a1c94=_0x3a1c94-0x0;var _0x501dde=_0x356c[_0x3a1c94];return _0x501dde;};'use strict';var _=require(_0xc356('0x0'));var util=require('util');var moment=require(_0xc356('0x1'));var BPromise=require(_0xc356('0x2'));var rs=require(_0xc356('0x3'));var fs=require('fs');var Redis=require(_0xc356('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc356('0x5'));var logger=require('../../config/logger')(_0xc356('0x6'));var config=require(_0xc356('0x7'));var jayson=require(_0xc356('0x8'));var client=jayson[_0xc356('0x9')][_0xc356('0xa')]({'port':0x232a});config[_0xc356('0xb')]=_[_0xc356('0xc')](config[_0xc356('0xb')],{'host':_0xc356('0xd'),'port':0x18eb});var socket=require(_0xc356('0xe'))(new Redis(config[_0xc356('0xb')]));require(_0xc356('0xf'))['register'](socket);function respondWithRpcPromise(_0x141aec,_0x47a36f,_0x5f0280){return new BPromise(function(_0x9fa767,_0x415734){return client[_0xc356('0x10')](_0x141aec,_0x5f0280)[_0xc356('0x11')](function(_0x11376d){logger[_0xc356('0x12')](_0xc356('0x13'),_0x47a36f,_0xc356('0x14'));logger[_0xc356('0x15')](_0xc356('0x16'),_0x47a36f,_0xc356('0x14'),JSON[_0xc356('0x17')](_0x11376d));if(_0x11376d[_0xc356('0x18')]){if(_0x11376d[_0xc356('0x18')]['code']===0x1f4){logger[_0xc356('0x18')](_0xc356('0x13'),_0x47a36f,_0x11376d[_0xc356('0x18')][_0xc356('0x19')]);return _0x415734(_0x11376d[_0xc356('0x18')][_0xc356('0x19')]);}logger[_0xc356('0x18')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x47a36f,_0x11376d[_0xc356('0x18')][_0xc356('0x19')]);return _0x9fa767(_0x11376d[_0xc356('0x18')]['message']);}else{logger[_0xc356('0x12')](_0xc356('0x13'),_0x47a36f,'request\x20sent');_0x9fa767(_0x11376d[_0xc356('0x1a')]['message']);}})[_0xc356('0x1b')](function(_0x29b8b2){logger[_0xc356('0x18')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x47a36f,_0x29b8b2);_0x415734(_0x29b8b2);});});}exports[_0xc356('0x1c')]=function(_0x27b962){var _0x1b6f31=this;return new Promise(function(_0x20eeb5,_0x5f19da){return db[_0xc356('0x1d')][_0xc356('0x1e')]({'raw':_0x27b962[_0xc356('0x1f')]?_0x27b962['options']['raw']===undefined?!![]:![]:!![],'where':_0x27b962[_0xc356('0x1f')]?_0x27b962[_0xc356('0x1f')][_0xc356('0x20')]||null:null,'attributes':[[db[_0xc356('0x21')]['fn'](_0xc356('0x22'),db[_0xc356('0x21')]['fn']('IF',db['sequelize']['literal'](_0xc356('0x23')))),_0xc356('0x24')]]})['then'](function(_0x26a682){logger[_0xc356('0x12')](_0xc356('0x1c'),_0x27b962);logger[_0xc356('0x15')](_0xc356('0x1c'),_0x27b962,JSON[_0xc356('0x17')](_0x26a682));_0x20eeb5(_0x26a682);})['catch'](function(_0x1a1dcd){logger[_0xc356('0x18')](_0xc356('0x1c'),_0x1a1dcd[_0xc356('0x19')],_0x27b962);_0x5f19da(_0x1b6f31[_0xc356('0x18')](0x1f4,_0x1a1dcd[_0xc356('0x19')]));});});}; \ No newline at end of file +var _0xffc9=['`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','lodash','util','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','options','raw','where','sequelize','COUNT'];(function(_0x3c9e1f,_0x12afdb){var _0x55d142=function(_0x17a881){while(--_0x17a881){_0x3c9e1f['push'](_0x3c9e1f['shift']());}};_0x55d142(++_0x12afdb);}(_0xffc9,0xf7));var _0x9ffc=function(_0x34c0ac,_0x1cc797){_0x34c0ac=_0x34c0ac-0x0;var _0x292649=_0xffc9[_0x34c0ac];return _0x292649;};'use strict';var _=require(_0x9ffc('0x0'));var util=require(_0x9ffc('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9ffc('0x2'));var logger=require(_0x9ffc('0x3'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9ffc('0x4'));var client=jayson[_0x9ffc('0x5')][_0x9ffc('0x6')]({'port':0x232a});config[_0x9ffc('0x7')]=_[_0x9ffc('0x8')](config[_0x9ffc('0x7')],{'host':_0x9ffc('0x9'),'port':0x18eb});var socket=require(_0x9ffc('0xa'))(new Redis(config[_0x9ffc('0x7')]));require(_0x9ffc('0xb'))[_0x9ffc('0xc')](socket);function respondWithRpcPromise(_0x1e292f,_0x38edaa,_0x50767){return new BPromise(function(_0x596f61,_0x147613){return client[_0x9ffc('0xd')](_0x1e292f,_0x50767)[_0x9ffc('0xe')](function(_0x550638){logger[_0x9ffc('0xf')](_0x9ffc('0x10'),_0x38edaa,_0x9ffc('0x11'));logger[_0x9ffc('0x12')](_0x9ffc('0x13'),_0x38edaa,'request\x20sent',JSON[_0x9ffc('0x14')](_0x550638));if(_0x550638[_0x9ffc('0x15')]){if(_0x550638['error'][_0x9ffc('0x16')]===0x1f4){logger[_0x9ffc('0x15')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x38edaa,_0x550638[_0x9ffc('0x15')][_0x9ffc('0x17')]);return _0x147613(_0x550638[_0x9ffc('0x15')][_0x9ffc('0x17')]);}logger['error'](_0x9ffc('0x10'),_0x38edaa,_0x550638[_0x9ffc('0x15')][_0x9ffc('0x17')]);return _0x596f61(_0x550638['error'][_0x9ffc('0x17')]);}else{logger['info']('UserVoiceQueueRt,\x20%s,\x20%s',_0x38edaa,_0x9ffc('0x11'));_0x596f61(_0x550638[_0x9ffc('0x18')]['message']);}})[_0x9ffc('0x19')](function(_0x442b03){logger['error'](_0x9ffc('0x10'),_0x38edaa,_0x442b03);_0x147613(_0x442b03);});});}exports[_0x9ffc('0x1a')]=function(_0x479efb){var _0x6a512b=this;return new Promise(function(_0x4d72b3,_0x416ca6){return db[_0x9ffc('0x1b')]['findAll']({'raw':_0x479efb[_0x9ffc('0x1c')]?_0x479efb[_0x9ffc('0x1c')][_0x9ffc('0x1d')]===undefined?!![]:![]:!![],'where':_0x479efb['options']?_0x479efb[_0x9ffc('0x1c')][_0x9ffc('0x1e')]||null:null,'attributes':[[db[_0x9ffc('0x1f')]['fn'](_0x9ffc('0x20'),db['sequelize']['fn']('IF',db[_0x9ffc('0x1f')]['literal'](_0x9ffc('0x21')))),_0x9ffc('0x22')]]})['then'](function(_0x43d171){logger['info'](_0x9ffc('0x1a'),_0x479efb);logger[_0x9ffc('0x12')](_0x9ffc('0x1a'),_0x479efb,JSON[_0x9ffc('0x14')](_0x43d171));_0x4d72b3(_0x43d171);})['catch'](function(_0x4cab9d){logger['error']('GetVoiceQueueRtPauses',_0x4cab9d['message'],_0x479efb);_0x416ca6(_0x6a512b[_0x9ffc('0x15')](0x1f4,_0x4cab9d[_0x9ffc('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 7e43e76..88d80d7 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 _0xba34=['userVoiceQueueRt:','./userVoiceQueueRt.events','save','remove','update','removeListener','register'];(function(_0x4336d3,_0x571bd4){var _0x5a929=function(_0x26cfd2){while(--_0x26cfd2){_0x4336d3['push'](_0x4336d3['shift']());}};_0x5a929(++_0x571bd4);}(_0xba34,0x119));var _0x4ba3=function(_0x213fe2,_0x5a104f){_0x213fe2=_0x213fe2-0x0;var _0x5ba0ec=_0xba34[_0x213fe2];return _0x5ba0ec;};'use strict';var UserVoiceQueueRtEvents=require(_0x4ba3('0x0'));var events=[_0x4ba3('0x1'),_0x4ba3('0x2'),_0x4ba3('0x3')];function createListener(_0xeb0ac4,_0x4d6e75){return function(_0x5aa88e){_0x4d6e75['emit'](_0xeb0ac4,_0x5aa88e);};}function removeListener(_0x4592fc,_0x2947f2){return function(){UserVoiceQueueRtEvents[_0x4ba3('0x4')](_0x4592fc,_0x2947f2);};}exports[_0x4ba3('0x5')]=function(_0x3590a1){for(var _0xb88621=0x0,_0xe5f99a=events['length'];_0xb88621<_0xe5f99a;_0xb88621++){var _0x6254fb=events[_0xb88621];var _0x368eee=createListener(_0x4ba3('0x6')+_0x6254fb,_0x3590a1);UserVoiceQueueRtEvents['on'](_0x6254fb,_0x368eee);}}; \ No newline at end of file +var _0xaf0d=['userVoiceQueueRt:','save','remove','removeListener'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0xaf0d,0x6d));var _0xdaf0=function(_0x81ef32,_0x588c41){_0x81ef32=_0x81ef32-0x0;var _0x2cd1dd=_0xaf0d[_0x81ef32];return _0x2cd1dd;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0xdaf0('0x0'),_0xdaf0('0x1'),'update'];function createListener(_0x53877e,_0x5ed0cf){return function(_0x4d0160){_0x5ed0cf['emit'](_0x53877e,_0x4d0160);};}function removeListener(_0x1b6f35,_0x21a3fa){return function(){UserVoiceQueueRtEvents[_0xdaf0('0x2')](_0x1b6f35,_0x21a3fa);};}exports['register']=function(_0x35fe4f){for(var _0x14b19d=0x0,_0x53aec7=events['length'];_0x14b19d<_0x53aec7;_0x14b19d++){var _0x26bda3=events[_0x14b19d];var _0x1dc345=createListener(_0xdaf0('0x3')+_0x26bda3,_0x35fe4f);UserVoiceQueueRtEvents['on'](_0x26bda3,_0x1dc345);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 0bd6456..8d81f35 100644 --- a/server/api/userWhatsappQueue/index.js +++ b/server/api/userWhatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x547add,_0x387042){var _0x2ed1f3=function(_0x3bbb4d){while(--_0x3bbb4d){_0x547add['push'](_0x547add['shift']());}};_0x2ed1f3(++_0x387042);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x267428,_0x401ec9){var _0x2dc910=function(_0x480077){while(--_0x480077){_0x267428['push'](_0x267428['shift']());}};_0x2dc910(++_0x401ec9);}(_0xedd9,0xfc));var _0x9edd=function(_0xe4db28,_0x4b59c6){_0xe4db28=_0xe4db28-0x0;var _0x49a32f=_0xedd9[_0xe4db28];return _0x49a32f;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index ea00479..8f0f8ba 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 _0x514f=['exports','INTEGER','sequelize'];(function(_0x2858fd,_0x8bd349){var _0x592693=function(_0x5e156e){while(--_0x5e156e){_0x2858fd['push'](_0x2858fd['shift']());}};_0x592693(++_0x8bd349);}(_0x514f,0x167));var _0xf514=function(_0x3fdaf4,_0x1cd733){_0x3fdaf4=_0x3fdaf4-0x0;var _0x4b2c04=_0x514f[_0x3fdaf4];return _0x4b2c04;};'use strict';var Sequelize=require(_0xf514('0x0'));module[_0xf514('0x1')]={'penalty':{'type':Sequelize[_0xf514('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe873=['sequelize','exports'];(function(_0x11e083,_0x546721){var _0x176817=function(_0x2cdb80){while(--_0x2cdb80){_0x11e083['push'](_0x11e083['shift']());}};_0x176817(++_0x546721);}(_0xe873,0x1e6));var _0x3e87=function(_0x5f31c6,_0x5015c8){_0x5f31c6=_0x5f31c6-0x0;var _0x7310df=_0xe873[_0x5f31c6];return _0x7310df;};'use strict';var Sequelize=require(_0x3e87('0x0'));module[_0x3e87('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.model.js b/server/api/userWhatsappQueue/userWhatsappQueue.model.js index caa6061..c9ed02a 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 _0x5c48=['bluebird','request-promise','path','rimraf','../../config/environment','./userWhatsappQueue.attributes','exports','define','UserWhatsappQueue','lodash','util','../../config/logger','api'];(function(_0x57b7f6,_0x5d6061){var _0x135fed=function(_0x14f057){while(--_0x14f057){_0x57b7f6['push'](_0x57b7f6['shift']());}};_0x135fed(++_0x5d6061);}(_0x5c48,0x19c));var _0x85c4=function(_0xf458ec,_0x389b3f){_0xf458ec=_0xf458ec-0x0;var _0x204523=_0x5c48[_0xf458ec];return _0x204523;};'use strict';var _=require(_0x85c4('0x0'));var util=require(_0x85c4('0x1'));var logger=require(_0x85c4('0x2'))(_0x85c4('0x3'));var moment=require('moment');var BPromise=require(_0x85c4('0x4'));var rp=require(_0x85c4('0x5'));var fs=require('fs');var path=require(_0x85c4('0x6'));var rimraf=require(_0x85c4('0x7'));var config=require(_0x85c4('0x8'));var attributes=require(_0x85c4('0x9'));module[_0x85c4('0xa')]=function(_0x2664bc,_0x70c320){return _0x2664bc[_0x85c4('0xb')](_0x85c4('0xc'),attributes,{'tableName':'user_has_whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd4f2=['./userWhatsappQueue.attributes','exports','define','UserWhatsappQueue','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment'];(function(_0x2df767,_0x33550d){var _0x1d51b5=function(_0x3144e0){while(--_0x3144e0){_0x2df767['push'](_0x2df767['shift']());}};_0x1d51b5(++_0x33550d);}(_0xd4f2,0x100));var _0x2d4f=function(_0x30e2c7,_0x265d0f){_0x30e2c7=_0x30e2c7-0x0;var _0x5cf9bb=_0xd4f2[_0x30e2c7];return _0x5cf9bb;};'use strict';var _=require(_0x2d4f('0x0'));var util=require(_0x2d4f('0x1'));var logger=require(_0x2d4f('0x2'))(_0x2d4f('0x3'));var moment=require(_0x2d4f('0x4'));var BPromise=require(_0x2d4f('0x5'));var rp=require(_0x2d4f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2d4f('0x7'));var attributes=require(_0x2d4f('0x8'));module[_0x2d4f('0x9')]=function(_0x3d5948,_0x11f26c){return _0x3d5948[_0x2d4f('0xa')](_0x2d4f('0xb'),attributes,{'tableName':'user_has_whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js index f9a07df..46fdb78 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 _0xefa6=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x307bc0,_0x378ca4){var _0x5ad9e1=function(_0x1288f1){while(--_0x1288f1){_0x307bc0['push'](_0x307bc0['shift']());}};_0x5ad9e1(++_0x378ca4);}(_0xefa6,0x6e));var _0x6efa=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xefa6[_0x1035c1];return _0x308d67;};'use strict';var _=require(_0x6efa('0x0'));var util=require(_0x6efa('0x1'));var moment=require(_0x6efa('0x2'));var BPromise=require(_0x6efa('0x3'));var rs=require(_0x6efa('0x4'));var fs=require('fs');var Redis=require(_0x6efa('0x5'));var db=require(_0x6efa('0x6'))['db'];var utils=require(_0x6efa('0x7'));var logger=require(_0x6efa('0x8'))('rpc');var config=require(_0x6efa('0x9'));var jayson=require(_0x6efa('0xa'));var client=jayson['client'][_0x6efa('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x299143,_0x1d7fc2,_0x1fc5a9){return new BPromise(function(_0x12e524,_0x1d98d5){return client['request'](_0x299143,_0x1fc5a9)[_0x6efa('0xc')](function(_0x2c453e){logger['info'](_0x6efa('0xd'),_0x1d7fc2,_0x6efa('0xe'));logger[_0x6efa('0xf')](_0x6efa('0x10'),_0x1d7fc2,_0x6efa('0xe'),JSON[_0x6efa('0x11')](_0x2c453e));if(_0x2c453e[_0x6efa('0x12')]){if(_0x2c453e[_0x6efa('0x12')][_0x6efa('0x13')]===0x1f4){logger[_0x6efa('0x12')](_0x6efa('0xd'),_0x1d7fc2,_0x2c453e[_0x6efa('0x12')]['message']);return _0x1d98d5(_0x2c453e['error'][_0x6efa('0x14')]);}logger[_0x6efa('0x12')]('UserWhatsappQueue,\x20%s,\x20%s',_0x1d7fc2,_0x2c453e['error'][_0x6efa('0x14')]);return _0x12e524(_0x2c453e[_0x6efa('0x12')][_0x6efa('0x14')]);}else{logger['info']('UserWhatsappQueue,\x20%s,\x20%s',_0x1d7fc2,_0x6efa('0xe'));_0x12e524(_0x2c453e[_0x6efa('0x15')][_0x6efa('0x14')]);}})[_0x6efa('0x16')](function(_0x13f46e){logger[_0x6efa('0x12')](_0x6efa('0xd'),_0x1d7fc2,_0x13f46e);_0x1d98d5(_0x13f46e);});});} \ No newline at end of file +var _0x2cbc=['http','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0x2cbc,0x17a));var _0xc2cb=function(_0x371241,_0x1006c8){_0x371241=_0x371241-0x0;var _0x1eb44d=_0x2cbc[_0x371241];return _0x1eb44d;};'use strict';var _=require(_0xc2cb('0x0'));var util=require(_0xc2cb('0x1'));var moment=require(_0xc2cb('0x2'));var BPromise=require(_0xc2cb('0x3'));var rs=require(_0xc2cb('0x4'));var fs=require('fs');var Redis=require(_0xc2cb('0x5'));var db=require(_0xc2cb('0x6'))['db'];var utils=require(_0xc2cb('0x7'));var logger=require(_0xc2cb('0x8'))('rpc');var config=require(_0xc2cb('0x9'));var jayson=require(_0xc2cb('0xa'));var client=jayson[_0xc2cb('0xb')][_0xc2cb('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1e74bb,_0x3f2336,_0x1c65e8){return new BPromise(function(_0x2950a0,_0xbf4a91){return client[_0xc2cb('0xd')](_0x1e74bb,_0x1c65e8)[_0xc2cb('0xe')](function(_0x56ad0c){logger[_0xc2cb('0xf')](_0xc2cb('0x10'),_0x3f2336,_0xc2cb('0x11'));logger[_0xc2cb('0x12')](_0xc2cb('0x13'),_0x3f2336,_0xc2cb('0x11'),JSON[_0xc2cb('0x14')](_0x56ad0c));if(_0x56ad0c[_0xc2cb('0x15')]){if(_0x56ad0c[_0xc2cb('0x15')][_0xc2cb('0x16')]===0x1f4){logger['error'](_0xc2cb('0x10'),_0x3f2336,_0x56ad0c['error'][_0xc2cb('0x17')]);return _0xbf4a91(_0x56ad0c[_0xc2cb('0x15')][_0xc2cb('0x17')]);}logger[_0xc2cb('0x15')]('UserWhatsappQueue,\x20%s,\x20%s',_0x3f2336,_0x56ad0c[_0xc2cb('0x15')][_0xc2cb('0x17')]);return _0x2950a0(_0x56ad0c['error']['message']);}else{logger[_0xc2cb('0xf')](_0xc2cb('0x10'),_0x3f2336,'request\x20sent');_0x2950a0(_0x56ad0c[_0xc2cb('0x18')][_0xc2cb('0x17')]);}})[_0xc2cb('0x19')](function(_0x11e614){logger['error'](_0xc2cb('0x10'),_0x3f2336,_0x11e614);_0xbf4a91(_0x11e614);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 2ac09f6..cce8525 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 _0x1782=['fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x3ab1d0,_0x5068fd){var _0x4bb5af=function(_0x1f45b4){while(--_0x1f45b4){_0x3ab1d0['push'](_0x3ab1d0['shift']());}};_0x4bb5af(++_0x5068fd);}(_0x1782,0x13e));var _0x2178=function(_0x2c7ff5,_0x504abe){_0x2c7ff5=_0x2c7ff5-0x0;var _0x42fef4=_0x1782[_0x2c7ff5];return _0x42fef4;};'use strict';var multer=require(_0x2178('0x0'));var util=require('util');var path=require(_0x2178('0x1'));var timeout=require(_0x2178('0x2'));var express=require(_0x2178('0x3'));var router=express[_0x2178('0x4')]();var fs_extra=require(_0x2178('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x2178('0x6'));var config=require(_0x2178('0x7'));var controller=require('./variable.controller');router['get']('/',auth[_0x2178('0x8')](),controller[_0x2178('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x2178('0xa')]);router[_0x2178('0xb')]('/',auth[_0x2178('0x8')](),controller[_0x2178('0xc')]);router[_0x2178('0xd')](_0x2178('0xe'),auth['isAuthenticated'](),controller[_0x2178('0xf')]);router[_0x2178('0x10')](_0x2178('0xe'),auth[_0x2178('0x8')](),controller[_0x2178('0x11')]);module[_0x2178('0x12')]=router; \ No newline at end of file +var _0x765b=['put','/:id','destroy','exports','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','post','create'];(function(_0x32d330,_0xe907c8){var _0xe81a43=function(_0x322e56){while(--_0x322e56){_0x32d330['push'](_0x32d330['shift']());}};_0xe81a43(++_0xe907c8);}(_0x765b,0x18c));var _0xb765=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0x765b[_0x3e112d];return _0x531c31;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xb765('0x0'));var express=require('express');var router=express[_0xb765('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0xb765('0x2'));var interaction=require(_0xb765('0x3'));var config=require(_0xb765('0x4'));var controller=require('./variable.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xb765('0x5')]('/:id',auth[_0xb765('0x6')](),controller[_0xb765('0x7')]);router[_0xb765('0x8')]('/',auth['isAuthenticated'](),controller[_0xb765('0x9')]);router[_0xb765('0xa')](_0xb765('0xb'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xb765('0xb'),auth[_0xb765('0x6')](),controller[_0xb765('0xc')]);module[_0xb765('0xd')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 5710d18..71c2e9f 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 _0x2cbe=['STRING','name','exports'];(function(_0x2bf5ef,_0x399d1f){var _0x411847=function(_0x5b7dc0){while(--_0x5b7dc0){_0x2bf5ef['push'](_0x2bf5ef['shift']());}};_0x411847(++_0x399d1f);}(_0x2cbe,0x110));var _0xe2cb=function(_0x32b4aa,_0x12eba6){_0x32b4aa=_0x32b4aa-0x0;var _0x473160=_0x2cbe[_0x32b4aa];return _0x473160;};'use strict';var Sequelize=require('sequelize');module[_0xe2cb('0x0')]={'name':{'type':Sequelize[_0xe2cb('0x1')],'unique':_0xe2cb('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xe2cb('0x1')]}}; \ No newline at end of file +var _0xd8b5=['name','sequelize','exports','STRING'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0xd8b5,0x17d));var _0x5d8b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd8b5[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x5d8b('0x0'));module[_0x5d8b('0x1')]={'name':{'type':Sequelize[_0x5d8b('0x2')],'unique':_0x5d8b('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x5d8b('0x2')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 7e3a70f..1f164ae 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 _0xe9ae=['limit','count','set','Content-Range','apply','reject','save','destroy','then','get','Variables','UserProfileResource','stack','name','send','index','Variable','rawAttributes','fieldName','model','map','keys','filters','intersection','fields','query','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','catch','includeAll','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','error','params','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined'];(function(_0x44b094,_0x3d5800){var _0x23866d=function(_0x1495c0){while(--_0x1495c0){_0x44b094['push'](_0x44b094['shift']());}};_0x23866d(++_0x3d5800);}(_0xe9ae,0x125));var _0xee9a=function(_0x5369a9,_0x193d5e){_0x5369a9=_0x5369a9-0x0;var _0x130ec8=_0xe9ae[_0x5369a9];return _0x130ec8;};'use strict';var emlformat=require(_0xee9a('0x0'));var rimraf=require(_0xee9a('0x1'));var zipdir=require(_0xee9a('0x2'));var jsonpatch=require(_0xee9a('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xee9a('0x4'));var util=require(_0xee9a('0x5'));var path=require(_0xee9a('0x6'));var sox=require(_0xee9a('0x7'));var csv=require(_0xee9a('0x8'));var ejs=require(_0xee9a('0x9'));var fs=require('fs');var fs_extra=require(_0xee9a('0xa'));var _=require(_0xee9a('0xb'));var squel=require(_0xee9a('0xc'));var crypto=require('crypto');var jsforce=require(_0xee9a('0xd'));var deskjs=require(_0xee9a('0xe'));var toCsv=require(_0xee9a('0x8'));var querystring=require(_0xee9a('0xf'));var Papa=require(_0xee9a('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xee9a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xee9a('0x12'));var config=require(_0xee9a('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xee9a('0x14'))['db'];function respondWithStatusCode(_0x9c2d03,_0x3a2e14){_0x3a2e14=_0x3a2e14||0xcc;return function(_0x5c388c){if(_0x5c388c){return _0x9c2d03[_0xee9a('0x15')](_0x3a2e14);}return _0x9c2d03['status'](_0x3a2e14)[_0xee9a('0x16')]();};}function respondWithResult(_0x5f14a0,_0x344b3c){_0x344b3c=_0x344b3c||0xc8;return function(_0x15f462){if(_0x15f462){return _0x5f14a0[_0xee9a('0x17')](_0x344b3c)[_0xee9a('0x18')](_0x15f462);}};}function respondWithFilteredResult(_0x41f71d,_0x1e2cfe){return function(_0x52bee1){if(_0x52bee1){var _0x301835=typeof _0x1e2cfe[_0xee9a('0x19')]===_0xee9a('0x1a')&&typeof _0x1e2cfe[_0xee9a('0x1b')]===_0xee9a('0x1a');var _0x2799c9=_0x52bee1[_0xee9a('0x1c')];var _0x8cb79d=_0x301835?0x0:_0x1e2cfe[_0xee9a('0x19')];var _0x488fd0=_0x301835?_0x52bee1['count']:_0x1e2cfe[_0xee9a('0x19')]+_0x1e2cfe[_0xee9a('0x1b')];var _0xd699a5;if(_0x488fd0>=_0x2799c9){_0x488fd0=_0x2799c9;_0xd699a5=0xc8;}else{_0xd699a5=0xce;}_0x41f71d[_0xee9a('0x17')](_0xd699a5);return _0x41f71d[_0xee9a('0x1d')](_0xee9a('0x1e'),_0x8cb79d+'-'+_0x488fd0+'/'+_0x2799c9)['json'](_0x52bee1);}return null;};}function patchUpdates(_0x5836d0){return function(_0x56615a){try{jsonpatch[_0xee9a('0x1f')](_0x56615a,_0x5836d0,!![]);}catch(_0x198683){return BPromise[_0xee9a('0x20')](_0x198683);}return _0x56615a[_0xee9a('0x21')]();};}function saveUpdates(_0x13225c,_0x235e8c){return function(_0x132363){if(_0x132363){return _0x132363['update'](_0x13225c)['then'](function(_0x4c2e85){return _0x4c2e85;});}return null;};}function removeEntity(_0x551123,_0x2a2bc6){return function(_0x6529b5){if(_0x6529b5){return _0x6529b5[_0xee9a('0x22')]()[_0xee9a('0x23')](function(){var _0x2b7fad=_0x6529b5[_0xee9a('0x24')]({'plain':!![]});var _0x558857=_0xee9a('0x25');return db[_0xee9a('0x26')]['destroy']({'where':{'type':_0x558857,'resourceId':_0x2b7fad['id']}})['then'](function(){return _0x6529b5;});})[_0xee9a('0x23')](function(){_0x551123[_0xee9a('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x557e7a,_0x40f973){return function(_0x37b64c){if(!_0x37b64c){_0x557e7a[_0xee9a('0x15')](0x194);}return _0x37b64c;};}function handleError(_0x39dfd9,_0x32db8d){_0x32db8d=_0x32db8d||0x1f4;return function(_0x1542fa){logger['error'](_0x1542fa[_0xee9a('0x27')]);if(_0x1542fa['name']){delete _0x1542fa[_0xee9a('0x28')];}_0x39dfd9['status'](_0x32db8d)[_0xee9a('0x29')](_0x1542fa);};}exports[_0xee9a('0x2a')]=function(_0x4025a2,_0x5af15e){var _0x550100={},_0x1ddbf3={},_0x52543a={'count':0x0,'rows':[]};var _0x469afd=_['map'](db[_0xee9a('0x2b')][_0xee9a('0x2c')],function(_0x5a2f68){return{'name':_0x5a2f68[_0xee9a('0x2d')],'type':_0x5a2f68['type']['key']};});_0x1ddbf3[_0xee9a('0x2e')]=_[_0xee9a('0x2f')](_0x469afd,_0xee9a('0x28'));_0x1ddbf3['query']=_[_0xee9a('0x30')](_0x4025a2['query']);_0x1ddbf3[_0xee9a('0x31')]=_[_0xee9a('0x32')](_0x1ddbf3[_0xee9a('0x2e')],_0x1ddbf3['query']);_0x550100['attributes']=_[_0xee9a('0x32')](_0x1ddbf3[_0xee9a('0x2e')],qs[_0xee9a('0x33')](_0x4025a2[_0xee9a('0x34')][_0xee9a('0x33')]));_0x550100[_0xee9a('0x35')]=_0x550100[_0xee9a('0x35')][_0xee9a('0x36')]?_0x550100[_0xee9a('0x35')]:_0x1ddbf3['model'];if(!_0x4025a2[_0xee9a('0x34')][_0xee9a('0x37')](_0xee9a('0x38'))){_0x550100[_0xee9a('0x1b')]=qs[_0xee9a('0x1b')](_0x4025a2[_0xee9a('0x34')]['limit']);_0x550100[_0xee9a('0x19')]=qs[_0xee9a('0x19')](_0x4025a2[_0xee9a('0x34')]['offset']);}_0x550100[_0xee9a('0x39')]=qs[_0xee9a('0x3a')](_0x4025a2[_0xee9a('0x34')][_0xee9a('0x3a')]);_0x550100[_0xee9a('0x3b')]=qs['filters'](_[_0xee9a('0x3c')](_0x4025a2['query'],_0x1ddbf3[_0xee9a('0x31')]),_0x469afd);if(_0x4025a2['query'][_0xee9a('0x3d')]){_0x550100[_0xee9a('0x3b')]=_[_0xee9a('0x3e')](_0x550100[_0xee9a('0x3b')],{'$or':_['map'](_0x469afd,function(_0x1e822b){if(_0x1e822b['type']!==_0xee9a('0x3f')){var _0x5392ee={};_0x5392ee[_0x1e822b[_0xee9a('0x28')]]={'$like':'%'+_0x4025a2[_0xee9a('0x34')][_0xee9a('0x3d')]+'%'};return _0x5392ee;}})});}_0x550100=_['merge']({},_0x550100,_0x4025a2[_0xee9a('0x40')]);var _0xb5ca8e={'where':_0x550100['where']};return db['Variable'][_0xee9a('0x1c')](_0xb5ca8e)[_0xee9a('0x23')](function(_0xf57e28){_0x52543a['count']=_0xf57e28;if(_0x4025a2['query']['includeAll']){_0x550100['include']=[{'all':!![]}];}return db[_0xee9a('0x2b')][_0xee9a('0x41')](_0x550100);})[_0xee9a('0x23')](function(_0x196a47){_0x52543a['rows']=_0x196a47;return _0x52543a;})['then'](respondWithFilteredResult(_0x5af15e,_0x550100))[_0xee9a('0x42')](handleError(_0x5af15e,null));};exports['show']=function(_0x537c62,_0x317a58){var _0x75a8a6={'raw':!![],'where':{'id':_0x537c62['params']['id']}},_0x334bad={};_0x334bad['model']=_['keys'](db[_0xee9a('0x2b')][_0xee9a('0x2c')]);_0x334bad[_0xee9a('0x34')]=_['keys'](_0x537c62[_0xee9a('0x34')]);_0x334bad[_0xee9a('0x31')]=_[_0xee9a('0x32')](_0x334bad[_0xee9a('0x2e')],_0x334bad['query']);_0x75a8a6[_0xee9a('0x35')]=_[_0xee9a('0x32')](_0x334bad[_0xee9a('0x2e')],qs['fields'](_0x537c62[_0xee9a('0x34')][_0xee9a('0x33')]));_0x75a8a6[_0xee9a('0x35')]=_0x75a8a6[_0xee9a('0x35')]['length']?_0x75a8a6[_0xee9a('0x35')]:_0x334bad['model'];if(_0x537c62[_0xee9a('0x34')][_0xee9a('0x43')]){_0x75a8a6[_0xee9a('0x44')]=[{'all':!![]}];}_0x75a8a6=_['merge']({},_0x75a8a6,_0x537c62['options']);return db[_0xee9a('0x2b')][_0xee9a('0x45')](_0x75a8a6)[_0xee9a('0x23')](handleEntityNotFound(_0x317a58,null))[_0xee9a('0x23')](respondWithResult(_0x317a58,null))[_0xee9a('0x42')](handleError(_0x317a58,null));};exports[_0xee9a('0x46')]=function(_0x2ae7fd,_0x58e655){return db[_0xee9a('0x2b')]['create'](_0x2ae7fd[_0xee9a('0x47')],{})[_0xee9a('0x23')](function(_0x265c5f){var _0x81d63e=_0x2ae7fd['user'][_0xee9a('0x24')]({'plain':!![]});if(!_0x81d63e)throw new Error(_0xee9a('0x48'));if(_0x81d63e[_0xee9a('0x49')]===_0xee9a('0x4a')){var _0x4e8c0b=_0x265c5f[_0xee9a('0x24')]({'plain':!![]});var _0x394fe5='Variables';return db[_0xee9a('0x4b')][_0xee9a('0x45')]({'where':{'name':_0x394fe5,'userProfileId':_0x81d63e[_0xee9a('0x4c')]},'raw':!![]})[_0xee9a('0x23')](function(_0x2c4cb4){if(_0x2c4cb4&&_0x2c4cb4[_0xee9a('0x4d')]===0x0){return db[_0xee9a('0x26')]['create']({'name':_0x4e8c0b[_0xee9a('0x28')],'resourceId':_0x4e8c0b['id'],'type':_0x2c4cb4[_0xee9a('0x28')],'sectionId':_0x2c4cb4['id']},{})[_0xee9a('0x23')](function(){return _0x265c5f;});}else{return _0x265c5f;}})[_0xee9a('0x42')](function(_0x2c1866){logger[_0xee9a('0x4e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2c1866);throw _0x2c1866;});}return _0x265c5f;})['then'](respondWithResult(_0x58e655,0xc9))[_0xee9a('0x42')](handleError(_0x58e655,null));};exports['update']=function(_0x43764a,_0x3af7ff){if(_0x43764a['body']['id']){delete _0x43764a[_0xee9a('0x47')]['id'];}return db[_0xee9a('0x2b')][_0xee9a('0x45')]({'where':{'id':_0x43764a[_0xee9a('0x4f')]['id']}})[_0xee9a('0x23')](handleEntityNotFound(_0x3af7ff,null))[_0xee9a('0x23')](saveUpdates(_0x43764a['body'],null))['then'](respondWithResult(_0x3af7ff,null))[_0xee9a('0x42')](handleError(_0x3af7ff,null));};exports['destroy']=function(_0x1949ae,_0x457468){return db[_0xee9a('0x2b')]['find']({'where':{'id':_0x1949ae[_0xee9a('0x4f')]['id']}})[_0xee9a('0x23')](handleEntityNotFound(_0x457468,null))[_0xee9a('0x23')](removeEntity(_0x457468,null))[_0xee9a('0x42')](handleError(_0x457468,null));}; \ No newline at end of file +var _0x043b=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','get','UserProfileResource','end','error','stack','name','send','index','map','Variable','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','merge','where','VIRTUAL','filter','includeAll','include','findAll','rows','show','params','length','options','find','catch','create','role','user','Variables','UserProfileSection','userProfileId','autoAssociation','body','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service'];(function(_0x5235a6,_0x680b76){var _0x1cf37e=function(_0x31c173){while(--_0x31c173){_0x5235a6['push'](_0x5235a6['shift']());}};_0x1cf37e(++_0x680b76);}(_0x043b,0x1da));var _0xb043=function(_0x2dd12c,_0x355e42){_0x2dd12c=_0x2dd12c-0x0;var _0x20410c=_0x043b[_0x2dd12c];return _0x20410c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb043('0x0'));var zipdir=require(_0xb043('0x1'));var jsonpatch=require(_0xb043('0x2'));var rp=require('request-promise');var moment=require(_0xb043('0x3'));var BPromise=require(_0xb043('0x4'));var Mustache=require(_0xb043('0x5'));var util=require(_0xb043('0x6'));var path=require(_0xb043('0x7'));var sox=require(_0xb043('0x8'));var csv=require('to-csv');var ejs=require(_0xb043('0x9'));var fs=require('fs');var fs_extra=require(_0xb043('0xa'));var _=require(_0xb043('0xb'));var squel=require(_0xb043('0xc'));var crypto=require('crypto');var jsforce=require(_0xb043('0xd'));var deskjs=require(_0xb043('0xe'));var toCsv=require('to-csv');var querystring=require(_0xb043('0xf'));var Papa=require('papaparse');var Redis=require(_0xb043('0x10'));var authService=require(_0xb043('0x11'));var qs=require(_0xb043('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb043('0x13'));var logger=require(_0xb043('0x14'))(_0xb043('0x15'));var utils=require(_0xb043('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x426420,_0x2b3318){_0x2b3318=_0x2b3318||0xcc;return function(_0x30677a){if(_0x30677a){return _0x426420[_0xb043('0x17')](_0x2b3318);}return _0x426420[_0xb043('0x18')](_0x2b3318)['end']();};}function respondWithResult(_0x39c4f0,_0x43c765){_0x43c765=_0x43c765||0xc8;return function(_0x397aa4){if(_0x397aa4){return _0x39c4f0[_0xb043('0x18')](_0x43c765)[_0xb043('0x19')](_0x397aa4);}};}function respondWithFilteredResult(_0x3f0dc0,_0xd283c9){return function(_0x99f309){if(_0x99f309){var _0x1a379c=typeof _0xd283c9[_0xb043('0x1a')]===_0xb043('0x1b')&&typeof _0xd283c9[_0xb043('0x1c')]===_0xb043('0x1b');var _0x58ba47=_0x99f309[_0xb043('0x1d')];var _0xfab53a=_0x1a379c?0x0:_0xd283c9['offset'];var _0x14f315=_0x1a379c?_0x99f309[_0xb043('0x1d')]:_0xd283c9[_0xb043('0x1a')]+_0xd283c9[_0xb043('0x1c')];var _0x3b0197;if(_0x14f315>=_0x58ba47){_0x14f315=_0x58ba47;_0x3b0197=0xc8;}else{_0x3b0197=0xce;}_0x3f0dc0[_0xb043('0x18')](_0x3b0197);return _0x3f0dc0[_0xb043('0x1e')](_0xb043('0x1f'),_0xfab53a+'-'+_0x14f315+'/'+_0x58ba47)[_0xb043('0x19')](_0x99f309);}return null;};}function patchUpdates(_0x4540c6){return function(_0x461c2e){try{jsonpatch['apply'](_0x461c2e,_0x4540c6,!![]);}catch(_0x5b8d8b){return BPromise['reject'](_0x5b8d8b);}return _0x461c2e[_0xb043('0x20')]();};}function saveUpdates(_0x15e6fa,_0x4ba228){return function(_0x266b88){if(_0x266b88){return _0x266b88[_0xb043('0x21')](_0x15e6fa)[_0xb043('0x22')](function(_0x234d4d){return _0x234d4d;});}return null;};}function removeEntity(_0x389bc4,_0x75ff2c){return function(_0x2da40b){if(_0x2da40b){return _0x2da40b[_0xb043('0x23')]()[_0xb043('0x22')](function(){var _0x4a8ac3=_0x2da40b[_0xb043('0x24')]({'plain':!![]});var _0x3b96a1='Variables';return db[_0xb043('0x25')][_0xb043('0x23')]({'where':{'type':_0x3b96a1,'resourceId':_0x4a8ac3['id']}})[_0xb043('0x22')](function(){return _0x2da40b;});})[_0xb043('0x22')](function(){_0x389bc4[_0xb043('0x18')](0xcc)[_0xb043('0x26')]();});}};}function handleEntityNotFound(_0x3295c2,_0x11ac25){return function(_0x39a884){if(!_0x39a884){_0x3295c2[_0xb043('0x17')](0x194);}return _0x39a884;};}function handleError(_0x15cf60,_0x29af7a){_0x29af7a=_0x29af7a||0x1f4;return function(_0x49aece){logger[_0xb043('0x27')](_0x49aece[_0xb043('0x28')]);if(_0x49aece[_0xb043('0x29')]){delete _0x49aece[_0xb043('0x29')];}_0x15cf60[_0xb043('0x18')](_0x29af7a)[_0xb043('0x2a')](_0x49aece);};}exports[_0xb043('0x2b')]=function(_0x4d8fe5,_0x4b45df){var _0x2cc9b9={},_0x5de928={},_0x5bf89b={'count':0x0,'rows':[]};var _0x2e65e9=_[_0xb043('0x2c')](db[_0xb043('0x2d')][_0xb043('0x2e')],function(_0x344f69){return{'name':_0x344f69['fieldName'],'type':_0x344f69[_0xb043('0x2f')][_0xb043('0x30')]};});_0x5de928[_0xb043('0x31')]=_[_0xb043('0x2c')](_0x2e65e9,_0xb043('0x29'));_0x5de928[_0xb043('0x32')]=_[_0xb043('0x33')](_0x4d8fe5['query']);_0x5de928[_0xb043('0x34')]=_[_0xb043('0x35')](_0x5de928[_0xb043('0x31')],_0x5de928[_0xb043('0x32')]);_0x2cc9b9[_0xb043('0x36')]=_[_0xb043('0x35')](_0x5de928['model'],qs[_0xb043('0x37')](_0x4d8fe5['query'][_0xb043('0x37')]));_0x2cc9b9[_0xb043('0x36')]=_0x2cc9b9[_0xb043('0x36')]['length']?_0x2cc9b9[_0xb043('0x36')]:_0x5de928['model'];if(!_0x4d8fe5[_0xb043('0x32')][_0xb043('0x38')]('nolimit')){_0x2cc9b9[_0xb043('0x1c')]=qs[_0xb043('0x1c')](_0x4d8fe5[_0xb043('0x32')][_0xb043('0x1c')]);_0x2cc9b9[_0xb043('0x1a')]=qs['offset'](_0x4d8fe5['query']['offset']);}_0x2cc9b9[_0xb043('0x39')]=qs['sort'](_0x4d8fe5[_0xb043('0x32')][_0xb043('0x3a')]);_0x2cc9b9['where']=qs[_0xb043('0x34')](_[_0xb043('0x3b')](_0x4d8fe5[_0xb043('0x32')],_0x5de928[_0xb043('0x34')]),_0x2e65e9);if(_0x4d8fe5[_0xb043('0x32')]['filter']){_0x2cc9b9['where']=_[_0xb043('0x3c')](_0x2cc9b9[_0xb043('0x3d')],{'$or':_['map'](_0x2e65e9,function(_0x26e971){if(_0x26e971[_0xb043('0x2f')]!==_0xb043('0x3e')){var _0x5ab82e={};_0x5ab82e[_0x26e971['name']]={'$like':'%'+_0x4d8fe5['query'][_0xb043('0x3f')]+'%'};return _0x5ab82e;}})});}_0x2cc9b9=_['merge']({},_0x2cc9b9,_0x4d8fe5['options']);var _0x195075={'where':_0x2cc9b9[_0xb043('0x3d')]};return db['Variable'][_0xb043('0x1d')](_0x195075)[_0xb043('0x22')](function(_0x2b13a4){_0x5bf89b[_0xb043('0x1d')]=_0x2b13a4;if(_0x4d8fe5[_0xb043('0x32')][_0xb043('0x40')]){_0x2cc9b9[_0xb043('0x41')]=[{'all':!![]}];}return db[_0xb043('0x2d')][_0xb043('0x42')](_0x2cc9b9);})[_0xb043('0x22')](function(_0x30ebd1){_0x5bf89b[_0xb043('0x43')]=_0x30ebd1;return _0x5bf89b;})['then'](respondWithFilteredResult(_0x4b45df,_0x2cc9b9))['catch'](handleError(_0x4b45df,null));};exports[_0xb043('0x44')]=function(_0x267b44,_0x3c0482){var _0x3f816e={'raw':!![],'where':{'id':_0x267b44[_0xb043('0x45')]['id']}},_0x32b455={};_0x32b455[_0xb043('0x31')]=_['keys'](db[_0xb043('0x2d')]['rawAttributes']);_0x32b455[_0xb043('0x32')]=_[_0xb043('0x33')](_0x267b44[_0xb043('0x32')]);_0x32b455[_0xb043('0x34')]=_['intersection'](_0x32b455[_0xb043('0x31')],_0x32b455['query']);_0x3f816e[_0xb043('0x36')]=_[_0xb043('0x35')](_0x32b455[_0xb043('0x31')],qs['fields'](_0x267b44[_0xb043('0x32')][_0xb043('0x37')]));_0x3f816e[_0xb043('0x36')]=_0x3f816e['attributes'][_0xb043('0x46')]?_0x3f816e['attributes']:_0x32b455[_0xb043('0x31')];if(_0x267b44['query'][_0xb043('0x40')]){_0x3f816e[_0xb043('0x41')]=[{'all':!![]}];}_0x3f816e=_['merge']({},_0x3f816e,_0x267b44[_0xb043('0x47')]);return db['Variable'][_0xb043('0x48')](_0x3f816e)['then'](handleEntityNotFound(_0x3c0482,null))[_0xb043('0x22')](respondWithResult(_0x3c0482,null))[_0xb043('0x49')](handleError(_0x3c0482,null));};exports[_0xb043('0x4a')]=function(_0x4f6ee0,_0x2da7da){return db[_0xb043('0x2d')][_0xb043('0x4a')](_0x4f6ee0['body'],{})[_0xb043('0x22')](function(_0x27b87e){var _0x1e4519=_0x4f6ee0['user'][_0xb043('0x24')]({'plain':!![]});if(!_0x1e4519)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1e4519[_0xb043('0x4b')]===_0xb043('0x4c')){var _0x48473d=_0x27b87e[_0xb043('0x24')]({'plain':!![]});var _0x3661f0=_0xb043('0x4d');return db[_0xb043('0x4e')][_0xb043('0x48')]({'where':{'name':_0x3661f0,'userProfileId':_0x1e4519[_0xb043('0x4f')]},'raw':!![]})[_0xb043('0x22')](function(_0x146cf2){if(_0x146cf2&&_0x146cf2[_0xb043('0x50')]===0x0){return db['UserProfileResource'][_0xb043('0x4a')]({'name':_0x48473d[_0xb043('0x29')],'resourceId':_0x48473d['id'],'type':_0x146cf2[_0xb043('0x29')],'sectionId':_0x146cf2['id']},{})[_0xb043('0x22')](function(){return _0x27b87e;});}else{return _0x27b87e;}})[_0xb043('0x49')](function(_0x13cf1f){logger[_0xb043('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x13cf1f);throw _0x13cf1f;});}return _0x27b87e;})[_0xb043('0x22')](respondWithResult(_0x2da7da,0xc9))['catch'](handleError(_0x2da7da,null));};exports[_0xb043('0x21')]=function(_0x237ca2,_0x23bedc){if(_0x237ca2[_0xb043('0x51')]['id']){delete _0x237ca2[_0xb043('0x51')]['id'];}return db[_0xb043('0x2d')]['find']({'where':{'id':_0x237ca2[_0xb043('0x45')]['id']}})[_0xb043('0x22')](handleEntityNotFound(_0x23bedc,null))[_0xb043('0x22')](saveUpdates(_0x237ca2['body'],null))[_0xb043('0x22')](respondWithResult(_0x23bedc,null))[_0xb043('0x49')](handleError(_0x23bedc,null));};exports[_0xb043('0x23')]=function(_0x1c9c75,_0x269f21){return db[_0xb043('0x2d')][_0xb043('0x48')]({'where':{'id':_0x1c9c75['params']['id']}})[_0xb043('0x22')](handleEntityNotFound(_0x269f21,null))[_0xb043('0x22')](removeEntity(_0x269f21,null))[_0xb043('0x49')](handleError(_0x269f21,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index f6a253e..f2aa9d4 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 _0x6452=['lodash','../../config/logger','request-promise','path','rimraf','./variable.attributes','exports','define','tools_variables'];(function(_0x54bfac,_0x415a80){var _0x1ab6b3=function(_0x298c29){while(--_0x298c29){_0x54bfac['push'](_0x54bfac['shift']());}};_0x1ab6b3(++_0x415a80);}(_0x6452,0x1b9));var _0x2645=function(_0x2e913b,_0x4b7071){_0x2e913b=_0x2e913b-0x0;var _0x173899=_0x6452[_0x2e913b];return _0x173899;};'use strict';var _=require(_0x2645('0x0'));var util=require('util');var logger=require(_0x2645('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2645('0x2'));var fs=require('fs');var path=require(_0x2645('0x3'));var rimraf=require(_0x2645('0x4'));var config=require('../../config/environment');var attributes=require(_0x2645('0x5'));module[_0x2645('0x6')]=function(_0x375f9e,_0x11f0e9){return _0x375f9e[_0x2645('0x7')]('Variable',attributes,{'tableName':_0x2645('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3a18=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./variable.attributes','exports','define','Variable','tools_variables','lodash','util'];(function(_0x186b0e,_0x57b796){var _0x1f69b1=function(_0x184936){while(--_0x184936){_0x186b0e['push'](_0x186b0e['shift']());}};_0x1f69b1(++_0x57b796);}(_0x3a18,0x1ed));var _0x83a1=function(_0x773e5b,_0x580f76){_0x773e5b=_0x773e5b-0x0;var _0x53140c=_0x3a18[_0x773e5b];return _0x53140c;};'use strict';var _=require(_0x83a1('0x0'));var util=require(_0x83a1('0x1'));var logger=require(_0x83a1('0x2'))(_0x83a1('0x3'));var moment=require(_0x83a1('0x4'));var BPromise=require(_0x83a1('0x5'));var rp=require(_0x83a1('0x6'));var fs=require('fs');var path=require(_0x83a1('0x7'));var rimraf=require(_0x83a1('0x8'));var config=require(_0x83a1('0x9'));var attributes=require(_0x83a1('0xa'));module[_0x83a1('0xb')]=function(_0x4769eb,_0x3ee5b2){return _0x4769eb[_0x83a1('0xc')](_0x83a1('0xd'),attributes,{'tableName':_0x83a1('0xe'),'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 196cddc..8eebc4d 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 _0x4b84=['catch','lodash','util','randomstring','../../config/utils','../../config/logger','rpc','http','then','info','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','Variable,\x20%s,\x20%s','message','ShowVariable','Variable','find','options','raw','where','attributes','include','map','model'];(function(_0x36fe3a,_0x14c406){var _0x465273=function(_0x1297ee){while(--_0x1297ee){_0x36fe3a['push'](_0x36fe3a['shift']());}};_0x465273(++_0x14c406);}(_0x4b84,0x1cc));var _0x44b8=function(_0x2f57b2,_0xa8e91a){_0x2f57b2=_0x2f57b2-0x0;var _0x5ace77=_0x4b84[_0x2f57b2];return _0x5ace77;};'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')]('Variable,\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')]('Variable,\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);});});}exports[_0x44b8('0x10')]=function(_0x55e258){var _0x36743e=this;return new Promise(function(_0xe3de8f,_0x5103f5){return db[_0x44b8('0x11')][_0x44b8('0x12')]({'raw':_0x55e258['options']?_0x55e258[_0x44b8('0x13')][_0x44b8('0x14')]===undefined?!![]:![]:!![],'where':_0x55e258[_0x44b8('0x13')]?_0x55e258[_0x44b8('0x13')][_0x44b8('0x15')]||null:null,'attributes':_0x55e258[_0x44b8('0x13')]?_0x55e258[_0x44b8('0x13')][_0x44b8('0x16')]||null:null,'include':_0x55e258[_0x44b8('0x13')]?_0x55e258[_0x44b8('0x13')][_0x44b8('0x17')]?_[_0x44b8('0x18')](_0x55e258['options'][_0x44b8('0x17')],function(_0x3a8aa4){return{'model':db[_0x3a8aa4[_0x44b8('0x19')]],'as':_0x3a8aa4['as'],'attributes':_0x3a8aa4[_0x44b8('0x16')],'include':_0x3a8aa4[_0x44b8('0x17')]?_['map'](_0x3a8aa4[_0x44b8('0x17')],function(_0x54677c){return{'model':db[_0x54677c[_0x44b8('0x19')]],'as':_0x54677c['as'],'attributes':_0x54677c[_0x44b8('0x16')],'include':_0x54677c[_0x44b8('0x17')]?_[_0x44b8('0x18')](_0x54677c[_0x44b8('0x17')],function(_0x59acbc){return{'model':db[_0x59acbc[_0x44b8('0x19')]],'as':_0x59acbc['as'],'attributes':_0x59acbc['attributes']};}):[]};}):[]};}):[]:[]})[_0x44b8('0x7')](function(_0x350482){logger['info'](_0x44b8('0x10'),_0x55e258);logger[_0x44b8('0xa')](_0x44b8('0x10'),_0x55e258,JSON['stringify'](_0x350482));_0xe3de8f(_0x350482);})[_0x44b8('0x1a')](function(_0x242342){logger['error'](_0x44b8('0x10'),_0x242342['message'],_0x55e258);_0x5103f5(_0x36743e[_0x44b8('0xd')](0x1f4,_0x242342['message']));});});}; \ No newline at end of file +var _0x55ca=['options','where','attributes','include','map','model','lodash','util','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ShowVariable','Variable','find'];(function(_0x282999,_0x4df660){var _0x30681f=function(_0x50e926){while(--_0x50e926){_0x282999['push'](_0x282999['shift']());}};_0x30681f(++_0x4df660);}(_0x55ca,0x126));var _0xa55c=function(_0x2fb87e,_0x483324){_0x2fb87e=_0x2fb87e-0x0;var _0x5de4c1=_0x55ca[_0x2fb87e];return _0x5de4c1;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa55c('0x2'));var db=require(_0xa55c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa55c('0x4'))(_0xa55c('0x5'));var config=require(_0xa55c('0x6'));var jayson=require(_0xa55c('0x7'));var client=jayson[_0xa55c('0x8')][_0xa55c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36b623,_0x4d0624,_0x2121fd){return new BPromise(function(_0x2537f0,_0x57e069){return client[_0xa55c('0xa')](_0x36b623,_0x2121fd)[_0xa55c('0xb')](function(_0x52a3bc){logger['info'](_0xa55c('0xc'),_0x4d0624,_0xa55c('0xd'));logger[_0xa55c('0xe')](_0xa55c('0xf'),_0x4d0624,_0xa55c('0xd'),JSON[_0xa55c('0x10')](_0x52a3bc));if(_0x52a3bc[_0xa55c('0x11')]){if(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x12')]===0x1f4){logger[_0xa55c('0x11')]('Variable,\x20%s,\x20%s',_0x4d0624,_0x52a3bc['error'][_0xa55c('0x13')]);return _0x57e069(_0x52a3bc['error']['message']);}logger['error'](_0xa55c('0xc'),_0x4d0624,_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);return _0x2537f0(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);}else{logger[_0xa55c('0x14')]('Variable,\x20%s,\x20%s',_0x4d0624,_0xa55c('0xd'));_0x2537f0(_0x52a3bc[_0xa55c('0x15')][_0xa55c('0x13')]);}})[_0xa55c('0x16')](function(_0x1c4cfd){logger[_0xa55c('0x11')](_0xa55c('0xc'),_0x4d0624,_0x1c4cfd);_0x57e069(_0x1c4cfd);});});}exports[_0xa55c('0x17')]=function(_0x24783b){var _0x4cee3c=this;return new Promise(function(_0x3d4c9e,_0x104a99){return db[_0xa55c('0x18')][_0xa55c('0x19')]({'raw':_0x24783b[_0xa55c('0x1a')]?_0x24783b[_0xa55c('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x24783b['options']?_0x24783b[_0xa55c('0x1a')][_0xa55c('0x1b')]||null:null,'attributes':_0x24783b[_0xa55c('0x1a')]?_0x24783b['options'][_0xa55c('0x1c')]||null:null,'include':_0x24783b[_0xa55c('0x1a')]?_0x24783b['options'][_0xa55c('0x1d')]?_[_0xa55c('0x1e')](_0x24783b[_0xa55c('0x1a')][_0xa55c('0x1d')],function(_0x234372){return{'model':db[_0x234372['model']],'as':_0x234372['as'],'attributes':_0x234372[_0xa55c('0x1c')],'include':_0x234372['include']?_['map'](_0x234372['include'],function(_0x19ae88){return{'model':db[_0x19ae88['model']],'as':_0x19ae88['as'],'attributes':_0x19ae88[_0xa55c('0x1c')],'include':_0x19ae88[_0xa55c('0x1d')]?_[_0xa55c('0x1e')](_0x19ae88[_0xa55c('0x1d')],function(_0x2313a9){return{'model':db[_0x2313a9[_0xa55c('0x1f')]],'as':_0x2313a9['as'],'attributes':_0x2313a9[_0xa55c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa55c('0xb')](function(_0x192df2){logger[_0xa55c('0x14')](_0xa55c('0x17'),_0x24783b);logger['debug'](_0xa55c('0x17'),_0x24783b,JSON[_0xa55c('0x10')](_0x192df2));_0x3d4c9e(_0x192df2);})[_0xa55c('0x16')](function(_0x906caa){logger['error'](_0xa55c('0x17'),_0x906caa[_0xa55c('0x13')],_0x24783b);_0x104a99(_0x4cee3c[_0xa55c('0x11')](0x1f4,_0x906caa[_0xa55c('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 2c3b9a9..13d87c4 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 _0x10ab=['index','/fetch','fetch','isAuthenticated','canUpdate','/pull','/restart','restart','/migrations','migrations','exports','express','Router','./version.controller','get'];(function(_0x574524,_0x114ff8){var _0x4c6d91=function(_0x5e60eb){while(--_0x5e60eb){_0x574524['push'](_0x574524['shift']());}};_0x4c6d91(++_0x114ff8);}(_0x10ab,0x65));var _0xb10a=function(_0x34d635,_0x2784fc){_0x34d635=_0x34d635-0x0;var _0x3ab288=_0x10ab[_0x34d635];return _0x3ab288;};'use strict';var express=require(_0xb10a('0x0'));var router=express[_0xb10a('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xb10a('0x2'));router[_0xb10a('0x3')]('/',controller[_0xb10a('0x4')]);router[_0xb10a('0x3')](_0xb10a('0x5'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0xb10a('0x6')]);router[_0xb10a('0x3')]('/reset',auth[_0xb10a('0x7')](),auth[_0xb10a('0x8')](),controller['reset']);router[_0xb10a('0x3')](_0xb10a('0x9'),auth[_0xb10a('0x7')](),auth[_0xb10a('0x8')](),controller['pull']);router[_0xb10a('0x3')](_0xb10a('0xa'),auth['isAuthenticated'](),controller[_0xb10a('0xb')]);router[_0xb10a('0x3')](_0xb10a('0xc'),controller[_0xb10a('0xd')]);module[_0xb10a('0xe')]=router; \ No newline at end of file +var _0x35de=['/restart','restart','migrations','exports','Router','../../components/auth/service','./version.controller','get','index','isAuthenticated','fetch','/reset','canUpdate','reset','/pull','pull'];(function(_0xa5a3be,_0x35069e){var _0x3b6dfb=function(_0x2954cd){while(--_0x2954cd){_0xa5a3be['push'](_0xa5a3be['shift']());}};_0x3b6dfb(++_0x35069e);}(_0x35de,0x1d4));var _0xe35d=function(_0x3050ca,_0x3e36b0){_0x3050ca=_0x3050ca-0x0;var _0x1eed1d=_0x35de[_0x3050ca];return _0x1eed1d;};'use strict';var express=require('express');var router=express[_0xe35d('0x0')]();var auth=require(_0xe35d('0x1'));var controller=require(_0xe35d('0x2'));router[_0xe35d('0x3')]('/',controller[_0xe35d('0x4')]);router['get']('/fetch',auth[_0xe35d('0x5')](),auth['canUpdate'](),controller[_0xe35d('0x6')]);router[_0xe35d('0x3')](_0xe35d('0x7'),auth['isAuthenticated'](),auth[_0xe35d('0x8')](),controller[_0xe35d('0x9')]);router['get'](_0xe35d('0xa'),auth[_0xe35d('0x5')](),auth[_0xe35d('0x8')](),controller[_0xe35d('0xb')]);router[_0xe35d('0x3')](_0xe35d('0xc'),auth[_0xe35d('0x5')](),controller[_0xe35d('0xd')]);router[_0xe35d('0x3')]('/migrations',controller[_0xe35d('0xe')]);module[_0xe35d('0xf')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index cb906a4..71eebdb 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 _0x2fe5=['compare-versions','exec','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','simple-git','root','index','exports','query','latest','fetch','tags','2.0.0','status','json','origin','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','error','git\x20reset\x20--hard\x20FETCH_HEAD','pull','npm\x20install\x20--production','restart','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','replace','.js','push','length','sort','sequelize','getQueryInterface','constructor','join','server','map','then','Database\x20migrated\x20successfully\x20from\x20version\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','pkginfo','version'];(function(_0x40c63a,_0x4d27){var _0x2dfc12=function(_0x4369bf){while(--_0x4369bf){_0x40c63a['push'](_0x40c63a['shift']());}};_0x2dfc12(++_0x4d27);}(_0x2fe5,0x68));var _0x52fe=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x2fe5[_0x4565bf];return _0x5610ba;};'use strict';var Umzug=require(_0x52fe('0x0'));var path=require(_0x52fe('0x1'));var fs=require('fs');var _=require('lodash');var pkginfo=require(_0x52fe('0x2'))(module,_0x52fe('0x3'));var compareVersions=require(_0x52fe('0x4'));var exec=require('child_process')[_0x52fe('0x5')];var db=require(_0x52fe('0x6'))['db'];var config=require(_0x52fe('0x7'));var pm2=require(_0x52fe('0x8'));var logger=require(_0x52fe('0x9'))('update');var git=require(_0x52fe('0xa'))(config[_0x52fe('0xb')]);exports[_0x52fe('0xc')]=function(_0x123552,_0x4ce571){var _0x1fb024={'current':module[_0x52fe('0xd')]['version'],'phonebar':0x2};if(_0x123552[_0x52fe('0xe')]&&_0x123552['query'][_0x52fe('0xf')]){return git[_0x52fe('0x10')]()[_0x52fe('0x11')](function(_0xd0f955,_0x313b63){_0x1fb024['latest']=(_0xd0f955?module[_0x52fe('0xd')][_0x52fe('0x3')]:_0x313b63['latest'])||_0x52fe('0x12');return _0x4ce571[_0x52fe('0x13')](0xc8)[_0x52fe('0x14')](_0x1fb024);});}else{return _0x4ce571[_0x52fe('0x13')](0xc8)['json'](_0x1fb024);}};exports[_0x52fe('0x10')]=function(_0x4a6586,_0x719554){return git['fetch']([_0x52fe('0x15'),'master'],function(_0x3be2f6){if(_0x3be2f6){logger['error'](_0x3be2f6);return _0x719554['status'](0x1f4)[_0x52fe('0x14')](_0x3be2f6);}logger[_0x52fe('0x16')](_0x52fe('0x17'));return _0x719554['status'](0xc8)[_0x52fe('0x14')]({'output':_0x52fe('0x18')});});};exports[_0x52fe('0x19')]=function(_0x99be95,_0x39a4f4){return git[_0x52fe('0x19')]([_0x52fe('0x1a'),_0x52fe('0x1b')],function(_0x20515e){if(_0x20515e){logger[_0x52fe('0x1c')](_0x20515e);return _0x39a4f4[_0x52fe('0x13')](0x1f4)[_0x52fe('0x14')](_0x20515e);}logger['info'](_0x52fe('0x1d'));return _0x39a4f4[_0x52fe('0x13')](0xc8)['json']({'output':'git\x20reset\x20--hard'});});};exports[_0x52fe('0x1e')]=function(_0x1f31cb,_0x2bf0c6){exec(_0x52fe('0x1f'),function(_0xd4017e,_0x262bba,_0x1d80cb){logger['info'](_0x262bba);logger[_0x52fe('0x16')](_0x1d80cb);if(_0xd4017e){logger[_0x52fe('0x1c')](_0xd4017e);return _0x2bf0c6[_0x52fe('0x13')](0x1f4)['json'](_0xd4017e);}return _0x2bf0c6['status'](0xc8)[_0x52fe('0x14')]({'output':_0x262bba});});};exports[_0x52fe('0x20')]=function(_0x356603,_0x1f33d8){return pm2[_0x52fe('0x20')]('motion2')['then'](function(_0x43b10d){logger['info'](_0x52fe('0x21'),_0x43b10d);return _0x1f33d8[_0x52fe('0x13')](0xc8)[_0x52fe('0x14')]({'output':_0x52fe('0x22')});})[_0x52fe('0x23')](function(_0x213e7a){logger['error'](_0x213e7a);return _0x1f33d8[_0x52fe('0x13')](0x1f4)[_0x52fe('0x14')](_0x213e7a);});};exports[_0x52fe('0x24')]=function(_0x8ed3f7,_0x171d32){var _0x45a507=fs[_0x52fe('0x25')](path['join'](config[_0x52fe('0xb')],'server',_0x52fe('0x24')));var _0x283e6e=[];for(var _0x2b67cf=0x0;_0x2b67cf<_0x45a507['length'];_0x2b67cf++){var _0x4885c1=_0x45a507[_0x2b67cf][_0x52fe('0x26')](_0x52fe('0x27'),'');if(compareVersions(module['exports'][_0x52fe('0x3')],_0x4885c1)===-0x1){_0x283e6e[_0x52fe('0x28')](_0x4885c1);}}if(_0x283e6e[_0x52fe('0x29')]){var _0x10b13b=_0x283e6e[_0x52fe('0x2a')](compareVersions);var _0x479d9d=new Umzug({'storage':_0x52fe('0x2b'),'storageOptions':{'model':db['Migration'],'modelName':'Migration','columnName':_0x52fe('0x3')},'migrations':{'params':[db[_0x52fe('0x2b')][_0x52fe('0x2c')](),db[_0x52fe('0x2b')][_0x52fe('0x2d')],function(){throw new Error('Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.');}],'path':path[_0x52fe('0x2e')](config[_0x52fe('0xb')],_0x52fe('0x2f'),'migrations'),'pattern':/\.js$/}});_0x479d9d['up']({'migrations':_[_0x52fe('0x30')](_0x10b13b,function(_0x567b00){return _0x567b00+'.js';})})[_0x52fe('0x31')](function(){return _0x171d32['status'](0xc8)['json']({'output':_0x52fe('0x32')+module[_0x52fe('0xd')][_0x52fe('0x3')]+'\x20to\x20'+_[_0x52fe('0x33')](_0x10b13b),'migrations':_[_0x52fe('0x2e')](_0x10b13b)});})[_0x52fe('0x23')](function(_0x549d5d){if(_0x549d5d instanceof db['sequelize'][_0x52fe('0x34')]){return _0x171d32['status'](0xc8)[_0x52fe('0x14')]({'output':_0x52fe('0x35')});}else{return _0x171d32[_0x52fe('0x13')](0x1f4)[_0x52fe('0x14')](_0x549d5d);}});}else{return _0x171d32[_0x52fe('0x13')](0xc8)[_0x52fe('0x14')]({'output':_0x52fe('0x35')});}}; \ No newline at end of file +var _0xfd67=['catch','migrations','readdirSync','join','replace','.js','push','length','sort','sequelize','Migration','getQueryInterface','constructor','server','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','lodash','pkginfo','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','simple-git','root','index','exports','version','query','latest','fetch','tags','status','json','origin','master','error','info','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','then','pm2\x20restart\x20motion\x20%s'];(function(_0x2e7c87,_0x4d357d){var _0x3ff361=function(_0x272bb5){while(--_0x272bb5){_0x2e7c87['push'](_0x2e7c87['shift']());}};_0x3ff361(++_0x4d357d);}(_0xfd67,0x1cc));var _0x7fd6=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xfd67[_0x2641f9];return _0x585741;};'use strict';var Umzug=require(_0x7fd6('0x0'));var path=require('path');var fs=require('fs');var _=require(_0x7fd6('0x1'));var pkginfo=require(_0x7fd6('0x2'))(module,'version');var compareVersions=require('compare-versions');var exec=require(_0x7fd6('0x3'))[_0x7fd6('0x4')];var db=require(_0x7fd6('0x5'))['db'];var config=require(_0x7fd6('0x6'));var pm2=require(_0x7fd6('0x7'));var logger=require(_0x7fd6('0x8'))('update');var git=require(_0x7fd6('0x9'))(config[_0x7fd6('0xa')]);exports[_0x7fd6('0xb')]=function(_0x6dfabc,_0x4385f5){var _0x136856={'current':module[_0x7fd6('0xc')][_0x7fd6('0xd')],'phonebar':0x2};if(_0x6dfabc['query']&&_0x6dfabc[_0x7fd6('0xe')][_0x7fd6('0xf')]){return git[_0x7fd6('0x10')]()[_0x7fd6('0x11')](function(_0x5dbf28,_0x507b74){_0x136856[_0x7fd6('0xf')]=(_0x5dbf28?module[_0x7fd6('0xc')]['version']:_0x507b74[_0x7fd6('0xf')])||'2.0.0';return _0x4385f5[_0x7fd6('0x12')](0xc8)[_0x7fd6('0x13')](_0x136856);});}else{return _0x4385f5['status'](0xc8)['json'](_0x136856);}};exports[_0x7fd6('0x10')]=function(_0x5d1a9c,_0x57e515){return git['fetch']([_0x7fd6('0x14'),_0x7fd6('0x15')],function(_0x516ce9){if(_0x516ce9){logger[_0x7fd6('0x16')](_0x516ce9);return _0x57e515[_0x7fd6('0x12')](0x1f4)[_0x7fd6('0x13')](_0x516ce9);}logger[_0x7fd6('0x17')]('git\x20fetch');return _0x57e515[_0x7fd6('0x12')](0xc8)['json']({'output':_0x7fd6('0x18')});});};exports['reset']=function(_0x5dc536,_0x3b4733){return git[_0x7fd6('0x19')]([_0x7fd6('0x1a'),_0x7fd6('0x1b')],function(_0x31019e){if(_0x31019e){logger[_0x7fd6('0x16')](_0x31019e);return _0x3b4733[_0x7fd6('0x12')](0x1f4)['json'](_0x31019e);}logger['info']('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x3b4733[_0x7fd6('0x12')](0xc8)[_0x7fd6('0x13')]({'output':_0x7fd6('0x1c')});});};exports[_0x7fd6('0x1d')]=function(_0x5ea5d3,_0x1a8629){exec(_0x7fd6('0x1e'),function(_0x5d623c,_0x329223,_0x4a401a){logger[_0x7fd6('0x17')](_0x329223);logger[_0x7fd6('0x17')](_0x4a401a);if(_0x5d623c){logger['error'](_0x5d623c);return _0x1a8629[_0x7fd6('0x12')](0x1f4)[_0x7fd6('0x13')](_0x5d623c);}return _0x1a8629[_0x7fd6('0x12')](0xc8)[_0x7fd6('0x13')]({'output':_0x329223});});};exports[_0x7fd6('0x1f')]=function(_0x3378bc,_0x41d558){return pm2['restart'](_0x7fd6('0x20'))[_0x7fd6('0x21')](function(_0x32176b){logger[_0x7fd6('0x17')](_0x7fd6('0x22'),_0x32176b);return _0x41d558[_0x7fd6('0x12')](0xc8)[_0x7fd6('0x13')]({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})[_0x7fd6('0x23')](function(_0x426459){logger[_0x7fd6('0x16')](_0x426459);return _0x41d558[_0x7fd6('0x12')](0x1f4)[_0x7fd6('0x13')](_0x426459);});};exports[_0x7fd6('0x24')]=function(_0x315e57,_0x463a7b){var _0x5f45bf=fs[_0x7fd6('0x25')](path[_0x7fd6('0x26')](config[_0x7fd6('0xa')],'server',_0x7fd6('0x24')));var _0x4672ae=[];for(var _0x85cd58=0x0;_0x85cd58<_0x5f45bf['length'];_0x85cd58++){var _0x198fda=_0x5f45bf[_0x85cd58][_0x7fd6('0x27')](_0x7fd6('0x28'),'');if(compareVersions(module[_0x7fd6('0xc')][_0x7fd6('0xd')],_0x198fda)===-0x1){_0x4672ae[_0x7fd6('0x29')](_0x198fda);}}if(_0x4672ae[_0x7fd6('0x2a')]){var _0x262a76=_0x4672ae[_0x7fd6('0x2b')](compareVersions);var _0x391ed0=new Umzug({'storage':_0x7fd6('0x2c'),'storageOptions':{'model':db[_0x7fd6('0x2d')],'modelName':_0x7fd6('0x2d'),'columnName':_0x7fd6('0xd')},'migrations':{'params':[db[_0x7fd6('0x2c')][_0x7fd6('0x2e')](),db['sequelize'][_0x7fd6('0x2f')],function(){throw new Error('Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.');}],'path':path['join'](config[_0x7fd6('0xa')],_0x7fd6('0x30'),_0x7fd6('0x24')),'pattern':/\.js$/}});_0x391ed0['up']({'migrations':_[_0x7fd6('0x31')](_0x262a76,function(_0x1afbcc){return _0x1afbcc+_0x7fd6('0x28');})})['then'](function(){return _0x463a7b[_0x7fd6('0x12')](0xc8)['json']({'output':_0x7fd6('0x32')+module[_0x7fd6('0xc')][_0x7fd6('0xd')]+_0x7fd6('0x33')+_[_0x7fd6('0x34')](_0x262a76),'migrations':_[_0x7fd6('0x26')](_0x262a76)});})[_0x7fd6('0x23')](function(_0x18137c){if(_0x18137c instanceof db['sequelize'][_0x7fd6('0x35')]){return _0x463a7b['status'](0xc8)[_0x7fd6('0x13')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x463a7b[_0x7fd6('0x12')](0x1f4)[_0x7fd6('0x13')](_0x18137c);}});}else{return _0x463a7b[_0x7fd6('0x12')](0xc8)[_0x7fd6('0x13')]({'output':_0x7fd6('0x36')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index fa04fe7..3ed776b 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 _0x3d74=['../../config/environment','get','isAuthenticated','index','/describe','show','post','create','put','/:id','update','delete','exports','path','express','Router','fs-extra'];(function(_0x457702,_0xa7824e){var _0x3a7f11=function(_0x10def0){while(--_0x10def0){_0x457702['push'](_0x457702['shift']());}};_0x3a7f11(++_0xa7824e);}(_0x3d74,0x183));var _0x43d7=function(_0x56d2a8,_0x37d4ae){_0x56d2a8=_0x56d2a8-0x0;var _0x23b40c=_0x3d74[_0x56d2a8];return _0x23b40c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x43d7('0x0'));var timeout=require('connect-timeout');var express=require(_0x43d7('0x1'));var router=express[_0x43d7('0x2')]();var fs_extra=require(_0x43d7('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x43d7('0x4'));var controller=require('./voiceAgentReport.controller');router[_0x43d7('0x5')]('/',auth[_0x43d7('0x6')](),controller[_0x43d7('0x7')]);router[_0x43d7('0x5')](_0x43d7('0x8'),auth['isAuthenticated'](),controller['describe']);router[_0x43d7('0x5')]('/:id',auth['isAuthenticated'](),controller[_0x43d7('0x9')]);router[_0x43d7('0xa')]('/',auth[_0x43d7('0x6')](),controller[_0x43d7('0xb')]);router[_0x43d7('0xc')](_0x43d7('0xd'),auth['isAuthenticated'](),controller[_0x43d7('0xe')]);router[_0x43d7('0xf')]('/:id',auth[_0x43d7('0x6')](),controller['destroy']);module[_0x43d7('0x10')]=router; \ No newline at end of file +var _0x6eb3=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','/describe','isAuthenticated','describe','/:id','post','create'];(function(_0x54e64b,_0x376532){var _0x19ac0e=function(_0x37c7d3){while(--_0x37c7d3){_0x54e64b['push'](_0x54e64b['shift']());}};_0x19ac0e(++_0x376532);}(_0x6eb3,0x11d));var _0x36eb=function(_0x2bc7a1,_0x50a273){_0x2bc7a1=_0x2bc7a1-0x0;var _0x3bc804=_0x6eb3[_0x2bc7a1];return _0x3bc804;};'use strict';var multer=require(_0x36eb('0x0'));var util=require(_0x36eb('0x1'));var path=require(_0x36eb('0x2'));var timeout=require(_0x36eb('0x3'));var express=require('express');var router=express[_0x36eb('0x4')]();var fs_extra=require(_0x36eb('0x5'));var auth=require(_0x36eb('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x36eb('0x7'));var controller=require('./voiceAgentReport.controller');router[_0x36eb('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x36eb('0x8')](_0x36eb('0x9'),auth[_0x36eb('0xa')](),controller[_0x36eb('0xb')]);router['get'](_0x36eb('0xc'),auth[_0x36eb('0xa')](),controller['show']);router[_0x36eb('0xd')]('/',auth['isAuthenticated'](),controller[_0x36eb('0xe')]);router[_0x36eb('0xf')](_0x36eb('0xc'),auth[_0x36eb('0xa')](),controller[_0x36eb('0x10')]);router[_0x36eb('0x11')](_0x36eb('0xc'),auth[_0x36eb('0xa')](),controller[_0x36eb('0x12')]);module[_0x36eb('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 4eb9291..673d0f3 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 _0x2964=['STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports'];(function(_0x34b69c,_0x2a64f3){var _0x1c04dc=function(_0x3027ac){while(--_0x3027ac){_0x34b69c['push'](_0x34b69c['shift']());}};_0x1c04dc(++_0x2a64f3);}(_0x2964,0x108));var _0x4296=function(_0x127710,_0x4623a4){_0x127710=_0x127710-0x0;var _0x32b31f=_0x2964[_0x127710];return _0x32b31f;};'use strict';var Sequelize=require(_0x4296('0x0'));module[_0x4296('0x1')]={'type':{'type':Sequelize[_0x4296('0x2')]},'uniqueid':{'type':Sequelize[_0x4296('0x2')]},'calleridnum':{'type':Sequelize[_0x4296('0x2')]},'calleridname':{'type':Sequelize[_0x4296('0x2')]},'queue':{'type':Sequelize[_0x4296('0x2')]},'interface':{'type':Sequelize[_0x4296('0x2')]},'membername':{'type':Sequelize[_0x4296('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x4296('0x3')]},'agentcompleteAt':{'type':Sequelize[_0x4296('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0x4296('0x3')]},'agentdumpAt':{'type':Sequelize[_0x4296('0x3')]},'holdtime':{'type':Sequelize[_0x4296('0x4')]},'agentcomplete':{'type':Sequelize[_0x4296('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x4296('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x4296('0x4')]},'agentacw':{'type':Sequelize[_0x4296('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x4296('0x4')]},'reason':{'type':Sequelize[_0x4296('0x2')]},'lastevent':{'type':Sequelize[_0x4296('0x2')]},'channel':{'type':Sequelize[_0x4296('0x2')]},'channelstate':{'type':Sequelize[_0x4296('0x4')]},'channelstatedesc':{'type':Sequelize[_0x4296('0x2')]},'connectedlinenum':{'type':Sequelize[_0x4296('0x2')]},'connectedlinename':{'type':Sequelize[_0x4296('0x2')]},'language':{'type':Sequelize[_0x4296('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x4296('0x2')]},'exten':{'type':Sequelize[_0x4296('0x2')]},'priority':{'type':Sequelize[_0x4296('0x2')]},'destchannel':{'type':Sequelize[_0x4296('0x2')]},'destchannelstate':{'type':Sequelize[_0x4296('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x4296('0x2')]},'destcalleridnum':{'type':Sequelize[_0x4296('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x4296('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x4296('0x2')]},'destlanguage':{'type':Sequelize[_0x4296('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x4296('0x2')]},'destexten':{'type':Sequelize[_0x4296('0x2')]},'destpriority':{'type':Sequelize[_0x4296('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x4296('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0x4296('0x2')]},'transfer':{'type':Sequelize[_0x4296('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x4296('0x6')},'transferexten':{'type':Sequelize[_0x4296('0x2')]},'transferuniqueid':{'type':Sequelize[_0x4296('0x2')]},'agententerreason':{'type':Sequelize[_0x4296('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x3264=['FORWARD,\x20BLIND,\x20ATTENDED','exports','STRING','DATE','BOOLEAN','INTEGER'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3264,0x7f));var _0x4326=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0x3264[_0x3b0731];return _0x4204d7;};'use strict';var Sequelize=require('sequelize');module[_0x4326('0x0')]={'type':{'type':Sequelize[_0x4326('0x1')]},'uniqueid':{'type':Sequelize[_0x4326('0x1')]},'calleridnum':{'type':Sequelize[_0x4326('0x1')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x4326('0x1')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x4326('0x2')]},'agentcompleteAt':{'type':Sequelize[_0x4326('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0x4326('0x2')]},'agentdumpAt':{'type':Sequelize[_0x4326('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x4326('0x3')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x4326('0x3')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x4326('0x3')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x4326('0x4')]},'agentacw':{'type':Sequelize[_0x4326('0x3')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x4326('0x4')]},'reason':{'type':Sequelize[_0x4326('0x1')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x4326('0x4')]},'channelstatedesc':{'type':Sequelize[_0x4326('0x1')]},'connectedlinenum':{'type':Sequelize[_0x4326('0x1')]},'connectedlinename':{'type':Sequelize[_0x4326('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x4326('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x4326('0x1')]},'destchannel':{'type':Sequelize[_0x4326('0x1')]},'destchannelstate':{'type':Sequelize[_0x4326('0x4')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x4326('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x4326('0x1')]},'destaccountcode':{'type':Sequelize[_0x4326('0x1')]},'destcontext':{'type':Sequelize[_0x4326('0x1')]},'destexten':{'type':Sequelize[_0x4326('0x1')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x4326('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x4326('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0x4326('0x1')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x4326('0x1')],'comment':_0x4326('0x5')},'transferexten':{'type':Sequelize[_0x4326('0x1')]},'transferuniqueid':{'type':Sequelize[_0x4326('0x1')]},'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 f630b6b..623e557 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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'use strict';var 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(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'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 bbfee28..47ecfc6 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 _0xb2ac=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','lodash','util'];(function(_0x4c3e95,_0x4f0d5c){var _0x14c5f1=function(_0x5d50bb){while(--_0x5d50bb){_0x4c3e95['push'](_0x4c3e95['shift']());}};_0x14c5f1(++_0x4f0d5c);}(_0xb2ac,0x16a));var _0xcb2a=function(_0x45761c,_0x16c4fa){_0x45761c=_0x45761c-0x0;var _0x3f695a=_0xb2ac[_0x45761c];return _0x3f695a;};'use strict';var _=require(_0xcb2a('0x0'));var util=require(_0xcb2a('0x1'));var logger=require(_0xcb2a('0x2'))(_0xcb2a('0x3'));var moment=require(_0xcb2a('0x4'));var BPromise=require(_0xcb2a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcb2a('0x6'));var rimraf=require(_0xcb2a('0x7'));var config=require(_0xcb2a('0x8'));var attributes=require(_0xcb2a('0x9'));module[_0xcb2a('0xa')]=function(_0x1fe0b6,_0x4e4df3){return _0x1fe0b6[_0xcb2a('0xb')](_0xcb2a('0xc'),attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':['uniqueid','destuniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x1354=['rimraf','../../config/environment','./voiceAgentReport.attributes','VoiceAgentReport','report_agent','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1477ef,_0x54a5d6){var _0x164acd=function(_0x139149){while(--_0x139149){_0x1477ef['push'](_0x1477ef['shift']());}};_0x164acd(++_0x54a5d6);}(_0x1354,0x95));var _0x4135=function(_0x262baa,_0x283058){_0x262baa=_0x262baa-0x0;var _0x4f2257=_0x1354[_0x262baa];return _0x4f2257;};'use strict';var _=require(_0x4135('0x0'));var util=require(_0x4135('0x1'));var logger=require(_0x4135('0x2'))(_0x4135('0x3'));var moment=require(_0x4135('0x4'));var BPromise=require(_0x4135('0x5'));var rp=require(_0x4135('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4135('0x7'));var config=require(_0x4135('0x8'));var attributes=require(_0x4135('0x9'));module['exports']=function(_0x14ff47,_0x2bcd68){return _0x14ff47['define'](_0x4135('0xa'),attributes,{'tableName':_0x4135('0xb'),'paranoid':![],'indexes':[{'fields':[_0x4135('0xc'),'destuniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 8df2e28..07acc75 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 _0x88bd=['message','result','catch','CreateVoiceAgentReport','create','body','options','raw','debug','VoiceAgentReport','update','where','limit','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','VoiceAgentReport,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x1d6dfb,_0x2d08e5){var _0x1a8fbb=function(_0x212550){while(--_0x212550){_0x1d6dfb['push'](_0x1d6dfb['shift']());}};_0x1a8fbb(++_0x2d08e5);}(_0x88bd,0x116));var _0xd88b=function(_0x5067aa,_0x2f7a98){_0x5067aa=_0x5067aa-0x0;var _0x32408a=_0x88bd[_0x5067aa];return _0x32408a;};'use strict';var _=require('lodash');var util=require(_0xd88b('0x0'));var moment=require(_0xd88b('0x1'));var BPromise=require(_0xd88b('0x2'));var rs=require(_0xd88b('0x3'));var fs=require('fs');var Redis=require(_0xd88b('0x4'));var db=require(_0xd88b('0x5'))['db'];var utils=require(_0xd88b('0x6'));var logger=require('../../config/logger')(_0xd88b('0x7'));var config=require('../../config/environment');var jayson=require(_0xd88b('0x8'));var client=jayson[_0xd88b('0x9')][_0xd88b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41ff40,_0x318c96,_0x46d315){return new BPromise(function(_0x3d05c4,_0x3c0c29){return client[_0xd88b('0xb')](_0x41ff40,_0x46d315)[_0xd88b('0xc')](function(_0x833dfc){logger[_0xd88b('0xd')](_0xd88b('0xe'),_0x318c96,_0xd88b('0xf'));logger['debug'](_0xd88b('0x10'),_0x318c96,_0xd88b('0xf'),JSON['stringify'](_0x833dfc));if(_0x833dfc[_0xd88b('0x11')]){if(_0x833dfc[_0xd88b('0x11')][_0xd88b('0x12')]===0x1f4){logger['error'](_0xd88b('0xe'),_0x318c96,_0x833dfc['error'][_0xd88b('0x13')]);return _0x3c0c29(_0x833dfc['error'][_0xd88b('0x13')]);}logger[_0xd88b('0x11')](_0xd88b('0xe'),_0x318c96,_0x833dfc[_0xd88b('0x11')]['message']);return _0x3d05c4(_0x833dfc[_0xd88b('0x11')][_0xd88b('0x13')]);}else{logger[_0xd88b('0xd')](_0xd88b('0xe'),_0x318c96,_0xd88b('0xf'));_0x3d05c4(_0x833dfc[_0xd88b('0x14')][_0xd88b('0x13')]);}})[_0xd88b('0x15')](function(_0x25ffa5){logger['error'](_0xd88b('0xe'),_0x318c96,_0x25ffa5);_0x3c0c29(_0x25ffa5);});});}exports[_0xd88b('0x16')]=function(_0x513a3d){var _0x4b8401=this;return new Promise(function(_0x5150d5,_0x357c08){return db['VoiceAgentReport'][_0xd88b('0x17')](_0x513a3d[_0xd88b('0x18')],{'raw':_0x513a3d[_0xd88b('0x19')]?_0x513a3d['options'][_0xd88b('0x1a')]===undefined?!![]:![]:!![]})[_0xd88b('0xc')](function(_0x15aa1a){logger[_0xd88b('0xd')](_0xd88b('0x16'),_0x513a3d);logger[_0xd88b('0x1b')](_0xd88b('0x16'),_0x513a3d,JSON['stringify'](_0x15aa1a));_0x5150d5(_0x15aa1a);})[_0xd88b('0x15')](function(_0x3d0d3a){logger[_0xd88b('0x11')]('CreateVoiceAgentReport',_0x3d0d3a[_0xd88b('0x13')],_0x513a3d);_0x357c08(_0x4b8401[_0xd88b('0x11')](0x1f4,_0x3d0d3a[_0xd88b('0x13')]));});});};exports['UpdateVoiceAgentReport']=function(_0x10d003){var _0x47d556=this;return new Promise(function(_0x45ed44,_0x399fbe){return db[_0xd88b('0x1c')][_0xd88b('0x1d')](_0x10d003[_0xd88b('0x18')],{'raw':_0x10d003[_0xd88b('0x19')]?_0x10d003['options'][_0xd88b('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x10d003[_0xd88b('0x19')]?_0x10d003[_0xd88b('0x19')][_0xd88b('0x1e')]||null:null,'attributes':_0x10d003['options']?_0x10d003[_0xd88b('0x19')]['attributes']||null:null,'limit':_0x10d003['options']?_0x10d003[_0xd88b('0x19')][_0xd88b('0x1f')]||null:null})[_0xd88b('0xc')](function(_0x503f6c){logger[_0xd88b('0xd')]('UpdateVoiceAgentReport',_0x10d003);logger['debug']('UpdateVoiceAgentReport',_0x10d003,JSON[_0xd88b('0x20')](_0x503f6c));_0x45ed44(_0x503f6c);})[_0xd88b('0x15')](function(_0xee0480){logger[_0xd88b('0x11')]('UpdateVoiceAgentReport',_0xee0480[_0xd88b('0x13')],_0x10d003);_0x399fbe(_0x47d556[_0xd88b('0x11')](0x1f4,_0xee0480[_0xd88b('0x13')]));});});}; \ No newline at end of file +var _0x2cc0=['../../config/logger','rpc','jayson/promise','http','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateVoiceAgentReport','body','options','raw','VoiceAgentReport','update','where','limit','UpdateVoiceAgentReport','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x488699,_0x376ba5){var _0x280f9b=function(_0x4873a9){while(--_0x4873a9){_0x488699['push'](_0x488699['shift']());}};_0x280f9b(++_0x376ba5);}(_0x2cc0,0x19a));var _0x02cc=function(_0x68f1e7,_0xd8ad2){_0x68f1e7=_0x68f1e7-0x0;var _0x18ed78=_0x2cc0[_0x68f1e7];return _0x18ed78;};'use strict';var _=require(_0x02cc('0x0'));var util=require(_0x02cc('0x1'));var moment=require(_0x02cc('0x2'));var BPromise=require('bluebird');var rs=require(_0x02cc('0x3'));var fs=require('fs');var Redis=require(_0x02cc('0x4'));var db=require(_0x02cc('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x02cc('0x6'))(_0x02cc('0x7'));var config=require('../../config/environment');var jayson=require(_0x02cc('0x8'));var client=jayson['client'][_0x02cc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4ca1fc,_0x4c3f29,_0x4cbecb){return new BPromise(function(_0x3eeb30,_0x230ca9){return client[_0x02cc('0xa')](_0x4ca1fc,_0x4cbecb)[_0x02cc('0xb')](function(_0x140ccc){logger[_0x02cc('0xc')](_0x02cc('0xd'),_0x4c3f29,_0x02cc('0xe'));logger[_0x02cc('0xf')](_0x02cc('0x10'),_0x4c3f29,'request\x20sent',JSON[_0x02cc('0x11')](_0x140ccc));if(_0x140ccc[_0x02cc('0x12')]){if(_0x140ccc['error'][_0x02cc('0x13')]===0x1f4){logger[_0x02cc('0x12')](_0x02cc('0xd'),_0x4c3f29,_0x140ccc['error'][_0x02cc('0x14')]);return _0x230ca9(_0x140ccc[_0x02cc('0x12')][_0x02cc('0x14')]);}logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0x4c3f29,_0x140ccc['error'][_0x02cc('0x14')]);return _0x3eeb30(_0x140ccc[_0x02cc('0x12')]['message']);}else{logger[_0x02cc('0xc')](_0x02cc('0xd'),_0x4c3f29,'request\x20sent');_0x3eeb30(_0x140ccc[_0x02cc('0x15')]['message']);}})['catch'](function(_0x3f1a3d){logger[_0x02cc('0x12')]('VoiceAgentReport,\x20%s,\x20%s',_0x4c3f29,_0x3f1a3d);_0x230ca9(_0x3f1a3d);});});}exports[_0x02cc('0x16')]=function(_0x1adbaf){var _0x22119a=this;return new Promise(function(_0x2dac40,_0xf8d4dc){return db['VoiceAgentReport']['create'](_0x1adbaf[_0x02cc('0x17')],{'raw':_0x1adbaf[_0x02cc('0x18')]?_0x1adbaf[_0x02cc('0x18')][_0x02cc('0x19')]===undefined?!![]:![]:!![]})[_0x02cc('0xb')](function(_0x31e188){logger[_0x02cc('0xc')](_0x02cc('0x16'),_0x1adbaf);logger['debug']('CreateVoiceAgentReport',_0x1adbaf,JSON[_0x02cc('0x11')](_0x31e188));_0x2dac40(_0x31e188);})['catch'](function(_0x3cf311){logger[_0x02cc('0x12')](_0x02cc('0x16'),_0x3cf311[_0x02cc('0x14')],_0x1adbaf);_0xf8d4dc(_0x22119a['error'](0x1f4,_0x3cf311['message']));});});};exports['UpdateVoiceAgentReport']=function(_0x18db5d){var _0xadc817=this;return new Promise(function(_0x5a756d,_0x57952c){return db[_0x02cc('0x1a')][_0x02cc('0x1b')](_0x18db5d[_0x02cc('0x17')],{'raw':_0x18db5d['options']?_0x18db5d[_0x02cc('0x18')][_0x02cc('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x18db5d[_0x02cc('0x18')]?_0x18db5d[_0x02cc('0x18')][_0x02cc('0x1c')]||null:null,'attributes':_0x18db5d[_0x02cc('0x18')]?_0x18db5d['options']['attributes']||null:null,'limit':_0x18db5d[_0x02cc('0x18')]?_0x18db5d[_0x02cc('0x18')][_0x02cc('0x1d')]||null:null})['then'](function(_0xf23ea2){logger[_0x02cc('0xc')](_0x02cc('0x1e'),_0x18db5d);logger[_0x02cc('0xf')]('UpdateVoiceAgentReport',_0x18db5d,JSON[_0x02cc('0x11')](_0xf23ea2));_0x5a756d(_0xf23ea2);})[_0x02cc('0x1f')](function(_0x18cb13){logger['error'](_0x02cc('0x1e'),_0x18cb13[_0x02cc('0x14')],_0x18db5d);_0x57952c(_0xadc817[_0x02cc('0x12')](0x1f4,_0x18cb13[_0x02cc('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index e5240fc..abe360d 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 _0x303a=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','index','/describe','/:id','post','create','update','delete','exports','multer','path'];(function(_0x5d2265,_0x216789){var _0x4844bb=function(_0x2bdc10){while(--_0x2bdc10){_0x5d2265['push'](_0x5d2265['shift']());}};_0x4844bb(++_0x216789);}(_0x303a,0x1a0));var _0xa303=function(_0x4ff443,_0x5e1148){_0x4ff443=_0x4ff443-0x0;var _0x12832a=_0x303a[_0x4ff443];return _0x12832a;};'use strict';var multer=require(_0xa303('0x0'));var util=require('util');var path=require(_0xa303('0x1'));var timeout=require(_0xa303('0x2'));var express=require(_0xa303('0x3'));var router=express[_0xa303('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa303('0x5'));var interaction=require(_0xa303('0x6'));var config=require(_0xa303('0x7'));var controller=require(_0xa303('0x8'));router[_0xa303('0x9')]('/',auth[_0xa303('0xa')](),controller[_0xa303('0xb')]);router[_0xa303('0x9')](_0xa303('0xc'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xa303('0xd'),auth[_0xa303('0xa')](),controller['show']);router[_0xa303('0xe')]('/',auth['isAuthenticated'](),controller[_0xa303('0xf')]);router['put'](_0xa303('0xd'),auth[_0xa303('0xa')](),controller[_0xa303('0x10')]);router[_0xa303('0x11')]('/:id',auth[_0xa303('0xa')](),controller['destroy']);module[_0xa303('0x12')]=router; \ No newline at end of file +var _0x277c=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','describe','/:id','show','post','create','update','delete','destroy','multer','path','connect-timeout'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x277c,0x153));var _0xc277=function(_0x26492c,_0x1c3180){_0x26492c=_0x26492c-0x0;var _0x10fbfb=_0x277c[_0x26492c];return _0x10fbfb;};'use strict';var multer=require(_0xc277('0x0'));var util=require('util');var path=require(_0xc277('0x1'));var timeout=require(_0xc277('0x2'));var express=require(_0xc277('0x3'));var router=express[_0xc277('0x4')]();var fs_extra=require(_0xc277('0x5'));var auth=require(_0xc277('0x6'));var interaction=require(_0xc277('0x7'));var config=require(_0xc277('0x8'));var controller=require('./voiceCallReport.controller');router['get']('/',auth[_0xc277('0x9')](),controller['index']);router[_0xc277('0xa')]('/describe',auth[_0xc277('0x9')](),controller[_0xc277('0xb')]);router['get'](_0xc277('0xc'),auth[_0xc277('0x9')](),controller[_0xc277('0xd')]);router[_0xc277('0xe')]('/',auth[_0xc277('0x9')](),controller[_0xc277('0xf')]);router['put']('/:id',auth[_0xc277('0x9')](),controller[_0xc277('0x10')]);router[_0xc277('0x11')](_0xc277('0xc'),auth['isAuthenticated'](),controller[_0xc277('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 3329101..e09f6fd 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 _0xd1eb=['sequelize','STRING','ENUM','inbound','inbound-fax','outbound-fax','dialer','TEXT','DATE','INTEGER'];(function(_0x2adf28,_0x5bf2ed){var _0x1fbc45=function(_0x408878){while(--_0x408878){_0x2adf28['push'](_0x2adf28['shift']());}};_0x1fbc45(++_0x5bf2ed);}(_0xd1eb,0xc8));var _0xbd1e=function(_0x6dd42b,_0x2ed4d0){_0x6dd42b=_0x6dd42b-0x0;var _0x24e230=_0xd1eb[_0x6dd42b];return _0x24e230;};'use strict';var Sequelize=require(_0xbd1e('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xbd1e('0x1')]},'type':{'type':Sequelize[_0xbd1e('0x2')](_0xbd1e('0x3'),'internal','outbound',_0xbd1e('0x4'),_0xbd1e('0x5'),_0xbd1e('0x6'))},'tag':{'type':Sequelize[_0xbd1e('0x1')]},'accountcode':{'type':Sequelize[_0xbd1e('0x1')]},'source':{'type':Sequelize[_0xbd1e('0x1')]},'destination':{'type':Sequelize[_0xbd1e('0x1')]},'destinationcontext':{'type':Sequelize[_0xbd1e('0x1')]},'callerid':{'type':Sequelize[_0xbd1e('0x1')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0xbd1e('0x1')]},'lastdata':{'type':Sequelize[_0xbd1e('0x7')]},'starttime':{'type':Sequelize[_0xbd1e('0x8')]},'systemanswertime':{'type':Sequelize[_0xbd1e('0x8')]},'answertime':{'type':Sequelize[_0xbd1e('0x8')]},'endtime':{'type':Sequelize[_0xbd1e('0x8')]},'duration':{'type':Sequelize[_0xbd1e('0x9')]},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0xbd1e('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xbd1e('0x1')]},'amaflags':{'type':Sequelize[_0xbd1e('0x1')]},'userfield':{'type':Sequelize[_0xbd1e('0x1')]},'userDisposition':{'type':Sequelize[_0xbd1e('0x1')]},'userSecondDisposition':{'type':Sequelize[_0xbd1e('0x1')]},'userThirdDisposition':{'type':Sequelize[_0xbd1e('0x1')]},'note':{'type':Sequelize[_0xbd1e('0x1')]},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize[_0xbd1e('0x9')]},'sipcallid':{'type':Sequelize[_0xbd1e('0x1')]}}; \ No newline at end of file +var _0x114d=['inbound-fax','TEXT','DATE','INTEGER','sequelize','exports','STRING','inbound','internal','outbound'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x114d,0x144));var _0xd114=function(_0x25104d,_0x2e92ac){_0x25104d=_0x25104d-0x0;var _0x209ccc=_0x114d[_0x25104d];return _0x209ccc;};'use strict';var Sequelize=require(_0xd114('0x0'));module[_0xd114('0x1')]={'uniqueid':{'type':Sequelize[_0xd114('0x2')]},'type':{'type':Sequelize['ENUM'](_0xd114('0x3'),_0xd114('0x4'),_0xd114('0x5'),_0xd114('0x6'),'outbound-fax','dialer')},'tag':{'type':Sequelize[_0xd114('0x2')]},'accountcode':{'type':Sequelize[_0xd114('0x2')]},'source':{'type':Sequelize[_0xd114('0x2')]},'destination':{'type':Sequelize[_0xd114('0x2')]},'destinationcontext':{'type':Sequelize[_0xd114('0x2')]},'callerid':{'type':Sequelize[_0xd114('0x2')]},'channel':{'type':Sequelize[_0xd114('0x2')]},'destinationchannel':{'type':Sequelize[_0xd114('0x2')]},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xd114('0x7')]},'starttime':{'type':Sequelize[_0xd114('0x8')]},'systemanswertime':{'type':Sequelize[_0xd114('0x8')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xd114('0x8')]},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0xd114('0x9')]},'mohtime':{'type':Sequelize[_0xd114('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0xd114('0x2')]},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0xd114('0x2')]},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xd114('0x2')]},'prefix':{'type':Sequelize[_0xd114('0x2')]},'routeid':{'type':Sequelize[_0xd114('0x9')]},'sipcallid':{'type':Sequelize[_0xd114('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index cb6330e..e3422b5 100644 --- a/server/api/voiceCallReport/voiceCallReport.controller.js +++ b/server/api/voiceCallReport/voiceCallReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['stack','name','send','index','VoiceCallReport','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','fullname','alias','User','findAll','catch','params','keys','find','create','body','destroy','describe','update','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then'];(function(_0x3fcc20,_0x57c31b){var _0x15d3ce=function(_0x575619){while(--_0x575619){_0x3fcc20['push'](_0x3fcc20['shift']());}};_0x15d3ce(++_0x57c31b);}(_0x5f2f,0x73));var _0xf5f2=function(_0x28c7f3,_0x1aed62){_0x28c7f3=_0x28c7f3-0x0;var _0x28acfb=_0x5f2f[_0x28c7f3];return _0x28acfb;};'use strict';var emlformat=require(_0xf5f2('0x0'));var rimraf=require(_0xf5f2('0x1'));var zipdir=require(_0xf5f2('0x2'));var jsonpatch=require(_0xf5f2('0x3'));var rp=require(_0xf5f2('0x4'));var moment=require(_0xf5f2('0x5'));var BPromise=require(_0xf5f2('0x6'));var Mustache=require(_0xf5f2('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf5f2('0x8'));var csv=require(_0xf5f2('0x9'));var ejs=require(_0xf5f2('0xa'));var fs=require('fs');var fs_extra=require(_0xf5f2('0xb'));var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0x9'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf5f2('0x16'));var db=require(_0xf5f2('0x17'))['db'];function respondWithStatusCode(_0x331482,_0x3f2997){_0x3f2997=_0x3f2997||0xcc;return function(_0x59bb6c){if(_0x59bb6c){return _0x331482[_0xf5f2('0x18')](_0x3f2997);}return _0x331482['status'](_0x3f2997)[_0xf5f2('0x19')]();};}function respondWithResult(_0xea612c,_0x269909){_0x269909=_0x269909||0xc8;return function(_0x1c1a5c){if(_0x1c1a5c){return _0xea612c[_0xf5f2('0x1a')](_0x269909)['json'](_0x1c1a5c);}};}function respondWithFilteredResult(_0xafe430,_0x286197){return function(_0x17d656){if(_0x17d656){var _0x1b6dd2=typeof _0x286197[_0xf5f2('0x1b')]===_0xf5f2('0x1c')&&typeof _0x286197[_0xf5f2('0x1d')]===_0xf5f2('0x1c');var _0x11f702=_0x17d656[_0xf5f2('0x1e')];var _0x20fccd=_0x1b6dd2?0x0:_0x286197[_0xf5f2('0x1b')];var _0x4ff59b=_0x1b6dd2?_0x17d656[_0xf5f2('0x1e')]:_0x286197[_0xf5f2('0x1b')]+_0x286197[_0xf5f2('0x1d')];var _0x1bf655;if(_0x4ff59b>=_0x11f702){_0x4ff59b=_0x11f702;_0x1bf655=0xc8;}else{_0x1bf655=0xce;}_0xafe430['status'](_0x1bf655);return _0xafe430[_0xf5f2('0x1f')](_0xf5f2('0x20'),_0x20fccd+'-'+_0x4ff59b+'/'+_0x11f702)['json'](_0x17d656);}return null;};}function patchUpdates(_0x47acfc){return function(_0x2d2805){try{jsonpatch[_0xf5f2('0x21')](_0x2d2805,_0x47acfc,!![]);}catch(_0x4ae323){return BPromise[_0xf5f2('0x22')](_0x4ae323);}return _0x2d2805[_0xf5f2('0x23')]();};}function saveUpdates(_0x39e44a,_0x39c024){return function(_0x36f1cb){if(_0x36f1cb){return _0x36f1cb['update'](_0x39e44a)[_0xf5f2('0x24')](function(_0x4669a6){return _0x4669a6;});}return null;};}function removeEntity(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(_0x287ad5){return _0x287ad5['destroy']()['then'](function(){_0x4e8bda[_0xf5f2('0x1a')](0xcc)[_0xf5f2('0x19')]();});}};}function handleEntityNotFound(_0x13da6f,_0x1a5bb3){return function(_0xf6c58d){if(!_0xf6c58d){_0x13da6f[_0xf5f2('0x18')](0x194);}return _0xf6c58d;};}function handleError(_0x13a3be,_0x281ec8){_0x281ec8=_0x281ec8||0x1f4;return function(_0x294414){logger['error'](_0x294414[_0xf5f2('0x25')]);if(_0x294414[_0xf5f2('0x26')]){delete _0x294414[_0xf5f2('0x26')];}_0x13a3be[_0xf5f2('0x1a')](_0x281ec8)[_0xf5f2('0x27')](_0x294414);};}exports[_0xf5f2('0x28')]=function(_0x5b6672,_0x53cb96){var _0x22c826={},_0x14c829={},_0x11c771={'count':0x0,'rows':[]};var _0x5027ab=_['map'](db[_0xf5f2('0x29')][_0xf5f2('0x2a')],function(_0x17394a){return{'name':_0x17394a[_0xf5f2('0x2b')],'type':_0x17394a[_0xf5f2('0x2c')]['key']};});_0x14c829['model']=_[_0xf5f2('0x2d')](_0x5027ab,'name');_0x14c829[_0xf5f2('0x2e')]=_['keys'](_0x5b6672[_0xf5f2('0x2e')]);_0x14c829[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],_0x14c829[_0xf5f2('0x2e')]);_0x22c826[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],qs['fields'](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x22c826[_0xf5f2('0x32')]=_0x22c826[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x22c826[_0xf5f2('0x32')]:_0x14c829[_0xf5f2('0x31')];if(!_0x5b6672['query'][_0xf5f2('0x35')](_0xf5f2('0x36'))){_0x22c826['limit']=qs[_0xf5f2('0x1d')](_0x5b6672['query'][_0xf5f2('0x1d')]);_0x22c826[_0xf5f2('0x1b')]=qs[_0xf5f2('0x1b')](_0x5b6672[_0xf5f2('0x2e')]['offset']);}_0x22c826['order']=qs[_0xf5f2('0x37')](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x37')]);_0x22c826['where']=qs[_0xf5f2('0x2f')](_['pick'](_0x5b6672[_0xf5f2('0x2e')],_0x14c829['filters']),_0x5027ab);if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]){_0x22c826['where']=_[_0xf5f2('0x39')](_0x22c826[_0xf5f2('0x3a')],{'$or':_[_0xf5f2('0x2d')](_0x5027ab,function(_0x35f738){if(_0x35f738['type']!=='VIRTUAL'){var _0x3d328f={};_0x3d328f[_0x35f738[_0xf5f2('0x26')]]={'$like':'%'+_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]+'%'};return _0x3d328f;}})});}_0x22c826=_[_0xf5f2('0x39')]({},_0x22c826,_0x5b6672[_0xf5f2('0x3b')]);var _0x2bc20e={'where':_0x22c826['where']};return db[_0xf5f2('0x29')][_0xf5f2('0x1e')](_0x2bc20e)['then'](function(_0xc6a1ae){_0x11c771[_0xf5f2('0x1e')]=_0xc6a1ae;if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x22c826[_0xf5f2('0x3d')]=[{'attributes':['id',_0xf5f2('0x26'),_0xf5f2('0x3e'),_0xf5f2('0x3f')],'model':db['User'],'as':_0xf5f2('0x40')}];}return db[_0xf5f2('0x29')][_0xf5f2('0x41')](_0x22c826);})['then'](function(_0x509dbc){_0x11c771['rows']=_0x509dbc;return _0x11c771;})[_0xf5f2('0x24')](respondWithFilteredResult(_0x53cb96,_0x22c826))[_0xf5f2('0x42')](handleError(_0x53cb96,null));};exports['show']=function(_0x106272,_0xeed03d){var _0x28e33f={'raw':!![],'where':{'id':_0x106272[_0xf5f2('0x43')]['id']}},_0x31f86c={};_0x31f86c[_0xf5f2('0x31')]=_[_0xf5f2('0x44')](db[_0xf5f2('0x29')][_0xf5f2('0x2a')]);_0x31f86c[_0xf5f2('0x2e')]=_[_0xf5f2('0x44')](_0x106272[_0xf5f2('0x2e')]);_0x31f86c[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x31f86c['model'],_0x31f86c[_0xf5f2('0x2e')]);_0x28e33f['attributes']=_[_0xf5f2('0x30')](_0x31f86c[_0xf5f2('0x31')],qs[_0xf5f2('0x33')](_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x28e33f[_0xf5f2('0x32')]=_0x28e33f['attributes'][_0xf5f2('0x34')]?_0x28e33f[_0xf5f2('0x32')]:_0x31f86c[_0xf5f2('0x31')];if(_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x28e33f[_0xf5f2('0x3d')]=[{'all':!![]}];}_0x28e33f=_[_0xf5f2('0x39')]({},_0x28e33f,_0x106272[_0xf5f2('0x3b')]);return db['VoiceCallReport'][_0xf5f2('0x45')](_0x28e33f)[_0xf5f2('0x24')](handleEntityNotFound(_0xeed03d,null))[_0xf5f2('0x24')](respondWithResult(_0xeed03d,null))['catch'](handleError(_0xeed03d,null));};exports[_0xf5f2('0x46')]=function(_0xc91b64,_0x3179a9){return db['VoiceCallReport']['create'](_0xc91b64[_0xf5f2('0x47')],{})[_0xf5f2('0x24')](respondWithResult(_0x3179a9,0xc9))['catch'](handleError(_0x3179a9,null));};exports[_0xf5f2('0x48')]=function(_0x533cca,_0x740321){return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'id':_0x533cca['params']['id']}})[_0xf5f2('0x24')](handleEntityNotFound(_0x740321,null))[_0xf5f2('0x24')](removeEntity(_0x740321,null))[_0xf5f2('0x42')](handleError(_0x740321,null));};exports[_0xf5f2('0x49')]=function(_0x4fa738,_0x3154c1){return db[_0xf5f2('0x29')]['describe']()['then'](respondWithResult(_0x3154c1,null))[_0xf5f2('0x42')](handleError(_0x3154c1,null));};exports[_0xf5f2('0x4a')]=function(_0x57782c,_0x22b645){if(_0x57782c[_0xf5f2('0x47')][_0xf5f2('0x4b')]){delete _0x57782c[_0xf5f2('0x47')]['uniqueid'];}return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'uniqueid':_0x57782c[_0xf5f2('0x43')]['id'],'UserId':{'$or':[null,_0x57782c['user']['id']]}}})[_0xf5f2('0x24')](handleEntityNotFound(_0x22b645,null))[_0xf5f2('0x24')](saveUpdates(_0x57782c[_0xf5f2('0x47')],null))[_0xf5f2('0x24')](respondWithResult(_0x22b645,null))[_0xf5f2('0x42')](handleError(_0x22b645,null));}; \ No newline at end of file +var _0xadb5=['filter','VIRTUAL','merge','options','includeAll','include','fullname','User','findAll','rows','show','rawAttributes','length','find','catch','body','params','describe','uniqueid','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','stack','name','send','index','map','VoiceCallReport','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters'];(function(_0x427352,_0x1bce61){var _0x23e0e6=function(_0x2a42a9){while(--_0x2a42a9){_0x427352['push'](_0x427352['shift']());}};_0x23e0e6(++_0x1bce61);}(_0xadb5,0xad));var _0x5adb=function(_0x159adc,_0x68d044){_0x159adc=_0x159adc-0x0;var _0x1c8138=_0xadb5[_0x159adc];return _0x1c8138;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5adb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5adb('0x1'));var rp=require(_0x5adb('0x2'));var moment=require(_0x5adb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5adb('0x4'));var util=require(_0x5adb('0x5'));var path=require(_0x5adb('0x6'));var sox=require('sox');var csv=require(_0x5adb('0x7'));var ejs=require(_0x5adb('0x8'));var fs=require('fs');var fs_extra=require(_0x5adb('0x9'));var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x7'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5adb('0x14'))(_0x5adb('0x15'));var utils=require(_0x5adb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5adb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a0b70,_0x5433bf){_0x5433bf=_0x5433bf||0xcc;return function(_0x8cfcc6){if(_0x8cfcc6){return _0x2a0b70[_0x5adb('0x18')](_0x5433bf);}return _0x2a0b70[_0x5adb('0x19')](_0x5433bf)['end']();};}function respondWithResult(_0x2a545b,_0x34af2c){_0x34af2c=_0x34af2c||0xc8;return function(_0xf82f72){if(_0xf82f72){return _0x2a545b['status'](_0x34af2c)[_0x5adb('0x1a')](_0xf82f72);}};}function respondWithFilteredResult(_0x518823,_0x367d82){return function(_0x42a482){if(_0x42a482){var _0x30614e=typeof _0x367d82[_0x5adb('0x1b')]===_0x5adb('0x1c')&&typeof _0x367d82[_0x5adb('0x1d')]===_0x5adb('0x1c');var _0x42f4c6=_0x42a482[_0x5adb('0x1e')];var _0x529b65=_0x30614e?0x0:_0x367d82[_0x5adb('0x1b')];var _0x5de028=_0x30614e?_0x42a482[_0x5adb('0x1e')]:_0x367d82['offset']+_0x367d82[_0x5adb('0x1d')];var _0x50e84f;if(_0x5de028>=_0x42f4c6){_0x5de028=_0x42f4c6;_0x50e84f=0xc8;}else{_0x50e84f=0xce;}_0x518823['status'](_0x50e84f);return _0x518823[_0x5adb('0x1f')](_0x5adb('0x20'),_0x529b65+'-'+_0x5de028+'/'+_0x42f4c6)[_0x5adb('0x1a')](_0x42a482);}return null;};}function patchUpdates(_0x1fd4a7){return function(_0x99bc6c){try{jsonpatch['apply'](_0x99bc6c,_0x1fd4a7,!![]);}catch(_0x3255b3){return BPromise['reject'](_0x3255b3);}return _0x99bc6c['save']();};}function saveUpdates(_0x3754cc,_0x379b33){return function(_0x1a38d3){if(_0x1a38d3){return _0x1a38d3[_0x5adb('0x21')](_0x3754cc)[_0x5adb('0x22')](function(_0x413911){return _0x413911;});}return null;};}function removeEntity(_0xfd9bb9,_0x4ca150){return function(_0x4b1957){if(_0x4b1957){return _0x4b1957[_0x5adb('0x23')]()[_0x5adb('0x22')](function(){_0xfd9bb9[_0x5adb('0x19')](0xcc)[_0x5adb('0x24')]();});}};}function handleEntityNotFound(_0x49f203,_0x2fee18){return function(_0x2e1e63){if(!_0x2e1e63){_0x49f203['sendStatus'](0x194);}return _0x2e1e63;};}function handleError(_0x1feecf,_0x1ded9f){_0x1ded9f=_0x1ded9f||0x1f4;return function(_0x1a0acd){logger['error'](_0x1a0acd[_0x5adb('0x25')]);if(_0x1a0acd[_0x5adb('0x26')]){delete _0x1a0acd[_0x5adb('0x26')];}_0x1feecf[_0x5adb('0x19')](_0x1ded9f)[_0x5adb('0x27')](_0x1a0acd);};}exports[_0x5adb('0x28')]=function(_0x4a5d46,_0x49992e){var _0x5d457e={},_0x39bddd={},_0x1eac55={'count':0x0,'rows':[]};var _0x60a672=_[_0x5adb('0x29')](db[_0x5adb('0x2a')]['rawAttributes'],function(_0x11ec2a){return{'name':_0x11ec2a[_0x5adb('0x2b')],'type':_0x11ec2a[_0x5adb('0x2c')][_0x5adb('0x2d')]};});_0x39bddd[_0x5adb('0x2e')]=_[_0x5adb('0x29')](_0x60a672,_0x5adb('0x26'));_0x39bddd[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x4a5d46[_0x5adb('0x2f')]);_0x39bddd['filters']=_[_0x5adb('0x31')](_0x39bddd['model'],_0x39bddd[_0x5adb('0x2f')]);_0x5d457e[_0x5adb('0x32')]=_['intersection'](_0x39bddd[_0x5adb('0x2e')],qs[_0x5adb('0x33')](_0x4a5d46[_0x5adb('0x2f')]['fields']));_0x5d457e[_0x5adb('0x32')]=_0x5d457e[_0x5adb('0x32')]['length']?_0x5d457e['attributes']:_0x39bddd[_0x5adb('0x2e')];if(!_0x4a5d46['query'][_0x5adb('0x34')](_0x5adb('0x35'))){_0x5d457e[_0x5adb('0x1d')]=qs[_0x5adb('0x1d')](_0x4a5d46[_0x5adb('0x2f')]['limit']);_0x5d457e[_0x5adb('0x1b')]=qs[_0x5adb('0x1b')](_0x4a5d46[_0x5adb('0x2f')]['offset']);}_0x5d457e['order']=qs[_0x5adb('0x36')](_0x4a5d46[_0x5adb('0x2f')]['sort']);_0x5d457e[_0x5adb('0x37')]=qs['filters'](_[_0x5adb('0x38')](_0x4a5d46['query'],_0x39bddd[_0x5adb('0x39')]),_0x60a672);if(_0x4a5d46['query'][_0x5adb('0x3a')]){_0x5d457e[_0x5adb('0x37')]=_['merge'](_0x5d457e[_0x5adb('0x37')],{'$or':_['map'](_0x60a672,function(_0xadbe37){if(_0xadbe37[_0x5adb('0x2c')]!==_0x5adb('0x3b')){var _0x50edd1={};_0x50edd1[_0xadbe37[_0x5adb('0x26')]]={'$like':'%'+_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3a')]+'%'};return _0x50edd1;}})});}_0x5d457e=_[_0x5adb('0x3c')]({},_0x5d457e,_0x4a5d46[_0x5adb('0x3d')]);var _0x52d74f={'where':_0x5d457e['where']};return db['VoiceCallReport']['count'](_0x52d74f)[_0x5adb('0x22')](function(_0x2fbe14){_0x1eac55[_0x5adb('0x1e')]=_0x2fbe14;if(_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0x5d457e[_0x5adb('0x3f')]=[{'attributes':['id',_0x5adb('0x26'),_0x5adb('0x40'),'alias'],'model':db['User'],'as':_0x5adb('0x41')}];}return db['VoiceCallReport'][_0x5adb('0x42')](_0x5d457e);})[_0x5adb('0x22')](function(_0x299746){_0x1eac55[_0x5adb('0x43')]=_0x299746;return _0x1eac55;})[_0x5adb('0x22')](respondWithFilteredResult(_0x49992e,_0x5d457e))['catch'](handleError(_0x49992e,null));};exports[_0x5adb('0x44')]=function(_0x565b03,_0x508690){var _0x4160ad={'raw':!![],'where':{'id':_0x565b03['params']['id']}},_0x1a256c={};_0x1a256c[_0x5adb('0x2e')]=_[_0x5adb('0x30')](db[_0x5adb('0x2a')][_0x5adb('0x45')]);_0x1a256c[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x565b03[_0x5adb('0x2f')]);_0x1a256c['filters']=_['intersection'](_0x1a256c[_0x5adb('0x2e')],_0x1a256c[_0x5adb('0x2f')]);_0x4160ad[_0x5adb('0x32')]=_[_0x5adb('0x31')](_0x1a256c['model'],qs['fields'](_0x565b03[_0x5adb('0x2f')][_0x5adb('0x33')]));_0x4160ad[_0x5adb('0x32')]=_0x4160ad[_0x5adb('0x32')][_0x5adb('0x46')]?_0x4160ad['attributes']:_0x1a256c[_0x5adb('0x2e')];if(_0x565b03[_0x5adb('0x2f')]['includeAll']){_0x4160ad[_0x5adb('0x3f')]=[{'all':!![]}];}_0x4160ad=_[_0x5adb('0x3c')]({},_0x4160ad,_0x565b03[_0x5adb('0x3d')]);return db[_0x5adb('0x2a')][_0x5adb('0x47')](_0x4160ad)[_0x5adb('0x22')](handleEntityNotFound(_0x508690,null))[_0x5adb('0x22')](respondWithResult(_0x508690,null))[_0x5adb('0x48')](handleError(_0x508690,null));};exports['create']=function(_0x3a925b,_0x57dc8b){return db['VoiceCallReport']['create'](_0x3a925b[_0x5adb('0x49')],{})[_0x5adb('0x22')](respondWithResult(_0x57dc8b,0xc9))[_0x5adb('0x48')](handleError(_0x57dc8b,null));};exports['destroy']=function(_0x2ad69d,_0x5cbab5){return db[_0x5adb('0x2a')][_0x5adb('0x47')]({'where':{'id':_0x2ad69d[_0x5adb('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5cbab5,null))[_0x5adb('0x22')](removeEntity(_0x5cbab5,null))['catch'](handleError(_0x5cbab5,null));};exports[_0x5adb('0x4b')]=function(_0x6dc067,_0x55c535){return db[_0x5adb('0x2a')][_0x5adb('0x4b')]()[_0x5adb('0x22')](respondWithResult(_0x55c535,null))[_0x5adb('0x48')](handleError(_0x55c535,null));};exports[_0x5adb('0x21')]=function(_0x4cb36c,_0x36b847){if(_0x4cb36c[_0x5adb('0x49')][_0x5adb('0x4c')]){delete _0x4cb36c[_0x5adb('0x49')]['uniqueid'];}return db[_0x5adb('0x2a')][_0x5adb('0x47')]({'where':{'uniqueid':_0x4cb36c[_0x5adb('0x4a')]['id'],'UserId':{'$or':[null,_0x4cb36c['user']['id']]}}})[_0x5adb('0x22')](handleEntityNotFound(_0x36b847,null))[_0x5adb('0x22')](saveUpdates(_0x4cb36c[_0x5adb('0x49')],null))[_0x5adb('0x22')](respondWithResult(_0x36b847,null))['catch'](handleError(_0x36b847,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index d43cde3..cddef95 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 _0xbb45=['path','rimraf','./voiceCallReport.attributes','define','VoiceCallReport','report_call','uniqueid','lodash','util','../../config/logger','moment','request-promise'];(function(_0x93d7e0,_0x3ecdf4){var _0x1e93e8=function(_0x594198){while(--_0x594198){_0x93d7e0['push'](_0x93d7e0['shift']());}};_0x1e93e8(++_0x3ecdf4);}(_0xbb45,0xd3));var _0x5bb4=function(_0x237670,_0x3ffb1f){_0x237670=_0x237670-0x0;var _0x4975f7=_0xbb45[_0x237670];return _0x4975f7;};'use strict';var _=require(_0x5bb4('0x0'));var util=require(_0x5bb4('0x1'));var logger=require(_0x5bb4('0x2'))('api');var moment=require(_0x5bb4('0x3'));var BPromise=require('bluebird');var rp=require(_0x5bb4('0x4'));var fs=require('fs');var path=require(_0x5bb4('0x5'));var rimraf=require(_0x5bb4('0x6'));var config=require('../../config/environment');var attributes=require(_0x5bb4('0x7'));module['exports']=function(_0x435f5f,_0x1f8763){return _0x435f5f[_0x5bb4('0x8')](_0x5bb4('0x9'),attributes,{'tableName':_0x5bb4('0xa'),'paranoid':![],'indexes':[{'fields':[_0x5bb4('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1da3=['define','report_call','uniqueid','lodash','bluebird','request-promise','path','./voiceCallReport.attributes','exports'];(function(_0x16eb11,_0x1a2251){var _0x3ae7ef=function(_0x575a01){while(--_0x575a01){_0x16eb11['push'](_0x16eb11['shift']());}};_0x3ae7ef(++_0x1a2251);}(_0x1da3,0x78));var _0x31da=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x1da3[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x31da('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x31da('0x1'));var rp=require(_0x31da('0x2'));var fs=require('fs');var path=require(_0x31da('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x31da('0x4'));module[_0x31da('0x5')]=function(_0x4be331,_0x448131){return _0x4be331[_0x31da('0x6')]('VoiceCallReport',attributes,{'tableName':_0x31da('0x7'),'paranoid':![],'indexes':[{'fields':[_0x31da('0x8')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index e0377d8..361cb0b 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 _0xb4be=['request\x20sent','debug','stringify','code','error','message','info','result','catch','GetVoiceCallReport','findAll','options','raw','where','include','map','model','attributes','CreateVoiceCallReport','create','UpdateVoiceCallReport','VoiceCallReport','update','limit','lodash','util','moment','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','VoiceCallReport,\x20%s,\x20%s'];(function(_0x187718,_0x427383){var _0x29ddf4=function(_0x2ec62a){while(--_0x2ec62a){_0x187718['push'](_0x187718['shift']());}};_0x29ddf4(++_0x427383);}(_0xb4be,0x84));var _0xeb4b=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xb4be[_0x4e676e];return _0x336a3c;};'use strict';var _=require(_0xeb4b('0x0'));var util=require(_0xeb4b('0x1'));var moment=require(_0xeb4b('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(_0xeb4b('0x3'));var logger=require(_0xeb4b('0x4'))(_0xeb4b('0x5'));var config=require(_0xeb4b('0x6'));var jayson=require(_0xeb4b('0x7'));var client=jayson['client'][_0xeb4b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4784d4,_0x75e352,_0x529826){return new BPromise(function(_0x3a71b2,_0x19fc0b){return client[_0xeb4b('0x9')](_0x4784d4,_0x529826)[_0xeb4b('0xa')](function(_0x9c3b8a){logger['info'](_0xeb4b('0xb'),_0x75e352,_0xeb4b('0xc'));logger[_0xeb4b('0xd')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x75e352,'request\x20sent',JSON[_0xeb4b('0xe')](_0x9c3b8a));if(_0x9c3b8a['error']){if(_0x9c3b8a['error'][_0xeb4b('0xf')]===0x1f4){logger[_0xeb4b('0x10')]('VoiceCallReport,\x20%s,\x20%s',_0x75e352,_0x9c3b8a[_0xeb4b('0x10')][_0xeb4b('0x11')]);return _0x19fc0b(_0x9c3b8a['error'][_0xeb4b('0x11')]);}logger[_0xeb4b('0x10')](_0xeb4b('0xb'),_0x75e352,_0x9c3b8a[_0xeb4b('0x10')][_0xeb4b('0x11')]);return _0x3a71b2(_0x9c3b8a[_0xeb4b('0x10')]['message']);}else{logger[_0xeb4b('0x12')](_0xeb4b('0xb'),_0x75e352,_0xeb4b('0xc'));_0x3a71b2(_0x9c3b8a[_0xeb4b('0x13')][_0xeb4b('0x11')]);}})[_0xeb4b('0x14')](function(_0x278ffe){logger[_0xeb4b('0x10')]('VoiceCallReport,\x20%s,\x20%s',_0x75e352,_0x278ffe);_0x19fc0b(_0x278ffe);});});}exports[_0xeb4b('0x15')]=function(_0xa2759b){var _0x12d7ed=this;return new Promise(function(_0x5f5988,_0x3c1a1b){return db['VoiceCallReport'][_0xeb4b('0x16')]({'raw':_0xa2759b['options']?_0xa2759b[_0xeb4b('0x17')][_0xeb4b('0x18')]===undefined?!![]:![]:!![],'where':_0xa2759b[_0xeb4b('0x17')]?_0xa2759b[_0xeb4b('0x17')][_0xeb4b('0x19')]||null:null,'attributes':_0xa2759b['options']?_0xa2759b[_0xeb4b('0x17')]['attributes']||null:null,'limit':_0xa2759b[_0xeb4b('0x17')]?_0xa2759b[_0xeb4b('0x17')]['limit']||null:null,'include':_0xa2759b[_0xeb4b('0x17')]?_0xa2759b[_0xeb4b('0x17')][_0xeb4b('0x1a')]?_[_0xeb4b('0x1b')](_0xa2759b['options'][_0xeb4b('0x1a')],function(_0x26ae6d){return{'model':db[_0x26ae6d[_0xeb4b('0x1c')]],'as':_0x26ae6d['as'],'attributes':_0x26ae6d[_0xeb4b('0x1d')],'include':_0x26ae6d['include']?_[_0xeb4b('0x1b')](_0x26ae6d[_0xeb4b('0x1a')],function(_0x172f71){return{'model':db[_0x172f71[_0xeb4b('0x1c')]],'as':_0x172f71['as'],'attributes':_0x172f71['attributes'],'include':_0x172f71[_0xeb4b('0x1a')]?_['map'](_0x172f71[_0xeb4b('0x1a')],function(_0x29b103){return{'model':db[_0x29b103[_0xeb4b('0x1c')]],'as':_0x29b103['as'],'attributes':_0x29b103[_0xeb4b('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xeb4b('0xa')](function(_0xda9594){logger[_0xeb4b('0x12')](_0xeb4b('0x15'),_0xa2759b);logger[_0xeb4b('0xd')](_0xeb4b('0x15'),_0xa2759b,JSON['stringify'](_0xda9594));_0x5f5988(_0xda9594);})['catch'](function(_0x515337){logger[_0xeb4b('0x10')](_0xeb4b('0x15'),_0x515337[_0xeb4b('0x11')],_0xa2759b);_0x3c1a1b(_0x12d7ed[_0xeb4b('0x10')](0x1f4,_0x515337[_0xeb4b('0x11')]));});});};exports[_0xeb4b('0x1e')]=function(_0x40f16b){var _0x4cfeb4=this;return new Promise(function(_0x472f62,_0x1fd33c){return db['VoiceCallReport'][_0xeb4b('0x1f')](_0x40f16b['body'],{'raw':_0x40f16b[_0xeb4b('0x17')]?_0x40f16b[_0xeb4b('0x17')][_0xeb4b('0x18')]===undefined?!![]:![]:!![]})[_0xeb4b('0xa')](function(_0x4bbbb1){logger[_0xeb4b('0x12')]('CreateVoiceCallReport',_0x40f16b);logger['debug'](_0xeb4b('0x1e'),_0x40f16b,JSON[_0xeb4b('0xe')](_0x4bbbb1));_0x472f62(_0x4bbbb1);})[_0xeb4b('0x14')](function(_0x3b1a3f){logger[_0xeb4b('0x10')](_0xeb4b('0x1e'),_0x3b1a3f['message'],_0x40f16b);_0x1fd33c(_0x4cfeb4[_0xeb4b('0x10')](0x1f4,_0x3b1a3f[_0xeb4b('0x11')]));});});};exports[_0xeb4b('0x20')]=function(_0x1ca37f){var _0x3ca5a6=this;return new Promise(function(_0x52a60e,_0x2de769){return db[_0xeb4b('0x21')][_0xeb4b('0x22')](_0x1ca37f['body'],{'raw':_0x1ca37f[_0xeb4b('0x17')]?_0x1ca37f['options'][_0xeb4b('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ca37f[_0xeb4b('0x17')]?_0x1ca37f[_0xeb4b('0x17')][_0xeb4b('0x19')]||null:null,'attributes':_0x1ca37f[_0xeb4b('0x17')]?_0x1ca37f['options'][_0xeb4b('0x1d')]||null:null,'limit':_0x1ca37f[_0xeb4b('0x17')]?_0x1ca37f[_0xeb4b('0x17')][_0xeb4b('0x23')]||null:null})[_0xeb4b('0xa')](function(_0x20f7fa){logger[_0xeb4b('0x12')](_0xeb4b('0x20'),_0x1ca37f);logger[_0xeb4b('0xd')]('UpdateVoiceCallReport',_0x1ca37f,JSON[_0xeb4b('0xe')](_0x20f7fa));_0x52a60e(_0x20f7fa);})[_0xeb4b('0x14')](function(_0x3d27d2){logger[_0xeb4b('0x10')](_0xeb4b('0x20'),_0x3d27d2[_0xeb4b('0x11')],_0x1ca37f);_0x2de769(_0x3ca5a6[_0xeb4b('0x10')](0x1f4,_0x3d27d2[_0xeb4b('0x11')]));});});}; \ No newline at end of file +var _0xbb93=['VoiceCallReport','findAll','options','raw','where','limit','include','model','map','attributes','GetVoiceCallReport','CreateVoiceCallReport','body','UpdateVoiceCallReport','update','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbb93,0x120));var _0x3bb9=function(_0x381e8,_0x286a77){_0x381e8=_0x381e8-0x0;var _0x25e45f=_0xbb93[_0x381e8];return _0x25e45f;};'use strict';var _=require(_0x3bb9('0x0'));var util=require('util');var moment=require(_0x3bb9('0x1'));var BPromise=require('bluebird');var rs=require(_0x3bb9('0x2'));var fs=require('fs');var Redis=require(_0x3bb9('0x3'));var db=require(_0x3bb9('0x4'))['db'];var utils=require(_0x3bb9('0x5'));var logger=require(_0x3bb9('0x6'))(_0x3bb9('0x7'));var config=require('../../config/environment');var jayson=require(_0x3bb9('0x8'));var client=jayson[_0x3bb9('0x9')][_0x3bb9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4fb367,_0x102989,_0x4e04c6){return new BPromise(function(_0x3e858a,_0x38097c){return client[_0x3bb9('0xb')](_0x4fb367,_0x4e04c6)[_0x3bb9('0xc')](function(_0x46e4ee){logger[_0x3bb9('0xd')](_0x3bb9('0xe'),_0x102989,_0x3bb9('0xf'));logger[_0x3bb9('0x10')](_0x3bb9('0x11'),_0x102989,_0x3bb9('0xf'),JSON[_0x3bb9('0x12')](_0x46e4ee));if(_0x46e4ee[_0x3bb9('0x13')]){if(_0x46e4ee['error'][_0x3bb9('0x14')]===0x1f4){logger[_0x3bb9('0x13')](_0x3bb9('0xe'),_0x102989,_0x46e4ee[_0x3bb9('0x13')][_0x3bb9('0x15')]);return _0x38097c(_0x46e4ee[_0x3bb9('0x13')][_0x3bb9('0x15')]);}logger[_0x3bb9('0x13')](_0x3bb9('0xe'),_0x102989,_0x46e4ee[_0x3bb9('0x13')][_0x3bb9('0x15')]);return _0x3e858a(_0x46e4ee[_0x3bb9('0x13')][_0x3bb9('0x15')]);}else{logger[_0x3bb9('0xd')](_0x3bb9('0xe'),_0x102989,_0x3bb9('0xf'));_0x3e858a(_0x46e4ee[_0x3bb9('0x16')][_0x3bb9('0x15')]);}})[_0x3bb9('0x17')](function(_0x5a94dd){logger[_0x3bb9('0x13')](_0x3bb9('0xe'),_0x102989,_0x5a94dd);_0x38097c(_0x5a94dd);});});}exports['GetVoiceCallReport']=function(_0x513d64){var _0xdb4791=this;return new Promise(function(_0x111327,_0x559de0){return db[_0x3bb9('0x18')][_0x3bb9('0x19')]({'raw':_0x513d64[_0x3bb9('0x1a')]?_0x513d64[_0x3bb9('0x1a')][_0x3bb9('0x1b')]===undefined?!![]:![]:!![],'where':_0x513d64[_0x3bb9('0x1a')]?_0x513d64[_0x3bb9('0x1a')][_0x3bb9('0x1c')]||null:null,'attributes':_0x513d64[_0x3bb9('0x1a')]?_0x513d64['options']['attributes']||null:null,'limit':_0x513d64['options']?_0x513d64[_0x3bb9('0x1a')][_0x3bb9('0x1d')]||null:null,'include':_0x513d64['options']?_0x513d64[_0x3bb9('0x1a')][_0x3bb9('0x1e')]?_['map'](_0x513d64[_0x3bb9('0x1a')][_0x3bb9('0x1e')],function(_0x172cb0){return{'model':db[_0x172cb0[_0x3bb9('0x1f')]],'as':_0x172cb0['as'],'attributes':_0x172cb0['attributes'],'include':_0x172cb0[_0x3bb9('0x1e')]?_[_0x3bb9('0x20')](_0x172cb0['include'],function(_0x28d4ca){return{'model':db[_0x28d4ca[_0x3bb9('0x1f')]],'as':_0x28d4ca['as'],'attributes':_0x28d4ca[_0x3bb9('0x21')],'include':_0x28d4ca[_0x3bb9('0x1e')]?_[_0x3bb9('0x20')](_0x28d4ca[_0x3bb9('0x1e')],function(_0x2a52f4){return{'model':db[_0x2a52f4[_0x3bb9('0x1f')]],'as':_0x2a52f4['as'],'attributes':_0x2a52f4['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1122a6){logger[_0x3bb9('0xd')](_0x3bb9('0x22'),_0x513d64);logger[_0x3bb9('0x10')]('GetVoiceCallReport',_0x513d64,JSON[_0x3bb9('0x12')](_0x1122a6));_0x111327(_0x1122a6);})[_0x3bb9('0x17')](function(_0x2eb122){logger['error'](_0x3bb9('0x22'),_0x2eb122[_0x3bb9('0x15')],_0x513d64);_0x559de0(_0xdb4791[_0x3bb9('0x13')](0x1f4,_0x2eb122['message']));});});};exports[_0x3bb9('0x23')]=function(_0x233da1){var _0x1ada12=this;return new Promise(function(_0x46d9ef,_0x18299f){return db[_0x3bb9('0x18')]['create'](_0x233da1[_0x3bb9('0x24')],{'raw':_0x233da1[_0x3bb9('0x1a')]?_0x233da1[_0x3bb9('0x1a')][_0x3bb9('0x1b')]===undefined?!![]:![]:!![]})[_0x3bb9('0xc')](function(_0x407955){logger[_0x3bb9('0xd')](_0x3bb9('0x23'),_0x233da1);logger['debug'](_0x3bb9('0x23'),_0x233da1,JSON['stringify'](_0x407955));_0x46d9ef(_0x407955);})[_0x3bb9('0x17')](function(_0x124b24){logger[_0x3bb9('0x13')](_0x3bb9('0x23'),_0x124b24[_0x3bb9('0x15')],_0x233da1);_0x18299f(_0x1ada12[_0x3bb9('0x13')](0x1f4,_0x124b24[_0x3bb9('0x15')]));});});};exports[_0x3bb9('0x25')]=function(_0x4d15a8){var _0x3412cd=this;return new Promise(function(_0x47faad,_0x609ede){return db[_0x3bb9('0x18')][_0x3bb9('0x26')](_0x4d15a8['body'],{'raw':_0x4d15a8[_0x3bb9('0x1a')]?_0x4d15a8[_0x3bb9('0x1a')][_0x3bb9('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4d15a8['options']?_0x4d15a8[_0x3bb9('0x1a')][_0x3bb9('0x1c')]||null:null,'attributes':_0x4d15a8[_0x3bb9('0x1a')]?_0x4d15a8[_0x3bb9('0x1a')][_0x3bb9('0x21')]||null:null,'limit':_0x4d15a8[_0x3bb9('0x1a')]?_0x4d15a8[_0x3bb9('0x1a')][_0x3bb9('0x1d')]||null:null})[_0x3bb9('0xc')](function(_0xd7804){logger['info'](_0x3bb9('0x25'),_0x4d15a8);logger[_0x3bb9('0x10')](_0x3bb9('0x25'),_0x4d15a8,JSON[_0x3bb9('0x12')](_0xd7804));_0x47faad(_0xd7804);})['catch'](function(_0x1ca868){logger[_0x3bb9('0x13')](_0x3bb9('0x25'),_0x1ca868[_0x3bb9('0x15')],_0x4d15a8);_0x609ede(_0x3412cd[_0x3bb9('0x13')](0x1f4,_0x1ca868['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 3198c84..7dc8f4b 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 _0x30a2=['/:id','show','post','create','put','update','delete','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','isAuthenticated','index','get'];(function(_0x574662,_0x13bfe8){var _0xfe85e7=function(_0x378dc6){while(--_0x378dc6){_0x574662['push'](_0x574662['shift']());}};_0xfe85e7(++_0x13bfe8);}(_0x30a2,0x6b));var _0x230a=function(_0x445c98,_0x132bf7){_0x445c98=_0x445c98-0x0;var _0x2fe913=_0x30a2[_0x445c98];return _0x2fe913;};'use strict';var multer=require('multer');var util=require(_0x230a('0x0'));var path=require(_0x230a('0x1'));var timeout=require(_0x230a('0x2'));var express=require(_0x230a('0x3'));var router=express[_0x230a('0x4')]();var fs_extra=require(_0x230a('0x5'));var auth=require(_0x230a('0x6'));var interaction=require(_0x230a('0x7'));var config=require(_0x230a('0x8'));var controller=require(_0x230a('0x9'));router['get']('/',auth[_0x230a('0xa')](),controller[_0x230a('0xb')]);router[_0x230a('0xc')](_0x230a('0xd'),auth[_0x230a('0xa')](),controller[_0x230a('0xe')]);router[_0x230a('0xf')]('/',auth[_0x230a('0xa')](),controller[_0x230a('0x10')]);router[_0x230a('0x11')](_0x230a('0xd'),auth['isAuthenticated'](),controller[_0x230a('0x12')]);router[_0x230a('0x13')](_0x230a('0xd'),auth[_0x230a('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x1b6a=['../../config/environment','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x587ba2,_0x42eb40){var _0x50ec73=function(_0x2f32e3){while(--_0x2f32e3){_0x587ba2['push'](_0x587ba2['shift']());}};_0x50ec73(++_0x42eb40);}(_0x1b6a,0x11e));var _0xa1b6=function(_0x1feaab,_0x546eb6){_0x1feaab=_0x1feaab-0x0;var _0x5bf7c5=_0x1b6a[_0x1feaab];return _0x5bf7c5;};'use strict';var multer=require(_0xa1b6('0x0'));var util=require(_0xa1b6('0x1'));var path=require(_0xa1b6('0x2'));var timeout=require('connect-timeout');var express=require(_0xa1b6('0x3'));var router=express[_0xa1b6('0x4')]();var fs_extra=require(_0xa1b6('0x5'));var auth=require(_0xa1b6('0x6'));var interaction=require(_0xa1b6('0x7'));var config=require(_0xa1b6('0x8'));var controller=require('./voiceChanSpy.controller');router[_0xa1b6('0x9')]('/',auth[_0xa1b6('0xa')](),controller[_0xa1b6('0xb')]);router[_0xa1b6('0x9')]('/:id',auth[_0xa1b6('0xa')](),controller[_0xa1b6('0xc')]);router[_0xa1b6('0xd')]('/',auth['isAuthenticated'](),controller[_0xa1b6('0xe')]);router[_0xa1b6('0xf')](_0xa1b6('0x10'),auth[_0xa1b6('0xa')](),controller[_0xa1b6('0x11')]);router[_0xa1b6('0x12')]('/:id',auth[_0xa1b6('0xa')](),controller[_0xa1b6('0x13')]);module[_0xa1b6('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index ebe2925..0a5ff83 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 _0x21b9=['sequelize','STRING','name','setDataValue','join','getDataValue','options','BOOLEAN'];(function(_0x1f5525,_0x55b4e7){var _0x28be10=function(_0x4b04b2){while(--_0x4b04b2){_0x1f5525['push'](_0x1f5525['shift']());}};_0x28be10(++_0x55b4e7);}(_0x21b9,0x178));var _0x921b=function(_0x22fb68,_0x56dbf5){_0x22fb68=_0x22fb68-0x0;var _0x5604f9=_0x21b9[_0x22fb68];return _0x5604f9;};'use strict';var Sequelize=require(_0x921b('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x921b('0x1')],'unique':_0x921b('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0x921b('0x1')],'set':function(_0x3c7832){this[_0x921b('0x3')]('options',_0x3c7832?_0x3c7832[_0x921b('0x4')](''):[]);},'get':function(){return this[_0x921b('0x5')]('options')?this[_0x921b('0x5')](_0x921b('0x6'))['split'](''):[];}},'auth':{'type':Sequelize[_0x921b('0x7')],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd094=['name','setDataValue','options','join','getDataValue','split','BOOLEAN','exports','STRING'];(function(_0x3ff228,_0x2d3335){var _0x2006d6=function(_0x3f5831){while(--_0x3f5831){_0x3ff228['push'](_0x3ff228['shift']());}};_0x2006d6(++_0x2d3335);}(_0xd094,0x127));var _0x4d09=function(_0x124b28,_0x3c2617){_0x124b28=_0x124b28-0x0;var _0x152b36=_0xd094[_0x124b28];return _0x152b36;};'use strict';var Sequelize=require('sequelize');module[_0x4d09('0x0')]={'name':{'type':Sequelize[_0x4d09('0x1')]},'prefix':{'type':Sequelize[_0x4d09('0x1')],'unique':_0x4d09('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0x4d09('0x1')],'set':function(_0x18f4c1){this[_0x4d09('0x3')](_0x4d09('0x4'),_0x18f4c1?_0x18f4c1[_0x4d09('0x5')](''):[]);},'get':function(){return this['getDataValue']('options')?this[_0x4d09('0x6')](_0x4d09('0x4'))[_0x4d09('0x7')](''):[];}},'auth':{'type':Sequelize[_0x4d09('0x8')],'defaultValue':![]},'password':{'type':Sequelize[_0x4d09('0x1')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x4d09('0x1')]},'description':{'type':Sequelize[_0x4d09('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index a92a312..961624f 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 _0x136c=['undefined','limit','count','offset','status','set','Content-Range','update','then','destroy','ChanSpies','end','error','stack','name','send','index','VoiceChanSpy','fieldName','type','key','map','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','include','show','params','rawAttributes','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','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','../../config/utils','../../mysqldb','sendStatus'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0x136c,0x1d2));var _0xc136=function(_0x3d5a49,_0x44a550){_0x3d5a49=_0x3d5a49-0x0;var _0x43abb9=_0x136c[_0x3d5a49];return _0x43abb9;};'use strict';var emlformat=require(_0xc136('0x0'));var rimraf=require(_0xc136('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc136('0x2'));var rp=require(_0xc136('0x3'));var moment=require(_0xc136('0x4'));var BPromise=require(_0xc136('0x5'));var Mustache=require(_0xc136('0x6'));var util=require(_0xc136('0x7'));var path=require(_0xc136('0x8'));var sox=require(_0xc136('0x9'));var csv=require(_0xc136('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc136('0xb'));var _=require('lodash');var squel=require(_0xc136('0xc'));var crypto=require(_0xc136('0xd'));var jsforce=require(_0xc136('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xc136('0xa'));var querystring=require('querystring');var Papa=require(_0xc136('0xf'));var Redis=require(_0xc136('0x10'));var authService=require(_0xc136('0x11'));var qs=require(_0xc136('0x12'));var as=require(_0xc136('0x13'));var hardwareService=require(_0xc136('0x14'));var logger=require(_0xc136('0x15'))(_0xc136('0x16'));var utils=require(_0xc136('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc136('0x18'))['db'];function respondWithStatusCode(_0x5d0c62,_0x17b00b){_0x17b00b=_0x17b00b||0xcc;return function(_0x473a8b){if(_0x473a8b){return _0x5d0c62[_0xc136('0x19')](_0x17b00b);}return _0x5d0c62['status'](_0x17b00b)['end']();};}function respondWithResult(_0x15be1a,_0x36d55d){_0x36d55d=_0x36d55d||0xc8;return function(_0x4e2674){if(_0x4e2674){return _0x15be1a['status'](_0x36d55d)['json'](_0x4e2674);}};}function respondWithFilteredResult(_0x2e28ba,_0x16e87f){return function(_0x4fa765){if(_0x4fa765){var _0x4e24fb=typeof _0x16e87f['offset']===_0xc136('0x1a')&&typeof _0x16e87f[_0xc136('0x1b')]===_0xc136('0x1a');var _0x155929=_0x4fa765[_0xc136('0x1c')];var _0x1ccf5f=_0x4e24fb?0x0:_0x16e87f['offset'];var _0x5df9b7=_0x4e24fb?_0x4fa765['count']:_0x16e87f[_0xc136('0x1d')]+_0x16e87f['limit'];var _0x238f8c;if(_0x5df9b7>=_0x155929){_0x5df9b7=_0x155929;_0x238f8c=0xc8;}else{_0x238f8c=0xce;}_0x2e28ba[_0xc136('0x1e')](_0x238f8c);return _0x2e28ba[_0xc136('0x1f')](_0xc136('0x20'),_0x1ccf5f+'-'+_0x5df9b7+'/'+_0x155929)['json'](_0x4fa765);}return null;};}function patchUpdates(_0x2b8527){return function(_0x1f942b){try{jsonpatch['apply'](_0x1f942b,_0x2b8527,!![]);}catch(_0xc26366){return BPromise['reject'](_0xc26366);}return _0x1f942b['save']();};}function saveUpdates(_0x5ac0bf,_0x1a350a){return function(_0x4f766d){if(_0x4f766d){return _0x4f766d[_0xc136('0x21')](_0x5ac0bf)[_0xc136('0x22')](function(_0x279c07){return _0x279c07;});}return null;};}function removeEntity(_0x45e5fe,_0x5d8300){return function(_0x6f0831){if(_0x6f0831){return _0x6f0831[_0xc136('0x23')]()['then'](function(){var _0x3432b0=_0x6f0831['get']({'plain':!![]});var _0x21a163=_0xc136('0x24');return db['UserProfileResource']['destroy']({'where':{'type':_0x21a163,'resourceId':_0x3432b0['id']}})[_0xc136('0x22')](function(){return _0x6f0831;});})[_0xc136('0x22')](function(){_0x45e5fe['status'](0xcc)[_0xc136('0x25')]();});}};}function handleEntityNotFound(_0x283d7a,_0x31e862){return function(_0x2608b8){if(!_0x2608b8){_0x283d7a[_0xc136('0x19')](0x194);}return _0x2608b8;};}function handleError(_0x1c1057,_0xa3e411){_0xa3e411=_0xa3e411||0x1f4;return function(_0x5f3027){logger[_0xc136('0x26')](_0x5f3027[_0xc136('0x27')]);if(_0x5f3027[_0xc136('0x28')]){delete _0x5f3027[_0xc136('0x28')];}_0x1c1057[_0xc136('0x1e')](_0xa3e411)[_0xc136('0x29')](_0x5f3027);};}exports[_0xc136('0x2a')]=function(_0x1cba1e,_0x24632e){var _0x5e591e={},_0x2b3e73={},_0x218d07={'count':0x0,'rows':[]};var _0x4497bc=_['map'](db[_0xc136('0x2b')]['rawAttributes'],function(_0x4e5e09){return{'name':_0x4e5e09[_0xc136('0x2c')],'type':_0x4e5e09[_0xc136('0x2d')][_0xc136('0x2e')]};});_0x2b3e73['model']=_[_0xc136('0x2f')](_0x4497bc,_0xc136('0x28'));_0x2b3e73['query']=_[_0xc136('0x30')](_0x1cba1e[_0xc136('0x31')]);_0x2b3e73['filters']=_[_0xc136('0x32')](_0x2b3e73[_0xc136('0x33')],_0x2b3e73[_0xc136('0x31')]);_0x5e591e[_0xc136('0x34')]=_[_0xc136('0x32')](_0x2b3e73[_0xc136('0x33')],qs[_0xc136('0x35')](_0x1cba1e[_0xc136('0x31')][_0xc136('0x35')]));_0x5e591e[_0xc136('0x34')]=_0x5e591e[_0xc136('0x34')][_0xc136('0x36')]?_0x5e591e['attributes']:_0x2b3e73[_0xc136('0x33')];if(!_0x1cba1e[_0xc136('0x31')][_0xc136('0x37')](_0xc136('0x38'))){_0x5e591e[_0xc136('0x1b')]=qs[_0xc136('0x1b')](_0x1cba1e[_0xc136('0x31')]['limit']);_0x5e591e[_0xc136('0x1d')]=qs[_0xc136('0x1d')](_0x1cba1e[_0xc136('0x31')][_0xc136('0x1d')]);}_0x5e591e[_0xc136('0x39')]=qs[_0xc136('0x3a')](_0x1cba1e[_0xc136('0x31')]['sort']);_0x5e591e[_0xc136('0x3b')]=qs[_0xc136('0x3c')](_[_0xc136('0x3d')](_0x1cba1e[_0xc136('0x31')],_0x2b3e73[_0xc136('0x3c')]),_0x4497bc);if(_0x1cba1e['query'][_0xc136('0x3e')]){_0x5e591e[_0xc136('0x3b')]=_['merge'](_0x5e591e[_0xc136('0x3b')],{'$or':_[_0xc136('0x2f')](_0x4497bc,function(_0x26d2fc){if(_0x26d2fc[_0xc136('0x2d')]!==_0xc136('0x3f')){var _0x5d404e={};_0x5d404e[_0x26d2fc['name']]={'$like':'%'+_0x1cba1e[_0xc136('0x31')]['filter']+'%'};return _0x5d404e;}})});}_0x5e591e=_[_0xc136('0x40')]({},_0x5e591e,_0x1cba1e[_0xc136('0x41')]);var _0xabd8ff={'where':_0x5e591e[_0xc136('0x3b')]};return db[_0xc136('0x2b')][_0xc136('0x1c')](_0xabd8ff)[_0xc136('0x22')](function(_0x51af1e){_0x218d07['count']=_0x51af1e;if(_0x1cba1e[_0xc136('0x31')]['includeAll']){_0x5e591e[_0xc136('0x42')]=[{'all':!![]}];}return db[_0xc136('0x2b')]['findAll'](_0x5e591e);})[_0xc136('0x22')](function(_0x2c18c6){_0x218d07['rows']=_0x2c18c6;return _0x218d07;})['then'](respondWithFilteredResult(_0x24632e,_0x5e591e))['catch'](handleError(_0x24632e,null));};exports[_0xc136('0x43')]=function(_0x371142,_0x53c426){var _0x141ab0={'raw':![],'where':{'id':_0x371142[_0xc136('0x44')]['id']}},_0x18bed7={};_0x18bed7['model']=_[_0xc136('0x30')](db[_0xc136('0x2b')][_0xc136('0x45')]);_0x18bed7[_0xc136('0x31')]=_[_0xc136('0x30')](_0x371142['query']);_0x18bed7[_0xc136('0x3c')]=_[_0xc136('0x32')](_0x18bed7[_0xc136('0x33')],_0x18bed7[_0xc136('0x31')]);_0x141ab0[_0xc136('0x34')]=_[_0xc136('0x32')](_0x18bed7[_0xc136('0x33')],qs[_0xc136('0x35')](_0x371142[_0xc136('0x31')][_0xc136('0x35')]));_0x141ab0[_0xc136('0x34')]=_0x141ab0[_0xc136('0x34')][_0xc136('0x36')]?_0x141ab0[_0xc136('0x34')]:_0x18bed7[_0xc136('0x33')];if(_0x371142[_0xc136('0x31')][_0xc136('0x46')]){_0x141ab0[_0xc136('0x42')]=[{'all':!![]}];}_0x141ab0=_[_0xc136('0x40')]({},_0x141ab0,_0x371142[_0xc136('0x41')]);return db['VoiceChanSpy'][_0xc136('0x47')](_0x141ab0)[_0xc136('0x22')](handleEntityNotFound(_0x53c426,null))[_0xc136('0x22')](respondWithResult(_0x53c426,null))['catch'](handleError(_0x53c426,null));};exports['create']=function(_0x34193c,_0x24f258){return db[_0xc136('0x2b')][_0xc136('0x48')](_0x34193c[_0xc136('0x49')],{})['then'](function(_0x25288d){var _0x133715=_0x34193c[_0xc136('0x4a')][_0xc136('0x4b')]({'plain':!![]});if(!_0x133715)throw new Error(_0xc136('0x4c'));if(_0x133715[_0xc136('0x4d')]===_0xc136('0x4a')){var _0x4ea74f=_0x25288d[_0xc136('0x4b')]({'plain':!![]});var _0x16784c=_0xc136('0x24');return db[_0xc136('0x4e')]['find']({'where':{'name':_0x16784c,'userProfileId':_0x133715['userProfileId']},'raw':!![]})[_0xc136('0x22')](function(_0x2c7b74){if(_0x2c7b74&&_0x2c7b74['autoAssociation']===0x0){return db[_0xc136('0x4f')][_0xc136('0x48')]({'name':_0x4ea74f[_0xc136('0x28')],'resourceId':_0x4ea74f['id'],'type':_0x2c7b74[_0xc136('0x28')],'sectionId':_0x2c7b74['id']},{})[_0xc136('0x22')](function(){return _0x25288d;});}else{return _0x25288d;}})[_0xc136('0x50')](function(_0x2e91d2){logger[_0xc136('0x26')](_0xc136('0x51'),_0x2e91d2);throw _0x2e91d2;});}return _0x25288d;})[_0xc136('0x22')](respondWithResult(_0x24f258,0xc9))['catch'](handleError(_0x24f258,null));};exports['update']=function(_0x16f568,_0x297158){if(_0x16f568[_0xc136('0x49')]['id']){delete _0x16f568[_0xc136('0x49')]['id'];}return db[_0xc136('0x2b')][_0xc136('0x47')]({'where':{'id':_0x16f568[_0xc136('0x44')]['id']}})[_0xc136('0x22')](handleEntityNotFound(_0x297158,null))['then'](saveUpdates(_0x16f568['body'],null))['then'](respondWithResult(_0x297158,null))['catch'](handleError(_0x297158,null));};exports[_0xc136('0x23')]=function(_0x5a18ef,_0x5ab4a0){return db[_0xc136('0x2b')]['find']({'where':{'id':_0x5a18ef[_0xc136('0x44')]['id']}})[_0xc136('0x22')](handleEntityNotFound(_0x5ab4a0,null))['then'](removeEntity(_0x5ab4a0,null))[_0xc136('0x50')](handleError(_0x5ab4a0,null));}; \ No newline at end of file +var _0x1491=['query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','options','includeAll','include','rows','catch','params','keys','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','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/advancedSearch','../../config/utils','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','destroy','then','get','ChanSpies','UserProfileResource','error','name','send','map','VoiceChanSpy','rawAttributes','type','key','intersection','model'];(function(_0x4fecca,_0x41c652){var _0x5528f3=function(_0x55b997){while(--_0x55b997){_0x4fecca['push'](_0x4fecca['shift']());}};_0x5528f3(++_0x41c652);}(_0x1491,0x1b1));var _0x1149=function(_0x3078cd,_0xbd49a5){_0x3078cd=_0x3078cd-0x0;var _0x553add=_0x1491[_0x3078cd];return _0x553add;};'use strict';var emlformat=require(_0x1149('0x0'));var rimraf=require(_0x1149('0x1'));var zipdir=require(_0x1149('0x2'));var jsonpatch=require(_0x1149('0x3'));var rp=require('request-promise');var moment=require(_0x1149('0x4'));var BPromise=require(_0x1149('0x5'));var Mustache=require(_0x1149('0x6'));var util=require(_0x1149('0x7'));var path=require(_0x1149('0x8'));var sox=require(_0x1149('0x9'));var csv=require(_0x1149('0xa'));var ejs=require(_0x1149('0xb'));var fs=require('fs');var fs_extra=require(_0x1149('0xc'));var _=require(_0x1149('0xd'));var squel=require(_0x1149('0xe'));var crypto=require(_0x1149('0xf'));var jsforce=require(_0x1149('0x10'));var deskjs=require(_0x1149('0x11'));var toCsv=require(_0x1149('0xa'));var querystring=require(_0x1149('0x12'));var Papa=require(_0x1149('0x13'));var Redis=require(_0x1149('0x14'));var authService=require(_0x1149('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0x1149('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x1149('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1149('0x18'))['db'];function respondWithStatusCode(_0x55ba22,_0x439553){_0x439553=_0x439553||0xcc;return function(_0x3531e6){if(_0x3531e6){return _0x55ba22[_0x1149('0x19')](_0x439553);}return _0x55ba22[_0x1149('0x1a')](_0x439553)[_0x1149('0x1b')]();};}function respondWithResult(_0x22a1b6,_0x5aa405){_0x5aa405=_0x5aa405||0xc8;return function(_0x4749f1){if(_0x4749f1){return _0x22a1b6['status'](_0x5aa405)['json'](_0x4749f1);}};}function respondWithFilteredResult(_0x669ae,_0xdac107){return function(_0x552de8){if(_0x552de8){var _0xdee3e5=typeof _0xdac107[_0x1149('0x1c')]===_0x1149('0x1d')&&typeof _0xdac107[_0x1149('0x1e')]===_0x1149('0x1d');var _0x27f49f=_0x552de8[_0x1149('0x1f')];var _0x373ca0=_0xdee3e5?0x0:_0xdac107[_0x1149('0x1c')];var _0x88c9b1=_0xdee3e5?_0x552de8[_0x1149('0x1f')]:_0xdac107[_0x1149('0x1c')]+_0xdac107[_0x1149('0x1e')];var _0x517c77;if(_0x88c9b1>=_0x27f49f){_0x88c9b1=_0x27f49f;_0x517c77=0xc8;}else{_0x517c77=0xce;}_0x669ae['status'](_0x517c77);return _0x669ae[_0x1149('0x20')](_0x1149('0x21'),_0x373ca0+'-'+_0x88c9b1+'/'+_0x27f49f)[_0x1149('0x22')](_0x552de8);}return null;};}function patchUpdates(_0x4781b8){return function(_0x27a2fb){try{jsonpatch['apply'](_0x27a2fb,_0x4781b8,!![]);}catch(_0x20b2bc){return BPromise[_0x1149('0x23')](_0x20b2bc);}return _0x27a2fb[_0x1149('0x24')]();};}function saveUpdates(_0x4d5649,_0x3a891c){return function(_0x2d6b4b){if(_0x2d6b4b){return _0x2d6b4b[_0x1149('0x25')](_0x4d5649)['then'](function(_0x695140){return _0x695140;});}return null;};}function removeEntity(_0x214f3e,_0x20a1b6){return function(_0x59eb5e){if(_0x59eb5e){return _0x59eb5e[_0x1149('0x26')]()[_0x1149('0x27')](function(){var _0x1f36ff=_0x59eb5e[_0x1149('0x28')]({'plain':!![]});var _0x1d6843=_0x1149('0x29');return db[_0x1149('0x2a')][_0x1149('0x26')]({'where':{'type':_0x1d6843,'resourceId':_0x1f36ff['id']}})[_0x1149('0x27')](function(){return _0x59eb5e;});})[_0x1149('0x27')](function(){_0x214f3e['status'](0xcc)[_0x1149('0x1b')]();});}};}function handleEntityNotFound(_0x17cf9b,_0x56a81e){return function(_0x5516d4){if(!_0x5516d4){_0x17cf9b[_0x1149('0x19')](0x194);}return _0x5516d4;};}function handleError(_0x4dc164,_0x593df7){_0x593df7=_0x593df7||0x1f4;return function(_0x1b633a){logger[_0x1149('0x2b')](_0x1b633a['stack']);if(_0x1b633a[_0x1149('0x2c')]){delete _0x1b633a[_0x1149('0x2c')];}_0x4dc164[_0x1149('0x1a')](_0x593df7)[_0x1149('0x2d')](_0x1b633a);};}exports['index']=function(_0x5d267a,_0x4f9834){var _0x1ce0e8={},_0x27619c={},_0x337569={'count':0x0,'rows':[]};var _0x482c8e=_[_0x1149('0x2e')](db[_0x1149('0x2f')][_0x1149('0x30')],function(_0x123317){return{'name':_0x123317['fieldName'],'type':_0x123317[_0x1149('0x31')][_0x1149('0x32')]};});_0x27619c['model']=_['map'](_0x482c8e,_0x1149('0x2c'));_0x27619c['query']=_['keys'](_0x5d267a['query']);_0x27619c['filters']=_[_0x1149('0x33')](_0x27619c[_0x1149('0x34')],_0x27619c[_0x1149('0x35')]);_0x1ce0e8['attributes']=_[_0x1149('0x33')](_0x27619c['model'],qs['fields'](_0x5d267a[_0x1149('0x35')][_0x1149('0x36')]));_0x1ce0e8[_0x1149('0x37')]=_0x1ce0e8[_0x1149('0x37')][_0x1149('0x38')]?_0x1ce0e8['attributes']:_0x27619c[_0x1149('0x34')];if(!_0x5d267a[_0x1149('0x35')][_0x1149('0x39')](_0x1149('0x3a'))){_0x1ce0e8[_0x1149('0x1e')]=qs['limit'](_0x5d267a[_0x1149('0x35')][_0x1149('0x1e')]);_0x1ce0e8[_0x1149('0x1c')]=qs[_0x1149('0x1c')](_0x5d267a[_0x1149('0x35')][_0x1149('0x1c')]);}_0x1ce0e8[_0x1149('0x3b')]=qs[_0x1149('0x3c')](_0x5d267a['query'][_0x1149('0x3c')]);_0x1ce0e8[_0x1149('0x3d')]=qs['filters'](_['pick'](_0x5d267a[_0x1149('0x35')],_0x27619c[_0x1149('0x3e')]),_0x482c8e);if(_0x5d267a[_0x1149('0x35')][_0x1149('0x3f')]){_0x1ce0e8['where']=_['merge'](_0x1ce0e8['where'],{'$or':_[_0x1149('0x2e')](_0x482c8e,function(_0x38a980){if(_0x38a980[_0x1149('0x31')]!=='VIRTUAL'){var _0x478a5c={};_0x478a5c[_0x38a980['name']]={'$like':'%'+_0x5d267a[_0x1149('0x35')]['filter']+'%'};return _0x478a5c;}})});}_0x1ce0e8=_['merge']({},_0x1ce0e8,_0x5d267a[_0x1149('0x40')]);var _0x47c84d={'where':_0x1ce0e8[_0x1149('0x3d')]};return db['VoiceChanSpy']['count'](_0x47c84d)['then'](function(_0x37ad54){_0x337569['count']=_0x37ad54;if(_0x5d267a['query'][_0x1149('0x41')]){_0x1ce0e8[_0x1149('0x42')]=[{'all':!![]}];}return db['VoiceChanSpy']['findAll'](_0x1ce0e8);})[_0x1149('0x27')](function(_0x31e646){_0x337569[_0x1149('0x43')]=_0x31e646;return _0x337569;})[_0x1149('0x27')](respondWithFilteredResult(_0x4f9834,_0x1ce0e8))[_0x1149('0x44')](handleError(_0x4f9834,null));};exports['show']=function(_0x58b434,_0x3ccf97){var _0x31df65={'raw':![],'where':{'id':_0x58b434[_0x1149('0x45')]['id']}},_0x47af09={};_0x47af09['model']=_[_0x1149('0x46')](db['VoiceChanSpy'][_0x1149('0x30')]);_0x47af09[_0x1149('0x35')]=_[_0x1149('0x46')](_0x58b434[_0x1149('0x35')]);_0x47af09[_0x1149('0x3e')]=_['intersection'](_0x47af09[_0x1149('0x34')],_0x47af09[_0x1149('0x35')]);_0x31df65[_0x1149('0x37')]=_[_0x1149('0x33')](_0x47af09[_0x1149('0x34')],qs['fields'](_0x58b434['query'][_0x1149('0x36')]));_0x31df65[_0x1149('0x37')]=_0x31df65[_0x1149('0x37')][_0x1149('0x38')]?_0x31df65['attributes']:_0x47af09[_0x1149('0x34')];if(_0x58b434[_0x1149('0x35')]['includeAll']){_0x31df65[_0x1149('0x42')]=[{'all':!![]}];}_0x31df65=_[_0x1149('0x47')]({},_0x31df65,_0x58b434['options']);return db['VoiceChanSpy'][_0x1149('0x48')](_0x31df65)[_0x1149('0x27')](handleEntityNotFound(_0x3ccf97,null))['then'](respondWithResult(_0x3ccf97,null))[_0x1149('0x44')](handleError(_0x3ccf97,null));};exports[_0x1149('0x49')]=function(_0x3af860,_0x24bcc0){return db['VoiceChanSpy'][_0x1149('0x49')](_0x3af860[_0x1149('0x4a')],{})[_0x1149('0x27')](function(_0x332c28){var _0x19b5b1=_0x3af860[_0x1149('0x4b')][_0x1149('0x28')]({'plain':!![]});if(!_0x19b5b1)throw new Error(_0x1149('0x4c'));if(_0x19b5b1[_0x1149('0x4d')]===_0x1149('0x4b')){var _0xff32f4=_0x332c28[_0x1149('0x28')]({'plain':!![]});var _0x13c8ed='ChanSpies';return db[_0x1149('0x4e')][_0x1149('0x48')]({'where':{'name':_0x13c8ed,'userProfileId':_0x19b5b1[_0x1149('0x4f')]},'raw':!![]})[_0x1149('0x27')](function(_0x22e18d){if(_0x22e18d&&_0x22e18d['autoAssociation']===0x0){return db[_0x1149('0x2a')][_0x1149('0x49')]({'name':_0xff32f4[_0x1149('0x2c')],'resourceId':_0xff32f4['id'],'type':_0x22e18d[_0x1149('0x2c')],'sectionId':_0x22e18d['id']},{})[_0x1149('0x27')](function(){return _0x332c28;});}else{return _0x332c28;}})[_0x1149('0x44')](function(_0x301796){logger[_0x1149('0x2b')](_0x1149('0x50'),_0x301796);throw _0x301796;});}return _0x332c28;})[_0x1149('0x27')](respondWithResult(_0x24bcc0,0xc9))['catch'](handleError(_0x24bcc0,null));};exports[_0x1149('0x25')]=function(_0x44d8d6,_0x37c82e){if(_0x44d8d6['body']['id']){delete _0x44d8d6['body']['id'];}return db[_0x1149('0x2f')][_0x1149('0x48')]({'where':{'id':_0x44d8d6[_0x1149('0x45')]['id']}})['then'](handleEntityNotFound(_0x37c82e,null))['then'](saveUpdates(_0x44d8d6[_0x1149('0x4a')],null))[_0x1149('0x27')](respondWithResult(_0x37c82e,null))[_0x1149('0x44')](handleError(_0x37c82e,null));};exports[_0x1149('0x26')]=function(_0x5b6924,_0x16c12e){return db['VoiceChanSpy'][_0x1149('0x48')]({'where':{'id':_0x5b6924[_0x1149('0x45')]['id']}})[_0x1149('0x27')](handleEntityNotFound(_0x16c12e,null))['then'](removeEntity(_0x16c12e,null))['catch'](handleError(_0x16c12e,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 8f28e4f..ccb68be 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 _0xae43=['recordingFormat','auth','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','record','concat','internal','User','agent','then','catch','exports','models','VoiceChanSpy','voice_chanspy','VoiceExtension','destroy','length','lodash','util','./voiceChanSpy.attributes','context','from-sip','format','%s%s','prefix','system','merge','Set','CDR(type)=%s','chanspy','push','MixMonitor','${UNIQUEID}.%s,a'];(function(_0x55c6db,_0x5c0329){var _0x4b4d40=function(_0x38bdfc){while(--_0x38bdfc){_0x55c6db['push'](_0x55c6db['shift']());}};_0x4b4d40(++_0x5c0329);}(_0xae43,0x146));var _0x3ae4=function(_0x339d45,_0x5b91d4){_0x339d45=_0x339d45-0x0;var _0x5e4a60=_0xae43[_0x339d45];return _0x5e4a60;};'use strict';var _=require(_0x3ae4('0x0'));var util=require(_0x3ae4('0x1'));var BPromise=require('bluebird');var attributes=require(_0x3ae4('0x2'));var getUserApplications=function(_0x424840,_0x4135d8,_0x49c657){var _0x3ada7b=0x1;var _0x440234=[];var _0x35f5d9={'context':_0x4135d8[_0x3ae4('0x3')]||_0x3ae4('0x4'),'exten':util[_0x3ae4('0x5')](_0x3ae4('0x6'),_0x424840[_0x3ae4('0x7')],_0x49c657),'type':_0x3ae4('0x8'),'isApp':![],'ChanSpyId':_0x424840['id'],'UserId':_0x4135d8['id']};_0x440234['push'](_[_0x3ae4('0x9')]({'app':_0x3ae4('0xa'),'appdata':util[_0x3ae4('0x5')](_0x3ae4('0xb'),_0x3ae4('0xc')),'priority':_0x3ada7b++},_0x35f5d9));if(_0x424840['record']){_0x440234[_0x3ae4('0xd')](_[_0x3ae4('0x9')]({'app':_0x3ae4('0xe'),'appdata':util['format'](_0x3ae4('0xf'),_0x424840[_0x3ae4('0x10')]),'priority':_0x3ada7b++},_0x35f5d9));}if(_0x424840[_0x3ae4('0x11')]){_0x440234[_0x3ae4('0xd')](_[_0x3ae4('0x9')]({'app':_0x3ae4('0x12'),'appdata':_0x424840[_0x3ae4('0x13')],'priority':_0x3ada7b++},_0x35f5d9));}_0x440234['push'](_[_0x3ae4('0x9')]({'app':_0x3ae4('0x14'),'appdata':util[_0x3ae4('0x5')](_0x3ae4('0x15'),_0x4135d8[_0x3ae4('0x16')],_0x424840['options']?_0x424840[_0x3ae4('0x17')]['join'](''):''),'priority':_0x3ada7b++},_0x35f5d9));if(_0x424840[_0x3ae4('0x18')]){_0x440234[_0x3ae4('0xd')](_[_0x3ae4('0x9')]({'app':'StopMixMonitor','priority':_0x3ada7b++},_0x35f5d9));}return _0x440234;};var getChanSpyApplications=function(_0x1fdb7b,_0x4e5df0){var _0x30735e=[];for(var _0x10aa71=0x0,_0x5a6ab9=0x1;_0x10aa71<_0x4e5df0['length'];_0x10aa71++,_0x5a6ab9=0x1){_0x30735e=_0x30735e[_0x3ae4('0x19')](getUserApplications(_0x1fdb7b,_0x4e5df0[_0x10aa71],_0x4e5df0[_0x10aa71][_0x3ae4('0x1a')]));if(_0x4e5df0[_0x10aa71][_0x3ae4('0x1a')]!=_0x4e5df0[_0x10aa71][_0x3ae4('0x16')]){_0x30735e=_0x30735e['concat'](getUserApplications(_0x1fdb7b,_0x4e5df0[_0x10aa71],_0x4e5df0[_0x10aa71][_0x3ae4('0x16')]));}}return _0x30735e;};var getChanSpyPromise=function(_0x3f7e9b,_0x3365cd){return new BPromise(function(_0x250b87,_0x53b7df){return _0x3f7e9b[_0x3ae4('0x1b')]['findAll']({'attributes':['id',_0x3ae4('0x16'),_0x3ae4('0x1a')],'where':{'role':_0x3ae4('0x1c'),'chanspy':!![]},'raw':!![]})[_0x3ae4('0x1d')](function(_0x25eff7){if(_0x25eff7){return _0x250b87(getChanSpyApplications(_0x3365cd,_0x25eff7));}return _0x250b87([]);})[_0x3ae4('0x1e')](function(_0x41422a){_0x53b7df(_0x41422a);});});};module[_0x3ae4('0x1f')]=function(_0x1c7257,_0x442cfd){var _0x3f1c18=_0x1c7257[_0x3ae4('0x20')];return _0x1c7257['define'](_0x3ae4('0x21'),attributes,{'tableName':_0x3ae4('0x22'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x438604,_0x4074b6,_0x1ffd9c){return getChanSpyPromise(_0x3f1c18,_0x438604)[_0x3ae4('0x1d')](function(_0x1e2b66){if(_0x1e2b66&&_0x1e2b66['length']){return _0x3f1c18['VoiceExtension']['bulkCreate'](_0x1e2b66);}})[_0x3ae4('0x1d')](function(){_0x1ffd9c();})[_0x3ae4('0x1e')](function(_0x475b79){_0x1ffd9c(_0x475b79);});},'afterUpdate':function(_0x2a80cc,_0x28a1ed,_0x579abf){return _0x3f1c18[_0x3ae4('0x23')][_0x3ae4('0x24')]({'where':{'ChanSpyId':_0x2a80cc['id']}})['then'](function(){return getChanSpyPromise(_0x3f1c18,_0x2a80cc);})[_0x3ae4('0x1d')](function(_0x4fef39){if(_0x4fef39&&_0x4fef39[_0x3ae4('0x25')]){return _0x3f1c18[_0x3ae4('0x23')]['bulkCreate'](_0x4fef39);}})[_0x3ae4('0x1d')](function(){_0x579abf();})[_0x3ae4('0x1e')](function(_0x2a5900){_0x579abf(_0x2a5900);});},'afterDestroy':function(_0x3bf461,_0x537010,_0x39846f){return _0x3f1c18['VoiceExtension'][_0x3ae4('0x24')]({'where':{'ChanSpyId':_0x3bf461['id']}})['then'](function(){_0x39846f();})[_0x3ae4('0x1e')](function(_0x4b2170){_0x39846f(_0x4b2170);});}}});}; \ No newline at end of file +var _0xeb6b=['chanspy','record','merge','MixMonitor','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','StopMixMonitor','length','concat','internal','User','findAll','agent','catch','models','define','VoiceChanSpy','voice_chanspy','then','VoiceExtension','bulkCreate','destroy','lodash','util','bluebird','./voiceChanSpy.attributes','format','%s%s','prefix','system','push','Set','CDR(type)=%s'];(function(_0x4f732f,_0x421804){var _0x4aebcd=function(_0x2d3fb7){while(--_0x2d3fb7){_0x4f732f['push'](_0x4f732f['shift']());}};_0x4aebcd(++_0x421804);}(_0xeb6b,0x18c));var _0xbeb6=function(_0x5b9a89,_0x1ea158){_0x5b9a89=_0x5b9a89-0x0;var _0x3d867b=_0xeb6b[_0x5b9a89];return _0x3d867b;};'use strict';var _=require(_0xbeb6('0x0'));var util=require(_0xbeb6('0x1'));var BPromise=require(_0xbeb6('0x2'));var attributes=require(_0xbeb6('0x3'));var getUserApplications=function(_0x3007b0,_0x17388b,_0x1f75e8){var _0x400bba=0x1;var _0x2bfa55=[];var _0x2b7fe7={'context':_0x17388b['context']||'from-sip','exten':util[_0xbeb6('0x4')](_0xbeb6('0x5'),_0x3007b0[_0xbeb6('0x6')],_0x1f75e8),'type':_0xbeb6('0x7'),'isApp':![],'ChanSpyId':_0x3007b0['id'],'UserId':_0x17388b['id']};_0x2bfa55[_0xbeb6('0x8')](_['merge']({'app':_0xbeb6('0x9'),'appdata':util['format'](_0xbeb6('0xa'),_0xbeb6('0xb')),'priority':_0x400bba++},_0x2b7fe7));if(_0x3007b0[_0xbeb6('0xc')]){_0x2bfa55[_0xbeb6('0x8')](_[_0xbeb6('0xd')]({'app':_0xbeb6('0xe'),'appdata':util[_0xbeb6('0x4')]('${UNIQUEID}.%s,a',_0x3007b0['recordingFormat']),'priority':_0x400bba++},_0x2b7fe7));}if(_0x3007b0['auth']){_0x2bfa55[_0xbeb6('0x8')](_['merge']({'app':_0xbeb6('0xf'),'appdata':_0x3007b0[_0xbeb6('0x10')],'priority':_0x400bba++},_0x2b7fe7));}_0x2bfa55[_0xbeb6('0x8')](_[_0xbeb6('0xd')]({'app':_0xbeb6('0x11'),'appdata':util['format'](_0xbeb6('0x12'),_0x17388b[_0xbeb6('0x13')],_0x3007b0[_0xbeb6('0x14')]?_0x3007b0[_0xbeb6('0x14')]['join'](''):''),'priority':_0x400bba++},_0x2b7fe7));if(_0x3007b0[_0xbeb6('0xc')]){_0x2bfa55[_0xbeb6('0x8')](_[_0xbeb6('0xd')]({'app':_0xbeb6('0x15'),'priority':_0x400bba++},_0x2b7fe7));}return _0x2bfa55;};var getChanSpyApplications=function(_0x557fb3,_0x31a891){var _0x3e07d4=[];for(var _0x4f5c98=0x0,_0x2244fa=0x1;_0x4f5c98<_0x31a891[_0xbeb6('0x16')];_0x4f5c98++,_0x2244fa=0x1){_0x3e07d4=_0x3e07d4[_0xbeb6('0x17')](getUserApplications(_0x557fb3,_0x31a891[_0x4f5c98],_0x31a891[_0x4f5c98][_0xbeb6('0x18')]));if(_0x31a891[_0x4f5c98][_0xbeb6('0x18')]!=_0x31a891[_0x4f5c98][_0xbeb6('0x13')]){_0x3e07d4=_0x3e07d4[_0xbeb6('0x17')](getUserApplications(_0x557fb3,_0x31a891[_0x4f5c98],_0x31a891[_0x4f5c98]['name']));}}return _0x3e07d4;};var getChanSpyPromise=function(_0x5bf9a5,_0x97f564){return new BPromise(function(_0x6def84,_0x9dd8d6){return _0x5bf9a5[_0xbeb6('0x19')][_0xbeb6('0x1a')]({'attributes':['id',_0xbeb6('0x13'),_0xbeb6('0x18')],'where':{'role':_0xbeb6('0x1b'),'chanspy':!![]},'raw':!![]})['then'](function(_0x4dfd89){if(_0x4dfd89){return _0x6def84(getChanSpyApplications(_0x97f564,_0x4dfd89));}return _0x6def84([]);})[_0xbeb6('0x1c')](function(_0x167376){_0x9dd8d6(_0x167376);});});};module['exports']=function(_0x397afc,_0x4d30e0){var _0x5d2afd=_0x397afc[_0xbeb6('0x1d')];return _0x397afc[_0xbeb6('0x1e')](_0xbeb6('0x1f'),attributes,{'tableName':_0xbeb6('0x20'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0xabb73d,_0x244668,_0x281b7a){return getChanSpyPromise(_0x5d2afd,_0xabb73d)[_0xbeb6('0x21')](function(_0x538f99){if(_0x538f99&&_0x538f99['length']){return _0x5d2afd[_0xbeb6('0x22')]['bulkCreate'](_0x538f99);}})[_0xbeb6('0x21')](function(){_0x281b7a();})['catch'](function(_0x16661f){_0x281b7a(_0x16661f);});},'afterUpdate':function(_0x3c9dc5,_0x372be8,_0x33cfd1){return _0x5d2afd[_0xbeb6('0x22')]['destroy']({'where':{'ChanSpyId':_0x3c9dc5['id']}})[_0xbeb6('0x21')](function(){return getChanSpyPromise(_0x5d2afd,_0x3c9dc5);})[_0xbeb6('0x21')](function(_0x515bf7){if(_0x515bf7&&_0x515bf7[_0xbeb6('0x16')]){return _0x5d2afd[_0xbeb6('0x22')][_0xbeb6('0x23')](_0x515bf7);}})[_0xbeb6('0x21')](function(){_0x33cfd1();})[_0xbeb6('0x1c')](function(_0x3fcabd){_0x33cfd1(_0x3fcabd);});},'afterDestroy':function(_0xb23f02,_0x5c76b8,_0x1b17cc){return _0x5d2afd['VoiceExtension'][_0xbeb6('0x24')]({'where':{'ChanSpyId':_0xb23f02['id']}})['then'](function(){_0x1b17cc();})[_0xbeb6('0x1c')](function(_0x3026a9){_0x1b17cc(_0x3026a9);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 6d458a7..0c8de54 100644 --- a/server/api/voiceChanSpy/voiceChanSpy.rpc.js +++ b/server/api/voiceChanSpy/voiceChanSpy.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3c81=['VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird','randomstring','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x277968,_0x21ff21){var _0x4be944=function(_0x9a02b8){while(--_0x9a02b8){_0x277968['push'](_0x277968['shift']());}};_0x4be944(++_0x21ff21);}(_0x3c81,0x102));var _0x13c8=function(_0x1f7a9e,_0x3c36a3){_0x1f7a9e=_0x1f7a9e-0x0;var _0x5920bb=_0x3c81[_0x1f7a9e];return _0x5920bb;};'use strict';var _=require(_0x13c8('0x0'));var util=require(_0x13c8('0x1'));var moment=require('moment');var BPromise=require(_0x13c8('0x2'));var rs=require(_0x13c8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x13c8('0x4'));var config=require(_0x13c8('0x5'));var jayson=require(_0x13c8('0x6'));var client=jayson[_0x13c8('0x7')][_0x13c8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f0bd2,_0x445b69,_0x4f7bcc){return new BPromise(function(_0x17c228,_0x4905c3){return client[_0x13c8('0x9')](_0x3f0bd2,_0x4f7bcc)[_0x13c8('0xa')](function(_0x189ce6){logger[_0x13c8('0xb')](_0x13c8('0xc'),_0x445b69,_0x13c8('0xd'));logger[_0x13c8('0xe')](_0x13c8('0xf'),_0x445b69,_0x13c8('0xd'),JSON[_0x13c8('0x10')](_0x189ce6));if(_0x189ce6[_0x13c8('0x11')]){if(_0x189ce6[_0x13c8('0x11')][_0x13c8('0x12')]===0x1f4){logger[_0x13c8('0x11')]('VoiceChanSpy,\x20%s,\x20%s',_0x445b69,_0x189ce6[_0x13c8('0x11')][_0x13c8('0x13')]);return _0x4905c3(_0x189ce6[_0x13c8('0x11')][_0x13c8('0x13')]);}logger['error'](_0x13c8('0xc'),_0x445b69,_0x189ce6['error']['message']);return _0x17c228(_0x189ce6['error'][_0x13c8('0x13')]);}else{logger['info'](_0x13c8('0xc'),_0x445b69,_0x13c8('0xd'));_0x17c228(_0x189ce6[_0x13c8('0x14')][_0x13c8('0x13')]);}})['catch'](function(_0x13a9e1){logger[_0x13c8('0x11')](_0x13c8('0xc'),_0x445b69,_0x13a9e1);_0x4905c3(_0x13a9e1);});});} \ No newline at end of file +var _0x7af2=['catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','error','message','VoiceChanSpy,\x20%s,\x20%s','result'];(function(_0x3fa853,_0x2f7da8){var _0x5111a8=function(_0x2703ad){while(--_0x2703ad){_0x3fa853['push'](_0x3fa853['shift']());}};_0x5111a8(++_0x2f7da8);}(_0x7af2,0x119));var _0x27af=function(_0xe31859,_0x5ed378){_0xe31859=_0xe31859-0x0;var _0x255df2=_0x7af2[_0xe31859];return _0x255df2;};'use strict';var _=require('lodash');var util=require(_0x27af('0x0'));var moment=require(_0x27af('0x1'));var BPromise=require(_0x27af('0x2'));var rs=require(_0x27af('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x27af('0x4'))['db'];var utils=require(_0x27af('0x5'));var logger=require(_0x27af('0x6'))(_0x27af('0x7'));var config=require(_0x27af('0x8'));var jayson=require(_0x27af('0x9'));var client=jayson[_0x27af('0xa')][_0x27af('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2193c6,_0x572219,_0x1e2509){return new BPromise(function(_0x366868,_0x389e97){return client['request'](_0x2193c6,_0x1e2509)[_0x27af('0xc')](function(_0xfa1882){logger[_0x27af('0xd')]('VoiceChanSpy,\x20%s,\x20%s',_0x572219,_0x27af('0xe'));logger['debug']('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0x572219,_0x27af('0xe'),JSON['stringify'](_0xfa1882));if(_0xfa1882['error']){if(_0xfa1882[_0x27af('0xf')]['code']===0x1f4){logger[_0x27af('0xf')]('VoiceChanSpy,\x20%s,\x20%s',_0x572219,_0xfa1882[_0x27af('0xf')][_0x27af('0x10')]);return _0x389e97(_0xfa1882[_0x27af('0xf')][_0x27af('0x10')]);}logger[_0x27af('0xf')](_0x27af('0x11'),_0x572219,_0xfa1882[_0x27af('0xf')][_0x27af('0x10')]);return _0x366868(_0xfa1882[_0x27af('0xf')][_0x27af('0x10')]);}else{logger[_0x27af('0xd')](_0x27af('0x11'),_0x572219,_0x27af('0xe'));_0x366868(_0xfa1882[_0x27af('0x12')][_0x27af('0x10')]);}})[_0x27af('0x13')](function(_0x13f8ed){logger[_0x27af('0xf')]('VoiceChanSpy,\x20%s,\x20%s',_0x572219,_0x13f8ed);_0x389e97(_0x13f8ed);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 96f79de..8e4a5e6 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 _0xb1b6=['delete','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceContext.controller','get','isAuthenticated','index','/:id','show','create','update'];(function(_0x53c240,_0x49d9ef){var _0x926802=function(_0x481050){while(--_0x481050){_0x53c240['push'](_0x53c240['shift']());}};_0x926802(++_0x49d9ef);}(_0xb1b6,0x1aa));var _0x6b1b=function(_0x2c7f28,_0x2078a4){_0x2c7f28=_0x2c7f28-0x0;var _0x146708=_0xb1b6[_0x2c7f28];return _0x146708;};'use strict';var multer=require(_0x6b1b('0x0'));var util=require('util');var path=require(_0x6b1b('0x1'));var timeout=require(_0x6b1b('0x2'));var express=require(_0x6b1b('0x3'));var router=express[_0x6b1b('0x4')]();var fs_extra=require(_0x6b1b('0x5'));var auth=require(_0x6b1b('0x6'));var interaction=require(_0x6b1b('0x7'));var config=require('../../config/environment');var controller=require(_0x6b1b('0x8'));router[_0x6b1b('0x9')]('/',auth[_0x6b1b('0xa')](),controller[_0x6b1b('0xb')]);router[_0x6b1b('0x9')](_0x6b1b('0xc'),auth[_0x6b1b('0xa')](),controller[_0x6b1b('0xd')]);router['post']('/',auth[_0x6b1b('0xa')](),controller[_0x6b1b('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x6b1b('0xf')]);router[_0x6b1b('0x10')](_0x6b1b('0xc'),auth[_0x6b1b('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x2cd7=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','/:id','isAuthenticated','post','create','delete','destroy','exports','path'];(function(_0x40893b,_0x2f28ae){var _0x5ceb8a=function(_0x4bc90b){while(--_0x4bc90b){_0x40893b['push'](_0x40893b['shift']());}};_0x5ceb8a(++_0x2f28ae);}(_0x2cd7,0xcf));var _0x72cd=function(_0x1d3c28,_0x508984){_0x1d3c28=_0x1d3c28-0x0;var _0x49af6b=_0x2cd7[_0x1d3c28];return _0x49af6b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x72cd('0x0'));var timeout=require('connect-timeout');var express=require(_0x72cd('0x1'));var router=express[_0x72cd('0x2')]();var fs_extra=require(_0x72cd('0x3'));var auth=require(_0x72cd('0x4'));var interaction=require(_0x72cd('0x5'));var config=require(_0x72cd('0x6'));var controller=require(_0x72cd('0x7'));router[_0x72cd('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x72cd('0x8')](_0x72cd('0x9'),auth[_0x72cd('0xa')](),controller['show']);router[_0x72cd('0xb')]('/',auth[_0x72cd('0xa')](),controller[_0x72cd('0xc')]);router['put'](_0x72cd('0x9'),auth[_0x72cd('0xa')](),controller['update']);router[_0x72cd('0xd')](_0x72cd('0x9'),auth[_0x72cd('0xa')](),controller[_0x72cd('0xe')]);module[_0x72cd('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index e4446b7..99a73c2 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 _0xaeaa=['BOOLEAN','exports','STRING','name'];(function(_0x380d70,_0x137364){var _0x3b8ef6=function(_0x389dfd){while(--_0x389dfd){_0x380d70['push'](_0x380d70['shift']());}};_0x3b8ef6(++_0x137364);}(_0xaeaa,0x6d));var _0xaaea=function(_0x212ed7,_0x31362c){_0x212ed7=_0x212ed7-0x0;var _0x13d051=_0xaeaa[_0x212ed7];return _0x13d051;};'use strict';var Sequelize=require('sequelize');module[_0xaaea('0x0')]={'name':{'type':Sequelize[_0xaaea('0x1')],'unique':_0xaaea('0x2')},'description':{'type':Sequelize[_0xaaea('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xaaea('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x0aa6=['BOOLEAN','sequelize','STRING','name'];(function(_0x371d05,_0x598ae4){var _0x2f5e21=function(_0x3ee4dc){while(--_0x3ee4dc){_0x371d05['push'](_0x371d05['shift']());}};_0x2f5e21(++_0x598ae4);}(_0x0aa6,0x79));var _0x60aa=function(_0x43e21a,_0x5e2d59){_0x43e21a=_0x43e21a-0x0;var _0x11d57d=_0x0aa6[_0x43e21a];return _0x11d57d;};'use strict';var Sequelize=require(_0x60aa('0x0'));module['exports']={'name':{'type':Sequelize[_0x60aa('0x1')],'unique':_0x60aa('0x2')},'description':{'type':Sequelize[_0x60aa('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x60aa('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index 715d2d0..38984f7 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 _0x70d3=['render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','moment','bluebird','util','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','http','then','info','VoiceContext,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','destroy','get','Contexts','UserProfileResource','end','stack','name','send','map','VoiceContext','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','merge','where','VIRTUAL','filter','includeAll','include','findAll','rows','show','params','options','find','create','body','readFileSync','join','root','server/files/templates/context.ejs','utf8'];(function(_0x1ab183,_0x47be8d){var _0x510d5e=function(_0x4e4b24){while(--_0x4e4b24){_0x1ab183['push'](_0x1ab183['shift']());}};_0x510d5e(++_0x47be8d);}(_0x70d3,0x6e));var _0x370d=function(_0x52460f,_0xa7092){_0x52460f=_0x52460f-0x0;var _0x30fa30=_0x70d3[_0x52460f];return _0x30fa30;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x370d('0x0'));var zipdir=require(_0x370d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x370d('0x2'));var BPromise=require(_0x370d('0x3'));var Mustache=require('mustache');var util=require(_0x370d('0x4'));var path=require(_0x370d('0x5'));var sox=require(_0x370d('0x6'));var csv=require('to-csv');var ejs=require(_0x370d('0x7'));var fs=require('fs');var fs_extra=require(_0x370d('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x370d('0x9'));var jsforce=require(_0x370d('0xa'));var deskjs=require(_0x370d('0xb'));var toCsv=require(_0x370d('0xc'));var querystring=require(_0x370d('0xd'));var Papa=require(_0x370d('0xe'));var Redis=require('ioredis');var authService=require(_0x370d('0xf'));var qs=require(_0x370d('0x10'));var as=require(_0x370d('0x11'));var hardwareService=require(_0x370d('0x12'));var logger=require(_0x370d('0x13'))(_0x370d('0x14'));var utils=require(_0x370d('0x15'));var config=require(_0x370d('0x16'));var licenseUtil=require(_0x370d('0x17'));var db=require('../../mysqldb')['db'];var jayson=require(_0x370d('0x18'));var client=jayson['client'][_0x370d('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x50c27e,_0x73c893,_0x1167eb,_0x3df566){return new BPromise(function(_0x4219ad,_0x2467a4){var _0xc87d0d=_0x3df566||client;return _0xc87d0d['request'](_0x50c27e,_0x1167eb)[_0x370d('0x1a')](function(_0x50e1d5){logger[_0x370d('0x1b')](_0x370d('0x1c'),_0x73c893,'request\x20sent');logger[_0x370d('0x1d')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x73c893,_0x370d('0x1e'),JSON['stringify'](_0x50e1d5));if(_0x50e1d5[_0x370d('0x1f')]){if(_0x50e1d5[_0x370d('0x1f')][_0x370d('0x20')]===0x1f4){logger[_0x370d('0x1f')](_0x370d('0x1c'),_0x73c893,_0x50e1d5[_0x370d('0x1f')][_0x370d('0x21')]);return _0x2467a4(_0x50e1d5[_0x370d('0x1f')][_0x370d('0x21')]);}logger['error'](_0x370d('0x1c'),_0x73c893,_0x50e1d5[_0x370d('0x1f')][_0x370d('0x21')]);return _0x4219ad(_0x50e1d5[_0x370d('0x1f')]['message']);}else{logger[_0x370d('0x1b')](_0x370d('0x1c'),_0x73c893,'request\x20sent');_0x4219ad(_0x50e1d5[_0x370d('0x22')]['message']);}})[_0x370d('0x23')](function(_0x2cd7e3){logger[_0x370d('0x1f')](_0x370d('0x1c'),_0x73c893,_0x2cd7e3);_0x2467a4(_0x2cd7e3);});});}function respondWithStatusCode(_0x2fc101,_0x4428e8){_0x4428e8=_0x4428e8||0xcc;return function(_0x58b08e){if(_0x58b08e){return _0x2fc101['sendStatus'](_0x4428e8);}return _0x2fc101[_0x370d('0x24')](_0x4428e8)['end']();};}function respondWithResult(_0x2b87b1,_0x5f0ca4){_0x5f0ca4=_0x5f0ca4||0xc8;return function(_0x19df66){if(_0x19df66){return _0x2b87b1[_0x370d('0x24')](_0x5f0ca4)[_0x370d('0x25')](_0x19df66);}};}function respondWithFilteredResult(_0x3df18a,_0x20ef9b){return function(_0xa75e){if(_0xa75e){var _0x4fa204=typeof _0x20ef9b[_0x370d('0x26')]==='undefined'&&typeof _0x20ef9b['limit']===_0x370d('0x27');var _0x424b51=_0xa75e[_0x370d('0x28')];var _0x573a7e=_0x4fa204?0x0:_0x20ef9b[_0x370d('0x26')];var _0x5753e4=_0x4fa204?_0xa75e[_0x370d('0x28')]:_0x20ef9b[_0x370d('0x26')]+_0x20ef9b[_0x370d('0x29')];var _0x2d5873;if(_0x5753e4>=_0x424b51){_0x5753e4=_0x424b51;_0x2d5873=0xc8;}else{_0x2d5873=0xce;}_0x3df18a['status'](_0x2d5873);return _0x3df18a[_0x370d('0x2a')](_0x370d('0x2b'),_0x573a7e+'-'+_0x5753e4+'/'+_0x424b51)[_0x370d('0x25')](_0xa75e);}return null;};}function patchUpdates(_0x1c7e5b){return function(_0x3a81ef){try{jsonpatch[_0x370d('0x2c')](_0x3a81ef,_0x1c7e5b,!![]);}catch(_0x4646c3){return BPromise[_0x370d('0x2d')](_0x4646c3);}return _0x3a81ef['save']();};}function saveUpdates(_0x45b511,_0x555fd0){return function(_0xef6ab5){if(_0xef6ab5){return _0xef6ab5[_0x370d('0x2e')](_0x45b511)[_0x370d('0x1a')](function(_0x2f253b){return _0x2f253b;});}return null;};}function removeEntity(_0x5b8bb1,_0x49408b){return function(_0x26c339){if(_0x26c339){return _0x26c339[_0x370d('0x2f')]()[_0x370d('0x1a')](function(){var _0x34b379=_0x26c339[_0x370d('0x30')]({'plain':!![]});var _0x33c400=_0x370d('0x31');return db[_0x370d('0x32')][_0x370d('0x2f')]({'where':{'type':_0x33c400,'resourceId':_0x34b379['id']}})[_0x370d('0x1a')](function(){return _0x26c339;});})['then'](function(){_0x5b8bb1['status'](0xcc)[_0x370d('0x33')]();});}};}function handleEntityNotFound(_0x1b5675,_0x461a77){return function(_0x39a9af){if(!_0x39a9af){_0x1b5675['sendStatus'](0x194);}return _0x39a9af;};}function handleError(_0x4e8647,_0x2c023c){_0x2c023c=_0x2c023c||0x1f4;return function(_0x255661){logger[_0x370d('0x1f')](_0x255661[_0x370d('0x34')]);if(_0x255661[_0x370d('0x35')]){delete _0x255661[_0x370d('0x35')];}_0x4e8647['status'](_0x2c023c)[_0x370d('0x36')](_0x255661);};}exports['index']=function(_0x52314d,_0x29184f){var _0x5b2859={},_0x2c64c3={},_0x25970e={'count':0x0,'rows':[]};var _0x26e582=_[_0x370d('0x37')](db[_0x370d('0x38')][_0x370d('0x39')],function(_0x4da7c3){return{'name':_0x4da7c3[_0x370d('0x3a')],'type':_0x4da7c3[_0x370d('0x3b')][_0x370d('0x3c')]};});_0x2c64c3[_0x370d('0x3d')]=_[_0x370d('0x37')](_0x26e582,'name');_0x2c64c3[_0x370d('0x3e')]=_[_0x370d('0x3f')](_0x52314d[_0x370d('0x3e')]);_0x2c64c3['filters']=_[_0x370d('0x40')](_0x2c64c3['model'],_0x2c64c3[_0x370d('0x3e')]);_0x5b2859[_0x370d('0x41')]=_[_0x370d('0x40')](_0x2c64c3[_0x370d('0x3d')],qs[_0x370d('0x42')](_0x52314d[_0x370d('0x3e')][_0x370d('0x42')]));_0x5b2859[_0x370d('0x41')]=_0x5b2859[_0x370d('0x41')][_0x370d('0x43')]?_0x5b2859['attributes']:_0x2c64c3['model'];if(!_0x52314d[_0x370d('0x3e')][_0x370d('0x44')]('nolimit')){_0x5b2859[_0x370d('0x29')]=qs[_0x370d('0x29')](_0x52314d[_0x370d('0x3e')][_0x370d('0x29')]);_0x5b2859['offset']=qs[_0x370d('0x26')](_0x52314d[_0x370d('0x3e')][_0x370d('0x26')]);}_0x5b2859[_0x370d('0x45')]=qs[_0x370d('0x46')](_0x52314d[_0x370d('0x3e')]['sort']);_0x5b2859['where']=qs[_0x370d('0x47')](_[_0x370d('0x48')](_0x52314d['query'],_0x2c64c3[_0x370d('0x47')]),_0x26e582);if(_0x52314d[_0x370d('0x3e')]['filter']){_0x5b2859['where']=_[_0x370d('0x49')](_0x5b2859[_0x370d('0x4a')],{'$or':_[_0x370d('0x37')](_0x26e582,function(_0x3c022a){if(_0x3c022a[_0x370d('0x3b')]!==_0x370d('0x4b')){var _0x3aff37={};_0x3aff37[_0x3c022a[_0x370d('0x35')]]={'$like':'%'+_0x52314d[_0x370d('0x3e')][_0x370d('0x4c')]+'%'};return _0x3aff37;}})});}_0x5b2859=_['merge']({},_0x5b2859,_0x52314d['options']);var _0x1defa5={'where':_0x5b2859[_0x370d('0x4a')]};return db['VoiceContext'][_0x370d('0x28')](_0x1defa5)[_0x370d('0x1a')](function(_0x4f848d){_0x25970e[_0x370d('0x28')]=_0x4f848d;if(_0x52314d['query'][_0x370d('0x4d')]){_0x5b2859[_0x370d('0x4e')]=[{'all':!![]}];}return db['VoiceContext'][_0x370d('0x4f')](_0x5b2859);})[_0x370d('0x1a')](function(_0xa3b85b){_0x25970e[_0x370d('0x50')]=_0xa3b85b;return _0x25970e;})[_0x370d('0x1a')](respondWithFilteredResult(_0x29184f,_0x5b2859))[_0x370d('0x23')](handleError(_0x29184f,null));};exports[_0x370d('0x51')]=function(_0x5d9466,_0x12c3a6){var _0x1000ae={'raw':![],'where':{'id':_0x5d9466[_0x370d('0x52')]['id']}},_0x5dd3d7={};_0x5dd3d7[_0x370d('0x3d')]=_[_0x370d('0x3f')](db[_0x370d('0x38')][_0x370d('0x39')]);_0x5dd3d7['query']=_[_0x370d('0x3f')](_0x5d9466['query']);_0x5dd3d7['filters']=_[_0x370d('0x40')](_0x5dd3d7[_0x370d('0x3d')],_0x5dd3d7[_0x370d('0x3e')]);_0x1000ae['attributes']=_[_0x370d('0x40')](_0x5dd3d7[_0x370d('0x3d')],qs[_0x370d('0x42')](_0x5d9466['query'][_0x370d('0x42')]));_0x1000ae[_0x370d('0x41')]=_0x1000ae[_0x370d('0x41')]['length']?_0x1000ae['attributes']:_0x5dd3d7['model'];if(_0x5d9466[_0x370d('0x3e')][_0x370d('0x4d')]){_0x1000ae[_0x370d('0x4e')]=[{'all':!![]}];}_0x1000ae=_[_0x370d('0x49')]({},_0x1000ae,_0x5d9466[_0x370d('0x53')]);return db['VoiceContext'][_0x370d('0x54')](_0x1000ae)[_0x370d('0x1a')](handleEntityNotFound(_0x12c3a6,null))[_0x370d('0x1a')](respondWithResult(_0x12c3a6,null))[_0x370d('0x23')](handleError(_0x12c3a6,null));};exports['create']=function(_0x12476d,_0x4712a1,_0xacb8ce){var _0x514808;return db[_0x370d('0x38')][_0x370d('0x55')](_0x12476d[_0x370d('0x56')],{'raw':!![]})[_0x370d('0x1a')](function(_0x486bec){_0x514808=_0x486bec;return db['VoiceContext'][_0x370d('0x4f')]({'raw':!![]});})['then'](function(_0x25939d){var _0x55ea26=fs[_0x370d('0x57')](path[_0x370d('0x58')](config[_0x370d('0x59')],_0x370d('0x5a')),_0x370d('0x5b'));var _0x20c670=ejs[_0x370d('0x5c')](_0x55ea26,{'contexts':_0x25939d||[]});fs[_0x370d('0x5d')](_0x370d('0x5e'),_0x20c670);})[_0x370d('0x1a')](function(){return respondWithRpcPromise(_0x370d('0x5f'),_0x370d('0x55'),{'module':_0x370d('0x60')});})['then'](function(){var _0x3e1a76=_0x12476d[_0x370d('0x61')][_0x370d('0x30')]({'plain':!![]});if(!_0x3e1a76)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3e1a76['role']===_0x370d('0x61')){var _0x57c4dd=_0x514808['get']({'plain':!![]});return db[_0x370d('0x62')][_0x370d('0x54')]({'where':{'name':'Contexts','userProfileId':_0x3e1a76['userProfileId']},'raw':!![]})[_0x370d('0x1a')](function(_0x5f3de6){if(_0x5f3de6&&_0x5f3de6[_0x370d('0x63')]===0x0){return db[_0x370d('0x32')][_0x370d('0x55')]({'name':_0x57c4dd[_0x370d('0x35')],'resourceId':_0x57c4dd['id'],'type':_0x5f3de6['name'],'sectionId':_0x5f3de6['id']},{})[_0x370d('0x1a')](function(){return _0x514808;});}else{return _0x514808;}})[_0x370d('0x23')](function(_0x124137){logger[_0x370d('0x1f')](_0x370d('0x64'),_0x124137);throw _0x124137;});}return _0x514808;})[_0x370d('0x1a')](respondWithResult(_0x4712a1,0xc9))[_0x370d('0x23')](handleError(_0x4712a1,null));};exports[_0x370d('0x2e')]=function(_0x46e813,_0x3892fd,_0x437b06){var _0x1b6246;return db[_0x370d('0x38')][_0x370d('0x54')]({'where':{'id':_0x46e813['params']['id']}})[_0x370d('0x1a')](handleEntityNotFound(_0x3892fd,null))[_0x370d('0x1a')](saveUpdates(_0x46e813['body'],null))[_0x370d('0x1a')](function(_0x537cc7){if(_0x537cc7){_0x1b6246=_0x537cc7;return db['VoiceContext']['findAll']({'raw':!![]});}})[_0x370d('0x1a')](function(_0xbe02c){var _0x172b92=fs[_0x370d('0x57')](path['join'](config[_0x370d('0x59')],_0x370d('0x5a')),_0x370d('0x5b'));var _0x350910=ejs[_0x370d('0x5c')](_0x172b92,{'contexts':_0xbe02c||[]});fs[_0x370d('0x5d')](_0x370d('0x5e'),_0x350910);})['then'](function(){return respondWithRpcPromise(_0x370d('0x5f'),_0x370d('0x2e'),{'module':'chan_sip.so'});})[_0x370d('0x1a')](function(){return _0x1b6246;})[_0x370d('0x1a')](respondWithResult(_0x3892fd,null))[_0x370d('0x23')](handleError(_0x3892fd,null));};exports[_0x370d('0x2f')]=function(_0xd03344,_0x5312aa,_0x17795d){var _0x38dc90;return db['VoiceContext'][_0x370d('0x54')]({'where':{'id':_0xd03344[_0x370d('0x52')]['id']}})['then'](handleEntityNotFound(_0x5312aa,null))[_0x370d('0x1a')](removeEntity(_0x5312aa,null))['then'](function(){return db[_0x370d('0x38')][_0x370d('0x4f')]({'raw':!![]});})['then'](function(_0x436721){var _0x5cbcba=fs[_0x370d('0x57')](path[_0x370d('0x58')](config[_0x370d('0x59')],_0x370d('0x5a')),'utf8');var _0x2602c8=ejs['render'](_0x5cbcba,{'contexts':_0x436721});fs[_0x370d('0x5d')](_0x370d('0x5e'),_0x2602c8);return respondWithRpcPromise('Reload','destroy',{'module':_0x370d('0x60')});})[_0x370d('0x23')](handleError(_0x5312aa,null));}; \ No newline at end of file +var _0x0188=['eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','get','Contexts','UserProfileResource','stack','name','send','index','map','VoiceContext','fieldName','type','query','keys','filters','model','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','rawAttributes','intersection','length','find','create','body','readFileSync','join','server/files/templates/context.ejs','utf8','render','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findAll','writeFileSync','destroy','params','root'];(function(_0xce6234,_0x33c276){var _0x34ce87=function(_0x854446){while(--_0x854446){_0xce6234['push'](_0xce6234['shift']());}};_0x34ce87(++_0x33c276);}(_0x0188,0xd4));var _0x8018=function(_0x31abee,_0x11ff0c){_0x31abee=_0x31abee-0x0;var _0x3c1761=_0x0188[_0x31abee];return _0x3c1761;};'use strict';var emlformat=require(_0x8018('0x0'));var rimraf=require(_0x8018('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8018('0x2'));var moment=require(_0x8018('0x3'));var BPromise=require(_0x8018('0x4'));var Mustache=require(_0x8018('0x5'));var util=require(_0x8018('0x6'));var path=require(_0x8018('0x7'));var sox=require('sox');var csv=require(_0x8018('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8018('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x8018('0xa'));var jsforce=require(_0x8018('0xb'));var deskjs=require(_0x8018('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8018('0xd'));var Redis=require('ioredis');var authService=require(_0x8018('0xe'));var qs=require(_0x8018('0xf'));var as=require(_0x8018('0x10'));var hardwareService=require(_0x8018('0x11'));var logger=require(_0x8018('0x12'))(_0x8018('0x13'));var utils=require(_0x8018('0x14'));var config=require(_0x8018('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x8018('0x16'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x8018('0x17')][_0x8018('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x2d969a,_0x32bedd,_0x3d5981,_0x5119ea){return new BPromise(function(_0x2afc63,_0x31cfea){var _0x3488b6=_0x5119ea||client;return _0x3488b6[_0x8018('0x19')](_0x2d969a,_0x3d5981)[_0x8018('0x1a')](function(_0x5422ac){logger[_0x8018('0x1b')](_0x8018('0x1c'),_0x32bedd,_0x8018('0x1d'));logger['debug'](_0x8018('0x1e'),_0x32bedd,'request\x20sent',JSON['stringify'](_0x5422ac));if(_0x5422ac[_0x8018('0x1f')]){if(_0x5422ac[_0x8018('0x1f')][_0x8018('0x20')]===0x1f4){logger[_0x8018('0x1f')]('VoiceContext,\x20%s,\x20%s',_0x32bedd,_0x5422ac[_0x8018('0x1f')][_0x8018('0x21')]);return _0x31cfea(_0x5422ac['error'][_0x8018('0x21')]);}logger[_0x8018('0x1f')](_0x8018('0x1c'),_0x32bedd,_0x5422ac[_0x8018('0x1f')][_0x8018('0x21')]);return _0x2afc63(_0x5422ac[_0x8018('0x1f')][_0x8018('0x21')]);}else{logger[_0x8018('0x1b')](_0x8018('0x1c'),_0x32bedd,_0x8018('0x1d'));_0x2afc63(_0x5422ac[_0x8018('0x22')][_0x8018('0x21')]);}})['catch'](function(_0xaf542){logger['error'](_0x8018('0x1c'),_0x32bedd,_0xaf542);_0x31cfea(_0xaf542);});});}function respondWithStatusCode(_0x16dc51,_0x3e8e05){_0x3e8e05=_0x3e8e05||0xcc;return function(_0x192d15){if(_0x192d15){return _0x16dc51[_0x8018('0x23')](_0x3e8e05);}return _0x16dc51[_0x8018('0x24')](_0x3e8e05)[_0x8018('0x25')]();};}function respondWithResult(_0x21253a,_0x241185){_0x241185=_0x241185||0xc8;return function(_0x2def4){if(_0x2def4){return _0x21253a[_0x8018('0x24')](_0x241185)[_0x8018('0x26')](_0x2def4);}};}function respondWithFilteredResult(_0x4f3b58,_0x33e0fa){return function(_0x49a0ae){if(_0x49a0ae){var _0x38f7c9=typeof _0x33e0fa[_0x8018('0x27')]===_0x8018('0x28')&&typeof _0x33e0fa[_0x8018('0x29')]==='undefined';var _0x13d029=_0x49a0ae['count'];var _0x3fa94f=_0x38f7c9?0x0:_0x33e0fa[_0x8018('0x27')];var _0xc6aadc=_0x38f7c9?_0x49a0ae[_0x8018('0x2a')]:_0x33e0fa[_0x8018('0x27')]+_0x33e0fa[_0x8018('0x29')];var _0x56189e;if(_0xc6aadc>=_0x13d029){_0xc6aadc=_0x13d029;_0x56189e=0xc8;}else{_0x56189e=0xce;}_0x4f3b58[_0x8018('0x24')](_0x56189e);return _0x4f3b58[_0x8018('0x2b')](_0x8018('0x2c'),_0x3fa94f+'-'+_0xc6aadc+'/'+_0x13d029)[_0x8018('0x26')](_0x49a0ae);}return null;};}function patchUpdates(_0x4d74ad){return function(_0x49641b){try{jsonpatch[_0x8018('0x2d')](_0x49641b,_0x4d74ad,!![]);}catch(_0x2e73d0){return BPromise[_0x8018('0x2e')](_0x2e73d0);}return _0x49641b[_0x8018('0x2f')]();};}function saveUpdates(_0x5c9f59,_0x3dde9a){return function(_0x3cda09){if(_0x3cda09){return _0x3cda09[_0x8018('0x30')](_0x5c9f59)[_0x8018('0x1a')](function(_0x1f28c1){return _0x1f28c1;});}return null;};}function removeEntity(_0x282480,_0x3c3537){return function(_0x55734a){if(_0x55734a){return _0x55734a['destroy']()[_0x8018('0x1a')](function(){var _0x4ab5a9=_0x55734a[_0x8018('0x31')]({'plain':!![]});var _0xd42ada=_0x8018('0x32');return db[_0x8018('0x33')]['destroy']({'where':{'type':_0xd42ada,'resourceId':_0x4ab5a9['id']}})['then'](function(){return _0x55734a;});})[_0x8018('0x1a')](function(){_0x282480[_0x8018('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1becd8,_0x2ea441){return function(_0x3d86e7){if(!_0x3d86e7){_0x1becd8[_0x8018('0x23')](0x194);}return _0x3d86e7;};}function handleError(_0x1db1de,_0x39a34b){_0x39a34b=_0x39a34b||0x1f4;return function(_0x7665ac){logger[_0x8018('0x1f')](_0x7665ac[_0x8018('0x34')]);if(_0x7665ac[_0x8018('0x35')]){delete _0x7665ac[_0x8018('0x35')];}_0x1db1de['status'](_0x39a34b)[_0x8018('0x36')](_0x7665ac);};}exports[_0x8018('0x37')]=function(_0x5dc6df,_0x4de3d1){var _0x2e28ae={},_0x404079={},_0x55b795={'count':0x0,'rows':[]};var _0x5ee6b9=_[_0x8018('0x38')](db[_0x8018('0x39')]['rawAttributes'],function(_0x3571b2){return{'name':_0x3571b2[_0x8018('0x3a')],'type':_0x3571b2[_0x8018('0x3b')]['key']};});_0x404079['model']=_[_0x8018('0x38')](_0x5ee6b9,_0x8018('0x35'));_0x404079[_0x8018('0x3c')]=_[_0x8018('0x3d')](_0x5dc6df['query']);_0x404079[_0x8018('0x3e')]=_['intersection'](_0x404079[_0x8018('0x3f')],_0x404079[_0x8018('0x3c')]);_0x2e28ae[_0x8018('0x40')]=_['intersection'](_0x404079[_0x8018('0x3f')],qs[_0x8018('0x41')](_0x5dc6df[_0x8018('0x3c')][_0x8018('0x41')]));_0x2e28ae[_0x8018('0x40')]=_0x2e28ae[_0x8018('0x40')]['length']?_0x2e28ae['attributes']:_0x404079['model'];if(!_0x5dc6df[_0x8018('0x3c')][_0x8018('0x42')](_0x8018('0x43'))){_0x2e28ae[_0x8018('0x29')]=qs[_0x8018('0x29')](_0x5dc6df['query'][_0x8018('0x29')]);_0x2e28ae['offset']=qs['offset'](_0x5dc6df[_0x8018('0x3c')]['offset']);}_0x2e28ae[_0x8018('0x44')]=qs['sort'](_0x5dc6df[_0x8018('0x3c')][_0x8018('0x45')]);_0x2e28ae['where']=qs['filters'](_[_0x8018('0x46')](_0x5dc6df['query'],_0x404079[_0x8018('0x3e')]),_0x5ee6b9);if(_0x5dc6df[_0x8018('0x3c')][_0x8018('0x47')]){_0x2e28ae[_0x8018('0x48')]=_[_0x8018('0x49')](_0x2e28ae[_0x8018('0x48')],{'$or':_[_0x8018('0x38')](_0x5ee6b9,function(_0x32433e){if(_0x32433e[_0x8018('0x3b')]!==_0x8018('0x4a')){var _0x4b4072={};_0x4b4072[_0x32433e[_0x8018('0x35')]]={'$like':'%'+_0x5dc6df['query'][_0x8018('0x47')]+'%'};return _0x4b4072;}})});}_0x2e28ae=_[_0x8018('0x49')]({},_0x2e28ae,_0x5dc6df[_0x8018('0x4b')]);var _0x2fd339={'where':_0x2e28ae['where']};return db[_0x8018('0x39')]['count'](_0x2fd339)[_0x8018('0x1a')](function(_0xd5f5d0){_0x55b795[_0x8018('0x2a')]=_0xd5f5d0;if(_0x5dc6df[_0x8018('0x3c')][_0x8018('0x4c')]){_0x2e28ae[_0x8018('0x4d')]=[{'all':!![]}];}return db[_0x8018('0x39')]['findAll'](_0x2e28ae);})[_0x8018('0x1a')](function(_0x3d1889){_0x55b795[_0x8018('0x4e')]=_0x3d1889;return _0x55b795;})[_0x8018('0x1a')](respondWithFilteredResult(_0x4de3d1,_0x2e28ae))[_0x8018('0x4f')](handleError(_0x4de3d1,null));};exports['show']=function(_0x5d0c5c,_0x232de1){var _0x15e77c={'raw':![],'where':{'id':_0x5d0c5c['params']['id']}},_0x56a551={};_0x56a551[_0x8018('0x3f')]=_['keys'](db[_0x8018('0x39')][_0x8018('0x50')]);_0x56a551[_0x8018('0x3c')]=_[_0x8018('0x3d')](_0x5d0c5c[_0x8018('0x3c')]);_0x56a551[_0x8018('0x3e')]=_['intersection'](_0x56a551[_0x8018('0x3f')],_0x56a551[_0x8018('0x3c')]);_0x15e77c[_0x8018('0x40')]=_[_0x8018('0x51')](_0x56a551['model'],qs['fields'](_0x5d0c5c['query'][_0x8018('0x41')]));_0x15e77c[_0x8018('0x40')]=_0x15e77c[_0x8018('0x40')][_0x8018('0x52')]?_0x15e77c['attributes']:_0x56a551[_0x8018('0x3f')];if(_0x5d0c5c[_0x8018('0x3c')]['includeAll']){_0x15e77c[_0x8018('0x4d')]=[{'all':!![]}];}_0x15e77c=_[_0x8018('0x49')]({},_0x15e77c,_0x5d0c5c[_0x8018('0x4b')]);return db['VoiceContext'][_0x8018('0x53')](_0x15e77c)[_0x8018('0x1a')](handleEntityNotFound(_0x232de1,null))[_0x8018('0x1a')](respondWithResult(_0x232de1,null))[_0x8018('0x4f')](handleError(_0x232de1,null));};exports[_0x8018('0x54')]=function(_0x5b922a,_0x20699d,_0x4ea929){var _0x4d944d;return db[_0x8018('0x39')][_0x8018('0x54')](_0x5b922a[_0x8018('0x55')],{'raw':!![]})[_0x8018('0x1a')](function(_0x5cee9b){_0x4d944d=_0x5cee9b;return db['VoiceContext']['findAll']({'raw':!![]});})[_0x8018('0x1a')](function(_0x554fdb){var _0x43370b=fs[_0x8018('0x56')](path[_0x8018('0x57')](config['root'],_0x8018('0x58')),_0x8018('0x59'));var _0x570794=ejs[_0x8018('0x5a')](_0x43370b,{'contexts':_0x554fdb||[]});fs['writeFileSync'](_0x8018('0x5b'),_0x570794);})['then'](function(){return respondWithRpcPromise(_0x8018('0x5c'),_0x8018('0x54'),{'module':_0x8018('0x5d')});})['then'](function(){var _0x26014a=_0x5b922a[_0x8018('0x5e')][_0x8018('0x31')]({'plain':!![]});if(!_0x26014a)throw new Error(_0x8018('0x5f'));if(_0x26014a[_0x8018('0x60')]===_0x8018('0x5e')){var _0x12f802=_0x4d944d['get']({'plain':!![]});return db[_0x8018('0x61')]['find']({'where':{'name':'Contexts','userProfileId':_0x26014a[_0x8018('0x62')]},'raw':!![]})[_0x8018('0x1a')](function(_0x3c7372){if(_0x3c7372&&_0x3c7372[_0x8018('0x63')]===0x0){return db[_0x8018('0x33')][_0x8018('0x54')]({'name':_0x12f802[_0x8018('0x35')],'resourceId':_0x12f802['id'],'type':_0x3c7372['name'],'sectionId':_0x3c7372['id']},{})[_0x8018('0x1a')](function(){return _0x4d944d;});}else{return _0x4d944d;}})[_0x8018('0x4f')](function(_0xbf16a0){logger[_0x8018('0x1f')](_0x8018('0x64'),_0xbf16a0);throw _0xbf16a0;});}return _0x4d944d;})[_0x8018('0x1a')](respondWithResult(_0x20699d,0xc9))[_0x8018('0x4f')](handleError(_0x20699d,null));};exports[_0x8018('0x30')]=function(_0x57b970,_0x14cf79,_0xc685dc){var _0x31efa6;return db[_0x8018('0x39')][_0x8018('0x53')]({'where':{'id':_0x57b970['params']['id']}})['then'](handleEntityNotFound(_0x14cf79,null))[_0x8018('0x1a')](saveUpdates(_0x57b970[_0x8018('0x55')],null))[_0x8018('0x1a')](function(_0x828c62){if(_0x828c62){_0x31efa6=_0x828c62;return db[_0x8018('0x39')][_0x8018('0x65')]({'raw':!![]});}})['then'](function(_0x16f1cd){var _0x15c551=fs['readFileSync'](path[_0x8018('0x57')](config['root'],_0x8018('0x58')),_0x8018('0x59'));var _0xf279cd=ejs[_0x8018('0x5a')](_0x15c551,{'contexts':_0x16f1cd||[]});fs[_0x8018('0x66')](_0x8018('0x5b'),_0xf279cd);})['then'](function(){return respondWithRpcPromise(_0x8018('0x5c'),'update',{'module':_0x8018('0x5d')});})[_0x8018('0x1a')](function(){return _0x31efa6;})[_0x8018('0x1a')](respondWithResult(_0x14cf79,null))[_0x8018('0x4f')](handleError(_0x14cf79,null));};exports[_0x8018('0x67')]=function(_0x212360,_0x4e5fa8,_0x4b3c9f){var _0x132945;return db[_0x8018('0x39')][_0x8018('0x53')]({'where':{'id':_0x212360[_0x8018('0x68')]['id']}})[_0x8018('0x1a')](handleEntityNotFound(_0x4e5fa8,null))['then'](removeEntity(_0x4e5fa8,null))[_0x8018('0x1a')](function(){return db[_0x8018('0x39')][_0x8018('0x65')]({'raw':!![]});})[_0x8018('0x1a')](function(_0x560e0d){var _0x320eee=fs['readFileSync'](path[_0x8018('0x57')](config[_0x8018('0x69')],'server/files/templates/context.ejs'),_0x8018('0x59'));var _0x35ca33=ejs[_0x8018('0x5a')](_0x320eee,{'contexts':_0x560e0d});fs['writeFileSync'](_0x8018('0x5b'),_0x35ca33);return respondWithRpcPromise(_0x8018('0x5c'),'destroy',{'module':'chan_sip.so'});})[_0x8018('0x4f')](handleError(_0x4e5fa8,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 90959db..4c8bce3 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 _0xd081=['rimraf','../../config/environment','define','VoiceContext','voice_contexts','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x49677a,_0x197e86){var _0x115408=function(_0xc88918){while(--_0xc88918){_0x49677a['push'](_0x49677a['shift']());}};_0x115408(++_0x197e86);}(_0xd081,0x13d));var _0x1d08=function(_0x314422,_0xe926d6){_0x314422=_0x314422-0x0;var _0x5c7ebb=_0xd081[_0x314422];return _0x5c7ebb;};'use strict';var _=require(_0x1d08('0x0'));var util=require(_0x1d08('0x1'));var logger=require(_0x1d08('0x2'))(_0x1d08('0x3'));var moment=require(_0x1d08('0x4'));var BPromise=require(_0x1d08('0x5'));var rp=require(_0x1d08('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1d08('0x7'));var config=require(_0x1d08('0x8'));var attributes=require('./voiceContext.attributes');module['exports']=function(_0x3d4d99,_0x515d66){return _0x3d4d99[_0x1d08('0x9')](_0x1d08('0xa'),attributes,{'tableName':_0x1d08('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8e8a=['api','bluebird','request-promise','rimraf','./voiceContext.attributes','exports','VoiceContext','voice_contexts','util','../../config/logger'];(function(_0x1dfba0,_0x1ff985){var _0x5bf628=function(_0x414ff5){while(--_0x414ff5){_0x1dfba0['push'](_0x1dfba0['shift']());}};_0x5bf628(++_0x1ff985);}(_0x8e8a,0x8a));var _0xa8e8=function(_0x5a1fe9,_0x33ff4f){_0x5a1fe9=_0x5a1fe9-0x0;var _0x296584=_0x8e8a[_0x5a1fe9];return _0x296584;};'use strict';var _=require('lodash');var util=require(_0xa8e8('0x0'));var logger=require(_0xa8e8('0x1'))(_0xa8e8('0x2'));var moment=require('moment');var BPromise=require(_0xa8e8('0x3'));var rp=require(_0xa8e8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa8e8('0x5'));var config=require('../../config/environment');var attributes=require(_0xa8e8('0x6'));module[_0xa8e8('0x7')]=function(_0x36c7a4,_0x4be22c){return _0x36c7a4['define'](_0xa8e8('0x8'),attributes,{'tableName':_0xa8e8('0x9'),'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 5e3e0b3..a39787d 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 _0x354b=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x103888,_0x2c9331){var _0x102a74=function(_0xbcd468){while(--_0xbcd468){_0x103888['push'](_0x103888['shift']());}};_0x102a74(++_0x2c9331);}(_0x354b,0x85));var _0xb354=function(_0xa802ba,_0x4a2872){_0xa802ba=_0xa802ba-0x0;var _0x2b418d=_0x354b[_0xa802ba];return _0x2b418d;};'use strict';var _=require(_0xb354('0x0'));var util=require(_0xb354('0x1'));var moment=require(_0xb354('0x2'));var BPromise=require(_0xb354('0x3'));var rs=require(_0xb354('0x4'));var fs=require('fs');var Redis=require(_0xb354('0x5'));var db=require(_0xb354('0x6'))['db'];var utils=require(_0xb354('0x7'));var logger=require(_0xb354('0x8'))(_0xb354('0x9'));var config=require('../../config/environment');var jayson=require(_0xb354('0xa'));var client=jayson['client'][_0xb354('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xaad045,_0x330e68,_0x5c4498){return new BPromise(function(_0x4cf3ac,_0x19f71b){return client['request'](_0xaad045,_0x5c4498)[_0xb354('0xc')](function(_0x5c273b){logger[_0xb354('0xd')](_0xb354('0xe'),_0x330e68,_0xb354('0xf'));logger[_0xb354('0x10')](_0xb354('0x11'),_0x330e68,_0xb354('0xf'),JSON[_0xb354('0x12')](_0x5c273b));if(_0x5c273b['error']){if(_0x5c273b['error']['code']===0x1f4){logger['error'](_0xb354('0xe'),_0x330e68,_0x5c273b[_0xb354('0x13')][_0xb354('0x14')]);return _0x19f71b(_0x5c273b[_0xb354('0x13')][_0xb354('0x14')]);}logger[_0xb354('0x13')](_0xb354('0xe'),_0x330e68,_0x5c273b[_0xb354('0x13')][_0xb354('0x14')]);return _0x4cf3ac(_0x5c273b[_0xb354('0x13')][_0xb354('0x14')]);}else{logger['info'](_0xb354('0xe'),_0x330e68,_0xb354('0xf'));_0x4cf3ac(_0x5c273b[_0xb354('0x15')][_0xb354('0x14')]);}})[_0xb354('0x16')](function(_0x38ec60){logger[_0xb354('0x13')](_0xb354('0xe'),_0x330e68,_0x38ec60);_0x19f71b(_0x38ec60);});});} \ No newline at end of file +var _0x99d4=['VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x587bdf,_0x5086cb){var _0x4cd8b2=function(_0x4dd70e){while(--_0x4dd70e){_0x587bdf['push'](_0x587bdf['shift']());}};_0x4cd8b2(++_0x5086cb);}(_0x99d4,0x122));var _0x499d=function(_0x35b62d,_0x51cc16){_0x35b62d=_0x35b62d-0x0;var _0x419912=_0x99d4[_0x35b62d];return _0x419912;};'use strict';var _=require(_0x499d('0x0'));var util=require('util');var moment=require(_0x499d('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x499d('0x2'));var db=require(_0x499d('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x499d('0x4'));var jayson=require(_0x499d('0x5'));var client=jayson[_0x499d('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b8134,_0x167110,_0x470d12){return new BPromise(function(_0x4e75b0,_0x4abf7d){return client[_0x499d('0x7')](_0x1b8134,_0x470d12)[_0x499d('0x8')](function(_0x23c468){logger[_0x499d('0x9')](_0x499d('0xa'),_0x167110,_0x499d('0xb'));logger[_0x499d('0xc')](_0x499d('0xd'),_0x167110,'request\x20sent',JSON[_0x499d('0xe')](_0x23c468));if(_0x23c468[_0x499d('0xf')]){if(_0x23c468[_0x499d('0xf')][_0x499d('0x10')]===0x1f4){logger[_0x499d('0xf')](_0x499d('0xa'),_0x167110,_0x23c468['error'][_0x499d('0x11')]);return _0x4abf7d(_0x23c468['error'][_0x499d('0x11')]);}logger[_0x499d('0xf')](_0x499d('0xa'),_0x167110,_0x23c468[_0x499d('0xf')][_0x499d('0x11')]);return _0x4e75b0(_0x23c468[_0x499d('0xf')][_0x499d('0x11')]);}else{logger['info'](_0x499d('0xa'),_0x167110,_0x499d('0xb'));_0x4e75b0(_0x23c468[_0x499d('0x12')][_0x499d('0x11')]);}})[_0x499d('0x13')](function(_0x1abcc1){logger[_0x499d('0xf')](_0x499d('0xa'),_0x167110,_0x1abcc1);_0x4abf7d(_0x1abcc1);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index d41eecd..905d4e3 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 _0x994b=['describe','/:id','isAuthenticated','post','put','update','delete','exports','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index'];(function(_0x2a68c5,_0x92456d){var _0x3adcba=function(_0x1db3ed){while(--_0x1db3ed){_0x2a68c5['push'](_0x2a68c5['shift']());}};_0x3adcba(++_0x92456d);}(_0x994b,0x198));var _0xb994=function(_0x3c4cae,_0x4f2faf){_0x3c4cae=_0x3c4cae-0x0;var _0x2011e7=_0x994b[_0x3c4cae];return _0x2011e7;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xb994('0x0'));var express=require(_0xb994('0x1'));var router=express['Router']();var fs_extra=require(_0xb994('0x2'));var auth=require(_0xb994('0x3'));var interaction=require(_0xb994('0x4'));var config=require(_0xb994('0x5'));var controller=require('./voiceDialReport.controller');router[_0xb994('0x6')]('/',auth['isAuthenticated'](),controller[_0xb994('0x7')]);router[_0xb994('0x6')]('/describe',auth['isAuthenticated'](),controller[_0xb994('0x8')]);router[_0xb994('0x6')](_0xb994('0x9'),auth[_0xb994('0xa')](),controller['show']);router[_0xb994('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0xb994('0xc')](_0xb994('0x9'),auth[_0xb994('0xa')](),controller[_0xb994('0xd')]);router[_0xb994('0xe')](_0xb994('0x9'),auth[_0xb994('0xa')](),controller['destroy']);module[_0xb994('0xf')]=router; \ No newline at end of file +var _0xcc7f=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','/:id','show','post','update','delete','destroy','multer','util','path','Router'];(function(_0x22f8c6,_0x57039c){var _0x524b47=function(_0x4d58f3){while(--_0x4d58f3){_0x22f8c6['push'](_0x22f8c6['shift']());}};_0x524b47(++_0x57039c);}(_0xcc7f,0x1e9));var _0xfcc7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcc7f[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xfcc7('0x0'));var util=require(_0xfcc7('0x1'));var path=require(_0xfcc7('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xfcc7('0x3')]();var fs_extra=require(_0xfcc7('0x4'));var auth=require(_0xfcc7('0x5'));var interaction=require(_0xfcc7('0x6'));var config=require(_0xfcc7('0x7'));var controller=require('./voiceDialReport.controller');router[_0xfcc7('0x8')]('/',auth[_0xfcc7('0x9')](),controller['index']);router[_0xfcc7('0x8')](_0xfcc7('0xa'),auth[_0xfcc7('0x9')](),controller['describe']);router[_0xfcc7('0x8')](_0xfcc7('0xb'),auth['isAuthenticated'](),controller[_0xfcc7('0xc')]);router[_0xfcc7('0xd')]('/',auth[_0xfcc7('0x9')](),controller['create']);router['put'](_0xfcc7('0xb'),auth['isAuthenticated'](),controller[_0xfcc7('0xe')]);router[_0xfcc7('0xf')](_0xfcc7('0xb'),auth[_0xfcc7('0x9')](),controller[_0xfcc7('0x10')]);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 2796cff..da0660d 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 _0x8ef6=['INTEGER','DATE','sequelize','exports','STRING'];(function(_0x1c510a,_0x1413a9){var _0x23cedd=function(_0x3f3e43){while(--_0x3f3e43){_0x1c510a['push'](_0x1c510a['shift']());}};_0x23cedd(++_0x1413a9);}(_0x8ef6,0xf2));var _0x68ef=function(_0x3b55a2,_0x56ec92){_0x3b55a2=_0x3b55a2-0x0;var _0x37bc6f=_0x8ef6[_0x3b55a2];return _0x37bc6f;};'use strict';var Sequelize=require(_0x68ef('0x0'));module[_0x68ef('0x1')]={'privilege':{'type':Sequelize[_0x68ef('0x2')]},'channel':{'type':Sequelize[_0x68ef('0x2')]},'channelstate':{'type':Sequelize[_0x68ef('0x3')]},'channelstatedesc':{'type':Sequelize[_0x68ef('0x2')]},'calleridnum':{'type':Sequelize[_0x68ef('0x2')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x68ef('0x2')]},'connectedlinename':{'type':Sequelize[_0x68ef('0x2')]},'language':{'type':Sequelize[_0x68ef('0x2')]},'accountcode':{'type':Sequelize[_0x68ef('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x68ef('0x3')]},'uniqueid':{'type':Sequelize[_0x68ef('0x2')]},'linkedid':{'type':Sequelize[_0x68ef('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x68ef('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x68ef('0x2')]},'destcalleridnum':{'type':Sequelize[_0x68ef('0x2')]},'destcalleridname':{'type':Sequelize[_0x68ef('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x68ef('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x68ef('0x2')]},'destlanguage':{'type':Sequelize[_0x68ef('0x2')]},'destaccountcode':{'type':Sequelize[_0x68ef('0x2')]},'destcontext':{'type':Sequelize[_0x68ef('0x2')]},'destexten':{'type':Sequelize[_0x68ef('0x2')]},'destpriority':{'type':Sequelize[_0x68ef('0x3')]},'destuniqueid':{'type':Sequelize[_0x68ef('0x2')]},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize[_0x68ef('0x2')]},'dialstatus':{'type':Sequelize[_0x68ef('0x2')]},'starttime':{'type':Sequelize[_0x68ef('0x4')]},'answertime':{'type':Sequelize[_0x68ef('0x4')]},'endtime':{'type':Sequelize[_0x68ef('0x4')]},'lastevent':{'type':Sequelize[_0x68ef('0x2')],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0x68ef('0x3')]},'duration':{'type':Sequelize[_0x68ef('0x3')]},'holdtime':{'type':Sequelize[_0x68ef('0x3')]},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x8d0e=['INTEGER','DATE','called,connect,complete','sequelize','exports','STRING'];(function(_0x21205e,_0x7eb8e7){var _0x136ebb=function(_0x54aac2){while(--_0x54aac2){_0x21205e['push'](_0x21205e['shift']());}};_0x136ebb(++_0x7eb8e7);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x77d6a7,_0x5da0d5){_0x77d6a7=_0x77d6a7-0x0;var _0x1d4b2b=_0x8d0e[_0x77d6a7];return _0x1d4b2b;};'use strict';var Sequelize=require(_0xe8d0('0x0'));module[_0xe8d0('0x1')]={'privilege':{'type':Sequelize[_0xe8d0('0x2')]},'channel':{'type':Sequelize[_0xe8d0('0x2')]},'channelstate':{'type':Sequelize[_0xe8d0('0x3')]},'channelstatedesc':{'type':Sequelize[_0xe8d0('0x2')]},'calleridnum':{'type':Sequelize[_0xe8d0('0x2')]},'calleridname':{'type':Sequelize[_0xe8d0('0x2')]},'connectedlinenum':{'type':Sequelize[_0xe8d0('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xe8d0('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xe8d0('0x2')]},'priority':{'type':Sequelize[_0xe8d0('0x3')]},'uniqueid':{'type':Sequelize[_0xe8d0('0x2')]},'linkedid':{'type':Sequelize[_0xe8d0('0x2')]},'destchannel':{'type':Sequelize[_0xe8d0('0x2')]},'destchannelstate':{'type':Sequelize[_0xe8d0('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xe8d0('0x2')]},'destcalleridnum':{'type':Sequelize[_0xe8d0('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xe8d0('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xe8d0('0x2')]},'destlanguage':{'type':Sequelize[_0xe8d0('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xe8d0('0x2')]},'destpriority':{'type':Sequelize[_0xe8d0('0x3')]},'destuniqueid':{'type':Sequelize[_0xe8d0('0x2')]},'destlinkedid':{'type':Sequelize[_0xe8d0('0x2')]},'dialstring':{'type':Sequelize[_0xe8d0('0x2')]},'dialstatus':{'type':Sequelize[_0xe8d0('0x2')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xe8d0('0x4')]},'endtime':{'type':Sequelize[_0xe8d0('0x4')]},'lastevent':{'type':Sequelize['STRING'],'comment':_0xe8d0('0x5')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0xe8d0('0x3')]},'billableseconds':{'type':Sequelize[_0xe8d0('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 4c8570b..34c2e58 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 _0x16a0=['keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','include','VoiceDialReport','rows','catch','show','options','find','create','body','update','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','undefined','count','offset','Content-Range','json','reject','save','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query'];(function(_0x487177,_0x1ddcd6){var _0x147202=function(_0xa5105){while(--_0xa5105){_0x487177['push'](_0x487177['shift']());}};_0x147202(++_0x1ddcd6);}(_0x16a0,0x185));var _0x016a=function(_0xfa1fc8,_0x50be63){_0xfa1fc8=_0xfa1fc8-0x0;var _0x263e72=_0x16a0[_0xfa1fc8];return _0x263e72;};'use strict';var emlformat=require(_0x016a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x016a('0x1'));var jsonpatch=require(_0x016a('0x2'));var rp=require(_0x016a('0x3'));var moment=require(_0x016a('0x4'));var BPromise=require(_0x016a('0x5'));var Mustache=require(_0x016a('0x6'));var util=require('util');var path=require(_0x016a('0x7'));var sox=require('sox');var csv=require(_0x016a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x016a('0x9'));var _=require(_0x016a('0xa'));var squel=require(_0x016a('0xb'));var crypto=require('crypto');var jsforce=require(_0x016a('0xc'));var deskjs=require(_0x016a('0xd'));var toCsv=require(_0x016a('0x8'));var querystring=require(_0x016a('0xe'));var Papa=require(_0x016a('0xf'));var Redis=require(_0x016a('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x016a('0x11'));var as=require(_0x016a('0x12'));var hardwareService=require(_0x016a('0x13'));var logger=require('../../config/logger')(_0x016a('0x14'));var utils=require(_0x016a('0x15'));var config=require(_0x016a('0x16'));var licenseUtil=require(_0x016a('0x17'));var db=require(_0x016a('0x18'))['db'];function respondWithStatusCode(_0x18cf45,_0x53b827){_0x53b827=_0x53b827||0xcc;return function(_0x17752e){if(_0x17752e){return _0x18cf45[_0x016a('0x19')](_0x53b827);}return _0x18cf45[_0x016a('0x1a')](_0x53b827)[_0x016a('0x1b')]();};}function respondWithResult(_0x369cb5,_0x13a529){_0x13a529=_0x13a529||0xc8;return function(_0x3e4478){if(_0x3e4478){return _0x369cb5[_0x016a('0x1a')](_0x13a529)['json'](_0x3e4478);}};}function respondWithFilteredResult(_0x2dc7d4,_0xb7968d){return function(_0x2eda79){if(_0x2eda79){var _0x2f867a=typeof _0xb7968d['offset']==='undefined'&&typeof _0xb7968d[_0x016a('0x1c')]===_0x016a('0x1d');var _0x44644c=_0x2eda79[_0x016a('0x1e')];var _0x31ae84=_0x2f867a?0x0:_0xb7968d[_0x016a('0x1f')];var _0x349fb5=_0x2f867a?_0x2eda79[_0x016a('0x1e')]:_0xb7968d[_0x016a('0x1f')]+_0xb7968d[_0x016a('0x1c')];var _0x224e1c;if(_0x349fb5>=_0x44644c){_0x349fb5=_0x44644c;_0x224e1c=0xc8;}else{_0x224e1c=0xce;}_0x2dc7d4[_0x016a('0x1a')](_0x224e1c);return _0x2dc7d4['set'](_0x016a('0x20'),_0x31ae84+'-'+_0x349fb5+'/'+_0x44644c)[_0x016a('0x21')](_0x2eda79);}return null;};}function patchUpdates(_0x51b19d){return function(_0x56a4a1){try{jsonpatch['apply'](_0x56a4a1,_0x51b19d,!![]);}catch(_0x10274d){return BPromise[_0x016a('0x22')](_0x10274d);}return _0x56a4a1[_0x016a('0x23')]();};}function saveUpdates(_0x15f872,_0x7463e){return function(_0x4cbed4){if(_0x4cbed4){return _0x4cbed4['update'](_0x15f872)[_0x016a('0x24')](function(_0x9aeca6){return _0x9aeca6;});}return null;};}function removeEntity(_0x183192,_0x2a0ba2){return function(_0x2a40e1){if(_0x2a40e1){return _0x2a40e1[_0x016a('0x25')]()['then'](function(){_0x183192['status'](0xcc)[_0x016a('0x1b')]();});}};}function handleEntityNotFound(_0x5b58ff,_0x37e46e){return function(_0x3bbe34){if(!_0x3bbe34){_0x5b58ff['sendStatus'](0x194);}return _0x3bbe34;};}function handleError(_0x2825e9,_0x5eb863){_0x5eb863=_0x5eb863||0x1f4;return function(_0x2e408c){logger[_0x016a('0x26')](_0x2e408c[_0x016a('0x27')]);if(_0x2e408c['name']){delete _0x2e408c[_0x016a('0x28')];}_0x2825e9[_0x016a('0x1a')](_0x5eb863)[_0x016a('0x29')](_0x2e408c);};}exports['index']=function(_0x3bc561,_0x5c200c){var _0x2be924={},_0x3643a5={},_0xedfe65={'count':0x0,'rows':[]};var _0x55b2ae=_[_0x016a('0x2a')](db['VoiceDialReport'][_0x016a('0x2b')],function(_0x39cbe0){return{'name':_0x39cbe0[_0x016a('0x2c')],'type':_0x39cbe0[_0x016a('0x2d')][_0x016a('0x2e')]};});_0x3643a5[_0x016a('0x2f')]=_[_0x016a('0x2a')](_0x55b2ae,_0x016a('0x28'));_0x3643a5[_0x016a('0x30')]=_[_0x016a('0x31')](_0x3bc561['query']);_0x3643a5[_0x016a('0x32')]=_[_0x016a('0x33')](_0x3643a5[_0x016a('0x2f')],_0x3643a5['query']);_0x2be924['attributes']=_[_0x016a('0x33')](_0x3643a5['model'],qs[_0x016a('0x34')](_0x3bc561[_0x016a('0x30')][_0x016a('0x34')]));_0x2be924[_0x016a('0x35')]=_0x2be924[_0x016a('0x35')][_0x016a('0x36')]?_0x2be924['attributes']:_0x3643a5[_0x016a('0x2f')];if(!_0x3bc561[_0x016a('0x30')][_0x016a('0x37')]('nolimit')){_0x2be924[_0x016a('0x1c')]=qs[_0x016a('0x1c')](_0x3bc561[_0x016a('0x30')][_0x016a('0x1c')]);_0x2be924['offset']=qs['offset'](_0x3bc561['query'][_0x016a('0x1f')]);}_0x2be924[_0x016a('0x38')]=qs[_0x016a('0x39')](_0x3bc561[_0x016a('0x30')][_0x016a('0x39')]);_0x2be924[_0x016a('0x3a')]=qs['filters'](_[_0x016a('0x3b')](_0x3bc561[_0x016a('0x30')],_0x3643a5[_0x016a('0x32')]),_0x55b2ae);if(_0x3bc561['query']['filter']){_0x2be924[_0x016a('0x3a')]=_[_0x016a('0x3c')](_0x2be924[_0x016a('0x3a')],{'$or':_[_0x016a('0x2a')](_0x55b2ae,function(_0x47c777){if(_0x47c777[_0x016a('0x2d')]!==_0x016a('0x3d')){var _0x544c61={};_0x544c61[_0x47c777[_0x016a('0x28')]]={'$like':'%'+_0x3bc561[_0x016a('0x30')]['filter']+'%'};return _0x544c61;}})});}_0x2be924=_[_0x016a('0x3c')]({},_0x2be924,_0x3bc561['options']);var _0x512e9c={'where':_0x2be924[_0x016a('0x3a')]};return db['VoiceDialReport']['count'](_0x512e9c)['then'](function(_0x1b0fbf){_0xedfe65[_0x016a('0x1e')]=_0x1b0fbf;if(_0x3bc561[_0x016a('0x30')]['includeAll']){_0x2be924[_0x016a('0x3e')]=[{'all':!![]}];}return db[_0x016a('0x3f')]['findAll'](_0x2be924);})[_0x016a('0x24')](function(_0xb729fc){_0xedfe65[_0x016a('0x40')]=_0xb729fc;return _0xedfe65;})['then'](respondWithFilteredResult(_0x5c200c,_0x2be924))[_0x016a('0x41')](handleError(_0x5c200c,null));};exports[_0x016a('0x42')]=function(_0x859210,_0x33f3db){var _0x5cf4bf={'raw':!![],'where':{'id':_0x859210['params']['id']}},_0x1b6db5={};_0x1b6db5[_0x016a('0x2f')]=_[_0x016a('0x31')](db[_0x016a('0x3f')][_0x016a('0x2b')]);_0x1b6db5[_0x016a('0x30')]=_[_0x016a('0x31')](_0x859210[_0x016a('0x30')]);_0x1b6db5['filters']=_[_0x016a('0x33')](_0x1b6db5[_0x016a('0x2f')],_0x1b6db5[_0x016a('0x30')]);_0x5cf4bf['attributes']=_[_0x016a('0x33')](_0x1b6db5[_0x016a('0x2f')],qs['fields'](_0x859210['query']['fields']));_0x5cf4bf['attributes']=_0x5cf4bf[_0x016a('0x35')][_0x016a('0x36')]?_0x5cf4bf[_0x016a('0x35')]:_0x1b6db5[_0x016a('0x2f')];if(_0x859210[_0x016a('0x30')]['includeAll']){_0x5cf4bf[_0x016a('0x3e')]=[{'all':!![]}];}_0x5cf4bf=_[_0x016a('0x3c')]({},_0x5cf4bf,_0x859210[_0x016a('0x43')]);return db[_0x016a('0x3f')][_0x016a('0x44')](_0x5cf4bf)[_0x016a('0x24')](handleEntityNotFound(_0x33f3db,null))[_0x016a('0x24')](respondWithResult(_0x33f3db,null))[_0x016a('0x41')](handleError(_0x33f3db,null));};exports[_0x016a('0x45')]=function(_0x51d81b,_0x30da5e){return db[_0x016a('0x3f')]['create'](_0x51d81b[_0x016a('0x46')],{})['then'](respondWithResult(_0x30da5e,0xc9))[_0x016a('0x41')](handleError(_0x30da5e,null));};exports[_0x016a('0x47')]=function(_0x533efb,_0x3b01d8){if(_0x533efb[_0x016a('0x46')]['id']){delete _0x533efb['body']['id'];}return db['VoiceDialReport'][_0x016a('0x44')]({'where':{'id':_0x533efb[_0x016a('0x48')]['id']}})[_0x016a('0x24')](handleEntityNotFound(_0x3b01d8,null))['then'](saveUpdates(_0x533efb['body'],null))['then'](respondWithResult(_0x3b01d8,null))[_0x016a('0x41')](handleError(_0x3b01d8,null));};exports[_0x016a('0x25')]=function(_0x3fc1ac,_0x25b3bc){return db[_0x016a('0x3f')][_0x016a('0x44')]({'where':{'id':_0x3fc1ac[_0x016a('0x48')]['id']}})['then'](handleEntityNotFound(_0x25b3bc,null))[_0x016a('0x24')](removeEntity(_0x25b3bc,null))[_0x016a('0x41')](handleError(_0x25b3bc,null));};exports['describe']=function(_0x503c83,_0x11da53){return db[_0x016a('0x3f')]['describe']()[_0x016a('0x24')](respondWithResult(_0x11da53,null))[_0x016a('0x41')](handleError(_0x11da53,null));}; \ No newline at end of file +var _0xabae=['zip-dir','fast-json-patch','moment','bluebird','mustache','util','ejs','fs-extra','squel','crypto','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','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','fields','attributes','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','VoiceDialReport','includeAll','include','findAll','rows','show','params','intersection','length','find','catch','create','body','describe','eml-format','rimraf'];(function(_0x3ac8ed,_0x168aeb){var _0x5e7345=function(_0x515294){while(--_0x515294){_0x3ac8ed['push'](_0x3ac8ed['shift']());}};_0x5e7345(++_0x168aeb);}(_0xabae,0x1d2));var _0xeaba=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xabae[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xeaba('0x0'));var rimraf=require(_0xeaba('0x1'));var zipdir=require(_0xeaba('0x2'));var jsonpatch=require(_0xeaba('0x3'));var rp=require('request-promise');var moment=require(_0xeaba('0x4'));var BPromise=require(_0xeaba('0x5'));var Mustache=require(_0xeaba('0x6'));var util=require(_0xeaba('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xeaba('0x8'));var fs=require('fs');var fs_extra=require(_0xeaba('0x9'));var _=require('lodash');var squel=require(_0xeaba('0xa'));var crypto=require(_0xeaba('0xb'));var jsforce=require(_0xeaba('0xc'));var deskjs=require(_0xeaba('0xd'));var toCsv=require(_0xeaba('0xe'));var querystring=require('querystring');var Papa=require(_0xeaba('0xf'));var Redis=require(_0xeaba('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xeaba('0x11'));var as=require(_0xeaba('0x12'));var hardwareService=require(_0xeaba('0x13'));var logger=require(_0xeaba('0x14'))(_0xeaba('0x15'));var utils=require(_0xeaba('0x16'));var config=require(_0xeaba('0x17'));var licenseUtil=require(_0xeaba('0x18'));var db=require(_0xeaba('0x19'))['db'];function respondWithStatusCode(_0x4cdf0e,_0xe41361){_0xe41361=_0xe41361||0xcc;return function(_0x14b08b){if(_0x14b08b){return _0x4cdf0e[_0xeaba('0x1a')](_0xe41361);}return _0x4cdf0e['status'](_0xe41361)[_0xeaba('0x1b')]();};}function respondWithResult(_0xf5a21f,_0x5e0d9a){_0x5e0d9a=_0x5e0d9a||0xc8;return function(_0x154e70){if(_0x154e70){return _0xf5a21f[_0xeaba('0x1c')](_0x5e0d9a)[_0xeaba('0x1d')](_0x154e70);}};}function respondWithFilteredResult(_0x3b08f5,_0x18d40a){return function(_0x20b45f){if(_0x20b45f){var _0x546079=typeof _0x18d40a[_0xeaba('0x1e')]===_0xeaba('0x1f')&&typeof _0x18d40a[_0xeaba('0x20')]===_0xeaba('0x1f');var _0x170ecb=_0x20b45f[_0xeaba('0x21')];var _0x20832a=_0x546079?0x0:_0x18d40a[_0xeaba('0x1e')];var _0x4785e6=_0x546079?_0x20b45f[_0xeaba('0x21')]:_0x18d40a[_0xeaba('0x1e')]+_0x18d40a[_0xeaba('0x20')];var _0x5657cc;if(_0x4785e6>=_0x170ecb){_0x4785e6=_0x170ecb;_0x5657cc=0xc8;}else{_0x5657cc=0xce;}_0x3b08f5[_0xeaba('0x1c')](_0x5657cc);return _0x3b08f5['set'](_0xeaba('0x22'),_0x20832a+'-'+_0x4785e6+'/'+_0x170ecb)['json'](_0x20b45f);}return null;};}function patchUpdates(_0x28d221){return function(_0x56be9e){try{jsonpatch[_0xeaba('0x23')](_0x56be9e,_0x28d221,!![]);}catch(_0x4b4221){return BPromise[_0xeaba('0x24')](_0x4b4221);}return _0x56be9e[_0xeaba('0x25')]();};}function saveUpdates(_0x4588d9,_0x13e56c){return function(_0xd63d97){if(_0xd63d97){return _0xd63d97[_0xeaba('0x26')](_0x4588d9)[_0xeaba('0x27')](function(_0x5a9309){return _0x5a9309;});}return null;};}function removeEntity(_0x3f5881,_0x84366){return function(_0x4b5a73){if(_0x4b5a73){return _0x4b5a73[_0xeaba('0x28')]()['then'](function(){_0x3f5881['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3cb0f2,_0xaf6779){return function(_0x1aefc0){if(!_0x1aefc0){_0x3cb0f2[_0xeaba('0x1a')](0x194);}return _0x1aefc0;};}function handleError(_0x2d8246,_0x2fc4c7){_0x2fc4c7=_0x2fc4c7||0x1f4;return function(_0x2883aa){logger[_0xeaba('0x29')](_0x2883aa['stack']);if(_0x2883aa[_0xeaba('0x2a')]){delete _0x2883aa[_0xeaba('0x2a')];}_0x2d8246[_0xeaba('0x1c')](_0x2fc4c7)[_0xeaba('0x2b')](_0x2883aa);};}exports['index']=function(_0x3c65f6,_0x3ee195){var _0x2efef1={},_0x9b0fa6={},_0x4d3ad1={'count':0x0,'rows':[]};var _0x561d5e=_[_0xeaba('0x2c')](db['VoiceDialReport'][_0xeaba('0x2d')],function(_0x163c33){return{'name':_0x163c33[_0xeaba('0x2e')],'type':_0x163c33[_0xeaba('0x2f')][_0xeaba('0x30')]};});_0x9b0fa6[_0xeaba('0x31')]=_[_0xeaba('0x2c')](_0x561d5e,_0xeaba('0x2a'));_0x9b0fa6[_0xeaba('0x32')]=_[_0xeaba('0x33')](_0x3c65f6[_0xeaba('0x32')]);_0x9b0fa6[_0xeaba('0x34')]=_['intersection'](_0x9b0fa6[_0xeaba('0x31')],_0x9b0fa6[_0xeaba('0x32')]);_0x2efef1['attributes']=_['intersection'](_0x9b0fa6[_0xeaba('0x31')],qs[_0xeaba('0x35')](_0x3c65f6[_0xeaba('0x32')]['fields']));_0x2efef1[_0xeaba('0x36')]=_0x2efef1[_0xeaba('0x36')]['length']?_0x2efef1[_0xeaba('0x36')]:_0x9b0fa6[_0xeaba('0x31')];if(!_0x3c65f6[_0xeaba('0x32')][_0xeaba('0x37')](_0xeaba('0x38'))){_0x2efef1[_0xeaba('0x20')]=qs['limit'](_0x3c65f6[_0xeaba('0x32')][_0xeaba('0x20')]);_0x2efef1[_0xeaba('0x1e')]=qs['offset'](_0x3c65f6[_0xeaba('0x32')][_0xeaba('0x1e')]);}_0x2efef1[_0xeaba('0x39')]=qs[_0xeaba('0x3a')](_0x3c65f6['query'][_0xeaba('0x3a')]);_0x2efef1['where']=qs[_0xeaba('0x34')](_['pick'](_0x3c65f6[_0xeaba('0x32')],_0x9b0fa6[_0xeaba('0x34')]),_0x561d5e);if(_0x3c65f6[_0xeaba('0x32')][_0xeaba('0x3b')]){_0x2efef1[_0xeaba('0x3c')]=_[_0xeaba('0x3d')](_0x2efef1[_0xeaba('0x3c')],{'$or':_[_0xeaba('0x2c')](_0x561d5e,function(_0xde1fa8){if(_0xde1fa8['type']!==_0xeaba('0x3e')){var _0x381d86={};_0x381d86[_0xde1fa8[_0xeaba('0x2a')]]={'$like':'%'+_0x3c65f6[_0xeaba('0x32')]['filter']+'%'};return _0x381d86;}})});}_0x2efef1=_[_0xeaba('0x3d')]({},_0x2efef1,_0x3c65f6[_0xeaba('0x3f')]);var _0x2e630f={'where':_0x2efef1[_0xeaba('0x3c')]};return db[_0xeaba('0x40')][_0xeaba('0x21')](_0x2e630f)[_0xeaba('0x27')](function(_0x4ae18a){_0x4d3ad1[_0xeaba('0x21')]=_0x4ae18a;if(_0x3c65f6[_0xeaba('0x32')][_0xeaba('0x41')]){_0x2efef1[_0xeaba('0x42')]=[{'all':!![]}];}return db['VoiceDialReport'][_0xeaba('0x43')](_0x2efef1);})[_0xeaba('0x27')](function(_0x4e0786){_0x4d3ad1[_0xeaba('0x44')]=_0x4e0786;return _0x4d3ad1;})[_0xeaba('0x27')](respondWithFilteredResult(_0x3ee195,_0x2efef1))['catch'](handleError(_0x3ee195,null));};exports[_0xeaba('0x45')]=function(_0x2c36ca,_0x35502c){var _0x53957f={'raw':!![],'where':{'id':_0x2c36ca[_0xeaba('0x46')]['id']}},_0x1ddabb={};_0x1ddabb[_0xeaba('0x31')]=_[_0xeaba('0x33')](db[_0xeaba('0x40')][_0xeaba('0x2d')]);_0x1ddabb[_0xeaba('0x32')]=_[_0xeaba('0x33')](_0x2c36ca[_0xeaba('0x32')]);_0x1ddabb[_0xeaba('0x34')]=_[_0xeaba('0x47')](_0x1ddabb[_0xeaba('0x31')],_0x1ddabb[_0xeaba('0x32')]);_0x53957f['attributes']=_['intersection'](_0x1ddabb[_0xeaba('0x31')],qs[_0xeaba('0x35')](_0x2c36ca[_0xeaba('0x32')]['fields']));_0x53957f[_0xeaba('0x36')]=_0x53957f[_0xeaba('0x36')][_0xeaba('0x48')]?_0x53957f[_0xeaba('0x36')]:_0x1ddabb['model'];if(_0x2c36ca[_0xeaba('0x32')][_0xeaba('0x41')]){_0x53957f[_0xeaba('0x42')]=[{'all':!![]}];}_0x53957f=_[_0xeaba('0x3d')]({},_0x53957f,_0x2c36ca[_0xeaba('0x3f')]);return db[_0xeaba('0x40')][_0xeaba('0x49')](_0x53957f)[_0xeaba('0x27')](handleEntityNotFound(_0x35502c,null))['then'](respondWithResult(_0x35502c,null))[_0xeaba('0x4a')](handleError(_0x35502c,null));};exports[_0xeaba('0x4b')]=function(_0x2c17ea,_0x110a14){return db[_0xeaba('0x40')][_0xeaba('0x4b')](_0x2c17ea[_0xeaba('0x4c')],{})[_0xeaba('0x27')](respondWithResult(_0x110a14,0xc9))[_0xeaba('0x4a')](handleError(_0x110a14,null));};exports[_0xeaba('0x26')]=function(_0x158054,_0x4fadc0){if(_0x158054[_0xeaba('0x4c')]['id']){delete _0x158054['body']['id'];}return db[_0xeaba('0x40')][_0xeaba('0x49')]({'where':{'id':_0x158054[_0xeaba('0x46')]['id']}})['then'](handleEntityNotFound(_0x4fadc0,null))[_0xeaba('0x27')](saveUpdates(_0x158054[_0xeaba('0x4c')],null))[_0xeaba('0x27')](respondWithResult(_0x4fadc0,null))['catch'](handleError(_0x4fadc0,null));};exports[_0xeaba('0x28')]=function(_0x30115e,_0x109573){return db[_0xeaba('0x40')]['find']({'where':{'id':_0x30115e[_0xeaba('0x46')]['id']}})[_0xeaba('0x27')](handleEntityNotFound(_0x109573,null))[_0xeaba('0x27')](removeEntity(_0x109573,null))[_0xeaba('0x4a')](handleError(_0x109573,null));};exports['describe']=function(_0x119b2f,_0x380974){return db[_0xeaba('0x40')][_0xeaba('0x4d')]()[_0xeaba('0x27')](respondWithResult(_0x380974,null))[_0xeaba('0x4a')](handleError(_0x380974,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 4890e17..0c8cf54 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 _0x7da7=['../../config/environment','exports','define','report_dial','uniqueid','lodash','util','../../config/logger','bluebird','request-promise','rimraf'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x7da7,0x10d));var _0x77da=function(_0x556927,_0x34b53f){_0x556927=_0x556927-0x0;var _0x5f1235=_0x7da7[_0x556927];return _0x5f1235;};'use strict';var _=require(_0x77da('0x0'));var util=require(_0x77da('0x1'));var logger=require(_0x77da('0x2'))('api');var moment=require('moment');var BPromise=require(_0x77da('0x3'));var rp=require(_0x77da('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x77da('0x5'));var config=require(_0x77da('0x6'));var attributes=require('./voiceDialReport.attributes');module[_0x77da('0x7')]=function(_0xc54a12,_0x47da81){return _0xc54a12[_0x77da('0x8')]('VoiceDialReport',attributes,{'tableName':_0x77da('0x9'),'paranoid':![],'indexes':[{'fields':[_0x77da('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9f84=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceDialReport.attributes','exports','define','VoiceDialReport','uniqueid'];(function(_0x16c92e,_0x32a146){var _0x5a881a=function(_0x12fe4d){while(--_0x12fe4d){_0x16c92e['push'](_0x16c92e['shift']());}};_0x5a881a(++_0x32a146);}(_0x9f84,0x10a));var _0x49f8=function(_0x563512,_0x2f0c90){_0x563512=_0x563512-0x0;var _0xf9375c=_0x9f84[_0x563512];return _0xf9375c;};'use strict';var _=require('lodash');var util=require(_0x49f8('0x0'));var logger=require(_0x49f8('0x1'))(_0x49f8('0x2'));var moment=require(_0x49f8('0x3'));var BPromise=require(_0x49f8('0x4'));var rp=require(_0x49f8('0x5'));var fs=require('fs');var path=require(_0x49f8('0x6'));var rimraf=require(_0x49f8('0x7'));var config=require(_0x49f8('0x8'));var attributes=require(_0x49f8('0x9'));module[_0x49f8('0xa')]=function(_0x313d3f,_0x414c1e){return _0x313d3f[_0x49f8('0xb')](_0x49f8('0xc'),attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':[_0x49f8('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 90c6447..e3163c5 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 _0xe70a=['result','catch','CreateVoiceDialReport','create','body','options','raw','stringify','UpdateVoiceDialReport','update','where','attributes','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','request\x20sent','debug','error','code','VoiceDialReport,\x20%s,\x20%s','message'];(function(_0x4f60f2,_0x1d82dd){var _0x3d6a54=function(_0x5dc05c){while(--_0x5dc05c){_0x4f60f2['push'](_0x4f60f2['shift']());}};_0x3d6a54(++_0x1d82dd);}(_0xe70a,0x1ec));var _0xae70=function(_0x5ce411,_0x49a3ba){_0x5ce411=_0x5ce411-0x0;var _0x346a6d=_0xe70a[_0x5ce411];return _0x346a6d;};'use strict';var _=require(_0xae70('0x0'));var util=require(_0xae70('0x1'));var moment=require('moment');var BPromise=require(_0xae70('0x2'));var rs=require(_0xae70('0x3'));var fs=require('fs');var Redis=require(_0xae70('0x4'));var db=require(_0xae70('0x5'))['db'];var utils=require(_0xae70('0x6'));var logger=require(_0xae70('0x7'))(_0xae70('0x8'));var config=require(_0xae70('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xae70('0xa')][_0xae70('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x371aad,_0x1545c6,_0x5095cf){return new BPromise(function(_0x1a7b1c,_0x211952){return client['request'](_0x371aad,_0x5095cf)[_0xae70('0xc')](function(_0x23c66f){logger[_0xae70('0xd')]('VoiceDialReport,\x20%s,\x20%s',_0x1545c6,_0xae70('0xe'));logger[_0xae70('0xf')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x1545c6,_0xae70('0xe'),JSON['stringify'](_0x23c66f));if(_0x23c66f[_0xae70('0x10')]){if(_0x23c66f[_0xae70('0x10')][_0xae70('0x11')]===0x1f4){logger[_0xae70('0x10')](_0xae70('0x12'),_0x1545c6,_0x23c66f[_0xae70('0x10')][_0xae70('0x13')]);return _0x211952(_0x23c66f[_0xae70('0x10')][_0xae70('0x13')]);}logger[_0xae70('0x10')](_0xae70('0x12'),_0x1545c6,_0x23c66f[_0xae70('0x10')][_0xae70('0x13')]);return _0x1a7b1c(_0x23c66f[_0xae70('0x10')]['message']);}else{logger[_0xae70('0xd')](_0xae70('0x12'),_0x1545c6,_0xae70('0xe'));_0x1a7b1c(_0x23c66f[_0xae70('0x14')][_0xae70('0x13')]);}})[_0xae70('0x15')](function(_0x46031c){logger[_0xae70('0x10')](_0xae70('0x12'),_0x1545c6,_0x46031c);_0x211952(_0x46031c);});});}exports[_0xae70('0x16')]=function(_0x51a902){var _0x3e7f9a=this;return new Promise(function(_0x381632,_0x9a4c2c){return db['VoiceDialReport'][_0xae70('0x17')](_0x51a902[_0xae70('0x18')],{'raw':_0x51a902[_0xae70('0x19')]?_0x51a902[_0xae70('0x19')][_0xae70('0x1a')]===undefined?!![]:![]:!![]})[_0xae70('0xc')](function(_0x4c9d18){logger[_0xae70('0xd')](_0xae70('0x16'),_0x51a902);logger['debug'](_0xae70('0x16'),_0x51a902,JSON[_0xae70('0x1b')](_0x4c9d18));_0x381632(_0x4c9d18);})[_0xae70('0x15')](function(_0x2351be){logger[_0xae70('0x10')](_0xae70('0x16'),_0x2351be['message'],_0x51a902);_0x9a4c2c(_0x3e7f9a['error'](0x1f4,_0x2351be[_0xae70('0x13')]));});});};exports[_0xae70('0x1c')]=function(_0x140953){var _0xc56fe6=this;return new Promise(function(_0x3b5d27,_0x34be9c){return db['VoiceDialReport'][_0xae70('0x1d')](_0x140953['body'],{'raw':_0x140953[_0xae70('0x19')]?_0x140953[_0xae70('0x19')][_0xae70('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x140953['options']?_0x140953[_0xae70('0x19')][_0xae70('0x1e')]||null:null,'attributes':_0x140953['options']?_0x140953[_0xae70('0x19')][_0xae70('0x1f')]||null:null,'limit':_0x140953['options']?_0x140953[_0xae70('0x19')]['limit']||null:null})[_0xae70('0xc')](function(_0x422a28){logger[_0xae70('0xd')](_0xae70('0x1c'),_0x140953);logger[_0xae70('0xf')](_0xae70('0x1c'),_0x140953,JSON[_0xae70('0x1b')](_0x422a28));_0x3b5d27(_0x422a28);})[_0xae70('0x15')](function(_0x865f15){logger[_0xae70('0x10')](_0xae70('0x1c'),_0x865f15[_0xae70('0x13')],_0x140953);_0x34be9c(_0xc56fe6[_0xae70('0x10')](0x1f4,_0x865f15[_0xae70('0x13')]));});});}; \ No newline at end of file +var _0x0289=['util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','VoiceDialReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','CreateVoiceDialReport','VoiceDialReport','create','body','options','raw','info','attributes','UpdateVoiceDialReport','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0289,0x1df));var _0x9028=function(_0x1f6ba3,_0x5b7a1d){_0x1f6ba3=_0x1f6ba3-0x0;var _0x218b24=_0x0289[_0x1f6ba3];return _0x218b24;};'use strict';var _=require(_0x9028('0x0'));var util=require(_0x9028('0x1'));var moment=require('moment');var BPromise=require(_0x9028('0x2'));var rs=require(_0x9028('0x3'));var fs=require('fs');var Redis=require(_0x9028('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9028('0x5'));var logger=require(_0x9028('0x6'))(_0x9028('0x7'));var config=require(_0x9028('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9028('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x501692,_0x523ed5,_0x34c473){return new BPromise(function(_0x5c5d51,_0x58a6a1){return client[_0x9028('0xa')](_0x501692,_0x34c473)[_0x9028('0xb')](function(_0x3ffaf8){logger['info'](_0x9028('0xc'),_0x523ed5,'request\x20sent');logger[_0x9028('0xd')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x523ed5,_0x9028('0xe'),JSON[_0x9028('0xf')](_0x3ffaf8));if(_0x3ffaf8['error']){if(_0x3ffaf8[_0x9028('0x10')][_0x9028('0x11')]===0x1f4){logger['error'](_0x9028('0xc'),_0x523ed5,_0x3ffaf8[_0x9028('0x10')][_0x9028('0x12')]);return _0x58a6a1(_0x3ffaf8[_0x9028('0x10')][_0x9028('0x12')]);}logger[_0x9028('0x10')](_0x9028('0xc'),_0x523ed5,_0x3ffaf8[_0x9028('0x10')][_0x9028('0x12')]);return _0x5c5d51(_0x3ffaf8[_0x9028('0x10')][_0x9028('0x12')]);}else{logger['info'](_0x9028('0xc'),_0x523ed5,_0x9028('0xe'));_0x5c5d51(_0x3ffaf8[_0x9028('0x13')][_0x9028('0x12')]);}})[_0x9028('0x14')](function(_0x5dcff2){logger[_0x9028('0x10')]('VoiceDialReport,\x20%s,\x20%s',_0x523ed5,_0x5dcff2);_0x58a6a1(_0x5dcff2);});});}exports[_0x9028('0x15')]=function(_0x5ea1a6){var _0xfd2014=this;return new Promise(function(_0x59d503,_0x559f51){return db[_0x9028('0x16')][_0x9028('0x17')](_0x5ea1a6[_0x9028('0x18')],{'raw':_0x5ea1a6[_0x9028('0x19')]?_0x5ea1a6['options'][_0x9028('0x1a')]===undefined?!![]:![]:!![]})[_0x9028('0xb')](function(_0x203ce4){logger[_0x9028('0x1b')](_0x9028('0x15'),_0x5ea1a6);logger['debug'](_0x9028('0x15'),_0x5ea1a6,JSON[_0x9028('0xf')](_0x203ce4));_0x59d503(_0x203ce4);})[_0x9028('0x14')](function(_0x36af28){logger['error'](_0x9028('0x15'),_0x36af28['message'],_0x5ea1a6);_0x559f51(_0xfd2014[_0x9028('0x10')](0x1f4,_0x36af28[_0x9028('0x12')]));});});};exports['UpdateVoiceDialReport']=function(_0x8af220){var _0x20db93=this;return new Promise(function(_0x249dd6,_0x4cf8ee){return db['VoiceDialReport']['update'](_0x8af220[_0x9028('0x18')],{'raw':_0x8af220[_0x9028('0x19')]?_0x8af220[_0x9028('0x19')][_0x9028('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x8af220[_0x9028('0x19')]?_0x8af220['options']['where']||null:null,'attributes':_0x8af220[_0x9028('0x19')]?_0x8af220[_0x9028('0x19')][_0x9028('0x1c')]||null:null,'limit':_0x8af220['options']?_0x8af220['options']['limit']||null:null})['then'](function(_0x22f496){logger[_0x9028('0x1b')]('UpdateVoiceDialReport',_0x8af220);logger['debug'](_0x9028('0x1d'),_0x8af220,JSON[_0x9028('0xf')](_0x22f496));_0x249dd6(_0x22f496);})['catch'](function(_0x4e1aee){logger[_0x9028('0x10')]('UpdateVoiceDialReport',_0x4e1aee['message'],_0x8af220);_0x4cf8ee(_0x20db93[_0x9028('0x10')](0x1f4,_0x4e1aee['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index a819964..2b456a6 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 _0x5b49=['update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','/:id','show','post','/:id/applications','put'];(function(_0xca120e,_0x5e0966){var _0x6df0ab=function(_0x21b1e0){while(--_0x21b1e0){_0xca120e['push'](_0xca120e['shift']());}};_0x6df0ab(++_0x5e0966);}(_0x5b49,0x128));var _0x95b4=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0x5b49[_0x3899d1];return _0xeb4a7d;};'use strict';var multer=require(_0x95b4('0x0'));var util=require(_0x95b4('0x1'));var path=require(_0x95b4('0x2'));var timeout=require(_0x95b4('0x3'));var express=require(_0x95b4('0x4'));var router=express[_0x95b4('0x5')]();var fs_extra=require(_0x95b4('0x6'));var auth=require(_0x95b4('0x7'));var interaction=require(_0x95b4('0x8'));var config=require(_0x95b4('0x9'));var controller=require(_0x95b4('0xa'));router[_0x95b4('0xb')]('/',auth[_0x95b4('0xc')](),controller[_0x95b4('0xd')]);router['get'](_0x95b4('0xe'),auth[_0x95b4('0xc')](),controller[_0x95b4('0xf')]);router[_0x95b4('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x95b4('0x10')](_0x95b4('0x11'),auth['isAuthenticated'](),controller['addApplications']);router[_0x95b4('0x12')](_0x95b4('0xe'),auth[_0x95b4('0xc')](),controller[_0x95b4('0x13')]);router[_0x95b4('0x14')](_0x95b4('0xe'),auth[_0x95b4('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xb49f=['path','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','show','post','create','/:id/applications','addApplications','/:id','update','delete','destroy','exports','multer','util'];(function(_0x5c9f9c,_0x2193ed){var _0x20350a=function(_0x4b7419){while(--_0x4b7419){_0x5c9f9c['push'](_0x5c9f9c['shift']());}};_0x20350a(++_0x2193ed);}(_0xb49f,0x1b6));var _0xfb49=function(_0x220799,_0x3f05f1){_0x220799=_0x220799-0x0;var _0x350266=_0xb49f[_0x220799];return _0x350266;};'use strict';var multer=require(_0xfb49('0x0'));var util=require(_0xfb49('0x1'));var path=require(_0xfb49('0x2'));var timeout=require('connect-timeout');var express=require(_0xfb49('0x3'));var router=express[_0xfb49('0x4')]();var fs_extra=require(_0xfb49('0x5'));var auth=require(_0xfb49('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voiceExtension.controller');router[_0xfb49('0x7')]('/',auth[_0xfb49('0x8')](),controller[_0xfb49('0x9')]);router[_0xfb49('0x7')]('/:id',auth[_0xfb49('0x8')](),controller[_0xfb49('0xa')]);router[_0xfb49('0xb')]('/',auth['isAuthenticated'](),controller[_0xfb49('0xc')]);router[_0xfb49('0xb')](_0xfb49('0xd'),auth[_0xfb49('0x8')](),controller[_0xfb49('0xe')]);router['put'](_0xfb49('0xf'),auth[_0xfb49('0x8')](),controller[_0xfb49('0x10')]);router[_0xfb49('0x11')](_0xfb49('0xf'),auth[_0xfb49('0x8')](),controller[_0xfb49('0x12')]);module[_0xfb49('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index d2fee93..feaaa62 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 _0x850b=['inbound','outbound','internal','inbound-fax','outbound-fax','any','INTEGER','BOOLEAN','wav','getDataValue','exports','STRING','compositeIndex','NoOp'];(function(_0x19c1c2,_0x17c0f9){var _0x5a4395=function(_0x4a6cf2){while(--_0x4a6cf2){_0x19c1c2['push'](_0x19c1c2['shift']());}};_0x5a4395(++_0x17c0f9);}(_0x850b,0xc0));var _0xb850=function(_0x1a7b4f,_0x34e3b5){_0x1a7b4f=_0x1a7b4f-0x0;var _0x1487b9=_0x850b[_0x1a7b4f];return _0x1487b9;};'use strict';var Sequelize=require('sequelize');module[_0xb850('0x0')]={'context':{'type':Sequelize[_0xb850('0x1')],'allowNull':![],'unique':_0xb850('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xb850('0x2')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize[_0xb850('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xb850('0x1')],'allowNull':![],'defaultValue':_0xb850('0x3')},'appdata':{'type':Sequelize[_0xb850('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0xb850('0x4'),_0xb850('0x5'),_0xb850('0x6'),_0xb850('0x7'),_0xb850('0x8'),'system',_0xb850('0x9')),'allowNull':![]},'description':{'type':Sequelize[_0xb850('0x1')]},'interval':{'type':Sequelize[_0xb850('0x1')],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize[_0xb850('0xa')]},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xb850('0x1')],'defaultValue':null},'callerID':{'type':Sequelize[_0xb850('0x1')],'allowNull':!![]},'record':{'type':Sequelize[_0xb850('0xb')],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize[_0xb850('0x1')],'defaultValue':_0xb850('0xc')},'answer':{'type':Sequelize[_0xb850('0xb')],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x238ad2){return this[_0xb850('0xd')]('exten');}},'alias':{'type':Sequelize[_0xb850('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0xed8a=['BOOLEAN','VIRTUAL','getDataValue','exten','sequelize','STRING','compositeIndex','NoOp','internal','inbound-fax','outbound-fax','system','any','*,*,*,*','INTEGER'];(function(_0x3e8f4d,_0x2973ed){var _0x590a2e=function(_0x5ebea8){while(--_0x5ebea8){_0x3e8f4d['push'](_0x3e8f4d['shift']());}};_0x590a2e(++_0x2973ed);}(_0xed8a,0x112));var _0xaed8=function(_0x3c0974,_0x4041ba){_0x3c0974=_0x3c0974-0x0;var _0x45f952=_0xed8a[_0x3c0974];return _0x45f952;};'use strict';var Sequelize=require(_0xaed8('0x0'));module['exports']={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xaed8('0x1')],'allowNull':![],'unique':_0xaed8('0x2')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0xaed8('0x2')},'tag':{'type':Sequelize[_0xaed8('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xaed8('0x1')],'allowNull':![],'defaultValue':_0xaed8('0x3')},'appdata':{'type':Sequelize[_0xaed8('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM']('inbound','outbound',_0xaed8('0x4'),_0xaed8('0x5'),_0xaed8('0x6'),_0xaed8('0x7'),_0xaed8('0x8')),'allowNull':![]},'description':{'type':Sequelize[_0xaed8('0x1')]},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xaed8('0x9')},'IntervalId':{'type':Sequelize[_0xaed8('0xa')]},'isApp':{'type':Sequelize[_0xaed8('0xb')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xaed8('0x1')],'defaultValue':null},'callerID':{'type':Sequelize[_0xaed8('0x1')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize[_0xaed8('0x1')],'defaultValue':'wav'},'answer':{'type':Sequelize[_0xaed8('0xb')],'defaultValue':!![]},'name':{'type':Sequelize[_0xaed8('0xc')],'get':function(_0x3d093a){return this[_0xaed8('0xd')](_0xaed8('0xe'));}},'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 511ad7f..264c2ce 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 _0x3de3=['addApplications','sequelize','ISOLATION_LEVELS','findOne','isApp','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','finally','sendStatus','send','lodash','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','end','status','offset','undefined','limit','count','set','json','get','InboundRoutes','inbound','outbound','internal','filter','ignore','value','includes','type','find','name','destroy','then','error','stack','index','map','VoiceExtension','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','order','sort','pick','where','merge','options','includeAll','include','rows','catch','show','params','keys','create','body','startsWith','exten','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OutboundRoutes','InternalRoutes','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','update','context','description','recordingFormat','cutdigits','mandatoryDisposition','alias'];(function(_0x9920ab,_0x119b50){var _0x3d4b5c=function(_0x5f4555){while(--_0x5f4555){_0x9920ab['push'](_0x9920ab['shift']());}};_0x3d4b5c(++_0x119b50);}(_0x3de3,0xc7));var _0x33de=function(_0xd2c1bb,_0xd8cf52){_0xd2c1bb=_0xd2c1bb-0x0;var _0x44bfae=_0x3de3[_0xd2c1bb];return _0x44bfae;};'use strict';var _=require(_0x33de('0x0'));var Redis=require(_0x33de('0x1'));var qs=require(_0x33de('0x2'));var logger=require(_0x33de('0x3'))('api');var config=require(_0x33de('0x4'));var db=require(_0x33de('0x5'))['db'];config[_0x33de('0x6')]=_[_0x33de('0x7')](config[_0x33de('0x6')],{'host':_0x33de('0x8'),'port':0x18eb});var socket=require(_0x33de('0x9'))(new Redis(config['redis']));require(_0x33de('0xa'))[_0x33de('0xb')](socket);function respondWithStatusCode(_0x30aac7,_0x558f16){_0x558f16=_0x558f16||0xcc;return function(_0x6a5796){if(_0x6a5796){return _0x30aac7['sendStatus'](_0x558f16);}return _0x30aac7['status'](_0x558f16)[_0x33de('0xc')]();};}function respondWithResult(_0x1e1890,_0x5e4595){_0x5e4595=_0x5e4595||0xc8;return function(_0x45b9fc){if(_0x45b9fc){return _0x1e1890[_0x33de('0xd')](_0x5e4595)['json'](_0x45b9fc);}};}function respondWithFilteredResult(_0x5d0d11,_0x53d2ce){return function(_0x20c2ac){if(_0x20c2ac){var _0x6dedd9=typeof _0x53d2ce[_0x33de('0xe')]===_0x33de('0xf')&&typeof _0x53d2ce[_0x33de('0x10')]===_0x33de('0xf');var _0x33817c=_0x20c2ac[_0x33de('0x11')];var _0x19d028=_0x6dedd9?0x0:_0x53d2ce[_0x33de('0xe')];var _0x5cc385=_0x6dedd9?_0x20c2ac[_0x33de('0x11')]:_0x53d2ce['offset']+_0x53d2ce[_0x33de('0x10')];var _0x42d4e3;if(_0x5cc385>=_0x33817c){_0x5cc385=_0x33817c;_0x42d4e3=0xc8;}else{_0x42d4e3=0xce;}_0x5d0d11[_0x33de('0xd')](_0x42d4e3);return _0x5d0d11[_0x33de('0x12')]('Content-Range',_0x19d028+'-'+_0x5cc385+'/'+_0x33817c)[_0x33de('0x13')](_0x20c2ac);}return null;};}function removeEntity(_0x3d16de){return function(_0x317f73){if(_0x317f73){return _0x317f73['destroy']()['then'](function(){var _0x12a375=_0x317f73[_0x33de('0x14')]({'plain':!![]});var _0x37f08b=[{'name':_0x33de('0x15'),'value':_0x33de('0x16'),'ignore':![]},{'name':'OutboundRoutes','value':_0x33de('0x17'),'ignore':![]},{'name':'InternalRoutes','value':_0x33de('0x18'),'ignore':![]}];var _0x5a5a40=_(_0x37f08b)[_0x33de('0x19')](_0x33de('0x1a'))['map'](_0x33de('0x1b'))[_0x33de('0x1b')]();if(_[_0x33de('0x1c')](_0x5a5a40,_0x12a375[_0x33de('0x1d')])){return;}var _0x2c7154=_[_0x33de('0x1e')](_0x37f08b,[_0x33de('0x1b'),_0x12a375[_0x33de('0x1d')]])[_0x33de('0x1f')];return db['UserProfileResource'][_0x33de('0x20')]({'where':{'type':_0x2c7154,'resourceId':_0x12a375['id']}})[_0x33de('0x21')](function(){return _0x317f73;});})[_0x33de('0x21')](function(){_0x3d16de[_0x33de('0xd')](0xcc)[_0x33de('0xc')]();});}};}function handleEntityNotFound(_0xd06205){return function(_0x335448){if(!_0x335448){_0xd06205['sendStatus'](0x194);}return _0x335448;};}function handleError(_0x513fa7,_0x45a82f){_0x45a82f=_0x45a82f||0x1f4;return function(_0x21de12){logger[_0x33de('0x22')](_0x21de12[_0x33de('0x23')]);if(_0x21de12['name']){delete _0x21de12[_0x33de('0x1f')];}_0x513fa7[_0x33de('0xd')](_0x45a82f)['send'](_0x21de12);};}exports[_0x33de('0x24')]=function(_0x566544,_0x3adcfd){var _0xe1306f={},_0x16b49a={},_0x50e3e1={'count':0x0,'rows':[]};var _0xe647e3=_[_0x33de('0x25')](db[_0x33de('0x26')][_0x33de('0x27')],function(_0x30fe17){return{'name':_0x30fe17[_0x33de('0x28')],'type':_0x30fe17[_0x33de('0x1d')][_0x33de('0x29')]};});_0x16b49a[_0x33de('0x2a')]=_[_0x33de('0x25')](_0xe647e3,_0x33de('0x1f'));_0x16b49a[_0x33de('0x2b')]=_['keys'](_0x566544[_0x33de('0x2b')]);_0x16b49a[_0x33de('0x2c')]=_[_0x33de('0x2d')](_0x16b49a['model'],_0x16b49a[_0x33de('0x2b')]);_0xe1306f[_0x33de('0x2e')]=_[_0x33de('0x2d')](_0x16b49a[_0x33de('0x2a')],qs[_0x33de('0x2f')](_0x566544[_0x33de('0x2b')]['fields']));_0xe1306f['attributes']=_0xe1306f[_0x33de('0x2e')][_0x33de('0x30')]?_0xe1306f[_0x33de('0x2e')]:_0x16b49a[_0x33de('0x2a')];if(!_0x566544[_0x33de('0x2b')]['hasOwnProperty']('nolimit')){_0xe1306f[_0x33de('0x10')]=qs['limit'](_0x566544[_0x33de('0x2b')][_0x33de('0x10')]);_0xe1306f[_0x33de('0xe')]=qs[_0x33de('0xe')](_0x566544[_0x33de('0x2b')][_0x33de('0xe')]);}_0xe1306f[_0x33de('0x31')]=qs[_0x33de('0x32')](_0x566544[_0x33de('0x2b')][_0x33de('0x32')]);_0xe1306f['where']=qs[_0x33de('0x2c')](_[_0x33de('0x33')](_0x566544['query'],_0x16b49a[_0x33de('0x2c')]),_0xe647e3);if(_0x566544[_0x33de('0x2b')][_0x33de('0x19')]){_0xe1306f[_0x33de('0x34')]=_[_0x33de('0x35')](_0xe1306f[_0x33de('0x34')],{'$or':_[_0x33de('0x25')](_0xe647e3,function(_0x215714){if(_0x215714[_0x33de('0x1d')]!=='VIRTUAL'){var _0x2aca52={};_0x2aca52[_0x215714['name']]={'$like':'%'+_0x566544['query'][_0x33de('0x19')]+'%'};return _0x2aca52;}})});}_0xe1306f=_[_0x33de('0x35')]({},_0xe1306f,_0x566544[_0x33de('0x36')]);var _0x4a3fc2={'where':_0xe1306f[_0x33de('0x34')]};return db[_0x33de('0x26')]['count'](_0x4a3fc2)[_0x33de('0x21')](function(_0x3ea4fc){_0x50e3e1[_0x33de('0x11')]=_0x3ea4fc;if(_0x566544[_0x33de('0x2b')][_0x33de('0x37')]){_0xe1306f[_0x33de('0x38')]=[{'all':!![]}];}return db[_0x33de('0x26')]['findAll'](_0xe1306f);})[_0x33de('0x21')](function(_0x139501){_0x50e3e1[_0x33de('0x39')]=_0x139501;return _0x50e3e1;})[_0x33de('0x21')](respondWithFilteredResult(_0x3adcfd,_0xe1306f))[_0x33de('0x3a')](handleError(_0x3adcfd,null));};exports[_0x33de('0x3b')]=function(_0x4d42cc,_0x55f3a8){var _0x1d6e0d={'raw':![],'where':{'id':_0x4d42cc[_0x33de('0x3c')]['id']}},_0x4cfb8a={};_0x4cfb8a[_0x33de('0x2a')]=_[_0x33de('0x3d')](db[_0x33de('0x26')][_0x33de('0x27')]);_0x4cfb8a['query']=_[_0x33de('0x3d')](_0x4d42cc[_0x33de('0x2b')]);_0x4cfb8a[_0x33de('0x2c')]=_['intersection'](_0x4cfb8a[_0x33de('0x2a')],_0x4cfb8a[_0x33de('0x2b')]);_0x1d6e0d['attributes']=_[_0x33de('0x2d')](_0x4cfb8a[_0x33de('0x2a')],qs['fields'](_0x4d42cc[_0x33de('0x2b')][_0x33de('0x2f')]));_0x1d6e0d[_0x33de('0x2e')]=_0x1d6e0d[_0x33de('0x2e')][_0x33de('0x30')]?_0x1d6e0d[_0x33de('0x2e')]:_0x4cfb8a[_0x33de('0x2a')];if(_0x4d42cc['query'][_0x33de('0x37')]){_0x1d6e0d[_0x33de('0x38')]=[{'all':!![]}];}_0x1d6e0d=_[_0x33de('0x35')]({},_0x1d6e0d,_0x4d42cc[_0x33de('0x36')]);return db[_0x33de('0x26')][_0x33de('0x1e')](_0x1d6e0d)[_0x33de('0x21')](handleEntityNotFound(_0x55f3a8,null))[_0x33de('0x21')](respondWithResult(_0x55f3a8,null))[_0x33de('0x3a')](handleError(_0x55f3a8,null));};exports['destroy']=function(_0xa3a945,_0x12a75f){return db['VoiceExtension'][_0x33de('0x1e')]({'where':{'id':_0xa3a945['params']['id']}})[_0x33de('0x21')](handleEntityNotFound(_0x12a75f,null))[_0x33de('0x21')](removeEntity(_0x12a75f,null))['catch'](handleError(_0x12a75f,null));};exports[_0x33de('0x3e')]=function(_0x1f0fdd,_0xe85f03){if(_0x1f0fdd[_0x33de('0x3f')][_0x33de('0x1d')]===_0x33de('0x17')&&!_[_0x33de('0x40')](_0x1f0fdd[_0x33de('0x3f')]['exten'],'_')){_0x1f0fdd[_0x33de('0x3f')][_0x33de('0x41')]='_'[_0x33de('0x42')](_0x1f0fdd[_0x33de('0x3f')][_0x33de('0x41')]);}return db[_0x33de('0x26')][_0x33de('0x3e')](_0x1f0fdd['body'],{'raw':![]})[_0x33de('0x21')](function(_0x369b96){var _0x465552=_0x1f0fdd[_0x33de('0x43')][_0x33de('0x14')]({'plain':!![]});if(!_0x465552)throw new Error(_0x33de('0x44'));if(_0x465552[_0x33de('0x45')]==='user'){var _0x20fe3c=_0x369b96['get']({'plain':!![]});var _0x23b738=[{'name':_0x33de('0x15'),'value':_0x33de('0x16')},{'name':_0x33de('0x46'),'value':_0x33de('0x17')},{'name':_0x33de('0x47'),'value':'internal'}];var _0x2966fb=_[_0x33de('0x1e')](_0x23b738,['value',_0x20fe3c[_0x33de('0x1d')]])[_0x33de('0x1f')];return db[_0x33de('0x48')][_0x33de('0x1e')]({'where':{'name':_0x2966fb,'userProfileId':_0x465552[_0x33de('0x49')]},'raw':!![]})[_0x33de('0x21')](function(_0x14004d){if(_0x14004d&&_0x14004d[_0x33de('0x4a')]===0x0){return db[_0x33de('0x4b')][_0x33de('0x3e')]({'name':_0x20fe3c[_0x33de('0x1f')],'resourceId':_0x20fe3c['id'],'type':_0x14004d['name'],'sectionId':_0x14004d['id']},{})[_0x33de('0x21')](function(){return _0x369b96;});}else{return _0x369b96;}})[_0x33de('0x3a')](function(_0x82c444){logger[_0x33de('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x82c444);throw _0x82c444;});}return _0x369b96;})[_0x33de('0x21')](respondWithResult(_0xe85f03,0xc9))[_0x33de('0x3a')](handleError(_0xe85f03,null));};exports[_0x33de('0x4c')]=function(_0x46b40a,_0x139407){if(_0x46b40a[_0x33de('0x3f')]['id']){delete _0x46b40a[_0x33de('0x3f')]['id'];}return db[_0x33de('0x26')][_0x33de('0x1e')]({'where':{'id':_0x46b40a[_0x33de('0x3c')]['id']}})[_0x33de('0x21')](handleEntityNotFound(_0x139407,null))[_0x33de('0x21')](function(_0x4d16ab){if(_0x4d16ab){return db[_0x33de('0x26')][_0x33de('0x4c')](_[_0x33de('0x33')](_0x46b40a[_0x33de('0x3f')],[_0x33de('0x41'),_0x33de('0x4d'),_0x33de('0x4e'),_0x33de('0x4f'),_0x33de('0x50'),_0x33de('0x51'),_0x33de('0x52')]),{'where':{'context':_0x4d16ab[_0x33de('0x4d')],'exten':_0x4d16ab['exten']},'individualHooks':!![]})[_0x33de('0x21')](function(_0x41d7a5){return _0x41d7a5;});}return null;})[_0x33de('0x21')](respondWithStatusCode(_0x139407,null))[_0x33de('0x3a')](handleError(_0x139407,null));};exports[_0x33de('0x53')]=function(_0x483f53,_0x258440){var _0x2a1042=_0x483f53[_0x33de('0x3c')]['id'];var _0x189257=_0x483f53['body'];var _0x3a597c=0xc8;var _0x5906ec=null;return db[_0x33de('0x54')]['transaction']({'isolationLevel':db[_0x33de('0x54')]['Transaction'][_0x33de('0x55')]['READ_COMMITTED']},function(_0x49320e){return db['VoiceExtension'][_0x33de('0x56')]({'where':{'id':_0x2a1042},'transaction':_0x49320e})[_0x33de('0x21')](function(_0x582c0a){if(_0x582c0a){return db[_0x33de('0x26')]['destroy']({'where':{'VoiceExtensionId':_0x2a1042},'transaction':_0x49320e})['then'](function(){var _0x11cbc4=_[_0x33de('0x25')](_0x189257,function(_0x3964ae){_0x3964ae['VoiceExtensionId']=_0x2a1042;_0x3964ae[_0x33de('0x57')]=!![];return _0x3964ae;});return _0x582c0a['createRouting'](_0x11cbc4);})[_0x33de('0x21')](function(_0x3c7aee){return db['VoiceExtension'][_0x33de('0x58')](_0x3c7aee,{'transaction':_0x49320e});});}else{_0x3a597c=0x194;_0x5906ec=[];}});})[_0x33de('0x21')](function(){if(_0x3a597c!==0x194){return db[_0x33de('0x26')][_0x33de('0x59')]({'where':{'isApp':!![],'VoiceExtensionId':_0x2a1042},'order':_0x33de('0x5a')})[_0x33de('0x21')](function(_0xe76f0c){_0x5906ec=_0xe76f0c;});}})['catch'](function(_0x29ba14){_0x3a597c=0x1f4;logger['error'](_0x29ba14[_0x33de('0x23')]);if(_0x29ba14[_0x33de('0x1f')]){delete _0x29ba14['name'];}_0x5906ec=_0x29ba14;})[_0x33de('0x5b')](function(){if(_0x5906ec===null){_0x258440[_0x33de('0x5c')](_0x3a597c);}else{if(_0x3a597c===0x1f4){_0x258440[_0x33de('0xd')](_0x3a597c)[_0x33de('0x5d')](_0x5906ec);}else{_0x258440[_0x33de('0xd')](_0x3a597c)[_0x33de('0x13')](_0x5906ec);}}});}; \ No newline at end of file +var _0xc86b=['addApplications','sequelize','READ_COMMITTED','findOne','VoiceExtensionId','isApp','findAndCountAll','cast(priority\x20as\x20unsigned)','stack','finally','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','socket.io-emitter','./voiceExtension.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','destroy','then','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','internal','filter','ignore','map','value','includes','type','find','name','UserProfileResource','error','VoiceExtension','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','options','includeAll','findAll','rows','catch','show','params','create','body','exten','concat','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','description','recordingFormat','cutdigits','mandatoryDisposition'];(function(_0x45d174,_0x47c6bb){var _0x3a0128=function(_0xdd4c62){while(--_0xdd4c62){_0x45d174['push'](_0x45d174['shift']());}};_0x3a0128(++_0x47c6bb);}(_0xc86b,0x1d1));var _0xbc86=function(_0x1c7da9,_0x516a33){_0x1c7da9=_0x1c7da9-0x0;var _0x1bfbb1=_0xc86b[_0x1c7da9];return _0x1bfbb1;};'use strict';var _=require(_0xbc86('0x0'));var Redis=require(_0xbc86('0x1'));var qs=require(_0xbc86('0x2'));var logger=require(_0xbc86('0x3'))(_0xbc86('0x4'));var config=require('../../config/environment');var db=require(_0xbc86('0x5'))['db'];config[_0xbc86('0x6')]=_[_0xbc86('0x7')](config[_0xbc86('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0xbc86('0x8'))(new Redis(config[_0xbc86('0x6')]));require(_0xbc86('0x9'))['register'](socket);function respondWithStatusCode(_0x4a9e17,_0x2eaacb){_0x2eaacb=_0x2eaacb||0xcc;return function(_0x4db244){if(_0x4db244){return _0x4a9e17[_0xbc86('0xa')](_0x2eaacb);}return _0x4a9e17[_0xbc86('0xb')](_0x2eaacb)[_0xbc86('0xc')]();};}function respondWithResult(_0x59b932,_0x305706){_0x305706=_0x305706||0xc8;return function(_0x100266){if(_0x100266){return _0x59b932[_0xbc86('0xb')](_0x305706)[_0xbc86('0xd')](_0x100266);}};}function respondWithFilteredResult(_0x1db8de,_0x3c5c37){return function(_0x8a8f78){if(_0x8a8f78){var _0x3cf1c6=typeof _0x3c5c37[_0xbc86('0xe')]===_0xbc86('0xf')&&typeof _0x3c5c37[_0xbc86('0x10')]===_0xbc86('0xf');var _0x408ddd=_0x8a8f78[_0xbc86('0x11')];var _0x4d69e0=_0x3cf1c6?0x0:_0x3c5c37[_0xbc86('0xe')];var _0x25c67c=_0x3cf1c6?_0x8a8f78[_0xbc86('0x11')]:_0x3c5c37[_0xbc86('0xe')]+_0x3c5c37[_0xbc86('0x10')];var _0x124170;if(_0x25c67c>=_0x408ddd){_0x25c67c=_0x408ddd;_0x124170=0xc8;}else{_0x124170=0xce;}_0x1db8de[_0xbc86('0xb')](_0x124170);return _0x1db8de[_0xbc86('0x12')](_0xbc86('0x13'),_0x4d69e0+'-'+_0x25c67c+'/'+_0x408ddd)[_0xbc86('0xd')](_0x8a8f78);}return null;};}function removeEntity(_0x8317b2){return function(_0x2fac83){if(_0x2fac83){return _0x2fac83[_0xbc86('0x14')]()[_0xbc86('0x15')](function(){var _0x7b71f6=_0x2fac83[_0xbc86('0x16')]({'plain':!![]});var _0x223213=[{'name':_0xbc86('0x17'),'value':_0xbc86('0x18'),'ignore':![]},{'name':_0xbc86('0x19'),'value':_0xbc86('0x1a'),'ignore':![]},{'name':_0xbc86('0x1b'),'value':_0xbc86('0x1c'),'ignore':![]}];var _0x57d946=_(_0x223213)[_0xbc86('0x1d')](_0xbc86('0x1e'))[_0xbc86('0x1f')]('value')[_0xbc86('0x20')]();if(_[_0xbc86('0x21')](_0x57d946,_0x7b71f6[_0xbc86('0x22')])){return;}var _0x110d3c=_[_0xbc86('0x23')](_0x223213,['value',_0x7b71f6[_0xbc86('0x22')]])[_0xbc86('0x24')];return db[_0xbc86('0x25')]['destroy']({'where':{'type':_0x110d3c,'resourceId':_0x7b71f6['id']}})['then'](function(){return _0x2fac83;});})['then'](function(){_0x8317b2[_0xbc86('0xb')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d03fb){return function(_0x37fb66){if(!_0x37fb66){_0x5d03fb[_0xbc86('0xa')](0x194);}return _0x37fb66;};}function handleError(_0x429213,_0x4199ce){_0x4199ce=_0x4199ce||0x1f4;return function(_0xaf2ce2){logger[_0xbc86('0x26')](_0xaf2ce2['stack']);if(_0xaf2ce2[_0xbc86('0x24')]){delete _0xaf2ce2['name'];}_0x429213[_0xbc86('0xb')](_0x4199ce)['send'](_0xaf2ce2);};}exports['index']=function(_0x5802b3,_0x361532){var _0x1ab135={},_0x5a7a74={},_0x7dbdd6={'count':0x0,'rows':[]};var _0x5d861d=_['map'](db[_0xbc86('0x27')][_0xbc86('0x28')],function(_0x2bedcd){return{'name':_0x2bedcd[_0xbc86('0x29')],'type':_0x2bedcd[_0xbc86('0x22')][_0xbc86('0x2a')]};});_0x5a7a74[_0xbc86('0x2b')]=_[_0xbc86('0x1f')](_0x5d861d,_0xbc86('0x24'));_0x5a7a74['query']=_[_0xbc86('0x2c')](_0x5802b3[_0xbc86('0x2d')]);_0x5a7a74[_0xbc86('0x2e')]=_[_0xbc86('0x2f')](_0x5a7a74['model'],_0x5a7a74['query']);_0x1ab135[_0xbc86('0x30')]=_[_0xbc86('0x2f')](_0x5a7a74['model'],qs['fields'](_0x5802b3[_0xbc86('0x2d')][_0xbc86('0x31')]));_0x1ab135['attributes']=_0x1ab135[_0xbc86('0x30')][_0xbc86('0x32')]?_0x1ab135[_0xbc86('0x30')]:_0x5a7a74[_0xbc86('0x2b')];if(!_0x5802b3[_0xbc86('0x2d')]['hasOwnProperty'](_0xbc86('0x33'))){_0x1ab135[_0xbc86('0x10')]=qs[_0xbc86('0x10')](_0x5802b3['query'][_0xbc86('0x10')]);_0x1ab135['offset']=qs[_0xbc86('0xe')](_0x5802b3[_0xbc86('0x2d')][_0xbc86('0xe')]);}_0x1ab135[_0xbc86('0x34')]=qs['sort'](_0x5802b3[_0xbc86('0x2d')][_0xbc86('0x35')]);_0x1ab135[_0xbc86('0x36')]=qs['filters'](_[_0xbc86('0x37')](_0x5802b3[_0xbc86('0x2d')],_0x5a7a74[_0xbc86('0x2e')]),_0x5d861d);if(_0x5802b3[_0xbc86('0x2d')][_0xbc86('0x1d')]){_0x1ab135['where']=_[_0xbc86('0x38')](_0x1ab135[_0xbc86('0x36')],{'$or':_[_0xbc86('0x1f')](_0x5d861d,function(_0x4c2ca4){if(_0x4c2ca4['type']!=='VIRTUAL'){var _0x15f774={};_0x15f774[_0x4c2ca4[_0xbc86('0x24')]]={'$like':'%'+_0x5802b3[_0xbc86('0x2d')][_0xbc86('0x1d')]+'%'};return _0x15f774;}})});}_0x1ab135=_[_0xbc86('0x38')]({},_0x1ab135,_0x5802b3[_0xbc86('0x39')]);var _0x374114={'where':_0x1ab135[_0xbc86('0x36')]};return db[_0xbc86('0x27')][_0xbc86('0x11')](_0x374114)[_0xbc86('0x15')](function(_0x5a6335){_0x7dbdd6[_0xbc86('0x11')]=_0x5a6335;if(_0x5802b3[_0xbc86('0x2d')][_0xbc86('0x3a')]){_0x1ab135['include']=[{'all':!![]}];}return db[_0xbc86('0x27')][_0xbc86('0x3b')](_0x1ab135);})[_0xbc86('0x15')](function(_0x2b7fc0){_0x7dbdd6[_0xbc86('0x3c')]=_0x2b7fc0;return _0x7dbdd6;})[_0xbc86('0x15')](respondWithFilteredResult(_0x361532,_0x1ab135))[_0xbc86('0x3d')](handleError(_0x361532,null));};exports[_0xbc86('0x3e')]=function(_0x53a828,_0x185ec0){var _0x518d9d={'raw':![],'where':{'id':_0x53a828[_0xbc86('0x3f')]['id']}},_0x69fcdc={};_0x69fcdc[_0xbc86('0x2b')]=_['keys'](db[_0xbc86('0x27')][_0xbc86('0x28')]);_0x69fcdc[_0xbc86('0x2d')]=_[_0xbc86('0x2c')](_0x53a828['query']);_0x69fcdc[_0xbc86('0x2e')]=_[_0xbc86('0x2f')](_0x69fcdc['model'],_0x69fcdc[_0xbc86('0x2d')]);_0x518d9d[_0xbc86('0x30')]=_[_0xbc86('0x2f')](_0x69fcdc[_0xbc86('0x2b')],qs[_0xbc86('0x31')](_0x53a828['query'][_0xbc86('0x31')]));_0x518d9d[_0xbc86('0x30')]=_0x518d9d[_0xbc86('0x30')][_0xbc86('0x32')]?_0x518d9d[_0xbc86('0x30')]:_0x69fcdc[_0xbc86('0x2b')];if(_0x53a828[_0xbc86('0x2d')][_0xbc86('0x3a')]){_0x518d9d['include']=[{'all':!![]}];}_0x518d9d=_[_0xbc86('0x38')]({},_0x518d9d,_0x53a828['options']);return db[_0xbc86('0x27')]['find'](_0x518d9d)[_0xbc86('0x15')](handleEntityNotFound(_0x185ec0,null))[_0xbc86('0x15')](respondWithResult(_0x185ec0,null))[_0xbc86('0x3d')](handleError(_0x185ec0,null));};exports['destroy']=function(_0x49647c,_0x1b9481){return db[_0xbc86('0x27')][_0xbc86('0x23')]({'where':{'id':_0x49647c[_0xbc86('0x3f')]['id']}})[_0xbc86('0x15')](handleEntityNotFound(_0x1b9481,null))[_0xbc86('0x15')](removeEntity(_0x1b9481,null))[_0xbc86('0x3d')](handleError(_0x1b9481,null));};exports[_0xbc86('0x40')]=function(_0x1ddbd9,_0x239424){if(_0x1ddbd9[_0xbc86('0x41')][_0xbc86('0x22')]===_0xbc86('0x1a')&&!_['startsWith'](_0x1ddbd9[_0xbc86('0x41')][_0xbc86('0x42')],'_')){_0x1ddbd9[_0xbc86('0x41')][_0xbc86('0x42')]='_'[_0xbc86('0x43')](_0x1ddbd9[_0xbc86('0x41')]['exten']);}return db[_0xbc86('0x27')][_0xbc86('0x40')](_0x1ddbd9[_0xbc86('0x41')],{'raw':![]})[_0xbc86('0x15')](function(_0xbb8ab7){var _0x27eac0=_0x1ddbd9['user'][_0xbc86('0x16')]({'plain':!![]});if(!_0x27eac0)throw new Error(_0xbc86('0x44'));if(_0x27eac0[_0xbc86('0x45')]===_0xbc86('0x46')){var _0x17c733=_0xbb8ab7['get']({'plain':!![]});var _0x29d924=[{'name':'InboundRoutes','value':_0xbc86('0x18')},{'name':'OutboundRoutes','value':_0xbc86('0x1a')},{'name':_0xbc86('0x1b'),'value':_0xbc86('0x1c')}];var _0x2881=_[_0xbc86('0x23')](_0x29d924,[_0xbc86('0x20'),_0x17c733[_0xbc86('0x22')]])[_0xbc86('0x24')];return db[_0xbc86('0x47')][_0xbc86('0x23')]({'where':{'name':_0x2881,'userProfileId':_0x27eac0[_0xbc86('0x48')]},'raw':!![]})[_0xbc86('0x15')](function(_0x4c3447){if(_0x4c3447&&_0x4c3447[_0xbc86('0x49')]===0x0){return db[_0xbc86('0x25')][_0xbc86('0x40')]({'name':_0x17c733[_0xbc86('0x24')],'resourceId':_0x17c733['id'],'type':_0x4c3447[_0xbc86('0x24')],'sectionId':_0x4c3447['id']},{})['then'](function(){return _0xbb8ab7;});}else{return _0xbb8ab7;}})[_0xbc86('0x3d')](function(_0x11c64d){logger[_0xbc86('0x26')](_0xbc86('0x4a'),_0x11c64d);throw _0x11c64d;});}return _0xbb8ab7;})[_0xbc86('0x15')](respondWithResult(_0x239424,0xc9))[_0xbc86('0x3d')](handleError(_0x239424,null));};exports[_0xbc86('0x4b')]=function(_0x406aa9,_0x22de7b){if(_0x406aa9[_0xbc86('0x41')]['id']){delete _0x406aa9[_0xbc86('0x41')]['id'];}return db[_0xbc86('0x27')][_0xbc86('0x23')]({'where':{'id':_0x406aa9['params']['id']}})[_0xbc86('0x15')](handleEntityNotFound(_0x22de7b,null))[_0xbc86('0x15')](function(_0x3b0a19){if(_0x3b0a19){return db['VoiceExtension']['update'](_[_0xbc86('0x37')](_0x406aa9[_0xbc86('0x41')],['exten',_0xbc86('0x4c'),_0xbc86('0x4d'),_0xbc86('0x4e'),_0xbc86('0x4f'),_0xbc86('0x50'),'alias']),{'where':{'context':_0x3b0a19[_0xbc86('0x4c')],'exten':_0x3b0a19[_0xbc86('0x42')]},'individualHooks':!![]})['then'](function(_0x1d38a7){return _0x1d38a7;});}return null;})[_0xbc86('0x15')](respondWithStatusCode(_0x22de7b,null))['catch'](handleError(_0x22de7b,null));};exports[_0xbc86('0x51')]=function(_0x5c2364,_0x1cf382){var _0x5f17cd=_0x5c2364[_0xbc86('0x3f')]['id'];var _0x1ba458=_0x5c2364[_0xbc86('0x41')];var _0x357ae5=0xc8;var _0x33fba5=null;return db[_0xbc86('0x52')]['transaction']({'isolationLevel':db[_0xbc86('0x52')]['Transaction']['ISOLATION_LEVELS'][_0xbc86('0x53')]},function(_0x376d0a){return db[_0xbc86('0x27')][_0xbc86('0x54')]({'where':{'id':_0x5f17cd},'transaction':_0x376d0a})[_0xbc86('0x15')](function(_0x4ce19e){if(_0x4ce19e){return db[_0xbc86('0x27')][_0xbc86('0x14')]({'where':{'VoiceExtensionId':_0x5f17cd},'transaction':_0x376d0a})[_0xbc86('0x15')](function(){var _0x3b5896=_[_0xbc86('0x1f')](_0x1ba458,function(_0x30a7b9){_0x30a7b9[_0xbc86('0x55')]=_0x5f17cd;_0x30a7b9[_0xbc86('0x56')]=!![];return _0x30a7b9;});return _0x4ce19e['createRouting'](_0x3b5896);})[_0xbc86('0x15')](function(_0x38e582){return db[_0xbc86('0x27')]['bulkCreate'](_0x38e582,{'transaction':_0x376d0a});});}else{_0x357ae5=0x194;_0x33fba5=[];}});})['then'](function(){if(_0x357ae5!==0x194){return db[_0xbc86('0x27')][_0xbc86('0x57')]({'where':{'isApp':!![],'VoiceExtensionId':_0x5f17cd},'order':_0xbc86('0x58')})[_0xbc86('0x15')](function(_0x35c4a1){_0x33fba5=_0x35c4a1;});}})[_0xbc86('0x3d')](function(_0x18396f){_0x357ae5=0x1f4;logger[_0xbc86('0x26')](_0x18396f[_0xbc86('0x59')]);if(_0x18396f[_0xbc86('0x24')]){delete _0x18396f['name'];}_0x33fba5=_0x18396f;})[_0xbc86('0x5a')](function(){if(_0x33fba5===null){_0x1cf382[_0xbc86('0xa')](_0x357ae5);}else{if(_0x357ae5===0x1f4){_0x1cf382[_0xbc86('0xb')](_0x357ae5)['send'](_0x33fba5);}else{_0x1cf382['status'](_0x357ae5)[_0xbc86('0xd')](_0x33fba5);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 0280fca..70e036c 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 _0xd8a2=['VoiceExtension','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x31a526,_0x48eb92){var _0x555ca7=function(_0x2c2667){while(--_0x2c2667){_0x31a526['push'](_0x31a526['shift']());}};_0x555ca7(++_0x48eb92);}(_0xd8a2,0x167));var _0x2d8a=function(_0x589542,_0x10229b){_0x589542=_0x589542-0x0;var _0x4aeb79=_0xd8a2[_0x589542];return _0x4aeb79;};'use strict';var EventEmitter=require(_0x2d8a('0x0'));var VoiceExtension=require('../../mysqldb')['db'][_0x2d8a('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x2d8a('0x2')](0x0);var events={'afterCreate':_0x2d8a('0x3'),'afterUpdate':_0x2d8a('0x4'),'afterDestroy':_0x2d8a('0x5')};function emitEvent(_0x17b920){return function(_0x566859,_0x5370d8,_0x4ea658){VoiceExtensionEvents[_0x2d8a('0x6')](_0x17b920+':'+_0x566859['id'],_0x566859);VoiceExtensionEvents[_0x2d8a('0x6')](_0x17b920,_0x566859);_0x4ea658(null);};}for(var e in events){if(events[_0x2d8a('0x7')](e)){var event=events[e];VoiceExtension[_0x2d8a('0x8')](e,emitEvent(event));}}module[_0x2d8a('0x9')]=VoiceExtensionEvents; \ No newline at end of file +var _0x24f6=['save','update','remove','exports','events','../../mysqldb','VoiceExtension','setMaxListeners'];(function(_0x146f35,_0x34f4cc){var _0x4c7b10=function(_0x399228){while(--_0x399228){_0x146f35['push'](_0x146f35['shift']());}};_0x4c7b10(++_0x34f4cc);}(_0x24f6,0x15c));var _0x624f=function(_0x515aff,_0x767a1a){_0x515aff=_0x515aff-0x0;var _0x10a328=_0x24f6[_0x515aff];return _0x10a328;};'use strict';var EventEmitter=require(_0x624f('0x0'));var VoiceExtension=require(_0x624f('0x1'))['db'][_0x624f('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x624f('0x3')](0x0);var events={'afterCreate':_0x624f('0x4'),'afterUpdate':_0x624f('0x5'),'afterDestroy':_0x624f('0x6')};function emitEvent(_0x395447){return function(_0x3c903b,_0x5273df,_0x63482c){VoiceExtensionEvents['emit'](_0x395447+':'+_0x3c903b['id'],_0x3c903b);VoiceExtensionEvents['emit'](_0x395447,_0x3c903b);_0x63482c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0x624f('0x7')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 7a3429e..11e41e3 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 _0x3b2b=['queue','playback','includes','app','appType','custom','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice','GotoIfTime',',${EXTEN},','appdata','XMCS-UNIQUEID=${CHANNEL(LINKEDID)}','priority','last','catch','VoiceExtension','voice_extensions','get','Hangup','lodash','./voiceExtension.attributes','models','type','Set','CDR(type)=','context','exten','alias','CDR(routeAlias)=','No\x20alias\x20set','inbound','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','CDR(type)=outbound','outbound','NoOp','CDR(destination)=','${EXTEN:','cutdigits','${EXTEN}','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','trunk','timeout','url','split','length','name','param','phone','prefix','join','options','indexOf','U(xcally-mixmonitor-context)','isEmpty','findAll','interval','then','intervals','map','filter','IntervalId','toLowerCase','tag','CDR(tag)=','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer'];(function(_0x58a4ac,_0x43fd42){var _0x545810=function(_0x308e65){while(--_0x308e65){_0x58a4ac['push'](_0x58a4ac['shift']());}};_0x545810(++_0x43fd42);}(_0x3b2b,0x64));var _0xb3b2=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0x3b2b[_0x21aec3];return _0x288bbc;};'use strict';var _=require(_0xb3b2('0x0'));var attributes=require(_0xb3b2('0x1'));module['exports']=function(_0xf70a0d){var _0x342f90=_0xf70a0d[_0xb3b2('0x2')];function _0x218282(_0x83ffbd){var _0x2f382f=0x2;var _0x1aaf04=[{'type':_0x83ffbd[_0xb3b2('0x3')],'app':_0xb3b2('0x4'),'appdata':_0xb3b2('0x5')+_0x83ffbd[_0xb3b2('0x3')],'context':_0x83ffbd[_0xb3b2('0x6')],'exten':_0x83ffbd[_0xb3b2('0x7')],'priority':_0x2f382f++,'VoiceExtensionId':_0x83ffbd['id']},{'type':_0x83ffbd[_0xb3b2('0x3')],'app':_0x83ffbd[_0xb3b2('0x8')]?_0xb3b2('0x4'):'NoOp','appdata':_0x83ffbd[_0xb3b2('0x8')]?_0xb3b2('0x9')+_0x83ffbd[_0xb3b2('0x8')]:_0xb3b2('0xa'),'context':_0x83ffbd[_0xb3b2('0x6')],'exten':_0x83ffbd['exten'],'priority':_0x2f382f++,'VoiceExtensionId':_0x83ffbd['id']}];if(_0x83ffbd[_0xb3b2('0x3')]===_0xb3b2('0xb')){_0x1aaf04[_0xb3b2('0xc')]({'type':'inbound','app':'Set','appdata':_0xb3b2('0xd')+_0x83ffbd['id'],'context':_0x83ffbd[_0xb3b2('0x6')],'exten':_0x83ffbd[_0xb3b2('0x7')],'priority':_0x2f382f++,'VoiceExtensionId':_0x83ffbd['id']});}_0x1aaf04['push']({'type':_0x83ffbd['type'],'app':_0xb3b2('0x4'),'appdata':_0xb3b2('0xe'),'context':_0x83ffbd[_0xb3b2('0x6')],'exten':_0x83ffbd[_0xb3b2('0x7')],'priority':_0x2f382f++,'VoiceExtensionId':_0x83ffbd['id']},{'type':_0x83ffbd[_0xb3b2('0x3')],'app':_0xb3b2('0x4'),'appdata':_0xb3b2('0xf'),'context':_0x83ffbd['context'],'exten':_0x83ffbd['exten'],'priority':_0x2f382f++,'VoiceExtensionId':_0x83ffbd['id']},{'type':_0x83ffbd[_0xb3b2('0x3')],'app':'Set','appdata':_0xb3b2('0x10'),'context':_0x83ffbd[_0xb3b2('0x6')],'exten':_0x83ffbd[_0xb3b2('0x7')],'priority':_0x2f382f++,'VoiceExtensionId':_0x83ffbd['id']});return _0x1aaf04;}function _0x11396a(_0x80fd16){var _0x2f0e7f=0x2;var _0x57ee49=[{'type':'outbound','app':_0xb3b2('0x4'),'appdata':_0xb3b2('0x11'),'context':_0x80fd16['context'],'exten':_0x80fd16[_0xb3b2('0x7')],'priority':_0x2f0e7f++,'VoiceExtensionId':_0x80fd16['id']},{'type':_0xb3b2('0x12'),'app':_0x80fd16[_0xb3b2('0x8')]?_0xb3b2('0x4'):_0xb3b2('0x13'),'appdata':_0x80fd16['alias']?'CDR(routeAlias)='+_0x80fd16['alias']:_0xb3b2('0xa'),'context':_0x80fd16[_0xb3b2('0x6')],'exten':_0x80fd16['exten'],'priority':_0x2f0e7f++,'VoiceExtensionId':_0x80fd16['id']},{'type':_0xb3b2('0x12'),'app':'Set','appdata':_0xb3b2('0x14')+(_0x80fd16['cutdigits']?_0xb3b2('0x15')+_0x80fd16[_0xb3b2('0x16')]+'}':_0xb3b2('0x17')),'context':_0x80fd16[_0xb3b2('0x6')],'exten':_0x80fd16[_0xb3b2('0x7')],'priority':_0x2f0e7f++,'VoiceExtensionId':_0x80fd16['id']},{'type':_0xb3b2('0x12'),'app':_0xb3b2('0x4'),'appdata':_0xb3b2('0xd')+_0x80fd16['id'],'context':_0x80fd16[_0xb3b2('0x6')],'exten':_0x80fd16['exten'],'priority':_0x2f0e7f++,'VoiceExtensionId':_0x80fd16['id']},{'type':'outbound','app':'ExecIf','appdata':_0xb3b2('0x18')+(_0x2f0e7f+0x2)+'):Goto('+(_0x2f0e7f+0x1)+')','context':_0x80fd16['context'],'exten':_0x80fd16[_0xb3b2('0x7')],'priority':_0x2f0e7f++,'VoiceExtensionId':_0x80fd16['id']},{'type':'outbound','app':_0xb3b2('0x4'),'appdata':_0x80fd16[_0xb3b2('0x16')]?'CDR(prefix)=${EXTEN:0:'+_0x80fd16[_0xb3b2('0x16')]+'}':'CDR(prefix)=noprefix','context':_0x80fd16[_0xb3b2('0x6')],'exten':_0x80fd16[_0xb3b2('0x7')],'priority':_0x2f0e7f++,'VoiceExtensionId':_0x80fd16['id']},{'type':_0xb3b2('0x12'),'app':_0xb3b2('0x4'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x80fd16[_0xb3b2('0x6')],'exten':_0x80fd16[_0xb3b2('0x7')],'priority':_0x2f0e7f++,'VoiceExtensionId':_0x80fd16['id']},{'type':_0xb3b2('0x12'),'app':'Set','appdata':_0xb3b2('0xf'),'context':_0x80fd16['context'],'exten':_0x80fd16[_0xb3b2('0x7')],'priority':_0x2f0e7f++,'VoiceExtensionId':_0x80fd16['id']},{'type':_0xb3b2('0x12'),'app':_0xb3b2('0x4'),'appdata':_0xb3b2('0x10'),'context':_0x80fd16[_0xb3b2('0x6')],'exten':_0x80fd16[_0xb3b2('0x7')],'priority':_0x2f0e7f++,'VoiceExtensionId':_0x80fd16['id']},{'type':_0xb3b2('0x12'),'app':_0xb3b2('0x4'),'appdata':_0xb3b2('0x19')+_0x80fd16['id'],'context':_0x80fd16[_0xb3b2('0x6')],'exten':_0x80fd16['exten'],'priority':_0x2f0e7f++,'VoiceExtensionId':_0x80fd16['id']}];if(_0x80fd16[_0xb3b2('0x1a')](_0xb3b2('0x1b'))&&_0x80fd16[_0xb3b2('0x1b')]!==_0xb3b2('0x1c')){_0x57ee49[_0xb3b2('0xc')]({'type':_0xb3b2('0x12'),'app':_0xb3b2('0x4'),'appdata':_0xb3b2('0x1d'),'context':_0x80fd16[_0xb3b2('0x6')],'exten':_0x80fd16[_0xb3b2('0x7')],'priority':_0x2f0e7f++,'VoiceExtensionId':_0x80fd16['id']},{'type':_0xb3b2('0x12'),'app':_0xb3b2('0x4'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x80fd16[_0xb3b2('0x1b')]||'wav','context':_0x80fd16[_0xb3b2('0x6')],'exten':_0x80fd16['exten'],'priority':_0x2f0e7f++,'VoiceExtensionId':_0x80fd16['id']});}return _0x57ee49;}function _0x23331f(_0x478c85,_0x3aa8c4){var _0x3763ea=[{'name':_0xb3b2('0x1e'),'param':0x0},{'name':_0xb3b2('0x1f'),'param':0x1},{'name':'options','param':0x2},{'name':_0xb3b2('0x20'),'param':0x3}];var _0x22c137={};var _0x579293=_0x3aa8c4[_0xb3b2('0x21')](',');var _0xabed40=[];for(var _0xbbeff9=0x0;_0xbbeff9<_0x3763ea[_0xb3b2('0x22')];_0xbbeff9++){switch(_0x3763ea[_0xbbeff9][_0xb3b2('0x23')]){case _0xb3b2('0x1e'):_0x22c137[_0xb3b2('0x1e')]=_0x579293[_0x3763ea[_0xbbeff9][_0xb3b2('0x24')]][_0xb3b2('0x21')]('/')[0x1];_0x22c137[_0xb3b2('0x25')]=_0x579293[_0x3763ea[_0xbbeff9]['param']][_0xb3b2('0x21')]('/')[0x2];_0x22c137['prefix']=_0x22c137[_0xb3b2('0x25')]?_0x22c137[_0xb3b2('0x25')][_0xb3b2('0x21')]('$')[0x0]:undefined;_0x22c137[_0xb3b2('0x25')]=_0x478c85[_0xb3b2('0x16')]?(_0x22c137[_0xb3b2('0x26')]||'')+_0xb3b2('0x15')+_0x478c85[_0xb3b2('0x16')]+'}':(_0x22c137[_0xb3b2('0x26')]||'')+_0xb3b2('0x17');_0xabed40[_0x3763ea[_0xbbeff9]['param']]=['SIP',_0x22c137[_0xb3b2('0x1e')],_0x22c137[_0xb3b2('0x25')]][_0xb3b2('0x27')]('/');break;case _0xb3b2('0x28'):_0x22c137[_0xb3b2('0x28')]=_0x579293[_0x3763ea[_0xbbeff9][_0xb3b2('0x24')]];if(_0x478c85[_0xb3b2('0x1b')]!=='none'){if(_0x22c137[_0xb3b2('0x28')][_0xb3b2('0x29')]('U(xcally-mixmonitor-context)')<0x0){_0x22c137['options']+=_0xb3b2('0x2a');}}else{_0x22c137[_0xb3b2('0x28')]=_0x22c137[_0xb3b2('0x28')]['replace'](_0xb3b2('0x2a'),'');}_0xabed40[_0x3763ea[_0xbbeff9][_0xb3b2('0x24')]]=_0x22c137[_0xb3b2('0x28')];break;default:_0xabed40[_0x3763ea[_0xbbeff9][_0xb3b2('0x24')]]=_0x579293[_0x3763ea[_0xbbeff9][_0xb3b2('0x24')]];}}return _0xabed40['join'](',');}function _0x4215e2(_0xbb2bdb,_0x7f126b,_0x970872){return new Promise(function(_0x588514,_0x4e1225){var _0x8446e3=[];if(_[_0xb3b2('0x2b')](_0x7f126b))return _0x588514(_0x8446e3);_0x342f90['Interval'][_0xb3b2('0x2c')]({'attributes':['id',_0xb3b2('0x2d'),'IntervalId'],'raw':!![]})[_0xb3b2('0x2e')](function(_0x17d715){for(var _0x1eedb7=0x0,_0x5e12d0=0x0;_0x1eedb7<_0x7f126b[_0xb3b2('0x22')];_0x1eedb7++,_0x5e12d0=0x0){var _0x161173=_0x7f126b[_0x1eedb7];var _0x2b9a5b=[];var _0x482073=[];delete _0x161173['id'];if(_0x161173[_0xb3b2('0x2d')]!=='*,*,*,*'){_0x161173[_0xb3b2('0x2f')]=[_0x161173[_0xb3b2('0x2d')]];}else{_0x161173[_0xb3b2('0x2f')]=_0x161173['IntervalId']?_[_0xb3b2('0x30')](_[_0xb3b2('0x31')](_0x17d715,{'IntervalId':_0x161173[_0xb3b2('0x32')]}),'interval'):[];}_0x161173[_0xb3b2('0x6')]=_0xbb2bdb[_0xb3b2('0x6')];_0x161173[_0xb3b2('0x7')]=_0xbb2bdb[_0xb3b2('0x7')];if(_0x161173['type'])_0x161173['type']=_0x161173['type'][_0xb3b2('0x33')]();if(_0xbb2bdb[_0xb3b2('0x3')]===_0xb3b2('0x12')){if(_0x161173['hasOwnProperty'](_0xb3b2('0x34'))&&_0x161173[_0xb3b2('0x34')]&&_0x161173[_0xb3b2('0x34')]!=='--'){_0x2b9a5b['push']({'type':_0x161173['type'][_0xb3b2('0x33')](),'app':_0xb3b2('0x4'),'appdata':_0xb3b2('0x35')+_0x161173[_0xb3b2('0x34')],'context':_0xbb2bdb[_0xb3b2('0x6')],'exten':_0xbb2bdb[_0xb3b2('0x7')],'priority':_0x161173[_0xb3b2('0x2f')]['length']+_0x970872+_0x5e12d0++,'VoiceExtensionId':_0xbb2bdb['id']});}_0x2b9a5b[_0xb3b2('0xc')]({'type':_0x161173[_0xb3b2('0x3')][_0xb3b2('0x33')](),'app':_0xb3b2('0x36'),'appdata':_0xb3b2('0x37')+(_0x161173[_0xb3b2('0x38')]?_0xb3b2('0x39')+_0x161173[_0xb3b2('0x38')]+')':_0xb3b2('0x3a')),'context':_0xbb2bdb['context'],'exten':_0xbb2bdb[_0xb3b2('0x7')],'priority':_0x161173[_0xb3b2('0x2f')][_0xb3b2('0x22')]+_0x970872+_0x5e12d0++,'VoiceExtensionId':_0xbb2bdb['id']});}else{if(_0x161173[_0xb3b2('0x1a')](_0xb3b2('0x3b'))){if([_0xb3b2('0x3c'),_0xb3b2('0x3d')][_0xb3b2('0x3e')](_0x161173[_0xb3b2('0x3f')]['toLowerCase']())&&_0x161173[_0xb3b2('0x40')]!==_0xb3b2('0x41')){if(_0x161173[_0xb3b2('0x3b')]){_0x2b9a5b[_0xb3b2('0xc')]({'type':_0x161173['type'][_0xb3b2('0x33')](),'app':'ExecIf','appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0xbb2bdb[_0xb3b2('0x6')],'exten':_0xbb2bdb[_0xb3b2('0x7')],'priority':_0x161173[_0xb3b2('0x2f')][_0xb3b2('0x22')]+_0x970872+_0x5e12d0++,'VoiceExtensionId':_0xbb2bdb['id']});_0x2b9a5b[_0xb3b2('0xc')]({'type':_0x161173[_0xb3b2('0x3')][_0xb3b2('0x33')](),'app':_0xb3b2('0x4'),'appdata':_0xb3b2('0x42'),'context':_0xbb2bdb[_0xb3b2('0x6')],'exten':_0xbb2bdb[_0xb3b2('0x7')],'priority':_0x161173[_0xb3b2('0x2f')][_0xb3b2('0x22')]+_0x970872+_0x5e12d0++,'VoiceExtensionId':_0xbb2bdb['id']});}else{_0x2b9a5b[_0xb3b2('0xc')]({'type':_0x161173['type'][_0xb3b2('0x33')](),'app':_0xb3b2('0x36'),'appdata':_0xb3b2('0x43'),'context':_0xbb2bdb[_0xb3b2('0x6')],'exten':_0xbb2bdb[_0xb3b2('0x7')],'priority':_0x161173[_0xb3b2('0x2f')][_0xb3b2('0x22')]+_0x970872+_0x5e12d0++,'VoiceExtensionId':_0xbb2bdb['id']});_0x2b9a5b[_0xb3b2('0xc')]({'type':_0x161173[_0xb3b2('0x3')][_0xb3b2('0x33')](),'app':_0xb3b2('0x4'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0xbb2bdb['context'],'exten':_0xbb2bdb[_0xb3b2('0x7')],'priority':_0x161173[_0xb3b2('0x2f')][_0xb3b2('0x22')]+_0x970872+_0x5e12d0++,'VoiceExtensionId':_0xbb2bdb['id']});}}}}for(var _0x438a40=0x0;_0x438a40<_0x161173[_0xb3b2('0x2f')]['length'];_0x438a40++){var _0x4eca42=_0x970872+_0x161173[_0xb3b2('0x2f')]['length'];var _0x42d2ca=_0x438a40===_0x161173[_0xb3b2('0x2f')][_0xb3b2('0x22')]-0x1?_0x970872+_0x2b9a5b['length']+_0x482073[_0xb3b2('0x22')]+0x2:_0x970872+_0x438a40+0x1;_0x2b9a5b[_0xb3b2('0x44')](_0x438a40,0x0,{'type':_0xbb2bdb[_0xb3b2('0x3')],'app':_0xb3b2('0x45'),'appdata':_0x161173[_0xb3b2('0x2f')][_0x438a40]+'?'+_0xbb2bdb[_0xb3b2('0x6')]+_0xb3b2('0x46')+_0x4eca42+':'+_0xbb2bdb[_0xb3b2('0x6')]+_0xb3b2('0x46')+_0x42d2ca,'exten':_0xbb2bdb[_0xb3b2('0x7')],'context':_0xbb2bdb[_0xb3b2('0x6')],'priority':_0x970872+_0x438a40,'VoiceExtensionId':_0xbb2bdb['id']});}if(_0x161173['appType']==='outboundDial'){_0x161173['appdata']=_0x23331f(_0xbb2bdb,_0x161173[_0xb3b2('0x47')]);}if(_0x161173[_0xb3b2('0x40')]==='agi'){_0x2b9a5b['push']({'type':_0x161173[_0xb3b2('0x3')][_0xb3b2('0x33')](),'app':'Set','appdata':_0xb3b2('0x48'),'context':_0xbb2bdb[_0xb3b2('0x6')],'exten':_0xbb2bdb[_0xb3b2('0x7')],'priority':_0x161173[_0xb3b2('0x2f')][_0xb3b2('0x22')]+_0x970872+_0x5e12d0++,'VoiceExtensionId':_0xbb2bdb['id']});}_0x161173[_0xb3b2('0x49')]=_0x2b9a5b[_0xb3b2('0x22')]?_['last'](_0x2b9a5b)[_0xb3b2('0x49')]+0x1:_0x970872;_0x8446e3=_['concat'](_0x8446e3,_0x2b9a5b,[_0x161173],_0x482073);_0x970872=_[_0xb3b2('0x4a')](_0x8446e3)['priority']+0x1;}return _0x588514(_0x8446e3);})[_0xb3b2('0x4b')](function(_0x4203ec){_0x4e1225(_0x4203ec);});});}return _0xf70a0d['define'](_0xb3b2('0x4c'),attributes,{'tableName':_0xb3b2('0x4d'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x177a9c){var _0x246855=this[_0xb3b2('0x4e')]({'plain':!![]});var _0x201b48=_0x246855[_0xb3b2('0x3')]==='outbound'?_0x11396a(_0x246855):_0x218282(_0x246855);return _0x4215e2(_0x246855,_0x177a9c,_[_0xb3b2('0x4a')](_0x201b48)[_0xb3b2('0x49')]+0x1)[_0xb3b2('0x2e')](function(_0x1a931f){var _0x4a394b=_['concat'](_0x201b48,_0x1a931f);_0x4a394b[_0xb3b2('0xc')]({'type':_0x246855[_0xb3b2('0x3')],'app':_0xb3b2('0x4f'),'exten':_0x246855[_0xb3b2('0x7')],'context':_0x246855[_0xb3b2('0x6')],'priority':_[_0xb3b2('0x4a')](_0x4a394b)['priority']+0x1,'VoiceExtensionId':_0x246855['id']});return _0x4a394b;});}}});}; \ No newline at end of file +var _0xa43e=['_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','options','url','split','length','name','param','phone','prefix','${EXTEN:','SIP','U(xcally-mixmonitor-context)','replace','join','isEmpty','Interval','findAll','interval','IntervalId','then','*,*,*,*','intervals','map','hasOwnProperty','tag','toLowerCase','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','playback','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','appType','outboundDial','appdata','agi','XMCS-UNIQUEID=${CHANNEL(LINKEDID)}','last','priority','concat','catch','define','VoiceExtension','voice_extensions','get','exports','models','type','Set','CDR(type)=','context','NoOp','alias','CDR(routeAlias)=','inbound','CDR(routeid)=','exten','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','No\x20alias\x20set','CDR(destination)=','cutdigits','${EXTEN}','ExecIf','CDR(prefix)=noprefix','XCALLY-MOTION-ANSWER=0','outboundrouteid=','recordingFormat','none','push'];(function(_0x5e4ebf,_0x32e4aa){var _0x5d5684=function(_0xb71399){while(--_0xb71399){_0x5e4ebf['push'](_0x5e4ebf['shift']());}};_0x5d5684(++_0x32e4aa);}(_0xa43e,0xdc));var _0xea43=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xa43e[_0x5d6456];return _0x4d66c1;};'use strict';var _=require('lodash');var attributes=require('./voiceExtension.attributes');module[_0xea43('0x0')]=function(_0x4ea9f2){var _0x163752=_0x4ea9f2[_0xea43('0x1')];function _0x1f21e3(_0x3bab42){var _0x56c5a6=0x2;var _0x2e0351=[{'type':_0x3bab42[_0xea43('0x2')],'app':_0xea43('0x3'),'appdata':_0xea43('0x4')+_0x3bab42[_0xea43('0x2')],'context':_0x3bab42[_0xea43('0x5')],'exten':_0x3bab42['exten'],'priority':_0x56c5a6++,'VoiceExtensionId':_0x3bab42['id']},{'type':_0x3bab42['type'],'app':_0x3bab42['alias']?_0xea43('0x3'):_0xea43('0x6'),'appdata':_0x3bab42[_0xea43('0x7')]?_0xea43('0x8')+_0x3bab42[_0xea43('0x7')]:'No\x20alias\x20set','context':_0x3bab42[_0xea43('0x5')],'exten':_0x3bab42['exten'],'priority':_0x56c5a6++,'VoiceExtensionId':_0x3bab42['id']}];if(_0x3bab42[_0xea43('0x2')]===_0xea43('0x9')){_0x2e0351['push']({'type':'inbound','app':_0xea43('0x3'),'appdata':_0xea43('0xa')+_0x3bab42['id'],'context':_0x3bab42[_0xea43('0x5')],'exten':_0x3bab42[_0xea43('0xb')],'priority':_0x56c5a6++,'VoiceExtensionId':_0x3bab42['id']});}_0x2e0351['push']({'type':_0x3bab42[_0xea43('0x2')],'app':_0xea43('0x3'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x3bab42[_0xea43('0x5')],'exten':_0x3bab42[_0xea43('0xb')],'priority':_0x56c5a6++,'VoiceExtensionId':_0x3bab42['id']},{'type':_0x3bab42[_0xea43('0x2')],'app':'Set','appdata':_0xea43('0xc'),'context':_0x3bab42['context'],'exten':_0x3bab42[_0xea43('0xb')],'priority':_0x56c5a6++,'VoiceExtensionId':_0x3bab42['id']},{'type':_0x3bab42['type'],'app':_0xea43('0x3'),'appdata':_0xea43('0xd'),'context':_0x3bab42[_0xea43('0x5')],'exten':_0x3bab42[_0xea43('0xb')],'priority':_0x56c5a6++,'VoiceExtensionId':_0x3bab42['id']});return _0x2e0351;}function _0x58768a(_0x1fcfc8){var _0x4a1c29=0x2;var _0x2a2b0c=[{'type':'outbound','app':_0xea43('0x3'),'appdata':'CDR(type)=outbound','context':_0x1fcfc8[_0xea43('0x5')],'exten':_0x1fcfc8[_0xea43('0xb')],'priority':_0x4a1c29++,'VoiceExtensionId':_0x1fcfc8['id']},{'type':_0xea43('0xe'),'app':_0x1fcfc8[_0xea43('0x7')]?'Set':'NoOp','appdata':_0x1fcfc8[_0xea43('0x7')]?_0xea43('0x8')+_0x1fcfc8['alias']:_0xea43('0xf'),'context':_0x1fcfc8[_0xea43('0x5')],'exten':_0x1fcfc8[_0xea43('0xb')],'priority':_0x4a1c29++,'VoiceExtensionId':_0x1fcfc8['id']},{'type':_0xea43('0xe'),'app':_0xea43('0x3'),'appdata':_0xea43('0x10')+(_0x1fcfc8[_0xea43('0x11')]?'${EXTEN:'+_0x1fcfc8[_0xea43('0x11')]+'}':_0xea43('0x12')),'context':_0x1fcfc8[_0xea43('0x5')],'exten':_0x1fcfc8[_0xea43('0xb')],'priority':_0x4a1c29++,'VoiceExtensionId':_0x1fcfc8['id']},{'type':'outbound','app':'Set','appdata':'CDR(routeid)='+_0x1fcfc8['id'],'context':_0x1fcfc8[_0xea43('0x5')],'exten':_0x1fcfc8[_0xea43('0xb')],'priority':_0x4a1c29++,'VoiceExtensionId':_0x1fcfc8['id']},{'type':_0xea43('0xe'),'app':_0xea43('0x13'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x4a1c29+0x2)+'):Goto('+(_0x4a1c29+0x1)+')','context':_0x1fcfc8['context'],'exten':_0x1fcfc8[_0xea43('0xb')],'priority':_0x4a1c29++,'VoiceExtensionId':_0x1fcfc8['id']},{'type':_0xea43('0xe'),'app':_0xea43('0x3'),'appdata':_0x1fcfc8[_0xea43('0x11')]?'CDR(prefix)=${EXTEN:0:'+_0x1fcfc8[_0xea43('0x11')]+'}':_0xea43('0x14'),'context':_0x1fcfc8[_0xea43('0x5')],'exten':_0x1fcfc8['exten'],'priority':_0x4a1c29++,'VoiceExtensionId':_0x1fcfc8['id']},{'type':_0xea43('0xe'),'app':_0xea43('0x3'),'appdata':_0xea43('0x15'),'context':_0x1fcfc8[_0xea43('0x5')],'exten':_0x1fcfc8[_0xea43('0xb')],'priority':_0x4a1c29++,'VoiceExtensionId':_0x1fcfc8['id']},{'type':_0xea43('0xe'),'app':_0xea43('0x3'),'appdata':_0xea43('0xc'),'context':_0x1fcfc8[_0xea43('0x5')],'exten':_0x1fcfc8[_0xea43('0xb')],'priority':_0x4a1c29++,'VoiceExtensionId':_0x1fcfc8['id']},{'type':'outbound','app':'Set','appdata':'MONITOR_OPTIONS=ab','context':_0x1fcfc8[_0xea43('0x5')],'exten':_0x1fcfc8[_0xea43('0xb')],'priority':_0x4a1c29++,'VoiceExtensionId':_0x1fcfc8['id']},{'type':'outbound','app':_0xea43('0x3'),'appdata':_0xea43('0x16')+_0x1fcfc8['id'],'context':_0x1fcfc8[_0xea43('0x5')],'exten':_0x1fcfc8[_0xea43('0xb')],'priority':_0x4a1c29++,'VoiceExtensionId':_0x1fcfc8['id']}];if(_0x1fcfc8['hasOwnProperty']('recordingFormat')&&_0x1fcfc8[_0xea43('0x17')]!==_0xea43('0x18')){_0x2a2b0c[_0xea43('0x19')]({'type':_0xea43('0xe'),'app':_0xea43('0x3'),'appdata':_0xea43('0x1a'),'context':_0x1fcfc8[_0xea43('0x5')],'exten':_0x1fcfc8[_0xea43('0xb')],'priority':_0x4a1c29++,'VoiceExtensionId':_0x1fcfc8['id']},{'type':_0xea43('0xe'),'app':_0xea43('0x3'),'appdata':_0xea43('0x1b')+_0x1fcfc8[_0xea43('0x17')]||_0xea43('0x1c'),'context':_0x1fcfc8[_0xea43('0x5')],'exten':_0x1fcfc8[_0xea43('0xb')],'priority':_0x4a1c29++,'VoiceExtensionId':_0x1fcfc8['id']});}return _0x2a2b0c;}function _0x262a81(_0x175fe3,_0xb9fa75){var _0x451bea=[{'name':_0xea43('0x1d'),'param':0x0},{'name':_0xea43('0x1e'),'param':0x1},{'name':_0xea43('0x1f'),'param':0x2},{'name':_0xea43('0x20'),'param':0x3}];var _0x1e7b24={};var _0x26be3d=_0xb9fa75[_0xea43('0x21')](',');var _0x21a131=[];for(var _0x247b09=0x0;_0x247b09<_0x451bea[_0xea43('0x22')];_0x247b09++){switch(_0x451bea[_0x247b09][_0xea43('0x23')]){case _0xea43('0x1d'):_0x1e7b24[_0xea43('0x1d')]=_0x26be3d[_0x451bea[_0x247b09][_0xea43('0x24')]][_0xea43('0x21')]('/')[0x1];_0x1e7b24[_0xea43('0x25')]=_0x26be3d[_0x451bea[_0x247b09][_0xea43('0x24')]]['split']('/')[0x2];_0x1e7b24[_0xea43('0x26')]=_0x1e7b24['phone']?_0x1e7b24['phone']['split']('$')[0x0]:undefined;_0x1e7b24[_0xea43('0x25')]=_0x175fe3[_0xea43('0x11')]?(_0x1e7b24[_0xea43('0x26')]||'')+_0xea43('0x27')+_0x175fe3[_0xea43('0x11')]+'}':(_0x1e7b24[_0xea43('0x26')]||'')+'${EXTEN}';_0x21a131[_0x451bea[_0x247b09][_0xea43('0x24')]]=[_0xea43('0x28'),_0x1e7b24['trunk'],_0x1e7b24[_0xea43('0x25')]]['join']('/');break;case _0xea43('0x1f'):_0x1e7b24[_0xea43('0x1f')]=_0x26be3d[_0x451bea[_0x247b09][_0xea43('0x24')]];if(_0x175fe3[_0xea43('0x17')]!=='none'){if(_0x1e7b24[_0xea43('0x1f')]['indexOf']('U(xcally-mixmonitor-context)')<0x0){_0x1e7b24['options']+=_0xea43('0x29');}}else{_0x1e7b24[_0xea43('0x1f')]=_0x1e7b24[_0xea43('0x1f')][_0xea43('0x2a')](_0xea43('0x29'),'');}_0x21a131[_0x451bea[_0x247b09]['param']]=_0x1e7b24[_0xea43('0x1f')];break;default:_0x21a131[_0x451bea[_0x247b09]['param']]=_0x26be3d[_0x451bea[_0x247b09][_0xea43('0x24')]];}}return _0x21a131[_0xea43('0x2b')](',');}function _0x1b4b74(_0x108fb2,_0x1de4cf,_0x3f2428){return new Promise(function(_0x11fa44,_0xbd5c47){var _0x389cdf=[];if(_[_0xea43('0x2c')](_0x1de4cf))return _0x11fa44(_0x389cdf);_0x163752[_0xea43('0x2d')][_0xea43('0x2e')]({'attributes':['id',_0xea43('0x2f'),_0xea43('0x30')],'raw':!![]})[_0xea43('0x31')](function(_0x2b7ba4){for(var _0x1cda85=0x0,_0x14217a=0x0;_0x1cda85<_0x1de4cf[_0xea43('0x22')];_0x1cda85++,_0x14217a=0x0){var _0x184df7=_0x1de4cf[_0x1cda85];var _0x4ae6b0=[];var _0x47f6d1=[];delete _0x184df7['id'];if(_0x184df7[_0xea43('0x2f')]!==_0xea43('0x32')){_0x184df7[_0xea43('0x33')]=[_0x184df7['interval']];}else{_0x184df7[_0xea43('0x33')]=_0x184df7[_0xea43('0x30')]?_[_0xea43('0x34')](_['filter'](_0x2b7ba4,{'IntervalId':_0x184df7[_0xea43('0x30')]}),_0xea43('0x2f')):[];}_0x184df7['context']=_0x108fb2[_0xea43('0x5')];_0x184df7['exten']=_0x108fb2[_0xea43('0xb')];if(_0x184df7[_0xea43('0x2')])_0x184df7[_0xea43('0x2')]=_0x184df7[_0xea43('0x2')]['toLowerCase']();if(_0x108fb2[_0xea43('0x2')]===_0xea43('0xe')){if(_0x184df7[_0xea43('0x35')](_0xea43('0x36'))&&_0x184df7[_0xea43('0x36')]&&_0x184df7[_0xea43('0x36')]!=='--'){_0x4ae6b0[_0xea43('0x19')]({'type':_0x184df7[_0xea43('0x2')][_0xea43('0x37')](),'app':'Set','appdata':'CDR(tag)='+_0x184df7['tag'],'context':_0x108fb2[_0xea43('0x5')],'exten':_0x108fb2['exten'],'priority':_0x184df7[_0xea43('0x33')][_0xea43('0x22')]+_0x3f2428+_0x14217a++,'VoiceExtensionId':_0x108fb2['id']});}_0x4ae6b0[_0xea43('0x19')]({'type':_0x184df7['type'][_0xea43('0x37')](),'app':'ExecIf','appdata':_0xea43('0x38')+(_0x184df7[_0xea43('0x39')]?_0xea43('0x3a')+_0x184df7['callerID']+')':_0xea43('0x3b')),'context':_0x108fb2[_0xea43('0x5')],'exten':_0x108fb2[_0xea43('0xb')],'priority':_0x184df7[_0xea43('0x33')][_0xea43('0x22')]+_0x3f2428+_0x14217a++,'VoiceExtensionId':_0x108fb2['id']});}else{if(_0x184df7[_0xea43('0x35')](_0xea43('0x3c'))){if(['queue',_0xea43('0x3d')]['includes'](_0x184df7['app'][_0xea43('0x37')]())&&_0x184df7['appType']!==_0xea43('0x3e')){if(_0x184df7[_0xea43('0x3c')]){_0x4ae6b0[_0xea43('0x19')]({'type':_0x184df7[_0xea43('0x2')]['toLowerCase'](),'app':_0xea43('0x13'),'appdata':_0xea43('0x3f'),'context':_0x108fb2[_0xea43('0x5')],'exten':_0x108fb2[_0xea43('0xb')],'priority':_0x184df7[_0xea43('0x33')]['length']+_0x3f2428+_0x14217a++,'VoiceExtensionId':_0x108fb2['id']});_0x4ae6b0[_0xea43('0x19')]({'type':_0x184df7[_0xea43('0x2')][_0xea43('0x37')](),'app':_0xea43('0x3'),'appdata':_0xea43('0x40'),'context':_0x108fb2['context'],'exten':_0x108fb2[_0xea43('0xb')],'priority':_0x184df7[_0xea43('0x33')][_0xea43('0x22')]+_0x3f2428+_0x14217a++,'VoiceExtensionId':_0x108fb2['id']});}else{_0x4ae6b0[_0xea43('0x19')]({'type':_0x184df7['type'][_0xea43('0x37')](),'app':_0xea43('0x13'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x108fb2[_0xea43('0x5')],'exten':_0x108fb2[_0xea43('0xb')],'priority':_0x184df7[_0xea43('0x33')][_0xea43('0x22')]+_0x3f2428+_0x14217a++,'VoiceExtensionId':_0x108fb2['id']});_0x4ae6b0['push']({'type':_0x184df7[_0xea43('0x2')]['toLowerCase'](),'app':_0xea43('0x3'),'appdata':_0xea43('0x41'),'context':_0x108fb2[_0xea43('0x5')],'exten':_0x108fb2[_0xea43('0xb')],'priority':_0x184df7[_0xea43('0x33')][_0xea43('0x22')]+_0x3f2428+_0x14217a++,'VoiceExtensionId':_0x108fb2['id']});}}}}for(var _0x48e894=0x0;_0x48e894<_0x184df7[_0xea43('0x33')][_0xea43('0x22')];_0x48e894++){var _0x18d73a=_0x3f2428+_0x184df7[_0xea43('0x33')]['length'];var _0x30cd1c=_0x48e894===_0x184df7[_0xea43('0x33')][_0xea43('0x22')]-0x1?_0x3f2428+_0x4ae6b0['length']+_0x47f6d1[_0xea43('0x22')]+0x2:_0x3f2428+_0x48e894+0x1;_0x4ae6b0[_0xea43('0x42')](_0x48e894,0x0,{'type':_0x108fb2[_0xea43('0x2')],'app':_0xea43('0x43'),'appdata':_0x184df7[_0xea43('0x33')][_0x48e894]+'?'+_0x108fb2[_0xea43('0x5')]+',${EXTEN},'+_0x18d73a+':'+_0x108fb2[_0xea43('0x5')]+_0xea43('0x44')+_0x30cd1c,'exten':_0x108fb2[_0xea43('0xb')],'context':_0x108fb2[_0xea43('0x5')],'priority':_0x3f2428+_0x48e894,'VoiceExtensionId':_0x108fb2['id']});}if(_0x184df7[_0xea43('0x45')]===_0xea43('0x46')){_0x184df7[_0xea43('0x47')]=_0x262a81(_0x108fb2,_0x184df7['appdata']);}if(_0x184df7[_0xea43('0x45')]===_0xea43('0x48')){_0x4ae6b0[_0xea43('0x19')]({'type':_0x184df7[_0xea43('0x2')][_0xea43('0x37')](),'app':'Set','appdata':_0xea43('0x49'),'context':_0x108fb2[_0xea43('0x5')],'exten':_0x108fb2['exten'],'priority':_0x184df7['intervals'][_0xea43('0x22')]+_0x3f2428+_0x14217a++,'VoiceExtensionId':_0x108fb2['id']});}_0x184df7['priority']=_0x4ae6b0[_0xea43('0x22')]?_[_0xea43('0x4a')](_0x4ae6b0)[_0xea43('0x4b')]+0x1:_0x3f2428;_0x389cdf=_[_0xea43('0x4c')](_0x389cdf,_0x4ae6b0,[_0x184df7],_0x47f6d1);_0x3f2428=_['last'](_0x389cdf)[_0xea43('0x4b')]+0x1;}return _0x11fa44(_0x389cdf);})[_0xea43('0x4d')](function(_0xdf0b81){_0xbd5c47(_0xdf0b81);});});}return _0x4ea9f2[_0xea43('0x4e')](_0xea43('0x4f'),attributes,{'tableName':_0xea43('0x50'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x5b62bb){var _0x4e5d48=this[_0xea43('0x51')]({'plain':!![]});var _0x52d9f6=_0x4e5d48[_0xea43('0x2')]===_0xea43('0xe')?_0x58768a(_0x4e5d48):_0x1f21e3(_0x4e5d48);return _0x1b4b74(_0x4e5d48,_0x5b62bb,_[_0xea43('0x4a')](_0x52d9f6)[_0xea43('0x4b')]+0x1)[_0xea43('0x31')](function(_0x4045e6){var _0x34d637=_[_0xea43('0x4c')](_0x52d9f6,_0x4045e6);_0x34d637[_0xea43('0x19')]({'type':_0x4e5d48[_0xea43('0x2')],'app':'Hangup','exten':_0x4e5d48['exten'],'context':_0x4e5d48[_0xea43('0x5')],'priority':_[_0xea43('0x4a')](_0x34d637)[_0xea43('0x4b')]+0x1,'VoiceExtensionId':_0x4e5d48['id']});return _0x34d637;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index a3138be..f2ea2cc 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 _0x8e20=['socket.io-emitter','./voiceExtension.socket','register','request','then','request\x20sent','error','code','message','info','VoiceExtension,\x20%s,\x20%s','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','where','attributes','include','map','model','debug','stringify','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8e20,0x1af));var _0x08e2=function(_0x4c1ec2,_0x4f42b7){_0x4c1ec2=_0x4c1ec2-0x0;var _0x3f6f1c=_0x8e20[_0x4c1ec2];return _0x3f6f1c;};'use strict';var _=require(_0x08e2('0x0'));var util=require(_0x08e2('0x1'));var moment=require(_0x08e2('0x2'));var BPromise=require('bluebird');var rs=require(_0x08e2('0x3'));var fs=require('fs');var Redis=require(_0x08e2('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x08e2('0x5'));var logger=require(_0x08e2('0x6'))(_0x08e2('0x7'));var config=require(_0x08e2('0x8'));var jayson=require(_0x08e2('0x9'));var client=jayson['client'][_0x08e2('0xa')]({'port':0x232a});config[_0x08e2('0xb')]=_['defaults'](config[_0x08e2('0xb')],{'host':_0x08e2('0xc'),'port':0x18eb});var socket=require(_0x08e2('0xd'))(new Redis(config[_0x08e2('0xb')]));require(_0x08e2('0xe'))[_0x08e2('0xf')](socket);function respondWithRpcPromise(_0x59365f,_0x127f5f,_0x4eb644){return new BPromise(function(_0x4b66b8,_0x1ae554){return client[_0x08e2('0x10')](_0x59365f,_0x4eb644)[_0x08e2('0x11')](function(_0x2538c8){logger['info']('VoiceExtension,\x20%s,\x20%s',_0x127f5f,_0x08e2('0x12'));logger['debug']('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x127f5f,_0x08e2('0x12'),JSON['stringify'](_0x2538c8));if(_0x2538c8[_0x08e2('0x13')]){if(_0x2538c8['error'][_0x08e2('0x14')]===0x1f4){logger['error']('VoiceExtension,\x20%s,\x20%s',_0x127f5f,_0x2538c8['error'][_0x08e2('0x15')]);return _0x1ae554(_0x2538c8[_0x08e2('0x13')][_0x08e2('0x15')]);}logger['error']('VoiceExtension,\x20%s,\x20%s',_0x127f5f,_0x2538c8['error']['message']);return _0x4b66b8(_0x2538c8['error']['message']);}else{logger[_0x08e2('0x16')](_0x08e2('0x17'),_0x127f5f,_0x08e2('0x12'));_0x4b66b8(_0x2538c8[_0x08e2('0x18')][_0x08e2('0x15')]);}})[_0x08e2('0x19')](function(_0x38f6d1){logger[_0x08e2('0x13')](_0x08e2('0x17'),_0x127f5f,_0x38f6d1);_0x1ae554(_0x38f6d1);});});}exports[_0x08e2('0x1a')]=function(_0x2384a3){var _0x5d1568=this;return new Promise(function(_0x5e3cba,_0x52787e){return db[_0x08e2('0x1b')][_0x08e2('0x1c')]({'raw':_0x2384a3['options']?_0x2384a3[_0x08e2('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x2384a3[_0x08e2('0x1d')]?_0x2384a3['options'][_0x08e2('0x1e')]||null:null,'attributes':_0x2384a3[_0x08e2('0x1d')]?_0x2384a3[_0x08e2('0x1d')][_0x08e2('0x1f')]||null:null,'limit':_0x2384a3[_0x08e2('0x1d')]?_0x2384a3['options']['limit']||null:null,'include':_0x2384a3['options']?_0x2384a3[_0x08e2('0x1d')][_0x08e2('0x20')]?_[_0x08e2('0x21')](_0x2384a3[_0x08e2('0x1d')][_0x08e2('0x20')],function(_0x4dbf2c){return{'model':db[_0x4dbf2c['model']],'as':_0x4dbf2c['as'],'attributes':_0x4dbf2c[_0x08e2('0x1f')],'include':_0x4dbf2c[_0x08e2('0x20')]?_[_0x08e2('0x21')](_0x4dbf2c[_0x08e2('0x20')],function(_0x4d1b29){return{'model':db[_0x4d1b29[_0x08e2('0x22')]],'as':_0x4d1b29['as'],'attributes':_0x4d1b29['attributes'],'include':_0x4d1b29[_0x08e2('0x20')]?_[_0x08e2('0x21')](_0x4d1b29[_0x08e2('0x20')],function(_0x5cdfb2){return{'model':db[_0x5cdfb2[_0x08e2('0x22')]],'as':_0x5cdfb2['as'],'attributes':_0x5cdfb2[_0x08e2('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x08e2('0x11')](function(_0x24a633){logger['info'](_0x08e2('0x1a'),_0x2384a3);logger[_0x08e2('0x23')](_0x08e2('0x1a'),_0x2384a3,JSON[_0x08e2('0x24')](_0x24a633));_0x5e3cba(_0x24a633);})['catch'](function(_0x2ab732){logger[_0x08e2('0x13')]('GetVoiceExtension',_0x2ab732[_0x08e2('0x15')],_0x2384a3);_0x52787e(_0x5d1568['error'](0x1f4,_0x2ab732['message']));});});}; \ No newline at end of file +var _0x8ad5=['GetVoiceExtension','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','request','then','info','VoiceExtension,\x20%s,\x20%s','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','VoiceExtension','findAll','options','raw','where','attributes','limit','include','map','model'];(function(_0xbc9524,_0x4b0850){var _0x25cef2=function(_0x5f38da){while(--_0x5f38da){_0xbc9524['push'](_0xbc9524['shift']());}};_0x25cef2(++_0x4b0850);}(_0x8ad5,0xf1));var _0x58ad=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x8ad5[_0x37bd26];return _0xe83dc4;};'use strict';var _=require(_0x58ad('0x0'));var util=require(_0x58ad('0x1'));var moment=require(_0x58ad('0x2'));var BPromise=require(_0x58ad('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x58ad('0x4'))['db'];var utils=require(_0x58ad('0x5'));var logger=require(_0x58ad('0x6'))(_0x58ad('0x7'));var config=require(_0x58ad('0x8'));var jayson=require(_0x58ad('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x58ad('0xa')]=_[_0x58ad('0xb')](config[_0x58ad('0xa')],{'host':_0x58ad('0xc'),'port':0x18eb});var socket=require(_0x58ad('0xd'))(new Redis(config[_0x58ad('0xa')]));require(_0x58ad('0xe'))[_0x58ad('0xf')](socket);function respondWithRpcPromise(_0x6035c7,_0x4da7e4,_0xd8b943){return new BPromise(function(_0x127aea,_0x3d2e5a){return client[_0x58ad('0x10')](_0x6035c7,_0xd8b943)[_0x58ad('0x11')](function(_0x3f1c00){logger[_0x58ad('0x12')](_0x58ad('0x13'),_0x4da7e4,'request\x20sent');logger[_0x58ad('0x14')](_0x58ad('0x15'),_0x4da7e4,_0x58ad('0x16'),JSON[_0x58ad('0x17')](_0x3f1c00));if(_0x3f1c00[_0x58ad('0x18')]){if(_0x3f1c00[_0x58ad('0x18')][_0x58ad('0x19')]===0x1f4){logger[_0x58ad('0x18')]('VoiceExtension,\x20%s,\x20%s',_0x4da7e4,_0x3f1c00['error']['message']);return _0x3d2e5a(_0x3f1c00['error'][_0x58ad('0x1a')]);}logger['error'](_0x58ad('0x13'),_0x4da7e4,_0x3f1c00[_0x58ad('0x18')][_0x58ad('0x1a')]);return _0x127aea(_0x3f1c00[_0x58ad('0x18')][_0x58ad('0x1a')]);}else{logger['info'](_0x58ad('0x13'),_0x4da7e4,_0x58ad('0x16'));_0x127aea(_0x3f1c00[_0x58ad('0x1b')][_0x58ad('0x1a')]);}})[_0x58ad('0x1c')](function(_0x38de51){logger[_0x58ad('0x18')](_0x58ad('0x13'),_0x4da7e4,_0x38de51);_0x3d2e5a(_0x38de51);});});}exports['GetVoiceExtension']=function(_0x3266d9){var _0x422ee4=this;return new Promise(function(_0x40f899,_0x5e4ff8){return db[_0x58ad('0x1d')][_0x58ad('0x1e')]({'raw':_0x3266d9[_0x58ad('0x1f')]?_0x3266d9['options'][_0x58ad('0x20')]===undefined?!![]:![]:!![],'where':_0x3266d9[_0x58ad('0x1f')]?_0x3266d9[_0x58ad('0x1f')][_0x58ad('0x21')]||null:null,'attributes':_0x3266d9['options']?_0x3266d9[_0x58ad('0x1f')][_0x58ad('0x22')]||null:null,'limit':_0x3266d9[_0x58ad('0x1f')]?_0x3266d9[_0x58ad('0x1f')][_0x58ad('0x23')]||null:null,'include':_0x3266d9[_0x58ad('0x1f')]?_0x3266d9[_0x58ad('0x1f')][_0x58ad('0x24')]?_['map'](_0x3266d9[_0x58ad('0x1f')]['include'],function(_0x3de31f){return{'model':db[_0x3de31f['model']],'as':_0x3de31f['as'],'attributes':_0x3de31f['attributes'],'include':_0x3de31f[_0x58ad('0x24')]?_[_0x58ad('0x25')](_0x3de31f[_0x58ad('0x24')],function(_0x10efb3){return{'model':db[_0x10efb3[_0x58ad('0x26')]],'as':_0x10efb3['as'],'attributes':_0x10efb3[_0x58ad('0x22')],'include':_0x10efb3[_0x58ad('0x24')]?_[_0x58ad('0x25')](_0x10efb3[_0x58ad('0x24')],function(_0x167485){return{'model':db[_0x167485[_0x58ad('0x26')]],'as':_0x167485['as'],'attributes':_0x167485['attributes']};}):[]};}):[]};}):[]:[]})[_0x58ad('0x11')](function(_0x3b4a38){logger[_0x58ad('0x12')](_0x58ad('0x27'),_0x3266d9);logger[_0x58ad('0x14')]('GetVoiceExtension',_0x3266d9,JSON[_0x58ad('0x17')](_0x3b4a38));_0x40f899(_0x3b4a38);})[_0x58ad('0x1c')](function(_0x3850d4){logger[_0x58ad('0x18')](_0x58ad('0x27'),_0x3850d4['message'],_0x3266d9);_0x5e4ff8(_0x422ee4['error'](0x1f4,_0x3850d4[_0x58ad('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index b60882e..82d7948 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(_0x1fc75a,_0x12c345){var _0x4062c6=function(_0x16ec68){while(--_0x16ec68){_0x1fc75a['push'](_0x1fc75a['shift']());}};_0x4062c6(++_0x12c345);}(_0xf494,0x1c6));var _0x4f49=function(_0x9bfc04,_0x1088c6){_0x9bfc04=_0x9bfc04-0x0;var _0x1554b9=_0xf494[_0x9bfc04];return _0x1554b9;};'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 _0xabce=['voiceExtension:','./voiceExtension.events','save','remove','update','emit'];(function(_0x5e45f2,_0x47d0c7){var _0x1d175f=function(_0x5714a4){while(--_0x5714a4){_0x5e45f2['push'](_0x5e45f2['shift']());}};_0x1d175f(++_0x47d0c7);}(_0xabce,0x103));var _0xeabc=function(_0x34021d,_0x753aa6){_0x34021d=_0x34021d-0x0;var _0x16597b=_0xabce[_0x34021d];return _0x16597b;};'use strict';var VoiceExtensionEvents=require(_0xeabc('0x0'));var events=[_0xeabc('0x1'),_0xeabc('0x2'),_0xeabc('0x3')];function createListener(_0x49dbcc,_0x5bd1a4){return function(_0x5ebc95){_0x5bd1a4[_0xeabc('0x4')](_0x49dbcc,_0x5ebc95);};}function removeListener(_0x1d9f37,_0x1a88a7){return function(){VoiceExtensionEvents['removeListener'](_0x1d9f37,_0x1a88a7);};}exports['register']=function(_0x1b07a8){for(var _0x52a4d7=0x0,_0x229ba4=events['length'];_0x52a4d7<_0x229ba4;_0x52a4d7++){var _0x3bdc29=events[_0x52a4d7];var _0x9417af=createListener(_0xeabc('0x5')+_0x3bdc29,_0x1b07a8);VoiceExtensionEvents['on'](_0x3bdc29,_0x9417af);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 2b41595..1dc072b 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 _0x8ace=['isAuthenticated','index','/:id','/:id/messages','getMessages','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get'];(function(_0x58fc2f,_0x111399){var _0x3a1312=function(_0x3d2ff2){while(--_0x3d2ff2){_0x58fc2f['push'](_0x58fc2f['shift']());}};_0x3a1312(++_0x111399);}(_0x8ace,0x1bc));var _0xe8ac=function(_0x51e347,_0x1b565a){_0x51e347=_0x51e347-0x0;var _0x49ab46=_0x8ace[_0x51e347];return _0x49ab46;};'use strict';var multer=require(_0xe8ac('0x0'));var util=require(_0xe8ac('0x1'));var path=require(_0xe8ac('0x2'));var timeout=require(_0xe8ac('0x3'));var express=require(_0xe8ac('0x4'));var router=express[_0xe8ac('0x5')]();var fs_extra=require(_0xe8ac('0x6'));var auth=require(_0xe8ac('0x7'));var interaction=require(_0xe8ac('0x8'));var config=require(_0xe8ac('0x9'));var controller=require(_0xe8ac('0xa'));router[_0xe8ac('0xb')]('/',auth[_0xe8ac('0xc')](),controller[_0xe8ac('0xd')]);router['get'](_0xe8ac('0xe'),auth[_0xe8ac('0xc')](),controller['show']);router['get'](_0xe8ac('0xf'),auth['isAuthenticated'](),controller[_0xe8ac('0x10')]);router[_0xe8ac('0x11')]('/',auth[_0xe8ac('0xc')](),controller[_0xe8ac('0x12')]);router[_0xe8ac('0x13')](_0xe8ac('0xe'),auth['isAuthenticated'](),controller[_0xe8ac('0x14')]);router[_0xe8ac('0x15')](_0xe8ac('0xe'),auth['isAuthenticated'](),controller[_0xe8ac('0x16')]);module[_0xe8ac('0x17')]=router; \ No newline at end of file +var _0x687b=['../../components/interaction/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','index','/:id','show','getMessages','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x4fa915,_0x58829d){var _0x2e5d2c=function(_0x220a22){while(--_0x220a22){_0x4fa915['push'](_0x4fa915['shift']());}};_0x2e5d2c(++_0x58829d);}(_0x687b,0x14a));var _0xb687=function(_0x130719,_0x2a7018){_0x130719=_0x130719-0x0;var _0x159865=_0x687b[_0x130719];return _0x159865;};'use strict';var multer=require(_0xb687('0x0'));var util=require(_0xb687('0x1'));var path=require(_0xb687('0x2'));var timeout=require(_0xb687('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xb687('0x4'));var auth=require(_0xb687('0x5'));var interaction=require(_0xb687('0x6'));var config=require(_0xb687('0x7'));var controller=require(_0xb687('0x8'));router[_0xb687('0x9')]('/',auth[_0xb687('0xa')](),controller[_0xb687('0xb')]);router[_0xb687('0x9')](_0xb687('0xc'),auth['isAuthenticated'](),controller[_0xb687('0xd')]);router[_0xb687('0x9')]('/:id/messages',auth[_0xb687('0xa')](),controller[_0xb687('0xe')]);router[_0xb687('0xf')]('/',auth[_0xb687('0xa')](),controller[_0xb687('0x10')]);router[_0xb687('0x11')](_0xb687('0xc'),auth[_0xb687('0xa')](),controller[_0xb687('0x12')]);router['delete'](_0xb687('0xc'),auth[_0xb687('0xa')](),controller[_0xb687('0x13')]);module[_0xb687('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 b0c14b3..ddbaa50 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 _0x8274=['TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','sequelize','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','ENUM','yes'];(function(_0x3d4c6f,_0x443db6){var _0x451178=function(_0x35216d){while(--_0x35216d){_0x3d4c6f['push'](_0x3d4c6f['shift']());}};_0x451178(++_0x443db6);}(_0x8274,0x1b8));var _0x4827=function(_0x2b37b9,_0x42777d){_0x2b37b9=_0x2b37b9-0x0;var _0x1c525b=_0x8274[_0x2b37b9];return _0x1c525b;};'use strict';var Sequelize=require(_0x4827('0x0'));module['exports']={'customer_id':{'type':Sequelize[_0x4827('0x1')]},'context':{'type':Sequelize[_0x4827('0x1')],'defaultValue':_0x4827('0x2'),'unique':_0x4827('0x3')},'mailbox':{'type':Sequelize[_0x4827('0x1')],'defaultValue':'','allowNull':![],'unique':_0x4827('0x3')},'password':{'type':Sequelize[_0x4827('0x1')]},'fullname':{'type':Sequelize[_0x4827('0x1')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x435d18){this[_0x4827('0x4')](_0x4827('0x5'),typeof _0x435d18===_0x4827('0x6')&&_0x435d18[_0x4827('0x7')]()?_0x435d18[_0x4827('0x7')]():null);}},'pager':{'type':Sequelize[_0x4827('0x1')]},'tz':{'type':Sequelize[_0x4827('0x1')],'defaultValue':'central'},'attach':{'type':Sequelize[_0x4827('0x8')]('yes','no'),'defaultValue':_0x4827('0x9'),'allowNull':![]},'saycid':{'type':Sequelize[_0x4827('0x8')]('yes','no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0x4827('0x1')]},'callback':{'type':Sequelize[_0x4827('0x1')]},'review':{'type':Sequelize[_0x4827('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x4827('0x8')](_0x4827('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0x4827('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x4827('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x4827('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0x4827('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x4827('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x4827('0x8')](_0x4827('0x9'),'no'),'defaultValue':_0x4827('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0x4827('0x8')](_0x4827('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x4827('0x8')](_0x4827('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0x4827('0x9'),'no'),'defaultValue':_0x4827('0x9'),'allowNull':![]},'stamp':{'type':_0x4827('0xb')},'emailsubject':{'type':Sequelize[_0x4827('0x1')]},'emailbody':{'type':Sequelize[_0x4827('0x1')]},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x4827('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x4827('0xd')],'get':function(){return this[_0x4827('0xe')](_0x4827('0xf'))+_0x4827('0x10')+this['getDataValue'](_0x4827('0x11'));}}}; \ No newline at end of file +var _0xd4c3=['TIMESTAMP','INTEGER','getDataValue','\x20-\x20','mailbox','exports','STRING','contest_mailbox','setDataValue','email','string','trim','central','ENUM','yes','TINYINT(4)'];(function(_0x9f711e,_0x1e39b5){var _0x151b76=function(_0x27ed09){while(--_0x27ed09){_0x9f711e['push'](_0x9f711e['shift']());}};_0x151b76(++_0x1e39b5);}(_0xd4c3,0x105));var _0x3d4c=function(_0x2bfd4f,_0x1bbf2c){_0x2bfd4f=_0x2bfd4f-0x0;var _0x341849=_0xd4c3[_0x2bfd4f];return _0x341849;};'use strict';var Sequelize=require('sequelize');module[_0x3d4c('0x0')]={'customer_id':{'type':Sequelize[_0x3d4c('0x1')]},'context':{'type':Sequelize[_0x3d4c('0x1')],'defaultValue':'from-voicemail','unique':_0x3d4c('0x2')},'mailbox':{'type':Sequelize[_0x3d4c('0x1')],'defaultValue':'','allowNull':![],'unique':_0x3d4c('0x2')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0x3d4c('0x1')]},'email':{'type':Sequelize[_0x3d4c('0x1')],'validate':{'isEmail':!![]},'set':function(_0x2161ab){this[_0x3d4c('0x3')](_0x3d4c('0x4'),typeof _0x2161ab===_0x3d4c('0x5')&&_0x2161ab[_0x3d4c('0x6')]()?_0x2161ab[_0x3d4c('0x6')]():null);}},'pager':{'type':Sequelize[_0x3d4c('0x1')]},'tz':{'type':Sequelize[_0x3d4c('0x1')],'defaultValue':_0x3d4c('0x7')},'attach':{'type':Sequelize[_0x3d4c('0x8')]('yes','no'),'defaultValue':_0x3d4c('0x9'),'allowNull':![]},'saycid':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x3d4c('0x9'),'allowNull':![]},'dialout':{'type':Sequelize[_0x3d4c('0x1')]},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x3d4c('0x8')](_0x3d4c('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x3d4c('0x8')](_0x3d4c('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x3d4c('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x3d4c('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x3d4c('0x8')](_0x3d4c('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x3d4c('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0x3d4c('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x3d4c('0x8')](_0x3d4c('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x3d4c('0x8')](_0x3d4c('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0x3d4c('0xb')},'emailsubject':{'type':Sequelize[_0x3d4c('0x1')]},'emailbody':{'type':Sequelize[_0x3d4c('0x1')]},'maxsecs':{'type':Sequelize[_0x3d4c('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x3d4c('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x3d4c('0xd')]('fullname')+_0x3d4c('0xe')+this[_0x3d4c('0xd')](_0x3d4c('0xf'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index c9ebba0..ffb11d4 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 _0xa74f=['ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','offset','undefined','limit','count','set','json','reject','save','destroy','then','Voicemails','UserProfileResource','error','stack','send','map','VoiceMail','rawAttributes','fieldName','type','key','model','name','query','intersection','attributes','fields','length','order','sort','where','filters','pick','filter','merge','VIRTUAL','rows','catch','show','params','keys','include','find','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','findOne','VoiceMailMessage','hasOwnProperty','nolimit','mailbox','options','findAndCountAll','zip-dir','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x3af438,_0x12ff38){var _0x15497b=function(_0x3edf83){while(--_0x3edf83){_0x3af438['push'](_0x3af438['shift']());}};_0x15497b(++_0x12ff38);}(_0xa74f,0x9a));var _0xfa74=function(_0x495e9f,_0x1b1d80){_0x495e9f=_0x495e9f-0x0;var _0xb249d2=_0xa74f[_0x495e9f];return _0xb249d2;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xfa74('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xfa74('0x1'));var BPromise=require(_0xfa74('0x2'));var Mustache=require(_0xfa74('0x3'));var util=require(_0xfa74('0x4'));var path=require('path');var sox=require(_0xfa74('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfa74('0x6'));var _=require(_0xfa74('0x7'));var squel=require(_0xfa74('0x8'));var crypto=require(_0xfa74('0x9'));var jsforce=require(_0xfa74('0xa'));var deskjs=require(_0xfa74('0xb'));var toCsv=require('to-csv');var querystring=require(_0xfa74('0xc'));var Papa=require(_0xfa74('0xd'));var Redis=require(_0xfa74('0xe'));var authService=require(_0xfa74('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xfa74('0x10'));var hardwareService=require(_0xfa74('0x11'));var logger=require('../../config/logger')(_0xfa74('0x12'));var utils=require(_0xfa74('0x13'));var config=require(_0xfa74('0x14'));var licenseUtil=require(_0xfa74('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x23591a,_0x998585){_0x998585=_0x998585||0xcc;return function(_0x78173f){if(_0x78173f){return _0x23591a[_0xfa74('0x16')](_0x998585);}return _0x23591a['status'](_0x998585)[_0xfa74('0x17')]();};}function respondWithResult(_0x33cda3,_0x3eb49b){_0x3eb49b=_0x3eb49b||0xc8;return function(_0x3947ca){if(_0x3947ca){return _0x33cda3[_0xfa74('0x18')](_0x3eb49b)['json'](_0x3947ca);}};}function respondWithFilteredResult(_0x199d20,_0x13d911){return function(_0x947da6){if(_0x947da6){var _0x1f1de0=typeof _0x13d911[_0xfa74('0x19')]===_0xfa74('0x1a')&&typeof _0x13d911[_0xfa74('0x1b')]==='undefined';var _0x58a67a=_0x947da6[_0xfa74('0x1c')];var _0x51dda1=_0x1f1de0?0x0:_0x13d911['offset'];var _0x31d3c1=_0x1f1de0?_0x947da6[_0xfa74('0x1c')]:_0x13d911[_0xfa74('0x19')]+_0x13d911['limit'];var _0x3bede6;if(_0x31d3c1>=_0x58a67a){_0x31d3c1=_0x58a67a;_0x3bede6=0xc8;}else{_0x3bede6=0xce;}_0x199d20[_0xfa74('0x18')](_0x3bede6);return _0x199d20[_0xfa74('0x1d')]('Content-Range',_0x51dda1+'-'+_0x31d3c1+'/'+_0x58a67a)[_0xfa74('0x1e')](_0x947da6);}return null;};}function patchUpdates(_0x302eb4){return function(_0x2e6c33){try{jsonpatch['apply'](_0x2e6c33,_0x302eb4,!![]);}catch(_0x5466ca){return BPromise[_0xfa74('0x1f')](_0x5466ca);}return _0x2e6c33[_0xfa74('0x20')]();};}function saveUpdates(_0x9932db,_0xeaaa19){return function(_0x1a453d){if(_0x1a453d){return _0x1a453d['update'](_0x9932db)['then'](function(_0x3721bf){return _0x3721bf;});}return null;};}function removeEntity(_0x5aa8a7,_0x48cbd3){return function(_0x529810){if(_0x529810){return _0x529810[_0xfa74('0x21')]()[_0xfa74('0x22')](function(){var _0x42d9bf=_0x529810['get']({'plain':!![]});var _0x530f99=_0xfa74('0x23');return db[_0xfa74('0x24')]['destroy']({'where':{'type':_0x530f99,'resourceId':_0x42d9bf['id']}})[_0xfa74('0x22')](function(){return _0x529810;});})['then'](function(){_0x5aa8a7[_0xfa74('0x18')](0xcc)[_0xfa74('0x17')]();});}};}function handleEntityNotFound(_0x55d8e4,_0x298388){return function(_0x1130de){if(!_0x1130de){_0x55d8e4[_0xfa74('0x16')](0x194);}return _0x1130de;};}function handleError(_0x218c86,_0x4f7337){_0x4f7337=_0x4f7337||0x1f4;return function(_0xd9c55d){logger[_0xfa74('0x25')](_0xd9c55d[_0xfa74('0x26')]);if(_0xd9c55d['name']){delete _0xd9c55d['name'];}_0x218c86[_0xfa74('0x18')](_0x4f7337)[_0xfa74('0x27')](_0xd9c55d);};}exports['index']=function(_0x4b38fc,_0x343466){var _0x564060={},_0x2238d4={},_0x4d6d0a={'count':0x0,'rows':[]};var _0x363173=_[_0xfa74('0x28')](db[_0xfa74('0x29')][_0xfa74('0x2a')],function(_0x4c506f){return{'name':_0x4c506f[_0xfa74('0x2b')],'type':_0x4c506f[_0xfa74('0x2c')][_0xfa74('0x2d')]};});_0x2238d4[_0xfa74('0x2e')]=_[_0xfa74('0x28')](_0x363173,_0xfa74('0x2f'));_0x2238d4[_0xfa74('0x30')]=_['keys'](_0x4b38fc[_0xfa74('0x30')]);_0x2238d4['filters']=_[_0xfa74('0x31')](_0x2238d4[_0xfa74('0x2e')],_0x2238d4[_0xfa74('0x30')]);_0x564060[_0xfa74('0x32')]=_['intersection'](_0x2238d4['model'],qs[_0xfa74('0x33')](_0x4b38fc[_0xfa74('0x30')][_0xfa74('0x33')]));_0x564060[_0xfa74('0x32')]=_0x564060['attributes'][_0xfa74('0x34')]?_0x564060[_0xfa74('0x32')]:_0x2238d4['model'];if(!_0x4b38fc['query']['hasOwnProperty']('nolimit')){_0x564060['limit']=qs[_0xfa74('0x1b')](_0x4b38fc[_0xfa74('0x30')][_0xfa74('0x1b')]);_0x564060[_0xfa74('0x19')]=qs[_0xfa74('0x19')](_0x4b38fc[_0xfa74('0x30')][_0xfa74('0x19')]);}_0x564060[_0xfa74('0x35')]=qs[_0xfa74('0x36')](_0x4b38fc['query'][_0xfa74('0x36')]);_0x564060[_0xfa74('0x37')]=qs[_0xfa74('0x38')](_[_0xfa74('0x39')](_0x4b38fc[_0xfa74('0x30')],_0x2238d4[_0xfa74('0x38')]),_0x363173);if(_0x4b38fc['query'][_0xfa74('0x3a')]){_0x564060[_0xfa74('0x37')]=_[_0xfa74('0x3b')](_0x564060[_0xfa74('0x37')],{'$or':_['map'](_0x363173,function(_0x207566){if(_0x207566[_0xfa74('0x2c')]!==_0xfa74('0x3c')){var _0x35f252={};_0x35f252[_0x207566['name']]={'$like':'%'+_0x4b38fc[_0xfa74('0x30')][_0xfa74('0x3a')]+'%'};return _0x35f252;}})});}_0x564060=_[_0xfa74('0x3b')]({},_0x564060,_0x4b38fc['options']);var _0x5d32bc={'where':_0x564060[_0xfa74('0x37')]};return db[_0xfa74('0x29')][_0xfa74('0x1c')](_0x5d32bc)[_0xfa74('0x22')](function(_0x55f4e3){_0x4d6d0a[_0xfa74('0x1c')]=_0x55f4e3;if(_0x4b38fc[_0xfa74('0x30')]['includeAll']){_0x564060['include']=[{'all':!![]}];}return db['VoiceMail']['findAll'](_0x564060);})[_0xfa74('0x22')](function(_0x3098ca){_0x4d6d0a[_0xfa74('0x3d')]=_0x3098ca;return _0x4d6d0a;})[_0xfa74('0x22')](respondWithFilteredResult(_0x343466,_0x564060))[_0xfa74('0x3e')](handleError(_0x343466,null));};exports[_0xfa74('0x3f')]=function(_0x7735c5,_0x5aac45){var _0x274062={'raw':!![],'where':{'id':_0x7735c5[_0xfa74('0x40')]['id']}},_0x3938c1={};_0x3938c1[_0xfa74('0x2e')]=_[_0xfa74('0x41')](db['VoiceMail'][_0xfa74('0x2a')]);_0x3938c1[_0xfa74('0x30')]=_[_0xfa74('0x41')](_0x7735c5[_0xfa74('0x30')]);_0x3938c1[_0xfa74('0x38')]=_[_0xfa74('0x31')](_0x3938c1[_0xfa74('0x2e')],_0x3938c1[_0xfa74('0x30')]);_0x274062[_0xfa74('0x32')]=_[_0xfa74('0x31')](_0x3938c1['model'],qs[_0xfa74('0x33')](_0x7735c5['query'][_0xfa74('0x33')]));_0x274062[_0xfa74('0x32')]=_0x274062[_0xfa74('0x32')][_0xfa74('0x34')]?_0x274062['attributes']:_0x3938c1[_0xfa74('0x2e')];if(_0x7735c5[_0xfa74('0x30')]['includeAll']){_0x274062[_0xfa74('0x42')]=[{'all':!![]}];}_0x274062=_[_0xfa74('0x3b')]({},_0x274062,_0x7735c5['options']);return db[_0xfa74('0x29')][_0xfa74('0x43')](_0x274062)[_0xfa74('0x22')](handleEntityNotFound(_0x5aac45,null))[_0xfa74('0x22')](respondWithResult(_0x5aac45,null))[_0xfa74('0x3e')](handleError(_0x5aac45,null));};exports['create']=function(_0x54e06c,_0x36f6ca){return db[_0xfa74('0x29')]['create'](_0x54e06c[_0xfa74('0x44')],{})[_0xfa74('0x22')](function(_0x3100f2){var _0x4ca49e=_0x54e06c['user'][_0xfa74('0x45')]({'plain':!![]});if(!_0x4ca49e)throw new Error(_0xfa74('0x46'));if(_0x4ca49e[_0xfa74('0x47')]===_0xfa74('0x48')){var _0x36508a=_0x3100f2[_0xfa74('0x45')]({'plain':!![]});var _0x2d217d=_0xfa74('0x23');return db['UserProfileSection'][_0xfa74('0x43')]({'where':{'name':_0x2d217d,'userProfileId':_0x4ca49e[_0xfa74('0x49')]},'raw':!![]})[_0xfa74('0x22')](function(_0x2654b5){if(_0x2654b5&&_0x2654b5['autoAssociation']===0x0){return db['UserProfileResource'][_0xfa74('0x4a')]({'name':_0x36508a['name'],'resourceId':_0x36508a['id'],'type':_0x2654b5[_0xfa74('0x2f')],'sectionId':_0x2654b5['id']},{})[_0xfa74('0x22')](function(){return _0x3100f2;});}else{return _0x3100f2;}})[_0xfa74('0x3e')](function(_0x33e31e){logger[_0xfa74('0x25')](_0xfa74('0x4b'),_0x33e31e);throw _0x33e31e;});}return _0x3100f2;})[_0xfa74('0x22')](respondWithResult(_0x36f6ca,0xc9))['catch'](handleError(_0x36f6ca,null));};exports[_0xfa74('0x4c')]=function(_0x4bcee3,_0x21d7c5){if(_0x4bcee3['body']['id']){delete _0x4bcee3['body']['id'];}return db[_0xfa74('0x29')][_0xfa74('0x43')]({'where':{'id':_0x4bcee3['params']['id']}})['then'](handleEntityNotFound(_0x21d7c5,null))[_0xfa74('0x22')](saveUpdates(_0x4bcee3[_0xfa74('0x44')],null))[_0xfa74('0x22')](respondWithResult(_0x21d7c5,null))[_0xfa74('0x3e')](handleError(_0x21d7c5,null));};exports[_0xfa74('0x21')]=function(_0xfc3547,_0x1198f3){return db[_0xfa74('0x29')][_0xfa74('0x43')]({'where':{'id':_0xfc3547[_0xfa74('0x40')]['id']}})['then'](handleEntityNotFound(_0x1198f3,null))[_0xfa74('0x22')](removeEntity(_0x1198f3,null))[_0xfa74('0x3e')](handleError(_0x1198f3,null));};exports['getMessages']=function(_0x550974,_0x3d88dc,_0x2e7262){return db[_0xfa74('0x29')][_0xfa74('0x4d')]({'where':{'id':_0x550974[_0xfa74('0x40')]['id']}})['then'](handleEntityNotFound(_0x3d88dc,null))[_0xfa74('0x22')](function(_0x4d6235){var _0x26b398;var _0x2fff37={},_0x375bf7={};_0x375bf7['model']=_['keys'](db[_0xfa74('0x4e')][_0xfa74('0x2a')]);_0x375bf7[_0xfa74('0x30')]=_[_0xfa74('0x41')](_0x550974['query']);_0x375bf7[_0xfa74('0x38')]=_[_0xfa74('0x31')](_0x375bf7['model'],_0x375bf7[_0xfa74('0x30')]);_0x2fff37[_0xfa74('0x32')]=_[_0xfa74('0x31')](_0x375bf7[_0xfa74('0x2e')],qs['fields'](_0x550974[_0xfa74('0x30')]['fields']));_0x2fff37[_0xfa74('0x32')]=_0x2fff37[_0xfa74('0x32')][_0xfa74('0x34')]?_0x2fff37[_0xfa74('0x32')]:_0x375bf7[_0xfa74('0x2e')];if(!_0x550974[_0xfa74('0x30')][_0xfa74('0x4f')](_0xfa74('0x50'))){_0x2fff37[_0xfa74('0x1b')]=qs[_0xfa74('0x1b')](_0x550974[_0xfa74('0x30')][_0xfa74('0x1b')]);_0x2fff37[_0xfa74('0x19')]=qs[_0xfa74('0x19')](_0x550974[_0xfa74('0x30')]['offset']);}_0x2fff37[_0xfa74('0x35')]=qs[_0xfa74('0x36')](_0x550974['query']['sort']);_0x2fff37[_0xfa74('0x37')]=qs['filters'](_[_0xfa74('0x39')](_0x550974[_0xfa74('0x30')],_0x375bf7[_0xfa74('0x38')]));if(_0x550974['query'][_0xfa74('0x3a')]){_0x2fff37['where']=_['merge'](_0x2fff37[_0xfa74('0x37')],{'$or':_[_0xfa74('0x28')](_0x2fff37[_0xfa74('0x32')],function(_0x414e31){var _0x474c7d={};_0x474c7d[_0x414e31]={'$like':'%'+_0x550974[_0xfa74('0x30')][_0xfa74('0x3a')]+'%'};return _0x474c7d;})});}_0x2fff37[_0xfa74('0x37')]=_[_0xfa74('0x3b')](_0x2fff37[_0xfa74('0x37')],{'mailboxuser':_0x4d6235[_0xfa74('0x51')]});_0x2fff37=_['merge']({},_0x2fff37,_0x550974[_0xfa74('0x52')]);return db['VoiceMailMessage'][_0xfa74('0x53')](_0x2fff37)[_0xfa74('0x22')](respondWithFilteredResult(_0x3d88dc,_0x2fff37));})[_0xfa74('0x3e')](handleError(_0x3d88dc,null));}; \ No newline at end of file +var _0xf45e=['request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','destroy','then','UserProfileResource','error','stack','name','send','map','VoiceMail','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','params','rawAttributes','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Voicemails','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','getMessages','findOne','VoiceMailMessage','mailbox','findAndCountAll','eml-format','zip-dir'];(function(_0x3221f9,_0x4a0f39){var _0x1368da=function(_0x64d6ad){while(--_0x64d6ad){_0x3221f9['push'](_0x3221f9['shift']());}};_0x1368da(++_0x4a0f39);}(_0xf45e,0x115));var _0xef45=function(_0xd59e52,_0x67f122){_0xd59e52=_0xd59e52-0x0;var _0x27b8c6=_0xf45e[_0xd59e52];return _0x27b8c6;};'use strict';var emlformat=require(_0xef45('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xef45('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xef45('0x2'));var moment=require(_0xef45('0x3'));var BPromise=require(_0xef45('0x4'));var Mustache=require(_0xef45('0x5'));var util=require(_0xef45('0x6'));var path=require(_0xef45('0x7'));var sox=require(_0xef45('0x8'));var csv=require(_0xef45('0x9'));var ejs=require(_0xef45('0xa'));var fs=require('fs');var fs_extra=require(_0xef45('0xb'));var _=require(_0xef45('0xc'));var squel=require(_0xef45('0xd'));var crypto=require(_0xef45('0xe'));var jsforce=require(_0xef45('0xf'));var deskjs=require(_0xef45('0x10'));var toCsv=require(_0xef45('0x9'));var querystring=require(_0xef45('0x11'));var Papa=require(_0xef45('0x12'));var Redis=require(_0xef45('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xef45('0x14'));var as=require(_0xef45('0x15'));var hardwareService=require(_0xef45('0x16'));var logger=require(_0xef45('0x17'))(_0xef45('0x18'));var utils=require(_0xef45('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xef45('0x1a'));var db=require(_0xef45('0x1b'))['db'];function respondWithStatusCode(_0x30babb,_0x433be9){_0x433be9=_0x433be9||0xcc;return function(_0x476739){if(_0x476739){return _0x30babb['sendStatus'](_0x433be9);}return _0x30babb['status'](_0x433be9)[_0xef45('0x1c')]();};}function respondWithResult(_0x47fd96,_0x2ae89a){_0x2ae89a=_0x2ae89a||0xc8;return function(_0xb0fc43){if(_0xb0fc43){return _0x47fd96[_0xef45('0x1d')](_0x2ae89a)['json'](_0xb0fc43);}};}function respondWithFilteredResult(_0x5b3136,_0x29c0c4){return function(_0x5530e6){if(_0x5530e6){var _0x11cd3a=typeof _0x29c0c4[_0xef45('0x1e')]===_0xef45('0x1f')&&typeof _0x29c0c4[_0xef45('0x20')]==='undefined';var _0x560b2f=_0x5530e6[_0xef45('0x21')];var _0x219778=_0x11cd3a?0x0:_0x29c0c4[_0xef45('0x1e')];var _0x258785=_0x11cd3a?_0x5530e6['count']:_0x29c0c4['offset']+_0x29c0c4[_0xef45('0x20')];var _0x20ef26;if(_0x258785>=_0x560b2f){_0x258785=_0x560b2f;_0x20ef26=0xc8;}else{_0x20ef26=0xce;}_0x5b3136[_0xef45('0x1d')](_0x20ef26);return _0x5b3136[_0xef45('0x22')](_0xef45('0x23'),_0x219778+'-'+_0x258785+'/'+_0x560b2f)[_0xef45('0x24')](_0x5530e6);}return null;};}function patchUpdates(_0x375cbd){return function(_0x4a6217){try{jsonpatch[_0xef45('0x25')](_0x4a6217,_0x375cbd,!![]);}catch(_0x3e2a47){return BPromise[_0xef45('0x26')](_0x3e2a47);}return _0x4a6217[_0xef45('0x27')]();};}function saveUpdates(_0x27322f,_0x5205bf){return function(_0x40abc8){if(_0x40abc8){return _0x40abc8['update'](_0x27322f)['then'](function(_0x7707a1){return _0x7707a1;});}return null;};}function removeEntity(_0x2b41d8,_0xbb859b){return function(_0x7817d0){if(_0x7817d0){return _0x7817d0[_0xef45('0x28')]()[_0xef45('0x29')](function(){var _0x315777=_0x7817d0['get']({'plain':!![]});var _0x208b35='Voicemails';return db[_0xef45('0x2a')][_0xef45('0x28')]({'where':{'type':_0x208b35,'resourceId':_0x315777['id']}})['then'](function(){return _0x7817d0;});})[_0xef45('0x29')](function(){_0x2b41d8[_0xef45('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1096af,_0x4f8c9b){return function(_0x550e18){if(!_0x550e18){_0x1096af['sendStatus'](0x194);}return _0x550e18;};}function handleError(_0x53690e,_0x1f636f){_0x1f636f=_0x1f636f||0x1f4;return function(_0x2f72ef){logger[_0xef45('0x2b')](_0x2f72ef[_0xef45('0x2c')]);if(_0x2f72ef['name']){delete _0x2f72ef[_0xef45('0x2d')];}_0x53690e['status'](_0x1f636f)[_0xef45('0x2e')](_0x2f72ef);};}exports['index']=function(_0x3e6922,_0x5bfd2d){var _0x575734={},_0x14ce5a={},_0x3e45de={'count':0x0,'rows':[]};var _0x390a7a=_[_0xef45('0x2f')](db[_0xef45('0x30')]['rawAttributes'],function(_0x5551ce){return{'name':_0x5551ce['fieldName'],'type':_0x5551ce[_0xef45('0x31')][_0xef45('0x32')]};});_0x14ce5a[_0xef45('0x33')]=_[_0xef45('0x2f')](_0x390a7a,_0xef45('0x2d'));_0x14ce5a[_0xef45('0x34')]=_[_0xef45('0x35')](_0x3e6922['query']);_0x14ce5a['filters']=_[_0xef45('0x36')](_0x14ce5a['model'],_0x14ce5a[_0xef45('0x34')]);_0x575734['attributes']=_[_0xef45('0x36')](_0x14ce5a[_0xef45('0x33')],qs[_0xef45('0x37')](_0x3e6922[_0xef45('0x34')][_0xef45('0x37')]));_0x575734['attributes']=_0x575734[_0xef45('0x38')][_0xef45('0x39')]?_0x575734[_0xef45('0x38')]:_0x14ce5a['model'];if(!_0x3e6922['query'][_0xef45('0x3a')](_0xef45('0x3b'))){_0x575734['limit']=qs[_0xef45('0x20')](_0x3e6922['query']['limit']);_0x575734[_0xef45('0x1e')]=qs[_0xef45('0x1e')](_0x3e6922[_0xef45('0x34')]['offset']);}_0x575734[_0xef45('0x3c')]=qs[_0xef45('0x3d')](_0x3e6922[_0xef45('0x34')][_0xef45('0x3d')]);_0x575734['where']=qs['filters'](_[_0xef45('0x3e')](_0x3e6922[_0xef45('0x34')],_0x14ce5a[_0xef45('0x3f')]),_0x390a7a);if(_0x3e6922[_0xef45('0x34')][_0xef45('0x40')]){_0x575734[_0xef45('0x41')]=_[_0xef45('0x42')](_0x575734[_0xef45('0x41')],{'$or':_['map'](_0x390a7a,function(_0x4f5877){if(_0x4f5877[_0xef45('0x31')]!==_0xef45('0x43')){var _0x154e72={};_0x154e72[_0x4f5877[_0xef45('0x2d')]]={'$like':'%'+_0x3e6922[_0xef45('0x34')][_0xef45('0x40')]+'%'};return _0x154e72;}})});}_0x575734=_[_0xef45('0x42')]({},_0x575734,_0x3e6922[_0xef45('0x44')]);var _0x3a5082={'where':_0x575734[_0xef45('0x41')]};return db[_0xef45('0x30')][_0xef45('0x21')](_0x3a5082)[_0xef45('0x29')](function(_0xd7d217){_0x3e45de[_0xef45('0x21')]=_0xd7d217;if(_0x3e6922[_0xef45('0x34')]['includeAll']){_0x575734[_0xef45('0x45')]=[{'all':!![]}];}return db[_0xef45('0x30')][_0xef45('0x46')](_0x575734);})[_0xef45('0x29')](function(_0x54ccb8){_0x3e45de[_0xef45('0x47')]=_0x54ccb8;return _0x3e45de;})['then'](respondWithFilteredResult(_0x5bfd2d,_0x575734))[_0xef45('0x48')](handleError(_0x5bfd2d,null));};exports['show']=function(_0x5faf67,_0x2d086f){var _0x2236d9={'raw':!![],'where':{'id':_0x5faf67[_0xef45('0x49')]['id']}},_0x36e81a={};_0x36e81a[_0xef45('0x33')]=_[_0xef45('0x35')](db['VoiceMail'][_0xef45('0x4a')]);_0x36e81a[_0xef45('0x34')]=_[_0xef45('0x35')](_0x5faf67[_0xef45('0x34')]);_0x36e81a[_0xef45('0x3f')]=_[_0xef45('0x36')](_0x36e81a[_0xef45('0x33')],_0x36e81a[_0xef45('0x34')]);_0x2236d9[_0xef45('0x38')]=_[_0xef45('0x36')](_0x36e81a[_0xef45('0x33')],qs[_0xef45('0x37')](_0x5faf67[_0xef45('0x34')][_0xef45('0x37')]));_0x2236d9[_0xef45('0x38')]=_0x2236d9['attributes'][_0xef45('0x39')]?_0x2236d9[_0xef45('0x38')]:_0x36e81a[_0xef45('0x33')];if(_0x5faf67['query']['includeAll']){_0x2236d9['include']=[{'all':!![]}];}_0x2236d9=_[_0xef45('0x42')]({},_0x2236d9,_0x5faf67[_0xef45('0x44')]);return db[_0xef45('0x30')][_0xef45('0x4b')](_0x2236d9)[_0xef45('0x29')](handleEntityNotFound(_0x2d086f,null))[_0xef45('0x29')](respondWithResult(_0x2d086f,null))['catch'](handleError(_0x2d086f,null));};exports[_0xef45('0x4c')]=function(_0x463796,_0x2b2419){return db['VoiceMail']['create'](_0x463796[_0xef45('0x4d')],{})[_0xef45('0x29')](function(_0x4feeb1){var _0x1a56ae=_0x463796[_0xef45('0x4e')][_0xef45('0x4f')]({'plain':!![]});if(!_0x1a56ae)throw new Error(_0xef45('0x50'));if(_0x1a56ae[_0xef45('0x51')]===_0xef45('0x4e')){var _0x23581f=_0x4feeb1[_0xef45('0x4f')]({'plain':!![]});var _0x1961b4=_0xef45('0x52');return db[_0xef45('0x53')][_0xef45('0x4b')]({'where':{'name':_0x1961b4,'userProfileId':_0x1a56ae[_0xef45('0x54')]},'raw':!![]})[_0xef45('0x29')](function(_0x48a391){if(_0x48a391&&_0x48a391[_0xef45('0x55')]===0x0){return db[_0xef45('0x2a')][_0xef45('0x4c')]({'name':_0x23581f['name'],'resourceId':_0x23581f['id'],'type':_0x48a391[_0xef45('0x2d')],'sectionId':_0x48a391['id']},{})[_0xef45('0x29')](function(){return _0x4feeb1;});}else{return _0x4feeb1;}})[_0xef45('0x48')](function(_0x1531ea){logger['error'](_0xef45('0x56'),_0x1531ea);throw _0x1531ea;});}return _0x4feeb1;})[_0xef45('0x29')](respondWithResult(_0x2b2419,0xc9))[_0xef45('0x48')](handleError(_0x2b2419,null));};exports[_0xef45('0x57')]=function(_0x67d57b,_0x41f575){if(_0x67d57b[_0xef45('0x4d')]['id']){delete _0x67d57b[_0xef45('0x4d')]['id'];}return db[_0xef45('0x30')][_0xef45('0x4b')]({'where':{'id':_0x67d57b[_0xef45('0x49')]['id']}})[_0xef45('0x29')](handleEntityNotFound(_0x41f575,null))['then'](saveUpdates(_0x67d57b[_0xef45('0x4d')],null))[_0xef45('0x29')](respondWithResult(_0x41f575,null))[_0xef45('0x48')](handleError(_0x41f575,null));};exports[_0xef45('0x28')]=function(_0x2fe9cf,_0x32232f){return db['VoiceMail']['find']({'where':{'id':_0x2fe9cf[_0xef45('0x49')]['id']}})['then'](handleEntityNotFound(_0x32232f,null))[_0xef45('0x29')](removeEntity(_0x32232f,null))[_0xef45('0x48')](handleError(_0x32232f,null));};exports[_0xef45('0x58')]=function(_0x5676fb,_0x16b04e,_0x398dc0){return db['VoiceMail'][_0xef45('0x59')]({'where':{'id':_0x5676fb['params']['id']}})['then'](handleEntityNotFound(_0x16b04e,null))[_0xef45('0x29')](function(_0x4f78ac){var _0x189f22;var _0x3fbc26={},_0x22fd64={};_0x22fd64['model']=_[_0xef45('0x35')](db[_0xef45('0x5a')]['rawAttributes']);_0x22fd64[_0xef45('0x34')]=_[_0xef45('0x35')](_0x5676fb[_0xef45('0x34')]);_0x22fd64[_0xef45('0x3f')]=_[_0xef45('0x36')](_0x22fd64[_0xef45('0x33')],_0x22fd64[_0xef45('0x34')]);_0x3fbc26[_0xef45('0x38')]=_['intersection'](_0x22fd64[_0xef45('0x33')],qs['fields'](_0x5676fb['query'][_0xef45('0x37')]));_0x3fbc26['attributes']=_0x3fbc26[_0xef45('0x38')][_0xef45('0x39')]?_0x3fbc26['attributes']:_0x22fd64[_0xef45('0x33')];if(!_0x5676fb[_0xef45('0x34')][_0xef45('0x3a')](_0xef45('0x3b'))){_0x3fbc26[_0xef45('0x20')]=qs[_0xef45('0x20')](_0x5676fb['query'][_0xef45('0x20')]);_0x3fbc26[_0xef45('0x1e')]=qs[_0xef45('0x1e')](_0x5676fb[_0xef45('0x34')][_0xef45('0x1e')]);}_0x3fbc26['order']=qs[_0xef45('0x3d')](_0x5676fb['query'][_0xef45('0x3d')]);_0x3fbc26[_0xef45('0x41')]=qs['filters'](_[_0xef45('0x3e')](_0x5676fb[_0xef45('0x34')],_0x22fd64[_0xef45('0x3f')]));if(_0x5676fb['query']['filter']){_0x3fbc26[_0xef45('0x41')]=_[_0xef45('0x42')](_0x3fbc26[_0xef45('0x41')],{'$or':_['map'](_0x3fbc26[_0xef45('0x38')],function(_0x3956b0){var _0x49131e={};_0x49131e[_0x3956b0]={'$like':'%'+_0x5676fb[_0xef45('0x34')]['filter']+'%'};return _0x49131e;})});}_0x3fbc26[_0xef45('0x41')]=_[_0xef45('0x42')](_0x3fbc26[_0xef45('0x41')],{'mailboxuser':_0x4f78ac[_0xef45('0x5b')]});_0x3fbc26=_[_0xef45('0x42')]({},_0x3fbc26,_0x5676fb[_0xef45('0x44')]);return db[_0xef45('0x5a')][_0xef45('0x5c')](_0x3fbc26)['then'](respondWithFilteredResult(_0x16b04e,_0x3fbc26));})[_0xef45('0x48')](handleError(_0x16b04e,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 5e26fbd..6452ede 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 _0xba98=['exports','define','VoiceMail','mailbox_context','mailbox','context','bluebird','request-promise','path','../../config/environment','./voiceMail.attributes'];(function(_0x2b6f78,_0xb274ea){var _0x59b6aa=function(_0x3f9815){while(--_0x3f9815){_0x2b6f78['push'](_0x2b6f78['shift']());}};_0x59b6aa(++_0xb274ea);}(_0xba98,0x8a));var _0x8ba9=function(_0x521dac,_0xf6a8bc){_0x521dac=_0x521dac-0x0;var _0x2e23f5=_0xba98[_0x521dac];return _0x2e23f5;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x8ba9('0x0'));var rp=require(_0x8ba9('0x1'));var fs=require('fs');var path=require(_0x8ba9('0x2'));var rimraf=require('rimraf');var config=require(_0x8ba9('0x3'));var attributes=require(_0x8ba9('0x4'));module[_0x8ba9('0x5')]=function(_0x220621,_0x45d902){return _0x220621[_0x8ba9('0x6')](_0x8ba9('0x7'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':_0x8ba9('0x8'),'fields':[_0x8ba9('0x9'),_0x8ba9('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb5d5=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail','mailbox','lodash','util','../../config/logger'];(function(_0x50cfc3,_0x526cc6){var _0x5c11ef=function(_0xeaf96a){while(--_0xeaf96a){_0x50cfc3['push'](_0x50cfc3['shift']());}};_0x5c11ef(++_0x526cc6);}(_0xb5d5,0x16d));var _0x5b5d=function(_0x253de2,_0x2fed48){_0x253de2=_0x253de2-0x0;var _0x551337=_0xb5d5[_0x253de2];return _0x551337;};'use strict';var _=require(_0x5b5d('0x0'));var util=require(_0x5b5d('0x1'));var logger=require(_0x5b5d('0x2'))(_0x5b5d('0x3'));var moment=require(_0x5b5d('0x4'));var BPromise=require(_0x5b5d('0x5'));var rp=require(_0x5b5d('0x6'));var fs=require('fs');var path=require(_0x5b5d('0x7'));var rimraf=require(_0x5b5d('0x8'));var config=require(_0x5b5d('0x9'));var attributes=require(_0x5b5d('0xa'));module[_0x5b5d('0xb')]=function(_0x244c8a,_0x3d6b7e){return _0x244c8a[_0x5b5d('0xc')](_0x5b5d('0xd'),attributes,{'tableName':_0x5b5d('0xe'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0x5b5d('0xf'),'context']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 529fe80..92a43c3 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 _0xe7bb=['message','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x34eb31,_0x8f0f70){var _0x254994=function(_0xbec9a3){while(--_0xbec9a3){_0x34eb31['push'](_0x34eb31['shift']());}};_0x254994(++_0x8f0f70);}(_0xe7bb,0x145));var _0xbe7b=function(_0x56451a,_0x524421){_0x56451a=_0x56451a-0x0;var _0x269d07=_0xe7bb[_0x56451a];return _0x269d07;};'use strict';var _=require(_0xbe7b('0x0'));var util=require('util');var moment=require(_0xbe7b('0x1'));var BPromise=require(_0xbe7b('0x2'));var rs=require(_0xbe7b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbe7b('0x4'))['db'];var utils=require(_0xbe7b('0x5'));var logger=require(_0xbe7b('0x6'))(_0xbe7b('0x7'));var config=require('../../config/environment');var jayson=require(_0xbe7b('0x8'));var client=jayson[_0xbe7b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x43adc4,_0x40987b,_0x406ac9){return new BPromise(function(_0x377ae3,_0x3c34c6){return client['request'](_0x43adc4,_0x406ac9)[_0xbe7b('0xa')](function(_0x3d09f4){logger[_0xbe7b('0xb')](_0xbe7b('0xc'),_0x40987b,_0xbe7b('0xd'));logger[_0xbe7b('0xe')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x40987b,'request\x20sent',JSON[_0xbe7b('0xf')](_0x3d09f4));if(_0x3d09f4['error']){if(_0x3d09f4[_0xbe7b('0x10')]['code']===0x1f4){logger['error'](_0xbe7b('0xc'),_0x40987b,_0x3d09f4[_0xbe7b('0x10')][_0xbe7b('0x11')]);return _0x3c34c6(_0x3d09f4[_0xbe7b('0x10')][_0xbe7b('0x11')]);}logger['error'](_0xbe7b('0xc'),_0x40987b,_0x3d09f4[_0xbe7b('0x10')][_0xbe7b('0x11')]);return _0x377ae3(_0x3d09f4[_0xbe7b('0x10')][_0xbe7b('0x11')]);}else{logger['info'](_0xbe7b('0xc'),_0x40987b,_0xbe7b('0xd'));_0x377ae3(_0x3d09f4['result']['message']);}})['catch'](function(_0x2dbcf6){logger[_0xbe7b('0x10')]('VoiceMail,\x20%s,\x20%s',_0x40987b,_0x2dbcf6);_0x3c34c6(_0x2dbcf6);});});} \ No newline at end of file +var _0xe389=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch'];(function(_0x57d13b,_0x52d8cb){var _0x467696=function(_0x153000){while(--_0x153000){_0x57d13b['push'](_0x57d13b['shift']());}};_0x467696(++_0x52d8cb);}(_0xe389,0x84));var _0x9e38=function(_0x581d11,_0x483221){_0x581d11=_0x581d11-0x0;var _0x282199=_0xe389[_0x581d11];return _0x282199;};'use strict';var _=require(_0x9e38('0x0'));var util=require(_0x9e38('0x1'));var moment=require(_0x9e38('0x2'));var BPromise=require(_0x9e38('0x3'));var rs=require(_0x9e38('0x4'));var fs=require('fs');var Redis=require(_0x9e38('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x9e38('0x6'));var logger=require(_0x9e38('0x7'))('rpc');var config=require(_0x9e38('0x8'));var jayson=require(_0x9e38('0x9'));var client=jayson[_0x9e38('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe10a78,_0x17815c,_0x103850){return new BPromise(function(_0x57a71d,_0x359180){return client[_0x9e38('0xb')](_0xe10a78,_0x103850)[_0x9e38('0xc')](function(_0x5cd975){logger['info'](_0x9e38('0xd'),_0x17815c,_0x9e38('0xe'));logger[_0x9e38('0xf')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x17815c,_0x9e38('0xe'),JSON[_0x9e38('0x10')](_0x5cd975));if(_0x5cd975['error']){if(_0x5cd975[_0x9e38('0x11')][_0x9e38('0x12')]===0x1f4){logger[_0x9e38('0x11')]('VoiceMail,\x20%s,\x20%s',_0x17815c,_0x5cd975['error'][_0x9e38('0x13')]);return _0x359180(_0x5cd975['error'][_0x9e38('0x13')]);}logger[_0x9e38('0x11')](_0x9e38('0xd'),_0x17815c,_0x5cd975[_0x9e38('0x11')]['message']);return _0x57a71d(_0x5cd975[_0x9e38('0x11')][_0x9e38('0x13')]);}else{logger['info'](_0x9e38('0xd'),_0x17815c,_0x9e38('0xe'));_0x57a71d(_0x5cd975[_0x9e38('0x14')][_0x9e38('0x13')]);}})[_0x9e38('0x15')](function(_0x4ee05a){logger['error'](_0x9e38('0xd'),_0x17815c,_0x4ee05a);_0x359180(_0x4ee05a);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 20b25e2..782ff52 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 _0xd00d=['/:id/download','download','post','create','put','/:id','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated'];(function(_0x5ef55a,_0x2a03b1){var _0x20ae40=function(_0x46ce81){while(--_0x46ce81){_0x5ef55a['push'](_0x5ef55a['shift']());}};_0x20ae40(++_0x2a03b1);}(_0xd00d,0x1d1));var _0xdd00=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0xd00d[_0x5f1391];return _0x50ebe3;};'use strict';var multer=require(_0xdd00('0x0'));var util=require(_0xdd00('0x1'));var path=require(_0xdd00('0x2'));var timeout=require(_0xdd00('0x3'));var express=require(_0xdd00('0x4'));var router=express['Router']();var fs_extra=require(_0xdd00('0x5'));var auth=require(_0xdd00('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xdd00('0x7'));var controller=require('./voiceMailMessage.controller');router[_0xdd00('0x8')]('/',auth[_0xdd00('0x9')](),controller['index']);router[_0xdd00('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xdd00('0x8')](_0xdd00('0xa'),auth[_0xdd00('0x9')](),controller[_0xdd00('0xb')]);router[_0xdd00('0xc')]('/',auth[_0xdd00('0x9')](),controller[_0xdd00('0xd')]);router[_0xdd00('0xe')](_0xdd00('0xf'),auth[_0xdd00('0x9')](),controller[_0xdd00('0x10')]);router[_0xdd00('0x11')](_0xdd00('0xf'),auth[_0xdd00('0x9')](),controller['destroy']);module[_0xdd00('0x12')]=router; \ No newline at end of file +var _0x7eed=['path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','isAuthenticated','index','/:id','show','get','/:id/download','download','post','create','put','update','delete','destroy','multer','util'];(function(_0x5bccbf,_0x547e42){var _0x2158c6=function(_0x40f28a){while(--_0x40f28a){_0x5bccbf['push'](_0x5bccbf['shift']());}};_0x2158c6(++_0x547e42);}(_0x7eed,0x163));var _0xd7ee=function(_0x53c8c7,_0x348f83){_0x53c8c7=_0x53c8c7-0x0;var _0x4f9626=_0x7eed[_0x53c8c7];return _0x4f9626;};'use strict';var multer=require(_0xd7ee('0x0'));var util=require(_0xd7ee('0x1'));var path=require(_0xd7ee('0x2'));var timeout=require(_0xd7ee('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xd7ee('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xd7ee('0x5'));var config=require(_0xd7ee('0x6'));var controller=require(_0xd7ee('0x7'));router['get']('/',auth[_0xd7ee('0x8')](),controller[_0xd7ee('0x9')]);router['get'](_0xd7ee('0xa'),auth[_0xd7ee('0x8')](),controller[_0xd7ee('0xb')]);router[_0xd7ee('0xc')](_0xd7ee('0xd'),auth[_0xd7ee('0x8')](),controller[_0xd7ee('0xe')]);router[_0xd7ee('0xf')]('/',auth[_0xd7ee('0x8')](),controller[_0xd7ee('0x10')]);router[_0xd7ee('0x11')](_0xd7ee('0xa'),auth[_0xd7ee('0x8')](),controller[_0xd7ee('0x12')]);router[_0xd7ee('0x13')](_0xd7ee('0xa'),auth[_0xd7ee('0x8')](),controller[_0xd7ee('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 8f908d6..400c9b7 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 _0xbfc5=['getDataValue','STRING','BLOB','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','VIRTUAL'];(function(_0xfc74bf,_0x3548c9){var _0x4d2c30=function(_0xd113e6){while(--_0xd113e6){_0xfc74bf['push'](_0xfc74bf['shift']());}};_0x4d2c30(++_0x3548c9);}(_0xbfc5,0x15c));var _0x5bfc=function(_0x28b9d7,_0x5b863b){_0x28b9d7=_0x28b9d7-0x0;var _0x1d3ee9=_0xbfc5[_0x28b9d7];return _0x1d3ee9;};'use strict';var Sequelize=require(_0x5bfc('0x0'));module[_0x5bfc('0x1')]={'name':{'type':Sequelize[_0x5bfc('0x2')],'get':function(_0x3ce130){return this[_0x5bfc('0x3')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize[_0x5bfc('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x5bfc('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0x5bfc('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0x5bfc('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0x5bfc('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x5bfc('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x5bfc('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0x5bfc('0x5')]('long'),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0x5bfc('0x4')],'defaultValue':''},'stamp':{'type':_0x5bfc('0x6'),'defaultValue':Sequelize[_0x5bfc('0x7')](_0x5bfc('0x8'))}}; \ No newline at end of file +var _0x634c=['STRING','BLOB','long','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','exports','VIRTUAL','getDataValue'];(function(_0x2d5bd8,_0x2610c3){var _0x377275=function(_0x12d475){while(--_0x12d475){_0x2d5bd8['push'](_0x2d5bd8['shift']());}};_0x377275(++_0x2610c3);}(_0x634c,0x19b));var _0xc634=function(_0x28b406,_0x2935cb){_0x28b406=_0x28b406-0x0;var _0x5d6113=_0x634c[_0x28b406];return _0x5d6113;};'use strict';var Sequelize=require('sequelize');module[_0xc634('0x0')]={'name':{'type':Sequelize[_0xc634('0x1')],'get':function(_0x2f8efe){return this[_0xc634('0x2')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xc634('0x3')],'defaultValue':''},'context':{'type':Sequelize[_0xc634('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xc634('0x3')],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize[_0xc634('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0xc634('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xc634('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0xc634('0x4')](_0xc634('0x5')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0xc634('0x3')],'defaultValue':''},'stamp':{'type':_0xc634('0x6'),'defaultValue':Sequelize[_0xc634('0x7')](_0xc634('0x8'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index d3a2394..98a5a51 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 _0xb9c7=['update','destroy','then','error','stack','name','send','index','map','VoiceMailMessage','fieldName','type','key','differenceBy','query','keys','filters','intersection','fields','attributes','model','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','length','includeAll','create','body','find','params','download','recording','msg_id','ValidationError','VoiceMailMessage\x20not\x20found','attachment;\x20filename=\x22','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range'];(function(_0x10c51f,_0x11270f){var _0x56a0cd=function(_0x563ac6){while(--_0x563ac6){_0x10c51f['push'](_0x10c51f['shift']());}};_0x56a0cd(++_0x11270f);}(_0xb9c7,0x83));var _0x7b9c=function(_0x1e28f7,_0x4a4b91){_0x1e28f7=_0x1e28f7-0x0;var _0x65a5d7=_0xb9c7[_0x1e28f7];return _0x65a5d7;};'use strict';var emlformat=require(_0x7b9c('0x0'));var rimraf=require(_0x7b9c('0x1'));var zipdir=require(_0x7b9c('0x2'));var jsonpatch=require(_0x7b9c('0x3'));var rp=require(_0x7b9c('0x4'));var moment=require(_0x7b9c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x7b9c('0x6'));var util=require(_0x7b9c('0x7'));var path=require(_0x7b9c('0x8'));var sox=require(_0x7b9c('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7b9c('0xa'));var _=require(_0x7b9c('0xb'));var squel=require(_0x7b9c('0xc'));var crypto=require(_0x7b9c('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7b9c('0xe'));var toCsv=require('to-csv');var querystring=require(_0x7b9c('0xf'));var Papa=require(_0x7b9c('0x10'));var Redis=require(_0x7b9c('0x11'));var authService=require(_0x7b9c('0x12'));var qs=require(_0x7b9c('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7b9c('0x14'));var logger=require('../../config/logger')(_0x7b9c('0x15'));var utils=require(_0x7b9c('0x16'));var config=require(_0x7b9c('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x7b9c('0x18'))['db'];function respondWithStatusCode(_0x4de358,_0x33a4b0){_0x33a4b0=_0x33a4b0||0xcc;return function(_0x20b9d4){if(_0x20b9d4){return _0x4de358[_0x7b9c('0x19')](_0x33a4b0);}return _0x4de358[_0x7b9c('0x1a')](_0x33a4b0)[_0x7b9c('0x1b')]();};}function respondWithResult(_0x13736c,_0x3cc478){_0x3cc478=_0x3cc478||0xc8;return function(_0x13bc66){if(_0x13bc66){return _0x13736c[_0x7b9c('0x1a')](_0x3cc478)[_0x7b9c('0x1c')](_0x13bc66);}};}function respondWithFilteredResult(_0x201964,_0x209353){return function(_0x146761){if(_0x146761){var _0x145b6b=typeof _0x209353[_0x7b9c('0x1d')]===_0x7b9c('0x1e')&&typeof _0x209353['limit']===_0x7b9c('0x1e');var _0x3186b2=_0x146761[_0x7b9c('0x1f')];var _0x521fb6=_0x145b6b?0x0:_0x209353[_0x7b9c('0x1d')];var _0x25552b=_0x145b6b?_0x146761[_0x7b9c('0x1f')]:_0x209353[_0x7b9c('0x1d')]+_0x209353[_0x7b9c('0x20')];var _0x440dac;if(_0x25552b>=_0x3186b2){_0x25552b=_0x3186b2;_0x440dac=0xc8;}else{_0x440dac=0xce;}_0x201964[_0x7b9c('0x1a')](_0x440dac);return _0x201964[_0x7b9c('0x21')](_0x7b9c('0x22'),_0x521fb6+'-'+_0x25552b+'/'+_0x3186b2)['json'](_0x146761);}return null;};}function patchUpdates(_0x3dbcf0){return function(_0x1a9118){try{jsonpatch['apply'](_0x1a9118,_0x3dbcf0,!![]);}catch(_0xde7312){return BPromise['reject'](_0xde7312);}return _0x1a9118['save']();};}function saveUpdates(_0x4ad81b,_0x55c845){return function(_0x323831){if(_0x323831){return _0x323831[_0x7b9c('0x23')](_0x4ad81b)['then'](function(_0x1a9f93){return _0x1a9f93;});}return null;};}function removeEntity(_0x1655d8,_0x992da3){return function(_0x719482){if(_0x719482){return _0x719482[_0x7b9c('0x24')]()[_0x7b9c('0x25')](function(){_0x1655d8[_0x7b9c('0x1a')](0xcc)[_0x7b9c('0x1b')]();});}};}function handleEntityNotFound(_0x84eb70,_0x137657){return function(_0x28663a){if(!_0x28663a){_0x84eb70[_0x7b9c('0x19')](0x194);}return _0x28663a;};}function handleError(_0x2765b3,_0x154314){_0x154314=_0x154314||0x1f4;return function(_0x371210){logger[_0x7b9c('0x26')](_0x371210[_0x7b9c('0x27')]);if(_0x371210['name']){delete _0x371210[_0x7b9c('0x28')];}_0x2765b3[_0x7b9c('0x1a')](_0x154314)[_0x7b9c('0x29')](_0x371210);};}exports[_0x7b9c('0x2a')]=function(_0x33e7ab,_0xf98cad){var _0x4be5de={},_0x19d0de={},_0x199a48={'count':0x0,'rows':[]};var _0x3b0e79=_[_0x7b9c('0x2b')](db[_0x7b9c('0x2c')]['rawAttributes'],function(_0x425b47){return{'name':_0x425b47[_0x7b9c('0x2d')],'type':_0x425b47[_0x7b9c('0x2e')][_0x7b9c('0x2f')]};});_0x19d0de['model']=_[_0x7b9c('0x30')](_[_0x7b9c('0x2b')](_0x3b0e79,'name'),[_0x7b9c('0x28')]);_0x19d0de[_0x7b9c('0x31')]=_[_0x7b9c('0x32')](_0x33e7ab[_0x7b9c('0x31')]);_0x19d0de[_0x7b9c('0x33')]=_[_0x7b9c('0x34')](_0x19d0de['model'],_0x19d0de[_0x7b9c('0x31')]);_0x4be5de['attributes']=_['intersection'](_0x19d0de['model'],qs[_0x7b9c('0x35')](_0x33e7ab[_0x7b9c('0x31')]['fields']));_0x4be5de['attributes']=_0x4be5de[_0x7b9c('0x36')]['length']?_0x4be5de[_0x7b9c('0x36')]:_0x19d0de[_0x7b9c('0x37')];if(!_0x33e7ab[_0x7b9c('0x31')][_0x7b9c('0x38')](_0x7b9c('0x39'))){_0x4be5de[_0x7b9c('0x20')]=qs['limit'](_0x33e7ab[_0x7b9c('0x31')][_0x7b9c('0x20')]);_0x4be5de[_0x7b9c('0x1d')]=qs['offset'](_0x33e7ab['query'][_0x7b9c('0x1d')]);}_0x4be5de[_0x7b9c('0x3a')]=qs[_0x7b9c('0x3b')](_0x33e7ab['query']['sort']);_0x4be5de[_0x7b9c('0x3c')]=qs[_0x7b9c('0x33')](_[_0x7b9c('0x3d')](_0x33e7ab[_0x7b9c('0x31')],_0x19d0de['filters']),_0x3b0e79);if(_0x33e7ab[_0x7b9c('0x31')][_0x7b9c('0x3e')]){_0x4be5de[_0x7b9c('0x3c')]=_[_0x7b9c('0x3f')](_0x4be5de['where'],{'$or':_['map'](_0x3b0e79,function(_0x84d302){if(_0x84d302[_0x7b9c('0x2e')]!==_0x7b9c('0x40')){var _0x126027={};_0x126027[_0x84d302[_0x7b9c('0x28')]]={'$like':'%'+_0x33e7ab[_0x7b9c('0x31')]['filter']+'%'};return _0x126027;}})});}_0x4be5de=_[_0x7b9c('0x3f')]({},_0x4be5de,_0x33e7ab[_0x7b9c('0x41')]);var _0x40b6e4={'where':_0x4be5de['where']};return db[_0x7b9c('0x2c')][_0x7b9c('0x1f')](_0x40b6e4)[_0x7b9c('0x25')](function(_0x340259){_0x199a48['count']=_0x340259;if(_0x33e7ab[_0x7b9c('0x31')]['includeAll']){_0x4be5de[_0x7b9c('0x42')]=[{'all':!![]}];}return db['VoiceMailMessage'][_0x7b9c('0x43')](_0x4be5de);})[_0x7b9c('0x25')](function(_0x3ad8cc){_0x199a48[_0x7b9c('0x44')]=_0x3ad8cc;return _0x199a48;})[_0x7b9c('0x25')](respondWithFilteredResult(_0xf98cad,_0x4be5de))[_0x7b9c('0x45')](handleError(_0xf98cad,null));};exports[_0x7b9c('0x46')]=function(_0x7bcb97,_0x4e22b4){var _0xe90c0f={'raw':!![],'where':{'id':_0x7bcb97['params']['id']}},_0x35b746={};_0x35b746[_0x7b9c('0x37')]=_[_0x7b9c('0x32')](db['VoiceMailMessage']['rawAttributes']);_0x35b746[_0x7b9c('0x31')]=_[_0x7b9c('0x32')](_0x7bcb97[_0x7b9c('0x31')]);_0x35b746['filters']=_[_0x7b9c('0x34')](_0x35b746['model'],_0x35b746[_0x7b9c('0x31')]);_0xe90c0f['attributes']=_['intersection'](_0x35b746[_0x7b9c('0x37')],qs[_0x7b9c('0x35')](_0x7bcb97['query'][_0x7b9c('0x35')]));_0xe90c0f[_0x7b9c('0x36')]=_0xe90c0f[_0x7b9c('0x36')][_0x7b9c('0x47')]?_0xe90c0f['attributes']:_0x35b746[_0x7b9c('0x37')];if(_0x7bcb97[_0x7b9c('0x31')][_0x7b9c('0x48')]){_0xe90c0f[_0x7b9c('0x42')]=[{'all':!![]}];}_0xe90c0f=_['merge']({},_0xe90c0f,_0x7bcb97['options']);return db[_0x7b9c('0x2c')]['find'](_0xe90c0f)[_0x7b9c('0x25')](handleEntityNotFound(_0x4e22b4,null))[_0x7b9c('0x25')](respondWithResult(_0x4e22b4,null))['catch'](handleError(_0x4e22b4,null));};exports[_0x7b9c('0x49')]=function(_0x4e7b09,_0x432ffa){return db['VoiceMailMessage'][_0x7b9c('0x49')](_0x4e7b09[_0x7b9c('0x4a')],{})['then'](respondWithResult(_0x432ffa,0xc9))[_0x7b9c('0x45')](handleError(_0x432ffa,null));};exports[_0x7b9c('0x23')]=function(_0x173b61,_0x5a6f5b){if(_0x173b61[_0x7b9c('0x4a')]['id']){delete _0x173b61[_0x7b9c('0x4a')]['id'];}return db[_0x7b9c('0x2c')][_0x7b9c('0x4b')]({'where':{'id':_0x173b61[_0x7b9c('0x4c')]['id']}})[_0x7b9c('0x25')](handleEntityNotFound(_0x5a6f5b,null))[_0x7b9c('0x25')](saveUpdates(_0x173b61[_0x7b9c('0x4a')],null))[_0x7b9c('0x25')](respondWithResult(_0x5a6f5b,null))[_0x7b9c('0x45')](handleError(_0x5a6f5b,null));};exports['destroy']=function(_0x46a86b,_0x301406){return db[_0x7b9c('0x2c')][_0x7b9c('0x4b')]({'where':{'id':_0x46a86b[_0x7b9c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x301406,null))[_0x7b9c('0x25')](removeEntity(_0x301406,null))['catch'](handleError(_0x301406,null));};exports[_0x7b9c('0x4d')]=function(_0x24800c,_0x49be6a,_0x52ebee){return db[_0x7b9c('0x2c')]['find']({'where':{'id':_0x24800c[_0x7b9c('0x4c')]['id']},'attributes':['id',_0x7b9c('0x4e'),_0x7b9c('0x4f')]})[_0x7b9c('0x25')](handleEntityNotFound(_0x49be6a,null))['then'](function(_0x129490){if(_0x129490){if(!_0x129490[_0x7b9c('0x4e')]){throw new db['Sequelize'][(_0x7b9c('0x50'))](_0x7b9c('0x51'));}var _0x453b9d={'Content-Type':'audio/wav','Content-Disposition':'attachment'};if(_0x129490[_0x7b9c('0x4f')]){_0x453b9d['Content-Disposition']=_0x7b9c('0x52')+_0x129490[_0x7b9c('0x4f')]+'.wav\x22';}_0x49be6a[_0x7b9c('0x21')](_0x453b9d);return _0x49be6a['send'](new Buffer(_0x129490[_0x7b9c('0x4e')]));}})[_0x7b9c('0x45')](handleError(_0x49be6a,null));}; \ No newline at end of file +var _0xb248=['filter','merge','options','includeAll','include','findAll','rows','catch','show','params','fields','length','body','find','recording','Sequelize','VoiceMailMessage\x20not\x20found','audio/wav','attachment','msg_id','Content-Disposition','.wav\x22','eml-format','zip-dir','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','limit','count','status','set','json','apply','reject','save','update','then','destroy','error','stack','send','index','map','VoiceMailMessage','rawAttributes','type','model','differenceBy','name','query','filters','attributes','intersection','hasOwnProperty','nolimit','sort','where'];(function(_0x1104c9,_0x2c729c){var _0x3d55e7=function(_0x1a434b){while(--_0x1a434b){_0x1104c9['push'](_0x1104c9['shift']());}};_0x3d55e7(++_0x2c729c);}(_0xb248,0x1de));var _0x8b24=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xb248[_0x618414];return _0x21c19a;};'use strict';var emlformat=require(_0x8b24('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8b24('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8b24('0x2'));var BPromise=require(_0x8b24('0x3'));var Mustache=require(_0x8b24('0x4'));var util=require(_0x8b24('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x8b24('0x6'));var ejs=require(_0x8b24('0x7'));var fs=require('fs');var fs_extra=require(_0x8b24('0x8'));var _=require(_0x8b24('0x9'));var squel=require('squel');var crypto=require(_0x8b24('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8b24('0x6'));var querystring=require(_0x8b24('0xb'));var Papa=require(_0x8b24('0xc'));var Redis=require(_0x8b24('0xd'));var authService=require(_0x8b24('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8b24('0xf'));var utils=require(_0x8b24('0x10'));var config=require(_0x8b24('0x11'));var licenseUtil=require(_0x8b24('0x12'));var db=require(_0x8b24('0x13'))['db'];function respondWithStatusCode(_0x5dba80,_0x5e16e0){_0x5e16e0=_0x5e16e0||0xcc;return function(_0x3092d4){if(_0x3092d4){return _0x5dba80[_0x8b24('0x14')](_0x5e16e0);}return _0x5dba80['status'](_0x5e16e0)[_0x8b24('0x15')]();};}function respondWithResult(_0x16ceda,_0x3fdbca){_0x3fdbca=_0x3fdbca||0xc8;return function(_0x1a6703){if(_0x1a6703){return _0x16ceda['status'](_0x3fdbca)['json'](_0x1a6703);}};}function respondWithFilteredResult(_0x76a9d8,_0x3250da){return function(_0x1e6ee7){if(_0x1e6ee7){var _0x426860=typeof _0x3250da[_0x8b24('0x16')]===_0x8b24('0x17')&&typeof _0x3250da[_0x8b24('0x18')]==='undefined';var _0x5bac21=_0x1e6ee7['count'];var _0x55c71a=_0x426860?0x0:_0x3250da[_0x8b24('0x16')];var _0x33d4b5=_0x426860?_0x1e6ee7[_0x8b24('0x19')]:_0x3250da[_0x8b24('0x16')]+_0x3250da[_0x8b24('0x18')];var _0x1020b9;if(_0x33d4b5>=_0x5bac21){_0x33d4b5=_0x5bac21;_0x1020b9=0xc8;}else{_0x1020b9=0xce;}_0x76a9d8[_0x8b24('0x1a')](_0x1020b9);return _0x76a9d8[_0x8b24('0x1b')]('Content-Range',_0x55c71a+'-'+_0x33d4b5+'/'+_0x5bac21)[_0x8b24('0x1c')](_0x1e6ee7);}return null;};}function patchUpdates(_0x584e75){return function(_0x5507eb){try{jsonpatch[_0x8b24('0x1d')](_0x5507eb,_0x584e75,!![]);}catch(_0x79f74){return BPromise[_0x8b24('0x1e')](_0x79f74);}return _0x5507eb[_0x8b24('0x1f')]();};}function saveUpdates(_0x200112,_0xf148f8){return function(_0xea455b){if(_0xea455b){return _0xea455b[_0x8b24('0x20')](_0x200112)[_0x8b24('0x21')](function(_0x51272a){return _0x51272a;});}return null;};}function removeEntity(_0x473f7b,_0x31141a){return function(_0x125f60){if(_0x125f60){return _0x125f60[_0x8b24('0x22')]()['then'](function(){_0x473f7b[_0x8b24('0x1a')](0xcc)[_0x8b24('0x15')]();});}};}function handleEntityNotFound(_0x1564a2,_0x438a31){return function(_0x59ca21){if(!_0x59ca21){_0x1564a2[_0x8b24('0x14')](0x194);}return _0x59ca21;};}function handleError(_0x11e7cd,_0x515c07){_0x515c07=_0x515c07||0x1f4;return function(_0x43ce2d){logger[_0x8b24('0x23')](_0x43ce2d[_0x8b24('0x24')]);if(_0x43ce2d['name']){delete _0x43ce2d['name'];}_0x11e7cd[_0x8b24('0x1a')](_0x515c07)[_0x8b24('0x25')](_0x43ce2d);};}exports[_0x8b24('0x26')]=function(_0x5b2afb,_0x14d561){var _0x315e3a={},_0x5b6197={},_0x190ba={'count':0x0,'rows':[]};var _0x551169=_[_0x8b24('0x27')](db[_0x8b24('0x28')][_0x8b24('0x29')],function(_0xf8e09){return{'name':_0xf8e09['fieldName'],'type':_0xf8e09[_0x8b24('0x2a')]['key']};});_0x5b6197[_0x8b24('0x2b')]=_[_0x8b24('0x2c')](_[_0x8b24('0x27')](_0x551169,_0x8b24('0x2d')),[_0x8b24('0x2d')]);_0x5b6197[_0x8b24('0x2e')]=_['keys'](_0x5b2afb[_0x8b24('0x2e')]);_0x5b6197[_0x8b24('0x2f')]=_['intersection'](_0x5b6197['model'],_0x5b6197['query']);_0x315e3a[_0x8b24('0x30')]=_[_0x8b24('0x31')](_0x5b6197['model'],qs['fields'](_0x5b2afb['query']['fields']));_0x315e3a[_0x8b24('0x30')]=_0x315e3a[_0x8b24('0x30')]['length']?_0x315e3a['attributes']:_0x5b6197['model'];if(!_0x5b2afb['query'][_0x8b24('0x32')](_0x8b24('0x33'))){_0x315e3a['limit']=qs[_0x8b24('0x18')](_0x5b2afb[_0x8b24('0x2e')][_0x8b24('0x18')]);_0x315e3a['offset']=qs[_0x8b24('0x16')](_0x5b2afb[_0x8b24('0x2e')][_0x8b24('0x16')]);}_0x315e3a['order']=qs[_0x8b24('0x34')](_0x5b2afb['query'][_0x8b24('0x34')]);_0x315e3a[_0x8b24('0x35')]=qs[_0x8b24('0x2f')](_['pick'](_0x5b2afb['query'],_0x5b6197[_0x8b24('0x2f')]),_0x551169);if(_0x5b2afb['query'][_0x8b24('0x36')]){_0x315e3a[_0x8b24('0x35')]=_[_0x8b24('0x37')](_0x315e3a[_0x8b24('0x35')],{'$or':_[_0x8b24('0x27')](_0x551169,function(_0x5c4189){if(_0x5c4189[_0x8b24('0x2a')]!=='VIRTUAL'){var _0x5a0cad={};_0x5a0cad[_0x5c4189[_0x8b24('0x2d')]]={'$like':'%'+_0x5b2afb[_0x8b24('0x2e')][_0x8b24('0x36')]+'%'};return _0x5a0cad;}})});}_0x315e3a=_[_0x8b24('0x37')]({},_0x315e3a,_0x5b2afb[_0x8b24('0x38')]);var _0x29bd28={'where':_0x315e3a[_0x8b24('0x35')]};return db[_0x8b24('0x28')]['count'](_0x29bd28)['then'](function(_0x3a2033){_0x190ba[_0x8b24('0x19')]=_0x3a2033;if(_0x5b2afb[_0x8b24('0x2e')][_0x8b24('0x39')]){_0x315e3a[_0x8b24('0x3a')]=[{'all':!![]}];}return db[_0x8b24('0x28')][_0x8b24('0x3b')](_0x315e3a);})[_0x8b24('0x21')](function(_0x3dc6d1){_0x190ba[_0x8b24('0x3c')]=_0x3dc6d1;return _0x190ba;})[_0x8b24('0x21')](respondWithFilteredResult(_0x14d561,_0x315e3a))[_0x8b24('0x3d')](handleError(_0x14d561,null));};exports[_0x8b24('0x3e')]=function(_0xffa186,_0x28b157){var _0x25a63d={'raw':!![],'where':{'id':_0xffa186[_0x8b24('0x3f')]['id']}},_0x1128fe={};_0x1128fe['model']=_['keys'](db[_0x8b24('0x28')][_0x8b24('0x29')]);_0x1128fe['query']=_['keys'](_0xffa186['query']);_0x1128fe[_0x8b24('0x2f')]=_[_0x8b24('0x31')](_0x1128fe['model'],_0x1128fe['query']);_0x25a63d[_0x8b24('0x30')]=_[_0x8b24('0x31')](_0x1128fe[_0x8b24('0x2b')],qs['fields'](_0xffa186[_0x8b24('0x2e')][_0x8b24('0x40')]));_0x25a63d[_0x8b24('0x30')]=_0x25a63d[_0x8b24('0x30')][_0x8b24('0x41')]?_0x25a63d[_0x8b24('0x30')]:_0x1128fe[_0x8b24('0x2b')];if(_0xffa186['query'][_0x8b24('0x39')]){_0x25a63d[_0x8b24('0x3a')]=[{'all':!![]}];}_0x25a63d=_[_0x8b24('0x37')]({},_0x25a63d,_0xffa186['options']);return db[_0x8b24('0x28')]['find'](_0x25a63d)['then'](handleEntityNotFound(_0x28b157,null))[_0x8b24('0x21')](respondWithResult(_0x28b157,null))[_0x8b24('0x3d')](handleError(_0x28b157,null));};exports['create']=function(_0x1b1e24,_0x371ab9){return db[_0x8b24('0x28')]['create'](_0x1b1e24[_0x8b24('0x42')],{})['then'](respondWithResult(_0x371ab9,0xc9))[_0x8b24('0x3d')](handleError(_0x371ab9,null));};exports[_0x8b24('0x20')]=function(_0x2556fd,_0x129ce6){if(_0x2556fd[_0x8b24('0x42')]['id']){delete _0x2556fd[_0x8b24('0x42')]['id'];}return db[_0x8b24('0x28')][_0x8b24('0x43')]({'where':{'id':_0x2556fd[_0x8b24('0x3f')]['id']}})[_0x8b24('0x21')](handleEntityNotFound(_0x129ce6,null))[_0x8b24('0x21')](saveUpdates(_0x2556fd[_0x8b24('0x42')],null))[_0x8b24('0x21')](respondWithResult(_0x129ce6,null))['catch'](handleError(_0x129ce6,null));};exports[_0x8b24('0x22')]=function(_0x40d7c3,_0x478a82){return db[_0x8b24('0x28')]['find']({'where':{'id':_0x40d7c3[_0x8b24('0x3f')]['id']}})['then'](handleEntityNotFound(_0x478a82,null))[_0x8b24('0x21')](removeEntity(_0x478a82,null))[_0x8b24('0x3d')](handleError(_0x478a82,null));};exports['download']=function(_0x45c840,_0x5348c0,_0xbd73b3){return db[_0x8b24('0x28')][_0x8b24('0x43')]({'where':{'id':_0x45c840['params']['id']},'attributes':['id',_0x8b24('0x44'),'msg_id']})[_0x8b24('0x21')](handleEntityNotFound(_0x5348c0,null))['then'](function(_0x378d4f){if(_0x378d4f){if(!_0x378d4f[_0x8b24('0x44')]){throw new db[(_0x8b24('0x45'))]['ValidationError'](_0x8b24('0x46'));}var _0x341705={'Content-Type':_0x8b24('0x47'),'Content-Disposition':_0x8b24('0x48')};if(_0x378d4f[_0x8b24('0x49')]){_0x341705[_0x8b24('0x4a')]='attachment;\x20filename=\x22'+_0x378d4f[_0x8b24('0x49')]+_0x8b24('0x4b');}_0x5348c0[_0x8b24('0x1b')](_0x341705);return _0x5348c0[_0x8b24('0x25')](new Buffer(_0x378d4f['recording']));}})[_0x8b24('0x3d')](handleError(_0x5348c0,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index e34b178..9a38989 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 _0x11bd=['exports','voice_voicemail_messages','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceMailMessage.attributes'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0x11bd,0x8e));var _0xd11b=function(_0x57e8d6,_0x57229f){_0x57e8d6=_0x57e8d6-0x0;var _0x59f024=_0x11bd[_0x57e8d6];return _0x59f024;};'use strict';var _=require('lodash');var util=require(_0xd11b('0x0'));var logger=require('../../config/logger')(_0xd11b('0x1'));var moment=require(_0xd11b('0x2'));var BPromise=require(_0xd11b('0x3'));var rp=require(_0xd11b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd11b('0x5'));var config=require(_0xd11b('0x6'));var attributes=require(_0xd11b('0x7'));module[_0xd11b('0x8')]=function(_0x456356,_0x1b4641){return _0x456356['define']('VoiceMailMessage',attributes,{'tableName':_0xd11b('0x9'),'paranoid':![],'indexes':[{'name':'dir','fields':['dir']}],'timestamps':![]});}; \ No newline at end of file +var _0x7a18=['request-promise','path','rimraf','../../config/environment','./voiceMailMessage.attributes','define','VoiceMailMessage','dir','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7a18,0x158));var _0x87a1=function(_0x148c09,_0x4fd39f){_0x148c09=_0x148c09-0x0;var _0x18e613=_0x7a18[_0x148c09];return _0x18e613;};'use strict';var _=require(_0x87a1('0x0'));var util=require(_0x87a1('0x1'));var logger=require(_0x87a1('0x2'))(_0x87a1('0x3'));var moment=require(_0x87a1('0x4'));var BPromise=require(_0x87a1('0x5'));var rp=require(_0x87a1('0x6'));var fs=require('fs');var path=require(_0x87a1('0x7'));var rimraf=require(_0x87a1('0x8'));var config=require(_0x87a1('0x9'));var attributes=require(_0x87a1('0xa'));module['exports']=function(_0x315809,_0x33368f){return _0x315809[_0x87a1('0xb')](_0x87a1('0xc'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0x87a1('0xd'),'fields':[_0x87a1('0xd')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 8d6e262..b3e5822 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 _0xad13=['message','result','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','VoiceMailMessage,\x20%s,\x20%s,\x20%s','code','error'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xad13,0xe9));var _0x3ad1=function(_0x597980,_0x2722d9){_0x597980=_0x597980-0x0;var _0x5957cf=_0xad13[_0x597980];return _0x5957cf;};'use strict';var _=require(_0x3ad1('0x0'));var util=require('util');var moment=require(_0x3ad1('0x1'));var BPromise=require(_0x3ad1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3ad1('0x3'));var db=require(_0x3ad1('0x4'))['db'];var utils=require(_0x3ad1('0x5'));var logger=require(_0x3ad1('0x6'))(_0x3ad1('0x7'));var config=require(_0x3ad1('0x8'));var jayson=require(_0x3ad1('0x9'));var client=jayson[_0x3ad1('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x47e1bb,_0x733472,_0x2d9dfe){return new BPromise(function(_0x5c48e0,_0xb54099){return client[_0x3ad1('0xb')](_0x47e1bb,_0x2d9dfe)[_0x3ad1('0xc')](function(_0x191d11){logger[_0x3ad1('0xd')](_0x3ad1('0xe'),_0x733472,_0x3ad1('0xf'));logger['debug'](_0x3ad1('0x10'),_0x733472,'request\x20sent',JSON['stringify'](_0x191d11));if(_0x191d11['error']){if(_0x191d11['error'][_0x3ad1('0x11')]===0x1f4){logger[_0x3ad1('0x12')](_0x3ad1('0xe'),_0x733472,_0x191d11[_0x3ad1('0x12')][_0x3ad1('0x13')]);return _0xb54099(_0x191d11[_0x3ad1('0x12')][_0x3ad1('0x13')]);}logger['error'](_0x3ad1('0xe'),_0x733472,_0x191d11[_0x3ad1('0x12')][_0x3ad1('0x13')]);return _0x5c48e0(_0x191d11['error'][_0x3ad1('0x13')]);}else{logger[_0x3ad1('0xd')](_0x3ad1('0xe'),_0x733472,'request\x20sent');_0x5c48e0(_0x191d11[_0x3ad1('0x14')][_0x3ad1('0x13')]);}})['catch'](function(_0x4a3432){logger[_0x3ad1('0x12')]('VoiceMailMessage,\x20%s,\x20%s',_0x733472,_0x4a3432);_0xb54099(_0x4a3432);});});} \ No newline at end of file +var _0xca10=['info','catch','util','moment','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','VoiceMailMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message'];(function(_0x6566b9,_0x1c0120){var _0x4d70f9=function(_0x22a70b){while(--_0x22a70b){_0x6566b9['push'](_0x6566b9['shift']());}};_0x4d70f9(++_0x1c0120);}(_0xca10,0x10c));var _0x0ca1=function(_0x1a3165,_0x2142d1){_0x1a3165=_0x1a3165-0x0;var _0x23bee2=_0xca10[_0x1a3165];return _0x23bee2;};'use strict';var _=require('lodash');var util=require(_0x0ca1('0x0'));var moment=require(_0x0ca1('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0ca1('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x0ca1('0x3'))(_0x0ca1('0x4'));var config=require(_0x0ca1('0x5'));var jayson=require(_0x0ca1('0x6'));var client=jayson['client'][_0x0ca1('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xbe94bb,_0x1aed1b,_0x4109d5){return new BPromise(function(_0x3b09b0,_0x41447e){return client[_0x0ca1('0x8')](_0xbe94bb,_0x4109d5)[_0x0ca1('0x9')](function(_0x951a90){logger['info'](_0x0ca1('0xa'),_0x1aed1b,'request\x20sent');logger[_0x0ca1('0xb')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x1aed1b,_0x0ca1('0xc'),JSON[_0x0ca1('0xd')](_0x951a90));if(_0x951a90[_0x0ca1('0xe')]){if(_0x951a90[_0x0ca1('0xe')][_0x0ca1('0xf')]===0x1f4){logger[_0x0ca1('0xe')](_0x0ca1('0xa'),_0x1aed1b,_0x951a90['error']['message']);return _0x41447e(_0x951a90[_0x0ca1('0xe')][_0x0ca1('0x10')]);}logger['error'](_0x0ca1('0xa'),_0x1aed1b,_0x951a90['error']['message']);return _0x3b09b0(_0x951a90[_0x0ca1('0xe')][_0x0ca1('0x10')]);}else{logger[_0x0ca1('0x11')]('VoiceMailMessage,\x20%s,\x20%s',_0x1aed1b,_0x0ca1('0xc'));_0x3b09b0(_0x951a90['result'][_0x0ca1('0x10')]);}})[_0x0ca1('0x12')](function(_0x15b08e){logger[_0x0ca1('0xe')](_0x0ca1('0xa'),_0x1aed1b,_0x15b08e);_0x41447e(_0x15b08e);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 63a3316..d812756 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 _0xfe1b=['update','delete','destroy','/:id/sounds/:id2','removeSound','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','/:id/sounds','post','addSound','put'];(function(_0x4e4e52,_0x2ab35f){var _0x38fd83=function(_0x134286){while(--_0x134286){_0x4e4e52['push'](_0x4e4e52['shift']());}};_0x38fd83(++_0x2ab35f);}(_0xfe1b,0x166));var _0xbfe1=function(_0x29ad8c,_0x381542){_0x29ad8c=_0x29ad8c-0x0;var _0x333cad=_0xfe1b[_0x29ad8c];return _0x333cad;};'use strict';var multer=require(_0xbfe1('0x0'));var util=require(_0xbfe1('0x1'));var path=require(_0xbfe1('0x2'));var timeout=require(_0xbfe1('0x3'));var express=require(_0xbfe1('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xbfe1('0x5'));var interaction=require(_0xbfe1('0x6'));var config=require(_0xbfe1('0x7'));var controller=require('./voiceMusicOnHold.controller');router[_0xbfe1('0x8')]('/',auth['isAuthenticated'](),controller[_0xbfe1('0x9')]);router['get'](_0xbfe1('0xa'),auth[_0xbfe1('0xb')](),controller['show']);router['get'](_0xbfe1('0xc'),auth['isAuthenticated'](),controller['getSounds']);router['post']('/',auth[_0xbfe1('0xb')](),controller['create']);router[_0xbfe1('0xd')](_0xbfe1('0xc'),auth[_0xbfe1('0xb')](),controller[_0xbfe1('0xe')]);router[_0xbfe1('0xf')](_0xbfe1('0xa'),auth[_0xbfe1('0xb')](),controller[_0xbfe1('0x10')]);router[_0xbfe1('0x11')](_0xbfe1('0xa'),auth[_0xbfe1('0xb')](),controller[_0xbfe1('0x12')]);router[_0xbfe1('0x11')](_0xbfe1('0x13'),auth[_0xbfe1('0xb')](),controller[_0xbfe1('0x14')]);module[_0xbfe1('0x15')]=router; \ No newline at end of file +var _0x3a73=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','show','/:id/sounds','post','create','addSound','put','update','delete','/:id','/:id/sounds/:id2','removeSound','exports','multer','util'];(function(_0x2f4748,_0x24af55){var _0x18eece=function(_0x489dd6){while(--_0x489dd6){_0x2f4748['push'](_0x2f4748['shift']());}};_0x18eece(++_0x24af55);}(_0x3a73,0x6c));var _0x33a7=function(_0x2b7be4,_0x4498e0){_0x2b7be4=_0x2b7be4-0x0;var _0x2f65c8=_0x3a73[_0x2b7be4];return _0x2f65c8;};'use strict';var multer=require(_0x33a7('0x0'));var util=require(_0x33a7('0x1'));var path=require(_0x33a7('0x2'));var timeout=require(_0x33a7('0x3'));var express=require(_0x33a7('0x4'));var router=express[_0x33a7('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x33a7('0x6'));var interaction=require(_0x33a7('0x7'));var config=require('../../config/environment');var controller=require('./voiceMusicOnHold.controller');router[_0x33a7('0x8')]('/',auth[_0x33a7('0x9')](),controller['index']);router[_0x33a7('0x8')]('/:id',auth[_0x33a7('0x9')](),controller[_0x33a7('0xa')]);router[_0x33a7('0x8')](_0x33a7('0xb'),auth['isAuthenticated'](),controller['getSounds']);router[_0x33a7('0xc')]('/',auth[_0x33a7('0x9')](),controller[_0x33a7('0xd')]);router[_0x33a7('0xc')](_0x33a7('0xb'),auth[_0x33a7('0x9')](),controller[_0x33a7('0xe')]);router[_0x33a7('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x33a7('0x10')]);router[_0x33a7('0x11')](_0x33a7('0x12'),auth['isAuthenticated'](),controller['destroy']);router[_0x33a7('0x11')](_0x33a7('0x13'),auth['isAuthenticated'](),controller[_0x33a7('0x14')]);module[_0x33a7('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index df31ec5..a1d4d58 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 _0x0f0e=['mp3','STRING','alpha','sequelize','exports','ENUM','custom','files','mp3nb','quietmp3'];(function(_0x32d947,_0x31ab1d){var _0x17f9db=function(_0x328336){while(--_0x328336){_0x32d947['push'](_0x32d947['shift']());}};_0x17f9db(++_0x31ab1d);}(_0x0f0e,0x12f));var _0xe0f0=function(_0x54351a,_0x308b42){_0x54351a=_0x54351a-0x0;var _0x264ee2=_0x0f0e[_0x54351a];return _0x264ee2;};'use strict';var Sequelize=require(_0xe0f0('0x0'));module[_0xe0f0('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0xe0f0('0x2')](_0xe0f0('0x3'),_0xe0f0('0x4'),_0xe0f0('0x5'),'quietmp3nb',_0xe0f0('0x6'),_0xe0f0('0x7')),'allowNull':!![],'defaultValue':_0xe0f0('0x4')},'directory':{'type':Sequelize[_0xe0f0('0x8')],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize[_0xe0f0('0x8')],'allowNull':!![]},'sort':{'type':Sequelize[_0xe0f0('0x8')],'allowNull':!![],'defaultValue':_0xe0f0('0x9')},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file +var _0xb32b=['mp3nb','quietmp3nb','quietmp3','mp3','STRING','sequelize','exports','name','ENUM','custom','files'];(function(_0x224c46,_0x1c8265){var _0x4649c7=function(_0x51e821){while(--_0x51e821){_0x224c46['push'](_0x224c46['shift']());}};_0x4649c7(++_0x1c8265);}(_0xb32b,0x1bd));var _0xbb32=function(_0x9ad63,_0x26d2d2){_0x9ad63=_0x9ad63-0x0;var _0x475b97=_0xb32b[_0x9ad63];return _0x475b97;};'use strict';var Sequelize=require(_0xbb32('0x0'));module[_0xbb32('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xbb32('0x2')},'mode':{'type':Sequelize[_0xbb32('0x3')](_0xbb32('0x4'),_0xbb32('0x5'),_0xbb32('0x6'),_0xbb32('0x7'),_0xbb32('0x8'),_0xbb32('0x9')),'allowNull':!![],'defaultValue':_0xbb32('0x5')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0xbb32('0xa')],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize[_0xbb32('0xa')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0xbb32('0xa')],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize['BOOLEAN'],'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 5fa4229..11f5289 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 _0x0dfd=['crypto','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','then','get','MusicOnHolds','destroy','error','stack','name','index','VoiceMusicOnHold','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','update','body','create','sequelize','transaction','files','join','root','server/files/moh','mkdirSync','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','directory','forEach','unlinkSync','rmdirSync','Sequelize','ValidationError','message','addSound','Sound','save_name','createdAt','server/files/sounds/converted','format','basename','extname','converted_format','%s.%s','symlinkSync','removeSound','findOne','id2','getSounds','keys','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x313c9f,_0x16cf92){var _0x3debef=function(_0xdc5cac){while(--_0xdc5cac){_0x313c9f['push'](_0x313c9f['shift']());}};_0x3debef(++_0x16cf92);}(_0x0dfd,0xd5));var _0xd0df=function(_0x52798c,_0x45c8ca){_0x52798c=_0x52798c-0x0;var _0x229cf1=_0x0dfd[_0x52798c];return _0x229cf1;};'use strict';var emlformat=require(_0xd0df('0x0'));var rimraf=require(_0xd0df('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd0df('0x2'));var rp=require(_0xd0df('0x3'));var moment=require(_0xd0df('0x4'));var BPromise=require(_0xd0df('0x5'));var Mustache=require(_0xd0df('0x6'));var util=require('util');var path=require(_0xd0df('0x7'));var sox=require('sox');var csv=require(_0xd0df('0x8'));var ejs=require(_0xd0df('0x9'));var fs=require('fs');var fs_extra=require(_0xd0df('0xa'));var _=require(_0xd0df('0xb'));var squel=require(_0xd0df('0xc'));var crypto=require(_0xd0df('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd0df('0x8'));var querystring=require('querystring');var Papa=require(_0xd0df('0xe'));var Redis=require(_0xd0df('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xd0df('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd0df('0x11'));var logger=require(_0xd0df('0x12'))('api');var utils=require(_0xd0df('0x13'));var config=require(_0xd0df('0x14'));var licenseUtil=require(_0xd0df('0x15'));var db=require(_0xd0df('0x16'))['db'];function respondWithStatusCode(_0x2ed704,_0x2406d2){_0x2406d2=_0x2406d2||0xcc;return function(_0x300f1b){if(_0x300f1b){return _0x2ed704[_0xd0df('0x17')](_0x2406d2);}return _0x2ed704[_0xd0df('0x18')](_0x2406d2)[_0xd0df('0x19')]();};}function respondWithResult(_0x344b3f,_0x552fc4){_0x552fc4=_0x552fc4||0xc8;return function(_0x2fcc09){if(_0x2fcc09){return _0x344b3f[_0xd0df('0x18')](_0x552fc4)[_0xd0df('0x1a')](_0x2fcc09);}};}function respondWithFilteredResult(_0x56355a,_0x1459a1){return function(_0x2483c3){if(_0x2483c3){var _0x7e1c06=typeof _0x1459a1[_0xd0df('0x1b')]===_0xd0df('0x1c')&&typeof _0x1459a1['limit']==='undefined';var _0xa3ca8=_0x2483c3[_0xd0df('0x1d')];var _0x4de853=_0x7e1c06?0x0:_0x1459a1[_0xd0df('0x1b')];var _0x583c11=_0x7e1c06?_0x2483c3[_0xd0df('0x1d')]:_0x1459a1[_0xd0df('0x1b')]+_0x1459a1[_0xd0df('0x1e')];var _0x1bdfbc;if(_0x583c11>=_0xa3ca8){_0x583c11=_0xa3ca8;_0x1bdfbc=0xc8;}else{_0x1bdfbc=0xce;}_0x56355a[_0xd0df('0x18')](_0x1bdfbc);return _0x56355a[_0xd0df('0x1f')](_0xd0df('0x20'),_0x4de853+'-'+_0x583c11+'/'+_0xa3ca8)['json'](_0x2483c3);}return null;};}function patchUpdates(_0x50b729){return function(_0x5a418b){try{jsonpatch['apply'](_0x5a418b,_0x50b729,!![]);}catch(_0x478606){return BPromise[_0xd0df('0x21')](_0x478606);}return _0x5a418b[_0xd0df('0x22')]();};}function saveUpdates(_0x556db6,_0x2b2ca4){return function(_0x478f94){if(_0x478f94){return _0x478f94['update'](_0x556db6)[_0xd0df('0x23')](function(_0x2931e7){return _0x2931e7;});}return null;};}function removeEntity(_0x19b3ea,_0x451a9e){return function(_0x50305b){if(_0x50305b){return _0x50305b['destroy']()['then'](function(){var _0x47dcfa=_0x50305b[_0xd0df('0x24')]({'plain':!![]});var _0x3f27f0=_0xd0df('0x25');return db['UserProfileResource'][_0xd0df('0x26')]({'where':{'type':_0x3f27f0,'resourceId':_0x47dcfa['id']}})[_0xd0df('0x23')](function(){return _0x50305b;});})[_0xd0df('0x23')](function(){_0x19b3ea[_0xd0df('0x18')](0xcc)[_0xd0df('0x19')]();});}};}function handleEntityNotFound(_0x1aaa68,_0xdc1b69){return function(_0x35feac){if(!_0x35feac){_0x1aaa68[_0xd0df('0x17')](0x194);}return _0x35feac;};}function handleError(_0x3acd65,_0x232aa1){_0x232aa1=_0x232aa1||0x1f4;return function(_0x2d1c1e){logger[_0xd0df('0x27')](_0x2d1c1e[_0xd0df('0x28')]);if(_0x2d1c1e[_0xd0df('0x29')]){delete _0x2d1c1e[_0xd0df('0x29')];}_0x3acd65[_0xd0df('0x18')](_0x232aa1)['send'](_0x2d1c1e);};}exports[_0xd0df('0x2a')]=function(_0x15ac3d,_0x1a9cfa){var _0x3d9e30={},_0x3e7f44={},_0x39c5c5={'count':0x0,'rows':[]};var _0x39adce=_['map'](db[_0xd0df('0x2b')][_0xd0df('0x2c')],function(_0x55c60c){return{'name':_0x55c60c[_0xd0df('0x2d')],'type':_0x55c60c[_0xd0df('0x2e')][_0xd0df('0x2f')]};});_0x3e7f44[_0xd0df('0x30')]=_['map'](_0x39adce,'name');_0x3e7f44[_0xd0df('0x31')]=_['keys'](_0x15ac3d['query']);_0x3e7f44[_0xd0df('0x32')]=_[_0xd0df('0x33')](_0x3e7f44[_0xd0df('0x30')],_0x3e7f44[_0xd0df('0x31')]);_0x3d9e30[_0xd0df('0x34')]=_[_0xd0df('0x33')](_0x3e7f44[_0xd0df('0x30')],qs['fields'](_0x15ac3d['query'][_0xd0df('0x35')]));_0x3d9e30[_0xd0df('0x34')]=_0x3d9e30[_0xd0df('0x34')][_0xd0df('0x36')]?_0x3d9e30['attributes']:_0x3e7f44[_0xd0df('0x30')];if(!_0x15ac3d['query'][_0xd0df('0x37')](_0xd0df('0x38'))){_0x3d9e30[_0xd0df('0x1e')]=qs[_0xd0df('0x1e')](_0x15ac3d['query']['limit']);_0x3d9e30['offset']=qs[_0xd0df('0x1b')](_0x15ac3d[_0xd0df('0x31')][_0xd0df('0x1b')]);}_0x3d9e30[_0xd0df('0x39')]=qs['sort'](_0x15ac3d[_0xd0df('0x31')]['sort']);delete _0x15ac3d['query'][_0xd0df('0x3a')];_0x3d9e30['where']=qs['filters'](_[_0xd0df('0x3b')](_0x15ac3d[_0xd0df('0x31')],_0x3e7f44[_0xd0df('0x32')]),_0x39adce);if(_0x15ac3d[_0xd0df('0x31')][_0xd0df('0x3c')]){_0x3d9e30[_0xd0df('0x3d')]=_[_0xd0df('0x3e')](_0x3d9e30['where'],{'$or':_[_0xd0df('0x3f')](_0x39adce,function(_0x1bfb5a){if(_0x1bfb5a[_0xd0df('0x2e')]!==_0xd0df('0x40')){var _0xbe5fc={};_0xbe5fc[_0x1bfb5a[_0xd0df('0x29')]]={'$like':'%'+_0x15ac3d['query']['filter']+'%'};return _0xbe5fc;}})});}_0x3d9e30=_[_0xd0df('0x3e')]({},_0x3d9e30,_0x15ac3d[_0xd0df('0x41')]);var _0x9316d1={'where':_0x3d9e30[_0xd0df('0x3d')]};return db[_0xd0df('0x2b')][_0xd0df('0x1d')](_0x9316d1)[_0xd0df('0x23')](function(_0x1e5c60){_0x39c5c5[_0xd0df('0x1d')]=_0x1e5c60;if(_0x15ac3d[_0xd0df('0x31')][_0xd0df('0x42')]){_0x3d9e30[_0xd0df('0x43')]=[{'all':!![]}];}return db[_0xd0df('0x2b')][_0xd0df('0x44')](_0x3d9e30);})[_0xd0df('0x23')](function(_0x178496){_0x39c5c5[_0xd0df('0x45')]=_0x178496;return _0x39c5c5;})[_0xd0df('0x23')](respondWithFilteredResult(_0x1a9cfa,_0x3d9e30))[_0xd0df('0x46')](handleError(_0x1a9cfa,null));};exports[_0xd0df('0x47')]=function(_0x9e1da6,_0x2da6e0){var _0x48cbf0={'raw':![],'where':{'id':_0x9e1da6[_0xd0df('0x48')]['id']}},_0x3b4fe2={};_0x3b4fe2[_0xd0df('0x30')]=_['keys'](db[_0xd0df('0x2b')][_0xd0df('0x2c')]);_0x3b4fe2['query']=_['keys'](_0x9e1da6['query']);_0x3b4fe2[_0xd0df('0x32')]=_[_0xd0df('0x33')](_0x3b4fe2[_0xd0df('0x30')],_0x3b4fe2[_0xd0df('0x31')]);_0x48cbf0[_0xd0df('0x34')]=_[_0xd0df('0x33')](_0x3b4fe2['model'],qs[_0xd0df('0x35')](_0x9e1da6['query'][_0xd0df('0x35')]));_0x48cbf0[_0xd0df('0x34')]=_0x48cbf0[_0xd0df('0x34')][_0xd0df('0x36')]?_0x48cbf0[_0xd0df('0x34')]:_0x3b4fe2['model'];if(_0x9e1da6['query'][_0xd0df('0x42')]){_0x48cbf0[_0xd0df('0x43')]=[{'all':!![]}];}_0x48cbf0=_[_0xd0df('0x3e')]({},_0x48cbf0,_0x9e1da6['options']);return db[_0xd0df('0x2b')][_0xd0df('0x49')](_0x48cbf0)[_0xd0df('0x23')](handleEntityNotFound(_0x2da6e0,null))[_0xd0df('0x23')](respondWithResult(_0x2da6e0,null))['catch'](handleError(_0x2da6e0,null));};exports[_0xd0df('0x4a')]=function(_0x44eb72,_0x3a0ced){if(_0x44eb72[_0xd0df('0x4b')]['id']){delete _0x44eb72[_0xd0df('0x4b')]['id'];}return db[_0xd0df('0x2b')][_0xd0df('0x49')]({'where':{'id':_0x44eb72[_0xd0df('0x48')]['id']}})[_0xd0df('0x23')](handleEntityNotFound(_0x3a0ced,null))[_0xd0df('0x23')](saveUpdates(_0x44eb72[_0xd0df('0x4b')],null))[_0xd0df('0x23')](respondWithResult(_0x3a0ced,null))[_0xd0df('0x46')](handleError(_0x3a0ced,null));};exports[_0xd0df('0x4c')]=function(_0x1e803e,_0x274e29,_0x41cbc6){return db[_0xd0df('0x4d')][_0xd0df('0x4e')](function(_0x23df68){if(_0x1e803e[_0xd0df('0x4b')]['mode']===_0xd0df('0x4f')){_0x1e803e[_0xd0df('0x4b')]['directory']=path[_0xd0df('0x50')](config[_0xd0df('0x51')],_0xd0df('0x52'),_0x1e803e['body'][_0xd0df('0x29')]);}return db['VoiceMusicOnHold']['create'](_0x1e803e[_0xd0df('0x4b')],{'transaction':_0x23df68})[_0xd0df('0x23')](function(_0x48d8c2){if(_0x1e803e['body']['mode']===_0xd0df('0x4f')){fs[_0xd0df('0x53')](_0x48d8c2['directory'],parseInt('0777',0x8));}var _0x51e906=_0x1e803e['user'][_0xd0df('0x24')]({'plain':!![]});if(!_0x51e906)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x51e906[_0xd0df('0x54')]===_0xd0df('0x55')){var _0x285a6c=_0x48d8c2[_0xd0df('0x24')]({'plain':!![]});return db[_0xd0df('0x56')]['find']({'where':{'name':'MusicOnHolds','userProfileId':_0x51e906[_0xd0df('0x57')]},'raw':!![]})[_0xd0df('0x23')](function(_0x4a80ce){if(_0x4a80ce&&_0x4a80ce[_0xd0df('0x58')]===0x0){return db['UserProfileResource']['create']({'name':_0x285a6c['name'],'resourceId':_0x285a6c['id'],'type':_0x4a80ce[_0xd0df('0x29')],'sectionId':_0x4a80ce['id']},{})['then'](function(){return _0x48d8c2;});}else{return _0x48d8c2;}})[_0xd0df('0x46')](function(_0x565b08){logger[_0xd0df('0x27')](_0xd0df('0x59'),_0x565b08);});}return _0x48d8c2;});})[_0xd0df('0x23')](respondWithResult(_0x274e29,0xc9))[_0xd0df('0x46')](handleError(_0x274e29,null));};exports['destroy']=function(_0x4071fa,_0x162cad,_0x129ee7){var _0x3d4572;return db[_0xd0df('0x2b')][_0xd0df('0x49')]({'where':{'id':_0x4071fa['params']['id']}})[_0xd0df('0x23')](function(_0x1edbb9){if(_0x1edbb9){return db[_0xd0df('0x4d')][_0xd0df('0x4e')](function(_0x38e5d2){return _0x1edbb9[_0xd0df('0x26')]({'transaction':_0x38e5d2,'raw':!![]})[_0xd0df('0x23')](function(_0x1e058d){if(_0x1e058d[_0xd0df('0x5a')]){fs['readdirSync'](_0x1e058d[_0xd0df('0x5a')])[_0xd0df('0x5b')](function(_0x16f96d){fs[_0xd0df('0x5c')](path['join'](_0x1e058d['directory'],_0x16f96d));});fs[_0xd0df('0x5d')](_0x1e058d[_0xd0df('0x5a')]);}return _0x1e058d;});})['catch'](function(_0xd586f1){throw new db[(_0xd0df('0x5e'))][(_0xd0df('0x5f'))](_0xd586f1[_0xd0df('0x60')]);});}})[_0xd0df('0x23')](handleEntityNotFound(_0x162cad,null))[_0xd0df('0x23')](removeEntity(_0x162cad,null))['catch'](handleError(_0x162cad,null));};exports[_0xd0df('0x61')]=function(_0x2de4d4,_0x32ad34,_0x2e7540){return db['sequelize']['transaction'](function(_0x2679c3){var _0x26a02a;return db[_0xd0df('0x2b')][_0xd0df('0x49')]({'where':{'id':_0x2de4d4[_0xd0df('0x48')]['id']}})[_0xd0df('0x23')](function(_0x2393c3){if(_0x2393c3){_0x26a02a=_0x2393c3;return _0x2393c3['addSound'](_0x2de4d4[_0xd0df('0x4b')]['id'],{'transaction':_0x2679c3});}})[_0xd0df('0x23')](function(_0x2bdb86){if(_0x2bdb86){return db[_0xd0df('0x62')]['findOne']({'where':{'id':_0x2de4d4[_0xd0df('0x4b')]['id']},'attributes':['id',_0xd0df('0x29'),_0xd0df('0x63'),'converted_format',_0xd0df('0x64')],'raw':!![]});}})[_0xd0df('0x23')](function(_0x3bd4e8){if(_0x3bd4e8){var _0x43d03c=path[_0xd0df('0x50')](config[_0xd0df('0x51')],_0xd0df('0x65'),util[_0xd0df('0x66')]('%s.%s',path[_0xd0df('0x67')](_0x3bd4e8['save_name'],path[_0xd0df('0x68')](_0x3bd4e8[_0xd0df('0x63')])),_0x3bd4e8[_0xd0df('0x69')]));var _0x319207=path[_0xd0df('0x50')](config[_0xd0df('0x51')],_0xd0df('0x52'),_0x26a02a['name'],util[_0xd0df('0x66')](_0xd0df('0x6a'),_0x3bd4e8[_0xd0df('0x29')],_0x3bd4e8[_0xd0df('0x69')]));fs[_0xd0df('0x6b')](_0x43d03c,_0x319207);return _0x3bd4e8;}})[_0xd0df('0x46')](function(_0x142763){throw new db[(_0xd0df('0x5e'))][(_0xd0df('0x5f'))](_0x142763[_0xd0df('0x60')]);});})[_0xd0df('0x23')](handleEntityNotFound(_0x32ad34,null))[_0xd0df('0x23')](respondWithResult(_0x32ad34,0xc9))[_0xd0df('0x46')](handleError(_0x32ad34,null));};exports[_0xd0df('0x6c')]=function(_0x531fbc,_0x1e1969,_0x40b25e){return db[_0xd0df('0x4d')][_0xd0df('0x4e')](function(_0x214a05){var _0x80f679;return db['VoiceMusicOnHold'][_0xd0df('0x6d')]({'where':{'id':_0x531fbc[_0xd0df('0x48')]['id']}})[_0xd0df('0x23')](handleEntityNotFound(_0x1e1969,null))[_0xd0df('0x23')](function(_0x2ec7a1){if(_0x2ec7a1){_0x80f679=_0x2ec7a1;return _0x2ec7a1[_0xd0df('0x6c')](_0x531fbc[_0xd0df('0x48')][_0xd0df('0x6e')]);}})[_0xd0df('0x23')](function(_0x1fc7a9){if(_0x1fc7a9){return db['Sound'][_0xd0df('0x6d')]({'where':{'id':_0x531fbc['params']['id2']},'attributes':['id','name',_0xd0df('0x63'),'converted_format',_0xd0df('0x64')],'raw':!![]});}})['then'](function(_0x19433e){if(_0x19433e){fs[_0xd0df('0x5c')](path[_0xd0df('0x50')](_0x80f679[_0xd0df('0x5a')],util[_0xd0df('0x66')](_0xd0df('0x6a'),_0x19433e['name'],_0x19433e[_0xd0df('0x69')])));return _0x19433e;}})['catch'](function(_0x2043fa){throw new db['Sequelize'][(_0xd0df('0x5f'))](_0x2043fa[_0xd0df('0x60')]);});})[_0xd0df('0x23')](handleEntityNotFound(_0x1e1969,null))['then'](respondWithStatusCode(_0x1e1969,0xcc))[_0xd0df('0x46')](handleError(_0x1e1969,null));};exports[_0xd0df('0x6f')]=function(_0x50d325,_0x753858,_0x28d3ee){var _0x3c57b3={};var _0x1b8f98={};var _0x5c3c6c;var _0x5e130d;return db[_0xd0df('0x2b')][_0xd0df('0x6d')]({'where':{'id':_0x50d325[_0xd0df('0x48')]['id']}})[_0xd0df('0x23')](handleEntityNotFound(_0x753858,null))[_0xd0df('0x23')](function(_0x3ab5d3){if(_0x3ab5d3){_0x5c3c6c=_0x3ab5d3;_0x1b8f98[_0xd0df('0x30')]=_['keys'](db['Sound'][_0xd0df('0x2c')]);_0x1b8f98[_0xd0df('0x31')]=_[_0xd0df('0x70')](_0x50d325[_0xd0df('0x31')]);_0x1b8f98[_0xd0df('0x32')]=_[_0xd0df('0x33')](_0x1b8f98[_0xd0df('0x30')],_0x1b8f98['query']);_0x3c57b3['attributes']=_[_0xd0df('0x33')](_0x1b8f98['model'],qs[_0xd0df('0x35')](_0x50d325[_0xd0df('0x31')][_0xd0df('0x35')]));_0x3c57b3[_0xd0df('0x34')]=_0x3c57b3[_0xd0df('0x34')][_0xd0df('0x36')]?_0x3c57b3['attributes']:_0x1b8f98[_0xd0df('0x30')];_0x3c57b3[_0xd0df('0x39')]=qs[_0xd0df('0x3a')](_0x50d325[_0xd0df('0x31')][_0xd0df('0x3a')]);_0x3c57b3[_0xd0df('0x3d')]=qs[_0xd0df('0x32')](_[_0xd0df('0x3b')](_0x50d325['query'],_0x1b8f98['filters']));if(_0x50d325[_0xd0df('0x31')][_0xd0df('0x3c')]){_0x3c57b3[_0xd0df('0x3d')]=_[_0xd0df('0x3e')](_0x3c57b3[_0xd0df('0x3d')],{'$or':_['map'](_0x3c57b3['attributes'],function(_0x22c8b3){var _0xc085e3={};_0xc085e3[_0x22c8b3]={'$like':'%'+_0x50d325['query']['filter']+'%'};return _0xc085e3;})});}_0x3c57b3=_[_0xd0df('0x3e')]({},_0x3c57b3,_0x50d325[_0xd0df('0x41')]);return _0x5c3c6c[_0xd0df('0x6f')](_0x3c57b3);}})[_0xd0df('0x23')](function(_0x7830db){if(_0x7830db){_0x5e130d=_0x7830db[_0xd0df('0x36')];if(!_0x50d325['query'][_0xd0df('0x37')](_0xd0df('0x38'))){_0x3c57b3[_0xd0df('0x1e')]=qs[_0xd0df('0x1e')](_0x50d325['query'][_0xd0df('0x1e')]);_0x3c57b3[_0xd0df('0x1b')]=qs[_0xd0df('0x1b')](_0x50d325[_0xd0df('0x31')][_0xd0df('0x1b')]);}return _0x5c3c6c[_0xd0df('0x6f')](_0x3c57b3);}})[_0xd0df('0x23')](function(_0x376698){if(_0x376698){return _0x376698?{'count':_0x5e130d,'rows':_0x376698}:null;}})['then'](respondWithResult(_0x753858,null))[_0xd0df('0x46')](handleError(_0x753858,null));}; \ No newline at end of file +var _0xe825=['Sequelize','ValidationError','message','addSound','Sound','findOne','converted_format','createdAt','join','server/files/sounds/converted','format','%s.%s','save_name','extname','symlinkSync','id2','getSounds','eml-format','rimraf','fast-json-patch','request-promise','moment','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','get','MusicOnHolds','UserProfileResource','stack','index','map','rawAttributes','fieldName','type','key','model','name','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','VIRTUAL','filter','options','VoiceMusicOnHold','includeAll','include','rows','catch','params','keys','body','sequelize','transaction','mode','directory','root','server/files/moh','create','mkdirSync','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','readdirSync','forEach','unlinkSync','rmdirSync'];(function(_0x3aeec2,_0x2dcdba){var _0x3aea49=function(_0x3f4123){while(--_0x3f4123){_0x3aeec2['push'](_0x3aeec2['shift']());}};_0x3aea49(++_0x2dcdba);}(_0xe825,0x80));var _0x5e82=function(_0x3133c8,_0x1ecaa8){_0x3133c8=_0x3133c8-0x0;var _0x1d4f12=_0xe825[_0x3133c8];return _0x1d4f12;};'use strict';var emlformat=require(_0x5e82('0x0'));var rimraf=require(_0x5e82('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5e82('0x2'));var rp=require(_0x5e82('0x3'));var moment=require(_0x5e82('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5e82('0x5'));var path=require('path');var sox=require(_0x5e82('0x6'));var csv=require(_0x5e82('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5e82('0x8'));var _=require(_0x5e82('0x9'));var squel=require(_0x5e82('0xa'));var crypto=require(_0x5e82('0xb'));var jsforce=require(_0x5e82('0xc'));var deskjs=require(_0x5e82('0xd'));var toCsv=require(_0x5e82('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5e82('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x5e82('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5e82('0x10'));var logger=require(_0x5e82('0x11'))(_0x5e82('0x12'));var utils=require(_0x5e82('0x13'));var config=require(_0x5e82('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x5e82('0x15'))['db'];function respondWithStatusCode(_0x429938,_0x4e9b7d){_0x4e9b7d=_0x4e9b7d||0xcc;return function(_0x57c280){if(_0x57c280){return _0x429938[_0x5e82('0x16')](_0x4e9b7d);}return _0x429938['status'](_0x4e9b7d)[_0x5e82('0x17')]();};}function respondWithResult(_0xefac61,_0x54975f){_0x54975f=_0x54975f||0xc8;return function(_0x346a80){if(_0x346a80){return _0xefac61[_0x5e82('0x18')](_0x54975f)[_0x5e82('0x19')](_0x346a80);}};}function respondWithFilteredResult(_0x2e304b,_0x52e156){return function(_0x1212e2){if(_0x1212e2){var _0x4e71f4=typeof _0x52e156[_0x5e82('0x1a')]===_0x5e82('0x1b')&&typeof _0x52e156[_0x5e82('0x1c')]===_0x5e82('0x1b');var _0x36b962=_0x1212e2[_0x5e82('0x1d')];var _0x3cb1de=_0x4e71f4?0x0:_0x52e156['offset'];var _0x21f50e=_0x4e71f4?_0x1212e2[_0x5e82('0x1d')]:_0x52e156[_0x5e82('0x1a')]+_0x52e156[_0x5e82('0x1c')];var _0x44e3ad;if(_0x21f50e>=_0x36b962){_0x21f50e=_0x36b962;_0x44e3ad=0xc8;}else{_0x44e3ad=0xce;}_0x2e304b[_0x5e82('0x18')](_0x44e3ad);return _0x2e304b[_0x5e82('0x1e')](_0x5e82('0x1f'),_0x3cb1de+'-'+_0x21f50e+'/'+_0x36b962)[_0x5e82('0x19')](_0x1212e2);}return null;};}function patchUpdates(_0x485fd7){return function(_0x43770b){try{jsonpatch[_0x5e82('0x20')](_0x43770b,_0x485fd7,!![]);}catch(_0x91def7){return BPromise['reject'](_0x91def7);}return _0x43770b[_0x5e82('0x21')]();};}function saveUpdates(_0x507f77,_0x197cdb){return function(_0x3be6cb){if(_0x3be6cb){return _0x3be6cb[_0x5e82('0x22')](_0x507f77)[_0x5e82('0x23')](function(_0x525d44){return _0x525d44;});}return null;};}function removeEntity(_0x381584,_0xc7dc3b){return function(_0x2e0a69){if(_0x2e0a69){return _0x2e0a69['destroy']()[_0x5e82('0x23')](function(){var _0x4e7311=_0x2e0a69[_0x5e82('0x24')]({'plain':!![]});var _0x1ccdbc=_0x5e82('0x25');return db[_0x5e82('0x26')]['destroy']({'where':{'type':_0x1ccdbc,'resourceId':_0x4e7311['id']}})['then'](function(){return _0x2e0a69;});})[_0x5e82('0x23')](function(){_0x381584[_0x5e82('0x18')](0xcc)[_0x5e82('0x17')]();});}};}function handleEntityNotFound(_0x2e595e,_0x2f6c5e){return function(_0x206f22){if(!_0x206f22){_0x2e595e[_0x5e82('0x16')](0x194);}return _0x206f22;};}function handleError(_0xa001bb,_0x155582){_0x155582=_0x155582||0x1f4;return function(_0x38bb8a){logger['error'](_0x38bb8a[_0x5e82('0x27')]);if(_0x38bb8a['name']){delete _0x38bb8a['name'];}_0xa001bb['status'](_0x155582)['send'](_0x38bb8a);};}exports[_0x5e82('0x28')]=function(_0x1f3e40,_0x38d445){var _0x3352c1={},_0x46b66b={},_0xd9dfac={'count':0x0,'rows':[]};var _0x387bd8=_[_0x5e82('0x29')](db['VoiceMusicOnHold'][_0x5e82('0x2a')],function(_0x34fe13){return{'name':_0x34fe13[_0x5e82('0x2b')],'type':_0x34fe13[_0x5e82('0x2c')][_0x5e82('0x2d')]};});_0x46b66b[_0x5e82('0x2e')]=_[_0x5e82('0x29')](_0x387bd8,_0x5e82('0x2f'));_0x46b66b[_0x5e82('0x30')]=_['keys'](_0x1f3e40['query']);_0x46b66b['filters']=_[_0x5e82('0x31')](_0x46b66b[_0x5e82('0x2e')],_0x46b66b[_0x5e82('0x30')]);_0x3352c1['attributes']=_['intersection'](_0x46b66b[_0x5e82('0x2e')],qs[_0x5e82('0x32')](_0x1f3e40[_0x5e82('0x30')][_0x5e82('0x32')]));_0x3352c1['attributes']=_0x3352c1[_0x5e82('0x33')][_0x5e82('0x34')]?_0x3352c1[_0x5e82('0x33')]:_0x46b66b[_0x5e82('0x2e')];if(!_0x1f3e40[_0x5e82('0x30')][_0x5e82('0x35')](_0x5e82('0x36'))){_0x3352c1['limit']=qs['limit'](_0x1f3e40['query']['limit']);_0x3352c1[_0x5e82('0x1a')]=qs['offset'](_0x1f3e40[_0x5e82('0x30')][_0x5e82('0x1a')]);}_0x3352c1[_0x5e82('0x37')]=qs[_0x5e82('0x38')](_0x1f3e40[_0x5e82('0x30')]['sort']);delete _0x1f3e40['query'][_0x5e82('0x38')];_0x3352c1[_0x5e82('0x39')]=qs['filters'](_[_0x5e82('0x3a')](_0x1f3e40[_0x5e82('0x30')],_0x46b66b[_0x5e82('0x3b')]),_0x387bd8);if(_0x1f3e40['query']['filter']){_0x3352c1[_0x5e82('0x39')]=_[_0x5e82('0x3c')](_0x3352c1[_0x5e82('0x39')],{'$or':_[_0x5e82('0x29')](_0x387bd8,function(_0x262b12){if(_0x262b12[_0x5e82('0x2c')]!==_0x5e82('0x3d')){var _0xe817d={};_0xe817d[_0x262b12['name']]={'$like':'%'+_0x1f3e40['query'][_0x5e82('0x3e')]+'%'};return _0xe817d;}})});}_0x3352c1=_[_0x5e82('0x3c')]({},_0x3352c1,_0x1f3e40[_0x5e82('0x3f')]);var _0x13b9f6={'where':_0x3352c1['where']};return db[_0x5e82('0x40')][_0x5e82('0x1d')](_0x13b9f6)[_0x5e82('0x23')](function(_0x2a87fd){_0xd9dfac['count']=_0x2a87fd;if(_0x1f3e40['query'][_0x5e82('0x41')]){_0x3352c1[_0x5e82('0x42')]=[{'all':!![]}];}return db[_0x5e82('0x40')]['findAll'](_0x3352c1);})[_0x5e82('0x23')](function(_0x11733d){_0xd9dfac[_0x5e82('0x43')]=_0x11733d;return _0xd9dfac;})[_0x5e82('0x23')](respondWithFilteredResult(_0x38d445,_0x3352c1))[_0x5e82('0x44')](handleError(_0x38d445,null));};exports['show']=function(_0x1e23b3,_0x34265c){var _0x12ddcb={'raw':![],'where':{'id':_0x1e23b3[_0x5e82('0x45')]['id']}},_0x475577={};_0x475577[_0x5e82('0x2e')]=_[_0x5e82('0x46')](db[_0x5e82('0x40')][_0x5e82('0x2a')]);_0x475577['query']=_[_0x5e82('0x46')](_0x1e23b3[_0x5e82('0x30')]);_0x475577['filters']=_['intersection'](_0x475577[_0x5e82('0x2e')],_0x475577[_0x5e82('0x30')]);_0x12ddcb[_0x5e82('0x33')]=_[_0x5e82('0x31')](_0x475577[_0x5e82('0x2e')],qs[_0x5e82('0x32')](_0x1e23b3['query'][_0x5e82('0x32')]));_0x12ddcb[_0x5e82('0x33')]=_0x12ddcb[_0x5e82('0x33')][_0x5e82('0x34')]?_0x12ddcb['attributes']:_0x475577[_0x5e82('0x2e')];if(_0x1e23b3[_0x5e82('0x30')][_0x5e82('0x41')]){_0x12ddcb['include']=[{'all':!![]}];}_0x12ddcb=_[_0x5e82('0x3c')]({},_0x12ddcb,_0x1e23b3[_0x5e82('0x3f')]);return db[_0x5e82('0x40')]['find'](_0x12ddcb)[_0x5e82('0x23')](handleEntityNotFound(_0x34265c,null))['then'](respondWithResult(_0x34265c,null))[_0x5e82('0x44')](handleError(_0x34265c,null));};exports[_0x5e82('0x22')]=function(_0x2e6008,_0x32ece4){if(_0x2e6008[_0x5e82('0x47')]['id']){delete _0x2e6008['body']['id'];}return db[_0x5e82('0x40')]['find']({'where':{'id':_0x2e6008[_0x5e82('0x45')]['id']}})['then'](handleEntityNotFound(_0x32ece4,null))[_0x5e82('0x23')](saveUpdates(_0x2e6008[_0x5e82('0x47')],null))['then'](respondWithResult(_0x32ece4,null))[_0x5e82('0x44')](handleError(_0x32ece4,null));};exports['create']=function(_0x1b72df,_0x26485f,_0x41ba2e){return db[_0x5e82('0x48')][_0x5e82('0x49')](function(_0x38c5d1){if(_0x1b72df[_0x5e82('0x47')][_0x5e82('0x4a')]==='files'){_0x1b72df[_0x5e82('0x47')][_0x5e82('0x4b')]=path['join'](config[_0x5e82('0x4c')],_0x5e82('0x4d'),_0x1b72df['body'][_0x5e82('0x2f')]);}return db[_0x5e82('0x40')][_0x5e82('0x4e')](_0x1b72df[_0x5e82('0x47')],{'transaction':_0x38c5d1})['then'](function(_0x3846e8){if(_0x1b72df[_0x5e82('0x47')]['mode']==='files'){fs[_0x5e82('0x4f')](_0x3846e8['directory'],parseInt(_0x5e82('0x50'),0x8));}var _0x489cab=_0x1b72df[_0x5e82('0x51')][_0x5e82('0x24')]({'plain':!![]});if(!_0x489cab)throw new Error(_0x5e82('0x52'));if(_0x489cab[_0x5e82('0x53')]===_0x5e82('0x51')){var _0x57e832=_0x3846e8['get']({'plain':!![]});return db[_0x5e82('0x54')][_0x5e82('0x55')]({'where':{'name':_0x5e82('0x25'),'userProfileId':_0x489cab['userProfileId']},'raw':!![]})[_0x5e82('0x23')](function(_0x138d61){if(_0x138d61&&_0x138d61[_0x5e82('0x56')]===0x0){return db[_0x5e82('0x26')][_0x5e82('0x4e')]({'name':_0x57e832[_0x5e82('0x2f')],'resourceId':_0x57e832['id'],'type':_0x138d61[_0x5e82('0x2f')],'sectionId':_0x138d61['id']},{})[_0x5e82('0x23')](function(){return _0x3846e8;});}else{return _0x3846e8;}})[_0x5e82('0x44')](function(_0x124050){logger[_0x5e82('0x57')](_0x5e82('0x58'),_0x124050);});}return _0x3846e8;});})[_0x5e82('0x23')](respondWithResult(_0x26485f,0xc9))[_0x5e82('0x44')](handleError(_0x26485f,null));};exports[_0x5e82('0x59')]=function(_0x484d4c,_0x1563f2,_0x44b226){var _0x85e684;return db[_0x5e82('0x40')]['find']({'where':{'id':_0x484d4c[_0x5e82('0x45')]['id']}})[_0x5e82('0x23')](function(_0x42ffe5){if(_0x42ffe5){return db['sequelize'][_0x5e82('0x49')](function(_0x5e471d){return _0x42ffe5[_0x5e82('0x59')]({'transaction':_0x5e471d,'raw':!![]})[_0x5e82('0x23')](function(_0x4334b6){if(_0x4334b6[_0x5e82('0x4b')]){fs[_0x5e82('0x5a')](_0x4334b6['directory'])[_0x5e82('0x5b')](function(_0x3fcfce){fs[_0x5e82('0x5c')](path['join'](_0x4334b6[_0x5e82('0x4b')],_0x3fcfce));});fs[_0x5e82('0x5d')](_0x4334b6['directory']);}return _0x4334b6;});})[_0x5e82('0x44')](function(_0x2cc8d6){throw new db[(_0x5e82('0x5e'))][(_0x5e82('0x5f'))](_0x2cc8d6[_0x5e82('0x60')]);});}})[_0x5e82('0x23')](handleEntityNotFound(_0x1563f2,null))['then'](removeEntity(_0x1563f2,null))[_0x5e82('0x44')](handleError(_0x1563f2,null));};exports[_0x5e82('0x61')]=function(_0x55fd1a,_0x5ee523,_0x297574){return db[_0x5e82('0x48')]['transaction'](function(_0x529c21){var _0x3b9be2;return db[_0x5e82('0x40')][_0x5e82('0x55')]({'where':{'id':_0x55fd1a['params']['id']}})['then'](function(_0x51db80){if(_0x51db80){_0x3b9be2=_0x51db80;return _0x51db80['addSound'](_0x55fd1a['body']['id'],{'transaction':_0x529c21});}})[_0x5e82('0x23')](function(_0x4df9fd){if(_0x4df9fd){return db[_0x5e82('0x62')][_0x5e82('0x63')]({'where':{'id':_0x55fd1a[_0x5e82('0x47')]['id']},'attributes':['id','name','save_name',_0x5e82('0x64'),_0x5e82('0x65')],'raw':!![]});}})['then'](function(_0x171134){if(_0x171134){var _0x23d934=path[_0x5e82('0x66')](config[_0x5e82('0x4c')],_0x5e82('0x67'),util[_0x5e82('0x68')](_0x5e82('0x69'),path['basename'](_0x171134[_0x5e82('0x6a')],path[_0x5e82('0x6b')](_0x171134[_0x5e82('0x6a')])),_0x171134[_0x5e82('0x64')]));var _0x343a5a=path['join'](config['root'],'server/files/moh',_0x3b9be2['name'],util['format'](_0x5e82('0x69'),_0x171134['name'],_0x171134[_0x5e82('0x64')]));fs[_0x5e82('0x6c')](_0x23d934,_0x343a5a);return _0x171134;}})[_0x5e82('0x44')](function(_0x4d06bc){throw new db[(_0x5e82('0x5e'))][(_0x5e82('0x5f'))](_0x4d06bc['message']);});})[_0x5e82('0x23')](handleEntityNotFound(_0x5ee523,null))['then'](respondWithResult(_0x5ee523,0xc9))[_0x5e82('0x44')](handleError(_0x5ee523,null));};exports['removeSound']=function(_0x19f765,_0x4b4c10,_0x5bed62){return db[_0x5e82('0x48')][_0x5e82('0x49')](function(_0x475720){var _0x354d78;return db[_0x5e82('0x40')][_0x5e82('0x63')]({'where':{'id':_0x19f765[_0x5e82('0x45')]['id']}})['then'](handleEntityNotFound(_0x4b4c10,null))[_0x5e82('0x23')](function(_0x348d92){if(_0x348d92){_0x354d78=_0x348d92;return _0x348d92['removeSound'](_0x19f765['params'][_0x5e82('0x6d')]);}})[_0x5e82('0x23')](function(_0x5e06d9){if(_0x5e06d9){return db[_0x5e82('0x62')][_0x5e82('0x63')]({'where':{'id':_0x19f765[_0x5e82('0x45')][_0x5e82('0x6d')]},'attributes':['id','name','save_name',_0x5e82('0x64'),'createdAt'],'raw':!![]});}})[_0x5e82('0x23')](function(_0x48f050){if(_0x48f050){fs[_0x5e82('0x5c')](path[_0x5e82('0x66')](_0x354d78[_0x5e82('0x4b')],util[_0x5e82('0x68')](_0x5e82('0x69'),_0x48f050[_0x5e82('0x2f')],_0x48f050[_0x5e82('0x64')])));return _0x48f050;}})[_0x5e82('0x44')](function(_0x35e18c){throw new db[(_0x5e82('0x5e'))]['ValidationError'](_0x35e18c['message']);});})['then'](handleEntityNotFound(_0x4b4c10,null))[_0x5e82('0x23')](respondWithStatusCode(_0x4b4c10,0xcc))[_0x5e82('0x44')](handleError(_0x4b4c10,null));};exports[_0x5e82('0x6e')]=function(_0x9b5ab6,_0x3be7d7,_0x276a78){var _0x4bfffc={};var _0x3728b8={};var _0xcdff30;var _0x2ee23b;return db['VoiceMusicOnHold'][_0x5e82('0x63')]({'where':{'id':_0x9b5ab6[_0x5e82('0x45')]['id']}})[_0x5e82('0x23')](handleEntityNotFound(_0x3be7d7,null))[_0x5e82('0x23')](function(_0x50ad29){if(_0x50ad29){_0xcdff30=_0x50ad29;_0x3728b8[_0x5e82('0x2e')]=_[_0x5e82('0x46')](db[_0x5e82('0x62')][_0x5e82('0x2a')]);_0x3728b8[_0x5e82('0x30')]=_[_0x5e82('0x46')](_0x9b5ab6[_0x5e82('0x30')]);_0x3728b8['filters']=_[_0x5e82('0x31')](_0x3728b8[_0x5e82('0x2e')],_0x3728b8[_0x5e82('0x30')]);_0x4bfffc[_0x5e82('0x33')]=_['intersection'](_0x3728b8[_0x5e82('0x2e')],qs['fields'](_0x9b5ab6[_0x5e82('0x30')][_0x5e82('0x32')]));_0x4bfffc[_0x5e82('0x33')]=_0x4bfffc[_0x5e82('0x33')][_0x5e82('0x34')]?_0x4bfffc['attributes']:_0x3728b8[_0x5e82('0x2e')];_0x4bfffc[_0x5e82('0x37')]=qs[_0x5e82('0x38')](_0x9b5ab6['query'][_0x5e82('0x38')]);_0x4bfffc[_0x5e82('0x39')]=qs[_0x5e82('0x3b')](_[_0x5e82('0x3a')](_0x9b5ab6[_0x5e82('0x30')],_0x3728b8[_0x5e82('0x3b')]));if(_0x9b5ab6[_0x5e82('0x30')][_0x5e82('0x3e')]){_0x4bfffc[_0x5e82('0x39')]=_['merge'](_0x4bfffc['where'],{'$or':_[_0x5e82('0x29')](_0x4bfffc[_0x5e82('0x33')],function(_0x10ee95){var _0xf479af={};_0xf479af[_0x10ee95]={'$like':'%'+_0x9b5ab6['query']['filter']+'%'};return _0xf479af;})});}_0x4bfffc=_[_0x5e82('0x3c')]({},_0x4bfffc,_0x9b5ab6['options']);return _0xcdff30['getSounds'](_0x4bfffc);}})[_0x5e82('0x23')](function(_0x1c89c2){if(_0x1c89c2){_0x2ee23b=_0x1c89c2['length'];if(!_0x9b5ab6['query'][_0x5e82('0x35')](_0x5e82('0x36'))){_0x4bfffc[_0x5e82('0x1c')]=qs[_0x5e82('0x1c')](_0x9b5ab6[_0x5e82('0x30')][_0x5e82('0x1c')]);_0x4bfffc[_0x5e82('0x1a')]=qs[_0x5e82('0x1a')](_0x9b5ab6[_0x5e82('0x30')][_0x5e82('0x1a')]);}return _0xcdff30[_0x5e82('0x6e')](_0x4bfffc);}})[_0x5e82('0x23')](function(_0x46018f){if(_0x46018f){return _0x46018f?{'count':_0x2ee23b,'rows':_0x46018f}:null;}})['then'](respondWithResult(_0x3be7d7,null))[_0x5e82('0x44')](handleError(_0x3be7d7,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index db8e3e1..2b54c06 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 _0x3d42=['util','moment','bluebird','request-promise','../../config/environment','exports','define','VoiceMusicOnHold','voice_musiconhold','lodash'];(function(_0x3b72a1,_0x2c1ca2){var _0x13105a=function(_0x5ee632){while(--_0x5ee632){_0x3b72a1['push'](_0x3b72a1['shift']());}};_0x13105a(++_0x2c1ca2);}(_0x3d42,0x10d));var _0x23d4=function(_0x30b856,_0x19b882){_0x30b856=_0x30b856-0x0;var _0x312901=_0x3d42[_0x30b856];return _0x312901;};'use strict';var _=require(_0x23d4('0x0'));var util=require(_0x23d4('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x23d4('0x2'));var BPromise=require(_0x23d4('0x3'));var rp=require(_0x23d4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x23d4('0x5'));var attributes=require('./voiceMusicOnHold.attributes');module[_0x23d4('0x6')]=function(_0xb67a7b,_0x59f284){return _0xb67a7b[_0x23d4('0x7')](_0x23d4('0x8'),attributes,{'tableName':_0x23d4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3f48=['bluebird','request-promise','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold','lodash','util','moment'];(function(_0x5dbaa7,_0x1f6d4a){var _0x481319=function(_0x116e27){while(--_0x116e27){_0x5dbaa7['push'](_0x5dbaa7['shift']());}};_0x481319(++_0x1f6d4a);}(_0x3f48,0x1aa));var _0x83f4=function(_0x21021b,_0x57a94c){_0x21021b=_0x21021b-0x0;var _0x359b42=_0x3f48[_0x21021b];return _0x359b42;};'use strict';var _=require(_0x83f4('0x0'));var util=require(_0x83f4('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x83f4('0x2'));var BPromise=require(_0x83f4('0x3'));var rp=require(_0x83f4('0x4'));var fs=require('fs');var path=require(_0x83f4('0x5'));var rimraf=require(_0x83f4('0x6'));var config=require(_0x83f4('0x7'));var attributes=require(_0x83f4('0x8'));module[_0x83f4('0x9')]=function(_0x19df3e,_0x3e8fde){return _0x19df3e[_0x83f4('0xa')](_0x83f4('0xb'),attributes,{'tableName':_0x83f4('0xc'),'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 c5f88ea..02159ba 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(_0x1dcda3,_0x1c1de2){var _0x1e45ae=function(_0x13a5b9){while(--_0x13a5b9){_0x1dcda3['push'](_0x1dcda3['shift']());}};_0x1e45ae(++_0x1c1de2);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1e500e,_0x2c9d74){_0x1e500e=_0x1e500e-0x0;var _0x10dc5e=_0xcb91[_0x1e500e];return _0x10dc5e;};'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 _0xe706=['http','request','then','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x413150,_0xb8351d){var _0x4b0e7e=function(_0x2127d1){while(--_0x2127d1){_0x413150['push'](_0x413150['shift']());}};_0x4b0e7e(++_0xb8351d);}(_0xe706,0xa3));var _0x6e70=function(_0x5ba513,_0x459c3b){_0x5ba513=_0x5ba513-0x0;var _0x1132a0=_0xe706[_0x5ba513];return _0x1132a0;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('VoiceMusicOnHold,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('VoiceMusicOnHold,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index f58fc6d..f68ede1 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 _0xc288=['get','index','isAuthenticated','describe','/:id','show','/:id/users','getTeams','create','addAgents','/:id/teams','addTeams','put','update','delete','destroy','removeTeams','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller'];(function(_0x258f7d,_0x696412){var _0x177820=function(_0x25d141){while(--_0x25d141){_0x258f7d['push'](_0x258f7d['shift']());}};_0x177820(++_0x696412);}(_0xc288,0x18b));var _0x8c28=function(_0x224d7b,_0x51e476){_0x224d7b=_0x224d7b-0x0;var _0x1e6974=_0xc288[_0x224d7b];return _0x1e6974;};'use strict';var multer=require(_0x8c28('0x0'));var util=require('util');var path=require(_0x8c28('0x1'));var timeout=require(_0x8c28('0x2'));var express=require(_0x8c28('0x3'));var router=express[_0x8c28('0x4')]();var fs_extra=require(_0x8c28('0x5'));var auth=require(_0x8c28('0x6'));var interaction=require(_0x8c28('0x7'));var config=require(_0x8c28('0x8'));var controller=require(_0x8c28('0x9'));router[_0x8c28('0xa')]('/',auth['isAuthenticated'](),controller[_0x8c28('0xb')]);router['get']('/describe',auth[_0x8c28('0xc')](),controller[_0x8c28('0xd')]);router[_0x8c28('0xa')](_0x8c28('0xe'),auth[_0x8c28('0xc')](),controller[_0x8c28('0xf')]);router['get'](_0x8c28('0x10'),auth[_0x8c28('0xc')](),controller['getAgents']);router['get']('/:id/teams',auth[_0x8c28('0xc')](),controller[_0x8c28('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0x8c28('0x12')]);router['post'](_0x8c28('0x10'),auth[_0x8c28('0xc')](),controller[_0x8c28('0x13')]);router['post'](_0x8c28('0x14'),auth['isAuthenticated'](),controller[_0x8c28('0x15')]);router[_0x8c28('0x16')](_0x8c28('0xe'),auth[_0x8c28('0xc')](),controller[_0x8c28('0x17')]);router[_0x8c28('0x18')](_0x8c28('0xe'),auth[_0x8c28('0xc')](),controller[_0x8c28('0x19')]);router[_0x8c28('0x18')](_0x8c28('0x10'),auth['isAuthenticated'](),controller['removeAgents']);router['delete']('/:id/teams',auth[_0x8c28('0xc')](),controller[_0x8c28('0x1a')]);module['exports']=router; \ No newline at end of file +var _0x370d=['/:id/users','getAgents','/:id/teams','getTeams','post','create','addAgents','addTeams','put','delete','destroy','removeAgents','removeTeams','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x59d07d,_0x24160f){var _0x43ed0f=function(_0x39b8a2){while(--_0x39b8a2){_0x59d07d['push'](_0x59d07d['shift']());}};_0x43ed0f(++_0x24160f);}(_0x370d,0x194));var _0xd370=function(_0x24b9b6,_0x334f64){_0x24b9b6=_0x24b9b6-0x0;var _0x4cb658=_0x370d[_0x24b9b6];return _0x4cb658;};'use strict';var multer=require(_0xd370('0x0'));var util=require('util');var path=require(_0xd370('0x1'));var timeout=require('connect-timeout');var express=require(_0xd370('0x2'));var router=express[_0xd370('0x3')]();var fs_extra=require(_0xd370('0x4'));var auth=require(_0xd370('0x5'));var interaction=require(_0xd370('0x6'));var config=require(_0xd370('0x7'));var controller=require(_0xd370('0x8'));router[_0xd370('0x9')]('/',auth[_0xd370('0xa')](),controller[_0xd370('0xb')]);router[_0xd370('0x9')](_0xd370('0xc'),auth['isAuthenticated'](),controller[_0xd370('0xd')]);router['get'](_0xd370('0xe'),auth[_0xd370('0xa')](),controller[_0xd370('0xf')]);router[_0xd370('0x9')](_0xd370('0x10'),auth[_0xd370('0xa')](),controller[_0xd370('0x11')]);router['get'](_0xd370('0x12'),auth[_0xd370('0xa')](),controller[_0xd370('0x13')]);router[_0xd370('0x14')]('/',auth[_0xd370('0xa')](),controller[_0xd370('0x15')]);router['post'](_0xd370('0x10'),auth[_0xd370('0xa')](),controller[_0xd370('0x16')]);router[_0xd370('0x14')](_0xd370('0x12'),auth['isAuthenticated'](),controller[_0xd370('0x17')]);router[_0xd370('0x18')](_0xd370('0xe'),auth[_0xd370('0xa')](),controller['update']);router[_0xd370('0x19')](_0xd370('0xe'),auth[_0xd370('0xa')](),controller[_0xd370('0x1a')]);router[_0xd370('0x19')](_0xd370('0x10'),auth['isAuthenticated'](),controller[_0xd370('0x1b')]);router['delete'](_0xd370('0x12'),auth[_0xd370('0xa')](),controller[_0xd370('0x1c')]);module[_0xd370('0x1d')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index a1592a5..7f2d702 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 _0x7e36=['VIRTUAL','system-','getDataValue','STRING','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7e36,0x134));var _0x67e3=function(_0xf7bf02,_0x13da13){_0xf7bf02=_0xf7bf02-0x0;var _0x4f263f=_0x7e36[_0xf7bf02];return _0x4f263f;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x67e3('0x0')],'allowNull':![],'unique':_0x67e3('0x1')},'prefix':{'type':Sequelize[_0x67e3('0x2')],'get':function(_0x145e21){return _0x67e3('0x3')+this[_0x67e3('0x4')]('name')+'-';}},'description':{'type':Sequelize[_0x67e3('0x0')]},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x698b=['VIRTUAL','system-','getDataValue','sequelize','exports','STRING','name'];(function(_0x5e2b71,_0x32882f){var _0x4ba620=function(_0x12afd1){while(--_0x12afd1){_0x5e2b71['push'](_0x5e2b71['shift']());}};_0x4ba620(++_0x32882f);}(_0x698b,0x81));var _0xb698=function(_0x21c372,_0x5aa563){_0x21c372=_0x21c372-0x0;var _0x5b93bd=_0x698b[_0x21c372];return _0x5b93bd;};'use strict';var Sequelize=require(_0xb698('0x0'));module[_0xb698('0x1')]={'name':{'type':Sequelize[_0xb698('0x2')],'allowNull':![],'unique':_0xb698('0x3')},'prefix':{'type':Sequelize[_0xb698('0x4')],'get':function(_0x40967a){return _0xb698('0x5')+this[_0xb698('0x6')]('name')+'-';}},'description':{'type':Sequelize[_0xb698('0x2')]},'callerIdAll':{'type':Sequelize[_0xb698('0x2')]},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 13f4943..8fdcc5b 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 _0x5464=['findById','addAgents','omit','spread','ids','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','emit','getAgents','findOne','User','order','options','nolimit','getTeams','Team','addTeams','online','interface','flatMap','each','TeamVoicePrefix','upsert','forEach','removeTeams','Agents','select','field','tq.TeamId','from','team_has_voice_prefixes','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','ut.UserId\x20=\x20?','QueryTypes','SELECT','every','TeamId','includes','all','compact','isEmpty','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','sendStatus','end','status','json','undefined','limit','count','offset','Content-Range','apply','save','update','then','destroy','VoicePrefixes','UserProfileResource','stack','name','send','index','VoicePrefix','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','pick','filter','where','merge','includeAll','findAll','rows','catch','show','params','find','describe','create','sequelize','transaction','body','get','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','type','description','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','prefix','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','${EXTEN:','charAt','system-'];(function(_0x36fe46,_0x40010c){var _0x4d2e9c=function(_0x2dfa20){while(--_0x2dfa20){_0x36fe46['push'](_0x36fe46['shift']());}};_0x4d2e9c(++_0x40010c);}(_0x5464,0x15d));var _0x4546=function(_0x4ec2ec,_0x26fcbf){_0x4ec2ec=_0x4ec2ec-0x0;var _0x3cddbf=_0x5464[_0x4ec2ec];return _0x3cddbf;};'use strict';var emlformat=require(_0x4546('0x0'));var rimraf=require(_0x4546('0x1'));var zipdir=require(_0x4546('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4546('0x3'));var moment=require('moment');var BPromise=require(_0x4546('0x4'));var Mustache=require('mustache');var util=require(_0x4546('0x5'));var path=require(_0x4546('0x6'));var sox=require(_0x4546('0x7'));var csv=require(_0x4546('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4546('0x9'));var crypto=require(_0x4546('0xa'));var jsforce=require(_0x4546('0xb'));var deskjs=require(_0x4546('0xc'));var toCsv=require(_0x4546('0x8'));var querystring=require(_0x4546('0xd'));var Papa=require(_0x4546('0xe'));var Redis=require(_0x4546('0xf'));var authService=require(_0x4546('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x4546('0x11'));var hardwareService=require(_0x4546('0x12'));var logger=require(_0x4546('0x13'))('api');var utils=require(_0x4546('0x14'));var config=require(_0x4546('0x15'));var licenseUtil=require(_0x4546('0x16'));var db=require(_0x4546('0x17'))['db'];config['redis']=_['defaults'](config[_0x4546('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./voicePrefix.socket')['register'](socket);function respondWithStatusCode(_0x4f5571,_0x102180){_0x102180=_0x102180||0xcc;return function(_0x51e279){if(_0x51e279){return _0x4f5571[_0x4546('0x19')](_0x102180);}return _0x4f5571['status'](_0x102180)[_0x4546('0x1a')]();};}function respondWithResult(_0x564f3e,_0x3741f2){_0x3741f2=_0x3741f2||0xc8;return function(_0x18bc09){if(_0x18bc09){return _0x564f3e[_0x4546('0x1b')](_0x3741f2)[_0x4546('0x1c')](_0x18bc09);}};}function respondWithFilteredResult(_0x2a294b,_0x15e09e){return function(_0x57d8de){if(_0x57d8de){var _0x4ffd6b=typeof _0x15e09e['offset']===_0x4546('0x1d')&&typeof _0x15e09e[_0x4546('0x1e')]===_0x4546('0x1d');var _0x3d95c2=_0x57d8de[_0x4546('0x1f')];var _0x337a44=_0x4ffd6b?0x0:_0x15e09e[_0x4546('0x20')];var _0x2f6329=_0x4ffd6b?_0x57d8de[_0x4546('0x1f')]:_0x15e09e[_0x4546('0x20')]+_0x15e09e['limit'];var _0x2d689f;if(_0x2f6329>=_0x3d95c2){_0x2f6329=_0x3d95c2;_0x2d689f=0xc8;}else{_0x2d689f=0xce;}_0x2a294b[_0x4546('0x1b')](_0x2d689f);return _0x2a294b['set'](_0x4546('0x21'),_0x337a44+'-'+_0x2f6329+'/'+_0x3d95c2)[_0x4546('0x1c')](_0x57d8de);}return null;};}function patchUpdates(_0x1a1984){return function(_0x2f065d){try{jsonpatch[_0x4546('0x22')](_0x2f065d,_0x1a1984,!![]);}catch(_0x15b013){return BPromise['reject'](_0x15b013);}return _0x2f065d[_0x4546('0x23')]();};}function saveUpdates(_0x2cca8b,_0x4f9fcf){return function(_0x824698){if(_0x824698){return _0x824698[_0x4546('0x24')](_0x2cca8b)[_0x4546('0x25')](function(_0x4467ee){return _0x4467ee;});}return null;};}function removeEntity(_0x23084b,_0x53ae5e){return function(_0x49dc98){if(_0x49dc98){return _0x49dc98[_0x4546('0x26')]()[_0x4546('0x25')](function(){var _0x48fc36=_0x49dc98['get']({'plain':!![]});var _0x43740e=_0x4546('0x27');return db[_0x4546('0x28')][_0x4546('0x26')]({'where':{'type':_0x43740e,'resourceId':_0x48fc36['id']}})[_0x4546('0x25')](function(){return _0x49dc98;});})[_0x4546('0x25')](function(){_0x23084b[_0x4546('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x367b23,_0x52c546){return function(_0x3a2d12){if(!_0x3a2d12){_0x367b23[_0x4546('0x19')](0x194);}return _0x3a2d12;};}function handleError(_0x5396c5,_0x539f74){_0x539f74=_0x539f74||0x1f4;return function(_0xf7a95b){logger['error'](_0xf7a95b[_0x4546('0x29')]);if(_0xf7a95b[_0x4546('0x2a')]){delete _0xf7a95b['name'];}_0x5396c5['status'](_0x539f74)[_0x4546('0x2b')](_0xf7a95b);};}exports[_0x4546('0x2c')]=function(_0x258d26,_0x5716dc){var _0x10db2e={},_0x2c8e44={},_0x540983={'count':0x0,'rows':[]};var _0xad1b9c=_['map'](db[_0x4546('0x2d')][_0x4546('0x2e')],function(_0xe89b7c){return{'name':_0xe89b7c[_0x4546('0x2f')],'type':_0xe89b7c['type'][_0x4546('0x30')]};});_0x2c8e44[_0x4546('0x31')]=_[_0x4546('0x32')](_0xad1b9c,_0x4546('0x2a'));_0x2c8e44[_0x4546('0x33')]=_[_0x4546('0x34')](_0x258d26['query']);_0x2c8e44[_0x4546('0x35')]=_[_0x4546('0x36')](_0x2c8e44['model'],_0x2c8e44['query']);_0x10db2e[_0x4546('0x37')]=_[_0x4546('0x36')](_0x2c8e44['model'],qs[_0x4546('0x38')](_0x258d26[_0x4546('0x33')]['fields']));_0x10db2e['attributes']=_0x10db2e[_0x4546('0x37')][_0x4546('0x39')]?_0x10db2e[_0x4546('0x37')]:_0x2c8e44[_0x4546('0x31')];if(!_0x258d26[_0x4546('0x33')][_0x4546('0x3a')]('nolimit')){_0x10db2e[_0x4546('0x1e')]=qs[_0x4546('0x1e')](_0x258d26['query'][_0x4546('0x1e')]);_0x10db2e['offset']=qs[_0x4546('0x20')](_0x258d26[_0x4546('0x33')]['offset']);}_0x10db2e['order']=qs[_0x4546('0x3b')](_0x258d26[_0x4546('0x33')][_0x4546('0x3b')]);_0x10db2e['where']=qs[_0x4546('0x35')](_[_0x4546('0x3c')](_0x258d26[_0x4546('0x33')],_0x2c8e44[_0x4546('0x35')]),_0xad1b9c);if(_0x258d26[_0x4546('0x33')][_0x4546('0x3d')]){_0x10db2e[_0x4546('0x3e')]=_[_0x4546('0x3f')](_0x10db2e['where'],{'$or':_[_0x4546('0x32')](_0xad1b9c,function(_0x9bedd7){if(_0x9bedd7['type']!=='VIRTUAL'){var _0x3bafee={};_0x3bafee[_0x9bedd7[_0x4546('0x2a')]]={'$like':'%'+_0x258d26[_0x4546('0x33')][_0x4546('0x3d')]+'%'};return _0x3bafee;}})});}_0x10db2e=_[_0x4546('0x3f')]({},_0x10db2e,_0x258d26['options']);var _0x977146={'where':_0x10db2e[_0x4546('0x3e')]};return db[_0x4546('0x2d')][_0x4546('0x1f')](_0x977146)[_0x4546('0x25')](function(_0x3fabf0){_0x540983[_0x4546('0x1f')]=_0x3fabf0;if(_0x258d26[_0x4546('0x33')][_0x4546('0x40')]){_0x10db2e['include']=[{'all':!![]}];}return db[_0x4546('0x2d')][_0x4546('0x41')](_0x10db2e);})[_0x4546('0x25')](function(_0x35b51e){_0x540983[_0x4546('0x42')]=_0x35b51e;return _0x540983;})[_0x4546('0x25')](respondWithFilteredResult(_0x5716dc,_0x10db2e))[_0x4546('0x43')](handleError(_0x5716dc,null));};exports[_0x4546('0x44')]=function(_0x426eb9,_0x44752d){var _0x19cdad={'raw':![],'where':{'id':_0x426eb9[_0x4546('0x45')]['id']}},_0x524702={};_0x524702[_0x4546('0x31')]=_['keys'](db[_0x4546('0x2d')][_0x4546('0x2e')]);_0x524702[_0x4546('0x33')]=_['keys'](_0x426eb9[_0x4546('0x33')]);_0x524702[_0x4546('0x35')]=_[_0x4546('0x36')](_0x524702[_0x4546('0x31')],_0x524702[_0x4546('0x33')]);_0x19cdad[_0x4546('0x37')]=_[_0x4546('0x36')](_0x524702[_0x4546('0x31')],qs[_0x4546('0x38')](_0x426eb9[_0x4546('0x33')]['fields']));_0x19cdad[_0x4546('0x37')]=_0x19cdad[_0x4546('0x37')]['length']?_0x19cdad[_0x4546('0x37')]:_0x524702[_0x4546('0x31')];if(_0x426eb9[_0x4546('0x33')][_0x4546('0x40')]){_0x19cdad['include']=[{'all':!![]}];}_0x19cdad=_[_0x4546('0x3f')]({},_0x19cdad,_0x426eb9['options']);return db[_0x4546('0x2d')][_0x4546('0x46')](_0x19cdad)[_0x4546('0x25')](handleEntityNotFound(_0x44752d,null))['then'](respondWithResult(_0x44752d,null))[_0x4546('0x43')](handleError(_0x44752d,null));};exports[_0x4546('0x26')]=function(_0x13f705,_0xc8a1f3){return db[_0x4546('0x2d')][_0x4546('0x46')]({'where':{'id':_0x13f705[_0x4546('0x45')]['id']}})[_0x4546('0x25')](handleEntityNotFound(_0xc8a1f3,null))[_0x4546('0x25')](removeEntity(_0xc8a1f3,null))[_0x4546('0x43')](handleError(_0xc8a1f3,null));};exports[_0x4546('0x47')]=function(_0x49b0d8,_0x2778f2){return db[_0x4546('0x2d')]['describe']()[_0x4546('0x25')](respondWithResult(_0x2778f2,null))[_0x4546('0x43')](handleError(_0x2778f2,null));};exports[_0x4546('0x48')]=function(_0x4ca3a6,_0x422ebc){var _0x31dc1e;return db[_0x4546('0x49')][_0x4546('0x4a')](function(_0x10dfd6){return db[_0x4546('0x2d')][_0x4546('0x48')](_0x4ca3a6[_0x4546('0x4b')],{'transaction':_0x10dfd6})[_0x4546('0x25')](function(_0x15365d){_0x31dc1e=_0x15365d[_0x4546('0x4c')]({'plain':!![]});return db[_0x4546('0x4d')][_0x4546('0x46')]({'where':{'id':_0x31dc1e[_0x4546('0x4e')]},'raw':!![]})[_0x4546('0x25')](function(_0x456ebe){return createVoicePrefixExtensions(_0x31dc1e,_0x456ebe,_0x10dfd6);});});})['then'](function(){var _0x3e13ab=_0x4ca3a6[_0x4546('0x4f')]['get']({'plain':!![]});if(!_0x3e13ab)throw new Error(_0x4546('0x50'));if(_0x3e13ab[_0x4546('0x51')]===_0x4546('0x4f')){var _0x30e748=_0x31dc1e;return db['UserProfileSection'][_0x4546('0x46')]({'where':{'name':_0x4546('0x27'),'userProfileId':_0x3e13ab[_0x4546('0x52')]},'raw':!![]})[_0x4546('0x25')](function(_0x49a106){if(_0x49a106&&_0x49a106[_0x4546('0x53')]===0x0){return db[_0x4546('0x28')][_0x4546('0x48')]({'name':_0x30e748[_0x4546('0x2a')],'resourceId':_0x30e748['id'],'type':_0x49a106[_0x4546('0x2a')],'sectionId':_0x49a106['id']},{})[_0x4546('0x25')](function(){return _0x31dc1e;});}else{return _0x31dc1e;}})['catch'](function(_0x2ece0a){logger[_0x4546('0x54')](_0x4546('0x55'),_0x2ece0a);throw _0x2ece0a;});}return _0x31dc1e;})[_0x4546('0x25')](respondWithResult(_0x422ebc,null))['catch'](handleError(_0x422ebc,null));};function Extension(_0x37d128,_0x4a1a00,_0x28238f,_0x24e66c){this[_0x4546('0x56')]=_0x4546('0x57');this[_0x4546('0x58')]=_0x37d128;this['app']=_0x28238f;this[_0x4546('0x59')]='system';this[_0x4546('0x5a')]='Voice\x20Prefix\x20Extension';this['priority']=_0x4a1a00;this['appdata']=_0x24e66c;}function createVoicePrefixExtensions(_0xbf2eab,_0x5e35bf,_0x29f980){return new BPromise(function(_0x466f19,_0x1e4914){var _0x2a1a21=new Extension(formatPrefixName(_0xbf2eab['prefix']),0x1,_0x4546('0x5b'),_0x4546('0x5c'));_0x2a1a21[_0x4546('0x5d')]=_0xbf2eab['id'];return db[_0x4546('0x4d')][_0x4546('0x48')](_0x2a1a21,{'transaction':_0x29f980})['then'](function(_0xc4be35){var _0x4b3340=_0xc4be35[_0x4546('0x4c')]({'plain':!![]});var _0x4c21d6=_[_0x4546('0x32')](addVoicePrefixExtensions(_0xbf2eab,_0x5e35bf),function(_0x423330){_0x423330[_0x4546('0x4e')]=_0x4b3340['id'];_0x423330['VoicePrefixId']=_0xbf2eab['id'];return _0x423330;});return db[_0x4546('0x4d')][_0x4546('0x5e')](_0x4c21d6,{'transaction':_0x29f980})[_0x4546('0x25')](function(_0x220259){if(!_0x220259){return _0x1e4914(_0x4546('0x5f'));}else{return _0x466f19(_0x220259);}})[_0x4546('0x43')](function(_0x310661){return _0x1e4914(_0x310661);});});;});};function addVoicePrefixExtensions(_0x332ed4,_0x55ecd9){var _0x2b231f=[];var _0x2c0ee3=formatPrefixName(_0x332ed4[_0x4546('0x60')]);_0x2b231f[_0x4546('0x61')](new Extension(_0x2c0ee3,0x2,_0x4546('0x62'),_0x4546('0x63')+_0x332ed4[_0x4546('0x2a')]));if(_0x332ed4[_0x4546('0x64')]){_0x2b231f[_0x4546('0x61')](new Extension(_0x2c0ee3,0x3,_0x4546('0x62'),_0x4546('0x65')+_0x332ed4[_0x4546('0x64')]));}else{_0x2b231f[_0x4546('0x61')](new Extension(_0x2c0ee3,0x3,_0x4546('0x5b'),_0x4546('0x66')));}_0x2b231f['push'](new Extension(_0x2c0ee3,0x4,_0x4546('0x67'),_0x55ecd9['context']+','+_0x4546('0x68')+(0x8+_0x332ed4[_0x4546('0x2a')]['length'])+'}'+','+0x1));return _0x2b231f;}function formatPrefixName(_0x314afc){var _0x335881='_';for(var _0x27680b=0x0;_0x27680b<_0x314afc[_0x4546('0x39')];_0x27680b++){if(_0x314afc[_0x4546('0x69')](_0x27680b)=='-'){_0x335881+=_0x314afc[_0x4546('0x69')](_0x27680b);}else{_0x335881+='['+_0x314afc[_0x4546('0x69')](_0x27680b)+']';}}_0x335881+='.';return _0x335881;}exports[_0x4546('0x24')]=function(_0x275c76,_0x3f3f99,_0x1aa678){var _0x194667=_0x275c76[_0x4546('0x4b')];_0x194667['prefix']=_0x4546('0x6a')+_0x194667[_0x4546('0x2a')]+'-';return db[_0x4546('0x49')]['transaction'](function(_0xb6e936){return db[_0x4546('0x2d')][_0x4546('0x24')](_0x194667,{'where':{'id':_0x194667['id']},'transaction':_0xb6e936})[_0x4546('0x25')](function(){return db[_0x4546('0x4d')][_0x4546('0x26')]({'where':{'VoicePrefixId':_0x194667['id']},'transaction':_0xb6e936})[_0x4546('0x25')](function(){return db['VoiceExtension'][_0x4546('0x46')]({'where':{'id':_0x194667[_0x4546('0x4e')]},'raw':!![]})[_0x4546('0x25')](function(_0x5d14f1){return createVoicePrefixExtensions(_0x194667,_0x5d14f1,_0xb6e936);});});});})['then'](function(){return db[_0x4546('0x2d')][_0x4546('0x6b')](_0x194667['id']);})['then'](respondWithResult(_0x3f3f99,null))[_0x4546('0x43')](handleError(_0x3f3f99,null));};exports[_0x4546('0x6c')]=function(_0x121e51,_0x11e2e4,_0x5e17a2){return db[_0x4546('0x2d')][_0x4546('0x46')]({'where':{'id':_0x121e51[_0x4546('0x45')]['id']}})[_0x4546('0x25')](handleEntityNotFound(_0x11e2e4,null))[_0x4546('0x25')](function(_0x45f510){if(_0x45f510){return _0x45f510[_0x4546('0x6c')](_0x121e51[_0x4546('0x4b')]['ids'],_[_0x4546('0x6d')](_0x121e51[_0x4546('0x4b')],['ids','id'])||{})[_0x4546('0x6e')](function(_0x5a0de1){for(var _0x52419e=0x0;_0x52419e<_0x121e51[_0x4546('0x4b')][_0x4546('0x6f')][_0x4546('0x39')];_0x52419e+=0x1){socket['emit'](_0x4546('0x70'),{'UserId':Number(_0x121e51[_0x4546('0x4b')][_0x4546('0x6f')][_0x52419e]),'VoicePrefixId':Number(_0x121e51[_0x4546('0x45')]['id'])});}return _0x5a0de1;});}})[_0x4546('0x25')](respondWithResult(_0x11e2e4,null))[_0x4546('0x43')](handleError(_0x11e2e4,null));};exports[_0x4546('0x71')]=function(_0x50078a,_0x4cd517,_0x40897f){return db[_0x4546('0x2d')][_0x4546('0x46')]({'where':{'id':_0x50078a[_0x4546('0x45')]['id']}})[_0x4546('0x25')](handleEntityNotFound(_0x4cd517,null))[_0x4546('0x25')](function(_0x4c1a64){if(_0x4c1a64){return _0x4c1a64['removeAgents'](_0x50078a[_0x4546('0x33')][_0x4546('0x6f')])[_0x4546('0x25')](function(){if(_[_0x4546('0x72')](_0x50078a[_0x4546('0x33')][_0x4546('0x6f')])){for(var _0x3e38bd=0x0;_0x3e38bd<_0x50078a[_0x4546('0x33')]['ids'][_0x4546('0x39')];_0x3e38bd+=0x1){socket['emit'](_0x4546('0x73'),{'UserId':Number(_0x50078a[_0x4546('0x33')][_0x4546('0x6f')][_0x3e38bd]),'VoicePrefixId':Number(_0x50078a['params']['id'])});}}else{socket[_0x4546('0x74')](_0x4546('0x73'),{'UserId':Number(_0x50078a[_0x4546('0x33')][_0x4546('0x6f')]),'VoicePrefixId':Number(_0x50078a[_0x4546('0x45')]['id'])});}});}})[_0x4546('0x25')](respondWithStatusCode(_0x4cd517,null))[_0x4546('0x43')](handleError(_0x4cd517,null));};exports[_0x4546('0x75')]=function(_0x3ff208,_0xc35517,_0x5f29c6){var _0x41cb1f={};var _0x454663={};var _0x59021a;var _0x36f8b5;return db[_0x4546('0x2d')][_0x4546('0x76')]({'where':{'id':_0x3ff208[_0x4546('0x45')]['id']}})['then'](handleEntityNotFound(_0xc35517,null))['then'](function(_0x3842fd){if(_0x3842fd){_0x59021a=_0x3842fd;_0x454663[_0x4546('0x31')]=_[_0x4546('0x34')](db[_0x4546('0x77')][_0x4546('0x2e')]);_0x454663['query']=_[_0x4546('0x34')](_0x3ff208[_0x4546('0x33')]);_0x454663[_0x4546('0x35')]=_[_0x4546('0x36')](_0x454663[_0x4546('0x31')],_0x454663['query']);_0x41cb1f[_0x4546('0x37')]=_['intersection'](_0x454663[_0x4546('0x31')],qs[_0x4546('0x38')](_0x3ff208[_0x4546('0x33')][_0x4546('0x38')]));_0x41cb1f[_0x4546('0x37')]=_0x41cb1f[_0x4546('0x37')][_0x4546('0x39')]?_0x41cb1f[_0x4546('0x37')]:_0x454663['model'];_0x41cb1f[_0x4546('0x78')]=qs[_0x4546('0x3b')](_0x3ff208[_0x4546('0x33')][_0x4546('0x3b')]);_0x41cb1f[_0x4546('0x3e')]=qs['filters'](_[_0x4546('0x3c')](_0x3ff208['query'],_0x454663['filters']));if(_0x3ff208['query'][_0x4546('0x3d')]){_0x41cb1f[_0x4546('0x3e')]=_[_0x4546('0x3f')](_0x41cb1f[_0x4546('0x3e')],{'$or':_[_0x4546('0x32')](_0x41cb1f[_0x4546('0x37')],function(_0x180a07){var _0x327ae2={};_0x327ae2[_0x180a07]={'$like':'%'+_0x3ff208[_0x4546('0x33')][_0x4546('0x3d')]+'%'};return _0x327ae2;})});}_0x41cb1f=_['merge']({},_0x41cb1f,_0x3ff208[_0x4546('0x79')]);return _0x59021a['getAgents'](_0x41cb1f);}})[_0x4546('0x25')](function(_0x278e43){if(_0x278e43){_0x36f8b5=_0x278e43[_0x4546('0x39')];if(!_0x3ff208[_0x4546('0x33')][_0x4546('0x3a')](_0x4546('0x7a'))){_0x41cb1f[_0x4546('0x1e')]=qs['limit'](_0x3ff208[_0x4546('0x33')][_0x4546('0x1e')]);_0x41cb1f['offset']=qs[_0x4546('0x20')](_0x3ff208[_0x4546('0x33')][_0x4546('0x20')]);}return _0x59021a[_0x4546('0x75')](_0x41cb1f);}})[_0x4546('0x25')](function(_0x2a9010){if(_0x2a9010){return _0x2a9010?{'count':_0x36f8b5,'rows':_0x2a9010}:null;}})[_0x4546('0x25')](respondWithResult(_0xc35517,null))[_0x4546('0x43')](handleError(_0xc35517,null));};exports[_0x4546('0x7b')]=function(_0x3cbef4,_0x264c12,_0x2ba11b){var _0x59b252={};var _0x37d871={};var _0xf3a8dc;var _0x4247db;return db[_0x4546('0x2d')][_0x4546('0x76')]({'where':{'id':_0x3cbef4[_0x4546('0x45')]['id']}})[_0x4546('0x25')](handleEntityNotFound(_0x264c12,null))[_0x4546('0x25')](function(_0x3855e9){if(_0x3855e9){_0xf3a8dc=_0x3855e9;_0x37d871[_0x4546('0x31')]=_[_0x4546('0x34')](db[_0x4546('0x7c')][_0x4546('0x2e')]);_0x37d871[_0x4546('0x33')]=_[_0x4546('0x34')](_0x3cbef4[_0x4546('0x33')]);_0x37d871[_0x4546('0x35')]=_[_0x4546('0x36')](_0x37d871[_0x4546('0x31')],_0x37d871[_0x4546('0x33')]);_0x59b252[_0x4546('0x37')]=_[_0x4546('0x36')](_0x37d871[_0x4546('0x31')],qs['fields'](_0x3cbef4['query'][_0x4546('0x38')]));_0x59b252['attributes']=_0x59b252[_0x4546('0x37')][_0x4546('0x39')]?_0x59b252[_0x4546('0x37')]:_0x37d871['model'];_0x59b252[_0x4546('0x78')]=qs['sort'](_0x3cbef4['query'][_0x4546('0x3b')]);_0x59b252[_0x4546('0x3e')]=qs[_0x4546('0x35')](_['pick'](_0x3cbef4['query'],_0x37d871[_0x4546('0x35')]));if(_0x3cbef4[_0x4546('0x33')]['filter']){_0x59b252[_0x4546('0x3e')]=_[_0x4546('0x3f')](_0x59b252[_0x4546('0x3e')],{'$or':_[_0x4546('0x32')](_0x59b252[_0x4546('0x37')],function(_0x65a6a4){var _0x417e49={};_0x417e49[_0x65a6a4]={'$like':'%'+_0x3cbef4['query'][_0x4546('0x3d')]+'%'};return _0x417e49;})});}_0x59b252=_['merge']({},_0x59b252,_0x3cbef4[_0x4546('0x79')]);return _0xf3a8dc['getTeams'](_0x59b252);}})['then'](function(_0x3d95e5){if(_0x3d95e5){_0x4247db=_0x3d95e5['length'];if(!_0x3cbef4['query'][_0x4546('0x3a')](_0x4546('0x7a'))){_0x59b252[_0x4546('0x1e')]=qs[_0x4546('0x1e')](_0x3cbef4[_0x4546('0x33')][_0x4546('0x1e')]);_0x59b252[_0x4546('0x20')]=qs['offset'](_0x3cbef4[_0x4546('0x33')]['offset']);}return _0xf3a8dc[_0x4546('0x7b')](_0x59b252);}})[_0x4546('0x25')](function(_0x24798b){if(_0x24798b){return _0x24798b?{'count':_0x4247db,'rows':_0x24798b}:null;}})[_0x4546('0x25')](respondWithResult(_0x264c12,null))[_0x4546('0x43')](handleError(_0x264c12,null));};exports[_0x4546('0x7d')]=function(_0x597648,_0x19aeab,_0x22a956){var _0x12eea5=_0x597648[_0x4546('0x4b')]['ids'];var _0x33f125;return db[_0x4546('0x7c')][_0x4546('0x41')]({'where':{'id':_0x12eea5},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id','name',_0x4546('0x7e'),'voicePause',_0x4546('0x7f')],'raw':!![]}]})['then'](function(_0x3fc0b8){if(_0x3fc0b8){_0x33f125=_0x3fc0b8;var _0x55ec89=_[_0x4546('0x80')](_0x3fc0b8,function(_0x645df3){var _0x54bd82=_0x645df3[_0x4546('0x4c')]({'plain':!![]});return _0x54bd82['Agents'];});return db[_0x4546('0x2d')][_0x4546('0x46')]({'where':{'id':_0x597648[_0x4546('0x45')]['id']}})[_0x4546('0x25')](function(_0x7f3cf0){return db['sequelize'][_0x4546('0x4a')](function(_0x3ab4f4){return _0x7f3cf0[_0x4546('0x7d')](_0x12eea5,{'transaction':_0x3ab4f4})[_0x4546('0x25')](function(){return BPromise[_0x4546('0x81')](_0x33f125,function(_0x4dae4a){return db[_0x4546('0x82')][_0x4546('0x83')]({'TeamId':_0x4dae4a['id'],'VoicePrefixId':_0x597648[_0x4546('0x45')]['id']},{'transaction':_0x3ab4f4});});})[_0x4546('0x25')](function(){return BPromise[_0x4546('0x81')](_0x55ec89,function(_0x14d671){return db['UserVoicePrefix']['findOrCreate']({'where':{'UserId':_0x14d671['id'],'VoicePrefixId':_0x597648[_0x4546('0x45')]['id']},'transaction':_0x3ab4f4});});})[_0x4546('0x25')](function(){_0x55ec89[_0x4546('0x84')](function(_0x150027){socket[_0x4546('0x74')]('userVoicePrefix:save',{'UserId':_0x150027['id'],'VoicePrefixId':_0x7f3cf0['id']});});});});});}})['then'](respondWithStatusCode(_0x19aeab,null))[_0x4546('0x43')](handleError(_0x19aeab,null));};exports[_0x4546('0x85')]=function(_0x697259,_0x228e87,_0x1470c2){return db[_0x4546('0x7c')][_0x4546('0x41')]({'where':{'id':_0x697259[_0x4546('0x33')][_0x4546('0x6f')]},'attributes':['id'],'include':[{'model':db[_0x4546('0x77')],'as':_0x4546('0x86'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x228e87,null))['then'](function(_0x15a005){var _0x4ba4aa=_[_0x4546('0x32')](_0x15a005,'id');var _0x57dac4=[];var _0x5523f9=[];var _0x55b583=squel[_0x4546('0x87')]();_0x55b583[_0x4546('0x88')](_0x4546('0x89'))[_0x4546('0x8a')](_0x4546('0x8b'),'tq')['join'](_0x4546('0x8c'),'ut',_0x4546('0x8d'))[_0x4546('0x3e')](_0x4546('0x8e'),_0x697259[_0x4546('0x45')]['id']);for(var _0x12ef28=0x0;_0x12ef28<_0x15a005[_0x4546('0x39')];_0x12ef28+=0x1){let _0x12eb2b=_0x15a005[_0x12ef28];for(var _0xc06b87=0x0;_0xc06b87<_0x12eb2b[_0x4546('0x86')]['length'];_0xc06b87+=0x1){let _0x412111=_0x12eb2b[_0x4546('0x86')][_0xc06b87];var _0x5cb58c=_0x55b583['clone']();_0x5cb58c[_0x4546('0x3e')](_0x4546('0x8f'),_0x412111['id']);_0x5523f9['push'](db[_0x4546('0x49')]['query'](_0x5cb58c['toString'](),{'type':db['sequelize'][_0x4546('0x90')][_0x4546('0x91')]})['then'](function(_0x572e86){if(_0x572e86[_0x4546('0x39')]===0x1){return _0x412111['id'];}else{var _0x1bb34e=_[_0x4546('0x92')](_['map'](_0x572e86,_0x4546('0x93')),function(_0x3a9f01){return _[_0x4546('0x94')](_0x4ba4aa,_0x3a9f01);});if(_0x1bb34e){return _0x412111['id'];}}}));}}return BPromise[_0x4546('0x95')](_0x5523f9)[_0x4546('0x25')](function(_0xe806bc){_0x57dac4=_(_0x57dac4)['union'](_0xe806bc)[_0x4546('0x96')]()['value']();return db['VoicePrefix'][_0x4546('0x46')]({'where':{'id':_0x697259['params']['id']}})[_0x4546('0x25')](function(_0x42feda){return db[_0x4546('0x49')][_0x4546('0x4a')](function(_0x305a9a){return _0x42feda['removeTeams'](_0x697259[_0x4546('0x33')][_0x4546('0x6f')],{'transaction':_0x305a9a})['then'](function(){if(!_[_0x4546('0x97')](_0x57dac4)){return _0x42feda['removeAgents'](_0x57dac4,{'transaction':_0x305a9a});}})[_0x4546('0x25')](function(){_0x57dac4['forEach'](function(_0x35eb62){socket[_0x4546('0x74')](_0x4546('0x73'),{'UserId':_0x35eb62,'VoicePrefixId':_0x42feda['id']});});});});});});})[_0x4546('0x25')](respondWithStatusCode(_0x228e87,null))[_0x4546('0x43')](handleError(_0x228e87,null));}; \ No newline at end of file +var _0x955f=['online','voicePause','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','forEach','removeTeams','field','tq.TeamId','from','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','isEmpty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./voicePrefix.socket','register','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','get','VoicePrefixes','UserProfileResource','stack','name','send','index','map','VoicePrefix','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','show','params','keys','find','catch','describe','sequelize','transaction','create','body','VoiceExtensionId','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','description','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','VoiceExtension','bulkCreate','push','Set','CDR(prefix)=','callerIdAll','No\x20callerid\x20available','${EXTEN:','charAt','system-','findById','addAgents','ids','spread','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','User','getTeams','Team','addTeams','Agents'];(function(_0xa55284,_0xcfac9){var _0x224e4f=function(_0x27e7b7){while(--_0x27e7b7){_0xa55284['push'](_0xa55284['shift']());}};_0x224e4f(++_0xcfac9);}(_0x955f,0x1eb));var _0xf955=function(_0x36b53d,_0x252c4b){_0x36b53d=_0x36b53d-0x0;var _0x3e2c16=_0x955f[_0x36b53d];return _0x3e2c16;};'use strict';var emlformat=require(_0xf955('0x0'));var rimraf=require(_0xf955('0x1'));var zipdir=require(_0xf955('0x2'));var jsonpatch=require(_0xf955('0x3'));var rp=require(_0xf955('0x4'));var moment=require('moment');var BPromise=require(_0xf955('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf955('0x6'));var sox=require('sox');var csv=require(_0xf955('0x7'));var ejs=require(_0xf955('0x8'));var fs=require('fs');var fs_extra=require(_0xf955('0x9'));var _=require('lodash');var squel=require(_0xf955('0xa'));var crypto=require(_0xf955('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xf955('0xc'));var toCsv=require(_0xf955('0x7'));var querystring=require(_0xf955('0xd'));var Papa=require(_0xf955('0xe'));var Redis=require(_0xf955('0xf'));var authService=require(_0xf955('0x10'));var qs=require(_0xf955('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf955('0x12'));var logger=require('../../config/logger')(_0xf955('0x13'));var utils=require(_0xf955('0x14'));var config=require(_0xf955('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xf955('0x16'))['db'];config['redis']=_[_0xf955('0x17')](config['redis'],{'host':_0xf955('0x18'),'port':0x18eb});var socket=require(_0xf955('0x19'))(new Redis(config[_0xf955('0x1a')]));require(_0xf955('0x1b'))[_0xf955('0x1c')](socket);function respondWithStatusCode(_0x341b8c,_0x1c3235){_0x1c3235=_0x1c3235||0xcc;return function(_0x2783f2){if(_0x2783f2){return _0x341b8c[_0xf955('0x1d')](_0x1c3235);}return _0x341b8c[_0xf955('0x1e')](_0x1c3235)['end']();};}function respondWithResult(_0xc29b35,_0x54e60b){_0x54e60b=_0x54e60b||0xc8;return function(_0x3139d5){if(_0x3139d5){return _0xc29b35[_0xf955('0x1e')](_0x54e60b)[_0xf955('0x1f')](_0x3139d5);}};}function respondWithFilteredResult(_0x15c07c,_0x50930d){return function(_0x5ac6cb){if(_0x5ac6cb){var _0x1e20d1=typeof _0x50930d[_0xf955('0x20')]===_0xf955('0x21')&&typeof _0x50930d['limit']===_0xf955('0x21');var _0x3576fa=_0x5ac6cb[_0xf955('0x22')];var _0x3f960e=_0x1e20d1?0x0:_0x50930d[_0xf955('0x20')];var _0x5f4d9a=_0x1e20d1?_0x5ac6cb[_0xf955('0x22')]:_0x50930d[_0xf955('0x20')]+_0x50930d[_0xf955('0x23')];var _0x488d04;if(_0x5f4d9a>=_0x3576fa){_0x5f4d9a=_0x3576fa;_0x488d04=0xc8;}else{_0x488d04=0xce;}_0x15c07c[_0xf955('0x1e')](_0x488d04);return _0x15c07c['set'](_0xf955('0x24'),_0x3f960e+'-'+_0x5f4d9a+'/'+_0x3576fa)[_0xf955('0x1f')](_0x5ac6cb);}return null;};}function patchUpdates(_0x37143d){return function(_0xa4ebb4){try{jsonpatch[_0xf955('0x25')](_0xa4ebb4,_0x37143d,!![]);}catch(_0x565641){return BPromise[_0xf955('0x26')](_0x565641);}return _0xa4ebb4[_0xf955('0x27')]();};}function saveUpdates(_0x3585c7,_0x13a1a7){return function(_0x17dec2){if(_0x17dec2){return _0x17dec2[_0xf955('0x28')](_0x3585c7)[_0xf955('0x29')](function(_0x552cf3){return _0x552cf3;});}return null;};}function removeEntity(_0x18f435,_0x1acf33){return function(_0xba8a22){if(_0xba8a22){return _0xba8a22[_0xf955('0x2a')]()[_0xf955('0x29')](function(){var _0x13a86d=_0xba8a22[_0xf955('0x2b')]({'plain':!![]});var _0x51f3ab=_0xf955('0x2c');return db[_0xf955('0x2d')][_0xf955('0x2a')]({'where':{'type':_0x51f3ab,'resourceId':_0x13a86d['id']}})[_0xf955('0x29')](function(){return _0xba8a22;});})[_0xf955('0x29')](function(){_0x18f435[_0xf955('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2232a7,_0x1e5d37){return function(_0x4ec3e8){if(!_0x4ec3e8){_0x2232a7[_0xf955('0x1d')](0x194);}return _0x4ec3e8;};}function handleError(_0x2c8df1,_0xf3c870){_0xf3c870=_0xf3c870||0x1f4;return function(_0x1ef794){logger['error'](_0x1ef794[_0xf955('0x2e')]);if(_0x1ef794['name']){delete _0x1ef794[_0xf955('0x2f')];}_0x2c8df1[_0xf955('0x1e')](_0xf3c870)[_0xf955('0x30')](_0x1ef794);};}exports[_0xf955('0x31')]=function(_0x1e8024,_0x32121b){var _0xd5dfb0={},_0x366b6d={},_0x483a12={'count':0x0,'rows':[]};var _0x45e913=_[_0xf955('0x32')](db[_0xf955('0x33')][_0xf955('0x34')],function(_0x4fea0c){return{'name':_0x4fea0c[_0xf955('0x35')],'type':_0x4fea0c[_0xf955('0x36')][_0xf955('0x37')]};});_0x366b6d[_0xf955('0x38')]=_[_0xf955('0x32')](_0x45e913,'name');_0x366b6d['query']=_['keys'](_0x1e8024[_0xf955('0x39')]);_0x366b6d[_0xf955('0x3a')]=_[_0xf955('0x3b')](_0x366b6d[_0xf955('0x38')],_0x366b6d[_0xf955('0x39')]);_0xd5dfb0[_0xf955('0x3c')]=_['intersection'](_0x366b6d[_0xf955('0x38')],qs['fields'](_0x1e8024[_0xf955('0x39')][_0xf955('0x3d')]));_0xd5dfb0[_0xf955('0x3c')]=_0xd5dfb0['attributes'][_0xf955('0x3e')]?_0xd5dfb0['attributes']:_0x366b6d[_0xf955('0x38')];if(!_0x1e8024[_0xf955('0x39')][_0xf955('0x3f')](_0xf955('0x40'))){_0xd5dfb0['limit']=qs[_0xf955('0x23')](_0x1e8024[_0xf955('0x39')]['limit']);_0xd5dfb0[_0xf955('0x20')]=qs[_0xf955('0x20')](_0x1e8024[_0xf955('0x39')]['offset']);}_0xd5dfb0[_0xf955('0x41')]=qs[_0xf955('0x42')](_0x1e8024[_0xf955('0x39')]['sort']);_0xd5dfb0[_0xf955('0x43')]=qs[_0xf955('0x3a')](_[_0xf955('0x44')](_0x1e8024[_0xf955('0x39')],_0x366b6d[_0xf955('0x3a')]),_0x45e913);if(_0x1e8024[_0xf955('0x39')][_0xf955('0x45')]){_0xd5dfb0[_0xf955('0x43')]=_['merge'](_0xd5dfb0[_0xf955('0x43')],{'$or':_[_0xf955('0x32')](_0x45e913,function(_0x2aacdf){if(_0x2aacdf[_0xf955('0x36')]!==_0xf955('0x46')){var _0x13e57d={};_0x13e57d[_0x2aacdf[_0xf955('0x2f')]]={'$like':'%'+_0x1e8024[_0xf955('0x39')][_0xf955('0x45')]+'%'};return _0x13e57d;}})});}_0xd5dfb0=_[_0xf955('0x47')]({},_0xd5dfb0,_0x1e8024[_0xf955('0x48')]);var _0x1c72b8={'where':_0xd5dfb0[_0xf955('0x43')]};return db[_0xf955('0x33')][_0xf955('0x22')](_0x1c72b8)[_0xf955('0x29')](function(_0x356ec2){_0x483a12[_0xf955('0x22')]=_0x356ec2;if(_0x1e8024[_0xf955('0x39')]['includeAll']){_0xd5dfb0[_0xf955('0x49')]=[{'all':!![]}];}return db[_0xf955('0x33')][_0xf955('0x4a')](_0xd5dfb0);})['then'](function(_0x16fc1a){_0x483a12['rows']=_0x16fc1a;return _0x483a12;})[_0xf955('0x29')](respondWithFilteredResult(_0x32121b,_0xd5dfb0))['catch'](handleError(_0x32121b,null));};exports[_0xf955('0x4b')]=function(_0x24cb74,_0x213136){var _0x21ddf0={'raw':![],'where':{'id':_0x24cb74[_0xf955('0x4c')]['id']}},_0x50b209={};_0x50b209[_0xf955('0x38')]=_[_0xf955('0x4d')](db['VoicePrefix']['rawAttributes']);_0x50b209[_0xf955('0x39')]=_[_0xf955('0x4d')](_0x24cb74[_0xf955('0x39')]);_0x50b209[_0xf955('0x3a')]=_['intersection'](_0x50b209[_0xf955('0x38')],_0x50b209[_0xf955('0x39')]);_0x21ddf0[_0xf955('0x3c')]=_['intersection'](_0x50b209[_0xf955('0x38')],qs['fields'](_0x24cb74[_0xf955('0x39')][_0xf955('0x3d')]));_0x21ddf0[_0xf955('0x3c')]=_0x21ddf0['attributes'][_0xf955('0x3e')]?_0x21ddf0[_0xf955('0x3c')]:_0x50b209[_0xf955('0x38')];if(_0x24cb74[_0xf955('0x39')]['includeAll']){_0x21ddf0[_0xf955('0x49')]=[{'all':!![]}];}_0x21ddf0=_[_0xf955('0x47')]({},_0x21ddf0,_0x24cb74[_0xf955('0x48')]);return db[_0xf955('0x33')][_0xf955('0x4e')](_0x21ddf0)['then'](handleEntityNotFound(_0x213136,null))[_0xf955('0x29')](respondWithResult(_0x213136,null))['catch'](handleError(_0x213136,null));};exports[_0xf955('0x2a')]=function(_0x5b5621,_0x38edc7){return db['VoicePrefix']['find']({'where':{'id':_0x5b5621[_0xf955('0x4c')]['id']}})[_0xf955('0x29')](handleEntityNotFound(_0x38edc7,null))['then'](removeEntity(_0x38edc7,null))[_0xf955('0x4f')](handleError(_0x38edc7,null));};exports['describe']=function(_0x488fcd,_0x4c2977){return db['VoicePrefix'][_0xf955('0x50')]()[_0xf955('0x29')](respondWithResult(_0x4c2977,null))['catch'](handleError(_0x4c2977,null));};exports['create']=function(_0x171609,_0x17fc93){var _0x460052;return db[_0xf955('0x51')][_0xf955('0x52')](function(_0xa56483){return db[_0xf955('0x33')][_0xf955('0x53')](_0x171609[_0xf955('0x54')],{'transaction':_0xa56483})[_0xf955('0x29')](function(_0x1b7b73){_0x460052=_0x1b7b73[_0xf955('0x2b')]({'plain':!![]});return db['VoiceExtension'][_0xf955('0x4e')]({'where':{'id':_0x460052[_0xf955('0x55')]},'raw':!![]})[_0xf955('0x29')](function(_0x24322a){return createVoicePrefixExtensions(_0x460052,_0x24322a,_0xa56483);});});})[_0xf955('0x29')](function(){var _0x4dc34b=_0x171609[_0xf955('0x56')][_0xf955('0x2b')]({'plain':!![]});if(!_0x4dc34b)throw new Error(_0xf955('0x57'));if(_0x4dc34b[_0xf955('0x58')]===_0xf955('0x56')){var _0x9057df=_0x460052;return db[_0xf955('0x59')][_0xf955('0x4e')]({'where':{'name':_0xf955('0x2c'),'userProfileId':_0x4dc34b[_0xf955('0x5a')]},'raw':!![]})['then'](function(_0x19a455){if(_0x19a455&&_0x19a455[_0xf955('0x5b')]===0x0){return db[_0xf955('0x2d')][_0xf955('0x53')]({'name':_0x9057df[_0xf955('0x2f')],'resourceId':_0x9057df['id'],'type':_0x19a455[_0xf955('0x2f')],'sectionId':_0x19a455['id']},{})[_0xf955('0x29')](function(){return _0x460052;});}else{return _0x460052;}})[_0xf955('0x4f')](function(_0x948963){logger[_0xf955('0x5c')](_0xf955('0x5d'),_0x948963);throw _0x948963;});}return _0x460052;})[_0xf955('0x29')](respondWithResult(_0x17fc93,null))['catch'](handleError(_0x17fc93,null));};function Extension(_0x1388a0,_0x452de9,_0x381cf0,_0x3eb727){this[_0xf955('0x5e')]=_0xf955('0x5f');this[_0xf955('0x60')]=_0x1388a0;this['app']=_0x381cf0;this['type']='system';this[_0xf955('0x61')]='Voice\x20Prefix\x20Extension';this['priority']=_0x452de9;this[_0xf955('0x62')]=_0x3eb727;}function createVoicePrefixExtensions(_0x533e0f,_0x10535d,_0x3fa5b5){return new BPromise(function(_0x158469,_0x30cb80){var _0x4c88ae=new Extension(formatPrefixName(_0x533e0f[_0xf955('0x63')]),0x1,_0xf955('0x64'),_0xf955('0x65'));_0x4c88ae[_0xf955('0x66')]=_0x533e0f['id'];return db[_0xf955('0x67')]['create'](_0x4c88ae,{'transaction':_0x3fa5b5})[_0xf955('0x29')](function(_0x5990d7){var _0x18905b=_0x5990d7[_0xf955('0x2b')]({'plain':!![]});var _0x3adee7=_['map'](addVoicePrefixExtensions(_0x533e0f,_0x10535d),function(_0x39aaed){_0x39aaed[_0xf955('0x55')]=_0x18905b['id'];_0x39aaed[_0xf955('0x66')]=_0x533e0f['id'];return _0x39aaed;});return db[_0xf955('0x67')][_0xf955('0x68')](_0x3adee7,{'transaction':_0x3fa5b5})[_0xf955('0x29')](function(_0x3761f2){if(!_0x3761f2){return _0x30cb80('Extensions\x20creation\x20failed');}else{return _0x158469(_0x3761f2);}})['catch'](function(_0x1bf4ac){return _0x30cb80(_0x1bf4ac);});});;});};function addVoicePrefixExtensions(_0x2d29a0,_0x3390f3){var _0x3f0873=[];var _0xab5eed=formatPrefixName(_0x2d29a0[_0xf955('0x63')]);_0x3f0873[_0xf955('0x69')](new Extension(_0xab5eed,0x2,_0xf955('0x6a'),_0xf955('0x6b')+_0x2d29a0[_0xf955('0x2f')]));if(_0x2d29a0[_0xf955('0x6c')]){_0x3f0873['push'](new Extension(_0xab5eed,0x3,_0xf955('0x6a'),'PREFIX-CALLERIDALL='+_0x2d29a0[_0xf955('0x6c')]));}else{_0x3f0873['push'](new Extension(_0xab5eed,0x3,'NoOp',_0xf955('0x6d')));}_0x3f0873[_0xf955('0x69')](new Extension(_0xab5eed,0x4,'goto',_0x3390f3[_0xf955('0x5e')]+','+_0xf955('0x6e')+(0x8+_0x2d29a0['name']['length'])+'}'+','+0x1));return _0x3f0873;}function formatPrefixName(_0x1e418){var _0xdf351a='_';for(var _0x46f0e2=0x0;_0x46f0e2<_0x1e418['length'];_0x46f0e2++){if(_0x1e418[_0xf955('0x6f')](_0x46f0e2)=='-'){_0xdf351a+=_0x1e418[_0xf955('0x6f')](_0x46f0e2);}else{_0xdf351a+='['+_0x1e418[_0xf955('0x6f')](_0x46f0e2)+']';}}_0xdf351a+='.';return _0xdf351a;}exports[_0xf955('0x28')]=function(_0x38461c,_0x2c2911,_0x260581){var _0xf1e40b=_0x38461c['body'];_0xf1e40b[_0xf955('0x63')]=_0xf955('0x70')+_0xf1e40b['name']+'-';return db[_0xf955('0x51')][_0xf955('0x52')](function(_0x54dac){return db[_0xf955('0x33')]['update'](_0xf1e40b,{'where':{'id':_0xf1e40b['id']},'transaction':_0x54dac})[_0xf955('0x29')](function(){return db[_0xf955('0x67')]['destroy']({'where':{'VoicePrefixId':_0xf1e40b['id']},'transaction':_0x54dac})['then'](function(){return db[_0xf955('0x67')][_0xf955('0x4e')]({'where':{'id':_0xf1e40b[_0xf955('0x55')]},'raw':!![]})[_0xf955('0x29')](function(_0x4de03b){return createVoicePrefixExtensions(_0xf1e40b,_0x4de03b,_0x54dac);});});});})[_0xf955('0x29')](function(){return db[_0xf955('0x33')][_0xf955('0x71')](_0xf1e40b['id']);})[_0xf955('0x29')](respondWithResult(_0x2c2911,null))[_0xf955('0x4f')](handleError(_0x2c2911,null));};exports[_0xf955('0x72')]=function(_0x403876,_0x4635e6,_0x61b1ef){return db[_0xf955('0x33')][_0xf955('0x4e')]({'where':{'id':_0x403876[_0xf955('0x4c')]['id']}})[_0xf955('0x29')](handleEntityNotFound(_0x4635e6,null))['then'](function(_0x1af54a){if(_0x1af54a){return _0x1af54a[_0xf955('0x72')](_0x403876[_0xf955('0x54')][_0xf955('0x73')],_['omit'](_0x403876[_0xf955('0x54')],[_0xf955('0x73'),'id'])||{})[_0xf955('0x74')](function(_0x8bdcf2){for(var _0x2b266d=0x0;_0x2b266d<_0x403876[_0xf955('0x54')][_0xf955('0x73')][_0xf955('0x3e')];_0x2b266d+=0x1){socket[_0xf955('0x75')](_0xf955('0x76'),{'UserId':Number(_0x403876[_0xf955('0x54')]['ids'][_0x2b266d]),'VoicePrefixId':Number(_0x403876[_0xf955('0x4c')]['id'])});}return _0x8bdcf2;});}})[_0xf955('0x29')](respondWithResult(_0x4635e6,null))[_0xf955('0x4f')](handleError(_0x4635e6,null));};exports[_0xf955('0x77')]=function(_0x33aa10,_0xaeaffb,_0x1cd55b){return db['VoicePrefix'][_0xf955('0x4e')]({'where':{'id':_0x33aa10['params']['id']}})[_0xf955('0x29')](handleEntityNotFound(_0xaeaffb,null))['then'](function(_0x1a61d9){if(_0x1a61d9){return _0x1a61d9[_0xf955('0x77')](_0x33aa10[_0xf955('0x39')][_0xf955('0x73')])[_0xf955('0x29')](function(){if(_[_0xf955('0x78')](_0x33aa10['query'][_0xf955('0x73')])){for(var _0x2b0c75=0x0;_0x2b0c75<_0x33aa10[_0xf955('0x39')]['ids']['length'];_0x2b0c75+=0x1){socket[_0xf955('0x75')](_0xf955('0x79'),{'UserId':Number(_0x33aa10[_0xf955('0x39')]['ids'][_0x2b0c75]),'VoicePrefixId':Number(_0x33aa10[_0xf955('0x4c')]['id'])});}}else{socket['emit'](_0xf955('0x79'),{'UserId':Number(_0x33aa10['query'][_0xf955('0x73')]),'VoicePrefixId':Number(_0x33aa10[_0xf955('0x4c')]['id'])});}});}})[_0xf955('0x29')](respondWithStatusCode(_0xaeaffb,null))['catch'](handleError(_0xaeaffb,null));};exports[_0xf955('0x7a')]=function(_0x397f7e,_0x2cd1bd,_0x521227){var _0xba62d0={};var _0x441a9c={};var _0x126cb5;var _0x3d796b;return db[_0xf955('0x33')][_0xf955('0x7b')]({'where':{'id':_0x397f7e[_0xf955('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2cd1bd,null))[_0xf955('0x29')](function(_0x1e0882){if(_0x1e0882){_0x126cb5=_0x1e0882;_0x441a9c[_0xf955('0x38')]=_[_0xf955('0x4d')](db[_0xf955('0x7c')]['rawAttributes']);_0x441a9c[_0xf955('0x39')]=_[_0xf955('0x4d')](_0x397f7e['query']);_0x441a9c['filters']=_[_0xf955('0x3b')](_0x441a9c[_0xf955('0x38')],_0x441a9c[_0xf955('0x39')]);_0xba62d0[_0xf955('0x3c')]=_['intersection'](_0x441a9c[_0xf955('0x38')],qs['fields'](_0x397f7e['query'][_0xf955('0x3d')]));_0xba62d0[_0xf955('0x3c')]=_0xba62d0['attributes']['length']?_0xba62d0[_0xf955('0x3c')]:_0x441a9c[_0xf955('0x38')];_0xba62d0[_0xf955('0x41')]=qs['sort'](_0x397f7e['query'][_0xf955('0x42')]);_0xba62d0[_0xf955('0x43')]=qs[_0xf955('0x3a')](_['pick'](_0x397f7e['query'],_0x441a9c['filters']));if(_0x397f7e['query'][_0xf955('0x45')]){_0xba62d0['where']=_[_0xf955('0x47')](_0xba62d0[_0xf955('0x43')],{'$or':_[_0xf955('0x32')](_0xba62d0[_0xf955('0x3c')],function(_0x325f2e){var _0x5e8f32={};_0x5e8f32[_0x325f2e]={'$like':'%'+_0x397f7e[_0xf955('0x39')][_0xf955('0x45')]+'%'};return _0x5e8f32;})});}_0xba62d0=_[_0xf955('0x47')]({},_0xba62d0,_0x397f7e[_0xf955('0x48')]);return _0x126cb5['getAgents'](_0xba62d0);}})[_0xf955('0x29')](function(_0x2737c6){if(_0x2737c6){_0x3d796b=_0x2737c6['length'];if(!_0x397f7e[_0xf955('0x39')][_0xf955('0x3f')](_0xf955('0x40'))){_0xba62d0[_0xf955('0x23')]=qs[_0xf955('0x23')](_0x397f7e[_0xf955('0x39')]['limit']);_0xba62d0['offset']=qs[_0xf955('0x20')](_0x397f7e['query'][_0xf955('0x20')]);}return _0x126cb5[_0xf955('0x7a')](_0xba62d0);}})[_0xf955('0x29')](function(_0x95cc72){if(_0x95cc72){return _0x95cc72?{'count':_0x3d796b,'rows':_0x95cc72}:null;}})['then'](respondWithResult(_0x2cd1bd,null))['catch'](handleError(_0x2cd1bd,null));};exports[_0xf955('0x7d')]=function(_0x12b9f8,_0x20a220,_0x25319c){var _0xee52ad={};var _0x4b2c01={};var _0x21f45e;var _0x132c80;return db[_0xf955('0x33')][_0xf955('0x7b')]({'where':{'id':_0x12b9f8['params']['id']}})['then'](handleEntityNotFound(_0x20a220,null))[_0xf955('0x29')](function(_0x14123e){if(_0x14123e){_0x21f45e=_0x14123e;_0x4b2c01['model']=_[_0xf955('0x4d')](db[_0xf955('0x7e')][_0xf955('0x34')]);_0x4b2c01[_0xf955('0x39')]=_['keys'](_0x12b9f8[_0xf955('0x39')]);_0x4b2c01[_0xf955('0x3a')]=_[_0xf955('0x3b')](_0x4b2c01[_0xf955('0x38')],_0x4b2c01[_0xf955('0x39')]);_0xee52ad[_0xf955('0x3c')]=_[_0xf955('0x3b')](_0x4b2c01['model'],qs['fields'](_0x12b9f8['query'][_0xf955('0x3d')]));_0xee52ad[_0xf955('0x3c')]=_0xee52ad[_0xf955('0x3c')][_0xf955('0x3e')]?_0xee52ad[_0xf955('0x3c')]:_0x4b2c01[_0xf955('0x38')];_0xee52ad[_0xf955('0x41')]=qs['sort'](_0x12b9f8[_0xf955('0x39')][_0xf955('0x42')]);_0xee52ad['where']=qs[_0xf955('0x3a')](_[_0xf955('0x44')](_0x12b9f8[_0xf955('0x39')],_0x4b2c01[_0xf955('0x3a')]));if(_0x12b9f8[_0xf955('0x39')][_0xf955('0x45')]){_0xee52ad[_0xf955('0x43')]=_[_0xf955('0x47')](_0xee52ad['where'],{'$or':_['map'](_0xee52ad['attributes'],function(_0x1d3d27){var _0x3945f5={};_0x3945f5[_0x1d3d27]={'$like':'%'+_0x12b9f8[_0xf955('0x39')][_0xf955('0x45')]+'%'};return _0x3945f5;})});}_0xee52ad=_[_0xf955('0x47')]({},_0xee52ad,_0x12b9f8['options']);return _0x21f45e[_0xf955('0x7d')](_0xee52ad);}})[_0xf955('0x29')](function(_0x1d2559){if(_0x1d2559){_0x132c80=_0x1d2559[_0xf955('0x3e')];if(!_0x12b9f8[_0xf955('0x39')][_0xf955('0x3f')](_0xf955('0x40'))){_0xee52ad[_0xf955('0x23')]=qs[_0xf955('0x23')](_0x12b9f8['query'][_0xf955('0x23')]);_0xee52ad['offset']=qs[_0xf955('0x20')](_0x12b9f8[_0xf955('0x39')][_0xf955('0x20')]);}return _0x21f45e[_0xf955('0x7d')](_0xee52ad);}})[_0xf955('0x29')](function(_0x187fb0){if(_0x187fb0){return _0x187fb0?{'count':_0x132c80,'rows':_0x187fb0}:null;}})[_0xf955('0x29')](respondWithResult(_0x20a220,null))['catch'](handleError(_0x20a220,null));};exports[_0xf955('0x7f')]=function(_0x4bb590,_0x222df2,_0x40d7c7){var _0x569eee=_0x4bb590[_0xf955('0x54')][_0xf955('0x73')];var _0x1d3aa1;return db[_0xf955('0x7e')][_0xf955('0x4a')]({'where':{'id':_0x569eee},'attributes':['id'],'include':[{'model':db[_0xf955('0x7c')],'as':_0xf955('0x80'),'attributes':['id','name',_0xf955('0x81'),_0xf955('0x82'),'interface'],'raw':!![]}]})[_0xf955('0x29')](function(_0x3fd8ed){if(_0x3fd8ed){_0x1d3aa1=_0x3fd8ed;var _0x4bbba6=_['flatMap'](_0x3fd8ed,function(_0x356eb0){var _0x314173=_0x356eb0[_0xf955('0x2b')]({'plain':!![]});return _0x314173['Agents'];});return db[_0xf955('0x33')][_0xf955('0x4e')]({'where':{'id':_0x4bb590[_0xf955('0x4c')]['id']}})[_0xf955('0x29')](function(_0x399ffb){return db[_0xf955('0x51')][_0xf955('0x52')](function(_0x8d0c5b){return _0x399ffb[_0xf955('0x7f')](_0x569eee,{'transaction':_0x8d0c5b})[_0xf955('0x29')](function(){return BPromise[_0xf955('0x83')](_0x1d3aa1,function(_0x41fde7){return db[_0xf955('0x84')][_0xf955('0x85')]({'TeamId':_0x41fde7['id'],'VoicePrefixId':_0x4bb590['params']['id']},{'transaction':_0x8d0c5b});});})['then'](function(){return BPromise[_0xf955('0x83')](_0x4bbba6,function(_0xc7cc7b){return db[_0xf955('0x86')][_0xf955('0x87')]({'where':{'UserId':_0xc7cc7b['id'],'VoicePrefixId':_0x4bb590[_0xf955('0x4c')]['id']},'transaction':_0x8d0c5b});});})['then'](function(){_0x4bbba6[_0xf955('0x88')](function(_0x3bab0d){socket['emit'](_0xf955('0x76'),{'UserId':_0x3bab0d['id'],'VoicePrefixId':_0x399ffb['id']});});});});});}})[_0xf955('0x29')](respondWithStatusCode(_0x222df2,null))[_0xf955('0x4f')](handleError(_0x222df2,null));};exports[_0xf955('0x89')]=function(_0x5a20d4,_0x3cc61c,_0x588a0f){return db[_0xf955('0x7e')][_0xf955('0x4a')]({'where':{'id':_0x5a20d4[_0xf955('0x39')][_0xf955('0x73')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xf955('0x80'),'attributes':['id'],'raw':!![]}]})[_0xf955('0x29')](handleEntityNotFound(_0x3cc61c,null))[_0xf955('0x29')](function(_0x1c75cc){var _0x340089=_['map'](_0x1c75cc,'id');var _0x12e6aa=[];var _0x1f38db=[];var _0x395013=squel['select']();_0x395013[_0xf955('0x8a')](_0xf955('0x8b'))[_0xf955('0x8c')](_0xf955('0x8d'),'tq')[_0xf955('0x8e')](_0xf955('0x8f'),'ut',_0xf955('0x90'))['where']('VoicePrefixId\x20=\x20?',_0x5a20d4['params']['id']);for(var _0x345a7c=0x0;_0x345a7c<_0x1c75cc[_0xf955('0x3e')];_0x345a7c+=0x1){let _0x57fef3=_0x1c75cc[_0x345a7c];for(var _0x476e81=0x0;_0x476e81<_0x57fef3[_0xf955('0x80')][_0xf955('0x3e')];_0x476e81+=0x1){let _0x5397e4=_0x57fef3[_0xf955('0x80')][_0x476e81];var _0x31c26a=_0x395013['clone']();_0x31c26a['where'](_0xf955('0x91'),_0x5397e4['id']);_0x1f38db[_0xf955('0x69')](db[_0xf955('0x51')][_0xf955('0x39')](_0x31c26a[_0xf955('0x92')](),{'type':db['sequelize'][_0xf955('0x93')][_0xf955('0x94')]})[_0xf955('0x29')](function(_0x38935f){if(_0x38935f[_0xf955('0x3e')]===0x1){return _0x5397e4['id'];}else{var _0x480d95=_[_0xf955('0x95')](_[_0xf955('0x32')](_0x38935f,_0xf955('0x96')),function(_0x22cf11){return _['includes'](_0x340089,_0x22cf11);});if(_0x480d95){return _0x5397e4['id'];}}}));}}return BPromise[_0xf955('0x97')](_0x1f38db)[_0xf955('0x29')](function(_0x723d5e){_0x12e6aa=_(_0x12e6aa)[_0xf955('0x98')](_0x723d5e)[_0xf955('0x99')]()['value']();return db[_0xf955('0x33')][_0xf955('0x4e')]({'where':{'id':_0x5a20d4['params']['id']}})[_0xf955('0x29')](function(_0x38e078){return db[_0xf955('0x51')][_0xf955('0x52')](function(_0x19df1c){return _0x38e078[_0xf955('0x89')](_0x5a20d4[_0xf955('0x39')][_0xf955('0x73')],{'transaction':_0x19df1c})[_0xf955('0x29')](function(){if(!_[_0xf955('0x9a')](_0x12e6aa)){return _0x38e078['removeAgents'](_0x12e6aa,{'transaction':_0x19df1c});}})['then'](function(){_0x12e6aa[_0xf955('0x88')](function(_0x161a62){socket[_0xf955('0x75')](_0xf955('0x79'),{'UserId':_0x161a62,'VoicePrefixId':_0x38e078['id']});});});});});});})['then'](respondWithStatusCode(_0x3cc61c,null))[_0xf955('0x4f')](handleError(_0x3cc61c,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index a9bc7c8..3d43c7b 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 _0x5f8f=['VoicePrefix','update','emit','hook','exports','events','../../mysqldb'];(function(_0x20e6b2,_0xee01e3){var _0x5a19e4=function(_0x420742){while(--_0x420742){_0x20e6b2['push'](_0x20e6b2['shift']());}};_0x5a19e4(++_0xee01e3);}(_0x5f8f,0x1a2));var _0xf5f8=function(_0x436c65,_0x35818b){_0x436c65=_0x436c65-0x0;var _0x52c563=_0x5f8f[_0x436c65];return _0x52c563;};'use strict';var EventEmitter=require(_0xf5f8('0x0'));var VoicePrefix=require(_0xf5f8('0x1'))['db'][_0xf5f8('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xf5f8('0x3'),'afterDestroy':'remove'};function emitEvent(_0xc41ce){return function(_0x4e7ecc,_0x17d7de,_0x103d57){VoicePrefixEvents['emit'](_0xc41ce+':'+_0x4e7ecc['id'],_0x4e7ecc);VoicePrefixEvents[_0xf5f8('0x4')](_0xc41ce,_0x4e7ecc);_0x103d57(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0xf5f8('0x5')](e,emitEvent(event));}}module[_0xf5f8('0x6')]=VoicePrefixEvents; \ No newline at end of file +var _0x85b1=['save','update','remove','emit','hook','exports','events','VoicePrefix','setMaxListeners'];(function(_0x257af8,_0xdd8cb){var _0x4e5518=function(_0x1c37c2){while(--_0x1c37c2){_0x257af8['push'](_0x257af8['shift']());}};_0x4e5518(++_0xdd8cb);}(_0x85b1,0xc3));var _0x185b=function(_0x476bf4,_0x2a3755){_0x476bf4=_0x476bf4-0x0;var _0x788ffe=_0x85b1[_0x476bf4];return _0x788ffe;};'use strict';var EventEmitter=require(_0x185b('0x0'));var VoicePrefix=require('../../mysqldb')['db'][_0x185b('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x185b('0x2')](0x0);var events={'afterCreate':_0x185b('0x3'),'afterUpdate':_0x185b('0x4'),'afterDestroy':_0x185b('0x5')};function emitEvent(_0x4620e6){return function(_0x5b83a9,_0x5129e7,_0x24003f){VoicePrefixEvents[_0x185b('0x6')](_0x4620e6+':'+_0x5b83a9['id'],_0x5b83a9);VoicePrefixEvents[_0x185b('0x6')](_0x4620e6,_0x5b83a9);_0x24003f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0x185b('0x7')](e,emitEvent(event));}}module[_0x185b('0x8')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index d1ffaaf..60c76fb 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 _0xa0e9=['request-promise','path','rimraf','./voicePrefix.attributes','exports','VoicePrefix','voice_prefixes','lodash','util','moment'];(function(_0x1d4421,_0x2a01f3){var _0x1013de=function(_0xb93624){while(--_0xb93624){_0x1d4421['push'](_0x1d4421['shift']());}};_0x1013de(++_0x2a01f3);}(_0xa0e9,0xcf));var _0x9a0e=function(_0x48817d,_0x12a7cf){_0x48817d=_0x48817d-0x0;var _0x3ffdae=_0xa0e9[_0x48817d];return _0x3ffdae;};'use strict';var _=require(_0x9a0e('0x0'));var util=require(_0x9a0e('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x9a0e('0x2'));var BPromise=require('bluebird');var rp=require(_0x9a0e('0x3'));var fs=require('fs');var path=require(_0x9a0e('0x4'));var rimraf=require(_0x9a0e('0x5'));var config=require('../../config/environment');var attributes=require(_0x9a0e('0x6'));module[_0x9a0e('0x7')]=function(_0x4f1e11,_0x3c3c29){return _0x4f1e11['define'](_0x9a0e('0x8'),attributes,{'tableName':_0x9a0e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xef57=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','VoicePrefix','voice_prefixes','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xef57,0x1ed));var _0x7ef5=function(_0x4810f5,_0x3a3fb9){_0x4810f5=_0x4810f5-0x0;var _0x59cfa2=_0xef57[_0x4810f5];return _0x59cfa2;};'use strict';var _=require(_0x7ef5('0x0'));var util=require(_0x7ef5('0x1'));var logger=require(_0x7ef5('0x2'))(_0x7ef5('0x3'));var moment=require(_0x7ef5('0x4'));var BPromise=require(_0x7ef5('0x5'));var rp=require(_0x7ef5('0x6'));var fs=require('fs');var path=require(_0x7ef5('0x7'));var rimraf=require(_0x7ef5('0x8'));var config=require(_0x7ef5('0x9'));var attributes=require('./voicePrefix.attributes');module['exports']=function(_0x209075,_0x393257){return _0x209075[_0x7ef5('0xa')](_0x7ef5('0xb'),attributes,{'tableName':_0x7ef5('0xc'),'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 e8837a5..a187fab 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 _0xd301=['defaults','socket.io-emitter','./voicePrefix.socket','register','request','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis'];(function(_0x4e7af4,_0x758572){var _0x2548f1=function(_0xa849c){while(--_0xa849c){_0x4e7af4['push'](_0x4e7af4['shift']());}};_0x2548f1(++_0x758572);}(_0xd301,0x145));var _0x1d30=function(_0x483351,_0xb26b44){_0x483351=_0x483351-0x0;var _0x2f9d65=_0xd301[_0x483351];return _0x2f9d65;};'use strict';var _=require(_0x1d30('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1d30('0x1'));var fs=require('fs');var Redis=require(_0x1d30('0x2'));var db=require(_0x1d30('0x3'))['db'];var utils=require(_0x1d30('0x4'));var logger=require(_0x1d30('0x5'))(_0x1d30('0x6'));var config=require(_0x1d30('0x7'));var jayson=require(_0x1d30('0x8'));var client=jayson[_0x1d30('0x9')]['http']({'port':0x232a});config[_0x1d30('0xa')]=_[_0x1d30('0xb')](config[_0x1d30('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x1d30('0xc'))(new Redis(config[_0x1d30('0xa')]));require(_0x1d30('0xd'))[_0x1d30('0xe')](socket);function respondWithRpcPromise(_0x2a526e,_0xbad263,_0x2bcc44){return new BPromise(function(_0x5ced3a,_0x3b65ed){return client[_0x1d30('0xf')](_0x2a526e,_0x2bcc44)[_0x1d30('0x10')](function(_0x521497){logger[_0x1d30('0x11')](_0x1d30('0x12'),_0xbad263,_0x1d30('0x13'));logger[_0x1d30('0x14')](_0x1d30('0x15'),_0xbad263,_0x1d30('0x13'),JSON[_0x1d30('0x16')](_0x521497));if(_0x521497[_0x1d30('0x17')]){if(_0x521497[_0x1d30('0x17')][_0x1d30('0x18')]===0x1f4){logger[_0x1d30('0x17')](_0x1d30('0x12'),_0xbad263,_0x521497[_0x1d30('0x17')][_0x1d30('0x19')]);return _0x3b65ed(_0x521497[_0x1d30('0x17')]['message']);}logger[_0x1d30('0x17')](_0x1d30('0x12'),_0xbad263,_0x521497[_0x1d30('0x17')][_0x1d30('0x19')]);return _0x5ced3a(_0x521497[_0x1d30('0x17')]['message']);}else{logger['info'](_0x1d30('0x12'),_0xbad263,_0x1d30('0x13'));_0x5ced3a(_0x521497[_0x1d30('0x1a')][_0x1d30('0x19')]);}})[_0x1d30('0x1b')](function(_0x458b97){logger[_0x1d30('0x17')](_0x1d30('0x12'),_0xbad263,_0x458b97);_0x3b65ed(_0x458b97);});});} \ No newline at end of file +var _0xb931=['error','code','VoicePrefix,\x20%s,\x20%s','message','catch','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','then','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x32bce8,_0x49bbae){var _0x36ee96=function(_0x1517d5){while(--_0x1517d5){_0x32bce8['push'](_0x32bce8['shift']());}};_0x36ee96(++_0x49bbae);}(_0xb931,0x155));var _0x1b93=function(_0x3da5a0,_0x253d15){_0x3da5a0=_0x3da5a0-0x0;var _0x5020ce=_0xb931[_0x3da5a0];return _0x5020ce;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1b93('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1b93('0x1'));var db=require(_0x1b93('0x2'))['db'];var utils=require(_0x1b93('0x3'));var logger=require(_0x1b93('0x4'))(_0x1b93('0x5'));var config=require(_0x1b93('0x6'));var jayson=require(_0x1b93('0x7'));var client=jayson[_0x1b93('0x8')][_0x1b93('0x9')]({'port':0x232a});config[_0x1b93('0xa')]=_[_0x1b93('0xb')](config[_0x1b93('0xa')],{'host':_0x1b93('0xc'),'port':0x18eb});var socket=require(_0x1b93('0xd'))(new Redis(config[_0x1b93('0xa')]));require('./voicePrefix.socket')['register'](socket);function respondWithRpcPromise(_0x35ce31,_0x151964,_0x12026b){return new BPromise(function(_0x4aa9fb,_0x38e7da){return client['request'](_0x35ce31,_0x12026b)[_0x1b93('0xe')](function(_0x4391ec){logger['info']('VoicePrefix,\x20%s,\x20%s',_0x151964,_0x1b93('0xf'));logger[_0x1b93('0x10')](_0x1b93('0x11'),_0x151964,'request\x20sent',JSON[_0x1b93('0x12')](_0x4391ec));if(_0x4391ec['error']){if(_0x4391ec[_0x1b93('0x13')][_0x1b93('0x14')]===0x1f4){logger[_0x1b93('0x13')](_0x1b93('0x15'),_0x151964,_0x4391ec[_0x1b93('0x13')][_0x1b93('0x16')]);return _0x38e7da(_0x4391ec['error'][_0x1b93('0x16')]);}logger[_0x1b93('0x13')](_0x1b93('0x15'),_0x151964,_0x4391ec[_0x1b93('0x13')]['message']);return _0x4aa9fb(_0x4391ec[_0x1b93('0x13')][_0x1b93('0x16')]);}else{logger['info'](_0x1b93('0x15'),_0x151964,_0x1b93('0xf'));_0x4aa9fb(_0x4391ec['result']['message']);}})[_0x1b93('0x17')](function(_0x2780be){logger[_0x1b93('0x13')](_0x1b93('0x15'),_0x151964,_0x2780be);_0x38e7da(_0x2780be);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index d92d3cf..3ffd9ac 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 _0x5825=['register','length','voicePrefix:','./voicePrefix.events','save','remove','update','emit','removeListener'];(function(_0x2067e9,_0x5e6a97){var _0x280ce4=function(_0x2eca23){while(--_0x2eca23){_0x2067e9['push'](_0x2067e9['shift']());}};_0x280ce4(++_0x5e6a97);}(_0x5825,0x78));var _0x5582=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x5825[_0x59ee6f];return _0x4c0979;};'use strict';var VoicePrefixEvents=require(_0x5582('0x0'));var events=[_0x5582('0x1'),_0x5582('0x2'),_0x5582('0x3')];function createListener(_0x54a828,_0x3d828c){return function(_0x515266){_0x3d828c[_0x5582('0x4')](_0x54a828,_0x515266);};}function removeListener(_0x2dbcea,_0x3713d6){return function(){VoicePrefixEvents[_0x5582('0x5')](_0x2dbcea,_0x3713d6);};}exports[_0x5582('0x6')]=function(_0x11eb87){for(var _0x17a897=0x0,_0x5d618a=events[_0x5582('0x7')];_0x17a897<_0x5d618a;_0x17a897++){var _0x588f5f=events[_0x17a897];var _0x39b66=createListener(_0x5582('0x8')+_0x588f5f,_0x11eb87);VoicePrefixEvents['on'](_0x588f5f,_0x39b66);}}; \ No newline at end of file +var _0xd382=['./voicePrefix.events','save','remove','update','emit','voicePrefix:'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd382,0x1b6));var _0x2d38=function(_0x3b8f1a,_0x5803b8){_0x3b8f1a=_0x3b8f1a-0x0;var _0x30d8ab=_0xd382[_0x3b8f1a];return _0x30d8ab;};'use strict';var VoicePrefixEvents=require(_0x2d38('0x0'));var events=[_0x2d38('0x1'),_0x2d38('0x2'),_0x2d38('0x3')];function createListener(_0x260d8e,_0xe32566){return function(_0x9ab754){_0xe32566[_0x2d38('0x4')](_0x260d8e,_0x9ab754);};}function removeListener(_0xf6bceb,_0x312012){return function(){VoicePrefixEvents['removeListener'](_0xf6bceb,_0x312012);};}exports['register']=function(_0x5a8219){for(var _0x30106c=0x0,_0x1e2919=events['length'];_0x30106c<_0x1e2919;_0x30106c++){var _0x1296cb=events[_0x30106c];var _0x3fb88f=createListener(_0x2d38('0x5')+_0x1296cb,_0x5a8219);VoicePrefixEvents['on'](_0x1296cb,_0x3fb88f);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 28d5e56..83ffbf4 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(_0x3d9557,_0x5d09d2){var _0x359ff8=function(_0x784fa){while(--_0x784fa){_0x3d9557['push'](_0x3d9557['shift']());}};_0x359ff8(++_0x5d09d2);}(_0xb10b,0x12a));var _0xbb10=function(_0x521a00,_0x3e3d24){_0x521a00=_0x521a00-0x0;var _0xc8130=_0xb10b[_0x521a00];return _0xc8130;};'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 _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(_0x23a079,_0xb8c9aa){var _0x53f2a5=function(_0x1b3dc5){while(--_0x1b3dc5){_0x23a079['push'](_0x23a079['shift']());}};_0x53f2a5(++_0xb8c9aa);}(_0xb10b,0x12a));var _0xbb10=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0xb10b[_0x5f1391];return _0x50ebe3;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0x9')](_0xbb10('0xf'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['getHopperFinals']);router[_0xbb10('0x9')]('/:id/hopper_black',auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);router[_0xbb10('0x9')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router['get'](_0xbb10('0x14'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x15')]);router[_0xbb10('0x9')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x9')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller['getLists']);router[_0xbb10('0x9')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0x1c')]);router[_0xbb10('0x1b')](_0xbb10('0x1d'),auth[_0xbb10('0xb')](),controller['clone']);router[_0xbb10('0x1b')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);router[_0xbb10('0x1b')](_0xbb10('0x14'),auth['isAuthenticated'](),controller[_0xbb10('0x1f')]);router[_0xbb10('0x1b')]('/:id/lists',auth['isAuthenticated'](),controller[_0xbb10('0x20')]);router[_0xbb10('0x1b')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x21')]);router[_0xbb10('0x22')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x24')]);router[_0xbb10('0x25')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth[_0xbb10('0xb')](),controller[_0xbb10('0x26')]);router[_0xbb10('0x25')]('/:id/users',auth[_0xbb10('0xb')](),controller[_0xbb10('0x27')]);router[_0xbb10('0x25')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x28')]);router[_0xbb10('0x25')]('/:id/blacklists',auth[_0xbb10('0xb')](),controller[_0xbb10('0x29')]);module[_0xbb10('0x2a')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index d569c4f..24aac35 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 _0x0541=['power','predictive','Dial\x20Method.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#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)','#RecallMe\x20Timeout\x20(min:1)','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','name','ENUM','inbound','outbound','STRING','default','ringall','fewestcalls','random','rrmemory','wrandom','setDataValue','strategy','getDataValue','type','dialMethod','preview','booked','roundrobin','includes','INTEGER','yes','once','TEXT','periodic_announce','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','progressive'];(function(_0x13b677,_0x441ab5){var _0x120a3d=function(_0x36899d){while(--_0x36899d){_0x13b677['push'](_0x13b677['shift']());}};_0x120a3d(++_0x441ab5);}(_0x0541,0x1b2));var _0x1054=function(_0x2fec51,_0x480819){_0x2fec51=_0x2fec51-0x0;var _0x4d2f6f=_0x0541[_0x2fec51];return _0x4d2f6f;};'use strict';var Sequelize=require(_0x1054('0x0'));module[_0x1054('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x1054('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x1054('0x3')](_0x1054('0x4'),_0x1054('0x5')),'allowNull':![],'defaultValue':_0x1054('0x4')},'musiconhold':{'type':Sequelize[_0x1054('0x6')],'defaultValue':_0x1054('0x7')},'announce':{'type':Sequelize[_0x1054('0x6')],'defaultValue':''},'strategy':{'type':Sequelize[_0x1054('0x3')]('rr',_0x1054('0x8'),'leastrecent',_0x1054('0x9'),_0x1054('0xa'),_0x1054('0xb'),'linear',_0x1054('0xc'),'rrordered'),'allowNull':![],'defaultValue':_0x1054('0x8'),'set':function(_0x3b994c){this[_0x1054('0xd')](_0x1054('0xe'),_0x3b994c?_0x3b994c:_0x1054('0xb'));},'get':function(){var _0x36eb07=this[_0x1054('0xf')](_0x1054('0x10'));var _0x1b2847=this[_0x1054('0xf')](_0x1054('0x11'));var _0x480119=this[_0x1054('0xf')](_0x1054('0xe'));if(_0x36eb07===_0x1054('0x5')){if(_0x1b2847===_0x1054('0x12')){return null;}if(_0x1b2847===_0x1054('0x13')&&![_0x1054('0xb'),_0x1054('0x14')][_0x1054('0x15')](_0x480119)){this[_0x1054('0xd')](_0x1054('0xe'),_0x1054('0xb'));}}return _0x480119;}},'servicelevel':{'type':Sequelize[_0x1054('0x16')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x1054('0x6')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x1054('0x16')](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x1054('0x16')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x1054('0x6')]},'weight':{'type':Sequelize[_0x1054('0x16')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x1054('0x16')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x1054('0x3')](_0x1054('0x17'),'no'),'defaultValue':_0x1054('0x17')},'autopause':{'type':Sequelize[_0x1054('0x3')](_0x1054('0x17'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x1054('0x16')](0xb)},'autopausebusy':{'type':Sequelize[_0x1054('0x3')](_0x1054('0x17'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x1054('0x3')](_0x1054('0x17'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x1054('0x3')](_0x1054('0x17'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x1054('0x3')]('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x1054('0x3')](_0x1054('0x17'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x1054('0x3')](_0x1054('0x17'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x1054('0x6')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x1054('0x6')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x1054('0x16')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM'](_0x1054('0x17'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x1054('0x3')](_0x1054('0x17'),'no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize[_0x1054('0x3')](_0x1054('0x17'),'no',_0x1054('0x18')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x1054('0x6')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x1054('0x3')](_0x1054('0x17'),'no')},'announce_position_limit':{'type':Sequelize[_0x1054('0x16')](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x1054('0x6')],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x1054('0x6')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x1054('0x6')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x1054('0x6')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x1054('0x6')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x1054('0x6')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x1054('0x6')],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize[_0x1054('0x6')]},'queue_quantity2':{'type':Sequelize[_0x1054('0x6')]},'queue_periodic_announce':{'type':Sequelize[_0x1054('0x6')]},'queue_less_than':{'type':Sequelize[_0x1054('0x6')]},'periodic_announce':{'type':Sequelize[_0x1054('0x19')],'set':function(_0x570038){this[_0x1054('0xd')](_0x1054('0x1a'),_0x570038?_0x570038['join'](','):[]);},'get':function(){return this[_0x1054('0xf')](_0x1054('0x1a'))?this[_0x1054('0xf')](_0x1054('0x1a'))[_0x1054('0x1b')](','):[];}},'joinempty':{'type':Sequelize[_0x1054('0x6')],'defaultValue':'yes','set':function(_0x5544fd){this[_0x1054('0xd')](_0x1054('0x1c'),_0x5544fd?_0x5544fd['join'](','):undefined);},'get':function(){return this[_0x1054('0xf')]('joinempty')?this[_0x1054('0xf')]('joinempty')['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x1054('0x6')],'defaultValue':'no','set':function(_0x378673){this[_0x1054('0xd')](_0x1054('0x1d'),_0x378673?_0x378673['join'](','):undefined);},'get':function(){return this[_0x1054('0xf')](_0x1054('0x1d'))?this[_0x1054('0xf')](_0x1054('0x1d'))[_0x1054('0x1b')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x1054('0x3')]('yes','no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x1054('0x3')](_0x1054('0x17'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x1054('0x16')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1054('0x6')]},'acw':{'type':Sequelize[_0x1054('0x1e')],'defaultValue':0x0,'set':function(_0x4e82a4){this[_0x1054('0xd')](_0x1054('0x1f'),_0x4e82a4);if(_0x4e82a4){if(this[_0x1054('0xf')](_0x1054('0x20'))<0x2){this[_0x1054('0xd')](_0x1054('0x20'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x1054('0x1e')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0x1054('0x3')](_0x1054('0x12'),_0x1054('0x21'),_0x1054('0x22'),_0x1054('0x23'),_0x1054('0x13')),'defaultValue':'progressive','comment':_0x1054('0x24')},'dialLimitChannel':{'type':Sequelize[_0x1054('0x16')](0x4)[_0x1054('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize[_0x1054('0x16')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x1054('0x26')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0x1054('0x25')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x1054('0x27')},'dialPredictiveOptimization':{'type':Sequelize[_0x1054('0x3')]('agentBusyFactor',_0x1054('0x28')),'defaultValue':'dropRate','comment':_0x1054('0x29')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0x1054('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x1054('0x2a')},'dialPredictiveInterval':{'type':Sequelize[_0x1054('0x16')](0x3)[_0x1054('0x25')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x1054('0x2b')},'dialOriginateCallerIdName':{'type':Sequelize[_0x1054('0x6')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x1054('0x6')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x1054('0x25')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1054('0x2c')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0x1054('0x2d'),'comment':_0x1054('0x2e')},'dialQueueTimeout':{'type':Sequelize[_0x1054('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize[_0x1054('0x6')],'comment':_0x1054('0x2f')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1054('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1054('0x30')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x1054('0x16')](0x5)[_0x1054('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1054('0x31')},'dialBusyMaxRetry':{'type':Sequelize[_0x1054('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1054('0x32')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1054('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1054('0x33')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x1054('0x16')](0x3)[_0x1054('0x25')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x1054('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x1054('0x16')](0x3)[_0x1054('0x25')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x1054('0x34')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x1054('0x6')],'defaultValue':_0x1054('0x35')},'dialPrefix':{'type':Sequelize[_0x1054('0x6')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x1054('0x3')](_0x1054('0x36'),_0x1054('0x37'),_0x1054('0x38')),'defaultValue':_0x1054('0x36')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x1054('0x39')},'dialAMDInitialSilence':{'type':Sequelize[_0x1054('0x16')](0x9)[_0x1054('0x25')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x1054('0x25')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x1054('0x3a')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x1054('0x25')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x1054('0x16')](0x9)[_0x1054('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1054('0x3b')},'dialAMDMinWordLength':{'type':Sequelize[_0x1054('0x16')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x1054('0x3c')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x1054('0x16')](0x9)[_0x1054('0x25')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x1054('0x3d')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x1054('0x16')](0x9)[_0x1054('0x25')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x1054('0x3e')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x1054('0x16')](0x5)[_0x1054('0x25')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x1054('0x3f')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x1054('0x16')](0x9)[_0x1054('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize['INTEGER'](0x5)[_0x1054('0x25')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x1054('0x40')},'dialRecallInQueue':{'type':Sequelize[_0x1054('0x1e')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize[_0x1054('0x3')](_0x1054('0x41'),'ASC'),'defaultValue':_0x1054('0x41')},'dialQueueProject2':{'type':Sequelize[_0x1054('0x6')],'comment':_0x1054('0x2f')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x1054('0x1e')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x1054('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1054('0x42')},'dialCutDigit':{'type':Sequelize[_0x1054('0x16')](0x3)[_0x1054('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1054('0x43')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x1054('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1054('0x44')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x1054('0x16')](0x5)[_0x1054('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x1054('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1054('0x45')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x1054('0x16')](0x3)[_0x1054('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1054('0x46')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x1054('0x16')](0x5)[_0x1054('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1054('0x47')},'dialMachineMaxRetry':{'type':Sequelize[_0x1054('0x16')](0x3)[_0x1054('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1054('0x48')},'dialMachineRetryFrequency':{'type':Sequelize[_0x1054('0x16')](0x5)[_0x1054('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1054('0x49')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1054('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x1054('0x16')](0x5)[_0x1054('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1054('0x4a')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1054('0x16')],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x1054('0x4b'),'set':function(_0x25fe38){if(!_0x25fe38)this[_0x1054('0xd')](_0x1054('0x4c'),null);this[_0x1054('0xd')](_0x1054('0x4d'),_0x25fe38);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x1054('0x16')](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x1054('0x25')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x1054('0x1e')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize['INTEGER'](0x3)[_0x1054('0x25')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x1054('0x1e')],'defaultValue':![]}}; \ No newline at end of file +var _0x0e85=['DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','STRING','name','ENUM','inbound','default','leastrecent','random','rrmemory','linear','wrandom','rrordered','setDataValue','getDataValue','dialMethod','strategy','outbound','booked','roundrobin','includes','INTEGER','yes','TEXT','join','periodic_announce','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','preview','progressive','power','predictive','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','FLOAT','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','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)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length'];(function(_0x486075,_0x5e724b){var _0x2ebaf7=function(_0x2c647a){while(--_0x2c647a){_0x486075['push'](_0x486075['shift']());}};_0x2ebaf7(++_0x5e724b);}(_0x0e85,0xfc));var _0x50e8=function(_0x1b6c6d,_0x2983b0){_0x1b6c6d=_0x1b6c6d-0x0;var _0x290d9d=_0x0e85[_0x1b6c6d];return _0x290d9d;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x50e8('0x0')],'allowNull':![],'unique':_0x50e8('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x50e8('0x2')](_0x50e8('0x3'),'outbound'),'allowNull':![],'defaultValue':_0x50e8('0x3')},'musiconhold':{'type':Sequelize[_0x50e8('0x0')],'defaultValue':_0x50e8('0x4')},'announce':{'type':Sequelize[_0x50e8('0x0')],'defaultValue':''},'strategy':{'type':Sequelize[_0x50e8('0x2')]('rr','ringall',_0x50e8('0x5'),'fewestcalls',_0x50e8('0x6'),_0x50e8('0x7'),_0x50e8('0x8'),_0x50e8('0x9'),_0x50e8('0xa')),'allowNull':![],'defaultValue':'ringall','set':function(_0x26b815){this[_0x50e8('0xb')]('strategy',_0x26b815?_0x26b815:_0x50e8('0x7'));},'get':function(){var _0x2cb6ff=this[_0x50e8('0xc')]('type');var _0x1ec732=this['getDataValue'](_0x50e8('0xd'));var _0x31da71=this[_0x50e8('0xc')](_0x50e8('0xe'));if(_0x2cb6ff===_0x50e8('0xf')){if(_0x1ec732==='preview'){return null;}if(_0x1ec732===_0x50e8('0x10')&&![_0x50e8('0x7'),_0x50e8('0x11')][_0x50e8('0x12')](_0x31da71)){this[_0x50e8('0xb')](_0x50e8('0xe'),_0x50e8('0x7'));}}return _0x31da71;}},'servicelevel':{'type':Sequelize[_0x50e8('0x13')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x50e8('0x0')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x50e8('0x13')](0xb)},'timeout':{'type':Sequelize[_0x50e8('0x13')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x50e8('0x13')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x50e8('0x0')]},'weight':{'type':Sequelize[_0x50e8('0x13')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x50e8('0x13')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x50e8('0x2')](_0x50e8('0x14'),'no'),'defaultValue':_0x50e8('0x14')},'autopause':{'type':Sequelize[_0x50e8('0x2')](_0x50e8('0x14'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize[_0x50e8('0x2')]('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x50e8('0x2')]('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x50e8('0x13')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x50e8('0x2')](_0x50e8('0x14'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x50e8('0x2')](_0x50e8('0x14'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x50e8('0x2')](_0x50e8('0x14'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x50e8('0x2')](_0x50e8('0x14'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x50e8('0x0')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x50e8('0x13')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x50e8('0x13')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x50e8('0x2')](_0x50e8('0x14'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x50e8('0x2')](_0x50e8('0x14'),'no'),'defaultValue':_0x50e8('0x14')},'announce_holdtime':{'type':Sequelize[_0x50e8('0x2')](_0x50e8('0x14'),'no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x50e8('0x2')]('yes','no')},'announce_position_limit':{'type':Sequelize[_0x50e8('0x13')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x50e8('0x2')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x50e8('0x0')]},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x50e8('0x0')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x50e8('0x0')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x50e8('0x0')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x50e8('0x0')]},'queue_quantity1':{'type':Sequelize[_0x50e8('0x0')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize[_0x50e8('0x0')]},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize[_0x50e8('0x15')],'set':function(_0x560591){this[_0x50e8('0xb')]('periodic_announce',_0x560591?_0x560591[_0x50e8('0x16')](','):[]);},'get':function(){return this[_0x50e8('0xc')](_0x50e8('0x17'))?this[_0x50e8('0xc')](_0x50e8('0x17'))[_0x50e8('0x18')](','):[];}},'joinempty':{'type':Sequelize[_0x50e8('0x0')],'defaultValue':_0x50e8('0x14'),'set':function(_0x1feedd){this[_0x50e8('0xb')](_0x50e8('0x19'),_0x1feedd?_0x1feedd[_0x50e8('0x16')](','):undefined);},'get':function(){return this[_0x50e8('0xc')](_0x50e8('0x19'))?this[_0x50e8('0xc')](_0x50e8('0x19'))[_0x50e8('0x18')](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x1b9651){this['setDataValue'](_0x50e8('0x1a'),_0x1b9651?_0x1b9651[_0x50e8('0x16')](','):undefined);},'get':function(){return this[_0x50e8('0xc')](_0x50e8('0x1a'))?this[_0x50e8('0xc')](_0x50e8('0x1a'))[_0x50e8('0x18')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x50e8('0x2')](_0x50e8('0x14'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x50e8('0x2')](_0x50e8('0x14'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x50e8('0x13')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x50e8('0x2')](_0x50e8('0x14'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x50e8('0x0')]},'description':{'type':Sequelize[_0x50e8('0x0')]},'acw':{'type':Sequelize[_0x50e8('0x1b')],'defaultValue':0x0,'set':function(_0x42ab96){this['setDataValue'](_0x50e8('0x1c'),_0x42ab96);if(_0x42ab96){if(this[_0x50e8('0xc')](_0x50e8('0x1d'))<0x2){this[_0x50e8('0xb')](_0x50e8('0x1d'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x50e8('0x13')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x50e8('0x1b')],'defaultValue':0x0,'comment':_0x50e8('0x1e')},'dialMethod':{'type':Sequelize[_0x50e8('0x2')](_0x50e8('0x1f'),_0x50e8('0x20'),_0x50e8('0x21'),_0x50e8('0x22'),_0x50e8('0x10')),'defaultValue':_0x50e8('0x20'),'comment':_0x50e8('0x23')},'dialLimitChannel':{'type':Sequelize[_0x50e8('0x13')](0x4)[_0x50e8('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x50e8('0x25')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0x50e8('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x50e8('0x26')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0x50e8('0x24')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize[_0x50e8('0x2')](_0x50e8('0x27'),_0x50e8('0x28')),'defaultValue':_0x50e8('0x28'),'comment':_0x50e8('0x29')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x50e8('0x2a')](0x2)[_0x50e8('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x50e8('0x2b')},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)[_0x50e8('0x24')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x50e8('0x2c')},'dialOriginateCallerIdName':{'type':Sequelize[_0x50e8('0x0')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x50e8('0x0')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x50e8('0x2d')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':'tTxX','comment':_0x50e8('0x2e')},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x50e8('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x50e8('0x2f')},'dialQueueProject':{'type':Sequelize['STRING'],'comment':_0x50e8('0x30')},'dialCongestionMaxRetry':{'type':Sequelize[_0x50e8('0x13')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x50e8('0x31')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x50e8('0x13')](0x5)[_0x50e8('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x50e8('0x32')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x50e8('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x50e8('0x13')](0x5)[_0x50e8('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x50e8('0x33')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x50e8('0x13')](0x3)[_0x50e8('0x24')],'defaultValue':0x3,'comment':_0x50e8('0x34')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x50e8('0x13')](0x5)[_0x50e8('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x50e8('0x35')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x50e8('0x24')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x50e8('0x36')},'dialTimezone':{'type':Sequelize[_0x50e8('0x0')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x50e8('0x0')],'defaultValue':_0x50e8('0x37')},'dialPrefix':{'type':Sequelize[_0x50e8('0x0')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x50e8('0x2')]('always','never',_0x50e8('0x38')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x50e8('0x1b')],'defaultValue':0x0,'comment':_0x50e8('0x39')},'dialAMDInitialSilence':{'type':Sequelize[_0x50e8('0x13')](0x9)[_0x50e8('0x24')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x50e8('0x3a')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x50e8('0x3b')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x50e8('0x13')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x50e8('0x13')](0x9)[_0x50e8('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x50e8('0x13')](0x9)[_0x50e8('0x24')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x50e8('0x3c')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x50e8('0x3d')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x50e8('0x13')](0x9)[_0x50e8('0x24')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x50e8('0x3e')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x50e8('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x50e8('0x13')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x50e8('0x3f')},'dialRecallMeTimeout':{'type':Sequelize[_0x50e8('0x13')](0x5)[_0x50e8('0x24')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0x50e8('0x1b')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize[_0x50e8('0x2')](_0x50e8('0x40'),_0x50e8('0x41')),'defaultValue':_0x50e8('0x40')},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':_0x50e8('0x30')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x50e8('0x1b')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x50e8('0x1b')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x50e8('0x13')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x50e8('0x42')},'dialCutDigit':{'type':Sequelize[_0x50e8('0x13')](0x3)[_0x50e8('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x50e8('0x43')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x50e8('0x13')](0x3)[_0x50e8('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x50e8('0x44')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x50e8('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x50e8('0x13')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x50e8('0x45')},'dialDropRetryFrequency':{'type':Sequelize[_0x50e8('0x13')](0x5)[_0x50e8('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x50e8('0x46')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x50e8('0x13')](0x3)[_0x50e8('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x50e8('0x47')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x50e8('0x13')](0x5)[_0x50e8('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x50e8('0x13')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x50e8('0x48')},'dialMachineRetryFrequency':{'type':Sequelize[_0x50e8('0x13')](0x5)[_0x50e8('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x50e8('0x49')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x50e8('0x13')](0x3)[_0x50e8('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x50e8('0x4a')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x50e8('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x50e8('0x4b')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x50e8('0x13')],'allowNull':!![],'comment':_0x50e8('0x4c')},'mandatoryDisposition':{'type':Sequelize[_0x50e8('0x1b')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x301ab7){if(!_0x301ab7)this[_0x50e8('0xb')](_0x50e8('0x4d'),null);this[_0x50e8('0xb')](_0x50e8('0x4e'),_0x301ab7);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x50e8('0x13')](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x50e8('0x13')](0x3)[_0x50e8('0x24')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x50e8('0x13')](0x3)[_0x50e8('0x24')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x50e8('0x1b')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 764cde8..9604c67 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 _0x6aa7=['ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','deletedAt\x20IS\x20NULL','cm_hopper_additional_phones','CmHopperId','OrderBy','ci.item','ci.OrderBy+1','cm_contact_has_items','h.ContactId=ci.CmContactId','h.scheduledat=?','ci.ItemClass=?','PHONE','getBlackLists','CmList','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','moment','util','lodash','squel','ioredis','../../config/logger','api','../../config/environment','defaults','localhost','socket.io-emitter','redis','register','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','update','then','get','VoiceQueues','inbound','QueueCampaigns','outbound','ignore','map','value','includes','type','find','name','UserProfileResource','destroy','error','stack','index','VoiceQueue','rawAttributes','fieldName','getOptions','where','include','rows','show','model','keys','query','attributes','intersection','fields','length','includeAll','merge','options','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','updatedAt','createdAt','getHoppers','findOne','filters','nolimit','order','sort','pick','VoiceQueueId','filter','CmHopper','findAll','getHopperHistories','CmHopperHistory','CmHopperFinal','hasOwnProperty','CmHopperBlack','getTeams','Team','addTeams','teams','User','online','voicePause','interface','flatMap','forEach','penalty','Agents','sequelize','transaction','each','TeamVoiceQueue','upsert','findOrCreate','UserVoiceQueueRt','isNil','format','SIP/%s','emit','userVoiceQueue:save','removeTeams','ids','field','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','SELECT','every','TeamId','compact','isEmpty','removeAgents','addAgents','spread','all','isArray','userVoiceQueue:remove','getAgents','getMembers','getLists','addLists','YYYY-MM-DD\x20HH:mm:ss','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','toString','cm_contacts','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','select'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x6aa7,0x178));var _0x76aa=function(_0x1e8f51,_0x57b3f6){_0x1e8f51=_0x1e8f51-0x0;var _0xdf7928=_0x6aa7[_0x1e8f51];return _0xdf7928;};'use strict';var moment=require(_0x76aa('0x0'));var BPromise=require('bluebird');var util=require(_0x76aa('0x1'));var _=require(_0x76aa('0x2'));var squel=require(_0x76aa('0x3'));var Redis=require(_0x76aa('0x4'));var qs=require('../../components/parsers/qs');var logger=require(_0x76aa('0x5'))(_0x76aa('0x6'));var config=require(_0x76aa('0x7'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x76aa('0x8')](config['redis'],{'host':_0x76aa('0x9'),'port':0x18eb});var socket=require(_0x76aa('0xa'))(new Redis(config[_0x76aa('0xb')]));require('./voiceQueue.socket')[_0x76aa('0xc')](socket);function respondWithStatusCode(_0x266bd5,_0x3a3f36){_0x3a3f36=_0x3a3f36||0xcc;return function(_0x557d69){if(_0x557d69){return _0x266bd5[_0x76aa('0xd')](_0x3a3f36);}return _0x266bd5[_0x76aa('0xe')](_0x3a3f36)[_0x76aa('0xf')]();};}function respondWithResult(_0x16cb50,_0x37f1ab){_0x37f1ab=_0x37f1ab||0xc8;return function(_0x128435){if(_0x128435){return _0x16cb50[_0x76aa('0xe')](_0x37f1ab)[_0x76aa('0x10')](_0x128435);}};}function respondWithFilteredResult(_0xd6327,_0x17a417){return function(_0x5e5f47){if(_0x5e5f47){var _0x112c39=typeof _0x17a417['offset']===_0x76aa('0x11')&&typeof _0x17a417[_0x76aa('0x12')]===_0x76aa('0x11');var _0x8e44ed=_0x5e5f47[_0x76aa('0x13')];var _0x4e309f=_0x112c39?0x0:_0x17a417['offset'];var _0x2b3b4f=_0x112c39?_0x5e5f47['count']:_0x17a417[_0x76aa('0x14')]+_0x17a417[_0x76aa('0x12')];var _0x5cf594;if(_0x2b3b4f>=_0x8e44ed){_0x2b3b4f=_0x8e44ed;_0x5cf594=0xc8;}else{_0x5cf594=0xce;}_0xd6327[_0x76aa('0xe')](_0x5cf594);return _0xd6327['set'](_0x76aa('0x15'),_0x4e309f+'-'+_0x2b3b4f+'/'+_0x8e44ed)['json'](_0x5e5f47);}return null;};}function saveUpdates(_0x1515e9){return function(_0x413cf6){if(_0x413cf6){return _0x413cf6[_0x76aa('0x16')](_0x1515e9)[_0x76aa('0x17')](function(_0xa1bc7){return _0xa1bc7;});}return null;};}function removeEntity(_0x3ead3f){return function(_0x496902){if(_0x496902){return _0x496902['destroy']()[_0x76aa('0x17')](function(){var _0x454dd3=_0x496902[_0x76aa('0x18')]({'plain':!![]});var _0x15b931=[{'name':_0x76aa('0x19'),'value':_0x76aa('0x1a'),'ignore':![]},{'name':_0x76aa('0x1b'),'value':_0x76aa('0x1c'),'ignore':![]}];var _0x385157=_(_0x15b931)['filter'](_0x76aa('0x1d'))[_0x76aa('0x1e')](_0x76aa('0x1f'))['value']();if(_[_0x76aa('0x20')](_0x385157,_0x454dd3[_0x76aa('0x21')])){return;}var _0x31252f=_[_0x76aa('0x22')](_0x15b931,[_0x76aa('0x1f'),_0x454dd3[_0x76aa('0x21')]])[_0x76aa('0x23')];return db[_0x76aa('0x24')][_0x76aa('0x25')]({'where':{'type':_0x31252f,'resourceId':_0x454dd3['id']}})[_0x76aa('0x17')](function(){return _0x496902;});})[_0x76aa('0x17')](function(){_0x3ead3f[_0x76aa('0xe')](0xcc)[_0x76aa('0xf')]();});}};}function handleEntityNotFound(_0x4ef9b0){return function(_0xb5e8a9){if(!_0xb5e8a9){_0x4ef9b0[_0x76aa('0xd')](0x194);}return _0xb5e8a9;};}function handleError(_0x25c614,_0x2e7ab4){_0x2e7ab4=_0x2e7ab4||0x1f4;return function(_0xa1e6){logger[_0x76aa('0x26')](_0xa1e6[_0x76aa('0x27')]);if(_0xa1e6[_0x76aa('0x23')]){delete _0xa1e6[_0x76aa('0x23')];}_0x25c614[_0x76aa('0xe')](_0x2e7ab4)['send'](_0xa1e6);};}exports[_0x76aa('0x28')]=function(_0x5a8030,_0x994550){var _0x365ff8={};var _0x2dec94={'count':0x0,'rows':[]};var _0x1e90b9=_[_0x76aa('0x1e')](db[_0x76aa('0x29')][_0x76aa('0x2a')],function(_0x3827ec){return{'name':_0x3827ec[_0x76aa('0x2b')],'type':_0x3827ec[_0x76aa('0x21')]['key']};});_0x365ff8=qs[_0x76aa('0x2c')](_0x1e90b9,_0x5a8030);var _0x5532c7={'where':_0x365ff8[_0x76aa('0x2d')]};return db[_0x76aa('0x29')][_0x76aa('0x13')](_0x5532c7)[_0x76aa('0x17')](function(_0x35a705){_0x2dec94['count']=_0x35a705;_0x365ff8[_0x76aa('0x2e')]=qs[_0x76aa('0x2e')](_0x5a8030['query']);return db[_0x76aa('0x29')]['findAll'](_0x365ff8);})[_0x76aa('0x17')](function(_0x4c90b6){_0x2dec94[_0x76aa('0x2f')]=_0x4c90b6;return _0x2dec94;})['then'](respondWithFilteredResult(_0x994550,_0x365ff8))['catch'](handleError(_0x994550,null));};exports[_0x76aa('0x30')]=function(_0x282c56,_0x198fcb){var _0x37dfab={'raw':![],'where':{'id':_0x282c56['params']['id']}},_0x595a0f={};_0x595a0f[_0x76aa('0x31')]=_[_0x76aa('0x32')](db[_0x76aa('0x29')][_0x76aa('0x2a')]);_0x595a0f[_0x76aa('0x33')]=_['keys'](_0x282c56[_0x76aa('0x33')]);_0x595a0f['filters']=_['intersection'](_0x595a0f[_0x76aa('0x31')],_0x595a0f[_0x76aa('0x33')]);_0x37dfab[_0x76aa('0x34')]=_[_0x76aa('0x35')](_0x595a0f['model'],qs[_0x76aa('0x36')](_0x282c56[_0x76aa('0x33')][_0x76aa('0x36')]));_0x37dfab['attributes']=_0x37dfab[_0x76aa('0x34')][_0x76aa('0x37')]?_0x37dfab[_0x76aa('0x34')]:_0x595a0f[_0x76aa('0x31')];if(_0x282c56[_0x76aa('0x33')][_0x76aa('0x38')]){_0x37dfab[_0x76aa('0x2e')]=[{'all':!![]}];}_0x37dfab=_[_0x76aa('0x39')]({},_0x37dfab,_0x282c56[_0x76aa('0x3a')]);return db['VoiceQueue'][_0x76aa('0x22')](_0x37dfab)[_0x76aa('0x17')](handleEntityNotFound(_0x198fcb,null))[_0x76aa('0x17')](respondWithResult(_0x198fcb,null))[_0x76aa('0x3b')](handleError(_0x198fcb,null));};exports[_0x76aa('0x3c')]=function(_0x2957aa,_0x572fdb){return db['VoiceQueue'][_0x76aa('0x3c')](_0x2957aa[_0x76aa('0x3d')],{})[_0x76aa('0x17')](function(_0x365612){var _0x50599f=_0x2957aa[_0x76aa('0x3e')][_0x76aa('0x18')]({'plain':!![]});if(!_0x50599f)throw new Error(_0x76aa('0x3f'));if(_0x50599f[_0x76aa('0x40')]===_0x76aa('0x3e')){var _0x4aa2f3=_0x365612[_0x76aa('0x18')]({'plain':!![]});var _0x556f59=[{'name':_0x76aa('0x19'),'value':'inbound'},{'name':'QueueCampaigns','value':'outbound'}];var _0x144f0a=_['find'](_0x556f59,['value',_0x4aa2f3['type']])[_0x76aa('0x23')];return db[_0x76aa('0x41')][_0x76aa('0x22')]({'where':{'name':_0x144f0a,'userProfileId':_0x50599f[_0x76aa('0x42')]},'raw':!![]})[_0x76aa('0x17')](function(_0x47b0c8){if(_0x47b0c8&&_0x47b0c8[_0x76aa('0x43')]===0x0){return db[_0x76aa('0x24')][_0x76aa('0x3c')]({'name':_0x4aa2f3[_0x76aa('0x23')],'resourceId':_0x4aa2f3['id'],'type':_0x47b0c8[_0x76aa('0x23')],'sectionId':_0x47b0c8['id']},{})['then'](function(){return _0x365612;});}else{return _0x365612;}})[_0x76aa('0x3b')](function(_0x1c62a9){logger['error'](_0x76aa('0x44'),_0x1c62a9);throw _0x1c62a9;});}return _0x365612;})['then'](respondWithResult(_0x572fdb,0xc9))[_0x76aa('0x3b')](handleError(_0x572fdb,null));};exports[_0x76aa('0x45')]=function(_0x31930b,_0x18fd3e){var _0x2d0bc4={'where':{'id':_0x31930b[_0x76aa('0x46')]['id']}},_0x3e0315={};_0x3e0315[_0x76aa('0x31')]=_[_0x76aa('0x32')](db[_0x76aa('0x29')]['rawAttributes']);_0x2d0bc4[_0x76aa('0x34')]=_['intersection'](_0x3e0315[_0x76aa('0x31')],qs[_0x76aa('0x36')](_0x31930b[_0x76aa('0x33')][_0x76aa('0x36')]));_0x2d0bc4['attributes']=_0x2d0bc4['attributes'][_0x76aa('0x37')]?_0x2d0bc4['attributes']:_0x3e0315[_0x76aa('0x31')];if(_0x31930b[_0x76aa('0x33')][_0x76aa('0x38')]){_0x2d0bc4[_0x76aa('0x2e')]=[{'all':!![]}];}_0x2d0bc4=_[_0x76aa('0x39')]({},_0x2d0bc4,_0x31930b[_0x76aa('0x3a')]);return db['VoiceQueue']['find'](_0x2d0bc4)[_0x76aa('0x17')](handleEntityNotFound(_0x18fd3e,null))[_0x76aa('0x17')](function(_0x1708d4){if(_0x1708d4){var _0x40e8ff=_0x1708d4[_0x76aa('0x18')]({'plain':!![]});_0x40e8ff=qs[_0x76aa('0x47')](_0x40e8ff,['id','createdAt',_0x76aa('0x48')]);_0x31930b[_0x76aa('0x3d')]=_[_0x76aa('0x47')](_0x31930b['body'],['id',_0x76aa('0x49'),'updatedAt']);return db[_0x76aa('0x29')]['create'](_[_0x76aa('0x39')](_0x40e8ff,_0x31930b[_0x76aa('0x3d')]),{'include':_0x31930b[_0x76aa('0x33')][_0x76aa('0x38')]?[{'all':!![]}]:undefined})[_0x76aa('0x17')](function(_0x316de3){var _0x953726=_0x31930b['user'][_0x76aa('0x18')]({'plain':!![]});if(!_0x953726)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x953726[_0x76aa('0x40')]===_0x76aa('0x3e')){var _0x288151=_0x316de3[_0x76aa('0x18')]({'plain':!![]});var _0x3fa7ec=[{'name':_0x76aa('0x19'),'value':_0x76aa('0x1a')},{'name':'QueueCampaigns','value':_0x76aa('0x1c')}];var _0x281f73=_[_0x76aa('0x22')](_0x3fa7ec,[_0x76aa('0x1f'),_0x288151['type']])[_0x76aa('0x23')];return db[_0x76aa('0x41')][_0x76aa('0x22')]({'where':{'name':_0x281f73,'userProfileId':_0x953726[_0x76aa('0x42')]},'raw':!![]})[_0x76aa('0x17')](function(_0xf7732){if(_0xf7732&&_0xf7732['autoAssociation']===0x0){return db[_0x76aa('0x24')][_0x76aa('0x3c')]({'name':_0x288151[_0x76aa('0x23')],'resourceId':_0x288151['id'],'type':_0xf7732[_0x76aa('0x23')],'sectionId':_0xf7732['id']},{})[_0x76aa('0x17')](function(){return _0x316de3;});}else{return _0x316de3;}})[_0x76aa('0x3b')](function(_0x37babe){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x37babe);throw _0x37babe;});}return _0x316de3;});}})[_0x76aa('0x17')](respondWithResult(_0x18fd3e,0xc9))[_0x76aa('0x3b')](handleError(_0x18fd3e,null));};exports['update']=function(_0x3d7802,_0x1e6f3c){if(_0x3d7802['body']['id']){delete _0x3d7802[_0x76aa('0x3d')]['id'];}return db[_0x76aa('0x29')][_0x76aa('0x22')]({'where':{'id':_0x3d7802[_0x76aa('0x46')]['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x1e6f3c,null))[_0x76aa('0x17')](saveUpdates(_0x3d7802[_0x76aa('0x3d')],null))[_0x76aa('0x17')](respondWithResult(_0x1e6f3c,null))[_0x76aa('0x3b')](handleError(_0x1e6f3c,null));};exports['destroy']=function(_0xd337f0,_0x49156c){return db[_0x76aa('0x29')][_0x76aa('0x22')]({'where':{'id':_0xd337f0[_0x76aa('0x46')]['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x49156c,null))[_0x76aa('0x17')](removeEntity(_0x49156c,null))[_0x76aa('0x3b')](handleError(_0x49156c,null));};exports[_0x76aa('0x4a')]=function(_0x431d1c,_0x2f1263){var _0x5eceba={'raw':![],'where':{}};var _0x267fcf={};var _0x3d4025={'count':0x0,'rows':[]};return db[_0x76aa('0x29')][_0x76aa('0x4b')]({'where':{'id':_0x431d1c[_0x76aa('0x46')]['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x2f1263,null))[_0x76aa('0x17')](function(_0x157540){if(_0x157540){_0x267fcf['model']=_[_0x76aa('0x32')](db['CmHopper'][_0x76aa('0x2a')]);_0x267fcf[_0x76aa('0x33')]=_[_0x76aa('0x32')](_0x431d1c[_0x76aa('0x33')]);_0x267fcf[_0x76aa('0x4c')]=_[_0x76aa('0x35')](_0x267fcf[_0x76aa('0x31')],_0x267fcf['query']);_0x5eceba[_0x76aa('0x34')]=_[_0x76aa('0x35')](_0x267fcf['model'],qs['fields'](_0x431d1c[_0x76aa('0x33')][_0x76aa('0x36')]));_0x5eceba['attributes']=_0x5eceba[_0x76aa('0x34')][_0x76aa('0x37')]?_0x5eceba[_0x76aa('0x34')]:_0x267fcf['model'];if(!_0x431d1c[_0x76aa('0x33')]['hasOwnProperty'](_0x76aa('0x4d'))){_0x5eceba[_0x76aa('0x12')]=qs[_0x76aa('0x12')](_0x431d1c[_0x76aa('0x33')]['limit']);_0x5eceba['offset']=qs[_0x76aa('0x14')](_0x431d1c['query'][_0x76aa('0x14')]);}_0x5eceba[_0x76aa('0x4e')]=qs[_0x76aa('0x4f')](_0x431d1c[_0x76aa('0x33')][_0x76aa('0x4f')]);_0x5eceba[_0x76aa('0x2d')]=qs[_0x76aa('0x4c')](_[_0x76aa('0x50')](_0x431d1c[_0x76aa('0x33')],_0x267fcf['filters']));_0x5eceba[_0x76aa('0x2d')][_0x76aa('0x51')]=_0x157540['id'];if(_0x431d1c[_0x76aa('0x33')][_0x76aa('0x52')]){_0x5eceba['where']=_['merge'](_0x5eceba['where'],{'$or':_[_0x76aa('0x1e')](_0x5eceba['attributes'],function(_0xb61e5){var _0x256195={};_0x256195[_0xb61e5]={'$like':'%'+_0x431d1c[_0x76aa('0x33')][_0x76aa('0x52')]+'%'};return _0x256195;})});}_0x5eceba=_['merge']({},_0x5eceba,_0x431d1c[_0x76aa('0x3a')]);return db['CmHopper'][_0x76aa('0x13')]({'where':_0x5eceba[_0x76aa('0x2d')]})[_0x76aa('0x17')](function(_0x11d602){_0x3d4025[_0x76aa('0x13')]=_0x11d602;if(_0x431d1c['query'][_0x76aa('0x38')]){_0x5eceba[_0x76aa('0x2e')]=[{'all':!![]}];}return db[_0x76aa('0x53')][_0x76aa('0x54')](_0x5eceba);})[_0x76aa('0x17')](function(_0x22432d){_0x3d4025[_0x76aa('0x2f')]=_0x22432d;return _0x3d4025;});}})[_0x76aa('0x17')](respondWithFilteredResult(_0x2f1263,_0x5eceba))['catch'](handleError(_0x2f1263,null));};exports[_0x76aa('0x55')]=function(_0x381f44,_0x48136a){var _0x3c1b98={'raw':!![],'where':{}};var _0x215463={};var _0x325487={'count':0x0,'rows':[]};return db[_0x76aa('0x29')][_0x76aa('0x4b')]({'where':{'id':_0x381f44[_0x76aa('0x46')]['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x48136a,null))['then'](function(_0xdb821b){if(_0xdb821b){_0x215463['model']=_['keys'](db[_0x76aa('0x56')][_0x76aa('0x2a')]);_0x215463['query']=_['keys'](_0x381f44[_0x76aa('0x33')]);_0x215463[_0x76aa('0x4c')]=_[_0x76aa('0x35')](_0x215463['model'],_0x215463['query']);_0x3c1b98[_0x76aa('0x34')]=_[_0x76aa('0x35')](_0x215463[_0x76aa('0x31')],qs['fields'](_0x381f44[_0x76aa('0x33')]['fields']));_0x3c1b98[_0x76aa('0x34')]=_0x3c1b98[_0x76aa('0x34')][_0x76aa('0x37')]?_0x3c1b98[_0x76aa('0x34')]:_0x215463[_0x76aa('0x31')];if(!_0x381f44['query']['hasOwnProperty'](_0x76aa('0x4d'))){_0x3c1b98[_0x76aa('0x12')]=qs[_0x76aa('0x12')](_0x381f44['query'][_0x76aa('0x12')]);_0x3c1b98[_0x76aa('0x14')]=qs[_0x76aa('0x14')](_0x381f44[_0x76aa('0x33')][_0x76aa('0x14')]);}_0x3c1b98['order']=qs[_0x76aa('0x4f')](_0x381f44['query'][_0x76aa('0x4f')]);_0x3c1b98[_0x76aa('0x2d')]=qs[_0x76aa('0x4c')](_[_0x76aa('0x50')](_0x381f44[_0x76aa('0x33')],_0x215463[_0x76aa('0x4c')]));_0x3c1b98['where']['VoiceQueueId']=_0xdb821b['id'];if(_0x381f44['query']['filter']){_0x3c1b98['where']=_[_0x76aa('0x39')](_0x3c1b98[_0x76aa('0x2d')],{'$or':_['map'](_0x3c1b98['attributes'],function(_0x4f01e9){var _0x3a6326={};_0x3a6326[_0x4f01e9]={'$like':'%'+_0x381f44[_0x76aa('0x33')][_0x76aa('0x52')]+'%'};return _0x3a6326;})});}_0x3c1b98=_['merge']({},_0x3c1b98,_0x381f44['options']);return db[_0x76aa('0x56')][_0x76aa('0x13')]({'where':_0x3c1b98[_0x76aa('0x2d')]})[_0x76aa('0x17')](function(_0x354c7b){_0x325487['count']=_0x354c7b;if(_0x381f44['query'][_0x76aa('0x38')]){_0x3c1b98['include']=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x3c1b98);})[_0x76aa('0x17')](function(_0xbb1ccd){_0x325487['rows']=_0xbb1ccd;return _0x325487;});}})[_0x76aa('0x17')](respondWithFilteredResult(_0x48136a,_0x3c1b98))[_0x76aa('0x3b')](handleError(_0x48136a,null));};exports['getHopperFinals']=function(_0x22063f,_0x24331a){var _0x11d91f={'raw':!![],'where':{}};var _0x258e5a={};var _0x1fa86b={'count':0x0,'rows':[]};return db[_0x76aa('0x29')][_0x76aa('0x4b')]({'where':{'id':_0x22063f[_0x76aa('0x46')]['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x24331a,null))['then'](function(_0x84bc91){if(_0x84bc91){_0x258e5a[_0x76aa('0x31')]=_['keys'](db[_0x76aa('0x57')][_0x76aa('0x2a')]);_0x258e5a[_0x76aa('0x33')]=_['keys'](_0x22063f[_0x76aa('0x33')]);_0x258e5a[_0x76aa('0x4c')]=_['intersection'](_0x258e5a[_0x76aa('0x31')],_0x258e5a[_0x76aa('0x33')]);_0x11d91f[_0x76aa('0x34')]=_['intersection'](_0x258e5a[_0x76aa('0x31')],qs[_0x76aa('0x36')](_0x22063f['query']['fields']));_0x11d91f['attributes']=_0x11d91f[_0x76aa('0x34')][_0x76aa('0x37')]?_0x11d91f[_0x76aa('0x34')]:_0x258e5a[_0x76aa('0x31')];if(!_0x22063f['query']['hasOwnProperty']('nolimit')){_0x11d91f[_0x76aa('0x12')]=qs['limit'](_0x22063f[_0x76aa('0x33')][_0x76aa('0x12')]);_0x11d91f['offset']=qs[_0x76aa('0x14')](_0x22063f[_0x76aa('0x33')]['offset']);}_0x11d91f[_0x76aa('0x4e')]=qs[_0x76aa('0x4f')](_0x22063f[_0x76aa('0x33')][_0x76aa('0x4f')]);_0x11d91f[_0x76aa('0x2d')]=qs[_0x76aa('0x4c')](_['pick'](_0x22063f[_0x76aa('0x33')],_0x258e5a['filters']));_0x11d91f['where']['VoiceQueueId']=_0x84bc91['id'];if(_0x22063f['query']['filter']){_0x11d91f[_0x76aa('0x2d')]=_[_0x76aa('0x39')](_0x11d91f[_0x76aa('0x2d')],{'$or':_[_0x76aa('0x1e')](_0x11d91f['attributes'],function(_0x447103){var _0x2192ed={};_0x2192ed[_0x447103]={'$like':'%'+_0x22063f[_0x76aa('0x33')][_0x76aa('0x52')]+'%'};return _0x2192ed;})});}_0x11d91f=_[_0x76aa('0x39')]({},_0x11d91f,_0x22063f['options']);return db[_0x76aa('0x57')][_0x76aa('0x13')]({'where':_0x11d91f[_0x76aa('0x2d')]})[_0x76aa('0x17')](function(_0x13be70){_0x1fa86b[_0x76aa('0x13')]=_0x13be70;if(_0x22063f[_0x76aa('0x33')]['includeAll']){_0x11d91f[_0x76aa('0x2e')]=[{'all':!![]}];}return db[_0x76aa('0x57')]['findAll'](_0x11d91f);})['then'](function(_0x216e87){_0x1fa86b[_0x76aa('0x2f')]=_0x216e87;return _0x1fa86b;});}})['then'](respondWithFilteredResult(_0x24331a,_0x11d91f))[_0x76aa('0x3b')](handleError(_0x24331a,null));};exports['getHopperBlacks']=function(_0x28ec11,_0x5cc005){var _0x28b439={'raw':!![],'where':{}};var _0x583924={};var _0x45227e={'count':0x0,'rows':[]};return db[_0x76aa('0x29')][_0x76aa('0x4b')]({'where':{'id':_0x28ec11['params']['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x5cc005,null))['then'](function(_0x1af32e){if(_0x1af32e){_0x583924[_0x76aa('0x31')]=_['keys'](db['CmHopperBlack'][_0x76aa('0x2a')]);_0x583924[_0x76aa('0x33')]=_[_0x76aa('0x32')](_0x28ec11[_0x76aa('0x33')]);_0x583924['filters']=_['intersection'](_0x583924[_0x76aa('0x31')],_0x583924['query']);_0x28b439[_0x76aa('0x34')]=_['intersection'](_0x583924[_0x76aa('0x31')],qs[_0x76aa('0x36')](_0x28ec11['query'][_0x76aa('0x36')]));_0x28b439['attributes']=_0x28b439['attributes'][_0x76aa('0x37')]?_0x28b439[_0x76aa('0x34')]:_0x583924['model'];if(!_0x28ec11[_0x76aa('0x33')][_0x76aa('0x58')](_0x76aa('0x4d'))){_0x28b439['limit']=qs[_0x76aa('0x12')](_0x28ec11[_0x76aa('0x33')][_0x76aa('0x12')]);_0x28b439[_0x76aa('0x14')]=qs[_0x76aa('0x14')](_0x28ec11[_0x76aa('0x33')][_0x76aa('0x14')]);}_0x28b439[_0x76aa('0x4e')]=qs[_0x76aa('0x4f')](_0x28ec11[_0x76aa('0x33')][_0x76aa('0x4f')]);_0x28b439[_0x76aa('0x2d')]=qs['filters'](_[_0x76aa('0x50')](_0x28ec11[_0x76aa('0x33')],_0x583924['filters']));_0x28b439[_0x76aa('0x2d')][_0x76aa('0x51')]=_0x1af32e['id'];if(_0x28ec11['query']['filter']){_0x28b439[_0x76aa('0x2d')]=_[_0x76aa('0x39')](_0x28b439['where'],{'$or':_[_0x76aa('0x1e')](_0x28b439[_0x76aa('0x34')],function(_0x24af48){var _0x5010c8={};_0x5010c8[_0x24af48]={'$like':'%'+_0x28ec11[_0x76aa('0x33')][_0x76aa('0x52')]+'%'};return _0x5010c8;})});}_0x28b439=_['merge']({},_0x28b439,_0x28ec11[_0x76aa('0x3a')]);return db[_0x76aa('0x59')][_0x76aa('0x13')]({'where':_0x28b439[_0x76aa('0x2d')]})[_0x76aa('0x17')](function(_0x42543c){_0x45227e['count']=_0x42543c;if(_0x28ec11[_0x76aa('0x33')]['includeAll']){_0x28b439[_0x76aa('0x2e')]=[{'all':!![]}];}return db[_0x76aa('0x59')][_0x76aa('0x54')](_0x28b439);})['then'](function(_0x4c5f54){_0x45227e[_0x76aa('0x2f')]=_0x4c5f54;return _0x45227e;});}})[_0x76aa('0x17')](respondWithFilteredResult(_0x5cc005,_0x28b439))[_0x76aa('0x3b')](handleError(_0x5cc005,null));};exports[_0x76aa('0x5a')]=function(_0x1a81fd,_0x1eb8f2){var _0x4f7dd4={};var _0x5a4c03={};var _0x2565a2;var _0x109bd3;return db[_0x76aa('0x29')][_0x76aa('0x4b')]({'where':{'id':_0x1a81fd['params']['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x1eb8f2,null))['then'](function(_0x54d530){if(_0x54d530){_0x2565a2=_0x54d530;_0x5a4c03[_0x76aa('0x31')]=_[_0x76aa('0x32')](db[_0x76aa('0x5b')]['rawAttributes']);_0x5a4c03[_0x76aa('0x33')]=_[_0x76aa('0x32')](_0x1a81fd[_0x76aa('0x33')]);_0x5a4c03[_0x76aa('0x4c')]=_[_0x76aa('0x35')](_0x5a4c03[_0x76aa('0x31')],_0x5a4c03[_0x76aa('0x33')]);_0x4f7dd4['attributes']=_[_0x76aa('0x35')](_0x5a4c03[_0x76aa('0x31')],qs[_0x76aa('0x36')](_0x1a81fd[_0x76aa('0x33')][_0x76aa('0x36')]));_0x4f7dd4[_0x76aa('0x34')]=_0x4f7dd4['attributes'][_0x76aa('0x37')]?_0x4f7dd4[_0x76aa('0x34')]:_0x5a4c03[_0x76aa('0x31')];_0x4f7dd4[_0x76aa('0x4e')]=qs['sort'](_0x1a81fd[_0x76aa('0x33')][_0x76aa('0x4f')]);_0x4f7dd4[_0x76aa('0x2d')]=qs[_0x76aa('0x4c')](_[_0x76aa('0x50')](_0x1a81fd['query'],_0x5a4c03[_0x76aa('0x4c')]));if(_0x1a81fd[_0x76aa('0x33')]['filter']){_0x4f7dd4['where']=_[_0x76aa('0x39')](_0x4f7dd4[_0x76aa('0x2d')],{'$or':_[_0x76aa('0x1e')](_0x4f7dd4[_0x76aa('0x34')],function(_0x46f098){var _0x293221={};_0x293221[_0x46f098]={'$like':'%'+_0x1a81fd['query'][_0x76aa('0x52')]+'%'};return _0x293221;})});}_0x4f7dd4=_[_0x76aa('0x39')]({},_0x4f7dd4,_0x1a81fd[_0x76aa('0x3a')]);return _0x2565a2[_0x76aa('0x5a')](_0x4f7dd4);}})[_0x76aa('0x17')](function(_0x2e7bb7){if(_0x2e7bb7){_0x109bd3=_0x2e7bb7['length'];if(!_0x1a81fd[_0x76aa('0x33')][_0x76aa('0x58')](_0x76aa('0x4d'))){_0x4f7dd4[_0x76aa('0x12')]=qs[_0x76aa('0x12')](_0x1a81fd[_0x76aa('0x33')]['limit']);_0x4f7dd4[_0x76aa('0x14')]=qs['offset'](_0x1a81fd[_0x76aa('0x33')]['offset']);}return _0x2565a2[_0x76aa('0x5a')](_0x4f7dd4);}})[_0x76aa('0x17')](function(_0x56d6af){if(_0x56d6af){return _0x56d6af?{'count':_0x109bd3,'rows':_0x56d6af}:null;}})[_0x76aa('0x17')](respondWithResult(_0x1eb8f2,null))[_0x76aa('0x3b')](handleError(_0x1eb8f2,null));};exports[_0x76aa('0x5c')]=function(_0x57636c,_0x3ae5e8){var _0x46c818=_0x57636c['body'][_0x76aa('0x5d')];var _0xfe926d=_[_0x76aa('0x1e')](_0x46c818,'id');return db[_0x76aa('0x5b')][_0x76aa('0x54')]({'where':{'id':_0xfe926d},'attributes':['id'],'include':[{'model':db[_0x76aa('0x5e')],'as':'Agents','attributes':['id',_0x76aa('0x23'),_0x76aa('0x5f'),_0x76aa('0x60'),_0x76aa('0x61')],'raw':!![]}]})[_0x76aa('0x17')](function(_0x28e1a4){if(_0x28e1a4){var _0x8bb516=_[_0x76aa('0x62')](_0x28e1a4,function(_0xf9f670){var _0x1359f9=_0xf9f670[_0x76aa('0x18')]({'plain':!![]});_0x1359f9['Agents'][_0x76aa('0x63')](function(_0x58cd0c){_0x58cd0c[_0x76aa('0x64')]=_[_0x76aa('0x22')](_0x46c818,{'id':_0x1359f9['id']})[_0x76aa('0x64')];});return _0x1359f9[_0x76aa('0x65')];});return db[_0x76aa('0x29')][_0x76aa('0x22')]({'where':{'id':_0x57636c['params']['id']}})[_0x76aa('0x17')](function(_0x53090c){return db[_0x76aa('0x66')][_0x76aa('0x67')](function(_0x2045a2){return _0x53090c['addTeams'](_0xfe926d,{'transaction':_0x2045a2})[_0x76aa('0x17')](function(){return BPromise[_0x76aa('0x68')](_0x46c818,function(_0x228968){return db[_0x76aa('0x69')][_0x76aa('0x6a')]({'TeamId':_0x228968['id'],'VoiceQueueId':_0x57636c['params']['id'],'penalty':_0x228968[_0x76aa('0x64')]},{'transaction':_0x2045a2});});})['then'](function(){return BPromise[_0x76aa('0x68')](_0x8bb516,function(_0x1bc764){return db['UserVoiceQueue'][_0x76aa('0x6b')]({'where':{'UserId':_0x1bc764['id'],'VoiceQueueId':_0x57636c[_0x76aa('0x46')]['id']},'defaults':{'penalty':_0x1bc764[_0x76aa('0x64')]},'transaction':_0x2045a2});});})[_0x76aa('0x17')](function(){return BPromise[_0x76aa('0x68')](_[_0x76aa('0x52')](_0x8bb516,{'online':!![]}),function(_0x245af7){return db[_0x76aa('0x6c')]['upsert']({'membername':_0x245af7[_0x76aa('0x23')],'UserId':_0x245af7['id'],'queue_name':_0x53090c[_0x76aa('0x23')],'VoiceQueueId':_0x53090c['id'],'interface':_[_0x76aa('0x6d')](_0x245af7[_0x76aa('0x61')])?util[_0x76aa('0x6e')](_0x76aa('0x6f'),_0x245af7[_0x76aa('0x23')]):_0x245af7[_0x76aa('0x61')],'paused':_0x245af7['voicePause']||![],'penalty':_0x245af7[_0x76aa('0x64')]},{'transaction':_0x2045a2});});})[_0x76aa('0x17')](function(){_0x8bb516[_0x76aa('0x63')](function(_0x54e450){socket[_0x76aa('0x70')](_0x76aa('0x71'),{'UserId':_0x54e450['id'],'VoiceQueueId':_0x53090c['id']});});});});});}})[_0x76aa('0x17')](respondWithStatusCode(_0x3ae5e8,null))[_0x76aa('0x3b')](handleError(_0x3ae5e8,null));};exports[_0x76aa('0x72')]=function(_0x5db8d8,_0x21fd43){return db['Team'][_0x76aa('0x54')]({'where':{'id':_0x5db8d8[_0x76aa('0x33')][_0x76aa('0x73')]},'attributes':['id'],'include':[{'model':db[_0x76aa('0x5e')],'as':_0x76aa('0x65'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x21fd43,null))[_0x76aa('0x17')](function(_0x4920fa){var _0x577463=_[_0x76aa('0x1e')](_0x4920fa,'id');var _0x20ba92=[];var _0x533080=[];var _0x3cd088=squel['select']();_0x3cd088[_0x76aa('0x74')](_0x76aa('0x75'))[_0x76aa('0x76')](_0x76aa('0x77'),'tq')[_0x76aa('0x78')](_0x76aa('0x79'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x76aa('0x2d')](_0x76aa('0x7a'),_0x5db8d8[_0x76aa('0x46')]['id']);for(var _0x3ebe91=0x0;_0x3ebe91<_0x4920fa[_0x76aa('0x37')];_0x3ebe91+=0x1){let _0x14318c=_0x4920fa[_0x3ebe91];for(var _0xbfa5f8=0x0;_0xbfa5f8<_0x14318c[_0x76aa('0x65')][_0x76aa('0x37')];_0xbfa5f8+=0x1){let _0x46772f=_0x14318c[_0x76aa('0x65')][_0xbfa5f8];var _0x40df44=_0x3cd088[_0x76aa('0x45')]();_0x40df44[_0x76aa('0x2d')](_0x76aa('0x7b'),_0x46772f['id']);_0x533080[_0x76aa('0x7c')](db[_0x76aa('0x66')][_0x76aa('0x33')](_0x40df44['toString'](),{'type':db[_0x76aa('0x66')]['QueryTypes'][_0x76aa('0x7d')]})[_0x76aa('0x17')](function(_0x4a093b){if(_0x4a093b[_0x76aa('0x37')]===0x1){return _0x46772f['id'];}else{var _0x5305f1=_[_0x76aa('0x7e')](_[_0x76aa('0x1e')](_0x4a093b,_0x76aa('0x7f')),function(_0x5ceae2){return _[_0x76aa('0x20')](_0x577463,_0x5ceae2);});if(_0x5305f1){return _0x46772f['id'];}}}));}}return BPromise['all'](_0x533080)['then'](function(_0x3c9841){_0x20ba92=_(_0x20ba92)['union'](_0x3c9841)[_0x76aa('0x80')]()['value']();return db['VoiceQueue'][_0x76aa('0x22')]({'where':{'id':_0x5db8d8[_0x76aa('0x46')]['id']}})[_0x76aa('0x17')](function(_0x3f4ded){return db[_0x76aa('0x66')][_0x76aa('0x67')](function(_0x434634){return _0x3f4ded[_0x76aa('0x72')](_0x5db8d8[_0x76aa('0x33')][_0x76aa('0x73')],{'transaction':_0x434634})[_0x76aa('0x17')](function(){if(!_[_0x76aa('0x81')](_0x20ba92)){return _0x3f4ded[_0x76aa('0x82')](_0x20ba92,{'transaction':_0x434634})[_0x76aa('0x17')](function(){return db['UserVoiceQueueRt'][_0x76aa('0x25')]({'where':{'VoiceQueueId':_0x5db8d8[_0x76aa('0x46')]['id'],'UserId':_0x20ba92},'transaction':_0x434634});});}})[_0x76aa('0x17')](function(){_0x20ba92[_0x76aa('0x63')](function(_0x540bf3){socket[_0x76aa('0x70')]('userVoiceQueue:remove',{'UserId':_0x540bf3,'VoiceQueueId':_0x3f4ded['id']});});});});});});})[_0x76aa('0x17')](respondWithStatusCode(_0x21fd43,null))['catch'](handleError(_0x21fd43,null));};exports[_0x76aa('0x83')]=function(_0x5427f0,_0x3e9153){var _0x490090,_0x31b7a8;return db['VoiceQueue'][_0x76aa('0x22')]({'where':{'id':_0x5427f0[_0x76aa('0x46')]['id']}})['then'](handleEntityNotFound(_0x3e9153,null))[_0x76aa('0x17')](function(_0x51feca){if(_0x51feca){_0x31b7a8=_0x51feca;return _0x51feca[_0x76aa('0x83')](_0x5427f0['body'][_0x76aa('0x73')],_['omit'](_0x5427f0['body'],[_0x76aa('0x73'),'id'])||{})[_0x76aa('0x84')](function(_0x38b6aa){for(var _0x395501=0x0;_0x395501<_0x5427f0[_0x76aa('0x3d')][_0x76aa('0x73')][_0x76aa('0x37')];_0x395501+=0x1){socket[_0x76aa('0x70')](_0x76aa('0x71'),{'UserId':Number(_0x5427f0[_0x76aa('0x3d')]['ids'][_0x395501]),'VoiceQueueId':Number(_0x5427f0[_0x76aa('0x46')]['id'])});}return _0x38b6aa;});}})[_0x76aa('0x17')](function(_0x3d969f){_0x490090=_0x3d969f||[];if(_0x31b7a8){return db[_0x76aa('0x5e')][_0x76aa('0x54')]({'where':{'id':_0x5427f0[_0x76aa('0x3d')][_0x76aa('0x73')]},'attributes':['id',_0x76aa('0x23'),_0x76aa('0x5f'),_0x76aa('0x60'),_0x76aa('0x61')],'raw':!![]});}})[_0x76aa('0x17')](function(_0x3274a9){if(!_[_0x76aa('0x81')](_0x3274a9)){var _0x5c0268=[];for(var _0x5c5a6f=0x0;_0x5c5a6f<_0x3274a9[_0x76aa('0x37')];_0x5c5a6f++){if(_0x3274a9[_0x5c5a6f][_0x76aa('0x5f')]){_0x5c0268[_0x76aa('0x7c')](db['UserVoiceQueueRt']['upsert']({'membername':_0x3274a9[_0x5c5a6f][_0x76aa('0x23')],'UserId':_0x3274a9[_0x5c5a6f]['id'],'queue_name':_0x31b7a8[_0x76aa('0x23')],'VoiceQueueId':_0x31b7a8['id'],'interface':_[_0x76aa('0x6d')](_0x3274a9[_0x5c5a6f]['interface'])?util[_0x76aa('0x6e')](_0x76aa('0x6f'),_0x3274a9[_0x5c5a6f]['name']):_0x3274a9[_0x5c5a6f]['interface'],'paused':_0x3274a9[_0x5c5a6f]['voicePause']||![],'penalty':_0x5427f0[_0x76aa('0x3d')][_0x76aa('0x64')]||0x0}));}}return BPromise[_0x76aa('0x85')](_0x5c0268);}})['then'](function(){return _0x490090;})[_0x76aa('0x17')](respondWithResult(_0x3e9153,null))[_0x76aa('0x3b')](handleError(_0x3e9153,null));};exports['removeAgents']=function(_0x5433dc,_0x328d1a){return db[_0x76aa('0x29')][_0x76aa('0x22')]({'where':{'id':_0x5433dc['params']['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x328d1a,null))[_0x76aa('0x17')](function(_0x546770){if(_0x546770){return _0x546770[_0x76aa('0x82')](_0x5433dc[_0x76aa('0x33')]['ids'])[_0x76aa('0x17')](function(){if(_[_0x76aa('0x86')](_0x5433dc['query'][_0x76aa('0x73')])){for(var _0x4df504=0x0;_0x4df504<_0x5433dc['query'][_0x76aa('0x73')][_0x76aa('0x37')];_0x4df504+=0x1){socket[_0x76aa('0x70')](_0x76aa('0x87'),{'UserId':Number(_0x5433dc[_0x76aa('0x33')][_0x76aa('0x73')][_0x4df504]),'VoiceQueueId':Number(_0x5433dc[_0x76aa('0x46')]['id'])});}}else{socket[_0x76aa('0x70')](_0x76aa('0x87'),{'UserId':Number(_0x5433dc[_0x76aa('0x33')]['ids']),'VoiceQueueId':Number(_0x5433dc['params']['id'])});}});}})[_0x76aa('0x17')](function(_0x2726da){return db[_0x76aa('0x6c')][_0x76aa('0x25')]({'where':{'VoiceQueueId':_0x5433dc[_0x76aa('0x46')]['id'],'UserId':_0x5433dc[_0x76aa('0x33')]['ids']}})[_0x76aa('0x17')](function(){return _0x2726da;});})[_0x76aa('0x17')](respondWithStatusCode(_0x328d1a,null))[_0x76aa('0x3b')](handleError(_0x328d1a,null));};exports[_0x76aa('0x88')]=function(_0x38694d,_0xf0b932){var _0x1c8cf5={};var _0x5a8d0f={};var _0x5f513d;var _0x54e70c;return db[_0x76aa('0x29')][_0x76aa('0x4b')]({'where':{'id':_0x38694d[_0x76aa('0x46')]['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0xf0b932,null))[_0x76aa('0x17')](function(_0x4afe13){if(_0x4afe13){_0x5f513d=_0x4afe13;_0x5a8d0f['model']=_[_0x76aa('0x32')](db[_0x76aa('0x5e')][_0x76aa('0x2a')]);_0x5a8d0f[_0x76aa('0x33')]=_[_0x76aa('0x32')](_0x38694d['query']);_0x5a8d0f[_0x76aa('0x4c')]=_['intersection'](_0x5a8d0f[_0x76aa('0x31')],_0x5a8d0f['query']);_0x1c8cf5['attributes']=_[_0x76aa('0x35')](_0x5a8d0f['model'],qs[_0x76aa('0x36')](_0x38694d[_0x76aa('0x33')][_0x76aa('0x36')]));_0x1c8cf5[_0x76aa('0x34')]=_0x1c8cf5[_0x76aa('0x34')][_0x76aa('0x37')]?_0x1c8cf5[_0x76aa('0x34')]:_0x5a8d0f[_0x76aa('0x31')];_0x1c8cf5['order']=qs[_0x76aa('0x4f')](_0x38694d[_0x76aa('0x33')][_0x76aa('0x4f')]);_0x1c8cf5[_0x76aa('0x2d')]=qs[_0x76aa('0x4c')](_['pick'](_0x38694d[_0x76aa('0x33')],_0x5a8d0f['filters']));if(_0x38694d[_0x76aa('0x33')]['filter']){_0x1c8cf5[_0x76aa('0x2d')]=_['merge'](_0x1c8cf5[_0x76aa('0x2d')],{'$or':_['map'](_0x1c8cf5[_0x76aa('0x34')],function(_0x8b2ee1){var _0x279be2={};_0x279be2[_0x8b2ee1]={'$like':'%'+_0x38694d['query']['filter']+'%'};return _0x279be2;})});}_0x1c8cf5=_[_0x76aa('0x39')]({},_0x1c8cf5,_0x38694d['options']);return _0x5f513d[_0x76aa('0x88')](_0x1c8cf5);}})[_0x76aa('0x17')](function(_0x1b99d8){if(_0x1b99d8){_0x54e70c=_0x1b99d8['length'];if(!_0x38694d['query']['hasOwnProperty']('nolimit')){_0x1c8cf5[_0x76aa('0x12')]=qs[_0x76aa('0x12')](_0x38694d[_0x76aa('0x33')][_0x76aa('0x12')]);_0x1c8cf5[_0x76aa('0x14')]=qs[_0x76aa('0x14')](_0x38694d[_0x76aa('0x33')][_0x76aa('0x14')]);}return _0x5f513d[_0x76aa('0x88')](_0x1c8cf5);}})[_0x76aa('0x17')](function(_0x2484fd){if(_0x2484fd){return _0x2484fd?{'count':_0x54e70c,'rows':_0x2484fd}:null;}})[_0x76aa('0x17')](respondWithResult(_0xf0b932,null))[_0x76aa('0x3b')](handleError(_0xf0b932,null));};exports['getMembers']=function(_0x2b12e9,_0x4e697b){var _0x1e902d={};var _0x3a7658={};var _0x1b1f85;var _0x3fb275;return db[_0x76aa('0x29')][_0x76aa('0x4b')]({'where':{'id':_0x2b12e9[_0x76aa('0x46')]['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x4e697b,null))[_0x76aa('0x17')](function(_0x1bdc5c){if(_0x1bdc5c){_0x1b1f85=_0x1bdc5c;_0x3a7658[_0x76aa('0x31')]=_['keys'](db['UserVoiceQueueRt'][_0x76aa('0x2a')]);_0x3a7658[_0x76aa('0x33')]=_['keys'](_0x2b12e9[_0x76aa('0x33')]);_0x3a7658[_0x76aa('0x4c')]=_[_0x76aa('0x35')](_0x3a7658[_0x76aa('0x31')],_0x3a7658[_0x76aa('0x33')]);_0x1e902d[_0x76aa('0x34')]=_[_0x76aa('0x35')](_0x3a7658['model'],qs[_0x76aa('0x36')](_0x2b12e9[_0x76aa('0x33')]['fields']));_0x1e902d['attributes']=_0x1e902d[_0x76aa('0x34')][_0x76aa('0x37')]?_0x1e902d[_0x76aa('0x34')]:_0x3a7658[_0x76aa('0x31')];_0x1e902d[_0x76aa('0x4e')]=qs[_0x76aa('0x4f')](_0x2b12e9[_0x76aa('0x33')][_0x76aa('0x4f')]);_0x1e902d[_0x76aa('0x2d')]=qs[_0x76aa('0x4c')](_[_0x76aa('0x50')](_0x2b12e9[_0x76aa('0x33')],_0x3a7658[_0x76aa('0x4c')]));if(_0x2b12e9['query']['filter']){_0x1e902d[_0x76aa('0x2d')]=_[_0x76aa('0x39')](_0x1e902d[_0x76aa('0x2d')],{'$or':_[_0x76aa('0x1e')](_0x1e902d['attributes'],function(_0x5f3819){var _0x2a8410={};_0x2a8410[_0x5f3819]={'$like':'%'+_0x2b12e9[_0x76aa('0x33')][_0x76aa('0x52')]+'%'};return _0x2a8410;})});}_0x1e902d=_['merge']({},_0x1e902d,_0x2b12e9['options']);return _0x1b1f85['getMembers'](_0x1e902d);}})[_0x76aa('0x17')](function(_0x4df872){if(_0x4df872){_0x3fb275=_0x4df872[_0x76aa('0x37')];if(!_0x2b12e9[_0x76aa('0x33')][_0x76aa('0x58')](_0x76aa('0x4d'))){_0x1e902d[_0x76aa('0x12')]=qs[_0x76aa('0x12')](_0x2b12e9[_0x76aa('0x33')][_0x76aa('0x12')]);_0x1e902d[_0x76aa('0x14')]=qs[_0x76aa('0x14')](_0x2b12e9[_0x76aa('0x33')][_0x76aa('0x14')]);}return _0x1b1f85[_0x76aa('0x89')](_0x1e902d);}})[_0x76aa('0x17')](function(_0x3b1f33){return _0x3b1f33?{'count':_0x3fb275,'rows':_0x3b1f33}:null;})[_0x76aa('0x17')](respondWithResult(_0x4e697b,null))['catch'](handleError(_0x4e697b,null));};exports[_0x76aa('0x8a')]=function(_0x5e8cec,_0x1a37e9){var _0x58932f={};var _0x17bd1a={};var _0x5d7a2b;var _0x363c45;return db['VoiceQueue']['findOne']({'where':{'id':_0x5e8cec[_0x76aa('0x46')]['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x1a37e9,null))[_0x76aa('0x17')](function(_0x44668d){if(_0x44668d){_0x5d7a2b=_0x44668d;_0x17bd1a[_0x76aa('0x31')]=_[_0x76aa('0x32')](db['CmList'][_0x76aa('0x2a')]);_0x17bd1a[_0x76aa('0x33')]=_[_0x76aa('0x32')](_0x5e8cec[_0x76aa('0x33')]);_0x17bd1a['filters']=_[_0x76aa('0x35')](_0x17bd1a[_0x76aa('0x31')],_0x17bd1a[_0x76aa('0x33')]);_0x58932f[_0x76aa('0x34')]=_[_0x76aa('0x35')](_0x17bd1a[_0x76aa('0x31')],qs[_0x76aa('0x36')](_0x5e8cec[_0x76aa('0x33')][_0x76aa('0x36')]));_0x58932f[_0x76aa('0x34')]=_0x58932f[_0x76aa('0x34')][_0x76aa('0x37')]?_0x58932f['attributes']:_0x17bd1a['model'];_0x58932f[_0x76aa('0x4e')]=qs[_0x76aa('0x4f')](_0x5e8cec[_0x76aa('0x33')][_0x76aa('0x4f')]);_0x58932f[_0x76aa('0x2d')]=qs[_0x76aa('0x4c')](_[_0x76aa('0x50')](_0x5e8cec[_0x76aa('0x33')],_0x17bd1a[_0x76aa('0x4c')]));if(_0x5e8cec[_0x76aa('0x33')][_0x76aa('0x52')]){_0x58932f['where']=_[_0x76aa('0x39')](_0x58932f['where'],{'$or':_[_0x76aa('0x1e')](_0x58932f[_0x76aa('0x34')],function(_0x278bac){var _0x14256c={};_0x14256c[_0x278bac]={'$like':'%'+_0x5e8cec[_0x76aa('0x33')]['filter']+'%'};return _0x14256c;})});}_0x58932f=_['merge']({},_0x58932f,_0x5e8cec[_0x76aa('0x3a')]);return _0x5d7a2b['getLists'](_0x58932f);}})[_0x76aa('0x17')](function(_0xb760ca){if(_0xb760ca){_0x363c45=_0xb760ca[_0x76aa('0x37')];if(!_0x5e8cec[_0x76aa('0x33')][_0x76aa('0x58')]('nolimit')){_0x58932f['limit']=qs[_0x76aa('0x12')](_0x5e8cec[_0x76aa('0x33')][_0x76aa('0x12')]);_0x58932f[_0x76aa('0x14')]=qs[_0x76aa('0x14')](_0x5e8cec[_0x76aa('0x33')][_0x76aa('0x14')]);}return _0x5d7a2b[_0x76aa('0x8a')](_0x58932f);}})[_0x76aa('0x17')](function(_0x33644d){if(_0x33644d){return _0x33644d?{'count':_0x363c45,'rows':_0x33644d}:null;}})['then'](respondWithResult(_0x1a37e9,null))[_0x76aa('0x3b')](handleError(_0x1a37e9,null));};exports[_0x76aa('0x8b')]=function(_0x4830ea,_0x20638f){var _0x2b2f27=moment()[_0x76aa('0x6e')](_0x76aa('0x8c'));var _0x1a5297,_0x487c28;return db[_0x76aa('0x29')]['find']({'where':{'id':_0x4830ea[_0x76aa('0x46')]['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x20638f,null))[_0x76aa('0x17')](function(_0x2f2a27){if(_0x2f2a27){_0x487c28=_0x2f2a27;return _0x2f2a27['addLists'](_0x4830ea[_0x76aa('0x3d')][_0x76aa('0x73')],_[_0x76aa('0x47')](_0x4830ea[_0x76aa('0x3d')],[_0x76aa('0x73'),'id'])||{});}return null;})[_0x76aa('0x84')](function(_0xca12fa){var _0xb0a4e1;_0x1a5297=_0xca12fa||[];var _0x1f7f1d=[];if(_0xca12fa){for(var _0x413528=0x0;_0x413528<_0xca12fa[_0x76aa('0x37')];_0x413528+=0x1){var _0x39de41=_0xca12fa[_0x413528][_0x76aa('0x18')]({'plain':!![]});_0x487c28[_0x76aa('0x8d')]=_0x4830ea['body']['dialCheckDuplicateType']?_0x4830ea[_0x76aa('0x3d')][_0x76aa('0x8d')]:_0x487c28['dialCheckDuplicateType'];switch(_0x487c28[_0x76aa('0x8d')]){case'always':_0xb0a4e1=squel[_0x76aa('0x8e')]()[_0x76aa('0x8f')](_0x76aa('0x90'))[_0x76aa('0x91')]([_0x76aa('0x92'),_0x76aa('0x93'),_0x76aa('0x94'),_0x76aa('0x95'),'VoiceQueueId',_0x76aa('0x49'),_0x76aa('0x48')],squel['select']()['field'](_0x76aa('0x92'),_0x76aa('0x92'))[_0x76aa('0x74')]('\x27'+_0x2b2f27+'\x27',_0x76aa('0x93'))[_0x76aa('0x74')]('id','ContactId')[_0x76aa('0x74')](_0x39de41['CmListId'][_0x76aa('0x96')](),_0x76aa('0x95'))[_0x76aa('0x74')](_0x4830ea[_0x76aa('0x46')]['id'][_0x76aa('0x96')](),_0x76aa('0x51'))[_0x76aa('0x74')]('\x27'+_0x2b2f27+'\x27',_0x76aa('0x49'))[_0x76aa('0x74')]('\x27'+_0x2b2f27+'\x27',_0x76aa('0x48'))[_0x76aa('0x76')](_0x76aa('0x97'))[_0x76aa('0x2d')]('deletedAt\x20IS\x20NULL')[_0x76aa('0x2d')]('ListId\x20=\x20?',_0x39de41['CmListId']['toString']())[_0x76aa('0x2d')]('phone\x20IS\x20NOT\x20NULL')['where']('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x76aa('0x74')](_0x76aa('0x98'))['from'](_0x76aa('0x99'))[_0x76aa('0x2d')](_0x76aa('0x7a'),_0x4830ea['params']['id']['toString']()))['where'](_0x76aa('0x9a'),squel['select']()[_0x76aa('0x74')](_0x76aa('0x9b'))['from'](_0x76aa('0x90'))[_0x76aa('0x2d')]('VoiceQueueId\x20=\x20?',_0x4830ea[_0x76aa('0x46')]['id'][_0x76aa('0x96')]())))[_0x76aa('0x96')]();break;case _0x76aa('0x9c'):_0xb0a4e1=squel[_0x76aa('0x8e')]()[_0x76aa('0x8f')](_0x76aa('0x90'))[_0x76aa('0x91')](['phone',_0x76aa('0x93'),_0x76aa('0x94'),_0x76aa('0x95'),_0x76aa('0x51'),_0x76aa('0x49'),_0x76aa('0x48')],squel[_0x76aa('0x9d')]()[_0x76aa('0x74')](_0x76aa('0x92'),_0x76aa('0x92'))['field']('\x27'+_0x2b2f27+'\x27',_0x76aa('0x93'))[_0x76aa('0x74')]('id',_0x76aa('0x94'))['field'](_0x39de41['CmListId']['toString'](),_0x76aa('0x95'))[_0x76aa('0x74')](_0x4830ea['params']['id'][_0x76aa('0x96')](),'VoiceQueueId')['field']('\x27'+_0x2b2f27+'\x27',_0x76aa('0x49'))[_0x76aa('0x74')]('\x27'+_0x2b2f27+'\x27','updatedAt')[_0x76aa('0x76')](_0x76aa('0x97'))[_0x76aa('0x2d')]('deletedAt\x20IS\x20NULL')[_0x76aa('0x2d')](_0x76aa('0x9e'),_0x39de41[_0x76aa('0x9f')][_0x76aa('0x96')]())[_0x76aa('0x2d')](_0x76aa('0xa0'))[_0x76aa('0x2d')](_0x76aa('0x9a'),squel[_0x76aa('0x9d')]()[_0x76aa('0x74')](_0x76aa('0x9b'))['from'](_0x76aa('0x90'))[_0x76aa('0x2d')](_0x76aa('0x7a'),_0x4830ea['params']['id']['toString']())))[_0x76aa('0x96')]();break;default:_0xb0a4e1=squel[_0x76aa('0x8e')]()[_0x76aa('0x8f')]('cm_hopper')[_0x76aa('0x91')]([_0x76aa('0x92'),_0x76aa('0x93'),_0x76aa('0x94'),_0x76aa('0x95'),_0x76aa('0x51'),_0x76aa('0x49'),_0x76aa('0x48')],squel[_0x76aa('0x9d')]()[_0x76aa('0x74')](_0x76aa('0x92'),_0x76aa('0x92'))[_0x76aa('0x74')]('\x27'+_0x2b2f27+'\x27',_0x76aa('0x93'))['field']('id',_0x76aa('0x94'))['field'](_0x39de41[_0x76aa('0x9f')]['toString'](),_0x76aa('0x95'))[_0x76aa('0x74')](_0x4830ea[_0x76aa('0x46')]['id']['toString'](),_0x76aa('0x51'))[_0x76aa('0x74')]('\x27'+_0x2b2f27+'\x27',_0x76aa('0x49'))[_0x76aa('0x74')]('\x27'+_0x2b2f27+'\x27',_0x76aa('0x48'))[_0x76aa('0x76')]('cm_contacts')['where'](_0x76aa('0xa1'))[_0x76aa('0x2d')](_0x76aa('0x9e'),_0x39de41['CmListId']['toString']())[_0x76aa('0x2d')](_0x76aa('0xa0')))[_0x76aa('0x96')]();}_0x1f7f1d['push'](db['sequelize'][_0x76aa('0x33')](_0xb0a4e1));}return BPromise[_0x76aa('0x85')](_0x1f7f1d);}})[_0x76aa('0x17')](function(){var _0xbb19e4=[];var _0x226b44=squel[_0x76aa('0x8e')]()[_0x76aa('0x8f')](_0x76aa('0xa2'))['fromQuery']([_0x76aa('0xa3'),_0x76aa('0x92'),_0x76aa('0xa4'),'createdAt',_0x76aa('0x48')],squel[_0x76aa('0x9d')]()[_0x76aa('0x74')]('h.id')['field'](_0x76aa('0xa5'))['field'](_0x76aa('0xa6'))[_0x76aa('0x74')]('\x27'+_0x2b2f27+'\x27',_0x76aa('0x49'))[_0x76aa('0x74')]('\x27'+_0x2b2f27+'\x27','updatedAt')['from'](_0x76aa('0xa7'),'ci')[_0x76aa('0x78')](_0x76aa('0x90'),'h',_0x76aa('0xa8'))[_0x76aa('0x2d')](_0x76aa('0xa9'),_0x2b2f27)['where'](_0x76aa('0xaa'),_0x76aa('0xab')))[_0x76aa('0x96')]();_0xbb19e4['push'](db[_0x76aa('0x66')][_0x76aa('0x33')](_0x226b44));return BPromise[_0x76aa('0x85')](_0xbb19e4);})['then'](function(){return _0x1a5297;})[_0x76aa('0x17')](respondWithResult(_0x20638f,null))['catch'](handleError(_0x20638f,null));};exports['removeLists']=function(_0xef9ea7,_0x45f21f){return db[_0x76aa('0x29')]['find']({'where':{'id':_0xef9ea7[_0x76aa('0x46')]['id']}})['then'](handleEntityNotFound(_0x45f21f,null))[_0x76aa('0x17')](function(_0x113e70){if(_0x113e70){return _0x113e70['removeLists'](_0xef9ea7[_0x76aa('0x33')]['ids']);}})['then'](function(_0x583d68){if(_0x583d68){return db[_0x76aa('0x53')]['destroy']({'where':{'ListId':_0xef9ea7[_0x76aa('0x33')]['ids'],'VoiceQueueId':_0xef9ea7['params']['id']}})[_0x76aa('0x17')](function(){return _0x583d68;});}})['then'](respondWithStatusCode(_0x45f21f,null))['catch'](handleError(_0x45f21f,null));};exports[_0x76aa('0xac')]=function(_0x3b7370,_0x1c3431){var _0x865a1b={};var _0x132d60={};var _0x1a3074;var _0x3184a2;return db['VoiceQueue']['findOne']({'where':{'id':_0x3b7370[_0x76aa('0x46')]['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x1c3431,null))[_0x76aa('0x17')](function(_0x274356){if(_0x274356){_0x1a3074=_0x274356;_0x132d60[_0x76aa('0x31')]=_[_0x76aa('0x32')](db[_0x76aa('0xad')][_0x76aa('0x2a')]);_0x132d60[_0x76aa('0x33')]=_['keys'](_0x3b7370['query']);_0x132d60[_0x76aa('0x4c')]=_[_0x76aa('0x35')](_0x132d60[_0x76aa('0x31')],_0x132d60[_0x76aa('0x33')]);_0x865a1b['attributes']=_['intersection'](_0x132d60[_0x76aa('0x31')],qs['fields'](_0x3b7370[_0x76aa('0x33')][_0x76aa('0x36')]));_0x865a1b['attributes']=_0x865a1b[_0x76aa('0x34')][_0x76aa('0x37')]?_0x865a1b[_0x76aa('0x34')]:_0x132d60[_0x76aa('0x31')];_0x865a1b[_0x76aa('0x4e')]=qs['sort'](_0x3b7370[_0x76aa('0x33')][_0x76aa('0x4f')]);_0x865a1b['where']=qs['filters'](_[_0x76aa('0x50')](_0x3b7370[_0x76aa('0x33')],_0x132d60[_0x76aa('0x4c')]));if(_0x3b7370[_0x76aa('0x33')][_0x76aa('0x52')]){_0x865a1b[_0x76aa('0x2d')]=_[_0x76aa('0x39')](_0x865a1b[_0x76aa('0x2d')],{'$or':_[_0x76aa('0x1e')](_0x865a1b[_0x76aa('0x34')],function(_0xbb0ea3){var _0x4978dd={};_0x4978dd[_0xbb0ea3]={'$like':'%'+_0x3b7370[_0x76aa('0x33')][_0x76aa('0x52')]+'%'};return _0x4978dd;})});}_0x865a1b=_[_0x76aa('0x39')]({},_0x865a1b,_0x3b7370[_0x76aa('0x3a')]);return _0x1a3074['getBlackLists'](_0x865a1b);}})['then'](function(_0x4ee1d3){if(_0x4ee1d3){_0x3184a2=_0x4ee1d3['length'];if(!_0x3b7370[_0x76aa('0x33')][_0x76aa('0x58')](_0x76aa('0x4d'))){_0x865a1b[_0x76aa('0x12')]=qs[_0x76aa('0x12')](_0x3b7370[_0x76aa('0x33')][_0x76aa('0x12')]);_0x865a1b['offset']=qs['offset'](_0x3b7370[_0x76aa('0x33')]['offset']);}return _0x1a3074[_0x76aa('0xac')](_0x865a1b);}})[_0x76aa('0x17')](function(_0x3bc149){if(_0x3bc149){return _0x3bc149?{'count':_0x3184a2,'rows':_0x3bc149}:null;}})['then'](respondWithResult(_0x1c3431,null))[_0x76aa('0x3b')](handleError(_0x1c3431,null));};exports[_0x76aa('0xae')]=function(_0x29e112,_0x3fd683){var _0x5c2c4d;return db[_0x76aa('0x29')][_0x76aa('0x22')]({'where':{'id':_0x29e112[_0x76aa('0x46')]['id']}})['then'](handleEntityNotFound(_0x3fd683,null))[_0x76aa('0x17')](function(_0xcb041d){if(_0xcb041d){return _0xcb041d[_0x76aa('0xae')](_0x29e112[_0x76aa('0x3d')][_0x76aa('0x73')],_[_0x76aa('0x47')](_0x29e112[_0x76aa('0x3d')],['ids','id'])||{});}return null;})['spread'](function(_0x72b9a){var _0x29db0f;_0x5c2c4d=_0x72b9a||[];var _0x28a212=[];if(_0x72b9a){for(var _0x242cd6=0x0;_0x242cd6<_0x72b9a[_0x76aa('0x37')];_0x242cd6+=0x1){var _0xeb428a=_0x72b9a[_0x242cd6][_0x76aa('0x18')]({'plain':!![]});_0x29db0f=squel[_0x76aa('0x8e')]()[_0x76aa('0x8f')](_0x76aa('0xaf'))[_0x76aa('0x91')]([_0x76aa('0x92'),_0x76aa('0x94'),_0x76aa('0x95'),_0x76aa('0x51'),_0x76aa('0x49'),_0x76aa('0x48')],squel[_0x76aa('0x9d')]()[_0x76aa('0x74')](_0x76aa('0x92'),_0x76aa('0x92'))[_0x76aa('0x74')]('id',_0x76aa('0x94'))[_0x76aa('0x74')](_0xeb428a[_0x76aa('0x9f')][_0x76aa('0x96')](),_0x76aa('0x95'))[_0x76aa('0x74')](_0x29e112['params']['id'][_0x76aa('0x96')](),_0x76aa('0x51'))[_0x76aa('0x74')](_0x76aa('0xb0'),'createdAt')[_0x76aa('0x74')](_0x76aa('0xb0'),_0x76aa('0x48'))['from'](_0x76aa('0x97'))[_0x76aa('0x2d')]('deletedAt\x20IS\x20NULL')[_0x76aa('0x2d')]('ListId\x20=\x20?',_0xeb428a[_0x76aa('0x9f')][_0x76aa('0x96')]())[_0x76aa('0x2d')](_0x76aa('0xa0')))['toString']();_0x28a212[_0x76aa('0x7c')](db['sequelize'][_0x76aa('0x33')](_0x29db0f));}return BPromise['all'](_0x28a212);}})[_0x76aa('0x17')](function(){return _0x5c2c4d;})['then'](respondWithResult(_0x3fd683,null))[_0x76aa('0x3b')](handleError(_0x3fd683,null));};exports[_0x76aa('0xb1')]=function(_0x140ee1,_0x3d9e9e){return db[_0x76aa('0x29')][_0x76aa('0x22')]({'where':{'id':_0x140ee1['params']['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x3d9e9e,null))[_0x76aa('0x17')](function(_0x139e67){if(_0x139e67){return _0x139e67[_0x76aa('0xb1')](_0x140ee1['query'][_0x76aa('0x73')]);}})[_0x76aa('0x17')](function(_0x506cad){if(_0x506cad){return db['CmHopperBlack'][_0x76aa('0x25')]({'where':{'ListId':_0x140ee1[_0x76aa('0x33')][_0x76aa('0x73')],'VoiceQueueId':_0x140ee1[_0x76aa('0x46')]['id']}})['then'](function(){return _0x506cad;});}})['then'](respondWithStatusCode(_0x3d9e9e,null))[_0x76aa('0x3b')](handleError(_0x3d9e9e,null));}; \ No newline at end of file +var _0x6aa7=['ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','deletedAt\x20IS\x20NULL','cm_hopper_additional_phones','CmHopperId','OrderBy','ci.item','ci.OrderBy+1','cm_contact_has_items','h.ContactId=ci.CmContactId','h.scheduledat=?','ci.ItemClass=?','PHONE','getBlackLists','CmList','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','moment','util','lodash','squel','ioredis','../../config/logger','api','../../config/environment','defaults','localhost','socket.io-emitter','redis','register','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','update','then','get','VoiceQueues','inbound','QueueCampaigns','outbound','ignore','map','value','includes','type','find','name','UserProfileResource','destroy','error','stack','index','VoiceQueue','rawAttributes','fieldName','getOptions','where','include','rows','show','model','keys','query','attributes','intersection','fields','length','includeAll','merge','options','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','updatedAt','createdAt','getHoppers','findOne','filters','nolimit','order','sort','pick','VoiceQueueId','filter','CmHopper','findAll','getHopperHistories','CmHopperHistory','CmHopperFinal','hasOwnProperty','CmHopperBlack','getTeams','Team','addTeams','teams','User','online','voicePause','interface','flatMap','forEach','penalty','Agents','sequelize','transaction','each','TeamVoiceQueue','upsert','findOrCreate','UserVoiceQueueRt','isNil','format','SIP/%s','emit','userVoiceQueue:save','removeTeams','ids','field','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','SELECT','every','TeamId','compact','isEmpty','removeAgents','addAgents','spread','all','isArray','userVoiceQueue:remove','getAgents','getMembers','getLists','addLists','YYYY-MM-DD\x20HH:mm:ss','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','toString','cm_contacts','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','select'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x6aa7,0x178));var _0x76aa=function(_0x28c545,_0x1dadb5){_0x28c545=_0x28c545-0x0;var _0x5683e5=_0x6aa7[_0x28c545];return _0x5683e5;};'use strict';var moment=require(_0x76aa('0x0'));var BPromise=require('bluebird');var util=require(_0x76aa('0x1'));var _=require(_0x76aa('0x2'));var squel=require(_0x76aa('0x3'));var Redis=require(_0x76aa('0x4'));var qs=require('../../components/parsers/qs');var logger=require(_0x76aa('0x5'))(_0x76aa('0x6'));var config=require(_0x76aa('0x7'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x76aa('0x8')](config['redis'],{'host':_0x76aa('0x9'),'port':0x18eb});var socket=require(_0x76aa('0xa'))(new Redis(config[_0x76aa('0xb')]));require('./voiceQueue.socket')[_0x76aa('0xc')](socket);function respondWithStatusCode(_0x266bd5,_0x3a3f36){_0x3a3f36=_0x3a3f36||0xcc;return function(_0x557d69){if(_0x557d69){return _0x266bd5[_0x76aa('0xd')](_0x3a3f36);}return _0x266bd5[_0x76aa('0xe')](_0x3a3f36)[_0x76aa('0xf')]();};}function respondWithResult(_0x16cb50,_0x37f1ab){_0x37f1ab=_0x37f1ab||0xc8;return function(_0x128435){if(_0x128435){return _0x16cb50[_0x76aa('0xe')](_0x37f1ab)[_0x76aa('0x10')](_0x128435);}};}function respondWithFilteredResult(_0xd6327,_0x17a417){return function(_0x5e5f47){if(_0x5e5f47){var _0x112c39=typeof _0x17a417['offset']===_0x76aa('0x11')&&typeof _0x17a417[_0x76aa('0x12')]===_0x76aa('0x11');var _0x8e44ed=_0x5e5f47[_0x76aa('0x13')];var _0x4e309f=_0x112c39?0x0:_0x17a417['offset'];var _0x2b3b4f=_0x112c39?_0x5e5f47['count']:_0x17a417[_0x76aa('0x14')]+_0x17a417[_0x76aa('0x12')];var _0x5cf594;if(_0x2b3b4f>=_0x8e44ed){_0x2b3b4f=_0x8e44ed;_0x5cf594=0xc8;}else{_0x5cf594=0xce;}_0xd6327[_0x76aa('0xe')](_0x5cf594);return _0xd6327['set'](_0x76aa('0x15'),_0x4e309f+'-'+_0x2b3b4f+'/'+_0x8e44ed)['json'](_0x5e5f47);}return null;};}function saveUpdates(_0x1515e9){return function(_0x413cf6){if(_0x413cf6){return _0x413cf6[_0x76aa('0x16')](_0x1515e9)[_0x76aa('0x17')](function(_0xa1bc7){return _0xa1bc7;});}return null;};}function removeEntity(_0x3ead3f){return function(_0x496902){if(_0x496902){return _0x496902['destroy']()[_0x76aa('0x17')](function(){var _0x454dd3=_0x496902[_0x76aa('0x18')]({'plain':!![]});var _0x15b931=[{'name':_0x76aa('0x19'),'value':_0x76aa('0x1a'),'ignore':![]},{'name':_0x76aa('0x1b'),'value':_0x76aa('0x1c'),'ignore':![]}];var _0x385157=_(_0x15b931)['filter'](_0x76aa('0x1d'))[_0x76aa('0x1e')](_0x76aa('0x1f'))['value']();if(_[_0x76aa('0x20')](_0x385157,_0x454dd3[_0x76aa('0x21')])){return;}var _0x31252f=_[_0x76aa('0x22')](_0x15b931,[_0x76aa('0x1f'),_0x454dd3[_0x76aa('0x21')]])[_0x76aa('0x23')];return db[_0x76aa('0x24')][_0x76aa('0x25')]({'where':{'type':_0x31252f,'resourceId':_0x454dd3['id']}})[_0x76aa('0x17')](function(){return _0x496902;});})[_0x76aa('0x17')](function(){_0x3ead3f[_0x76aa('0xe')](0xcc)[_0x76aa('0xf')]();});}};}function handleEntityNotFound(_0x4ef9b0){return function(_0xb5e8a9){if(!_0xb5e8a9){_0x4ef9b0[_0x76aa('0xd')](0x194);}return _0xb5e8a9;};}function handleError(_0x25c614,_0x2e7ab4){_0x2e7ab4=_0x2e7ab4||0x1f4;return function(_0xa1e6){logger[_0x76aa('0x26')](_0xa1e6[_0x76aa('0x27')]);if(_0xa1e6[_0x76aa('0x23')]){delete _0xa1e6[_0x76aa('0x23')];}_0x25c614[_0x76aa('0xe')](_0x2e7ab4)['send'](_0xa1e6);};}exports[_0x76aa('0x28')]=function(_0x5a8030,_0x994550){var _0x365ff8={};var _0x2dec94={'count':0x0,'rows':[]};var _0x1e90b9=_[_0x76aa('0x1e')](db[_0x76aa('0x29')][_0x76aa('0x2a')],function(_0x3827ec){return{'name':_0x3827ec[_0x76aa('0x2b')],'type':_0x3827ec[_0x76aa('0x21')]['key']};});_0x365ff8=qs[_0x76aa('0x2c')](_0x1e90b9,_0x5a8030);var _0x5532c7={'where':_0x365ff8[_0x76aa('0x2d')]};return db[_0x76aa('0x29')][_0x76aa('0x13')](_0x5532c7)[_0x76aa('0x17')](function(_0x35a705){_0x2dec94['count']=_0x35a705;_0x365ff8[_0x76aa('0x2e')]=qs[_0x76aa('0x2e')](_0x5a8030['query']);return db[_0x76aa('0x29')]['findAll'](_0x365ff8);})[_0x76aa('0x17')](function(_0x4c90b6){_0x2dec94[_0x76aa('0x2f')]=_0x4c90b6;return _0x2dec94;})['then'](respondWithFilteredResult(_0x994550,_0x365ff8))['catch'](handleError(_0x994550,null));};exports[_0x76aa('0x30')]=function(_0x282c56,_0x198fcb){var _0x37dfab={'raw':![],'where':{'id':_0x282c56['params']['id']}},_0x595a0f={};_0x595a0f[_0x76aa('0x31')]=_[_0x76aa('0x32')](db[_0x76aa('0x29')][_0x76aa('0x2a')]);_0x595a0f[_0x76aa('0x33')]=_['keys'](_0x282c56[_0x76aa('0x33')]);_0x595a0f['filters']=_['intersection'](_0x595a0f[_0x76aa('0x31')],_0x595a0f[_0x76aa('0x33')]);_0x37dfab[_0x76aa('0x34')]=_[_0x76aa('0x35')](_0x595a0f['model'],qs[_0x76aa('0x36')](_0x282c56[_0x76aa('0x33')][_0x76aa('0x36')]));_0x37dfab['attributes']=_0x37dfab[_0x76aa('0x34')][_0x76aa('0x37')]?_0x37dfab[_0x76aa('0x34')]:_0x595a0f[_0x76aa('0x31')];if(_0x282c56[_0x76aa('0x33')][_0x76aa('0x38')]){_0x37dfab[_0x76aa('0x2e')]=[{'all':!![]}];}_0x37dfab=_[_0x76aa('0x39')]({},_0x37dfab,_0x282c56[_0x76aa('0x3a')]);return db['VoiceQueue'][_0x76aa('0x22')](_0x37dfab)[_0x76aa('0x17')](handleEntityNotFound(_0x198fcb,null))[_0x76aa('0x17')](respondWithResult(_0x198fcb,null))[_0x76aa('0x3b')](handleError(_0x198fcb,null));};exports[_0x76aa('0x3c')]=function(_0x2957aa,_0x572fdb){return db['VoiceQueue'][_0x76aa('0x3c')](_0x2957aa[_0x76aa('0x3d')],{})[_0x76aa('0x17')](function(_0x365612){var _0x50599f=_0x2957aa[_0x76aa('0x3e')][_0x76aa('0x18')]({'plain':!![]});if(!_0x50599f)throw new Error(_0x76aa('0x3f'));if(_0x50599f[_0x76aa('0x40')]===_0x76aa('0x3e')){var _0x4aa2f3=_0x365612[_0x76aa('0x18')]({'plain':!![]});var _0x556f59=[{'name':_0x76aa('0x19'),'value':'inbound'},{'name':'QueueCampaigns','value':'outbound'}];var _0x144f0a=_['find'](_0x556f59,['value',_0x4aa2f3['type']])[_0x76aa('0x23')];return db[_0x76aa('0x41')][_0x76aa('0x22')]({'where':{'name':_0x144f0a,'userProfileId':_0x50599f[_0x76aa('0x42')]},'raw':!![]})[_0x76aa('0x17')](function(_0x47b0c8){if(_0x47b0c8&&_0x47b0c8[_0x76aa('0x43')]===0x0){return db[_0x76aa('0x24')][_0x76aa('0x3c')]({'name':_0x4aa2f3[_0x76aa('0x23')],'resourceId':_0x4aa2f3['id'],'type':_0x47b0c8[_0x76aa('0x23')],'sectionId':_0x47b0c8['id']},{})['then'](function(){return _0x365612;});}else{return _0x365612;}})[_0x76aa('0x3b')](function(_0x1c62a9){logger['error'](_0x76aa('0x44'),_0x1c62a9);throw _0x1c62a9;});}return _0x365612;})['then'](respondWithResult(_0x572fdb,0xc9))[_0x76aa('0x3b')](handleError(_0x572fdb,null));};exports[_0x76aa('0x45')]=function(_0x31930b,_0x18fd3e){var _0x2d0bc4={'where':{'id':_0x31930b[_0x76aa('0x46')]['id']}},_0x3e0315={};_0x3e0315[_0x76aa('0x31')]=_[_0x76aa('0x32')](db[_0x76aa('0x29')]['rawAttributes']);_0x2d0bc4[_0x76aa('0x34')]=_['intersection'](_0x3e0315[_0x76aa('0x31')],qs[_0x76aa('0x36')](_0x31930b[_0x76aa('0x33')][_0x76aa('0x36')]));_0x2d0bc4['attributes']=_0x2d0bc4['attributes'][_0x76aa('0x37')]?_0x2d0bc4['attributes']:_0x3e0315[_0x76aa('0x31')];if(_0x31930b[_0x76aa('0x33')][_0x76aa('0x38')]){_0x2d0bc4[_0x76aa('0x2e')]=[{'all':!![]}];}_0x2d0bc4=_[_0x76aa('0x39')]({},_0x2d0bc4,_0x31930b[_0x76aa('0x3a')]);return db['VoiceQueue']['find'](_0x2d0bc4)[_0x76aa('0x17')](handleEntityNotFound(_0x18fd3e,null))[_0x76aa('0x17')](function(_0x1708d4){if(_0x1708d4){var _0x40e8ff=_0x1708d4[_0x76aa('0x18')]({'plain':!![]});_0x40e8ff=qs[_0x76aa('0x47')](_0x40e8ff,['id','createdAt',_0x76aa('0x48')]);_0x31930b[_0x76aa('0x3d')]=_[_0x76aa('0x47')](_0x31930b['body'],['id',_0x76aa('0x49'),'updatedAt']);return db[_0x76aa('0x29')]['create'](_[_0x76aa('0x39')](_0x40e8ff,_0x31930b[_0x76aa('0x3d')]),{'include':_0x31930b[_0x76aa('0x33')][_0x76aa('0x38')]?[{'all':!![]}]:undefined})[_0x76aa('0x17')](function(_0x316de3){var _0x953726=_0x31930b['user'][_0x76aa('0x18')]({'plain':!![]});if(!_0x953726)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x953726[_0x76aa('0x40')]===_0x76aa('0x3e')){var _0x288151=_0x316de3[_0x76aa('0x18')]({'plain':!![]});var _0x3fa7ec=[{'name':_0x76aa('0x19'),'value':_0x76aa('0x1a')},{'name':'QueueCampaigns','value':_0x76aa('0x1c')}];var _0x281f73=_[_0x76aa('0x22')](_0x3fa7ec,[_0x76aa('0x1f'),_0x288151['type']])[_0x76aa('0x23')];return db[_0x76aa('0x41')][_0x76aa('0x22')]({'where':{'name':_0x281f73,'userProfileId':_0x953726[_0x76aa('0x42')]},'raw':!![]})[_0x76aa('0x17')](function(_0xf7732){if(_0xf7732&&_0xf7732['autoAssociation']===0x0){return db[_0x76aa('0x24')][_0x76aa('0x3c')]({'name':_0x288151[_0x76aa('0x23')],'resourceId':_0x288151['id'],'type':_0xf7732[_0x76aa('0x23')],'sectionId':_0xf7732['id']},{})[_0x76aa('0x17')](function(){return _0x316de3;});}else{return _0x316de3;}})[_0x76aa('0x3b')](function(_0x37babe){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x37babe);throw _0x37babe;});}return _0x316de3;});}})[_0x76aa('0x17')](respondWithResult(_0x18fd3e,0xc9))[_0x76aa('0x3b')](handleError(_0x18fd3e,null));};exports['update']=function(_0x3d7802,_0x1e6f3c){if(_0x3d7802['body']['id']){delete _0x3d7802[_0x76aa('0x3d')]['id'];}return db[_0x76aa('0x29')][_0x76aa('0x22')]({'where':{'id':_0x3d7802[_0x76aa('0x46')]['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x1e6f3c,null))[_0x76aa('0x17')](saveUpdates(_0x3d7802[_0x76aa('0x3d')],null))[_0x76aa('0x17')](respondWithResult(_0x1e6f3c,null))[_0x76aa('0x3b')](handleError(_0x1e6f3c,null));};exports['destroy']=function(_0xd337f0,_0x49156c){return db[_0x76aa('0x29')][_0x76aa('0x22')]({'where':{'id':_0xd337f0[_0x76aa('0x46')]['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x49156c,null))[_0x76aa('0x17')](removeEntity(_0x49156c,null))[_0x76aa('0x3b')](handleError(_0x49156c,null));};exports[_0x76aa('0x4a')]=function(_0x431d1c,_0x2f1263){var _0x5eceba={'raw':![],'where':{}};var _0x267fcf={};var _0x3d4025={'count':0x0,'rows':[]};return db[_0x76aa('0x29')][_0x76aa('0x4b')]({'where':{'id':_0x431d1c[_0x76aa('0x46')]['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x2f1263,null))[_0x76aa('0x17')](function(_0x157540){if(_0x157540){_0x267fcf['model']=_[_0x76aa('0x32')](db['CmHopper'][_0x76aa('0x2a')]);_0x267fcf[_0x76aa('0x33')]=_[_0x76aa('0x32')](_0x431d1c[_0x76aa('0x33')]);_0x267fcf[_0x76aa('0x4c')]=_[_0x76aa('0x35')](_0x267fcf[_0x76aa('0x31')],_0x267fcf['query']);_0x5eceba[_0x76aa('0x34')]=_[_0x76aa('0x35')](_0x267fcf['model'],qs['fields'](_0x431d1c[_0x76aa('0x33')][_0x76aa('0x36')]));_0x5eceba['attributes']=_0x5eceba[_0x76aa('0x34')][_0x76aa('0x37')]?_0x5eceba[_0x76aa('0x34')]:_0x267fcf['model'];if(!_0x431d1c[_0x76aa('0x33')]['hasOwnProperty'](_0x76aa('0x4d'))){_0x5eceba[_0x76aa('0x12')]=qs[_0x76aa('0x12')](_0x431d1c[_0x76aa('0x33')]['limit']);_0x5eceba['offset']=qs[_0x76aa('0x14')](_0x431d1c['query'][_0x76aa('0x14')]);}_0x5eceba[_0x76aa('0x4e')]=qs[_0x76aa('0x4f')](_0x431d1c[_0x76aa('0x33')][_0x76aa('0x4f')]);_0x5eceba[_0x76aa('0x2d')]=qs[_0x76aa('0x4c')](_[_0x76aa('0x50')](_0x431d1c[_0x76aa('0x33')],_0x267fcf['filters']));_0x5eceba[_0x76aa('0x2d')][_0x76aa('0x51')]=_0x157540['id'];if(_0x431d1c[_0x76aa('0x33')][_0x76aa('0x52')]){_0x5eceba['where']=_['merge'](_0x5eceba['where'],{'$or':_[_0x76aa('0x1e')](_0x5eceba['attributes'],function(_0xb61e5){var _0x256195={};_0x256195[_0xb61e5]={'$like':'%'+_0x431d1c[_0x76aa('0x33')][_0x76aa('0x52')]+'%'};return _0x256195;})});}_0x5eceba=_['merge']({},_0x5eceba,_0x431d1c[_0x76aa('0x3a')]);return db['CmHopper'][_0x76aa('0x13')]({'where':_0x5eceba[_0x76aa('0x2d')]})[_0x76aa('0x17')](function(_0x11d602){_0x3d4025[_0x76aa('0x13')]=_0x11d602;if(_0x431d1c['query'][_0x76aa('0x38')]){_0x5eceba[_0x76aa('0x2e')]=[{'all':!![]}];}return db[_0x76aa('0x53')][_0x76aa('0x54')](_0x5eceba);})[_0x76aa('0x17')](function(_0x22432d){_0x3d4025[_0x76aa('0x2f')]=_0x22432d;return _0x3d4025;});}})[_0x76aa('0x17')](respondWithFilteredResult(_0x2f1263,_0x5eceba))['catch'](handleError(_0x2f1263,null));};exports[_0x76aa('0x55')]=function(_0x381f44,_0x48136a){var _0x3c1b98={'raw':!![],'where':{}};var _0x215463={};var _0x325487={'count':0x0,'rows':[]};return db[_0x76aa('0x29')][_0x76aa('0x4b')]({'where':{'id':_0x381f44[_0x76aa('0x46')]['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x48136a,null))['then'](function(_0xdb821b){if(_0xdb821b){_0x215463['model']=_['keys'](db[_0x76aa('0x56')][_0x76aa('0x2a')]);_0x215463['query']=_['keys'](_0x381f44[_0x76aa('0x33')]);_0x215463[_0x76aa('0x4c')]=_[_0x76aa('0x35')](_0x215463['model'],_0x215463['query']);_0x3c1b98[_0x76aa('0x34')]=_[_0x76aa('0x35')](_0x215463[_0x76aa('0x31')],qs['fields'](_0x381f44[_0x76aa('0x33')]['fields']));_0x3c1b98[_0x76aa('0x34')]=_0x3c1b98[_0x76aa('0x34')][_0x76aa('0x37')]?_0x3c1b98[_0x76aa('0x34')]:_0x215463[_0x76aa('0x31')];if(!_0x381f44['query']['hasOwnProperty'](_0x76aa('0x4d'))){_0x3c1b98[_0x76aa('0x12')]=qs[_0x76aa('0x12')](_0x381f44['query'][_0x76aa('0x12')]);_0x3c1b98[_0x76aa('0x14')]=qs[_0x76aa('0x14')](_0x381f44[_0x76aa('0x33')][_0x76aa('0x14')]);}_0x3c1b98['order']=qs[_0x76aa('0x4f')](_0x381f44['query'][_0x76aa('0x4f')]);_0x3c1b98[_0x76aa('0x2d')]=qs[_0x76aa('0x4c')](_[_0x76aa('0x50')](_0x381f44[_0x76aa('0x33')],_0x215463[_0x76aa('0x4c')]));_0x3c1b98['where']['VoiceQueueId']=_0xdb821b['id'];if(_0x381f44['query']['filter']){_0x3c1b98['where']=_[_0x76aa('0x39')](_0x3c1b98[_0x76aa('0x2d')],{'$or':_['map'](_0x3c1b98['attributes'],function(_0x4f01e9){var _0x3a6326={};_0x3a6326[_0x4f01e9]={'$like':'%'+_0x381f44[_0x76aa('0x33')][_0x76aa('0x52')]+'%'};return _0x3a6326;})});}_0x3c1b98=_['merge']({},_0x3c1b98,_0x381f44['options']);return db[_0x76aa('0x56')][_0x76aa('0x13')]({'where':_0x3c1b98[_0x76aa('0x2d')]})[_0x76aa('0x17')](function(_0x354c7b){_0x325487['count']=_0x354c7b;if(_0x381f44['query'][_0x76aa('0x38')]){_0x3c1b98['include']=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x3c1b98);})[_0x76aa('0x17')](function(_0xbb1ccd){_0x325487['rows']=_0xbb1ccd;return _0x325487;});}})[_0x76aa('0x17')](respondWithFilteredResult(_0x48136a,_0x3c1b98))[_0x76aa('0x3b')](handleError(_0x48136a,null));};exports['getHopperFinals']=function(_0x22063f,_0x24331a){var _0x11d91f={'raw':!![],'where':{}};var _0x258e5a={};var _0x1fa86b={'count':0x0,'rows':[]};return db[_0x76aa('0x29')][_0x76aa('0x4b')]({'where':{'id':_0x22063f[_0x76aa('0x46')]['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x24331a,null))['then'](function(_0x84bc91){if(_0x84bc91){_0x258e5a[_0x76aa('0x31')]=_['keys'](db[_0x76aa('0x57')][_0x76aa('0x2a')]);_0x258e5a[_0x76aa('0x33')]=_['keys'](_0x22063f[_0x76aa('0x33')]);_0x258e5a[_0x76aa('0x4c')]=_['intersection'](_0x258e5a[_0x76aa('0x31')],_0x258e5a[_0x76aa('0x33')]);_0x11d91f[_0x76aa('0x34')]=_['intersection'](_0x258e5a[_0x76aa('0x31')],qs[_0x76aa('0x36')](_0x22063f['query']['fields']));_0x11d91f['attributes']=_0x11d91f[_0x76aa('0x34')][_0x76aa('0x37')]?_0x11d91f[_0x76aa('0x34')]:_0x258e5a[_0x76aa('0x31')];if(!_0x22063f['query']['hasOwnProperty']('nolimit')){_0x11d91f[_0x76aa('0x12')]=qs['limit'](_0x22063f[_0x76aa('0x33')][_0x76aa('0x12')]);_0x11d91f['offset']=qs[_0x76aa('0x14')](_0x22063f[_0x76aa('0x33')]['offset']);}_0x11d91f[_0x76aa('0x4e')]=qs[_0x76aa('0x4f')](_0x22063f[_0x76aa('0x33')][_0x76aa('0x4f')]);_0x11d91f[_0x76aa('0x2d')]=qs[_0x76aa('0x4c')](_['pick'](_0x22063f[_0x76aa('0x33')],_0x258e5a['filters']));_0x11d91f['where']['VoiceQueueId']=_0x84bc91['id'];if(_0x22063f['query']['filter']){_0x11d91f[_0x76aa('0x2d')]=_[_0x76aa('0x39')](_0x11d91f[_0x76aa('0x2d')],{'$or':_[_0x76aa('0x1e')](_0x11d91f['attributes'],function(_0x447103){var _0x2192ed={};_0x2192ed[_0x447103]={'$like':'%'+_0x22063f[_0x76aa('0x33')][_0x76aa('0x52')]+'%'};return _0x2192ed;})});}_0x11d91f=_[_0x76aa('0x39')]({},_0x11d91f,_0x22063f['options']);return db[_0x76aa('0x57')][_0x76aa('0x13')]({'where':_0x11d91f[_0x76aa('0x2d')]})[_0x76aa('0x17')](function(_0x13be70){_0x1fa86b[_0x76aa('0x13')]=_0x13be70;if(_0x22063f[_0x76aa('0x33')]['includeAll']){_0x11d91f[_0x76aa('0x2e')]=[{'all':!![]}];}return db[_0x76aa('0x57')]['findAll'](_0x11d91f);})['then'](function(_0x216e87){_0x1fa86b[_0x76aa('0x2f')]=_0x216e87;return _0x1fa86b;});}})['then'](respondWithFilteredResult(_0x24331a,_0x11d91f))[_0x76aa('0x3b')](handleError(_0x24331a,null));};exports['getHopperBlacks']=function(_0x28ec11,_0x5cc005){var _0x28b439={'raw':!![],'where':{}};var _0x583924={};var _0x45227e={'count':0x0,'rows':[]};return db[_0x76aa('0x29')][_0x76aa('0x4b')]({'where':{'id':_0x28ec11['params']['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x5cc005,null))['then'](function(_0x1af32e){if(_0x1af32e){_0x583924[_0x76aa('0x31')]=_['keys'](db['CmHopperBlack'][_0x76aa('0x2a')]);_0x583924[_0x76aa('0x33')]=_[_0x76aa('0x32')](_0x28ec11[_0x76aa('0x33')]);_0x583924['filters']=_['intersection'](_0x583924[_0x76aa('0x31')],_0x583924['query']);_0x28b439[_0x76aa('0x34')]=_['intersection'](_0x583924[_0x76aa('0x31')],qs[_0x76aa('0x36')](_0x28ec11['query'][_0x76aa('0x36')]));_0x28b439['attributes']=_0x28b439['attributes'][_0x76aa('0x37')]?_0x28b439[_0x76aa('0x34')]:_0x583924['model'];if(!_0x28ec11[_0x76aa('0x33')][_0x76aa('0x58')](_0x76aa('0x4d'))){_0x28b439['limit']=qs[_0x76aa('0x12')](_0x28ec11[_0x76aa('0x33')][_0x76aa('0x12')]);_0x28b439[_0x76aa('0x14')]=qs[_0x76aa('0x14')](_0x28ec11[_0x76aa('0x33')][_0x76aa('0x14')]);}_0x28b439[_0x76aa('0x4e')]=qs[_0x76aa('0x4f')](_0x28ec11[_0x76aa('0x33')][_0x76aa('0x4f')]);_0x28b439[_0x76aa('0x2d')]=qs['filters'](_[_0x76aa('0x50')](_0x28ec11[_0x76aa('0x33')],_0x583924['filters']));_0x28b439[_0x76aa('0x2d')][_0x76aa('0x51')]=_0x1af32e['id'];if(_0x28ec11['query']['filter']){_0x28b439[_0x76aa('0x2d')]=_[_0x76aa('0x39')](_0x28b439['where'],{'$or':_[_0x76aa('0x1e')](_0x28b439[_0x76aa('0x34')],function(_0x24af48){var _0x5010c8={};_0x5010c8[_0x24af48]={'$like':'%'+_0x28ec11[_0x76aa('0x33')][_0x76aa('0x52')]+'%'};return _0x5010c8;})});}_0x28b439=_['merge']({},_0x28b439,_0x28ec11[_0x76aa('0x3a')]);return db[_0x76aa('0x59')][_0x76aa('0x13')]({'where':_0x28b439[_0x76aa('0x2d')]})[_0x76aa('0x17')](function(_0x42543c){_0x45227e['count']=_0x42543c;if(_0x28ec11[_0x76aa('0x33')]['includeAll']){_0x28b439[_0x76aa('0x2e')]=[{'all':!![]}];}return db[_0x76aa('0x59')][_0x76aa('0x54')](_0x28b439);})['then'](function(_0x4c5f54){_0x45227e[_0x76aa('0x2f')]=_0x4c5f54;return _0x45227e;});}})[_0x76aa('0x17')](respondWithFilteredResult(_0x5cc005,_0x28b439))[_0x76aa('0x3b')](handleError(_0x5cc005,null));};exports[_0x76aa('0x5a')]=function(_0x1a81fd,_0x1eb8f2){var _0x4f7dd4={};var _0x5a4c03={};var _0x2565a2;var _0x109bd3;return db[_0x76aa('0x29')][_0x76aa('0x4b')]({'where':{'id':_0x1a81fd['params']['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x1eb8f2,null))['then'](function(_0x54d530){if(_0x54d530){_0x2565a2=_0x54d530;_0x5a4c03[_0x76aa('0x31')]=_[_0x76aa('0x32')](db[_0x76aa('0x5b')]['rawAttributes']);_0x5a4c03[_0x76aa('0x33')]=_[_0x76aa('0x32')](_0x1a81fd[_0x76aa('0x33')]);_0x5a4c03[_0x76aa('0x4c')]=_[_0x76aa('0x35')](_0x5a4c03[_0x76aa('0x31')],_0x5a4c03[_0x76aa('0x33')]);_0x4f7dd4['attributes']=_[_0x76aa('0x35')](_0x5a4c03[_0x76aa('0x31')],qs[_0x76aa('0x36')](_0x1a81fd[_0x76aa('0x33')][_0x76aa('0x36')]));_0x4f7dd4[_0x76aa('0x34')]=_0x4f7dd4['attributes'][_0x76aa('0x37')]?_0x4f7dd4[_0x76aa('0x34')]:_0x5a4c03[_0x76aa('0x31')];_0x4f7dd4[_0x76aa('0x4e')]=qs['sort'](_0x1a81fd[_0x76aa('0x33')][_0x76aa('0x4f')]);_0x4f7dd4[_0x76aa('0x2d')]=qs[_0x76aa('0x4c')](_[_0x76aa('0x50')](_0x1a81fd['query'],_0x5a4c03[_0x76aa('0x4c')]));if(_0x1a81fd[_0x76aa('0x33')]['filter']){_0x4f7dd4['where']=_[_0x76aa('0x39')](_0x4f7dd4[_0x76aa('0x2d')],{'$or':_[_0x76aa('0x1e')](_0x4f7dd4[_0x76aa('0x34')],function(_0x46f098){var _0x293221={};_0x293221[_0x46f098]={'$like':'%'+_0x1a81fd['query'][_0x76aa('0x52')]+'%'};return _0x293221;})});}_0x4f7dd4=_[_0x76aa('0x39')]({},_0x4f7dd4,_0x1a81fd[_0x76aa('0x3a')]);return _0x2565a2[_0x76aa('0x5a')](_0x4f7dd4);}})[_0x76aa('0x17')](function(_0x2e7bb7){if(_0x2e7bb7){_0x109bd3=_0x2e7bb7['length'];if(!_0x1a81fd[_0x76aa('0x33')][_0x76aa('0x58')](_0x76aa('0x4d'))){_0x4f7dd4[_0x76aa('0x12')]=qs[_0x76aa('0x12')](_0x1a81fd[_0x76aa('0x33')]['limit']);_0x4f7dd4[_0x76aa('0x14')]=qs['offset'](_0x1a81fd[_0x76aa('0x33')]['offset']);}return _0x2565a2[_0x76aa('0x5a')](_0x4f7dd4);}})[_0x76aa('0x17')](function(_0x56d6af){if(_0x56d6af){return _0x56d6af?{'count':_0x109bd3,'rows':_0x56d6af}:null;}})[_0x76aa('0x17')](respondWithResult(_0x1eb8f2,null))[_0x76aa('0x3b')](handleError(_0x1eb8f2,null));};exports[_0x76aa('0x5c')]=function(_0x57636c,_0x3ae5e8){var _0x46c818=_0x57636c['body'][_0x76aa('0x5d')];var _0xfe926d=_[_0x76aa('0x1e')](_0x46c818,'id');return db[_0x76aa('0x5b')][_0x76aa('0x54')]({'where':{'id':_0xfe926d},'attributes':['id'],'include':[{'model':db[_0x76aa('0x5e')],'as':'Agents','attributes':['id',_0x76aa('0x23'),_0x76aa('0x5f'),_0x76aa('0x60'),_0x76aa('0x61')],'raw':!![]}]})[_0x76aa('0x17')](function(_0x28e1a4){if(_0x28e1a4){var _0x8bb516=_[_0x76aa('0x62')](_0x28e1a4,function(_0xf9f670){var _0x1359f9=_0xf9f670[_0x76aa('0x18')]({'plain':!![]});_0x1359f9['Agents'][_0x76aa('0x63')](function(_0x58cd0c){_0x58cd0c[_0x76aa('0x64')]=_[_0x76aa('0x22')](_0x46c818,{'id':_0x1359f9['id']})[_0x76aa('0x64')];});return _0x1359f9[_0x76aa('0x65')];});return db[_0x76aa('0x29')][_0x76aa('0x22')]({'where':{'id':_0x57636c['params']['id']}})[_0x76aa('0x17')](function(_0x53090c){return db[_0x76aa('0x66')][_0x76aa('0x67')](function(_0x2045a2){return _0x53090c['addTeams'](_0xfe926d,{'transaction':_0x2045a2})[_0x76aa('0x17')](function(){return BPromise[_0x76aa('0x68')](_0x46c818,function(_0x228968){return db[_0x76aa('0x69')][_0x76aa('0x6a')]({'TeamId':_0x228968['id'],'VoiceQueueId':_0x57636c['params']['id'],'penalty':_0x228968[_0x76aa('0x64')]},{'transaction':_0x2045a2});});})['then'](function(){return BPromise[_0x76aa('0x68')](_0x8bb516,function(_0x1bc764){return db['UserVoiceQueue'][_0x76aa('0x6b')]({'where':{'UserId':_0x1bc764['id'],'VoiceQueueId':_0x57636c[_0x76aa('0x46')]['id']},'defaults':{'penalty':_0x1bc764[_0x76aa('0x64')]},'transaction':_0x2045a2});});})[_0x76aa('0x17')](function(){return BPromise[_0x76aa('0x68')](_[_0x76aa('0x52')](_0x8bb516,{'online':!![]}),function(_0x245af7){return db[_0x76aa('0x6c')]['upsert']({'membername':_0x245af7[_0x76aa('0x23')],'UserId':_0x245af7['id'],'queue_name':_0x53090c[_0x76aa('0x23')],'VoiceQueueId':_0x53090c['id'],'interface':_[_0x76aa('0x6d')](_0x245af7[_0x76aa('0x61')])?util[_0x76aa('0x6e')](_0x76aa('0x6f'),_0x245af7[_0x76aa('0x23')]):_0x245af7[_0x76aa('0x61')],'paused':_0x245af7['voicePause']||![],'penalty':_0x245af7[_0x76aa('0x64')]},{'transaction':_0x2045a2});});})[_0x76aa('0x17')](function(){_0x8bb516[_0x76aa('0x63')](function(_0x54e450){socket[_0x76aa('0x70')](_0x76aa('0x71'),{'UserId':_0x54e450['id'],'VoiceQueueId':_0x53090c['id']});});});});});}})[_0x76aa('0x17')](respondWithStatusCode(_0x3ae5e8,null))[_0x76aa('0x3b')](handleError(_0x3ae5e8,null));};exports[_0x76aa('0x72')]=function(_0x5db8d8,_0x21fd43){return db['Team'][_0x76aa('0x54')]({'where':{'id':_0x5db8d8[_0x76aa('0x33')][_0x76aa('0x73')]},'attributes':['id'],'include':[{'model':db[_0x76aa('0x5e')],'as':_0x76aa('0x65'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x21fd43,null))[_0x76aa('0x17')](function(_0x4920fa){var _0x577463=_[_0x76aa('0x1e')](_0x4920fa,'id');var _0x20ba92=[];var _0x533080=[];var _0x3cd088=squel['select']();_0x3cd088[_0x76aa('0x74')](_0x76aa('0x75'))[_0x76aa('0x76')](_0x76aa('0x77'),'tq')[_0x76aa('0x78')](_0x76aa('0x79'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x76aa('0x2d')](_0x76aa('0x7a'),_0x5db8d8[_0x76aa('0x46')]['id']);for(var _0x3ebe91=0x0;_0x3ebe91<_0x4920fa[_0x76aa('0x37')];_0x3ebe91+=0x1){let _0x14318c=_0x4920fa[_0x3ebe91];for(var _0xbfa5f8=0x0;_0xbfa5f8<_0x14318c[_0x76aa('0x65')][_0x76aa('0x37')];_0xbfa5f8+=0x1){let _0x46772f=_0x14318c[_0x76aa('0x65')][_0xbfa5f8];var _0x40df44=_0x3cd088[_0x76aa('0x45')]();_0x40df44[_0x76aa('0x2d')](_0x76aa('0x7b'),_0x46772f['id']);_0x533080[_0x76aa('0x7c')](db[_0x76aa('0x66')][_0x76aa('0x33')](_0x40df44['toString'](),{'type':db[_0x76aa('0x66')]['QueryTypes'][_0x76aa('0x7d')]})[_0x76aa('0x17')](function(_0x4a093b){if(_0x4a093b[_0x76aa('0x37')]===0x1){return _0x46772f['id'];}else{var _0x5305f1=_[_0x76aa('0x7e')](_[_0x76aa('0x1e')](_0x4a093b,_0x76aa('0x7f')),function(_0x5ceae2){return _[_0x76aa('0x20')](_0x577463,_0x5ceae2);});if(_0x5305f1){return _0x46772f['id'];}}}));}}return BPromise['all'](_0x533080)['then'](function(_0x3c9841){_0x20ba92=_(_0x20ba92)['union'](_0x3c9841)[_0x76aa('0x80')]()['value']();return db['VoiceQueue'][_0x76aa('0x22')]({'where':{'id':_0x5db8d8[_0x76aa('0x46')]['id']}})[_0x76aa('0x17')](function(_0x3f4ded){return db[_0x76aa('0x66')][_0x76aa('0x67')](function(_0x434634){return _0x3f4ded[_0x76aa('0x72')](_0x5db8d8[_0x76aa('0x33')][_0x76aa('0x73')],{'transaction':_0x434634})[_0x76aa('0x17')](function(){if(!_[_0x76aa('0x81')](_0x20ba92)){return _0x3f4ded[_0x76aa('0x82')](_0x20ba92,{'transaction':_0x434634})[_0x76aa('0x17')](function(){return db['UserVoiceQueueRt'][_0x76aa('0x25')]({'where':{'VoiceQueueId':_0x5db8d8[_0x76aa('0x46')]['id'],'UserId':_0x20ba92},'transaction':_0x434634});});}})[_0x76aa('0x17')](function(){_0x20ba92[_0x76aa('0x63')](function(_0x540bf3){socket[_0x76aa('0x70')]('userVoiceQueue:remove',{'UserId':_0x540bf3,'VoiceQueueId':_0x3f4ded['id']});});});});});});})[_0x76aa('0x17')](respondWithStatusCode(_0x21fd43,null))['catch'](handleError(_0x21fd43,null));};exports[_0x76aa('0x83')]=function(_0x5427f0,_0x3e9153){var _0x490090,_0x31b7a8;return db['VoiceQueue'][_0x76aa('0x22')]({'where':{'id':_0x5427f0[_0x76aa('0x46')]['id']}})['then'](handleEntityNotFound(_0x3e9153,null))[_0x76aa('0x17')](function(_0x51feca){if(_0x51feca){_0x31b7a8=_0x51feca;return _0x51feca[_0x76aa('0x83')](_0x5427f0['body'][_0x76aa('0x73')],_['omit'](_0x5427f0['body'],[_0x76aa('0x73'),'id'])||{})[_0x76aa('0x84')](function(_0x38b6aa){for(var _0x395501=0x0;_0x395501<_0x5427f0[_0x76aa('0x3d')][_0x76aa('0x73')][_0x76aa('0x37')];_0x395501+=0x1){socket[_0x76aa('0x70')](_0x76aa('0x71'),{'UserId':Number(_0x5427f0[_0x76aa('0x3d')]['ids'][_0x395501]),'VoiceQueueId':Number(_0x5427f0[_0x76aa('0x46')]['id'])});}return _0x38b6aa;});}})[_0x76aa('0x17')](function(_0x3d969f){_0x490090=_0x3d969f||[];if(_0x31b7a8){return db[_0x76aa('0x5e')][_0x76aa('0x54')]({'where':{'id':_0x5427f0[_0x76aa('0x3d')][_0x76aa('0x73')]},'attributes':['id',_0x76aa('0x23'),_0x76aa('0x5f'),_0x76aa('0x60'),_0x76aa('0x61')],'raw':!![]});}})[_0x76aa('0x17')](function(_0x3274a9){if(!_[_0x76aa('0x81')](_0x3274a9)){var _0x5c0268=[];for(var _0x5c5a6f=0x0;_0x5c5a6f<_0x3274a9[_0x76aa('0x37')];_0x5c5a6f++){if(_0x3274a9[_0x5c5a6f][_0x76aa('0x5f')]){_0x5c0268[_0x76aa('0x7c')](db['UserVoiceQueueRt']['upsert']({'membername':_0x3274a9[_0x5c5a6f][_0x76aa('0x23')],'UserId':_0x3274a9[_0x5c5a6f]['id'],'queue_name':_0x31b7a8[_0x76aa('0x23')],'VoiceQueueId':_0x31b7a8['id'],'interface':_[_0x76aa('0x6d')](_0x3274a9[_0x5c5a6f]['interface'])?util[_0x76aa('0x6e')](_0x76aa('0x6f'),_0x3274a9[_0x5c5a6f]['name']):_0x3274a9[_0x5c5a6f]['interface'],'paused':_0x3274a9[_0x5c5a6f]['voicePause']||![],'penalty':_0x5427f0[_0x76aa('0x3d')][_0x76aa('0x64')]||0x0}));}}return BPromise[_0x76aa('0x85')](_0x5c0268);}})['then'](function(){return _0x490090;})[_0x76aa('0x17')](respondWithResult(_0x3e9153,null))[_0x76aa('0x3b')](handleError(_0x3e9153,null));};exports['removeAgents']=function(_0x5433dc,_0x328d1a){return db[_0x76aa('0x29')][_0x76aa('0x22')]({'where':{'id':_0x5433dc['params']['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x328d1a,null))[_0x76aa('0x17')](function(_0x546770){if(_0x546770){return _0x546770[_0x76aa('0x82')](_0x5433dc[_0x76aa('0x33')]['ids'])[_0x76aa('0x17')](function(){if(_[_0x76aa('0x86')](_0x5433dc['query'][_0x76aa('0x73')])){for(var _0x4df504=0x0;_0x4df504<_0x5433dc['query'][_0x76aa('0x73')][_0x76aa('0x37')];_0x4df504+=0x1){socket[_0x76aa('0x70')](_0x76aa('0x87'),{'UserId':Number(_0x5433dc[_0x76aa('0x33')][_0x76aa('0x73')][_0x4df504]),'VoiceQueueId':Number(_0x5433dc[_0x76aa('0x46')]['id'])});}}else{socket[_0x76aa('0x70')](_0x76aa('0x87'),{'UserId':Number(_0x5433dc[_0x76aa('0x33')]['ids']),'VoiceQueueId':Number(_0x5433dc['params']['id'])});}});}})[_0x76aa('0x17')](function(_0x2726da){return db[_0x76aa('0x6c')][_0x76aa('0x25')]({'where':{'VoiceQueueId':_0x5433dc[_0x76aa('0x46')]['id'],'UserId':_0x5433dc[_0x76aa('0x33')]['ids']}})[_0x76aa('0x17')](function(){return _0x2726da;});})[_0x76aa('0x17')](respondWithStatusCode(_0x328d1a,null))[_0x76aa('0x3b')](handleError(_0x328d1a,null));};exports[_0x76aa('0x88')]=function(_0x38694d,_0xf0b932){var _0x1c8cf5={};var _0x5a8d0f={};var _0x5f513d;var _0x54e70c;return db[_0x76aa('0x29')][_0x76aa('0x4b')]({'where':{'id':_0x38694d[_0x76aa('0x46')]['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0xf0b932,null))[_0x76aa('0x17')](function(_0x4afe13){if(_0x4afe13){_0x5f513d=_0x4afe13;_0x5a8d0f['model']=_[_0x76aa('0x32')](db[_0x76aa('0x5e')][_0x76aa('0x2a')]);_0x5a8d0f[_0x76aa('0x33')]=_[_0x76aa('0x32')](_0x38694d['query']);_0x5a8d0f[_0x76aa('0x4c')]=_['intersection'](_0x5a8d0f[_0x76aa('0x31')],_0x5a8d0f['query']);_0x1c8cf5['attributes']=_[_0x76aa('0x35')](_0x5a8d0f['model'],qs[_0x76aa('0x36')](_0x38694d[_0x76aa('0x33')][_0x76aa('0x36')]));_0x1c8cf5[_0x76aa('0x34')]=_0x1c8cf5[_0x76aa('0x34')][_0x76aa('0x37')]?_0x1c8cf5[_0x76aa('0x34')]:_0x5a8d0f[_0x76aa('0x31')];_0x1c8cf5['order']=qs[_0x76aa('0x4f')](_0x38694d[_0x76aa('0x33')][_0x76aa('0x4f')]);_0x1c8cf5[_0x76aa('0x2d')]=qs[_0x76aa('0x4c')](_['pick'](_0x38694d[_0x76aa('0x33')],_0x5a8d0f['filters']));if(_0x38694d[_0x76aa('0x33')]['filter']){_0x1c8cf5[_0x76aa('0x2d')]=_['merge'](_0x1c8cf5[_0x76aa('0x2d')],{'$or':_['map'](_0x1c8cf5[_0x76aa('0x34')],function(_0x8b2ee1){var _0x279be2={};_0x279be2[_0x8b2ee1]={'$like':'%'+_0x38694d['query']['filter']+'%'};return _0x279be2;})});}_0x1c8cf5=_[_0x76aa('0x39')]({},_0x1c8cf5,_0x38694d['options']);return _0x5f513d[_0x76aa('0x88')](_0x1c8cf5);}})[_0x76aa('0x17')](function(_0x1b99d8){if(_0x1b99d8){_0x54e70c=_0x1b99d8['length'];if(!_0x38694d['query']['hasOwnProperty']('nolimit')){_0x1c8cf5[_0x76aa('0x12')]=qs[_0x76aa('0x12')](_0x38694d[_0x76aa('0x33')][_0x76aa('0x12')]);_0x1c8cf5[_0x76aa('0x14')]=qs[_0x76aa('0x14')](_0x38694d[_0x76aa('0x33')][_0x76aa('0x14')]);}return _0x5f513d[_0x76aa('0x88')](_0x1c8cf5);}})[_0x76aa('0x17')](function(_0x2484fd){if(_0x2484fd){return _0x2484fd?{'count':_0x54e70c,'rows':_0x2484fd}:null;}})[_0x76aa('0x17')](respondWithResult(_0xf0b932,null))[_0x76aa('0x3b')](handleError(_0xf0b932,null));};exports['getMembers']=function(_0x2b12e9,_0x4e697b){var _0x1e902d={};var _0x3a7658={};var _0x1b1f85;var _0x3fb275;return db[_0x76aa('0x29')][_0x76aa('0x4b')]({'where':{'id':_0x2b12e9[_0x76aa('0x46')]['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x4e697b,null))[_0x76aa('0x17')](function(_0x1bdc5c){if(_0x1bdc5c){_0x1b1f85=_0x1bdc5c;_0x3a7658[_0x76aa('0x31')]=_['keys'](db['UserVoiceQueueRt'][_0x76aa('0x2a')]);_0x3a7658[_0x76aa('0x33')]=_['keys'](_0x2b12e9[_0x76aa('0x33')]);_0x3a7658[_0x76aa('0x4c')]=_[_0x76aa('0x35')](_0x3a7658[_0x76aa('0x31')],_0x3a7658[_0x76aa('0x33')]);_0x1e902d[_0x76aa('0x34')]=_[_0x76aa('0x35')](_0x3a7658['model'],qs[_0x76aa('0x36')](_0x2b12e9[_0x76aa('0x33')]['fields']));_0x1e902d['attributes']=_0x1e902d[_0x76aa('0x34')][_0x76aa('0x37')]?_0x1e902d[_0x76aa('0x34')]:_0x3a7658[_0x76aa('0x31')];_0x1e902d[_0x76aa('0x4e')]=qs[_0x76aa('0x4f')](_0x2b12e9[_0x76aa('0x33')][_0x76aa('0x4f')]);_0x1e902d[_0x76aa('0x2d')]=qs[_0x76aa('0x4c')](_[_0x76aa('0x50')](_0x2b12e9[_0x76aa('0x33')],_0x3a7658[_0x76aa('0x4c')]));if(_0x2b12e9['query']['filter']){_0x1e902d[_0x76aa('0x2d')]=_[_0x76aa('0x39')](_0x1e902d[_0x76aa('0x2d')],{'$or':_[_0x76aa('0x1e')](_0x1e902d['attributes'],function(_0x5f3819){var _0x2a8410={};_0x2a8410[_0x5f3819]={'$like':'%'+_0x2b12e9[_0x76aa('0x33')][_0x76aa('0x52')]+'%'};return _0x2a8410;})});}_0x1e902d=_['merge']({},_0x1e902d,_0x2b12e9['options']);return _0x1b1f85['getMembers'](_0x1e902d);}})[_0x76aa('0x17')](function(_0x4df872){if(_0x4df872){_0x3fb275=_0x4df872[_0x76aa('0x37')];if(!_0x2b12e9[_0x76aa('0x33')][_0x76aa('0x58')](_0x76aa('0x4d'))){_0x1e902d[_0x76aa('0x12')]=qs[_0x76aa('0x12')](_0x2b12e9[_0x76aa('0x33')][_0x76aa('0x12')]);_0x1e902d[_0x76aa('0x14')]=qs[_0x76aa('0x14')](_0x2b12e9[_0x76aa('0x33')][_0x76aa('0x14')]);}return _0x1b1f85[_0x76aa('0x89')](_0x1e902d);}})[_0x76aa('0x17')](function(_0x3b1f33){return _0x3b1f33?{'count':_0x3fb275,'rows':_0x3b1f33}:null;})[_0x76aa('0x17')](respondWithResult(_0x4e697b,null))['catch'](handleError(_0x4e697b,null));};exports[_0x76aa('0x8a')]=function(_0x5e8cec,_0x1a37e9){var _0x58932f={};var _0x17bd1a={};var _0x5d7a2b;var _0x363c45;return db['VoiceQueue']['findOne']({'where':{'id':_0x5e8cec[_0x76aa('0x46')]['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x1a37e9,null))[_0x76aa('0x17')](function(_0x44668d){if(_0x44668d){_0x5d7a2b=_0x44668d;_0x17bd1a[_0x76aa('0x31')]=_[_0x76aa('0x32')](db['CmList'][_0x76aa('0x2a')]);_0x17bd1a[_0x76aa('0x33')]=_[_0x76aa('0x32')](_0x5e8cec[_0x76aa('0x33')]);_0x17bd1a['filters']=_[_0x76aa('0x35')](_0x17bd1a[_0x76aa('0x31')],_0x17bd1a[_0x76aa('0x33')]);_0x58932f[_0x76aa('0x34')]=_[_0x76aa('0x35')](_0x17bd1a[_0x76aa('0x31')],qs[_0x76aa('0x36')](_0x5e8cec[_0x76aa('0x33')][_0x76aa('0x36')]));_0x58932f[_0x76aa('0x34')]=_0x58932f[_0x76aa('0x34')][_0x76aa('0x37')]?_0x58932f['attributes']:_0x17bd1a['model'];_0x58932f[_0x76aa('0x4e')]=qs[_0x76aa('0x4f')](_0x5e8cec[_0x76aa('0x33')][_0x76aa('0x4f')]);_0x58932f[_0x76aa('0x2d')]=qs[_0x76aa('0x4c')](_[_0x76aa('0x50')](_0x5e8cec[_0x76aa('0x33')],_0x17bd1a[_0x76aa('0x4c')]));if(_0x5e8cec[_0x76aa('0x33')][_0x76aa('0x52')]){_0x58932f['where']=_[_0x76aa('0x39')](_0x58932f['where'],{'$or':_[_0x76aa('0x1e')](_0x58932f[_0x76aa('0x34')],function(_0x278bac){var _0x14256c={};_0x14256c[_0x278bac]={'$like':'%'+_0x5e8cec[_0x76aa('0x33')]['filter']+'%'};return _0x14256c;})});}_0x58932f=_['merge']({},_0x58932f,_0x5e8cec[_0x76aa('0x3a')]);return _0x5d7a2b['getLists'](_0x58932f);}})[_0x76aa('0x17')](function(_0xb760ca){if(_0xb760ca){_0x363c45=_0xb760ca[_0x76aa('0x37')];if(!_0x5e8cec[_0x76aa('0x33')][_0x76aa('0x58')]('nolimit')){_0x58932f['limit']=qs[_0x76aa('0x12')](_0x5e8cec[_0x76aa('0x33')][_0x76aa('0x12')]);_0x58932f[_0x76aa('0x14')]=qs[_0x76aa('0x14')](_0x5e8cec[_0x76aa('0x33')][_0x76aa('0x14')]);}return _0x5d7a2b[_0x76aa('0x8a')](_0x58932f);}})[_0x76aa('0x17')](function(_0x33644d){if(_0x33644d){return _0x33644d?{'count':_0x363c45,'rows':_0x33644d}:null;}})['then'](respondWithResult(_0x1a37e9,null))[_0x76aa('0x3b')](handleError(_0x1a37e9,null));};exports[_0x76aa('0x8b')]=function(_0x4830ea,_0x20638f){var _0x2b2f27=moment()[_0x76aa('0x6e')](_0x76aa('0x8c'));var _0x1a5297,_0x487c28;return db[_0x76aa('0x29')]['find']({'where':{'id':_0x4830ea[_0x76aa('0x46')]['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x20638f,null))[_0x76aa('0x17')](function(_0x2f2a27){if(_0x2f2a27){_0x487c28=_0x2f2a27;return _0x2f2a27['addLists'](_0x4830ea[_0x76aa('0x3d')][_0x76aa('0x73')],_[_0x76aa('0x47')](_0x4830ea[_0x76aa('0x3d')],[_0x76aa('0x73'),'id'])||{});}return null;})[_0x76aa('0x84')](function(_0xca12fa){var _0xb0a4e1;_0x1a5297=_0xca12fa||[];var _0x1f7f1d=[];if(_0xca12fa){for(var _0x413528=0x0;_0x413528<_0xca12fa[_0x76aa('0x37')];_0x413528+=0x1){var _0x39de41=_0xca12fa[_0x413528][_0x76aa('0x18')]({'plain':!![]});_0x487c28[_0x76aa('0x8d')]=_0x4830ea['body']['dialCheckDuplicateType']?_0x4830ea[_0x76aa('0x3d')][_0x76aa('0x8d')]:_0x487c28['dialCheckDuplicateType'];switch(_0x487c28[_0x76aa('0x8d')]){case'always':_0xb0a4e1=squel[_0x76aa('0x8e')]()[_0x76aa('0x8f')](_0x76aa('0x90'))[_0x76aa('0x91')]([_0x76aa('0x92'),_0x76aa('0x93'),_0x76aa('0x94'),_0x76aa('0x95'),'VoiceQueueId',_0x76aa('0x49'),_0x76aa('0x48')],squel['select']()['field'](_0x76aa('0x92'),_0x76aa('0x92'))[_0x76aa('0x74')]('\x27'+_0x2b2f27+'\x27',_0x76aa('0x93'))[_0x76aa('0x74')]('id','ContactId')[_0x76aa('0x74')](_0x39de41['CmListId'][_0x76aa('0x96')](),_0x76aa('0x95'))[_0x76aa('0x74')](_0x4830ea[_0x76aa('0x46')]['id'][_0x76aa('0x96')](),_0x76aa('0x51'))[_0x76aa('0x74')]('\x27'+_0x2b2f27+'\x27',_0x76aa('0x49'))[_0x76aa('0x74')]('\x27'+_0x2b2f27+'\x27',_0x76aa('0x48'))[_0x76aa('0x76')](_0x76aa('0x97'))[_0x76aa('0x2d')]('deletedAt\x20IS\x20NULL')[_0x76aa('0x2d')]('ListId\x20=\x20?',_0x39de41['CmListId']['toString']())[_0x76aa('0x2d')]('phone\x20IS\x20NOT\x20NULL')['where']('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x76aa('0x74')](_0x76aa('0x98'))['from'](_0x76aa('0x99'))[_0x76aa('0x2d')](_0x76aa('0x7a'),_0x4830ea['params']['id']['toString']()))['where'](_0x76aa('0x9a'),squel['select']()[_0x76aa('0x74')](_0x76aa('0x9b'))['from'](_0x76aa('0x90'))[_0x76aa('0x2d')]('VoiceQueueId\x20=\x20?',_0x4830ea[_0x76aa('0x46')]['id'][_0x76aa('0x96')]())))[_0x76aa('0x96')]();break;case _0x76aa('0x9c'):_0xb0a4e1=squel[_0x76aa('0x8e')]()[_0x76aa('0x8f')](_0x76aa('0x90'))[_0x76aa('0x91')](['phone',_0x76aa('0x93'),_0x76aa('0x94'),_0x76aa('0x95'),_0x76aa('0x51'),_0x76aa('0x49'),_0x76aa('0x48')],squel[_0x76aa('0x9d')]()[_0x76aa('0x74')](_0x76aa('0x92'),_0x76aa('0x92'))['field']('\x27'+_0x2b2f27+'\x27',_0x76aa('0x93'))[_0x76aa('0x74')]('id',_0x76aa('0x94'))['field'](_0x39de41['CmListId']['toString'](),_0x76aa('0x95'))[_0x76aa('0x74')](_0x4830ea['params']['id'][_0x76aa('0x96')](),'VoiceQueueId')['field']('\x27'+_0x2b2f27+'\x27',_0x76aa('0x49'))[_0x76aa('0x74')]('\x27'+_0x2b2f27+'\x27','updatedAt')[_0x76aa('0x76')](_0x76aa('0x97'))[_0x76aa('0x2d')]('deletedAt\x20IS\x20NULL')[_0x76aa('0x2d')](_0x76aa('0x9e'),_0x39de41[_0x76aa('0x9f')][_0x76aa('0x96')]())[_0x76aa('0x2d')](_0x76aa('0xa0'))[_0x76aa('0x2d')](_0x76aa('0x9a'),squel[_0x76aa('0x9d')]()[_0x76aa('0x74')](_0x76aa('0x9b'))['from'](_0x76aa('0x90'))[_0x76aa('0x2d')](_0x76aa('0x7a'),_0x4830ea['params']['id']['toString']())))[_0x76aa('0x96')]();break;default:_0xb0a4e1=squel[_0x76aa('0x8e')]()[_0x76aa('0x8f')]('cm_hopper')[_0x76aa('0x91')]([_0x76aa('0x92'),_0x76aa('0x93'),_0x76aa('0x94'),_0x76aa('0x95'),_0x76aa('0x51'),_0x76aa('0x49'),_0x76aa('0x48')],squel[_0x76aa('0x9d')]()[_0x76aa('0x74')](_0x76aa('0x92'),_0x76aa('0x92'))[_0x76aa('0x74')]('\x27'+_0x2b2f27+'\x27',_0x76aa('0x93'))['field']('id',_0x76aa('0x94'))['field'](_0x39de41[_0x76aa('0x9f')]['toString'](),_0x76aa('0x95'))[_0x76aa('0x74')](_0x4830ea[_0x76aa('0x46')]['id']['toString'](),_0x76aa('0x51'))[_0x76aa('0x74')]('\x27'+_0x2b2f27+'\x27',_0x76aa('0x49'))[_0x76aa('0x74')]('\x27'+_0x2b2f27+'\x27',_0x76aa('0x48'))[_0x76aa('0x76')]('cm_contacts')['where'](_0x76aa('0xa1'))[_0x76aa('0x2d')](_0x76aa('0x9e'),_0x39de41['CmListId']['toString']())[_0x76aa('0x2d')](_0x76aa('0xa0')))[_0x76aa('0x96')]();}_0x1f7f1d['push'](db['sequelize'][_0x76aa('0x33')](_0xb0a4e1));}return BPromise[_0x76aa('0x85')](_0x1f7f1d);}})[_0x76aa('0x17')](function(){var _0xbb19e4=[];var _0x226b44=squel[_0x76aa('0x8e')]()[_0x76aa('0x8f')](_0x76aa('0xa2'))['fromQuery']([_0x76aa('0xa3'),_0x76aa('0x92'),_0x76aa('0xa4'),'createdAt',_0x76aa('0x48')],squel[_0x76aa('0x9d')]()[_0x76aa('0x74')]('h.id')['field'](_0x76aa('0xa5'))['field'](_0x76aa('0xa6'))[_0x76aa('0x74')]('\x27'+_0x2b2f27+'\x27',_0x76aa('0x49'))[_0x76aa('0x74')]('\x27'+_0x2b2f27+'\x27','updatedAt')['from'](_0x76aa('0xa7'),'ci')[_0x76aa('0x78')](_0x76aa('0x90'),'h',_0x76aa('0xa8'))[_0x76aa('0x2d')](_0x76aa('0xa9'),_0x2b2f27)['where'](_0x76aa('0xaa'),_0x76aa('0xab')))[_0x76aa('0x96')]();_0xbb19e4['push'](db[_0x76aa('0x66')][_0x76aa('0x33')](_0x226b44));return BPromise[_0x76aa('0x85')](_0xbb19e4);})['then'](function(){return _0x1a5297;})[_0x76aa('0x17')](respondWithResult(_0x20638f,null))['catch'](handleError(_0x20638f,null));};exports['removeLists']=function(_0xef9ea7,_0x45f21f){return db[_0x76aa('0x29')]['find']({'where':{'id':_0xef9ea7[_0x76aa('0x46')]['id']}})['then'](handleEntityNotFound(_0x45f21f,null))[_0x76aa('0x17')](function(_0x113e70){if(_0x113e70){return _0x113e70['removeLists'](_0xef9ea7[_0x76aa('0x33')]['ids']);}})['then'](function(_0x583d68){if(_0x583d68){return db[_0x76aa('0x53')]['destroy']({'where':{'ListId':_0xef9ea7[_0x76aa('0x33')]['ids'],'VoiceQueueId':_0xef9ea7['params']['id']}})[_0x76aa('0x17')](function(){return _0x583d68;});}})['then'](respondWithStatusCode(_0x45f21f,null))['catch'](handleError(_0x45f21f,null));};exports[_0x76aa('0xac')]=function(_0x3b7370,_0x1c3431){var _0x865a1b={};var _0x132d60={};var _0x1a3074;var _0x3184a2;return db['VoiceQueue']['findOne']({'where':{'id':_0x3b7370[_0x76aa('0x46')]['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x1c3431,null))[_0x76aa('0x17')](function(_0x274356){if(_0x274356){_0x1a3074=_0x274356;_0x132d60[_0x76aa('0x31')]=_[_0x76aa('0x32')](db[_0x76aa('0xad')][_0x76aa('0x2a')]);_0x132d60[_0x76aa('0x33')]=_['keys'](_0x3b7370['query']);_0x132d60[_0x76aa('0x4c')]=_[_0x76aa('0x35')](_0x132d60[_0x76aa('0x31')],_0x132d60[_0x76aa('0x33')]);_0x865a1b['attributes']=_['intersection'](_0x132d60[_0x76aa('0x31')],qs['fields'](_0x3b7370[_0x76aa('0x33')][_0x76aa('0x36')]));_0x865a1b['attributes']=_0x865a1b[_0x76aa('0x34')][_0x76aa('0x37')]?_0x865a1b[_0x76aa('0x34')]:_0x132d60[_0x76aa('0x31')];_0x865a1b[_0x76aa('0x4e')]=qs['sort'](_0x3b7370[_0x76aa('0x33')][_0x76aa('0x4f')]);_0x865a1b['where']=qs['filters'](_[_0x76aa('0x50')](_0x3b7370[_0x76aa('0x33')],_0x132d60[_0x76aa('0x4c')]));if(_0x3b7370[_0x76aa('0x33')][_0x76aa('0x52')]){_0x865a1b[_0x76aa('0x2d')]=_[_0x76aa('0x39')](_0x865a1b[_0x76aa('0x2d')],{'$or':_[_0x76aa('0x1e')](_0x865a1b[_0x76aa('0x34')],function(_0xbb0ea3){var _0x4978dd={};_0x4978dd[_0xbb0ea3]={'$like':'%'+_0x3b7370[_0x76aa('0x33')][_0x76aa('0x52')]+'%'};return _0x4978dd;})});}_0x865a1b=_[_0x76aa('0x39')]({},_0x865a1b,_0x3b7370[_0x76aa('0x3a')]);return _0x1a3074['getBlackLists'](_0x865a1b);}})['then'](function(_0x4ee1d3){if(_0x4ee1d3){_0x3184a2=_0x4ee1d3['length'];if(!_0x3b7370[_0x76aa('0x33')][_0x76aa('0x58')](_0x76aa('0x4d'))){_0x865a1b[_0x76aa('0x12')]=qs[_0x76aa('0x12')](_0x3b7370[_0x76aa('0x33')][_0x76aa('0x12')]);_0x865a1b['offset']=qs['offset'](_0x3b7370[_0x76aa('0x33')]['offset']);}return _0x1a3074[_0x76aa('0xac')](_0x865a1b);}})[_0x76aa('0x17')](function(_0x3bc149){if(_0x3bc149){return _0x3bc149?{'count':_0x3184a2,'rows':_0x3bc149}:null;}})['then'](respondWithResult(_0x1c3431,null))[_0x76aa('0x3b')](handleError(_0x1c3431,null));};exports[_0x76aa('0xae')]=function(_0x29e112,_0x3fd683){var _0x5c2c4d;return db[_0x76aa('0x29')][_0x76aa('0x22')]({'where':{'id':_0x29e112[_0x76aa('0x46')]['id']}})['then'](handleEntityNotFound(_0x3fd683,null))[_0x76aa('0x17')](function(_0xcb041d){if(_0xcb041d){return _0xcb041d[_0x76aa('0xae')](_0x29e112[_0x76aa('0x3d')][_0x76aa('0x73')],_[_0x76aa('0x47')](_0x29e112[_0x76aa('0x3d')],['ids','id'])||{});}return null;})['spread'](function(_0x72b9a){var _0x29db0f;_0x5c2c4d=_0x72b9a||[];var _0x28a212=[];if(_0x72b9a){for(var _0x242cd6=0x0;_0x242cd6<_0x72b9a[_0x76aa('0x37')];_0x242cd6+=0x1){var _0xeb428a=_0x72b9a[_0x242cd6][_0x76aa('0x18')]({'plain':!![]});_0x29db0f=squel[_0x76aa('0x8e')]()[_0x76aa('0x8f')](_0x76aa('0xaf'))[_0x76aa('0x91')]([_0x76aa('0x92'),_0x76aa('0x94'),_0x76aa('0x95'),_0x76aa('0x51'),_0x76aa('0x49'),_0x76aa('0x48')],squel[_0x76aa('0x9d')]()[_0x76aa('0x74')](_0x76aa('0x92'),_0x76aa('0x92'))[_0x76aa('0x74')]('id',_0x76aa('0x94'))[_0x76aa('0x74')](_0xeb428a[_0x76aa('0x9f')][_0x76aa('0x96')](),_0x76aa('0x95'))[_0x76aa('0x74')](_0x29e112['params']['id'][_0x76aa('0x96')](),_0x76aa('0x51'))[_0x76aa('0x74')](_0x76aa('0xb0'),'createdAt')[_0x76aa('0x74')](_0x76aa('0xb0'),_0x76aa('0x48'))['from'](_0x76aa('0x97'))[_0x76aa('0x2d')]('deletedAt\x20IS\x20NULL')[_0x76aa('0x2d')]('ListId\x20=\x20?',_0xeb428a[_0x76aa('0x9f')][_0x76aa('0x96')]())[_0x76aa('0x2d')](_0x76aa('0xa0')))['toString']();_0x28a212[_0x76aa('0x7c')](db['sequelize'][_0x76aa('0x33')](_0x29db0f));}return BPromise['all'](_0x28a212);}})[_0x76aa('0x17')](function(){return _0x5c2c4d;})['then'](respondWithResult(_0x3fd683,null))[_0x76aa('0x3b')](handleError(_0x3fd683,null));};exports[_0x76aa('0xb1')]=function(_0x140ee1,_0x3d9e9e){return db[_0x76aa('0x29')][_0x76aa('0x22')]({'where':{'id':_0x140ee1['params']['id']}})[_0x76aa('0x17')](handleEntityNotFound(_0x3d9e9e,null))[_0x76aa('0x17')](function(_0x139e67){if(_0x139e67){return _0x139e67[_0x76aa('0xb1')](_0x140ee1['query'][_0x76aa('0x73')]);}})[_0x76aa('0x17')](function(_0x506cad){if(_0x506cad){return db['CmHopperBlack'][_0x76aa('0x25')]({'where':{'ListId':_0x140ee1[_0x76aa('0x33')][_0x76aa('0x73')],'VoiceQueueId':_0x140ee1[_0x76aa('0x46')]['id']}})['then'](function(){return _0x506cad;});}})['then'](respondWithStatusCode(_0x3d9e9e,null))[_0x76aa('0x3b')](handleError(_0x3d9e9e,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 07ec72a..073e6a5 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 _0xc27b=['../../mysqldb','VoiceQueue','setMaxListeners','hasOwnProperty','hook','exports','events'];(function(_0x49b180,_0x363be4){var _0x4acd80=function(_0x4de942){while(--_0x4de942){_0x49b180['push'](_0x49b180['shift']());}};_0x4acd80(++_0x363be4);}(_0xc27b,0x6f));var _0xbc27=function(_0xbb17f5,_0x41a5b0){_0xbb17f5=_0xbb17f5-0x0;var _0x5c632f=_0xc27b[_0xbb17f5];return _0x5c632f;};'use strict';var EventEmitter=require(_0xbc27('0x0'));var VoiceQueue=require(_0xbc27('0x1'))['db'][_0xbc27('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xbc27('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x18b08d){return function(_0x4cee16,_0x2065ca,_0x4f88a4){VoiceQueueEvents['emit'](_0x18b08d+':'+_0x4cee16['id'],_0x4cee16);VoiceQueueEvents['emit'](_0x18b08d,_0x4cee16);_0x4f88a4(null);};}for(var e in events){if(events[_0xbc27('0x4')](e)){var event=events[e];VoiceQueue[_0xbc27('0x5')](e,emitEvent(event));}}module[_0xbc27('0x6')]=VoiceQueueEvents; \ No newline at end of file +var _0x3f3b=['update','emit','hasOwnProperty','hook','exports','events','VoiceQueue','setMaxListeners','save'];(function(_0x5ea529,_0xb364a2){var _0x42c1af=function(_0xb57dfe){while(--_0xb57dfe){_0x5ea529['push'](_0x5ea529['shift']());}};_0x42c1af(++_0xb364a2);}(_0x3f3b,0x19a));var _0xb3f3=function(_0x5d3927,_0x5c2d5c){_0x5d3927=_0x5d3927-0x0;var _0x6974b8=_0x3f3b[_0x5d3927];return _0x6974b8;};'use strict';var EventEmitter=require(_0xb3f3('0x0'));var VoiceQueue=require('../../mysqldb')['db'][_0xb3f3('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xb3f3('0x2')](0x0);var events={'afterCreate':_0xb3f3('0x3'),'afterUpdate':_0xb3f3('0x4'),'afterDestroy':'remove'};function emitEvent(_0x235697){return function(_0xa2e7c4,_0x3649a5,_0xbad69e){VoiceQueueEvents[_0xb3f3('0x5')](_0x235697+':'+_0xa2e7c4['id'],_0xa2e7c4);VoiceQueueEvents['emit'](_0x235697,_0xa2e7c4);_0xbad69e(null);};}for(var e in events){if(events[_0xb3f3('0x6')](e)){var event=events[e];VoiceQueue[_0xb3f3('0x7')](e,emitEvent(event));}}module[_0xb3f3('0x8')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index f888a82..e9147be 100644 --- a/server/api/voiceQueue/voiceQueue.model.js +++ b/server/api/voiceQueue/voiceQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['voice_queues','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./voiceQueue.attributes'];(function(_0x48ac7f,_0xb8ec44){var _0x50a9b6=function(_0x46d1fa){while(--_0x46d1fa){_0x48ac7f['push'](_0x48ac7f['shift']());}};_0x50a9b6(++_0xb8ec44);}(_0x70e0,0x17b));var _0x070e=function(_0x4d9919,_0x4e7564){_0x4d9919=_0x4d9919-0x0;var _0x1ae850=_0x70e0[_0x4d9919];return _0x1ae850;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x070e('0x3'));var rp=require(_0x070e('0x4'));var fs=require('fs');var path=require(_0x070e('0x5'));var rimraf=require(_0x070e('0x6'));var config=require('../../config/environment');var attributes=require(_0x070e('0x7'));module['exports']=function(_0x46fe68,_0x4b041d){return _0x46fe68['define']('VoiceQueue',attributes,{'tableName':_0x070e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3e74=['exports','VoiceQueue','voice_queues','lodash','../../config/logger','api','moment','path','../../config/environment','./voiceQueue.attributes'];(function(_0x2e476a,_0x1c655d){var _0x188142=function(_0x4936ef){while(--_0x4936ef){_0x2e476a['push'](_0x2e476a['shift']());}};_0x188142(++_0x1c655d);}(_0x3e74,0x175));var _0x43e7=function(_0x16ca00,_0x714fc){_0x16ca00=_0x16ca00-0x0;var _0x3a033a=_0x3e74[_0x16ca00];return _0x3a033a;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index 15da120..d1b1648 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 _0x846f=['socket.io-emitter','redis','./voiceQueue.socket','register','request','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueue','VoiceQueue','options','raw','where','attributes','include','map','model','then','find','ShowVoiceQueue','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost'];(function(_0x2bcddb,_0x3eaf37){var _0x12a9e8=function(_0xeeb678){while(--_0xeeb678){_0x2bcddb['push'](_0x2bcddb['shift']());}};_0x12a9e8(++_0x3eaf37);}(_0x846f,0x1b6));var _0xf846=function(_0x3356f8,_0x556029){_0x3356f8=_0x3356f8-0x0;var _0x8b54c5=_0x846f[_0x3356f8];return _0x8b54c5;};'use strict';var _=require(_0xf846('0x0'));var util=require(_0xf846('0x1'));var moment=require(_0xf846('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf846('0x3'));var db=require(_0xf846('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf846('0x5'))(_0xf846('0x6'));var config=require(_0xf846('0x7'));var jayson=require(_0xf846('0x8'));var client=jayson[_0xf846('0x9')][_0xf846('0xa')]({'port':0x232a});config['redis']=_[_0xf846('0xb')](config['redis'],{'host':_0xf846('0xc'),'port':0x18eb});var socket=require(_0xf846('0xd'))(new Redis(config[_0xf846('0xe')]));require(_0xf846('0xf'))[_0xf846('0x10')](socket);function respondWithRpcPromise(_0x4b5231,_0x3d3b56,_0x3c9679){return new BPromise(function(_0x1c5deb,_0x1ae940){return client[_0xf846('0x11')](_0x4b5231,_0x3c9679)['then'](function(_0x2db684){logger[_0xf846('0x12')](_0xf846('0x13'),_0x3d3b56,_0xf846('0x14'));logger[_0xf846('0x15')](_0xf846('0x16'),_0x3d3b56,_0xf846('0x14'),JSON[_0xf846('0x17')](_0x2db684));if(_0x2db684[_0xf846('0x18')]){if(_0x2db684[_0xf846('0x18')][_0xf846('0x19')]===0x1f4){logger[_0xf846('0x18')](_0xf846('0x13'),_0x3d3b56,_0x2db684[_0xf846('0x18')]['message']);return _0x1ae940(_0x2db684[_0xf846('0x18')]['message']);}logger[_0xf846('0x18')](_0xf846('0x13'),_0x3d3b56,_0x2db684[_0xf846('0x18')][_0xf846('0x1a')]);return _0x1c5deb(_0x2db684['error'][_0xf846('0x1a')]);}else{logger[_0xf846('0x12')](_0xf846('0x13'),_0x3d3b56,_0xf846('0x14'));_0x1c5deb(_0x2db684[_0xf846('0x1b')]['message']);}})[_0xf846('0x1c')](function(_0x1c4ed1){logger['error']('VoiceQueue,\x20%s,\x20%s',_0x3d3b56,_0x1c4ed1);_0x1ae940(_0x1c4ed1);});});}exports[_0xf846('0x1d')]=function(_0x41b198){var _0x4aa648=this;return new Promise(function(_0x35b472,_0x1acafd){return db[_0xf846('0x1e')]['findAll']({'raw':_0x41b198['options']?_0x41b198[_0xf846('0x1f')][_0xf846('0x20')]===undefined?!![]:![]:!![],'where':_0x41b198[_0xf846('0x1f')]?_0x41b198[_0xf846('0x1f')][_0xf846('0x21')]||null:null,'attributes':_0x41b198[_0xf846('0x1f')]?_0x41b198['options'][_0xf846('0x22')]||null:null,'limit':_0x41b198['options']?_0x41b198['options']['limit']||null:null,'include':_0x41b198[_0xf846('0x1f')]?_0x41b198[_0xf846('0x1f')][_0xf846('0x23')]?_['map'](_0x41b198[_0xf846('0x1f')]['include'],function(_0x3eb8f0){return{'model':db[_0x3eb8f0['model']],'as':_0x3eb8f0['as'],'attributes':_0x3eb8f0[_0xf846('0x22')],'include':_0x3eb8f0[_0xf846('0x23')]?_[_0xf846('0x24')](_0x3eb8f0['include'],function(_0x5efca1){return{'model':db[_0x5efca1[_0xf846('0x25')]],'as':_0x5efca1['as'],'attributes':_0x5efca1[_0xf846('0x22')],'include':_0x5efca1[_0xf846('0x23')]?_[_0xf846('0x24')](_0x5efca1[_0xf846('0x23')],function(_0x232bdb){return{'model':db[_0x232bdb[_0xf846('0x25')]],'as':_0x232bdb['as'],'attributes':_0x232bdb['attributes']};}):[]};}):[]};}):[]:[]})[_0xf846('0x26')](function(_0x1ccbee){logger[_0xf846('0x12')]('GetVoiceQueue',_0x41b198);logger['debug']('GetVoiceQueue',_0x41b198,JSON['stringify'](_0x1ccbee));_0x35b472(_0x1ccbee);})[_0xf846('0x1c')](function(_0x5921f0){logger[_0xf846('0x18')](_0xf846('0x1d'),_0x5921f0[_0xf846('0x1a')],_0x41b198);_0x1acafd(_0x4aa648['error'](0x1f4,_0x5921f0[_0xf846('0x1a')]));});});};exports['ShowVoiceQueue']=function(_0x20f692){var _0x26babd=this;return new Promise(function(_0x10641e,_0x4d286b){return db['VoiceQueue'][_0xf846('0x27')]({'raw':_0x20f692['options']?_0x20f692['options']['raw']===undefined?!![]:![]:!![],'where':_0x20f692[_0xf846('0x1f')]?_0x20f692['options']['where']||null:null,'attributes':_0x20f692['options']?_0x20f692[_0xf846('0x1f')][_0xf846('0x22')]||null:null,'include':_0x20f692[_0xf846('0x1f')]?_0x20f692[_0xf846('0x1f')][_0xf846('0x23')]?_[_0xf846('0x24')](_0x20f692['options']['include'],function(_0x1598e8){return{'model':db[_0x1598e8['model']],'as':_0x1598e8['as'],'attributes':_0x1598e8['attributes'],'include':_0x1598e8[_0xf846('0x23')]?_[_0xf846('0x24')](_0x1598e8[_0xf846('0x23')],function(_0x2a0b87){return{'model':db[_0x2a0b87[_0xf846('0x25')]],'as':_0x2a0b87['as'],'attributes':_0x2a0b87[_0xf846('0x22')],'include':_0x2a0b87[_0xf846('0x23')]?_['map'](_0x2a0b87[_0xf846('0x23')],function(_0x5bafab){return{'model':db[_0x5bafab['model']],'as':_0x5bafab['as'],'attributes':_0x5bafab[_0xf846('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23c1e0){logger[_0xf846('0x12')](_0xf846('0x28'),_0x20f692);logger['debug'](_0xf846('0x28'),_0x20f692,JSON[_0xf846('0x17')](_0x23c1e0));_0x10641e(_0x23c1e0);})[_0xf846('0x1c')](function(_0x5956bd){logger['error'](_0xf846('0x28'),_0x5956bd[_0xf846('0x1a')],_0x20f692);_0x4d286b(_0x26babd['error'](0x1f4,_0x5956bd['message']));});});}; \ No newline at end of file +var _0xb1e4=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','defaults','localhost','socket.io-emitter','redis','./voiceQueue.socket','register','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueue','VoiceQueue','options','raw','where','attributes','limit','include','map','model','find','ShowVoiceQueue','lodash','util','moment'];(function(_0x4d56f3,_0x1d0787){var _0x1a8ce8=function(_0x4b7475){while(--_0x4b7475){_0x4d56f3['push'](_0x4d56f3['shift']());}};_0x1a8ce8(++_0x1d0787);}(_0xb1e4,0x12a));var _0x4b1e=function(_0x1580d4,_0x1640d6){_0x1580d4=_0x1580d4-0x0;var _0x5db7c0=_0xb1e4[_0x1580d4];return _0x5db7c0;};'use strict';var _=require(_0x4b1e('0x0'));var util=require(_0x4b1e('0x1'));var moment=require(_0x4b1e('0x2'));var BPromise=require(_0x4b1e('0x3'));var rs=require(_0x4b1e('0x4'));var fs=require('fs');var Redis=require(_0x4b1e('0x5'));var db=require(_0x4b1e('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x4b1e('0x7'))(_0x4b1e('0x8'));var config=require(_0x4b1e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x4b1e('0xa')][_0x4b1e('0xb')]({'port':0x232a});config['redis']=_[_0x4b1e('0xc')](config['redis'],{'host':_0x4b1e('0xd'),'port':0x18eb});var socket=require(_0x4b1e('0xe'))(new Redis(config[_0x4b1e('0xf')]));require(_0x4b1e('0x10'))[_0x4b1e('0x11')](socket);function respondWithRpcPromise(_0x5f42e5,_0x47ba5a,_0x321f4e){return new BPromise(function(_0x290775,_0x1f78f8){return client[_0x4b1e('0x12')](_0x5f42e5,_0x321f4e)[_0x4b1e('0x13')](function(_0x222a3f){logger[_0x4b1e('0x14')](_0x4b1e('0x15'),_0x47ba5a,_0x4b1e('0x16'));logger[_0x4b1e('0x17')](_0x4b1e('0x18'),_0x47ba5a,_0x4b1e('0x16'),JSON[_0x4b1e('0x19')](_0x222a3f));if(_0x222a3f[_0x4b1e('0x1a')]){if(_0x222a3f[_0x4b1e('0x1a')][_0x4b1e('0x1b')]===0x1f4){logger[_0x4b1e('0x1a')](_0x4b1e('0x15'),_0x47ba5a,_0x222a3f[_0x4b1e('0x1a')][_0x4b1e('0x1c')]);return _0x1f78f8(_0x222a3f[_0x4b1e('0x1a')][_0x4b1e('0x1c')]);}logger[_0x4b1e('0x1a')](_0x4b1e('0x15'),_0x47ba5a,_0x222a3f['error']['message']);return _0x290775(_0x222a3f['error'][_0x4b1e('0x1c')]);}else{logger[_0x4b1e('0x14')]('VoiceQueue,\x20%s,\x20%s',_0x47ba5a,'request\x20sent');_0x290775(_0x222a3f[_0x4b1e('0x1d')][_0x4b1e('0x1c')]);}})[_0x4b1e('0x1e')](function(_0x3ebad5){logger[_0x4b1e('0x1a')]('VoiceQueue,\x20%s,\x20%s',_0x47ba5a,_0x3ebad5);_0x1f78f8(_0x3ebad5);});});}exports[_0x4b1e('0x1f')]=function(_0x5b94f4){var _0x12f052=this;return new Promise(function(_0x1b242c,_0x5a3b19){return db[_0x4b1e('0x20')]['findAll']({'raw':_0x5b94f4[_0x4b1e('0x21')]?_0x5b94f4[_0x4b1e('0x21')][_0x4b1e('0x22')]===undefined?!![]:![]:!![],'where':_0x5b94f4[_0x4b1e('0x21')]?_0x5b94f4[_0x4b1e('0x21')][_0x4b1e('0x23')]||null:null,'attributes':_0x5b94f4[_0x4b1e('0x21')]?_0x5b94f4[_0x4b1e('0x21')][_0x4b1e('0x24')]||null:null,'limit':_0x5b94f4[_0x4b1e('0x21')]?_0x5b94f4[_0x4b1e('0x21')][_0x4b1e('0x25')]||null:null,'include':_0x5b94f4[_0x4b1e('0x21')]?_0x5b94f4[_0x4b1e('0x21')][_0x4b1e('0x26')]?_[_0x4b1e('0x27')](_0x5b94f4['options']['include'],function(_0x58b798){return{'model':db[_0x58b798[_0x4b1e('0x28')]],'as':_0x58b798['as'],'attributes':_0x58b798[_0x4b1e('0x24')],'include':_0x58b798['include']?_[_0x4b1e('0x27')](_0x58b798[_0x4b1e('0x26')],function(_0x2158ec){return{'model':db[_0x2158ec['model']],'as':_0x2158ec['as'],'attributes':_0x2158ec[_0x4b1e('0x24')],'include':_0x2158ec['include']?_['map'](_0x2158ec['include'],function(_0x3fb081){return{'model':db[_0x3fb081[_0x4b1e('0x28')]],'as':_0x3fb081['as'],'attributes':_0x3fb081[_0x4b1e('0x24')]};}):[]};}):[]};}):[]:[]})[_0x4b1e('0x13')](function(_0x156089){logger[_0x4b1e('0x14')](_0x4b1e('0x1f'),_0x5b94f4);logger[_0x4b1e('0x17')]('GetVoiceQueue',_0x5b94f4,JSON['stringify'](_0x156089));_0x1b242c(_0x156089);})[_0x4b1e('0x1e')](function(_0x5d9e34){logger[_0x4b1e('0x1a')](_0x4b1e('0x1f'),_0x5d9e34[_0x4b1e('0x1c')],_0x5b94f4);_0x5a3b19(_0x12f052['error'](0x1f4,_0x5d9e34['message']));});});};exports['ShowVoiceQueue']=function(_0x187fac){var _0x2e7bcc=this;return new Promise(function(_0x13d8bc,_0x28b82c){return db[_0x4b1e('0x20')][_0x4b1e('0x29')]({'raw':_0x187fac['options']?_0x187fac[_0x4b1e('0x21')]['raw']===undefined?!![]:![]:!![],'where':_0x187fac[_0x4b1e('0x21')]?_0x187fac[_0x4b1e('0x21')][_0x4b1e('0x23')]||null:null,'attributes':_0x187fac[_0x4b1e('0x21')]?_0x187fac[_0x4b1e('0x21')][_0x4b1e('0x24')]||null:null,'include':_0x187fac[_0x4b1e('0x21')]?_0x187fac[_0x4b1e('0x21')][_0x4b1e('0x26')]?_['map'](_0x187fac[_0x4b1e('0x21')][_0x4b1e('0x26')],function(_0x209a40){return{'model':db[_0x209a40['model']],'as':_0x209a40['as'],'attributes':_0x209a40[_0x4b1e('0x24')],'include':_0x209a40['include']?_['map'](_0x209a40[_0x4b1e('0x26')],function(_0x27bfd8){return{'model':db[_0x27bfd8[_0x4b1e('0x28')]],'as':_0x27bfd8['as'],'attributes':_0x27bfd8['attributes'],'include':_0x27bfd8[_0x4b1e('0x26')]?_[_0x4b1e('0x27')](_0x27bfd8[_0x4b1e('0x26')],function(_0x5a2bd8){return{'model':db[_0x5a2bd8[_0x4b1e('0x28')]],'as':_0x5a2bd8['as'],'attributes':_0x5a2bd8[_0x4b1e('0x24')]};}):[]};}):[]};}):[]:[]})[_0x4b1e('0x13')](function(_0x16dd7e){logger['info'](_0x4b1e('0x2a'),_0x187fac);logger[_0x4b1e('0x17')](_0x4b1e('0x2a'),_0x187fac,JSON['stringify'](_0x16dd7e));_0x13d8bc(_0x16dd7e);})[_0x4b1e('0x1e')](function(_0x94c8f2){logger['error'](_0x4b1e('0x2a'),_0x94c8f2[_0x4b1e('0x1c')],_0x187fac);_0x28b82c(_0x2e7bcc['error'](0x1f4,_0x94c8f2['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 36b2d1b..a67e2e3 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 _0xe921=['update','removeListener','register','save','remove'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe921,0xf8));var _0x1e92=function(_0x4109f2,_0x42b196){_0x4109f2=_0x4109f2-0x0;var _0x513249=_0xe921[_0x4109f2];return _0x513249;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0x1e92('0x0'),_0x1e92('0x1'),_0x1e92('0x2')];function createListener(_0x599b74,_0x45b9b5){return function(_0x50bffe){_0x45b9b5['emit'](_0x599b74,_0x50bffe);};}function removeListener(_0x8e420a,_0x2f0431){return function(){VoiceQueueEvents[_0x1e92('0x3')](_0x8e420a,_0x2f0431);};}exports[_0x1e92('0x4')]=function(_0x18236c){for(var _0x4dba9b=0x0,_0x39b655=events['length'];_0x4dba9b<_0x39b655;_0x4dba9b++){var _0x37f33e=events[_0x4dba9b];var _0x5086ea=createListener('voiceQueue:'+_0x37f33e,_0x18236c);VoiceQueueEvents['on'](_0x37f33e,_0x5086ea);}}; \ No newline at end of file +var _0x8097=['voiceQueue:','./voiceQueue.events','save','remove'];(function(_0x53b4b1,_0x2dd3ab){var _0x2277a5=function(_0x3c9ee6){while(--_0x3c9ee6){_0x53b4b1['push'](_0x53b4b1['shift']());}};_0x2277a5(++_0x2dd3ab);}(_0x8097,0x125));var _0x7809=function(_0x52c413,_0x5e47ec){_0x52c413=_0x52c413-0x0;var _0x1ae7d8=_0x8097[_0x52c413];return _0x1ae7d8;};'use strict';var VoiceQueueEvents=require(_0x7809('0x0'));var events=[_0x7809('0x1'),_0x7809('0x2'),'update'];function createListener(_0x522659,_0x22fb33){return function(_0x28e728){_0x22fb33['emit'](_0x522659,_0x28e728);};}function removeListener(_0x31b574,_0x2a1046){return function(){VoiceQueueEvents['removeListener'](_0x31b574,_0x2a1046);};}exports['register']=function(_0x2b2645){for(var _0x572d5a=0x0,_0x5064cf=events['length'];_0x572d5a<_0x5064cf;_0x572d5a++){var _0x5307c5=events[_0x572d5a];var _0x57a11f=createListener(_0x7809('0x3')+_0x5307c5,_0x2b2645);VoiceQueueEvents['on'](_0x5307c5,_0x57a11f);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 1622d59..9b8835d 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 _0xca13=['/describe','describe','/index','getVoiceQueuesReport','show','create','update','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated'];(function(_0x25bca6,_0xe415ea){var _0x3f8d02=function(_0x3e581b){while(--_0x3e581b){_0x25bca6['push'](_0x25bca6['shift']());}};_0x3f8d02(++_0xe415ea);}(_0xca13,0xd9));var _0x3ca1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xca13[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x3ca1('0x0'));var util=require(_0x3ca1('0x1'));var path=require(_0x3ca1('0x2'));var timeout=require(_0x3ca1('0x3'));var express=require(_0x3ca1('0x4'));var router=express[_0x3ca1('0x5')]();var fs_extra=require(_0x3ca1('0x6'));var auth=require(_0x3ca1('0x7'));var interaction=require(_0x3ca1('0x8'));var config=require(_0x3ca1('0x9'));var controller=require(_0x3ca1('0xa'));router[_0x3ca1('0xb')]('/',auth[_0x3ca1('0xc')](),controller['index']);router[_0x3ca1('0xb')](_0x3ca1('0xd'),auth[_0x3ca1('0xc')](),controller[_0x3ca1('0xe')]);router[_0x3ca1('0xb')](_0x3ca1('0xf'),auth[_0x3ca1('0xc')](),controller[_0x3ca1('0x10')]);router['get']('/:id',auth[_0x3ca1('0xc')](),controller[_0x3ca1('0x11')]);router['post']('/',auth[_0x3ca1('0xc')](),controller[_0x3ca1('0x12')]);router['put']('/:id',auth[_0x3ca1('0xc')](),controller[_0x3ca1('0x13')]);router['delete'](_0x3ca1('0x14'),auth[_0x3ca1('0xc')](),controller[_0x3ca1('0x15')]);module[_0x3ca1('0x16')]=router; \ No newline at end of file +var _0xf8bd=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/index','getVoiceQueuesReport','show','post','create','put','update','delete','/:id','destroy','exports','multer'];(function(_0x22838c,_0x4ff22c){var _0xfcead3=function(_0x1c6f60){while(--_0x1c6f60){_0x22838c['push'](_0x22838c['shift']());}};_0xfcead3(++_0x4ff22c);}(_0xf8bd,0x1cb));var _0xdf8b=function(_0x284318,_0xd1ce42){_0x284318=_0x284318-0x0;var _0x2682f5=_0xf8bd[_0x284318];return _0x2682f5;};'use strict';var multer=require(_0xdf8b('0x0'));var util=require('util');var path=require(_0xdf8b('0x1'));var timeout=require(_0xdf8b('0x2'));var express=require(_0xdf8b('0x3'));var router=express[_0xdf8b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xdf8b('0x5'));var interaction=require(_0xdf8b('0x6'));var config=require('../../config/environment');var controller=require('./voiceQueueReport.controller');router[_0xdf8b('0x7')]('/',auth[_0xdf8b('0x8')](),controller[_0xdf8b('0x9')]);router[_0xdf8b('0x7')](_0xdf8b('0xa'),auth['isAuthenticated'](),controller[_0xdf8b('0xb')]);router[_0xdf8b('0x7')](_0xdf8b('0xc'),auth[_0xdf8b('0x8')](),controller[_0xdf8b('0xd')]);router[_0xdf8b('0x7')]('/:id',auth[_0xdf8b('0x8')](),controller[_0xdf8b('0xe')]);router[_0xdf8b('0xf')]('/',auth[_0xdf8b('0x8')](),controller[_0xdf8b('0x10')]);router[_0xdf8b('0x11')]('/:id',auth[_0xdf8b('0x8')](),controller[_0xdf8b('0x12')]);router[_0xdf8b('0x13')](_0xdf8b('0x14'),auth[_0xdf8b('0x8')](),controller[_0xdf8b('0x15')]);module[_0xdf8b('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 60e0d6d..99c7d38 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 _0x5d2c=['format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','sequelize','moment','exports','STRING','DATE'];(function(_0x2e76a7,_0x23871a){var _0x454cde=function(_0x51724d){while(--_0x51724d){_0x2e76a7['push'](_0x2e76a7['shift']());}};_0x454cde(++_0x23871a);}(_0x5d2c,0x19f));var _0xc5d2=function(_0x1105f9,_0x51faca){_0x1105f9=_0x1105f9-0x0;var _0x568d5f=_0x5d2c[_0x1105f9];return _0x568d5f;};'use strict';var Sequelize=require(_0xc5d2('0x0'));var moment=require(_0xc5d2('0x1'));module[_0xc5d2('0x2')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xc5d2('0x3')]},'calleridname':{'type':Sequelize[_0xc5d2('0x3')]},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize[_0xc5d2('0x4')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x317828){var _0x353785=moment(_0x317828);var _0x557a59=moment(this['getDataValue']('queuecallerjoinAt'))[_0xc5d2('0x5')](_0xc5d2('0x6'));var _0x5a3efd=_0x353785[_0xc5d2('0x7')](_0x557a59,_0xc5d2('0x8'));this[_0xc5d2('0x9')](_0xc5d2('0xa'),_0x317828);this['setDataValue'](_0xc5d2('0xb'),_0x5a3efd||null);}},'position':{'type':Sequelize[_0xc5d2('0xc')]},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0xc5d2('0xd')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xc5d2('0x4')]},'queuecallercomplete':{'type':Sequelize[_0xc5d2('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize[_0xc5d2('0xd')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xc5d2('0x4')]},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':_0xc5d2('0xe')},'originalposition':{'type':Sequelize[_0xc5d2('0xc')]},'channel':{'type':Sequelize[_0xc5d2('0x3')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xc5d2('0x3')]},'accountcode':{'type':Sequelize[_0xc5d2('0x3')]},'context':{'type':Sequelize[_0xc5d2('0x3')]},'exten':{'type':Sequelize[_0xc5d2('0x3')]},'priority':{'type':Sequelize[_0xc5d2('0x3')]},'holdtime':{'type':Sequelize[_0xc5d2('0xc')]},'mohtime':{'type':Sequelize[_0xc5d2('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xc5d2('0xd')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0xc5d2('0xd')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xc5d2('0x3')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0xc5d2('0x3')]},'disposition':{'type':Sequelize[_0xc5d2('0x3')]},'secondDisposition':{'type':Sequelize[_0xc5d2('0x3')]},'thirdDisposition':{'type':Sequelize[_0xc5d2('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0xc5d2('0xc')],'defaultValue':0x0},'note':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xbdc7=['FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xbdc7,0x1dd));var _0x7bdc=function(_0x3bd482,_0x2c74ef){_0x3bd482=_0x3bd482-0x0;var _0x419e7c=_0xbdc7[_0x3bd482];return _0x419e7c;};'use strict';var Sequelize=require(_0x7bdc('0x0'));var moment=require(_0x7bdc('0x1'));module[_0x7bdc('0x2')]={'type':{'type':Sequelize[_0x7bdc('0x3')]},'uniqueid':{'type':Sequelize[_0x7bdc('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x7bdc('0x3')]},'queue':{'type':Sequelize[_0x7bdc('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0x7bdc('0x4')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x2bf438){var _0x59f41c=moment(_0x2bf438);var _0x8d3dee=moment(this['getDataValue'](_0x7bdc('0x5')))[_0x7bdc('0x6')](_0x7bdc('0x7'));var _0x46bc04=_0x59f41c[_0x7bdc('0x8')](_0x8d3dee,_0x7bdc('0x9'));this[_0x7bdc('0xa')](_0x7bdc('0xb'),_0x2bf438);this['setDataValue'](_0x7bdc('0xc'),_0x46bc04||null);}},'position':{'type':Sequelize[_0x7bdc('0xd')]},'count':{'type':Sequelize[_0x7bdc('0xd')]},'queuecallerabandon':{'type':Sequelize[_0x7bdc('0xe')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x7bdc('0x4')]},'queuecallercomplete':{'type':Sequelize[_0x7bdc('0xe')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x7bdc('0x4')]},'queuecallerexit':{'type':Sequelize[_0x7bdc('0xe')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x7bdc('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0x7bdc('0x3')],'comment':_0x7bdc('0xf')},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x7bdc('0x3')]},'accountcode':{'type':Sequelize[_0x7bdc('0x3')]},'context':{'type':Sequelize[_0x7bdc('0x3')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x7bdc('0x3')]},'holdtime':{'type':Sequelize[_0x7bdc('0xd')]},'mohtime':{'type':Sequelize[_0x7bdc('0xd')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x7bdc('0x3')]},'transfer':{'type':Sequelize[_0x7bdc('0xe')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x7bdc('0x3')],'comment':_0x7bdc('0x10')},'transferexten':{'type':Sequelize[_0x7bdc('0x3')]},'transferuniqueid':{'type':Sequelize[_0x7bdc('0x3')]},'disposition':{'type':Sequelize[_0x7bdc('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x7bdc('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0x7bdc('0xd')],'defaultValue':0x0},'note':{'type':Sequelize[_0x7bdc('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index db5bd24..69087e8 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 _0x0478=['reject','update','destroy','then','sendStatus','error','stack','name','send','index','map','VoiceQueueReport','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','filter','includeAll','include','catch','show','keys','length','options','find','create','body','params','getVoiceQueuesReport','findAll','rows','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','defaults','socket.io-emitter','redis','status','end','json','limit','count','offset','set','apply'];(function(_0x2d57a9,_0x5ae060){var _0x1b9671=function(_0x95fb4e){while(--_0x95fb4e){_0x2d57a9['push'](_0x2d57a9['shift']());}};_0x1b9671(++_0x5ae060);}(_0x0478,0x1a6));var _0x8047=function(_0x45d6f9,_0x443787){_0x45d6f9=_0x45d6f9-0x0;var _0x3b7316=_0x0478[_0x45d6f9];return _0x3b7316;};'use strict';var emlformat=require(_0x8047('0x0'));var rimraf=require(_0x8047('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8047('0x2'));var rp=require('request-promise');var moment=require(_0x8047('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x8047('0x4'));var util=require(_0x8047('0x5'));var path=require(_0x8047('0x6'));var sox=require(_0x8047('0x7'));var csv=require(_0x8047('0x8'));var ejs=require(_0x8047('0x9'));var fs=require('fs');var fs_extra=require(_0x8047('0xa'));var _=require(_0x8047('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8047('0xc'));var deskjs=require(_0x8047('0xd'));var toCsv=require(_0x8047('0x8'));var querystring=require(_0x8047('0xe'));var Papa=require(_0x8047('0xf'));var Redis=require(_0x8047('0x10'));var authService=require(_0x8047('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x8047('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8047('0x13'))(_0x8047('0x14'));var utils=require('../../config/utils');var config=require(_0x8047('0x15'));var licenseUtil=require(_0x8047('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x8047('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x8047('0x18'))(new Redis(config[_0x8047('0x19')]));require('./voiceQueueReport.socket')['register'](socket);function respondWithStatusCode(_0x487418,_0x573165){_0x573165=_0x573165||0xcc;return function(_0x4ec018){if(_0x4ec018){return _0x487418['sendStatus'](_0x573165);}return _0x487418[_0x8047('0x1a')](_0x573165)[_0x8047('0x1b')]();};}function respondWithResult(_0x4b3899,_0x3b5744){_0x3b5744=_0x3b5744||0xc8;return function(_0x2b3f38){if(_0x2b3f38){return _0x4b3899[_0x8047('0x1a')](_0x3b5744)[_0x8047('0x1c')](_0x2b3f38);}};}function respondWithFilteredResult(_0x2e4968,_0x227688){return function(_0x19f3f1){if(_0x19f3f1){var _0x28e3d7=typeof _0x227688['offset']==='undefined'&&typeof _0x227688[_0x8047('0x1d')]==='undefined';var _0x5c4fd5=_0x19f3f1[_0x8047('0x1e')];var _0x4df646=_0x28e3d7?0x0:_0x227688[_0x8047('0x1f')];var _0x58c694=_0x28e3d7?_0x19f3f1[_0x8047('0x1e')]:_0x227688[_0x8047('0x1f')]+_0x227688[_0x8047('0x1d')];var _0x2e132b;if(_0x58c694>=_0x5c4fd5){_0x58c694=_0x5c4fd5;_0x2e132b=0xc8;}else{_0x2e132b=0xce;}_0x2e4968[_0x8047('0x1a')](_0x2e132b);return _0x2e4968[_0x8047('0x20')]('Content-Range',_0x4df646+'-'+_0x58c694+'/'+_0x5c4fd5)[_0x8047('0x1c')](_0x19f3f1);}return null;};}function patchUpdates(_0x1fca08){return function(_0x52e7c6){try{jsonpatch[_0x8047('0x21')](_0x52e7c6,_0x1fca08,!![]);}catch(_0x3bdfd2){return BPromise[_0x8047('0x22')](_0x3bdfd2);}return _0x52e7c6['save']();};}function saveUpdates(_0x6c25b2,_0x8aa727){return function(_0x119730){if(_0x119730){return _0x119730[_0x8047('0x23')](_0x6c25b2)['then'](function(_0x51bcec){return _0x51bcec;});}return null;};}function removeEntity(_0x5a45bf,_0x1a4544){return function(_0x1db4cc){if(_0x1db4cc){return _0x1db4cc[_0x8047('0x24')]()[_0x8047('0x25')](function(){_0x5a45bf[_0x8047('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x49ecb7,_0x4d6968){return function(_0x5a8ec8){if(!_0x5a8ec8){_0x49ecb7[_0x8047('0x26')](0x194);}return _0x5a8ec8;};}function handleError(_0x52260b,_0x5c41bb){_0x5c41bb=_0x5c41bb||0x1f4;return function(_0x20a9fd){logger[_0x8047('0x27')](_0x20a9fd[_0x8047('0x28')]);if(_0x20a9fd[_0x8047('0x29')]){delete _0x20a9fd['name'];}_0x52260b[_0x8047('0x1a')](_0x5c41bb)[_0x8047('0x2a')](_0x20a9fd);};}exports[_0x8047('0x2b')]=function(_0x4b5456,_0xb392f2){var _0x1fe83a={},_0x577e62={},_0x4d5bdf={'count':0x0,'rows':[]};var _0x24ac5c=_[_0x8047('0x2c')](db[_0x8047('0x2d')][_0x8047('0x2e')],function(_0x473a00){return{'name':_0x473a00['fieldName'],'type':_0x473a00[_0x8047('0x2f')][_0x8047('0x30')]};});_0x577e62[_0x8047('0x31')]=_[_0x8047('0x2c')](_0x24ac5c,_0x8047('0x29'));_0x577e62['query']=_['keys'](_0x4b5456[_0x8047('0x32')]);_0x577e62[_0x8047('0x33')]=_[_0x8047('0x34')](_0x577e62['model'],_0x577e62['query']);_0x1fe83a[_0x8047('0x35')]=_[_0x8047('0x34')](_0x577e62[_0x8047('0x31')],qs[_0x8047('0x36')](_0x4b5456[_0x8047('0x32')]['fields']));_0x1fe83a[_0x8047('0x35')]=_0x1fe83a[_0x8047('0x35')]['length']?_0x1fe83a['attributes']:_0x577e62[_0x8047('0x31')];if(!_0x4b5456['query'][_0x8047('0x37')](_0x8047('0x38'))){_0x1fe83a[_0x8047('0x1d')]=qs['limit'](_0x4b5456[_0x8047('0x32')][_0x8047('0x1d')]);_0x1fe83a[_0x8047('0x1f')]=qs[_0x8047('0x1f')](_0x4b5456[_0x8047('0x32')]['offset']);}_0x1fe83a['order']=qs['sort'](_0x4b5456[_0x8047('0x32')][_0x8047('0x39')]);_0x1fe83a[_0x8047('0x3a')]=qs[_0x8047('0x33')](_['pick'](_0x4b5456[_0x8047('0x32')],_0x577e62['filters']),_0x24ac5c);if(_0x4b5456['query']['filter']){_0x1fe83a[_0x8047('0x3a')]=_[_0x8047('0x3b')](_0x1fe83a[_0x8047('0x3a')],{'$or':_[_0x8047('0x2c')](_0x24ac5c,function(_0x444fc0){if(_0x444fc0[_0x8047('0x2f')]!==_0x8047('0x3c')){var _0x3afa52={};_0x3afa52[_0x444fc0[_0x8047('0x29')]]={'$like':'%'+_0x4b5456[_0x8047('0x32')][_0x8047('0x3d')]+'%'};return _0x3afa52;}})});}_0x1fe83a=_[_0x8047('0x3b')]({},_0x1fe83a,_0x4b5456['options']);var _0x33ea16={'where':_0x1fe83a['where']};return db[_0x8047('0x2d')][_0x8047('0x1e')](_0x33ea16)['then'](function(_0x25910f){_0x4d5bdf[_0x8047('0x1e')]=_0x25910f;if(_0x4b5456[_0x8047('0x32')][_0x8047('0x3e')]){_0x1fe83a[_0x8047('0x3f')]=[{'all':!![]}];}return db[_0x8047('0x2d')]['findAll'](_0x1fe83a);})[_0x8047('0x25')](function(_0x40c057){_0x4d5bdf['rows']=_0x40c057;return _0x4d5bdf;})[_0x8047('0x25')](respondWithFilteredResult(_0xb392f2,_0x1fe83a))[_0x8047('0x40')](handleError(_0xb392f2,null));};exports[_0x8047('0x41')]=function(_0x5adfd0,_0x405559){var _0x104dff={'raw':![],'where':{'id':_0x5adfd0['params']['id']}},_0x523a85={};_0x523a85[_0x8047('0x31')]=_[_0x8047('0x42')](db['VoiceQueueReport'][_0x8047('0x2e')]);_0x523a85[_0x8047('0x32')]=_['keys'](_0x5adfd0[_0x8047('0x32')]);_0x523a85[_0x8047('0x33')]=_['intersection'](_0x523a85[_0x8047('0x31')],_0x523a85[_0x8047('0x32')]);_0x104dff[_0x8047('0x35')]=_[_0x8047('0x34')](_0x523a85[_0x8047('0x31')],qs[_0x8047('0x36')](_0x5adfd0[_0x8047('0x32')][_0x8047('0x36')]));_0x104dff['attributes']=_0x104dff[_0x8047('0x35')][_0x8047('0x43')]?_0x104dff[_0x8047('0x35')]:_0x523a85[_0x8047('0x31')];if(_0x5adfd0[_0x8047('0x32')][_0x8047('0x3e')]){_0x104dff[_0x8047('0x3f')]=[{'all':!![]}];}_0x104dff=_[_0x8047('0x3b')]({},_0x104dff,_0x5adfd0[_0x8047('0x44')]);return db['VoiceQueueReport'][_0x8047('0x45')](_0x104dff)[_0x8047('0x25')](handleEntityNotFound(_0x405559,null))[_0x8047('0x25')](respondWithResult(_0x405559,null))[_0x8047('0x40')](handleError(_0x405559,null));};exports[_0x8047('0x46')]=function(_0x327522,_0x581ef1){return db[_0x8047('0x2d')][_0x8047('0x46')](_0x327522[_0x8047('0x47')],{})[_0x8047('0x25')](respondWithResult(_0x581ef1,0xc9))['catch'](handleError(_0x581ef1,null));};exports[_0x8047('0x23')]=function(_0x413e98,_0x5150ce){if(_0x413e98[_0x8047('0x47')]['id']){delete _0x413e98[_0x8047('0x47')]['id'];}return db[_0x8047('0x2d')][_0x8047('0x45')]({'where':{'id':_0x413e98[_0x8047('0x48')]['id']}})[_0x8047('0x25')](handleEntityNotFound(_0x5150ce,null))[_0x8047('0x25')](saveUpdates(_0x413e98[_0x8047('0x47')],null))[_0x8047('0x25')](respondWithResult(_0x5150ce,null))[_0x8047('0x40')](handleError(_0x5150ce,null));};exports[_0x8047('0x24')]=function(_0xc17226,_0x224f7b){return db[_0x8047('0x2d')]['find']({'where':{'id':_0xc17226[_0x8047('0x48')]['id']}})[_0x8047('0x25')](handleEntityNotFound(_0x224f7b,null))[_0x8047('0x25')](removeEntity(_0x224f7b,null))[_0x8047('0x40')](handleError(_0x224f7b,null));};exports['describe']=function(_0x297734,_0x9c0144){return db['VoiceQueueReport']['describe']()[_0x8047('0x25')](respondWithResult(_0x9c0144,null))[_0x8047('0x40')](handleError(_0x9c0144,null));};exports[_0x8047('0x49')]=function(_0xe4e8e1,_0x3eb825){var _0x263366={},_0xeaafd2={},_0x8b528b={'count':0x0,'rows':[]};_0xeaafd2[_0x8047('0x31')]=_[_0x8047('0x42')](db[_0x8047('0x2d')]['rawAttributes']);_0xeaafd2[_0x8047('0x32')]=_[_0x8047('0x42')](_0xe4e8e1[_0x8047('0x32')]);_0xeaafd2['filters']=_['intersection'](_0xeaafd2[_0x8047('0x31')],_0xeaafd2[_0x8047('0x32')]);_0x263366[_0x8047('0x35')]=_[_0x8047('0x34')](_0xeaafd2[_0x8047('0x31')],qs[_0x8047('0x36')](_0xe4e8e1['query'][_0x8047('0x36')]));_0x263366[_0x8047('0x35')]=_0x263366['attributes'][_0x8047('0x43')]?_0x263366[_0x8047('0x35')]:_0xeaafd2[_0x8047('0x31')];if(!_0xe4e8e1['query'][_0x8047('0x37')]('nolimit')){_0x263366['limit']=qs[_0x8047('0x1d')](_0xe4e8e1['query'][_0x8047('0x1d')]);_0x263366[_0x8047('0x1f')]=qs[_0x8047('0x1f')](_0xe4e8e1[_0x8047('0x32')][_0x8047('0x1f')]);}_0x263366['order']=qs[_0x8047('0x39')](_0xe4e8e1['query']['sort']);_0x263366[_0x8047('0x3a')]=qs[_0x8047('0x33')](_['pick'](_0xe4e8e1[_0x8047('0x32')],_0xeaafd2[_0x8047('0x33')]));if(_0xe4e8e1[_0x8047('0x32')]['filter']){_0x263366['where']=_[_0x8047('0x3b')](_0x263366[_0x8047('0x3a')],{'$or':_[_0x8047('0x2c')](_0x263366[_0x8047('0x35')],function(_0xe3718){var _0x3de51b={};_0x3de51b[_0xe3718]={'$like':'%'+_0xe4e8e1[_0x8047('0x32')][_0x8047('0x3d')]+'%'};return _0x3de51b;})});}_0x263366=_['merge']({},_0x263366,_0xe4e8e1[_0x8047('0x44')]);var _0x10675b={'where':_0x263366[_0x8047('0x3a')]};return db[_0x8047('0x2d')][_0x8047('0x1e')](_0x10675b)[_0x8047('0x25')](function(_0x57d9f1){_0x8b528b[_0x8047('0x1e')]=_0x57d9f1;if(_0xe4e8e1['query'][_0x8047('0x3e')]){_0x263366[_0x8047('0x3f')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x8047('0x4a')](_0x263366);})['then'](function(_0x180a56){_0x8b528b[_0x8047('0x4b')]=_0x180a56;return _0x8b528b;})[_0x8047('0x25')](respondWithFilteredResult(_0x3eb825,_0x263366,_0x8047('0x49')))[_0x8047('0x40')](handleError(_0x3eb825,null,_0x8047('0x49')));}; \ No newline at end of file +var _0xbe36=['length','find','create','body','describe','getVoiceQueuesReport','eml-format','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','VoiceQueueReport','findAll','rows','catch','show','params'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xbe36,0xf6));var _0x6be3=function(_0x2e7a79,_0x154fd0){_0x2e7a79=_0x2e7a79-0x0;var _0x385801=_0xbe36[_0x2e7a79];return _0x385801;};'use strict';var emlformat=require(_0x6be3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6be3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6be3('0x2'));var BPromise=require(_0x6be3('0x3'));var Mustache=require(_0x6be3('0x4'));var util=require(_0x6be3('0x5'));var path=require(_0x6be3('0x6'));var sox=require(_0x6be3('0x7'));var csv=require(_0x6be3('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6be3('0x9'));var _=require('lodash');var squel=require(_0x6be3('0xa'));var crypto=require('crypto');var jsforce=require(_0x6be3('0xb'));var deskjs=require(_0x6be3('0xc'));var toCsv=require('to-csv');var querystring=require(_0x6be3('0xd'));var Papa=require(_0x6be3('0xe'));var Redis=require('ioredis');var authService=require(_0x6be3('0xf'));var qs=require(_0x6be3('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6be3('0x11'));var logger=require(_0x6be3('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x6be3('0x13')]=_[_0x6be3('0x14')](config[_0x6be3('0x13')],{'host':_0x6be3('0x15'),'port':0x18eb});var socket=require(_0x6be3('0x16'))(new Redis(config['redis']));require(_0x6be3('0x17'))[_0x6be3('0x18')](socket);function respondWithStatusCode(_0x16485d,_0x5acf7c){_0x5acf7c=_0x5acf7c||0xcc;return function(_0x313328){if(_0x313328){return _0x16485d['sendStatus'](_0x5acf7c);}return _0x16485d[_0x6be3('0x19')](_0x5acf7c)[_0x6be3('0x1a')]();};}function respondWithResult(_0x3a56ca,_0x100db2){_0x100db2=_0x100db2||0xc8;return function(_0x296b58){if(_0x296b58){return _0x3a56ca[_0x6be3('0x19')](_0x100db2)[_0x6be3('0x1b')](_0x296b58);}};}function respondWithFilteredResult(_0x3882e9,_0x1ddd28){return function(_0xf0e604){if(_0xf0e604){var _0x2989c5=typeof _0x1ddd28[_0x6be3('0x1c')]===_0x6be3('0x1d')&&typeof _0x1ddd28[_0x6be3('0x1e')]===_0x6be3('0x1d');var _0x2e1959=_0xf0e604[_0x6be3('0x1f')];var _0x46c6f2=_0x2989c5?0x0:_0x1ddd28[_0x6be3('0x1c')];var _0x3bcc46=_0x2989c5?_0xf0e604['count']:_0x1ddd28[_0x6be3('0x1c')]+_0x1ddd28[_0x6be3('0x1e')];var _0x1dfc2f;if(_0x3bcc46>=_0x2e1959){_0x3bcc46=_0x2e1959;_0x1dfc2f=0xc8;}else{_0x1dfc2f=0xce;}_0x3882e9[_0x6be3('0x19')](_0x1dfc2f);return _0x3882e9['set'](_0x6be3('0x20'),_0x46c6f2+'-'+_0x3bcc46+'/'+_0x2e1959)['json'](_0xf0e604);}return null;};}function patchUpdates(_0x16d035){return function(_0x398b2b){try{jsonpatch[_0x6be3('0x21')](_0x398b2b,_0x16d035,!![]);}catch(_0x5b57d6){return BPromise[_0x6be3('0x22')](_0x5b57d6);}return _0x398b2b[_0x6be3('0x23')]();};}function saveUpdates(_0x396a61,_0x2b8fc3){return function(_0x1d7fed){if(_0x1d7fed){return _0x1d7fed[_0x6be3('0x24')](_0x396a61)[_0x6be3('0x25')](function(_0x15a8c3){return _0x15a8c3;});}return null;};}function removeEntity(_0x4d5609,_0x3d71dd){return function(_0x418e1e){if(_0x418e1e){return _0x418e1e[_0x6be3('0x26')]()[_0x6be3('0x25')](function(){_0x4d5609['status'](0xcc)[_0x6be3('0x1a')]();});}};}function handleEntityNotFound(_0x1e4c2a,_0x8bdc74){return function(_0x6b617b){if(!_0x6b617b){_0x1e4c2a[_0x6be3('0x27')](0x194);}return _0x6b617b;};}function handleError(_0x35b0fe,_0x53f5cb){_0x53f5cb=_0x53f5cb||0x1f4;return function(_0x12e5e2){logger['error'](_0x12e5e2[_0x6be3('0x28')]);if(_0x12e5e2[_0x6be3('0x29')]){delete _0x12e5e2[_0x6be3('0x29')];}_0x35b0fe[_0x6be3('0x19')](_0x53f5cb)[_0x6be3('0x2a')](_0x12e5e2);};}exports[_0x6be3('0x2b')]=function(_0x42958c,_0x2da2e2){var _0x21e40f={},_0x39a631={},_0x20c003={'count':0x0,'rows':[]};var _0x3cda60=_[_0x6be3('0x2c')](db['VoiceQueueReport'][_0x6be3('0x2d')],function(_0x1af242){return{'name':_0x1af242[_0x6be3('0x2e')],'type':_0x1af242[_0x6be3('0x2f')][_0x6be3('0x30')]};});_0x39a631[_0x6be3('0x31')]=_[_0x6be3('0x2c')](_0x3cda60,_0x6be3('0x29'));_0x39a631[_0x6be3('0x32')]=_[_0x6be3('0x33')](_0x42958c['query']);_0x39a631['filters']=_[_0x6be3('0x34')](_0x39a631[_0x6be3('0x31')],_0x39a631[_0x6be3('0x32')]);_0x21e40f[_0x6be3('0x35')]=_[_0x6be3('0x34')](_0x39a631[_0x6be3('0x31')],qs[_0x6be3('0x36')](_0x42958c[_0x6be3('0x32')][_0x6be3('0x36')]));_0x21e40f[_0x6be3('0x35')]=_0x21e40f['attributes']['length']?_0x21e40f['attributes']:_0x39a631['model'];if(!_0x42958c[_0x6be3('0x32')][_0x6be3('0x37')](_0x6be3('0x38'))){_0x21e40f['limit']=qs[_0x6be3('0x1e')](_0x42958c[_0x6be3('0x32')][_0x6be3('0x1e')]);_0x21e40f[_0x6be3('0x1c')]=qs['offset'](_0x42958c['query']['offset']);}_0x21e40f[_0x6be3('0x39')]=qs[_0x6be3('0x3a')](_0x42958c[_0x6be3('0x32')][_0x6be3('0x3a')]);_0x21e40f[_0x6be3('0x3b')]=qs[_0x6be3('0x3c')](_[_0x6be3('0x3d')](_0x42958c[_0x6be3('0x32')],_0x39a631['filters']),_0x3cda60);if(_0x42958c[_0x6be3('0x32')][_0x6be3('0x3e')]){_0x21e40f['where']=_['merge'](_0x21e40f[_0x6be3('0x3b')],{'$or':_[_0x6be3('0x2c')](_0x3cda60,function(_0x97430b){if(_0x97430b[_0x6be3('0x2f')]!==_0x6be3('0x3f')){var _0x341b1f={};_0x341b1f[_0x97430b[_0x6be3('0x29')]]={'$like':'%'+_0x42958c['query'][_0x6be3('0x3e')]+'%'};return _0x341b1f;}})});}_0x21e40f=_[_0x6be3('0x40')]({},_0x21e40f,_0x42958c[_0x6be3('0x41')]);var _0x156977={'where':_0x21e40f[_0x6be3('0x3b')]};return db['VoiceQueueReport'][_0x6be3('0x1f')](_0x156977)['then'](function(_0x130abf){_0x20c003[_0x6be3('0x1f')]=_0x130abf;if(_0x42958c['query'][_0x6be3('0x42')]){_0x21e40f[_0x6be3('0x43')]=[{'all':!![]}];}return db[_0x6be3('0x44')][_0x6be3('0x45')](_0x21e40f);})[_0x6be3('0x25')](function(_0x43fe94){_0x20c003[_0x6be3('0x46')]=_0x43fe94;return _0x20c003;})[_0x6be3('0x25')](respondWithFilteredResult(_0x2da2e2,_0x21e40f))[_0x6be3('0x47')](handleError(_0x2da2e2,null));};exports[_0x6be3('0x48')]=function(_0x2e08d1,_0x2373f8){var _0x79d84f={'raw':![],'where':{'id':_0x2e08d1[_0x6be3('0x49')]['id']}},_0x14e1c5={};_0x14e1c5[_0x6be3('0x31')]=_[_0x6be3('0x33')](db['VoiceQueueReport']['rawAttributes']);_0x14e1c5[_0x6be3('0x32')]=_[_0x6be3('0x33')](_0x2e08d1[_0x6be3('0x32')]);_0x14e1c5[_0x6be3('0x3c')]=_[_0x6be3('0x34')](_0x14e1c5['model'],_0x14e1c5[_0x6be3('0x32')]);_0x79d84f[_0x6be3('0x35')]=_[_0x6be3('0x34')](_0x14e1c5[_0x6be3('0x31')],qs[_0x6be3('0x36')](_0x2e08d1[_0x6be3('0x32')][_0x6be3('0x36')]));_0x79d84f[_0x6be3('0x35')]=_0x79d84f[_0x6be3('0x35')][_0x6be3('0x4a')]?_0x79d84f[_0x6be3('0x35')]:_0x14e1c5[_0x6be3('0x31')];if(_0x2e08d1[_0x6be3('0x32')][_0x6be3('0x42')]){_0x79d84f[_0x6be3('0x43')]=[{'all':!![]}];}_0x79d84f=_[_0x6be3('0x40')]({},_0x79d84f,_0x2e08d1['options']);return db[_0x6be3('0x44')][_0x6be3('0x4b')](_0x79d84f)[_0x6be3('0x25')](handleEntityNotFound(_0x2373f8,null))[_0x6be3('0x25')](respondWithResult(_0x2373f8,null))['catch'](handleError(_0x2373f8,null));};exports[_0x6be3('0x4c')]=function(_0x3bfc2e,_0x5df116){return db[_0x6be3('0x44')][_0x6be3('0x4c')](_0x3bfc2e[_0x6be3('0x4d')],{})[_0x6be3('0x25')](respondWithResult(_0x5df116,0xc9))[_0x6be3('0x47')](handleError(_0x5df116,null));};exports[_0x6be3('0x24')]=function(_0x588c68,_0x9163f0){if(_0x588c68['body']['id']){delete _0x588c68[_0x6be3('0x4d')]['id'];}return db[_0x6be3('0x44')][_0x6be3('0x4b')]({'where':{'id':_0x588c68[_0x6be3('0x49')]['id']}})[_0x6be3('0x25')](handleEntityNotFound(_0x9163f0,null))[_0x6be3('0x25')](saveUpdates(_0x588c68[_0x6be3('0x4d')],null))[_0x6be3('0x25')](respondWithResult(_0x9163f0,null))[_0x6be3('0x47')](handleError(_0x9163f0,null));};exports[_0x6be3('0x26')]=function(_0x5b5e0a,_0x168565){return db['VoiceQueueReport'][_0x6be3('0x4b')]({'where':{'id':_0x5b5e0a[_0x6be3('0x49')]['id']}})[_0x6be3('0x25')](handleEntityNotFound(_0x168565,null))[_0x6be3('0x25')](removeEntity(_0x168565,null))['catch'](handleError(_0x168565,null));};exports['describe']=function(_0x39e154,_0x598210){return db[_0x6be3('0x44')][_0x6be3('0x4e')]()[_0x6be3('0x25')](respondWithResult(_0x598210,null))[_0x6be3('0x47')](handleError(_0x598210,null));};exports[_0x6be3('0x4f')]=function(_0x2e541d,_0xc41ccc){var _0x3607f3={},_0x737ff3={},_0x35fb39={'count':0x0,'rows':[]};_0x737ff3[_0x6be3('0x31')]=_['keys'](db['VoiceQueueReport'][_0x6be3('0x2d')]);_0x737ff3['query']=_['keys'](_0x2e541d[_0x6be3('0x32')]);_0x737ff3[_0x6be3('0x3c')]=_[_0x6be3('0x34')](_0x737ff3[_0x6be3('0x31')],_0x737ff3[_0x6be3('0x32')]);_0x3607f3['attributes']=_[_0x6be3('0x34')](_0x737ff3[_0x6be3('0x31')],qs[_0x6be3('0x36')](_0x2e541d[_0x6be3('0x32')][_0x6be3('0x36')]));_0x3607f3['attributes']=_0x3607f3[_0x6be3('0x35')][_0x6be3('0x4a')]?_0x3607f3[_0x6be3('0x35')]:_0x737ff3[_0x6be3('0x31')];if(!_0x2e541d[_0x6be3('0x32')]['hasOwnProperty'](_0x6be3('0x38'))){_0x3607f3['limit']=qs[_0x6be3('0x1e')](_0x2e541d[_0x6be3('0x32')][_0x6be3('0x1e')]);_0x3607f3[_0x6be3('0x1c')]=qs[_0x6be3('0x1c')](_0x2e541d['query'][_0x6be3('0x1c')]);}_0x3607f3[_0x6be3('0x39')]=qs[_0x6be3('0x3a')](_0x2e541d[_0x6be3('0x32')]['sort']);_0x3607f3[_0x6be3('0x3b')]=qs[_0x6be3('0x3c')](_[_0x6be3('0x3d')](_0x2e541d[_0x6be3('0x32')],_0x737ff3['filters']));if(_0x2e541d[_0x6be3('0x32')][_0x6be3('0x3e')]){_0x3607f3[_0x6be3('0x3b')]=_[_0x6be3('0x40')](_0x3607f3[_0x6be3('0x3b')],{'$or':_[_0x6be3('0x2c')](_0x3607f3[_0x6be3('0x35')],function(_0x321a7a){var _0x5593c7={};_0x5593c7[_0x321a7a]={'$like':'%'+_0x2e541d[_0x6be3('0x32')]['filter']+'%'};return _0x5593c7;})});}_0x3607f3=_['merge']({},_0x3607f3,_0x2e541d[_0x6be3('0x41')]);var _0x447931={'where':_0x3607f3[_0x6be3('0x3b')]};return db[_0x6be3('0x44')][_0x6be3('0x1f')](_0x447931)[_0x6be3('0x25')](function(_0x46aeb5){_0x35fb39[_0x6be3('0x1f')]=_0x46aeb5;if(_0x2e541d[_0x6be3('0x32')][_0x6be3('0x42')]){_0x3607f3[_0x6be3('0x43')]=[{'all':!![]}];}return db[_0x6be3('0x44')]['findAll'](_0x3607f3);})[_0x6be3('0x25')](function(_0x31c98b){_0x35fb39['rows']=_0x31c98b;return _0x35fb39;})[_0x6be3('0x25')](respondWithFilteredResult(_0xc41ccc,_0x3607f3,_0x6be3('0x4f')))[_0x6be3('0x47')](handleError(_0xc41ccc,null,_0x6be3('0x4f')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index c1ba7fd..46d0769 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 _0x9d0d=['setMaxListeners','save','update','remove','emit','hasOwnProperty','events','../../mysqldb'];(function(_0x35933a,_0x3d4b25){var _0x45264b=function(_0x5ef155){while(--_0x5ef155){_0x35933a['push'](_0x35933a['shift']());}};_0x45264b(++_0x3d4b25);}(_0x9d0d,0xc6));var _0xd9d0=function(_0x53f5a7,_0xc7c66b){_0x53f5a7=_0x53f5a7-0x0;var _0x656fa3=_0x9d0d[_0x53f5a7];return _0x656fa3;};'use strict';var EventEmitter=require(_0xd9d0('0x0'));var VoiceQueueReport=require(_0xd9d0('0x1'))['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xd9d0('0x2')](0x0);var events={'afterCreate':_0xd9d0('0x3'),'afterUpdate':_0xd9d0('0x4'),'afterDestroy':_0xd9d0('0x5')};function emitEvent(_0x1f7a17){return function(_0x4d5d57,_0x7bd788,_0x514481){VoiceQueueReportEvents[_0xd9d0('0x6')](_0x1f7a17+':'+_0x4d5d57['id'],_0x4d5d57);VoiceQueueReportEvents[_0xd9d0('0x6')](_0x1f7a17,_0x4d5d57);_0x514481(null);};}for(var e in events){if(events[_0xd9d0('0x7')](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents; \ No newline at end of file +var _0x379b=['../../mysqldb','VoiceQueueReport','setMaxListeners','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x20ee8b,_0x5507c9){var _0xd1f288=function(_0x166deb){while(--_0x166deb){_0x20ee8b['push'](_0x20ee8b['shift']());}};_0xd1f288(++_0x5507c9);}(_0x379b,0x182));var _0xb379=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x379b[_0x4b369d];return _0x571a98;};'use strict';var EventEmitter=require(_0xb379('0x0'));var VoiceQueueReport=require(_0xb379('0x1'))['db'][_0xb379('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xb379('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb379('0x4'),'afterDestroy':_0xb379('0x5')};function emitEvent(_0x5fef4a){return function(_0x4a0422,_0x2410a5,_0x43144b){VoiceQueueReportEvents[_0xb379('0x6')](_0x5fef4a+':'+_0x4a0422['id'],_0x4a0422);VoiceQueueReportEvents['emit'](_0x5fef4a,_0x4a0422);_0x43144b(null);};}for(var e in events){if(events[_0xb379('0x7')](e)){var event=events[e];VoiceQueueReport[_0xb379('0x8')](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 220ee82..63521a4 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 _0xd091=['define','VoiceQueueReport','report_queue','uniqueid','calleridnum','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./voiceQueueReport.attributes','exports'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0xd091,0xd7));var _0x1d09=function(_0x38b643,_0x14dc0d){_0x38b643=_0x38b643-0x0;var _0x23cf24=_0xd091[_0x38b643];return _0x23cf24;};'use strict';var _=require(_0x1d09('0x0'));var util=require(_0x1d09('0x1'));var logger=require(_0x1d09('0x2'))(_0x1d09('0x3'));var moment=require('moment');var BPromise=require(_0x1d09('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1d09('0x5'));var rimraf=require(_0x1d09('0x6'));var config=require(_0x1d09('0x7'));var attributes=require(_0x1d09('0x8'));module[_0x1d09('0x9')]=function(_0x4970fd,_0x265301){return _0x4970fd[_0x1d09('0xa')](_0x1d09('0xb'),attributes,{'tableName':_0x1d09('0xc'),'paranoid':![],'indexes':[{'fields':[_0x1d09('0xd')]},{'fields':[_0x1d09('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6a6c=['uniqueid','calleridnum','lodash','util','api','bluebird','path','rimraf','../../config/environment','./voiceQueueReport.attributes','exports'];(function(_0xdc37a1,_0x53ebb9){var _0x99b4fe=function(_0x2811e3){while(--_0x2811e3){_0xdc37a1['push'](_0xdc37a1['shift']());}};_0x99b4fe(++_0x53ebb9);}(_0x6a6c,0x199));var _0xc6a6=function(_0x4e91b4,_0x5643f7){_0x4e91b4=_0x4e91b4-0x0;var _0x767297=_0x6a6c[_0x4e91b4];return _0x767297;};'use strict';var _=require(_0xc6a6('0x0'));var util=require(_0xc6a6('0x1'));var logger=require('../../config/logger')(_0xc6a6('0x2'));var moment=require('moment');var BPromise=require(_0xc6a6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc6a6('0x4'));var rimraf=require(_0xc6a6('0x5'));var config=require(_0xc6a6('0x6'));var attributes=require(_0xc6a6('0x7'));module[_0xc6a6('0x8')]=function(_0x539ec0,_0xb00b28){return _0x539ec0['define']('VoiceQueueReport',attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':[_0xc6a6('0x9')]},{'fields':[_0xc6a6('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 84b74cb..f6f5f3d 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 _0x3c6f=['attributes','include','debug','create','raw','CreateVoiceQueueReport','UpdateVoiceQueueReport','then','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','defaults','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','request','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetVoiceQueueReport','VoiceQueueReport','findAll','options','where','limit','map','model'];(function(_0x588011,_0x5e9d11){var _0x3b3773=function(_0x4cca54){while(--_0x4cca54){_0x588011['push'](_0x588011['shift']());}};_0x3b3773(++_0x5e9d11);}(_0x3c6f,0x1a3));var _0xf3c6=function(_0x44e686,_0x31f646){_0x44e686=_0x44e686-0x0;var _0xec591b=_0x3c6f[_0x44e686];return _0xec591b;};'use strict';var _=require(_0xf3c6('0x0'));var util=require(_0xf3c6('0x1'));var moment=require(_0xf3c6('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf3c6('0x3'));var db=require(_0xf3c6('0x4'))['db'];var utils=require(_0xf3c6('0x5'));var logger=require(_0xf3c6('0x6'))(_0xf3c6('0x7'));var config=require(_0xf3c6('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf3c6('0x9')]({'port':0x232a});config['redis']=_[_0xf3c6('0xa')](config[_0xf3c6('0xb')],{'host':_0xf3c6('0xc'),'port':0x18eb});var socket=require(_0xf3c6('0xd'))(new Redis(config['redis']));require(_0xf3c6('0xe'))['register'](socket);function respondWithRpcPromise(_0x5ad512,_0x203449,_0xb3ad0e){return new BPromise(function(_0x3fdf89,_0x3dd5de){return client[_0xf3c6('0xf')](_0x5ad512,_0xb3ad0e)['then'](function(_0x23dea2){logger[_0xf3c6('0x10')](_0xf3c6('0x11'),_0x203449,_0xf3c6('0x12'));logger['debug']('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x203449,_0xf3c6('0x12'),JSON[_0xf3c6('0x13')](_0x23dea2));if(_0x23dea2[_0xf3c6('0x14')]){if(_0x23dea2[_0xf3c6('0x14')][_0xf3c6('0x15')]===0x1f4){logger[_0xf3c6('0x14')](_0xf3c6('0x11'),_0x203449,_0x23dea2[_0xf3c6('0x14')][_0xf3c6('0x16')]);return _0x3dd5de(_0x23dea2[_0xf3c6('0x14')][_0xf3c6('0x16')]);}logger[_0xf3c6('0x14')](_0xf3c6('0x11'),_0x203449,_0x23dea2['error'][_0xf3c6('0x16')]);return _0x3fdf89(_0x23dea2[_0xf3c6('0x14')][_0xf3c6('0x16')]);}else{logger['info'](_0xf3c6('0x11'),_0x203449,_0xf3c6('0x12'));_0x3fdf89(_0x23dea2[_0xf3c6('0x17')][_0xf3c6('0x16')]);}})['catch'](function(_0x4fc08e){logger[_0xf3c6('0x14')]('VoiceQueueReport,\x20%s,\x20%s',_0x203449,_0x4fc08e);_0x3dd5de(_0x4fc08e);});});}exports[_0xf3c6('0x18')]=function(_0x3691de){var _0x4766c8=this;return new Promise(function(_0x5451c8,_0x21e8e6){return db[_0xf3c6('0x19')][_0xf3c6('0x1a')]({'raw':_0x3691de[_0xf3c6('0x1b')]?_0x3691de[_0xf3c6('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x3691de[_0xf3c6('0x1b')]?_0x3691de['options'][_0xf3c6('0x1c')]||null:null,'attributes':_0x3691de[_0xf3c6('0x1b')]?_0x3691de[_0xf3c6('0x1b')]['attributes']||null:null,'limit':_0x3691de[_0xf3c6('0x1b')]?_0x3691de[_0xf3c6('0x1b')][_0xf3c6('0x1d')]||null:null,'include':_0x3691de[_0xf3c6('0x1b')]?_0x3691de[_0xf3c6('0x1b')]['include']?_[_0xf3c6('0x1e')](_0x3691de['options']['include'],function(_0x41efa0){return{'model':db[_0x41efa0[_0xf3c6('0x1f')]],'as':_0x41efa0['as'],'attributes':_0x41efa0[_0xf3c6('0x20')],'include':_0x41efa0[_0xf3c6('0x21')]?_[_0xf3c6('0x1e')](_0x41efa0[_0xf3c6('0x21')],function(_0x325b9a){return{'model':db[_0x325b9a[_0xf3c6('0x1f')]],'as':_0x325b9a['as'],'attributes':_0x325b9a[_0xf3c6('0x20')],'include':_0x325b9a['include']?_['map'](_0x325b9a['include'],function(_0x5d509e){return{'model':db[_0x5d509e[_0xf3c6('0x1f')]],'as':_0x5d509e['as'],'attributes':_0x5d509e['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5a77d0){logger['info'](_0xf3c6('0x18'),_0x3691de);logger[_0xf3c6('0x22')](_0xf3c6('0x18'),_0x3691de,JSON[_0xf3c6('0x13')](_0x5a77d0));_0x5451c8(_0x5a77d0);})['catch'](function(_0xf2a9c7){logger[_0xf3c6('0x14')](_0xf3c6('0x18'),_0xf2a9c7['message'],_0x3691de);_0x21e8e6(_0x4766c8[_0xf3c6('0x14')](0x1f4,_0xf2a9c7[_0xf3c6('0x16')]));});});};exports['CreateVoiceQueueReport']=function(_0x3ac90b){var _0x3daeff=this;return new Promise(function(_0x7ce8c1,_0x550320){return db[_0xf3c6('0x19')][_0xf3c6('0x23')](_0x3ac90b['body'],{'raw':_0x3ac90b[_0xf3c6('0x1b')]?_0x3ac90b['options'][_0xf3c6('0x24')]===undefined?!![]:![]:!![]})['then'](function(_0x46872c){logger[_0xf3c6('0x10')](_0xf3c6('0x25'),_0x3ac90b);logger[_0xf3c6('0x22')](_0xf3c6('0x25'),_0x3ac90b,JSON['stringify'](_0x46872c));_0x7ce8c1(_0x46872c);})['catch'](function(_0x31fff4){logger[_0xf3c6('0x14')](_0xf3c6('0x25'),_0x31fff4[_0xf3c6('0x16')],_0x3ac90b);_0x550320(_0x3daeff['error'](0x1f4,_0x31fff4['message']));});});};exports[_0xf3c6('0x26')]=function(_0x499732){var _0x38fbf6=this;return new Promise(function(_0xe6c79e,_0x53298b){return db[_0xf3c6('0x19')]['update'](_0x499732['body'],{'raw':_0x499732[_0xf3c6('0x1b')]?_0x499732[_0xf3c6('0x1b')][_0xf3c6('0x24')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x499732['options']?_0x499732[_0xf3c6('0x1b')][_0xf3c6('0x1c')]||null:null,'attributes':_0x499732[_0xf3c6('0x1b')]?_0x499732[_0xf3c6('0x1b')][_0xf3c6('0x20')]||null:null,'limit':_0x499732[_0xf3c6('0x1b')]?_0x499732[_0xf3c6('0x1b')][_0xf3c6('0x1d')]||null:null})[_0xf3c6('0x27')](function(_0x5cf7ec){logger[_0xf3c6('0x10')](_0xf3c6('0x26'),_0x499732);logger['debug'](_0xf3c6('0x26'),_0x499732,JSON[_0xf3c6('0x13')](_0x5cf7ec));_0xe6c79e(_0x5cf7ec);})[_0xf3c6('0x28')](function(_0x2fc31b){logger[_0xf3c6('0x14')](_0xf3c6('0x26'),_0x2fc31b[_0xf3c6('0x16')],_0x499732);_0x53298b(_0x38fbf6['error'](0x1f4,_0x2fc31b[_0xf3c6('0x16')]));});});}; \ No newline at end of file +var _0x3b68=['defaults','localhost','socket.io-emitter','request','then','info','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceQueueReport,\x20%s,\x20%s','result','catch','GetVoiceQueueReport','findAll','options','raw','where','attributes','limit','include','map','model','CreateVoiceQueueReport','VoiceQueueReport','UpdateVoiceQueueReport','body','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x3df3a1,_0xcf23c5){var _0x49c5c1=function(_0x5195ca){while(--_0x5195ca){_0x3df3a1['push'](_0x3df3a1['shift']());}};_0x49c5c1(++_0xcf23c5);}(_0x3b68,0x17e));var _0x83b6=function(_0x11ca19,_0x233e90){_0x11ca19=_0x11ca19-0x0;var _0x3b984b=_0x3b68[_0x11ca19];return _0x3b984b;};'use strict';var _=require(_0x83b6('0x0'));var util=require(_0x83b6('0x1'));var moment=require(_0x83b6('0x2'));var BPromise=require(_0x83b6('0x3'));var rs=require(_0x83b6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x83b6('0x5'))['db'];var utils=require(_0x83b6('0x6'));var logger=require(_0x83b6('0x7'))(_0x83b6('0x8'));var config=require(_0x83b6('0x9'));var jayson=require(_0x83b6('0xa'));var client=jayson[_0x83b6('0xb')][_0x83b6('0xc')]({'port':0x232a});config[_0x83b6('0xd')]=_[_0x83b6('0xe')](config['redis'],{'host':_0x83b6('0xf'),'port':0x18eb});var socket=require(_0x83b6('0x10'))(new Redis(config['redis']));require('./voiceQueueReport.socket')['register'](socket);function respondWithRpcPromise(_0x22273c,_0x1ed7e8,_0x1cdbb2){return new BPromise(function(_0xe43f1e,_0x518180){return client[_0x83b6('0x11')](_0x22273c,_0x1cdbb2)[_0x83b6('0x12')](function(_0x527e38){logger[_0x83b6('0x13')]('VoiceQueueReport,\x20%s,\x20%s',_0x1ed7e8,_0x83b6('0x14'));logger[_0x83b6('0x15')](_0x83b6('0x16'),_0x1ed7e8,_0x83b6('0x14'),JSON[_0x83b6('0x17')](_0x527e38));if(_0x527e38[_0x83b6('0x18')]){if(_0x527e38['error'][_0x83b6('0x19')]===0x1f4){logger[_0x83b6('0x18')]('VoiceQueueReport,\x20%s,\x20%s',_0x1ed7e8,_0x527e38[_0x83b6('0x18')][_0x83b6('0x1a')]);return _0x518180(_0x527e38[_0x83b6('0x18')]['message']);}logger['error'](_0x83b6('0x1b'),_0x1ed7e8,_0x527e38[_0x83b6('0x18')]['message']);return _0xe43f1e(_0x527e38['error']['message']);}else{logger[_0x83b6('0x13')](_0x83b6('0x1b'),_0x1ed7e8,_0x83b6('0x14'));_0xe43f1e(_0x527e38[_0x83b6('0x1c')][_0x83b6('0x1a')]);}})[_0x83b6('0x1d')](function(_0x4dd8ef){logger[_0x83b6('0x18')](_0x83b6('0x1b'),_0x1ed7e8,_0x4dd8ef);_0x518180(_0x4dd8ef);});});}exports[_0x83b6('0x1e')]=function(_0x55dbe2){var _0x1006e9=this;return new Promise(function(_0x119a52,_0x371baa){return db['VoiceQueueReport'][_0x83b6('0x1f')]({'raw':_0x55dbe2[_0x83b6('0x20')]?_0x55dbe2['options'][_0x83b6('0x21')]===undefined?!![]:![]:!![],'where':_0x55dbe2['options']?_0x55dbe2[_0x83b6('0x20')][_0x83b6('0x22')]||null:null,'attributes':_0x55dbe2[_0x83b6('0x20')]?_0x55dbe2[_0x83b6('0x20')][_0x83b6('0x23')]||null:null,'limit':_0x55dbe2[_0x83b6('0x20')]?_0x55dbe2[_0x83b6('0x20')][_0x83b6('0x24')]||null:null,'include':_0x55dbe2[_0x83b6('0x20')]?_0x55dbe2[_0x83b6('0x20')][_0x83b6('0x25')]?_[_0x83b6('0x26')](_0x55dbe2[_0x83b6('0x20')][_0x83b6('0x25')],function(_0x173398){return{'model':db[_0x173398[_0x83b6('0x27')]],'as':_0x173398['as'],'attributes':_0x173398[_0x83b6('0x23')],'include':_0x173398[_0x83b6('0x25')]?_['map'](_0x173398[_0x83b6('0x25')],function(_0x4c2aaa){return{'model':db[_0x4c2aaa[_0x83b6('0x27')]],'as':_0x4c2aaa['as'],'attributes':_0x4c2aaa[_0x83b6('0x23')],'include':_0x4c2aaa['include']?_[_0x83b6('0x26')](_0x4c2aaa['include'],function(_0x4344a8){return{'model':db[_0x4344a8[_0x83b6('0x27')]],'as':_0x4344a8['as'],'attributes':_0x4344a8[_0x83b6('0x23')]};}):[]};}):[]};}):[]:[]})[_0x83b6('0x12')](function(_0x1db9c8){logger['info']('GetVoiceQueueReport',_0x55dbe2);logger[_0x83b6('0x15')](_0x83b6('0x1e'),_0x55dbe2,JSON[_0x83b6('0x17')](_0x1db9c8));_0x119a52(_0x1db9c8);})[_0x83b6('0x1d')](function(_0x27d889){logger[_0x83b6('0x18')]('GetVoiceQueueReport',_0x27d889['message'],_0x55dbe2);_0x371baa(_0x1006e9['error'](0x1f4,_0x27d889[_0x83b6('0x1a')]));});});};exports[_0x83b6('0x28')]=function(_0x4cb80b){var _0x32388b=this;return new Promise(function(_0x4ad21d,_0x4255c7){return db[_0x83b6('0x29')]['create'](_0x4cb80b['body'],{'raw':_0x4cb80b[_0x83b6('0x20')]?_0x4cb80b['options']['raw']===undefined?!![]:![]:!![]})[_0x83b6('0x12')](function(_0x3138b6){logger['info'](_0x83b6('0x28'),_0x4cb80b);logger['debug'](_0x83b6('0x28'),_0x4cb80b,JSON[_0x83b6('0x17')](_0x3138b6));_0x4ad21d(_0x3138b6);})[_0x83b6('0x1d')](function(_0x1279ff){logger[_0x83b6('0x18')](_0x83b6('0x28'),_0x1279ff['message'],_0x4cb80b);_0x4255c7(_0x32388b[_0x83b6('0x18')](0x1f4,_0x1279ff[_0x83b6('0x1a')]));});});};exports[_0x83b6('0x2a')]=function(_0x3a7842){var _0x48daa3=this;return new Promise(function(_0x467395,_0x4d3921){return db['VoiceQueueReport']['update'](_0x3a7842[_0x83b6('0x2b')],{'raw':_0x3a7842[_0x83b6('0x20')]?_0x3a7842[_0x83b6('0x20')][_0x83b6('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3a7842[_0x83b6('0x20')]?_0x3a7842[_0x83b6('0x20')][_0x83b6('0x22')]||null:null,'attributes':_0x3a7842[_0x83b6('0x20')]?_0x3a7842[_0x83b6('0x20')][_0x83b6('0x23')]||null:null,'limit':_0x3a7842['options']?_0x3a7842[_0x83b6('0x20')][_0x83b6('0x24')]||null:null})[_0x83b6('0x12')](function(_0x4af1dd){logger[_0x83b6('0x13')]('UpdateVoiceQueueReport',_0x3a7842);logger['debug'](_0x83b6('0x2a'),_0x3a7842,JSON[_0x83b6('0x17')](_0x4af1dd));_0x467395(_0x4af1dd);})['catch'](function(_0x316bf4){logger[_0x83b6('0x18')](_0x83b6('0x2a'),_0x316bf4[_0x83b6('0x1a')],_0x3a7842);_0x4d3921(_0x48daa3[_0x83b6('0x18')](0x1f4,_0x316bf4[_0x83b6('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index e273ad1..691d14d 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 _0xd51f=['length','voiceQueueReport:','./voiceQueueReport.events','save','update','emit','removeListener'];(function(_0x37d5ff,_0x5ee83b){var _0x146b37=function(_0x596170){while(--_0x596170){_0x37d5ff['push'](_0x37d5ff['shift']());}};_0x146b37(++_0x5ee83b);}(_0xd51f,0xf0));var _0xfd51=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xd51f[_0x4a9fb1];return _0x348672;};'use strict';var VoiceQueueReportEvents=require(_0xfd51('0x0'));var events=[_0xfd51('0x1'),'remove',_0xfd51('0x2')];function createListener(_0x2745b5,_0x583496){return function(_0x1fa890){_0x583496[_0xfd51('0x3')](_0x2745b5,_0x1fa890);};}function removeListener(_0x49bb3e,_0x3efc9b){return function(){VoiceQueueReportEvents[_0xfd51('0x4')](_0x49bb3e,_0x3efc9b);};}exports['register']=function(_0x3e3517){for(var _0x3a2cd4=0x0,_0x5dc337=events[_0xfd51('0x5')];_0x3a2cd4<_0x5dc337;_0x3a2cd4++){var _0x155f37=events[_0x3a2cd4];var _0x2c3fb2=createListener(_0xfd51('0x6')+_0x155f37,_0x3e3517);VoiceQueueReportEvents['on'](_0x155f37,_0x2c3fb2);}}; \ No newline at end of file +var _0x684d=['save','remove','update','emit','register','length'];(function(_0x282ccc,_0x5d66a1){var _0x27c2dd=function(_0x58431a){while(--_0x58431a){_0x282ccc['push'](_0x282ccc['shift']());}};_0x27c2dd(++_0x5d66a1);}(_0x684d,0x174));var _0xd684=function(_0x10e97e,_0x56d5a7){_0x10e97e=_0x10e97e-0x0;var _0x3ac637=_0x684d[_0x10e97e];return _0x3ac637;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0xd684('0x0'),_0xd684('0x1'),_0xd684('0x2')];function createListener(_0x54e0e0,_0x34f5e4){return function(_0x52e16b){_0x34f5e4[_0xd684('0x3')](_0x54e0e0,_0x52e16b);};}function removeListener(_0x1d505b,_0x654972){return function(){VoiceQueueReportEvents['removeListener'](_0x1d505b,_0x654972);};}exports[_0xd684('0x4')]=function(_0x5f50ac){for(var _0x3bf907=0x0,_0x51350a=events[_0xd684('0x5')];_0x3bf907<_0x51350a;_0x3bf907++){var _0x422bd2=events[_0x3bf907];var _0x23058d=createListener('voiceQueueReport:'+_0x422bd2,_0x5f50ac);VoiceQueueReportEvents['on'](_0x422bd2,_0x23058d);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index d118d62..9c811ac 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 _0x3de0=['multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','post','put','update','delete','destroy'];(function(_0x42c7c1,_0x59e4e9){var _0x596b60=function(_0xc0ba50){while(--_0xc0ba50){_0x42c7c1['push'](_0x42c7c1['shift']());}};_0x596b60(++_0x59e4e9);}(_0x3de0,0x143));var _0x03de=function(_0x23df10,_0x3de04c){_0x23df10=_0x23df10-0x0;var _0x5e01d5=_0x3de0[_0x23df10];return _0x5e01d5;};'use strict';var multer=require(_0x03de('0x0'));var util=require('util');var path=require(_0x03de('0x1'));var timeout=require(_0x03de('0x2'));var express=require('express');var router=express[_0x03de('0x3')]();var fs_extra=require(_0x03de('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x03de('0x5'));var config=require(_0x03de('0x6'));var controller=require('./voiceQueuesLog.controller');router['get']('/',auth[_0x03de('0x7')](),controller[_0x03de('0x8')]);router[_0x03de('0x9')](_0x03de('0xa'),auth[_0x03de('0x7')](),controller[_0x03de('0xb')]);router[_0x03de('0xc')]('/',auth[_0x03de('0x7')](),controller['create']);router[_0x03de('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x03de('0xe')]);router[_0x03de('0xf')]('/:id',auth[_0x03de('0x7')](),controller[_0x03de('0x10')]);module['exports']=router; \ No newline at end of file +var _0xcb99=['../../config/environment','./voiceQueuesLog.controller','isAuthenticated','get','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','Router','fs-extra','../../components/auth/service'];(function(_0x36d24a,_0x2ab06e){var _0x439dc9=function(_0x25ef28){while(--_0x25ef28){_0x36d24a['push'](_0x36d24a['shift']());}};_0x439dc9(++_0x2ab06e);}(_0xcb99,0x8b));var _0x9cb9=function(_0x5bca8f,_0x1683d5){_0x5bca8f=_0x5bca8f-0x0;var _0x20fd20=_0xcb99[_0x5bca8f];return _0x20fd20;};'use strict';var multer=require(_0x9cb9('0x0'));var util=require('util');var path=require(_0x9cb9('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9cb9('0x2')]();var fs_extra=require(_0x9cb9('0x3'));var auth=require(_0x9cb9('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x9cb9('0x5'));var controller=require(_0x9cb9('0x6'));router['get']('/',auth[_0x9cb9('0x7')](),controller['index']);router[_0x9cb9('0x8')](_0x9cb9('0x9'),auth[_0x9cb9('0x7')](),controller[_0x9cb9('0xa')]);router[_0x9cb9('0xb')]('/',auth[_0x9cb9('0x7')](),controller[_0x9cb9('0xc')]);router[_0x9cb9('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x9cb9('0xe')]);router[_0x9cb9('0xf')](_0x9cb9('0x9'),auth['isAuthenticated'](),controller[_0x9cb9('0x10')]);module[_0x9cb9('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 2637138..90594cb 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 _0xc01e=['exports','STRING','DATE','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP'];(function(_0x52e4ac,_0x2b337d){var _0x42f116=function(_0x4d8d15){while(--_0x4d8d15){_0x52e4ac['push'](_0x52e4ac['shift']());}};_0x42f116(++_0x2b337d);}(_0xc01e,0x1b3));var _0xec01=function(_0x518990,_0x8fa098){_0x518990=_0x518990-0x0;var _0x258811=_0xc01e[_0x518990];return _0x258811;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0xec01('0x0')]={'time':{'type':Sequelize[_0xec01('0x1')]},'callid':{'type':Sequelize[_0xec01('0x1')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xec01('0x1')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xec01('0x1')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xec01('0x1')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xec01('0x1')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xec01('0x1')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xec01('0x1')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xec01('0x2')],'allowNull':![],'defaultValue':Sequelize[_0xec01('0x3')](_0xec01('0x4'))}}; \ No newline at end of file +var _0x158b=['CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','moment','exports','STRING','DATE'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x158b,0x181));var _0xb158=function(_0x526530,_0x67ae75){_0x526530=_0x526530-0x0;var _0x5824c9=_0x158b[_0x526530];return _0x5824c9;};'use strict';var Sequelize=require(_0xb158('0x0'));var moment=require(_0xb158('0x1'));module[_0xb158('0x2')]={'time':{'type':Sequelize[_0xb158('0x3')]},'callid':{'type':Sequelize[_0xb158('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xb158('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xb158('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xb158('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xb158('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xb158('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xb158('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xb158('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xb158('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xb158('0x4')],'allowNull':![],'defaultValue':Sequelize['literal'](_0xb158('0x5'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index af47acc..397a866 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 _0xde5f=['status','json','offset','undefined','limit','count','Content-Range','apply','save','update','destroy','then','error','stack','name','send','index','map','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','VoiceQueuesLog','find','catch','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x2dca8c,_0x223457){var _0x3a2d12=function(_0x16c2b1){while(--_0x16c2b1){_0x2dca8c['push'](_0x2dca8c['shift']());}};_0x3a2d12(++_0x223457);}(_0xde5f,0x157));var _0xfde5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xde5f[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xfde5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfde5('0x1'));var jsonpatch=require(_0xfde5('0x2'));var rp=require(_0xfde5('0x3'));var moment=require(_0xfde5('0x4'));var BPromise=require(_0xfde5('0x5'));var Mustache=require(_0xfde5('0x6'));var util=require(_0xfde5('0x7'));var path=require(_0xfde5('0x8'));var sox=require(_0xfde5('0x9'));var csv=require(_0xfde5('0xa'));var ejs=require(_0xfde5('0xb'));var fs=require('fs');var fs_extra=require(_0xfde5('0xc'));var _=require(_0xfde5('0xd'));var squel=require('squel');var crypto=require(_0xfde5('0xe'));var jsforce=require(_0xfde5('0xf'));var deskjs=require(_0xfde5('0x10'));var toCsv=require(_0xfde5('0xa'));var querystring=require(_0xfde5('0x11'));var Papa=require(_0xfde5('0x12'));var Redis=require(_0xfde5('0x13'));var authService=require(_0xfde5('0x14'));var qs=require(_0xfde5('0x15'));var as=require(_0xfde5('0x16'));var hardwareService=require(_0xfde5('0x17'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xfde5('0x18'));var db=require(_0xfde5('0x19'))['db'];function respondWithStatusCode(_0x568975,_0x1c25d4){_0x1c25d4=_0x1c25d4||0xcc;return function(_0x1cec62){if(_0x1cec62){return _0x568975[_0xfde5('0x1a')](_0x1c25d4);}return _0x568975[_0xfde5('0x1b')](_0x1c25d4)['end']();};}function respondWithResult(_0x5a6d8f,_0x3c6572){_0x3c6572=_0x3c6572||0xc8;return function(_0x33cbb4){if(_0x33cbb4){return _0x5a6d8f[_0xfde5('0x1b')](_0x3c6572)[_0xfde5('0x1c')](_0x33cbb4);}};}function respondWithFilteredResult(_0x2b4a12,_0x1272d4){return function(_0x448120){if(_0x448120){var _0x44b528=typeof _0x1272d4[_0xfde5('0x1d')]===_0xfde5('0x1e')&&typeof _0x1272d4[_0xfde5('0x1f')]===_0xfde5('0x1e');var _0x20e098=_0x448120[_0xfde5('0x20')];var _0x3d1382=_0x44b528?0x0:_0x1272d4[_0xfde5('0x1d')];var _0x40cbd7=_0x44b528?_0x448120[_0xfde5('0x20')]:_0x1272d4[_0xfde5('0x1d')]+_0x1272d4[_0xfde5('0x1f')];var _0x50fc69;if(_0x40cbd7>=_0x20e098){_0x40cbd7=_0x20e098;_0x50fc69=0xc8;}else{_0x50fc69=0xce;}_0x2b4a12[_0xfde5('0x1b')](_0x50fc69);return _0x2b4a12['set'](_0xfde5('0x21'),_0x3d1382+'-'+_0x40cbd7+'/'+_0x20e098)['json'](_0x448120);}return null;};}function patchUpdates(_0x371129){return function(_0x53f017){try{jsonpatch[_0xfde5('0x22')](_0x53f017,_0x371129,!![]);}catch(_0xadb69e){return BPromise['reject'](_0xadb69e);}return _0x53f017[_0xfde5('0x23')]();};}function saveUpdates(_0x22341e,_0x187cf3){return function(_0x5b1750){if(_0x5b1750){return _0x5b1750[_0xfde5('0x24')](_0x22341e)['then'](function(_0x292434){return _0x292434;});}return null;};}function removeEntity(_0x26770f,_0x3c69bd){return function(_0x35cd03){if(_0x35cd03){return _0x35cd03[_0xfde5('0x25')]()[_0xfde5('0x26')](function(){_0x26770f[_0xfde5('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e5155,_0x5981b2){return function(_0x208518){if(!_0x208518){_0x2e5155[_0xfde5('0x1a')](0x194);}return _0x208518;};}function handleError(_0x339563,_0x543626){_0x543626=_0x543626||0x1f4;return function(_0x8addb4){logger[_0xfde5('0x27')](_0x8addb4[_0xfde5('0x28')]);if(_0x8addb4[_0xfde5('0x29')]){delete _0x8addb4['name'];}_0x339563['status'](_0x543626)[_0xfde5('0x2a')](_0x8addb4);};}exports[_0xfde5('0x2b')]=function(_0x396cec,_0x4737e4){var _0xcc2310={},_0x33fd57={},_0x2d875e={'count':0x0,'rows':[]};var _0x215a01=_[_0xfde5('0x2c')](db['VoiceQueuesLog'][_0xfde5('0x2d')],function(_0x5b0cad){return{'name':_0x5b0cad['fieldName'],'type':_0x5b0cad[_0xfde5('0x2e')][_0xfde5('0x2f')]};});_0x33fd57[_0xfde5('0x30')]=_[_0xfde5('0x2c')](_0x215a01,_0xfde5('0x29'));_0x33fd57['query']=_[_0xfde5('0x31')](_0x396cec[_0xfde5('0x32')]);_0x33fd57[_0xfde5('0x33')]=_[_0xfde5('0x34')](_0x33fd57['model'],_0x33fd57[_0xfde5('0x32')]);_0xcc2310[_0xfde5('0x35')]=_[_0xfde5('0x34')](_0x33fd57[_0xfde5('0x30')],qs[_0xfde5('0x36')](_0x396cec[_0xfde5('0x32')]['fields']));_0xcc2310[_0xfde5('0x35')]=_0xcc2310[_0xfde5('0x35')][_0xfde5('0x37')]?_0xcc2310['attributes']:_0x33fd57[_0xfde5('0x30')];if(!_0x396cec[_0xfde5('0x32')][_0xfde5('0x38')](_0xfde5('0x39'))){_0xcc2310[_0xfde5('0x1f')]=qs[_0xfde5('0x1f')](_0x396cec[_0xfde5('0x32')][_0xfde5('0x1f')]);_0xcc2310[_0xfde5('0x1d')]=qs[_0xfde5('0x1d')](_0x396cec[_0xfde5('0x32')][_0xfde5('0x1d')]);}_0xcc2310['order']=qs[_0xfde5('0x3a')](_0x396cec[_0xfde5('0x32')][_0xfde5('0x3a')]);_0xcc2310[_0xfde5('0x3b')]=qs[_0xfde5('0x33')](_['pick'](_0x396cec[_0xfde5('0x32')],_0x33fd57[_0xfde5('0x33')]),_0x215a01);if(_0x396cec[_0xfde5('0x32')][_0xfde5('0x3c')]){_0xcc2310[_0xfde5('0x3b')]=_[_0xfde5('0x3d')](_0xcc2310[_0xfde5('0x3b')],{'$or':_['map'](_0x215a01,function(_0x21cb59){if(_0x21cb59[_0xfde5('0x2e')]!==_0xfde5('0x3e')){var _0x22c793={};_0x22c793[_0x21cb59['name']]={'$like':'%'+_0x396cec['query']['filter']+'%'};return _0x22c793;}})});}_0xcc2310=_[_0xfde5('0x3d')]({},_0xcc2310,_0x396cec[_0xfde5('0x3f')]);var _0x50de8f={'where':_0xcc2310[_0xfde5('0x3b')]};return db['VoiceQueuesLog'][_0xfde5('0x20')](_0x50de8f)[_0xfde5('0x26')](function(_0x2a2ff1){_0x2d875e[_0xfde5('0x20')]=_0x2a2ff1;if(_0x396cec[_0xfde5('0x32')][_0xfde5('0x40')]){_0xcc2310[_0xfde5('0x41')]=[{'all':!![]}];}return db['VoiceQueuesLog'][_0xfde5('0x42')](_0xcc2310);})['then'](function(_0x39e8fb){_0x2d875e[_0xfde5('0x43')]=_0x39e8fb;return _0x2d875e;})[_0xfde5('0x26')](respondWithFilteredResult(_0x4737e4,_0xcc2310))['catch'](handleError(_0x4737e4,null));};exports['show']=function(_0x4b5467,_0x3dc569){var _0x461b51={'raw':!![],'where':{'id':_0x4b5467[_0xfde5('0x44')]['id']}},_0x26fcbe={};_0x26fcbe[_0xfde5('0x30')]=_[_0xfde5('0x31')](db['VoiceQueuesLog'][_0xfde5('0x2d')]);_0x26fcbe[_0xfde5('0x32')]=_['keys'](_0x4b5467[_0xfde5('0x32')]);_0x26fcbe[_0xfde5('0x33')]=_[_0xfde5('0x34')](_0x26fcbe['model'],_0x26fcbe[_0xfde5('0x32')]);_0x461b51[_0xfde5('0x35')]=_[_0xfde5('0x34')](_0x26fcbe[_0xfde5('0x30')],qs[_0xfde5('0x36')](_0x4b5467[_0xfde5('0x32')][_0xfde5('0x36')]));_0x461b51['attributes']=_0x461b51[_0xfde5('0x35')][_0xfde5('0x37')]?_0x461b51['attributes']:_0x26fcbe['model'];if(_0x4b5467[_0xfde5('0x32')][_0xfde5('0x40')]){_0x461b51[_0xfde5('0x41')]=[{'all':!![]}];}_0x461b51=_['merge']({},_0x461b51,_0x4b5467[_0xfde5('0x3f')]);return db[_0xfde5('0x45')][_0xfde5('0x46')](_0x461b51)['then'](handleEntityNotFound(_0x3dc569,null))[_0xfde5('0x26')](respondWithResult(_0x3dc569,null))[_0xfde5('0x47')](handleError(_0x3dc569,null));};exports[_0xfde5('0x48')]=function(_0x572bcc,_0x246a4c){return db[_0xfde5('0x45')][_0xfde5('0x48')](_0x572bcc[_0xfde5('0x49')],{})[_0xfde5('0x26')](respondWithResult(_0x246a4c,0xc9))[_0xfde5('0x47')](handleError(_0x246a4c,null));};exports['update']=function(_0x246b16,_0x3d4d0e){if(_0x246b16[_0xfde5('0x49')]['id']){delete _0x246b16[_0xfde5('0x49')]['id'];}return db['VoiceQueuesLog'][_0xfde5('0x46')]({'where':{'id':_0x246b16[_0xfde5('0x44')]['id']}})[_0xfde5('0x26')](handleEntityNotFound(_0x3d4d0e,null))[_0xfde5('0x26')](saveUpdates(_0x246b16['body'],null))[_0xfde5('0x26')](respondWithResult(_0x3d4d0e,null))['catch'](handleError(_0x3d4d0e,null));};exports[_0xfde5('0x25')]=function(_0x2b056a,_0x2f9ffb){return db[_0xfde5('0x45')][_0xfde5('0x46')]({'where':{'id':_0x2b056a['params']['id']}})[_0xfde5('0x26')](handleEntityNotFound(_0x2f9ffb,null))[_0xfde5('0x26')](removeEntity(_0x2f9ffb,null))[_0xfde5('0x47')](handleError(_0x2f9ffb,null));}; \ No newline at end of file +var _0xa6c5=['findAll','catch','show','params','keys','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','undefined','count','offset','set','Content-Range','json','apply','update','then','destroy','error','name','index','map','rawAttributes','type','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','VoiceQueuesLog','includeAll','include'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa6c5,0xe9));var _0x5a6c=function(_0x2ca752,_0x2f5343){_0x2ca752=_0x2ca752-0x0;var _0x1c59a7=_0xa6c5[_0x2ca752];return _0x1c59a7;};'use strict';var emlformat=require(_0x5a6c('0x0'));var rimraf=require(_0x5a6c('0x1'));var zipdir=require(_0x5a6c('0x2'));var jsonpatch=require(_0x5a6c('0x3'));var rp=require(_0x5a6c('0x4'));var moment=require(_0x5a6c('0x5'));var BPromise=require(_0x5a6c('0x6'));var Mustache=require(_0x5a6c('0x7'));var util=require(_0x5a6c('0x8'));var path=require(_0x5a6c('0x9'));var sox=require(_0x5a6c('0xa'));var csv=require(_0x5a6c('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5a6c('0xc'));var squel=require(_0x5a6c('0xd'));var crypto=require(_0x5a6c('0xe'));var jsforce=require(_0x5a6c('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x5a6c('0xb'));var querystring=require(_0x5a6c('0x10'));var Papa=require(_0x5a6c('0x11'));var Redis=require('ioredis');var authService=require(_0x5a6c('0x12'));var qs=require(_0x5a6c('0x13'));var as=require(_0x5a6c('0x14'));var hardwareService=require(_0x5a6c('0x15'));var logger=require(_0x5a6c('0x16'))(_0x5a6c('0x17'));var utils=require(_0x5a6c('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x5a6c('0x19'));var db=require(_0x5a6c('0x1a'))['db'];function respondWithStatusCode(_0x5e16aa,_0x22e667){_0x22e667=_0x22e667||0xcc;return function(_0x1867f5){if(_0x1867f5){return _0x5e16aa[_0x5a6c('0x1b')](_0x22e667);}return _0x5e16aa[_0x5a6c('0x1c')](_0x22e667)[_0x5a6c('0x1d')]();};}function respondWithResult(_0x44df70,_0x307038){_0x307038=_0x307038||0xc8;return function(_0x27b8cb){if(_0x27b8cb){return _0x44df70[_0x5a6c('0x1c')](_0x307038)['json'](_0x27b8cb);}};}function respondWithFilteredResult(_0x54b846,_0x85cf3f){return function(_0x1c9425){if(_0x1c9425){var _0x131e98=typeof _0x85cf3f['offset']==='undefined'&&typeof _0x85cf3f[_0x5a6c('0x1e')]===_0x5a6c('0x1f');var _0x20b278=_0x1c9425[_0x5a6c('0x20')];var _0xb02796=_0x131e98?0x0:_0x85cf3f['offset'];var _0x742bbc=_0x131e98?_0x1c9425['count']:_0x85cf3f[_0x5a6c('0x21')]+_0x85cf3f['limit'];var _0x359ff3;if(_0x742bbc>=_0x20b278){_0x742bbc=_0x20b278;_0x359ff3=0xc8;}else{_0x359ff3=0xce;}_0x54b846[_0x5a6c('0x1c')](_0x359ff3);return _0x54b846[_0x5a6c('0x22')](_0x5a6c('0x23'),_0xb02796+'-'+_0x742bbc+'/'+_0x20b278)[_0x5a6c('0x24')](_0x1c9425);}return null;};}function patchUpdates(_0x3e6493){return function(_0x59c4d2){try{jsonpatch[_0x5a6c('0x25')](_0x59c4d2,_0x3e6493,!![]);}catch(_0x56427e){return BPromise['reject'](_0x56427e);}return _0x59c4d2['save']();};}function saveUpdates(_0x585172,_0x4e5033){return function(_0x144bd1){if(_0x144bd1){return _0x144bd1[_0x5a6c('0x26')](_0x585172)[_0x5a6c('0x27')](function(_0x23db26){return _0x23db26;});}return null;};}function removeEntity(_0x251e5f,_0x3bb4d6){return function(_0x4d4dd7){if(_0x4d4dd7){return _0x4d4dd7[_0x5a6c('0x28')]()[_0x5a6c('0x27')](function(){_0x251e5f[_0x5a6c('0x1c')](0xcc)[_0x5a6c('0x1d')]();});}};}function handleEntityNotFound(_0x2b292f,_0x1af2e5){return function(_0xa93415){if(!_0xa93415){_0x2b292f['sendStatus'](0x194);}return _0xa93415;};}function handleError(_0x582628,_0x4aaf00){_0x4aaf00=_0x4aaf00||0x1f4;return function(_0x1ed989){logger[_0x5a6c('0x29')](_0x1ed989['stack']);if(_0x1ed989[_0x5a6c('0x2a')]){delete _0x1ed989[_0x5a6c('0x2a')];}_0x582628['status'](_0x4aaf00)['send'](_0x1ed989);};}exports[_0x5a6c('0x2b')]=function(_0x140aa1,_0x4abf05){var _0x28e3c8={},_0x206b10={},_0x2fac3d={'count':0x0,'rows':[]};var _0x5341e5=_[_0x5a6c('0x2c')](db['VoiceQueuesLog'][_0x5a6c('0x2d')],function(_0x550420){return{'name':_0x550420['fieldName'],'type':_0x550420[_0x5a6c('0x2e')]['key']};});_0x206b10[_0x5a6c('0x2f')]=_[_0x5a6c('0x2c')](_0x5341e5,'name');_0x206b10[_0x5a6c('0x30')]=_['keys'](_0x140aa1[_0x5a6c('0x30')]);_0x206b10[_0x5a6c('0x31')]=_['intersection'](_0x206b10[_0x5a6c('0x2f')],_0x206b10['query']);_0x28e3c8[_0x5a6c('0x32')]=_[_0x5a6c('0x33')](_0x206b10[_0x5a6c('0x2f')],qs['fields'](_0x140aa1[_0x5a6c('0x30')][_0x5a6c('0x34')]));_0x28e3c8[_0x5a6c('0x32')]=_0x28e3c8[_0x5a6c('0x32')][_0x5a6c('0x35')]?_0x28e3c8['attributes']:_0x206b10[_0x5a6c('0x2f')];if(!_0x140aa1[_0x5a6c('0x30')][_0x5a6c('0x36')](_0x5a6c('0x37'))){_0x28e3c8['limit']=qs['limit'](_0x140aa1[_0x5a6c('0x30')][_0x5a6c('0x1e')]);_0x28e3c8[_0x5a6c('0x21')]=qs[_0x5a6c('0x21')](_0x140aa1[_0x5a6c('0x30')]['offset']);}_0x28e3c8[_0x5a6c('0x38')]=qs[_0x5a6c('0x39')](_0x140aa1[_0x5a6c('0x30')]['sort']);_0x28e3c8[_0x5a6c('0x3a')]=qs[_0x5a6c('0x31')](_[_0x5a6c('0x3b')](_0x140aa1[_0x5a6c('0x30')],_0x206b10[_0x5a6c('0x31')]),_0x5341e5);if(_0x140aa1[_0x5a6c('0x30')]['filter']){_0x28e3c8[_0x5a6c('0x3a')]=_['merge'](_0x28e3c8[_0x5a6c('0x3a')],{'$or':_[_0x5a6c('0x2c')](_0x5341e5,function(_0x5a2c29){if(_0x5a2c29[_0x5a6c('0x2e')]!==_0x5a6c('0x3c')){var _0x4e6a40={};_0x4e6a40[_0x5a2c29[_0x5a6c('0x2a')]]={'$like':'%'+_0x140aa1[_0x5a6c('0x30')][_0x5a6c('0x3d')]+'%'};return _0x4e6a40;}})});}_0x28e3c8=_[_0x5a6c('0x3e')]({},_0x28e3c8,_0x140aa1[_0x5a6c('0x3f')]);var _0x449e1a={'where':_0x28e3c8[_0x5a6c('0x3a')]};return db[_0x5a6c('0x40')]['count'](_0x449e1a)[_0x5a6c('0x27')](function(_0x2c0919){_0x2fac3d['count']=_0x2c0919;if(_0x140aa1[_0x5a6c('0x30')][_0x5a6c('0x41')]){_0x28e3c8[_0x5a6c('0x42')]=[{'all':!![]}];}return db[_0x5a6c('0x40')][_0x5a6c('0x43')](_0x28e3c8);})['then'](function(_0x145d9){_0x2fac3d['rows']=_0x145d9;return _0x2fac3d;})[_0x5a6c('0x27')](respondWithFilteredResult(_0x4abf05,_0x28e3c8))[_0x5a6c('0x44')](handleError(_0x4abf05,null));};exports[_0x5a6c('0x45')]=function(_0x2861c7,_0x41ba27){var _0x2554b2={'raw':!![],'where':{'id':_0x2861c7[_0x5a6c('0x46')]['id']}},_0x1cd27a={};_0x1cd27a[_0x5a6c('0x2f')]=_['keys'](db[_0x5a6c('0x40')]['rawAttributes']);_0x1cd27a[_0x5a6c('0x30')]=_[_0x5a6c('0x47')](_0x2861c7[_0x5a6c('0x30')]);_0x1cd27a['filters']=_[_0x5a6c('0x33')](_0x1cd27a[_0x5a6c('0x2f')],_0x1cd27a[_0x5a6c('0x30')]);_0x2554b2[_0x5a6c('0x32')]=_[_0x5a6c('0x33')](_0x1cd27a['model'],qs[_0x5a6c('0x34')](_0x2861c7[_0x5a6c('0x30')][_0x5a6c('0x34')]));_0x2554b2[_0x5a6c('0x32')]=_0x2554b2['attributes'][_0x5a6c('0x35')]?_0x2554b2[_0x5a6c('0x32')]:_0x1cd27a[_0x5a6c('0x2f')];if(_0x2861c7['query'][_0x5a6c('0x41')]){_0x2554b2[_0x5a6c('0x42')]=[{'all':!![]}];}_0x2554b2=_['merge']({},_0x2554b2,_0x2861c7[_0x5a6c('0x3f')]);return db[_0x5a6c('0x40')][_0x5a6c('0x48')](_0x2554b2)[_0x5a6c('0x27')](handleEntityNotFound(_0x41ba27,null))[_0x5a6c('0x27')](respondWithResult(_0x41ba27,null))[_0x5a6c('0x44')](handleError(_0x41ba27,null));};exports[_0x5a6c('0x49')]=function(_0x4a5d95,_0x345e97){return db['VoiceQueuesLog'][_0x5a6c('0x49')](_0x4a5d95[_0x5a6c('0x4a')],{})['then'](respondWithResult(_0x345e97,0xc9))[_0x5a6c('0x44')](handleError(_0x345e97,null));};exports['update']=function(_0x10f012,_0x15f3a){if(_0x10f012[_0x5a6c('0x4a')]['id']){delete _0x10f012[_0x5a6c('0x4a')]['id'];}return db[_0x5a6c('0x40')]['find']({'where':{'id':_0x10f012[_0x5a6c('0x46')]['id']}})[_0x5a6c('0x27')](handleEntityNotFound(_0x15f3a,null))['then'](saveUpdates(_0x10f012[_0x5a6c('0x4a')],null))[_0x5a6c('0x27')](respondWithResult(_0x15f3a,null))[_0x5a6c('0x44')](handleError(_0x15f3a,null));};exports[_0x5a6c('0x28')]=function(_0xc87842,_0x30ecf1){return db['VoiceQueuesLog'][_0x5a6c('0x48')]({'where':{'id':_0xc87842[_0x5a6c('0x46')]['id']}})[_0x5a6c('0x27')](handleEntityNotFound(_0x30ecf1,null))[_0x5a6c('0x27')](removeEntity(_0x30ecf1,null))[_0x5a6c('0x44')](handleError(_0x30ecf1,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 484f09e..cb144da 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 _0xac8b=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','voice_queues_log','event','dtm'];(function(_0x1f1ea7,_0x4e468e){var _0x1c38ca=function(_0x61cafa){while(--_0x61cafa){_0x1f1ea7['push'](_0x1f1ea7['shift']());}};_0x1c38ca(++_0x4e468e);}(_0xac8b,0x1c2));var _0xbac8=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xac8b[_0x5037ab];return _0x512adb;};'use strict';var _=require('lodash');var util=require(_0xbac8('0x0'));var logger=require(_0xbac8('0x1'))('api');var moment=require(_0xbac8('0x2'));var BPromise=require(_0xbac8('0x3'));var rp=require(_0xbac8('0x4'));var fs=require('fs');var path=require(_0xbac8('0x5'));var rimraf=require(_0xbac8('0x6'));var config=require(_0xbac8('0x7'));var attributes=require(_0xbac8('0x8'));module[_0xbac8('0x9')]=function(_0x329e46,_0x2c9733){return _0x329e46[_0xbac8('0xa')](_0xbac8('0xb'),attributes,{'tableName':_0xbac8('0xc'),'paranoid':![],'indexes':[{'name':'event_dtm','fields':[_0xbac8('0xd'),_0xbac8('0xe')]}],'timestamps':![]});}; \ No newline at end of file +var _0x4579=['voice_queues_log','event','dtm','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x441ed2,_0x3d9f56){var _0x45b60e=function(_0x3c62f1){while(--_0x3c62f1){_0x441ed2['push'](_0x441ed2['shift']());}};_0x45b60e(++_0x3d9f56);}(_0x4579,0x1d7));var _0x9457=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4579[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x9457('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9457('0x1'));var moment=require(_0x9457('0x2'));var BPromise=require(_0x9457('0x3'));var rp=require(_0x9457('0x4'));var fs=require('fs');var path=require(_0x9457('0x5'));var rimraf=require(_0x9457('0x6'));var config=require(_0x9457('0x7'));var attributes=require('./voiceQueuesLog.attributes');module[_0x9457('0x8')]=function(_0x364bc5,_0x3b308b){return _0x364bc5[_0x9457('0x9')]('VoiceQueuesLog',attributes,{'tableName':_0x9457('0xa'),'paranoid':![],'indexes':[{'name':'event_dtm','fields':[_0x9457('0xb'),_0x9457('0xc')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index ac3a822..a793411 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 _0x58a7=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x46f587,_0x34fdcb){var _0x9a818f=function(_0x12af2e){while(--_0x12af2e){_0x46f587['push'](_0x46f587['shift']());}};_0x9a818f(++_0x34fdcb);}(_0x58a7,0xf7));var _0x758a=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x58a7[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x758a('0x0'));var util=require(_0x758a('0x1'));var moment=require(_0x758a('0x2'));var BPromise=require(_0x758a('0x3'));var rs=require(_0x758a('0x4'));var fs=require('fs');var Redis=require(_0x758a('0x5'));var db=require(_0x758a('0x6'))['db'];var utils=require(_0x758a('0x7'));var logger=require('../../config/logger')(_0x758a('0x8'));var config=require(_0x758a('0x9'));var jayson=require(_0x758a('0xa'));var client=jayson[_0x758a('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x52bc94,_0x232c83,_0x514bca){return new BPromise(function(_0x227bdb,_0x31311b){return client[_0x758a('0xc')](_0x52bc94,_0x514bca)[_0x758a('0xd')](function(_0x1e5665){logger[_0x758a('0xe')](_0x758a('0xf'),_0x232c83,_0x758a('0x10'));logger[_0x758a('0x11')](_0x758a('0x12'),_0x232c83,_0x758a('0x10'),JSON['stringify'](_0x1e5665));if(_0x1e5665['error']){if(_0x1e5665[_0x758a('0x13')][_0x758a('0x14')]===0x1f4){logger[_0x758a('0x13')]('VoiceQueuesLog,\x20%s,\x20%s',_0x232c83,_0x1e5665[_0x758a('0x13')][_0x758a('0x15')]);return _0x31311b(_0x1e5665[_0x758a('0x13')][_0x758a('0x15')]);}logger[_0x758a('0x13')]('VoiceQueuesLog,\x20%s,\x20%s',_0x232c83,_0x1e5665['error'][_0x758a('0x15')]);return _0x227bdb(_0x1e5665[_0x758a('0x13')][_0x758a('0x15')]);}else{logger['info']('VoiceQueuesLog,\x20%s,\x20%s',_0x232c83,'request\x20sent');_0x227bdb(_0x1e5665['result'][_0x758a('0x15')]);}})[_0x758a('0x16')](function(_0x520883){logger[_0x758a('0x13')](_0x758a('0xf'),_0x232c83,_0x520883);_0x31311b(_0x520883);});});} \ No newline at end of file +var _0x3140=['jayson/promise','client','http','request','info','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceQueuesLog,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x37f70c,_0xab98f1){var _0x5044f9=function(_0x3edc6d){while(--_0x3edc6d){_0x37f70c['push'](_0x37f70c['shift']());}};_0x5044f9(++_0xab98f1);}(_0x3140,0xaf));var _0x0314=function(_0x5e709a,_0x1d7975){_0x5e709a=_0x5e709a-0x0;var _0x57401a=_0x3140[_0x5e709a];return _0x57401a;};'use strict';var _=require(_0x0314('0x0'));var util=require(_0x0314('0x1'));var moment=require(_0x0314('0x2'));var BPromise=require(_0x0314('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0314('0x4'))['db'];var utils=require(_0x0314('0x5'));var logger=require(_0x0314('0x6'))(_0x0314('0x7'));var config=require(_0x0314('0x8'));var jayson=require(_0x0314('0x9'));var client=jayson[_0x0314('0xa')][_0x0314('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x11ee94,_0x44762d,_0x176944){return new BPromise(function(_0x495b27,_0x26031f){return client[_0x0314('0xc')](_0x11ee94,_0x176944)['then'](function(_0x5e9bca){logger[_0x0314('0xd')]('VoiceQueuesLog,\x20%s,\x20%s',_0x44762d,_0x0314('0xe'));logger[_0x0314('0xf')](_0x0314('0x10'),_0x44762d,_0x0314('0xe'),JSON[_0x0314('0x11')](_0x5e9bca));if(_0x5e9bca[_0x0314('0x12')]){if(_0x5e9bca['error'][_0x0314('0x13')]===0x1f4){logger[_0x0314('0x12')](_0x0314('0x14'),_0x44762d,_0x5e9bca[_0x0314('0x12')][_0x0314('0x15')]);return _0x26031f(_0x5e9bca[_0x0314('0x12')][_0x0314('0x15')]);}logger['error'](_0x0314('0x14'),_0x44762d,_0x5e9bca[_0x0314('0x12')][_0x0314('0x15')]);return _0x495b27(_0x5e9bca[_0x0314('0x12')][_0x0314('0x15')]);}else{logger[_0x0314('0xd')](_0x0314('0x14'),_0x44762d,_0x0314('0xe'));_0x495b27(_0x5e9bca['result'][_0x0314('0x15')]);}})[_0x0314('0x16')](function(_0x1f23c6){logger['error'](_0x0314('0x14'),_0x44762d,_0x1f23c6);_0x26031f(_0x1f23c6);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 28ff793..3eba9f4 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 _0xe5d1=['../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/describe','download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','post','create','put','update','delete','/:id','destroy','exports','multer','util','Router','fs-extra'];(function(_0x14d3cc,_0x567831){var _0x1f822b=function(_0x1eeeb9){while(--_0x1eeeb9){_0x14d3cc['push'](_0x14d3cc['shift']());}};_0x1f822b(++_0x567831);}(_0xe5d1,0x155));var _0x1e5d=function(_0xf8886b,_0x504891){_0xf8886b=_0xf8886b-0x0;var _0x321bd5=_0xe5d1[_0xf8886b];return _0x321bd5;};'use strict';var multer=require(_0x1e5d('0x0'));var util=require(_0x1e5d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1e5d('0x2')]();var fs_extra=require(_0x1e5d('0x3'));var auth=require(_0x1e5d('0x4'));var interaction=require(_0x1e5d('0x5'));var config=require('../../config/environment');var controller=require('./voiceRecording.controller');router['get']('/',auth[_0x1e5d('0x6')](),controller[_0x1e5d('0x7')]);router[_0x1e5d('0x8')](_0x1e5d('0x9'),auth[_0x1e5d('0x6')](),controller['describe']);router[_0x1e5d('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x1e5d('0x8')]('/:id/download',auth[_0x1e5d('0x6')](),controller[_0x1e5d('0xa')]);router[_0x1e5d('0x8')](_0x1e5d('0xb'),controller[_0x1e5d('0xc')]);router[_0x1e5d('0x8')](_0x1e5d('0xd'),auth[_0x1e5d('0x6')](),controller[_0x1e5d('0xe')]);router[_0x1e5d('0xf')]('/',auth[_0x1e5d('0x6')](),controller[_0x1e5d('0x10')]);router[_0x1e5d('0xf')](_0x1e5d('0xd'),auth[_0x1e5d('0x6')](),controller['runTranscribe']);router[_0x1e5d('0x11')]('/:id',auth[_0x1e5d('0x6')](),controller[_0x1e5d('0x12')]);router[_0x1e5d('0x13')](_0x1e5d('0x14'),auth['isAuthenticated'](),controller[_0x1e5d('0x15')]);module[_0x1e5d('0x16')]=router; \ No newline at end of file +var _0xd29d=['get','/describe','describe','/:id','show','/:id/download','download','/:id/downloads','downloads','downloadTranscribe','create','post','/:id/transcribe','runTranscribe','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceRecording.controller','isAuthenticated','index'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0xd29d,0x13e));var _0xdd29=function(_0x183ca5,_0x1e95f0){_0x183ca5=_0x183ca5-0x0;var _0x8c638=_0xd29d[_0x183ca5];return _0x8c638;};'use strict';var multer=require(_0xdd29('0x0'));var util=require(_0xdd29('0x1'));var path=require(_0xdd29('0x2'));var timeout=require(_0xdd29('0x3'));var express=require(_0xdd29('0x4'));var router=express[_0xdd29('0x5')]();var fs_extra=require(_0xdd29('0x6'));var auth=require(_0xdd29('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xdd29('0x8'));var controller=require(_0xdd29('0x9'));router['get']('/',auth[_0xdd29('0xa')](),controller[_0xdd29('0xb')]);router[_0xdd29('0xc')](_0xdd29('0xd'),auth[_0xdd29('0xa')](),controller[_0xdd29('0xe')]);router[_0xdd29('0xc')](_0xdd29('0xf'),auth[_0xdd29('0xa')](),controller[_0xdd29('0x10')]);router[_0xdd29('0xc')](_0xdd29('0x11'),auth[_0xdd29('0xa')](),controller[_0xdd29('0x12')]);router[_0xdd29('0xc')](_0xdd29('0x13'),controller[_0xdd29('0x14')]);router[_0xdd29('0xc')]('/:id/transcribe',auth[_0xdd29('0xa')](),controller[_0xdd29('0x15')]);router['post']('/',auth[_0xdd29('0xa')](),controller[_0xdd29('0x16')]);router[_0xdd29('0x17')](_0xdd29('0x18'),auth[_0xdd29('0xa')](),controller[_0xdd29('0x19')]);router[_0xdd29('0x1a')](_0xdd29('0xf'),auth[_0xdd29('0xa')](),controller[_0xdd29('0x1b')]);router['delete'](_0xdd29('0xf'),auth['isAuthenticated'](),controller[_0xdd29('0x1c')]);module[_0xdd29('0x1d')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 2bec44b..b28b65d 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(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'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(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'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 e7fc09f..5acb907 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 _0xfe6d=['runTranscribe','findOne','secrets','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','language','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','Cloud\x20Provider\x20not\x20available','data1','data2','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','transcribeRegion','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','IN_PROGRESS','tempSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','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','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','reject','update','then','destroy','error','name','send','index','VoiceRecording','rawAttributes','fieldName','type','differenceBy','map','format','query','keys','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','filters','merge','VIRTUAL','filter','options','findAll','rows','catch','show','params','length','includeAll','find','create','body','describe','download','uniqueid','value','%s.cypher','recording','filename','extname','unlink','message','VoiceRecording\x20not\x20found','Not\x20found','downloads','../../components/encryptor','sequelize','MD5','col','token','$and','push','existsSync','decryptFile','Sequelize','ValidationError','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','listBuckets','upload','TranscribeService','startTranscriptionJob','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','TranscriptionJob','transcribeName','TranscriptionJobName','transcribeStatus','TranscriptionJobStatus'];(function(_0x401b79,_0x3ac9b1){var _0x4ab64a=function(_0xb841ad){while(--_0xb841ad){_0x401b79['push'](_0x401b79['shift']());}};_0x4ab64a(++_0x3ac9b1);}(_0xfe6d,0xbd));var _0xdfe6=function(_0x58dc25,_0x49b9d5){_0x58dc25=_0x58dc25-0x0;var _0x21b0a7=_0xfe6d[_0x58dc25];return _0x21b0a7;};'use strict';var emlformat=require(_0xdfe6('0x0'));var rimraf=require(_0xdfe6('0x1'));var zipdir=require(_0xdfe6('0x2'));var jsonpatch=require(_0xdfe6('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xdfe6('0x4'));var Mustache=require(_0xdfe6('0x5'));var util=require(_0xdfe6('0x6'));var path=require(_0xdfe6('0x7'));var sox=require(_0xdfe6('0x8'));var csv=require('to-csv');var ejs=require(_0xdfe6('0x9'));var fs=require('fs');var fs_extra=require(_0xdfe6('0xa'));var _=require(_0xdfe6('0xb'));var squel=require(_0xdfe6('0xc'));var crypto=require(_0xdfe6('0xd'));var jsforce=require(_0xdfe6('0xe'));var deskjs=require(_0xdfe6('0xf'));var toCsv=require(_0xdfe6('0x10'));var querystring=require(_0xdfe6('0x11'));var Papa=require(_0xdfe6('0x12'));var AWS=require('aws-sdk');var uuidv4=require(_0xdfe6('0x13'));var Redis=require(_0xdfe6('0x14'));var authService=require(_0xdfe6('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0xdfe6('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdfe6('0x17'))(_0xdfe6('0x18'));var utils=require(_0xdfe6('0x19'));var config=require(_0xdfe6('0x1a'));var licenseUtil=require(_0xdfe6('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x23fc47,_0xc4d797){_0xc4d797=_0xc4d797||0xcc;return function(_0x35d01f){if(_0x35d01f){return _0x23fc47['sendStatus'](_0xc4d797);}return _0x23fc47[_0xdfe6('0x1c')](_0xc4d797)[_0xdfe6('0x1d')]();};}function respondWithResult(_0x22debe,_0x538662){_0x538662=_0x538662||0xc8;return function(_0x2ee58a){if(_0x2ee58a){return _0x22debe['status'](_0x538662)[_0xdfe6('0x1e')](_0x2ee58a);}};}function respondWithFilteredResult(_0x37b55f,_0x2c3a6d){return function(_0x365c50){if(_0x365c50){var _0x5dd40a=typeof _0x2c3a6d[_0xdfe6('0x1f')]===_0xdfe6('0x20')&&typeof _0x2c3a6d[_0xdfe6('0x21')]===_0xdfe6('0x20');var _0xf636d1=_0x365c50['count'];var _0x16a5a2=_0x5dd40a?0x0:_0x2c3a6d[_0xdfe6('0x1f')];var _0x494933=_0x5dd40a?_0x365c50[_0xdfe6('0x22')]:_0x2c3a6d['offset']+_0x2c3a6d[_0xdfe6('0x21')];var _0x2e50e1;if(_0x494933>=_0xf636d1){_0x494933=_0xf636d1;_0x2e50e1=0xc8;}else{_0x2e50e1=0xce;}_0x37b55f['status'](_0x2e50e1);return _0x37b55f[_0xdfe6('0x23')]('Content-Range',_0x16a5a2+'-'+_0x494933+'/'+_0xf636d1)[_0xdfe6('0x1e')](_0x365c50);}return null;};}function patchUpdates(_0x4be4c4){return function(_0x49bd90){try{jsonpatch['apply'](_0x49bd90,_0x4be4c4,!![]);}catch(_0x308736){return BPromise[_0xdfe6('0x24')](_0x308736);}return _0x49bd90['save']();};}function saveUpdates(_0x484fb5,_0x48b2f0){return function(_0x4219ca){if(_0x4219ca){return _0x4219ca[_0xdfe6('0x25')](_0x484fb5)[_0xdfe6('0x26')](function(_0x515e4f){return _0x515e4f;});}return null;};}function removeEntity(_0x123c6e,_0x320ecf){return function(_0x5dd969){if(_0x5dd969){return _0x5dd969[_0xdfe6('0x27')]()['then'](function(){_0x123c6e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x42a73a,_0x2ad653){return function(_0x46cebd){if(!_0x46cebd){_0x42a73a['sendStatus'](0x194);}return _0x46cebd;};}function handleError(_0x4cef01,_0x52fe46){_0x52fe46=_0x52fe46||0x1f4;return function(_0x3f1a89){logger[_0xdfe6('0x28')](_0x3f1a89['stack']);if(_0x3f1a89[_0xdfe6('0x29')]){delete _0x3f1a89['name'];}_0x4cef01['status'](_0x52fe46)[_0xdfe6('0x2a')](_0x3f1a89);};}exports[_0xdfe6('0x2b')]=function(_0x348ace,_0x47d26b){var _0x4350fe={},_0x460f5a={},_0x55ce48={'count':0x0,'rows':[]};var _0x4ff609=_['map'](db[_0xdfe6('0x2c')][_0xdfe6('0x2d')],function(_0x26f5e9){return{'name':_0x26f5e9[_0xdfe6('0x2e')],'type':_0x26f5e9[_0xdfe6('0x2f')]['key']};});_0x460f5a['model']=_[_0xdfe6('0x30')](_[_0xdfe6('0x31')](_0x4ff609,_0xdfe6('0x29')),[_0xdfe6('0x32')]);_0x460f5a[_0xdfe6('0x33')]=_[_0xdfe6('0x34')](_0x348ace[_0xdfe6('0x33')]);_0x460f5a['filters']=_[_0xdfe6('0x35')](_0x460f5a[_0xdfe6('0x36')],_0x460f5a[_0xdfe6('0x33')]);_0x4350fe[_0xdfe6('0x37')]=_[_0xdfe6('0x35')](_0x460f5a[_0xdfe6('0x36')],qs[_0xdfe6('0x38')](_0x348ace[_0xdfe6('0x33')][_0xdfe6('0x38')]));_0x4350fe['attributes']=_0x4350fe['attributes']['length']?_0x4350fe[_0xdfe6('0x37')]:_0x460f5a[_0xdfe6('0x36')];if(!_0x348ace[_0xdfe6('0x33')][_0xdfe6('0x39')]('nolimit')){_0x4350fe['limit']=qs[_0xdfe6('0x21')](_0x348ace[_0xdfe6('0x33')]['limit']);_0x4350fe[_0xdfe6('0x1f')]=qs[_0xdfe6('0x1f')](_0x348ace['query']['offset']);}_0x4350fe[_0xdfe6('0x3a')]=qs[_0xdfe6('0x3b')](_0x348ace[_0xdfe6('0x33')]['sort']);_0x4350fe[_0xdfe6('0x3c')]=qs[_0xdfe6('0x3d')](_['pick'](_0x348ace[_0xdfe6('0x33')],_0x460f5a[_0xdfe6('0x3d')]),_0x4ff609);if(_0x348ace[_0xdfe6('0x33')]['filter']){_0x4350fe[_0xdfe6('0x3c')]=_[_0xdfe6('0x3e')](_0x4350fe[_0xdfe6('0x3c')],{'$or':_[_0xdfe6('0x31')](_0x4ff609,function(_0x2996ad){if(_0x2996ad[_0xdfe6('0x2f')]!==_0xdfe6('0x3f')){var _0x1ab3db={};_0x1ab3db[_0x2996ad[_0xdfe6('0x29')]]={'$like':'%'+_0x348ace['query'][_0xdfe6('0x40')]+'%'};return _0x1ab3db;}})});}_0x4350fe=_[_0xdfe6('0x3e')]({},_0x4350fe,_0x348ace[_0xdfe6('0x41')]);var _0x51360e={'where':_0x4350fe[_0xdfe6('0x3c')]};return db[_0xdfe6('0x2c')][_0xdfe6('0x22')](_0x51360e)[_0xdfe6('0x26')](function(_0x37b322){_0x55ce48[_0xdfe6('0x22')]=_0x37b322;if(_0x348ace[_0xdfe6('0x33')]['includeAll']){_0x4350fe['include']=[{'all':!![]}];}return db[_0xdfe6('0x2c')][_0xdfe6('0x42')](_0x4350fe);})['then'](function(_0x2a9b60){_0x55ce48[_0xdfe6('0x43')]=_0x2a9b60;return _0x55ce48;})[_0xdfe6('0x26')](respondWithFilteredResult(_0x47d26b,_0x4350fe))[_0xdfe6('0x44')](handleError(_0x47d26b,null));};exports[_0xdfe6('0x45')]=function(_0x470a89,_0x3575bf){var _0x12d5b8={'raw':![],'where':{'id':_0x470a89[_0xdfe6('0x46')]['id']}},_0x3ea0b4={};_0x3ea0b4[_0xdfe6('0x36')]=_['keys'](db[_0xdfe6('0x2c')]['rawAttributes']);_0x3ea0b4[_0xdfe6('0x33')]=_['keys'](_0x470a89['query']);_0x3ea0b4[_0xdfe6('0x3d')]=_[_0xdfe6('0x35')](_0x3ea0b4[_0xdfe6('0x36')],_0x3ea0b4[_0xdfe6('0x33')]);_0x12d5b8[_0xdfe6('0x37')]=_[_0xdfe6('0x35')](_0x3ea0b4[_0xdfe6('0x36')],qs[_0xdfe6('0x38')](_0x470a89[_0xdfe6('0x33')][_0xdfe6('0x38')]));_0x12d5b8[_0xdfe6('0x37')]=_0x12d5b8['attributes'][_0xdfe6('0x47')]?_0x12d5b8['attributes']:_0x3ea0b4[_0xdfe6('0x36')];if(_0x470a89['query'][_0xdfe6('0x48')]){_0x12d5b8['include']=[{'all':!![]}];}_0x12d5b8=_[_0xdfe6('0x3e')]({},_0x12d5b8,_0x470a89[_0xdfe6('0x41')]);return db[_0xdfe6('0x2c')][_0xdfe6('0x49')](_0x12d5b8)[_0xdfe6('0x26')](handleEntityNotFound(_0x3575bf,null))[_0xdfe6('0x26')](respondWithResult(_0x3575bf,null))[_0xdfe6('0x44')](handleError(_0x3575bf,null));};exports[_0xdfe6('0x4a')]=function(_0x4f2411,_0x1e7d8d){return db[_0xdfe6('0x2c')]['create'](_0x4f2411['body'],{})['then'](respondWithResult(_0x1e7d8d,0xc9))[_0xdfe6('0x44')](handleError(_0x1e7d8d,null));};exports['update']=function(_0x613516,_0x3c9380){if(_0x613516[_0xdfe6('0x4b')]['id']){delete _0x613516[_0xdfe6('0x4b')]['id'];}return db[_0xdfe6('0x2c')][_0xdfe6('0x49')]({'where':{'id':_0x613516[_0xdfe6('0x46')]['id']}})[_0xdfe6('0x26')](handleEntityNotFound(_0x3c9380,null))[_0xdfe6('0x26')](saveUpdates(_0x613516[_0xdfe6('0x4b')],null))[_0xdfe6('0x26')](respondWithResult(_0x3c9380,null))['catch'](handleError(_0x3c9380,null));};exports[_0xdfe6('0x4c')]=function(_0x1162dc,_0x119a6b){return db[_0xdfe6('0x2c')][_0xdfe6('0x4c')]()['then'](respondWithResult(_0x119a6b,null))[_0xdfe6('0x44')](handleError(_0x119a6b,null));};exports[_0xdfe6('0x4d')]=function(_0x1a9b2d,_0x21200f,_0x112af7){var _0xce9e2d=require('../../components/encryptor');var _0x421156=![];var _0x1542d7={};if(_0x1a9b2d['query'][_0xdfe6('0x2f')]&&_0x1a9b2d[_0xdfe6('0x33')][_0xdfe6('0x2f')]==='uniqueid'){_0x1542d7[_0xdfe6('0x4e')]=_0x1a9b2d[_0xdfe6('0x46')]['id'];}else{_0x1542d7['id']=_0x1a9b2d[_0xdfe6('0x46')]['id'];}return db[_0xdfe6('0x2c')]['find']({'where':_0x1542d7,'attributes':['id',_0xdfe6('0x4f')],'raw':!![]})[_0xdfe6('0x26')](handleEntityNotFound(_0x21200f,null))['then'](function(_0x4ffcaa){if(_0x4ffcaa){var _0x4fe37e=_0x4ffcaa[_0xdfe6('0x4f')];var _0x1a5dfd=util[_0xdfe6('0x32')](_0xdfe6('0x50'),_0x4fe37e);if(fs['existsSync'](_0x1a5dfd)){_0x421156=!![];return _0xce9e2d['decryptFile'](_0x1a5dfd,_0x4fe37e,config['secrets'][_0xdfe6('0x51')])[_0xdfe6('0x26')](function(){return _0x4ffcaa;});}return _0x4ffcaa;}})[_0xdfe6('0x26')](function(_0x44e05d){if(_0x44e05d){var _0x5c7ca4=_0x44e05d[_0xdfe6('0x4f')];if(!fs['existsSync'](_0x5c7ca4)){throw new db['Sequelize']['ValidationError']('VoiceRecording\x20not\x20found');}if(_0x44e05d[_0xdfe6('0x52')]){return _0x21200f[_0xdfe6('0x4d')](_0x5c7ca4,_0x44e05d['filename']+path[_0xdfe6('0x53')](_0x5c7ca4),function(){if(_0x421156){fs[_0xdfe6('0x54')](_0x5c7ca4);}});}else{return _0x21200f[_0xdfe6('0x4d')](_0x5c7ca4,function(_0x534bba){if(_0x421156){fs[_0xdfe6('0x54')](_0x5c7ca4);}});}}})[_0xdfe6('0x44')](function(_0x57b218){if(_0x57b218[_0xdfe6('0x55')]===_0xdfe6('0x56')){_0x21200f[_0xdfe6('0x1c')](0x194)[_0xdfe6('0x2a')](_0xdfe6('0x57'));}else{return handleError(_0x21200f,null);}});};exports[_0xdfe6('0x58')]=function(_0x467343,_0x3e8778,_0x3e968b){var _0x190faa=require(_0xdfe6('0x59'));var _0x5a84d4=![];var _0x2f7db0={'$and':[db[_0xdfe6('0x5a')][_0xdfe6('0x3c')](db[_0xdfe6('0x5a')]['fn'](_0xdfe6('0x5b'),db[_0xdfe6('0x5a')][_0xdfe6('0x5c')](_0xdfe6('0x4e'))),_0x467343['query'][_0xdfe6('0x5d')])]};if(_0x467343['query']['type']&&_0x467343['query'][_0xdfe6('0x2f')]===_0xdfe6('0x4e')){_0x2f7db0[_0xdfe6('0x5e')][_0xdfe6('0x5f')]({'uniqueid':_0x467343[_0xdfe6('0x46')]['id']});}else{_0x2f7db0[_0xdfe6('0x5e')][_0xdfe6('0x5f')]({'id':_0x467343['params']['id']});}return db['VoiceRecording']['find']({'where':_0x2f7db0,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0x3e8778,null))[_0xdfe6('0x26')](function(_0x3a0942){if(_0x3a0942){var _0x2471f5=util[_0xdfe6('0x32')](_0xdfe6('0x50'),_0x3a0942['value']);if(fs[_0xdfe6('0x60')](_0x2471f5)){_0x5a84d4=!![];return _0x190faa[_0xdfe6('0x61')](_0x2471f5,_0x3a0942[_0xdfe6('0x4f')],config['secrets'][_0xdfe6('0x51')])[_0xdfe6('0x26')](function(){return _0x3a0942;});}return _0x3a0942;}})['then'](function(_0x14d210){if(_0x14d210){if(!fs[_0xdfe6('0x60')](_0x14d210['value'])){throw new db[(_0xdfe6('0x62'))][(_0xdfe6('0x63'))](_0xdfe6('0x56'));}if(_0x14d210[_0xdfe6('0x52')]){return _0x3e8778[_0xdfe6('0x4d')](_0x14d210['value'],_0x14d210[_0xdfe6('0x52')]+path['extname'](_0x14d210[_0xdfe6('0x4f')]),function(){if(_0x5a84d4){fs[_0xdfe6('0x54')](_0x14d210[_0xdfe6('0x4f')]);}});}else{return _0x3e8778[_0xdfe6('0x4d')](_0x14d210[_0xdfe6('0x4f')],function(_0x439c8f){if(_0x5a84d4){fs[_0xdfe6('0x54')](_0x14d210['value']);}});}}})[_0xdfe6('0x44')](handleError(_0x3e8778,null));};exports[_0xdfe6('0x27')]=function(_0x318125,_0x2e74aa){return db['VoiceRecording'][_0xdfe6('0x49')]({'where':{'id':_0x318125[_0xdfe6('0x46')]['id']}})['then'](function(_0x4c4bbe){if(_[_0xdfe6('0x64')](_0x4c4bbe)){throw new ReferenceError(_0xdfe6('0x65'));}return _0x4c4bbe;})[_0xdfe6('0x26')](function(_0x4bacb5){var _0x36ab37=_0x4bacb5[_0xdfe6('0x4f')];logger[_0xdfe6('0x66')](_0xdfe6('0x67'),_0x36ab37);if(!_['isNil'](_0x4bacb5['value'])&&fs[_0xdfe6('0x60')](_0x36ab37)){logger['info'](_0xdfe6('0x68')+_0x36ab37+_0xdfe6('0x69'));fs['unlinkSync'](_0x36ab37);}_0x36ab37=_0x36ab37+_0xdfe6('0x6a');if(!_[_0xdfe6('0x64')](_0x4bacb5[_0xdfe6('0x4f')])&&fs['existsSync'](_0x36ab37)){logger[_0xdfe6('0x66')](_0xdfe6('0x68')+_0x36ab37+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xdfe6('0x6b')](_0x36ab37);}return _0x4bacb5;})[_0xdfe6('0x26')](function(_0x2979fe){if(!_0x2979fe)throw new InternalError();return _0x2979fe[_0xdfe6('0x27')]();})[_0xdfe6('0x26')](function(){_0x2e74aa['status'](0xcc)['end']();})['catch'](handleError(_0x2e74aa,null));};function getBucketslist(_0x30f23a,_0x112eb8,_0x93f82a){return new Promise(function(_0x33dfd5,_0x12ef53){var _0x28d9d2=new AWS['S3']({'accessKeyId':_0x112eb8,'secretAccessKey':_0x30f23a,'region':_0x93f82a});_0x28d9d2[_0xdfe6('0x6c')]({},function(_0x35b3ef,_0x57dff4){if(_0x35b3ef){return _0x12ef53(_0x35b3ef);}else{return _0x33dfd5(_0x57dff4);}});});}function createBucket(_0x5ddcac,_0x356343,_0x25390e,_0x44db16){return new Promise(function(_0x2a0b94,_0x903297){var _0x12c6e8=new AWS['S3']({'accessKeyId':_0x356343,'secretAccessKey':_0x5ddcac,'region':_0x25390e});_0x12c6e8['createBucket']({'Bucket':_0x44db16},function(_0x51fdcf,_0x3e99c7){if(_0x51fdcf){return _0x903297(_0x51fdcf);}else{return _0x2a0b94(_0x3e99c7);}});});}function uploadFile(_0x5aa8f5,_0x22c21c,_0x2a11d6,_0x4ddc64,_0x4e793a,_0x19e472){return new Promise(function(_0x46ccd0,_0x28ae85){var _0x165a18=new AWS['S3']({'accessKeyId':_0x22c21c,'secretAccessKey':_0x5aa8f5,'region':_0x2a11d6});_0x165a18[_0xdfe6('0x6d')]({'Bucket':_0x4ddc64,'Key':_0x4e793a,'Body':_0x19e472},function(_0x15db6a,_0x3bfba7){if(_0x15db6a){return _0x28ae85(_0x15db6a);}else{return _0x46ccd0(_0x3bfba7);}});});}function startTranscribe(_0x184f94,_0x44e8a5,_0x49587c,_0x1c7ad5,_0x5c34a7,_0x3b72bd){return new Promise(function(_0x1741f5,_0x2e070e){var _0x38b7eb=new AWS[(_0xdfe6('0x6e'))]({'accessKeyId':_0x44e8a5,'secretAccessKey':_0x184f94,'region':_0x49587c});_0x38b7eb[_0xdfe6('0x6f')]({'TranscriptionJobName':_0x1c7ad5,'LanguageCode':_0x5c34a7,'Media':{'MediaFileUri':_0x3b72bd}},function(_0xd418e0,_0x256e1b){if(_0xd418e0){return _0x2e070e(_0xd418e0);}else{return _0x1741f5(_0x256e1b);}});});}function transcribe(_0x3cf119,_0x2db5a5,_0x550995,_0x4d0a8e,_0x4645ae,_0x1e6c06,_0x1998f9){return new Promise(function(_0x49637d,_0xf8f5ee){var _0x3c3e33={};logger['info'](util['format']('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x3cf119,_0x4645ae));return uploadFile(_0x2db5a5,_0x550995,_0x4d0a8e,_0x4645ae,path['basename'](_0x1e6c06),fs[_0xdfe6('0x70')](_0x1e6c06))[_0xdfe6('0x26')](function(_0x1512c4){logger[_0xdfe6('0x66')](util[_0xdfe6('0x32')](_0xdfe6('0x71'),_0x3cf119,_0x4645ae,_0x1512c4[_0xdfe6('0x72')]));_0x3c3e33[_0xdfe6('0x73')]=_0x1512c4['Bucket'];_0x3c3e33[_0xdfe6('0x74')]=_0x1512c4[_0xdfe6('0x72')];logger['info'](util[_0xdfe6('0x32')](_0xdfe6('0x75'),_0x3cf119));return startTranscribe(_0x2db5a5,_0x550995,_0x4d0a8e,uuidv4(),_0x1998f9,_0x1512c4['Location']);})[_0xdfe6('0x26')](function(_0x360ae9){logger[_0xdfe6('0x66')](util['format']('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0x3cf119,_0x360ae9[_0xdfe6('0x76')]['TranscriptionJobName']));_0x3c3e33[_0xdfe6('0x77')]=_0x360ae9['TranscriptionJob'][_0xdfe6('0x78')];_0x3c3e33[_0xdfe6('0x79')]=_0x360ae9[_0xdfe6('0x76')][_0xdfe6('0x7a')];return _0x49637d(_0x3c3e33);})[_0xdfe6('0x44')](function(_0x5c1b24){return _0xf8f5ee(_0x5c1b24);});});}exports[_0xdfe6('0x7b')]=function(_0x43abd3,_0x405c2c,_0x52af5f){var _0x4d5e0c;var _0x1d0de7;var _0x17d714;var _0x5743a8=require('../../components/encryptor');return db[_0xdfe6('0x2c')][_0xdfe6('0x7c')]({'where':{'id':_0x43abd3[_0xdfe6('0x46')]['id']}})[_0xdfe6('0x26')](function(_0x3774ec){if(_0x3774ec){var _0xe5ed60=util['format'](_0xdfe6('0x50'),_0x3774ec[_0xdfe6('0x4f')]);if(fs[_0xdfe6('0x60')](_0xe5ed60)){cypher=!![];return _0x5743a8['decryptFile'](_0xe5ed60,_0x3774ec[_0xdfe6('0x4f')],config[_0xdfe6('0x7d')][_0xdfe6('0x51')])[_0xdfe6('0x26')](function(){return _0x3774ec;});}return _0x3774ec;}})[_0xdfe6('0x26')](function(_0x2fc777){if(!_0x2fc777){throw new db[(_0xdfe6('0x62'))][(_0xdfe6('0x63'))](_0xdfe6('0x7e'));}_0x1d0de7=_0x2fc777;return db[_0xdfe6('0x7f')]['findOne']({'where':{'id':0x1}});})[_0xdfe6('0x26')](handleEntityNotFound(_0x405c2c,null))['then'](function(_0x53918a){if(_0x53918a){_0x4d5e0c=_0x53918a;if(!_0x4d5e0c[_0xdfe6('0x80')]||!_0x4d5e0c[_0xdfe6('0x81')]||!_0x4d5e0c['transcribeRegion']||!_0x4d5e0c[_0xdfe6('0x82')]||!_0x4d5e0c[_0xdfe6('0x73')]){throw new db[(_0xdfe6('0x62'))][(_0xdfe6('0x63'))](_0xdfe6('0x83'));}if(_0x43abd3[_0xdfe6('0x4b')][_0xdfe6('0x84')]&&(!_0x4d5e0c[_0xdfe6('0x85')]||!_0x4d5e0c[_0xdfe6('0x86')]||!_0x4d5e0c[_0xdfe6('0x87')]||!_0x4d5e0c[_0xdfe6('0x82')]||!_0x4d5e0c[_0xdfe6('0x73')])){throw new db[(_0xdfe6('0x62'))]['ValidationError'](_0xdfe6('0x88'));}return db['CloudProvider'][_0xdfe6('0x7c')]({'where':{'id':_0x4d5e0c[_0xdfe6('0x81')]}});}})[_0xdfe6('0x26')](function(_0x522f6d){if(!_0x522f6d){throw new db[(_0xdfe6('0x62'))][(_0xdfe6('0x63'))](_0xdfe6('0x89'));}if(!_0x522f6d[_0xdfe6('0x8a')]||!_0x522f6d[_0xdfe6('0x8b')]){throw new db[(_0xdfe6('0x62'))][(_0xdfe6('0x63'))]('Cloud\x20Provider\x20not\x20configured');}_0x17d714=_0x522f6d;return getBucketslist(_0x17d714['data1'],_0x17d714[_0xdfe6('0x8b')],_0x4d5e0c['transcribeRegion']);})[_0xdfe6('0x26')](function(_0x2432fc){if(_0x2432fc&&_0x2432fc[_0xdfe6('0x8c')]){var _0x2ed02a=_[_0xdfe6('0x49')](_0x2432fc[_0xdfe6('0x8c')],function(_0x59c9ea){return _0x59c9ea[_0xdfe6('0x8d')]===_0x4d5e0c[_0xdfe6('0x73')];});if(!_0x2ed02a){logger[_0xdfe6('0x66')](util[_0xdfe6('0x32')](_0xdfe6('0x8e'),_0x43abd3[_0xdfe6('0x46')]['id'],_0x4d5e0c[_0xdfe6('0x73')]));return createBucket(_0x17d714[_0xdfe6('0x8a')],_0x17d714[_0xdfe6('0x8b')],_0x4d5e0c[_0xdfe6('0x8f')],_0x4d5e0c[_0xdfe6('0x73')]);}logger[_0xdfe6('0x66')](util[_0xdfe6('0x32')](_0xdfe6('0x90'),_0x43abd3['params']['id'],_0x4d5e0c[_0xdfe6('0x73')]));return;}})['then'](function(_0x309eed){if(_0x1d0de7[_0xdfe6('0x79')]===_0xdfe6('0x91')){return transcribe(_0x43abd3[_0xdfe6('0x46')]['id'],_0x17d714['data1'],_0x17d714[_0xdfe6('0x8b')],_0x4d5e0c['transcribeRegion'],_0x4d5e0c['bucket'],_0x1d0de7['value'],_0x4d5e0c[_0xdfe6('0x82')]);}else{logger[_0xdfe6('0x66')](util[_0xdfe6('0x32')]('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x43abd3[_0xdfe6('0x46')]['id']));return{'transcribeStatus':_0xdfe6('0x92')};}})[_0xdfe6('0x26')](function(_0x2b8ca0){if(_0x2b8ca0){_0x2b8ca0[_0xdfe6('0x93')]=_0x43abd3['body'][_0xdfe6('0x84')];return _0x1d0de7[_0xdfe6('0x94')](_0x2b8ca0);}})[_0xdfe6('0x26')](respondWithResult(_0x405c2c,null))[_0xdfe6('0x44')](handleError(_0x405c2c,null));};function writeFile(_0x2cb2c8,_0x520f56){return new Promise(function(_0x2e3de6,_0x3970de){fs[_0xdfe6('0x95')](_0x520f56,_0x2cb2c8,function(_0x1e2d77,_0x143710){if(_0x1e2d77){return _0x3970de(_0x1e2d77);}else{return _0x2e3de6(_0x143710);}});});}exports[_0xdfe6('0x96')]=function(_0x5d2b2d,_0x581259,_0x39696a){return db[_0xdfe6('0x2c')][_0xdfe6('0x7c')]({'where':{'id':_0x5d2b2d[_0xdfe6('0x46')]['id']}})[_0xdfe6('0x26')](handleEntityNotFound(_0x581259))[_0xdfe6('0x26')](function(_0x43037a){if(_0x43037a&&_0x43037a[_0xdfe6('0x97')]){var _0x563b79=_0x43037a[_0xdfe6('0x97')];var _0x1bae8d=config[_0xdfe6('0x98')]+_0xdfe6('0x99')+_0x43037a['id']+_0xdfe6('0x9a');if(fs[_0xdfe6('0x60')](_0x1bae8d)){return _0x1bae8d;}return writeFile(_0x563b79,_0x1bae8d)['then'](function(){return _0x1bae8d;});}else{throw new db[(_0xdfe6('0x62'))]['ValidationError'](_0xdfe6('0x9b'));}})[_0xdfe6('0x26')](function(_0x413022){return _0x581259[_0xdfe6('0x4d')](_0x413022);})['catch'](handleError(_0x581259));}; \ No newline at end of file +var _0xa861=['limit','count','offset','status','set','apply','reject','save','update','destroy','stack','name','send','index','fieldName','type','model','differenceBy','map','format','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','where','merge','filter','options','VoiceRecording','then','include','findAll','show','rawAttributes','keys','includeAll','find','catch','create','body','params','download','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','decryptFile','secrets','recording','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','Not\x20found','downloads','sequelize','MD5','col','token','push','$and','Sequelize','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','listBuckets','createBucket','TranscribeService','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','TranscriptionJobName','transcribeName','TranscriptionJob','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','transcribeRegion','bucket','Transcribe\x20not\x20configured','sentiment','sentimentAccountId','sentimentRegion','language','Sentiment\x20Analysis\x20not\x20configured','data1','Cloud\x20Provider\x20not\x20configured','Buckets','Name','data2','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','runSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','zip-dir','request-promise','moment','bluebird','path','sox','ejs','squel','desk.js','to-csv','papaparse','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','undefined'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xa861,0x112));var _0x1a86=function(_0x39f34f,_0x298f45){_0x39f34f=_0x39f34f-0x0;var _0x59fee1=_0xa861[_0x39f34f];return _0x59fee1;};'use strict';var emlformat=require(_0x1a86('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1a86('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1a86('0x2'));var moment=require(_0x1a86('0x3'));var BPromise=require(_0x1a86('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1a86('0x5'));var sox=require(_0x1a86('0x6'));var csv=require('to-csv');var ejs=require(_0x1a86('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x1a86('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1a86('0x9'));var toCsv=require(_0x1a86('0xa'));var querystring=require('querystring');var Papa=require(_0x1a86('0xb'));var AWS=require('aws-sdk');var uuidv4=require(_0x1a86('0xc'));var Redis=require(_0x1a86('0xd'));var authService=require(_0x1a86('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x1a86('0xf'));var hardwareService=require(_0x1a86('0x10'));var logger=require(_0x1a86('0x11'))(_0x1a86('0x12'));var utils=require(_0x1a86('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x1a86('0x14'));var db=require(_0x1a86('0x15'))['db'];function respondWithStatusCode(_0x23e0ca,_0x6cc677){_0x6cc677=_0x6cc677||0xcc;return function(_0x283495){if(_0x283495){return _0x23e0ca[_0x1a86('0x16')](_0x6cc677);}return _0x23e0ca['status'](_0x6cc677)[_0x1a86('0x17')]();};}function respondWithResult(_0x27ceef,_0x5c9a96){_0x5c9a96=_0x5c9a96||0xc8;return function(_0x4fa7c8){if(_0x4fa7c8){return _0x27ceef['status'](_0x5c9a96)[_0x1a86('0x18')](_0x4fa7c8);}};}function respondWithFilteredResult(_0x2865e8,_0x423117){return function(_0x757ef9){if(_0x757ef9){var _0x4fbaa8=typeof _0x423117['offset']===_0x1a86('0x19')&&typeof _0x423117[_0x1a86('0x1a')]===_0x1a86('0x19');var _0x3863a0=_0x757ef9[_0x1a86('0x1b')];var _0x3e014d=_0x4fbaa8?0x0:_0x423117['offset'];var _0x1914fd=_0x4fbaa8?_0x757ef9[_0x1a86('0x1b')]:_0x423117[_0x1a86('0x1c')]+_0x423117['limit'];var _0x460c51;if(_0x1914fd>=_0x3863a0){_0x1914fd=_0x3863a0;_0x460c51=0xc8;}else{_0x460c51=0xce;}_0x2865e8[_0x1a86('0x1d')](_0x460c51);return _0x2865e8[_0x1a86('0x1e')]('Content-Range',_0x3e014d+'-'+_0x1914fd+'/'+_0x3863a0)[_0x1a86('0x18')](_0x757ef9);}return null;};}function patchUpdates(_0x4138ad){return function(_0x524937){try{jsonpatch[_0x1a86('0x1f')](_0x524937,_0x4138ad,!![]);}catch(_0x34ff08){return BPromise[_0x1a86('0x20')](_0x34ff08);}return _0x524937[_0x1a86('0x21')]();};}function saveUpdates(_0x59c126,_0x4e0649){return function(_0x3504cb){if(_0x3504cb){return _0x3504cb[_0x1a86('0x22')](_0x59c126)['then'](function(_0x1e2ef5){return _0x1e2ef5;});}return null;};}function removeEntity(_0x453cd9,_0x51cc27){return function(_0x375960){if(_0x375960){return _0x375960[_0x1a86('0x23')]()['then'](function(){_0x453cd9[_0x1a86('0x1d')](0xcc)[_0x1a86('0x17')]();});}};}function handleEntityNotFound(_0x5a1456,_0x19648c){return function(_0x19a2b2){if(!_0x19a2b2){_0x5a1456[_0x1a86('0x16')](0x194);}return _0x19a2b2;};}function handleError(_0x303141,_0x420ef2){_0x420ef2=_0x420ef2||0x1f4;return function(_0x5e9edd){logger['error'](_0x5e9edd[_0x1a86('0x24')]);if(_0x5e9edd['name']){delete _0x5e9edd[_0x1a86('0x25')];}_0x303141[_0x1a86('0x1d')](_0x420ef2)[_0x1a86('0x26')](_0x5e9edd);};}exports[_0x1a86('0x27')]=function(_0x36b76e,_0x5115c9){var _0x3c34bd={},_0x3adb74={},_0x521f19={'count':0x0,'rows':[]};var _0x24a2bc=_['map'](db['VoiceRecording']['rawAttributes'],function(_0x4ec984){return{'name':_0x4ec984[_0x1a86('0x28')],'type':_0x4ec984[_0x1a86('0x29')]['key']};});_0x3adb74[_0x1a86('0x2a')]=_[_0x1a86('0x2b')](_[_0x1a86('0x2c')](_0x24a2bc,'name'),[_0x1a86('0x2d')]);_0x3adb74[_0x1a86('0x2e')]=_['keys'](_0x36b76e[_0x1a86('0x2e')]);_0x3adb74[_0x1a86('0x2f')]=_[_0x1a86('0x30')](_0x3adb74[_0x1a86('0x2a')],_0x3adb74['query']);_0x3c34bd[_0x1a86('0x31')]=_[_0x1a86('0x30')](_0x3adb74['model'],qs[_0x1a86('0x32')](_0x36b76e['query'][_0x1a86('0x32')]));_0x3c34bd[_0x1a86('0x31')]=_0x3c34bd[_0x1a86('0x31')][_0x1a86('0x33')]?_0x3c34bd[_0x1a86('0x31')]:_0x3adb74[_0x1a86('0x2a')];if(!_0x36b76e[_0x1a86('0x2e')][_0x1a86('0x34')](_0x1a86('0x35'))){_0x3c34bd[_0x1a86('0x1a')]=qs['limit'](_0x36b76e[_0x1a86('0x2e')]['limit']);_0x3c34bd[_0x1a86('0x1c')]=qs[_0x1a86('0x1c')](_0x36b76e['query']['offset']);}_0x3c34bd['order']=qs[_0x1a86('0x36')](_0x36b76e[_0x1a86('0x2e')][_0x1a86('0x36')]);_0x3c34bd['where']=qs['filters'](_[_0x1a86('0x37')](_0x36b76e[_0x1a86('0x2e')],_0x3adb74[_0x1a86('0x2f')]),_0x24a2bc);if(_0x36b76e['query']['filter']){_0x3c34bd[_0x1a86('0x38')]=_[_0x1a86('0x39')](_0x3c34bd[_0x1a86('0x38')],{'$or':_[_0x1a86('0x2c')](_0x24a2bc,function(_0x628bfa){if(_0x628bfa[_0x1a86('0x29')]!=='VIRTUAL'){var _0x1cb738={};_0x1cb738[_0x628bfa['name']]={'$like':'%'+_0x36b76e[_0x1a86('0x2e')][_0x1a86('0x3a')]+'%'};return _0x1cb738;}})});}_0x3c34bd=_[_0x1a86('0x39')]({},_0x3c34bd,_0x36b76e[_0x1a86('0x3b')]);var _0x249878={'where':_0x3c34bd['where']};return db[_0x1a86('0x3c')][_0x1a86('0x1b')](_0x249878)[_0x1a86('0x3d')](function(_0x174b6b){_0x521f19[_0x1a86('0x1b')]=_0x174b6b;if(_0x36b76e[_0x1a86('0x2e')]['includeAll']){_0x3c34bd[_0x1a86('0x3e')]=[{'all':!![]}];}return db[_0x1a86('0x3c')][_0x1a86('0x3f')](_0x3c34bd);})[_0x1a86('0x3d')](function(_0x17c414){_0x521f19['rows']=_0x17c414;return _0x521f19;})[_0x1a86('0x3d')](respondWithFilteredResult(_0x5115c9,_0x3c34bd))['catch'](handleError(_0x5115c9,null));};exports[_0x1a86('0x40')]=function(_0x46c11e,_0x41afe5){var _0x1d44e4={'raw':![],'where':{'id':_0x46c11e['params']['id']}},_0x2d87e5={};_0x2d87e5[_0x1a86('0x2a')]=_['keys'](db[_0x1a86('0x3c')][_0x1a86('0x41')]);_0x2d87e5[_0x1a86('0x2e')]=_[_0x1a86('0x42')](_0x46c11e[_0x1a86('0x2e')]);_0x2d87e5[_0x1a86('0x2f')]=_[_0x1a86('0x30')](_0x2d87e5['model'],_0x2d87e5[_0x1a86('0x2e')]);_0x1d44e4[_0x1a86('0x31')]=_[_0x1a86('0x30')](_0x2d87e5['model'],qs[_0x1a86('0x32')](_0x46c11e[_0x1a86('0x2e')][_0x1a86('0x32')]));_0x1d44e4['attributes']=_0x1d44e4[_0x1a86('0x31')]['length']?_0x1d44e4[_0x1a86('0x31')]:_0x2d87e5[_0x1a86('0x2a')];if(_0x46c11e[_0x1a86('0x2e')][_0x1a86('0x43')]){_0x1d44e4[_0x1a86('0x3e')]=[{'all':!![]}];}_0x1d44e4=_[_0x1a86('0x39')]({},_0x1d44e4,_0x46c11e[_0x1a86('0x3b')]);return db[_0x1a86('0x3c')][_0x1a86('0x44')](_0x1d44e4)[_0x1a86('0x3d')](handleEntityNotFound(_0x41afe5,null))[_0x1a86('0x3d')](respondWithResult(_0x41afe5,null))[_0x1a86('0x45')](handleError(_0x41afe5,null));};exports['create']=function(_0x32a96e,_0x2b79f3){return db[_0x1a86('0x3c')][_0x1a86('0x46')](_0x32a96e['body'],{})['then'](respondWithResult(_0x2b79f3,0xc9))[_0x1a86('0x45')](handleError(_0x2b79f3,null));};exports[_0x1a86('0x22')]=function(_0x455695,_0x4d2c67){if(_0x455695['body']['id']){delete _0x455695[_0x1a86('0x47')]['id'];}return db[_0x1a86('0x3c')]['find']({'where':{'id':_0x455695[_0x1a86('0x48')]['id']}})[_0x1a86('0x3d')](handleEntityNotFound(_0x4d2c67,null))['then'](saveUpdates(_0x455695['body'],null))[_0x1a86('0x3d')](respondWithResult(_0x4d2c67,null))['catch'](handleError(_0x4d2c67,null));};exports['describe']=function(_0x3ca13c,_0x25ef0e){return db[_0x1a86('0x3c')]['describe']()[_0x1a86('0x3d')](respondWithResult(_0x25ef0e,null))['catch'](handleError(_0x25ef0e,null));};exports[_0x1a86('0x49')]=function(_0x20b9e6,_0x583862,_0x31d52d){var _0x4397b6=require(_0x1a86('0x4a'));var _0x9b2e4d=![];var _0x2bd898={};if(_0x20b9e6['query'][_0x1a86('0x29')]&&_0x20b9e6[_0x1a86('0x2e')]['type']==='uniqueid'){_0x2bd898[_0x1a86('0x4b')]=_0x20b9e6[_0x1a86('0x48')]['id'];}else{_0x2bd898['id']=_0x20b9e6[_0x1a86('0x48')]['id'];}return db['VoiceRecording']['find']({'where':_0x2bd898,'attributes':['id',_0x1a86('0x4c')],'raw':!![]})[_0x1a86('0x3d')](handleEntityNotFound(_0x583862,null))[_0x1a86('0x3d')](function(_0xa8f3bc){if(_0xa8f3bc){var _0x3ddbfd=_0xa8f3bc['value'];var _0xcfad7c=util['format'](_0x1a86('0x4d'),_0x3ddbfd);if(fs[_0x1a86('0x4e')](_0xcfad7c)){_0x9b2e4d=!![];return _0x4397b6[_0x1a86('0x4f')](_0xcfad7c,_0x3ddbfd,config[_0x1a86('0x50')][_0x1a86('0x51')])[_0x1a86('0x3d')](function(){return _0xa8f3bc;});}return _0xa8f3bc;}})[_0x1a86('0x3d')](function(_0x108cd3){if(_0x108cd3){var _0x5b4146=_0x108cd3['value'];if(!fs[_0x1a86('0x4e')](_0x5b4146)){throw new db['Sequelize'][(_0x1a86('0x52'))](_0x1a86('0x53'));}if(_0x108cd3[_0x1a86('0x54')]){return _0x583862[_0x1a86('0x49')](_0x5b4146,_0x108cd3[_0x1a86('0x54')]+path[_0x1a86('0x55')](_0x5b4146),function(){if(_0x9b2e4d){fs[_0x1a86('0x56')](_0x5b4146);}});}else{return _0x583862['download'](_0x5b4146,function(_0x1233aa){if(_0x9b2e4d){fs[_0x1a86('0x56')](_0x5b4146);}});}}})['catch'](function(_0x81bb8d){if(_0x81bb8d['message']===_0x1a86('0x53')){_0x583862['status'](0x194)['send'](_0x1a86('0x57'));}else{return handleError(_0x583862,null);}});};exports[_0x1a86('0x58')]=function(_0x1e7160,_0x26324e,_0x13c616){var _0x33a76e=require('../../components/encryptor');var _0x92237d=![];var _0x38974d={'$and':[db[_0x1a86('0x59')][_0x1a86('0x38')](db[_0x1a86('0x59')]['fn'](_0x1a86('0x5a'),db[_0x1a86('0x59')][_0x1a86('0x5b')](_0x1a86('0x4b'))),_0x1e7160['query'][_0x1a86('0x5c')])]};if(_0x1e7160[_0x1a86('0x2e')][_0x1a86('0x29')]&&_0x1e7160[_0x1a86('0x2e')][_0x1a86('0x29')]==='uniqueid'){_0x38974d['$and'][_0x1a86('0x5d')]({'uniqueid':_0x1e7160[_0x1a86('0x48')]['id']});}else{_0x38974d[_0x1a86('0x5e')][_0x1a86('0x5d')]({'id':_0x1e7160['params']['id']});}return db[_0x1a86('0x3c')][_0x1a86('0x44')]({'where':_0x38974d,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0x26324e,null))[_0x1a86('0x3d')](function(_0x38b4a0){if(_0x38b4a0){var _0x5d41ae=util[_0x1a86('0x2d')](_0x1a86('0x4d'),_0x38b4a0[_0x1a86('0x4c')]);if(fs[_0x1a86('0x4e')](_0x5d41ae)){_0x92237d=!![];return _0x33a76e[_0x1a86('0x4f')](_0x5d41ae,_0x38b4a0[_0x1a86('0x4c')],config['secrets'][_0x1a86('0x51')])['then'](function(){return _0x38b4a0;});}return _0x38b4a0;}})['then'](function(_0x2102b5){if(_0x2102b5){if(!fs[_0x1a86('0x4e')](_0x2102b5[_0x1a86('0x4c')])){throw new db[(_0x1a86('0x5f'))]['ValidationError'](_0x1a86('0x53'));}if(_0x2102b5['filename']){return _0x26324e[_0x1a86('0x49')](_0x2102b5['value'],_0x2102b5[_0x1a86('0x54')]+path['extname'](_0x2102b5['value']),function(){if(_0x92237d){fs[_0x1a86('0x56')](_0x2102b5[_0x1a86('0x4c')]);}});}else{return _0x26324e[_0x1a86('0x49')](_0x2102b5[_0x1a86('0x4c')],function(_0x2b8404){if(_0x92237d){fs['unlink'](_0x2102b5['value']);}});}}})[_0x1a86('0x45')](handleError(_0x26324e,null));};exports['destroy']=function(_0x51a1d2,_0x9dec96){return db[_0x1a86('0x3c')][_0x1a86('0x44')]({'where':{'id':_0x51a1d2[_0x1a86('0x48')]['id']}})[_0x1a86('0x3d')](function(_0x4ed540){if(_[_0x1a86('0x60')](_0x4ed540)){throw new ReferenceError(_0x1a86('0x61'));}return _0x4ed540;})[_0x1a86('0x3d')](function(_0x58efbd){var _0x1339ea=_0x58efbd[_0x1a86('0x4c')];logger[_0x1a86('0x62')](_0x1a86('0x63'),_0x1339ea);if(!_[_0x1a86('0x60')](_0x58efbd[_0x1a86('0x4c')])&&fs[_0x1a86('0x4e')](_0x1339ea)){logger[_0x1a86('0x62')](_0x1a86('0x64')+_0x1339ea+_0x1a86('0x65'));fs[_0x1a86('0x66')](_0x1339ea);}_0x1339ea=_0x1339ea+_0x1a86('0x67');if(!_[_0x1a86('0x60')](_0x58efbd['value'])&&fs[_0x1a86('0x4e')](_0x1339ea)){logger[_0x1a86('0x62')]('File:\x20\x22'+_0x1339ea+_0x1a86('0x65'));fs[_0x1a86('0x66')](_0x1339ea);}return _0x58efbd;})[_0x1a86('0x3d')](function(_0x5802d0){if(!_0x5802d0)throw new InternalError();return _0x5802d0[_0x1a86('0x23')]();})[_0x1a86('0x3d')](function(){_0x9dec96[_0x1a86('0x1d')](0xcc)['end']();})[_0x1a86('0x45')](handleError(_0x9dec96,null));};function getBucketslist(_0x45fe50,_0x10a22c,_0x10853c){return new Promise(function(_0x55a218,_0x5e80dd){var _0xa1a4bd=new AWS['S3']({'accessKeyId':_0x10a22c,'secretAccessKey':_0x45fe50,'region':_0x10853c});_0xa1a4bd[_0x1a86('0x68')]({},function(_0x448835,_0x290208){if(_0x448835){return _0x5e80dd(_0x448835);}else{return _0x55a218(_0x290208);}});});}function createBucket(_0x57dcb2,_0x3b830f,_0x50e2b1,_0x3715d6){return new Promise(function(_0x88ed11,_0x410781){var _0x48e94e=new AWS['S3']({'accessKeyId':_0x3b830f,'secretAccessKey':_0x57dcb2,'region':_0x50e2b1});_0x48e94e[_0x1a86('0x69')]({'Bucket':_0x3715d6},function(_0x2e6822,_0x3d82d0){if(_0x2e6822){return _0x410781(_0x2e6822);}else{return _0x88ed11(_0x3d82d0);}});});}function uploadFile(_0x3c0a1e,_0x3e37e4,_0x5f4775,_0xd4a4c4,_0x2b9bf6,_0x3757bf){return new Promise(function(_0x559c1e,_0x368690){var _0xc14e50=new AWS['S3']({'accessKeyId':_0x3e37e4,'secretAccessKey':_0x3c0a1e,'region':_0x5f4775});_0xc14e50['upload']({'Bucket':_0xd4a4c4,'Key':_0x2b9bf6,'Body':_0x3757bf},function(_0x1d3a4d,_0x5f2ea8){if(_0x1d3a4d){return _0x368690(_0x1d3a4d);}else{return _0x559c1e(_0x5f2ea8);}});});}function startTranscribe(_0x3c89dc,_0x30ab2d,_0x397924,_0x13a347,_0x34cf92,_0x1b0dbb){return new Promise(function(_0x8fa8b7,_0x53a6ba){var _0x4f1b99=new AWS[(_0x1a86('0x6a'))]({'accessKeyId':_0x30ab2d,'secretAccessKey':_0x3c89dc,'region':_0x397924});_0x4f1b99['startTranscriptionJob']({'TranscriptionJobName':_0x13a347,'LanguageCode':_0x34cf92,'Media':{'MediaFileUri':_0x1b0dbb}},function(_0x5bb0b7,_0x363341){if(_0x5bb0b7){return _0x53a6ba(_0x5bb0b7);}else{return _0x8fa8b7(_0x363341);}});});}function transcribe(_0xba5241,_0x475e77,_0x4f2f83,_0x1526d9,_0x156db4,_0x21c2f6,_0x27ece6){return new Promise(function(_0x51f8fa,_0x364d49){var _0x1b4dcf={};logger[_0x1a86('0x62')](util[_0x1a86('0x2d')](_0x1a86('0x6b'),_0xba5241,_0x156db4));return uploadFile(_0x475e77,_0x4f2f83,_0x1526d9,_0x156db4,path[_0x1a86('0x6c')](_0x21c2f6),fs['readFileSync'](_0x21c2f6))[_0x1a86('0x3d')](function(_0x2792f0){logger[_0x1a86('0x62')](util[_0x1a86('0x2d')](_0x1a86('0x6d'),_0xba5241,_0x156db4,_0x2792f0[_0x1a86('0x6e')]));_0x1b4dcf['bucket']=_0x2792f0['Bucket'];_0x1b4dcf[_0x1a86('0x6f')]=_0x2792f0['Location'];logger[_0x1a86('0x62')](util[_0x1a86('0x2d')](_0x1a86('0x70'),_0xba5241));return startTranscribe(_0x475e77,_0x4f2f83,_0x1526d9,uuidv4(),_0x27ece6,_0x2792f0[_0x1a86('0x6e')]);})[_0x1a86('0x3d')](function(_0x383a2c){logger[_0x1a86('0x62')](util[_0x1a86('0x2d')]('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0xba5241,_0x383a2c['TranscriptionJob'][_0x1a86('0x71')]));_0x1b4dcf[_0x1a86('0x72')]=_0x383a2c[_0x1a86('0x73')]['TranscriptionJobName'];_0x1b4dcf[_0x1a86('0x74')]=_0x383a2c[_0x1a86('0x73')][_0x1a86('0x75')];return _0x51f8fa(_0x1b4dcf);})[_0x1a86('0x45')](function(_0x22a97b){return _0x364d49(_0x22a97b);});});}exports[_0x1a86('0x76')]=function(_0x4e1dba,_0x110790,_0x15df9f){var _0x410325;var _0x22a5d4;var _0x40aed2;var _0x3d3ead=require(_0x1a86('0x4a'));return db[_0x1a86('0x3c')][_0x1a86('0x77')]({'where':{'id':_0x4e1dba['params']['id']}})[_0x1a86('0x3d')](function(_0x49ef7f){if(_0x49ef7f){var _0x17b612=util[_0x1a86('0x2d')]('%s.cypher',_0x49ef7f[_0x1a86('0x4c')]);if(fs[_0x1a86('0x4e')](_0x17b612)){cypher=!![];return _0x3d3ead[_0x1a86('0x4f')](_0x17b612,_0x49ef7f[_0x1a86('0x4c')],config[_0x1a86('0x50')][_0x1a86('0x51')])[_0x1a86('0x3d')](function(){return _0x49ef7f;});}return _0x49ef7f;}})[_0x1a86('0x3d')](function(_0x2f1931){if(!_0x2f1931){throw new db[(_0x1a86('0x5f'))]['ValidationError'](_0x1a86('0x78'));}_0x22a5d4=_0x2f1931;return db[_0x1a86('0x79')][_0x1a86('0x77')]({'where':{'id':0x1}});})[_0x1a86('0x3d')](handleEntityNotFound(_0x110790,null))[_0x1a86('0x3d')](function(_0x149a4b){if(_0x149a4b){_0x410325=_0x149a4b;if(!_0x410325[_0x1a86('0x7a')]||!_0x410325[_0x1a86('0x7b')]||!_0x410325[_0x1a86('0x7c')]||!_0x410325['language']||!_0x410325[_0x1a86('0x7d')]){throw new db[(_0x1a86('0x5f'))][(_0x1a86('0x52'))](_0x1a86('0x7e'));}if(_0x4e1dba['body']['runSentiment']&&(!_0x410325[_0x1a86('0x7f')]||!_0x410325[_0x1a86('0x80')]||!_0x410325[_0x1a86('0x81')]||!_0x410325[_0x1a86('0x82')]||!_0x410325['bucket'])){throw new db[(_0x1a86('0x5f'))][(_0x1a86('0x52'))](_0x1a86('0x83'));}return db['CloudProvider'][_0x1a86('0x77')]({'where':{'id':_0x410325[_0x1a86('0x7b')]}});}})['then'](function(_0x2d4c37){if(!_0x2d4c37){throw new db[(_0x1a86('0x5f'))][(_0x1a86('0x52'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x2d4c37[_0x1a86('0x84')]||!_0x2d4c37['data2']){throw new db[(_0x1a86('0x5f'))][(_0x1a86('0x52'))](_0x1a86('0x85'));}_0x40aed2=_0x2d4c37;return getBucketslist(_0x40aed2[_0x1a86('0x84')],_0x40aed2['data2'],_0x410325[_0x1a86('0x7c')]);})[_0x1a86('0x3d')](function(_0x2133a7){if(_0x2133a7&&_0x2133a7[_0x1a86('0x86')]){var _0x398e42=_[_0x1a86('0x44')](_0x2133a7[_0x1a86('0x86')],function(_0x26617e){return _0x26617e[_0x1a86('0x87')]===_0x410325[_0x1a86('0x7d')];});if(!_0x398e42){logger[_0x1a86('0x62')](util[_0x1a86('0x2d')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0x4e1dba[_0x1a86('0x48')]['id'],_0x410325[_0x1a86('0x7d')]));return createBucket(_0x40aed2['data1'],_0x40aed2[_0x1a86('0x88')],_0x410325[_0x1a86('0x7c')],_0x410325[_0x1a86('0x7d')]);}logger[_0x1a86('0x62')](util[_0x1a86('0x2d')](_0x1a86('0x89'),_0x4e1dba[_0x1a86('0x48')]['id'],_0x410325[_0x1a86('0x7d')]));return;}})['then'](function(_0x5172b1){if(_0x22a5d4['transcribeStatus']===_0x1a86('0x8a')){return transcribe(_0x4e1dba[_0x1a86('0x48')]['id'],_0x40aed2['data1'],_0x40aed2[_0x1a86('0x88')],_0x410325[_0x1a86('0x7c')],_0x410325[_0x1a86('0x7d')],_0x22a5d4['value'],_0x410325[_0x1a86('0x82')]);}else{logger[_0x1a86('0x62')](util[_0x1a86('0x2d')](_0x1a86('0x8b'),_0x4e1dba[_0x1a86('0x48')]['id']));return{'transcribeStatus':_0x1a86('0x8c')};}})['then'](function(_0x117fad){if(_0x117fad){_0x117fad[_0x1a86('0x8d')]=_0x4e1dba[_0x1a86('0x47')][_0x1a86('0x8e')];return _0x22a5d4[_0x1a86('0x8f')](_0x117fad);}})[_0x1a86('0x3d')](respondWithResult(_0x110790,null))[_0x1a86('0x45')](handleError(_0x110790,null));};function writeFile(_0x5d11f1,_0x94c4a9){return new Promise(function(_0x284d7e,_0x5bd8cc){fs[_0x1a86('0x90')](_0x94c4a9,_0x5d11f1,function(_0xb7e5d1,_0xf8747){if(_0xb7e5d1){return _0x5bd8cc(_0xb7e5d1);}else{return _0x284d7e(_0xf8747);}});});}exports[_0x1a86('0x91')]=function(_0x43a507,_0x191ba3,_0x4a1a0a){return db[_0x1a86('0x3c')][_0x1a86('0x77')]({'where':{'id':_0x43a507[_0x1a86('0x48')]['id']}})[_0x1a86('0x3d')](handleEntityNotFound(_0x191ba3))[_0x1a86('0x3d')](function(_0xfaa3ef){if(_0xfaa3ef&&_0xfaa3ef[_0x1a86('0x92')]){var _0x4077d2=_0xfaa3ef[_0x1a86('0x92')];var _0x5aafba=config['root']+_0x1a86('0x93')+_0xfaa3ef['id']+_0x1a86('0x94');if(fs[_0x1a86('0x4e')](_0x5aafba)){return _0x5aafba;}return writeFile(_0x4077d2,_0x5aafba)['then'](function(){return _0x5aafba;});}else{throw new db[(_0x1a86('0x5f'))][(_0x1a86('0x52'))](_0x1a86('0x95'));}})[_0x1a86('0x3d')](function(_0x4cbeaf){return _0x191ba3[_0x1a86('0x49')](_0x4cbeaf);})[_0x1a86('0x45')](handleError(_0x191ba3));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index d096be3..008dc44 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 _0xee39=['voice_recordings','uniqueid','transcribeStatus','./voiceRecording.attributes','exports','define','VoiceRecording'];(function(_0xb70bef,_0x1d0afe){var _0x4fbe74=function(_0x1051ac){while(--_0x1051ac){_0xb70bef['push'](_0xb70bef['shift']());}};_0x4fbe74(++_0x1d0afe);}(_0xee39,0x1e6));var _0x9ee3=function(_0x4c4b75,_0x136ce6){_0x4c4b75=_0x4c4b75-0x0;var _0x1853da=_0xee39[_0x4c4b75];return _0x1853da;};'use strict';var attributes=require(_0x9ee3('0x0'));module[_0x9ee3('0x1')]=function(_0xe604cf,_0x58cf62){return _0xe604cf[_0x9ee3('0x2')](_0x9ee3('0x3'),attributes,{'tableName':_0x9ee3('0x4'),'paranoid':![],'indexes':[{'name':_0x9ee3('0x5'),'fields':[_0x9ee3('0x5')]},{'name':_0x9ee3('0x6'),'fields':[_0x9ee3('0x6')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe06f=['exports','VoiceRecording','voice_recordings','uniqueid','transcribeStatus','./voiceRecording.attributes'];(function(_0x25c326,_0x250137){var _0x762452=function(_0x50ce5e){while(--_0x50ce5e){_0x25c326['push'](_0x25c326['shift']());}};_0x762452(++_0x250137);}(_0xe06f,0x65));var _0xfe06=function(_0x58c6b8,_0x20527f){_0x58c6b8=_0x58c6b8-0x0;var _0x566645=_0xe06f[_0x58c6b8];return _0x566645;};'use strict';var attributes=require(_0xfe06('0x0'));module[_0xfe06('0x1')]=function(_0x53e2c9,_0x2ba5f3){return _0x53e2c9['define'](_0xfe06('0x2'),attributes,{'tableName':_0xfe06('0x3'),'paranoid':![],'indexes':[{'name':_0xfe06('0x4'),'fields':[_0xfe06('0x4')]},{'name':_0xfe06('0x5'),'fields':[_0xfe06('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 60b2dd8..3211935 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 _0xcaf2=['CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','create','existsSync','value','format','encryptFile','secrets','recording','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','error','code','message','result','VoiceRecording','body','options','raw','where','attributes','limit','UpdateVoiceRecording','stringify','catch'];(function(_0x27c991,_0x41f5a3){var _0x2bba4c=function(_0x1bfd2e){while(--_0x1bfd2e){_0x27c991['push'](_0x27c991['shift']());}};_0x2bba4c(++_0x41f5a3);}(_0xcaf2,0x8a));var _0x2caf=function(_0x1d0458,_0x4ed6d4){_0x1d0458=_0x1d0458-0x0;var _0x2fad3c=_0xcaf2[_0x1d0458];return _0x2fad3c;};'use strict';var _=require(_0x2caf('0x0'));var util=require('util');var moment=require(_0x2caf('0x1'));var BPromise=require(_0x2caf('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2caf('0x3'));var db=require(_0x2caf('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2caf('0x5'))('rpc');var config=require(_0x2caf('0x6'));var jayson=require(_0x2caf('0x7'));var client=jayson[_0x2caf('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc44e4e,_0x314486,_0x4667c6){return new BPromise(function(_0x34e792,_0x5611aa){return client[_0x2caf('0x9')](_0xc44e4e,_0x4667c6)[_0x2caf('0xa')](function(_0x45e520){logger[_0x2caf('0xb')](_0x2caf('0xc'),_0x314486,_0x2caf('0xd'));logger[_0x2caf('0xe')](_0x2caf('0xf'),_0x314486,_0x2caf('0xd'),JSON['stringify'](_0x45e520));if(_0x45e520[_0x2caf('0x10')]){if(_0x45e520[_0x2caf('0x10')][_0x2caf('0x11')]===0x1f4){logger[_0x2caf('0x10')](_0x2caf('0xc'),_0x314486,_0x45e520[_0x2caf('0x10')][_0x2caf('0x12')]);return _0x5611aa(_0x45e520[_0x2caf('0x10')]['message']);}logger[_0x2caf('0x10')](_0x2caf('0xc'),_0x314486,_0x45e520['error']['message']);return _0x34e792(_0x45e520['error'][_0x2caf('0x12')]);}else{logger['info'](_0x2caf('0xc'),_0x314486,_0x2caf('0xd'));_0x34e792(_0x45e520[_0x2caf('0x13')][_0x2caf('0x12')]);}})['catch'](function(_0x184355){logger['error'](_0x2caf('0xc'),_0x314486,_0x184355);_0x5611aa(_0x184355);});});}exports['UpdateVoiceRecording']=function(_0x4a33fc){var _0x3e975f=this;return new Promise(function(_0x58047b,_0xe72440){return db[_0x2caf('0x14')]['update'](_0x4a33fc[_0x2caf('0x15')],{'raw':_0x4a33fc[_0x2caf('0x16')]?_0x4a33fc[_0x2caf('0x16')][_0x2caf('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4a33fc[_0x2caf('0x16')]?_0x4a33fc['options'][_0x2caf('0x18')]||null:null,'attributes':_0x4a33fc[_0x2caf('0x16')]?_0x4a33fc[_0x2caf('0x16')][_0x2caf('0x19')]||null:null,'limit':_0x4a33fc[_0x2caf('0x16')]?_0x4a33fc[_0x2caf('0x16')][_0x2caf('0x1a')]||null:null})[_0x2caf('0xa')](function(_0x3332b1){logger[_0x2caf('0xb')](_0x2caf('0x1b'),_0x4a33fc);logger['debug'](_0x2caf('0x1b'),_0x4a33fc,JSON[_0x2caf('0x1c')](_0x3332b1));_0x58047b(_0x3332b1);})[_0x2caf('0x1d')](function(_0x401ea2){logger[_0x2caf('0x10')](_0x2caf('0x1b'),_0x401ea2[_0x2caf('0x12')],_0x4a33fc);_0xe72440(_0x3e975f[_0x2caf('0x10')](0x1f4,_0x401ea2[_0x2caf('0x12')]));});});};exports[_0x2caf('0x1e')]=function(_0x5ad211){var _0x6a32ac=this;return new Promise(function(_0x325eda,_0xbefce6){var _0x37b08f=require(_0x2caf('0x1f'));var _0x17d3c6;return db[_0x2caf('0x20')][_0x2caf('0x21')]({'attributes':['id',_0x2caf('0x22')],'where':{'id':0x1},'raw':!![]})[_0x2caf('0xa')](function(_0x30da75){_0x17d3c6=_0x30da75;return db[_0x2caf('0x14')][_0x2caf('0x23')](_0x5ad211['body']);})[_0x2caf('0xa')](function(_0xda0ec5){if(_0x17d3c6[_0x2caf('0x22')]&&fs[_0x2caf('0x24')](_0xda0ec5[_0x2caf('0x25')])){var _0x1f52bf=util[_0x2caf('0x26')]('%s.cypher',_0xda0ec5[_0x2caf('0x25')]);return _0x37b08f[_0x2caf('0x27')](_0xda0ec5['value'],_0x1f52bf,config[_0x2caf('0x28')][_0x2caf('0x29')])[_0x2caf('0xa')](function(){fs['unlink'](_0xda0ec5[_0x2caf('0x25')]);logger['info']('CreateVoiceRecording\x20file\x20encrypted');return _0xda0ec5;});}return _0xda0ec5;})[_0x2caf('0xa')](function(_0x28b715){logger[_0x2caf('0xb')](_0x2caf('0x1e'),_0x5ad211);logger[_0x2caf('0xe')](_0x2caf('0x1e'),_0x5ad211,JSON[_0x2caf('0x1c')](_0x28b715));_0x325eda(_0x28b715);})[_0x2caf('0x1d')](function(_0x20818e){logger['error'](_0x2caf('0x1e'),_0x20818e[_0x2caf('0x12')],_0x5ad211);_0xbefce6(_0x6a32ac[_0x2caf('0x10')](0x1f4,_0x20818e[_0x2caf('0x12')]));});});}; \ No newline at end of file +var _0x5fdc=['CreateVoiceRecording','Setting','findOne','callRecordingEncryption','create','existsSync','value','format','%s.cypher','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceRecording,\x20%s,\x20%s','info','UpdateVoiceRecording','VoiceRecording','body','options','raw','where','attributes','limit','catch'];(function(_0xcd5a3d,_0x3c5b33){var _0xd43207=function(_0x17d976){while(--_0x17d976){_0xcd5a3d['push'](_0xcd5a3d['shift']());}};_0xd43207(++_0x3c5b33);}(_0x5fdc,0x127));var _0xc5fd=function(_0xb7b67d,_0x576189){_0xb7b67d=_0xb7b67d-0x0;var _0x51d8cb=_0x5fdc[_0xb7b67d];return _0x51d8cb;};'use strict';var _=require(_0xc5fd('0x0'));var util=require(_0xc5fd('0x1'));var moment=require(_0xc5fd('0x2'));var BPromise=require(_0xc5fd('0x3'));var rs=require(_0xc5fd('0x4'));var fs=require('fs');var Redis=require(_0xc5fd('0x5'));var db=require(_0xc5fd('0x6'))['db'];var utils=require(_0xc5fd('0x7'));var logger=require(_0xc5fd('0x8'))(_0xc5fd('0x9'));var config=require(_0xc5fd('0xa'));var jayson=require(_0xc5fd('0xb'));var client=jayson[_0xc5fd('0xc')][_0xc5fd('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x15ffe7,_0x5a2eb4,_0x5d86e5){return new BPromise(function(_0x493389,_0x224801){return client[_0xc5fd('0xe')](_0x15ffe7,_0x5d86e5)[_0xc5fd('0xf')](function(_0x45c91f){logger['info']('VoiceRecording,\x20%s,\x20%s',_0x5a2eb4,_0xc5fd('0x10'));logger[_0xc5fd('0x11')](_0xc5fd('0x12'),_0x5a2eb4,_0xc5fd('0x10'),JSON[_0xc5fd('0x13')](_0x45c91f));if(_0x45c91f[_0xc5fd('0x14')]){if(_0x45c91f['error'][_0xc5fd('0x15')]===0x1f4){logger['error']('VoiceRecording,\x20%s,\x20%s',_0x5a2eb4,_0x45c91f[_0xc5fd('0x14')][_0xc5fd('0x16')]);return _0x224801(_0x45c91f[_0xc5fd('0x14')][_0xc5fd('0x16')]);}logger[_0xc5fd('0x14')](_0xc5fd('0x17'),_0x5a2eb4,_0x45c91f[_0xc5fd('0x14')][_0xc5fd('0x16')]);return _0x493389(_0x45c91f['error'][_0xc5fd('0x16')]);}else{logger[_0xc5fd('0x18')](_0xc5fd('0x17'),_0x5a2eb4,_0xc5fd('0x10'));_0x493389(_0x45c91f['result']['message']);}})['catch'](function(_0x5529b3){logger['error'](_0xc5fd('0x17'),_0x5a2eb4,_0x5529b3);_0x224801(_0x5529b3);});});}exports[_0xc5fd('0x19')]=function(_0x27f611){var _0xd0a9f1=this;return new Promise(function(_0x2ee392,_0x3f981f){return db[_0xc5fd('0x1a')]['update'](_0x27f611[_0xc5fd('0x1b')],{'raw':_0x27f611[_0xc5fd('0x1c')]?_0x27f611[_0xc5fd('0x1c')][_0xc5fd('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x27f611[_0xc5fd('0x1c')]?_0x27f611['options'][_0xc5fd('0x1e')]||null:null,'attributes':_0x27f611[_0xc5fd('0x1c')]?_0x27f611[_0xc5fd('0x1c')][_0xc5fd('0x1f')]||null:null,'limit':_0x27f611['options']?_0x27f611['options'][_0xc5fd('0x20')]||null:null})[_0xc5fd('0xf')](function(_0x3d7211){logger[_0xc5fd('0x18')](_0xc5fd('0x19'),_0x27f611);logger[_0xc5fd('0x11')]('UpdateVoiceRecording',_0x27f611,JSON[_0xc5fd('0x13')](_0x3d7211));_0x2ee392(_0x3d7211);})[_0xc5fd('0x21')](function(_0x1a5174){logger[_0xc5fd('0x14')](_0xc5fd('0x19'),_0x1a5174[_0xc5fd('0x16')],_0x27f611);_0x3f981f(_0xd0a9f1[_0xc5fd('0x14')](0x1f4,_0x1a5174['message']));});});};exports[_0xc5fd('0x22')]=function(_0x48cd1d){var _0x2ee700=this;return new Promise(function(_0x231368,_0x44681d){var _0x2bee22=require('../../components/encryptor');var _0x176313;return db[_0xc5fd('0x23')][_0xc5fd('0x24')]({'attributes':['id',_0xc5fd('0x25')],'where':{'id':0x1},'raw':!![]})[_0xc5fd('0xf')](function(_0x209975){_0x176313=_0x209975;return db['VoiceRecording'][_0xc5fd('0x26')](_0x48cd1d['body']);})['then'](function(_0x12a962){if(_0x176313[_0xc5fd('0x25')]&&fs[_0xc5fd('0x27')](_0x12a962[_0xc5fd('0x28')])){var _0x7693c4=util[_0xc5fd('0x29')](_0xc5fd('0x2a'),_0x12a962[_0xc5fd('0x28')]);return _0x2bee22['encryptFile'](_0x12a962[_0xc5fd('0x28')],_0x7693c4,config[_0xc5fd('0x2b')][_0xc5fd('0x2c')])[_0xc5fd('0xf')](function(){fs[_0xc5fd('0x2d')](_0x12a962[_0xc5fd('0x28')]);logger[_0xc5fd('0x18')](_0xc5fd('0x2e'));return _0x12a962;});}return _0x12a962;})[_0xc5fd('0xf')](function(_0x466aa1){logger[_0xc5fd('0x18')](_0xc5fd('0x22'),_0x48cd1d);logger['debug'](_0xc5fd('0x22'),_0x48cd1d,JSON[_0xc5fd('0x13')](_0x466aa1));_0x231368(_0x466aa1);})[_0xc5fd('0x21')](function(_0x1fa329){logger[_0xc5fd('0x14')](_0xc5fd('0x22'),_0x1fa329[_0xc5fd('0x16')],_0x48cd1d);_0x44681d(_0x2ee700[_0xc5fd('0x14')](0x1f4,_0x1fa329[_0xc5fd('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index cb19f3c..7bb4104 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 _0xe7ca=['delete','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./voiceTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','create','put'];(function(_0x336ca2,_0x1a813a){var _0xda59a6=function(_0x47caa6){while(--_0x47caa6){_0x336ca2['push'](_0x336ca2['shift']());}};_0xda59a6(++_0x1a813a);}(_0xe7ca,0x9a));var _0xae7c=function(_0x452031,_0x1c51d2){_0x452031=_0x452031-0x0;var _0x2c080c=_0xe7ca[_0x452031];return _0x2c080c;};'use strict';var multer=require(_0xae7c('0x0'));var util=require('util');var path=require(_0xae7c('0x1'));var timeout=require(_0xae7c('0x2'));var express=require(_0xae7c('0x3'));var router=express[_0xae7c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xae7c('0x5'));var interaction=require(_0xae7c('0x6'));var config=require('../../config/environment');var controller=require(_0xae7c('0x7'));router[_0xae7c('0x8')]('/',auth[_0xae7c('0x9')](),controller[_0xae7c('0xa')]);router['get'](_0xae7c('0xb'),auth[_0xae7c('0x9')](),controller['describe']);router['get'](_0xae7c('0xc'),auth[_0xae7c('0x9')](),controller[_0xae7c('0xd')]);router['post']('/',auth[_0xae7c('0x9')](),controller[_0xae7c('0xe')]);router[_0xae7c('0xf')](_0xae7c('0xc'),auth[_0xae7c('0x9')](),controller['update']);router[_0xae7c('0x10')](_0xae7c('0xc'),auth[_0xae7c('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x3b8b=['/describe','isAuthenticated','show','post','create','put','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','index'];(function(_0x1f6cc9,_0x456c8e){var _0x9bd7d1=function(_0x488214){while(--_0x488214){_0x1f6cc9['push'](_0x1f6cc9['shift']());}};_0x9bd7d1(++_0x456c8e);}(_0x3b8b,0x154));var _0xb3b8=function(_0x2aa48b,_0x5a4446){_0x2aa48b=_0x2aa48b-0x0;var _0x48caf8=_0x3b8b[_0x2aa48b];return _0x48caf8;};'use strict';var multer=require(_0xb3b8('0x0'));var util=require(_0xb3b8('0x1'));var path=require(_0xb3b8('0x2'));var timeout=require(_0xb3b8('0x3'));var express=require(_0xb3b8('0x4'));var router=express[_0xb3b8('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb3b8('0x6'));var interaction=require(_0xb3b8('0x7'));var config=require(_0xb3b8('0x8'));var controller=require(_0xb3b8('0x9'));router[_0xb3b8('0xa')]('/',auth['isAuthenticated'](),controller[_0xb3b8('0xb')]);router[_0xb3b8('0xa')](_0xb3b8('0xc'),auth[_0xb3b8('0xd')](),controller['describe']);router[_0xb3b8('0xa')]('/:id',auth[_0xb3b8('0xd')](),controller[_0xb3b8('0xe')]);router[_0xb3b8('0xf')]('/',auth[_0xb3b8('0xd')](),controller[_0xb3b8('0x10')]);router[_0xb3b8('0x11')]('/:id',auth[_0xb3b8('0xd')](),controller['update']);router[_0xb3b8('0x12')](_0xb3b8('0x13'),auth[_0xb3b8('0xd')](),controller[_0xb3b8('0x14')]);module[_0xb3b8('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 0b2b0f5..b343d99 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 _0xb644=['STRING','Yes','sequelize','ENUM','blind'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0xb644,0xed));var _0x4b64=function(_0x3de875,_0x55b236){_0x3de875=_0x3de875-0x0;var _0xbdc57b=_0xb644[_0x3de875];return _0xbdc57b;};'use strict';var Sequelize=require(_0x4b64('0x0'));var moment=require('moment');module['exports']={'type':{'type':Sequelize[_0x4b64('0x1')](_0x4b64('0x2'),'attended')},'result':{'type':Sequelize[_0x4b64('0x3')]},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0x4b64('0x3')]},'transfererconnectedlinenum':{'type':Sequelize[_0x4b64('0x3')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0x4b64('0x3')]},'transferercontext':{'type':Sequelize[_0x4b64('0x3')]},'transfererexten':{'type':Sequelize[_0x4b64('0x3')]},'transfererlinkedid':{'type':Sequelize[_0x4b64('0x3')]},'transfereechannel':{'type':Sequelize[_0x4b64('0x3')]},'transfereecalleridnum':{'type':Sequelize[_0x4b64('0x3')]},'transfereecalleridname':{'type':Sequelize[_0x4b64('0x3')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x4b64('0x3')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize[_0x4b64('0x3')]},'transfereecontext':{'type':Sequelize[_0x4b64('0x3')]},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize[_0x4b64('0x3')]},'isexternal':{'type':Sequelize['ENUM'](_0x4b64('0x4'),'No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1251=['attended','STRING','Yes','sequelize','exports','ENUM','blind'];(function(_0x5a9509,_0x39e4db){var _0x45bfc0=function(_0x47bae1){while(--_0x47bae1){_0x5a9509['push'](_0x5a9509['shift']());}};_0x45bfc0(++_0x39e4db);}(_0x1251,0x8f));var _0x1125=function(_0x24844d,_0x727f98){_0x24844d=_0x24844d-0x0;var _0x458a84=_0x1251[_0x24844d];return _0x458a84;};'use strict';var Sequelize=require(_0x1125('0x0'));var moment=require('moment');module[_0x1125('0x1')]={'type':{'type':Sequelize[_0x1125('0x2')](_0x1125('0x3'),_0x1125('0x4'))},'result':{'type':Sequelize[_0x1125('0x5')]},'transfererchannel':{'type':Sequelize[_0x1125('0x5')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0x1125('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0x1125('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0x1125('0x5')]},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize[_0x1125('0x5')]},'transfereechannel':{'type':Sequelize[_0x1125('0x5')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize[_0x1125('0x5')]},'transfereeconnectedlinename':{'type':Sequelize[_0x1125('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0x1125('0x5')]},'transfereecontext':{'type':Sequelize[_0x1125('0x5')]},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize[_0x1125('0x5')]},'isexternal':{'type':Sequelize[_0x1125('0x2')](_0x1125('0x6'),'No')},'context':{'type':Sequelize[_0x1125('0x5')]},'extension':{'type':Sequelize[_0x1125('0x5')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 5534d35..1713e41 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 _0x2c23=['json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','index','map','VoiceTransferReport','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','includeAll','include','rows','show','params','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0x320b9e,_0x1f892f){var _0x5e4416=function(_0x160fcc){while(--_0x160fcc){_0x320b9e['push'](_0x320b9e['shift']());}};_0x5e4416(++_0x1f892f);}(_0x2c23,0x75));var _0x32c2=function(_0xf3d3d,_0x18c710){_0xf3d3d=_0xf3d3d-0x0;var _0x1e5511=_0x2c23[_0xf3d3d];return _0x1e5511;};'use strict';var emlformat=require(_0x32c2('0x0'));var rimraf=require(_0x32c2('0x1'));var zipdir=require(_0x32c2('0x2'));var jsonpatch=require(_0x32c2('0x3'));var rp=require(_0x32c2('0x4'));var moment=require(_0x32c2('0x5'));var BPromise=require(_0x32c2('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x32c2('0x7'));var csv=require(_0x32c2('0x8'));var ejs=require(_0x32c2('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32c2('0xa'));var squel=require('squel');var crypto=require(_0x32c2('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x32c2('0xc'));var toCsv=require(_0x32c2('0x8'));var querystring=require(_0x32c2('0xd'));var Papa=require(_0x32c2('0xe'));var Redis=require(_0x32c2('0xf'));var authService=require(_0x32c2('0x10'));var qs=require(_0x32c2('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32c2('0x12'));var logger=require(_0x32c2('0x13'))(_0x32c2('0x14'));var utils=require('../../config/utils');var config=require(_0x32c2('0x15'));var licenseUtil=require(_0x32c2('0x16'));var db=require(_0x32c2('0x17'))['db'];function respondWithStatusCode(_0xc3431d,_0x59add2){_0x59add2=_0x59add2||0xcc;return function(_0x57917a){if(_0x57917a){return _0xc3431d[_0x32c2('0x18')](_0x59add2);}return _0xc3431d[_0x32c2('0x19')](_0x59add2)[_0x32c2('0x1a')]();};}function respondWithResult(_0x45f33c,_0x367b7a){_0x367b7a=_0x367b7a||0xc8;return function(_0xcbf924){if(_0xcbf924){return _0x45f33c['status'](_0x367b7a)[_0x32c2('0x1b')](_0xcbf924);}};}function respondWithFilteredResult(_0x1c1ff6,_0x284783){return function(_0x3079a2){if(_0x3079a2){var _0x5271e8=typeof _0x284783[_0x32c2('0x1c')]===_0x32c2('0x1d')&&typeof _0x284783[_0x32c2('0x1e')]===_0x32c2('0x1d');var _0x35a5ba=_0x3079a2[_0x32c2('0x1f')];var _0x561df7=_0x5271e8?0x0:_0x284783[_0x32c2('0x1c')];var _0x20b3ab=_0x5271e8?_0x3079a2[_0x32c2('0x1f')]:_0x284783[_0x32c2('0x1c')]+_0x284783[_0x32c2('0x1e')];var _0x49b353;if(_0x20b3ab>=_0x35a5ba){_0x20b3ab=_0x35a5ba;_0x49b353=0xc8;}else{_0x49b353=0xce;}_0x1c1ff6[_0x32c2('0x19')](_0x49b353);return _0x1c1ff6[_0x32c2('0x20')](_0x32c2('0x21'),_0x561df7+'-'+_0x20b3ab+'/'+_0x35a5ba)['json'](_0x3079a2);}return null;};}function patchUpdates(_0xa48aee){return function(_0x2b65dd){try{jsonpatch['apply'](_0x2b65dd,_0xa48aee,!![]);}catch(_0x21775a){return BPromise[_0x32c2('0x22')](_0x21775a);}return _0x2b65dd[_0x32c2('0x23')]();};}function saveUpdates(_0x5a8a4e,_0x48143c){return function(_0x1addf5){if(_0x1addf5){return _0x1addf5[_0x32c2('0x24')](_0x5a8a4e)[_0x32c2('0x25')](function(_0xcd1a){return _0xcd1a;});}return null;};}function removeEntity(_0xaa5d5f,_0x1d099b){return function(_0x5c3142){if(_0x5c3142){return _0x5c3142[_0x32c2('0x26')]()[_0x32c2('0x25')](function(){_0xaa5d5f[_0x32c2('0x19')](0xcc)[_0x32c2('0x1a')]();});}};}function handleEntityNotFound(_0x3c862b,_0x358479){return function(_0x3c12b9){if(!_0x3c12b9){_0x3c862b[_0x32c2('0x18')](0x194);}return _0x3c12b9;};}function handleError(_0x530125,_0x352a6a){_0x352a6a=_0x352a6a||0x1f4;return function(_0xc887dc){logger[_0x32c2('0x27')](_0xc887dc[_0x32c2('0x28')]);if(_0xc887dc[_0x32c2('0x29')]){delete _0xc887dc[_0x32c2('0x29')];}_0x530125[_0x32c2('0x19')](_0x352a6a)['send'](_0xc887dc);};}exports[_0x32c2('0x2a')]=function(_0x39bd10,_0x4622f8){var _0x565ecc={},_0x4ec607={},_0x336641={'count':0x0,'rows':[]};var _0x20405b=_[_0x32c2('0x2b')](db[_0x32c2('0x2c')][_0x32c2('0x2d')],function(_0x5ecd65){return{'name':_0x5ecd65[_0x32c2('0x2e')],'type':_0x5ecd65['type']['key']};});_0x4ec607[_0x32c2('0x2f')]=_[_0x32c2('0x2b')](_0x20405b,_0x32c2('0x29'));_0x4ec607[_0x32c2('0x30')]=_[_0x32c2('0x31')](_0x39bd10[_0x32c2('0x30')]);_0x4ec607[_0x32c2('0x32')]=_[_0x32c2('0x33')](_0x4ec607[_0x32c2('0x2f')],_0x4ec607[_0x32c2('0x30')]);_0x565ecc[_0x32c2('0x34')]=_[_0x32c2('0x33')](_0x4ec607[_0x32c2('0x2f')],qs['fields'](_0x39bd10[_0x32c2('0x30')][_0x32c2('0x35')]));_0x565ecc[_0x32c2('0x34')]=_0x565ecc[_0x32c2('0x34')][_0x32c2('0x36')]?_0x565ecc[_0x32c2('0x34')]:_0x4ec607[_0x32c2('0x2f')];if(!_0x39bd10['query'][_0x32c2('0x37')](_0x32c2('0x38'))){_0x565ecc[_0x32c2('0x1e')]=qs[_0x32c2('0x1e')](_0x39bd10[_0x32c2('0x30')][_0x32c2('0x1e')]);_0x565ecc[_0x32c2('0x1c')]=qs['offset'](_0x39bd10[_0x32c2('0x30')][_0x32c2('0x1c')]);}_0x565ecc[_0x32c2('0x39')]=qs[_0x32c2('0x3a')](_0x39bd10[_0x32c2('0x30')][_0x32c2('0x3a')]);_0x565ecc[_0x32c2('0x3b')]=qs['filters'](_['pick'](_0x39bd10[_0x32c2('0x30')],_0x4ec607[_0x32c2('0x32')]),_0x20405b);if(_0x39bd10[_0x32c2('0x30')][_0x32c2('0x3c')]){_0x565ecc[_0x32c2('0x3b')]=_[_0x32c2('0x3d')](_0x565ecc[_0x32c2('0x3b')],{'$or':_[_0x32c2('0x2b')](_0x20405b,function(_0x2de934){if(_0x2de934['type']!=='VIRTUAL'){var _0x5aa277={};_0x5aa277[_0x2de934[_0x32c2('0x29')]]={'$like':'%'+_0x39bd10['query']['filter']+'%'};return _0x5aa277;}})});}_0x565ecc=_[_0x32c2('0x3d')]({},_0x565ecc,_0x39bd10['options']);var _0x4ef581={'where':_0x565ecc[_0x32c2('0x3b')]};return db[_0x32c2('0x2c')][_0x32c2('0x1f')](_0x4ef581)[_0x32c2('0x25')](function(_0x219e48){_0x336641['count']=_0x219e48;if(_0x39bd10[_0x32c2('0x30')][_0x32c2('0x3e')]){_0x565ecc[_0x32c2('0x3f')]=[{'all':!![]}];}return db[_0x32c2('0x2c')]['findAll'](_0x565ecc);})[_0x32c2('0x25')](function(_0x33a19c){_0x336641[_0x32c2('0x40')]=_0x33a19c;return _0x336641;})[_0x32c2('0x25')](respondWithFilteredResult(_0x4622f8,_0x565ecc))['catch'](handleError(_0x4622f8,null));};exports[_0x32c2('0x41')]=function(_0x4a0395,_0x2e4daf){var _0x4fe418={'raw':!![],'where':{'id':_0x4a0395[_0x32c2('0x42')]['id']}},_0x330a2f={};_0x330a2f[_0x32c2('0x2f')]=_[_0x32c2('0x31')](db['VoiceTransferReport']['rawAttributes']);_0x330a2f[_0x32c2('0x30')]=_[_0x32c2('0x31')](_0x4a0395[_0x32c2('0x30')]);_0x330a2f[_0x32c2('0x32')]=_['intersection'](_0x330a2f[_0x32c2('0x2f')],_0x330a2f[_0x32c2('0x30')]);_0x4fe418[_0x32c2('0x34')]=_[_0x32c2('0x33')](_0x330a2f[_0x32c2('0x2f')],qs['fields'](_0x4a0395['query'][_0x32c2('0x35')]));_0x4fe418['attributes']=_0x4fe418[_0x32c2('0x34')][_0x32c2('0x36')]?_0x4fe418['attributes']:_0x330a2f['model'];if(_0x4a0395[_0x32c2('0x30')][_0x32c2('0x3e')]){_0x4fe418[_0x32c2('0x3f')]=[{'all':!![]}];}_0x4fe418=_[_0x32c2('0x3d')]({},_0x4fe418,_0x4a0395['options']);return db['VoiceTransferReport'][_0x32c2('0x43')](_0x4fe418)[_0x32c2('0x25')](handleEntityNotFound(_0x2e4daf,null))[_0x32c2('0x25')](respondWithResult(_0x2e4daf,null))[_0x32c2('0x44')](handleError(_0x2e4daf,null));};exports[_0x32c2('0x45')]=function(_0x2c755f,_0x28c404){return db[_0x32c2('0x2c')][_0x32c2('0x45')](_0x2c755f[_0x32c2('0x46')],{})[_0x32c2('0x25')](respondWithResult(_0x28c404,0xc9))[_0x32c2('0x44')](handleError(_0x28c404,null));};exports[_0x32c2('0x24')]=function(_0x5b9c72,_0x5deb39){if(_0x5b9c72[_0x32c2('0x46')]['id']){delete _0x5b9c72[_0x32c2('0x46')]['id'];}return db[_0x32c2('0x2c')][_0x32c2('0x43')]({'where':{'id':_0x5b9c72['params']['id']}})[_0x32c2('0x25')](handleEntityNotFound(_0x5deb39,null))[_0x32c2('0x25')](saveUpdates(_0x5b9c72[_0x32c2('0x46')],null))['then'](respondWithResult(_0x5deb39,null))['catch'](handleError(_0x5deb39,null));};exports[_0x32c2('0x26')]=function(_0x56fdc1,_0x592d6c){return db[_0x32c2('0x2c')][_0x32c2('0x43')]({'where':{'id':_0x56fdc1[_0x32c2('0x42')]['id']}})[_0x32c2('0x25')](handleEntityNotFound(_0x592d6c,null))['then'](removeEntity(_0x592d6c,null))[_0x32c2('0x44')](handleError(_0x592d6c,null));};exports['describe']=function(_0x9edb20,_0x2b65b8){return db[_0x32c2('0x2c')][_0x32c2('0x47')]()[_0x32c2('0x25')](respondWithResult(_0x2b65b8,null))[_0x32c2('0x44')](handleError(_0x2b65b8,null));}; \ No newline at end of file +var _0xe93c=['offset','set','apply','reject','save','update','then','error','stack','name','send','index','map','VoiceTransferReport','rawAttributes','fieldName','type','model','query','keys','filters','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','intersection','fields','find','create','body','destroy','rimraf','fast-json-patch','moment','bluebird','mustache','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count'];(function(_0xe1770a,_0x4fc5d6){var _0x3e6274=function(_0x1a016f){while(--_0x1a016f){_0xe1770a['push'](_0xe1770a['shift']());}};_0x3e6274(++_0x4fc5d6);}(_0xe93c,0x74));var _0xce93=function(_0x462bfc,_0x11747e){_0x462bfc=_0x462bfc-0x0;var _0x170740=_0xe93c[_0x462bfc];return _0x170740;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xce93('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xce93('0x1'));var rp=require('request-promise');var moment=require(_0xce93('0x2'));var BPromise=require(_0xce93('0x3'));var Mustache=require(_0xce93('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xce93('0x5'));var ejs=require(_0xce93('0x6'));var fs=require('fs');var fs_extra=require(_0xce93('0x7'));var _=require('lodash');var squel=require(_0xce93('0x8'));var crypto=require(_0xce93('0x9'));var jsforce=require(_0xce93('0xa'));var deskjs=require(_0xce93('0xb'));var toCsv=require(_0xce93('0x5'));var querystring=require('querystring');var Papa=require(_0xce93('0xc'));var Redis=require(_0xce93('0xd'));var authService=require(_0xce93('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xce93('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xce93('0x10'))(_0xce93('0x11'));var utils=require(_0xce93('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xce93('0x13'));var db=require(_0xce93('0x14'))['db'];function respondWithStatusCode(_0x5a5072,_0xf0da30){_0xf0da30=_0xf0da30||0xcc;return function(_0x31751e){if(_0x31751e){return _0x5a5072[_0xce93('0x15')](_0xf0da30);}return _0x5a5072['status'](_0xf0da30)[_0xce93('0x16')]();};}function respondWithResult(_0x7ea755,_0x4ce40a){_0x4ce40a=_0x4ce40a||0xc8;return function(_0x314a4c){if(_0x314a4c){return _0x7ea755[_0xce93('0x17')](_0x4ce40a)[_0xce93('0x18')](_0x314a4c);}};}function respondWithFilteredResult(_0x46a7b5,_0x3796ba){return function(_0xf3d36a){if(_0xf3d36a){var _0x4be97c=typeof _0x3796ba['offset']===_0xce93('0x19')&&typeof _0x3796ba[_0xce93('0x1a')]===_0xce93('0x19');var _0x1b6b4c=_0xf3d36a[_0xce93('0x1b')];var _0xd4ddea=_0x4be97c?0x0:_0x3796ba[_0xce93('0x1c')];var _0x5e1801=_0x4be97c?_0xf3d36a['count']:_0x3796ba[_0xce93('0x1c')]+_0x3796ba[_0xce93('0x1a')];var _0xd0ef45;if(_0x5e1801>=_0x1b6b4c){_0x5e1801=_0x1b6b4c;_0xd0ef45=0xc8;}else{_0xd0ef45=0xce;}_0x46a7b5['status'](_0xd0ef45);return _0x46a7b5[_0xce93('0x1d')]('Content-Range',_0xd4ddea+'-'+_0x5e1801+'/'+_0x1b6b4c)[_0xce93('0x18')](_0xf3d36a);}return null;};}function patchUpdates(_0x349ca4){return function(_0x242f5a){try{jsonpatch[_0xce93('0x1e')](_0x242f5a,_0x349ca4,!![]);}catch(_0x1a4876){return BPromise[_0xce93('0x1f')](_0x1a4876);}return _0x242f5a[_0xce93('0x20')]();};}function saveUpdates(_0x5add3a,_0x2252ca){return function(_0x1db86b){if(_0x1db86b){return _0x1db86b[_0xce93('0x21')](_0x5add3a)['then'](function(_0x5deb6f){return _0x5deb6f;});}return null;};}function removeEntity(_0x1dd107,_0x4631be){return function(_0x47edd1){if(_0x47edd1){return _0x47edd1['destroy']()[_0xce93('0x22')](function(){_0x1dd107['status'](0xcc)[_0xce93('0x16')]();});}};}function handleEntityNotFound(_0x524eab,_0x81f834){return function(_0xf443ee){if(!_0xf443ee){_0x524eab[_0xce93('0x15')](0x194);}return _0xf443ee;};}function handleError(_0x225f20,_0xbd8542){_0xbd8542=_0xbd8542||0x1f4;return function(_0x2878f7){logger[_0xce93('0x23')](_0x2878f7[_0xce93('0x24')]);if(_0x2878f7[_0xce93('0x25')]){delete _0x2878f7[_0xce93('0x25')];}_0x225f20[_0xce93('0x17')](_0xbd8542)[_0xce93('0x26')](_0x2878f7);};}exports[_0xce93('0x27')]=function(_0x33e258,_0x48536f){var _0x5e9955={},_0x354050={},_0x5bfa37={'count':0x0,'rows':[]};var _0x451ece=_[_0xce93('0x28')](db[_0xce93('0x29')][_0xce93('0x2a')],function(_0x4cad1f){return{'name':_0x4cad1f[_0xce93('0x2b')],'type':_0x4cad1f[_0xce93('0x2c')]['key']};});_0x354050[_0xce93('0x2d')]=_[_0xce93('0x28')](_0x451ece,_0xce93('0x25'));_0x354050[_0xce93('0x2e')]=_[_0xce93('0x2f')](_0x33e258['query']);_0x354050[_0xce93('0x30')]=_['intersection'](_0x354050['model'],_0x354050['query']);_0x5e9955[_0xce93('0x31')]=_['intersection'](_0x354050[_0xce93('0x2d')],qs['fields'](_0x33e258[_0xce93('0x2e')]['fields']));_0x5e9955[_0xce93('0x31')]=_0x5e9955[_0xce93('0x31')][_0xce93('0x32')]?_0x5e9955[_0xce93('0x31')]:_0x354050[_0xce93('0x2d')];if(!_0x33e258[_0xce93('0x2e')][_0xce93('0x33')](_0xce93('0x34'))){_0x5e9955[_0xce93('0x1a')]=qs[_0xce93('0x1a')](_0x33e258[_0xce93('0x2e')][_0xce93('0x1a')]);_0x5e9955[_0xce93('0x1c')]=qs[_0xce93('0x1c')](_0x33e258[_0xce93('0x2e')]['offset']);}_0x5e9955['order']=qs[_0xce93('0x35')](_0x33e258[_0xce93('0x2e')][_0xce93('0x35')]);_0x5e9955[_0xce93('0x36')]=qs['filters'](_[_0xce93('0x37')](_0x33e258[_0xce93('0x2e')],_0x354050[_0xce93('0x30')]),_0x451ece);if(_0x33e258[_0xce93('0x2e')][_0xce93('0x38')]){_0x5e9955[_0xce93('0x36')]=_['merge'](_0x5e9955['where'],{'$or':_[_0xce93('0x28')](_0x451ece,function(_0x1f6f37){if(_0x1f6f37[_0xce93('0x2c')]!==_0xce93('0x39')){var _0x1e1fcf={};_0x1e1fcf[_0x1f6f37[_0xce93('0x25')]]={'$like':'%'+_0x33e258[_0xce93('0x2e')][_0xce93('0x38')]+'%'};return _0x1e1fcf;}})});}_0x5e9955=_[_0xce93('0x3a')]({},_0x5e9955,_0x33e258[_0xce93('0x3b')]);var _0x3cca17={'where':_0x5e9955['where']};return db[_0xce93('0x29')][_0xce93('0x1b')](_0x3cca17)[_0xce93('0x22')](function(_0x572d19){_0x5bfa37[_0xce93('0x1b')]=_0x572d19;if(_0x33e258[_0xce93('0x2e')][_0xce93('0x3c')]){_0x5e9955[_0xce93('0x3d')]=[{'all':!![]}];}return db['VoiceTransferReport'][_0xce93('0x3e')](_0x5e9955);})[_0xce93('0x22')](function(_0x7c7a04){_0x5bfa37[_0xce93('0x3f')]=_0x7c7a04;return _0x5bfa37;})['then'](respondWithFilteredResult(_0x48536f,_0x5e9955))[_0xce93('0x40')](handleError(_0x48536f,null));};exports['show']=function(_0x14e999,_0x5a3fc6){var _0x557f72={'raw':!![],'where':{'id':_0x14e999[_0xce93('0x41')]['id']}},_0x266f41={};_0x266f41[_0xce93('0x2d')]=_['keys'](db[_0xce93('0x29')][_0xce93('0x2a')]);_0x266f41[_0xce93('0x2e')]=_[_0xce93('0x2f')](_0x14e999[_0xce93('0x2e')]);_0x266f41[_0xce93('0x30')]=_['intersection'](_0x266f41[_0xce93('0x2d')],_0x266f41['query']);_0x557f72[_0xce93('0x31')]=_[_0xce93('0x42')](_0x266f41['model'],qs[_0xce93('0x43')](_0x14e999[_0xce93('0x2e')][_0xce93('0x43')]));_0x557f72[_0xce93('0x31')]=_0x557f72[_0xce93('0x31')][_0xce93('0x32')]?_0x557f72[_0xce93('0x31')]:_0x266f41[_0xce93('0x2d')];if(_0x14e999[_0xce93('0x2e')][_0xce93('0x3c')]){_0x557f72['include']=[{'all':!![]}];}_0x557f72=_['merge']({},_0x557f72,_0x14e999[_0xce93('0x3b')]);return db[_0xce93('0x29')][_0xce93('0x44')](_0x557f72)[_0xce93('0x22')](handleEntityNotFound(_0x5a3fc6,null))['then'](respondWithResult(_0x5a3fc6,null))[_0xce93('0x40')](handleError(_0x5a3fc6,null));};exports[_0xce93('0x45')]=function(_0x300924,_0xd03ed0){return db['VoiceTransferReport']['create'](_0x300924[_0xce93('0x46')],{})[_0xce93('0x22')](respondWithResult(_0xd03ed0,0xc9))[_0xce93('0x40')](handleError(_0xd03ed0,null));};exports['update']=function(_0x4aa14d,_0x58ba3d){if(_0x4aa14d[_0xce93('0x46')]['id']){delete _0x4aa14d[_0xce93('0x46')]['id'];}return db[_0xce93('0x29')][_0xce93('0x44')]({'where':{'id':_0x4aa14d[_0xce93('0x41')]['id']}})[_0xce93('0x22')](handleEntityNotFound(_0x58ba3d,null))[_0xce93('0x22')](saveUpdates(_0x4aa14d[_0xce93('0x46')],null))[_0xce93('0x22')](respondWithResult(_0x58ba3d,null))[_0xce93('0x40')](handleError(_0x58ba3d,null));};exports[_0xce93('0x47')]=function(_0x24926e,_0x594b2b){return db[_0xce93('0x29')][_0xce93('0x44')]({'where':{'id':_0x24926e[_0xce93('0x41')]['id']}})[_0xce93('0x22')](handleEntityNotFound(_0x594b2b,null))[_0xce93('0x22')](removeEntity(_0x594b2b,null))[_0xce93('0x40')](handleError(_0x594b2b,null));};exports['describe']=function(_0x31dc5d,_0x40f260){return db['VoiceTransferReport']['describe']()[_0xce93('0x22')](respondWithResult(_0x40f260,null))['catch'](handleError(_0x40f260,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 6b8c0cc..c66255f 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 _0xdf0a=['lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','define','VoiceTransferReport','report_call_transfer'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0xdf0a,0xea));var _0xadf0=function(_0xeb8561,_0x1affd7){_0xeb8561=_0xeb8561-0x0;var _0xef04b7=_0xdf0a[_0xeb8561];return _0xef04b7;};'use strict';var _=require(_0xadf0('0x0'));var util=require('util');var logger=require(_0xadf0('0x1'))(_0xadf0('0x2'));var moment=require(_0xadf0('0x3'));var BPromise=require(_0xadf0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xadf0('0x5'));var rimraf=require(_0xadf0('0x6'));var config=require(_0xadf0('0x7'));var attributes=require(_0xadf0('0x8'));module[_0xadf0('0x9')]=function(_0x5b6ea3,_0x142464){return _0x5b6ea3[_0xadf0('0xa')](_0xadf0('0xb'),attributes,{'tableName':_0xadf0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x15fe=['./voiceTransferReport.attributes','exports','define','VoiceTransferReport','report_call_transfer','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x5483d4,_0x285446){var _0x5362b9=function(_0x1d216b){while(--_0x1d216b){_0x5483d4['push'](_0x5483d4['shift']());}};_0x5362b9(++_0x285446);}(_0x15fe,0x75));var _0xe15f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x15fe[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe15f('0x0'));var util=require(_0xe15f('0x1'));var logger=require(_0xe15f('0x2'))(_0xe15f('0x3'));var moment=require(_0xe15f('0x4'));var BPromise=require(_0xe15f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe15f('0x6'));var rimraf=require(_0xe15f('0x7'));var config=require(_0xe15f('0x8'));var attributes=require(_0xe15f('0x9'));module[_0xe15f('0xa')]=function(_0x383073,_0x542926){return _0x383073[_0xe15f('0xb')](_0xe15f('0xc'),attributes,{'tableName':_0xe15f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.rpc.js b/server/api/voiceTransferReport/voiceTransferReport.rpc.js index 2184aae..6859c4a 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 _0x9ebc=['rpc','../../config/environment','jayson/promise','http','then','info','VoiceTransferReport,\x20%s,\x20%s','VoiceTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','create','body','options','raw','CreateVoiceTransferReport','debug','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x2c680a,_0x4aa283){var _0x127800=function(_0x2cfc4c){while(--_0x2cfc4c){_0x2c680a['push'](_0x2c680a['shift']());}};_0x127800(++_0x4aa283);}(_0x9ebc,0x1b4));var _0xc9eb=function(_0x5ec5d5,_0xfbe071){_0x5ec5d5=_0x5ec5d5-0x0;var _0x58e97d=_0x9ebc[_0x5ec5d5];return _0x58e97d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc9eb('0x0'));var BPromise=require(_0xc9eb('0x1'));var rs=require(_0xc9eb('0x2'));var fs=require('fs');var Redis=require(_0xc9eb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc9eb('0x4'));var logger=require(_0xc9eb('0x5'))(_0xc9eb('0x6'));var config=require(_0xc9eb('0x7'));var jayson=require(_0xc9eb('0x8'));var client=jayson['client'][_0xc9eb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5e0336,_0x6e7e06,_0x32375c){return new BPromise(function(_0x1d3b9e,_0x202827){return client['request'](_0x5e0336,_0x32375c)[_0xc9eb('0xa')](function(_0x5f2271){logger[_0xc9eb('0xb')](_0xc9eb('0xc'),_0x6e7e06,'request\x20sent');logger['debug'](_0xc9eb('0xd'),_0x6e7e06,_0xc9eb('0xe'),JSON[_0xc9eb('0xf')](_0x5f2271));if(_0x5f2271[_0xc9eb('0x10')]){if(_0x5f2271['error']['code']===0x1f4){logger['error'](_0xc9eb('0xc'),_0x6e7e06,_0x5f2271[_0xc9eb('0x10')][_0xc9eb('0x11')]);return _0x202827(_0x5f2271[_0xc9eb('0x10')][_0xc9eb('0x11')]);}logger[_0xc9eb('0x10')](_0xc9eb('0xc'),_0x6e7e06,_0x5f2271[_0xc9eb('0x10')][_0xc9eb('0x11')]);return _0x1d3b9e(_0x5f2271[_0xc9eb('0x10')][_0xc9eb('0x11')]);}else{logger[_0xc9eb('0xb')](_0xc9eb('0xc'),_0x6e7e06,_0xc9eb('0xe'));_0x1d3b9e(_0x5f2271[_0xc9eb('0x12')][_0xc9eb('0x11')]);}})[_0xc9eb('0x13')](function(_0x311a76){logger[_0xc9eb('0x10')](_0xc9eb('0xc'),_0x6e7e06,_0x311a76);_0x202827(_0x311a76);});});}exports['CreateVoiceTransferReport']=function(_0x18554b){var _0x309832=this;return new Promise(function(_0x4dc1b9,_0x5989a3){return db['VoiceTransferReport'][_0xc9eb('0x14')](_0x18554b[_0xc9eb('0x15')],{'raw':_0x18554b['options']?_0x18554b[_0xc9eb('0x16')][_0xc9eb('0x17')]===undefined?!![]:![]:!![]})[_0xc9eb('0xa')](function(_0x1bf39a){logger[_0xc9eb('0xb')](_0xc9eb('0x18'),_0x18554b);logger[_0xc9eb('0x19')](_0xc9eb('0x18'),_0x18554b,JSON[_0xc9eb('0xf')](_0x1bf39a));_0x4dc1b9(_0x1bf39a);})[_0xc9eb('0x13')](function(_0xdf1cd0){logger['error'](_0xc9eb('0x18'),_0xdf1cd0[_0xc9eb('0x11')],_0x18554b);_0x5989a3(_0x309832[_0xc9eb('0x10')](0x1f4,_0xdf1cd0[_0xc9eb('0x11')]));});});}; \ No newline at end of file +var _0x727f=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','CreateVoiceTransferReport','VoiceTransferReport','body','options','catch'];(function(_0x59a2b7,_0x16c2a6){var _0x59593c=function(_0x4986eb){while(--_0x4986eb){_0x59a2b7['push'](_0x59a2b7['shift']());}};_0x59593c(++_0x16c2a6);}(_0x727f,0xc8));var _0xf727=function(_0x59b699,_0x498081){_0x59b699=_0x59b699-0x0;var _0x299f5e=_0x727f[_0x59b699];return _0x299f5e;};'use strict';var _=require('lodash');var util=require(_0xf727('0x0'));var moment=require(_0xf727('0x1'));var BPromise=require(_0xf727('0x2'));var rs=require(_0xf727('0x3'));var fs=require('fs');var Redis=require(_0xf727('0x4'));var db=require(_0xf727('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf727('0x6'))('rpc');var config=require(_0xf727('0x7'));var jayson=require(_0xf727('0x8'));var client=jayson[_0xf727('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4a3a55,_0x3df360,_0x3931f8){return new BPromise(function(_0x39be77,_0x21e48d){return client[_0xf727('0xa')](_0x4a3a55,_0x3931f8)[_0xf727('0xb')](function(_0x5e2b5c){logger[_0xf727('0xc')](_0xf727('0xd'),_0x3df360,_0xf727('0xe'));logger[_0xf727('0xf')]('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x3df360,'request\x20sent',JSON[_0xf727('0x10')](_0x5e2b5c));if(_0x5e2b5c[_0xf727('0x11')]){if(_0x5e2b5c['error']['code']===0x1f4){logger[_0xf727('0x11')](_0xf727('0xd'),_0x3df360,_0x5e2b5c[_0xf727('0x11')][_0xf727('0x12')]);return _0x21e48d(_0x5e2b5c[_0xf727('0x11')][_0xf727('0x12')]);}logger[_0xf727('0x11')]('VoiceTransferReport,\x20%s,\x20%s',_0x3df360,_0x5e2b5c[_0xf727('0x11')][_0xf727('0x12')]);return _0x39be77(_0x5e2b5c[_0xf727('0x11')]['message']);}else{logger[_0xf727('0xc')](_0xf727('0xd'),_0x3df360,_0xf727('0xe'));_0x39be77(_0x5e2b5c[_0xf727('0x13')][_0xf727('0x12')]);}})['catch'](function(_0x26f4e0){logger[_0xf727('0x11')]('VoiceTransferReport,\x20%s,\x20%s',_0x3df360,_0x26f4e0);_0x21e48d(_0x26f4e0);});});}exports[_0xf727('0x14')]=function(_0x4c62de){var _0x2399f4=this;return new Promise(function(_0x2ea214,_0x2b708d){return db[_0xf727('0x15')]['create'](_0x4c62de[_0xf727('0x16')],{'raw':_0x4c62de[_0xf727('0x17')]?_0x4c62de[_0xf727('0x17')]['raw']===undefined?!![]:![]:!![]})[_0xf727('0xb')](function(_0x2aa618){logger['info'](_0xf727('0x14'),_0x4c62de);logger[_0xf727('0xf')](_0xf727('0x14'),_0x4c62de,JSON[_0xf727('0x10')](_0x2aa618));_0x2ea214(_0x2aa618);})[_0xf727('0x18')](function(_0x501c19){logger[_0xf727('0x11')](_0xf727('0x14'),_0x501c19[_0xf727('0x12')],_0x4c62de);_0x2b708d(_0x2399f4['error'](0x1f4,_0x501c19[_0xf727('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index cff695b..385df94 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 _0x00bb=['answer','hold','/unhold','unhold','calls','/transfer','exports','express','Router','../../components/auth/service','post','isAuthenticated','isWebrtcLicence','/hangup','/answer'];(function(_0x1dae94,_0x239003){var _0x36ce2d=function(_0x295f18){while(--_0x295f18){_0x1dae94['push'](_0x1dae94['shift']());}};_0x36ce2d(++_0x239003);}(_0x00bb,0x1d8));var _0xb00b=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0x00bb[_0x3054be];return _0x3df150;};'use strict';var express=require(_0xb00b('0x0'));var router=express[_0xb00b('0x1')]();var auth=require(_0xb00b('0x2'));var controller=require('./webbar.controller');router[_0xb00b('0x3')]('/originate',auth[_0xb00b('0x4')](),auth[_0xb00b('0x5')](),controller['originate']);router[_0xb00b('0x3')](_0xb00b('0x6'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller['hangup']);router[_0xb00b('0x3')](_0xb00b('0x7'),auth[_0xb00b('0x4')](),auth[_0xb00b('0x5')](),controller[_0xb00b('0x8')]);router[_0xb00b('0x3')]('/hold',auth['isAuthenticated'](),auth[_0xb00b('0x5')](),controller[_0xb00b('0x9')]);router[_0xb00b('0x3')](_0xb00b('0xa'),auth[_0xb00b('0x4')](),auth['isWebrtcLicence'](),controller[_0xb00b('0xb')]);router['post']('/calls',auth['isAuthenticated'](),auth[_0xb00b('0x5')](),controller[_0xb00b('0xc')]);router[_0xb00b('0x3')](_0xb00b('0xd'),auth[_0xb00b('0x4')](),auth[_0xb00b('0x5')](),controller['transfer']);module[_0xb00b('0xe')]=router; \ No newline at end of file +var _0xdace=['unhold','calls','/transfer','transfer','exports','express','../../components/auth/service','./webbar.controller','post','isAuthenticated','isWebrtcLicence','originate','hangup','/answer','/hold','/unhold'];(function(_0x2389fb,_0x18c3e6){var _0x5160db=function(_0x3a8080){while(--_0x3a8080){_0x2389fb['push'](_0x2389fb['shift']());}};_0x5160db(++_0x18c3e6);}(_0xdace,0xc5));var _0xedac=function(_0x817d9b,_0x3c37e3){_0x817d9b=_0x817d9b-0x0;var _0x2752e1=_0xdace[_0x817d9b];return _0x2752e1;};'use strict';var express=require(_0xedac('0x0'));var router=express['Router']();var auth=require(_0xedac('0x1'));var controller=require(_0xedac('0x2'));router[_0xedac('0x3')]('/originate',auth[_0xedac('0x4')](),auth[_0xedac('0x5')](),controller[_0xedac('0x6')]);router[_0xedac('0x3')]('/hangup',auth[_0xedac('0x4')](),auth[_0xedac('0x5')](),controller[_0xedac('0x7')]);router['post'](_0xedac('0x8'),auth[_0xedac('0x4')](),auth[_0xedac('0x5')](),controller['answer']);router[_0xedac('0x3')](_0xedac('0x9'),auth[_0xedac('0x4')](),auth['isWebrtcLicence'](),controller['hold']);router[_0xedac('0x3')](_0xedac('0xa'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0xedac('0xb')]);router[_0xedac('0x3')]('/calls',auth[_0xedac('0x4')](),auth['isWebrtcLicence'](),controller[_0xedac('0xc')]);router[_0xedac('0x3')](_0xedac('0xd'),auth[_0xedac('0x4')](),auth[_0xedac('0x5')](),controller[_0xedac('0xe')]);module[_0xedac('0xf')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index 0d4db60..c5d4b21 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 _0x073e=['originate','info','originate\x20fired:','body','json','userId','callNumber','callbackUrl','entityFound:','format','user:%s','webbar:originate','catch','hangup','webbar:hangup','hangup\x20executed!','answer','webbar:answer','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','all','UserId','conference','conference\x20fired:','webbar:conference','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','client','http','../../config/logger','defaults','redis','localhost','socket.io-emitter','validate','userId\x20is\x20required','string','callNumber\x20is\x20required','number','sessionId\x20is\x20required','transferNumber\x20is\x20required','emit','log','error','stack','name','status','send','NotFound','request','then','User','agent','VoiceChannels','filter','rows','sessionId','length'];(function(_0x62bf3d,_0x27b69d){var _0x56499d=function(_0x29d7ac){while(--_0x29d7ac){_0x62bf3d['push'](_0x62bf3d['shift']());}};_0x56499d(++_0x27b69d);}(_0x073e,0x181));var _0xe073=function(_0x146516,_0x469a16){_0x146516=_0x146516-0x0;var _0x20fe8a=_0x073e[_0x146516];return _0x20fe8a;};'use strict';var path=require(_0xe073('0x0'));var fs=require('fs');var _=require(_0xe073('0x1'));var db=require(_0xe073('0x2'))['db'];var config=require(_0xe073('0x3'));var util=require('util');var BPromise=require('bluebird');var jayson=require('jayson/promise');var amiClient=jayson[_0xe073('0x4')][_0xe073('0x5')]({'port':0x232a});var logger=require(_0xe073('0x6'))('webbarapi');var Redis=require('ioredis');config['redis']=_[_0xe073('0x7')](config[_0xe073('0x8')],{'host':_0xe073('0x9'),'port':0x18eb});var io=require(_0xe073('0xa'))(new Redis(config[_0xe073('0x8')]));var Schema=require(_0xe073('0xb'));var originateValidation=new Schema({'userId':{'type':'number','required':[!![],_0xe073('0xc')]},'callNumber':{'type':_0xe073('0xd'),'required':[!![],_0xe073('0xe')]},'callerId':{'type':_0xe073('0xd')},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':_0xe073('0xf'),'required':[!![],_0xe073('0xc')]},'sessionId':{'type':_0xe073('0xd'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xe073('0xf'),'required':[!![],_0xe073('0xc')]},'sessionId':{'type':_0xe073('0xd'),'required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],_0xe073('0xc')]},'sessionId':{'type':'string','required':[!![],_0xe073('0x10')]},'transferNumber':{'type':'string','required':[!![],_0xe073('0x11')]}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],_0xe073('0xc')]},'sessionId':{'type':_0xe073('0xd'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xe073('0xf'),'required':[!![],_0xe073('0xc')]},'sessionId':{'type':_0xe073('0xd'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0xe073('0xf'),'required':[!![],_0xe073('0xc')]}});var conferenceValidation=new Schema({'userId':{'type':_0xe073('0xf'),'required':[!![],_0xe073('0xc')]}});function emit(_0x26f3d3,_0x38f9e5,_0x512fe8){logger['info'](_0x26f3d3,_0x38f9e5,JSON['stringify'](_0x512fe8));io['to'](_0x26f3d3)[_0xe073('0x12')](_0x38f9e5,_0x512fe8);}function handleError(_0x15488e){return function(_0x10486c){console[_0xe073('0x13')]('handleError:',_0x10486c,_0x10486c instanceof RangeError);logger[_0xe073('0x14')](_0x10486c[_0xe073('0x15')]);if(_0x10486c instanceof RangeError){if(_0x10486c[_0xe073('0x16')]){delete _0x10486c['name'];}_0x15488e[_0xe073('0x17')](0x194)[_0xe073('0x18')](_0x10486c);}else{if(_0x10486c[_0xe073('0x16')]){delete _0x10486c[_0xe073('0x16')];}_0x15488e[_0xe073('0x17')](0x1f4)[_0xe073('0x18')](_0x10486c);}};}function checkError(){return function(_0x41639a){if(!_0x41639a){throw new RangeError(_0xe073('0x19'));}return _0x41639a;};}function respondWithRpcPromise(_0xef9bf5,_0x40b28c){return new BPromise(function(_0x5143fa,_0x4405fd){var _0x21f9c2=amiClient;return _0x21f9c2[_0xe073('0x1a')](_0xef9bf5,_0x40b28c)[_0xe073('0x1b')](function(_0x39bcb4){if(_0x39bcb4[_0xe073('0x14')]){if(_0x39bcb4['error']['code']===0x1f4){return _0x4405fd(_0x39bcb4[_0xe073('0x14')]['message']);}return _0x5143fa(_0x39bcb4['error']['message']);}else{_0x5143fa(_0x39bcb4['result']);}})['catch'](function(_0x50795f){_0x4405fd(_0x50795f);});});}function getAgent(_0x23537f){return db[_0xe073('0x1c')]['findOne']({'where':{'id':_0x23537f,'role':_0xe073('0x1d')}})[_0xe073('0x1b')](checkError());}function getAgentCheckSession(_0x436c34,_0x5a5b2b){return new BPromise(function(_0x10f5ba,_0x58bffd){var _0x255d91=respondWithRpcPromise(_0xe073('0x1e'));var _0x599972=getAgent(_0x436c34);Promise['all']([_0x255d91,_0x599972])[_0xe073('0x1b')](function(_0x859ed8){var _0x278fbb=_0x859ed8[0x0];var _0x2f1cd2=_0x859ed8[0x1];var _0x20fabe=_[_0xe073('0x1f')](_0x278fbb[_0xe073('0x20')],function(_0x2a206a){return _0x2a206a['UserId']==_0x2f1cd2['id']&&_0x2a206a[_0xe073('0x21')]==_0x5a5b2b;});if(_0x20fabe[_0xe073('0x22')]==0x1){_0x10f5ba(_0x2f1cd2);}else{_0x58bffd(new RangeError('sessionId\x20'+_0x5a5b2b+'\x20not\x20found!'));}});});}exports[_0xe073('0x23')]=function(_0x5afd92,_0x3f6564){logger[_0xe073('0x24')](_0xe073('0x25'),_0x5afd92['body']);var _0x4b1e0a=originateValidation[_0xe073('0xb')](_0x5afd92[_0xe073('0x26')]);if(_0x4b1e0a['length']>0x0){return _0x3f6564[_0xe073('0x17')](0x190)[_0xe073('0x27')](_0x4b1e0a);}var _0xd2e860=_0x5afd92['body'][_0xe073('0x28')];var _0x4997a8=_0x5afd92['body'][_0xe073('0x29')];var _0x4588df=_0x5afd92[_0xe073('0x26')]['callerId'];var _0x23da53=_0x5afd92[_0xe073('0x26')][_0xe073('0x2a')];return getAgent(_0xd2e860)['then'](function(_0x341bab){logger[_0xe073('0x24')](_0xe073('0x2b'),_0x341bab[_0xe073('0x16')]);emit(util[_0xe073('0x2c')](_0xe073('0x2d'),_0x341bab['name']),_0xe073('0x2e'),{'callNumber':_0x4997a8,'callerId':_0x4588df,'callbackUrl':_0x23da53});return _0x3f6564[_0xe073('0x17')](0xc8)[_0xe073('0x27')]({'error':![],'message':'originate\x20executed!'});})[_0xe073('0x2f')](handleError(_0x3f6564));};exports[_0xe073('0x30')]=function(_0x110416,_0xc348b1){logger[_0xe073('0x24')]('hangup\x20fired:',_0x110416[_0xe073('0x26')]);var _0x5abc09=hangupValidation[_0xe073('0xb')](_0x110416[_0xe073('0x26')]);if(_0x5abc09[_0xe073('0x22')]>0x0){return _0xc348b1[_0xe073('0x17')](0x190)[_0xe073('0x27')](_0x5abc09);}var _0x2e200c=_0x110416[_0xe073('0x26')][_0xe073('0x28')];var _0x23a210=_0x110416[_0xe073('0x26')][_0xe073('0x21')];return getAgent(_0x2e200c)[_0xe073('0x1b')](function(_0x16be1a){logger['info'](_0xe073('0x2b'),_0x16be1a['name']);emit(util[_0xe073('0x2c')](_0xe073('0x2d'),_0x16be1a[_0xe073('0x16')]),_0xe073('0x31'),{'sessionId':_0x23a210});return _0xc348b1['status'](0xc8)[_0xe073('0x27')]({'error':![],'message':_0xe073('0x32')});})[_0xe073('0x2f')](handleError(_0xc348b1));};exports[_0xe073('0x33')]=function(_0x27758c,_0x56c08e){logger[_0xe073('0x24')]('answer\x20fired:',_0x27758c[_0xe073('0x26')]);var _0x2a8c57=answerValidation[_0xe073('0xb')](_0x27758c[_0xe073('0x26')]);if(_0x2a8c57[_0xe073('0x22')]>0x0){return _0x56c08e[_0xe073('0x17')](0x190)[_0xe073('0x27')](_0x2a8c57);}var _0x2f4939=_0x27758c[_0xe073('0x26')][_0xe073('0x28')];var _0x2c312b=_0x27758c['body']['sessionId'];return getAgent(_0x2f4939)[_0xe073('0x1b')](function(_0x3d4138){logger[_0xe073('0x24')](_0xe073('0x2b'),_0x3d4138[_0xe073('0x16')]);emit(util['format'](_0xe073('0x2d'),_0x3d4138[_0xe073('0x16')]),_0xe073('0x34'),{'sessionId':_0x2c312b});return _0x56c08e[_0xe073('0x17')](0xc8)[_0xe073('0x27')]({'error':![],'message':'answer\x20executed!'});})[_0xe073('0x2f')](handleError(_0x56c08e));};exports['hold']=function(_0x5aad64,_0x122f82){logger[_0xe073('0x24')]('hold\x20fired:',_0x5aad64['body']);var _0x20aea2=holdValidation[_0xe073('0xb')](_0x5aad64[_0xe073('0x26')]);if(_0x20aea2[_0xe073('0x22')]>0x0){return _0x122f82[_0xe073('0x17')](0x190)[_0xe073('0x27')](_0x20aea2);}var _0x317159=_0x5aad64['body'][_0xe073('0x28')];var _0x570964=_0x5aad64[_0xe073('0x26')][_0xe073('0x21')];return getAgent(_0x317159)[_0xe073('0x1b')](function(_0x4e1f1d){logger['info'](_0xe073('0x2b'),_0x4e1f1d[_0xe073('0x16')]);emit(util[_0xe073('0x2c')]('user:%s',_0x4e1f1d[_0xe073('0x16')]),_0xe073('0x35'),{'sessionId':_0x570964});return _0x122f82[_0xe073('0x17')](0xc8)[_0xe073('0x27')]({'error':![],'message':_0xe073('0x36')});})[_0xe073('0x2f')](handleError(_0x122f82));};exports[_0xe073('0x37')]=function(_0x307541,_0x3238eb){logger['info'](_0xe073('0x38'),_0x307541['body']);var _0x145bff=unholdValidation['validate'](_0x307541[_0xe073('0x26')]);if(_0x145bff[_0xe073('0x22')]>0x0){return _0x3238eb[_0xe073('0x17')](0x190)[_0xe073('0x27')](_0x145bff);}var _0x527a35=_0x307541[_0xe073('0x26')][_0xe073('0x28')];var _0x191005=_0x307541['body']['sessionId'];return getAgent(_0x527a35)[_0xe073('0x1b')](function(_0x1b12f8){logger[_0xe073('0x24')](_0xe073('0x2b'),_0x1b12f8[_0xe073('0x16')]);emit(util['format'](_0xe073('0x2d'),_0x1b12f8[_0xe073('0x16')]),_0xe073('0x39'),{'sessionId':_0x191005});return _0x3238eb[_0xe073('0x17')](0xc8)[_0xe073('0x27')]({'error':![],'message':_0xe073('0x3a')});})[_0xe073('0x2f')](handleError(_0x3238eb));};exports[_0xe073('0x3b')]=function(_0x374587,_0xbb074){logger['info'](_0xe073('0x3c'),_0xbb074['body']);var _0x5825eb=callsValidation[_0xe073('0xb')](_0x374587[_0xe073('0x26')]);if(_0x5825eb[_0xe073('0x22')]>0x0){return _0xbb074['status'](0x190)[_0xe073('0x27')](_0x5825eb);}var _0x37e892=_0x374587[_0xe073('0x26')]['userId'];var _0x420b53=respondWithRpcPromise('VoiceChannels');var _0xa0a501=getAgent(_0x37e892);return Promise[_0xe073('0x3d')]([_0x420b53,_0xa0a501])[_0xe073('0x1b')](function(_0x1a1382){var _0x3ff94a=_0x1a1382[0x0];var _0x56d026=_0x1a1382[0x1];var _0x129953=_[_0xe073('0x1f')](_0x3ff94a[_0xe073('0x20')],function(_0x3c0389){return _0x3c0389[_0xe073('0x3e')]==_0x56d026['id'];});return _0xbb074[_0xe073('0x17')](0xc8)[_0xe073('0x27')]({'count':_0x129953[_0xe073('0x22')],'rows':_0x129953});})[_0xe073('0x2f')](handleError(_0xbb074));};exports[_0xe073('0x3f')]=function(_0x922c35,_0x21ac98){logger[_0xe073('0x24')](_0xe073('0x40'),_0x922c35[_0xe073('0x26')]);var _0x1b26ac=conferenceValidation[_0xe073('0xb')](_0x922c35[_0xe073('0x26')]);if(_0x1b26ac[_0xe073('0x22')]>0x0){return _0x21ac98[_0xe073('0x17')](0x190)['json'](_0x1b26ac);}var _0x2fde71=_0x922c35[_0xe073('0x26')][_0xe073('0x28')];return getAgent(_0x2fde71)[_0xe073('0x1b')](function(_0x29405d){logger['info'](_0xe073('0x2b'),_0x29405d['name']);emit(util[_0xe073('0x2c')](_0xe073('0x2d'),_0x29405d[_0xe073('0x16')]),_0xe073('0x41'));return _0x21ac98[_0xe073('0x17')](0xc8)[_0xe073('0x27')]({'error':![],'message':'conference\x20executed!'});})[_0xe073('0x2f')](handleError(_0x21ac98));};exports['transfer']=function(_0x3c04a9,_0x4be096){logger[_0xe073('0x24')](_0xe073('0x42'),_0x3c04a9[_0xe073('0x26')]);var _0xae8bac=transferValidation[_0xe073('0xb')](_0x3c04a9[_0xe073('0x26')]);if(_0xae8bac[_0xe073('0x22')]>0x0){return _0x4be096[_0xe073('0x17')](0x190)[_0xe073('0x27')](_0xae8bac);}var _0x3264fb=_0x3c04a9[_0xe073('0x26')]['userId'];var _0x4e3453=_0x3c04a9[_0xe073('0x26')][_0xe073('0x21')];var _0x5b8653=_0x3c04a9['body'][_0xe073('0x43')];return getAgent(_0x3264fb)[_0xe073('0x1b')](function(_0x2f70d1){logger[_0xe073('0x24')](_0xe073('0x2b'),_0x2f70d1['name']);emit(util[_0xe073('0x2c')](_0xe073('0x2d'),_0x2f70d1[_0xe073('0x16')]),_0xe073('0x44'),{'sessionId':_0x4e3453,'transferNumber':_0x5b8653});return _0x4be096[_0xe073('0x17')](0xc8)[_0xe073('0x27')]({'error':![],'message':_0xe073('0x45')});})[_0xe073('0x2f')](handleError(_0x4be096));}; \ No newline at end of file +var _0xc874=['filter','rows','UserId','sessionId','length','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','json','userId','callerId','callbackUrl','info','format','webbar:originate','originate\x20executed!','hangup','validate','webbar:hangup','hangup\x20executed!','answer','entityFound:','user:%s','webbar:answer','answer\x20executed!','hold\x20fired:','webbar:hold','hold\x20executed!','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','conference\x20fired:','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','transfer\x20executed!','path','../../mysqldb','../../config/environment','jayson/promise','client','http','webbarapi','ioredis','defaults','redis','localhost','socket.io-emitter','number','string','callNumber\x20is\x20required','userId\x20is\x20required','sessionId\x20is\x20required','stringify','emit','log','error','stack','name','send','status','NotFound','request','then','code','message','result','catch','User','findOne','VoiceChannels'];(function(_0x534018,_0x5c6771){var _0x1c7a4c=function(_0x297d1d){while(--_0x297d1d){_0x534018['push'](_0x534018['shift']());}};_0x1c7a4c(++_0x5c6771);}(_0xc874,0x154));var _0x4c87=function(_0x1a0600,_0x41feef){_0x1a0600=_0x1a0600-0x0;var _0x734670=_0xc874[_0x1a0600];return _0x734670;};'use strict';var path=require(_0x4c87('0x0'));var fs=require('fs');var _=require('lodash');var db=require(_0x4c87('0x1'))['db'];var config=require(_0x4c87('0x2'));var util=require('util');var BPromise=require('bluebird');var jayson=require(_0x4c87('0x3'));var amiClient=jayson[_0x4c87('0x4')][_0x4c87('0x5')]({'port':0x232a});var logger=require('../../config/logger')(_0x4c87('0x6'));var Redis=require(_0x4c87('0x7'));config['redis']=_[_0x4c87('0x8')](config[_0x4c87('0x9')],{'host':_0x4c87('0xa'),'port':0x18eb});var io=require(_0x4c87('0xb'))(new Redis(config[_0x4c87('0x9')]));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':_0x4c87('0xc'),'required':[!![],'userId\x20is\x20required']},'callNumber':{'type':_0x4c87('0xd'),'required':[!![],_0x4c87('0xe')]},'callerId':{'type':_0x4c87('0xd')},'callbackUrl':{'type':_0x4c87('0xd')}});var hangupValidation=new Schema({'userId':{'type':_0x4c87('0xc'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x4c87('0xd'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x4c87('0xc'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x4c87('0xd'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x4c87('0xc'),'required':[!![],_0x4c87('0xf')]},'sessionId':{'type':_0x4c87('0xd'),'required':[!![],_0x4c87('0x10')]},'transferNumber':{'type':'string','required':[!![],'transferNumber\x20is\x20required']}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],_0x4c87('0xf')]},'sessionId':{'type':_0x4c87('0xd'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x4c87('0xc'),'required':[!![],_0x4c87('0xf')]},'sessionId':{'type':_0x4c87('0xd'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x4c87('0xc'),'required':[!![],_0x4c87('0xf')]}});var conferenceValidation=new Schema({'userId':{'type':_0x4c87('0xc'),'required':[!![],'userId\x20is\x20required']}});function emit(_0x27abb9,_0x3c32cc,_0x585705){logger['info'](_0x27abb9,_0x3c32cc,JSON[_0x4c87('0x11')](_0x585705));io['to'](_0x27abb9)[_0x4c87('0x12')](_0x3c32cc,_0x585705);}function handleError(_0x2b55fa){return function(_0x547d92){console[_0x4c87('0x13')]('handleError:',_0x547d92,_0x547d92 instanceof RangeError);logger[_0x4c87('0x14')](_0x547d92[_0x4c87('0x15')]);if(_0x547d92 instanceof RangeError){if(_0x547d92[_0x4c87('0x16')]){delete _0x547d92[_0x4c87('0x16')];}_0x2b55fa['status'](0x194)[_0x4c87('0x17')](_0x547d92);}else{if(_0x547d92[_0x4c87('0x16')]){delete _0x547d92[_0x4c87('0x16')];}_0x2b55fa[_0x4c87('0x18')](0x1f4)[_0x4c87('0x17')](_0x547d92);}};}function checkError(){return function(_0x22fac7){if(!_0x22fac7){throw new RangeError(_0x4c87('0x19'));}return _0x22fac7;};}function respondWithRpcPromise(_0x9da0d6,_0x50289b){return new BPromise(function(_0x353ac9,_0x33aafd){var _0x5cc15d=amiClient;return _0x5cc15d[_0x4c87('0x1a')](_0x9da0d6,_0x50289b)[_0x4c87('0x1b')](function(_0x5a9496){if(_0x5a9496[_0x4c87('0x14')]){if(_0x5a9496[_0x4c87('0x14')][_0x4c87('0x1c')]===0x1f4){return _0x33aafd(_0x5a9496[_0x4c87('0x14')]['message']);}return _0x353ac9(_0x5a9496[_0x4c87('0x14')][_0x4c87('0x1d')]);}else{_0x353ac9(_0x5a9496[_0x4c87('0x1e')]);}})[_0x4c87('0x1f')](function(_0x637dbc){_0x33aafd(_0x637dbc);});});}function getAgent(_0x3eb09e){return db[_0x4c87('0x20')][_0x4c87('0x21')]({'where':{'id':_0x3eb09e,'role':'agent'}})[_0x4c87('0x1b')](checkError());}function getAgentCheckSession(_0x47ef54,_0x27f13d){return new BPromise(function(_0x381af7,_0x3a9520){var _0x1f246e=respondWithRpcPromise(_0x4c87('0x22'));var _0x583371=getAgent(_0x47ef54);Promise['all']([_0x1f246e,_0x583371])[_0x4c87('0x1b')](function(_0x23483e){var _0x2e3549=_0x23483e[0x0];var _0x106121=_0x23483e[0x1];var _0xa7eb3=_[_0x4c87('0x23')](_0x2e3549[_0x4c87('0x24')],function(_0x10aea2){return _0x10aea2[_0x4c87('0x25')]==_0x106121['id']&&_0x10aea2[_0x4c87('0x26')]==_0x27f13d;});if(_0xa7eb3[_0x4c87('0x27')]==0x1){_0x381af7(_0x106121);}else{_0x3a9520(new RangeError(_0x4c87('0x28')+_0x27f13d+_0x4c87('0x29')));}});});}exports[_0x4c87('0x2a')]=function(_0x3a1aaf,_0x185590){logger['info'](_0x4c87('0x2b'),_0x3a1aaf['body']);var _0x110b84=originateValidation['validate'](_0x3a1aaf[_0x4c87('0x2c')]);if(_0x110b84[_0x4c87('0x27')]>0x0){return _0x185590[_0x4c87('0x18')](0x190)[_0x4c87('0x2d')](_0x110b84);}var _0x58eb98=_0x3a1aaf[_0x4c87('0x2c')][_0x4c87('0x2e')];var _0x2f307a=_0x3a1aaf[_0x4c87('0x2c')]['callNumber'];var _0x2060f8=_0x3a1aaf[_0x4c87('0x2c')][_0x4c87('0x2f')];var _0x30fdba=_0x3a1aaf['body'][_0x4c87('0x30')];return getAgent(_0x58eb98)[_0x4c87('0x1b')](function(_0x5fb196){logger[_0x4c87('0x31')]('entityFound:',_0x5fb196['name']);emit(util[_0x4c87('0x32')]('user:%s',_0x5fb196[_0x4c87('0x16')]),_0x4c87('0x33'),{'callNumber':_0x2f307a,'callerId':_0x2060f8,'callbackUrl':_0x30fdba});return _0x185590[_0x4c87('0x18')](0xc8)[_0x4c87('0x2d')]({'error':![],'message':_0x4c87('0x34')});})['catch'](handleError(_0x185590));};exports[_0x4c87('0x35')]=function(_0x11a632,_0xcc73b5){logger['info']('hangup\x20fired:',_0x11a632[_0x4c87('0x2c')]);var _0x2da03f=hangupValidation[_0x4c87('0x36')](_0x11a632['body']);if(_0x2da03f[_0x4c87('0x27')]>0x0){return _0xcc73b5['status'](0x190)['json'](_0x2da03f);}var _0x5bbd35=_0x11a632[_0x4c87('0x2c')][_0x4c87('0x2e')];var _0x2de50d=_0x11a632['body'][_0x4c87('0x26')];return getAgent(_0x5bbd35)[_0x4c87('0x1b')](function(_0x5de7b1){logger[_0x4c87('0x31')]('entityFound:',_0x5de7b1['name']);emit(util[_0x4c87('0x32')]('user:%s',_0x5de7b1[_0x4c87('0x16')]),_0x4c87('0x37'),{'sessionId':_0x2de50d});return _0xcc73b5['status'](0xc8)[_0x4c87('0x2d')]({'error':![],'message':_0x4c87('0x38')});})['catch'](handleError(_0xcc73b5));};exports[_0x4c87('0x39')]=function(_0x5a70b7,_0x521944){logger[_0x4c87('0x31')]('answer\x20fired:',_0x5a70b7['body']);var _0x35c74b=answerValidation[_0x4c87('0x36')](_0x5a70b7['body']);if(_0x35c74b[_0x4c87('0x27')]>0x0){return _0x521944[_0x4c87('0x18')](0x190)[_0x4c87('0x2d')](_0x35c74b);}var _0x45b950=_0x5a70b7['body'][_0x4c87('0x2e')];var _0x448208=_0x5a70b7[_0x4c87('0x2c')][_0x4c87('0x26')];return getAgent(_0x45b950)['then'](function(_0x33716e){logger[_0x4c87('0x31')](_0x4c87('0x3a'),_0x33716e['name']);emit(util[_0x4c87('0x32')](_0x4c87('0x3b'),_0x33716e[_0x4c87('0x16')]),_0x4c87('0x3c'),{'sessionId':_0x448208});return _0x521944['status'](0xc8)[_0x4c87('0x2d')]({'error':![],'message':_0x4c87('0x3d')});})[_0x4c87('0x1f')](handleError(_0x521944));};exports['hold']=function(_0x507686,_0x41cfe9){logger[_0x4c87('0x31')](_0x4c87('0x3e'),_0x507686[_0x4c87('0x2c')]);var _0x52bac1=holdValidation['validate'](_0x507686[_0x4c87('0x2c')]);if(_0x52bac1[_0x4c87('0x27')]>0x0){return _0x41cfe9[_0x4c87('0x18')](0x190)[_0x4c87('0x2d')](_0x52bac1);}var _0x2c7eef=_0x507686[_0x4c87('0x2c')][_0x4c87('0x2e')];var _0x290761=_0x507686[_0x4c87('0x2c')][_0x4c87('0x26')];return getAgent(_0x2c7eef)['then'](function(_0x20f4f2){logger[_0x4c87('0x31')](_0x4c87('0x3a'),_0x20f4f2[_0x4c87('0x16')]);emit(util['format'](_0x4c87('0x3b'),_0x20f4f2[_0x4c87('0x16')]),_0x4c87('0x3f'),{'sessionId':_0x290761});return _0x41cfe9['status'](0xc8)[_0x4c87('0x2d')]({'error':![],'message':_0x4c87('0x40')});})[_0x4c87('0x1f')](handleError(_0x41cfe9));};exports['unhold']=function(_0x31f23a,_0x1b5843){logger[_0x4c87('0x31')]('unhold\x20fired:',_0x31f23a['body']);var _0x578b39=unholdValidation['validate'](_0x31f23a['body']);if(_0x578b39[_0x4c87('0x27')]>0x0){return _0x1b5843[_0x4c87('0x18')](0x190)['json'](_0x578b39);}var _0x59545c=_0x31f23a[_0x4c87('0x2c')][_0x4c87('0x2e')];var _0x205419=_0x31f23a[_0x4c87('0x2c')][_0x4c87('0x26')];return getAgent(_0x59545c)[_0x4c87('0x1b')](function(_0x64642a){logger[_0x4c87('0x31')]('entityFound:',_0x64642a['name']);emit(util[_0x4c87('0x32')](_0x4c87('0x3b'),_0x64642a[_0x4c87('0x16')]),_0x4c87('0x41'),{'sessionId':_0x205419});return _0x1b5843[_0x4c87('0x18')](0xc8)[_0x4c87('0x2d')]({'error':![],'message':_0x4c87('0x42')});})[_0x4c87('0x1f')](handleError(_0x1b5843));};exports[_0x4c87('0x43')]=function(_0x2a4bf1,_0x4aa6e3){logger['info'](_0x4c87('0x44'),_0x4aa6e3['body']);var _0x3fae0d=callsValidation[_0x4c87('0x36')](_0x2a4bf1[_0x4c87('0x2c')]);if(_0x3fae0d['length']>0x0){return _0x4aa6e3[_0x4c87('0x18')](0x190)[_0x4c87('0x2d')](_0x3fae0d);}var _0x3d407a=_0x2a4bf1[_0x4c87('0x2c')][_0x4c87('0x2e')];var _0x67c32d=respondWithRpcPromise(_0x4c87('0x22'));var _0x4e552a=getAgent(_0x3d407a);return Promise['all']([_0x67c32d,_0x4e552a])[_0x4c87('0x1b')](function(_0x2fb4a){var _0x253e8b=_0x2fb4a[0x0];var _0x197c0d=_0x2fb4a[0x1];var _0x16be71=_[_0x4c87('0x23')](_0x253e8b[_0x4c87('0x24')],function(_0x1f7b9b){return _0x1f7b9b[_0x4c87('0x25')]==_0x197c0d['id'];});return _0x4aa6e3[_0x4c87('0x18')](0xc8)[_0x4c87('0x2d')]({'count':_0x16be71[_0x4c87('0x27')],'rows':_0x16be71});})[_0x4c87('0x1f')](handleError(_0x4aa6e3));};exports['conference']=function(_0x37b319,_0x24c52a){logger[_0x4c87('0x31')](_0x4c87('0x45'),_0x37b319[_0x4c87('0x2c')]);var _0x1d71e5=conferenceValidation[_0x4c87('0x36')](_0x37b319['body']);if(_0x1d71e5['length']>0x0){return _0x24c52a[_0x4c87('0x18')](0x190)['json'](_0x1d71e5);}var _0x53e6ba=_0x37b319['body'][_0x4c87('0x2e')];return getAgent(_0x53e6ba)[_0x4c87('0x1b')](function(_0x20c0b6){logger[_0x4c87('0x31')](_0x4c87('0x3a'),_0x20c0b6['name']);emit(util['format'](_0x4c87('0x3b'),_0x20c0b6['name']),'webbar:conference');return _0x24c52a['status'](0xc8)[_0x4c87('0x2d')]({'error':![],'message':_0x4c87('0x46')});})[_0x4c87('0x1f')](handleError(_0x24c52a));};exports[_0x4c87('0x47')]=function(_0x44a2c7,_0x4ed555){logger['info'](_0x4c87('0x48'),_0x44a2c7[_0x4c87('0x2c')]);var _0xdf24be=transferValidation[_0x4c87('0x36')](_0x44a2c7['body']);if(_0xdf24be['length']>0x0){return _0x4ed555[_0x4c87('0x18')](0x190)['json'](_0xdf24be);}var _0x30773f=_0x44a2c7[_0x4c87('0x2c')]['userId'];var _0x10b898=_0x44a2c7['body'][_0x4c87('0x26')];var _0x38dfad=_0x44a2c7[_0x4c87('0x2c')][_0x4c87('0x49')];return getAgent(_0x30773f)['then'](function(_0x44a493){logger[_0x4c87('0x31')](_0x4c87('0x3a'),_0x44a493[_0x4c87('0x16')]);emit(util[_0x4c87('0x32')](_0x4c87('0x3b'),_0x44a493['name']),'webbar:transfer',{'sessionId':_0x10b898,'transferNumber':_0x38dfad});return _0x4ed555[_0x4c87('0x18')](0xc8)[_0x4c87('0x2d')]({'error':![],'message':_0x4c87('0x4a')});})['catch'](handleError(_0x4ed555));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 5a20dda..3788aaf 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 _0x7516=['../../components/interaction/service','./whatsappAccount.controller','index','get','/describe','describe','/:id','isAuthenticated','show','/:id/dispositions','getAnswers','/:id/applications','getApplications','post','create','/:id/canned_answers','addAnswer','/:id/users','addAgents','addApplications','notify','/:id/send','send','update','delete','destroy','removeAnswers','removeAgents','util','path','connect-timeout','Router','fs-extra'];(function(_0x2fbfd2,_0x3bfa10){var _0x20ea78=function(_0x2a6ce6){while(--_0x2a6ce6){_0x2fbfd2['push'](_0x2fbfd2['shift']());}};_0x20ea78(++_0x3bfa10);}(_0x7516,0x7f));var _0x6751=function(_0x10f68e,_0xf198ea){_0x10f68e=_0x10f68e-0x0;var _0x4c8372=_0x7516[_0x10f68e];return _0x4c8372;};'use strict';var multer=require('multer');var util=require(_0x6751('0x0'));var path=require(_0x6751('0x1'));var timeout=require(_0x6751('0x2'));var express=require('express');var router=express[_0x6751('0x3')]();var fs_extra=require(_0x6751('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x6751('0x5'));var config=require('../../config/environment');var controller=require(_0x6751('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x6751('0x7')]);router[_0x6751('0x8')](_0x6751('0x9'),auth['isAuthenticated'](),controller[_0x6751('0xa')]);router['get'](_0x6751('0xb'),auth[_0x6751('0xc')](),controller[_0x6751('0xd')]);router[_0x6751('0x8')](_0x6751('0xe'),auth[_0x6751('0xc')](),controller['getDispositions']);router['get']('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x6751('0xf')]);router[_0x6751('0x8')]('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router[_0x6751('0x8')](_0x6751('0x10'),auth[_0x6751('0xc')](),controller[_0x6751('0x11')]);router[_0x6751('0x12')]('/',auth[_0x6751('0xc')](),controller[_0x6751('0x13')]);router['post']('/:id/dispositions',auth['isAuthenticated'](),controller['addDisposition']);router[_0x6751('0x12')](_0x6751('0x14'),auth[_0x6751('0xc')](),controller[_0x6751('0x15')]);router[_0x6751('0x12')](_0x6751('0x16'),auth['isAuthenticated'](),controller[_0x6751('0x17')]);router[_0x6751('0x12')]('/:id/applications',auth[_0x6751('0xc')](),controller[_0x6751('0x18')]);router[_0x6751('0x12')]('/:id/notify',controller[_0x6751('0x19')]);router['post'](_0x6751('0x1a'),auth['isAuthenticated'](),controller[_0x6751('0x1b')]);router['put'](_0x6751('0xb'),auth[_0x6751('0xc')](),controller[_0x6751('0x1c')]);router[_0x6751('0x1d')]('/:id',auth[_0x6751('0xc')](),controller[_0x6751('0x1e')]);router['delete'](_0x6751('0xe'),auth[_0x6751('0xc')](),controller['removeDispositions']);router[_0x6751('0x1d')](_0x6751('0x14'),auth[_0x6751('0xc')](),controller[_0x6751('0x1f')]);router[_0x6751('0x1d')]('/:id/users',auth[_0x6751('0xc')](),controller[_0x6751('0x20')]);module['exports']=router; \ No newline at end of file +var _0x6d4a=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/describe','isAuthenticated','describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','post','create','/:id/dispositions','addDisposition','addAnswer','/:id/notify','/:id/send','send','update','delete','destroy','removeAnswers','exports','path','connect-timeout','express','Router'];(function(_0x26d386,_0x1660c0){var _0x4ef9a8=function(_0x55e2d3){while(--_0x55e2d3){_0x26d386['push'](_0x26d386['shift']());}};_0x4ef9a8(++_0x1660c0);}(_0x6d4a,0x194));var _0xa6d4=function(_0x502116,_0x2c0606){_0x502116=_0x502116-0x0;var _0x53c1c9=_0x6d4a[_0x502116];return _0x53c1c9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xa6d4('0x0'));var timeout=require(_0xa6d4('0x1'));var express=require(_0xa6d4('0x2'));var router=express[_0xa6d4('0x3')]();var fs_extra=require(_0xa6d4('0x4'));var auth=require(_0xa6d4('0x5'));var interaction=require(_0xa6d4('0x6'));var config=require(_0xa6d4('0x7'));var controller=require('./whatsappAccount.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xa6d4('0x8')]);router[_0xa6d4('0x9')](_0xa6d4('0xa'),auth[_0xa6d4('0xb')](),controller[_0xa6d4('0xc')]);router[_0xa6d4('0x9')](_0xa6d4('0xd'),auth[_0xa6d4('0xb')](),controller[_0xa6d4('0xe')]);router[_0xa6d4('0x9')]('/:id/dispositions',auth[_0xa6d4('0xb')](),controller[_0xa6d4('0xf')]);router[_0xa6d4('0x9')](_0xa6d4('0x10'),auth['isAuthenticated'](),controller[_0xa6d4('0x11')]);router[_0xa6d4('0x9')](_0xa6d4('0x12'),auth[_0xa6d4('0xb')](),controller[_0xa6d4('0x13')]);router[_0xa6d4('0x9')](_0xa6d4('0x14'),auth['isAuthenticated'](),controller['getApplications']);router[_0xa6d4('0x15')]('/',auth[_0xa6d4('0xb')](),controller[_0xa6d4('0x16')]);router[_0xa6d4('0x15')](_0xa6d4('0x17'),auth[_0xa6d4('0xb')](),controller[_0xa6d4('0x18')]);router['post'](_0xa6d4('0x10'),auth[_0xa6d4('0xb')](),controller[_0xa6d4('0x19')]);router[_0xa6d4('0x15')](_0xa6d4('0x12'),auth[_0xa6d4('0xb')](),controller['addAgents']);router[_0xa6d4('0x15')](_0xa6d4('0x14'),auth[_0xa6d4('0xb')](),controller['addApplications']);router[_0xa6d4('0x15')](_0xa6d4('0x1a'),controller['notify']);router[_0xa6d4('0x15')](_0xa6d4('0x1b'),auth[_0xa6d4('0xb')](),controller[_0xa6d4('0x1c')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xa6d4('0x1d')]);router[_0xa6d4('0x1e')](_0xa6d4('0xd'),auth[_0xa6d4('0xb')](),controller[_0xa6d4('0x1f')]);router[_0xa6d4('0x1e')]('/:id/dispositions',auth['isAuthenticated'](),controller['removeDispositions']);router[_0xa6d4('0x1e')](_0xa6d4('0x10'),auth[_0xa6d4('0xb')](),controller[_0xa6d4('0x20')]);router[_0xa6d4('0x1e')]('/:id/users',auth[_0xa6d4('0xb')](),controller['removeAgents']);module[_0xa6d4('0x21')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 89b9f98..d63be82 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 _0xd32d=['name','STRING','ENUM','twilio','sinch','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports'];(function(_0x1624a2,_0x3386dd){var _0x588569=function(_0x3a6259){while(--_0x3a6259){_0x1624a2['push'](_0x1624a2['shift']());}};_0x588569(++_0x3386dd);}(_0xd32d,0x15b));var _0xdd32=function(_0x103d27,_0xa1b546){_0x103d27=_0x103d27-0x0;var _0x994f6d=_0xd32d[_0x103d27];return _0x994f6d;};'use strict';var Sequelize=require(_0xdd32('0x0'));var rs=require(_0xdd32('0x1'));module[_0xdd32('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0xdd32('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0xdd32('0x4')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0xdd32('0x4')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0xdd32('0x4')]},'type':{'type':Sequelize[_0xdd32('0x5')](_0xdd32('0x6'),_0xdd32('0x7'))},'accountSid':{'type':Sequelize[_0xdd32('0x4')]},'baseUrl':{'type':Sequelize[_0xdd32('0x4')]},'authToken':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize['TEXT'],'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[_0xdd32('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xdd32('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xdd32('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xdd32('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xdd32('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xdd32('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xdd32('0x9')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xdd32('0x8')],'defaultValue':![],'comment':_0xdd32('0xa'),'set':function(_0x27102b){if(!_0x27102b){this[_0xdd32('0xb')](_0xdd32('0xc'),null);}this[_0xdd32('0xb')](_0xdd32('0xd'),_0x27102b);}},'description':{'type':Sequelize[_0xdd32('0x4')]}}; \ No newline at end of file +var _0x1d4e=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','randomstring','exports','STRING','name','generate','ENUM','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x269502,_0x687ff0){var _0x2ac7f9=function(_0xba928a){while(--_0xba928a){_0x269502['push'](_0x269502['shift']());}};_0x2ac7f9(++_0x687ff0);}(_0x1d4e,0x137));var _0xe1d4=function(_0x551dbe,_0x5a352e){_0x551dbe=_0x551dbe-0x0;var _0x33e2b0=_0x1d4e[_0x551dbe];return _0x33e2b0;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xe1d4('0x0'));module[_0xe1d4('0x1')]={'name':{'type':Sequelize[_0xe1d4('0x2')],'unique':_0xe1d4('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0xe1d4('0x2')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0xe1d4('0x2')],'defaultValue':function(){return rs[_0xe1d4('0x4')]();}},'phone':{'type':Sequelize[_0xe1d4('0x2')]},'type':{'type':Sequelize[_0xe1d4('0x5')]('twilio','sinch')},'accountSid':{'type':Sequelize[_0xe1d4('0x2')]},'baseUrl':{'type':Sequelize[_0xe1d4('0x2')]},'authToken':{'type':Sequelize[_0xe1d4('0x2')]},'notificationTemplate':{'type':Sequelize[_0xe1d4('0x6')],'defaultValue':function(){return _0xe1d4('0x7');}},'notificationSound':{'type':Sequelize[_0xe1d4('0x8')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xe1d4('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xe1d4('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xe1d4('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xe1d4('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xe1d4('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xe1d4('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xe1d4('0xa')},'mandatoryDisposition':{'type':Sequelize[_0xe1d4('0x8')],'defaultValue':![],'comment':_0xe1d4('0xb'),'set':function(_0x3c0ca9){if(!_0x3c0ca9){this[_0xe1d4('0xc')](_0xe1d4('0xd'),null);}this[_0xe1d4('0xc')]('mandatoryDisposition',_0x3c0ca9);}},'description':{'type':Sequelize[_0xe1d4('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index d73a2a2..241b649 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 _0xa7b1=['rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','client','http','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','update','destroy','get','WhatsappAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','WhatsappAccount','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','show','params','keys','rawAttributes','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','WhatsappAccountId','Disposition','findOne','pick','options','rows','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','addAgents','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','length','addApplications','sequelize','transaction','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','getApplications','notify','whatsapp','Applications','account','sinch','statuses','state','read','timestamp','applications','asc','CmContact','Sequelize','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId','mobile','from','replace','whatsapp:','Body','messageId','MessageSid','notifications','message_id','isNil','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','list','omit','Contacts','defaults','WhatsappInteraction','interaction','push','close','unmanaged','*,*,*,*','WhatsappMessage','ContactId','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','queueId','WhatsappQueue','waitForTheAssignedQueue','Start','startRouting','receiveMessage','WhatsappAccount,\x20%s,\x20%s,\x20%s','entity\x20found','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','to\x20is\x20mandatory','List','out','Messages','dataValues'];(function(_0x2c86a9,_0x79f182){var _0x5909d6=function(_0x5bf7c8){while(--_0x5bf7c8){_0x2c86a9['push'](_0x2c86a9['shift']());}};_0x5909d6(++_0x79f182);}(_0xa7b1,0x194));var _0x1a7b=function(_0x21440c,_0x3b12d6){_0x21440c=_0x21440c-0x0;var _0x18b528=_0xa7b1[_0x21440c];return _0x18b528;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1a7b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1a7b('0x1'));var rp=require(_0x1a7b('0x2'));var moment=require(_0x1a7b('0x3'));var BPromise=require(_0x1a7b('0x4'));var Mustache=require(_0x1a7b('0x5'));var util=require(_0x1a7b('0x6'));var path=require(_0x1a7b('0x7'));var sox=require(_0x1a7b('0x8'));var csv=require(_0x1a7b('0x9'));var ejs=require(_0x1a7b('0xa'));var fs=require('fs');var fs_extra=require(_0x1a7b('0xb'));var _=require(_0x1a7b('0xc'));var squel=require(_0x1a7b('0xd'));var crypto=require(_0x1a7b('0xe'));var jsforce=require(_0x1a7b('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x1a7b('0x9'));var querystring=require('querystring');var Papa=require(_0x1a7b('0x10'));var Redis=require('ioredis');var authService=require(_0x1a7b('0x11'));var qs=require(_0x1a7b('0x12'));var as=require(_0x1a7b('0x13'));var hardwareService=require(_0x1a7b('0x14'));var logger=require(_0x1a7b('0x15'))(_0x1a7b('0x16'));var utils=require(_0x1a7b('0x17'));var config=require(_0x1a7b('0x18'));var licenseUtil=require(_0x1a7b('0x19'));var db=require(_0x1a7b('0x1a'))['db'];config[_0x1a7b('0x1b')]=_['defaults'](config['redis'],{'host':_0x1a7b('0x1c'),'port':0x18eb});var socket=require(_0x1a7b('0x1d'))(new Redis(config[_0x1a7b('0x1b')]));require(_0x1a7b('0x1e'))[_0x1a7b('0x1f')](socket);var jayson=require(_0x1a7b('0x20'));var client=jayson[_0x1a7b('0x21')][_0x1a7b('0x22')]({'port':0x232c});function respondWithRpcPromise(_0x4a5671,_0x19f1bc,_0x3d2cd7,_0x10b80a){return new BPromise(function(_0x4ede92,_0xb00d97){var _0x5b3383=_0x10b80a||client;return _0x5b3383['request'](_0x4a5671,_0x3d2cd7)[_0x1a7b('0x23')](function(_0x4d7723){logger[_0x1a7b('0x24')](_0x1a7b('0x25'),_0x19f1bc,_0x1a7b('0x26'));logger['debug']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x19f1bc,_0x1a7b('0x26'),JSON[_0x1a7b('0x27')](_0x4d7723));if(_0x4d7723[_0x1a7b('0x28')]){if(_0x4d7723[_0x1a7b('0x28')][_0x1a7b('0x29')]===0x1f4){logger[_0x1a7b('0x28')](_0x1a7b('0x25'),_0x19f1bc,_0x4d7723[_0x1a7b('0x28')][_0x1a7b('0x2a')]);return _0xb00d97(_0x4d7723['error'][_0x1a7b('0x2a')]);}logger[_0x1a7b('0x28')](_0x1a7b('0x25'),_0x19f1bc,_0x4d7723[_0x1a7b('0x28')]['message']);return _0x4ede92(_0x4d7723[_0x1a7b('0x28')][_0x1a7b('0x2a')]);}else{logger[_0x1a7b('0x24')]('WhatsappAccount,\x20%s,\x20%s',_0x19f1bc,'request\x20sent');_0x4ede92(_0x4d7723[_0x1a7b('0x2b')][_0x1a7b('0x2a')]);}})['catch'](function(_0x324aa6){logger['error'](_0x1a7b('0x25'),_0x19f1bc,_0x324aa6);_0xb00d97(_0x324aa6);});});}function respondWithStatusCode(_0x38f2b0,_0x1938c9){_0x1938c9=_0x1938c9||0xcc;return function(_0x3235ef){if(_0x3235ef){return _0x38f2b0['sendStatus'](_0x1938c9);}return _0x38f2b0[_0x1a7b('0x2c')](_0x1938c9)[_0x1a7b('0x2d')]();};}function respondWithResult(_0x5580a5,_0x5c4470){_0x5c4470=_0x5c4470||0xc8;return function(_0x97c542){if(_0x97c542){return _0x5580a5[_0x1a7b('0x2c')](_0x5c4470)['json'](_0x97c542);}};}function respondWithFilteredResult(_0x160a15,_0x49df55){return function(_0x4fab3a){if(_0x4fab3a){var _0x24cfb4=typeof _0x49df55[_0x1a7b('0x2e')]===_0x1a7b('0x2f')&&typeof _0x49df55[_0x1a7b('0x30')]===_0x1a7b('0x2f');var _0x17f643=_0x4fab3a['count'];var _0x997581=_0x24cfb4?0x0:_0x49df55[_0x1a7b('0x2e')];var _0xc477a6=_0x24cfb4?_0x4fab3a[_0x1a7b('0x31')]:_0x49df55[_0x1a7b('0x2e')]+_0x49df55[_0x1a7b('0x30')];var _0x3e8c93;if(_0xc477a6>=_0x17f643){_0xc477a6=_0x17f643;_0x3e8c93=0xc8;}else{_0x3e8c93=0xce;}_0x160a15[_0x1a7b('0x2c')](_0x3e8c93);return _0x160a15[_0x1a7b('0x32')](_0x1a7b('0x33'),_0x997581+'-'+_0xc477a6+'/'+_0x17f643)[_0x1a7b('0x34')](_0x4fab3a);}return null;};}function patchUpdates(_0x564798){return function(_0x91f59c){try{jsonpatch[_0x1a7b('0x35')](_0x91f59c,_0x564798,!![]);}catch(_0x96d446){return BPromise['reject'](_0x96d446);}return _0x91f59c['save']();};}function saveUpdates(_0x2b1954,_0xe88ac5){return function(_0x4fe066){if(_0x4fe066){return _0x4fe066[_0x1a7b('0x36')](_0x2b1954)['then'](function(_0x2ac9fe){return _0x2ac9fe;});}return null;};}function removeEntity(_0x2c1adb,_0x4a57f4){return function(_0x46b719){if(_0x46b719){return _0x46b719[_0x1a7b('0x37')]()['then'](function(){var _0x43486e=_0x46b719[_0x1a7b('0x38')]({'plain':!![]});var _0x54d513=_0x1a7b('0x39');return db[_0x1a7b('0x3a')][_0x1a7b('0x37')]({'where':{'type':_0x54d513,'resourceId':_0x43486e['id']}})['then'](function(){return _0x46b719;});})[_0x1a7b('0x23')](function(){_0x2c1adb[_0x1a7b('0x2c')](0xcc)[_0x1a7b('0x2d')]();});}};}function handleEntityNotFound(_0x2cd1cc,_0x5690c3){return function(_0x312403){if(!_0x312403){_0x2cd1cc['sendStatus'](0x194);}return _0x312403;};}function handleError(_0x5c06e4,_0x38d085){_0x38d085=_0x38d085||0x1f4;return function(_0xe6973d){logger[_0x1a7b('0x28')](_0xe6973d[_0x1a7b('0x3b')]);if(_0xe6973d['name']){delete _0xe6973d[_0x1a7b('0x3c')];}_0x5c06e4[_0x1a7b('0x2c')](_0x38d085)[_0x1a7b('0x3d')](_0xe6973d);};}exports[_0x1a7b('0x3e')]=function(_0x127517,_0x129c66){var _0x13519d={'include':[{'model':db[_0x1a7b('0x3f')],'as':_0x1a7b('0x40')}]},_0x350595={},_0x2322d2={'count':0x0,'rows':[]};var _0x5ca86d=_['map'](db[_0x1a7b('0x41')]['rawAttributes'],function(_0x4ea226){return{'name':_0x4ea226[_0x1a7b('0x42')],'type':_0x4ea226[_0x1a7b('0x43')][_0x1a7b('0x44')]};});_0x350595[_0x1a7b('0x45')]=_[_0x1a7b('0x46')](_0x5ca86d,_0x1a7b('0x3c'));_0x350595[_0x1a7b('0x47')]=_['keys'](_0x127517[_0x1a7b('0x47')]);_0x350595[_0x1a7b('0x48')]=_[_0x1a7b('0x49')](_0x350595['model'],_0x350595[_0x1a7b('0x47')]);_0x13519d['attributes']=_['intersection'](_0x350595[_0x1a7b('0x45')],qs[_0x1a7b('0x4a')](_0x127517[_0x1a7b('0x47')]['fields']));_0x13519d['attributes']=_0x13519d[_0x1a7b('0x4b')]['length']?_0x13519d[_0x1a7b('0x4b')]:_0x350595[_0x1a7b('0x45')];if(!_0x127517[_0x1a7b('0x47')][_0x1a7b('0x4c')](_0x1a7b('0x4d'))){_0x13519d[_0x1a7b('0x30')]=qs[_0x1a7b('0x30')](_0x127517['query'][_0x1a7b('0x30')]);_0x13519d[_0x1a7b('0x2e')]=qs[_0x1a7b('0x2e')](_0x127517[_0x1a7b('0x47')][_0x1a7b('0x2e')]);}_0x13519d[_0x1a7b('0x4e')]=qs[_0x1a7b('0x4f')](_0x127517[_0x1a7b('0x47')][_0x1a7b('0x4f')]);_0x13519d[_0x1a7b('0x50')]=qs[_0x1a7b('0x48')](_['pick'](_0x127517[_0x1a7b('0x47')],_0x350595['filters']),_0x5ca86d);if(_0x127517[_0x1a7b('0x47')][_0x1a7b('0x51')]){_0x13519d[_0x1a7b('0x50')]=_[_0x1a7b('0x52')](_0x13519d[_0x1a7b('0x50')],{'$or':_[_0x1a7b('0x46')](_0x5ca86d,function(_0x5825bd){if(_0x5825bd[_0x1a7b('0x43')]!==_0x1a7b('0x53')){var _0x395c55={};_0x395c55[_0x5825bd['name']]={'$like':'%'+_0x127517[_0x1a7b('0x47')][_0x1a7b('0x51')]+'%'};return _0x395c55;}})});}_0x13519d=_[_0x1a7b('0x52')]({},_0x13519d,_0x127517['options']);var _0xcb46d5={'where':_0x13519d['where']};return db['WhatsappAccount']['count'](_0xcb46d5)['then'](function(_0x183476){_0x2322d2[_0x1a7b('0x31')]=_0x183476;if(_0x127517[_0x1a7b('0x47')][_0x1a7b('0x54')]){_0x13519d[_0x1a7b('0x55')]=[{'all':!![]}];}return db[_0x1a7b('0x41')][_0x1a7b('0x56')](_0x13519d);})[_0x1a7b('0x23')](function(_0x3b13c8){_0x2322d2['rows']=_0x3b13c8;return _0x2322d2;})[_0x1a7b('0x23')](respondWithFilteredResult(_0x129c66,_0x13519d))['catch'](handleError(_0x129c66,null));};exports[_0x1a7b('0x57')]=function(_0x4f07dc,_0x4a0109){var _0x21942e={'raw':![],'where':{'id':_0x4f07dc[_0x1a7b('0x58')]['id']},'include':[{'model':db[_0x1a7b('0x3f')],'as':'mandatoryDispositionPause'}]},_0x501273={};_0x501273[_0x1a7b('0x45')]=_[_0x1a7b('0x59')](db['WhatsappAccount'][_0x1a7b('0x5a')]);_0x501273[_0x1a7b('0x47')]=_[_0x1a7b('0x59')](_0x4f07dc[_0x1a7b('0x47')]);_0x501273[_0x1a7b('0x48')]=_[_0x1a7b('0x49')](_0x501273[_0x1a7b('0x45')],_0x501273['query']);_0x21942e['attributes']=_[_0x1a7b('0x49')](_0x501273[_0x1a7b('0x45')],qs[_0x1a7b('0x4a')](_0x4f07dc['query'][_0x1a7b('0x4a')]));_0x21942e[_0x1a7b('0x4b')]=_0x21942e['attributes']['length']?_0x21942e[_0x1a7b('0x4b')]:_0x501273['model'];if(_0x4f07dc[_0x1a7b('0x47')][_0x1a7b('0x54')]){_0x21942e[_0x1a7b('0x55')]=[{'all':!![]}];}_0x21942e=_[_0x1a7b('0x52')]({},_0x21942e,_0x4f07dc['options']);return db[_0x1a7b('0x41')]['find'](_0x21942e)[_0x1a7b('0x23')](handleEntityNotFound(_0x4a0109,null))[_0x1a7b('0x23')](respondWithResult(_0x4a0109,null))['catch'](handleError(_0x4a0109,null));};exports[_0x1a7b('0x5b')]=function(_0x5ab4ca,_0x5c11a3){return db[_0x1a7b('0x41')][_0x1a7b('0x5b')](_0x5ab4ca[_0x1a7b('0x5c')],{})[_0x1a7b('0x23')](function(_0x98b8a6){var _0x334965=_0x5ab4ca['user'][_0x1a7b('0x38')]({'plain':!![]});if(!_0x334965)throw new Error(_0x1a7b('0x5d'));if(_0x334965[_0x1a7b('0x5e')]===_0x1a7b('0x5f')){var _0xdcba60=_0x98b8a6[_0x1a7b('0x38')]({'plain':!![]});var _0x249c04=_0x1a7b('0x39');return db[_0x1a7b('0x60')][_0x1a7b('0x61')]({'where':{'name':_0x249c04,'userProfileId':_0x334965['userProfileId']},'raw':!![]})[_0x1a7b('0x23')](function(_0x902175){if(_0x902175&&_0x902175[_0x1a7b('0x62')]===0x0){return db[_0x1a7b('0x3a')][_0x1a7b('0x5b')]({'name':_0xdcba60[_0x1a7b('0x3c')],'resourceId':_0xdcba60['id'],'type':_0x902175[_0x1a7b('0x3c')],'sectionId':_0x902175['id']},{})[_0x1a7b('0x23')](function(){return _0x98b8a6;});}else{return _0x98b8a6;}})[_0x1a7b('0x63')](function(_0x132b67){logger[_0x1a7b('0x28')](_0x1a7b('0x64'),_0x132b67);throw _0x132b67;});}return _0x98b8a6;})['then'](respondWithResult(_0x5c11a3,0xc9))['catch'](handleError(_0x5c11a3,null));};exports[_0x1a7b('0x36')]=function(_0x201df3,_0x54161f){if(_0x201df3['body']['id']){delete _0x201df3[_0x1a7b('0x5c')]['id'];}return db['WhatsappAccount'][_0x1a7b('0x61')]({'where':{'id':_0x201df3[_0x1a7b('0x58')]['id']},'include':[{'model':db[_0x1a7b('0x3f')],'as':_0x1a7b('0x40')}]})[_0x1a7b('0x23')](handleEntityNotFound(_0x54161f,null))[_0x1a7b('0x23')](saveUpdates(_0x201df3[_0x1a7b('0x5c')],null))[_0x1a7b('0x23')](respondWithResult(_0x54161f,null))[_0x1a7b('0x63')](handleError(_0x54161f,null));};exports[_0x1a7b('0x37')]=function(_0x765e37,_0x552fbd){return db[_0x1a7b('0x41')][_0x1a7b('0x61')]({'where':{'id':_0x765e37[_0x1a7b('0x58')]['id']}})[_0x1a7b('0x23')](handleEntityNotFound(_0x552fbd,null))[_0x1a7b('0x23')](removeEntity(_0x552fbd,null))[_0x1a7b('0x63')](handleError(_0x552fbd,null));};exports[_0x1a7b('0x65')]=function(_0x447db8,_0x44df67){return db[_0x1a7b('0x41')][_0x1a7b('0x65')]()[_0x1a7b('0x23')](respondWithResult(_0x44df67,null))[_0x1a7b('0x63')](handleError(_0x44df67,null));};exports[_0x1a7b('0x66')]=function(_0x26cd8d,_0x4e68df,_0x364ae3){if(_0x26cd8d['body']['id']){delete _0x26cd8d['body']['id'];}return db[_0x1a7b('0x41')][_0x1a7b('0x61')]({'where':{'id':_0x26cd8d[_0x1a7b('0x58')]['id']}})['then'](handleEntityNotFound(_0x4e68df,null))[_0x1a7b('0x23')](function(_0x17c5ff){if(_0x17c5ff){_0x26cd8d[_0x1a7b('0x5c')][_0x1a7b('0x67')]=_0x17c5ff['id'];return db[_0x1a7b('0x68')][_0x1a7b('0x5b')](_0x26cd8d[_0x1a7b('0x5c')]);}})[_0x1a7b('0x23')](respondWithResult(_0x4e68df,null))['catch'](handleError(_0x4e68df,null));};exports['getDispositions']=function(_0x1af4e1,_0x2c9150,_0x1f4e65){var _0x4aeb1e={'raw':![],'where':{}};var _0x1065b5={};var _0x1e4c40={'count':0x0,'rows':[]};return db[_0x1a7b('0x41')][_0x1a7b('0x69')]({'where':{'id':_0x1af4e1[_0x1a7b('0x58')]['id']}})[_0x1a7b('0x23')](handleEntityNotFound(_0x2c9150,null))[_0x1a7b('0x23')](function(_0x3abcdd){if(_0x3abcdd){_0x1065b5[_0x1a7b('0x45')]=_[_0x1a7b('0x59')](db[_0x1a7b('0x68')][_0x1a7b('0x5a')]);_0x1065b5[_0x1a7b('0x47')]=_[_0x1a7b('0x59')](_0x1af4e1[_0x1a7b('0x47')]);_0x1065b5['filters']=_['intersection'](_0x1065b5['model'],_0x1065b5['query']);_0x4aeb1e[_0x1a7b('0x4b')]=_['intersection'](_0x1065b5[_0x1a7b('0x45')],qs[_0x1a7b('0x4a')](_0x1af4e1[_0x1a7b('0x47')][_0x1a7b('0x4a')]));_0x4aeb1e[_0x1a7b('0x4b')]=_0x4aeb1e[_0x1a7b('0x4b')]['length']?_0x4aeb1e[_0x1a7b('0x4b')]:_0x1065b5[_0x1a7b('0x45')];if(!_0x1af4e1[_0x1a7b('0x47')]['hasOwnProperty'](_0x1a7b('0x4d'))){_0x4aeb1e['limit']=qs['limit'](_0x1af4e1[_0x1a7b('0x47')][_0x1a7b('0x30')]);_0x4aeb1e[_0x1a7b('0x2e')]=qs[_0x1a7b('0x2e')](_0x1af4e1[_0x1a7b('0x47')][_0x1a7b('0x2e')]);}_0x4aeb1e[_0x1a7b('0x4e')]=qs['sort'](_0x1af4e1[_0x1a7b('0x47')][_0x1a7b('0x4f')]);_0x4aeb1e[_0x1a7b('0x50')]=qs[_0x1a7b('0x48')](_[_0x1a7b('0x6a')](_0x1af4e1[_0x1a7b('0x47')],_0x1065b5[_0x1a7b('0x48')]));_0x4aeb1e[_0x1a7b('0x50')][_0x1a7b('0x67')]=_0x3abcdd['id'];if(_0x1af4e1[_0x1a7b('0x47')][_0x1a7b('0x51')]){_0x4aeb1e[_0x1a7b('0x50')]=_[_0x1a7b('0x52')](_0x4aeb1e['where'],{'$or':_[_0x1a7b('0x46')](_0x4aeb1e[_0x1a7b('0x4b')],function(_0x5ca890){var _0x397657={};_0x397657[_0x5ca890]={'$like':'%'+_0x1af4e1[_0x1a7b('0x47')]['filter']+'%'};return _0x397657;})});}_0x4aeb1e=_[_0x1a7b('0x52')]({},_0x4aeb1e,_0x1af4e1[_0x1a7b('0x6b')]);return db[_0x1a7b('0x68')]['count']({'where':_0x4aeb1e[_0x1a7b('0x50')]})[_0x1a7b('0x23')](function(_0x3d6cd8){_0x1e4c40['count']=_0x3d6cd8;if(_0x1af4e1[_0x1a7b('0x47')][_0x1a7b('0x54')]){_0x4aeb1e[_0x1a7b('0x55')]=[{'all':!![]}];}return db[_0x1a7b('0x68')][_0x1a7b('0x56')](_0x4aeb1e);})[_0x1a7b('0x23')](function(_0x9c99bf){_0x1e4c40[_0x1a7b('0x6c')]=_0x9c99bf;return _0x1e4c40;});}})['then'](respondWithFilteredResult(_0x2c9150,_0x4aeb1e))[_0x1a7b('0x63')](handleError(_0x2c9150,null));};exports['removeDispositions']=function(_0x4b641c,_0x373384,_0x10730b){return db[_0x1a7b('0x41')]['find']({'where':{'id':_0x4b641c[_0x1a7b('0x58')]['id']}})[_0x1a7b('0x23')](handleEntityNotFound(_0x373384,null))['then'](function(_0x488331){if(_0x488331){return _0x488331[_0x1a7b('0x6d')](_0x4b641c[_0x1a7b('0x47')][_0x1a7b('0x6e')]);}})['then'](respondWithStatusCode(_0x373384,null))[_0x1a7b('0x63')](handleError(_0x373384,null));};exports[_0x1a7b('0x6f')]=function(_0x348b44,_0x3415f8,_0x2387cb){if(_0x348b44[_0x1a7b('0x5c')]['id']){delete _0x348b44['body']['id'];}return db[_0x1a7b('0x41')]['find']({'where':{'id':_0x348b44[_0x1a7b('0x58')]['id']}})['then'](handleEntityNotFound(_0x3415f8,null))['then'](function(_0xc8c705){if(_0xc8c705){_0x348b44[_0x1a7b('0x5c')]['WhatsappAccountId']=_0xc8c705['id'];return db[_0x1a7b('0x70')][_0x1a7b('0x5b')](_0x348b44[_0x1a7b('0x5c')]);}})[_0x1a7b('0x23')](respondWithResult(_0x3415f8,null))['catch'](handleError(_0x3415f8,null));};exports['getAnswers']=function(_0x2940cd,_0x462690,_0x5da3d4){var _0x59141c={'raw':![],'where':{}};var _0x1362c0={};var _0x109afb={'count':0x0,'rows':[]};return db[_0x1a7b('0x41')][_0x1a7b('0x69')]({'where':{'id':_0x2940cd[_0x1a7b('0x58')]['id']}})[_0x1a7b('0x23')](handleEntityNotFound(_0x462690,null))[_0x1a7b('0x23')](function(_0x5cc73e){if(_0x5cc73e){_0x1362c0['model']=_['keys'](db[_0x1a7b('0x70')][_0x1a7b('0x5a')]);_0x1362c0[_0x1a7b('0x47')]=_[_0x1a7b('0x59')](_0x2940cd[_0x1a7b('0x47')]);_0x1362c0[_0x1a7b('0x48')]=_[_0x1a7b('0x49')](_0x1362c0[_0x1a7b('0x45')],_0x1362c0['query']);_0x59141c[_0x1a7b('0x4b')]=_[_0x1a7b('0x49')](_0x1362c0['model'],qs[_0x1a7b('0x4a')](_0x2940cd[_0x1a7b('0x47')]['fields']));_0x59141c[_0x1a7b('0x4b')]=_0x59141c[_0x1a7b('0x4b')]['length']?_0x59141c[_0x1a7b('0x4b')]:_0x1362c0[_0x1a7b('0x45')];if(!_0x2940cd[_0x1a7b('0x47')][_0x1a7b('0x4c')](_0x1a7b('0x4d'))){_0x59141c[_0x1a7b('0x30')]=qs[_0x1a7b('0x30')](_0x2940cd[_0x1a7b('0x47')][_0x1a7b('0x30')]);_0x59141c[_0x1a7b('0x2e')]=qs[_0x1a7b('0x2e')](_0x2940cd[_0x1a7b('0x47')][_0x1a7b('0x2e')]);}_0x59141c[_0x1a7b('0x4e')]=qs[_0x1a7b('0x4f')](_0x2940cd[_0x1a7b('0x47')][_0x1a7b('0x4f')]);_0x59141c[_0x1a7b('0x50')]=qs[_0x1a7b('0x48')](_[_0x1a7b('0x6a')](_0x2940cd[_0x1a7b('0x47')],_0x1362c0[_0x1a7b('0x48')]));_0x59141c[_0x1a7b('0x50')][_0x1a7b('0x67')]=_0x5cc73e['id'];if(_0x2940cd[_0x1a7b('0x47')][_0x1a7b('0x51')]){_0x59141c[_0x1a7b('0x50')]=_[_0x1a7b('0x52')](_0x59141c[_0x1a7b('0x50')],{'$or':_[_0x1a7b('0x46')](_0x59141c['attributes'],function(_0x4112eb){var _0x3a6f00={};_0x3a6f00[_0x4112eb]={'$like':'%'+_0x2940cd[_0x1a7b('0x47')]['filter']+'%'};return _0x3a6f00;})});}_0x59141c=_[_0x1a7b('0x52')]({},_0x59141c,_0x2940cd[_0x1a7b('0x6b')]);return db[_0x1a7b('0x70')][_0x1a7b('0x31')]({'where':_0x59141c['where']})[_0x1a7b('0x23')](function(_0x5490e4){_0x109afb[_0x1a7b('0x31')]=_0x5490e4;if(_0x2940cd[_0x1a7b('0x47')]['includeAll']){_0x59141c[_0x1a7b('0x55')]=[{'all':!![]}];}return db[_0x1a7b('0x70')][_0x1a7b('0x56')](_0x59141c);})[_0x1a7b('0x23')](function(_0x497354){_0x109afb[_0x1a7b('0x6c')]=_0x497354;return _0x109afb;});}})[_0x1a7b('0x23')](respondWithFilteredResult(_0x462690,_0x59141c))[_0x1a7b('0x63')](handleError(_0x462690,null));};exports[_0x1a7b('0x71')]=function(_0x448e99,_0xf3e68c,_0x39efc8){return db[_0x1a7b('0x41')]['find']({'where':{'id':_0x448e99[_0x1a7b('0x58')]['id']}})[_0x1a7b('0x23')](handleEntityNotFound(_0xf3e68c,null))[_0x1a7b('0x23')](function(_0x1e3491){if(_0x1e3491){return _0x1e3491[_0x1a7b('0x71')](_0x448e99[_0x1a7b('0x47')][_0x1a7b('0x6e')]);}})[_0x1a7b('0x23')](respondWithStatusCode(_0xf3e68c,null))[_0x1a7b('0x63')](handleError(_0xf3e68c,null));};exports[_0x1a7b('0x72')]=function(_0x384f36,_0x4fb22d,_0x3441c3){return db['WhatsappAccount'][_0x1a7b('0x61')]({'where':{'id':_0x384f36[_0x1a7b('0x58')]['id']}})['then'](handleEntityNotFound(_0x4fb22d,null))[_0x1a7b('0x23')](function(_0x406e8a){if(_0x406e8a){return _0x406e8a[_0x1a7b('0x72')](_0x384f36['body'][_0x1a7b('0x6e')],_['omit'](_0x384f36[_0x1a7b('0x5c')],[_0x1a7b('0x6e'),'id'])||{})[_0x1a7b('0x73')](function(_0x5469d5){for(var _0x22216c=0x0;_0x22216c<_0x384f36[_0x1a7b('0x5c')][_0x1a7b('0x6e')]['length'];_0x22216c+=0x1){socket[_0x1a7b('0x74')](_0x1a7b('0x75'),{'UserId':Number(_0x384f36[_0x1a7b('0x5c')]['ids'][_0x22216c]),'WhatsappAccountId':Number(_0x384f36[_0x1a7b('0x58')]['id'])});}return _0x5469d5;});}})[_0x1a7b('0x23')](respondWithResult(_0x4fb22d,null))[_0x1a7b('0x63')](handleError(_0x4fb22d,null));};exports[_0x1a7b('0x76')]=function(_0x4d6055,_0x1f16ef,_0x5bd86d){return db[_0x1a7b('0x41')][_0x1a7b('0x61')]({'where':{'id':_0x4d6055['params']['id']}})[_0x1a7b('0x23')](handleEntityNotFound(_0x1f16ef,null))[_0x1a7b('0x23')](function(_0x3e197a){if(_0x3e197a){return _0x3e197a[_0x1a7b('0x76')](_0x4d6055[_0x1a7b('0x47')]['ids'])[_0x1a7b('0x23')](function(){if(_[_0x1a7b('0x77')](_0x4d6055[_0x1a7b('0x47')]['ids'])){for(var _0x4adc3f=0x0;_0x4adc3f<_0x4d6055[_0x1a7b('0x47')]['ids']['length'];_0x4adc3f+=0x1){socket[_0x1a7b('0x74')](_0x1a7b('0x78'),{'UserId':Number(_0x4d6055[_0x1a7b('0x47')]['ids'][_0x4adc3f]),'WhatsappAccountId':Number(_0x4d6055[_0x1a7b('0x58')]['id'])});}}else{socket['emit'](_0x1a7b('0x78'),{'UserId':Number(_0x4d6055[_0x1a7b('0x47')][_0x1a7b('0x6e')]),'WhatsappAccountId':Number(_0x4d6055['params']['id'])});}});}})[_0x1a7b('0x23')](respondWithStatusCode(_0x1f16ef,null))['catch'](handleError(_0x1f16ef,null));};exports[_0x1a7b('0x79')]=function(_0x5daaa6,_0x40274a,_0xd75d82){var _0x465078={};var _0x14a7ee={};var _0x385634;var _0x4ab4a8;return db['WhatsappAccount'][_0x1a7b('0x69')]({'where':{'id':_0x5daaa6['params']['id']}})[_0x1a7b('0x23')](handleEntityNotFound(_0x40274a,null))['then'](function(_0x44b39b){if(_0x44b39b){_0x385634=_0x44b39b;_0x14a7ee[_0x1a7b('0x45')]=_[_0x1a7b('0x59')](db['User'][_0x1a7b('0x5a')]);_0x14a7ee[_0x1a7b('0x47')]=_[_0x1a7b('0x59')](_0x5daaa6[_0x1a7b('0x47')]);_0x14a7ee[_0x1a7b('0x48')]=_[_0x1a7b('0x49')](_0x14a7ee[_0x1a7b('0x45')],_0x14a7ee[_0x1a7b('0x47')]);_0x465078[_0x1a7b('0x4b')]=_[_0x1a7b('0x49')](_0x14a7ee[_0x1a7b('0x45')],qs[_0x1a7b('0x4a')](_0x5daaa6[_0x1a7b('0x47')][_0x1a7b('0x4a')]));_0x465078[_0x1a7b('0x4b')]=_0x465078['attributes']['length']?_0x465078['attributes']:_0x14a7ee[_0x1a7b('0x45')];_0x465078[_0x1a7b('0x4e')]=qs['sort'](_0x5daaa6[_0x1a7b('0x47')]['sort']);_0x465078[_0x1a7b('0x50')]=qs[_0x1a7b('0x48')](_['pick'](_0x5daaa6['query'],_0x14a7ee[_0x1a7b('0x48')]));if(_0x5daaa6[_0x1a7b('0x47')][_0x1a7b('0x51')]){_0x465078[_0x1a7b('0x50')]=_[_0x1a7b('0x52')](_0x465078[_0x1a7b('0x50')],{'$or':_[_0x1a7b('0x46')](_0x465078[_0x1a7b('0x4b')],function(_0x4eaca6){var _0xd3f7e7={};_0xd3f7e7[_0x4eaca6]={'$like':'%'+_0x5daaa6[_0x1a7b('0x47')][_0x1a7b('0x51')]+'%'};return _0xd3f7e7;})});}_0x465078=_[_0x1a7b('0x52')]({},_0x465078,_0x5daaa6[_0x1a7b('0x6b')]);return _0x385634[_0x1a7b('0x79')](_0x465078);}})[_0x1a7b('0x23')](function(_0x1c5e4d){if(_0x1c5e4d){_0x4ab4a8=_0x1c5e4d[_0x1a7b('0x7a')];if(!_0x5daaa6['query'][_0x1a7b('0x4c')](_0x1a7b('0x4d'))){_0x465078[_0x1a7b('0x30')]=qs['limit'](_0x5daaa6['query'][_0x1a7b('0x30')]);_0x465078['offset']=qs['offset'](_0x5daaa6[_0x1a7b('0x47')]['offset']);}return _0x385634[_0x1a7b('0x79')](_0x465078);}})['then'](function(_0x2ed709){if(_0x2ed709){return _0x2ed709?{'count':_0x4ab4a8,'rows':_0x2ed709}:null;}})[_0x1a7b('0x23')](respondWithResult(_0x40274a,null))[_0x1a7b('0x63')](handleError(_0x40274a,null));};exports[_0x1a7b('0x7b')]=function(_0x4e3893,_0x20ccb2){var _0xff1866=_0x4e3893[_0x1a7b('0x58')]['id'];var _0x1636c6=_0x4e3893['body'];var _0x248c53=0xc8;var _0x175ea6=null;return db[_0x1a7b('0x7c')][_0x1a7b('0x7d')]({'isolationLevel':db[_0x1a7b('0x7c')]['Transaction']['ISOLATION_LEVELS'][_0x1a7b('0x7e')]},function(_0x17b6e2){return db['WhatsappAccount']['findOne']({'where':{'id':_0xff1866},'transaction':_0x17b6e2})[_0x1a7b('0x23')](function(_0x1bd8cf){if(_0x1bd8cf){return db[_0x1a7b('0x7f')]['destroy']({'where':{'WhatsappAccountId':_0xff1866},'transaction':_0x17b6e2})[_0x1a7b('0x23')](function(){var _0x45f906=_[_0x1a7b('0x46')](_0x1636c6,function(_0x3a5f14){_0x3a5f14[_0x1a7b('0x67')]=_0xff1866;return _0x3a5f14;});return db[_0x1a7b('0x7f')][_0x1a7b('0x80')](_0x45f906,{'transaction':_0x17b6e2});});}else{_0x248c53=0x194;_0x175ea6=[];}});})[_0x1a7b('0x23')](function(){if(_0x248c53!==0x194){return db[_0x1a7b('0x7f')][_0x1a7b('0x81')]({'where':{'WhatsappAccountId':_0xff1866},'order':_0x1a7b('0x82')})['then'](function(_0x3a3d90){_0x175ea6=_0x3a3d90;});}})[_0x1a7b('0x63')](function(_0x57018c){_0x248c53=0x1f4;logger[_0x1a7b('0x28')](_0x57018c[_0x1a7b('0x3b')]);if(_0x57018c[_0x1a7b('0x3c')]){delete _0x57018c[_0x1a7b('0x3c')];}_0x175ea6=_0x57018c;})['finally'](function(){if(_0x175ea6===null){_0x20ccb2['sendStatus'](_0x248c53);}else{if(_0x248c53===0x1f4){_0x20ccb2['status'](_0x248c53)[_0x1a7b('0x3d')](_0x175ea6);}else{_0x20ccb2[_0x1a7b('0x2c')](_0x248c53)[_0x1a7b('0x34')](_0x175ea6);}}});};exports['getApplications']=function(_0x33eec3,_0x1551fe,_0x354db7){var _0x121747={};var _0x199adc={};var _0x46da89;var _0x3a7226;return db[_0x1a7b('0x41')]['findOne']({'where':{'id':_0x33eec3[_0x1a7b('0x58')]['id']}})[_0x1a7b('0x23')](handleEntityNotFound(_0x1551fe,null))[_0x1a7b('0x23')](function(_0x3dad5c){if(_0x3dad5c){_0x46da89=_0x3dad5c;_0x199adc['model']=_[_0x1a7b('0x59')](db[_0x1a7b('0x7f')][_0x1a7b('0x5a')]);_0x199adc[_0x1a7b('0x47')]=_[_0x1a7b('0x59')](_0x33eec3[_0x1a7b('0x47')]);_0x199adc['filters']=_[_0x1a7b('0x49')](_0x199adc[_0x1a7b('0x45')],_0x199adc[_0x1a7b('0x47')]);_0x121747['attributes']=_[_0x1a7b('0x49')](_0x199adc['model'],qs[_0x1a7b('0x4a')](_0x33eec3[_0x1a7b('0x47')][_0x1a7b('0x4a')]));_0x121747['attributes']=_0x121747[_0x1a7b('0x4b')][_0x1a7b('0x7a')]?_0x121747['attributes']:_0x199adc[_0x1a7b('0x45')];_0x121747[_0x1a7b('0x4e')]=qs[_0x1a7b('0x4f')](_0x33eec3[_0x1a7b('0x47')][_0x1a7b('0x4f')]);_0x121747['where']=qs[_0x1a7b('0x48')](_[_0x1a7b('0x6a')](_0x33eec3[_0x1a7b('0x47')],_0x199adc[_0x1a7b('0x48')]));if(_0x33eec3[_0x1a7b('0x47')][_0x1a7b('0x51')]){_0x121747['where']=_[_0x1a7b('0x52')](_0x121747['where'],{'$or':_[_0x1a7b('0x46')](_0x121747[_0x1a7b('0x4b')],function(_0x3d95f5){var _0xf7b58f={};_0xf7b58f[_0x3d95f5]={'$like':'%'+_0x33eec3['query'][_0x1a7b('0x51')]+'%'};return _0xf7b58f;})});}_0x121747=_[_0x1a7b('0x52')]({},_0x121747,_0x33eec3[_0x1a7b('0x6b')]);return _0x46da89[_0x1a7b('0x83')](_0x121747);}})[_0x1a7b('0x23')](function(_0x1d92ef){if(_0x1d92ef){_0x3a7226=_0x1d92ef['length'];if(!_0x33eec3[_0x1a7b('0x47')][_0x1a7b('0x4c')]('nolimit')){_0x121747[_0x1a7b('0x30')]=qs[_0x1a7b('0x30')](_0x33eec3['query'][_0x1a7b('0x30')]);_0x121747[_0x1a7b('0x2e')]=qs[_0x1a7b('0x2e')](_0x33eec3['query'][_0x1a7b('0x2e')]);}return _0x46da89[_0x1a7b('0x83')](_0x121747);}})[_0x1a7b('0x23')](function(_0x446df6){if(_0x446df6){return _0x446df6?{'count':_0x3a7226,'rows':_0x446df6}:null;}})[_0x1a7b('0x23')](respondWithResult(_0x1551fe,null))[_0x1a7b('0x63')](handleError(_0x1551fe,null));};exports[_0x1a7b('0x84')]=function(_0x2c7cd1,_0x124bd9,_0x4de9fd){var _0x4b77e6={'channel':_0x1a7b('0x85')};var _0x29a7b3=[];var _0x3bb400=[];var _0xfb898a={};return db[_0x1a7b('0x41')][_0x1a7b('0x61')]({'where':{'id':_0x2c7cd1['params']['id']},'include':[{'model':db[_0x1a7b('0x7f')],'as':_0x1a7b('0x86')}]})[_0x1a7b('0x23')](handleEntityNotFound(_0x124bd9,null))[_0x1a7b('0x23')](function(_0x34711f){_0x4b77e6['account']=_0x34711f;if(_0x4b77e6[_0x1a7b('0x87')]&&_0x4b77e6['account']['type']===_0x1a7b('0x88')&&_0x2c7cd1[_0x1a7b('0x5c')][_0x1a7b('0x89')]){if(_0x2c7cd1[_0x1a7b('0x5c')][_0x1a7b('0x89')][_0x1a7b('0x7a')]===0x0)return;if(_0x2c7cd1[_0x1a7b('0x5c')][_0x1a7b('0x89')][0x0][_0x1a7b('0x8a')]!==_0x1a7b('0x8b'))return;return db['WhatsappMessage'][_0x1a7b('0x36')]({'read':!![],'readAt':_0x2c7cd1[_0x1a7b('0x5c')][_0x1a7b('0x89')][0x0][_0x1a7b('0x8c')]},{'where':{'messageId':_0x2c7cd1['body']['statuses'][0x0]['message_id']},'individualHooks':!![]})['then'](function(_0x22814c){return _0x124bd9['status'](0xc8)[_0x1a7b('0x34')](_0x22814c);});}_0x4b77e6[_0x1a7b('0x8d')]=_['orderBy'](_0x34711f[_0x1a7b('0x86')],[_0x1a7b('0x82')],[_0x1a7b('0x8e')]);if(_0x4b77e6[_0x1a7b('0x87')]['Applications']){delete _0x4b77e6[_0x1a7b('0x87')][_0x1a7b('0x86')];}return db[_0x1a7b('0x8f')][_0x1a7b('0x65')]()[_0x1a7b('0x23')](function(_0xd28a9c){if(!_0xd28a9c){throw new db[(_0x1a7b('0x90'))]['ValidationError'](_0x1a7b('0x91'));}_0x29a7b3=_['difference'](_[_0x1a7b('0x59')](_0xd28a9c),[_0x1a7b('0x92'),_0x1a7b('0x93')]);_0x3bb400=_[_0x1a7b('0x94')](_[_0x1a7b('0x59')](_0xd28a9c),[_0x1a7b('0x92'),_0x1a7b('0x93'),_0x1a7b('0x95'),_0x1a7b('0x96')]);_0x4b77e6[_0x1a7b('0x5c')]={'mapKey':_0x1a7b('0x97')};if(_0x4b77e6['account']&&_0x4b77e6[_0x1a7b('0x87')][_0x1a7b('0x43')]==='twilio'){_0x4b77e6[_0x1a7b('0x5c')][_0x1a7b('0x98')]=_0x2c7cd1[_0x1a7b('0x5c')]['From'][_0x1a7b('0x99')](_0x1a7b('0x9a'),'');_0x4b77e6[_0x1a7b('0x5c')][_0x1a7b('0x5c')]=_0x2c7cd1[_0x1a7b('0x5c')][_0x1a7b('0x9b')];_0x4b77e6['body'][_0x1a7b('0x9c')]=_0x2c7cd1[_0x1a7b('0x5c')][_0x1a7b('0x9d')];}if(_0x4b77e6['account']&&_0x4b77e6[_0x1a7b('0x87')][_0x1a7b('0x43')]===_0x1a7b('0x88')){_0x4b77e6['body'][_0x1a7b('0x98')]=_0x2c7cd1['body'][_0x1a7b('0x9e')][0x0][_0x1a7b('0x98')];_0x4b77e6[_0x1a7b('0x5c')][_0x1a7b('0x5c')]=_0x2c7cd1[_0x1a7b('0x5c')][_0x1a7b('0x9e')][0x0][_0x1a7b('0x2a')][_0x1a7b('0x5c')];_0x4b77e6[_0x1a7b('0x5c')]['messageId']=_0x2c7cd1[_0x1a7b('0x5c')][_0x1a7b('0x9e')][0x0][_0x1a7b('0x9f')];}if(_0x4b77e6['body']['id']){delete _0x4b77e6['body']['id'];}if(_[_0x1a7b('0xa0')](_0x4b77e6[_0x1a7b('0x5c')][_0x1a7b('0x98')])){throw new db[(_0x1a7b('0x90'))][(_0x1a7b('0xa1'))](_0x1a7b('0xa2'));}if(_[_0x1a7b('0xa0')](_0x4b77e6['body']['body'])||_0x4b77e6[_0x1a7b('0x5c')][_0x1a7b('0x5c')]===''){throw new db[(_0x1a7b('0x90'))][(_0x1a7b('0xa1'))](_0x1a7b('0xa3'));}if(_[_0x1a7b('0xa0')](_0x4b77e6[_0x1a7b('0x5c')][_0x1a7b('0xa4')])){throw new db[(_0x1a7b('0x90'))]['ValidationError'](_0x1a7b('0xa5')+_0x3bb400);}if(!_[_0x1a7b('0xa6')](_0x3bb400,_0x4b77e6[_0x1a7b('0x5c')]['mapKey'])){throw new db['Sequelize']['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3bb400);}_0xfb898a[_0x4b77e6['body']['mapKey']]=_0x4b77e6[_0x1a7b('0x5c')][_0x1a7b('0x98')];return db[_0x1a7b('0xa7')][_0x1a7b('0x61')]({'where':{'id':_0x4b77e6['account'][_0x1a7b('0x96')]},'include':[{'model':db[_0x1a7b('0x8f')],'as':'Contacts','where':_0xfb898a,'limit':0x1,'order':[['updatedAt','DESC']]}]});})['then'](handleEntityNotFound(_0x124bd9,null))['then'](function(_0x49e033){if(_0x49e033){_0x4b77e6[_0x1a7b('0xa8')]=_[_0x1a7b('0xa9')](_0x49e033,[_0x1a7b('0xaa')]);if(_0x49e033[_0x1a7b('0xaa')]['length']){return _0x49e033['Contacts'][0x0];}var _0x7815e7=_[_0x1a7b('0xab')](_0x4b77e6[_0x1a7b('0x5c')],{'firstName':_0x4b77e6[_0x1a7b('0x5c')][_0x1a7b('0x98')],'ListId':_0x49e033['id']});_0x7815e7[_0x4b77e6[_0x1a7b('0x5c')][_0x1a7b('0xa4')]]=_0x4b77e6[_0x1a7b('0x5c')]['from'];return db[_0x1a7b('0x8f')][_0x1a7b('0x5b')](_0x7815e7,{'fields':_0x29a7b3,'raw':!![]});}})[_0x1a7b('0x23')](handleEntityNotFound(_0x124bd9,null))[_0x1a7b('0x23')](function(_0x269015){if(_0x269015){_0x4b77e6['contact']=_0x269015;var _0x12d2d1={'ContactId':_0x269015['id'],'phone':_0x4b77e6[_0x1a7b('0x5c')]['from'],'WhatsappAccountId':_0x2c7cd1[_0x1a7b('0x58')]['id']};var _0x3b2abd={'ContactId':_0x269015['id'],'WhatsappAccountId':_0x2c7cd1['params']['id'],'closed':![]};return db[_0x1a7b('0xac')][_0x1a7b('0x61')]({'where':_0x3b2abd})[_0x1a7b('0x23')](function(_0x45271b){if(_0x45271b){return[_0x45271b,![]];}return db[_0x1a7b('0xac')][_0x1a7b('0x5b')](_0x12d2d1)['then'](function(_0x3fbd00){return[_0x3fbd00,!![]];});});}})[_0x1a7b('0x73')](function(_0x5dff8c,_0x269d5c){_0x4b77e6['interaction']=_0x5dff8c['get']({'plain':!![]});_0x4b77e6[_0x1a7b('0xad')]['created']=![];if(_0x269d5c){if(_0x4b77e6[_0x1a7b('0x87')]['autoclose']){_0x4b77e6[_0x1a7b('0x8d')][_0x1a7b('0xae')]({'id':0x0,'priority':_0x4b77e6[_0x1a7b('0x8d')][_0x1a7b('0x7a')]+0x1,'app':_0x1a7b('0xaf'),'appdata':_0x1a7b('0xb0'),'interval':_0x1a7b('0xb1')});}_0x4b77e6['interaction']['created']=!![];}return db[_0x1a7b('0xb2')][_0x1a7b('0x5b')]({'phone':_0x4b77e6['body'][_0x1a7b('0x98')],'messageId':_0x4b77e6['body'][_0x1a7b('0x9c')],'body':_0x4b77e6['body'][_0x1a7b('0x5c')],'WhatsappAccountId':_0x2c7cd1[_0x1a7b('0x58')]['id'],'WhatsappInteractionId':_0x5dff8c['id'],'direction':'in','ContactId':_0x5dff8c[_0x1a7b('0xb3')],'AttachmentId':_0x4b77e6[_0x1a7b('0x5c')][_0x1a7b('0xb4')]});})[_0x1a7b('0x23')](function(_0x3fe5f4){_0x4b77e6[_0x1a7b('0x2a')]=_0x3fe5f4;if(!_0x4b77e6['interaction'][_0x1a7b('0xb5')])return;return db[_0x1a7b('0xb6')][_0x1a7b('0x61')]({'attributes':['id',_0x1a7b('0x3c')],'where':{'id':_0x4b77e6[_0x1a7b('0xad')][_0x1a7b('0xb5')]}});})[_0x1a7b('0x23')](function(_0xe0637e){if(_0xe0637e){_0x4b77e6[_0x1a7b('0x8d')][_0x1a7b('0xb7')]({'id':0x0,'priority':0x0,'app':_0x1a7b('0xb8'),'appdata':_0xe0637e[_0x1a7b('0x3c')]+','+(_0x4b77e6[_0x1a7b('0x87')][_0x1a7b('0xb9')]||0xa),'interval':_0x1a7b('0xb1')});}if(!_0x4b77e6[_0x1a7b('0xad')][_0x1a7b('0xba')])return;return db[_0x1a7b('0xbb')][_0x1a7b('0x61')]({'attributes':['id','name'],'where':{'id':_0x4b77e6['interaction'][_0x1a7b('0xba')]}});})[_0x1a7b('0x23')](function(_0x5089bd){if(_0x5089bd){_0x4b77e6[_0x1a7b('0x8d')][_0x1a7b('0xb7')]({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x5089bd[_0x1a7b('0x3c')]+','+(_0x4b77e6['account'][_0x1a7b('0xbc')]||0x12c),'interval':_0x1a7b('0xb1')});}return respondWithRpcPromise(_0x1a7b('0xbd'),_0x1a7b('0xbe'),_0x4b77e6);})['then'](function(_0x3742ef){if(_0x3742ef){var _0x55d075=0xc8;var _0xd7946d=_0x1a7b('0xbf');logger[_0x1a7b('0x24')](_0x1a7b('0xc0'),_0xd7946d,_0x55d075,_0x1a7b('0xc1'));logger[_0x1a7b('0xc2')](_0x1a7b('0xc3'),_0xd7946d,_0x55d075,_0x1a7b('0xc1'),JSON[_0x1a7b('0x27')](_0x3742ef));if(_0x4b77e6[_0x1a7b('0x87')][_0x1a7b('0x43')]===_0x1a7b('0xc4')){return _0x124bd9[_0x1a7b('0x2c')](_0x55d075)[_0x1a7b('0x32')]('Content-Type','text/xml')[_0x1a7b('0x3d')]('\x0a');}else{return _0x124bd9[_0x1a7b('0x2c')](_0x55d075)[_0x1a7b('0x34')](_0x3742ef);}}});})['catch'](handleError(_0x124bd9,null));};exports[_0x1a7b('0x3d')]=function(_0x298aac,_0x3bfaa4,_0x58d7c4){var _0x243667,_0x318924,_0x165c41;if(_[_0x1a7b('0xa0')](_0x298aac[_0x1a7b('0x5c')]['body'])||_0x298aac[_0x1a7b('0x5c')][_0x1a7b('0x5c')]===''){throw new db['Sequelize']['ValidationError'](_0x1a7b('0xa3'));}if(_[_0x1a7b('0xa0')](_0x298aac[_0x1a7b('0x5c')]['to'])){throw new db['Sequelize']['ValidationError'](_0x1a7b('0xc5'));}_0x243667=_0x298aac[_0x1a7b('0x5c')]['to'];return db[_0x1a7b('0x41')][_0x1a7b('0x61')]({'where':{'id':_0x298aac['params']['id']},'include':[{'model':db[_0x1a7b('0xa7')],'as':_0x1a7b('0xc6'),'include':[{'model':db[_0x1a7b('0x8f')],'as':_0x1a7b('0xaa'),'where':{'mobile':_0x243667},'limit':0x1,'order':[[_0x1a7b('0x93'),'DESC']]}]}]})[_0x1a7b('0x23')](handleEntityNotFound(_0x3bfaa4,null))[_0x1a7b('0x23')](function(_0x3e703c){if(_0x3e703c&&_0x3e703c[_0x1a7b('0xc6')]){_0x318924=_0x3e703c['get']({'plain':!![]});if(_0x318924['List']&&_0x318924['List'][_0x1a7b('0xaa')][_0x1a7b('0x7a')]){return _0x318924[_0x1a7b('0xc6')][_0x1a7b('0xaa')][0x0];}return db['CmContact'][_0x1a7b('0x5b')](_[_0x1a7b('0xab')](_0x298aac[_0x1a7b('0x5c')],{'firstName':_0x243667,'mobile':_0x243667,'phone':_0x243667,'ListId':_0x318924['ListId']}));}})[_0x1a7b('0x23')](handleEntityNotFound(_0x3bfaa4,null))['then'](function(_0x5ddfa4){if(_0x5ddfa4){_0x165c41=_0x5ddfa4;return db[_0x1a7b('0xac')][_0x1a7b('0x61')]({'where':{'ContactId':_0x165c41['id'],'closed':![],'WhatsappAccountId':_0x318924['id']}})['then'](function(_0x398c99){if(_0x398c99){return[_0x398c99,![]];}return db[_0x1a7b('0xac')]['create']({'UserId':_0x298aac[_0x1a7b('0x5f')]['id'],'ContactId':_0x165c41['id'],'WhatsappAccountId':_0x318924['id'],'phone':_0x243667,'firstMsgDirection':_0x1a7b('0xc7'),'Messages':[_[_0x1a7b('0x52')](_0x298aac[_0x1a7b('0x5c')],{'read':![],'body':_0x298aac[_0x1a7b('0x5c')][_0x1a7b('0x5c')],'phone':_0x243667,'WhatsappAccountId':_0x318924['id'],'UserId':_0x298aac[_0x1a7b('0x5f')]['id'],'ContactId':_0x165c41['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':_0x1a7b('0xc8')}]})[_0x1a7b('0x23')](function(_0x1bf081){return[_0x1bf081,!![]];});});}})[_0x1a7b('0x73')](function(_0x4aed31,_0x9952ea){if(_0x9952ea){return _0x4aed31;}return db[_0x1a7b('0xb2')][_0x1a7b('0x5b')](_[_0x1a7b('0x52')](_0x298aac[_0x1a7b('0x5c')],{'read':![],'body':_0x298aac['body']['body'],'phone':_0x243667,'WhatsappAccountId':_0x318924['id'],'WhatsappInteractionId':_0x4aed31['id'],'UserId':_0x298aac[_0x1a7b('0x5f')]['id'],'ContactId':_0x165c41['id']}))[_0x1a7b('0x23')](function(_0x5124e2){_0x4aed31[_0x1a7b('0xc9')][_0x1a7b('0xc8')]=[];_0x4aed31[_0x1a7b('0xc9')][_0x1a7b('0xc8')][_0x1a7b('0xae')](_0x5124e2[_0x1a7b('0xc9')]);return _0x4aed31;});})['then'](respondWithResult(_0x3bfaa4,null))[_0x1a7b('0x63')](handleError(_0x3bfaa4,null));}; \ No newline at end of file +var _0xf08c=['squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','jayson/promise','http','then','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','offset','undefined','limit','count','Content-Range','save','destroy','get','WhatsappAccounts','UserProfileResource','stack','name','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','type','key','model','query','keys','intersection','fields','attributes','nolimit','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','length','create','body','user','role','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','WhatsappAccountId','getDispositions','findOne','rawAttributes','pick','Disposition','ids','addAnswer','CannedAnswer','hasOwnProperty','removeAnswers','addAgents','omit','spread','emit','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','order','addApplications','sequelize','transaction','ISOLATION_LEVELS','WhatsappApplication','bulkCreate','findAndCountAll','finally','send','json','getApplications','Applications','account','sinch','statuses','state','read','WhatsappMessage','update','timestamp','message_id','applications','orderBy','priority','asc','CmContact','ValidationError','no\x20available\x20attributes','difference','updatedAt','CompanyId','ListId','mobile','twilio','from','whatsapp:','Body','notifications','messageId','isNil','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','DESC','list','Contacts','contact','WhatsappInteraction','interaction','autoclose','push','close','unmanaged','created','ContactId','UserId','agent','*,*,*,*','queueId','WhatsappQueue','unshift','queue','waitForTheAssignedQueue','receiveMessage','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','set','Content-Type','text/xml','\x0a','to\x20is\x20mandatory','List','Messages','dataValues','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf08c,0xb5));var _0xcf08=function(_0x4d977c,_0x5134d7){_0x4d977c=_0x4d977c-0x0;var _0x34f668=_0xf08c[_0x4d977c];return _0x34f668;};'use strict';var emlformat=require(_0xcf08('0x0'));var rimraf=require(_0xcf08('0x1'));var zipdir=require(_0xcf08('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcf08('0x3'));var moment=require(_0xcf08('0x4'));var BPromise=require(_0xcf08('0x5'));var Mustache=require(_0xcf08('0x6'));var util=require('util');var path=require('path');var sox=require(_0xcf08('0x7'));var csv=require(_0xcf08('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcf08('0x9'));var _=require(_0xcf08('0xa'));var squel=require(_0xcf08('0xb'));var crypto=require(_0xcf08('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xcf08('0x8'));var querystring=require('querystring');var Papa=require(_0xcf08('0xd'));var Redis=require(_0xcf08('0xe'));var authService=require(_0xcf08('0xf'));var qs=require(_0xcf08('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcf08('0x11'));var logger=require(_0xcf08('0x12'))(_0xcf08('0x13'));var utils=require(_0xcf08('0x14'));var config=require(_0xcf08('0x15'));var licenseUtil=require(_0xcf08('0x16'));var db=require(_0xcf08('0x17'))['db'];config[_0xcf08('0x18')]=_[_0xcf08('0x19')](config[_0xcf08('0x18')],{'host':_0xcf08('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./whatsappAccount.socket')[_0xcf08('0x1b')](socket);var jayson=require(_0xcf08('0x1c'));var client=jayson['client'][_0xcf08('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0x3fe9c5,_0x8c9d32,_0x2b0135,_0xf97f6e){return new BPromise(function(_0x4efc1a,_0xa838ef){var _0x5d89a7=_0xf97f6e||client;return _0x5d89a7['request'](_0x3fe9c5,_0x2b0135)[_0xcf08('0x1e')](function(_0x798fc2){logger['info'](_0xcf08('0x1f'),_0x8c9d32,_0xcf08('0x20'));logger[_0xcf08('0x21')](_0xcf08('0x22'),_0x8c9d32,_0xcf08('0x20'),JSON[_0xcf08('0x23')](_0x798fc2));if(_0x798fc2['error']){if(_0x798fc2[_0xcf08('0x24')][_0xcf08('0x25')]===0x1f4){logger[_0xcf08('0x24')]('WhatsappAccount,\x20%s,\x20%s',_0x8c9d32,_0x798fc2[_0xcf08('0x24')]['message']);return _0xa838ef(_0x798fc2[_0xcf08('0x24')][_0xcf08('0x26')]);}logger['error'](_0xcf08('0x1f'),_0x8c9d32,_0x798fc2[_0xcf08('0x24')][_0xcf08('0x26')]);return _0x4efc1a(_0x798fc2[_0xcf08('0x24')]['message']);}else{logger[_0xcf08('0x27')](_0xcf08('0x1f'),_0x8c9d32,'request\x20sent');_0x4efc1a(_0x798fc2[_0xcf08('0x28')]['message']);}})[_0xcf08('0x29')](function(_0x440ad0){logger['error'](_0xcf08('0x1f'),_0x8c9d32,_0x440ad0);_0xa838ef(_0x440ad0);});});}function respondWithStatusCode(_0x32d41d,_0x27f0bc){_0x27f0bc=_0x27f0bc||0xcc;return function(_0x213511){if(_0x213511){return _0x32d41d[_0xcf08('0x2a')](_0x27f0bc);}return _0x32d41d[_0xcf08('0x2b')](_0x27f0bc)[_0xcf08('0x2c')]();};}function respondWithResult(_0x35f774,_0x8ad51d){_0x8ad51d=_0x8ad51d||0xc8;return function(_0x306ac7){if(_0x306ac7){return _0x35f774['status'](_0x8ad51d)['json'](_0x306ac7);}};}function respondWithFilteredResult(_0x371741,_0x37035d){return function(_0x4a98d7){if(_0x4a98d7){var _0x684f45=typeof _0x37035d[_0xcf08('0x2d')]===_0xcf08('0x2e')&&typeof _0x37035d[_0xcf08('0x2f')]===_0xcf08('0x2e');var _0x1709ca=_0x4a98d7[_0xcf08('0x30')];var _0x29f65d=_0x684f45?0x0:_0x37035d[_0xcf08('0x2d')];var _0x315b96=_0x684f45?_0x4a98d7[_0xcf08('0x30')]:_0x37035d[_0xcf08('0x2d')]+_0x37035d[_0xcf08('0x2f')];var _0x2808de;if(_0x315b96>=_0x1709ca){_0x315b96=_0x1709ca;_0x2808de=0xc8;}else{_0x2808de=0xce;}_0x371741[_0xcf08('0x2b')](_0x2808de);return _0x371741['set'](_0xcf08('0x31'),_0x29f65d+'-'+_0x315b96+'/'+_0x1709ca)['json'](_0x4a98d7);}return null;};}function patchUpdates(_0x580acc){return function(_0x3c6afe){try{jsonpatch['apply'](_0x3c6afe,_0x580acc,!![]);}catch(_0x59367f){return BPromise['reject'](_0x59367f);}return _0x3c6afe[_0xcf08('0x32')]();};}function saveUpdates(_0x15fd54,_0x7994c1){return function(_0x5493dd){if(_0x5493dd){return _0x5493dd['update'](_0x15fd54)[_0xcf08('0x1e')](function(_0x276fbe){return _0x276fbe;});}return null;};}function removeEntity(_0x3b9af1,_0x2a5b6a){return function(_0x315053){if(_0x315053){return _0x315053[_0xcf08('0x33')]()[_0xcf08('0x1e')](function(){var _0x56da2f=_0x315053[_0xcf08('0x34')]({'plain':!![]});var _0x597629=_0xcf08('0x35');return db[_0xcf08('0x36')]['destroy']({'where':{'type':_0x597629,'resourceId':_0x56da2f['id']}})[_0xcf08('0x1e')](function(){return _0x315053;});})[_0xcf08('0x1e')](function(){_0x3b9af1[_0xcf08('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x53f457,_0x1aae14){return function(_0x3b6975){if(!_0x3b6975){_0x53f457[_0xcf08('0x2a')](0x194);}return _0x3b6975;};}function handleError(_0x28f767,_0x44da74){_0x44da74=_0x44da74||0x1f4;return function(_0xd73d53){logger[_0xcf08('0x24')](_0xd73d53[_0xcf08('0x37')]);if(_0xd73d53[_0xcf08('0x38')]){delete _0xd73d53[_0xcf08('0x38')];}_0x28f767['status'](_0x44da74)['send'](_0xd73d53);};}exports[_0xcf08('0x39')]=function(_0x1d7aeb,_0x20bfd2){var _0x22720f={'include':[{'model':db[_0xcf08('0x3a')],'as':_0xcf08('0x3b')}]},_0x4261e1={},_0x2b1ab1={'count':0x0,'rows':[]};var _0x558bb6=_[_0xcf08('0x3c')](db[_0xcf08('0x3d')]['rawAttributes'],function(_0x2795fc){return{'name':_0x2795fc['fieldName'],'type':_0x2795fc[_0xcf08('0x3e')][_0xcf08('0x3f')]};});_0x4261e1[_0xcf08('0x40')]=_[_0xcf08('0x3c')](_0x558bb6,_0xcf08('0x38'));_0x4261e1[_0xcf08('0x41')]=_[_0xcf08('0x42')](_0x1d7aeb[_0xcf08('0x41')]);_0x4261e1['filters']=_[_0xcf08('0x43')](_0x4261e1[_0xcf08('0x40')],_0x4261e1[_0xcf08('0x41')]);_0x22720f['attributes']=_['intersection'](_0x4261e1[_0xcf08('0x40')],qs[_0xcf08('0x44')](_0x1d7aeb[_0xcf08('0x41')][_0xcf08('0x44')]));_0x22720f['attributes']=_0x22720f[_0xcf08('0x45')]['length']?_0x22720f[_0xcf08('0x45')]:_0x4261e1[_0xcf08('0x40')];if(!_0x1d7aeb[_0xcf08('0x41')]['hasOwnProperty'](_0xcf08('0x46'))){_0x22720f[_0xcf08('0x2f')]=qs[_0xcf08('0x2f')](_0x1d7aeb[_0xcf08('0x41')][_0xcf08('0x2f')]);_0x22720f[_0xcf08('0x2d')]=qs[_0xcf08('0x2d')](_0x1d7aeb[_0xcf08('0x41')][_0xcf08('0x2d')]);}_0x22720f['order']=qs[_0xcf08('0x47')](_0x1d7aeb[_0xcf08('0x41')][_0xcf08('0x47')]);_0x22720f[_0xcf08('0x48')]=qs[_0xcf08('0x49')](_['pick'](_0x1d7aeb[_0xcf08('0x41')],_0x4261e1[_0xcf08('0x49')]),_0x558bb6);if(_0x1d7aeb[_0xcf08('0x41')][_0xcf08('0x4a')]){_0x22720f[_0xcf08('0x48')]=_[_0xcf08('0x4b')](_0x22720f[_0xcf08('0x48')],{'$or':_[_0xcf08('0x3c')](_0x558bb6,function(_0x1e8551){if(_0x1e8551[_0xcf08('0x3e')]!==_0xcf08('0x4c')){var _0x4241e5={};_0x4241e5[_0x1e8551[_0xcf08('0x38')]]={'$like':'%'+_0x1d7aeb[_0xcf08('0x41')][_0xcf08('0x4a')]+'%'};return _0x4241e5;}})});}_0x22720f=_[_0xcf08('0x4b')]({},_0x22720f,_0x1d7aeb[_0xcf08('0x4d')]);var _0x17445f={'where':_0x22720f[_0xcf08('0x48')]};return db['WhatsappAccount']['count'](_0x17445f)[_0xcf08('0x1e')](function(_0x12165f){_0x2b1ab1[_0xcf08('0x30')]=_0x12165f;if(_0x1d7aeb[_0xcf08('0x41')][_0xcf08('0x4e')]){_0x22720f[_0xcf08('0x4f')]=[{'all':!![]}];}return db['WhatsappAccount'][_0xcf08('0x50')](_0x22720f);})[_0xcf08('0x1e')](function(_0x36e753){_0x2b1ab1[_0xcf08('0x51')]=_0x36e753;return _0x2b1ab1;})[_0xcf08('0x1e')](respondWithFilteredResult(_0x20bfd2,_0x22720f))[_0xcf08('0x29')](handleError(_0x20bfd2,null));};exports['show']=function(_0x9e2369,_0xa5bf03){var _0x442725={'raw':![],'where':{'id':_0x9e2369[_0xcf08('0x52')]['id']},'include':[{'model':db[_0xcf08('0x3a')],'as':_0xcf08('0x3b')}]},_0x52b835={};_0x52b835[_0xcf08('0x40')]=_[_0xcf08('0x42')](db[_0xcf08('0x3d')]['rawAttributes']);_0x52b835[_0xcf08('0x41')]=_[_0xcf08('0x42')](_0x9e2369['query']);_0x52b835[_0xcf08('0x49')]=_[_0xcf08('0x43')](_0x52b835[_0xcf08('0x40')],_0x52b835['query']);_0x442725['attributes']=_[_0xcf08('0x43')](_0x52b835[_0xcf08('0x40')],qs[_0xcf08('0x44')](_0x9e2369[_0xcf08('0x41')][_0xcf08('0x44')]));_0x442725[_0xcf08('0x45')]=_0x442725[_0xcf08('0x45')][_0xcf08('0x53')]?_0x442725[_0xcf08('0x45')]:_0x52b835[_0xcf08('0x40')];if(_0x9e2369['query']['includeAll']){_0x442725[_0xcf08('0x4f')]=[{'all':!![]}];}_0x442725=_['merge']({},_0x442725,_0x9e2369[_0xcf08('0x4d')]);return db[_0xcf08('0x3d')]['find'](_0x442725)[_0xcf08('0x1e')](handleEntityNotFound(_0xa5bf03,null))[_0xcf08('0x1e')](respondWithResult(_0xa5bf03,null))['catch'](handleError(_0xa5bf03,null));};exports[_0xcf08('0x54')]=function(_0x578caf,_0x107e09){return db['WhatsappAccount']['create'](_0x578caf[_0xcf08('0x55')],{})['then'](function(_0xc8dbb2){var _0x2c3ae3=_0x578caf[_0xcf08('0x56')][_0xcf08('0x34')]({'plain':!![]});if(!_0x2c3ae3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2c3ae3[_0xcf08('0x57')]==='user'){var _0x2ba63c=_0xc8dbb2['get']({'plain':!![]});var _0x49761e='WhatsappAccounts';return db['UserProfileSection'][_0xcf08('0x58')]({'where':{'name':_0x49761e,'userProfileId':_0x2c3ae3['userProfileId']},'raw':!![]})[_0xcf08('0x1e')](function(_0xafe320){if(_0xafe320&&_0xafe320[_0xcf08('0x59')]===0x0){return db[_0xcf08('0x36')][_0xcf08('0x54')]({'name':_0x2ba63c[_0xcf08('0x38')],'resourceId':_0x2ba63c['id'],'type':_0xafe320[_0xcf08('0x38')],'sectionId':_0xafe320['id']},{})[_0xcf08('0x1e')](function(){return _0xc8dbb2;});}else{return _0xc8dbb2;}})[_0xcf08('0x29')](function(_0x19ca45){logger[_0xcf08('0x24')](_0xcf08('0x5a'),_0x19ca45);throw _0x19ca45;});}return _0xc8dbb2;})[_0xcf08('0x1e')](respondWithResult(_0x107e09,0xc9))[_0xcf08('0x29')](handleError(_0x107e09,null));};exports['update']=function(_0x3b3e18,_0x2de3c8){if(_0x3b3e18['body']['id']){delete _0x3b3e18[_0xcf08('0x55')]['id'];}return db[_0xcf08('0x3d')][_0xcf08('0x58')]({'where':{'id':_0x3b3e18[_0xcf08('0x52')]['id']},'include':[{'model':db['Pause'],'as':_0xcf08('0x3b')}]})[_0xcf08('0x1e')](handleEntityNotFound(_0x2de3c8,null))[_0xcf08('0x1e')](saveUpdates(_0x3b3e18['body'],null))[_0xcf08('0x1e')](respondWithResult(_0x2de3c8,null))[_0xcf08('0x29')](handleError(_0x2de3c8,null));};exports['destroy']=function(_0x17c0cb,_0x853439){return db['WhatsappAccount'][_0xcf08('0x58')]({'where':{'id':_0x17c0cb[_0xcf08('0x52')]['id']}})[_0xcf08('0x1e')](handleEntityNotFound(_0x853439,null))[_0xcf08('0x1e')](removeEntity(_0x853439,null))['catch'](handleError(_0x853439,null));};exports['describe']=function(_0x4624b1,_0x591a3e){return db['WhatsappAccount'][_0xcf08('0x5b')]()[_0xcf08('0x1e')](respondWithResult(_0x591a3e,null))['catch'](handleError(_0x591a3e,null));};exports[_0xcf08('0x5c')]=function(_0x585f7a,_0x4c7060,_0x3369b9){if(_0x585f7a['body']['id']){delete _0x585f7a[_0xcf08('0x55')]['id'];}return db[_0xcf08('0x3d')][_0xcf08('0x58')]({'where':{'id':_0x585f7a[_0xcf08('0x52')]['id']}})[_0xcf08('0x1e')](handleEntityNotFound(_0x4c7060,null))[_0xcf08('0x1e')](function(_0x22fc47){if(_0x22fc47){_0x585f7a['body'][_0xcf08('0x5d')]=_0x22fc47['id'];return db['Disposition'][_0xcf08('0x54')](_0x585f7a[_0xcf08('0x55')]);}})[_0xcf08('0x1e')](respondWithResult(_0x4c7060,null))[_0xcf08('0x29')](handleError(_0x4c7060,null));};exports[_0xcf08('0x5e')]=function(_0x44da28,_0x740feb,_0x96bc07){var _0x4178ed={'raw':![],'where':{}};var _0x109ab5={};var _0x21677d={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0xcf08('0x5f')]({'where':{'id':_0x44da28[_0xcf08('0x52')]['id']}})[_0xcf08('0x1e')](handleEntityNotFound(_0x740feb,null))[_0xcf08('0x1e')](function(_0x2eb731){if(_0x2eb731){_0x109ab5['model']=_[_0xcf08('0x42')](db['Disposition'][_0xcf08('0x60')]);_0x109ab5[_0xcf08('0x41')]=_[_0xcf08('0x42')](_0x44da28[_0xcf08('0x41')]);_0x109ab5[_0xcf08('0x49')]=_['intersection'](_0x109ab5[_0xcf08('0x40')],_0x109ab5[_0xcf08('0x41')]);_0x4178ed[_0xcf08('0x45')]=_[_0xcf08('0x43')](_0x109ab5[_0xcf08('0x40')],qs['fields'](_0x44da28[_0xcf08('0x41')][_0xcf08('0x44')]));_0x4178ed['attributes']=_0x4178ed[_0xcf08('0x45')]['length']?_0x4178ed[_0xcf08('0x45')]:_0x109ab5[_0xcf08('0x40')];if(!_0x44da28[_0xcf08('0x41')]['hasOwnProperty'](_0xcf08('0x46'))){_0x4178ed[_0xcf08('0x2f')]=qs[_0xcf08('0x2f')](_0x44da28[_0xcf08('0x41')]['limit']);_0x4178ed[_0xcf08('0x2d')]=qs[_0xcf08('0x2d')](_0x44da28[_0xcf08('0x41')]['offset']);}_0x4178ed['order']=qs[_0xcf08('0x47')](_0x44da28['query']['sort']);_0x4178ed[_0xcf08('0x48')]=qs['filters'](_[_0xcf08('0x61')](_0x44da28[_0xcf08('0x41')],_0x109ab5['filters']));_0x4178ed['where'][_0xcf08('0x5d')]=_0x2eb731['id'];if(_0x44da28[_0xcf08('0x41')][_0xcf08('0x4a')]){_0x4178ed['where']=_[_0xcf08('0x4b')](_0x4178ed[_0xcf08('0x48')],{'$or':_['map'](_0x4178ed[_0xcf08('0x45')],function(_0x4935a7){var _0x3ea85f={};_0x3ea85f[_0x4935a7]={'$like':'%'+_0x44da28[_0xcf08('0x41')]['filter']+'%'};return _0x3ea85f;})});}_0x4178ed=_[_0xcf08('0x4b')]({},_0x4178ed,_0x44da28['options']);return db[_0xcf08('0x62')][_0xcf08('0x30')]({'where':_0x4178ed[_0xcf08('0x48')]})[_0xcf08('0x1e')](function(_0x2d1a7b){_0x21677d[_0xcf08('0x30')]=_0x2d1a7b;if(_0x44da28['query']['includeAll']){_0x4178ed[_0xcf08('0x4f')]=[{'all':!![]}];}return db[_0xcf08('0x62')]['findAll'](_0x4178ed);})[_0xcf08('0x1e')](function(_0x520f38){_0x21677d[_0xcf08('0x51')]=_0x520f38;return _0x21677d;});}})[_0xcf08('0x1e')](respondWithFilteredResult(_0x740feb,_0x4178ed))[_0xcf08('0x29')](handleError(_0x740feb,null));};exports['removeDispositions']=function(_0x3b1479,_0x4d6dd1,_0x2db692){return db[_0xcf08('0x3d')]['find']({'where':{'id':_0x3b1479[_0xcf08('0x52')]['id']}})[_0xcf08('0x1e')](handleEntityNotFound(_0x4d6dd1,null))[_0xcf08('0x1e')](function(_0x1f620f){if(_0x1f620f){return _0x1f620f['removeDispositions'](_0x3b1479['query'][_0xcf08('0x63')]);}})[_0xcf08('0x1e')](respondWithStatusCode(_0x4d6dd1,null))[_0xcf08('0x29')](handleError(_0x4d6dd1,null));};exports[_0xcf08('0x64')]=function(_0x332490,_0x51ab43,_0x52557f){if(_0x332490[_0xcf08('0x55')]['id']){delete _0x332490['body']['id'];}return db[_0xcf08('0x3d')]['find']({'where':{'id':_0x332490[_0xcf08('0x52')]['id']}})[_0xcf08('0x1e')](handleEntityNotFound(_0x51ab43,null))['then'](function(_0x2a2c37){if(_0x2a2c37){_0x332490[_0xcf08('0x55')][_0xcf08('0x5d')]=_0x2a2c37['id'];return db[_0xcf08('0x65')][_0xcf08('0x54')](_0x332490[_0xcf08('0x55')]);}})[_0xcf08('0x1e')](respondWithResult(_0x51ab43,null))[_0xcf08('0x29')](handleError(_0x51ab43,null));};exports['getAnswers']=function(_0x240d4b,_0xdf2977,_0x3547c7){var _0x2e72a5={'raw':![],'where':{}};var _0x2ede98={};var _0x54564c={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0xcf08('0x5f')]({'where':{'id':_0x240d4b[_0xcf08('0x52')]['id']}})[_0xcf08('0x1e')](handleEntityNotFound(_0xdf2977,null))['then'](function(_0xea2d8){if(_0xea2d8){_0x2ede98['model']=_[_0xcf08('0x42')](db[_0xcf08('0x65')]['rawAttributes']);_0x2ede98[_0xcf08('0x41')]=_[_0xcf08('0x42')](_0x240d4b[_0xcf08('0x41')]);_0x2ede98[_0xcf08('0x49')]=_[_0xcf08('0x43')](_0x2ede98['model'],_0x2ede98[_0xcf08('0x41')]);_0x2e72a5[_0xcf08('0x45')]=_[_0xcf08('0x43')](_0x2ede98['model'],qs[_0xcf08('0x44')](_0x240d4b[_0xcf08('0x41')][_0xcf08('0x44')]));_0x2e72a5[_0xcf08('0x45')]=_0x2e72a5[_0xcf08('0x45')]['length']?_0x2e72a5[_0xcf08('0x45')]:_0x2ede98[_0xcf08('0x40')];if(!_0x240d4b[_0xcf08('0x41')][_0xcf08('0x66')](_0xcf08('0x46'))){_0x2e72a5['limit']=qs['limit'](_0x240d4b[_0xcf08('0x41')][_0xcf08('0x2f')]);_0x2e72a5[_0xcf08('0x2d')]=qs[_0xcf08('0x2d')](_0x240d4b['query'][_0xcf08('0x2d')]);}_0x2e72a5['order']=qs[_0xcf08('0x47')](_0x240d4b[_0xcf08('0x41')]['sort']);_0x2e72a5[_0xcf08('0x48')]=qs['filters'](_['pick'](_0x240d4b[_0xcf08('0x41')],_0x2ede98[_0xcf08('0x49')]));_0x2e72a5['where'][_0xcf08('0x5d')]=_0xea2d8['id'];if(_0x240d4b[_0xcf08('0x41')][_0xcf08('0x4a')]){_0x2e72a5[_0xcf08('0x48')]=_[_0xcf08('0x4b')](_0x2e72a5[_0xcf08('0x48')],{'$or':_[_0xcf08('0x3c')](_0x2e72a5[_0xcf08('0x45')],function(_0xde05a1){var _0x30336c={};_0x30336c[_0xde05a1]={'$like':'%'+_0x240d4b[_0xcf08('0x41')][_0xcf08('0x4a')]+'%'};return _0x30336c;})});}_0x2e72a5=_['merge']({},_0x2e72a5,_0x240d4b[_0xcf08('0x4d')]);return db[_0xcf08('0x65')][_0xcf08('0x30')]({'where':_0x2e72a5[_0xcf08('0x48')]})[_0xcf08('0x1e')](function(_0x3eb343){_0x54564c[_0xcf08('0x30')]=_0x3eb343;if(_0x240d4b[_0xcf08('0x41')][_0xcf08('0x4e')]){_0x2e72a5[_0xcf08('0x4f')]=[{'all':!![]}];}return db[_0xcf08('0x65')]['findAll'](_0x2e72a5);})[_0xcf08('0x1e')](function(_0x509543){_0x54564c[_0xcf08('0x51')]=_0x509543;return _0x54564c;});}})[_0xcf08('0x1e')](respondWithFilteredResult(_0xdf2977,_0x2e72a5))[_0xcf08('0x29')](handleError(_0xdf2977,null));};exports[_0xcf08('0x67')]=function(_0x233ab2,_0x39861a,_0x4884b6){return db[_0xcf08('0x3d')][_0xcf08('0x58')]({'where':{'id':_0x233ab2[_0xcf08('0x52')]['id']}})[_0xcf08('0x1e')](handleEntityNotFound(_0x39861a,null))[_0xcf08('0x1e')](function(_0x30d79b){if(_0x30d79b){return _0x30d79b[_0xcf08('0x67')](_0x233ab2[_0xcf08('0x41')][_0xcf08('0x63')]);}})[_0xcf08('0x1e')](respondWithStatusCode(_0x39861a,null))[_0xcf08('0x29')](handleError(_0x39861a,null));};exports[_0xcf08('0x68')]=function(_0x3074f6,_0x1f9cdb,_0x139e52){return db[_0xcf08('0x3d')][_0xcf08('0x58')]({'where':{'id':_0x3074f6[_0xcf08('0x52')]['id']}})[_0xcf08('0x1e')](handleEntityNotFound(_0x1f9cdb,null))[_0xcf08('0x1e')](function(_0x5925bc){if(_0x5925bc){return _0x5925bc['addAgents'](_0x3074f6[_0xcf08('0x55')]['ids'],_[_0xcf08('0x69')](_0x3074f6['body'],['ids','id'])||{})[_0xcf08('0x6a')](function(_0xb9d4d5){for(var _0x5e496f=0x0;_0x5e496f<_0x3074f6['body'][_0xcf08('0x63')][_0xcf08('0x53')];_0x5e496f+=0x1){socket[_0xcf08('0x6b')]('userWhatsappAccount:save',{'UserId':Number(_0x3074f6[_0xcf08('0x55')][_0xcf08('0x63')][_0x5e496f]),'WhatsappAccountId':Number(_0x3074f6[_0xcf08('0x52')]['id'])});}return _0xb9d4d5;});}})[_0xcf08('0x1e')](respondWithResult(_0x1f9cdb,null))['catch'](handleError(_0x1f9cdb,null));};exports[_0xcf08('0x6c')]=function(_0x56363c,_0x2eef6a,_0x5ee59a){return db['WhatsappAccount'][_0xcf08('0x58')]({'where':{'id':_0x56363c[_0xcf08('0x52')]['id']}})[_0xcf08('0x1e')](handleEntityNotFound(_0x2eef6a,null))[_0xcf08('0x1e')](function(_0x41fd9f){if(_0x41fd9f){return _0x41fd9f[_0xcf08('0x6c')](_0x56363c[_0xcf08('0x41')][_0xcf08('0x63')])[_0xcf08('0x1e')](function(){if(_[_0xcf08('0x6d')](_0x56363c['query'][_0xcf08('0x63')])){for(var _0x1b6c4c=0x0;_0x1b6c4c<_0x56363c[_0xcf08('0x41')][_0xcf08('0x63')][_0xcf08('0x53')];_0x1b6c4c+=0x1){socket[_0xcf08('0x6b')](_0xcf08('0x6e'),{'UserId':Number(_0x56363c[_0xcf08('0x41')][_0xcf08('0x63')][_0x1b6c4c]),'WhatsappAccountId':Number(_0x56363c[_0xcf08('0x52')]['id'])});}}else{socket[_0xcf08('0x6b')](_0xcf08('0x6e'),{'UserId':Number(_0x56363c[_0xcf08('0x41')][_0xcf08('0x63')]),'WhatsappAccountId':Number(_0x56363c[_0xcf08('0x52')]['id'])});}});}})[_0xcf08('0x1e')](respondWithStatusCode(_0x2eef6a,null))[_0xcf08('0x29')](handleError(_0x2eef6a,null));};exports[_0xcf08('0x6f')]=function(_0x31415c,_0x4acab2,_0x396f97){var _0x255870={};var _0x238dd7={};var _0x2cefb4;var _0x32c390;return db['WhatsappAccount'][_0xcf08('0x5f')]({'where':{'id':_0x31415c[_0xcf08('0x52')]['id']}})[_0xcf08('0x1e')](handleEntityNotFound(_0x4acab2,null))[_0xcf08('0x1e')](function(_0x2b77d9){if(_0x2b77d9){_0x2cefb4=_0x2b77d9;_0x238dd7[_0xcf08('0x40')]=_[_0xcf08('0x42')](db[_0xcf08('0x70')]['rawAttributes']);_0x238dd7[_0xcf08('0x41')]=_[_0xcf08('0x42')](_0x31415c[_0xcf08('0x41')]);_0x238dd7['filters']=_[_0xcf08('0x43')](_0x238dd7[_0xcf08('0x40')],_0x238dd7[_0xcf08('0x41')]);_0x255870[_0xcf08('0x45')]=_[_0xcf08('0x43')](_0x238dd7[_0xcf08('0x40')],qs[_0xcf08('0x44')](_0x31415c[_0xcf08('0x41')][_0xcf08('0x44')]));_0x255870[_0xcf08('0x45')]=_0x255870[_0xcf08('0x45')]['length']?_0x255870[_0xcf08('0x45')]:_0x238dd7['model'];_0x255870[_0xcf08('0x71')]=qs[_0xcf08('0x47')](_0x31415c['query']['sort']);_0x255870['where']=qs[_0xcf08('0x49')](_[_0xcf08('0x61')](_0x31415c[_0xcf08('0x41')],_0x238dd7[_0xcf08('0x49')]));if(_0x31415c[_0xcf08('0x41')][_0xcf08('0x4a')]){_0x255870['where']=_[_0xcf08('0x4b')](_0x255870[_0xcf08('0x48')],{'$or':_[_0xcf08('0x3c')](_0x255870['attributes'],function(_0x2de307){var _0x3623c9={};_0x3623c9[_0x2de307]={'$like':'%'+_0x31415c[_0xcf08('0x41')][_0xcf08('0x4a')]+'%'};return _0x3623c9;})});}_0x255870=_[_0xcf08('0x4b')]({},_0x255870,_0x31415c[_0xcf08('0x4d')]);return _0x2cefb4[_0xcf08('0x6f')](_0x255870);}})['then'](function(_0x4eb1ea){if(_0x4eb1ea){_0x32c390=_0x4eb1ea[_0xcf08('0x53')];if(!_0x31415c['query'][_0xcf08('0x66')](_0xcf08('0x46'))){_0x255870[_0xcf08('0x2f')]=qs['limit'](_0x31415c[_0xcf08('0x41')][_0xcf08('0x2f')]);_0x255870[_0xcf08('0x2d')]=qs[_0xcf08('0x2d')](_0x31415c[_0xcf08('0x41')]['offset']);}return _0x2cefb4[_0xcf08('0x6f')](_0x255870);}})['then'](function(_0x36f27c){if(_0x36f27c){return _0x36f27c?{'count':_0x32c390,'rows':_0x36f27c}:null;}})['then'](respondWithResult(_0x4acab2,null))[_0xcf08('0x29')](handleError(_0x4acab2,null));};exports[_0xcf08('0x72')]=function(_0x309d33,_0x3e899b){var _0x441f79=_0x309d33[_0xcf08('0x52')]['id'];var _0x5be0e2=_0x309d33['body'];var _0x354587=0xc8;var _0x8b6ccf=null;return db[_0xcf08('0x73')][_0xcf08('0x74')]({'isolationLevel':db['sequelize']['Transaction'][_0xcf08('0x75')]['READ_COMMITTED']},function(_0x3ac344){return db['WhatsappAccount'][_0xcf08('0x5f')]({'where':{'id':_0x441f79},'transaction':_0x3ac344})[_0xcf08('0x1e')](function(_0x4812b6){if(_0x4812b6){return db[_0xcf08('0x76')]['destroy']({'where':{'WhatsappAccountId':_0x441f79},'transaction':_0x3ac344})['then'](function(){var _0x7a3654=_[_0xcf08('0x3c')](_0x5be0e2,function(_0x22e683){_0x22e683['WhatsappAccountId']=_0x441f79;return _0x22e683;});return db[_0xcf08('0x76')][_0xcf08('0x77')](_0x7a3654,{'transaction':_0x3ac344});});}else{_0x354587=0x194;_0x8b6ccf=[];}});})['then'](function(){if(_0x354587!==0x194){return db[_0xcf08('0x76')][_0xcf08('0x78')]({'where':{'WhatsappAccountId':_0x441f79},'order':'priority'})[_0xcf08('0x1e')](function(_0x19b119){_0x8b6ccf=_0x19b119;});}})['catch'](function(_0x26eef4){_0x354587=0x1f4;logger['error'](_0x26eef4[_0xcf08('0x37')]);if(_0x26eef4[_0xcf08('0x38')]){delete _0x26eef4[_0xcf08('0x38')];}_0x8b6ccf=_0x26eef4;})[_0xcf08('0x79')](function(){if(_0x8b6ccf===null){_0x3e899b[_0xcf08('0x2a')](_0x354587);}else{if(_0x354587===0x1f4){_0x3e899b[_0xcf08('0x2b')](_0x354587)[_0xcf08('0x7a')](_0x8b6ccf);}else{_0x3e899b[_0xcf08('0x2b')](_0x354587)[_0xcf08('0x7b')](_0x8b6ccf);}}});};exports['getApplications']=function(_0x28a116,_0x3851e5,_0x50b02a){var _0x1360cc={};var _0x32170d={};var _0x156cc3;var _0x2e053e;return db[_0xcf08('0x3d')][_0xcf08('0x5f')]({'where':{'id':_0x28a116[_0xcf08('0x52')]['id']}})[_0xcf08('0x1e')](handleEntityNotFound(_0x3851e5,null))[_0xcf08('0x1e')](function(_0x4db288){if(_0x4db288){_0x156cc3=_0x4db288;_0x32170d[_0xcf08('0x40')]=_[_0xcf08('0x42')](db[_0xcf08('0x76')]['rawAttributes']);_0x32170d['query']=_[_0xcf08('0x42')](_0x28a116[_0xcf08('0x41')]);_0x32170d['filters']=_[_0xcf08('0x43')](_0x32170d[_0xcf08('0x40')],_0x32170d[_0xcf08('0x41')]);_0x1360cc[_0xcf08('0x45')]=_['intersection'](_0x32170d['model'],qs[_0xcf08('0x44')](_0x28a116['query']['fields']));_0x1360cc[_0xcf08('0x45')]=_0x1360cc['attributes']['length']?_0x1360cc[_0xcf08('0x45')]:_0x32170d[_0xcf08('0x40')];_0x1360cc[_0xcf08('0x71')]=qs['sort'](_0x28a116[_0xcf08('0x41')][_0xcf08('0x47')]);_0x1360cc['where']=qs[_0xcf08('0x49')](_[_0xcf08('0x61')](_0x28a116[_0xcf08('0x41')],_0x32170d[_0xcf08('0x49')]));if(_0x28a116[_0xcf08('0x41')][_0xcf08('0x4a')]){_0x1360cc[_0xcf08('0x48')]=_['merge'](_0x1360cc[_0xcf08('0x48')],{'$or':_['map'](_0x1360cc[_0xcf08('0x45')],function(_0x14658b){var _0x1457d0={};_0x1457d0[_0x14658b]={'$like':'%'+_0x28a116[_0xcf08('0x41')][_0xcf08('0x4a')]+'%'};return _0x1457d0;})});}_0x1360cc=_['merge']({},_0x1360cc,_0x28a116['options']);return _0x156cc3[_0xcf08('0x7c')](_0x1360cc);}})['then'](function(_0x4b9ad4){if(_0x4b9ad4){_0x2e053e=_0x4b9ad4['length'];if(!_0x28a116[_0xcf08('0x41')][_0xcf08('0x66')](_0xcf08('0x46'))){_0x1360cc[_0xcf08('0x2f')]=qs[_0xcf08('0x2f')](_0x28a116[_0xcf08('0x41')][_0xcf08('0x2f')]);_0x1360cc[_0xcf08('0x2d')]=qs[_0xcf08('0x2d')](_0x28a116['query'][_0xcf08('0x2d')]);}return _0x156cc3['getApplications'](_0x1360cc);}})[_0xcf08('0x1e')](function(_0x13cceb){if(_0x13cceb){return _0x13cceb?{'count':_0x2e053e,'rows':_0x13cceb}:null;}})[_0xcf08('0x1e')](respondWithResult(_0x3851e5,null))['catch'](handleError(_0x3851e5,null));};exports['notify']=function(_0xf2ec7e,_0x18ce19,_0x5221b0){var _0x1c8cf8={'channel':'whatsapp'};var _0x319ad0=[];var _0xf591ad=[];var _0x54e558={};return db['WhatsappAccount'][_0xcf08('0x58')]({'where':{'id':_0xf2ec7e['params']['id']},'include':[{'model':db[_0xcf08('0x76')],'as':_0xcf08('0x7d')}]})[_0xcf08('0x1e')](handleEntityNotFound(_0x18ce19,null))['then'](function(_0x4e3428){_0x1c8cf8['account']=_0x4e3428;if(_0x1c8cf8[_0xcf08('0x7e')]&&_0x1c8cf8[_0xcf08('0x7e')][_0xcf08('0x3e')]===_0xcf08('0x7f')&&_0xf2ec7e[_0xcf08('0x55')][_0xcf08('0x80')]){if(_0xf2ec7e[_0xcf08('0x55')]['statuses']['length']===0x0)return;if(_0xf2ec7e['body'][_0xcf08('0x80')][0x0][_0xcf08('0x81')]!==_0xcf08('0x82'))return;return db[_0xcf08('0x83')][_0xcf08('0x84')]({'read':!![],'readAt':_0xf2ec7e['body'][_0xcf08('0x80')][0x0][_0xcf08('0x85')]},{'where':{'messageId':_0xf2ec7e[_0xcf08('0x55')][_0xcf08('0x80')][0x0][_0xcf08('0x86')]},'individualHooks':!![]})[_0xcf08('0x1e')](function(_0x2f353d){return _0x18ce19[_0xcf08('0x2b')](0xc8)['json'](_0x2f353d);});}_0x1c8cf8[_0xcf08('0x87')]=_[_0xcf08('0x88')](_0x4e3428[_0xcf08('0x7d')],[_0xcf08('0x89')],[_0xcf08('0x8a')]);if(_0x1c8cf8[_0xcf08('0x7e')][_0xcf08('0x7d')]){delete _0x1c8cf8[_0xcf08('0x7e')]['Applications'];}return db[_0xcf08('0x8b')][_0xcf08('0x5b')]()[_0xcf08('0x1e')](function(_0x1de7cb){if(!_0x1de7cb){throw new db['Sequelize'][(_0xcf08('0x8c'))](_0xcf08('0x8d'));}_0x319ad0=_[_0xcf08('0x8e')](_[_0xcf08('0x42')](_0x1de7cb),['createdAt',_0xcf08('0x8f')]);_0xf591ad=_[_0xcf08('0x8e')](_[_0xcf08('0x42')](_0x1de7cb),['createdAt',_0xcf08('0x8f'),_0xcf08('0x90'),_0xcf08('0x91')]);_0x1c8cf8[_0xcf08('0x55')]={'mapKey':_0xcf08('0x92')};if(_0x1c8cf8[_0xcf08('0x7e')]&&_0x1c8cf8[_0xcf08('0x7e')][_0xcf08('0x3e')]===_0xcf08('0x93')){_0x1c8cf8['body'][_0xcf08('0x94')]=_0xf2ec7e['body']['From']['replace'](_0xcf08('0x95'),'');_0x1c8cf8['body'][_0xcf08('0x55')]=_0xf2ec7e['body'][_0xcf08('0x96')];_0x1c8cf8[_0xcf08('0x55')]['messageId']=_0xf2ec7e['body']['MessageSid'];}if(_0x1c8cf8[_0xcf08('0x7e')]&&_0x1c8cf8[_0xcf08('0x7e')][_0xcf08('0x3e')]===_0xcf08('0x7f')){_0x1c8cf8[_0xcf08('0x55')]['from']=_0xf2ec7e['body']['notifications'][0x0]['from'];_0x1c8cf8[_0xcf08('0x55')][_0xcf08('0x55')]=_0xf2ec7e[_0xcf08('0x55')][_0xcf08('0x97')][0x0][_0xcf08('0x26')][_0xcf08('0x55')];_0x1c8cf8[_0xcf08('0x55')][_0xcf08('0x98')]=_0xf2ec7e['body'][_0xcf08('0x97')][0x0][_0xcf08('0x86')];}if(_0x1c8cf8[_0xcf08('0x55')]['id']){delete _0x1c8cf8[_0xcf08('0x55')]['id'];}if(_[_0xcf08('0x99')](_0x1c8cf8['body'][_0xcf08('0x94')])){throw new db[(_0xcf08('0x9a'))][(_0xcf08('0x8c'))](_0xcf08('0x9b'));}if(_[_0xcf08('0x99')](_0x1c8cf8['body'][_0xcf08('0x55')])||_0x1c8cf8[_0xcf08('0x55')][_0xcf08('0x55')]===''){throw new db[(_0xcf08('0x9a'))][(_0xcf08('0x8c'))](_0xcf08('0x9c'));}if(_[_0xcf08('0x99')](_0x1c8cf8[_0xcf08('0x55')]['mapKey'])){throw new db[(_0xcf08('0x9a'))][(_0xcf08('0x8c'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xf591ad);}if(!_[_0xcf08('0x9d')](_0xf591ad,_0x1c8cf8[_0xcf08('0x55')][_0xcf08('0x9e')])){throw new db[(_0xcf08('0x9a'))][(_0xcf08('0x8c'))](_0xcf08('0x9f')+_0xf591ad);}_0x54e558[_0x1c8cf8[_0xcf08('0x55')]['mapKey']]=_0x1c8cf8[_0xcf08('0x55')][_0xcf08('0x94')];return db[_0xcf08('0xa0')][_0xcf08('0x58')]({'where':{'id':_0x1c8cf8['account'][_0xcf08('0x91')]},'include':[{'model':db[_0xcf08('0x8b')],'as':'Contacts','where':_0x54e558,'limit':0x1,'order':[[_0xcf08('0x8f'),_0xcf08('0xa1')]]}]});})['then'](handleEntityNotFound(_0x18ce19,null))['then'](function(_0x57445a){if(_0x57445a){_0x1c8cf8[_0xcf08('0xa2')]=_['omit'](_0x57445a,[_0xcf08('0xa3')]);if(_0x57445a['Contacts'][_0xcf08('0x53')]){return _0x57445a[_0xcf08('0xa3')][0x0];}var _0x56e757=_['defaults'](_0x1c8cf8[_0xcf08('0x55')],{'firstName':_0x1c8cf8['body']['from'],'ListId':_0x57445a['id']});_0x56e757[_0x1c8cf8[_0xcf08('0x55')]['mapKey']]=_0x1c8cf8[_0xcf08('0x55')][_0xcf08('0x94')];return db[_0xcf08('0x8b')][_0xcf08('0x54')](_0x56e757,{'fields':_0x319ad0,'raw':!![]});}})[_0xcf08('0x1e')](handleEntityNotFound(_0x18ce19,null))[_0xcf08('0x1e')](function(_0xd169ca){if(_0xd169ca){_0x1c8cf8[_0xcf08('0xa4')]=_0xd169ca;var _0x8502af={'ContactId':_0xd169ca['id'],'phone':_0x1c8cf8['body'][_0xcf08('0x94')],'WhatsappAccountId':_0xf2ec7e[_0xcf08('0x52')]['id']};var _0x496eb8={'ContactId':_0xd169ca['id'],'WhatsappAccountId':_0xf2ec7e[_0xcf08('0x52')]['id'],'closed':![]};return db['WhatsappInteraction'][_0xcf08('0x58')]({'where':_0x496eb8})[_0xcf08('0x1e')](function(_0x2a4130){if(_0x2a4130){return[_0x2a4130,![]];}return db[_0xcf08('0xa5')][_0xcf08('0x54')](_0x8502af)[_0xcf08('0x1e')](function(_0x3e8ecd){return[_0x3e8ecd,!![]];});});}})[_0xcf08('0x6a')](function(_0x19e9fd,_0x4700f8){_0x1c8cf8['interaction']=_0x19e9fd[_0xcf08('0x34')]({'plain':!![]});_0x1c8cf8[_0xcf08('0xa6')]['created']=![];if(_0x4700f8){if(_0x1c8cf8[_0xcf08('0x7e')][_0xcf08('0xa7')]){_0x1c8cf8[_0xcf08('0x87')][_0xcf08('0xa8')]({'id':0x0,'priority':_0x1c8cf8[_0xcf08('0x87')]['length']+0x1,'app':_0xcf08('0xa9'),'appdata':_0xcf08('0xaa'),'interval':'*,*,*,*'});}_0x1c8cf8[_0xcf08('0xa6')][_0xcf08('0xab')]=!![];}return db['WhatsappMessage'][_0xcf08('0x54')]({'phone':_0x1c8cf8['body']['from'],'messageId':_0x1c8cf8[_0xcf08('0x55')]['messageId'],'body':_0x1c8cf8['body']['body'],'WhatsappAccountId':_0xf2ec7e[_0xcf08('0x52')]['id'],'WhatsappInteractionId':_0x19e9fd['id'],'direction':'in','ContactId':_0x19e9fd[_0xcf08('0xac')],'AttachmentId':_0x1c8cf8[_0xcf08('0x55')]['AttachmentId']});})['then'](function(_0x1348ed){_0x1c8cf8[_0xcf08('0x26')]=_0x1348ed;if(!_0x1c8cf8[_0xcf08('0xa6')][_0xcf08('0xad')])return;return db[_0xcf08('0x70')]['find']({'attributes':['id',_0xcf08('0x38')],'where':{'id':_0x1c8cf8[_0xcf08('0xa6')]['UserId']}});})[_0xcf08('0x1e')](function(_0xe8c0dd){if(_0xe8c0dd){_0x1c8cf8[_0xcf08('0x87')]['unshift']({'id':0x0,'priority':0x0,'app':_0xcf08('0xae'),'appdata':_0xe8c0dd[_0xcf08('0x38')]+','+(_0x1c8cf8['account']['waitForTheAssignedAgent']||0xa),'interval':_0xcf08('0xaf')});}if(!_0x1c8cf8['interaction'][_0xcf08('0xb0')])return;return db[_0xcf08('0xb1')][_0xcf08('0x58')]({'attributes':['id',_0xcf08('0x38')],'where':{'id':_0x1c8cf8[_0xcf08('0xa6')][_0xcf08('0xb0')]}});})[_0xcf08('0x1e')](function(_0x458e60){if(_0x458e60){_0x1c8cf8['applications'][_0xcf08('0xb2')]({'id':0x0,'priority':0x1,'app':_0xcf08('0xb3'),'appdata':_0x458e60[_0xcf08('0x38')]+','+(_0x1c8cf8[_0xcf08('0x7e')][_0xcf08('0xb4')]||0x12c),'interval':_0xcf08('0xaf')});}return respondWithRpcPromise('Start','startRouting',_0x1c8cf8);})[_0xcf08('0x1e')](function(_0xc2f146){if(_0xc2f146){var _0x12dfe0=0xc8;var _0x59d754=_0xcf08('0xb5');logger['info'](_0xcf08('0x22'),_0x59d754,_0x12dfe0,'entity\x20found');logger['debug'](_0xcf08('0xb6'),_0x59d754,_0x12dfe0,_0xcf08('0xb7'),JSON[_0xcf08('0x23')](_0xc2f146));if(_0x1c8cf8[_0xcf08('0x7e')]['type']===_0xcf08('0x93')){return _0x18ce19[_0xcf08('0x2b')](_0x12dfe0)[_0xcf08('0xb8')](_0xcf08('0xb9'),_0xcf08('0xba'))['send'](_0xcf08('0xbb'));}else{return _0x18ce19[_0xcf08('0x2b')](_0x12dfe0)[_0xcf08('0x7b')](_0xc2f146);}}});})['catch'](handleError(_0x18ce19,null));};exports[_0xcf08('0x7a')]=function(_0x3774d2,_0x5f5b5b,_0x27552f){var _0x5b5c33,_0xdc61cd,_0x4de193;if(_[_0xcf08('0x99')](_0x3774d2[_0xcf08('0x55')][_0xcf08('0x55')])||_0x3774d2[_0xcf08('0x55')][_0xcf08('0x55')]===''){throw new db['Sequelize']['ValidationError'](_0xcf08('0x9c'));}if(_[_0xcf08('0x99')](_0x3774d2[_0xcf08('0x55')]['to'])){throw new db[(_0xcf08('0x9a'))][(_0xcf08('0x8c'))](_0xcf08('0xbc'));}_0x5b5c33=_0x3774d2[_0xcf08('0x55')]['to'];return db[_0xcf08('0x3d')][_0xcf08('0x58')]({'where':{'id':_0x3774d2[_0xcf08('0x52')]['id']},'include':[{'model':db[_0xcf08('0xa0')],'as':_0xcf08('0xbd'),'include':[{'model':db['CmContact'],'as':_0xcf08('0xa3'),'where':{'mobile':_0x5b5c33},'limit':0x1,'order':[[_0xcf08('0x8f'),_0xcf08('0xa1')]]}]}]})[_0xcf08('0x1e')](handleEntityNotFound(_0x5f5b5b,null))[_0xcf08('0x1e')](function(_0x36b036){if(_0x36b036&&_0x36b036[_0xcf08('0xbd')]){_0xdc61cd=_0x36b036[_0xcf08('0x34')]({'plain':!![]});if(_0xdc61cd[_0xcf08('0xbd')]&&_0xdc61cd[_0xcf08('0xbd')][_0xcf08('0xa3')][_0xcf08('0x53')]){return _0xdc61cd[_0xcf08('0xbd')][_0xcf08('0xa3')][0x0];}return db[_0xcf08('0x8b')][_0xcf08('0x54')](_[_0xcf08('0x19')](_0x3774d2['body'],{'firstName':_0x5b5c33,'mobile':_0x5b5c33,'phone':_0x5b5c33,'ListId':_0xdc61cd[_0xcf08('0x91')]}));}})[_0xcf08('0x1e')](handleEntityNotFound(_0x5f5b5b,null))[_0xcf08('0x1e')](function(_0x181982){if(_0x181982){_0x4de193=_0x181982;return db[_0xcf08('0xa5')][_0xcf08('0x58')]({'where':{'ContactId':_0x4de193['id'],'closed':![],'WhatsappAccountId':_0xdc61cd['id']}})[_0xcf08('0x1e')](function(_0x5eaeb7){if(_0x5eaeb7){return[_0x5eaeb7,![]];}return db[_0xcf08('0xa5')][_0xcf08('0x54')]({'UserId':_0x3774d2[_0xcf08('0x56')]['id'],'ContactId':_0x4de193['id'],'WhatsappAccountId':_0xdc61cd['id'],'phone':_0x5b5c33,'firstMsgDirection':'out','Messages':[_[_0xcf08('0x4b')](_0x3774d2[_0xcf08('0x55')],{'read':![],'body':_0x3774d2[_0xcf08('0x55')][_0xcf08('0x55')],'phone':_0x5b5c33,'WhatsappAccountId':_0xdc61cd['id'],'UserId':_0x3774d2['user']['id'],'ContactId':_0x4de193['id']})]},{'include':[{'model':db[_0xcf08('0x83')],'as':_0xcf08('0xbe')}]})[_0xcf08('0x1e')](function(_0x5c117a){return[_0x5c117a,!![]];});});}})[_0xcf08('0x6a')](function(_0x381dc7,_0x5676ab){if(_0x5676ab){return _0x381dc7;}return db['WhatsappMessage'][_0xcf08('0x54')](_[_0xcf08('0x4b')](_0x3774d2[_0xcf08('0x55')],{'read':![],'body':_0x3774d2[_0xcf08('0x55')][_0xcf08('0x55')],'phone':_0x5b5c33,'WhatsappAccountId':_0xdc61cd['id'],'WhatsappInteractionId':_0x381dc7['id'],'UserId':_0x3774d2[_0xcf08('0x56')]['id'],'ContactId':_0x4de193['id']}))[_0xcf08('0x1e')](function(_0x271932){_0x381dc7[_0xcf08('0xbf')]['Messages']=[];_0x381dc7[_0xcf08('0xbf')]['Messages']['push'](_0x271932['dataValues']);return _0x381dc7;});})['then'](respondWithResult(_0x5f5b5b,null))[_0xcf08('0x29')](handleError(_0x5f5b5b,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 3b0b05c..20fea02 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 _0x48a1=['hook','exports','events','WhatsappAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x5f5454,_0x3b4672){var _0x3c088b=function(_0x55bf5c){while(--_0x55bf5c){_0x5f5454['push'](_0x5f5454['shift']());}};_0x3c088b(++_0x3b4672);}(_0x48a1,0x1ec));var _0x148a=function(_0x526703,_0x4bf1f5){_0x526703=_0x526703-0x0;var _0x410f19=_0x48a1[_0x526703];return _0x410f19;};'use strict';var EventEmitter=require(_0x148a('0x0'));var WhatsappAccount=require('../../mysqldb')['db'][_0x148a('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x148a('0x2')](0x0);var events={'afterCreate':_0x148a('0x3'),'afterUpdate':_0x148a('0x4'),'afterDestroy':_0x148a('0x5')};function emitEvent(_0x106e19){return function(_0x6e222d,_0xf1148f,_0x66685f){WhatsappAccountEvents[_0x148a('0x6')](_0x106e19+':'+_0x6e222d['id'],_0x6e222d);WhatsappAccountEvents[_0x148a('0x6')](_0x106e19,_0x6e222d);_0x66685f(null);};}for(var e in events){if(events[_0x148a('0x7')](e)){var event=events[e];WhatsappAccount[_0x148a('0x8')](e,emitEvent(event));}}module[_0x148a('0x9')]=WhatsappAccountEvents; \ No newline at end of file +var _0xa2fe=['emit','hasOwnProperty','hook','exports','events','setMaxListeners','update','remove'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0xa2fe,0x94));var _0xea2f=function(_0x2d994d,_0x168a27){_0x2d994d=_0x2d994d-0x0;var _0xd54be4=_0xa2fe[_0x2d994d];return _0xd54be4;};'use strict';var EventEmitter=require(_0xea2f('0x0'));var WhatsappAccount=require('../../mysqldb')['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xea2f('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xea2f('0x2'),'afterDestroy':_0xea2f('0x3')};function emitEvent(_0x1eadc3){return function(_0x522eaf,_0x7fcc9,_0x16d65d){WhatsappAccountEvents[_0xea2f('0x4')](_0x1eadc3+':'+_0x522eaf['id'],_0x522eaf);WhatsappAccountEvents[_0xea2f('0x4')](_0x1eadc3,_0x522eaf);_0x16d65d(null);};}for(var e in events){if(events[_0xea2f('0x5')](e)){var event=events[e];WhatsappAccount[_0xea2f('0x6')](e,emitEvent(event));}}module[_0xea2f('0x7')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 3791530..4501227 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 _0x15f0=['WhatsappAccount','whatsapp_accounts','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappAccount.attributes','exports'];(function(_0x3289ed,_0x5c99d1){var _0x1880bd=function(_0x10564d){while(--_0x10564d){_0x3289ed['push'](_0x3289ed['shift']());}};_0x1880bd(++_0x5c99d1);}(_0x15f0,0x17b));var _0x015f=function(_0x259521,_0x286720){_0x259521=_0x259521-0x0;var _0x13a471=_0x15f0[_0x259521];return _0x13a471;};'use strict';var _=require(_0x015f('0x0'));var util=require('util');var logger=require(_0x015f('0x1'))(_0x015f('0x2'));var moment=require(_0x015f('0x3'));var BPromise=require(_0x015f('0x4'));var rp=require(_0x015f('0x5'));var fs=require('fs');var path=require(_0x015f('0x6'));var rimraf=require(_0x015f('0x7'));var config=require(_0x015f('0x8'));var attributes=require(_0x015f('0x9'));module[_0x015f('0xa')]=function(_0x4a5eb5,_0x222b40){return _0x4a5eb5['define'](_0x015f('0xb'),attributes,{'tableName':_0x015f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7758=['request-promise','path','rimraf','../../config/environment','./whatsappAccount.attributes','exports','define','whatsapp_accounts','util','api','moment','bluebird'];(function(_0x2c96f6,_0x877207){var _0x6d4808=function(_0x567e0c){while(--_0x567e0c){_0x2c96f6['push'](_0x2c96f6['shift']());}};_0x6d4808(++_0x877207);}(_0x7758,0xb0));var _0x8775=function(_0x3a43c1,_0x27e9ac){_0x3a43c1=_0x3a43c1-0x0;var _0x2c85f4=_0x7758[_0x3a43c1];return _0x2c85f4;};'use strict';var _=require('lodash');var util=require(_0x8775('0x0'));var logger=require('../../config/logger')(_0x8775('0x1'));var moment=require(_0x8775('0x2'));var BPromise=require(_0x8775('0x3'));var rp=require(_0x8775('0x4'));var fs=require('fs');var path=require(_0x8775('0x5'));var rimraf=require(_0x8775('0x6'));var config=require(_0x8775('0x7'));var attributes=require(_0x8775('0x8'));module[_0x8775('0x9')]=function(_0x2ed77c,_0x3105e2){return _0x2ed77c[_0x8775('0xa')]('WhatsappAccount',attributes,{'tableName':_0x8775('0xb'),'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 083ba1c..63f91c1 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 _0xe2b8=['result','catch','ShowWhatsappAccount','WhatsappAccount','find','raw','options','where','include','map','model','attributes','stringify','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./whatsappAccount.socket','register','then','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','code','message','info'];(function(_0x1252c6,_0x12beec){var _0x3b687e=function(_0x36607d){while(--_0x36607d){_0x1252c6['push'](_0x1252c6['shift']());}};_0x3b687e(++_0x12beec);}(_0xe2b8,0x189));var _0x8e2b=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xe2b8[_0x465a0c];return _0x1e202e;};'use strict';var _=require('lodash');var util=require(_0x8e2b('0x0'));var moment=require('moment');var BPromise=require(_0x8e2b('0x1'));var rs=require(_0x8e2b('0x2'));var fs=require('fs');var Redis=require(_0x8e2b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x8e2b('0x4'));var logger=require(_0x8e2b('0x5'))('rpc');var config=require(_0x8e2b('0x6'));var jayson=require(_0x8e2b('0x7'));var client=jayson[_0x8e2b('0x8')][_0x8e2b('0x9')]({'port':0x232a});config['redis']=_[_0x8e2b('0xa')](config[_0x8e2b('0xb')],{'host':_0x8e2b('0xc'),'port':0x18eb});var socket=require(_0x8e2b('0xd'))(new Redis(config[_0x8e2b('0xb')]));require(_0x8e2b('0xe'))[_0x8e2b('0xf')](socket);function respondWithRpcPromise(_0x1da433,_0x146f01,_0x1a45dd){return new BPromise(function(_0x289330,_0x2a89a5){return client['request'](_0x1da433,_0x1a45dd)[_0x8e2b('0x10')](function(_0x5e886d){logger['info'](_0x8e2b('0x11'),_0x146f01,_0x8e2b('0x12'));logger[_0x8e2b('0x13')](_0x8e2b('0x14'),_0x146f01,_0x8e2b('0x12'),JSON['stringify'](_0x5e886d));if(_0x5e886d[_0x8e2b('0x15')]){if(_0x5e886d[_0x8e2b('0x15')][_0x8e2b('0x16')]===0x1f4){logger[_0x8e2b('0x15')](_0x8e2b('0x11'),_0x146f01,_0x5e886d[_0x8e2b('0x15')]['message']);return _0x2a89a5(_0x5e886d[_0x8e2b('0x15')][_0x8e2b('0x17')]);}logger[_0x8e2b('0x15')](_0x8e2b('0x11'),_0x146f01,_0x5e886d['error'][_0x8e2b('0x17')]);return _0x289330(_0x5e886d[_0x8e2b('0x15')][_0x8e2b('0x17')]);}else{logger[_0x8e2b('0x18')](_0x8e2b('0x11'),_0x146f01,'request\x20sent');_0x289330(_0x5e886d[_0x8e2b('0x19')]['message']);}})[_0x8e2b('0x1a')](function(_0x4afb6f){logger[_0x8e2b('0x15')]('WhatsappAccount,\x20%s,\x20%s',_0x146f01,_0x4afb6f);_0x2a89a5(_0x4afb6f);});});}exports[_0x8e2b('0x1b')]=function(_0x2bcda0){var _0x24b2c1=this;return new Promise(function(_0x561e4a,_0x2dafc1){return db[_0x8e2b('0x1c')][_0x8e2b('0x1d')]({'raw':_0x2bcda0['options']?_0x2bcda0['options'][_0x8e2b('0x1e')]===undefined?!![]:![]:!![],'where':_0x2bcda0[_0x8e2b('0x1f')]?_0x2bcda0[_0x8e2b('0x1f')][_0x8e2b('0x20')]||null:null,'attributes':_0x2bcda0['options']?_0x2bcda0[_0x8e2b('0x1f')]['attributes']||null:null,'include':_0x2bcda0[_0x8e2b('0x1f')]?_0x2bcda0['options'][_0x8e2b('0x21')]?_[_0x8e2b('0x22')](_0x2bcda0['options'][_0x8e2b('0x21')],function(_0x3d8118){return{'model':db[_0x3d8118[_0x8e2b('0x23')]],'as':_0x3d8118['as'],'attributes':_0x3d8118[_0x8e2b('0x24')],'include':_0x3d8118[_0x8e2b('0x21')]?_[_0x8e2b('0x22')](_0x3d8118[_0x8e2b('0x21')],function(_0x1da8d0){return{'model':db[_0x1da8d0['model']],'as':_0x1da8d0['as'],'attributes':_0x1da8d0['attributes'],'include':_0x1da8d0[_0x8e2b('0x21')]?_[_0x8e2b('0x22')](_0x1da8d0['include'],function(_0x3139d3){return{'model':db[_0x3139d3[_0x8e2b('0x23')]],'as':_0x3139d3['as'],'attributes':_0x3139d3[_0x8e2b('0x24')]};}):[]};}):[]};}):[]:[]})[_0x8e2b('0x10')](function(_0x4f12a9){logger[_0x8e2b('0x18')]('ShowWhatsappAccount',_0x2bcda0);logger['debug'](_0x8e2b('0x1b'),_0x2bcda0,JSON[_0x8e2b('0x25')](_0x4f12a9));_0x561e4a(_0x4f12a9);})[_0x8e2b('0x1a')](function(_0x386c4f){logger[_0x8e2b('0x15')](_0x8e2b('0x1b'),_0x386c4f[_0x8e2b('0x17')],_0x2bcda0);_0x2dafc1(_0x24b2c1['error'](0x1f4,_0x386c4f['message']));});});}; \ No newline at end of file +var _0x4ad3=['attributes','map','include','model','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./whatsappAccount.socket','register','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowWhatsappAccount','WhatsappAccount','find','options','where'];(function(_0x55f251,_0x3e1f22){var _0x476c2c=function(_0x2e5fe4){while(--_0x2e5fe4){_0x55f251['push'](_0x55f251['shift']());}};_0x476c2c(++_0x3e1f22);}(_0x4ad3,0x1b1));var _0x34ad=function(_0x87b0ff,_0x314389){_0x87b0ff=_0x87b0ff-0x0;var _0x3bc0b2=_0x4ad3[_0x87b0ff];return _0x3bc0b2;};'use strict';var _=require(_0x34ad('0x0'));var util=require(_0x34ad('0x1'));var moment=require(_0x34ad('0x2'));var BPromise=require(_0x34ad('0x3'));var rs=require(_0x34ad('0x4'));var fs=require('fs');var Redis=require(_0x34ad('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x34ad('0x6'));var logger=require(_0x34ad('0x7'))(_0x34ad('0x8'));var config=require(_0x34ad('0x9'));var jayson=require(_0x34ad('0xa'));var client=jayson[_0x34ad('0xb')][_0x34ad('0xc')]({'port':0x232a});config[_0x34ad('0xd')]=_[_0x34ad('0xe')](config[_0x34ad('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x34ad('0xd')]));require(_0x34ad('0xf'))[_0x34ad('0x10')](socket);function respondWithRpcPromise(_0x1e1d8c,_0x56a16c,_0x43e756){return new BPromise(function(_0x126fe0,_0x3ba937){return client[_0x34ad('0x11')](_0x1e1d8c,_0x43e756)[_0x34ad('0x12')](function(_0x2c1d64){logger[_0x34ad('0x13')](_0x34ad('0x14'),_0x56a16c,_0x34ad('0x15'));logger[_0x34ad('0x16')](_0x34ad('0x17'),_0x56a16c,_0x34ad('0x15'),JSON[_0x34ad('0x18')](_0x2c1d64));if(_0x2c1d64[_0x34ad('0x19')]){if(_0x2c1d64[_0x34ad('0x19')][_0x34ad('0x1a')]===0x1f4){logger['error'](_0x34ad('0x14'),_0x56a16c,_0x2c1d64[_0x34ad('0x19')][_0x34ad('0x1b')]);return _0x3ba937(_0x2c1d64['error'][_0x34ad('0x1b')]);}logger[_0x34ad('0x19')](_0x34ad('0x14'),_0x56a16c,_0x2c1d64[_0x34ad('0x19')][_0x34ad('0x1b')]);return _0x126fe0(_0x2c1d64['error'][_0x34ad('0x1b')]);}else{logger['info'](_0x34ad('0x14'),_0x56a16c,_0x34ad('0x15'));_0x126fe0(_0x2c1d64[_0x34ad('0x1c')][_0x34ad('0x1b')]);}})[_0x34ad('0x1d')](function(_0x4b7f3e){logger[_0x34ad('0x19')](_0x34ad('0x14'),_0x56a16c,_0x4b7f3e);_0x3ba937(_0x4b7f3e);});});}exports[_0x34ad('0x1e')]=function(_0x15bf30){var _0x36b82f=this;return new Promise(function(_0xffdd2e,_0x3c178a){return db[_0x34ad('0x1f')][_0x34ad('0x20')]({'raw':_0x15bf30['options']?_0x15bf30[_0x34ad('0x21')]['raw']===undefined?!![]:![]:!![],'where':_0x15bf30[_0x34ad('0x21')]?_0x15bf30['options'][_0x34ad('0x22')]||null:null,'attributes':_0x15bf30[_0x34ad('0x21')]?_0x15bf30[_0x34ad('0x21')][_0x34ad('0x23')]||null:null,'include':_0x15bf30[_0x34ad('0x21')]?_0x15bf30[_0x34ad('0x21')]['include']?_[_0x34ad('0x24')](_0x15bf30['options'][_0x34ad('0x25')],function(_0x4bdad0){return{'model':db[_0x4bdad0['model']],'as':_0x4bdad0['as'],'attributes':_0x4bdad0[_0x34ad('0x23')],'include':_0x4bdad0[_0x34ad('0x25')]?_[_0x34ad('0x24')](_0x4bdad0[_0x34ad('0x25')],function(_0x17fc51){return{'model':db[_0x17fc51[_0x34ad('0x26')]],'as':_0x17fc51['as'],'attributes':_0x17fc51[_0x34ad('0x23')],'include':_0x17fc51[_0x34ad('0x25')]?_[_0x34ad('0x24')](_0x17fc51[_0x34ad('0x25')],function(_0x580ee5){return{'model':db[_0x580ee5[_0x34ad('0x26')]],'as':_0x580ee5['as'],'attributes':_0x580ee5[_0x34ad('0x23')]};}):[]};}):[]};}):[]:[]})[_0x34ad('0x12')](function(_0x31b880){logger[_0x34ad('0x13')](_0x34ad('0x1e'),_0x15bf30);logger[_0x34ad('0x16')](_0x34ad('0x1e'),_0x15bf30,JSON[_0x34ad('0x18')](_0x31b880));_0xffdd2e(_0x31b880);})[_0x34ad('0x1d')](function(_0x46e2a0){logger[_0x34ad('0x19')](_0x34ad('0x1e'),_0x46e2a0[_0x34ad('0x1b')],_0x15bf30);_0x3c178a(_0x36b82f[_0x34ad('0x19')](0x1f4,_0x46e2a0[_0x34ad('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 51f6f29..a64668f 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 _0x41f7=['./whatsappAccount.events','save','update','removeListener','register','whatsappAccount:'];(function(_0x3d2541,_0x9bedc7){var _0xa1ee40=function(_0x182d01){while(--_0x182d01){_0x3d2541['push'](_0x3d2541['shift']());}};_0xa1ee40(++_0x9bedc7);}(_0x41f7,0x1bc));var _0x741f=function(_0x55dfa2,_0x463df2){_0x55dfa2=_0x55dfa2-0x0;var _0x12308a=_0x41f7[_0x55dfa2];return _0x12308a;};'use strict';var WhatsappAccountEvents=require(_0x741f('0x0'));var events=[_0x741f('0x1'),'remove',_0x741f('0x2')];function createListener(_0x37f919,_0x28db03){return function(_0x4c64de){_0x28db03['emit'](_0x37f919,_0x4c64de);};}function removeListener(_0x2b922b,_0x222e22){return function(){WhatsappAccountEvents[_0x741f('0x3')](_0x2b922b,_0x222e22);};}exports[_0x741f('0x4')]=function(_0x403a13){for(var _0x252d0c=0x0,_0xa2bc14=events['length'];_0x252d0c<_0xa2bc14;_0x252d0c++){var _0x38c3f9=events[_0x252d0c];var _0x1c568d=createListener(_0x741f('0x5')+_0x38c3f9,_0x403a13);WhatsappAccountEvents['on'](_0x38c3f9,_0x1c568d);}}; \ No newline at end of file +var _0xee00=['update','emit','removeListener','register','whatsappAccount:','./whatsappAccount.events','save','remove'];(function(_0x9dfcd5,_0x228d83){var _0x5345a1=function(_0x3bf3e3){while(--_0x3bf3e3){_0x9dfcd5['push'](_0x9dfcd5['shift']());}};_0x5345a1(++_0x228d83);}(_0xee00,0x16d));var _0x0ee0=function(_0x57f912,_0x26ae3b){_0x57f912=_0x57f912-0x0;var _0x456d61=_0xee00[_0x57f912];return _0x456d61;};'use strict';var WhatsappAccountEvents=require(_0x0ee0('0x0'));var events=[_0x0ee0('0x1'),_0x0ee0('0x2'),_0x0ee0('0x3')];function createListener(_0x5881e4,_0x2f623c){return function(_0xbad386){_0x2f623c[_0x0ee0('0x4')](_0x5881e4,_0xbad386);};}function removeListener(_0xd3bdd1,_0x4dc611){return function(){WhatsappAccountEvents[_0x0ee0('0x5')](_0xd3bdd1,_0x4dc611);};}exports[_0x0ee0('0x6')]=function(_0x3875f1){for(var _0x28badf=0x0,_0x1aabd1=events['length'];_0x28badf<_0x1aabd1;_0x28badf++){var _0x465ec9=events[_0x28badf];var _0x27c54d=createListener(_0x0ee0('0x7')+_0x465ec9,_0x3875f1);WhatsappAccountEvents['on'](_0x465ec9,_0x27c54d);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index f8d1f9e..209269b 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 _0x64ec=['isAuthenticated','index','/:id','show','post','create','put','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get'];(function(_0x5608df,_0xff2326){var _0x4c2e63=function(_0xec1440){while(--_0xec1440){_0x5608df['push'](_0x5608df['shift']());}};_0x4c2e63(++_0xff2326);}(_0x64ec,0xa9));var _0xc64e=function(_0x3b5796,_0x4a3549){_0x3b5796=_0x3b5796-0x0;var _0x3cc3c7=_0x64ec[_0x3b5796];return _0x3cc3c7;};'use strict';var multer=require(_0xc64e('0x0'));var util=require(_0xc64e('0x1'));var path=require(_0xc64e('0x2'));var timeout=require(_0xc64e('0x3'));var express=require(_0xc64e('0x4'));var router=express[_0xc64e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc64e('0x6'));var interaction=require(_0xc64e('0x7'));var config=require(_0xc64e('0x8'));var controller=require(_0xc64e('0x9'));router[_0xc64e('0xa')]('/',auth[_0xc64e('0xb')](),controller[_0xc64e('0xc')]);router['get'](_0xc64e('0xd'),auth[_0xc64e('0xb')](),controller[_0xc64e('0xe')]);router[_0xc64e('0xf')]('/',auth[_0xc64e('0xb')](),controller[_0xc64e('0x10')]);router[_0xc64e('0x11')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xc64e('0x12')](_0xc64e('0xd'),auth[_0xc64e('0xb')](),controller['destroy']);module[_0xc64e('0x13')]=router; \ No newline at end of file +var _0x1b46=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','isAuthenticated','index','post','create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0x672050,_0x4525b1){var _0x3ef28a=function(_0x472880){while(--_0x472880){_0x672050['push'](_0x672050['shift']());}};_0x3ef28a(++_0x4525b1);}(_0x1b46,0xb9));var _0x61b4=function(_0x2ea200,_0x325887){_0x2ea200=_0x2ea200-0x0;var _0xe69240=_0x1b46[_0x2ea200];return _0xe69240;};'use strict';var multer=require(_0x61b4('0x0'));var util=require(_0x61b4('0x1'));var path=require(_0x61b4('0x2'));var timeout=require(_0x61b4('0x3'));var express=require(_0x61b4('0x4'));var router=express[_0x61b4('0x5')]();var fs_extra=require(_0x61b4('0x6'));var auth=require(_0x61b4('0x7'));var interaction=require(_0x61b4('0x8'));var config=require(_0x61b4('0x9'));var controller=require(_0x61b4('0xa'));router[_0x61b4('0xb')]('/',auth[_0x61b4('0xc')](),controller[_0x61b4('0xd')]);router[_0x61b4('0xb')]('/:id',auth[_0x61b4('0xc')](),controller['show']);router[_0x61b4('0xe')]('/',auth['isAuthenticated'](),controller[_0x61b4('0xf')]);router[_0x61b4('0x10')](_0x61b4('0x11'),auth[_0x61b4('0xc')](),controller[_0x61b4('0x12')]);router[_0x61b4('0x13')]('/:id',auth[_0x61b4('0xc')](),controller[_0x61b4('0x14')]);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 d5d2e40..421eb6a 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 _0x6b9a=['noop','TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x5cd376,_0x163789){var _0x57de74=function(_0x3e56c9){while(--_0x3e56c9){_0x5cd376['push'](_0x5cd376['shift']());}};_0x57de74(++_0x163789);}(_0x6b9a,0x153));var _0xa6b9=function(_0x2e2e9f,_0x4aafb1){_0x2e2e9f=_0x2e2e9f-0x0;var _0x652c49=_0x6b9a[_0x2e2e9f];return _0x652c49;};'use strict';var Sequelize=require(_0xa6b9('0x0'));module[_0xa6b9('0x1')]={'priority':{'type':Sequelize[_0xa6b9('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xa6b9('0x3')],'allowNull':![],'defaultValue':_0xa6b9('0x4')},'appdata':{'type':Sequelize[_0xa6b9('0x5')]()},'description':{'type':Sequelize[_0xa6b9('0x3')]},'interval':{'type':Sequelize[_0xa6b9('0x3')],'defaultValue':_0xa6b9('0x6')}}; \ No newline at end of file +var _0x2fa6=['STRING','noop','TEXT','sequelize','exports','INTEGER'];(function(_0x5a219d,_0x31f60f){var _0x4ba8a5=function(_0x59c63f){while(--_0x59c63f){_0x5a219d['push'](_0x5a219d['shift']());}};_0x4ba8a5(++_0x31f60f);}(_0x2fa6,0xb7));var _0x62fa=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x2fa6[_0x432682];return _0x463d05;};'use strict';var Sequelize=require(_0x62fa('0x0'));module[_0x62fa('0x1')]={'priority':{'type':Sequelize[_0x62fa('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x62fa('0x3')],'allowNull':![],'defaultValue':_0x62fa('0x4')},'appdata':{'type':Sequelize[_0x62fa('0x5')]()},'description':{'type':Sequelize[_0x62fa('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 812a594..fe989d3 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 _0xc2a2=['ejs','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','save','update','then','destroy','error','stack','name','index','map','WhatsappApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','create','body','params','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv'];(function(_0x178a72,_0x5014f2){var _0x2e11ab=function(_0x46dbdd){while(--_0x46dbdd){_0x178a72['push'](_0x178a72['shift']());}};_0x2e11ab(++_0x5014f2);}(_0xc2a2,0x84));var _0x2c2a=function(_0xd1c4,_0x189b6f){_0xd1c4=_0xd1c4-0x0;var _0x2f2375=_0xc2a2[_0xd1c4];return _0x2f2375;};'use strict';var emlformat=require(_0x2c2a('0x0'));var rimraf=require(_0x2c2a('0x1'));var zipdir=require(_0x2c2a('0x2'));var jsonpatch=require(_0x2c2a('0x3'));var rp=require('request-promise');var moment=require(_0x2c2a('0x4'));var BPromise=require(_0x2c2a('0x5'));var Mustache=require(_0x2c2a('0x6'));var util=require('util');var path=require(_0x2c2a('0x7'));var sox=require(_0x2c2a('0x8'));var csv=require(_0x2c2a('0x9'));var ejs=require(_0x2c2a('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2c2a('0xb'));var toCsv=require('to-csv');var querystring=require(_0x2c2a('0xc'));var Papa=require('papaparse');var Redis=require(_0x2c2a('0xd'));var authService=require(_0x2c2a('0xe'));var qs=require(_0x2c2a('0xf'));var as=require(_0x2c2a('0x10'));var hardwareService=require(_0x2c2a('0x11'));var logger=require(_0x2c2a('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x2c2a('0x13'));var licenseUtil=require(_0x2c2a('0x14'));var db=require(_0x2c2a('0x15'))['db'];function respondWithStatusCode(_0xbfd5c3,_0x3ec5de){_0x3ec5de=_0x3ec5de||0xcc;return function(_0x29d19f){if(_0x29d19f){return _0xbfd5c3['sendStatus'](_0x3ec5de);}return _0xbfd5c3[_0x2c2a('0x16')](_0x3ec5de)[_0x2c2a('0x17')]();};}function respondWithResult(_0x50e4d0,_0x11cb43){_0x11cb43=_0x11cb43||0xc8;return function(_0x4caf5f){if(_0x4caf5f){return _0x50e4d0[_0x2c2a('0x16')](_0x11cb43)['json'](_0x4caf5f);}};}function respondWithFilteredResult(_0x430898,_0x40051f){return function(_0x523692){if(_0x523692){var _0x10b98e=typeof _0x40051f[_0x2c2a('0x18')]===_0x2c2a('0x19')&&typeof _0x40051f[_0x2c2a('0x1a')]===_0x2c2a('0x19');var _0x14486f=_0x523692['count'];var _0x53fe55=_0x10b98e?0x0:_0x40051f[_0x2c2a('0x18')];var _0x4a1382=_0x10b98e?_0x523692[_0x2c2a('0x1b')]:_0x40051f[_0x2c2a('0x18')]+_0x40051f[_0x2c2a('0x1a')];var _0x2120ab;if(_0x4a1382>=_0x14486f){_0x4a1382=_0x14486f;_0x2120ab=0xc8;}else{_0x2120ab=0xce;}_0x430898[_0x2c2a('0x16')](_0x2120ab);return _0x430898[_0x2c2a('0x1c')](_0x2c2a('0x1d'),_0x53fe55+'-'+_0x4a1382+'/'+_0x14486f)[_0x2c2a('0x1e')](_0x523692);}return null;};}function patchUpdates(_0xc1fec5){return function(_0xd991e9){try{jsonpatch['apply'](_0xd991e9,_0xc1fec5,!![]);}catch(_0x1896f2){return BPromise['reject'](_0x1896f2);}return _0xd991e9[_0x2c2a('0x1f')]();};}function saveUpdates(_0x3bf453,_0x5c2e06){return function(_0x36927b){if(_0x36927b){return _0x36927b[_0x2c2a('0x20')](_0x3bf453)[_0x2c2a('0x21')](function(_0x5a8ad3){return _0x5a8ad3;});}return null;};}function removeEntity(_0x2842f9,_0x25788b){return function(_0x385266){if(_0x385266){return _0x385266[_0x2c2a('0x22')]()[_0x2c2a('0x21')](function(){_0x2842f9[_0x2c2a('0x16')](0xcc)[_0x2c2a('0x17')]();});}};}function handleEntityNotFound(_0x459aee,_0x4d80ce){return function(_0x5d6597){if(!_0x5d6597){_0x459aee['sendStatus'](0x194);}return _0x5d6597;};}function handleError(_0x5b0530,_0x35f048){_0x35f048=_0x35f048||0x1f4;return function(_0xccbae4){logger[_0x2c2a('0x23')](_0xccbae4[_0x2c2a('0x24')]);if(_0xccbae4[_0x2c2a('0x25')]){delete _0xccbae4[_0x2c2a('0x25')];}_0x5b0530['status'](_0x35f048)['send'](_0xccbae4);};}exports[_0x2c2a('0x26')]=function(_0x1d907f,_0x10e371){var _0x27dc1b={},_0x5c2fbb={},_0xe8bd4b={'count':0x0,'rows':[]};var _0x735b1b=_[_0x2c2a('0x27')](db[_0x2c2a('0x28')][_0x2c2a('0x29')],function(_0x2fcd8b){return{'name':_0x2fcd8b[_0x2c2a('0x2a')],'type':_0x2fcd8b[_0x2c2a('0x2b')][_0x2c2a('0x2c')]};});_0x5c2fbb[_0x2c2a('0x2d')]=_[_0x2c2a('0x27')](_0x735b1b,_0x2c2a('0x25'));_0x5c2fbb[_0x2c2a('0x2e')]=_[_0x2c2a('0x2f')](_0x1d907f['query']);_0x5c2fbb[_0x2c2a('0x30')]=_[_0x2c2a('0x31')](_0x5c2fbb[_0x2c2a('0x2d')],_0x5c2fbb[_0x2c2a('0x2e')]);_0x27dc1b[_0x2c2a('0x32')]=_['intersection'](_0x5c2fbb[_0x2c2a('0x2d')],qs[_0x2c2a('0x33')](_0x1d907f['query'][_0x2c2a('0x33')]));_0x27dc1b['attributes']=_0x27dc1b[_0x2c2a('0x32')][_0x2c2a('0x34')]?_0x27dc1b[_0x2c2a('0x32')]:_0x5c2fbb[_0x2c2a('0x2d')];if(!_0x1d907f[_0x2c2a('0x2e')][_0x2c2a('0x35')](_0x2c2a('0x36'))){_0x27dc1b['limit']=qs[_0x2c2a('0x1a')](_0x1d907f[_0x2c2a('0x2e')][_0x2c2a('0x1a')]);_0x27dc1b['offset']=qs['offset'](_0x1d907f[_0x2c2a('0x2e')]['offset']);}_0x27dc1b[_0x2c2a('0x37')]=qs[_0x2c2a('0x38')](_0x1d907f[_0x2c2a('0x2e')][_0x2c2a('0x38')]);_0x27dc1b[_0x2c2a('0x39')]=qs['filters'](_[_0x2c2a('0x3a')](_0x1d907f[_0x2c2a('0x2e')],_0x5c2fbb[_0x2c2a('0x30')]),_0x735b1b);if(_0x1d907f[_0x2c2a('0x2e')][_0x2c2a('0x3b')]){_0x27dc1b[_0x2c2a('0x39')]=_[_0x2c2a('0x3c')](_0x27dc1b[_0x2c2a('0x39')],{'$or':_[_0x2c2a('0x27')](_0x735b1b,function(_0x16814a){if(_0x16814a['type']!=='VIRTUAL'){var _0x40dce6={};_0x40dce6[_0x16814a[_0x2c2a('0x25')]]={'$like':'%'+_0x1d907f[_0x2c2a('0x2e')][_0x2c2a('0x3b')]+'%'};return _0x40dce6;}})});}_0x27dc1b=_[_0x2c2a('0x3c')]({},_0x27dc1b,_0x1d907f[_0x2c2a('0x3d')]);var _0x5d4fc4={'where':_0x27dc1b['where']};return db[_0x2c2a('0x28')][_0x2c2a('0x1b')](_0x5d4fc4)[_0x2c2a('0x21')](function(_0x42d135){_0xe8bd4b[_0x2c2a('0x1b')]=_0x42d135;if(_0x1d907f[_0x2c2a('0x2e')][_0x2c2a('0x3e')]){_0x27dc1b[_0x2c2a('0x3f')]=[{'all':!![]}];}return db[_0x2c2a('0x28')][_0x2c2a('0x40')](_0x27dc1b);})['then'](function(_0x87a74){_0xe8bd4b['rows']=_0x87a74;return _0xe8bd4b;})[_0x2c2a('0x21')](respondWithFilteredResult(_0x10e371,_0x27dc1b))[_0x2c2a('0x41')](handleError(_0x10e371,null));};exports[_0x2c2a('0x42')]=function(_0x381b6d,_0x486d23){var _0x2a53a0={'raw':!![],'where':{'id':_0x381b6d['params']['id']}},_0x1321b0={};_0x1321b0[_0x2c2a('0x2d')]=_[_0x2c2a('0x2f')](db[_0x2c2a('0x28')][_0x2c2a('0x29')]);_0x1321b0[_0x2c2a('0x2e')]=_[_0x2c2a('0x2f')](_0x381b6d[_0x2c2a('0x2e')]);_0x1321b0[_0x2c2a('0x30')]=_['intersection'](_0x1321b0['model'],_0x1321b0[_0x2c2a('0x2e')]);_0x2a53a0['attributes']=_[_0x2c2a('0x31')](_0x1321b0['model'],qs[_0x2c2a('0x33')](_0x381b6d['query'][_0x2c2a('0x33')]));_0x2a53a0[_0x2c2a('0x32')]=_0x2a53a0[_0x2c2a('0x32')][_0x2c2a('0x34')]?_0x2a53a0['attributes']:_0x1321b0['model'];if(_0x381b6d[_0x2c2a('0x2e')]['includeAll']){_0x2a53a0[_0x2c2a('0x3f')]=[{'all':!![]}];}_0x2a53a0=_['merge']({},_0x2a53a0,_0x381b6d[_0x2c2a('0x3d')]);return db[_0x2c2a('0x28')]['find'](_0x2a53a0)[_0x2c2a('0x21')](handleEntityNotFound(_0x486d23,null))[_0x2c2a('0x21')](respondWithResult(_0x486d23,null))['catch'](handleError(_0x486d23,null));};exports['create']=function(_0x3e9e3d,_0x4d45f9){return db[_0x2c2a('0x28')][_0x2c2a('0x43')](_0x3e9e3d[_0x2c2a('0x44')],{})[_0x2c2a('0x21')](respondWithResult(_0x4d45f9,0xc9))['catch'](handleError(_0x4d45f9,null));};exports['update']=function(_0xbe97dc,_0xac03d9){if(_0xbe97dc[_0x2c2a('0x44')]['id']){delete _0xbe97dc[_0x2c2a('0x44')]['id'];}return db['WhatsappApplication']['find']({'where':{'id':_0xbe97dc[_0x2c2a('0x45')]['id']}})['then'](handleEntityNotFound(_0xac03d9,null))[_0x2c2a('0x21')](saveUpdates(_0xbe97dc['body'],null))[_0x2c2a('0x21')](respondWithResult(_0xac03d9,null))[_0x2c2a('0x41')](handleError(_0xac03d9,null));};exports['destroy']=function(_0x4e2602,_0x350e9d){return db[_0x2c2a('0x28')][_0x2c2a('0x46')]({'where':{'id':_0x4e2602[_0x2c2a('0x45')]['id']}})['then'](handleEntityNotFound(_0x350e9d,null))[_0x2c2a('0x21')](removeEntity(_0x350e9d,null))['catch'](handleError(_0x350e9d,null));}; \ No newline at end of file +var _0x5a13=['fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','include','find','create','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','map','WhatsappApplication','rawAttributes'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x5a13,0x145));var _0x35a1=function(_0x17d074,_0x3aa349){_0x17d074=_0x17d074-0x0;var _0x368f1f=_0x5a13[_0x17d074];return _0x368f1f;};'use strict';var emlformat=require(_0x35a1('0x0'));var rimraf=require(_0x35a1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x35a1('0x2'));var rp=require(_0x35a1('0x3'));var moment=require(_0x35a1('0x4'));var BPromise=require(_0x35a1('0x5'));var Mustache=require(_0x35a1('0x6'));var util=require(_0x35a1('0x7'));var path=require(_0x35a1('0x8'));var sox=require(_0x35a1('0x9'));var csv=require(_0x35a1('0xa'));var ejs=require(_0x35a1('0xb'));var fs=require('fs');var fs_extra=require(_0x35a1('0xc'));var _=require(_0x35a1('0xd'));var squel=require(_0x35a1('0xe'));var crypto=require(_0x35a1('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x35a1('0x10'));var Papa=require(_0x35a1('0x11'));var Redis=require('ioredis');var authService=require(_0x35a1('0x12'));var qs=require(_0x35a1('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x35a1('0x14'))(_0x35a1('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x35a1('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x386db9,_0x572c66){_0x572c66=_0x572c66||0xcc;return function(_0x21098a){if(_0x21098a){return _0x386db9[_0x35a1('0x17')](_0x572c66);}return _0x386db9[_0x35a1('0x18')](_0x572c66)[_0x35a1('0x19')]();};}function respondWithResult(_0x1f57bf,_0xa149d0){_0xa149d0=_0xa149d0||0xc8;return function(_0x20d868){if(_0x20d868){return _0x1f57bf[_0x35a1('0x18')](_0xa149d0)[_0x35a1('0x1a')](_0x20d868);}};}function respondWithFilteredResult(_0xff0405,_0x366df0){return function(_0x41939f){if(_0x41939f){var _0x2f93be=typeof _0x366df0[_0x35a1('0x1b')]===_0x35a1('0x1c')&&typeof _0x366df0[_0x35a1('0x1d')]===_0x35a1('0x1c');var _0x2b22b4=_0x41939f[_0x35a1('0x1e')];var _0x1de373=_0x2f93be?0x0:_0x366df0['offset'];var _0x3b17dc=_0x2f93be?_0x41939f[_0x35a1('0x1e')]:_0x366df0[_0x35a1('0x1b')]+_0x366df0[_0x35a1('0x1d')];var _0x2a9df3;if(_0x3b17dc>=_0x2b22b4){_0x3b17dc=_0x2b22b4;_0x2a9df3=0xc8;}else{_0x2a9df3=0xce;}_0xff0405[_0x35a1('0x18')](_0x2a9df3);return _0xff0405[_0x35a1('0x1f')](_0x35a1('0x20'),_0x1de373+'-'+_0x3b17dc+'/'+_0x2b22b4)[_0x35a1('0x1a')](_0x41939f);}return null;};}function patchUpdates(_0x5929e5){return function(_0x473186){try{jsonpatch[_0x35a1('0x21')](_0x473186,_0x5929e5,!![]);}catch(_0x5ddd25){return BPromise[_0x35a1('0x22')](_0x5ddd25);}return _0x473186[_0x35a1('0x23')]();};}function saveUpdates(_0x5433d7,_0xc13bad){return function(_0x5a1742){if(_0x5a1742){return _0x5a1742[_0x35a1('0x24')](_0x5433d7)[_0x35a1('0x25')](function(_0x329054){return _0x329054;});}return null;};}function removeEntity(_0x5e42cf,_0x1ced16){return function(_0x2b87a1){if(_0x2b87a1){return _0x2b87a1['destroy']()['then'](function(){_0x5e42cf['status'](0xcc)[_0x35a1('0x19')]();});}};}function handleEntityNotFound(_0x51f5bd,_0x5408a7){return function(_0x52d22b){if(!_0x52d22b){_0x51f5bd[_0x35a1('0x17')](0x194);}return _0x52d22b;};}function handleError(_0x288a0d,_0x39248b){_0x39248b=_0x39248b||0x1f4;return function(_0x3f1563){logger['error'](_0x3f1563[_0x35a1('0x26')]);if(_0x3f1563[_0x35a1('0x27')]){delete _0x3f1563[_0x35a1('0x27')];}_0x288a0d[_0x35a1('0x18')](_0x39248b)[_0x35a1('0x28')](_0x3f1563);};}exports[_0x35a1('0x29')]=function(_0x3d3453,_0x24bb2d){var _0x243841={},_0x381bcc={},_0x83a000={'count':0x0,'rows':[]};var _0x384a8e=_[_0x35a1('0x2a')](db[_0x35a1('0x2b')][_0x35a1('0x2c')],function(_0x4b74b3){return{'name':_0x4b74b3[_0x35a1('0x2d')],'type':_0x4b74b3[_0x35a1('0x2e')][_0x35a1('0x2f')]};});_0x381bcc[_0x35a1('0x30')]=_[_0x35a1('0x2a')](_0x384a8e,_0x35a1('0x27'));_0x381bcc[_0x35a1('0x31')]=_[_0x35a1('0x32')](_0x3d3453[_0x35a1('0x31')]);_0x381bcc[_0x35a1('0x33')]=_[_0x35a1('0x34')](_0x381bcc['model'],_0x381bcc['query']);_0x243841[_0x35a1('0x35')]=_['intersection'](_0x381bcc[_0x35a1('0x30')],qs['fields'](_0x3d3453[_0x35a1('0x31')][_0x35a1('0x36')]));_0x243841[_0x35a1('0x35')]=_0x243841[_0x35a1('0x35')][_0x35a1('0x37')]?_0x243841[_0x35a1('0x35')]:_0x381bcc[_0x35a1('0x30')];if(!_0x3d3453[_0x35a1('0x31')][_0x35a1('0x38')](_0x35a1('0x39'))){_0x243841[_0x35a1('0x1d')]=qs['limit'](_0x3d3453[_0x35a1('0x31')][_0x35a1('0x1d')]);_0x243841[_0x35a1('0x1b')]=qs['offset'](_0x3d3453['query']['offset']);}_0x243841['order']=qs['sort'](_0x3d3453['query'][_0x35a1('0x3a')]);_0x243841[_0x35a1('0x3b')]=qs[_0x35a1('0x33')](_[_0x35a1('0x3c')](_0x3d3453[_0x35a1('0x31')],_0x381bcc[_0x35a1('0x33')]),_0x384a8e);if(_0x3d3453[_0x35a1('0x31')][_0x35a1('0x3d')]){_0x243841['where']=_[_0x35a1('0x3e')](_0x243841['where'],{'$or':_[_0x35a1('0x2a')](_0x384a8e,function(_0x1a034e){if(_0x1a034e[_0x35a1('0x2e')]!==_0x35a1('0x3f')){var _0x25ed31={};_0x25ed31[_0x1a034e['name']]={'$like':'%'+_0x3d3453[_0x35a1('0x31')][_0x35a1('0x3d')]+'%'};return _0x25ed31;}})});}_0x243841=_[_0x35a1('0x3e')]({},_0x243841,_0x3d3453['options']);var _0x599295={'where':_0x243841[_0x35a1('0x3b')]};return db[_0x35a1('0x2b')][_0x35a1('0x1e')](_0x599295)[_0x35a1('0x25')](function(_0x482ce7){_0x83a000[_0x35a1('0x1e')]=_0x482ce7;if(_0x3d3453['query'][_0x35a1('0x40')]){_0x243841['include']=[{'all':!![]}];}return db[_0x35a1('0x2b')][_0x35a1('0x41')](_0x243841);})['then'](function(_0x51eaaf){_0x83a000[_0x35a1('0x42')]=_0x51eaaf;return _0x83a000;})['then'](respondWithFilteredResult(_0x24bb2d,_0x243841))[_0x35a1('0x43')](handleError(_0x24bb2d,null));};exports[_0x35a1('0x44')]=function(_0x541d6a,_0x3522c3){var _0x502695={'raw':!![],'where':{'id':_0x541d6a['params']['id']}},_0xb1c14c={};_0xb1c14c[_0x35a1('0x30')]=_['keys'](db[_0x35a1('0x2b')]['rawAttributes']);_0xb1c14c[_0x35a1('0x31')]=_['keys'](_0x541d6a[_0x35a1('0x31')]);_0xb1c14c[_0x35a1('0x33')]=_[_0x35a1('0x34')](_0xb1c14c[_0x35a1('0x30')],_0xb1c14c[_0x35a1('0x31')]);_0x502695[_0x35a1('0x35')]=_[_0x35a1('0x34')](_0xb1c14c['model'],qs[_0x35a1('0x36')](_0x541d6a[_0x35a1('0x31')][_0x35a1('0x36')]));_0x502695[_0x35a1('0x35')]=_0x502695[_0x35a1('0x35')][_0x35a1('0x37')]?_0x502695['attributes']:_0xb1c14c[_0x35a1('0x30')];if(_0x541d6a[_0x35a1('0x31')][_0x35a1('0x40')]){_0x502695[_0x35a1('0x45')]=[{'all':!![]}];}_0x502695=_[_0x35a1('0x3e')]({},_0x502695,_0x541d6a['options']);return db[_0x35a1('0x2b')][_0x35a1('0x46')](_0x502695)[_0x35a1('0x25')](handleEntityNotFound(_0x3522c3,null))[_0x35a1('0x25')](respondWithResult(_0x3522c3,null))['catch'](handleError(_0x3522c3,null));};exports[_0x35a1('0x47')]=function(_0xc0f5f2,_0x1c1e24){return db[_0x35a1('0x2b')][_0x35a1('0x47')](_0xc0f5f2[_0x35a1('0x48')],{})[_0x35a1('0x25')](respondWithResult(_0x1c1e24,0xc9))['catch'](handleError(_0x1c1e24,null));};exports['update']=function(_0x16092f,_0x34805f){if(_0x16092f[_0x35a1('0x48')]['id']){delete _0x16092f[_0x35a1('0x48')]['id'];}return db['WhatsappApplication']['find']({'where':{'id':_0x16092f[_0x35a1('0x49')]['id']}})[_0x35a1('0x25')](handleEntityNotFound(_0x34805f,null))[_0x35a1('0x25')](saveUpdates(_0x16092f[_0x35a1('0x48')],null))['then'](respondWithResult(_0x34805f,null))['catch'](handleError(_0x34805f,null));};exports['destroy']=function(_0x256d48,_0x5d7f55){return db[_0x35a1('0x2b')][_0x35a1('0x46')]({'where':{'id':_0x256d48[_0x35a1('0x49')]['id']}})[_0x35a1('0x25')](handleEntityNotFound(_0x5d7f55,null))[_0x35a1('0x25')](removeEntity(_0x5d7f55,null))[_0x35a1('0x43')](handleError(_0x5d7f55,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 1778c0b..12f156f 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 _0xf5a7=['../../config/environment','./whatsappApplication.attributes','exports','define','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x29908c,_0x78229e){var _0x5be33f=function(_0x454a60){while(--_0x454a60){_0x29908c['push'](_0x29908c['shift']());}};_0x5be33f(++_0x78229e);}(_0xf5a7,0x133));var _0x7f5a=function(_0x59ba00,_0x277f4e){_0x59ba00=_0x59ba00-0x0;var _0x948c2e=_0xf5a7[_0x59ba00];return _0x948c2e;};'use strict';var _=require(_0x7f5a('0x0'));var util=require(_0x7f5a('0x1'));var logger=require('../../config/logger')(_0x7f5a('0x2'));var moment=require(_0x7f5a('0x3'));var BPromise=require(_0x7f5a('0x4'));var rp=require(_0x7f5a('0x5'));var fs=require('fs');var path=require(_0x7f5a('0x6'));var rimraf=require(_0x7f5a('0x7'));var config=require(_0x7f5a('0x8'));var attributes=require(_0x7f5a('0x9'));module[_0x7f5a('0xa')]=function(_0x520bf9,_0x2808f2){return _0x520bf9[_0x7f5a('0xb')]('WhatsappApplication',attributes,{'tableName':_0x7f5a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7f5a('0xd'),'collate':_0x7f5a('0xe')});}; \ No newline at end of file +var _0x84ab=['exports','WhatsappApplication','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./whatsappApplication.attributes'];(function(_0xf7cd57,_0x25be8b){var _0x83e3ea=function(_0x56a612){while(--_0x56a612){_0xf7cd57['push'](_0xf7cd57['shift']());}};_0x83e3ea(++_0x25be8b);}(_0x84ab,0x12f));var _0xb84a=function(_0x57975f,_0x388556){_0x57975f=_0x57975f-0x0;var _0x4793b8=_0x84ab[_0x57975f];return _0x4793b8;};'use strict';var _=require(_0xb84a('0x0'));var util=require(_0xb84a('0x1'));var logger=require(_0xb84a('0x2'))(_0xb84a('0x3'));var moment=require(_0xb84a('0x4'));var BPromise=require('bluebird');var rp=require(_0xb84a('0x5'));var fs=require('fs');var path=require(_0xb84a('0x6'));var rimraf=require('rimraf');var config=require(_0xb84a('0x7'));var attributes=require(_0xb84a('0x8'));module[_0xb84a('0x9')]=function(_0x5b9def,_0x521a64){return _0x5b9def['define'](_0xb84a('0xa'),attributes,{'tableName':'whatsapp_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb84a('0xb'),'collate':_0xb84a('0xc')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 4865244..f923d9e 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 _0x6f0d=['WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent'];(function(_0x36b32e,_0x140771){var _0x53257a=function(_0x1ea32a){while(--_0x1ea32a){_0x36b32e['push'](_0x36b32e['shift']());}};_0x53257a(++_0x140771);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x2279b2,_0x35da75){_0x2279b2=_0x2279b2-0x0;var _0x56eb82=_0x6f0d[_0x2279b2];return _0x56eb82;};'use strict';var _=require('lodash');var util=require(_0xd6f0('0x0'));var moment=require(_0xd6f0('0x1'));var BPromise=require(_0xd6f0('0x2'));var rs=require(_0xd6f0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd6f0('0x4'))['db'];var utils=require(_0xd6f0('0x5'));var logger=require(_0xd6f0('0x6'))(_0xd6f0('0x7'));var config=require(_0xd6f0('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd6f0('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe21ac4,_0x1af29c,_0x8b89a9){return new BPromise(function(_0x1a48a0,_0x4c4916){return client['request'](_0xe21ac4,_0x8b89a9)[_0xd6f0('0xa')](function(_0x272c4e){logger[_0xd6f0('0xb')](_0xd6f0('0xc'),_0x1af29c,_0xd6f0('0xd'));logger['debug'](_0xd6f0('0xe'),_0x1af29c,_0xd6f0('0xd'),JSON[_0xd6f0('0xf')](_0x272c4e));if(_0x272c4e[_0xd6f0('0x10')]){if(_0x272c4e['error'][_0xd6f0('0x11')]===0x1f4){logger[_0xd6f0('0x10')](_0xd6f0('0xc'),_0x1af29c,_0x272c4e[_0xd6f0('0x10')][_0xd6f0('0x12')]);return _0x4c4916(_0x272c4e[_0xd6f0('0x10')][_0xd6f0('0x12')]);}logger[_0xd6f0('0x10')](_0xd6f0('0xc'),_0x1af29c,_0x272c4e['error'][_0xd6f0('0x12')]);return _0x1a48a0(_0x272c4e[_0xd6f0('0x10')]['message']);}else{logger[_0xd6f0('0xb')]('WhatsappApplication,\x20%s,\x20%s',_0x1af29c,_0xd6f0('0xd'));_0x1a48a0(_0x272c4e[_0xd6f0('0x13')][_0xd6f0('0x12')]);}})[_0xd6f0('0x14')](function(_0x64ff5f){logger[_0xd6f0('0x10')](_0xd6f0('0xc'),_0x1af29c,_0x64ff5f);_0x4c4916(_0x64ff5f);});});} \ No newline at end of file +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(_0x7fdf31,_0x238ef3){var _0x1327d7=function(_0x308110){while(--_0x308110){_0x7fdf31['push'](_0x7fdf31['shift']());}};_0x1327d7(++_0x238ef3);}(_0x4bc3,0x16e));var _0x34bc=function(_0x5a3cf0,_0x160a68){_0x5a3cf0=_0x5a3cf0-0x0;var _0x5a64ee=_0x4bc3[_0x5a3cf0];return _0x5a64ee;};'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 91b8ed6..35db538 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 _0x326f=['./whatsappInteraction.controller','get','isAuthenticated','/describe','describe','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','whatsapp','put','/:id','tracked','whatsappinteraction:update','update','delete','whatsappinteraction:destroy','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1a3cc7,_0x2900e3){var _0x338438=function(_0x5a4872){while(--_0x5a4872){_0x1a3cc7['push'](_0x1a3cc7['shift']());}};_0x338438(++_0x2900e3);}(_0x326f,0xd1));var _0xf326=function(_0x3afb9d,_0x54ed6b){_0x3afb9d=_0x3afb9d-0x0;var _0x4f9b97=_0x326f[_0x3afb9d];return _0x4f9b97;};'use strict';var multer=require(_0xf326('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf326('0x1'));var express=require(_0xf326('0x2'));var router=express[_0xf326('0x3')]();var fs_extra=require(_0xf326('0x4'));var auth=require(_0xf326('0x5'));var interaction=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var controller=require(_0xf326('0x8'));router[_0xf326('0x9')]('/',auth[_0xf326('0xa')](),controller['index']);router[_0xf326('0x9')](_0xf326('0xb'),auth[_0xf326('0xa')](),controller[_0xf326('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xf326('0xd')]);router[_0xf326('0x9')](_0xf326('0xe'),auth[_0xf326('0xa')](),controller[_0xf326('0xf')]);router['get'](_0xf326('0x10'),auth['isAuthenticated'](),controller[_0xf326('0x11')]);router['post']('/',auth[_0xf326('0xa')](),controller['create']);router[_0xf326('0x12')](_0xf326('0xe'),auth['isAuthenticated'](),controller[_0xf326('0x13')]);router[_0xf326('0x12')](_0xf326('0x14'),auth[_0xf326('0xa')](),interaction['tracked'](_0xf326('0x15'),'whatsappinteraction:addtags'),controller['addTags']);router[_0xf326('0x16')](_0xf326('0x17'),auth[_0xf326('0xa')](),interaction[_0xf326('0x18')](_0xf326('0x15'),_0xf326('0x19')),controller[_0xf326('0x1a')]);router[_0xf326('0x1b')]('/:id',auth[_0xf326('0xa')](),interaction[_0xf326('0x18')](_0xf326('0x15'),_0xf326('0x1c')),controller[_0xf326('0x1d')]);router[_0xf326('0x1b')]('/:id/tags',auth['isAuthenticated'](),controller['removeTags']);module[_0xf326('0x1e')]=router; \ No newline at end of file +var _0x53ec=['util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./whatsappInteraction.controller','isAuthenticated','get','/describe','describe','/:id','show','/:id/messages','getMessages','create','post','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','whatsappinteraction:update','update','delete','whatsappinteraction:destroy','removeTags','exports','multer'];(function(_0x4c0003,_0x59ba77){var _0x41dfd1=function(_0x2c7c60){while(--_0x2c7c60){_0x4c0003['push'](_0x4c0003['shift']());}};_0x41dfd1(++_0x59ba77);}(_0x53ec,0x192));var _0xc53e=function(_0xb1496a,_0x190543){_0xb1496a=_0xb1496a-0x0;var _0x301916=_0x53ec[_0xb1496a];return _0x301916;};'use strict';var multer=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var path=require(_0xc53e('0x2'));var timeout=require(_0xc53e('0x3'));var express=require(_0xc53e('0x4'));var router=express[_0xc53e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc53e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc53e('0x7'));var controller=require(_0xc53e('0x8'));router['get']('/',auth[_0xc53e('0x9')](),controller['index']);router[_0xc53e('0xa')](_0xc53e('0xb'),auth['isAuthenticated'](),controller[_0xc53e('0xc')]);router[_0xc53e('0xa')](_0xc53e('0xd'),auth[_0xc53e('0x9')](),controller[_0xc53e('0xe')]);router[_0xc53e('0xa')](_0xc53e('0xf'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x10')]);router['get']('/:id/download',auth[_0xc53e('0x9')](),controller['download']);router['post']('/',auth[_0xc53e('0x9')](),controller[_0xc53e('0x11')]);router[_0xc53e('0x12')](_0xc53e('0xf'),auth['isAuthenticated'](),controller['addMessage']);router[_0xc53e('0x12')](_0xc53e('0x13'),auth[_0xc53e('0x9')](),interaction[_0xc53e('0x14')](_0xc53e('0x15'),_0xc53e('0x16')),controller[_0xc53e('0x17')]);router[_0xc53e('0x18')](_0xc53e('0xd'),auth[_0xc53e('0x9')](),interaction['tracked'](_0xc53e('0x15'),_0xc53e('0x19')),controller[_0xc53e('0x1a')]);router[_0xc53e('0x1b')](_0xc53e('0xd'),auth[_0xc53e('0x9')](),interaction[_0xc53e('0x14')](_0xc53e('0x15'),_0xc53e('0x1c')),controller['destroy']);router['delete'](_0xc53e('0x13'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x1d')]);module[_0xc53e('0x1e')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 9368b38..675424a 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 _0x6f75=['DATE','STRING','ENUM','out','INTEGER','sequelize','moment','exports','BOOLEAN'];(function(_0x53bfbb,_0xf55521){var _0x8f3221=function(_0x2c911f){while(--_0x2c911f){_0x53bfbb['push'](_0x53bfbb['shift']());}};_0x8f3221(++_0xf55521);}(_0x6f75,0x71));var _0x56f7=function(_0x4a150c,_0x5cc26b){_0x4a150c=_0x4a150c-0x0;var _0x21d72b=_0x6f75[_0x4a150c];return _0x21d72b;};'use strict';var Sequelize=require(_0x56f7('0x0'));var moment=require(_0x56f7('0x1'));module[_0x56f7('0x2')]={'closed':{'type':Sequelize[_0x56f7('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x56f7('0x4')]},'disposition':{'type':Sequelize[_0x56f7('0x5')]},'secondDisposition':{'type':Sequelize[_0x56f7('0x5')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x56f7('0x5')]},'phone':{'type':Sequelize[_0x56f7('0x5')]},'read1stAt':{'type':Sequelize[_0x56f7('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x56f7('0x6')]('in',_0x56f7('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize[_0x56f7('0x8')]}}; \ No newline at end of file +var _0xd8d7=['sequelize','moment','exports','BOOLEAN','DATE','STRING','ENUM','out','INTEGER'];(function(_0x3378a5,_0x317f7f){var _0x43235f=function(_0x4c54c9){while(--_0x4c54c9){_0x3378a5['push'](_0x3378a5['shift']());}};_0x43235f(++_0x317f7f);}(_0xd8d7,0x1d4));var _0x7d8d=function(_0x53a7af,_0x1408a5){_0x53a7af=_0x53a7af-0x0;var _0x3cc7f6=_0xd8d7[_0x53a7af];return _0x3cc7f6;};'use strict';var Sequelize=require(_0x7d8d('0x0'));var moment=require(_0x7d8d('0x1'));module[_0x7d8d('0x2')]={'closed':{'type':Sequelize[_0x7d8d('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x7d8d('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x7d8d('0x5')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x7d8d('0x6')]('in',_0x7d8d('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x7d8d('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x7d8d('0x6')]('in',_0x7d8d('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x7d8d('0x3')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x7d8d('0x8')]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 362746c..a5d49bf 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 _0x7f6f=['limit','undefined','count','set','Content-Range','update','then','error','stack','name','send','index','map','WhatsappInteraction','rawAttributes','fieldName','type','key','findAll','user','params','model','query','keys','intersection','fields','attributes','length','includeAll','include','merge','options','find','create','catch','body','destroy','describe','addMessage','WhatsappMessage','ids','omit','getMessages','findOne','filters','sort','where','pick','WhatsappInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','spread','Tag','emit','whatsappInteractionTags:save','removeTags','unix','toString','root','server','files','tmp','join','attachments','transcript-%d-%s.zip','push','User','Contact','firstName','Attachment','Messages','createdAt','direction','secret','read','WhatsappAccount','get','mkdirSync','Whatsapp','Account','fullname','N.A.','closed','closedAt','disposition','basename','existsSync','createReadStream','pipe','createWriteStream','System','lastName','out','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','download','log','err','rimraf','zip-dir','moment','bluebird','util','path','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status','end','json','offset'];(function(_0x14c0c4,_0x41dd07){var _0x7ce512=function(_0x615181){while(--_0x615181){_0x14c0c4['push'](_0x14c0c4['shift']());}};_0x7ce512(++_0x41dd07);}(_0x7f6f,0x6c));var _0xf7f6=function(_0x536256,_0x237fb5){_0x536256=_0x536256-0x0;var _0x1675f7=_0x7f6f[_0x536256];return _0x1675f7;};'use strict';var rimraf=require(_0xf7f6('0x0'));var zipdir=require(_0xf7f6('0x1'));var moment=require(_0xf7f6('0x2'));var BPromise=require(_0xf7f6('0x3'));var util=require(_0xf7f6('0x4'));var path=require(_0xf7f6('0x5'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var Redis=require(_0xf7f6('0x6'));var interaction=require(_0xf7f6('0x7'));var qs=require(_0xf7f6('0x8'));var pdf=require(_0xf7f6('0x9'));var logger=require(_0xf7f6('0xa'))(_0xf7f6('0xb'));var config=require(_0xf7f6('0xc'));var db=require(_0xf7f6('0xd'))['db'];config[_0xf7f6('0xe')]=_[_0xf7f6('0xf')](config[_0xf7f6('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0xf7f6('0x10'))(new Redis(config['redis']));require(_0xf7f6('0x11'))[_0xf7f6('0x12')](socket);function respondWithStatusCode(_0x5e2ab3,_0x206123){_0x206123=_0x206123||0xcc;return function(_0x14644f){if(_0x14644f){return _0x5e2ab3[_0xf7f6('0x13')](_0x206123);}return _0x5e2ab3[_0xf7f6('0x14')](_0x206123)[_0xf7f6('0x15')]();};}function respondWithResult(_0x13c90c,_0x19e87c){_0x19e87c=_0x19e87c||0xc8;return function(_0x519986){if(_0x519986){return _0x13c90c[_0xf7f6('0x14')](_0x19e87c)[_0xf7f6('0x16')](_0x519986);}};}function respondWithFilteredResult(_0xceb207,_0x3c18ff){return function(_0x2b7fdc){if(_0x2b7fdc){var _0x4824de=typeof _0x3c18ff[_0xf7f6('0x17')]==='undefined'&&typeof _0x3c18ff[_0xf7f6('0x18')]===_0xf7f6('0x19');var _0x58bb5f=_0x2b7fdc[_0xf7f6('0x1a')];var _0x418a5e=_0x4824de?0x0:_0x3c18ff[_0xf7f6('0x17')];var _0x7c3594=_0x4824de?_0x2b7fdc['count']:_0x3c18ff[_0xf7f6('0x17')]+_0x3c18ff['limit'];var _0x575782;if(_0x7c3594>=_0x58bb5f){_0x7c3594=_0x58bb5f;_0x575782=0xc8;}else{_0x575782=0xce;}_0xceb207['status'](_0x575782);return _0xceb207[_0xf7f6('0x1b')](_0xf7f6('0x1c'),_0x418a5e+'-'+_0x7c3594+'/'+_0x58bb5f)[_0xf7f6('0x16')](_0x2b7fdc);}return null;};}function saveUpdates(_0x40a530){return function(_0x32911a){if(_0x32911a){return _0x32911a[_0xf7f6('0x1d')](_0x40a530)[_0xf7f6('0x1e')](function(_0x1fa1aa){return _0x1fa1aa;});}return null;};}function removeEntity(_0x1edcf5){return function(_0x51ce04){if(_0x51ce04){return _0x51ce04['destroy']()[_0xf7f6('0x1e')](function(){_0x1edcf5[_0xf7f6('0x14')](0xcc)[_0xf7f6('0x15')]();});}};}function handleEntityNotFound(_0x5478e3){return function(_0x17c38c){if(!_0x17c38c){_0x5478e3['sendStatus'](0x194);}return _0x17c38c;};}function handleError(_0x2ad1b4,_0x426a22){_0x426a22=_0x426a22||0x1f4;return function(_0x3afa02){logger[_0xf7f6('0x1f')](_0x3afa02[_0xf7f6('0x20')]);if(_0x3afa02[_0xf7f6('0x21')]){delete _0x3afa02['name'];}_0x2ad1b4['status'](_0x426a22)[_0xf7f6('0x22')](_0x3afa02);};}exports[_0xf7f6('0x23')]=function(_0xa65bed,_0x59e092){var _0x3aca85={};var _0x55526f=_[_0xf7f6('0x24')](db[_0xf7f6('0x25')][_0xf7f6('0x26')],function(_0x2fee86){return{'name':_0x2fee86[_0xf7f6('0x27')],'type':_0x2fee86[_0xf7f6('0x28')][_0xf7f6('0x29')]};});_0x3aca85=qs['getOptions'](_0x55526f,_0xa65bed);return interaction[_0xf7f6('0x2a')]('whatsapp',_0xa65bed['query'],_0xa65bed[_0xf7f6('0x2b')],_0x3aca85,_0x55526f)[_0xf7f6('0x1e')](respondWithFilteredResult(_0x59e092,_0x3aca85))['catch'](handleError(_0x59e092,null));};exports['show']=function(_0x2fefb6,_0x5d7fff){var _0x2fdd5f={'raw':![],'where':{'id':_0x2fefb6[_0xf7f6('0x2c')]['id']}},_0x52fa6a={};_0x52fa6a[_0xf7f6('0x2d')]=_['keys'](db[_0xf7f6('0x25')][_0xf7f6('0x26')]);_0x52fa6a[_0xf7f6('0x2e')]=_[_0xf7f6('0x2f')](_0x2fefb6[_0xf7f6('0x2e')]);_0x52fa6a['filters']=_[_0xf7f6('0x30')](_0x52fa6a[_0xf7f6('0x2d')],_0x52fa6a['query']);_0x2fdd5f['attributes']=_[_0xf7f6('0x30')](_0x52fa6a['model'],qs[_0xf7f6('0x31')](_0x2fefb6[_0xf7f6('0x2e')][_0xf7f6('0x31')]));_0x2fdd5f[_0xf7f6('0x32')]=_0x2fdd5f[_0xf7f6('0x32')][_0xf7f6('0x33')]?_0x2fdd5f[_0xf7f6('0x32')]:_0x52fa6a[_0xf7f6('0x2d')];if(_0x2fefb6[_0xf7f6('0x2e')][_0xf7f6('0x34')]){_0x2fdd5f[_0xf7f6('0x35')]=[{'all':!![]}];}_0x2fdd5f=_[_0xf7f6('0x36')]({},_0x2fdd5f,_0x2fefb6[_0xf7f6('0x37')]);return db[_0xf7f6('0x25')][_0xf7f6('0x38')](_0x2fdd5f)[_0xf7f6('0x1e')](handleEntityNotFound(_0x5d7fff,null))[_0xf7f6('0x1e')](respondWithResult(_0x5d7fff,null))['catch'](handleError(_0x5d7fff,null));};exports[_0xf7f6('0x39')]=function(_0x4aa260,_0x443bf7){return db['WhatsappInteraction']['create'](_0x4aa260['body'],{})[_0xf7f6('0x1e')](respondWithResult(_0x443bf7,0xc9))[_0xf7f6('0x3a')](handleError(_0x443bf7,null));};exports[_0xf7f6('0x1d')]=function(_0x3eee4f,_0x3ea60b){if(_0x3eee4f[_0xf7f6('0x3b')]['id']){delete _0x3eee4f['body']['id'];}return db[_0xf7f6('0x25')][_0xf7f6('0x38')]({'where':{'id':_0x3eee4f[_0xf7f6('0x2c')]['id']}})[_0xf7f6('0x1e')](handleEntityNotFound(_0x3ea60b,null))['then'](saveUpdates(_0x3eee4f[_0xf7f6('0x3b')],null))[_0xf7f6('0x1e')](respondWithResult(_0x3ea60b,null))[_0xf7f6('0x3a')](handleError(_0x3ea60b,null));};exports[_0xf7f6('0x3c')]=function(_0x34a4a7,_0x3e5e1a){return db['WhatsappInteraction'][_0xf7f6('0x38')]({'where':{'id':_0x34a4a7[_0xf7f6('0x2c')]['id']}})[_0xf7f6('0x1e')](handleEntityNotFound(_0x3e5e1a,null))['then'](removeEntity(_0x3e5e1a,null))[_0xf7f6('0x3a')](handleError(_0x3e5e1a,null));};exports[_0xf7f6('0x3d')]=function(_0x4b495c,_0x3107bb){return db[_0xf7f6('0x25')][_0xf7f6('0x3d')]()[_0xf7f6('0x1e')](respondWithResult(_0x3107bb,null))[_0xf7f6('0x3a')](handleError(_0x3107bb,null));};exports[_0xf7f6('0x3e')]=function(_0x5a3a2a,_0x4a76e5){return db[_0xf7f6('0x3f')][_0xf7f6('0x38')]({'where':{'id':_0x5a3a2a['params']['id']}})[_0xf7f6('0x1e')](handleEntityNotFound(_0x4a76e5,null))[_0xf7f6('0x1e')](function(_0x4264ea){if(_0x4264ea){return _0x4264ea[_0xf7f6('0x3e')](_0x5a3a2a['body'][_0xf7f6('0x40')],_[_0xf7f6('0x41')](_0x5a3a2a[_0xf7f6('0x3b')],[_0xf7f6('0x40'),'id'])||{});}})[_0xf7f6('0x1e')](respondWithResult(_0x4a76e5,null))[_0xf7f6('0x3a')](handleError(_0x4a76e5,null));};exports[_0xf7f6('0x42')]=function(_0x5ac428,_0xf5d1de){var _0x663d4b={'raw':![],'where':{}};var _0x28886e={};var _0x58adec={'count':0x0,'rows':[]};return db[_0xf7f6('0x25')][_0xf7f6('0x43')]({'where':{'id':_0x5ac428[_0xf7f6('0x2c')]['id']}})[_0xf7f6('0x1e')](handleEntityNotFound(_0xf5d1de,null))[_0xf7f6('0x1e')](function(_0x490933){if(_0x490933){_0x28886e[_0xf7f6('0x2d')]=_[_0xf7f6('0x2f')](db[_0xf7f6('0x3f')][_0xf7f6('0x26')]);_0x28886e[_0xf7f6('0x2e')]=_[_0xf7f6('0x2f')](_0x5ac428[_0xf7f6('0x2e')]);_0x28886e[_0xf7f6('0x44')]=_[_0xf7f6('0x30')](_0x28886e[_0xf7f6('0x2d')],_0x28886e['query']);_0x663d4b['attributes']=_[_0xf7f6('0x30')](_0x28886e['model'],qs[_0xf7f6('0x31')](_0x5ac428[_0xf7f6('0x2e')][_0xf7f6('0x31')]));_0x663d4b[_0xf7f6('0x32')]=_0x663d4b[_0xf7f6('0x32')][_0xf7f6('0x33')]?_0x663d4b[_0xf7f6('0x32')]:_0x28886e[_0xf7f6('0x2d')];if(!_0x5ac428[_0xf7f6('0x2e')]['hasOwnProperty']('nolimit')){_0x663d4b['limit']=qs[_0xf7f6('0x18')](_0x5ac428[_0xf7f6('0x2e')][_0xf7f6('0x18')]);_0x663d4b['offset']=qs['offset'](_0x5ac428['query']['offset']);}_0x663d4b['order']=qs[_0xf7f6('0x45')](_0x5ac428[_0xf7f6('0x2e')][_0xf7f6('0x45')]);_0x663d4b[_0xf7f6('0x46')]=qs[_0xf7f6('0x44')](_[_0xf7f6('0x47')](_0x5ac428[_0xf7f6('0x2e')],_0x28886e[_0xf7f6('0x44')]));_0x663d4b[_0xf7f6('0x46')][_0xf7f6('0x48')]=_0x490933['id'];if(_0x5ac428['query'][_0xf7f6('0x49')]){_0x663d4b[_0xf7f6('0x46')]=_[_0xf7f6('0x36')](_0x663d4b[_0xf7f6('0x46')],{'$or':_[_0xf7f6('0x24')](_0x663d4b[_0xf7f6('0x32')],function(_0x26477b){var _0x479819={};_0x479819[_0x26477b]={'$like':'%'+_0x5ac428[_0xf7f6('0x2e')][_0xf7f6('0x49')]+'%'};return _0x479819;})});}if(_0x5ac428[_0xf7f6('0x2e')][_0xf7f6('0x4a')]){var _0x20932b=_0x5ac428[_0xf7f6('0x2e')]['$gte'][_0xf7f6('0x4b')](',');var _0x56b853={};_0x56b853[_0x20932b[0x0]]={'$gte':moment(_0x20932b[0x1])[_0xf7f6('0x4c')](_0xf7f6('0x4d'))};_0x663d4b[_0xf7f6('0x46')]=_[_0xf7f6('0x36')](_0x663d4b[_0xf7f6('0x46')],_0x56b853);}_0x663d4b=_[_0xf7f6('0x36')]({},_0x663d4b,_0x5ac428[_0xf7f6('0x37')]);return db[_0xf7f6('0x3f')]['count']({'where':_0x663d4b[_0xf7f6('0x46')]})[_0xf7f6('0x1e')](function(_0xe0832){_0x58adec[_0xf7f6('0x1a')]=_0xe0832;if(_0x5ac428['query']['includeAll']){_0x663d4b['include']=[{'all':!![]}];}return db[_0xf7f6('0x3f')][_0xf7f6('0x2a')](_0x663d4b);})[_0xf7f6('0x1e')](function(_0x565619){_0x58adec[_0xf7f6('0x4e')]=_0x565619;return _0x58adec;});}})[_0xf7f6('0x1e')](respondWithFilteredResult(_0xf5d1de,_0x663d4b))[_0xf7f6('0x3a')](handleError(_0xf5d1de,null));};exports[_0xf7f6('0x4f')]=function(_0x29264d,_0xbb2cc1){return db[_0xf7f6('0x25')]['find']({'where':{'id':_0x29264d[_0xf7f6('0x2c')]['id']}})[_0xf7f6('0x1e')](handleEntityNotFound(_0xbb2cc1,null))[_0xf7f6('0x1e')](function(_0x579090){if(_0x579090){return _0x579090['setTags'](_0x29264d[_0xf7f6('0x3b')][_0xf7f6('0x40')],_[_0xf7f6('0x41')](_0x29264d[_0xf7f6('0x3b')],[_0xf7f6('0x40'),'id'])||{})[_0xf7f6('0x50')](function(){return db[_0xf7f6('0x51')]['findAll']({'attributes':['id',_0xf7f6('0x21'),'color'],'where':{'id':_0x29264d[_0xf7f6('0x3b')][_0xf7f6('0x40')]}});})[_0xf7f6('0x1e')](function(_0x45af8d){socket[_0xf7f6('0x52')](_0xf7f6('0x53'),{'id':Number(_0x29264d[_0xf7f6('0x2c')]['id']),'tags':_0x45af8d||[]});return{'id':Number(_0x29264d['params']['id']),'tags':_0x45af8d||[]};});}})[_0xf7f6('0x1e')](respondWithResult(_0xbb2cc1,null))['catch'](handleError(_0xbb2cc1,null));};exports['removeTags']=function(_0x25ae9a,_0x3cde17){return db['WhatsappInteraction'][_0xf7f6('0x38')]({'where':{'id':_0x25ae9a[_0xf7f6('0x2c')]['id']}})[_0xf7f6('0x1e')](handleEntityNotFound(_0x3cde17,null))['then'](function(_0x14dec0){if(_0x14dec0){return _0x14dec0[_0xf7f6('0x54')](_0x25ae9a[_0xf7f6('0x2e')]['ids']);}})[_0xf7f6('0x1e')](respondWithStatusCode(_0x3cde17,null))['catch'](handleError(_0x3cde17,null));};exports['download']=function(_0x1566f9,_0x388a9e){var _0x1522b8=moment()[_0xf7f6('0x55')]()[_0xf7f6('0x56')]();var _0xef24dd=path['join'](config[_0xf7f6('0x57')],_0xf7f6('0x58'),_0xf7f6('0x59'),_0xf7f6('0x5a'));var _0x37af70=path[_0xf7f6('0x5b')](config['root'],'server',_0xf7f6('0x59'),_0xf7f6('0x5c'));var _0x26eb92=path[_0xf7f6('0x5b')](_0xef24dd,_0x1522b8);var _0x2c5faa=util[_0xf7f6('0x4c')](_0xf7f6('0x5d'),_0x1566f9[_0xf7f6('0x2c')]['id'],_0x1522b8);var _0x3f182a=path['join'](_0xef24dd,_0x2c5faa);var _0x48b4f8=[];_0x48b4f8[_0xf7f6('0x5e')]({'model':db[_0xf7f6('0x5f')],'as':_0xf7f6('0x5f'),'attributes':['id','fullname'],'raw':!![]});_0x48b4f8[_0xf7f6('0x5e')]({'model':db['CmContact'],'as':_0xf7f6('0x60'),'attributes':['id',_0xf7f6('0x61'),'lastName'],'raw':!![]});if(_0x1566f9[_0xf7f6('0x2e')]['attachments']){_0x48b4f8[_0xf7f6('0x5e')]({'model':db[_0xf7f6('0x62')],'as':_0xf7f6('0x62'),'raw':!![]});}var _0x324655=[{'model':db['WhatsappMessage'],'as':_0xf7f6('0x63'),'attributes':['id','body',_0xf7f6('0x64'),_0xf7f6('0x65'),_0xf7f6('0x66'),_0xf7f6('0x67')],'include':_0x48b4f8}];_0x324655[_0xf7f6('0x5e')]({'model':db[_0xf7f6('0x68')],'as':'Account','attributes':['id',_0xf7f6('0x21')]});_0x324655[_0xf7f6('0x5e')]({'model':db[_0xf7f6('0x5f')],'as':'Owner','attributes':['id','fullname']});return db[_0xf7f6('0x25')]['find']({'where':{'id':_0x1566f9[_0xf7f6('0x2c')]['id']},'include':_0x324655})[_0xf7f6('0x1e')](handleEntityNotFound(_0x388a9e,null))[_0xf7f6('0x1e')](function(_0x44b8f2){if(_0x44b8f2){var _0x5275e0=_0x44b8f2[_0xf7f6('0x69')]({'plain':!![]});fs[_0xf7f6('0x6a')](_0x26eb92);var _0x5ad5ac={'channel':_0xf7f6('0x6b'),'account':_0x5275e0[_0xf7f6('0x6c')]['name'],'agent':_0x5275e0['Owner']?_0x5275e0['Owner'][_0xf7f6('0x6d')]:_0xf7f6('0x6e'),'createdAt':moment(_0x5275e0[_0xf7f6('0x64')])[_0xf7f6('0x4c')](_0xf7f6('0x4d'))[_0xf7f6('0x56')](),'closedAt':_0x5275e0[_0xf7f6('0x6f')]?moment(_0x5275e0[_0xf7f6('0x70')])['format'](_0xf7f6('0x4d'))[_0xf7f6('0x56')]():'','disposition':_0x5275e0[_0xf7f6('0x71')],'messages':_(_0x5275e0[_0xf7f6('0x63')])[_0xf7f6('0x49')]({'secret':![]})[_0xf7f6('0x24')](function(_0x360e67){if(_0x360e67[_0xf7f6('0x62')]){var _0x611738=path[_0xf7f6('0x5b')](_0x37af70,_0x360e67['Attachment'][_0xf7f6('0x72')]);if(fs[_0xf7f6('0x73')](_0x611738)){fs[_0xf7f6('0x74')](_0x611738)[_0xf7f6('0x75')](fs[_0xf7f6('0x76')](path[_0xf7f6('0x5b')](_0x26eb92,_0x360e67['Attachment'][_0xf7f6('0x72')])));}}return{'date':moment(_0x360e67[_0xf7f6('0x64')])['format'](_0xf7f6('0x4d'))[_0xf7f6('0x56')](),'sender':_0x360e67[_0xf7f6('0x65')]==='out'?_0x360e67['User']?_0x360e67[_0xf7f6('0x5f')][_0xf7f6('0x6d')]:_0xf7f6('0x77'):_0x360e67[_0xf7f6('0x60')]['firstName']+(_0x360e67[_0xf7f6('0x60')][_0xf7f6('0x78')]?'\x20'+_0x360e67[_0xf7f6('0x60')][_0xf7f6('0x78')]:''),'body':_0x360e67[_0xf7f6('0x62')]?_0x360e67[_0xf7f6('0x62')][_0xf7f6('0x72')]:_0x360e67['body'],'direction':_0x360e67['direction']===_0xf7f6('0x79')?'A':'C','secret':_0x360e67[_0xf7f6('0x66')],'read':_0x360e67[_0xf7f6('0x67')],'attachment':_0x360e67['Attachment']};})[_0xf7f6('0x7a')]()};return ejs[_0xf7f6('0x7b')](path[_0xf7f6('0x5b')](config[_0xf7f6('0x57')],_0xf7f6('0x58'),_0xf7f6('0x7c'),_0xf7f6('0x7d')),{'interaction':_0x5ad5ac})[_0xf7f6('0x1e')](function(_0x1ac709){var _0x419909=path[_0xf7f6('0x5b')](_0x26eb92,_0xf7f6('0x7e')+_0x5275e0['id']+'-'+_0x1522b8+_0xf7f6('0x7f'));var _0x4e04e1={'path':_0x419909,'channel':'Whatsapp','interactionId':_0x5275e0['id']};return pdf[_0xf7f6('0x80')](_0x1ac709,_0x4e04e1);})['then'](function(){return new BPromise(function(_0xbf58a4,_0x29976c){zipdir(_0x26eb92,{'saveTo':_0x3f182a},function(_0x29a496,_0x1c5f8e){if(_0x29a496)return _0x29976c(_0x29a496);return _0xbf58a4(_0x1c5f8e);});})[_0xf7f6('0x1e')](function(){return new BPromise(function(_0x5a9e9d,_0x1d821b){rimraf(_0x26eb92,function(_0x20813b){if(_0x20813b)_0x1d821b(_0x20813b);return _0x5a9e9d();});});})[_0xf7f6('0x1e')](function(){return _0x388a9e[_0xf7f6('0x81')](_0x3f182a,_0x2c5faa,function(_0x5ba25d){if(_0x5ba25d){console[_0xf7f6('0x82')](_0xf7f6('0x83'),_0x5ba25d);}else{fs['unlinkSync'](_0x3f182a);}});});});}else{return _0x388a9e[_0xf7f6('0x13')](0xc8);}})[_0xf7f6('0x3a')](handleError(_0x388a9e,null));}; \ No newline at end of file +var _0x2d6d=['register','sendStatus','status','json','offset','undefined','limit','count','update','destroy','then','stack','name','send','WhatsappInteraction','rawAttributes','fieldName','key','getOptions','findAll','whatsapp','user','catch','params','model','keys','query','filters','attributes','fields','length','includeAll','include','merge','options','find','create','body','addMessage','WhatsappMessage','ids','intersection','order','sort','where','pick','WhatsappInteractionId','filter','map','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rows','setTags','omit','color','emit','whatsappInteractionTags:save','removeTags','unix','toString','join','root','files','tmp','server','transcript-%d-%s.zip','push','User','fullname','Contact','firstName','attachments','Attachment','createdAt','direction','secret','WhatsappAccount','Account','get','mkdirSync','Owner','N.A.','closed','closedAt','Messages','basename','existsSync','createReadStream','createWriteStream','out','System','lastName','read','value','renderFile','downloadInteraction.ejs','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','moment','bluebird','util','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','defaults','localhost','./whatsappInteraction.socket'];(function(_0x30e6c7,_0x4e544c){var _0x19b029=function(_0x1c37ed){while(--_0x1c37ed){_0x30e6c7['push'](_0x30e6c7['shift']());}};_0x19b029(++_0x4e544c);}(_0x2d6d,0x66));var _0xd2d6=function(_0x54b396,_0x3612ee){_0x54b396=_0x54b396-0x0;var _0x532e6d=_0x2d6d[_0x54b396];return _0x532e6d;};'use strict';var rimraf=require(_0xd2d6('0x0'));var zipdir=require(_0xd2d6('0x1'));var moment=require(_0xd2d6('0x2'));var BPromise=require(_0xd2d6('0x3'));var util=require(_0xd2d6('0x4'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var _=require(_0xd2d6('0x5'));var Redis=require(_0xd2d6('0x6'));var interaction=require(_0xd2d6('0x7'));var qs=require(_0xd2d6('0x8'));var pdf=require(_0xd2d6('0x9'));var logger=require(_0xd2d6('0xa'))(_0xd2d6('0xb'));var config=require(_0xd2d6('0xc'));var db=require(_0xd2d6('0xd'))['db'];config['redis']=_[_0xd2d6('0xe')](config['redis'],{'host':_0xd2d6('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xd2d6('0x10'))[_0xd2d6('0x11')](socket);function respondWithStatusCode(_0x2747b0,_0xa4469a){_0xa4469a=_0xa4469a||0xcc;return function(_0x3c498d){if(_0x3c498d){return _0x2747b0[_0xd2d6('0x12')](_0xa4469a);}return _0x2747b0[_0xd2d6('0x13')](_0xa4469a)['end']();};}function respondWithResult(_0x5f1586,_0x20800e){_0x20800e=_0x20800e||0xc8;return function(_0x1d62c4){if(_0x1d62c4){return _0x5f1586[_0xd2d6('0x13')](_0x20800e)[_0xd2d6('0x14')](_0x1d62c4);}};}function respondWithFilteredResult(_0x38a8be,_0x2590e4){return function(_0x59529e){if(_0x59529e){var _0x14ab6f=typeof _0x2590e4[_0xd2d6('0x15')]===_0xd2d6('0x16')&&typeof _0x2590e4[_0xd2d6('0x17')]==='undefined';var _0x4fdac3=_0x59529e[_0xd2d6('0x18')];var _0x352619=_0x14ab6f?0x0:_0x2590e4[_0xd2d6('0x15')];var _0x8ba7fb=_0x14ab6f?_0x59529e[_0xd2d6('0x18')]:_0x2590e4[_0xd2d6('0x15')]+_0x2590e4['limit'];var _0x3765a5;if(_0x8ba7fb>=_0x4fdac3){_0x8ba7fb=_0x4fdac3;_0x3765a5=0xc8;}else{_0x3765a5=0xce;}_0x38a8be['status'](_0x3765a5);return _0x38a8be['set']('Content-Range',_0x352619+'-'+_0x8ba7fb+'/'+_0x4fdac3)[_0xd2d6('0x14')](_0x59529e);}return null;};}function saveUpdates(_0x322a52){return function(_0x2dddf1){if(_0x2dddf1){return _0x2dddf1[_0xd2d6('0x19')](_0x322a52)['then'](function(_0x2d3bcb){return _0x2d3bcb;});}return null;};}function removeEntity(_0xcc6d55){return function(_0x56b27f){if(_0x56b27f){return _0x56b27f[_0xd2d6('0x1a')]()[_0xd2d6('0x1b')](function(){_0xcc6d55[_0xd2d6('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f0bd0){return function(_0x213e96){if(!_0x213e96){_0x1f0bd0[_0xd2d6('0x12')](0x194);}return _0x213e96;};}function handleError(_0x5e397d,_0x39d3f0){_0x39d3f0=_0x39d3f0||0x1f4;return function(_0x2422c0){logger['error'](_0x2422c0[_0xd2d6('0x1c')]);if(_0x2422c0[_0xd2d6('0x1d')]){delete _0x2422c0['name'];}_0x5e397d['status'](_0x39d3f0)[_0xd2d6('0x1e')](_0x2422c0);};}exports['index']=function(_0x31c721,_0x10eb6f){var _0x1eb5b7={};var _0x3f15f4=_['map'](db[_0xd2d6('0x1f')][_0xd2d6('0x20')],function(_0x20e5a2){return{'name':_0x20e5a2[_0xd2d6('0x21')],'type':_0x20e5a2['type'][_0xd2d6('0x22')]};});_0x1eb5b7=qs[_0xd2d6('0x23')](_0x3f15f4,_0x31c721);return interaction[_0xd2d6('0x24')](_0xd2d6('0x25'),_0x31c721['query'],_0x31c721[_0xd2d6('0x26')],_0x1eb5b7,_0x3f15f4)['then'](respondWithFilteredResult(_0x10eb6f,_0x1eb5b7))[_0xd2d6('0x27')](handleError(_0x10eb6f,null));};exports['show']=function(_0x8f3083,_0x88566d){var _0x3b3f81={'raw':![],'where':{'id':_0x8f3083[_0xd2d6('0x28')]['id']}},_0x3138ad={};_0x3138ad[_0xd2d6('0x29')]=_['keys'](db['WhatsappInteraction'][_0xd2d6('0x20')]);_0x3138ad['query']=_[_0xd2d6('0x2a')](_0x8f3083[_0xd2d6('0x2b')]);_0x3138ad[_0xd2d6('0x2c')]=_['intersection'](_0x3138ad['model'],_0x3138ad[_0xd2d6('0x2b')]);_0x3b3f81[_0xd2d6('0x2d')]=_['intersection'](_0x3138ad[_0xd2d6('0x29')],qs[_0xd2d6('0x2e')](_0x8f3083[_0xd2d6('0x2b')]['fields']));_0x3b3f81['attributes']=_0x3b3f81['attributes'][_0xd2d6('0x2f')]?_0x3b3f81[_0xd2d6('0x2d')]:_0x3138ad['model'];if(_0x8f3083[_0xd2d6('0x2b')][_0xd2d6('0x30')]){_0x3b3f81[_0xd2d6('0x31')]=[{'all':!![]}];}_0x3b3f81=_[_0xd2d6('0x32')]({},_0x3b3f81,_0x8f3083[_0xd2d6('0x33')]);return db[_0xd2d6('0x1f')][_0xd2d6('0x34')](_0x3b3f81)[_0xd2d6('0x1b')](handleEntityNotFound(_0x88566d,null))[_0xd2d6('0x1b')](respondWithResult(_0x88566d,null))[_0xd2d6('0x27')](handleError(_0x88566d,null));};exports[_0xd2d6('0x35')]=function(_0x245f4b,_0x32bc10){return db[_0xd2d6('0x1f')][_0xd2d6('0x35')](_0x245f4b[_0xd2d6('0x36')],{})[_0xd2d6('0x1b')](respondWithResult(_0x32bc10,0xc9))[_0xd2d6('0x27')](handleError(_0x32bc10,null));};exports[_0xd2d6('0x19')]=function(_0x39e16b,_0x2da04c){if(_0x39e16b[_0xd2d6('0x36')]['id']){delete _0x39e16b[_0xd2d6('0x36')]['id'];}return db['WhatsappInteraction'][_0xd2d6('0x34')]({'where':{'id':_0x39e16b['params']['id']}})[_0xd2d6('0x1b')](handleEntityNotFound(_0x2da04c,null))[_0xd2d6('0x1b')](saveUpdates(_0x39e16b[_0xd2d6('0x36')],null))['then'](respondWithResult(_0x2da04c,null))[_0xd2d6('0x27')](handleError(_0x2da04c,null));};exports[_0xd2d6('0x1a')]=function(_0x3252c8,_0x457f99){return db['WhatsappInteraction'][_0xd2d6('0x34')]({'where':{'id':_0x3252c8[_0xd2d6('0x28')]['id']}})[_0xd2d6('0x1b')](handleEntityNotFound(_0x457f99,null))[_0xd2d6('0x1b')](removeEntity(_0x457f99,null))[_0xd2d6('0x27')](handleError(_0x457f99,null));};exports['describe']=function(_0x9e0db2,_0x595d6e){return db[_0xd2d6('0x1f')]['describe']()['then'](respondWithResult(_0x595d6e,null))[_0xd2d6('0x27')](handleError(_0x595d6e,null));};exports[_0xd2d6('0x37')]=function(_0x57be50,_0x12c794){return db[_0xd2d6('0x38')][_0xd2d6('0x34')]({'where':{'id':_0x57be50['params']['id']}})[_0xd2d6('0x1b')](handleEntityNotFound(_0x12c794,null))[_0xd2d6('0x1b')](function(_0x2e8312){if(_0x2e8312){return _0x2e8312[_0xd2d6('0x37')](_0x57be50[_0xd2d6('0x36')][_0xd2d6('0x39')],_['omit'](_0x57be50['body'],[_0xd2d6('0x39'),'id'])||{});}})[_0xd2d6('0x1b')](respondWithResult(_0x12c794,null))[_0xd2d6('0x27')](handleError(_0x12c794,null));};exports['getMessages']=function(_0x4b587d,_0x4239be){var _0x354474={'raw':![],'where':{}};var _0x2ea506={};var _0x4f37f0={'count':0x0,'rows':[]};return db['WhatsappInteraction']['findOne']({'where':{'id':_0x4b587d[_0xd2d6('0x28')]['id']}})[_0xd2d6('0x1b')](handleEntityNotFound(_0x4239be,null))['then'](function(_0x4cae26){if(_0x4cae26){_0x2ea506[_0xd2d6('0x29')]=_['keys'](db[_0xd2d6('0x38')][_0xd2d6('0x20')]);_0x2ea506[_0xd2d6('0x2b')]=_[_0xd2d6('0x2a')](_0x4b587d[_0xd2d6('0x2b')]);_0x2ea506[_0xd2d6('0x2c')]=_['intersection'](_0x2ea506[_0xd2d6('0x29')],_0x2ea506[_0xd2d6('0x2b')]);_0x354474['attributes']=_[_0xd2d6('0x3a')](_0x2ea506[_0xd2d6('0x29')],qs[_0xd2d6('0x2e')](_0x4b587d[_0xd2d6('0x2b')][_0xd2d6('0x2e')]));_0x354474[_0xd2d6('0x2d')]=_0x354474[_0xd2d6('0x2d')][_0xd2d6('0x2f')]?_0x354474[_0xd2d6('0x2d')]:_0x2ea506['model'];if(!_0x4b587d[_0xd2d6('0x2b')]['hasOwnProperty']('nolimit')){_0x354474[_0xd2d6('0x17')]=qs[_0xd2d6('0x17')](_0x4b587d[_0xd2d6('0x2b')][_0xd2d6('0x17')]);_0x354474[_0xd2d6('0x15')]=qs[_0xd2d6('0x15')](_0x4b587d[_0xd2d6('0x2b')][_0xd2d6('0x15')]);}_0x354474[_0xd2d6('0x3b')]=qs[_0xd2d6('0x3c')](_0x4b587d[_0xd2d6('0x2b')][_0xd2d6('0x3c')]);_0x354474[_0xd2d6('0x3d')]=qs[_0xd2d6('0x2c')](_[_0xd2d6('0x3e')](_0x4b587d[_0xd2d6('0x2b')],_0x2ea506['filters']));_0x354474[_0xd2d6('0x3d')][_0xd2d6('0x3f')]=_0x4cae26['id'];if(_0x4b587d[_0xd2d6('0x2b')][_0xd2d6('0x40')]){_0x354474['where']=_[_0xd2d6('0x32')](_0x354474[_0xd2d6('0x3d')],{'$or':_[_0xd2d6('0x41')](_0x354474[_0xd2d6('0x2d')],function(_0x570d20){var _0xdb268d={};_0xdb268d[_0x570d20]={'$like':'%'+_0x4b587d[_0xd2d6('0x2b')][_0xd2d6('0x40')]+'%'};return _0xdb268d;})});}if(_0x4b587d[_0xd2d6('0x2b')]['$gte']){var _0x3cfeee=_0x4b587d[_0xd2d6('0x2b')][_0xd2d6('0x42')][_0xd2d6('0x43')](',');var _0x5afbd5={};_0x5afbd5[_0x3cfeee[0x0]]={'$gte':moment(_0x3cfeee[0x1])[_0xd2d6('0x44')](_0xd2d6('0x45'))};_0x354474[_0xd2d6('0x3d')]=_['merge'](_0x354474['where'],_0x5afbd5);}_0x354474=_[_0xd2d6('0x32')]({},_0x354474,_0x4b587d[_0xd2d6('0x33')]);return db['WhatsappMessage'][_0xd2d6('0x18')]({'where':_0x354474[_0xd2d6('0x3d')]})[_0xd2d6('0x1b')](function(_0x27dab6){_0x4f37f0['count']=_0x27dab6;if(_0x4b587d[_0xd2d6('0x2b')][_0xd2d6('0x30')]){_0x354474['include']=[{'all':!![]}];}return db[_0xd2d6('0x38')][_0xd2d6('0x24')](_0x354474);})[_0xd2d6('0x1b')](function(_0x5e010b){_0x4f37f0[_0xd2d6('0x46')]=_0x5e010b;return _0x4f37f0;});}})[_0xd2d6('0x1b')](respondWithFilteredResult(_0x4239be,_0x354474))[_0xd2d6('0x27')](handleError(_0x4239be,null));};exports['addTags']=function(_0x4cdb5b,_0x25e136){return db['WhatsappInteraction'][_0xd2d6('0x34')]({'where':{'id':_0x4cdb5b[_0xd2d6('0x28')]['id']}})[_0xd2d6('0x1b')](handleEntityNotFound(_0x25e136,null))[_0xd2d6('0x1b')](function(_0x4652a9){if(_0x4652a9){return _0x4652a9[_0xd2d6('0x47')](_0x4cdb5b[_0xd2d6('0x36')]['ids'],_[_0xd2d6('0x48')](_0x4cdb5b['body'],[_0xd2d6('0x39'),'id'])||{})['spread'](function(){return db['Tag'][_0xd2d6('0x24')]({'attributes':['id',_0xd2d6('0x1d'),_0xd2d6('0x49')],'where':{'id':_0x4cdb5b[_0xd2d6('0x36')]['ids']}});})[_0xd2d6('0x1b')](function(_0x11a83a){socket[_0xd2d6('0x4a')](_0xd2d6('0x4b'),{'id':Number(_0x4cdb5b[_0xd2d6('0x28')]['id']),'tags':_0x11a83a||[]});return{'id':Number(_0x4cdb5b[_0xd2d6('0x28')]['id']),'tags':_0x11a83a||[]};});}})['then'](respondWithResult(_0x25e136,null))[_0xd2d6('0x27')](handleError(_0x25e136,null));};exports[_0xd2d6('0x4c')]=function(_0x310a4b,_0x195028){return db['WhatsappInteraction']['find']({'where':{'id':_0x310a4b[_0xd2d6('0x28')]['id']}})[_0xd2d6('0x1b')](handleEntityNotFound(_0x195028,null))[_0xd2d6('0x1b')](function(_0xfbbbed){if(_0xfbbbed){return _0xfbbbed[_0xd2d6('0x4c')](_0x310a4b[_0xd2d6('0x2b')][_0xd2d6('0x39')]);}})['then'](respondWithStatusCode(_0x195028,null))[_0xd2d6('0x27')](handleError(_0x195028,null));};exports['download']=function(_0x5567d9,_0x322400){var _0x2d54a3=moment()[_0xd2d6('0x4d')]()[_0xd2d6('0x4e')]();var _0x201d8c=path[_0xd2d6('0x4f')](config[_0xd2d6('0x50')],'server',_0xd2d6('0x51'),_0xd2d6('0x52'));var _0x26f9b3=path[_0xd2d6('0x4f')](config['root'],_0xd2d6('0x53'),'files','attachments');var _0x34bbe9=path[_0xd2d6('0x4f')](_0x201d8c,_0x2d54a3);var _0x3e2c68=util[_0xd2d6('0x44')](_0xd2d6('0x54'),_0x5567d9[_0xd2d6('0x28')]['id'],_0x2d54a3);var _0x5a745e=path[_0xd2d6('0x4f')](_0x201d8c,_0x3e2c68);var _0x2d7acf=[];_0x2d7acf[_0xd2d6('0x55')]({'model':db[_0xd2d6('0x56')],'as':_0xd2d6('0x56'),'attributes':['id',_0xd2d6('0x57')],'raw':!![]});_0x2d7acf[_0xd2d6('0x55')]({'model':db['CmContact'],'as':_0xd2d6('0x58'),'attributes':['id',_0xd2d6('0x59'),'lastName'],'raw':!![]});if(_0x5567d9['query'][_0xd2d6('0x5a')]){_0x2d7acf[_0xd2d6('0x55')]({'model':db[_0xd2d6('0x5b')],'as':'Attachment','raw':!![]});}var _0x587274=[{'model':db['WhatsappMessage'],'as':'Messages','attributes':['id',_0xd2d6('0x36'),_0xd2d6('0x5c'),_0xd2d6('0x5d'),_0xd2d6('0x5e'),'read'],'include':_0x2d7acf}];_0x587274['push']({'model':db[_0xd2d6('0x5f')],'as':_0xd2d6('0x60'),'attributes':['id',_0xd2d6('0x1d')]});_0x587274[_0xd2d6('0x55')]({'model':db['User'],'as':'Owner','attributes':['id',_0xd2d6('0x57')]});return db['WhatsappInteraction'][_0xd2d6('0x34')]({'where':{'id':_0x5567d9['params']['id']},'include':_0x587274})['then'](handleEntityNotFound(_0x322400,null))[_0xd2d6('0x1b')](function(_0x353599){if(_0x353599){var _0x1e1e93=_0x353599[_0xd2d6('0x61')]({'plain':!![]});fs[_0xd2d6('0x62')](_0x34bbe9);var _0x43730a={'channel':'Whatsapp','account':_0x1e1e93[_0xd2d6('0x60')][_0xd2d6('0x1d')],'agent':_0x1e1e93[_0xd2d6('0x63')]?_0x1e1e93[_0xd2d6('0x63')]['fullname']:_0xd2d6('0x64'),'createdAt':moment(_0x1e1e93['createdAt'])[_0xd2d6('0x44')](_0xd2d6('0x45'))[_0xd2d6('0x4e')](),'closedAt':_0x1e1e93[_0xd2d6('0x65')]?moment(_0x1e1e93[_0xd2d6('0x66')])[_0xd2d6('0x44')](_0xd2d6('0x45'))['toString']():'','disposition':_0x1e1e93['disposition'],'messages':_(_0x1e1e93[_0xd2d6('0x67')])[_0xd2d6('0x40')]({'secret':![]})[_0xd2d6('0x41')](function(_0x484d72){if(_0x484d72[_0xd2d6('0x5b')]){var _0x230877=path[_0xd2d6('0x4f')](_0x26f9b3,_0x484d72[_0xd2d6('0x5b')][_0xd2d6('0x68')]);if(fs[_0xd2d6('0x69')](_0x230877)){fs[_0xd2d6('0x6a')](_0x230877)['pipe'](fs[_0xd2d6('0x6b')](path['join'](_0x34bbe9,_0x484d72[_0xd2d6('0x5b')][_0xd2d6('0x68')])));}}return{'date':moment(_0x484d72['createdAt'])[_0xd2d6('0x44')](_0xd2d6('0x45'))[_0xd2d6('0x4e')](),'sender':_0x484d72[_0xd2d6('0x5d')]===_0xd2d6('0x6c')?_0x484d72[_0xd2d6('0x56')]?_0x484d72['User'][_0xd2d6('0x57')]:_0xd2d6('0x6d'):_0x484d72[_0xd2d6('0x58')]['firstName']+(_0x484d72[_0xd2d6('0x58')][_0xd2d6('0x6e')]?'\x20'+_0x484d72[_0xd2d6('0x58')][_0xd2d6('0x6e')]:''),'body':_0x484d72[_0xd2d6('0x5b')]?_0x484d72['Attachment'][_0xd2d6('0x68')]:_0x484d72[_0xd2d6('0x36')],'direction':_0x484d72[_0xd2d6('0x5d')]==='out'?'A':'C','secret':_0x484d72[_0xd2d6('0x5e')],'read':_0x484d72[_0xd2d6('0x6f')],'attachment':_0x484d72['Attachment']};})[_0xd2d6('0x70')]()};return ejs[_0xd2d6('0x71')](path[_0xd2d6('0x4f')](config[_0xd2d6('0x50')],_0xd2d6('0x53'),'views',_0xd2d6('0x72')),{'interaction':_0x43730a})[_0xd2d6('0x1b')](function(_0x8e4bda){var _0x4b702f=path[_0xd2d6('0x4f')](_0x34bbe9,'transcript-'+_0x1e1e93['id']+'-'+_0x2d54a3+_0xd2d6('0x73'));var _0x4aabcc={'path':_0x4b702f,'channel':'Whatsapp','interactionId':_0x1e1e93['id']};return pdf[_0xd2d6('0x74')](_0x8e4bda,_0x4aabcc);})[_0xd2d6('0x1b')](function(){return new BPromise(function(_0x454968,_0x148356){zipdir(_0x34bbe9,{'saveTo':_0x5a745e},function(_0x2f3f06,_0x34b44a){if(_0x2f3f06)return _0x148356(_0x2f3f06);return _0x454968(_0x34b44a);});})['then'](function(){return new BPromise(function(_0x49ccfb,_0x3388db){rimraf(_0x34bbe9,function(_0x2d2f72){if(_0x2d2f72)_0x3388db(_0x2d2f72);return _0x49ccfb();});});})[_0xd2d6('0x1b')](function(){return _0x322400['download'](_0x5a745e,_0x3e2c68,function(_0x2eeac4){if(_0x2eeac4){console['log'](_0xd2d6('0x75'),_0x2eeac4);}else{fs[_0xd2d6('0x76')](_0x5a745e);}});});});}else{return _0x322400['sendStatus'](0xc8);}})[_0xd2d6('0x27')](handleError(_0x322400,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 3019577..667e92c 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 _0xa477=['save','update','remove','getUsers','Users','findAll','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappMessage','setMaxListeners'];(function(_0x1d4eed,_0x4922b2){var _0x10911b=function(_0x5422ab){while(--_0x5422ab){_0x1d4eed['push'](_0x1d4eed['shift']());}};_0x10911b(++_0x4922b2);}(_0xa477,0xe6));var _0x7a47=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xa477[_0x21a9d9];return _0x46adce;};'use strict';var EventEmitter=require(_0x7a47('0x0'));var WhatsappInteraction=require(_0x7a47('0x1'))['db']['WhatsappInteraction'];var WhatsappMessage=require(_0x7a47('0x1'))['db'][_0x7a47('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x7a47('0x3')](0x0);var events={'afterCreate':_0x7a47('0x4'),'afterUpdate':_0x7a47('0x5'),'afterDestroy':_0x7a47('0x6')};function emitEvent(_0x1b595e){return function(_0x56b589,_0x493cad,_0x307852){_0x56b589[_0x7a47('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x54e9aa){_0x56b589['setDataValue'](_0x7a47('0x8'),_0x54e9aa['map'](function(_0x2dc504){return{'id':_0x2dc504['id']};}));return WhatsappMessage[_0x7a47('0x9')]({'where':{'WhatsappInteractionId':_0x56b589['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x3afd71){_0x56b589[_0x7a47('0xa')](_0x7a47('0xb'),_0x3afd71[_0x7a47('0xc')]);WhatsappInteractionEvents[_0x7a47('0xd')](_0x1b595e+':'+_0x56b589['id'],_0x56b589);WhatsappInteractionEvents['emit'](_0x1b595e,_0x56b589);_0x307852(null);})[_0x7a47('0xe')](_0x307852(null));};}for(var e in events){if(events[_0x7a47('0xf')](e)){var event=events[e];WhatsappInteraction[_0x7a47('0x10')](e,emitEvent(event));}}module[_0x7a47('0x11')]=WhatsappInteractionEvents; \ No newline at end of file +var _0xee11=['findAll','unreadMessages','emit','catch','hasOwnProperty','exports','events','../../mysqldb','WhatsappMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue'];(function(_0x4c66a4,_0x588f4d){var _0x43280f=function(_0x229817){while(--_0x229817){_0x4c66a4['push'](_0x4c66a4['shift']());}};_0x43280f(++_0x588f4d);}(_0xee11,0x146));var _0x1ee1=function(_0x412e27,_0x20a978){_0x412e27=_0x412e27-0x0;var _0x53da42=_0xee11[_0x412e27];return _0x53da42;};'use strict';var EventEmitter=require(_0x1ee1('0x0'));var WhatsappInteraction=require('../../mysqldb')['db']['WhatsappInteraction'];var WhatsappMessage=require(_0x1ee1('0x1'))['db'][_0x1ee1('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x1ee1('0x3')](0x0);var events={'afterCreate':_0x1ee1('0x4'),'afterUpdate':_0x1ee1('0x5'),'afterDestroy':_0x1ee1('0x6')};function emitEvent(_0x3eb96f){return function(_0x3990df,_0x517892,_0x1322a7){_0x3990df[_0x1ee1('0x7')]({'attributes':['id'],'raw':!![]})[_0x1ee1('0x8')](function(_0x289d4c){_0x3990df[_0x1ee1('0x9')]('Users',_0x289d4c['map'](function(_0x3ae411){return{'id':_0x3ae411['id']};}));return WhatsappMessage[_0x1ee1('0xa')]({'where':{'WhatsappInteractionId':_0x3990df['id'],'direction':'in','read':![]},'raw':!![]});})[_0x1ee1('0x8')](function(_0x3bd418){_0x3990df['setDataValue'](_0x1ee1('0xb'),_0x3bd418['length']);WhatsappInteractionEvents[_0x1ee1('0xc')](_0x3eb96f+':'+_0x3990df['id'],_0x3990df);WhatsappInteractionEvents[_0x1ee1('0xc')](_0x3eb96f,_0x3990df);_0x1322a7(null);})[_0x1ee1('0xd')](_0x1322a7(null));};}for(var e in events){if(events[_0x1ee1('0xe')](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module[_0x1ee1('0xf')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index c77fcde..e4e2e06 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 _0x07ef=['changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappInteraction.attributes','exports','define','WhatsappInteraction','whatsapp_interactions'];(function(_0x46baac,_0x3dd147){var _0x3557de=function(_0x10b20b){while(--_0x10b20b){_0x46baac['push'](_0x46baac['shift']());}};_0x3557de(++_0x3dd147);}(_0x07ef,0x70));var _0xf07e=function(_0x214a03,_0x2e4061){_0x214a03=_0x214a03-0x0;var _0xda476a=_0x07ef[_0x214a03];return _0xda476a;};'use strict';var _=require(_0xf07e('0x0'));var util=require(_0xf07e('0x1'));var logger=require(_0xf07e('0x2'))(_0xf07e('0x3'));var moment=require('moment');var BPromise=require(_0xf07e('0x4'));var rp=require(_0xf07e('0x5'));var fs=require('fs');var path=require(_0xf07e('0x6'));var rimraf=require(_0xf07e('0x7'));var config=require(_0xf07e('0x8'));var attributes=require(_0xf07e('0x9'));module[_0xf07e('0xa')]=function(_0x3f0b3c,_0x12d829){return _0x3f0b3c[_0xf07e('0xb')](_0xf07e('0xc'),attributes,{'tableName':_0xf07e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x10e2c7,_0x152ae8,_0x32c0d5){if(_0x10e2c7[_0xf07e('0xe')](_0xf07e('0xf'))){_0x10e2c7[_0xf07e('0x10')]=moment()['format'](_0xf07e('0x11'));}_0x32c0d5(null,_0x10e2c7);}}});}; \ No newline at end of file +var _0xc35f=['WhatsappInteraction','whatsapp_interactions','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappInteraction.attributes','exports','define'];(function(_0x23763d,_0x5a7d6d){var _0x3a0883=function(_0x1e7cce){while(--_0x1e7cce){_0x23763d['push'](_0x23763d['shift']());}};_0x3a0883(++_0x5a7d6d);}(_0xc35f,0x16f));var _0xfc35=function(_0x5ab33e,_0x4cf1dc){_0x5ab33e=_0x5ab33e-0x0;var _0x277c6a=_0xc35f[_0x5ab33e];return _0x277c6a;};'use strict';var _=require(_0xfc35('0x0'));var util=require(_0xfc35('0x1'));var logger=require(_0xfc35('0x2'))(_0xfc35('0x3'));var moment=require(_0xfc35('0x4'));var BPromise=require(_0xfc35('0x5'));var rp=require(_0xfc35('0x6'));var fs=require('fs');var path=require(_0xfc35('0x7'));var rimraf=require(_0xfc35('0x8'));var config=require(_0xfc35('0x9'));var attributes=require(_0xfc35('0xa'));module[_0xfc35('0xb')]=function(_0x57fb45,_0x4941b7){return _0x57fb45[_0xfc35('0xc')](_0xfc35('0xd'),attributes,{'tableName':_0xfc35('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x53ee60,_0x56a014,_0x10053c){if(_0x53ee60['changed'](_0xfc35('0xf'))){_0x53ee60[_0xfc35('0x10')]=moment()[_0xfc35('0x11')](_0xfc35('0x12'));}_0x10053c(null,_0x53ee60);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 650b3c7..9bffba5 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 _0x8543=['then','catch','AddTagsToWhatsappInteraction','find','where','ids','omit','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','./whatsappInteraction.socket','register','request','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','raw','attributes','limit'];(function(_0x3529d6,_0x311ca8){var _0x5a29c8=function(_0x44d45c){while(--_0x44d45c){_0x3529d6['push'](_0x3529d6['shift']());}};_0x5a29c8(++_0x311ca8);}(_0x8543,0x159));var _0x3854=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x8543[_0x160c73];return _0xd9302;};'use strict';var _=require(_0x3854('0x0'));var util=require(_0x3854('0x1'));var moment=require(_0x3854('0x2'));var BPromise=require('bluebird');var rs=require(_0x3854('0x3'));var fs=require('fs');var Redis=require(_0x3854('0x4'));var db=require(_0x3854('0x5'))['db'];var utils=require(_0x3854('0x6'));var logger=require(_0x3854('0x7'))(_0x3854('0x8'));var config=require(_0x3854('0x9'));var jayson=require(_0x3854('0xa'));var client=jayson['client'][_0x3854('0xb')]({'port':0x232a});config[_0x3854('0xc')]=_[_0x3854('0xd')](config[_0x3854('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3854('0xc')]));require(_0x3854('0xe'))[_0x3854('0xf')](socket);function respondWithRpcPromise(_0x1d86a4,_0xa0bf58,_0x13a6fe){return new BPromise(function(_0x42924d,_0x1414e2){return client[_0x3854('0x10')](_0x1d86a4,_0x13a6fe)['then'](function(_0x265fef){logger[_0x3854('0x11')](_0x3854('0x12'),_0xa0bf58,_0x3854('0x13'));logger[_0x3854('0x14')]('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0xa0bf58,_0x3854('0x13'),JSON[_0x3854('0x15')](_0x265fef));if(_0x265fef[_0x3854('0x16')]){if(_0x265fef[_0x3854('0x16')]['code']===0x1f4){logger[_0x3854('0x16')]('WhatsappInteraction,\x20%s,\x20%s',_0xa0bf58,_0x265fef[_0x3854('0x16')][_0x3854('0x17')]);return _0x1414e2(_0x265fef[_0x3854('0x16')]['message']);}logger[_0x3854('0x16')](_0x3854('0x12'),_0xa0bf58,_0x265fef[_0x3854('0x16')][_0x3854('0x17')]);return _0x42924d(_0x265fef[_0x3854('0x16')][_0x3854('0x17')]);}else{logger['info'](_0x3854('0x12'),_0xa0bf58,_0x3854('0x13'));_0x42924d(_0x265fef[_0x3854('0x18')][_0x3854('0x17')]);}})['catch'](function(_0x4f613c){logger[_0x3854('0x16')](_0x3854('0x12'),_0xa0bf58,_0x4f613c);_0x1414e2(_0x4f613c);});});}exports[_0x3854('0x19')]=function(_0x2d86cb){var _0x36a358=this;return new Promise(function(_0x1de32f,_0x33131c){return db[_0x3854('0x1a')][_0x3854('0x1b')](_0x2d86cb[_0x3854('0x1c')],{'raw':_0x2d86cb[_0x3854('0x1d')]?_0x2d86cb[_0x3854('0x1d')][_0x3854('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2d86cb['options']?_0x2d86cb[_0x3854('0x1d')]['where']||null:null,'attributes':_0x2d86cb[_0x3854('0x1d')]?_0x2d86cb[_0x3854('0x1d')][_0x3854('0x1f')]||null:null,'limit':_0x2d86cb[_0x3854('0x1d')]?_0x2d86cb[_0x3854('0x1d')][_0x3854('0x20')]||null:null})[_0x3854('0x21')](function(_0x23b5b4){logger[_0x3854('0x11')]('UpdateWhatsappInteraction',_0x2d86cb);logger[_0x3854('0x14')](_0x3854('0x19'),_0x2d86cb,JSON[_0x3854('0x15')](_0x23b5b4));_0x1de32f(_0x23b5b4);})[_0x3854('0x22')](function(_0x199551){logger[_0x3854('0x16')](_0x3854('0x19'),_0x199551['message'],_0x2d86cb);_0x33131c(_0x36a358[_0x3854('0x16')](0x1f4,_0x199551[_0x3854('0x17')]));});});};exports[_0x3854('0x23')]=function(_0x5a6443){return new Promise(function(_0x57422e,_0x17d633){return db['WhatsappInteraction'][_0x3854('0x24')]({'where':_0x5a6443[_0x3854('0x1d')]?_0x5a6443[_0x3854('0x1d')][_0x3854('0x25')]||null:null})['then'](function(_0x5f1c1d){if(_0x5f1c1d){return _0x5f1c1d['addTags'](_0x5a6443['body'][_0x3854('0x26')],_[_0x3854('0x27')](_0x5a6443[_0x3854('0x1c')],[_0x3854('0x26'),'id'])||{});}})[_0x3854('0x28')](function(_0x56efe4){logger['info'](_0x3854('0x29'),_0x5a6443);logger['debug']('AddTags',_0x5a6443,JSON[_0x3854('0x15')](_0x56efe4));_0x57422e(_0x56efe4);})[_0x3854('0x22')](function(_0x1db20c){logger['error'](_0x3854('0x29'),_0x1db20c[_0x3854('0x17')],_0x5a6443);_0x17d633(_this[_0x3854('0x16')](0x1f4,_0x1db20c[_0x3854('0x17')]));});});}; \ No newline at end of file +var _0xa3b8=['redis','defaults','socket.io-emitter','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','raw','where','attributes','limit','then','AddTagsToWhatsappInteraction','find','addTags','ids','omit','AddTags','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x430b24,_0x1f085e){var _0x5cee14=function(_0x15fcf4){while(--_0x15fcf4){_0x430b24['push'](_0x430b24['shift']());}};_0x5cee14(++_0x1f085e);}(_0xa3b8,0x100));var _0x8a3b=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa3b8[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require('lodash');var util=require(_0x8a3b('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8a3b('0x1'));var fs=require('fs');var Redis=require(_0x8a3b('0x2'));var db=require(_0x8a3b('0x3'))['db'];var utils=require(_0x8a3b('0x4'));var logger=require(_0x8a3b('0x5'))(_0x8a3b('0x6'));var config=require('../../config/environment');var jayson=require(_0x8a3b('0x7'));var client=jayson[_0x8a3b('0x8')][_0x8a3b('0x9')]({'port':0x232a});config[_0x8a3b('0xa')]=_[_0x8a3b('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x8a3b('0xc'))(new Redis(config[_0x8a3b('0xa')]));require('./whatsappInteraction.socket')['register'](socket);function respondWithRpcPromise(_0xf1e97e,_0x36d547,_0x3dcf3b){return new BPromise(function(_0x58f062,_0x1eacea){return client['request'](_0xf1e97e,_0x3dcf3b)['then'](function(_0x38cc8f){logger[_0x8a3b('0xd')](_0x8a3b('0xe'),_0x36d547,_0x8a3b('0xf'));logger['debug']('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x36d547,_0x8a3b('0xf'),JSON[_0x8a3b('0x10')](_0x38cc8f));if(_0x38cc8f['error']){if(_0x38cc8f[_0x8a3b('0x11')][_0x8a3b('0x12')]===0x1f4){logger['error'](_0x8a3b('0xe'),_0x36d547,_0x38cc8f[_0x8a3b('0x11')][_0x8a3b('0x13')]);return _0x1eacea(_0x38cc8f[_0x8a3b('0x11')][_0x8a3b('0x13')]);}logger['error'](_0x8a3b('0xe'),_0x36d547,_0x38cc8f['error']['message']);return _0x58f062(_0x38cc8f[_0x8a3b('0x11')][_0x8a3b('0x13')]);}else{logger[_0x8a3b('0xd')](_0x8a3b('0xe'),_0x36d547,'request\x20sent');_0x58f062(_0x38cc8f[_0x8a3b('0x14')][_0x8a3b('0x13')]);}})[_0x8a3b('0x15')](function(_0x5a201d){logger[_0x8a3b('0x11')](_0x8a3b('0xe'),_0x36d547,_0x5a201d);_0x1eacea(_0x5a201d);});});}exports[_0x8a3b('0x16')]=function(_0x26381d){var _0x227693=this;return new Promise(function(_0x2886a3,_0x2cbe4b){return db[_0x8a3b('0x17')][_0x8a3b('0x18')](_0x26381d[_0x8a3b('0x19')],{'raw':_0x26381d['options']?_0x26381d[_0x8a3b('0x1a')][_0x8a3b('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x26381d['options']?_0x26381d[_0x8a3b('0x1a')][_0x8a3b('0x1c')]||null:null,'attributes':_0x26381d[_0x8a3b('0x1a')]?_0x26381d['options'][_0x8a3b('0x1d')]||null:null,'limit':_0x26381d['options']?_0x26381d[_0x8a3b('0x1a')][_0x8a3b('0x1e')]||null:null})[_0x8a3b('0x1f')](function(_0x444dcb){logger[_0x8a3b('0xd')](_0x8a3b('0x16'),_0x26381d);logger['debug']('UpdateWhatsappInteraction',_0x26381d,JSON[_0x8a3b('0x10')](_0x444dcb));_0x2886a3(_0x444dcb);})[_0x8a3b('0x15')](function(_0x31c4ab){logger['error'](_0x8a3b('0x16'),_0x31c4ab[_0x8a3b('0x13')],_0x26381d);_0x2cbe4b(_0x227693[_0x8a3b('0x11')](0x1f4,_0x31c4ab[_0x8a3b('0x13')]));});});};exports[_0x8a3b('0x20')]=function(_0x4bcc40){return new Promise(function(_0x3f2258,_0x4542b5){return db[_0x8a3b('0x17')][_0x8a3b('0x21')]({'where':_0x4bcc40['options']?_0x4bcc40['options']['where']||null:null})['then'](function(_0x524901){if(_0x524901){return _0x524901[_0x8a3b('0x22')](_0x4bcc40[_0x8a3b('0x19')][_0x8a3b('0x23')],_[_0x8a3b('0x24')](_0x4bcc40[_0x8a3b('0x19')],[_0x8a3b('0x23'),'id'])||{});}})['spread'](function(_0x28ec63){logger[_0x8a3b('0xd')]('AddTags',_0x4bcc40);logger['debug'](_0x8a3b('0x25'),_0x4bcc40,JSON[_0x8a3b('0x10')](_0x28ec63));_0x3f2258(_0x28ec63);})[_0x8a3b('0x15')](function(_0x1b82e0){logger['error']('AddTags',_0x1b82e0[_0x8a3b('0x13')],_0x4bcc40);_0x4542b5(_this[_0x8a3b('0x11')](0x1f4,_0x1b82e0[_0x8a3b('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 6a2c7d2..19945b6 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 _0x8e8b=['remove','emit','removeListener','register','length','whatsappInteraction:','./whatsappInteraction.events','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8e8b,0x186));var _0xb8e8=function(_0x4e2461,_0x2061d1){_0x4e2461=_0x4e2461-0x0;var _0x4b93a8=_0x8e8b[_0x4e2461];return _0x4b93a8;};'use strict';var WhatsappInteractionEvents=require(_0xb8e8('0x0'));var events=[_0xb8e8('0x1'),_0xb8e8('0x2'),'update'];function createListener(_0x5cac60,_0xe795d5){return function(_0x1eb1cf){_0xe795d5[_0xb8e8('0x3')](_0x5cac60,_0x1eb1cf);};}function removeListener(_0x38260f,_0x19928d){return function(){WhatsappInteractionEvents[_0xb8e8('0x4')](_0x38260f,_0x19928d);};}exports[_0xb8e8('0x5')]=function(_0x42ec9e){for(var _0x4c5b61=0x0,_0x1ce87f=events[_0xb8e8('0x6')];_0x4c5b61<_0x1ce87f;_0x4c5b61++){var _0x75164e=events[_0x4c5b61];var _0x13d848=createListener(_0xb8e8('0x7')+_0x75164e,_0x42ec9e);WhatsappInteractionEvents['on'](_0x75164e,_0x13d848);}}; \ No newline at end of file +var _0x622d=['./whatsappInteraction.events','save','remove','update','emit','removeListener','register','length','whatsappInteraction:'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x622d,0xea));var _0xd622=function(_0x3315c7,_0x22a1e0){_0x3315c7=_0x3315c7-0x0;var _0x4ef48d=_0x622d[_0x3315c7];return _0x4ef48d;};'use strict';var WhatsappInteractionEvents=require(_0xd622('0x0'));var events=[_0xd622('0x1'),_0xd622('0x2'),_0xd622('0x3')];function createListener(_0x36391c,_0x18196f){return function(_0x238ace){_0x18196f[_0xd622('0x4')](_0x36391c,_0x238ace);};}function removeListener(_0x5b68f1,_0x3efeb2){return function(){WhatsappInteractionEvents[_0xd622('0x5')](_0x5b68f1,_0x3efeb2);};}exports[_0xd622('0x6')]=function(_0x40c455){for(var _0x54aba3=0x0,_0x474ce3=events[_0xd622('0x7')];_0x54aba3<_0x474ce3;_0x54aba3++){var _0x210c08=events[_0x54aba3];var _0x2cd40c=createListener(_0xd622('0x8')+_0x210c08,_0x40c455);WhatsappInteractionEvents['on'](_0x210c08,_0x2cd40c);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 962d743..849760b 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 _0x7d38=['update','/:id/accept','accept','reject','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./whatsappMessage.controller','/describe','isAuthenticated','describe','get','/:id','show','post','tracked','whatsapp','whatsappmessage:create','create','/:id/status','status','put'];(function(_0x56ebbf,_0xf0e613){var _0x43926e=function(_0x41356a){while(--_0x41356a){_0x56ebbf['push'](_0x56ebbf['shift']());}};_0x43926e(++_0xf0e613);}(_0x7d38,0x71));var _0x87d3=function(_0x550bf4,_0x36b898){_0x550bf4=_0x550bf4-0x0;var _0x1fb796=_0x7d38[_0x550bf4];return _0x1fb796;};'use strict';var multer=require(_0x87d3('0x0'));var util=require(_0x87d3('0x1'));var path=require(_0x87d3('0x2'));var timeout=require(_0x87d3('0x3'));var express=require(_0x87d3('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x87d3('0x5'));var interaction=require(_0x87d3('0x6'));var config=require('../../config/environment');var controller=require(_0x87d3('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x87d3('0x8'),auth[_0x87d3('0x9')](),controller[_0x87d3('0xa')]);router[_0x87d3('0xb')](_0x87d3('0xc'),auth[_0x87d3('0x9')](),controller[_0x87d3('0xd')]);router[_0x87d3('0xe')]('/',auth[_0x87d3('0x9')](),interaction[_0x87d3('0xf')](_0x87d3('0x10'),_0x87d3('0x11')),controller[_0x87d3('0x12')]);router[_0x87d3('0xe')](_0x87d3('0x13'),controller[_0x87d3('0x14')]);router[_0x87d3('0x15')](_0x87d3('0xc'),auth[_0x87d3('0x9')](),controller[_0x87d3('0x16')]);router['put'](_0x87d3('0x17'),auth[_0x87d3('0x9')](),controller[_0x87d3('0x18')]);router[_0x87d3('0x15')]('/:id/reject',auth['isAuthenticated'](),controller[_0x87d3('0x19')]);router['delete'](_0x87d3('0xc'),auth[_0x87d3('0x9')](),controller[_0x87d3('0x1a')]);module['exports']=router; \ No newline at end of file +var _0x0515=['update','/:id/accept','accept','/:id/reject','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','index','/describe','isAuthenticated','describe','/:id','show','tracked','whatsappmessage:create','create','post','status','put'];(function(_0x5e259c,_0x1d5662){var _0x1aba0a=function(_0x426890){while(--_0x426890){_0x5e259c['push'](_0x5e259c['shift']());}};_0x1aba0a(++_0x1d5662);}(_0x0515,0x7f));var _0x5051=function(_0x2eac4f,_0x5173f9){_0x2eac4f=_0x2eac4f-0x0;var _0x58f73b=_0x0515[_0x2eac4f];return _0x58f73b;};'use strict';var multer=require(_0x5051('0x0'));var util=require(_0x5051('0x1'));var path=require(_0x5051('0x2'));var timeout=require(_0x5051('0x3'));var express=require(_0x5051('0x4'));var router=express['Router']();var fs_extra=require(_0x5051('0x5'));var auth=require(_0x5051('0x6'));var interaction=require(_0x5051('0x7'));var config=require(_0x5051('0x8'));var controller=require(_0x5051('0x9'));router[_0x5051('0xa')]('/',auth['isAuthenticated'](),controller[_0x5051('0xb')]);router[_0x5051('0xa')](_0x5051('0xc'),auth[_0x5051('0xd')](),controller[_0x5051('0xe')]);router[_0x5051('0xa')](_0x5051('0xf'),auth['isAuthenticated'](),controller[_0x5051('0x10')]);router['post']('/',auth[_0x5051('0xd')](),interaction[_0x5051('0x11')]('whatsapp',_0x5051('0x12')),controller[_0x5051('0x13')]);router[_0x5051('0x14')]('/:id/status',controller[_0x5051('0x15')]);router[_0x5051('0x16')](_0x5051('0xf'),auth['isAuthenticated'](),controller[_0x5051('0x17')]);router[_0x5051('0x16')](_0x5051('0x18'),auth[_0x5051('0xd')](),controller[_0x5051('0x19')]);router[_0x5051('0x16')](_0x5051('0x1a'),auth[_0x5051('0xd')](),controller['reject']);router[_0x5051('0x1b')](_0x5051('0xf'),auth[_0x5051('0xd')](),controller[_0x5051('0x1c')]);module[_0x5051('0x1d')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 6424f8c..452294f 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 _0xb8b3=['sequelize','exports','TEXT','medium','BOOLEAN','out','DATE','STRING'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xb8b3,0x1a0));var _0x3b8b=function(_0x3a2e49,_0x21ebea){_0x3a2e49=_0x3a2e49-0x0;var _0x257140=_0xb8b3[_0x3a2e49];return _0x257140;};'use strict';var Sequelize=require(_0x3b8b('0x0'));module[_0x3b8b('0x1')]={'body':{'type':Sequelize[_0x3b8b('0x2')](_0x3b8b('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x3b8b('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x3b8b('0x5')),'defaultValue':_0x3b8b('0x5'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x3b8b('0x6')]},'secret':{'type':Sequelize[_0x3b8b('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x3b8b('0x7')]},'providerResponse':{'type':Sequelize[_0x3b8b('0x2')]}}; \ No newline at end of file +var _0x475c=['STRING','DATE','sequelize','exports','TEXT','medium','BOOLEAN','out'];(function(_0x29fc9d,_0x4271c7){var _0x588e6b=function(_0x3d7e7f){while(--_0x3d7e7f){_0x29fc9d['push'](_0x29fc9d['shift']());}};_0x588e6b(++_0x4271c7);}(_0x475c,0x1da));var _0xc475=function(_0x27518f,_0x4a45ef){_0x27518f=_0x27518f-0x0;var _0x4437e=_0x475c[_0x27518f];return _0x4437e;};'use strict';var Sequelize=require(_0xc475('0x0'));module[_0xc475('0x1')]={'body':{'type':Sequelize[_0xc475('0x2')](_0xc475('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xc475('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xc475('0x5')),'defaultValue':_0xc475('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0xc475('0x6')](0xbe)},'phone':{'type':Sequelize[_0xc475('0x6')]},'readAt':{'type':Sequelize[_0xc475('0x7')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0xc475('0x6')]},'providerResponse':{'type':Sequelize[_0xc475('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index e67fc63..b539b5b 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 _0xfbcf=['describe','whatsapp-interactions','whatsapp','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','WhatsappInteraction','isNil','read1stAt','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','agent','manual','interface','SIP/%s','channel','motionChannel','accept','EventManager','acceptmessage','WhatsappInteractionId','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','event','rejectmessage','WhatsappAccount','WhatsappAccountId','inspect','MessageSid','messageId','MessageStatus','read','WhatsappAccount,\x20%s,\x20%s,\x20%s','twilio','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappMessage.socket','jayson/promise','client','http','request','then','info','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','apply','reject','save','update','destroy','stack','send','map','WhatsappMessage','rawAttributes','fieldName','key','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','filter','options','includeAll','include','rows','show','model','create','body','find','params'];(function(_0xf5d71c,_0x2613a6){var _0x5af672=function(_0x191f52){while(--_0x191f52){_0xf5d71c['push'](_0xf5d71c['shift']());}};_0x5af672(++_0x2613a6);}(_0xfbcf,0x14e));var _0xffbc=function(_0x2396df,_0x5022f5){_0x2396df=_0x2396df-0x0;var _0x38a0d8=_0xfbcf[_0x2396df];return _0x38a0d8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xffbc('0x0'));var zipdir=require(_0xffbc('0x1'));var jsonpatch=require(_0xffbc('0x2'));var rp=require(_0xffbc('0x3'));var moment=require('moment');var BPromise=require(_0xffbc('0x4'));var Mustache=require(_0xffbc('0x5'));var util=require(_0xffbc('0x6'));var path=require(_0xffbc('0x7'));var sox=require('sox');var csv=require(_0xffbc('0x8'));var ejs=require(_0xffbc('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xffbc('0xa'));var crypto=require(_0xffbc('0xb'));var jsforce=require(_0xffbc('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xffbc('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xffbc('0xd'));var authService=require(_0xffbc('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xffbc('0xf'));var hardwareService=require(_0xffbc('0x10'));var logger=require(_0xffbc('0x11'))(_0xffbc('0x12'));var utils=require('../../config/utils');var config=require(_0xffbc('0x13'));var licenseUtil=require(_0xffbc('0x14'));var db=require(_0xffbc('0x15'))['db'];config[_0xffbc('0x16')]=_['defaults'](config[_0xffbc('0x16')],{'host':_0xffbc('0x17'),'port':0x18eb});var socket=require(_0xffbc('0x18'))(new Redis(config[_0xffbc('0x16')]));require(_0xffbc('0x19'))['register'](socket);var jayson=require(_0xffbc('0x1a'));var client=jayson[_0xffbc('0x1b')]['http']({'port':0x232c});var client9002=jayson[_0xffbc('0x1b')][_0xffbc('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x4632b4,_0x83b329,_0xb18cbf,_0x2c92f3){return new BPromise(function(_0xd3374b,_0x15bb8a){var _0x4d855a=_0x2c92f3||client;return _0x4d855a[_0xffbc('0x1d')](_0x4632b4,_0xb18cbf)[_0xffbc('0x1e')](function(_0x343c94){logger[_0xffbc('0x1f')]('WhatsappMessage,\x20%s,\x20%s',_0x83b329,_0xffbc('0x20'));logger[_0xffbc('0x21')](_0xffbc('0x22'),_0x83b329,_0xffbc('0x20'),JSON[_0xffbc('0x23')](_0x343c94));if(_0x343c94[_0xffbc('0x24')]){if(_0x343c94[_0xffbc('0x24')][_0xffbc('0x25')]===0x1f4){logger[_0xffbc('0x24')](_0xffbc('0x26'),_0x83b329,_0x343c94[_0xffbc('0x24')][_0xffbc('0x27')]);return _0x15bb8a(_0x343c94['error']['message']);}logger[_0xffbc('0x24')](_0xffbc('0x26'),_0x83b329,_0x343c94[_0xffbc('0x24')][_0xffbc('0x27')]);return _0xd3374b(_0x343c94['error'][_0xffbc('0x27')]);}else{logger[_0xffbc('0x1f')](_0xffbc('0x26'),_0x83b329,'request\x20sent');_0xd3374b(_0x343c94[_0xffbc('0x28')][_0xffbc('0x27')]);}})[_0xffbc('0x29')](function(_0x2babb7){logger[_0xffbc('0x24')](_0xffbc('0x26'),_0x83b329,_0x2babb7);_0x15bb8a(_0x2babb7);});});}function respondWithStatusCode(_0x41b1b8,_0x1513d7){_0x1513d7=_0x1513d7||0xcc;return function(_0x1ef000){if(_0x1ef000){return _0x41b1b8[_0xffbc('0x2a')](_0x1513d7);}return _0x41b1b8[_0xffbc('0x2b')](_0x1513d7)[_0xffbc('0x2c')]();};}function respondWithResult(_0x59246d,_0x28cf7c){_0x28cf7c=_0x28cf7c||0xc8;return function(_0x43d856){if(_0x43d856){return _0x59246d['status'](_0x28cf7c)[_0xffbc('0x2d')](_0x43d856);}};}function respondWithFilteredResult(_0x11974c,_0x58fe58){return function(_0x322660){if(_0x322660){var _0x80a6db=typeof _0x58fe58['offset']==='undefined'&&typeof _0x58fe58[_0xffbc('0x2e')]===_0xffbc('0x2f');var _0x16d4a4=_0x322660[_0xffbc('0x30')];var _0x180465=_0x80a6db?0x0:_0x58fe58[_0xffbc('0x31')];var _0x5db1cd=_0x80a6db?_0x322660[_0xffbc('0x30')]:_0x58fe58[_0xffbc('0x31')]+_0x58fe58[_0xffbc('0x2e')];var _0x46fb2a;if(_0x5db1cd>=_0x16d4a4){_0x5db1cd=_0x16d4a4;_0x46fb2a=0xc8;}else{_0x46fb2a=0xce;}_0x11974c[_0xffbc('0x2b')](_0x46fb2a);return _0x11974c['set'](_0xffbc('0x32'),_0x180465+'-'+_0x5db1cd+'/'+_0x16d4a4)[_0xffbc('0x2d')](_0x322660);}return null;};}function patchUpdates(_0x57e7eb){return function(_0x2e19f1){try{jsonpatch[_0xffbc('0x33')](_0x2e19f1,_0x57e7eb,!![]);}catch(_0x1fb9a6){return BPromise[_0xffbc('0x34')](_0x1fb9a6);}return _0x2e19f1[_0xffbc('0x35')]();};}function saveUpdates(_0x136b2b,_0x24c024){return function(_0x552993){if(_0x552993){return _0x552993[_0xffbc('0x36')](_0x136b2b)[_0xffbc('0x1e')](function(_0x13cd7a){return _0x13cd7a;});}return null;};}function removeEntity(_0x42856e,_0x4479bd){return function(_0x39e413){if(_0x39e413){return _0x39e413[_0xffbc('0x37')]()[_0xffbc('0x1e')](function(){_0x42856e[_0xffbc('0x2b')](0xcc)[_0xffbc('0x2c')]();});}};}function handleEntityNotFound(_0x5a8cb2,_0x345dd4){return function(_0x3403f0){if(!_0x3403f0){_0x5a8cb2[_0xffbc('0x2a')](0x194);}return _0x3403f0;};}function handleError(_0x4f7237,_0x1928e2){_0x1928e2=_0x1928e2||0x1f4;return function(_0x225cac){logger['error'](_0x225cac[_0xffbc('0x38')]);if(_0x225cac['name']){delete _0x225cac['name'];}_0x4f7237[_0xffbc('0x2b')](_0x1928e2)[_0xffbc('0x39')](_0x225cac);};}exports['index']=function(_0x20c8fd,_0x3afdbb){var _0x1b1a0d={},_0x4a642b={},_0x54abf1={'count':0x0,'rows':[]};var _0x394a15=_[_0xffbc('0x3a')](db[_0xffbc('0x3b')][_0xffbc('0x3c')],function(_0x4c7c39){return{'name':_0x4c7c39[_0xffbc('0x3d')],'type':_0x4c7c39['type'][_0xffbc('0x3e')]};});_0x4a642b['model']=_[_0xffbc('0x3a')](_0x394a15,_0xffbc('0x3f'));_0x4a642b[_0xffbc('0x40')]=_[_0xffbc('0x41')](_0x20c8fd[_0xffbc('0x40')]);_0x4a642b[_0xffbc('0x42')]=_[_0xffbc('0x43')](_0x4a642b['model'],_0x4a642b[_0xffbc('0x40')]);_0x1b1a0d[_0xffbc('0x44')]=_['intersection'](_0x4a642b['model'],qs[_0xffbc('0x45')](_0x20c8fd[_0xffbc('0x40')]['fields']));_0x1b1a0d[_0xffbc('0x44')]=_0x1b1a0d['attributes'][_0xffbc('0x46')]?_0x1b1a0d[_0xffbc('0x44')]:_0x4a642b['model'];if(!_0x20c8fd['query'][_0xffbc('0x47')](_0xffbc('0x48'))){_0x1b1a0d[_0xffbc('0x2e')]=qs[_0xffbc('0x2e')](_0x20c8fd[_0xffbc('0x40')][_0xffbc('0x2e')]);_0x1b1a0d[_0xffbc('0x31')]=qs[_0xffbc('0x31')](_0x20c8fd['query']['offset']);}_0x1b1a0d['order']=qs['sort'](_0x20c8fd[_0xffbc('0x40')][_0xffbc('0x49')]);_0x1b1a0d[_0xffbc('0x4a')]=qs[_0xffbc('0x42')](_[_0xffbc('0x4b')](_0x20c8fd[_0xffbc('0x40')],_0x4a642b[_0xffbc('0x42')]),_0x394a15);if(_0x20c8fd[_0xffbc('0x40')]['filter']){_0x1b1a0d['where']=_[_0xffbc('0x4c')](_0x1b1a0d[_0xffbc('0x4a')],{'$or':_['map'](_0x394a15,function(_0x1a2cb4){if(_0x1a2cb4[_0xffbc('0x4d')]!=='VIRTUAL'){var _0x4a3625={};_0x4a3625[_0x1a2cb4[_0xffbc('0x3f')]]={'$like':'%'+_0x20c8fd[_0xffbc('0x40')][_0xffbc('0x4e')]+'%'};return _0x4a3625;}})});}_0x1b1a0d=_['merge']({},_0x1b1a0d,_0x20c8fd[_0xffbc('0x4f')]);var _0x4888f4={'where':_0x1b1a0d['where']};return db[_0xffbc('0x3b')][_0xffbc('0x30')](_0x4888f4)[_0xffbc('0x1e')](function(_0x3f2a4e){_0x54abf1[_0xffbc('0x30')]=_0x3f2a4e;if(_0x20c8fd[_0xffbc('0x40')][_0xffbc('0x50')]){_0x1b1a0d[_0xffbc('0x51')]=[{'all':!![]}];}return db[_0xffbc('0x3b')]['findAll'](_0x1b1a0d);})[_0xffbc('0x1e')](function(_0x3f6bdd){_0x54abf1[_0xffbc('0x52')]=_0x3f6bdd;return _0x54abf1;})[_0xffbc('0x1e')](respondWithFilteredResult(_0x3afdbb,_0x1b1a0d))[_0xffbc('0x29')](handleError(_0x3afdbb,null));};exports[_0xffbc('0x53')]=function(_0x39bcee,_0x49f6d1){var _0x404560={'raw':!![],'where':{'id':_0x39bcee['params']['id']}},_0xfc2578={};_0xfc2578[_0xffbc('0x54')]=_['keys'](db[_0xffbc('0x3b')][_0xffbc('0x3c')]);_0xfc2578[_0xffbc('0x40')]=_['keys'](_0x39bcee[_0xffbc('0x40')]);_0xfc2578[_0xffbc('0x42')]=_[_0xffbc('0x43')](_0xfc2578['model'],_0xfc2578[_0xffbc('0x40')]);_0x404560[_0xffbc('0x44')]=_['intersection'](_0xfc2578[_0xffbc('0x54')],qs[_0xffbc('0x45')](_0x39bcee[_0xffbc('0x40')][_0xffbc('0x45')]));_0x404560[_0xffbc('0x44')]=_0x404560['attributes']['length']?_0x404560[_0xffbc('0x44')]:_0xfc2578['model'];if(_0x39bcee['query'][_0xffbc('0x50')]){_0x404560['include']=[{'all':!![]}];}_0x404560=_[_0xffbc('0x4c')]({},_0x404560,_0x39bcee['options']);return db[_0xffbc('0x3b')]['find'](_0x404560)['then'](handleEntityNotFound(_0x49f6d1,null))['then'](respondWithResult(_0x49f6d1,null))[_0xffbc('0x29')](handleError(_0x49f6d1,null));};exports['create']=function(_0x4cb04d,_0x57eeaf){return db[_0xffbc('0x3b')][_0xffbc('0x55')](_0x4cb04d[_0xffbc('0x56')],{})[_0xffbc('0x1e')](respondWithResult(_0x57eeaf,0xc9))[_0xffbc('0x29')](handleError(_0x57eeaf,null));};exports[_0xffbc('0x36')]=function(_0x2027c2,_0x22cd15){if(_0x2027c2[_0xffbc('0x56')]['id']){delete _0x2027c2[_0xffbc('0x56')]['id'];}return db['WhatsappMessage'][_0xffbc('0x57')]({'where':{'id':_0x2027c2[_0xffbc('0x58')]['id']}})['then'](handleEntityNotFound(_0x22cd15,null))['then'](saveUpdates(_0x2027c2[_0xffbc('0x56')],null))['then'](respondWithResult(_0x22cd15,null))[_0xffbc('0x29')](handleError(_0x22cd15,null));};exports[_0xffbc('0x37')]=function(_0x3c7e68,_0x8ce8a8){return db[_0xffbc('0x3b')][_0xffbc('0x57')]({'where':{'id':_0x3c7e68[_0xffbc('0x58')]['id']}})[_0xffbc('0x1e')](handleEntityNotFound(_0x8ce8a8,null))[_0xffbc('0x1e')](removeEntity(_0x8ce8a8,null))[_0xffbc('0x29')](handleError(_0x8ce8a8,null));};exports['describe']=function(_0x1ec952,_0xf3e486){return db['WhatsappMessage'][_0xffbc('0x59')]()[_0xffbc('0x1e')](respondWithResult(_0xf3e486,null))[_0xffbc('0x29')](handleError(_0xf3e486,null));};var interaction_log=require(_0xffbc('0x11'))(_0xffbc('0x5a'));exports['accept']=function(_0x3b978d,_0x46ef81,_0x163844){var _0x3faae6={'agent':{},'channel':_0xffbc('0x5b')};if(_0x3b978d['body']['id']){delete _0x3b978d['body']['id'];}_0x3b978d['body']['read']=!![];_0x3b978d['body'][_0xffbc('0x5c')]=moment()[_0xffbc('0x5d')](_0xffbc('0x5e'));_0x3b978d[_0xffbc('0x56')]['UserId']=_0x3b978d[_0xffbc('0x56')][_0xffbc('0x5f')]||_0x3b978d[_0xffbc('0x60')]['id'];_0x3faae6['agent']['id']=_0x3b978d[_0xffbc('0x56')]['UserId'];return db['WhatsappMessage']['find']({'where':{'id':_0x3b978d[_0xffbc('0x58')]['id'],'UserId':null}})[_0xffbc('0x1e')](handleEntityNotFound(_0x46ef81,null))[_0xffbc('0x1e')](saveUpdates(_0x3b978d[_0xffbc('0x56')],null))['then'](function(_0x2154eb){if(_0x2154eb){_0x3faae6['message']=_0x2154eb[_0xffbc('0x61')]({'plain':!![]});return db[_0xffbc('0x62')]['find']({'where':{'id':_0x2154eb['WhatsappInteractionId']}});}return null;})[_0xffbc('0x1e')](handleEntityNotFound(_0x46ef81,null))['then'](function(_0x157cee){if(_0x157cee){return _0x157cee[_0xffbc('0x36')]({'UserId':_0x3b978d[_0xffbc('0x56')][_0xffbc('0x5f')],'read1stAt':_[_0xffbc('0x63')](_0x157cee[_0xffbc('0x64')])?moment()[_0xffbc('0x5d')](_0xffbc('0x5e')):undefined});}return null;})[_0xffbc('0x1e')](function(_0x3cb55c){if(_0x3cb55c){_0x3faae6[_0xffbc('0x65')]=_0x3cb55c[_0xffbc('0x61')]({'plain':!![]});interaction_log['info'](_0xffbc('0x66'),_0x3b978d[_0xffbc('0x60')]['id'],_0x3b978d[_0xffbc('0x60')][_0xffbc('0x3f')],_0x3b978d[_0xffbc('0x60')][_0xffbc('0x67')],_0x3faae6[_0xffbc('0x65')]['id'],_0x3b978d[_0xffbc('0x56')]?JSON[_0xffbc('0x23')](_0x3b978d[_0xffbc('0x56')]):_0xffbc('0x68'));return respondWithRpcPromise(_0xffbc('0x69'),_0xffbc('0x6a'),_0x3faae6);}return null;})[_0xffbc('0x1e')](function(_0x4428fe){var _0x2ed74f='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4428fe[_0xffbc('0x27')][_0xffbc('0x6b')];return db[_0xffbc('0x6c')][_0xffbc('0x40')](_0x2ed74f,{'type':db[_0xffbc('0x6d')][_0xffbc('0x6e')][_0xffbc('0x6f')],'raw':!![]})['then'](function(_0x49fcae){return _0x49fcae;});})['then'](function(_0x35cf4f){if(_0x35cf4f){_0x3faae6[_0xffbc('0x27')][_0xffbc('0x70')]=_0x35cf4f[0x0];if(!_0x3b978d[_0xffbc('0x56')]['UserId'])return;return db[_0xffbc('0x71')][_0xffbc('0x57')]({'where':{'id':_0x3b978d[_0xffbc('0x56')][_0xffbc('0x5f')],'role':'agent'},'attributes':['id',_0xffbc('0x3f'),_0xffbc('0x72'),_0xffbc('0x73'),_0xffbc('0x74')],'raw':!![]});}return null;})['then'](function(_0x4c478f){if(!_0x4c478f)return null;_0x3faae6['message'][_0xffbc('0x75')]=_0x4c478f;return _0x3faae6;})[_0xffbc('0x1e')](function(_0x46698a){if(_0x46698a){if(_0x3b978d[_0xffbc('0x56')][_0xffbc('0x76')]){_0x3faae6[_0xffbc('0x27')][_0xffbc('0x77')]=util[_0xffbc('0x5d')](_0xffbc('0x78'),_0x3b978d[_0xffbc('0x60')]['name']);_0x3faae6[_0xffbc('0x27')]['channel']=_0x3faae6[_0xffbc('0x79')];_0x3faae6[_0xffbc('0x27')][_0xffbc('0x7a')]=_0x3faae6[_0xffbc('0x79')];_0x3faae6[_0xffbc('0x27')]['event']=_0xffbc('0x7b');return respondWithRpcPromise(_0xffbc('0x7c'),_0xffbc('0x7c'),{'event':_0xffbc('0x7d'),'message':_0x3faae6[_0xffbc('0x27')]},client9002)['then'](function(){return _0x3faae6;});}return _0x3faae6;}return null;})[_0xffbc('0x1e')](respondWithResult(_0x46ef81,null))['catch'](handleError(_0x46ef81,null));};var interaction_log=require('../../config/logger')('whatsapp-interactions');exports[_0xffbc('0x34')]=function(_0x1e3956,_0x1d25ea,_0x1e5309){var _0x22e456={'agent':{},'channel':_0xffbc('0x5b')};if(_0x1e3956[_0xffbc('0x56')]['id']){delete _0x1e3956[_0xffbc('0x56')]['id'];}_0x1e3956['body'][_0xffbc('0x5f')]=_0x1e3956[_0xffbc('0x56')][_0xffbc('0x5f')]||_0x1e3956[_0xffbc('0x60')]['id'];_0x22e456[_0xffbc('0x75')]['id']=_0x1e3956['body'][_0xffbc('0x5f')];return db['WhatsappMessage']['find']({'where':{'id':_0x1e3956['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1d25ea,null))[_0xffbc('0x1e')](function(_0xfcb1d){if(_0xfcb1d){_0x22e456[_0xffbc('0x27')]=_0xfcb1d[_0xffbc('0x61')]({'plain':!![]});return db[_0xffbc('0x62')]['find']({'where':{'id':_0xfcb1d[_0xffbc('0x7e')]}});}return null;})[_0xffbc('0x1e')](handleEntityNotFound(_0x1d25ea,null))[_0xffbc('0x1e')](function(_0x341af1){if(_0x341af1){_0x22e456[_0xffbc('0x65')]=_0x341af1[_0xffbc('0x61')]({'plain':!![]});interaction_log[_0xffbc('0x1f')](_0xffbc('0x7f'),_0x1e3956[_0xffbc('0x60')]['id'],_0x1e3956[_0xffbc('0x60')][_0xffbc('0x3f')],_0x1e3956[_0xffbc('0x60')][_0xffbc('0x67')],_0x22e456[_0xffbc('0x65')]['id'],_0x1e3956[_0xffbc('0x56')]?JSON[_0xffbc('0x23')](_0x1e3956[_0xffbc('0x56')]):_0xffbc('0x68'));return respondWithRpcPromise('RejectMessage',_0xffbc('0x80'),_0x22e456);}return null;})[_0xffbc('0x1e')](function(_0x2451b6){var _0x2b8f6d=_0xffbc('0x81')+_0x2451b6[_0xffbc('0x27')][_0xffbc('0x6b')];return db[_0xffbc('0x6c')][_0xffbc('0x40')](_0x2b8f6d,{'type':db['Sequelize'][_0xffbc('0x6e')]['SELECT'],'raw':!![]})[_0xffbc('0x1e')](function(_0x26a892){return _0x26a892;});})[_0xffbc('0x1e')](function(_0x1565d0){if(_0x1565d0){_0x22e456['message'][_0xffbc('0x70')]=_0x1565d0[0x0];if(!_0x1e3956[_0xffbc('0x56')]['UserId'])return;return db[_0xffbc('0x71')][_0xffbc('0x57')]({'where':{'id':_0x1e3956[_0xffbc('0x56')]['UserId'],'role':_0xffbc('0x75')},'attributes':['id',_0xffbc('0x3f'),_0xffbc('0x72'),_0xffbc('0x73'),_0xffbc('0x74')],'raw':!![]});}return null;})['then'](function(_0x40aa11){if(!_0x40aa11)return null;_0x22e456['message'][_0xffbc('0x75')]=_0x40aa11;return _0x22e456;})[_0xffbc('0x1e')](function(_0x182286){if(_0x182286){_0x182286[_0xffbc('0x27')][_0xffbc('0x77')]=util[_0xffbc('0x5d')]('SIP/%s',_0x1e3956[_0xffbc('0x60')]['name']);_0x182286[_0xffbc('0x27')][_0xffbc('0x79')]=_0x22e456[_0xffbc('0x79')];_0x182286[_0xffbc('0x27')]['motionChannel']=_0x22e456[_0xffbc('0x79')];_0x182286['message'][_0xffbc('0x82')]=_0xffbc('0x34');respondWithRpcPromise('EventManager',_0xffbc('0x7c'),{'event':_0xffbc('0x83'),'message':_0x182286[_0xffbc('0x27')]},client9002);return _0x22e456;}return null;})[_0xffbc('0x1e')](respondWithResult(_0x1d25ea,null))['catch'](handleError(_0x1d25ea,null));};exports[_0xffbc('0x2b')]=function(_0x2b87f3,_0x5a364c,_0x131173){if(_0x2b87f3[_0xffbc('0x56')]['id']){delete _0x2b87f3[_0xffbc('0x56')]['id'];}var _0x186486;return db[_0xffbc('0x3b')][_0xffbc('0x57')]({'where':{'id':_0x2b87f3[_0xffbc('0x58')]['id']}})[_0xffbc('0x1e')](handleEntityNotFound(_0x5a364c,null))[_0xffbc('0x1e')](function(_0x292318){if(_0x292318){_0x186486=_0x292318;return db[_0xffbc('0x84')][_0xffbc('0x57')]({'where':{'id':_0x292318[_0xffbc('0x85')]}});}})[_0xffbc('0x1e')](handleEntityNotFound(_0x5a364c,null))[_0xffbc('0x1e')](function(_0x21f613){if(_0x21f613){logger[_0xffbc('0x21')]('WhatsppMessage,\x20%s,\x20%s,\x20%s',_0xffbc('0x2b'),'received\x20delivery\x20report\x20from',_0x21f613[_0xffbc('0x4d')],util[_0xffbc('0x86')](_0x2b87f3[_0xffbc('0x56')],{'showHidden':![],'depth':null}));switch(_0x21f613[_0xffbc('0x4d')]){case'twilio':if(_0x2b87f3[_0xffbc('0x56')][_0xffbc('0x87')]&&_0x2b87f3['body'][_0xffbc('0x87')]===_0x186486[_0xffbc('0x88')]&&_0x2b87f3[_0xffbc('0x56')][_0xffbc('0x89')]&&_0x2b87f3['body'][_0xffbc('0x89')]===_0xffbc('0x8a')){return _0x186486['update']({'read':!![]});}else{logger[_0xffbc('0x24')](_0xffbc('0x8b'),_0xffbc('0x2b'),_0xffbc('0x8c'),util[_0xffbc('0x86')](_0x2b87f3[_0xffbc('0x56')],{'showHidden':![],'depth':null}));}break;}return _0x186486;}})[_0xffbc('0x1e')](respondWithResult(_0x5a364c,null))[_0xffbc('0x29')](handleError(_0x5a364c,null));}; \ No newline at end of file +var _0x7260=['eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','to-csv','ejs','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','redis','defaults','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','client','request','then','WhatsappMessage,\x20%s,\x20%s','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','catch','sendStatus','status','json','undefined','limit','count','offset','set','reject','save','update','destroy','end','name','send','index','map','rawAttributes','fieldName','type','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','WhatsappMessage','includeAll','findAll','rows','show','params','options','find','create','body','describe','whatsapp-interactions','accept','whatsapp','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','interaction','get','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','agent','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','contact','WhatsappAccount','WhatsppMessage,\x20%s,\x20%s,\x20%s','inspect','twilio','MessageSid','messageId','MessageStatus'];(function(_0x1b293f,_0x160df1){var _0x37b49d=function(_0x123935){while(--_0x123935){_0x1b293f['push'](_0x1b293f['shift']());}};_0x37b49d(++_0x160df1);}(_0x7260,0x189));var _0x0726=function(_0x19f3c2,_0x15f272){_0x19f3c2=_0x19f3c2-0x0;var _0x1ae167=_0x7260[_0x19f3c2];return _0x1ae167;};'use strict';var emlformat=require(_0x0726('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0726('0x1'));var jsonpatch=require(_0x0726('0x2'));var rp=require(_0x0726('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0726('0x4'));var util=require(_0x0726('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x0726('0x6'));var ejs=require(_0x0726('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0726('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0726('0x9'));var toCsv=require(_0x0726('0x6'));var querystring=require(_0x0726('0xa'));var Papa=require(_0x0726('0xb'));var Redis=require(_0x0726('0xc'));var authService=require(_0x0726('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x0726('0xe'));var hardwareService=require(_0x0726('0xf'));var logger=require(_0x0726('0x10'))('api');var utils=require(_0x0726('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x0726('0x12'));var db=require('../../mysqldb')['db'];config[_0x0726('0x13')]=_[_0x0726('0x14')](config[_0x0726('0x13')],{'host':'localhost','port':0x18eb});var socket=require(_0x0726('0x15'))(new Redis(config[_0x0726('0x13')]));require(_0x0726('0x16'))[_0x0726('0x17')](socket);var jayson=require(_0x0726('0x18'));var client=jayson[_0x0726('0x19')]['http']({'port':0x232c});var client9002=jayson[_0x0726('0x19')]['http']({'port':0x232a});function respondWithRpcPromise(_0x31fa12,_0x5093eb,_0xd4ed91,_0x36e3cb){return new BPromise(function(_0x15fabe,_0x45db88){var _0xed2a34=_0x36e3cb||client;return _0xed2a34[_0x0726('0x1a')](_0x31fa12,_0xd4ed91)[_0x0726('0x1b')](function(_0x5994c8){logger['info'](_0x0726('0x1c'),_0x5093eb,'request\x20sent');logger[_0x0726('0x1d')](_0x0726('0x1e'),_0x5093eb,_0x0726('0x1f'),JSON[_0x0726('0x20')](_0x5994c8));if(_0x5994c8[_0x0726('0x21')]){if(_0x5994c8['error']['code']===0x1f4){logger[_0x0726('0x21')](_0x0726('0x1c'),_0x5093eb,_0x5994c8[_0x0726('0x21')][_0x0726('0x22')]);return _0x45db88(_0x5994c8[_0x0726('0x21')]['message']);}logger[_0x0726('0x21')](_0x0726('0x1c'),_0x5093eb,_0x5994c8[_0x0726('0x21')][_0x0726('0x22')]);return _0x15fabe(_0x5994c8[_0x0726('0x21')][_0x0726('0x22')]);}else{logger[_0x0726('0x23')](_0x0726('0x1c'),_0x5093eb,_0x0726('0x1f'));_0x15fabe(_0x5994c8['result'][_0x0726('0x22')]);}})[_0x0726('0x24')](function(_0x11e3d8){logger[_0x0726('0x21')](_0x0726('0x1c'),_0x5093eb,_0x11e3d8);_0x45db88(_0x11e3d8);});});}function respondWithStatusCode(_0x1a9e7b,_0x45fc23){_0x45fc23=_0x45fc23||0xcc;return function(_0x42bc13){if(_0x42bc13){return _0x1a9e7b[_0x0726('0x25')](_0x45fc23);}return _0x1a9e7b[_0x0726('0x26')](_0x45fc23)['end']();};}function respondWithResult(_0x447189,_0xdcbd9){_0xdcbd9=_0xdcbd9||0xc8;return function(_0x188333){if(_0x188333){return _0x447189[_0x0726('0x26')](_0xdcbd9)[_0x0726('0x27')](_0x188333);}};}function respondWithFilteredResult(_0x30ec99,_0x2c3a87){return function(_0x597ead){if(_0x597ead){var _0x48d69c=typeof _0x2c3a87['offset']===_0x0726('0x28')&&typeof _0x2c3a87[_0x0726('0x29')]===_0x0726('0x28');var _0x1882a3=_0x597ead[_0x0726('0x2a')];var _0x29235b=_0x48d69c?0x0:_0x2c3a87[_0x0726('0x2b')];var _0x3c8441=_0x48d69c?_0x597ead['count']:_0x2c3a87[_0x0726('0x2b')]+_0x2c3a87[_0x0726('0x29')];var _0x1ac3da;if(_0x3c8441>=_0x1882a3){_0x3c8441=_0x1882a3;_0x1ac3da=0xc8;}else{_0x1ac3da=0xce;}_0x30ec99[_0x0726('0x26')](_0x1ac3da);return _0x30ec99[_0x0726('0x2c')]('Content-Range',_0x29235b+'-'+_0x3c8441+'/'+_0x1882a3)[_0x0726('0x27')](_0x597ead);}return null;};}function patchUpdates(_0x31749f){return function(_0x2540f8){try{jsonpatch['apply'](_0x2540f8,_0x31749f,!![]);}catch(_0x4443ff){return BPromise[_0x0726('0x2d')](_0x4443ff);}return _0x2540f8[_0x0726('0x2e')]();};}function saveUpdates(_0x44da5e,_0x2ba903){return function(_0x4e282c){if(_0x4e282c){return _0x4e282c[_0x0726('0x2f')](_0x44da5e)[_0x0726('0x1b')](function(_0x1b692e){return _0x1b692e;});}return null;};}function removeEntity(_0x235a36,_0x42c982){return function(_0x48fc2e){if(_0x48fc2e){return _0x48fc2e[_0x0726('0x30')]()[_0x0726('0x1b')](function(){_0x235a36[_0x0726('0x26')](0xcc)[_0x0726('0x31')]();});}};}function handleEntityNotFound(_0x461f9e,_0x42d409){return function(_0x324644){if(!_0x324644){_0x461f9e['sendStatus'](0x194);}return _0x324644;};}function handleError(_0x4ef7f3,_0x6783a9){_0x6783a9=_0x6783a9||0x1f4;return function(_0x3a14ed){logger[_0x0726('0x21')](_0x3a14ed['stack']);if(_0x3a14ed[_0x0726('0x32')]){delete _0x3a14ed[_0x0726('0x32')];}_0x4ef7f3['status'](_0x6783a9)[_0x0726('0x33')](_0x3a14ed);};}exports[_0x0726('0x34')]=function(_0x18ac8e,_0x404d2f){var _0x4961f6={},_0x11ea3a={},_0x28f31a={'count':0x0,'rows':[]};var _0x354497=_[_0x0726('0x35')](db['WhatsappMessage'][_0x0726('0x36')],function(_0x17d936){return{'name':_0x17d936[_0x0726('0x37')],'type':_0x17d936[_0x0726('0x38')]['key']};});_0x11ea3a['model']=_[_0x0726('0x35')](_0x354497,_0x0726('0x32'));_0x11ea3a[_0x0726('0x39')]=_[_0x0726('0x3a')](_0x18ac8e['query']);_0x11ea3a[_0x0726('0x3b')]=_['intersection'](_0x11ea3a[_0x0726('0x3c')],_0x11ea3a[_0x0726('0x39')]);_0x4961f6[_0x0726('0x3d')]=_[_0x0726('0x3e')](_0x11ea3a[_0x0726('0x3c')],qs['fields'](_0x18ac8e[_0x0726('0x39')][_0x0726('0x3f')]));_0x4961f6['attributes']=_0x4961f6[_0x0726('0x3d')][_0x0726('0x40')]?_0x4961f6[_0x0726('0x3d')]:_0x11ea3a[_0x0726('0x3c')];if(!_0x18ac8e[_0x0726('0x39')][_0x0726('0x41')](_0x0726('0x42'))){_0x4961f6[_0x0726('0x29')]=qs[_0x0726('0x29')](_0x18ac8e[_0x0726('0x39')][_0x0726('0x29')]);_0x4961f6['offset']=qs['offset'](_0x18ac8e['query']['offset']);}_0x4961f6[_0x0726('0x43')]=qs['sort'](_0x18ac8e['query'][_0x0726('0x44')]);_0x4961f6[_0x0726('0x45')]=qs[_0x0726('0x3b')](_[_0x0726('0x46')](_0x18ac8e[_0x0726('0x39')],_0x11ea3a['filters']),_0x354497);if(_0x18ac8e[_0x0726('0x39')][_0x0726('0x47')]){_0x4961f6[_0x0726('0x45')]=_[_0x0726('0x48')](_0x4961f6[_0x0726('0x45')],{'$or':_[_0x0726('0x35')](_0x354497,function(_0x9c3b05){if(_0x9c3b05['type']!=='VIRTUAL'){var _0x23dea8={};_0x23dea8[_0x9c3b05[_0x0726('0x32')]]={'$like':'%'+_0x18ac8e[_0x0726('0x39')]['filter']+'%'};return _0x23dea8;}})});}_0x4961f6=_[_0x0726('0x48')]({},_0x4961f6,_0x18ac8e['options']);var _0x235cf1={'where':_0x4961f6['where']};return db[_0x0726('0x49')][_0x0726('0x2a')](_0x235cf1)[_0x0726('0x1b')](function(_0x209620){_0x28f31a[_0x0726('0x2a')]=_0x209620;if(_0x18ac8e[_0x0726('0x39')][_0x0726('0x4a')]){_0x4961f6['include']=[{'all':!![]}];}return db[_0x0726('0x49')][_0x0726('0x4b')](_0x4961f6);})[_0x0726('0x1b')](function(_0x11f288){_0x28f31a[_0x0726('0x4c')]=_0x11f288;return _0x28f31a;})[_0x0726('0x1b')](respondWithFilteredResult(_0x404d2f,_0x4961f6))[_0x0726('0x24')](handleError(_0x404d2f,null));};exports[_0x0726('0x4d')]=function(_0xd400a4,_0x4f35c5){var _0x16f281={'raw':!![],'where':{'id':_0xd400a4[_0x0726('0x4e')]['id']}},_0x333a96={};_0x333a96['model']=_[_0x0726('0x3a')](db[_0x0726('0x49')][_0x0726('0x36')]);_0x333a96[_0x0726('0x39')]=_[_0x0726('0x3a')](_0xd400a4[_0x0726('0x39')]);_0x333a96[_0x0726('0x3b')]=_[_0x0726('0x3e')](_0x333a96['model'],_0x333a96[_0x0726('0x39')]);_0x16f281[_0x0726('0x3d')]=_[_0x0726('0x3e')](_0x333a96[_0x0726('0x3c')],qs[_0x0726('0x3f')](_0xd400a4[_0x0726('0x39')][_0x0726('0x3f')]));_0x16f281[_0x0726('0x3d')]=_0x16f281[_0x0726('0x3d')][_0x0726('0x40')]?_0x16f281[_0x0726('0x3d')]:_0x333a96['model'];if(_0xd400a4['query'][_0x0726('0x4a')]){_0x16f281['include']=[{'all':!![]}];}_0x16f281=_[_0x0726('0x48')]({},_0x16f281,_0xd400a4[_0x0726('0x4f')]);return db['WhatsappMessage'][_0x0726('0x50')](_0x16f281)[_0x0726('0x1b')](handleEntityNotFound(_0x4f35c5,null))[_0x0726('0x1b')](respondWithResult(_0x4f35c5,null))[_0x0726('0x24')](handleError(_0x4f35c5,null));};exports[_0x0726('0x51')]=function(_0x4aa837,_0x58b9a4){return db[_0x0726('0x49')][_0x0726('0x51')](_0x4aa837[_0x0726('0x52')],{})[_0x0726('0x1b')](respondWithResult(_0x58b9a4,0xc9))[_0x0726('0x24')](handleError(_0x58b9a4,null));};exports[_0x0726('0x2f')]=function(_0x5f1bdc,_0x5afb44){if(_0x5f1bdc['body']['id']){delete _0x5f1bdc[_0x0726('0x52')]['id'];}return db[_0x0726('0x49')][_0x0726('0x50')]({'where':{'id':_0x5f1bdc[_0x0726('0x4e')]['id']}})[_0x0726('0x1b')](handleEntityNotFound(_0x5afb44,null))[_0x0726('0x1b')](saveUpdates(_0x5f1bdc[_0x0726('0x52')],null))['then'](respondWithResult(_0x5afb44,null))['catch'](handleError(_0x5afb44,null));};exports[_0x0726('0x30')]=function(_0xe1427e,_0x3f5453){return db[_0x0726('0x49')][_0x0726('0x50')]({'where':{'id':_0xe1427e['params']['id']}})['then'](handleEntityNotFound(_0x3f5453,null))[_0x0726('0x1b')](removeEntity(_0x3f5453,null))['catch'](handleError(_0x3f5453,null));};exports[_0x0726('0x53')]=function(_0x1d4d4c,_0x2eafee){return db['WhatsappMessage']['describe']()[_0x0726('0x1b')](respondWithResult(_0x2eafee,null))[_0x0726('0x24')](handleError(_0x2eafee,null));};var interaction_log=require(_0x0726('0x10'))(_0x0726('0x54'));exports[_0x0726('0x55')]=function(_0xe7b4ca,_0xe130da,_0x2f6230){var _0x1ac115={'agent':{},'channel':_0x0726('0x56')};if(_0xe7b4ca[_0x0726('0x52')]['id']){delete _0xe7b4ca[_0x0726('0x52')]['id'];}_0xe7b4ca[_0x0726('0x52')][_0x0726('0x57')]=!![];_0xe7b4ca[_0x0726('0x52')]['readAt']=moment()[_0x0726('0x58')](_0x0726('0x59'));_0xe7b4ca[_0x0726('0x52')][_0x0726('0x5a')]=_0xe7b4ca[_0x0726('0x52')][_0x0726('0x5a')]||_0xe7b4ca[_0x0726('0x5b')]['id'];_0x1ac115['agent']['id']=_0xe7b4ca[_0x0726('0x52')][_0x0726('0x5a')];return db[_0x0726('0x49')][_0x0726('0x50')]({'where':{'id':_0xe7b4ca[_0x0726('0x4e')]['id'],'UserId':null}})[_0x0726('0x1b')](handleEntityNotFound(_0xe130da,null))['then'](saveUpdates(_0xe7b4ca[_0x0726('0x52')],null))['then'](function(_0x43de5d){if(_0x43de5d){_0x1ac115[_0x0726('0x22')]=_0x43de5d['get']({'plain':!![]});return db[_0x0726('0x5c')]['find']({'where':{'id':_0x43de5d[_0x0726('0x5d')]}});}return null;})['then'](handleEntityNotFound(_0xe130da,null))[_0x0726('0x1b')](function(_0x58cfe8){if(_0x58cfe8){return _0x58cfe8['update']({'UserId':_0xe7b4ca[_0x0726('0x52')][_0x0726('0x5a')],'read1stAt':_[_0x0726('0x5e')](_0x58cfe8[_0x0726('0x5f')])?moment()[_0x0726('0x58')](_0x0726('0x59')):undefined});}return null;})[_0x0726('0x1b')](function(_0x3cbf83){if(_0x3cbf83){_0x1ac115[_0x0726('0x60')]=_0x3cbf83[_0x0726('0x61')]({'plain':!![]});interaction_log[_0x0726('0x23')](_0x0726('0x62'),_0xe7b4ca[_0x0726('0x5b')]['id'],_0xe7b4ca[_0x0726('0x5b')][_0x0726('0x32')],_0xe7b4ca[_0x0726('0x5b')][_0x0726('0x63')],_0x1ac115[_0x0726('0x60')]['id'],_0xe7b4ca['body']?JSON[_0x0726('0x20')](_0xe7b4ca[_0x0726('0x52')]):_0x0726('0x64'));return respondWithRpcPromise(_0x0726('0x65'),'acceptMessage',_0x1ac115);}return null;})[_0x0726('0x1b')](function(_0x410bdb){var _0x5ad704='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x410bdb[_0x0726('0x22')][_0x0726('0x66')];return db[_0x0726('0x67')][_0x0726('0x39')](_0x5ad704,{'type':db[_0x0726('0x68')][_0x0726('0x69')][_0x0726('0x6a')],'raw':!![]})[_0x0726('0x1b')](function(_0x5d5c42){return _0x5d5c42;});})[_0x0726('0x1b')](function(_0x4de160){if(_0x4de160){_0x1ac115['message']['contact']=_0x4de160[0x0];if(!_0xe7b4ca[_0x0726('0x52')][_0x0726('0x5a')])return;return db[_0x0726('0x6b')][_0x0726('0x50')]({'where':{'id':_0xe7b4ca['body'][_0x0726('0x5a')],'role':_0x0726('0x6c')},'attributes':['id',_0x0726('0x32'),_0x0726('0x6d'),_0x0726('0x6e'),_0x0726('0x6f')],'raw':!![]});}return null;})[_0x0726('0x1b')](function(_0x1eb93a){if(!_0x1eb93a)return null;_0x1ac115['message'][_0x0726('0x6c')]=_0x1eb93a;return _0x1ac115;})[_0x0726('0x1b')](function(_0x16b000){if(_0x16b000){if(_0xe7b4ca[_0x0726('0x52')][_0x0726('0x70')]){_0x1ac115['message'][_0x0726('0x71')]=util['format'](_0x0726('0x72'),_0xe7b4ca[_0x0726('0x5b')][_0x0726('0x32')]);_0x1ac115[_0x0726('0x22')][_0x0726('0x73')]=_0x1ac115[_0x0726('0x73')];_0x1ac115[_0x0726('0x22')][_0x0726('0x74')]=_0x1ac115['channel'];_0x1ac115[_0x0726('0x22')][_0x0726('0x75')]=_0x0726('0x55');return respondWithRpcPromise(_0x0726('0x76'),_0x0726('0x76'),{'event':_0x0726('0x77'),'message':_0x1ac115[_0x0726('0x22')]},client9002)[_0x0726('0x1b')](function(){return _0x1ac115;});}return _0x1ac115;}return null;})['then'](respondWithResult(_0xe130da,null))['catch'](handleError(_0xe130da,null));};var interaction_log=require(_0x0726('0x10'))(_0x0726('0x54'));exports[_0x0726('0x2d')]=function(_0x6a80b6,_0x4cbdc9,_0x290907){var _0x4622d5={'agent':{},'channel':'whatsapp'};if(_0x6a80b6[_0x0726('0x52')]['id']){delete _0x6a80b6[_0x0726('0x52')]['id'];}_0x6a80b6[_0x0726('0x52')][_0x0726('0x5a')]=_0x6a80b6[_0x0726('0x52')]['UserId']||_0x6a80b6['user']['id'];_0x4622d5[_0x0726('0x6c')]['id']=_0x6a80b6[_0x0726('0x52')][_0x0726('0x5a')];return db[_0x0726('0x49')][_0x0726('0x50')]({'where':{'id':_0x6a80b6[_0x0726('0x4e')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4cbdc9,null))[_0x0726('0x1b')](function(_0x4f4d8f){if(_0x4f4d8f){_0x4622d5['message']=_0x4f4d8f[_0x0726('0x61')]({'plain':!![]});return db['WhatsappInteraction']['find']({'where':{'id':_0x4f4d8f[_0x0726('0x5d')]}});}return null;})[_0x0726('0x1b')](handleEntityNotFound(_0x4cbdc9,null))['then'](function(_0x3eb26e){if(_0x3eb26e){_0x4622d5[_0x0726('0x60')]=_0x3eb26e[_0x0726('0x61')]({'plain':!![]});interaction_log[_0x0726('0x23')]('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x6a80b6[_0x0726('0x5b')]['id'],_0x6a80b6[_0x0726('0x5b')]['name'],_0x6a80b6[_0x0726('0x5b')][_0x0726('0x63')],_0x4622d5[_0x0726('0x60')]['id'],_0x6a80b6[_0x0726('0x52')]?JSON[_0x0726('0x20')](_0x6a80b6[_0x0726('0x52')]):'null');return respondWithRpcPromise(_0x0726('0x78'),_0x0726('0x79'),_0x4622d5);}return null;})[_0x0726('0x1b')](function(_0x10ed5e){var _0x2b3c45=_0x0726('0x7a')+_0x10ed5e['message'][_0x0726('0x66')];return db[_0x0726('0x67')]['query'](_0x2b3c45,{'type':db[_0x0726('0x68')][_0x0726('0x69')][_0x0726('0x6a')],'raw':!![]})[_0x0726('0x1b')](function(_0x53be75){return _0x53be75;});})[_0x0726('0x1b')](function(_0x3a65f5){if(_0x3a65f5){_0x4622d5[_0x0726('0x22')][_0x0726('0x7b')]=_0x3a65f5[0x0];if(!_0x6a80b6[_0x0726('0x52')][_0x0726('0x5a')])return;return db['User'][_0x0726('0x50')]({'where':{'id':_0x6a80b6['body'][_0x0726('0x5a')],'role':_0x0726('0x6c')},'attributes':['id',_0x0726('0x32'),'fullname','email',_0x0726('0x6f')],'raw':!![]});}return null;})[_0x0726('0x1b')](function(_0x46a79d){if(!_0x46a79d)return null;_0x4622d5[_0x0726('0x22')][_0x0726('0x6c')]=_0x46a79d;return _0x4622d5;})[_0x0726('0x1b')](function(_0xc237e1){if(_0xc237e1){_0xc237e1['message']['interface']=util[_0x0726('0x58')](_0x0726('0x72'),_0x6a80b6[_0x0726('0x5b')][_0x0726('0x32')]);_0xc237e1['message'][_0x0726('0x73')]=_0x4622d5[_0x0726('0x73')];_0xc237e1[_0x0726('0x22')][_0x0726('0x74')]=_0x4622d5[_0x0726('0x73')];_0xc237e1[_0x0726('0x22')][_0x0726('0x75')]=_0x0726('0x2d');respondWithRpcPromise(_0x0726('0x76'),_0x0726('0x76'),{'event':'rejectmessage','message':_0xc237e1[_0x0726('0x22')]},client9002);return _0x4622d5;}return null;})[_0x0726('0x1b')](respondWithResult(_0x4cbdc9,null))[_0x0726('0x24')](handleError(_0x4cbdc9,null));};exports[_0x0726('0x26')]=function(_0x1f331b,_0x482354,_0x41871e){if(_0x1f331b['body']['id']){delete _0x1f331b[_0x0726('0x52')]['id'];}var _0x44cbe4;return db[_0x0726('0x49')][_0x0726('0x50')]({'where':{'id':_0x1f331b[_0x0726('0x4e')]['id']}})['then'](handleEntityNotFound(_0x482354,null))[_0x0726('0x1b')](function(_0x3aed22){if(_0x3aed22){_0x44cbe4=_0x3aed22;return db[_0x0726('0x7c')][_0x0726('0x50')]({'where':{'id':_0x3aed22['WhatsappAccountId']}});}})['then'](handleEntityNotFound(_0x482354,null))[_0x0726('0x1b')](function(_0xbe030b){if(_0xbe030b){logger[_0x0726('0x1d')](_0x0726('0x7d'),_0x0726('0x26'),'received\x20delivery\x20report\x20from',_0xbe030b[_0x0726('0x38')],util[_0x0726('0x7e')](_0x1f331b[_0x0726('0x52')],{'showHidden':![],'depth':null}));switch(_0xbe030b[_0x0726('0x38')]){case _0x0726('0x7f'):if(_0x1f331b['body'][_0x0726('0x80')]&&_0x1f331b['body'][_0x0726('0x80')]===_0x44cbe4[_0x0726('0x81')]&&_0x1f331b[_0x0726('0x52')][_0x0726('0x82')]&&_0x1f331b[_0x0726('0x52')][_0x0726('0x82')]===_0x0726('0x57')){return _0x44cbe4[_0x0726('0x2f')]({'read':!![]});}else{logger[_0x0726('0x21')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x0726('0x26'),_0x0726('0x7f'),util[_0x0726('0x7e')](_0x1f331b['body'],{'showHidden':![],'depth':null}));}break;}return _0x44cbe4;}})['then'](respondWithResult(_0x482354,null))['catch'](handleError(_0x482354,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 9087553..880b2d1 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 _0x705f=['update','remove','emit','hasOwnProperty','hook','WhatsappMessage','save'];(function(_0x2a0e9a,_0x334df0){var _0x17951b=function(_0x34a261){while(--_0x34a261){_0x2a0e9a['push'](_0x2a0e9a['shift']());}};_0x17951b(++_0x334df0);}(_0x705f,0x75));var _0xf705=function(_0x479f6f,_0x1c26c4){_0x479f6f=_0x479f6f-0x0;var _0x24e701=_0x705f[_0x479f6f];return _0x24e701;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require('../../mysqldb')['db'][_0xf705('0x0')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf705('0x1'),'afterUpdate':_0xf705('0x2'),'afterDestroy':_0xf705('0x3')};function emitEvent(_0x35760c){return function(_0x1dd679,_0x47514c,_0x9045cf){WhatsappMessageEvents[_0xf705('0x4')](_0x35760c+':'+_0x1dd679['id'],_0x1dd679);WhatsappMessageEvents[_0xf705('0x4')](_0x35760c,_0x1dd679);_0x9045cf(null);};}for(var e in events){if(events[_0xf705('0x5')](e)){var event=events[e];WhatsappMessage[_0xf705('0x6')](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents; \ No newline at end of file +var _0x8b29=['setMaxListeners','remove','emit','hasOwnProperty','hook','exports','events','WhatsappMessage'];(function(_0xe24c53,_0x57f5d2){var _0x4e78ec=function(_0x23a188){while(--_0x23a188){_0xe24c53['push'](_0xe24c53['shift']());}};_0x4e78ec(++_0x57f5d2);}(_0x8b29,0xbe));var _0x98b2=function(_0x15c5c5,_0x2249cf){_0x15c5c5=_0x15c5c5-0x0;var _0x4e9611=_0x8b29[_0x15c5c5];return _0x4e9611;};'use strict';var EventEmitter=require(_0x98b2('0x0'));var WhatsappMessage=require('../../mysqldb')['db'][_0x98b2('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x98b2('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x98b2('0x3')};function emitEvent(_0x20afa9){return function(_0x5bf7df,_0x209616,_0x5da9ce){WhatsappMessageEvents[_0x98b2('0x4')](_0x20afa9+':'+_0x5bf7df['id'],_0x5bf7df);WhatsappMessageEvents[_0x98b2('0x4')](_0x20afa9,_0x5bf7df);_0x5da9ce(null);};}for(var e in events){if(events[_0x98b2('0x5')](e)){var event=events[e];WhatsappMessage[_0x98b2('0x6')](e,emitEvent(event));}}module[_0x98b2('0x7')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index 0e20a76..823704c 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 _0x3fe1=['/api/whatsapp/messages/','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/whatsapp/v1/','/messages/','text','POST','application/json','statuses','message_id','update','err','WhatsappMessage,\x20%s','finally','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','node-fetch','rimraf','../../config/environment','exports','WhatsappMessage','messageId','fti_whatsapp_messages','FULLTEXT','models','get','direction','toLowerCase','out','WhatsappInteraction','findOne','WhatsappInteractionId','then','createdAt','catch','error','secret','WhatsappAccount','find','WhatsappAccountId','twilio','accountSid','authToken','messages','create','whatsapp:','phone'];(function(_0xad901d,_0x24475d){var _0x309f1a=function(_0x4a978b){while(--_0x4a978b){_0xad901d['push'](_0xad901d['shift']());}};_0x309f1a(++_0x24475d);}(_0x3fe1,0x89));var _0x13fe=function(_0x14e4a8,_0x239c0e){_0x14e4a8=_0x14e4a8-0x0;var _0x25a0e0=_0x3fe1[_0x14e4a8];return _0x25a0e0;};'use strict';var _=require('lodash');var util=require(_0x13fe('0x0'));var logger=require(_0x13fe('0x1'))(_0x13fe('0x2'));var moment=require(_0x13fe('0x3'));var BPromise=require(_0x13fe('0x4'));var rp=require(_0x13fe('0x5'));var fetch=require(_0x13fe('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x13fe('0x7'));var config=require(_0x13fe('0x8'));var attributes=require('./whatsappMessage.attributes');module[_0x13fe('0x9')]=function(_0x5d9ad0,_0x1e80de){return _0x5d9ad0['define'](_0x13fe('0xa'),attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':_0x13fe('0xb'),'fields':[_0x13fe('0xb')]},{'name':_0x13fe('0xc'),'fields':['body'],'type':_0x13fe('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x13dbec,_0x39f202,_0x1ba33b){var _0x2d4058=_0x5d9ad0[_0x13fe('0xe')];var _0x1feeaf=_0x13dbec[_0x13fe('0xf')]({'plain':!![]});if(_0x1feeaf[_0x13fe('0x10')]['toLowerCase']()==='in'||_0x1feeaf[_0x13fe('0x10')][_0x13fe('0x11')]()===_0x13fe('0x12')&&!_0x1feeaf['secret']&&!_['isNil'](_0x1feeaf['UserId'])){_0x2d4058[_0x13fe('0x13')][_0x13fe('0x14')]({'where':{'id':_0x1feeaf[_0x13fe('0x15')]}})[_0x13fe('0x16')](function(_0x149e31){if(_0x149e31){_0x149e31['update']({'lastMsgAt':_0x1feeaf[_0x13fe('0x17')],'lastMsgDirection':_0x1feeaf[_0x13fe('0x10')][_0x13fe('0x11')]()});}})[_0x13fe('0x18')](function(_0x57c375){console[_0x13fe('0x19')](_0x57c375);});}if(_0x1feeaf[_0x13fe('0x10')]==='out'&&!_0x1feeaf[_0x13fe('0x1a')]){var _0x1ef54b;_0x2d4058[_0x13fe('0x1b')][_0x13fe('0x1c')]({'where':{'id':_0x1feeaf[_0x13fe('0x1d')]},'raw':!![]})['then'](function(_0x2f2b16){_0x1ef54b=_0x2f2b16;if(_0x1ef54b&&_0x1ef54b['type']){switch(_0x1ef54b['type']){case _0x13fe('0x1e'):var _0x2c2c38=require(_0x13fe('0x1e'));if(_0x1ef54b[_0x13fe('0x1f')]&&_0x1ef54b['authToken']&&_0x1ef54b['phone']){var _0x5bd70f=new _0x2c2c38(_0x1ef54b[_0x13fe('0x1f')],_0x1ef54b[_0x13fe('0x20')]);_0x5bd70f[_0x13fe('0x21')][_0x13fe('0x22')]({'body':_0x1feeaf['body'],'to':_0x13fe('0x23')+_0x1feeaf[_0x13fe('0x24')],'from':_0x13fe('0x23')+_0x1ef54b[_0x13fe('0x24')],'statusCallback':_0x1ef54b['remote']+_0x13fe('0x25')+_0x1feeaf['id']+_0x13fe('0x26')+_0x1ef54b[_0x13fe('0x27')]})[_0x13fe('0x16')](function(_0x3a4487){if(_0x3a4487[_0x13fe('0x28')]){return _0x13dbec['update']({'messageId':_0x3a4487['sid']});}})['catch'](function(_0x90d160){logger[_0x13fe('0x19')](_0x13fe('0x29'),_0x13fe('0x2a'),'twilio',util['inspect'](_0x90d160,{'showHidden':![],'depth':null}));});}else{logger['error']('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x13fe('0x2a'),_0x13fe('0x1e'),_0x13fe('0x2b'));}break;case _0x13fe('0x2c'):var _0x1350d7=_0x1ef54b[_0x13fe('0x1f')];var _0x4aabd2=_0x1ef54b['authToken'];var _0x120c27=_0x1ef54b[_0x13fe('0x2d')]+_0x13fe('0x2e')+_0x1350d7+_0x13fe('0x2f');var _0x155f38={'to':[_0x1feeaf[_0x13fe('0x24')]],'message':{'type':_0x13fe('0x30'),'text':_0x1feeaf['body']}};var _0x2122ee={'method':_0x13fe('0x31'),'uri':_0x120c27,'headers':{'Authorization':'Bearer\x20'+_0x4aabd2,'Content-Type':_0x13fe('0x32')},'body':_0x155f38,'json':!![]};rp(_0x2122ee)[_0x13fe('0x16')](function(_0x3976c9){if(_0x3976c9[_0x13fe('0x33')][0x0][_0x13fe('0x34')]){return _0x13dbec[_0x13fe('0x35')]({'messageId':_0x3976c9[_0x13fe('0x33')][0x0]['message_id']});}})[_0x13fe('0x18')](function(_0x143b8a){logger[_0x13fe('0x36')](_0x13fe('0x37'),_0x143b8a);});break;}}})[_0x13fe('0x38')](function(){_0x1ba33b();});}else{_0x1ba33b();}}},'charset':'utf8mb4','collate':_0x13fe('0x39')});}; \ No newline at end of file +var _0xd363=['isNil','WhatsappInteraction','findOne','WhatsappInteractionId','then','update','createdAt','direction','catch','error','secret','WhatsappAccount','find','WhatsappAccountId','type','twilio','authToken','phone','accountSid','messages','create','whatsapp:','remote','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','/whatsapp/v1/','/messages/','text','Bearer\x20','application/json','statuses','message_id','err','WhatsappMessage,\x20%s','finally','lodash','util','api','bluebird','node-fetch','path','../../config/environment','./whatsappMessage.attributes','exports','define','WhatsappMessage','whatsapp_messages','messageId','body','models','get','toLowerCase','out'];(function(_0x27757d,_0x1c8554){var _0x639644=function(_0x1eff99){while(--_0x1eff99){_0x27757d['push'](_0x27757d['shift']());}};_0x639644(++_0x1c8554);}(_0xd363,0xd6));var _0x3d36=function(_0x2c699e,_0x5e9d6c){_0x2c699e=_0x2c699e-0x0;var _0x5844e3=_0xd363[_0x2c699e];return _0x5844e3;};'use strict';var _=require(_0x3d36('0x0'));var util=require(_0x3d36('0x1'));var logger=require('../../config/logger')(_0x3d36('0x2'));var moment=require('moment');var BPromise=require(_0x3d36('0x3'));var rp=require('request-promise');var fetch=require(_0x3d36('0x4'));var fs=require('fs');var path=require(_0x3d36('0x5'));var rimraf=require('rimraf');var config=require(_0x3d36('0x6'));var attributes=require(_0x3d36('0x7'));module[_0x3d36('0x8')]=function(_0x398d6f,_0x2c2980){return _0x398d6f[_0x3d36('0x9')](_0x3d36('0xa'),attributes,{'tableName':_0x3d36('0xb'),'paranoid':![],'indexes':[{'name':_0x3d36('0xc'),'fields':[_0x3d36('0xc')]},{'name':'fti_whatsapp_messages','fields':[_0x3d36('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x415a51,_0x3b4273,_0x73bbf){var _0x495fd5=_0x398d6f[_0x3d36('0xe')];var _0x3e2ed0=_0x415a51[_0x3d36('0xf')]({'plain':!![]});if(_0x3e2ed0['direction'][_0x3d36('0x10')]()==='in'||_0x3e2ed0['direction'][_0x3d36('0x10')]()===_0x3d36('0x11')&&!_0x3e2ed0['secret']&&!_[_0x3d36('0x12')](_0x3e2ed0['UserId'])){_0x495fd5[_0x3d36('0x13')][_0x3d36('0x14')]({'where':{'id':_0x3e2ed0[_0x3d36('0x15')]}})[_0x3d36('0x16')](function(_0x1945ed){if(_0x1945ed){_0x1945ed[_0x3d36('0x17')]({'lastMsgAt':_0x3e2ed0[_0x3d36('0x18')],'lastMsgDirection':_0x3e2ed0[_0x3d36('0x19')][_0x3d36('0x10')]()});}})[_0x3d36('0x1a')](function(_0x2f7da5){console[_0x3d36('0x1b')](_0x2f7da5);});}if(_0x3e2ed0['direction']===_0x3d36('0x11')&&!_0x3e2ed0[_0x3d36('0x1c')]){var _0x58af74;_0x495fd5[_0x3d36('0x1d')][_0x3d36('0x1e')]({'where':{'id':_0x3e2ed0[_0x3d36('0x1f')]},'raw':!![]})[_0x3d36('0x16')](function(_0x4cd546){_0x58af74=_0x4cd546;if(_0x58af74&&_0x58af74[_0x3d36('0x20')]){switch(_0x58af74[_0x3d36('0x20')]){case _0x3d36('0x21'):var _0x508927=require(_0x3d36('0x21'));if(_0x58af74['accountSid']&&_0x58af74[_0x3d36('0x22')]&&_0x58af74[_0x3d36('0x23')]){var _0x4b8f3f=new _0x508927(_0x58af74[_0x3d36('0x24')],_0x58af74['authToken']);_0x4b8f3f[_0x3d36('0x25')][_0x3d36('0x26')]({'body':_0x3e2ed0['body'],'to':_0x3d36('0x27')+_0x3e2ed0[_0x3d36('0x23')],'from':_0x3d36('0x27')+_0x58af74[_0x3d36('0x23')],'statusCallback':_0x58af74[_0x3d36('0x28')]+'/api/whatsapp/messages/'+_0x3e2ed0['id']+_0x3d36('0x29')+_0x58af74[_0x3d36('0x2a')]})[_0x3d36('0x16')](function(_0x2706a2){if(_0x2706a2[_0x3d36('0x2b')]){return _0x415a51[_0x3d36('0x17')]({'messageId':_0x2706a2[_0x3d36('0x2b')]});}})['catch'](function(_0x26e7a7){logger['error'](_0x3d36('0x2c'),_0x3d36('0x2d'),_0x3d36('0x21'),util[_0x3d36('0x2e')](_0x26e7a7,{'showHidden':![],'depth':null}));});}else{logger[_0x3d36('0x1b')](_0x3d36('0x2c'),'afterCreate',_0x3d36('0x21'),_0x3d36('0x2f'));}break;case'sinch':var _0x3127be=_0x58af74[_0x3d36('0x24')];var _0x5eedaf=_0x58af74[_0x3d36('0x22')];var _0x265702=_0x58af74['baseUrl']+_0x3d36('0x30')+_0x3127be+_0x3d36('0x31');var _0x31aa5b={'to':[_0x3e2ed0['phone']],'message':{'type':_0x3d36('0x32'),'text':_0x3e2ed0[_0x3d36('0xd')]}};var _0x22ea95={'method':'POST','uri':_0x265702,'headers':{'Authorization':_0x3d36('0x33')+_0x5eedaf,'Content-Type':_0x3d36('0x34')},'body':_0x31aa5b,'json':!![]};rp(_0x22ea95)['then'](function(_0x1f6250){if(_0x1f6250[_0x3d36('0x35')][0x0][_0x3d36('0x36')]){return _0x415a51[_0x3d36('0x17')]({'messageId':_0x1f6250[_0x3d36('0x35')][0x0]['message_id']});}})['catch'](function(_0x6d76f4){logger[_0x3d36('0x37')](_0x3d36('0x38'),_0x6d76f4);});break;}}})[_0x3d36('0x39')](function(){_0x73bbf();});}else{_0x73bbf();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index d4d0d63..bb6e9cb 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 _0xb3de=['../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateWhatsappMessage','WhatsappMessage','create','options','raw','lodash','util','moment','bluebird','randomstring'];(function(_0x1c4dce,_0x489776){var _0x95a038=function(_0x1b5f48){while(--_0x1b5f48){_0x1c4dce['push'](_0x1c4dce['shift']());}};_0x95a038(++_0x489776);}(_0xb3de,0x1c9));var _0xeb3d=function(_0x1e6e08,_0x1cd747){_0x1e6e08=_0x1e6e08-0x0;var _0x5995c4=_0xb3de[_0x1e6e08];return _0x5995c4;};'use strict';var _=require(_0xeb3d('0x0'));var util=require(_0xeb3d('0x1'));var moment=require(_0xeb3d('0x2'));var BPromise=require(_0xeb3d('0x3'));var rs=require(_0xeb3d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeb3d('0x5'));var logger=require(_0xeb3d('0x6'))('rpc');var config=require(_0xeb3d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xeb3d('0x8')][_0xeb3d('0x9')]({'port':0x232a});config[_0xeb3d('0xa')]=_[_0xeb3d('0xb')](config[_0xeb3d('0xa')],{'host':_0xeb3d('0xc'),'port':0x18eb});var socket=require(_0xeb3d('0xd'))(new Redis(config[_0xeb3d('0xa')]));require(_0xeb3d('0xe'))['register'](socket);function respondWithRpcPromise(_0x570fdd,_0x5c5b2c,_0x3350d1){return new BPromise(function(_0x1b8a1b,_0x449598){return client[_0xeb3d('0xf')](_0x570fdd,_0x3350d1)[_0xeb3d('0x10')](function(_0x279f77){logger[_0xeb3d('0x11')](_0xeb3d('0x12'),_0x5c5b2c,_0xeb3d('0x13'));logger[_0xeb3d('0x14')](_0xeb3d('0x15'),_0x5c5b2c,_0xeb3d('0x13'),JSON[_0xeb3d('0x16')](_0x279f77));if(_0x279f77[_0xeb3d('0x17')]){if(_0x279f77[_0xeb3d('0x17')][_0xeb3d('0x18')]===0x1f4){logger[_0xeb3d('0x17')](_0xeb3d('0x12'),_0x5c5b2c,_0x279f77[_0xeb3d('0x17')]['message']);return _0x449598(_0x279f77[_0xeb3d('0x17')]['message']);}logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x5c5b2c,_0x279f77[_0xeb3d('0x17')][_0xeb3d('0x19')]);return _0x1b8a1b(_0x279f77[_0xeb3d('0x17')][_0xeb3d('0x19')]);}else{logger['info'](_0xeb3d('0x12'),_0x5c5b2c,_0xeb3d('0x13'));_0x1b8a1b(_0x279f77[_0xeb3d('0x1a')][_0xeb3d('0x19')]);}})[_0xeb3d('0x1b')](function(_0x142eb5){logger[_0xeb3d('0x17')](_0xeb3d('0x12'),_0x5c5b2c,_0x142eb5);_0x449598(_0x142eb5);});});}exports[_0xeb3d('0x1c')]=function(_0x41a95c){var _0xa4e0e4=this;return new Promise(function(_0x1c9b14,_0x197761){return db[_0xeb3d('0x1d')][_0xeb3d('0x1e')](_0x41a95c['body'],{'raw':_0x41a95c[_0xeb3d('0x1f')]?_0x41a95c[_0xeb3d('0x1f')][_0xeb3d('0x20')]===undefined?!![]:![]:!![]})[_0xeb3d('0x10')](function(_0x9c7816){logger['info']('CreateWhatsappMessage',_0x41a95c);logger[_0xeb3d('0x14')](_0xeb3d('0x1c'),_0x41a95c,JSON[_0xeb3d('0x16')](_0x9c7816));_0x1c9b14(_0x9c7816);})[_0xeb3d('0x1b')](function(_0x52b140){logger[_0xeb3d('0x17')](_0xeb3d('0x1c'),_0x52b140['message'],_0x41a95c);_0x197761(_0xa4e0e4[_0xeb3d('0x17')](0x1f4,_0x52b140['message']));});});}; \ No newline at end of file +var _0x2a0a=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','error','message','CreateWhatsappMessage','WhatsappMessage','create','options','catch','lodash','util'];(function(_0x18839c,_0x48453b){var _0x16e30b=function(_0x5094a4){while(--_0x5094a4){_0x18839c['push'](_0x18839c['shift']());}};_0x16e30b(++_0x48453b);}(_0x2a0a,0x116));var _0xa2a0=function(_0x1e8b44,_0x245647){_0x1e8b44=_0x1e8b44-0x0;var _0x575a88=_0x2a0a[_0x1e8b44];return _0x575a88;};'use strict';var _=require(_0xa2a0('0x0'));var util=require(_0xa2a0('0x1'));var moment=require(_0xa2a0('0x2'));var BPromise=require(_0xa2a0('0x3'));var rs=require(_0xa2a0('0x4'));var fs=require('fs');var Redis=require(_0xa2a0('0x5'));var db=require(_0xa2a0('0x6'))['db'];var utils=require(_0xa2a0('0x7'));var logger=require(_0xa2a0('0x8'))('rpc');var config=require(_0xa2a0('0x9'));var jayson=require(_0xa2a0('0xa'));var client=jayson[_0xa2a0('0xb')][_0xa2a0('0xc')]({'port':0x232a});config[_0xa2a0('0xd')]=_[_0xa2a0('0xe')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa2a0('0xd')]));require('./whatsappMessage.socket')['register'](socket);function respondWithRpcPromise(_0x314fa6,_0x3f85c1,_0x5d1990){return new BPromise(function(_0x33a97a,_0x415792){return client[_0xa2a0('0xf')](_0x314fa6,_0x5d1990)[_0xa2a0('0x10')](function(_0x951920){logger[_0xa2a0('0x11')](_0xa2a0('0x12'),_0x3f85c1,_0xa2a0('0x13'));logger[_0xa2a0('0x14')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x3f85c1,_0xa2a0('0x13'),JSON['stringify'](_0x951920));if(_0x951920[_0xa2a0('0x15')]){if(_0x951920[_0xa2a0('0x15')]['code']===0x1f4){logger[_0xa2a0('0x15')]('WhatsappMessage,\x20%s,\x20%s',_0x3f85c1,_0x951920[_0xa2a0('0x15')]['message']);return _0x415792(_0x951920[_0xa2a0('0x15')][_0xa2a0('0x16')]);}logger['error'](_0xa2a0('0x12'),_0x3f85c1,_0x951920[_0xa2a0('0x15')][_0xa2a0('0x16')]);return _0x33a97a(_0x951920[_0xa2a0('0x15')][_0xa2a0('0x16')]);}else{logger['info'](_0xa2a0('0x12'),_0x3f85c1,_0xa2a0('0x13'));_0x33a97a(_0x951920['result']['message']);}})['catch'](function(_0x44e5e7){logger[_0xa2a0('0x15')]('WhatsappMessage,\x20%s,\x20%s',_0x3f85c1,_0x44e5e7);_0x415792(_0x44e5e7);});});}exports[_0xa2a0('0x17')]=function(_0x342e92){var _0x50faff=this;return new Promise(function(_0x3e3349,_0xbf2876){return db[_0xa2a0('0x18')][_0xa2a0('0x19')](_0x342e92['body'],{'raw':_0x342e92['options']?_0x342e92[_0xa2a0('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0xa2a0('0x10')](function(_0x2590c8){logger['info'](_0xa2a0('0x17'),_0x342e92);logger['debug'](_0xa2a0('0x17'),_0x342e92,JSON['stringify'](_0x2590c8));_0x3e3349(_0x2590c8);})[_0xa2a0('0x1b')](function(_0x3a64dc){logger[_0xa2a0('0x15')](_0xa2a0('0x17'),_0x3a64dc[_0xa2a0('0x16')],_0x342e92);_0xbf2876(_0x50faff[_0xa2a0('0x15')](0x1f4,_0x3a64dc[_0xa2a0('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 01f6705..21140ab 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 _0x5a78=['length','whatsappMessage:','./whatsappMessage.events','save','update','emit','register'];(function(_0x3f3f40,_0x4c71f4){var _0x403b7a=function(_0x509014){while(--_0x509014){_0x3f3f40['push'](_0x3f3f40['shift']());}};_0x403b7a(++_0x4c71f4);}(_0x5a78,0x183));var _0x85a7=function(_0x57b8a4,_0x57afb2){_0x57b8a4=_0x57b8a4-0x0;var _0x10cd11=_0x5a78[_0x57b8a4];return _0x10cd11;};'use strict';var WhatsappMessageEvents=require(_0x85a7('0x0'));var events=[_0x85a7('0x1'),'remove',_0x85a7('0x2')];function createListener(_0x3a8fd4,_0x460530){return function(_0x3489a5){_0x460530[_0x85a7('0x3')](_0x3a8fd4,_0x3489a5);};}function removeListener(_0x55821b,_0x3ced68){return function(){WhatsappMessageEvents['removeListener'](_0x55821b,_0x3ced68);};}exports[_0x85a7('0x4')]=function(_0x2f8388){for(var _0x10035e=0x0,_0x4c91f3=events[_0x85a7('0x5')];_0x10035e<_0x4c91f3;_0x10035e++){var _0x215ab5=events[_0x10035e];var _0x5adad5=createListener(_0x85a7('0x6')+_0x215ab5,_0x2f8388);WhatsappMessageEvents['on'](_0x215ab5,_0x5adad5);}}; \ No newline at end of file +var _0x6588=['update','emit','removeListener','register','./whatsappMessage.events','save','remove'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x6588,0x97));var _0x8658=function(_0x5b9dd7,_0x43a06e){_0x5b9dd7=_0x5b9dd7-0x0;var _0x49ec19=_0x6588[_0x5b9dd7];return _0x49ec19;};'use strict';var WhatsappMessageEvents=require(_0x8658('0x0'));var events=[_0x8658('0x1'),_0x8658('0x2'),_0x8658('0x3')];function createListener(_0x52be0b,_0x4dee87){return function(_0x1b22fa){_0x4dee87[_0x8658('0x4')](_0x52be0b,_0x1b22fa);};}function removeListener(_0x27c212,_0x1fe541){return function(){WhatsappMessageEvents[_0x8658('0x5')](_0x27c212,_0x1fe541);};}exports[_0x8658('0x6')]=function(_0x1249ca){for(var _0x59496b=0x0,_0x5a1294=events['length'];_0x59496b<_0x5a1294;_0x59496b++){var _0x3a90c9=events[_0x59496b];var _0x48e1ce=createListener('whatsappMessage:'+_0x3a90c9,_0x1249ca);WhatsappMessageEvents['on'](_0x3a90c9,_0x48e1ce);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index a342b44..55a2cdc 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 _0x38ec=['getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x56658a,_0x51d0b1){var _0x3bb601=function(_0x29d18b){while(--_0x29d18b){_0x56658a['push'](_0x56658a['shift']());}};_0x3bb601(++_0x51d0b1);}(_0x38ec,0xa6));var _0xc38e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x38ec[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xc38e('0x0'));var util=require(_0xc38e('0x1'));var path=require(_0xc38e('0x2'));var timeout=require(_0xc38e('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xc38e('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xc38e('0x5'));var config=require(_0xc38e('0x6'));var controller=require(_0xc38e('0x7'));router[_0xc38e('0x8')]('/',auth[_0xc38e('0x9')](),controller['index']);router[_0xc38e('0x8')](_0xc38e('0xa'),auth[_0xc38e('0x9')](),controller[_0xc38e('0xb')]);router[_0xc38e('0x8')](_0xc38e('0xc'),auth[_0xc38e('0x9')](),controller[_0xc38e('0xd')]);router[_0xc38e('0x8')]('/:id/members',auth['isAuthenticated'](),controller[_0xc38e('0xe')]);router['get'](_0xc38e('0xf'),auth[_0xc38e('0x9')](),controller[_0xc38e('0x10')]);router[_0xc38e('0x8')](_0xc38e('0x11'),auth[_0xc38e('0x9')](),controller[_0xc38e('0x12')]);router[_0xc38e('0x13')]('/',auth[_0xc38e('0x9')](),controller[_0xc38e('0x14')]);router[_0xc38e('0x13')]('/:id/teams',auth[_0xc38e('0x9')](),controller[_0xc38e('0x15')]);router[_0xc38e('0x13')](_0xc38e('0x11'),auth[_0xc38e('0x9')](),controller[_0xc38e('0x16')]);router[_0xc38e('0x17')](_0xc38e('0xc'),auth[_0xc38e('0x9')](),controller[_0xc38e('0x18')]);router[_0xc38e('0x19')](_0xc38e('0xc'),auth[_0xc38e('0x9')](),controller[_0xc38e('0x1a')]);router[_0xc38e('0x19')]('/:id/teams',auth[_0xc38e('0x9')](),controller[_0xc38e('0x1b')]);router[_0xc38e('0x19')](_0xc38e('0x11'),auth['isAuthenticated'](),controller[_0xc38e('0x1c')]);module[_0xc38e('0x1d')]=router; \ No newline at end of file +var _0xaa18=['getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','delete','removeAgents','exports','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','/:id/members'];(function(_0x2bd750,_0xd784ed){var _0x42183b=function(_0x216a58){while(--_0x216a58){_0x2bd750['push'](_0x2bd750['shift']());}};_0x42183b(++_0xd784ed);}(_0xaa18,0x69));var _0x8aa1=function(_0x191121,_0x1f7063){_0x191121=_0x191121-0x0;var _0x1de155=_0xaa18[_0x191121];return _0x1de155;};'use strict';var multer=require('multer');var util=require(_0x8aa1('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8aa1('0x1'));var router=express[_0x8aa1('0x2')]();var fs_extra=require(_0x8aa1('0x3'));var auth=require(_0x8aa1('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x8aa1('0x5'));var controller=require('./whatsappQueue.controller');router[_0x8aa1('0x6')]('/',auth[_0x8aa1('0x7')](),controller['index']);router[_0x8aa1('0x6')](_0x8aa1('0x8'),auth[_0x8aa1('0x7')](),controller['describe']);router[_0x8aa1('0x6')]('/:id',auth[_0x8aa1('0x7')](),controller['show']);router[_0x8aa1('0x6')](_0x8aa1('0x9'),auth[_0x8aa1('0x7')](),controller[_0x8aa1('0xa')]);router[_0x8aa1('0x6')](_0x8aa1('0xb'),auth['isAuthenticated'](),controller[_0x8aa1('0xc')]);router['get'](_0x8aa1('0xd'),auth[_0x8aa1('0x7')](),controller[_0x8aa1('0xe')]);router[_0x8aa1('0xf')]('/',auth[_0x8aa1('0x7')](),controller[_0x8aa1('0x10')]);router['post'](_0x8aa1('0xb'),auth[_0x8aa1('0x7')](),controller[_0x8aa1('0x11')]);router[_0x8aa1('0xf')](_0x8aa1('0xd'),auth[_0x8aa1('0x7')](),controller[_0x8aa1('0x12')]);router[_0x8aa1('0x13')]('/:id',auth[_0x8aa1('0x7')](),controller['update']);router['delete']('/:id',auth[_0x8aa1('0x7')](),controller['destroy']);router['delete'](_0x8aa1('0xb'),auth[_0x8aa1('0x7')](),controller['removeTeams']);router[_0x8aa1('0x14')]('/:id/users',auth[_0x8aa1('0x7')](),controller[_0x8aa1('0x15')]);module[_0x8aa1('0x16')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 985bb7f..fc50195 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 _0x3e5c=['beepall','roundrobin','sequelize','exports','STRING','name','ENUM','rrmemory'];(function(_0x642916,_0x344d32){var _0x2391b7=function(_0x20c504){while(--_0x20c504){_0x642916['push'](_0x642916['shift']());}};_0x2391b7(++_0x344d32);}(_0x3e5c,0x9a));var _0xc3e5=function(_0x58388c,_0x5b9fc8){_0x58388c=_0x58388c-0x0;var _0x17208a=_0x3e5c[_0x58388c];return _0x17208a;};'use strict';var Sequelize=require(_0xc3e5('0x0'));module[_0xc3e5('0x1')]={'name':{'type':Sequelize[_0xc3e5('0x2')],'unique':_0xc3e5('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc3e5('0x4')](_0xc3e5('0x5'),_0xc3e5('0x6'),_0xc3e5('0x7'))},'description':{'type':Sequelize[_0xc3e5('0x2')]}}; \ No newline at end of file +var _0xad53=['rrmemory','beepall','sequelize','exports','STRING','name','INTEGER','ENUM'];(function(_0x357b56,_0x1120be){var _0x4e3c55=function(_0x2afc49){while(--_0x2afc49){_0x357b56['push'](_0x357b56['shift']());}};_0x4e3c55(++_0x1120be);}(_0xad53,0x1ea));var _0x3ad5=function(_0xf3554b,_0x1ac738){_0xf3554b=_0xf3554b-0x0;var _0x305737=_0xad53[_0xf3554b];return _0x305737;};'use strict';var Sequelize=require(_0x3ad5('0x0'));module[_0x3ad5('0x1')]={'name':{'type':Sequelize[_0x3ad5('0x2')],'unique':_0x3ad5('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x3ad5('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3ad5('0x5')](_0x3ad5('0x6'),_0x3ad5('0x7'),'roundrobin')},'description':{'type':Sequelize[_0x3ad5('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index bbaacd3..8876340 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 _0x398b=['bluebird','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','destroy','get','WhatsappQueues','UserProfileResource','stack','name','send','index','map','WhatsappQueue','rawAttributes','key','getOptions','where','then','include','query','findAll','rows','catch','show','model','keys','filters','intersection','attributes','fields','includeAll','merge','options','find','create','body','user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','length','hasOwnProperty','nolimit','order','sort','pick','WhatsappQueueId','filter','UserWhatsappQueue','User','UserId','whatsappPause','updatedAt','format','%s/%s','SIP','Team','getTeams','addTeams','ids','online','voicePause','interface','flatMap','Agents','sequelize','findOrCreate','emit','userWhatsappQueue:save','removeTeams','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','toString','QueryTypes','every','TeamId','all','union','compact','value','transaction','isEmpty','removeAgents','forEach','userWhatsappQueue:remove','addAgents','omit','spread','getAgents'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0x398b,0x1e8));var _0xb398=function(_0x5ae7ae,_0x534c34){_0x5ae7ae=_0x5ae7ae-0x0;var _0x5929f7=_0x398b[_0x5ae7ae];return _0x5929f7;};'use strict';var BPromise=require(_0xb398('0x0'));var util=require('util');var _=require(_0xb398('0x1'));var squel=require(_0xb398('0x2'));var Redis=require(_0xb398('0x3'));var qs=require(_0xb398('0x4'));var logger=require(_0xb398('0x5'))(_0xb398('0x6'));var config=require('../../config/environment');var db=require(_0xb398('0x7'))['db'];config[_0xb398('0x8')]=_['defaults'](config['redis'],{'host':_0xb398('0x9'),'port':0x18eb});var socket=require(_0xb398('0xa'))(new Redis(config[_0xb398('0x8')]));require(_0xb398('0xb'))[_0xb398('0xc')](socket);function respondWithStatusCode(_0x23fd64,_0x3ba146){_0x3ba146=_0x3ba146||0xcc;return function(_0x14616b){if(_0x14616b){return _0x23fd64[_0xb398('0xd')](_0x3ba146);}return _0x23fd64[_0xb398('0xe')](_0x3ba146)[_0xb398('0xf')]();};}function respondWithResult(_0x35dc98,_0x46cd47){_0x46cd47=_0x46cd47||0xc8;return function(_0x3a4c56){if(_0x3a4c56){return _0x35dc98['status'](_0x46cd47)[_0xb398('0x10')](_0x3a4c56);}};}function respondWithFilteredResult(_0x373a9f,_0x26aadc){return function(_0x209da9){if(_0x209da9){var _0x126e4e=typeof _0x26aadc[_0xb398('0x11')]===_0xb398('0x12')&&typeof _0x26aadc[_0xb398('0x13')]===_0xb398('0x12');var _0x48a750=_0x209da9[_0xb398('0x14')];var _0x4188eb=_0x126e4e?0x0:_0x26aadc[_0xb398('0x11')];var _0x588270=_0x126e4e?_0x209da9['count']:_0x26aadc[_0xb398('0x11')]+_0x26aadc[_0xb398('0x13')];var _0x379c9c;if(_0x588270>=_0x48a750){_0x588270=_0x48a750;_0x379c9c=0xc8;}else{_0x379c9c=0xce;}_0x373a9f[_0xb398('0xe')](_0x379c9c);return _0x373a9f[_0xb398('0x15')](_0xb398('0x16'),_0x4188eb+'-'+_0x588270+'/'+_0x48a750)[_0xb398('0x10')](_0x209da9);}return null;};}function saveUpdates(_0x14f733){return function(_0x44e17f){if(_0x44e17f){return _0x44e17f[_0xb398('0x17')](_0x14f733)['then'](function(_0x3991e3){return _0x3991e3;});}return null;};}function removeEntity(_0x5e087e){return function(_0x3c6318){if(_0x3c6318){return _0x3c6318[_0xb398('0x18')]()['then'](function(){var _0x317640=_0x3c6318[_0xb398('0x19')]({'plain':!![]});var _0x253a01=_0xb398('0x1a');return db[_0xb398('0x1b')][_0xb398('0x18')]({'where':{'type':_0x253a01,'resourceId':_0x317640['id']}})['then'](function(){return _0x3c6318;});})['then'](function(){_0x5e087e[_0xb398('0xe')](0xcc)['end']();});}};}function handleEntityNotFound(_0x18a115){return function(_0x52cc71){if(!_0x52cc71){_0x18a115[_0xb398('0xd')](0x194);}return _0x52cc71;};}function handleError(_0x5231b3,_0x155da7){_0x155da7=_0x155da7||0x1f4;return function(_0x1f711e){logger['error'](_0x1f711e[_0xb398('0x1c')]);if(_0x1f711e[_0xb398('0x1d')]){delete _0x1f711e[_0xb398('0x1d')];}_0x5231b3[_0xb398('0xe')](_0x155da7)[_0xb398('0x1e')](_0x1f711e);};}exports[_0xb398('0x1f')]=function(_0x23dc7d,_0x42c29f){var _0x5ecb59={};var _0x338b65={'count':0x0,'rows':[]};var _0x1f7c25=_[_0xb398('0x20')](db[_0xb398('0x21')][_0xb398('0x22')],function(_0x5abbbc){return{'name':_0x5abbbc['fieldName'],'type':_0x5abbbc['type'][_0xb398('0x23')]};});_0x5ecb59=qs[_0xb398('0x24')](_0x1f7c25,_0x23dc7d);var _0x2c0ffa={'where':_0x5ecb59[_0xb398('0x25')]};return db[_0xb398('0x21')][_0xb398('0x14')](_0x2c0ffa)[_0xb398('0x26')](function(_0x3187b0){_0x338b65[_0xb398('0x14')]=_0x3187b0;_0x5ecb59['include']=qs[_0xb398('0x27')](_0x23dc7d[_0xb398('0x28')]);return db[_0xb398('0x21')][_0xb398('0x29')](_0x5ecb59);})[_0xb398('0x26')](function(_0x5781da){_0x338b65[_0xb398('0x2a')]=_0x5781da;return _0x338b65;})[_0xb398('0x26')](respondWithFilteredResult(_0x42c29f,_0x5ecb59))[_0xb398('0x2b')](handleError(_0x42c29f,null));};exports[_0xb398('0x2c')]=function(_0x232d0c,_0x452b0d){var _0x56c48e={'raw':!![],'where':{'id':_0x232d0c['params']['id']}},_0x240024={};_0x240024[_0xb398('0x2d')]=_[_0xb398('0x2e')](db[_0xb398('0x21')][_0xb398('0x22')]);_0x240024['query']=_['keys'](_0x232d0c['query']);_0x240024[_0xb398('0x2f')]=_[_0xb398('0x30')](_0x240024[_0xb398('0x2d')],_0x240024[_0xb398('0x28')]);_0x56c48e[_0xb398('0x31')]=_[_0xb398('0x30')](_0x240024[_0xb398('0x2d')],qs[_0xb398('0x32')](_0x232d0c['query'][_0xb398('0x32')]));_0x56c48e[_0xb398('0x31')]=_0x56c48e[_0xb398('0x31')]['length']?_0x56c48e[_0xb398('0x31')]:_0x240024['model'];if(_0x232d0c[_0xb398('0x28')][_0xb398('0x33')]){_0x56c48e[_0xb398('0x27')]=[{'all':!![]}];}_0x56c48e=_[_0xb398('0x34')]({},_0x56c48e,_0x232d0c[_0xb398('0x35')]);return db['WhatsappQueue'][_0xb398('0x36')](_0x56c48e)['then'](handleEntityNotFound(_0x452b0d,null))['then'](respondWithResult(_0x452b0d,null))['catch'](handleError(_0x452b0d,null));};exports[_0xb398('0x37')]=function(_0x4bbc3e,_0xec1ac7){return db['WhatsappQueue'][_0xb398('0x37')](_0x4bbc3e[_0xb398('0x38')],{})['then'](function(_0x4c3131){var _0x42a507=_0x4bbc3e[_0xb398('0x39')][_0xb398('0x19')]({'plain':!![]});if(!_0x42a507)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x42a507[_0xb398('0x3a')]==='user'){var _0x98815=_0x4c3131[_0xb398('0x19')]({'plain':!![]});var _0x4622cf=_0xb398('0x1a');return db[_0xb398('0x3b')]['find']({'where':{'name':_0x4622cf,'userProfileId':_0x42a507[_0xb398('0x3c')]},'raw':!![]})[_0xb398('0x26')](function(_0x5b3820){if(_0x5b3820&&_0x5b3820['autoAssociation']===0x0){return db[_0xb398('0x1b')][_0xb398('0x37')]({'name':_0x98815[_0xb398('0x1d')],'resourceId':_0x98815['id'],'type':_0x5b3820[_0xb398('0x1d')],'sectionId':_0x5b3820['id']},{})[_0xb398('0x26')](function(){return _0x4c3131;});}else{return _0x4c3131;}})[_0xb398('0x2b')](function(_0x1c27bb){logger['error'](_0xb398('0x3d'),_0x1c27bb);throw _0x1c27bb;});}return _0x4c3131;})['then'](respondWithResult(_0xec1ac7,0xc9))[_0xb398('0x2b')](handleError(_0xec1ac7,null));};exports[_0xb398('0x17')]=function(_0x23aebd,_0x17ac62){if(_0x23aebd['body']['id']){delete _0x23aebd['body']['id'];}return db['WhatsappQueue'][_0xb398('0x36')]({'where':{'id':_0x23aebd[_0xb398('0x3e')]['id']}})[_0xb398('0x26')](handleEntityNotFound(_0x17ac62,null))[_0xb398('0x26')](saveUpdates(_0x23aebd[_0xb398('0x38')],null))[_0xb398('0x26')](respondWithResult(_0x17ac62,null))[_0xb398('0x2b')](handleError(_0x17ac62,null));};exports[_0xb398('0x18')]=function(_0x1c7606,_0xc12d99){return db[_0xb398('0x21')][_0xb398('0x36')]({'where':{'id':_0x1c7606[_0xb398('0x3e')]['id']}})['then'](handleEntityNotFound(_0xc12d99,null))['then'](removeEntity(_0xc12d99,null))[_0xb398('0x2b')](handleError(_0xc12d99,null));};exports[_0xb398('0x3f')]=function(_0x1b7317,_0x206ce8){return db[_0xb398('0x21')][_0xb398('0x3f')]()[_0xb398('0x26')](respondWithResult(_0x206ce8,null))['catch'](handleError(_0x206ce8,null));};exports[_0xb398('0x40')]=function(_0x962a87,_0x2e316c){var _0x357350={'raw':!![],'where':{}},_0x5eb93a={},_0x5ebd22;return db['WhatsappQueue'][_0xb398('0x41')]({'where':{'id':_0x962a87[_0xb398('0x3e')]['id']}})[_0xb398('0x26')](handleEntityNotFound(_0x2e316c,null))[_0xb398('0x26')](function(_0x288b88){if(_0x288b88){_0x5ebd22=_0x288b88[_0xb398('0x19')]({'plain':!![]});_0x5eb93a['model']=_[_0xb398('0x2e')](db['UserWhatsappQueue']['rawAttributes']);_0x5eb93a[_0xb398('0x28')]=_[_0xb398('0x2e')](_0x962a87[_0xb398('0x28')]);_0x5eb93a['filters']=_[_0xb398('0x30')](_0x5eb93a[_0xb398('0x2d')],_0x5eb93a[_0xb398('0x28')]);_0x357350[_0xb398('0x31')]=_[_0xb398('0x30')](_0x5eb93a['model'],qs[_0xb398('0x32')](_0x962a87[_0xb398('0x28')][_0xb398('0x32')]));_0x357350['attributes']=_0x357350[_0xb398('0x31')][_0xb398('0x42')]?_0x357350[_0xb398('0x31')]:_0x5eb93a['model'];if(!_0x962a87['query'][_0xb398('0x43')](_0xb398('0x44'))){_0x357350[_0xb398('0x13')]=qs[_0xb398('0x13')](_0x962a87[_0xb398('0x28')]['limit']);_0x357350['offset']=qs[_0xb398('0x11')](_0x962a87[_0xb398('0x28')][_0xb398('0x11')]);}_0x357350[_0xb398('0x45')]=qs[_0xb398('0x46')](_0x962a87[_0xb398('0x28')]['sort']);_0x357350[_0xb398('0x25')]=qs[_0xb398('0x2f')](_[_0xb398('0x47')](_0x962a87[_0xb398('0x28')],_0x5eb93a[_0xb398('0x2f')]));_0x357350[_0xb398('0x25')][_0xb398('0x48')]=_0x288b88['id'];if(_0x962a87[_0xb398('0x28')][_0xb398('0x49')]){_0x357350[_0xb398('0x25')]=_[_0xb398('0x34')](_0x357350[_0xb398('0x25')],{'$or':_[_0xb398('0x20')](_0x357350['attributes'],function(_0x1fb746){var _0x21abbe={};_0x21abbe[_0x1fb746]={'$like':'%'+_0x962a87[_0xb398('0x28')]['filter']+'%'};return _0x21abbe;})});}_0x357350=_[_0xb398('0x34')]({},_0x357350,_0x962a87[_0xb398('0x35')]);return db[_0xb398('0x4a')][_0xb398('0x29')](_0x357350);}})[_0xb398('0x26')](function(_0x157576){if(_0x157576){return db[_0xb398('0x4b')]['findAndCountAll']({'where':{'id':_[_0xb398('0x20')](_0x157576,_0xb398('0x4c')),'role':'agent'},'attributes':['id','name',_0xb398('0x4d'),_0xb398('0x4e'),'createdAt']});}})[_0xb398('0x26')](function(_0x1800e2){if(_0x1800e2){return{'count':_0x1800e2[_0xb398('0x14')],'rows':_[_0xb398('0x20')](_0x1800e2[_0xb398('0x2a')],function(_0x1928ef){return{'membername':_0x1928ef[_0xb398('0x1d')],'UserId':_0x1928ef['id'],'queue_name':_0x5ebd22[_0xb398('0x1d')],'WhatsappQueueId':_0x5ebd22['id'],'interface':util[_0xb398('0x4f')](_0xb398('0x50'),_0xb398('0x51'),_0x1928ef[_0xb398('0x1d')]),'penalty':0x0,'paused':_0x1928ef['whatsappPause'],'createdAt':_0x1928ef['createdAt'],'updatedAt':_0x1928ef[_0xb398('0x4e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xb398('0x26')](respondWithFilteredResult(_0x2e316c,_0x357350))[_0xb398('0x2b')](handleError(_0x2e316c,null));};exports['getTeams']=function(_0x1d8757,_0x5127f2){var _0x38cc6b={};var _0x70e0cf={};var _0x3087b5;var _0x4911b4;return db[_0xb398('0x21')][_0xb398('0x41')]({'where':{'id':_0x1d8757[_0xb398('0x3e')]['id']}})[_0xb398('0x26')](handleEntityNotFound(_0x5127f2,null))['then'](function(_0x5ae7ea){if(_0x5ae7ea){_0x3087b5=_0x5ae7ea;_0x70e0cf[_0xb398('0x2d')]=_[_0xb398('0x2e')](db[_0xb398('0x52')][_0xb398('0x22')]);_0x70e0cf[_0xb398('0x28')]=_[_0xb398('0x2e')](_0x1d8757[_0xb398('0x28')]);_0x70e0cf[_0xb398('0x2f')]=_['intersection'](_0x70e0cf[_0xb398('0x2d')],_0x70e0cf[_0xb398('0x28')]);_0x38cc6b['attributes']=_[_0xb398('0x30')](_0x70e0cf[_0xb398('0x2d')],qs[_0xb398('0x32')](_0x1d8757[_0xb398('0x28')]['fields']));_0x38cc6b[_0xb398('0x31')]=_0x38cc6b[_0xb398('0x31')]['length']?_0x38cc6b[_0xb398('0x31')]:_0x70e0cf[_0xb398('0x2d')];_0x38cc6b[_0xb398('0x45')]=qs[_0xb398('0x46')](_0x1d8757['query']['sort']);_0x38cc6b[_0xb398('0x25')]=qs['filters'](_[_0xb398('0x47')](_0x1d8757[_0xb398('0x28')],_0x70e0cf['filters']));if(_0x1d8757['query']['filter']){_0x38cc6b['where']=_[_0xb398('0x34')](_0x38cc6b[_0xb398('0x25')],{'$or':_[_0xb398('0x20')](_0x38cc6b[_0xb398('0x31')],function(_0x7632dc){var _0x82b0e2={};_0x82b0e2[_0x7632dc]={'$like':'%'+_0x1d8757[_0xb398('0x28')][_0xb398('0x49')]+'%'};return _0x82b0e2;})});}_0x38cc6b=_[_0xb398('0x34')]({},_0x38cc6b,_0x1d8757[_0xb398('0x35')]);return _0x3087b5[_0xb398('0x53')](_0x38cc6b);}})[_0xb398('0x26')](function(_0x33ec24){if(_0x33ec24){_0x4911b4=_0x33ec24[_0xb398('0x42')];if(!_0x1d8757[_0xb398('0x28')]['hasOwnProperty']('nolimit')){_0x38cc6b['limit']=qs[_0xb398('0x13')](_0x1d8757['query'][_0xb398('0x13')]);_0x38cc6b['offset']=qs[_0xb398('0x11')](_0x1d8757[_0xb398('0x28')][_0xb398('0x11')]);}return _0x3087b5[_0xb398('0x53')](_0x38cc6b);}})['then'](function(_0x4452c9){if(_0x4452c9){return _0x4452c9?{'count':_0x4911b4,'rows':_0x4452c9}:null;}})[_0xb398('0x26')](respondWithResult(_0x5127f2,null))[_0xb398('0x2b')](handleError(_0x5127f2,null));};exports[_0xb398('0x54')]=function(_0x492b6e,_0x2563da){var _0x58a172=_0x492b6e[_0xb398('0x38')][_0xb398('0x55')];return db[_0xb398('0x52')][_0xb398('0x29')]({'where':{'id':_0x58a172},'attributes':['id'],'include':[{'model':db[_0xb398('0x4b')],'as':'Agents','attributes':['id','name',_0xb398('0x56'),_0xb398('0x57'),_0xb398('0x58')],'raw':!![]}]})[_0xb398('0x26')](function(_0x54e558){if(_0x54e558){var _0x51b800=_[_0xb398('0x59')](_0x54e558,function(_0x520bf0){var _0x593dac=_0x520bf0[_0xb398('0x19')]({'plain':!![]});return _0x593dac[_0xb398('0x5a')];});return db[_0xb398('0x21')][_0xb398('0x36')]({'where':{'id':_0x492b6e['params']['id']}})[_0xb398('0x26')](function(_0x1e46e4){return db[_0xb398('0x5b')]['transaction'](function(_0x4aebfc){return _0x1e46e4[_0xb398('0x54')](_0x58a172,{'transaction':_0x4aebfc})['then'](function(){return BPromise['each'](_0x51b800,function(_0xa8a0c7){return db[_0xb398('0x4a')][_0xb398('0x5c')]({'where':{'UserId':_0xa8a0c7['id'],'WhatsappQueueId':_0x492b6e[_0xb398('0x3e')]['id']},'transaction':_0x4aebfc});});})[_0xb398('0x26')](function(){_0x51b800['forEach'](function(_0x37cac8){socket[_0xb398('0x5d')](_0xb398('0x5e'),{'UserId':_0x37cac8['id'],'WhatsappQueueId':_0x1e46e4['id']});});});});});}})[_0xb398('0x26')](respondWithStatusCode(_0x2563da,null))[_0xb398('0x2b')](handleError(_0x2563da,null));};exports[_0xb398('0x5f')]=function(_0xbf22f6,_0x187742){return db[_0xb398('0x52')][_0xb398('0x29')]({'where':{'id':_0xbf22f6['query']['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0xb398('0x5a'),'attributes':['id'],'raw':!![]}]})[_0xb398('0x26')](handleEntityNotFound(_0x187742,null))[_0xb398('0x26')](function(_0x5923cd){var _0x54cc3c=_['map'](_0x5923cd,'id');var _0x47a6f4=[];var _0x421c1c=[];var _0xd89502=squel[_0xb398('0x60')]();_0xd89502[_0xb398('0x61')](_0xb398('0x62'))[_0xb398('0x63')]('team_has_whatsapp_queues','tq')[_0xb398('0x64')](_0xb398('0x65'),'ut',_0xb398('0x66'))['where'](_0xb398('0x67'),_0xbf22f6[_0xb398('0x3e')]['id']);for(var _0x311aad=0x0;_0x311aad<_0x5923cd[_0xb398('0x42')];_0x311aad+=0x1){let _0x48d353=_0x5923cd[_0x311aad];for(var _0x20063f=0x0;_0x20063f<_0x48d353[_0xb398('0x5a')]['length'];_0x20063f+=0x1){let _0x2bd808=_0x48d353[_0xb398('0x5a')][_0x20063f];var _0x53a312=_0xd89502[_0xb398('0x68')]();_0x53a312['where']('ut.UserId\x20=\x20?',_0x2bd808['id']);_0x421c1c['push'](db[_0xb398('0x5b')][_0xb398('0x28')](_0x53a312[_0xb398('0x69')](),{'type':db[_0xb398('0x5b')][_0xb398('0x6a')]['SELECT']})[_0xb398('0x26')](function(_0x4ef69b){if(_0x4ef69b[_0xb398('0x42')]===0x1){return _0x2bd808['id'];}else{var _0xc2b2a7=_[_0xb398('0x6b')](_[_0xb398('0x20')](_0x4ef69b,_0xb398('0x6c')),function(_0x3950e2){return _['includes'](_0x54cc3c,_0x3950e2);});if(_0xc2b2a7){return _0x2bd808['id'];}}}));}}return BPromise[_0xb398('0x6d')](_0x421c1c)[_0xb398('0x26')](function(_0x381510){_0x47a6f4=_(_0x47a6f4)[_0xb398('0x6e')](_0x381510)[_0xb398('0x6f')]()[_0xb398('0x70')]();return db[_0xb398('0x21')][_0xb398('0x36')]({'where':{'id':_0xbf22f6[_0xb398('0x3e')]['id']}})[_0xb398('0x26')](function(_0x443ee2){return db[_0xb398('0x5b')][_0xb398('0x71')](function(_0x3037ef){return _0x443ee2['removeTeams'](_0xbf22f6[_0xb398('0x28')][_0xb398('0x55')],{'transaction':_0x3037ef})[_0xb398('0x26')](function(){if(!_[_0xb398('0x72')](_0x47a6f4)){return _0x443ee2[_0xb398('0x73')](_0x47a6f4,{'transaction':_0x3037ef});}})['then'](function(){_0x47a6f4[_0xb398('0x74')](function(_0x101cb3){socket[_0xb398('0x5d')](_0xb398('0x75'),{'UserId':_0x101cb3,'WhatsappQueueId':_0x443ee2['id']});});});});});});})['then'](respondWithStatusCode(_0x187742,null))['catch'](handleError(_0x187742,null));};exports[_0xb398('0x76')]=function(_0x5b191c,_0x25d88a){return db[_0xb398('0x21')][_0xb398('0x36')]({'where':{'id':_0x5b191c[_0xb398('0x3e')]['id']}})[_0xb398('0x26')](handleEntityNotFound(_0x25d88a,null))[_0xb398('0x26')](function(_0x27e6c7){if(_0x27e6c7){return _0x27e6c7[_0xb398('0x76')](_0x5b191c['body'][_0xb398('0x55')],_[_0xb398('0x77')](_0x5b191c[_0xb398('0x38')],['ids','id'])||{})[_0xb398('0x78')](function(_0x37d20a){for(var _0x28c24d=0x0;_0x28c24d<_0x5b191c[_0xb398('0x38')][_0xb398('0x55')]['length'];_0x28c24d+=0x1){socket[_0xb398('0x5d')](_0xb398('0x5e'),{'UserId':Number(_0x5b191c[_0xb398('0x38')][_0xb398('0x55')][_0x28c24d]),'WhatsappQueueId':Number(_0x5b191c[_0xb398('0x3e')]['id'])});}return _0x37d20a;});}})['then'](respondWithResult(_0x25d88a,null))[_0xb398('0x2b')](handleError(_0x25d88a,null));};exports[_0xb398('0x73')]=function(_0x4da052,_0x32b8f5){return db[_0xb398('0x21')][_0xb398('0x36')]({'where':{'id':_0x4da052[_0xb398('0x3e')]['id']}})['then'](handleEntityNotFound(_0x32b8f5,null))['then'](function(_0x554fe6){if(_0x554fe6){return _0x554fe6[_0xb398('0x73')](_0x4da052[_0xb398('0x28')]['ids'])[_0xb398('0x26')](function(){if(_['isArray'](_0x4da052[_0xb398('0x28')][_0xb398('0x55')])){for(var _0xae415b=0x0;_0xae415b<_0x4da052[_0xb398('0x28')][_0xb398('0x55')][_0xb398('0x42')];_0xae415b+=0x1){socket['emit']('userWhatsappQueue:remove',{'UserId':Number(_0x4da052[_0xb398('0x28')][_0xb398('0x55')][_0xae415b]),'WhatsappQueueId':Number(_0x4da052[_0xb398('0x3e')]['id'])});}}else{socket[_0xb398('0x5d')]('userWhatsappQueue:remove',{'UserId':Number(_0x4da052[_0xb398('0x28')]['ids']),'WhatsappQueueId':Number(_0x4da052[_0xb398('0x3e')]['id'])});}});}})[_0xb398('0x26')](respondWithStatusCode(_0x32b8f5,null))['catch'](handleError(_0x32b8f5,null));};exports['getAgents']=function(_0x204631,_0xe81462){var _0x1b5ecf={};var _0x7824c5={};var _0x256f0d;var _0x14ad45;return db[_0xb398('0x21')][_0xb398('0x41')]({'where':{'id':_0x204631[_0xb398('0x3e')]['id']}})[_0xb398('0x26')](handleEntityNotFound(_0xe81462,null))[_0xb398('0x26')](function(_0x6c92de){if(_0x6c92de){_0x256f0d=_0x6c92de;_0x7824c5[_0xb398('0x2d')]=_['keys'](db[_0xb398('0x4b')][_0xb398('0x22')]);_0x7824c5[_0xb398('0x28')]=_[_0xb398('0x2e')](_0x204631['query']);_0x7824c5[_0xb398('0x2f')]=_['intersection'](_0x7824c5[_0xb398('0x2d')],_0x7824c5[_0xb398('0x28')]);_0x1b5ecf[_0xb398('0x31')]=_[_0xb398('0x30')](_0x7824c5['model'],qs[_0xb398('0x32')](_0x204631[_0xb398('0x28')][_0xb398('0x32')]));_0x1b5ecf['attributes']=_0x1b5ecf[_0xb398('0x31')]['length']?_0x1b5ecf[_0xb398('0x31')]:_0x7824c5[_0xb398('0x2d')];_0x1b5ecf[_0xb398('0x45')]=qs[_0xb398('0x46')](_0x204631[_0xb398('0x28')][_0xb398('0x46')]);_0x1b5ecf['where']=qs['filters'](_[_0xb398('0x47')](_0x204631[_0xb398('0x28')],_0x7824c5['filters']));if(_0x204631['query'][_0xb398('0x49')]){_0x1b5ecf[_0xb398('0x25')]=_[_0xb398('0x34')](_0x1b5ecf[_0xb398('0x25')],{'$or':_[_0xb398('0x20')](_0x1b5ecf[_0xb398('0x31')],function(_0x4297d6){var _0xdaef6a={};_0xdaef6a[_0x4297d6]={'$like':'%'+_0x204631['query']['filter']+'%'};return _0xdaef6a;})});}_0x1b5ecf=_[_0xb398('0x34')]({},_0x1b5ecf,_0x204631[_0xb398('0x35')]);return _0x256f0d[_0xb398('0x79')](_0x1b5ecf);}})[_0xb398('0x26')](function(_0x42397c){if(_0x42397c){_0x14ad45=_0x42397c[_0xb398('0x42')];if(!_0x204631[_0xb398('0x28')]['hasOwnProperty'](_0xb398('0x44'))){_0x1b5ecf[_0xb398('0x13')]=qs[_0xb398('0x13')](_0x204631[_0xb398('0x28')][_0xb398('0x13')]);_0x1b5ecf[_0xb398('0x11')]=qs[_0xb398('0x11')](_0x204631[_0xb398('0x28')][_0xb398('0x11')]);}return _0x256f0d[_0xb398('0x79')](_0x1b5ecf);}})[_0xb398('0x26')](function(_0x587f6d){if(_0x587f6d){return _0x587f6d?{'count':_0x14ad45,'rows':_0x587f6d}:null;}})[_0xb398('0x26')](respondWithResult(_0xe81462,null))['catch'](handleError(_0xe81462,null));}; \ No newline at end of file +var _0xea1b=['findAll','rows','catch','params','model','keys','filters','intersection','attributes','fields','includeAll','merge','options','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserWhatsappQueue','length','hasOwnProperty','nolimit','order','sort','WhatsappQueueId','filter','User','findAndCountAll','UserId','agent','whatsappPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','pick','addTeams','Agents','online','voicePause','flatMap','sequelize','transaction','forEach','emit','userWhatsappQueue:save','removeTeams','ids','select','field','from','team_has_whatsapp_queues','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','addAgents','omit','spread','isArray','userWhatsappQueue:remove','getAgents','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./whatsappQueue.socket','sendStatus','status','end','json','limit','count','offset','set','Content-Range','update','then','destroy','WhatsappQueues','UserProfileResource','error','stack','name','send','map','WhatsappQueue','rawAttributes','fieldName','type','key','where','include','query'];(function(_0x5c70e4,_0x52d5eb){var _0x228e46=function(_0xc8d61f){while(--_0xc8d61f){_0x5c70e4['push'](_0x5c70e4['shift']());}};_0x228e46(++_0x52d5eb);}(_0xea1b,0x144));var _0xbea1=function(_0x27216c,_0x2d8876){_0x27216c=_0x27216c-0x0;var _0x5f1960=_0xea1b[_0x27216c];return _0x5f1960;};'use strict';var BPromise=require(_0xbea1('0x0'));var util=require(_0xbea1('0x1'));var _=require(_0xbea1('0x2'));var squel=require(_0xbea1('0x3'));var Redis=require(_0xbea1('0x4'));var qs=require(_0xbea1('0x5'));var logger=require(_0xbea1('0x6'))(_0xbea1('0x7'));var config=require(_0xbea1('0x8'));var db=require(_0xbea1('0x9'))['db'];config['redis']=_[_0xbea1('0xa')](config[_0xbea1('0xb')],{'host':_0xbea1('0xc'),'port':0x18eb});var socket=require(_0xbea1('0xd'))(new Redis(config[_0xbea1('0xb')]));require(_0xbea1('0xe'))['register'](socket);function respondWithStatusCode(_0x28ed2a,_0x38dc00){_0x38dc00=_0x38dc00||0xcc;return function(_0x2672e9){if(_0x2672e9){return _0x28ed2a[_0xbea1('0xf')](_0x38dc00);}return _0x28ed2a[_0xbea1('0x10')](_0x38dc00)[_0xbea1('0x11')]();};}function respondWithResult(_0x1c3061,_0x14187d){_0x14187d=_0x14187d||0xc8;return function(_0x386b9f){if(_0x386b9f){return _0x1c3061['status'](_0x14187d)[_0xbea1('0x12')](_0x386b9f);}};}function respondWithFilteredResult(_0x4a6ad2,_0x42dfc0){return function(_0x2ee587){if(_0x2ee587){var _0x4f0a43=typeof _0x42dfc0['offset']==='undefined'&&typeof _0x42dfc0[_0xbea1('0x13')]==='undefined';var _0x2a86ac=_0x2ee587[_0xbea1('0x14')];var _0x5650ec=_0x4f0a43?0x0:_0x42dfc0[_0xbea1('0x15')];var _0x2420d0=_0x4f0a43?_0x2ee587[_0xbea1('0x14')]:_0x42dfc0['offset']+_0x42dfc0[_0xbea1('0x13')];var _0x4225f8;if(_0x2420d0>=_0x2a86ac){_0x2420d0=_0x2a86ac;_0x4225f8=0xc8;}else{_0x4225f8=0xce;}_0x4a6ad2[_0xbea1('0x10')](_0x4225f8);return _0x4a6ad2[_0xbea1('0x16')](_0xbea1('0x17'),_0x5650ec+'-'+_0x2420d0+'/'+_0x2a86ac)[_0xbea1('0x12')](_0x2ee587);}return null;};}function saveUpdates(_0x589975){return function(_0x38b686){if(_0x38b686){return _0x38b686[_0xbea1('0x18')](_0x589975)[_0xbea1('0x19')](function(_0x332b86){return _0x332b86;});}return null;};}function removeEntity(_0x434a48){return function(_0x51bdea){if(_0x51bdea){return _0x51bdea[_0xbea1('0x1a')]()[_0xbea1('0x19')](function(){var _0x597176=_0x51bdea['get']({'plain':!![]});var _0x5771c2=_0xbea1('0x1b');return db[_0xbea1('0x1c')][_0xbea1('0x1a')]({'where':{'type':_0x5771c2,'resourceId':_0x597176['id']}})[_0xbea1('0x19')](function(){return _0x51bdea;});})[_0xbea1('0x19')](function(){_0x434a48[_0xbea1('0x10')](0xcc)[_0xbea1('0x11')]();});}};}function handleEntityNotFound(_0x49beb2){return function(_0x5443d7){if(!_0x5443d7){_0x49beb2[_0xbea1('0xf')](0x194);}return _0x5443d7;};}function handleError(_0x1b6b03,_0x441200){_0x441200=_0x441200||0x1f4;return function(_0x2b8946){logger[_0xbea1('0x1d')](_0x2b8946[_0xbea1('0x1e')]);if(_0x2b8946[_0xbea1('0x1f')]){delete _0x2b8946['name'];}_0x1b6b03[_0xbea1('0x10')](_0x441200)[_0xbea1('0x20')](_0x2b8946);};}exports['index']=function(_0x2d209d,_0xdf6bbf){var _0xbd2ad9={};var _0x198642={'count':0x0,'rows':[]};var _0xb3e4ff=_[_0xbea1('0x21')](db[_0xbea1('0x22')][_0xbea1('0x23')],function(_0xa832fe){return{'name':_0xa832fe[_0xbea1('0x24')],'type':_0xa832fe[_0xbea1('0x25')][_0xbea1('0x26')]};});_0xbd2ad9=qs['getOptions'](_0xb3e4ff,_0x2d209d);var _0x5a0ab6={'where':_0xbd2ad9[_0xbea1('0x27')]};return db[_0xbea1('0x22')][_0xbea1('0x14')](_0x5a0ab6)[_0xbea1('0x19')](function(_0x1cf817){_0x198642[_0xbea1('0x14')]=_0x1cf817;_0xbd2ad9[_0xbea1('0x28')]=qs[_0xbea1('0x28')](_0x2d209d[_0xbea1('0x29')]);return db[_0xbea1('0x22')][_0xbea1('0x2a')](_0xbd2ad9);})[_0xbea1('0x19')](function(_0x467d3f){_0x198642[_0xbea1('0x2b')]=_0x467d3f;return _0x198642;})[_0xbea1('0x19')](respondWithFilteredResult(_0xdf6bbf,_0xbd2ad9))[_0xbea1('0x2c')](handleError(_0xdf6bbf,null));};exports['show']=function(_0x5f0b37,_0x346cd6){var _0x3bf3b5={'raw':!![],'where':{'id':_0x5f0b37[_0xbea1('0x2d')]['id']}},_0x178045={};_0x178045[_0xbea1('0x2e')]=_[_0xbea1('0x2f')](db[_0xbea1('0x22')]['rawAttributes']);_0x178045['query']=_[_0xbea1('0x2f')](_0x5f0b37[_0xbea1('0x29')]);_0x178045[_0xbea1('0x30')]=_[_0xbea1('0x31')](_0x178045[_0xbea1('0x2e')],_0x178045[_0xbea1('0x29')]);_0x3bf3b5[_0xbea1('0x32')]=_['intersection'](_0x178045['model'],qs[_0xbea1('0x33')](_0x5f0b37['query'][_0xbea1('0x33')]));_0x3bf3b5[_0xbea1('0x32')]=_0x3bf3b5[_0xbea1('0x32')]['length']?_0x3bf3b5[_0xbea1('0x32')]:_0x178045[_0xbea1('0x2e')];if(_0x5f0b37['query'][_0xbea1('0x34')]){_0x3bf3b5['include']=[{'all':!![]}];}_0x3bf3b5=_[_0xbea1('0x35')]({},_0x3bf3b5,_0x5f0b37[_0xbea1('0x36')]);return db['WhatsappQueue'][_0xbea1('0x37')](_0x3bf3b5)['then'](handleEntityNotFound(_0x346cd6,null))[_0xbea1('0x19')](respondWithResult(_0x346cd6,null))[_0xbea1('0x2c')](handleError(_0x346cd6,null));};exports[_0xbea1('0x38')]=function(_0x268c12,_0x19469f){return db[_0xbea1('0x22')][_0xbea1('0x38')](_0x268c12[_0xbea1('0x39')],{})['then'](function(_0x48ea43){var _0x77e0bc=_0x268c12['user'][_0xbea1('0x3a')]({'plain':!![]});if(!_0x77e0bc)throw new Error(_0xbea1('0x3b'));if(_0x77e0bc['role']===_0xbea1('0x3c')){var _0x136823=_0x48ea43[_0xbea1('0x3a')]({'plain':!![]});var _0x304ba8=_0xbea1('0x1b');return db['UserProfileSection']['find']({'where':{'name':_0x304ba8,'userProfileId':_0x77e0bc['userProfileId']},'raw':!![]})[_0xbea1('0x19')](function(_0xd64f38){if(_0xd64f38&&_0xd64f38['autoAssociation']===0x0){return db['UserProfileResource'][_0xbea1('0x38')]({'name':_0x136823[_0xbea1('0x1f')],'resourceId':_0x136823['id'],'type':_0xd64f38['name'],'sectionId':_0xd64f38['id']},{})['then'](function(){return _0x48ea43;});}else{return _0x48ea43;}})['catch'](function(_0x243619){logger[_0xbea1('0x1d')](_0xbea1('0x3d'),_0x243619);throw _0x243619;});}return _0x48ea43;})['then'](respondWithResult(_0x19469f,0xc9))[_0xbea1('0x2c')](handleError(_0x19469f,null));};exports[_0xbea1('0x18')]=function(_0x220bf4,_0x941cf0){if(_0x220bf4[_0xbea1('0x39')]['id']){delete _0x220bf4[_0xbea1('0x39')]['id'];}return db[_0xbea1('0x22')]['find']({'where':{'id':_0x220bf4[_0xbea1('0x2d')]['id']}})[_0xbea1('0x19')](handleEntityNotFound(_0x941cf0,null))['then'](saveUpdates(_0x220bf4['body'],null))[_0xbea1('0x19')](respondWithResult(_0x941cf0,null))['catch'](handleError(_0x941cf0,null));};exports['destroy']=function(_0x433037,_0x27e097){return db['WhatsappQueue']['find']({'where':{'id':_0x433037[_0xbea1('0x2d')]['id']}})[_0xbea1('0x19')](handleEntityNotFound(_0x27e097,null))[_0xbea1('0x19')](removeEntity(_0x27e097,null))[_0xbea1('0x2c')](handleError(_0x27e097,null));};exports[_0xbea1('0x3e')]=function(_0x1e9cef,_0x58c87d){return db[_0xbea1('0x22')]['describe']()[_0xbea1('0x19')](respondWithResult(_0x58c87d,null))['catch'](handleError(_0x58c87d,null));};exports[_0xbea1('0x3f')]=function(_0x5bfec2,_0x51f746){var _0x24ea23={'raw':!![],'where':{}},_0x4dc415={},_0x5868d2;return db[_0xbea1('0x22')][_0xbea1('0x40')]({'where':{'id':_0x5bfec2['params']['id']}})[_0xbea1('0x19')](handleEntityNotFound(_0x51f746,null))[_0xbea1('0x19')](function(_0x4e8ace){if(_0x4e8ace){_0x5868d2=_0x4e8ace['get']({'plain':!![]});_0x4dc415[_0xbea1('0x2e')]=_[_0xbea1('0x2f')](db[_0xbea1('0x41')][_0xbea1('0x23')]);_0x4dc415['query']=_[_0xbea1('0x2f')](_0x5bfec2[_0xbea1('0x29')]);_0x4dc415[_0xbea1('0x30')]=_[_0xbea1('0x31')](_0x4dc415['model'],_0x4dc415[_0xbea1('0x29')]);_0x24ea23['attributes']=_[_0xbea1('0x31')](_0x4dc415['model'],qs[_0xbea1('0x33')](_0x5bfec2[_0xbea1('0x29')]['fields']));_0x24ea23[_0xbea1('0x32')]=_0x24ea23[_0xbea1('0x32')][_0xbea1('0x42')]?_0x24ea23['attributes']:_0x4dc415['model'];if(!_0x5bfec2['query'][_0xbea1('0x43')](_0xbea1('0x44'))){_0x24ea23[_0xbea1('0x13')]=qs[_0xbea1('0x13')](_0x5bfec2[_0xbea1('0x29')][_0xbea1('0x13')]);_0x24ea23[_0xbea1('0x15')]=qs[_0xbea1('0x15')](_0x5bfec2[_0xbea1('0x29')][_0xbea1('0x15')]);}_0x24ea23[_0xbea1('0x45')]=qs[_0xbea1('0x46')](_0x5bfec2[_0xbea1('0x29')][_0xbea1('0x46')]);_0x24ea23[_0xbea1('0x27')]=qs['filters'](_['pick'](_0x5bfec2[_0xbea1('0x29')],_0x4dc415['filters']));_0x24ea23[_0xbea1('0x27')][_0xbea1('0x47')]=_0x4e8ace['id'];if(_0x5bfec2[_0xbea1('0x29')]['filter']){_0x24ea23['where']=_[_0xbea1('0x35')](_0x24ea23[_0xbea1('0x27')],{'$or':_[_0xbea1('0x21')](_0x24ea23[_0xbea1('0x32')],function(_0x59d379){var _0x3cea59={};_0x3cea59[_0x59d379]={'$like':'%'+_0x5bfec2[_0xbea1('0x29')][_0xbea1('0x48')]+'%'};return _0x3cea59;})});}_0x24ea23=_[_0xbea1('0x35')]({},_0x24ea23,_0x5bfec2['options']);return db['UserWhatsappQueue'][_0xbea1('0x2a')](_0x24ea23);}})[_0xbea1('0x19')](function(_0x2eca21){if(_0x2eca21){return db[_0xbea1('0x49')][_0xbea1('0x4a')]({'where':{'id':_[_0xbea1('0x21')](_0x2eca21,_0xbea1('0x4b')),'role':_0xbea1('0x4c')},'attributes':['id',_0xbea1('0x1f'),_0xbea1('0x4d'),_0xbea1('0x4e'),_0xbea1('0x4f')]});}})[_0xbea1('0x19')](function(_0x565322){if(_0x565322){return{'count':_0x565322[_0xbea1('0x14')],'rows':_[_0xbea1('0x21')](_0x565322[_0xbea1('0x2b')],function(_0x1dc974){return{'membername':_0x1dc974[_0xbea1('0x1f')],'UserId':_0x1dc974['id'],'queue_name':_0x5868d2[_0xbea1('0x1f')],'WhatsappQueueId':_0x5868d2['id'],'interface':util[_0xbea1('0x50')](_0xbea1('0x51'),_0xbea1('0x52'),_0x1dc974[_0xbea1('0x1f')]),'penalty':0x0,'paused':_0x1dc974[_0xbea1('0x4d')],'createdAt':_0x1dc974[_0xbea1('0x4f')],'updatedAt':_0x1dc974[_0xbea1('0x4e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xbea1('0x19')](respondWithFilteredResult(_0x51f746,_0x24ea23))[_0xbea1('0x2c')](handleError(_0x51f746,null));};exports[_0xbea1('0x53')]=function(_0x571c0d,_0x32f157){var _0x22d083={};var _0x2cb882={};var _0x3b5383;var _0x17e817;return db[_0xbea1('0x22')][_0xbea1('0x40')]({'where':{'id':_0x571c0d[_0xbea1('0x2d')]['id']}})[_0xbea1('0x19')](handleEntityNotFound(_0x32f157,null))[_0xbea1('0x19')](function(_0x1d05f3){if(_0x1d05f3){_0x3b5383=_0x1d05f3;_0x2cb882[_0xbea1('0x2e')]=_[_0xbea1('0x2f')](db[_0xbea1('0x54')]['rawAttributes']);_0x2cb882[_0xbea1('0x29')]=_[_0xbea1('0x2f')](_0x571c0d[_0xbea1('0x29')]);_0x2cb882[_0xbea1('0x30')]=_[_0xbea1('0x31')](_0x2cb882['model'],_0x2cb882['query']);_0x22d083['attributes']=_[_0xbea1('0x31')](_0x2cb882[_0xbea1('0x2e')],qs[_0xbea1('0x33')](_0x571c0d[_0xbea1('0x29')][_0xbea1('0x33')]));_0x22d083[_0xbea1('0x32')]=_0x22d083[_0xbea1('0x32')]['length']?_0x22d083[_0xbea1('0x32')]:_0x2cb882[_0xbea1('0x2e')];_0x22d083[_0xbea1('0x45')]=qs[_0xbea1('0x46')](_0x571c0d['query'][_0xbea1('0x46')]);_0x22d083[_0xbea1('0x27')]=qs[_0xbea1('0x30')](_[_0xbea1('0x55')](_0x571c0d[_0xbea1('0x29')],_0x2cb882[_0xbea1('0x30')]));if(_0x571c0d[_0xbea1('0x29')]['filter']){_0x22d083[_0xbea1('0x27')]=_['merge'](_0x22d083[_0xbea1('0x27')],{'$or':_[_0xbea1('0x21')](_0x22d083[_0xbea1('0x32')],function(_0x2439dd){var _0x58e0c6={};_0x58e0c6[_0x2439dd]={'$like':'%'+_0x571c0d['query']['filter']+'%'};return _0x58e0c6;})});}_0x22d083=_[_0xbea1('0x35')]({},_0x22d083,_0x571c0d[_0xbea1('0x36')]);return _0x3b5383['getTeams'](_0x22d083);}})[_0xbea1('0x19')](function(_0x5455be){if(_0x5455be){_0x17e817=_0x5455be[_0xbea1('0x42')];if(!_0x571c0d[_0xbea1('0x29')][_0xbea1('0x43')]('nolimit')){_0x22d083[_0xbea1('0x13')]=qs['limit'](_0x571c0d[_0xbea1('0x29')][_0xbea1('0x13')]);_0x22d083[_0xbea1('0x15')]=qs[_0xbea1('0x15')](_0x571c0d[_0xbea1('0x29')][_0xbea1('0x15')]);}return _0x3b5383[_0xbea1('0x53')](_0x22d083);}})[_0xbea1('0x19')](function(_0x572b1b){if(_0x572b1b){return _0x572b1b?{'count':_0x17e817,'rows':_0x572b1b}:null;}})[_0xbea1('0x19')](respondWithResult(_0x32f157,null))['catch'](handleError(_0x32f157,null));};exports[_0xbea1('0x56')]=function(_0x364b4e,_0x3fc9f3){var _0x41ab56=_0x364b4e['body']['ids'];return db['Team']['findAll']({'where':{'id':_0x41ab56},'attributes':['id'],'include':[{'model':db['User'],'as':_0xbea1('0x57'),'attributes':['id',_0xbea1('0x1f'),_0xbea1('0x58'),_0xbea1('0x59'),'interface'],'raw':!![]}]})[_0xbea1('0x19')](function(_0x4e4475){if(_0x4e4475){var _0x43bbf2=_[_0xbea1('0x5a')](_0x4e4475,function(_0x292e01){var _0x3df3e8=_0x292e01[_0xbea1('0x3a')]({'plain':!![]});return _0x3df3e8[_0xbea1('0x57')];});return db['WhatsappQueue'][_0xbea1('0x37')]({'where':{'id':_0x364b4e[_0xbea1('0x2d')]['id']}})[_0xbea1('0x19')](function(_0x121e95){return db[_0xbea1('0x5b')][_0xbea1('0x5c')](function(_0xd950f){return _0x121e95[_0xbea1('0x56')](_0x41ab56,{'transaction':_0xd950f})[_0xbea1('0x19')](function(){return BPromise['each'](_0x43bbf2,function(_0x8ac906){return db[_0xbea1('0x41')]['findOrCreate']({'where':{'UserId':_0x8ac906['id'],'WhatsappQueueId':_0x364b4e[_0xbea1('0x2d')]['id']},'transaction':_0xd950f});});})[_0xbea1('0x19')](function(){_0x43bbf2[_0xbea1('0x5d')](function(_0x43371e){socket[_0xbea1('0x5e')](_0xbea1('0x5f'),{'UserId':_0x43371e['id'],'WhatsappQueueId':_0x121e95['id']});});});});});}})['then'](respondWithStatusCode(_0x3fc9f3,null))[_0xbea1('0x2c')](handleError(_0x3fc9f3,null));};exports[_0xbea1('0x60')]=function(_0x40fb2d,_0x15021e){return db['Team'][_0xbea1('0x2a')]({'where':{'id':_0x40fb2d['query'][_0xbea1('0x61')]},'attributes':['id'],'include':[{'model':db[_0xbea1('0x49')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xbea1('0x19')](handleEntityNotFound(_0x15021e,null))['then'](function(_0x20df59){var _0x266ff0=_[_0xbea1('0x21')](_0x20df59,'id');var _0x128d31=[];var _0x131657=[];var _0x3a8363=squel[_0xbea1('0x62')]();_0x3a8363[_0xbea1('0x63')]('tq.TeamId')[_0xbea1('0x64')](_0xbea1('0x65'),'tq')['join']('user_has_teams','ut',_0xbea1('0x66'))[_0xbea1('0x27')](_0xbea1('0x67'),_0x40fb2d[_0xbea1('0x2d')]['id']);for(var _0x4ecfcd=0x0;_0x4ecfcd<_0x20df59['length'];_0x4ecfcd+=0x1){let _0xe76524=_0x20df59[_0x4ecfcd];for(var _0x36d322=0x0;_0x36d322<_0xe76524[_0xbea1('0x57')][_0xbea1('0x42')];_0x36d322+=0x1){let _0x2bbcc3=_0xe76524[_0xbea1('0x57')][_0x36d322];var _0x21b81c=_0x3a8363['clone']();_0x21b81c[_0xbea1('0x27')]('ut.UserId\x20=\x20?',_0x2bbcc3['id']);_0x131657[_0xbea1('0x68')](db[_0xbea1('0x5b')][_0xbea1('0x29')](_0x21b81c[_0xbea1('0x69')](),{'type':db[_0xbea1('0x5b')][_0xbea1('0x6a')][_0xbea1('0x6b')]})[_0xbea1('0x19')](function(_0x357c2a){if(_0x357c2a[_0xbea1('0x42')]===0x1){return _0x2bbcc3['id'];}else{var _0x1f1481=_['every'](_[_0xbea1('0x21')](_0x357c2a,_0xbea1('0x6c')),function(_0x18a0f7){return _[_0xbea1('0x6d')](_0x266ff0,_0x18a0f7);});if(_0x1f1481){return _0x2bbcc3['id'];}}}));}}return BPromise[_0xbea1('0x6e')](_0x131657)[_0xbea1('0x19')](function(_0xd2904c){_0x128d31=_(_0x128d31)[_0xbea1('0x6f')](_0xd2904c)[_0xbea1('0x70')]()[_0xbea1('0x71')]();return db[_0xbea1('0x22')]['find']({'where':{'id':_0x40fb2d[_0xbea1('0x2d')]['id']}})[_0xbea1('0x19')](function(_0x290bbb){return db['sequelize'][_0xbea1('0x5c')](function(_0x169128){return _0x290bbb['removeTeams'](_0x40fb2d['query'][_0xbea1('0x61')],{'transaction':_0x169128})[_0xbea1('0x19')](function(){if(!_[_0xbea1('0x72')](_0x128d31)){return _0x290bbb[_0xbea1('0x73')](_0x128d31,{'transaction':_0x169128});}})[_0xbea1('0x19')](function(){_0x128d31['forEach'](function(_0x1d40e6){socket[_0xbea1('0x5e')]('userWhatsappQueue:remove',{'UserId':_0x1d40e6,'WhatsappQueueId':_0x290bbb['id']});});});});});});})['then'](respondWithStatusCode(_0x15021e,null))[_0xbea1('0x2c')](handleError(_0x15021e,null));};exports[_0xbea1('0x74')]=function(_0x1d8ebc,_0x566f06){return db['WhatsappQueue'][_0xbea1('0x37')]({'where':{'id':_0x1d8ebc[_0xbea1('0x2d')]['id']}})['then'](handleEntityNotFound(_0x566f06,null))[_0xbea1('0x19')](function(_0x2f59af){if(_0x2f59af){return _0x2f59af[_0xbea1('0x74')](_0x1d8ebc[_0xbea1('0x39')]['ids'],_[_0xbea1('0x75')](_0x1d8ebc[_0xbea1('0x39')],[_0xbea1('0x61'),'id'])||{})[_0xbea1('0x76')](function(_0x342d77){for(var _0x10bb3c=0x0;_0x10bb3c<_0x1d8ebc[_0xbea1('0x39')][_0xbea1('0x61')][_0xbea1('0x42')];_0x10bb3c+=0x1){socket[_0xbea1('0x5e')]('userWhatsappQueue:save',{'UserId':Number(_0x1d8ebc[_0xbea1('0x39')]['ids'][_0x10bb3c]),'WhatsappQueueId':Number(_0x1d8ebc['params']['id'])});}return _0x342d77;});}})[_0xbea1('0x19')](respondWithResult(_0x566f06,null))[_0xbea1('0x2c')](handleError(_0x566f06,null));};exports['removeAgents']=function(_0x130bc2,_0x1e90e4){return db['WhatsappQueue']['find']({'where':{'id':_0x130bc2[_0xbea1('0x2d')]['id']}})['then'](handleEntityNotFound(_0x1e90e4,null))[_0xbea1('0x19')](function(_0x2f6c77){if(_0x2f6c77){return _0x2f6c77['removeAgents'](_0x130bc2[_0xbea1('0x29')]['ids'])[_0xbea1('0x19')](function(){if(_[_0xbea1('0x77')](_0x130bc2[_0xbea1('0x29')][_0xbea1('0x61')])){for(var _0x3c2bfa=0x0;_0x3c2bfa<_0x130bc2[_0xbea1('0x29')][_0xbea1('0x61')][_0xbea1('0x42')];_0x3c2bfa+=0x1){socket[_0xbea1('0x5e')](_0xbea1('0x78'),{'UserId':Number(_0x130bc2[_0xbea1('0x29')]['ids'][_0x3c2bfa]),'WhatsappQueueId':Number(_0x130bc2[_0xbea1('0x2d')]['id'])});}}else{socket[_0xbea1('0x5e')](_0xbea1('0x78'),{'UserId':Number(_0x130bc2[_0xbea1('0x29')][_0xbea1('0x61')]),'WhatsappQueueId':Number(_0x130bc2[_0xbea1('0x2d')]['id'])});}});}})[_0xbea1('0x19')](respondWithStatusCode(_0x1e90e4,null))[_0xbea1('0x2c')](handleError(_0x1e90e4,null));};exports[_0xbea1('0x79')]=function(_0x3b97ed,_0x681c99){var _0x37aafe={};var _0x3055a5={};var _0x522a02;var _0x46df54;return db[_0xbea1('0x22')][_0xbea1('0x40')]({'where':{'id':_0x3b97ed[_0xbea1('0x2d')]['id']}})[_0xbea1('0x19')](handleEntityNotFound(_0x681c99,null))['then'](function(_0x217014){if(_0x217014){_0x522a02=_0x217014;_0x3055a5[_0xbea1('0x2e')]=_[_0xbea1('0x2f')](db[_0xbea1('0x49')]['rawAttributes']);_0x3055a5['query']=_[_0xbea1('0x2f')](_0x3b97ed[_0xbea1('0x29')]);_0x3055a5[_0xbea1('0x30')]=_[_0xbea1('0x31')](_0x3055a5[_0xbea1('0x2e')],_0x3055a5[_0xbea1('0x29')]);_0x37aafe[_0xbea1('0x32')]=_['intersection'](_0x3055a5[_0xbea1('0x2e')],qs[_0xbea1('0x33')](_0x3b97ed['query']['fields']));_0x37aafe[_0xbea1('0x32')]=_0x37aafe[_0xbea1('0x32')]['length']?_0x37aafe[_0xbea1('0x32')]:_0x3055a5[_0xbea1('0x2e')];_0x37aafe[_0xbea1('0x45')]=qs['sort'](_0x3b97ed[_0xbea1('0x29')][_0xbea1('0x46')]);_0x37aafe['where']=qs['filters'](_[_0xbea1('0x55')](_0x3b97ed['query'],_0x3055a5['filters']));if(_0x3b97ed[_0xbea1('0x29')][_0xbea1('0x48')]){_0x37aafe[_0xbea1('0x27')]=_[_0xbea1('0x35')](_0x37aafe[_0xbea1('0x27')],{'$or':_[_0xbea1('0x21')](_0x37aafe[_0xbea1('0x32')],function(_0x40e302){var _0xfbeaf5={};_0xfbeaf5[_0x40e302]={'$like':'%'+_0x3b97ed['query'][_0xbea1('0x48')]+'%'};return _0xfbeaf5;})});}_0x37aafe=_[_0xbea1('0x35')]({},_0x37aafe,_0x3b97ed['options']);return _0x522a02[_0xbea1('0x79')](_0x37aafe);}})[_0xbea1('0x19')](function(_0x5e5c56){if(_0x5e5c56){_0x46df54=_0x5e5c56[_0xbea1('0x42')];if(!_0x3b97ed[_0xbea1('0x29')][_0xbea1('0x43')](_0xbea1('0x44'))){_0x37aafe[_0xbea1('0x13')]=qs['limit'](_0x3b97ed[_0xbea1('0x29')][_0xbea1('0x13')]);_0x37aafe[_0xbea1('0x15')]=qs[_0xbea1('0x15')](_0x3b97ed[_0xbea1('0x29')][_0xbea1('0x15')]);}return _0x522a02[_0xbea1('0x79')](_0x37aafe);}})['then'](function(_0x202ce0){if(_0x202ce0){return _0x202ce0?{'count':_0x46df54,'rows':_0x202ce0}:null;}})[_0xbea1('0x19')](respondWithResult(_0x681c99,null))[_0xbea1('0x2c')](handleError(_0x681c99,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 2f28d5f..aa36a2f 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 _0xa0cb=['WhatsappQueue','setMaxListeners','update','remove','emit','exports','events','../../mysqldb'];(function(_0x107de1,_0x3ac67e){var _0x480589=function(_0x1a1f0f){while(--_0x1a1f0f){_0x107de1['push'](_0x107de1['shift']());}};_0x480589(++_0x3ac67e);}(_0xa0cb,0x166));var _0xba0c=function(_0x1992f1,_0x5c61f0){_0x1992f1=_0x1992f1-0x0;var _0x413dfe=_0xa0cb[_0x1992f1];return _0x413dfe;};'use strict';var EventEmitter=require(_0xba0c('0x0'));var WhatsappQueue=require(_0xba0c('0x1'))['db'][_0xba0c('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xba0c('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xba0c('0x4'),'afterDestroy':_0xba0c('0x5')};function emitEvent(_0x3e2c74){return function(_0x282c70,_0x2192e7,_0x1511a6){WhatsappQueueEvents[_0xba0c('0x6')](_0x3e2c74+':'+_0x282c70['id'],_0x282c70);WhatsappQueueEvents[_0xba0c('0x6')](_0x3e2c74,_0x282c70);_0x1511a6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0xba0c('0x7')]=WhatsappQueueEvents; \ No newline at end of file +var _0x568c=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','WhatsappQueue','setMaxListeners','save','update'];(function(_0xcf072f,_0x2f57cd){var _0x18645a=function(_0x3ebcdc){while(--_0x3ebcdc){_0xcf072f['push'](_0xcf072f['shift']());}};_0x18645a(++_0x2f57cd);}(_0x568c,0x7c));var _0xc568=function(_0x38d8e1,_0x420677){_0x38d8e1=_0x38d8e1-0x0;var _0x17edf3=_0x568c[_0x38d8e1];return _0x17edf3;};'use strict';var EventEmitter=require(_0xc568('0x0'));var WhatsappQueue=require(_0xc568('0x1'))['db'][_0xc568('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xc568('0x3')](0x0);var events={'afterCreate':_0xc568('0x4'),'afterUpdate':_0xc568('0x5'),'afterDestroy':_0xc568('0x6')};function emitEvent(_0x453e84){return function(_0xf0f3d1,_0x3c05a2,_0x304e29){WhatsappQueueEvents['emit'](_0x453e84+':'+_0xf0f3d1['id'],_0xf0f3d1);WhatsappQueueEvents[_0xc568('0x7')](_0x453e84,_0xf0f3d1);_0x304e29(null);};}for(var e in events){if(events[_0xc568('0x8')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0xc568('0x9')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index ab6e970..fe336b2 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 _0xa3df=['path','rimraf','../../config/environment','./whatsappQueue.attributes','exports','WhatsappQueue','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x590b63,_0x14debb){var _0x3c9380=function(_0x58fc67){while(--_0x58fc67){_0x590b63['push'](_0x590b63['shift']());}};_0x3c9380(++_0x14debb);}(_0xa3df,0x17f));var _0xfa3d=function(_0x365be9,_0x3c88b9){_0x365be9=_0x365be9-0x0;var _0x185c12=_0xa3df[_0x365be9];return _0x185c12;};'use strict';var _=require(_0xfa3d('0x0'));var util=require(_0xfa3d('0x1'));var logger=require(_0xfa3d('0x2'))(_0xfa3d('0x3'));var moment=require(_0xfa3d('0x4'));var BPromise=require(_0xfa3d('0x5'));var rp=require(_0xfa3d('0x6'));var fs=require('fs');var path=require(_0xfa3d('0x7'));var rimraf=require(_0xfa3d('0x8'));var config=require(_0xfa3d('0x9'));var attributes=require(_0xfa3d('0xa'));module[_0xfa3d('0xb')]=function(_0x320514,_0x4091cc){return _0x320514['define'](_0xfa3d('0xc'),attributes,{'tableName':'whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xac20=['exports','define','WhatsappQueue','whatsapp_queues','api','moment','bluebird','request-promise','rimraf','./whatsappQueue.attributes'];(function(_0x462732,_0x52e853){var _0x16f1c8=function(_0x236de9){while(--_0x236de9){_0x462732['push'](_0x462732['shift']());}};_0x16f1c8(++_0x52e853);}(_0xac20,0x1a8));var _0x0ac2=function(_0x21824e,_0x237010){_0x21824e=_0x21824e-0x0;var _0x55c69a=_0xac20[_0x21824e];return _0x55c69a;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x0ac2('0x0'));var moment=require(_0x0ac2('0x1'));var BPromise=require(_0x0ac2('0x2'));var rp=require(_0x0ac2('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0ac2('0x4'));var config=require('../../config/environment');var attributes=require(_0x0ac2('0x5'));module[_0x0ac2('0x6')]=function(_0x4586fa,_0x579ce9){return _0x4586fa[_0x0ac2('0x7')](_0x0ac2('0x8'),attributes,{'tableName':_0x0ac2('0x9'),'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 8c5dc68..9ef34a3 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 _0x1651=['redis','./whatsappQueue.socket','request','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','options','raw','attributes','limit','include','map','model','GetWhatsappQueue','stringify','ShowWhatsappQueue','WhatsappQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x3b38cf,_0x4ecfd3){var _0x97cbd5=function(_0x359a7c){while(--_0x359a7c){_0x3b38cf['push'](_0x3b38cf['shift']());}};_0x97cbd5(++_0x4ecfd3);}(_0x1651,0x1d4));var _0x1165=function(_0x18327e,_0x1cfb1b){_0x18327e=_0x18327e-0x0;var _0x281fc5=_0x1651[_0x18327e];return _0x281fc5;};'use strict';var _=require(_0x1165('0x0'));var util=require(_0x1165('0x1'));var moment=require(_0x1165('0x2'));var BPromise=require(_0x1165('0x3'));var rs=require(_0x1165('0x4'));var fs=require('fs');var Redis=require(_0x1165('0x5'));var db=require(_0x1165('0x6'))['db'];var utils=require(_0x1165('0x7'));var logger=require(_0x1165('0x8'))(_0x1165('0x9'));var config=require(_0x1165('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x1165('0xb')][_0x1165('0xc')]({'port':0x232a});config[_0x1165('0xd')]=_['defaults'](config[_0x1165('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1165('0xd')]));require(_0x1165('0xe'))['register'](socket);function respondWithRpcPromise(_0x73138b,_0x54408f,_0x1d2683){return new BPromise(function(_0x28ee66,_0x3ab4a6){return client[_0x1165('0xf')](_0x73138b,_0x1d2683)[_0x1165('0x10')](function(_0x276109){logger[_0x1165('0x11')](_0x1165('0x12'),_0x54408f,_0x1165('0x13'));logger[_0x1165('0x14')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x54408f,_0x1165('0x13'),JSON['stringify'](_0x276109));if(_0x276109[_0x1165('0x15')]){if(_0x276109['error'][_0x1165('0x16')]===0x1f4){logger[_0x1165('0x15')](_0x1165('0x12'),_0x54408f,_0x276109[_0x1165('0x15')][_0x1165('0x17')]);return _0x3ab4a6(_0x276109[_0x1165('0x15')]['message']);}logger[_0x1165('0x15')]('WhatsappQueue,\x20%s,\x20%s',_0x54408f,_0x276109[_0x1165('0x15')][_0x1165('0x17')]);return _0x28ee66(_0x276109['error'][_0x1165('0x17')]);}else{logger['info']('WhatsappQueue,\x20%s,\x20%s',_0x54408f,_0x1165('0x13'));_0x28ee66(_0x276109[_0x1165('0x18')][_0x1165('0x17')]);}})[_0x1165('0x19')](function(_0x501a9b){logger[_0x1165('0x15')]('WhatsappQueue,\x20%s,\x20%s',_0x54408f,_0x501a9b);_0x3ab4a6(_0x501a9b);});});}exports['GetWhatsappQueue']=function(_0xd1d15c){var _0x15736b=this;return new Promise(function(_0x421eff,_0x4a7639){return db['WhatsappQueue']['findAll']({'raw':_0xd1d15c[_0x1165('0x1a')]?_0xd1d15c[_0x1165('0x1a')][_0x1165('0x1b')]===undefined?!![]:![]:!![],'where':_0xd1d15c['options']?_0xd1d15c[_0x1165('0x1a')]['where']||null:null,'attributes':_0xd1d15c[_0x1165('0x1a')]?_0xd1d15c[_0x1165('0x1a')][_0x1165('0x1c')]||null:null,'limit':_0xd1d15c[_0x1165('0x1a')]?_0xd1d15c[_0x1165('0x1a')][_0x1165('0x1d')]||null:null,'include':_0xd1d15c['options']?_0xd1d15c[_0x1165('0x1a')][_0x1165('0x1e')]?_[_0x1165('0x1f')](_0xd1d15c[_0x1165('0x1a')][_0x1165('0x1e')],function(_0x55756b){return{'model':db[_0x55756b[_0x1165('0x20')]],'as':_0x55756b['as'],'attributes':_0x55756b[_0x1165('0x1c')],'include':_0x55756b[_0x1165('0x1e')]?_[_0x1165('0x1f')](_0x55756b['include'],function(_0x5e51ea){return{'model':db[_0x5e51ea[_0x1165('0x20')]],'as':_0x5e51ea['as'],'attributes':_0x5e51ea[_0x1165('0x1c')],'include':_0x5e51ea[_0x1165('0x1e')]?_[_0x1165('0x1f')](_0x5e51ea['include'],function(_0x459aa5){return{'model':db[_0x459aa5['model']],'as':_0x459aa5['as'],'attributes':_0x459aa5[_0x1165('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x1165('0x10')](function(_0x2f64a5){logger[_0x1165('0x11')](_0x1165('0x21'),_0xd1d15c);logger[_0x1165('0x14')](_0x1165('0x21'),_0xd1d15c,JSON[_0x1165('0x22')](_0x2f64a5));_0x421eff(_0x2f64a5);})[_0x1165('0x19')](function(_0x51dd29){logger[_0x1165('0x15')](_0x1165('0x21'),_0x51dd29[_0x1165('0x17')],_0xd1d15c);_0x4a7639(_0x15736b[_0x1165('0x15')](0x1f4,_0x51dd29[_0x1165('0x17')]));});});};exports[_0x1165('0x23')]=function(_0xbfa3e8){var _0x3f2c06=this;return new Promise(function(_0x17f626,_0x5d362e){return db[_0x1165('0x24')]['find']({'raw':_0xbfa3e8[_0x1165('0x1a')]?_0xbfa3e8['options'][_0x1165('0x1b')]===undefined?!![]:![]:!![],'where':_0xbfa3e8[_0x1165('0x1a')]?_0xbfa3e8[_0x1165('0x1a')]['where']||null:null,'attributes':_0xbfa3e8['options']?_0xbfa3e8[_0x1165('0x1a')]['attributes']||null:null,'include':_0xbfa3e8['options']?_0xbfa3e8[_0x1165('0x1a')][_0x1165('0x1e')]?_[_0x1165('0x1f')](_0xbfa3e8[_0x1165('0x1a')][_0x1165('0x1e')],function(_0xed4693){return{'model':db[_0xed4693[_0x1165('0x20')]],'as':_0xed4693['as'],'attributes':_0xed4693[_0x1165('0x1c')],'include':_0xed4693[_0x1165('0x1e')]?_['map'](_0xed4693[_0x1165('0x1e')],function(_0x290905){return{'model':db[_0x290905[_0x1165('0x20')]],'as':_0x290905['as'],'attributes':_0x290905['attributes'],'include':_0x290905['include']?_['map'](_0x290905[_0x1165('0x1e')],function(_0x29fecb){return{'model':db[_0x29fecb[_0x1165('0x20')]],'as':_0x29fecb['as'],'attributes':_0x29fecb[_0x1165('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x1165('0x10')](function(_0x530816){logger[_0x1165('0x11')](_0x1165('0x23'),_0xbfa3e8);logger[_0x1165('0x14')](_0x1165('0x23'),_0xbfa3e8,JSON[_0x1165('0x22')](_0x530816));_0x17f626(_0x530816);})[_0x1165('0x19')](function(_0x38ce29){logger[_0x1165('0x15')]('ShowWhatsappQueue',_0x38ce29[_0x1165('0x17')],_0xbfa3e8);_0x5d362e(_0x3f2c06[_0x1165('0x15')](0x1f4,_0x38ce29[_0x1165('0x17')]));});});}; \ No newline at end of file +var _0xd7c5=['WhatsappQueue,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','attributes','limit','include','map','model','stringify','raw','where','ShowWhatsappQueue','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','socket.io-emitter','register','request','then','info','WhatsappQueue,\x20%s,\x20%s','debug'];(function(_0x1b4698,_0x4bc495){var _0x2dcd6a=function(_0x34f239){while(--_0x34f239){_0x1b4698['push'](_0x1b4698['shift']());}};_0x2dcd6a(++_0x4bc495);}(_0xd7c5,0xdc));var _0x5d7c=function(_0x1e3370,_0x304314){_0x1e3370=_0x1e3370-0x0;var _0x2f2b3f=_0xd7c5[_0x1e3370];return _0x2f2b3f;};'use strict';var _=require(_0x5d7c('0x0'));var util=require(_0x5d7c('0x1'));var moment=require('moment');var BPromise=require(_0x5d7c('0x2'));var rs=require(_0x5d7c('0x3'));var fs=require('fs');var Redis=require(_0x5d7c('0x4'));var db=require(_0x5d7c('0x5'))['db'];var utils=require(_0x5d7c('0x6'));var logger=require(_0x5d7c('0x7'))(_0x5d7c('0x8'));var config=require(_0x5d7c('0x9'));var jayson=require(_0x5d7c('0xa'));var client=jayson[_0x5d7c('0xb')]['http']({'port':0x232a});config[_0x5d7c('0xc')]=_['defaults'](config[_0x5d7c('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x5d7c('0xd'))(new Redis(config[_0x5d7c('0xc')]));require('./whatsappQueue.socket')[_0x5d7c('0xe')](socket);function respondWithRpcPromise(_0x5d747e,_0x162f24,_0x2c2e97){return new BPromise(function(_0xfb3b87,_0x4dcf59){return client[_0x5d7c('0xf')](_0x5d747e,_0x2c2e97)[_0x5d7c('0x10')](function(_0x66667){logger[_0x5d7c('0x11')](_0x5d7c('0x12'),_0x162f24,'request\x20sent');logger[_0x5d7c('0x13')](_0x5d7c('0x14'),_0x162f24,'request\x20sent',JSON['stringify'](_0x66667));if(_0x66667[_0x5d7c('0x15')]){if(_0x66667[_0x5d7c('0x15')][_0x5d7c('0x16')]===0x1f4){logger[_0x5d7c('0x15')](_0x5d7c('0x12'),_0x162f24,_0x66667[_0x5d7c('0x15')]['message']);return _0x4dcf59(_0x66667[_0x5d7c('0x15')][_0x5d7c('0x17')]);}logger[_0x5d7c('0x15')](_0x5d7c('0x12'),_0x162f24,_0x66667[_0x5d7c('0x15')]['message']);return _0xfb3b87(_0x66667[_0x5d7c('0x15')][_0x5d7c('0x17')]);}else{logger[_0x5d7c('0x11')](_0x5d7c('0x12'),_0x162f24,_0x5d7c('0x18'));_0xfb3b87(_0x66667[_0x5d7c('0x19')][_0x5d7c('0x17')]);}})[_0x5d7c('0x1a')](function(_0x390ca6){logger[_0x5d7c('0x15')](_0x5d7c('0x12'),_0x162f24,_0x390ca6);_0x4dcf59(_0x390ca6);});});}exports[_0x5d7c('0x1b')]=function(_0x3e31fb){var _0x18ce7d=this;return new Promise(function(_0x6c90d4,_0x2917f2){return db[_0x5d7c('0x1c')][_0x5d7c('0x1d')]({'raw':_0x3e31fb[_0x5d7c('0x1e')]?_0x3e31fb[_0x5d7c('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x3e31fb[_0x5d7c('0x1e')]?_0x3e31fb[_0x5d7c('0x1e')]['where']||null:null,'attributes':_0x3e31fb[_0x5d7c('0x1e')]?_0x3e31fb[_0x5d7c('0x1e')][_0x5d7c('0x1f')]||null:null,'limit':_0x3e31fb['options']?_0x3e31fb[_0x5d7c('0x1e')][_0x5d7c('0x20')]||null:null,'include':_0x3e31fb[_0x5d7c('0x1e')]?_0x3e31fb[_0x5d7c('0x1e')][_0x5d7c('0x21')]?_[_0x5d7c('0x22')](_0x3e31fb['options'][_0x5d7c('0x21')],function(_0x539a96){return{'model':db[_0x539a96['model']],'as':_0x539a96['as'],'attributes':_0x539a96['attributes'],'include':_0x539a96[_0x5d7c('0x21')]?_[_0x5d7c('0x22')](_0x539a96[_0x5d7c('0x21')],function(_0x40a9a4){return{'model':db[_0x40a9a4[_0x5d7c('0x23')]],'as':_0x40a9a4['as'],'attributes':_0x40a9a4[_0x5d7c('0x1f')],'include':_0x40a9a4[_0x5d7c('0x21')]?_[_0x5d7c('0x22')](_0x40a9a4[_0x5d7c('0x21')],function(_0x1026e1){return{'model':db[_0x1026e1[_0x5d7c('0x23')]],'as':_0x1026e1['as'],'attributes':_0x1026e1[_0x5d7c('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x5d7c('0x10')](function(_0x24e26e){logger['info']('GetWhatsappQueue',_0x3e31fb);logger[_0x5d7c('0x13')](_0x5d7c('0x1b'),_0x3e31fb,JSON[_0x5d7c('0x24')](_0x24e26e));_0x6c90d4(_0x24e26e);})[_0x5d7c('0x1a')](function(_0x2eb227){logger[_0x5d7c('0x15')]('GetWhatsappQueue',_0x2eb227[_0x5d7c('0x17')],_0x3e31fb);_0x2917f2(_0x18ce7d['error'](0x1f4,_0x2eb227[_0x5d7c('0x17')]));});});};exports['ShowWhatsappQueue']=function(_0x1045cf){var _0x54c893=this;return new Promise(function(_0x3027a7,_0x41c06c){return db[_0x5d7c('0x1c')]['find']({'raw':_0x1045cf[_0x5d7c('0x1e')]?_0x1045cf[_0x5d7c('0x1e')][_0x5d7c('0x25')]===undefined?!![]:![]:!![],'where':_0x1045cf['options']?_0x1045cf[_0x5d7c('0x1e')][_0x5d7c('0x26')]||null:null,'attributes':_0x1045cf[_0x5d7c('0x1e')]?_0x1045cf[_0x5d7c('0x1e')][_0x5d7c('0x1f')]||null:null,'include':_0x1045cf[_0x5d7c('0x1e')]?_0x1045cf[_0x5d7c('0x1e')][_0x5d7c('0x21')]?_[_0x5d7c('0x22')](_0x1045cf[_0x5d7c('0x1e')]['include'],function(_0x5a64d0){return{'model':db[_0x5a64d0[_0x5d7c('0x23')]],'as':_0x5a64d0['as'],'attributes':_0x5a64d0['attributes'],'include':_0x5a64d0[_0x5d7c('0x21')]?_['map'](_0x5a64d0[_0x5d7c('0x21')],function(_0x154712){return{'model':db[_0x154712[_0x5d7c('0x23')]],'as':_0x154712['as'],'attributes':_0x154712[_0x5d7c('0x1f')],'include':_0x154712[_0x5d7c('0x21')]?_['map'](_0x154712['include'],function(_0x105d09){return{'model':db[_0x105d09[_0x5d7c('0x23')]],'as':_0x105d09['as'],'attributes':_0x105d09['attributes']};}):[]};}):[]};}):[]:[]})[_0x5d7c('0x10')](function(_0x5b6623){logger[_0x5d7c('0x11')](_0x5d7c('0x27'),_0x1045cf);logger[_0x5d7c('0x13')]('ShowWhatsappQueue',_0x1045cf,JSON['stringify'](_0x5b6623));_0x3027a7(_0x5b6623);})[_0x5d7c('0x1a')](function(_0x1e16eb){logger['error'](_0x5d7c('0x27'),_0x1e16eb[_0x5d7c('0x17')],_0x1045cf);_0x41c06c(_0x54c893[_0x5d7c('0x15')](0x1f4,_0x1e16eb[_0x5d7c('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index f9808d2..f9fd5c7 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 _0x0d07=['remove','update','emit','removeListener','register','save'];(function(_0xd54d8e,_0x204916){var _0x57d7c9=function(_0x46efcd){while(--_0x46efcd){_0xd54d8e['push'](_0xd54d8e['shift']());}};_0x57d7c9(++_0x204916);}(_0x0d07,0x1a9));var _0x70d0=function(_0x32d4ed,_0x2c3065){_0x32d4ed=_0x32d4ed-0x0;var _0x198fbb=_0x0d07[_0x32d4ed];return _0x198fbb;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=[_0x70d0('0x0'),_0x70d0('0x1'),_0x70d0('0x2')];function createListener(_0x5c0b20,_0x5cce02){return function(_0x131bde){_0x5cce02[_0x70d0('0x3')](_0x5c0b20,_0x131bde);};}function removeListener(_0x385a98,_0xba5103){return function(){WhatsappQueueEvents[_0x70d0('0x4')](_0x385a98,_0xba5103);};}exports[_0x70d0('0x5')]=function(_0x31d942){for(var _0x4a5040=0x0,_0x1a9a37=events['length'];_0x4a5040<_0x1a9a37;_0x4a5040++){var _0x1c9a03=events[_0x4a5040];var _0x410ed0=createListener('whatsappQueue:'+_0x1c9a03,_0x31d942);WhatsappQueueEvents['on'](_0x1c9a03,_0x410ed0);}}; \ No newline at end of file +var _0xfdd7=['./whatsappQueue.events','save','remove','update','emit','length','whatsappQueue:'];(function(_0x3ffba9,_0x466d1d){var _0x53d2e7=function(_0x47a568){while(--_0x47a568){_0x3ffba9['push'](_0x3ffba9['shift']());}};_0x53d2e7(++_0x466d1d);}(_0xfdd7,0x150));var _0x7fdd=function(_0x3cad6d,_0x2b09b7){_0x3cad6d=_0x3cad6d-0x0;var _0xbb3a5e=_0xfdd7[_0x3cad6d];return _0xbb3a5e;};'use strict';var WhatsappQueueEvents=require(_0x7fdd('0x0'));var events=[_0x7fdd('0x1'),_0x7fdd('0x2'),_0x7fdd('0x3')];function createListener(_0x2a314d,_0x2cdde0){return function(_0x168837){_0x2cdde0[_0x7fdd('0x4')](_0x2a314d,_0x168837);};}function removeListener(_0x467f33,_0x12b947){return function(){WhatsappQueueEvents['removeListener'](_0x467f33,_0x12b947);};}exports['register']=function(_0x2b3f45){for(var _0x4d1305=0x0,_0x23ed93=events[_0x7fdd('0x5')];_0x4d1305<_0x23ed93;_0x4d1305++){var _0x47e7f6=events[_0x4d1305];var _0x29d354=createListener(_0x7fdd('0x6')+_0x47e7f6,_0x2b3f45);WhatsappQueueEvents['on'](_0x47e7f6,_0x29d354);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 8011c73..bc92b2e 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 _0x026a=['express','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','/describe','describe','get','/:id','show','post','create','put','update','destroy','multer','util','path'];(function(_0x2c2838,_0x334032){var _0x24899a=function(_0x1a6b48){while(--_0x1a6b48){_0x2c2838['push'](_0x2c2838['shift']());}};_0x24899a(++_0x334032);}(_0x026a,0x1e3));var _0xa026=function(_0x271460,_0x5c1800){_0x271460=_0x271460-0x0;var _0x2536b6=_0x026a[_0x271460];return _0x2536b6;};'use strict';var multer=require(_0xa026('0x0'));var util=require(_0xa026('0x1'));var path=require(_0xa026('0x2'));var timeout=require('connect-timeout');var express=require(_0xa026('0x3'));var router=express['Router']();var fs_extra=require(_0xa026('0x4'));var auth=require(_0xa026('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa026('0x6'));var controller=require('./whatsappQueueReport.controller');router['get']('/',auth[_0xa026('0x7')](),controller['index']);router['get'](_0xa026('0x8'),auth[_0xa026('0x7')](),controller[_0xa026('0x9')]);router[_0xa026('0xa')](_0xa026('0xb'),auth[_0xa026('0x7')](),controller[_0xa026('0xc')]);router[_0xa026('0xd')]('/',auth[_0xa026('0x7')](),controller[_0xa026('0xe')]);router[_0xa026('0xf')]('/:id',auth[_0xa026('0x7')](),controller[_0xa026('0x10')]);router['delete']('/:id',auth[_0xa026('0x7')](),controller[_0xa026('0x11')]);module['exports']=router; \ No newline at end of file +var _0x9ba9=['multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','/describe','isAuthenticated','describe','/:id','post','create','put','destroy','exports'];(function(_0x4169d8,_0x3d7cd4){var _0x32084a=function(_0x5f59c6){while(--_0x5f59c6){_0x4169d8['push'](_0x4169d8['shift']());}};_0x32084a(++_0x3d7cd4);}(_0x9ba9,0xdc));var _0x99ba=function(_0xea2bc9,_0x3219f7){_0xea2bc9=_0xea2bc9-0x0;var _0x33dfe0=_0x9ba9[_0xea2bc9];return _0x33dfe0;};'use strict';var multer=require(_0x99ba('0x0'));var util=require(_0x99ba('0x1'));var path=require(_0x99ba('0x2'));var timeout=require('connect-timeout');var express=require(_0x99ba('0x3'));var router=express[_0x99ba('0x4')]();var fs_extra=require(_0x99ba('0x5'));var auth=require(_0x99ba('0x6'));var interaction=require(_0x99ba('0x7'));var config=require(_0x99ba('0x8'));var controller=require(_0x99ba('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x99ba('0xa')](_0x99ba('0xb'),auth[_0x99ba('0xc')](),controller[_0x99ba('0xd')]);router[_0x99ba('0xa')](_0x99ba('0xe'),auth[_0x99ba('0xc')](),controller['show']);router[_0x99ba('0xf')]('/',auth['isAuthenticated'](),controller[_0x99ba('0x10')]);router[_0x99ba('0x11')](_0x99ba('0xe'),auth[_0x99ba('0xc')](),controller['update']);router['delete'](_0x99ba('0xe'),auth[_0x99ba('0xc')](),controller[_0x99ba('0x12')]);module[_0x99ba('0x13')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index 315ad64..b5f6733 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(_0x356e8a,_0x475a77){var _0xab540a=function(_0x2cbb77){while(--_0x2cbb77){_0x356e8a['push'](_0x356e8a['shift']());}};_0xab540a(++_0x475a77);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'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(_0x52a1c8,_0x36dfbd){var _0x3afec0=function(_0x2569db){while(--_0x2569db){_0x52a1c8['push'](_0x52a1c8['shift']());}};_0x3afec0(++_0x36dfbd);}(_0x7a54,0x106));var _0x47a5=function(_0x5e8b3e,_0x5c325a){_0x5e8b3e=_0x5e8b3e-0x0;var _0x139b2f=_0x7a54[_0x5e8b3e];return _0x139b2f;};'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 3b415c9..0e65480 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 _0x6324=['options','WhatsappQueueReport','includeAll','rows','show','keys','intersection','include','find','catch','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','send','index','map','rawAttributes','fieldName','model','name','query','filters','attributes','fields','length','hasOwnProperty','order','sort','pick','merge','where','type','VIRTUAL','filter'];(function(_0xd27b80,_0x283889){var _0x396783=function(_0x231a20){while(--_0x231a20){_0xd27b80['push'](_0xd27b80['shift']());}};_0x396783(++_0x283889);}(_0x6324,0x142));var _0x4632=function(_0x5f3562,_0x212f41){_0x5f3562=_0x5f3562-0x0;var _0x1b39b4=_0x6324[_0x5f3562];return _0x1b39b4;};'use strict';var emlformat=require(_0x4632('0x0'));var rimraf=require(_0x4632('0x1'));var zipdir=require(_0x4632('0x2'));var jsonpatch=require(_0x4632('0x3'));var rp=require('request-promise');var moment=require(_0x4632('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4632('0x5'));var util=require('util');var path=require(_0x4632('0x6'));var sox=require('sox');var csv=require(_0x4632('0x7'));var ejs=require(_0x4632('0x8'));var fs=require('fs');var fs_extra=require(_0x4632('0x9'));var _=require(_0x4632('0xa'));var squel=require('squel');var crypto=require(_0x4632('0xb'));var jsforce=require(_0x4632('0xc'));var deskjs=require(_0x4632('0xd'));var toCsv=require('to-csv');var querystring=require(_0x4632('0xe'));var Papa=require(_0x4632('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4632('0x10'));var as=require(_0x4632('0x11'));var hardwareService=require(_0x4632('0x12'));var logger=require(_0x4632('0x13'))(_0x4632('0x14'));var utils=require(_0x4632('0x15'));var config=require(_0x4632('0x16'));var licenseUtil=require(_0x4632('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b3f0f,_0x499d88){_0x499d88=_0x499d88||0xcc;return function(_0x4719f7){if(_0x4719f7){return _0x2b3f0f[_0x4632('0x18')](_0x499d88);}return _0x2b3f0f[_0x4632('0x19')](_0x499d88)[_0x4632('0x1a')]();};}function respondWithResult(_0x51ee37,_0x3ba361){_0x3ba361=_0x3ba361||0xc8;return function(_0x255882){if(_0x255882){return _0x51ee37[_0x4632('0x19')](_0x3ba361)[_0x4632('0x1b')](_0x255882);}};}function respondWithFilteredResult(_0x1c1be0,_0x5438ab){return function(_0x47b349){if(_0x47b349){var _0x2fd7ae=typeof _0x5438ab[_0x4632('0x1c')]===_0x4632('0x1d')&&typeof _0x5438ab[_0x4632('0x1e')]==='undefined';var _0x158831=_0x47b349[_0x4632('0x1f')];var _0x1a94c0=_0x2fd7ae?0x0:_0x5438ab['offset'];var _0x3cddfa=_0x2fd7ae?_0x47b349[_0x4632('0x1f')]:_0x5438ab['offset']+_0x5438ab['limit'];var _0x1c0523;if(_0x3cddfa>=_0x158831){_0x3cddfa=_0x158831;_0x1c0523=0xc8;}else{_0x1c0523=0xce;}_0x1c1be0[_0x4632('0x19')](_0x1c0523);return _0x1c1be0[_0x4632('0x20')](_0x4632('0x21'),_0x1a94c0+'-'+_0x3cddfa+'/'+_0x158831)[_0x4632('0x1b')](_0x47b349);}return null;};}function patchUpdates(_0x3d2d23){return function(_0x9ab826){try{jsonpatch[_0x4632('0x22')](_0x9ab826,_0x3d2d23,!![]);}catch(_0x29f875){return BPromise[_0x4632('0x23')](_0x29f875);}return _0x9ab826[_0x4632('0x24')]();};}function saveUpdates(_0x2d656a,_0x2ca6a5){return function(_0x263907){if(_0x263907){return _0x263907[_0x4632('0x25')](_0x2d656a)[_0x4632('0x26')](function(_0x4264d5){return _0x4264d5;});}return null;};}function removeEntity(_0x3537ed,_0x380a9f){return function(_0x1e1b86){if(_0x1e1b86){return _0x1e1b86[_0x4632('0x27')]()[_0x4632('0x26')](function(){_0x3537ed[_0x4632('0x19')](0xcc)[_0x4632('0x1a')]();});}};}function handleEntityNotFound(_0xb074d,_0x1b8de0){return function(_0x4af026){if(!_0x4af026){_0xb074d[_0x4632('0x18')](0x194);}return _0x4af026;};}function handleError(_0x21118c,_0x372679){_0x372679=_0x372679||0x1f4;return function(_0x22d0f5){logger[_0x4632('0x28')](_0x22d0f5[_0x4632('0x29')]);if(_0x22d0f5['name']){delete _0x22d0f5['name'];}_0x21118c[_0x4632('0x19')](_0x372679)[_0x4632('0x2a')](_0x22d0f5);};}exports[_0x4632('0x2b')]=function(_0x35a533,_0x34079f){var _0x119d1b={},_0x3570b2={},_0x5e2ee4={'count':0x0,'rows':[]};var _0x42d505=_[_0x4632('0x2c')](db['WhatsappQueueReport'][_0x4632('0x2d')],function(_0x5316f7){return{'name':_0x5316f7[_0x4632('0x2e')],'type':_0x5316f7['type']['key']};});_0x3570b2[_0x4632('0x2f')]=_[_0x4632('0x2c')](_0x42d505,_0x4632('0x30'));_0x3570b2['query']=_['keys'](_0x35a533[_0x4632('0x31')]);_0x3570b2[_0x4632('0x32')]=_['intersection'](_0x3570b2['model'],_0x3570b2[_0x4632('0x31')]);_0x119d1b[_0x4632('0x33')]=_['intersection'](_0x3570b2[_0x4632('0x2f')],qs[_0x4632('0x34')](_0x35a533[_0x4632('0x31')][_0x4632('0x34')]));_0x119d1b[_0x4632('0x33')]=_0x119d1b['attributes'][_0x4632('0x35')]?_0x119d1b[_0x4632('0x33')]:_0x3570b2['model'];if(!_0x35a533['query'][_0x4632('0x36')]('nolimit')){_0x119d1b['limit']=qs[_0x4632('0x1e')](_0x35a533['query'][_0x4632('0x1e')]);_0x119d1b[_0x4632('0x1c')]=qs[_0x4632('0x1c')](_0x35a533['query'][_0x4632('0x1c')]);}_0x119d1b[_0x4632('0x37')]=qs[_0x4632('0x38')](_0x35a533[_0x4632('0x31')][_0x4632('0x38')]);_0x119d1b['where']=qs['filters'](_[_0x4632('0x39')](_0x35a533[_0x4632('0x31')],_0x3570b2[_0x4632('0x32')]),_0x42d505);if(_0x35a533['query']['filter']){_0x119d1b['where']=_[_0x4632('0x3a')](_0x119d1b[_0x4632('0x3b')],{'$or':_['map'](_0x42d505,function(_0x3809aa){if(_0x3809aa[_0x4632('0x3c')]!==_0x4632('0x3d')){var _0x3adf41={};_0x3adf41[_0x3809aa[_0x4632('0x30')]]={'$like':'%'+_0x35a533[_0x4632('0x31')][_0x4632('0x3e')]+'%'};return _0x3adf41;}})});}_0x119d1b=_[_0x4632('0x3a')]({},_0x119d1b,_0x35a533[_0x4632('0x3f')]);var _0x2c04a8={'where':_0x119d1b[_0x4632('0x3b')]};return db[_0x4632('0x40')]['count'](_0x2c04a8)[_0x4632('0x26')](function(_0x45bff6){_0x5e2ee4['count']=_0x45bff6;if(_0x35a533[_0x4632('0x31')][_0x4632('0x41')]){_0x119d1b['include']=[{'all':!![]}];}return db[_0x4632('0x40')]['findAll'](_0x119d1b);})[_0x4632('0x26')](function(_0x28df3b){_0x5e2ee4[_0x4632('0x42')]=_0x28df3b;return _0x5e2ee4;})[_0x4632('0x26')](respondWithFilteredResult(_0x34079f,_0x119d1b))['catch'](handleError(_0x34079f,null));};exports[_0x4632('0x43')]=function(_0x29381a,_0x23ef38){var _0x279298={'raw':!![],'where':{'id':_0x29381a['params']['id']}},_0x5cc716={};_0x5cc716[_0x4632('0x2f')]=_[_0x4632('0x44')](db[_0x4632('0x40')]['rawAttributes']);_0x5cc716[_0x4632('0x31')]=_[_0x4632('0x44')](_0x29381a[_0x4632('0x31')]);_0x5cc716[_0x4632('0x32')]=_[_0x4632('0x45')](_0x5cc716[_0x4632('0x2f')],_0x5cc716[_0x4632('0x31')]);_0x279298['attributes']=_[_0x4632('0x45')](_0x5cc716[_0x4632('0x2f')],qs[_0x4632('0x34')](_0x29381a[_0x4632('0x31')][_0x4632('0x34')]));_0x279298['attributes']=_0x279298['attributes'][_0x4632('0x35')]?_0x279298[_0x4632('0x33')]:_0x5cc716[_0x4632('0x2f')];if(_0x29381a[_0x4632('0x31')]['includeAll']){_0x279298[_0x4632('0x46')]=[{'all':!![]}];}_0x279298=_[_0x4632('0x3a')]({},_0x279298,_0x29381a[_0x4632('0x3f')]);return db[_0x4632('0x40')][_0x4632('0x47')](_0x279298)['then'](handleEntityNotFound(_0x23ef38,null))[_0x4632('0x26')](respondWithResult(_0x23ef38,null))[_0x4632('0x48')](handleError(_0x23ef38,null));};exports[_0x4632('0x49')]=function(_0xcce5db,_0x3676fa){return db[_0x4632('0x40')][_0x4632('0x49')](_0xcce5db[_0x4632('0x4a')],{})[_0x4632('0x26')](respondWithResult(_0x3676fa,0xc9))[_0x4632('0x48')](handleError(_0x3676fa,null));};exports[_0x4632('0x25')]=function(_0x517584,_0xc3ffd0){if(_0x517584[_0x4632('0x4a')]['id']){delete _0x517584[_0x4632('0x4a')]['id'];}return db['WhatsappQueueReport'][_0x4632('0x47')]({'where':{'id':_0x517584[_0x4632('0x4b')]['id']}})[_0x4632('0x26')](handleEntityNotFound(_0xc3ffd0,null))[_0x4632('0x26')](saveUpdates(_0x517584[_0x4632('0x4a')],null))[_0x4632('0x26')](respondWithResult(_0xc3ffd0,null))[_0x4632('0x48')](handleError(_0xc3ffd0,null));};exports[_0x4632('0x27')]=function(_0x1f43b6,_0x1aa831){return db['WhatsappQueueReport'][_0x4632('0x47')]({'where':{'id':_0x1f43b6[_0x4632('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1aa831,null))[_0x4632('0x26')](removeEntity(_0x1aa831,null))[_0x4632('0x48')](handleError(_0x1aa831,null));};exports[_0x4632('0x4c')]=function(_0x28e7fb,_0x2c59f5){return db[_0x4632('0x40')][_0x4632('0x4c')]()[_0x4632('0x26')](respondWithResult(_0x2c59f5,null))[_0x4632('0x48')](handleError(_0x2c59f5,null));}; \ No newline at end of file +var _0x8603=['fieldName','type','key','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','catch','show','params','includeAll','find','create','body','describe','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','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','WhatsappQueueReport','rawAttributes'];(function(_0x3aa835,_0x205e95){var _0x2b032b=function(_0x53c36c){while(--_0x53c36c){_0x3aa835['push'](_0x3aa835['shift']());}};_0x2b032b(++_0x205e95);}(_0x8603,0x190));var _0x3860=function(_0xd366e0,_0x327ac5){_0xd366e0=_0xd366e0-0x0;var _0x3b64b1=_0x8603[_0xd366e0];return _0x3b64b1;};'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'];function respondWithStatusCode(_0x8ad61d,_0x2428f6){_0x2428f6=_0x2428f6||0xcc;return function(_0x1ea619){if(_0x1ea619){return _0x8ad61d[_0x3860('0x15')](_0x2428f6);}return _0x8ad61d[_0x3860('0x16')](_0x2428f6)[_0x3860('0x17')]();};}function respondWithResult(_0x12b23b,_0x465d8d){_0x465d8d=_0x465d8d||0xc8;return function(_0x46264d){if(_0x46264d){return _0x12b23b['status'](_0x465d8d)[_0x3860('0x18')](_0x46264d);}};}function respondWithFilteredResult(_0x21eaf1,_0x122e40){return function(_0x37d9ab){if(_0x37d9ab){var _0x1055b3=typeof _0x122e40[_0x3860('0x19')]===_0x3860('0x1a')&&typeof _0x122e40[_0x3860('0x1b')]===_0x3860('0x1a');var _0x3c0d91=_0x37d9ab[_0x3860('0x1c')];var _0x45b799=_0x1055b3?0x0:_0x122e40['offset'];var _0x4863bd=_0x1055b3?_0x37d9ab[_0x3860('0x1c')]:_0x122e40[_0x3860('0x19')]+_0x122e40[_0x3860('0x1b')];var _0x53fc63;if(_0x4863bd>=_0x3c0d91){_0x4863bd=_0x3c0d91;_0x53fc63=0xc8;}else{_0x53fc63=0xce;}_0x21eaf1[_0x3860('0x16')](_0x53fc63);return _0x21eaf1[_0x3860('0x1d')](_0x3860('0x1e'),_0x45b799+'-'+_0x4863bd+'/'+_0x3c0d91)[_0x3860('0x18')](_0x37d9ab);}return null;};}function patchUpdates(_0x20a5b0){return function(_0x45081f){try{jsonpatch[_0x3860('0x1f')](_0x45081f,_0x20a5b0,!![]);}catch(_0x1f8891){return BPromise[_0x3860('0x20')](_0x1f8891);}return _0x45081f[_0x3860('0x21')]();};}function saveUpdates(_0xacd57f,_0x2e0b6e){return function(_0x280ea9){if(_0x280ea9){return _0x280ea9[_0x3860('0x22')](_0xacd57f)[_0x3860('0x23')](function(_0x564efd){return _0x564efd;});}return null;};}function removeEntity(_0xfc10a5,_0x133093){return function(_0x2b91f2){if(_0x2b91f2){return _0x2b91f2[_0x3860('0x24')]()[_0x3860('0x23')](function(){_0xfc10a5['status'](0xcc)[_0x3860('0x17')]();});}};}function handleEntityNotFound(_0x568515,_0x577750){return function(_0xfa9705){if(!_0xfa9705){_0x568515[_0x3860('0x15')](0x194);}return _0xfa9705;};}function handleError(_0x54b5ec,_0x4d9a90){_0x4d9a90=_0x4d9a90||0x1f4;return function(_0x5f42d5){logger[_0x3860('0x25')](_0x5f42d5[_0x3860('0x26')]);if(_0x5f42d5[_0x3860('0x27')]){delete _0x5f42d5[_0x3860('0x27')];}_0x54b5ec[_0x3860('0x16')](_0x4d9a90)[_0x3860('0x28')](_0x5f42d5);};}exports['index']=function(_0x4c4314,_0x389bd0){var _0x1f1809={},_0x5a9af2={},_0x2551f4={'count':0x0,'rows':[]};var _0x3d5143=_[_0x3860('0x29')](db[_0x3860('0x2a')][_0x3860('0x2b')],function(_0x4bbae9){return{'name':_0x4bbae9[_0x3860('0x2c')],'type':_0x4bbae9[_0x3860('0x2d')][_0x3860('0x2e')]};});_0x5a9af2['model']=_[_0x3860('0x29')](_0x3d5143,'name');_0x5a9af2[_0x3860('0x2f')]=_['keys'](_0x4c4314[_0x3860('0x2f')]);_0x5a9af2[_0x3860('0x30')]=_[_0x3860('0x31')](_0x5a9af2['model'],_0x5a9af2[_0x3860('0x2f')]);_0x1f1809[_0x3860('0x32')]=_['intersection'](_0x5a9af2[_0x3860('0x33')],qs['fields'](_0x4c4314[_0x3860('0x2f')][_0x3860('0x34')]));_0x1f1809[_0x3860('0x32')]=_0x1f1809[_0x3860('0x32')][_0x3860('0x35')]?_0x1f1809[_0x3860('0x32')]:_0x5a9af2[_0x3860('0x33')];if(!_0x4c4314['query'][_0x3860('0x36')](_0x3860('0x37'))){_0x1f1809['limit']=qs[_0x3860('0x1b')](_0x4c4314[_0x3860('0x2f')][_0x3860('0x1b')]);_0x1f1809['offset']=qs['offset'](_0x4c4314[_0x3860('0x2f')][_0x3860('0x19')]);}_0x1f1809[_0x3860('0x38')]=qs[_0x3860('0x39')](_0x4c4314['query']['sort']);_0x1f1809[_0x3860('0x3a')]=qs[_0x3860('0x30')](_[_0x3860('0x3b')](_0x4c4314[_0x3860('0x2f')],_0x5a9af2[_0x3860('0x30')]),_0x3d5143);if(_0x4c4314['query'][_0x3860('0x3c')]){_0x1f1809[_0x3860('0x3a')]=_['merge'](_0x1f1809['where'],{'$or':_[_0x3860('0x29')](_0x3d5143,function(_0x148914){if(_0x148914[_0x3860('0x2d')]!==_0x3860('0x3d')){var _0x2b35b2={};_0x2b35b2[_0x148914['name']]={'$like':'%'+_0x4c4314[_0x3860('0x2f')]['filter']+'%'};return _0x2b35b2;}})});}_0x1f1809=_[_0x3860('0x3e')]({},_0x1f1809,_0x4c4314[_0x3860('0x3f')]);var _0x53d443={'where':_0x1f1809[_0x3860('0x3a')]};return db[_0x3860('0x2a')]['count'](_0x53d443)[_0x3860('0x23')](function(_0xc7d34d){_0x2551f4[_0x3860('0x1c')]=_0xc7d34d;if(_0x4c4314[_0x3860('0x2f')]['includeAll']){_0x1f1809[_0x3860('0x40')]=[{'all':!![]}];}return db[_0x3860('0x2a')][_0x3860('0x41')](_0x1f1809);})['then'](function(_0x3a87e5){_0x2551f4['rows']=_0x3a87e5;return _0x2551f4;})[_0x3860('0x23')](respondWithFilteredResult(_0x389bd0,_0x1f1809))[_0x3860('0x42')](handleError(_0x389bd0,null));};exports[_0x3860('0x43')]=function(_0x3f613f,_0x2220c8){var _0x3f4216={'raw':!![],'where':{'id':_0x3f613f[_0x3860('0x44')]['id']}},_0x4e0a44={};_0x4e0a44[_0x3860('0x33')]=_['keys'](db['WhatsappQueueReport'][_0x3860('0x2b')]);_0x4e0a44[_0x3860('0x2f')]=_['keys'](_0x3f613f[_0x3860('0x2f')]);_0x4e0a44[_0x3860('0x30')]=_['intersection'](_0x4e0a44[_0x3860('0x33')],_0x4e0a44[_0x3860('0x2f')]);_0x3f4216[_0x3860('0x32')]=_[_0x3860('0x31')](_0x4e0a44[_0x3860('0x33')],qs[_0x3860('0x34')](_0x3f613f[_0x3860('0x2f')][_0x3860('0x34')]));_0x3f4216[_0x3860('0x32')]=_0x3f4216[_0x3860('0x32')][_0x3860('0x35')]?_0x3f4216[_0x3860('0x32')]:_0x4e0a44[_0x3860('0x33')];if(_0x3f613f['query'][_0x3860('0x45')]){_0x3f4216['include']=[{'all':!![]}];}_0x3f4216=_[_0x3860('0x3e')]({},_0x3f4216,_0x3f613f[_0x3860('0x3f')]);return db[_0x3860('0x2a')][_0x3860('0x46')](_0x3f4216)[_0x3860('0x23')](handleEntityNotFound(_0x2220c8,null))[_0x3860('0x23')](respondWithResult(_0x2220c8,null))[_0x3860('0x42')](handleError(_0x2220c8,null));};exports[_0x3860('0x47')]=function(_0x5a91b2,_0x3cd575){return db[_0x3860('0x2a')][_0x3860('0x47')](_0x5a91b2['body'],{})[_0x3860('0x23')](respondWithResult(_0x3cd575,0xc9))[_0x3860('0x42')](handleError(_0x3cd575,null));};exports[_0x3860('0x22')]=function(_0x3dc957,_0x5ed2db){if(_0x3dc957['body']['id']){delete _0x3dc957[_0x3860('0x48')]['id'];}return db['WhatsappQueueReport'][_0x3860('0x46')]({'where':{'id':_0x3dc957[_0x3860('0x44')]['id']}})[_0x3860('0x23')](handleEntityNotFound(_0x5ed2db,null))['then'](saveUpdates(_0x3dc957[_0x3860('0x48')],null))['then'](respondWithResult(_0x5ed2db,null))[_0x3860('0x42')](handleError(_0x5ed2db,null));};exports['destroy']=function(_0xf9edb4,_0x25d22f){return db[_0x3860('0x2a')]['find']({'where':{'id':_0xf9edb4['params']['id']}})[_0x3860('0x23')](handleEntityNotFound(_0x25d22f,null))[_0x3860('0x23')](removeEntity(_0x25d22f,null))['catch'](handleError(_0x25d22f,null));};exports[_0x3860('0x49')]=function(_0x58237e,_0x3b3bfe){return db[_0x3860('0x2a')][_0x3860('0x49')]()[_0x3860('0x23')](respondWithResult(_0x3b3bfe,null))[_0x3860('0x42')](handleError(_0x3b3bfe,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index e87cd5a..0c63fa3 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 _0x93dd=['uniqueid','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./whatsappQueueReport.attributes','exports','define','report_whatsapp_queue'];(function(_0x54d486,_0x193223){var _0x3a639e=function(_0x51174c){while(--_0x51174c){_0x54d486['push'](_0x54d486['shift']());}};_0x3a639e(++_0x193223);}(_0x93dd,0x1bb));var _0xd93d=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0x93dd[_0x4ff09b];return _0x3f5c2e;};'use strict';var _=require(_0xd93d('0x0'));var util=require('util');var logger=require(_0xd93d('0x1'))(_0xd93d('0x2'));var moment=require(_0xd93d('0x3'));var BPromise=require(_0xd93d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd93d('0x5'));var rimraf=require(_0xd93d('0x6'));var config=require(_0xd93d('0x7'));var attributes=require(_0xd93d('0x8'));module[_0xd93d('0x9')]=function(_0x570b5c,_0x5dfdd5){return _0x570b5c[_0xd93d('0xa')]('WhatsappQueueReport',attributes,{'tableName':_0xd93d('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xd93d('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1cc4=['bluebird','request-promise','path','rimraf','../../config/environment','./whatsappQueueReport.attributes','exports','report_whatsapp_queue','util','../../config/logger','api'];(function(_0x7ad661,_0x1e4efa){var _0x363e14=function(_0x507439){while(--_0x507439){_0x7ad661['push'](_0x7ad661['shift']());}};_0x363e14(++_0x1e4efa);}(_0x1cc4,0x110));var _0x41cc=function(_0x33314d,_0x499628){_0x33314d=_0x33314d-0x0;var _0x4ffe8e=_0x1cc4[_0x33314d];return _0x4ffe8e;};'use strict';var _=require('lodash');var util=require(_0x41cc('0x0'));var logger=require(_0x41cc('0x1'))(_0x41cc('0x2'));var moment=require('moment');var BPromise=require(_0x41cc('0x3'));var rp=require(_0x41cc('0x4'));var fs=require('fs');var path=require(_0x41cc('0x5'));var rimraf=require(_0x41cc('0x6'));var config=require(_0x41cc('0x7'));var attributes=require(_0x41cc('0x8'));module[_0x41cc('0x9')]=function(_0x4c1a1d,_0x372fe8){return _0x4c1a1d['define']('WhatsappQueueReport',attributes,{'tableName':_0x41cc('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 4ba9238..7401556 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 _0x402d=['client','http','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','debug','stringify','catch','raw','where','attributes','UpdateWhatsappQueueReport','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x58c20f,_0x4cdb1b){var _0x3b0318=function(_0x36fa84){while(--_0x36fa84){_0x58c20f['push'](_0x58c20f['shift']());}};_0x3b0318(++_0x4cdb1b);}(_0x402d,0x176));var _0xd402=function(_0x2f81bb,_0x50842e){_0x2f81bb=_0x2f81bb-0x0;var _0x4b6da8=_0x402d[_0x2f81bb];return _0x4b6da8;};'use strict';var _=require(_0xd402('0x0'));var util=require(_0xd402('0x1'));var moment=require(_0xd402('0x2'));var BPromise=require('bluebird');var rs=require(_0xd402('0x3'));var fs=require('fs');var Redis=require(_0xd402('0x4'));var db=require(_0xd402('0x5'))['db'];var utils=require(_0xd402('0x6'));var logger=require(_0xd402('0x7'))(_0xd402('0x8'));var config=require(_0xd402('0x9'));var jayson=require(_0xd402('0xa'));var client=jayson[_0xd402('0xb')][_0xd402('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3447a8,_0x25dd7c,_0x2fa6f8){return new BPromise(function(_0x88d0a2,_0xed28a6){return client[_0xd402('0xd')](_0x3447a8,_0x2fa6f8)[_0xd402('0xe')](function(_0x4242a4){logger[_0xd402('0xf')](_0xd402('0x10'),_0x25dd7c,_0xd402('0x11'));logger['debug'](_0xd402('0x12'),_0x25dd7c,'request\x20sent',JSON['stringify'](_0x4242a4));if(_0x4242a4[_0xd402('0x13')]){if(_0x4242a4[_0xd402('0x13')][_0xd402('0x14')]===0x1f4){logger['error'](_0xd402('0x10'),_0x25dd7c,_0x4242a4[_0xd402('0x13')]['message']);return _0xed28a6(_0x4242a4[_0xd402('0x13')][_0xd402('0x15')]);}logger[_0xd402('0x13')](_0xd402('0x10'),_0x25dd7c,_0x4242a4[_0xd402('0x13')][_0xd402('0x15')]);return _0x88d0a2(_0x4242a4[_0xd402('0x13')]['message']);}else{logger['info'](_0xd402('0x10'),_0x25dd7c,_0xd402('0x11'));_0x88d0a2(_0x4242a4[_0xd402('0x16')]['message']);}})['catch'](function(_0xd6a074){logger[_0xd402('0x13')](_0xd402('0x10'),_0x25dd7c,_0xd6a074);_0xed28a6(_0xd6a074);});});}exports[_0xd402('0x17')]=function(_0x1972df){var _0x4d8400=this;return new Promise(function(_0xf94871,_0x20c5be){return db[_0xd402('0x18')][_0xd402('0x19')](_0x1972df[_0xd402('0x1a')],{'raw':_0x1972df['options']?_0x1972df[_0xd402('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0xd402('0xe')](function(_0x39c514){logger[_0xd402('0xf')]('CreateWhatsappQueueReport',_0x1972df);logger[_0xd402('0x1c')](_0xd402('0x17'),_0x1972df,JSON[_0xd402('0x1d')](_0x39c514));_0xf94871(_0x39c514);})[_0xd402('0x1e')](function(_0x5cd872){logger[_0xd402('0x13')]('CreateWhatsappQueueReport',_0x5cd872[_0xd402('0x15')],_0x1972df);_0x20c5be(_0x4d8400[_0xd402('0x13')](0x1f4,_0x5cd872['message']));});});};exports['UpdateWhatsappQueueReport']=function(_0x150157){var _0x4ca2be=this;return new Promise(function(_0x4ef093,_0x56c11f){return db[_0xd402('0x18')]['update'](_0x150157[_0xd402('0x1a')],{'raw':_0x150157['options']?_0x150157['options'][_0xd402('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x150157[_0xd402('0x1b')]?_0x150157[_0xd402('0x1b')][_0xd402('0x20')]||null:null,'attributes':_0x150157[_0xd402('0x1b')]?_0x150157[_0xd402('0x1b')][_0xd402('0x21')]||null:null,'limit':_0x150157[_0xd402('0x1b')]?_0x150157['options']['limit']||null:null})['then'](function(_0x2b7d30){logger['info']('UpdateWhatsappQueueReport',_0x150157);logger[_0xd402('0x1c')](_0xd402('0x22'),_0x150157,JSON['stringify'](_0x2b7d30));_0x4ef093(_0x2b7d30);})[_0xd402('0x1e')](function(_0x2eb64d){logger['error'](_0xd402('0x22'),_0x2eb64d[_0xd402('0x15')],_0x150157);_0x56c11f(_0x4ca2be['error'](0x1f4,_0x2eb64d[_0xd402('0x15')]));});});}; \ No newline at end of file +var _0xa634=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateWhatsappQueueReport','create','body','options','raw','UpdateWhatsappQueueReport','WhatsappQueueReport','where','attributes','limit','lodash','util','moment','bluebird'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xa634,0xb0));var _0x4a63=function(_0x68cade,_0x208b4b){_0x68cade=_0x68cade-0x0;var _0x241489=_0xa634[_0x68cade];return _0x241489;};'use strict';var _=require(_0x4a63('0x0'));var util=require(_0x4a63('0x1'));var moment=require(_0x4a63('0x2'));var BPromise=require(_0x4a63('0x3'));var rs=require(_0x4a63('0x4'));var fs=require('fs');var Redis=require(_0x4a63('0x5'));var db=require(_0x4a63('0x6'))['db'];var utils=require(_0x4a63('0x7'));var logger=require(_0x4a63('0x8'))(_0x4a63('0x9'));var config=require(_0x4a63('0xa'));var jayson=require(_0x4a63('0xb'));var client=jayson['client'][_0x4a63('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xda6229,_0x3a145d,_0x33b51e){return new BPromise(function(_0x14f430,_0x37c997){return client[_0x4a63('0xd')](_0xda6229,_0x33b51e)[_0x4a63('0xe')](function(_0x4c503a){logger[_0x4a63('0xf')](_0x4a63('0x10'),_0x3a145d,'request\x20sent');logger[_0x4a63('0x11')](_0x4a63('0x12'),_0x3a145d,_0x4a63('0x13'),JSON[_0x4a63('0x14')](_0x4c503a));if(_0x4c503a[_0x4a63('0x15')]){if(_0x4c503a[_0x4a63('0x15')][_0x4a63('0x16')]===0x1f4){logger[_0x4a63('0x15')](_0x4a63('0x10'),_0x3a145d,_0x4c503a[_0x4a63('0x15')][_0x4a63('0x17')]);return _0x37c997(_0x4c503a[_0x4a63('0x15')]['message']);}logger['error'](_0x4a63('0x10'),_0x3a145d,_0x4c503a[_0x4a63('0x15')][_0x4a63('0x17')]);return _0x14f430(_0x4c503a[_0x4a63('0x15')]['message']);}else{logger['info'](_0x4a63('0x10'),_0x3a145d,_0x4a63('0x13'));_0x14f430(_0x4c503a[_0x4a63('0x18')]['message']);}})[_0x4a63('0x19')](function(_0x16ee6d){logger[_0x4a63('0x15')]('WhatsappQueueReport,\x20%s,\x20%s',_0x3a145d,_0x16ee6d);_0x37c997(_0x16ee6d);});});}exports[_0x4a63('0x1a')]=function(_0x1ae314){var _0x4babed=this;return new Promise(function(_0x1c2015,_0x12a9dc){return db['WhatsappQueueReport'][_0x4a63('0x1b')](_0x1ae314[_0x4a63('0x1c')],{'raw':_0x1ae314[_0x4a63('0x1d')]?_0x1ae314['options'][_0x4a63('0x1e')]===undefined?!![]:![]:!![]})[_0x4a63('0xe')](function(_0x26ab2f){logger['info'](_0x4a63('0x1a'),_0x1ae314);logger[_0x4a63('0x11')]('CreateWhatsappQueueReport',_0x1ae314,JSON[_0x4a63('0x14')](_0x26ab2f));_0x1c2015(_0x26ab2f);})[_0x4a63('0x19')](function(_0x335827){logger[_0x4a63('0x15')](_0x4a63('0x1a'),_0x335827['message'],_0x1ae314);_0x12a9dc(_0x4babed[_0x4a63('0x15')](0x1f4,_0x335827[_0x4a63('0x17')]));});});};exports[_0x4a63('0x1f')]=function(_0x24df26){var _0x17de87=this;return new Promise(function(_0x41735c,_0x2ac60a){return db[_0x4a63('0x20')]['update'](_0x24df26['body'],{'raw':_0x24df26[_0x4a63('0x1d')]?_0x24df26[_0x4a63('0x1d')][_0x4a63('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x24df26['options']?_0x24df26[_0x4a63('0x1d')][_0x4a63('0x21')]||null:null,'attributes':_0x24df26['options']?_0x24df26[_0x4a63('0x1d')][_0x4a63('0x22')]||null:null,'limit':_0x24df26[_0x4a63('0x1d')]?_0x24df26[_0x4a63('0x1d')][_0x4a63('0x23')]||null:null})[_0x4a63('0xe')](function(_0x27b734){logger[_0x4a63('0xf')]('UpdateWhatsappQueueReport',_0x24df26);logger[_0x4a63('0x11')]('UpdateWhatsappQueueReport',_0x24df26,JSON['stringify'](_0x27b734));_0x41735c(_0x27b734);})[_0x4a63('0x19')](function(_0x48dd28){logger[_0x4a63('0x15')](_0x4a63('0x1f'),_0x48dd28[_0x4a63('0x17')],_0x24df26);_0x2ac60a(_0x17de87[_0x4a63('0x15')](0x1f4,_0x48dd28['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index f00164c..1a0809b 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 _0x8aea=['post','create','put','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id'];(function(_0x1b1209,_0x1d6c27){var _0x5e0d57=function(_0x1b67eb){while(--_0x1b67eb){_0x1b1209['push'](_0x1b1209['shift']());}};_0x5e0d57(++_0x1d6c27);}(_0x8aea,0x71));var _0xa8ae=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8aea[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xa8ae('0x0'));var util=require(_0xa8ae('0x1'));var path=require(_0xa8ae('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa8ae('0x3')]();var fs_extra=require(_0xa8ae('0x4'));var auth=require(_0xa8ae('0x5'));var interaction=require(_0xa8ae('0x6'));var config=require(_0xa8ae('0x7'));var controller=require('./whatsappTransferReport.controller');router[_0xa8ae('0x8')]('/',auth[_0xa8ae('0x9')](),controller[_0xa8ae('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xa8ae('0xb')]);router[_0xa8ae('0x8')](_0xa8ae('0xc'),auth[_0xa8ae('0x9')](),controller['show']);router[_0xa8ae('0xd')]('/',auth[_0xa8ae('0x9')](),controller[_0xa8ae('0xe')]);router[_0xa8ae('0xf')]('/:id',auth[_0xa8ae('0x9')](),controller['update']);router['delete'](_0xa8ae('0xc'),auth[_0xa8ae('0x9')](),controller[_0xa8ae('0x10')]);module[_0xa8ae('0x11')]=router; \ No newline at end of file +var _0x796f=['../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x796f,0xcc));var _0xf796=function(_0x422821,_0x457f27){_0x422821=_0x422821-0x0;var _0x5c3e3f=_0x796f[_0x422821];return _0x5c3e3f;};'use strict';var multer=require(_0xf796('0x0'));var util=require('util');var path=require(_0xf796('0x1'));var timeout=require(_0xf796('0x2'));var express=require(_0xf796('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf796('0x4'));var interaction=require(_0xf796('0x5'));var config=require(_0xf796('0x6'));var controller=require(_0xf796('0x7'));router['get']('/',auth[_0xf796('0x8')](),controller[_0xf796('0x9')]);router[_0xf796('0xa')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xf796('0xa')](_0xf796('0xb'),auth[_0xf796('0x8')](),controller[_0xf796('0xc')]);router[_0xf796('0xd')]('/',auth[_0xf796('0x8')](),controller[_0xf796('0xe')]);router[_0xf796('0xf')](_0xf796('0xb'),auth['isAuthenticated'](),controller[_0xf796('0x10')]);router[_0xf796('0x11')](_0xf796('0xb'),auth[_0xf796('0x8')](),controller['destroy']);module[_0xf796('0x12')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 9681c53..138862d 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 _0xd290=['queue','DATE','sequelize','exports','ENUM'];(function(_0x9fcf19,_0x51cb0b){var _0x4d11d0=function(_0x50fed4){while(--_0x50fed4){_0x9fcf19['push'](_0x9fcf19['shift']());}};_0x4d11d0(++_0x51cb0b);}(_0xd290,0x165));var _0x0d29=function(_0x195a9d,_0x1c3fa1){_0x195a9d=_0x195a9d-0x0;var _0x287ca6=_0xd290[_0x195a9d];return _0x287ca6;};'use strict';var Sequelize=require(_0x0d29('0x0'));module[_0x0d29('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x0d29('0x2')]('account','agent',_0x0d29('0x3')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x0d29('0x4')]}}; \ No newline at end of file +var _0x15f9=['exports','STRING','ENUM','account','agent','queue','DATE','sequelize'];(function(_0x4a7ca8,_0x3fd17a){var _0x4ce6e7=function(_0xd86c05){while(--_0xd86c05){_0x4a7ca8['push'](_0x4a7ca8['shift']());}};_0x4ce6e7(++_0x3fd17a);}(_0x15f9,0xf7));var _0x915f=function(_0x43405f,_0x542f04){_0x43405f=_0x43405f-0x0;var _0x1876e6=_0x15f9[_0x43405f];return _0x1876e6;};'use strict';var Sequelize=require(_0x915f('0x0'));module[_0x915f('0x1')]={'uniqueid':{'type':Sequelize[_0x915f('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x915f('0x3')](_0x915f('0x4'),_0x915f('0x5'),_0x915f('0x6')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x915f('0x7')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index 66b1126..de972d2 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 _0xd397=['limit','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','count','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','map','WhatsappTransferReport','rawAttributes','fieldName','type','key','query','filters','attributes','intersection','model','fields','length','hasOwnProperty'];(function(_0x216ce9,_0x3bdfc1){var _0x174623=function(_0x360f95){while(--_0x360f95){_0x216ce9['push'](_0x216ce9['shift']());}};_0x174623(++_0x3bdfc1);}(_0xd397,0xae));var _0x7d39=function(_0x4efaf7,_0x2d330a){_0x4efaf7=_0x4efaf7-0x0;var _0x3c6f04=_0xd397[_0x4efaf7];return _0x3c6f04;};'use strict';var emlformat=require(_0x7d39('0x0'));var rimraf=require(_0x7d39('0x1'));var zipdir=require(_0x7d39('0x2'));var jsonpatch=require(_0x7d39('0x3'));var rp=require(_0x7d39('0x4'));var moment=require(_0x7d39('0x5'));var BPromise=require(_0x7d39('0x6'));var Mustache=require('mustache');var util=require(_0x7d39('0x7'));var path=require(_0x7d39('0x8'));var sox=require(_0x7d39('0x9'));var csv=require(_0x7d39('0xa'));var ejs=require(_0x7d39('0xb'));var fs=require('fs');var fs_extra=require(_0x7d39('0xc'));var _=require(_0x7d39('0xd'));var squel=require(_0x7d39('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7d39('0xf'));var toCsv=require(_0x7d39('0xa'));var querystring=require(_0x7d39('0x10'));var Papa=require(_0x7d39('0x11'));var Redis=require(_0x7d39('0x12'));var authService=require(_0x7d39('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7d39('0x14'));var hardwareService=require(_0x7d39('0x15'));var logger=require('../../config/logger')(_0x7d39('0x16'));var utils=require(_0x7d39('0x17'));var config=require(_0x7d39('0x18'));var licenseUtil=require(_0x7d39('0x19'));var db=require(_0x7d39('0x1a'))['db'];function respondWithStatusCode(_0x42089e,_0xcd2ddf){_0xcd2ddf=_0xcd2ddf||0xcc;return function(_0xf0749d){if(_0xf0749d){return _0x42089e[_0x7d39('0x1b')](_0xcd2ddf);}return _0x42089e[_0x7d39('0x1c')](_0xcd2ddf)[_0x7d39('0x1d')]();};}function respondWithResult(_0x1ba897,_0x2184cc){_0x2184cc=_0x2184cc||0xc8;return function(_0x52791e){if(_0x52791e){return _0x1ba897[_0x7d39('0x1c')](_0x2184cc)[_0x7d39('0x1e')](_0x52791e);}};}function respondWithFilteredResult(_0x19976a,_0x333587){return function(_0x488961){if(_0x488961){var _0x306dd0=typeof _0x333587[_0x7d39('0x1f')]==='undefined'&&typeof _0x333587['limit']==='undefined';var _0x19bfde=_0x488961[_0x7d39('0x20')];var _0x233a31=_0x306dd0?0x0:_0x333587['offset'];var _0x2daae9=_0x306dd0?_0x488961[_0x7d39('0x20')]:_0x333587[_0x7d39('0x1f')]+_0x333587['limit'];var _0x3a4e60;if(_0x2daae9>=_0x19bfde){_0x2daae9=_0x19bfde;_0x3a4e60=0xc8;}else{_0x3a4e60=0xce;}_0x19976a[_0x7d39('0x1c')](_0x3a4e60);return _0x19976a['set'](_0x7d39('0x21'),_0x233a31+'-'+_0x2daae9+'/'+_0x19bfde)['json'](_0x488961);}return null;};}function patchUpdates(_0x1e2c78){return function(_0xed6218){try{jsonpatch[_0x7d39('0x22')](_0xed6218,_0x1e2c78,!![]);}catch(_0x3677f1){return BPromise[_0x7d39('0x23')](_0x3677f1);}return _0xed6218[_0x7d39('0x24')]();};}function saveUpdates(_0x30a599,_0x1ff196){return function(_0x2dc5c5){if(_0x2dc5c5){return _0x2dc5c5[_0x7d39('0x25')](_0x30a599)[_0x7d39('0x26')](function(_0x2a4b9f){return _0x2a4b9f;});}return null;};}function removeEntity(_0x1c32d2,_0x4c2252){return function(_0x26c22b){if(_0x26c22b){return _0x26c22b[_0x7d39('0x27')]()['then'](function(){_0x1c32d2[_0x7d39('0x1c')](0xcc)[_0x7d39('0x1d')]();});}};}function handleEntityNotFound(_0x20c7c8,_0x1fbcc2){return function(_0x291721){if(!_0x291721){_0x20c7c8[_0x7d39('0x1b')](0x194);}return _0x291721;};}function handleError(_0x580fd7,_0x355419){_0x355419=_0x355419||0x1f4;return function(_0x78749e){logger['error'](_0x78749e[_0x7d39('0x28')]);if(_0x78749e[_0x7d39('0x29')]){delete _0x78749e[_0x7d39('0x29')];}_0x580fd7[_0x7d39('0x1c')](_0x355419)['send'](_0x78749e);};}exports[_0x7d39('0x2a')]=function(_0x157bdf,_0x25cc48){var _0x4c59d9={},_0x3158b0={},_0x5633d1={'count':0x0,'rows':[]};var _0x187ba1=_[_0x7d39('0x2b')](db[_0x7d39('0x2c')][_0x7d39('0x2d')],function(_0x5d00cb){return{'name':_0x5d00cb[_0x7d39('0x2e')],'type':_0x5d00cb[_0x7d39('0x2f')][_0x7d39('0x30')]};});_0x3158b0['model']=_[_0x7d39('0x2b')](_0x187ba1,_0x7d39('0x29'));_0x3158b0[_0x7d39('0x31')]=_['keys'](_0x157bdf['query']);_0x3158b0[_0x7d39('0x32')]=_['intersection'](_0x3158b0['model'],_0x3158b0['query']);_0x4c59d9[_0x7d39('0x33')]=_[_0x7d39('0x34')](_0x3158b0[_0x7d39('0x35')],qs[_0x7d39('0x36')](_0x157bdf[_0x7d39('0x31')][_0x7d39('0x36')]));_0x4c59d9[_0x7d39('0x33')]=_0x4c59d9[_0x7d39('0x33')][_0x7d39('0x37')]?_0x4c59d9[_0x7d39('0x33')]:_0x3158b0[_0x7d39('0x35')];if(!_0x157bdf[_0x7d39('0x31')][_0x7d39('0x38')]('nolimit')){_0x4c59d9[_0x7d39('0x39')]=qs[_0x7d39('0x39')](_0x157bdf['query'][_0x7d39('0x39')]);_0x4c59d9[_0x7d39('0x1f')]=qs['offset'](_0x157bdf[_0x7d39('0x31')][_0x7d39('0x1f')]);}_0x4c59d9[_0x7d39('0x3a')]=qs['sort'](_0x157bdf[_0x7d39('0x31')][_0x7d39('0x3b')]);_0x4c59d9[_0x7d39('0x3c')]=qs[_0x7d39('0x32')](_['pick'](_0x157bdf[_0x7d39('0x31')],_0x3158b0['filters']),_0x187ba1);if(_0x157bdf[_0x7d39('0x31')][_0x7d39('0x3d')]){_0x4c59d9[_0x7d39('0x3c')]=_[_0x7d39('0x3e')](_0x4c59d9['where'],{'$or':_[_0x7d39('0x2b')](_0x187ba1,function(_0x583e17){if(_0x583e17[_0x7d39('0x2f')]!==_0x7d39('0x3f')){var _0x45d169={};_0x45d169[_0x583e17[_0x7d39('0x29')]]={'$like':'%'+_0x157bdf[_0x7d39('0x31')]['filter']+'%'};return _0x45d169;}})});}_0x4c59d9=_['merge']({},_0x4c59d9,_0x157bdf[_0x7d39('0x40')]);var _0x1ae8d4={'where':_0x4c59d9[_0x7d39('0x3c')]};return db[_0x7d39('0x2c')]['count'](_0x1ae8d4)['then'](function(_0x140ffa){_0x5633d1[_0x7d39('0x20')]=_0x140ffa;if(_0x157bdf['query']['includeAll']){_0x4c59d9[_0x7d39('0x41')]=[{'all':!![]}];}return db[_0x7d39('0x2c')][_0x7d39('0x42')](_0x4c59d9);})['then'](function(_0x7be012){_0x5633d1[_0x7d39('0x43')]=_0x7be012;return _0x5633d1;})[_0x7d39('0x26')](respondWithFilteredResult(_0x25cc48,_0x4c59d9))[_0x7d39('0x44')](handleError(_0x25cc48,null));};exports[_0x7d39('0x45')]=function(_0x1aab19,_0xf675c4){var _0x59b7a1={'raw':!![],'where':{'id':_0x1aab19[_0x7d39('0x46')]['id']}},_0x4ee8c4={};_0x4ee8c4[_0x7d39('0x35')]=_[_0x7d39('0x47')](db[_0x7d39('0x2c')][_0x7d39('0x2d')]);_0x4ee8c4['query']=_[_0x7d39('0x47')](_0x1aab19['query']);_0x4ee8c4[_0x7d39('0x32')]=_['intersection'](_0x4ee8c4[_0x7d39('0x35')],_0x4ee8c4[_0x7d39('0x31')]);_0x59b7a1['attributes']=_[_0x7d39('0x34')](_0x4ee8c4[_0x7d39('0x35')],qs[_0x7d39('0x36')](_0x1aab19[_0x7d39('0x31')][_0x7d39('0x36')]));_0x59b7a1['attributes']=_0x59b7a1[_0x7d39('0x33')][_0x7d39('0x37')]?_0x59b7a1[_0x7d39('0x33')]:_0x4ee8c4[_0x7d39('0x35')];if(_0x1aab19[_0x7d39('0x31')][_0x7d39('0x48')]){_0x59b7a1['include']=[{'all':!![]}];}_0x59b7a1=_['merge']({},_0x59b7a1,_0x1aab19[_0x7d39('0x40')]);return db[_0x7d39('0x2c')][_0x7d39('0x49')](_0x59b7a1)[_0x7d39('0x26')](handleEntityNotFound(_0xf675c4,null))[_0x7d39('0x26')](respondWithResult(_0xf675c4,null))[_0x7d39('0x44')](handleError(_0xf675c4,null));};exports[_0x7d39('0x4a')]=function(_0x317d77,_0x4787cb){return db[_0x7d39('0x2c')][_0x7d39('0x4a')](_0x317d77[_0x7d39('0x4b')],{})[_0x7d39('0x26')](respondWithResult(_0x4787cb,0xc9))[_0x7d39('0x44')](handleError(_0x4787cb,null));};exports[_0x7d39('0x25')]=function(_0x1e362b,_0xb60d96){if(_0x1e362b['body']['id']){delete _0x1e362b['body']['id'];}return db[_0x7d39('0x2c')]['find']({'where':{'id':_0x1e362b[_0x7d39('0x46')]['id']}})['then'](handleEntityNotFound(_0xb60d96,null))[_0x7d39('0x26')](saveUpdates(_0x1e362b[_0x7d39('0x4b')],null))[_0x7d39('0x26')](respondWithResult(_0xb60d96,null))[_0x7d39('0x44')](handleError(_0xb60d96,null));};exports[_0x7d39('0x27')]=function(_0x44a04f,_0x22be5d){return db['WhatsappTransferReport'][_0x7d39('0x49')]({'where':{'id':_0x44a04f['params']['id']}})[_0x7d39('0x26')](handleEntityNotFound(_0x22be5d,null))[_0x7d39('0x26')](removeEntity(_0x22be5d,null))[_0x7d39('0x44')](handleError(_0x22be5d,null));};exports[_0x7d39('0x4c')]=function(_0x14de38,_0x30af70){return db['WhatsappTransferReport'][_0x7d39('0x4c')]()[_0x7d39('0x26')](respondWithResult(_0x30af70,null))[_0x7d39('0x44')](handleError(_0x30af70,null));}; \ No newline at end of file +var _0x0381=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','error','stack','name','send','index','WhatsappTransferReport','rawAttributes','fieldName','type','key','map','query','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','options','then','includeAll','rows','catch','show','keys','find','create','body','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x2fee1d,_0x5bf7e7){var _0x4eee2e=function(_0x56b551){while(--_0x56b551){_0x2fee1d['push'](_0x2fee1d['shift']());}};_0x4eee2e(++_0x5bf7e7);}(_0x0381,0x1c7));var _0x1038=function(_0x14d17d,_0x56493b){_0x14d17d=_0x14d17d-0x0;var _0x388bb6=_0x0381[_0x14d17d];return _0x388bb6;};'use strict';var emlformat=require(_0x1038('0x0'));var rimraf=require(_0x1038('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1038('0x2'));var rp=require(_0x1038('0x3'));var moment=require(_0x1038('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1038('0x5'));var util=require(_0x1038('0x6'));var path=require(_0x1038('0x7'));var sox=require(_0x1038('0x8'));var csv=require(_0x1038('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1038('0xa'));var _=require(_0x1038('0xb'));var squel=require(_0x1038('0xc'));var crypto=require(_0x1038('0xd'));var jsforce=require(_0x1038('0xe'));var deskjs=require(_0x1038('0xf'));var toCsv=require('to-csv');var querystring=require(_0x1038('0x10'));var Papa=require(_0x1038('0x11'));var Redis=require(_0x1038('0x12'));var authService=require(_0x1038('0x13'));var qs=require(_0x1038('0x14'));var as=require(_0x1038('0x15'));var hardwareService=require(_0x1038('0x16'));var logger=require(_0x1038('0x17'))(_0x1038('0x18'));var utils=require(_0x1038('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x1038('0x1a'));var db=require(_0x1038('0x1b'))['db'];function respondWithStatusCode(_0x189c6c,_0x422f4f){_0x422f4f=_0x422f4f||0xcc;return function(_0x484251){if(_0x484251){return _0x189c6c[_0x1038('0x1c')](_0x422f4f);}return _0x189c6c['status'](_0x422f4f)[_0x1038('0x1d')]();};}function respondWithResult(_0x31775a,_0x2be9fc){_0x2be9fc=_0x2be9fc||0xc8;return function(_0x3a7038){if(_0x3a7038){return _0x31775a[_0x1038('0x1e')](_0x2be9fc)['json'](_0x3a7038);}};}function respondWithFilteredResult(_0x240a05,_0x150d20){return function(_0x7b67){if(_0x7b67){var _0x589486=typeof _0x150d20[_0x1038('0x1f')]===_0x1038('0x20')&&typeof _0x150d20['limit']==='undefined';var _0x13bda1=_0x7b67[_0x1038('0x21')];var _0x4a0e28=_0x589486?0x0:_0x150d20['offset'];var _0x300295=_0x589486?_0x7b67['count']:_0x150d20['offset']+_0x150d20[_0x1038('0x22')];var _0x2f918f;if(_0x300295>=_0x13bda1){_0x300295=_0x13bda1;_0x2f918f=0xc8;}else{_0x2f918f=0xce;}_0x240a05[_0x1038('0x1e')](_0x2f918f);return _0x240a05[_0x1038('0x23')](_0x1038('0x24'),_0x4a0e28+'-'+_0x300295+'/'+_0x13bda1)[_0x1038('0x25')](_0x7b67);}return null;};}function patchUpdates(_0x5dbd2f){return function(_0x4faeae){try{jsonpatch[_0x1038('0x26')](_0x4faeae,_0x5dbd2f,!![]);}catch(_0x2102a9){return BPromise[_0x1038('0x27')](_0x2102a9);}return _0x4faeae[_0x1038('0x28')]();};}function saveUpdates(_0x43c0ec,_0x43b148){return function(_0x556182){if(_0x556182){return _0x556182[_0x1038('0x29')](_0x43c0ec)['then'](function(_0x1910af){return _0x1910af;});}return null;};}function removeEntity(_0x4d5497,_0x1b8476){return function(_0x4ff769){if(_0x4ff769){return _0x4ff769['destroy']()['then'](function(){_0x4d5497['status'](0xcc)[_0x1038('0x1d')]();});}};}function handleEntityNotFound(_0x18ccaa,_0x3ea244){return function(_0x250292){if(!_0x250292){_0x18ccaa[_0x1038('0x1c')](0x194);}return _0x250292;};}function handleError(_0x4587af,_0x49e3fb){_0x49e3fb=_0x49e3fb||0x1f4;return function(_0x3b9d6a){logger[_0x1038('0x2a')](_0x3b9d6a[_0x1038('0x2b')]);if(_0x3b9d6a[_0x1038('0x2c')]){delete _0x3b9d6a[_0x1038('0x2c')];}_0x4587af[_0x1038('0x1e')](_0x49e3fb)[_0x1038('0x2d')](_0x3b9d6a);};}exports[_0x1038('0x2e')]=function(_0x383bc2,_0x5233da){var _0x6bb9d4={},_0x5080e8={},_0xdf8f80={'count':0x0,'rows':[]};var _0x121ffa=_['map'](db[_0x1038('0x2f')][_0x1038('0x30')],function(_0x317fb6){return{'name':_0x317fb6[_0x1038('0x31')],'type':_0x317fb6[_0x1038('0x32')][_0x1038('0x33')]};});_0x5080e8['model']=_[_0x1038('0x34')](_0x121ffa,_0x1038('0x2c'));_0x5080e8['query']=_['keys'](_0x383bc2[_0x1038('0x35')]);_0x5080e8['filters']=_[_0x1038('0x36')](_0x5080e8['model'],_0x5080e8[_0x1038('0x35')]);_0x6bb9d4[_0x1038('0x37')]=_['intersection'](_0x5080e8[_0x1038('0x38')],qs[_0x1038('0x39')](_0x383bc2[_0x1038('0x35')][_0x1038('0x39')]));_0x6bb9d4[_0x1038('0x37')]=_0x6bb9d4[_0x1038('0x37')][_0x1038('0x3a')]?_0x6bb9d4[_0x1038('0x37')]:_0x5080e8[_0x1038('0x38')];if(!_0x383bc2[_0x1038('0x35')][_0x1038('0x3b')](_0x1038('0x3c'))){_0x6bb9d4['limit']=qs[_0x1038('0x22')](_0x383bc2[_0x1038('0x35')]['limit']);_0x6bb9d4[_0x1038('0x1f')]=qs['offset'](_0x383bc2[_0x1038('0x35')][_0x1038('0x1f')]);}_0x6bb9d4['order']=qs['sort'](_0x383bc2[_0x1038('0x35')][_0x1038('0x3d')]);_0x6bb9d4[_0x1038('0x3e')]=qs[_0x1038('0x3f')](_[_0x1038('0x40')](_0x383bc2[_0x1038('0x35')],_0x5080e8[_0x1038('0x3f')]),_0x121ffa);if(_0x383bc2[_0x1038('0x35')][_0x1038('0x41')]){_0x6bb9d4['where']=_[_0x1038('0x42')](_0x6bb9d4[_0x1038('0x3e')],{'$or':_[_0x1038('0x34')](_0x121ffa,function(_0x43eb39){if(_0x43eb39[_0x1038('0x32')]!=='VIRTUAL'){var _0x5b7965={};_0x5b7965[_0x43eb39['name']]={'$like':'%'+_0x383bc2['query'][_0x1038('0x41')]+'%'};return _0x5b7965;}})});}_0x6bb9d4=_['merge']({},_0x6bb9d4,_0x383bc2[_0x1038('0x43')]);var _0x2191a1={'where':_0x6bb9d4[_0x1038('0x3e')]};return db[_0x1038('0x2f')]['count'](_0x2191a1)[_0x1038('0x44')](function(_0x6a6e82){_0xdf8f80['count']=_0x6a6e82;if(_0x383bc2[_0x1038('0x35')][_0x1038('0x45')]){_0x6bb9d4['include']=[{'all':!![]}];}return db[_0x1038('0x2f')]['findAll'](_0x6bb9d4);})[_0x1038('0x44')](function(_0x2c7613){_0xdf8f80[_0x1038('0x46')]=_0x2c7613;return _0xdf8f80;})[_0x1038('0x44')](respondWithFilteredResult(_0x5233da,_0x6bb9d4))[_0x1038('0x47')](handleError(_0x5233da,null));};exports[_0x1038('0x48')]=function(_0x2ecbf4,_0x28b1e0){var _0x28cb22={'raw':!![],'where':{'id':_0x2ecbf4['params']['id']}},_0x35d12b={};_0x35d12b['model']=_[_0x1038('0x49')](db[_0x1038('0x2f')]['rawAttributes']);_0x35d12b[_0x1038('0x35')]=_[_0x1038('0x49')](_0x2ecbf4[_0x1038('0x35')]);_0x35d12b[_0x1038('0x3f')]=_['intersection'](_0x35d12b['model'],_0x35d12b[_0x1038('0x35')]);_0x28cb22[_0x1038('0x37')]=_['intersection'](_0x35d12b[_0x1038('0x38')],qs[_0x1038('0x39')](_0x2ecbf4['query'][_0x1038('0x39')]));_0x28cb22[_0x1038('0x37')]=_0x28cb22[_0x1038('0x37')][_0x1038('0x3a')]?_0x28cb22[_0x1038('0x37')]:_0x35d12b[_0x1038('0x38')];if(_0x2ecbf4[_0x1038('0x35')][_0x1038('0x45')]){_0x28cb22['include']=[{'all':!![]}];}_0x28cb22=_[_0x1038('0x42')]({},_0x28cb22,_0x2ecbf4[_0x1038('0x43')]);return db[_0x1038('0x2f')][_0x1038('0x4a')](_0x28cb22)['then'](handleEntityNotFound(_0x28b1e0,null))[_0x1038('0x44')](respondWithResult(_0x28b1e0,null))['catch'](handleError(_0x28b1e0,null));};exports[_0x1038('0x4b')]=function(_0x4928b7,_0x1ba08e){return db[_0x1038('0x2f')]['create'](_0x4928b7[_0x1038('0x4c')],{})[_0x1038('0x44')](respondWithResult(_0x1ba08e,0xc9))[_0x1038('0x47')](handleError(_0x1ba08e,null));};exports[_0x1038('0x29')]=function(_0x58d462,_0x3a0012){if(_0x58d462[_0x1038('0x4c')]['id']){delete _0x58d462['body']['id'];}return db[_0x1038('0x2f')][_0x1038('0x4a')]({'where':{'id':_0x58d462['params']['id']}})['then'](handleEntityNotFound(_0x3a0012,null))[_0x1038('0x44')](saveUpdates(_0x58d462[_0x1038('0x4c')],null))['then'](respondWithResult(_0x3a0012,null))[_0x1038('0x47')](handleError(_0x3a0012,null));};exports['destroy']=function(_0x55ffc8,_0x2d56a1){return db[_0x1038('0x2f')][_0x1038('0x4a')]({'where':{'id':_0x55ffc8[_0x1038('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2d56a1,null))[_0x1038('0x44')](removeEntity(_0x2d56a1,null))[_0x1038('0x47')](handleError(_0x2d56a1,null));};exports[_0x1038('0x4e')]=function(_0x3edc64,_0x347988){return db[_0x1038('0x2f')][_0x1038('0x4e')]()[_0x1038('0x44')](respondWithResult(_0x347988,null))[_0x1038('0x47')](handleError(_0x347988,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 211b46d..35e1e66 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 _0x15d0=['WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util','api','request-promise','../../config/environment','exports'];(function(_0x23308a,_0x305b19){var _0x5ed67a=function(_0x2d6b03){while(--_0x2d6b03){_0x23308a['push'](_0x23308a['shift']());}};_0x5ed67a(++_0x305b19);}(_0x15d0,0x111));var _0x015d=function(_0x3f6abd,_0x3bcded){_0x3f6abd=_0x3f6abd-0x0;var _0x1b1419=_0x15d0[_0x3f6abd];return _0x1b1419;};'use strict';var _=require(_0x015d('0x0'));var util=require(_0x015d('0x1'));var logger=require('../../config/logger')(_0x015d('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x015d('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x015d('0x4'));var attributes=require('./whatsappTransferReport.attributes');module[_0x015d('0x5')]=function(_0x5381e7,_0x344976){return _0x5381e7['define'](_0x015d('0x6'),attributes,{'tableName':_0x015d('0x7'),'paranoid':![],'indexes':[{'name':_0x015d('0x8'),'fields':[_0x015d('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x777b=['lodash','util','api','path','rimraf','../../config/environment','exports','define','WhatsappTransferReport','report_whatsapp_transfer'];(function(_0x3a415b,_0x37c756){var _0x426f0a=function(_0xd7ff9f){while(--_0xd7ff9f){_0x3a415b['push'](_0x3a415b['shift']());}};_0x426f0a(++_0x37c756);}(_0x777b,0x17c));var _0xb777=function(_0x320d35,_0x99efad){_0x320d35=_0x320d35-0x0;var _0x43e5f9=_0x777b[_0x320d35];return _0x43e5f9;};'use strict';var _=require(_0xb777('0x0'));var util=require(_0xb777('0x1'));var logger=require('../../config/logger')(_0xb777('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb777('0x3'));var rimraf=require(_0xb777('0x4'));var config=require(_0xb777('0x5'));var attributes=require('./whatsappTransferReport.attributes');module[_0xb777('0x6')]=function(_0x3ffc1d,_0x4446aa){return _0x3ffc1d[_0xb777('0x7')](_0xb777('0x8'),attributes,{'tableName':_0xb777('0x9'),'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 25d6ed8..18866b4 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 _0x30ea=['info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x16d593,_0x4150ff){var _0x3ba454=function(_0xb7b354){while(--_0xb7b354){_0x16d593['push'](_0x16d593['shift']());}};_0x3ba454(++_0x4150ff);}(_0x30ea,0x1ac));var _0xa30e=function(_0x51e326,_0x5a762f){_0x51e326=_0x51e326-0x0;var _0x11638e=_0x30ea[_0x51e326];return _0x11638e;};'use strict';var _=require('lodash');var util=require(_0xa30e('0x0'));var moment=require(_0xa30e('0x1'));var BPromise=require(_0xa30e('0x2'));var rs=require(_0xa30e('0x3'));var fs=require('fs');var Redis=require(_0xa30e('0x4'));var db=require(_0xa30e('0x5'))['db'];var utils=require(_0xa30e('0x6'));var logger=require(_0xa30e('0x7'))(_0xa30e('0x8'));var config=require(_0xa30e('0x9'));var jayson=require(_0xa30e('0xa'));var client=jayson['client'][_0xa30e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xc12c0e,_0x24457e,_0x4e91f5){return new BPromise(function(_0x5edfcc,_0x366237){return client[_0xa30e('0xc')](_0xc12c0e,_0x4e91f5)['then'](function(_0x3109a2){logger[_0xa30e('0xd')](_0xa30e('0xe'),_0x24457e,_0xa30e('0xf'));logger['debug']('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x24457e,_0xa30e('0xf'),JSON['stringify'](_0x3109a2));if(_0x3109a2[_0xa30e('0x10')]){if(_0x3109a2[_0xa30e('0x10')][_0xa30e('0x11')]===0x1f4){logger[_0xa30e('0x10')]('WhatsappTransferReport,\x20%s,\x20%s',_0x24457e,_0x3109a2['error'][_0xa30e('0x12')]);return _0x366237(_0x3109a2[_0xa30e('0x10')][_0xa30e('0x12')]);}logger['error'](_0xa30e('0xe'),_0x24457e,_0x3109a2['error'][_0xa30e('0x12')]);return _0x5edfcc(_0x3109a2['error'][_0xa30e('0x12')]);}else{logger[_0xa30e('0xd')](_0xa30e('0xe'),_0x24457e,_0xa30e('0xf'));_0x5edfcc(_0x3109a2[_0xa30e('0x13')]['message']);}})[_0xa30e('0x14')](function(_0x54aae2){logger[_0xa30e('0x10')](_0xa30e('0xe'),_0x24457e,_0x54aae2);_0x366237(_0x54aae2);});});} \ No newline at end of file +var _0xbc25=['../../config/environment','jayson/promise','http','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x287ddf,_0x3821a3){var _0x58c0e6=function(_0x421681){while(--_0x421681){_0x287ddf['push'](_0x287ddf['shift']());}};_0x58c0e6(++_0x3821a3);}(_0xbc25,0x132));var _0x5bc2=function(_0xb9135,_0x57893b){_0xb9135=_0xb9135-0x0;var _0x2002d3=_0xbc25[_0xb9135];return _0x2002d3;};'use strict';var _=require(_0x5bc2('0x0'));var util=require(_0x5bc2('0x1'));var moment=require(_0x5bc2('0x2'));var BPromise=require(_0x5bc2('0x3'));var rs=require(_0x5bc2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5bc2('0x5'))['db'];var utils=require(_0x5bc2('0x6'));var logger=require(_0x5bc2('0x7'))(_0x5bc2('0x8'));var config=require(_0x5bc2('0x9'));var jayson=require(_0x5bc2('0xa'));var client=jayson['client'][_0x5bc2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x351c35,_0x257039,_0x9bdb16){return new BPromise(function(_0x32c49,_0x51e643){return client[_0x5bc2('0xc')](_0x351c35,_0x9bdb16)[_0x5bc2('0xd')](function(_0x23e3f7){logger[_0x5bc2('0xe')](_0x5bc2('0xf'),_0x257039,_0x5bc2('0x10'));logger[_0x5bc2('0x11')]('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x257039,_0x5bc2('0x10'),JSON[_0x5bc2('0x12')](_0x23e3f7));if(_0x23e3f7[_0x5bc2('0x13')]){if(_0x23e3f7[_0x5bc2('0x13')]['code']===0x1f4){logger['error'](_0x5bc2('0xf'),_0x257039,_0x23e3f7[_0x5bc2('0x13')][_0x5bc2('0x14')]);return _0x51e643(_0x23e3f7[_0x5bc2('0x13')][_0x5bc2('0x14')]);}logger[_0x5bc2('0x13')](_0x5bc2('0xf'),_0x257039,_0x23e3f7[_0x5bc2('0x13')][_0x5bc2('0x14')]);return _0x32c49(_0x23e3f7[_0x5bc2('0x13')]['message']);}else{logger['info']('WhatsappTransferReport,\x20%s,\x20%s',_0x257039,_0x5bc2('0x10'));_0x32c49(_0x23e3f7['result'][_0x5bc2('0x14')]);}})['catch'](function(_0x26a3b9){logger[_0x5bc2('0x13')](_0x5bc2('0xf'),_0x257039,_0x26a3b9);_0x51e643(_0x26a3b9);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 2dcc097..492ed48 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4a9c=['app','./config/pm2','./config/pm2/config','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','then','default','listen','info','start','filter','exitCode','number','length','pm2_env','map','online','name','join','Offline\x20apps:','status','None','log','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','exit','lodash','./mysqldb','./config/seedDB','./config/license','./rpc','./config/environment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4a9c,0xcc));var _0xc4a9=function(_0x2a68b6,_0x300212){_0x2a68b6=_0x2a68b6-0x0;var _0xbcfb75=_0x4a9c[_0x2a68b6];return _0xbcfb75;};'use strict';var _=require(_0xc4a9('0x0'));var db=require(_0xc4a9('0x1'))['db'];var seedDb=require(_0xc4a9('0x2'));var checkLicense=require(_0xc4a9('0x3'));var rpc=require(_0xc4a9('0x4'));var config=require(_0xc4a9('0x5'));var logger=require('./config/logger')(_0xc4a9('0x6'));var pm2=require(_0xc4a9('0x7'));var pm2Config=require(_0xc4a9('0x8'));var schedule=require('./config/schedule');var chat=require('./config/schedule/chat');var whatsapp=require(_0xc4a9('0x9'));var transcribe=require(_0xc4a9('0xa'));var provider=require(_0xc4a9('0xb'));function main(){return db[_0xc4a9('0xc')]['sync']()[_0xc4a9('0xd')](function(){if(config['seedDB']){return seedDb['default']();}})[_0xc4a9('0xd')](function(){return checkLicense[_0xc4a9('0xe')]();})[_0xc4a9('0xd')](function(){return rpc[_0xc4a9('0xf')]();})[_0xc4a9('0xd')](function(_0x131217){logger[_0xc4a9('0x10')](_0x131217);return chat[_0xc4a9('0x11')]();})[_0xc4a9('0xd')](function(){return whatsapp[_0xc4a9('0x11')]();})[_0xc4a9('0xd')](function(){return schedule['start']();})[_0xc4a9('0xd')](function(){return transcribe[_0xc4a9('0x11')]();})[_0xc4a9('0xd')](function(){return provider['start']();})[_0xc4a9('0xd')](function(_0x182ba6){logger['info'](_0x182ba6);return pm2['start'](pm2Config);})[_0xc4a9('0xd')](function(_0x573459){var _0x3bc294=_0x573459[_0xc4a9('0x12')](function(_0x3a955e){return typeof _0x3a955e[_0xc4a9('0x13')]===_0xc4a9('0x14')&&_0x3a955e['exitCode']>=0x0;});if(_0x3bc294[_0xc4a9('0x15')]>0x0){throw new Error(_0x3bc294['length']+'\x20processes\x20failed\x20at\x20startup:\x20'+_['map'](_0x3bc294,function(_0x3a3d5c){return'\x22'+_0x3a3d5c[_0xc4a9('0x16')]['name']+'\x22';}));}logger[_0xc4a9('0x10')]('Online\x20apps:',_[_0xc4a9('0x17')](_[_0xc4a9('0x12')](_0x573459,{'status':_0xc4a9('0x18')}),_0xc4a9('0x19'))[_0xc4a9('0x1a')]());logger[_0xc4a9('0x10')](_0xc4a9('0x1b'),_[_0xc4a9('0x17')](_[_0xc4a9('0x12')](_0x573459,function(_0x5707f6){return _0x5707f6[_0xc4a9('0x1c')]!=='online';}),_0xc4a9('0x19'))[_0xc4a9('0x1a')]()||_0xc4a9('0x1d'));console[_0xc4a9('0x1e')]('App\x20Ready!');})[_0xc4a9('0x1f')](function(_0x2e4cd6){console['log'](_0xc4a9('0x20'),_0x2e4cd6);logger[_0xc4a9('0x21')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x2e4cd6);process[_0xc4a9('0x22')](0x1);});}main(); \ No newline at end of file +var _0x0fcd=['online','join','None','catch','log','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','./mysqldb','./config/seedDB','./config/license','./rpc','./config/environment','./config/logger','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/transcribe','sync','seedDB','default','then','listen','info','start','exitCode','number','map','pm2_env','Online\x20apps:','name','Offline\x20apps:','filter','status'];(function(_0x15dc08,_0x45ab3b){var _0x15372e=function(_0x2ef03d){while(--_0x2ef03d){_0x15dc08['push'](_0x15dc08['shift']());}};_0x15372e(++_0x45ab3b);}(_0x0fcd,0x129));var _0xd0fc=function(_0x1ea63c,_0x324dd4){_0x1ea63c=_0x1ea63c-0x0;var _0xe2de07=_0x0fcd[_0x1ea63c];return _0xe2de07;};'use strict';var _=require('lodash');var db=require(_0xd0fc('0x0'))['db'];var seedDb=require(_0xd0fc('0x1'));var checkLicense=require(_0xd0fc('0x2'));var rpc=require(_0xd0fc('0x3'));var config=require(_0xd0fc('0x4'));var logger=require(_0xd0fc('0x5'))('app');var pm2=require(_0xd0fc('0x6'));var pm2Config=require(_0xd0fc('0x7'));var schedule=require(_0xd0fc('0x8'));var chat=require(_0xd0fc('0x9'));var whatsapp=require('./config/schedule/whatsapp');var transcribe=require(_0xd0fc('0xa'));var provider=require('./config/schedule/cloud-provider');function main(){return db['sequelize'][_0xd0fc('0xb')]()['then'](function(){if(config[_0xd0fc('0xc')]){return seedDb[_0xd0fc('0xd')]();}})[_0xd0fc('0xe')](function(){return checkLicense['default']();})[_0xd0fc('0xe')](function(){return rpc[_0xd0fc('0xf')]();})['then'](function(_0x5c8bb2){logger[_0xd0fc('0x10')](_0x5c8bb2);return chat[_0xd0fc('0x11')]();})[_0xd0fc('0xe')](function(){return whatsapp['start']();})[_0xd0fc('0xe')](function(){return schedule['start']();})[_0xd0fc('0xe')](function(){return transcribe[_0xd0fc('0x11')]();})['then'](function(){return provider[_0xd0fc('0x11')]();})[_0xd0fc('0xe')](function(_0x2f1c7a){logger['info'](_0x2f1c7a);return pm2[_0xd0fc('0x11')](pm2Config);})[_0xd0fc('0xe')](function(_0x34492c){var _0x54f78c=_0x34492c['filter'](function(_0x3f7fde){return typeof _0x3f7fde[_0xd0fc('0x12')]===_0xd0fc('0x13')&&_0x3f7fde['exitCode']>=0x0;});if(_0x54f78c['length']>0x0){throw new Error(_0x54f78c['length']+'\x20processes\x20failed\x20at\x20startup:\x20'+_[_0xd0fc('0x14')](_0x54f78c,function(_0x4ced92){return'\x22'+_0x4ced92[_0xd0fc('0x15')]['name']+'\x22';}));}logger[_0xd0fc('0x10')](_0xd0fc('0x16'),_[_0xd0fc('0x14')](_['filter'](_0x34492c,{'status':'online'}),_0xd0fc('0x17'))['join']());logger[_0xd0fc('0x10')](_0xd0fc('0x18'),_[_0xd0fc('0x14')](_[_0xd0fc('0x19')](_0x34492c,function(_0x43d092){return _0x43d092[_0xd0fc('0x1a')]!==_0xd0fc('0x1b');}),'name')[_0xd0fc('0x1c')]()||_0xd0fc('0x1d'));console['log']('App\x20Ready!');})[_0xd0fc('0x1e')](function(_0x25ce2a){console[_0xd0fc('0x1f')](_0xd0fc('0x20'),_0x25ce2a);logger[_0xd0fc('0x21')](_0xd0fc('0x22'),_0x25ce2a);process[_0xd0fc('0x23')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 98ea994..0f64340 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 _0x087b=['../../mysqldb','../../config/environment','../encryptor','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','bluebird','util','moment','secrets','session','role','fullname','name','internal','email','userpic','permissions','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','lastLoginAt','lastPauseAt','crudPermissions','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControlPort','hotdesk','userProfileId','privacyEnabled','settingsEnabled','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','chatAutoanswer','chatAutoanswerDelay','emailAutoanswer','emailAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswer','whatsappAutoanswerDelay','messengerSoundNotification','isChatInteractionAuthorized','isAuthenticated','user','ChatInteraction','params','closed','disposition','unmanaged','json','Unmanaged.','Forbidden.','catch','use','headers','authorization','startsWith','Basic','then','authenticate','pass','status','Wrong\x20credentials.','Bearer','query','apikey','getUuid','sub','Setting','findOne','blockDuration','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','add','minutes','Unknown\x20authorization\x20format','User','find','canUpdate','update','Forbidden','isWebrtcLicence','getLicense','signToken','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','/dashboards/general','send','retrieveApiKey','isNil','apiKeyIat','regenerateApiKey','validatePasswordPattern','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','splice','unshift','encryptString','promisify','sign','secret','payload','options','verify','toString','hex','floor','now','HS512'];(function(_0x7538c5,_0xa5d8ac){var _0x8b56be=function(_0x2036c0){while(--_0x2036c0){_0x7538c5['push'](_0x7538c5['shift']());}};_0x8b56be(++_0xa5d8ac);}(_0x087b,0x11a));var _0xb087=function(_0x4e9d3c,_0x1f4b98){_0x4e9d3c=_0x4e9d3c-0x0;var _0x2d0825=_0x087b[_0x4e9d3c];return _0x2d0825;};'use strict';var db=require(_0xb087('0x0'))['db'];var config=require(_0xb087('0x1'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require('../../config/license/util');var encryptor=require(_0xb087('0x2'));var _=require('lodash');var jwt=require(_0xb087('0x3'));var expressJwt=require(_0xb087('0x4'));var compose=require(_0xb087('0x5'));var basicAuth=require(_0xb087('0x6'));var crypto=require(_0xb087('0x7'));var BPromise=require(_0xb087('0x8'));var util=require(_0xb087('0x9'));var moment=require(_0xb087('0xa'));var validateJwt=expressJwt({'secret':config[_0xb087('0xb')][_0xb087('0xc')]});var userAttributes=['id',_0xb087('0xd'),_0xb087('0xe'),_0xb087('0xf'),_0xb087('0x10'),_0xb087('0x11'),_0xb087('0x12'),_0xb087('0x13'),'md5secret',_0xb087('0x14'),_0xb087('0x15'),_0xb087('0x16'),_0xb087('0x17'),_0xb087('0x18'),_0xb087('0x19'),_0xb087('0x1a'),'showWebBar',_0xb087('0x1b'),_0xb087('0x1c'),_0xb087('0x1d'),'allowmessenger',_0xb087('0x1e'),_0xb087('0x1f'),_0xb087('0x20'),_0xb087('0x21'),_0xb087('0x22'),_0xb087('0x23'),_0xb087('0x24'),_0xb087('0x25'),_0xb087('0x26'),_0xb087('0x27'),'phoneBarRemoteControl',_0xb087('0x28'),_0xb087('0x29'),'interface',_0xb087('0x2a'),_0xb087('0x2b'),_0xb087('0x2c'),'wssPort',_0xb087('0x2d'),_0xb087('0x2e'),_0xb087('0x2f'),_0xb087('0x30'),'selectRecallMeCampaign',_0xb087('0x31'),_0xb087('0x32'),_0xb087('0x33'),_0xb087('0x34'),'smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','openchannelAutoanswerDelay',_0xb087('0x35'),_0xb087('0x36'),_0xb087('0x37'),_0xb087('0x38'),_0xb087('0x39')];exports[_0xb087('0x3a')]=function(){return this[_0xb087('0x3b')](!![])['use'](function(_0x1d1424,_0x466397,_0x1de654){if(_0x1d1424[_0xb087('0x3c')]){_0x1de654();}else{return db[_0xb087('0x3d')]['findOne']({'where':{'id':_0x1d1424[_0xb087('0x3e')]['id']},'attributes':['id',_0xb087('0x3f'),'disposition'],'raw':!![]})['then'](function(_0x50745a){if(_0x50745a&&_0x50745a['closed']){return _0x466397['status'](_0x50745a[_0xb087('0x40')]===_0xb087('0x41')?0x195:0x193)[_0xb087('0x42')]({'message':_0x50745a[_0xb087('0x40')]===_0xb087('0x41')?_0xb087('0x43'):_0xb087('0x44')});}else{_0x1de654();}})[_0xb087('0x45')](function(_0x6cfb22){_0x1de654(_0x6cfb22);});}});};exports[_0xb087('0x3b')]=function isAuthenticated(_0x18058c){return compose()[_0xb087('0x46')](function(_0xb0baf6,_0x263259,_0x593b78){var _0x37393a;if(_0xb0baf6[_0xb087('0x47')][_0xb087('0x48')]){if(_[_0xb087('0x49')](_0xb0baf6[_0xb087('0x47')][_0xb087('0x48')],_0xb087('0x4a'))){var _0x13fb2f=basicAuth(_0xb0baf6);db['User']['find']({'where':{'name':_0x13fb2f[_0xb087('0xf')]}})[_0xb087('0x4b')](function(_0x4cb5a8){if(!_0x4cb5a8||!_0x4cb5a8[_0xb087('0x4c')](_0x13fb2f[_0xb087('0x4d')])){return _0x263259[_0xb087('0x4e')](0x191)[_0xb087('0x42')]({'message':_0xb087('0x4f')});}_0xb0baf6[_0xb087('0x3c')]={'id':_0x4cb5a8['id']};_0x593b78();})[_0xb087('0x45')](function(_0x3b7ace){_0x593b78(_0x3b7ace);});}else if(_[_0xb087('0x49')](_0xb0baf6[_0xb087('0x47')][_0xb087('0x48')],_0xb087('0x50'))){validateJwt(_0xb0baf6,_0x263259,_0x593b78);}else{if(_0x18058c){_0x593b78();}else{return _0x263259['status'](0x193)[_0xb087('0x42')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0xb0baf6[_0xb087('0x51')][_0xb087('0x52')]){try{var _0x738e68={'audience':hardwareConf[_0xb087('0x53')](),'issuer':hardwareConf[_0xb087('0x53')]()};verifyJwt(_0xb0baf6[_0xb087('0x51')][_0xb087('0x52')],_0x738e68)[_0xb087('0x4b')](function(_0x8a4c3c){return db['User']['find']({'where':{'id':_0x8a4c3c[_0xb087('0x54')]}})[_0xb087('0x4b')](function(_0x1ce1ef){_0x37393a=_0x1ce1ef;return db[_0xb087('0x55')][_0xb087('0x56')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xb087('0x57')],'raw':!![]});})[_0xb087('0x4b')](function(_0x48524e){if(!_0x37393a||!_['isEqual'](_0x37393a[_0xb087('0x58')],_0x8a4c3c[_0xb087('0x59')])){return _0x263259[_0xb087('0x4e')](0x191)['json']({'message':_0xb087('0x5a')});}if(_0x37393a[_0xb087('0x5b')]){return _0x263259[_0xb087('0x4e')](0x191)[_0xb087('0x42')]({'message':_0xb087('0x5c')});}if(_0x37393a['blocked']){if(_0x48524e[_0xb087('0x57')]>0x0){if(moment(_0x37393a['blockedAt'])[_0xb087('0x5d')](_0x48524e['blockDuration'],_0xb087('0x5e'))>moment()){return _0x263259[_0xb087('0x4e')](0x191)['json']({'message':_0xb087('0x5c')});}}else{return _0x263259['status'](0x191)[_0xb087('0x42')]({'message':'Invalid\x20API\x20access\x20key'});}}_0xb0baf6[_0xb087('0x3c')]={'id':_0x37393a['id']};_0x593b78();});})[_0xb087('0x45')](function(){return _0x263259[_0xb087('0x4e')](0x191)[_0xb087('0x42')]({'message':_0xb087('0x5c')});});}catch(_0x2a4787){_0x593b78(_0x2a4787);}}else if(_0x18058c){_0x593b78();}else{return _0x263259[_0xb087('0x4e')](0x193)['json']({'message':_0xb087('0x5f')});}})['use'](function(_0x2a2b9c,_0x2d71c2,_0x5b6924){if(_0x2a2b9c[_0xb087('0x3c')]){db[_0xb087('0x60')][_0xb087('0x61')]({'where':{'id':_0x2a2b9c['user']['id']},'attributes':userAttributes})[_0xb087('0x4b')](function(_0x4a9ccb){if(!_0x4a9ccb){return _0x2d71c2[_0xb087('0x4e')](0x194)[_0xb087('0x42')]({'message':'User\x20not\x20found.'});}_0x2a2b9c[_0xb087('0x3c')]=_0x4a9ccb;_0x5b6924();})[_0xb087('0x45')](function(_0x4addbd){_0x5b6924(_0x4addbd);});}else if(_0x18058c){_0x5b6924();}else{return _0x2d71c2[_0xb087('0x4e')](0x194)[_0xb087('0x42')]({'message':'User\x20object\x20not\x20found.'});}});};exports[_0xb087('0x62')]=function canUpdate(){return compose()[_0xb087('0x46')](function(_0x1d7f80,_0x174c10,_0x58ca9f){return licenseUtil['getLicense']()[_0xb087('0x4b')](function(_0x42e19f){if(_0x42e19f[_0xb087('0x63')]){_0x58ca9f();}else{return _0x174c10[_0xb087('0x4e')](0x193)[_0xb087('0x42')]({'message':_0xb087('0x64')});}})['catch'](function(_0x4a1949){_0x58ca9f(_0x4a1949);});});};exports[_0xb087('0x65')]=function isWebrtcLicence(){return compose()['use'](function(_0x3a405b,_0x3966f4,_0x2a1823){return licenseUtil[_0xb087('0x66')]()['then'](function(_0x2be4f2){if(_0x2be4f2['webrtc']){_0x2a1823();}else{return _0x3966f4[_0xb087('0x4e')](0x193)[_0xb087('0x42')]({'message':_0xb087('0x64')});}})[_0xb087('0x45')](function(_0x46b12c){_0x2a1823(_0x46b12c);});});};exports['isMiddleware']=function(_0x21506f,_0xb15e28,_0x588d96){_0x21506f['isMiddleware']=!![];return _0x588d96();};exports[_0xb087('0x67')]=function signToken(_0x4f0bc3){return signJwt(_0x4f0bc3);};exports['setTokenCookie']=function(_0x1c9f8f,_0x341665){if(!_0x1c9f8f['user']){return _0x341665[_0xb087('0x4e')](0x194)[_0xb087('0x42')]({'message':_0xb087('0x68')});}var _0x48950c={'payload':{'id':_0x1c9f8f['user']['id'],'role':_0x1c9f8f[_0xb087('0x3c')]['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x48950c)['then'](function(_0x1e52e4){_0x341665[_0xb087('0x69')](_0xb087('0x6a'),_0x1e52e4);_0x341665[_0xb087('0x6b')](_0xb087('0x6c'));})[_0xb087('0x45')](function(_0xbd849d){return _0x341665[_0xb087('0x4e')](0x1f4)[_0xb087('0x6d')](_0xbd849d);});};exports[_0xb087('0x6e')]=function(_0x47d47c){if(_[_0xb087('0x6f')](_0x47d47c['apiKeyNonce'])||_[_0xb087('0x6f')](_0x47d47c[_0xb087('0x70')])){return null;}else{return createJwt(_0x47d47c);}};exports['generateApiKey']=function(_0xde0773){_0xde0773[_0xb087('0x58')]=generateNonce();_0xde0773[_0xb087('0x70')]=generateIssuedAt();return createJwt(_0xde0773);};exports[_0xb087('0x71')]=function(_0x401901,_0x3c85d1){var _0x167e90=_0x401901[_0xb087('0x51')][_0xb087('0x52')];if(_0x167e90){var _0x357616={'nonce':_0x3c85d1[_0xb087('0x58')],'iat':_0x3c85d1['apiKeyIat'],'audience':hardwareConf[_0xb087('0x53')](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x167e90,_0x357616)[_0xb087('0x4b')](function(){return generateApiKey(_0x3c85d1);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};exports[_0xb087('0x72')]=function(_0x56c67){var _0x187ffd=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x187ffd[_0xb087('0x73')](_0x56c67))throw new db[(_0xb087('0x74'))][(_0xb087('0x75'))](_0xb087('0x76'));return;};exports[_0xb087('0x77')]=function(_0x3f3091,_0x323e0a,_0x300e9b){var _0x2ee0a3=encryptor[_0xb087('0x78')](_0x323e0a)[_0xb087('0x79')](',');for(var _0x3f6fd7=0x0;_0x3f6fd7<_0x300e9b;_0x3f6fd7++){if(!_0x2ee0a3[_0x3f6fd7])break;if(_0x3f3091[_0xb087('0x7a')]()===_0x2ee0a3[_0x3f6fd7][_0xb087('0x7a')]()){var _0x3185c4=util[_0xb087('0x7b')](_0xb087('0x7c'),_0x300e9b);if(_0x300e9b===0x1){_0x3185c4=_0xb087('0x7d');}throw new db[(_0xb087('0x74'))]['ValidationError'](_0x3185c4);}}return;};exports[_0xb087('0x7e')]=function(_0x1f893a,_0xe81087){var _0x561c40=_0xe81087?encryptor[_0xb087('0x78')](_0xe81087)[_0xb087('0x79')](','):[];if(_0x561c40['length']===0x5){_0x561c40[_0xb087('0x7f')](-0x1,0x1);}_0x561c40[_0xb087('0x80')](_0x1f893a);return encryptor[_0xb087('0x81')](_0x561c40['join'](','));};function signJwt(_0x133c58){var _0x257894=BPromise[_0xb087('0x82')](jwt[_0xb087('0x83')],{'context':jwt});var _0x1842a2=_0x133c58[_0xb087('0x84')]||config[_0xb087('0xb')][_0xb087('0xc')];return new BPromise(function(_0x4ff2db,_0x3cad9b){_0x257894(_0x133c58[_0xb087('0x85')],_0x1842a2,_0x133c58[_0xb087('0x86')])['then'](function(_0x812ed2){_0x4ff2db(_0x812ed2);})['catch'](function(_0x4a2441){_0x3cad9b(_0x4a2441);});});}function verifyJwt(_0x3516d4,_0x338b13,_0x48c00c){var _0x298fdb=BPromise['promisify'](jwt[_0xb087('0x87')],{'context':jwt});var _0x1a8237=_0x48c00c||config['secrets']['session'];return new BPromise(function(_0x22219d,_0x5c43c8){_0x298fdb(_0x3516d4,_0x1a8237,_0x338b13)['then'](function(_0x3c97ab){_0x22219d(_0x3c97ab);})['catch'](function(_0x34ad78){_0x5c43c8(_0x34ad78);});});}function generateNonce(){return crypto['randomBytes'](0x10)[_0xb087('0x88')](_0xb087('0x89'));}function generateIssuedAt(){return Math[_0xb087('0x8a')](Date[_0xb087('0x8b')]()/0x3e8)[_0xb087('0x88')]();}function createJwt(_0x3174bb){var _0x490cd7={'payload':{'iat':_0x3174bb[_0xb087('0x70')],'nonce':_0x3174bb['apiKeyNonce']},'options':{'algorithm':_0xb087('0x8c'),'subject':_0x3174bb['id'][_0xb087('0x88')](),'issuer':hardwareConf[_0xb087('0x53')](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x490cd7)[_0xb087('0x4b')](function(_0x5d935c){return{'iat':_0x3174bb[_0xb087('0x70')],'nonce':_0x3174bb[_0xb087('0x58')],'token':_0x5d935c};});} \ No newline at end of file +var _0x9c00=['floor','toString','../../mysqldb','../../config/environment','../encryptor','lodash','express-jwt','composable-middleware','basic-auth','crypto','bluebird','secrets','session','role','fullname','name','email','userpic','permissions','md5secret','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','interface','userProfileId','privacyEnabled','settingsEnabled','downloadVoiceRecordings','ignorePauseForPreviewCalls','chatAutoanswer','chatAutoanswerDelay','emailAutoanswer','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswer','messengerSoundNotification','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','closed','disposition','status','unmanaged','json','Unmanaged.','Forbidden.','catch','headers','authorization','startsWith','User','find','then','authenticate','pass','Wrong\x20credentials.','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','Setting','blockDuration','isEqual','apiKeyNonce','disabled','Invalid\x20API\x20access\x20key','blocked','blockedAt','add','minutes','canUpdate','Forbidden','isWebrtcLicence','getLicense','webrtc','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','motion.token','redirect','/dashboards/general','send','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','length','splice','unshift','encryptString','sign','secret','payload','options','promisify','randomBytes','hex'];(function(_0x64924c,_0x472da8){var _0x1b8e46=function(_0x3561fe){while(--_0x3561fe){_0x64924c['push'](_0x64924c['shift']());}};_0x1b8e46(++_0x472da8);}(_0x9c00,0x1a0));var _0x09c0=function(_0x199d4f,_0x49ede1){_0x199d4f=_0x199d4f-0x0;var _0x202d75=_0x9c00[_0x199d4f];return _0x202d75;};'use strict';var db=require(_0x09c0('0x0'))['db'];var config=require(_0x09c0('0x1'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require('../../config/license/util');var encryptor=require(_0x09c0('0x2'));var _=require(_0x09c0('0x3'));var jwt=require('jsonwebtoken');var expressJwt=require(_0x09c0('0x4'));var compose=require(_0x09c0('0x5'));var basicAuth=require(_0x09c0('0x6'));var crypto=require(_0x09c0('0x7'));var BPromise=require(_0x09c0('0x8'));var util=require('util');var moment=require('moment');var validateJwt=expressJwt({'secret':config[_0x09c0('0x9')][_0x09c0('0xa')]});var userAttributes=['id',_0x09c0('0xb'),_0x09c0('0xc'),_0x09c0('0xd'),'internal',_0x09c0('0xe'),_0x09c0('0xf'),_0x09c0('0x10'),_0x09c0('0x11'),_0x09c0('0x12'),_0x09c0('0x13'),_0x09c0('0x14'),_0x09c0('0x15'),_0x09c0('0x16'),_0x09c0('0x17'),_0x09c0('0x18'),_0x09c0('0x19'),_0x09c0('0x1a'),_0x09c0('0x1b'),_0x09c0('0x1c'),_0x09c0('0x1d'),_0x09c0('0x1e'),_0x09c0('0x1f'),_0x09c0('0x20'),_0x09c0('0x21'),_0x09c0('0x22'),_0x09c0('0x23'),_0x09c0('0x24'),_0x09c0('0x25'),_0x09c0('0x26'),_0x09c0('0x27'),'phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk',_0x09c0('0x28'),_0x09c0('0x29'),_0x09c0('0x2a'),_0x09c0('0x2b'),'wssPort',_0x09c0('0x2c'),'downloadOmnichannelInteractions','downloadAttachments',_0x09c0('0x2d'),'selectRecallMeCampaign',_0x09c0('0x2e'),_0x09c0('0x2f'),_0x09c0('0x30'),'emailAutoanswerDelay',_0x09c0('0x31'),_0x09c0('0x32'),_0x09c0('0x33'),_0x09c0('0x34'),_0x09c0('0x35'),_0x09c0('0x36'),_0x09c0('0x37'),'whatsappAutoanswerDelay',_0x09c0('0x38')];exports[_0x09c0('0x39')]=function(){return this[_0x09c0('0x3a')](!![])[_0x09c0('0x3b')](function(_0x59a76a,_0x4f6824,_0x321bcc){if(_0x59a76a[_0x09c0('0x3c')]){_0x321bcc();}else{return db[_0x09c0('0x3d')][_0x09c0('0x3e')]({'where':{'id':_0x59a76a['params']['id']},'attributes':['id',_0x09c0('0x3f'),_0x09c0('0x40')],'raw':!![]})['then'](function(_0x2c7202){if(_0x2c7202&&_0x2c7202[_0x09c0('0x3f')]){return _0x4f6824[_0x09c0('0x41')](_0x2c7202[_0x09c0('0x40')]===_0x09c0('0x42')?0x195:0x193)[_0x09c0('0x43')]({'message':_0x2c7202[_0x09c0('0x40')]===_0x09c0('0x42')?_0x09c0('0x44'):_0x09c0('0x45')});}else{_0x321bcc();}})[_0x09c0('0x46')](function(_0x5e53ac){_0x321bcc(_0x5e53ac);});}});};exports[_0x09c0('0x3a')]=function isAuthenticated(_0x1bdde9){return compose()['use'](function(_0x1d09e0,_0x5aa0b9,_0x3f5b10){var _0x4d6bdc;if(_0x1d09e0[_0x09c0('0x47')][_0x09c0('0x48')]){if(_[_0x09c0('0x49')](_0x1d09e0[_0x09c0('0x47')]['authorization'],'Basic')){var _0x17c374=basicAuth(_0x1d09e0);db[_0x09c0('0x4a')][_0x09c0('0x4b')]({'where':{'name':_0x17c374['name']}})[_0x09c0('0x4c')](function(_0x4bdae9){if(!_0x4bdae9||!_0x4bdae9[_0x09c0('0x4d')](_0x17c374[_0x09c0('0x4e')])){return _0x5aa0b9[_0x09c0('0x41')](0x191)['json']({'message':_0x09c0('0x4f')});}_0x1d09e0[_0x09c0('0x3c')]={'id':_0x4bdae9['id']};_0x3f5b10();})[_0x09c0('0x46')](function(_0x184c0b){_0x3f5b10(_0x184c0b);});}else if(_[_0x09c0('0x49')](_0x1d09e0[_0x09c0('0x47')][_0x09c0('0x48')],'Bearer')){validateJwt(_0x1d09e0,_0x5aa0b9,_0x3f5b10);}else{if(_0x1bdde9){_0x3f5b10();}else{return _0x5aa0b9[_0x09c0('0x41')](0x193)[_0x09c0('0x43')]({'message':_0x09c0('0x50')});}}}else if(_0x1d09e0[_0x09c0('0x51')][_0x09c0('0x52')]){try{var _0x50a37e={'audience':hardwareConf[_0x09c0('0x53')](),'issuer':hardwareConf[_0x09c0('0x53')]()};verifyJwt(_0x1d09e0[_0x09c0('0x51')][_0x09c0('0x52')],_0x50a37e)[_0x09c0('0x4c')](function(_0x541d0a){return db[_0x09c0('0x4a')][_0x09c0('0x4b')]({'where':{'id':_0x541d0a[_0x09c0('0x54')]}})[_0x09c0('0x4c')](function(_0x419d1c){_0x4d6bdc=_0x419d1c;return db[_0x09c0('0x55')][_0x09c0('0x3e')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x09c0('0x56')],'raw':!![]});})[_0x09c0('0x4c')](function(_0x3ab3d9){if(!_0x4d6bdc||!_[_0x09c0('0x57')](_0x4d6bdc[_0x09c0('0x58')],_0x541d0a['nonce'])){return _0x5aa0b9['status'](0x191)['json']({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}if(_0x4d6bdc[_0x09c0('0x59')]){return _0x5aa0b9[_0x09c0('0x41')](0x191)[_0x09c0('0x43')]({'message':_0x09c0('0x5a')});}if(_0x4d6bdc[_0x09c0('0x5b')]){if(_0x3ab3d9['blockDuration']>0x0){if(moment(_0x4d6bdc[_0x09c0('0x5c')])[_0x09c0('0x5d')](_0x3ab3d9['blockDuration'],_0x09c0('0x5e'))>moment()){return _0x5aa0b9['status'](0x191)[_0x09c0('0x43')]({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x5aa0b9[_0x09c0('0x41')](0x191)[_0x09c0('0x43')]({'message':'Invalid\x20API\x20access\x20key'});}}_0x1d09e0[_0x09c0('0x3c')]={'id':_0x4d6bdc['id']};_0x3f5b10();});})[_0x09c0('0x46')](function(){return _0x5aa0b9['status'](0x191)[_0x09c0('0x43')]({'message':_0x09c0('0x5a')});});}catch(_0xb8a592){_0x3f5b10(_0xb8a592);}}else if(_0x1bdde9){_0x3f5b10();}else{return _0x5aa0b9[_0x09c0('0x41')](0x193)[_0x09c0('0x43')]({'message':_0x09c0('0x50')});}})['use'](function(_0x24bb97,_0x3e0686,_0x2d6344){if(_0x24bb97['user']){db[_0x09c0('0x4a')][_0x09c0('0x4b')]({'where':{'id':_0x24bb97[_0x09c0('0x3c')]['id']},'attributes':userAttributes})['then'](function(_0x184340){if(!_0x184340){return _0x3e0686[_0x09c0('0x41')](0x194)['json']({'message':'User\x20not\x20found.'});}_0x24bb97[_0x09c0('0x3c')]=_0x184340;_0x2d6344();})[_0x09c0('0x46')](function(_0x576f10){_0x2d6344(_0x576f10);});}else if(_0x1bdde9){_0x2d6344();}else{return _0x3e0686[_0x09c0('0x41')](0x194)[_0x09c0('0x43')]({'message':'User\x20object\x20not\x20found.'});}});};exports[_0x09c0('0x5f')]=function canUpdate(){return compose()[_0x09c0('0x3b')](function(_0x2e7d4f,_0x33fc26,_0x2cef94){return licenseUtil['getLicense']()[_0x09c0('0x4c')](function(_0x499fe8){if(_0x499fe8['update']){_0x2cef94();}else{return _0x33fc26[_0x09c0('0x41')](0x193)[_0x09c0('0x43')]({'message':_0x09c0('0x60')});}})[_0x09c0('0x46')](function(_0x252496){_0x2cef94(_0x252496);});});};exports[_0x09c0('0x61')]=function isWebrtcLicence(){return compose()['use'](function(_0x5e239a,_0x502eff,_0xf54a1f){return licenseUtil[_0x09c0('0x62')]()[_0x09c0('0x4c')](function(_0x56ec01){if(_0x56ec01[_0x09c0('0x63')]){_0xf54a1f();}else{return _0x502eff[_0x09c0('0x41')](0x193)[_0x09c0('0x43')]({'message':_0x09c0('0x60')});}})[_0x09c0('0x46')](function(_0x7ba10f){_0xf54a1f(_0x7ba10f);});});};exports[_0x09c0('0x64')]=function(_0x2b3c56,_0x3f6d14,_0x38085c){_0x2b3c56[_0x09c0('0x64')]=!![];return _0x38085c();};exports[_0x09c0('0x65')]=function signToken(_0x28bd8a){return signJwt(_0x28bd8a);};exports[_0x09c0('0x66')]=function(_0x332b69,_0x32abbe){if(!_0x332b69[_0x09c0('0x3c')]){return _0x32abbe[_0x09c0('0x41')](0x194)[_0x09c0('0x43')]({'message':_0x09c0('0x67')});}var _0x5b27a4={'payload':{'id':_0x332b69[_0x09c0('0x3c')]['id'],'role':_0x332b69[_0x09c0('0x3c')][_0x09c0('0xb')]},'options':{'expiresIn':0x15180}};return signJwt(_0x5b27a4)[_0x09c0('0x4c')](function(_0x22f8b7){_0x32abbe['cookie'](_0x09c0('0x68'),_0x22f8b7);_0x32abbe[_0x09c0('0x69')](_0x09c0('0x6a'));})['catch'](function(_0xe0b82a){return _0x32abbe[_0x09c0('0x41')](0x1f4)[_0x09c0('0x6b')](_0xe0b82a);});};exports[_0x09c0('0x6c')]=function(_0x55b0f0){if(_[_0x09c0('0x6d')](_0x55b0f0[_0x09c0('0x58')])||_['isNil'](_0x55b0f0[_0x09c0('0x6e')])){return null;}else{return createJwt(_0x55b0f0);}};exports[_0x09c0('0x6f')]=function(_0x12f881){_0x12f881[_0x09c0('0x58')]=generateNonce();_0x12f881[_0x09c0('0x6e')]=generateIssuedAt();return createJwt(_0x12f881);};exports[_0x09c0('0x70')]=function(_0x3ebabb,_0x4987cf){var _0x4b6402=_0x3ebabb[_0x09c0('0x51')][_0x09c0('0x52')];if(_0x4b6402){var _0x1ab662={'nonce':_0x4987cf['apiKeyNonce'],'iat':_0x4987cf[_0x09c0('0x6e')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x09c0('0x53')]()};return verifyJwt(_0x4b6402,_0x1ab662)[_0x09c0('0x4c')](function(){return generateApiKey(_0x4987cf);});}else{throw{'message':_0x09c0('0x71')};}};exports[_0x09c0('0x72')]=function(_0x1df729){var _0xa94cfa=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0xa94cfa[_0x09c0('0x73')](_0x1df729))throw new db['Sequelize'][(_0x09c0('0x74'))](_0x09c0('0x75'));return;};exports[_0x09c0('0x76')]=function(_0x270ff2,_0x3a6845,_0x219195){var _0x1ad79f=encryptor[_0x09c0('0x77')](_0x3a6845)[_0x09c0('0x78')](',');for(var _0x123ad7=0x0;_0x123ad7<_0x219195;_0x123ad7++){if(!_0x1ad79f[_0x123ad7])break;if(_0x270ff2[_0x09c0('0x79')]()===_0x1ad79f[_0x123ad7]['toLowerCase']()){var _0x34cc0a=util[_0x09c0('0x7a')](_0x09c0('0x7b'),_0x219195);if(_0x219195===0x1){_0x34cc0a=_0x09c0('0x7c');}throw new db['Sequelize'][(_0x09c0('0x74'))](_0x34cc0a);}}return;};exports['updatePasswordsHistory']=function(_0x29205f,_0x9a4f4){var _0x1cfdb3=_0x9a4f4?encryptor['decryptString'](_0x9a4f4)['split'](','):[];if(_0x1cfdb3[_0x09c0('0x7d')]===0x5){_0x1cfdb3[_0x09c0('0x7e')](-0x1,0x1);}_0x1cfdb3[_0x09c0('0x7f')](_0x29205f);return encryptor[_0x09c0('0x80')](_0x1cfdb3['join'](','));};function signJwt(_0x247c3d){var _0x17eba7=BPromise['promisify'](jwt[_0x09c0('0x81')],{'context':jwt});var _0x47722f=_0x247c3d[_0x09c0('0x82')]||config[_0x09c0('0x9')]['session'];return new BPromise(function(_0x8d27a5,_0x24f23b){_0x17eba7(_0x247c3d[_0x09c0('0x83')],_0x47722f,_0x247c3d[_0x09c0('0x84')])[_0x09c0('0x4c')](function(_0x4613e0){_0x8d27a5(_0x4613e0);})[_0x09c0('0x46')](function(_0x63dda8){_0x24f23b(_0x63dda8);});});}function verifyJwt(_0x17931c,_0x2722fb,_0x85adc7){var _0x2906cb=BPromise[_0x09c0('0x85')](jwt['verify'],{'context':jwt});var _0x13f3af=_0x85adc7||config[_0x09c0('0x9')][_0x09c0('0xa')];return new BPromise(function(_0x4163fc,_0x356dcd){_0x2906cb(_0x17931c,_0x13f3af,_0x2722fb)['then'](function(_0x1205da){_0x4163fc(_0x1205da);})[_0x09c0('0x46')](function(_0x2e54f1){_0x356dcd(_0x2e54f1);});});}function generateNonce(){return crypto[_0x09c0('0x86')](0x10)['toString'](_0x09c0('0x87'));}function generateIssuedAt(){return Math[_0x09c0('0x88')](Date['now']()/0x3e8)[_0x09c0('0x89')]();}function createJwt(_0x1920c9){var _0x20dd29={'payload':{'iat':_0x1920c9[_0x09c0('0x6e')],'nonce':_0x1920c9[_0x09c0('0x58')]},'options':{'algorithm':'HS512','subject':_0x1920c9['id'][_0x09c0('0x89')](),'issuer':hardwareConf[_0x09c0('0x53')](),'audience':hardwareConf[_0x09c0('0x53')]()}};return signJwt(_0x20dd29)[_0x09c0('0x4c')](function(_0xe5af77){return{'iat':_0x1920c9['apiKeyIat'],'nonce':_0x1920c9[_0x09c0('0x58')],'token':_0xe5af77};});} \ No newline at end of file diff --git a/server/components/contacts/index.js b/server/components/contacts/index.js index 583f219..9c506b6 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 _0xe875=['../../mysqldb','findAll','skipContactsQuery','resolve','getContactsSubquery','then','search','parseAdvancedSearchFilter','parseQueryParameters','where','default','fields','filter','user','clause','tags','skip','checkListsRestrictions','count','buildContactsQuery','getFilteredContacts','catch','CmContact','describe','keys','cf_','map','findOne','all','length','fieldType','type','./sql-utils'];(function(_0x4e8b00,_0x59e9ac){var _0xdb08de=function(_0x30eb46){while(--_0x30eb46){_0x4e8b00['push'](_0x4e8b00['shift']());}};_0xdb08de(++_0x59e9ac);}(_0xe875,0x16a));var _0x5e87=function(_0x1c8b2d,_0xf9ef6){_0x1c8b2d=_0x1c8b2d-0x0;var _0x640977=_0xe875[_0x1c8b2d];return _0x640977;};'use strict';var _=require('lodash');var sqlUtils=require(_0x5e87('0x0'));var db=require(_0x5e87('0x1'))['db'];exports[_0x5e87('0x2')]=function(_0x5e8821,_0x24e966,_0x3b26db,_0x2da0f3){var _0x3ee15f={'count':0x0,'rows':[]};var _0x359c98=sqlUtils[_0x5e87('0x3')](_0x24e966,_0x5e8821);if(_0x359c98){return Promise[_0x5e87('0x4')](_0x3ee15f);}var _0x8c7702=sqlUtils[_0x5e87('0x5')]();var _0x58ad27={};var _0x5caace=![];var _0x39b39d=![];return Promise[_0x5e87('0x4')]()[_0x5e87('0x6')](function(){if(_0x5e8821[_0x5e87('0x7')]){return sqlUtils[_0x5e87('0x8')](_0x5e8821[_0x5e87('0x7')],_0x2da0f3);}else{return sqlUtils[_0x5e87('0x9')](_0x5e8821,_0x2da0f3);}})[_0x5e87('0x6')](function(_0x31d27e){_0x8c7702[_0x5e87('0xa')](_0x31d27e[_0x5e87('0xb')]);_0x8c7702[_0x5e87('0xa')](_0x31d27e[_0x5e87('0xc')]);_0x8c7702[_0x5e87('0xa')](_0x31d27e[_0x5e87('0xd')]);_0x8c7702['where'](_0x31d27e[_0x5e87('0xe')][_0x5e87('0xf')]);_0x58ad27=_0x31d27e[_0x5e87('0x10')];_0x39b39d=_0x31d27e[_0x5e87('0xe')][_0x5e87('0x11')];return sqlUtils[_0x5e87('0x12')](_0x24e966,_0x5e8821,_0x39b39d);})[_0x5e87('0x6')](function(_0x4a042b){_0x8c7702['where'](_0x4a042b);var _0x584952=_0x5e8821[_0x5e87('0x7')]?_0x58ad27['ids']:_0x5e8821['tag'];_0x5caace=_0x584952?!![]:![];return sqlUtils['countFilteredContacts'](_0x8c7702,_0x584952);})['then'](function(_0x3aea85){_0x3ee15f[_0x5e87('0x13')]=_0x3aea85;if(_0x3ee15f[_0x5e87('0x13')]===0x0){return;}if(_0x5e8821['User']){_0x39b39d=!![];}return sqlUtils[_0x5e87('0x14')](_0x8c7702,_0x5e8821[_0x5e87('0xc')],_0x3b26db,_0x5caace,_0x58ad27[_0x5e87('0xf')],_0x39b39d);})[_0x5e87('0x6')](function(_0x4bb891){if(!_0x4bb891){return[];}return sqlUtils[_0x5e87('0x15')](_0x4bb891,_0x5e8821,_0x3b26db);})[_0x5e87('0x6')](function(_0x171d19){_0x3ee15f['rows']=_0x171d19;return _0x3ee15f;})[_0x5e87('0x16')](function(_0xa84b93){throw _0xa84b93;});};exports['describe']=function(){var _0x1291d3={};var _0x46bf38=[];return db[_0x5e87('0x17')][_0x5e87('0x18')]()[_0x5e87('0x6')](function(_0x5d0a7b){_0x1291d3=_0x5d0a7b;var _0x833be5=Object[_0x5e87('0x19')](_0x1291d3)[_0x5e87('0xd')](function(_0x34a38b){return _['startsWith'](_0x34a38b,_0x5e87('0x1a'))?_0x34a38b:undefined;});var _0x502f53=_0x833be5[_0x5e87('0x1b')](function(_0x163e04){return db['CmCustomField'][_0x5e87('0x1c')]({'where':{'id':_0x163e04['slice'](0x3)},'raw':!![]});});return Promise[_0x5e87('0x1d')](_0x502f53);})[_0x5e87('0x6')](function(_0x13a2dd){for(var _0x988c62=0x0;_0x988c62<_0x13a2dd[_0x5e87('0x1e')];_0x988c62++){if(_0x13a2dd[_0x988c62]){var _0x36e79a=_0x5e87('0x1a')+_0x13a2dd[_0x988c62]['id'];_0x1291d3[_0x36e79a][_0x5e87('0x1f')]=_0x13a2dd[_0x988c62][_0x5e87('0x20')];}}_0x46bf38=_[_0x5e87('0x1b')](Object[_0x5e87('0x19')](_0x1291d3),function(_0x5ef89b){return{'name':_0x5ef89b,'type':_0x1291d3[_0x5ef89b][_0x5e87('0x20')]};});return _0x46bf38;})['catch'](function(_0x18921a){throw _0x18921a;});}; \ No newline at end of file +var _0xf62d=['startsWith','cf_','map','CmCustomField','findOne','slice','all','length','fieldType','keys','type','lodash','findAll','skipContactsQuery','resolve','getContactsSubquery','then','search','parseAdvancedSearchFilter','parseQueryParameters','where','default','filter','user','clause','skip','ids','tag','countFilteredContacts','count','buildContactsQuery','getFilteredContacts','rows','catch','describe'];(function(_0x18b0bb,_0x30b0f8){var _0x165fe6=function(_0x465663){while(--_0x465663){_0x18b0bb['push'](_0x18b0bb['shift']());}};_0x165fe6(++_0x30b0f8);}(_0xf62d,0x18c));var _0xdf62=function(_0x40d753,_0x27ffa6){_0x40d753=_0x40d753-0x0;var _0x4e3240=_0xf62d[_0x40d753];return _0x4e3240;};'use strict';var _=require(_0xdf62('0x0'));var sqlUtils=require('./sql-utils');var db=require('../../mysqldb')['db'];exports[_0xdf62('0x1')]=function(_0x238051,_0xa2607b,_0x71680e,_0x1482d2){var _0xa7bfea={'count':0x0,'rows':[]};var _0x27087d=sqlUtils[_0xdf62('0x2')](_0xa2607b,_0x238051);if(_0x27087d){return Promise[_0xdf62('0x3')](_0xa7bfea);}var _0x22fe75=sqlUtils[_0xdf62('0x4')]();var _0x25f351={};var _0x2d82c0=![];var _0x4f3519=![];return Promise['resolve']()[_0xdf62('0x5')](function(){if(_0x238051[_0xdf62('0x6')]){return sqlUtils[_0xdf62('0x7')](_0x238051[_0xdf62('0x6')],_0x1482d2);}else{return sqlUtils[_0xdf62('0x8')](_0x238051,_0x1482d2);}})['then'](function(_0x844f7f){_0x22fe75[_0xdf62('0x9')](_0x844f7f[_0xdf62('0xa')]);_0x22fe75[_0xdf62('0x9')](_0x844f7f['fields']);_0x22fe75[_0xdf62('0x9')](_0x844f7f[_0xdf62('0xb')]);_0x22fe75[_0xdf62('0x9')](_0x844f7f[_0xdf62('0xc')][_0xdf62('0xd')]);_0x25f351=_0x844f7f['tags'];_0x4f3519=_0x844f7f['user'][_0xdf62('0xe')];return sqlUtils['checkListsRestrictions'](_0xa2607b,_0x238051,_0x4f3519);})['then'](function(_0x1250f0){_0x22fe75[_0xdf62('0x9')](_0x1250f0);var _0x241e30=_0x238051[_0xdf62('0x6')]?_0x25f351[_0xdf62('0xf')]:_0x238051[_0xdf62('0x10')];_0x2d82c0=_0x241e30?!![]:![];return sqlUtils[_0xdf62('0x11')](_0x22fe75,_0x241e30);})[_0xdf62('0x5')](function(_0x11b8f8){_0xa7bfea[_0xdf62('0x12')]=_0x11b8f8;if(_0xa7bfea['count']===0x0){return;}if(_0x238051['User']){_0x4f3519=!![];}return sqlUtils[_0xdf62('0x13')](_0x22fe75,_0x238051['fields'],_0x71680e,_0x2d82c0,_0x25f351[_0xdf62('0xd')],_0x4f3519);})[_0xdf62('0x5')](function(_0x317b36){if(!_0x317b36){return[];}return sqlUtils[_0xdf62('0x14')](_0x317b36,_0x238051,_0x71680e);})[_0xdf62('0x5')](function(_0x2f6f8e){_0xa7bfea[_0xdf62('0x15')]=_0x2f6f8e;return _0xa7bfea;})[_0xdf62('0x16')](function(_0x259a9f){throw _0x259a9f;});};exports[_0xdf62('0x17')]=function(){var _0x3978f7={};var _0x378bd5=[];return db['CmContact'][_0xdf62('0x17')]()['then'](function(_0x2bd6b9){_0x3978f7=_0x2bd6b9;var _0x5c8b21=Object['keys'](_0x3978f7)[_0xdf62('0xb')](function(_0x2180c7){return _[_0xdf62('0x18')](_0x2180c7,_0xdf62('0x19'))?_0x2180c7:undefined;});var _0x1a1363=_0x5c8b21[_0xdf62('0x1a')](function(_0x1767a0){return db[_0xdf62('0x1b')][_0xdf62('0x1c')]({'where':{'id':_0x1767a0[_0xdf62('0x1d')](0x3)},'raw':!![]});});return Promise[_0xdf62('0x1e')](_0x1a1363);})[_0xdf62('0x5')](function(_0x16849e){for(var _0x41637c=0x0;_0x41637c<_0x16849e[_0xdf62('0x1f')];_0x41637c++){if(_0x16849e[_0x41637c]){var _0x5ea2ac=_0xdf62('0x19')+_0x16849e[_0x41637c]['id'];_0x3978f7[_0x5ea2ac][_0xdf62('0x20')]=_0x16849e[_0x41637c]['type'];}}_0x378bd5=_['map'](Object[_0xdf62('0x21')](_0x3978f7),function(_0x536a33){return{'name':_0x536a33,'type':_0x3978f7[_0x536a33][_0xdf62('0x22')]};});return _0x378bd5;})[_0xdf62('0x16')](function(_0x218ab3){throw _0x218ab3;});}; \ No newline at end of file diff --git a/server/components/contacts/sql-utils.js b/server/components/contacts/sql-utils.js index 8641b7a..99c4260 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 _0x9f8e=['castTo','DATE','buildExpression','type','default','text','start','value','end','Tag','map','clause','and','tags','ids','user','uc.UserId\x20=\x20?','skip','some','compact','Contact','User','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','resolve','then','fields','filter','c.ListId\x20IS\x20NULL','attributes','group','c.id','limit','offset','subqry.id','order','subqry.','DESC','color','keyBy','Sequelize','SELECT','CmContact','toString','Tags','split','clone','COUNT(*)','isEmpty','t.id\x20IN\x20?','sequelize','exports','lodash','squel','../parsers/advancedSearch','../parsers/qs','../interaction/utils','../../mysqldb','role','agent','search','ListId','true','select','from','where','subqry','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20','.id','ct.CmContactId\x20=\x20','tools_tags','firstName','phone','mobile','email','updatedAt','deletedAt','TagIds','includes','push','forEach','field','GROUP_CONCAT(DISTINCT\x20t.id)','expr','getSelectedTags','replace','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.lastName\x20LIKE\x20?','parseSearch','conditions','name','dateOfBirth','fieldType','datetime'];(function(_0x28a3dc,_0x21fe8c){var _0x1751fe=function(_0x33c894){while(--_0x33c894){_0x28a3dc['push'](_0x28a3dc['shift']());}};_0x1751fe(++_0x21fe8c);}(_0x9f8e,0x16f));var _0xe9f8=function(_0x35af5b,_0x30eda1){_0x35af5b=_0x35af5b-0x0;var _0x347f4d=_0x9f8e[_0x35af5b];return _0x347f4d;};'use strict';var _=require(_0xe9f8('0x0'));var squel=require(_0xe9f8('0x1'));var as=require(_0xe9f8('0x2'));var qs=require(_0xe9f8('0x3'));var utils=require(_0xe9f8('0x4'));var db=require(_0xe9f8('0x5'))['db'];function skipContactsQuery(_0x33fd0f,_0x436fd0){var _0x2ffbb1=![];if(_0x33fd0f[_0xe9f8('0x6')]===_0xe9f8('0x7')&&!_0x436fd0[_0xe9f8('0x8')]&&!_0x436fd0[_0xe9f8('0x9')]&&_0x436fd0['autocomplete']!==_0xe9f8('0xa')){_0x2ffbb1=!![];}return _0x2ffbb1;}function getContactsSubquery(){return squel[_0xe9f8('0xb')]()[_0xe9f8('0xc')]('cm_contacts','c')[_0xe9f8('0xd')]('c.deletedAt\x20IS\x20NULL');}function applyJoinClauses(_0x5b5d77,_0x267a90){var _0x176d07=_0x267a90?'c':_0xe9f8('0xe');_0x5b5d77[_0xe9f8('0xf')](_0xe9f8('0x10'),'uc',_0xe9f8('0x11')+_0x176d07+_0xe9f8('0x12'))[_0xe9f8('0xf')]('cm_contact_has_tags','ct',_0xe9f8('0x13')+_0x176d07+'.id')['left_join'](_0xe9f8('0x14'),'t','t.id\x20=\x20ct.TagId');return _0x5b5d77;}function addFieldsToQuery(_0x169dcd,_0x48c6d0,_0x21e11f,_0x2b514c,_0x31212d){var _0x476c84=_0x31212d?'c':_0xe9f8('0xe');if(!_0x48c6d0){_0x48c6d0=['id',_0xe9f8('0x15'),'lastName',_0xe9f8('0x16'),_0xe9f8('0x17'),'fax',_0xe9f8('0x18'),_0xe9f8('0x9'),'CompanyId','createdAt',_0xe9f8('0x19'),_0xe9f8('0x1a'),_0xe9f8('0x1b')];}else if(!_0x48c6d0[_0xe9f8('0x1c')]('id')){_0x48c6d0[_0xe9f8('0x1d')]('id');}var _0x501e9b=_0x21e11f&&_0x31212d||!_0x21e11f&&!_0x31212d;if(_0x2b514c){_0x501e9b=_0x2b514c&&_0x31212d||!_0x2b514c&&!_0x31212d;}_0x48c6d0[_0xe9f8('0x1e')](function(_0x267417){if(_0x267417===_0xe9f8('0x1b')){if(_0x501e9b){_0x169dcd[_0xe9f8('0x1f')](_0xe9f8('0x20'),_0x267417);}else if(_0x21e11f||_0x2b514c){_0x169dcd['field'](_0x476c84+'.'+_0x267417);}}else{_0x169dcd['field'](_0x476c84+'.'+_0x267417);}});return _0x169dcd;}function getSqlClauses(){var _0x209961={'default':squel[_0xe9f8('0x21')](),'fields':squel[_0xe9f8('0x21')](),'filter':squel[_0xe9f8('0x21')](),'tags':{'clause':squel[_0xe9f8('0x21')](),'ids':null},'user':{'clause':squel[_0xe9f8('0x21')](),'skip':![]}};return _0x209961;}function parseTagParameter(_0x568fb2){var _0x26967c=squel[_0xe9f8('0x21')]();if(_0x568fb2){var _0x5f21d9=utils[_0xe9f8('0x22')](_0x568fb2);_0x5f21d9[_0xe9f8('0x1e')](function(_0x79e351){_0x26967c['or']('CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x79e351+',%');});}return _0x26967c;}function parseSearchFilter(_0x2de8e7){var _0x274ebe=squel['expr']();if(_0x2de8e7){var _0x5a712f=_0x2de8e7[_0xe9f8('0x23')]('\x5c','\x5c\x5c')[_0xe9f8('0x23')](/'/g,'\x27\x27');if(_0x5a712f['split']('\x20')[_0xe9f8('0x24')]>0x1){_0x274ebe['or'](_0xe9f8('0x25'),qs[_0xe9f8('0x26')](_0x5a712f,!![]),null);}else{if(qs[_0xe9f8('0x27')](_0x5a712f)){_0x274ebe['or'](_0xe9f8('0x28'),_0x5a712f+'%');_0x274ebe['or'](_0xe9f8('0x29'),_0x5a712f+'%');_0x274ebe['or'](_0xe9f8('0x2a'),_0x5a712f+'%');_0x274ebe['or'](_0xe9f8('0x2b'),_0x5a712f+'%');}else if(qs[_0xe9f8('0x2c')](_0x5a712f)){_0x274ebe['or'](_0xe9f8('0x2d'),_0x5a712f+'%');}else{_0x274ebe['or']('c.firstName\x20LIKE\x20?','%'+_0x5a712f+'%');_0x274ebe['or'](_0xe9f8('0x2e'),'%'+_0x5a712f+'%');_0x274ebe['or'](_0xe9f8('0x2d'),'%'+_0x5a712f+'%');}}}return _0x274ebe;}function parseAdvancedSearchFilter(_0x440841,_0x41e75a){var _0x546f4d=getSqlClauses();var _0x3da647=as[_0xe9f8('0x2f')](_0x440841);var _0x397127=_0x3da647['sqlOperator'];for(var _0x241ef9=0x0;_0x241ef9<_0x3da647[_0xe9f8('0x30')]['length'];_0x241ef9++){var _0x4c052c=_0x3da647[_0xe9f8('0x30')][_0x241ef9];var _0x123d6b='c';var _0x1597ba=_['find'](_0x41e75a,[_0xe9f8('0x31'),_0x4c052c['field']]);if(_0x1597ba){if(_0x4c052c[_0xe9f8('0x1f')]===_0xe9f8('0x32')||_0x1597ba[_0xe9f8('0x33')]===_0xe9f8('0x34')){_0x4c052c[_0xe9f8('0x35')]=_0xe9f8('0x36');}var _0x55c8ed=as[_0xe9f8('0x37')](_0x123d6b,_0x1597ba[_0xe9f8('0x38')],_0x4c052c);_0x546f4d[_0xe9f8('0x39')][_0x397127](_0x55c8ed[_0xe9f8('0x3a')],_0x55c8ed['value'][_0xe9f8('0x3b')],_0x55c8ed[_0xe9f8('0x3c')][_0xe9f8('0x3d')]);}else{if(_0x4c052c['field']===_0xe9f8('0x3e')){var _0x1392b8=_0x4c052c[_0xe9f8('0x3c')]['split'](',')[_0xe9f8('0x3f')](function(_0x42653f){return Number(_0x42653f);});var _0x1536d2=parseTagParameter(_0x1392b8);_0x546f4d['tags'][_0xe9f8('0x40')][_0xe9f8('0x41')](_0x1536d2);_0x546f4d[_0xe9f8('0x42')][_0xe9f8('0x43')]=_0x1392b8;}else if(_0x4c052c[_0xe9f8('0x1f')]==='User'){_0x546f4d[_0xe9f8('0x44')][_0xe9f8('0x40')][_0xe9f8('0x41')](_0xe9f8('0x45'),_0x4c052c[_0xe9f8('0x3c')]);_0x546f4d[_0xe9f8('0x44')][_0xe9f8('0x46')]=!![];}}}return _0x546f4d;}function parseModelFields(_0x46ab3a,_0x15db28){var _0x2f8543=squel['expr']();var _0x32f0d3=_(_0x46ab3a)['keys']()['map'](function(_0x4f35d9){return _[_0xe9f8('0x47')](_0x15db28,[_0xe9f8('0x31'),_0x4f35d9])?_0x4f35d9:undefined;})[_0xe9f8('0x48')]()['value']();if(_0x46ab3a[_0xe9f8('0x49')]){_0x32f0d3[_0xe9f8('0x1d')](_0xe9f8('0x49'));}if(_0x46ab3a[_0xe9f8('0x4a')]){_0x32f0d3[_0xe9f8('0x1d')]('User');}if(_0x32f0d3[_0xe9f8('0x24')]>0x0){_0x32f0d3[_0xe9f8('0x1e')](function(_0x57b14f){if(_0x57b14f===_0xe9f8('0x9')){_0x2f8543[_0xe9f8('0x41')]('c.ListId\x20IN\x20?',[][_0xe9f8('0x4b')](_0x46ab3a[_0x57b14f]));}else if(_0x57b14f===_0xe9f8('0x49')){var _0x53dde9='%'+_0x46ab3a[_0x57b14f]+'%';_0x2f8543[_0xe9f8('0x41')](_0xe9f8('0x4c'),_0x53dde9);}else if(_0x57b14f===_0xe9f8('0x4a')){_0x2f8543[_0xe9f8('0x41')](_0xe9f8('0x45'),_0x46ab3a[_0x57b14f]);}else{_0x2f8543[_0xe9f8('0x41')]('c.'+_0x57b14f+'\x20=\x20?',_0x46ab3a[_0x57b14f]);}});}return _0x2f8543;}function parseQueryParameters(_0x2916f1,_0x401701){var _0x211755=getSqlClauses();return Promise[_0xe9f8('0x4d')]()['then'](function(){return parseModelFields(_0x2916f1,_0x401701);})[_0xe9f8('0x4e')](function(_0x5dd8f6){_0x211755[_0xe9f8('0x4f')][_0xe9f8('0x41')](_0x5dd8f6);return parseTagParameter(_0x2916f1['tag']);})[_0xe9f8('0x4e')](function(_0x2f0eaf){_0x211755[_0xe9f8('0x42')][_0xe9f8('0x40')][_0xe9f8('0x41')](_0x2f0eaf);return parseSearchFilter(_0x2916f1[_0xe9f8('0x50')]);})[_0xe9f8('0x4e')](function(_0x5407ff){_0x211755[_0xe9f8('0x50')]=_0x5407ff;return _0x211755;});}function checkListsRestrictions(_0x1c6956,_0x333d0c,_0x32c0e4){var _0x3d33cc=squel[_0xe9f8('0x21')]();return Promise['resolve']()[_0xe9f8('0x4e')](function(){if(_0x333d0c[_0xe9f8('0x8')]&&_0x1c6956[_0xe9f8('0x6')]==='agent'&&!_0x32c0e4){return _0x1c6956['getLists']({'attributes':['id'],'raw':!![]});}})[_0xe9f8('0x4e')](function(_0x11b128){if(_0x11b128){if(_0x11b128['length']===0x0){_0x3d33cc[_0xe9f8('0x41')](_0xe9f8('0x51'));}else{_0x3d33cc[_0xe9f8('0x41')]('c.ListId\x20IN\x20?',_[_0xe9f8('0x3f')](_0x11b128,'id'));}}})[_0xe9f8('0x4e')](function(){return _0x3d33cc;});}function buildContactsQuery(_0x1c82d1,_0x43bcfb,_0x4cbb25,_0xa118f0,_0x3f19a3,_0x1410cf){if(_0x43bcfb){_0x43bcfb=_0x4cbb25[_0xe9f8('0x52')];}_0x1c82d1=addFieldsToQuery(_0x1c82d1,_0x43bcfb,_0xa118f0,_0x1410cf,!![]);var _0x484cf6=squel[_0xe9f8('0xb')]();_0x484cf6=addFieldsToQuery(_0x484cf6,_0x43bcfb,_0xa118f0,_0x1410cf,![]);if(_0xa118f0||_0x1410cf){_0x1c82d1=applyJoinClauses(_0x1c82d1,!![]);_0x1c82d1[_0xe9f8('0x53')](_0xe9f8('0x54'));if(_0x4cbb25[_0xe9f8('0x55')]){_0x484cf6[_0xe9f8('0x55')](_0x4cbb25['limit']);}if(_0x4cbb25[_0xe9f8('0x56')]){_0x484cf6['offset'](_0x4cbb25[_0xe9f8('0x56')]);}}else{_0x484cf6=applyJoinClauses(_0x484cf6,![]);_0x484cf6['group'](_0xe9f8('0x57'));if(_0x4cbb25['limit']){_0x1c82d1[_0xe9f8('0x55')](_0x4cbb25[_0xe9f8('0x55')]);}if(_0x4cbb25[_0xe9f8('0x56')]){_0x1c82d1[_0xe9f8('0x56')](_0x4cbb25['offset']);}}_0x484cf6['having'](_0x3f19a3);if(_0x4cbb25[_0xe9f8('0x58')]){_0x4cbb25[_0xe9f8('0x58')][_0xe9f8('0x1e')](function(_0xb61afb){_0x1c82d1[_0xe9f8('0x58')]('c.'+_0xb61afb[0x0],_0xb61afb[0x1]==='DESC'?![]:!![]);_0x484cf6[_0xe9f8('0x58')](_0xe9f8('0x59')+_0xb61afb[0x0],_0xb61afb[0x1]===_0xe9f8('0x5a')?![]:!![]);});}_0x484cf6[_0xe9f8('0xc')](_0x1c82d1,_0xe9f8('0xe'));return _0x484cf6;}function getFilteredContacts(_0x115fc3){var _0x519862=[];return db[_0xe9f8('0x3e')]['findAll']({'attributes':['id',_0xe9f8('0x31'),_0xe9f8('0x5b')],'raw':!![]})[_0xe9f8('0x4e')](function(_0x3efd07){_0x519862=_[_0xe9f8('0x5c')](_0x3efd07,'id');var _0x15df43={'type':db[_0xe9f8('0x5d')]['QueryTypes'][_0xe9f8('0x5e')],'model':db[_0xe9f8('0x5f')],'mapToModel':!![],'nest':!![],'raw':!![]};return db['sequelize']['query'](_0x115fc3[_0xe9f8('0x60')](),_0x15df43);})['then'](function(_0x2563c1){_0x2563c1[_0xe9f8('0x1e')](function(_0x37a656){if(_0x37a656[_0xe9f8('0x1b')]){_0x37a656[_0xe9f8('0x61')]=[];_0x37a656[_0xe9f8('0x1b')][_0xe9f8('0x62')](',')[_0xe9f8('0x1e')](function(_0x19ab43){_0x37a656[_0xe9f8('0x61')][_0xe9f8('0x1d')](_0x519862[_0x19ab43]);});}delete _0x37a656[_0xe9f8('0x1b')];});return _0x2563c1;});}function countFilteredContacts(_0x539a1c,_0x38d2f8){var _0x598458=_0x539a1c[_0xe9f8('0x63')]();_0x598458[_0xe9f8('0x1f')](_0xe9f8('0x64'));_0x598458=applyJoinClauses(_0x598458,!![]);_0x539a1c[_0xe9f8('0x53')](_0xe9f8('0x54'));var _0x32f535=utils[_0xe9f8('0x22')](_0x38d2f8);if(!_[_0xe9f8('0x65')](_0x32f535)){_0x598458[_0xe9f8('0xd')](_0xe9f8('0x66'),_0x32f535);}var _0x40741e={'type':db[_0xe9f8('0x5d')]['QueryTypes'][_0xe9f8('0x5e')],'raw':!![]};return db[_0xe9f8('0x67')]['query'](_0x598458[_0xe9f8('0x60')](),_0x40741e)['then'](function(_0x5b8f6d){return _0x5b8f6d[0x0][_0xe9f8('0x64')];});}module[_0xe9f8('0x68')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file +var _0xd33d=['CmContact','sequelize','query','toString','Tags','isEmpty','where','t.id\x20IN\x20?','squel','../parsers/advancedSearch','../parsers/qs','../../mysqldb','role','search','ListId','autocomplete','true','select','from','cm_contacts','subqry','left_join','cm_user_has_contacts','ct.CmContactId\x20=\x20','.id','tools_tags','t.id\x20=\x20ct.TagId','firstName','phone','mobile','fax','email','CompanyId','createdAt','deletedAt','TagIds','includes','push','field','expr','getSelectedTags','forEach','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.id\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.email\x20LIKE\x20?','parseSearch','conditions','find','name','fieldType','datetime','castTo','DATE','buildExpression','text','value','Tag','map','tags','and','User','user','clause','skip','compact','Contact','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','uc.UserId\x20=\x20?','\x20=\x20?','then','fields','tag','filter','resolve','agent','attributes','c.id','limit','offset','group','having','order','subqry.','findAll','color','Sequelize','QueryTypes','SELECT'];(function(_0x5f1d55,_0xb135f4){var _0x25a0ee=function(_0x3ca9ff){while(--_0x3ca9ff){_0x5f1d55['push'](_0x5f1d55['shift']());}};_0x25a0ee(++_0xb135f4);}(_0xd33d,0x137));var _0xdd33=function(_0x938a9f,_0x5c88b6){_0x938a9f=_0x938a9f-0x0;var _0x3cefe1=_0xd33d[_0x938a9f];return _0x3cefe1;};'use strict';var _=require('lodash');var squel=require(_0xdd33('0x0'));var as=require(_0xdd33('0x1'));var qs=require(_0xdd33('0x2'));var utils=require('../interaction/utils');var db=require(_0xdd33('0x3'))['db'];function skipContactsQuery(_0x48bb09,_0x5d154e){var _0x3c6d78=![];if(_0x48bb09[_0xdd33('0x4')]==='agent'&&!_0x5d154e[_0xdd33('0x5')]&&!_0x5d154e[_0xdd33('0x6')]&&_0x5d154e[_0xdd33('0x7')]!==_0xdd33('0x8')){_0x3c6d78=!![];}return _0x3c6d78;}function getContactsSubquery(){return squel[_0xdd33('0x9')]()[_0xdd33('0xa')](_0xdd33('0xb'),'c')['where']('c.deletedAt\x20IS\x20NULL');}function applyJoinClauses(_0x4361bc,_0x52e667){var _0x4ff438=_0x52e667?'c':_0xdd33('0xc');_0x4361bc[_0xdd33('0xd')](_0xdd33('0xe'),'uc','uc.CmContactId\x20=\x20'+_0x4ff438+'.id')[_0xdd33('0xd')]('cm_contact_has_tags','ct',_0xdd33('0xf')+_0x4ff438+_0xdd33('0x10'))[_0xdd33('0xd')](_0xdd33('0x11'),'t',_0xdd33('0x12'));return _0x4361bc;}function addFieldsToQuery(_0x184f49,_0x48a34e,_0x1449da,_0x205368,_0x34100c){var _0x1f8053=_0x34100c?'c':_0xdd33('0xc');if(!_0x48a34e){_0x48a34e=['id',_0xdd33('0x13'),'lastName',_0xdd33('0x14'),_0xdd33('0x15'),_0xdd33('0x16'),_0xdd33('0x17'),'ListId',_0xdd33('0x18'),_0xdd33('0x19'),'updatedAt',_0xdd33('0x1a'),_0xdd33('0x1b')];}else if(!_0x48a34e[_0xdd33('0x1c')]('id')){_0x48a34e[_0xdd33('0x1d')]('id');}var _0xd34734=_0x1449da&&_0x34100c||!_0x1449da&&!_0x34100c;if(_0x205368){_0xd34734=_0x205368&&_0x34100c||!_0x205368&&!_0x34100c;}_0x48a34e['forEach'](function(_0x3c2096){if(_0x3c2096===_0xdd33('0x1b')){if(_0xd34734){_0x184f49[_0xdd33('0x1e')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x3c2096);}else if(_0x1449da||_0x205368){_0x184f49[_0xdd33('0x1e')](_0x1f8053+'.'+_0x3c2096);}}else{_0x184f49[_0xdd33('0x1e')](_0x1f8053+'.'+_0x3c2096);}});return _0x184f49;}function getSqlClauses(){var _0x3c8e01={'default':squel[_0xdd33('0x1f')](),'fields':squel['expr'](),'filter':squel['expr'](),'tags':{'clause':squel[_0xdd33('0x1f')](),'ids':null},'user':{'clause':squel[_0xdd33('0x1f')](),'skip':![]}};return _0x3c8e01;}function parseTagParameter(_0x33600c){var _0x3d7048=squel[_0xdd33('0x1f')]();if(_0x33600c){var _0xedac03=utils[_0xdd33('0x20')](_0x33600c);_0xedac03[_0xdd33('0x21')](function(_0xdc70a6){_0x3d7048['or'](_0xdd33('0x22'),'%,'+_0xdc70a6+',%');});}return _0x3d7048;}function parseSearchFilter(_0x89ab75){var _0x1f7e1f=squel[_0xdd33('0x1f')]();if(_0x89ab75){var _0x248729=_0x89ab75['replace']('\x5c','\x5c\x5c')[_0xdd33('0x23')](/'/g,'\x27\x27');if(_0x248729[_0xdd33('0x24')]('\x20')[_0xdd33('0x25')]>0x1){_0x1f7e1f['or'](_0xdd33('0x26'),qs[_0xdd33('0x27')](_0x248729,!![]),null);}else{if(qs[_0xdd33('0x28')](_0x248729)){_0x1f7e1f['or'](_0xdd33('0x29'),_0x248729+'%');_0x1f7e1f['or']('c.phone\x20LIKE\x20?',_0x248729+'%');_0x1f7e1f['or'](_0xdd33('0x2a'),_0x248729+'%');_0x1f7e1f['or'](_0xdd33('0x2b'),_0x248729+'%');}else if(qs[_0xdd33('0x2c')](_0x248729)){_0x1f7e1f['or']('c.email\x20LIKE\x20?',_0x248729+'%');}else{_0x1f7e1f['or'](_0xdd33('0x2d'),'%'+_0x248729+'%');_0x1f7e1f['or'](_0xdd33('0x2e'),'%'+_0x248729+'%');_0x1f7e1f['or'](_0xdd33('0x2f'),'%'+_0x248729+'%');}}}return _0x1f7e1f;}function parseAdvancedSearchFilter(_0x38e4d9,_0x29985b){var _0x4c6dce=getSqlClauses();var _0x1b6d33=as[_0xdd33('0x30')](_0x38e4d9);var _0x531770=_0x1b6d33['sqlOperator'];for(var _0x439472=0x0;_0x439472<_0x1b6d33[_0xdd33('0x31')]['length'];_0x439472++){var _0x471ebe=_0x1b6d33[_0xdd33('0x31')][_0x439472];var _0x38d7a5='c';var _0x1725b8=_[_0xdd33('0x32')](_0x29985b,[_0xdd33('0x33'),_0x471ebe[_0xdd33('0x1e')]]);if(_0x1725b8){if(_0x471ebe[_0xdd33('0x1e')]==='dateOfBirth'||_0x1725b8[_0xdd33('0x34')]===_0xdd33('0x35')){_0x471ebe[_0xdd33('0x36')]=_0xdd33('0x37');}var _0x92d092=as[_0xdd33('0x38')](_0x38d7a5,_0x1725b8['type'],_0x471ebe);_0x4c6dce['default'][_0x531770](_0x92d092[_0xdd33('0x39')],_0x92d092[_0xdd33('0x3a')]['start'],_0x92d092[_0xdd33('0x3a')]['end']);}else{if(_0x471ebe[_0xdd33('0x1e')]===_0xdd33('0x3b')){var _0x5eb6b8=_0x471ebe[_0xdd33('0x3a')][_0xdd33('0x24')](',')[_0xdd33('0x3c')](function(_0x15cdad){return Number(_0x15cdad);});var _0x440a8a=parseTagParameter(_0x5eb6b8);_0x4c6dce[_0xdd33('0x3d')]['clause'][_0xdd33('0x3e')](_0x440a8a);_0x4c6dce[_0xdd33('0x3d')]['ids']=_0x5eb6b8;}else if(_0x471ebe['field']===_0xdd33('0x3f')){_0x4c6dce[_0xdd33('0x40')][_0xdd33('0x41')]['and']('uc.UserId\x20=\x20?',_0x471ebe[_0xdd33('0x3a')]);_0x4c6dce[_0xdd33('0x40')][_0xdd33('0x42')]=!![];}}}return _0x4c6dce;}function parseModelFields(_0xb7dd8e,_0x5383b7){var _0x5b7ad1=squel[_0xdd33('0x1f')]();var _0x44c162=_(_0xb7dd8e)['keys']()[_0xdd33('0x3c')](function(_0x191e43){return _['some'](_0x5383b7,[_0xdd33('0x33'),_0x191e43])?_0x191e43:undefined;})[_0xdd33('0x43')]()[_0xdd33('0x3a')]();if(_0xb7dd8e[_0xdd33('0x44')]){_0x44c162[_0xdd33('0x1d')](_0xdd33('0x44'));}if(_0xb7dd8e[_0xdd33('0x3f')]){_0x44c162[_0xdd33('0x1d')](_0xdd33('0x3f'));}if(_0x44c162[_0xdd33('0x25')]>0x0){_0x44c162[_0xdd33('0x21')](function(_0x3038d2){if(_0x3038d2==='ListId'){_0x5b7ad1['and'](_0xdd33('0x45'),[][_0xdd33('0x46')](_0xb7dd8e[_0x3038d2]));}else if(_0x3038d2===_0xdd33('0x44')){var _0x140107='%'+_0xb7dd8e[_0x3038d2]+'%';_0x5b7ad1['and'](_0xdd33('0x47'),_0x140107);}else if(_0x3038d2===_0xdd33('0x3f')){_0x5b7ad1[_0xdd33('0x3e')](_0xdd33('0x48'),_0xb7dd8e[_0x3038d2]);}else{_0x5b7ad1['and']('c.'+_0x3038d2+_0xdd33('0x49'),_0xb7dd8e[_0x3038d2]);}});}return _0x5b7ad1;}function parseQueryParameters(_0x4fe931,_0x5c6092){var _0x272d20=getSqlClauses();return Promise['resolve']()[_0xdd33('0x4a')](function(){return parseModelFields(_0x4fe931,_0x5c6092);})[_0xdd33('0x4a')](function(_0x18a463){_0x272d20[_0xdd33('0x4b')][_0xdd33('0x3e')](_0x18a463);return parseTagParameter(_0x4fe931[_0xdd33('0x4c')]);})[_0xdd33('0x4a')](function(_0x1fa34a){_0x272d20[_0xdd33('0x3d')][_0xdd33('0x41')][_0xdd33('0x3e')](_0x1fa34a);return parseSearchFilter(_0x4fe931['filter']);})[_0xdd33('0x4a')](function(_0x1273e4){_0x272d20[_0xdd33('0x4d')]=_0x1273e4;return _0x272d20;});}function checkListsRestrictions(_0x46216f,_0x4b3244,_0x3e586c){var _0x11409f=squel[_0xdd33('0x1f')]();return Promise[_0xdd33('0x4e')]()[_0xdd33('0x4a')](function(){if(_0x4b3244[_0xdd33('0x5')]&&_0x46216f[_0xdd33('0x4')]===_0xdd33('0x4f')&&!_0x3e586c){return _0x46216f['getLists']({'attributes':['id'],'raw':!![]});}})['then'](function(_0x4f9dfe){if(_0x4f9dfe){if(_0x4f9dfe['length']===0x0){_0x11409f[_0xdd33('0x3e')]('c.ListId\x20IS\x20NULL');}else{_0x11409f[_0xdd33('0x3e')](_0xdd33('0x45'),_[_0xdd33('0x3c')](_0x4f9dfe,'id'));}}})[_0xdd33('0x4a')](function(){return _0x11409f;});}function buildContactsQuery(_0x3e64af,_0x1f1687,_0x19a820,_0x8c0d9e,_0x48536e,_0x5bb35c){if(_0x1f1687){_0x1f1687=_0x19a820[_0xdd33('0x50')];}_0x3e64af=addFieldsToQuery(_0x3e64af,_0x1f1687,_0x8c0d9e,_0x5bb35c,!![]);var _0xd2dda2=squel['select']();_0xd2dda2=addFieldsToQuery(_0xd2dda2,_0x1f1687,_0x8c0d9e,_0x5bb35c,![]);if(_0x8c0d9e||_0x5bb35c){_0x3e64af=applyJoinClauses(_0x3e64af,!![]);_0x3e64af['group'](_0xdd33('0x51'));if(_0x19a820['limit']){_0xd2dda2[_0xdd33('0x52')](_0x19a820[_0xdd33('0x52')]);}if(_0x19a820[_0xdd33('0x53')]){_0xd2dda2['offset'](_0x19a820[_0xdd33('0x53')]);}}else{_0xd2dda2=applyJoinClauses(_0xd2dda2,![]);_0xd2dda2[_0xdd33('0x54')]('subqry.id');if(_0x19a820['limit']){_0x3e64af[_0xdd33('0x52')](_0x19a820[_0xdd33('0x52')]);}if(_0x19a820['offset']){_0x3e64af['offset'](_0x19a820[_0xdd33('0x53')]);}}_0xd2dda2[_0xdd33('0x55')](_0x48536e);if(_0x19a820[_0xdd33('0x56')]){_0x19a820[_0xdd33('0x56')][_0xdd33('0x21')](function(_0x116f6b){_0x3e64af[_0xdd33('0x56')]('c.'+_0x116f6b[0x0],_0x116f6b[0x1]==='DESC'?![]:!![]);_0xd2dda2[_0xdd33('0x56')](_0xdd33('0x57')+_0x116f6b[0x0],_0x116f6b[0x1]==='DESC'?![]:!![]);});}_0xd2dda2[_0xdd33('0xa')](_0x3e64af,_0xdd33('0xc'));return _0xd2dda2;}function getFilteredContacts(_0x1f7144){var _0x1263a0=[];return db['Tag'][_0xdd33('0x58')]({'attributes':['id',_0xdd33('0x33'),_0xdd33('0x59')],'raw':!![]})['then'](function(_0x30578f){_0x1263a0=_['keyBy'](_0x30578f,'id');var _0x13449e={'type':db[_0xdd33('0x5a')][_0xdd33('0x5b')][_0xdd33('0x5c')],'model':db[_0xdd33('0x5d')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0xdd33('0x5e')][_0xdd33('0x5f')](_0x1f7144[_0xdd33('0x60')](),_0x13449e);})[_0xdd33('0x4a')](function(_0x82b6ca){_0x82b6ca[_0xdd33('0x21')](function(_0x45d87e){if(_0x45d87e['TagIds']){_0x45d87e[_0xdd33('0x61')]=[];_0x45d87e[_0xdd33('0x1b')][_0xdd33('0x24')](',')[_0xdd33('0x21')](function(_0x267e18){_0x45d87e[_0xdd33('0x61')][_0xdd33('0x1d')](_0x1263a0[_0x267e18]);});}delete _0x45d87e['TagIds'];});return _0x82b6ca;});}function countFilteredContacts(_0x7cfd6a,_0x664af6){var _0xfe07b8=_0x7cfd6a['clone']();_0xfe07b8[_0xdd33('0x1e')]('COUNT(*)');_0xfe07b8=applyJoinClauses(_0xfe07b8,!![]);_0x7cfd6a[_0xdd33('0x54')](_0xdd33('0x51'));var _0x4421ee=utils['getSelectedTags'](_0x664af6);if(!_[_0xdd33('0x62')](_0x4421ee)){_0xfe07b8[_0xdd33('0x63')](_0xdd33('0x64'),_0x4421ee);}var _0x91dc90={'type':db[_0xdd33('0x5a')][_0xdd33('0x5b')]['SELECT'],'raw':!![]};return db['sequelize'][_0xdd33('0x5f')](_0xfe07b8[_0xdd33('0x60')](),_0x91dc90)[_0xdd33('0x4a')](function(_0xf6cb88){return _0xf6cb88[0x0]['COUNT(*)'];});}module['exports']={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 3fb6a73..f0b03f7 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 _0xcede=['unlink','createDecipher','encryptString','secret','createCipher','utf8','base64','final','decryptString','../../config/environment','../../config/logger','app','aes-256-ctr','aes192','encrypt','algorithm','join','error','test','getCiphers','filter','indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream','data','update','binary','write','end','close'];(function(_0x2012a3,_0x38f26f){var _0x28d4c5=function(_0x39b6c0){while(--_0x39b6c0){_0x2012a3['push'](_0x2012a3['shift']());}};_0x28d4c5(++_0x38f26f);}(_0xcede,0xc9));var _0xeced=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xcede[_0x6131cd];return _0x47e916;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require('bluebird');var _=require('lodash');var config=require(_0xeced('0x0'));var logger=require(_0xeced('0x1'))(_0xeced('0x2'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets']['session'],'algorithm':_0xeced('0x3')};const fileOptions={'algorithm':_0xeced('0x4')};if(config[_0xeced('0x5')]&&config['encrypt'][_0xeced('0x6')]){var isSupported=isAlgorithmSupported(config[_0xeced('0x5')][_0xeced('0x6')]);if(isSupported){fileOptions[_0xeced('0x6')]=config['encrypt']['algorithm'];}else{var supportedAlgorithms=getSupportedCiphers()[_0xeced('0x7')](',\x20');logger[_0xeced('0x8')](config[_0xeced('0x5')][_0xeced('0x6')],'is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:',supportedAlgorithms);}}function isASupportedCipher(_0x1d1a92){return AES_SUPPORTED_RX[_0xeced('0x9')](_0x1d1a92);}function getSupportedCiphers(){return crypto[_0xeced('0xa')]()[_0xeced('0xb')](isASupportedCipher);}function isAlgorithmSupported(_0x1ccb16){return getSupportedCiphers()[_0xeced('0xc')](_0x1ccb16)>-0x1;}function combineOptions(_0x59a1c3){var _0x4f2859={};for(var _0x356f94 in fileOptions){if(fileOptions['hasOwnProperty'](_0x356f94)){_0x4f2859[_0x356f94]=fileOptions[_0x356f94];}}if(_0x59a1c3){for(var _0x124d76 in _0x59a1c3){if(_0x59a1c3[_0xeced('0xd')](_0x124d76)){_0x4f2859[_0x124d76]=_0x59a1c3[_0x124d76];}}}return _0x4f2859;}exports[_0xeced('0xe')]=function(_0x308b93,_0x3287d4,_0x26c278,_0x4da463){return new BPromise(function(_0x5a5449,_0x3b1992){_0x4da463=combineOptions(_0x4da463);var _0x1935e6=new Buffer(_0x26c278);var _0x669d44=fs[_0xeced('0xf')](_0x308b93);var _0x1a3a05=fs[_0xeced('0x10')](_0x3287d4);var _0x12192f=crypto['createCipher'](_0x4da463[_0xeced('0x6')],_0x1935e6);_0x669d44['on'](_0xeced('0x11'),function(_0x57dbeb){var _0x5cefc5=new Buffer(_0x12192f[_0xeced('0x12')](_0x57dbeb),_0xeced('0x13'));_0x1a3a05[_0xeced('0x14')](_0x5cefc5);});_0x669d44['on'](_0xeced('0x15'),function(){try{var _0x1d56b7=new Buffer(_0x12192f['final'](_0xeced('0x13')),'binary');_0x1a3a05['write'](_0x1d56b7);_0x1a3a05[_0xeced('0x15')]();_0x1a3a05['on'](_0xeced('0x16'),function(){return _0x5a5449(_0x3287d4);});}catch(_0x90d9f9){fs[_0xeced('0x17')](_0x3287d4);return _0x3b1992(_0x90d9f9);}});});};exports['decryptFile']=function(_0x3062ae,_0x5bc59a,_0x10939a,_0x3d6385){return new BPromise(function(_0x44701e,_0x1edb2b){_0x3d6385=combineOptions(_0x3d6385);var _0xf9e55e=new Buffer(_0x10939a);var _0x13f70f=fs[_0xeced('0xf')](_0x3062ae);var _0x44e52b=fs['createWriteStream'](_0x5bc59a);var _0x17ff27=crypto[_0xeced('0x18')](_0x3d6385[_0xeced('0x6')],_0xf9e55e);_0x13f70f['on']('data',function(_0x3ef3b4){var _0x5ee63c=new Buffer(_0x17ff27[_0xeced('0x12')](_0x3ef3b4),_0xeced('0x13'));_0x44e52b[_0xeced('0x14')](_0x5ee63c);});_0x13f70f['on'](_0xeced('0x15'),function(){try{var _0x284ac5=new Buffer(_0x17ff27['final'](_0xeced('0x13')),'binary');_0x44e52b[_0xeced('0x14')](_0x284ac5);_0x44e52b['end']();_0x44e52b['on'](_0xeced('0x16'),function(){return _0x44701e(_0x5bc59a);});}catch(_0x48afb1){fs['unlink'](_0x5bc59a);return _0x1edb2b(_0x48afb1);}});});};exports[_0xeced('0x19')]=function(_0x16a510,_0x5bc838,_0x488421){var _0x2f685b=_0x488421||stringOptions['algorithm'];var _0x3c203a=_0x5bc838||stringOptions[_0xeced('0x1a')];var _0xa0db67=crypto[_0xeced('0x1b')](_0x2f685b,_0x3c203a);var _0x3e3c5d=_0xa0db67[_0xeced('0x12')](_0x16a510,_0xeced('0x1c'),_0xeced('0x1d'));_0x3e3c5d+=_0xa0db67[_0xeced('0x1e')](_0xeced('0x1d'));return _0x3e3c5d;};exports[_0xeced('0x1f')]=function(_0x1bcace,_0xb87135,_0x1e1be3){var _0x1da863=_0x1e1be3||stringOptions['algorithm'];var _0xf00ad6=_0xb87135||stringOptions['secret'];var _0x4cee88=crypto[_0xeced('0x18')](_0x1da863,_0xf00ad6);var _0x4e5590=_0x4cee88['update'](_0x1bcace,_0xeced('0x1d'),'utf8');_0x4e5590+=_0x4cee88[_0xeced('0x1e')](_0xeced('0x1c'));return _0x4e5590;}; \ No newline at end of file +var _0x10fe=['decryptFile','createDecipher','encryptString','secret','utf8','base64','decryptString','crypto','bluebird','lodash','../../config/environment','../../config/logger','app','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','join','error','getCiphers','filter','indexOf','hasOwnProperty','createReadStream','createWriteStream','createCipher','data','update','final','binary','write','end','close','unlink'];(function(_0x16b66e,_0x9eb55e){var _0x15013a=function(_0x57e70e){while(--_0x57e70e){_0x16b66e['push'](_0x16b66e['shift']());}};_0x15013a(++_0x9eb55e);}(_0x10fe,0xdf));var _0xe10f=function(_0x48d82b,_0x162f2c){_0x48d82b=_0x48d82b-0x0;var _0x3d88f5=_0x10fe[_0x48d82b];return _0x3d88f5;};'use strict';var crypto=require(_0xe10f('0x0'));var fs=require('fs');var BPromise=require(_0xe10f('0x1'));var _=require(_0xe10f('0x2'));var config=require(_0xe10f('0x3'));var logger=require(_0xe10f('0x4'))(_0xe10f('0x5'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0xe10f('0x6')][_0xe10f('0x7')],'algorithm':_0xe10f('0x8')};const fileOptions={'algorithm':_0xe10f('0x9')};if(config[_0xe10f('0xa')]&&config[_0xe10f('0xa')]['algorithm']){var isSupported=isAlgorithmSupported(config[_0xe10f('0xa')][_0xe10f('0xb')]);if(isSupported){fileOptions[_0xe10f('0xb')]=config['encrypt'][_0xe10f('0xb')];}else{var supportedAlgorithms=getSupportedCiphers()[_0xe10f('0xc')](',\x20');logger[_0xe10f('0xd')](config[_0xe10f('0xa')][_0xe10f('0xb')],'is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:',supportedAlgorithms);}}function isASupportedCipher(_0x196207){return AES_SUPPORTED_RX['test'](_0x196207);}function getSupportedCiphers(){return crypto[_0xe10f('0xe')]()[_0xe10f('0xf')](isASupportedCipher);}function isAlgorithmSupported(_0x1a964b){return getSupportedCiphers()[_0xe10f('0x10')](_0x1a964b)>-0x1;}function combineOptions(_0x5e08e5){var _0x56ce37={};for(var _0x326866 in fileOptions){if(fileOptions['hasOwnProperty'](_0x326866)){_0x56ce37[_0x326866]=fileOptions[_0x326866];}}if(_0x5e08e5){for(var _0x4d71e1 in _0x5e08e5){if(_0x5e08e5[_0xe10f('0x11')](_0x4d71e1)){_0x56ce37[_0x4d71e1]=_0x5e08e5[_0x4d71e1];}}}return _0x56ce37;}exports['encryptFile']=function(_0x275f71,_0x85f2ce,_0x5b5eef,_0x48cb6f){return new BPromise(function(_0x325a72,_0x2b1d25){_0x48cb6f=combineOptions(_0x48cb6f);var _0x18ce6b=new Buffer(_0x5b5eef);var _0x5a1e49=fs[_0xe10f('0x12')](_0x275f71);var _0x40fb1f=fs[_0xe10f('0x13')](_0x85f2ce);var _0xfbe287=crypto[_0xe10f('0x14')](_0x48cb6f[_0xe10f('0xb')],_0x18ce6b);_0x5a1e49['on'](_0xe10f('0x15'),function(_0x1b7947){var _0x5a1d79=new Buffer(_0xfbe287[_0xe10f('0x16')](_0x1b7947),'binary');_0x40fb1f['write'](_0x5a1d79);});_0x5a1e49['on']('end',function(){try{var _0xefd604=new Buffer(_0xfbe287[_0xe10f('0x17')](_0xe10f('0x18')),_0xe10f('0x18'));_0x40fb1f[_0xe10f('0x19')](_0xefd604);_0x40fb1f[_0xe10f('0x1a')]();_0x40fb1f['on'](_0xe10f('0x1b'),function(){return _0x325a72(_0x85f2ce);});}catch(_0x3bccb6){fs[_0xe10f('0x1c')](_0x85f2ce);return _0x2b1d25(_0x3bccb6);}});});};exports[_0xe10f('0x1d')]=function(_0x892ea2,_0xdd3e2e,_0x14b8cb,_0x1f2c8a){return new BPromise(function(_0x1bb480,_0x7333ac){_0x1f2c8a=combineOptions(_0x1f2c8a);var _0x5055a1=new Buffer(_0x14b8cb);var _0x167f63=fs[_0xe10f('0x12')](_0x892ea2);var _0x1ec09f=fs[_0xe10f('0x13')](_0xdd3e2e);var _0x3aa681=crypto[_0xe10f('0x1e')](_0x1f2c8a[_0xe10f('0xb')],_0x5055a1);_0x167f63['on'](_0xe10f('0x15'),function(_0x3abc9a){var _0x2b09d3=new Buffer(_0x3aa681[_0xe10f('0x16')](_0x3abc9a),'binary');_0x1ec09f[_0xe10f('0x19')](_0x2b09d3);});_0x167f63['on'](_0xe10f('0x1a'),function(){try{var _0x20234a=new Buffer(_0x3aa681['final']('binary'),_0xe10f('0x18'));_0x1ec09f[_0xe10f('0x19')](_0x20234a);_0x1ec09f[_0xe10f('0x1a')]();_0x1ec09f['on']('close',function(){return _0x1bb480(_0xdd3e2e);});}catch(_0x720e45){fs[_0xe10f('0x1c')](_0xdd3e2e);return _0x7333ac(_0x720e45);}});});};exports[_0xe10f('0x1f')]=function(_0x231947,_0x73bea5,_0x35db3f){var _0xd53776=_0x35db3f||stringOptions[_0xe10f('0xb')];var _0x1a6a6b=_0x73bea5||stringOptions[_0xe10f('0x20')];var _0x3f1738=crypto[_0xe10f('0x14')](_0xd53776,_0x1a6a6b);var _0x55afa=_0x3f1738[_0xe10f('0x16')](_0x231947,_0xe10f('0x21'),_0xe10f('0x22'));_0x55afa+=_0x3f1738[_0xe10f('0x17')](_0xe10f('0x22'));return _0x55afa;};exports[_0xe10f('0x23')]=function(_0x11032a,_0x56b4bd,_0x4ffe6f){var _0xe09c5=_0x4ffe6f||stringOptions[_0xe10f('0xb')];var _0x78948f=_0x56b4bd||stringOptions[_0xe10f('0x20')];var _0x4508fd=crypto[_0xe10f('0x1e')](_0xe09c5,_0x78948f);var _0x3ec92f=_0x4508fd['update'](_0x11032a,_0xe10f('0x22'),_0xe10f('0x21'));_0x3ec92f+=_0x4508fd[_0xe10f('0x17')](_0xe10f('0x21'));return _0x3ec92f;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 20b6c72..0b74aa9 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 _0xa0d2=['.csv','existsSync','join','each','%s%d.%s','csv','%s.%s','writeFileSync','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','finally','util','path','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','split','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','length','range','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname'];(function(_0x222bf8,_0x3283a5){var _0xd6fa69=function(_0x253dd2){while(--_0x253dd2){_0x222bf8['push'](_0x222bf8['shift']());}};_0xd6fa69(++_0x3283a5);}(_0xa0d2,0x1dc));var _0x2a0d=function(_0x784e2e,_0x823425){_0x784e2e=_0x784e2e-0x0;var _0x30e40a=_0xa0d2[_0x784e2e];return _0x30e40a;};'use strict';var util=require(_0x2a0d('0x0'));var path=require(_0x2a0d('0x1'));var _=require('lodash');var csv=require(_0x2a0d('0x2'));var fs=require('fs');var BPromise=require(_0x2a0d('0x3'));var zipdir=require(_0x2a0d('0x4'));var rimraf=require(_0x2a0d('0x5'));var db=require(_0x2a0d('0x6'))['db'];var dbH=require(_0x2a0d('0x6'))[_0x2a0d('0x7')];var logger=require(_0x2a0d('0x8'))(_0x2a0d('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0x2a0d('0xa')][0x2]);var QUERY=process[_0x2a0d('0xa')][0x3];var PATH=process[_0x2a0d('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x5c2a96,_0x2365a5){var _0x397739={'status':_0x5c2a96};var _0x46ab90={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2365a5){_0x397739[_0x2a0d('0xb')]=_0x2365a5;}return db[_0x2a0d('0xc')]['update'](_0x397739,_0x46ab90);}function main(){var _0x41fe92=0x1388;var _0x2482e2;logger[_0x2a0d('0xd')](util[_0x2a0d('0xe')](_0x2a0d('0xf'),EXTRACTED_REPORT_ID,'CSV'));return db[_0x2a0d('0x10')][_0x2a0d('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x2a0d('0x12'),'splitSizeCsv']})[_0x2a0d('0x13')](function(_0x1ee0f1){if(_0x1ee0f1){_0x2482e2=_0x1ee0f1;_0x41fe92=_0x2482e2['splitSizeCsv']||0x1388;}})[_0x2a0d('0x13')](function(){return dbH[_0x2a0d('0x14')][_0x2a0d('0x15')](util[_0x2a0d('0xe')](_0x2a0d('0x16'),QUERY),{'type':dbH[_0x2a0d('0x14')][_0x2a0d('0x17')][_0x2a0d('0x18')]});})[_0x2a0d('0x13')](function(_0x14292d){if(!_0x14292d[0x0][_0x2a0d('0x19')]){return analyticExtractedReport(_0x2a0d('0x1a'));}var _0x37573b=[];var _0x34ae68=0x0;if(_0x2482e2['split']){if(_0x14292d&&_0x14292d[_0x2a0d('0x1b')]){var _0xcd0368=_[_0x2a0d('0x1c')](_0x14292d[0x0]['num']/_0x41fe92);var _0x44241d=Number[_0x2a0d('0x1d')](_0x14292d[0x0][_0x2a0d('0x19')]/_0x41fe92)?_0x14292d[0x0][_0x2a0d('0x19')]%_0x41fe92:0x0;_0xcd0368[_0x2a0d('0x1e')](function(_0x427657){if(_0x427657>0x0){_0x34ae68+=_0x41fe92;}_0x37573b[_0x2a0d('0x1f')](dbH['sequelize']['query'](util[_0x2a0d('0xe')](_0x2a0d('0x20'),QUERY,_0x41fe92,_0x34ae68),{'type':dbH[_0x2a0d('0x14')]['QueryTypes']['SELECT']}));});if(_0x44241d>0x0){_0x34ae68+=_0x41fe92;_0x37573b[_0x2a0d('0x1f')](dbH['sequelize']['query'](util[_0x2a0d('0xe')](_0x2a0d('0x20'),QUERY,_0x44241d,_0x34ae68),{'type':dbH[_0x2a0d('0x14')][_0x2a0d('0x17')][_0x2a0d('0x18')]}));}}}else{_0x37573b[_0x2a0d('0x1f')](dbH['sequelize'][_0x2a0d('0x15')](QUERY,{'type':dbH['sequelize']['QueryTypes']['SELECT']}));}var _0x429eee=path[_0x2a0d('0x21')](PATH);var _0x193ba2=path['basename'](PATH,_0x2a0d('0x22'));var _0x352738=_0x2482e2['split']&&_0x37573b['length']>0x1;var _0x3e7f5f=[];if(!fs[_0x2a0d('0x23')](path['join'](_0x429eee,_0x193ba2))&&_0x352738){fs['mkdirSync'](path[_0x2a0d('0x24')](_0x429eee,_0x193ba2));}return BPromise[_0x2a0d('0x25')](_0x37573b,function(_0x1713fe){_0x3e7f5f[_0x2a0d('0x1f')](_0x1713fe);})['then'](function(){for(var _0x572f8a=0x0;_0x572f8a<_0x3e7f5f[_0x2a0d('0x1b')];_0x572f8a+=0x1){var _0x1eaff4;var _0x9325b0=_0x3e7f5f[_0x572f8a];if(_0x352738){_0x1eaff4=path['join'](_0x429eee,_0x193ba2,util[_0x2a0d('0xe')](_0x2a0d('0x26'),_0x193ba2,_0x572f8a,_0x2a0d('0x27')));}else{_0x1eaff4=path[_0x2a0d('0x24')](_0x429eee,util['format'](_0x2a0d('0x28'),_0x193ba2,'csv'));}fs[_0x2a0d('0x29')](_0x1eaff4,csv(_0x9325b0));}})[_0x2a0d('0x13')](function(){if(_0x352738){return new Promise(function(_0x418ba5){zipdir(path[_0x2a0d('0x24')](_0x429eee,_0x193ba2),{'saveTo':path['join'](_0x429eee,util[_0x2a0d('0xe')]('%s.%s',_0x193ba2,_0x2a0d('0x2a')))},function(_0x59b841,_0x34fc0c){rimraf(path['join'](_0x429eee,_0x193ba2),function(){});_0x418ba5(_0x2a0d('0x2b'));});});}})[_0x2a0d('0x13')](function(){logger['info'](util[_0x2a0d('0xe')](_0x2a0d('0x2c'),EXTRACTED_REPORT_ID,_0x2a0d('0x2d')));return analyticExtractedReport(_0x2a0d('0x2e'),_0x352738?util[_0x2a0d('0xe')](_0x2a0d('0x28'),_0x193ba2,_0x352738?_0x2a0d('0x2a'):_0x2a0d('0x27')):null);});})[_0x2a0d('0x2f')](function(_0x3abf92){logger[_0x2a0d('0xd')](util['format'](_0x2a0d('0x30'),EXTRACTED_REPORT_ID,_0x2a0d('0x2d')),util[_0x2a0d('0x31')](_0x3abf92,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x2a0d('0x32')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file +var _0x2e9b=['range','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','basename','.csv','existsSync','join','mkdirSync','each','%s%d.%s','csv','%s.%s','writeFileSync','zip','zip\x20finished','catch','inspect','Failed','path','lodash','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','format','CSV','Setting','find','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num','Empty','length'];(function(_0x55ffee,_0x1862c1){var _0x27992d=function(_0x3cd3d9){while(--_0x3cd3d9){_0x55ffee['push'](_0x55ffee['shift']());}};_0x27992d(++_0x1862c1);}(_0x2e9b,0x100));var _0xb2e9=function(_0x22f5cb,_0x3d77f1){_0x22f5cb=_0x22f5cb-0x0;var _0x5becb0=_0x2e9b[_0x22f5cb];return _0x5becb0;};'use strict';var util=require('util');var path=require(_0xb2e9('0x0'));var _=require(_0xb2e9('0x1'));var csv=require('to-csv');var fs=require('fs');var BPromise=require(_0xb2e9('0x2'));var zipdir=require('zip-dir');var rimraf=require('rimraf');var db=require(_0xb2e9('0x3'))['db'];var dbH=require(_0xb2e9('0x3'))[_0xb2e9('0x4')];var logger=require(_0xb2e9('0x5'))(_0xb2e9('0x6'));var EXTRACTED_REPORT_ID=Number(process[_0xb2e9('0x7')][0x2]);var QUERY=process[_0xb2e9('0x7')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0xf72e27,_0x2daf5c){var _0xc2a222={'status':_0xf72e27};var _0x5bcde4={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2daf5c){_0xc2a222[_0xb2e9('0x8')]=_0x2daf5c;}return db[_0xb2e9('0x9')][_0xb2e9('0xa')](_0xc2a222,_0x5bcde4);}function main(){var _0x42c312=0x1388;var _0x4c21b1;logger[_0xb2e9('0xb')](util[_0xb2e9('0xc')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xb2e9('0xd')));return db[_0xb2e9('0xe')][_0xb2e9('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xb2e9('0x10'),_0xb2e9('0x11')]})[_0xb2e9('0x12')](function(_0x12738c){if(_0x12738c){_0x4c21b1=_0x12738c;_0x42c312=_0x4c21b1[_0xb2e9('0x11')]||0x1388;}})['then'](function(){return dbH[_0xb2e9('0x13')][_0xb2e9('0x14')](util[_0xb2e9('0xc')](_0xb2e9('0x15'),QUERY),{'type':dbH[_0xb2e9('0x13')]['QueryTypes'][_0xb2e9('0x16')]});})[_0xb2e9('0x12')](function(_0x54b717){if(!_0x54b717[0x0][_0xb2e9('0x17')]){return analyticExtractedReport(_0xb2e9('0x18'));}var _0x1fb9f2=[];var _0x2aca38=0x0;if(_0x4c21b1['split']){if(_0x54b717&&_0x54b717[_0xb2e9('0x19')]){var _0x567db2=_[_0xb2e9('0x1a')](_0x54b717[0x0][_0xb2e9('0x17')]/_0x42c312);var _0x16f059=Number[_0xb2e9('0x1b')](_0x54b717[0x0][_0xb2e9('0x17')]/_0x42c312)?_0x54b717[0x0][_0xb2e9('0x17')]%_0x42c312:0x0;_0x567db2[_0xb2e9('0x1c')](function(_0x45bbf7){if(_0x45bbf7>0x0){_0x2aca38+=_0x42c312;}_0x1fb9f2[_0xb2e9('0x1d')](dbH[_0xb2e9('0x13')][_0xb2e9('0x14')](util['format'](_0xb2e9('0x1e'),QUERY,_0x42c312,_0x2aca38),{'type':dbH[_0xb2e9('0x13')][_0xb2e9('0x1f')]['SELECT']}));});if(_0x16f059>0x0){_0x2aca38+=_0x42c312;_0x1fb9f2[_0xb2e9('0x1d')](dbH[_0xb2e9('0x13')][_0xb2e9('0x14')](util[_0xb2e9('0xc')](_0xb2e9('0x1e'),QUERY,_0x16f059,_0x2aca38),{'type':dbH[_0xb2e9('0x13')][_0xb2e9('0x1f')]['SELECT']}));}}}else{_0x1fb9f2['push'](dbH[_0xb2e9('0x13')][_0xb2e9('0x14')](QUERY,{'type':dbH[_0xb2e9('0x13')][_0xb2e9('0x1f')][_0xb2e9('0x16')]}));}var _0x11d5c7=path['dirname'](PATH);var _0x178871=path[_0xb2e9('0x20')](PATH,_0xb2e9('0x21'));var _0x1c7464=_0x4c21b1[_0xb2e9('0x10')]&&_0x1fb9f2['length']>0x1;var _0x4f1769=[];if(!fs[_0xb2e9('0x22')](path[_0xb2e9('0x23')](_0x11d5c7,_0x178871))&&_0x1c7464){fs[_0xb2e9('0x24')](path[_0xb2e9('0x23')](_0x11d5c7,_0x178871));}return BPromise[_0xb2e9('0x25')](_0x1fb9f2,function(_0x281c49){_0x4f1769['push'](_0x281c49);})[_0xb2e9('0x12')](function(){for(var _0x4896d3=0x0;_0x4896d3<_0x4f1769[_0xb2e9('0x19')];_0x4896d3+=0x1){var _0x5765a9;var _0x38dc24=_0x4f1769[_0x4896d3];if(_0x1c7464){_0x5765a9=path[_0xb2e9('0x23')](_0x11d5c7,_0x178871,util['format'](_0xb2e9('0x26'),_0x178871,_0x4896d3,_0xb2e9('0x27')));}else{_0x5765a9=path['join'](_0x11d5c7,util[_0xb2e9('0xc')](_0xb2e9('0x28'),_0x178871,_0xb2e9('0x27')));}fs[_0xb2e9('0x29')](_0x5765a9,csv(_0x38dc24));}})[_0xb2e9('0x12')](function(){if(_0x1c7464){return new Promise(function(_0x2f9af6){zipdir(path[_0xb2e9('0x23')](_0x11d5c7,_0x178871),{'saveTo':path[_0xb2e9('0x23')](_0x11d5c7,util[_0xb2e9('0xc')](_0xb2e9('0x28'),_0x178871,_0xb2e9('0x2a')))},function(_0xbfc870,_0x3ca153){rimraf(path[_0xb2e9('0x23')](_0x11d5c7,_0x178871),function(){});_0x2f9af6(_0xb2e9('0x2b'));});});}})['then'](function(){logger[_0xb2e9('0xb')](util['format']('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xb2e9('0xd')));return analyticExtractedReport('Completed',_0x1c7464?util[_0xb2e9('0xc')](_0xb2e9('0x28'),_0x178871,_0x1c7464?_0xb2e9('0x2a'):_0xb2e9('0x27')):null);});})[_0xb2e9('0x2c')](function(_0x1e2cf2){logger[_0xb2e9('0xb')](util[_0xb2e9('0xc')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xb2e9('0xd')),util[_0xb2e9('0x2d')](_0x1e2cf2,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xb2e9('0x2e'));})['finally'](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 8d71afc..88efa78 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 _0x6c10=['Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','header','pageBreak','landscape','footer','Arial','black','right','num','Empty','Setting','split','splitSizePdf','then','range','%s\x20limit\x20%d\x20OFFSET\x20%d','sequelize','QueryTypes','SELECT','query','.pdf','existsSync','mkdirSync','join','createPdfKitDocument','%s%d.%s','pdf','%s.%s','all','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','exit','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','YYYY-MM-DD','center','Interaction\x20Transcript','pipe','createWriteStream','finish','util','path','moment','html-to-pdfmake','pdfmake/src/printer','rimraf','jsdom','JSDOM','bluebird','../../mysqldb','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','AnalyticExtractedReport','map','tableHeader','pick','toString','length','auto','body','concat','keys','forEach','push','format'];(function(_0x26bbdc,_0x3fd26d){var _0x150be2=function(_0x3a3185){while(--_0x3a3185){_0x26bbdc['push'](_0x26bbdc['shift']());}};_0x150be2(++_0x3fd26d);}(_0x6c10,0x1d7));var _0x06c1=function(_0x2a6d45,_0x3c9321){_0x2a6d45=_0x2a6d45-0x0;var _0x295253=_0x6c10[_0x2a6d45];return _0x295253;};'use strict';var _=require('lodash');var fs=require('fs');var util=require(_0x06c1('0x0'));var path=require(_0x06c1('0x1'));var moment=require(_0x06c1('0x2'));var htmlToPdfmake=require(_0x06c1('0x3'));var PdfPrinter=require(_0x06c1('0x4'));var zipdir=require('zip-dir');var rimraf=require(_0x06c1('0x5'));var JSDOM=require(_0x06c1('0x6'))[_0x06c1('0x7')];var window=new JSDOM('')['window'];var BPromise=require(_0x06c1('0x8'));var db=require(_0x06c1('0x9'))['db'];var dbH=require(_0x06c1('0x9'))['dbH'];var logger=require(_0x06c1('0xa'))(_0x06c1('0xb'));var EXTRACTED_REPORT_ID=Number(process[_0x06c1('0xc')][0x2]);var QUERY=process[_0x06c1('0xc')][0x3];var PATH=process[_0x06c1('0xc')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0x06c1('0xd');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x4bc60f,_0x408bb7){var _0x1fad43={'status':_0x4bc60f};var _0x151bce={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x408bb7){_0x1fad43['savename']=_0x408bb7;}return db[_0x06c1('0xe')]['update'](_0x1fad43,_0x151bce);}function getHeaders(_0x45524a){return _[_0x06c1('0xf')](_0x45524a,function(_0x44eefd){return{'text':_0x44eefd,'style':_0x06c1('0x10')};});}function getRows(_0x27de45,_0x5a2285){return _[_0x06c1('0xf')](_0x5a2285,function(_0x473f49){return _(_0x473f49)[_0x06c1('0x11')](_0x27de45)[_0x06c1('0xf')](function(_0x549290){return _0x549290?_[_0x06c1('0x12')](_0x549290):'';})['value']();});}function createTable(_0x3863b1,_0x3175de){var _0x16b564={'widths':_['fill'](Array(_0x3863b1[_0x06c1('0x13')]),0x91),'heights':function(_0x2da1be){return _0x2da1be===0x0?_0x06c1('0x14'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x5c08ca=getHeaders(_0x3863b1);_0x16b564[_0x06c1('0x15')]['push'](_0x5c08ca);var _0x50cdab=getRows(_0x3863b1,_0x3175de);_0x16b564[_0x06c1('0x15')]=_0x16b564[_0x06c1('0x15')][_0x06c1('0x16')](_0x50cdab);return _0x16b564;}function createTables(_0x53c537){var _0x248fa2=[];var _0x78ddb5=_['chunk'](Object[_0x06c1('0x17')](_0x53c537[0x0]),0x5);_0x78ddb5[_0x06c1('0x18')](function(_0x247870){_0x248fa2[_0x06c1('0x19')](createTable(_0x247870,_0x53c537));});return _0x248fa2;}function getPDFDocDefinition(_0x3e3e67){var _0x1de5c0=util[_0x06c1('0x1a')](_0x06c1('0x1b'),NAME,EXTRACTED_REPORT[_0x06c1('0x1c')],moment(EXTRACTED_REPORT[_0x06c1('0x1d')])[_0x06c1('0x1a')](FORMAT),moment(EXTRACTED_REPORT[_0x06c1('0x1e')])[_0x06c1('0x1a')](FORMAT));var _0x1cf945=[];for(var _0x497ce9=0x0;_0x497ce9<_0x3e3e67[_0x06c1('0x13')];_0x497ce9++){var _0x30e56e=[];if(_0x497ce9===0x0){_0x30e56e[_0x06c1('0x19')]({'text':_0x1de5c0,'style':_0x06c1('0x1f')});}var _0x306f25={'table':_0x3e3e67[_0x497ce9]};if(_0x497ce9>0x0){_0x306f25[_0x06c1('0x20')]='before';_0x306f25['margin']=[0x0,0x46,0x0,0x0];}_0x30e56e[_0x06c1('0x19')](_0x306f25);_0x1cf945[_0x06c1('0x19')](_0x30e56e);}return{'pageSize':'A4','pageOrientation':_0x06c1('0x21'),'content':_0x1cf945,'footer':function(_0x2525e9,_0x5ee203){return{'text':_0x2525e9[_0x06c1('0x12')]()+'\x20/\x20'+_0x5ee203,'style':_0x06c1('0x22')};},'defaultStyle':{'font':_0x06c1('0x23')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x06c1('0x24')},'footer':{'alignment':_0x06c1('0x25'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x43ef7e){var _0x43e94e=0x1388;var _0x54b42e;if(!_0x43ef7e[0x0][_0x06c1('0x26')]){return analyticExtractedReport(_0x06c1('0x27'));}return db[_0x06c1('0x28')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x06c1('0x29'),_0x06c1('0x2a')]})[_0x06c1('0x2b')](function(_0x32b6e1){if(_0x32b6e1){_0x54b42e=_0x32b6e1;_0x43e94e=_0x54b42e[_0x06c1('0x2a')]||0x3e8;}})[_0x06c1('0x2b')](function(){var _0x2d0e7e=[];var _0x3cb29e=0x0;if(_0x54b42e[_0x06c1('0x29')]){if(_0x43ef7e&&_0x43ef7e['length']){var _0x419a26=_[_0x06c1('0x2c')](_0x43ef7e[0x0][_0x06c1('0x26')]/_0x43e94e);var _0x18c7a8=Number['isInteger'](_0x43ef7e[0x0][_0x06c1('0x26')]/_0x43e94e)?_0x43ef7e[0x0][_0x06c1('0x26')]%_0x43e94e:0x0;_0x419a26[_0x06c1('0x18')](function(_0x519108){if(_0x519108>0x0){_0x3cb29e+=_0x43e94e;}_0x2d0e7e[_0x06c1('0x19')](dbH['sequelize']['query'](util[_0x06c1('0x1a')](_0x06c1('0x2d'),QUERY,_0x43e94e,_0x3cb29e),{'type':dbH[_0x06c1('0x2e')][_0x06c1('0x2f')][_0x06c1('0x30')]}));});if(_0x18c7a8>0x0){_0x3cb29e+=_0x43e94e;_0x2d0e7e['push'](dbH[_0x06c1('0x2e')]['query'](util[_0x06c1('0x1a')](_0x06c1('0x2d'),QUERY,_0x18c7a8,_0x3cb29e),{'type':dbH[_0x06c1('0x2e')][_0x06c1('0x2f')][_0x06c1('0x30')]}));}}}else{_0x2d0e7e['push'](dbH['sequelize'][_0x06c1('0x31')](QUERY,{'type':dbH[_0x06c1('0x2e')][_0x06c1('0x2f')][_0x06c1('0x30')]}));}var _0x114bd7=path['dirname'](PATH);var _0x1a66c=path['basename'](PATH,_0x06c1('0x32'));var _0x3466cd=_0x54b42e[_0x06c1('0x29')]&&_0x2d0e7e[_0x06c1('0x13')]>0x1;var _0x38955e=[];if(!fs[_0x06c1('0x33')](path['join'](_0x114bd7,_0x1a66c))&&_0x3466cd){fs[_0x06c1('0x34')](path[_0x06c1('0x35')](_0x114bd7,_0x1a66c));}return BPromise['each'](_0x2d0e7e,function(_0x47ec8c){_0x38955e[_0x06c1('0x19')](_0x47ec8c);})['then'](function(){var _0x246949=[];for(var _0x4bcc1e=0x0;_0x4bcc1e<_0x38955e['length'];_0x4bcc1e+=0x1){var _0x407f62=_0x38955e[_0x4bcc1e];var _0x165183=createTables(_['flatten'](_0x407f62));var _0x255ede;var _0x58861a=getPDFDocDefinition(_0x165183);var _0x546746=getPDFPrinter();var _0xc44434=_0x546746[_0x06c1('0x36')](_0x58861a);if(_0x3466cd){_0x255ede=path[_0x06c1('0x35')](_0x114bd7,_0x1a66c,util[_0x06c1('0x1a')](_0x06c1('0x37'),_0x1a66c,_0x4bcc1e,_0x06c1('0x38')));}else{_0x255ede=path[_0x06c1('0x35')](_0x114bd7,util[_0x06c1('0x1a')](_0x06c1('0x39'),_0x1a66c,'pdf'));}_0x246949[_0x06c1('0x19')](writePDFDocument(_0xc44434,_0x255ede));}return Promise[_0x06c1('0x3a')](_0x246949);})['then'](function(){if(_0x3466cd){return new Promise(function(_0x59cf4){zipdir(path['join'](_0x114bd7,_0x1a66c),{'saveTo':path[_0x06c1('0x35')](_0x114bd7,util[_0x06c1('0x1a')]('%s.%s',_0x1a66c,_0x06c1('0x3b')))},function(){rimraf(path[_0x06c1('0x35')](_0x114bd7,_0x1a66c),function(){});_0x59cf4(_0x06c1('0x3c'));});});}})[_0x06c1('0x2b')](function(){if(!_0x3466cd)return;rimraf(path[_0x06c1('0x35')](_0x114bd7,_0x1a66c),function(){});})['then'](function(){logger['info'](util['format'](_0x06c1('0x3d'),EXTRACTED_REPORT_ID,_0x06c1('0x3e')));return analyticExtractedReport(_0x06c1('0x3f'),_0x3466cd?util['format'](_0x06c1('0x39'),_0x1a66c,_0x3466cd?_0x06c1('0x3b'):_0x06c1('0x38')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x06c1('0x40')](util[_0x06c1('0x1a')](_0x06c1('0x41'),EXTRACTED_REPORT_ID,_0x06c1('0x3e')));return db[_0x06c1('0xe')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})[_0x06c1('0x2b')](function(_0x1efa94){EXTRACTED_REPORT=_0x1efa94;return dbH[_0x06c1('0x2e')][_0x06c1('0x31')](util[_0x06c1('0x1a')](_0x06c1('0x42'),QUERY),{'type':dbH[_0x06c1('0x2e')][_0x06c1('0x2f')][_0x06c1('0x30')]});})[_0x06c1('0x2b')](extractReport)[_0x06c1('0x43')](function(_0x436b8b){logger['info'](util[_0x06c1('0x1a')](_0x06c1('0x44'),EXTRACTED_REPORT_ID,_0x06c1('0x3e')),util[_0x06c1('0x45')](_0x436b8b,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x06c1('0x46'));})['finally'](function(){process[_0x06c1('0x47')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x50a1db=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+_0x06c1('0x48'),'italics':__dirname+_0x06c1('0x49'),'bolditalics':__dirname+_0x06c1('0x4a')}});return _0x50a1db;}function getPDFDocDefinitionFromHTML(_0x100d8d,_0x17a65a){var _0x3016db=util[_0x06c1('0x1a')](_0x06c1('0x4b'),_0x17a65a[_0x06c1('0x4c')],_0x17a65a['interactionId']);var _0xad1ed0=moment()[_0x06c1('0x1a')](_0x06c1('0x4d'))[_0x06c1('0x12')]();var _0x3e0304=htmlToPdfmake(_0x100d8d,{'window':window,'tableAutoSize':!![]});return{'content':[_0x3e0304],'defaultStyle':{'font':_0x06c1('0x23')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x06c1('0x4e'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x06c1('0x4e'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x06c1('0x4e')}},'header':function(){return[{'text':_0x06c1('0x4f'),'style':'header'}];},'footer':function(_0x48c0ea,_0x2df01c){return[{'text':util[_0x06c1('0x1a')]('\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s',_0x3016db,_0x48c0ea,_0x2df01c,_0xad1ed0),'style':_0x06c1('0x22')}];}};}function writePDFDocument(_0x505f95,_0x331630){return new Promise(function(_0x2a23de,_0x56faa3){var _0x28c07e=_0x505f95[_0x06c1('0x50')](fs[_0x06c1('0x51')](_0x331630));_0x28c07e['on'](_0x06c1('0x52'),function(){_0x2a23de(_0x06c1('0x52'));});_0x28c07e['on']('error',function(_0x53097c){_0x56faa3(_0x53097c);});_0x505f95['end']();});}exports['createPdfFromHTML']=function(_0x286b8a,_0xc6dbc0){var _0x114313=getPDFPrinter();var _0x3f9404=getPDFDocDefinitionFromHTML(_0x286b8a,_0xc6dbc0);var _0x313ddf=_0x114313[_0x06c1('0x36')](_0x3f9404);return writePDFDocument(_0x313ddf,_0xc6dbc0[_0x06c1('0x1')])[_0x06c1('0x43')](function(_0x5c10e5){throw _0x5c10e5;});}; \ No newline at end of file +var _0x29d5=['landscape','black','num','Empty','find','split','splitSizePdf','range','isInteger','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','basename','.pdf','join','mkdirSync','each','then','pdf','%s.%s','zip','zip\x20finished','info','PDF','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','YYYY-MM-DD','Arial','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','footer','pipe','createWriteStream','finish','error','createPdfFromHTML','createPdfKitDocument','lodash','path','moment','pdfmake/src/printer','zip-dir','jsdom','JSDOM','window','bluebird','../../mysqldb','dbH','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','tableHeader','map','pick','toString','value','fill','auto','body','chunk','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','endDate','length','push','header','pageBreak','before','margin'];(function(_0x652786,_0x299abc){var _0x234eb3=function(_0x2e1c55){while(--_0x2e1c55){_0x652786['push'](_0x652786['shift']());}};_0x234eb3(++_0x299abc);}(_0x29d5,0x197));var _0x529d=function(_0x38ceb8,_0x40d380){_0x38ceb8=_0x38ceb8-0x0;var _0x5aa920=_0x29d5[_0x38ceb8];return _0x5aa920;};'use strict';var _=require(_0x529d('0x0'));var fs=require('fs');var util=require('util');var path=require(_0x529d('0x1'));var moment=require(_0x529d('0x2'));var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require(_0x529d('0x3'));var zipdir=require(_0x529d('0x4'));var rimraf=require('rimraf');var JSDOM=require(_0x529d('0x5'))[_0x529d('0x6')];var window=new JSDOM('')[_0x529d('0x7')];var BPromise=require(_0x529d('0x8'));var db=require(_0x529d('0x9'))['db'];var dbH=require(_0x529d('0x9'))[_0x529d('0xa')];var logger=require('../../config/logger')(_0x529d('0xb'));var EXTRACTED_REPORT_ID=Number(process[_0x529d('0xc')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x529d('0xc')][0x4];var NAME=process[_0x529d('0xc')][0x5];var FORMAT=_0x529d('0xd');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x41177c,_0x2a62c1){var _0xa56181={'status':_0x41177c};var _0xfaf2a5={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2a62c1){_0xa56181[_0x529d('0xe')]=_0x2a62c1;}return db[_0x529d('0xf')][_0x529d('0x10')](_0xa56181,_0xfaf2a5);}function getHeaders(_0x20aab0){return _['map'](_0x20aab0,function(_0x580b4f){return{'text':_0x580b4f,'style':_0x529d('0x11')};});}function getRows(_0x5d9eee,_0x50c1af){return _[_0x529d('0x12')](_0x50c1af,function(_0x3b5f08){return _(_0x3b5f08)[_0x529d('0x13')](_0x5d9eee)['map'](function(_0xb98972){return _0xb98972?_[_0x529d('0x14')](_0xb98972):'';})[_0x529d('0x15')]();});}function createTable(_0x21ba8c,_0x5d4b82){var _0x2371c6={'widths':_[_0x529d('0x16')](Array(_0x21ba8c['length']),0x91),'heights':function(_0x2aa242){return _0x2aa242===0x0?_0x529d('0x17'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x4e72f8=getHeaders(_0x21ba8c);_0x2371c6[_0x529d('0x18')]['push'](_0x4e72f8);var _0x5ecbff=getRows(_0x21ba8c,_0x5d4b82);_0x2371c6['body']=_0x2371c6[_0x529d('0x18')]['concat'](_0x5ecbff);return _0x2371c6;}function createTables(_0x533f57){var _0x44b74a=[];var _0x292d78=_[_0x529d('0x19')](Object[_0x529d('0x1a')](_0x533f57[0x0]),0x5);_0x292d78[_0x529d('0x1b')](function(_0x192542){_0x44b74a['push'](createTable(_0x192542,_0x533f57));});return _0x44b74a;}function getPDFDocDefinition(_0x436dad){var _0x3a848f=util[_0x529d('0x1c')](_0x529d('0x1d'),NAME,EXTRACTED_REPORT[_0x529d('0x1e')],moment(EXTRACTED_REPORT['startDate'])[_0x529d('0x1c')](FORMAT),moment(EXTRACTED_REPORT[_0x529d('0x1f')])[_0x529d('0x1c')](FORMAT));var _0x1a4757=[];for(var _0x14b117=0x0;_0x14b117<_0x436dad[_0x529d('0x20')];_0x14b117++){var _0x11e60a=[];if(_0x14b117===0x0){_0x11e60a[_0x529d('0x21')]({'text':_0x3a848f,'style':_0x529d('0x22')});}var _0x193f82={'table':_0x436dad[_0x14b117]};if(_0x14b117>0x0){_0x193f82[_0x529d('0x23')]=_0x529d('0x24');_0x193f82[_0x529d('0x25')]=[0x0,0x46,0x0,0x0];}_0x11e60a[_0x529d('0x21')](_0x193f82);_0x1a4757[_0x529d('0x21')](_0x11e60a);}return{'pageSize':'A4','pageOrientation':_0x529d('0x26'),'content':_0x1a4757,'footer':function(_0x260023,_0x4c4281){return{'text':_0x260023['toString']()+'\x20/\x20'+_0x4c4281,'style':'footer'};},'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x529d('0x27')},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x21dbc5){var _0x54a06b=0x1388;var _0x404f2d;if(!_0x21dbc5[0x0][_0x529d('0x28')]){return analyticExtractedReport(_0x529d('0x29'));}return db['Setting'][_0x529d('0x2a')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x529d('0x2b'),_0x529d('0x2c')]})['then'](function(_0xe4aa53){if(_0xe4aa53){_0x404f2d=_0xe4aa53;_0x54a06b=_0x404f2d[_0x529d('0x2c')]||0x3e8;}})['then'](function(){var _0x426168=[];var _0x57615c=0x0;if(_0x404f2d[_0x529d('0x2b')]){if(_0x21dbc5&&_0x21dbc5[_0x529d('0x20')]){var _0x3f9c5b=_[_0x529d('0x2d')](_0x21dbc5[0x0][_0x529d('0x28')]/_0x54a06b);var _0x3e20cc=Number[_0x529d('0x2e')](_0x21dbc5[0x0][_0x529d('0x28')]/_0x54a06b)?_0x21dbc5[0x0]['num']%_0x54a06b:0x0;_0x3f9c5b[_0x529d('0x1b')](function(_0x62cfac){if(_0x62cfac>0x0){_0x57615c+=_0x54a06b;}_0x426168[_0x529d('0x21')](dbH[_0x529d('0x2f')][_0x529d('0x30')](util['format'](_0x529d('0x31'),QUERY,_0x54a06b,_0x57615c),{'type':dbH[_0x529d('0x2f')][_0x529d('0x32')][_0x529d('0x33')]}));});if(_0x3e20cc>0x0){_0x57615c+=_0x54a06b;_0x426168['push'](dbH['sequelize'][_0x529d('0x30')](util[_0x529d('0x1c')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x3e20cc,_0x57615c),{'type':dbH['sequelize'][_0x529d('0x32')][_0x529d('0x33')]}));}}}else{_0x426168[_0x529d('0x21')](dbH['sequelize']['query'](QUERY,{'type':dbH['sequelize'][_0x529d('0x32')][_0x529d('0x33')]}));}var _0x16d318=path['dirname'](PATH);var _0xfd4a7e=path[_0x529d('0x34')](PATH,_0x529d('0x35'));var _0x1785df=_0x404f2d[_0x529d('0x2b')]&&_0x426168[_0x529d('0x20')]>0x1;var _0x483312=[];if(!fs['existsSync'](path[_0x529d('0x36')](_0x16d318,_0xfd4a7e))&&_0x1785df){fs[_0x529d('0x37')](path[_0x529d('0x36')](_0x16d318,_0xfd4a7e));}return BPromise[_0x529d('0x38')](_0x426168,function(_0x72eae){_0x483312[_0x529d('0x21')](_0x72eae);})[_0x529d('0x39')](function(){var _0x3772c9=[];for(var _0xf6d6a1=0x0;_0xf6d6a1<_0x483312[_0x529d('0x20')];_0xf6d6a1+=0x1){var _0x5759f2=_0x483312[_0xf6d6a1];var _0x34c815=createTables(_['flatten'](_0x5759f2));var _0x3ff0e1;var _0x1b635d=getPDFDocDefinition(_0x34c815);var _0x36739c=getPDFPrinter();var _0x1d4c61=_0x36739c['createPdfKitDocument'](_0x1b635d);if(_0x1785df){_0x3ff0e1=path[_0x529d('0x36')](_0x16d318,_0xfd4a7e,util['format']('%s%d.%s',_0xfd4a7e,_0xf6d6a1,_0x529d('0x3a')));}else{_0x3ff0e1=path['join'](_0x16d318,util[_0x529d('0x1c')]('%s.%s',_0xfd4a7e,_0x529d('0x3a')));}_0x3772c9[_0x529d('0x21')](writePDFDocument(_0x1d4c61,_0x3ff0e1));}return Promise['all'](_0x3772c9);})[_0x529d('0x39')](function(){if(_0x1785df){return new Promise(function(_0x452f2d){zipdir(path['join'](_0x16d318,_0xfd4a7e),{'saveTo':path[_0x529d('0x36')](_0x16d318,util['format'](_0x529d('0x3b'),_0xfd4a7e,_0x529d('0x3c')))},function(){rimraf(path[_0x529d('0x36')](_0x16d318,_0xfd4a7e),function(){});_0x452f2d(_0x529d('0x3d'));});});}})[_0x529d('0x39')](function(){if(!_0x1785df)return;rimraf(path[_0x529d('0x36')](_0x16d318,_0xfd4a7e),function(){});})[_0x529d('0x39')](function(){logger[_0x529d('0x3e')](util[_0x529d('0x1c')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x529d('0x3f')));return analyticExtractedReport('Completed',_0x1785df?util[_0x529d('0x1c')](_0x529d('0x3b'),_0xfd4a7e,_0x1785df?'zip':_0x529d('0x3a')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x529d('0x3e')](util['format'](_0x529d('0x40'),EXTRACTED_REPORT_ID,_0x529d('0x3f')));return db[_0x529d('0xf')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})[_0x529d('0x39')](function(_0x3e9f14){EXTRACTED_REPORT=_0x3e9f14;return dbH[_0x529d('0x2f')][_0x529d('0x30')](util[_0x529d('0x1c')](_0x529d('0x41'),QUERY),{'type':dbH['sequelize']['QueryTypes'][_0x529d('0x33')]});})[_0x529d('0x39')](extractReport)[_0x529d('0x42')](function(_0x21d37f){logger[_0x529d('0x3e')](util[_0x529d('0x1c')](_0x529d('0x43'),EXTRACTED_REPORT_ID,_0x529d('0x3f')),util['inspect'](_0x21d37f,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x529d('0x44'));})[_0x529d('0x45')](function(){process[_0x529d('0x46')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x255395=new PdfPrinter({'Arial':{'normal':__dirname+_0x529d('0x47'),'bold':__dirname+_0x529d('0x48'),'italics':__dirname+_0x529d('0x49'),'bolditalics':__dirname+_0x529d('0x4a')}});return _0x255395;}function getPDFDocDefinitionFromHTML(_0x531280,_0x4cc5af){var _0x28f922=util[_0x529d('0x1c')](_0x529d('0x4b'),_0x4cc5af[_0x529d('0x4c')],_0x4cc5af['interactionId']);var _0x2863f4=moment()[_0x529d('0x1c')](_0x529d('0x4d'))[_0x529d('0x14')]();var _0x5c9ffa=htmlToPdfmake(_0x531280,{'window':window,'tableAutoSize':!![]});return{'content':[_0x5c9ffa],'defaultStyle':{'font':_0x529d('0x4e')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':'center','margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x529d('0x4f'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x529d('0x4f')}},'header':function(){return[{'text':_0x529d('0x50'),'style':_0x529d('0x22')}];},'footer':function(_0x279170,_0x59d121){return[{'text':util[_0x529d('0x1c')](_0x529d('0x51'),_0x28f922,_0x279170,_0x59d121,_0x2863f4),'style':_0x529d('0x52')}];}};}function writePDFDocument(_0xdaa0b0,_0x32bbe5){return new Promise(function(_0x18641c,_0x3cd84c){var _0x181891=_0xdaa0b0[_0x529d('0x53')](fs[_0x529d('0x54')](_0x32bbe5));_0x181891['on'](_0x529d('0x55'),function(){_0x18641c(_0x529d('0x55'));});_0x181891['on'](_0x529d('0x56'),function(_0x14a9da){_0x3cd84c(_0x14a9da);});_0xdaa0b0['end']();});}exports[_0x529d('0x57')]=function(_0xeef313,_0x241a97){var _0x4d8c09=getPDFPrinter();var _0x1d4f3d=getPDFDocDefinitionFromHTML(_0xeef313,_0x241a97);var _0x426bd9=_0x4d8c09[_0x529d('0x58')](_0x1d4f3d);return writePDFDocument(_0x426bd9,_0x241a97[_0x529d('0x1')])['catch'](function(_0x2c16ff){throw _0x2c16ff;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 5eab322..5273d30 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 _0xcf98=['../../config/logger','analytics','argv','savename','info','Setting','find','splitSizeXlsx','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','SELECT','then','num','Empty','split','length','range','isInteger','forEach','%s\x20limit\x20%d\x20OFFSET\x20%d','push','dirname','.xlsx','existsSync','mkdirSync','join','each','xlsx','writeFileSync','binary','%s.%s','zip','zip\x20finished','XLSX','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','path','lodash','json2xls','zip-dir','rimraf','../../mysqldb','dbH'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xcf98,0xc8));var _0x8cf9=function(_0x34953e,_0x1e4820){_0x34953e=_0x34953e-0x0;var _0x5e154f=_0xcf98[_0x34953e];return _0x5e154f;};'use strict';var util=require(_0x8cf9('0x0'));var path=require(_0x8cf9('0x1'));var _=require(_0x8cf9('0x2'));var fs=require('fs');var json2xls=require(_0x8cf9('0x3'));var BPromise=require('bluebird');var zipdir=require(_0x8cf9('0x4'));var rimraf=require(_0x8cf9('0x5'));var db=require(_0x8cf9('0x6'))['db'];var dbH=require(_0x8cf9('0x6'))[_0x8cf9('0x7')];var logger=require(_0x8cf9('0x8'))(_0x8cf9('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0x8cf9('0xa')][0x2]);var QUERY=process[_0x8cf9('0xa')][0x3];var PATH=process[_0x8cf9('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0xd6c522,_0x1ae5ea){var _0x51cd13={'status':_0xd6c522};var _0x20e198={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1ae5ea){_0x51cd13[_0x8cf9('0xb')]=_0x1ae5ea;}return db['AnalyticExtractedReport']['update'](_0x51cd13,_0x20e198);}function main(){var _0x539396=0x1388;var _0x5db4d0;logger[_0x8cf9('0xc')](util['format']('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'XLSX'));return db[_0x8cf9('0xd')][_0x8cf9('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split','splitSizeXlsx']})['then'](function(_0x433b06){if(_0x433b06){_0x5db4d0=_0x433b06;_0x539396=_0x5db4d0[_0x8cf9('0xf')]||0x1388;}})['then'](function(){return dbH['sequelize'][_0x8cf9('0x10')](util[_0x8cf9('0x11')](_0x8cf9('0x12'),QUERY),{'type':dbH[_0x8cf9('0x13')][_0x8cf9('0x14')][_0x8cf9('0x15')]});})[_0x8cf9('0x16')](function(_0x5468c8){if(!_0x5468c8[0x0][_0x8cf9('0x17')]){return analyticExtractedReport(_0x8cf9('0x18'));}var _0x2d9095=[];var _0x47df89=0x0;if(_0x5db4d0[_0x8cf9('0x19')]){if(_0x5468c8&&_0x5468c8[_0x8cf9('0x1a')]){var _0x16b7bd=_[_0x8cf9('0x1b')](_0x5468c8[0x0][_0x8cf9('0x17')]/_0x539396);var _0x11a4ed=Number[_0x8cf9('0x1c')](_0x5468c8[0x0][_0x8cf9('0x17')]/_0x539396)?_0x5468c8[0x0][_0x8cf9('0x17')]%_0x539396:0x0;_0x16b7bd[_0x8cf9('0x1d')](function(_0x1ad5ba){if(_0x1ad5ba>0x0){_0x47df89+=_0x539396;}_0x2d9095['push'](dbH[_0x8cf9('0x13')][_0x8cf9('0x10')](util[_0x8cf9('0x11')](_0x8cf9('0x1e'),QUERY,_0x539396,_0x47df89),{'type':dbH[_0x8cf9('0x13')]['QueryTypes']['SELECT']}));});if(_0x11a4ed>0x0){_0x47df89+=_0x539396;_0x2d9095['push'](dbH[_0x8cf9('0x13')][_0x8cf9('0x10')](util[_0x8cf9('0x11')](_0x8cf9('0x1e'),QUERY,_0x11a4ed,_0x47df89),{'type':dbH['sequelize'][_0x8cf9('0x14')][_0x8cf9('0x15')]}));}}}else{_0x2d9095[_0x8cf9('0x1f')](dbH[_0x8cf9('0x13')][_0x8cf9('0x10')](QUERY,{'type':dbH[_0x8cf9('0x13')][_0x8cf9('0x14')][_0x8cf9('0x15')]}));}var _0x55680c=path[_0x8cf9('0x20')](PATH);var _0x108da5=path['basename'](PATH,_0x8cf9('0x21'));var _0x52291f=_0x5db4d0[_0x8cf9('0x19')]&&_0x2d9095[_0x8cf9('0x1a')]>0x1;var _0x2bf56f=[];if(!fs[_0x8cf9('0x22')](path['join'](_0x55680c,_0x108da5))&&_0x52291f){fs[_0x8cf9('0x23')](path[_0x8cf9('0x24')](_0x55680c,_0x108da5));}return BPromise[_0x8cf9('0x25')](_0x2d9095,function(_0x50d7f3){_0x2bf56f[_0x8cf9('0x1f')](_0x50d7f3);})['then'](function(){for(var _0x53c854=0x0;_0x53c854<_0x2bf56f['length'];_0x53c854+=0x1){var _0x28645f;var _0x28a882=_0x2bf56f[_0x53c854];if(_0x52291f){_0x28645f=path[_0x8cf9('0x24')](_0x55680c,_0x108da5,util['format']('%s%d.%s',_0x108da5,_0x53c854,_0x8cf9('0x26')));}else{_0x28645f=path[_0x8cf9('0x24')](_0x55680c,util['format']('%s.%s',_0x108da5,_0x8cf9('0x26')));}fs[_0x8cf9('0x27')](_0x28645f,json2xls(_0x28a882),_0x8cf9('0x28'));}})[_0x8cf9('0x16')](function(){if(_0x52291f){return new Promise(function(_0x2d46fb){zipdir(path[_0x8cf9('0x24')](_0x55680c,_0x108da5),{'saveTo':path[_0x8cf9('0x24')](_0x55680c,util['format'](_0x8cf9('0x29'),_0x108da5,_0x8cf9('0x2a')))},function(_0x1f4a13,_0x1ea6a8){rimraf(path['join'](_0x55680c,_0x108da5),function(){});_0x2d46fb(_0x8cf9('0x2b'));});});}})['then'](function(){logger[_0x8cf9('0xc')](util['format']('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x8cf9('0x2c')));return analyticExtractedReport(_0x8cf9('0x2d'),_0x52291f?util[_0x8cf9('0x11')](_0x8cf9('0x29'),_0x108da5,_0x52291f?_0x8cf9('0x2a'):'xlsx'):null);});})[_0x8cf9('0x2e')](function(_0x3e3b2a){logger['info'](util[_0x8cf9('0x11')](_0x8cf9('0x2f'),EXTRACTED_REPORT_ID,_0x8cf9('0x2c')),util[_0x8cf9('0x30')](_0x3e3b2a,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x8cf9('0x31'));})[_0x8cf9('0x32')](function(){process[_0x8cf9('0x33')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x65ba=['dbH','analytics','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num','Empty','length','range','isInteger','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','basename','.xlsx','join','mkdirSync','each','%s%d.%s','xlsx','%s.%s','zip','zip\x20finished','XLSX','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','exit','lodash','zip-dir','rimraf','../../mysqldb'];(function(_0x2814e5,_0x285e18){var _0x32c653=function(_0x10f164){while(--_0x10f164){_0x2814e5['push'](_0x2814e5['shift']());}};_0x32c653(++_0x285e18);}(_0x65ba,0x110));var _0xa65b=function(_0x4766d1,_0x4c5fe6){_0x4766d1=_0x4766d1-0x0;var _0x42d22b=_0x65ba[_0x4766d1];return _0x42d22b;};'use strict';var util=require('util');var path=require('path');var _=require(_0xa65b('0x0'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require('bluebird');var zipdir=require(_0xa65b('0x1'));var rimraf=require(_0xa65b('0x2'));var db=require(_0xa65b('0x3'))['db'];var dbH=require(_0xa65b('0x3'))[_0xa65b('0x4')];var logger=require('../../config/logger')(_0xa65b('0x5'));var EXTRACTED_REPORT_ID=Number(process[_0xa65b('0x6')][0x2]);var QUERY=process[_0xa65b('0x6')][0x3];var PATH=process[_0xa65b('0x6')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x49875d,_0x1b99a6){var _0xf0dc79={'status':_0x49875d};var _0x4bb15a={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1b99a6){_0xf0dc79[_0xa65b('0x7')]=_0x1b99a6;}return db[_0xa65b('0x8')][_0xa65b('0x9')](_0xf0dc79,_0x4bb15a);}function main(){var _0x1986e9=0x1388;var _0x577904;logger[_0xa65b('0xa')](util[_0xa65b('0xb')](_0xa65b('0xc'),EXTRACTED_REPORT_ID,'XLSX'));return db[_0xa65b('0xd')][_0xa65b('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xa65b('0xf')]})[_0xa65b('0x10')](function(_0x52e7a7){if(_0x52e7a7){_0x577904=_0x52e7a7;_0x1986e9=_0x577904[_0xa65b('0xf')]||0x1388;}})[_0xa65b('0x10')](function(){return dbH[_0xa65b('0x11')][_0xa65b('0x12')](util[_0xa65b('0xb')](_0xa65b('0x13'),QUERY),{'type':dbH[_0xa65b('0x11')]['QueryTypes'][_0xa65b('0x14')]});})['then'](function(_0x1b4767){if(!_0x1b4767[0x0][_0xa65b('0x15')]){return analyticExtractedReport(_0xa65b('0x16'));}var _0x981072=[];var _0x1826d1=0x0;if(_0x577904['split']){if(_0x1b4767&&_0x1b4767[_0xa65b('0x17')]){var _0x446a3a=_[_0xa65b('0x18')](_0x1b4767[0x0][_0xa65b('0x15')]/_0x1986e9);var _0x1e164d=Number[_0xa65b('0x19')](_0x1b4767[0x0][_0xa65b('0x15')]/_0x1986e9)?_0x1b4767[0x0]['num']%_0x1986e9:0x0;_0x446a3a['forEach'](function(_0x96baa3){if(_0x96baa3>0x0){_0x1826d1+=_0x1986e9;}_0x981072[_0xa65b('0x1a')](dbH[_0xa65b('0x11')][_0xa65b('0x12')](util[_0xa65b('0xb')](_0xa65b('0x1b'),QUERY,_0x1986e9,_0x1826d1),{'type':dbH[_0xa65b('0x11')][_0xa65b('0x1c')][_0xa65b('0x14')]}));});if(_0x1e164d>0x0){_0x1826d1+=_0x1986e9;_0x981072[_0xa65b('0x1a')](dbH[_0xa65b('0x11')]['query'](util[_0xa65b('0xb')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x1e164d,_0x1826d1),{'type':dbH[_0xa65b('0x11')][_0xa65b('0x1c')]['SELECT']}));}}}else{_0x981072['push'](dbH['sequelize'][_0xa65b('0x12')](QUERY,{'type':dbH[_0xa65b('0x11')][_0xa65b('0x1c')][_0xa65b('0x14')]}));}var _0x3abcb4=path[_0xa65b('0x1d')](PATH);var _0x330b76=path[_0xa65b('0x1e')](PATH,_0xa65b('0x1f'));var _0x30665f=_0x577904['split']&&_0x981072[_0xa65b('0x17')]>0x1;var _0x4f44f7=[];if(!fs['existsSync'](path[_0xa65b('0x20')](_0x3abcb4,_0x330b76))&&_0x30665f){fs[_0xa65b('0x21')](path[_0xa65b('0x20')](_0x3abcb4,_0x330b76));}return BPromise[_0xa65b('0x22')](_0x981072,function(_0x4f5ccf){_0x4f44f7['push'](_0x4f5ccf);})['then'](function(){for(var _0x1c6ed8=0x0;_0x1c6ed8<_0x4f44f7['length'];_0x1c6ed8+=0x1){var _0x4669bc;var _0x5c106d=_0x4f44f7[_0x1c6ed8];if(_0x30665f){_0x4669bc=path['join'](_0x3abcb4,_0x330b76,util[_0xa65b('0xb')](_0xa65b('0x23'),_0x330b76,_0x1c6ed8,_0xa65b('0x24')));}else{_0x4669bc=path[_0xa65b('0x20')](_0x3abcb4,util[_0xa65b('0xb')](_0xa65b('0x25'),_0x330b76,_0xa65b('0x24')));}fs['writeFileSync'](_0x4669bc,json2xls(_0x5c106d),'binary');}})[_0xa65b('0x10')](function(){if(_0x30665f){return new Promise(function(_0x121acd){zipdir(path[_0xa65b('0x20')](_0x3abcb4,_0x330b76),{'saveTo':path[_0xa65b('0x20')](_0x3abcb4,util[_0xa65b('0xb')](_0xa65b('0x25'),_0x330b76,_0xa65b('0x26')))},function(_0x201531,_0x5e9120){rimraf(path[_0xa65b('0x20')](_0x3abcb4,_0x330b76),function(){});_0x121acd(_0xa65b('0x27'));});});}})[_0xa65b('0x10')](function(){logger[_0xa65b('0xa')](util[_0xa65b('0xb')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xa65b('0x28')));return analyticExtractedReport('Completed',_0x30665f?util[_0xa65b('0xb')](_0xa65b('0x25'),_0x330b76,_0x30665f?_0xa65b('0x26'):_0xa65b('0x24')):null);});})[_0xa65b('0x29')](function(_0x46d58b){logger[_0xa65b('0xa')](util[_0xa65b('0xb')](_0xa65b('0x2a'),EXTRACTED_REPORT_ID,'XLSX'),util[_0xa65b('0x2b')](_0x46d58b,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xa65b('0x2c'));})['finally'](function(){process[_0xa65b('0x2d')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 3b29329..6677f79 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 _0xbfd2=['toLowerCase','appType','custom','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','last','concat','transaction','destroy','bulkCreate','sortBy','catch','rewrite','lodash','models','findAll','then','intervals','VoiceExtension','IntervalId','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','hasOwnProperty','priority','extensions','extension','find','push','type','CDR(type)=%s','context','VoiceExtensionId','inbound','Set','CDR(routeid)=','outbound','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','interval','*,*,*,*','tag','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf'];(function(_0x1636c3,_0x8ad076){var _0x3a2211=function(_0x1606e9){while(--_0x1606e9){_0x1636c3['push'](_0x1636c3['shift']());}};_0x3a2211(++_0x8ad076);}(_0xbfd2,0xd9));var _0x2bfd=function(_0xcc6fb2,_0x46b544){_0xcc6fb2=_0xcc6fb2-0x0;var _0x3adc7c=_0xbfd2[_0xcc6fb2];return _0x3adc7c;};'use strict';var _=require(_0x2bfd('0x0'));var util=require('util');function rewrite(_0x5caff9,_0x34d863){var _0x1c9bc3=this;return _0x5caff9[_0x2bfd('0x1')]['Interval'][_0x2bfd('0x2')]({'raw':!![]})[_0x2bfd('0x3')](function(_0x588736){_0x1c9bc3[_0x2bfd('0x4')]=_0x588736;return _0x5caff9[_0x2bfd('0x1')][_0x2bfd('0x5')][_0x2bfd('0x2')]({'where':{'IntervalId':_0x34d863[_0x2bfd('0x6')]},'raw':!![]});})['then'](function(_0x2ee9ce){return _0x5caff9[_0x2bfd('0x1')][_0x2bfd('0x5')][_0x2bfd('0x2')]({'where':{'exten':{'$in':_[_0x2bfd('0x7')](_[_0x2bfd('0x8')](_0x2ee9ce,_0x2bfd('0x9')))}},'order':[{'raw':_0x2bfd('0xa')}],'raw':!![]});})['then'](function(_0x1e138a){var _0x1df825=_[_0x2bfd('0xb')](_0x1e138a,{'priority':'1'});var _0x48f65c=_[_0x2bfd('0xb')](_0x1e138a,{'isApp':0x1});var _0x3fc659=_[_0x2bfd('0xc')](_0x48f65c,_0x2bfd('0x9'));var _0x10152c=[_0x2bfd('0xd'),_0x2bfd('0xe')];var _0x1cd265=[];var _0x3943c4=[];for(var _0x3ac537 in _0x3fc659){if(_0x3fc659[_0x2bfd('0xf')](_0x3ac537)){_0x1c9bc3[_0x2bfd('0x10')]=0x2;_0x1c9bc3[_0x2bfd('0x11')]=[];_0x1c9bc3[_0x2bfd('0x12')]=_[_0x2bfd('0x13')](_0x1df825,{'exten':_0x3fc659[_0x3ac537][0x0][_0x2bfd('0x9')]});_0x1c9bc3['extensions'][_0x2bfd('0x14')]({'type':_0x3fc659[_0x3ac537][0x0][_0x2bfd('0x15')],'app':'Set','appdata':util['format'](_0x2bfd('0x16'),_0x3fc659[_0x3ac537][0x0][_0x2bfd('0x15')]),'context':_0x3fc659[_0x3ac537][0x0][_0x2bfd('0x17')],'exten':_0x3fc659[_0x3ac537][0x0][_0x2bfd('0x9')],'priority':_0x1c9bc3[_0x2bfd('0x10')]++,'VoiceExtensionId':_0x3fc659[_0x3ac537][0x0][_0x2bfd('0x18')]});if(_0x3fc659[_0x3ac537][0x0][_0x2bfd('0x15')]===_0x2bfd('0x19')){_0x1c9bc3[_0x2bfd('0x11')][_0x2bfd('0x14')]({'type':_0x3fc659[_0x3ac537][0x0][_0x2bfd('0x15')],'app':_0x2bfd('0x1a'),'appdata':_0x2bfd('0x1b')+_0x3fc659[_0x3ac537][0x0][_0x2bfd('0x18')],'context':_0x3fc659[_0x3ac537][0x0][_0x2bfd('0x17')],'exten':_0x3fc659[_0x3ac537][0x0]['exten'],'priority':_0x1c9bc3[_0x2bfd('0x10')]++,'VoiceExtensionId':_0x3fc659[_0x3ac537][0x0][_0x2bfd('0x18')]});}else if(_0x3fc659[_0x3ac537][0x0][_0x2bfd('0x15')]===_0x2bfd('0x1c')){if(_0x1c9bc3[_0x2bfd('0x12')]){_0x1c9bc3[_0x2bfd('0x11')][_0x2bfd('0x14')]({'type':_0x3fc659[_0x3ac537][0x0]['type'],'app':_0x2bfd('0x1a'),'appdata':'CDR(destination)='+(_0x1c9bc3['extension'][_0x2bfd('0x1d')]?_0x2bfd('0x1e')+_0x1c9bc3[_0x2bfd('0x12')][_0x2bfd('0x1d')]+'}':_0x2bfd('0x1f')),'context':_0x3fc659[_0x3ac537][0x0]['context'],'exten':_0x3fc659[_0x3ac537][0x0][_0x2bfd('0x9')],'priority':_0x1c9bc3[_0x2bfd('0x10')]++,'VoiceExtensionId':_0x3fc659[_0x3ac537][0x0][_0x2bfd('0x18')]});}_0x1c9bc3[_0x2bfd('0x11')][_0x2bfd('0x14')]({'type':_0x3fc659[_0x3ac537][0x0]['type'],'app':_0x2bfd('0x1a'),'appdata':_0x2bfd('0x1b')+_0x3fc659[_0x3ac537][0x0][_0x2bfd('0x18')],'context':_0x3fc659[_0x3ac537][0x0][_0x2bfd('0x17')],'exten':_0x3fc659[_0x3ac537][0x0][_0x2bfd('0x9')],'priority':_0x1c9bc3[_0x2bfd('0x10')]++,'VoiceExtensionId':_0x3fc659[_0x3ac537][0x0][_0x2bfd('0x18')]});var _0x3a38ae=_0x1c9bc3['priority']++;_0x1c9bc3['extensions']['push']({'type':_0x3fc659[_0x3ac537][0x0][_0x2bfd('0x15')],'app':_0x2bfd('0x20'),'appdata':_0x2bfd('0x21')+(_0x3a38ae+0x2)+'):Goto('+(_0x3a38ae+0x1)+')','context':_0x3fc659[_0x3ac537][0x0][_0x2bfd('0x17')],'exten':_0x3fc659[_0x3ac537][0x0][_0x2bfd('0x9')],'priority':_0x3a38ae,'VoiceExtensionId':_0x3fc659[_0x3ac537][0x0][_0x2bfd('0x18')]});if(_0x1c9bc3['extension']){_0x1c9bc3['extensions'][_0x2bfd('0x14')]({'type':_0x3fc659[_0x3ac537][0x0]['type'],'app':'Set','appdata':_0x1c9bc3[_0x2bfd('0x12')][_0x2bfd('0x1d')]?_0x2bfd('0x22')+_0x1c9bc3[_0x2bfd('0x12')]['cutdigits']+'}':'CDR(prefix)=noprefix','context':_0x3fc659[_0x3ac537][0x0][_0x2bfd('0x17')],'exten':_0x3fc659[_0x3ac537][0x0][_0x2bfd('0x9')],'priority':_0x1c9bc3[_0x2bfd('0x10')]++,'VoiceExtensionId':_0x3fc659[_0x3ac537][0x0][_0x2bfd('0x18')]});}_0x1c9bc3[_0x2bfd('0x11')][_0x2bfd('0x14')]({'type':_0x3fc659[_0x3ac537][0x0]['type'],'app':'Set','appdata':_0x2bfd('0x23')+_0x3fc659[_0x3ac537][0x0][_0x2bfd('0x18')],'context':_0x3fc659[_0x3ac537][0x0][_0x2bfd('0x17')],'exten':_0x3fc659[_0x3ac537][0x0][_0x2bfd('0x9')],'priority':_0x1c9bc3['priority']++,'VoiceExtensionId':_0x3fc659[_0x3ac537][0x0]['VoiceExtensionId']});if(_0x1c9bc3[_0x2bfd('0x12')]&&_0x1c9bc3[_0x2bfd('0x12')][_0x2bfd('0xf')](_0x2bfd('0x24'))&&_0x1c9bc3[_0x2bfd('0x12')]['recordingFormat']!==_0x2bfd('0x25')){_0x1c9bc3[_0x2bfd('0x11')][_0x2bfd('0x14')]({'type':_0x3fc659[_0x3ac537][0x0][_0x2bfd('0x15')],'app':_0x2bfd('0x1a'),'appdata':_0x2bfd('0x26'),'context':_0x3fc659[_0x3ac537][0x0][_0x2bfd('0x17')],'exten':_0x3fc659[_0x3ac537][0x0]['exten'],'priority':_0x1c9bc3['priority']++,'VoiceExtensionId':_0x3fc659[_0x3ac537][0x0][_0x2bfd('0x18')]});_0x1c9bc3[_0x2bfd('0x11')][_0x2bfd('0x14')]({'type':_0x3fc659[_0x3ac537][0x0][_0x2bfd('0x15')],'app':_0x2bfd('0x1a'),'appdata':_0x2bfd('0x27')+_0x1c9bc3[_0x2bfd('0x12')][_0x2bfd('0x24')]||'wav','context':_0x3fc659[_0x3ac537][0x0][_0x2bfd('0x17')],'exten':_0x3fc659[_0x3ac537][0x0]['exten'],'priority':_0x1c9bc3[_0x2bfd('0x10')]++,'VoiceExtensionId':_0x3fc659[_0x3ac537][0x0][_0x2bfd('0x18')]});}}_0x1c9bc3[_0x2bfd('0x11')][_0x2bfd('0x14')]({'type':_0x3fc659[_0x3ac537][0x0][_0x2bfd('0x15')],'app':_0x2bfd('0x1a'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x3fc659[_0x3ac537][0x0][_0x2bfd('0x17')],'exten':_0x3fc659[_0x3ac537][0x0][_0x2bfd('0x9')],'priority':_0x1c9bc3[_0x2bfd('0x10')]++,'VoiceExtensionId':_0x3fc659[_0x3ac537][0x0]['VoiceExtensionId']});_0x1c9bc3[_0x2bfd('0x11')][_0x2bfd('0x14')]({'type':_0x3fc659[_0x3ac537][0x0][_0x2bfd('0x15')],'app':_0x2bfd('0x1a'),'appdata':_0x2bfd('0x28'),'context':_0x3fc659[_0x3ac537][0x0][_0x2bfd('0x17')],'exten':_0x3fc659[_0x3ac537][0x0][_0x2bfd('0x9')],'priority':_0x1c9bc3['priority']++,'VoiceExtensionId':_0x3fc659[_0x3ac537][0x0]['VoiceExtensionId']});_0x1c9bc3[_0x2bfd('0x11')][_0x2bfd('0x14')]({'type':_0x3fc659[_0x3ac537][0x0][_0x2bfd('0x15')],'app':_0x2bfd('0x1a'),'appdata':_0x2bfd('0x29'),'context':_0x3fc659[_0x3ac537][0x0][_0x2bfd('0x17')],'exten':_0x3fc659[_0x3ac537][0x0]['exten'],'priority':_0x1c9bc3[_0x2bfd('0x10')]++,'VoiceExtensionId':_0x3fc659[_0x3ac537][0x0]['VoiceExtensionId']});for(var _0x8ff0ee=0x0,_0x59ee5=0x0;_0x8ff0ee<_0x3fc659[_0x3ac537][_0x2bfd('0x2a')];_0x8ff0ee+=0x1,_0x59ee5=0x0){var _0x16ef5c=_0x3fc659[_0x3ac537][_0x8ff0ee];if(_0x16ef5c[_0x2bfd('0x15')]){_0x16ef5c[_0x2bfd('0x15')]=_0x16ef5c[_0x2bfd('0x15')]['toLowerCase']();}var _0x1959da=[];var _0x334082=[];delete _0x16ef5c['id'];delete _0x16ef5c['createdAt'];delete _0x16ef5c['updatedAt'];var _0x4b4615=_0x16ef5c[_0x2bfd('0x2b')]!==_0x2bfd('0x2c')?[_0x16ef5c[_0x2bfd('0x2b')]]:_0x16ef5c[_0x2bfd('0x6')]?_[_0x2bfd('0x8')](_[_0x2bfd('0xb')](_0x1c9bc3['intervals'],{'IntervalId':_0x16ef5c['IntervalId']}),'interval'):[];if(_0x16ef5c[_0x2bfd('0xf')](_0x2bfd('0x2d'))){if(_0x16ef5c[_0x2bfd('0x2d')]&&_0x16ef5c[_0x2bfd('0x2d')]!=='--'){_0x1959da[_0x2bfd('0x14')]({'type':_0x16ef5c[_0x2bfd('0x15')],'app':_0x2bfd('0x1a'),'appdata':'CDR(tag)='+_0x16ef5c[_0x2bfd('0x2d')],'context':_0x16ef5c['context'],'exten':_0x16ef5c['exten'],'priority':_0x4b4615[_0x2bfd('0x2a')]+_0x1c9bc3[_0x2bfd('0x10')]+_0x59ee5++,'VoiceExtensionId':_0x16ef5c[_0x2bfd('0x18')]});}}if(_0x16ef5c['type']===_0x2bfd('0x1c')&&_0x16ef5c[_0x2bfd('0xf')](_0x2bfd('0x2e'))){if(_0x16ef5c[_0x2bfd('0x2e')]){_0x1959da['push']({'type':_0x16ef5c['type'],'app':'ExecIf','appdata':_0x2bfd('0x2f')+_0x16ef5c[_0x2bfd('0x2e')]+')','context':_0x16ef5c[_0x2bfd('0x17')],'exten':_0x16ef5c[_0x2bfd('0x9')],'priority':_0x4b4615['length']+_0x1c9bc3['priority']+_0x59ee5++,'VoiceExtensionId':_0x16ef5c['VoiceExtensionId']});}else{_0x1959da[_0x2bfd('0x14')]({'type':_0x16ef5c[_0x2bfd('0x15')],'app':_0x2bfd('0x20'),'appdata':_0x2bfd('0x30'),'context':_0x16ef5c[_0x2bfd('0x17')],'exten':_0x16ef5c[_0x2bfd('0x9')],'priority':_0x4b4615[_0x2bfd('0x2a')]+_0x1c9bc3['priority']+_0x59ee5++,'VoiceExtensionId':_0x16ef5c[_0x2bfd('0x18')]});}}if(_0x16ef5c[_0x2bfd('0xf')](_0x2bfd('0x31'))){if(_0x10152c[_0x2bfd('0x32')](_0x16ef5c['app'][_0x2bfd('0x33')]())>=0x0&&_0x16ef5c[_0x2bfd('0x34')]!==_0x2bfd('0x35')){if(_0x16ef5c[_0x2bfd('0x31')]){_0x1959da[_0x2bfd('0x14')]({'type':_0x16ef5c[_0x2bfd('0x15')],'app':_0x2bfd('0x20'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x16ef5c['context'],'exten':_0x16ef5c[_0x2bfd('0x9')],'priority':_0x4b4615[_0x2bfd('0x2a')]+_0x1c9bc3[_0x2bfd('0x10')]+_0x59ee5++,'VoiceExtensionId':_0x16ef5c[_0x2bfd('0x18')]});_0x1959da[_0x2bfd('0x14')]({'type':_0x16ef5c[_0x2bfd('0x15')],'app':_0x2bfd('0x1a'),'appdata':_0x2bfd('0x36'),'context':_0x16ef5c[_0x2bfd('0x17')],'exten':_0x16ef5c[_0x2bfd('0x9')],'priority':_0x4b4615[_0x2bfd('0x2a')]+_0x1c9bc3['priority']+_0x59ee5++,'VoiceExtensionId':_0x16ef5c[_0x2bfd('0x18')]});}else{_0x1959da[_0x2bfd('0x14')]({'type':_0x16ef5c[_0x2bfd('0x15')],'app':_0x2bfd('0x20'),'appdata':_0x2bfd('0x37'),'context':_0x16ef5c[_0x2bfd('0x17')],'exten':_0x16ef5c['exten'],'priority':_0x4b4615[_0x2bfd('0x2a')]+_0x1c9bc3[_0x2bfd('0x10')]+_0x59ee5++,'VoiceExtensionId':_0x16ef5c['VoiceExtensionId']});_0x1959da[_0x2bfd('0x14')]({'type':_0x16ef5c[_0x2bfd('0x15')],'app':_0x2bfd('0x1a'),'appdata':_0x2bfd('0x38'),'context':_0x16ef5c['context'],'exten':_0x16ef5c['exten'],'priority':_0x4b4615[_0x2bfd('0x2a')]+_0x1c9bc3[_0x2bfd('0x10')]+_0x59ee5++,'VoiceExtensionId':_0x16ef5c['VoiceExtensionId']});}}}for(var _0x5e4894=0x0;_0x5e4894<_0x4b4615[_0x2bfd('0x2a')];_0x5e4894+=0x1){var _0x39659a=_0x1c9bc3['priority']+_0x4b4615[_0x2bfd('0x2a')];var _0x214001=_0x5e4894===_0x4b4615[_0x2bfd('0x2a')]-0x1?_0x1c9bc3[_0x2bfd('0x10')]+_0x1959da[_0x2bfd('0x2a')]+_0x334082[_0x2bfd('0x2a')]+0x2:_0x1c9bc3[_0x2bfd('0x10')]+_0x5e4894+0x1;_0x1959da['splice'](_0x5e4894,0x0,{'type':_0x16ef5c['type'],'app':_0x2bfd('0x39'),'appdata':_0x4b4615[_0x5e4894]+'?'+_0x16ef5c[_0x2bfd('0x17')]+',${EXTEN},'+_0x39659a+':'+_0x16ef5c[_0x2bfd('0x17')]+_0x2bfd('0x3a')+_0x214001,'exten':_0x16ef5c[_0x2bfd('0x9')],'context':_0x16ef5c[_0x2bfd('0x17')],'priority':_0x1c9bc3[_0x2bfd('0x10')]+_0x5e4894,'VoiceExtensionId':_0x3fc659[_0x3ac537][0x0][_0x2bfd('0x18')]});}_0x16ef5c[_0x2bfd('0x10')]=_0x1959da[_0x2bfd('0x2a')]?_[_0x2bfd('0x3b')](_0x1959da)[_0x2bfd('0x10')]+0x1:_0x1c9bc3[_0x2bfd('0x10')];_0x1c9bc3[_0x2bfd('0x10')]=(_0x334082[_0x2bfd('0x2a')]?_[_0x2bfd('0x3b')](_0x334082)[_0x2bfd('0x10')]:_0x16ef5c[_0x2bfd('0x10')])+0x1;_0x1c9bc3['extensions']=_[_0x2bfd('0x3c')](_0x1c9bc3[_0x2bfd('0x11')],_0x1959da,[_0x16ef5c],_0x334082);}_0x1c9bc3['extensions'][_0x2bfd('0x14')]({'type':_0x3fc659[_0x3ac537][0x0][_0x2bfd('0x15')],'app':'Hangup','exten':_0x3fc659[_0x3ac537][0x0][_0x2bfd('0x9')],'context':_0x3fc659[_0x3ac537][0x0]['context'],'priority':_0x1c9bc3[_0x2bfd('0x10')],'VoiceExtensionId':_0x3fc659[_0x3ac537][0x0][_0x2bfd('0x18')]});_0x1cd265[_0x2bfd('0x14')](_0x3fc659[_0x3ac537][0x0]['VoiceExtensionId']);_0x3943c4=_['concat'](_0x3943c4,_0x1c9bc3[_0x2bfd('0x11')]);}}return _0x5caff9[_0x2bfd('0x3d')](function(_0x4b5b04){return _0x5caff9[_0x2bfd('0x1')]['VoiceExtension'][_0x2bfd('0x3e')]({'where':{'VoiceExtensionId':{'$in':_0x1cd265}},'transaction':_0x4b5b04})[_0x2bfd('0x3')](function(_0xb3fd48){return _0x5caff9[_0x2bfd('0x1')][_0x2bfd('0x5')][_0x2bfd('0x3f')](_[_0x2bfd('0x40')](_0x3943c4,_0x2bfd('0x10')),{'transaction':_0x4b5b04});});});})[_0x2bfd('0x41')](function(_0x4a707b){console['error'](_0x4a707b);});}exports[_0x2bfd('0x42')]=rewrite; \ No newline at end of file +var _0xfba0=['${EXTEN}','CDR(routeid)=','ExecIf','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','length','updatedAt','interval','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','answer','indexOf','app','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','destroy','catch','error','rewrite','lodash','util','models','Interval','findAll','then','intervals','IntervalId','VoiceExtension','uniq','map','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','playback','hasOwnProperty','extensions','extension','find','exten','push','type','Set','format','CDR(type)=%s','context','priority','VoiceExtensionId','inbound','outbound','CDR(destination)=','cutdigits','${EXTEN:'];(function(_0x48cc13,_0x2365ca){var _0x49a422=function(_0x4fffba){while(--_0x4fffba){_0x48cc13['push'](_0x48cc13['shift']());}};_0x49a422(++_0x2365ca);}(_0xfba0,0x138));var _0x0fba=function(_0x39377c,_0x472e53){_0x39377c=_0x39377c-0x0;var _0x54423e=_0xfba0[_0x39377c];return _0x54423e;};'use strict';var _=require(_0x0fba('0x0'));var util=require(_0x0fba('0x1'));function rewrite(_0x27ec99,_0x4f2407){var _0x978fbe=this;return _0x27ec99[_0x0fba('0x2')][_0x0fba('0x3')][_0x0fba('0x4')]({'raw':!![]})[_0x0fba('0x5')](function(_0x38dfcb){_0x978fbe[_0x0fba('0x6')]=_0x38dfcb;return _0x27ec99[_0x0fba('0x2')]['VoiceExtension'][_0x0fba('0x4')]({'where':{'IntervalId':_0x4f2407[_0x0fba('0x7')]},'raw':!![]});})[_0x0fba('0x5')](function(_0xd2cb0c){return _0x27ec99[_0x0fba('0x2')][_0x0fba('0x8')][_0x0fba('0x4')]({'where':{'exten':{'$in':_[_0x0fba('0x9')](_[_0x0fba('0xa')](_0xd2cb0c,'exten'))}},'order':[{'raw':_0x0fba('0xb')}],'raw':!![]});})[_0x0fba('0x5')](function(_0x514429){var _0x147759=_[_0x0fba('0xc')](_0x514429,{'priority':'1'});var _0x5ec07f=_[_0x0fba('0xc')](_0x514429,{'isApp':0x1});var _0x728662=_[_0x0fba('0xd')](_0x5ec07f,'exten');var _0x593783=['queue',_0x0fba('0xe')];var _0x45eca9=[];var _0xbade5b=[];for(var _0x49b5d9 in _0x728662){if(_0x728662[_0x0fba('0xf')](_0x49b5d9)){_0x978fbe['priority']=0x2;_0x978fbe[_0x0fba('0x10')]=[];_0x978fbe[_0x0fba('0x11')]=_[_0x0fba('0x12')](_0x147759,{'exten':_0x728662[_0x49b5d9][0x0][_0x0fba('0x13')]});_0x978fbe[_0x0fba('0x10')][_0x0fba('0x14')]({'type':_0x728662[_0x49b5d9][0x0][_0x0fba('0x15')],'app':_0x0fba('0x16'),'appdata':util[_0x0fba('0x17')](_0x0fba('0x18'),_0x728662[_0x49b5d9][0x0][_0x0fba('0x15')]),'context':_0x728662[_0x49b5d9][0x0][_0x0fba('0x19')],'exten':_0x728662[_0x49b5d9][0x0][_0x0fba('0x13')],'priority':_0x978fbe[_0x0fba('0x1a')]++,'VoiceExtensionId':_0x728662[_0x49b5d9][0x0][_0x0fba('0x1b')]});if(_0x728662[_0x49b5d9][0x0][_0x0fba('0x15')]===_0x0fba('0x1c')){_0x978fbe[_0x0fba('0x10')][_0x0fba('0x14')]({'type':_0x728662[_0x49b5d9][0x0][_0x0fba('0x15')],'app':'Set','appdata':'CDR(routeid)='+_0x728662[_0x49b5d9][0x0][_0x0fba('0x1b')],'context':_0x728662[_0x49b5d9][0x0][_0x0fba('0x19')],'exten':_0x728662[_0x49b5d9][0x0][_0x0fba('0x13')],'priority':_0x978fbe['priority']++,'VoiceExtensionId':_0x728662[_0x49b5d9][0x0]['VoiceExtensionId']});}else if(_0x728662[_0x49b5d9][0x0]['type']===_0x0fba('0x1d')){if(_0x978fbe[_0x0fba('0x11')]){_0x978fbe[_0x0fba('0x10')][_0x0fba('0x14')]({'type':_0x728662[_0x49b5d9][0x0][_0x0fba('0x15')],'app':_0x0fba('0x16'),'appdata':_0x0fba('0x1e')+(_0x978fbe['extension'][_0x0fba('0x1f')]?_0x0fba('0x20')+_0x978fbe[_0x0fba('0x11')]['cutdigits']+'}':_0x0fba('0x21')),'context':_0x728662[_0x49b5d9][0x0][_0x0fba('0x19')],'exten':_0x728662[_0x49b5d9][0x0]['exten'],'priority':_0x978fbe[_0x0fba('0x1a')]++,'VoiceExtensionId':_0x728662[_0x49b5d9][0x0][_0x0fba('0x1b')]});}_0x978fbe[_0x0fba('0x10')][_0x0fba('0x14')]({'type':_0x728662[_0x49b5d9][0x0][_0x0fba('0x15')],'app':_0x0fba('0x16'),'appdata':_0x0fba('0x22')+_0x728662[_0x49b5d9][0x0]['VoiceExtensionId'],'context':_0x728662[_0x49b5d9][0x0][_0x0fba('0x19')],'exten':_0x728662[_0x49b5d9][0x0][_0x0fba('0x13')],'priority':_0x978fbe[_0x0fba('0x1a')]++,'VoiceExtensionId':_0x728662[_0x49b5d9][0x0]['VoiceExtensionId']});var _0x4d4cdc=_0x978fbe['priority']++;_0x978fbe[_0x0fba('0x10')][_0x0fba('0x14')]({'type':_0x728662[_0x49b5d9][0x0][_0x0fba('0x15')],'app':_0x0fba('0x23'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x4d4cdc+0x2)+'):Goto('+(_0x4d4cdc+0x1)+')','context':_0x728662[_0x49b5d9][0x0]['context'],'exten':_0x728662[_0x49b5d9][0x0][_0x0fba('0x13')],'priority':_0x4d4cdc,'VoiceExtensionId':_0x728662[_0x49b5d9][0x0]['VoiceExtensionId']});if(_0x978fbe['extension']){_0x978fbe[_0x0fba('0x10')][_0x0fba('0x14')]({'type':_0x728662[_0x49b5d9][0x0][_0x0fba('0x15')],'app':'Set','appdata':_0x978fbe[_0x0fba('0x11')]['cutdigits']?'CDR(prefix)=${EXTEN:0:'+_0x978fbe[_0x0fba('0x11')][_0x0fba('0x1f')]+'}':_0x0fba('0x24'),'context':_0x728662[_0x49b5d9][0x0][_0x0fba('0x19')],'exten':_0x728662[_0x49b5d9][0x0][_0x0fba('0x13')],'priority':_0x978fbe['priority']++,'VoiceExtensionId':_0x728662[_0x49b5d9][0x0][_0x0fba('0x1b')]});}_0x978fbe[_0x0fba('0x10')][_0x0fba('0x14')]({'type':_0x728662[_0x49b5d9][0x0][_0x0fba('0x15')],'app':'Set','appdata':_0x0fba('0x25')+_0x728662[_0x49b5d9][0x0][_0x0fba('0x1b')],'context':_0x728662[_0x49b5d9][0x0][_0x0fba('0x19')],'exten':_0x728662[_0x49b5d9][0x0][_0x0fba('0x13')],'priority':_0x978fbe[_0x0fba('0x1a')]++,'VoiceExtensionId':_0x728662[_0x49b5d9][0x0][_0x0fba('0x1b')]});if(_0x978fbe[_0x0fba('0x11')]&&_0x978fbe[_0x0fba('0x11')][_0x0fba('0xf')](_0x0fba('0x26'))&&_0x978fbe[_0x0fba('0x11')][_0x0fba('0x26')]!==_0x0fba('0x27')){_0x978fbe['extensions'][_0x0fba('0x14')]({'type':_0x728662[_0x49b5d9][0x0][_0x0fba('0x15')],'app':_0x0fba('0x16'),'appdata':_0x0fba('0x28'),'context':_0x728662[_0x49b5d9][0x0][_0x0fba('0x19')],'exten':_0x728662[_0x49b5d9][0x0][_0x0fba('0x13')],'priority':_0x978fbe[_0x0fba('0x1a')]++,'VoiceExtensionId':_0x728662[_0x49b5d9][0x0]['VoiceExtensionId']});_0x978fbe['extensions'][_0x0fba('0x14')]({'type':_0x728662[_0x49b5d9][0x0][_0x0fba('0x15')],'app':_0x0fba('0x16'),'appdata':_0x0fba('0x29')+_0x978fbe[_0x0fba('0x11')][_0x0fba('0x26')]||_0x0fba('0x2a'),'context':_0x728662[_0x49b5d9][0x0][_0x0fba('0x19')],'exten':_0x728662[_0x49b5d9][0x0][_0x0fba('0x13')],'priority':_0x978fbe[_0x0fba('0x1a')]++,'VoiceExtensionId':_0x728662[_0x49b5d9][0x0]['VoiceExtensionId']});}}_0x978fbe[_0x0fba('0x10')]['push']({'type':_0x728662[_0x49b5d9][0x0][_0x0fba('0x15')],'app':_0x0fba('0x16'),'appdata':_0x0fba('0x2b'),'context':_0x728662[_0x49b5d9][0x0][_0x0fba('0x19')],'exten':_0x728662[_0x49b5d9][0x0][_0x0fba('0x13')],'priority':_0x978fbe[_0x0fba('0x1a')]++,'VoiceExtensionId':_0x728662[_0x49b5d9][0x0][_0x0fba('0x1b')]});_0x978fbe[_0x0fba('0x10')][_0x0fba('0x14')]({'type':_0x728662[_0x49b5d9][0x0]['type'],'app':'Set','appdata':_0x0fba('0x2c'),'context':_0x728662[_0x49b5d9][0x0][_0x0fba('0x19')],'exten':_0x728662[_0x49b5d9][0x0][_0x0fba('0x13')],'priority':_0x978fbe['priority']++,'VoiceExtensionId':_0x728662[_0x49b5d9][0x0]['VoiceExtensionId']});_0x978fbe[_0x0fba('0x10')][_0x0fba('0x14')]({'type':_0x728662[_0x49b5d9][0x0]['type'],'app':_0x0fba('0x16'),'appdata':'MONITOR_OPTIONS=ab','context':_0x728662[_0x49b5d9][0x0][_0x0fba('0x19')],'exten':_0x728662[_0x49b5d9][0x0][_0x0fba('0x13')],'priority':_0x978fbe[_0x0fba('0x1a')]++,'VoiceExtensionId':_0x728662[_0x49b5d9][0x0][_0x0fba('0x1b')]});for(var _0x1721a7=0x0,_0x390d95=0x0;_0x1721a7<_0x728662[_0x49b5d9][_0x0fba('0x2d')];_0x1721a7+=0x1,_0x390d95=0x0){var _0x5cae32=_0x728662[_0x49b5d9][_0x1721a7];if(_0x5cae32[_0x0fba('0x15')]){_0x5cae32[_0x0fba('0x15')]=_0x5cae32[_0x0fba('0x15')]['toLowerCase']();}var _0x100990=[];var _0x1f23ef=[];delete _0x5cae32['id'];delete _0x5cae32['createdAt'];delete _0x5cae32[_0x0fba('0x2e')];var _0x16b33b=_0x5cae32['interval']!=='*,*,*,*'?[_0x5cae32[_0x0fba('0x2f')]]:_0x5cae32[_0x0fba('0x7')]?_[_0x0fba('0xa')](_[_0x0fba('0xc')](_0x978fbe[_0x0fba('0x6')],{'IntervalId':_0x5cae32['IntervalId']}),'interval'):[];if(_0x5cae32[_0x0fba('0xf')](_0x0fba('0x30'))){if(_0x5cae32[_0x0fba('0x30')]&&_0x5cae32[_0x0fba('0x30')]!=='--'){_0x100990[_0x0fba('0x14')]({'type':_0x5cae32[_0x0fba('0x15')],'app':_0x0fba('0x16'),'appdata':_0x0fba('0x31')+_0x5cae32[_0x0fba('0x30')],'context':_0x5cae32[_0x0fba('0x19')],'exten':_0x5cae32[_0x0fba('0x13')],'priority':_0x16b33b[_0x0fba('0x2d')]+_0x978fbe[_0x0fba('0x1a')]+_0x390d95++,'VoiceExtensionId':_0x5cae32[_0x0fba('0x1b')]});}}if(_0x5cae32[_0x0fba('0x15')]==='outbound'&&_0x5cae32[_0x0fba('0xf')](_0x0fba('0x32'))){if(_0x5cae32['callerID']){_0x100990['push']({'type':_0x5cae32['type'],'app':'ExecIf','appdata':_0x0fba('0x33')+_0x5cae32['callerID']+')','context':_0x5cae32[_0x0fba('0x19')],'exten':_0x5cae32[_0x0fba('0x13')],'priority':_0x16b33b[_0x0fba('0x2d')]+_0x978fbe['priority']+_0x390d95++,'VoiceExtensionId':_0x5cae32[_0x0fba('0x1b')]});}else{_0x100990[_0x0fba('0x14')]({'type':_0x5cae32[_0x0fba('0x15')],'app':'ExecIf','appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x5cae32['context'],'exten':_0x5cae32[_0x0fba('0x13')],'priority':_0x16b33b['length']+_0x978fbe[_0x0fba('0x1a')]+_0x390d95++,'VoiceExtensionId':_0x5cae32[_0x0fba('0x1b')]});}}if(_0x5cae32[_0x0fba('0xf')](_0x0fba('0x34'))){if(_0x593783[_0x0fba('0x35')](_0x5cae32[_0x0fba('0x36')]['toLowerCase']())>=0x0&&_0x5cae32['appType']!=='custom'){if(_0x5cae32['answer']){_0x100990[_0x0fba('0x14')]({'type':_0x5cae32['type'],'app':_0x0fba('0x23'),'appdata':_0x0fba('0x37'),'context':_0x5cae32[_0x0fba('0x19')],'exten':_0x5cae32['exten'],'priority':_0x16b33b['length']+_0x978fbe[_0x0fba('0x1a')]+_0x390d95++,'VoiceExtensionId':_0x5cae32[_0x0fba('0x1b')]});_0x100990['push']({'type':_0x5cae32['type'],'app':_0x0fba('0x16'),'appdata':_0x0fba('0x38'),'context':_0x5cae32['context'],'exten':_0x5cae32[_0x0fba('0x13')],'priority':_0x16b33b[_0x0fba('0x2d')]+_0x978fbe[_0x0fba('0x1a')]+_0x390d95++,'VoiceExtensionId':_0x5cae32[_0x0fba('0x1b')]});}else{_0x100990[_0x0fba('0x14')]({'type':_0x5cae32['type'],'app':_0x0fba('0x23'),'appdata':_0x0fba('0x39'),'context':_0x5cae32[_0x0fba('0x19')],'exten':_0x5cae32[_0x0fba('0x13')],'priority':_0x16b33b['length']+_0x978fbe[_0x0fba('0x1a')]+_0x390d95++,'VoiceExtensionId':_0x5cae32[_0x0fba('0x1b')]});_0x100990[_0x0fba('0x14')]({'type':_0x5cae32['type'],'app':_0x0fba('0x16'),'appdata':_0x0fba('0x3a'),'context':_0x5cae32[_0x0fba('0x19')],'exten':_0x5cae32['exten'],'priority':_0x16b33b[_0x0fba('0x2d')]+_0x978fbe[_0x0fba('0x1a')]+_0x390d95++,'VoiceExtensionId':_0x5cae32[_0x0fba('0x1b')]});}}}for(var _0x445baf=0x0;_0x445baf<_0x16b33b['length'];_0x445baf+=0x1){var _0x3774f7=_0x978fbe[_0x0fba('0x1a')]+_0x16b33b[_0x0fba('0x2d')];var _0x45ca62=_0x445baf===_0x16b33b[_0x0fba('0x2d')]-0x1?_0x978fbe[_0x0fba('0x1a')]+_0x100990[_0x0fba('0x2d')]+_0x1f23ef[_0x0fba('0x2d')]+0x2:_0x978fbe[_0x0fba('0x1a')]+_0x445baf+0x1;_0x100990['splice'](_0x445baf,0x0,{'type':_0x5cae32[_0x0fba('0x15')],'app':_0x0fba('0x3b'),'appdata':_0x16b33b[_0x445baf]+'?'+_0x5cae32[_0x0fba('0x19')]+',${EXTEN},'+_0x3774f7+':'+_0x5cae32[_0x0fba('0x19')]+_0x0fba('0x3c')+_0x45ca62,'exten':_0x5cae32[_0x0fba('0x13')],'context':_0x5cae32[_0x0fba('0x19')],'priority':_0x978fbe[_0x0fba('0x1a')]+_0x445baf,'VoiceExtensionId':_0x728662[_0x49b5d9][0x0][_0x0fba('0x1b')]});}_0x5cae32[_0x0fba('0x1a')]=_0x100990[_0x0fba('0x2d')]?_[_0x0fba('0x3d')](_0x100990)[_0x0fba('0x1a')]+0x1:_0x978fbe[_0x0fba('0x1a')];_0x978fbe[_0x0fba('0x1a')]=(_0x1f23ef[_0x0fba('0x2d')]?_[_0x0fba('0x3d')](_0x1f23ef)[_0x0fba('0x1a')]:_0x5cae32[_0x0fba('0x1a')])+0x1;_0x978fbe['extensions']=_[_0x0fba('0x3e')](_0x978fbe[_0x0fba('0x10')],_0x100990,[_0x5cae32],_0x1f23ef);}_0x978fbe[_0x0fba('0x10')][_0x0fba('0x14')]({'type':_0x728662[_0x49b5d9][0x0]['type'],'app':_0x0fba('0x3f'),'exten':_0x728662[_0x49b5d9][0x0][_0x0fba('0x13')],'context':_0x728662[_0x49b5d9][0x0][_0x0fba('0x19')],'priority':_0x978fbe[_0x0fba('0x1a')],'VoiceExtensionId':_0x728662[_0x49b5d9][0x0][_0x0fba('0x1b')]});_0x45eca9[_0x0fba('0x14')](_0x728662[_0x49b5d9][0x0][_0x0fba('0x1b')]);_0xbade5b=_[_0x0fba('0x3e')](_0xbade5b,_0x978fbe[_0x0fba('0x10')]);}}return _0x27ec99[_0x0fba('0x40')](function(_0x539043){return _0x27ec99['models']['VoiceExtension'][_0x0fba('0x41')]({'where':{'VoiceExtensionId':{'$in':_0x45eca9}},'transaction':_0x539043})['then'](function(_0x49c989){return _0x27ec99[_0x0fba('0x2')][_0x0fba('0x8')]['bulkCreate'](_['sortBy'](_0xbade5b,_0x0fba('0x1a')),{'transaction':_0x539043});});});})[_0x0fba('0x42')](function(_0x46808b){console[_0x0fba('0x43')](_0x46808b);});}exports[_0x0fba('0x44')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 2ddb7fa..a2f0731 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 _0x7993=['../../../api/cmContact/cmContact.socket','register','argv','undefined','Missing\x20filepath\x20parameter!','null','Missing\x20binding\x20parameters!','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','test','isNil','errors','length','map','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','Duplicate\x20Contact','CmContact','create','keys','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','insert','into','cm_hopper','fromQuery','ContactId','createdAt','updatedAt','select','field','NOW()','scheduledAt','from','cm_contacts','deletedAt\x20IS\x20NULL','where','ListId\x20=\x20?','toString','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','id\x20IN\x20?','calleridnum','str','phone\x20IS\x20NOT\x20NULL','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','get','always','sequelize','VoiceQueueId','onlyIfOpen','query','CampaignId','Campaign','BlackLists','cmContact,\x20%s,\x20%s','all','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','info','CSV\x20import\x20process\x20stopped!','createReadStream','parse','duplicate','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','squel','papaparse','ioredis','../../../mysqldb','../../../config/environment','redis','defaults','localhost','socket.io-emitter'];(function(_0x260859,_0x3cfcff){var _0x4b77f8=function(_0x2e48f8){while(--_0x2e48f8){_0x260859['push'](_0x260859['shift']());}};_0x4b77f8(++_0x3cfcff);}(_0x7993,0x1cc));var _0x3799=function(_0x2a58f4,_0x13885b){_0x2a58f4=_0x2a58f4-0x0;var _0x58ef72=_0x7993[_0x2a58f4];return _0x58ef72;};'use strict';var BPromise=require(_0x3799('0x0'));var util=require(_0x3799('0x1'));var _=require(_0x3799('0x2'));var fs=require('fs');var squel=require(_0x3799('0x3'));var Papa=require(_0x3799('0x4'));var Redis=require(_0x3799('0x5'));var db=require(_0x3799('0x6'))['db'];var config=require(_0x3799('0x7'));var logger=require('../../../config/logger')('api');config[_0x3799('0x8')]=_[_0x3799('0x9')](config['redis'],{'host':_0x3799('0xa'),'port':0x18eb});var socket=require(_0x3799('0xb'))(new Redis(config[_0x3799('0x8')]));require(_0x3799('0xc'))[_0x3799('0xd')](socket);try{if(!process[_0x3799('0xe')][0x2]||process['argv'][0x2]===_0x3799('0xf')||process[_0x3799('0xe')][0x2]==='null'){throw new Error(_0x3799('0x10'));}var FILEPATH=process['argv'][0x2];if(!process['argv'][0x3]||process[_0x3799('0xe')][0x3]===_0x3799('0xf')||process[_0x3799('0xe')][0x3]==='null'||!process['argv'][0x4]||process['argv'][0x4]==='undefined'||process[_0x3799('0xe')][0x4]===_0x3799('0x11')){throw new Error(_0x3799('0x12'));}var FIELDS=_['zipObject'](process[_0x3799('0xe')][0x3][_0x3799('0x13')](','),process[_0x3799('0xe')][0x4][_0x3799('0x13')](','));if(!process[_0x3799('0xe')][0x5]||process['argv'][0x5]===_0x3799('0xf')||process[_0x3799('0xe')][0x5]===_0x3799('0x11')){throw new Error(_0x3799('0x14'));}var LISTID=process[_0x3799('0xe')][0x5];var COMPANYID=process[_0x3799('0xe')][0x6]&&process['argv'][0x6]!==_0x3799('0xf')&&process[_0x3799('0xe')][0x6]!==_0x3799('0x11')?process[_0x3799('0xe')][0x6]:null;var DUPLICATES=process[_0x3799('0xe')][0x7]&&process[_0x3799('0xe')][0x7]!==_0x3799('0xf')&&process[_0x3799('0xe')][0x7]!==_0x3799('0x11')?process[_0x3799('0xe')][0x7]:null;if(!process['argv'][0x8]||process[_0x3799('0xe')][0x8]===_0x3799('0xf')||process[_0x3799('0xe')][0x8]===_0x3799('0x11')){throw new Error(_0x3799('0x15'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x22d8a3){logger[_0x3799('0x16')](_0x22d8a3);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(_0x4ce57e,_0x566a17,_0x1fbf1f,_0x153b71){var _0x2f3a95={'message':_0x566a17};_0x2f3a95[_0x4ce57e]=!![];if(_0x1fbf1f){_0x2f3a95[_0x3799('0x17')]=_0x1fbf1f;}if(_0x153b71){_0x2f3a95[_0x3799('0x18')]=_0x153b71;}return _0x2f3a95;}function isEmail(_0x31849e){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))*$/[_0x3799('0x19')](_0x31849e);}function checkRow(_0x288ae3,_0x2e9ceb,_0x4a2f52){return new BPromise(function(_0x27b1ef,_0x3cdaa8){if(_[_0x3799('0x1a')](_0x288ae3)){return _0x3cdaa8(handleCheckRowError(_0x3799('0x16'),'The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x4a2f52));}if(_0x288ae3['errors']&&_0x288ae3[_0x3799('0x1b')][_0x3799('0x1c')]){var _0xf7ffb6=_[_0x3799('0x1d')](_0x288ae3[_0x3799('0x1b')],_0x3799('0x1e'))[_0x3799('0x1f')](';');return _0x3cdaa8(handleCheckRowError('error',_0xf7ffb6,null,_0x4a2f52));}var _0x46f99a={};for(var _0x27c1de in FIELDS){if(FIELDS[_0x3799('0x20')](_0x27c1de)&&FIELDS[_0x27c1de]){_0x46f99a[_0x27c1de]=_0x288ae3['data'][0x0][FIELDS[_0x27c1de]]||_0x288ae3[_0x3799('0x21')][0x0]['\ufeff'+FIELDS[_0x27c1de]];}}if(!_0x46f99a[_0x3799('0x22')]){return _0x3cdaa8(handleCheckRowError(_0x3799('0x16'),_0x3799('0x23'),null,_0x4a2f52));}if(!_0x46f99a[_0x3799('0x24')]){return _0x3cdaa8(handleCheckRowError(_0x3799('0x16'),_0x3799('0x25'),null,_0x4a2f52));}if(_0x46f99a[_0x3799('0x26')]){var _0x38751f=moment(_0x46f99a[_0x3799('0x26')],_0x3799('0x27'));if(!_0x38751f[_0x3799('0x28')]()){return _0x3cdaa8(handleCheckRowError('error',_0x3799('0x29'),null,_0x4a2f52));}}if(_0x46f99a[_0x3799('0x2a')]){if(!isEmail(_0x46f99a[_0x3799('0x2a')])){return _0x3cdaa8(handleCheckRowError('error',_0x3799('0x2b'),null,_0x4a2f52));}}_0x46f99a[_0x3799('0x2c')]=LISTID;_0x46f99a[_0x3799('0x2d')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x3799('0x1c')]&&_0x2e9ceb){var _0x2f3242={};for(var _0x358b89=0x0,_0x27b3ed=DUPLICATES[_0x3799('0x1c')];_0x358b89<_0x27b3ed;_0x358b89+=0x1){_0x2f3242[DUPLICATES[_0x358b89]]=_0x46f99a[DUPLICATES[_0x358b89]];}var _0x4ec646=_[_0x3799('0x2e')](_0x2e9ceb,_0x2f3242);if(_0x4ec646){return _0x3cdaa8(handleCheckRowError('duplicate',_0x3799('0x2f'),_0x4ec646,_0x4a2f52));}}return db[_0x3799('0x30')][_0x3799('0x31')](_0x46f99a,{'raw':!![],'hooks':![],'fields':_[_0x3799('0x32')](_0x46f99a)})[_0x3799('0x33')](function(_0x41b278){if(DUPLICATES&&DUPLICATES[_0x3799('0x1c')]&&_0x2e9ceb){_0x2e9ceb[_0x3799('0x34')](_[_0x3799('0x35')](_0x46f99a,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x41b278['id'];return _0x27b1ef();})[_0x3799('0x36')](function(_0x3bcf99){return _0x3cdaa8(handleCheckRowError('error',_0x3799('0x37')+(_0x3bcf99['message']||JSON[_0x3799('0x38')](_0x3bcf99)),null,_0x4a2f52));});});}function checkHopper(){function _0x33b61b(){return function(_0x549d16){logger[_0x3799('0x16')](_0x3799('0x39'),_0x3799('0x3a'),util[_0x3799('0x3b')](_0x549d16,{'showHidden':![],'depth':null}));};}var _0x2bc1ed=function(_0x812e6c,_0x169df6){var _0x36fd16=squel[_0x3799('0x3c')]()[_0x3799('0x3d')](_0x3799('0x3e'))[_0x3799('0x3f')]([_0x3799('0x24'),'scheduledAt',_0x3799('0x40'),_0x3799('0x2c'),_0x169df6,_0x3799('0x41'),_0x3799('0x42')],squel[_0x3799('0x43')]()[_0x3799('0x44')]('phone',_0x3799('0x24'))['field'](_0x3799('0x45'),_0x3799('0x46'))['field']('id',_0x3799('0x40'))['field'](LISTID['toString'](),'ListId')[_0x3799('0x44')](_0x812e6c['id']['toString'](),_0x169df6)[_0x3799('0x44')](_0x3799('0x45'),_0x3799('0x41'))[_0x3799('0x44')]('NOW()',_0x3799('0x42'))[_0x3799('0x47')](_0x3799('0x48'))['where'](_0x3799('0x49'))[_0x3799('0x4a')](_0x3799('0x4b'),LISTID[_0x3799('0x4c')]())[_0x3799('0x4a')]('phone\x20IS\x20NOT\x20NULL')[_0x3799('0x4a')](_0x3799('0x4d'),squel[_0x3799('0x43')]()[_0x3799('0x44')](_0x3799('0x24'))[_0x3799('0x47')](_0x3799('0x3e'))[_0x3799('0x4a')](_0x169df6+_0x3799('0x4e'),_0x812e6c['id'][_0x3799('0x4c')]())))[_0x3799('0x4c')]();return _0x36fd16;};var _0x3bb336=function(_0x39fef0,_0x2560d9){var _0x2606d7=squel[_0x3799('0x3c')]()[_0x3799('0x3d')](_0x3799('0x3e'))[_0x3799('0x3f')]([_0x3799('0x24'),_0x3799('0x46'),_0x3799('0x40'),_0x3799('0x2c'),_0x2560d9,'createdAt',_0x3799('0x42')],squel[_0x3799('0x43')]()[_0x3799('0x44')](_0x3799('0x24'),_0x3799('0x24'))[_0x3799('0x44')](_0x3799('0x45'),_0x3799('0x46'))[_0x3799('0x44')]('id',_0x3799('0x40'))['field'](LISTID[_0x3799('0x4c')](),_0x3799('0x2c'))[_0x3799('0x44')](_0x39fef0['id'][_0x3799('0x4c')](),_0x2560d9)[_0x3799('0x44')](_0x3799('0x45'),_0x3799('0x41'))[_0x3799('0x44')]('NOW()',_0x3799('0x42'))['from']('cm_contacts')[_0x3799('0x4a')](_0x3799('0x49'))[_0x3799('0x4a')](_0x3799('0x4b'),LISTID['toString']())[_0x3799('0x4a')](_0x3799('0x4f'),squel['str'](hopperContacts))[_0x3799('0x4a')]('phone\x20IS\x20NOT\x20NULL')[_0x3799('0x4a')](_0x3799('0x4d'),squel['select']()[_0x3799('0x44')](_0x3799('0x50'))[_0x3799('0x47')]('cm_hopper_final')[_0x3799('0x4a')](_0x2560d9+'\x20=\x20?',_0x39fef0['id'][_0x3799('0x4c')]()))['where'](_0x3799('0x4d'),squel[_0x3799('0x43')]()[_0x3799('0x44')](_0x3799('0x24'))[_0x3799('0x47')]('cm_hopper')[_0x3799('0x4a')](_0x2560d9+_0x3799('0x4e'),_0x39fef0['id'][_0x3799('0x4c')]())))[_0x3799('0x4c')]();return _0x2606d7;};function _0x4e2d46(_0x2dbca6,_0x598d40){var _0x20f5a3=squel[_0x3799('0x3c')]()[_0x3799('0x3d')](_0x3799('0x3e'))[_0x3799('0x3f')]([_0x3799('0x24'),_0x3799('0x46'),'ContactId','ListId',_0x598d40,_0x3799('0x41'),_0x3799('0x42')],squel[_0x3799('0x43')]()[_0x3799('0x44')](_0x3799('0x24'),_0x3799('0x24'))[_0x3799('0x44')](_0x3799('0x45'),'scheduledAt')[_0x3799('0x44')]('id','ContactId')['field'](LISTID['toString'](),_0x3799('0x2c'))[_0x3799('0x44')](_0x2dbca6['id'][_0x3799('0x4c')](),_0x598d40)[_0x3799('0x44')]('NOW()','createdAt')[_0x3799('0x44')]('NOW()',_0x3799('0x42'))['from'](_0x3799('0x48'))[_0x3799('0x4a')](_0x3799('0x49'))[_0x3799('0x4a')]('ListId\x20=\x20?',LISTID[_0x3799('0x4c')]())[_0x3799('0x4a')]('id\x20IN\x20?',squel[_0x3799('0x51')](hopperContacts))[_0x3799('0x4a')](_0x3799('0x52')))[_0x3799('0x4c')]();return _0x20f5a3;}function _0x12b154(_0x15bb96,_0x1b8cf6){var _0x27ba01=squel['insert']()[_0x3799('0x3d')](_0x3799('0x53'))[_0x3799('0x3f')]([_0x3799('0x24'),'ContactId','ListId',_0x1b8cf6,_0x3799('0x41'),'updatedAt'],squel[_0x3799('0x43')]()[_0x3799('0x44')](_0x3799('0x24'),'phone')[_0x3799('0x44')]('id',_0x3799('0x40'))[_0x3799('0x44')](LISTID[_0x3799('0x4c')](),_0x3799('0x2c'))[_0x3799('0x44')](_0x15bb96['id']['toString'](),_0x1b8cf6)['field'](_0x3799('0x45'),_0x3799('0x41'))[_0x3799('0x44')](_0x3799('0x45'),_0x3799('0x42'))[_0x3799('0x47')](_0x3799('0x48'))[_0x3799('0x4a')](_0x3799('0x49'))['where'](_0x3799('0x4b'),LISTID['toString']())[_0x3799('0x4a')](_0x3799('0x4f'),squel[_0x3799('0x51')](hopperContacts))['where'](_0x3799('0x52')))[_0x3799('0x4c')]();return _0x27ba01;}return db[_0x3799('0x54')][_0x3799('0x55')]({'where':{'type':_0x3799('0x56')},'attributes':['id',_0x3799('0x57')],'include':[{'model':db[_0x3799('0x58')],'as':_0x3799('0x59'),'where':{'id':LISTID}}]})[_0x3799('0x33')](function(_0x3aa170){var _0x3bf8da=[];if(_0x3aa170){var _0x5a275a;for(var _0x423804=0x0,_0x3f780d;_0x423804<_0x3aa170[_0x3799('0x1c')];_0x423804+=0x1){_0x3f780d=_0x3aa170[_0x423804][_0x3799('0x5a')]({'plain':!![]});switch(_0x3f780d['dialCheckDuplicateType']){case _0x3799('0x5b'):_0x3bf8da[_0x3799('0x34')](db[_0x3799('0x5c')]['query'](_0x3bb336(_0x3f780d,_0x3799('0x5d')))[_0x3799('0x33')](function(){})[_0x3799('0x36')](_0x33b61b()));break;case _0x3799('0x5e'):_0x3bf8da[_0x3799('0x34')](db[_0x3799('0x5c')][_0x3799('0x5f')](_0x2bc1ed(_0x3f780d,'VoiceQueueId'))[_0x3799('0x33')](function(){})['catch'](_0x33b61b()));break;default:_0x3bf8da[_0x3799('0x34')](db['sequelize']['query'](_0x4e2d46(_0x3f780d,_0x3799('0x5d')))[_0x3799('0x33')](function(){})['catch'](_0x33b61b()));}}}return _0x3bf8da;})['all']()['then'](function(){return db['VoiceQueue'][_0x3799('0x55')]({'where':{'type':_0x3799('0x56')},'attributes':['id'],'include':[{'model':db[_0x3799('0x58')],'as':'BlackLists','where':{'id':LISTID}}]})['then'](function(_0x63baa0){var _0xa0f354=[];if(_0x63baa0){var _0x1684eb;for(var _0x2cfadf=0x0,_0x41b878;_0x2cfadf<_0x63baa0[_0x3799('0x1c')];_0x2cfadf+=0x1){_0x41b878=_0x63baa0[_0x2cfadf][_0x3799('0x5a')]({'plain':!![]});_0xa0f354[_0x3799('0x34')](db[_0x3799('0x5c')][_0x3799('0x5f')](_0x12b154(_0x41b878,_0x3799('0x5d')))[_0x3799('0x33')](function(){})[_0x3799('0x36')](_0x33b61b()));}}return _0xa0f354;})['all']();})['then'](function(){return db['Campaign'][_0x3799('0x55')]({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x3799('0x58')],'as':_0x3799('0x59'),'where':{'id':LISTID}}]})[_0x3799('0x33')](function(_0x375298){var _0x5a7bf0=[];if(_0x375298){for(var _0x4ee59e=0x0,_0x5c39c4;_0x4ee59e<_0x375298[_0x3799('0x1c')];_0x4ee59e+=0x1){_0x5c39c4=_0x375298[_0x4ee59e][_0x3799('0x5a')]({'plain':!![]});switch(_0x5c39c4[_0x3799('0x57')]){case _0x3799('0x5b'):_0x5a7bf0[_0x3799('0x34')](db[_0x3799('0x5c')][_0x3799('0x5f')](_0x3bb336(_0x5c39c4,'CampaignId'))[_0x3799('0x33')](function(){})['catch'](_0x33b61b()));break;case _0x3799('0x5e'):_0x5a7bf0[_0x3799('0x34')](db[_0x3799('0x5c')][_0x3799('0x5f')](_0x2bc1ed(_0x5c39c4,_0x3799('0x60')))[_0x3799('0x33')](function(){})[_0x3799('0x36')](_0x33b61b()));break;default:_0x5a7bf0[_0x3799('0x34')](db[_0x3799('0x5c')][_0x3799('0x5f')](_0x4e2d46(_0x5c39c4,_0x3799('0x60')))[_0x3799('0x33')](function(){})[_0x3799('0x36')](_0x33b61b()));}}}return _0x5a7bf0;})['all']();})[_0x3799('0x33')](function(){return db[_0x3799('0x61')][_0x3799('0x55')]({'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x3799('0x62'),'where':{'id':LISTID}}]})['then'](function(_0x127620){var _0x5b5adc=[];if(_0x127620){for(var _0x5c6451=0x0,_0xbbf52;_0x5c6451<_0x127620['length'];_0x5c6451+=0x1){_0xbbf52=_0x127620[_0x5c6451][_0x3799('0x5a')]({'plain':!![]});_0x5b5adc[_0x3799('0x34')](db['sequelize'][_0x3799('0x5f')](_0x12b154(_0xbbf52,_0x3799('0x60')))[_0x3799('0x33')](function(){})['catch'](_0x33b61b()));}}return _0x5b5adc;})['all']();})[_0x3799('0x36')](function(_0x5ef85a){logger[_0x3799('0x16')](_0x3799('0x63'),'generalCheckHopper',_0x5ef85a[_0x3799('0x1e')]);});}var processPromises=function(_0xf0b693){return BPromise[_0x3799('0x64')](promises)[_0x3799('0x33')](function(_0x3fb13b){})[_0x3799('0x36')](function(_0x10093e){logger[_0x3799('0x16')](_0x3799('0x65'),JSON[_0x3799('0x38')](_0x10093e));})[_0x3799('0x66')](function(){socket[_0x3799('0x67')](_0x3799('0x68')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0xf0b693){return _0xf0b693[_0x3799('0x69')]();}});};var endCsv=function(){return BPromise[_0x3799('0x6a')]()['then'](function(){if(hopperContacts){return checkHopper();}})[_0x3799('0x33')](function(){socket[_0x3799('0x67')](_0x3799('0x68')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x3799('0x6b')](FILEPATH);}catch(_0x3c787a){logger[_0x3799('0x16')](_0x3799('0x6c'),JSON[_0x3799('0x38')](_0x3c787a));}finally{process[_0x3799('0x6d')](0x0);}});};process['on']('SIGINT',function(){logger[_0x3799('0x6e')](_0x3799('0x6f'));endCsv();});function main(){return BPromise['resolve']()[_0x3799('0x33')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db[_0x3799('0x30')][_0x3799('0x55')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x3799('0x33')](function(_0x30d5a2){var _0x5d0ded=fs[_0x3799('0x70')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x3799('0x71')](_0x5d0ded,{'header':!![],'skipEmptyLines':!![],'step':function(_0x3b8f6d,_0x4c7291){total+=0x1;var _0x20202d=total;promises[_0x3799('0x34')](checkRow(_0x3b8f6d,_0x30d5a2,_0x20202d)[_0x3799('0x33')](function(){success+=0x1;})[_0x3799('0x36')](function(_0x3af6b3){if(_0x3af6b3['error']){errors+=0x1;delete _0x3af6b3[_0x3799('0x16')];}else if(_0x3af6b3[_0x3799('0x72')]){duplicates+=0x1;delete _0x3af6b3[_0x3799('0x72')];}rows[_0x3799('0x34')](_0x3af6b3);}));if(total%0xc8===0x0){_0x4c7291['pause']();return processPromises(_0x4c7291);}},'complete':function(){return processPromises()['then'](function(){logger[_0x3799('0x6e')](_0x3799('0x73'));endCsv();});},'error':function(_0x1933a0,_0x3c8b69){logger['info'](_0x3799('0x74'),JSON[_0x3799('0x38')](_0x1933a0));endCsv();}});})[_0x3799('0x36')](function(_0x7ad838){logger[_0x3799('0x16')](_0x3799('0x75'),JSON[_0x3799('0x38')](_0x7ad838));});}main(); \ No newline at end of file +var _0xaad6=['cm_contacts','where','deletedAt\x20IS\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','scheduledAt','ContactId','ListId\x20=\x20?','id\x20IN\x20?','str','phone\x20IS\x20NOT\x20NULL','calleridnum','cm_hopper_final','cm_hopper_black','VoiceQueue','findAll','dialCheckDuplicateType','CmList','Lists','then','get','always','query','VoiceQueueId','onlyIfOpen','sequelize','all','outbound','BlackLists','CampaignId','Campaign','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','contact:csv_','resume','emit','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','resolve','createReadStream','parse','duplicate','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','squel','papaparse','../../../config/environment','../../../config/logger','api','redis','defaults','localhost','../../../api/cmContact/cmContact.socket','register','undefined','argv','Missing\x20filepath\x20parameter!','null','Missing\x20binding\x20parameters!','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','test','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','map','message','join','hasOwnProperty','data','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','length','find','Duplicate\x20Contact','CmContact','create','keys','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','insert','into','cm_hopper','fromQuery','createdAt','updatedAt','select','field','NOW()','toString','from'];(function(_0xa08915,_0x258bca){var _0x1ffe24=function(_0x507ad5){while(--_0x507ad5){_0xa08915['push'](_0xa08915['shift']());}};_0x1ffe24(++_0x258bca);}(_0xaad6,0x119));var _0x6aad=function(_0x3226b3,_0x130f7f){_0x3226b3=_0x3226b3-0x0;var _0x3aa600=_0xaad6[_0x3226b3];return _0x3aa600;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require('lodash');var fs=require('fs');var squel=require(_0x6aad('0x0'));var Papa=require(_0x6aad('0x1'));var Redis=require('ioredis');var db=require('../../../mysqldb')['db'];var config=require(_0x6aad('0x2'));var logger=require(_0x6aad('0x3'))(_0x6aad('0x4'));config[_0x6aad('0x5')]=_[_0x6aad('0x6')](config[_0x6aad('0x5')],{'host':_0x6aad('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6aad('0x5')]));require(_0x6aad('0x8'))[_0x6aad('0x9')](socket);try{if(!process['argv'][0x2]||process['argv'][0x2]===_0x6aad('0xa')||process[_0x6aad('0xb')][0x2]==='null'){throw new Error(_0x6aad('0xc'));}var FILEPATH=process[_0x6aad('0xb')][0x2];if(!process[_0x6aad('0xb')][0x3]||process[_0x6aad('0xb')][0x3]==='undefined'||process[_0x6aad('0xb')][0x3]===_0x6aad('0xd')||!process[_0x6aad('0xb')][0x4]||process['argv'][0x4]==='undefined'||process[_0x6aad('0xb')][0x4]===_0x6aad('0xd')){throw new Error(_0x6aad('0xe'));}var FIELDS=_['zipObject'](process[_0x6aad('0xb')][0x3][_0x6aad('0xf')](','),process[_0x6aad('0xb')][0x4][_0x6aad('0xf')](','));if(!process[_0x6aad('0xb')][0x5]||process[_0x6aad('0xb')][0x5]===_0x6aad('0xa')||process[_0x6aad('0xb')][0x5]==='null'){throw new Error(_0x6aad('0x10'));}var LISTID=process['argv'][0x5];var COMPANYID=process[_0x6aad('0xb')][0x6]&&process[_0x6aad('0xb')][0x6]!==_0x6aad('0xa')&&process[_0x6aad('0xb')][0x6]!=='null'?process['argv'][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0x6aad('0xb')][0x7]!=='undefined'&&process[_0x6aad('0xb')][0x7]!==_0x6aad('0xd')?process[_0x6aad('0xb')][0x7]:null;if(!process[_0x6aad('0xb')][0x8]||process['argv'][0x8]===_0x6aad('0xa')||process[_0x6aad('0xb')][0x8]===_0x6aad('0xd')){throw new Error(_0x6aad('0x11'));}var SOCKET_TIMESTAMP=process[_0x6aad('0xb')][0x8];}catch(_0x153b7c){logger[_0x6aad('0x12')](_0x153b7c);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(_0x5dc099,_0x184dfb,_0x20a100,_0x1f77fb){var _0x3ff414={'message':_0x184dfb};_0x3ff414[_0x5dc099]=!![];if(_0x20a100){_0x3ff414[_0x6aad('0x13')]=_0x20a100;}if(_0x1f77fb){_0x3ff414[_0x6aad('0x14')]=_0x1f77fb;}return _0x3ff414;}function isEmail(_0x1c148e){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))*$/[_0x6aad('0x15')](_0x1c148e);}function checkRow(_0x2f9cb5,_0x643946,_0x16d253){return new BPromise(function(_0x387363,_0x48c587){if(_['isNil'](_0x2f9cb5)){return _0x48c587(handleCheckRowError(_0x6aad('0x12'),_0x6aad('0x16'),null,_0x16d253));}if(_0x2f9cb5[_0x6aad('0x17')]&&_0x2f9cb5[_0x6aad('0x17')]['length']){var _0x2c09b4=_[_0x6aad('0x18')](_0x2f9cb5[_0x6aad('0x17')],_0x6aad('0x19'))[_0x6aad('0x1a')](';');return _0x48c587(handleCheckRowError(_0x6aad('0x12'),_0x2c09b4,null,_0x16d253));}var _0x57298d={};for(var _0x3ee375 in FIELDS){if(FIELDS[_0x6aad('0x1b')](_0x3ee375)&&FIELDS[_0x3ee375]){_0x57298d[_0x3ee375]=_0x2f9cb5[_0x6aad('0x1c')][0x0][FIELDS[_0x3ee375]]||_0x2f9cb5['data'][0x0]['\ufeff'+FIELDS[_0x3ee375]];}}if(!_0x57298d['firstName']){return _0x48c587(handleCheckRowError(_0x6aad('0x12'),_0x6aad('0x1d'),null,_0x16d253));}if(!_0x57298d[_0x6aad('0x1e')]){return _0x48c587(handleCheckRowError(_0x6aad('0x12'),_0x6aad('0x1f'),null,_0x16d253));}if(_0x57298d[_0x6aad('0x20')]){var _0x15ec54=moment(_0x57298d['birthDate'],_0x6aad('0x21'));if(!_0x15ec54[_0x6aad('0x22')]()){return _0x48c587(handleCheckRowError('error','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x16d253));}}if(_0x57298d[_0x6aad('0x23')]){if(!isEmail(_0x57298d['email'])){return _0x48c587(handleCheckRowError(_0x6aad('0x12'),_0x6aad('0x24'),null,_0x16d253));}}_0x57298d[_0x6aad('0x25')]=LISTID;_0x57298d[_0x6aad('0x26')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x6aad('0x27')]&&_0x643946){var _0xdf127d={};for(var _0x505301=0x0,_0x5c6580=DUPLICATES[_0x6aad('0x27')];_0x505301<_0x5c6580;_0x505301+=0x1){_0xdf127d[DUPLICATES[_0x505301]]=_0x57298d[DUPLICATES[_0x505301]];}var _0x2a6439=_[_0x6aad('0x28')](_0x643946,_0xdf127d);if(_0x2a6439){return _0x48c587(handleCheckRowError('duplicate',_0x6aad('0x29'),_0x2a6439,_0x16d253));}}return db[_0x6aad('0x2a')][_0x6aad('0x2b')](_0x57298d,{'raw':!![],'hooks':![],'fields':_[_0x6aad('0x2c')](_0x57298d)})['then'](function(_0x3b4a6e){if(DUPLICATES&&DUPLICATES['length']&&_0x643946){_0x643946[_0x6aad('0x2d')](_[_0x6aad('0x2e')](_0x57298d,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x3b4a6e['id'];return _0x387363();})[_0x6aad('0x2f')](function(_0x232b6f){return _0x48c587(handleCheckRowError(_0x6aad('0x12'),_0x6aad('0x30')+(_0x232b6f[_0x6aad('0x19')]||JSON[_0x6aad('0x31')](_0x232b6f)),null,_0x16d253));});});}function checkHopper(){function _0x29adb8(){return function(_0x596ca1){logger[_0x6aad('0x12')](_0x6aad('0x32'),_0x6aad('0x33'),util[_0x6aad('0x34')](_0x596ca1,{'showHidden':![],'depth':null}));};}var _0x4adaf1=function(_0x10c3a5,_0x54fa8b){var _0x317a01=squel[_0x6aad('0x35')]()[_0x6aad('0x36')](_0x6aad('0x37'))[_0x6aad('0x38')]([_0x6aad('0x1e'),'scheduledAt','ContactId',_0x6aad('0x25'),_0x54fa8b,_0x6aad('0x39'),_0x6aad('0x3a')],squel[_0x6aad('0x3b')]()[_0x6aad('0x3c')](_0x6aad('0x1e'),_0x6aad('0x1e'))['field'](_0x6aad('0x3d'),'scheduledAt')['field']('id','ContactId')[_0x6aad('0x3c')](LISTID[_0x6aad('0x3e')](),_0x6aad('0x25'))[_0x6aad('0x3c')](_0x10c3a5['id'][_0x6aad('0x3e')](),_0x54fa8b)[_0x6aad('0x3c')]('NOW()','createdAt')['field'](_0x6aad('0x3d'),_0x6aad('0x3a'))[_0x6aad('0x3f')](_0x6aad('0x40'))[_0x6aad('0x41')](_0x6aad('0x42'))['where']('ListId\x20=\x20?',LISTID[_0x6aad('0x3e')]())[_0x6aad('0x41')]('phone\x20IS\x20NOT\x20NULL')['where'](_0x6aad('0x43'),squel['select']()[_0x6aad('0x3c')]('phone')['from'](_0x6aad('0x37'))['where'](_0x54fa8b+_0x6aad('0x44'),_0x10c3a5['id'][_0x6aad('0x3e')]())))[_0x6aad('0x3e')]();return _0x317a01;};var _0x54d1f5=function(_0x170150,_0x493e05){var _0x128745=squel[_0x6aad('0x35')]()[_0x6aad('0x36')](_0x6aad('0x37'))[_0x6aad('0x38')]([_0x6aad('0x1e'),_0x6aad('0x45'),_0x6aad('0x46'),_0x6aad('0x25'),_0x493e05,'createdAt',_0x6aad('0x3a')],squel[_0x6aad('0x3b')]()['field'](_0x6aad('0x1e'),_0x6aad('0x1e'))[_0x6aad('0x3c')](_0x6aad('0x3d'),_0x6aad('0x45'))[_0x6aad('0x3c')]('id',_0x6aad('0x46'))[_0x6aad('0x3c')](LISTID[_0x6aad('0x3e')](),_0x6aad('0x25'))[_0x6aad('0x3c')](_0x170150['id'][_0x6aad('0x3e')](),_0x493e05)[_0x6aad('0x3c')]('NOW()','createdAt')[_0x6aad('0x3c')](_0x6aad('0x3d'),_0x6aad('0x3a'))['from'](_0x6aad('0x40'))[_0x6aad('0x41')](_0x6aad('0x42'))[_0x6aad('0x41')](_0x6aad('0x47'),LISTID['toString']())[_0x6aad('0x41')](_0x6aad('0x48'),squel[_0x6aad('0x49')](hopperContacts))[_0x6aad('0x41')](_0x6aad('0x4a'))[_0x6aad('0x41')]('phone\x20NOT\x20IN\x20(?)',squel[_0x6aad('0x3b')]()[_0x6aad('0x3c')](_0x6aad('0x4b'))[_0x6aad('0x3f')](_0x6aad('0x4c'))['where'](_0x493e05+'\x20=\x20?',_0x170150['id'][_0x6aad('0x3e')]()))[_0x6aad('0x41')](_0x6aad('0x43'),squel[_0x6aad('0x3b')]()[_0x6aad('0x3c')](_0x6aad('0x1e'))[_0x6aad('0x3f')](_0x6aad('0x37'))[_0x6aad('0x41')](_0x493e05+'\x20=\x20?',_0x170150['id'][_0x6aad('0x3e')]())))[_0x6aad('0x3e')]();return _0x128745;};function _0x50db9d(_0x1bfb25,_0x47eb78){var _0x1b4951=squel['insert']()['into'](_0x6aad('0x37'))[_0x6aad('0x38')]([_0x6aad('0x1e'),_0x6aad('0x45'),'ContactId',_0x6aad('0x25'),_0x47eb78,'createdAt',_0x6aad('0x3a')],squel['select']()['field'](_0x6aad('0x1e'),_0x6aad('0x1e'))[_0x6aad('0x3c')](_0x6aad('0x3d'),_0x6aad('0x45'))[_0x6aad('0x3c')]('id',_0x6aad('0x46'))[_0x6aad('0x3c')](LISTID['toString'](),_0x6aad('0x25'))[_0x6aad('0x3c')](_0x1bfb25['id'][_0x6aad('0x3e')](),_0x47eb78)[_0x6aad('0x3c')](_0x6aad('0x3d'),_0x6aad('0x39'))[_0x6aad('0x3c')]('NOW()',_0x6aad('0x3a'))[_0x6aad('0x3f')](_0x6aad('0x40'))[_0x6aad('0x41')](_0x6aad('0x42'))[_0x6aad('0x41')]('ListId\x20=\x20?',LISTID['toString']())[_0x6aad('0x41')]('id\x20IN\x20?',squel['str'](hopperContacts))[_0x6aad('0x41')](_0x6aad('0x4a')))[_0x6aad('0x3e')]();return _0x1b4951;}function _0xec58a5(_0x2f19cb,_0x210314){var _0x26ce11=squel[_0x6aad('0x35')]()[_0x6aad('0x36')](_0x6aad('0x4d'))['fromQuery']([_0x6aad('0x1e'),_0x6aad('0x46'),_0x6aad('0x25'),_0x210314,_0x6aad('0x39'),_0x6aad('0x3a')],squel[_0x6aad('0x3b')]()[_0x6aad('0x3c')](_0x6aad('0x1e'),'phone')[_0x6aad('0x3c')]('id',_0x6aad('0x46'))[_0x6aad('0x3c')](LISTID[_0x6aad('0x3e')](),_0x6aad('0x25'))['field'](_0x2f19cb['id'][_0x6aad('0x3e')](),_0x210314)[_0x6aad('0x3c')](_0x6aad('0x3d'),_0x6aad('0x39'))[_0x6aad('0x3c')](_0x6aad('0x3d'),_0x6aad('0x3a'))[_0x6aad('0x3f')](_0x6aad('0x40'))[_0x6aad('0x41')](_0x6aad('0x42'))['where'](_0x6aad('0x47'),LISTID[_0x6aad('0x3e')]())[_0x6aad('0x41')](_0x6aad('0x48'),squel[_0x6aad('0x49')](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL'))['toString']();return _0x26ce11;}return db[_0x6aad('0x4e')][_0x6aad('0x4f')]({'where':{'type':'outbound'},'attributes':['id',_0x6aad('0x50')],'include':[{'model':db[_0x6aad('0x51')],'as':_0x6aad('0x52'),'where':{'id':LISTID}}]})[_0x6aad('0x53')](function(_0x301a12){var _0x2a0ee3=[];if(_0x301a12){var _0x4ca860;for(var _0x56f75e=0x0,_0x22a081;_0x56f75e<_0x301a12[_0x6aad('0x27')];_0x56f75e+=0x1){_0x22a081=_0x301a12[_0x56f75e][_0x6aad('0x54')]({'plain':!![]});switch(_0x22a081[_0x6aad('0x50')]){case _0x6aad('0x55'):_0x2a0ee3[_0x6aad('0x2d')](db['sequelize'][_0x6aad('0x56')](_0x54d1f5(_0x22a081,_0x6aad('0x57')))['then'](function(){})['catch'](_0x29adb8()));break;case _0x6aad('0x58'):_0x2a0ee3['push'](db[_0x6aad('0x59')][_0x6aad('0x56')](_0x4adaf1(_0x22a081,_0x6aad('0x57')))[_0x6aad('0x53')](function(){})[_0x6aad('0x2f')](_0x29adb8()));break;default:_0x2a0ee3['push'](db[_0x6aad('0x59')][_0x6aad('0x56')](_0x50db9d(_0x22a081,_0x6aad('0x57')))[_0x6aad('0x53')](function(){})[_0x6aad('0x2f')](_0x29adb8()));}}}return _0x2a0ee3;})[_0x6aad('0x5a')]()['then'](function(){return db[_0x6aad('0x4e')][_0x6aad('0x4f')]({'where':{'type':_0x6aad('0x5b')},'attributes':['id'],'include':[{'model':db[_0x6aad('0x51')],'as':_0x6aad('0x5c'),'where':{'id':LISTID}}]})[_0x6aad('0x53')](function(_0x571ec6){var _0x27c1ce=[];if(_0x571ec6){var _0x4933ac;for(var _0x544780=0x0,_0x138150;_0x544780<_0x571ec6['length'];_0x544780+=0x1){_0x138150=_0x571ec6[_0x544780][_0x6aad('0x54')]({'plain':!![]});_0x27c1ce[_0x6aad('0x2d')](db['sequelize'][_0x6aad('0x56')](_0xec58a5(_0x138150,'VoiceQueueId'))[_0x6aad('0x53')](function(){})[_0x6aad('0x2f')](_0x29adb8()));}}return _0x27c1ce;})['all']();})[_0x6aad('0x53')](function(){return db['Campaign'][_0x6aad('0x4f')]({'attributes':['id',_0x6aad('0x50')],'include':[{'model':db[_0x6aad('0x51')],'as':_0x6aad('0x52'),'where':{'id':LISTID}}]})[_0x6aad('0x53')](function(_0x521903){var _0x42917f=[];if(_0x521903){for(var _0x1a12b3=0x0,_0x4f877a;_0x1a12b3<_0x521903[_0x6aad('0x27')];_0x1a12b3+=0x1){_0x4f877a=_0x521903[_0x1a12b3]['get']({'plain':!![]});switch(_0x4f877a['dialCheckDuplicateType']){case _0x6aad('0x55'):_0x42917f[_0x6aad('0x2d')](db[_0x6aad('0x59')][_0x6aad('0x56')](_0x54d1f5(_0x4f877a,'CampaignId'))[_0x6aad('0x53')](function(){})[_0x6aad('0x2f')](_0x29adb8()));break;case _0x6aad('0x58'):_0x42917f[_0x6aad('0x2d')](db[_0x6aad('0x59')][_0x6aad('0x56')](_0x4adaf1(_0x4f877a,_0x6aad('0x5d')))['then'](function(){})['catch'](_0x29adb8()));break;default:_0x42917f[_0x6aad('0x2d')](db[_0x6aad('0x59')]['query'](_0x50db9d(_0x4f877a,_0x6aad('0x5d')))[_0x6aad('0x53')](function(){})[_0x6aad('0x2f')](_0x29adb8()));}}}return _0x42917f;})[_0x6aad('0x5a')]();})[_0x6aad('0x53')](function(){return db[_0x6aad('0x5e')]['findAll']({'attributes':['id'],'include':[{'model':db['CmList'],'as':'BlackLists','where':{'id':LISTID}}]})['then'](function(_0x53a5e6){var _0x2a7288=[];if(_0x53a5e6){for(var _0x50f4b2=0x0,_0x38d804;_0x50f4b2<_0x53a5e6['length'];_0x50f4b2+=0x1){_0x38d804=_0x53a5e6[_0x50f4b2][_0x6aad('0x54')]({'plain':!![]});_0x2a7288[_0x6aad('0x2d')](db['sequelize'][_0x6aad('0x56')](_0xec58a5(_0x38d804,_0x6aad('0x5d')))[_0x6aad('0x53')](function(){})[_0x6aad('0x2f')](_0x29adb8()));}}return _0x2a7288;})[_0x6aad('0x5a')]();})[_0x6aad('0x2f')](function(_0x2778c2){logger[_0x6aad('0x12')](_0x6aad('0x5f'),_0x6aad('0x60'),_0x2778c2[_0x6aad('0x19')]);});}var processPromises=function(_0x35477f){return BPromise[_0x6aad('0x5a')](promises)[_0x6aad('0x53')](function(_0x78af57){})[_0x6aad('0x2f')](function(_0x3425d0){logger[_0x6aad('0x12')](_0x6aad('0x61'),JSON[_0x6aad('0x31')](_0x3425d0));})['finally'](function(){socket['emit'](_0x6aad('0x62')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x35477f){return _0x35477f[_0x6aad('0x63')]();}});};var endCsv=function(){return BPromise['resolve']()['then'](function(){if(hopperContacts){return checkHopper();}})[_0x6aad('0x53')](function(){socket[_0x6aad('0x64')]('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x6aad('0x65')](FILEPATH);}catch(_0x45e6a2){logger['error'](_0x6aad('0x66'),JSON[_0x6aad('0x31')](_0x45e6a2));}finally{process[_0x6aad('0x67')](0x0);}});};process['on'](_0x6aad('0x68'),function(){logger[_0x6aad('0x69')](_0x6aad('0x6a'));endCsv();});function main(){return BPromise[_0x6aad('0x6b')]()[_0x6aad('0x53')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x6aad('0xf')](',');return db['CmContact'][_0x6aad('0x4f')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x1bf0a5){var _0x285d4d=fs[_0x6aad('0x6c')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x6aad('0x6d')](_0x285d4d,{'header':!![],'skipEmptyLines':!![],'step':function(_0x468569,_0xb8f4ff){total+=0x1;var _0x34b33a=total;promises[_0x6aad('0x2d')](checkRow(_0x468569,_0x1bf0a5,_0x34b33a)[_0x6aad('0x53')](function(){success+=0x1;})[_0x6aad('0x2f')](function(_0xf94079){if(_0xf94079[_0x6aad('0x12')]){errors+=0x1;delete _0xf94079[_0x6aad('0x12')];}else if(_0xf94079[_0x6aad('0x6e')]){duplicates+=0x1;delete _0xf94079['duplicate'];}rows[_0x6aad('0x2d')](_0xf94079);}));if(total%0xc8===0x0){_0xb8f4ff[_0x6aad('0x6f')]();return processPromises(_0xb8f4ff);}},'complete':function(){return processPromises()['then'](function(){logger[_0x6aad('0x69')](_0x6aad('0x70'));endCsv();});},'error':function(_0xd68836,_0x4ea8d2){logger[_0x6aad('0x69')](_0x6aad('0x71'),JSON['stringify'](_0xd68836));endCsv();}});})[_0x6aad('0x2f')](function(_0x2df91a){logger[_0x6aad('0x12')](_0x6aad('0x72'),JSON[_0x6aad('0x31')](_0x2df91a));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 0c94ac3..3860724 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 _0xa7ce=['emit','complete','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','binding','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','map','SIGINT','uncaughtException','lodash','papaparse','util','moment','squel','../../../mysqldb','../../../config/logger','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','field','.id\x20=\x20','where','\x20=\x20','AdditionalPhones','then','split','length','push','isNil','filter','CmContactHasItem','update','updated','PHONE','inserted','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.UserId','into','cm_hopper','fromQuery','phone','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','UserId','recallme','fields','join','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','toString','select','from','cm_hopper_black','ListId\x20=\x20?','.offset-cm_contacts.utcOffset\x20minute)','insert','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_hopper.ContactId','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','concat','keys','CompanyId','scheduledAt',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','info','message','exit','sequelize','query','spread','catch','campaigns.id','campaigns.dialTimezone','campaigns','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','all','error','voice_queues.id','voice_queues.dialTimezone','voice_queues_has_cm_lists','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','utcOffset','set','offset','dialTimezone','main','stringify','socket_timestamp','root','server/files/tmp','.csv','includes','header','ContactItemType','findAll','name','_description','createReadStream','data','rows','errors','find','hasOwnProperty','trim','replace','isValid','isNaN','isNumber','email','dateOfBirth','YYYY-MM-DD','timezones','firstName','\x20not\x20specified','itemTypeId','description','SystemRow','appendFileSync','contact:import:','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','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','DROP\x20TABLE\x20','contactId','orderBy','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','CampaignId','campaigns_has_cm_blacklists','finish','affectedRows'];(function(_0xbd8dd8,_0x3a43a5){var _0x38b80b=function(_0x42306c){while(--_0x42306c){_0xbd8dd8['push'](_0xbd8dd8['shift']());}};_0x38b80b(++_0x3a43a5);}(_0xa7ce,0xbf));var _0xea7c=function(_0x25a505,_0x2f1078){_0x25a505=_0x25a505-0x0;var _0x5ec6ee=_0xa7ce[_0x25a505];return _0x5ec6ee;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0xea7c('0x0'));var Papa=require(_0xea7c('0x1'));var util=require(_0xea7c('0x2'));var BPromise=require('bluebird');var moment=require(_0xea7c('0x3'));var squel=require(_0xea7c('0x4'));var Redis=require('ioredis');var db=require(_0xea7c('0x5'))['db'];var config=require('../../../config/environment');var shared=require('../../../config/environment/shared');var logger=require(_0xea7c('0x6'))('import');config[_0xea7c('0x7')]=_[_0xea7c('0x8')](config['redis'],{'host':_0xea7c('0x9'),'port':0x18eb});var socket=require(_0xea7c('0xa'))(new Redis(config[_0xea7c('0x7')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0xea7c('0xb')](_0xea7c('0xc'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0xea7c('0xb')]('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x2cee22){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))*$/[_0xea7c('0xd')](_0x2cee22);}function selectNotIn(_0x156e53,_0x538251,_0x246cf8,_0x10ebb1,_0x274bef){return squel['select']()[_0xea7c('0xe')]('phone')['from'](_0x10ebb1)['join'](_0x538251,null,_0x538251+_0xea7c('0xf')+_0x10ebb1+'.'+_0x246cf8)[_0xea7c('0x10')](_0x10ebb1+'.'+_0x246cf8+_0xea7c('0x11')+_0x156e53+'.'+_0x246cf8)[_0xea7c('0x10')](_0x538251+'.dialCheckDuplicateType\x20IN\x20('+_0x274bef['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x1ea206,_0x506818){promisesAdditionalPhones=[];return db['CmContact']['findAll']({'raw':!![],'attributes':['id',_0xea7c('0x12')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})['then'](function(_0x1bc269){if(_0x1bc269!==null){var _0x5ab48f=[];for(var _0x4f4ef6=0x0;_0x4f4ef6<_0x1bc269['length'];_0x4f4ef6++){var _0x36f81f=_0x1bc269[_0x4f4ef6];_0x5ab48f['push'](insertAdditionalPhones(_0x36f81f));}}Promise['all'](_0x5ab48f)[_0xea7c('0x13')](function(){_0x1ea206({'val':0x1});});});});}function insertAdditionalPhones(_0x4b8ee5){return new Promise(function(_0x6323b,_0x4163b5){var _0x57153f=_0x4b8ee5[_0xea7c('0x12')];var _0x4ebe3e=_0x57153f[_0xea7c('0x14')](';');var _0x12e074=[];orderBy=0x0;for(var _0x50c987=0x0;_0x50c987<_0x4ebe3e[_0xea7c('0x15')];_0x50c987++){_0x12e074[_0xea7c('0x16')](splitAdditionalPhone(_0x4b8ee5['id'],_0x4ebe3e[_0x50c987]));}Promise['all'](_0x12e074)[_0xea7c('0x13')](function(){_0x6323b({'val':_0x4ebe3e[_0xea7c('0x15')]});});});}function splitAdditionalPhone(_0x2110e5,_0x112bf6){return new Promise(function(_0x1381ae,_0x212dc5){var _0x1dac16=_0x112bf6['split'](':');var _0x3fc1d0=_0x1dac16[0x0];var _0x15ea16=_0x1dac16[0x1];if(!_[_0xea7c('0x17')](_0x15ea16)){var _0x2c559e=_0x15ea16[_0xea7c('0x14')]('|');var _0x46be54=[];for(var _0x1e25bf=0x0;_0x1e25bf<_0x2c559e['length'];_0x1e25bf++){if(_0x2c559e[_0x1e25bf]!==''){var _0x4543ee=_[_0xea7c('0x18')](promisesAdditionalPhones,{'contactId':_0x2110e5,'phone':_0x2c559e[_0x1e25bf]});if(_0x4543ee[_0xea7c('0x15')]==0x0){orderBy++;promisesAdditionalPhones[_0xea7c('0x16')]({'contactId':_0x2110e5,'contactTypeId':_0x3fc1d0,'phone':_0x2c559e[_0x1e25bf],'orderBy':orderBy});}}}_0x1381ae({'ok':0x1});}else _0x1381ae({'res':0x0});});}function createAdditionalPhone(_0x2aa6a5,_0x546532,_0x4531b3,_0x49ba41){var _0x459742='';var _0x25c401='';var _0x565492=_0x4531b3[_0xea7c('0x14')]('§');_0x459742=_0x565492[0x0];if(_0x565492[_0xea7c('0x15')]==0x2)_0x25c401=_0x565492[0x1];return new Promise(function(_0x1af08b,_0x39e3d0){return db['CmContactHasItem']['findOne']({'where':{'CmContactId':_0x2aa6a5,'item':_0x459742}})[_0xea7c('0x13')](function(_0x5069bb){if(_0x5069bb){return db[_0xea7c('0x19')][_0xea7c('0x1a')]({'ItemTypeId':_0x546532,'description':_0x25c401,'OrderBy':_0x49ba41},{'where':{'CmContactId':_0x2aa6a5,'item':_0x459742}})[_0xea7c('0x13')](function(_0x224d4d){_0x1af08b({'res':_0xea7c('0x1b')});});}else{return db[_0xea7c('0x19')]['create']({'CmContactId':_0x2aa6a5,'item':_0x459742,'description':_0x25c401,'ItemTypeId':_0x546532,'OrderBy':_0x49ba41,'ItemClass':_0xea7c('0x1c')})[_0xea7c('0x13')](function(_0x38cbcd){_0x1af08b({'res':_0xea7c('0x1d')});});}});});}function insertCmHopper(_0x431015,_0xded033,_0x590bb4,_0x2e51c6,_0x11f205){var _0x42c351=[_0xea7c('0x1e'),_0xea7c('0x1f'),_0xea7c('0x20'),_0xea7c('0x21'),_0xded033+'.'+_0x2e51c6,_0xea7c('0x22'),_0xea7c('0x23'),'cm_contacts.priority',_0xea7c('0x24'),'\x22'+_0x11f205+'\x22'];return squel['insert']()[_0xea7c('0x25')](_0xea7c('0x26'))[_0xea7c('0x27')]([_0xea7c('0x28'),_0xea7c('0x29'),_0xea7c('0x2a'),_0xea7c('0x2b'),_0x2e51c6,_0xea7c('0x2c'),_0xea7c('0x2d'),_0xea7c('0x2e'),_0xea7c('0x2f'),_0xea7c('0x30')],squel['select']()[_0xea7c('0x31')](_0x42c351)['from'](_0xded033)[_0xea7c('0x32')](_0xea7c('0x33'),null,_0xea7c('0x34')+_0xded033+_0xea7c('0x35'))['join'](_0x590bb4,null,_0x590bb4+_0xea7c('0xf')+_0xded033+'.'+_0x2e51c6)['where'](_0xded033+_0xea7c('0x36'),_0x431015)[_0xea7c('0x10')](_0xea7c('0x37'),NOW)[_0xea7c('0x10')](_0xea7c('0x38'),selectNotIn(_0xded033,_0x590bb4,_0x2e51c6,'cm_hopper',[_0xea7c('0x39'),'\x22onlyIfOpen\x22']))[_0xea7c('0x10')](_0xea7c('0x38'),selectNotIn(_0xded033,_0x590bb4,_0x2e51c6,_0xea7c('0x26'),[_0xea7c('0x39')])))[_0xea7c('0x3a')]();}function insertCmHopperBlack(_0x27270f,_0x152e35,_0x5f594f,_0x3af7fd){var _0x2d7d0d=['cm_contacts.phone',_0xea7c('0x20'),_0xea7c('0x21'),_0x152e35+'.'+_0x3af7fd,'cm_contacts.createdAt','cm_contacts.updatedAt'];return squel['insert']()[_0xea7c('0x25')]('cm_hopper_black')['fromQuery']([_0xea7c('0x28'),'ContactId','ListId',_0x3af7fd,_0xea7c('0x2c'),_0xea7c('0x2d')],squel[_0xea7c('0x3b')]()['fields'](_0x2d7d0d)[_0xea7c('0x3c')](_0x152e35)[_0xea7c('0x32')](_0xea7c('0x33'),null,_0xea7c('0x34')+_0x152e35+'.CmListId')[_0xea7c('0x32')](_0x5f594f,null,_0x5f594f+'.id\x20=\x20'+_0x152e35+'.'+_0x3af7fd)[_0xea7c('0x10')](_0x152e35+_0xea7c('0x36'),_0x27270f)['where']('cm_contacts.createdAt\x20=\x20?',NOW)[_0xea7c('0x10')](_0xea7c('0x38'),squel[_0xea7c('0x3b')]()[_0xea7c('0xe')]('phone')['from'](_0xea7c('0x3d'))[_0xea7c('0x10')](_0xea7c('0x3e'),_0x27270f)[_0xea7c('0x10')](_0x3af7fd+_0xea7c('0x11')+_0x152e35+'.'+_0x3af7fd)))[_0xea7c('0x3a')]();}function insertTzCmHopper(_0x3c52a9,_0x4cd3cb,_0x488150,_0x3252a2,_0x54124b,_0x13e0a2){var _0x357154=['cm_contacts.phone','date_add(cm_contacts.scheduledat,interval\x20'+_0x13e0a2+_0xea7c('0x3f'),_0xea7c('0x20'),_0xea7c('0x21'),_0x4cd3cb+'.'+_0x3252a2,_0xea7c('0x22'),_0xea7c('0x23'),'cm_contacts.priority',_0xea7c('0x24'),'\x22'+_0x54124b+'\x22'];var _0x1b6459=squel[_0xea7c('0x40')]()[_0xea7c('0x25')](_0xea7c('0x26'))[_0xea7c('0x27')]([_0xea7c('0x28'),_0xea7c('0x29'),_0xea7c('0x2a'),_0xea7c('0x2b'),_0x3252a2,_0xea7c('0x2c'),_0xea7c('0x2d'),'priority','UserId',_0xea7c('0x30')],squel[_0xea7c('0x3b')]()['fields'](_0x357154)[_0xea7c('0x3c')](_0x4cd3cb)[_0xea7c('0x32')]('cm_contacts',null,'cm_contacts.ListId\x20=\x20'+_0x4cd3cb+'.CmListId')[_0xea7c('0x32')](_0x488150,null,_0x488150+_0xea7c('0xf')+_0x4cd3cb+'.'+_0x3252a2)['join'](_0x13e0a2,null,_0x13e0a2+_0xea7c('0xf')+_0x4cd3cb+'.'+_0x3252a2)[_0xea7c('0x10')](_0x4cd3cb+_0xea7c('0x36'),_0x3c52a9)[_0xea7c('0x10')](_0xea7c('0x37'),NOW)[_0xea7c('0x10')](_0xea7c('0x38'),selectNotIn(_0x4cd3cb,_0x488150,_0x3252a2,_0xea7c('0x26'),[_0xea7c('0x39'),'\x22onlyIfOpen\x22']))[_0xea7c('0x10')](_0xea7c('0x38'),selectNotIn(_0x4cd3cb,_0x488150,_0x3252a2,'cm_hopper',[_0xea7c('0x39')])))[_0xea7c('0x3a')]();return _0x1b6459;}function insertTzCmHopperBlack(_0xcd4fc4,_0x5ccd29,_0x125af5,_0x1533b1){var _0x4b2cbf=[_0xea7c('0x1e'),_0xea7c('0x20'),_0xea7c('0x21'),_0x5ccd29+'.'+_0x1533b1,_0xea7c('0x22'),_0xea7c('0x23')];return squel[_0xea7c('0x40')]()[_0xea7c('0x25')]('cm_hopper_black')[_0xea7c('0x27')]([_0xea7c('0x28'),_0xea7c('0x2a'),_0xea7c('0x2b'),_0x1533b1,'createdAt',_0xea7c('0x2d')],squel[_0xea7c('0x3b')]()[_0xea7c('0x31')](_0x4b2cbf)['from'](_0x5ccd29)[_0xea7c('0x32')](_0xea7c('0x33'),null,_0xea7c('0x34')+_0x5ccd29+'.CmListId')[_0xea7c('0x32')](_0x125af5,null,_0x125af5+_0xea7c('0xf')+_0x5ccd29+'.'+_0x1533b1)[_0xea7c('0x10')](_0x5ccd29+_0xea7c('0x36'),_0xcd4fc4)[_0xea7c('0x10')](_0xea7c('0x37'),NOW)['where'](_0xea7c('0x38'),squel['select']()['field']('phone')[_0xea7c('0x3c')](_0xea7c('0x3d'))[_0xea7c('0x10')](_0xea7c('0x3e'),_0xcd4fc4)[_0xea7c('0x10')](_0x1533b1+_0xea7c('0x11')+_0x5ccd29+'.'+_0x1533b1)))[_0xea7c('0x3a')]();}function insertCmHopperAdditionalPhones(_0x42db7d){var _0x12dea4=[_0xea7c('0x41'),_0xea7c('0x42'),_0xea7c('0x43'),_0xea7c('0x44'),_0xea7c('0x45')];return squel[_0xea7c('0x40')]()[_0xea7c('0x25')](_0xea7c('0x46'))[_0xea7c('0x27')]([_0xea7c('0x47'),_0xea7c('0x28'),'OrderBy',_0xea7c('0x2c'),'updatedAt'],squel[_0xea7c('0x3b')]()['fields'](_0x12dea4)['from']('cm_hopper')[_0xea7c('0x32')](_0xea7c('0x33'),null,_0xea7c('0x48'))[_0xea7c('0x32')](_0xea7c('0x49'),null,_0xea7c('0x4a'))[_0xea7c('0x10')](_0xea7c('0x4b'),_0x42db7d)['where'](_0xea7c('0x37'),NOW))[_0xea7c('0x3a')]();}function insertCmContact(_0x543bd6,_0x4f78d7,_0x16dad2,_0x23e150){var _0x235280=_[_0xea7c('0x4c')](_[_0xea7c('0x4d')](_0x23e150),[_0xea7c('0x2b'),_0xea7c('0x4e'),_0xea7c('0x2c'),'updatedAt',_0xea7c('0x4f')]);return squel[_0xea7c('0x40')]()['into'](_0xea7c('0x33'))[_0xea7c('0x27')](_0x235280,squel[_0xea7c('0x3b')]()['fields'](_0x235280)[_0xea7c('0x3c')](_0x4f78d7)[_0xea7c('0x10')]('('+_0x16dad2[_0xea7c('0x32')](',')+_0xea7c('0x50'),squel[_0xea7c('0x3b')]()['fields'](_0x16dad2)[_0xea7c('0x3c')](_0xea7c('0x33'))[_0xea7c('0x10')](_0xea7c('0x3e'),_0x543bd6)[_0xea7c('0x10')](_0xea7c('0x51')))['where'](_0xea7c('0x52'),squel[_0xea7c('0x3b')]()[_0xea7c('0xe')](_0xea7c('0x53'),'min_id')[_0xea7c('0x3c')](_0x4f78d7)['group'](_0x16dad2['join'](','))))[_0xea7c('0x3a')]();}function handleStop(){logger[_0xea7c('0x54')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x2b51e5){logger['error'](_0x2b51e5[_0xea7c('0x55')]);process[_0xea7c('0x56')](0x1);}function handleError(_0x4f20c6,_0x5e635e){stats['errors'][_0xea7c('0x16')]({'name':_0x5e635e['code'],'message':_0x5e635e[_0xea7c('0x55')],'row':_0x4f20c6});}function handleQuery(_0x3543e6){logger['info'](_0x3543e6);return db[_0xea7c('0x57')][_0xea7c('0x58')](_0x3543e6)[_0xea7c('0x59')](function(_0x37c020){results[_0xea7c('0x16')](_0x37c020);})[_0xea7c('0x5a')](function(_0x44c9dc){logger['error'](_0x44c9dc[_0xea7c('0x55')]);});}function updateTzCampaigns(_0xde86ae){return new Promise(function(_0x350113,_0x1b059c){var _0x55f154=squel[_0xea7c('0x3b')]()[_0xea7c('0x31')]([_0xea7c('0x5b'),_0xea7c('0x5c')])[_0xea7c('0x3c')](_0xea7c('0x5d'))[_0xea7c('0x32')]('campaigns_has_cm_lists',null,_0xea7c('0x5e'))[_0xea7c('0x10')](_0xea7c('0x5f')+_0xde86ae);db[_0xea7c('0x57')][_0xea7c('0x58')](_0x55f154[_0xea7c('0x3a')]())[_0xea7c('0x59')](function(_0x49c330){var _0x1a109f=[];for(var _0x45334b=0x0;_0x45334b<_0x49c330[_0xea7c('0x15')];_0x45334b++){_0x1a109f['push'](getTimezoneData(_0x49c330[_0x45334b],tmp_campaigns));}BPromise[_0xea7c('0x60')](_0x1a109f)[_0xea7c('0x13')](function(){_0x350113({'val':0x1});});})[_0xea7c('0x5a')](function(_0x5b3b6c){logger[_0xea7c('0x61')](_0x5b3b6c[_0xea7c('0x55')]);_0x350113({'val':0x0});});});}function updateTzVoiceQueues(_0x36c5ef){return new Promise(function(_0x4bdb94,_0x506555){var _0x2a6804=squel['select']()[_0xea7c('0x31')]([_0xea7c('0x62'),_0xea7c('0x63')])[_0xea7c('0x3c')]('voice_queues')['join'](_0xea7c('0x64'),null,_0xea7c('0x65'))[_0xea7c('0x10')](_0xea7c('0x66')+_0x36c5ef);db[_0xea7c('0x57')]['query'](_0x2a6804[_0xea7c('0x3a')]())[_0xea7c('0x59')](function(_0x20d1a4){var _0x52c3db=[];for(var _0x53aec6=0x0;_0x53aec6<_0x20d1a4[_0xea7c('0x15')];_0x53aec6++){_0x52c3db[_0xea7c('0x16')](getTimezoneData(_0x20d1a4[_0x53aec6],tmp_voice_queues));}BPromise[_0xea7c('0x60')](_0x52c3db)[_0xea7c('0x13')](function(){_0x4bdb94({'val':0x1});});})[_0xea7c('0x5a')](function(_0x388dc4){logger[_0xea7c('0x61')](_0x388dc4[_0xea7c('0x55')]);_0x4bdb94({'val':0x0});});});}function getTimezoneData(_0x276ce6,_0x5c8936){return new Promise(function(_0xa2b85b,_0x460d7d){var _0x77193f=shared['timezones'];var _0x2f8d5b=_0x77193f[_0x276ce6['dialTimezone']];if(_[_0xea7c('0x17')](_0x2f8d5b)){_0xa2b85b({'ret':0x1});}else{var _0x42bf34=_0x2f8d5b[_0xea7c('0x67')];var _0x19f5b8=squel['insert']()[_0xea7c('0x25')](_0x5c8936)[_0xea7c('0x68')]('id',_0x276ce6['id'])[_0xea7c('0x68')](_0xea7c('0x69'),_0x42bf34)[_0xea7c('0x68')](_0xea7c('0x6a'),_0x276ce6['dialTimezone'])['toString']();return db[_0xea7c('0x57')][_0xea7c('0x58')](_0x19f5b8)[_0xea7c('0x59')](function(_0x21b79c){_0xa2b85b({'ret':0x1});})[_0xea7c('0x5a')](function(_0x10b05d){logger[_0xea7c('0x61')](_0x10b05d[_0xea7c('0x55')]);_0x460d7d({'ret':0x1});});}});}function handleTZQuery(_0x6301cc){logger[_0xea7c('0x54')](_0x6301cc);return db[_0xea7c('0x57')][_0xea7c('0x58')](_0x6301cc)['spread'](function(_0x136bb5){})[_0xea7c('0x5a')](function(_0x47d6c7){logger[_0xea7c('0x61')](_0x47d6c7['message']);});}function main(_0x4c5845,_0x2687a3,_0x3cc9ca,_0x17b4ba){logger[_0xea7c('0x54')](_0xea7c('0x6b'),_0x4c5845,JSON[_0xea7c('0x6c')](_0x2687a3));process['send']('start');var _0x4c6c8b=_0x2687a3['binding'];var _0x39d760=_['clone'](_0x4c6c8b);var _0x25ed20=_0x2687a3[_0xea7c('0x6d')];var _0x3e345c=path[_0xea7c('0x32')](config[_0xea7c('0x6e')],_0xea7c('0x6f'),_0x25ed20+_0xea7c('0x70'));hasTZ=_[_0xea7c('0x4d')](_0x4c6c8b)[_0xea7c('0x71')]('dialTimezone');var _0x173702=_[_0xea7c('0x4d')](_0x4c6c8b)['join']();logger[_0xea7c('0x54')](_0xea7c('0x72'),_0x173702);db[_0xea7c('0x73')][_0xea7c('0x74')]({'raw':!![],'attributes':['id',_0xea7c('0x75')]})[_0xea7c('0x13')](function(_0x3120fe){for(var _0x304c5b=0x0;_0x304c5b<_0x3120fe[_0xea7c('0x15')];_0x304c5b++){if(_0x3120fe[_0x304c5b][_0xea7c('0x75')]in _0x4c6c8b){contactItemTypes['push'](_0x3120fe[_0x304c5b]);delete _0x39d760[_0x3120fe[_0x304c5b][_0xea7c('0x75')]];hasAdditionalPhones=!![];}for(var _0x5f17af in _0x4c6c8b){if(_0x3120fe[_0x304c5b][_0xea7c('0x75')]+_0xea7c('0x76')===_0x5f17af){phoneDescriptions[_0xea7c('0x16')]({'itemTypeId':_0x3120fe[_0x304c5b]['id'],'description':_0x5f17af});delete _0x39d760[_0x5f17af];}}}if(hasAdditionalPhones)_0x39d760[_0xea7c('0x12')]='';var _0xe774c=_['keys'](_0x39d760)[_0xea7c('0x32')]();logger[_0xea7c('0x54')]('header',_0xe774c);fs['writeFileSync'](_0x3e345c,_0xe774c+'\x0a');Papa['parse'](fs[_0xea7c('0x77')](_0x4c5845),{'header':!![],'skipEmptyLines':!![],'step':function(_0x439957,_0x456b2d){try{for(var _0x4171f4=0x0,_0x3dc098=[];_0x4171f4<_0x439957[_0xea7c('0x78')][_0xea7c('0x15')];_0x4171f4++){stats[_0xea7c('0x79')]+=0x1;if(_0x439957[_0xea7c('0x7a')][_0x4171f4]){handleError(_0x439957[_0xea7c('0x78')][_0x4171f4],_0x439957[_0xea7c('0x7a')][_0x4171f4]);}else{var _0x4c614d=[];var _0x16a86c=[];var _0x1ef633={};for(var _0x29e3af in _0x4c6c8b){let _0x3917d7=contactItemTypes[_0xea7c('0x7b')](_0x96a442=>_0x96a442[_0xea7c('0x75')]===_0x29e3af);let _0x10a191=contactItemTypes[_0xea7c('0x7b')](_0x4abe69=>_0x4abe69[_0xea7c('0x75')]+_0xea7c('0x76')===_0x29e3af);if(_[_0xea7c('0x17')](_0x3917d7)&&_[_0xea7c('0x17')](_0x10a191)){if(_0x4c6c8b[_0xea7c('0x7c')](_0x29e3af)){if(_0x439957['data'][_0x4171f4][_0x4c6c8b[_0x29e3af]]){var _0x206d0e=_[_0xea7c('0x7d')](_0x439957[_0xea7c('0x78')][_0x4171f4][_0x4c6c8b[_0x29e3af]][_0xea7c('0x7e')](/"/g,'\x27'));switch(_0x29e3af){case _0xea7c('0x29'):var _0x1c0df3=moment(_0x206d0e,_0xea7c('0xc'),!![]);if(_0x1c0df3[_0xea7c('0x7f')]()){_0x3dc098[_0xea7c('0x16')]('\x22'+_0x206d0e+'\x22');}else{_0x4c614d[_0xea7c('0x16')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0xea7c('0x2e'):var _0x964f84=parseInt(_0x206d0e);_0x206d0e=_[_0xea7c('0x80')](_0x964f84)||_0x964f84<0x0||_0x964f84>0x4?_0x17b4ba?0x3:0x2:_0x964f84;_0x3dc098[_0xea7c('0x16')]('\x22'+_0x206d0e+'\x22');break;case _0xea7c('0x2f'):var _0x4f0d80=parseInt(_0x206d0e);if(_[_0xea7c('0x81')](_0x4f0d80)&&_[_0xea7c('0x71')](_0x3cc9ca,_0x4f0d80)){_0x3dc098[_0xea7c('0x16')]('\x22'+_0x4f0d80+'\x22');}else{_0x4c614d[_0xea7c('0x16')]('agent\x20not\x20exists');}break;case _0xea7c('0x82'):if(isEmail(_0x206d0e)){_0x3dc098[_0xea7c('0x16')]('\x22'+_0x206d0e+'\x22');}else{_0x4c614d[_0xea7c('0x16')]('email\x20wrong\x20format');}break;case _0xea7c('0x83'):var _0xc0d08d=moment(_0x206d0e,_0xea7c('0x84'),!![]);if(_0xc0d08d[_0xea7c('0x7f')]()){_0x3dc098[_0xea7c('0x16')]('\x22'+_0x206d0e+'\x22');}else{_0x4c614d[_0xea7c('0x16')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;case _0xea7c('0x6a'):var _0x3c2b8a=shared[_0xea7c('0x85')];var _0x464914=_0x3c2b8a[_0x206d0e];if(!_[_0xea7c('0x17')](_0x464914)){var _0x200c66=_0x464914[_0xea7c('0x67')];_0x3dc098[_0xea7c('0x16')]('\x22'+_0x206d0e+'\x22');_0x3dc098['push']('\x22'+_0x200c66+'\x22');}break;default:_0x3dc098[_0xea7c('0x16')]('\x22'+_0x206d0e+'\x22');}}else{switch(_0x29e3af){case _0xea7c('0x86'):case _0xea7c('0x28'):_0x4c614d['push'](_0x29e3af+_0xea7c('0x87'));break;default:_0x3dc098[_0xea7c('0x16')]('\x22\x22');}}}}else{var _0x3d4910='';if(!_[_0xea7c('0x17')](_0x3917d7)){if(!_0x1ef633[_0xea7c('0x7c')](_0x3917d7['id'])){if(!_[_0xea7c('0x17')](_0x439957[_0xea7c('0x78')][_0x4171f4][_0x4c6c8b[_0x29e3af]])){var _0x206d0e=_[_0xea7c('0x7d')](_0x439957[_0xea7c('0x78')][_0x4171f4][_0x4c6c8b[_0x29e3af]][_0xea7c('0x7e')](/"/g,'\x27'));var _0x49dec9=phoneDescriptions[_0xea7c('0x7b')](_0x210ebe=>_0x210ebe[_0xea7c('0x88')]===_0x3917d7['id']);if(!_[_0xea7c('0x17')](_0x49dec9)){var _0x208745=_[_0xea7c('0x7d')](_0x439957[_0xea7c('0x78')][_0x4171f4][_0x4c6c8b[_0x49dec9[_0xea7c('0x89')]]]['replace'](/"/g,'\x27'));if(!_[_0xea7c('0x17')](_0x208745))_0x206d0e=_0x206d0e+'§'+_0x208745;}if(_0x3d4910=='')_0x3d4910=_0x206d0e;else _0x3d4910+='|'+_0x206d0e;}_0x16a86c[_0xea7c('0x16')](_0x3917d7['id']+':'+_0x3d4910);_0x1ef633[_0x3917d7['id']]=0x1;}}}}if(hasAdditionalPhones){_0x3dc098[_0xea7c('0x16')]('\x22'+_0x16a86c['join'](';')+'\x22');}if(_0x4c614d[_0xea7c('0x15')]){handleError(_0x439957[_0xea7c('0x78')][_0x4171f4],{'code':_0xea7c('0x8a'),'message':_0x4c614d[_0xea7c('0x32')]()});}else{fs[_0xea7c('0x8b')](_0x3e345c,_0x3dc098[_0xea7c('0x32')]()+'\x0a');}_0x3dc098=[];}if(!(stats[_0xea7c('0x79')]%0xc8)){socket['emit'](_0xea7c('0x8c')+_0x25ed20,stats);stats[_0xea7c('0x7a')]=[];}}if(stopped){logger[_0xea7c('0x54')]('Abort\x20parser');_0x456b2d['abort']();}}catch(_0x1b7010){handleError(_0x439957['data'][_0x4171f4],{'code':_0xea7c('0x8d'),'message':_0x1b7010[_0xea7c('0x55')]});logger['error'](_0xea7c('0x8e'),_0x1b7010[_0xea7c('0x55')]);}},'complete':function(){try{var _0x73df25=[];var _0x17b304=[];var _0x3fdca5='cm_contacts';if(_0x2687a3[_0xea7c('0x8f')]&&_0x2687a3[_0xea7c('0x8f')][_0xea7c('0x15')]){_0x3fdca5=_0xea7c('0x90')+_0x25ed20;_0x73df25[_0xea7c('0x16')](_0xea7c('0x91')+_0x3fdca5+_0xea7c('0x92'));}tmp_campaigns=_0xea7c('0x93')+_0x25ed20;tmp_voice_queues=_0xea7c('0x94')+_0x25ed20;_0x17b304[_0xea7c('0x16')]('CREATE\x20TABLE\x20'+tmp_campaigns+_0xea7c('0x95'));_0x17b304['push'](_0xea7c('0x91')+tmp_voice_queues+_0xea7c('0x95'));BPromise[_0xea7c('0x96')](_0x17b304,handleTZQuery)['then'](function(_0x66b6d8){updateTzCampaigns(_0x2687a3['ListId'])[_0xea7c('0x13')](function(_0x4c58f3){updateTzVoiceQueues(_0x2687a3['ListId'])['then'](function(_0x18462d){if(hasTZ)_0xe774c=_0xe774c[_0xea7c('0x7e')](_0xea7c('0x6a'),'dialTimezone,utcOffset');var _0x226a73=util[_0xea7c('0xb')](_0xea7c('0x97'),_0x3e345c,_0x3fdca5,_0xe774c,_0x2687a3[_0xea7c('0x2b')],_0x2687a3['CompanyId']||null,NOW,NOW);if(_[_0xea7c('0x17')](_0x4c6c8b[_0xea7c('0x29')])){_0x226a73+=',\x20scheduledAt\x20=\x20NOW()';}_0x73df25[_0xea7c('0x16')](_0x226a73);if(_0x2687a3[_0xea7c('0x8f')]&&_0x2687a3['duplicates'][_0xea7c('0x15')]){_0x73df25[_0xea7c('0x16')](insertCmContact(_0x2687a3[_0xea7c('0x2b')],_0x3fdca5,_0x2687a3[_0xea7c('0x8f')],_0x4c6c8b));_0x73df25['push'](_0xea7c('0x98')+_0x3fdca5+';');}BPromise[_0xea7c('0x96')](_0x73df25,handleQuery)[_0xea7c('0x13')](function(_0x5da30a){BPromise[_0xea7c('0x60')]([handleAdditionalPhones()])['then'](function(){_0x73df25=[];for(var _0x19b23c=0x0;_0x19b23c_0x2c7716[_0xfd20('0x75')]===_0x39aee1);let _0x1ab766=contactItemTypes[_0xfd20('0x7c')](_0x52e33a=>_0x52e33a[_0xfd20('0x75')]+_0xfd20('0x7d')===_0x39aee1);if(_[_0xfd20('0x67')](_0x1b0e48)&&_[_0xfd20('0x67')](_0x1ab766)){if(_0x3ab460[_0xfd20('0x7e')](_0x39aee1)){if(_0x59eb56[_0xfd20('0x7a')][_0x4b35e0][_0x3ab460[_0x39aee1]]){var _0x21af24=_[_0xfd20('0x7f')](_0x59eb56[_0xfd20('0x7a')][_0x4b35e0][_0x3ab460[_0x39aee1]][_0xfd20('0x80')](/"/g,'\x27'));switch(_0x39aee1){case _0xfd20('0x2e'):var _0x37fb22=moment(_0x21af24,_0xfd20('0xf'),!![]);if(_0x37fb22[_0xfd20('0x81')]()){_0x357506[_0xfd20('0x1d')]('\x22'+_0x21af24+'\x22');}else{_0x2ac39e[_0xfd20('0x1d')](_0xfd20('0x82'));}break;case _0xfd20('0x33'):var _0x4b2ef7=parseInt(_0x21af24);_0x21af24=_['isNaN'](_0x4b2ef7)||_0x4b2ef7<0x0||_0x4b2ef7>0x4?_0x14aed6?0x3:0x2:_0x4b2ef7;_0x357506[_0xfd20('0x1d')]('\x22'+_0x21af24+'\x22');break;case _0xfd20('0x34'):var _0x660c7a=parseInt(_0x21af24);if(_[_0xfd20('0x83')](_0x660c7a)&&_['includes'](_0x5af5cd,_0x660c7a)){_0x357506['push']('\x22'+_0x660c7a+'\x22');}else{_0x2ac39e[_0xfd20('0x1d')](_0xfd20('0x84'));}break;case _0xfd20('0x85'):if(isEmail(_0x21af24)){_0x357506['push']('\x22'+_0x21af24+'\x22');}else{_0x2ac39e['push'](_0xfd20('0x86'));}break;case _0xfd20('0x87'):var _0x55cb87=moment(_0x21af24,'YYYY-MM-DD',!![]);if(_0x55cb87['isValid']()){_0x357506[_0xfd20('0x1d')]('\x22'+_0x21af24+'\x22');}else{_0x2ac39e[_0xfd20('0x1d')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;case _0xfd20('0x6b'):var _0x4baa4f=shared[_0xfd20('0x66')];var _0x5ce846=_0x4baa4f[_0x21af24];if(!_[_0xfd20('0x67')](_0x5ce846)){var _0x86b805=_0x5ce846[_0xfd20('0x68')];_0x357506['push']('\x22'+_0x21af24+'\x22');_0x357506['push']('\x22'+_0x86b805+'\x22');}break;default:_0x357506[_0xfd20('0x1d')]('\x22'+_0x21af24+'\x22');}}else{switch(_0x39aee1){case'firstName':case _0xfd20('0x12'):_0x2ac39e[_0xfd20('0x1d')](_0x39aee1+_0xfd20('0x88'));break;default:_0x357506[_0xfd20('0x1d')]('\x22\x22');}}}}else{var _0x289e18='';if(!_[_0xfd20('0x67')](_0x1b0e48)){if(!_0x451194[_0xfd20('0x7e')](_0x1b0e48['id'])){if(!_[_0xfd20('0x67')](_0x59eb56[_0xfd20('0x7a')][_0x4b35e0][_0x3ab460[_0x39aee1]])){var _0x21af24=_[_0xfd20('0x7f')](_0x59eb56['data'][_0x4b35e0][_0x3ab460[_0x39aee1]]['replace'](/"/g,'\x27'));var _0x3fd0d7=phoneDescriptions[_0xfd20('0x7c')](_0x363aac=>_0x363aac['itemTypeId']===_0x1b0e48['id']);if(!_[_0xfd20('0x67')](_0x3fd0d7)){var _0x152a2e=_['trim'](_0x59eb56[_0xfd20('0x7a')][_0x4b35e0][_0x3ab460[_0x3fd0d7[_0xfd20('0x89')]]]['replace'](/"/g,'\x27'));if(!_[_0xfd20('0x67')](_0x152a2e))_0x21af24=_0x21af24+'§'+_0x152a2e;}if(_0x289e18=='')_0x289e18=_0x21af24;else _0x289e18+='|'+_0x21af24;}_0x21f3ba[_0xfd20('0x1d')](_0x1b0e48['id']+':'+_0x289e18);_0x451194[_0x1b0e48['id']]=0x1;}}}}if(hasAdditionalPhones){_0x357506['push']('\x22'+_0x21f3ba[_0xfd20('0x18')](';')+'\x22');}if(_0x2ac39e[_0xfd20('0x1b')]){handleError(_0x59eb56['data'][_0x4b35e0],{'code':_0xfd20('0x8a'),'message':_0x2ac39e[_0xfd20('0x18')]()});}else{fs[_0xfd20('0x8b')](_0xabc6c2,_0x357506[_0xfd20('0x18')]()+'\x0a');}_0x357506=[];}if(!(stats[_0xfd20('0x7b')]%0xc8)){socket[_0xfd20('0x8c')](_0xfd20('0x8d')+_0x2fcfc3,stats);stats['errors']=[];}}if(stopped){logger[_0xfd20('0x53')](_0xfd20('0x8e'));_0x287f9d[_0xfd20('0x8f')]();}}catch(_0x12305d){handleError(_0x59eb56['data'][_0x4b35e0],{'code':_0xfd20('0x90'),'message':_0x12305d[_0xfd20('0x56')]});logger['error'](_0xfd20('0x91'),_0x12305d[_0xfd20('0x56')]);}},'complete':function(){try{var _0x4ef590=[];var _0x124f58=[];var _0x20384d='cm_contacts';if(_0x1ba464[_0xfd20('0x92')]&&_0x1ba464['duplicates']['length']){_0x20384d=_0xfd20('0x93')+_0x2fcfc3;_0x4ef590[_0xfd20('0x1d')](_0xfd20('0x94')+_0x20384d+_0xfd20('0x95'));}tmp_campaigns=_0xfd20('0x96')+_0x2fcfc3;tmp_voice_queues=_0xfd20('0x97')+_0x2fcfc3;_0x124f58[_0xfd20('0x1d')](_0xfd20('0x94')+tmp_campaigns+_0xfd20('0x98'));_0x124f58[_0xfd20('0x1d')](_0xfd20('0x94')+tmp_voice_queues+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');BPromise[_0xfd20('0x99')](_0x124f58,handleTZQuery)[_0xfd20('0x1a')](function(_0x37fef5){updateTzCampaigns(_0x1ba464[_0xfd20('0x30')])[_0xfd20('0x1a')](function(_0x598082){updateTzVoiceQueues(_0x1ba464[_0xfd20('0x30')])[_0xfd20('0x1a')](function(_0x152851){if(hasTZ)_0x414a8f=_0x414a8f[_0xfd20('0x80')](_0xfd20('0x6b'),_0xfd20('0x9a'));var _0x15e36f=util[_0xfd20('0xe')](_0xfd20('0x9b'),_0xabc6c2,_0x20384d,_0x414a8f,_0x1ba464[_0xfd20('0x30')],_0x1ba464[_0xfd20('0x4e')]||null,NOW,NOW);if(_['isNil'](_0x3ab460[_0xfd20('0x2e')])){_0x15e36f+=',\x20scheduledAt\x20=\x20NOW()';}_0x4ef590[_0xfd20('0x1d')](_0x15e36f);if(_0x1ba464[_0xfd20('0x92')]&&_0x1ba464['duplicates']['length']){_0x4ef590[_0xfd20('0x1d')](insertCmContact(_0x1ba464[_0xfd20('0x30')],_0x20384d,_0x1ba464[_0xfd20('0x92')],_0x3ab460));_0x4ef590['push']('DROP\x20TABLE\x20'+_0x20384d+';');}BPromise[_0xfd20('0x99')](_0x4ef590,handleQuery)[_0xfd20('0x1a')](function(_0x4a7b1b){BPromise['all']([handleAdditionalPhones()])[_0xfd20('0x1a')](function(){_0x4ef590=[];for(var _0x5bd24a=0x0;_0x5bd24a\x20\x20');}var _0x3cb24a=path[_0xfd20('0x18')](config[_0xfd20('0x71')],_0xfd20('0x72'),process['argv'][0x2]);if(!fs['existsSync'](_0x3cb24a)){throw new Error('file\x20doesn\x27t\x20exists');}var _0x2fba05={};try{_0x2fba05=JSON[_0xfd20('0x78')](process[_0xfd20('0xa8')][0x3]);if(!_0x2fba05[_0xfd20('0xa9')]){throw new Error('binding\x20doesn\x27t\x20exists');}if(!_0x2fba05[_0xfd20('0xa9')][_0xfd20('0x12')]){throw new Error(_0xfd20('0xaa'));}if(!_0x2fba05[_0xfd20('0xa9')][_0xfd20('0xab')]){throw new Error('firstName\x20is\x20mandatory');}var _0x36af9e=0x0;if(_0x2fba05['binding'][_0xfd20('0x34')]){_0x36af9e=0x1;}if(!_0x2fba05[_0xfd20('0x30')]){throw new Error(_0xfd20('0xac'));}}catch(_0x2c7aa9){throw new Error(_0xfd20('0xad'));}var _0x70f9a5=[];try{_0x70f9a5=_['map'](JSON[_0xfd20('0x78')](process['argv'][0x4]),'id');}catch(_0x38311d){logger[_0xfd20('0x53')](_0xfd20('0xae'));}main(_0x3cb24a,_0x2fba05,_0x70f9a5,_0x36af9e);}validate();process['on'](_0xfd20('0xaf'),handleStop);process['on'](_0xfd20('0xb0'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/import/cm/csvUpdates.js b/server/components/import/cm/csvUpdates.js index 5e38524..a134fc8 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 _0x81fa=['body','findAll','name','_description','parse','createReadStream','data','rows','find','hasOwnProperty','trim','replace','scheduledat','UserId','isNumber','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','isValid','firstName','\x20not\x20specified','itemTypeId','SystemRow','appendFileSync','emit','contact:import:','abort','SystemError','step','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','CIS\x20len','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','contact','contactId','contactTypeId','orderBy','DROP\x20TABLE\x20','each','finish','affectedRows','unlink','complete','argv','arguments\x20\x20\x20','root','server/files/tmp','existsSync','file\x20doesn\x27t\x20exists','binding','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','util','bluebird','moment','squel','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','YYYYMMDDHHmmss','field','from','.id\x20=\x20','where','\x20=\x20','join','sequelize','query','select\x20*\x20from\x20','spread','length','isNil','phone','AdditionalPhones','push','catch','error','message','all','split','filter','findOne','then','CmContactHasItem','update','create','inserted','CmContact','CmHopper','cm_contacts.phone','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.UserId','insert','into','cm_hopper','ContactId','createdAt','updatedAt','priority','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','fromQuery','ListId','select','cm_hopper_black','ListId\x20=\x20?','\x20=\x20?','toString','cm_hopper.id','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_hopper.ListId\x20=\x20?','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','id\x20IN\x20?','MIN(id)','min_id','info','Received\x20SIGINT','exit','errors','stringify','send','start','clone','socket_timestamp','.csv'];(function(_0x3dc7c4,_0x273dc1){var _0x22b147=function(_0x4f4607){while(--_0x4f4607){_0x3dc7c4['push'](_0x3dc7c4['shift']());}};_0x22b147(++_0x273dc1);}(_0x81fa,0xdd));var _0xa81f=function(_0x5e5964,_0x201efc){_0x5e5964=_0x5e5964-0x0;var _0xb11687=_0x81fa[_0x5e5964];return _0xb11687;};'use strict';var fs=require('fs');var path=require(_0xa81f('0x0'));var _=require(_0xa81f('0x1'));var Papa=require('papaparse');var util=require(_0xa81f('0x2'));var BPromise=require(_0xa81f('0x3'));var moment=require(_0xa81f('0x4'));var squel=require(_0xa81f('0x5'));var Redis=require('ioredis');var db=require(_0xa81f('0x6'))['db'];var config=require(_0xa81f('0x7'));var logger=require(_0xa81f('0x8'))(_0xa81f('0x9'));config[_0xa81f('0xa')]=_[_0xa81f('0xb')](config[_0xa81f('0xa')],{'host':_0xa81f('0xc'),'port':0x18eb});var socket=require(_0xa81f('0xd'))(new Redis(config[_0xa81f('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()[_0xa81f('0xe')](_0xa81f('0xf'));var tempTableName='cm_contacts_temp_'+moment()['format'](_0xa81f('0x10'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x182ae7){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0x182ae7);}function selectNotIn(_0x47e978,_0x5b8b3c,_0x13aaf9,_0x4b9aa1,_0x12fd0e){return squel['select']()[_0xa81f('0x11')]('phone')[_0xa81f('0x12')](_0x4b9aa1)['join'](_0x5b8b3c,null,_0x5b8b3c+_0xa81f('0x13')+_0x4b9aa1+'.'+_0x13aaf9)[_0xa81f('0x14')](_0x4b9aa1+'.'+_0x13aaf9+_0xa81f('0x15')+_0x47e978+'.'+_0x13aaf9)[_0xa81f('0x14')](_0x5b8b3c+'.dialCheckDuplicateType\x20IN\x20('+_0x12fd0e[_0xa81f('0x16')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x872de3,_0x3ed3d9){promisesAdditionalPhones=[];promisesContact=[];return db[_0xa81f('0x17')][_0xa81f('0x18')](_0xa81f('0x19')+tempTableName)[_0xa81f('0x1a')](function(_0x4e41ba){if(_0x4e41ba!==null){var _0x33dd9e=[];for(var _0x53ab47=0x0;_0x53ab47<_0x4e41ba[_0xa81f('0x1b')];_0x53ab47++){var _0x25a5dd=_0x4e41ba[_0x53ab47];if(!_[_0xa81f('0x1c')](_0x25a5dd[_0xa81f('0x1d')])){if(!_['isNil'](_0x25a5dd[_0xa81f('0x1e')]))_0x33dd9e[_0xa81f('0x1f')](insertAdditionalPhones(_0x25a5dd));promisesContact['push']({'contact':_0x25a5dd});}}}Promise['all'](_0x33dd9e)['then'](function(){_0x872de3({'val':0x1});});})[_0xa81f('0x20')](function(_0x5ee99b){logger[_0xa81f('0x21')](_0x5ee99b[_0xa81f('0x22')]);});});}function insertAdditionalPhones(_0x61797e){return new Promise(function(_0x1ac5b1,_0xd4c3ea){var _0x29fc08=_0x61797e[_0xa81f('0x1e')];if(_['isNil'](_0x29fc08))_0xd4c3ea({'val':0x0});else{var _0x4fa4dd=_0x29fc08['split'](';');var _0x16dac4=[];orderBy=0x0;for(var _0x582cca=0x0;_0x582cca<_0x4fa4dd['length'];_0x582cca++){_0x16dac4[_0xa81f('0x1f')](splitAdditionalPhone(_0x61797e['id'],_0x4fa4dd[_0x582cca]));}Promise[_0xa81f('0x23')](_0x16dac4)['then'](function(){_0x1ac5b1({'val':_0x4fa4dd['length']});});}});}function splitAdditionalPhone(_0x4190db,_0x1acf9a){return new Promise(function(_0x44c1c6,_0x45ccd6){var _0x324917=_0x1acf9a['split'](':');var _0x12e401=_0x324917[0x0];var _0x292f28=_0x324917[0x1];if(_0x292f28!==''){var _0x3abab6=_0x292f28[_0xa81f('0x24')]('|');var _0x3a0cb7=[];for(var _0x69309d=0x0;_0x69309d<_0x3abab6[_0xa81f('0x1b')];_0x69309d++){if(_0x3abab6[_0x69309d]!==''){var _0xda556b=_[_0xa81f('0x25')](promisesAdditionalPhones,{'contactId':_0x4190db,'phone':_0x3abab6[_0x69309d]});if(_0xda556b['length']==0x0){orderBy++;promisesAdditionalPhones['push']({'contactId':_0x4190db,'contactTypeId':_0x12e401,'phone':_0x3abab6[_0x69309d],'orderBy':orderBy});}}}_0x44c1c6({'ok':0x1});}else _0x44c1c6({'res':0x0});});}function createAdditionalPhone(_0x119aae,_0x21c17b,_0x49bb33,_0x4fd979){var _0x206c5c='';var _0x1dc15f='';var _0x26dc51=_0x49bb33['split']('§');_0x206c5c=_0x26dc51[0x0];if(_0x26dc51['length']==0x2)_0x1dc15f=_0x26dc51[0x1];return new Promise(function(_0x5bb887,_0x43c570){return db['CmContactHasItem'][_0xa81f('0x26')]({'where':{'CmContactId':_0x119aae,'item':_0x206c5c}})[_0xa81f('0x27')](function(_0x209b0d){if(_0x209b0d){return db[_0xa81f('0x28')][_0xa81f('0x29')]({'ItemTypeId':_0x21c17b,'description':_0x1dc15f,'OrderBy':_0x4fd979},{'where':{'CmContactId':_0x119aae,'item':_0x206c5c}})[_0xa81f('0x27')](function(_0x514450){_0x5bb887({'res':'updated'});});}else{return db[_0xa81f('0x28')][_0xa81f('0x2a')]({'CmContactId':_0x119aae,'item':_0x206c5c,'ItemTypeId':_0x21c17b,'description':_0x1dc15f,'OrderBy':_0x4fd979,'ItemClass':'PHONE'})[_0xa81f('0x27')](function(_0x566b3c){_0x5bb887({'res':_0xa81f('0x2b')});});}});});}function updateContact(_0x224021){return new Promise(function(_0x3a2725,_0x2e846d){var _0x40106a=_0x224021['id'];delete _0x224021['id'];return db[_0xa81f('0x2c')][_0xa81f('0x29')](_0x224021,{'where':{'id':_0x40106a}})[_0xa81f('0x27')](function(_0x1906a0){updatedRows+=0x1;return db[_0xa81f('0x2d')]['update']({'phone':_0x224021[_0xa81f('0x1d')]},{'where':{'ContactId':_0x40106a}})[_0xa81f('0x27')](function(_0x382146){_0x3a2725({'ret':'OK'});});});});}function insertCmHopper(_0x1bc01f,_0x17e5ec,_0x4fdb8b,_0x2d5db6,_0x3467a5){var _0x82b32a=[_0xa81f('0x2e'),'cm_contacts.scheduledat',_0xa81f('0x2f'),_0xa81f('0x30'),_0x17e5ec+'.'+_0x2d5db6,_0xa81f('0x31'),_0xa81f('0x32'),'cm_contacts.priority',_0xa81f('0x33'),'\x22'+_0x3467a5+'\x22'];return squel[_0xa81f('0x34')]()[_0xa81f('0x35')](_0xa81f('0x36'))['fromQuery']([_0xa81f('0x1d'),'scheduledat',_0xa81f('0x37'),'ListId',_0x2d5db6,_0xa81f('0x38'),_0xa81f('0x39'),_0xa81f('0x3a'),'UserId',_0xa81f('0x3b')],squel['select']()[_0xa81f('0x3c')](_0x82b32a)[_0xa81f('0x12')](_0x17e5ec)['join'](_0xa81f('0x3d'),null,_0xa81f('0x3e')+_0x17e5ec+_0xa81f('0x3f'))[_0xa81f('0x16')](_0x4fdb8b,null,_0x4fdb8b+_0xa81f('0x13')+_0x17e5ec+'.'+_0x2d5db6)[_0xa81f('0x14')](_0x17e5ec+_0xa81f('0x40'),_0x1bc01f)[_0xa81f('0x14')](_0xa81f('0x41'),NOW)[_0xa81f('0x14')](_0xa81f('0x42'),selectNotIn(_0x17e5ec,_0x4fdb8b,_0x2d5db6,_0xa81f('0x36'),[_0xa81f('0x43'),'\x22onlyIfOpen\x22']))[_0xa81f('0x14')](_0xa81f('0x42'),selectNotIn(_0x17e5ec,_0x4fdb8b,_0x2d5db6,_0xa81f('0x36'),[_0xa81f('0x43')])))['toString']();}function insertCmHopperBlack(_0x35b37f,_0x301f68,_0x38f8f1,_0x279c1f){var _0x38738f=['cm_contacts.phone',_0xa81f('0x2f'),'cm_contacts.ListId',_0x301f68+'.'+_0x279c1f,_0xa81f('0x31'),'cm_contacts.updatedAt'];return squel['insert']()[_0xa81f('0x35')]('cm_hopper_black')[_0xa81f('0x44')]([_0xa81f('0x1d'),_0xa81f('0x37'),_0xa81f('0x45'),_0x279c1f,_0xa81f('0x38'),_0xa81f('0x39')],squel[_0xa81f('0x46')]()[_0xa81f('0x3c')](_0x38738f)[_0xa81f('0x12')](_0x301f68)['join'](_0xa81f('0x3d'),null,_0xa81f('0x3e')+_0x301f68+_0xa81f('0x3f'))['join'](_0x38f8f1,null,_0x38f8f1+_0xa81f('0x13')+_0x301f68+'.'+_0x279c1f)[_0xa81f('0x14')](_0x301f68+_0xa81f('0x40'),_0x35b37f)[_0xa81f('0x14')](_0xa81f('0x41'),NOW)[_0xa81f('0x14')](_0xa81f('0x42'),squel[_0xa81f('0x46')]()[_0xa81f('0x11')](_0xa81f('0x1d'))[_0xa81f('0x12')](_0xa81f('0x47'))[_0xa81f('0x14')](_0xa81f('0x48'),_0x35b37f)[_0xa81f('0x14')](_0x279c1f+_0xa81f('0x49'),_0x301f68+'.'+_0x279c1f)))[_0xa81f('0x4a')]();}function insertCmHopperAdditionalPhones(_0x28dda4){var _0x2143d7=[_0xa81f('0x4b'),'cm_contact_has_items.item',_0xa81f('0x4c'),_0xa81f('0x4d'),'cm_contact_has_items.updatedAt'];return squel['insert']()[_0xa81f('0x35')](_0xa81f('0x4e'))[_0xa81f('0x44')]([_0xa81f('0x4f'),_0xa81f('0x1d'),_0xa81f('0x50'),_0xa81f('0x38'),_0xa81f('0x39')],squel['select']()[_0xa81f('0x3c')](_0x2143d7)[_0xa81f('0x12')]('cm_hopper')[_0xa81f('0x16')]('cm_contacts',null,_0xa81f('0x51'))[_0xa81f('0x16')](_0xa81f('0x52'),null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')[_0xa81f('0x14')](_0xa81f('0x53'),_0x28dda4)['where'](_0xa81f('0x41'),NOW))[_0xa81f('0x4a')]();}function insertCmContact(_0x111272,_0x29acb2,_0x51abcc,_0x135562){var _0x267246=_[_0xa81f('0x54')](_[_0xa81f('0x55')](_0x135562),[_0xa81f('0x45'),_0xa81f('0x56'),_0xa81f('0x38'),_0xa81f('0x39')]);return squel[_0xa81f('0x34')]()[_0xa81f('0x35')]('cm_contacts')[_0xa81f('0x44')](_0x267246,squel[_0xa81f('0x46')]()[_0xa81f('0x3c')](_0x267246)[_0xa81f('0x12')](_0x29acb2)['where']('('+_0x51abcc[_0xa81f('0x16')](',')+_0xa81f('0x57'),squel['select']()[_0xa81f('0x3c')](_0x51abcc)[_0xa81f('0x12')](_0xa81f('0x3d'))[_0xa81f('0x14')](_0xa81f('0x48'),_0x111272))[_0xa81f('0x14')](_0xa81f('0x58'),squel[_0xa81f('0x46')]()[_0xa81f('0x11')](_0xa81f('0x59'),_0xa81f('0x5a'))[_0xa81f('0x12')](_0x29acb2)['group'](_0x51abcc['join'](','))))[_0xa81f('0x4a')]();}function handleStop(){logger[_0xa81f('0x5b')](_0xa81f('0x5c'));stopped=!![];}function handleUncaughtException(_0x33de7c){logger[_0xa81f('0x21')](_0x33de7c[_0xa81f('0x22')]);process[_0xa81f('0x5d')](0x1);}function handleError(_0x13c8d8,_0x459274){stats[_0xa81f('0x5e')]['push']({'name':_0x459274['code'],'message':_0x459274[_0xa81f('0x22')],'row':_0x13c8d8});}function handleQuery(_0x48c7ee){logger[_0xa81f('0x5b')](_0x48c7ee);return db[_0xa81f('0x17')][_0xa81f('0x18')](_0x48c7ee)[_0xa81f('0x1a')](function(_0x5ac153){results['push'](_0x5ac153);})[_0xa81f('0x20')](function(_0x25cafa){logger[_0xa81f('0x21')](_0x25cafa['message']);});}function main(_0x5e7364,_0x25cb41,_0x59a3a3,_0x983f85){logger[_0xa81f('0x5b')]('main',_0x5e7364,JSON[_0xa81f('0x5f')](_0x25cb41));process[_0xa81f('0x60')](_0xa81f('0x61'));var _0x15673b=_0x25cb41['binding'];var _0x209ecd=_[_0xa81f('0x62')](_0x15673b);var _0x36deed=_0x25cb41[_0xa81f('0x63')];var _0x206f62=path[_0xa81f('0x16')](config['root'],'server/files/tmp',_0x36deed+_0xa81f('0x64'));logger['info'](_0xa81f('0x65'),_0x25cb41);db['ContactItemType'][_0xa81f('0x66')]({'raw':!![],'attributes':['id',_0xa81f('0x67')]})['then'](function(_0x23b530){for(var _0x4c2b72=0x0;_0x4c2b72<_0x23b530[_0xa81f('0x1b')];_0x4c2b72++){if(_0x23b530[_0x4c2b72][_0xa81f('0x67')]in _0x15673b){contactItemTypes[_0xa81f('0x1f')](_0x23b530[_0x4c2b72]);delete _0x209ecd[_0x23b530[_0x4c2b72]['name']];hasAdditionalPhones=!![];}for(var _0x9cd428 in _0x15673b){if(_0x23b530[_0x4c2b72]['name']+_0xa81f('0x68')===_0x9cd428){phoneDescriptions[_0xa81f('0x1f')]({'itemTypeId':_0x23b530[_0x4c2b72]['id'],'description':_0x9cd428});delete _0x209ecd[_0x9cd428];}}}if(hasAdditionalPhones)_0x209ecd[_0xa81f('0x1e')]='';var _0x14f8d3=_['keys'](_0x209ecd)[_0xa81f('0x16')]();logger[_0xa81f('0x5b')]('header',_0x14f8d3);fs['writeFileSync'](_0x206f62,_0x14f8d3+'\x0a');Papa[_0xa81f('0x69')](fs[_0xa81f('0x6a')](_0x5e7364),{'header':!![],'skipEmptyLines':!![],'step':function(_0x14b67e,_0x1b6277){try{for(var _0xeea2cd=0x0,_0x17b629=[];_0xeea2cd<_0x14b67e[_0xa81f('0x6b')][_0xa81f('0x1b')];_0xeea2cd++){stats[_0xa81f('0x6c')]+=0x1;if(_0x14b67e[_0xa81f('0x5e')][_0xeea2cd]){handleError(_0x14b67e['data'][_0xeea2cd],_0x14b67e['errors'][_0xeea2cd]);}else{var _0x32c3c3=[];var _0xa31ae8=[];var _0xd284c2={};for(var _0xc0c711 in _0x15673b){let _0x118f7c=contactItemTypes['find'](_0x27d862=>_0x27d862[_0xa81f('0x67')]===_0xc0c711);let _0x24b105=contactItemTypes[_0xa81f('0x6d')](_0x12546e=>_0x12546e[_0xa81f('0x67')]+'_description'===_0xc0c711);if(_[_0xa81f('0x1c')](_0x118f7c)&&_[_0xa81f('0x1c')](_0x24b105)){if(_0x15673b[_0xa81f('0x6e')](_0xc0c711)){if(_0x14b67e[_0xa81f('0x6b')][_0xeea2cd][_0x15673b[_0xc0c711]]){var _0x467465=_[_0xa81f('0x6f')](_0x14b67e[_0xa81f('0x6b')][_0xeea2cd][_0x15673b[_0xc0c711]][_0xa81f('0x70')](/"/g,'\x27'));switch(_0xc0c711){case _0xa81f('0x71'):var _0x13d7f6=moment(_0x467465,_0xa81f('0xf'),!![]);if(_0x13d7f6['isValid']()){_0x17b629[_0xa81f('0x1f')]('\x22'+_0x467465+'\x22');}else{_0x32c3c3[_0xa81f('0x1f')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case'priority':var _0x410911=parseInt(_0x467465);_0x467465=_['isNaN'](_0x410911)||_0x410911<0x0||_0x410911>0x4?_0x983f85?0x3:0x2:_0x410911;_0x17b629[_0xa81f('0x1f')]('\x22'+_0x467465+'\x22');break;case _0xa81f('0x72'):var _0x3586bf=parseInt(_0x467465);if(_[_0xa81f('0x73')](_0x3586bf)&&_[_0xa81f('0x74')](_0x59a3a3,_0x3586bf)){_0x17b629[_0xa81f('0x1f')]('\x22'+_0x3586bf+'\x22');}else{_0x32c3c3[_0xa81f('0x1f')](_0xa81f('0x75'));}break;case _0xa81f('0x76'):if(isEmail(_0x467465)){_0x17b629[_0xa81f('0x1f')]('\x22'+_0x467465+'\x22');}else{_0x32c3c3['push'](_0xa81f('0x77'));}break;case _0xa81f('0x78'):var _0x247388=moment(_0x467465,_0xa81f('0x79'),!![]);if(_0x247388[_0xa81f('0x7a')]()){_0x17b629[_0xa81f('0x1f')]('\x22'+_0x467465+'\x22');}else{_0x32c3c3[_0xa81f('0x1f')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x17b629[_0xa81f('0x1f')]('\x22'+_0x467465+'\x22');}}else{switch(_0xc0c711){case _0xa81f('0x7b'):case _0xa81f('0x1d'):_0x32c3c3['push'](_0xc0c711+_0xa81f('0x7c'));break;default:_0x17b629[_0xa81f('0x1f')]('\x22\x22');}}}}else{var _0x510bc7='';if(!_[_0xa81f('0x1c')](_0x118f7c)){if(!_0xd284c2[_0xa81f('0x6e')](_0x118f7c['id'])){for(var _0x475d5b=0x0;_0x475d5b<_0x15673b[_0xc0c711][_0xa81f('0x1b')];_0x475d5b++){var _0x467465=_[_0xa81f('0x6f')](_0x14b67e[_0xa81f('0x6b')][_0xeea2cd][_0x15673b[_0xc0c711][_0x475d5b]][_0xa81f('0x70')](/"/g,'\x27'));var _0x2df881=phoneDescriptions['find'](_0x88e3f5=>_0x88e3f5[_0xa81f('0x7d')]===_0x118f7c['id']);if(!_[_0xa81f('0x1c')](_0x2df881)){var _0x2a7e23=_[_0xa81f('0x6f')](_0x14b67e[_0xa81f('0x6b')][_0xeea2cd][_0x15673b[_0x2df881['description']][0x0]][_0xa81f('0x70')](/"/g,'\x27'));if(!_[_0xa81f('0x1c')](_0x2a7e23))_0x467465=_0x467465+'§'+_0x2a7e23;}if(_0x510bc7=='')_0x510bc7=_0x467465;else _0x510bc7+='|'+_0x467465;}_0xa31ae8[_0xa81f('0x1f')](_0x118f7c['id']+':'+_0x510bc7);_0xd284c2[_0x118f7c['id']]=0x1;}}}}if(hasAdditionalPhones){_0x17b629[_0xa81f('0x1f')]('\x22'+_0xa31ae8[_0xa81f('0x16')](';')+'\x22');}if(_0x32c3c3[_0xa81f('0x1b')]){handleError(_0x14b67e[_0xa81f('0x6b')][_0xeea2cd],{'code':_0xa81f('0x7e'),'message':_0x32c3c3[_0xa81f('0x16')]()});}else{fs[_0xa81f('0x7f')](_0x206f62,_0x17b629['join']()+'\x0a');}_0x17b629=[];}if(!(stats['rows']%0xc8)){socket[_0xa81f('0x80')](_0xa81f('0x81')+_0x36deed,stats);stats[_0xa81f('0x5e')]=[];}}if(stopped){logger[_0xa81f('0x5b')]('Abort\x20parser');_0x1b6277[_0xa81f('0x82')]();}}catch(_0x2c2423){handleError(_0x14b67e[_0xa81f('0x6b')][_0xeea2cd],{'code':_0xa81f('0x83'),'message':_0x2c2423[_0xa81f('0x22')]});logger['error'](_0xa81f('0x84'),_0x2c2423[_0xa81f('0x22')]);}},'complete':function(){try{var _0x198f91=[];var _0x24dbd8=tempTableName;_0x198f91[_0xa81f('0x1f')](_0xa81f('0x85')+_0x24dbd8+_0xa81f('0x86'));logger[_0xa81f('0x5b')](_0xa81f('0x87'),contactItemTypes[_0xa81f('0x1b')]);var _0x2beab7=util[_0xa81f('0xe')](_0xa81f('0x88'),_0x206f62,_0x24dbd8,_0x14f8d3,_0x25cb41[_0xa81f('0x45')],_0x25cb41[_0xa81f('0x56')]||null,NOW,NOW);if(_[_0xa81f('0x1c')](_0x15673b['scheduledat'])){_0x2beab7+=',\x20scheduledAt\x20=\x20NOW()';}_0x198f91[_0xa81f('0x1f')](_0x2beab7);BPromise['each'](_0x198f91,handleQuery)[_0xa81f('0x27')](function(_0x1bc909){BPromise['all']([handleAdditionalPhones()])[_0xa81f('0x27')](function(){_0x198f91=[];for(var _0x30d64d=0x0;_0x30d64d_0x22b3d6[_0x8be5('0x69')]===_0x144794);let _0xdd3004=contactItemTypes[_0x8be5('0x71')](_0x468997=>_0x468997[_0x8be5('0x69')]+_0x8be5('0x6a')===_0x144794);if(_[_0x8be5('0x1a')](_0x10314d)&&_['isNil'](_0xdd3004)){if(_0x1e2b60[_0x8be5('0x72')](_0x144794)){if(_0x58de0d['data'][_0x45749a][_0x1e2b60[_0x144794]]){var _0xa31611=_[_0x8be5('0x73')](_0x58de0d['data'][_0x45749a][_0x1e2b60[_0x144794]][_0x8be5('0x74')](/"/g,'\x27'));switch(_0x144794){case'scheduledat':var _0x4c9a6d=moment(_0xa31611,_0x8be5('0xb'),!![]);if(_0x4c9a6d['isValid']()){_0x470eb5[_0x8be5('0x1b')]('\x22'+_0xa31611+'\x22');}else{_0x403df8[_0x8be5('0x1b')](_0x8be5('0x75'));}break;case _0x8be5('0x3b'):var _0x246585=parseInt(_0xa31611);_0xa31611=_[_0x8be5('0x76')](_0x246585)||_0x246585<0x0||_0x246585>0x4?_0x573426?0x3:0x2:_0x246585;_0x470eb5[_0x8be5('0x1b')]('\x22'+_0xa31611+'\x22');break;case _0x8be5('0x3c'):var _0x2efa55=parseInt(_0xa31611);if(_[_0x8be5('0x77')](_0x2efa55)&&_['includes'](_0x4d9e0d,_0x2efa55)){_0x470eb5['push']('\x22'+_0x2efa55+'\x22');}else{_0x403df8['push'](_0x8be5('0x78'));}break;case _0x8be5('0x79'):if(isEmail(_0xa31611)){_0x470eb5['push']('\x22'+_0xa31611+'\x22');}else{_0x403df8[_0x8be5('0x1b')](_0x8be5('0x7a'));}break;case _0x8be5('0x7b'):var _0x262eff=moment(_0xa31611,'YYYY-MM-DD',!![]);if(_0x262eff['isValid']()){_0x470eb5[_0x8be5('0x1b')]('\x22'+_0xa31611+'\x22');}else{_0x403df8[_0x8be5('0x1b')](_0x8be5('0x7c'));}break;default:_0x470eb5[_0x8be5('0x1b')]('\x22'+_0xa31611+'\x22');}}else{switch(_0x144794){case _0x8be5('0x7d'):case _0x8be5('0x10'):_0x403df8[_0x8be5('0x1b')](_0x144794+_0x8be5('0x7e'));break;default:_0x470eb5[_0x8be5('0x1b')]('\x22\x22');}}}}else{var _0x4954b3='';if(!_[_0x8be5('0x1a')](_0x10314d)){if(!_0x306c90[_0x8be5('0x72')](_0x10314d['id'])){for(var _0x2b86ff=0x0;_0x2b86ff<_0x1e2b60[_0x144794][_0x8be5('0x19')];_0x2b86ff++){var _0xa31611=_[_0x8be5('0x73')](_0x58de0d[_0x8be5('0x6e')][_0x45749a][_0x1e2b60[_0x144794][_0x2b86ff]]['replace'](/"/g,'\x27'));var _0x4f4a40=phoneDescriptions[_0x8be5('0x71')](_0x1cd0e9=>_0x1cd0e9[_0x8be5('0x7f')]===_0x10314d['id']);if(!_['isNil'](_0x4f4a40)){var _0x39b055=_[_0x8be5('0x73')](_0x58de0d[_0x8be5('0x6e')][_0x45749a][_0x1e2b60[_0x4f4a40[_0x8be5('0x80')]][0x0]]['replace'](/"/g,'\x27'));if(!_[_0x8be5('0x1a')](_0x39b055))_0xa31611=_0xa31611+'§'+_0x39b055;}if(_0x4954b3=='')_0x4954b3=_0xa31611;else _0x4954b3+='|'+_0xa31611;}_0x3447ca['push'](_0x10314d['id']+':'+_0x4954b3);_0x306c90[_0x10314d['id']]=0x1;}}}}if(hasAdditionalPhones){_0x470eb5[_0x8be5('0x1b')]('\x22'+_0x3447ca[_0x8be5('0x3f')](';')+'\x22');}if(_0x403df8[_0x8be5('0x19')]){handleError(_0x58de0d['data'][_0x45749a],{'code':_0x8be5('0x81'),'message':_0x403df8['join']()});}else{fs[_0x8be5('0x82')](_0xeb6189,_0x470eb5[_0x8be5('0x3f')]()+'\x0a');}_0x470eb5=[];}if(!(stats['rows']%0xc8)){socket['emit']('contact:import:'+_0x302895,stats);stats[_0x8be5('0x70')]=[];}}if(stopped){logger['info'](_0x8be5('0x83'));_0x15e13b[_0x8be5('0x84')]();}}catch(_0x5637bc){handleError(_0x58de0d['data'][_0x45749a],{'code':_0x8be5('0x85'),'message':_0x5637bc['message']});logger[_0x8be5('0x1e')]('step',_0x5637bc[_0x8be5('0x5c')]);}},'complete':function(){try{var _0x14b517=[];var _0x2338e3=tempTableName;_0x14b517[_0x8be5('0x1b')](_0x8be5('0x86')+_0x2338e3+_0x8be5('0x87'));logger[_0x8be5('0x5b')](_0x8be5('0x88'),contactItemTypes['length']);var _0x427745=util[_0x8be5('0xa')](_0x8be5('0x89'),_0xeb6189,_0x2338e3,_0x291445,_0x405363[_0x8be5('0x38')],_0x405363[_0x8be5('0x57')]||null,NOW,NOW);if(_[_0x8be5('0x1a')](_0x1e2b60[_0x8be5('0x36')])){_0x427745+=',\x20scheduledAt\x20=\x20NOW()';}_0x14b517['push'](_0x427745);BPromise[_0x8be5('0x8a')](_0x14b517,handleQuery)['then'](function(_0x10cf3a){BPromise[_0x8be5('0x1c')]([handleAdditionalPhones()])[_0x8be5('0x1d')](function(){_0x14b517=[];for(var _0x13be21=0x0;_0x13be21\x20\x20');}var _0x4f81b2=path[_0x8be5('0x3f')](config['root'],_0x8be5('0x66'),process[_0x8be5('0x92')][0x2]);if(!fs['existsSync'](_0x4f81b2)){throw new Error(_0x8be5('0x93'));}var _0xa39da9={};try{_0xa39da9=JSON['parse'](process['argv'][0x3]);if(!_0xa39da9[_0x8be5('0x64')]){throw new Error('binding\x20doesn\x27t\x20exists');}var _0x386e74=0x0;if(_0xa39da9[_0x8be5('0x64')][_0x8be5('0x3c')]){_0x386e74=0x1;}if(!_0xa39da9[_0x8be5('0x38')]){throw new Error('ListId\x20is\x20mandatory');}}catch(_0x2fa804){throw new Error(_0x8be5('0x94'));}var _0x3c62a8=[];try{_0x3c62a8=_['map'](JSON[_0x8be5('0x6c')](process['argv'][0x4]),'id');}catch(_0x2484c9){logger[_0x8be5('0x5b')](_0x8be5('0x95'));}main(_0x4f81b2,_0xa39da9,_0x3c62a8,_0x386e74);}validate();process['on']('SIGINT',handleStop);process['on']('uncaughtException',handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index 10da56d..a3a2cf9 100644 --- a/server/components/integrations/configuration.js +++ b/server/components/integrations/configuration.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x18c2=['destcalleridnum','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','talktime','***\x20Call\x20Info\x20***','Member\x20Name','Answer\x20Time','answertime','Complete\x20Time','endtime','Duration','duration','Billable\x20Time','getSubjects','string','toLowerCase','inbound','push','variable','queue','calleridnum','outbound','getDescriptions','voice','keyValue','Caller\x20Number','Caller\x20Name','calleridname','Call\x20To','Queue','UniqueId','uniqueid','Date','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Number'];(function(_0x6c8671,_0x470181){var _0x4dffa9=function(_0x57fc7e){while(--_0x57fc7e){_0x6c8671['push'](_0x6c8671['shift']());}};_0x4dffa9(++_0x470181);}(_0x18c2,0x10d));var _0x218c=function(_0x371c93,_0x4369c0){_0x371c93=_0x371c93-0x0;var _0x1d1e40=_0x18c2[_0x371c93];return _0x1d1e40;};'use strict';exports[_0x218c('0x0')]=function(_0x4f5854,_0x14a17a){var _0x4d2bda=[{'type':_0x218c('0x1'),'content':'[xCALLY\x20Ticket]','variableName':null}];switch(_0x4f5854[_0x218c('0x2')]()){case'voice':switch(_0x14a17a[_0x218c('0x2')]()){case _0x218c('0x3'):_0x4d2bda[_0x218c('0x4')]({'type':_0x218c('0x5'),'content':'','variableName':_0x218c('0x6')});_0x4d2bda[_0x218c('0x4')]({'type':_0x218c('0x5'),'content':'','variableName':_0x218c('0x7')});break;case _0x218c('0x8'):_0x4d2bda[_0x218c('0x4')]({'type':_0x218c('0x1'),'content':'Outbound\x20Call','variableName':null});_0x4d2bda[_0x218c('0x4')]({'type':'variable','content':'','variableName':'destcalleridnum'});break;}}return _0x4d2bda;};exports[_0x218c('0x9')]=function(_0x478535,_0x3172a3){var _0x419b31=[];switch(_0x478535['toLowerCase']()){case _0x218c('0xa'):switch(_0x3172a3[_0x218c('0x2')]()){case _0x218c('0x3'):_0x419b31=[{'type':_0x218c('0x1'),'content':'***\x20Call\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x218c('0xb'),'content':'','key':_0x218c('0xc'),'keyType':_0x218c('0x5'),'variableName':_0x218c('0x7')},{'type':_0x218c('0xb'),'content':'','key':_0x218c('0xd'),'keyType':_0x218c('0x5'),'variableName':_0x218c('0xe')},{'type':_0x218c('0xb'),'content':'','key':_0x218c('0xf'),'keyType':'variable','variableName':'destexten'},{'type':_0x218c('0xb'),'content':'','key':_0x218c('0x10'),'keyType':'variable','variableName':_0x218c('0x6')},{'type':_0x218c('0xb'),'content':'','key':_0x218c('0x11'),'keyType':_0x218c('0x5'),'variableName':_0x218c('0x12')},{'type':_0x218c('0xb'),'content':'','key':_0x218c('0x13'),'keyType':'variable','variableName':_0x218c('0x14')},{'type':_0x218c('0x1'),'content':_0x218c('0x15'),'key':null,'keyType':null,'variableName':null},{'type':_0x218c('0xb'),'content':'','key':_0x218c('0x16'),'keyType':_0x218c('0x5'),'variableName':_0x218c('0x17')},{'type':_0x218c('0xb'),'content':'','key':_0x218c('0x18'),'keyType':_0x218c('0x5'),'variableName':_0x218c('0x19')},{'type':_0x218c('0x1'),'content':_0x218c('0x1a'),'key':null,'keyType':null,'variableName':null},{'type':_0x218c('0xb'),'content':'','key':_0x218c('0x1b'),'keyType':'variable','variableName':_0x218c('0x14')},{'type':_0x218c('0xb'),'content':'','key':_0x218c('0x1c'),'keyType':_0x218c('0x5'),'variableName':_0x218c('0x1d')},{'type':_0x218c('0xb'),'content':'','key':_0x218c('0x1e'),'keyType':_0x218c('0x5'),'variableName':_0x218c('0x1f')},{'type':_0x218c('0xb'),'content':'','key':'Hold\x20Time','keyType':_0x218c('0x5'),'variableName':'holdtime'},{'type':'keyValue','content':'','key':'Talk\x20Time','keyType':_0x218c('0x5'),'variableName':_0x218c('0x20')}];break;case _0x218c('0x8'):_0x419b31=[{'type':_0x218c('0x1'),'content':_0x218c('0x21'),'variableName':null},{'type':'keyValue','content':'','key':'Called\x20Number','keyType':_0x218c('0x5'),'keyContent':'','variableName':_0x218c('0x19')},{'type':_0x218c('0xb'),'content':'','key':_0x218c('0x22'),'keyType':'variable','keyContent':'','variableName':'membername'},{'type':_0x218c('0xb'),'content':'','key':_0x218c('0x11'),'keyType':_0x218c('0x5'),'keyContent':'','variableName':_0x218c('0x12')},{'type':_0x218c('0xb'),'content':'','key':_0x218c('0x13'),'keyType':'variable','keyContent':'','variableName':'starttime'},{'type':_0x218c('0x1'),'content':'***\x20Time\x20Info\x20***'},{'type':'keyValue','content':'','key':_0x218c('0x23'),'keyType':_0x218c('0x5'),'keyContent':'','variableName':_0x218c('0x24')},{'type':_0x218c('0xb'),'content':'','key':_0x218c('0x25'),'keyType':_0x218c('0x5'),'keyContent':'','variableName':_0x218c('0x26')},{'type':'keyValue','content':'','key':_0x218c('0x27'),'keyType':'variable','keyContent':'','variableName':_0x218c('0x28')},{'type':'keyValue','content':'','key':_0x218c('0x29'),'keyType':_0x218c('0x5'),'keyContent':'','variableName':'billableseconds'}];break;}}return _0x419b31;}; \ No newline at end of file +var _0xed10=['Complete\x20Time','endtime','duration','Billable\x20Time','getSubjects','string','[xCALLY\x20Ticket]','toLowerCase','push','variable','calleridnum','outbound','Outbound\x20Call','destcalleridnum','voice','***\x20Call\x20Info\x20***','keyValue','Caller\x20Name','calleridname','Queue','queue','UniqueId','uniqueid','Date','agentcalledAt','Agent\x20Name','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','talktime','Called\x20Number','Member\x20Name','membername','starttime','Answer\x20Time','answertime'];(function(_0x3c2166,_0x41fc16){var _0x30ccc3=function(_0x689bc3){while(--_0x689bc3){_0x3c2166['push'](_0x3c2166['shift']());}};_0x30ccc3(++_0x41fc16);}(_0xed10,0x1bc));var _0x0ed1=function(_0x224dda,_0x16d0f9){_0x224dda=_0x224dda-0x0;var _0x2987ac=_0xed10[_0x224dda];return _0x2987ac;};'use strict';exports[_0x0ed1('0x0')]=function(_0x4538e0,_0xc4139b){var _0x397807=[{'type':_0x0ed1('0x1'),'content':_0x0ed1('0x2'),'variableName':null}];switch(_0x4538e0[_0x0ed1('0x3')]()){case'voice':switch(_0xc4139b[_0x0ed1('0x3')]()){case'inbound':_0x397807[_0x0ed1('0x4')]({'type':_0x0ed1('0x5'),'content':'','variableName':'queue'});_0x397807[_0x0ed1('0x4')]({'type':_0x0ed1('0x5'),'content':'','variableName':_0x0ed1('0x6')});break;case _0x0ed1('0x7'):_0x397807[_0x0ed1('0x4')]({'type':'string','content':_0x0ed1('0x8'),'variableName':null});_0x397807['push']({'type':'variable','content':'','variableName':_0x0ed1('0x9')});break;}}return _0x397807;};exports['getDescriptions']=function(_0x64762b,_0x43625f){var _0x465efe=[];switch(_0x64762b[_0x0ed1('0x3')]()){case _0x0ed1('0xa'):switch(_0x43625f[_0x0ed1('0x3')]()){case'inbound':_0x465efe=[{'type':'string','content':_0x0ed1('0xb'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':'Caller\x20Number','keyType':_0x0ed1('0x5'),'variableName':_0x0ed1('0x6')},{'type':_0x0ed1('0xc'),'content':'','key':_0x0ed1('0xd'),'keyType':'variable','variableName':_0x0ed1('0xe')},{'type':_0x0ed1('0xc'),'content':'','key':'Call\x20To','keyType':_0x0ed1('0x5'),'variableName':'destexten'},{'type':_0x0ed1('0xc'),'content':'','key':_0x0ed1('0xf'),'keyType':_0x0ed1('0x5'),'variableName':_0x0ed1('0x10')},{'type':_0x0ed1('0xc'),'content':'','key':_0x0ed1('0x11'),'keyType':'variable','variableName':_0x0ed1('0x12')},{'type':'keyValue','content':'','key':_0x0ed1('0x13'),'keyType':_0x0ed1('0x5'),'variableName':_0x0ed1('0x14')},{'type':_0x0ed1('0x1'),'content':'***\x20Agent\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x0ed1('0xc'),'content':'','key':_0x0ed1('0x15'),'keyType':'variable','variableName':_0x0ed1('0x16')},{'type':'keyValue','content':'','key':_0x0ed1('0x17'),'keyType':'variable','variableName':_0x0ed1('0x9')},{'type':_0x0ed1('0x1'),'content':_0x0ed1('0x18'),'key':null,'keyType':null,'variableName':null},{'type':_0x0ed1('0xc'),'content':'','key':_0x0ed1('0x19'),'keyType':_0x0ed1('0x5'),'variableName':_0x0ed1('0x14')},{'type':_0x0ed1('0xc'),'content':'','key':_0x0ed1('0x1a'),'keyType':'variable','variableName':_0x0ed1('0x1b')},{'type':_0x0ed1('0xc'),'content':'','key':_0x0ed1('0x1c'),'keyType':'variable','variableName':_0x0ed1('0x1d')},{'type':_0x0ed1('0xc'),'content':'','key':_0x0ed1('0x1e'),'keyType':'variable','variableName':_0x0ed1('0x1f')},{'type':_0x0ed1('0xc'),'content':'','key':_0x0ed1('0x20'),'keyType':_0x0ed1('0x5'),'variableName':_0x0ed1('0x21')}];break;case'outbound':_0x465efe=[{'type':_0x0ed1('0x1'),'content':_0x0ed1('0xb'),'variableName':null},{'type':'keyValue','content':'','key':_0x0ed1('0x22'),'keyType':_0x0ed1('0x5'),'keyContent':'','variableName':_0x0ed1('0x9')},{'type':_0x0ed1('0xc'),'content':'','key':_0x0ed1('0x23'),'keyType':_0x0ed1('0x5'),'keyContent':'','variableName':_0x0ed1('0x24')},{'type':_0x0ed1('0xc'),'content':'','key':'UniqueId','keyType':_0x0ed1('0x5'),'keyContent':'','variableName':_0x0ed1('0x12')},{'type':'keyValue','content':'','key':_0x0ed1('0x13'),'keyType':_0x0ed1('0x5'),'keyContent':'','variableName':_0x0ed1('0x25')},{'type':_0x0ed1('0x1'),'content':_0x0ed1('0x18')},{'type':_0x0ed1('0xc'),'content':'','key':_0x0ed1('0x26'),'keyType':_0x0ed1('0x5'),'keyContent':'','variableName':_0x0ed1('0x27')},{'type':_0x0ed1('0xc'),'content':'','key':_0x0ed1('0x28'),'keyType':_0x0ed1('0x5'),'keyContent':'','variableName':_0x0ed1('0x29')},{'type':_0x0ed1('0xc'),'content':'','key':'Duration','keyType':_0x0ed1('0x5'),'keyContent':'','variableName':_0x0ed1('0x2a')},{'type':_0x0ed1('0xc'),'content':'','key':_0x0ed1('0x2b'),'keyType':_0x0ed1('0x5'),'keyContent':'','variableName':'billableseconds'}];break;}}return _0x465efe;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index 6f8b841..07d8eda 100644 --- a/server/components/interaction/service.js +++ b/server/components/interaction/service.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3eab=['default','fields','filter','having','read','tags','checkAccountsRestrictions','group','i.id','ids','tag','count','clause','order','forEach','contactName','getClosedOrderClause','DESC','getFilteredInteractions','rows','catch','user','query','clone','body','omit','phone','fax','mobile','updateUser','lodash','./sql-utils','./utils','findAll','skipInteractionsQuery','resolve','getInteractionsQuery','then','search','parseAdvancedSearchFilter','parseQueryParameters','where','contact'];(function(_0x57936d,_0x5473db){var _0x24d9c1=function(_0x1a1d76){while(--_0x1a1d76){_0x57936d['push'](_0x57936d['shift']());}};_0x24d9c1(++_0x5473db);}(_0x3eab,0x176));var _0xb3ea=function(_0x8023bc,_0x40e85c){_0x8023bc=_0x8023bc-0x0;var _0x5818df=_0x3eab[_0x8023bc];return _0x5818df;};'use strict';var _=require(_0xb3ea('0x0'));var sqlUtils=require(_0xb3ea('0x1'));var utils=require(_0xb3ea('0x2'));exports[_0xb3ea('0x3')]=function(_0x447223,_0x52ce7d,_0x881d19,_0xdd13ad,_0x2409d6){var _0x150bd7={'count':0x0,'rows':[]};var _0x53c7f5=sqlUtils[_0xb3ea('0x4')](_0x447223,_0x881d19,_0x52ce7d);if(_0x53c7f5){return Promise[_0xb3ea('0x5')](_0x150bd7);}var _0x352473=sqlUtils[_0xb3ea('0x6')](_0x447223);var _0x4d9df6={};return Promise[_0xb3ea('0x5')]()[_0xb3ea('0x7')](function(){if(_0x52ce7d[_0xb3ea('0x8')]){return sqlUtils[_0xb3ea('0x9')](_0x52ce7d['search'],_0x2409d6);}else{return sqlUtils[_0xb3ea('0xa')](_0x447223,_0x52ce7d,_0x2409d6);}})[_0xb3ea('0x7')](function(_0x131a5b){_0x352473['where'](_0x131a5b['body']);_0x352473[_0xb3ea('0xb')](_0x131a5b[_0xb3ea('0xc')]);_0x352473['where'](_0x131a5b[_0xb3ea('0xd')]);_0x352473[_0xb3ea('0xb')](_0x131a5b[_0xb3ea('0xe')]);_0x352473[_0xb3ea('0xb')](_0x131a5b[_0xb3ea('0xf')]);_0x352473[_0xb3ea('0xb')](_0x131a5b['user']);_0x352473[_0xb3ea('0x10')](_0x131a5b[_0xb3ea('0x11')]);_0x4d9df6=_0x131a5b[_0xb3ea('0x12')];return sqlUtils[_0xb3ea('0x13')](_0x447223,_0x881d19,_0x52ce7d);})[_0xb3ea('0x7')](function(_0x14d41a){_0x352473['where'](_0x14d41a);_0x352473[_0xb3ea('0x14')](_0xb3ea('0x15'));var _0xfe6abd=_0x52ce7d[_0xb3ea('0x8')]?_0x4d9df6[_0xb3ea('0x16')]:_0x52ce7d[_0xb3ea('0x17')];return sqlUtils['countFilteredInteractions'](_0x352473,_0xfe6abd);})['then'](function(_0x54b05d){_0x150bd7[_0xb3ea('0x18')]=_0x54b05d['length'];if(_0x150bd7['count']===0x0){return[];}_0x352473[_0xb3ea('0x10')](_0x4d9df6[_0xb3ea('0x19')]);if(_0xdd13ad[_0xb3ea('0x1a')]){_0xdd13ad[_0xb3ea('0x1a')][_0xb3ea('0x1b')](function(_0x7f2042){var _0xb793f6=_0x7f2042[0x0]===_0xb3ea('0x1c')?_0x7f2042[0x0]:'i.'+_0x7f2042[0x0];_0x352473['order'](_0xb793f6,_0x7f2042[0x1]==='DESC'?![]:!![]);if(_0x7f2042[0x0]==='closed'){var _0x13b43c=sqlUtils[_0xb3ea('0x1d')](_0x447223,_0x52ce7d);_0x352473['order'](_0x13b43c,_0x7f2042[0x1]===_0xb3ea('0x1e')?![]:!![]);}});}return sqlUtils[_0xb3ea('0x1f')](_0x447223,_0x352473,_0x52ce7d,_0xdd13ad);})[_0xb3ea('0x7')](function(_0x1fd461){_0x150bd7[_0xb3ea('0x20')]=_0x1fd461;return _0x150bd7;})[_0xb3ea('0x21')](function(_0x12be90){throw _0x12be90;});};exports['tracked']=function(_0x216a2b,_0x3dfdc7){return function(_0x284fce,_0x2e42ee,_0x4217a1){var _0x31a679=_0x284fce[_0xb3ea('0x22')];var _0x2bdebf={};var _0x124486=_0x284fce[_0xb3ea('0x23')];if(_0x2bdebf){_0x2bdebf=_[_0xb3ea('0x24')](_0x284fce[_0xb3ea('0x25')]);_0x2bdebf=_[_0xb3ea('0x26')](_0x2bdebf,[_0xb3ea('0x25'),'html',_0xb3ea('0x27'),_0xb3ea('0x28'),_0xb3ea('0x29')]);}utils[_0xb3ea('0x2a')](_0x31a679,_0x2bdebf,_0x124486,_0x216a2b,_0x3dfdc7);_0x4217a1(null);};}; \ No newline at end of file +var _0xea27=['then','where','body','contact','default','fields','filter','user','tags','checkAccountsRestrictions','group','i.id','ids','tag','count','having','order','forEach','DESC','getClosedOrderClause','getFilteredInteractions','rows','catch','clone','omit','html','fax','mobile','updateUser','lodash','./sql-utils','./utils','findAll','skipInteractionsQuery','resolve','parseAdvancedSearchFilter','search','parseQueryParameters'];(function(_0xed4d91,_0x573db3){var _0x35bc09=function(_0x3df9c9){while(--_0x3df9c9){_0xed4d91['push'](_0xed4d91['shift']());}};_0x35bc09(++_0x573db3);}(_0xea27,0x101));var _0x7ea2=function(_0x4ae625,_0xf396d0){_0x4ae625=_0x4ae625-0x0;var _0x31accf=_0xea27[_0x4ae625];return _0x31accf;};'use strict';var _=require(_0x7ea2('0x0'));var sqlUtils=require(_0x7ea2('0x1'));var utils=require(_0x7ea2('0x2'));exports[_0x7ea2('0x3')]=function(_0x5df526,_0x367e00,_0x2d00a6,_0x3f4e0d,_0x21f5fe){var _0x176f88={'count':0x0,'rows':[]};var _0x520ef7=sqlUtils[_0x7ea2('0x4')](_0x5df526,_0x2d00a6,_0x367e00);if(_0x520ef7){return Promise[_0x7ea2('0x5')](_0x176f88);}var _0x222cce=sqlUtils['getInteractionsQuery'](_0x5df526);var _0x186b64={};return Promise[_0x7ea2('0x5')]()['then'](function(){if(_0x367e00['search']){return sqlUtils[_0x7ea2('0x6')](_0x367e00[_0x7ea2('0x7')],_0x21f5fe);}else{return sqlUtils[_0x7ea2('0x8')](_0x5df526,_0x367e00,_0x21f5fe);}})[_0x7ea2('0x9')](function(_0x1b064a){_0x222cce[_0x7ea2('0xa')](_0x1b064a[_0x7ea2('0xb')]);_0x222cce[_0x7ea2('0xa')](_0x1b064a[_0x7ea2('0xc')]);_0x222cce['where'](_0x1b064a[_0x7ea2('0xd')]);_0x222cce[_0x7ea2('0xa')](_0x1b064a[_0x7ea2('0xe')]);_0x222cce['where'](_0x1b064a[_0x7ea2('0xf')]);_0x222cce[_0x7ea2('0xa')](_0x1b064a[_0x7ea2('0x10')]);_0x222cce['having'](_0x1b064a['read']);_0x186b64=_0x1b064a[_0x7ea2('0x11')];return sqlUtils[_0x7ea2('0x12')](_0x5df526,_0x2d00a6,_0x367e00);})[_0x7ea2('0x9')](function(_0x39e5a8){_0x222cce['where'](_0x39e5a8);_0x222cce[_0x7ea2('0x13')](_0x7ea2('0x14'));var _0x48bda8=_0x367e00[_0x7ea2('0x7')]?_0x186b64[_0x7ea2('0x15')]:_0x367e00[_0x7ea2('0x16')];return sqlUtils['countFilteredInteractions'](_0x222cce,_0x48bda8);})[_0x7ea2('0x9')](function(_0x481b0b){_0x176f88[_0x7ea2('0x17')]=_0x481b0b['length'];if(_0x176f88['count']===0x0){return[];}_0x222cce[_0x7ea2('0x18')](_0x186b64['clause']);if(_0x3f4e0d['order']){_0x3f4e0d[_0x7ea2('0x19')][_0x7ea2('0x1a')](function(_0x475ef){var _0x520449=_0x475ef[0x0]==='contactName'?_0x475ef[0x0]:'i.'+_0x475ef[0x0];_0x222cce['order'](_0x520449,_0x475ef[0x1]===_0x7ea2('0x1b')?![]:!![]);if(_0x475ef[0x0]==='closed'){var _0x3b9970=sqlUtils[_0x7ea2('0x1c')](_0x5df526,_0x367e00);_0x222cce['order'](_0x3b9970,_0x475ef[0x1]==='DESC'?![]:!![]);}});}return sqlUtils[_0x7ea2('0x1d')](_0x5df526,_0x222cce,_0x367e00,_0x3f4e0d);})[_0x7ea2('0x9')](function(_0x5cd7d3){_0x176f88[_0x7ea2('0x1e')]=_0x5cd7d3;return _0x176f88;})[_0x7ea2('0x1f')](function(_0x320843){throw _0x320843;});};exports['tracked']=function(_0x21ab89,_0x420f1f){return function(_0x3b9ef7,_0x4c77cd,_0x5a2f03){var _0x351316=_0x3b9ef7[_0x7ea2('0x10')];var _0x62946d={};var _0x4929af=_0x3b9ef7['query'];if(_0x62946d){_0x62946d=_[_0x7ea2('0x20')](_0x3b9ef7['body']);_0x62946d=_[_0x7ea2('0x21')](_0x62946d,[_0x7ea2('0xb'),_0x7ea2('0x22'),'phone',_0x7ea2('0x23'),_0x7ea2('0x24')]);}utils[_0x7ea2('0x25')](_0x351316,_0x62946d,_0x4929af,_0x21ab89,_0x420f1f);_0x5a2f03(null);};}; \ No newline at end of file diff --git a/server/components/interaction/sql-utils.js b/server/components/interaction/sql-utils.js index 76d224e..4244a87 100644 --- a/server/components/interaction/sql-utils.js +++ b/server/components/interaction/sql-utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x368e=['squel','../parsers/advancedSearch','../parsers/qs','./update-interaction','updateInteraction','./utils','../../mysqldb','getAccountFK','role','agent','search','select','field','name','color','tools_tags','getInteractionFK','user_has_','_interactions','u.fullname','ui.','left_join','users','u.id\x20=\x20ui.UserId','length','\x20IN\x20?','map','getInteractionsTables','from','interactions','cm_contacts','accounts','a.id\x20=\x20i.','messages','me.','\x20=\x20i.id','interactionsTags','it.','t.id\x20=\x20it.TagId','expr','getSelectedTags','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','unreadMessages\x20{OPERATOR}\x200','replace','{OPERATOR}','isNumeric','i.id\x20LIKE\x20?','whatsapp','i.phone\x20LIKE\x20?','openchannel','i.from\x20LIKE\x20?','mail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','fax','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','parseSearch','sqlOperator','conditions','find','type','default','text','value','unreadMessages','read','and','Contact','operator','split','contact','ContactId','buildExpression','tags','clause','ids','User','$substring','user','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','body','plainBody','end','keys','some','compact','concat','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','resolve','then','fields','filter','capitalize','Websites','Accounts','i.thirdDisposition','i.secondDisposition','i.disposition','unshift','i.substatus','shift','CONCAT_WS(\x27\x27,\x20','Interaction','Sequelize','SELECT','sequelize','toString','merge','attributes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','a.email','Account.email','contactName','i.id','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgDirection','i.to','i.ContactId','i.UserId','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','c.lastName','Contact.lastName','Contact.email','c.mobile','Contact.mobile','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset','query','groupBy','Setting','enableEmailPreview','all','COUNT(*)','isEmpty','where','exports','lodash'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x368e,0x1e5));var _0xe368=function(_0x1b2bde,_0x32ea63){_0x1b2bde=_0x1b2bde-0x0;var _0x1743b9=_0x368e[_0x1b2bde];return _0x1743b9;};'use strict';var _=require(_0xe368('0x0'));var squel=require(_0xe368('0x1'));var as=require(_0xe368('0x2'));var qs=require(_0xe368('0x3'));var updateInteraction=require(_0xe368('0x4'))[_0xe368('0x5')];var utils=require(_0xe368('0x6'));var db=require(_0xe368('0x7'))['db'];function skipInteractionsQuery(_0x45de90,_0x220d78,_0x1f0d19){var _0x57113c=![];var _0x175901=utils[_0xe368('0x8')](_0x45de90);if(_0x220d78[_0xe368('0x9')]===_0xe368('0xa')&&!_0x1f0d19[_0xe368('0xb')]&&!_0x1f0d19[_0x175901]){_0x57113c=!![];}return _0x57113c;}function getTagsQuery(){return squel[_0xe368('0xc')]()[_0xe368('0xd')]('id')[_0xe368('0xd')](_0xe368('0xe'))[_0xe368('0xd')](_0xe368('0xf'))['from'](_0xe368('0x10'));}function getUsersQuery(_0x14461f,_0x9f22d3){var _0x27c3df=utils[_0xe368('0x11')](_0x14461f);var _0x520f85=_0xe368('0x12')+_0x14461f+_0xe368('0x13');var _0x4b30a1=squel[_0xe368('0xc')]()[_0xe368('0xd')]('u.id')[_0xe368('0xd')](_0xe368('0x14'))[_0xe368('0xd')](_0xe368('0x15')+_0x27c3df)['from'](_0x520f85,'ui')[_0xe368('0x16')](_0xe368('0x17'),'u',_0xe368('0x18'));if(_0x9f22d3[_0xe368('0x19')]>0x0){_0x4b30a1['where'](_0xe368('0x15')+_0x27c3df+_0xe368('0x1a'),_[_0xe368('0x1b')](_0x9f22d3,'id'));}return _0x4b30a1;}function getInteractionsQuery(_0x15848e){var _0x213e62=utils[_0xe368('0x1c')](_0x15848e);var _0x44b3b7=utils['getAccountFK'](_0x15848e);var _0x5148e8=utils[_0xe368('0x11')](_0x15848e);return squel[_0xe368('0xc')]()[_0xe368('0x1d')](_0x213e62[_0xe368('0x1e')],'i')['left_join'](_0xe368('0x1f'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xe368('0x16')](_0xe368('0x17'),'o','o.id\x20=\x20i.UserId')[_0xe368('0x16')](_0x213e62[_0xe368('0x20')],'a',_0xe368('0x21')+_0x44b3b7)[_0xe368('0x16')](_0x213e62[_0xe368('0x22')],'me',_0xe368('0x23')+_0x5148e8+_0xe368('0x24'))[_0xe368('0x16')](_0x213e62[_0xe368('0x25')],'it',_0xe368('0x26')+_0x5148e8+_0xe368('0x24'))[_0xe368('0x16')]('tools_tags','t',_0xe368('0x27'));}function getSqlClauses(){var _0x4c39b2={'body':squel[_0xe368('0x28')](),'contact':squel[_0xe368('0x28')](),'default':squel[_0xe368('0x28')](),'fields':squel[_0xe368('0x28')](),'filter':squel['expr'](),'read':squel[_0xe368('0x28')](),'tags':{'clause':squel[_0xe368('0x28')](),'ids':null},'user':squel['expr']()};return _0x4c39b2;}function parseTagParameter(_0x45869f){var _0x207448=squel['expr']();if(_0x45869f){var _0x19ec4a=utils[_0xe368('0x29')](_0x45869f);_0x19ec4a[_0xe368('0x2a')](function(_0x5965d0){_0x207448['or'](_0xe368('0x2b'),'%,'+_0x5965d0+',%');});}return _0x207448;}function parseReadParameter(_0x336e77){var _0x18609f='';if(_0x336e77){_0x18609f=_0xe368('0x2c');if(_0x336e77==='1'){_0x18609f=_0x18609f[_0xe368('0x2d')](_0xe368('0x2e'),'=');}else{_0x18609f=_0x18609f[_0xe368('0x2d')](_0xe368('0x2e'),'>');}}return _0x18609f;}function parseSearchFilter(_0x266893,_0x690513){var _0x2d1b1d=squel[_0xe368('0x28')]();if(_0x690513){var _0x2361d3=_0x690513[_0xe368('0x2d')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xe368('0x2f')](_0x2361d3)){_0x2d1b1d['or'](_0xe368('0x30'),_0x2361d3+'%');if(['sms',_0xe368('0x31')]['includes'](_0x266893)){_0x2d1b1d['or'](_0xe368('0x32'),_0x2361d3+'%');}else if(_0x266893==='fax'){_0x2d1b1d['or']('i.fax\x20LIKE\x20?',_0x2361d3+'%');}else if(_0x266893===_0xe368('0x33')){_0x2d1b1d['or'](_0xe368('0x34'),_0x2361d3+'%');}}else if(_0x266893===_0xe368('0x35')&&qs['isEmail'](_0x2361d3)){_0x2d1b1d['or'](_0xe368('0x36'),_0x2361d3+'%');}else{if(_0x266893===_0xe368('0x35')){_0x2d1b1d['or'](_0xe368('0x37'),qs[_0xe368('0x38')](_0x2361d3,!![]))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xe368('0x38')](_0x2361d3));}else if(_0x266893!==_0xe368('0x39')){_0x2d1b1d['or'](_0xe368('0x3a'),qs[_0xe368('0x38')](_0x2361d3));}_0x2d1b1d['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xe368('0x38')](_0x2361d3,!![]),null);}}return _0x2d1b1d;}function parseAdvancedSearchFilter(_0x334619,_0x11e079){var _0x2d603c=getSqlClauses();var _0x34d566=as[_0xe368('0x3b')](_0x334619);var _0x12d42f=_0x34d566[_0xe368('0x3c')];for(var _0x1bc20c=0x0;_0x1bc20c<_0x34d566['conditions'][_0xe368('0x19')];_0x1bc20c++){var _0x51cdf1=_0x34d566[_0xe368('0x3d')][_0x1bc20c];var _0x3bb425='i';var _0x5e6011=_[_0xe368('0x3e')](_0x11e079,['name',_0x51cdf1[_0xe368('0xd')]]);if(_0x5e6011){var _0x124745=as['buildExpression'](_0x3bb425,_0x5e6011[_0xe368('0x3f')],_0x51cdf1);_0x2d603c[_0xe368('0x40')][_0x12d42f](_0x124745[_0xe368('0x41')],_0x124745[_0xe368('0x42')]['start'],_0x124745[_0xe368('0x42')]['end']);}else{switch(_0x51cdf1[_0xe368('0xd')]){case _0xe368('0x43'):var _0x136239=parseReadParameter(_0x51cdf1[_0xe368('0x42')]);_0x2d603c[_0xe368('0x44')][_0xe368('0x45')](_0x136239);break;case _0xe368('0x46'):if(_0x51cdf1[_0xe368('0x47')]==='$substring'){if(_0x51cdf1[_0xe368('0x42')][_0xe368('0x48')]('\x20')[_0xe368('0x19')]>0x1){_0x2d603c['contact'][_0x12d42f]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xe368('0x38')](_0x51cdf1[_0xe368('0x42')],!![]),null);}else{var _0x401b20='%'+_0x51cdf1['value']+'%';_0x2d603c[_0xe368('0x49')][_0x12d42f]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x401b20,_0x401b20,_0x401b20);}}else{_0x5e6011=_[_0xe368('0x3e')](_0x11e079,['name','ContactId']);_0x51cdf1['field']=_0xe368('0x4a');_0x124745=as[_0xe368('0x4b')](_0x3bb425,_0x5e6011[_0xe368('0x3f')],_0x51cdf1);_0x2d603c['contact'][_0x12d42f](_0x124745[_0xe368('0x41')],_0x124745[_0xe368('0x42')]['start'],_0x124745[_0xe368('0x42')]['end']);}break;case'Tag':var _0x46236c=_0x51cdf1[_0xe368('0x42')][_0xe368('0x48')](',')[_0xe368('0x1b')](function(_0x311aaa){return Number(_0x311aaa);});var _0x5ef7df=parseTagParameter(_0x46236c);_0x2d603c[_0xe368('0x4c')][_0xe368('0x4d')]['and'](_0x5ef7df);_0x2d603c[_0xe368('0x4c')][_0xe368('0x4e')]=_0x46236c;break;case _0xe368('0x4f'):if(_0x51cdf1[_0xe368('0x47')]===_0xe368('0x50')){_0x2d603c[_0xe368('0x51')][_0x12d42f](_0xe368('0x52'),'%'+_0x51cdf1['value']+'%',null);}else{_0x5e6011=_[_0xe368('0x3e')](_0x11e079,[_0xe368('0xe'),_0xe368('0x53')]);_0x51cdf1[_0xe368('0xd')]=_0xe368('0x53');_0x124745=as[_0xe368('0x4b')](_0x3bb425,_0x5e6011['type'],_0x51cdf1);_0x2d603c[_0xe368('0x51')][_0x12d42f](_0x124745[_0xe368('0x41')],_0x124745[_0xe368('0x42')][_0xe368('0x54')],_0x124745[_0xe368('0x42')]['end']);}break;case _0xe368('0x55'):case _0xe368('0x56'):_0x124745=as['buildExpression']('me',null,_0x51cdf1);_0x2d603c[_0xe368('0x55')][_0x12d42f](_0x124745[_0xe368('0x41')],_0x124745[_0xe368('0x42')][_0xe368('0x54')],_0x124745[_0xe368('0x42')][_0xe368('0x57')]);break;}}}return _0x2d603c;}function parseModelFields(_0x8f2d14,_0x13a342,_0x374c5d){var _0x32853a=utils[_0xe368('0x8')](_0x8f2d14);var _0x56fd46=squel[_0xe368('0x28')]();var _0x25d7e8=_(_0x13a342)[_0xe368('0x58')]()[_0xe368('0x1b')](function(_0x1ef0e1){return _[_0xe368('0x59')](_0x374c5d,['name',_0x1ef0e1])?_0x1ef0e1:undefined;})[_0xe368('0x5a')]()[_0xe368('0x42')]();if(_0x25d7e8[_0xe368('0x19')]>0x0){_0x25d7e8[_0xe368('0x2a')](function(_0x14c094){if(_0x14c094===_0x32853a){_0x56fd46[_0xe368('0x45')]('i.'+_0x32853a+_0xe368('0x1a'),[][_0xe368('0x5b')](_0x13a342[_0x14c094]));}else if(_0x14c094===_0xe368('0x5c')){var _0x452668=JSON['parse'](_0x13a342[_0x14c094])[_0xe368('0x5d')];var _0x2a5ae2=JSON[_0xe368('0x5e')](_0x13a342[_0x14c094])[_0xe368('0x5f')];_0x56fd46[_0xe368('0x45')](_0xe368('0x60'),_0x452668,_0x2a5ae2);}else{if(_0x13a342[_0x14c094]===_0xe368('0x61')){_0x56fd46[_0xe368('0x45')]('i.'+_0x14c094+_0xe368('0x62'));}else{_0x56fd46['and']('i.'+_0x14c094+_0xe368('0x63'),_0x13a342[_0x14c094]);}}});}return _0x56fd46;}function parseQueryParameters(_0x5432ab,_0x2ccafc,_0x7074ae){var _0x235521=getSqlClauses();return Promise[_0xe368('0x64')]()[_0xe368('0x65')](function(){return parseModelFields(_0x5432ab,_0x2ccafc,_0x7074ae);})[_0xe368('0x65')](function(_0x4c7e4a){_0x235521[_0xe368('0x66')]['and'](_0x4c7e4a);return parseReadParameter(_0x2ccafc['read']);})[_0xe368('0x65')](function(_0x39e2c6){_0x235521['read'][_0xe368('0x45')](_0x39e2c6);return parseTagParameter(_0x2ccafc['tag']);})[_0xe368('0x65')](function(_0x2e9d8e){_0x235521[_0xe368('0x4c')][_0xe368('0x4d')]['and'](_0x2e9d8e);return parseSearchFilter(_0x5432ab,_0x2ccafc[_0xe368('0x67')]);})[_0xe368('0x65')](function(_0x1e32ec){_0x235521['filter']=_0x1e32ec;return _0x235521;});}function checkAccountsRestrictions(_0x460262,_0x13c846,_0xc92c01){var _0x17d338=utils[_0xe368('0x8')](_0x460262);var _0x3a658a='get'+_[_0xe368('0x68')](_0x460262)+(_0x460262==='chat'?_0xe368('0x69'):_0xe368('0x6a'));var _0x52d37f=squel[_0xe368('0x28')]();return Promise['resolve']()[_0xe368('0x65')](function(){if(_0xc92c01[_0xe368('0xb')]&&_0x13c846['role']==='agent'){return _0x13c846[_0x3a658a]({'attributes':['id'],'raw':!![]});}})[_0xe368('0x65')](function(_0x4ca02d){if(_0x4ca02d){if(_0x4ca02d[_0xe368('0x19')]===0x0){_0x52d37f['and']('i.'+_0x17d338+_0xe368('0x62'));}else{_0x52d37f[_0xe368('0x45')]('i.'+_0x17d338+_0xe368('0x1a'),_[_0xe368('0x1b')](_0x4ca02d,'id'));}}else if(!_0xc92c01[_0x17d338]){_0x52d37f['and']('i.'+_0x17d338+'\x20IS\x20NOT\x20NULL');}})[_0xe368('0x65')](function(){return _0x52d37f;});}function getClosedOrderClause(_0x4a3c89,_0x352b4a){var _0x1140c4='';var _0x249da6=[_0xe368('0x6b'),_0xe368('0x6c'),_0xe368('0x6d')];if(_0x4a3c89===_0xe368('0x35')){_0x249da6[_0xe368('0x6e')](_0xe368('0x6f'));}if(_0x352b4a['closed']==='0'&&_0x4a3c89===_0xe368('0x35')){_0x1140c4=_0xe368('0x6f');}else{if(_0x352b4a['closed']==='1'){_0x249da6[_0xe368('0x70')]();}_0x1140c4=_0xe368('0x71')+_0x249da6['join'](',\x20')+')';}return _0x1140c4;}function getFilteredInteractions(_0x4ef16f,_0xc0d4c2,_0x480508,_0x38e543){var _0x1019bb=utils['getInteractionFK'](_0x4ef16f);var _0x55dbd8=_['capitalize'](_0x4ef16f)+_0xe368('0x72');var _0x4b60c9=[];var _0x2146e6=getTagsQuery();var _0x1e9af4={'type':db[_0xe368('0x73')]['QueryTypes'][_0xe368('0x74')],'raw':!![]};var _0x580ab0=[];var _0x5750b4=[];return db[_0xe368('0x75')]['query'](_0x2146e6[_0xe368('0x76')](),_0x1e9af4)[_0xe368('0x65')](function(_0x521400){_0x4b60c9=_['keyBy'](_0x521400,'id');_0x1e9af4=_[_0xe368('0x77')](_0x1e9af4,{'model':db[_0x55dbd8],'mapToModel':!![],'nest':!![]});if(_0x480508[_0xe368('0x66')]){_0x38e543[_0xe368('0x78')][_0xe368('0x2a')](function(_0x3ed5cf){_0xc0d4c2['field']('i.'+_0x3ed5cf);});}else{_0xc0d4c2[_0xe368('0xd')](_0xe368('0x79'),_0xe368('0x43'));_0xc0d4c2['field']('a.key',_0xe368('0x7a'));_0xc0d4c2['field'](_0xe368('0x7b'),_0xe368('0x7c'));if(_0x4ef16f===_0xe368('0x35')){_0xc0d4c2[_0xe368('0xd')](_0xe368('0x7d'),_0xe368('0x7e'));_0xc0d4c2[_0xe368('0xd')]('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',_0xe368('0x7f'));_0xc0d4c2['field'](_0xe368('0x80'));_0xc0d4c2[_0xe368('0xd')](_0xe368('0x81'));_0xc0d4c2['field'](_0xe368('0x82'));_0xc0d4c2[_0xe368('0xd')](_0xe368('0x83'));_0xc0d4c2['field'](_0xe368('0x84'));_0xc0d4c2[_0xe368('0xd')](_0xe368('0x85'));_0xc0d4c2[_0xe368('0xd')]('i.lastMsgAt');_0xc0d4c2[_0xe368('0xd')](_0xe368('0x86'));_0xc0d4c2[_0xe368('0xd')]('i.subject');_0xc0d4c2[_0xe368('0xd')](_0xe368('0x6d'));_0xc0d4c2[_0xe368('0xd')](_0xe368('0x6c'));_0xc0d4c2[_0xe368('0xd')](_0xe368('0x6b'));_0xc0d4c2[_0xe368('0xd')](_0xe368('0x6f'));_0xc0d4c2[_0xe368('0xd')](_0xe368('0x87'));_0xc0d4c2[_0xe368('0xd')](_0xe368('0x88'));_0xc0d4c2[_0xe368('0xd')]('i.MailAccountId');_0xc0d4c2['field'](_0xe368('0x89'));}else if(_0x4ef16f===_0xe368('0x33')){_0xc0d4c2[_0xe368('0xd')](_0xe368('0x8a'),_0xe368('0x7f'));}else{_0xc0d4c2['field'](_0xe368('0x8b'),_0xe368('0x7f'));}if(_0x4ef16f!==_0xe368('0x35')){_0xc0d4c2[_0xe368('0xd')]('i.*');}_0xc0d4c2[_0xe368('0xd')](_0xe368('0x8c'),'Contact.firstName');_0xc0d4c2[_0xe368('0xd')](_0xe368('0x8d'),_0xe368('0x8e'));_0xc0d4c2[_0xe368('0xd')]('c.email',_0xe368('0x8f'));_0xc0d4c2[_0xe368('0xd')]('c.phone','Contact.phone');_0xc0d4c2[_0xe368('0xd')](_0xe368('0x90'),_0xe368('0x91'));_0xc0d4c2[_0xe368('0xd')]('c.fax','Contact.fax');_0xc0d4c2[_0xe368('0xd')](_0xe368('0x92'),'Owner.fullname');_0xc0d4c2['field'](_0xe368('0x93'),_0xe368('0x94'));_0xc0d4c2[_0xe368('0xd')](_0xe368('0x95'),_0xe368('0x96'));}if(_0x38e543[_0xe368('0x97')]){_0xc0d4c2[_0xe368('0x97')](_0x38e543[_0xe368('0x97')]);}if(_0x38e543[_0xe368('0x98')]){_0xc0d4c2[_0xe368('0x98')](_0x38e543[_0xe368('0x98')]);}return db[_0xe368('0x75')]['query'](_0xc0d4c2[_0xe368('0x76')](),_0x1e9af4);})['then'](function(_0xe234cf){_0x580ab0=_0xe234cf;var _0x24ddcd=getUsersQuery(_0x4ef16f,_0x580ab0);return db[_0xe368('0x75')][_0xe368('0x99')](_0x24ddcd['toString'](),_0x1e9af4);})[_0xe368('0x65')](function(_0x27f3f0){_0x5750b4=_[_0xe368('0x9a')](_0x27f3f0,_0x1019bb);if(_0x4ef16f===_0xe368('0x35')){return db[_0xe368('0x9b')]['findOne']({'attributes':[_0xe368('0x9c')],'raw':!![]});}})['then'](function(_0x5b1e84){var _0x1eaae3=_0x5b1e84?_0x5b1e84[_0xe368('0x9c')]:undefined;var _0x5a9be3=_0x580ab0[_0xe368('0x1b')](function(_0x4d5c5c){return updateInteraction(_0x4d5c5c,_0x4b60c9,_0x5750b4,_0x1eaae3);});return Promise[_0xe368('0x9d')](_0x5a9be3);});}function countFilteredInteractions(_0x1239b4,_0x221eff){var _0xf7a54=_0x1239b4['clone']();_0xf7a54[_0xe368('0xd')](_0xe368('0x9e'));_0xf7a54['field'](_0xe368('0x79'),_0xe368('0x43'));var _0x29ee70=utils[_0xe368('0x29')](_0x221eff);if(!_[_0xe368('0x9f')](_0x29ee70)){_0xf7a54[_0xe368('0xa0')]('t.id\x20IN\x20?',_0x29ee70);}var _0x410ea6={'type':db[_0xe368('0x73')]['QueryTypes'][_0xe368('0x74')],'raw':!![]};return db['sequelize']['query'](_0xf7a54[_0xe368('0x76')](),_0x410ea6);}module[_0xe368('0xa1')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file +var _0x3346=['i.closed','i.attach','i.lastMsgAt','i.subject','i.MailAccountId','i.UserId','openchannel','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','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','i.*','c.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset','sequelize','groupBy','enableEmailPreview','all','clone','COUNT(*)','isEmpty','Sequelize','exports','lodash','squel','../parsers/advancedSearch','../parsers/qs','./update-interaction','updateInteraction','./utils','getAccountFK','role','agent','search','select','field','name','color','tools_tags','user_has_','_interactions','u.id','u.fullname','ui.','left_join','users','u.id\x20=\x20ui.UserId','length','where','\x20IN\x20?','map','from','interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','accounts','a.id\x20=\x20i.','messages','me.','it.','t.id\x20=\x20it.TagId','expr','getSelectedTags','forEach','unreadMessages\x20{OPERATOR}\x200','replace','{OPERATOR}','isNumeric','i.id\x20LIKE\x20?','sms','includes','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)','parseSearch','sqlOperator','find','type','default','text','start','end','unreadMessages','value','read','and','Contact','operator','$substring','split','contact','buildExpression','Tag','tags','clause','ids','User','UserId','user','plainBody','body','keys','some','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','resolve','then','fields','tag','filter','get','capitalize','chat','Websites','Accounts','\x20IS\x20NULL','\x20IS\x20NOT\x20NULL','i.thirdDisposition','i.secondDisposition','i.disposition','unshift','i.substatus','closed','shift','join','getInteractionFK','Interaction','QueryTypes','SELECT','query','toString','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','a.email','Account.email','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.id','i.createdAt','i.updatedAt'];(function(_0x400cdf,_0x1f5dcf){var _0x46120d=function(_0x44ee51){while(--_0x44ee51){_0x400cdf['push'](_0x400cdf['shift']());}};_0x46120d(++_0x1f5dcf);}(_0x3346,0xc8));var _0x6334=function(_0x5514b0,_0x30ecbc){_0x5514b0=_0x5514b0-0x0;var _0x381527=_0x3346[_0x5514b0];return _0x381527;};'use strict';var _=require(_0x6334('0x0'));var squel=require(_0x6334('0x1'));var as=require(_0x6334('0x2'));var qs=require(_0x6334('0x3'));var updateInteraction=require(_0x6334('0x4'))[_0x6334('0x5')];var utils=require(_0x6334('0x6'));var db=require('../../mysqldb')['db'];function skipInteractionsQuery(_0xd6ab80,_0x78d7b6,_0x580db9){var _0x3462f8=![];var _0x4f6fc2=utils[_0x6334('0x7')](_0xd6ab80);if(_0x78d7b6[_0x6334('0x8')]===_0x6334('0x9')&&!_0x580db9[_0x6334('0xa')]&&!_0x580db9[_0x4f6fc2]){_0x3462f8=!![];}return _0x3462f8;}function getTagsQuery(){return squel[_0x6334('0xb')]()[_0x6334('0xc')]('id')[_0x6334('0xc')](_0x6334('0xd'))[_0x6334('0xc')](_0x6334('0xe'))['from'](_0x6334('0xf'));}function getUsersQuery(_0x1cc8d9,_0x26cffe){var _0x28297d=utils['getInteractionFK'](_0x1cc8d9);var _0x5be695=_0x6334('0x10')+_0x1cc8d9+_0x6334('0x11');var _0x577512=squel['select']()[_0x6334('0xc')](_0x6334('0x12'))[_0x6334('0xc')](_0x6334('0x13'))['field'](_0x6334('0x14')+_0x28297d)['from'](_0x5be695,'ui')[_0x6334('0x15')](_0x6334('0x16'),'u',_0x6334('0x17'));if(_0x26cffe[_0x6334('0x18')]>0x0){_0x577512[_0x6334('0x19')](_0x6334('0x14')+_0x28297d+_0x6334('0x1a'),_[_0x6334('0x1b')](_0x26cffe,'id'));}return _0x577512;}function getInteractionsQuery(_0x2316c8){var _0x1043c0=utils['getInteractionsTables'](_0x2316c8);var _0x510a14=utils[_0x6334('0x7')](_0x2316c8);var _0x4dc60e=utils['getInteractionFK'](_0x2316c8);return squel[_0x6334('0xb')]()[_0x6334('0x1c')](_0x1043c0[_0x6334('0x1d')],'i')['left_join'](_0x6334('0x1e'),'c',_0x6334('0x1f'))[_0x6334('0x15')]('users','o',_0x6334('0x20'))[_0x6334('0x15')](_0x1043c0[_0x6334('0x21')],'a',_0x6334('0x22')+_0x510a14)[_0x6334('0x15')](_0x1043c0[_0x6334('0x23')],'me',_0x6334('0x24')+_0x4dc60e+'\x20=\x20i.id')['left_join'](_0x1043c0['interactionsTags'],'it',_0x6334('0x25')+_0x4dc60e+'\x20=\x20i.id')[_0x6334('0x15')](_0x6334('0xf'),'t',_0x6334('0x26'));}function getSqlClauses(){var _0x516b26={'body':squel[_0x6334('0x27')](),'contact':squel[_0x6334('0x27')](),'default':squel['expr'](),'fields':squel['expr'](),'filter':squel[_0x6334('0x27')](),'read':squel['expr'](),'tags':{'clause':squel['expr'](),'ids':null},'user':squel[_0x6334('0x27')]()};return _0x516b26;}function parseTagParameter(_0x54ac57){var _0x219b19=squel[_0x6334('0x27')]();if(_0x54ac57){var _0x2c640b=utils[_0x6334('0x28')](_0x54ac57);_0x2c640b[_0x6334('0x29')](function(_0x11c5fe){_0x219b19['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x11c5fe+',%');});}return _0x219b19;}function parseReadParameter(_0x32e655){var _0x1e6351='';if(_0x32e655){_0x1e6351=_0x6334('0x2a');if(_0x32e655==='1'){_0x1e6351=_0x1e6351[_0x6334('0x2b')]('{OPERATOR}','=');}else{_0x1e6351=_0x1e6351[_0x6334('0x2b')](_0x6334('0x2c'),'>');}}return _0x1e6351;}function parseSearchFilter(_0x2ee53e,_0x8f9d1c){var _0x2b4924=squel[_0x6334('0x27')]();if(_0x8f9d1c){var _0x37e75a=_0x8f9d1c[_0x6334('0x2b')]('\x5c','\x5c\x5c')[_0x6334('0x2b')](/'/g,'\x27\x27');if(qs[_0x6334('0x2d')](_0x37e75a)){_0x2b4924['or'](_0x6334('0x2e'),_0x37e75a+'%');if([_0x6334('0x2f'),'whatsapp'][_0x6334('0x30')](_0x2ee53e)){_0x2b4924['or']('i.phone\x20LIKE\x20?',_0x37e75a+'%');}else if(_0x2ee53e===_0x6334('0x31')){_0x2b4924['or'](_0x6334('0x32'),_0x37e75a+'%');}else if(_0x2ee53e==='openchannel'){_0x2b4924['or'](_0x6334('0x33'),_0x37e75a+'%');}}else if(_0x2ee53e===_0x6334('0x34')&&qs[_0x6334('0x35')](_0x37e75a)){_0x2b4924['or'](_0x6334('0x36'),_0x37e75a+'%');}else{if(_0x2ee53e===_0x6334('0x34')){_0x2b4924['or'](_0x6334('0x37'),qs[_0x6334('0x38')](_0x37e75a,!![]))['or'](_0x6334('0x39'),qs[_0x6334('0x38')](_0x37e75a));}else if(_0x2ee53e!=='fax'){_0x2b4924['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x6334('0x38')](_0x37e75a));}_0x2b4924['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x37e75a,!![]),null);}}return _0x2b4924;}function parseAdvancedSearchFilter(_0x16b6fa,_0x1a2390){var _0x460d5c=getSqlClauses();var _0xa38c60=as[_0x6334('0x3a')](_0x16b6fa);var _0x54f4eb=_0xa38c60[_0x6334('0x3b')];for(var _0x3a0ecb=0x0;_0x3a0ecb<_0xa38c60['conditions']['length'];_0x3a0ecb++){var _0x349cc0=_0xa38c60['conditions'][_0x3a0ecb];var _0x4ff0dc='i';var _0x51c879=_[_0x6334('0x3c')](_0x1a2390,[_0x6334('0xd'),_0x349cc0[_0x6334('0xc')]]);if(_0x51c879){var _0x1dab16=as['buildExpression'](_0x4ff0dc,_0x51c879[_0x6334('0x3d')],_0x349cc0);_0x460d5c[_0x6334('0x3e')][_0x54f4eb](_0x1dab16[_0x6334('0x3f')],_0x1dab16['value'][_0x6334('0x40')],_0x1dab16['value'][_0x6334('0x41')]);}else{switch(_0x349cc0[_0x6334('0xc')]){case _0x6334('0x42'):var _0x528210=parseReadParameter(_0x349cc0[_0x6334('0x43')]);_0x460d5c[_0x6334('0x44')][_0x6334('0x45')](_0x528210);break;case _0x6334('0x46'):if(_0x349cc0[_0x6334('0x47')]===_0x6334('0x48')){if(_0x349cc0[_0x6334('0x43')][_0x6334('0x49')]('\x20')[_0x6334('0x18')]>0x1){_0x460d5c['contact'][_0x54f4eb]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x6334('0x38')](_0x349cc0[_0x6334('0x43')],!![]),null);}else{var _0x5b126d='%'+_0x349cc0[_0x6334('0x43')]+'%';_0x460d5c[_0x6334('0x4a')][_0x54f4eb]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x5b126d,_0x5b126d,_0x5b126d);}}else{_0x51c879=_['find'](_0x1a2390,[_0x6334('0xd'),'ContactId']);_0x349cc0[_0x6334('0xc')]='ContactId';_0x1dab16=as[_0x6334('0x4b')](_0x4ff0dc,_0x51c879['type'],_0x349cc0);_0x460d5c[_0x6334('0x4a')][_0x54f4eb](_0x1dab16[_0x6334('0x3f')],_0x1dab16[_0x6334('0x43')]['start'],_0x1dab16[_0x6334('0x43')][_0x6334('0x41')]);}break;case _0x6334('0x4c'):var _0x406599=_0x349cc0[_0x6334('0x43')][_0x6334('0x49')](',')[_0x6334('0x1b')](function(_0x7ec5d5){return Number(_0x7ec5d5);});var _0x582b84=parseTagParameter(_0x406599);_0x460d5c[_0x6334('0x4d')][_0x6334('0x4e')][_0x6334('0x45')](_0x582b84);_0x460d5c[_0x6334('0x4d')][_0x6334('0x4f')]=_0x406599;break;case _0x6334('0x50'):if(_0x349cc0[_0x6334('0x47')]===_0x6334('0x48')){_0x460d5c['user'][_0x54f4eb]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x349cc0['value']+'%',null);}else{_0x51c879=_[_0x6334('0x3c')](_0x1a2390,[_0x6334('0xd'),_0x6334('0x51')]);_0x349cc0[_0x6334('0xc')]=_0x6334('0x51');_0x1dab16=as[_0x6334('0x4b')](_0x4ff0dc,_0x51c879[_0x6334('0x3d')],_0x349cc0);_0x460d5c[_0x6334('0x52')][_0x54f4eb](_0x1dab16[_0x6334('0x3f')],_0x1dab16[_0x6334('0x43')][_0x6334('0x40')],_0x1dab16[_0x6334('0x43')][_0x6334('0x41')]);}break;case'body':case _0x6334('0x53'):_0x1dab16=as['buildExpression']('me',null,_0x349cc0);_0x460d5c[_0x6334('0x54')][_0x54f4eb](_0x1dab16[_0x6334('0x3f')],_0x1dab16[_0x6334('0x43')][_0x6334('0x40')],_0x1dab16[_0x6334('0x43')][_0x6334('0x41')]);break;}}}return _0x460d5c;}function parseModelFields(_0x405d61,_0x25ba53,_0x307f1c){var _0x4977c7=utils['getAccountFK'](_0x405d61);var _0x1d2d17=squel[_0x6334('0x27')]();var _0x14d4d4=_(_0x25ba53)[_0x6334('0x55')]()[_0x6334('0x1b')](function(_0x1fd1a7){return _[_0x6334('0x56')](_0x307f1c,[_0x6334('0xd'),_0x1fd1a7])?_0x1fd1a7:undefined;})['compact']()['value']();if(_0x14d4d4['length']>0x0){_0x14d4d4[_0x6334('0x29')](function(_0x56ca5e){if(_0x56ca5e===_0x4977c7){_0x1d2d17['and']('i.'+_0x4977c7+'\x20IN\x20?',[]['concat'](_0x25ba53[_0x56ca5e]));}else if(_0x56ca5e===_0x6334('0x57')){var _0x2dda84=JSON[_0x6334('0x58')](_0x25ba53[_0x56ca5e])[_0x6334('0x59')];var _0xc65ff9=JSON[_0x6334('0x58')](_0x25ba53[_0x56ca5e])['$lte'];_0x1d2d17[_0x6334('0x45')](_0x6334('0x5a'),_0x2dda84,_0xc65ff9);}else{if(_0x25ba53[_0x56ca5e]===_0x6334('0x5b')){_0x1d2d17[_0x6334('0x45')]('i.'+_0x56ca5e+'\x20IS\x20NULL');}else{_0x1d2d17[_0x6334('0x45')]('i.'+_0x56ca5e+'\x20=\x20?',_0x25ba53[_0x56ca5e]);}}});}return _0x1d2d17;}function parseQueryParameters(_0x31dfbb,_0x204fa3,_0x22d56b){var _0x3c9ee8=getSqlClauses();return Promise[_0x6334('0x5c')]()[_0x6334('0x5d')](function(){return parseModelFields(_0x31dfbb,_0x204fa3,_0x22d56b);})[_0x6334('0x5d')](function(_0x5216f6){_0x3c9ee8[_0x6334('0x5e')][_0x6334('0x45')](_0x5216f6);return parseReadParameter(_0x204fa3['read']);})[_0x6334('0x5d')](function(_0xa9cf61){_0x3c9ee8[_0x6334('0x44')][_0x6334('0x45')](_0xa9cf61);return parseTagParameter(_0x204fa3[_0x6334('0x5f')]);})[_0x6334('0x5d')](function(_0x18df1d){_0x3c9ee8[_0x6334('0x4d')]['clause']['and'](_0x18df1d);return parseSearchFilter(_0x31dfbb,_0x204fa3[_0x6334('0x60')]);})[_0x6334('0x5d')](function(_0x53a47f){_0x3c9ee8[_0x6334('0x60')]=_0x53a47f;return _0x3c9ee8;});}function checkAccountsRestrictions(_0x414f7d,_0x1e90c1,_0x3471b3){var _0x49286f=utils[_0x6334('0x7')](_0x414f7d);var _0x4d882d=_0x6334('0x61')+_[_0x6334('0x62')](_0x414f7d)+(_0x414f7d===_0x6334('0x63')?_0x6334('0x64'):_0x6334('0x65'));var _0x3fc509=squel['expr']();return Promise['resolve']()[_0x6334('0x5d')](function(){if(_0x3471b3['search']&&_0x1e90c1[_0x6334('0x8')]==='agent'){return _0x1e90c1[_0x4d882d]({'attributes':['id'],'raw':!![]});}})[_0x6334('0x5d')](function(_0x554bff){if(_0x554bff){if(_0x554bff[_0x6334('0x18')]===0x0){_0x3fc509[_0x6334('0x45')]('i.'+_0x49286f+_0x6334('0x66'));}else{_0x3fc509['and']('i.'+_0x49286f+_0x6334('0x1a'),_[_0x6334('0x1b')](_0x554bff,'id'));}}else if(!_0x3471b3[_0x49286f]){_0x3fc509[_0x6334('0x45')]('i.'+_0x49286f+_0x6334('0x67'));}})['then'](function(){return _0x3fc509;});}function getClosedOrderClause(_0x814ed0,_0x533f92){var _0x1cb040='';var _0xf7d04b=[_0x6334('0x68'),_0x6334('0x69'),_0x6334('0x6a')];if(_0x814ed0==='mail'){_0xf7d04b[_0x6334('0x6b')](_0x6334('0x6c'));}if(_0x533f92['closed']==='0'&&_0x814ed0==='mail'){_0x1cb040=_0x6334('0x6c');}else{if(_0x533f92[_0x6334('0x6d')]==='1'){_0xf7d04b[_0x6334('0x6e')]();}_0x1cb040='CONCAT_WS(\x27\x27,\x20'+_0xf7d04b[_0x6334('0x6f')](',\x20')+')';}return _0x1cb040;}function getFilteredInteractions(_0x305807,_0x21bff8,_0x5b040b,_0x2516b1){var _0x28b69a=utils[_0x6334('0x70')](_0x305807);var _0x1883d9=_['capitalize'](_0x305807)+_0x6334('0x71');var _0x5ba847=[];var _0x547a55=getTagsQuery();var _0x2eb796={'type':db['Sequelize'][_0x6334('0x72')][_0x6334('0x73')],'raw':!![]};var _0x23ad49=[];var _0x8b71c4=[];return db['sequelize'][_0x6334('0x74')](_0x547a55[_0x6334('0x75')](),_0x2eb796)[_0x6334('0x5d')](function(_0x4e8f3e){_0x5ba847=_['keyBy'](_0x4e8f3e,'id');_0x2eb796=_[_0x6334('0x76')](_0x2eb796,{'model':db[_0x1883d9],'mapToModel':!![],'nest':!![]});if(_0x5b040b[_0x6334('0x5e')]){_0x2516b1['attributes'][_0x6334('0x29')](function(_0xc212f3){_0x21bff8[_0x6334('0xc')]('i.'+_0xc212f3);});}else{_0x21bff8['field'](_0x6334('0x77'),_0x6334('0x42'));_0x21bff8['field'](_0x6334('0x78'),_0x6334('0x79'));_0x21bff8[_0x6334('0xc')](_0x6334('0x7a'),_0x6334('0x7b'));if(_0x305807===_0x6334('0x34')){_0x21bff8[_0x6334('0xc')](_0x6334('0x7c'),_0x6334('0x7d'));_0x21bff8[_0x6334('0xc')](_0x6334('0x7e'),'contactName');_0x21bff8['field'](_0x6334('0x7f'));_0x21bff8[_0x6334('0xc')](_0x6334('0x80'));_0x21bff8[_0x6334('0xc')](_0x6334('0x81'));_0x21bff8[_0x6334('0xc')](_0x6334('0x82'));_0x21bff8['field']('i.closedAt');_0x21bff8[_0x6334('0xc')](_0x6334('0x83'));_0x21bff8['field'](_0x6334('0x84'));_0x21bff8['field']('i.lastMsgDirection');_0x21bff8['field'](_0x6334('0x85'));_0x21bff8[_0x6334('0xc')]('i.disposition');_0x21bff8[_0x6334('0xc')](_0x6334('0x69'));_0x21bff8['field'](_0x6334('0x68'));_0x21bff8[_0x6334('0xc')](_0x6334('0x6c'));_0x21bff8[_0x6334('0xc')]('i.to');_0x21bff8['field']('i.ContactId');_0x21bff8[_0x6334('0xc')](_0x6334('0x86'));_0x21bff8[_0x6334('0xc')](_0x6334('0x87'));}else if(_0x305807===_0x6334('0x88')){_0x21bff8['field'](_0x6334('0x89'),_0x6334('0x8a'));}else{_0x21bff8['field'](_0x6334('0x8b'),_0x6334('0x8a'));}if(_0x305807!=='mail'){_0x21bff8[_0x6334('0xc')](_0x6334('0x8c'));}_0x21bff8[_0x6334('0xc')](_0x6334('0x8d'),'Contact.firstName');_0x21bff8[_0x6334('0xc')]('c.lastName',_0x6334('0x8e'));_0x21bff8[_0x6334('0xc')](_0x6334('0x8f'),_0x6334('0x90'));_0x21bff8[_0x6334('0xc')](_0x6334('0x91'),_0x6334('0x92'));_0x21bff8[_0x6334('0xc')](_0x6334('0x93'),_0x6334('0x94'));_0x21bff8[_0x6334('0xc')](_0x6334('0x95'),'Contact.fax');_0x21bff8[_0x6334('0xc')](_0x6334('0x96'),'Owner.fullname');_0x21bff8['field']('o.internal',_0x6334('0x97'));_0x21bff8[_0x6334('0xc')](_0x6334('0x98'),_0x6334('0x99'));}if(_0x2516b1[_0x6334('0x9a')]){_0x21bff8[_0x6334('0x9a')](_0x2516b1['limit']);}if(_0x2516b1['offset']){_0x21bff8[_0x6334('0x9b')](_0x2516b1['offset']);}return db[_0x6334('0x9c')]['query'](_0x21bff8[_0x6334('0x75')](),_0x2eb796);})[_0x6334('0x5d')](function(_0x428629){_0x23ad49=_0x428629;var _0x55b05d=getUsersQuery(_0x305807,_0x23ad49);return db[_0x6334('0x9c')][_0x6334('0x74')](_0x55b05d['toString'](),_0x2eb796);})[_0x6334('0x5d')](function(_0x36af80){_0x8b71c4=_[_0x6334('0x9d')](_0x36af80,_0x28b69a);if(_0x305807===_0x6334('0x34')){return db['Setting']['findOne']({'attributes':[_0x6334('0x9e')],'raw':!![]});}})[_0x6334('0x5d')](function(_0x346d68){var _0x1ceedb=_0x346d68?_0x346d68[_0x6334('0x9e')]:undefined;var _0x274190=_0x23ad49[_0x6334('0x1b')](function(_0x6d1ecd){return updateInteraction(_0x6d1ecd,_0x5ba847,_0x8b71c4,_0x1ceedb);});return Promise[_0x6334('0x9f')](_0x274190);});}function countFilteredInteractions(_0xd6377b,_0x6a80b5){var _0x3fa0f0=_0xd6377b[_0x6334('0xa0')]();_0x3fa0f0[_0x6334('0xc')](_0x6334('0xa1'));_0x3fa0f0[_0x6334('0xc')](_0x6334('0x77'),'unreadMessages');var _0x1b2141=utils['getSelectedTags'](_0x6a80b5);if(!_[_0x6334('0xa2')](_0x1b2141)){_0x3fa0f0[_0x6334('0x19')]('t.id\x20IN\x20?',_0x1b2141);}var _0x3f27c2={'type':db[_0x6334('0xa3')][_0x6334('0x72')][_0x6334('0x73')],'raw':!![]};return db[_0x6334('0x9c')][_0x6334('0x74')](_0x3fa0f0[_0x6334('0x75')](),_0x3f27c2);}module[_0x6334('0xa4')]={'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 b1d8137..fed2acd 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 _0x4e4e=['talking','unmanaged','MailMessage','out','plainBody','-id','then','lastMsgText','catch','updateInteraction','Users','TagIds','Tags','lodash','map','split','push','waiting','abandoned','closed','disposition','UserId','answered'];(function(_0x4a90c2,_0x4bab41){var _0x518377=function(_0x40c9f8){while(--_0x40c9f8){_0x4a90c2['push'](_0x4a90c2['shift']());}};_0x518377(++_0x4bab41);}(_0x4e4e,0xdc));var _0xe4e4=function(_0x262236,_0x856fa9){_0x262236=_0x262236-0x0;var _0x1f42dc=_0x4e4e[_0x262236];return _0x1f42dc;};'use strict';var _=require(_0xe4e4('0x0'));var db=require('../../mysqldb')['db'];function getInteractionUsers(_0x217c85,_0x215d81){return new Promise(function(_0xf1fe06,_0x2a77ff){try{var _0x1c71a0=[];if(_0x215d81[_0x217c85]){_0x1c71a0=_0x215d81[_0x217c85][_0xe4e4('0x1')](function(_0x2d29f1){return{'id':_0x2d29f1['id'],'fullname':_0x2d29f1['fullname']};});}return _0xf1fe06(_0x1c71a0);}catch(_0xf20d69){_0x2a77ff(_0xf20d69);}});}function getInteractionTags(_0x3bc379,_0x1a6ddf){var _0x419b6d=[];if(_0x3bc379){_0x3bc379[_0xe4e4('0x2')](',')['forEach'](function(_0x187de5){_0x419b6d[_0xe4e4('0x3')](_0x1a6ddf[_0x187de5]);});}return _0x419b6d;}function updateWaitingCounter(_0x168a48){if(_0x168a48[_0xe4e4('0x4')]){_0x168a48[_0xe4e4('0x4')]-=0x1;}}function updateInteractionCounters(_0x255508){_0x255508['waiting']=0x0;_0x255508['talking']=0x0;_0x255508['answered']=0x0;_0x255508['unmanaged']=0x0;_0x255508[_0xe4e4('0x5')]=0x0;_0x255508['total']=0x0;if(_0x255508[_0xe4e4('0x6')]){if(_0x255508[_0xe4e4('0x7')]===_0xe4e4('0x5')){_0x255508[_0xe4e4('0x5')]+=0x1;updateWaitingCounter(_0x255508);}if(_0x255508[_0xe4e4('0x8')]){_0x255508[_0xe4e4('0x9')]+=0x1;if(_0x255508[_0xe4e4('0xa')]){_0x255508[_0xe4e4('0xa')]-=0x1;}}else{if(_0x255508['disposition']){_0x255508[_0xe4e4('0xb')]+=0x1;updateWaitingCounter(_0x255508);}}}else{if(!_0x255508[_0xe4e4('0x8')]){_0x255508[_0xe4e4('0x4')]+=0x1;}if(_0x255508[_0xe4e4('0x8')]){_0x255508[_0xe4e4('0xa')]+=0x1;updateWaitingCounter(_0x255508);}}_0x255508['total']+=0x1;return _0x255508;}function getLastMessageText(_0x277ade){return db[_0xe4e4('0xc')]['findOne']({'where':{'$and':[{'MailInteractionId':_0x277ade['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xe4e4('0xd')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xe4e4('0xe')],'order':_0xe4e4('0xf'),'raw':!![]})[_0xe4e4('0x10')](function(_0x55d8ea){if(_0x55d8ea&&_0x55d8ea[_0xe4e4('0xe')]){_0x277ade[_0xe4e4('0x11')]=_['trimStart'](_0x55d8ea[_0xe4e4('0xe')]);}return _0x277ade;})[_0xe4e4('0x12')](function(_0x20122d){throw _0x20122d;});}exports[_0xe4e4('0x13')]=function(_0x255722,_0x2785e9,_0x51fb25,_0x40d954){return new Promise(function(_0x46943f,_0x2de686){return getInteractionUsers(_0x255722['id'],_0x51fb25)[_0xe4e4('0x10')](function(_0xa9da8d){_0x255722[_0xe4e4('0x14')]=_0xa9da8d;return getInteractionTags(_0x255722[_0xe4e4('0x15')],_0x2785e9);})[_0xe4e4('0x10')](function(_0x45b019){_0x255722[_0xe4e4('0x16')]=_0x45b019;delete _0x255722[_0xe4e4('0x15')];return updateInteractionCounters(_0x255722);})[_0xe4e4('0x10')](function(_0x456f1f){if(_0x40d954){return getLastMessageText(_0x456f1f);}else{return _0x456f1f;}})[_0xe4e4('0x10')](function(_0x114e8e){_0x46943f(_0x114e8e);})['catch'](function(_0x1dfd46){_0x2de686(_0x1dfd46);});});}; \ No newline at end of file +var _0x1924=['unmanaged','abandoned','closed','disposition','answered','UserId','total','MailMessage','findOne','out','-id','then','plainBody','lastMsgText','trimStart','catch','updateInteraction','Tags','lodash','map','fullname','split','forEach','push','waiting','talking'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1924,0x94));var _0x4192=function(_0x2e9b11,_0xb9d74e){_0x2e9b11=_0x2e9b11-0x0;var _0x560f8f=_0x1924[_0x2e9b11];return _0x560f8f;};'use strict';var _=require(_0x4192('0x0'));var db=require('../../mysqldb')['db'];function getInteractionUsers(_0x4d55f9,_0x1a9133){return new Promise(function(_0x5e66d5,_0x3f11d4){try{var _0x36f72e=[];if(_0x1a9133[_0x4d55f9]){_0x36f72e=_0x1a9133[_0x4d55f9][_0x4192('0x1')](function(_0x5d1982){return{'id':_0x5d1982['id'],'fullname':_0x5d1982[_0x4192('0x2')]};});}return _0x5e66d5(_0x36f72e);}catch(_0x568ea8){_0x3f11d4(_0x568ea8);}});}function getInteractionTags(_0xb8a2f7,_0x1ace37){var _0x3bd2b1=[];if(_0xb8a2f7){_0xb8a2f7[_0x4192('0x3')](',')[_0x4192('0x4')](function(_0x362b14){_0x3bd2b1[_0x4192('0x5')](_0x1ace37[_0x362b14]);});}return _0x3bd2b1;}function updateWaitingCounter(_0x36f1df){if(_0x36f1df[_0x4192('0x6')]){_0x36f1df[_0x4192('0x6')]-=0x1;}}function updateInteractionCounters(_0xd2edc4){_0xd2edc4['waiting']=0x0;_0xd2edc4[_0x4192('0x7')]=0x0;_0xd2edc4['answered']=0x0;_0xd2edc4[_0x4192('0x8')]=0x0;_0xd2edc4[_0x4192('0x9')]=0x0;_0xd2edc4['total']=0x0;if(_0xd2edc4[_0x4192('0xa')]){if(_0xd2edc4[_0x4192('0xb')]===_0x4192('0x9')){_0xd2edc4[_0x4192('0x9')]+=0x1;updateWaitingCounter(_0xd2edc4);}if(_0xd2edc4['UserId']){_0xd2edc4[_0x4192('0xc')]+=0x1;if(_0xd2edc4[_0x4192('0x7')]){_0xd2edc4[_0x4192('0x7')]-=0x1;}}else{if(_0xd2edc4['disposition']){_0xd2edc4[_0x4192('0x8')]+=0x1;updateWaitingCounter(_0xd2edc4);}}}else{if(!_0xd2edc4[_0x4192('0xd')]){_0xd2edc4[_0x4192('0x6')]+=0x1;}if(_0xd2edc4[_0x4192('0xd')]){_0xd2edc4['talking']+=0x1;updateWaitingCounter(_0xd2edc4);}}_0xd2edc4[_0x4192('0xe')]+=0x1;return _0xd2edc4;}function getLastMessageText(_0x4193a2){return db[_0x4192('0xf')][_0x4192('0x10')]({'where':{'$and':[{'MailInteractionId':_0x4193a2['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x4192('0x11')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0x4192('0x12'),'raw':!![]})[_0x4192('0x13')](function(_0x419dfa){if(_0x419dfa&&_0x419dfa[_0x4192('0x14')]){_0x4193a2[_0x4192('0x15')]=_[_0x4192('0x16')](_0x419dfa['plainBody']);}return _0x4193a2;})[_0x4192('0x17')](function(_0x470537){throw _0x470537;});}exports[_0x4192('0x18')]=function(_0x2d4e14,_0x1a58d6,_0x3f4354,_0x21da6e){return new Promise(function(_0x809da6,_0x1eb373){return getInteractionUsers(_0x2d4e14['id'],_0x3f4354)[_0x4192('0x13')](function(_0x1f118c){_0x2d4e14['Users']=_0x1f118c;return getInteractionTags(_0x2d4e14['TagIds'],_0x1a58d6);})['then'](function(_0x1279ec){_0x2d4e14[_0x4192('0x19')]=_0x1279ec;delete _0x2d4e14['TagIds'];return updateInteractionCounters(_0x2d4e14);})[_0x4192('0x13')](function(_0x3dce3a){if(_0x21da6e){return getLastMessageText(_0x3dce3a);}else{return _0x3dce3a;}})[_0x4192('0x13')](function(_0x5a4b66){_0x809da6(_0x5a4b66);})[_0x4192('0x17')](function(_0x921033){_0x1eb373(_0x921033);});});}; \ No newline at end of file diff --git a/server/components/interaction/utils.js b/server/components/interaction/utils.js index 74d8f61..84a1712 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 _0x07f3=['stringify','null','Interaction','then','info','catch','exports','../../mysqldb','../../config/logger','mail-interactions','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','capitalize','chat','Website','Account','InteractionId','upperFirst','unknown','websites','accounts','_interaction_has_tags','_messages','user_has_','_interactions','isArray','toLowerCase','toUpperCase','role'];(function(_0xda0001,_0x5d3e28){var _0x3c1c06=function(_0x1afeb6){while(--_0x1afeb6){_0xda0001['push'](_0xda0001['shift']());}};_0x3c1c06(++_0x5d3e28);}(_0x07f3,0x13d));var _0x307f=function(_0x9edfd5,_0x286486){_0x9edfd5=_0x9edfd5-0x0;var _0x330738=_0x07f3[_0x9edfd5];return _0x330738;};'use strict';var _=require('lodash');var db=require(_0x307f('0x0'))['db'];var loggers={'openchannel':require(_0x307f('0x1'))('openchannel-interactions'),'mail':require(_0x307f('0x1'))(_0x307f('0x2')),'fax':require(_0x307f('0x1'))(_0x307f('0x3')),'sms':require('../../config/logger')(_0x307f('0x4')),'chat':require('../../config/logger')(_0x307f('0x5')),'whatsapp':require('../../config/logger')(_0x307f('0x6'))};function getAccountFK(_0x5954fb){return _[_0x307f('0x7')](_0x5954fb)+(_0x5954fb===_0x307f('0x8')?_0x307f('0x9'):_0x307f('0xa'))+'Id';}function getInteractionFK(_0x37826d){return _['capitalize'](_0x37826d)+_0x307f('0xb');}function getInteractionId(_0xc98d61,_0x2c3378,_0x2037a0){if(_0xc98d61&&_0xc98d61[_[_0x307f('0xc')](_0x2037a0)+_0x307f('0xb')]){return _0xc98d61[_[_0x307f('0xc')](_0x2037a0)+_0x307f('0xb')];}else if(_0xc98d61&&_0xc98d61['id']){return _0xc98d61['id'];}else if(_0x2c3378&&_0x2c3378['id']){return _0x2c3378['id'];}else{return _0x307f('0xd');}}function getInteractionsTables(_0x425684){return{'accounts':_0x425684+'_'+(_0x425684===_0x307f('0x8')?_0x307f('0xe'):_0x307f('0xf')),'interactions':_0x425684+'_interactions','interactionsTags':_0x425684+_0x307f('0x10'),'messages':_0x425684+_0x307f('0x11'),'userInteractions':_0x307f('0x12')+_0x425684+_0x307f('0x13')};}function getSelectedTags(_0x2dc2ee){var _0x46b1bd=[];if(_0x2dc2ee){_0x46b1bd=Array[_0x307f('0x14')](_0x2dc2ee)?_0x2dc2ee:[_0x2dc2ee];}return _0x46b1bd;}function log(_0x2bacbb,_0x28ce59,_0x566541,_0x2f4f0b,_0x341a00,_0x3b7082){loggers[_0x341a00[_0x307f('0x15')]()][_0x2bacbb]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3b7082[_0x307f('0x16')](),_0x28ce59?_0x28ce59['id']:null,_0x28ce59?_0x28ce59['name']:null,_0x28ce59?_0x28ce59[_0x307f('0x17')]:null,getInteractionId(_0x566541,_0x2f4f0b,_0x341a00),_0x566541?JSON[_0x307f('0x18')](_0x566541):_0x307f('0x19'));}function updateUser(_0x36d1a9,_0x5c7699,_0x465560,_0x57f385,_0x54c182){db[_[_0x307f('0xc')](_0x57f385)+_0x307f('0x1a')]['findOne']({'where':{'id':getInteractionId(_0x5c7699,_0x465560,_0x57f385)}})['then'](function(_0x25cc7e){if(_0x25cc7e){return _0x25cc7e['update']({'UserId':_0x36d1a9?_0x36d1a9['id']:null});}})[_0x307f('0x1b')](function(_0x4b0bee){if(_0x4b0bee){log(_0x307f('0x1c'),_0x36d1a9,_0x5c7699,_0x465560,_0x57f385,_0x54c182);}})[_0x307f('0x1d')](function(){log('error',_0x36d1a9,_0x5c7699,_0x465560,_0x57f385,_0x54c182);});}module[_0x307f('0x1e')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file +var _0x6952=['openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','chat-interactions','capitalize','chat','Website','Account','InteractionId','unknown','_interactions','_interaction_has_tags','user_has_','toUpperCase','name','role','stringify','null','upperFirst','findOne','update','then','catch','error','lodash','../../mysqldb','../../config/logger'];(function(_0x38e978,_0x387f65){var _0x3ce39c=function(_0x53a078){while(--_0x53a078){_0x38e978['push'](_0x38e978['shift']());}};_0x3ce39c(++_0x387f65);}(_0x6952,0xa5));var _0x2695=function(_0x379ede,_0x41cf30){_0x379ede=_0x379ede-0x0;var _0xea3c34=_0x6952[_0x379ede];return _0xea3c34;};'use strict';var _=require(_0x2695('0x0'));var db=require(_0x2695('0x1'))['db'];var loggers={'openchannel':require(_0x2695('0x2'))(_0x2695('0x3')),'mail':require(_0x2695('0x2'))(_0x2695('0x4')),'fax':require(_0x2695('0x2'))(_0x2695('0x5')),'sms':require(_0x2695('0x2'))(_0x2695('0x6')),'chat':require(_0x2695('0x2'))(_0x2695('0x7')),'whatsapp':require('../../config/logger')('whatsapp-interactions')};function getAccountFK(_0x720a79){return _[_0x2695('0x8')](_0x720a79)+(_0x720a79===_0x2695('0x9')?_0x2695('0xa'):_0x2695('0xb'))+'Id';}function getInteractionFK(_0x30f819){return _[_0x2695('0x8')](_0x30f819)+'InteractionId';}function getInteractionId(_0x311844,_0x27dc62,_0x487965){if(_0x311844&&_0x311844[_['upperFirst'](_0x487965)+_0x2695('0xc')]){return _0x311844[_['upperFirst'](_0x487965)+_0x2695('0xc')];}else if(_0x311844&&_0x311844['id']){return _0x311844['id'];}else if(_0x27dc62&&_0x27dc62['id']){return _0x27dc62['id'];}else{return _0x2695('0xd');}}function getInteractionsTables(_0x71ff4){return{'accounts':_0x71ff4+'_'+(_0x71ff4===_0x2695('0x9')?'websites':'accounts'),'interactions':_0x71ff4+_0x2695('0xe'),'interactionsTags':_0x71ff4+_0x2695('0xf'),'messages':_0x71ff4+'_messages','userInteractions':_0x2695('0x10')+_0x71ff4+_0x2695('0xe')};}function getSelectedTags(_0x3379cf){var _0x331c2b=[];if(_0x3379cf){_0x331c2b=Array['isArray'](_0x3379cf)?_0x3379cf:[_0x3379cf];}return _0x331c2b;}function log(_0x3b1203,_0x3c2061,_0x4e971f,_0x43f99d,_0x4b319b,_0x8024fd){loggers[_0x4b319b['toLowerCase']()][_0x3b1203]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x8024fd[_0x2695('0x11')](),_0x3c2061?_0x3c2061['id']:null,_0x3c2061?_0x3c2061[_0x2695('0x12')]:null,_0x3c2061?_0x3c2061[_0x2695('0x13')]:null,getInteractionId(_0x4e971f,_0x43f99d,_0x4b319b),_0x4e971f?JSON[_0x2695('0x14')](_0x4e971f):_0x2695('0x15'));}function updateUser(_0x518250,_0x248691,_0x1a0c78,_0x262e1c,_0x30244d){db[_[_0x2695('0x16')](_0x262e1c)+'Interaction'][_0x2695('0x17')]({'where':{'id':getInteractionId(_0x248691,_0x1a0c78,_0x262e1c)}})['then'](function(_0x457a60){if(_0x457a60){return _0x457a60[_0x2695('0x18')]({'UserId':_0x518250?_0x518250['id']:null});}})[_0x2695('0x19')](function(_0x1a201d){if(_0x1a201d){log('info',_0x518250,_0x248691,_0x1a0c78,_0x262e1c,_0x30244d);}})[_0x2695('0x1a')](function(){log(_0x2695('0x1b'),_0x518250,_0x248691,_0x1a0c78,_0x262e1c,_0x30244d);});}module['exports']={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 9b1ad48..1058f6a 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 _0x0000=['data1','license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','utf8','final','parse','hasOwnProperty','use','License','findOne','then','count','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','users','User','admin','user','isUserLimit','crypto','util','../../mysqldb','../../config/environment'];(function(_0x38cb95,_0x344f72){var _0x37334a=function(_0x140489){while(--_0x140489){_0x38cb95['push'](_0x38cb95['shift']());}};_0x37334a(++_0x344f72);}(_0x0000,0x130));var _0x0000=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0000[_0x14add3];return _0x4a174f;};'use strict';var crypto=require(_0x0000('0x0'));var util=require(_0x0000('0x1'));var compose=require('composable-middleware');var db=require(_0x0000('0x2'))['db'];var config=require(_0x0000('0x3'));function getValueFromLicense(_0x176bbb,_0x4afbc0){if(_0x176bbb&&_0x4afbc0){if(_0x4afbc0[_0x0000('0x4')]&&_0x4afbc0['license']){var _0x5d48c4=_0x4afbc0[_0x0000('0x4')];var _0x498b0e=_0x4afbc0[_0x0000('0x5')];var _0x143f32=_0x5d48c4[_0x0000('0x6')]('-')[0x4];var _0x30c818=_0x5d48c4[_0x0000('0x6')]('-')[0x0];var _0x5833e6=crypto[_0x0000('0x7')](_0x0000('0x8'),util[_0x0000('0x9')](_0x0000('0xa'),_0x143f32,_0x5d48c4,_0x30c818));var _0x4f707e=_0x5833e6[_0x0000('0xb')](_0x498b0e,'base64',_0x0000('0xc'));_0x4f707e+=_0x5833e6[_0x0000('0xd')](_0x0000('0xc'));var _0x2e6c17=JSON[_0x0000('0xe')](_0x4f707e);return _0x2e6c17[_0x0000('0xf')](_0x176bbb)?_0x2e6c17[_0x176bbb]:null;}}return null;}function isLimit(_0x39b006,_0x139656,_0x5d29ac,_0x1512f7){var _0x411454=_0x139656;return compose()[_0x0000('0x10')](function(_0x305255,_0x469d2f,_0x1ea0f7){return db[_0x0000('0x11')][_0x0000('0x12')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x1312f8){var _0x58c3b8=getValueFromLicense(_0x39b006,_0x1312f8);return _0x58c3b8?_0x58c3b8:_0x411454;})[_0x0000('0x13')](function(_0x4074b1){_0x411454=_0x4074b1;return _0x5d29ac[_0x0000('0x14')](_0x1512f7);})[_0x0000('0x13')](function(_0x27a2df){if(_0x27a2df>=_0x411454){return _0x469d2f['status'](0x193)[_0x0000('0x15')]({'message':util[_0x0000('0x9')](_0x0000('0x16'),_0x39b006)});}_0x1ea0f7();})['catch'](function(_0x11f87e){_0x1ea0f7(_0x11f87e);});});}function isUserLimit(){return isLimit(_0x0000('0x17'),0x1,db[_0x0000('0x18')],{'where':{'$or':[{'role':_0x0000('0x19')},{'role':_0x0000('0x1a')}]}});}exports[_0x0000('0x1b')]=isUserLimit; \ No newline at end of file +var _0xe754=['then','count','status','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','User','admin','user','isUserLimit','util','composable-middleware','../../mysqldb','../../config/environment','license','split','createDecipher','aes-256-ctr','format','update','base64','utf8','final','parse','hasOwnProperty','License','findOne'];(function(_0x527f33,_0x12b632){var _0x2bdabd=function(_0x410d55){while(--_0x410d55){_0x527f33['push'](_0x527f33['shift']());}};_0x2bdabd(++_0x12b632);}(_0xe754,0x127));var _0x4e75=function(_0x1ab28d,_0x4f5cfd){_0x1ab28d=_0x1ab28d-0x0;var _0x4c116c=_0xe754[_0x1ab28d];return _0x4c116c;};'use strict';var crypto=require('crypto');var util=require(_0x4e75('0x0'));var compose=require(_0x4e75('0x1'));var db=require(_0x4e75('0x2'))['db'];var config=require(_0x4e75('0x3'));function getValueFromLicense(_0x54e34a,_0x120714){if(_0x54e34a&&_0x120714){if(_0x120714['data1']&&_0x120714['license']){var _0x4f6f5c=_0x120714['data1'];var _0x208b6b=_0x120714[_0x4e75('0x4')];var _0x172492=_0x4f6f5c[_0x4e75('0x5')]('-')[0x4];var _0x4a3e95=_0x4f6f5c[_0x4e75('0x5')]('-')[0x0];var _0x4a2f8f=crypto[_0x4e75('0x6')](_0x4e75('0x7'),util[_0x4e75('0x8')]('%s:%s:%s',_0x172492,_0x4f6f5c,_0x4a3e95));var _0x3a3beb=_0x4a2f8f[_0x4e75('0x9')](_0x208b6b,_0x4e75('0xa'),_0x4e75('0xb'));_0x3a3beb+=_0x4a2f8f[_0x4e75('0xc')](_0x4e75('0xb'));var _0x1e5afc=JSON[_0x4e75('0xd')](_0x3a3beb);return _0x1e5afc[_0x4e75('0xe')](_0x54e34a)?_0x1e5afc[_0x54e34a]:null;}}return null;}function isLimit(_0x2fa49f,_0x3b2cac,_0x3465b4,_0xc5860a){var _0x2df819=_0x3b2cac;return compose()['use'](function(_0x2411d5,_0x1abe3d,_0x20e439){return db[_0x4e75('0xf')][_0x4e75('0x10')]({'where':{'id':0x1},'raw':!![]})[_0x4e75('0x11')](function(_0x4d7827){var _0x3070aa=getValueFromLicense(_0x2fa49f,_0x4d7827);return _0x3070aa?_0x3070aa:_0x2df819;})[_0x4e75('0x11')](function(_0x5a3733){_0x2df819=_0x5a3733;return _0x3465b4[_0x4e75('0x12')](_0xc5860a);})['then'](function(_0x4bb235){if(_0x4bb235>=_0x2df819){return _0x1abe3d[_0x4e75('0x13')](0x193)['json']({'message':util[_0x4e75('0x8')](_0x4e75('0x14'),_0x2fa49f)});}_0x20e439();})[_0x4e75('0x15')](function(_0x1ce0e2){_0x20e439(_0x1ce0e2);});});}function isUserLimit(){return isLimit('users',0x1,db[_0x4e75('0x16')],{'where':{'$or':[{'role':_0x4e75('0x17')},{'role':_0x4e75('0x18')}]}});}exports[_0x4e75('0x19')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index d73e4c6..e666743 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 _0x2e93=['$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','$in','start','$endsWith','pop','DATE','utcOffset','format','lodash','moment','parseSearch','sqlOperator','startsWith','and','replace','split','length','forEach','shift','match','filter','map','conditions','push','$eq','operator','$between','value','add','days','YYYY-MM-DD','castTo','CAST(','\x20AS\x20','field','includes','$ne','$notIn','text','\x20OR\x20','IN\x20?','=\x20?','<>\x20?','$substring','$startsWith','LIKE\x20?','$lt','<\x20?','$gt','$lte','<=\x20?'];(function(_0x159d63,_0x26bc7d){var _0x5804ac=function(_0x9d4dda){while(--_0x9d4dda){_0x159d63['push'](_0x159d63['shift']());}};_0x5804ac(++_0x26bc7d);}(_0x2e93,0x17d));var _0x32e9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2e93[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x32e9('0x0'));var moment=require(_0x32e9('0x1'));exports[_0x32e9('0x2')]=function(_0x85eac8){var _0x48648b={'conditions':[]};_0x48648b[_0x32e9('0x3')]=_[_0x32e9('0x4')](_0x85eac8,'[$or]')?'or':_0x32e9('0x5');var _0x35def6=_0x85eac8[_0x32e9('0x6')]('[$and]','')[_0x32e9('0x6')]('[$or]','')[_0x32e9('0x7')]('||');for(var _0x3b87e8=0x0;_0x3b87e8<_0x35def6[_0x32e9('0x8')];_0x3b87e8++){var _0x382cea=_0x35def6[_0x3b87e8]['split'](':=');var _0x50c351=_0x382cea[0x0];var _0x532ceb=_0x382cea['slice'](0x1);_0x532ceb[_0x32e9('0x9')](function(_0x378171){var _0x226635=_0x378171[_0x32e9('0x7')]('[')[_0x32e9('0xa')]();var _0x12c3f4=_0x378171[_0x32e9('0xb')](/\[(.*?)\]/g);_0x12c3f4[_0x32e9('0x9')](function(_0x25e57e){var _0x5141d3=_0x25e57e[_0x32e9('0x7')]('[')[_0x32e9('0xc')](function(_0x35d472){return _0x35d472['indexOf'](']')>-0x1;})[_0x32e9('0xd')](function(_0x4e25b9){return _0x4e25b9['split'](']')[0x0];})[0x0];_0x48648b[_0x32e9('0xe')][_0x32e9('0xf')]({'field':_0x50c351,'operator':_0x226635,'value':_0x5141d3});});});}return _0x48648b;};exports['buildExpression']=function(_0x9b20dd,_0x2c3fea,_0x459248){var _0x446ed3={};if(_0x2c3fea==='DATE'){if(_0x459248['operator']===_0x32e9('0x10')){_0x459248[_0x32e9('0x11')]=_0x32e9('0x12');_0x459248[_0x32e9('0x13')]+=','+_0x459248[_0x32e9('0x13')];}else if(_['includes'](['$gt','$lte'],_0x459248[_0x32e9('0x11')])){_0x459248['value']=moment(_0x459248[_0x32e9('0x13')])[_0x32e9('0x14')](0x1,_0x32e9('0x15'))['format'](_0x32e9('0x16'));}}if(_0x459248[_0x32e9('0x17')]){_0x2c3fea=_0x459248['castTo'];_0x446ed3['text']=_0x32e9('0x18')+_0x9b20dd+'.'+_0x459248['field']+_0x32e9('0x19')+_0x459248['castTo']+')\x20'+parseOperator(_0x459248[_0x32e9('0x11')]);}else{_0x446ed3['text']=_0x9b20dd+'.'+_0x459248[_0x32e9('0x1a')]+'\x20'+parseOperator(_0x459248['operator']);}if(_[_0x32e9('0x1b')]([_0x32e9('0x1c'),_0x32e9('0x1d')],_0x459248[_0x32e9('0x11')]))_0x446ed3[_0x32e9('0x1e')]='('+_0x446ed3[_0x32e9('0x1e')]+_0x32e9('0x1f')+_0x9b20dd+'.'+_0x459248[_0x32e9('0x1a')]+'\x20IS\x20NULL)';_0x446ed3[_0x32e9('0x13')]=parseValue(_0x2c3fea,_0x459248[_0x32e9('0x11')],_0x459248['value']);return _0x446ed3;};function parseOperator(_0x5af9da){var _0xb8b66c;switch(_0x5af9da){case'$in':_0xb8b66c=_0x32e9('0x20');break;case _0x32e9('0x1d'):_0xb8b66c='NOT\x20IN\x20?';break;case'$eq':_0xb8b66c=_0x32e9('0x21');break;case'$ne':_0xb8b66c=_0x32e9('0x22');break;case _0x32e9('0x23'):case _0x32e9('0x24'):case'$endsWith':_0xb8b66c=_0x32e9('0x25');break;case _0x32e9('0x26'):_0xb8b66c=_0x32e9('0x27');break;case _0x32e9('0x28'):_0xb8b66c='>\x20?';break;case _0x32e9('0x29'):_0xb8b66c=_0x32e9('0x2a');break;case _0x32e9('0x2b'):_0xb8b66c=_0x32e9('0x2c');break;case _0x32e9('0x12'):_0xb8b66c=_0x32e9('0x2d');break;}return _0xb8b66c;}function parseValue(_0x29dcdf,_0x58bb96,_0x3fdeb3){var _0x55d458={'start':undefined,'end':undefined};switch(_0x58bb96){case _0x32e9('0x2e'):case _0x32e9('0x1d'):_0x55d458[_0x32e9('0x2f')]=_0x3fdeb3['split'](',');break;case _0x32e9('0x23'):_0x55d458['start']='%'+_0x3fdeb3+'%';break;case _0x32e9('0x24'):_0x55d458[_0x32e9('0x2f')]=_0x3fdeb3+'%';break;case _0x32e9('0x30'):_0x55d458[_0x32e9('0x2f')]='%'+_0x3fdeb3;break;case'$between':var _0x5aebe2=_0x3fdeb3['split'](',');var _0x3fdeb3=_0x5aebe2[_0x32e9('0xa')]();var _0x1fa025=_0x5aebe2[_0x32e9('0x31')]();if(_0x29dcdf===_0x32e9('0x32')){_0x3fdeb3=moment(_0x3fdeb3)[_0x32e9('0x33')](0x0,!![])[_0x32e9('0x34')]();_0x1fa025=moment(_0x1fa025)[_0x32e9('0x33')](0x0,!![])[_0x32e9('0x14')](0x17,'hours')[_0x32e9('0x14')](0x3b,'minutes')['add'](0x3b,'seconds')[_0x32e9('0x34')]();}_0x55d458={'start':_0x3fdeb3,'end':_0x1fa025};break;default:_0x55d458[_0x32e9('0x2f')]=_0x3fdeb3;break;}return _0x55d458;} \ No newline at end of file +var _0xe3f8=['utcOffset','hours','add','minutes','lodash','parseSearch','sqlOperator','startsWith','and','replace','[$and]','[$or]','split','length','slice','forEach','shift','match','indexOf','map','conditions','push','operator','$eq','value','includes','$gt','$lte','format','castTo','text','field','\x20AS\x20','\x20OR\x20','$in','=\x20?','$ne','<>\x20?','$substring','<\x20?','>\x20?','$gte','>=\x20?','$between','BETWEEN\x20?\x20AND\x20?','$notIn','start','$startsWith','$endsWith','pop','DATE'];(function(_0x4506fe,_0x128efd){var _0x2d9455=function(_0x25d559){while(--_0x25d559){_0x4506fe['push'](_0x4506fe['shift']());}};_0x2d9455(++_0x128efd);}(_0xe3f8,0x6a));var _0x8e3f=function(_0x5bc512,_0x20c7a7){_0x5bc512=_0x5bc512-0x0;var _0x10b611=_0xe3f8[_0x5bc512];return _0x10b611;};'use strict';var _=require(_0x8e3f('0x0'));var moment=require('moment');exports[_0x8e3f('0x1')]=function(_0x2fde00){var _0x2de238={'conditions':[]};_0x2de238[_0x8e3f('0x2')]=_[_0x8e3f('0x3')](_0x2fde00,'[$or]')?'or':_0x8e3f('0x4');var _0x5e73d2=_0x2fde00[_0x8e3f('0x5')](_0x8e3f('0x6'),'')[_0x8e3f('0x5')](_0x8e3f('0x7'),'')[_0x8e3f('0x8')]('||');for(var _0x5b9dde=0x0;_0x5b9dde<_0x5e73d2[_0x8e3f('0x9')];_0x5b9dde++){var _0x445416=_0x5e73d2[_0x5b9dde][_0x8e3f('0x8')](':=');var _0x50f459=_0x445416[0x0];var _0x16487a=_0x445416[_0x8e3f('0xa')](0x1);_0x16487a[_0x8e3f('0xb')](function(_0x2987db){var _0x365e7a=_0x2987db['split']('[')[_0x8e3f('0xc')]();var _0x483c1f=_0x2987db[_0x8e3f('0xd')](/\[(.*?)\]/g);_0x483c1f['forEach'](function(_0x1ca2a1){var _0x17ef96=_0x1ca2a1[_0x8e3f('0x8')]('[')['filter'](function(_0x1f2e1e){return _0x1f2e1e[_0x8e3f('0xe')](']')>-0x1;})[_0x8e3f('0xf')](function(_0x578f23){return _0x578f23['split'](']')[0x0];})[0x0];_0x2de238[_0x8e3f('0x10')][_0x8e3f('0x11')]({'field':_0x50f459,'operator':_0x365e7a,'value':_0x17ef96});});});}return _0x2de238;};exports['buildExpression']=function(_0x2ed00d,_0x377f12,_0x192378){var _0x1d0d31={};if(_0x377f12==='DATE'){if(_0x192378[_0x8e3f('0x12')]===_0x8e3f('0x13')){_0x192378[_0x8e3f('0x12')]='$between';_0x192378[_0x8e3f('0x14')]+=','+_0x192378[_0x8e3f('0x14')];}else if(_[_0x8e3f('0x15')]([_0x8e3f('0x16'),_0x8e3f('0x17')],_0x192378[_0x8e3f('0x12')])){_0x192378[_0x8e3f('0x14')]=moment(_0x192378['value'])['add'](0x1,'days')[_0x8e3f('0x18')]('YYYY-MM-DD');}}if(_0x192378[_0x8e3f('0x19')]){_0x377f12=_0x192378[_0x8e3f('0x19')];_0x1d0d31[_0x8e3f('0x1a')]='CAST('+_0x2ed00d+'.'+_0x192378[_0x8e3f('0x1b')]+_0x8e3f('0x1c')+_0x192378[_0x8e3f('0x19')]+')\x20'+parseOperator(_0x192378[_0x8e3f('0x12')]);}else{_0x1d0d31[_0x8e3f('0x1a')]=_0x2ed00d+'.'+_0x192378[_0x8e3f('0x1b')]+'\x20'+parseOperator(_0x192378['operator']);}if(_['includes'](['$ne','$notIn'],_0x192378[_0x8e3f('0x12')]))_0x1d0d31[_0x8e3f('0x1a')]='('+_0x1d0d31[_0x8e3f('0x1a')]+_0x8e3f('0x1d')+_0x2ed00d+'.'+_0x192378['field']+'\x20IS\x20NULL)';_0x1d0d31['value']=parseValue(_0x377f12,_0x192378[_0x8e3f('0x12')],_0x192378[_0x8e3f('0x14')]);return _0x1d0d31;};function parseOperator(_0x31b7e5){var _0xeb5f64;switch(_0x31b7e5){case _0x8e3f('0x1e'):_0xeb5f64='IN\x20?';break;case'$notIn':_0xeb5f64='NOT\x20IN\x20?';break;case _0x8e3f('0x13'):_0xeb5f64=_0x8e3f('0x1f');break;case _0x8e3f('0x20'):_0xeb5f64=_0x8e3f('0x21');break;case _0x8e3f('0x22'):case'$startsWith':case'$endsWith':_0xeb5f64='LIKE\x20?';break;case'$lt':_0xeb5f64=_0x8e3f('0x23');break;case'$gt':_0xeb5f64=_0x8e3f('0x24');break;case _0x8e3f('0x17'):_0xeb5f64='<=\x20?';break;case _0x8e3f('0x25'):_0xeb5f64=_0x8e3f('0x26');break;case _0x8e3f('0x27'):_0xeb5f64=_0x8e3f('0x28');break;}return _0xeb5f64;}function parseValue(_0x11c6c2,_0x340936,_0x51ebc0){var _0x3f4d2b={'start':undefined,'end':undefined};switch(_0x340936){case _0x8e3f('0x1e'):case _0x8e3f('0x29'):_0x3f4d2b[_0x8e3f('0x2a')]=_0x51ebc0['split'](',');break;case _0x8e3f('0x22'):_0x3f4d2b[_0x8e3f('0x2a')]='%'+_0x51ebc0+'%';break;case _0x8e3f('0x2b'):_0x3f4d2b[_0x8e3f('0x2a')]=_0x51ebc0+'%';break;case _0x8e3f('0x2c'):_0x3f4d2b[_0x8e3f('0x2a')]='%'+_0x51ebc0;break;case'$between':var _0x59520f=_0x51ebc0[_0x8e3f('0x8')](',');var _0x51ebc0=_0x59520f[_0x8e3f('0xc')]();var _0x4e77ad=_0x59520f[_0x8e3f('0x2d')]();if(_0x11c6c2===_0x8e3f('0x2e')){_0x51ebc0=moment(_0x51ebc0)[_0x8e3f('0x2f')](0x0,!![])['format']();_0x4e77ad=moment(_0x4e77ad)[_0x8e3f('0x2f')](0x0,!![])['add'](0x17,_0x8e3f('0x30'))[_0x8e3f('0x31')](0x3b,_0x8e3f('0x32'))[_0x8e3f('0x31')](0x3b,'seconds')['format']();}_0x3f4d2b={'start':_0x51ebc0,'end':_0x4e77ad};break;default:_0x3f4d2b['start']=_0x51ebc0;break;}return _0x3f4d2b;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index a7c0379..51f6189 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 _0xb99c=['col','unsigned','DESC','ASC','omit','isObject','unset','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue','\x22{EXPR}\x22','{EXPR}','replace','push','join','getOptions','query','$id','name','intersection','attributes','length','nolimit','where','filters','filter','object','value','VIRTUAL','lower','options','include','includeAll','lodash','sequelize','../../mysqldb','parse','keys','includes','model','alias','fields','raw','isEmpty','find','type','DATE','isPlainObject','$gte','format','YYYY-MM-DD','utc','$lte','uniqueid','isArray','limit','offset','sort','split','map','indexOf','priority','cast'];(function(_0x5e6ea3,_0x9addd2){var _0x4048b5=function(_0x9092e4){while(--_0x9092e4){_0x5e6ea3['push'](_0x5e6ea3['shift']());}};_0x4048b5(++_0x9addd2);}(_0xb99c,0x1a9));var _0xcb99=function(_0x465dba,_0x431923){_0x465dba=_0x465dba-0x0;var _0x70aeb3=_0xb99c[_0x465dba];return _0x70aeb3;};'use strict';var _=require(_0xcb99('0x0'));var sequelize=require(_0xcb99('0x1'));var moment=require('moment');var db=require(_0xcb99('0x2'))['db'];var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x5c2b2b){var _0x2f5bf5=['ne'];try{var _0x36073a=JSON[_0xcb99('0x3')](_0x5c2b2b);var _0x296fbf=Object[_0xcb99('0x4')](_0x36073a)[0x0];return _0x2f5bf5[_0xcb99('0x5')](_0x296fbf);}catch(_0x90061c){return![];}}function getOperatorValue(_0xd995f2){var _0x51d16f=JSON[_0xcb99('0x3')](_0xd995f2);var _0x25ccca=Object[_0xcb99('0x4')](_0x51d16f)[0x0];var _0x34241d=_0x51d16f[_0x25ccca];return{['$'+_0x25ccca]:_0x34241d};}function parseIncludeModel(_0x5359ba){var _0x18ceca=JSON[_0xcb99('0x3')](_0x5359ba);return{'model':db[_0x18ceca[_0xcb99('0x6')]],'as':_0x18ceca[_0xcb99('0x7')],'attributes':_0x18ceca[_0xcb99('0x8')],'raw':_0x18ceca[_0xcb99('0x9')]};}exports[_0xcb99('0x8')]=function(_0x589601){var _0x32bef0=null;if(_0x589601){_0x32bef0=_0x589601['split'](',');}return _0x32bef0;};exports['filters']=function(_0x25b639,_0x22118){var _0x447e74={};if(!_[_0xcb99('0xa')](_0x25b639)){_['forOwn'](_0x25b639,function(_0x128a56,_0x256584){try{if(_0x22118){var _0x4670cb=_[_0xcb99('0xb')](_0x22118,{'name':_0x256584})||{};if(hasSequelizeOperator(_0x128a56)){_0x447e74[_0x256584]=getOperatorValue(_0x128a56);}else if(_0x4670cb[_0xcb99('0xc')]===_0xcb99('0xd')&&_[_0xcb99('0xe')](_0x128a56)){var _0x14a060=JSON[_0xcb99('0x3')](_0x128a56);var _0x10fb98={'$gte':moment(moment(_0x14a060[_0xcb99('0xf')])[_0xcb99('0x10')](_0xcb99('0x11')))[_0xcb99('0x12')]()[_0xcb99('0x10')](),'$lte':moment(moment(_0x14a060[_0xcb99('0x13')])[_0xcb99('0x10')](_0xcb99('0x11')))['utc']()['subtract'](0x1,'s')[_0xcb99('0x10')]()};_0x447e74[_0x256584]=_0x10fb98;}else if(_0x4670cb['name']===_0xcb99('0x14')){_0x447e74[_0x256584]=_0x128a56;}else{_0x447e74[_0x256584]=_[_0xcb99('0x15')](_0x128a56)?_0x128a56:JSON['parse'](_0x128a56);}}else{_0x447e74[_0x256584]=_[_0xcb99('0x15')](_0x128a56)?_0x128a56:JSON[_0xcb99('0x3')](_0x128a56);}}catch(_0x1fa6ee){_0x447e74[_0x256584]=_0x128a56['split'](',');}});}return _0x447e74;};exports[_0xcb99('0x16')]=function(_0x58dd92){_0x58dd92=parseInt(_0x58dd92,0xa);if(!_0x58dd92||_0x58dd92<0x0){_0x58dd92=LIMIT_VALUE;}return _0x58dd92;};exports[_0xcb99('0x17')]=function(_0x307eca){_0x307eca=parseInt(_0x307eca,0xa);if(!_0x307eca||_0x307eca<0x0){_0x307eca=0x0;}return _0x307eca;};exports[_0xcb99('0x18')]=function(_0x1b0d64){var _0x343308,_0x22b66c=null;if(_0x1b0d64){_0x343308=_0x1b0d64[_0xcb99('0x19')](',');_0x22b66c=_[_0xcb99('0x1a')](_0x343308,function(_0x5311f5){if(_0x5311f5[_0xcb99('0x1b')]('-')===0x0){return[_0x5311f5===_0xcb99('0x1c')?sequelize[_0xcb99('0x1d')](sequelize[_0xcb99('0x1e')](_0xcb99('0x1c')),_0xcb99('0x1f')):_0x5311f5['substr'](0x1),_0xcb99('0x20')];}else{return[_0x5311f5===_0xcb99('0x1c')?sequelize[_0xcb99('0x1d')](sequelize[_0xcb99('0x1e')]('priority'),_0xcb99('0x1f')):_0x5311f5,_0xcb99('0x21')];}});}return _0x22b66c;};exports[_0xcb99('0x22')]=function(_0x42973b,_0x38e12c){if(_[_0xcb99('0xa')](_0x42973b)){return _0x42973b;}if(_[_0xcb99('0x15')](_0x42973b)){for(var _0x4f903c=0x0;_0x4f903c<_0x42973b['length'];_0x4f903c+=0x1){_0x42973b[_0x4f903c]=this[_0xcb99('0x22')](_0x42973b[_0x4f903c],_0x38e12c);}return _0x42973b;}if(!_[_0xcb99('0x23')](_0x42973b)){return _0x42973b;}if(_['isString'](_0x38e12c)){_0x38e12c=[_0x38e12c];}if(!_['isArray'](_0x38e12c)){return _0x42973b;}for(var _0x503ae9=0x0;_0x503ae9<_0x38e12c['length'];_0x503ae9+=0x1){_[_0xcb99('0x24')](_0x42973b,_0x38e12c[_0x503ae9]);}for(var _0x5cb09e in _0x42973b){if(_0x42973b['hasOwnProperty'](_0x5cb09e)){_0x42973b[_0x5cb09e]=this[_0xcb99('0x22')](_0x42973b[_0x5cb09e],_0x38e12c);}}return _0x42973b;};exports[_0xcb99('0x25')]=function(_0x5d0cfa){return _0x5d0cfa[_0xcb99('0x26')](RegExp(_0xcb99('0x27')))?!![]:![];};exports[_0xcb99('0x28')]=function(_0x35b483){return _0x35b483['match'](/^\S+@\S+$/)?!![]:![];};exports[_0xcb99('0x29')]=function(_0x308505,_0x40a504){var _0xc7fba8=[];var _0x4afabf=/[ `!@#$%^&*()_\-?~]/;var _0xdc033b=_0x40a504?_0xcb99('0x2a'):_0xcb99('0x2b');_0x308505['split'](/[ ,]+/)['forEach'](function(_0x2d572c){_0x2d572c=_0x2d572c[_0xcb99('0x2c')](/([^:]")"+/g,'$1');_0x2d572c='+'+_0x2d572c+'*';var _0x137e6a=_0x2d572c[_0xcb99('0x26')](_0x4afabf);if(_0x137e6a){_0x2d572c='\x22'+_0x2d572c+'\x22';}_0xc7fba8[_0xcb99('0x2d')](_0x2d572c);});_0xdc033b=_0xdc033b[_0xcb99('0x2c')](_0xcb99('0x2b'),_0xc7fba8[_0xcb99('0x2e')]('\x20'));return _0xdc033b;};exports[_0xcb99('0x2f')]=function(_0xf7a5f1,_0x5cf4fd,_0x50f4a4){var _0x4eed23={},_0x5d2803={};if(_0x5cf4fd['query']['$id']){_0x5cf4fd[_0xcb99('0x30')]['id']=_0x5cf4fd[_0xcb99('0x30')][_0xcb99('0x31')];delete _0x5cf4fd[_0xcb99('0x30')][_0xcb99('0x31')];}_0x4eed23[_0xcb99('0x6')]=_['map'](_0xf7a5f1,_0xcb99('0x32'));_0x4eed23[_0xcb99('0x30')]=_[_0xcb99('0x4')](_0x5cf4fd['query']);_0x4eed23['filters']=_[_0xcb99('0x33')](_0x4eed23[_0xcb99('0x6')],_0x4eed23['query']);_0x5d2803[_0xcb99('0x34')]=_[_0xcb99('0x33')](_0x4eed23['model'],this['fields'](_0x5cf4fd[_0xcb99('0x30')][_0xcb99('0x8')]));_0x5d2803[_0xcb99('0x34')]=_0x5d2803[_0xcb99('0x34')][_0xcb99('0x35')]?_0x5d2803['attributes']:_0x4eed23[_0xcb99('0x6')];if(!_0x5cf4fd[_0xcb99('0x30')]['hasOwnProperty'](_0xcb99('0x36'))){_0x5d2803[_0xcb99('0x16')]=this[_0xcb99('0x16')](_0x5cf4fd['query'][_0xcb99('0x16')]);_0x5d2803['offset']=this[_0xcb99('0x17')](_0x5cf4fd[_0xcb99('0x30')]['offset']);}_0x5d2803['order']=this['sort'](_0x5cf4fd[_0xcb99('0x30')][_0xcb99('0x18')]);_0x5d2803[_0xcb99('0x37')]=this[_0xcb99('0x38')](_['pick'](_0x5cf4fd[_0xcb99('0x30')],_0x4eed23[_0xcb99('0x38')]),_0xf7a5f1);if(_0x5cf4fd['query'][_0xcb99('0x39')]){var _0x52c7a8=_0xf7a5f1;var _0x5c4608=_0x5cf4fd['query'][_0xcb99('0x39')];if(typeof _0x5c4608===_0xcb99('0x3a')){_0x52c7a8=_['filter'](_0xf7a5f1,function(_0xe0212){return _[_0xcb99('0x5')](_0x5c4608['columns'],_0xe0212[_0xcb99('0x32')]);});_0x5c4608=_0x5c4608[_0xcb99('0x3b')];}_0x5d2803['where']=_['merge'](_0x5d2803['where'],{'$or':_[_0xcb99('0x1a')](_0x52c7a8,function(_0x40588c){if(_0x40588c['type']!==_0xcb99('0x3c')){if(_0x50f4a4){return sequelize[_0xcb99('0x37')](sequelize['fn'](_0xcb99('0x3d'),sequelize[_0xcb99('0x1e')](_0x40588c[_0xcb99('0x32')])),{'$like':sequelize['fn'](_0xcb99('0x3d'),'%'+_0x5cf4fd[_0xcb99('0x30')]['filter']+'%')});}else{var _0x11dac8={};_0x11dac8[_0x40588c['name']]={'$like':'%'+_0x5cf4fd[_0xcb99('0x30')][_0xcb99('0x39')]+'%'};return _0x11dac8;}}})});}_0x5d2803=_['merge']({},_0x5d2803,_0x5cf4fd[_0xcb99('0x3e')]);return _0x5d2803;};exports[_0xcb99('0x3f')]=function(_0x13250d){var _0x20248e=[];if(_0x13250d[_0xcb99('0x40')]){_0x20248e[_0xcb99('0x2d')]({'all':!![]});}else if(_0x13250d[_0xcb99('0x3f')]){if(Array['isArray'](_0x13250d['include'])){_0x20248e=Object['keys'](_0x13250d['include'])[_0xcb99('0x1a')](function(_0x32734a){return parseIncludeModel(_0x13250d['include'][_0x32734a]);});}else{var _0x1d4bb6=parseIncludeModel(_0x13250d[_0xcb99('0x3f')]);_0x20248e[_0xcb99('0x2d')](_0x1d4bb6);}}return _0x20248e;}; \ No newline at end of file +var _0x7b27=['$gte','format','$lte','YYYY-MM-DD','utc','subtract','uniqueid','isArray','offset','sort','indexOf','priority','cast','col','unsigned','substr','ASC','omit','length','isObject','isString','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','isEmail','forEach','replace','{EXPR}','join','getOptions','query','$id','intersection','attributes','limit','order','pick','filter','object','name','where','merge','lower','options','include','includeAll','push','map','lodash','moment','../../mysqldb','parse','includes','keys','model','alias','fields','raw','split','filters','isEmpty','forOwn','find','type','DATE','isPlainObject'];(function(_0x595e6c,_0x5ca9e6){var _0x3eeea3=function(_0x4b3634){while(--_0x4b3634){_0x595e6c['push'](_0x595e6c['shift']());}};_0x3eeea3(++_0x5ca9e6);}(_0x7b27,0x186));var _0x77b2=function(_0x3f31e2,_0x2dd0ee){_0x3f31e2=_0x3f31e2-0x0;var _0x294fd1=_0x7b27[_0x3f31e2];return _0x294fd1;};'use strict';var _=require(_0x77b2('0x0'));var sequelize=require('sequelize');var moment=require(_0x77b2('0x1'));var db=require(_0x77b2('0x2'))['db'];var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x4000dd){var _0x2f5a3a=['ne'];try{var _0x511dfe=JSON[_0x77b2('0x3')](_0x4000dd);var _0x47075b=Object['keys'](_0x511dfe)[0x0];return _0x2f5a3a[_0x77b2('0x4')](_0x47075b);}catch(_0x26538a){return![];}}function getOperatorValue(_0x243b61){var _0x569bce=JSON[_0x77b2('0x3')](_0x243b61);var _0x2a97d8=Object[_0x77b2('0x5')](_0x569bce)[0x0];var _0x1308f7=_0x569bce[_0x2a97d8];return{['$'+_0x2a97d8]:_0x1308f7};}function parseIncludeModel(_0x5139eb){var _0x13c0bc=JSON[_0x77b2('0x3')](_0x5139eb);return{'model':db[_0x13c0bc[_0x77b2('0x6')]],'as':_0x13c0bc[_0x77b2('0x7')],'attributes':_0x13c0bc[_0x77b2('0x8')],'raw':_0x13c0bc[_0x77b2('0x9')]};}exports[_0x77b2('0x8')]=function(_0x2dc1db){var _0x5ddcf6=null;if(_0x2dc1db){_0x5ddcf6=_0x2dc1db[_0x77b2('0xa')](',');}return _0x5ddcf6;};exports[_0x77b2('0xb')]=function(_0x51d4ea,_0xfbadc6){var _0x4918c4={};if(!_[_0x77b2('0xc')](_0x51d4ea)){_[_0x77b2('0xd')](_0x51d4ea,function(_0x4bd51c,_0x2a14ba){try{if(_0xfbadc6){var _0x512412=_[_0x77b2('0xe')](_0xfbadc6,{'name':_0x2a14ba})||{};if(hasSequelizeOperator(_0x4bd51c)){_0x4918c4[_0x2a14ba]=getOperatorValue(_0x4bd51c);}else if(_0x512412[_0x77b2('0xf')]===_0x77b2('0x10')&&_[_0x77b2('0x11')](_0x4bd51c)){var _0x197265=JSON[_0x77b2('0x3')](_0x4bd51c);var _0x2539d3={'$gte':moment(moment(_0x197265[_0x77b2('0x12')])[_0x77b2('0x13')]('YYYY-MM-DD'))['utc']()[_0x77b2('0x13')](),'$lte':moment(moment(_0x197265[_0x77b2('0x14')])[_0x77b2('0x13')](_0x77b2('0x15')))[_0x77b2('0x16')]()[_0x77b2('0x17')](0x1,'s')[_0x77b2('0x13')]()};_0x4918c4[_0x2a14ba]=_0x2539d3;}else if(_0x512412['name']===_0x77b2('0x18')){_0x4918c4[_0x2a14ba]=_0x4bd51c;}else{_0x4918c4[_0x2a14ba]=_[_0x77b2('0x19')](_0x4bd51c)?_0x4bd51c:JSON[_0x77b2('0x3')](_0x4bd51c);}}else{_0x4918c4[_0x2a14ba]=_[_0x77b2('0x19')](_0x4bd51c)?_0x4bd51c:JSON[_0x77b2('0x3')](_0x4bd51c);}}catch(_0x497d98){_0x4918c4[_0x2a14ba]=_0x4bd51c[_0x77b2('0xa')](',');}});}return _0x4918c4;};exports['limit']=function(_0x298871){_0x298871=parseInt(_0x298871,0xa);if(!_0x298871||_0x298871<0x0){_0x298871=LIMIT_VALUE;}return _0x298871;};exports[_0x77b2('0x1a')]=function(_0x34a960){_0x34a960=parseInt(_0x34a960,0xa);if(!_0x34a960||_0x34a960<0x0){_0x34a960=0x0;}return _0x34a960;};exports[_0x77b2('0x1b')]=function(_0x2d6fbc){var _0x3880ad,_0x36dde1=null;if(_0x2d6fbc){_0x3880ad=_0x2d6fbc['split'](',');_0x36dde1=_['map'](_0x3880ad,function(_0x4a4a8a){if(_0x4a4a8a[_0x77b2('0x1c')]('-')===0x0){return[_0x4a4a8a===_0x77b2('0x1d')?sequelize[_0x77b2('0x1e')](sequelize[_0x77b2('0x1f')](_0x77b2('0x1d')),_0x77b2('0x20')):_0x4a4a8a[_0x77b2('0x21')](0x1),'DESC'];}else{return[_0x4a4a8a===_0x77b2('0x1d')?sequelize[_0x77b2('0x1e')](sequelize[_0x77b2('0x1f')](_0x77b2('0x1d')),_0x77b2('0x20')):_0x4a4a8a,_0x77b2('0x22')];}});}return _0x36dde1;};exports[_0x77b2('0x23')]=function(_0x250202,_0x2bf511){if(_[_0x77b2('0xc')](_0x250202)){return _0x250202;}if(_['isArray'](_0x250202)){for(var _0x3cc4d9=0x0;_0x3cc4d9<_0x250202[_0x77b2('0x24')];_0x3cc4d9+=0x1){_0x250202[_0x3cc4d9]=this[_0x77b2('0x23')](_0x250202[_0x3cc4d9],_0x2bf511);}return _0x250202;}if(!_[_0x77b2('0x25')](_0x250202)){return _0x250202;}if(_[_0x77b2('0x26')](_0x2bf511)){_0x2bf511=[_0x2bf511];}if(!_['isArray'](_0x2bf511)){return _0x250202;}for(var _0x251bf1=0x0;_0x251bf1<_0x2bf511[_0x77b2('0x24')];_0x251bf1+=0x1){_[_0x77b2('0x27')](_0x250202,_0x2bf511[_0x251bf1]);}for(var _0x334366 in _0x250202){if(_0x250202[_0x77b2('0x28')](_0x334366)){_0x250202[_0x334366]=this[_0x77b2('0x23')](_0x250202[_0x334366],_0x2bf511);}}return _0x250202;};exports[_0x77b2('0x29')]=function(_0x1e9e01){return _0x1e9e01[_0x77b2('0x2a')](RegExp(_0x77b2('0x2b')))?!![]:![];};exports[_0x77b2('0x2c')]=function(_0xdc9cb6){return _0xdc9cb6['match'](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x5c2db3,_0x4d1d36){var _0xa5f89a=[];var _0xcd8de=/[ `!@#$%^&*()_\-?~]/;var _0x577e0e=_0x4d1d36?'\x22{EXPR}\x22':'{EXPR}';_0x5c2db3[_0x77b2('0xa')](/[ ,]+/)[_0x77b2('0x2d')](function(_0x46bc7c){_0x46bc7c=_0x46bc7c[_0x77b2('0x2e')](/([^:]")"+/g,'$1');_0x46bc7c='+'+_0x46bc7c+'*';var _0x4e3a30=_0x46bc7c[_0x77b2('0x2a')](_0xcd8de);if(_0x4e3a30){_0x46bc7c='\x22'+_0x46bc7c+'\x22';}_0xa5f89a['push'](_0x46bc7c);});_0x577e0e=_0x577e0e[_0x77b2('0x2e')](_0x77b2('0x2f'),_0xa5f89a[_0x77b2('0x30')]('\x20'));return _0x577e0e;};exports[_0x77b2('0x31')]=function(_0x3e0e90,_0x2bccdc,_0x539abd){var _0x1e8cf0={},_0x405c14={};if(_0x2bccdc[_0x77b2('0x32')]['$id']){_0x2bccdc[_0x77b2('0x32')]['id']=_0x2bccdc['query'][_0x77b2('0x33')];delete _0x2bccdc[_0x77b2('0x32')][_0x77b2('0x33')];}_0x1e8cf0['model']=_['map'](_0x3e0e90,'name');_0x1e8cf0['query']=_[_0x77b2('0x5')](_0x2bccdc['query']);_0x1e8cf0[_0x77b2('0xb')]=_[_0x77b2('0x34')](_0x1e8cf0[_0x77b2('0x6')],_0x1e8cf0[_0x77b2('0x32')]);_0x405c14[_0x77b2('0x35')]=_[_0x77b2('0x34')](_0x1e8cf0[_0x77b2('0x6')],this['fields'](_0x2bccdc['query'][_0x77b2('0x8')]));_0x405c14[_0x77b2('0x35')]=_0x405c14[_0x77b2('0x35')][_0x77b2('0x24')]?_0x405c14['attributes']:_0x1e8cf0[_0x77b2('0x6')];if(!_0x2bccdc[_0x77b2('0x32')][_0x77b2('0x28')]('nolimit')){_0x405c14['limit']=this[_0x77b2('0x36')](_0x2bccdc[_0x77b2('0x32')][_0x77b2('0x36')]);_0x405c14[_0x77b2('0x1a')]=this['offset'](_0x2bccdc[_0x77b2('0x32')][_0x77b2('0x1a')]);}_0x405c14[_0x77b2('0x37')]=this[_0x77b2('0x1b')](_0x2bccdc[_0x77b2('0x32')]['sort']);_0x405c14['where']=this[_0x77b2('0xb')](_[_0x77b2('0x38')](_0x2bccdc[_0x77b2('0x32')],_0x1e8cf0[_0x77b2('0xb')]),_0x3e0e90);if(_0x2bccdc[_0x77b2('0x32')][_0x77b2('0x39')]){var _0x95ac66=_0x3e0e90;var _0x531e2e=_0x2bccdc['query'][_0x77b2('0x39')];if(typeof _0x531e2e===_0x77b2('0x3a')){_0x95ac66=_[_0x77b2('0x39')](_0x3e0e90,function(_0x3446cf){return _['includes'](_0x531e2e['columns'],_0x3446cf[_0x77b2('0x3b')]);});_0x531e2e=_0x531e2e['value'];}_0x405c14[_0x77b2('0x3c')]=_[_0x77b2('0x3d')](_0x405c14[_0x77b2('0x3c')],{'$or':_['map'](_0x95ac66,function(_0x4932b3){if(_0x4932b3[_0x77b2('0xf')]!=='VIRTUAL'){if(_0x539abd){return sequelize[_0x77b2('0x3c')](sequelize['fn'](_0x77b2('0x3e'),sequelize[_0x77b2('0x1f')](_0x4932b3['name'])),{'$like':sequelize['fn'](_0x77b2('0x3e'),'%'+_0x2bccdc[_0x77b2('0x32')][_0x77b2('0x39')]+'%')});}else{var _0x3a3d26={};_0x3a3d26[_0x4932b3[_0x77b2('0x3b')]]={'$like':'%'+_0x2bccdc[_0x77b2('0x32')][_0x77b2('0x39')]+'%'};return _0x3a3d26;}}})});}_0x405c14=_[_0x77b2('0x3d')]({},_0x405c14,_0x2bccdc[_0x77b2('0x3f')]);return _0x405c14;};exports[_0x77b2('0x40')]=function(_0x17e456){var _0x384b0a=[];if(_0x17e456[_0x77b2('0x41')]){_0x384b0a[_0x77b2('0x42')]({'all':!![]});}else if(_0x17e456[_0x77b2('0x40')]){if(Array[_0x77b2('0x19')](_0x17e456[_0x77b2('0x40')])){_0x384b0a=Object[_0x77b2('0x5')](_0x17e456[_0x77b2('0x40')])[_0x77b2('0x43')](function(_0x5dd399){return parseIncludeModel(_0x17e456[_0x77b2('0x40')][_0x5dd399]);});}else{var _0x411a12=parseIncludeModel(_0x17e456[_0x77b2('0x40')]);_0x384b0a[_0x77b2('0x42')](_0x411a12);}}return _0x384b0a;}; \ No newline at end of file diff --git a/server/components/realtime/agents.js b/server/components/realtime/agents.js index 0885475..6fcfbd6 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 _0xdf7c=['filter','length','idle','unknown','unavailable','ringing','voiceStatus','pause','every','chatStatus','mailStatus','openchannelStatus','whatsappStatus','request','Agents','then','error','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','*pause','busy','getAgentStatus','startCase','Queue','map','findOne','flatten','uniq','value','getAgentIdsByQueues','getAgentIdsByStatus','resolve','includes','findAll','name','fullname','chatPause','mailPause','pauseType','globalStatus','split','fields','order','ASC','internal','indexOf','sort','DESC','toLowerCase','sortAgentsByStatus','userpic','online','lastPauseAt','address','chatCapacity','mailCapacity','smsCapacity','faxCapacity','chatCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','smsStatus','faxStatus','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','queue','phoneBarEnableAutomaticScreenRecording','routealias','omit','pick','filterAgentAttributes','jayson/promise','../../mysqldb','client','faxPause','openchannelPause','voicePause','whatsappPause'];(function(_0x1a8bbc,_0x17a086){var _0x212fc2=function(_0x55c718){while(--_0x55c718){_0x1a8bbc['push'](_0x1a8bbc['shift']());}};_0x212fc2(++_0x17a086);}(_0xdf7c,0x149));var _0xcdf7=function(_0x533e4e,_0x4eba54){_0x533e4e=_0x533e4e-0x0;var _0x1f14bb=_0xdf7c[_0x533e4e];return _0x1f14bb;};'use strict';var _=require('lodash');var jayson=require(_0xcdf7('0x0'));var db=require(_0xcdf7('0x1'))['db'];var amiClient=jayson[_0xcdf7('0x2')]['http']({'port':0x232a});var routingClient=jayson['client']['http']({'port':0x232c});function isAgentPaused(_0x2353ab,_0x2b8628){var _0x5d9797=[_0x2353ab['chatPause'],_0x2353ab[_0xcdf7('0x3')],_0x2353ab['mailPause'],_0x2353ab[_0xcdf7('0x4')],_0x2353ab['smsPause'],_0x2353ab[_0xcdf7('0x5')],_0x2353ab[_0xcdf7('0x6')]];if(!_0x2b8628)return _['every'](_0x5d9797);var _0x223a65=_[_0xcdf7('0x7')](_0x5d9797);return _0x223a65[_0xcdf7('0x8')]>0x0&&_0x223a65['length']<_0x5d9797[_0xcdf7('0x8')]?!![]:![];}function isIdle(_0x546bf5){return _0x546bf5===_0xcdf7('0x9')||_0x546bf5===_0xcdf7('0xa')||_0x546bf5===_0xcdf7('0xb')||_0x546bf5===_0xcdf7('0xc')||_['isNil'](_0x546bf5);}function isAgentIdle(_0x45b273){if(_0x45b273[_0xcdf7('0xd')]!==_0xcdf7('0x9')&&_0x45b273[_0xcdf7('0x5')]){_0x45b273['voiceStatus']=_0xcdf7('0xe');return![];}return _[_0xcdf7('0xf')]([_0x45b273[_0xcdf7('0x10')],_0x45b273['faxStatus'],_0x45b273[_0xcdf7('0x11')],_0x45b273[_0xcdf7('0x12')],_0x45b273['smsStatus'],_0x45b273['voiceStatus'],_0x45b273[_0xcdf7('0x13')]],isIdle);}function getRealtimeAgents(){return amiClient[_0xcdf7('0x14')](_0xcdf7('0x15'),{})[_0xcdf7('0x16')](function(_0x433f8f){if(_0x433f8f[_0xcdf7('0x17')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)');}var _0x3d1ab1=_0x433f8f[_0xcdf7('0x18')];return routingClient[_0xcdf7('0x14')](_0xcdf7('0x15'),{})[_0xcdf7('0x16')](function(_0x17f4f0){if(_0x17f4f0[_0xcdf7('0x17')]){throw new Error(_0xcdf7('0x19'));}var _0x345377=_0x17f4f0[_0xcdf7('0x18')];return _[_0xcdf7('0x1a')]({},_0x3d1ab1,_0x345377);});})[_0xcdf7('0x1b')](function(_0x3aa75b){throw _0x3aa75b;});}exports['getRealtimeAgents']=getRealtimeAgents;function getAgentStatus(_0xbec5c9){var _0x4b1f5c=_0xcdf7('0xa');if(isAgentPaused(_0xbec5c9))_0x4b1f5c=_0xcdf7('0xe');else if(isAgentPaused(_0xbec5c9,!![]))_0x4b1f5c=_0xcdf7('0x1c');else if(isAgentIdle(_0xbec5c9))_0x4b1f5c=_0xcdf7('0x9');else _0x4b1f5c=_0xcdf7('0x1d');return _0x4b1f5c;}exports[_0xcdf7('0x1e')]=getAgentStatus;function getAgentIdsByQueues(_0x35e34e,_0x42e1e0){var _0x2e8e45=_['isArray'](_0x35e34e)?_0x35e34e:[_0x35e34e];var _0x5c0d3a=_[_0xcdf7('0x1f')](_0x42e1e0)+_0xcdf7('0x20');var _0x3c8e53=_[_0xcdf7('0x21')](_0x2e8e45,function(_0x453a56){return db[_0x5c0d3a][_0xcdf7('0x22')]({'where':{'id':_0x453a56}})['then'](function(_0x858137){if(!_0x858137)return[];return _0x858137['getAgents']({'attributes':['id'],'raw':!![]});});});return Promise['all'](_0x3c8e53)[_0xcdf7('0x16')](function(_0x1dd78e){var _0x50df32=_(_0x1dd78e)[_0xcdf7('0x23')]()[_0xcdf7('0x21')]('id')[_0xcdf7('0x24')]()[_0xcdf7('0x25')]();return _0x50df32;});}exports[_0xcdf7('0x26')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x7ffd89,_0x291117,_0x37744a){try{if(_0x291117[_0xcdf7('0x8')]>0x0){_0x7ffd89=_0x7ffd89[_0xcdf7('0x7')](function(_0x2790b6){return _0x291117['includes'](_0x2790b6['id']);});}var _0x9eb428=_0x7ffd89[_0xcdf7('0x7')](function(_0x251b42){var _0xdee7ee=_0xcdf7('0x1d');if(isAgentIdle(_0x251b42)){_0xdee7ee=_0xcdf7('0x9');}return _0xdee7ee===_0x37744a;});return _[_0xcdf7('0x21')](_0x9eb428,'id');}catch(_0x4a6a76){throw _0x4a6a76;}}exports[_0xcdf7('0x27')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x4cd760,_0x1e7728,_0x1ecd6d){return Promise[_0xcdf7('0x28')]()['then'](function(){if(_0x1e7728[_0xcdf7('0x8')]>0x0){_0x4cd760=_0x4cd760[_0xcdf7('0x7')](function(_0x4b4427){return _0x1e7728[_0xcdf7('0x29')](_0x4b4427['id']);});}return _0x4cd760;})[_0xcdf7('0x16')](function(){return db['User'][_0xcdf7('0x2a')]({'attributes':['id',_0xcdf7('0x2b'),_0xcdf7('0x2c'),_0xcdf7('0x2d'),'faxPause',_0xcdf7('0x2e'),_0xcdf7('0x4'),'smsPause',_0xcdf7('0x5'),'whatsappPause',_0xcdf7('0x2f')],'where':{'id':{'$in':_['map'](_0x4cd760,'id')}},'raw':!![]});})[_0xcdf7('0x16')](function(_0x43c56b){return _0x43c56b[_0xcdf7('0x21')](function(_0x20f12c){var _0x239821=_['find'](_0x4cd760,['id',_0x20f12c['id']]);var _0x5d2414=filterAgentAttributes(_0x239821);_['merge'](_0x20f12c,_0x5d2414);_0x20f12c[_0xcdf7('0x30')]=getAgentStatus(_0x20f12c);return _0x20f12c;});})['then'](function(_0xad20ab){var _0x54a4ad=sortAgentsByStatus(_0xad20ab,_0x1ecd6d);return _['map'](_0x54a4ad,'id');})['catch'](function(_0x18f727){throw _0x18f727;});}exports['getSortedAgentsIdsByStatus']=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x5532e5){var _0x30f73e={'fields':[],'order':null};var _0xca7534=_0x5532e5[_0xcdf7('0x31')](',');_0x30f73e[_0xcdf7('0x32')]=_['filter'](_0xca7534,function(_0x38ff96){if(!_0x38ff96[_0xcdf7('0x29')](_0xcdf7('0x30'))){return!![];}_0x30f73e[_0xcdf7('0x33')]=_['startsWith'](_0x38ff96,'-')?'DESC':_0xcdf7('0x34');return![];});return _0x30f73e;}exports['getUpdatedSortOptions']=getUpdatedSortOptions;function validateSortParameter(_0x164f2f){if(!_0x164f2f){_0x164f2f='fullname,internal';}if(_0x164f2f['includes'](_0xcdf7('0x2c'))&&!_0x164f2f[_0xcdf7('0x29')](_0xcdf7('0x35'))){var _0x842ab2=_0x164f2f['substring'](0x0,_0x164f2f[_0xcdf7('0x36')](_0xcdf7('0x2c')));_0x164f2f+=','+_0x842ab2+'internal';}return _0x164f2f;}exports['validateSortParameter']=validateSortParameter;function sortAgentsByStatus(_0x1cf066,_0x5e62a1){var _0x3b784d=_0x1cf066[_0xcdf7('0x37')](function(_0x3fde7b,_0x1bb489){if(_0x3fde7b[_0xcdf7('0x30')]===_0x1bb489['globalStatus']){if(_0x3fde7b[_0xcdf7('0x30')]==='pause'){if(_0x5e62a1===_0xcdf7('0x38')){return(_0x3fde7b['pauseType']||'')<(_0x1bb489[_0xcdf7('0x2f')]||'')||_0x3fde7b[_0xcdf7('0x2c')][_0xcdf7('0x39')]()>_0x1bb489[_0xcdf7('0x2c')][_0xcdf7('0x39')]()?0x1:-0x1;}else{return(_0x3fde7b[_0xcdf7('0x2f')]||'')<(_0x1bb489[_0xcdf7('0x2f')]||'')||_0x3fde7b[_0xcdf7('0x2c')]['toLowerCase']()>_0x1bb489[_0xcdf7('0x2c')][_0xcdf7('0x39')]()?-0x1:0x1;}}else{if(_0x5e62a1===_0xcdf7('0x38')){return _0x3fde7b[_0xcdf7('0x2c')][_0xcdf7('0x39')]()<_0x1bb489['fullname'][_0xcdf7('0x39')]()?0x1:-0x1;}else{return _0x3fde7b[_0xcdf7('0x2c')][_0xcdf7('0x39')]()<_0x1bb489[_0xcdf7('0x2c')][_0xcdf7('0x39')]()?-0x1:0x1;}}}else{if(_0x5e62a1===_0xcdf7('0x38')){return _0x3fde7b[_0xcdf7('0x30')]<_0x1bb489[_0xcdf7('0x30')]?0x1:-0x1;}else{return _0x3fde7b[_0xcdf7('0x30')]<_0x1bb489[_0xcdf7('0x30')]?-0x1:0x1;}}});return _0x3b784d;}exports[_0xcdf7('0x3a')]=sortAgentsByStatus;function filterAgentAttributes(_0x3fc225){var _0x2cb9ff=[_0xcdf7('0x3b'),_0xcdf7('0x3c'),'lastLoginAt',_0xcdf7('0x3d'),_0xcdf7('0x2f'),'lastPauseAt',_0xcdf7('0x35'),_0xcdf7('0x3e'),_0xcdf7('0x2d'),_0xcdf7('0x4'),_0xcdf7('0x2e'),'smsPause',_0xcdf7('0x6'),_0xcdf7('0x3'),_0xcdf7('0x5'),_0xcdf7('0x3f'),'openchannelCapacity',_0xcdf7('0x40'),_0xcdf7('0x41'),'whatsappCapacity',_0xcdf7('0x42'),_0xcdf7('0x43'),'openchannelCurrentCapacity',_0xcdf7('0x44'),_0xcdf7('0x45'),_0xcdf7('0x46'),_0xcdf7('0x47'),_0xcdf7('0x10'),_0xcdf7('0x12'),_0xcdf7('0x11'),_0xcdf7('0x48'),_0xcdf7('0x13'),_0xcdf7('0x49'),_0xcdf7('0xd'),'chatStatusTime','openchannelStatusTime',_0xcdf7('0x4a'),_0xcdf7('0x4b'),_0xcdf7('0x4c'),_0xcdf7('0x4d'),'voiceStatusTime',_0xcdf7('0x4e'),'destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent',_0xcdf7('0x4f'),_0xcdf7('0x50')];var _0x2842b3=[_0xcdf7('0x2d'),_0xcdf7('0x4'),_0xcdf7('0x2e'),'smsPause',_0xcdf7('0x6'),_0xcdf7('0x3'),_0xcdf7('0x5'),_0xcdf7('0x3c')];var _0x1eb928=_(_0x3fc225)[_0xcdf7('0x51')](_0x2842b3)[_0xcdf7('0x52')](_0x2cb9ff)['value']();return _0x1eb928;}exports[_0xcdf7('0x53')]=filterAgentAttributes; \ No newline at end of file +var _0x5c05=['chatStatusTime','openchannelStatusTime','mailStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','queue','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','routealias','filterAgentAttributes','lodash','jayson/promise','client','http','chatPause','mailPause','openchannelPause','voicePause','whatsappPause','length','unavailable','ringing','isNil','idle','voiceStatus','every','faxStatus','mailStatus','openchannelStatus','smsStatus','Agents','then','error','result','request','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','getRealtimeAgents','unknown','pause','*pause','busy','getAgentStatus','isArray','Queue','findOne','getAgents','flatten','uniq','value','filter','includes','resolve','User','findAll','name','fullname','faxPause','smsPause','map','globalStatus','catch','getSortedAgentsIdsByStatus','fields','order','startsWith','DESC','getUpdatedSortOptions','fullname,internal','internal','substring','indexOf','validateSortParameter','sort','pauseType','toLowerCase','userpic','online','lastLoginAt','lastPauseAt','address','mailCapacity','smsCapacity','whatsappCapacity','openchannelCurrentCapacity','mailCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity'];(function(_0x34021d,_0x753aa6){var _0x16597b=function(_0x2d040a){while(--_0x2d040a){_0x34021d['push'](_0x34021d['shift']());}};_0x16597b(++_0x753aa6);}(_0x5c05,0x66));var _0x55c0=function(_0x2653c2,_0x21fef0){_0x2653c2=_0x2653c2-0x0;var _0x4ae3c9=_0x5c05[_0x2653c2];return _0x4ae3c9;};'use strict';var _=require(_0x55c0('0x0'));var jayson=require(_0x55c0('0x1'));var db=require('../../mysqldb')['db'];var amiClient=jayson[_0x55c0('0x2')][_0x55c0('0x3')]({'port':0x232a});var routingClient=jayson[_0x55c0('0x2')][_0x55c0('0x3')]({'port':0x232c});function isAgentPaused(_0x2b7d11,_0x5b1d11){var _0x4409be=[_0x2b7d11[_0x55c0('0x4')],_0x2b7d11['faxPause'],_0x2b7d11[_0x55c0('0x5')],_0x2b7d11[_0x55c0('0x6')],_0x2b7d11['smsPause'],_0x2b7d11[_0x55c0('0x7')],_0x2b7d11[_0x55c0('0x8')]];if(!_0x5b1d11)return _['every'](_0x4409be);var _0x22fcd6=_['filter'](_0x4409be);return _0x22fcd6[_0x55c0('0x9')]>0x0&&_0x22fcd6['length']<_0x4409be['length']?!![]:![];}function isIdle(_0x3a12b7){return _0x3a12b7==='idle'||_0x3a12b7==='unknown'||_0x3a12b7===_0x55c0('0xa')||_0x3a12b7===_0x55c0('0xb')||_[_0x55c0('0xc')](_0x3a12b7);}function isAgentIdle(_0x300772){if(_0x300772['voiceStatus']!==_0x55c0('0xd')&&_0x300772[_0x55c0('0x7')]){_0x300772[_0x55c0('0xe')]='pause';return![];}return _[_0x55c0('0xf')]([_0x300772['chatStatus'],_0x300772[_0x55c0('0x10')],_0x300772[_0x55c0('0x11')],_0x300772[_0x55c0('0x12')],_0x300772[_0x55c0('0x13')],_0x300772[_0x55c0('0xe')],_0x300772['whatsappStatus']],isIdle);}function getRealtimeAgents(){return amiClient['request'](_0x55c0('0x14'),{})[_0x55c0('0x15')](function(_0x4df362){if(_0x4df362[_0x55c0('0x16')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)');}var _0x1b0f06=_0x4df362[_0x55c0('0x17')];return routingClient[_0x55c0('0x18')]('Agents',{})[_0x55c0('0x15')](function(_0x5c071d){if(_0x5c071d[_0x55c0('0x16')]){throw new Error(_0x55c0('0x19'));}var _0x51856f=_0x5c071d[_0x55c0('0x17')];return _[_0x55c0('0x1a')]({},_0x1b0f06,_0x51856f);});})['catch'](function(_0x57265b){throw _0x57265b;});}exports[_0x55c0('0x1b')]=getRealtimeAgents;function getAgentStatus(_0x548d79){var _0x3aab1b=_0x55c0('0x1c');if(isAgentPaused(_0x548d79))_0x3aab1b=_0x55c0('0x1d');else if(isAgentPaused(_0x548d79,!![]))_0x3aab1b=_0x55c0('0x1e');else if(isAgentIdle(_0x548d79))_0x3aab1b='idle';else _0x3aab1b=_0x55c0('0x1f');return _0x3aab1b;}exports[_0x55c0('0x20')]=getAgentStatus;function getAgentIdsByQueues(_0x2bb4ee,_0xef080a){var _0x2471c5=_[_0x55c0('0x21')](_0x2bb4ee)?_0x2bb4ee:[_0x2bb4ee];var _0x34f77c=_['startCase'](_0xef080a)+_0x55c0('0x22');var _0x141841=_['map'](_0x2471c5,function(_0x2b2fa8){return db[_0x34f77c][_0x55c0('0x23')]({'where':{'id':_0x2b2fa8}})[_0x55c0('0x15')](function(_0x28b607){if(!_0x28b607)return[];return _0x28b607[_0x55c0('0x24')]({'attributes':['id'],'raw':!![]});});});return Promise['all'](_0x141841)[_0x55c0('0x15')](function(_0x1535d0){var _0x5c9d3e=_(_0x1535d0)[_0x55c0('0x25')]()['map']('id')[_0x55c0('0x26')]()[_0x55c0('0x27')]();return _0x5c9d3e;});}exports['getAgentIdsByQueues']=getAgentIdsByQueues;function getAgentIdsByStatus(_0x5a4ba2,_0x151d07,_0x5709ea){try{if(_0x151d07[_0x55c0('0x9')]>0x0){_0x5a4ba2=_0x5a4ba2[_0x55c0('0x28')](function(_0x4c4918){return _0x151d07[_0x55c0('0x29')](_0x4c4918['id']);});}var _0x4b89d9=_0x5a4ba2[_0x55c0('0x28')](function(_0xc71e3a){var _0x5be570=_0x55c0('0x1f');if(isAgentIdle(_0xc71e3a)){_0x5be570=_0x55c0('0xd');}return _0x5be570===_0x5709ea;});return _['map'](_0x4b89d9,'id');}catch(_0x26e92e){throw _0x26e92e;}}exports['getAgentIdsByStatus']=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x364bce,_0x1f708a,_0x4ae175){return Promise[_0x55c0('0x2a')]()['then'](function(){if(_0x1f708a[_0x55c0('0x9')]>0x0){_0x364bce=_0x364bce['filter'](function(_0x59c285){return _0x1f708a[_0x55c0('0x29')](_0x59c285['id']);});}return _0x364bce;})[_0x55c0('0x15')](function(){return db[_0x55c0('0x2b')][_0x55c0('0x2c')]({'attributes':['id',_0x55c0('0x2d'),_0x55c0('0x2e'),_0x55c0('0x4'),_0x55c0('0x2f'),_0x55c0('0x5'),_0x55c0('0x6'),_0x55c0('0x30'),_0x55c0('0x7'),_0x55c0('0x8'),'pauseType'],'where':{'id':{'$in':_[_0x55c0('0x31')](_0x364bce,'id')}},'raw':!![]});})[_0x55c0('0x15')](function(_0xf934f5){return _0xf934f5[_0x55c0('0x31')](function(_0x400ea7){var _0x24fdb9=_['find'](_0x364bce,['id',_0x400ea7['id']]);var _0x1d51c5=filterAgentAttributes(_0x24fdb9);_[_0x55c0('0x1a')](_0x400ea7,_0x1d51c5);_0x400ea7[_0x55c0('0x32')]=getAgentStatus(_0x400ea7);return _0x400ea7;});})['then'](function(_0x173384){var _0x40c9e5=sortAgentsByStatus(_0x173384,_0x4ae175);return _[_0x55c0('0x31')](_0x40c9e5,'id');})[_0x55c0('0x33')](function(_0x550cd5){throw _0x550cd5;});}exports[_0x55c0('0x34')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x2a50b0){var _0x6c49cc={'fields':[],'order':null};var _0x37a5e4=_0x2a50b0['split'](',');_0x6c49cc[_0x55c0('0x35')]=_[_0x55c0('0x28')](_0x37a5e4,function(_0x407271){if(!_0x407271['includes'](_0x55c0('0x32'))){return!![];}_0x6c49cc[_0x55c0('0x36')]=_[_0x55c0('0x37')](_0x407271,'-')?_0x55c0('0x38'):'ASC';return![];});return _0x6c49cc;}exports[_0x55c0('0x39')]=getUpdatedSortOptions;function validateSortParameter(_0x18e9b2){if(!_0x18e9b2){_0x18e9b2=_0x55c0('0x3a');}if(_0x18e9b2[_0x55c0('0x29')](_0x55c0('0x2e'))&&!_0x18e9b2[_0x55c0('0x29')](_0x55c0('0x3b'))){var _0x2a7496=_0x18e9b2[_0x55c0('0x3c')](0x0,_0x18e9b2[_0x55c0('0x3d')](_0x55c0('0x2e')));_0x18e9b2+=','+_0x2a7496+_0x55c0('0x3b');}return _0x18e9b2;}exports[_0x55c0('0x3e')]=validateSortParameter;function sortAgentsByStatus(_0x3a1cb4,_0x5297be){var _0x17eecf=_0x3a1cb4[_0x55c0('0x3f')](function(_0x182fb8,_0x30bc60){if(_0x182fb8[_0x55c0('0x32')]===_0x30bc60[_0x55c0('0x32')]){if(_0x182fb8[_0x55c0('0x32')]===_0x55c0('0x1d')){if(_0x5297be==='DESC'){return(_0x182fb8[_0x55c0('0x40')]||'')<(_0x30bc60[_0x55c0('0x40')]||'')||_0x182fb8[_0x55c0('0x2e')][_0x55c0('0x41')]()>_0x30bc60[_0x55c0('0x2e')][_0x55c0('0x41')]()?0x1:-0x1;}else{return(_0x182fb8[_0x55c0('0x40')]||'')<(_0x30bc60['pauseType']||'')||_0x182fb8[_0x55c0('0x2e')]['toLowerCase']()>_0x30bc60[_0x55c0('0x2e')][_0x55c0('0x41')]()?-0x1:0x1;}}else{if(_0x5297be==='DESC'){return _0x182fb8[_0x55c0('0x2e')][_0x55c0('0x41')]()<_0x30bc60[_0x55c0('0x2e')][_0x55c0('0x41')]()?0x1:-0x1;}else{return _0x182fb8[_0x55c0('0x2e')][_0x55c0('0x41')]()<_0x30bc60['fullname'][_0x55c0('0x41')]()?-0x1:0x1;}}}else{if(_0x5297be===_0x55c0('0x38')){return _0x182fb8[_0x55c0('0x32')]<_0x30bc60[_0x55c0('0x32')]?0x1:-0x1;}else{return _0x182fb8['globalStatus']<_0x30bc60[_0x55c0('0x32')]?-0x1:0x1;}}});return _0x17eecf;}exports['sortAgentsByStatus']=sortAgentsByStatus;function filterAgentAttributes(_0x454c14){var _0x3f96a3=[_0x55c0('0x42'),_0x55c0('0x43'),_0x55c0('0x44'),_0x55c0('0x45'),_0x55c0('0x40'),_0x55c0('0x45'),'internal',_0x55c0('0x46'),_0x55c0('0x4'),'openchannelPause',_0x55c0('0x5'),_0x55c0('0x30'),_0x55c0('0x8'),_0x55c0('0x2f'),_0x55c0('0x7'),'chatCapacity','openchannelCapacity',_0x55c0('0x47'),_0x55c0('0x48'),_0x55c0('0x49'),'faxCapacity','chatCurrentCapacity',_0x55c0('0x4a'),_0x55c0('0x4b'),'smsCurrentCapacity',_0x55c0('0x4c'),_0x55c0('0x4d'),'chatStatus',_0x55c0('0x12'),_0x55c0('0x11'),'smsStatus','whatsappStatus','faxStatus',_0x55c0('0xe'),_0x55c0('0x4e'),_0x55c0('0x4f'),_0x55c0('0x50'),'smsStatusTime',_0x55c0('0x51'),_0x55c0('0x52'),_0x55c0('0x53'),_0x55c0('0x54'),_0x55c0('0x55'),_0x55c0('0x56'),_0x55c0('0x57'),'phoneBarEnableAutomaticScreenRecording',_0x55c0('0x58')];var _0x5e24d0=['chatPause',_0x55c0('0x6'),'mailPause',_0x55c0('0x30'),_0x55c0('0x8'),_0x55c0('0x2f'),_0x55c0('0x7'),_0x55c0('0x43')];var _0x36c9fd=_(_0x454c14)['omit'](_0x5e24d0)['pick'](_0x3f96a3)[_0x55c0('0x27')]();return _0x36c9fd;}exports[_0x55c0('0x59')]=filterAgentAttributes; \ No newline at end of file diff --git a/server/components/realtime/queues.js b/server/components/realtime/queues.js index 0199ef2..f409d1c 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 _0x46e1=['Queues','then','error','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','getRealtimeQueues','inbound','concat','outbound','map','get','paused','available','waiting','find','merge','pick','initializeQueues','lodash','jayson/promise','util','client','http','loggedIn','busy','inUse','invalid','loggedInDb','notInUse','onHold','ringing','ringInUse','talking','unavailable','unknown','message','statusMessage','dialActive','dialMethod','Trunk','startProgressive','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialPredictiveIntervalMaxThreshold','predictiveIntervalAvailable','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','voice','request','startCase'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x46e1,0x15d));var _0x146e=function(_0x12caed,_0x2c8b61){_0x12caed=_0x12caed-0x0;var _0x1cbab7=_0x46e1[_0x12caed];return _0x1cbab7;};'use strict';var _=require(_0x146e('0x0'));var jayson=require(_0x146e('0x1'));var util=require(_0x146e('0x2'));var amiClient=jayson[_0x146e('0x3')][_0x146e('0x4')]({'port':0x232a});var routingClient=jayson['client'][_0x146e('0x4')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=['available',_0x146e('0x5'),'paused','waiting'];var VOICE_QUEUE_ATTRIBUTES=[_0x146e('0x6'),_0x146e('0x7'),_0x146e('0x8'),_0x146e('0x9'),_0x146e('0xa'),_0x146e('0xb'),_0x146e('0xc'),_0x146e('0xd'),_0x146e('0xe'),_0x146e('0xf'),_0x146e('0x10')];var OUTBOUND_QUEUE_ATTRIBUTES=['pTalking','originated',_0x146e('0x11'),_0x146e('0x12'),_0x146e('0x13'),_0x146e('0x14'),_0x146e('0x15'),'startPredictive',_0x146e('0x16'),_0x146e('0x17'),_0x146e('0x18'),'erlangAbandonmentRate',_0x146e('0x19'),'dialPredictiveInterval',_0x146e('0x1a'),'dialPredictiveIntervalMinThreshold',_0x146e('0x1b'),'predictiveIntervalTotalCalls',_0x146e('0x1c'),_0x146e('0x1d'),_0x146e('0x1e'),_0x146e('0x1f'),_0x146e('0x20')];function getRealtimeQueues(_0x4e10f5,_0x558022){var _0xceb8f0=_0x558022===_0x146e('0x21')?amiClient:routingClient;return _0xceb8f0[_0x146e('0x22')](_[_0x146e('0x23')](_0x558022)+_0x146e('0x24'),_0x4e10f5)[_0x146e('0x25')](function(_0x3a7a1d){if(_0x3a7a1d[_0x146e('0x26')])throw new Error(util[_0x146e('0x27')](_0x146e('0x28'),_0x558022));return _0x3a7a1d[_0x146e('0x29')];})['catch'](function(_0x2d6c9b){throw _0x2d6c9b;});}exports[_0x146e('0x2a')]=getRealtimeQueues;function initializeQueues(_0x5ef66a,_0x29d318,_0x11a7f2,_0xa90165){var _0xdb21d1=DEFAULT_QUEUE_ATTRIBUTES;if(_0x11a7f2==='voice'){if(_0xa90165===_0x146e('0x2b')){_0xdb21d1=_0xdb21d1[_0x146e('0x2c')](VOICE_QUEUE_ATTRIBUTES);}else if(_0xa90165===_0x146e('0x2d')){_0xdb21d1=_0xdb21d1[_0x146e('0x2c')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x5ef66a[_0x146e('0x2e')](function(_0x2f0cc8){var _0x2f35d1=_0x2f0cc8[_0x146e('0x2f')]({'plain':!![]});_0x2f35d1[_0x146e('0x30')]=0x0;_0x2f35d1[_0x146e('0x9')]=0x0;_0x2f35d1[_0x146e('0x5')]=0x0;_0x2f35d1[_0x146e('0x31')]=0x0;_0x2f35d1[_0x146e('0x32')]=0x0;if(_0x11a7f2===_0x146e('0x21')){_0x2f35d1['talking']=0x0;_0x2f35d1[_0x146e('0x6')]=0x0;if(_0xa90165===_0x146e('0x2d')){_0x2f35d1['pTalking']=0x0;_0x2f35d1['originated']=0x0;}}var _0x13f54c=_[_0x146e('0x33')](_0x29d318,['id',_0x2f35d1['id']]);if(_0x13f54c){_[_0x146e('0x34')](_0x2f35d1,_[_0x146e('0x35')](_0x13f54c,_0xdb21d1));}return _0x2f35d1;});}exports[_0x146e('0x36')]=initializeQueues; \ No newline at end of file +var _0xc75a=['Queues','error','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','getRealtimeQueues','inbound','map','get','talking','busy','outbound','pTalking','merge','pick','initializeQueues','lodash','jayson/promise','client','http','available','loggedIn','paused','waiting','inUse','invalid','loggedInDb','notInUse','onHold','ringing','ringInUse','unavailable','unknown','originated','message','statusMessage','dialActive','dialMethod','startPredictive','startProgressive','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','predictiveIntervalAvailable','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','voice','request'];(function(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0xc75a,0x74));var _0xac75=function(_0x1be3b3,_0x4335ee){_0x1be3b3=_0x1be3b3-0x0;var _0x4f8b2d=_0xc75a[_0x1be3b3];return _0x4f8b2d;};'use strict';var _=require(_0xac75('0x0'));var jayson=require(_0xac75('0x1'));var util=require('util');var amiClient=jayson[_0xac75('0x2')][_0xac75('0x3')]({'port':0x232a});var routingClient=jayson[_0xac75('0x2')][_0xac75('0x3')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0xac75('0x4'),_0xac75('0x5'),_0xac75('0x6'),_0xac75('0x7')];var VOICE_QUEUE_ATTRIBUTES=['busy',_0xac75('0x8'),_0xac75('0x9'),_0xac75('0xa'),_0xac75('0xb'),_0xac75('0xc'),_0xac75('0xd'),_0xac75('0xe'),'talking',_0xac75('0xf'),_0xac75('0x10')];var OUTBOUND_QUEUE_ATTRIBUTES=['pTalking',_0xac75('0x11'),_0xac75('0x12'),_0xac75('0x13'),_0xac75('0x14'),_0xac75('0x15'),'Trunk',_0xac75('0x16'),_0xac75('0x17'),'erlangCalls',_0xac75('0x18'),_0xac75('0x19'),_0xac75('0x1a'),_0xac75('0x1b'),'dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold',_0xac75('0x1c'),'predictiveIntervalTotalCalls',_0xac75('0x1d'),'predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit',_0xac75('0x1e'),_0xac75('0x1f')];function getRealtimeQueues(_0x24bdfd,_0x11c762){var _0x314cac=_0x11c762===_0xac75('0x20')?amiClient:routingClient;return _0x314cac[_0xac75('0x21')](_['startCase'](_0x11c762)+_0xac75('0x22'),_0x24bdfd)['then'](function(_0x3d4257){if(_0x3d4257[_0xac75('0x23')])throw new Error(util[_0xac75('0x24')](_0xac75('0x25'),_0x11c762));return _0x3d4257[_0xac75('0x26')];})['catch'](function(_0x42db48){throw _0x42db48;});}exports[_0xac75('0x27')]=getRealtimeQueues;function initializeQueues(_0x4f0728,_0x599b6d,_0x22cc6f,_0x1ae0cc){var _0x3f09e6=DEFAULT_QUEUE_ATTRIBUTES;if(_0x22cc6f==='voice'){if(_0x1ae0cc===_0xac75('0x28')){_0x3f09e6=_0x3f09e6['concat'](VOICE_QUEUE_ATTRIBUTES);}else if(_0x1ae0cc==='outbound'){_0x3f09e6=_0x3f09e6['concat'](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x4f0728[_0xac75('0x29')](function(_0xcc8598){var _0x51e3c5=_0xcc8598[_0xac75('0x2a')]({'plain':!![]});_0x51e3c5['paused']=0x0;_0x51e3c5[_0xac75('0xa')]=0x0;_0x51e3c5[_0xac75('0x5')]=0x0;_0x51e3c5['available']=0x0;_0x51e3c5[_0xac75('0x7')]=0x0;if(_0x22cc6f===_0xac75('0x20')){_0x51e3c5[_0xac75('0x2b')]=0x0;_0x51e3c5[_0xac75('0x2c')]=0x0;if(_0x1ae0cc===_0xac75('0x2d')){_0x51e3c5[_0xac75('0x2e')]=0x0;_0x51e3c5[_0xac75('0x11')]=0x0;}}var _0x46a8ac=_['find'](_0x599b6d,['id',_0x51e3c5['id']]);if(_0x46a8ac){_[_0xac75('0x2f')](_0x51e3c5,_[_0xac75('0x30')](_0x46a8ac,_0x3f09e6));}return _0x51e3c5;});}exports[_0xac75('0x31')]=initializeQueues; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index e2e7bda..c0c0a4e 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(_0x2ef251,_0x3687e5){var _0x5c931b=function(_0x3e1e36){while(--_0x3e1e36){_0x2ef251['push'](_0x2ef251['shift']());}};_0x5c931b(++_0x3687e5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'use strict';var express=require(_0x0a9e('0x0'));var methodOverride=require(_0x0a9e('0x1'));var cookieParser=require(_0x0a9e('0x2'));var errorHandler=require('errorhandler');var path=require('path');var passport=require(_0x0a9e('0x3'));var cors=require('cors');var config=require(_0x0a9e('0x4'));exports[_0x0a9e('0x5')]=function(_0x2ab90b){var _0x991246=_0x2ab90b[_0x0a9e('0x6')]('env');if(_0x991246===_0x0a9e('0x7')){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path['join'](config['root'],_0x0a9e('0xa')));}if(_0x991246==='development'||_0x991246==='test'){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path[_0x0a9e('0xb')](config[_0x0a9e('0xc')],_0x0a9e('0xd')));_0x2ab90b[_0x0a9e('0xe')](errorHandler());}_0x2ab90b['set']('json\x20replacer',function(_0x527cdd,_0x4cfe67){if(this[_0x527cdd]instanceof Date){_0x4cfe67=this[_0x527cdd][_0x0a9e('0xf')]()[_0x0a9e('0x10')]('.')[0x0]+'Z';}return _0x4cfe67;});_0x2ab90b[_0x0a9e('0xe')](express[_0x0a9e('0x11')](_0x2ab90b[_0x0a9e('0x6')](_0x0a9e('0x9'))));_0x2ab90b['set'](_0x0a9e('0x12'),config[_0x0a9e('0xc')]+_0x0a9e('0x13'));_0x2ab90b[_0x0a9e('0x14')](_0x0a9e('0x15'),require(_0x0a9e('0x16'))['renderFile']);_0x2ab90b[_0x0a9e('0x8')]('view\x20engine',_0x0a9e('0x15'));_0x2ab90b['use'](express[_0x0a9e('0x17')]({'limit':_0x0a9e('0x18'),'extended':!![]}));_0x2ab90b['use'](express[_0x0a9e('0x19')]({'limit':'50mb'}));_0x2ab90b[_0x0a9e('0xe')](cors());_0x2ab90b[_0x0a9e('0xe')](methodOverride());_0x2ab90b[_0x0a9e('0xe')](cookieParser());_0x2ab90b[_0x0a9e('0xe')](passport[_0x0a9e('0x1a')]());}; \ No newline at end of file +var _0xa9e0=['get','production','set','appPath','public','join','root','client','use','toISOString','split','static','views','/server/views','engine','html','ejs','urlencoded','50mb','json','initialize','express','method-override','cookie-parser','passport','./environment','default'];(function(_0x269ee8,_0x477226){var _0x4d98bd=function(_0x20d4c4){while(--_0x20d4c4){_0x269ee8['push'](_0x269ee8['shift']());}};_0x4d98bd(++_0x477226);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'use strict';var express=require(_0x0a9e('0x0'));var methodOverride=require(_0x0a9e('0x1'));var cookieParser=require(_0x0a9e('0x2'));var errorHandler=require('errorhandler');var path=require('path');var passport=require(_0x0a9e('0x3'));var cors=require('cors');var config=require(_0x0a9e('0x4'));exports[_0x0a9e('0x5')]=function(_0x2ab90b){var _0x991246=_0x2ab90b[_0x0a9e('0x6')]('env');if(_0x991246===_0x0a9e('0x7')){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path['join'](config['root'],_0x0a9e('0xa')));}if(_0x991246==='development'||_0x991246==='test'){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path[_0x0a9e('0xb')](config[_0x0a9e('0xc')],_0x0a9e('0xd')));_0x2ab90b[_0x0a9e('0xe')](errorHandler());}_0x2ab90b['set']('json\x20replacer',function(_0x527cdd,_0x4cfe67){if(this[_0x527cdd]instanceof Date){_0x4cfe67=this[_0x527cdd][_0x0a9e('0xf')]()[_0x0a9e('0x10')]('.')[0x0]+'Z';}return _0x4cfe67;});_0x2ab90b[_0x0a9e('0xe')](express[_0x0a9e('0x11')](_0x2ab90b[_0x0a9e('0x6')](_0x0a9e('0x9'))));_0x2ab90b['set'](_0x0a9e('0x12'),config[_0x0a9e('0xc')]+_0x0a9e('0x13'));_0x2ab90b[_0x0a9e('0x14')](_0x0a9e('0x15'),require(_0x0a9e('0x16'))['renderFile']);_0x2ab90b[_0x0a9e('0x8')]('view\x20engine',_0x0a9e('0x15'));_0x2ab90b['use'](express[_0x0a9e('0x17')]({'limit':_0x0a9e('0x18'),'extended':!![]}));_0x2ab90b['use'](express[_0x0a9e('0x19')]({'limit':'50mb'}));_0x2ab90b[_0x0a9e('0xe')](cors());_0x2ab90b[_0x0a9e('0xe')](methodOverride());_0x2ab90b[_0x0a9e('0xe')](cookieParser());_0x2ab90b[_0x0a9e('0xe')](passport[_0x0a9e('0x1a')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 471d978..91c381f 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 _0x8290=['concat','head','mac','00:00:00:00:00:00','address','cpus','map','model','join','createHash','md5','update','hex','getUuid','platform','licenseToken','test','win32','utf8','replace','hostname','ipAddress','substring','lodash','crypto','child_process','../environment','networkInterfaces','orderBy','IPv4','internal'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x8290,0x18b));var _0x0829=function(_0x4327c4,_0x3e8812){_0x4327c4=_0x4327c4-0x0;var _0x246ae8=_0x8290[_0x4327c4];return _0x246ae8;};'use strict';var _=require(_0x0829('0x0'));var os=require('os');var crypto=require(_0x0829('0x1'));var machine=require('bimedia-machine-uuid');var exec=require(_0x0829('0x2'))['execSync'];var config=require(_0x0829('0x3'));function getInterfaces(){var _0x549e79=[];var _0x4824da=os[_0x0829('0x4')]();var _0x5682c7=_[_0x0829('0x5')](_['keys'](_0x4824da));for(var _0x51caa4=0x0;_0x51caa4<_0x5682c7['length'];_0x51caa4++){var _0x257cac=_0x4824da[_0x5682c7[_0x51caa4]]['filter'](function(_0x32ffca){return _0x32ffca['family']===_0x0829('0x6')&&_0x32ffca[_0x0829('0x7')]===![];});_0x549e79=_0x549e79[_0x0829('0x8')](_0x257cac);}return _0x549e79;}function getFirstInterface(){var _0x500256=_[_0x0829('0x9')](getInterfaces());return{'macAddress':_0x500256&&_0x500256[_0x0829('0xa')]?_0x500256[_0x0829('0xa')]:_0x0829('0xb'),'ipAddress':_0x500256&&_0x500256[_0x0829('0xc')]?_0x500256[_0x0829('0xc')]:'127.0.0.1'};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0x52a9aa=_[_0x0829('0x5')](os[_0x0829('0xd')]()[_0x0829('0xe')](function(_0x182e04){return _0x182e04[_0x0829('0xf')];}))[_0x0829('0x10')](':');return crypto[_0x0829('0x11')](_0x0829('0x12'))[_0x0829('0x13')](_0x52a9aa)['digest'](_0x0829('0x14'));}exports[_0x0829('0x15')]=function(){var _0x373ad4=os[_0x0829('0x16')]();var _0x1e9d1f=/[0-9a-f-]{36}/;if(config[_0x0829('0x17')]&&_0x1e9d1f[_0x0829('0x18')](config[_0x0829('0x17')])){return config['licenseToken'];}else if(_0x373ad4===_0x0829('0x19')){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0x0829('0x1a')})[_0x0829('0x1b')]('\x0d\x0a','');}else{var _0x33bb11=getFirstInterface();var _0x52847f=getCPUhash();var _0x534a95=_0x52847f+'|'+os[_0x0829('0x1c')]()+'|'+_0x33bb11['macAddress']+'|'+_0x33bb11[_0x0829('0x1d')];var _0x122322=crypto[_0x0829('0x11')](_0x0829('0x12'))[_0x0829('0x13')](_0x534a95)['digest']('hex');return _0x122322['substring'](0x0,0x8)+'-'+_0x122322[_0x0829('0x1e')](0x8,0xc)+'-'+_0x122322[_0x0829('0x1e')](0xc,0x10)+'-'+_0x122322['substring'](0x10,0x14)+'-'+_0x122322[_0x0829('0x1e')](0x14);}}; \ No newline at end of file +var _0xe3f1=['licenseToken','win32','replace','hostname','macAddress','ipAddress','substring','lodash','crypto','child_process','../environment','networkInterfaces','orderBy','filter','family','IPv4','internal','concat','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','model','join','createHash','md5','update','digest','hex','test'];(function(_0x5d0746,_0x511b2d){var _0x19a392=function(_0x111382){while(--_0x111382){_0x5d0746['push'](_0x5d0746['shift']());}};_0x19a392(++_0x511b2d);}(_0xe3f1,0x1e7));var _0x1e3f=function(_0x57916e,_0x563691){_0x57916e=_0x57916e-0x0;var _0x398bca=_0xe3f1[_0x57916e];return _0x398bca;};'use strict';var _=require(_0x1e3f('0x0'));var os=require('os');var crypto=require(_0x1e3f('0x1'));var machine=require('bimedia-machine-uuid');var exec=require(_0x1e3f('0x2'))['execSync'];var config=require(_0x1e3f('0x3'));function getInterfaces(){var _0x519454=[];var _0x3d9590=os[_0x1e3f('0x4')]();var _0x236f9d=_[_0x1e3f('0x5')](_['keys'](_0x3d9590));for(var _0x8c659e=0x0;_0x8c659e<_0x236f9d['length'];_0x8c659e++){var _0xba3dbd=_0x3d9590[_0x236f9d[_0x8c659e]][_0x1e3f('0x6')](function(_0x171309){return _0x171309[_0x1e3f('0x7')]===_0x1e3f('0x8')&&_0x171309[_0x1e3f('0x9')]===![];});_0x519454=_0x519454[_0x1e3f('0xa')](_0xba3dbd);}return _0x519454;}function getFirstInterface(){var _0x5db06a=_['head'](getInterfaces());return{'macAddress':_0x5db06a&&_0x5db06a[_0x1e3f('0xb')]?_0x5db06a['mac']:_0x1e3f('0xc'),'ipAddress':_0x5db06a&&_0x5db06a[_0x1e3f('0xd')]?_0x5db06a[_0x1e3f('0xd')]:_0x1e3f('0xe')};}exports[_0x1e3f('0xf')]=getFirstInterface;function getCPUhash(){var _0x28d2a6=_[_0x1e3f('0x5')](os[_0x1e3f('0x10')]()['map'](function(_0x22f6eb){return _0x22f6eb[_0x1e3f('0x11')];}))[_0x1e3f('0x12')](':');return crypto[_0x1e3f('0x13')](_0x1e3f('0x14'))[_0x1e3f('0x15')](_0x28d2a6)[_0x1e3f('0x16')](_0x1e3f('0x17'));}exports['getUuid']=function(){var _0x313490=os['platform']();var _0x94e84d=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x94e84d[_0x1e3f('0x18')](config[_0x1e3f('0x19')])){return config[_0x1e3f('0x19')];}else if(_0x313490===_0x1e3f('0x1a')){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':'utf8'})[_0x1e3f('0x1b')]('\x0d\x0a','');}else{var _0x14423a=getFirstInterface();var _0x4053e4=getCPUhash();var _0x23e0c1=_0x4053e4+'|'+os[_0x1e3f('0x1c')]()+'|'+_0x14423a[_0x1e3f('0x1d')]+'|'+_0x14423a[_0x1e3f('0x1e')];var _0x16543f=crypto[_0x1e3f('0x13')](_0x1e3f('0x14'))['update'](_0x23e0c1)[_0x1e3f('0x16')](_0x1e3f('0x17'));return _0x16543f['substring'](0x0,0x8)+'-'+_0x16543f[_0x1e3f('0x1f')](0x8,0xc)+'-'+_0x16543f[_0x1e3f('0x1f')](0xc,0x10)+'-'+_0x16543f['substring'](0x10,0x14)+'-'+_0x16543f[_0x1e3f('0x1f')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 7e972d4..2912674 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 _0xeba7=['getUuid','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','moment','request-promise','bluebird','pkginfo','../../mysqldb','./hardware','../logger','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','version','%s/api/servers/%s/check?version=%s&oldtoken=%s','then','catch','get','data1','data2','active','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','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','days','error','message'];(function(_0x402e8a,_0x190624){var _0x163029=function(_0x2bb2b7){while(--_0x2bb2b7){_0x402e8a['push'](_0x402e8a['shift']());}};_0x163029(++_0x190624);}(_0xeba7,0x12b));var _0x7eba=function(_0x89eaf8,_0x24148c){_0x89eaf8=_0x89eaf8-0x0;var _0x5477f2=_0xeba7[_0x89eaf8];return _0x5477f2;};'use strict';var util=require(_0x7eba('0x0'));var moment=require(_0x7eba('0x1'));var rp=require(_0x7eba('0x2'));var BPromise=require(_0x7eba('0x3'));var pkginfo=require(_0x7eba('0x4'))(module,'version');var db=require(_0x7eba('0x5'))['db'];var encryptor=require('../../components/encryptor');var hardware=require(_0x7eba('0x6'));var logger=require(_0x7eba('0x7'))(_0x7eba('0x8'));var HOST=_0x7eba('0x9');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x3724b4){return new BPromise(function(_0x43fc24,_0x566b96){var _0x2b5a6d=util[_0x7eba('0xa')](_0x7eba('0xb'),HOST,_0x3724b4,module[_0x7eba('0xc')][_0x7eba('0xd')]);if(oldToken){_0x2b5a6d=util[_0x7eba('0xa')](_0x7eba('0xe'),HOST,_0x3724b4,module[_0x7eba('0xc')][_0x7eba('0xd')],oldToken);}var _0x2ac041={'uri':_0x2b5a6d,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x2ac041)[_0x7eba('0xf')](function(_0x11208a){_0x43fc24(_0x11208a);})[_0x7eba('0x10')](function(_0x218fca){_0x566b96(_0x218fca);});});}function manageLicense(_0x2cbb54,_0x5c8178){var _0x152fbd=_0x5c8178[_0x7eba('0x11')]({'plain':!![]});if(!isOldTokenSent&&_0x152fbd[_0x7eba('0x12')]!==_0x2cbb54&&!_0x152fbd[_0x7eba('0x13')]){oldToken=_0x152fbd[_0x7eba('0x12')];}httpRequest(_0x2cbb54)[_0x7eba('0xf')](function(_0x2e31f9){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x2e31f9[_0x7eba('0x14')]){isOldTokenSent=![];if(!_0x152fbd[_0x7eba('0x8')]&&_0x152fbd[_0x7eba('0x8')]!=_0x2e31f9[_0x7eba('0x8')]||_0x152fbd[_0x7eba('0x8')]&&_0x152fbd['data2']){logger[_0x7eba('0x15')](_0x7eba('0x16'));}if(_0x152fbd[_0x7eba('0x8')]&&!_0x152fbd['data2']&&_0x152fbd[_0x7eba('0x8')]!=_0x2e31f9[_0x7eba('0x8')]){logger['info'](_0x7eba('0x17'));}if(_0x152fbd[_0x7eba('0x8')]&&!_0x152fbd[_0x7eba('0x13')]&&_0x152fbd[_0x7eba('0x8')]==_0x2e31f9[_0x7eba('0x8')]){return _0x5c8178;}return _0x5c8178[_0x7eba('0x18')]({'data1':_0x2cbb54,'data2':null,'license':_0x2e31f9[_0x7eba('0x8')]});}else{if(_0x2e31f9['license']||_0x152fbd[_0x7eba('0x8')]){if(!_0x152fbd[_0x7eba('0x13')]){if(_0x152fbd[_0x7eba('0x12')]==_0x2cbb54){GRAY_PERIOD_REASON=_0x7eba('0x19');logger[_0x7eba('0x15')](_0x7eba('0x1a'));}else{GRAY_PERIOD_REASON=_0x7eba('0x1b');logger[_0x7eba('0x15')](_0x7eba('0x1c'),_0x152fbd[_0x7eba('0x12')],_0x2cbb54);}logger[_0x7eba('0x15')](_0x7eba('0x1d'),GRAY_PERIOD_REASON[_0x7eba('0x1e')](),moment()[_0x7eba('0xa')](_0x7eba('0x1f')));return _0x5c8178[_0x7eba('0x18')]({'data2':encryptor[_0x7eba('0x20')](moment()[_0x7eba('0xa')](_0x7eba('0x1f')))});}else{if(moment()[_0x7eba('0x21')](encryptor['decryptString'](_0x152fbd[_0x7eba('0x13')]),_0x7eba('0x22'))>DAYS){logger['info']('DEMO\x20START\x20AT\x20%s',moment()[_0x7eba('0xa')](_0x7eba('0x1f')));isOldTokenSent=![];return _0x5c8178[_0x7eba('0x18')]({'data1':_0x2cbb54,'data2':null,'license':null});}}}else{if(_0x152fbd['data1']!=_0x2cbb54){logger[_0x7eba('0x15')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x152fbd[_0x7eba('0x12')],_0x2cbb54);return _0x5c8178[_0x7eba('0x18')]({'data1':_0x2cbb54,'data2':null,'license':null});}}}return _0x5c8178;})[_0x7eba('0xf')](function(_0x8d07bf){_0x5c8178=_0x8d07bf;})[_0x7eba('0x10')](function(_0x4089de){logger[_0x7eba('0x23')](_0x4089de[_0x7eba('0x24')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0x7eba('0x25')](),_0x5c8178);},TIME);});}function defaultLicense(){var _0x36fcd6=hardware[_0x7eba('0x25')]();if(_0x36fcd6){return db['License'][_0x7eba('0x26')]({'where':{'id':0x1},'defaults':{'data1':_0x36fcd6}})[_0x7eba('0x27')](function(_0x48d4cc,_0x19aec1){logger['info'](_0x7eba('0x28'),_0x36fcd6);manageLicense(_0x36fcd6,_0x48d4cc);})[_0x7eba('0x10')](function(_0x12aa27){logger['error'](_0x12aa27['message']);});}}exports[_0x7eba('0x29')]=defaultLicense; \ No newline at end of file +var _0xe376=['message','finally','getUuid','License','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','moment','request-promise','bluebird','pkginfo','../../components/encryptor','./hardware','../logger','license','format','%s/api/servers/%s/check?version=%s','exports','version','%s/api/servers/%s/check?version=%s&oldtoken=%s','then','catch','get','data2','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','data1','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','update','encryptString','diff','decryptString','days','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','error'];(function(_0x27aca9,_0x267830){var _0x170d61=function(_0xd7070){while(--_0xd7070){_0x27aca9['push'](_0x27aca9['shift']());}};_0x170d61(++_0x267830);}(_0xe376,0xfd));var _0x6e37=function(_0x3e954d,_0x4cc3a0){_0x3e954d=_0x3e954d-0x0;var _0x59649b=_0xe376[_0x3e954d];return _0x59649b;};'use strict';var util=require(_0x6e37('0x0'));var moment=require(_0x6e37('0x1'));var rp=require(_0x6e37('0x2'));var BPromise=require(_0x6e37('0x3'));var pkginfo=require(_0x6e37('0x4'))(module,'version');var db=require('../../mysqldb')['db'];var encryptor=require(_0x6e37('0x5'));var hardware=require(_0x6e37('0x6'));var logger=require(_0x6e37('0x7'))(_0x6e37('0x8'));var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x2684f1){return new BPromise(function(_0x163b8c,_0x1c6510){var _0x27204d=util[_0x6e37('0x9')](_0x6e37('0xa'),HOST,_0x2684f1,module[_0x6e37('0xb')][_0x6e37('0xc')]);if(oldToken){_0x27204d=util[_0x6e37('0x9')](_0x6e37('0xd'),HOST,_0x2684f1,module[_0x6e37('0xb')]['version'],oldToken);}var _0x459a2f={'uri':_0x27204d,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x459a2f)[_0x6e37('0xe')](function(_0x1056fd){_0x163b8c(_0x1056fd);})[_0x6e37('0xf')](function(_0x55f9ac){_0x1c6510(_0x55f9ac);});});}function manageLicense(_0x6d7e15,_0x4ddf04){var _0x22f644=_0x4ddf04[_0x6e37('0x10')]({'plain':!![]});if(!isOldTokenSent&&_0x22f644['data1']!==_0x6d7e15&&!_0x22f644[_0x6e37('0x11')]){oldToken=_0x22f644['data1'];}httpRequest(_0x6d7e15)[_0x6e37('0xe')](function(_0x5b28f4){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x5b28f4[_0x6e37('0x12')]){isOldTokenSent=![];if(!_0x22f644[_0x6e37('0x8')]&&_0x22f644[_0x6e37('0x8')]!=_0x5b28f4['license']||_0x22f644[_0x6e37('0x8')]&&_0x22f644['data2']){logger[_0x6e37('0x13')](_0x6e37('0x14'));}if(_0x22f644[_0x6e37('0x8')]&&!_0x22f644[_0x6e37('0x11')]&&_0x22f644['license']!=_0x5b28f4['license']){logger[_0x6e37('0x13')](_0x6e37('0x15'));}if(_0x22f644[_0x6e37('0x8')]&&!_0x22f644[_0x6e37('0x11')]&&_0x22f644[_0x6e37('0x8')]==_0x5b28f4[_0x6e37('0x8')]){return _0x4ddf04;}return _0x4ddf04['update']({'data1':_0x6d7e15,'data2':null,'license':_0x5b28f4['license']});}else{if(_0x5b28f4['license']||_0x22f644[_0x6e37('0x8')]){if(!_0x22f644[_0x6e37('0x11')]){if(_0x22f644[_0x6e37('0x16')]==_0x6d7e15){GRAY_PERIOD_REASON='Disabled';logger['info'](_0x6e37('0x17'));}else{GRAY_PERIOD_REASON='Changed';logger[_0x6e37('0x13')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x22f644[_0x6e37('0x16')],_0x6d7e15);}logger[_0x6e37('0x13')](_0x6e37('0x18'),GRAY_PERIOD_REASON[_0x6e37('0x19')](),moment()['format'](_0x6e37('0x1a')));return _0x4ddf04[_0x6e37('0x1b')]({'data2':encryptor[_0x6e37('0x1c')](moment()[_0x6e37('0x9')](_0x6e37('0x1a')))});}else{if(moment()[_0x6e37('0x1d')](encryptor[_0x6e37('0x1e')](_0x22f644[_0x6e37('0x11')]),_0x6e37('0x1f'))>DAYS){logger[_0x6e37('0x13')]('DEMO\x20START\x20AT\x20%s',moment()[_0x6e37('0x9')](_0x6e37('0x1a')));isOldTokenSent=![];return _0x4ddf04[_0x6e37('0x1b')]({'data1':_0x6d7e15,'data2':null,'license':null});}}}else{if(_0x22f644[_0x6e37('0x16')]!=_0x6d7e15){logger[_0x6e37('0x13')](_0x6e37('0x20'),_0x22f644[_0x6e37('0x16')],_0x6d7e15);return _0x4ddf04[_0x6e37('0x1b')]({'data1':_0x6d7e15,'data2':null,'license':null});}}}return _0x4ddf04;})[_0x6e37('0xe')](function(_0x3ee789){_0x4ddf04=_0x3ee789;})[_0x6e37('0xf')](function(_0x5e0f99){logger[_0x6e37('0x21')](_0x5e0f99[_0x6e37('0x22')]);})[_0x6e37('0x23')](function(){setTimeout(function(){manageLicense(hardware[_0x6e37('0x24')](),_0x4ddf04);},TIME);});}function defaultLicense(){var _0x5671a0=hardware[_0x6e37('0x24')]();if(_0x5671a0){return db[_0x6e37('0x25')]['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x5671a0}})[_0x6e37('0x26')](function(_0x5bcd49,_0x269963){logger[_0x6e37('0x13')](_0x6e37('0x27'),_0x5671a0);manageLicense(_0x5671a0,_0x5bcd49);})[_0x6e37('0xf')](function(_0x439ab3){logger['error'](_0x439ab3[_0x6e37('0x22')]);});}}exports[_0x6e37('0x28')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 1c755d9..1758be5 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 _0xaebc=['message','User','findAll','role','sequelize','COUNT','col','admin','telephone','telephones','forEach','count','pick','countBy','user','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','bluebird','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','getUuid','Breaking\x20license','License','find','defaults','then','catch','data1','license','isEmpty','split','format','%s:%s:%s','parse','demo','uuid','decryptString','gray','deadline','add','days','grayReason','machineUuid','changed','disabled'];(function(_0x4c5b60,_0x5e6db1){var _0x411dd9=function(_0x94dce1){while(--_0x94dce1){_0x4c5b60['push'](_0x4c5b60['shift']());}};_0x411dd9(++_0x5e6db1);}(_0xaebc,0x1f2));var _0xcaeb=function(_0x57a670,_0x30e402){_0x57a670=_0x57a670-0x0;var _0x41ce21=_0xaebc[_0x57a670];return _0x41ce21;};'use strict';var util=require(_0xcaeb('0x0'));var _=require('lodash');var moment=require('moment');var BPromise=require(_0xcaeb('0x1'));var hardware=require('./hardware');var encryptor=require(_0xcaeb('0x2'));var db=require(_0xcaeb('0x3'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xcaeb('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware[_0xcaeb('0x5')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xcaeb('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xcaeb('0x6'),'machineUuid':hardware[_0xcaeb('0x5')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x2fe59c){return new BPromise(function(_0x112bd7,_0xb6c09f){return db[_0xcaeb('0x7')][_0xcaeb('0x8')](_[_0xcaeb('0x9')](_0x2fe59c,{'raw':!![],'where':{'id':0x1}}))[_0xcaeb('0xa')](function(_0x40d724){return checkLicense(_0x40d724,null);})[_0xcaeb('0xa')](function(_0x44ae0d){_0x112bd7(_0x44ae0d);return;})[_0xcaeb('0xb')](function(_0x58a218){_0xb6c09f(_0x58a218);});});}function checkLicense(_0x58ae8a,_0x443fd0){if(!_0x58ae8a){demoLicense['uuid']=_0x58ae8a[_0xcaeb('0xc')];return demoLicense;}try{var _0x255653=_0x443fd0||_0x58ae8a[_0xcaeb('0xd')];if(_[_0xcaeb('0xe')](_0x255653)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x1f54a8=_0x58ae8a[_0xcaeb('0xc')];var _0xd0e1a8=_0x58ae8a['data2'];var _0x1caa8d=_0x1f54a8['split']('-')[0x4];var _0x4955ab=_0x1f54a8[_0xcaeb('0xf')]('-')[0x0];var _0x2b998a=encryptor['decryptString'](_0x255653,util[_0xcaeb('0x10')](_0xcaeb('0x11'),_0x1caa8d,_0x1f54a8,_0x4955ab));var _0x920eb4=JSON[_0xcaeb('0x12')](_0x2b998a);_0x920eb4[_0xcaeb('0x13')]=![];_0x920eb4[_0xcaeb('0x14')]=_0x1f54a8;_0x920eb4['machineUuid']=hardware['getUuid']();if(_0xd0e1a8){var _0x5971d6=encryptor[_0xcaeb('0x15')](_0xd0e1a8);_0x920eb4[_0xcaeb('0x16')]=_0x5971d6;_0x920eb4[_0xcaeb('0x17')]=moment(_0x5971d6)[_0xcaeb('0x18')](0x7,_0xcaeb('0x19'))[_0xcaeb('0x10')]();_0x920eb4[_0xcaeb('0x1a')]=_0x920eb4['uuid']!=_0x920eb4[_0xcaeb('0x1b')]?_0xcaeb('0x1c'):_0xcaeb('0x1d');}return _0x920eb4;}catch(_0x215ac8){breakingLicense['uuid']=_0x58ae8a[_0xcaeb('0xc')];breakingLicense[_0xcaeb('0x1e')]=_0x215ac8['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x455668,_0x38e689){getLicense()[_0xcaeb('0xa')](function(_0x3784e9){return db[_0xcaeb('0x1f')][_0xcaeb('0x20')]({'attributes':[_0xcaeb('0x21'),[db[_0xcaeb('0x22')]['fn'](_0xcaeb('0x23'),db[_0xcaeb('0x22')][_0xcaeb('0x24')](_0xcaeb('0x21'))),'count']],'group':'role','where':{'role':{'$or':[_0xcaeb('0x25'),'user',_0xcaeb('0x26')]}},'raw':!![]})['then'](function(_0x580b09){var _0x4f8ae7={'user':_0x3784e9['users']||0x0,'telephone':_0x3784e9[_0xcaeb('0x27')]||0x0};_0x580b09[_0xcaeb('0x28')](function(_0x24136b){var _0x40aefa=_0x24136b['role']===_0xcaeb('0x25')?'user':_0x24136b[_0xcaeb('0x21')];_0x4f8ae7[_0x40aefa]-=_0x24136b[_0xcaeb('0x29')];if(_0x4f8ae7[_0x40aefa]<0x0)_0x4f8ae7[_0x40aefa]=0x0;});_0x455668(_0x4f8ae7);return;});})[_0xcaeb('0xb')](function(_0xdff719){_0x38e689(_0xdff719);});});}function checkUserLimits(_0x5d60e3){return new BPromise(function(_0x4a4834,_0x252b3b){getLimits()['then'](function(_0x2e8f38){var _0x1a4d2d=_[_0xcaeb('0x2a')](_[_0xcaeb('0x2b')](_0x5d60e3,'role'),[_0xcaeb('0x25'),_0xcaeb('0x2c'),_0xcaeb('0x26')]);var _0x4874f1=(_0x1a4d2d['admin']||0x0)+(_0x1a4d2d[_0xcaeb('0x2c')]||0x0);var _0x130808=_0x1a4d2d[_0xcaeb('0x26')]||0x0;if(_0x4874f1>_0x2e8f38['user'])return _0x252b3b(_0xcaeb('0x2d'));if(_0x130808>_0x2e8f38[_0xcaeb('0x26')])return _0x252b3b(_0xcaeb('0x2e'));return _0x4a4834();})[_0xcaeb('0xb')](function(_0x36b74b){_0x252b3b(_0x36b74b);});});}module[_0xcaeb('0x2f')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0x4f67=['defaults','then','catch','license','isEmpty','data1','data2','split','parse','demo','uuid','machineUuid','decryptString','gray','deadline','add','format','changed','disabled','message','User','findAll','role','COUNT','col','count','admin','user','telephone','telephones','forEach','pick','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','moment','bluebird','./hardware','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','License','find'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4f67,0x16d));var _0x74f6=function(_0x29ce14,_0x334166){_0x29ce14=_0x29ce14-0x0;var _0x48f289=_0x4f67[_0x29ce14];return _0x48f289;};'use strict';var util=require(_0x74f6('0x0'));var _=require(_0x74f6('0x1'));var moment=require(_0x74f6('0x2'));var BPromise=require(_0x74f6('0x3'));var hardware=require(_0x74f6('0x4'));var encryptor=require('../../components/encryptor');var db=require(_0x74f6('0x5'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x74f6('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x74f6('0x7'),'machineUuid':hardware[_0x74f6('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x74f6('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','machineUuid':hardware[_0x74f6('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x1bffbc){return new BPromise(function(_0x6f3353,_0x3369bb){return db[_0x74f6('0x9')][_0x74f6('0xa')](_[_0x74f6('0xb')](_0x1bffbc,{'raw':!![],'where':{'id':0x1}}))[_0x74f6('0xc')](function(_0x543bc6){return checkLicense(_0x543bc6,null);})[_0x74f6('0xc')](function(_0x3f5984){_0x6f3353(_0x3f5984);return;})[_0x74f6('0xd')](function(_0x85d296){_0x3369bb(_0x85d296);});});}function checkLicense(_0x37999f,_0x241d50){if(!_0x37999f){demoLicense['uuid']=_0x37999f['data1'];return demoLicense;}try{var _0x1807e7=_0x241d50||_0x37999f[_0x74f6('0xe')];if(_[_0x74f6('0xf')](_0x1807e7)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x6cec18=_0x37999f[_0x74f6('0x10')];var _0x1ec30e=_0x37999f[_0x74f6('0x11')];var _0xaaca99=_0x6cec18[_0x74f6('0x12')]('-')[0x4];var _0x33f0b7=_0x6cec18[_0x74f6('0x12')]('-')[0x0];var _0x5606d6=encryptor['decryptString'](_0x1807e7,util['format']('%s:%s:%s',_0xaaca99,_0x6cec18,_0x33f0b7));var _0xe86906=JSON[_0x74f6('0x13')](_0x5606d6);_0xe86906[_0x74f6('0x14')]=![];_0xe86906[_0x74f6('0x15')]=_0x6cec18;_0xe86906[_0x74f6('0x16')]=hardware['getUuid']();if(_0x1ec30e){var _0x4cfbc2=encryptor[_0x74f6('0x17')](_0x1ec30e);_0xe86906[_0x74f6('0x18')]=_0x4cfbc2;_0xe86906[_0x74f6('0x19')]=moment(_0x4cfbc2)[_0x74f6('0x1a')](0x7,'days')[_0x74f6('0x1b')]();_0xe86906['grayReason']=_0xe86906['uuid']!=_0xe86906[_0x74f6('0x16')]?_0x74f6('0x1c'):_0x74f6('0x1d');}return _0xe86906;}catch(_0x1a3f77){breakingLicense[_0x74f6('0x15')]=_0x37999f[_0x74f6('0x10')];breakingLicense['message']=_0x1a3f77[_0x74f6('0x1e')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x146a33,_0x17e262){getLicense()[_0x74f6('0xc')](function(_0x1d9a35){return db[_0x74f6('0x1f')][_0x74f6('0x20')]({'attributes':[_0x74f6('0x21'),[db['sequelize']['fn'](_0x74f6('0x22'),db['sequelize'][_0x74f6('0x23')](_0x74f6('0x21'))),_0x74f6('0x24')]],'group':_0x74f6('0x21'),'where':{'role':{'$or':[_0x74f6('0x25'),_0x74f6('0x26'),_0x74f6('0x27')]}},'raw':!![]})[_0x74f6('0xc')](function(_0x316870){var _0xa519c3={'user':_0x1d9a35['users']||0x0,'telephone':_0x1d9a35[_0x74f6('0x28')]||0x0};_0x316870[_0x74f6('0x29')](function(_0x9aeee0){var _0x492cf2=_0x9aeee0['role']===_0x74f6('0x25')?_0x74f6('0x26'):_0x9aeee0[_0x74f6('0x21')];_0xa519c3[_0x492cf2]-=_0x9aeee0[_0x74f6('0x24')];if(_0xa519c3[_0x492cf2]<0x0)_0xa519c3[_0x492cf2]=0x0;});_0x146a33(_0xa519c3);return;});})[_0x74f6('0xd')](function(_0x22bd73){_0x17e262(_0x22bd73);});});}function checkUserLimits(_0x37c9ae){return new BPromise(function(_0x304070,_0x5eab4d){getLimits()[_0x74f6('0xc')](function(_0x30a1db){var _0x50d911=_[_0x74f6('0x2a')](_[_0x74f6('0x2b')](_0x37c9ae,_0x74f6('0x21')),[_0x74f6('0x25'),_0x74f6('0x26'),_0x74f6('0x27')]);var _0xedb98e=(_0x50d911['admin']||0x0)+(_0x50d911[_0x74f6('0x26')]||0x0);var _0x3bad5d=_0x50d911[_0x74f6('0x27')]||0x0;if(_0xedb98e>_0x30a1db[_0x74f6('0x26')])return _0x5eab4d(_0x74f6('0x2c'));if(_0x3bad5d>_0x30a1db[_0x74f6('0x27')])return _0x5eab4d(_0x74f6('0x2d'));return _0x304070();})[_0x74f6('0xd')](function(_0x150949){_0x5eab4d(_0x150949);});});}module[_0x74f6('0x2e')]={'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 2e4ae0b..458fc79 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 _0x7334=['myappanuglar-secret','exports','http://localhost:9000'];(function(_0x50f14d,_0x34062a){var _0x2fe324=function(_0x56bcb7){while(--_0x56bcb7){_0x50f14d['push'](_0x50f14d['shift']());}};_0x2fe324(++_0x34062a);}(_0x7334,0x184));var _0x4733=function(_0x13a52e,_0x3cd8bd){_0x13a52e=_0x13a52e-0x0;var _0x1b2732=_0x7334[_0x13a52e];return _0x1b2732;};'use strict';module[_0x4733('0x0')]={'DOMAIN':_0x4733('0x1'),'SESSION_SECRET':_0x4733('0x2'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file +var _0xc2c7=['http://localhost:9000','myappanuglar-secret','app-id','secret'];(function(_0x331886,_0x9df113){var _0x36b2a9=function(_0x16847f){while(--_0x16847f){_0x331886['push'](_0x331886['shift']());}};_0x36b2a9(++_0x9df113);}(_0xc2c7,0x134));var _0x7c2c=function(_0x102b04,_0x17160c){_0x102b04=_0x102b04-0x0;var _0x5d2d4e=_0xc2c7[_0x102b04];return _0x5d2d4e;};'use strict';module['exports']={'DOMAIN':_0x7c2c('0x0'),'SESSION_SECRET':_0x7c2c('0x1'),'GOOGLE_ID':_0x7c2c('0x2'),'GOOGLE_SECRET':_0x7c2c('0x3'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 23bd80a..2c5818f 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xacba=['../utils/loggers','fileLogger'];(function(_0x298e5c,_0x315a25){var _0x33ad31=function(_0x344ac8){while(--_0x344ac8){_0x298e5c['push'](_0x298e5c['shift']());}};_0x33ad31(++_0x315a25);}(_0xacba,0x17a));var _0xaacb=function(_0x4fda6e,_0x2b38ee){_0x4fda6e=_0x4fda6e-0x0;var _0x1a8bba=_0xacba[_0x4fda6e];return _0x1a8bba;};'use strict';var fileLogger=require(_0xaacb('0x0'))[_0xaacb('0x1')];module['exports']=fileLogger; \ No newline at end of file +var _0xbe41=['../utils/loggers','fileLogger','exports'];(function(_0x231f24,_0x248184){var _0xd1d9a0=function(_0x437af2){while(--_0x437af2){_0x231f24['push'](_0x231f24['shift']());}};_0xd1d9a0(++_0x248184);}(_0xbe41,0x1a1));var _0x1be4=function(_0xec8088,_0x5fe409){_0xec8088=_0xec8088-0x0;var _0x44ad57=_0xbe41[_0xec8088];return _0x44ad57;};'use strict';var fileLogger=require(_0x1be4('0x0'))[_0x1be4('0x1')];module[_0x1be4('0x2')]=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index e7fa3b6..e989539 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 _0xb164=['../../services/email/index.js','routing','../../services/routing/index.js','xdr','exports','path','../../config/environment','root','join','../../services/express/index.js','ami','../../services/ami/index.js','agi','email'];(function(_0x581174,_0x41e3ce){var _0x132336=function(_0x4ec49b){while(--_0x4ec49b){_0x581174['push'](_0x581174['shift']());}};_0x132336(++_0x41e3ce);}(_0xb164,0x11d));var _0x4b16=function(_0x2dbe8d,_0x3c517d){_0x2dbe8d=_0x2dbe8d-0x0;var _0x2402c2=_0xb164[_0x2dbe8d];return _0x2402c2;};'use strict';var path=require(_0x4b16('0x0'));var cfg=require(_0x4b16('0x1'));var env={'NODE_PATH':path['resolve'](path['join'](cfg[_0x4b16('0x2')],'legacy-libs'))};var pm2config={'apps':[{'name':'express','script':path[_0x4b16('0x3')](__dirname,_0x4b16('0x4')),'env':env},{'name':_0x4b16('0x5'),'script':path['join'](__dirname,_0x4b16('0x6')),'env':env},{'name':_0x4b16('0x7'),'script':path[_0x4b16('0x3')](__dirname,'../../services/agi/index.js'),'env':env},{'name':_0x4b16('0x8'),'script':path[_0x4b16('0x3')](__dirname,_0x4b16('0x9')),'env':env},{'name':_0x4b16('0xa'),'script':path['join'](__dirname,_0x4b16('0xb')),'env':env},{'name':_0x4b16('0xc'),'script':path['join'](__dirname,'../../services/xdr/index.js'),'env':env}]};module[_0x4b16('0xd')]=pm2config; \ No newline at end of file +var _0x9e54=['../../services/express/index.js','ami','../../services/ami/index.js','agi','../../services/agi/index.js','email','../../services/email/index.js','routing','xdr','../../services/xdr/index.js','exports','path','../../config/environment','resolve','join','legacy-libs','express'];(function(_0x24e05a,_0x36cf4f){var _0x21c536=function(_0x4091fc){while(--_0x4091fc){_0x24e05a['push'](_0x24e05a['shift']());}};_0x21c536(++_0x36cf4f);}(_0x9e54,0x1c5));var _0x49e5=function(_0x487f22,_0x2cc035){_0x487f22=_0x487f22-0x0;var _0x5b8880=_0x9e54[_0x487f22];return _0x5b8880;};'use strict';var path=require(_0x49e5('0x0'));var cfg=require(_0x49e5('0x1'));var env={'NODE_PATH':path[_0x49e5('0x2')](path[_0x49e5('0x3')](cfg['root'],_0x49e5('0x4')))};var pm2config={'apps':[{'name':_0x49e5('0x5'),'script':path[_0x49e5('0x3')](__dirname,_0x49e5('0x6')),'env':env},{'name':_0x49e5('0x7'),'script':path[_0x49e5('0x3')](__dirname,_0x49e5('0x8')),'env':env},{'name':_0x49e5('0x9'),'script':path[_0x49e5('0x3')](__dirname,_0x49e5('0xa')),'env':env},{'name':_0x49e5('0xb'),'script':path[_0x49e5('0x3')](__dirname,_0x49e5('0xc')),'env':env},{'name':_0x49e5('0xd'),'script':path['join'](__dirname,'../../services/routing/index.js'),'env':env},{'name':_0x49e5('0xe'),'script':path['join'](__dirname,_0x49e5('0xf')),'env':env}]};module[_0x49e5('0x10')]=pm2config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index b047e7c..18eee7c 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 _0xa0ac=['disconnect','then','stop','restart','list','describe','delete','dump','saved','pm2','connect','connected'];(function(_0x296e52,_0x428515){var _0x286070=function(_0x35aedf){while(--_0x35aedf){_0x296e52['push'](_0x296e52['shift']());}};_0x286070(++_0x428515);}(_0xa0ac,0xbd));var _0xca0a=function(_0x3f4070,_0x4aaf18){_0x3f4070=_0x3f4070-0x0;var _0x4dc88a=_0xa0ac[_0x3f4070];return _0x4dc88a;};'use strict';var pm2=require(_0xca0a('0x0'));var BPromise=require('bluebird');var config=require('./config');function connect(){return new BPromise(function(_0x24b3ea,_0x4fdd85){return pm2[_0xca0a('0x1')](function(_0x851325){if(_0x851325){return _0x4fdd85(_0x851325);}return _0x24b3ea(_0xca0a('0x2'));});});};exports['start']=function(_0x2e9602){return connect()['then'](function(){return new BPromise(function(_0x4e06aa,_0x1340f1){return pm2['start'](_0x2e9602,function(_0x1fc68f,_0x1b7efd){if(_0x1fc68f){return _0x1340f1(_0x1fc68f);}pm2[_0xca0a('0x3')]();return _0x4e06aa(_0x1b7efd);});});});};exports['stop']=function(_0x3c5418){return connect()[_0xca0a('0x4')](function(){return new BPromise(function(_0x32e599,_0x7e6c64){return pm2[_0xca0a('0x5')](_0x3c5418,function(_0x9c886,_0x182569){if(_0x9c886){return _0x7e6c64(_0x9c886);}pm2[_0xca0a('0x3')]();return _0x32e599(_0x182569);});});});};exports['restart']=function(_0x5aec7d){return connect()[_0xca0a('0x4')](function(){return new BPromise(function(_0x531a91,_0x666270){return pm2[_0xca0a('0x6')](_0x5aec7d,function(_0x31f58c,_0x5653a0){if(_0x31f58c){return _0x666270(_0x31f58c);}pm2[_0xca0a('0x3')]();return _0x531a91(_0x5653a0);});});});};exports[_0xca0a('0x7')]=function(){return connect()['then'](function(){return new BPromise(function(_0x26defa,_0x590f6e){return pm2[_0xca0a('0x7')](function(_0x346882,_0xb906a0){if(_0x346882){return _0x590f6e(_0x346882);}pm2[_0xca0a('0x3')]();return _0x26defa(_0xb906a0);});});});};exports[_0xca0a('0x8')]=function(_0x9b43c6){return connect()[_0xca0a('0x4')](function(){return new BPromise(function(_0x37fa5d,_0x14e555){return pm2[_0xca0a('0x8')](_0x9b43c6,function(_0x5d6632,_0x630df6){if(_0x5d6632){return _0x14e555(_0x5d6632);}pm2[_0xca0a('0x3')]();return _0x37fa5d(_0x630df6);});});});};exports[_0xca0a('0x9')]=function(_0x200ce9){return connect()[_0xca0a('0x4')](function(){return new BPromise(function(_0x44b2b3,_0xbd41ee){return pm2[_0xca0a('0x9')](_0x200ce9,function(_0x18f019,_0xc0aa74){if(_0x18f019){return _0xbd41ee(_0x18f019);}pm2[_0xca0a('0x3')]();return _0x44b2b3(_0xc0aa74);});});});};exports[_0xca0a('0xa')]=function(){return connect()['then'](function(){return new BPromise(function(_0x406193,_0x27eba8){return pm2[_0xca0a('0xa')](function(_0x5088e9){if(_0x5088e9){return _0x27eba8(_0x5088e9);}return _0x406193(_0xca0a('0xb'));});});});}; \ No newline at end of file +var _0x8a58=['then','disconnect','stop','restart','list','describe','delete','dump','saved','pm2','bluebird','./config','connect','connected','start'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8a58,0x1ad));var _0x88a5=function(_0x3a5b4d,_0x32477c){_0x3a5b4d=_0x3a5b4d-0x0;var _0x3b71fd=_0x8a58[_0x3a5b4d];return _0x3b71fd;};'use strict';var pm2=require(_0x88a5('0x0'));var BPromise=require(_0x88a5('0x1'));var config=require(_0x88a5('0x2'));function connect(){return new BPromise(function(_0x547d8e,_0x1837f0){return pm2[_0x88a5('0x3')](function(_0x531c97){if(_0x531c97){return _0x1837f0(_0x531c97);}return _0x547d8e(_0x88a5('0x4'));});});};exports[_0x88a5('0x5')]=function(_0x382038){return connect()[_0x88a5('0x6')](function(){return new BPromise(function(_0x42916c,_0x3c9e93){return pm2['start'](_0x382038,function(_0x4c8a3d,_0x3f1db1){if(_0x4c8a3d){return _0x3c9e93(_0x4c8a3d);}pm2[_0x88a5('0x7')]();return _0x42916c(_0x3f1db1);});});});};exports[_0x88a5('0x8')]=function(_0x3d8805){return connect()['then'](function(){return new BPromise(function(_0x13b334,_0x3a91df){return pm2['stop'](_0x3d8805,function(_0x482840,_0x4679f7){if(_0x482840){return _0x3a91df(_0x482840);}pm2[_0x88a5('0x7')]();return _0x13b334(_0x4679f7);});});});};exports[_0x88a5('0x9')]=function(_0x1fbe7e){return connect()['then'](function(){return new BPromise(function(_0x3bb6e9,_0x4c4c66){return pm2[_0x88a5('0x9')](_0x1fbe7e,function(_0x58c3a0,_0x23e6c3){if(_0x58c3a0){return _0x4c4c66(_0x58c3a0);}pm2[_0x88a5('0x7')]();return _0x3bb6e9(_0x23e6c3);});});});};exports['list']=function(){return connect()['then'](function(){return new BPromise(function(_0x886aba,_0x3192ff){return pm2[_0x88a5('0xa')](function(_0x11f7ca,_0x4777cc){if(_0x11f7ca){return _0x3192ff(_0x11f7ca);}pm2[_0x88a5('0x7')]();return _0x886aba(_0x4777cc);});});});};exports[_0x88a5('0xb')]=function(_0x1e1d75){return connect()[_0x88a5('0x6')](function(){return new BPromise(function(_0x56a270,_0x5d12eb){return pm2[_0x88a5('0xb')](_0x1e1d75,function(_0x593702,_0x42c2fd){if(_0x593702){return _0x5d12eb(_0x593702);}pm2[_0x88a5('0x7')]();return _0x56a270(_0x42c2fd);});});});};exports['delete']=function(_0xa58e00){return connect()[_0x88a5('0x6')](function(){return new BPromise(function(_0x11b06e,_0x284d00){return pm2[_0x88a5('0xc')](_0xa58e00,function(_0x46d096,_0x57500a){if(_0x46d096){return _0x284d00(_0x46d096);}pm2[_0x88a5('0x7')]();return _0x11b06e(_0x57500a);});});});};exports['dump']=function(){return connect()[_0x88a5('0x6')](function(){return new BPromise(function(_0xb0af74,_0x3a9523){return pm2[_0x88a5('0xd')](function(_0x31a2dd){if(_0x31a2dd){return _0x3a9523(_0x31a2dd);}return _0xb0af74(_0x88a5('0xe'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 75646ce..01b5cd9 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 _0x2954=['defaults','localhost','Setting','find','chatTimeout','then','ChatInteraction','lastMsgAt','subtract','minutes','map','info','update','system','timeout','length','chatInteraction:update','catch','error','start','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','redis'];(function(_0x12b683,_0x124186){var _0xfb150b=function(_0x565ce7){while(--_0x565ce7){_0x12b683['push'](_0x12b683['shift']());}};_0xfb150b(++_0x124186);}(_0x2954,0x1e4));var _0x4295=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0x2954[_0x23e7c1];return _0x1add43;};'use strict';var _=require(_0x4295('0x0'));var moment=require(_0x4295('0x1'));var Redis=require(_0x4295('0x2'));var util=require(_0x4295('0x3'));var config=require(_0x4295('0x4'));var db=require(_0x4295('0x5'))['db'];var logger=require(_0x4295('0x6'))(_0x4295('0x7'));config[_0x4295('0x8')]=_[_0x4295('0x9')](config[_0x4295('0x8')],{'host':_0x4295('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function closeInteractions(){var _0x257951=0x0;var _0x1e3f6c=[];return db[_0x4295('0xb')][_0x4295('0xc')]({'raw':!![],'attributes':['id',_0x4295('0xd')],'where':{'id':0x1}})[_0x4295('0xe')](function(_0x212d4d){_0x257951=_0x212d4d[_0x4295('0xd')];if(_0x257951){return db[_0x4295('0xf')]['findAll']({'raw':!![],'attributes':['id',_0x4295('0x10')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x4295('0x11')](_0x212d4d[_0x4295('0xd')],_0x4295('0x12'))}}});}else{return[];}})[_0x4295('0xe')](function(_0x263ca7){if(_0x263ca7&&_0x263ca7['length']){_0x1e3f6c=_[_0x4295('0x13')](_0x263ca7||[],'id');logger[_0x4295('0x14')]('[CHAT]\x20Interactions\x20to\x20close:',_0x1e3f6c['join']());return db[_0x4295('0xf')][_0x4295('0x15')]({'closeReason':_0x4295('0x16'),'disposition':_0x4295('0x17'),'closed':!![],'closedAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x1e3f6c}});}})['then'](function(){if(_0x1e3f6c&&_0x1e3f6c['length']){logger[_0x4295('0x14')]('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x1e3f6c['join']());for(var _0x23f039=0x0;_0x23f039<_0x1e3f6c[_0x4295('0x18')];_0x23f039++){io['emit'](_0x4295('0x19'),{'id':_0x1e3f6c[_0x23f039],'closed':!![]});}}})[_0x4295('0x1a')](function(_0x597b5e){logger[_0x4295('0x1b')]('[CHAT]\x20Error\x20closing\x20interactions',_0x597b5e?util['inspect'](_0x597b5e,{'showHidden':![],'depth':null}):'');});}exports[_0x4295('0x1c')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x720a=['schedule','defaults','redis','localhost','socket.io-emitter','Setting','chatTimeout','then','ChatInteraction','findAll','lastMsgAt','subtract','minutes','map','info','[CHAT]\x20Interactions\x20to\x20close:','system','timeout','length','join','emit','catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','util','../../config/environment','../../mysqldb','../logger'];(function(_0x432fca,_0xb0b1b5){var _0x3adba4=function(_0x5e3ae4){while(--_0x5e3ae4){_0x432fca['push'](_0x432fca['shift']());}};_0x3adba4(++_0xb0b1b5);}(_0x720a,0x17a));var _0xa720=function(_0x411004,_0x5f3515){_0x411004=_0x411004-0x0;var _0x262c27=_0x720a[_0x411004];return _0x262c27;};'use strict';var _=require(_0xa720('0x0'));var moment=require(_0xa720('0x1'));var Redis=require('ioredis');var util=require(_0xa720('0x2'));var config=require(_0xa720('0x3'));var db=require(_0xa720('0x4'))['db'];var logger=require(_0xa720('0x5'))(_0xa720('0x6'));config['redis']=_[_0xa720('0x7')](config[_0xa720('0x8')],{'host':_0xa720('0x9'),'port':0x18eb});var io=require(_0xa720('0xa'))(new Redis(config[_0xa720('0x8')]));function closeInteractions(){var _0x3aef2d=0x0;var _0x45f4de=[];return db[_0xa720('0xb')]['find']({'raw':!![],'attributes':['id',_0xa720('0xc')],'where':{'id':0x1}})[_0xa720('0xd')](function(_0x271cbb){_0x3aef2d=_0x271cbb[_0xa720('0xc')];if(_0x3aef2d){return db[_0xa720('0xe')][_0xa720('0xf')]({'raw':!![],'attributes':['id',_0xa720('0x10')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xa720('0x11')](_0x271cbb[_0xa720('0xc')],_0xa720('0x12'))}}});}else{return[];}})[_0xa720('0xd')](function(_0x28d9e4){if(_0x28d9e4&&_0x28d9e4['length']){_0x45f4de=_[_0xa720('0x13')](_0x28d9e4||[],'id');logger[_0xa720('0x14')](_0xa720('0x15'),_0x45f4de['join']());return db['ChatInteraction']['update']({'closeReason':_0xa720('0x16'),'disposition':_0xa720('0x17'),'closed':!![],'closedAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x45f4de}});}})['then'](function(){if(_0x45f4de&&_0x45f4de[_0xa720('0x18')]){logger['info']('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x45f4de[_0xa720('0x19')]());for(var _0x3cc1a1=0x0;_0x3cc1a1<_0x45f4de[_0xa720('0x18')];_0x3cc1a1++){io[_0xa720('0x1a')]('chatInteraction:update',{'id':_0x45f4de[_0x3cc1a1],'closed':!![]});}}})[_0xa720('0x1b')](function(_0x33bf08){logger[_0xa720('0x1c')](_0xa720('0x1d'),_0x33bf08?util[_0xa720('0x1e')](_0x33bf08,{'showHidden':![],'depth':null}):'');});}exports[_0xa720('0x1f')]=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 8dddd9b..81a4a0d 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 _0xb822=['startAllRefreshIntervals'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb822,0x15b));var _0x2b82=function(_0x7a3355,_0x3390db){_0x7a3355=_0x7a3355-0x0;var _0x11691f=_0xb822[_0x7a3355];return _0x11691f;};'use strict';function start(){var _0x2aa9dd=require('../../api/cloudProvider/cloudProvider.oauth.js');return _0x2aa9dd[_0x2b82('0x0')]();}module['exports']={'intervals':{},'start':start}; \ No newline at end of file +var _0xd879=['../../api/cloudProvider/cloudProvider.oauth.js','exports'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xd879,0x1ac));var _0x9d87=function(_0x349e53,_0x3d67cd){_0x349e53=_0x349e53-0x0;var _0x448e75=_0xd879[_0x349e53];return _0x448e75;};'use strict';function start(){var _0x1fb111=require(_0x9d87('0x0'));return _0x1fb111['startAllRefreshIntervals']();}module[_0x9d87('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 0895140..52289df 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 _0xfc9c=['add','start','deleteJob','length','isBetween','update','update\x20cron','run','util','path','moment','jayson/promise','bluebird','../logger','schedule','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','getSmtpOptions','format','\x22%s\x22\x20<%s>','name','Smtp','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','%s.%s','savename','extname','existsSync','status','Sent','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','attachments','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','stringify','email\x20sent','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','catch','no\x20report\x20id','Schedule','MailServerOut','CloudProvider','keys','jobs','toString','keyBy','difference','intersection','exists','stop','delete\x20cron','toRun','index','my\x20id','run\x20job','cron','active','startAt','endAt'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfc9c,0xb4));var _0xcfc9=function(_0x155003,_0x1e9d08){_0x155003=_0x155003-0x0;var _0xf696ab=_0xfc9c[_0x155003];return _0xf696ab;};'use strict';var fs=require('fs');var util=require(_0xcfc9('0x0'));var path=require(_0xcfc9('0x1'));var _=require('lodash');var moment=require(_0xcfc9('0x2'));var CronJobManager=require('cron-job-manager');var jayson=require(_0xcfc9('0x3'));var BPromise=require(_0xcfc9('0x4'));var logger=require(_0xcfc9('0x5'))(_0xcfc9('0x6'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0xcfc9('0x7'));var analyticDefaultReportController=require(_0xcfc9('0x8'));var client=jayson[_0xcfc9('0x9')][_0xcfc9('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x5dd399,_0x5d6694){return function(){logger[_0xcfc9('0xb')](_0xcfc9('0xc'),_0x5dd399[_0xcfc9('0xd')]);var _0x5352ee=!![];var _0x4cea66=_0x5dd399[_0xcfc9('0xe')][_0xcfc9('0xf')]();var _0x1f2985={'account':_0x4cea66,'message':{'from':util[_0xcfc9('0x10')](_0xcfc9('0x11'),_0x5dd399['MailAccount'][_0xcfc9('0x12')],_0x5dd399['MailAccount']['email']||_0x5dd399[_0xcfc9('0xe')][_0xcfc9('0x13')]['user']),'to':_0x5dd399[_0xcfc9('0xd')],'cc':_0x5dd399['cc'],'bcc':_0x5dd399[_0xcfc9('0x14')],'subject':util['format'](_0xcfc9('0x15'),_0x5d6694[_0xcfc9('0x12')],_0x5dd399[_0xcfc9('0x16')],_0x5dd399[_0xcfc9('0x17')])}};var _0x224349=path[_0xcfc9('0x18')](__dirname,_0xcfc9('0x19'));var _0x4605a6=_0x5d6694['savename'];var _0x21b8ed=util['format'](_0xcfc9('0x1a'),path['basename'](_0x5d6694[_0xcfc9('0x1b')],path[_0xcfc9('0x1c')](_0x5d6694[_0xcfc9('0x1b')])),'zip');var _0x470a59=path['join'](_0x224349,_0x4605a6);var _0xf0c03b=path[_0xcfc9('0x18')](_0x224349,_0x21b8ed);if(fs[_0xcfc9('0x1d')](_0x470a59)){_0x5d6694[_0xcfc9('0x1e')]=_0xcfc9('0x1f');_0x1f2985[_0xcfc9('0x20')]['attachments']=[{'filename':_0x4605a6,'path':_0x470a59}];_0x1f2985[_0xcfc9('0x20')][_0xcfc9('0x21')]=util['format'](_0xcfc9('0x22'),JSON['stringify'](_0x5d6694,null,0x2));}else if(fs[_0xcfc9('0x1d')](_0xf0c03b)){_0x5d6694[_0xcfc9('0x1e')]=_0xcfc9('0x1f');_0x1f2985[_0xcfc9('0x20')][_0xcfc9('0x23')]=[{'filename':_0x21b8ed,'path':_0xf0c03b}];}else{_0x1f2985['message'][_0xcfc9('0x21')]=_0xcfc9('0x24');if(!_0x5dd399[_0xcfc9('0x25')]){_0x5352ee=![];logger[_0xcfc9('0xb')](_0xcfc9('0x26'));}}if(_0x5352ee){return client[_0xcfc9('0x27')](_0xcfc9('0x28'),_0x1f2985)[_0xcfc9('0x29')](function(_0x65c45f){if(_0x65c45f[_0xcfc9('0x2a')]){return logger[_0xcfc9('0x2a')](_0xcfc9('0x2b'),JSON[_0xcfc9('0x2c')](_0x65c45f));}return logger[_0xcfc9('0xb')](_0xcfc9('0x2d'));})['catch'](function(_0x5a68f1){return logger[_0xcfc9('0x2a')]('error\x20mail',JSON[_0xcfc9('0x2c')](_0x5a68f1));});}};}function handleError(){return function(_0x148f5f){return logger[_0xcfc9('0x2a')](JSON['stringify'](_0x148f5f));};}function handleResult(_0x3bd189){return function(_0x5b02cf){logger[_0xcfc9('0xb')](_0xcfc9('0x2e'),JSON[_0xcfc9('0x2c')](_0x5b02cf));if(_0x3bd189[_0xcfc9('0xe')]&&_0x3bd189['MailAccount']['Smtp']&&!_['isNil'](_0x3bd189['email'])){setTimeout(handleSendEmail(_0x3bd189,_0x5b02cf),0x3c*0x3e8);}};}function handleJob(_0x2f75fb){return function(){try{if(_[_0xcfc9('0x2f')](_0x2f75fb['subtractNumber'])){return logger[_0xcfc9('0xb')](_0xcfc9('0x30'));}if(_[_0xcfc9('0x2f')](_0x2f75fb[_0xcfc9('0x17')])){return logger[_0xcfc9('0xb')](_0xcfc9('0x31'));}var _0x4bca83={'startDate':moment()['subtract'](_0x2f75fb[_0xcfc9('0x16')],_0x2f75fb['subtractUnit'])['format'](_0xcfc9('0x32')),'endDate':moment()['format'](_0xcfc9('0x32')),'type':'scheduled','output':_0x2f75fb[_0xcfc9('0x33')],'name':_0x2f75fb['name']};if(!_['isNil'](_0x2f75fb[_0xcfc9('0x34')])){logger['info'](_0xcfc9('0x35'),_0x2f75fb['DefaultReportId']);return analyticDefaultReportController[_0xcfc9('0x36')]({'id':_0x2f75fb[_0xcfc9('0x34')]},_0x4bca83)[_0xcfc9('0x29')](handleResult(_0x2f75fb))['catch'](handleError());}if(!_[_0xcfc9('0x2f')](_0x2f75fb[_0xcfc9('0x37')])){logger['info']('exec\x20custom\x20report\x20id:%s',_0x2f75fb[_0xcfc9('0x37')]);return analyticCustomReportController[_0xcfc9('0x36')]({'id':_0x2f75fb['CustomReportId']},_0x4bca83)[_0xcfc9('0x29')](handleResult(_0x2f75fb))[_0xcfc9('0x38')](handleError());}}catch(_0x34fa10){logger['error'](JSON[_0xcfc9('0x2c')](_0x34fa10));}return logger[_0xcfc9('0xb')](_0xcfc9('0x39'));};}function getJobs(_0x47d49e){var _0x7fba01={};if(_0x47d49e){_0x7fba01['id']=_0x47d49e;}return db[_0xcfc9('0x3a')]['findAll']({'where':_0x7fba01,'include':[{'model':db[_0xcfc9('0xe')],'attributes':['id',_0xcfc9('0x12'),_0xcfc9('0xd')],'include':[{'model':db[_0xcfc9('0x3b')],'as':_0xcfc9('0x13'),'include':[{'model':db['CloudProvider'],'as':_0xcfc9('0x3c')}]}]}]})['then'](function(_0x20e7bb){var _0x53a172=_[_0xcfc9('0x3d')](manager[_0xcfc9('0x3e')]);var _0x110148=_['map'](_0x20e7bb,function(_0x352b74){return _0x352b74['id'][_0xcfc9('0x3f')]();});var _0x1eb041=_[_0xcfc9('0x40')](_0x20e7bb,function(_0x1db31c){return _0x1db31c['id']['toString']();});var _0x5ed0fe=_0x47d49e?_0x110148:_[_0xcfc9('0x41')](_0x110148,_0x53a172);var _0x5ecb6f=_[_0xcfc9('0x42')](_0x110148,_0x53a172);var _0xa6081d=_[_0xcfc9('0x41')](_0x53a172,_0x110148);var _0x5ebcb9;var _0x4aad4a;for(_0x5ebcb9=0x0;_0x5ebcb9<_0xa6081d['length']&&!_0x47d49e;_0x5ebcb9+=0x1){_0x4aad4a=_0xa6081d[_0x5ebcb9][_0xcfc9('0x3f')]();if(manager[_0xcfc9('0x43')](_0x4aad4a)){manager[_0xcfc9('0x44')](_0x4aad4a);manager['deleteJob'](_0x4aad4a);logger[_0xcfc9('0xb')](_0xcfc9('0x45'),_0x4aad4a);}}logger['info'](_0xcfc9('0x46'),JSON[_0xcfc9('0x2c')](_0x5ed0fe));for(_0x5ebcb9=0x0;_0x5ebcb9<_0x5ed0fe['length'];_0x5ebcb9+=0x1){_0x4aad4a=_0x5ed0fe[_0x5ebcb9][_0xcfc9('0x3f')]();logger[_0xcfc9('0xb')](_0xcfc9('0x47'),_0x4aad4a);if(_0x47d49e){logger[_0xcfc9('0xb')](_0xcfc9('0x48'),_0x47d49e);logger[_0xcfc9('0xb')](JSON[_0xcfc9('0x2c')](_0x1eb041[_0x4aad4a]));BPromise['resolve']()[_0xcfc9('0x29')](handleJob(_0x1eb041[_0x4aad4a]));logger[_0xcfc9('0xb')](_0xcfc9('0x49'),_0x1eb041[_0x4aad4a][_0xcfc9('0x12')],_0x1eb041[_0x4aad4a]['cron']);}else if(_0x1eb041[_0x4aad4a][_0xcfc9('0x4a')]&&_0x1eb041[_0x4aad4a][_0xcfc9('0x4b')]&&moment()['isBetween'](_0x1eb041[_0x4aad4a][_0xcfc9('0x4c')],_0x1eb041[_0x4aad4a][_0xcfc9('0x4d')])){manager[_0xcfc9('0x4e')](_0x4aad4a,_0x1eb041[_0x4aad4a]['cron'],handleJob(_0x1eb041[_0x4aad4a]));manager[_0xcfc9('0x4f')](_0x4aad4a);logger[_0xcfc9('0xb')]('add\x20cron',_0x1eb041[_0x4aad4a]['name'],_0x1eb041[_0x4aad4a][_0xcfc9('0x4a')]);}else if(manager[_0xcfc9('0x43')](_0x4aad4a)){manager['stop'](_0x4aad4a);manager[_0xcfc9('0x50')](_0x4aad4a);logger['info']('stop\x20cron',_0x1eb041[_0x4aad4a][_0xcfc9('0x12')],_0x1eb041[_0x4aad4a]['cron']);}}for(_0x5ebcb9=0x0,_0x4aad4a;_0x5ebcb9<_0x5ecb6f[_0xcfc9('0x51')]&&!_0x47d49e;_0x5ebcb9+=0x1){_0x4aad4a=_0x5ecb6f[_0x5ebcb9][_0xcfc9('0x3f')]();if(manager['exists'](_0x4aad4a)){if(_0x1eb041[_0x4aad4a]['cron']&&_0x1eb041[_0x4aad4a]['active']&&moment()[_0xcfc9('0x52')](_0x1eb041[_0x4aad4a][_0xcfc9('0x4c')],_0x1eb041[_0x4aad4a]['endAt'])){manager[_0xcfc9('0x53')](_0x4aad4a,_0x1eb041[_0x4aad4a][_0xcfc9('0x4a')],handleJob(_0x1eb041[_0x4aad4a]));logger[_0xcfc9('0xb')](_0xcfc9('0x54'),_0x1eb041[_0x4aad4a]['name'],_0x1eb041[_0x4aad4a][_0xcfc9('0x4a')]);}else{manager[_0xcfc9('0x44')](_0x4aad4a);manager[_0xcfc9('0x50')](_0x4aad4a);logger[_0xcfc9('0xb')]('stop\x20cron',_0x1eb041[_0x4aad4a]['name'],_0x1eb041[_0x4aad4a][_0xcfc9('0x4a')]);}}}})[_0xcfc9('0x38')](function(_0x2308da){logger[_0xcfc9('0x2a')](JSON[_0xcfc9('0x2c')](_0x2308da));});}exports[_0xcfc9('0x55')]=function(_0x10dcbe){return getJobs(_0x10dcbe);};exports[_0xcfc9('0x4f')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x5717=['subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','Schedule','MailServerOut','CloudProvider','jobs','map','keyBy','toString','intersection','length','exists','deleteJob','delete\x20cron','toRun','index','my\x20id','resolve','cron','active','isBetween','endAt','add','start','stop','startAt','update','run','util','path','lodash','cron-job-manager','jayson/promise','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','format','\x22%s\x22\x20<%s>','name','Smtp','user','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','savename','basename','extname','zip','existsSync','Sent','message','attachments','text','stringify','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','then','error','error\x20mail','email\x20sent','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined'];(function(_0x4a54a5,_0x1390d3){var _0x2e4cea=function(_0x2c2ea3){while(--_0x2c2ea3){_0x4a54a5['push'](_0x4a54a5['shift']());}};_0x2e4cea(++_0x1390d3);}(_0x5717,0x73));var _0x7571=function(_0x2bc58f,_0x3d3cbe){_0x2bc58f=_0x2bc58f-0x0;var _0x359217=_0x5717[_0x2bc58f];return _0x359217;};'use strict';var fs=require('fs');var util=require(_0x7571('0x0'));var path=require(_0x7571('0x1'));var _=require(_0x7571('0x2'));var moment=require('moment');var CronJobManager=require(_0x7571('0x3'));var jayson=require(_0x7571('0x4'));var BPromise=require('bluebird');var logger=require('../logger')(_0x7571('0x5'));var db=require(_0x7571('0x6'))['db'];var analyticCustomReportController=require(_0x7571('0x7'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0x7571('0x8')][_0x7571('0x9')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x7ba8c5,_0x3f2053){return function(){logger[_0x7571('0xa')](_0x7571('0xb'),_0x7ba8c5[_0x7571('0xc')]);var _0x661ba8=!![];var _0x3f2e3e=_0x7ba8c5[_0x7571('0xd')]['getSmtpOptions']();var _0x1a0159={'account':_0x3f2e3e,'message':{'from':util[_0x7571('0xe')](_0x7571('0xf'),_0x7ba8c5[_0x7571('0xd')][_0x7571('0x10')],_0x7ba8c5[_0x7571('0xd')][_0x7571('0xc')]||_0x7ba8c5[_0x7571('0xd')][_0x7571('0x11')][_0x7571('0x12')]),'to':_0x7ba8c5[_0x7571('0xc')],'cc':_0x7ba8c5['cc'],'bcc':_0x7ba8c5['bcc'],'subject':util[_0x7571('0xe')](_0x7571('0x13'),_0x3f2053['name'],_0x7ba8c5[_0x7571('0x14')],_0x7ba8c5[_0x7571('0x15')])}};var _0x5b2818=path[_0x7571('0x16')](__dirname,_0x7571('0x17'));var _0x152d64=_0x3f2053[_0x7571('0x18')];var _0x81b8e1=util['format']('%s.%s',path[_0x7571('0x19')](_0x3f2053['savename'],path[_0x7571('0x1a')](_0x3f2053['savename'])),_0x7571('0x1b'));var _0x1fcd20=path[_0x7571('0x16')](_0x5b2818,_0x152d64);var _0x513656=path['join'](_0x5b2818,_0x81b8e1);if(fs[_0x7571('0x1c')](_0x1fcd20)){_0x3f2053['status']=_0x7571('0x1d');_0x1a0159[_0x7571('0x1e')][_0x7571('0x1f')]=[{'filename':_0x152d64,'path':_0x1fcd20}];_0x1a0159[_0x7571('0x1e')][_0x7571('0x20')]=util['format']('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON[_0x7571('0x21')](_0x3f2053,null,0x2));}else if(fs[_0x7571('0x1c')](_0x513656)){_0x3f2053['status']=_0x7571('0x1d');_0x1a0159['message'][_0x7571('0x1f')]=[{'filename':_0x81b8e1,'path':_0x513656}];}else{_0x1a0159[_0x7571('0x1e')]['text']=_0x7571('0x22');if(!_0x7ba8c5[_0x7571('0x23')]){_0x661ba8=![];logger[_0x7571('0xa')](_0x7571('0x24'));}}if(_0x661ba8){return client[_0x7571('0x25')]('SendMail',_0x1a0159)[_0x7571('0x26')](function(_0x12b385){if(_0x12b385[_0x7571('0x27')]){return logger[_0x7571('0x27')](_0x7571('0x28'),JSON[_0x7571('0x21')](_0x12b385));}return logger[_0x7571('0xa')](_0x7571('0x29'));})[_0x7571('0x2a')](function(_0x4d35d6){return logger[_0x7571('0x27')](_0x7571('0x28'),JSON[_0x7571('0x21')](_0x4d35d6));});}};}function handleError(){return function(_0x551f14){return logger[_0x7571('0x27')](JSON[_0x7571('0x21')](_0x551f14));};}function handleResult(_0x5e0cae){return function(_0x7d36c8){logger[_0x7571('0xa')](_0x7571('0x2b'),JSON['stringify'](_0x7d36c8));if(_0x5e0cae['MailAccount']&&_0x5e0cae['MailAccount'][_0x7571('0x11')]&&!_[_0x7571('0x2c')](_0x5e0cae[_0x7571('0xc')])){setTimeout(handleSendEmail(_0x5e0cae,_0x7d36c8),0x3c*0x3e8);}};}function handleJob(_0x507ca3){return function(){try{if(_['isNil'](_0x507ca3[_0x7571('0x14')])){return logger[_0x7571('0xa')](_0x7571('0x2d'));}if(_[_0x7571('0x2c')](_0x507ca3[_0x7571('0x15')])){return logger['info'](_0x7571('0x2e'));}var _0x5b9561={'startDate':moment()[_0x7571('0x2f')](_0x507ca3['subtractNumber'],_0x507ca3[_0x7571('0x15')])[_0x7571('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0x7571('0xe')](_0x7571('0x30')),'type':_0x7571('0x31'),'output':_0x507ca3[_0x7571('0x32')],'name':_0x507ca3[_0x7571('0x10')]};if(!_[_0x7571('0x2c')](_0x507ca3[_0x7571('0x33')])){logger[_0x7571('0xa')]('exec\x20defaul\x20report\x20id:%s',_0x507ca3[_0x7571('0x33')]);return analyticDefaultReportController[_0x7571('0x34')]({'id':_0x507ca3[_0x7571('0x33')]},_0x5b9561)[_0x7571('0x26')](handleResult(_0x507ca3))[_0x7571('0x2a')](handleError());}if(!_['isNil'](_0x507ca3[_0x7571('0x35')])){logger[_0x7571('0xa')](_0x7571('0x36'),_0x507ca3[_0x7571('0x35')]);return analyticCustomReportController['runReport']({'id':_0x507ca3['CustomReportId']},_0x5b9561)[_0x7571('0x26')](handleResult(_0x507ca3))['catch'](handleError());}}catch(_0x14164e){logger['error'](JSON['stringify'](_0x14164e));}return logger['info']('no\x20report\x20id');};}function getJobs(_0x49f034){var _0x2284eb={};if(_0x49f034){_0x2284eb['id']=_0x49f034;}return db[_0x7571('0x37')]['findAll']({'where':_0x2284eb,'include':[{'model':db['MailAccount'],'attributes':['id',_0x7571('0x10'),'email'],'include':[{'model':db[_0x7571('0x38')],'as':_0x7571('0x11'),'include':[{'model':db[_0x7571('0x39')],'as':_0x7571('0x39')}]}]}]})[_0x7571('0x26')](function(_0x473843){var _0x56b58d=_['keys'](manager[_0x7571('0x3a')]);var _0x3041ea=_[_0x7571('0x3b')](_0x473843,function(_0x4a5ee2){return _0x4a5ee2['id']['toString']();});var _0x2574d4=_[_0x7571('0x3c')](_0x473843,function(_0x552709){return _0x552709['id'][_0x7571('0x3d')]();});var _0x1f57d4=_0x49f034?_0x3041ea:_['difference'](_0x3041ea,_0x56b58d);var _0x2d06fd=_[_0x7571('0x3e')](_0x3041ea,_0x56b58d);var _0x32b652=_['difference'](_0x56b58d,_0x3041ea);var _0x45402f;var _0x1d4ac7;for(_0x45402f=0x0;_0x45402f<_0x32b652[_0x7571('0x3f')]&&!_0x49f034;_0x45402f+=0x1){_0x1d4ac7=_0x32b652[_0x45402f]['toString']();if(manager[_0x7571('0x40')](_0x1d4ac7)){manager['stop'](_0x1d4ac7);manager[_0x7571('0x41')](_0x1d4ac7);logger[_0x7571('0xa')](_0x7571('0x42'),_0x1d4ac7);}}logger[_0x7571('0xa')](_0x7571('0x43'),JSON['stringify'](_0x1f57d4));for(_0x45402f=0x0;_0x45402f<_0x1f57d4['length'];_0x45402f+=0x1){_0x1d4ac7=_0x1f57d4[_0x45402f][_0x7571('0x3d')]();logger[_0x7571('0xa')](_0x7571('0x44'),_0x1d4ac7);if(_0x49f034){logger[_0x7571('0xa')](_0x7571('0x45'),_0x49f034);logger[_0x7571('0xa')](JSON['stringify'](_0x2574d4[_0x1d4ac7]));BPromise[_0x7571('0x46')]()['then'](handleJob(_0x2574d4[_0x1d4ac7]));logger[_0x7571('0xa')]('run\x20job',_0x2574d4[_0x1d4ac7][_0x7571('0x10')],_0x2574d4[_0x1d4ac7][_0x7571('0x47')]);}else if(_0x2574d4[_0x1d4ac7][_0x7571('0x47')]&&_0x2574d4[_0x1d4ac7][_0x7571('0x48')]&&moment()[_0x7571('0x49')](_0x2574d4[_0x1d4ac7]['startAt'],_0x2574d4[_0x1d4ac7][_0x7571('0x4a')])){manager[_0x7571('0x4b')](_0x1d4ac7,_0x2574d4[_0x1d4ac7]['cron'],handleJob(_0x2574d4[_0x1d4ac7]));manager[_0x7571('0x4c')](_0x1d4ac7);logger['info']('add\x20cron',_0x2574d4[_0x1d4ac7][_0x7571('0x10')],_0x2574d4[_0x1d4ac7][_0x7571('0x47')]);}else if(manager['exists'](_0x1d4ac7)){manager[_0x7571('0x4d')](_0x1d4ac7);manager[_0x7571('0x41')](_0x1d4ac7);logger[_0x7571('0xa')]('stop\x20cron',_0x2574d4[_0x1d4ac7][_0x7571('0x10')],_0x2574d4[_0x1d4ac7]['cron']);}}for(_0x45402f=0x0,_0x1d4ac7;_0x45402f<_0x2d06fd[_0x7571('0x3f')]&&!_0x49f034;_0x45402f+=0x1){_0x1d4ac7=_0x2d06fd[_0x45402f][_0x7571('0x3d')]();if(manager[_0x7571('0x40')](_0x1d4ac7)){if(_0x2574d4[_0x1d4ac7][_0x7571('0x47')]&&_0x2574d4[_0x1d4ac7][_0x7571('0x48')]&&moment()['isBetween'](_0x2574d4[_0x1d4ac7][_0x7571('0x4e')],_0x2574d4[_0x1d4ac7][_0x7571('0x4a')])){manager[_0x7571('0x4f')](_0x1d4ac7,_0x2574d4[_0x1d4ac7][_0x7571('0x47')],handleJob(_0x2574d4[_0x1d4ac7]));logger['info']('update\x20cron',_0x2574d4[_0x1d4ac7][_0x7571('0x10')],_0x2574d4[_0x1d4ac7][_0x7571('0x47')]);}else{manager['stop'](_0x1d4ac7);manager[_0x7571('0x41')](_0x1d4ac7);logger[_0x7571('0xa')]('stop\x20cron',_0x2574d4[_0x1d4ac7][_0x7571('0x10')],_0x2574d4[_0x1d4ac7]['cron']);}}}})[_0x7571('0x2a')](function(_0x31a270){logger[_0x7571('0x27')](JSON[_0x7571('0x21')](_0x31a270));});}exports[_0x7571('0x50')]=function(_0x2dba96){return getJobs(_0x2dba96);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file diff --git a/server/config/schedule/transcribe.js b/server/config/schedule/transcribe.js index 7b671ed..e172bdc 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 _0x75ea=['data2','transcribeName','then','format','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','TranscriptFileUri','results','transcripts','length','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentimentAccountId','sentimentRegion','language','bucket','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Mixed','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','sentiment','Cloud\x20Provider\x20not\x20configured','Negative','Neutral','COMPLETED','catch','name','SequelizeValidationError','error','inspect','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Settings\x20not\x20available','transcribeAccountId','transcribeRegion','Transcribe\x20not\x20configured','push','all','lodash','aws-sdk','util','bluebird','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','info','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','data1'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x75ea,0x7d));var _0xa75e=function(_0x5171ba,_0x45fdfc){_0x5171ba=_0x5171ba-0x0;var _0x2c4252=_0x75ea[_0x5171ba];return _0x2c4252;};var _=require(_0xa75e('0x0'));var AWS=require(_0xa75e('0x1'));var rp=require('request-promise');var util=require(_0xa75e('0x2'));var BPromise=require(_0xa75e('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0xa75e('0x4'))(_0xa75e('0x5'));function getTranscriptionJob(_0x446097,_0x1255c3,_0x201f4b,_0x4d6703){return new Promise(function(_0x2a3364,_0x1f9627){var _0x1f666f=new AWS[(_0xa75e('0x6'))]({'accessKeyId':_0x1255c3,'secretAccessKey':_0x446097,'region':_0x201f4b});_0x1f666f[_0xa75e('0x7')]({'TranscriptionJobName':_0x4d6703},function(_0x31a28d,_0x351164){if(_0x31a28d){return _0x1f9627(_0x31a28d);}else{return _0x2a3364(_0x351164);}});});}function sentiment(_0x493f46,_0x4ecc87,_0x560baa,_0x5c2c35,_0x39aab0){return new Promise(function(_0x568154,_0x245dd2){var _0x495157=new AWS[(_0xa75e('0x8'))]({'accessKeyId':_0x4ecc87,'secretAccessKey':_0x493f46,'region':_0x560baa});_0x495157[_0xa75e('0x9')]({'Text':_0x5c2c35,'LanguageCode':_0x39aab0['substring'](0x0,0x2)},function(_0x20b79b,_0x259e8c){if(_0x20b79b){return _0x245dd2(_0x20b79b);}else{return _0x568154(_0x259e8c);}});});}function checkTranscribeJob(_0x38dce8,_0x35c81b,_0x46d808){var _0x3d01eb;return new BPromise(function(_0x164ccb,_0x242ade){logger[_0xa75e('0xa')](util['format'](_0xa75e('0xb'),_0x38dce8['id'],_0x38dce8['transcribeName']));return getTranscriptionJob(_0x46d808[_0xa75e('0xc')],_0x46d808[_0xa75e('0xd')],_0x35c81b['transcribeRegion'],_0x38dce8[_0xa75e('0xe')])[_0xa75e('0xf')](function(_0x1d78ce){logger['info'](util[_0xa75e('0x10')](_0xa75e('0x11'),_0x38dce8['id'],_0x38dce8[_0xa75e('0xe')],_0x1d78ce[_0xa75e('0x12')][_0xa75e('0x13')]));if(!_0x38dce8[_0xa75e('0x14')]){switch(_0x1d78ce[_0xa75e('0x12')][_0xa75e('0x13')]){case'COMPLETED':var _0x280491={'transcribeStatus':_0x1d78ce[_0xa75e('0x12')][_0xa75e('0x13')],'fileUri':_0x1d78ce['TranscriptionJob']['Transcript'][_0xa75e('0x15')]};logger['info'](util['format']('[RECORDING:%d]\x20Get\x20transcript',_0x38dce8['id']));return rp({'uri':_0x1d78ce[_0xa75e('0x12')]['Transcript'][_0xa75e('0x15')],'json':!![]})['then'](function(_0x32766b){logger[_0xa75e('0xa')](util[_0xa75e('0x10')]('[RECORDING:%d]\x20Transcript\x20downloaded',_0x38dce8['id']));if(_0x32766b&&_0x32766b[_0xa75e('0x16')]&&_0x32766b[_0xa75e('0x16')][_0xa75e('0x17')]&&_0x32766b['results'][_0xa75e('0x17')][_0xa75e('0x18')]){_0x280491[_0xa75e('0x14')]='';for(var _0x9add90=0x0;_0x9add90<_0x32766b[_0xa75e('0x16')][_0xa75e('0x17')][_0xa75e('0x18')];_0x9add90++){_0x280491[_0xa75e('0x14')]+=_0x32766b[_0xa75e('0x16')]['transcripts'][_0x9add90]['transcript']+'';}}return _0x38dce8[_0xa75e('0x19')](_0x280491);})[_0xa75e('0xf')](function(){logger['info'](util[_0xa75e('0x10')](_0xa75e('0x1a'),_0x38dce8['id']));if(!_0x38dce8[_0xa75e('0x1b')]){throw new db[(_0xa75e('0x1c'))][(_0xa75e('0x1d'))](_0xa75e('0x1e'));}if(!_0x35c81b['sentiment']||!_0x35c81b[_0xa75e('0x1f')]||!_0x35c81b[_0xa75e('0x20')]||!_0x35c81b[_0xa75e('0x21')]||!_0x35c81b[_0xa75e('0x22')]){throw new db[(_0xa75e('0x1c'))]['ValidationError'](_0xa75e('0x23'));}if(!_0x280491['fileText']){throw new Error('Transcript\x20not\x20available');}if(_0x35c81b[_0xa75e('0x1f')]===_0x46d808['id']){return _0x46d808;}else{return db[_0xa75e('0x24')][_0xa75e('0x25')]({'where':{'id':_settings[_0xa75e('0x1f')]}});}})[_0xa75e('0xf')](function(_0xf091d7){if(!_0xf091d7){throw new db[(_0xa75e('0x1c'))][(_0xa75e('0x1d'))](_0xa75e('0x26'));}if(!_0xf091d7[_0xa75e('0xc')]||!_0xf091d7[_0xa75e('0xd')]){throw new db[(_0xa75e('0x1c'))][(_0xa75e('0x1d'))]('Cloud\x20Provider\x20not\x20configured');}_0x3d01eb=_0xf091d7;logger[_0xa75e('0xa')](util[_0xa75e('0x10')](_0xa75e('0x27'),_0x38dce8['id']));return sentiment(_0x3d01eb[_0xa75e('0xc')],_0x3d01eb[_0xa75e('0xd')],_0x35c81b[_0xa75e('0x20')],_0x280491['fileText'],_0x35c81b['language']);})['then'](function(_0x2c560c){logger['info'](util['format'](_0xa75e('0x28'),_0x38dce8['id']));return _0x38dce8['update']({'sentiment':_0x2c560c[_0xa75e('0x29')],'sPositive':_0x2c560c[_0xa75e('0x2a')][_0xa75e('0x2b')],'sNegative':_0x2c560c[_0xa75e('0x2a')]['Negative'],'sMixed':_0x2c560c[_0xa75e('0x2a')][_0xa75e('0x2c')],'sNeutral':_0x2c560c[_0xa75e('0x2a')]['Neutral']});})['then'](function(){logger[_0xa75e('0xa')](util[_0xa75e('0x10')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x38dce8['id']));_0x164ccb();});case _0xa75e('0x2d'):return _0x38dce8[_0xa75e('0x19')]({'transcribeStatus':'FAILED','failureReason':_0x1d78ce[_0xa75e('0x12')][_0xa75e('0x2e')]})['then'](function(){logger[_0xa75e('0xa')](util[_0xa75e('0x10')](_0xa75e('0x1a'),_0x38dce8['id']));_0x164ccb();});default:logger['info'](util[_0xa75e('0x10')](_0xa75e('0x2f'),_0x38dce8['id']));break;}}else{return BPromise[_0xa75e('0x30')]()[_0xa75e('0xf')](function(){if(!_0x38dce8[_0xa75e('0x1b')]){throw new db['Sequelize'][(_0xa75e('0x1d'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x35c81b[_0xa75e('0x31')]||!_0x35c81b[_0xa75e('0x1f')]||!_0x35c81b[_0xa75e('0x20')]||!_0x35c81b[_0xa75e('0x21')]||!_0x35c81b[_0xa75e('0x22')]){throw new db['Sequelize'][(_0xa75e('0x1d'))](_0xa75e('0x23'));}if(!_0x38dce8[_0xa75e('0x14')]){throw new Error('Transcript\x20not\x20available');}if(_0x35c81b[_0xa75e('0x1f')]===_0x46d808['id']){return _0x46d808;}else{return db[_0xa75e('0x24')]['findOne']({'where':{'id':_settings[_0xa75e('0x1f')]}});}})[_0xa75e('0xf')](function(_0x554179){if(!_0x554179){throw new db[(_0xa75e('0x1c'))][(_0xa75e('0x1d'))](_0xa75e('0x26'));}if(!_0x554179[_0xa75e('0xc')]||!_0x554179[_0xa75e('0xd')]){throw new db[(_0xa75e('0x1c'))]['ValidationError'](_0xa75e('0x32'));}_0x3d01eb=_0x554179;logger[_0xa75e('0xa')](util[_0xa75e('0x10')](_0xa75e('0x27'),_0x38dce8['id']));return sentiment(_0x3d01eb['data1'],_0x3d01eb['data2'],_0x35c81b['sentimentRegion'],_0x38dce8[_0xa75e('0x14')],_0x35c81b[_0xa75e('0x21')]);})[_0xa75e('0xf')](function(_0x355017){logger['info'](util[_0xa75e('0x10')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x38dce8['id']));return _0x38dce8[_0xa75e('0x19')]({'sentiment':_0x355017[_0xa75e('0x29')],'sPositive':_0x355017[_0xa75e('0x2a')]['Positive'],'sNegative':_0x355017[_0xa75e('0x2a')][_0xa75e('0x33')],'sMixed':_0x355017['SentimentScore'][_0xa75e('0x2c')],'sNeutral':_0x355017[_0xa75e('0x2a')][_0xa75e('0x34')],'transcribeStatus':_0xa75e('0x35')});})['then'](function(){logger[_0xa75e('0xa')](util[_0xa75e('0x10')](_0xa75e('0x1a'),_0x38dce8['id']));_0x164ccb();});}})[_0xa75e('0x36')](function(_0x5b184d){if(_0x5b184d){if(!_0x5b184d[_0xa75e('0x37')]||_0x5b184d['name']!==_0xa75e('0x38')){logger[_0xa75e('0x39')](util[_0xa75e('0x10')]('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x38dce8['id']),util[_0xa75e('0x3a')](_0x5b184d,{'showHidden':![],'depth':null}));}}_0x164ccb();});});}function checkTranscribe(){var _0x1f1861;var _0xc27aef;var _0x4cf713;return db[_0xa75e('0x3b')][_0xa75e('0x3c')]({'where':{'transcribeStatus':_0xa75e('0x3d')}})['then'](function(_0x24dd7a){if(!_0x24dd7a||!_0x24dd7a['length']){throw new db[(_0xa75e('0x1c'))][(_0xa75e('0x1d'))](_0xa75e('0x3e'));}_0x1f1861=_0x24dd7a;return db['Setting'][_0xa75e('0x25')]({'where':{'id':0x1}});})[_0xa75e('0xf')](function(_0x47f04e){if(!_0x47f04e){throw new db[(_0xa75e('0x1c'))][(_0xa75e('0x1d'))](_0xa75e('0x3f'));}_0xc27aef=_0x47f04e;if(!_0xc27aef[_0xa75e('0x5')]||!_0xc27aef[_0xa75e('0x40')]||!_0xc27aef[_0xa75e('0x41')]||!_0xc27aef[_0xa75e('0x21')]||!_0xc27aef[_0xa75e('0x22')]){throw new db[(_0xa75e('0x1c'))][(_0xa75e('0x1d'))](_0xa75e('0x42'));}return db[_0xa75e('0x24')]['findOne']({'where':{'id':_0xc27aef[_0xa75e('0x40')]}});})[_0xa75e('0xf')](function(_0x5b8480){if(!_0x5b8480){throw new db[(_0xa75e('0x1c'))]['ValidationError'](_0xa75e('0x26'));}if(!_0x5b8480[_0xa75e('0xc')]||!_0x5b8480[_0xa75e('0xd')]){throw new db[(_0xa75e('0x1c'))][(_0xa75e('0x1d'))](_0xa75e('0x32'));}_0x4cf713=_0x5b8480;var _0x62eedf=[];_0x1f1861['forEach'](function(_0x44a68e){_0x62eedf[_0xa75e('0x43')](checkTranscribeJob(_0x44a68e,_0xc27aef,_0x4cf713));});return BPromise[_0xa75e('0x44')](_0x62eedf);})[_0xa75e('0x36')](function(_0x23159e){if(_0x23159e){if(!_0x23159e[_0xa75e('0x37')]||_0x23159e[_0xa75e('0x37')]!=='SequelizeValidationError'){logger[_0xa75e('0x39')](util[_0xa75e('0x3a')](_0x23159e,{'showHidden':![],'depth':null}));}}});}exports['start']=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x9e5e=['[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','fileText','TranscriptionJobStatus','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','Sentiment\x20Analysis\x20not\x20requested','sentimentAccountId','sentimentRegion','bucket','ValidationError','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','language','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Negative','Mixed','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','sentiment','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','findOne','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','VoiceRecording','findAll','IN_PROGRESS','length','Setting','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','all','catch','start','lodash','aws-sdk','util','bluebird','../../mysqldb','transcribe','getTranscriptionJob','Comprehend','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data2','transcribeRegion','then'];(function(_0x220dbb,_0x99328d){var _0x2b77de=function(_0x15e966){while(--_0x15e966){_0x220dbb['push'](_0x220dbb['shift']());}};_0x2b77de(++_0x99328d);}(_0x9e5e,0x1e2));var _0xe9e5=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0x9e5e[_0x24f31b];return _0x488401;};var _=require(_0xe9e5('0x0'));var AWS=require(_0xe9e5('0x1'));var rp=require('request-promise');var util=require(_0xe9e5('0x2'));var BPromise=require(_0xe9e5('0x3'));var db=require(_0xe9e5('0x4'))['db'];var logger=require('../../config/logger')(_0xe9e5('0x5'));function getTranscriptionJob(_0x5c29f3,_0x396715,_0x2bc952,_0x4f5182){return new Promise(function(_0x5c09f0,_0xf4d974){var _0x2333df=new AWS['TranscribeService']({'accessKeyId':_0x396715,'secretAccessKey':_0x5c29f3,'region':_0x2bc952});_0x2333df[_0xe9e5('0x6')]({'TranscriptionJobName':_0x4f5182},function(_0x2533d8,_0x3c5c1b){if(_0x2533d8){return _0xf4d974(_0x2533d8);}else{return _0x5c09f0(_0x3c5c1b);}});});}function sentiment(_0x6325f0,_0x34b7f5,_0x18a551,_0x18d1ee,_0x28a123){return new Promise(function(_0x2a58fb,_0x5397ce){var _0x38cd93=new AWS[(_0xe9e5('0x7'))]({'accessKeyId':_0x34b7f5,'secretAccessKey':_0x6325f0,'region':_0x18a551});_0x38cd93['detectSentiment']({'Text':_0x18d1ee,'LanguageCode':_0x28a123['substring'](0x0,0x2)},function(_0x4f4d79,_0x517c91){if(_0x4f4d79){return _0x5397ce(_0x4f4d79);}else{return _0x2a58fb(_0x517c91);}});});}function checkTranscribeJob(_0x439466,_0x145c5f,_0x42dcba){var _0x272b49;return new BPromise(function(_0x269ac4,_0x4aab69){logger[_0xe9e5('0x8')](util[_0xe9e5('0x9')](_0xe9e5('0xa'),_0x439466['id'],_0x439466[_0xe9e5('0xb')]));return getTranscriptionJob(_0x42dcba['data1'],_0x42dcba[_0xe9e5('0xc')],_0x145c5f[_0xe9e5('0xd')],_0x439466[_0xe9e5('0xb')])[_0xe9e5('0xe')](function(_0x17990d){logger[_0xe9e5('0x8')](util[_0xe9e5('0x9')](_0xe9e5('0xf'),_0x439466['id'],_0x439466[_0xe9e5('0xb')],_0x17990d[_0xe9e5('0x10')]['TranscriptionJobStatus']));if(!_0x439466[_0xe9e5('0x11')]){switch(_0x17990d[_0xe9e5('0x10')][_0xe9e5('0x12')]){case _0xe9e5('0x13'):var _0x28dfbe={'transcribeStatus':_0x17990d[_0xe9e5('0x10')][_0xe9e5('0x12')],'fileUri':_0x17990d[_0xe9e5('0x10')][_0xe9e5('0x14')][_0xe9e5('0x15')]};logger['info'](util['format']('[RECORDING:%d]\x20Get\x20transcript',_0x439466['id']));return rp({'uri':_0x17990d[_0xe9e5('0x10')][_0xe9e5('0x14')][_0xe9e5('0x15')],'json':!![]})[_0xe9e5('0xe')](function(_0x4143dc){logger[_0xe9e5('0x8')](util[_0xe9e5('0x9')](_0xe9e5('0x16'),_0x439466['id']));if(_0x4143dc&&_0x4143dc[_0xe9e5('0x17')]&&_0x4143dc[_0xe9e5('0x17')][_0xe9e5('0x18')]&&_0x4143dc['results'][_0xe9e5('0x18')]['length']){_0x28dfbe[_0xe9e5('0x11')]='';for(var _0x48005f=0x0;_0x48005f<_0x4143dc[_0xe9e5('0x17')]['transcripts']['length'];_0x48005f++){_0x28dfbe['fileText']+=_0x4143dc[_0xe9e5('0x17')][_0xe9e5('0x18')][_0x48005f][_0xe9e5('0x19')]+'';}}return _0x439466[_0xe9e5('0x1a')](_0x28dfbe);})[_0xe9e5('0xe')](function(){logger[_0xe9e5('0x8')](util[_0xe9e5('0x9')](_0xe9e5('0x1b'),_0x439466['id']));if(!_0x439466[_0xe9e5('0x1c')]){throw new db[(_0xe9e5('0x1d'))]['ValidationError'](_0xe9e5('0x1e'));}if(!_0x145c5f['sentiment']||!_0x145c5f[_0xe9e5('0x1f')]||!_0x145c5f[_0xe9e5('0x20')]||!_0x145c5f['language']||!_0x145c5f[_0xe9e5('0x21')]){throw new db[(_0xe9e5('0x1d'))][(_0xe9e5('0x22'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x28dfbe[_0xe9e5('0x11')]){throw new Error('Transcript\x20not\x20available');}if(_0x145c5f[_0xe9e5('0x1f')]===_0x42dcba['id']){return _0x42dcba;}else{return db[_0xe9e5('0x23')]['findOne']({'where':{'id':_settings[_0xe9e5('0x1f')]}});}})[_0xe9e5('0xe')](function(_0x50cf20){if(!_0x50cf20){throw new db[(_0xe9e5('0x1d'))][(_0xe9e5('0x22'))](_0xe9e5('0x24'));}if(!_0x50cf20[_0xe9e5('0x25')]||!_0x50cf20[_0xe9e5('0xc')]){throw new db[(_0xe9e5('0x1d'))]['ValidationError']('Cloud\x20Provider\x20not\x20configured');}_0x272b49=_0x50cf20;logger[_0xe9e5('0x8')](util[_0xe9e5('0x9')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x439466['id']));return sentiment(_0x272b49[_0xe9e5('0x25')],_0x272b49[_0xe9e5('0xc')],_0x145c5f['sentimentRegion'],_0x28dfbe['fileText'],_0x145c5f[_0xe9e5('0x26')]);})['then'](function(_0x5dde23){logger[_0xe9e5('0x8')](util[_0xe9e5('0x9')](_0xe9e5('0x27'),_0x439466['id']));return _0x439466[_0xe9e5('0x1a')]({'sentiment':_0x5dde23[_0xe9e5('0x28')],'sPositive':_0x5dde23[_0xe9e5('0x29')][_0xe9e5('0x2a')],'sNegative':_0x5dde23[_0xe9e5('0x29')][_0xe9e5('0x2b')],'sMixed':_0x5dde23[_0xe9e5('0x29')][_0xe9e5('0x2c')],'sNeutral':_0x5dde23[_0xe9e5('0x29')][_0xe9e5('0x2d')]});})['then'](function(){logger[_0xe9e5('0x8')](util[_0xe9e5('0x9')](_0xe9e5('0x1b'),_0x439466['id']));_0x269ac4();});case _0xe9e5('0x2e'):return _0x439466[_0xe9e5('0x1a')]({'transcribeStatus':_0xe9e5('0x2e'),'failureReason':_0x17990d['TranscriptionJob'][_0xe9e5('0x2f')]})[_0xe9e5('0xe')](function(){logger[_0xe9e5('0x8')](util['format'](_0xe9e5('0x1b'),_0x439466['id']));_0x269ac4();});default:logger[_0xe9e5('0x8')](util[_0xe9e5('0x9')](_0xe9e5('0x30'),_0x439466['id']));break;}}else{return BPromise[_0xe9e5('0x31')]()[_0xe9e5('0xe')](function(){if(!_0x439466[_0xe9e5('0x1c')]){throw new db['Sequelize']['ValidationError'](_0xe9e5('0x1e'));}if(!_0x145c5f[_0xe9e5('0x32')]||!_0x145c5f[_0xe9e5('0x1f')]||!_0x145c5f[_0xe9e5('0x20')]||!_0x145c5f[_0xe9e5('0x26')]||!_0x145c5f['bucket']){throw new db[(_0xe9e5('0x1d'))]['ValidationError'](_0xe9e5('0x33'));}if(!_0x439466['fileText']){throw new Error(_0xe9e5('0x34'));}if(_0x145c5f[_0xe9e5('0x1f')]===_0x42dcba['id']){return _0x42dcba;}else{return db['CloudProvider'][_0xe9e5('0x35')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0xe9e5('0xe')](function(_0x2ff35a){if(!_0x2ff35a){throw new db[(_0xe9e5('0x1d'))][(_0xe9e5('0x22'))](_0xe9e5('0x24'));}if(!_0x2ff35a[_0xe9e5('0x25')]||!_0x2ff35a[_0xe9e5('0xc')]){throw new db[(_0xe9e5('0x1d'))][(_0xe9e5('0x22'))](_0xe9e5('0x36'));}_0x272b49=_0x2ff35a;logger[_0xe9e5('0x8')](util['format'](_0xe9e5('0x37'),_0x439466['id']));return sentiment(_0x272b49[_0xe9e5('0x25')],_0x272b49[_0xe9e5('0xc')],_0x145c5f[_0xe9e5('0x20')],_0x439466['fileText'],_0x145c5f['language']);})[_0xe9e5('0xe')](function(_0x54cf26){logger[_0xe9e5('0x8')](util[_0xe9e5('0x9')](_0xe9e5('0x27'),_0x439466['id']));return _0x439466[_0xe9e5('0x1a')]({'sentiment':_0x54cf26[_0xe9e5('0x28')],'sPositive':_0x54cf26['SentimentScore'][_0xe9e5('0x2a')],'sNegative':_0x54cf26['SentimentScore']['Negative'],'sMixed':_0x54cf26['SentimentScore'][_0xe9e5('0x2c')],'sNeutral':_0x54cf26[_0xe9e5('0x29')][_0xe9e5('0x2d')],'transcribeStatus':_0xe9e5('0x13')});})[_0xe9e5('0xe')](function(){logger[_0xe9e5('0x8')](util[_0xe9e5('0x9')](_0xe9e5('0x1b'),_0x439466['id']));_0x269ac4();});}})['catch'](function(_0x868ecb){if(_0x868ecb){if(!_0x868ecb[_0xe9e5('0x38')]||_0x868ecb[_0xe9e5('0x38')]!==_0xe9e5('0x39')){logger[_0xe9e5('0x3a')](util[_0xe9e5('0x9')](_0xe9e5('0x3b'),_0x439466['id']),util['inspect'](_0x868ecb,{'showHidden':![],'depth':null}));}}_0x269ac4();});});}function checkTranscribe(){var _0x4c38a7;var _0x24772a;var _0x4e8b56;return db[_0xe9e5('0x3c')][_0xe9e5('0x3d')]({'where':{'transcribeStatus':_0xe9e5('0x3e')}})['then'](function(_0x3eae80){if(!_0x3eae80||!_0x3eae80[_0xe9e5('0x3f')]){throw new db[(_0xe9e5('0x1d'))][(_0xe9e5('0x22'))]('No\x20transcribe\x20job\x20to\x20check');}_0x4c38a7=_0x3eae80;return db[_0xe9e5('0x40')][_0xe9e5('0x35')]({'where':{'id':0x1}});})[_0xe9e5('0xe')](function(_0xda435e){if(!_0xda435e){throw new db[(_0xe9e5('0x1d'))][(_0xe9e5('0x22'))](_0xe9e5('0x41'));}_0x24772a=_0xda435e;if(!_0x24772a[_0xe9e5('0x5')]||!_0x24772a[_0xe9e5('0x42')]||!_0x24772a['transcribeRegion']||!_0x24772a['language']||!_0x24772a[_0xe9e5('0x21')]){throw new db[(_0xe9e5('0x1d'))][(_0xe9e5('0x22'))](_0xe9e5('0x43'));}return db[_0xe9e5('0x23')][_0xe9e5('0x35')]({'where':{'id':_0x24772a[_0xe9e5('0x42')]}});})[_0xe9e5('0xe')](function(_0x47d74b){if(!_0x47d74b){throw new db['Sequelize']['ValidationError'](_0xe9e5('0x24'));}if(!_0x47d74b[_0xe9e5('0x25')]||!_0x47d74b[_0xe9e5('0xc')]){throw new db[(_0xe9e5('0x1d'))][(_0xe9e5('0x22'))](_0xe9e5('0x36'));}_0x4e8b56=_0x47d74b;var _0x2fd3c1=[];_0x4c38a7['forEach'](function(_0xd6b0ed){_0x2fd3c1['push'](checkTranscribeJob(_0xd6b0ed,_0x24772a,_0x4e8b56));});return BPromise[_0xe9e5('0x44')](_0x2fd3c1);})[_0xe9e5('0x45')](function(_0x3af576){if(_0x3af576){if(!_0x3af576['name']||_0x3af576[_0xe9e5('0x38')]!==_0xe9e5('0x39')){logger['error'](util['inspect'](_0x3af576,{'showHidden':![],'depth':null}));}}});}exports[_0xe9e5('0x46')]=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 54c086d..94776e1 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 _0xf188=['timeout','format','YYYY-MM-DD\x20HH:mm:ss','then','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','join','whatsappInteraction:update','catch','[WHATSAPP]\x20Error\x20closing\x20interactions','start','moment','ioredis','util','../logger','schedule','defaults','localhost','socket.io-emitter','redis','WhatsappInteraction','findAll','lastMsgAt','subtract','hours','map','info','update'];(function(_0x24fdd6,_0x1c4703){var _0x3ed812=function(_0x4c4fcb){while(--_0x4c4fcb){_0x24fdd6['push'](_0x24fdd6['shift']());}};_0x3ed812(++_0x1c4703);}(_0xf188,0xfd));var _0x8f18=function(_0x352397,_0x2f1357){_0x352397=_0x352397-0x0;var _0x1d90c4=_0xf188[_0x352397];return _0x1d90c4;};'use strict';var _=require('lodash');var moment=require(_0x8f18('0x0'));var Redis=require(_0x8f18('0x1'));var util=require(_0x8f18('0x2'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var logger=require(_0x8f18('0x3'))(_0x8f18('0x4'));config['redis']=_[_0x8f18('0x5')](config['redis'],{'host':_0x8f18('0x6'),'port':0x18eb});var io=require(_0x8f18('0x7'))(new Redis(config[_0x8f18('0x8')]));function closeInteractions(){var _0x104a70=[];return db[_0x8f18('0x9')][_0x8f18('0xa')]({'raw':!![],'attributes':['id',_0x8f18('0xb')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x8f18('0xc')](0x18,_0x8f18('0xd'))}}})['then'](function(_0x13d105){if(_0x13d105&&_0x13d105['length']){_0x104a70=_[_0x8f18('0xe')](_0x13d105||[],'id');logger[_0x8f18('0xf')]('[WHATSAPP]\x20Interactions\x20to\x20close:',_0x104a70['join']());return db[_0x8f18('0x9')][_0x8f18('0x10')]({'closeReason':'system','disposition':_0x8f18('0x11'),'closed':!![],'closedAt':moment()[_0x8f18('0x12')](_0x8f18('0x13'))},{'where':{'id':_0x104a70}});}})[_0x8f18('0x14')](function(){if(_0x104a70&&_0x104a70['length']){logger[_0x8f18('0xf')](_0x8f18('0x15'),_0x104a70[_0x8f18('0x16')]());for(var _0x2c3975=0x0;_0x2c3975<_0x104a70['length'];_0x2c3975++){io['emit'](_0x8f18('0x17'),{'id':_0x104a70[_0x2c3975],'closed':!![]});}}})[_0x8f18('0x18')](function(_0x1a8243){logger['error'](_0x8f18('0x19'),_0x1a8243?util['inspect'](_0x1a8243,{'showHidden':![],'depth':null}):'');});}exports[_0x8f18('0x1a')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xfa34=['emit','whatsappInteraction:update','catch','[WHATSAPP]\x20Error\x20closing\x20interactions','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','redis','defaults','localhost','WhatsappInteraction','findAll','lastMsgAt','subtract','hours','then','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','YYYY-MM-DD\x20HH:mm:ss','length'];(function(_0x497f87,_0x26ae76){var _0x25993e=function(_0x2815e9){while(--_0x2815e9){_0x497f87['push'](_0x497f87['shift']());}};_0x25993e(++_0x26ae76);}(_0xfa34,0x74));var _0x4fa3=function(_0x1f8053,_0x111077){_0x1f8053=_0x1f8053-0x0;var _0x174fd8=_0xfa34[_0x1f8053];return _0x174fd8;};'use strict';var _=require(_0x4fa3('0x0'));var moment=require(_0x4fa3('0x1'));var Redis=require(_0x4fa3('0x2'));var util=require(_0x4fa3('0x3'));var config=require(_0x4fa3('0x4'));var db=require(_0x4fa3('0x5'))['db'];var logger=require(_0x4fa3('0x6'))('schedule');config[_0x4fa3('0x7')]=_[_0x4fa3('0x8')](config[_0x4fa3('0x7')],{'host':_0x4fa3('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x4fa3('0x7')]));function closeInteractions(){var _0x735afc=[];return db[_0x4fa3('0xa')][_0x4fa3('0xb')]({'raw':!![],'attributes':['id',_0x4fa3('0xc')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x4fa3('0xd')](0x18,_0x4fa3('0xe'))}}})[_0x4fa3('0xf')](function(_0x2cbbc9){if(_0x2cbbc9&&_0x2cbbc9['length']){_0x735afc=_[_0x4fa3('0x10')](_0x2cbbc9||[],'id');logger[_0x4fa3('0x11')](_0x4fa3('0x12'),_0x735afc[_0x4fa3('0x13')]());return db['WhatsappInteraction'][_0x4fa3('0x14')]({'closeReason':_0x4fa3('0x15'),'disposition':'timeout','closed':!![],'closedAt':moment()['format'](_0x4fa3('0x16'))},{'where':{'id':_0x735afc}});}})[_0x4fa3('0xf')](function(){if(_0x735afc&&_0x735afc[_0x4fa3('0x17')]){logger[_0x4fa3('0x11')]('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x735afc[_0x4fa3('0x13')]());for(var _0x32b585=0x0;_0x32b585<_0x735afc[_0x4fa3('0x17')];_0x32b585++){io[_0x4fa3('0x18')](_0x4fa3('0x19'),{'id':_0x735afc[_0x32b585],'closed':!![]});}}})[_0x4fa3('0x1a')](function(_0x1df8fd){logger['error'](_0x4fa3('0x1b'),_0x1df8fd?util['inspect'](_0x1df8fd,{'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 72e306b..9398189 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4f45=['contacts1','CmHopper','log','contacts2','hopper2','util','../mysqldb','Biondo','innocenzo.biondo','push','now','Innocenzo','@xcally.com','CmContact','destroy','then','bulkCreate','finished\x20populating'];(function(_0x3fdef4,_0x444beb){var _0x3f099e=function(_0x163a7e){while(--_0x163a7e){_0x3fdef4['push'](_0x3fdef4['shift']());}};_0x3f099e(++_0x444beb);}(_0x4f45,0x191));var _0x54f4=function(_0x1b0842,_0xf59338){_0x1b0842=_0x1b0842-0x0;var _0x69b76e=_0x4f45[_0x1b0842];return _0x69b76e;};'use strict';var util=require(_0x54f4('0x0'));var db=require(_0x54f4('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x54f4('0x2')+i,'phone':0xf879fb460+i,'email':_0x54f4('0x3')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x54f4('0x4')]({'id':i,'active':![],'scheduledat':Date[_0x54f4('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x54f4('0x5')](),'updatedAt':Date[_0x54f4('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x54f4('0x4')]({'id':i,'firstName':_0x54f4('0x6')+i,'lastName':_0x54f4('0x2')+i,'phone':0xf879fb460+i,'email':_0x54f4('0x3')+i+_0x54f4('0x7')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x54f4('0x4')]({'id':i,'active':![],'scheduledat':Date[_0x54f4('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x54f4('0x5')](),'updatedAt':Date[_0x54f4('0x5')]()});}db[_0x54f4('0x8')][_0x54f4('0x9')]({'where':{}})[_0x54f4('0xa')](function(){return db[_0x54f4('0x8')][_0x54f4('0xb')](contacts);})['then'](function(){console['log'](_0x54f4('0xc'),_0x54f4('0xd'));return db[_0x54f4('0xe')][_0x54f4('0x9')]({'where':{}});})[_0x54f4('0xa')](function(){return db[_0x54f4('0xe')][_0x54f4('0xb')](hopper);})[_0x54f4('0xa')](function(){console[_0x54f4('0xf')]('finished\x20populating','hopper1');return db[_0x54f4('0x8')][_0x54f4('0xb')](contacts2);})[_0x54f4('0xa')](function(){console[_0x54f4('0xf')](_0x54f4('0xc'),_0x54f4('0x10'));return db['CmHopper'][_0x54f4('0xb')](hopper2);})[_0x54f4('0xa')](function(){console[_0x54f4('0xf')](_0x54f4('0xc'),_0x54f4('0x11'));})['catch'](function(_0x1fe299){console[_0x54f4('0xf')](_0x1fe299);}); \ No newline at end of file +var _0x99c1=['hopper1','hopper2','util','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','CmContact','then','bulkCreate','log','finished\x20populating','contacts1','CmHopper'];(function(_0x2e29d5,_0x1d3c3){var _0x1119a1=function(_0x10c8a1){while(--_0x10c8a1){_0x2e29d5['push'](_0x2e29d5['shift']());}};_0x1119a1(++_0x1d3c3);}(_0x99c1,0x123));var _0x199c=function(_0x4e740d,_0x7b2c98){_0x4e740d=_0x4e740d-0x0;var _0x54c399=_0x99c1[_0x4e740d];return _0x54c399;};'use strict';var util=require(_0x199c('0x0'));var db=require(_0x199c('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x199c('0x2')]({'id':i,'firstName':_0x199c('0x3')+i,'lastName':_0x199c('0x4')+i,'phone':0xf879fb460+i,'email':_0x199c('0x5')+i+_0x199c('0x6')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x199c('0x2')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x199c('0x7')](),'updatedAt':Date[_0x199c('0x7')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x199c('0x2')]({'id':i,'firstName':_0x199c('0x3')+i,'lastName':_0x199c('0x4')+i,'phone':0xf879fb460+i,'email':_0x199c('0x5')+i+_0x199c('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x199c('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x199c('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x199c('0x7')]()});}db[_0x199c('0x8')]['destroy']({'where':{}})[_0x199c('0x9')](function(){return db[_0x199c('0x8')][_0x199c('0xa')](contacts);})[_0x199c('0x9')](function(){console[_0x199c('0xb')](_0x199c('0xc'),_0x199c('0xd'));return db[_0x199c('0xe')]['destroy']({'where':{}});})[_0x199c('0x9')](function(){return db['CmHopper'][_0x199c('0xa')](hopper);})[_0x199c('0x9')](function(){console[_0x199c('0xb')](_0x199c('0xc'),_0x199c('0xf'));return db[_0x199c('0x8')][_0x199c('0xa')](contacts2);})[_0x199c('0x9')](function(){console[_0x199c('0xb')](_0x199c('0xc'),'contacts2');return db[_0x199c('0xe')][_0x199c('0xa')](hopper2);})[_0x199c('0x9')](function(){console[_0x199c('0xb')]('finished\x20populating',_0x199c('0x10'));})['catch'](function(_0x8ae53){console[_0x199c('0xb')](_0x8ae53);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 30b170a..82f08fc 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5e11=['../mysqldb','push','format','%s%s','agent','%s%s@xcally.com','friend','udp','wss','ulaw','yes','/etc/pki/tls/private/motion.key','actpass','User','bulkCreate','then','log','catch','util'];(function(_0x13acad,_0x4a0af5){var _0x45e0dd=function(_0x5d709e){while(--_0x5d709e){_0x13acad['push'](_0x13acad['shift']());}};_0x45e0dd(++_0x4a0af5);}(_0x5e11,0xbd));var _0x15e1=function(_0x403c8d,_0x5e3825){_0x403c8d=_0x403c8d-0x0;var _0x4ca60d=_0x5e11[_0x403c8d];return _0x4ca60d;};'use strict';var util=require(_0x15e1('0x0'));var db=require(_0x15e1('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x15e1('0x2')]({'name':util[_0x15e1('0x3')](_0x15e1('0x4'),_0x15e1('0x5'),i),'fullname':util[_0x15e1('0x3')](_0x15e1('0x4'),_0x15e1('0x5'),i),'email':util[_0x15e1('0x3')](_0x15e1('0x6'),_0x15e1('0x5'),i),'role':_0x15e1('0x5'),'password':'password','internal':0xfa0+i,'type':_0x15e1('0x7'),'transport':[_0x15e1('0x8'),'ws',_0x15e1('0x9')],'disallow':['all'],'allow':[_0x15e1('0xa')],'defaultuser':util['format']('%s%s',_0x15e1('0x5'),i),'encryption':'yes','avpf':_0x15e1('0xb'),'force_avp':_0x15e1('0xb'),'icesupport':_0x15e1('0xb'),'dtlsenable':_0x15e1('0xb'),'dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0x15e1('0xc'),'dtlssetup':_0x15e1('0xd'),'callerid':util[_0x15e1('0x3')]('\x22%s\x22\x20<%s>',util[_0x15e1('0x3')]('%s%s',_0x15e1('0x5'),i),0xfa0+i)});}db[_0x15e1('0xe')][_0x15e1('0xf')](users)[_0x15e1('0x10')](function(){console[_0x15e1('0x11')]('add\x20user');})[_0x15e1('0x12')](function(_0x33e33b){console['log'](_0x33e33b);}); \ No newline at end of file +var _0x6f18=['friend','udp','wss','all','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','bulkCreate','add\x20user','util','push','format','%s%s','agent','%s%s@xcally.com'];(function(_0x5f4475,_0x2821b4){var _0x1fd047=function(_0x23598f){while(--_0x23598f){_0x5f4475['push'](_0x5f4475['shift']());}};_0x1fd047(++_0x2821b4);}(_0x6f18,0x71));var _0x86f1=function(_0x4c8c34,_0x5c4a63){_0x4c8c34=_0x4c8c34-0x0;var _0x1ab816=_0x6f18[_0x4c8c34];return _0x1ab816;};'use strict';var util=require(_0x86f1('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x86f1('0x1')]({'name':util[_0x86f1('0x2')](_0x86f1('0x3'),_0x86f1('0x4'),i),'fullname':util[_0x86f1('0x2')](_0x86f1('0x3'),_0x86f1('0x4'),i),'email':util['format'](_0x86f1('0x5'),'agent',i),'role':_0x86f1('0x4'),'password':'password','internal':0xfa0+i,'type':_0x86f1('0x6'),'transport':[_0x86f1('0x7'),'ws',_0x86f1('0x8')],'disallow':[_0x86f1('0x9')],'allow':['ulaw'],'defaultuser':util['format'](_0x86f1('0x3'),_0x86f1('0x4'),i),'encryption':'yes','avpf':_0x86f1('0xa'),'force_avp':_0x86f1('0xa'),'icesupport':_0x86f1('0xa'),'dtlsenable':_0x86f1('0xa'),'dtlsverify':'no','dtlscertfile':_0x86f1('0xb'),'dtlsprivatekey':_0x86f1('0xc'),'dtlssetup':_0x86f1('0xd'),'callerid':util[_0x86f1('0x2')](_0x86f1('0xe'),util[_0x86f1('0x2')](_0x86f1('0x3'),_0x86f1('0x4'),i),0xfa0+i)});}db['User'][_0x86f1('0xf')](users)['then'](function(){console['log'](_0x86f1('0x10'));})['catch'](function(_0x64cdf4){console['log'](_0x64cdf4);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 9df6a50..a2274d4 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8411=['role','agent','telephone','type','ivr','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','findAll','Telephones','IvrCampaigns','resourceId','map','where','Campaign','format','%s:queue:%s','length','user:%s','handshake','query','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','WhatsappInteraction','WhatsappInteractions','voice:inbound','voice:outbound','hasOwnProperty','include','push','SmsQueue','MailQueue','WhatsappQueue','Trunk','user','userProfileId','VoiceQueue','FaxQueue','Trunks','getVoiceQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','chat','sms','openchannel','whatsapp','telephone:%s','trunk:%s','leave','removeChatInteractions','emit','user_has_chat_interactions:remove','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','OpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','catch','log','connection','setMaxListeners','address','request','remotePort','connectedAt','SocketIO\x20','nsp','disconnect','DISCONNECTED','bluebird','../mysqldb','Agents','User','name'];(function(_0x1f0464,_0x74c830){var _0x3b8414=function(_0x2c4ff3){while(--_0x2c4ff3){_0x1f0464['push'](_0x1f0464['shift']());}};_0x3b8414(++_0x74c830);}(_0x8411,0x118));var _0x1841=function(_0x2a383f,_0x49a7e5){_0x2a383f=_0x2a383f-0x0;var _0x977199=_0x8411[_0x2a383f];return _0x977199;};'use strict';var _=require('lodash');var util=require('util');var BPromise=require(_0x1841('0x0'));var db=require(_0x1841('0x1'))['db'];var config=require('./environment');var queryQueues={'attributes':['id','name'],'include':[{'as':_0x1841('0x2'),'model':db[_0x1841('0x3')],'attributes':['id',_0x1841('0x4'),_0x1841('0x5')],'raw':!![],'where':{'role':_0x1841('0x6')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0x1841('0x7')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id',_0x1841('0x4')],'where':{'role':_0x1841('0x6')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x1841('0x4'),_0x1841('0x8')],'where':{'type':_0x1841('0x9')}};function getAssociatedResources(_0x2726a0,_0x15cb80,_0x2316e4){return db[_0x1841('0xa')][_0x1841('0xb')]({'where':{'name':_0x2726a0,'userProfileId':_0x15cb80},'raw':!![]})[_0x1841('0xc')](function(_0x1ae8b8){if(_0x1ae8b8){if(_0x1ae8b8[_0x1841('0xd')]){switch(_0x2726a0){case _0x1841('0xe'):case _0x1841('0xf'):case _0x1841('0x10'):case _0x1841('0x11'):case _0x1841('0x12'):case _0x1841('0x13'):case'WhatsappQueues':return db[_0x2316e4][_0x1841('0x14')](queryQueues);case _0x1841('0x15'):return db[_0x2316e4][_0x1841('0x14')](queryTelephones);case'Trunks':return db[_0x2316e4]['findAll'](queryTrunks);case _0x1841('0x16'):return db[_0x2316e4][_0x1841('0x14')](queryCampaigns);}}else{return db['UserProfileResource'][_0x1841('0x14')]({'attributes':[_0x1841('0x17')],'where':{'sectionId':_0x1ae8b8['id']},'raw':!![]})[_0x1841('0xc')](function(_0x287c5e){if(_0x287c5e){var _0x1e7426={'where':{'id':_[_0x1841('0x18')](_0x287c5e,'resourceId')},'raw':!![]};switch(_0x2316e4){case _0x1841('0x3'):_0x1e7426[_0x1841('0x19')][_0x1841('0x5')]=_0x1841('0x7');break;case _0x1841('0x1a'):_0x1e7426[_0x1841('0x19')][_0x1841('0x8')]=_0x1841('0x9');break;}return db[_0x2316e4][_0x1841('0x14')](_0x1e7426);}else{return[];}});}}else{return[];}})[_0x1841('0xc')](function(_0x1c471f){return _0x1c471f;});}function joinOrLeaveQueues(_0xe44718,_0x25a777,_0x8f6094,_0x55f8ed){_0xe44718[_0x25a777](util[_0x1841('0x1b')](_0x1841('0x1c'),_0x8f6094,_0x55f8ed[_0x1841('0x4')]));if(_0x55f8ed[_0x1841('0x2')]){for(var _0x5201b3=0x0;_0x5201b3<_0x55f8ed[_0x1841('0x2')][_0x1841('0x1d')];_0x5201b3+=0x1){_0xe44718[_0x25a777](util[_0x1841('0x1b')](_0x1841('0x1e'),_0x55f8ed[_0x1841('0x2')][_0x5201b3][_0x1841('0x4')]));}}}function joinOrLeave(_0x28a0d2,_0x3a546b,_0x381c46){var _0xb65ca6;if(_0x28a0d2[_0x1841('0x1f')][_0x1841('0x20')]['id']){db[_0x1841('0x3')]['find']({'attributes':['id','name',_0x1841('0x5'),'userProfileId'],'where':{'id':_0x28a0d2[_0x1841('0x1f')][_0x1841('0x20')]['id']},'include':[{'model':db[_0x1841('0x21')],'as':_0x1841('0x22'),'attributes':['id'],'raw':!![]},{'model':db[_0x1841('0x23')],'as':_0x1841('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0x1841('0x25')],'as':_0x1841('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x1841('0x27')],'as':_0x1841('0x28'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x1841('0x29')],'as':_0x1841('0x2a'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x1f0985){if(_0x1f0985){_0xb65ca6=_0x1f0985;_0x28a0d2[_0x3a546b](util[_0x1841('0x1b')](_0x1841('0x1e'),_0x1f0985[_0x1841('0x4')]));var _0x2bc73a=[];switch(_0x1f0985[_0x1841('0x5')]){case'admin':_0x28a0d2[_0x3a546b](_0x1841('0x2b'));_0x28a0d2[_0x3a546b](_0x1841('0x2c'));if(queryQueues[_0x1841('0x2d')](_0x1841('0x2e'))){delete queryQueues[_0x1841('0x2e')];}_0x2bc73a[_0x1841('0x2f')](db['VoiceQueue'][_0x1841('0x14')](queryQueues));_0x2bc73a[_0x1841('0x2f')](db['ChatQueue'][_0x1841('0x14')](queryQueues));_0x2bc73a['push'](db['FaxQueue'][_0x1841('0x14')](queryQueues));_0x2bc73a[_0x1841('0x2f')](db[_0x1841('0x30')][_0x1841('0x14')](queryQueues));_0x2bc73a['push'](db[_0x1841('0x31')][_0x1841('0x14')](queryQueues));_0x2bc73a[_0x1841('0x2f')](db['OpenchannelQueue'][_0x1841('0x14')](queryQueues));_0x2bc73a[_0x1841('0x2f')](db[_0x1841('0x32')][_0x1841('0x14')](queryQueues));_0x2bc73a[_0x1841('0x2f')](db[_0x1841('0x3')]['findAll'](queryTelephones));_0x2bc73a[_0x1841('0x2f')](db[_0x1841('0x33')]['findAll'](queryTrunks));_0x2bc73a[_0x1841('0x2f')](db['Campaign'][_0x1841('0x14')](queryCampaigns));_0x2bc73a[_0x1841('0x2f')](db['User'][_0x1841('0x14')](queryAgents));break;case _0x1841('0x34'):_0x28a0d2[_0x3a546b](_0x1841('0x2b'));_0x28a0d2[_0x3a546b](_0x1841('0x2c'));_0x2bc73a[_0x1841('0x2f')](getAssociatedResources('VoiceQueues',_0x1f0985[_0x1841('0x35')],_0x1841('0x36')));_0x2bc73a[_0x1841('0x2f')](getAssociatedResources(_0x1841('0xf'),_0x1f0985[_0x1841('0x35')],'ChatQueue'));_0x2bc73a[_0x1841('0x2f')](getAssociatedResources('FaxQueues',_0x1f0985[_0x1841('0x35')],_0x1841('0x37')));_0x2bc73a['push'](getAssociatedResources('SmsQueues',_0x1f0985[_0x1841('0x35')],_0x1841('0x30')));_0x2bc73a[_0x1841('0x2f')](getAssociatedResources(_0x1841('0x12'),_0x1f0985[_0x1841('0x35')],_0x1841('0x31')));_0x2bc73a[_0x1841('0x2f')](getAssociatedResources(_0x1841('0x13'),_0x1f0985[_0x1841('0x35')],'OpenchannelQueue'));_0x2bc73a[_0x1841('0x2f')](getAssociatedResources('WhatsappQueues',_0x1f0985[_0x1841('0x35')],_0x1841('0x32')));_0x2bc73a[_0x1841('0x2f')](getAssociatedResources(_0x1841('0x15'),_0x1f0985[_0x1841('0x35')],_0x1841('0x3')));_0x2bc73a['push'](getAssociatedResources(_0x1841('0x38'),_0x1f0985['userProfileId'],'Trunk'));_0x2bc73a['push'](getAssociatedResources(_0x1841('0x16'),_0x1f0985['userProfileId'],_0x1841('0x1a')));_0x2bc73a[_0x1841('0x2f')](db['User'][_0x1841('0x14')](queryAgents));break;case'agent':_0x28a0d2[_0x3a546b](_0x1841('0x2b'));_0x28a0d2[_0x3a546b](_0x1841('0x2c'));_0x2bc73a[_0x1841('0x2f')](_0x1f0985[_0x1841('0x39')]({'attributes':['id',_0x1841('0x4')]}));_0x2bc73a[_0x1841('0x2f')](_0x1f0985['getChatQueues']({'attributes':['id',_0x1841('0x4')]}));_0x2bc73a[_0x1841('0x2f')](_0x1f0985[_0x1841('0x3a')]({'attributes':['id',_0x1841('0x4')]}));_0x2bc73a['push'](_0x1f0985[_0x1841('0x3b')]({'attributes':['id',_0x1841('0x4')]}));_0x2bc73a['push'](_0x1f0985[_0x1841('0x3c')]({'attributes':['id',_0x1841('0x4')]}));_0x2bc73a[_0x1841('0x2f')](_0x1f0985[_0x1841('0x3d')]({'attributes':['id',_0x1841('0x4')]}));_0x2bc73a['push'](_0x1f0985[_0x1841('0x3e')]({'attributes':['id','name']}));break;}return BPromise[_0x1841('0x3f')](_0x2bc73a);}})[_0x1841('0xc')](function(_0x32e0ff){if(_0x32e0ff&&_0x32e0ff[_0x1841('0x1d')]){for(var _0x5f54e1=0x0;_0x5f54e1<_0x32e0ff[_0x1841('0x1d')];_0x5f54e1+=0x1){for(var _0x55b3f3=0x0;_0x55b3f3<_0x32e0ff[_0x5f54e1][_0x1841('0x1d')];_0x55b3f3+=0x1){switch(_0x5f54e1){case 0x0:joinOrLeaveQueues(_0x28a0d2,_0x3a546b,'voice',_0x32e0ff[_0x5f54e1][_0x55b3f3]);break;case 0x1:joinOrLeaveQueues(_0x28a0d2,_0x3a546b,_0x1841('0x40'),_0x32e0ff[_0x5f54e1][_0x55b3f3]);break;case 0x2:joinOrLeaveQueues(_0x28a0d2,_0x3a546b,'fax',_0x32e0ff[_0x5f54e1][_0x55b3f3]);break;case 0x3:joinOrLeaveQueues(_0x28a0d2,_0x3a546b,_0x1841('0x41'),_0x32e0ff[_0x5f54e1][_0x55b3f3]);break;case 0x4:joinOrLeaveQueues(_0x28a0d2,_0x3a546b,'mail',_0x32e0ff[_0x5f54e1][_0x55b3f3]);break;case 0x5:joinOrLeaveQueues(_0x28a0d2,_0x3a546b,_0x1841('0x42'),_0x32e0ff[_0x5f54e1][_0x55b3f3]);break;case 0x6:joinOrLeaveQueues(_0x28a0d2,_0x3a546b,_0x1841('0x43'),_0x32e0ff[_0x5f54e1][_0x55b3f3]);break;case 0x7:if(_0xb65ca6[_0x1841('0x5')]!==_0x1841('0x6'))_0x28a0d2[_0x3a546b](util[_0x1841('0x1b')](_0x1841('0x44'),_0x32e0ff[_0x5f54e1][_0x55b3f3][_0x1841('0x4')]));break;case 0x8:if(_0xb65ca6[_0x1841('0x5')]!==_0x1841('0x6'))_0x28a0d2[_0x3a546b](util[_0x1841('0x1b')](_0x1841('0x45'),_0x32e0ff[_0x5f54e1][_0x55b3f3][_0x1841('0x4')]));break;case 0x9:if(_0xb65ca6[_0x1841('0x5')]!==_0x1841('0x6'))_0x28a0d2[_0x3a546b](util[_0x1841('0x1b')]('campaign:%s:%s',_0x32e0ff[_0x5f54e1][_0x55b3f3][_0x1841('0x8')],_0x32e0ff[_0x5f54e1][_0x55b3f3]['name']));break;case 0xa:_0x28a0d2[_0x3a546b](util[_0x1841('0x1b')](_0x1841('0x1e'),_0x32e0ff[_0x5f54e1][_0x55b3f3][_0x1841('0x4')]));break;}}}}})['then'](function(){if(_0x3a546b===_0x1841('0x46')){var _0x2e1335=_['map'](_0xb65ca6['ChatInteractions'],'id');return _0xb65ca6[_0x1841('0x47')](_0x2e1335)[_0x1841('0xc')](function(){for(var _0x22b1a4=0x0;_0x22b1a4<_0x2e1335[_0x1841('0x1d')];_0x22b1a4+=0x1){_0x381c46[_0x1841('0x48')](_0x1841('0x49'),{'ChatInteractionId':Number(_0x2e1335[_0x22b1a4]),'UserId':Number(_0xb65ca6['id'])});}});}})[_0x1841('0xc')](function(){if(_0x3a546b===_0x1841('0x46')){var _0x8658fa=_[_0x1841('0x18')](_0xb65ca6['MailInteractions'],'id');return _0xb65ca6['removeMailInteractions'](_0x8658fa)[_0x1841('0xc')](function(){for(var _0x55138b=0x0;_0x55138b<_0x8658fa['length'];_0x55138b+=0x1){_0x381c46[_0x1841('0x48')](_0x1841('0x4a'),{'MailInteractionId':Number(_0x8658fa[_0x55138b]),'UserId':Number(_0xb65ca6['id'])});}});}})[_0x1841('0xc')](function(){if(_0x3a546b===_0x1841('0x46')){var _0x299b9d=_[_0x1841('0x18')](_0xb65ca6[_0x1841('0x26')],'id');return _0xb65ca6[_0x1841('0x4b')](_0x299b9d)['then'](function(){for(var _0x5a4f6f=0x0;_0x5a4f6f<_0x299b9d['length'];_0x5a4f6f+=0x1){_0x381c46[_0x1841('0x48')](_0x1841('0x4c'),{'FaxInteractionId':Number(_0x299b9d[_0x5a4f6f]),'UserId':Number(_0xb65ca6['id'])});}});}})['then'](function(){if(_0x3a546b===_0x1841('0x46')){var _0x3cba23=_['map'](_0xb65ca6[_0x1841('0x28')],'id');return _0xb65ca6[_0x1841('0x4d')](_0x3cba23)['then'](function(){for(var _0x441300=0x0;_0x441300<_0x3cba23[_0x1841('0x1d')];_0x441300+=0x1){_0x381c46[_0x1841('0x48')](_0x1841('0x4e'),{'SmsInteractionId':Number(_0x3cba23[_0x441300]),'UserId':Number(_0xb65ca6['id'])});}});}})[_0x1841('0xc')](function(){if(_0x3a546b==='leave'){var _0x567a92=_['map'](_0xb65ca6[_0x1841('0x4f')],'id');return _0xb65ca6[_0x1841('0x50')](_0x567a92)[_0x1841('0xc')](function(){for(var _0x2b4188=0x0;_0x2b4188<_0x567a92[_0x1841('0x1d')];_0x2b4188+=0x1){_0x381c46[_0x1841('0x48')](_0x1841('0x51'),{'OpenchannelInteractionId':Number(_0x567a92[_0x2b4188]),'UserId':Number(_0xb65ca6['id'])});}});}})['then'](function(){if(_0x3a546b===_0x1841('0x46')){var _0x4aca45=_[_0x1841('0x18')](_0xb65ca6[_0x1841('0x2a')],'id');return _0xb65ca6[_0x1841('0x52')](_0x4aca45)['then'](function(){for(var _0x2e5f21=0x0;_0x2e5f21<_0x4aca45[_0x1841('0x1d')];_0x2e5f21+=0x1){_0x381c46[_0x1841('0x48')]('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0x4aca45[_0x2e5f21]),'UserId':Number(_0xb65ca6['id'])});}});}})[_0x1841('0x53')](function(_0x4fbb0f){_0x28a0d2[_0x1841('0x54')](_0x4fbb0f);});}}function onDisconnect(_0x49a64e,_0x58cb73){joinOrLeave(_0x49a64e,_0x1841('0x46'),_0x58cb73);}function onConnect(_0x33384b){joinOrLeave(_0x33384b,'join');}exports['default']=function(_0x1659bc){_0x1659bc['on'](_0x1841('0x55'),function(_0x28ffc3){_0x28ffc3[_0x1841('0x56')](0x0);_0x28ffc3[_0x1841('0x57')]=_0x28ffc3[_0x1841('0x58')][_0x1841('0x55')]['remoteAddress']+':'+_0x28ffc3[_0x1841('0x58')][_0x1841('0x55')][_0x1841('0x59')];_0x28ffc3[_0x1841('0x5a')]=new Date();_0x28ffc3[_0x1841('0x54')]=function(_0x19e5b7){console[_0x1841('0x54')](_0x1841('0x5b')+_0x28ffc3[_0x1841('0x5c')]['name']+'['+_0x28ffc3[_0x1841('0x57')]+']',_0x19e5b7);};_0x28ffc3['on'](_0x1841('0x5d'),function(){onDisconnect(_0x28ffc3,_0x1659bc);_0x28ffc3[_0x1841('0x54')](_0x1841('0x5e'));});onConnect(_0x28ffc3);_0x28ffc3[_0x1841('0x54')]('CONNECTED');});}; \ No newline at end of file +var _0xbd89=['SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','user','voice:inbound','voice:outbound','ChatQueues','SmsQueue','MailQueues','WhatsappQueues','getVoiceQueues','getFaxQueues','getMailQueues','getWhatsappQueues','all','length','chat','fax','sms','mail','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','removeChatInteractions','emit','leave','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','user_has_openchannel_interactions:remove','WhatsappInteractions','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','connection','address','remoteAddress','request','remotePort','connectedAt','log','SocketIO\x20','disconnect','DISCONNECTED','CONNECTED','../mysqldb','name','Agents','User','role','telephone','agent','type','ivr','findOne','then','VoiceQueues','FaxQueues','SmsQueues','OpenchannelQueues','findAll','Telephones','IvrCampaigns','UserProfileResource','resourceId','map','Campaign','where','format','%s:queue:%s','user:%s','handshake','query','find','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions'];(function(_0x6efabe,_0x564e16){var _0x30cef3=function(_0x3451b){while(--_0x3451b){_0x6efabe['push'](_0x6efabe['shift']());}};_0x30cef3(++_0x564e16);}(_0xbd89,0x9e));var _0x9bd8=function(_0x256395,_0x282d01){_0x256395=_0x256395-0x0;var _0x12d8da=_0xbd89[_0x256395];return _0x12d8da;};'use strict';var _=require('lodash');var util=require('util');var BPromise=require('bluebird');var db=require(_0x9bd8('0x0'))['db'];var config=require('./environment');var queryQueues={'attributes':['id',_0x9bd8('0x1')],'include':[{'as':_0x9bd8('0x2'),'model':db[_0x9bd8('0x3')],'attributes':['id',_0x9bd8('0x1'),_0x9bd8('0x4')],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x9bd8('0x1')],'where':{'role':_0x9bd8('0x5')}};var queryTrunks={'raw':!![],'attributes':['id',_0x9bd8('0x1')]};var queryAgents={'raw':!![],'attributes':['id',_0x9bd8('0x1')],'where':{'role':_0x9bd8('0x6')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x9bd8('0x1'),_0x9bd8('0x7')],'where':{'type':_0x9bd8('0x8')}};function getAssociatedResources(_0x13c974,_0x13d19f,_0x531a57){return db['UserProfileSection'][_0x9bd8('0x9')]({'where':{'name':_0x13c974,'userProfileId':_0x13d19f},'raw':!![]})[_0x9bd8('0xa')](function(_0x270598){if(_0x270598){if(_0x270598['autoAssociation']){switch(_0x13c974){case _0x9bd8('0xb'):case'ChatQueues':case _0x9bd8('0xc'):case _0x9bd8('0xd'):case'MailQueues':case _0x9bd8('0xe'):case'WhatsappQueues':return db[_0x531a57][_0x9bd8('0xf')](queryQueues);case _0x9bd8('0x10'):return db[_0x531a57][_0x9bd8('0xf')](queryTelephones);case'Trunks':return db[_0x531a57][_0x9bd8('0xf')](queryTrunks);case _0x9bd8('0x11'):return db[_0x531a57][_0x9bd8('0xf')](queryCampaigns);}}else{return db[_0x9bd8('0x12')][_0x9bd8('0xf')]({'attributes':[_0x9bd8('0x13')],'where':{'sectionId':_0x270598['id']},'raw':!![]})['then'](function(_0x14d7aa){if(_0x14d7aa){var _0x19d291={'where':{'id':_[_0x9bd8('0x14')](_0x14d7aa,_0x9bd8('0x13'))},'raw':!![]};switch(_0x531a57){case'User':_0x19d291['where']['role']=_0x9bd8('0x5');break;case _0x9bd8('0x15'):_0x19d291[_0x9bd8('0x16')]['type']=_0x9bd8('0x8');break;}return db[_0x531a57][_0x9bd8('0xf')](_0x19d291);}else{return[];}});}}else{return[];}})[_0x9bd8('0xa')](function(_0x24f2be){return _0x24f2be;});}function joinOrLeaveQueues(_0x50b1cb,_0x5dd147,_0x55a81f,_0x1fafbb){_0x50b1cb[_0x5dd147](util[_0x9bd8('0x17')](_0x9bd8('0x18'),_0x55a81f,_0x1fafbb[_0x9bd8('0x1')]));if(_0x1fafbb[_0x9bd8('0x2')]){for(var _0x56036c=0x0;_0x56036c<_0x1fafbb[_0x9bd8('0x2')]['length'];_0x56036c+=0x1){_0x50b1cb[_0x5dd147](util[_0x9bd8('0x17')](_0x9bd8('0x19'),_0x1fafbb['Agents'][_0x56036c][_0x9bd8('0x1')]));}}}function joinOrLeave(_0x534260,_0x5c0b12,_0x51397d){var _0x150ec2;if(_0x534260[_0x9bd8('0x1a')][_0x9bd8('0x1b')]['id']){db['User'][_0x9bd8('0x1c')]({'attributes':['id','name','role',_0x9bd8('0x1d')],'where':{'id':_0x534260['handshake'][_0x9bd8('0x1b')]['id']},'include':[{'model':db[_0x9bd8('0x1e')],'as':_0x9bd8('0x1f'),'attributes':['id'],'raw':!![]},{'model':db[_0x9bd8('0x20')],'as':_0x9bd8('0x21'),'attributes':['id'],'raw':!![]},{'model':db[_0x9bd8('0x22')],'as':_0x9bd8('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0x9bd8('0x24')],'as':_0x9bd8('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x9bd8('0x26')],'as':_0x9bd8('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x9bd8('0x28')],'as':'WhatsappInteractions','attributes':['id'],'raw':!![]}]})['then'](function(_0x5ba530){if(_0x5ba530){_0x150ec2=_0x5ba530;_0x534260[_0x5c0b12](util[_0x9bd8('0x17')](_0x9bd8('0x19'),_0x5ba530[_0x9bd8('0x1')]));var _0x18fba7=[];switch(_0x5ba530[_0x9bd8('0x4')]){case'admin':_0x534260[_0x5c0b12]('voice:inbound');_0x534260[_0x5c0b12]('voice:outbound');if(queryQueues[_0x9bd8('0x29')](_0x9bd8('0x2a'))){delete queryQueues[_0x9bd8('0x2a')];}_0x18fba7[_0x9bd8('0x2b')](db[_0x9bd8('0x2c')]['findAll'](queryQueues));_0x18fba7['push'](db[_0x9bd8('0x2d')][_0x9bd8('0xf')](queryQueues));_0x18fba7[_0x9bd8('0x2b')](db[_0x9bd8('0x2e')][_0x9bd8('0xf')](queryQueues));_0x18fba7[_0x9bd8('0x2b')](db['SmsQueue'][_0x9bd8('0xf')](queryQueues));_0x18fba7[_0x9bd8('0x2b')](db[_0x9bd8('0x2f')][_0x9bd8('0xf')](queryQueues));_0x18fba7[_0x9bd8('0x2b')](db[_0x9bd8('0x30')][_0x9bd8('0xf')](queryQueues));_0x18fba7['push'](db[_0x9bd8('0x31')][_0x9bd8('0xf')](queryQueues));_0x18fba7['push'](db[_0x9bd8('0x3')][_0x9bd8('0xf')](queryTelephones));_0x18fba7[_0x9bd8('0x2b')](db[_0x9bd8('0x32')][_0x9bd8('0xf')](queryTrunks));_0x18fba7['push'](db[_0x9bd8('0x15')]['findAll'](queryCampaigns));_0x18fba7[_0x9bd8('0x2b')](db[_0x9bd8('0x3')][_0x9bd8('0xf')](queryAgents));break;case _0x9bd8('0x33'):_0x534260[_0x5c0b12](_0x9bd8('0x34'));_0x534260[_0x5c0b12](_0x9bd8('0x35'));_0x18fba7[_0x9bd8('0x2b')](getAssociatedResources(_0x9bd8('0xb'),_0x5ba530[_0x9bd8('0x1d')],'VoiceQueue'));_0x18fba7[_0x9bd8('0x2b')](getAssociatedResources(_0x9bd8('0x36'),_0x5ba530['userProfileId'],'ChatQueue'));_0x18fba7[_0x9bd8('0x2b')](getAssociatedResources(_0x9bd8('0xc'),_0x5ba530[_0x9bd8('0x1d')],'FaxQueue'));_0x18fba7['push'](getAssociatedResources(_0x9bd8('0xd'),_0x5ba530[_0x9bd8('0x1d')],_0x9bd8('0x37')));_0x18fba7[_0x9bd8('0x2b')](getAssociatedResources(_0x9bd8('0x38'),_0x5ba530[_0x9bd8('0x1d')],_0x9bd8('0x2f')));_0x18fba7[_0x9bd8('0x2b')](getAssociatedResources(_0x9bd8('0xe'),_0x5ba530['userProfileId'],_0x9bd8('0x30')));_0x18fba7[_0x9bd8('0x2b')](getAssociatedResources(_0x9bd8('0x39'),_0x5ba530[_0x9bd8('0x1d')],_0x9bd8('0x31')));_0x18fba7[_0x9bd8('0x2b')](getAssociatedResources(_0x9bd8('0x10'),_0x5ba530['userProfileId'],_0x9bd8('0x3')));_0x18fba7[_0x9bd8('0x2b')](getAssociatedResources('Trunks',_0x5ba530[_0x9bd8('0x1d')],_0x9bd8('0x32')));_0x18fba7[_0x9bd8('0x2b')](getAssociatedResources(_0x9bd8('0x11'),_0x5ba530[_0x9bd8('0x1d')],_0x9bd8('0x15')));_0x18fba7[_0x9bd8('0x2b')](db[_0x9bd8('0x3')]['findAll'](queryAgents));break;case'agent':_0x534260[_0x5c0b12](_0x9bd8('0x34'));_0x534260[_0x5c0b12](_0x9bd8('0x35'));_0x18fba7[_0x9bd8('0x2b')](_0x5ba530[_0x9bd8('0x3a')]({'attributes':['id','name']}));_0x18fba7[_0x9bd8('0x2b')](_0x5ba530['getChatQueues']({'attributes':['id',_0x9bd8('0x1')]}));_0x18fba7[_0x9bd8('0x2b')](_0x5ba530[_0x9bd8('0x3b')]({'attributes':['id',_0x9bd8('0x1')]}));_0x18fba7[_0x9bd8('0x2b')](_0x5ba530['getSmsQueues']({'attributes':['id',_0x9bd8('0x1')]}));_0x18fba7[_0x9bd8('0x2b')](_0x5ba530[_0x9bd8('0x3c')]({'attributes':['id','name']}));_0x18fba7[_0x9bd8('0x2b')](_0x5ba530['getOpenchannelQueues']({'attributes':['id','name']}));_0x18fba7[_0x9bd8('0x2b')](_0x5ba530[_0x9bd8('0x3d')]({'attributes':['id',_0x9bd8('0x1')]}));break;}return BPromise[_0x9bd8('0x3e')](_0x18fba7);}})['then'](function(_0x1be420){if(_0x1be420&&_0x1be420[_0x9bd8('0x3f')]){for(var _0x348c74=0x0;_0x348c74<_0x1be420[_0x9bd8('0x3f')];_0x348c74+=0x1){for(var _0x2fdcbb=0x0;_0x2fdcbb<_0x1be420[_0x348c74][_0x9bd8('0x3f')];_0x2fdcbb+=0x1){switch(_0x348c74){case 0x0:joinOrLeaveQueues(_0x534260,_0x5c0b12,'voice',_0x1be420[_0x348c74][_0x2fdcbb]);break;case 0x1:joinOrLeaveQueues(_0x534260,_0x5c0b12,_0x9bd8('0x40'),_0x1be420[_0x348c74][_0x2fdcbb]);break;case 0x2:joinOrLeaveQueues(_0x534260,_0x5c0b12,_0x9bd8('0x41'),_0x1be420[_0x348c74][_0x2fdcbb]);break;case 0x3:joinOrLeaveQueues(_0x534260,_0x5c0b12,_0x9bd8('0x42'),_0x1be420[_0x348c74][_0x2fdcbb]);break;case 0x4:joinOrLeaveQueues(_0x534260,_0x5c0b12,_0x9bd8('0x43'),_0x1be420[_0x348c74][_0x2fdcbb]);break;case 0x5:joinOrLeaveQueues(_0x534260,_0x5c0b12,'openchannel',_0x1be420[_0x348c74][_0x2fdcbb]);break;case 0x6:joinOrLeaveQueues(_0x534260,_0x5c0b12,_0x9bd8('0x44'),_0x1be420[_0x348c74][_0x2fdcbb]);break;case 0x7:if(_0x150ec2[_0x9bd8('0x4')]!==_0x9bd8('0x6'))_0x534260[_0x5c0b12](util[_0x9bd8('0x17')](_0x9bd8('0x45'),_0x1be420[_0x348c74][_0x2fdcbb][_0x9bd8('0x1')]));break;case 0x8:if(_0x150ec2[_0x9bd8('0x4')]!==_0x9bd8('0x6'))_0x534260[_0x5c0b12](util['format'](_0x9bd8('0x46'),_0x1be420[_0x348c74][_0x2fdcbb][_0x9bd8('0x1')]));break;case 0x9:if(_0x150ec2[_0x9bd8('0x4')]!==_0x9bd8('0x6'))_0x534260[_0x5c0b12](util['format'](_0x9bd8('0x47'),_0x1be420[_0x348c74][_0x2fdcbb][_0x9bd8('0x7')],_0x1be420[_0x348c74][_0x2fdcbb]['name']));break;case 0xa:_0x534260[_0x5c0b12](util[_0x9bd8('0x17')](_0x9bd8('0x19'),_0x1be420[_0x348c74][_0x2fdcbb][_0x9bd8('0x1')]));break;}}}}})[_0x9bd8('0xa')](function(){if(_0x5c0b12==='leave'){var _0xef4927=_[_0x9bd8('0x14')](_0x150ec2[_0x9bd8('0x1f')],'id');return _0x150ec2[_0x9bd8('0x48')](_0xef4927)[_0x9bd8('0xa')](function(){for(var _0x66eb9a=0x0;_0x66eb9a<_0xef4927['length'];_0x66eb9a+=0x1){_0x51397d[_0x9bd8('0x49')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0xef4927[_0x66eb9a]),'UserId':Number(_0x150ec2['id'])});}});}})[_0x9bd8('0xa')](function(){if(_0x5c0b12===_0x9bd8('0x4a')){var _0x2b1e64=_[_0x9bd8('0x14')](_0x150ec2[_0x9bd8('0x21')],'id');return _0x150ec2[_0x9bd8('0x4b')](_0x2b1e64)[_0x9bd8('0xa')](function(){for(var _0x5b2d6a=0x0;_0x5b2d6a<_0x2b1e64[_0x9bd8('0x3f')];_0x5b2d6a+=0x1){_0x51397d['emit'](_0x9bd8('0x4c'),{'MailInteractionId':Number(_0x2b1e64[_0x5b2d6a]),'UserId':Number(_0x150ec2['id'])});}});}})[_0x9bd8('0xa')](function(){if(_0x5c0b12===_0x9bd8('0x4a')){var _0x4bd57e=_[_0x9bd8('0x14')](_0x150ec2[_0x9bd8('0x23')],'id');return _0x150ec2[_0x9bd8('0x4d')](_0x4bd57e)[_0x9bd8('0xa')](function(){for(var _0x57ee9c=0x0;_0x57ee9c<_0x4bd57e[_0x9bd8('0x3f')];_0x57ee9c+=0x1){_0x51397d[_0x9bd8('0x49')](_0x9bd8('0x4e'),{'FaxInteractionId':Number(_0x4bd57e[_0x57ee9c]),'UserId':Number(_0x150ec2['id'])});}});}})['then'](function(){if(_0x5c0b12===_0x9bd8('0x4a')){var _0x7848b=_[_0x9bd8('0x14')](_0x150ec2[_0x9bd8('0x25')],'id');return _0x150ec2[_0x9bd8('0x4f')](_0x7848b)[_0x9bd8('0xa')](function(){for(var _0x316771=0x0;_0x316771<_0x7848b[_0x9bd8('0x3f')];_0x316771+=0x1){_0x51397d[_0x9bd8('0x49')](_0x9bd8('0x50'),{'SmsInteractionId':Number(_0x7848b[_0x316771]),'UserId':Number(_0x150ec2['id'])});}});}})[_0x9bd8('0xa')](function(){if(_0x5c0b12===_0x9bd8('0x4a')){var _0x3b0e17=_['map'](_0x150ec2[_0x9bd8('0x27')],'id');return _0x150ec2['removeOpenchannelInteractions'](_0x3b0e17)[_0x9bd8('0xa')](function(){for(var _0x10c985=0x0;_0x10c985<_0x3b0e17[_0x9bd8('0x3f')];_0x10c985+=0x1){_0x51397d[_0x9bd8('0x49')](_0x9bd8('0x51'),{'OpenchannelInteractionId':Number(_0x3b0e17[_0x10c985]),'UserId':Number(_0x150ec2['id'])});}});}})['then'](function(){if(_0x5c0b12===_0x9bd8('0x4a')){var _0x14ff6e=_['map'](_0x150ec2[_0x9bd8('0x52')],'id');return _0x150ec2[_0x9bd8('0x53')](_0x14ff6e)[_0x9bd8('0xa')](function(){for(var _0x2185a0=0x0;_0x2185a0<_0x14ff6e[_0x9bd8('0x3f')];_0x2185a0+=0x1){_0x51397d[_0x9bd8('0x49')](_0x9bd8('0x54'),{'WhatsappInteractionId':Number(_0x14ff6e[_0x2185a0]),'UserId':Number(_0x150ec2['id'])});}});}})[_0x9bd8('0x55')](function(_0x5ed68d){_0x534260['log'](_0x5ed68d);});}}function onDisconnect(_0x52a136,_0x26e873){joinOrLeave(_0x52a136,'leave',_0x26e873);}function onConnect(_0x3c78bc){joinOrLeave(_0x3c78bc,'join');}exports['default']=function(_0x3f4cdd){_0x3f4cdd['on'](_0x9bd8('0x56'),function(_0x5efce1){_0x5efce1['setMaxListeners'](0x0);_0x5efce1[_0x9bd8('0x57')]=_0x5efce1['request'][_0x9bd8('0x56')][_0x9bd8('0x58')]+':'+_0x5efce1[_0x9bd8('0x59')][_0x9bd8('0x56')][_0x9bd8('0x5a')];_0x5efce1[_0x9bd8('0x5b')]=new Date();_0x5efce1['log']=function(_0x367ac7){console[_0x9bd8('0x5c')](_0x9bd8('0x5d')+_0x5efce1['nsp'][_0x9bd8('0x1')]+'['+_0x5efce1[_0x9bd8('0x57')]+']',_0x367ac7);};_0x5efce1['on'](_0x9bd8('0x5e'),function(){onDisconnect(_0x5efce1,_0x3f4cdd);_0x5efce1[_0x9bd8('0x5c')](_0x9bd8('0x5f'));});onConnect(_0x5efce1);_0x5efce1[_0x9bd8('0x5c')](_0x9bd8('0x60'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 1c0759d..fde9da4 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 _0x6bdc=['then','info','Trigger,\x20%s','error','code','catch','get','channel','direction','resolve','ContactId','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','query','Sequelize','SELECT','contact','UserId','undefined','format','name','agent','incomingmessage','outgoingmessage','motionChannel','event','QueryTypes','interface','SIP/%s','AfterCreate','closed','substatus','AfterUpdate','User','find','fullname','email','hasOwnProperty','model','hook','callback','toLowerCase','../../mysqldb','jayson/promise','../logger','triggers','client','afterCreate','newinteraction','Chat','closedinteraction','ChatMessage','ChatOfflineMessage','newmessage','Sms','afterUpdate','SmsMessage','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','MailMessage','OpenchannelInteraction','Openchannel','request','EventManager'];(function(_0x11bd67,_0x34201e){var _0x236091=function(_0x144887){while(--_0x144887){_0x11bd67['push'](_0x11bd67['shift']());}};_0x236091(++_0x34201e);}(_0x6bdc,0x70));var _0xc6bd=function(_0x2eaea0,_0x3ce341){_0x2eaea0=_0x2eaea0-0x0;var _0x3a6ba8=_0x6bdc[_0x2eaea0];return _0x3a6ba8;};'use strict';var util=require('util');var db=require(_0xc6bd('0x0'))['db'];var jayson=require(_0xc6bd('0x1'));var logger=require(_0xc6bd('0x2'))(_0xc6bd('0x3'));var client=jayson[_0xc6bd('0x4')]['http']({'port':0x232a});var triggers=[{'channel':'Chat','model':'ChatInteraction','event':_0xc6bd('0x5'),'condition':_0xc6bd('0x6'),'callback':afterCreate},{'channel':_0xc6bd('0x7'),'model':'ChatInteraction','event':'afterUpdate','condition':_0xc6bd('0x8'),'callback':afterUpdate},{'channel':_0xc6bd('0x7'),'model':_0xc6bd('0x9'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':'Chat','model':_0xc6bd('0xa'),'event':_0xc6bd('0x5'),'condition':_0xc6bd('0xb'),'callback':afterCreateOfflineMessage},{'channel':_0xc6bd('0xc'),'model':'SmsInteraction','event':_0xc6bd('0x5'),'condition':'newinteraction','callback':afterCreate},{'channel':_0xc6bd('0xc'),'model':'SmsInteraction','event':_0xc6bd('0xd'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xc6bd('0xc'),'model':_0xc6bd('0xe'),'event':_0xc6bd('0x5'),'condition':_0xc6bd('0xb'),'callback':afterCreateMessage},{'channel':_0xc6bd('0xf'),'model':_0xc6bd('0x10'),'event':_0xc6bd('0x5'),'condition':_0xc6bd('0x6'),'callback':afterCreate},{'channel':_0xc6bd('0xf'),'model':_0xc6bd('0x10'),'event':_0xc6bd('0xd'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xc6bd('0xf'),'model':_0xc6bd('0x11'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0xc6bd('0x12'),'model':_0xc6bd('0x13'),'event':_0xc6bd('0x5'),'condition':_0xc6bd('0x6'),'callback':afterCreate},{'channel':'Fax','model':_0xc6bd('0x13'),'event':_0xc6bd('0xd'),'condition':_0xc6bd('0x8'),'callback':afterUpdate},{'channel':'Fax','model':_0xc6bd('0x14'),'event':_0xc6bd('0x5'),'condition':_0xc6bd('0xb'),'callback':afterCreateMessage},{'channel':_0xc6bd('0x15'),'model':_0xc6bd('0x16'),'event':'afterCreate','condition':_0xc6bd('0x6'),'callback':afterCreate},{'channel':'Mail','model':_0xc6bd('0x16'),'event':'afterUpdate','condition':_0xc6bd('0x8'),'callback':afterUpdate},{'channel':_0xc6bd('0x15'),'model':_0xc6bd('0x17'),'event':_0xc6bd('0x5'),'condition':_0xc6bd('0xb'),'callback':afterCreateMessage},{'channel':'Openchannel','model':_0xc6bd('0x18'),'event':'afterCreate','condition':_0xc6bd('0x6'),'callback':afterCreate},{'channel':_0xc6bd('0x19'),'model':'OpenchannelInteraction','event':'afterUpdate','condition':_0xc6bd('0x8'),'callback':afterUpdate},{'channel':_0xc6bd('0x19'),'model':'OpenchannelMessage','event':_0xc6bd('0x5'),'condition':_0xc6bd('0xb'),'callback':afterCreateMessage}];function request(_0x8e6107){return client[_0xc6bd('0x1a')](_0xc6bd('0x1b'),_0x8e6107)[_0xc6bd('0x1c')](function(_0x37426b){logger[_0xc6bd('0x1d')](_0xc6bd('0x1e'),'EventManager',_0x37426b);if(_0x37426b[_0xc6bd('0x1f')]){if(_0x37426b['error'][_0xc6bd('0x20')]===0x1f4){logger[_0xc6bd('0x1f')](_0xc6bd('0x1e'),_0xc6bd('0x1b'),_0x37426b['error']);}}})[_0xc6bd('0x21')](function(_0x55a6f3){logger[_0xc6bd('0x1f')](_0xc6bd('0x1e'),_0xc6bd('0x1b'),_0x55a6f3);});}function afterCreateMessage(_0x52ee39){return function(_0x322021){_0x322021=_0x322021[_0xc6bd('0x22')]({'plain':!![]});_0x322021[_0xc6bd('0x23')]=_0x52ee39;_0x322021['motionChannel']=_0x52ee39;_0x322021['event']=_0x322021[_0xc6bd('0x24')];Promise[_0xc6bd('0x25')]()['then'](function(){if(typeof _0x322021[_0xc6bd('0x26')]==='undefined')return null;var _0x12ae8c=_0xc6bd('0x27')+_0x322021[_0xc6bd('0x26')];return db[_0xc6bd('0x28')][_0xc6bd('0x29')](_0x12ae8c,{'type':db[_0xc6bd('0x2a')]['QueryTypes'][_0xc6bd('0x2b')],'raw':!![]});})['then'](function(_0x40ff8d){if(_0x40ff8d){_0x322021[_0xc6bd('0x2c')]=_0x40ff8d[0x0];}if(typeof _0x322021[_0xc6bd('0x2d')]===_0xc6bd('0x2e'))return;return getAgent(_0x322021[_0xc6bd('0x2d')]);})[_0xc6bd('0x1c')](function(_0x320495){if(_0x320495){_0x322021['interface']=util[_0xc6bd('0x2f')]('SIP/%s',_0x320495[_0xc6bd('0x30')]);_0x322021[_0xc6bd('0x31')]=_0x320495;_0x322021[_0xc6bd('0x23')]=_0x52ee39;return request({'event':_0xc6bd('0x32'),'message':_0x322021});}else{return request({'event':_0xc6bd('0x33'),'message':_0x322021});}})[_0xc6bd('0x21')](function(_0x5a16da){logger[_0xc6bd('0x1f')]('Trigger,\x20%s','AfterCreateMessage',_0x5a16da);});};}function afterCreateOfflineMessage(_0x4ad78f){return function(_0xcc6fa5){_0xcc6fa5=_0xcc6fa5['get']({'plain':!![]});_0xcc6fa5[_0xc6bd('0x23')]=_0x4ad78f;_0xcc6fa5[_0xc6bd('0x34')]=_0x4ad78f;_0xcc6fa5[_0xc6bd('0x35')]='offlineMessage';return request({'event':_0xcc6fa5[_0xc6bd('0x35')],'message':_0xcc6fa5});};}function afterCreate(_0x248164,_0x33f147){return function(_0x44c0c){_0x44c0c=_0x44c0c[_0xc6bd('0x22')]({'plain':!![]});_0x44c0c[_0xc6bd('0x23')]=_0x248164;_0x44c0c[_0xc6bd('0x34')]=_0x248164;_0x44c0c[_0xc6bd('0x35')]='opened';Promise['resolve']()[_0xc6bd('0x1c')](function(){var _0x15b6b4=_0xc6bd('0x27')+_0x44c0c[_0xc6bd('0x26')];return db[_0xc6bd('0x28')]['query'](_0x15b6b4,{'type':db[_0xc6bd('0x2a')][_0xc6bd('0x36')][_0xc6bd('0x2b')],'raw':!![]});})[_0xc6bd('0x1c')](function(_0x7725c3){if(_0x7725c3){_0x44c0c['contact']=_0x7725c3[0x0];}if(typeof _0x44c0c['UserId']===_0xc6bd('0x2e'))return;return getAgent(_0x44c0c[_0xc6bd('0x2d')]);})[_0xc6bd('0x1c')](function(_0x4f614c){if(_0x4f614c){_0x44c0c[_0xc6bd('0x37')]=util[_0xc6bd('0x2f')](_0xc6bd('0x38'),_0x4f614c[_0xc6bd('0x30')]);_0x44c0c['agent']=_0x4f614c;}return request({'event':_0x33f147,'message':_0x44c0c});})[_0xc6bd('0x21')](function(_0x5ab93){logger[_0xc6bd('0x1f')](_0xc6bd('0x1e'),_0xc6bd('0x39'),_0x5ab93);});};}function afterUpdate(_0x3f366f){return function(_0x4bf3d3){var _0x354726=_0x4bf3d3['changed'](_0xc6bd('0x3a'))&&_0x4bf3d3['closed'];var _0x318508=_0x4bf3d3['changed'](_0xc6bd('0x3b'));if(_0x354726||_0x318508){var _0x52a5b2=_0x354726?_0xc6bd('0x8'):_0xc6bd('0x3b');var _0x26281c=_0x4bf3d3[_0xc6bd('0x22')]({'plain':!![]});_0x26281c[_0xc6bd('0x23')]=_0x3f366f;_0x26281c[_0xc6bd('0x34')]=_0x3f366f;_0x26281c[_0xc6bd('0x35')]=_0x354726?_0xc6bd('0x3a'):_0xc6bd('0x3b');var _0x3a9a36=_0xc6bd('0x27')+_0x26281c[_0xc6bd('0x26')];return db[_0xc6bd('0x28')]['query'](_0x3a9a36,{'type':db[_0xc6bd('0x2a')]['QueryTypes'][_0xc6bd('0x2b')],'raw':!![]})[_0xc6bd('0x1c')](function(_0x3b5dbd){if(_0x3b5dbd){_0x26281c['contact']=_0x3b5dbd[0x0];}if(typeof _0x26281c[_0xc6bd('0x2d')]===_0xc6bd('0x2e'))return;return getAgent(_0x26281c['UserId']);})['then'](function(_0x2d5977){if(_0x2d5977){_0x26281c[_0xc6bd('0x37')]=util[_0xc6bd('0x2f')](_0xc6bd('0x38'),_0x2d5977['name']);_0x26281c[_0xc6bd('0x31')]=_0x2d5977;}return request({'event':_0x52a5b2,'message':_0x26281c});})[_0xc6bd('0x21')](function(_0x31c194){logger[_0xc6bd('0x1f')]('Trigger,\x20%s',_0xc6bd('0x3c'),_0x31c194);});}};}function getAgent(_0x397a13){return db[_0xc6bd('0x3d')][_0xc6bd('0x3e')]({'where':{'id':_0x397a13},'attributes':['id',_0xc6bd('0x30'),_0xc6bd('0x3f'),_0xc6bd('0x40'),'internal'],'raw':!![]})[_0xc6bd('0x1c')](function(_0x278c7b){return _0x278c7b;});}exports['default']=function(){for(var _0x45e21a=0x0;_0x45e21a=_0xe69916['agents']){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x1964e3(_0x5980e2);})['catch'](function(_0x5b05ae){_0x2665cd(_0x5b05ae);});});}; \ No newline at end of file +var _0x8814=['agents','catch','lodash','bluebird','./license/util','chat','fax','sms','whatsapp','openchannel','getChannels','clearBlockUser','isUndefined','blockedAt','updateAttributes','role','agent','User','count','then','getLicense'];(function(_0x68aa08,_0x1d97c9){var _0x585901=function(_0x59b187){while(--_0x59b187){_0x68aa08['push'](_0x68aa08['shift']());}};_0x585901(++_0x1d97c9);}(_0x8814,0x152));var _0x4881=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0x8814[_0x36c5b0];return _0xf19333;};'use strict';var _=require(_0x4881('0x0'));var BPromise=require(_0x4881('0x1'));var db=require('../mysqldb')['db'];var util=require(_0x4881('0x2'));var channels=['voice','mail',_0x4881('0x3'),_0x4881('0x4'),_0x4881('0x5'),_0x4881('0x6'),_0x4881('0x7')];exports[_0x4881('0x8')]=function(){return channels;};exports['isValidChannel']=function(_0x3be69c){_0x3be69c=_0x3be69c['toLowerCase']();return _['includes'](channels,_0x3be69c);};exports[_0x4881('0x9')]=function(_0x2fd1f5,_0x2a86f7,_0x40767f,_0xa891de){var _0x434c82={'loginAttempts':_0x2a86f7,'blocked':_0x40767f};if(!_[_0x4881('0xa')](_0xa891de)){_0x434c82[_0x4881('0xb')]=_0xa891de;}return _0x2fd1f5[_0x4881('0xc')](_0x434c82);};exports['getLicense']=function(_0x3a6895){return new BPromise(function(_0x1fb7d9,_0x12ccf7){var _0x4ca788=0x0;if(_0x3a6895[_0x4881('0xd')]!==_0x4881('0xe')){_0x1fb7d9(_0x3a6895);}db[_0x4881('0xf')][_0x4881('0x10')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x3a6895['id']}}})[_0x4881('0x11')](function(_0x3fb1ed){_0x4ca788=_0x3fb1ed;return util[_0x4881('0x12')]();})[_0x4881('0x11')](function(_0xf34294){if(_0xf34294&&_0xf34294[_0x4881('0x13')]&&_0x4ca788>=_0xf34294[_0x4881('0x13')]){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x1fb7d9(_0x3a6895);})[_0x4881('0x14')](function(_0x35946e){_0x12ccf7(_0x35946e);});});}; \ No newline at end of file diff --git a/server/errors/api.js b/server/errors/api.js index e80c6ea..2fa970e 100644 --- a/server/errors/api.js +++ b/server/errors/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcbd4=['Entity\x20not\x20found','Out\x20Of\x20Interval','statusMessage','status','send','util','../config/logger','message','Internal\x20Server\x20Error','name','Error','Bad\x20Request','inherits','Forbidden'];(function(_0x2d34d6,_0x397ff9){var _0x1d3d12=function(_0x558800){while(--_0x558800){_0x2d34d6['push'](_0x2d34d6['shift']());}};_0x1d3d12(++_0x397ff9);}(_0xcbd4,0x1c5));var _0x4cbd=function(_0x3afec2,_0x5bb55b){_0x3afec2=_0x3afec2-0x0;var _0x3aab42=_0xcbd4[_0x3afec2];return _0x3aab42;};'use strict';var util=require(_0x4cbd('0x0'));var logger=require(_0x4cbd('0x1'))('api');var APIError=function(_0x1f71f3,_0x3dcff5){this[_0x4cbd('0x2')]=_0x1f71f3||_0x4cbd('0x3');this[_0x4cbd('0x4')]=_0x3dcff5||_0x4cbd('0x5');util['inherits'](APIError,Error);};var APIBadRequestError=function(_0x30973a){this[_0x4cbd('0x2')]=_0x30973a||_0x4cbd('0x6');this['name']=_0x4cbd('0x6');util[_0x4cbd('0x7')](APIBadRequestError,APIError);};var APIForbiddenError=function(_0x20703b){this[_0x4cbd('0x2')]=_0x20703b||_0x4cbd('0x8');this[_0x4cbd('0x4')]=_0x4cbd('0x8');util[_0x4cbd('0x7')](APIForbiddenError,APIError);};var APINotFoundError=function(_0x202227){this['message']=_0x202227||_0x4cbd('0x9');this[_0x4cbd('0x4')]='Not\x20Found';util[_0x4cbd('0x7')](APINotFoundError,APIError);};var APIOutOfIntervalError=function(_0x535727){this[_0x4cbd('0x2')]=_0x535727||'Message\x20sent\x20outside\x20a\x20valid\x20interval';this['name']=_0x4cbd('0xa');util[_0x4cbd('0x7')](APIOutOfIntervalError,APIError);};function getStatusCode(_0x4a0add){switch(_0x4a0add){case'Bad\x20Request':return 0x190;case _0x4cbd('0x8'),_0x4cbd('0xa'):return 0x193;case'Not\x20Found':return 0x194;default:return 0x1f4;}}function getCustomStatusMessage(_0x301f6f){if(_0x301f6f===_0x4cbd('0xa'))return _0x301f6f;return null;}function handleError(_0x4f3da7){return function(_0x5a0dd1){logger['error'](_0x5a0dd1['stack']);var _0xabfdb3=getStatusCode(_0x5a0dd1[_0x4cbd('0x4')]);var _0x1565a9=getCustomStatusMessage(_0x5a0dd1['name']);if(_0x5a0dd1['name'])delete _0x5a0dd1['name'];if(_0x1565a9)_0x4f3da7[_0x4cbd('0xb')]=_0x1565a9;return _0x4f3da7[_0x4cbd('0xc')](_0xabfdb3)[_0x4cbd('0xd')](_0x5a0dd1);};}module['exports']={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APIForbiddenError':APIForbiddenError,'APIOutOfIntervalError':APIOutOfIntervalError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file +var _0x814b=['statusMessage','status','send','exports','util','../config/logger','api','message','name','Error','inherits','Bad\x20Request','Entity\x20not\x20found','Not\x20Found','Message\x20sent\x20outside\x20a\x20valid\x20interval','Out\x20Of\x20Interval','error','stack'];(function(_0xde681d,_0x320776){var _0x58db6e=function(_0x3b33b2){while(--_0x3b33b2){_0xde681d['push'](_0xde681d['shift']());}};_0x58db6e(++_0x320776);}(_0x814b,0x1a2));var _0xb814=function(_0x31c796,_0x2e3c7f){_0x31c796=_0x31c796-0x0;var _0x128356=_0x814b[_0x31c796];return _0x128356;};'use strict';var util=require(_0xb814('0x0'));var logger=require(_0xb814('0x1'))(_0xb814('0x2'));var APIError=function(_0x2f4ece,_0xfbb64b){this[_0xb814('0x3')]=_0x2f4ece||'Internal\x20Server\x20Error';this[_0xb814('0x4')]=_0xfbb64b||_0xb814('0x5');util[_0xb814('0x6')](APIError,Error);};var APIBadRequestError=function(_0x4237bc){this[_0xb814('0x3')]=_0x4237bc||_0xb814('0x7');this['name']=_0xb814('0x7');util[_0xb814('0x6')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x5c8539){this[_0xb814('0x3')]=_0x5c8539||_0xb814('0x8');this[_0xb814('0x4')]=_0xb814('0x9');util[_0xb814('0x6')](APINotFoundError,APIError);};var APIOutOfIntervalError=function(_0x21d4a5){this[_0xb814('0x3')]=_0x21d4a5||_0xb814('0xa');this[_0xb814('0x4')]=_0xb814('0xb');util[_0xb814('0x6')](APIOutOfIntervalError,APIError);};function getStatusCode(_0x4b5f14){switch(_0x4b5f14){case _0xb814('0x7'):return 0x190;case'Forbidden',_0xb814('0xb'):return 0x193;case _0xb814('0x9'):return 0x194;default:return 0x1f4;}}function getCustomStatusMessage(_0x35b10d){if(_0x35b10d===_0xb814('0xb'))return _0x35b10d;return null;}function handleError(_0x2ce718){return function(_0x3bde14){logger[_0xb814('0xc')](_0x3bde14[_0xb814('0xd')]);var _0xa0a2e5=getStatusCode(_0x3bde14[_0xb814('0x4')]);var _0x3f4881=getCustomStatusMessage(_0x3bde14[_0xb814('0x4')]);if(_0x3bde14[_0xb814('0x4')])delete _0x3bde14[_0xb814('0x4')];if(_0x3f4881)_0x2ce718[_0xb814('0xe')]=_0x3f4881;return _0x2ce718[_0xb814('0xf')](_0xa0a2e5)[_0xb814('0x10')](_0x3bde14);};}module[_0xb814('0x11')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APIOutOfIntervalError':APIOutOfIntervalError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 367934f..5afd95e 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcaff=['exports','404','status','render','json','send'];(function(_0x5e77db,_0x356d1c){var _0x34b675=function(_0x4914b5){while(--_0x4914b5){_0x5e77db['push'](_0x5e77db['shift']());}};_0x34b675(++_0x356d1c);}(_0xcaff,0x96));var _0xfcaf=function(_0x2be2af,_0x192143){_0x2be2af=_0x2be2af-0x0;var _0x555456=_0xcaff[_0x2be2af];return _0x555456;};'use strict';module[_0xfcaf('0x0')][0x194]=function pageNotFound(_0x41f090,_0x8b5de0){var _0x2efe57=_0xfcaf('0x1');var _0x416a40=0x194;var _0x495e03={'status':_0x416a40};_0x8b5de0[_0xfcaf('0x2')](_0x495e03[_0xfcaf('0x2')]);_0x8b5de0[_0xfcaf('0x3')](_0x2efe57,{},function(_0x2fee49,_0x10c81a){if(_0x2fee49){return _0x8b5de0['status'](_0x495e03[_0xfcaf('0x2')])[_0xfcaf('0x4')](_0x495e03);}_0x8b5de0[_0xfcaf('0x5')](_0x10c81a);});}; \ No newline at end of file +var _0x404b=['json','send','exports','404','status','render'];(function(_0x330740,_0x58c0c0){var _0x1cb5f2=function(_0xa5c99a){while(--_0xa5c99a){_0x330740['push'](_0x330740['shift']());}};_0x1cb5f2(++_0x58c0c0);}(_0x404b,0x68));var _0xb404=function(_0x4b6649,_0x2e890a){_0x4b6649=_0x4b6649-0x0;var _0x2ab0fb=_0x404b[_0x4b6649];return _0x2ab0fb;};'use strict';module[_0xb404('0x0')][0x194]=function pageNotFound(_0x45132c,_0x27434d){var _0x34a6d4=_0xb404('0x1');var _0x1c2dfc=0x194;var _0xe60f={'status':_0x1c2dfc};_0x27434d['status'](_0xe60f[_0xb404('0x2')]);_0x27434d[_0xb404('0x3')](_0x34a6d4,{},function(_0x2600d7,_0x40315f){if(_0x2600d7){return _0x27434d[_0xb404('0x2')](_0xe60f[_0xb404('0x2')])[_0xb404('0x4')](_0xe60f);}_0x27434d[_0xb404('0x5')](_0x40315f);});}; \ No newline at end of file diff --git a/server/migrations/2.6.19.js b/server/migrations/2.6.19.js index c6780ae..4b7d9b5 100644 --- a/server/migrations/2.6.19.js +++ b/server/migrations/2.6.19.js @@ -267,11 +267,6 @@ module.exports = { }); // END whatsapp_interactions - //START cm_hopper - migration.query('ALTER TABLE `cm_hopper` DROP FOREIGN KEY `cm_hopper_ibfk_3`;'); - migration.query('ALTER TABLE `cm_hopper` ADD CONSTRAINT `cm_hopper_ibfk_3` FOREIGN KEY (`UserId`) REFERENCES `users`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;'); - //END cm_hopper - // START users migration.addColumn('users', 'messengerSoundNotification', { type: Sequelize.BOOLEAN, diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 575b93d..fb4cc77 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7eec=['ZendeskField','../api/intZendeskField/intZendeskField.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','VtigerField','ServicenowAccount','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','Dynamics365Configuration','../api/intDynamics365Field/intDynamics365Field.model','../api/intFreshsalesAccount/intFreshsalesAccount.model','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','../api/intFreshsalesField/intFreshsalesField.model','../api/network/network.model','ChatQueueReport','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','../api/smsQueueReport/smsQueueReport.model','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareRecording','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','CmList','../api/cmList/cmList.model','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','../api/userProfileResource/userProfileResource.model','../api/userNotification/userNotification.model','WhatsappAccount','WhatsappApplication','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','WhatsappTransferReport','../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','UserSetting','../api/user-setting/user-setting.model','hasOne','VoiceMail','UserId','userSetting','cascade','Recordings','hasMany','VoiceQueuesRt','Extensions','HopperFinals','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteractions','WhatsappInteractions','UserNotification','UserNotifications','SET\x20NULL','belongsTo','belongsToMany','Groups','chat_group_has_users','Contacts','cm_user_has_contacts','Lists','user_has_teams','MailInteractions','user_has_mail_interactions','user_has_chat_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefix','VoicePrefixes','MailQueues','ChatQueues','SmsQueues','OpenchannelQueues','WhatsappQueues','UserWhatsappQueue','cm_user_has_lists','ChatWebsite','ChatWebsites','user_has_chat_websites','MailAccount','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','SpiedAgents','ChanSpyId','Applications','VoiceMusicOnHold','moh_has_sounds','VoiceQueueId','HopperHistories','CmHopperBlack','HopperBlacks','JscriptySessions','TrunkBackupId','Interval','IntervalId','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','BlackLists','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','VoiceCallReport','QueueCalls','uniqueid','Contact','ContactId','MailAccountId','CloudProviderId','restrict','Answers','Interactions','ListId','team_has_mail_queues','Teams','MailInteractionId','Account','Owner','Tags','mail_interaction_has_tags','ChatWebsiteId','ChatOfflineMessageId','MailApplication','TagId','List','Items','Dispositions','FaxAccountId','Exntensions','mandatoryDispositionPause','user_has_fax_accounts','FaxInteractionId','fax_interaction_has_tags','Users','user_has_fax_interactions','Interaction','AttachmentId','team_has_fax_queues','SmsAccountId','SmsQueue','SmsInteractionId','sms_interaction_has_tags','UserSmsQueue','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelMessage','OpenchannelInteractionId','openchannel_interaction_has_tags','ThroughTags','team_has_openchannel_queues','ProactiveActions','ChatApplication','Agent','Queue','Website','chat_interaction_has_tags','ChatInteractionId','team_has_chat_queues','ChatGroup','Hoppers','Company','cm_contact_has_tags','AdditionalPhones','All','OneAll','AutomationAllId','Any','AutomationAnyId','Actions','AutomationId','Intervals','MailApplications','FaxApplications','SmsApplications','DefaultReportId','AnalyticCustomReport','CustomReportId','Mohs','whatsapp_interaction_has_tags','ItemTypeId','Hopper','CmContactId','Trigger','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','Fields','AnalyticMetric','MetricId','AccountId','Subjects','SubjectId','Descriptions','DescriptionId','SalesforceAccount','Description','Field','FieldId','Variable','VariableId','SugarcrmAccount','Configurations','Subject','DeskField','int_desk_configuration_has_tags','FreshdeskAccount','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','VtigerAccount','ServicenowConfiguration','Dynamics365Field','FreshsalesAccount','FreshsalesConfiguration','FreshsalesField','FromId','ToId','SessionId','SmsQueueReport','JscriptyQuestionReport','ProjectId','FaxQueues','team_has_whatsapp_queues','CampaignId','TrunkId','SquareProjectId','campaigns_has_cm_lists','FromMailAccountId','FromAccount','FromUserId','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','ToChatQueueId','ToChatWebsiteId','FromAgent','ToFaxQueueId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CmCustomField','CustomFields','Queues','userProfileId','UserProfileResource','Resources','sectionId','WhatsappAccountId','user_has_whatsapp_accounts','WhatsappInteractionId','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','user','Imap','Smtp','exports','../config/environment','sequelize','defaultsDeep','xcall','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','motion2','database','username','User','../api/user/user.model','VoiceChanSpy','import','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','VoiceExtension','../api/voiceExtension/voiceExtension.model','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','Trunk','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','MailMessage','../api/mailMessage/mailMessage.model','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','FaxInteraction','FaxMessage','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','ChatQueue','../api/chatQueue/chatQueue.model','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','Action','../api/automation/automation.model','CannedAnswer','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','../api/interval/interval.model','Pause','../api/pause/pause.model','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','../api/sound/sound.model','Tag','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','CmContactHasItem','../api/cmContactHasItem/cmContactHasItem.model','CmHopperAdditionalPhone','Template','../api/template/template.model','../api/trigger/trigger.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration'];(function(_0x30bd66,_0x36a93d){var _0x74c9dd=function(_0x2cd660){while(--_0x2cd660){_0x30bd66['push'](_0x30bd66['shift']());}};_0x74c9dd(++_0x36a93d);}(_0x7eec,0x149));var _0xc7ee=function(_0x1ae373,_0x3f74b2){_0x1ae373=_0x1ae373-0x0;var _0x124e6d=_0x7eec[_0x1ae373];return _0x124e6d;};'use strict';var config=require(_0xc7ee('0x0'));var Sequelize=require(_0xc7ee('0x1'));var _=require('lodash');var jstz=require('jstz');var timezone=jstz['determine']();config[_0xc7ee('0x1')]=_[_0xc7ee('0x2')](config[_0xc7ee('0x1')],{'database':'motion2','username':_0xc7ee('0x3'),'password':_0xc7ee('0x4'),'options':{'host':_0xc7ee('0x5'),'port':0xcea,'dialect':_0xc7ee('0x6'),'dialectOptions':{'charset':_0xc7ee('0x7')},'logging':![],'timezone':timezone[_0xc7ee('0x8')](),'define':{'charset':_0xc7ee('0x9'),'collate':_0xc7ee('0xa')}}});config[_0xc7ee('0xb')]=_[_0xc7ee('0x2')](config[_0xc7ee('0xb')],{'database':_0xc7ee('0xc'),'username':_0xc7ee('0x3'),'password':_0xc7ee('0x4'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0xc7ee('0x6'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0xc7ee('0x8')](),'define':{'charset':_0xc7ee('0x9'),'collate':_0xc7ee('0xa')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xc7ee('0x1')][_0xc7ee('0xd')],config[_0xc7ee('0x1')][_0xc7ee('0xe')],config[_0xc7ee('0x1')]['password'],config[_0xc7ee('0x1')]['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0xc7ee('0xd')],config[_0xc7ee('0xb')][_0xc7ee('0xe')],config[_0xc7ee('0xb')]['password'],config['sequelizeHistory']['options'])};db[_0xc7ee('0xf')]=db[_0xc7ee('0x1')]['import'](_0xc7ee('0x10'));db[_0xc7ee('0x11')]=db['sequelize'][_0xc7ee('0x12')](_0xc7ee('0x13'));db[_0xc7ee('0x14')]=db[_0xc7ee('0x1')][_0xc7ee('0x12')]('../api/voiceContext/voiceContext.model');db[_0xc7ee('0x15')]=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0x16'));db['VoiceMusicOnHold']=db[_0xc7ee('0x1')]['import'](_0xc7ee('0x17'));db[_0xc7ee('0x18')]=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0x19'));db[_0xc7ee('0x1a')]=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0x1b'));db[_0xc7ee('0x1c')]=db[_0xc7ee('0x1')]['import'](_0xc7ee('0x1d'));db['VoiceMail']=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0x1e'));db[_0xc7ee('0x1f')]=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0x20'));db['VoiceCallReport']=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0x21'));db[_0xc7ee('0x22')]=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0x23'));db[_0xc7ee('0x24')]=db[_0xc7ee('0x1')]['import'](_0xc7ee('0x25'));db[_0xc7ee('0x26')]=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0x27'));db['MemberReport']=db[_0xc7ee('0x1')]['import']('../api/memberReport/memberReport.model');db[_0xc7ee('0x28')]=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0x29'));db['VoiceTransferReport']=db['sequelize']['import'](_0xc7ee('0x2a'));db[_0xc7ee('0x2b')]=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0x2c'));db[_0xc7ee('0x2d')]=db[_0xc7ee('0x1')][_0xc7ee('0x12')]('../api/userVoiceQueue/userVoiceQueue.model');db[_0xc7ee('0x2e')]=db['sequelize'][_0xc7ee('0x12')](_0xc7ee('0x2f'));db[_0xc7ee('0x30')]=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0x31'));db[_0xc7ee('0x32')]=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0x33'));db['UserSmsQueue']=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0x34'));db[_0xc7ee('0x35')]=db['sequelize'][_0xc7ee('0x12')]('../api/userOpenchannelQueue/userOpenchannelQueue.model');db['UserWhatsappQueue']=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0x36'));db[_0xc7ee('0x37')]=db[_0xc7ee('0x1')]['import'](_0xc7ee('0x38'));db[_0xc7ee('0x39')]=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0x3a'));db['MailAccount']=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0x3b'));db[_0xc7ee('0x3c')]=db['sequelize']['import'](_0xc7ee('0x3d'));db[_0xc7ee('0x3e')]=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0x3f'));db[_0xc7ee('0x40')]=db[_0xc7ee('0x1')][_0xc7ee('0x12')]('../api/mailInteraction/mailInteraction.model');db[_0xc7ee('0x41')]=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0x42'));db['MailApplication']=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0x43'));db[_0xc7ee('0x44')]=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0x45'));db[_0xc7ee('0x46')]=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0x47'));db[_0xc7ee('0x48')]=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0x49'));db[_0xc7ee('0x4a')]=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0x4b'));db[_0xc7ee('0x4c')]=db[_0xc7ee('0x1')][_0xc7ee('0x12')]('../api/faxApplication/faxApplication.model');db[_0xc7ee('0x4d')]=db[_0xc7ee('0x1')][_0xc7ee('0x12')]('../api/faxInteraction/faxInteraction.model');db[_0xc7ee('0x4e')]=db[_0xc7ee('0x1')][_0xc7ee('0x12')]('../api/faxMessage/faxMessage.model');db[_0xc7ee('0x4f')]=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0x50'));db[_0xc7ee('0x51')]=db['sequelize'][_0xc7ee('0x12')](_0xc7ee('0x52'));db[_0xc7ee('0x53')]=db[_0xc7ee('0x1')]['import']('../api/smsAccount/smsAccount.model');db[_0xc7ee('0x54')]=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0x55'));db[_0xc7ee('0x56')]=db[_0xc7ee('0x1')]['import'](_0xc7ee('0x57'));db[_0xc7ee('0x58')]=db['sequelize'][_0xc7ee('0x12')]('../api/smsMessage/smsMessage.model');db['SmsQueue']=db[_0xc7ee('0x1')][_0xc7ee('0x12')]('../api/smsQueue/smsQueue.model');db[_0xc7ee('0x59')]=db['sequelize']['import'](_0xc7ee('0x5a'));db[_0xc7ee('0x5b')]=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0x5c'));db[_0xc7ee('0x5d')]=db['sequelize']['import'](_0xc7ee('0x5e'));db['OpenchannelMessage']=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0x5f'));db[_0xc7ee('0x60')]=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0x61'));db['ChatWebsite']=db[_0xc7ee('0x1')]['import'](_0xc7ee('0x62'));db[_0xc7ee('0x63')]=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0x64'));db['ChatApplication']=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0x65'));db[_0xc7ee('0x66')]=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0x67'));db[_0xc7ee('0x68')]=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0x69'));db[_0xc7ee('0x6a')]=db[_0xc7ee('0x1')][_0xc7ee('0x12')]('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0xc7ee('0x6b')]=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0x6c'));db['ChatGroup']=db[_0xc7ee('0x1')]['import'](_0xc7ee('0x6d'));db[_0xc7ee('0x6e')]=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0x6f'));db[_0xc7ee('0x70')]=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0x71'));db[_0xc7ee('0x72')]=db[_0xc7ee('0x1')]['import'](_0xc7ee('0x73'));db[_0xc7ee('0x74')]=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0x75'));db['CmHopperBlack']=db['sequelize'][_0xc7ee('0x12')](_0xc7ee('0x76'));db[_0xc7ee('0x77')]=db[_0xc7ee('0x1')]['import'](_0xc7ee('0x78'));db[_0xc7ee('0x79')]=db['sequelize']['import'](_0xc7ee('0x7a'));db[_0xc7ee('0x7b')]=db[_0xc7ee('0x1')][_0xc7ee('0x12')]('../api/reportAgentPreview/reportAgentPreview.model');db['CmCustomField']=db[_0xc7ee('0x1')][_0xc7ee('0x12')]('../api/cmCustomField/cmCustomField.model');db[_0xc7ee('0x7c')]=db[_0xc7ee('0x1')]['import']('../api/action/action.model');db['Automation']=db[_0xc7ee('0x1')]['import'](_0xc7ee('0x7d'));db[_0xc7ee('0x7e')]=db['sequelize']['import']('../api/cannedAnswer/cannedAnswer.model');db[_0xc7ee('0x7f')]=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0x80'));db[_0xc7ee('0x81')]=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0x82'));db['Interval']=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0x83'));db[_0xc7ee('0x84')]=db['sequelize'][_0xc7ee('0x12')](_0xc7ee('0x85'));db['Cdr']=db['sequelize'][_0xc7ee('0x12')](_0xc7ee('0x86'));db[_0xc7ee('0x87')]=db['sequelize'][_0xc7ee('0x12')](_0xc7ee('0x88'));db[_0xc7ee('0x89')]=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0x8a'));db['Sound']=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0x8b'));db[_0xc7ee('0x8c')]=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0x8d'));db[_0xc7ee('0x8e')]=db['sequelize'][_0xc7ee('0x12')](_0xc7ee('0x8f'));db[_0xc7ee('0x90')]=db[_0xc7ee('0x1')]['import'](_0xc7ee('0x91'));db[_0xc7ee('0x92')]=db[_0xc7ee('0x1')][_0xc7ee('0x12')]('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model');db[_0xc7ee('0x93')]=db['sequelize'][_0xc7ee('0x12')](_0xc7ee('0x94'));db['Trigger']=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0x95'));db['Variable']=db[_0xc7ee('0x1')][_0xc7ee('0x12')]('../api/variable/variable.model');db[_0xc7ee('0x96')]=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0x97'));db[_0xc7ee('0x98')]=db['sequelize'][_0xc7ee('0x12')](_0xc7ee('0x99'));db['AnalyticCustomReport']=db[_0xc7ee('0x1')]['import']('../api/analyticCustomReport/analyticCustomReport.model');db[_0xc7ee('0x9a')]=db['sequelize']['import'](_0xc7ee('0x9b'));db[_0xc7ee('0x9c')]=db[_0xc7ee('0x1')][_0xc7ee('0x12')]('../api/analyticExtractedReport/analyticExtractedReport.model');db['AnalyticMetric']=db[_0xc7ee('0x1')]['import'](_0xc7ee('0x9d'));db[_0xc7ee('0x9e')]=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0x9f'));db[_0xc7ee('0xa0')]=db[_0xc7ee('0x1')]['import'](_0xc7ee('0xa1'));db['SalesforceAccount']=db['sequelize'][_0xc7ee('0x12')]('../api/intSalesforceAccount/intSalesforceAccount.model');db[_0xc7ee('0xa2')]=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0xa3'));db[_0xc7ee('0xa4')]=db[_0xc7ee('0x1')]['import'](_0xc7ee('0xa5'));db['SugarcrmAccount']=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0xa6'));db[_0xc7ee('0xa7')]=db['sequelize'][_0xc7ee('0x12')](_0xc7ee('0xa8'));db[_0xc7ee('0xa9')]=db[_0xc7ee('0x1')]['import']('../api/intSugarcrmField/intSugarcrmField.model');db[_0xc7ee('0xaa')]=db['sequelize'][_0xc7ee('0x12')](_0xc7ee('0xab'));db[_0xc7ee('0xac')]=db[_0xc7ee('0x1')]['import'](_0xc7ee('0xad'));db['DeskField']=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0xae'));db[_0xc7ee('0xaf')]=db['sequelize'][_0xc7ee('0x12')](_0xc7ee('0xb0'));db[_0xc7ee('0xb1')]=db['sequelize'][_0xc7ee('0x12')](_0xc7ee('0xb2'));db[_0xc7ee('0xb3')]=db[_0xc7ee('0x1')]['import']('../api/intZohoField/intZohoField.model');db[_0xc7ee('0xb4')]=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0xb5'));db[_0xc7ee('0xb6')]=db[_0xc7ee('0x1')][_0xc7ee('0x12')]('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0xc7ee('0xb7')]=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0xb8'));db['FreshdeskAccount']=db['sequelize'][_0xc7ee('0x12')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db['FreshdeskConfiguration']=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0xb9'));db[_0xc7ee('0xba')]=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0xbb'));db['VtigerAccount']=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0xbc'));db[_0xc7ee('0xbd')]=db[_0xc7ee('0x1')][_0xc7ee('0x12')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0xc7ee('0xbe')]=db['sequelize'][_0xc7ee('0x12')]('../api/intVtigerField/intVtigerField.model');db[_0xc7ee('0xbf')]=db['sequelize'][_0xc7ee('0x12')]('../api/intServicenowAccount/intServicenowAccount.model');db['ServicenowConfiguration']=db['sequelize']['import'](_0xc7ee('0xc0'));db[_0xc7ee('0xc1')]=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0xc2'));db[_0xc7ee('0xc3')]=db[_0xc7ee('0x1')]['import']('../api/intDynamics365Account/intDynamics365Account.model');db[_0xc7ee('0xc4')]=db['sequelize'][_0xc7ee('0x12')]('../api/intDynamics365Configuration/intDynamics365Configuration.model');db['Dynamics365Field']=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0xc5'));db['FreshsalesAccount']=db[_0xc7ee('0x1')]['import'](_0xc7ee('0xc6'));db['FreshsalesConfiguration']=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0xc7'));db['FreshsalesField']=db[_0xc7ee('0x1')]['import'](_0xc7ee('0xc8'));db[_0xc7ee('0x96')]=db['sequelize']['import'](_0xc7ee('0x97'));db['Network']=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0xc9'));db[_0xc7ee('0xca')]=db[_0xc7ee('0x1')]['import']('../api/chatQueueReport/chatQueueReport.model');db[_0xc7ee('0xcb')]=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0xcc'));db[_0xc7ee('0xcd')]=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0xce'));db['JscriptyQuestionReport']=db[_0xc7ee('0x1')]['import'](_0xc7ee('0xcf'));db[_0xc7ee('0xd0')]=db['sequelize'][_0xc7ee('0x12')](_0xc7ee('0xd1'));db['SmsQueueReport']=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0xd2'));db['SquareReport']=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0xd3'));db[_0xc7ee('0xd4')]=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0xd5'));db[_0xc7ee('0xd6')]=db['sequelize'][_0xc7ee('0x12')](_0xc7ee('0xd7'));db[_0xc7ee('0xd8')]=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0xd9'));db[_0xc7ee('0xda')]=db[_0xc7ee('0x1')]['import'](_0xc7ee('0xdb'));db['SquareProject']=db[_0xc7ee('0x1')][_0xc7ee('0x12')]('../api/squareProject/squareProject.model');db[_0xc7ee('0xdc')]=db[_0xc7ee('0x1')][_0xc7ee('0x12')]('../api/squareRecording/squareRecording.model');db[_0xc7ee('0xdd')]=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0xde'));db[_0xc7ee('0xdf')]=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0xe0'));db[_0xc7ee('0xe1')]=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0xe2'));db[_0xc7ee('0xe3')]=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0xe4'));db[_0xc7ee('0xe5')]=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0xe6'));db[_0xc7ee('0xe7')]=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0xe8'));db[_0xc7ee('0xe9')]=db[_0xc7ee('0x1')][_0xc7ee('0x12')]('../api/plugin/plugin.model');db[_0xc7ee('0xea')]=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0xeb'));db[_0xc7ee('0xec')]=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0xed'));db[_0xc7ee('0xee')]=db[_0xc7ee('0x1')]['import'](_0xc7ee('0xef'));db[_0xc7ee('0xf0')]=db['sequelize']['import'](_0xc7ee('0xf1'));db[_0xc7ee('0xf2')]=db[_0xc7ee('0x1')][_0xc7ee('0x12')]('../api/smsTransferReport/smsTransferReport.model');db[_0xc7ee('0xf3')]=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0xf4'));db['VoicePrefix']=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0xf5'));db[_0xc7ee('0xf6')]=db['sequelize'][_0xc7ee('0x12')](_0xc7ee('0xf7'));db[_0xc7ee('0xf8')]=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0xf9'));db['UserProfileResource']=db['sequelize'][_0xc7ee('0x12')](_0xc7ee('0xfa'));db['UserNotification']=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0xfb'));db[_0xc7ee('0xfc')]=db[_0xc7ee('0x1')][_0xc7ee('0x12')]('../api/whatsappAccount/whatsappAccount.model');db[_0xc7ee('0xfd')]=db['sequelize'][_0xc7ee('0x12')]('../api/whatsappApplication/whatsappApplication.model');db[_0xc7ee('0xfe')]=db['sequelize'][_0xc7ee('0x12')](_0xc7ee('0xff'));db[_0xc7ee('0x100')]=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0x101'));db[_0xc7ee('0x102')]=db[_0xc7ee('0x1')][_0xc7ee('0x12')]('../api/whatsappQueueReport/whatsappQueueReport.model');db[_0xc7ee('0x103')]=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0x104'));db[_0xc7ee('0x105')]=db['sequelize']['import'](_0xc7ee('0x106'));db[_0xc7ee('0x107')]=db[_0xc7ee('0x1')]['import'](_0xc7ee('0x108'));db[_0xc7ee('0x109')]=db['sequelize']['import'](_0xc7ee('0x10a'));db[_0xc7ee('0x10b')]=db[_0xc7ee('0x1')]['import'](_0xc7ee('0x10c'));db[_0xc7ee('0x10d')]=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0x10e'));db[_0xc7ee('0x10f')]=db[_0xc7ee('0x1')][_0xc7ee('0x12')](_0xc7ee('0x110'));db[_0xc7ee('0xf')][_0xc7ee('0x111')](db[_0xc7ee('0x112')],{'as':_0xc7ee('0x112'),'onDelete':'cascade','foreignKey':_0xc7ee('0x113')});db['User'][_0xc7ee('0x111')](db[_0xc7ee('0x10f')],{'as':_0xc7ee('0x114'),'onDelete':_0xc7ee('0x115'),'foreignKey':_0xc7ee('0x113')});db[_0xc7ee('0xf')]['hasMany'](db[_0xc7ee('0x1a')],{'as':_0xc7ee('0x116'),'foreignKey':_0xc7ee('0x113')});db['User'][_0xc7ee('0x117')](db[_0xc7ee('0x2b')],{'as':_0xc7ee('0x118'),'foreignKey':_0xc7ee('0x113')});db[_0xc7ee('0xf')][_0xc7ee('0x117')](db[_0xc7ee('0x15')],{'as':_0xc7ee('0x119'),'onDelete':_0xc7ee('0x115'),'hooks':!![]});db[_0xc7ee('0xf')][_0xc7ee('0x117')](db[_0xc7ee('0x77')],{'as':_0xc7ee('0x11a'),'foreignKey':_0xc7ee('0x113')});db[_0xc7ee('0xf')][_0xc7ee('0x117')](db['CmHopperHistory'],{'as':_0xc7ee('0x11b'),'foreignKey':'UserId'});db[_0xc7ee('0xf')][_0xc7ee('0x117')](db[_0xc7ee('0x7b')],{'as':_0xc7ee('0x7b'),'foreignKey':_0xc7ee('0x113')});db['User'][_0xc7ee('0x117')](db['OpenchannelInteraction'],{'as':_0xc7ee('0x11c'),'foreignKey':_0xc7ee('0x113')});db['User'][_0xc7ee('0x117')](db['ChatInteraction'],{'as':_0xc7ee('0x11d'),'foreignKey':_0xc7ee('0x113')});db['User'][_0xc7ee('0x117')](db[_0xc7ee('0x56')],{'as':_0xc7ee('0x11e'),'foreignKey':_0xc7ee('0x113')});db[_0xc7ee('0xf')][_0xc7ee('0x117')](db[_0xc7ee('0x4d')],{'as':_0xc7ee('0x11f'),'foreignKey':_0xc7ee('0x113')});db['User']['hasMany'](db[_0xc7ee('0x40')],{'as':'MailInteractions','foreignKey':_0xc7ee('0x113')});db[_0xc7ee('0xf')][_0xc7ee('0x117')](db[_0xc7ee('0xfe')],{'as':_0xc7ee('0x120'),'foreignKey':'UserId'});db[_0xc7ee('0xf')][_0xc7ee('0x117')](db[_0xc7ee('0x121')],{'as':_0xc7ee('0x122'),'foreignKey':'SenderId'});db[_0xc7ee('0xf')][_0xc7ee('0x117')](db['CmHopper'],{'as':'Hoppers','foreignKey':_0xc7ee('0x113'),'onDelete':_0xc7ee('0x123')});db[_0xc7ee('0xf')][_0xc7ee('0x124')](db[_0xc7ee('0xf6')],{'as':_0xc7ee('0xf6'),'foreignKey':'userProfileId'});db['User'][_0xc7ee('0x125')](db['ChatGroup'],{'as':_0xc7ee('0x126'),'through':_0xc7ee('0x127')});db['User']['belongsToMany'](db[_0xc7ee('0x72')],{'as':_0xc7ee('0x128'),'through':_0xc7ee('0x129')});db['User'][_0xc7ee('0x125')](db[_0xc7ee('0xf3')],{'as':_0xc7ee('0x12a'),'through':'cm_user_has_lists'});db[_0xc7ee('0xf')]['belongsToMany'](db[_0xc7ee('0xdf')],{'through':_0xc7ee('0x12b')});db[_0xc7ee('0xf')][_0xc7ee('0x125')](db[_0xc7ee('0x40')],{'as':_0xc7ee('0x12c'),'through':_0xc7ee('0x12d')});db['User'][_0xc7ee('0x125')](db[_0xc7ee('0x66')],{'as':'ChatInteractions','through':_0xc7ee('0x12e')});db[_0xc7ee('0xf')][_0xc7ee('0x125')](db[_0xc7ee('0x4d')],{'as':_0xc7ee('0x11f'),'through':'user_has_fax_interactions'});db[_0xc7ee('0xf')][_0xc7ee('0x125')](db['SmsInteraction'],{'as':'SmsInteractions','through':_0xc7ee('0x12f')});db[_0xc7ee('0xf')][_0xc7ee('0x125')](db[_0xc7ee('0x5d')],{'as':_0xc7ee('0x11c'),'through':_0xc7ee('0x130')});db['User'][_0xc7ee('0x125')](db[_0xc7ee('0xfe')],{'as':_0xc7ee('0x120'),'through':_0xc7ee('0x131')});db['User'][_0xc7ee('0x125')](db[_0xc7ee('0x18')],{'as':_0xc7ee('0x132'),'through':'UserVoiceQueue','required':![]});db[_0xc7ee('0xf')][_0xc7ee('0x125')](db[_0xc7ee('0x133')],{'as':_0xc7ee('0x134'),'through':_0xc7ee('0x10d'),'required':![]});db[_0xc7ee('0xf')]['belongsToMany'](db['MailQueue'],{'as':_0xc7ee('0x135'),'through':_0xc7ee('0x30'),'required':![]});db[_0xc7ee('0xf')][_0xc7ee('0x125')](db[_0xc7ee('0x6b')],{'as':_0xc7ee('0x136'),'through':_0xc7ee('0x2e'),'required':![],'hooks':!![]});db['User']['belongsToMany'](db[_0xc7ee('0x4f')],{'as':'FaxQueues','through':_0xc7ee('0x32'),'required':![]});db[_0xc7ee('0xf')][_0xc7ee('0x125')](db['SmsQueue'],{'as':_0xc7ee('0x137'),'through':'UserSmsQueue','required':![]});db[_0xc7ee('0xf')][_0xc7ee('0x125')](db[_0xc7ee('0x60')],{'as':_0xc7ee('0x138'),'through':_0xc7ee('0x35'),'required':![]});db[_0xc7ee('0xf')][_0xc7ee('0x125')](db['WhatsappQueue'],{'as':_0xc7ee('0x139'),'through':_0xc7ee('0x13a'),'required':![]});db[_0xc7ee('0xf')][_0xc7ee('0x125')](db['CmList'],{'through':_0xc7ee('0x13b')});db['User']['belongsToMany'](db[_0xc7ee('0x13c')],{'as':_0xc7ee('0x13d'),'through':_0xc7ee('0x13e')});db[_0xc7ee('0xf')]['belongsToMany'](db[_0xc7ee('0x4a')],{'as':'FaxAccounts','through':'user_has_fax_accounts'});db['User'][_0xc7ee('0x125')](db[_0xc7ee('0x13f')],{'as':_0xc7ee('0x140'),'through':_0xc7ee('0x141')});db[_0xc7ee('0xf')]['belongsToMany'](db[_0xc7ee('0x59')],{'as':_0xc7ee('0x142'),'through':_0xc7ee('0x143')});db['User'][_0xc7ee('0x125')](db[_0xc7ee('0x53')],{'as':_0xc7ee('0x144'),'through':_0xc7ee('0x145')});db['User'][_0xc7ee('0x125')](db['WhatsappAccount'],{'as':'WhatsappAccounts','through':'user_has_whatsapp_accounts'});db[_0xc7ee('0x11')]['hasMany'](db[_0xc7ee('0x15')],{'as':_0xc7ee('0x146'),'onDelete':_0xc7ee('0x115'),'foreignKey':_0xc7ee('0x147')});db[_0xc7ee('0x14')][_0xc7ee('0x117')](db['VoiceExtension'],{'onDelete':_0xc7ee('0x115')});db['VoiceExtension'][_0xc7ee('0x117')](db[_0xc7ee('0x15')],{'as':_0xc7ee('0x148'),'onDelete':_0xc7ee('0x115')});db[_0xc7ee('0x149')][_0xc7ee('0x125')](db['Sound'],{'as':'Sounds','through':_0xc7ee('0x14a')});db[_0xc7ee('0x18')][_0xc7ee('0x117')](db['UserVoiceQueueRt'],{'as':'Members','foreignKey':_0xc7ee('0x14b')});db['VoiceQueue']['hasMany'](db[_0xc7ee('0x74')],{'as':'Hoppers','foreignKey':_0xc7ee('0x14b')});db[_0xc7ee('0x18')][_0xc7ee('0x117')](db['CmHopperFinal'],{'as':_0xc7ee('0x11a'),'foreignKey':_0xc7ee('0x14b')});db['VoiceQueue'][_0xc7ee('0x117')](db['CmHopperHistory'],{'as':_0xc7ee('0x14c'),'foreignKey':_0xc7ee('0x14b')});db[_0xc7ee('0x18')]['hasMany'](db[_0xc7ee('0x7b')],{'as':'ReportAgentPreview','foreignKey':'VoiceQueueId'});db[_0xc7ee('0x18')][_0xc7ee('0x117')](db[_0xc7ee('0x14d')],{'as':_0xc7ee('0x14e'),'foreignKey':_0xc7ee('0x14b')});db[_0xc7ee('0x18')][_0xc7ee('0x117')](db[_0xc7ee('0xd0')],{'as':_0xc7ee('0x14f'),'foreignKey':_0xc7ee('0x14b')});db['VoiceQueue'][_0xc7ee('0x124')](db[_0xc7ee('0x28')],{'as':_0xc7ee('0x28'),'foreignKey':'TrunkId'});db['VoiceQueue'][_0xc7ee('0x124')](db[_0xc7ee('0x28')],{'as':'TrunkBackup','foreignKey':_0xc7ee('0x150')});db[_0xc7ee('0x18')][_0xc7ee('0x124')](db[_0xc7ee('0x151')],{'as':_0xc7ee('0x151'),'foreignKey':_0xc7ee('0x152')});db[_0xc7ee('0x18')]['belongsTo'](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0xc7ee('0x153')});db[_0xc7ee('0x18')]['belongsToMany'](db[_0xc7ee('0xf3')],{'as':_0xc7ee('0x12a'),'through':_0xc7ee('0x154')});db[_0xc7ee('0x18')][_0xc7ee('0x125')](db[_0xc7ee('0xf')],{'as':_0xc7ee('0x155'),'through':_0xc7ee('0x2d')});db['VoiceQueue'][_0xc7ee('0x125')](db['Team'],{'as':'Teams','through':_0xc7ee('0x109')});db[_0xc7ee('0x18')]['belongsToMany'](db[_0xc7ee('0xf3')],{'as':_0xc7ee('0x156'),'through':_0xc7ee('0x157')});db[_0xc7ee('0x1a')]['belongsTo'](db[_0xc7ee('0xf')],{'as':_0xc7ee('0xf'),'foreignKey':'UserId'});db['ScreenRecording'][_0xc7ee('0x124')](db[_0xc7ee('0xf')],{'as':'User','foreignKey':'UserId'});db[_0xc7ee('0x112')][_0xc7ee('0x117')](db['VoiceMailMessage'],{'as':_0xc7ee('0x158'),'onDelete':_0xc7ee('0x115'),'foreignKey':_0xc7ee('0x159'),'sourceKey':_0xc7ee('0x15a')});db[_0xc7ee('0x1f')][_0xc7ee('0x124')](db[_0xc7ee('0x112')],{'foreignKey':_0xc7ee('0x159'),'targetKey':_0xc7ee('0x15a')});db[_0xc7ee('0x15b')][_0xc7ee('0x117')](db[_0xc7ee('0x26')],{'as':_0xc7ee('0x15c'),'foreignKey':'uniqueid','constraints':![]});db[_0xc7ee('0x15b')][_0xc7ee('0x117')](db[_0xc7ee('0x24')],{'as':'AgentReports','foreignKey':_0xc7ee('0x15d'),'constraints':![]});db[_0xc7ee('0x15b')][_0xc7ee('0x124')](db[_0xc7ee('0xf')],{'as':_0xc7ee('0xf'),'foreignKey':'UserId'});db[_0xc7ee('0x15b')][_0xc7ee('0x124')](db['CmContact'],{'as':_0xc7ee('0x15e'),'foreignKey':_0xc7ee('0x15f')});db[_0xc7ee('0x37')][_0xc7ee('0x124')](db['MailAccount'],{'as':_0xc7ee('0x13f'),'foreignKey':_0xc7ee('0x160')});db[_0xc7ee('0x37')][_0xc7ee('0x124')](db[_0xc7ee('0x107')],{'as':_0xc7ee('0x107'),'foreignKey':_0xc7ee('0x161'),'onDelete':'restrict'});db['MailServerOut']['belongsTo'](db[_0xc7ee('0x13f')],{'as':'MailAccount','foreignKey':_0xc7ee('0x160')});db['MailServerOut']['belongsTo'](db[_0xc7ee('0x107')],{'as':_0xc7ee('0x107'),'foreignKey':'CloudProviderId','onDelete':_0xc7ee('0x162')});db[_0xc7ee('0x13f')][_0xc7ee('0x111')](db[_0xc7ee('0x37')],{'as':'Imap','onDelete':'cascade'});db[_0xc7ee('0x13f')][_0xc7ee('0x111')](db['MailServerOut'],{'as':'Smtp','onDelete':'cascade'});db[_0xc7ee('0x13f')][_0xc7ee('0x117')](db['Disposition'],{'as':'Dispositions','foreignKey':_0xc7ee('0x160'),'onDelete':_0xc7ee('0x115')});db[_0xc7ee('0x13f')]['hasMany'](db[_0xc7ee('0x7e')],{'as':_0xc7ee('0x163'),'foreignKey':_0xc7ee('0x160')});db[_0xc7ee('0x13f')][_0xc7ee('0x117')](db[_0xc7ee('0x41')],{'as':_0xc7ee('0x158'),'foreignKey':'MailAccountId'});db['MailAccount'][_0xc7ee('0x117')](db['MailInteraction'],{'as':_0xc7ee('0x164')});db[_0xc7ee('0x13f')]['hasMany'](db['MailApplication'],{'as':_0xc7ee('0x148'),'foreignKey':_0xc7ee('0x160'),'onDelete':_0xc7ee('0x115')});db[_0xc7ee('0x13f')][_0xc7ee('0x124')](db['CmList'],{'as':'List','foreignKey':_0xc7ee('0x165')});db[_0xc7ee('0x13f')][_0xc7ee('0x124')](db['Template'],{'as':_0xc7ee('0x93'),'foreignKey':'TemplateId'});db['MailAccount'][_0xc7ee('0x124')](db[_0xc7ee('0x84')],{'as':'mandatoryDispositionPause','foreignKey':_0xc7ee('0x153')});db[_0xc7ee('0x13f')][_0xc7ee('0x125')](db['User'],{'as':_0xc7ee('0x155'),'through':_0xc7ee('0x141')});db[_0xc7ee('0x3c')]['belongsToMany'](db[_0xc7ee('0xf')],{'as':_0xc7ee('0x155'),'through':'UserMailQueue'});db[_0xc7ee('0x3c')][_0xc7ee('0x125')](db[_0xc7ee('0xdf')],{'through':_0xc7ee('0x166'),'as':_0xc7ee('0x167')});db[_0xc7ee('0x40')]['hasMany'](db[_0xc7ee('0x41')],{'as':_0xc7ee('0x158'),'onDelete':'cascade','foreignKey':_0xc7ee('0x168')});db['MailInteraction']['belongsTo'](db[_0xc7ee('0x13f')],{'as':_0xc7ee('0x169'),'foreignKey':_0xc7ee('0x160')});db['MailInteraction'][_0xc7ee('0x124')](db[_0xc7ee('0x72')],{'as':_0xc7ee('0x15e'),'foreignKey':_0xc7ee('0x15f')});db[_0xc7ee('0x40')]['belongsTo'](db[_0xc7ee('0xf')],{'as':_0xc7ee('0x16a'),'foreignKey':'UserId'});db[_0xc7ee('0x40')][_0xc7ee('0x125')](db[_0xc7ee('0x8c')],{'through':'mail_interaction_has_tags','as':_0xc7ee('0x16b')});db[_0xc7ee('0x40')][_0xc7ee('0x125')](db[_0xc7ee('0x8c')],{'through':_0xc7ee('0x16c'),'as':'ThroughTags'});db[_0xc7ee('0x40')][_0xc7ee('0x125')](db[_0xc7ee('0xf')],{'as':'Users','through':_0xc7ee('0x12d'),'foreignKey':'MailInteractionId'});db[_0xc7ee('0x41')][_0xc7ee('0x117')](db[_0xc7ee('0xe7')],{'as':'Attachments','onDelete':_0xc7ee('0x115')});db[_0xc7ee('0x41')][_0xc7ee('0x124')](db[_0xc7ee('0xf')],{'as':'User'});db[_0xc7ee('0x41')][_0xc7ee('0x124')](db[_0xc7ee('0x72')],{'onDelete':_0xc7ee('0x115'),'as':_0xc7ee('0x15e')});db[_0xc7ee('0x41')]['belongsTo'](db[_0xc7ee('0x40')],{'as':'Interaction','foreignKey':_0xc7ee('0x168')});db[_0xc7ee('0x41')]['belongsTo'](db['MailAccount'],{'as':_0xc7ee('0x169'),'foreignKey':_0xc7ee('0x160')});db[_0xc7ee('0x41')][_0xc7ee('0x124')](db[_0xc7ee('0x13c')],{'as':_0xc7ee('0x13c'),'foreignKey':_0xc7ee('0x16d')});db[_0xc7ee('0x41')][_0xc7ee('0x124')](db[_0xc7ee('0x6a')],{'as':_0xc7ee('0x6a'),'foreignKey':_0xc7ee('0x16e')});db[_0xc7ee('0x16f')][_0xc7ee('0x124')](db[_0xc7ee('0xf')],{'onDelete':'restrict'});db[_0xc7ee('0x16f')]['belongsTo'](db[_0xc7ee('0x3c')],{'onDelete':_0xc7ee('0x162')});db['MailApplication'][_0xc7ee('0x124')](db[_0xc7ee('0x13f')],{'onDelete':_0xc7ee('0x162')});db[_0xc7ee('0x16f')]['belongsTo'](db['Interval'],{'onDelete':'restrict','foreignKey':_0xc7ee('0x152')});db['MailApplication'][_0xc7ee('0x124')](db[_0xc7ee('0x8c')],{'onDelete':_0xc7ee('0x162'),'foreignKey':_0xc7ee('0x170')});db[_0xc7ee('0x44')][_0xc7ee('0x124')](db[_0xc7ee('0x13f')],{});db[_0xc7ee('0x44')][_0xc7ee('0x124')](db[_0xc7ee('0xf3')],{'as':_0xc7ee('0x171'),'foreignKey':_0xc7ee('0x165')});db[_0xc7ee('0x44')][_0xc7ee('0x124')](db['CmContact'],{'as':_0xc7ee('0x15e'),'foreignKey':_0xc7ee('0x15f')});db[_0xc7ee('0x44')][_0xc7ee('0x124')](db[_0xc7ee('0x40')],{});db[_0xc7ee('0x44')]['belongsTo'](db[_0xc7ee('0x41')],{});db[_0xc7ee('0x44')][_0xc7ee('0x124')](db[_0xc7ee('0xf')],{});db['MailQueueReport']['belongsTo'](db[_0xc7ee('0x3c')],{});db[_0xc7ee('0x46')][_0xc7ee('0x117')](db[_0xc7ee('0x48')],{'as':_0xc7ee('0x172'),'onDelete':_0xc7ee('0x115')});db['FaxAccount'][_0xc7ee('0x117')](db[_0xc7ee('0x7f')],{'as':_0xc7ee('0x173'),'foreignKey':'FaxAccountId','onDelete':_0xc7ee('0x115')});db[_0xc7ee('0x4a')][_0xc7ee('0x117')](db[_0xc7ee('0x7e')],{'as':_0xc7ee('0x163'),'foreignKey':'FaxAccountId'});db[_0xc7ee('0x4a')]['hasMany'](db['FaxInteraction'],{'as':_0xc7ee('0x164')});db[_0xc7ee('0x4a')]['hasMany'](db['FaxApplication'],{'as':_0xc7ee('0x148'),'foreignKey':_0xc7ee('0x174'),'onDelete':_0xc7ee('0x115')});db[_0xc7ee('0x4a')][_0xc7ee('0x117')](db[_0xc7ee('0x15')],{'as':_0xc7ee('0x175'),'onDelete':_0xc7ee('0x115')});db['FaxAccount'][_0xc7ee('0x117')](db['FaxMessage'],{'as':_0xc7ee('0x158')});db[_0xc7ee('0x4a')][_0xc7ee('0x124')](db['Trunk'],{'as':'Trunk'});db['FaxAccount'][_0xc7ee('0x124')](db[_0xc7ee('0xf3')],{'as':_0xc7ee('0x171'),'foreignKey':'ListId'});db[_0xc7ee('0x4a')][_0xc7ee('0x124')](db[_0xc7ee('0x84')],{'as':_0xc7ee('0x176'),'foreignKey':_0xc7ee('0x153')});db[_0xc7ee('0x4a')][_0xc7ee('0x125')](db['User'],{'as':_0xc7ee('0x155'),'through':_0xc7ee('0x177')});db['FaxApplication'][_0xc7ee('0x124')](db[_0xc7ee('0xf')],{'onDelete':_0xc7ee('0x162')});db[_0xc7ee('0x4c')][_0xc7ee('0x124')](db[_0xc7ee('0x4f')],{'onDelete':'restrict'});db[_0xc7ee('0x4c')][_0xc7ee('0x124')](db[_0xc7ee('0x4a')],{'onDelete':'restrict'});db[_0xc7ee('0x4c')]['belongsTo'](db[_0xc7ee('0x8c')],{'onDelete':_0xc7ee('0x162'),'foreignKey':_0xc7ee('0x170')});db[_0xc7ee('0x4d')][_0xc7ee('0x117')](db['FaxMessage'],{'as':_0xc7ee('0x158'),'onDelete':_0xc7ee('0x115'),'foreignKey':_0xc7ee('0x178')});db[_0xc7ee('0x4d')][_0xc7ee('0x124')](db[_0xc7ee('0x4a')],{'as':'Account','foreignKey':_0xc7ee('0x174')});db[_0xc7ee('0x4d')][_0xc7ee('0x124')](db[_0xc7ee('0x72')],{'as':_0xc7ee('0x15e'),'foreignKey':_0xc7ee('0x15f')});db[_0xc7ee('0x4d')][_0xc7ee('0x124')](db[_0xc7ee('0xf')],{'as':_0xc7ee('0x16a'),'foreignKey':_0xc7ee('0x113')});db[_0xc7ee('0x4d')][_0xc7ee('0x125')](db[_0xc7ee('0x8c')],{'through':'fax_interaction_has_tags','as':_0xc7ee('0x16b')});db['FaxInteraction'][_0xc7ee('0x125')](db['Tag'],{'through':_0xc7ee('0x179'),'as':'ThroughTags'});db[_0xc7ee('0x4d')][_0xc7ee('0x125')](db[_0xc7ee('0xf')],{'as':_0xc7ee('0x17a'),'through':_0xc7ee('0x17b'),'foreignKey':'FaxInteractionId'});db[_0xc7ee('0x4e')][_0xc7ee('0x124')](db['User'],{'onDelete':_0xc7ee('0x115'),'as':_0xc7ee('0xf')});db['FaxMessage'][_0xc7ee('0x124')](db['FaxInteraction'],{'as':_0xc7ee('0x17c'),'foreignKey':_0xc7ee('0x178')});db['FaxMessage'][_0xc7ee('0x124')](db[_0xc7ee('0x72')],{'onDelete':'cascade','as':_0xc7ee('0x15e')});db[_0xc7ee('0x4e')][_0xc7ee('0x124')](db[_0xc7ee('0xe7')],{'as':_0xc7ee('0xe7'),'foreignKey':_0xc7ee('0x17d')});db[_0xc7ee('0x4e')][_0xc7ee('0x124')](db[_0xc7ee('0x4a')],{'as':_0xc7ee('0x169'),'foreignKey':'FaxAccountId'});db['FaxQueue'][_0xc7ee('0x125')](db[_0xc7ee('0xf')],{'as':_0xc7ee('0x155'),'through':'UserFaxQueue'});db['FaxQueue'][_0xc7ee('0x125')](db[_0xc7ee('0xdf')],{'through':_0xc7ee('0x17e'),'as':_0xc7ee('0x167')});db['FaxQueueReport']['belongsTo'](db['FaxAccount'],{});db[_0xc7ee('0x51')]['belongsTo'](db[_0xc7ee('0xf3')],{'as':'List','foreignKey':_0xc7ee('0x165')});db[_0xc7ee('0x51')][_0xc7ee('0x124')](db[_0xc7ee('0x72')],{'as':_0xc7ee('0x15e'),'foreignKey':_0xc7ee('0x15f')});db['FaxQueueReport'][_0xc7ee('0x124')](db[_0xc7ee('0x4d')],{});db[_0xc7ee('0x51')][_0xc7ee('0x124')](db[_0xc7ee('0x4e')],{});db[_0xc7ee('0x51')][_0xc7ee('0x124')](db[_0xc7ee('0xf')],{});db[_0xc7ee('0x51')]['belongsTo'](db[_0xc7ee('0x4f')],{});db['SmsAccount']['hasMany'](db[_0xc7ee('0x7f')],{'as':_0xc7ee('0x173'),'foreignKey':_0xc7ee('0x17f'),'onDelete':_0xc7ee('0x115')});db[_0xc7ee('0x53')][_0xc7ee('0x117')](db[_0xc7ee('0x7e')],{'as':_0xc7ee('0x163'),'foreignKey':_0xc7ee('0x17f')});db['SmsAccount']['hasMany'](db[_0xc7ee('0x58')],{'as':_0xc7ee('0x158'),'foreignKey':'SmsAccountId'});db['SmsAccount'][_0xc7ee('0x117')](db[_0xc7ee('0x56')],{'as':'Interactions'});db[_0xc7ee('0x53')][_0xc7ee('0x117')](db[_0xc7ee('0x54')],{'as':_0xc7ee('0x148'),'foreignKey':_0xc7ee('0x17f'),'onDelete':'cascade'});db[_0xc7ee('0x53')][_0xc7ee('0x124')](db[_0xc7ee('0xf3')],{'as':_0xc7ee('0x171'),'foreignKey':_0xc7ee('0x165')});db[_0xc7ee('0x53')][_0xc7ee('0x124')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0xc7ee('0x53')]['belongsToMany'](db[_0xc7ee('0xf')],{'as':_0xc7ee('0x155'),'through':_0xc7ee('0x145')});db[_0xc7ee('0x54')][_0xc7ee('0x124')](db[_0xc7ee('0xf')],{'onDelete':_0xc7ee('0x162')});db[_0xc7ee('0x54')]['belongsTo'](db[_0xc7ee('0x180')],{'onDelete':_0xc7ee('0x162')});db['SmsApplication'][_0xc7ee('0x124')](db[_0xc7ee('0x53')],{'onDelete':_0xc7ee('0x162')});db[_0xc7ee('0x54')][_0xc7ee('0x124')](db[_0xc7ee('0x151')],{'onDelete':'restrict','foreignKey':_0xc7ee('0x152')});db['SmsApplication'][_0xc7ee('0x124')](db['Tag'],{'onDelete':'restrict','foreignKey':_0xc7ee('0x170')});db[_0xc7ee('0x56')][_0xc7ee('0x117')](db[_0xc7ee('0x58')],{'as':'Messages','onDelete':_0xc7ee('0x115'),'foreignKey':_0xc7ee('0x181')});db[_0xc7ee('0x56')][_0xc7ee('0x124')](db[_0xc7ee('0x53')],{'as':_0xc7ee('0x169'),'foreignKey':_0xc7ee('0x17f')});db[_0xc7ee('0x56')][_0xc7ee('0x124')](db[_0xc7ee('0x72')],{'as':'Contact','foreignKey':_0xc7ee('0x15f')});db[_0xc7ee('0x56')][_0xc7ee('0x124')](db['User'],{'as':'Owner','foreignKey':'UserId'});db[_0xc7ee('0x56')][_0xc7ee('0x125')](db[_0xc7ee('0x8c')],{'through':_0xc7ee('0x182'),'as':_0xc7ee('0x16b')});db[_0xc7ee('0x56')][_0xc7ee('0x125')](db[_0xc7ee('0x8c')],{'through':_0xc7ee('0x182'),'as':'ThroughTags'});db[_0xc7ee('0x56')][_0xc7ee('0x125')](db['User'],{'as':_0xc7ee('0x17a'),'through':_0xc7ee('0x12f'),'foreignKey':'SmsInteractionId'});db[_0xc7ee('0x58')][_0xc7ee('0x124')](db[_0xc7ee('0xf')],{'as':_0xc7ee('0xf')});db[_0xc7ee('0x58')][_0xc7ee('0x124')](db[_0xc7ee('0x72')],{'onDelete':_0xc7ee('0x115'),'as':_0xc7ee('0x15e')});db[_0xc7ee('0x58')][_0xc7ee('0x124')](db[_0xc7ee('0x56')],{'onDelete':'cascade','as':_0xc7ee('0x17c'),'foreignKey':_0xc7ee('0x181')});db[_0xc7ee('0x58')][_0xc7ee('0x124')](db['SmsAccount'],{'as':_0xc7ee('0x169'),'foreignKey':_0xc7ee('0x17f')});db[_0xc7ee('0x180')][_0xc7ee('0x125')](db[_0xc7ee('0xf')],{'as':_0xc7ee('0x155'),'through':_0xc7ee('0x183'),'foreignKey':_0xc7ee('0x184')});db['SmsQueue'][_0xc7ee('0x125')](db[_0xc7ee('0xdf')],{'through':_0xc7ee('0x185'),'as':'Teams'});db[_0xc7ee('0x59')][_0xc7ee('0x117')](db['Disposition'],{'as':_0xc7ee('0x173'),'foreignKey':'OpenchannelAccountId','onDelete':'cascade'});db[_0xc7ee('0x59')][_0xc7ee('0x117')](db[_0xc7ee('0x7e')],{'as':_0xc7ee('0x163'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0xc7ee('0x117')](db[_0xc7ee('0x5d')],{'as':_0xc7ee('0x164'),'foreignKey':_0xc7ee('0x186')});db['OpenchannelAccount'][_0xc7ee('0x117')](db['OpenchannelMessage'],{'as':_0xc7ee('0x158'),'foreignKey':_0xc7ee('0x186')});db[_0xc7ee('0x59')]['hasMany'](db[_0xc7ee('0x5b')],{'as':'Applications','foreignKey':_0xc7ee('0x186'),'onDelete':'cascade'});db['OpenchannelAccount'][_0xc7ee('0x124')](db[_0xc7ee('0xf3')],{'as':'List','foreignKey':'ListId'});db[_0xc7ee('0x59')][_0xc7ee('0x124')](db[_0xc7ee('0x84')],{'as':_0xc7ee('0x176'),'foreignKey':_0xc7ee('0x153')});db[_0xc7ee('0x59')][_0xc7ee('0x125')](db[_0xc7ee('0xf')],{'as':_0xc7ee('0x155'),'through':_0xc7ee('0x143')});db[_0xc7ee('0x5b')]['belongsTo'](db[_0xc7ee('0xf')],{'onDelete':'restrict'});db[_0xc7ee('0x5b')][_0xc7ee('0x124')](db[_0xc7ee('0x60')],{'onDelete':_0xc7ee('0x162'),'foreignKey':'OpenchannelQueueId'});db['OpenchannelApplication'][_0xc7ee('0x124')](db['OpenchannelAccount'],{'onDelete':_0xc7ee('0x162'),'foreignKey':'OpenchannelAccountId'});db[_0xc7ee('0x5b')][_0xc7ee('0x124')](db[_0xc7ee('0x151')],{'onDelete':'restrict','foreignKey':_0xc7ee('0x152')});db[_0xc7ee('0x5b')]['belongsTo'](db['Tag'],{'onDelete':'restrict','foreignKey':_0xc7ee('0x170')});db['OpenchannelInteraction'][_0xc7ee('0x117')](db[_0xc7ee('0x187')],{'as':_0xc7ee('0x158'),'onDelete':_0xc7ee('0x115'),'foreignKey':_0xc7ee('0x188')});db['OpenchannelInteraction']['belongsTo'](db[_0xc7ee('0x59')],{'as':_0xc7ee('0x169'),'foreignKey':'OpenchannelAccountId'});db[_0xc7ee('0x5d')]['belongsTo'](db['CmContact'],{'as':_0xc7ee('0x15e'),'foreignKey':_0xc7ee('0x15f')});db[_0xc7ee('0x5d')]['belongsTo'](db[_0xc7ee('0xf')],{'as':_0xc7ee('0x16a'),'foreignKey':'UserId'});db[_0xc7ee('0x5d')][_0xc7ee('0x125')](db['Tag'],{'through':_0xc7ee('0x189'),'as':'Tags'});db['OpenchannelInteraction'][_0xc7ee('0x125')](db[_0xc7ee('0x8c')],{'through':'openchannel_interaction_has_tags','as':_0xc7ee('0x18a')});db['OpenchannelInteraction'][_0xc7ee('0x125')](db[_0xc7ee('0xf')],{'as':_0xc7ee('0x17a'),'through':_0xc7ee('0x130'),'foreignKey':_0xc7ee('0x188')});db['OpenchannelMessage'][_0xc7ee('0x124')](db[_0xc7ee('0xf')],{'onDelete':_0xc7ee('0x115'),'as':_0xc7ee('0xf')});db['OpenchannelMessage'][_0xc7ee('0x124')](db['CmContact'],{'onDelete':_0xc7ee('0x115'),'as':'Contact'});db['OpenchannelMessage'][_0xc7ee('0x124')](db['OpenchannelInteraction'],{'onDelete':_0xc7ee('0x115'),'as':_0xc7ee('0x17c'),'foreignKey':'OpenchannelInteractionId'});db[_0xc7ee('0x187')][_0xc7ee('0x124')](db['Attachment'],{'as':_0xc7ee('0xe7'),'foreignKey':_0xc7ee('0x17d')});db[_0xc7ee('0x187')][_0xc7ee('0x124')](db[_0xc7ee('0x59')],{'as':_0xc7ee('0x169'),'foreignKey':_0xc7ee('0x186')});db['OpenchannelQueue']['belongsToMany'](db[_0xc7ee('0xf')],{'as':_0xc7ee('0x155'),'through':_0xc7ee('0x35'),'foreignKey':'OpenchannelQueueId'});db[_0xc7ee('0x60')]['belongsToMany'](db[_0xc7ee('0xdf')],{'through':_0xc7ee('0x18b'),'as':_0xc7ee('0x167')});db[_0xc7ee('0x13c')][_0xc7ee('0x117')](db['Disposition'],{'as':_0xc7ee('0x173'),'foreignKey':_0xc7ee('0x16d'),'onDelete':_0xc7ee('0x115')});db[_0xc7ee('0x13c')]['hasMany'](db[_0xc7ee('0x7e')],{'as':_0xc7ee('0x163'),'foreignKey':_0xc7ee('0x16d')});db[_0xc7ee('0x13c')][_0xc7ee('0x117')](db[_0xc7ee('0x6e')],{'as':_0xc7ee('0x18c')});db['ChatWebsite'][_0xc7ee('0x117')](db[_0xc7ee('0x66')],{'as':'Interactions'});db[_0xc7ee('0x13c')][_0xc7ee('0x117')](db[_0xc7ee('0x18d')],{'as':_0xc7ee('0x148'),'foreignKey':_0xc7ee('0x16d'),'onDelete':_0xc7ee('0x115')});db[_0xc7ee('0x13c')][_0xc7ee('0x117')](db[_0xc7ee('0x68')],{'as':_0xc7ee('0x158')});db[_0xc7ee('0x13c')][_0xc7ee('0x124')](db['CmList'],{'as':_0xc7ee('0x171'),'foreignKey':_0xc7ee('0x165')});db[_0xc7ee('0x13c')][_0xc7ee('0x124')](db[_0xc7ee('0x151')],{'as':'Interval','foreignKey':_0xc7ee('0x152')});db[_0xc7ee('0x13c')][_0xc7ee('0x124')](db['MailAccount'],{'as':'MailAccount','foreignKey':'MailAccountId'});db[_0xc7ee('0x13c')][_0xc7ee('0x124')](db['Pause'],{'as':_0xc7ee('0x176'),'foreignKey':_0xc7ee('0x153')});db[_0xc7ee('0x13c')][_0xc7ee('0x125')](db['User'],{'as':_0xc7ee('0x155'),'through':'user_has_chat_websites'});db[_0xc7ee('0x63')][_0xc7ee('0x124')](db[_0xc7ee('0x59')],{});db[_0xc7ee('0x63')][_0xc7ee('0x124')](db[_0xc7ee('0xf3')],{'as':'List','foreignKey':'ListId'});db['OpenchannelQueueReport'][_0xc7ee('0x124')](db['CmContact'],{'as':_0xc7ee('0x15e'),'foreignKey':_0xc7ee('0x15f')});db['OpenchannelQueueReport']['belongsTo'](db['OpenchannelInteraction'],{});db[_0xc7ee('0x63')]['belongsTo'](db['OpenchannelMessage'],{});db[_0xc7ee('0x63')][_0xc7ee('0x124')](db[_0xc7ee('0xf')],{});db['OpenchannelQueueReport'][_0xc7ee('0x124')](db[_0xc7ee('0x60')],{});db[_0xc7ee('0x18d')][_0xc7ee('0x124')](db[_0xc7ee('0xf')],{'as':_0xc7ee('0x18e'),'foreignKey':_0xc7ee('0x113'),'onDelete':'restrict'});db[_0xc7ee('0x18d')][_0xc7ee('0x124')](db[_0xc7ee('0x6b')],{'as':_0xc7ee('0x18f'),'foreignKey':'ChatQueueId','onDelete':'restrict'});db[_0xc7ee('0x18d')]['belongsTo'](db['ChatWebsite'],{'as':_0xc7ee('0x190'),'foreignKey':_0xc7ee('0x16d'),'onDelete':_0xc7ee('0x162')});db[_0xc7ee('0x18d')][_0xc7ee('0x124')](db[_0xc7ee('0x8c')],{'onDelete':'restrict','foreignKey':_0xc7ee('0x170')});db[_0xc7ee('0x66')][_0xc7ee('0x117')](db['ChatMessage'],{'as':_0xc7ee('0x158'),'onDelete':_0xc7ee('0x115'),'foreignKey':'ChatInteractionId'});db[_0xc7ee('0x66')][_0xc7ee('0x124')](db[_0xc7ee('0x13c')],{'as':'Account','foreignKey':_0xc7ee('0x16d')});db[_0xc7ee('0x66')][_0xc7ee('0x124')](db[_0xc7ee('0x72')],{'as':'Contact','foreignKey':_0xc7ee('0x15f')});db['ChatInteraction'][_0xc7ee('0x124')](db[_0xc7ee('0xf')],{'as':_0xc7ee('0x16a'),'foreignKey':_0xc7ee('0x113')});db['ChatInteraction'][_0xc7ee('0x125')](db['Tag'],{'through':_0xc7ee('0x191'),'as':_0xc7ee('0x16b')});db[_0xc7ee('0x66')][_0xc7ee('0x125')](db[_0xc7ee('0x8c')],{'through':_0xc7ee('0x191'),'as':'ThroughTags'});db[_0xc7ee('0x66')][_0xc7ee('0x125')](db[_0xc7ee('0xf')],{'as':_0xc7ee('0x17a'),'through':_0xc7ee('0x12e'),'foreignKey':'ChatInteractionId'});db[_0xc7ee('0x68')]['belongsTo'](db[_0xc7ee('0xf')],{'onDelete':_0xc7ee('0x115'),'as':_0xc7ee('0xf')});db['ChatMessage'][_0xc7ee('0x124')](db['CmContact'],{'onDelete':_0xc7ee('0x115'),'as':_0xc7ee('0x15e'),'foreignKey':_0xc7ee('0x15f')});db[_0xc7ee('0x68')][_0xc7ee('0x124')](db[_0xc7ee('0x66')],{'onDelete':_0xc7ee('0x115'),'as':_0xc7ee('0x17c'),'foreignKey':_0xc7ee('0x192')});db[_0xc7ee('0x68')][_0xc7ee('0x124')](db[_0xc7ee('0xe7')],{'as':_0xc7ee('0xe7'),'foreignKey':'AttachmentId'});db[_0xc7ee('0x68')]['belongsTo'](db[_0xc7ee('0x13c')],{'as':'Account','foreignKey':_0xc7ee('0x16d')});db[_0xc7ee('0x6a')]['hasMany'](db[_0xc7ee('0xe7')],{'as':'Attachments','foreignKey':'ChatOfflineMessageId','onDelete':_0xc7ee('0x115'),'hooks':!![]});db[_0xc7ee('0x6a')]['belongsTo'](db[_0xc7ee('0x72')],{'onDelete':'cascade','as':_0xc7ee('0x15e'),'foreignKey':_0xc7ee('0x15f')});db[_0xc7ee('0x6a')][_0xc7ee('0x124')](db[_0xc7ee('0x13c')],{'as':_0xc7ee('0x169'),'foreignKey':'ChatWebsiteId'});db['ChatQueue'][_0xc7ee('0x125')](db[_0xc7ee('0xf')],{'as':'Agents','through':_0xc7ee('0x2e'),'hooks':!![]});db[_0xc7ee('0x6b')][_0xc7ee('0x125')](db[_0xc7ee('0xdf')],{'through':_0xc7ee('0x193'),'as':_0xc7ee('0x167')});db[_0xc7ee('0x194')][_0xc7ee('0x117')](db['ChatInternalMessage'],{'as':_0xc7ee('0x158'),'foreignKey':'ChatGroupId','onDelete':'cascade'});db[_0xc7ee('0x194')]['belongsToMany'](db[_0xc7ee('0xf')],{'as':'Members','through':_0xc7ee('0x127')});db['ChatProactiveAction'][_0xc7ee('0x124')](db[_0xc7ee('0x13c')],{'as':_0xc7ee('0x190'),'foreignKey':_0xc7ee('0x16d')});db[_0xc7ee('0x70')]['hasMany'](db['CmContact'],{'as':'Contacts','foreignKey':'CompanyId'});db[_0xc7ee('0x72')][_0xc7ee('0x117')](db[_0xc7ee('0x90')],{'as':'Phones','foreignKey':'CmContactId'});db['CmContact'][_0xc7ee('0x117')](db['CmHopper'],{'as':_0xc7ee('0x195'),'foreignKey':_0xc7ee('0x15f')});db[_0xc7ee('0x72')][_0xc7ee('0x117')](db[_0xc7ee('0x77')],{'as':_0xc7ee('0x11a'),'foreignKey':_0xc7ee('0x15f')});db[_0xc7ee('0x72')][_0xc7ee('0x117')](db['CmHopperHistory'],{'as':'HopperHistories','foreignKey':'ContactId'});db[_0xc7ee('0x72')][_0xc7ee('0x117')](db['ReportAgentPreview'],{'as':_0xc7ee('0x7b'),'foreignKey':_0xc7ee('0x15f')});db[_0xc7ee('0x72')]['hasMany'](db[_0xc7ee('0xd0')],{'as':_0xc7ee('0x14f'),'foreignKey':'ContactId'});db[_0xc7ee('0x72')][_0xc7ee('0x117')](db['OpenchannelInteraction'],{'as':_0xc7ee('0x11c'),'foreignKey':_0xc7ee('0x15f'),'onDelete':'restrict'});db[_0xc7ee('0x72')][_0xc7ee('0x117')](db[_0xc7ee('0x66')],{'as':_0xc7ee('0x11d'),'foreignKey':_0xc7ee('0x15f'),'onDelete':'restrict'});db[_0xc7ee('0x72')]['hasMany'](db[_0xc7ee('0x56')],{'as':_0xc7ee('0x11e'),'foreignKey':'ContactId','onDelete':_0xc7ee('0x162')});db[_0xc7ee('0x72')]['hasMany'](db[_0xc7ee('0x4d')],{'as':_0xc7ee('0x11f'),'foreignKey':_0xc7ee('0x15f'),'onDelete':_0xc7ee('0x162')});db[_0xc7ee('0x72')]['hasMany'](db[_0xc7ee('0x40')],{'as':'MailInteractions','foreignKey':'ContactId','onDelete':'restrict'});db['CmContact'][_0xc7ee('0x124')](db[_0xc7ee('0x70')],{'as':_0xc7ee('0x196'),'foreignKey':'CompanyId'});db['CmContact']['belongsTo'](db[_0xc7ee('0xf3')],{'as':_0xc7ee('0x171'),'foreignKey':'ListId','onDelete':'cascade'});db[_0xc7ee('0x72')]['belongsToMany'](db[_0xc7ee('0xf')],{'as':_0xc7ee('0x17a'),'through':_0xc7ee('0x129')});db[_0xc7ee('0x72')][_0xc7ee('0x125')](db['Tag'],{'as':'Tags','through':_0xc7ee('0x197')});db['CmContact'][_0xc7ee('0x125')](db[_0xc7ee('0x8c')],{'through':_0xc7ee('0x197'),'as':_0xc7ee('0x18a')});db[_0xc7ee('0x74')][_0xc7ee('0x117')](db[_0xc7ee('0x92')],{'as':_0xc7ee('0x198'),'foreignKey':'CmHopperId'});db[_0xc7ee('0x74')][_0xc7ee('0x124')](db[_0xc7ee('0x72')],{'as':_0xc7ee('0x15e'),'foreignKey':'ContactId','onDelete':_0xc7ee('0x115')});db[_0xc7ee('0x74')][_0xc7ee('0x124')](db[_0xc7ee('0xf3')],{'as':'List','foreignKey':'ListId','onDelete':_0xc7ee('0x115')});db[_0xc7ee('0x74')][_0xc7ee('0x124')](db['User'],{'as':_0xc7ee('0x18e'),'foreignKey':_0xc7ee('0x113')});db['CmHopper']['belongsTo'](db['VoiceQueue'],{'as':_0xc7ee('0x18f'),'foreignKey':'VoiceQueueId','onDelete':_0xc7ee('0x115')});db[_0xc7ee('0x74')]['belongsTo'](db[_0xc7ee('0xe3')],{'as':_0xc7ee('0xe3'),'foreignKey':'CampaignId','onDelete':'cascade'});db['CmHopper'][_0xc7ee('0x124')](db[_0xc7ee('0xf')],{'as':_0xc7ee('0x16a'),'foreignKey':'OwnerId'});db[_0xc7ee('0x14d')][_0xc7ee('0x124')](db[_0xc7ee('0x72')],{'as':_0xc7ee('0x15e'),'foreignKey':_0xc7ee('0x15f'),'onDelete':_0xc7ee('0x115')});db[_0xc7ee('0x14d')][_0xc7ee('0x124')](db[_0xc7ee('0xf3')],{'as':_0xc7ee('0x171'),'foreignKey':_0xc7ee('0x165'),'onDelete':_0xc7ee('0x115')});db[_0xc7ee('0x14d')][_0xc7ee('0x124')](db[_0xc7ee('0x18')],{'as':_0xc7ee('0x18f'),'foreignKey':_0xc7ee('0x14b'),'onDelete':_0xc7ee('0x115')});db[_0xc7ee('0x14d')]['belongsTo'](db[_0xc7ee('0xe3')],{'as':_0xc7ee('0xe3'),'foreignKey':'CampaignId','onDelete':_0xc7ee('0x115')});db['Automation']['hasMany'](db[_0xc7ee('0x81')],{'as':{'plural':_0xc7ee('0x199'),'singular':_0xc7ee('0x19a')},'foreignKey':_0xc7ee('0x19b'),'onDelete':_0xc7ee('0x115'),'hooks':!![]});db['Automation'][_0xc7ee('0x117')](db[_0xc7ee('0x81')],{'as':{'plural':_0xc7ee('0x19c'),'singular':'OneAny'},'foreignKey':_0xc7ee('0x19d'),'onDelete':'cascade','hooks':!![]});db['Automation'][_0xc7ee('0x117')](db['Action'],{'as':_0xc7ee('0x19e'),'foreignKey':_0xc7ee('0x19f'),'onDelete':'cascade','hooks':!![]});db[_0xc7ee('0x7f')][_0xc7ee('0x117')](db[_0xc7ee('0x7f')],{'as':_0xc7ee('0x173'),'foreignKey':'ParentId','onDelete':_0xc7ee('0x115')});db['Interval'][_0xc7ee('0x117')](db[_0xc7ee('0x151')],{'as':_0xc7ee('0x1a0'),'foreignKey':_0xc7ee('0x152'),'onDelete':_0xc7ee('0x115'),'hooks':!![],'required':![]});db['Interval']['hasMany'](db[_0xc7ee('0x15')],{'as':_0xc7ee('0x119'),'foreignKey':_0xc7ee('0x152'),'onDelete':_0xc7ee('0x162')});db['Interval'][_0xc7ee('0x117')](db[_0xc7ee('0x16f')],{'as':_0xc7ee('0x1a1'),'foreignKey':'IntervalId'});db['Interval']['hasMany'](db['ChatApplication'],{'as':'ChatApplications','foreignKey':_0xc7ee('0x152')});db[_0xc7ee('0x151')][_0xc7ee('0x117')](db[_0xc7ee('0x4c')],{'as':_0xc7ee('0x1a2'),'foreignKey':_0xc7ee('0x152')});db['Interval'][_0xc7ee('0x117')](db['SmsApplication'],{'as':_0xc7ee('0x1a3'),'foreignKey':_0xc7ee('0x152')});db[_0xc7ee('0x89')][_0xc7ee('0x124')](db[_0xc7ee('0x13f')],{});db[_0xc7ee('0x89')][_0xc7ee('0x124')](db[_0xc7ee('0x9a')],{'foreignKey':_0xc7ee('0x1a4')});db['Schedule'][_0xc7ee('0x124')](db[_0xc7ee('0x1a5')],{'foreignKey':_0xc7ee('0x1a6')});db['Sound'][_0xc7ee('0x125')](db[_0xc7ee('0x149')],{'as':_0xc7ee('0x1a7'),'through':'moh_has_sounds','onDelete':_0xc7ee('0x162')});db[_0xc7ee('0x8c')]['belongsToMany'](db['CmContact'],{'through':'cm_contact_has_tags'});db[_0xc7ee('0x8c')][_0xc7ee('0x125')](db[_0xc7ee('0x66')],{'through':_0xc7ee('0x191')});db[_0xc7ee('0x8c')][_0xc7ee('0x125')](db[_0xc7ee('0x40')],{'through':'mail_interaction_has_tags'});db['Tag'][_0xc7ee('0x125')](db['SmsInteraction'],{'through':_0xc7ee('0x182')});db[_0xc7ee('0x8c')]['belongsToMany'](db[_0xc7ee('0x4d')],{'through':_0xc7ee('0x179')});db[_0xc7ee('0x8c')][_0xc7ee('0x125')](db[_0xc7ee('0x5d')],{'through':_0xc7ee('0x189')});db['Tag'][_0xc7ee('0x125')](db[_0xc7ee('0xfe')],{'through':_0xc7ee('0x1a8')});db['CmContactHasItem'][_0xc7ee('0x124')](db[_0xc7ee('0x8e')],{'as':'ItemType','foreignKey':_0xc7ee('0x1a9')});db[_0xc7ee('0x92')][_0xc7ee('0x124')](db[_0xc7ee('0x74')],{'as':_0xc7ee('0x1aa'),'foreignKey':'CmHopperId'});db['CmContactHasItem'][_0xc7ee('0x124')](db[_0xc7ee('0x72')],{'as':_0xc7ee('0x15e'),'foreignKey':_0xc7ee('0x1ab')});db[_0xc7ee('0x1ac')]['hasMany'](db[_0xc7ee('0x81')],{'as':{'plural':'AllConditions','singular':_0xc7ee('0x1ad')},'foreignKey':_0xc7ee('0x1ae'),'onDelete':_0xc7ee('0x115'),'hooks':!![]});db[_0xc7ee('0x1ac')][_0xc7ee('0x117')](db[_0xc7ee('0x81')],{'as':{'plural':_0xc7ee('0x1af'),'singular':_0xc7ee('0x1b0')},'foreignKey':_0xc7ee('0x1b1'),'onDelete':_0xc7ee('0x115'),'hooks':!![]});db[_0xc7ee('0x1ac')]['hasMany'](db[_0xc7ee('0x7c')],{'as':'Actions','foreignKey':'TriggerId','onDelete':'cascade','hooks':!![]});db[_0xc7ee('0x1a5')][_0xc7ee('0x117')](db[_0xc7ee('0x9e')],{'as':_0xc7ee('0x1b2'),'onDelete':_0xc7ee('0x115'),'foreignKey':_0xc7ee('0x1a6'),'hooks':!![]});db[_0xc7ee('0x9a')][_0xc7ee('0x117')](db['AnalyticFieldReport'],{'as':_0xc7ee('0x1b2'),'onDelete':_0xc7ee('0x115'),'foreignKey':_0xc7ee('0x1a4')});db['AnalyticMetric'][_0xc7ee('0x117')](db[_0xc7ee('0x9e')],{'as':_0xc7ee('0x1b2'),'onDelete':_0xc7ee('0x115'),'foreignKey':'MetricId'});db[_0xc7ee('0x9e')][_0xc7ee('0x124')](db[_0xc7ee('0x1b3')],{'foreignKey':_0xc7ee('0x1b4')});db['SalesforceAccount'][_0xc7ee('0x117')](db[_0xc7ee('0xa2')],{'as':'Configurations','onDelete':_0xc7ee('0x115'),'foreignKey':_0xc7ee('0x1b5')});db[_0xc7ee('0xa2')][_0xc7ee('0x117')](db['SalesforceField'],{'as':_0xc7ee('0x1b6'),'onDelete':_0xc7ee('0x115'),'foreignKey':_0xc7ee('0x1b7')});db[_0xc7ee('0xa2')][_0xc7ee('0x117')](db['SalesforceField'],{'as':_0xc7ee('0x1b8'),'onDelete':_0xc7ee('0x115'),'foreignKey':_0xc7ee('0x1b9')});db[_0xc7ee('0xa2')][_0xc7ee('0x117')](db[_0xc7ee('0xa4')],{'as':_0xc7ee('0x1b2'),'onDelete':_0xc7ee('0x115'),'foreignKey':'FieldId'});db[_0xc7ee('0xa2')][_0xc7ee('0x124')](db[_0xc7ee('0x1ba')],{'as':_0xc7ee('0x169'),'foreignKey':'AccountId'});db[_0xc7ee('0xa4')][_0xc7ee('0x117')](db[_0xc7ee('0xa4')],{'as':'Subject','foreignKey':_0xc7ee('0x1b7')});db[_0xc7ee('0xa4')][_0xc7ee('0x117')](db[_0xc7ee('0xa4')],{'as':_0xc7ee('0x1bb'),'foreignKey':_0xc7ee('0x1b9')});db[_0xc7ee('0xa4')]['hasMany'](db[_0xc7ee('0xa4')],{'as':_0xc7ee('0x1bc'),'foreignKey':_0xc7ee('0x1bd')});db[_0xc7ee('0xa4')][_0xc7ee('0x124')](db[_0xc7ee('0x1be')],{'as':_0xc7ee('0x1be'),'foreignKey':_0xc7ee('0x1bf')});db[_0xc7ee('0x1c0')]['hasMany'](db[_0xc7ee('0xa7')],{'as':_0xc7ee('0x1c1'),'onDelete':_0xc7ee('0x115'),'foreignKey':_0xc7ee('0x1b5')});db[_0xc7ee('0xa7')]['hasMany'](db[_0xc7ee('0xa9')],{'as':_0xc7ee('0x1b6'),'onDelete':_0xc7ee('0x115'),'foreignKey':'SubjectId'});db[_0xc7ee('0xa7')]['hasMany'](db[_0xc7ee('0xa9')],{'as':_0xc7ee('0x1b8'),'onDelete':_0xc7ee('0x115'),'foreignKey':'DescriptionId'});db['SugarcrmConfiguration']['hasMany'](db[_0xc7ee('0xa9')],{'as':_0xc7ee('0x1b2'),'onDelete':'cascade','foreignKey':_0xc7ee('0x1bd')});db[_0xc7ee('0xa7')]['belongsTo'](db[_0xc7ee('0x1c0')],{'as':'Account','foreignKey':_0xc7ee('0x1b5')});db['SugarcrmField'][_0xc7ee('0x117')](db[_0xc7ee('0xa9')],{'as':_0xc7ee('0x1c2'),'foreignKey':_0xc7ee('0x1b7')});db[_0xc7ee('0xa9')][_0xc7ee('0x117')](db[_0xc7ee('0xa9')],{'as':_0xc7ee('0x1bb'),'foreignKey':_0xc7ee('0x1b9')});db[_0xc7ee('0xa9')][_0xc7ee('0x117')](db[_0xc7ee('0xa9')],{'as':'Field','foreignKey':_0xc7ee('0x1bd')});db[_0xc7ee('0xa9')]['belongsTo'](db[_0xc7ee('0x1be')],{'as':_0xc7ee('0x1be'),'foreignKey':_0xc7ee('0x1bf')});db[_0xc7ee('0xaa')][_0xc7ee('0x117')](db[_0xc7ee('0xac')],{'as':'Configurations','onDelete':_0xc7ee('0x115'),'foreignKey':_0xc7ee('0x1b5')});db['DeskConfiguration'][_0xc7ee('0x117')](db[_0xc7ee('0x1c3')],{'as':_0xc7ee('0x1b6'),'onDelete':_0xc7ee('0x115'),'foreignKey':_0xc7ee('0x1b7')});db[_0xc7ee('0xac')][_0xc7ee('0x117')](db['DeskField'],{'as':_0xc7ee('0x1b8'),'onDelete':_0xc7ee('0x115'),'foreignKey':_0xc7ee('0x1b9')});db[_0xc7ee('0xac')][_0xc7ee('0x117')](db[_0xc7ee('0x1c3')],{'as':_0xc7ee('0x1b2'),'onDelete':_0xc7ee('0x115'),'foreignKey':_0xc7ee('0x1bd')});db['DeskConfiguration'][_0xc7ee('0x124')](db[_0xc7ee('0xaa')],{'as':_0xc7ee('0x169'),'foreignKey':'AccountId'});db[_0xc7ee('0xac')][_0xc7ee('0x125')](db[_0xc7ee('0x8c')],{'through':_0xc7ee('0x1c4')});db[_0xc7ee('0x1c3')][_0xc7ee('0x117')](db[_0xc7ee('0x1c3')],{'as':_0xc7ee('0x1c2'),'foreignKey':'SubjectId'});db['DeskField'][_0xc7ee('0x117')](db[_0xc7ee('0x1c3')],{'as':'Description','foreignKey':_0xc7ee('0x1b9')});db[_0xc7ee('0x1c3')]['hasMany'](db['DeskField'],{'as':_0xc7ee('0x1bc'),'foreignKey':_0xc7ee('0x1bd')});db[_0xc7ee('0x1c3')][_0xc7ee('0x124')](db[_0xc7ee('0x1be')],{'as':_0xc7ee('0x1be'),'foreignKey':_0xc7ee('0x1bf')});db['ZohoAccount'][_0xc7ee('0x117')](db[_0xc7ee('0xb1')],{'as':_0xc7ee('0x1c1'),'onDelete':_0xc7ee('0x115'),'foreignKey':_0xc7ee('0x1b5')});db[_0xc7ee('0xb1')]['hasMany'](db[_0xc7ee('0xb3')],{'as':_0xc7ee('0x1b6'),'onDelete':'cascade','foreignKey':_0xc7ee('0x1b7')});db[_0xc7ee('0xb1')][_0xc7ee('0x117')](db[_0xc7ee('0xb3')],{'as':_0xc7ee('0x1b8'),'onDelete':'cascade','foreignKey':_0xc7ee('0x1b9')});db['ZohoConfiguration'][_0xc7ee('0x117')](db[_0xc7ee('0xb3')],{'as':_0xc7ee('0x1b2'),'onDelete':_0xc7ee('0x115'),'foreignKey':_0xc7ee('0x1bd')});db[_0xc7ee('0xb1')][_0xc7ee('0x124')](db['ZohoAccount'],{'as':_0xc7ee('0x169'),'foreignKey':_0xc7ee('0x1b5')});db[_0xc7ee('0xb3')]['hasMany'](db[_0xc7ee('0xb3')],{'as':_0xc7ee('0x1c2'),'foreignKey':_0xc7ee('0x1b7')});db[_0xc7ee('0xb3')]['hasMany'](db['ZohoField'],{'as':_0xc7ee('0x1bb'),'foreignKey':_0xc7ee('0x1b9')});db[_0xc7ee('0xb3')][_0xc7ee('0x117')](db[_0xc7ee('0xb3')],{'as':_0xc7ee('0x1bc'),'foreignKey':'FieldId'});db[_0xc7ee('0xb3')][_0xc7ee('0x124')](db[_0xc7ee('0x1be')],{'as':'Variable','foreignKey':'VariableId'});db[_0xc7ee('0xb4')]['hasMany'](db[_0xc7ee('0xb6')],{'as':_0xc7ee('0x1c1'),'onDelete':_0xc7ee('0x115'),'foreignKey':_0xc7ee('0x1b5')});db[_0xc7ee('0xb6')]['hasMany'](db[_0xc7ee('0xb7')],{'as':'Subjects','foreignKey':_0xc7ee('0x1b7')});db[_0xc7ee('0xb6')][_0xc7ee('0x117')](db[_0xc7ee('0xb7')],{'as':_0xc7ee('0x1b8'),'foreignKey':'DescriptionId'});db[_0xc7ee('0xb6')][_0xc7ee('0x117')](db['ZendeskField'],{'as':_0xc7ee('0x1b2'),'foreignKey':'FieldId'});db[_0xc7ee('0xb6')][_0xc7ee('0x124')](db['ZendeskAccount'],{'as':'Account','foreignKey':_0xc7ee('0x1b5')});db['ZendeskConfiguration'][_0xc7ee('0x125')](db[_0xc7ee('0x8c')],{'through':'int_zendesk_configuration_has_tags'});db[_0xc7ee('0xb7')][_0xc7ee('0x117')](db[_0xc7ee('0xb7')],{'as':_0xc7ee('0x1c2'),'foreignKey':_0xc7ee('0x1b7')});db[_0xc7ee('0xb7')][_0xc7ee('0x117')](db[_0xc7ee('0xb7')],{'as':_0xc7ee('0x1bb'),'foreignKey':'DescriptionId'});db[_0xc7ee('0xb7')][_0xc7ee('0x117')](db['ZendeskField'],{'as':_0xc7ee('0x1bc'),'foreignKey':_0xc7ee('0x1bd')});db[_0xc7ee('0xb7')][_0xc7ee('0x124')](db[_0xc7ee('0x1be')],{'as':_0xc7ee('0x1be'),'foreignKey':_0xc7ee('0x1bf')});db[_0xc7ee('0x1c5')][_0xc7ee('0x117')](db[_0xc7ee('0x1c6')],{'as':_0xc7ee('0x1c1'),'onDelete':_0xc7ee('0x115'),'foreignKey':'AccountId'});db[_0xc7ee('0x1c6')]['hasMany'](db[_0xc7ee('0xba')],{'as':'Subjects','onDelete':_0xc7ee('0x115'),'foreignKey':'SubjectId'});db[_0xc7ee('0x1c6')]['hasMany'](db[_0xc7ee('0xba')],{'as':_0xc7ee('0x1b8'),'onDelete':_0xc7ee('0x115'),'foreignKey':_0xc7ee('0x1b9')});db[_0xc7ee('0x1c6')][_0xc7ee('0x117')](db['FreshdeskField'],{'as':_0xc7ee('0x1b2'),'onDelete':_0xc7ee('0x115'),'foreignKey':_0xc7ee('0x1bd')});db[_0xc7ee('0x1c6')][_0xc7ee('0x124')](db[_0xc7ee('0x1c5')],{'as':_0xc7ee('0x169'),'foreignKey':'AccountId'});db[_0xc7ee('0x1c6')][_0xc7ee('0x125')](db[_0xc7ee('0x8c')],{'through':_0xc7ee('0x1c7')});db[_0xc7ee('0xba')][_0xc7ee('0x117')](db[_0xc7ee('0xba')],{'as':_0xc7ee('0x1c2'),'foreignKey':'SubjectId'});db[_0xc7ee('0xba')]['hasMany'](db[_0xc7ee('0xba')],{'as':_0xc7ee('0x1bb'),'foreignKey':_0xc7ee('0x1b9')});db[_0xc7ee('0xba')][_0xc7ee('0x117')](db[_0xc7ee('0xba')],{'as':_0xc7ee('0x1bc'),'foreignKey':'FieldId'});db[_0xc7ee('0xba')][_0xc7ee('0x124')](db['Variable'],{'as':'Variable','foreignKey':_0xc7ee('0x1bf')});db[_0xc7ee('0x1c8')][_0xc7ee('0x117')](db[_0xc7ee('0xbd')],{'as':_0xc7ee('0x1c1'),'onDelete':_0xc7ee('0x115'),'foreignKey':_0xc7ee('0x1b5')});db[_0xc7ee('0xbd')]['hasMany'](db[_0xc7ee('0xbe')],{'as':_0xc7ee('0x1b6'),'foreignKey':_0xc7ee('0x1b7')});db['VtigerConfiguration']['hasMany'](db[_0xc7ee('0xbe')],{'as':'Descriptions','foreignKey':_0xc7ee('0x1b9')});db[_0xc7ee('0xbd')]['hasMany'](db[_0xc7ee('0xbe')],{'as':_0xc7ee('0x1b2'),'foreignKey':'FieldId'});db['VtigerConfiguration'][_0xc7ee('0x124')](db[_0xc7ee('0x1c8')],{'as':'Account','foreignKey':_0xc7ee('0x1b5')});db['VtigerField'][_0xc7ee('0x117')](db[_0xc7ee('0xbe')],{'as':'Subject','foreignKey':_0xc7ee('0x1b7')});db[_0xc7ee('0xbe')][_0xc7ee('0x117')](db[_0xc7ee('0xbe')],{'as':_0xc7ee('0x1bb'),'foreignKey':_0xc7ee('0x1b9')});db[_0xc7ee('0xbe')]['hasMany'](db['VtigerField'],{'as':'Field','foreignKey':'FieldId'});db['VtigerField'][_0xc7ee('0x124')](db[_0xc7ee('0x1be')],{'as':_0xc7ee('0x1be'),'foreignKey':_0xc7ee('0x1bf')});db[_0xc7ee('0xbf')][_0xc7ee('0x117')](db[_0xc7ee('0x1c9')],{'as':_0xc7ee('0x1c1'),'onDelete':_0xc7ee('0x115'),'foreignKey':_0xc7ee('0x1b5')});db[_0xc7ee('0x1c9')][_0xc7ee('0x117')](db[_0xc7ee('0xc1')],{'as':'Subjects','foreignKey':_0xc7ee('0x1b7')});db[_0xc7ee('0x1c9')][_0xc7ee('0x117')](db[_0xc7ee('0xc1')],{'as':'Descriptions','foreignKey':_0xc7ee('0x1b9')});db[_0xc7ee('0x1c9')]['hasMany'](db[_0xc7ee('0xc1')],{'as':_0xc7ee('0x1b2'),'foreignKey':'FieldId'});db['ServicenowConfiguration']['belongsTo'](db['ServicenowAccount'],{'as':_0xc7ee('0x169'),'foreignKey':'AccountId'});db[_0xc7ee('0xc1')][_0xc7ee('0x117')](db[_0xc7ee('0xc1')],{'as':_0xc7ee('0x1c2'),'foreignKey':'SubjectId'});db[_0xc7ee('0xc1')]['hasMany'](db[_0xc7ee('0xc1')],{'as':'Description','foreignKey':_0xc7ee('0x1b9')});db[_0xc7ee('0xc1')][_0xc7ee('0x117')](db['ServicenowField'],{'as':'Field','foreignKey':_0xc7ee('0x1bd')});db[_0xc7ee('0xc1')][_0xc7ee('0x124')](db[_0xc7ee('0x1be')],{'as':_0xc7ee('0x1be'),'foreignKey':_0xc7ee('0x1bf')});db[_0xc7ee('0xc3')][_0xc7ee('0x117')](db[_0xc7ee('0xc4')],{'as':'Configurations','onDelete':_0xc7ee('0x115'),'foreignKey':'AccountId'});db[_0xc7ee('0xc3')][_0xc7ee('0x124')](db[_0xc7ee('0x107')],{'as':'CloudProvider','foreignKey':_0xc7ee('0x161')});db[_0xc7ee('0xc4')]['hasMany'](db[_0xc7ee('0x1ca')],{'as':'Subjects','onDelete':_0xc7ee('0x115'),'foreignKey':'SubjectId'});db[_0xc7ee('0xc4')][_0xc7ee('0x117')](db[_0xc7ee('0x1ca')],{'as':'Descriptions','onDelete':_0xc7ee('0x115'),'foreignKey':_0xc7ee('0x1b9')});db['Dynamics365Configuration'][_0xc7ee('0x117')](db[_0xc7ee('0x1ca')],{'as':_0xc7ee('0x1b2'),'onDelete':'cascade','foreignKey':_0xc7ee('0x1bd')});db[_0xc7ee('0xc4')][_0xc7ee('0x124')](db[_0xc7ee('0xc3')],{'as':'Account','foreignKey':_0xc7ee('0x1b5')});db['Dynamics365Field'][_0xc7ee('0x117')](db[_0xc7ee('0x1ca')],{'as':_0xc7ee('0x1c2'),'foreignKey':_0xc7ee('0x1b7')});db['Dynamics365Field'][_0xc7ee('0x117')](db[_0xc7ee('0x1ca')],{'as':_0xc7ee('0x1bb'),'foreignKey':_0xc7ee('0x1b9')});db['Dynamics365Field'][_0xc7ee('0x117')](db[_0xc7ee('0x1ca')],{'as':_0xc7ee('0x1bc'),'foreignKey':_0xc7ee('0x1bd')});db[_0xc7ee('0x1ca')]['belongsTo'](db['Variable'],{'as':_0xc7ee('0x1be'),'foreignKey':_0xc7ee('0x1bf')});db[_0xc7ee('0x1cb')][_0xc7ee('0x117')](db['FreshsalesConfiguration'],{'as':_0xc7ee('0x1c1'),'onDelete':_0xc7ee('0x115'),'foreignKey':'AccountId'});db[_0xc7ee('0x1cc')]['hasMany'](db['FreshsalesField'],{'as':_0xc7ee('0x1b6'),'foreignKey':_0xc7ee('0x1b7')});db[_0xc7ee('0x1cc')]['hasMany'](db[_0xc7ee('0x1cd')],{'as':_0xc7ee('0x1b8'),'foreignKey':_0xc7ee('0x1b9')});db['FreshsalesConfiguration'][_0xc7ee('0x117')](db[_0xc7ee('0x1cd')],{'as':_0xc7ee('0x1b2'),'foreignKey':_0xc7ee('0x1bd')});db[_0xc7ee('0x1cc')][_0xc7ee('0x124')](db[_0xc7ee('0x1cb')],{'as':'Account','foreignKey':'AccountId'});db['FreshsalesField'][_0xc7ee('0x117')](db['FreshsalesField'],{'as':'Subject','foreignKey':_0xc7ee('0x1b7')});db[_0xc7ee('0x1cd')][_0xc7ee('0x117')](db[_0xc7ee('0x1cd')],{'as':'Description','foreignKey':_0xc7ee('0x1b9')});db[_0xc7ee('0x1cd')][_0xc7ee('0x117')](db['FreshsalesField'],{'as':'Field','foreignKey':_0xc7ee('0x1bd')});db[_0xc7ee('0x1cd')][_0xc7ee('0x124')](db[_0xc7ee('0x1be')],{'as':_0xc7ee('0x1be'),'foreignKey':_0xc7ee('0x1bf')});db['ChatQueueReport']['belongsTo'](db[_0xc7ee('0x13c')],{});db[_0xc7ee('0xca')]['belongsTo'](db['CmList'],{'as':_0xc7ee('0x171'),'foreignKey':_0xc7ee('0x165')});db[_0xc7ee('0xca')]['belongsTo'](db['CmContact'],{'as':_0xc7ee('0x15e'),'foreignKey':_0xc7ee('0x15f')});db['ChatQueueReport'][_0xc7ee('0x124')](db[_0xc7ee('0x66')],{});db[_0xc7ee('0xca')]['belongsTo'](db['ChatMessage'],{});db[_0xc7ee('0xca')][_0xc7ee('0x124')](db[_0xc7ee('0xf')],{});db[_0xc7ee('0xca')][_0xc7ee('0x124')](db['ChatQueue'],{});db[_0xc7ee('0xcb')][_0xc7ee('0x124')](db['User'],{'onDelete':_0xc7ee('0x115'),'foreignKey':_0xc7ee('0x1ce')});db[_0xc7ee('0xcb')]['belongsTo'](db[_0xc7ee('0xf')],{'onDelete':_0xc7ee('0x115'),'foreignKey':_0xc7ee('0x1cf')});db[_0xc7ee('0xd0')][_0xc7ee('0x117')](db['JscriptyQuestionReport'],{'foreignKey':'SessionId','onDelete':_0xc7ee('0x115')});db['JscriptySessionReport'][_0xc7ee('0x117')](db[_0xc7ee('0xcd')],{'foreignKey':_0xc7ee('0x1d0'),'onDelete':_0xc7ee('0x115')});db[_0xc7ee('0x1d1')]['belongsTo'](db[_0xc7ee('0x53')],{});db[_0xc7ee('0x1d1')][_0xc7ee('0x124')](db[_0xc7ee('0xf3')],{'as':'List','foreignKey':_0xc7ee('0x165')});db[_0xc7ee('0x1d1')]['belongsTo'](db[_0xc7ee('0x72')],{'as':_0xc7ee('0x15e'),'foreignKey':_0xc7ee('0x15f')});db['SmsQueueReport']['belongsTo'](db[_0xc7ee('0x56')],{});db[_0xc7ee('0x1d1')]['belongsTo'](db[_0xc7ee('0x58')],{});db[_0xc7ee('0x1d1')]['belongsTo'](db[_0xc7ee('0xf')],{});db['SmsQueueReport']['belongsTo'](db[_0xc7ee('0x180')],{});db[_0xc7ee('0xd6')][_0xc7ee('0x117')](db[_0xc7ee('0xd0')],{'foreignKey':'ProjectId'});db[_0xc7ee('0xd6')]['hasMany'](db[_0xc7ee('0x1d2')],{'foreignKey':_0xc7ee('0x1d3')});db[_0xc7ee('0xd6')]['hasMany'](db[_0xc7ee('0xcd')],{'foreignKey':_0xc7ee('0x1d3')});db[_0xc7ee('0xdf')][_0xc7ee('0x125')](db['User'],{'as':_0xc7ee('0x155'),'through':'user_has_teams'});db[_0xc7ee('0xdf')][_0xc7ee('0x125')](db[_0xc7ee('0x18')],{'through':_0xc7ee('0x109'),'as':_0xc7ee('0x132')});db[_0xc7ee('0xdf')][_0xc7ee('0x125')](db['MailQueue'],{'through':_0xc7ee('0x166'),'as':'MailQueues'});db['Team']['belongsToMany'](db['ChatQueue'],{'through':_0xc7ee('0x193'),'as':_0xc7ee('0x136')});db[_0xc7ee('0xdf')][_0xc7ee('0x125')](db[_0xc7ee('0x4f')],{'through':_0xc7ee('0x17e'),'as':_0xc7ee('0x1d4')});db[_0xc7ee('0xdf')]['belongsToMany'](db[_0xc7ee('0x180')],{'through':_0xc7ee('0x185'),'as':_0xc7ee('0x137')});db[_0xc7ee('0xdf')][_0xc7ee('0x125')](db['OpenchannelQueue'],{'through':_0xc7ee('0x18b'),'as':'OpenchannelQueues'});db['Team']['belongsToMany'](db[_0xc7ee('0x105')],{'through':_0xc7ee('0x1d5'),'as':_0xc7ee('0x139')});db[_0xc7ee('0xdf')]['belongsToMany'](db['VoicePrefix'],{'through':_0xc7ee('0x10b'),'as':_0xc7ee('0x134')});db[_0xc7ee('0xe3')][_0xc7ee('0x117')](db[_0xc7ee('0x74')],{'as':'Hoppers','foreignKey':'CampaignId'});db[_0xc7ee('0xe3')][_0xc7ee('0x117')](db[_0xc7ee('0x77')],{'as':'HopperFinals','foreignKey':_0xc7ee('0x1d6')});db[_0xc7ee('0xe3')][_0xc7ee('0x117')](db[_0xc7ee('0x79')],{'as':'HopperHistories','foreignKey':_0xc7ee('0x1d6')});db[_0xc7ee('0xe3')][_0xc7ee('0x117')](db['CmHopperBlack'],{'as':_0xc7ee('0x14e'),'foreignKey':_0xc7ee('0x1d6')});db['Campaign'][_0xc7ee('0x124')](db[_0xc7ee('0x28')],{'as':_0xc7ee('0x28'),'foreignKey':_0xc7ee('0x1d7')});db[_0xc7ee('0xe3')]['belongsTo'](db[_0xc7ee('0x28')],{'as':'TrunkBackup','foreignKey':_0xc7ee('0x150')});db['Campaign'][_0xc7ee('0x124')](db['Interval'],{'as':_0xc7ee('0x151'),'foreignKey':'IntervalId'});db[_0xc7ee('0xe3')][_0xc7ee('0x124')](db['SquareProject'],{'as':'SquareProject','foreignKey':_0xc7ee('0x1d8')});db['Campaign'][_0xc7ee('0x125')](db[_0xc7ee('0xf3')],{'as':_0xc7ee('0x12a'),'through':_0xc7ee('0x1d9')});db[_0xc7ee('0xe3')][_0xc7ee('0x125')](db['CmList'],{'as':'BlackLists','through':'campaigns_has_cm_blacklists'});db[_0xc7ee('0xe7')][_0xc7ee('0x124')](db[_0xc7ee('0x6a')],{'as':_0xc7ee('0x6a'),'foreignKey':_0xc7ee('0x16e')});db[_0xc7ee('0xea')]['belongsTo'](db['MailMessage'],{});db[_0xc7ee('0xea')][_0xc7ee('0x124')](db[_0xc7ee('0x40')],{});db[_0xc7ee('0xea')]['belongsTo'](db['MailAccount'],{'foreignKey':_0xc7ee('0x1da'),'as':_0xc7ee('0x1db')});db[_0xc7ee('0xea')][_0xc7ee('0x124')](db[_0xc7ee('0xf')],{'foreignKey':_0xc7ee('0x1dc'),'as':'FromAgent'});db[_0xc7ee('0xea')][_0xc7ee('0x124')](db[_0xc7ee('0xf')],{'foreignKey':_0xc7ee('0x1dd'),'as':_0xc7ee('0x1de')});db[_0xc7ee('0xea')][_0xc7ee('0x124')](db[_0xc7ee('0x3c')],{'foreignKey':_0xc7ee('0x1df'),'as':_0xc7ee('0x1e0')});db['MailTransferReport'][_0xc7ee('0x124')](db[_0xc7ee('0x13f')],{'foreignKey':_0xc7ee('0x1e1'),'as':_0xc7ee('0x1e2')});db[_0xc7ee('0xec')]['belongsTo'](db[_0xc7ee('0x68')],{});db[_0xc7ee('0xec')][_0xc7ee('0x124')](db[_0xc7ee('0x66')],{});db[_0xc7ee('0xec')][_0xc7ee('0x124')](db['ChatWebsite'],{'foreignKey':_0xc7ee('0x1e3'),'as':'FromAccount'});db[_0xc7ee('0xec')]['belongsTo'](db[_0xc7ee('0xf')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0xc7ee('0xec')][_0xc7ee('0x124')](db[_0xc7ee('0xf')],{'foreignKey':_0xc7ee('0x1dd'),'as':_0xc7ee('0x1de')});db[_0xc7ee('0xec')][_0xc7ee('0x124')](db[_0xc7ee('0x6b')],{'foreignKey':_0xc7ee('0x1e4'),'as':'ToQueue'});db[_0xc7ee('0xec')]['belongsTo'](db[_0xc7ee('0x13c')],{'foreignKey':_0xc7ee('0x1e5'),'as':_0xc7ee('0x1e2')});db[_0xc7ee('0xee')][_0xc7ee('0x124')](db['FaxMessage'],{});db['FaxTransferReport']['belongsTo'](db['FaxInteraction'],{});db[_0xc7ee('0xee')][_0xc7ee('0x124')](db['FaxAccount'],{'foreignKey':'FromFaxAccountId','as':'FromAccount'});db['FaxTransferReport'][_0xc7ee('0x124')](db[_0xc7ee('0xf')],{'foreignKey':_0xc7ee('0x1dc'),'as':_0xc7ee('0x1e6')});db[_0xc7ee('0xee')][_0xc7ee('0x124')](db['User'],{'foreignKey':_0xc7ee('0x1dd'),'as':_0xc7ee('0x1de')});db[_0xc7ee('0xee')][_0xc7ee('0x124')](db[_0xc7ee('0x4f')],{'foreignKey':_0xc7ee('0x1e7'),'as':'ToQueue'});db['FaxTransferReport'][_0xc7ee('0x124')](db[_0xc7ee('0x4a')],{'foreignKey':'ToFaxAccountId','as':'ToAccount'});db[_0xc7ee('0xf0')][_0xc7ee('0x124')](db[_0xc7ee('0x187')],{});db[_0xc7ee('0xf0')][_0xc7ee('0x124')](db[_0xc7ee('0x5d')],{});db[_0xc7ee('0xf0')][_0xc7ee('0x124')](db['OpenchannelAccount'],{'foreignKey':_0xc7ee('0x1e8'),'as':_0xc7ee('0x1db')});db[_0xc7ee('0xf0')]['belongsTo'](db['User'],{'foreignKey':_0xc7ee('0x1dc'),'as':_0xc7ee('0x1e6')});db[_0xc7ee('0xf0')][_0xc7ee('0x124')](db[_0xc7ee('0xf')],{'foreignKey':_0xc7ee('0x1dd'),'as':_0xc7ee('0x1de')});db[_0xc7ee('0xf0')]['belongsTo'](db[_0xc7ee('0x60')],{'foreignKey':_0xc7ee('0x1e9'),'as':_0xc7ee('0x1e0')});db['OpenchannelTransferReport'][_0xc7ee('0x124')](db[_0xc7ee('0x59')],{'foreignKey':_0xc7ee('0x1ea'),'as':_0xc7ee('0x1e2')});db['SmsTransferReport']['belongsTo'](db[_0xc7ee('0x58')],{});db[_0xc7ee('0xf2')]['belongsTo'](db['SmsInteraction'],{});db[_0xc7ee('0xf2')][_0xc7ee('0x124')](db[_0xc7ee('0x53')],{'foreignKey':_0xc7ee('0x1eb'),'as':_0xc7ee('0x1db')});db[_0xc7ee('0xf2')][_0xc7ee('0x124')](db['User'],{'foreignKey':_0xc7ee('0x1dc'),'as':_0xc7ee('0x1e6')});db[_0xc7ee('0xf2')]['belongsTo'](db[_0xc7ee('0xf')],{'foreignKey':_0xc7ee('0x1dd'),'as':_0xc7ee('0x1de')});db['SmsTransferReport']['belongsTo'](db[_0xc7ee('0x180')],{'foreignKey':_0xc7ee('0x1ec'),'as':'ToQueue'});db[_0xc7ee('0xf2')][_0xc7ee('0x124')](db['SmsAccount'],{'foreignKey':_0xc7ee('0x1ed'),'as':_0xc7ee('0x1e2')});db[_0xc7ee('0xf3')]['hasMany'](db[_0xc7ee('0x7f')],{'as':_0xc7ee('0x173'),'foreignKey':_0xc7ee('0x165'),'onDelete':_0xc7ee('0x115')});db[_0xc7ee('0xf3')][_0xc7ee('0x117')](db[_0xc7ee('0x1ee')],{'as':_0xc7ee('0x1ef'),'foreignKey':_0xc7ee('0x165')});db[_0xc7ee('0xf3')]['hasMany'](db[_0xc7ee('0x72')],{'as':_0xc7ee('0x128'),'onDelete':_0xc7ee('0x115'),'foreignKey':'ListId'});db[_0xc7ee('0xf3')][_0xc7ee('0x117')](db[_0xc7ee('0x77')],{'as':_0xc7ee('0x11a'),'foreignKey':_0xc7ee('0x165')});db[_0xc7ee('0xf3')][_0xc7ee('0x117')](db[_0xc7ee('0x79')],{'as':_0xc7ee('0x11b'),'foreignKey':_0xc7ee('0x165')});db[_0xc7ee('0xf3')][_0xc7ee('0x117')](db[_0xc7ee('0x7b')],{'as':_0xc7ee('0x7b'),'foreignKey':_0xc7ee('0x165')});db['CmList']['belongsToMany'](db[_0xc7ee('0x18')],{'as':_0xc7ee('0x1f0'),'through':_0xc7ee('0x154')});db[_0xc7ee('0xf3')][_0xc7ee('0x125')](db[_0xc7ee('0xf')],{'as':_0xc7ee('0x155'),'through':_0xc7ee('0x13b')});db[_0xc7ee('0x133')][_0xc7ee('0x117')](db[_0xc7ee('0x15')],{'as':_0xc7ee('0x119'),'onDelete':_0xc7ee('0x115')});db[_0xc7ee('0x133')]['belongsToMany'](db['User'],{'as':_0xc7ee('0x155'),'through':_0xc7ee('0x10d')});db[_0xc7ee('0x133')][_0xc7ee('0x125')](db[_0xc7ee('0xdf')],{'through':_0xc7ee('0x10b'),'as':_0xc7ee('0x167')});db[_0xc7ee('0xf6')]['hasMany'](db['User'],{'as':'Users','foreignKey':_0xc7ee('0x1f1')});db[_0xc7ee('0xf6')][_0xc7ee('0x117')](db[_0xc7ee('0xf8')],{'as':'UserProfileSections','foreignKey':_0xc7ee('0x1f1'),'onDelete':'cascade'});db[_0xc7ee('0xf8')][_0xc7ee('0x117')](db[_0xc7ee('0x1f2')],{'as':_0xc7ee('0x1f3'),'foreignKey':_0xc7ee('0x1f4'),'onDelete':'cascade'});db[_0xc7ee('0xfc')][_0xc7ee('0x117')](db[_0xc7ee('0x7f')],{'as':_0xc7ee('0x173'),'foreignKey':_0xc7ee('0x1f5'),'onDelete':'cascade'});db[_0xc7ee('0xfc')][_0xc7ee('0x117')](db['CannedAnswer'],{'as':_0xc7ee('0x163'),'foreignKey':'WhatsappAccountId'});db[_0xc7ee('0xfc')][_0xc7ee('0x117')](db['WhatsappMessage'],{'as':'Messages','foreignKey':_0xc7ee('0x1f5')});db[_0xc7ee('0xfc')][_0xc7ee('0x117')](db[_0xc7ee('0xfe')],{'as':_0xc7ee('0x164')});db['WhatsappAccount']['hasMany'](db[_0xc7ee('0xfd')],{'as':_0xc7ee('0x148'),'foreignKey':_0xc7ee('0x1f5'),'onDelete':'cascade'});db[_0xc7ee('0xfc')][_0xc7ee('0x124')](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0xc7ee('0xfc')]['belongsTo'](db[_0xc7ee('0x84')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0xc7ee('0xfc')][_0xc7ee('0x125')](db[_0xc7ee('0xf')],{'as':_0xc7ee('0x155'),'through':_0xc7ee('0x1f6')});db[_0xc7ee('0xfd')][_0xc7ee('0x124')](db['User'],{'onDelete':_0xc7ee('0x162')});db[_0xc7ee('0xfd')][_0xc7ee('0x124')](db['WhatsappQueue'],{'onDelete':_0xc7ee('0x162')});db[_0xc7ee('0xfd')][_0xc7ee('0x124')](db[_0xc7ee('0xfc')],{'onDelete':_0xc7ee('0x162')});db[_0xc7ee('0xfd')][_0xc7ee('0x124')](db['Interval'],{'onDelete':'restrict','foreignKey':'IntervalId'});db[_0xc7ee('0xfd')][_0xc7ee('0x124')](db[_0xc7ee('0x8c')],{'onDelete':'restrict','foreignKey':'TagId'});db[_0xc7ee('0xfe')][_0xc7ee('0x117')](db[_0xc7ee('0x100')],{'as':_0xc7ee('0x158'),'onDelete':_0xc7ee('0x115'),'foreignKey':_0xc7ee('0x1f7')});db[_0xc7ee('0xfe')][_0xc7ee('0x124')](db[_0xc7ee('0xfc')],{'as':_0xc7ee('0x169'),'foreignKey':_0xc7ee('0x1f5')});db[_0xc7ee('0xfe')][_0xc7ee('0x124')](db['CmContact'],{'as':_0xc7ee('0x15e'),'foreignKey':_0xc7ee('0x15f')});db[_0xc7ee('0xfe')][_0xc7ee('0x124')](db[_0xc7ee('0xf')],{'as':'Owner','foreignKey':_0xc7ee('0x113')});db[_0xc7ee('0xfe')][_0xc7ee('0x125')](db[_0xc7ee('0x8c')],{'through':'whatsapp_interaction_has_tags','as':_0xc7ee('0x16b')});db[_0xc7ee('0xfe')][_0xc7ee('0x125')](db[_0xc7ee('0x8c')],{'through':_0xc7ee('0x1a8'),'as':'ThroughTags'});db[_0xc7ee('0xfe')][_0xc7ee('0x125')](db['User'],{'as':_0xc7ee('0x17a'),'through':_0xc7ee('0x131'),'foreignKey':_0xc7ee('0x1f7')});db[_0xc7ee('0x100')][_0xc7ee('0x124')](db['User'],{'as':'User'});db[_0xc7ee('0x100')][_0xc7ee('0x124')](db[_0xc7ee('0x72')],{'onDelete':'cascade','as':_0xc7ee('0x15e')});db['WhatsappMessage'][_0xc7ee('0x124')](db[_0xc7ee('0xfe')],{'onDelete':_0xc7ee('0x115'),'as':_0xc7ee('0x17c'),'foreignKey':_0xc7ee('0x1f7')});db[_0xc7ee('0x100')][_0xc7ee('0x124')](db[_0xc7ee('0xfc')],{'as':_0xc7ee('0x169'),'foreignKey':_0xc7ee('0x1f5')});db['WhatsappQueueReport'][_0xc7ee('0x124')](db[_0xc7ee('0xfc')],{});db[_0xc7ee('0x102')][_0xc7ee('0x124')](db['CmList'],{'as':_0xc7ee('0x171'),'foreignKey':_0xc7ee('0x165')});db[_0xc7ee('0x102')][_0xc7ee('0x124')](db[_0xc7ee('0x72')],{'as':'Contact','foreignKey':_0xc7ee('0x15f')});db[_0xc7ee('0x102')][_0xc7ee('0x124')](db['WhatsappInteraction'],{});db[_0xc7ee('0x102')][_0xc7ee('0x124')](db['WhatsappQueue'],{});db[_0xc7ee('0x102')][_0xc7ee('0x124')](db[_0xc7ee('0x100')],{});db[_0xc7ee('0x102')][_0xc7ee('0x124')](db[_0xc7ee('0xf')],{});db[_0xc7ee('0x103')][_0xc7ee('0x124')](db[_0xc7ee('0x100')],{});db[_0xc7ee('0x103')][_0xc7ee('0x124')](db['WhatsappInteraction'],{});db[_0xc7ee('0x103')][_0xc7ee('0x124')](db['WhatsappAccount'],{'foreignKey':_0xc7ee('0x1f8'),'as':_0xc7ee('0x1db')});db['WhatsappTransferReport'][_0xc7ee('0x124')](db[_0xc7ee('0xfc')],{'foreignKey':_0xc7ee('0x1f9'),'as':_0xc7ee('0x1e2')});db[_0xc7ee('0x103')]['belongsTo'](db[_0xc7ee('0x105')],{'foreignKey':_0xc7ee('0x1fa'),'as':_0xc7ee('0x1e0')});db[_0xc7ee('0x103')][_0xc7ee('0x124')](db[_0xc7ee('0xf')],{'foreignKey':_0xc7ee('0x1dc'),'as':_0xc7ee('0x1e6')});db[_0xc7ee('0x103')]['belongsTo'](db[_0xc7ee('0xf')],{'foreignKey':_0xc7ee('0x1dd'),'as':_0xc7ee('0x1de')});db['WhatsappQueue'][_0xc7ee('0x125')](db['User'],{'as':_0xc7ee('0x155'),'through':_0xc7ee('0x13a'),'foreignKey':_0xc7ee('0x1fb')});db[_0xc7ee('0x105')][_0xc7ee('0x125')](db[_0xc7ee('0xdf')],{'through':_0xc7ee('0x1d5'),'as':_0xc7ee('0x167')});db[_0xc7ee('0x10f')]['belongsTo'](db[_0xc7ee('0xf')],{'as':_0xc7ee('0x1fc'),'foreignKey':'UserId','onDelete':_0xc7ee('0x115'),'hooks':!![]});db[_0xc7ee('0x107')][_0xc7ee('0x111')](db[_0xc7ee('0xc3')],{'as':'Dynamics365Account','onDelete':'restrict'});db[_0xc7ee('0x107')][_0xc7ee('0x111')](db[_0xc7ee('0x37')],{'as':_0xc7ee('0x1fd'),'onDelete':_0xc7ee('0x162')});db[_0xc7ee('0x107')][_0xc7ee('0x111')](db[_0xc7ee('0x39')],{'as':_0xc7ee('0x1fe'),'onDelete':_0xc7ee('0x162')});module[_0xc7ee('0x1ff')]={'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(_0x5d0609,_0x127562){var _0xaa3fd1=function(_0x47f457){while(--_0x47f457){_0x5d0609['push'](_0x5d0609['shift']());}};_0xaa3fd1(++_0x127562);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'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 4ea57db..07c2207 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc99a=['./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','./api/chatQueueReport','/api/chat/internal/messages','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/squareReport','./api/squareReportDetail','/api/jscripty/projects','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','./api/team','./api/license','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','/api/mail/reports/transfer','./api/mailTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','./api/smsTransferReport','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','/api/whatsapp/applications','./api/whatsappApplication','./api/whatsappInteraction','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','/api/user-settings','./api/user-setting','/api/auth/local','./api/authLocal','/api/auth/google','/api/auth/activedirectory','./api/authActiveDirectory','./api/jira','/api/rpc','/api/version','/api/system','/api/pm2','/api/webbar','./api/webbar','/api/logs','static','root','/apidoc','/www','/demo','join','/snippet','snippet','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','/index.html','path','express','./errors','./config/environment','./utils/client-side-logger','setupLoggers','default','then','use','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','/api/voice/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','./api/voiceCallReport','./api/voiceDialReport','./api/voiceAgentReport','/api/voice/queues/reports','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/faxAccount','/api/fax/applications','/api/fax/interactions','/api/fax/messages','./api/faxMessage','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/applications','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./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/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','./api/chatMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','./api/action','./api/automation','/api/canned_answers','/api/dispositions','./api/disposition','/api/conditions','/api/intervals','./api/pause','/api/voiceQueuesLog','./api/voiceQueuesLog','./api/schedule','/api/sounds','./api/cmContactHasItem','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','/api/analytics/metrics','./api/analyticFieldReport','/api/analytics/tree_reports','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts'];(function(_0x1df473,_0x1a6931){var _0x1bdd49=function(_0x519be6){while(--_0x519be6){_0x1df473['push'](_0x1df473['shift']());}};_0x1bdd49(++_0x1a6931);}(_0xc99a,0x7c));var _0xac99=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc99a[_0x3dd15e];return _0x231fd0;};'use strict';var path=require(_0xac99('0x0'));var express=require(_0xac99('0x1'));var errors=require(_0xac99('0x2'));var config=require(_0xac99('0x3'));var setupLoggers=require(_0xac99('0x4'))[_0xac99('0x5')];var clientSideLogs=require('./api/client-side-logs');exports[_0xac99('0x6')]=function(_0x98e7e4){return setupLoggers(_0x98e7e4)[_0xac99('0x7')](function(){_0x98e7e4[_0xac99('0x8')](_0xac99('0x9'),require(_0xac99('0xa')));_0x98e7e4[_0xac99('0x8')](_0xac99('0xb'),require(_0xac99('0xc')));_0x98e7e4[_0xac99('0x8')](_0xac99('0xd'),require(_0xac99('0xe')));_0x98e7e4['use'](_0xac99('0xf'),require(_0xac99('0x10')));_0x98e7e4['use'](_0xac99('0x11'),require(_0xac99('0x12')));_0x98e7e4[_0xac99('0x8')](_0xac99('0x13'),require('./api/voiceQueue'));_0x98e7e4[_0xac99('0x8')](_0xac99('0x14'),require('./api/voiceRecording'));_0x98e7e4['use']('/api/screen/recordings',require(_0xac99('0x15')));_0x98e7e4['use'](_0xac99('0x16'),require(_0xac99('0x17')));_0x98e7e4[_0xac99('0x8')](_0xac99('0x18'),require(_0xac99('0x19')));_0x98e7e4[_0xac99('0x8')]('/api/voice/calls/reports',require(_0xac99('0x1a')));_0x98e7e4['use']('/api/voice/dials/reports',require(_0xac99('0x1b')));_0x98e7e4[_0xac99('0x8')]('/api/voice/agents/reports',require(_0xac99('0x1c')));_0x98e7e4[_0xac99('0x8')](_0xac99('0x1d'),require('./api/voiceQueueReport'));_0x98e7e4['use'](_0xac99('0x1e'),require(_0xac99('0x1f')));_0x98e7e4[_0xac99('0x8')](_0xac99('0x20'),require(_0xac99('0x21')));_0x98e7e4[_0xac99('0x8')](_0xac99('0x22'),require('./api/voiceTransferReport'));_0x98e7e4['use'](_0xac99('0x23'),require(_0xac99('0x24')));_0x98e7e4['use'](_0xac99('0x25'),require(_0xac99('0x26')));_0x98e7e4['use']('/api/mail/queues',require(_0xac99('0x27')));_0x98e7e4[_0xac99('0x8')](_0xac99('0x28'),require(_0xac99('0x29')));_0x98e7e4[_0xac99('0x8')](_0xac99('0x2a'),require(_0xac99('0x2b')));_0x98e7e4[_0xac99('0x8')](_0xac99('0x2c'),require('./api/mailMessage'));_0x98e7e4[_0xac99('0x8')](_0xac99('0x2d'),require(_0xac99('0x2e')));_0x98e7e4[_0xac99('0x8')](_0xac99('0x2f'),require(_0xac99('0x30')));_0x98e7e4['use'](_0xac99('0x31'),require(_0xac99('0x32')));_0x98e7e4[_0xac99('0x8')](_0xac99('0x33'),require('./api/dashboardItem'));_0x98e7e4[_0xac99('0x8')]('/api/fax/accounts',require(_0xac99('0x34')));_0x98e7e4[_0xac99('0x8')](_0xac99('0x35'),require('./api/faxApplication'));_0x98e7e4['use'](_0xac99('0x36'),require('./api/faxInteraction'));_0x98e7e4['use'](_0xac99('0x37'),require(_0xac99('0x38')));_0x98e7e4['use']('/api/fax/queues',require('./api/faxQueue'));_0x98e7e4['use'](_0xac99('0x39'),require(_0xac99('0x3a')));_0x98e7e4[_0xac99('0x8')]('/api/sms/accounts',require('./api/smsAccount'));_0x98e7e4[_0xac99('0x8')](_0xac99('0x3b'),require('./api/smsApplication'));_0x98e7e4[_0xac99('0x8')](_0xac99('0x3c'),require(_0xac99('0x3d')));_0x98e7e4[_0xac99('0x8')](_0xac99('0x3e'),require(_0xac99('0x3f')));_0x98e7e4[_0xac99('0x8')](_0xac99('0x40'),require('./api/smsQueue'));_0x98e7e4[_0xac99('0x8')]('/api/openchannel/accounts',require(_0xac99('0x41')));_0x98e7e4[_0xac99('0x8')](_0xac99('0x42'),require(_0xac99('0x43')));_0x98e7e4['use'](_0xac99('0x44'),require('./api/openchannelInteraction'));_0x98e7e4[_0xac99('0x8')](_0xac99('0x45'),require(_0xac99('0x46')));_0x98e7e4['use'](_0xac99('0x47'),require(_0xac99('0x48')));_0x98e7e4[_0xac99('0x8')]('/api/chat/websites',require('./api/chatWebsite'));_0x98e7e4[_0xac99('0x8')]('/api/openchannel/reports/queue',require(_0xac99('0x49')));_0x98e7e4[_0xac99('0x8')](_0xac99('0x4a'),require(_0xac99('0x4b')));_0x98e7e4[_0xac99('0x8')](_0xac99('0x4c'),require(_0xac99('0x4d')));_0x98e7e4[_0xac99('0x8')]('/api/chat/messages',require(_0xac99('0x4e')));_0x98e7e4[_0xac99('0x8')]('/api/chat/offline_messages',require('./api/chatOfflineMessage'));_0x98e7e4[_0xac99('0x8')](_0xac99('0x4f'),require(_0xac99('0x50')));_0x98e7e4[_0xac99('0x8')](_0xac99('0x51'),require(_0xac99('0x52')));_0x98e7e4[_0xac99('0x8')](_0xac99('0x53'),require(_0xac99('0x54')));_0x98e7e4[_0xac99('0x8')](_0xac99('0x55'),require(_0xac99('0x56')));_0x98e7e4[_0xac99('0x8')](_0xac99('0x57'),require(_0xac99('0x58')));_0x98e7e4[_0xac99('0x8')](_0xac99('0x59'),require(_0xac99('0x5a')));_0x98e7e4['use'](_0xac99('0x5b'),require(_0xac99('0x5c')));_0x98e7e4['use']('/api/cm/hopper_final',require('./api/cmHopperFinal'));_0x98e7e4[_0xac99('0x8')](_0xac99('0x5d'),require(_0xac99('0x5e')));_0x98e7e4[_0xac99('0x8')](_0xac99('0x5f'),require(_0xac99('0x60')));_0x98e7e4['use']('/api/actions',require(_0xac99('0x61')));_0x98e7e4[_0xac99('0x8')]('/api/automations',require(_0xac99('0x62')));_0x98e7e4[_0xac99('0x8')](_0xac99('0x63'),require('./api/cannedAnswer'));_0x98e7e4[_0xac99('0x8')](_0xac99('0x64'),require(_0xac99('0x65')));_0x98e7e4[_0xac99('0x8')](_0xac99('0x66'),require('./api/condition'));_0x98e7e4[_0xac99('0x8')](_0xac99('0x67'),require('./api/interval'));_0x98e7e4['use']('/api/pauses',require(_0xac99('0x68')));_0x98e7e4['use']('/api/cdr',require('./api/cdr'));_0x98e7e4[_0xac99('0x8')](_0xac99('0x69'),require(_0xac99('0x6a')));_0x98e7e4[_0xac99('0x8')]('/api/schedules',require(_0xac99('0x6b')));_0x98e7e4['use'](_0xac99('0x6c'),require('./api/sound'));_0x98e7e4[_0xac99('0x8')]('/api/tags',require('./api/tag'));_0x98e7e4[_0xac99('0x8')]('/api/contact_item_types',require('./api/contactItemType'));_0x98e7e4[_0xac99('0x8')]('/api/cm_contact_has_items',require(_0xac99('0x6d')));_0x98e7e4[_0xac99('0x8')](_0xac99('0x6e'),require(_0xac99('0x6f')));_0x98e7e4['use']('/api/templates',require(_0xac99('0x70')));_0x98e7e4[_0xac99('0x8')](_0xac99('0x71'),require(_0xac99('0x72')));_0x98e7e4[_0xac99('0x8')](_0xac99('0x73'),require(_0xac99('0x74')));_0x98e7e4[_0xac99('0x8')](_0xac99('0x75'),require('./api/integration'));_0x98e7e4[_0xac99('0x8')]('/api/integrations/reports',require(_0xac99('0x76')));_0x98e7e4[_0xac99('0x8')](_0xac99('0x77'),require(_0xac99('0x78')));_0x98e7e4[_0xac99('0x8')](_0xac99('0x79'),require(_0xac99('0x7a')));_0x98e7e4[_0xac99('0x8')](_0xac99('0x7b'),require('./api/analyticExtractedReport'));_0x98e7e4[_0xac99('0x8')](_0xac99('0x7c'),require('./api/analyticMetric'));_0x98e7e4[_0xac99('0x8')]('/api/analytics/field_reports',require(_0xac99('0x7d')));_0x98e7e4[_0xac99('0x8')](_0xac99('0x7e'),require('./api/analyticTreeReport'));_0x98e7e4[_0xac99('0x8')]('/api/integrations/salesforce/accounts',require('./api/intSalesforceAccount'));_0x98e7e4[_0xac99('0x8')](_0xac99('0x7f'),require(_0xac99('0x80')));_0x98e7e4[_0xac99('0x8')](_0xac99('0x81'),require(_0xac99('0x82')));_0x98e7e4[_0xac99('0x8')]('/api/integrations/sugarcrm/accounts',require(_0xac99('0x83')));_0x98e7e4[_0xac99('0x8')](_0xac99('0x84'),require(_0xac99('0x85')));_0x98e7e4[_0xac99('0x8')](_0xac99('0x86'),require('./api/intSugarcrmField'));_0x98e7e4[_0xac99('0x8')]('/api/integrations/desk/accounts',require(_0xac99('0x87')));_0x98e7e4['use'](_0xac99('0x88'),require(_0xac99('0x89')));_0x98e7e4[_0xac99('0x8')](_0xac99('0x8a'),require(_0xac99('0x8b')));_0x98e7e4[_0xac99('0x8')](_0xac99('0x8c'),require(_0xac99('0x8d')));_0x98e7e4[_0xac99('0x8')](_0xac99('0x8e'),require(_0xac99('0x8f')));_0x98e7e4['use'](_0xac99('0x90'),require(_0xac99('0x91')));_0x98e7e4['use'](_0xac99('0x92'),require(_0xac99('0x93')));_0x98e7e4['use'](_0xac99('0x94'),require(_0xac99('0x95')));_0x98e7e4[_0xac99('0x8')](_0xac99('0x96'),require(_0xac99('0x97')));_0x98e7e4[_0xac99('0x8')](_0xac99('0x98'),require('./api/intFreshdeskAccount'));_0x98e7e4['use'](_0xac99('0x99'),require(_0xac99('0x9a')));_0x98e7e4[_0xac99('0x8')](_0xac99('0x9b'),require(_0xac99('0x9c')));_0x98e7e4[_0xac99('0x8')](_0xac99('0x9d'),require('./api/intVtigerAccount'));_0x98e7e4[_0xac99('0x8')](_0xac99('0x9e'),require(_0xac99('0x9f')));_0x98e7e4[_0xac99('0x8')]('/api/integrations/vtiger/fields',require(_0xac99('0xa0')));_0x98e7e4[_0xac99('0x8')](_0xac99('0xa1'),require(_0xac99('0xa2')));_0x98e7e4['use'](_0xac99('0xa3'),require('./api/intServicenowConfiguration'));_0x98e7e4[_0xac99('0x8')](_0xac99('0xa4'),require(_0xac99('0xa5')));_0x98e7e4[_0xac99('0x8')](_0xac99('0xa6'),require(_0xac99('0xa7')));_0x98e7e4[_0xac99('0x8')](_0xac99('0xa8'),require(_0xac99('0xa9')));_0x98e7e4[_0xac99('0x8')](_0xac99('0xaa'),require(_0xac99('0xab')));_0x98e7e4[_0xac99('0x8')](_0xac99('0xac'),require(_0xac99('0xad')));_0x98e7e4[_0xac99('0x8')](_0xac99('0xae'),require(_0xac99('0xaf')));_0x98e7e4['use'](_0xac99('0xb0'),require(_0xac99('0xb1')));_0x98e7e4['use']('/api/networks',require('./api/network'));_0x98e7e4[_0xac99('0x8')]('/api/chat/reports/queue',require(_0xac99('0xb2')));_0x98e7e4[_0xac99('0x8')](_0xac99('0xb3'),require('./api/chatInternalMessage'));_0x98e7e4[_0xac99('0x8')](_0xac99('0xb4'),require(_0xac99('0xb5')));_0x98e7e4[_0xac99('0x8')](_0xac99('0xb6'),require('./api/jscriptyQuestionReport'));_0x98e7e4[_0xac99('0x8')](_0xac99('0xb7'),require(_0xac99('0xb8')));_0x98e7e4['use'](_0xac99('0xb9'),require('./api/smsQueueReport'));_0x98e7e4[_0xac99('0x8')]('/api/square/reports',require(_0xac99('0xba')));_0x98e7e4[_0xac99('0x8')]('/api/square/details/reports',require(_0xac99('0xbb')));_0x98e7e4[_0xac99('0x8')](_0xac99('0xbc'),require('./api/jscriptyProject'));_0x98e7e4[_0xac99('0x8')](_0xac99('0xbd'),require(_0xac99('0xbe')));_0x98e7e4[_0xac99('0x8')](_0xac99('0xbf'),require(_0xac99('0xc0')));_0x98e7e4['use'](_0xac99('0xc1'),require(_0xac99('0xc2')));_0x98e7e4['use'](_0xac99('0xc3'),require(_0xac99('0xc4')));_0x98e7e4['use'](_0xac99('0xc5'),require(_0xac99('0xc6')));_0x98e7e4[_0xac99('0x8')]('/api/teams',require(_0xac99('0xc7')));_0x98e7e4['use']('/api/license',require(_0xac99('0xc8')));_0x98e7e4['use']('/api/campaigns',require('./api/campaign'));_0x98e7e4[_0xac99('0x8')](_0xac99('0xc9'),require(_0xac99('0xca')));_0x98e7e4[_0xac99('0x8')](_0xac99('0xcb'),require(_0xac99('0xcc')));_0x98e7e4[_0xac99('0x8')](_0xac99('0xcd'),require('./api/plugin'));_0x98e7e4['use'](_0xac99('0xce'),require(_0xac99('0xcf')));_0x98e7e4[_0xac99('0x8')]('/api/chat/reports/transfer',require('./api/chatTransferReport'));_0x98e7e4[_0xac99('0x8')](_0xac99('0xd0'),require(_0xac99('0xd1')));_0x98e7e4[_0xac99('0x8')]('/api/openchannel/reports/transfer',require('./api/openchannelTransferReport'));_0x98e7e4[_0xac99('0x8')]('/api/sms/reports/transfer',require(_0xac99('0xd2')));_0x98e7e4[_0xac99('0x8')]('/api/cm/lists',require(_0xac99('0xd3')));_0x98e7e4[_0xac99('0x8')](_0xac99('0xd4'),require(_0xac99('0xd5')));_0x98e7e4[_0xac99('0x8')](_0xac99('0xd6'),require('./api/userProfile'));_0x98e7e4[_0xac99('0x8')](_0xac99('0xd7'),require(_0xac99('0xd8')));_0x98e7e4[_0xac99('0x8')](_0xac99('0xd9'),require(_0xac99('0xda')));_0x98e7e4['use'](_0xac99('0xdb'),require(_0xac99('0xdc')));_0x98e7e4[_0xac99('0x8')](_0xac99('0xdd'),require('./api/whatsappAccount'));_0x98e7e4[_0xac99('0x8')](_0xac99('0xde'),require(_0xac99('0xdf')));_0x98e7e4[_0xac99('0x8')]('/api/whatsapp/interactions',require(_0xac99('0xe0')));_0x98e7e4[_0xac99('0x8')]('/api/whatsapp/messages',require('./api/whatsappMessage'));_0x98e7e4['use'](_0xac99('0xe1'),require(_0xac99('0xe2')));_0x98e7e4['use'](_0xac99('0xe3'),require(_0xac99('0xe4')));_0x98e7e4[_0xac99('0x8')](_0xac99('0xe5'),require(_0xac99('0xe6')));_0x98e7e4['use'](_0xac99('0xe7'),require(_0xac99('0xe8')));_0x98e7e4[_0xac99('0x8')](_0xac99('0xe9'),require(_0xac99('0xea')));_0x98e7e4['use'](_0xac99('0xeb'),require(_0xac99('0xec')));_0x98e7e4[_0xac99('0x8')](_0xac99('0xed'),require(_0xac99('0xee')));_0x98e7e4[_0xac99('0x8')](_0xac99('0xef'),require('./api/authGoogle'));_0x98e7e4['use'](_0xac99('0xf0'),require(_0xac99('0xf1')));_0x98e7e4[_0xac99('0x8')]('/api/jira',require(_0xac99('0xf2')));_0x98e7e4[_0xac99('0x8')](_0xac99('0xf3'),require('./api/rpc'));_0x98e7e4[_0xac99('0x8')](_0xac99('0xf4'),require('./api/version'));_0x98e7e4['use'](_0xac99('0xf5'),require('./api/system'));_0x98e7e4[_0xac99('0x8')](_0xac99('0xf6'),require('./api/pm2'));_0x98e7e4[_0xac99('0x8')](_0xac99('0xf7'),require(_0xac99('0xf8')));_0x98e7e4[_0xac99('0x8')](_0xac99('0xf9'),clientSideLogs);_0x98e7e4[_0xac99('0x8')]('/apidoc',express[_0xac99('0xfa')](path['join'](config[_0xac99('0xfb')],_0xac99('0xfc'))));_0x98e7e4[_0xac99('0x8')](_0xac99('0xfd'),express[_0xac99('0xfa')](path['join'](config[_0xac99('0xfb')],_0xac99('0xfd'))));_0x98e7e4['use'](_0xac99('0xfe'),express[_0xac99('0xfa')](path[_0xac99('0xff')](config[_0xac99('0xfb')],'/demo')));_0x98e7e4['use'](_0xac99('0x100'),express[_0xac99('0xfa')](path[_0xac99('0xff')](config[_0xac99('0xfb')],_0xac99('0x101'),'3.5.0')));_0x98e7e4[_0xac99('0x8')]('/plugins',express[_0xac99('0xfa')](path['join'](config[_0xac99('0xfb')],_0xac99('0x102'))));_0x98e7e4[_0xac99('0x103')](_0xac99('0x104'))[_0xac99('0x105')](errors[0x194]);_0x98e7e4[_0xac99('0x103')]('/*')[_0xac99('0x105')](function(_0x178fd8,_0x3fa408){_0x3fa408[_0xac99('0x106')](path[_0xac99('0x107')](_0x98e7e4[_0xac99('0x105')]('appPath')+_0xac99('0x108')));});return _0x98e7e4;});}; \ No newline at end of file +var _0xd811=['/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','/api/openchannel/accounts','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','./api/cmCustomField','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','/api/schedules','./api/sound','/api/tags','./api/contactItemType','./api/cmContactHasItem','/api/cm_hopper_additional_phones','/api/templates','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','./api/integrationReport','./api/analyticCustomReport','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','/api/integrations/desk/fields','./api/intDeskField','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','./api/intZohoField','./api/intZendeskAccount','./api/intZendeskConfiguration','./api/intZendeskField','/api/integrations/freshdesk/accounts','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','./api/intServicenowAccount','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','/api/integrations/dynamics365/fields','./api/intDynamics365Field','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','./api/jscriptyProject','/api/settings','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/plugin','/api/mail/reports/transfer','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/cmList','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','./api/whatsappQueue','/api/cloudProviders','/api/user-settings','./api/user-setting','/api/auth/local','/api/auth/google','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','/api/webbar','./api/webbar','/api/logs','/apidoc','static','join','root','/www','/demo','/snippet','3.6.0','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','/index.html','path','express','./errors','./config/environment','./utils/client-side-logger','setupLoggers','default','then','/api/users','./api/user','/api/voice/chanspy','use','/api/voice/contexts','./api/voiceContext','/api/voice/mohs','./api/voiceMusicOnHold','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','./api/voiceTransferReport','./api/mailServerOut','/api/mail/accounts','/api/mail/queues','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','/api/dashboards','./api/dashboard','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','/api/fax/reports/queue','./api/smsAccount'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd811,0x1ea));var _0x1d81=function(_0x2d982d,_0x121028){_0x2d982d=_0x2d982d-0x0;var _0x4f36b0=_0xd811[_0x2d982d];return _0x4f36b0;};'use strict';var path=require(_0x1d81('0x0'));var express=require(_0x1d81('0x1'));var errors=require(_0x1d81('0x2'));var config=require(_0x1d81('0x3'));var setupLoggers=require(_0x1d81('0x4'))[_0x1d81('0x5')];var clientSideLogs=require('./api/client-side-logs');exports[_0x1d81('0x6')]=function(_0x15910e){return setupLoggers(_0x15910e)[_0x1d81('0x7')](function(){_0x15910e['use'](_0x1d81('0x8'),require(_0x1d81('0x9')));_0x15910e['use'](_0x1d81('0xa'),require('./api/voiceChanSpy'));_0x15910e[_0x1d81('0xb')](_0x1d81('0xc'),require(_0x1d81('0xd')));_0x15910e[_0x1d81('0xb')]('/api/voice/extensions',require('./api/voiceExtension'));_0x15910e[_0x1d81('0xb')](_0x1d81('0xe'),require(_0x1d81('0xf')));_0x15910e[_0x1d81('0xb')]('/api/voice/queues',require(_0x1d81('0x10')));_0x15910e[_0x1d81('0xb')](_0x1d81('0x11'),require(_0x1d81('0x12')));_0x15910e[_0x1d81('0xb')](_0x1d81('0x13'),require('./api/screenRecording'));_0x15910e[_0x1d81('0xb')](_0x1d81('0x14'),require(_0x1d81('0x15')));_0x15910e[_0x1d81('0xb')](_0x1d81('0x16'),require(_0x1d81('0x17')));_0x15910e['use'](_0x1d81('0x18'),require(_0x1d81('0x19')));_0x15910e[_0x1d81('0xb')]('/api/voice/dials/reports',require(_0x1d81('0x1a')));_0x15910e[_0x1d81('0xb')](_0x1d81('0x1b'),require(_0x1d81('0x1c')));_0x15910e[_0x1d81('0xb')]('/api/voice/queues/reports',require('./api/voiceQueueReport'));_0x15910e['use'](_0x1d81('0x1d'),require(_0x1d81('0x1e')));_0x15910e[_0x1d81('0xb')](_0x1d81('0x1f'),require(_0x1d81('0x20')));_0x15910e['use']('/api/voice/transfers/reports',require(_0x1d81('0x21')));_0x15910e[_0x1d81('0xb')]('/api/mail/out_servers',require(_0x1d81('0x22')));_0x15910e[_0x1d81('0xb')](_0x1d81('0x23'),require('./api/mailAccount'));_0x15910e['use'](_0x1d81('0x24'),require('./api/mailQueue'));_0x15910e['use']('/api/mail/substatuses',require('./api/mailSubstatus'));_0x15910e[_0x1d81('0xb')](_0x1d81('0x25'),require(_0x1d81('0x26')));_0x15910e[_0x1d81('0xb')](_0x1d81('0x27'),require(_0x1d81('0x28')));_0x15910e[_0x1d81('0xb')](_0x1d81('0x29'),require('./api/mailApplication'));_0x15910e['use']('/api/mail/reports/queue',require('./api/mailQueueReport'));_0x15910e[_0x1d81('0xb')](_0x1d81('0x2a'),require(_0x1d81('0x2b')));_0x15910e[_0x1d81('0xb')]('/api/dashboards/items',require(_0x1d81('0x2c')));_0x15910e[_0x1d81('0xb')](_0x1d81('0x2d'),require(_0x1d81('0x2e')));_0x15910e[_0x1d81('0xb')](_0x1d81('0x2f'),require(_0x1d81('0x30')));_0x15910e[_0x1d81('0xb')](_0x1d81('0x31'),require(_0x1d81('0x32')));_0x15910e[_0x1d81('0xb')](_0x1d81('0x33'),require(_0x1d81('0x34')));_0x15910e[_0x1d81('0xb')](_0x1d81('0x35'),require('./api/faxQueue'));_0x15910e[_0x1d81('0xb')](_0x1d81('0x36'),require('./api/faxQueueReport'));_0x15910e['use']('/api/sms/accounts',require(_0x1d81('0x37')));_0x15910e[_0x1d81('0xb')](_0x1d81('0x38'),require(_0x1d81('0x39')));_0x15910e['use'](_0x1d81('0x3a'),require(_0x1d81('0x3b')));_0x15910e[_0x1d81('0xb')](_0x1d81('0x3c'),require(_0x1d81('0x3d')));_0x15910e[_0x1d81('0xb')](_0x1d81('0x3e'),require('./api/smsQueue'));_0x15910e[_0x1d81('0xb')](_0x1d81('0x3f'),require('./api/openchannelAccount'));_0x15910e[_0x1d81('0xb')](_0x1d81('0x40'),require(_0x1d81('0x41')));_0x15910e[_0x1d81('0xb')](_0x1d81('0x42'),require(_0x1d81('0x43')));_0x15910e[_0x1d81('0xb')](_0x1d81('0x44'),require('./api/openchannelMessage'));_0x15910e['use'](_0x1d81('0x45'),require(_0x1d81('0x46')));_0x15910e['use'](_0x1d81('0x47'),require(_0x1d81('0x48')));_0x15910e['use'](_0x1d81('0x49'),require(_0x1d81('0x4a')));_0x15910e[_0x1d81('0xb')]('/api/chat/applications',require('./api/chatApplication'));_0x15910e['use'](_0x1d81('0x4b'),require(_0x1d81('0x4c')));_0x15910e['use'](_0x1d81('0x4d'),require(_0x1d81('0x4e')));_0x15910e[_0x1d81('0xb')](_0x1d81('0x4f'),require(_0x1d81('0x50')));_0x15910e[_0x1d81('0xb')](_0x1d81('0x51'),require(_0x1d81('0x52')));_0x15910e['use']('/api/chat/groups',require('./api/chatGroup'));_0x15910e[_0x1d81('0xb')](_0x1d81('0x53'),require(_0x1d81('0x54')));_0x15910e['use'](_0x1d81('0x55'),require(_0x1d81('0x56')));_0x15910e[_0x1d81('0xb')](_0x1d81('0x57'),require('./api/cmContact'));_0x15910e['use'](_0x1d81('0x58'),require(_0x1d81('0x59')));_0x15910e[_0x1d81('0xb')](_0x1d81('0x5a'),require(_0x1d81('0x5b')));_0x15910e[_0x1d81('0xb')]('/api/cm/hopper_final',require(_0x1d81('0x5c')));_0x15910e[_0x1d81('0xb')](_0x1d81('0x5d'),require(_0x1d81('0x5e')));_0x15910e['use']('/api/cm/custom_fields',require(_0x1d81('0x5f')));_0x15910e['use']('/api/actions',require('./api/action'));_0x15910e[_0x1d81('0xb')](_0x1d81('0x60'),require(_0x1d81('0x61')));_0x15910e['use'](_0x1d81('0x62'),require(_0x1d81('0x63')));_0x15910e[_0x1d81('0xb')](_0x1d81('0x64'),require(_0x1d81('0x65')));_0x15910e[_0x1d81('0xb')](_0x1d81('0x66'),require(_0x1d81('0x67')));_0x15910e['use']('/api/intervals',require('./api/interval'));_0x15910e[_0x1d81('0xb')](_0x1d81('0x68'),require(_0x1d81('0x69')));_0x15910e[_0x1d81('0xb')](_0x1d81('0x6a'),require(_0x1d81('0x6b')));_0x15910e[_0x1d81('0xb')](_0x1d81('0x6c'),require('./api/voiceQueuesLog'));_0x15910e[_0x1d81('0xb')](_0x1d81('0x6d'),require('./api/schedule'));_0x15910e[_0x1d81('0xb')]('/api/sounds',require(_0x1d81('0x6e')));_0x15910e[_0x1d81('0xb')](_0x1d81('0x6f'),require('./api/tag'));_0x15910e['use']('/api/contact_item_types',require(_0x1d81('0x70')));_0x15910e['use']('/api/cm_contact_has_items',require(_0x1d81('0x71')));_0x15910e[_0x1d81('0xb')](_0x1d81('0x72'),require('./api/cmHopperAdditionalPhone'));_0x15910e['use'](_0x1d81('0x73'),require('./api/template'));_0x15910e[_0x1d81('0xb')]('/api/triggers',require(_0x1d81('0x74')));_0x15910e['use'](_0x1d81('0x75'),require(_0x1d81('0x76')));_0x15910e['use'](_0x1d81('0x77'),require(_0x1d81('0x78')));_0x15910e[_0x1d81('0xb')]('/api/integrations/reports',require(_0x1d81('0x79')));_0x15910e[_0x1d81('0xb')]('/api/analytics/custom_reports',require(_0x1d81('0x7a')));_0x15910e[_0x1d81('0xb')]('/api/analytics/default_reports',require('./api/analyticDefaultReport'));_0x15910e[_0x1d81('0xb')]('/api/analytics/extracted_reports',require(_0x1d81('0x7b')));_0x15910e[_0x1d81('0xb')](_0x1d81('0x7c'),require(_0x1d81('0x7d')));_0x15910e[_0x1d81('0xb')](_0x1d81('0x7e'),require(_0x1d81('0x7f')));_0x15910e['use']('/api/analytics/tree_reports',require(_0x1d81('0x80')));_0x15910e[_0x1d81('0xb')](_0x1d81('0x81'),require(_0x1d81('0x82')));_0x15910e[_0x1d81('0xb')]('/api/integrations/salesforce/configurations',require(_0x1d81('0x83')));_0x15910e['use'](_0x1d81('0x84'),require(_0x1d81('0x85')));_0x15910e[_0x1d81('0xb')](_0x1d81('0x86'),require('./api/intSugarcrmAccount'));_0x15910e[_0x1d81('0xb')](_0x1d81('0x87'),require(_0x1d81('0x88')));_0x15910e[_0x1d81('0xb')]('/api/integrations/sugarcrm/fields',require(_0x1d81('0x89')));_0x15910e[_0x1d81('0xb')](_0x1d81('0x8a'),require(_0x1d81('0x8b')));_0x15910e['use'](_0x1d81('0x8c'),require('./api/intDeskConfiguration'));_0x15910e[_0x1d81('0xb')](_0x1d81('0x8d'),require(_0x1d81('0x8e')));_0x15910e['use']('/api/integrations/zoho/accounts',require(_0x1d81('0x8f')));_0x15910e[_0x1d81('0xb')](_0x1d81('0x90'),require(_0x1d81('0x91')));_0x15910e['use']('/api/integrations/zoho/fields',require(_0x1d81('0x92')));_0x15910e[_0x1d81('0xb')]('/api/integrations/zendesk/accounts',require(_0x1d81('0x93')));_0x15910e[_0x1d81('0xb')]('/api/integrations/zendesk/configurations',require(_0x1d81('0x94')));_0x15910e[_0x1d81('0xb')]('/api/integrations/zendesk/fields',require(_0x1d81('0x95')));_0x15910e[_0x1d81('0xb')](_0x1d81('0x96'),require('./api/intFreshdeskAccount'));_0x15910e[_0x1d81('0xb')](_0x1d81('0x97'),require(_0x1d81('0x98')));_0x15910e[_0x1d81('0xb')](_0x1d81('0x99'),require(_0x1d81('0x9a')));_0x15910e[_0x1d81('0xb')]('/api/integrations/vtiger/accounts',require(_0x1d81('0x9b')));_0x15910e['use'](_0x1d81('0x9c'),require(_0x1d81('0x9d')));_0x15910e['use'](_0x1d81('0x9e'),require(_0x1d81('0x9f')));_0x15910e['use']('/api/integrations/servicenow/accounts',require(_0x1d81('0xa0')));_0x15910e[_0x1d81('0xb')]('/api/integrations/servicenow/configurations',require(_0x1d81('0xa1')));_0x15910e[_0x1d81('0xb')](_0x1d81('0xa2'),require(_0x1d81('0xa3')));_0x15910e['use'](_0x1d81('0xa4'),require(_0x1d81('0xa5')));_0x15910e['use'](_0x1d81('0xa6'),require('./api/intDynamics365Configuration'));_0x15910e[_0x1d81('0xb')](_0x1d81('0xa7'),require(_0x1d81('0xa8')));_0x15910e[_0x1d81('0xb')]('/api/integrations/freshsales/accounts',require(_0x1d81('0xa9')));_0x15910e[_0x1d81('0xb')](_0x1d81('0xaa'),require(_0x1d81('0xab')));_0x15910e[_0x1d81('0xb')](_0x1d81('0xac'),require(_0x1d81('0xad')));_0x15910e[_0x1d81('0xb')](_0x1d81('0xae'),require(_0x1d81('0xaf')));_0x15910e[_0x1d81('0xb')]('/api/chat/reports/queue',require(_0x1d81('0xb0')));_0x15910e[_0x1d81('0xb')](_0x1d81('0xb1'),require(_0x1d81('0xb2')));_0x15910e[_0x1d81('0xb')](_0x1d81('0xb3'),require(_0x1d81('0xb4')));_0x15910e[_0x1d81('0xb')](_0x1d81('0xb5'),require(_0x1d81('0xb6')));_0x15910e[_0x1d81('0xb')](_0x1d81('0xb7'),require(_0x1d81('0xb8')));_0x15910e['use'](_0x1d81('0xb9'),require(_0x1d81('0xba')));_0x15910e[_0x1d81('0xb')](_0x1d81('0xbb'),require(_0x1d81('0xbc')));_0x15910e[_0x1d81('0xb')](_0x1d81('0xbd'),require(_0x1d81('0xbe')));_0x15910e['use']('/api/jscripty/projects',require(_0x1d81('0xbf')));_0x15910e[_0x1d81('0xb')](_0x1d81('0xc0'),require('./api/setting'));_0x15910e[_0x1d81('0xb')](_0x1d81('0xc1'),require(_0x1d81('0xc2')));_0x15910e[_0x1d81('0xb')](_0x1d81('0xc3'),require(_0x1d81('0xc4')));_0x15910e[_0x1d81('0xb')]('/api/square/recordings',require(_0x1d81('0xc5')));_0x15910e['use'](_0x1d81('0xc6'),require(_0x1d81('0xc7')));_0x15910e[_0x1d81('0xb')](_0x1d81('0xc8'),require(_0x1d81('0xc9')));_0x15910e[_0x1d81('0xb')](_0x1d81('0xca'),require(_0x1d81('0xcb')));_0x15910e[_0x1d81('0xb')](_0x1d81('0xcc'),require(_0x1d81('0xcd')));_0x15910e[_0x1d81('0xb')](_0x1d81('0xce'),require(_0x1d81('0xcf')));_0x15910e[_0x1d81('0xb')](_0x1d81('0xd0'),require('./api/attachment'));_0x15910e[_0x1d81('0xb')]('/api/plugins',require(_0x1d81('0xd1')));_0x15910e[_0x1d81('0xb')](_0x1d81('0xd2'),require('./api/mailTransferReport'));_0x15910e[_0x1d81('0xb')](_0x1d81('0xd3'),require(_0x1d81('0xd4')));_0x15910e[_0x1d81('0xb')](_0x1d81('0xd5'),require(_0x1d81('0xd6')));_0x15910e['use'](_0x1d81('0xd7'),require(_0x1d81('0xd8')));_0x15910e[_0x1d81('0xb')](_0x1d81('0xd9'),require('./api/smsTransferReport'));_0x15910e[_0x1d81('0xb')]('/api/cm/lists',require(_0x1d81('0xda')));_0x15910e['use']('/api/voice/prefixes',require(_0x1d81('0xdb')));_0x15910e[_0x1d81('0xb')](_0x1d81('0xdc'),require(_0x1d81('0xdd')));_0x15910e['use'](_0x1d81('0xde'),require(_0x1d81('0xdf')));_0x15910e['use'](_0x1d81('0xe0'),require(_0x1d81('0xe1')));_0x15910e[_0x1d81('0xb')](_0x1d81('0xe2'),require(_0x1d81('0xe3')));_0x15910e['use'](_0x1d81('0xe4'),require(_0x1d81('0xe5')));_0x15910e[_0x1d81('0xb')](_0x1d81('0xe6'),require('./api/whatsappApplication'));_0x15910e[_0x1d81('0xb')](_0x1d81('0xe7'),require(_0x1d81('0xe8')));_0x15910e[_0x1d81('0xb')](_0x1d81('0xe9'),require(_0x1d81('0xea')));_0x15910e[_0x1d81('0xb')](_0x1d81('0xeb'),require(_0x1d81('0xec')));_0x15910e[_0x1d81('0xb')]('/api/whatsapp/reports/transfer',require('./api/whatsappTransferReport'));_0x15910e[_0x1d81('0xb')]('/api/whatsapp/queues',require(_0x1d81('0xed')));_0x15910e['use'](_0x1d81('0xee'),require('./api/cloudProvider'));_0x15910e[_0x1d81('0xb')]('/api/realtime',require('./api/realtime'));_0x15910e['use'](_0x1d81('0xef'),require(_0x1d81('0xf0')));_0x15910e['use'](_0x1d81('0xf1'),require('./api/authLocal'));_0x15910e['use'](_0x1d81('0xf2'),require('./api/authGoogle'));_0x15910e[_0x1d81('0xb')](_0x1d81('0xf3'),require(_0x1d81('0xf4')));_0x15910e[_0x1d81('0xb')](_0x1d81('0xf5'),require(_0x1d81('0xf6')));_0x15910e[_0x1d81('0xb')](_0x1d81('0xf7'),require('./api/rpc'));_0x15910e[_0x1d81('0xb')](_0x1d81('0xf8'),require(_0x1d81('0xf9')));_0x15910e['use'](_0x1d81('0xfa'),require(_0x1d81('0xfb')));_0x15910e['use'](_0x1d81('0xfc'),require('./api/pm2'));_0x15910e[_0x1d81('0xb')](_0x1d81('0xfd'),require(_0x1d81('0xfe')));_0x15910e[_0x1d81('0xb')](_0x1d81('0xff'),clientSideLogs);_0x15910e[_0x1d81('0xb')](_0x1d81('0x100'),express[_0x1d81('0x101')](path[_0x1d81('0x102')](config[_0x1d81('0x103')],_0x1d81('0x100'))));_0x15910e[_0x1d81('0xb')](_0x1d81('0x104'),express[_0x1d81('0x101')](path['join'](config[_0x1d81('0x103')],'/www')));_0x15910e[_0x1d81('0xb')](_0x1d81('0x105'),express['static'](path[_0x1d81('0x102')](config[_0x1d81('0x103')],_0x1d81('0x105'))));_0x15910e[_0x1d81('0xb')](_0x1d81('0x106'),express['static'](path['join'](config['root'],'snippet',_0x1d81('0x107'))));_0x15910e[_0x1d81('0xb')](_0x1d81('0x108'),express['static'](path[_0x1d81('0x102')](config[_0x1d81('0x103')],_0x1d81('0x109'))));_0x15910e[_0x1d81('0x10a')](_0x1d81('0x10b'))[_0x1d81('0x10c')](errors[0x194]);_0x15910e[_0x1d81('0x10a')]('/*')['get'](function(_0x5205c5,_0x3acc20){_0x3acc20[_0x1d81('0x10d')](path[_0x1d81('0x10e')](_0x15910e['get'](_0x1d81('0x10f'))+_0x1d81('0x110')));});return _0x15910e;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index abc2212..b719111 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2f15=['../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/intVtigerAccount/intVtigerAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','lodash','listen','../api/user/user.rpc','merge','../api/voiceQueue/voiceQueue.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/mailInteraction/mailInteraction.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxQueue/faxQueue.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc'];(function(_0x17355e,_0x52c7cc){var _0x459f03=function(_0x4c08c0){while(--_0x4c08c0){_0x17355e['push'](_0x17355e['shift']());}};_0x459f03(++_0x52c7cc);}(_0x2f15,0x6f));var _0x52f1=function(_0x1dc130,_0x1f8090){_0x1dc130=_0x1dc130-0x0;var _0x48e316=_0x2f15[_0x1dc130];return _0x48e316;};'use strict';var jayson=require('jayson/promise');var _=require(_0x52f1('0x0'));var config=require('../config/environment');exports[_0x52f1('0x1')]=function(){return new Promise(function(_0x3548a8,_0xdc883e){var _0x1fe2d3={};_0x1fe2d3=_['merge'](_0x1fe2d3,require(_0x52f1('0x2')));_0x1fe2d3=_[_0x52f1('0x3')](_0x1fe2d3,require('../api/voiceExtension/voiceExtension.rpc'));_0x1fe2d3=_[_0x52f1('0x3')](_0x1fe2d3,require(_0x52f1('0x4')));_0x1fe2d3=_[_0x52f1('0x3')](_0x1fe2d3,require('../api/voiceRecording/voiceRecording.rpc'));_0x1fe2d3=_['merge'](_0x1fe2d3,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x1fe2d3=_[_0x52f1('0x3')](_0x1fe2d3,require(_0x52f1('0x5')));_0x1fe2d3=_['merge'](_0x1fe2d3,require(_0x52f1('0x6')));_0x1fe2d3=_[_0x52f1('0x3')](_0x1fe2d3,require(_0x52f1('0x7')));_0x1fe2d3=_[_0x52f1('0x3')](_0x1fe2d3,require(_0x52f1('0x8')));_0x1fe2d3=_[_0x52f1('0x3')](_0x1fe2d3,require('../api/trunk/trunk.rpc'));_0x1fe2d3=_['merge'](_0x1fe2d3,require(_0x52f1('0x9')));_0x1fe2d3=_[_0x52f1('0x3')](_0x1fe2d3,require(_0x52f1('0xa')));_0x1fe2d3=_[_0x52f1('0x3')](_0x1fe2d3,require(_0x52f1('0xb')));_0x1fe2d3=_[_0x52f1('0x3')](_0x1fe2d3,require(_0x52f1('0xc')));_0x1fe2d3=_[_0x52f1('0x3')](_0x1fe2d3,require(_0x52f1('0xd')));_0x1fe2d3=_[_0x52f1('0x3')](_0x1fe2d3,require(_0x52f1('0xe')));_0x1fe2d3=_['merge'](_0x1fe2d3,require('../api/mailMessage/mailMessage.rpc'));_0x1fe2d3=_[_0x52f1('0x3')](_0x1fe2d3,require(_0x52f1('0xf')));_0x1fe2d3=_[_0x52f1('0x3')](_0x1fe2d3,require(_0x52f1('0x10')));_0x1fe2d3=_[_0x52f1('0x3')](_0x1fe2d3,require(_0x52f1('0x11')));_0x1fe2d3=_[_0x52f1('0x3')](_0x1fe2d3,require(_0x52f1('0x12')));_0x1fe2d3=_[_0x52f1('0x3')](_0x1fe2d3,require(_0x52f1('0x13')));_0x1fe2d3=_[_0x52f1('0x3')](_0x1fe2d3,require('../api/faxMessage/faxMessage.rpc'));_0x1fe2d3=_[_0x52f1('0x3')](_0x1fe2d3,require(_0x52f1('0x14')));_0x1fe2d3=_[_0x52f1('0x3')](_0x1fe2d3,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x1fe2d3=_[_0x52f1('0x3')](_0x1fe2d3,require(_0x52f1('0x15')));_0x1fe2d3=_[_0x52f1('0x3')](_0x1fe2d3,require(_0x52f1('0x16')));_0x1fe2d3=_[_0x52f1('0x3')](_0x1fe2d3,require(_0x52f1('0x17')));_0x1fe2d3=_[_0x52f1('0x3')](_0x1fe2d3,require('../api/smsQueue/smsQueue.rpc'));_0x1fe2d3=_[_0x52f1('0x3')](_0x1fe2d3,require(_0x52f1('0x18')));_0x1fe2d3=_['merge'](_0x1fe2d3,require(_0x52f1('0x19')));_0x1fe2d3=_[_0x52f1('0x3')](_0x1fe2d3,require(_0x52f1('0x1a')));_0x1fe2d3=_[_0x52f1('0x3')](_0x1fe2d3,require(_0x52f1('0x1b')));_0x1fe2d3=_[_0x52f1('0x3')](_0x1fe2d3,require(_0x52f1('0x1c')));_0x1fe2d3=_['merge'](_0x1fe2d3,require(_0x52f1('0x1d')));_0x1fe2d3=_[_0x52f1('0x3')](_0x1fe2d3,require(_0x52f1('0x1e')));_0x1fe2d3=_[_0x52f1('0x3')](_0x1fe2d3,require(_0x52f1('0x1f')));_0x1fe2d3=_[_0x52f1('0x3')](_0x1fe2d3,require(_0x52f1('0x20')));_0x1fe2d3=_[_0x52f1('0x3')](_0x1fe2d3,require('../api/cmHopper/cmHopper.rpc'));_0x1fe2d3=_['merge'](_0x1fe2d3,require(_0x52f1('0x21')));_0x1fe2d3=_[_0x52f1('0x3')](_0x1fe2d3,require(_0x52f1('0x22')));_0x1fe2d3=_[_0x52f1('0x3')](_0x1fe2d3,require(_0x52f1('0x23')));_0x1fe2d3=_[_0x52f1('0x3')](_0x1fe2d3,require(_0x52f1('0x24')));_0x1fe2d3=_['merge'](_0x1fe2d3,require(_0x52f1('0x25')));_0x1fe2d3=_['merge'](_0x1fe2d3,require(_0x52f1('0x26')));_0x1fe2d3=_[_0x52f1('0x3')](_0x1fe2d3,require(_0x52f1('0x27')));_0x1fe2d3=_[_0x52f1('0x3')](_0x1fe2d3,require(_0x52f1('0x28')));_0x1fe2d3=_['merge'](_0x1fe2d3,require(_0x52f1('0x29')));_0x1fe2d3=_[_0x52f1('0x3')](_0x1fe2d3,require(_0x52f1('0x2a')));_0x1fe2d3=_['merge'](_0x1fe2d3,require(_0x52f1('0x2b')));_0x1fe2d3=_[_0x52f1('0x3')](_0x1fe2d3,require(_0x52f1('0x2c')));_0x1fe2d3=_['merge'](_0x1fe2d3,require(_0x52f1('0x2d')));_0x1fe2d3=_[_0x52f1('0x3')](_0x1fe2d3,require(_0x52f1('0x2e')));_0x1fe2d3=_[_0x52f1('0x3')](_0x1fe2d3,require(_0x52f1('0x2f')));_0x1fe2d3=_[_0x52f1('0x3')](_0x1fe2d3,require(_0x52f1('0x30')));_0x1fe2d3=_['merge'](_0x1fe2d3,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x1fe2d3=_[_0x52f1('0x3')](_0x1fe2d3,require(_0x52f1('0x31')));_0x1fe2d3=_['merge'](_0x1fe2d3,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x1fe2d3=_[_0x52f1('0x3')](_0x1fe2d3,require(_0x52f1('0x32')));_0x1fe2d3=_[_0x52f1('0x3')](_0x1fe2d3,require(_0x52f1('0x33')));_0x1fe2d3=_[_0x52f1('0x3')](_0x1fe2d3,require(_0x52f1('0x34')));_0x1fe2d3=_[_0x52f1('0x3')](_0x1fe2d3,require(_0x52f1('0x35')));_0x1fe2d3=_[_0x52f1('0x3')](_0x1fe2d3,require(_0x52f1('0x36')));_0x1fe2d3=_[_0x52f1('0x3')](_0x1fe2d3,require(_0x52f1('0x37')));_0x1fe2d3=_[_0x52f1('0x3')](_0x1fe2d3,require('../api/setting/setting.rpc'));_0x1fe2d3=_[_0x52f1('0x3')](_0x1fe2d3,require(_0x52f1('0x38')));_0x1fe2d3=_[_0x52f1('0x3')](_0x1fe2d3,require(_0x52f1('0x39')));_0x1fe2d3=_[_0x52f1('0x3')](_0x1fe2d3,require(_0x52f1('0x3a')));_0x1fe2d3=_[_0x52f1('0x3')](_0x1fe2d3,require(_0x52f1('0x3b')));_0x1fe2d3=_[_0x52f1('0x3')](_0x1fe2d3,require('../api/campaign/campaign.rpc'));_0x1fe2d3=_[_0x52f1('0x3')](_0x1fe2d3,require(_0x52f1('0x3c')));_0x1fe2d3=_['merge'](_0x1fe2d3,require(_0x52f1('0x3d')));_0x1fe2d3=_[_0x52f1('0x3')](_0x1fe2d3,require(_0x52f1('0x3e')));_0x1fe2d3=_['merge'](_0x1fe2d3,require(_0x52f1('0x3f')));_0x1fe2d3=_['merge'](_0x1fe2d3,require(_0x52f1('0x40')));_0x1fe2d3=_['merge'](_0x1fe2d3,require(_0x52f1('0x41')));_0x1fe2d3=_[_0x52f1('0x3')](_0x1fe2d3,require(_0x52f1('0x42')));var _0x2bcc2d=jayson[_0x52f1('0x43')](_0x1fe2d3)[_0x52f1('0x44')]();var _0x2b42ad=config[_0x52f1('0x45')][_0x52f1('0x46')]||config['port']+0x1;var _0x147bb7=config[_0x52f1('0x45')]['ip']||'localhost';_0x2bcc2d['on']('error',function(_0x228a49){return _0xdc883e(_0x228a49);});_0x2bcc2d[_0x52f1('0x1')](_0x2b42ad,_0x147bb7,function(){console[_0x52f1('0x47')](_0x52f1('0x48'),_0x147bb7,_0x2b42ad);require(_0x52f1('0x49'))[_0x52f1('0x4a')]();return _0x3548a8(_0x52f1('0x4b')+_0x147bb7+':'+_0x2b42ad);});});}; \ No newline at end of file +var _0xef18=['../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','rpc','error','../config/triggers','default','RPC\x20listening\x20on\x20','lodash','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc'];(function(_0x5c6eb1,_0x4c2147){var _0xe8a9ab=function(_0x599804){while(--_0x599804){_0x5c6eb1['push'](_0x5c6eb1['shift']());}};_0xe8a9ab(++_0x4c2147);}(_0xef18,0xfb));var _0x8ef1=function(_0x36ed3c,_0x44a00a){_0x36ed3c=_0x36ed3c-0x0;var _0x52a2e0=_0xef18[_0x36ed3c];return _0x52a2e0;};'use strict';var jayson=require('jayson/promise');var _=require(_0x8ef1('0x0'));var config=require(_0x8ef1('0x1'));exports[_0x8ef1('0x2')]=function(){return new Promise(function(_0x134b9c,_0x1423c7){var _0x40bf1f={};_0x40bf1f=_[_0x8ef1('0x3')](_0x40bf1f,require(_0x8ef1('0x4')));_0x40bf1f=_[_0x8ef1('0x3')](_0x40bf1f,require('../api/voiceExtension/voiceExtension.rpc'));_0x40bf1f=_[_0x8ef1('0x3')](_0x40bf1f,require(_0x8ef1('0x5')));_0x40bf1f=_[_0x8ef1('0x3')](_0x40bf1f,require(_0x8ef1('0x6')));_0x40bf1f=_[_0x8ef1('0x3')](_0x40bf1f,require(_0x8ef1('0x7')));_0x40bf1f=_[_0x8ef1('0x3')](_0x40bf1f,require(_0x8ef1('0x8')));_0x40bf1f=_[_0x8ef1('0x3')](_0x40bf1f,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x40bf1f=_[_0x8ef1('0x3')](_0x40bf1f,require(_0x8ef1('0x9')));_0x40bf1f=_[_0x8ef1('0x3')](_0x40bf1f,require(_0x8ef1('0xa')));_0x40bf1f=_[_0x8ef1('0x3')](_0x40bf1f,require(_0x8ef1('0xb')));_0x40bf1f=_['merge'](_0x40bf1f,require(_0x8ef1('0xc')));_0x40bf1f=_[_0x8ef1('0x3')](_0x40bf1f,require(_0x8ef1('0xd')));_0x40bf1f=_[_0x8ef1('0x3')](_0x40bf1f,require(_0x8ef1('0xe')));_0x40bf1f=_[_0x8ef1('0x3')](_0x40bf1f,require(_0x8ef1('0xf')));_0x40bf1f=_['merge'](_0x40bf1f,require('../api/mailQueue/mailQueue.rpc'));_0x40bf1f=_['merge'](_0x40bf1f,require(_0x8ef1('0x10')));_0x40bf1f=_[_0x8ef1('0x3')](_0x40bf1f,require(_0x8ef1('0x11')));_0x40bf1f=_[_0x8ef1('0x3')](_0x40bf1f,require(_0x8ef1('0x12')));_0x40bf1f=_[_0x8ef1('0x3')](_0x40bf1f,require(_0x8ef1('0x13')));_0x40bf1f=_[_0x8ef1('0x3')](_0x40bf1f,require(_0x8ef1('0x14')));_0x40bf1f=_[_0x8ef1('0x3')](_0x40bf1f,require(_0x8ef1('0x15')));_0x40bf1f=_[_0x8ef1('0x3')](_0x40bf1f,require(_0x8ef1('0x16')));_0x40bf1f=_[_0x8ef1('0x3')](_0x40bf1f,require('../api/faxMessage/faxMessage.rpc'));_0x40bf1f=_['merge'](_0x40bf1f,require('../api/faxQueue/faxQueue.rpc'));_0x40bf1f=_[_0x8ef1('0x3')](_0x40bf1f,require(_0x8ef1('0x17')));_0x40bf1f=_[_0x8ef1('0x3')](_0x40bf1f,require(_0x8ef1('0x18')));_0x40bf1f=_[_0x8ef1('0x3')](_0x40bf1f,require('../api/smsInteraction/smsInteraction.rpc'));_0x40bf1f=_[_0x8ef1('0x3')](_0x40bf1f,require(_0x8ef1('0x19')));_0x40bf1f=_[_0x8ef1('0x3')](_0x40bf1f,require(_0x8ef1('0x1a')));_0x40bf1f=_['merge'](_0x40bf1f,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x40bf1f=_[_0x8ef1('0x3')](_0x40bf1f,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x40bf1f=_[_0x8ef1('0x3')](_0x40bf1f,require(_0x8ef1('0x1b')));_0x40bf1f=_[_0x8ef1('0x3')](_0x40bf1f,require(_0x8ef1('0x1c')));_0x40bf1f=_[_0x8ef1('0x3')](_0x40bf1f,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x40bf1f=_[_0x8ef1('0x3')](_0x40bf1f,require(_0x8ef1('0x1d')));_0x40bf1f=_[_0x8ef1('0x3')](_0x40bf1f,require(_0x8ef1('0x1e')));_0x40bf1f=_[_0x8ef1('0x3')](_0x40bf1f,require(_0x8ef1('0x1f')));_0x40bf1f=_[_0x8ef1('0x3')](_0x40bf1f,require('../api/cmContact/cmContact.rpc'));_0x40bf1f=_['merge'](_0x40bf1f,require('../api/cmHopper/cmHopper.rpc'));_0x40bf1f=_['merge'](_0x40bf1f,require(_0x8ef1('0x20')));_0x40bf1f=_[_0x8ef1('0x3')](_0x40bf1f,require(_0x8ef1('0x21')));_0x40bf1f=_[_0x8ef1('0x3')](_0x40bf1f,require(_0x8ef1('0x22')));_0x40bf1f=_['merge'](_0x40bf1f,require(_0x8ef1('0x23')));_0x40bf1f=_[_0x8ef1('0x3')](_0x40bf1f,require(_0x8ef1('0x24')));_0x40bf1f=_[_0x8ef1('0x3')](_0x40bf1f,require(_0x8ef1('0x25')));_0x40bf1f=_['merge'](_0x40bf1f,require('../api/sound/sound.rpc'));_0x40bf1f=_[_0x8ef1('0x3')](_0x40bf1f,require(_0x8ef1('0x26')));_0x40bf1f=_['merge'](_0x40bf1f,require(_0x8ef1('0x27')));_0x40bf1f=_['merge'](_0x40bf1f,require(_0x8ef1('0x28')));_0x40bf1f=_[_0x8ef1('0x3')](_0x40bf1f,require(_0x8ef1('0x29')));_0x40bf1f=_['merge'](_0x40bf1f,require(_0x8ef1('0x2a')));_0x40bf1f=_[_0x8ef1('0x3')](_0x40bf1f,require(_0x8ef1('0x2b')));_0x40bf1f=_[_0x8ef1('0x3')](_0x40bf1f,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x40bf1f=_[_0x8ef1('0x3')](_0x40bf1f,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x40bf1f=_['merge'](_0x40bf1f,require(_0x8ef1('0x2c')));_0x40bf1f=_[_0x8ef1('0x3')](_0x40bf1f,require(_0x8ef1('0x2d')));_0x40bf1f=_[_0x8ef1('0x3')](_0x40bf1f,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x40bf1f=_[_0x8ef1('0x3')](_0x40bf1f,require(_0x8ef1('0x2e')));_0x40bf1f=_[_0x8ef1('0x3')](_0x40bf1f,require(_0x8ef1('0x2f')));_0x40bf1f=_[_0x8ef1('0x3')](_0x40bf1f,require(_0x8ef1('0x30')));_0x40bf1f=_[_0x8ef1('0x3')](_0x40bf1f,require(_0x8ef1('0x31')));_0x40bf1f=_['merge'](_0x40bf1f,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x40bf1f=_[_0x8ef1('0x3')](_0x40bf1f,require('../api/squareReport/squareReport.rpc'));_0x40bf1f=_[_0x8ef1('0x3')](_0x40bf1f,require(_0x8ef1('0x32')));_0x40bf1f=_[_0x8ef1('0x3')](_0x40bf1f,require(_0x8ef1('0x33')));_0x40bf1f=_[_0x8ef1('0x3')](_0x40bf1f,require(_0x8ef1('0x34')));_0x40bf1f=_['merge'](_0x40bf1f,require(_0x8ef1('0x35')));_0x40bf1f=_['merge'](_0x40bf1f,require(_0x8ef1('0x36')));_0x40bf1f=_[_0x8ef1('0x3')](_0x40bf1f,require('../api/squareMessage/squareMessage.rpc'));_0x40bf1f=_[_0x8ef1('0x3')](_0x40bf1f,require(_0x8ef1('0x37')));_0x40bf1f=_[_0x8ef1('0x3')](_0x40bf1f,require(_0x8ef1('0x38')));_0x40bf1f=_['merge'](_0x40bf1f,require(_0x8ef1('0x39')));_0x40bf1f=_[_0x8ef1('0x3')](_0x40bf1f,require(_0x8ef1('0x3a')));_0x40bf1f=_[_0x8ef1('0x3')](_0x40bf1f,require(_0x8ef1('0x3b')));_0x40bf1f=_['merge'](_0x40bf1f,require(_0x8ef1('0x3c')));_0x40bf1f=_[_0x8ef1('0x3')](_0x40bf1f,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x40bf1f=_['merge'](_0x40bf1f,require(_0x8ef1('0x3d')));var _0x161587=jayson[_0x8ef1('0x3e')](_0x40bf1f)['http']();var _0x57d0ec=config[_0x8ef1('0x3f')]['port']||config['port']+0x1;var _0x4017b8=config[_0x8ef1('0x3f')]['ip']||'localhost';_0x161587['on'](_0x8ef1('0x40'),function(_0xdaa650){return _0x1423c7(_0xdaa650);});_0x161587[_0x8ef1('0x2')](_0x57d0ec,_0x4017b8,function(){console['log']('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x4017b8,_0x57d0ec);require(_0x8ef1('0x41'))[_0x8ef1('0x42')]();return _0x134b9c(_0x8ef1('0x43')+_0x4017b8+':'+_0x57d0ec);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 847b347..1f70803 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 _0x689f=['toLowerCase','hangup','emit','520-Invalid','search','520\x20End\x20of\x20proper','function','substring','no\x20code','replace','result=','indexOf','substr','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','destroy','pipe','command','write','sendRequest','sync','prototype','answer','ANSWER','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','VERBOSE\x20\x22%s\x22','join','EXEC\x20%s\x20%s','setContext','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','isNumber','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','GOTO\x20%s\x20%s\x20%s','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','wait','exec','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','EventEmitter','./reply','call','setEncoding','utf8','ready','line'];(function(_0x1c00f0,_0x37f2ae){var _0x1b3bbd=function(_0xf13ecc){while(--_0xf13ecc){_0x1c00f0['push'](_0x1c00f0['shift']());}};_0x1b3bbd(++_0x37f2ae);}(_0x689f,0x81));var _0xf689=function(_0x3ab437,_0x5723c1){_0x3ab437=_0x3ab437-0x0;var _0x46dd20=_0x689f[_0x3ab437];return _0x46dd20;};'use strict';var util=require('util');var _=require('lodash');var EventEmitter=require('events')[_0xf689('0x0')];var AGIReply=require(_0xf689('0x1'));var AGIError=require('./error');function AGIChannel(_0x5140d8){var _0x32627=this,_0x490e43=new AGIReply(),_0x1dc884=![],_0x581fe9={};EventEmitter[_0xf689('0x2')](_0x32627);_0x5140d8[_0xf689('0x3')](_0xf689('0x4'));_0x5140d8['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x490e43[_0xf689('0x3')](_0xf689('0x4'));_0x490e43['on']('headers',function(_0x98edba){for(var _0x87fc09 in _0x98edba){_0x32627[_0x87fc09]=_0x98edba[_0x87fc09];}_0x32627['emit'](_0xf689('0x5'));});_0x490e43['on'](_0xf689('0x6'),function(_0x27e780){if(_0x27e780[_0xf689('0x7')]()==_0xf689('0x8')){_0x32627[_0xf689('0x9')](_0xf689('0x8'));return;}if(_0x27e780['substring'](0x0,0xb)==_0xf689('0xa')){_0x1dc884=!![];}if(_0x1dc884){_0x581fe9['rx']+=_0x27e780+'\x0a';if(_0x27e780[_0xf689('0xb')](_0xf689('0xc'))!=-0x1){_0x1dc884=![];}}else{_0x581fe9['rx']=_0x27e780;}if(_0x1dc884){return;}if(typeof _0x581fe9['cb']==_0xf689('0xd')){var _0x2c7e72=_0x581fe9['rx'][_0xf689('0xe')](0x0,0x3),_0x462bf7=null,_0x1f1a54=null;_0x2c7e72=parseInt(_0x2c7e72);if(isNaN(_0x2c7e72)){_0x581fe9['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xf689('0xf')});return;}if(_0x2c7e72!=0xc8){_0x581fe9['cb'](null,{'code':_0x2c7e72,'result':-0x1,'extra':'KO'});return;}_0x462bf7=_0x581fe9['rx']['substring'](0x4)[_0xf689('0x10')](_0xf689('0x11'),'');if(_0x462bf7[_0xf689('0x12')]('\x20')!=-0x1){_0x462bf7=_0x462bf7[_0xf689('0x13')](0x0,_0x462bf7['indexOf']('\x20'));}if(_[_0xf689('0x14')](_0x462bf7,'-1')){_0x462bf7=parseInt(_0x462bf7);}_0x1f1a54=_0x581fe9['rx'][_0xf689('0x15')]('\x20');if(_0x1f1a54[_0xf689('0x16')]==0x3){_0x1f1a54=_0x1f1a54[0x2][_0xf689('0xe')](0x1,_0x1f1a54[0x2]['length']-0x1);}else if(_0x1f1a54[_0xf689('0x16')]>0x3){var _0x56327e=/\((.+)\)/;var _0x331bca=_0x581fe9['rx'][_0xf689('0x17')](_0x56327e);if(_0x331bca){_0x1f1a54=_0x331bca[0x1];}else{_0x1f1a54=null;}}else{_0x1f1a54=null;}_0x581fe9['cb'](null,{'code':_0x2c7e72,'result':_0x462bf7,'extra':_0x1f1a54});}});_0x5140d8['on']('error',function(_0x4f730d){_0x32627[_0xf689('0x9')](_0xf689('0x18'),new AGIError(_0xf689('0x19'),_0x4f730d[_0xf689('0x1a')]));});_0x5140d8['on']('close',function(){_0x32627[_0xf689('0x9')](_0xf689('0x1b'),new AGIError(_0xf689('0x1c')));});_0x5140d8['on'](_0xf689('0x1d'),function(){_0x32627[_0xf689('0x9')](_0xf689('0x1d'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x5140d8[_0xf689('0x1e')]();});_0x5140d8[_0xf689('0x1f')](_0x490e43);this[_0xf689('0x20')]=function(_0x41d937,_0x3f2f1f){var _0x41d937=_0x41d937||'',_0x3f2f1f=typeof _0x3f2f1f=='function'?_0x3f2f1f:new Function();_0x581fe9={'tx':_0x41d937,'rx':'','cb':_0x3f2f1f};_0x5140d8[_0xf689('0x21')](_0x41d937+'\x0a');},this['close']=function(){_0x5140d8['destroy']();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel['prototype'][_0xf689('0x22')]=function(_0x364636){return this['command'][_0xf689('0x23')](this,_0x364636);};AGIChannel[_0xf689('0x24')][_0xf689('0x25')]=function(){return this['sendRequest'](_0xf689('0x26'));};AGIChannel[_0xf689('0x24')][_0xf689('0x27')]=function(_0x413ea8,_0xe9865,_0x350ed6){_0x413ea8=_0x413ea8===undefined?_0xf689('0x28'):_0x413ea8;_0xe9865=_0xe9865===undefined?'5':_0xe9865;_0x350ed6=_0x350ed6===undefined?'1':_0x350ed6;return this[_0xf689('0x22')](util[_0xf689('0x29')](_0xf689('0x2a'),_0x413ea8,_0xe9865*0x3e8,_0x350ed6));};AGIChannel['prototype'][_0xf689('0x2b')]=function(_0x4d68d8){_0x4d68d8=_0x4d68d8||'NO\x20MESSAGE';return this['sendRequest'](util[_0xf689('0x29')](_0xf689('0x2c'),_0x4d68d8));};AGIChannel[_0xf689('0x24')]['exec']=function(_0x3971ce,_0x539a86){if(_['isArray'](_0x539a86)){return this['sendRequest'](util[_0xf689('0x29')]('EXEC\x20%s\x20%s',_0x3971ce,_0x539a86[_0xf689('0x2d')](',')));}return this[_0xf689('0x22')](util[_0xf689('0x29')](_0xf689('0x2e'),_0x3971ce,_0x539a86));};AGIChannel[_0xf689('0x24')][_0xf689('0x2f')]=function(_0x26511b){return this[_0xf689('0x22')](util['format']('SET\x20CONTEXT\x20%s',_0x26511b));};AGIChannel[_0xf689('0x24')]['setExtension']=function(_0x57bc98){return this[_0xf689('0x22')](util['format'](_0xf689('0x30'),_0x57bc98));};AGIChannel['prototype'][_0xf689('0x31')]=function(_0x5a1889){return this['sendRequest'](util[_0xf689('0x29')](_0xf689('0x32'),_0x5a1889));};AGIChannel[_0xf689('0x24')][_0xf689('0x8')]=function(){return this['sendRequest'](_0xf689('0x33'));};AGIChannel[_0xf689('0x24')]['setVariable']=function(_0x35cec0,_0x448750){var _0x150763=_['isBoolean'](_0x448750)||_[_0xf689('0x34')](_0x448750)?_0x448750[_0xf689('0x35')]():_0x448750;return this[_0xf689('0x22')](util[_0xf689('0x29')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x35cec0,_0x150763?_0x150763['toString']()[_0xf689('0x10')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0xf689('0x36')]=function(_0x2182d1,_0x12eb64){return this[_0xf689('0x22')](util[_0xf689('0x29')](_0xf689('0x37'),_0x2182d1,_0x12eb64));};AGIChannel['prototype']['sayDigits']=function(_0x4bbdae,_0x50014f){return this['sendRequest'](util[_0xf689('0x29')](_0xf689('0x38'),_0x4bbdae,_0x50014f));};AGIChannel['prototype'][_0xf689('0x39')]=function(_0x2b8eb4,_0x2ec3e5){return this[_0xf689('0x22')](util[_0xf689('0x29')](_0xf689('0x3a'),_0x2b8eb4,_0x2ec3e5));};AGIChannel[_0xf689('0x24')][_0xf689('0x3b')]=function(_0x2e29a6,_0x4b0325,_0x263500){_0x4b0325=_0x4b0325||this[_0xf689('0x3c')];_0x263500=_0x263500||0x1;this[_0xf689('0x2f')](_0x2e29a6);this['setExtension'](_0x4b0325);this[_0xf689('0x31')](_0x263500);return this['noop'](util['format'](_0xf689('0x3d'),_0x2e29a6,_0x4b0325,_0x263500));};AGIChannel[_0xf689('0x24')]['getVariable']=function(_0xfe048c){return this[_0xf689('0x22')](util[_0xf689('0x29')]('GET\x20VARIABLE\x20\x22%s\x22',_0xfe048c));};AGIChannel['prototype']['recordFile']=function(_0x42655d,_0x231ca1,_0x5882ed,_0x41e8ac,_0x48afa2,_0x57487f){_0x231ca1=_0x231ca1||'wav';_0x5882ed=_0x5882ed||'';_0x41e8ac=_0x41e8ac===undefined?-0x1:_0x41e8ac==='-1'?-0x1:_0x41e8ac*0x3e8;_0x48afa2=_0x48afa2===undefined?'':'s='+_0x48afa2;_0x57487f=_0x57487f?'BEEP':'';return this['sendRequest'](util[_0xf689('0x29')](_0xf689('0x3e'),_0x42655d,_0x231ca1,_0x5882ed,_0x41e8ac,_0x57487f,_0x48afa2));};AGIChannel[_0xf689('0x24')][_0xf689('0x3f')]=function(_0x5ec03f,_0x3ef786){_0x3ef786=_0x3ef786||'';return this[_0xf689('0x22')](util[_0xf689('0x29')](_0xf689('0x40'),_0x5ec03f,_0x3ef786));};AGIChannel[_0xf689('0x24')]['agi']=function(_0x449118){return this['exec']('AGI',_0x449118);};AGIChannel[_0xf689('0x24')][_0xf689('0x41')]=function(_0x35da20){return this[_0xf689('0x42')]('WAIT',_0x35da20);};AGIChannel[_0xf689('0x24')][_0xf689('0x18')]=function(_0x111658,_0x39f512){this['noop'](util[_0xf689('0x29')](_0xf689('0x43'),_0x111658['id'],_0x111658['label'],_0x39f512));return{'code':0x1f4,'result':'-1','extra':''};};module['exports']=AGIChannel; \ No newline at end of file +var _0x89d6=['code','close','emit','E_AGI_SOCKET_CLOSE','E_AGI_SOCKET_TIMEOUT','pipe','command','write','destroy','inherits','sendRequest','prototype','answer','ANSWER','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','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','HANGUP','setVariable','isBoolean','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','sayPhonetic','continueAt','extension','GOTO\x20%s\x20%s\x20%s','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','events','EventEmitter','./error','call','setEncoding','utf8','setTimeout','headers','ready','line','toLowerCase','hangup','substring','520-Invalid','search','function','no\x20code','replace','indexOf','substr','split','length','match','error','E_AGI_SOCKET_ERROR'];(function(_0x5e5b0d,_0x32ae1d){var _0x3b218e=function(_0x258382){while(--_0x258382){_0x5e5b0d['push'](_0x5e5b0d['shift']());}};_0x3b218e(++_0x32ae1d);}(_0x89d6,0x119));var _0x689d=function(_0x4d624d,_0x22c84b){_0x4d624d=_0x4d624d-0x0;var _0x3ee86f=_0x89d6[_0x4d624d];return _0x3ee86f;};'use strict';var util=require(_0x689d('0x0'));var _=require(_0x689d('0x1'));var EventEmitter=require(_0x689d('0x2'))[_0x689d('0x3')];var AGIReply=require('./reply');var AGIError=require(_0x689d('0x4'));function AGIChannel(_0x33b6ca){var _0x36ca6d=this,_0x48dd20=new AGIReply(),_0x2d9ee9=![],_0x3da648={};EventEmitter[_0x689d('0x5')](_0x36ca6d);_0x33b6ca[_0x689d('0x6')](_0x689d('0x7'));_0x33b6ca[_0x689d('0x8')](0x8*0x3c*0x3c*0x3e8);_0x48dd20['setEncoding'](_0x689d('0x7'));_0x48dd20['on'](_0x689d('0x9'),function(_0xaa8c77){for(var _0x5258ce in _0xaa8c77){_0x36ca6d[_0x5258ce]=_0xaa8c77[_0x5258ce];}_0x36ca6d['emit'](_0x689d('0xa'));});_0x48dd20['on'](_0x689d('0xb'),function(_0x46e636){if(_0x46e636[_0x689d('0xc')]()=='hangup'){_0x36ca6d['emit'](_0x689d('0xd'));return;}if(_0x46e636[_0x689d('0xe')](0x0,0xb)==_0x689d('0xf')){_0x2d9ee9=!![];}if(_0x2d9ee9){_0x3da648['rx']+=_0x46e636+'\x0a';if(_0x46e636[_0x689d('0x10')]('520\x20End\x20of\x20proper')!=-0x1){_0x2d9ee9=![];}}else{_0x3da648['rx']=_0x46e636;}if(_0x2d9ee9){return;}if(typeof _0x3da648['cb']==_0x689d('0x11')){var _0x1e5c7a=_0x3da648['rx'][_0x689d('0xe')](0x0,0x3),_0x4a3284=null,_0x2f0f8=null;_0x1e5c7a=parseInt(_0x1e5c7a);if(isNaN(_0x1e5c7a)){_0x3da648['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x689d('0x12')});return;}if(_0x1e5c7a!=0xc8){_0x3da648['cb'](null,{'code':_0x1e5c7a,'result':-0x1,'extra':'KO'});return;}_0x4a3284=_0x3da648['rx'][_0x689d('0xe')](0x4)[_0x689d('0x13')]('result=','');if(_0x4a3284[_0x689d('0x14')]('\x20')!=-0x1){_0x4a3284=_0x4a3284[_0x689d('0x15')](0x0,_0x4a3284['indexOf']('\x20'));}if(_['startsWith'](_0x4a3284,'-1')){_0x4a3284=parseInt(_0x4a3284);}_0x2f0f8=_0x3da648['rx'][_0x689d('0x16')]('\x20');if(_0x2f0f8[_0x689d('0x17')]==0x3){_0x2f0f8=_0x2f0f8[0x2][_0x689d('0xe')](0x1,_0x2f0f8[0x2][_0x689d('0x17')]-0x1);}else if(_0x2f0f8[_0x689d('0x17')]>0x3){var _0x561301=/\((.+)\)/;var _0x1b0e8d=_0x3da648['rx'][_0x689d('0x18')](_0x561301);if(_0x1b0e8d){_0x2f0f8=_0x1b0e8d[0x1];}else{_0x2f0f8=null;}}else{_0x2f0f8=null;}_0x3da648['cb'](null,{'code':_0x1e5c7a,'result':_0x4a3284,'extra':_0x2f0f8});}});_0x33b6ca['on']('error',function(_0x3110df){_0x36ca6d['emit'](_0x689d('0x19'),new AGIError(_0x689d('0x1a'),_0x3110df[_0x689d('0x1b')]));});_0x33b6ca['on'](_0x689d('0x1c'),function(){_0x36ca6d[_0x689d('0x1d')](_0x689d('0x1c'),new AGIError(_0x689d('0x1e')));});_0x33b6ca['on']('timeout',function(){_0x36ca6d[_0x689d('0x1d')]('timeout',new AGIError(_0x689d('0x1f')));_0x33b6ca['destroy']();});_0x33b6ca[_0x689d('0x20')](_0x48dd20);this[_0x689d('0x21')]=function(_0x4469e4,_0x55ebc6){var _0x4469e4=_0x4469e4||'',_0x55ebc6=typeof _0x55ebc6==_0x689d('0x11')?_0x55ebc6:new Function();_0x3da648={'tx':_0x4469e4,'rx':'','cb':_0x55ebc6};_0x33b6ca[_0x689d('0x22')](_0x4469e4+'\x0a');},this[_0x689d('0x1c')]=function(){_0x33b6ca[_0x689d('0x23')]();};}util[_0x689d('0x24')](AGIChannel,EventEmitter);AGIChannel['prototype'][_0x689d('0x25')]=function(_0x22a3cf){return this[_0x689d('0x21')]['sync'](this,_0x22a3cf);};AGIChannel[_0x689d('0x26')][_0x689d('0x27')]=function(){return this[_0x689d('0x25')](_0x689d('0x28'));};AGIChannel[_0x689d('0x26')]['getData']=function(_0x477190,_0x4fc325,_0x22f0fc){_0x477190=_0x477190===undefined?_0x689d('0x29'):_0x477190;_0x4fc325=_0x4fc325===undefined?'5':_0x4fc325;_0x22f0fc=_0x22f0fc===undefined?'1':_0x22f0fc;return this[_0x689d('0x25')](util[_0x689d('0x2a')](_0x689d('0x2b'),_0x477190,_0x4fc325*0x3e8,_0x22f0fc));};AGIChannel['prototype'][_0x689d('0x2c')]=function(_0x539279){_0x539279=_0x539279||'NO\x20MESSAGE';return this['sendRequest'](util[_0x689d('0x2a')](_0x689d('0x2d'),_0x539279));};AGIChannel[_0x689d('0x26')][_0x689d('0x2e')]=function(_0x5057df,_0x5963cf){if(_['isArray'](_0x5963cf)){return this[_0x689d('0x25')](util[_0x689d('0x2a')](_0x689d('0x2f'),_0x5057df,_0x5963cf[_0x689d('0x30')](',')));}return this[_0x689d('0x25')](util[_0x689d('0x2a')](_0x689d('0x2f'),_0x5057df,_0x5963cf));};AGIChannel['prototype'][_0x689d('0x31')]=function(_0x368fef){return this['sendRequest'](util[_0x689d('0x2a')](_0x689d('0x32'),_0x368fef));};AGIChannel['prototype'][_0x689d('0x33')]=function(_0x10f861){return this[_0x689d('0x25')](util[_0x689d('0x2a')](_0x689d('0x34'),_0x10f861));};AGIChannel[_0x689d('0x26')][_0x689d('0x35')]=function(_0x455183){return this[_0x689d('0x25')](util[_0x689d('0x2a')](_0x689d('0x36'),_0x455183));};AGIChannel[_0x689d('0x26')][_0x689d('0xd')]=function(){return this[_0x689d('0x25')](_0x689d('0x37'));};AGIChannel['prototype'][_0x689d('0x38')]=function(_0x9d169f,_0x26ebff){var _0x435827=_[_0x689d('0x39')](_0x26ebff)||_['isNumber'](_0x26ebff)?_0x26ebff[_0x689d('0x3a')]():_0x26ebff;return this[_0x689d('0x25')](util[_0x689d('0x2a')](_0x689d('0x3b'),_0x9d169f,_0x435827?_0x435827[_0x689d('0x3a')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0x689d('0x3c')]=function(_0x8e73f,_0x3a4059){return this['sendRequest'](util['format']('SAY\x20NUMBER\x20%s\x20%s',_0x8e73f,_0x3a4059));};AGIChannel[_0x689d('0x26')]['sayDigits']=function(_0x1b0d16,_0x39ad63){return this[_0x689d('0x25')](util[_0x689d('0x2a')]('SAY\x20DIGITS\x20%s\x20%s',_0x1b0d16,_0x39ad63));};AGIChannel[_0x689d('0x26')][_0x689d('0x3d')]=function(_0x53d54b,_0x4a3844){return this['sendRequest'](util['format']('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x53d54b,_0x4a3844));};AGIChannel[_0x689d('0x26')][_0x689d('0x3e')]=function(_0x54260e,_0x490a90,_0x31d6a3){_0x490a90=_0x490a90||this[_0x689d('0x3f')];_0x31d6a3=_0x31d6a3||0x1;this[_0x689d('0x31')](_0x54260e);this['setExtension'](_0x490a90);this['setPriority'](_0x31d6a3);return this['noop'](util[_0x689d('0x2a')](_0x689d('0x40'),_0x54260e,_0x490a90,_0x31d6a3));};AGIChannel[_0x689d('0x26')]['getVariable']=function(_0x202a79){return this[_0x689d('0x25')](util[_0x689d('0x2a')](_0x689d('0x41'),_0x202a79));};AGIChannel['prototype'][_0x689d('0x42')]=function(_0x39bf4e,_0xa03f8d,_0x30bee2,_0x2f5e21,_0x1a8680,_0x155d7d){_0xa03f8d=_0xa03f8d||_0x689d('0x43');_0x30bee2=_0x30bee2||'';_0x2f5e21=_0x2f5e21===undefined?-0x1:_0x2f5e21==='-1'?-0x1:_0x2f5e21*0x3e8;_0x1a8680=_0x1a8680===undefined?'':'s='+_0x1a8680;_0x155d7d=_0x155d7d?_0x689d('0x44'):'';return this[_0x689d('0x25')](util[_0x689d('0x2a')]('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x39bf4e,_0xa03f8d,_0x30bee2,_0x2f5e21,_0x155d7d,_0x1a8680));};AGIChannel[_0x689d('0x26')][_0x689d('0x45')]=function(_0x38379d,_0x305db){_0x305db=_0x305db||'';return this['sendRequest'](util['format'](_0x689d('0x46'),_0x38379d,_0x305db));};AGIChannel[_0x689d('0x26')][_0x689d('0x47')]=function(_0x4cd7b9){return this['exec'](_0x689d('0x48'),_0x4cd7b9);};AGIChannel[_0x689d('0x26')]['wait']=function(_0x24822c){return this[_0x689d('0x2e')](_0x689d('0x49'),_0x24822c);};AGIChannel[_0x689d('0x26')][_0x689d('0x19')]=function(_0xf85bf6,_0x24167a){this[_0x689d('0x2c')](util[_0x689d('0x2a')](_0x689d('0x4a'),_0xf85bf6['id'],_0xf85bf6[_0x689d('0x4b')],_0x24167a));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x689d('0x4c')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 5863632..90715dd 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 _0x1354=['Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','apply','message','name','exports','util','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x1354,0x12d));var _0x4135=function(_0x3c68e4,_0x20e968){_0x3c68e4=_0x3c68e4-0x0;var _0x2b35e7=_0x1354[_0x3c68e4];return _0x2b35e7;};'use strict';var util=require(_0x4135('0x0'));var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0x4135('0x1'),'E_AGI_SERVER_CLOSE':_0x4135('0x2'),'E_AGI_SERVER_MAXCONNECTION':_0x4135('0x3'),'E_AGI_SERVER_VOICE_DISABLED':_0x4135('0x4'),'E_AGI_SOCKET_ERROR':_0x4135('0x5'),'E_AGI_SOCKET_CLOSE':_0x4135('0x6'),'E_AGI_SOCKET_TIMEOUT':_0x4135('0x7'),'E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x4135('0x8'),'E_AGI_IVR_ENTRY':_0x4135('0x9')};function AGIError(_0x4686b2){var _0x4686b2=_0x4686b2||null,_0x1833de=_0x1833de||[],_0x1d7aef=0x1,_0x2960ff='';if(!error[_0x4686b2]){_0x4686b2=_0x4135('0xa');}_0x1833de[_0x4135('0xb')](error[_0x4686b2]);while(arguments[_0x1d7aef]){_0x1833de['push'](arguments[_0x1d7aef]);_0x1d7aef++;}_0x2960ff=util[_0x4135('0xc')][_0x4135('0xd')](util,_0x1833de);this[_0x4135('0xe')]=_0x2960ff;this[_0x4135('0xf')]=_0x4686b2;}module[_0x4135('0x10')]=AGIError; \ No newline at end of file +var _0xab6a=['[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','apply','message','name','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.'];(function(_0x39db05,_0x3868d0){var _0x3f0e22=function(_0x532c4f){while(--_0x532c4f){_0x39db05['push'](_0x39db05['shift']());}};_0x3f0e22(++_0x3868d0);}(_0xab6a,0xb6));var _0xaab6=function(_0x1265a7,_0x74e88){_0x1265a7=_0x1265a7-0x0;var _0x9a004a=_0xab6a[_0x1265a7];return _0x9a004a;};'use strict';var util=require(_0xaab6('0x0'));var error={'E_AGI_UNDEFINED':_0xaab6('0x1'),'E_AGI_ARGUMENT_PORT':_0xaab6('0x2'),'E_AGI_SERVER_ERROR':_0xaab6('0x3'),'E_AGI_SERVER_CLOSE':_0xaab6('0x4'),'E_AGI_SERVER_MAXCONNECTION':_0xaab6('0x5'),'E_AGI_SERVER_VOICE_DISABLED':_0xaab6('0x6'),'E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0xaab6('0x7'),'E_AGI_COMMAND_EMPTY':_0xaab6('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xaab6('0x9'),'E_AGI_IVR_ENTRY':_0xaab6('0xa')};function AGIError(_0xf65f1e){var _0xf65f1e=_0xf65f1e||null,_0x488478=_0x488478||[],_0x309c94=0x1,_0x1a1bd1='';if(!error[_0xf65f1e]){_0xf65f1e=_0xaab6('0xb');}_0x488478['push'](error[_0xf65f1e]);while(arguments[_0x309c94]){_0x488478[_0xaab6('0xc')](arguments[_0x309c94]);_0x309c94++;}_0x1a1bd1=util['format'][_0xaab6('0xd')](util,_0x488478);this[_0xaab6('0xe')]=_0x1a1bd1;this[_0xaab6('0xf')]=_0xf65f1e;}module[_0xaab6('0x10')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/events.js b/server/services/agi/events.js index b3948e0..35e0568 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 _0x65eb=['localhost','subscribe','agi','error','E_AGI_SERVER_ERROR','message','parse','emit','projectUpdate','exports','lodash','events','EventEmitter','./error','defaults','redis'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x65eb,0x12a));var _0xb65e=function(_0x93128c,_0x229a9f){_0x93128c=_0x93128c-0x0;var _0x254c69=_0x65eb[_0x93128c];return _0x254c69;};'use strict';var _=require(_0xb65e('0x0'));var EventEmitter=require(_0xb65e('0x1'))[_0xb65e('0x2')];var Redis=require('ioredis');var AGIError=require(_0xb65e('0x3'));var config=require('../../config/environment');config['redis']=_[_0xb65e('0x4')](config[_0xb65e('0x5')],{'host':_0xb65e('0x6'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0xb65e('0x5')]);sub[_0xb65e('0x7')](_0xb65e('0x8'),function(_0xb33956){if(_0xb33956)return eventEmitter['emit'](_0xb65e('0x9'),new AGIError(_0xb65e('0xa'),_0xb33956));});sub['on'](_0xb65e('0xb'),function(_0x785168,_0x1a9287){if(_0x785168!==_0xb65e('0x8'))return;try{var _0x4611fb=JSON[_0xb65e('0xc')](_0x1a9287);eventEmitter[_0xb65e('0xd')](_0xb65e('0xe'),_0x4611fb);}catch(_0x4714af){eventEmitter[_0xb65e('0xd')](_0xb65e('0x9'),new AGIError(_0xb65e('0xa'),_0x4714af));}});module[_0xb65e('0xf')]={'EventEmitter':eventEmitter}; \ No newline at end of file +var _0xc47c=['defaults','localhost','subscribe','agi','emit','error','E_AGI_SERVER_ERROR','message','projectUpdate','exports','events','EventEmitter','./error','../../config/environment','redis'];(function(_0x2d4dac,_0x1dc66c){var _0x53b86c=function(_0x577e9f){while(--_0x577e9f){_0x2d4dac['push'](_0x2d4dac['shift']());}};_0x53b86c(++_0x1dc66c);}(_0xc47c,0x82));var _0xcc47=function(_0x253fb5,_0x1fe76d){_0x253fb5=_0x253fb5-0x0;var _0x179359=_0xc47c[_0x253fb5];return _0x179359;};'use strict';var _=require('lodash');var EventEmitter=require(_0xcc47('0x0'))[_0xcc47('0x1')];var Redis=require('ioredis');var AGIError=require(_0xcc47('0x2'));var config=require(_0xcc47('0x3'));config[_0xcc47('0x4')]=_[_0xcc47('0x5')](config[_0xcc47('0x4')],{'host':_0xcc47('0x6'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0xcc47('0x4')]);sub[_0xcc47('0x7')](_0xcc47('0x8'),function(_0x344dc3){if(_0x344dc3)return eventEmitter[_0xcc47('0x9')](_0xcc47('0xa'),new AGIError(_0xcc47('0xb'),_0x344dc3));});sub['on'](_0xcc47('0xc'),function(_0x28af42,_0x4c7324){if(_0x28af42!=='agi')return;try{var _0x22eca4=JSON['parse'](_0x4c7324);eventEmitter['emit'](_0xcc47('0xd'),_0x22eca4);}catch(_0x1412b9){eventEmitter[_0xcc47('0x9')](_0xcc47('0xa'),new AGIError(_0xcc47('0xb'),_0x1412b9));}});module[_0xcc47('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 9bcfd52..45401ce 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 _0x8201=['edges','numberOfEdges','addVertex','vertices','prototype','addEdge','push','size','relations','getVertex','info','no\x20vertex\x20found','length','no\x20edge/s\x20available','condition','split','agicommand','vswitch','target','default','invalid','traverseBFS','default\x20on\x20switch\x20not\x20found','includes','condition\x20not\x20found','exports','lodash','menu','getsecretdigits'];(function(_0x189468,_0x110761){var _0x4f1d25=function(_0x3fee3d){while(--_0x3fee3d){_0x189468['push'](_0x189468['shift']());}};_0x4f1d25(++_0x110761);}(_0x8201,0x71));var _0x1820=function(_0x53a0b1,_0x3aa909){_0x53a0b1=_0x53a0b1-0x0;var _0x4125e9=_0x8201[_0x53a0b1];return _0x4125e9;};'use strict';var _=require(_0x1820('0x0'));var logger=require('../../../config/logger')('agi');var verticesWithRetry=[_0x1820('0x1'),'getdigits',_0x1820('0x2')];var Graph=function(){this['vertices']={};this[_0x1820('0x3')]={};this[_0x1820('0x4')]=0x0;};Graph['prototype'][_0x1820('0x5')]=function(_0x3f1501){this[_0x1820('0x6')][_0x3f1501['id']]=_0x3f1501;this['edges'][_0x3f1501['id']]=[];};Graph[_0x1820('0x7')][_0x1820('0x8')]=function(_0x5d33c6,_0x26cd56,_0x395dea){this[_0x1820('0x3')][_0x5d33c6][_0x1820('0x9')]({'target':_0x26cd56,'condition':_0x395dea});this[_0x1820('0x4')]+=0x1;};Graph[_0x1820('0x7')][_0x1820('0xa')]=function(){return _['size'](this['vertices']);};Graph[_0x1820('0x7')][_0x1820('0xb')]=function(){return this[_0x1820('0x4')];};Graph[_0x1820('0x7')][_0x1820('0xc')]=function(_0x2b505b){return this[_0x1820('0x6')][_0x2b505b];};Graph['prototype']['traverseBFS']=function(_0x57b825,_0x414d56){if(!this['vertices'][_0x57b825]){return logger[_0x1820('0xd')](_0x1820('0xe'));}var _0x230223=_0x414d56(this['vertices'][_0x57b825]);if(!_0x230223){return logger[_0x1820('0xd')]('stop\x20traverse');}if(this[_0x1820('0x3')][_0x57b825][_0x1820('0xf')]===0x0){return logger[_0x1820('0xd')](_0x1820('0x10'));}for(var _0x5b3332=0x0,_0x416660=[],_0x343387=![];_0x5b3332\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','hangup','find','production','initialize','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','getAll','[LICENSE]','finally','./server','port','listening','close','lodash','syncho','util','../../config/environment','../../config/license/util','./rpc','./project','./events','EventEmitter','agi','defaults','127.0.0.1','projectUpdate','error','stack','findIndex','deleted','push','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','[%s]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','createSquareReport','then','catch','hasOwnProperty','debug','variables'];(function(_0x5e044a,_0x38efc0){var _0x4c45ef=function(_0x26730c){while(--_0x26730c){_0x5e044a['push'](_0x5e044a['shift']());}};_0x4c45ef(++_0x38efc0);}(_0x3c67,0xbc));var _0x73c6=function(_0x342baa,_0x4a110f){_0x342baa=_0x342baa-0x0;var _0x1208f3=_0x3c67[_0x342baa];return _0x1208f3;};'use strict';var _=require(_0x73c6('0x0'));var syncho=require(_0x73c6('0x1'));var util=require(_0x73c6('0x2'));var config=require(_0x73c6('0x3'));var logger=require('../../config/logger')('agi');var utilLicense=require(_0x73c6('0x4'));var rpc=require(_0x73c6('0x5'));var Project=require(_0x73c6('0x6'));var AGIEmitter=require(_0x73c6('0x7'))[_0x73c6('0x8')];var projects=[];config[_0x73c6('0x9')]=_[_0x73c6('0xa')](config[_0x73c6('0x9')],{'ip':_0x73c6('0xb'),'port':0x11dd});AGIEmitter['on'](_0x73c6('0xc'),projectUpdateHandler);function connectionHandler(_0x313866){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x313866);agiHandler(_0x313866);}catch(_0x1a4288){logger[_0x73c6('0xd')](_0x1a4288[_0x73c6('0xe')]);}});});}function projectUpdateHandler(_0x3c4c86){try{var _0x36a7c9=_[_0x73c6('0xf')](projects,['id',_0x3c4c86['id']]);if(_0x36a7c9>-0x1){if(_0x3c4c86[_0x73c6('0x10')]===!![]){projects['splice'](_0x36a7c9,0x1);}else{projects[_0x36a7c9]=_0x3c4c86;}}else{projects[_0x73c6('0x11')](_0x3c4c86);}}catch(_0x3e2204){logger[_0x73c6('0xd')](_0x3e2204[_0x73c6('0xe')]);}}function listeningHandler(){console['log'](_0x73c6('0x12'),config[_0x73c6('0x9')]['port']);logger[_0x73c6('0x13')](util[_0x73c6('0x14')](_0x73c6('0x15'),config['agi']['ip'],config[_0x73c6('0x9')]['port']));}function errorHandler(_0x1ff5f0){if(_0x1ff5f0&&_0x1ff5f0[_0x73c6('0x16')]&&_0x1ff5f0[_0x73c6('0x17')]){logger[_0x73c6('0xd')](util[_0x73c6('0x14')](_0x73c6('0x18'),_0x1ff5f0[_0x73c6('0x16')],_0x1ff5f0[_0x73c6('0x17')]));}else{logger['error'](util[_0x73c6('0x14')]('[ERROR]\x20%s',_0x1ff5f0['stack']));}}function closeHandler(){logger[_0x73c6('0x13')](util['format'](_0x73c6('0x19'),this[_0x73c6('0x1a')],this['calleridname'],this[_0x73c6('0x1b')],this[_0x73c6('0x1c')],this[_0x73c6('0x1d')]));try{createSquareReport(this);}catch(_0x3fd10d){logger[_0x73c6('0xd')](_0x3fd10d[_0x73c6('0xe')]);}}function timeoutHandler(){logger['info'](util['format'](_0x73c6('0x1e'),this[_0x73c6('0x1a')],this[_0x73c6('0x1f')],this[_0x73c6('0x1b')],this[_0x73c6('0x1c')],this[_0x73c6('0x1d')]));}function hangupHandler(){logger[_0x73c6('0x13')](util[_0x73c6('0x14')](_0x73c6('0x20'),this[_0x73c6('0x1a')],this[_0x73c6('0x1f')],this[_0x73c6('0x1b')],this[_0x73c6('0x1c')],this[_0x73c6('0x1d')]));this[_0x73c6('0x21')]=!![];}function createSquareReport(_0x4b169e,_0x563d6f){rpc[_0x73c6('0x22')](_0x4b169e)[_0x73c6('0x23')](function(_0x4a7639){if(_0x563d6f){_0x563d6f(null,_0x4a7639);}})[_0x73c6('0x24')](function(_0x5da3da){if(_0x563d6f){_0x563d6f(null,_0x5da3da);}});}function setChannelVariables(_0x362071){for(var _0x2fef79 in _0x362071){if(_0x362071[_0x73c6('0x25')](_0x2fef79)){if(_0x2fef79['indexOf']('agi_')===0x0){_0x362071[_0x2fef79['substring'](0x4)]=_0x362071[_0x2fef79];delete _0x362071[_0x2fef79];}}}}function agiHandler(_0x5a1acf){logger[_0x73c6('0x26')](_0x73c6('0x27'),JSON['stringify'](_0x5a1acf,null,0x2));logger[_0x73c6('0x13')](util[_0x73c6('0x14')](_0x73c6('0x28'),_0x5a1acf[_0x73c6('0x1a')],_0x5a1acf['calleridname'],_0x5a1acf['callerid'],_0x5a1acf[_0x73c6('0x1c')],_0x5a1acf[_0x73c6('0x1d')]));_0x5a1acf['on'](_0x73c6('0xd'),errorHandler);_0x5a1acf['on']('close',closeHandler);_0x5a1acf['on']('timeout',timeoutHandler);_0x5a1acf['evtHangup']=![];_0x5a1acf['on'](_0x73c6('0x29'),hangupHandler);var _0x17d94d=_[_0x73c6('0x2a')](projects,[_0x73c6('0x16'),_0x5a1acf[_0x73c6('0x1a')]]);if(!_0x17d94d)return Project['handleNotFound'](_0x5a1acf);if(!_0x17d94d[_0x73c6('0x2b')])return Project['handleUnpublished'](_0x5a1acf);return Project[_0x73c6('0x2c')](_0x17d94d,_0x5a1acf);}function main(){var _0x122378;return utilLicense[_0x73c6('0x2d')]()[_0x73c6('0x23')](function(_0x5d07ff){if(!_0x5d07ff)return;if(_0x5d07ff[_0x73c6('0x2e')]){if(_0x5d07ff[_0x73c6('0x2f')]&&_0x5d07ff[_0x73c6('0x2f')]>0x0){logger['info'](util['format'](_0x73c6('0x30'),_0x5d07ff[_0x73c6('0x2f')]));_0x122378=_0x5d07ff['callysquare'];}else{logger[_0x73c6('0x13')](_0x73c6('0x31'));}}else{logger['info']('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x122378=-0x1;}})[_0x73c6('0x23')](function(){return Project[_0x73c6('0x32')]();})[_0x73c6('0x23')](function(_0x529e04){projects=_0x529e04;return;})['catch'](function(_0x21e7d8){logger[_0x73c6('0xd')](_0x73c6('0x33'),_0x21e7d8[_0x73c6('0xe')]);})[_0x73c6('0x34')](function(){var _0x28a464=require(_0x73c6('0x35'))(config[_0x73c6('0x9')][_0x73c6('0x36')],config[_0x73c6('0x9')]['ip'],_0x122378);_0x28a464['on'](_0x73c6('0xd'),errorHandler);_0x28a464['on'](_0x73c6('0x37'),listeningHandler);_0x28a464['on']('connection',connectionHandler);_0x28a464['on'](_0x73c6('0x38'),closeHandler);});}main(); \ No newline at end of file +var _0xb21d=['port','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','error','[%s]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','callerid','uniqueid','info','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','dnid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','evtHangup','indexOf','agi_','substring','debug','variables','stringify','close','timeout','find','production','handleUnpublished','initialize','getLicense','then','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','getAll','[LICENSE]','finally','listening','connection','lodash','syncho','util','../../config/environment','../../config/logger','agi','../../config/license/util','./rpc','./project','./events','defaults','127.0.0.1','projectUpdate','nextTick','stack','findIndex','deleted','push','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!'];(function(_0x199fa0,_0x52b3ce){var _0x45bec1=function(_0x176b13){while(--_0x176b13){_0x199fa0['push'](_0x199fa0['shift']());}};_0x45bec1(++_0x52b3ce);}(_0xb21d,0x1cd));var _0xdb21=function(_0x168fe7,_0x426aed){_0x168fe7=_0x168fe7-0x0;var _0x51ab13=_0xb21d[_0x168fe7];return _0x51ab13;};'use strict';var _=require(_0xdb21('0x0'));var syncho=require(_0xdb21('0x1'));var util=require(_0xdb21('0x2'));var config=require(_0xdb21('0x3'));var logger=require(_0xdb21('0x4'))(_0xdb21('0x5'));var utilLicense=require(_0xdb21('0x6'));var rpc=require(_0xdb21('0x7'));var Project=require(_0xdb21('0x8'));var AGIEmitter=require(_0xdb21('0x9'))['EventEmitter'];var projects=[];config[_0xdb21('0x5')]=_[_0xdb21('0xa')](config[_0xdb21('0x5')],{'ip':_0xdb21('0xb'),'port':0x11dd});AGIEmitter['on'](_0xdb21('0xc'),projectUpdateHandler);function connectionHandler(_0x227acb){process[_0xdb21('0xd')](function(){syncho(function(){try{setChannelVariables(_0x227acb);agiHandler(_0x227acb);}catch(_0x9c9cb9){logger['error'](_0x9c9cb9[_0xdb21('0xe')]);}});});}function projectUpdateHandler(_0x4e3140){try{var _0x13cc95=_[_0xdb21('0xf')](projects,['id',_0x4e3140['id']]);if(_0x13cc95>-0x1){if(_0x4e3140[_0xdb21('0x10')]===!![]){projects['splice'](_0x13cc95,0x1);}else{projects[_0x13cc95]=_0x4e3140;}}else{projects[_0xdb21('0x11')](_0x4e3140);}}catch(_0x1947b3){logger['error'](_0x1947b3[_0xdb21('0xe')]);}}function listeningHandler(){console['log'](_0xdb21('0x12'),config[_0xdb21('0x5')][_0xdb21('0x13')]);logger['info'](util[_0xdb21('0x14')](_0xdb21('0x15'),config['agi']['ip'],config[_0xdb21('0x5')][_0xdb21('0x13')]));}function errorHandler(_0x20849a){if(_0x20849a&&_0x20849a[_0xdb21('0x16')]&&_0x20849a[_0xdb21('0x17')]){logger[_0xdb21('0x18')](util['format'](_0xdb21('0x19'),_0x20849a['name'],_0x20849a['message']));}else{logger['error'](util[_0xdb21('0x14')]('[ERROR]\x20%s',_0x20849a[_0xdb21('0xe')]));}}function closeHandler(){logger['info'](util['format'](_0xdb21('0x1a'),this['arg_1'],this[_0xdb21('0x1b')],this[_0xdb21('0x1c')],this['dnid'],this[_0xdb21('0x1d')]));try{createSquareReport(this);}catch(_0x67e4a3){logger[_0xdb21('0x18')](_0x67e4a3['stack']);}}function timeoutHandler(){logger[_0xdb21('0x1e')](util[_0xdb21('0x14')](_0xdb21('0x1f'),this['arg_1'],this[_0xdb21('0x1b')],this[_0xdb21('0x1c')],this[_0xdb21('0x20')],this['uniqueid']));}function hangupHandler(){logger[_0xdb21('0x1e')](util[_0xdb21('0x14')](_0xdb21('0x21'),this[_0xdb21('0x22')],this['calleridname'],this[_0xdb21('0x1c')],this['dnid'],this[_0xdb21('0x1d')]));this[_0xdb21('0x23')]=!![];}function createSquareReport(_0xff4db5,_0x566001){rpc['createSquareReport'](_0xff4db5)['then'](function(_0x25db70){if(_0x566001){_0x566001(null,_0x25db70);}})['catch'](function(_0x2be658){if(_0x566001){_0x566001(null,_0x2be658);}});}function setChannelVariables(_0x187920){for(var _0x39976d in _0x187920){if(_0x187920['hasOwnProperty'](_0x39976d)){if(_0x39976d[_0xdb21('0x24')](_0xdb21('0x25'))===0x0){_0x187920[_0x39976d[_0xdb21('0x26')](0x4)]=_0x187920[_0x39976d];delete _0x187920[_0x39976d];}}}}function agiHandler(_0x4f2441){logger[_0xdb21('0x27')](_0xdb21('0x28'),JSON[_0xdb21('0x29')](_0x4f2441,null,0x2));logger['info'](util[_0xdb21('0x14')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x4f2441[_0xdb21('0x22')],_0x4f2441['calleridname'],_0x4f2441[_0xdb21('0x1c')],_0x4f2441[_0xdb21('0x20')],_0x4f2441[_0xdb21('0x1d')]));_0x4f2441['on'](_0xdb21('0x18'),errorHandler);_0x4f2441['on'](_0xdb21('0x2a'),closeHandler);_0x4f2441['on'](_0xdb21('0x2b'),timeoutHandler);_0x4f2441['evtHangup']=![];_0x4f2441['on']('hangup',hangupHandler);var _0x51212d=_[_0xdb21('0x2c')](projects,[_0xdb21('0x16'),_0x4f2441[_0xdb21('0x22')]]);if(!_0x51212d)return Project['handleNotFound'](_0x4f2441);if(!_0x51212d[_0xdb21('0x2d')])return Project[_0xdb21('0x2e')](_0x4f2441);return Project[_0xdb21('0x2f')](_0x51212d,_0x4f2441);}function main(){var _0x5794a6;return utilLicense[_0xdb21('0x30')]()[_0xdb21('0x31')](function(_0x309d81){if(!_0x309d81)return;if(_0x309d81[_0xdb21('0x32')]){if(_0x309d81[_0xdb21('0x33')]&&_0x309d81[_0xdb21('0x33')]>0x0){logger[_0xdb21('0x1e')](util[_0xdb21('0x14')](_0xdb21('0x34'),_0x309d81['callysquare']));_0x5794a6=_0x309d81[_0xdb21('0x33')];}else{logger['info'](_0xdb21('0x35'));}}else{logger[_0xdb21('0x1e')](_0xdb21('0x36'));_0x5794a6=-0x1;}})[_0xdb21('0x31')](function(){return Project[_0xdb21('0x37')]();})['then'](function(_0x30d7ca){projects=_0x30d7ca;return;})['catch'](function(_0x8673cb){logger[_0xdb21('0x18')](_0xdb21('0x38'),_0x8673cb[_0xdb21('0xe')]);})[_0xdb21('0x39')](function(){var _0x3277f3=require('./server')(config['agi'][_0xdb21('0x13')],config[_0xdb21('0x5')]['ip'],_0x5794a6);_0x3277f3['on']('error',errorHandler);_0x3277f3['on'](_0xdb21('0x3a'),listeningHandler);_0x3277f3['on'](_0xdb21('0x3b'),connectionHandler);_0x3277f3['on'](_0xdb21('0x2a'),closeHandler);});}main(); \ No newline at end of file diff --git a/server/services/agi/mailRpc/index.js b/server/services/agi/mailRpc/index.js index 14ae233..d223923 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 _0x5148=['result','sendMailMessage','SendMail','bluebird','jayson/promise','http','request','then','error'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x5148,0x1a1));var _0x8514=function(_0x5cbace,_0x33943c){_0x5cbace=_0x5cbace-0x0;var _0x6de5b8=_0x5148[_0x5cbace];return _0x6de5b8;};'use strict';var BPromise=require(_0x8514('0x0'));var jayson=require(_0x8514('0x1'));var client=jayson['client'][_0x8514('0x2')]({'port':0x232b});function request(_0x38bce6,_0x465524){return new BPromise(function(_0x569e8b,_0x19842e){return client[_0x8514('0x3')](_0x38bce6,_0x465524)[_0x8514('0x4')](function(_0x1432dd){if(_0x1432dd[_0x8514('0x5')]){return _0x19842e(_0x1432dd[_0x8514('0x5')]['message']);}else{return _0x569e8b(_0x1432dd[_0x8514('0x6')]);}})['catch'](function(_0x4fb531){return _0x19842e(_0x4fb531);});});}exports[_0x8514('0x7')]=function(_0x949e83,_0x19acb1){return request(_0x8514('0x8'),{'account':_0x949e83,'message':_0x19acb1});}; \ No newline at end of file +var _0xad97=['then','error','message','result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xad97,0x1c9));var _0x7ad9=function(_0x3030bc,_0x406b48){_0x3030bc=_0x3030bc-0x0;var _0x4b809f=_0xad97[_0x3030bc];return _0x4b809f;};'use strict';var BPromise=require(_0x7ad9('0x0'));var jayson=require(_0x7ad9('0x1'));var client=jayson[_0x7ad9('0x2')]['http']({'port':0x232b});function request(_0x5a7a3e,_0x1ec716){return new BPromise(function(_0x4718c7,_0x1e1fa7){return client['request'](_0x5a7a3e,_0x1ec716)[_0x7ad9('0x3')](function(_0x2c7772){if(_0x2c7772[_0x7ad9('0x4')]){return _0x1e1fa7(_0x2c7772[_0x7ad9('0x4')][_0x7ad9('0x5')]);}else{return _0x4718c7(_0x2c7772[_0x7ad9('0x6')]);}})[_0x7ad9('0x7')](function(_0xedb4be){return _0x1e1fa7(_0xedb4be);});});}exports[_0x7ad9('0x8')]=function(_0x43eade,_0x486ed8){return request(_0x7ad9('0x9'),{'account':_0x43eade,'message':_0x486ed8});}; \ No newline at end of file diff --git a/server/services/agi/project.js b/server/services/agi/project.js index 48543e7..8b359bb 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 _0x49fd=['dnid','uniqueid','traverseBFS','clear','vertex','agicommand','gotoc','context','extension','priority','response','code','evtHangup','isUndefined','result','agicommand\x20not\x20found','stack','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','finally','toString','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','Project\x20%s\x20not\x20found','continueAt','Project\x20%s\x20not\x20published','exports','lodash','xml2json','util','../../config/logger','./rpc','./mailRpc','./graph','./vertices','getSquareProjects','catch','error','Unable\x20to\x20download\x20CallySquare\x20projects','retry','maxRetry','omit','mxCell','hasOwnProperty','isArray','length','source','target','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'];(function(_0x6afc9c,_0xf6b755){var _0x195d68=function(_0x48f1eb){while(--_0x48f1eb){_0x6afc9c['push'](_0x6afc9c['shift']());}};_0x195d68(++_0xf6b755);}(_0x49fd,0x1db));var _0xd49f=function(_0x4e8079,_0x24edd5){_0x4e8079=_0x4e8079-0x0;var _0x74d014=_0x49fd[_0x4e8079];return _0x74d014;};'use strict';var _=require(_0xd49f('0x0'));var moment=require('moment');var parser=require(_0xd49f('0x1'));var util=require(_0xd49f('0x2'));var logger=require(_0xd49f('0x3'))('agi');var rpc=require(_0xd49f('0x4'));var mailRpc=require(_0xd49f('0x5'));var Graph=require(_0xd49f('0x6'));var Vertices=require(_0xd49f('0x7'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0xd49f('0x8')]()[_0xd49f('0x9')](function(_0x1a54b1){logger[_0xd49f('0xa')](_0xd49f('0xb'),_0x1a54b1['stack']);return[];});}function addVertex(_0x596790,_0x2fb355,_0x5256f6){_0x2fb355['agicommand']=_0x5256f6;if(_0x2fb355['hasOwnProperty'](_0xd49f('0xc'))){_0x2fb355[_0xd49f('0xd')]=parseInt(_0x2fb355[_0xd49f('0xc')],0xa);}_0x596790['addVertex'](_[_0xd49f('0xe')](_0x2fb355,_0xd49f('0xf')));}function initGraph(_0x2bfa58,_0x4a08a3){var _0x27c146=new Graph();for(var _0x63a46 in _0x2bfa58){if(_0x2bfa58[_0xd49f('0x10')](_0x63a46)){if(_[_0xd49f('0x11')](_0x2bfa58[_0x63a46])){for(var _0x14522c=0x0;_0x14522c<_0x2bfa58[_0x63a46][_0xd49f('0x12')];_0x14522c+=0x1){addVertex(_0x27c146,_0x2bfa58[_0x63a46][_0x14522c],_0x63a46);}}else{addVertex(_0x27c146,_0x2bfa58[_0x63a46],_0x63a46);}}}for(var _0x13f50f=0x0;_0x13f50f<_0x4a08a3[_0xd49f('0x12')];_0x13f50f+=0x1){if(_0x4a08a3[_0x13f50f][_0xd49f('0x13')]&&_0x4a08a3[_0x13f50f]['target']){_0x27c146['addEdge'](_0x4a08a3[_0x13f50f][_0xd49f('0x13')],_0x4a08a3[_0x13f50f][_0xd49f('0x14')],_0x4a08a3[_0x13f50f][_0xd49f('0x15')]);}}return _0x27c146;}function getRoot(_0x4fdcb4){return parser[_0xd49f('0x16')](_0x4fdcb4,{'object':!![]})[_0xd49f('0x17')][_0xd49f('0x18')];}function inspect(_0x3ba716){return util[_0xd49f('0x19')](_0x3ba716,{'showHidden':![],'depth':null});}function initialize(_0x5a2822,_0x52ac9b){var _0x2edb84=getRoot(_0x5a2822[_0xd49f('0x1a')]);if(!_0x2edb84||!_0x2edb84[_0xd49f('0x1b')])return;var _0x280f2c,_0xfacb6a,_0x389fa1;logger[_0xd49f('0x1c')](_0xd49f('0x18'),JSON[_0xd49f('0x1d')](_0x2edb84,null,0x2));_0x52ac9b[_0xd49f('0x1e')]=moment()[_0xd49f('0x1f')](_0xd49f('0x20'));_0x280f2c=initGraph(_['omit'](_0x2edb84,_0xd49f('0xf')),_0x2edb84[_0xd49f('0xf')]);_0xfacb6a=new Vertices(_0x52ac9b,rpc,mailRpc);logger[_0xd49f('0x21')](util[_0xd49f('0x1f')](_0xd49f('0x22'),_0x52ac9b[_0xd49f('0x23')],_0x52ac9b['calleridname'],_0x52ac9b[_0xd49f('0x24')],_0x52ac9b[_0xd49f('0x25')],_0x52ac9b[_0xd49f('0x26')]));_0x280f2c[_0xd49f('0x27')](_0x2edb84[_0xd49f('0x1b')]['id'],function(_0x3726fc){try{_0x3726fc=_0xfacb6a[_0xd49f('0x28')](_0x3726fc);logger['debug'](_0xd49f('0x29'),JSON['stringify'](_0x3726fc,null,0x2));if(_0x3726fc[_0xd49f('0x2a')]===_0xd49f('0x2b')){logger[_0xd49f('0x21')]('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x52ac9b[_0xd49f('0x2c')]=_0x3726fc['context']||_0x52ac9b[_0xd49f('0x2c')];_0x52ac9b[_0xd49f('0x2d')]=_0x3726fc['extension'];_0x52ac9b[_0xd49f('0x2e')]=_0x3726fc['priority']?_0x3726fc['priority']-0x1:0x1;return null;}else if(_0x3726fc&&_0xfacb6a[_0x3726fc[_0xd49f('0x2a')]]){_0x389fa1=_0xfacb6a[_0x3726fc[_0xd49f('0x2a')]](_0x3726fc);logger[_0xd49f('0x21')](_0xd49f('0x2f'),JSON[_0xd49f('0x1d')](_0x389fa1,null,0x2));if(_0x389fa1&&_0x389fa1[_0xd49f('0x30')]===AGI_CODE_SUCCESS&&_0x389fa1['result']!==AGI_RESULT_ERROR&&!_0x52ac9b[_0xd49f('0x31')]){logger[_0xd49f('0x1c')]('response',inspect(_0x389fa1));return _[_0xd49f('0x32')](_0x389fa1[_0xd49f('0x33')])?null:_0x389fa1[_0xd49f('0x33')]['toString']();}else{logger[_0xd49f('0xa')](_0xd49f('0x2f'),inspect(_0x389fa1));return null;}}else{logger[_0xd49f('0xa')](_0xd49f('0x34'));return null;}}catch(_0x5e1aa8){logger[_0xd49f('0xa')](_0x5e1aa8[_0xd49f('0x35')]);return null;}});if(_0x2edb84['finally']){logger[_0xd49f('0x21')](util['format'](_0xd49f('0x36'),_0x52ac9b[_0xd49f('0x23')],_0x52ac9b[_0xd49f('0x37')],_0x52ac9b['callerid'],_0x52ac9b[_0xd49f('0x25')],_0x52ac9b[_0xd49f('0x26')]));_0x280f2c[_0xd49f('0x27')](_0x2edb84[_0xd49f('0x38')]['id'],function(_0xc363a){try{_0xc363a=_0xfacb6a['clear'](_0xc363a);logger['debug']('vertex',JSON[_0xd49f('0x1d')](_0xc363a,null,0x2));if(_0xc363a&&_0xfacb6a[_0xc363a[_0xd49f('0x2a')]]){_0x389fa1=_0xfacb6a[_0xc363a['agicommand']](_0xc363a);if(_0x389fa1){logger[_0xd49f('0x1c')](_0xd49f('0x2f'),inspect(_0x389fa1));return _['isUndefined'](_0x389fa1[_0xd49f('0x33')])?null:_0x389fa1[_0xd49f('0x33')][_0xd49f('0x39')]();}else{logger['error'](_0xd49f('0x2f'),inspect(_0x389fa1));return null;}}else{logger[_0xd49f('0xa')]('agicommand\x20not\x20found');return null;}}catch(_0x41c6b0){logger[_0xd49f('0xa')](_0x41c6b0[_0xd49f('0x35')]);return null;}});}logger['info'](util[_0xd49f('0x1f')](_0xd49f('0x3a'),_0x52ac9b[_0xd49f('0x23')],_0x52ac9b['calleridname'],_0x52ac9b[_0xd49f('0x24')],_0x52ac9b['dnid'],_0x52ac9b[_0xd49f('0x26')]));logger[_0xd49f('0x21')](util['format']('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x52ac9b[_0xd49f('0x2c')],_0x52ac9b['extension'],parseInt(_0x52ac9b['priority'],0xa)+0x1));_0x52ac9b['continueAt'](_0x52ac9b[_0xd49f('0x2c')],_0x52ac9b[_0xd49f('0x2d')],parseInt(_0x52ac9b[_0xd49f('0x2e')],0xa)+0x1);_0x52ac9b[_0xd49f('0x3b')]();}function handleNotFound(_0x3ac81b){logger[_0xd49f('0xa')](util[_0xd49f('0x1f')](_0xd49f('0x3c'),_0x3ac81b[_0xd49f('0x23')]));_0x3ac81b[_0xd49f('0x3d')](_0x3ac81b[_0xd49f('0x2c')],_0x3ac81b[_0xd49f('0x2d')],parseInt(_0x3ac81b['priority'],0xa)+0x1);_0x3ac81b['close']();}function handleUnpublished(_0x29560f){logger['error'](util[_0xd49f('0x1f')](_0xd49f('0x3e'),_0x29560f[_0xd49f('0x23')]));_0x29560f[_0xd49f('0x3d')](_0x29560f['context'],_0x29560f['extension'],parseInt(_0x29560f['priority'],0xa)+0x1);_0x29560f[_0xd49f('0x3b')]();}module[_0xd49f('0x3f')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file +var _0x802d=['vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','evtHangup','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','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20found','close','exports','lodash','moment','xml2json','./rpc','./mailRpc','./graph','./vertices','getSquareProjects','catch','error','Unable\x20to\x20download\x20CallySquare\x20projects','stack','agicommand','hasOwnProperty','retry','addVertex','omit','mxCell','isArray','length','source','target','value','toJson','mxGraphModel','root','start','debug','stringify','joinAt','format','YYYY-MM-DD\x20HH:mm:ss','info','arg_1','calleridname','callerid','dnid','uniqueid','traverseBFS','clear'];(function(_0xd0cd0b,_0x490956){var _0x59cced=function(_0x567251){while(--_0x567251){_0xd0cd0b['push'](_0xd0cd0b['shift']());}};_0x59cced(++_0x490956);}(_0x802d,0x8f));var _0xd802=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x802d[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0xd802('0x0'));var moment=require(_0xd802('0x1'));var parser=require(_0xd802('0x2'));var util=require('util');var logger=require('../../config/logger')('agi');var rpc=require(_0xd802('0x3'));var mailRpc=require(_0xd802('0x4'));var Graph=require(_0xd802('0x5'));var Vertices=require(_0xd802('0x6'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0xd802('0x7')]()[_0xd802('0x8')](function(_0x4d878a){logger[_0xd802('0x9')](_0xd802('0xa'),_0x4d878a[_0xd802('0xb')]);return[];});}function addVertex(_0x3b66f8,_0x1434f3,_0x136580){_0x1434f3[_0xd802('0xc')]=_0x136580;if(_0x1434f3[_0xd802('0xd')](_0xd802('0xe'))){_0x1434f3['maxRetry']=parseInt(_0x1434f3[_0xd802('0xe')],0xa);}_0x3b66f8[_0xd802('0xf')](_[_0xd802('0x10')](_0x1434f3,_0xd802('0x11')));}function initGraph(_0x4741ce,_0x5f4f58){var _0x3a9134=new Graph();for(var _0x3dd5c9 in _0x4741ce){if(_0x4741ce[_0xd802('0xd')](_0x3dd5c9)){if(_[_0xd802('0x12')](_0x4741ce[_0x3dd5c9])){for(var _0x362e97=0x0;_0x362e97<_0x4741ce[_0x3dd5c9][_0xd802('0x13')];_0x362e97+=0x1){addVertex(_0x3a9134,_0x4741ce[_0x3dd5c9][_0x362e97],_0x3dd5c9);}}else{addVertex(_0x3a9134,_0x4741ce[_0x3dd5c9],_0x3dd5c9);}}}for(var _0x576226=0x0;_0x576226<_0x5f4f58[_0xd802('0x13')];_0x576226+=0x1){if(_0x5f4f58[_0x576226][_0xd802('0x14')]&&_0x5f4f58[_0x576226][_0xd802('0x15')]){_0x3a9134['addEdge'](_0x5f4f58[_0x576226][_0xd802('0x14')],_0x5f4f58[_0x576226]['target'],_0x5f4f58[_0x576226][_0xd802('0x16')]);}}return _0x3a9134;}function getRoot(_0x1b06a4){return parser[_0xd802('0x17')](_0x1b06a4,{'object':!![]})[_0xd802('0x18')][_0xd802('0x19')];}function inspect(_0x5f3c97){return util['inspect'](_0x5f3c97,{'showHidden':![],'depth':null});}function initialize(_0x12c36f,_0x4696b5){var _0x4f74c4=getRoot(_0x12c36f['production']);if(!_0x4f74c4||!_0x4f74c4[_0xd802('0x1a')])return;var _0xb59065,_0x35f0b2,_0x1a010c;logger[_0xd802('0x1b')](_0xd802('0x19'),JSON[_0xd802('0x1c')](_0x4f74c4,null,0x2));_0x4696b5[_0xd802('0x1d')]=moment()[_0xd802('0x1e')](_0xd802('0x1f'));_0xb59065=initGraph(_[_0xd802('0x10')](_0x4f74c4,_0xd802('0x11')),_0x4f74c4[_0xd802('0x11')]);_0x35f0b2=new Vertices(_0x4696b5,rpc,mailRpc);logger[_0xd802('0x20')](util['format']('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x4696b5[_0xd802('0x21')],_0x4696b5[_0xd802('0x22')],_0x4696b5[_0xd802('0x23')],_0x4696b5[_0xd802('0x24')],_0x4696b5[_0xd802('0x25')]));_0xb59065[_0xd802('0x26')](_0x4f74c4[_0xd802('0x1a')]['id'],function(_0x297f2d){try{_0x297f2d=_0x35f0b2[_0xd802('0x27')](_0x297f2d);logger['debug'](_0xd802('0x28'),JSON[_0xd802('0x1c')](_0x297f2d,null,0x2));if(_0x297f2d['agicommand']===_0xd802('0x29')){logger[_0xd802('0x20')](_0xd802('0x2a'));_0x4696b5[_0xd802('0x2b')]=_0x297f2d[_0xd802('0x2b')]||_0x4696b5[_0xd802('0x2b')];_0x4696b5[_0xd802('0x2c')]=_0x297f2d['extension'];_0x4696b5[_0xd802('0x2d')]=_0x297f2d['priority']?_0x297f2d[_0xd802('0x2d')]-0x1:0x1;return null;}else if(_0x297f2d&&_0x35f0b2[_0x297f2d[_0xd802('0xc')]]){_0x1a010c=_0x35f0b2[_0x297f2d[_0xd802('0xc')]](_0x297f2d);logger['info'](_0xd802('0x2e'),JSON[_0xd802('0x1c')](_0x1a010c,null,0x2));if(_0x1a010c&&_0x1a010c[_0xd802('0x2f')]===AGI_CODE_SUCCESS&&_0x1a010c['result']!==AGI_RESULT_ERROR&&!_0x4696b5[_0xd802('0x30')]){logger[_0xd802('0x1b')](_0xd802('0x2e'),inspect(_0x1a010c));return _[_0xd802('0x31')](_0x1a010c[_0xd802('0x32')])?null:_0x1a010c['result'][_0xd802('0x33')]();}else{logger[_0xd802('0x9')](_0xd802('0x2e'),inspect(_0x1a010c));return null;}}else{logger[_0xd802('0x9')](_0xd802('0x34'));return null;}}catch(_0x2db122){logger['error'](_0x2db122[_0xd802('0xb')]);return null;}});if(_0x4f74c4[_0xd802('0x35')]){logger[_0xd802('0x20')](util[_0xd802('0x1e')](_0xd802('0x36'),_0x4696b5[_0xd802('0x21')],_0x4696b5['calleridname'],_0x4696b5[_0xd802('0x23')],_0x4696b5[_0xd802('0x24')],_0x4696b5[_0xd802('0x25')]));_0xb59065[_0xd802('0x26')](_0x4f74c4[_0xd802('0x35')]['id'],function(_0x484dad){try{_0x484dad=_0x35f0b2[_0xd802('0x27')](_0x484dad);logger['debug']('vertex',JSON[_0xd802('0x1c')](_0x484dad,null,0x2));if(_0x484dad&&_0x35f0b2[_0x484dad[_0xd802('0xc')]]){_0x1a010c=_0x35f0b2[_0x484dad[_0xd802('0xc')]](_0x484dad);if(_0x1a010c){logger[_0xd802('0x1b')](_0xd802('0x2e'),inspect(_0x1a010c));return _[_0xd802('0x31')](_0x1a010c[_0xd802('0x32')])?null:_0x1a010c[_0xd802('0x32')][_0xd802('0x33')]();}else{logger[_0xd802('0x9')](_0xd802('0x2e'),inspect(_0x1a010c));return null;}}else{logger[_0xd802('0x9')](_0xd802('0x34'));return null;}}catch(_0x6f85a4){logger[_0xd802('0x9')](_0x6f85a4[_0xd802('0xb')]);return null;}});}logger[_0xd802('0x20')](util['format'](_0xd802('0x37'),_0x4696b5[_0xd802('0x21')],_0x4696b5['calleridname'],_0x4696b5[_0xd802('0x23')],_0x4696b5[_0xd802('0x24')],_0x4696b5[_0xd802('0x25')]));logger[_0xd802('0x20')](util[_0xd802('0x1e')](_0xd802('0x38'),_0x4696b5[_0xd802('0x2b')],_0x4696b5[_0xd802('0x2c')],parseInt(_0x4696b5['priority'],0xa)+0x1));_0x4696b5[_0xd802('0x39')](_0x4696b5['context'],_0x4696b5[_0xd802('0x2c')],parseInt(_0x4696b5['priority'],0xa)+0x1);_0x4696b5['close']();}function handleNotFound(_0x1ab538){logger[_0xd802('0x9')](util[_0xd802('0x1e')](_0xd802('0x3a'),_0x1ab538[_0xd802('0x21')]));_0x1ab538[_0xd802('0x39')](_0x1ab538['context'],_0x1ab538[_0xd802('0x2c')],parseInt(_0x1ab538[_0xd802('0x2d')],0xa)+0x1);_0x1ab538[_0xd802('0x3b')]();}function handleUnpublished(_0x2752d6){logger[_0xd802('0x9')](util[_0xd802('0x1e')]('Project\x20%s\x20not\x20published',_0x2752d6[_0xd802('0x21')]));_0x2752d6[_0xd802('0x39')](_0x2752d6[_0xd802('0x2b')],_0x2752d6['extension'],parseInt(_0x2752d6[_0xd802('0x2d')],0xa)+0x1);_0x2752d6[_0xd802('0x3b')]();}module[_0xd802('0x3c')]={'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 c33dc6a..be100a1 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 _0x3979=['slice','trim','emit','headers','line','exports','stream','Transform','call','_localBuffer','_inBody','prototype','_transform','\x0d\x0a\x0d\x0a','toString','indexOf','substring','length'];(function(_0x1d61d3,_0x1e6bcd){var _0x37e6da=function(_0x331601){while(--_0x331601){_0x1d61d3['push'](_0x1d61d3['shift']());}};_0x37e6da(++_0x1e6bcd);}(_0x3979,0x114));var _0x9397=function(_0x5e5029,_0x453ddd){_0x5e5029=_0x5e5029-0x0;var _0x28a432=_0x3979[_0x5e5029];return _0x28a432;};'use strict';var util=require('util');var Transform=require(_0x9397('0x0'))[_0x9397('0x1')];function AGIReply(_0x2948b2){Transform[_0x9397('0x2')](this,_0x2948b2);this[_0x9397('0x3')]='';this[_0x9397('0x4')]=![];}util['inherits'](AGIReply,Transform);AGIReply[_0x9397('0x5')][_0x9397('0x6')]=function(_0x1ba049,_0x47fb81,_0x206ab2){var _0x380477='\x0a',_0x42eb12=['\x0a\x0a',_0x9397('0x7')],_0x46e01e=-0x1,_0x20278b=-0x1,_0x2aa6d9='',_0x4af264=0x0,_0x1e90f3='',_0x4ea86b='';this[_0x9397('0x3')]+=_0x1ba049[_0x9397('0x8')]();_0x1e90f3=this[_0x9397('0x3')];if(!this[_0x9397('0x4')]){_0x4af264=0x0;while(_0x42eb12[_0x4af264]){while((_0x20278b=_0x1e90f3[_0x9397('0x9')](_0x42eb12[_0x4af264]))!=-0x1){_0x2aa6d9=_0x42eb12[_0x4af264];_0x4ea86b=_0x1e90f3[_0x9397('0xa')](0x0,_0x20278b);_0x1e90f3=_0x1e90f3[_0x9397('0xa')](_0x20278b+_0x2aa6d9[_0x9397('0xb')]);var _0xc154d3=_0x4ea86b['split'](_0x380477),_0x4c4b5c=0x0,_0x2812a7={},_0x3e46d8='',_0x58ebaa='',_0x3b661f=-0x1;while(_0xc154d3[_0x4c4b5c]){_0x3b661f=_0xc154d3[_0x4c4b5c]['indexOf'](':');if(_0x3b661f!=-0x1){_0x3e46d8=_0xc154d3[_0x4c4b5c][_0x9397('0xc')](0x0,_0x3b661f)[_0x9397('0xd')]();_0x58ebaa=_0xc154d3[_0x4c4b5c][_0x9397('0xc')](_0x3b661f+0x1)[_0x9397('0xd')]();if(_0x3e46d8['length']>0x0){_0x2812a7[_0x3e46d8]=_0x58ebaa;}}else{}_0x4c4b5c++;}this[_0x9397('0xe')](_0x9397('0xf'),_0x2812a7);this[_0x9397('0x4')]=!![];}_0x4af264++;}this[_0x9397('0x3')]=_0x1e90f3;}else{while((_0x46e01e=_0x1e90f3[_0x9397('0x9')](_0x380477))!=-0x1){_0x4ea86b=_0x1e90f3[_0x9397('0xa')](0x0,_0x46e01e);this['emit'](_0x9397('0x10'),_0x4ea86b);_0x1e90f3=_0x1e90f3['substring'](_0x46e01e+_0x380477['length']);}this[_0x9397('0x3')]=_0x1e90f3;}_0x206ab2();};module[_0x9397('0x11')]=AGIReply; \ No newline at end of file +var _0x0230=['headers','line','exports','util','stream','Transform','_localBuffer','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','toString','indexOf','substring','length','trim'];(function(_0x45fc9c,_0x70f2cb){var _0x984946=function(_0x432b38){while(--_0x432b38){_0x45fc9c['push'](_0x45fc9c['shift']());}};_0x984946(++_0x70f2cb);}(_0x0230,0x163));var _0x0023=function(_0x20ef64,_0x4a8fe9){_0x20ef64=_0x20ef64-0x0;var _0x3707d8=_0x0230[_0x20ef64];return _0x3707d8;};'use strict';var util=require(_0x0023('0x0'));var Transform=require(_0x0023('0x1'))[_0x0023('0x2')];function AGIReply(_0xfb7793){Transform['call'](this,_0xfb7793);this[_0x0023('0x3')]='';this['_inBody']=![];}util[_0x0023('0x4')](AGIReply,Transform);AGIReply[_0x0023('0x5')][_0x0023('0x6')]=function(_0x29a190,_0x4c920f,_0x1ea020){var _0x3d5c17='\x0a',_0x28deff=['\x0a\x0a',_0x0023('0x7')],_0x5564b1=-0x1,_0xc99468=-0x1,_0x4e4b3e='',_0x2e49cc=0x0,_0x2b8fea='',_0x192057='';this[_0x0023('0x3')]+=_0x29a190[_0x0023('0x8')]();_0x2b8fea=this[_0x0023('0x3')];if(!this['_inBody']){_0x2e49cc=0x0;while(_0x28deff[_0x2e49cc]){while((_0xc99468=_0x2b8fea[_0x0023('0x9')](_0x28deff[_0x2e49cc]))!=-0x1){_0x4e4b3e=_0x28deff[_0x2e49cc];_0x192057=_0x2b8fea[_0x0023('0xa')](0x0,_0xc99468);_0x2b8fea=_0x2b8fea[_0x0023('0xa')](_0xc99468+_0x4e4b3e[_0x0023('0xb')]);var _0x53c880=_0x192057['split'](_0x3d5c17),_0x592de8=0x0,_0x29a877={},_0x39ab74='',_0x11563b='',_0x58c264=-0x1;while(_0x53c880[_0x592de8]){_0x58c264=_0x53c880[_0x592de8][_0x0023('0x9')](':');if(_0x58c264!=-0x1){_0x39ab74=_0x53c880[_0x592de8]['slice'](0x0,_0x58c264)[_0x0023('0xc')]();_0x11563b=_0x53c880[_0x592de8]['slice'](_0x58c264+0x1)['trim']();if(_0x39ab74[_0x0023('0xb')]>0x0){_0x29a877[_0x39ab74]=_0x11563b;}}else{}_0x592de8++;}this['emit'](_0x0023('0xd'),_0x29a877);this['_inBody']=!![];}_0x2e49cc++;}this[_0x0023('0x3')]=_0x2b8fea;}else{while((_0x5564b1=_0x2b8fea[_0x0023('0x9')](_0x3d5c17))!=-0x1){_0x192057=_0x2b8fea['substring'](0x0,_0x5564b1);this['emit'](_0x0023('0xe'),_0x192057);_0x2b8fea=_0x2b8fea[_0x0023('0xa')](_0x5564b1+_0x3d5c17[_0x0023('0xb')]);}this[_0x0023('0x3')]=_0x2b8fea;}_0x1ea020();};module[_0x0023('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 d98bc57..b52d29a 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 _0x12fd=['createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareMessage','createCmContact','ShowCmHopper','ListId','getPauseById','ShowPause','LoginUser','agentUnpause','UnpauseUser','LogoutUser','lodash','moment','jayson/promise','client','http','request','then','error','result','catch','getSquareProjects','name','getSquareProject','getMailAccountById','CloudProvider','email','getSquareProjectById','ShowSquareProject','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','ShowUser','GetContactByPhone','phone','ShowTrunk','getSoundById','ShowSound','save_name','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x12fd,0x199));var _0xd12f=function(_0x9ca985,_0x3b5dbe){_0x9ca985=_0x9ca985-0x0;var _0x464e62=_0x12fd[_0x9ca985];return _0x464e62;};'use strict';var _=require(_0xd12f('0x0'));var moment=require(_0xd12f('0x1'));var jayson=require(_0xd12f('0x2'));var client=jayson[_0xd12f('0x3')][_0xd12f('0x4')]({'port':0x2329});function request(_0x48fb45,_0x1e72a3){return new Promise(function(_0x37f6b4,_0x13efed){return client[_0xd12f('0x5')](_0x48fb45,_0x1e72a3)[_0xd12f('0x6')](function(_0x154c72){if(_0x154c72['error']){return _0x13efed(_0x154c72[_0xd12f('0x7')]['message']);}else{return _0x37f6b4(_0x154c72[_0xd12f('0x8')]);}})[_0xd12f('0x9')](function(_0x62de68){return _0x13efed(_0x62de68);});});}exports[_0xd12f('0xa')]=function(){return request('GetSquareProjects',{'options':{'raw':![],'attributes':['id',_0xd12f('0xb'),'production']}});};exports[_0xd12f('0xc')]=function(_0x5108a9){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x5108a9},'attributes':['production']}});};exports[_0xd12f('0xd')]=function(_0x1c31c8){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x1c31c8},'include':[{'model':'MailServerOut','as':'Smtp','include':[{'model':'CloudProvider','as':_0xd12f('0xe')}]}],'attributes':['id','name',_0xd12f('0xf')],'smtp':!![]}});};exports[_0xd12f('0x10')]=function(_0x534064){return request(_0xd12f('0x11'),{'options':{'where':{'id':_0x534064},'attributes':[_0xd12f('0xb')]}});};exports['getVoiceQueueById']=function(_0x5d686e){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x5d686e},'attributes':[_0xd12f('0xb')]}});};exports[_0xd12f('0x12')]=function(_0x98947b){return request(_0xd12f('0x13'),{'options':{'where':{'id':_0x98947b},'attributes':[_0xd12f('0xb')]}});};exports[_0xd12f('0x14')]=function(_0x35100a){return request(_0xd12f('0x15'),{'options':{'where':{'id':_0x35100a},'attributes':[_0xd12f('0x16')]}});};exports['getUserById']=function(_0x4b00a2){return request(_0xd12f('0x17'),{'options':{'where':{'id':_0x4b00a2},'attributes':[_0xd12f('0xb')]}});};exports['getContactByPhone']=function(_0x14c619){return request(_0xd12f('0x18'),{'options':{'where':{'phone':_0x14c619[_0xd12f('0x19')]},'attributes':['id']}});};exports['getTrunkById']=function(_0x5c4a4c){return request(_0xd12f('0x1a'),{'options':{'where':{'id':_0x5c4a4c},'attributes':[_0xd12f('0xb')]}});};exports[_0xd12f('0x1b')]=function(_0x186b99){return request(_0xd12f('0x1c'),{'options':{'where':{'id':_0x186b99},'attributes':[_0xd12f('0x1d')]}});};exports['getIntervalById']=function(_0x2cb62b){return request(_0xd12f('0x1e'),{'options':{'raw':![],'where':{'id':_0x2cb62b},'include':[{'model':_0xd12f('0x1f'),'as':_0xd12f('0x20')}]}});};exports[_0xd12f('0x21')]=function(_0x3c0aed){return request(_0xd12f('0x22'),{'options':{'where':{'id':_0x3c0aed},'attributes':['id',_0xd12f('0xb')]}});};exports[_0xd12f('0x23')]=function(_0x1d5168){return request(_0xd12f('0x24'),{'body':_0x1d5168});};exports[_0xd12f('0x25')]=function(_0x382395){return request(_0xd12f('0x26'),{'body':_0x382395});};exports[_0xd12f('0x27')]=function(_0x37a9fd){return request(_0xd12f('0x28'),{'body':_[_0xd12f('0x29')](_0x37a9fd,{'project_name':_0x37a9fd[_0xd12f('0x2a')],'prev_project_name':_0x37a9fd[_0xd12f('0x2b')]||'','is_subproject':_0x37a9fd[_0xd12f('0x2b')]?!![]:![],'leaveAt':moment()[_0xd12f('0x2c')](_0xd12f('0x2d'))})});};exports['createSquareRecording']=function(_0x184d13){return request('CreateSquareRecording',{'body':_0x184d13});};exports[_0xd12f('0x2e')]=function(_0x377a3b){return request('CreateSquareMessage',{'body':_0x377a3b});};exports[_0xd12f('0x2f')]=function(_0x59b166){return request(_0xd12f('0x30'),{'options':{'raw':![],'where':{'phone':_0x59b166[_0xd12f('0x19')],'ListId':_0x59b166[_0xd12f('0x31')]}}})[_0xd12f('0x6')](function(_0x594205){if(_0x594205){return _0x594205;}return request('CreateCmContact',{'body':_0x59b166});});};exports[_0xd12f('0x32')]=function(_0x527b33){return request(_0xd12f('0x33'),{'options':{'where':{'id':_0x527b33},'attributes':['name']}});};exports['agentLogin']=function(_0x5928a7,_0x5c8fec){return request(_0xd12f('0x34'),{'body':{'interface':_0x5c8fec},'options':{'where':_0x5928a7}});};exports['agentPause']=function(_0x1ea6e8,_0x3b5d90,_0x1de94d){return request('PauseUser',{'body':{'type':_0x3b5d90,'uniqueid':_0x1de94d},'options':{'where':_0x1ea6e8}});};exports[_0xd12f('0x35')]=function(_0x5eccf2){return request(_0xd12f('0x36'),{'body':{},'options':{'where':_0x5eccf2}});};exports['agentLogout']=function(_0x5db3b8){return request(_0xd12f('0x37'),{'body':{},'options':{'where':_0x5db3b8}});}; \ No newline at end of file +var _0xcb57=['production','ShowMailAccount','MailServerOut','Smtp','CloudProvider','name','email','getSquareProjectById','ShowSquareProject','getVoiceQueueById','getVariableById','getSquareOdbcById','getUserById','ShowUser','getContactByPhone','GetContactByPhone','phone','getTrunkById','ShowTrunk','ShowSound','save_name','Interval','Intervals','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','arg_2','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','ListId','CreateCmContact','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','agentLogout','lodash','moment','client','then','error','message','result','catch','getSquareProjects','GetSquareProjects'];(function(_0x1317d8,_0x85a4f0){var _0xb58c6f=function(_0x2f68c9){while(--_0x2f68c9){_0x1317d8['push'](_0x1317d8['shift']());}};_0xb58c6f(++_0x85a4f0);}(_0xcb57,0xa1));var _0x7cb5=function(_0x500419,_0x549162){_0x500419=_0x500419-0x0;var _0x241c1a=_0xcb57[_0x500419];return _0x241c1a;};'use strict';var _=require(_0x7cb5('0x0'));var moment=require(_0x7cb5('0x1'));var jayson=require('jayson/promise');var client=jayson[_0x7cb5('0x2')]['http']({'port':0x2329});function request(_0x2183e8,_0x53c185){return new Promise(function(_0x33e1e6,_0x1b1ef7){return client['request'](_0x2183e8,_0x53c185)[_0x7cb5('0x3')](function(_0x87b278){if(_0x87b278[_0x7cb5('0x4')]){return _0x1b1ef7(_0x87b278['error'][_0x7cb5('0x5')]);}else{return _0x33e1e6(_0x87b278[_0x7cb5('0x6')]);}})[_0x7cb5('0x7')](function(_0x715420){return _0x1b1ef7(_0x715420);});});}exports[_0x7cb5('0x8')]=function(){return request(_0x7cb5('0x9'),{'options':{'raw':![],'attributes':['id','name','production']}});};exports['getSquareProject']=function(_0x11bafa){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x11bafa},'attributes':[_0x7cb5('0xa')]}});};exports['getMailAccountById']=function(_0x132830){return request(_0x7cb5('0xb'),{'options':{'raw':![],'where':{'id':_0x132830},'include':[{'model':_0x7cb5('0xc'),'as':_0x7cb5('0xd'),'include':[{'model':_0x7cb5('0xe'),'as':_0x7cb5('0xe')}]}],'attributes':['id',_0x7cb5('0xf'),_0x7cb5('0x10')],'smtp':!![]}});};exports[_0x7cb5('0x11')]=function(_0xf96338){return request(_0x7cb5('0x12'),{'options':{'where':{'id':_0xf96338},'attributes':[_0x7cb5('0xf')]}});};exports[_0x7cb5('0x13')]=function(_0x3648cb){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x3648cb},'attributes':['name']}});};exports[_0x7cb5('0x14')]=function(_0x30ba6a){return request('ShowVariable',{'options':{'where':{'id':_0x30ba6a},'attributes':[_0x7cb5('0xf')]}});};exports[_0x7cb5('0x15')]=function(_0x238fb4){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x238fb4},'attributes':['dsn']}});};exports[_0x7cb5('0x16')]=function(_0x318afd){return request(_0x7cb5('0x17'),{'options':{'where':{'id':_0x318afd},'attributes':['name']}});};exports[_0x7cb5('0x18')]=function(_0x58e0ea){return request(_0x7cb5('0x19'),{'options':{'where':{'phone':_0x58e0ea[_0x7cb5('0x1a')]},'attributes':['id']}});};exports[_0x7cb5('0x1b')]=function(_0x2b58db){return request(_0x7cb5('0x1c'),{'options':{'where':{'id':_0x2b58db},'attributes':[_0x7cb5('0xf')]}});};exports['getSoundById']=function(_0x208277){return request(_0x7cb5('0x1d'),{'options':{'where':{'id':_0x208277},'attributes':[_0x7cb5('0x1e')]}});};exports['getIntervalById']=function(_0x1b5d35){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x1b5d35},'include':[{'model':_0x7cb5('0x1f'),'as':_0x7cb5('0x20')}]}});};exports['getSmsAccountById']=function(_0x3e0496){return request(_0x7cb5('0x21'),{'options':{'where':{'id':_0x3e0496},'attributes':['id',_0x7cb5('0xf')]}});};exports[_0x7cb5('0x22')]=function(_0x2c6846){return request(_0x7cb5('0x23'),{'body':_0x2c6846});};exports[_0x7cb5('0x24')]=function(_0x126dc6){return request(_0x7cb5('0x25'),{'body':_0x126dc6});};exports[_0x7cb5('0x26')]=function(_0x5c4fb1){return request(_0x7cb5('0x27'),{'body':_['merge'](_0x5c4fb1,{'project_name':_0x5c4fb1['arg_1'],'prev_project_name':_0x5c4fb1[_0x7cb5('0x28')]||'','is_subproject':_0x5c4fb1[_0x7cb5('0x28')]?!![]:![],'leaveAt':moment()['format'](_0x7cb5('0x29'))})});};exports[_0x7cb5('0x2a')]=function(_0x35fbf0){return request(_0x7cb5('0x2b'),{'body':_0x35fbf0});};exports[_0x7cb5('0x2c')]=function(_0x3c465b){return request(_0x7cb5('0x2d'),{'body':_0x3c465b});};exports[_0x7cb5('0x2e')]=function(_0x178f22){return request(_0x7cb5('0x2f'),{'options':{'raw':![],'where':{'phone':_0x178f22[_0x7cb5('0x1a')],'ListId':_0x178f22[_0x7cb5('0x30')]}}})[_0x7cb5('0x3')](function(_0x1388f4){if(_0x1388f4){return _0x1388f4;}return request(_0x7cb5('0x31'),{'body':_0x178f22});});};exports['getPauseById']=function(_0x33c3fc){return request(_0x7cb5('0x32'),{'options':{'where':{'id':_0x33c3fc},'attributes':[_0x7cb5('0xf')]}});};exports[_0x7cb5('0x33')]=function(_0x37cd36,_0x4b44fe){return request(_0x7cb5('0x34'),{'body':{'interface':_0x4b44fe},'options':{'where':_0x37cd36}});};exports[_0x7cb5('0x35')]=function(_0x2e2cb6,_0x3d2f72,_0x3f1589){return request(_0x7cb5('0x36'),{'body':{'type':_0x3d2f72,'uniqueid':_0x3f1589},'options':{'where':_0x2e2cb6}});};exports[_0x7cb5('0x37')]=function(_0x393207){return request('UnpauseUser',{'body':{},'options':{'where':_0x393207}});};exports[_0x7cb5('0x38')]=function(_0x2e3d2a){return request('LogoutUser',{'body':{},'options':{'where':_0x2e3d2a}});}; \ 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 05a8373..00ca9cf 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 _0x9e2e=['exports','./polly','./lex'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x9e2e,0xd6));var _0xe9e2=function(_0x52a09e,_0x1c070a){_0x52a09e=_0x52a09e-0x0;var _0x1a8735=_0x9e2e[_0x52a09e];return _0x1a8735;};var polly=require(_0xe9e2('0x0'));var lex=require(_0xe9e2('0x1'));module[_0xe9e2('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x6596=['./lex','./polly'];(function(_0xe56909,_0x486697){var _0x1c0f27=function(_0x2415a5){while(--_0x2415a5){_0xe56909['push'](_0xe56909['shift']());}};_0x1c0f27(++_0x486697);}(_0x6596,0x1d3));var _0x6659=function(_0x51cc85,_0x4ff949){_0x51cc85=_0x51cc85-0x0;var _0x9f7d67=_0x6596[_0x51cc85];return _0x9f7d67;};var polly=require(_0x6659('0x0'));var lex=require(_0x6659('0x1'));module['exports']={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index c12b63d..5321dd2 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 _0x96cc=['./lib/api'];(function(_0x4898ec,_0x40865b){var _0x17935d=function(_0x4bfe0f){while(--_0x4bfe0f){_0x4898ec['push'](_0x4898ec['shift']());}};_0x17935d(++_0x40865b);}(_0x96cc,0x16c));var _0xc96c=function(_0x2bece8,_0x27c181){_0x2bece8=_0x2bece8-0x0;var _0xc01f33=_0x96cc[_0x2bece8];return _0xc01f33;};'use strict';var lex=require(_0xc96c('0x0'));module['exports']=function(_0x15025f,_0x5f11f2,_0x30bf8a,_0x3e7a95,_0x107043,_0x421701){return lex(_0x15025f,_0x5f11f2,_0x30bf8a,_0x3e7a95,_0x107043,_0x421701);}; \ No newline at end of file +var _0x9354=['exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9354,0x96));var _0x4935=function(_0x47604d,_0x15a014){_0x47604d=_0x47604d-0x0;var _0x388e4c=_0x9354[_0x47604d];return _0x388e4c;};'use strict';var lex=require('./lib/api');module[_0x4935('0x0')]=function(_0xc3c1f3,_0x4896da,_0x263dd5,_0x2a4993,_0x29d1eb,_0x280bbc){return lex(_0xc3c1f3,_0x4896da,_0x263dd5,_0x2a4993,_0x29d1eb,_0x280bbc);}; \ 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 c68ab33..2850272 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(_0xd86277,_0x406771){var _0x51110e=function(_0x4b0bc9){while(--_0x4b0bc9){_0xd86277['push'](_0xd86277['shift']());}};_0x51110e(++_0x406771);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'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(_0x263c0d,_0x1a0b9a){var _0x384068=function(_0x143eb5){while(--_0x143eb5){_0x263c0d['push'](_0x263c0d['shift']());}};_0x384068(++_0x1a0b9a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'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 1b9af61..2311304 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 _0xfd73=['./lib/api','exports'];(function(_0x15f8ad,_0x5275c3){var _0xc0238a=function(_0x5550c8){while(--_0x5550c8){_0x15f8ad['push'](_0x15f8ad['shift']());}};_0xc0238a(++_0x5275c3);}(_0xfd73,0x170));var _0x3fd7=function(_0x21f0ef,_0x44925c){_0x21f0ef=_0x21f0ef-0x0;var _0x38e784=_0xfd73[_0x21f0ef];return _0x38e784;};'use strict';var polly=require(_0x3fd7('0x0'));module[_0x3fd7('0x1')]=function(_0x3ca878,_0x164705,_0x13d19c,_0x18b9ca,_0x1ca822,_0x351f12,_0xf9915c){return polly(_0x3ca878,_0x164705,_0x13d19c,_0x18b9ca,_0x1ca822,_0x351f12,_0xf9915c);}; \ No newline at end of file +var _0xc811=['exports','./lib/api'];(function(_0x3f619d,_0x4762c5){var _0x1eb364=function(_0x407268){while(--_0x407268){_0x3f619d['push'](_0x3f619d['shift']());}};_0x1eb364(++_0x4762c5);}(_0xc811,0x113));var _0x1c81=function(_0x5e4ff1,_0x58dde1){_0x5e4ff1=_0x5e4ff1-0x0;var _0xd464f=_0xc811[_0x5e4ff1];return _0xd464f;};'use strict';var polly=require(_0x1c81('0x0'));module[_0x1c81('0x1')]=function(_0x260ded,_0x3427ee,_0x5ac7c3,_0x368347,_0x3ecd29,_0xf0f3fd,_0x7263a4){return polly(_0x260ded,_0x3427ee,_0x5ac7c3,_0x368347,_0x3ecd29,_0xf0f3fd,_0x7263a4);}; \ 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 19db313..39938f7 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 _0x6f10=['exports','mp3','bluebird','aws-sdk','synthesizeSpeech','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x6f10,0x1ad));var _0x06f1=function(_0xbca141,_0x221e43){_0xbca141=_0xbca141-0x0;var _0x21055b=_0x6f10[_0xbca141];return _0x21055b;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0x06f1('0x0'));var rs=require('randomstring');var AWS=require(_0x06f1('0x1'));function pollyResult(_0x4fa4bb,_0x49d89e,_0x30f290){return new BPromise(function(_0x52cb37,_0x1ce027){_0x4fa4bb[_0x06f1('0x2')](_0x49d89e,function(_0x2ce796,_0x4d5af5){if(_0x2ce796){_0x1ce027(_0x2ce796);}else if(_0x4d5af5){if(_0x4d5af5[_0x06f1('0x3')]instanceof Buffer){fs['writeFile'](_0x30f290,_0x4d5af5[_0x06f1('0x3')],function(_0x2609c3){if(_0x2609c3){_0x1ce027(_0x2609c3);}else{_0x52cb37();}});}else{_0x1ce027(new Error(_0x06f1('0x4')));}}else{_0x1ce027(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0x06f1('0x5')]=function(_0x462dc2,_0x5e5db2,_0x296e6b,_0x86194f,_0x5daad,_0x4848f1,_0xe32c4d){var _0x549f6c=new AWS['Polly']({'accessKeyId':_0x462dc2,'secretAccessKey':_0x5e5db2,'region':_0x296e6b});var _0x537612={'Text':_0x5daad,'TextType':_0x4848f1||'text','OutputFormat':_0x06f1('0x6'),'VoiceId':_0x86194f};return pollyResult(_0x549f6c,_0x537612,_0xe32c4d);}; \ No newline at end of file +var _0x0f85=['No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','mp3','path','randomstring','aws-sdk','writeFile'];(function(_0x2d4694,_0x237ea3){var _0x2ead5a=function(_0x553230){while(--_0x553230){_0x2d4694['push'](_0x2d4694['shift']());}};_0x2ead5a(++_0x237ea3);}(_0x0f85,0x194));var _0x50f8=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x0f85[_0x57b54c];return _0x59cc19;};'use strict';var fs=require('fs');var path=require(_0x50f8('0x0'));var BPromise=require('bluebird');var rs=require(_0x50f8('0x1'));var AWS=require(_0x50f8('0x2'));function pollyResult(_0x52d3a8,_0x2ccdef,_0x514a1a){return new BPromise(function(_0x52032a,_0x717223){_0x52d3a8['synthesizeSpeech'](_0x2ccdef,function(_0x24f097,_0x4b0298){if(_0x24f097){_0x717223(_0x24f097);}else if(_0x4b0298){if(_0x4b0298['AudioStream']instanceof Buffer){fs[_0x50f8('0x3')](_0x514a1a,_0x4b0298['AudioStream'],function(_0x59a0a9){if(_0x59a0a9){_0x717223(_0x59a0a9);}else{_0x52032a();}});}else{_0x717223(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x717223(new Error(_0x50f8('0x4')));}});});}module[_0x50f8('0x5')]=function(_0x3868b3,_0x1e9ed8,_0x15d318,_0x3590e6,_0xd36495,_0x1c5750,_0x3bfd8b){var _0x560068=new AWS[(_0x50f8('0x6'))]({'accessKeyId':_0x3868b3,'secretAccessKey':_0x1e9ed8,'region':_0x15d318});var _0x5b6502={'Text':_0xd36495,'TextType':_0x1c5750||'text','OutputFormat':_0x50f8('0x7'),'VoiceId':_0x3590e6};return pollyResult(_0x560068,_0x5b6502,_0x3bfd8b);}; \ 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 7252137..012f076 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 _0x3988=['exports'];(function(_0x3c81b5,_0x3f5ed7){var _0x5888c4=function(_0x4e65b0){while(--_0x4e65b0){_0x3c81b5['push'](_0x3c81b5['shift']());}};_0x5888c4(++_0x3f5ed7);}(_0x3988,0x1b1));var _0x8398=function(_0x43d51e,_0x4421c9){_0x43d51e=_0x43d51e-0x0;var _0x5d5c62=_0x3988[_0x43d51e];return _0x5d5c62;};'use strict';var asr=require('./lib/api');module[_0x8398('0x0')]=function(_0x58f188,_0x28dfcb,_0x5b235f,_0x24331c){return asr(_0x58f188,_0x28dfcb,_0x5b235f);}; \ No newline at end of file +var _0x0258=['./lib/api','exports'];(function(_0x19a6c6,_0x486db5){var _0x4e9c66=function(_0x1ac969){while(--_0x1ac969){_0x19a6c6['push'](_0x19a6c6['shift']());}};_0x4e9c66(++_0x486db5);}(_0x0258,0x94));var _0x8025=function(_0x506c94,_0x1825c6){_0x506c94=_0x506c94-0x0;var _0x2d05ca=_0x0258[_0x506c94];return _0x2d05ca;};'use strict';var asr=require(_0x8025('0x0'));module[_0x8025('0x1')]=function(_0x5e90f8,_0x1e3bb5,_0x2361b0,_0x59cc09){return asr(_0x5e90f8,_0x1e3bb5,_0x2361b0);}; \ 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 c3b4fe7..dd4d3e0 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 _0xad36=['POST','/v1/speech:recognize?key=','LINEAR16','8000','bluebird','https://speech.googleapis.com','exports','length','filepath\x20should\x20be\x20a\x20string','string','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0xad36,0x11c));var _0x6ad3=function(_0x216f0d,_0x2a3a25){_0x216f0d=_0x216f0d-0x0;var _0x4b6b57=_0xad36[_0x216f0d];return _0x4b6b57;};'use strict';var url=require('url');var BPromise=require(_0x6ad3('0x0'));var fs=require('fs');var host=_0x6ad3('0x1');module[_0x6ad3('0x2')]=function(_0x1164e0,_0x32fb2f,_0x35a0ee){return new BPromise(function(_0xef54ab,_0x17a9b2){var _0x3d8fee;if(typeof _0x1164e0!=='string'||_0x1164e0[_0x6ad3('0x3')]===0x0){return _0x17a9b2(_0x6ad3('0x4'));}if(typeof _0x32fb2f!==_0x6ad3('0x5')||_0x32fb2f[_0x6ad3('0x3')]===0x0){return _0x17a9b2('key\x20should\x20be\x20a\x20string');}if(typeof _0x35a0ee!=='undefined'&&(typeof _0x35a0ee!=='string'||_0x35a0ee['length']===0x0)){return _0x17a9b2(_0x6ad3('0x6'));}try{_0x3d8fee=fs[_0x6ad3('0x7')](_0x1164e0)[_0x6ad3('0x8')](_0x6ad3('0x9'));}catch(_0x236745){return _0x17a9b2(_0x236745);}return _0xef54ab({'method':_0x6ad3('0xa'),'uri':host+_0x6ad3('0xb')+_0x32fb2f,'body':{'config':{'encoding':_0x6ad3('0xc'),'sampleRateHertz':_0x6ad3('0xd'),'languageCode':_0x35a0ee},'audio':{'content':_0x3d8fee}},'json':!![]});});}; \ No newline at end of file +var _0xe57e=['key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','POST','/v1/speech:recognize?key=','LINEAR16','8000','url','https://speech.googleapis.com','exports','string','length'];(function(_0x3dedcf,_0x299499){var _0x1f5a9f=function(_0x290f4e){while(--_0x290f4e){_0x3dedcf['push'](_0x3dedcf['shift']());}};_0x1f5a9f(++_0x299499);}(_0xe57e,0xf2));var _0xee57=function(_0x365c0f,_0x567f2){_0x365c0f=_0x365c0f-0x0;var _0x8a56c2=_0xe57e[_0x365c0f];return _0x8a56c2;};'use strict';var url=require(_0xee57('0x0'));var BPromise=require('bluebird');var fs=require('fs');var host=_0xee57('0x1');module[_0xee57('0x2')]=function(_0x336aaa,_0x59bb30,_0x5e53cc){return new BPromise(function(_0x2dbc91,_0x544e4a){var _0x2d975b;if(typeof _0x336aaa!==_0xee57('0x3')||_0x336aaa[_0xee57('0x4')]===0x0){return _0x544e4a('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x59bb30!=='string'||_0x59bb30[_0xee57('0x4')]===0x0){return _0x544e4a(_0xee57('0x5'));}if(typeof _0x5e53cc!==_0xee57('0x6')&&(typeof _0x5e53cc!==_0xee57('0x3')||_0x5e53cc[_0xee57('0x4')]===0x0)){return _0x544e4a(_0xee57('0x7'));}try{_0x2d975b=fs[_0xee57('0x8')](_0x336aaa)['toString']('base64');}catch(_0x195956){return _0x544e4a(_0x195956);}return _0x2dbc91({'method':_0xee57('0x9'),'uri':host+_0xee57('0xa')+_0x59bb30,'body':{'config':{'encoding':_0xee57('0xb'),'sampleRateHertz':_0xee57('0xc'),'languageCode':_0x5e53cc},'audio':{'content':_0x2d975b}},'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 4b067b7..10cb4be 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 _0xfcb8=['./asr'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0xfcb8,0xfc));var _0x8fcb=function(_0x317e30,_0x32ad66){_0x317e30=_0x317e30-0x0;var _0x203788=_0xfcb8[_0x317e30];return _0x203788;};var asr=require(_0x8fcb('0x0'));module['exports']={'asr':asr}; \ No newline at end of file +var asr=require('./asr');module['exports']={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/scripts/index.js b/server/services/agi/scripts/index.js index ff385cc..c23975f 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 _0xb36c=['MP3','POST','from','audioContent','writeFile','googleCloudTTS\x20path','utf8','application/x-www-form-urlencoded','f.req=','stringify','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','.mp3','asr','results','alternatives','transcript','join','map','confidence','googleASR\x20transcription','googleASR\x20confidence','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','result','source','resolvedQuery','action','actionIncomplete','speech','score','status','code','metadata','endConversation','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','detectIntent','queryResult','allRequiredParamsPresent','fields','diagnosticInfo','end_conversation','fulfillmentText','intent','languageCode','queryText','responseId','Tilde\x20ASR\x20transcription','awsPolly','polly','awsLex','lex','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','format','model=%s','freeform=3','sestekNDA','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','bluebird','dialogflow','https','md5','path','querystring','request-promise','randomstring','google-tts-api','url','parse','./google','./tilde','../../../config/logger','https://api.ispeech.org/api/rest','https:','host','WHAT_EVER','get','statusCode','error','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','finish\x20download\x20file','close','unlink','download\x20error','pipe','protocol','request\x20to\x20','data','end','transcode','error\x20convert','info','start','resolve','tmp','generate','.wav','writeFileSync','base64','then','chmodSync','777','split','readFileSync','toString','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig'];(function(_0x2113b8,_0x5c1503){var _0x458be1=function(_0x5e3399){while(--_0x5e3399){_0x2113b8['push'](_0x2113b8['shift']());}};_0x458be1(++_0x5c1503);}(_0xb36c,0x154));var _0xcb36=function(_0x26c03b,_0x46fe19){_0x26c03b=_0x26c03b-0x0;var _0x5d4afb=_0xb36c[_0x26c03b];return _0x5d4afb;};'use strict';var apiai=require('apiai-promise');var BPromise=require(_0xcb36('0x0'));var dialogflow=require(_0xcb36('0x1'));var fs=require('fs');var http=require('http');var https=require(_0xcb36('0x2'));var md5=require(_0xcb36('0x3'));var path=require(_0xcb36('0x4'));var querystring=require(_0xcb36('0x5'));var rp=require(_0xcb36('0x6'));var rs=require(_0xcb36('0x7'));var sox=require('sox');var tts=require(_0xcb36('0x8'));var urlParse=require(_0xcb36('0x9'))[_0xcb36('0xa')];var util=require('util');var aws=require('./aws');var google=require(_0xcb36('0xb'));var sestek=require('./sestek');var tilde=require(_0xcb36('0xc'));var logger=require(_0xcb36('0xd'))('agi');var ISPEECH_API=_0xcb36('0xe');function downloadFile(_0x85303b,_0x40dc66){return new BPromise(function(_0x3a7df5,_0x36478c){var _0x2a7db2=urlParse(_0x85303b);var _0x3c0ff4=_0x2a7db2['protocol']===_0xcb36('0xf')?https:http;var _0x2a8246={'host':_0x2a7db2[_0xcb36('0x10')],'path':_0x2a7db2[_0xcb36('0x4')],'headers':{'user-agent':_0xcb36('0x11')}};_0x3c0ff4[_0xcb36('0x12')](_0x2a8246,function(_0x2c5ff0){if(_0x2c5ff0[_0xcb36('0x13')]!==0xc8){logger[_0xcb36('0x14')]('request\x20to\x20'+_0x85303b+_0xcb36('0x15')+_0x2c5ff0[_0xcb36('0x13')]+'\x20('+_0x2c5ff0[_0xcb36('0x16')]+')');_0x36478c(new Error('request\x20to\x20'+_0x85303b+_0xcb36('0x15')+_0x2c5ff0['statusCode']+'\x20('+_0x2c5ff0[_0xcb36('0x16')]+')'));return;}var _0x11c914=fs[_0xcb36('0x17')](_0x40dc66);_0x11c914['on'](_0xcb36('0x18'),function(){logger['info'](_0xcb36('0x19'));_0x11c914[_0xcb36('0x1a')](_0x3a7df5);});_0x11c914['on'](_0xcb36('0x14'),function(_0x31c67c){fs[_0xcb36('0x1b')](_0x40dc66);logger[_0xcb36('0x14')](_0xcb36('0x1c'),_0x31c67c);_0x36478c(_0x31c67c);});_0x2c5ff0[_0xcb36('0x1d')](_0x11c914);})['on'](_0xcb36('0x14'),function(_0xe32b2){logger[_0xcb36('0x14')](_0xe32b2);_0x36478c(_0xe32b2);})['end']();});}function uploadFile(_0x3880a7){return new BPromise(function(_0x287304,_0x3ece6c){var _0x210d56=urlParse(_0x3880a7);var _0x2088e4=_0x210d56[_0xcb36('0x1e')]===_0xcb36('0xf')?https:http;var _0x521814={'host':_0x210d56[_0xcb36('0x10')],'path':_0x210d56['path'],'headers':{'user-agent':_0xcb36('0x11')}};_0x2088e4[_0xcb36('0x12')](_0x521814,function(_0xb13250){if(_0xb13250[_0xcb36('0x13')]!==0xc8){_0x3ece6c(new Error(_0xcb36('0x1f')+_0x3880a7+'\x20failed,\x20status\x20code\x20=\x20'+_0xb13250[_0xcb36('0x13')]+'\x20('+_0xb13250[_0xcb36('0x16')]+')'));return;}var _0x5e3930='';_0xb13250['on'](_0xcb36('0x20'),function(_0x12ba30){_0x5e3930+=_0x12ba30;});_0xb13250['on'](_0xcb36('0x21'),function(){_0x287304(_0x5e3930);});})['on'](_0xcb36('0x14'),function(_0x1eed98){_0x3ece6c(_0x1eed98);})['end']();});}function convertFile(_0x272b76,_0x42b9a2){return new BPromise(function(_0x27b810,_0x287adf){var _0x2503ed=sox[_0xcb36('0x22')](_0x272b76,_0x42b9a2,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x2503ed['on']('error',function(_0x4db7f4){logger[_0xcb36('0x14')](_0xcb36('0x23'),_0x4db7f4);_0x287adf(_0x4db7f4);});_0x2503ed['on'](_0xcb36('0x21'),function(){logger[_0xcb36('0x24')]('finish\x20to\x20convert');_0x27b810();});_0x2503ed[_0xcb36('0x25')]();});}function base64Decode(_0x142a07,_0x24d52e){var _0x3d1c2e=path[_0xcb36('0x26')](__dirname,_0xcb36('0x27'),rs[_0xcb36('0x28')](0x4)+_0xcb36('0x29'));fs[_0xcb36('0x2a')](_0x3d1c2e,_0x142a07,_0xcb36('0x2b'));return convertFile(_0x3d1c2e,_0x24d52e)[_0xcb36('0x2c')](function(){try{fs[_0xcb36('0x1b')](_0x3d1c2e);fs[_0xcb36('0x2d')](_0x24d52e,_0xcb36('0x2e'));}catch(_0x590841){logger[_0xcb36('0x14')](_0x590841);}return _0x24d52e[_0xcb36('0x2f')]('.')[0x0];});}function base64Encode(_0x2df455){var _0x4de2f8=fs[_0xcb36('0x30')](_0x2df455);return new Buffer(_0x4de2f8)[_0xcb36('0x31')](_0xcb36('0x2b'));}exports['googleCloudTTS']=function(_0x6165e,_0x4a1bf1,_0x28907,_0x2feb61,_0x4c5a6b,_0x1d8f77){var _0x49b605,_0xf473b0;var _0x4fd0b4=_0xcb36('0x32');var _0x3b8b70=_0xcb36('0x33')+_0x6165e;var _0x4cd7df={};if(_0x4a1bf1===_0xcb36('0x34')){_0x4cd7df[_0xcb36('0x35')]={'ssml':_0x28907};}else{_0x4cd7df[_0xcb36('0x35')]={'text':_0x28907};};_0x4cd7df[_0xcb36('0x36')]={'languageCode':_0x2feb61,'ssmlGender':_0x4c5a6b};_0x4cd7df[_0xcb36('0x37')]={'audioEncoding':_0xcb36('0x38'),'sampleRateHertz':0x1f40};var _0x31bc7c={'url':_0x4fd0b4+'text:synthesize'+_0x3b8b70,'method':_0xcb36('0x39'),'json':!![],'body':_0x4cd7df};return rp(_0x31bc7c)[_0xcb36('0x2c')](function(_0x34d965){return new BPromise(function(_0x38859b,_0xbbaa50){_0x49b605=path[_0xcb36('0x26')](__dirname,_0xcb36('0x27'),rs['generate'](0x4)+'.mp3');var _0x5a7b9d=Buffer[_0xcb36('0x3a')](_0x34d965[_0xcb36('0x3b')],_0xcb36('0x2b'));return fs[_0xcb36('0x3c')](_0x49b605,_0x5a7b9d,function(_0x40c649){_0xbbaa50(_0x40c649);},function(_0x129ed4){fs[_0xcb36('0x2d')](_0x49b605,_0xcb36('0x2e'));_0x38859b(_0x129ed4);});});})[_0xcb36('0x2c')](function(_0x1f6f93){_0xf473b0=path[_0xcb36('0x26')](__dirname,_0xcb36('0x27'),rs[_0xcb36('0x28')](0x4)+'.wav');return convertFile(_0x49b605,_0xf473b0);})[_0xcb36('0x2c')](function(){try{fs[_0xcb36('0x1b')](_0x49b605);fs[_0xcb36('0x2d')](_0xf473b0,_0xcb36('0x2e'));}catch(_0xb9fe93){logger['error'](_0xb9fe93);}logger[_0xcb36('0x24')](_0xcb36('0x3d'),_0xf473b0['split']('.')[0x0]);return _0xf473b0[_0xcb36('0x2f')]('.')[0x0];});};exports['googleTTS']=function(_0x4c165b,_0x1e0673){var _0x833f20='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x19b299,_0x27881e;var _0x54ad74;var _0x2331f0={'encoding':_0xcb36('0x3e'),'method':_0xcb36('0x39'),'timeout':0x2710,'url':_0x833f20,'headers':{'Content-Type':_0xcb36('0x3f')},'body':_0xcb36('0x40')+encodeURIComponent(JSON[_0xcb36('0x41')]([[['jQ1olc',JSON[_0xcb36('0x41')]([_0x4c165b,_0x1e0673||'en',![],'null']),null,'generic']]]))};return rp(_0x2331f0)['then'](function(_0x14a71b){try{_0x54ad74=eval(_0x14a71b[_0xcb36('0x42')](0x5))[0x0][0x2];}catch(_0x5f2c7a){throw new Error(_0xcb36('0x43')+_0x14a71b[_0xcb36('0x20')]);}if(!_0x54ad74){if(_0x4c165b[_0xcb36('0x44')]>0xc8){throw new Error(_0xcb36('0x45'));}else{throw new Error(_0xcb36('0x46')+_0x1e0673+_0xcb36('0x47'));}}try{_0x54ad74=eval(_0x54ad74)[0x0];}catch(_0x53bdff){throw new Error(_0xcb36('0x43')+res['data']);}const _0x1ecd93=_0x54ad74;_0x19b299=path[_0xcb36('0x26')](__dirname,_0xcb36('0x27'),rs[_0xcb36('0x28')](0x4)+_0xcb36('0x48'));fs[_0xcb36('0x2a')](_0x19b299,_0x54ad74,{'encoding':'base64'});_0x27881e=path['resolve'](__dirname,_0xcb36('0x27'),rs['generate'](0x4)+'.wav');return convertFile(_0x19b299,_0x27881e);})['then'](function(){try{fs[_0xcb36('0x1b')](_0x19b299);fs[_0xcb36('0x2d')](_0x27881e,_0xcb36('0x2e'));}catch(_0xbf29af){logger['error'](_0xbf29af);}logger[_0xcb36('0x24')]('goggleTTS\x20path',_0x27881e[_0xcb36('0x2f')]('.')[0x0]);return _0x27881e[_0xcb36('0x2f')]('.')[0x0];});};exports['googleASR']=function(_0x47c184,_0x16db46,_0x4ec8be){return google[_0xcb36('0x49')](_0x47c184,_0x16db46,_0x4ec8be)[_0xcb36('0x2c')](function(_0x279d0e){logger[_0xcb36('0x24')](_0x279d0e['uri']);return rp(_0x279d0e);})[_0xcb36('0x2c')](function(_0x538fc8){var _0x358b35='';var _0x21da37=0x0;try{fs[_0xcb36('0x1b')](_0x47c184);}catch(_0xba8ab9){logger['error'](_0xba8ab9);}if(_0x538fc8&&_0x538fc8[_0xcb36('0x4a')]){_0x358b35=_0x538fc8[_0xcb36('0x4a')]['map'](function(_0x107081){return _0x107081&&_0x107081['alternatives'][0x0]&&_0x107081[_0xcb36('0x4b')][0x0][_0xcb36('0x4c')]?_0x107081[_0xcb36('0x4b')][0x0][_0xcb36('0x4c')]:'';})[_0xcb36('0x4d')]('\x0a');_0x21da37=_0x538fc8[_0xcb36('0x4a')][_0xcb36('0x4e')](function(_0x161560){return _0x161560&&_0x161560[_0xcb36('0x4b')][0x0]&&_0x161560[_0xcb36('0x4b')][0x0][_0xcb36('0x4f')]?_0x161560[_0xcb36('0x4b')][0x0]['confidence']:0x0;})[_0xcb36('0x4d')]('\x0a');}logger[_0xcb36('0x24')](_0xcb36('0x50'),_0x358b35);logger[_0xcb36('0x24')](_0xcb36('0x51'),_0x21da37);return{'transcript':_0x358b35,'confidence':_0x21da37};})['catch'](function(_0x110440){logger['error'](_0xcb36('0x52'),_0x110440['statusCode'],_0x110440[_0xcb36('0x53')],_0x110440[_0xcb36('0x54')]);});};exports[_0xcb36('0x55')]=function(_0x1370e5,_0x24d93f,_0x214df1,_0x4efc7d){var _0x576836=apiai(_0x24d93f,{'language':_0x4efc7d||'en'});return _0x576836[_0xcb36('0x56')](_0x214df1,{'sessionId':md5(_0x1370e5)})[_0xcb36('0x2c')](function(_0x14e609){logger[_0xcb36('0x24')](JSON[_0xcb36('0x41')](_0x14e609));return{'source':_0x14e609[_0xcb36('0x57')][_0xcb36('0x58')],'resolvedQuery':_0x14e609[_0xcb36('0x57')][_0xcb36('0x59')],'action':_0x14e609[_0xcb36('0x57')][_0xcb36('0x5a')],'actionIncomplete':_0x14e609[_0xcb36('0x57')][_0xcb36('0x5b')],'speech':_0x14e609[_0xcb36('0x57')]['fulfillment'][_0xcb36('0x5c')],'score':_0x14e609[_0xcb36('0x57')][_0xcb36('0x5d')],'statusCode':_0x14e609[_0xcb36('0x5e')][_0xcb36('0x5f')],'endConversation':_0x14e609[_0xcb36('0x57')][_0xcb36('0x60')][_0xcb36('0x61')]||![],'isFallbackIntent':_0x14e609['result'][_0xcb36('0x60')][_0xcb36('0x62')]};});};exports[_0xcb36('0x63')]=function(_0x45b0a4,_0x35b50d,_0x20c0f0,_0x163025,_0x9c6e5e,_0x3f6b73){var _0x22ea39=_0x163025[_0xcb36('0x64')](/\\n/g,'\x0a');var _0x378e0a={'credentials':{'private_key':_0x22ea39,'client_email':_0x20c0f0}};var _0x223fb9=new dialogflow[(_0xcb36('0x65'))](_0x378e0a);var _0x59df1d=_0x223fb9['sessionPath'](_0x35b50d,md5(_0x45b0a4));var _0x2d89cb={'session':_0x59df1d,'queryInput':{'text':{'text':_0x9c6e5e,'languageCode':_0x3f6b73}}};return _0x223fb9[_0xcb36('0x66')](_0x2d89cb)[_0xcb36('0x2c')](function(_0x4a140a){if(_0x4a140a&&_0x4a140a['length']){logger[_0xcb36('0x24')]('Dialogflow\x20V2\x20response:',JSON[_0xcb36('0x41')](_0x4a140a));var _0x2f6af6=_0x4a140a[0x0];if(_0x2f6af6){var _0x1dd8c2={'action':_0x2f6af6[_0xcb36('0x67')][_0xcb36('0x5a')],'allRequiredParamsPresent':_0x2f6af6[_0xcb36('0x67')][_0xcb36('0x68')],'endConversation':_0x2f6af6[_0xcb36('0x67')]['diagnosticInfo']&&_0x2f6af6[_0xcb36('0x67')]['diagnosticInfo'][_0xcb36('0x69')]?_0x2f6af6[_0xcb36('0x67')][_0xcb36('0x6a')][_0xcb36('0x69')][_0xcb36('0x6b')]['boolValue']:![],'fulfillmentText':_0x2f6af6[_0xcb36('0x67')][_0xcb36('0x6c')],'intentName':_0x2f6af6[_0xcb36('0x67')][_0xcb36('0x6d')][_0xcb36('0x53')],'intentDisplayName':_0x2f6af6['queryResult'][_0xcb36('0x6d')]['displayName'],'isFallbackIntent':_0x2f6af6[_0xcb36('0x67')][_0xcb36('0x6d')]['isFallback'],'languageCode':_0x2f6af6['queryResult'][_0xcb36('0x6e')],'queryText':_0x2f6af6['queryResult'][_0xcb36('0x6f')],'responseId':_0x2f6af6[_0xcb36('0x70')],'score':_0x2f6af6[_0xcb36('0x67')]['intentDetectionConfidence'],'speech':_0x2f6af6[_0xcb36('0x67')][_0xcb36('0x6c')],'providerResponse':JSON['stringify'](_0x4a140a)};return _0x1dd8c2;}}});};exports['tildeASR']=function(_0x3fbd76,_0x37b638,_0x4af8a,_0x456f67){return tilde[_0xcb36('0x49')](_0x3fbd76,_0x37b638,_0x4af8a,_0x456f67)[_0xcb36('0x2c')](function(_0x568cb0){try{fs[_0xcb36('0x1b')](_0x3fbd76);}catch(_0x5f5791){logger[_0xcb36('0x14')](_0x5f5791);}logger[_0xcb36('0x24')](_0xcb36('0x71'),_0x568cb0[_0xcb36('0x4c')]);logger[_0xcb36('0x24')]('Tilde\x20ASR\x20confidence',_0x568cb0[_0xcb36('0x4f')]);return _0x568cb0;});};exports[_0xcb36('0x72')]=function(_0x1b886c,_0x1d36e3,_0x1ad92f,_0xb78f47,_0x3fd508,_0x36366b){var _0x547a16=path[_0xcb36('0x26')](__dirname,_0xcb36('0x27'),rs[_0xcb36('0x28')](0x4)+'.mp3');var _0x83abb0;return aws[_0xcb36('0x73')](_0x1b886c,_0x1d36e3,_0x1ad92f,_0xb78f47,_0x3fd508,_0x36366b,_0x547a16)[_0xcb36('0x2c')](function(){_0x83abb0=path[_0xcb36('0x26')](__dirname,_0xcb36('0x27'),rs[_0xcb36('0x28')](0x4)+_0xcb36('0x29'));return convertFile(_0x547a16,_0x83abb0);})[_0xcb36('0x2c')](function(){try{fs['unlink'](_0x547a16);fs[_0xcb36('0x2d')](_0x83abb0,'777');}catch(_0x1134c9){logger[_0xcb36('0x14')](_0x1134c9);}return _0x83abb0[_0xcb36('0x2f')]('.')[0x0];});};exports[_0xcb36('0x74')]=function(_0x462306,_0x394c27,_0x4c96d9,_0x596e10,_0x80eefe,_0x1bd7d){return aws[_0xcb36('0x75')](_0x462306,_0x394c27,_0x4c96d9,_0x596e10,_0x80eefe,_0x1bd7d)[_0xcb36('0x2c')](function(_0x23d6ca){logger['info'](JSON[_0xcb36('0x41')](_0x23d6ca));return _0x23d6ca;});};exports['ispeechTTS']=function(_0x56f504,_0x3a6026,_0x3c673f,_0x21a598){var _0x30ab64=util['format'](_0xcb36('0x76'),ISPEECH_API,_0x56f504,encodeURIComponent(_0x3a6026),_0x3c673f,_0x21a598);var _0x54d298=path[_0xcb36('0x26')](__dirname,_0xcb36('0x27'),rs[_0xcb36('0x28')](0x4)+_0xcb36('0x48'));var _0x454100;return downloadFile(_0x30ab64,_0x54d298)['then'](function(){_0x454100=path['resolve'](__dirname,_0xcb36('0x27'),rs[_0xcb36('0x28')](0x4)+_0xcb36('0x29'));return convertFile(_0x54d298,_0x454100);})[_0xcb36('0x2c')](function(){try{fs[_0xcb36('0x1b')](_0x54d298);fs[_0xcb36('0x2d')](_0x454100,'777');}catch(_0x3114d1){logger[_0xcb36('0x14')](_0x3114d1);}return _0x454100[_0xcb36('0x2f')]('.')[0x0];});};exports[_0xcb36('0x77')]=function(_0x2d99ab,_0x4f2357,_0x4f6bca,_0xbfc29b){var _0x707b4d=util[_0xcb36('0x78')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x4f2357,_0x4f6bca,base64Encode(_0x2d99ab),_0xbfc29b?util[_0xcb36('0x78')](_0xcb36('0x79'),encodeURIComponent(_0xbfc29b)):_0xcb36('0x7a'));return uploadFile(_0x707b4d)[_0xcb36('0x2c')](function(_0x130c60){return querystring[_0xcb36('0xa')](_0x130c60);});};exports[_0xcb36('0x7b')]=function(_0x1c2c0b,_0x2e9500){return sestek['nda'](_0x1c2c0b,_0x2e9500)[_0xcb36('0x2c')](function(_0x2e8881){logger['info'](JSON[_0xcb36('0x41')](_0x2e8881));var _0x2146e7={'speech':_0x2e8881[_0xcb36('0x7c')],'action':_0x2e8881[_0xcb36('0x7d')]?_0x2e8881[_0xcb36('0x7d')][_0xcb36('0x7e')]:undefined,'actiondata':_0x2e8881['channelData']?_0x2e8881[_0xcb36('0x7d')][_0xcb36('0x7f')]:undefined};if(_0x2e8881[_0xcb36('0x7d')]&&_0x2e8881[_0xcb36('0x7d')][_0xcb36('0x80')]){return base64Decode(_0x2e8881['channelData'][_0xcb36('0x80')][_0xcb36('0x81')],path[_0xcb36('0x26')](__dirname,_0xcb36('0x27'),rs[_0xcb36('0x28')](0x4)+_0xcb36('0x29')))[_0xcb36('0x2c')](function(_0x3287a7){_0x2146e7[_0xcb36('0x82')]=_0x3287a7;return _0x2146e7;});}return _0x2146e7;});};exports[_0xcb36('0x83')]=function(){return __dirname;}; \ No newline at end of file +var _0x066b=['googleASR\x20transcription','googleASR\x20confidence','catch','googleDialogflow','source','resolvedQuery','result','action','actionIncomplete','fulfillment','speech','score','status','code','metadata','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','detectIntent','Dialogflow\x20V2\x20response:','queryResult','diagnosticInfo','fields','end_conversation','boolValue','intent','displayName','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','fulfillmentText','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','ispeechTTS','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','format','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','freeform=3','text','channelData','CustomAction','CustomActionData','AudioFromTts','audiofile','dirName','apiai-promise','dialogflow','http','https','md5','path','querystring','randomstring','sox','google-tts-api','url','util','./aws','./google','./sestek','./tilde','agi','https:','host','WHAT_EVER','statusCode','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','close','error','unlink','download\x20error','protocol','get','data','end','wav','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','base64','chmodSync','777','split','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','text:synthesize','POST','then','.mp3','from','writeFile','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','null','generic','parse\x20response\x20failed:\x0a','length','lang\x20\x22','\x22\x20might\x20not\x20exist','writeFileSync','goggleTTS\x20path','asr','uri','results','alternatives','transcript','join','map','confidence'];(function(_0x475e51,_0x4d52e9){var _0x4e336c=function(_0x55c8c5){while(--_0x55c8c5){_0x475e51['push'](_0x475e51['shift']());}};_0x4e336c(++_0x4d52e9);}(_0x066b,0x145));var _0xb066=function(_0xa9eeac,_0x354e17){_0xa9eeac=_0xa9eeac-0x0;var _0x50ce18=_0x066b[_0xa9eeac];return _0x50ce18;};'use strict';var apiai=require(_0xb066('0x0'));var BPromise=require('bluebird');var dialogflow=require(_0xb066('0x1'));var fs=require('fs');var http=require(_0xb066('0x2'));var https=require(_0xb066('0x3'));var md5=require(_0xb066('0x4'));var path=require(_0xb066('0x5'));var querystring=require(_0xb066('0x6'));var rp=require('request-promise');var rs=require(_0xb066('0x7'));var sox=require(_0xb066('0x8'));var tts=require(_0xb066('0x9'));var urlParse=require(_0xb066('0xa'))['parse'];var util=require(_0xb066('0xb'));var aws=require(_0xb066('0xc'));var google=require(_0xb066('0xd'));var sestek=require(_0xb066('0xe'));var tilde=require(_0xb066('0xf'));var logger=require('../../../config/logger')(_0xb066('0x10'));var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0xd6a8db,_0x30a6da){return new BPromise(function(_0x578b2a,_0x3e1c11){var _0x2b0fbe=urlParse(_0xd6a8db);var _0x410375=_0x2b0fbe['protocol']===_0xb066('0x11')?https:http;var _0x59d183={'host':_0x2b0fbe[_0xb066('0x12')],'path':_0x2b0fbe[_0xb066('0x5')],'headers':{'user-agent':_0xb066('0x13')}};_0x410375['get'](_0x59d183,function(_0x5e56cd){if(_0x5e56cd[_0xb066('0x14')]!==0xc8){logger['error'](_0xb066('0x15')+_0xd6a8db+_0xb066('0x16')+_0x5e56cd[_0xb066('0x14')]+'\x20('+_0x5e56cd[_0xb066('0x17')]+')');_0x3e1c11(new Error(_0xb066('0x15')+_0xd6a8db+_0xb066('0x16')+_0x5e56cd[_0xb066('0x14')]+'\x20('+_0x5e56cd[_0xb066('0x17')]+')'));return;}var _0x2780fa=fs[_0xb066('0x18')](_0x30a6da);_0x2780fa['on'](_0xb066('0x19'),function(){logger[_0xb066('0x1a')](_0xb066('0x1b'));_0x2780fa[_0xb066('0x1c')](_0x578b2a);});_0x2780fa['on'](_0xb066('0x1d'),function(_0x5a8cb1){fs[_0xb066('0x1e')](_0x30a6da);logger[_0xb066('0x1d')](_0xb066('0x1f'),_0x5a8cb1);_0x3e1c11(_0x5a8cb1);});_0x5e56cd['pipe'](_0x2780fa);})['on'](_0xb066('0x1d'),function(_0x4b42ba){logger[_0xb066('0x1d')](_0x4b42ba);_0x3e1c11(_0x4b42ba);})['end']();});}function uploadFile(_0x11eb9c){return new BPromise(function(_0xabe3a1,_0x419c76){var _0x3c23bf=urlParse(_0x11eb9c);var _0x7bf68a=_0x3c23bf[_0xb066('0x20')]===_0xb066('0x11')?https:http;var _0x134fd2={'host':_0x3c23bf[_0xb066('0x12')],'path':_0x3c23bf[_0xb066('0x5')],'headers':{'user-agent':_0xb066('0x13')}};_0x7bf68a[_0xb066('0x21')](_0x134fd2,function(_0x513b12){if(_0x513b12[_0xb066('0x14')]!==0xc8){_0x419c76(new Error(_0xb066('0x15')+_0x11eb9c+_0xb066('0x16')+_0x513b12[_0xb066('0x14')]+'\x20('+_0x513b12[_0xb066('0x17')]+')'));return;}var _0x503cb3='';_0x513b12['on'](_0xb066('0x22'),function(_0x32ee39){_0x503cb3+=_0x32ee39;});_0x513b12['on'](_0xb066('0x23'),function(){_0xabe3a1(_0x503cb3);});})['on'](_0xb066('0x1d'),function(_0x5cdbde){_0x419c76(_0x5cdbde);})[_0xb066('0x23')]();});}function convertFile(_0x2aad47,_0x1a57e3){return new BPromise(function(_0x3952d8,_0x2190b8){var _0x36cb05=sox['transcode'](_0x2aad47,_0x1a57e3,{'sampleRate':0x1f40,'format':_0xb066('0x24'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x36cb05['on'](_0xb066('0x1d'),function(_0x5e74da){logger['error'](_0xb066('0x25'),_0x5e74da);_0x2190b8(_0x5e74da);});_0x36cb05['on']('end',function(){logger[_0xb066('0x1a')](_0xb066('0x26'));_0x3952d8();});_0x36cb05[_0xb066('0x27')]();});}function base64Decode(_0x43379c,_0x1a8bbd){var _0x1f0ca6=path[_0xb066('0x28')](__dirname,_0xb066('0x29'),rs[_0xb066('0x2a')](0x4)+_0xb066('0x2b'));fs['writeFileSync'](_0x1f0ca6,_0x43379c,_0xb066('0x2c'));return convertFile(_0x1f0ca6,_0x1a8bbd)['then'](function(){try{fs['unlink'](_0x1f0ca6);fs[_0xb066('0x2d')](_0x1a8bbd,_0xb066('0x2e'));}catch(_0x33e1b5){logger['error'](_0x33e1b5);}return _0x1a8bbd[_0xb066('0x2f')]('.')[0x0];});}function base64Encode(_0x5b1848){var _0x10bd85=fs['readFileSync'](_0x5b1848);return new Buffer(_0x10bd85)[_0xb066('0x30')]('base64');}exports[_0xb066('0x31')]=function(_0x4c5805,_0x39bf55,_0x52cd6b,_0x445bb5,_0x1b9ea9,_0x336dce){var _0x2adb1a,_0x1273f4;var _0x3f7a73=_0xb066('0x32');var _0x1d994d=_0xb066('0x33')+_0x4c5805;var _0x1079df={};if(_0x39bf55===_0xb066('0x34')){_0x1079df[_0xb066('0x35')]={'ssml':_0x52cd6b};}else{_0x1079df['input']={'text':_0x52cd6b};};_0x1079df['voice']={'languageCode':_0x445bb5,'ssmlGender':_0x1b9ea9};_0x1079df['audioConfig']={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x2061eb={'url':_0x3f7a73+_0xb066('0x36')+_0x1d994d,'method':_0xb066('0x37'),'json':!![],'body':_0x1079df};return rp(_0x2061eb)[_0xb066('0x38')](function(_0xa61fb5){return new BPromise(function(_0x4b04bc,_0x28b6b7){_0x2adb1a=path[_0xb066('0x28')](__dirname,'tmp',rs[_0xb066('0x2a')](0x4)+_0xb066('0x39'));var _0x190682=Buffer[_0xb066('0x3a')](_0xa61fb5['audioContent'],_0xb066('0x2c'));return fs[_0xb066('0x3b')](_0x2adb1a,_0x190682,function(_0x53ae60){_0x28b6b7(_0x53ae60);},function(_0x36e034){fs[_0xb066('0x2d')](_0x2adb1a,_0xb066('0x2e'));_0x4b04bc(_0x36e034);});});})[_0xb066('0x38')](function(_0x183a0f){_0x1273f4=path[_0xb066('0x28')](__dirname,_0xb066('0x29'),rs[_0xb066('0x2a')](0x4)+_0xb066('0x2b'));return convertFile(_0x2adb1a,_0x1273f4);})[_0xb066('0x38')](function(){try{fs[_0xb066('0x1e')](_0x2adb1a);fs[_0xb066('0x2d')](_0x1273f4,'777');}catch(_0x54110b){logger[_0xb066('0x1d')](_0x54110b);}logger[_0xb066('0x1a')]('googleCloudTTS\x20path',_0x1273f4[_0xb066('0x2f')]('.')[0x0]);return _0x1273f4[_0xb066('0x2f')]('.')[0x0];});};exports[_0xb066('0x3c')]=function(_0x433829,_0x188018){var _0x22ece3=_0xb066('0x3d');var _0x50bf69,_0x3f8c99;var _0x53524a;var _0x508c29={'encoding':_0xb066('0x3e'),'method':_0xb066('0x37'),'timeout':0x2710,'url':_0x22ece3,'headers':{'Content-Type':_0xb066('0x3f')},'body':_0xb066('0x40')+encodeURIComponent(JSON[_0xb066('0x41')]([[[_0xb066('0x42'),JSON['stringify']([_0x433829,_0x188018||'en',![],_0xb066('0x43')]),null,_0xb066('0x44')]]]))};return rp(_0x508c29)[_0xb066('0x38')](function(_0x404639){try{_0x53524a=eval(_0x404639['slice'](0x5))[0x0][0x2];}catch(_0x50c94d){throw new Error(_0xb066('0x45')+_0x404639['data']);}if(!_0x53524a){if(_0x433829[_0xb066('0x46')]>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error(_0xb066('0x47')+_0x188018+_0xb066('0x48'));}}try{_0x53524a=eval(_0x53524a)[0x0];}catch(_0x292bb4){throw new Error(_0xb066('0x45')+res['data']);}const _0x342aa0=_0x53524a;_0x50bf69=path[_0xb066('0x28')](__dirname,_0xb066('0x29'),rs[_0xb066('0x2a')](0x4)+'.mp3');fs[_0xb066('0x49')](_0x50bf69,_0x53524a,{'encoding':'base64'});_0x3f8c99=path['resolve'](__dirname,_0xb066('0x29'),rs[_0xb066('0x2a')](0x4)+_0xb066('0x2b'));return convertFile(_0x50bf69,_0x3f8c99);})[_0xb066('0x38')](function(){try{fs[_0xb066('0x1e')](_0x50bf69);fs[_0xb066('0x2d')](_0x3f8c99,_0xb066('0x2e'));}catch(_0x3c40a3){logger[_0xb066('0x1d')](_0x3c40a3);}logger['info'](_0xb066('0x4a'),_0x3f8c99[_0xb066('0x2f')]('.')[0x0]);return _0x3f8c99[_0xb066('0x2f')]('.')[0x0];});};exports['googleASR']=function(_0x439e44,_0x4be617,_0x1e8f1e){return google[_0xb066('0x4b')](_0x439e44,_0x4be617,_0x1e8f1e)[_0xb066('0x38')](function(_0x38e4d1){logger[_0xb066('0x1a')](_0x38e4d1[_0xb066('0x4c')]);return rp(_0x38e4d1);})[_0xb066('0x38')](function(_0x3a3c73){var _0x1fd921='';var _0xb68aa6=0x0;try{fs[_0xb066('0x1e')](_0x439e44);}catch(_0x3c19c0){logger[_0xb066('0x1d')](_0x3c19c0);}if(_0x3a3c73&&_0x3a3c73[_0xb066('0x4d')]){_0x1fd921=_0x3a3c73[_0xb066('0x4d')]['map'](function(_0x47320d){return _0x47320d&&_0x47320d[_0xb066('0x4e')][0x0]&&_0x47320d['alternatives'][0x0]['transcript']?_0x47320d['alternatives'][0x0][_0xb066('0x4f')]:'';})[_0xb066('0x50')]('\x0a');_0xb68aa6=_0x3a3c73['results'][_0xb066('0x51')](function(_0x63682b){return _0x63682b&&_0x63682b[_0xb066('0x4e')][0x0]&&_0x63682b[_0xb066('0x4e')][0x0]['confidence']?_0x63682b[_0xb066('0x4e')][0x0][_0xb066('0x52')]:0x0;})[_0xb066('0x50')]('\x0a');}logger['info'](_0xb066('0x53'),_0x1fd921);logger[_0xb066('0x1a')](_0xb066('0x54'),_0xb68aa6);return{'transcript':_0x1fd921,'confidence':_0xb68aa6};})[_0xb066('0x55')](function(_0xeddc46){logger[_0xb066('0x1d')]('[%s]\x20%s:%s',_0xeddc46['statusCode'],_0xeddc46['name'],_0xeddc46['message']);});};exports[_0xb066('0x56')]=function(_0x432647,_0x3f8e96,_0xba5e1,_0x5dd5b0){var _0x331a61=apiai(_0x3f8e96,{'language':_0x5dd5b0||'en'});return _0x331a61['textRequest'](_0xba5e1,{'sessionId':md5(_0x432647)})[_0xb066('0x38')](function(_0x1a1039){logger[_0xb066('0x1a')](JSON[_0xb066('0x41')](_0x1a1039));return{'source':_0x1a1039['result'][_0xb066('0x57')],'resolvedQuery':_0x1a1039['result'][_0xb066('0x58')],'action':_0x1a1039[_0xb066('0x59')][_0xb066('0x5a')],'actionIncomplete':_0x1a1039[_0xb066('0x59')][_0xb066('0x5b')],'speech':_0x1a1039[_0xb066('0x59')][_0xb066('0x5c')][_0xb066('0x5d')],'score':_0x1a1039[_0xb066('0x59')][_0xb066('0x5e')],'statusCode':_0x1a1039[_0xb066('0x5f')][_0xb066('0x60')],'endConversation':_0x1a1039[_0xb066('0x59')]['metadata']['endConversation']||![],'isFallbackIntent':_0x1a1039['result'][_0xb066('0x61')][_0xb066('0x62')]};});};exports[_0xb066('0x63')]=function(_0x3b3138,_0x446e5b,_0x3b6c6d,_0x5bf2a8,_0x1598ae,_0x126463){var _0x18d3ad=_0x5bf2a8[_0xb066('0x64')](/\\n/g,'\x0a');var _0x2f7233={'credentials':{'private_key':_0x18d3ad,'client_email':_0x3b6c6d}};var _0x5ef769=new dialogflow[(_0xb066('0x65'))](_0x2f7233);var _0x249195=_0x5ef769['sessionPath'](_0x446e5b,md5(_0x3b3138));var _0x5e25be={'session':_0x249195,'queryInput':{'text':{'text':_0x1598ae,'languageCode':_0x126463}}};return _0x5ef769[_0xb066('0x66')](_0x5e25be)['then'](function(_0x44de30){if(_0x44de30&&_0x44de30[_0xb066('0x46')]){logger[_0xb066('0x1a')](_0xb066('0x67'),JSON[_0xb066('0x41')](_0x44de30));var _0x5d390d=_0x44de30[0x0];if(_0x5d390d){var _0x21a057={'action':_0x5d390d[_0xb066('0x68')][_0xb066('0x5a')],'allRequiredParamsPresent':_0x5d390d[_0xb066('0x68')]['allRequiredParamsPresent'],'endConversation':_0x5d390d[_0xb066('0x68')]['diagnosticInfo']&&_0x5d390d['queryResult']['diagnosticInfo']['fields']?_0x5d390d['queryResult'][_0xb066('0x69')][_0xb066('0x6a')][_0xb066('0x6b')][_0xb066('0x6c')]:![],'fulfillmentText':_0x5d390d[_0xb066('0x68')]['fulfillmentText'],'intentName':_0x5d390d[_0xb066('0x68')][_0xb066('0x6d')]['name'],'intentDisplayName':_0x5d390d['queryResult'][_0xb066('0x6d')][_0xb066('0x6e')],'isFallbackIntent':_0x5d390d['queryResult'][_0xb066('0x6d')][_0xb066('0x6f')],'languageCode':_0x5d390d['queryResult'][_0xb066('0x70')],'queryText':_0x5d390d[_0xb066('0x68')][_0xb066('0x71')],'responseId':_0x5d390d[_0xb066('0x72')],'score':_0x5d390d[_0xb066('0x68')][_0xb066('0x73')],'speech':_0x5d390d[_0xb066('0x68')][_0xb066('0x74')],'providerResponse':JSON['stringify'](_0x44de30)};return _0x21a057;}}});};exports[_0xb066('0x75')]=function(_0x227e81,_0x348533,_0x2d70bd,_0x2c851d){return tilde[_0xb066('0x4b')](_0x227e81,_0x348533,_0x2d70bd,_0x2c851d)[_0xb066('0x38')](function(_0x786b59){try{fs[_0xb066('0x1e')](_0x227e81);}catch(_0x39f9a0){logger[_0xb066('0x1d')](_0x39f9a0);}logger['info'](_0xb066('0x76'),_0x786b59[_0xb066('0x4f')]);logger[_0xb066('0x1a')](_0xb066('0x77'),_0x786b59['confidence']);return _0x786b59;});};exports[_0xb066('0x78')]=function(_0x4c6c81,_0x4b0abf,_0x8763a2,_0x47b0fb,_0x4f535f,_0x34cb2a){var _0x338f5e=path[_0xb066('0x28')](__dirname,_0xb066('0x29'),rs[_0xb066('0x2a')](0x4)+'.mp3');var _0x551951;return aws[_0xb066('0x79')](_0x4c6c81,_0x4b0abf,_0x8763a2,_0x47b0fb,_0x4f535f,_0x34cb2a,_0x338f5e)[_0xb066('0x38')](function(){_0x551951=path[_0xb066('0x28')](__dirname,_0xb066('0x29'),rs[_0xb066('0x2a')](0x4)+_0xb066('0x2b'));return convertFile(_0x338f5e,_0x551951);})['then'](function(){try{fs[_0xb066('0x1e')](_0x338f5e);fs['chmodSync'](_0x551951,_0xb066('0x2e'));}catch(_0x541c01){logger[_0xb066('0x1d')](_0x541c01);}return _0x551951[_0xb066('0x2f')]('.')[0x0];});};exports[_0xb066('0x7a')]=function(_0x331326,_0x4cc609,_0x2314a4,_0x4a7774,_0x28f294,_0x2852a6){return aws['lex'](_0x331326,_0x4cc609,_0x2314a4,_0x4a7774,_0x28f294,_0x2852a6)['then'](function(_0x4f12df){logger['info'](JSON[_0xb066('0x41')](_0x4f12df));return _0x4f12df;});};exports[_0xb066('0x7b')]=function(_0x16930c,_0x5253c6,_0x3fecc3,_0x3da4ce){var _0x5a323b=util['format'](_0xb066('0x7c'),ISPEECH_API,_0x16930c,encodeURIComponent(_0x5253c6),_0x3fecc3,_0x3da4ce);var _0x159110=path[_0xb066('0x28')](__dirname,_0xb066('0x29'),rs[_0xb066('0x2a')](0x4)+'.mp3');var _0x254c34;return downloadFile(_0x5a323b,_0x159110)[_0xb066('0x38')](function(){_0x254c34=path[_0xb066('0x28')](__dirname,_0xb066('0x29'),rs[_0xb066('0x2a')](0x4)+_0xb066('0x2b'));return convertFile(_0x159110,_0x254c34);})[_0xb066('0x38')](function(){try{fs[_0xb066('0x1e')](_0x159110);fs[_0xb066('0x2d')](_0x254c34,_0xb066('0x2e'));}catch(_0x23e9fc){logger[_0xb066('0x1d')](_0x23e9fc);}return _0x254c34['split']('.')[0x0];});};exports[_0xb066('0x7d')]=function(_0xb1b439,_0x283b39,_0x30726c,_0x487b12){var _0x9a5648=util[_0xb066('0x7e')](_0xb066('0x7f'),ISPEECH_API,_0x283b39,_0x30726c,base64Encode(_0xb1b439),_0x487b12?util[_0xb066('0x7e')]('model=%s',encodeURIComponent(_0x487b12)):_0xb066('0x80'));return uploadFile(_0x9a5648)['then'](function(_0x548b78){return querystring['parse'](_0x548b78);});};exports['sestekNDA']=function(_0x1dec4c,_0x557e17){return sestek['nda'](_0x1dec4c,_0x557e17)[_0xb066('0x38')](function(_0x173566){logger['info'](JSON[_0xb066('0x41')](_0x173566));var _0x3182c1={'speech':_0x173566[_0xb066('0x81')],'action':_0x173566['channelData']?_0x173566[_0xb066('0x82')][_0xb066('0x83')]:undefined,'actiondata':_0x173566['channelData']?_0x173566[_0xb066('0x82')][_0xb066('0x84')]:undefined};if(_0x173566[_0xb066('0x82')]&&_0x173566[_0xb066('0x82')][_0xb066('0x85')]){return base64Decode(_0x173566[_0xb066('0x82')][_0xb066('0x85')]['Data'],path[_0xb066('0x28')](__dirname,'tmp',rs['generate'](0x4)+_0xb066('0x2b')))[_0xb066('0x38')](function(_0x2a2b3a){_0x3182c1[_0xb066('0x86')]=_0x2a2b3a;return _0x3182c1;});}return _0x3182c1;});};exports[_0xb066('0x87')]=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 5bae70f..4981366 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 _0x9430=['./nda','exports'];(function(_0x581b6f,_0xb342ec){var _0x20aea0=function(_0x381f84){while(--_0x381f84){_0x581b6f['push'](_0x581b6f['shift']());}};_0x20aea0(++_0xb342ec);}(_0x9430,0x64));var _0x0943=function(_0x296468,_0x30dc41){_0x296468=_0x296468-0x0;var _0xb7c4bd=_0x9430[_0x296468];return _0xb7c4bd;};var nda=require(_0x0943('0x0'));module[_0x0943('0x1')]={'nda':nda}; \ No newline at end of file +var _0x28e6=['./nda','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x28e6,0xbc));var _0x628e=function(_0x2ffcee,_0x5f468a){_0x2ffcee=_0x2ffcee-0x0;var _0x3d0c1a=_0x28e6[_0x2ffcee];return _0x3d0c1a;};var nda=require(_0x628e('0x0'));module[_0x628e('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 c6009cf..133f0c9 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 _0x7117=['access_token','project','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','custom_action','CustomAction','custom_action_data','CustomActionData','stringify','request-promise','url','../../../../../config/logger','agi','POST','ndauth_url','/token','password','resolve','ndassistant_url','ndaactivity_type','message','Nda','uniqueid','callerid','dnid','extension','Bearer\x20'];(function(_0x1ac6e5,_0x40f47f){var _0x5877dc=function(_0x99caea){while(--_0x99caea){_0x1ac6e5['push'](_0x1ac6e5['shift']());}};_0x5877dc(++_0x40f47f);}(_0x7117,0x1ec));var _0x7711=function(_0x354826,_0xf3928c){_0x354826=_0x354826-0x0;var _0x5d63f5=_0x7117[_0x354826];return _0x5d63f5;};'use strict';var rp=require(_0x7711('0x0'));var url=require(_0x7711('0x1'));var logger=require(_0x7711('0x2'))(_0x7711('0x3'));module['exports']=function(_0x3a55de,_0x348cc0){var _0x5acf59={'method':_0x7711('0x4'),'uri':url['resolve'](_0x348cc0[_0x7711('0x5')],_0x7711('0x6')),'form':{'grant_type':_0x7711('0x7'),'username':_0x348cc0['username'],'password':_0x348cc0['password']},'json':!![]};return rp(_0x5acf59)['then'](function(_0x50acc7){var _0x390862={'method':_0x7711('0x4'),'uri':url[_0x7711('0x8')](_0x348cc0[_0x7711('0x9')],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x348cc0[_0x7711('0xa')]||_0x7711('0xb'),'channelId':_0x7711('0xc'),'conversation':{'id':_0x3a55de[_0x7711('0xd')]},'from':{'id':_0x3a55de[_0x7711('0xe')],'name':_0x3a55de['calleridname']},'recipient':{'id':_0x3a55de[_0x7711('0xf')],'name':_0x3a55de[_0x7711('0x10')]},'text':_0x348cc0['text'],'channelData':{}},'headers':{'Authorization':_0x7711('0x11')+_0x50acc7[_0x7711('0x12')]},'json':!![]};if(_0x348cc0[_0x7711('0x13')]){_0x390862[_0x7711('0x14')][_0x7711('0x15')][_0x7711('0x16')]=_0x348cc0['project'];}if(_0x348cc0[_0x7711('0x17')]=='1'){_0x390862[_0x7711('0x14')][_0x7711('0x15')][_0x7711('0x18')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x348cc0[_0x7711('0x19')]){_0x390862[_0x7711('0x14')][_0x7711('0x15')][_0x7711('0x1a')]=_0x348cc0[_0x7711('0x19')];if(_0x348cc0[_0x7711('0x1b')]){_0x390862[_0x7711('0x14')][_0x7711('0x15')][_0x7711('0x1c')]=_0x348cc0[_0x7711('0x1b')];}}logger['info'](JSON[_0x7711('0x1d')](_0x390862));return rp(_0x390862);});}; \ No newline at end of file +var _0xb98f=['ndaactivity_type','message','callerid','dnid','extension','text','Bearer\x20','access_token','project','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','custom_action','CustomAction','custom_action_data','CustomActionData','info','stringify','request-promise','url','../../../../../config/logger','agi','exports','POST','resolve','ndauth_url','/token','username','password'];(function(_0x1b6d68,_0x4c2e9f){var _0x4b4c0c=function(_0x4c088f){while(--_0x4c088f){_0x1b6d68['push'](_0x1b6d68['shift']());}};_0x4b4c0c(++_0x4c2e9f);}(_0xb98f,0xce));var _0xfb98=function(_0x36d0ee,_0xff9b1a){_0x36d0ee=_0x36d0ee-0x0;var _0xa8b365=_0xb98f[_0x36d0ee];return _0xa8b365;};'use strict';var rp=require(_0xfb98('0x0'));var url=require(_0xfb98('0x1'));var logger=require(_0xfb98('0x2'))(_0xfb98('0x3'));module[_0xfb98('0x4')]=function(_0x4f16b2,_0x5570ce){var _0x593d54={'method':_0xfb98('0x5'),'uri':url[_0xfb98('0x6')](_0x5570ce[_0xfb98('0x7')],_0xfb98('0x8')),'form':{'grant_type':'password','username':_0x5570ce[_0xfb98('0x9')],'password':_0x5570ce[_0xfb98('0xa')]},'json':!![]};return rp(_0x593d54)['then'](function(_0x27b394){var _0x4d06fc={'method':'POST','uri':url['resolve'](_0x5570ce['ndassistant_url'],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x5570ce[_0xfb98('0xb')]||_0xfb98('0xc'),'channelId':'Nda','conversation':{'id':_0x4f16b2['uniqueid']},'from':{'id':_0x4f16b2[_0xfb98('0xd')],'name':_0x4f16b2['calleridname']},'recipient':{'id':_0x4f16b2[_0xfb98('0xe')],'name':_0x4f16b2[_0xfb98('0xf')]},'text':_0x5570ce[_0xfb98('0x10')],'channelData':{}},'headers':{'Authorization':_0xfb98('0x11')+_0x27b394[_0xfb98('0x12')]},'json':!![]};if(_0x5570ce[_0xfb98('0x13')]){_0x4d06fc[_0xfb98('0x14')][_0xfb98('0x15')][_0xfb98('0x16')]=_0x5570ce[_0xfb98('0x13')];}if(_0x5570ce[_0xfb98('0x17')]=='1'){_0x4d06fc[_0xfb98('0x14')][_0xfb98('0x15')][_0xfb98('0x18')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x5570ce[_0xfb98('0x19')]){_0x4d06fc['body'][_0xfb98('0x15')][_0xfb98('0x1a')]=_0x5570ce[_0xfb98('0x19')];if(_0x5570ce[_0xfb98('0x1b')]){_0x4d06fc[_0xfb98('0x14')]['channelData'][_0xfb98('0x1c')]=_0x5570ce[_0xfb98('0x1b')];}}logger[_0xfb98('0x1d')](JSON[_0xfb98('0x1e')](_0x4d06fc));return rp(_0x4d06fc);});}; \ 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 2cd83e3..6bbf165 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 _0xbecb=['exports'];(function(_0x1045ac,_0x996d46){var _0x304407=function(_0x3a963f){while(--_0x3a963f){_0x1045ac['push'](_0x1045ac['shift']());}};_0x304407(++_0x996d46);}(_0xbecb,0x1ad));var _0xbbec=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0xbecb[_0x160c73];return _0xd9302;};'use strict';var asr=require('./lib/api');module[_0xbbec('0x0')]=function(_0x31bbbf,_0x3a9007,_0x2cbd6a,_0x372610){return asr(_0x31bbbf,_0x3a9007,_0x2cbd6a,_0x372610);}; \ No newline at end of file +var _0x7ca9=['exports','./lib/api'];(function(_0x5ce15c,_0x19c917){var _0x36e4f5=function(_0x50fa90){while(--_0x50fa90){_0x5ce15c['push'](_0x5ce15c['shift']());}};_0x36e4f5(++_0x19c917);}(_0x7ca9,0x7d));var _0x97ca=function(_0x41e9d6,_0xfcf42f){_0x41e9d6=_0x41e9d6-0x0;var _0x2ed1e8=_0x7ca9[_0x41e9d6];return _0x2ed1e8;};'use strict';var asr=require(_0x97ca('0x0'));module[_0x97ca('0x1')]=function(_0x381b17,_0x3858a0,_0x1e99be,_0x5504f0){return asr(_0x381b17,_0x3858a0,_0x1e99be,_0x5504f0);}; \ 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 22779d9..969f220 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 _0x8e6b=['send','stringify','data','close','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Success.','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isObject','message','bluebird','lodash','moment','../../../../../../config/logger','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','createHash','sha1','update','digest','hex','info'];(function(_0x3e7c63,_0x50abe9){var _0x156116=function(_0x39931e){while(--_0x39931e){_0x3e7c63['push'](_0x3e7c63['shift']());}};_0x156116(++_0x50abe9);}(_0x8e6b,0x1a1));var _0xb8e6=function(_0x3d8985,_0x1b330f){_0x3d8985=_0x3d8985-0x0;var _0x5239c8=_0x8e6b[_0x3d8985];return _0x5239c8;};'use strict';var BPromise=require(_0xb8e6('0x0'));var _=require(_0xb8e6('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xb8e6('0x2'));var crypto=require('crypto');var logger=require(_0xb8e6('0x3'))('agi');module['exports']=function(_0x51446f,_0x3b0965,_0x3279d0,_0x6dfb93){return new BPromise(function(_0x5c2d5d,_0x5c6d04){logger['info'](_0xb8e6('0x4'),_0x6dfb93||_0xb8e6('0x5'));var _0x542516=new WebSocket(_0x6dfb93||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x400f19='';var _0x23ad34='0';var _0x3a1952='1';var _0x17fa65='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x104bac(_0x1afedc){var _0xfa00b3=crypto[_0xb8e6('0x6')](_0xb8e6('0x7'));_0xfa00b3[_0xb8e6('0x8')](_0x1afedc);return _0xfa00b3[_0xb8e6('0x9')](_0xb8e6('0xa'));}function _0x4bb4d8(){try{logger[_0xb8e6('0xb')]('Open\x20Tilde\x20ASR\x20socket');var _0x4bf1fb=moment()['unix']();var _0x3ff0a7=_0x104bac(_0x4bf1fb+_0x3b0965+_0x3279d0);_0x542516[_0xb8e6('0xc')](JSON[_0xb8e6('0xd')]({'appID':_0x3b0965,'timestamp':_0x4bf1fb,'appKey':_0x3ff0a7}));var _0x490a76=fs['createReadStream'](_0x51446f);_0x490a76['on'](_0xb8e6('0xe'),function(_0x3827d0){_0x542516[_0xb8e6('0xc')](_0x3827d0);});_0x490a76['on'](_0xb8e6('0xf'),function(){_0x542516[_0xb8e6('0xc')](_0xb8e6('0x10'));});}catch(_0x4de284){logger[_0xb8e6('0x11')](_0xb8e6('0x12'),JSON['stringify'](_0x4de284));_0x542516[_0xb8e6('0x13')]();}}function _0x44a0(_0x242b73){try{if(_0x242b73){var _0x5727ec=JSON[_0xb8e6('0x14')](_0x242b73);switch(_0x5727ec[_0xb8e6('0x15')]){case 0x0:if(_0x5727ec[_0xb8e6('0x16')]){if(_0x5727ec['result'][_0xb8e6('0x17')]){logger['info'](_0xb8e6('0x18'),JSON[_0xb8e6('0xd')](_0x5727ec[_0xb8e6('0x16')]['hypotheses']));_0x400f19=_0x5727ec['result'][_0xb8e6('0x19')][0x0][_0xb8e6('0x1a')];_0x23ad34=_0x5727ec[_0xb8e6('0x16')][_0xb8e6('0x19')][0x0][_0xb8e6('0x1b')];_0x3a1952='0';_0x17fa65=_0xb8e6('0x1c');_0x542516['terminate']();}}break;case 0x1:logger['info'](_0xb8e6('0x1d'));_0x3a1952='1';_0x17fa65=_0xb8e6('0x1d');break;case 0x2:logger[_0xb8e6('0xb')](_0xb8e6('0x1e'));_0x3a1952='2';_0x17fa65=_0xb8e6('0x1e');break;case 0x9:logger[_0xb8e6('0xb')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x3a1952='9';_0x17fa65=_0xb8e6('0x1f');break;case 0xa:logger[_0xb8e6('0xb')](_0xb8e6('0x20'));_0x3a1952='10';_0x17fa65='Authentication\x20failed.';break;case 0xb:logger[_0xb8e6('0xb')](_0xb8e6('0x21'));_0x3a1952='11';_0x17fa65='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x3ba870){logger[_0xb8e6('0x11')](_0xb8e6('0x22'),JSON[_0xb8e6('0xd')](_0x3ba870));_0x542516['terminate']();}}function _0x31c136(){logger[_0xb8e6('0xb')](_0xb8e6('0x23'));_0x5c2d5d({'transcript':_0x400f19,'confidence':_0x23ad34,'status':_0x3a1952,'status_message':_0x17fa65});}function _0x49dd8c(_0x4d86c3){logger[_0xb8e6('0x11')](_0xb8e6('0x24'));if(!_['isNil'](_0x4d86c3)){logger[_0xb8e6('0x11')](_[_0xb8e6('0x25')](_0x4d86c3)?JSON[_0xb8e6('0xd')](_0x4d86c3):_0x4d86c3);}}_0x542516['on']('open',_0x4bb4d8);_0x542516['on'](_0xb8e6('0x26'),_0x44a0);_0x542516['on']('close',_0x31c136);_0x542516['on'](_0xb8e6('0x11'),_0x49dd8c);});}; \ No newline at end of file +var _0x0f27=['All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','error','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','bluebird','moment','crypto','../../../../../../config/logger','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','createHash','sha1','update','unix','send','stringify','createReadStream','close','EOS','Tilde\x20ASR\x20send\x20error','terminate','parse','result','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Success.','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.'];(function(_0x43954a,_0x549801){var _0xc2fa8c=function(_0x4c859d){while(--_0x4c859d){_0x43954a['push'](_0x43954a['shift']());}};_0xc2fa8c(++_0x549801);}(_0x0f27,0x111));var _0x70f2=function(_0x4cb819,_0x382986){_0x4cb819=_0x4cb819-0x0;var _0x33fb18=_0x0f27[_0x4cb819];return _0x33fb18;};'use strict';var BPromise=require(_0x70f2('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x70f2('0x1'));var crypto=require(_0x70f2('0x2'));var logger=require(_0x70f2('0x3'))(_0x70f2('0x4'));module[_0x70f2('0x5')]=function(_0x47e152,_0x296967,_0x276fe7,_0x22dd54){return new BPromise(function(_0x264188,_0x34d151){logger[_0x70f2('0x6')](_0x70f2('0x7'),_0x22dd54||_0x70f2('0x8'));var _0x41ef06=new WebSocket(_0x22dd54||_0x70f2('0x8'),{'perMessageDeflate':![]});var _0x172c7e='';var _0x49be51='0';var _0x2a76cb='1';var _0x24560c='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x435ce8(_0x5d5303){var _0x234804=crypto[_0x70f2('0x9')](_0x70f2('0xa'));_0x234804[_0x70f2('0xb')](_0x5d5303);return _0x234804['digest']('hex');}function _0x102e26(){try{logger[_0x70f2('0x6')]('Open\x20Tilde\x20ASR\x20socket');var _0x42e514=moment()[_0x70f2('0xc')]();var _0x329441=_0x435ce8(_0x42e514+_0x296967+_0x276fe7);_0x41ef06[_0x70f2('0xd')](JSON[_0x70f2('0xe')]({'appID':_0x296967,'timestamp':_0x42e514,'appKey':_0x329441}));var _0x1cd5bb=fs[_0x70f2('0xf')](_0x47e152);_0x1cd5bb['on']('data',function(_0x580c58){_0x41ef06['send'](_0x580c58);});_0x1cd5bb['on'](_0x70f2('0x10'),function(){_0x41ef06[_0x70f2('0xd')](_0x70f2('0x11'));});}catch(_0xaf9151){logger['error'](_0x70f2('0x12'),JSON[_0x70f2('0xe')](_0xaf9151));_0x41ef06[_0x70f2('0x13')]();}}function _0x286703(_0x580321){try{if(_0x580321){var _0x5b2f7f=JSON[_0x70f2('0x14')](_0x580321);switch(_0x5b2f7f['status']){case 0x0:if(_0x5b2f7f[_0x70f2('0x15')]){if(_0x5b2f7f['result']['final']){logger[_0x70f2('0x6')](_0x70f2('0x16'),JSON['stringify'](_0x5b2f7f[_0x70f2('0x15')][_0x70f2('0x17')]));_0x172c7e=_0x5b2f7f[_0x70f2('0x15')][_0x70f2('0x17')][0x0][_0x70f2('0x18')];_0x49be51=_0x5b2f7f[_0x70f2('0x15')][_0x70f2('0x17')][0x0][_0x70f2('0x19')];_0x2a76cb='0';_0x24560c=_0x70f2('0x1a');_0x41ef06[_0x70f2('0x13')]();}}break;case 0x1:logger[_0x70f2('0x6')](_0x70f2('0x1b'));_0x2a76cb='1';_0x24560c=_0x70f2('0x1b');break;case 0x2:logger[_0x70f2('0x6')](_0x70f2('0x1c'));_0x2a76cb='2';_0x24560c=_0x70f2('0x1c');break;case 0x9:logger['info'](_0x70f2('0x1d'));_0x2a76cb='9';_0x24560c=_0x70f2('0x1d');break;case 0xa:logger[_0x70f2('0x6')](_0x70f2('0x1e'));_0x2a76cb='10';_0x24560c=_0x70f2('0x1e');break;case 0xb:logger[_0x70f2('0x6')](_0x70f2('0x1f'));_0x2a76cb='11';_0x24560c=_0x70f2('0x1f');}}}catch(_0x5c2109){logger[_0x70f2('0x20')](_0x70f2('0x21'),JSON[_0x70f2('0xe')](_0x5c2109));_0x41ef06[_0x70f2('0x13')]();}}function _0x2620d4(){logger[_0x70f2('0x6')](_0x70f2('0x22'));_0x264188({'transcript':_0x172c7e,'confidence':_0x49be51,'status':_0x2a76cb,'status_message':_0x24560c});}function _0x10c511(_0x3511cb){logger['error'](_0x70f2('0x23'));if(!_[_0x70f2('0x24')](_0x3511cb)){logger[_0x70f2('0x20')](_[_0x70f2('0x25')](_0x3511cb)?JSON[_0x70f2('0xe')](_0x3511cb):_0x3511cb);}}_0x41ef06['on']('open',_0x102e26);_0x41ef06['on']('message',_0x286703);_0x41ef06['on'](_0x70f2('0x10'),_0x2620d4);_0x41ef06['on']('error',_0x10c511);});}; \ 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 3f7d5c8..17ae63a 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 _0x74aa=['./asr'];(function(_0x22e690,_0x5f570e){var _0x2b515f=function(_0x2bd741){while(--_0x2bd741){_0x22e690['push'](_0x22e690['shift']());}};_0x2b515f(++_0x5f570e);}(_0x74aa,0xc8));var _0xa74a=function(_0x2ebe90,_0x2825d9){_0x2ebe90=_0x2ebe90-0x0;var _0x184e90=_0x74aa[_0x2ebe90];return _0x184e90;};var asr=require(_0xa74a('0x0'));module['exports']={'asr':asr}; \ No newline at end of file +var _0xbdb6=['exports'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xbdb6,0x96));var _0x6bdb=function(_0x4733d3,_0x454290){_0x4733d3=_0x4733d3-0x0;var _0x1b9a44=_0xbdb6[_0x4733d3];return _0x1b9a44;};var asr=require('./asr');module[_0x6bdb('0x0')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 980147e..b80455b 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(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x9c44[_0x2d7f0e];return _0x110b07;};'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 _0x34e8=['E_AGI_ARGUMENT_PORT','createServer','listen','listening','connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','close','nextTick','inherits','exports','util','net','events','EventEmitter','./channel','call','emit','error'];(function(_0x9d2e87,_0x5e6cf7){var _0x48da9a=function(_0x499591){while(--_0x499591){_0x9d2e87['push'](_0x9d2e87['shift']());}};_0x48da9a(++_0x5e6cf7);}(_0x34e8,0x12c));var _0x834e=function(_0x2a77cb,_0x25c1f8){_0x2a77cb=_0x2a77cb-0x0;var _0xd61972=_0x34e8[_0x2a77cb];return _0xd61972;};'use strict';var util=require(_0x834e('0x0'));var net=require(_0x834e('0x1'));var EventEmitter=require(_0x834e('0x2'))[_0x834e('0x3')];var AGIError=require('./error');var AGIChannel=require(_0x834e('0x4'));var AGIServer=function(_0x21e2e0,_0x472111,_0x31bf20){var _0x289ef2=this;var _0x19a3e0=null;var _0x398bee=0x0;if(!_0x21e2e0)_0x21e2e0=0x11dd;if(!_0x472111)_0x472111='127.0.0.1';EventEmitter[_0x834e('0x5')](_0x289ef2);function _0x52056d(){if(!_0x21e2e0){_0x289ef2[_0x834e('0x6')](_0x834e('0x7'),new AGIError(_0x834e('0x8')));return![];}_0x19a3e0=net[_0x834e('0x9')]();_0x19a3e0[_0x834e('0xa')](_0x21e2e0,_0x472111);_0x19a3e0['on'](_0x834e('0xb'),function(){_0x289ef2[_0x834e('0x6')](_0x834e('0xb'));});_0x19a3e0['on'](_0x834e('0xc'),function(_0x186b3b){_0x19a3e0[_0x834e('0xd')](function(_0x36e124,_0x14038b){if(_0x36e124){_0x289ef2[_0x834e('0x6')](_0x834e('0x7'),new AGIError(_0x834e('0xe'),_0x36e124));}else if(_0x31bf20&&_0x31bf20<0x0){_0x289ef2[_0x834e('0x6')]('error',new AGIError(_0x834e('0xf')));_0x186b3b[_0x834e('0x10')]();}else if(_0x31bf20&&_0x31bf20>0x0&&_0x31bf20<_0x14038b){_0x398bee+=0x1;_0x289ef2['emit'](_0x834e('0x7'),new AGIError(_0x834e('0x11'),_0x398bee));_0x186b3b[_0x834e('0x10')]();}else{var _0x21cc0a=new AGIChannel(_0x186b3b);_0x21cc0a['on']('ready',function(){_0x289ef2[_0x834e('0x6')](_0x834e('0xc'),_0x21cc0a);});}});});_0x19a3e0['on']('error',function(_0x316205){_0x289ef2['emit'](_0x834e('0x7'),new AGIError(_0x834e('0xe'),_0x316205['code']));});_0x19a3e0['on'](_0x834e('0x12'),function(){_0x289ef2[_0x834e('0x6')](_0x834e('0x12'),new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x834e('0x13')](function(){_0x52056d();});};util[_0x834e('0x14')](AGIServer,EventEmitter);module[_0x834e('0x15')]=function(_0xb993a1,_0x237947,_0x254677){return new AGIServer(_0xb993a1,_0x237947,_0x254677);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 831881b..487ed37 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 _0x37f8=['DIALOGFLOW_%s','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','no\x20ndauth\x20url\x20configured','username','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','sesteknda','Sestek\x20NDA\x20%s\x20file\x20created','audiofile','streamFile','unlink','end','Enter\x20in\x20END\x20(%s)\x20block','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','no\x20trunk\x20selected','trunk_id','no\x20trunk\x20found','trunk_name','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','getSound','no\x20variable\x20selected\x20for\x20the\x20result','response','test','mindigit','maxdigit','hiddendigitsnum','generate','hiddendigitspos','substr','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','.wav','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','aws_bot_name','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','%s/recordings/%s','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','googleASR','GOOGLE_ASR_%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','appsecret','wav','TILDE_ASR_%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','extension','priority','gotoif','no\x20condition\x20configured','condition','true','false','EVAL\x20CONDITION\x20%s\x20%s','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','IspeechASR\x20Result\x20%s','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','success','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','no\x20file\x20audio\x20found','getData','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','no\x20find\x20by\x20configured','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','Executed\x20command\x20%s\x20%s','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','inspect','no\x20variable\x20selected\x20for\x20the\x20response','200','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','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','account_id','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','SENDFAX\x20block\x20not\x20implemented','sendSMS','sms_account_id','no\x20sms\x20account\x20configured','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','XMCS-UNIQUEID','yes','Answer','Skipped\x20Answer','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','getSquareProject','no\x20subproject\x20found\x20with\x20id\x20%d','agi://%s/square,\x22%s\x22,\x22%s\x22','host','127.0.0.1','AGI','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','command','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','apiKey','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','lodash','shelljs','odbc','randomstring','mustache','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getdigits','getsecretdigits','channel','rpc','mailRpc','prototype','getVariable','getVariableById','then','name','getVoiceQueue','catch','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getTrunkById','getSoundPath','save_name','getMailAccountById','sendMailMessage','getIntervals','IntervalId','interval','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','error','Error\x20getting\x20ODBC\x20connection\x20%s','query','Error\x20executing\x20query\x20%s','info','Query\x20executed\x20correctly\x20%s','close','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','createSquareRecording','callerid','calleridname','context','accountcode','dnid','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','trim','googleCloudTTS','google_cloud_tts_text_type','text','languageCode','ssmlGender','MALE','audioEncoding','MP3','googleTTS','google_tts_language','url','method','timeout','number','includes','POST','PUT','toUpperCase','body','headers','parse','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','options','googleDialogflow','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','key','ispeech_tts_language','en-US','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_secret_access_key','aws_polly_region','Amy','aws_text_type','awsLex','aws_access_key_id','aws_lex_region','google_asr_language','tildeASR','appid','clear','clone','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isArray','hasOwnProperty','isPlainObject','saveRestApiResult','%s.%s','length','setVariable','split','replaceAll','getAndSetVariable','result','extra','retry','maxRetry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','exec','MRCPSynth','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','agi','Enter\x20in\x20AGI\x20(%s)\x20block','args','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','answer','Enter\x20in\x20CALLBACK\x20(%s)\x20block','delay','add','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','lumenvoxtts','Executed\x20command\x20MRCPSynth\x20%s','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','no\x20grammar\x20configured','MRCPRecog','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20odbc\x20database\x20found','no\x20query\x20configured','replace','query:\x20%s','variable_id','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','DIAL','SIP/%s','opts','Executed\x20command\x20%s','dialogflow','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','providerResponse'];(function(_0x11b1aa,_0x6b7b8){var _0xa0c21=function(_0x3336be){while(--_0x3336be){_0x11b1aa['push'](_0x11b1aa['shift']());}};_0xa0c21(++_0x6b7b8);}(_0x37f8,0xd2));var _0x837f=function(_0x13471d,_0x2f4d39){_0x13471d=_0x13471d-0x0;var _0x3218c6=_0x37f8[_0x13471d];return _0x3218c6;};'use strict';var fs=require('fs');var util=require('util');var _=require(_0x837f('0x0'));var sh=require(_0x837f('0x1'));var odbc=require(_0x837f('0x2'))();var rs=require(_0x837f('0x3'));var moment=require('moment');var Mustache=require(_0x837f('0x4'));var rp=require('request-promise');var logger=require('../../config/logger')('agi');var config=require('../../config/environment');var scripts=require('./scripts');var FILES_PATH=_0x837f('0x5');var recursiveMapAttributes=[_0x837f('0x6'),_0x837f('0x7')];var verticesWithRetry=[_0x837f('0x8'),_0x837f('0x9'),_0x837f('0xa')];var AGIVertices=function(_0x12c732,_0x16cda5,_0x42fb6e){this[_0x837f('0xb')]=_0x12c732;this[_0x837f('0xc')]=_0x16cda5;this[_0x837f('0xd')]=_0x42fb6e;};AGIVertices[_0x837f('0xe')][_0x837f('0xf')]=function(_0x406dcd,_0x50b133){this[_0x837f('0xc')][_0x837f('0x10')](_0x406dcd)[_0x837f('0x11')](function(_0x132d31){_0x50b133(null,_0x132d31?_0x132d31[_0x837f('0x12')]:![]);})['catch'](function(_0x53045e){_0x50b133(_0x53045e);});};AGIVertices[_0x837f('0xe')][_0x837f('0x13')]=function(_0x20be3c,_0x3e38ea){this[_0x837f('0xc')]['getVoiceQueueById'](_0x20be3c)[_0x837f('0x11')](function(_0xb5b3f4){_0x3e38ea(null,_0xb5b3f4?_0xb5b3f4[_0x837f('0x12')]:![]);})[_0x837f('0x14')](function(_0x2e4257){_0x3e38ea(_0x2e4257);});};AGIVertices[_0x837f('0xe')]['getSquareProject']=function(_0x11f37a,_0x2f2617){this['rpc'][_0x837f('0x15')](_0x11f37a)[_0x837f('0x11')](function(_0x28baaf){_0x2f2617(null,_0x28baaf?_0x28baaf[_0x837f('0x12')]:![]);})['catch'](function(_0x1d974f){_0x2f2617(_0x1d974f);});};AGIVertices[_0x837f('0xe')][_0x837f('0x16')]=function(_0x2d9c9f,_0x14b3da){this['rpc'][_0x837f('0x17')](_0x2d9c9f)[_0x837f('0x11')](function(_0x216897){_0x14b3da(null,_0x216897?_0x216897[_0x837f('0x18')]:![]);})[_0x837f('0x14')](function(_0x55dc1e){_0x14b3da(_0x55dc1e);});};AGIVertices[_0x837f('0xe')][_0x837f('0x19')]=function(_0x287c6e,_0xe68eb1){this[_0x837f('0xc')][_0x837f('0x1a')](_0x287c6e)[_0x837f('0x11')](function(_0x3531ed){_0xe68eb1(null,_0x3531ed?_0x3531ed[_0x837f('0x12')]:![]);})[_0x837f('0x14')](function(_0x3fa18e){_0xe68eb1(_0x3fa18e);});};AGIVertices[_0x837f('0xe')][_0x837f('0x1b')]=function(_0xfd2069,_0x68af0d){this[_0x837f('0xc')][_0x837f('0x1c')](_0xfd2069)[_0x837f('0x11')](function(_0x1a6f26){_0x68af0d(null,_0x1a6f26?_0x1a6f26[_0x837f('0x12')]:![]);})[_0x837f('0x14')](function(_0x246637){_0x68af0d(_0x246637);});};AGIVertices[_0x837f('0xe')]['getSound']=function(_0x3f467d,_0x2df32d){var _0x4290e6=this;this['rpc']['getSoundById'](_0x3f467d)[_0x837f('0x11')](function(_0x1ab2e4){_0x2df32d(null,_0x1ab2e4?_0x4290e6[_0x837f('0x1d')](_0x1ab2e4[_0x837f('0x1e')]):![]);})[_0x837f('0x14')](function(_0x387533){_0x2df32d(_0x387533);});};AGIVertices[_0x837f('0xe')]['getMailAccount']=function(_0x1a2343,_0x13a2e1){this[_0x837f('0xc')][_0x837f('0x1f')](_0x1a2343)['then'](function(_0x4e4528){_0x13a2e1(null,_0x4e4528?_0x4e4528:![]);})['catch'](function(_0x282ecb){_0x13a2e1(_0x282ecb);});};AGIVertices[_0x837f('0xe')][_0x837f('0x20')]=function(_0x422498,_0x5e186e,_0x223bf8){this['mailRpc'][_0x837f('0x20')](_0x422498,_0x5e186e)['then'](function(){_0x223bf8(null);})['catch'](function(_0x12bcec){_0x223bf8(_0x12bcec);});};AGIVertices[_0x837f('0xe')][_0x837f('0x21')]=function(_0x5200a9,_0x42494b){this['rpc']['getIntervalById'](_0x5200a9)[_0x837f('0x11')](function(_0x4c6710){if(_0x4c6710){if(_0x4c6710[_0x837f('0x22')]){_0x42494b(null,[_0x4c6710[_0x837f('0x23')]]);}else{_0x42494b(null,_['map'](_0x4c6710[_0x837f('0x24')],_0x837f('0x23')));}}else{_0x42494b(null,![]);}})[_0x837f('0x14')](function(_0x378773){_0x42494b(_0x378773);});};AGIVertices[_0x837f('0xe')]['getSoundPath']=function(_0x273385){return util[_0x837f('0x25')](_0x837f('0x26'),FILES_PATH,_0x273385);};AGIVertices[_0x837f('0xe')][_0x837f('0x27')]=function(_0x53215a,_0x562b48,_0x452daa){odbc['open'](_0x53215a,function(_0x4debd2){if(_0x4debd2){logger[_0x837f('0x28')](_0x837f('0x29'),_0x4debd2);_0x452daa(_0x4debd2);}else{logger['info']('ODBC\x20connection\x20successfully');odbc[_0x837f('0x2a')](_0x562b48,function(_0x27bad2,_0x1e0584){if(_0x27bad2){logger['info'](_0x837f('0x2b'),_0x562b48);_0x452daa(_0x27bad2);}else{logger[_0x837f('0x2c')](_0x837f('0x2d'),_0x562b48);odbc[_0x837f('0x2e')](function(_0x2ed1de){if(_0x2ed1de){logger['error']('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x2ed1de);}_0x452daa(null,_0x1e0584);});}});}});};AGIVertices[_0x837f('0xe')][_0x837f('0x2f')]=function(_0x2b859a,_0x53c0c7){this['rpc'][_0x837f('0x30')](_0x2b859a)[_0x837f('0x11')](function(_0x207bcb){_0x53c0c7(null,_0x207bcb?_0x207bcb:![]);})['catch'](function(_0x33d40b){_0x53c0c7(_0x33d40b);});};AGIVertices[_0x837f('0xe')]['createSmsMessage']=function(_0x536baa,_0x5a94f9){this[_0x837f('0xc')][_0x837f('0x31')](_0x536baa)[_0x837f('0x11')](function(_0x4591db){_0x5a94f9(null,_0x4591db);})[_0x837f('0x14')](function(_0xadb885){_0x5a94f9(_0xadb885);});};AGIVertices[_0x837f('0xe')][_0x837f('0x32')]=function(_0xdbd892,_0xb06317,_0x5ee978){this[_0x837f('0xc')][_0x837f('0x32')]({'uniqueid':this['channel'][_0x837f('0x33')],'node':_0xdbd892[_0x837f('0x34')],'application':_0xdbd892[_0x837f('0x35')],'data':_0xb06317||null,'project_name':this[_0x837f('0xb')][_0x837f('0x36')],'callerid':this[_0x837f('0xb')]['callerid']})[_0x837f('0x11')](function(_0x18747f){if(_0x5ee978){_0x5ee978(null,_0x18747f);}})[_0x837f('0x14')](function(_0x1d9d64){if(_0x5ee978){_0x5ee978(_0x1d9d64);}});};AGIVertices[_0x837f('0xe')][_0x837f('0x37')]=function(_0x2ef474,_0x1ba5bc,_0x47e536,_0x140e0c){this[_0x837f('0xc')]['createSquareRecording']({'uniqueid':this[_0x837f('0xb')][_0x837f('0x33')],'callerid':this['channel'][_0x837f('0x38')],'calleridname':this[_0x837f('0xb')][_0x837f('0x39')],'context':this[_0x837f('0xb')][_0x837f('0x3a')],'extension':this[_0x837f('0xb')]['extension'],'priority':this[_0x837f('0xb')]['priority'],'accountcode':this[_0x837f('0xb')][_0x837f('0x3b')],'dnid':this[_0x837f('0xb')][_0x837f('0x3c')],'projectName':this[_0x837f('0xb')][_0x837f('0x36')],'saveName':_0x1ba5bc,'filename':_0x2ef474['file']||_0x1ba5bc,'savePath':_0x47e536})['then'](function(_0x5edfcc){_0x140e0c(null,_0x5edfcc);})[_0x837f('0x14')](function(_0x21cb9b){_0x140e0c(_0x21cb9b);});};AGIVertices['prototype'][_0x837f('0x3d')]=function(_0x58184b,_0x288995,_0x20a36f,_0x3c2644,_0xb6951a){this[_0x837f('0xc')][_0x837f('0x3d')]({'uniqueid':this['channel'][_0x837f('0x33')],'body':_0x58184b,'direction':_0x288995,'providerName':_0x20a36f,'providerResponse':_0x3c2644})['then'](function(_0x6a13fd){if(_0xb6951a){_0xb6951a(null,_0x6a13fd);}})[_0x837f('0x14')](function(_0x3734a6){if(_0xb6951a){_0xb6951a(_0x3734a6);}});};AGIVertices['prototype'][_0x837f('0x3e')]=function(_0x3f27ca,_0x1021e8){this[_0x837f('0xc')][_0x837f('0x3e')]({'firstName':_[_0x837f('0x3f')](_0x3f27ca['name'])||_[_0x837f('0x40')](_0x3f27ca[_0x837f('0x12')])?_0x837f('0x41')+Math[_0x837f('0x42')]():_0x3f27ca['name'],'lastName':_[_0x837f('0x3f')](_0x3f27ca['lastName'])||_[_0x837f('0x40')](_0x3f27ca['lastName'])?null:_0x3f27ca[_0x837f('0x43')],'phone':_0x3f27ca[_0x837f('0x44')],'ListId':_0x3f27ca[_0x837f('0x45')],'scheduledat':_0x3f27ca[_0x837f('0x46')],'callbackUniqueid':this[_0x837f('0xb')][_0x837f('0x33')],'tags':_0x837f('0x47'),'description':_0x837f('0x48')+_0x3f27ca[_0x837f('0x46')][_0x837f('0x49')](),'priority':_0x3f27ca[_0x837f('0x4a')]})[_0x837f('0x11')](function(_0x4f2730){_0x1021e8(null,_0x4f2730);})[_0x837f('0x14')](function(_0x16cb00){_0x1021e8(_0x16cb00);});};AGIVertices['prototype'][_0x837f('0x4b')]=function(_0xec28fd,_0x6b06c1){this[_0x837f('0xc')][_0x837f('0x4c')](_0xec28fd)[_0x837f('0x11')](function(_0x438d93){_0x6b06c1(null,_0x438d93?_0x438d93[_0x837f('0x12')]:![]);})[_0x837f('0x14')](function(_0x366a3a){_0x6b06c1(_0x366a3a);});};AGIVertices[_0x837f('0xe')][_0x837f('0x4d')]=function(_0x2b528a,_0x48440f,_0x476acd){var _0x3a6571={'role':_0x837f('0x4e')};_0x3a6571[_0x2b528a]=this['channel'][_0x837f('0x38')];this[_0x837f('0xc')][_0x837f('0x4d')](_0x3a6571,_0x48440f,this[_0x837f('0xb')][_0x837f('0x33')])[_0x837f('0x11')](function(_0x536075){_0x476acd(null,_['isNil'](_0x536075)?![]:!![]);})[_0x837f('0x14')](function(_0x35d7d1){logger[_0x837f('0x28')](_0x35d7d1);_0x476acd(null,![]);});};AGIVertices['prototype'][_0x837f('0x4f')]=function(_0x2b076b,_0x1aa3ae){var _0x420c9e={'role':'agent'};_0x420c9e[_0x2b076b]=this[_0x837f('0xb')][_0x837f('0x38')];this[_0x837f('0xc')]['agentUnpause'](_0x420c9e)['then'](function(_0x5f2e06){_0x1aa3ae(null,_[_0x837f('0x40')](_0x5f2e06)?![]:!![]);})[_0x837f('0x14')](function(_0xf7ebe8){logger[_0x837f('0x28')](_0xf7ebe8);_0x1aa3ae(null,![]);});};AGIVertices[_0x837f('0xe')][_0x837f('0x50')]=function(_0x471be5,_0x2aa3ce){var _0x1ed044={'role':_0x837f('0x4e')};_0x1ed044[_0x471be5]=this[_0x837f('0xb')][_0x837f('0x38')];this[_0x837f('0xc')][_0x837f('0x50')](_0x1ed044)['then'](function(_0x5bbcab){_0x2aa3ce(null,_['isNil'](_0x5bbcab)?![]:!![]);})[_0x837f('0x14')](function(_0x3b1c64){logger[_0x837f('0x28')](_0x3b1c64);_0x2aa3ce(null,![]);});};AGIVertices[_0x837f('0xe')][_0x837f('0x51')]=function(_0xf00bc5,_0x587767){var _0x33b1b9={'role':_0x837f('0x4e')};_0x33b1b9[_0xf00bc5]=this['channel'][_0x837f('0x38')];var _0x1d43f6=_0xf00bc5!=_0x837f('0x52')?util['format'](_0x837f('0x53'),_0x837f('0x54'),this[_0x837f('0xb')]['callerid']):undefined;this['rpc'][_0x837f('0x51')](_0x33b1b9,_0x1d43f6)['then'](function(_0x43fc60){_0x587767(null,_[_0x837f('0x40')](_0x43fc60)?![]:!![]);})[_0x837f('0x14')](function(_0x378cd6){logger['error'](_0x378cd6);_0x587767(null,![]);});};AGIVertices[_0x837f('0xe')][_0x837f('0x55')]=function(_0x11438a,_0x567b1e){sh['exec'](_[_0x837f('0x56')](_0x11438a),function(_0x130f36,_0x262b76){var _0x54a45d=_0x262b76['replace'](/(\r\n|\n|\r)/gm,'');_0x567b1e(null,_0x54a45d);});};AGIVertices['prototype'][_0x837f('0x57')]=function(_0x306ae2,_0x42972a){scripts[_0x837f('0x57')](_0x306ae2['apiKey'],_0x306ae2[_0x837f('0x58')]||_0x837f('0x59'),_0x306ae2['text'],_0x306ae2[_0x837f('0x5a')]||'en-US',_0x306ae2[_0x837f('0x5b')]||_0x837f('0x5c'),_0x306ae2[_0x837f('0x5d')]||_0x837f('0x5e'))[_0x837f('0x11')](function(_0x5aa64c){_0x42972a(null,_0x5aa64c);})[_0x837f('0x14')](function(_0x4dfa08){_0x42972a(_0x4dfa08);});};AGIVertices[_0x837f('0xe')][_0x837f('0x5f')]=function(_0x882897,_0x166b55){scripts['googleTTS'](_0x882897[_0x837f('0x59')],_0x882897[_0x837f('0x60')]||'en',0x1)['then'](function(_0x8ff6bb){_0x166b55(null,_0x8ff6bb);})['catch'](function(_0x2118a2){_0x166b55(_0x2118a2);});};AGIVertices[_0x837f('0xe')]['restAPI']=function(_0x383426,_0x39e37b){var _0x2287d6={'uri':_0x383426[_0x837f('0x61')],'method':_0x383426[_0x837f('0x62')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x383426[_0x837f('0x63')])===_0x837f('0x64')&&parseInt(_0x383426[_0x837f('0x63')])>=0x1?parseInt(_0x383426['timeout'])*0x3e8:0x5*0x3e8};if(_[_0x837f('0x65')]([_0x837f('0x66'),_0x837f('0x67')],_0x2287d6['method'][_0x837f('0x68')]())){try{_0x2287d6[_0x837f('0x69')]=_0x383426[_0x837f('0x7')]?JSON['parse'](_0x383426[_0x837f('0x7')]):{};}catch(_0x1e11d8){logger[_0x837f('0x28')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x1e11d8);}}try{_0x2287d6[_0x837f('0x6a')]=_0x383426[_0x837f('0x6')]?JSON[_0x837f('0x6b')](_0x383426[_0x837f('0x6')]):{};}catch(_0x543961){logger[_0x837f('0x28')](_0x837f('0x6c'),_0x543961);}if(_0x383426[_0x837f('0x6d')]){try{var _0x19bcf5=require(_0x383426[_0x837f('0x6d')])[_0x837f('0x6e')](this,_0x2287d6);_0x2287d6[_0x837f('0x6f')]=Mustache[_0x837f('0x70')](_0x383426[_0x837f('0x61')],_0x19bcf5,{},['$$','$$']);if(_0x2287d6[_0x837f('0x6a')]){_0x2287d6[_0x837f('0x6a')]=JSON[_0x837f('0x6b')](Mustache['render'](JSON[_0x837f('0x71')](_0x2287d6[_0x837f('0x6a')]),_0x19bcf5,{},['$$','$$']));}if(_0x2287d6[_0x837f('0x69')]){_0x2287d6[_0x837f('0x69')]=JSON[_0x837f('0x6b')](Mustache[_0x837f('0x70')](JSON[_0x837f('0x71')](_0x2287d6[_0x837f('0x69')]),_0x19bcf5,{},['$$','$$']));}}catch(_0x522bf6){logger['error'](_0x837f('0x72'),_0x522bf6);}}rp(_0x2287d6)[_0x837f('0x11')](function(_0x2ed2d3){var _0xe7a459={'statusCode':_0x2ed2d3[_0x837f('0x73')]||0xc8,'statusMessage':_0x2ed2d3[_0x837f('0x74')]||'OK','headers':_0x2ed2d3['headers']||{},'body':_0x2ed2d3[_0x837f('0x69')]||{}};_0x39e37b(null,_0xe7a459);})[_0x837f('0x14')](function(_0x2d4505){var _0x191834={'statusCode':_0x2d4505[_0x837f('0x73')]||0x1f4,'statusMessage':_0x2d4505[_0x837f('0x75')]||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x2d4505[_0x837f('0x76')][_0x837f('0x6a')]||{},'body':_0x2d4505[_0x837f('0x76')]['body']||{}};_0x39e37b(null,_0x191834);});};AGIVertices[_0x837f('0xe')]['googleDialogflow']=function(_0x3cba8b,_0x58c890){scripts[_0x837f('0x77')](this[_0x837f('0xb')]['uniqueid'],_0x3cba8b['key'],_0x3cba8b[_0x837f('0x59')],_0x3cba8b[_0x837f('0x78')]||'en')['then'](function(_0x4bc819){_0x58c890(null,_0x4bc819);})[_0x837f('0x14')](function(_0xa6f066){_0x58c890(_0xa6f066);});};AGIVertices[_0x837f('0xe')][_0x837f('0x79')]=function(_0x2bbc66,_0x287d48){scripts[_0x837f('0x79')](this[_0x837f('0xb')][_0x837f('0x33')],_0x2bbc66[_0x837f('0x7a')],_0x2bbc66[_0x837f('0x7b')],_0x2bbc66[_0x837f('0x7c')],_0x2bbc66['text'],_0x2bbc66[_0x837f('0x7d')]||'en')[_0x837f('0x11')](function(_0x5da61e){_0x287d48(null,_0x5da61e);})[_0x837f('0x14')](function(_0x243202){_0x287d48(_0x243202);});};AGIVertices[_0x837f('0xe')][_0x837f('0x7e')]=function(_0x552af7,_0x402811){scripts[_0x837f('0x7e')](this[_0x837f('0xb')],_0x552af7)[_0x837f('0x11')](function(_0x5a70f6){_0x402811(null,_0x5a70f6);})[_0x837f('0x14')](function(_0x45a9b8){_0x402811(_0x45a9b8);});};AGIVertices['prototype'][_0x837f('0x7f')]=function(_0x41fc30,_0xef053c){scripts[_0x837f('0x7f')](_0x41fc30[_0x837f('0x80')],_0x41fc30[_0x837f('0x59')],_0x41fc30[_0x837f('0x81')]||_0x837f('0x82'),_0x41fc30['speed'])[_0x837f('0x11')](function(_0x3378b1){_0xef053c(null,_0x3378b1);})[_0x837f('0x14')](function(_0x4d3520){_0xef053c(_0x4d3520);});};AGIVertices[_0x837f('0xe')][_0x837f('0x83')]=function(_0x107f0b,_0x3f0c81,_0x37091d){scripts['ispeechASR'](_0x3f0c81,_0x107f0b[_0x837f('0x80')],_0x107f0b[_0x837f('0x84')]||_0x837f('0x82'),this[_0x837f('0x85')](_0x107f0b[_0x837f('0x86')])?_0x107f0b[_0x837f('0x86')]:undefined)['then'](function(_0x4e4fb6){_0x37091d(null,_0x4e4fb6);})[_0x837f('0x14')](function(_0x45664d){_0x37091d(_0x45664d);});};AGIVertices[_0x837f('0xe')][_0x837f('0x87')]=function(_0x4dce7d,_0x29c5e5){scripts[_0x837f('0x87')](_0x4dce7d['aws_access_key_id'],_0x4dce7d[_0x837f('0x88')],_0x4dce7d[_0x837f('0x89')],_0x4dce7d['aws_polly_voice']||_0x837f('0x8a'),_0x4dce7d['text'],_0x4dce7d[_0x837f('0x8b')]||_0x837f('0x59'))['then'](function(_0x141aeb){_0x29c5e5(null,_0x141aeb);})['catch'](function(_0x301db8){_0x29c5e5(_0x301db8);});};AGIVertices[_0x837f('0xe')][_0x837f('0x8c')]=function(_0x546099,_0x22064f){scripts[_0x837f('0x8c')](this[_0x837f('0xb')][_0x837f('0x33')],_0x546099[_0x837f('0x8d')],_0x546099[_0x837f('0x88')],_0x546099[_0x837f('0x8e')],_0x546099[_0x837f('0x59')],_0x546099['aws_bot_name'])['then'](function(_0x1f6a00){_0x22064f(null,_0x1f6a00);})[_0x837f('0x14')](function(_0x36b550){_0x22064f(_0x36b550);});};AGIVertices[_0x837f('0xe')]['googleASR']=function(_0xbd64bb,_0x55739a,_0x1043a3){scripts['googleASR'](_0x55739a,_0xbd64bb['key'],_0xbd64bb[_0x837f('0x8f')]||_0x837f('0x82'))[_0x837f('0x11')](function(_0xe98900){_0x1043a3(null,_0xe98900);})[_0x837f('0x14')](function(_0x5b9e19){_0x1043a3(_0x5b9e19);});};AGIVertices[_0x837f('0xe')][_0x837f('0x90')]=function(_0xc92a78,_0x2ff476,_0x52d3f8){scripts[_0x837f('0x90')](_0x2ff476,_0xc92a78[_0x837f('0x91')],_0xc92a78['appsecret'],_0xc92a78[_0x837f('0x6f')])[_0x837f('0x11')](function(_0x494055){_0x52d3f8(null,_0x494055);})['catch'](function(_0x5844e1){_0x52d3f8(_0x5844e1);});};AGIVertices[_0x837f('0xe')][_0x837f('0x92')]=function(_0x235c4d){var _0x54d0db=_[_0x837f('0x65')](verticesWithRetry,_0x235c4d[_0x837f('0x35')])?_0x235c4d:_[_0x837f('0x93')](_0x235c4d);for(var _0x47e097 in _0x54d0db){if(_0x54d0db['hasOwnProperty'](_0x47e097)){if(_0x54d0db[_0x47e097]&&_[_0x837f('0x94')](_0x54d0db[_0x47e097])){if(_[_0x837f('0x65')](recursiveMapAttributes,_0x47e097)){_0x54d0db[_0x47e097]=this[_0x837f('0x95')](_0x54d0db[_0x47e097]);}else{_0x54d0db[_0x47e097]=this[_0x837f('0x96')](_0x54d0db[_0x47e097]);}}}}return _0x54d0db;};AGIVertices[_0x837f('0xe')][_0x837f('0x97')]=function(_0x592f99){for(var _0x77fb05 in _0x592f99){if(_0x592f99['hasOwnProperty'](_0x77fb05)){if(_['isPlainObject'](_0x592f99[_0x77fb05])){this['recursiveNodeIndex'](_0x592f99[_0x77fb05]);}else if(_[_0x837f('0x98')](_0x592f99[_0x77fb05])){for(var _0xc3e380=0x0;_0xc3e380<_0x592f99[_0x77fb05]['length'];_0xc3e380++){this[_0x837f('0x97')](_0x592f99[_0x77fb05][_0xc3e380]);}}else if(_['isString'](_0x592f99[_0x77fb05])){_0x592f99[_0x77fb05]=this[_0x837f('0x96')](_0x592f99[_0x77fb05]);}}}};AGIVertices[_0x837f('0xe')]['saveRestApiResult']=function(_0x1ec691,_0x33e831){for(var _0x53c393 in _0x1ec691){if(_0x1ec691[_0x837f('0x99')](_0x53c393)){if(_[_0x837f('0x9a')](_0x1ec691[_0x53c393])){if(!_[_0x837f('0x3f')](_0x1ec691[_0x53c393])){this[_0x837f('0x9b')](_0x1ec691[_0x53c393],util[_0x837f('0x25')](_0x837f('0x9c'),_0x33e831,_0x53c393));}}else if(_[_0x837f('0x98')](_0x1ec691[_0x53c393])){for(var _0x3db29a=0x0;_0x3db29a<_0x1ec691[_0x53c393][_0x837f('0x9d')];_0x3db29a++){this[_0x837f('0x9b')](_0x1ec691[_0x53c393][_0x3db29a],util['format'](_0x837f('0x9c'),_0x33e831,_0x53c393+'['+_0x3db29a+']'));}}else{if(!_[_0x837f('0x40')](_0x1ec691[_0x53c393])){this[_0x837f('0xb')][_0x837f('0x9e')](util['format'](_0x837f('0x9c'),_0x33e831,_0x53c393),_0x1ec691[_0x53c393]);}}}}};AGIVertices[_0x837f('0xe')][_0x837f('0x95')]=function(_0x471092){try{var _0x1d59da=JSON[_0x837f('0x6b')](_0x471092);this['recursiveNodeIndex'](_0x1d59da);return JSON[_0x837f('0x71')](_0x1d59da);}catch(_0x41a0b8){return this[_0x837f('0x96')](_0x471092);}};AGIVertices['prototype']['replaceAllVariables']=function(_0x43e99d){var _0x3b5010=_0x43e99d[_0x837f('0x9f')]('{');for(var _0x162b52=0x1;_0x162b52<_0x3b5010[_0x837f('0x9d')];_0x162b52+=0x1){var _0x1916b0=_0x3b5010[_0x162b52]['split']('}');if(_0x1916b0[_0x837f('0x9d')]>0x1){_0x43e99d=_0x43e99d[_0x837f('0xa0')]('{'+_0x1916b0[0x0]+'}',this[_0x837f('0xb')][_0x837f('0xf')](_0x1916b0[0x0])['extra']||_0x1916b0[0x0]);}}if(_0x3b5010[_0x837f('0x9d')]===0x1){return _0x43e99d[_0x837f('0x49')]();}return this[_0x837f('0x96')](_0x43e99d);};AGIVertices[_0x837f('0xe')][_0x837f('0xa1')]=function(_0x332cc3,_0x2b74e6){var _0x22aee1=this['channel'][_0x837f('0xf')](_0x332cc3);if(_0x22aee1[_0x837f('0xa2')]===-0x1){return _0x22aee1;}logger[_0x837f('0x2c')](util['format']('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x2b74e6,_0x22aee1[_0x837f('0xa3')]));return this[_0x837f('0xb')][_0x837f('0x9e')](_0x2b74e6,_0x22aee1[_0x837f('0xa3')]);};AGIVertices[_0x837f('0xe')][_0x837f('0x85')]=function(_0x516122){return _0x516122&&_0x516122!=='0'&&_0x516122!=='-1'&&_0x516122!=='';};AGIVertices['prototype']['maxRetry']=function(_0x2fa086){this[_0x837f('0x32')]['sync'](this,_0x2fa086,'-');_0x2fa086[_0x837f('0xa4')]=_0x2fa086[_0x837f('0xa5')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype'][_0x837f('0xa6')]=function(_0x39d009){logger['info'](util['format'](_0x837f('0xa7'),_0x39d009['label']));if(!this[_0x837f('0x85')](_0x39d009[_0x837f('0x59')])){return this[_0x837f('0xb')][_0x837f('0xa8')](_0x837f('0xa9'));}var _0x449576='\x22'+_0x39d009[_0x837f('0x59')]+'\x22';if(this[_0x837f('0x85')](_0x39d009['options'])){_0x449576+=','+_0x39d009['options'];}var _0x405f9a=this['channel'][_0x837f('0xaa')](_0x837f('0xab'),_0x449576);if(_0x405f9a[_0x837f('0xa2')]===-0x1){return _0x405f9a;}return this[_0x837f('0xb')][_0x837f('0xa8')](util[_0x837f('0x25')]('Executed\x20command\x20MRCPSynth\x20%s',_0x449576));};AGIVertices[_0x837f('0xe')]['mrcprecog']=function(_0x3e6ed6){logger[_0x837f('0x2c')](util[_0x837f('0x25')](_0x837f('0xac'),_0x3e6ed6[_0x837f('0x34')]));if(!this[_0x837f('0x85')](_0x3e6ed6['grammar'])){return this['channel'][_0x837f('0xa8')]('no\x20grammar\x20configured');}var _0x1b4895=_0x3e6ed6[_0x837f('0xad')];if(this[_0x837f('0x85')](_0x3e6ed6[_0x837f('0x76')])){_0x1b4895+=','+_0x3e6ed6[_0x837f('0x76')];}var _0x5e330f=this[_0x837f('0xb')]['exec']('MRCPRecog',_0x1b4895);if(_0x5e330f[_0x837f('0xa2')]===-0x1){return _0x5e330f;}var _0x131aad=this[_0x837f('0xa1')](_0x837f('0xae'),_0x837f('0xaf'));if(_0x131aad[_0x837f('0xa2')]===-0x1){return _0x131aad;}var _0x13ed5a=this[_0x837f('0xa1')](_0x837f('0xb0'),_0x837f('0xb1'));if(_0x13ed5a['result']===-0x1){return _0x13ed5a;}var _0x42babf=this[_0x837f('0xa1')](_0x837f('0xb2'),_0x837f('0xb3'));if(_0x42babf['result']===-0x1){return _0x42babf;}return this[_0x837f('0xb')][_0x837f('0xa8')](util[_0x837f('0x25')](_0x837f('0xb4'),_0x1b4895));};AGIVertices[_0x837f('0xe')][_0x837f('0xb5')]=function(_0x15792b){logger[_0x837f('0x2c')](util[_0x837f('0x25')](_0x837f('0xb6'),_0x15792b[_0x837f('0x34')]));return this[_0x837f('0xb')][_0x837f('0xb5')]([_0x15792b['command'],_0x15792b[_0x837f('0xb7')]]);};AGIVertices[_0x837f('0xe')]['answer']=function(_0x142f46){logger[_0x837f('0x2c')](util[_0x837f('0x25')](_0x837f('0xb8'),_0x142f46[_0x837f('0x34')]));if(this[_0x837f('0x85')](_0x142f46[_0x837f('0x63')])){logger[_0x837f('0x2c')](util[_0x837f('0x25')](_0x837f('0xb9'),_0x142f46[_0x837f('0x63')]));var _0x19a6a3=this['channel'][_0x837f('0xba')](_0x142f46[_0x837f('0x63')]);if(_0x19a6a3['result']===-0x1){return _0x19a6a3;}}return this[_0x837f('0xb')][_0x837f('0xbb')]();};AGIVertices['prototype'][_0x837f('0x47')]=function(_0xae964c){logger[_0x837f('0x2c')](util[_0x837f('0x25')](_0x837f('0xbc'),_0xae964c[_0x837f('0x34')]));if(!this[_0x837f('0x85')](_0xae964c['list_id'])){return this[_0x837f('0xb')][_0x837f('0x28')](_0xae964c,'no\x20list\x20selected');}_0xae964c[_0x837f('0x46')]=moment();if(this[_0x837f('0x85')](_0xae964c[_0x837f('0xbd')])){_0xae964c['scheduledAt']=moment()[_0x837f('0xbe')](_0xae964c[_0x837f('0xbd')],_0x837f('0xbf'));}if(!this[_0x837f('0x85')](_0xae964c[_0x837f('0x4a')])){_0xae964c[_0x837f('0x4a')]=0x2;}this[_0x837f('0x3e')][_0x837f('0x6e')](this,_0xae964c);return this['channel']['noop'](util[_0x837f('0x25')](_0x837f('0xc0'),_0xae964c['phone'],_0xae964c['list_id'],_0xae964c[_0x837f('0x46')]));};AGIVertices[_0x837f('0xe')]['custom_app']=function(_0x1d7c12){logger[_0x837f('0x2c')](util[_0x837f('0x25')](_0x837f('0xc1'),_0x1d7c12[_0x837f('0x34')]));var _0x38475b=this[_0x837f('0xb')]['exec'](_0x1d7c12[_0x837f('0xc2')],_0x1d7c12[_0x837f('0x76')]);if(_0x38475b[_0x837f('0xa2')]===-0x1){return _0x38475b;}return this[_0x837f('0xb')][_0x837f('0xa8')](util[_0x837f('0x25')]('Executed\x20command\x20%s\x20%s',_0x1d7c12['application'],_0x1d7c12[_0x837f('0x76')]));};AGIVertices['prototype'][_0x837f('0xc3')]=function(_0x3205f3){logger[_0x837f('0x2c')](util[_0x837f('0x25')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x3205f3[_0x837f('0x34')]));if(!this[_0x837f('0x85')](_0x3205f3[_0x837f('0x59')])){return this[_0x837f('0xb')][_0x837f('0xa8')](_0x837f('0xa9'));}var _0x21efd2='\x22'+_0x3205f3[_0x837f('0x59')]+'\x22';if(this['isConfigured'](_0x3205f3['options'])){_0x21efd2+=','+_0x3205f3[_0x837f('0x76')];}var _0x45ca28=this[_0x837f('0xb')][_0x837f('0xaa')](_0x837f('0xab'),_0x21efd2);if(_0x45ca28[_0x837f('0xa2')]===-0x1){return _0x45ca28;}return this[_0x837f('0xb')]['noop'](util[_0x837f('0x25')](_0x837f('0xc4'),_0x21efd2));};AGIVertices[_0x837f('0xe')]['sestektts']=function(_0x199b80){logger['info'](util[_0x837f('0x25')](_0x837f('0xc5'),_0x199b80[_0x837f('0x34')]));if(!this[_0x837f('0x85')](_0x199b80[_0x837f('0x59')])){return this[_0x837f('0xb')]['noop'](_0x837f('0xa9'));}var _0x58029f='\x22'+_0x199b80[_0x837f('0x59')]+'\x22';if(this['isConfigured'](_0x199b80['options'])){_0x58029f+=','+_0x199b80['options'];}var _0xebb841=this[_0x837f('0xb')][_0x837f('0xaa')](_0x837f('0xab'),_0x58029f);if(_0xebb841[_0x837f('0xa2')]===-0x1){return _0xebb841;}return this[_0x837f('0xb')][_0x837f('0xa8')](util[_0x837f('0x25')](_0x837f('0xc4'),_0x58029f));};AGIVertices[_0x837f('0xe')][_0x837f('0xc6')]=function(_0xf949ef){logger['info'](util[_0x837f('0x25')](_0x837f('0xc7'),_0xf949ef[_0x837f('0x34')]));if(!this[_0x837f('0x85')](_0xf949ef[_0x837f('0xad')])){return this['channel']['noop'](_0x837f('0xc8'));}var _0x5939bf=_0xf949ef[_0x837f('0xad')];if(this['isConfigured'](_0xf949ef[_0x837f('0x76')])){_0x5939bf+=','+_0xf949ef['options'];}var _0xdd3059=this[_0x837f('0xb')][_0x837f('0xaa')](_0x837f('0xc9'),_0x5939bf);if(_0xdd3059['result']===-0x1){return _0xdd3059;}var _0x211b8b=this[_0x837f('0xa1')](_0x837f('0xae'),_0x837f('0xca'));if(_0x211b8b['result']===-0x1){return _0x211b8b;}var _0x528db3=this[_0x837f('0xa1')](_0x837f('0xb0'),_0x837f('0xcb'));if(_0x528db3[_0x837f('0xa2')]===-0x1){return _0x528db3;}var _0x56c3da=this['getAndSetVariable'](_0x837f('0xb2'),_0x837f('0xcc'));if(_0x56c3da[_0x837f('0xa2')]===-0x1){return _0x56c3da;}return this[_0x837f('0xb')][_0x837f('0xa8')](util[_0x837f('0x25')](_0x837f('0xb4'),_0x5939bf));};AGIVertices[_0x837f('0xe')][_0x837f('0xcd')]=function(_0x5aac3b){logger[_0x837f('0x2c')](util[_0x837f('0x25')](_0x837f('0xce'),_0x5aac3b['label']));if(!this[_0x837f('0x85')](_0x5aac3b[_0x837f('0xad')])){return this['channel'][_0x837f('0xa8')](_0x837f('0xc8'));}var _0x143436=_0x5aac3b[_0x837f('0xad')];if(this[_0x837f('0x85')](_0x5aac3b['options'])){_0x143436+=','+_0x5aac3b[_0x837f('0x76')];}var _0x1b4393=this[_0x837f('0xb')][_0x837f('0xaa')]('MRCPRecog',_0x143436);if(_0x1b4393[_0x837f('0xa2')]===-0x1){return _0x1b4393;}var _0x1205ee=this['getAndSetVariable']('RECOG_CONFIDENCE()',_0x837f('0xcf'));if(_0x1205ee[_0x837f('0xa2')]===-0x1){return _0x1205ee;}var _0x312c22=this[_0x837f('0xa1')](_0x837f('0xb0'),_0x837f('0xd0'));if(_0x312c22[_0x837f('0xa2')]===-0x1){return _0x312c22;}var _0x1c2bf0=this[_0x837f('0xa1')](_0x837f('0xb2'),'SESTEK_ASR_INSTANCE');if(_0x1c2bf0[_0x837f('0xa2')]===-0x1){return _0x1c2bf0;}return this['channel'][_0x837f('0xa8')](util[_0x837f('0x25')]('Executed\x20command\x20MRCPRecog\x20%s',_0x143436));};AGIVertices[_0x837f('0xe')][_0x837f('0xd1')]=function(_0x30f1f8){logger[_0x837f('0x2c')](util[_0x837f('0x25')](_0x837f('0xd2'),_0x30f1f8[_0x837f('0x34')]));if(!this[_0x837f('0x85')](_0x30f1f8[_0x837f('0xd3')])){return this[_0x837f('0xb')][_0x837f('0x28')](_0x30f1f8,'no\x20database\x20selected');}var _0x5042b8=this[_0x837f('0x16')][_0x837f('0x6e')](this,_0x30f1f8[_0x837f('0xd3')]);if(!_0x5042b8){return this[_0x837f('0xb')]['error'](_0x30f1f8,_0x837f('0xd4'));}if(!this[_0x837f('0x85')](_0x30f1f8[_0x837f('0x2a')])){return this['channel']['error'](_0x30f1f8,_0x837f('0xd5'));}var _0x55578e=_0x30f1f8[_0x837f('0x2a')][_0x837f('0xd6')](/(\r\n|\n|\r)/gm,'\x20');this[_0x837f('0xb')][_0x837f('0xa8')](util['format'](_0x837f('0xd7'),_0x55578e));var _0x21d98d=this['getQueryOdbc'][_0x837f('0x6e')](this,_0x5042b8,_0x55578e);this[_0x837f('0x32')][_0x837f('0x6e')](this,_0x30f1f8,_0x55578e);if(!this[_0x837f('0x85')](_0x30f1f8[_0x837f('0xd8')])){return this['channel'][_0x837f('0xa8')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x1e24a9=this['getVariable'][_0x837f('0x6e')](this,_0x30f1f8['variable_id']);if(!_0x1e24a9){return this[_0x837f('0xb')][_0x837f('0x28')](_0x30f1f8,_0x837f('0xd9'));}var _0x3d7f96=this;_0x21d98d[_0x837f('0xda')](function(_0x5cee6a,_0x3e4e5f){Object[_0x837f('0xdb')](_0x5cee6a)['forEach'](function(_0x5d5b8d){_0x3d7f96[_0x837f('0xb')][_0x837f('0x9e')](util[_0x837f('0x25')](_0x837f('0xdc'),_0x1e24a9,_0x3e4e5f,_0x5d5b8d),_0x5cee6a[_0x5d5b8d]);});});this['channel'][_0x837f('0x9e')](util[_0x837f('0x25')](_0x837f('0xdd'),_0x1e24a9),_0x21d98d[_0x837f('0x9d')]);return this[_0x837f('0xb')][_0x837f('0xa8')](util[_0x837f('0x25')](_0x837f('0xde'),_0x1e24a9));};AGIVertices[_0x837f('0xe')][_0x837f('0xdf')]=function(_0x4e4796){logger[_0x837f('0xe0')](util['format'](_0x837f('0xe1'),_0x4e4796[_0x837f('0x34')]));if(!this['isConfigured'](_0x4e4796[_0x837f('0xe2')])){return this[_0x837f('0xb')]['error'](_0x4e4796,'no\x20user\x20selected');}var _0x5c4444=this[_0x837f('0x19')][_0x837f('0x6e')](this,_0x4e4796[_0x837f('0xe2')]);if(!_0x5c4444){return this['channel']['error'](_0x4e4796,'no\x20user\x20found');}var _0x52eb53=this[_0x837f('0xb')]['exec'](_0x837f('0xe3'),[util[_0x837f('0x25')](_0x837f('0xe4'),_0x5c4444),_0x4e4796[_0x837f('0x63')],_0x4e4796[_0x837f('0xe5')],_0x4e4796[_0x837f('0x61')]]);if(_0x52eb53[_0x837f('0xa2')]===-0x1){return _0x52eb53;}return this[_0x837f('0xb')]['noop'](util[_0x837f('0x25')](_0x837f('0xe6'),_0x837f('0xe3')));};AGIVertices[_0x837f('0xe')][_0x837f('0xe7')]=function(_0x5145ae){logger['info'](util[_0x837f('0x25')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x5145ae[_0x837f('0x34')]));if(!this[_0x837f('0x85')](_0x5145ae['key'])){return this['channel']['noop'](_0x837f('0xe8'));}if(!this['isConfigured'](_0x5145ae[_0x837f('0x59')])){return this[_0x837f('0xb')][_0x837f('0xa8')]('no\x20text\x20configured');}this[_0x837f('0xb')][_0x837f('0xe9')]=!![];this['createSquareDetailsReport'](_0x5145ae);this['createSquareMessage'](_0x5145ae['text'],'in','','');this[_0x837f('0xb')][_0x837f('0xa8')](util[_0x837f('0x25')](_0x837f('0xea'),_0x5145ae[_0x837f('0x59')]));var _0x55b545=this['googleDialogflow']['sync'](this,_0x5145ae);if(_0x55b545){for(var _0x4fb43a in _0x55b545){if(_0x55b545[_0x837f('0x99')](_0x4fb43a)){this[_0x837f('0xb')]['setVariable'](util[_0x837f('0x25')]('DIALOGFLOW_%s',_0x4fb43a[_0x837f('0x68')]()),_0x55b545[_0x4fb43a]);}}this[_0x837f('0x3d')](_0x55b545[_0x837f('0xeb')],_0x837f('0xec'),'dialogflow','');return this[_0x837f('0xb')][_0x837f('0xa8')](util['format'](_0x837f('0xed'),_0x55b545[_0x837f('0xeb')]));}return this[_0x837f('0xb')][_0x837f('0x28')](_0x5145ae,_0x837f('0xee'));};AGIVertices[_0x837f('0xe')][_0x837f('0xef')]=function(_0x47d7f6){logger[_0x837f('0x2c')](util[_0x837f('0x25')](_0x837f('0xf0'),_0x47d7f6[_0x837f('0x34')]));if(!this[_0x837f('0x85')](_0x47d7f6[_0x837f('0x7a')])){return this['channel'][_0x837f('0xa8')](_0x837f('0xf1'));}if(!this[_0x837f('0x85')](_0x47d7f6[_0x837f('0x7b')])){return this[_0x837f('0xb')][_0x837f('0xa8')](_0x837f('0xf2'));}if(!this[_0x837f('0x85')](_0x47d7f6[_0x837f('0x7c')])){return this[_0x837f('0xb')][_0x837f('0xa8')](_0x837f('0xf3'));}if(!this[_0x837f('0x85')](_0x47d7f6[_0x837f('0x7d')])){return this[_0x837f('0xb')][_0x837f('0xa8')](_0x837f('0xf4'));}if(!this[_0x837f('0x85')](_0x47d7f6[_0x837f('0x59')])){return this[_0x837f('0xb')][_0x837f('0xa8')](_0x837f('0xa9'));}this[_0x837f('0xb')][_0x837f('0xe9')]=!![];this[_0x837f('0x32')](_0x47d7f6);this['createSquareMessage'](_0x47d7f6[_0x837f('0x59')],'in','','');this[_0x837f('0xb')][_0x837f('0xa8')](util[_0x837f('0x25')]('Trying\x20DialogflowV2:\x20%s',_0x47d7f6[_0x837f('0x59')]));var _0x5acd46=this[_0x837f('0x79')][_0x837f('0x6e')](this,_0x47d7f6);if(_0x5acd46){for(var _0x8705d6 in _0x5acd46){if(_0x5acd46['hasOwnProperty'](_0x8705d6)){if(_0x8705d6!==_0x837f('0xf5')){this[_0x837f('0xb')][_0x837f('0x9e')](util[_0x837f('0x25')](_0x837f('0xf6'),_0x8705d6[_0x837f('0x68')]()),_0x5acd46[_0x8705d6]);}}}this[_0x837f('0x3d')](_0x5acd46[_0x837f('0xeb')],'out','dialogflowV2',_0x5acd46[_0x837f('0xf5')]);return this[_0x837f('0xb')][_0x837f('0xa8')](util[_0x837f('0x25')](_0x837f('0xf7'),_0x5acd46[_0x837f('0xeb')]));}return this['channel'][_0x837f('0x28')](_0x47d7f6,_0x837f('0xf8'));};AGIVertices[_0x837f('0xe')]['sesteknda']=function(_0x4fde3f){logger[_0x837f('0x2c')](util[_0x837f('0x25')](_0x837f('0xf9'),_0x4fde3f[_0x837f('0x34')]));if(!this['isConfigured'](_0x4fde3f['ndauth_url'])){return this[_0x837f('0xb')][_0x837f('0xa8')](_0x837f('0xfa'));}if(!this[_0x837f('0x85')](_0x4fde3f[_0x837f('0xfb')])){return this[_0x837f('0xb')]['noop']('no\x20username\x20configured');}if(!this['isConfigured'](_0x4fde3f['password'])){return this[_0x837f('0xb')][_0x837f('0xa8')](_0x837f('0xfc'));}if(!this['isConfigured'](_0x4fde3f[_0x837f('0xfd')])){return this[_0x837f('0xb')][_0x837f('0xa8')](_0x837f('0xa9'));}this['channel'][_0x837f('0xe9')]=!![];this[_0x837f('0x32')](_0x4fde3f);this['createSquareMessage'](_0x4fde3f[_0x837f('0x59')],'in','','');this[_0x837f('0xb')][_0x837f('0xa8')](util[_0x837f('0x25')](_0x837f('0xfe'),_0x4fde3f[_0x837f('0x59')]));var _0x4e29ad=this['sestekNDA'][_0x837f('0x6e')](this,_0x4fde3f);if(_0x4e29ad){for(var _0x5ddfab in _0x4e29ad){if(_0x4e29ad[_0x837f('0x99')](_0x5ddfab)){this[_0x837f('0xb')][_0x837f('0x9e')](util[_0x837f('0x25')]('SESTEK_NDA_%s',_0x5ddfab[_0x837f('0x68')]()),_0x4e29ad[_0x5ddfab]);}}this[_0x837f('0x3d')](_0x4e29ad[_0x837f('0xeb')],'out',_0x837f('0xff'),'');if(_0x4e29ad['audiofile']){this['channel'][_0x837f('0xa8')](util[_0x837f('0x25')](_0x837f('0x100'),_0x4e29ad[_0x837f('0x101')]));var _0x5f35ba=this[_0x837f('0xb')][_0x837f('0x102')](_0x4e29ad[_0x837f('0x101')]);try{fs[_0x837f('0x103')](_0x4e29ad[_0x837f('0x101')]+'.wav');}catch(_0x895beb){logger[_0x837f('0x28')](_0x895beb);}return _0x5f35ba;}else{return this[_0x837f('0xb')][_0x837f('0xa8')](util[_0x837f('0x25')]('SestekNDA\x20Result\x20%s',_0x4e29ad[_0x837f('0xeb')]));}}return this[_0x837f('0xb')][_0x837f('0x28')](_0x4fde3f,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0x837f('0xe')][_0x837f('0x104')]=function(_0x11b2cf){logger['info'](util['format'](_0x837f('0x105'),_0x11b2cf[_0x837f('0x34')]));return this[_0x837f('0xb')][_0x837f('0xa8')](_0x837f('0x104'));};AGIVertices[_0x837f('0xe')]['ext_dial']=function(_0x50bab4){logger['info'](util[_0x837f('0x25')](_0x837f('0x106'),_0x50bab4[_0x837f('0x34')]));var _0x8f786c='';if(_0x50bab4['trunk_id']){if(!this[_0x837f('0x85')](_0x50bab4['trunk_id'])){return this[_0x837f('0xb')][_0x837f('0x28')](_0x50bab4,_0x837f('0x107'));}else{var _0x32f32f=parseInt(_0x50bab4[_0x837f('0x108')],0xa);if(isNaN(_0x32f32f)){_0x8f786c=_0x50bab4[_0x837f('0x108')];}else{_0x8f786c=this[_0x837f('0x1b')][_0x837f('0x6e')](this,_0x50bab4[_0x837f('0x108')]);if(!_0x8f786c){return this[_0x837f('0xb')][_0x837f('0x28')](_0x50bab4,_0x837f('0x109'));}}}}else if(_0x50bab4[_0x837f('0x10a')]){_0x8f786c=_0x50bab4[_0x837f('0x10a')];}else{return this[_0x837f('0xb')]['error'](_0x50bab4,_0x837f('0x107'));}var _0x3a3a15=this[_0x837f('0xb')][_0x837f('0xaa')](_0x837f('0xe3'),[util[_0x837f('0x25')]('SIP/%s/%s',_0x8f786c,_0x50bab4[_0x837f('0x44')]),_0x50bab4['timeout'],_0x50bab4[_0x837f('0xe5')],_0x50bab4[_0x837f('0x61')]]);if(_0x3a3a15[_0x837f('0xa2')]===-0x1){return _0x3a3a15;}return this[_0x837f('0xb')]['noop'](util[_0x837f('0x25')](_0x837f('0xe6'),_0x837f('0xe3')));};AGIVertices[_0x837f('0xe')][_0x837f('0x10b')]=function(_0x2094eb){logger[_0x837f('0x2c')](util[_0x837f('0x25')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x2094eb['label']));return this['channel']['noop'](_0x837f('0x10b'));};AGIVertices[_0x837f('0xe')]['getdigits']=function(_0x5c8007){logger['info'](util[_0x837f('0x25')](_0x837f('0x10c'),_0x5c8007['label']));if(_0x5c8007[_0x837f('0xa4')]===0x0){return this['maxRetry'](_0x5c8007);}_0x5c8007[_0x837f('0xa4')]-=0x1;if(!this[_0x837f('0x85')](_0x5c8007[_0x837f('0x10d')])){return this[_0x837f('0xb')][_0x837f('0x28')](_0x5c8007,_0x837f('0x10e'));}var _0x473397=this[_0x837f('0x10f')]['sync'](this,_0x5c8007[_0x837f('0x10d')]);if(!_0x473397){return this[_0x837f('0xb')]['error'](_0x5c8007,'no\x20file\x20audio\x20found');}if(!this[_0x837f('0x85')](_0x5c8007[_0x837f('0xd8')])){return this[_0x837f('0xb')][_0x837f('0x28')](_0x837f('0x110'));}var _0x53e880=this[_0x837f('0xb')]['getData'](_0x473397,_0x5c8007[_0x837f('0x111')],_0x5c8007['maxdigit']);var _0x41b39e=_0x53e880[_0x837f('0xa2')]?_0x53e880[_0x837f('0xa2')][_0x837f('0x49')]():'';logger[_0x837f('0x2c')](_0x837f('0x112'),JSON['stringify'](_0x53e880));if(_0x53e880[_0x837f('0xa2')]===-0x1){this['createSquareDetailsReport'][_0x837f('0x6e')](this,_0x5c8007,_0x41b39e);return _0x53e880;}else if(_0x53e880['extra']===_0x837f('0x63')){_0x53e880[_0x837f('0xa2')]=_0x41b39e[_0x837f('0x9d')]>=parseInt(_0x5c8007[_0x837f('0x113')])?'x':'i';}else{_0x53e880['result']=_0x41b39e['length']>=parseInt(_0x5c8007[_0x837f('0x113')])&&_0x41b39e[_0x837f('0x9d')]<=parseInt(_0x5c8007[_0x837f('0x114')])?'x':'i';}var _0x49e139=this[_0x837f('0xf')][_0x837f('0x6e')](this,_0x5c8007[_0x837f('0xd8')]);if(!_0x49e139){return this[_0x837f('0xb')][_0x837f('0x28')](_0x5c8007,_0x837f('0xd9'));}this[_0x837f('0xb')][_0x837f('0x9e')](_0x49e139,_0x41b39e);if(this[_0x837f('0x85')](_0x5c8007[_0x837f('0x115')])){var _0x578dda=parseInt(_0x5c8007[_0x837f('0x115')],0xa);var _0x482c86=rs[_0x837f('0x116')]({'charset':'*','length':_0x578dda});var _0x1c288c=_0x41b39e['length'];if(_0x1c288c>0x0){if(_0x1c288c>_0x578dda){this['createSquareDetailsReport'][_0x837f('0x6e')](this,_0x5c8007,_0x5c8007[_0x837f('0x117')]==='first'?_0x482c86+_0x41b39e[_0x837f('0x118')](_0x578dda):_0x41b39e['substr'](0x0,_0x1c288c-_0x578dda)+_0x482c86);}else{this[_0x837f('0x32')][_0x837f('0x6e')](this,_0x5c8007,rs[_0x837f('0x116')]({'charset':'*','length':_0x1c288c}));}}else{this['createSquareDetailsReport'][_0x837f('0x6e')](this,_0x5c8007,'');}}else{this[_0x837f('0x32')][_0x837f('0x6e')](this,_0x5c8007,_0x41b39e);}return _0x53e880;};AGIVertices[_0x837f('0xe')]['getsecretdigits']=function(_0xcef8db){logger['info'](util[_0x837f('0x25')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0xcef8db[_0x837f('0x34')]));return this['getdigits'](_0xcef8db);};AGIVertices['prototype'][_0x837f('0x119')]=function(_0x5bc882){logger[_0x837f('0x2c')](util[_0x837f('0x25')](_0x837f('0x11a'),_0x5bc882[_0x837f('0x34')]));this[_0x837f('0x32')][_0x837f('0x6e')](this,_0x5bc882,_0x5bc882['goalname']);return this[_0x837f('0xb')][_0x837f('0xa8')](util[_0x837f('0x25')]('GOAL\x20%s',_0x5bc882[_0x837f('0x11b')]));};AGIVertices['prototype']['awspolly']=function(_0x35268d){logger[_0x837f('0x2c')](util['format'](_0x837f('0x11c'),_0x35268d[_0x837f('0x34')]));if(!this[_0x837f('0x85')](_0x35268d[_0x837f('0x8d')])||!this['isConfigured'](_0x35268d['aws_secret_access_key'])){return this[_0x837f('0xb')][_0x837f('0xa8')]('no\x20valid\x20credentials\x20configured');}if(!this['isConfigured'](_0x35268d['text'])){return this[_0x837f('0xb')][_0x837f('0xa8')](_0x837f('0xa9'));}this['channel'][_0x837f('0xa8')](util[_0x837f('0x25')]('Trying\x20aws\x20Polly\x20%s',_0x35268d[_0x837f('0x59')]));var _0x29da32=this[_0x837f('0x87')][_0x837f('0x6e')](this,_0x35268d);if(_0x29da32){this[_0x837f('0xb')][_0x837f('0xa8')](util[_0x837f('0x25')]('aws\x20Polly\x20%s\x20file\x20created',_0x29da32));var _0x59fa81=this['channel'][_0x837f('0x102')](_0x29da32);try{fs[_0x837f('0x103')](_0x29da32+_0x837f('0x11d'));}catch(_0x113a65){logger[_0x837f('0x28')](_0x113a65);}return _0x59fa81;}return this[_0x837f('0xb')]['error'](_0x35268d,'aws\x20Polly\x20is\x20unreachable');};AGIVertices[_0x837f('0xe')][_0x837f('0x11e')]=function(_0x36ea95){logger[_0x837f('0x2c')](util[_0x837f('0x25')](_0x837f('0x11f'),_0x36ea95[_0x837f('0x34')]));if(!this[_0x837f('0x85')](_0x36ea95[_0x837f('0x8d')])||!this[_0x837f('0x85')](_0x36ea95[_0x837f('0x88')])){return this[_0x837f('0xb')][_0x837f('0xa8')](_0x837f('0x120'));}if(!this[_0x837f('0x85')](_0x36ea95[_0x837f('0x121')])){return this[_0x837f('0xb')][_0x837f('0xa8')](_0x837f('0x122'));}if(!this[_0x837f('0x85')](_0x36ea95[_0x837f('0x59')])){return this[_0x837f('0xb')]['noop'](_0x837f('0xa9'));}this[_0x837f('0xb')][_0x837f('0xe9')]=!![];this[_0x837f('0x32')](_0x36ea95);this[_0x837f('0x3d')](_0x36ea95[_0x837f('0x59')],'in','','');this[_0x837f('0xb')]['noop'](util[_0x837f('0x25')](_0x837f('0x123'),_0x36ea95[_0x837f('0x59')]));var _0x1fe100=this[_0x837f('0x8c')]['sync'](this,_0x36ea95);if(_0x1fe100){for(var _0x388ed1 in _0x1fe100){if(_0x1fe100['hasOwnProperty'](_0x388ed1)&&_[_0x837f('0x94')](_0x1fe100[_0x388ed1])){this[_0x837f('0xb')]['setVariable'](util['format'](_0x837f('0x124'),_0x388ed1[_0x837f('0x68')]()),_0x1fe100[_0x388ed1]);}}if(_[_0x837f('0x40')](_0x1fe100[_0x837f('0x75')])){return this['channel']['noop'](_0x837f('0x125'));}else{this[_0x837f('0x3d')](_0x1fe100['message'],_0x837f('0xec'),_0x837f('0x126'),'');return this[_0x837f('0xb')][_0x837f('0xa8')](util[_0x837f('0x25')]('Amazon\x20Lex\x20Result\x20%s',_0x1fe100['message']));}}return this[_0x837f('0xb')][_0x837f('0x28')](_0x36ea95,_0x837f('0x127'));};AGIVertices[_0x837f('0xe')][_0x837f('0x128')]=function(_0x14bc2b){logger[_0x837f('0x2c')](util[_0x837f('0x25')](_0x837f('0x129'),_0x14bc2b['label'],_0x14bc2b[_0x837f('0x63')]));if(!this[_0x837f('0x85')](_0x14bc2b[_0x837f('0x80')])){return this['channel'][_0x837f('0xa8')](_0x837f('0xe8'));}var _0x2db459='wav';var _0x28ea85=util[_0x837f('0x25')](_0x837f('0x12a'),FILES_PATH,rs[_0x837f('0x116')](0x4));var _0x3d2d05=util[_0x837f('0x25')](_0x837f('0x9c'),_0x28ea85,_0x2db459);var _0x5c6697=!![];if(_0x14bc2b[_0x837f('0x12b')]===_0x837f('0x12c')){_0x5c6697=![];}var _0x537665=this['channel'][_0x837f('0x12d')](_0x28ea85,_0x2db459,_0x14bc2b[_0x837f('0x12e')],_0x14bc2b[_0x837f('0x63')],undefined,_0x5c6697);if(_0x537665[_0x837f('0xa2')]!==-0x1){this[_0x837f('0xb')]['noop'](util[_0x837f('0x25')](_0x837f('0x12f'),_0x3d2d05));var _0xd3a9c0=this[_0x837f('0x130')]['sync'](this,_0x14bc2b,_0x3d2d05);if(_0xd3a9c0){for(var _0x455292 in _0xd3a9c0){if(_0xd3a9c0['hasOwnProperty'](_0x455292)){this[_0x837f('0xb')]['setVariable'](util['format'](_0x837f('0x131'),_0x455292[_0x837f('0x68')]()),_0xd3a9c0[_0x455292]);}}return this[_0x837f('0xb')][_0x837f('0xa8')](util[_0x837f('0x25')]('GoogleASR\x20Result\x20%s',JSON['stringify'](_0xd3a9c0)));}}return _0x537665;};AGIVertices[_0x837f('0xe')][_0x837f('0x132')]=function(_0x258e99){logger[_0x837f('0x2c')](util[_0x837f('0x25')](_0x837f('0x133'),_0x258e99[_0x837f('0x34')]));if(!this[_0x837f('0x85')](_0x258e99[_0x837f('0x91')])){return this[_0x837f('0xb')][_0x837f('0xa8')]('no\x20appid\x20configured');}if(!this['isConfigured'](_0x258e99[_0x837f('0x134')])){return this[_0x837f('0xb')]['noop']('no\x20appsecret\x20configured');}var _0x35f770=_0x837f('0x135');var _0x235fbf=util[_0x837f('0x25')](_0x837f('0x12a'),FILES_PATH,rs[_0x837f('0x116')](0x4));var _0x27cd78=util[_0x837f('0x25')](_0x837f('0x9c'),_0x235fbf,_0x35f770);var _0x37a40e=!![];if(_0x258e99[_0x837f('0x12b')]===_0x837f('0x12c')){_0x37a40e=![];}var _0x2bdec4=this[_0x837f('0xb')][_0x837f('0x12d')](_0x235fbf,_0x35f770,_0x258e99[_0x837f('0x12e')],_0x258e99['timeout'],undefined,_0x37a40e);if(_0x2bdec4[_0x837f('0xa2')]!==-0x1){this[_0x837f('0xb')][_0x837f('0xa8')](util[_0x837f('0x25')]('tilde\x20%s\x20file\x20created',_0x27cd78));var _0x52be1d=this[_0x837f('0x90')][_0x837f('0x6e')](this,_0x258e99,_0x27cd78);if(_0x52be1d){for(var _0x28ac7d in _0x52be1d){if(_0x52be1d[_0x837f('0x99')](_0x28ac7d)){this[_0x837f('0xb')]['setVariable'](util[_0x837f('0x25')](_0x837f('0x136'),_0x28ac7d[_0x837f('0x68')]()),_0x52be1d[_0x28ac7d]);}}return this['channel'][_0x837f('0xa8')](util[_0x837f('0x25')]('TildeASR\x20Result\x20%s',JSON['stringify'](_0x52be1d)));}}return _0x2bdec4;};AGIVertices[_0x837f('0xe')][_0x837f('0x137')]=function(_0x374034){logger[_0x837f('0x2c')](util[_0x837f('0x25')](_0x837f('0x138'),_0x374034[_0x837f('0x34')]));return this[_0x837f('0xb')][_0x837f('0x139')](_0x374034[_0x837f('0x3a')],_0x374034[_0x837f('0x13a')],_0x374034[_0x837f('0x13b')]);};AGIVertices['prototype'][_0x837f('0x13c')]=function(_0x18670f){logger[_0x837f('0x2c')](util[_0x837f('0x25')]('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x18670f['label']));if(!this[_0x837f('0x85')](_0x18670f['condition'])){return this['channel'][_0x837f('0x28')](_0x18670f,_0x837f('0x13d'));}try{var _0x360b03=eval(_0x18670f[_0x837f('0x13e')])?_0x837f('0x13f'):_0x837f('0x140');this[_0x837f('0xb')]['noop'](util['format'](_0x837f('0x141'),_0x18670f['condition'],_0x360b03));return{'code':0xc8,'result':_0x360b03};}catch(_0x374392){return{'code':0xc8,'result':_0x837f('0x140')};}};AGIVertices[_0x837f('0xe')]['gotoiftime']=function(_0x5ab48c){logger[_0x837f('0x2c')](util[_0x837f('0x25')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x5ab48c['label']));if(!this[_0x837f('0x85')](_0x5ab48c[_0x837f('0x142')])){return this[_0x837f('0xb')][_0x837f('0x28')](_0x5ab48c,_0x837f('0x143'));}var _0x15e24a=this[_0x837f('0x21')][_0x837f('0x6e')](this,_0x5ab48c[_0x837f('0x142')]);if(!_0x15e24a){return this[_0x837f('0xb')][_0x837f('0x28')](_0x5ab48c,_0x837f('0x144'));}for(var _0x1a3591=0x0;_0x1a3591<_0x15e24a[_0x837f('0x9d')];_0x1a3591+=0x1){var _0x349b0c=this[_0x837f('0xb')]['getVariable'](util[_0x837f('0x25')](_0x837f('0x145'),_0x15e24a[_0x1a3591]));if(_0x349b0c[_0x837f('0xa2')]===-0x1){return _0x349b0c;}logger['info'](util[_0x837f('0x25')](_0x837f('0x146'),_0x15e24a[_0x1a3591],_0x349b0c[_0x837f('0xa3')]));if(_0x349b0c['extra']===_0x837f('0x13f')){logger['info'](util[_0x837f('0x25')](_0x837f('0x146'),_0x15e24a[_0x1a3591],_0x837f('0x13f')));this['channel']['noop'](util[_0x837f('0x25')]('IFTIME\x20%s\x20%s',_0x15e24a[_0x1a3591],_0x837f('0x13f')));return{'code':0xc8,'result':_0x837f('0x13f')};}else{logger[_0x837f('0x2c')](util[_0x837f('0x25')]('IFTIME\x20%s\x20%s',_0x15e24a[_0x1a3591],_0x837f('0x140')));this[_0x837f('0xb')][_0x837f('0xa8')](util[_0x837f('0x25')]('IFTIME\x20%s\x20%s',_0x15e24a[_0x1a3591],'false'));}}return{'code':0xc8,'result':_0x837f('0x140')};};AGIVertices[_0x837f('0xe')][_0x837f('0x147')]=function(_0x5e8d4d){logger[_0x837f('0x2c')](util[_0x837f('0x25')](_0x837f('0x148'),_0x5e8d4d[_0x837f('0x34')]));return this['channel'][_0x837f('0x147')]();};AGIVertices['prototype'][_0x837f('0x149')]=function(_0x3e701e){logger['info'](util[_0x837f('0x25')](_0x837f('0x14a'),_0x3e701e[_0x837f('0x34')]));if(!this[_0x837f('0x85')](_0x3e701e[_0x837f('0x80')])){return this[_0x837f('0xb')]['noop'](_0x837f('0xe8'));}var _0x241e7d=_0x837f('0x135');var _0x103deb=util[_0x837f('0x25')](_0x837f('0x12a'),FILES_PATH,rs[_0x837f('0x116')](0x4));var _0x51be2e=util['format'](_0x837f('0x9c'),_0x103deb,_0x241e7d);var _0x4e4883=!![];if(_0x3e701e[_0x837f('0x12b')]===_0x837f('0x12c')){_0x4e4883=![];}var _0x4a690e=this['channel'][_0x837f('0x12d')](_0x103deb,_0x241e7d,_0x3e701e[_0x837f('0x12e')],_0x3e701e[_0x837f('0x63')],undefined,_0x4e4883);if(_0x4a690e['result']!==-0x1){this[_0x837f('0xb')][_0x837f('0xa8')](util[_0x837f('0x25')](_0x837f('0x14b'),_0x51be2e));var _0x3a848e=this[_0x837f('0x83')][_0x837f('0x6e')](this,_0x3e701e,_0x51be2e);if(_0x3a848e){for(var _0x349b06 in _0x3a848e){if(_0x3a848e[_0x837f('0x99')](_0x349b06)){this[_0x837f('0xb')][_0x837f('0x9e')](util[_0x837f('0x25')]('ISPEECH_ASR_%s',_0x349b06[_0x837f('0x68')]()),_0x3a848e[_0x349b06]);}}return this['channel'][_0x837f('0xa8')](util[_0x837f('0x25')](_0x837f('0x14c'),JSON[_0x837f('0x71')](_0x3a848e)));}}return _0x4a690e;};AGIVertices['prototype']['ispeechtts']=function(_0x1c1285){logger[_0x837f('0x2c')](util[_0x837f('0x25')](_0x837f('0x14d'),_0x1c1285[_0x837f('0x34')]));if(!this[_0x837f('0x85')](_0x1c1285[_0x837f('0x80')])){return this[_0x837f('0xb')][_0x837f('0xa8')](_0x837f('0xe8'));}if(!this[_0x837f('0x85')](_0x1c1285[_0x837f('0x59')])){return this[_0x837f('0xb')][_0x837f('0xa8')](_0x837f('0xa9'));}this[_0x837f('0xb')][_0x837f('0xa8')](util[_0x837f('0x25')]('Trying\x20ispeech\x20TTS\x20%s',_0x1c1285[_0x837f('0x59')]));var _0x3df752=this[_0x837f('0x7f')][_0x837f('0x6e')](this,_0x1c1285);if(_0x3df752){this['channel'][_0x837f('0xa8')](util[_0x837f('0x25')]('ispeech\x20%s\x20file\x20created',_0x3df752));var _0x9b5ba3=this[_0x837f('0xb')][_0x837f('0x102')](_0x3df752,_0x1c1285['intKey']);try{fs[_0x837f('0x103')](_0x3df752+'.wav');}catch(_0x2c6bc8){logger[_0x837f('0x28')](_0x2c6bc8);}return _0x9b5ba3;}return this[_0x837f('0xb')]['error'](_0x1c1285,_0x837f('0x14e'));};AGIVertices[_0x837f('0xe')][_0x837f('0x14f')]=function(_0x34aa15){logger[_0x837f('0x2c')](util['format'](_0x837f('0x150'),_0x34aa15['label']));if(!this[_0x837f('0x85')](_0x34aa15[_0x837f('0x151')])){return this[_0x837f('0xb')][_0x837f('0x28')](_0x34aa15,'no\x20find\x20by\x20configured');}logger['info'](util[_0x837f('0x25')](_0x837f('0x152'),this[_0x837f('0xb')]['callerid'],_0x34aa15['findBy']));var _0x1fb001=this[_0x837f('0x51')][_0x837f('0x6e')](this,_0x34aa15[_0x837f('0x151')]);if(_0x1fb001){logger[_0x837f('0x2c')](util[_0x837f('0x25')](_0x837f('0x153'),this[_0x837f('0xb')]['callerid'],_0x34aa15['findBy']));this[_0x837f('0xb')][_0x837f('0xa8')](util[_0x837f('0x25')](_0x837f('0x153'),this[_0x837f('0xb')][_0x837f('0x38')],_0x34aa15[_0x837f('0x151')]));return{'code':0xc8,'result':'success'};}else{logger[_0x837f('0x2c')](util[_0x837f('0x25')](_0x837f('0x154'),this[_0x837f('0xb')][_0x837f('0x38')],_0x34aa15['findBy']));this['channel'][_0x837f('0xa8')](util[_0x837f('0x25')](_0x837f('0x154'),this[_0x837f('0xb')][_0x837f('0x38')],_0x34aa15[_0x837f('0x151')]));return{'code':0xc8,'result':_0x837f('0x155')};}};AGIVertices[_0x837f('0xe')]['logout']=function(_0x39d502){logger[_0x837f('0x2c')](util[_0x837f('0x25')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x39d502[_0x837f('0x34')]));if(!this['isConfigured'](_0x39d502[_0x837f('0x151')])){return this['channel'][_0x837f('0x28')](_0x39d502,'no\x20find\x20by\x20configured');}logger[_0x837f('0x2c')](util[_0x837f('0x25')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x837f('0xb')]['callerid'],_0x39d502[_0x837f('0x151')]));var _0x25c5cc=this[_0x837f('0x50')][_0x837f('0x6e')](this,_0x39d502[_0x837f('0x151')]);if(_0x25c5cc){logger[_0x837f('0x2c')](util['format'](_0x837f('0x153'),this[_0x837f('0xb')][_0x837f('0x38')],_0x39d502[_0x837f('0x151')]));this[_0x837f('0xb')][_0x837f('0xa8')](util['format'](_0x837f('0x153'),this[_0x837f('0xb')]['callerid'],_0x39d502[_0x837f('0x151')]));return{'code':0xc8,'result':_0x837f('0x156')};}else{logger['info'](util[_0x837f('0x25')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x837f('0xb')][_0x837f('0x38')],_0x39d502['findBy']));this[_0x837f('0xb')][_0x837f('0xa8')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x837f('0xb')][_0x837f('0x38')],_0x39d502[_0x837f('0x151')]));return{'code':0xc8,'result':_0x837f('0x155')};}};AGIVertices[_0x837f('0xe')]['math']=function(_0x54d41f){logger[_0x837f('0x2c')](util[_0x837f('0x25')](_0x837f('0x157'),_0x54d41f[_0x837f('0x34')]));if(!this[_0x837f('0x85')](_0x54d41f[_0x837f('0x158')])){return this[_0x837f('0xb')][_0x837f('0x28')](_0x54d41f,_0x837f('0x159'));}this[_0x837f('0xb')]['noop'](util['format'](_0x837f('0x15a'),_0x54d41f[_0x837f('0x158')]));var _0x305f90=eval(_0x54d41f[_0x837f('0x158')]);if(!this[_0x837f('0x85')](_0x54d41f[_0x837f('0xd8')])){return this['channel'][_0x837f('0xa8')](_0x837f('0x110'));}var _0x262afb=this[_0x837f('0xf')][_0x837f('0x6e')](this,_0x54d41f[_0x837f('0xd8')]);if(!_0x262afb){return this[_0x837f('0xb')]['error'](_0x54d41f,'no\x20variable\x20found');}if(_[_0x837f('0x98')](_0x305f90)){var _0x4385b7=this;_0x305f90[_0x837f('0xda')](function(_0x231780,_0x2b22f3){_0x4385b7[_0x837f('0xb')][_0x837f('0x9e')](util[_0x837f('0x25')](_0x837f('0x15b'),_0x262afb,_0x2b22f3),_0x231780);});return this[_0x837f('0xb')][_0x837f('0xa8')](util['format'](_0x837f('0x15c'),_0x262afb));}else{return this[_0x837f('0xb')]['setVariable'](_0x262afb,_0x305f90);}};AGIVertices['prototype'][_0x837f('0x8')]=function(_0x4c9aaf){logger[_0x837f('0x2c')](util[_0x837f('0x25')]('Enter\x20in\x20MENU\x20(%s)\x20block',_0x4c9aaf[_0x837f('0x34')]));if(_0x4c9aaf[_0x837f('0xa4')]===0x0){return this[_0x837f('0xa5')](_0x4c9aaf);}_0x4c9aaf[_0x837f('0xa4')]-=0x1;if(!this[_0x837f('0x85')](_0x4c9aaf[_0x837f('0x10d')])){return this[_0x837f('0xb')][_0x837f('0x28')](_0x4c9aaf,'no\x20file\x20audio\x20selected');}var _0xc0312f=this[_0x837f('0x10f')]['sync'](this,_0x4c9aaf[_0x837f('0x10d')]);if(!_0xc0312f){return this[_0x837f('0xb')]['error'](_0x4c9aaf,_0x837f('0x15d'));}var _0x3efb08=this['channel'][_0x837f('0x15e')](_0xc0312f,_0x4c9aaf[_0x837f('0x111')],_0x4c9aaf[_0x837f('0x15f')]);var _0x3e45e2=_0x3efb08[_0x837f('0xa2')];if(_0x3efb08['result']===-0x1){this[_0x837f('0x32')][_0x837f('0x6e')](this,_0x4c9aaf,'-1');return _0x3efb08;}else if(_0x3efb08[_0x837f('0xa3')]===_0x837f('0x63')){_0x3efb08[_0x837f('0xa2')]=_0x3efb08[_0x837f('0xa2')][_0x837f('0x9d')]>0x0?_0x3efb08[_0x837f('0xa2')]:'t';}else if(_['isEmpty'](_0x3efb08[_0x837f('0xa2')])){_0x3efb08[_0x837f('0xa2')]='#';_0x3e45e2='#';}if(!this[_0x837f('0x85')](_0x4c9aaf[_0x837f('0xd8')])){this[_0x837f('0xb')]['noop'](_0x837f('0x110'));}else{var _0x76d76c=this[_0x837f('0xf')][_0x837f('0x6e')](this,_0x4c9aaf['variable_id']);if(!_0x76d76c){return this['channel'][_0x837f('0x28')](_0x4c9aaf,_0x837f('0xd9'));}this[_0x837f('0xb')]['setVariable'](_0x76d76c,_0x3e45e2);}this[_0x837f('0x32')]['sync'](this,_0x4c9aaf,_0x3e45e2);return _0x3efb08;};AGIVertices[_0x837f('0xe')][_0x837f('0xa8')]=function(_0x24323a){logger[_0x837f('0x2c')](util[_0x837f('0x25')](_0x837f('0x160'),_0x24323a[_0x837f('0x34')]));return this[_0x837f('0xb')][_0x837f('0xa8')](_0x24323a[_0x837f('0x161')]||_0x24323a[_0x837f('0x34')]);};AGIVertices['prototype'][_0x837f('0x162')]=function(_0x265460){logger[_0x837f('0x2c')](util['format']('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x265460['label']));if(!this[_0x837f('0x85')](_0x265460[_0x837f('0x151')])){return this[_0x837f('0xb')][_0x837f('0x28')](_0x265460,_0x837f('0x163'));}logger[_0x837f('0x2c')](util[_0x837f('0x25')](_0x837f('0x152'),this[_0x837f('0xb')]['callerid'],_0x265460[_0x837f('0x151')]));var _0x64120b=this[_0x837f('0x4b')][_0x837f('0x6e')](this,_0x265460[_0x837f('0x164')]);var _0x12bcdf=this[_0x837f('0x4d')]['sync'](this,_0x265460[_0x837f('0x151')],_0x64120b);if(_0x12bcdf){logger[_0x837f('0x2c')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x837f('0xb')][_0x837f('0x38')],_0x265460[_0x837f('0x151')]));this[_0x837f('0xb')]['noop'](util[_0x837f('0x25')](_0x837f('0x153'),this[_0x837f('0xb')]['callerid'],_0x265460[_0x837f('0x151')]));return{'code':0xc8,'result':_0x837f('0x156')};}else{logger['info'](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x837f('0x38')],_0x265460[_0x837f('0x151')]));this[_0x837f('0xb')][_0x837f('0xa8')](util[_0x837f('0x25')](_0x837f('0x153'),this[_0x837f('0xb')][_0x837f('0x38')],_0x265460[_0x837f('0x151')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x837f('0xe')][_0x837f('0x165')]=function(_0x4a403c){logger[_0x837f('0x2c')](util[_0x837f('0x25')](_0x837f('0x166'),_0x4a403c[_0x837f('0x34')]));if(!this['isConfigured'](_0x4a403c[_0x837f('0x10d')])){return this[_0x837f('0xb')]['error'](_0x4a403c,_0x837f('0x10e'));}var _0x5577be=this[_0x837f('0x10f')]['sync'](this,_0x4a403c['file_id']);if(!_0x5577be){return this[_0x837f('0xb')][_0x837f('0x28')](_0x4a403c,_0x837f('0x15d'));}var _0x437185=this[_0x837f('0xb')]['exec'](_0x837f('0x167'),[_0x5577be,_0x4a403c[_0x837f('0xe5')]]);if(_0x437185[_0x837f('0xa2')]===-0x1){return _0x437185;}return this[_0x837f('0xb')][_0x837f('0xa8')](util[_0x837f('0x25')](_0x837f('0x168'),_0x837f('0x167'),_0x5577be));};AGIVertices[_0x837f('0xe')]['queue']=function(_0x51e618){logger[_0x837f('0x2c')](util[_0x837f('0x25')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x51e618[_0x837f('0x34')]));if(!this[_0x837f('0x85')](_0x51e618[_0x837f('0x169')])){return this[_0x837f('0xb')][_0x837f('0x28')](_0x51e618,_0x837f('0x16a'));}var _0x43d87f='';var _0x27f560=parseInt(_0x51e618['queue_id'],0xa);if(isNaN(_0x27f560)){_0x43d87f=_0x51e618[_0x837f('0x169')];}else{_0x43d87f=this['getVoiceQueue'][_0x837f('0x6e')](this,_0x51e618[_0x837f('0x169')]);if(!_0x43d87f){return this[_0x837f('0xb')][_0x837f('0x28')](_0x51e618,_0x837f('0x16b'));}}var _0x198ef8='';if(this[_0x837f('0x85')](_0x51e618[_0x837f('0x10d')])){var _0x1b576f=this[_0x837f('0x10f')][_0x837f('0x6e')](this,_0x51e618[_0x837f('0x10d')]);if(_0x1b576f){_0x198ef8=_0x1b576f;}}this['createSquareDetailsReport'][_0x837f('0x6e')](this,_0x51e618,_0x43d87f);if(_0x51e618[_0x837f('0xe5')][_0x837f('0x16c')]('x')<0x0){_0x51e618[_0x837f('0xe5')]+='x';}if(_0x51e618['opts'][_0x837f('0x16c')]('X')<0x0){_0x51e618['opts']+='X';}this['channel']['setVariable'](_0x837f('0x16d'),_0x43d87f?_0x43d87f[_0x837f('0x16e')]():'');var _0x248208=this[_0x837f('0xb')][_0x837f('0xaa')](_0x837f('0x16f'),[_0x43d87f,_0x51e618[_0x837f('0xe5')],_0x51e618['url'],_0x198ef8,_0x51e618[_0x837f('0x63')],_0x51e618['agi'],_0x51e618[_0x837f('0x170')],_0x51e618['gosub'],'',_0x51e618[_0x837f('0x171')]]);if(_0x248208[_0x837f('0xa2')]===-0x1){return _0x248208;}return this['channel']['noop'](util[_0x837f('0x25')](_0x837f('0x168'),_0x837f('0x16f'),_0x43d87f));};AGIVertices[_0x837f('0xe')][_0x837f('0x172')]=function(_0x137f1c){logger[_0x837f('0x2c')](util[_0x837f('0x25')](_0x837f('0x173'),_0x137f1c[_0x837f('0x34')]));var _0x3a2607=_0x137f1c[_0x837f('0x174')]||_0x837f('0x135');var _0x5a46b5=util['format'](_0x837f('0x175'),this['channel'][_0x837f('0x33')],rs[_0x837f('0x116')](0x5));var _0x17e1cd=util['format'](_0x837f('0x176'),FILES_PATH,_0x5a46b5,_0x3a2607);var _0x5237b4=util[_0x837f('0x25')](_0x837f('0x12a'),FILES_PATH,_0x5a46b5);this[_0x837f('0x37')][_0x837f('0x6e')](this,_0x137f1c,_0x5a46b5,_0x17e1cd);this[_0x837f('0xb')]['setVariable'](_0x837f('0x177'),_0x5a46b5);logger[_0x837f('0x2c')](_0x837f('0x178'),_0x5237b4,_0x3a2607,_0x137f1c[_0x837f('0x179')],_0x137f1c[_0x837f('0x63')]);return this[_0x837f('0xb')]['recordFile'](_0x5237b4,_0x3a2607,_0x137f1c[_0x837f('0x179')],_0x137f1c['timeout'],undefined,!![]);};AGIVertices[_0x837f('0xe')][_0x837f('0x17a')]=function(_0x5a76db){logger[_0x837f('0x2c')](util[_0x837f('0x25')](_0x837f('0x17b'),_0x5a76db[_0x837f('0x34')]));if(!this[_0x837f('0x85')](_0x5a76db[_0x837f('0x61')])){return this[_0x837f('0xb')][_0x837f('0xa8')](_0x837f('0x17c'));}var _0x2acf99=this['restAPI'][_0x837f('0x6e')](this,_0x5a76db);logger[_0x837f('0x2c')](util['format']('Response:',util[_0x837f('0x17d')](_0x2acf99,{'showHidden':![],'depth':null})));if(!this[_0x837f('0x85')](_0x5a76db[_0x837f('0xd8')])){return this[_0x837f('0xb')]['noop'](_0x837f('0x17e'));}var _0x2cae0a=this['getVariable']['sync'](this,_0x5a76db['variable_id']);if(!_0x2cae0a){return this[_0x837f('0xb')]['error'](_0x5a76db,_0x837f('0xd9'));}this[_0x837f('0xb')][_0x837f('0x9e')](util['format']('%s_STATUS_CODE',_0x2cae0a),_0x2acf99[_0x837f('0x73')]?_0x2acf99[_0x837f('0x73')]:_0x837f('0x17f'));this[_0x837f('0xb')]['setVariable'](util[_0x837f('0x25')]('%s_STATUS_MESSAGE',_0x2cae0a),_0x2acf99[_0x837f('0x74')]?_0x2acf99[_0x837f('0x74')]:'OK');if(_0x2acf99[_0x837f('0x69')]){try{this[_0x837f('0x9b')](_0x2acf99['body'],_0x2cae0a);}catch(_0x2083ab){logger[_0x837f('0x28')](util[_0x837f('0x25')](_0x837f('0x180'),_0x2cae0a));}}return this[_0x837f('0xb')]['noop'](util[_0x837f('0x25')](_0x837f('0xde'),_0x2cae0a));};AGIVertices[_0x837f('0xe')]['saydigits']=function(_0x2e4429){logger[_0x837f('0x2c')](util[_0x837f('0x25')](_0x837f('0x181'),_0x2e4429['label']));return this[_0x837f('0xb')][_0x837f('0x182')](_0x2e4429[_0x837f('0x183')][_0x837f('0xd6')](/\s+/g,''),_0x2e4429[_0x837f('0x179')]);};AGIVertices[_0x837f('0xe')][_0x837f('0x184')]=function(_0x20c534){logger['info'](util['format'](_0x837f('0x185'),_0x20c534[_0x837f('0x34')]));return this[_0x837f('0xb')]['sayNumber'](_0x20c534[_0x837f('0x64')]['replace'](/\s+/g,''),_0x20c534['escape_digits']);};AGIVertices[_0x837f('0xe')][_0x837f('0x186')]=function(_0x38b306){logger[_0x837f('0x2c')](util['format'](_0x837f('0x187'),_0x38b306[_0x837f('0x34')]));return this[_0x837f('0xb')][_0x837f('0x188')](_0x38b306[_0x837f('0x59')],_0x38b306[_0x837f('0x179')]);};AGIVertices[_0x837f('0xe')][_0x837f('0x189')]=function(_0x315f31){logger[_0x837f('0x2c')](util[_0x837f('0x25')](_0x837f('0x18a'),_0x315f31[_0x837f('0x34')]));if(!this['isConfigured'](_0x315f31['account_id'])){return this[_0x837f('0xb')][_0x837f('0xa8')](_0x837f('0x18b'));}var _0x17ccb5=this[_0x837f('0x18c')][_0x837f('0x6e')](this,_0x315f31['account_id']);if(!_0x17ccb5||!_0x17ccb5[_0x837f('0x18d')]){return this[_0x837f('0xb')]['error'](_0x315f31,_0x837f('0x18e'));}var _0x1815fc={'from':util['format'](_0x837f('0x18f'),_0x17ccb5['name'],_0x17ccb5[_0x837f('0x190')]||_0x17ccb5[_0x837f('0x18d')][_0x837f('0x191')]),'to':_0x315f31['to']||'','cc':_0x315f31['cc']||'','bcc':_0x315f31[_0x837f('0x192')]||'','subject':_0x315f31[_0x837f('0x193')],'html':_0x315f31[_0x837f('0x59')],'text':_0x315f31['text']};if(this['isConfigured'](_0x315f31[_0x837f('0x194')])){}logger[_0x837f('0xe0')]('sendMail\x20message',JSON[_0x837f('0x71')](_0x1815fc));this['createSquareDetailsReport']['sync'](this,_0x315f31,_0x315f31[_0x837f('0x195')]);this[_0x837f('0xb')][_0x837f('0xa8')](util[_0x837f('0x25')]('Trying\x20SendMail\x20with\x20account\x20%s',_0x17ccb5[_0x837f('0x12')]));this['sendMailMessage'][_0x837f('0x6e')](this,_0x17ccb5[_0x837f('0x196')],_0x1815fc);return this[_0x837f('0xb')][_0x837f('0xa8')](_0x837f('0x197'));};AGIVertices['prototype'][_0x837f('0x198')]=function(_0x363336){logger[_0x837f('0x2c')](util[_0x837f('0x25')]('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x363336['label']));return this['channel']['noop'](_0x837f('0x199'));};AGIVertices['prototype'][_0x837f('0x19a')]=function(_0x53fd3c){logger[_0x837f('0x2c')](util[_0x837f('0x25')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x53fd3c[_0x837f('0x34')]));if(!this['isConfigured'](_0x53fd3c[_0x837f('0x19b')])){return this[_0x837f('0xb')][_0x837f('0xa8')](_0x837f('0x19c'));}var _0x348d24=this[_0x837f('0x2f')][_0x837f('0x6e')](this,_0x53fd3c[_0x837f('0x19b')]);if(!_0x348d24){return this[_0x837f('0xb')][_0x837f('0x28')](_0x53fd3c,'no\x20sms\x20account\x20found');}var _0x40a3d6={'body':_0x53fd3c[_0x837f('0x19d')],'phone':_0x53fd3c['to']||'','SmsAccountId':_0x348d24['id']};logger[_0x837f('0xe0')](_0x837f('0x19e'),JSON[_0x837f('0x71')](_0x40a3d6));this[_0x837f('0x32')]['sync'](this,_0x53fd3c,_0x53fd3c[_0x837f('0x19b')]);this[_0x837f('0xb')][_0x837f('0xa8')](util['format'](_0x837f('0x19f'),_0x348d24[_0x837f('0x12')]));this[_0x837f('0x31')]['sync'](this,_0x40a3d6);return this['channel'][_0x837f('0xa8')]('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices['prototype'][_0x837f('0x1a0')]=function(_0x28a273){logger[_0x837f('0x2c')](util[_0x837f('0x25')](_0x837f('0x1a1'),_0x28a273[_0x837f('0x34')]));if(!this[_0x837f('0x85')](_0x28a273[_0x837f('0xd8')])){return this[_0x837f('0xb')][_0x837f('0x28')](_0x28a273,_0x837f('0x1a2'));}var _0x38380f=this[_0x837f('0xf')]['sync'](this,_0x28a273[_0x837f('0xd8')]);if(!_0x38380f){return this[_0x837f('0xb')][_0x837f('0x28')](_0x28a273,'no\x20variable\x20found');}return this['channel'][_0x837f('0x9e')](_0x38380f,_0x28a273[_0x837f('0x1a3')]);};AGIVertices['prototype']['start']=function(_0x4f1f06){logger['info'](util[_0x837f('0x25')](_0x837f('0x1a4'),_0x4f1f06[_0x837f('0x34')]));this[_0x837f('0xb')][_0x837f('0xa8')](_0x837f('0x1a5'));var _0xb50af8=this[_0x837f('0xb')][_0x837f('0xf')](_0x837f('0x1a6'));if(!_[_0x837f('0x3f')](_0xb50af8[_0x837f('0xa3')])){this[_0x837f('0xb')][_0x837f('0x33')]=_0xb50af8['extra'];}if(_0x4f1f06['answer']===_0x837f('0x1a7')){this['channel']['noop'](_0x837f('0x1a8'));return this['channel']['answer']();}return this[_0x837f('0xb')][_0x837f('0xa8')](_0x837f('0x1a9'));};AGIVertices[_0x837f('0xe')]['subproject']=function(_0x1f9a37){logger[_0x837f('0x2c')](util[_0x837f('0x25')](_0x837f('0x1aa'),_0x1f9a37[_0x837f('0x34')]));if(!this[_0x837f('0x85')](_0x1f9a37[_0x837f('0x1ab')])){return this[_0x837f('0xb')][_0x837f('0x28')](_0x1f9a37,_0x837f('0x1ac'));}var _0x46ee9b=this[_0x837f('0x1ad')][_0x837f('0x6e')](this,_0x1f9a37[_0x837f('0x1ab')]);if(!this['isConfigured'](_0x46ee9b)){return this[_0x837f('0xb')][_0x837f('0x28')](_0x1f9a37,util['format'](_0x837f('0x1ae'),_0x1f9a37[_0x837f('0x1ab')]));}if(_0x46ee9b===this['channel']['arg_1']){return this['channel'][_0x837f('0x28')](_0x1f9a37,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this['createSquareDetailsReport'][_0x837f('0x6e')](this,_0x1f9a37,_0x46ee9b);var _0x590303=this[_0x837f('0xb')][_0x837f('0xaa')]('AGI',util['format'](_0x837f('0x1af'),config[_0x837f('0xb5')][_0x837f('0x1b0')]||_0x837f('0x1b1'),_0x46ee9b,this[_0x837f('0xb')]['arg_1']));if(_0x590303[_0x837f('0xa2')]===-0x1){return _0x590303;}return this[_0x837f('0xb')][_0x837f('0xa8')](util[_0x837f('0x25')](_0x837f('0x168'),_0x837f('0x1b2'),_0x46ee9b));};AGIVertices[_0x837f('0xe')][_0x837f('0x1b3')]=function(_0x15dc25){logger['info'](util[_0x837f('0x25')](_0x837f('0x1b4'),_0x15dc25[_0x837f('0x34')]));var _0x366536=this[_0x837f('0x55')][_0x837f('0x6e')](this,_0x15dc25[_0x837f('0x1b5')]);this[_0x837f('0x32')][_0x837f('0x6e')](this,_0x15dc25,_0x15dc25[_0x837f('0x1b5')]);if(this['isConfigured'](_0x15dc25[_0x837f('0xd8')])){var _0x40b73=this[_0x837f('0xf')][_0x837f('0x6e')](this,_0x15dc25['variable_id']);if(_0x40b73){this[_0x837f('0xb')]['setVariable'](_0x40b73,_0x366536);return this[_0x837f('0xb')][_0x837f('0xa8')](util[_0x837f('0x25')](_0x837f('0x1b6'),_0x15dc25[_0x837f('0x1b5')],_0x40b73));}}return this[_0x837f('0xb')]['noop'](util[_0x837f('0x25')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x15dc25['command']));};AGIVertices[_0x837f('0xe')][_0x837f('0x1b7')]=function(_0x4bf16a){logger['info'](util[_0x837f('0x25')](_0x837f('0x1b8'),_0x4bf16a[_0x837f('0x34')]));_0x4bf16a[_0x837f('0x59')]=_0x4bf16a[_0x837f('0x59')][_0x837f('0xd6')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x837f('0x85')](_0x4bf16a[_0x837f('0x1b9')])){return this['channel'][_0x837f('0xa8')]('no\x20apiKey\x20configured');}if(!this[_0x837f('0x85')](_0x4bf16a[_0x837f('0x59')])){return this[_0x837f('0xb')][_0x837f('0xa8')]('no\x20text\x20configured');}this[_0x837f('0xb')]['noop'](util[_0x837f('0x25')](_0x837f('0x1ba'),_0x4bf16a[_0x837f('0x59')]));var _0x3a4d5c=this[_0x837f('0x57')][_0x837f('0x6e')](this,_0x4bf16a);if(_0x3a4d5c){this[_0x837f('0xb')][_0x837f('0xa8')](util[_0x837f('0x25')](_0x837f('0x1bb'),_0x3a4d5c));var _0x809508=this[_0x837f('0xb')][_0x837f('0x102')](_0x3a4d5c);try{fs[_0x837f('0x103')](_0x3a4d5c+_0x837f('0x11d'));}catch(_0x3db352){logger['error'](_0x3db352);}return _0x809508;}return this[_0x837f('0xb')][_0x837f('0x28')](_0x4bf16a,_0x837f('0x1bc'));};AGIVertices[_0x837f('0xe')][_0x837f('0x1bd')]=function(_0xb9d8aa){logger[_0x837f('0x2c')](util['format'](_0x837f('0x1be'),_0xb9d8aa[_0x837f('0x34')]));_0xb9d8aa['text']=_0xb9d8aa[_0x837f('0x59')][_0x837f('0xd6')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x837f('0x85')](_0xb9d8aa[_0x837f('0x59')])){return this[_0x837f('0xb')][_0x837f('0xa8')](_0x837f('0xa9'));}this[_0x837f('0xb')][_0x837f('0xa8')](util[_0x837f('0x25')]('Trying\x20Google\x20TTS\x20%s',_0xb9d8aa['text']));var _0x1d6480=this[_0x837f('0x5f')][_0x837f('0x6e')](this,_0xb9d8aa);if(_0x1d6480){this[_0x837f('0xb')][_0x837f('0xa8')](util[_0x837f('0x25')](_0x837f('0x1bf'),_0x1d6480));var _0x304a9f=this[_0x837f('0xb')][_0x837f('0x102')](_0x1d6480);try{fs[_0x837f('0x103')](_0x1d6480+'.wav');}catch(_0x26dff8){logger['error'](_0x26dff8);}return _0x304a9f;}return this[_0x837f('0xb')]['error'](_0xb9d8aa,_0x837f('0x1c0'));};AGIVertices['prototype'][_0x837f('0x1c1')]=function(_0x14d688){logger['info'](util[_0x837f('0x25')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x14d688[_0x837f('0x34')]));if(!this[_0x837f('0x85')](_0x14d688[_0x837f('0x151')])){return this[_0x837f('0xb')][_0x837f('0x28')](_0x14d688,_0x837f('0x163'));}logger[_0x837f('0x2c')](util[_0x837f('0x25')](_0x837f('0x152'),this[_0x837f('0xb')][_0x837f('0x38')],_0x14d688['findBy']));var _0x3caf1f=this[_0x837f('0x4f')][_0x837f('0x6e')](this,_0x14d688['findBy']);if(_0x3caf1f){logger[_0x837f('0x2c')](util['format'](_0x837f('0x153'),this[_0x837f('0xb')][_0x837f('0x38')],_0x14d688[_0x837f('0x151')]));this[_0x837f('0xb')][_0x837f('0xa8')](util['format'](_0x837f('0x153'),this['channel'][_0x837f('0x38')],_0x14d688['findBy']));return{'code':0xc8,'result':_0x837f('0x156')};}else{logger[_0x837f('0x2c')](util[_0x837f('0x25')](_0x837f('0x154'),this[_0x837f('0xb')]['callerid'],_0x14d688[_0x837f('0x151')]));this[_0x837f('0xb')][_0x837f('0xa8')](util[_0x837f('0x25')](_0x837f('0x154'),this[_0x837f('0xb')][_0x837f('0x38')],_0x14d688[_0x837f('0x151')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x837f('0xe')]['voicemail']=function(_0x3d1162){logger['info'](util['format'](_0x837f('0x1c2'),_0x3d1162[_0x837f('0x34')]));var _0x57a1c4=this['channel'][_0x837f('0xaa')](_0x837f('0x1c3'),[_0x3d1162['mailbox'],_0x3d1162[_0x837f('0x76')]]);if(_0x57a1c4[_0x837f('0xa2')]===-0x1){return _0x57a1c4;}return this[_0x837f('0xb')][_0x837f('0xa8')](util[_0x837f('0x25')](_0x837f('0x168'),_0x837f('0x1c3'),_0x3d1162[_0x837f('0x1c4')]));};AGIVertices[_0x837f('0xe')][_0x837f('0x1c5')]=function(_0x4e1cf4){logger['info'](util[_0x837f('0x25')](_0x837f('0x1c6'),_0x4e1cf4[_0x837f('0x34')]));if(!this[_0x837f('0x85')](_0x4e1cf4[_0x837f('0xd8')])){return this[_0x837f('0xb')][_0x837f('0x28')](_0x4e1cf4,_0x837f('0x1a2'));}var _0x203343=this[_0x837f('0xf')][_0x837f('0x6e')](this,_0x4e1cf4[_0x837f('0xd8')]);if(!_0x203343){return this[_0x837f('0xb')][_0x837f('0x28')](_0x4e1cf4,_0x837f('0xd9'));}var _0x2aebe5=this[_0x837f('0xb')]['getVariable'](_0x203343);return{'code':0xc8,'result':_0x2aebe5[_0x837f('0xa3')]?_0x2aebe5['extra']:'-'};};String[_0x837f('0xe')][_0x837f('0xa0')]=function(_0x28b449,_0x2a4d35){return this[_0x837f('0x9f')](_0x28b449)[_0x837f('0x1c7')](_0x2a4d35);};module['exports']=AGIVertices; \ No newline at end of file +var _0xb43b=['no\x20trunk\x20found','trunk_name','SIP/%s/%s','Executed\x20command\x20%s','Enter\x20in\x20FINALLY\x20(%s)\x20block','getdigits','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','response','mindigit','maxdigit','hiddendigitsnum','hiddendigitspos','first','substr','generate','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','aws_secret_access_key','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','unlink','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','aws_bot_name','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','NOBEEP','recordFile','intKey','GOOGLE_ASR_%s','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appsecret\x20configured','%s/recordings/%s','beep','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','extension','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','Trying\x20ispeech\x20TTS\x20%s','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','operation','no\x20operation\x20configured','math\x20%s','menu','Enter\x20in\x20MENU\x20(%s)\x20block','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','pause','getPause','pause_id','playback','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','position','record','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','%s_STATUS_MESSAGE','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayphonetic','sendMail','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','bcc','subject','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Sms\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20found\x20with\x20id\x20%d','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','system','command','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','no\x20apiKey\x20configured','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','unpause','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','replaceAll','join','exports','util','shelljs','odbc','randomstring','moment','mustache','request-promise','../../config/logger','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawBody','getsecretdigits','channel','mailRpc','prototype','getVariable','rpc','getVariableById','catch','getVoiceQueueById','then','name','getSquareProject','getSquareProjectById','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundById','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervalById','IntervalId','interval','Intervals','getSoundPath','format','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','calleridname','context','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isNil','callback_','random','lastName','phone','scheduledAt','Callback\x20scheduled\x20at\x20','agentPause','agent','agentUnpause','agentLogout','agentLogin','LOCAL','shellCommand','exec','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','url','timeout','number','POST','PUT','method','toUpperCase','parse','headers','rawHeaders','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','stringify','body','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','options','googleDialogflow','googleDialogflowV2','client_email','dialogflowV2_language','sestekNDA','key','ispeech_tts_language','ispeechASR','isConfigured','model','awsPolly','aws_access_key_id','aws_polly_region','Amy','aws_text_type','awsLex','aws_lex_region','googleASR','google_asr_language','tildeASR','appid','clear','includes','clone','isString','replaceObjectAllVariables','replaceAllVariables','hasOwnProperty','isPlainObject','recursiveNodeIndex','saveRestApiResult','isEmpty','%s.%s','isArray','length','split','extra','toString','getAndSetVariable','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','result','Executed\x20command\x20MRCPSynth\x20%s','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','Executed\x20command\x20MRCPRecog\x20%s','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','callback','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','minutes','callback_priority','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','list_id','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','MRCPSynth','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','sestekasr','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','getSquareOdbc','no\x20odbc\x20database\x20found','no\x20query\x20configured','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','setVariable','%s_ROWS_COUNT','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','SIP/%s','opts','DIAL','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','dialogflow','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','dialogflowV2_project_id','no\x20project_id\x20configured','private_key','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','password','no\x20password\x20configured','ndassistant_url','audiofile','streamFile','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','ext_dial','trunk_id','no\x20trunk\x20selected'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xb43b,0xbf));var _0xbb43=function(_0x55e871,_0x1e522f){_0x55e871=_0x55e871-0x0;var _0x4a5be1=_0xb43b[_0x55e871];return _0x4a5be1;};'use strict';var fs=require('fs');var util=require(_0xbb43('0x0'));var _=require('lodash');var sh=require(_0xbb43('0x1'));var odbc=require(_0xbb43('0x2'))();var rs=require(_0xbb43('0x3'));var moment=require(_0xbb43('0x4'));var Mustache=require(_0xbb43('0x5'));var rp=require(_0xbb43('0x6'));var logger=require(_0xbb43('0x7'))(_0xbb43('0x8'));var config=require(_0xbb43('0x9'));var scripts=require(_0xbb43('0xa'));var FILES_PATH=_0xbb43('0xb');var recursiveMapAttributes=['rawHeaders',_0xbb43('0xc')];var verticesWithRetry=['menu','getdigits',_0xbb43('0xd')];var AGIVertices=function(_0x120d67,_0x20ed03,_0x2239d8){this[_0xbb43('0xe')]=_0x120d67;this['rpc']=_0x20ed03;this[_0xbb43('0xf')]=_0x2239d8;};AGIVertices[_0xbb43('0x10')][_0xbb43('0x11')]=function(_0x2c28be,_0x5a4589){this[_0xbb43('0x12')][_0xbb43('0x13')](_0x2c28be)['then'](function(_0x516580){_0x5a4589(null,_0x516580?_0x516580['name']:![]);})[_0xbb43('0x14')](function(_0x5d0ccc){_0x5a4589(_0x5d0ccc);});};AGIVertices[_0xbb43('0x10')]['getVoiceQueue']=function(_0x2b0f1d,_0x217a4e){this[_0xbb43('0x12')][_0xbb43('0x15')](_0x2b0f1d)[_0xbb43('0x16')](function(_0x4f16d7){_0x217a4e(null,_0x4f16d7?_0x4f16d7[_0xbb43('0x17')]:![]);})['catch'](function(_0x199726){_0x217a4e(_0x199726);});};AGIVertices[_0xbb43('0x10')][_0xbb43('0x18')]=function(_0x10c91b,_0x3be44b){this[_0xbb43('0x12')][_0xbb43('0x19')](_0x10c91b)[_0xbb43('0x16')](function(_0x20b839){_0x3be44b(null,_0x20b839?_0x20b839[_0xbb43('0x17')]:![]);})[_0xbb43('0x14')](function(_0x4cb0b2){_0x3be44b(_0x4cb0b2);});};AGIVertices[_0xbb43('0x10')]['getSquareOdbc']=function(_0x44fd04,_0x5f4b4f){this[_0xbb43('0x12')][_0xbb43('0x1a')](_0x44fd04)['then'](function(_0x19c785){_0x5f4b4f(null,_0x19c785?_0x19c785[_0xbb43('0x1b')]:![]);})[_0xbb43('0x14')](function(_0x6f34d6){_0x5f4b4f(_0x6f34d6);});};AGIVertices[_0xbb43('0x10')][_0xbb43('0x1c')]=function(_0xee1084,_0x1e83cd){this[_0xbb43('0x12')][_0xbb43('0x1d')](_0xee1084)[_0xbb43('0x16')](function(_0x434ff5){_0x1e83cd(null,_0x434ff5?_0x434ff5[_0xbb43('0x17')]:![]);})[_0xbb43('0x14')](function(_0x500af4){_0x1e83cd(_0x500af4);});};AGIVertices[_0xbb43('0x10')][_0xbb43('0x1e')]=function(_0x54a9aa,_0x464b4a){this[_0xbb43('0x12')][_0xbb43('0x1f')](_0x54a9aa)['then'](function(_0x4ea4c5){_0x464b4a(null,_0x4ea4c5?_0x4ea4c5[_0xbb43('0x17')]:![]);})[_0xbb43('0x14')](function(_0x5b21b6){_0x464b4a(_0x5b21b6);});};AGIVertices['prototype'][_0xbb43('0x20')]=function(_0xb9fe3b,_0x268fb5){var _0x4bb859=this;this[_0xbb43('0x12')][_0xbb43('0x21')](_0xb9fe3b)[_0xbb43('0x16')](function(_0x1a6e2b){_0x268fb5(null,_0x1a6e2b?_0x4bb859['getSoundPath'](_0x1a6e2b[_0xbb43('0x22')]):![]);})[_0xbb43('0x14')](function(_0x821beb){_0x268fb5(_0x821beb);});};AGIVertices[_0xbb43('0x10')][_0xbb43('0x23')]=function(_0x41da98,_0x2860d8){this['rpc'][_0xbb43('0x24')](_0x41da98)[_0xbb43('0x16')](function(_0x3c46c6){_0x2860d8(null,_0x3c46c6?_0x3c46c6:![]);})['catch'](function(_0x359b25){_0x2860d8(_0x359b25);});};AGIVertices[_0xbb43('0x10')][_0xbb43('0x25')]=function(_0x168374,_0x2b3350,_0x2459a7){this[_0xbb43('0xf')][_0xbb43('0x25')](_0x168374,_0x2b3350)[_0xbb43('0x16')](function(){_0x2459a7(null);})['catch'](function(_0x5253a4){_0x2459a7(_0x5253a4);});};AGIVertices['prototype']['getIntervals']=function(_0x352249,_0x1186fd){this[_0xbb43('0x12')][_0xbb43('0x26')](_0x352249)[_0xbb43('0x16')](function(_0xa153c9){if(_0xa153c9){if(_0xa153c9[_0xbb43('0x27')]){_0x1186fd(null,[_0xa153c9[_0xbb43('0x28')]]);}else{_0x1186fd(null,_['map'](_0xa153c9[_0xbb43('0x29')],_0xbb43('0x28')));}}else{_0x1186fd(null,![]);}})[_0xbb43('0x14')](function(_0x5cbb05){_0x1186fd(_0x5cbb05);});};AGIVertices['prototype'][_0xbb43('0x2a')]=function(_0x42ae94){return util[_0xbb43('0x2b')](_0xbb43('0x2c'),FILES_PATH,_0x42ae94);};AGIVertices['prototype'][_0xbb43('0x2d')]=function(_0x4ab8e5,_0x3ba581,_0x10014c){odbc[_0xbb43('0x2e')](_0x4ab8e5,function(_0x181877){if(_0x181877){logger[_0xbb43('0x2f')](_0xbb43('0x30'),_0x181877);_0x10014c(_0x181877);}else{logger[_0xbb43('0x31')](_0xbb43('0x32'));odbc[_0xbb43('0x33')](_0x3ba581,function(_0xa48590,_0xfeaa38){if(_0xa48590){logger[_0xbb43('0x31')]('Error\x20executing\x20query\x20%s',_0x3ba581);_0x10014c(_0xa48590);}else{logger[_0xbb43('0x31')](_0xbb43('0x34'),_0x3ba581);odbc[_0xbb43('0x35')](function(_0x2db230){if(_0x2db230){logger[_0xbb43('0x2f')](_0xbb43('0x36'),_0x2db230);}_0x10014c(null,_0xfeaa38);});}});}});};AGIVertices[_0xbb43('0x10')][_0xbb43('0x37')]=function(_0x92d7cf,_0x2d7de8){this[_0xbb43('0x12')][_0xbb43('0x38')](_0x92d7cf)[_0xbb43('0x16')](function(_0x3a3371){_0x2d7de8(null,_0x3a3371?_0x3a3371:![]);})[_0xbb43('0x14')](function(_0x4a76a8){_0x2d7de8(_0x4a76a8);});};AGIVertices[_0xbb43('0x10')][_0xbb43('0x39')]=function(_0x38af31,_0x1b5646){this[_0xbb43('0x12')][_0xbb43('0x39')](_0x38af31)['then'](function(_0x13e9f7){_0x1b5646(null,_0x13e9f7);})[_0xbb43('0x14')](function(_0x550dd6){_0x1b5646(_0x550dd6);});};AGIVertices['prototype'][_0xbb43('0x3a')]=function(_0x1eb63f,_0x26aa10,_0xa6aacb){this[_0xbb43('0x12')]['createSquareDetailsReport']({'uniqueid':this['channel'][_0xbb43('0x3b')],'node':_0x1eb63f[_0xbb43('0x3c')],'application':_0x1eb63f[_0xbb43('0x3d')],'data':_0x26aa10||null,'project_name':this[_0xbb43('0xe')][_0xbb43('0x3e')],'callerid':this[_0xbb43('0xe')][_0xbb43('0x3f')]})[_0xbb43('0x16')](function(_0x475e26){if(_0xa6aacb){_0xa6aacb(null,_0x475e26);}})[_0xbb43('0x14')](function(_0x5ec957){if(_0xa6aacb){_0xa6aacb(_0x5ec957);}});};AGIVertices['prototype'][_0xbb43('0x40')]=function(_0x31891b,_0x5aa780,_0x13eb0f,_0x1e4eff){this[_0xbb43('0x12')][_0xbb43('0x40')]({'uniqueid':this[_0xbb43('0xe')][_0xbb43('0x3b')],'callerid':this[_0xbb43('0xe')]['callerid'],'calleridname':this[_0xbb43('0xe')][_0xbb43('0x41')],'context':this['channel'][_0xbb43('0x42')],'extension':this[_0xbb43('0xe')]['extension'],'priority':this[_0xbb43('0xe')][_0xbb43('0x43')],'accountcode':this[_0xbb43('0xe')][_0xbb43('0x44')],'dnid':this[_0xbb43('0xe')][_0xbb43('0x45')],'projectName':this[_0xbb43('0xe')][_0xbb43('0x3e')],'saveName':_0x5aa780,'filename':_0x31891b[_0xbb43('0x46')]||_0x5aa780,'savePath':_0x13eb0f})[_0xbb43('0x16')](function(_0x38cc4d){_0x1e4eff(null,_0x38cc4d);})[_0xbb43('0x14')](function(_0x5a2694){_0x1e4eff(_0x5a2694);});};AGIVertices[_0xbb43('0x10')][_0xbb43('0x47')]=function(_0x50096a,_0x7089bb,_0x4ab63b,_0x33d21b,_0x4998fb){this[_0xbb43('0x12')]['createSquareMessage']({'uniqueid':this[_0xbb43('0xe')][_0xbb43('0x3b')],'body':_0x50096a,'direction':_0x7089bb,'providerName':_0x4ab63b,'providerResponse':_0x33d21b})[_0xbb43('0x16')](function(_0x535347){if(_0x4998fb){_0x4998fb(null,_0x535347);}})[_0xbb43('0x14')](function(_0x218da6){if(_0x4998fb){_0x4998fb(_0x218da6);}});};AGIVertices[_0xbb43('0x10')]['createCmContact']=function(_0xd485c7,_0x3b53b9){this['rpc'][_0xbb43('0x48')]({'firstName':_['isEmpty'](_0xd485c7[_0xbb43('0x17')])||_[_0xbb43('0x49')](_0xd485c7['name'])?_0xbb43('0x4a')+Math[_0xbb43('0x4b')]():_0xd485c7[_0xbb43('0x17')],'lastName':_['isEmpty'](_0xd485c7[_0xbb43('0x4c')])||_['isNil'](_0xd485c7[_0xbb43('0x4c')])?null:_0xd485c7[_0xbb43('0x4c')],'phone':_0xd485c7[_0xbb43('0x4d')],'ListId':_0xd485c7['list_id'],'scheduledat':_0xd485c7[_0xbb43('0x4e')],'callbackUniqueid':this[_0xbb43('0xe')]['uniqueid'],'tags':'callback','description':_0xbb43('0x4f')+_0xd485c7[_0xbb43('0x4e')]['toString'](),'priority':_0xd485c7['callback_priority']})[_0xbb43('0x16')](function(_0x51ca4f){_0x3b53b9(null,_0x51ca4f);})[_0xbb43('0x14')](function(_0x4664e3){_0x3b53b9(_0x4664e3);});};AGIVertices[_0xbb43('0x10')]['getPause']=function(_0x5978c9,_0x52ec91){this['rpc']['getPauseById'](_0x5978c9)[_0xbb43('0x16')](function(_0x31d265){_0x52ec91(null,_0x31d265?_0x31d265[_0xbb43('0x17')]:![]);})[_0xbb43('0x14')](function(_0xbf2f4d){_0x52ec91(_0xbf2f4d);});};AGIVertices['prototype'][_0xbb43('0x50')]=function(_0x529455,_0x6e7c04,_0x4b5e4b){var _0x2ad30b={'role':_0xbb43('0x51')};_0x2ad30b[_0x529455]=this[_0xbb43('0xe')][_0xbb43('0x3f')];this['rpc'][_0xbb43('0x50')](_0x2ad30b,_0x6e7c04,this['channel'][_0xbb43('0x3b')])[_0xbb43('0x16')](function(_0x512619){_0x4b5e4b(null,_[_0xbb43('0x49')](_0x512619)?![]:!![]);})[_0xbb43('0x14')](function(_0x5cde88){logger[_0xbb43('0x2f')](_0x5cde88);_0x4b5e4b(null,![]);});};AGIVertices[_0xbb43('0x10')][_0xbb43('0x52')]=function(_0x19987b,_0x41c915){var _0x42221e={'role':_0xbb43('0x51')};_0x42221e[_0x19987b]=this[_0xbb43('0xe')]['callerid'];this[_0xbb43('0x12')]['agentUnpause'](_0x42221e)[_0xbb43('0x16')](function(_0x2e70bf){_0x41c915(null,_['isNil'](_0x2e70bf)?![]:!![]);})[_0xbb43('0x14')](function(_0x2e49e2){logger[_0xbb43('0x2f')](_0x2e49e2);_0x41c915(null,![]);});};AGIVertices[_0xbb43('0x10')][_0xbb43('0x53')]=function(_0x88a62a,_0x1233ba){var _0x2274a1={'role':'agent'};_0x2274a1[_0x88a62a]=this[_0xbb43('0xe')][_0xbb43('0x3f')];this[_0xbb43('0x12')][_0xbb43('0x53')](_0x2274a1)['then'](function(_0x226f27){_0x1233ba(null,_['isNil'](_0x226f27)?![]:!![]);})[_0xbb43('0x14')](function(_0x5102fb){logger[_0xbb43('0x2f')](_0x5102fb);_0x1233ba(null,![]);});};AGIVertices[_0xbb43('0x10')][_0xbb43('0x54')]=function(_0x265d2d,_0x3b8363){var _0x43468e={'role':_0xbb43('0x51')};_0x43468e[_0x265d2d]=this[_0xbb43('0xe')][_0xbb43('0x3f')];var _0x32483f=_0x265d2d!='internal'?util[_0xbb43('0x2b')]('%s/%s@from-sip/n',_0xbb43('0x55'),this[_0xbb43('0xe')][_0xbb43('0x3f')]):undefined;this[_0xbb43('0x12')][_0xbb43('0x54')](_0x43468e,_0x32483f)[_0xbb43('0x16')](function(_0x238a86){_0x3b8363(null,_[_0xbb43('0x49')](_0x238a86)?![]:!![]);})['catch'](function(_0x405665){logger['error'](_0x405665);_0x3b8363(null,![]);});};AGIVertices['prototype'][_0xbb43('0x56')]=function(_0x4be7f7,_0x7b2e43){sh[_0xbb43('0x57')](_['trim'](_0x4be7f7),function(_0x221727,_0x347c53){var _0x52bd44=_0x347c53[_0xbb43('0x58')](/(\r\n|\n|\r)/gm,'');_0x7b2e43(null,_0x52bd44);});};AGIVertices[_0xbb43('0x10')][_0xbb43('0x59')]=function(_0x14678c,_0x40ac8c){scripts[_0xbb43('0x59')](_0x14678c[_0xbb43('0x5a')],_0x14678c[_0xbb43('0x5b')]||_0xbb43('0x5c'),_0x14678c[_0xbb43('0x5c')],_0x14678c[_0xbb43('0x5d')]||_0xbb43('0x5e'),_0x14678c[_0xbb43('0x5f')]||_0xbb43('0x60'),_0x14678c[_0xbb43('0x61')]||_0xbb43('0x62'))[_0xbb43('0x16')](function(_0x40ab00){_0x40ac8c(null,_0x40ab00);})[_0xbb43('0x14')](function(_0x21fc9d){_0x40ac8c(_0x21fc9d);});};AGIVertices[_0xbb43('0x10')][_0xbb43('0x63')]=function(_0x475740,_0x38ae0e){scripts[_0xbb43('0x63')](_0x475740[_0xbb43('0x5c')],_0x475740[_0xbb43('0x64')]||'en',0x1)[_0xbb43('0x16')](function(_0x422ba7){_0x38ae0e(null,_0x422ba7);})[_0xbb43('0x14')](function(_0x498089){_0x38ae0e(_0x498089);});};AGIVertices[_0xbb43('0x10')][_0xbb43('0x65')]=function(_0x1d178a,_0x146ebc){var _0x1b66ba={'uri':_0x1d178a[_0xbb43('0x66')],'method':_0x1d178a['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x1d178a[_0xbb43('0x67')])===_0xbb43('0x68')&&parseInt(_0x1d178a['timeout'])>=0x1?parseInt(_0x1d178a['timeout'])*0x3e8:0x5*0x3e8};if(_['includes']([_0xbb43('0x69'),_0xbb43('0x6a')],_0x1b66ba[_0xbb43('0x6b')][_0xbb43('0x6c')]())){try{_0x1b66ba['body']=_0x1d178a['rawBody']?JSON[_0xbb43('0x6d')](_0x1d178a['rawBody']):{};}catch(_0x308199){logger[_0xbb43('0x2f')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x308199);}}try{_0x1b66ba[_0xbb43('0x6e')]=_0x1d178a[_0xbb43('0x6f')]?JSON[_0xbb43('0x6d')](_0x1d178a['rawHeaders']):{};}catch(_0x3374a8){logger['error'](_0xbb43('0x70'),_0x3374a8);}if(_0x1d178a[_0xbb43('0x71')]){try{var _0x4bd0d6=require(_0x1d178a[_0xbb43('0x71')])[_0xbb43('0x72')](this,_0x1b66ba);_0x1b66ba[_0xbb43('0x73')]=Mustache[_0xbb43('0x74')](_0x1d178a[_0xbb43('0x66')],_0x4bd0d6,{},['$$','$$']);if(_0x1b66ba['headers']){_0x1b66ba['headers']=JSON[_0xbb43('0x6d')](Mustache[_0xbb43('0x74')](JSON[_0xbb43('0x75')](_0x1b66ba[_0xbb43('0x6e')]),_0x4bd0d6,{},['$$','$$']));}if(_0x1b66ba[_0xbb43('0x76')]){_0x1b66ba[_0xbb43('0x76')]=JSON[_0xbb43('0x6d')](Mustache[_0xbb43('0x74')](JSON['stringify'](_0x1b66ba[_0xbb43('0x76')]),_0x4bd0d6,{},['$$','$$']));}}catch(_0x4f613a){logger[_0xbb43('0x2f')](_0xbb43('0x77'),_0x4f613a);}}rp(_0x1b66ba)['then'](function(_0x371a7c){var _0x1ba677={'statusCode':_0x371a7c[_0xbb43('0x78')]||0xc8,'statusMessage':_0x371a7c[_0xbb43('0x79')]||'OK','headers':_0x371a7c[_0xbb43('0x6e')]||{},'body':_0x371a7c[_0xbb43('0x76')]||{}};_0x146ebc(null,_0x1ba677);})['catch'](function(_0x3d0182){var _0x2d18e7={'statusCode':_0x3d0182['statusCode']||0x1f4,'statusMessage':_0x3d0182[_0xbb43('0x7a')]||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x3d0182[_0xbb43('0x7b')][_0xbb43('0x6e')]||{},'body':_0x3d0182[_0xbb43('0x7b')][_0xbb43('0x76')]||{}};_0x146ebc(null,_0x2d18e7);});};AGIVertices[_0xbb43('0x10')][_0xbb43('0x7c')]=function(_0x339552,_0x2042a4){scripts[_0xbb43('0x7c')](this[_0xbb43('0xe')][_0xbb43('0x3b')],_0x339552['key'],_0x339552[_0xbb43('0x5c')],_0x339552['dialogflow_language']||'en')[_0xbb43('0x16')](function(_0x41e4a8){_0x2042a4(null,_0x41e4a8);})[_0xbb43('0x14')](function(_0x21bea1){_0x2042a4(_0x21bea1);});};AGIVertices[_0xbb43('0x10')]['googleDialogflowV2']=function(_0x10498d,_0x22add9){scripts[_0xbb43('0x7d')](this[_0xbb43('0xe')][_0xbb43('0x3b')],_0x10498d['dialogflowV2_project_id'],_0x10498d[_0xbb43('0x7e')],_0x10498d['private_key'],_0x10498d[_0xbb43('0x5c')],_0x10498d[_0xbb43('0x7f')]||'en')[_0xbb43('0x16')](function(_0x1c611d){_0x22add9(null,_0x1c611d);})[_0xbb43('0x14')](function(_0x5b2803){_0x22add9(_0x5b2803);});};AGIVertices[_0xbb43('0x10')]['sestekNDA']=function(_0x6c9702,_0x56e9c1){scripts[_0xbb43('0x80')](this['channel'],_0x6c9702)[_0xbb43('0x16')](function(_0x37cf8e){_0x56e9c1(null,_0x37cf8e);})[_0xbb43('0x14')](function(_0x5f15f8){_0x56e9c1(_0x5f15f8);});};AGIVertices[_0xbb43('0x10')]['ispeechTTS']=function(_0xf95ccf,_0xacc0da){scripts['ispeechTTS'](_0xf95ccf[_0xbb43('0x81')],_0xf95ccf[_0xbb43('0x5c')],_0xf95ccf[_0xbb43('0x82')]||_0xbb43('0x5e'),_0xf95ccf['speed'])[_0xbb43('0x16')](function(_0x37eee1){_0xacc0da(null,_0x37eee1);})['catch'](function(_0x569ad2){_0xacc0da(_0x569ad2);});};AGIVertices['prototype'][_0xbb43('0x83')]=function(_0x57dd9a,_0x18830e,_0x1734b0){scripts[_0xbb43('0x83')](_0x18830e,_0x57dd9a['key'],_0x57dd9a['ispeech_asr_language']||_0xbb43('0x5e'),this[_0xbb43('0x84')](_0x57dd9a[_0xbb43('0x85')])?_0x57dd9a[_0xbb43('0x85')]:undefined)['then'](function(_0x44841f){_0x1734b0(null,_0x44841f);})[_0xbb43('0x14')](function(_0x2ea427){_0x1734b0(_0x2ea427);});};AGIVertices['prototype'][_0xbb43('0x86')]=function(_0xc9623,_0x75999e){scripts[_0xbb43('0x86')](_0xc9623[_0xbb43('0x87')],_0xc9623['aws_secret_access_key'],_0xc9623[_0xbb43('0x88')],_0xc9623['aws_polly_voice']||_0xbb43('0x89'),_0xc9623[_0xbb43('0x5c')],_0xc9623[_0xbb43('0x8a')]||_0xbb43('0x5c'))['then'](function(_0x3174ea){_0x75999e(null,_0x3174ea);})['catch'](function(_0x265bdd){_0x75999e(_0x265bdd);});};AGIVertices[_0xbb43('0x10')]['awsLex']=function(_0x2721fc,_0x40e57e){scripts[_0xbb43('0x8b')](this[_0xbb43('0xe')]['uniqueid'],_0x2721fc['aws_access_key_id'],_0x2721fc['aws_secret_access_key'],_0x2721fc[_0xbb43('0x8c')],_0x2721fc[_0xbb43('0x5c')],_0x2721fc['aws_bot_name'])[_0xbb43('0x16')](function(_0x27db99){_0x40e57e(null,_0x27db99);})[_0xbb43('0x14')](function(_0x1966f4){_0x40e57e(_0x1966f4);});};AGIVertices[_0xbb43('0x10')][_0xbb43('0x8d')]=function(_0x6a0f62,_0xf3db56,_0x2cc676){scripts['googleASR'](_0xf3db56,_0x6a0f62[_0xbb43('0x81')],_0x6a0f62[_0xbb43('0x8e')]||_0xbb43('0x5e'))[_0xbb43('0x16')](function(_0x2a95cb){_0x2cc676(null,_0x2a95cb);})[_0xbb43('0x14')](function(_0x1d6eda){_0x2cc676(_0x1d6eda);});};AGIVertices[_0xbb43('0x10')][_0xbb43('0x8f')]=function(_0x5c152,_0x9edadf,_0x5e3539){scripts[_0xbb43('0x8f')](_0x9edadf,_0x5c152[_0xbb43('0x90')],_0x5c152['appsecret'],_0x5c152[_0xbb43('0x73')])[_0xbb43('0x16')](function(_0x13e255){_0x5e3539(null,_0x13e255);})['catch'](function(_0x58ba69){_0x5e3539(_0x58ba69);});};AGIVertices[_0xbb43('0x10')][_0xbb43('0x91')]=function(_0x3e6c48){var _0x187f44=_[_0xbb43('0x92')](verticesWithRetry,_0x3e6c48[_0xbb43('0x3d')])?_0x3e6c48:_[_0xbb43('0x93')](_0x3e6c48);for(var _0xebceea in _0x187f44){if(_0x187f44['hasOwnProperty'](_0xebceea)){if(_0x187f44[_0xebceea]&&_[_0xbb43('0x94')](_0x187f44[_0xebceea])){if(_[_0xbb43('0x92')](recursiveMapAttributes,_0xebceea)){_0x187f44[_0xebceea]=this[_0xbb43('0x95')](_0x187f44[_0xebceea]);}else{_0x187f44[_0xebceea]=this[_0xbb43('0x96')](_0x187f44[_0xebceea]);}}}}return _0x187f44;};AGIVertices[_0xbb43('0x10')]['recursiveNodeIndex']=function(_0x56934f){for(var _0x29f88e in _0x56934f){if(_0x56934f[_0xbb43('0x97')](_0x29f88e)){if(_[_0xbb43('0x98')](_0x56934f[_0x29f88e])){this[_0xbb43('0x99')](_0x56934f[_0x29f88e]);}else if(_['isArray'](_0x56934f[_0x29f88e])){for(var _0xb3e15d=0x0;_0xb3e15d<_0x56934f[_0x29f88e]['length'];_0xb3e15d++){this['recursiveNodeIndex'](_0x56934f[_0x29f88e][_0xb3e15d]);}}else if(_['isString'](_0x56934f[_0x29f88e])){_0x56934f[_0x29f88e]=this[_0xbb43('0x96')](_0x56934f[_0x29f88e]);}}}};AGIVertices[_0xbb43('0x10')][_0xbb43('0x9a')]=function(_0x49daa9,_0x31708a){for(var _0x12037a in _0x49daa9){if(_0x49daa9[_0xbb43('0x97')](_0x12037a)){if(_['isPlainObject'](_0x49daa9[_0x12037a])){if(!_[_0xbb43('0x9b')](_0x49daa9[_0x12037a])){this['saveRestApiResult'](_0x49daa9[_0x12037a],util[_0xbb43('0x2b')](_0xbb43('0x9c'),_0x31708a,_0x12037a));}}else if(_[_0xbb43('0x9d')](_0x49daa9[_0x12037a])){for(var _0x12ec48=0x0;_0x12ec48<_0x49daa9[_0x12037a][_0xbb43('0x9e')];_0x12ec48++){this['saveRestApiResult'](_0x49daa9[_0x12037a][_0x12ec48],util[_0xbb43('0x2b')](_0xbb43('0x9c'),_0x31708a,_0x12037a+'['+_0x12ec48+']'));}}else{if(!_['isNil'](_0x49daa9[_0x12037a])){this[_0xbb43('0xe')]['setVariable'](util['format'](_0xbb43('0x9c'),_0x31708a,_0x12037a),_0x49daa9[_0x12037a]);}}}}};AGIVertices['prototype'][_0xbb43('0x95')]=function(_0x2a7fcd){try{var _0x1d7bf2=JSON[_0xbb43('0x6d')](_0x2a7fcd);this['recursiveNodeIndex'](_0x1d7bf2);return JSON['stringify'](_0x1d7bf2);}catch(_0xef51b7){return this[_0xbb43('0x96')](_0x2a7fcd);}};AGIVertices[_0xbb43('0x10')][_0xbb43('0x96')]=function(_0x501743){var _0x883f34=_0x501743[_0xbb43('0x9f')]('{');for(var _0x2f3739=0x1;_0x2f3739<_0x883f34[_0xbb43('0x9e')];_0x2f3739+=0x1){var _0x49b282=_0x883f34[_0x2f3739][_0xbb43('0x9f')]('}');if(_0x49b282[_0xbb43('0x9e')]>0x1){_0x501743=_0x501743['replaceAll']('{'+_0x49b282[0x0]+'}',this[_0xbb43('0xe')]['getVariable'](_0x49b282[0x0])[_0xbb43('0xa0')]||_0x49b282[0x0]);}}if(_0x883f34[_0xbb43('0x9e')]===0x1){return _0x501743[_0xbb43('0xa1')]();}return this[_0xbb43('0x96')](_0x501743);};AGIVertices['prototype'][_0xbb43('0xa2')]=function(_0x3cf673,_0x45116a){var _0x3d1677=this[_0xbb43('0xe')][_0xbb43('0x11')](_0x3cf673);if(_0x3d1677['result']===-0x1){return _0x3d1677;}logger[_0xbb43('0x31')](util[_0xbb43('0x2b')](_0xbb43('0xa3'),_0x45116a,_0x3d1677[_0xbb43('0xa0')]));return this[_0xbb43('0xe')]['setVariable'](_0x45116a,_0x3d1677[_0xbb43('0xa0')]);};AGIVertices[_0xbb43('0x10')][_0xbb43('0x84')]=function(_0x4b46bc){return _0x4b46bc&&_0x4b46bc!=='0'&&_0x4b46bc!=='-1'&&_0x4b46bc!=='';};AGIVertices[_0xbb43('0x10')][_0xbb43('0xa4')]=function(_0x2cffd0){this[_0xbb43('0x3a')][_0xbb43('0x72')](this,_0x2cffd0,'-');_0x2cffd0[_0xbb43('0xa5')]=_0x2cffd0[_0xbb43('0xa4')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xbb43('0x10')][_0xbb43('0xa6')]=function(_0x18738a){logger[_0xbb43('0x31')](util[_0xbb43('0x2b')](_0xbb43('0xa7'),_0x18738a[_0xbb43('0x3c')]));if(!this[_0xbb43('0x84')](_0x18738a[_0xbb43('0x5c')])){return this[_0xbb43('0xe')][_0xbb43('0xa8')](_0xbb43('0xa9'));}var _0x13f97e='\x22'+_0x18738a[_0xbb43('0x5c')]+'\x22';if(this['isConfigured'](_0x18738a[_0xbb43('0x7b')])){_0x13f97e+=','+_0x18738a[_0xbb43('0x7b')];}var _0x248a03=this[_0xbb43('0xe')][_0xbb43('0x57')]('MRCPSynth',_0x13f97e);if(_0x248a03[_0xbb43('0xaa')]===-0x1){return _0x248a03;}return this[_0xbb43('0xe')][_0xbb43('0xa8')](util[_0xbb43('0x2b')](_0xbb43('0xab'),_0x13f97e));};AGIVertices['prototype']['mrcprecog']=function(_0x418984){logger[_0xbb43('0x31')](util[_0xbb43('0x2b')]('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0x418984['label']));if(!this['isConfigured'](_0x418984[_0xbb43('0xac')])){return this[_0xbb43('0xe')]['noop'](_0xbb43('0xad'));}var _0x9eb32c=_0x418984[_0xbb43('0xac')];if(this[_0xbb43('0x84')](_0x418984['options'])){_0x9eb32c+=','+_0x418984[_0xbb43('0x7b')];}var _0x445590=this[_0xbb43('0xe')][_0xbb43('0x57')](_0xbb43('0xae'),_0x9eb32c);if(_0x445590['result']===-0x1){return _0x445590;}var _0x132910=this[_0xbb43('0xa2')](_0xbb43('0xaf'),'MRCP_RECOG_CONFIDENCE');if(_0x132910[_0xbb43('0xaa')]===-0x1){return _0x132910;}var _0x427abe=this[_0xbb43('0xa2')](_0xbb43('0xb0'),_0xbb43('0xb1'));if(_0x427abe[_0xbb43('0xaa')]===-0x1){return _0x427abe;}var _0x20face=this['getAndSetVariable']('RECOG_INSTANCE()','MRCP_RECOG_INSTANCE');if(_0x20face[_0xbb43('0xaa')]===-0x1){return _0x20face;}return this[_0xbb43('0xe')][_0xbb43('0xa8')](util[_0xbb43('0x2b')](_0xbb43('0xb2'),_0x9eb32c));};AGIVertices['prototype']['agi']=function(_0x1349e5){logger['info'](util[_0xbb43('0x2b')]('Enter\x20in\x20AGI\x20(%s)\x20block',_0x1349e5['label']));return this[_0xbb43('0xe')][_0xbb43('0x8')]([_0x1349e5['command'],_0x1349e5[_0xbb43('0xb3')]]);};AGIVertices['prototype'][_0xbb43('0xb4')]=function(_0x5b851f){logger['info'](util['format'](_0xbb43('0xb5'),_0x5b851f[_0xbb43('0x3c')]));if(this[_0xbb43('0x84')](_0x5b851f[_0xbb43('0x67')])){logger[_0xbb43('0x31')](util['format'](_0xbb43('0xb6'),_0x5b851f[_0xbb43('0x67')]));var _0x2560b3=this[_0xbb43('0xe')][_0xbb43('0xb7')](_0x5b851f[_0xbb43('0x67')]);if(_0x2560b3[_0xbb43('0xaa')]===-0x1){return _0x2560b3;}}return this['channel'][_0xbb43('0xb4')]();};AGIVertices['prototype'][_0xbb43('0xb8')]=function(_0x3c1a63){logger[_0xbb43('0x31')](util['format'](_0xbb43('0xb9'),_0x3c1a63[_0xbb43('0x3c')]));if(!this[_0xbb43('0x84')](_0x3c1a63['list_id'])){return this[_0xbb43('0xe')][_0xbb43('0x2f')](_0x3c1a63,_0xbb43('0xba'));}_0x3c1a63[_0xbb43('0x4e')]=moment();if(this[_0xbb43('0x84')](_0x3c1a63['delay'])){_0x3c1a63[_0xbb43('0x4e')]=moment()['add'](_0x3c1a63[_0xbb43('0xbb')],_0xbb43('0xbc'));}if(!this[_0xbb43('0x84')](_0x3c1a63[_0xbb43('0xbd')])){_0x3c1a63[_0xbb43('0xbd')]=0x2;}this['createCmContact'][_0xbb43('0x72')](this,_0x3c1a63);return this[_0xbb43('0xe')][_0xbb43('0xa8')](util[_0xbb43('0x2b')](_0xbb43('0xbe'),_0x3c1a63[_0xbb43('0x4d')],_0x3c1a63[_0xbb43('0xbf')],_0x3c1a63[_0xbb43('0x4e')]));};AGIVertices[_0xbb43('0x10')]['custom_app']=function(_0x401e7b){logger[_0xbb43('0x31')](util[_0xbb43('0x2b')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x401e7b[_0xbb43('0x3c')]));var _0x2ed633=this[_0xbb43('0xe')][_0xbb43('0x57')](_0x401e7b[_0xbb43('0xc0')],_0x401e7b[_0xbb43('0x7b')]);if(_0x2ed633[_0xbb43('0xaa')]===-0x1){return _0x2ed633;}return this[_0xbb43('0xe')][_0xbb43('0xa8')](util[_0xbb43('0x2b')](_0xbb43('0xc1'),_0x401e7b[_0xbb43('0xc0')],_0x401e7b[_0xbb43('0x7b')]));};AGIVertices[_0xbb43('0x10')][_0xbb43('0xc2')]=function(_0x23bb72){logger[_0xbb43('0x31')](util['format'](_0xbb43('0xc3'),_0x23bb72[_0xbb43('0x3c')]));if(!this[_0xbb43('0x84')](_0x23bb72['text'])){return this['channel'][_0xbb43('0xa8')](_0xbb43('0xa9'));}var _0x599d64='\x22'+_0x23bb72['text']+'\x22';if(this[_0xbb43('0x84')](_0x23bb72[_0xbb43('0x7b')])){_0x599d64+=','+_0x23bb72[_0xbb43('0x7b')];}var _0x16eff3=this[_0xbb43('0xe')]['exec'](_0xbb43('0xc4'),_0x599d64);if(_0x16eff3['result']===-0x1){return _0x16eff3;}return this['channel']['noop'](util[_0xbb43('0x2b')](_0xbb43('0xab'),_0x599d64));};AGIVertices['prototype'][_0xbb43('0xc5')]=function(_0x3244ed){logger[_0xbb43('0x31')](util[_0xbb43('0x2b')](_0xbb43('0xc6'),_0x3244ed['label']));if(!this[_0xbb43('0x84')](_0x3244ed[_0xbb43('0x5c')])){return this[_0xbb43('0xe')][_0xbb43('0xa8')]('no\x20text\x20configured');}var _0x46f510='\x22'+_0x3244ed['text']+'\x22';if(this[_0xbb43('0x84')](_0x3244ed[_0xbb43('0x7b')])){_0x46f510+=','+_0x3244ed[_0xbb43('0x7b')];}var _0x45cb88=this[_0xbb43('0xe')][_0xbb43('0x57')](_0xbb43('0xc4'),_0x46f510);if(_0x45cb88[_0xbb43('0xaa')]===-0x1){return _0x45cb88;}return this[_0xbb43('0xe')][_0xbb43('0xa8')](util[_0xbb43('0x2b')](_0xbb43('0xab'),_0x46f510));};AGIVertices[_0xbb43('0x10')][_0xbb43('0xc7')]=function(_0x3b4260){logger[_0xbb43('0x31')](util['format']('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x3b4260[_0xbb43('0x3c')]));if(!this[_0xbb43('0x84')](_0x3b4260['grammar'])){return this[_0xbb43('0xe')][_0xbb43('0xa8')](_0xbb43('0xad'));}var _0x2f4e12=_0x3b4260[_0xbb43('0xac')];if(this['isConfigured'](_0x3b4260[_0xbb43('0x7b')])){_0x2f4e12+=','+_0x3b4260['options'];}var _0x4ea141=this[_0xbb43('0xe')]['exec'](_0xbb43('0xae'),_0x2f4e12);if(_0x4ea141['result']===-0x1){return _0x4ea141;}var _0x23ae87=this[_0xbb43('0xa2')](_0xbb43('0xaf'),_0xbb43('0xc8'));if(_0x23ae87['result']===-0x1){return _0x23ae87;}var _0xbf45fe=this[_0xbb43('0xa2')](_0xbb43('0xb0'),_0xbb43('0xc9'));if(_0xbf45fe['result']===-0x1){return _0xbf45fe;}var _0x31d732=this[_0xbb43('0xa2')](_0xbb43('0xca'),'LUMENVOX_ASR_INSTANCE');if(_0x31d732[_0xbb43('0xaa')]===-0x1){return _0x31d732;}return this[_0xbb43('0xe')][_0xbb43('0xa8')](util[_0xbb43('0x2b')](_0xbb43('0xb2'),_0x2f4e12));};AGIVertices['prototype'][_0xbb43('0xcb')]=function(_0x5b3250){logger['info'](util[_0xbb43('0x2b')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x5b3250[_0xbb43('0x3c')]));if(!this[_0xbb43('0x84')](_0x5b3250[_0xbb43('0xac')])){return this[_0xbb43('0xe')][_0xbb43('0xa8')]('no\x20grammar\x20configured');}var _0x28d33a=_0x5b3250[_0xbb43('0xac')];if(this['isConfigured'](_0x5b3250[_0xbb43('0x7b')])){_0x28d33a+=','+_0x5b3250[_0xbb43('0x7b')];}var _0x35ae97=this[_0xbb43('0xe')][_0xbb43('0x57')](_0xbb43('0xae'),_0x28d33a);if(_0x35ae97['result']===-0x1){return _0x35ae97;}var _0x42b8b0=this[_0xbb43('0xa2')](_0xbb43('0xaf'),_0xbb43('0xcc'));if(_0x42b8b0[_0xbb43('0xaa')]===-0x1){return _0x42b8b0;}var _0x3859d9=this[_0xbb43('0xa2')](_0xbb43('0xb0'),'SESTEK_ASR_TRANSCRIPT');if(_0x3859d9[_0xbb43('0xaa')]===-0x1){return _0x3859d9;}var _0x1f7c11=this['getAndSetVariable'](_0xbb43('0xca'),_0xbb43('0xcd'));if(_0x1f7c11[_0xbb43('0xaa')]===-0x1){return _0x1f7c11;}return this[_0xbb43('0xe')][_0xbb43('0xa8')](util[_0xbb43('0x2b')](_0xbb43('0xb2'),_0x28d33a));};AGIVertices[_0xbb43('0x10')][_0xbb43('0xce')]=function(_0x38a9de){logger[_0xbb43('0x31')](util[_0xbb43('0x2b')](_0xbb43('0xcf'),_0x38a9de['label']));if(!this[_0xbb43('0x84')](_0x38a9de[_0xbb43('0xd0')])){return this['channel'][_0xbb43('0x2f')](_0x38a9de,'no\x20database\x20selected');}var _0x39b390=this[_0xbb43('0xd1')][_0xbb43('0x72')](this,_0x38a9de[_0xbb43('0xd0')]);if(!_0x39b390){return this[_0xbb43('0xe')][_0xbb43('0x2f')](_0x38a9de,_0xbb43('0xd2'));}if(!this[_0xbb43('0x84')](_0x38a9de[_0xbb43('0x33')])){return this[_0xbb43('0xe')][_0xbb43('0x2f')](_0x38a9de,_0xbb43('0xd3'));}var _0x54fca4=_0x38a9de['query'][_0xbb43('0x58')](/(\r\n|\n|\r)/gm,'\x20');this[_0xbb43('0xe')]['noop'](util[_0xbb43('0x2b')]('query:\x20%s',_0x54fca4));var _0x4f440e=this['getQueryOdbc'][_0xbb43('0x72')](this,_0x39b390,_0x54fca4);this[_0xbb43('0x3a')][_0xbb43('0x72')](this,_0x38a9de,_0x54fca4);if(!this[_0xbb43('0x84')](_0x38a9de[_0xbb43('0xd4')])){return this[_0xbb43('0xe')][_0xbb43('0xa8')](_0xbb43('0xd5'));}var _0x4e8bda=this[_0xbb43('0x11')][_0xbb43('0x72')](this,_0x38a9de['variable_id']);if(!_0x4e8bda){return this[_0xbb43('0xe')][_0xbb43('0x2f')](_0x38a9de,_0xbb43('0xd6'));}var _0x17ac9b=this;_0x4f440e[_0xbb43('0xd7')](function(_0x2cd3e7,_0x422b7c){Object[_0xbb43('0xd8')](_0x2cd3e7)[_0xbb43('0xd7')](function(_0x5f5ddc){_0x17ac9b[_0xbb43('0xe')][_0xbb43('0xd9')](util['format']('%s[%s][%s]',_0x4e8bda,_0x422b7c,_0x5f5ddc),_0x2cd3e7[_0x5f5ddc]);});});this[_0xbb43('0xe')][_0xbb43('0xd9')](util[_0xbb43('0x2b')](_0xbb43('0xda'),_0x4e8bda),_0x4f440e['length']);return this[_0xbb43('0xe')]['noop'](util[_0xbb43('0x2b')]('variable\x20%s\x20set',_0x4e8bda));};AGIVertices[_0xbb43('0x10')]['dial']=function(_0x1f941a){logger[_0xbb43('0xdb')](util[_0xbb43('0x2b')](_0xbb43('0xdc'),_0x1f941a['label']));if(!this[_0xbb43('0x84')](_0x1f941a[_0xbb43('0xdd')])){return this[_0xbb43('0xe')][_0xbb43('0x2f')](_0x1f941a,_0xbb43('0xde'));}var _0x1fbd28=this['getUser'][_0xbb43('0x72')](this,_0x1f941a['sip_id']);if(!_0x1fbd28){return this[_0xbb43('0xe')][_0xbb43('0x2f')](_0x1f941a,_0xbb43('0xdf'));}var _0x4bbf68=this[_0xbb43('0xe')][_0xbb43('0x57')]('DIAL',[util[_0xbb43('0x2b')](_0xbb43('0xe0'),_0x1fbd28),_0x1f941a[_0xbb43('0x67')],_0x1f941a[_0xbb43('0xe1')],_0x1f941a[_0xbb43('0x66')]]);if(_0x4bbf68[_0xbb43('0xaa')]===-0x1){return _0x4bbf68;}return this['channel'][_0xbb43('0xa8')](util[_0xbb43('0x2b')]('Executed\x20command\x20%s',_0xbb43('0xe2')));};AGIVertices['prototype']['dialogflow']=function(_0x5891ab){logger[_0xbb43('0x31')](util['format'](_0xbb43('0xe3'),_0x5891ab[_0xbb43('0x3c')]));if(!this[_0xbb43('0x84')](_0x5891ab[_0xbb43('0x81')])){return this[_0xbb43('0xe')][_0xbb43('0xa8')](_0xbb43('0xe4'));}if(!this[_0xbb43('0x84')](_0x5891ab['text'])){return this[_0xbb43('0xe')][_0xbb43('0xa8')](_0xbb43('0xa9'));}this[_0xbb43('0xe')][_0xbb43('0xe5')]=!![];this[_0xbb43('0x3a')](_0x5891ab);this[_0xbb43('0x47')](_0x5891ab[_0xbb43('0x5c')],'in','','');this[_0xbb43('0xe')][_0xbb43('0xa8')](util[_0xbb43('0x2b')](_0xbb43('0xe6'),_0x5891ab[_0xbb43('0x5c')]));var _0x256258=this['googleDialogflow']['sync'](this,_0x5891ab);if(_0x256258){for(var _0x30f12e in _0x256258){if(_0x256258[_0xbb43('0x97')](_0x30f12e)){this[_0xbb43('0xe')][_0xbb43('0xd9')](util[_0xbb43('0x2b')](_0xbb43('0xe7'),_0x30f12e['toUpperCase']()),_0x256258[_0x30f12e]);}}this[_0xbb43('0x47')](_0x256258[_0xbb43('0xe8')],_0xbb43('0xe9'),_0xbb43('0xea'),'');return this[_0xbb43('0xe')][_0xbb43('0xa8')](util[_0xbb43('0x2b')](_0xbb43('0xeb'),_0x256258[_0xbb43('0xe8')]));}return this['channel']['error'](_0x5891ab,_0xbb43('0xec'));};AGIVertices[_0xbb43('0x10')][_0xbb43('0xed')]=function(_0x1a7e0b){logger['info'](util[_0xbb43('0x2b')]('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x1a7e0b['label']));if(!this[_0xbb43('0x84')](_0x1a7e0b[_0xbb43('0xee')])){return this[_0xbb43('0xe')][_0xbb43('0xa8')](_0xbb43('0xef'));}if(!this[_0xbb43('0x84')](_0x1a7e0b[_0xbb43('0x7e')])){return this[_0xbb43('0xe')][_0xbb43('0xa8')]('no\x20client_email\x20configured');}if(!this[_0xbb43('0x84')](_0x1a7e0b[_0xbb43('0xf0')])){return this[_0xbb43('0xe')]['noop']('no\x20private_key\x20configured');}if(!this[_0xbb43('0x84')](_0x1a7e0b[_0xbb43('0x7f')])){return this[_0xbb43('0xe')][_0xbb43('0xa8')](_0xbb43('0xf1'));}if(!this[_0xbb43('0x84')](_0x1a7e0b[_0xbb43('0x5c')])){return this[_0xbb43('0xe')]['noop'](_0xbb43('0xa9'));}this[_0xbb43('0xe')]['bot']=!![];this['createSquareDetailsReport'](_0x1a7e0b);this[_0xbb43('0x47')](_0x1a7e0b[_0xbb43('0x5c')],'in','','');this['channel']['noop'](util[_0xbb43('0x2b')](_0xbb43('0xf2'),_0x1a7e0b['text']));var _0x2a19a4=this[_0xbb43('0x7d')][_0xbb43('0x72')](this,_0x1a7e0b);if(_0x2a19a4){for(var _0x31663f in _0x2a19a4){if(_0x2a19a4['hasOwnProperty'](_0x31663f)){if(_0x31663f!==_0xbb43('0xf3')){this['channel'][_0xbb43('0xd9')](util['format'](_0xbb43('0xe7'),_0x31663f[_0xbb43('0x6c')]()),_0x2a19a4[_0x31663f]);}}}this['createSquareMessage'](_0x2a19a4[_0xbb43('0xe8')],'out',_0xbb43('0xed'),_0x2a19a4[_0xbb43('0xf3')]);return this[_0xbb43('0xe')][_0xbb43('0xa8')](util['format'](_0xbb43('0xf4'),_0x2a19a4[_0xbb43('0xe8')]));}return this['channel'][_0xbb43('0x2f')](_0x1a7e0b,_0xbb43('0xf5'));};AGIVertices[_0xbb43('0x10')][_0xbb43('0xf6')]=function(_0x3cf8c7){logger[_0xbb43('0x31')](util[_0xbb43('0x2b')](_0xbb43('0xf7'),_0x3cf8c7[_0xbb43('0x3c')]));if(!this['isConfigured'](_0x3cf8c7[_0xbb43('0xf8')])){return this[_0xbb43('0xe')]['noop'](_0xbb43('0xf9'));}if(!this[_0xbb43('0x84')](_0x3cf8c7[_0xbb43('0xfa')])){return this['channel'][_0xbb43('0xa8')]('no\x20username\x20configured');}if(!this[_0xbb43('0x84')](_0x3cf8c7[_0xbb43('0xfb')])){return this['channel']['noop'](_0xbb43('0xfc'));}if(!this[_0xbb43('0x84')](_0x3cf8c7[_0xbb43('0xfd')])){return this[_0xbb43('0xe')]['noop'](_0xbb43('0xa9'));}this[_0xbb43('0xe')][_0xbb43('0xe5')]=!![];this['createSquareDetailsReport'](_0x3cf8c7);this[_0xbb43('0x47')](_0x3cf8c7[_0xbb43('0x5c')],'in','','');this[_0xbb43('0xe')][_0xbb43('0xa8')](util[_0xbb43('0x2b')]('Trying\x20SestekNDA:\x20%s',_0x3cf8c7[_0xbb43('0x5c')]));var _0x5addc8=this[_0xbb43('0x80')][_0xbb43('0x72')](this,_0x3cf8c7);if(_0x5addc8){for(var _0x2f92b4 in _0x5addc8){if(_0x5addc8[_0xbb43('0x97')](_0x2f92b4)){this[_0xbb43('0xe')]['setVariable'](util[_0xbb43('0x2b')]('SESTEK_NDA_%s',_0x2f92b4[_0xbb43('0x6c')]()),_0x5addc8[_0x2f92b4]);}}this[_0xbb43('0x47')](_0x5addc8['speech'],_0xbb43('0xe9'),_0xbb43('0xf6'),'');if(_0x5addc8[_0xbb43('0xfe')]){this[_0xbb43('0xe')][_0xbb43('0xa8')](util['format']('Sestek\x20NDA\x20%s\x20file\x20created',_0x5addc8[_0xbb43('0xfe')]));var _0x385c4b=this['channel'][_0xbb43('0xff')](_0x5addc8['audiofile']);try{fs['unlink'](_0x5addc8['audiofile']+_0xbb43('0x100'));}catch(_0xd3ece2){logger[_0xbb43('0x2f')](_0xd3ece2);}return _0x385c4b;}else{return this['channel'][_0xbb43('0xa8')](util[_0xbb43('0x2b')](_0xbb43('0x101'),_0x5addc8[_0xbb43('0xe8')]));}}return this[_0xbb43('0xe')][_0xbb43('0x2f')](_0x3cf8c7,_0xbb43('0x102'));};AGIVertices['prototype'][_0xbb43('0x103')]=function(_0x15cb69){logger[_0xbb43('0x31')](util[_0xbb43('0x2b')]('Enter\x20in\x20END\x20(%s)\x20block',_0x15cb69[_0xbb43('0x3c')]));return this[_0xbb43('0xe')][_0xbb43('0xa8')](_0xbb43('0x103'));};AGIVertices[_0xbb43('0x10')][_0xbb43('0x104')]=function(_0x376d44){logger[_0xbb43('0x31')](util['format']('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x376d44['label']));var _0x2b1df8='';if(_0x376d44[_0xbb43('0x105')]){if(!this[_0xbb43('0x84')](_0x376d44[_0xbb43('0x105')])){return this[_0xbb43('0xe')]['error'](_0x376d44,_0xbb43('0x106'));}else{var _0x1253d4=parseInt(_0x376d44['trunk_id'],0xa);if(isNaN(_0x1253d4)){_0x2b1df8=_0x376d44['trunk_id'];}else{_0x2b1df8=this['getTrunk']['sync'](this,_0x376d44[_0xbb43('0x105')]);if(!_0x2b1df8){return this[_0xbb43('0xe')]['error'](_0x376d44,_0xbb43('0x107'));}}}}else if(_0x376d44['trunk_name']){_0x2b1df8=_0x376d44[_0xbb43('0x108')];}else{return this[_0xbb43('0xe')][_0xbb43('0x2f')](_0x376d44,_0xbb43('0x106'));}var _0x4ce664=this[_0xbb43('0xe')]['exec'](_0xbb43('0xe2'),[util[_0xbb43('0x2b')](_0xbb43('0x109'),_0x2b1df8,_0x376d44[_0xbb43('0x4d')]),_0x376d44['timeout'],_0x376d44[_0xbb43('0xe1')],_0x376d44['url']]);if(_0x4ce664['result']===-0x1){return _0x4ce664;}return this['channel'][_0xbb43('0xa8')](util[_0xbb43('0x2b')](_0xbb43('0x10a'),'DIAL'));};AGIVertices[_0xbb43('0x10')]['finally']=function(_0xb9fdf){logger[_0xbb43('0x31')](util[_0xbb43('0x2b')](_0xbb43('0x10b'),_0xb9fdf[_0xbb43('0x3c')]));return this['channel']['noop']('finally');};AGIVertices['prototype'][_0xbb43('0x10c')]=function(_0x3bcec7){logger[_0xbb43('0x31')](util[_0xbb43('0x2b')](_0xbb43('0x10d'),_0x3bcec7['label']));if(_0x3bcec7['retry']===0x0){return this[_0xbb43('0xa4')](_0x3bcec7);}_0x3bcec7['retry']-=0x1;if(!this[_0xbb43('0x84')](_0x3bcec7[_0xbb43('0x10e')])){return this[_0xbb43('0xe')]['error'](_0x3bcec7,_0xbb43('0x10f'));}var _0x59006d=this['getSound'][_0xbb43('0x72')](this,_0x3bcec7[_0xbb43('0x10e')]);if(!_0x59006d){return this[_0xbb43('0xe')]['error'](_0x3bcec7,_0xbb43('0x110'));}if(!this[_0xbb43('0x84')](_0x3bcec7[_0xbb43('0xd4')])){return this[_0xbb43('0xe')][_0xbb43('0x2f')](_0xbb43('0xd5'));}var _0x267100=this[_0xbb43('0xe')][_0xbb43('0x111')](_0x59006d,_0x3bcec7[_0xbb43('0x112')],_0x3bcec7['maxdigit']);var _0x199d1e=_0x267100['result']?_0x267100['result'][_0xbb43('0xa1')]():'';logger[_0xbb43('0x31')]('test',JSON[_0xbb43('0x75')](_0x267100));if(_0x267100[_0xbb43('0xaa')]===-0x1){this[_0xbb43('0x3a')][_0xbb43('0x72')](this,_0x3bcec7,_0x199d1e);return _0x267100;}else if(_0x267100[_0xbb43('0xa0')]==='timeout'){_0x267100['result']=_0x199d1e[_0xbb43('0x9e')]>=parseInt(_0x3bcec7[_0xbb43('0x113')])?'x':'i';}else{_0x267100[_0xbb43('0xaa')]=_0x199d1e[_0xbb43('0x9e')]>=parseInt(_0x3bcec7[_0xbb43('0x113')])&&_0x199d1e[_0xbb43('0x9e')]<=parseInt(_0x3bcec7[_0xbb43('0x114')])?'x':'i';}var _0xd2a221=this['getVariable'][_0xbb43('0x72')](this,_0x3bcec7['variable_id']);if(!_0xd2a221){return this[_0xbb43('0xe')][_0xbb43('0x2f')](_0x3bcec7,_0xbb43('0xd6'));}this[_0xbb43('0xe')][_0xbb43('0xd9')](_0xd2a221,_0x199d1e);if(this[_0xbb43('0x84')](_0x3bcec7[_0xbb43('0x115')])){var _0x52074c=parseInt(_0x3bcec7[_0xbb43('0x115')],0xa);var _0x4d5fc4=rs['generate']({'charset':'*','length':_0x52074c});var _0x3b00c9=_0x199d1e[_0xbb43('0x9e')];if(_0x3b00c9>0x0){if(_0x3b00c9>_0x52074c){this[_0xbb43('0x3a')]['sync'](this,_0x3bcec7,_0x3bcec7[_0xbb43('0x116')]===_0xbb43('0x117')?_0x4d5fc4+_0x199d1e[_0xbb43('0x118')](_0x52074c):_0x199d1e[_0xbb43('0x118')](0x0,_0x3b00c9-_0x52074c)+_0x4d5fc4);}else{this[_0xbb43('0x3a')][_0xbb43('0x72')](this,_0x3bcec7,rs[_0xbb43('0x119')]({'charset':'*','length':_0x3b00c9}));}}else{this[_0xbb43('0x3a')][_0xbb43('0x72')](this,_0x3bcec7,'');}}else{this[_0xbb43('0x3a')][_0xbb43('0x72')](this,_0x3bcec7,_0x199d1e);}return _0x267100;};AGIVertices['prototype'][_0xbb43('0xd')]=function(_0x1344f6){logger[_0xbb43('0x31')](util[_0xbb43('0x2b')](_0xbb43('0x11a'),_0x1344f6[_0xbb43('0x3c')]));return this[_0xbb43('0x10c')](_0x1344f6);};AGIVertices['prototype'][_0xbb43('0x11b')]=function(_0x2e576b){logger[_0xbb43('0x31')](util[_0xbb43('0x2b')](_0xbb43('0x11c'),_0x2e576b['label']));this[_0xbb43('0x3a')]['sync'](this,_0x2e576b,_0x2e576b[_0xbb43('0x11d')]);return this[_0xbb43('0xe')][_0xbb43('0xa8')](util[_0xbb43('0x2b')](_0xbb43('0x11e'),_0x2e576b['goalname']));};AGIVertices[_0xbb43('0x10')][_0xbb43('0x11f')]=function(_0x4ce0a1){logger['info'](util[_0xbb43('0x2b')](_0xbb43('0x120'),_0x4ce0a1[_0xbb43('0x3c')]));if(!this[_0xbb43('0x84')](_0x4ce0a1[_0xbb43('0x87')])||!this[_0xbb43('0x84')](_0x4ce0a1[_0xbb43('0x121')])){return this['channel'][_0xbb43('0xa8')](_0xbb43('0x122'));}if(!this['isConfigured'](_0x4ce0a1[_0xbb43('0x5c')])){return this[_0xbb43('0xe')]['noop'](_0xbb43('0xa9'));}this[_0xbb43('0xe')][_0xbb43('0xa8')](util[_0xbb43('0x2b')](_0xbb43('0x123'),_0x4ce0a1[_0xbb43('0x5c')]));var _0x1fb01e=this[_0xbb43('0x86')][_0xbb43('0x72')](this,_0x4ce0a1);if(_0x1fb01e){this[_0xbb43('0xe')]['noop'](util[_0xbb43('0x2b')](_0xbb43('0x124'),_0x1fb01e));var _0x5b1dbe=this[_0xbb43('0xe')]['streamFile'](_0x1fb01e);try{fs[_0xbb43('0x125')](_0x1fb01e+_0xbb43('0x100'));}catch(_0x1d8866){logger[_0xbb43('0x2f')](_0x1d8866);}return _0x5b1dbe;}return this[_0xbb43('0xe')][_0xbb43('0x2f')](_0x4ce0a1,'aws\x20Polly\x20is\x20unreachable');};AGIVertices['prototype'][_0xbb43('0x126')]=function(_0x3a7eab){logger[_0xbb43('0x31')](util[_0xbb43('0x2b')](_0xbb43('0x127'),_0x3a7eab[_0xbb43('0x3c')]));if(!this[_0xbb43('0x84')](_0x3a7eab[_0xbb43('0x87')])||!this[_0xbb43('0x84')](_0x3a7eab[_0xbb43('0x121')])){return this[_0xbb43('0xe')][_0xbb43('0xa8')](_0xbb43('0x122'));}if(!this[_0xbb43('0x84')](_0x3a7eab[_0xbb43('0x128')])){return this[_0xbb43('0xe')]['noop'](_0xbb43('0x129'));}if(!this[_0xbb43('0x84')](_0x3a7eab['text'])){return this[_0xbb43('0xe')][_0xbb43('0xa8')](_0xbb43('0xa9'));}this[_0xbb43('0xe')]['bot']=!![];this[_0xbb43('0x3a')](_0x3a7eab);this[_0xbb43('0x47')](_0x3a7eab['text'],'in','','');this[_0xbb43('0xe')][_0xbb43('0xa8')](util[_0xbb43('0x2b')](_0xbb43('0x12a'),_0x3a7eab[_0xbb43('0x5c')]));var _0x4b3eb8=this[_0xbb43('0x8b')][_0xbb43('0x72')](this,_0x3a7eab);if(_0x4b3eb8){for(var _0x1a9ae1 in _0x4b3eb8){if(_0x4b3eb8[_0xbb43('0x97')](_0x1a9ae1)&&_[_0xbb43('0x94')](_0x4b3eb8[_0x1a9ae1])){this[_0xbb43('0xe')][_0xbb43('0xd9')](util[_0xbb43('0x2b')](_0xbb43('0x12b'),_0x1a9ae1[_0xbb43('0x6c')]()),_0x4b3eb8[_0x1a9ae1]);}}if(_[_0xbb43('0x49')](_0x4b3eb8[_0xbb43('0x7a')])){return this[_0xbb43('0xe')][_0xbb43('0xa8')](_0xbb43('0x12c'));}else{this[_0xbb43('0x47')](_0x4b3eb8[_0xbb43('0x7a')],'out',_0xbb43('0x12d'),'');return this[_0xbb43('0xe')][_0xbb43('0xa8')](util[_0xbb43('0x2b')](_0xbb43('0x12e'),_0x4b3eb8[_0xbb43('0x7a')]));}}return this[_0xbb43('0xe')][_0xbb43('0x2f')](_0x3a7eab,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0xbb43('0x10')][_0xbb43('0x12f')]=function(_0x5d315a){logger[_0xbb43('0x31')](util[_0xbb43('0x2b')](_0xbb43('0x130'),_0x5d315a[_0xbb43('0x3c')],_0x5d315a[_0xbb43('0x67')]));if(!this['isConfigured'](_0x5d315a[_0xbb43('0x81')])){return this[_0xbb43('0xe')][_0xbb43('0xa8')](_0xbb43('0xe4'));}var _0x13054b=_0xbb43('0x131');var _0x21b18a=util['format']('%s/recordings/%s',FILES_PATH,rs[_0xbb43('0x119')](0x4));var _0x504ca0=util['format'](_0xbb43('0x9c'),_0x21b18a,_0x13054b);var _0x4424b0=!![];if(_0x5d315a['beep']===_0xbb43('0x132')){_0x4424b0=![];}var _0x46ceb9=this[_0xbb43('0xe')][_0xbb43('0x133')](_0x21b18a,_0x13054b,_0x5d315a[_0xbb43('0x134')],_0x5d315a[_0xbb43('0x67')],undefined,_0x4424b0);if(_0x46ceb9[_0xbb43('0xaa')]!==-0x1){this['channel']['noop'](util[_0xbb43('0x2b')]('google\x20%s\x20file\x20created',_0x504ca0));var _0x233e10=this['googleASR'][_0xbb43('0x72')](this,_0x5d315a,_0x504ca0);if(_0x233e10){for(var _0x206f55 in _0x233e10){if(_0x233e10[_0xbb43('0x97')](_0x206f55)){this[_0xbb43('0xe')][_0xbb43('0xd9')](util[_0xbb43('0x2b')](_0xbb43('0x135'),_0x206f55['toUpperCase']()),_0x233e10[_0x206f55]);}}return this[_0xbb43('0xe')][_0xbb43('0xa8')](util[_0xbb43('0x2b')]('GoogleASR\x20Result\x20%s',JSON[_0xbb43('0x75')](_0x233e10)));}}return _0x46ceb9;};AGIVertices['prototype']['tildeasr']=function(_0x36e255){logger[_0xbb43('0x31')](util['format'](_0xbb43('0x136'),_0x36e255[_0xbb43('0x3c')]));if(!this[_0xbb43('0x84')](_0x36e255['appid'])){return this[_0xbb43('0xe')][_0xbb43('0xa8')]('no\x20appid\x20configured');}if(!this[_0xbb43('0x84')](_0x36e255['appsecret'])){return this['channel'][_0xbb43('0xa8')](_0xbb43('0x137'));}var _0x2d53a8=_0xbb43('0x131');var _0x30aa9e=util['format'](_0xbb43('0x138'),FILES_PATH,rs[_0xbb43('0x119')](0x4));var _0x4efbbe=util['format'](_0xbb43('0x9c'),_0x30aa9e,_0x2d53a8);var _0x3ee4df=!![];if(_0x36e255[_0xbb43('0x139')]===_0xbb43('0x132')){_0x3ee4df=![];}var _0x471eba=this['channel'][_0xbb43('0x133')](_0x30aa9e,_0x2d53a8,_0x36e255[_0xbb43('0x134')],_0x36e255['timeout'],undefined,_0x3ee4df);if(_0x471eba[_0xbb43('0xaa')]!==-0x1){this[_0xbb43('0xe')][_0xbb43('0xa8')](util['format'](_0xbb43('0x13a'),_0x4efbbe));var _0x14195e=this['tildeASR'][_0xbb43('0x72')](this,_0x36e255,_0x4efbbe);if(_0x14195e){for(var _0x181fd3 in _0x14195e){if(_0x14195e['hasOwnProperty'](_0x181fd3)){this[_0xbb43('0xe')]['setVariable'](util[_0xbb43('0x2b')](_0xbb43('0x13b'),_0x181fd3[_0xbb43('0x6c')]()),_0x14195e[_0x181fd3]);}}return this[_0xbb43('0xe')][_0xbb43('0xa8')](util['format']('TildeASR\x20Result\x20%s',JSON['stringify'](_0x14195e)));}}return _0x471eba;};AGIVertices[_0xbb43('0x10')][_0xbb43('0x13c')]=function(_0xfdfd9a){logger[_0xbb43('0x31')](util['format'](_0xbb43('0x13d'),_0xfdfd9a[_0xbb43('0x3c')]));return this[_0xbb43('0xe')]['continueAt'](_0xfdfd9a[_0xbb43('0x42')],_0xfdfd9a[_0xbb43('0x13e')],_0xfdfd9a[_0xbb43('0x43')]);};AGIVertices['prototype'][_0xbb43('0x13f')]=function(_0x368da1){logger[_0xbb43('0x31')](util[_0xbb43('0x2b')](_0xbb43('0x140'),_0x368da1[_0xbb43('0x3c')]));if(!this[_0xbb43('0x84')](_0x368da1[_0xbb43('0x141')])){return this[_0xbb43('0xe')][_0xbb43('0x2f')](_0x368da1,_0xbb43('0x142'));}try{var _0x37b006=eval(_0x368da1['condition'])?_0xbb43('0x143'):_0xbb43('0x144');this[_0xbb43('0xe')]['noop'](util['format'](_0xbb43('0x145'),_0x368da1[_0xbb43('0x141')],_0x37b006));return{'code':0xc8,'result':_0x37b006};}catch(_0x2a8019){return{'code':0xc8,'result':_0xbb43('0x144')};}};AGIVertices['prototype'][_0xbb43('0x146')]=function(_0x330365){logger[_0xbb43('0x31')](util[_0xbb43('0x2b')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x330365['label']));if(!this['isConfigured'](_0x330365[_0xbb43('0x147')])){return this[_0xbb43('0xe')][_0xbb43('0x2f')](_0x330365,'no\x20interval\x20configured');}var _0x166274=this['getIntervals'][_0xbb43('0x72')](this,_0x330365[_0xbb43('0x147')]);if(!_0x166274){return this[_0xbb43('0xe')][_0xbb43('0x2f')](_0x330365,_0xbb43('0x148'));}for(var _0x5c41c4=0x0;_0x5c41c4<_0x166274[_0xbb43('0x9e')];_0x5c41c4+=0x1){var _0x4e2738=this['channel'][_0xbb43('0x11')](util[_0xbb43('0x2b')](_0xbb43('0x149'),_0x166274[_0x5c41c4]));if(_0x4e2738[_0xbb43('0xaa')]===-0x1){return _0x4e2738;}logger[_0xbb43('0x31')](util[_0xbb43('0x2b')](_0xbb43('0x14a'),_0x166274[_0x5c41c4],_0x4e2738[_0xbb43('0xa0')]));if(_0x4e2738['extra']===_0xbb43('0x143')){logger[_0xbb43('0x31')](util[_0xbb43('0x2b')](_0xbb43('0x14a'),_0x166274[_0x5c41c4],_0xbb43('0x143')));this[_0xbb43('0xe')][_0xbb43('0xa8')](util[_0xbb43('0x2b')](_0xbb43('0x14a'),_0x166274[_0x5c41c4],'true'));return{'code':0xc8,'result':_0xbb43('0x143')};}else{logger[_0xbb43('0x31')](util['format'](_0xbb43('0x14a'),_0x166274[_0x5c41c4],_0xbb43('0x144')));this['channel']['noop'](util[_0xbb43('0x2b')](_0xbb43('0x14a'),_0x166274[_0x5c41c4],'false'));}}return{'code':0xc8,'result':'false'};};AGIVertices['prototype'][_0xbb43('0x14b')]=function(_0x12a14e){logger[_0xbb43('0x31')](util[_0xbb43('0x2b')](_0xbb43('0x14c'),_0x12a14e[_0xbb43('0x3c')]));return this[_0xbb43('0xe')][_0xbb43('0x14b')]();};AGIVertices[_0xbb43('0x10')][_0xbb43('0x14d')]=function(_0x59c107){logger[_0xbb43('0x31')](util[_0xbb43('0x2b')](_0xbb43('0x14e'),_0x59c107[_0xbb43('0x3c')]));if(!this[_0xbb43('0x84')](_0x59c107[_0xbb43('0x81')])){return this[_0xbb43('0xe')][_0xbb43('0xa8')]('no\x20key\x20configured');}var _0x392fb1=_0xbb43('0x131');var _0x1e9c62=util[_0xbb43('0x2b')](_0xbb43('0x138'),FILES_PATH,rs['generate'](0x4));var _0x949c33=util[_0xbb43('0x2b')](_0xbb43('0x9c'),_0x1e9c62,_0x392fb1);var _0x117224=!![];if(_0x59c107[_0xbb43('0x139')]===_0xbb43('0x132')){_0x117224=![];}var _0x44fc3b=this['channel'][_0xbb43('0x133')](_0x1e9c62,_0x392fb1,_0x59c107['intKey'],_0x59c107[_0xbb43('0x67')],undefined,_0x117224);if(_0x44fc3b['result']!==-0x1){this[_0xbb43('0xe')][_0xbb43('0xa8')](util['format'](_0xbb43('0x14f'),_0x949c33));var _0x83590e=this[_0xbb43('0x83')][_0xbb43('0x72')](this,_0x59c107,_0x949c33);if(_0x83590e){for(var _0x50a6de in _0x83590e){if(_0x83590e['hasOwnProperty'](_0x50a6de)){this[_0xbb43('0xe')][_0xbb43('0xd9')](util[_0xbb43('0x2b')](_0xbb43('0x150'),_0x50a6de[_0xbb43('0x6c')]()),_0x83590e[_0x50a6de]);}}return this[_0xbb43('0xe')][_0xbb43('0xa8')](util[_0xbb43('0x2b')]('IspeechASR\x20Result\x20%s',JSON[_0xbb43('0x75')](_0x83590e)));}}return _0x44fc3b;};AGIVertices[_0xbb43('0x10')]['ispeechtts']=function(_0x3fef47){logger[_0xbb43('0x31')](util['format']('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x3fef47[_0xbb43('0x3c')]));if(!this[_0xbb43('0x84')](_0x3fef47['key'])){return this[_0xbb43('0xe')]['noop']('no\x20key\x20configured');}if(!this[_0xbb43('0x84')](_0x3fef47[_0xbb43('0x5c')])){return this['channel'][_0xbb43('0xa8')]('no\x20text\x20configured');}this[_0xbb43('0xe')][_0xbb43('0xa8')](util[_0xbb43('0x2b')](_0xbb43('0x151'),_0x3fef47['text']));var _0xe79aa3=this['ispeechTTS'][_0xbb43('0x72')](this,_0x3fef47);if(_0xe79aa3){this[_0xbb43('0xe')][_0xbb43('0xa8')](util[_0xbb43('0x2b')](_0xbb43('0x14f'),_0xe79aa3));var _0x438d82=this['channel'][_0xbb43('0xff')](_0xe79aa3,_0x3fef47[_0xbb43('0x134')]);try{fs[_0xbb43('0x125')](_0xe79aa3+_0xbb43('0x100'));}catch(_0x12abeb){logger[_0xbb43('0x2f')](_0x12abeb);}return _0x438d82;}return this[_0xbb43('0xe')][_0xbb43('0x2f')](_0x3fef47,_0xbb43('0x152'));};AGIVertices['prototype'][_0xbb43('0x153')]=function(_0x48fca2){logger[_0xbb43('0x31')](util[_0xbb43('0x2b')](_0xbb43('0x154'),_0x48fca2['label']));if(!this[_0xbb43('0x84')](_0x48fca2[_0xbb43('0x155')])){return this[_0xbb43('0xe')]['error'](_0x48fca2,_0xbb43('0x156'));}logger[_0xbb43('0x31')](util[_0xbb43('0x2b')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel'][_0xbb43('0x3f')],_0x48fca2['findBy']));var _0x5bab0b=this['agentLogin'][_0xbb43('0x72')](this,_0x48fca2[_0xbb43('0x155')]);if(_0x5bab0b){logger[_0xbb43('0x31')](util['format'](_0xbb43('0x157'),this[_0xbb43('0xe')][_0xbb43('0x3f')],_0x48fca2[_0xbb43('0x155')]));this[_0xbb43('0xe')][_0xbb43('0xa8')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0xbb43('0xe')][_0xbb43('0x3f')],_0x48fca2[_0xbb43('0x155')]));return{'code':0xc8,'result':_0xbb43('0x158')};}else{logger[_0xbb43('0x31')](util[_0xbb43('0x2b')](_0xbb43('0x159'),this[_0xbb43('0xe')][_0xbb43('0x3f')],_0x48fca2[_0xbb43('0x155')]));this[_0xbb43('0xe')][_0xbb43('0xa8')](util[_0xbb43('0x2b')](_0xbb43('0x159'),this[_0xbb43('0xe')]['callerid'],_0x48fca2[_0xbb43('0x155')]));return{'code':0xc8,'result':_0xbb43('0x15a')};}};AGIVertices[_0xbb43('0x10')][_0xbb43('0x15b')]=function(_0x443641){logger[_0xbb43('0x31')](util[_0xbb43('0x2b')](_0xbb43('0x15c'),_0x443641[_0xbb43('0x3c')]));if(!this[_0xbb43('0x84')](_0x443641[_0xbb43('0x155')])){return this['channel']['error'](_0x443641,'no\x20find\x20by\x20configured');}logger[_0xbb43('0x31')](util[_0xbb43('0x2b')](_0xbb43('0x15d'),this[_0xbb43('0xe')][_0xbb43('0x3f')],_0x443641[_0xbb43('0x155')]));var _0x4132af=this['agentLogout'][_0xbb43('0x72')](this,_0x443641[_0xbb43('0x155')]);if(_0x4132af){logger[_0xbb43('0x31')](util[_0xbb43('0x2b')](_0xbb43('0x157'),this[_0xbb43('0xe')]['callerid'],_0x443641[_0xbb43('0x155')]));this['channel'][_0xbb43('0xa8')](util[_0xbb43('0x2b')](_0xbb43('0x157'),this[_0xbb43('0xe')][_0xbb43('0x3f')],_0x443641[_0xbb43('0x155')]));return{'code':0xc8,'result':_0xbb43('0x158')};}else{logger[_0xbb43('0x31')](util[_0xbb43('0x2b')](_0xbb43('0x159'),this[_0xbb43('0xe')]['callerid'],_0x443641[_0xbb43('0x155')]));this[_0xbb43('0xe')][_0xbb43('0xa8')](util['format'](_0xbb43('0x159'),this['channel'][_0xbb43('0x3f')],_0x443641['findBy']));return{'code':0xc8,'result':_0xbb43('0x15a')};}};AGIVertices[_0xbb43('0x10')][_0xbb43('0x15e')]=function(_0x104bac){logger[_0xbb43('0x31')](util[_0xbb43('0x2b')](_0xbb43('0x15f'),_0x104bac[_0xbb43('0x3c')]));if(!this[_0xbb43('0x84')](_0x104bac[_0xbb43('0x160')])){return this['channel'][_0xbb43('0x2f')](_0x104bac,_0xbb43('0x161'));}this[_0xbb43('0xe')][_0xbb43('0xa8')](util[_0xbb43('0x2b')](_0xbb43('0x162'),_0x104bac[_0xbb43('0x160')]));var _0x37942b=eval(_0x104bac['operation']);if(!this[_0xbb43('0x84')](_0x104bac[_0xbb43('0xd4')])){return this[_0xbb43('0xe')][_0xbb43('0xa8')](_0xbb43('0xd5'));}var _0x452b96=this[_0xbb43('0x11')][_0xbb43('0x72')](this,_0x104bac[_0xbb43('0xd4')]);if(!_0x452b96){return this[_0xbb43('0xe')]['error'](_0x104bac,'no\x20variable\x20found');}if(_[_0xbb43('0x9d')](_0x37942b)){var _0x344784=this;_0x37942b[_0xbb43('0xd7')](function(_0x25b657,_0x3b7cb0){_0x344784[_0xbb43('0xe')][_0xbb43('0xd9')](util['format']('%s[%s]',_0x452b96,_0x3b7cb0),_0x25b657);});return this[_0xbb43('0xe')][_0xbb43('0xa8')](util[_0xbb43('0x2b')]('variable\x20%s[key]\x20set',_0x452b96));}else{return this[_0xbb43('0xe')][_0xbb43('0xd9')](_0x452b96,_0x37942b);}};AGIVertices[_0xbb43('0x10')][_0xbb43('0x163')]=function(_0x521fd4){logger[_0xbb43('0x31')](util[_0xbb43('0x2b')](_0xbb43('0x164'),_0x521fd4['label']));if(_0x521fd4['retry']===0x0){return this[_0xbb43('0xa4')](_0x521fd4);}_0x521fd4[_0xbb43('0xa5')]-=0x1;if(!this[_0xbb43('0x84')](_0x521fd4[_0xbb43('0x10e')])){return this['channel'][_0xbb43('0x2f')](_0x521fd4,_0xbb43('0x10f'));}var _0x2d081d=this[_0xbb43('0x20')][_0xbb43('0x72')](this,_0x521fd4[_0xbb43('0x10e')]);if(!_0x2d081d){return this[_0xbb43('0xe')][_0xbb43('0x2f')](_0x521fd4,'no\x20file\x20audio\x20found');}var _0x1fb40a=this[_0xbb43('0xe')][_0xbb43('0x111')](_0x2d081d,_0x521fd4['response'],_0x521fd4[_0xbb43('0x165')]);var _0x363993=_0x1fb40a['result'];if(_0x1fb40a[_0xbb43('0xaa')]===-0x1){this[_0xbb43('0x3a')]['sync'](this,_0x521fd4,'-1');return _0x1fb40a;}else if(_0x1fb40a[_0xbb43('0xa0')]==='timeout'){_0x1fb40a['result']=_0x1fb40a[_0xbb43('0xaa')][_0xbb43('0x9e')]>0x0?_0x1fb40a['result']:'t';}else if(_[_0xbb43('0x9b')](_0x1fb40a[_0xbb43('0xaa')])){_0x1fb40a[_0xbb43('0xaa')]='#';_0x363993='#';}if(!this[_0xbb43('0x84')](_0x521fd4[_0xbb43('0xd4')])){this[_0xbb43('0xe')][_0xbb43('0xa8')](_0xbb43('0xd5'));}else{var _0x40716b=this[_0xbb43('0x11')]['sync'](this,_0x521fd4[_0xbb43('0xd4')]);if(!_0x40716b){return this[_0xbb43('0xe')][_0xbb43('0x2f')](_0x521fd4,_0xbb43('0xd6'));}this[_0xbb43('0xe')][_0xbb43('0xd9')](_0x40716b,_0x363993);}this[_0xbb43('0x3a')]['sync'](this,_0x521fd4,_0x363993);return _0x1fb40a;};AGIVertices[_0xbb43('0x10')][_0xbb43('0xa8')]=function(_0x5cd70b){logger[_0xbb43('0x31')](util['format'](_0xbb43('0x166'),_0x5cd70b[_0xbb43('0x3c')]));return this['channel']['noop'](_0x5cd70b['output']||_0x5cd70b[_0xbb43('0x3c')]);};AGIVertices['prototype'][_0xbb43('0x167')]=function(_0x3d0046){logger[_0xbb43('0x31')](util[_0xbb43('0x2b')]('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x3d0046['label']));if(!this[_0xbb43('0x84')](_0x3d0046['findBy'])){return this[_0xbb43('0xe')][_0xbb43('0x2f')](_0x3d0046,_0xbb43('0x156'));}logger[_0xbb43('0x31')](util['format'](_0xbb43('0x15d'),this[_0xbb43('0xe')]['callerid'],_0x3d0046['findBy']));var _0x4af8b3=this[_0xbb43('0x168')][_0xbb43('0x72')](this,_0x3d0046[_0xbb43('0x169')]);var _0x5e9251=this[_0xbb43('0x50')][_0xbb43('0x72')](this,_0x3d0046[_0xbb43('0x155')],_0x4af8b3);if(_0x5e9251){logger['info'](util[_0xbb43('0x2b')](_0xbb43('0x157'),this[_0xbb43('0xe')][_0xbb43('0x3f')],_0x3d0046[_0xbb43('0x155')]));this[_0xbb43('0xe')][_0xbb43('0xa8')](util[_0xbb43('0x2b')](_0xbb43('0x157'),this[_0xbb43('0xe')][_0xbb43('0x3f')],_0x3d0046[_0xbb43('0x155')]));return{'code':0xc8,'result':_0xbb43('0x158')};}else{logger[_0xbb43('0x31')](util[_0xbb43('0x2b')](_0xbb43('0x159'),this[_0xbb43('0xe')][_0xbb43('0x3f')],_0x3d0046[_0xbb43('0x155')]));this[_0xbb43('0xe')][_0xbb43('0xa8')](util[_0xbb43('0x2b')](_0xbb43('0x157'),this[_0xbb43('0xe')]['callerid'],_0x3d0046['findBy']));return{'code':0xc8,'result':_0xbb43('0x15a')};}};AGIVertices[_0xbb43('0x10')][_0xbb43('0x16a')]=function(_0xc4731c){logger[_0xbb43('0x31')](util[_0xbb43('0x2b')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0xc4731c[_0xbb43('0x3c')]));if(!this[_0xbb43('0x84')](_0xc4731c[_0xbb43('0x10e')])){return this['channel']['error'](_0xc4731c,_0xbb43('0x10f'));}var _0x10f879=this['getSound'][_0xbb43('0x72')](this,_0xc4731c[_0xbb43('0x10e')]);if(!_0x10f879){return this[_0xbb43('0xe')][_0xbb43('0x2f')](_0xc4731c,_0xbb43('0x110'));}var _0x7c2000=this[_0xbb43('0xe')][_0xbb43('0x57')](_0xbb43('0x16b'),[_0x10f879,_0xc4731c['opts']]);if(_0x7c2000[_0xbb43('0xaa')]===-0x1){return _0x7c2000;}return this[_0xbb43('0xe')][_0xbb43('0xa8')](util[_0xbb43('0x2b')](_0xbb43('0xc1'),'PLAYBACK',_0x10f879));};AGIVertices[_0xbb43('0x10')][_0xbb43('0x16c')]=function(_0x4963ba){logger['info'](util['format'](_0xbb43('0x16d'),_0x4963ba['label']));if(!this[_0xbb43('0x84')](_0x4963ba[_0xbb43('0x16e')])){return this[_0xbb43('0xe')][_0xbb43('0x2f')](_0x4963ba,'no\x20queue\x20selected');}var _0x4735b3='';var _0x23f48a=parseInt(_0x4963ba[_0xbb43('0x16e')],0xa);if(isNaN(_0x23f48a)){_0x4735b3=_0x4963ba[_0xbb43('0x16e')];}else{_0x4735b3=this['getVoiceQueue'][_0xbb43('0x72')](this,_0x4963ba[_0xbb43('0x16e')]);if(!_0x4735b3){return this[_0xbb43('0xe')][_0xbb43('0x2f')](_0x4963ba,_0xbb43('0x16f'));}}var _0x122c0f='';if(this[_0xbb43('0x84')](_0x4963ba['file_id'])){var _0x48d336=this[_0xbb43('0x20')][_0xbb43('0x72')](this,_0x4963ba['file_id']);if(_0x48d336){_0x122c0f=_0x48d336;}}this[_0xbb43('0x3a')][_0xbb43('0x72')](this,_0x4963ba,_0x4735b3);if(_0x4963ba['opts'][_0xbb43('0x170')]('x')<0x0){_0x4963ba[_0xbb43('0xe1')]+='x';}if(_0x4963ba['opts']['indexOf']('X')<0x0){_0x4963ba[_0xbb43('0xe1')]+='X';}this[_0xbb43('0xe')][_0xbb43('0xd9')](_0xbb43('0x171'),_0x4735b3?_0x4735b3[_0xbb43('0x172')]():'');var _0x52e65d=this[_0xbb43('0xe')][_0xbb43('0x57')](_0xbb43('0x173'),[_0x4735b3,_0x4963ba['opts'],_0x4963ba[_0xbb43('0x66')],_0x122c0f,_0x4963ba[_0xbb43('0x67')],_0x4963ba['agi'],_0x4963ba[_0xbb43('0x174')],_0x4963ba[_0xbb43('0x175')],'',_0x4963ba[_0xbb43('0x176')]]);if(_0x52e65d[_0xbb43('0xaa')]===-0x1){return _0x52e65d;}return this['channel']['noop'](util[_0xbb43('0x2b')]('Executed\x20command\x20%s\x20%s',_0xbb43('0x173'),_0x4735b3));};AGIVertices[_0xbb43('0x10')][_0xbb43('0x177')]=function(_0x41c067){logger[_0xbb43('0x31')](util[_0xbb43('0x2b')]('Enter\x20in\x20RECORD\x20(%s)\x20block',_0x41c067[_0xbb43('0x3c')]));var _0x50415f=_0x41c067[_0xbb43('0x178')]||'wav';var _0x3925c5=util[_0xbb43('0x2b')](_0xbb43('0x179'),this[_0xbb43('0xe')][_0xbb43('0x3b')],rs['generate'](0x5));var _0xec5c76=util['format'](_0xbb43('0x17a'),FILES_PATH,_0x3925c5,_0x50415f);var _0xed405c=util['format']('%s/recordings/%s',FILES_PATH,_0x3925c5);this['createSquareRecording']['sync'](this,_0x41c067,_0x3925c5,_0xec5c76);this[_0xbb43('0xe')]['setVariable'](_0xbb43('0x17b'),_0x3925c5);logger[_0xbb43('0x31')]('Recording\x20%s\x20%s\x20%s\x20%s',_0xed405c,_0x50415f,_0x41c067[_0xbb43('0x17c')],_0x41c067[_0xbb43('0x67')]);return this[_0xbb43('0xe')][_0xbb43('0x133')](_0xed405c,_0x50415f,_0x41c067[_0xbb43('0x17c')],_0x41c067[_0xbb43('0x67')],undefined,!![]);};AGIVertices[_0xbb43('0x10')][_0xbb43('0x17d')]=function(_0x3940d4){logger['info'](util[_0xbb43('0x2b')](_0xbb43('0x17e'),_0x3940d4[_0xbb43('0x3c')]));if(!this[_0xbb43('0x84')](_0x3940d4[_0xbb43('0x66')])){return this['channel'][_0xbb43('0xa8')](_0xbb43('0x17f'));}var _0x804903=this[_0xbb43('0x65')]['sync'](this,_0x3940d4);logger[_0xbb43('0x31')](util[_0xbb43('0x2b')](_0xbb43('0x180'),util[_0xbb43('0x181')](_0x804903,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x3940d4[_0xbb43('0xd4')])){return this[_0xbb43('0xe')][_0xbb43('0xa8')](_0xbb43('0x182'));}var _0x4ec050=this[_0xbb43('0x11')][_0xbb43('0x72')](this,_0x3940d4[_0xbb43('0xd4')]);if(!_0x4ec050){return this[_0xbb43('0xe')][_0xbb43('0x2f')](_0x3940d4,_0xbb43('0xd6'));}this[_0xbb43('0xe')][_0xbb43('0xd9')](util[_0xbb43('0x2b')](_0xbb43('0x183'),_0x4ec050),_0x804903[_0xbb43('0x78')]?_0x804903[_0xbb43('0x78')]:'200');this[_0xbb43('0xe')][_0xbb43('0xd9')](util[_0xbb43('0x2b')](_0xbb43('0x184'),_0x4ec050),_0x804903['statusMessage']?_0x804903[_0xbb43('0x79')]:'OK');if(_0x804903['body']){try{this[_0xbb43('0x9a')](_0x804903[_0xbb43('0x76')],_0x4ec050);}catch(_0x35ffca){logger[_0xbb43('0x2f')](util[_0xbb43('0x2b')]('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x4ec050));}}return this[_0xbb43('0xe')][_0xbb43('0xa8')](util['format']('variable\x20%s\x20set',_0x4ec050));};AGIVertices['prototype']['saydigits']=function(_0x2a4f14){logger[_0xbb43('0x31')](util[_0xbb43('0x2b')](_0xbb43('0x185'),_0x2a4f14[_0xbb43('0x3c')]));return this[_0xbb43('0xe')][_0xbb43('0x186')](_0x2a4f14[_0xbb43('0x187')][_0xbb43('0x58')](/\s+/g,''),_0x2a4f14[_0xbb43('0x17c')]);};AGIVertices[_0xbb43('0x10')][_0xbb43('0x188')]=function(_0x10ae45){logger[_0xbb43('0x31')](util['format'](_0xbb43('0x189'),_0x10ae45[_0xbb43('0x3c')]));return this['channel']['sayNumber'](_0x10ae45[_0xbb43('0x68')][_0xbb43('0x58')](/\s+/g,''),_0x10ae45[_0xbb43('0x17c')]);};AGIVertices[_0xbb43('0x10')][_0xbb43('0x18a')]=function(_0x13e606){logger['info'](util[_0xbb43('0x2b')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x13e606[_0xbb43('0x3c')]));return this['channel']['sayPhonetic'](_0x13e606[_0xbb43('0x5c')],_0x13e606[_0xbb43('0x17c')]);};AGIVertices['prototype'][_0xbb43('0x18b')]=function(_0x2eb0bb){logger[_0xbb43('0x31')](util[_0xbb43('0x2b')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x2eb0bb[_0xbb43('0x3c')]));if(!this[_0xbb43('0x84')](_0x2eb0bb[_0xbb43('0x18c')])){return this[_0xbb43('0xe')]['noop'](_0xbb43('0x18d'));}var _0x5ac169=this['getMailAccount']['sync'](this,_0x2eb0bb[_0xbb43('0x18c')]);if(!_0x5ac169||!_0x5ac169[_0xbb43('0x18e')]){return this['channel']['error'](_0x2eb0bb,_0xbb43('0x18f'));}var _0x1151a7={'from':util[_0xbb43('0x2b')](_0xbb43('0x190'),_0x5ac169[_0xbb43('0x17')],_0x5ac169[_0xbb43('0x191')]||_0x5ac169[_0xbb43('0x18e')]['user']),'to':_0x2eb0bb['to']||'','cc':_0x2eb0bb['cc']||'','bcc':_0x2eb0bb[_0xbb43('0x192')]||'','subject':_0x2eb0bb[_0xbb43('0x193')],'html':_0x2eb0bb['text'],'text':_0x2eb0bb['text']};if(this[_0xbb43('0x84')](_0x2eb0bb[_0xbb43('0x194')])){}logger[_0xbb43('0xdb')](_0xbb43('0x195'),JSON[_0xbb43('0x75')](_0x1151a7));this[_0xbb43('0x3a')]['sync'](this,_0x2eb0bb,_0x2eb0bb[_0xbb43('0x18c')]);this[_0xbb43('0xe')]['noop'](util[_0xbb43('0x2b')](_0xbb43('0x196'),_0x5ac169[_0xbb43('0x17')]));this['sendMailMessage']['sync'](this,_0x5ac169[_0xbb43('0x197')],_0x1151a7);return this['channel'][_0xbb43('0xa8')](_0xbb43('0x198'));};AGIVertices[_0xbb43('0x10')][_0xbb43('0x199')]=function(_0x4b7bf2){logger[_0xbb43('0x31')](util[_0xbb43('0x2b')](_0xbb43('0x19a'),_0x4b7bf2[_0xbb43('0x3c')]));return this[_0xbb43('0xe')]['noop'](_0xbb43('0x19b'));};AGIVertices['prototype'][_0xbb43('0x19c')]=function(_0x15661c){logger[_0xbb43('0x31')](util['format']('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x15661c['label']));if(!this['isConfigured'](_0x15661c[_0xbb43('0x19d')])){return this['channel'][_0xbb43('0xa8')](_0xbb43('0x19e'));}var _0x2f082a=this[_0xbb43('0x37')]['sync'](this,_0x15661c[_0xbb43('0x19d')]);if(!_0x2f082a){return this[_0xbb43('0xe')]['error'](_0x15661c,_0xbb43('0x19f'));}var _0x58e7f6={'body':_0x15661c[_0xbb43('0x1a0')],'phone':_0x15661c['to']||'','SmsAccountId':_0x2f082a['id']};logger[_0xbb43('0xdb')](_0xbb43('0x1a1'),JSON[_0xbb43('0x75')](_0x58e7f6));this[_0xbb43('0x3a')][_0xbb43('0x72')](this,_0x15661c,_0x15661c[_0xbb43('0x19d')]);this[_0xbb43('0xe')][_0xbb43('0xa8')](util[_0xbb43('0x2b')]('Trying\x20SendSMS\x20with\x20account\x20%s',_0x2f082a['name']));this['createSmsMessage'][_0xbb43('0x72')](this,_0x58e7f6);return this[_0xbb43('0xe')][_0xbb43('0xa8')](_0xbb43('0x1a2'));};AGIVertices['prototype']['set']=function(_0x55a4b8){logger[_0xbb43('0x31')](util[_0xbb43('0x2b')](_0xbb43('0x1a3'),_0x55a4b8[_0xbb43('0x3c')]));if(!this[_0xbb43('0x84')](_0x55a4b8[_0xbb43('0xd4')])){return this[_0xbb43('0xe')]['error'](_0x55a4b8,_0xbb43('0x1a4'));}var _0x2272c4=this[_0xbb43('0x11')][_0xbb43('0x72')](this,_0x55a4b8[_0xbb43('0xd4')]);if(!_0x2272c4){return this['channel'][_0xbb43('0x2f')](_0x55a4b8,_0xbb43('0xd6'));}return this[_0xbb43('0xe')][_0xbb43('0xd9')](_0x2272c4,_0x55a4b8['variable_value']);};AGIVertices['prototype'][_0xbb43('0x1a5')]=function(_0x59c439){logger[_0xbb43('0x31')](util[_0xbb43('0x2b')](_0xbb43('0x1a6'),_0x59c439[_0xbb43('0x3c')]));this[_0xbb43('0xe')][_0xbb43('0xa8')](_0xbb43('0x1a7'));var _0x3ce048=this[_0xbb43('0xe')][_0xbb43('0x11')]('XMCS-UNIQUEID');if(!_[_0xbb43('0x9b')](_0x3ce048['extra'])){this['channel'][_0xbb43('0x3b')]=_0x3ce048[_0xbb43('0xa0')];}if(_0x59c439[_0xbb43('0xb4')]===_0xbb43('0x1a8')){this[_0xbb43('0xe')][_0xbb43('0xa8')](_0xbb43('0x1a9'));return this[_0xbb43('0xe')][_0xbb43('0xb4')]();}return this[_0xbb43('0xe')][_0xbb43('0xa8')](_0xbb43('0x1aa'));};AGIVertices[_0xbb43('0x10')][_0xbb43('0x1ab')]=function(_0x582904){logger[_0xbb43('0x31')](util[_0xbb43('0x2b')](_0xbb43('0x1ac'),_0x582904[_0xbb43('0x3c')]));if(!this['isConfigured'](_0x582904[_0xbb43('0x1ad')])){return this[_0xbb43('0xe')][_0xbb43('0x2f')](_0x582904,'no\x20subproject\x20selected');}var _0x317df7=this['getSquareProject'][_0xbb43('0x72')](this,_0x582904['project_id']);if(!this[_0xbb43('0x84')](_0x317df7)){return this[_0xbb43('0xe')][_0xbb43('0x2f')](_0x582904,util[_0xbb43('0x2b')](_0xbb43('0x1ae'),_0x582904['project_id']));}if(_0x317df7===this[_0xbb43('0xe')][_0xbb43('0x3e')]){return this[_0xbb43('0xe')][_0xbb43('0x2f')](_0x582904,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this['createSquareDetailsReport']['sync'](this,_0x582904,_0x317df7);var _0x3b066a=this['channel'][_0xbb43('0x57')](_0xbb43('0x1af'),util[_0xbb43('0x2b')](_0xbb43('0x1b0'),config[_0xbb43('0x8')]['host']||_0xbb43('0x1b1'),_0x317df7,this[_0xbb43('0xe')][_0xbb43('0x3e')]));if(_0x3b066a[_0xbb43('0xaa')]===-0x1){return _0x3b066a;}return this[_0xbb43('0xe')][_0xbb43('0xa8')](util[_0xbb43('0x2b')](_0xbb43('0xc1'),_0xbb43('0x1af'),_0x317df7));};AGIVertices[_0xbb43('0x10')][_0xbb43('0x1b2')]=function(_0x4f1ec1){logger['info'](util[_0xbb43('0x2b')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x4f1ec1[_0xbb43('0x3c')]));var _0x1fb0d0=this[_0xbb43('0x56')]['sync'](this,_0x4f1ec1[_0xbb43('0x1b3')]);this[_0xbb43('0x3a')]['sync'](this,_0x4f1ec1,_0x4f1ec1[_0xbb43('0x1b3')]);if(this['isConfigured'](_0x4f1ec1[_0xbb43('0xd4')])){var _0x1c1ac0=this[_0xbb43('0x11')]['sync'](this,_0x4f1ec1['variable_id']);if(_0x1c1ac0){this[_0xbb43('0xe')][_0xbb43('0xd9')](_0x1c1ac0,_0x1fb0d0);return this[_0xbb43('0xe')][_0xbb43('0xa8')](util['format'](_0xbb43('0x1b4'),_0x4f1ec1[_0xbb43('0x1b3')],_0x1c1ac0));}}return this[_0xbb43('0xe')][_0xbb43('0xa8')](util[_0xbb43('0x2b')](_0xbb43('0x1b5'),_0x4f1ec1[_0xbb43('0x1b3')]));};AGIVertices['prototype'][_0xbb43('0x1b6')]=function(_0x25f187){logger[_0xbb43('0x31')](util[_0xbb43('0x2b')]('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x25f187[_0xbb43('0x3c')]));_0x25f187[_0xbb43('0x5c')]=_0x25f187[_0xbb43('0x5c')][_0xbb43('0x58')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x25f187[_0xbb43('0x5a')])){return this[_0xbb43('0xe')][_0xbb43('0xa8')](_0xbb43('0x1b7'));}if(!this['isConfigured'](_0x25f187['text'])){return this[_0xbb43('0xe')][_0xbb43('0xa8')](_0xbb43('0xa9'));}this['channel']['noop'](util[_0xbb43('0x2b')]('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x25f187[_0xbb43('0x5c')]));var _0x208e92=this[_0xbb43('0x59')]['sync'](this,_0x25f187);if(_0x208e92){this[_0xbb43('0xe')][_0xbb43('0xa8')](util[_0xbb43('0x2b')](_0xbb43('0x1b8'),_0x208e92));var _0x3fe433=this['channel'][_0xbb43('0xff')](_0x208e92);try{fs[_0xbb43('0x125')](_0x208e92+_0xbb43('0x100'));}catch(_0x3b7f19){logger[_0xbb43('0x2f')](_0x3b7f19);}return _0x3fe433;}return this[_0xbb43('0xe')][_0xbb43('0x2f')](_0x25f187,_0xbb43('0x1b9'));};AGIVertices[_0xbb43('0x10')]['tts']=function(_0x35f61f){logger[_0xbb43('0x31')](util[_0xbb43('0x2b')](_0xbb43('0x1ba'),_0x35f61f[_0xbb43('0x3c')]));_0x35f61f[_0xbb43('0x5c')]=_0x35f61f['text'][_0xbb43('0x58')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xbb43('0x84')](_0x35f61f[_0xbb43('0x5c')])){return this[_0xbb43('0xe')][_0xbb43('0xa8')](_0xbb43('0xa9'));}this[_0xbb43('0xe')]['noop'](util[_0xbb43('0x2b')](_0xbb43('0x1bb'),_0x35f61f[_0xbb43('0x5c')]));var _0xf32c73=this[_0xbb43('0x63')]['sync'](this,_0x35f61f);if(_0xf32c73){this['channel'][_0xbb43('0xa8')](util[_0xbb43('0x2b')](_0xbb43('0x1bc'),_0xf32c73));var _0x1f5da3=this[_0xbb43('0xe')][_0xbb43('0xff')](_0xf32c73);try{fs[_0xbb43('0x125')](_0xf32c73+_0xbb43('0x100'));}catch(_0x28375e){logger[_0xbb43('0x2f')](_0x28375e);}return _0x1f5da3;}return this[_0xbb43('0xe')][_0xbb43('0x2f')](_0x35f61f,'Google\x20TTS\x20is\x20unreachable');};AGIVertices[_0xbb43('0x10')][_0xbb43('0x1bd')]=function(_0x20e21e){logger[_0xbb43('0x31')](util[_0xbb43('0x2b')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x20e21e['label']));if(!this[_0xbb43('0x84')](_0x20e21e[_0xbb43('0x155')])){return this[_0xbb43('0xe')][_0xbb43('0x2f')](_0x20e21e,_0xbb43('0x156'));}logger[_0xbb43('0x31')](util[_0xbb43('0x2b')](_0xbb43('0x15d'),this[_0xbb43('0xe')][_0xbb43('0x3f')],_0x20e21e[_0xbb43('0x155')]));var _0x120c29=this[_0xbb43('0x52')]['sync'](this,_0x20e21e[_0xbb43('0x155')]);if(_0x120c29){logger[_0xbb43('0x31')](util[_0xbb43('0x2b')](_0xbb43('0x157'),this[_0xbb43('0xe')][_0xbb43('0x3f')],_0x20e21e[_0xbb43('0x155')]));this[_0xbb43('0xe')][_0xbb43('0xa8')](util[_0xbb43('0x2b')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0xbb43('0x3f')],_0x20e21e['findBy']));return{'code':0xc8,'result':'success'};}else{logger[_0xbb43('0x31')](util['format'](_0xbb43('0x159'),this[_0xbb43('0xe')]['callerid'],_0x20e21e[_0xbb43('0x155')]));this[_0xbb43('0xe')][_0xbb43('0xa8')](util[_0xbb43('0x2b')](_0xbb43('0x159'),this[_0xbb43('0xe')][_0xbb43('0x3f')],_0x20e21e[_0xbb43('0x155')]));return{'code':0xc8,'result':_0xbb43('0x15a')};}};AGIVertices[_0xbb43('0x10')]['voicemail']=function(_0x292967){logger['info'](util[_0xbb43('0x2b')](_0xbb43('0x1be'),_0x292967['label']));var _0x227a3e=this[_0xbb43('0xe')][_0xbb43('0x57')](_0xbb43('0x1bf'),[_0x292967['mailbox'],_0x292967[_0xbb43('0x7b')]]);if(_0x227a3e['result']===-0x1){return _0x227a3e;}return this[_0xbb43('0xe')][_0xbb43('0xa8')](util[_0xbb43('0x2b')]('Executed\x20command\x20%s\x20%s',_0xbb43('0x1bf'),_0x292967[_0xbb43('0x1c0')]));};AGIVertices['prototype'][_0xbb43('0x1c1')]=function(_0x5a4eec){logger[_0xbb43('0x31')](util[_0xbb43('0x2b')](_0xbb43('0x1c2'),_0x5a4eec[_0xbb43('0x3c')]));if(!this[_0xbb43('0x84')](_0x5a4eec[_0xbb43('0xd4')])){return this[_0xbb43('0xe')][_0xbb43('0x2f')](_0x5a4eec,_0xbb43('0x1a4'));}var _0x47261b=this[_0xbb43('0x11')][_0xbb43('0x72')](this,_0x5a4eec[_0xbb43('0xd4')]);if(!_0x47261b){return this[_0xbb43('0xe')]['error'](_0x5a4eec,_0xbb43('0xd6'));}var _0x47c71c=this[_0xbb43('0xe')][_0xbb43('0x11')](_0x47261b);return{'code':0xc8,'result':_0x47c71c[_0xbb43('0xa0')]?_0x47c71c['extra']:'-'};};String[_0xbb43('0x10')][_0xbb43('0x1c3')]=function(_0x301594,_0x26fd6f){return this[_0xbb43('0x9f')](_0x301594)[_0xbb43('0x1c4')](_0x26fd6f);};module[_0xbb43('0x1c5')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 18cb42f..0b6ee38 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 _0x8cad=['Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','lodash','moment','../ami','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','updateAcw','timer','uniqueid','info','[%s][UPDATE][ACWTIME:%s]','catch','error','finally','startAcw','channels','queue','mandatoryDisposition','mandatoryDispositionPause','name','resolve','getAgent','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','then','acwTimeout','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','message','[%s][TIMER][STOP][AGENT:%s]','[%s][UPDATE][ERRORS:%s]','stringify','[ACW][STOP]\x20%s','interface','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','[%s][BLINDTRANSFER:UNIQUEID]','transfereruniqueid','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause','all'];(function(_0x20121f,_0x22d010){var _0x4c6f68=function(_0x2f3256){while(--_0x2f3256){_0x20121f['push'](_0x20121f['shift']());}};_0x4c6f68(++_0x22d010);}(_0x8cad,0xfe));var _0xd8ca=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x8cad[_0x173441];return _0x2423a8;};'use strict';var _=require(_0xd8ca('0x0'));var moment=require(_0xd8ca('0x1'));var ami=require(_0xd8ca('0x2'));var logger=require(_0xd8ca('0x3'))(_0xd8ca('0x4'));var RpcUser=require(_0xd8ca('0x5'));var RpcVoiceAgentReport=require(_0xd8ca('0x6'));function Acw(_0x10c3c8){this[_0xd8ca('0x7')]=_0x10c3c8[_0xd8ca('0x7')];this[_0xd8ca('0x8')]=_0x10c3c8[_0xd8ca('0x8')];this[_0xd8ca('0x9')]=_0x10c3c8[_0xd8ca('0x9')];this['channels']={};ami['on'](_0xd8ca('0xa'),this[_0xd8ca('0xb')][_0xd8ca('0xc')](this));ami['on'](_0xd8ca('0xd'),this[_0xd8ca('0xe')]['bind'](this));ami['on'](_0xd8ca('0xf'),this['syncHangup'][_0xd8ca('0xc')](this));ami['on'](_0xd8ca('0x10'),this[_0xd8ca('0x11')][_0xd8ca('0xc')](this));ami['on'](_0xd8ca('0x12'),this[_0xd8ca('0x13')]['bind'](this));ami['on'](_0xd8ca('0x14'),this[_0xd8ca('0x15')][_0xd8ca('0xc')](this));ami['on'](_0xd8ca('0x16'),this[_0xd8ca('0x17')][_0xd8ca('0xc')](this));}function getDiff(_0x3c3e3d){var _0x38f352=moment()[_0xd8ca('0x18')](0x0);var _0x52726a=moment(_0x3c3e3d)[_0xd8ca('0x18')](0x0);return _0x38f352[_0xd8ca('0x19')](_0x52726a,_0xd8ca('0x1a'));}Acw[_0xd8ca('0x1b')][_0xd8ca('0x1c')]=function(_0x177367,_0x17330a){var _0x3013f2=this;var _0x229d85=getDiff(_0x3013f2[_0xd8ca('0x9')][_0x177367]['lastPauseAt']);clearTimeout(_0x3013f2[_0xd8ca('0x9')][_0x177367][_0xd8ca('0x1d')]);_0x3013f2[_0xd8ca('0x9')][_0x177367][_0xd8ca('0x1d')]=![];return RpcVoiceAgentReport['update']({'acwtime':_0x229d85},_0x3013f2['timers'][_0x177367][_0xd8ca('0x1e')],_0x177367)['then'](function(_0x2d43dd){logger[_0xd8ca('0x1f')](_0xd8ca('0x20'),_0x17330a,_0x229d85,_0x2d43dd);})[_0xd8ca('0x21')](function(_0x3063e1){logger[_0xd8ca('0x22')]('[%s][UPDATE][ERRORS:%s]',_0x17330a,_0x3063e1);})[_0xd8ca('0x23')](function(){delete _0x3013f2[_0xd8ca('0x9')][_0x177367];});};Acw[_0xd8ca('0x1b')][_0xd8ca('0x24')]=function(_0x5d9ba3){try{var _0x23854a=this;var _0x3053f0=this[_0xd8ca('0x25')][_0x5d9ba3]['interface'];var _0x2f627e=this[_0xd8ca('0x25')][_0x5d9ba3][_0xd8ca('0x26')];var _0xbf3254=this[_0xd8ca('0x7')][_0x2f627e];var _0x2c0c9b=![];var _0x1bf1dc='ACW';if(_0xbf3254[_0xd8ca('0x27')]&&_0xbf3254[_0xd8ca('0x28')]['name']){_0x2c0c9b=!![];_0x1bf1dc=_0xbf3254[_0xd8ca('0x28')][_0xd8ca('0x29')];}if(!_0x23854a[_0xd8ca('0x8')][_0x3053f0]){return Promise[_0xd8ca('0x2a')]();}return RpcUser[_0xd8ca('0x2b')](_0x23854a[_0xd8ca('0x8')][_0x3053f0]['id'])['then'](function(_0x1a91c9){if(!_0x1a91c9||_0x1a91c9['voicePause']){logger[_0xd8ca('0x1f')](_0xd8ca('0x2c'),_0x5d9ba3,_0x3053f0,_0x2f627e);return;}logger['info']('[%s][START][AGENT:%s][QUEUE:%s]',_0x5d9ba3,_0x3053f0,_0x2f627e);var _0x1ab436=_0x23854a[_0xd8ca('0x25')][_0x5d9ba3][_0xd8ca('0x2d')]&&_0x23854a[_0xd8ca('0x25')][_0x5d9ba3][_0xd8ca('0x2e')]?_0x23854a[_0xd8ca('0x25')][_0x5d9ba3][_0xd8ca('0x2e')]:_0x5d9ba3;return RpcUser[_0xd8ca('0x2f')](_0x23854a['agents'][_0x3053f0],_0x1bf1dc,_0x1ab436);})[_0xd8ca('0x30')](function(_0x33bfe0){if(_0x2c0c9b||!_0x33bfe0){return;}_0x23854a[_0xd8ca('0x9')][_0x3053f0]={};logger['info']('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x5d9ba3,_0x23854a[_0xd8ca('0x7')][_0x2f627e][_0xd8ca('0x31')],_0x3053f0,_0x2f627e);_0x23854a[_0xd8ca('0x9')][_0x3053f0][_0xd8ca('0x1d')]=setTimeout(_0x23854a[_0xd8ca('0x32')][_0xd8ca('0xc')](_0x23854a,_0x3053f0),_0x23854a[_0xd8ca('0x7')][_0x2f627e][_0xd8ca('0x31')]*0x3e8);_0x23854a['timers'][_0x3053f0][_0xd8ca('0x33')]=moment()[_0xd8ca('0x34')](_0xd8ca('0x35'));_0x23854a[_0xd8ca('0x9')][_0x3053f0][_0xd8ca('0x1e')]=_0x5d9ba3;_0x23854a[_0xd8ca('0x9')][_0x3053f0][_0xd8ca('0x26')]=_0x2f627e;_0x23854a[_0xd8ca('0x9')][_0x3053f0]['updateAcw']=_0x23854a[_0xd8ca('0x1c')][_0xd8ca('0xc')](_0x23854a,_0x3053f0,_0x5d9ba3);})[_0xd8ca('0x21')](function(){logger['error'](_0xd8ca('0x36'),_0x5d9ba3,_0x23854a[_0xd8ca('0x7')][_0x2f627e][_0xd8ca('0x31')],_0x3053f0,_0x2f627e);})['finally'](function(){delete _0x23854a[_0xd8ca('0x25')][_0x5d9ba3];});}catch(_0x5c3543){logger[_0xd8ca('0x22')]('[ACW][START]\x20%s',_0x5c3543[_0xd8ca('0x37')]);}};Acw[_0xd8ca('0x1b')][_0xd8ca('0x32')]=function(_0x5bc412){try{var _0x924357=this;if(_0x924357[_0xd8ca('0x9')][_0x5bc412]){_0x924357['timers'][_0x5bc412][_0xd8ca('0x1d')]=![];var _0x475ee4=_0x924357['timers'][_0x5bc412][_0xd8ca('0x1e')];var _0x4203d0=_0x924357['timers'][_0x5bc412][_0xd8ca('0x26')];var _0x220468=_0x924357[_0xd8ca('0x7')][_0x4203d0]['acwTimeout'];logger['info'](_0xd8ca('0x38'),_0x475ee4,_0x5bc412);RpcUser['saveUnpause'](this[_0xd8ca('0x8')][_0x5bc412]);RpcVoiceAgentReport['update']({'acwtime':_0x220468,'agentacw':!![]},_0x475ee4,_0x5bc412)[_0xd8ca('0x30')](function(_0x344ec7){logger[_0xd8ca('0x1f')](_0xd8ca('0x20'),_0x475ee4,_0x220468,_0x344ec7);})['catch'](function(_0x2ea03c){logger[_0xd8ca('0x22')](_0xd8ca('0x39'),_0x475ee4,_0x2ea03c);});}else{logger['error']('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x5bc412);if(_0x924357[_0xd8ca('0x9')]){logger[_0xd8ca('0x1f')]('[ACW][TIMERS]',JSON[_0xd8ca('0x3a')](_0x924357[_0xd8ca('0x9')]));}}}catch(_0x43fcee){logger[_0xd8ca('0x22')](_0xd8ca('0x3b'),_0x43fcee[_0xd8ca('0x37')]);}};Acw['prototype'][_0xd8ca('0xb')]=function(_0x2d10b3){try{if(this[_0xd8ca('0x7')][_0x2d10b3[_0xd8ca('0x26')]]&&(this[_0xd8ca('0x7')][_0x2d10b3[_0xd8ca('0x26')]][_0xd8ca('0x4')]||this[_0xd8ca('0x7')][_0x2d10b3['queue']][_0xd8ca('0x27')])){if(this[_0xd8ca('0x8')][_0x2d10b3['interface']]){this['channels'][_0x2d10b3[_0xd8ca('0x1e')]]={'queue':_0x2d10b3[_0xd8ca('0x26')],'interface':_0x2d10b3[_0xd8ca('0x3c')],'destlinkedid':_0x2d10b3[_0xd8ca('0x2e')]};}}}catch(_0x2ccb5c){logger[_0xd8ca('0x22')](_0xd8ca('0x3d'),_0x2ccb5c[_0xd8ca('0x37')]);}};Acw['prototype'][_0xd8ca('0x17')]=function(_0x6255dd){try{if(this[_0xd8ca('0x7')][_0x6255dd[_0xd8ca('0x26')]]&&(this[_0xd8ca('0x7')][_0x6255dd[_0xd8ca('0x26')]][_0xd8ca('0x4')]||this[_0xd8ca('0x7')][_0x6255dd['queue']][_0xd8ca('0x27')])){if(this[_0xd8ca('0x8')][_0x6255dd['interface']]){this[_0xd8ca('0x25')][_0x6255dd[_0xd8ca('0x1e')]]={'queue':_0x6255dd[_0xd8ca('0x26')],'interface':_0x6255dd[_0xd8ca('0x3c')]};}}}catch(_0x449758){logger[_0xd8ca('0x22')](_0xd8ca('0x3e'),_0x449758[_0xd8ca('0x37')]);}};Acw['prototype'][_0xd8ca('0xe')]=function(_0x14d15d){try{if(this[_0xd8ca('0x25')][_0x14d15d['uniqueid']]&&_[_0xd8ca('0x3f')](this[_0xd8ca('0x25')][_0x14d15d[_0xd8ca('0x1e')]][_0xd8ca('0x2d')])){logger[_0xd8ca('0x1f')](_0xd8ca('0x40'),_0x14d15d[_0xd8ca('0x1e')]);this[_0xd8ca('0x24')](_0x14d15d[_0xd8ca('0x1e')]);}else if(this[_0xd8ca('0x25')][_0x14d15d[_0xd8ca('0x41')]]&&_['isUndefined'](this[_0xd8ca('0x25')][_0x14d15d[_0xd8ca('0x41')]]['attended'])){logger[_0xd8ca('0x1f')](_0xd8ca('0x42'),_0x14d15d[_0xd8ca('0x41')]);this[_0xd8ca('0x24')](_0x14d15d[_0xd8ca('0x41')]);}}catch(_0x1fa1de){logger[_0xd8ca('0x22')](_0xd8ca('0x43'),_0x1fa1de[_0xd8ca('0x37')]);}};Acw['prototype']['syncHangup']=function(_0x2b798a){try{if(this[_0xd8ca('0x25')][_0x2b798a['uniqueid']]&&this[_0xd8ca('0x25')][_0x2b798a[_0xd8ca('0x1e')]][_0xd8ca('0x2d')]){logger[_0xd8ca('0x1f')]('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x2b798a['uniqueid']);this['startAcw'](_0x2b798a[_0xd8ca('0x1e')]);}else if(this[_0xd8ca('0x25')][_0x2b798a['linkedid']]&&this[_0xd8ca('0x25')][_0x2b798a[_0xd8ca('0x41')]][_0xd8ca('0x2d')]){logger[_0xd8ca('0x1f')](_0xd8ca('0x44'),_0x2b798a[_0xd8ca('0x41')]);this[_0xd8ca('0x24')](_0x2b798a[_0xd8ca('0x41')]);}}catch(_0x430f3f){logger[_0xd8ca('0x22')](_0xd8ca('0x45'),_0x430f3f[_0xd8ca('0x37')]);}};Acw[_0xd8ca('0x1b')]['syncAttendedTransfer']=function(_0x4d668f){try{if(!_[_0xd8ca('0x46')](this[_0xd8ca('0x25')][_0x4d668f['transfereeuniqueid']])){this[_0xd8ca('0x24')](_0x4d668f[_0xd8ca('0x47')]);if(this['channels'][_0x4d668f[_0xd8ca('0x48')]]){this['channels'][_0x4d668f[_0xd8ca('0x48')]][_0xd8ca('0x2d')]=!![];this['channels'][_0x4d668f[_0xd8ca('0x49')]]=this[_0xd8ca('0x25')][_0x4d668f[_0xd8ca('0x48')]];delete this[_0xd8ca('0x25')][_0x4d668f[_0xd8ca('0x48')]];}}else if(!_[_0xd8ca('0x46')](this[_0xd8ca('0x25')][_0x4d668f[_0xd8ca('0x49')]])){this[_0xd8ca('0x24')](_0x4d668f[_0xd8ca('0x49')]);if(this[_0xd8ca('0x25')][_0x4d668f['origtransfereruniqueid']]){this[_0xd8ca('0x25')][_0x4d668f[_0xd8ca('0x4a')]][_0xd8ca('0x2d')]=!![];this[_0xd8ca('0x25')][_0x4d668f[_0xd8ca('0x47')]]=this['channels'][_0x4d668f[_0xd8ca('0x4a')]];delete this[_0xd8ca('0x25')][_0x4d668f[_0xd8ca('0x4a')]];}}}catch(_0x3608a4){logger[_0xd8ca('0x22')](_0xd8ca('0x4b'),_0x3608a4[_0xd8ca('0x37')]);}};Acw['prototype']['syncBlindTransfer']=function(_0x5f4575){try{if(this[_0xd8ca('0x25')][_0x5f4575['transfereruniqueid']]){logger['info'](_0xd8ca('0x4c'),JSON[_0xd8ca('0x3a')](_0x5f4575['transfereruniqueid']));this['startAcw'](_0x5f4575[_0xd8ca('0x4d')]);}else if(this[_0xd8ca('0x25')][_0x5f4575['transfererlinkedid']]){logger[_0xd8ca('0x1f')]('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0xd8ca('0x3a')](_0x5f4575[_0xd8ca('0x4e')]));this[_0xd8ca('0x24')](_0x5f4575[_0xd8ca('0x4e')]);}}catch(_0x3c55ec){logger[_0xd8ca('0x22')](_0xd8ca('0x4f'),_0x3c55ec[_0xd8ca('0x37')]);}};Acw[_0xd8ca('0x1b')][_0xd8ca('0x11')]=function(_0x44c07a){try{if(this[_0xd8ca('0x7')][_0x44c07a[_0xd8ca('0x26')]]&&this['voiceQueues'][_0x44c07a[_0xd8ca('0x26')]][_0xd8ca('0x50')]===_0xd8ca('0x51')){if(this[_0xd8ca('0x8')][_0x44c07a[_0xd8ca('0x3c')]]){logger[_0xd8ca('0x1f')]('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x44c07a['uniqueid'],_0x44c07a[_0xd8ca('0x3c')],_0x44c07a[_0xd8ca('0x26')]);return RpcUser[_0xd8ca('0x2f')](this['agents'][_0x44c07a['interface']],_0xd8ca('0x52'),_0x44c07a['uniqueid']);}}}catch(_0x4bd9da){logger[_0xd8ca('0x22')](_0xd8ca('0x53'),_0x4bd9da[_0xd8ca('0x37')]);}};module['exports']=Acw; \ No newline at end of file +var _0x741c=['[%s][UPDATE][ERRORS:%s]','finally','interface','ACW','mandatoryDispositionPause','name','resolve','getAgent','voicePause','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','acwTimeout','format','YYYY-MM-DD\x20HH:mm:ss','queue','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','[ACW][START]\x20%s','message','stopAcw','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','update','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','stringify','[ACW][STOP]\x20%s','mandatoryDisposition','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','startAcw','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','syncHangup','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfereruniqueid','[%s][BLINDTRANSFER:LINKEDID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','lodash','moment','../ami','../../../config/logger','acw','../rpc/user','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','hanguprequest','syncHangupRequest','hangup','agentringnoanswer','syncAgentRingNoAnswer','bind','attendedtransfer','syncAttendedTransfer','blindtransfer','syncAgentConnectPreview','milliseconds','diff','prototype','updateAcw','lastPauseAt','timer','uniqueid','then','info','[%s][UPDATE][ACWTIME:%s]','catch','error'];(function(_0x381589,_0x27a707){var _0x2a075d=function(_0x4ea19d){while(--_0x4ea19d){_0x381589['push'](_0x381589['shift']());}};_0x2a075d(++_0x27a707);}(_0x741c,0x196));var _0xc741=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x741c[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0xc741('0x0'));var moment=require(_0xc741('0x1'));var ami=require(_0xc741('0x2'));var logger=require(_0xc741('0x3'))(_0xc741('0x4'));var RpcUser=require(_0xc741('0x5'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x5cee2e){this[_0xc741('0x6')]=_0x5cee2e['voiceQueues'];this[_0xc741('0x7')]=_0x5cee2e[_0xc741('0x7')];this[_0xc741('0x8')]=_0x5cee2e[_0xc741('0x8')];this[_0xc741('0x9')]={};ami['on'](_0xc741('0xa'),this[_0xc741('0xb')]['bind'](this));ami['on'](_0xc741('0xc'),this[_0xc741('0xd')]['bind'](this));ami['on'](_0xc741('0xe'),this['syncHangup']['bind'](this));ami['on'](_0xc741('0xf'),this[_0xc741('0x10')][_0xc741('0x11')](this));ami['on'](_0xc741('0x12'),this[_0xc741('0x13')][_0xc741('0x11')](this));ami['on'](_0xc741('0x14'),this['syncBlindTransfer']['bind'](this));ami['on']('custom:agentConnectPreview',this[_0xc741('0x15')][_0xc741('0x11')](this));}function getDiff(_0x3bf1f7){var _0x17e34d=moment()[_0xc741('0x16')](0x0);var _0x584b08=moment(_0x3bf1f7)[_0xc741('0x16')](0x0);return _0x17e34d[_0xc741('0x17')](_0x584b08,'seconds');}Acw[_0xc741('0x18')][_0xc741('0x19')]=function(_0xd92df7,_0x450179){var _0x21514e=this;var _0x5bbe86=getDiff(_0x21514e['timers'][_0xd92df7][_0xc741('0x1a')]);clearTimeout(_0x21514e['timers'][_0xd92df7][_0xc741('0x1b')]);_0x21514e[_0xc741('0x8')][_0xd92df7]['timer']=![];return RpcVoiceAgentReport['update']({'acwtime':_0x5bbe86},_0x21514e[_0xc741('0x8')][_0xd92df7][_0xc741('0x1c')],_0xd92df7)[_0xc741('0x1d')](function(_0x498a5f){logger[_0xc741('0x1e')](_0xc741('0x1f'),_0x450179,_0x5bbe86,_0x498a5f);})[_0xc741('0x20')](function(_0x82ce9d){logger[_0xc741('0x21')](_0xc741('0x22'),_0x450179,_0x82ce9d);})[_0xc741('0x23')](function(){delete _0x21514e[_0xc741('0x8')][_0xd92df7];});};Acw[_0xc741('0x18')]['startAcw']=function(_0x26bf01){try{var _0x52999b=this;var _0x212c67=this['channels'][_0x26bf01][_0xc741('0x24')];var _0x3c3497=this[_0xc741('0x9')][_0x26bf01]['queue'];var _0x71c786=this['voiceQueues'][_0x3c3497];var _0x1b19c5=![];var _0x28a041=_0xc741('0x25');if(_0x71c786['mandatoryDisposition']&&_0x71c786['mandatoryDispositionPause']['name']){_0x1b19c5=!![];_0x28a041=_0x71c786[_0xc741('0x26')][_0xc741('0x27')];}if(!_0x52999b[_0xc741('0x7')][_0x212c67]){return Promise[_0xc741('0x28')]();}return RpcUser[_0xc741('0x29')](_0x52999b['agents'][_0x212c67]['id'])['then'](function(_0x183764){if(!_0x183764||_0x183764[_0xc741('0x2a')]){logger[_0xc741('0x1e')](_0xc741('0x2b'),_0x26bf01,_0x212c67,_0x3c3497);return;}logger[_0xc741('0x1e')](_0xc741('0x2c'),_0x26bf01,_0x212c67,_0x3c3497);var _0x4a4ad2=_0x52999b[_0xc741('0x9')][_0x26bf01][_0xc741('0x2d')]&&_0x52999b['channels'][_0x26bf01][_0xc741('0x2e')]?_0x52999b[_0xc741('0x9')][_0x26bf01][_0xc741('0x2e')]:_0x26bf01;return RpcUser[_0xc741('0x2f')](_0x52999b[_0xc741('0x7')][_0x212c67],_0x28a041,_0x4a4ad2);})[_0xc741('0x1d')](function(_0x3b3703){if(_0x1b19c5||!_0x3b3703){return;}_0x52999b[_0xc741('0x8')][_0x212c67]={};logger[_0xc741('0x1e')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x26bf01,_0x52999b[_0xc741('0x6')][_0x3c3497]['acwTimeout'],_0x212c67,_0x3c3497);_0x52999b[_0xc741('0x8')][_0x212c67]['timer']=setTimeout(_0x52999b['stopAcw'][_0xc741('0x11')](_0x52999b,_0x212c67),_0x52999b[_0xc741('0x6')][_0x3c3497][_0xc741('0x30')]*0x3e8);_0x52999b['timers'][_0x212c67][_0xc741('0x1a')]=moment()[_0xc741('0x31')](_0xc741('0x32'));_0x52999b['timers'][_0x212c67][_0xc741('0x1c')]=_0x26bf01;_0x52999b[_0xc741('0x8')][_0x212c67][_0xc741('0x33')]=_0x3c3497;_0x52999b[_0xc741('0x8')][_0x212c67][_0xc741('0x19')]=_0x52999b[_0xc741('0x19')][_0xc741('0x11')](_0x52999b,_0x212c67,_0x26bf01);})['catch'](function(){logger['error'](_0xc741('0x34'),_0x26bf01,_0x52999b[_0xc741('0x6')][_0x3c3497][_0xc741('0x30')],_0x212c67,_0x3c3497);})[_0xc741('0x23')](function(){delete _0x52999b[_0xc741('0x9')][_0x26bf01];});}catch(_0x36463a){logger['error'](_0xc741('0x35'),_0x36463a[_0xc741('0x36')]);}};Acw['prototype'][_0xc741('0x37')]=function(_0x9aa5c7){try{var _0x7321b9=this;if(_0x7321b9['timers'][_0x9aa5c7]){_0x7321b9[_0xc741('0x8')][_0x9aa5c7][_0xc741('0x1b')]=![];var _0x85e752=_0x7321b9[_0xc741('0x8')][_0x9aa5c7][_0xc741('0x1c')];var _0x823009=_0x7321b9[_0xc741('0x8')][_0x9aa5c7]['queue'];var _0x179105=_0x7321b9[_0xc741('0x6')][_0x823009][_0xc741('0x30')];logger[_0xc741('0x1e')](_0xc741('0x38'),_0x85e752,_0x9aa5c7);RpcUser[_0xc741('0x39')](this[_0xc741('0x7')][_0x9aa5c7]);RpcVoiceAgentReport[_0xc741('0x3a')]({'acwtime':_0x179105,'agentacw':!![]},_0x85e752,_0x9aa5c7)['then'](function(_0x3467b9){logger[_0xc741('0x1e')](_0xc741('0x1f'),_0x85e752,_0x179105,_0x3467b9);})[_0xc741('0x20')](function(_0x4e4fc2){logger[_0xc741('0x21')]('[%s][UPDATE][ERRORS:%s]',_0x85e752,_0x4e4fc2);});}else{logger[_0xc741('0x21')](_0xc741('0x3b'),_0x9aa5c7);if(_0x7321b9[_0xc741('0x8')]){logger['info']('[ACW][TIMERS]',JSON[_0xc741('0x3c')](_0x7321b9[_0xc741('0x8')]));}}}catch(_0x38087f){logger[_0xc741('0x21')](_0xc741('0x3d'),_0x38087f[_0xc741('0x36')]);}};Acw[_0xc741('0x18')][_0xc741('0xb')]=function(_0x149a5e){try{if(this[_0xc741('0x6')][_0x149a5e[_0xc741('0x33')]]&&(this[_0xc741('0x6')][_0x149a5e[_0xc741('0x33')]][_0xc741('0x4')]||this[_0xc741('0x6')][_0x149a5e[_0xc741('0x33')]][_0xc741('0x3e')])){if(this['agents'][_0x149a5e[_0xc741('0x24')]]){this['channels'][_0x149a5e[_0xc741('0x1c')]]={'queue':_0x149a5e['queue'],'interface':_0x149a5e[_0xc741('0x24')],'destlinkedid':_0x149a5e[_0xc741('0x2e')]};}}}catch(_0x4c7938){logger[_0xc741('0x21')](_0xc741('0x3f'),_0x4c7938['message']);}};Acw[_0xc741('0x18')][_0xc741('0x15')]=function(_0x3eb832){try{if(this[_0xc741('0x6')][_0x3eb832[_0xc741('0x33')]]&&(this[_0xc741('0x6')][_0x3eb832[_0xc741('0x33')]]['acw']||this[_0xc741('0x6')][_0x3eb832['queue']]['mandatoryDisposition'])){if(this[_0xc741('0x7')][_0x3eb832['interface']]){this[_0xc741('0x9')][_0x3eb832[_0xc741('0x1c')]]={'queue':_0x3eb832[_0xc741('0x33')],'interface':_0x3eb832[_0xc741('0x24')]};}}}catch(_0x4188a4){logger[_0xc741('0x21')](_0xc741('0x40'),_0x4188a4[_0xc741('0x36')]);}};Acw[_0xc741('0x18')]['syncHangupRequest']=function(_0x4fbf07){try{if(this[_0xc741('0x9')][_0x4fbf07[_0xc741('0x1c')]]&&_[_0xc741('0x41')](this[_0xc741('0x9')][_0x4fbf07['uniqueid']][_0xc741('0x2d')])){logger['info'](_0xc741('0x42'),_0x4fbf07[_0xc741('0x1c')]);this[_0xc741('0x43')](_0x4fbf07[_0xc741('0x1c')]);}else if(this[_0xc741('0x9')][_0x4fbf07[_0xc741('0x44')]]&&_[_0xc741('0x41')](this[_0xc741('0x9')][_0x4fbf07[_0xc741('0x44')]][_0xc741('0x2d')])){logger[_0xc741('0x1e')](_0xc741('0x45'),_0x4fbf07['linkedid']);this[_0xc741('0x43')](_0x4fbf07[_0xc741('0x44')]);}}catch(_0x39ca1a){logger['error'](_0xc741('0x46'),_0x39ca1a[_0xc741('0x36')]);}};Acw[_0xc741('0x18')][_0xc741('0x47')]=function(_0x4ae57c){try{if(this[_0xc741('0x9')][_0x4ae57c[_0xc741('0x1c')]]&&this[_0xc741('0x9')][_0x4ae57c[_0xc741('0x1c')]]['attended']){logger[_0xc741('0x1e')]('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x4ae57c[_0xc741('0x1c')]);this[_0xc741('0x43')](_0x4ae57c[_0xc741('0x1c')]);}else if(this[_0xc741('0x9')][_0x4ae57c[_0xc741('0x44')]]&&this[_0xc741('0x9')][_0x4ae57c['linkedid']][_0xc741('0x2d')]){logger['info'](_0xc741('0x48'),_0x4ae57c[_0xc741('0x44')]);this[_0xc741('0x43')](_0x4ae57c[_0xc741('0x44')]);}}catch(_0x168076){logger['error']('[ACW][syncHangup]\x20%s',_0x168076[_0xc741('0x36')]);}};Acw['prototype'][_0xc741('0x13')]=function(_0x3b0d28){try{if(!_[_0xc741('0x49')](this[_0xc741('0x9')][_0x3b0d28[_0xc741('0x4a')]])){this[_0xc741('0x43')](_0x3b0d28[_0xc741('0x4a')]);if(this[_0xc741('0x9')][_0x3b0d28[_0xc741('0x4b')]]){this[_0xc741('0x9')][_0x3b0d28[_0xc741('0x4b')]][_0xc741('0x2d')]=!![];this['channels'][_0x3b0d28['transfertargetuniqueid']]=this[_0xc741('0x9')][_0x3b0d28[_0xc741('0x4b')]];delete this[_0xc741('0x9')][_0x3b0d28['secondtransfereruniqueid']];}}else if(!_['isNil'](this[_0xc741('0x9')][_0x3b0d28['transfertargetuniqueid']])){this[_0xc741('0x43')](_0x3b0d28[_0xc741('0x4c')]);if(this[_0xc741('0x9')][_0x3b0d28[_0xc741('0x4d')]]){this[_0xc741('0x9')][_0x3b0d28['origtransfereruniqueid']]['attended']=!![];this[_0xc741('0x9')][_0x3b0d28[_0xc741('0x4a')]]=this['channels'][_0x3b0d28[_0xc741('0x4d')]];delete this[_0xc741('0x9')][_0x3b0d28[_0xc741('0x4d')]];}}}catch(_0x278944){logger[_0xc741('0x21')]('[ACW][syncAttendedTransfer]\x20%s',_0x278944['message']);}};Acw[_0xc741('0x18')]['syncBlindTransfer']=function(_0x360e03){try{if(this[_0xc741('0x9')][_0x360e03['transfereruniqueid']]){logger[_0xc741('0x1e')](_0xc741('0x4e'),JSON[_0xc741('0x3c')](_0x360e03[_0xc741('0x4f')]));this[_0xc741('0x43')](_0x360e03[_0xc741('0x4f')]);}else if(this[_0xc741('0x9')][_0x360e03['transfererlinkedid']]){logger[_0xc741('0x1e')](_0xc741('0x50'),JSON['stringify'](_0x360e03[_0xc741('0x51')]));this[_0xc741('0x43')](_0x360e03[_0xc741('0x51')]);}}catch(_0x5aa443){logger[_0xc741('0x21')](_0xc741('0x52'),_0x5aa443['message']);}};Acw[_0xc741('0x18')][_0xc741('0x10')]=function(_0xfa0e86){try{if(this[_0xc741('0x6')][_0xfa0e86['queue']]&&this['voiceQueues'][_0xfa0e86[_0xc741('0x33')]]['autopause']===_0xc741('0x53')){if(this[_0xc741('0x7')][_0xfa0e86[_0xc741('0x24')]]){logger[_0xc741('0x1e')](_0xc741('0x54'),_0xfa0e86[_0xc741('0x1c')],_0xfa0e86['interface'],_0xfa0e86[_0xc741('0x33')]);return RpcUser['savePause'](this[_0xc741('0x7')][_0xfa0e86[_0xc741('0x24')]],_0xc741('0x55'),_0xfa0e86[_0xc741('0x1c')]);}}}catch(_0x57ed58){logger[_0xc741('0x21')](_0xc741('0x56'),_0x57ed58[_0xc741('0x36')]);}};module[_0xc741('0x57')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index d19c787..487811f 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 _0x7ca9=['asterisk','username','password','Action','promisify','action','error','format','port','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','devicestatelist','actionSipPeerStatus','sippeerstatus','queuesummary','actionCoreShowChannels','coreshowchannels','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','info','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','then','actionDeviceStateList','[ami.js][fullybooted]','exports','asterisk-manager','util','../../config/logger','../../config/environment'];(function(_0x332170,_0xb769d0){var _0x162361=function(_0x1bfe2b){while(--_0x1bfe2b){_0x332170['push'](_0x332170['shift']());}};_0x162361(++_0xb769d0);}(_0x7ca9,0x137));var _0x97ca=function(_0x3d6030,_0x20d669){_0x3d6030=_0x3d6030-0x0;var _0xa1f111=_0x7ca9[_0x3d6030];return _0xa1f111;};'use strict';var Manager=require(_0x97ca('0x0'));var BPromise=require('bluebird');var util=require(_0x97ca('0x1'));var logger=require(_0x97ca('0x2'))('ami');var config=require(_0x97ca('0x3'));var ami=new Manager(config[_0x97ca('0x4')]['port'],config[_0x97ca('0x4')]['ip'],config[_0x97ca('0x4')][_0x97ca('0x5')],config['asterisk'][_0x97ca('0x6')],!![]);ami['keepConnected']();ami[_0x97ca('0x7')]=BPromise[_0x97ca('0x8')](ami[_0x97ca('0x9')]);function error(_0x158055){logger[_0x97ca('0xa')](util[_0x97ca('0xb')]('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config[_0x97ca('0x4')][_0x97ca('0x5')],config[_0x97ca('0x4')]['ip'],config[_0x97ca('0x4')][_0x97ca('0xc')],util[_0x97ca('0xd')](_0x158055,![],null)));}function close(){logger['error'](util[_0x97ca('0xb')](_0x97ca('0xe'),config[_0x97ca('0x4')][_0x97ca('0x5')],config['asterisk']['ip'],config[_0x97ca('0x4')]['port']));}ami[_0x97ca('0xf')]=function(){return function(){return ami[_0x97ca('0x7')]({'action':_0x97ca('0x10')});};};ami['actionDeviceStateList']=function(){return function(){return ami['Action']({'action':_0x97ca('0x11')});};};ami[_0x97ca('0x12')]=function(){return function(){return ami[_0x97ca('0x7')]({'action':_0x97ca('0x13')});};};ami['actionQueueSummary']=function(){return function(){return ami[_0x97ca('0x7')]({'action':_0x97ca('0x14')});};};ami[_0x97ca('0x15')]=function(){return function(){return ami[_0x97ca('0x7')]({'action':_0x97ca('0x16')});};};function connect(){logger['info'](util[_0x97ca('0xb')](_0x97ca('0x17'),config[_0x97ca('0x4')][_0x97ca('0x5')],config[_0x97ca('0x4')]['ip'],config[_0x97ca('0x4')][_0x97ca('0xc')]));ami[_0x97ca('0x18')](_0x97ca('0xa'),error);ami[_0x97ca('0x18')](_0x97ca('0x19'),close);}ami['on'](_0x97ca('0x1a'),connect);ami['on']('shutdown',function(_0x5c0da8){logger[_0x97ca('0x1b')](util['format'](_0x97ca('0x1c'),config[_0x97ca('0x4')][_0x97ca('0x5')],config[_0x97ca('0x4')]['ip'],config[_0x97ca('0x4')][_0x97ca('0xc')],util[_0x97ca('0xd')](_0x5c0da8,![],null)));});ami['on'](_0x97ca('0x1d'),function(){logger[_0x97ca('0x1b')](util[_0x97ca('0xb')](_0x97ca('0x1e'),config[_0x97ca('0x4')][_0x97ca('0x5')],config['asterisk']['ip'],config[_0x97ca('0x4')]['port']));return Promise['resolve']()[_0x97ca('0x1f')](ami[_0x97ca('0xf')]())[_0x97ca('0x1f')](ami[_0x97ca('0x20')]())[_0x97ca('0x1f')](ami[_0x97ca('0x12')]())['then'](ami['actionQueueSummary']())[_0x97ca('0x1f')](ami['actionCoreShowChannels']())['catch'](function(_0x40735a){logger[_0x97ca('0xa')](_0x97ca('0x21'),util[_0x97ca('0xd')](_0x40735a,{'showHidden':![],'depth':null}));});});ami['once'](_0x97ca('0xa'),error);ami[_0x97ca('0x18')](_0x97ca('0x19'),close);module[_0x97ca('0x22')]=ami; \ No newline at end of file +var _0xf57a=['keepConnected','Action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','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','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','catch','[ami.js][fullybooted]','asterisk-manager','bluebird','../../config/logger','ami','../../config/environment','port','asterisk','username','password'];(function(_0x2e125a,_0x2d26f5){var _0x181dd7=function(_0x18dff7){while(--_0x18dff7){_0x2e125a['push'](_0x2e125a['shift']());}};_0x181dd7(++_0x2d26f5);}(_0xf57a,0x11f));var _0xaf57=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0xf57a[_0x17b6e3];return _0x3906f3;};'use strict';var Manager=require(_0xaf57('0x0'));var BPromise=require(_0xaf57('0x1'));var util=require('util');var logger=require(_0xaf57('0x2'))(_0xaf57('0x3'));var config=require(_0xaf57('0x4'));var ami=new Manager(config['asterisk'][_0xaf57('0x5')],config[_0xaf57('0x6')]['ip'],config[_0xaf57('0x6')][_0xaf57('0x7')],config[_0xaf57('0x6')][_0xaf57('0x8')],!![]);ami[_0xaf57('0x9')]();ami[_0xaf57('0xa')]=BPromise['promisify'](ami['action']);function error(_0x56778a){logger[_0xaf57('0xb')](util[_0xaf57('0xc')](_0xaf57('0xd'),config[_0xaf57('0x6')][_0xaf57('0x7')],config[_0xaf57('0x6')]['ip'],config['asterisk']['port'],util[_0xaf57('0xe')](_0x56778a,![],null)));}function close(){logger[_0xaf57('0xb')](util['format'](_0xaf57('0xf'),config['asterisk'][_0xaf57('0x7')],config[_0xaf57('0x6')]['ip'],config[_0xaf57('0x6')][_0xaf57('0x5')]));}ami[_0xaf57('0x10')]=function(){return function(){return ami['Action']({'action':_0xaf57('0x11')});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0xaf57('0xa')]({'action':'devicestatelist'});};};ami[_0xaf57('0x12')]=function(){return function(){return ami[_0xaf57('0xa')]({'action':_0xaf57('0x13')});};};ami[_0xaf57('0x14')]=function(){return function(){return ami['Action']({'action':_0xaf57('0x15')});};};ami[_0xaf57('0x16')]=function(){return function(){return ami[_0xaf57('0xa')]({'action':_0xaf57('0x17')});};};function connect(){logger[_0xaf57('0x18')](util[_0xaf57('0xc')](_0xaf57('0x19'),config['asterisk']['username'],config[_0xaf57('0x6')]['ip'],config[_0xaf57('0x6')]['port']));ami[_0xaf57('0x1a')](_0xaf57('0xb'),error);ami[_0xaf57('0x1a')](_0xaf57('0x1b'),close);}ami['on'](_0xaf57('0x1c'),connect);ami['on'](_0xaf57('0x1d'),function(_0x380701){logger[_0xaf57('0x18')](util[_0xaf57('0xc')](_0xaf57('0x1e'),config[_0xaf57('0x6')][_0xaf57('0x7')],config[_0xaf57('0x6')]['ip'],config[_0xaf57('0x6')][_0xaf57('0x5')],util[_0xaf57('0xe')](_0x380701,![],null)));});ami['on'](_0xaf57('0x1f'),function(){logger['info'](util['format'](_0xaf57('0x20'),config[_0xaf57('0x6')]['username'],config[_0xaf57('0x6')]['ip'],config[_0xaf57('0x6')][_0xaf57('0x5')]));return Promise[_0xaf57('0x21')]()[_0xaf57('0x22')](ami[_0xaf57('0x10')]())['then'](ami['actionDeviceStateList']())[_0xaf57('0x22')](ami['actionSipPeerStatus']())[_0xaf57('0x22')](ami['actionQueueSummary']())[_0xaf57('0x22')](ami[_0xaf57('0x16')]())[_0xaf57('0x23')](function(_0x252ed8){logger[_0xaf57('0xb')](_0xaf57('0x24'),util[_0xaf57('0xe')](_0x252ed8,{'showHidden':![],'depth':null}));});});ami[_0xaf57('0x1a')](_0xaf57('0xb'),error);ami['once'](_0xaf57('0x1b'),close);module['exports']=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index ea9a4da..4ac8a54 100644 --- a/server/services/ami/client.js +++ b/server/services/ami/client.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb43b=['catch','exports','jayson/promise','bluebird','ami','client','http','rpc','memberReport','error','message','result'];(function(_0x272cc5,_0x2f1508){var _0x33b8f2=function(_0x45848f){while(--_0x45848f){_0x272cc5['push'](_0x272cc5['shift']());}};_0x33b8f2(++_0x2f1508);}(_0xb43b,0x1b2));var _0xbb43=function(_0xe8627,_0x493064){_0xe8627=_0xe8627-0x0;var _0x4a3bd2=_0xb43b[_0xe8627];return _0x4a3bd2;};'use strict';var jayson=require(_0xbb43('0x0'));var BPromise=require(_0xbb43('0x1'));var logger=require('../../config/logger')(_0xbb43('0x2'));var client=jayson[_0xbb43('0x3')][_0xbb43('0x4')]({'port':0x2329});client['Request']=function(_0x131e9e,_0x41aff6){return new BPromise(function(_0x351254,_0x16432a){return client['request'](_0x131e9e,_0x41aff6)['then'](function(_0x378df5){logger['debug'](_0xbb43('0x5'),_0xbb43('0x6'),_0x131e9e,_0x41aff6,_0x378df5);if(_0x378df5[_0xbb43('0x7')]){logger[_0xbb43('0x7')](_0xbb43('0x5'),'memberReport',_0x131e9e,_0x378df5[_0xbb43('0x7')][_0xbb43('0x8')],_0x41aff6);return _0x16432a(_0x378df5['error'][_0xbb43('0x8')]);}else{return _0x351254(_0x378df5[_0xbb43('0x9')]);}})[_0xbb43('0xa')](function(_0x5e3611){logger[_0xbb43('0x7')](_0xbb43('0x5'),'memberReport',_0x131e9e,_0x5e3611,_0x41aff6);return _0x16432a(_0x5e3611);});});};module[_0xbb43('0xb')]=client; \ No newline at end of file +var _0x70e0=['catch','exports','jayson/promise','bluebird','../../config/logger','http','Request','then','memberReport','error','rpc','message','result'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x70e0,0x17b));var _0x070e=function(_0x50a4e4,_0x57e26a){_0x50a4e4=_0x50a4e4-0x0;var _0x18c58b=_0x70e0[_0x50a4e4];return _0x18c58b;};'use strict';var jayson=require(_0x070e('0x0'));var BPromise=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('ami');var client=jayson['client'][_0x070e('0x3')]({'port':0x2329});client[_0x070e('0x4')]=function(_0x277d32,_0x2593e5){return new BPromise(function(_0x5c90fc,_0x7bce9b){return client['request'](_0x277d32,_0x2593e5)[_0x070e('0x5')](function(_0x4b041d){logger['debug']('rpc',_0x070e('0x6'),_0x277d32,_0x2593e5,_0x4b041d);if(_0x4b041d[_0x070e('0x7')]){logger[_0x070e('0x7')](_0x070e('0x8'),_0x070e('0x6'),_0x277d32,_0x4b041d[_0x070e('0x7')][_0x070e('0x9')],_0x2593e5);return _0x7bce9b(_0x4b041d['error']['message']);}else{return _0x5c90fc(_0x4b041d[_0x070e('0xa')]);}})[_0x070e('0xb')](function(_0x12bb37){logger[_0x070e('0x7')](_0x070e('0x8'),_0x070e('0x6'),_0x277d32,_0x12bb37,_0x2593e5);return _0x7bce9b(_0x12bb37);});});};module[_0x070e('0xc')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index c3528f7..8b3f269 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 _0x271a=['dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAbandonedMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','entity\x20is\x20undefine','evt\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','buildNoAnswerEventPayload','custom:agentnoanswer','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','congestion','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','outboundRejectCallsDay','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','talking','floor','erlangCalls','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','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','avgHandleTime','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','loggedIn','[CatchErlangB]','milliseconds','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','actionOriginate','dialRecallMeTimeout','voicePause','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','QUEUE_RECALL','RECALL_TIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','limitCalls','checkContactEmpty','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','checkIsBlackListIvr','[actionOriginateIvr]\x20','dialLimitQueue','pTalking','not_inuse','getContactDialer','countReScheduled','[countReScheduled]\x20','checkIsBlackList','tryOriginatePredictive','dialOrderByScheduledAt','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','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','erlangb','----\x20Agent\x20Busy\x20Factor\x20----','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','[busyFactor]','Umin\x20=\x20','exports','util','lodash','uuid','moment','./utils','../preview/util/util','../../../config/environment/','../../../config/logger','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/voiceQueueRt','../rpc/interval','./models/action','./models/history','./models/agentComplete','./models/queueCallerAbandon','env','XCALLY_IP_AGI','127.0.0.1','prototype','tail','finally','preview','voiceQueues','agents','trunks','maxNumberOriginate','actions','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','queuesSummary','agentconnect','syncAgentConnect','bind','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','syncQueueSummaryComplete','hangup','newexten','syncNewExten','varset','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','getSettings','then','isUndefined','type','outbound','debug','inspect','format','name','voice_queue:save','isEmpty','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','predictiveIntervalTotalCalls','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','erlangBusyFactor','merge','getSeconds','startProgressive\x20value\x20cleared','startPredictive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','checkContactLowerLimitOriginate','temp','message','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','contactsRescheduled','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','state','endtime','starttime','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','pick','Interval','NULL_INTERVAL','Intervals','\x20INTERVAL_IS_NULL','isIVRCampaignActive','INACTIVE','isIVRCampaign','campaign:ivr:%s','campaign:save','sendMessageOneNotActive','is\x20not\x20active','DISACTIVED','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20disactive','Error','isTrunkReachable','active','SIP/%s','status','reachable','unmonitored','checkIsTrunkReachable','TrunkBackup','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTimeIvr','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','ifTime','\x20Intervals\x20is\x20empty\x20','timezones','UNKNOWN_TIMEZONE','\x20Timezone\x20unknow\x20','isArray','push','Action','command','iftime\x20%s,%s','content','indexOf','true','catch','all','some','OVERTIME_INTERVAL','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','stringify','resetActiveCalls','syncCampaigns','undefined','campaigns','resolve','dialTimezone','launchHandleIvr','[syncCampaigns]','checkDialMethod','dialMethod','handlePower','dialPowerLevel','booked','Queue','method\x20not\x20recognized','dialGlobalInterval','silly','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','intervalIftime','OVERTIME_GLOBAL_INTERVAL','Timezone:\x20','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','AMI\x20IfTime','queue','uniqueid','ivr','updateOriginated','answertime','YYYY-MM-DD\x20HH:mm:ss','outboundAnswerCallsDay','reason','agiafterat','dialQueueProject2','createHistory','[syncAgentComplete][createHistory]','moveContactManagedDialer','[syncAgentComplete]','droptime','responsetime','predictiveIntervalDroppedCallsTimeout','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','statedesc','TIMEOUT','countdropretry','countglobal','callAdditionalPhoneAfterMin','verifyAdditionalPhones','dialDropMaxRetry','queueCallerAbandonCreateState','additional','rescheduleContact','dialDropRetryFrequency','minutes','ContactId','ListId','CampaignId','[rescheduleContact][Drop]','Drop','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','outboundDropCallsDayCallersExit','Abandoned','dropreason','countabandonedretry','dialAbandonedRetryFrequency','voiceQueue','add','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','swapAdditionalPhones','channel','actionid','strategy','rrmemory','roundrobin','isNil','locked','paused','stateinterface','idHopper','run','[Catch][Preview][syncQueueStatusComplete]','VoiceQueueId','_rr','length','unlockRR','contactAgent-idHopper:\x20','[booked][RR][finaly]','Agent:\x20','[booked][unlock]','[unlock][syncQueueStatusComplete]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','getQueue','response','Success','callProgressDetecting','[callProgressDetecting]\x20','syncVarSet','variable','amdstatus','value','HANGUP','membername','AMD','emit','buildObj','amd','[syncHangupInAMD]','dialAMDActive','MACHINE','outboundAnswerAgiCallsDay','Machine','countmachineretry','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnosuchnumberretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','custom:amd','saveInDb','[syncHangupInAMDIvr][createHistory]','countnoanswerretry','syncHangup','ivrAnswerCallsDay','[syncHangupIvr]','AnswerAGI','AGI','[syncHangupIvr][createHistory]','outboundUnknownCallsDay','cause-txt','Unknow','running','isPreviewCampaign','statusMessage','getQueueCampaignStatusMessage','available','inUse','ACTIVE','[syncQueueSummary]','compareToOutboundQueue','queueSummaryCountersUpdated','updateReportFromOutboundQueue','assign','throttle','filter','dialPreviewRecallmeReminder','online','map','Agent','user:%s','user:dialPreviewRecallReminder','checkPreviewRecallReminder','clearZombieChannels','[uniqueid]','[actions]','sequence','enqueue','No\x20such\x20channel','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','UserId','[emptyContact][createHistory]','[emptyContact]','[syncQueueCallerAbandon]\x20[Drop]','handlePreviewRecallNotifications','handleIvr','object','originate','phone','contact\x20is\x20undefine','getCaller','dialQueueProject','NONE','\x22agi://%s/square,%s\x22','isOutboundQueue','\x22%s,%s%s,,,%s\x22','dialQueueTimeout','dialer','xcally-motion-dialer','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','setXMDContactVariables','Contact','Trunk','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','XMD-ORIGINATECALLERIDNUM','variables','SIP/%s/%s%s','dialPrefix','substring','dialCutDigit','dialOriginateTimeout','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','checkRetriveMax','dialNoAnswerMaxRetry'];(function(_0x8ba957,_0x314734){var _0x271c2e=function(_0x297878){while(--_0x297878){_0x8ba957['push'](_0x8ba957['shift']());}};_0x271c2e(++_0x314734);}(_0x271a,0x8f));var _0xa271=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x271a[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xa271('0x0'));var _=require(_0xa271('0x1'));var uuid=require(_0xa271('0x2'));var moment=require(_0xa271('0x3'));var rr=require('rr');var Redis=require('ioredis');var utils=require(_0xa271('0x4'));var hopperUtils=require('./utils/hopper');var ut=require(_0xa271('0x5'));var config=require(_0xa271('0x6'));var logger=require(_0xa271('0x7'))('dialer');var loggerBooked=require(_0xa271('0x7'))('booked');var loggerPredictive=require(_0xa271('0x7'))(_0xa271('0x8'));var loggerPredictiveCalls=require(_0xa271('0x7'))(_0xa271('0x9'));var loggerSyncQueueSummary=require('../../../config/logger')(_0xa271('0xa'));var ami=require(_0xa271('0xb'));config[_0xa271('0xc')]=_[_0xa271('0xd')](config[_0xa271('0xc')],{'host':_0xa271('0xe'),'port':0x18eb});var io=require(_0xa271('0xf'))(new Redis(config[_0xa271('0xc')]));var cmHopper=require(_0xa271('0x10'));var voiceQueueRt=require(_0xa271('0x11'));var RpcSetting=require('../rpc/setting');var Interval=require(_0xa271('0x12'));var Action=require(_0xa271('0x13'));var History=require(_0xa271('0x14'));var Final=require('./models/final');var AgentComplete=require(_0xa271('0x15'));var QueueCallerAbandon=require(_0xa271('0x16'));var Hangup=require('./models/hangup');var ipAgi=process[_0xa271('0x17')][_0xa271('0x18')]||_0xa271('0x19');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0xa271('0x1a')]['enqueue']=function(_0x4dcbe1){this[_0xa271('0x1b')]=this[_0xa271('0x1b')]?this[_0xa271('0x1b')][_0xa271('0x1c')](_0x4dcbe1):_0x4dcbe1();};function Dialer(_0x6493a4,_0x2bf6fe){this['sequence']=new Sequence();this[_0xa271('0x1d')]=_0x2bf6fe;this[_0xa271('0x1e')]=_0x6493a4[_0xa271('0x1e')];this['campaigns']=_0x6493a4['campaigns'];this[_0xa271('0x1f')]=_0x6493a4['agents'];this['trunks']=_0x6493a4[_0xa271('0x20')];this[_0xa271('0x21')]=config['maxNumberOriginate']||0x2;this['channels']={};this[_0xa271('0x22')]={};this[_0xa271('0x23')]={};this[_0xa271('0x24')]={};this[_0xa271('0x25')]={};this[_0xa271('0x26')]={};this[_0xa271('0x27')]={};this[_0xa271('0x28')]={};this[_0xa271('0x29')]={};this[_0xa271('0x2a')]={};this[_0xa271('0x2b')]={};ami['on'](_0xa271('0x2c'),this[_0xa271('0x2d')][_0xa271('0x2e')](this));ami['on']('queuecallerabandon',this[_0xa271('0x2f')][_0xa271('0x2e')](this));ami['on'](_0xa271('0x30'),this[_0xa271('0x31')][_0xa271('0x2e')](this));ami['on'](_0xa271('0x32'),this[_0xa271('0x33')]['bind'](this));ami['on'](_0xa271('0x34'),this[_0xa271('0xa')][_0xa271('0x2e')](this));ami['on']('custom:queuesummarycomplete',this[_0xa271('0x35')][_0xa271('0x2e')](this));ami['on'](_0xa271('0x36'),this['syncHangup'][_0xa271('0x2e')](this));ami['on'](_0xa271('0x37'),this[_0xa271('0x38')][_0xa271('0x2e')](this));ami['on'](_0xa271('0x39'),this['syncVarSet']['bind'](this));ami['on']('queuemember',this[_0xa271('0x3a')][_0xa271('0x2e')](this));ami['on'](_0xa271('0x3b'),this[_0xa271('0x3c')]['bind'](this));this[_0xa271('0x3d')]();this[_0xa271('0x3e')]();RpcSetting[_0xa271('0x3f')]()[_0xa271('0x40')](function(_0x2d50f3){previewRecallmeReminderInterval=_0x2d50f3['previewRecallmeReminderInterval'];});}function isNotNull(_0x100bd7){return _0x100bd7!==null&&!_[_0xa271('0x41')](_0x100bd7);}function msgResponse(_0x153061,_0x3f2040,_0x4eaab2){return{'action':_0x153061,'response':_0x3f2040,'message':_0x4eaab2,'stack':_0x4eaab2};}function emit(_0x20d860,_0x2a4608,_0x46d60b){io['to'](_0x20d860)['emit'](_0x2a4608,_0x46d60b);}function emitOutboundVoiceQueueSummary(_0x54da55){if(_0x54da55[_0xa271('0x42')]===_0xa271('0x43')){logger[_0xa271('0x44')]('[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:',util[_0xa271('0x45')](_0x54da55,{'showHidden':![],'depth':null}));emit(util[_0xa271('0x46')]('voice:queue:%s',_0x54da55[_0xa271('0x47')]),_0xa271('0x48'),_0x54da55);}}function checkGetDataPredictive(_0x3590f1){if(isNotNull(_0x3590f1)&&!_[_0xa271('0x49')](_0x3590f1)){loggerPredictive[_0xa271('0x4a')](_0xa271('0x4b'));loggerPredictive['info'](_0xa271('0x4c'),_0x3590f1['predictiveIntervalTotalCalls']);loggerPredictive[_0xa271('0x4a')]('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3590f1[_0xa271('0x4d')]);loggerPredictive[_0xa271('0x4a')](_0xa271('0x4e'),_0x3590f1['predictiveIntervalDroppedCallsTimeout']);loggerPredictive[_0xa271('0x4a')](_0xa271('0x4f'),_0x3590f1[_0xa271('0x50')]);loggerPredictive[_0xa271('0x4a')](_0xa271('0x51'),_0x3590f1[_0xa271('0x52')]);loggerPredictive[_0xa271('0x4a')](_0xa271('0x53'),_0x3590f1[_0xa271('0x54')]);loggerPredictive[_0xa271('0x4a')](_0xa271('0x55'));if(_0x3590f1[_0xa271('0x56')]>0x0){if(!_[_0xa271('0x41')](_0x3590f1['predictiveIntervalAvgTalktime'])&&_0x3590f1[_0xa271('0x54')]>0x0){return!![];}loggerPredictive[_0xa271('0x4a')](_0xa271('0x57'));if(!_[_0xa271('0x41')](_0x3590f1['predictiveIntervalAvgHoldtime'])&&_0x3590f1['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive[_0xa271('0x4a')](_0xa271('0x58'));}else{loggerPredictive[_0xa271('0x4a')]('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive['info'](_0xa271('0x59'));}return![];}function mergeDataErlangB(_0x24b74f){return function(_0x2a4682){loggerPredictive[_0xa271('0x4a')](_0xa271('0x5a'));loggerPredictive['info'](_0xa271('0x5b'),_0x2a4682['erlangCalls']);loggerPredictive[_0xa271('0x4a')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2a4682[_0xa271('0x5c')]);loggerPredictive[_0xa271('0x4a')](_0xa271('0x5d'),_0x2a4682[_0xa271('0x5e')]);loggerPredictive[_0xa271('0x4a')]('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2a4682[_0xa271('0x5f')]);loggerPredictive[_0xa271('0x4a')](_0xa271('0x5d'),_0x2a4682[_0xa271('0x5e')]);loggerPredictive[_0xa271('0x4a')](_0xa271('0x55'));_[_0xa271('0x60')](_0x24b74f,_0x2a4682);};}function ifInterval(_0xd3e5fa,_0x37b922){if(_[_0xa271('0x41')](_0x37b922)){return![];}return utils[_0xa271('0x61')](undefined,_0x37b922)<_0xd3e5fa*0x3c;}function clearPredictiveAttributes(_0x4ea5db){if(_0x4ea5db[_0xa271('0x27')]){_0x4ea5db[_0xa271('0x27')]=undefined;loggerPredictive[_0xa271('0x44')](_0x4ea5db['name'],_0xa271('0x62'));}if(_0x4ea5db['startPredictive']){_0x4ea5db[_0xa271('0x26')]=undefined;loggerPredictive[_0xa271('0x44')](_0x4ea5db['name'],_0xa271('0x63'));}if(_0x4ea5db[_0xa271('0x64')]){clearInterval(_0x4ea5db[_0xa271('0x64')]);_0x4ea5db[_0xa271('0x64')]=undefined;loggerPredictive[_0xa271('0x44')](_0x4ea5db[_0xa271('0x47')],_0xa271('0x65'));}}function loggerCatchPredictive(_0x2373bd,_0x3073a3){return function(_0x391c11){loggerPredictive[_0xa271('0x66')](_0x3073a3[_0xa271('0x47')],_0x2373bd);loggerPredictive['error'](_0x391c11['stack']);clearPredictiveAttributes(_0x3073a3);};}function loggerCatch(_0x7ba02b){return function(_0x54dfff){logger[_0xa271('0x66')](_0x7ba02b,util[_0xa271('0x45')](_0x54dfff,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x4af10d,_0x5d2070,_0x548d12){return function(_0xe25c77){utils[_0xa271('0x67')](_0x5d2070,_0x548d12,0x0);_0x5d2070[_0xa271('0x68')]=0x0;logger[_0xa271('0x66')](_0x4af10d,util[_0xa271('0x45')](_0xe25c77,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x51008e){return function(_0x21a37e){if(isNotNull(_0x21a37e)&&isNotNull(_0x21a37e[0x0])){if(_0x21a37e[0x0]['contactsRescheduled']>0x0){_0x51008e[_0xa271('0x69')]=utils[_0xa271('0x6a')][_0xa271('0x6b')];logger[_0xa271('0x4a')]('[getContactDialer2][ReScheduled]'+_0x51008e[_0xa271('0x47')],_0x21a37e[0x0][_0xa271('0x6c')],'contacts');}else{_0x51008e[_0xa271('0x69')]=utils[_0xa271('0x6a')][_0xa271('0x6d')];logger[_0xa271('0x4a')](_0xa271('0x6e')+_0x51008e[_0xa271('0x47')]);}}};}function createObjHistory(_0x2c4a74,_0x8a19f9,_0x443883,_0x4f398f,_0x5a4cbe){_0x2c4a74[_0xa271('0x69')]=_0x443883;var _0x11d85d=new Action(_0x2c4a74,_0x8a19f9);var _0x421334=new History(_0x11d85d);_0x421334[_0xa271('0x6f')]=_0x4f398f;_0x421334['statedesc']=_0x5a4cbe;_0x421334[_0xa271('0x70')]=_0x11d85d[_0xa271('0x71')];return _0x421334;}function unlockQueueStatus(_0x53ac96,_0x2058a5){setTimeout(function(){if(_['isUndefined'](_0x53ac96[_0xa271('0x72')])){loggerBooked['error'](_0xa271('0x73'),_0x2058a5);}_0x53ac96[_0xa271('0x72')]=!![];loggerBooked[_0xa271('0x4a')](_0xa271('0x74'),_0x2058a5,JSON['stringify'](_[_0xa271('0x75')](_0x53ac96,[_0xa271('0x47'),_0xa271('0x72')])));},0x1f3);}function checkInterval(_0x3a6964){return function(){if(!isNotNull(_0x3a6964[_0xa271('0x76')])){_0x3a6964[_0xa271('0x69')]=utils[_0xa271('0x6a')][_0xa271('0x77')];throw _0x3a6964[_0xa271('0x47')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x3a6964[_0xa271('0x76')][_0xa271('0x78')])){_0x3a6964['message']=utils[_0xa271('0x6a')][_0xa271('0x77')];throw _0x3a6964[_0xa271('0x47')]+_0xa271('0x79');}if(!isNotNull(_['isEmpty'](_0x3a6964['Interval'][_0xa271('0x78')]))){_0x3a6964[_0xa271('0x69')]=utils[_0xa271('0x6a')][_0xa271('0x77')];throw _0x3a6964[_0xa271('0x47')]+_0xa271('0x79');}};}function checkIsIVRCampaignActive(_0xc17371){return function(){if(!utils[_0xa271('0x7a')](_0xc17371)){_0xc17371[_0xa271('0x69')]=utils['CAMPAIGN_STATUS'][_0xa271('0x7b')];throw _0xc17371[_0xa271('0x47')]+'\x20NOT\x20Active';}};}function emitCampaignSummary(_0x4f58d0){if(utils[_0xa271('0x7c')](_0x4f58d0)){emit(util['format'](_0xa271('0x7d'),_0x4f58d0['name']),_0xa271('0x7e'),_0x4f58d0);}}function loggerCatchQueueSummary(_0x49322,_0x55938f){return function(_0x156e35){clearPredictiveAttributes(_0x55938f);emitCampaignSummary(_0x55938f);loggerSyncQueueSummary[_0xa271('0x44')](_0x49322,util[_0xa271('0x45')](_0x156e35,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x2697bd){if(_0x2697bd[_0xa271('0x7f')]){if(_0x2697bd['originated']===0x0){_0x2697bd['sendMessageOneNotActive']=![];_0x2697bd[_0xa271('0x69')]=utils['CAMPAIGN_STATUS'][_0xa271('0x7b')];loggerSyncQueueSummary[_0xa271('0x44')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x2697bd['name'],_0xa271('0x80'));}else{_0x2697bd[_0xa271('0x69')]=utils[_0xa271('0x6a')][_0xa271('0x81')];loggerSyncQueueSummary[_0xa271('0x44')](_0xa271('0x82'),_0x2697bd[_0xa271('0x47')],_0xa271('0x83'));}emitCampaignSummary(_0x2697bd);}}function myreject(_0x492c61){return function(_0x55e2a0){return _0x492c61(msgResponse('[ifTime][Action]',_0xa271('0x84'),JSON['stringify'](_0x55e2a0)));};}Dialer['prototype'][_0xa271('0x85')]=function(_0x1d81fe){return!_[_0xa271('0x41')](_0x1d81fe)&&_0x1d81fe&&!_[_0xa271('0x41')](_0x1d81fe[_0xa271('0x47')])&&!_[_0xa271('0x41')](_0x1d81fe[_0xa271('0x86')])&&_0x1d81fe['active']&&(this[_0xa271('0x20')][util[_0xa271('0x46')](_0xa271('0x87'),_0x1d81fe[_0xa271('0x47')])][_0xa271('0x88')]===_0xa271('0x89')||this[_0xa271('0x20')][util[_0xa271('0x46')](_0xa271('0x87'),_0x1d81fe[_0xa271('0x47')])][_0xa271('0x88')]===_0xa271('0x8a'));};Dialer[_0xa271('0x1a')][_0xa271('0x8b')]=function(_0x1531ab){var _0x5d04b9=this;return function(){if(!_0x5d04b9['isTrunkReachable'](_0x1531ab['Trunk'])){if(!_0x5d04b9[_0xa271('0x85')](_0x1531ab[_0xa271('0x8c')])){_0x1531ab[_0xa271('0x69')]=utils[_0xa271('0x6a')][_0xa271('0x8d')];throw _0x1531ab['name']+_0xa271('0x8e');}}};};Dialer[_0xa271('0x1a')][_0xa271('0x8f')]=function(_0x1ad387,_0x252d97,_0x248653,_0x4ac45f){var _0x1ecf56=this;return function(){var _0x2147c8=!![];return _0x1ecf56[_0xa271('0x90')](_0x1ad387,_0x252d97,_0x248653,_0x4ac45f,_0x2147c8);};};Dialer[_0xa271('0x1a')][_0xa271('0x91')]=function(_0x15926f,_0x35411c,_0x374b89,_0x35d2b6){var _0x2cdc50=this;return function(){var _0x5bbd46=![];return _0x2cdc50[_0xa271('0x90')](_0x15926f[_0xa271('0x78')],_0x35411c,_0x374b89,_0x35d2b6,_0x5bbd46);};};Dialer['prototype'][_0xa271('0x90')]=function(_0x16cd4b,_0x1279a1,_0x3efc8c,_0x29bf5d,_0xdd95c7){var _0x43107c=[];return new Promise(function(_0x46bf71,_0x18f833){if(!isNotNull(_0x16cd4b)){_0x29bf5d[_0xa271('0x69')]=utils[_0xa271('0x6a')][_0xa271('0x77')];return _0x18f833(msgResponse('ifTime',_0xa271('0x92'),_0x3efc8c+_0xa271('0x93')));}if(_['isEmpty'](_0x16cd4b)){_0x29bf5d[_0xa271('0x69')]=utils[_0xa271('0x6a')]['EMPTY_INTERVAL'];return _0x18f833(msgResponse(_0xa271('0x94'),_0xa271('0x92'),_0x3efc8c+_0xa271('0x95')));}if(_0x1279a1&&_[_0xa271('0x41')](config[_0xa271('0x96')][_0x1279a1])){_0x29bf5d[_0xa271('0x69')]=utils['CAMPAIGN_STATUS'][_0xa271('0x97')];return _0x18f833(msgResponse(_0xa271('0x94'),_0xa271('0x92'),_0x3efc8c+_0xa271('0x98')+_0x1279a1));}if(_[_0xa271('0x99')](_0x16cd4b)){for(var _0x56b5e6=0x0;_0x56b5e6<_0x16cd4b['length'];_0x56b5e6+=0x1){_0x43107c[_0xa271('0x9a')](ami[_0xa271('0x9b')]({'action':_0xa271('0x9c'),'command':util[_0xa271('0x46')](_0xa271('0x9d'),_0x16cd4b[_0x56b5e6]['interval'],!_[_0xa271('0x41')](config['timezones'][_0x1279a1])?_0x1279a1:'')})[_0xa271('0x40')](function(_0x2b3777){return _0x2b3777[_0xa271('0x9e')][_0xa271('0x9f')](_0xa271('0xa0'))>=0x0;})[_0xa271('0xa1')](myreject(_0x18f833)));}}else{_0x43107c['push'](ami[_0xa271('0x9b')]({'action':_0xa271('0x9c'),'command':util[_0xa271('0x46')](_0xa271('0x9d'),_0x16cd4b,!_[_0xa271('0x41')](config[_0xa271('0x96')][_0x1279a1])?_0x1279a1:'')})[_0xa271('0x40')](function(_0x5b7590){return _0x5b7590[_0xa271('0x9e')][_0xa271('0x9f')]('true')>=0x0;})[_0xa271('0xa1')](myreject(_0x18f833)));}Promise[_0xa271('0xa2')](_0x43107c)[_0xa271('0x40')](function(_0x1690ba){var _0x3fb233=_[_0xa271('0xa3')](_0x1690ba);if(_0x3fb233){return _0x46bf71(_0x3fb233);}else{_0x29bf5d[_0xa271('0x69')]=_0xdd95c7?utils['CAMPAIGN_STATUS']['OVERTIME_GLOBAL_INTERVAL']:utils[_0xa271('0x6a')][_0xa271('0xa4')];return _0x18f833(msgResponse(_0xa271('0xa5'),'Failure',_0xa271('0xa6')+_0xdd95c7+'\x20'+_0x3efc8c+_0xa271('0xa7')+util['inspect'](_0x16cd4b,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x1279a1));}})[_0xa271('0xa1')](function(_0x360f16){return _0x18f833(msgResponse('ifTime',_0xa271('0x92'),JSON[_0xa271('0xa8')](_0x360f16)));});});};Dialer[_0xa271('0x1a')][_0xa271('0x3d')]=function(){var _0x560f19=this;return cmHopper[_0xa271('0xa9')]({'active':![]},{'where':{'active':!![]}})[_0xa271('0x40')](function(){setInterval(function(){_0x560f19[_0xa271('0xaa')]();},0x3e8);});};Dialer['prototype'][_0xa271('0xaa')]=function(){var _0x207e7a=this;var _0x31fad8;for(var _0x38143a in this['campaigns']){if(typeof this['campaigns'][_0x38143a]!==_0xa271('0xab')){_0x31fad8=this[_0xa271('0xac')][_0x38143a];if(utils[_0xa271('0x7c')](_0x31fad8)&&utils[_0xa271('0x7a')](_0x31fad8)){_0x31fad8[_0xa271('0x7f')]=!![];Promise[_0xa271('0xad')]()[_0xa271('0x40')](checkIsIVRCampaignActive(_0x31fad8))[_0xa271('0x40')](checkInterval(_0x31fad8))[_0xa271('0x40')](_0x207e7a[_0xa271('0x8b')](_0x31fad8))[_0xa271('0x40')](_0x207e7a[_0xa271('0x8f')](_0x31fad8['dialGlobalInterval'],_0x31fad8[_0xa271('0xae')],_0x31fad8[_0xa271('0x47')],_0x31fad8))[_0xa271('0x40')](_0x207e7a[_0xa271('0x91')](_0x31fad8[_0xa271('0x76')],_0x31fad8[_0xa271('0xae')],_0x31fad8[_0xa271('0x47')],_0x31fad8))[_0xa271('0x40')](_0x207e7a[_0xa271('0xaf')](_0x31fad8))[_0xa271('0xa1')](loggerCatchQueueSummary(_0xa271('0xb0'),_0x31fad8));}else{notSendMessagesCampaign(_0x31fad8);}}}};Dialer['prototype'][_0xa271('0xb1')]=function(_0x328ce1){if(_0x328ce1['dialMethod']!=='predictive'){clearPredictiveAttributes(_0x328ce1);}switch(_0x328ce1[_0xa271('0xb2')]){case'progressive':this[_0xa271('0xb3')](_0x328ce1,0x1);break;case'power':this[_0xa271('0xb3')](_0x328ce1,_0x328ce1[_0xa271('0xb4')]);break;case _0xa271('0x8'):this['predictive'](_0x328ce1);break;case _0xa271('0xb5'):this['handlePower'](_0x328ce1,0x1);break;default:logger['error'](_0xa271('0xb6'),_0x328ce1[_0xa271('0x47')],_0xa271('0xb7'));}};Dialer['prototype'][_0xa271('0x94')]=function(_0x29c4be,_0x4e7367){var _0x42cb54=_0x29c4be[_0xa271('0xae')];var _0x1c0598=_0x4e7367?_0x29c4be[_0xa271('0xb8')]:_0x29c4be['Interval'][_0xa271('0x78')];logger[_0xa271('0xb9')](_0xa271('0xba'),_0x1c0598,_0x42cb54,_0x29c4be[_0xa271('0x47')],util['format'](_0xa271('0xbb'),_0x29c4be[_0xa271('0x47')],_0x29c4be['id']));var _0x13b22b=null;return Interval[_0xa271('0xbc')](_0x1c0598,_0x42cb54)[_0xa271('0x40')](function(_0x46c100){if(_0x46c100===!![]){return _0x46c100;}else{_0x29c4be[_0xa271('0x69')]=_0x4e7367?utils[_0xa271('0x6a')][_0xa271('0xbd')]:utils[_0xa271('0x6a')][_0xa271('0xa4')];_0x13b22b=msgResponse('[ifTime][promiseAll]',_0xa271('0x92'),'Global:\x20'+_0x4e7367+'\x20'+_0x29c4be[_0xa271('0x47')]+_0xa271('0xa7')+util[_0xa271('0x45')](_0x1c0598,{'showHidden':![],'depth':null})+_0xa271('0xbe')+_0x42cb54);}if(_0x13b22b!==null){logger[_0xa271('0xb9')](_0xa271('0xbf'),_0x13b22b);_0x13b22b['isGlobal']=_0x4e7367;throw _0x13b22b;}})['catch'](function(_0x12facf){logger[_0xa271('0x66')](_0xa271('0xc0'),_0x12facf);throw msgResponse('[ifTime][Action]',_0xa271('0x84'),util[_0xa271('0x45')](_0x12facf,{'showHidden':![],'depth':null}));});};Dialer['prototype'][_0xa271('0x2d')]=function(_0x5ddbc0){if(this[_0xa271('0x1e')][_0x5ddbc0[_0xa271('0xc1')]]){if(this[_0xa271('0x24')][_0x5ddbc0['uniqueid']]&&this[_0xa271('0x24')][_0x5ddbc0[_0xa271('0xc2')]]['type']!==_0xa271('0xc3')){this[_0xa271('0xc4')](this[_0xa271('0x1e')][_0x5ddbc0[_0xa271('0xc1')]]);this[_0xa271('0x24')][_0x5ddbc0[_0xa271('0xc2')]][_0xa271('0xc5')]=moment()[_0xa271('0x46')](_0xa271('0xc6'));}}};Dialer[_0xa271('0x1a')][_0xa271('0x33')]=function(_0xc9894e){var _0x15f580=this[_0xa271('0x24')][_0xc9894e[_0xa271('0xc2')]];if(this['voiceQueues'][_0xc9894e[_0xa271('0xc1')]]){if(_0x15f580&&_0x15f580[_0xa271('0x42')]!=='ivr'){delete this[_0xa271('0x24')][_0xc9894e[_0xa271('0xc2')]];this['voiceQueues'][_0xc9894e[_0xa271('0xc1')]][_0xa271('0xc7')]+=0x1;var _0x21cc50=new AgentComplete(_0x15f580,_0xc9894e);if(_0xc9894e[_0xa271('0xc8')]==='agent'){_0x21cc50[_0xa271('0xc9')]=this['voiceQueues'][_0xc9894e[_0xa271('0xc1')]][_0xa271('0xca')]&&this[_0xa271('0x1e')][_0xc9894e['queue']]['dialAgiAfterHangupAgent']?moment()[_0xa271('0x46')](_0xa271('0xc6')):undefined;}hopperUtils[_0xa271('0xcb')](_0x21cc50)[_0xa271('0xa1')](loggerCatch(_0xa271('0xcc')));hopperUtils[_0xa271('0xcd')](_0x21cc50)[_0xa271('0xa1')](loggerCatch(_0xa271('0xce')));}}};Dialer[_0xa271('0x1a')][_0xa271('0x2f')]=function(_0x319749){var _0x17573d=this[_0xa271('0x24')][_0x319749[_0xa271('0xc2')]];var _0x5c2e7d=this;var _0x4aedf7=![];var _0x376ad5;var _0x160ca2;if(this[_0xa271('0x1e')][_0x319749['queue']]){if(_0x17573d&&_0x17573d[_0xa271('0x42')]!==_0xa271('0xc3')){delete this[_0xa271('0x24')][_0x319749[_0xa271('0xc2')]];this['updateOriginated'](this[_0xa271('0x1e')][_0x319749[_0xa271('0xc1')]]);_0x17573d[_0xa271('0xcf')]=moment()['format'](_0xa271('0xc6'));var _0x2dbda6=new QueueCallerAbandon(_0x17573d,_0x319749);if(utils['getSeconds'](_0x17573d[_0xa271('0xcf')],_0x17573d[_0xa271('0xd0')])>=_0x17573d['dialQueueTimeout']){this[_0xa271('0x1e')][_0x319749['queue']][_0xa271('0xd1')]+=0x1;this[_0xa271('0x1e')][_0x319749[_0xa271('0xc1')]][_0xa271('0xd2')]+=0x1;this[_0xa271('0x1e')][_0x319749[_0xa271('0xc1')]][_0xa271('0xd3')]+=0x1;_0x2dbda6['state']=0xa;_0x2dbda6[_0xa271('0xd4')]='Drop';_0x2dbda6['dropreason']=_0xa271('0xd5');_0x2dbda6['agiafterat']=this[_0xa271('0x1e')][_0x319749['queue']][_0xa271('0xca')]?moment()[_0xa271('0x46')](_0xa271('0xc6')):undefined;_0x2dbda6[_0xa271('0xd6')]+=0x1;_0x2dbda6[_0xa271('0xd7')]+=0x1;_0x376ad5=this[_0xa271('0x1e')][_0x319749[_0xa271('0xc1')]]['dialDropRetryFrequency'];_0x160ca2=this[_0xa271('0x1e')][_0x319749['queue']][_0xa271('0xd8')];hopperUtils[_0xa271('0xd9')](_0x2dbda6,_0x2dbda6[_0xa271('0x6f')],_0x17573d['voiceQueue'])[_0xa271('0x40')](function(_0x479078){_0x4aedf7=_0x479078['additional']==0x1;if(_0x2dbda6['countdropretry']>=_0x5c2e7d[_0xa271('0x1e')][_0x319749[_0xa271('0xc1')]][_0xa271('0xda')]){_0x5c2e7d[_0xa271('0xdb')](_0x2dbda6,_0x479078[_0xa271('0xdc')]);}else{hopperUtils[_0xa271('0xdd')]({'active':![],'countdropretry':_0x2dbda6[_0xa271('0xd6')],'scheduledat':moment()['add'](_0x5c2e7d[_0xa271('0x1e')][_0x319749[_0xa271('0xc1')]][_0xa271('0xde')],_0xa271('0xdf'))[_0xa271('0x46')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x17573d[_0xa271('0xe0')],'ListId':_0x17573d[_0xa271('0xe1')],'VoiceQueueId':_0x17573d['VoiceQueueId']||undefined,'CampaignId':_0x17573d[_0xa271('0xe2')]||undefined})[_0xa271('0xa1')](loggerCatch(_0xa271('0xe3')));var _0x42dd04=new History(_0x2dbda6);_0x42dd04[_0xa271('0x6f')]=0xa;_0x42dd04['statedesc']=_0xa271('0xe4');_0x42dd04[_0xa271('0x71')]=moment()[_0xa271('0x46')]('YYYY-MM-DD\x20HH:mm:ss');_0x42dd04[_0xa271('0x70')]=_0x42dd04[_0xa271('0x71')];_0x42dd04[_0xa271('0xe5')]=_0x2dbda6[_0xa271('0xe5')];_0x42dd04[_0xa271('0xe6')]=_0x2dbda6[_0xa271('0xe6')];hopperUtils[_0xa271('0xcb')](_0x42dd04)[_0xa271('0xa1')](loggerCatch(_0xa271('0xe7')));}})[_0xa271('0x40')](function(){if(_0x4aedf7)hopperUtils['swapAdditionalPhones'](_0x2dbda6,_0x376ad5,_0x160ca2)['then'](function(){return 0x1;});});}else{this[_0xa271('0x1e')][_0x319749[_0xa271('0xc1')]][_0xa271('0x50')]+=0x1;this[_0xa271('0x1e')][_0x319749[_0xa271('0xc1')]][_0xa271('0xe8')]+=0x1;_0x2dbda6[_0xa271('0x6f')]=0xb;_0x2dbda6[_0xa271('0xd4')]=_0xa271('0xe9');_0x2dbda6[_0xa271('0xea')]='CALLEREXIT';_0x2dbda6[_0xa271('0xeb')]+=0x1;_0x2dbda6[_0xa271('0xd7')]+=0x1;_0x376ad5=this[_0xa271('0x1e')][_0x319749['queue']][_0xa271('0xec')];_0x160ca2=this[_0xa271('0x1e')][_0x319749[_0xa271('0xc1')]][_0xa271('0xd8')];hopperUtils[_0xa271('0xd9')](_0x2dbda6,_0x2dbda6[_0xa271('0x6f')],_0x17573d[_0xa271('0xed')])[_0xa271('0x40')](function(_0x303fdf){if(_0x2dbda6[_0xa271('0xeb')]>=_0x5c2e7d['voiceQueues'][_0x319749['queue']]['dialAbandonedMaxRetry']){_0x5c2e7d['queueCallerAbandonCreateState'](_0x2dbda6,_0x303fdf[_0xa271('0xdc')]);}else{hopperUtils[_0xa271('0xdd')]({'active':![],'countabandonedretry':_0x2dbda6[_0xa271('0xeb')],'scheduledat':moment()[_0xa271('0xee')](_0x5c2e7d[_0xa271('0x1e')][_0x319749[_0xa271('0xc1')]][_0xa271('0xec')],_0xa271('0xdf'))[_0xa271('0x46')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x17573d[_0xa271('0xe0')],'ListId':_0x17573d['ListId'],'VoiceQueueId':_0x17573d['VoiceQueueId']||undefined,'CampaignId':_0x17573d['CampaignId']||undefined})[_0xa271('0xa1')](loggerCatch(_0xa271('0xef')));var _0x4915ef=new History(_0x2dbda6);_0x4915ef['state']=0xb;_0x4915ef[_0xa271('0xd4')]=_0xa271('0xe9');_0x4915ef[_0xa271('0x71')]=moment()['format'](_0xa271('0xc6'));_0x4915ef[_0xa271('0x70')]=_0x4915ef['starttime'];_0x4915ef[_0xa271('0xe5')]=_0x2dbda6[_0xa271('0xe5')];_0x4915ef[_0xa271('0xe6')]=_0x2dbda6[_0xa271('0xe6')];hopperUtils[_0xa271('0xcb')](_0x4915ef)[_0xa271('0xa1')](loggerCatch(_0xa271('0xf0')));}})[_0xa271('0x40')](function(){if(_0x4aedf7)hopperUtils[_0xa271('0xf1')](_0x2dbda6,_0x376ad5,_0x160ca2)[_0xa271('0x40')](function(){return 0x1;});});}}}};Dialer[_0xa271('0x1a')][_0xa271('0x38')]=function(_0x13c686){if(this[_0xa271('0x22')][_0x13c686[_0xa271('0xc2')]]){this[_0xa271('0x22')][_0x13c686[_0xa271('0xc2')]]['channel']=_0x13c686['channel'];}if(this[_0xa271('0x24')][_0x13c686['uniqueid']]){this['uniqueId'][_0x13c686[_0xa271('0xc2')]][_0xa271('0xf2')]=_0x13c686[_0xa271('0xf2')];}};Dialer[_0xa271('0x1a')][_0xa271('0x3a')]=function(_0x125b5c){if(!this[_0xa271('0x22')][_0x125b5c['actionid']]){return;}var _0x2f6a23=this[_0xa271('0x1e')][this[_0xa271('0x22')][_0x125b5c[_0xa271('0xf3')]]['queue']][_0xa271('0xf4')]||_0xa271('0xf5');if(_0x2f6a23===_0xa271('0xf6')){if(this[_0xa271('0x22')][_0x125b5c['actionid']]&&_[_0xa271('0xf7')](this[_0xa271('0x22')][_0x125b5c[_0xa271('0xf3')]][_0xa271('0xf8')])&&_0x125b5c[_0xa271('0x88')]==='1'&&_0x125b5c[_0xa271('0xf9')]==='0'){if(this['agents'][_0x125b5c[_0xa271('0xfa')]]){if(!this[_0xa271('0x1f')][_0x125b5c[_0xa271('0xfa')]][_0xa271('0xf8')]){this[_0xa271('0x1f')][_0x125b5c[_0xa271('0xfa')]]['locked']=!![];this[_0xa271('0x22')][_0x125b5c[_0xa271('0xf3')]][_0xa271('0xf8')]=!![];this['actions'][_0x125b5c[_0xa271('0xf3')]]['stateinterface']=_0x125b5c[_0xa271('0xfa')];}}}}else if(_0x2f6a23==='rrmemory'){if(this[_0xa271('0x22')][_0x125b5c[_0xa271('0xf3')]]){if(this['agents'][_0x125b5c[_0xa271('0xfa')]]){this[_0xa271('0x22')][_0x125b5c[_0xa271('0xf3')]][_0xa271('0xfa')]=_0x125b5c[_0xa271('0xfa')];if(_[_0xa271('0xf7')](this['queueBooked'][this['actions'][_0x125b5c[_0xa271('0xf3')]][_0xa271('0xc1')]])){this[_0xa271('0x29')][this[_0xa271('0x22')][_0x125b5c['actionid']]['queue']]=[];}this['queueBooked'][this[_0xa271('0x22')][_0x125b5c[_0xa271('0xf3')]][_0xa271('0xc1')]][_0xa271('0x9a')](_[_0xa271('0x60')](_['pick'](this[_0xa271('0x22')][_0x125b5c['actionid']],[_0xa271('0xfb'),_0xa271('0xfa')]),{'status':_0x125b5c['status'],'paused':_0x125b5c[_0xa271('0xf9')]}));}}}};Dialer['prototype'][_0xa271('0x3c')]=function(_0x48a5d8){if(!this['actions'][_0x48a5d8[_0xa271('0xf3')]]){return;}var _0x2110e7=this;var _0x2fc57b=this[_0xa271('0x1e')][this['actions'][_0x48a5d8[_0xa271('0xf3')]][_0xa271('0xc1')]];var _0x253993=_0x2fc57b[_0xa271('0xf4')]||_0xa271('0xf5');if(_0x253993===_0xa271('0xf6')){if(this['actions'][_0x48a5d8[_0xa271('0xf3')]]&&this[_0xa271('0x22')][_0x48a5d8['actionid']]['stateinterface']){this['preview'][_0xa271('0xfc')](this[_0xa271('0x22')][_0x48a5d8[_0xa271('0xf3')]][_0xa271('0xfb')],this[_0xa271('0x22')][_0x48a5d8[_0xa271('0xf3')]]['stateinterface'])[_0xa271('0xa1')](function(_0x153f23){logger[_0xa271('0x66')](_0xa271('0xfd'),util[_0xa271('0x45')](_0x153f23,{'showHidden':![],'depth':null}));})[_0xa271('0x1c')](function(){_0x2110e7[_0xa271('0xc4')](_0x2110e7[_0xa271('0x1e')][_0x2110e7[_0xa271('0x22')][_0x48a5d8[_0xa271('0xf3')]][_0xa271('0xc1')]]);_0x2110e7[_0xa271('0x1f')][_0x2110e7[_0xa271('0x22')][_0x48a5d8['actionid']]['stateinterface']][_0xa271('0xf8')]=![];delete _0x2110e7[_0xa271('0x22')][_0x48a5d8[_0xa271('0xf3')]];unlockQueueStatus(_0x2fc57b);});}else{this[_0xa271('0xc4')](this[_0xa271('0x1e')][this[_0xa271('0x22')][_0x48a5d8[_0xa271('0xf3')]][_0xa271('0xc1')]]);hopperUtils[_0xa271('0xdd')]({'active':![],'ContactId':this[_0xa271('0x22')][_0x48a5d8[_0xa271('0xf3')]][_0xa271('0xe0')],'ListId':this[_0xa271('0x22')][_0x48a5d8[_0xa271('0xf3')]][_0xa271('0xe1')],'VoiceQueueId':this[_0xa271('0x22')][_0x48a5d8[_0xa271('0xf3')]][_0xa271('0xfe')]||undefined,'CampaignId':this['actions'][_0x48a5d8[_0xa271('0xf3')]]['CampaignId']||undefined})[_0xa271('0xa1')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0xa271('0x22')][_0x48a5d8[_0xa271('0xf3')]];unlockQueueStatus(_0x2fc57b);}}else if(_0x253993===_0xa271('0xf5')){var _0x3394f8;if(this[_0xa271('0x22')][_0x48a5d8[_0xa271('0xf3')]]&&!_[_0xa271('0x49')](this[_0xa271('0x29')][this[_0xa271('0x22')][_0x48a5d8[_0xa271('0xf3')]][_0xa271('0xc1')]])){if(this[_0xa271('0x2a')][_0x2110e7[_0xa271('0x22')][_0x48a5d8[_0xa271('0xf3')]][_0xa271('0xc1')]]){this[_0xa271('0x2a')][_0x2110e7[_0xa271('0x22')][_0x48a5d8[_0xa271('0xf3')]]['queue']]=this['queueBookedRR'][this[_0xa271('0x22')][_0x48a5d8[_0xa271('0xf3')]][_0xa271('0xc1')]]?this[_0xa271('0x2a')][this[_0xa271('0x22')][_0x48a5d8[_0xa271('0xf3')]][_0xa271('0xc1')]]:this[_0xa271('0x29')][this[_0xa271('0x22')][_0x48a5d8['actionid']][_0xa271('0xc1')]]?this[_0xa271('0x29')][this['actions'][_0x48a5d8[_0xa271('0xf3')]][_0xa271('0xc1')]][_0xa271('0xff')]||0x0:0x0;}this[_0xa271('0x29')][this[_0xa271('0x22')][_0x48a5d8['actionid']][_0xa271('0xc1')]][_0xa271('0xff')]=this[_0xa271('0x2a')][this['actions'][_0x48a5d8['actionid']]['queue']];for(var _0x3057ad=0x0;_0x3057ad=_0x47325a[_0xa271('0x124')]){_0x9f65d1[_0xa271('0x125')](_0x42cd47,_0x1d1ac4,_0x40b992,_0xa271('0x126'));}else{if(_0x42cd47[_0xa271('0x11e')]>=_0x47325a[_0xa271('0x127')]){_0x9f65d1[_0xa271('0x128')](_0x42cd47,_0x1d1ac4,_0x40b992,_0xa271('0x129'));}else{hopperUtils[_0xa271('0xdd')]({'active':![],'countmachineretry':_0x42cd47[_0xa271('0x11e')],'scheduledat':moment()[_0xa271('0xee')](_0x47325a[_0xa271('0x12a')],_0xa271('0xdf'))[_0xa271('0x46')](_0xa271('0xc6')),'ContactId':_0x42cd47[_0xa271('0xe0')],'ListId':_0x42cd47[_0xa271('0xe1')],'VoiceQueueId':_0x42cd47['VoiceQueueId']||undefined,'CampaignId':_0x42cd47[_0xa271('0xe2')]||undefined})['catch'](loggerCatch('[rescheduleContact][Machine]'));_0x1d1ac4({'reschedule':0x1});}}});}if(_0xf67387['type']===_0xa271('0xc3')&&this[_0xa271('0xac')][_0xf67387[_0xa271('0xc1')]][_0xa271('0x11a')]&&_0x1b3e48['value']===_0xa271('0x113')){delete this[_0xa271('0x24')][_0x1b3e48[_0xa271('0xc2')]];this[_0xa271('0xc4')](this[_0xa271('0xac')][_0xf67387[_0xa271('0xc1')]]);_0xaadee5=new Hangup(_0xf67387,_0x1b3e48);_0xaadee5[_0xa271('0x6f')]=0x12;_0xaadee5[_0xa271('0xd4')]='HangupInAMD';_0xaadee5[_0xa271('0x114')]=_0xa271('0x115');ami[_0xa271('0x116')](_0xa271('0x12b'),ut[_0xa271('0x117')](_0xaadee5,'amd'));this[_0xa271('0x12c')](_0xaadee5,_0xa271('0x12d'),'[syncHangupInAMDIvr]');}if(_0xf67387[_0xa271('0x42')]===_0xa271('0xc3')&&this[_0xa271('0xac')][_0xf67387['queue']]['dialAMDActive']&&_0x1b3e48['value']===_0xa271('0x11b')){return new Promise(function(_0x3135b4,_0x57ff73){delete _0x9f65d1['uniqueId'][_0x1b3e48[_0xa271('0xc2')]];_0x9f65d1[_0xa271('0xc4')](_0x9f65d1[_0xa271('0xac')][_0xf67387[_0xa271('0xc1')]]);_0x9f65d1[_0xa271('0xac')][_0xf67387[_0xa271('0xc1')]][_0xa271('0xc7')]+=0x1;_0x9f65d1['campaigns'][_0xf67387['queue']]['outboundAnswerAgiCallsDay']+=0x1;var _0x156eb3=_0x9f65d1[_0xa271('0xac')][_0xf67387[_0xa271('0xc1')]];var _0x56c7e9=new Hangup(_0xf67387,_0x1b3e48);_0x56c7e9[_0xa271('0x6f')]=0x13;_0x56c7e9[_0xa271('0xd4')]='Machine';_0x56c7e9[_0xa271('0x114')]=_0xa271('0x115');_0x56c7e9[_0xa271('0x11e')]+=0x1;_0x56c7e9['countglobal']+=0x1;_0x56c7e9[_0xa271('0x118')]=!![];ami[_0xa271('0x116')](_0xa271('0x12b'),ut['buildObj'](_0x56c7e9,_0xa271('0x118')));hopperUtils[_0xa271('0xcb')](_0x56c7e9)[_0xa271('0xa1')](loggerCatch(_0xa271('0x11f')));if(_0x56c7e9['countbusyretry']+_0x56c7e9[_0xa271('0x121')]+_0x56c7e9[_0xa271('0x12e')]+_0x56c7e9[_0xa271('0x122')]+_0x56c7e9[_0xa271('0xd6')]+_0x56c7e9['countabandonedretry']+_0x56c7e9[_0xa271('0x11e')]+_0x56c7e9[_0xa271('0x123')]>=_0x156eb3['dialGlobalMaxRetry']){_0x9f65d1[_0xa271('0x125')](_0x56c7e9,_0x3135b4,_0x57ff73,_0xa271('0x126'));}else{if(_0x56c7e9[_0xa271('0x11e')]>=_0x156eb3[_0xa271('0x127')]){_0x9f65d1[_0xa271('0x128')](_0x56c7e9,_0x3135b4,_0x57ff73,'reason\x2019\x20machine....');}else{hopperUtils[_0xa271('0xdd')]({'active':![],'countmachineretry':_0x56c7e9[_0xa271('0x11e')],'scheduledat':moment()[_0xa271('0xee')](_0x156eb3[_0xa271('0x12a')],_0xa271('0xdf'))[_0xa271('0x46')](_0xa271('0xc6')),'ContactId':_0x56c7e9['ContactId'],'ListId':_0x56c7e9[_0xa271('0xe1')],'VoiceQueueId':_0x56c7e9[_0xa271('0xfe')]||undefined,'CampaignId':_0x56c7e9['CampaignId']||undefined})[_0xa271('0xa1')](loggerCatch('[rescheduleContact][Machine]'));_0x3135b4({'reschedule':0x1});}}});}}};Dialer[_0xa271('0x1a')][_0xa271('0x12f')]=function(_0x1709d2){var _0x42cb34=this[_0xa271('0x24')][_0x1709d2['uniqueid']];var _0x2248c7;if(_0x42cb34&&_0x42cb34[_0xa271('0x42')]==='ivr'){delete this[_0xa271('0x24')][_0x1709d2[_0xa271('0xc2')]];this[_0xa271('0xc4')](this[_0xa271('0xac')][_0x42cb34[_0xa271('0xc1')]]);this[_0xa271('0xac')][_0x42cb34[_0xa271('0xc1')]][_0xa271('0x130')]+=0x1;_0x2248c7=new Hangup(_0x42cb34,_0x1709d2);hopperUtils['createHistory'](_0x2248c7)[_0xa271('0xa1')](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils[_0xa271('0xcd')](_0x2248c7)[_0xa271('0xa1')](loggerCatch(_0xa271('0x131')));}if(_0x42cb34&&_0x42cb34[_0xa271('0x42')]!=='ivr'&&isNotNull(this[_0xa271('0x1e')][_0x42cb34['queue']]['dialQueueProject'])){delete this[_0xa271('0x24')][_0x1709d2[_0xa271('0xc2')]];this[_0xa271('0xc4')](this[_0xa271('0x1e')][_0x42cb34[_0xa271('0xc1')]]);this[_0xa271('0x1e')][_0x42cb34[_0xa271('0xc1')]][_0xa271('0xc7')]+=0x1;this[_0xa271('0x1e')][_0x42cb34[_0xa271('0xc1')]][_0xa271('0x11c')]+=0x1;_0x2248c7=new Hangup(_0x42cb34,_0x1709d2);_0x2248c7[_0xa271('0x6f')]=0x10;_0x2248c7[_0xa271('0xd4')]=_0xa271('0x132');_0x2248c7[_0xa271('0x114')]=_0xa271('0x133');hopperUtils['createHistory'](_0x2248c7)[_0xa271('0xa1')](loggerCatch(_0xa271('0x134')));hopperUtils[_0xa271('0xcd')](_0x2248c7)[_0xa271('0xa1')](loggerCatch(_0xa271('0x131')));}if(_0x42cb34&&_0x42cb34[_0xa271('0x42')]!==_0xa271('0xc3')&&!isNotNull(this[_0xa271('0x1e')][_0x42cb34[_0xa271('0xc1')]]['dialQueueProject'])){delete this['uniqueId'][_0x1709d2['uniqueid']];this['updateOriginated'](this[_0xa271('0x1e')][_0x42cb34[_0xa271('0xc1')]]);this[_0xa271('0x1e')][_0x42cb34[_0xa271('0xc1')]][_0xa271('0x135')]+=0x1;_0x2248c7=new Hangup(_0x42cb34,_0x1709d2);_0x2248c7['state']=0xc;_0x2248c7[_0xa271('0xd4')]=_0x1709d2[_0xa271('0x136')];_0x2248c7[_0xa271('0x114')]=_0xa271('0x137');hopperUtils['createHistory'](_0x2248c7)[_0xa271('0xa1')](loggerCatch(_0xa271('0x134')));hopperUtils[_0xa271('0xcd')](_0x2248c7)[_0xa271('0xa1')](loggerCatch(_0xa271('0x131')));}};Dialer['prototype']['syncQueueSummary']=function(_0x103c16){var _0x180504=this;if(!_0x180504[_0xa271('0x2b')][_0x103c16[_0xa271('0x47')]]){_0x180504['queuesSummary'][_0x103c16[_0xa271('0x47')]]={'running':![]};}else if(_0x180504[_0xa271('0x2b')][_0x103c16[_0xa271('0x47')]][_0xa271('0x138')]===!![]){return;}else if(_0x180504[_0xa271('0x2b')][_0x103c16[_0xa271('0x47')]][_0xa271('0x138')]===![]){_0x180504[_0xa271('0x2b')][_0x103c16['name']][_0xa271('0x138')]=!![];}var _0x25d72b=_0x180504[_0xa271('0x1e')][_0x103c16[_0xa271('0x47')]];var _0x13079b=_0x25d72b[_0xa271('0x69')]!==utils['CAMPAIGN_STATUS']['INACTIVE'];var _0x4c6d64=utils[_0xa271('0x139')](_0x25d72b);_0x25d72b[_0xa271('0x13a')]=utils[_0xa271('0x13b')](_0x25d72b,_0x180504['trunks']);Promise[_0xa271('0xad')]()[_0xa271('0x40')](function(){if(_0x25d72b[_0xa271('0x13a')]===utils[_0xa271('0x6a')][_0xa271('0x7b')]){if(_0x13079b){clearPredictiveAttributes(_0x25d72b);_0x103c16[_0xa271('0x26')]=undefined;_0x103c16[_0xa271('0x27')]=undefined;}if(_0x25d72b['statusMessage']===utils[_0xa271('0x6a')][_0xa271('0x7b')]){_0x103c16[_0xa271('0x13c')]=0x0;_0x103c16['paused']=0x0;_0x103c16[_0xa271('0x13d')]=0x0;_0x103c16['talking']=0x0;_0x103c16['pTalking']=0x0;}}else if(_0x25d72b[_0xa271('0x13a')]===utils[_0xa271('0x6a')][_0xa271('0x13e')]&&!_0x4c6d64){return _0x180504[_0xa271('0x94')](_0x25d72b,!![])['then'](function(){return _0x180504[_0xa271('0x94')](_0x25d72b,![]);})[_0xa271('0x40')](function(){return _0x180504[_0xa271('0xb1')](_0x25d72b);})['catch'](function(_0xded843){loggerSyncQueueSummary[_0xa271('0x44')](_0xa271('0x13f'),util[_0xa271('0x45')](_0xded843,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x25d72b);});}else{clearPredictiveAttributes(_0x25d72b);}})[_0xa271('0x40')](function(){var _0x25f945=_0x103c16[_0xa271('0x140')](_0x25d72b);if(_0x25f945||_0x25d72b[_0xa271('0x141')]){_0x25d72b[_0xa271('0x141')]=![];_0x103c16[_0xa271('0x142')](_0x25d72b);Object[_0xa271('0x143')](_0x25d72b,_0x103c16);emitOutboundVoiceQueueSummary(_0x103c16);}_0x180504['queuesSummary'][_0x25d72b[_0xa271('0x47')]][_0xa271('0x138')]=![];})[_0xa271('0xa1')](function(_0x48e485){logger[_0xa271('0x66')]('[syncQueueSummary]',util[_0xa271('0x45')](_0x48e485,{'showHidden':![],'depth':null}));_0x180504[_0xa271('0x2b')][_0x25d72b[_0xa271('0x47')]][_0xa271('0x138')]=![];});};Dialer[_0xa271('0x1a')][_0xa271('0x35')]=_[_0xa271('0x144')](function(){var _0x5544c1=_[_0xa271('0x145')](this[_0xa271('0x1e')],function(_0x3005bf){return _0x3005bf[_0xa271('0x146')];});var _0x17f1a5=_[_0xa271('0x145')](this[_0xa271('0x1f')],function(_0x3384a7){return _0x3384a7[_0xa271('0x147')]&&_0x3384a7[_0xa271('0x88')]===_0xa271('0x89');});if(_0x5544c1[_0xa271('0x100')]>0x0&&_0x17f1a5[_0xa271('0x100')]>0x0){return Promise[_0xa271('0xad')]()[_0xa271('0x40')](cmHopper['handlePreviewRecallNotifications'](_[_0xa271('0x148')](_0x5544c1,'id'),previewRecallmeReminderInterval,_[_0xa271('0x148')](_0x17f1a5,'id')))[_0xa271('0x40')](function(_0x1bf37d){for(var _0xf257b8=0x0;_0xf257b8<_0x1bf37d[_0xa271('0x100')];_0xf257b8++){var _0x2b874f=_0x1bf37d[_0xf257b8][_0xa271('0x149')][_0xa271('0x47')];if(_0x2b874f)io['to'](util[_0xa271('0x46')](_0xa271('0x14a'),_0x2b874f))[_0xa271('0x116')](_0xa271('0x14b'),{'hopper':_0x1bf37d[_0xf257b8]});}})['catch'](function(_0x2992cb){logger[_0xa271('0x66')](_0xa271('0x14c'),_0x2992cb);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0xa271('0x1a')][_0xa271('0x3e')]=function(){var _0x353319=this;setInterval(function(){_0x353319[_0xa271('0x14d')](_0x353319[_0xa271('0x24')],_0xa271('0x14e'));_0x353319['clearZombieChannels'](_0x353319[_0xa271('0x22')],_0xa271('0x14f'));},0x32c8);};Dialer[_0xa271('0x1a')][_0xa271('0x14d')]=function(_0x3523e5,_0x36a9af){var _0xb54cf1=this;for(var _0x5aa428 in _0x3523e5){if(typeof _0x3523e5[_0x5aa428]!==_0xa271('0xab')){this[_0xa271('0x150')][_0xa271('0x151')](function(){if(!_[_0xa271('0xf7')](_0x3523e5[_0x5aa428])){return ami['Action']({'action':'status','channel':_0x3523e5[_0x5aa428][_0xa271('0xf2')]})[_0xa271('0xa1')](function(_0x50a9cd){if(_0x50a9cd[_0xa271('0x69')]===_0xa271('0x152')){setTimeout(function(){if(_0x3523e5[_0x5aa428]&&_0x3523e5[_0x5aa428][_0xa271('0x42')]!==_0xa271('0xc3')){_0xb54cf1['updateOriginated'](_0xb54cf1[_0xa271('0x1e')][_0x3523e5[_0x5aa428][_0xa271('0xc1')]]);logger[_0xa271('0x66')]('[Dialer][checkChannel]',_0x36a9af,_0x5aa428,_0x3523e5[_0x5aa428][_0xa271('0xc1')]);delete _0x3523e5[_0x5aa428];}if(_0x3523e5[_0x5aa428]&&_0x3523e5[_0x5aa428][_0xa271('0x42')]==='ivr'){_0xb54cf1['updateOriginated'](_0xb54cf1[_0xa271('0xac')][_0x3523e5[_0x5aa428]['queue']]);logger[_0xa271('0x66')](_0xa271('0x153'),_0x36a9af,_0x5aa428,_0x3523e5[_0x5aa428][_0xa271('0xc1')]);delete _0x3523e5[_0x5aa428];}},0x2328);}});}});}}};Dialer[_0xa271('0x1a')][_0xa271('0x154')]=function(_0x6677da){return Promise[_0xa271('0xad')]()[_0xa271('0x40')](voiceQueueRt[_0xa271('0x154')](_0x6677da))['catch'](loggerCatch(_0xa271('0x155')));};Dialer[_0xa271('0x1a')][_0xa271('0xc4')]=function(_0x2a81aa){if(!_[_0xa271('0x41')](_0x2a81aa)&&_0x2a81aa!==null){if(typeof _0x2a81aa[_0xa271('0x156')]!=='undefined'){if(_0x2a81aa[_0xa271('0x156')]>0x0){_0x2a81aa[_0xa271('0x156')]-=0x1;}else{logger[_0xa271('0x66')](_0xa271('0x157'));}}}else{logger['error'](_0xa271('0x158'));}};Dialer[_0xa271('0x1a')][_0xa271('0x159')]=function(_0x3b2579,_0x2224f4){var _0x32d03b=this;return function(_0x4a794a){_0x32d03b[_0xa271('0xc4')](_0x2224f4);logger[_0xa271('0x66')](_0x3b2579,util[_0xa271('0x45')](_0x4a794a,{'showHidden':![],'depth':null}));};};Dialer[_0xa271('0x1a')][_0xa271('0x15a')]=function(_0x2c1251,_0x5a9cf4,_0x55f6a7){var _0x195bf0={'state':0x19,'statedesc':_0xa271('0x15b')};this[_0xa271('0xc4')](_0x5a9cf4);this['saveInDb'](_[_0xa271('0x60')](_0x195bf0,_[_0xa271('0x75')](_0x55f6a7,[_0xa271('0xe0'),_0xa271('0xe1'),_0xa271('0x15c'),_0xa271('0xfe'),_0xa271('0xe2')])),_0xa271('0x15d'),_0xa271('0x15e'));logger['error'](_0x2c1251);};Dialer[_0xa271('0x1a')]['saveInDb']=function(_0x5af493,_0x31994a,_0x11fef0){hopperUtils[_0xa271('0xcb')](_0x5af493)[_0xa271('0xa1')](loggerCatch(_0x31994a));hopperUtils['moveContactManagedDialer'](_0x5af493)[_0xa271('0xa1')](loggerCatch(_0x11fef0));};Dialer[_0xa271('0x1a')][_0xa271('0xdb')]=function(_0x1f67a4,_0x4642ea){hopperUtils[_0xa271('0xcb')](_0x1f67a4)['catch'](loggerCatch('[syncAgentComplete][createHistory]'));if(_0x4642ea==0x0){hopperUtils['moveContactManagedDialer'](_0x1f67a4)[_0xa271('0xa1')](loggerCatch(_0xa271('0x15f')));}};Dialer[_0xa271('0x1a')]['checkPreviewRecallReminder']=function(_0x28f908){return Promise[_0xa271('0xad')]()[_0xa271('0x40')](cmHopper[_0xa271('0x160')](_0x28f908['id'],previewRecallmeReminderInterval))['then'](function(_0x16bb94){for(var _0x3498dd=0x0;_0x3498dd<_0x16bb94[_0xa271('0x100')];_0x3498dd++){var _0x3fcc76=_0x16bb94[_0x3498dd][_0xa271('0x149')]['name'];if(_0x3fcc76)io['to'](util[_0xa271('0x46')](_0xa271('0x14a'),_0x3fcc76))['emit']('user:dialPreviewRecallReminder',{'hopper':_0x16bb94[_0x3498dd]});}})[_0xa271('0xa1')](function(){});};Dialer['prototype'][_0xa271('0xaf')]=function(_0x5e34a8){var _0x3b1c6c=this;return function(){_0x3b1c6c[_0xa271('0x161')](_0x5e34a8);};};Dialer[_0xa271('0x1a')]['actionOriginate']=function(_0x34f68a,_0x43e21a){var _0x4d1137=this;var _0x168138=uuid['v4']();this[_0xa271('0x22')][_0x168138]=new Action(_0x34f68a,_0x43e21a,_0x168138);return new Promise(function(_0x1b49e8,_0x155baa){if(_[_0xa271('0x41')](_0x34f68a)&&typeof _0x34f68a!==_0xa271('0x162')){return _0x155baa(msgResponse(_0xa271('0x163'),'Failure','voiceQueue\x20is\x20undefine'));}if(_[_0xa271('0x41')](_0x43e21a[_0xa271('0x164')])||_0x43e21a[_0xa271('0x164')]===null){return _0x155baa(msgResponse(_0xa271('0x163'),_0xa271('0x92'),_0xa271('0x165')));}var _0x16642d={'XMD-CALLERID':_0x4d1137[_0xa271('0x22')][_0x168138][_0xa271('0x166')](),'XMD-AGI':_0x34f68a[_0xa271('0x167')]?util[_0xa271('0x46')]('\x22agi://%s/square,%s\x22',ipAgi,_0x34f68a[_0xa271('0x167')]):_0xa271('0x168'),'XMD-AGIAFTER':_0x34f68a[_0xa271('0xca')]?util[_0xa271('0x46')](_0xa271('0x169'),ipAgi,_0x34f68a['dialQueueProject2']):_0xa271('0x168'),'XMD-QUEUE':utils[_0xa271('0x16a')](_0x34f68a)?util[_0xa271('0x46')](_0xa271('0x16b'),_0x34f68a[_0xa271('0x47')],_0x34f68a['dialQueueOptions']||'',_0x34f68a['dialAgiAfterHangupAgent']?'c':'',_0x34f68a[_0xa271('0x16c')]||0x3):_0xa271('0x168'),'XMD-CONTACTID':_0x43e21a[_0xa271('0xe0')],'XMD-CDRTYPE':_0xa271('0x16d'),'CALLERID(all)':_0x4d1137[_0xa271('0x22')][_0x168138]['getCaller'](),'XMD-AMD':_0x34f68a[_0xa271('0x11a')]?_0xa271('0x13e'):'NONE','XMD-DESTINATION':_0xa271('0x16e')};if(_0x34f68a[_0xa271('0x11a')]){_0x16642d[_0xa271('0x16f')]=_0x34f68a[_0xa271('0x170')]||0x9c4;_0x16642d[_0xa271('0x171')]=_0x34f68a['dialAMDGreeting']||0x5dc;_0x16642d[_0xa271('0x172')]=_0x34f68a[_0xa271('0x173')]||0x320;_0x16642d[_0xa271('0x174')]=_0x34f68a[_0xa271('0x175')]||0x1388;_0x16642d[_0xa271('0x176')]=_0x34f68a[_0xa271('0x177')]||0x64;_0x16642d[_0xa271('0x178')]=_0x34f68a[_0xa271('0x179')]||0x32;_0x16642d[_0xa271('0x17a')]=_0x34f68a[_0xa271('0x17b')]||0x3;_0x16642d['XMD-AMDSILENCETHRESHOLD']=_0x34f68a[_0xa271('0x17c')]||0x100;_0x16642d['XMD-AMDMAXIMUMWORDLENGTH']=_0x34f68a[_0xa271('0x17d')]||0x1388;}if(utils[_0xa271('0x16a')](_0x34f68a)){_0x16642d[_0xa271('0x17e')]=_0x43e21a[_0xa271('0xfe')];}else{_0x16642d[_0xa271('0x17f')]=_0x43e21a[_0xa271('0xe2')];}var _0x3482ef=utils[_0xa271('0x180')](_0x43e21a[_0xa271('0x181')]);Object[_0xa271('0x143')](_0x16642d,_0x3482ef);var _0x1a8aa0=_0x4d1137[_0xa271('0x85')](_0x34f68a[_0xa271('0x182')])?utils[_0xa271('0x183')](_0x34f68a[_0xa271('0x182')][_0xa271('0x184')],_0x34f68a[_0xa271('0x185')],_0x34f68a[_0xa271('0x186')]>0x0?utils[_0xa271('0x187')](_0x34f68a['dialOriginateCallerIdNumber'],_0x34f68a[_0xa271('0x186')]):_0x34f68a[_0xa271('0x188')]):utils[_0xa271('0x183')](_[_0xa271('0xf7')](_0x34f68a['TrunkBackup'])?_0x34f68a['Trunk'][_0xa271('0x184')]:_0x34f68a[_0xa271('0x8c')][_0xa271('0x184')],_0x34f68a['dialOriginateCallerIdName'],_0x34f68a[_0xa271('0x186')]>0x0?utils[_0xa271('0x187')](_0x34f68a[_0xa271('0x188')],_0x34f68a[_0xa271('0x186')]):_0x34f68a[_0xa271('0x188')]);if(_0x1a8aa0){_0x16642d['XMD-ORIGINATECALLERIDNAME']=_0x4d1137[_0xa271('0x22')][_0x168138][_0xa271('0x189')]=utils[_0xa271('0x18a')](_0x1a8aa0);_0x16642d[_0xa271('0x18b')]=_0x43e21a[_0xa271('0x164')];}_0x34f68a[_0xa271('0x18c')]=_0x16642d;return ami['Action']({'actionid':_0x168138,'action':_0xa271('0x163'),'channel':_0x4d1137['isTrunkReachable'](_0x34f68a['Trunk'])?util[_0xa271('0x46')](_0xa271('0x18d'),_0x34f68a[_0xa271('0x182')][_0xa271('0x47')],isNotNull(_0x34f68a['dialPrefix'])?_0x34f68a[_0xa271('0x18e')]['trim']()||'':'',_0x34f68a['dialCutDigit']>0x0?_0x43e21a[_0xa271('0x164')][_0xa271('0x18f')](_0x34f68a[_0xa271('0x190')]):_0x43e21a[_0xa271('0x164')]):util[_0xa271('0x46')](_0xa271('0x18d'),_[_0xa271('0xf7')](_0x34f68a[_0xa271('0x8c')])?_0x34f68a[_0xa271('0x182')][_0xa271('0x47')]:_0x34f68a[_0xa271('0x8c')][_0xa271('0x47')],isNotNull(_0x34f68a[_0xa271('0x18e')])?_0x34f68a['dialPrefix']['trim']()||'':'',_0x34f68a[_0xa271('0x190')]>0x0?_0x43e21a[_0xa271('0x164')][_0xa271('0x18f')](_0x34f68a[_0xa271('0x190')]):_0x43e21a[_0xa271('0x164')]),'callerid':_0x1a8aa0,'Exten':'xcally-motion-dialer','Context':'from-sip','Priority':'1','variable':_0x16642d,'timeout':(_0x34f68a[_0xa271('0x191')]||0x1e)*0x3e8,'async':!![],'channelid':_0x168138})[_0xa271('0x40')](function(_0x4de68b){return _0x1b49e8(_0x4de68b);})[_0xa271('0xa1')](function(_0x477fbb){_0x34f68a[_0xa271('0x192')]+=0x1;var _0x57bb2f=new History(_0x4d1137[_0xa271('0x22')][_0x168138]);logger[_0xa271('0x66')](util[_0xa271('0x46')](_0xa271('0x193'),JSON[_0xa271('0xa8')](_0x477fbb)));_0x57bb2f['state']=0xe;_0x57bb2f[_0xa271('0xd4')]=_0xa271('0x194');_0x57bb2f[_0xa271('0x71')]=moment()[_0xa271('0x46')](_0xa271('0xc6'));_0x57bb2f[_0xa271('0x70')]=_0x57bb2f[_0xa271('0x71')];hopperUtils['createHistory'](_0x57bb2f)[_0xa271('0xa1')](loggerCatch(_0xa271('0x195')));_0x4d1137[_0xa271('0xcd')](_0x57bb2f)[_0xa271('0xa1')](loggerCatch(_0xa271('0x195')))[_0xa271('0x1c')](function(){delete _0x4d1137[_0xa271('0x22')][_0x168138];return _0x155baa(msgResponse('originate',_0xa271('0x84'),_0xa271('0x196')));});});});};Dialer[_0xa271('0x1a')][_0xa271('0x197')]=function(_0x561913,_0x2b05d2,_0x131865){var _0x258a57=new History(_0x2b05d2);if(_0x258a57[_0xa271('0x120')]+_0x258a57[_0xa271('0x121')]+_0x258a57[_0xa271('0x12e')]+_0x258a57[_0xa271('0x122')]+_0x258a57[_0xa271('0xd6')]+_0x258a57[_0xa271('0xeb')]+_0x258a57[_0xa271('0x11e')]+_0x258a57[_0xa271('0x123')]>=_0x131865[_0xa271('0x124')]-0x1){return!![];}switch(_0x561913){case 0x3:if(_0x258a57[_0xa271('0x12e')]>=_0x131865[_0xa271('0x198')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countnoanswerretry':_0x258a57[_0xa271('0x12e')]+=0x1,'scheduledat':moment()[_0xa271('0xee')](_0x131865[_0xa271('0x199')],'minutes')[_0xa271('0x46')](_0xa271('0xc6')),'ContactId':_0x258a57[_0xa271('0xe0')],'ListId':_0x258a57[_0xa271('0xe1')],'VoiceQueueId':_0x258a57[_0xa271('0xfe')]||undefined,'CampaignId':_0x258a57['CampaignId']||undefined})[_0xa271('0xa1')](loggerCatch(_0xa271('0x19a')));break;case 0x5:if(_0x258a57[_0xa271('0x120')]>=_0x131865['dialBusyMaxRetry']-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countbusyretry':_0x258a57[_0xa271('0x120')]+=0x1,'scheduledat':moment()[_0xa271('0xee')](_0x131865[_0xa271('0x19b')],'minutes')[_0xa271('0x46')](_0xa271('0xc6')),'ContactId':_0x258a57['ContactId'],'ListId':_0x258a57[_0xa271('0xe1')],'VoiceQueueId':_0x258a57['VoiceQueueId']||undefined,'CampaignId':_0x258a57[_0xa271('0xe2')]||undefined})[_0xa271('0xa1')](loggerCatch(_0xa271('0x19c')));break;case 0x8:if(_0x258a57['countcongestionretry']>=_0x131865[_0xa271('0x19d')]-0x1){return!![];}hopperUtils[_0xa271('0xdd')]({'active':![],'countcongestionretry':_0x258a57['countcongestionretry']+=0x1,'scheduledat':moment()[_0xa271('0xee')](_0x131865[_0xa271('0x19e')],_0xa271('0xdf'))[_0xa271('0x46')](_0xa271('0xc6')),'ContactId':_0x258a57[_0xa271('0xe0')],'ListId':_0x258a57[_0xa271('0xe1')],'VoiceQueueId':_0x258a57[_0xa271('0xfe')]||undefined,'CampaignId':_0x258a57[_0xa271('0xe2')]||undefined})[_0xa271('0xa1')](loggerCatch(_0xa271('0x19f')));break;case 0x0:if(_0x258a57[_0xa271('0x122')]>=_0x131865[_0xa271('0x1a0')]-0x1){return!![];}else{hopperUtils[_0xa271('0xdd')]({'active':![],'countnosuchnumberretry':_0x258a57['countnosuchnumberretry']+=0x1,'scheduledat':moment()[_0xa271('0xee')](_0x131865[_0xa271('0x1a1')],_0xa271('0xdf'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x258a57[_0xa271('0xe0')],'ListId':_0x258a57[_0xa271('0xe1')],'VoiceQueueId':_0x258a57[_0xa271('0xfe')]||undefined,'CampaignId':_0x258a57[_0xa271('0xe2')]||undefined})[_0xa271('0xa1')](loggerCatch(_0xa271('0x1a2')));}break;case 0xa:if(_0x258a57[_0xa271('0xd6')]>=_0x131865[_0xa271('0xda')]-0x1){return!![];}hopperUtils[_0xa271('0xdd')]({'active':![],'countdropretry':_0x258a57[_0xa271('0xd6')]+=0x1,'scheduledat':moment()['add'](_0x131865[_0xa271('0xde')],'minutes')[_0xa271('0x46')](_0xa271('0xc6')),'ContactId':_0x258a57[_0xa271('0xe0')],'ListId':_0x258a57[_0xa271('0xe1')],'VoiceQueueId':_0x258a57[_0xa271('0xfe')]||undefined,'CampaignId':_0x258a57[_0xa271('0xe2')]||undefined})[_0xa271('0xa1')](loggerCatch(_0xa271('0xe3')));break;case 0xb:if(_0x258a57[_0xa271('0xeb')]>=_0x131865[_0xa271('0x1a3')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countabandonedretry':_0x258a57[_0xa271('0xeb')]+=0x1,'scheduledat':moment()[_0xa271('0xee')](_0x131865[_0xa271('0xec')],'minutes')[_0xa271('0x46')](_0xa271('0xc6')),'ContactId':_0x258a57[_0xa271('0xe0')],'ListId':_0x258a57['ListId'],'VoiceQueueId':_0x258a57[_0xa271('0xfe')]||undefined,'CampaignId':_0x258a57['CampaignId']||undefined})[_0xa271('0xa1')](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x258a57[_0xa271('0x11e')]>=_0x131865[_0xa271('0x127')]-0x1){return!![];}hopperUtils[_0xa271('0xdd')]({'active':![],'countmachineretry':_0x258a57[_0xa271('0x11e')]+=0x1,'scheduledat':moment()[_0xa271('0xee')](_0x131865['dialMachineRetryFrequency'],_0xa271('0xdf'))[_0xa271('0x46')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x258a57[_0xa271('0xe0')],'ListId':_0x258a57[_0xa271('0xe1')],'VoiceQueueId':_0x258a57[_0xa271('0xfe')]||undefined,'CampaignId':_0x258a57['CampaignId']||undefined})[_0xa271('0xa1')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x258a57[_0xa271('0x123')]>=_0x131865['dialAgentRejectMaxRetry']-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countagentrejectretry':_0x258a57[_0xa271('0x123')]+=0x1,'scheduledat':moment()[_0xa271('0xee')](_0x131865[_0xa271('0x1a4')],_0xa271('0xdf'))[_0xa271('0x46')](_0xa271('0xc6')),'ContactId':_0x258a57[_0xa271('0xe0')],'ListId':_0x258a57['ListId'],'VoiceQueueId':_0x258a57[_0xa271('0xfe')]||undefined,'CampaignId':_0x258a57['CampaignId']||undefined})[_0xa271('0xa1')](loggerCatch(_0xa271('0x1a5')));break;default:return!![];}};Dialer[_0xa271('0x1a')][_0xa271('0x10d')]=function(_0xd56865,_0x295a0c,_0x1fa747){var _0x5c347c=this;var _0x40224e=new History(_0xd56865);var _0x263699=![];var _0x421dad;var _0x33f218;return new Promise(function(_0x236a20,_0x41145e){if(_[_0xa271('0x41')](_0x295a0c)&&typeof _0x295a0c!==_0xa271('0x162')){return _0x41145e(msgResponse('[callProgressDetecting]',_0xa271('0x92'),_0xa271('0x1a6')));}if(_['isUndefined'](_0x1fa747)&&typeof _0x1fa747!=='object'){return _0x41145e(msgResponse('[callProgressDetecting]','Failure',_0xa271('0x1a7')));}hopperUtils[_0xa271('0xd9')](_0x40224e,_0x1fa747['reason'],_0x295a0c)[_0xa271('0x40')](function(_0x3083db){if(_0x3083db[_0xa271('0xdc')]==0x1)_0x263699=!![];switch(_0x1fa747[_0xa271('0xc8')]){case'0':_0x295a0c[_0xa271('0x1a8')]+=0x1;_0x40224e[_0xa271('0x6f')]=0x0;_0x40224e['statedesc']=_0xa271('0x1a9');_0x40224e[_0xa271('0x122')]+=0x1;_0x40224e[_0xa271('0xd7')]+=0x1;ami[_0xa271('0x116')](_0xa271('0x1aa'),ut['buildObj'](_0xd56865,'nosuchnumber'));_0x421dad=_0x295a0c[_0xa271('0x1a1')];_0x33f218=_0x295a0c[_0xa271('0xd8')];hopperUtils[_0xa271('0xcb')](_0x40224e)[_0xa271('0xa1')](loggerCatch(_0xa271('0x11f')));if(_0x5c347c['checkRetriveMax'](0x0,_0xd56865,_0x295a0c)&&!_0x263699){if(_0x40224e[_0xa271('0x122')]>=_0x295a0c[_0xa271('0x1a0')]){_0x5c347c[_0xa271('0x128')](_0x40224e,_0x236a20,_0x41145e,_0xa271('0x1ab'));}else{_0x5c347c['stateGlobal'](_0x40224e,_0x236a20,_0x41145e,_0xa271('0x1ab'));}}break;case'3':_0x295a0c[_0xa271('0x1ac')]+=0x1;_0x40224e[_0xa271('0x6f')]=0x3;_0x40224e[_0xa271('0xd4')]=_0xa271('0x1ad');_0x40224e[_0xa271('0x12e')]+=0x1;_0x40224e['countglobal']+=0x1;var _0x5866e0=ut[_0xa271('0x1ae')](_0xd56865,_0x295a0c);ami[_0xa271('0x116')](_0xa271('0x1af'),_0x5866e0);_0x421dad=_0x295a0c[_0xa271('0x199')];_0x33f218=_0x295a0c['callAdditionalPhoneAfterMin'];hopperUtils[_0xa271('0xcb')](_0x40224e)[_0xa271('0xa1')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x5c347c['checkRetriveMax'](0x3,_0xd56865,_0x295a0c)&&!_0x263699){if(_0x40224e[_0xa271('0x12e')]>=_0x295a0c['dialNoAnswerMaxRetry']){_0x5c347c['createStateFinal'](_0x40224e,_0x236a20,_0x41145e,'reason\x203\x20ringing\x20no\x20answer');}else{_0x5c347c[_0xa271('0x125')](_0x40224e,_0x236a20,_0x41145e,_0xa271('0x1b0'));}}break;case'5':_0x295a0c['outboundBusyCallsDay']+=0x1;_0x40224e[_0xa271('0x6f')]=0x5;_0x40224e['statedesc']=_0xa271('0x1b1');_0x40224e[_0xa271('0x120')]+=0x1;_0x40224e['countglobal']+=0x1;ami['emit'](_0xa271('0x1b2'),ut[_0xa271('0x117')](_0xd56865,_0xa271('0x1b3')));_0x421dad=_0x295a0c[_0xa271('0x19b')];_0x33f218=_0x295a0c[_0xa271('0xd8')];hopperUtils['createHistory'](_0x40224e)[_0xa271('0xa1')](loggerCatch(_0xa271('0x1b4')));if(_0x5c347c['checkRetriveMax'](0x5,_0xd56865,_0x295a0c)&&!_0x263699){if(_0x40224e[_0xa271('0x120')]>=_0x295a0c['dialBusyMaxRetry']){_0x5c347c[_0xa271('0x128')](_0x40224e,_0x236a20,_0x41145e,_0xa271('0x1b5'));}else{_0x5c347c[_0xa271('0x125')](_0x40224e,_0x236a20,_0x41145e,_0xa271('0x1b5'));}}break;case'8':_0x295a0c[_0xa271('0x1b6')]+=0x1;_0x40224e['state']=0x8;_0x40224e[_0xa271('0xd4')]=_0xa271('0x1b7');_0x40224e[_0xa271('0x121')]+=0x1;_0x40224e[_0xa271('0xd7')]+=0x1;_0x421dad=_0x295a0c[_0xa271('0x19e')];_0x33f218=_0x295a0c[_0xa271('0xd8')];ami[_0xa271('0x116')]('custom:agentcongestion',ut['buildObj'](_0xd56865,_0xa271('0x1b8')));hopperUtils['createHistory'](_0x40224e)[_0xa271('0xa1')](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x5c347c[_0xa271('0x197')](0x8,_0xd56865,_0x295a0c)&&!_0x263699){if(_0x40224e[_0xa271('0x121')]>=_0x295a0c[_0xa271('0x19d')]){_0x5c347c[_0xa271('0x128')](_0x40224e,_0x236a20,_0x41145e,_0xa271('0x1b9'));}else{_0x5c347c[_0xa271('0x125')](_0x40224e,_0x236a20,_0x41145e,_0xa271('0x1b9'));}}break;case'11':_0x295a0c[_0xa271('0x1ba')]+=0x1;_0x40224e[_0xa271('0x6f')]=0xb;_0x40224e['statedesc']='Abandoned';_0x40224e[_0xa271('0xeb')]+=0x1;_0x40224e[_0xa271('0xd7')]+=0x1;_0x421dad=_0x295a0c[_0xa271('0xec')];_0x33f218=_0x295a0c[_0xa271('0xd8')];hopperUtils[_0xa271('0xcb')](_0x40224e)[_0xa271('0xa1')](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x5c347c[_0xa271('0x197')](0xb,_0xd56865,_0x295a0c)&&!_0x263699){if(_0x40224e['countabandonedretry']>=_0x295a0c['dialAbandonedMaxRetry']){_0x5c347c[_0xa271('0x128')](_0x40224e,_0x236a20,_0x41145e,'reason\x2011\x20abandoned');}else{_0x5c347c['stateGlobal'](_0x40224e,_0x236a20,_0x41145e,_0xa271('0x1bb'));}}break;case'20':_0x295a0c[_0xa271('0x1bc')]+=0x1;_0x40224e[_0xa271('0x6f')]=0x14;_0x40224e[_0xa271('0xd4')]='AgentReject';_0x40224e[_0xa271('0x123')]+=0x1;_0x40224e[_0xa271('0xd7')]+=0x1;_0x421dad=_0x295a0c[_0xa271('0x1a4')];_0x33f218=_0x295a0c[_0xa271('0xd8')];ami[_0xa271('0x116')](_0xa271('0x1bd'),ut[_0xa271('0x117')](_0xd56865,_0xa271('0x1be')));hopperUtils[_0xa271('0xcb')](_0x40224e)[_0xa271('0xa1')](loggerCatch(_0xa271('0x1bf')));if(_0x5c347c[_0xa271('0x197')](0x14,_0xd56865,_0x295a0c)&&!_0x263699){if(_0x40224e[_0xa271('0x123')]>=_0x295a0c[_0xa271('0x1c0')]){_0x5c347c[_0xa271('0x128')](_0x40224e,_0x236a20,_0x41145e,_0xa271('0x1c1'));}else{_0x5c347c[_0xa271('0x125')](_0x40224e,_0x236a20,_0x41145e,_0xa271('0x1c1'));}}break;default:_0x295a0c[_0xa271('0x135')]+=0x1;_0x40224e[_0xa271('0x6f')]=0xc;_0x40224e['statedesc']=_0x1fa747['reason'];_0x421dad=_0x295a0c[_0xa271('0x1a4')];_0x33f218=_0x295a0c[_0xa271('0xd8')];hopperUtils['createHistory'](_0x40224e)['catch'](loggerCatch(_0xa271('0x1c2')));if(_0x5c347c[_0xa271('0x197')](_0x1fa747[_0xa271('0xc8')],_0xd56865,_0x295a0c)&&!_0x263699){if(_0x40224e[_0xa271('0x120')]+_0x40224e['countcongestionretry']+_0x40224e[_0xa271('0x12e')]+_0x40224e[_0xa271('0x122')]+_0x40224e[_0xa271('0xd6')]+_0x40224e[_0xa271('0xeb')]+_0x40224e[_0xa271('0x11e')]+_0x40224e[_0xa271('0x123')]>=_0x295a0c['dialGlobalMaxRetry']){_0x5c347c[_0xa271('0x125')](_0x40224e,_0x236a20,_0x41145e,_0x1fa747[_0xa271('0xc8')]);}else{_0x5c347c['createStateFinal'](_0x40224e,_0x236a20,_0x41145e,_0x1fa747[_0xa271('0xc8')]);}}}})['then'](function(){if(_0x263699){hopperUtils[_0xa271('0xf1')](_0x40224e,_0x421dad,_0x33f218)['then'](function(){return _0x236a20(0x1);});}});});};Dialer[_0xa271('0x1a')][_0xa271('0x125')]=function(_0x153810,_0x41cf19,_0x1897da,_0x1cc3df){var _0x1fa0ac=new Final(_0x153810);_0x1fa0ac['state']=0xf;_0x1fa0ac[_0xa271('0xd4')]=_0xa271('0x1c3');this[_0xa271('0x128')](_0x1fa0ac,_0x41cf19,_0x1897da,_0x1cc3df);};Dialer[_0xa271('0x1a')]['createStateFinal']=function(_0x83df11,_0x25e2c6,_0x147acb,_0x4c938b){hopperUtils[_0xa271('0xcd')](_0x83df11)[_0xa271('0x40')](function(){return _0x25e2c6(msgResponse('[callProgressDetecting]','Success',_0x4c938b));})[_0xa271('0xa1')](function(){return _0x147acb(msgResponse(_0xa271('0x1c4'),'Failure',_0xa271('0x1c5')));});};Dialer[_0xa271('0x1a')][_0xa271('0x8')]=function(_0x2308a5){var _0x2e2459=_0x2308a5[_0xa271('0x1c6')]/0x64;var _0x539ede=_0x2308a5[_0xa271('0xd2')]/(_0x2308a5['outboundDropCallsDayTimeout']+_0x2308a5['outboundAnswerCallsDay']);var _0x1304f1=Math['round'](_0x2308a5[_0xa271('0x1c7')]*(_0x2308a5[_0xa271('0x1c8')]/0x64));var _0x3bc3d5=Math['round'](_0x2308a5['predictiveIntervalAvailable']*(_0x2308a5[_0xa271('0x1c9')]/0x64));var _0x183b2c=_0x2308a5[_0xa271('0x13c')]+_0x2308a5[_0xa271('0x1ca')];var _0x2faff5=Math[_0xa271('0x1cb')](_0x2308a5[_0xa271('0x1cc')]*_0x2308a5[_0xa271('0x5e')]*_0x2308a5[_0xa271('0x1cd')]*_0x2308a5[_0xa271('0x1ce')]);if(_[_0xa271('0x41')](_0x2308a5[_0xa271('0x27')])){if(!_[_0xa271('0x41')](_0x2308a5[_0xa271('0x26')])){_0x2308a5['startPredictive']=undefined;loggerPredictive['error'](_0xa271('0x1cf'),_0xa271('0x1d0'));}if(!_[_0xa271('0x41')](_0x2308a5[_0xa271('0x64')])){loggerPredictive[_0xa271('0x66')](_0xa271('0x1cf'),_0xa271('0x1d1'));clearInterval(_0x2308a5[_0xa271('0x64')]);_0x2308a5['handlePredictive']=undefined;}_0x2308a5[_0xa271('0x27')]=moment()[_0xa271('0x46')](_0xa271('0xc6'));loggerPredictive['info'](_0x2308a5['name'],'collection\x20data\x20in\x20progressive\x20at',_0x2308a5['startProgressive']);this[_0xa271('0xb3')](_0x2308a5,0x1);}else if(ifInterval(_0x2308a5[_0xa271('0x1d2')],_0x2308a5[_0xa271('0x27')])){this[_0xa271('0xb3')](_0x2308a5,0x1);loggerPredictiveCalls[_0xa271('0x4a')](_0xa271('0x1d3'),_0x2308a5[_0xa271('0x27')],_0x2308a5[_0xa271('0x47')]);_0x2308a5[_0xa271('0x1cc')]=0x0;_0x2308a5[_0xa271('0xd3')]=0x0;}else if(_0x2e2459<_0x539ede&&_0x2308a5[_0xa271('0x1d4')]===_0xa271('0x1d5')){clearPredictiveAttributes(_0x2308a5);loggerPredictive[_0xa271('0x4a')](_0xa271('0x1d6'),_0xa271('0x1d7'),_0x539ede,_0xa271('0x27'),_0x2308a5['name']);}else if(_0x2faff5<_0x2308a5[_0xa271('0xd3')]&&_0x2308a5['dialPredictiveOptimization']===_0xa271('0x1d5')){clearPredictiveAttributes(_0x2308a5);loggerPredictive[_0xa271('0x4a')]('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0xa271('0x1d8'),_0x2faff5,_0xa271('0x1d9'),_0x2308a5[_0xa271('0xd3')],'startProgressive',_0x2308a5[_0xa271('0x47')]);}else if(!ifInterval(_0x2308a5[_0xa271('0x1d2')],_0x2308a5[_0xa271('0x27')])&&_[_0xa271('0x41')](_0x2308a5[_0xa271('0x26')])&&!_['isUndefined'](_0x2308a5[_0xa271('0x27')])){_0x2308a5[_0xa271('0x26')]=moment()[_0xa271('0x46')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x2308a5['name'],_0xa271('0x1da'),_0x2308a5[_0xa271('0x26')]);hopperUtils['avgHandleTime'](_0x2308a5[_0xa271('0x1d2')])[_0xa271('0x40')](this[_0xa271('0x1db')](_0x2308a5))[_0xa271('0x40')](mergeDataErlangB(_0x2308a5))[_0xa271('0x40')](this[_0xa271('0x1dc')](_0x2308a5))['catch'](loggerCatchPredictive(_0xa271('0x1dd'),_0x2308a5));}else if(!ifInterval(_0x2308a5[_0xa271('0x1d2')],_0x2308a5[_0xa271('0x26')])){_0x2308a5[_0xa271('0xd3')]=0x0;_0x2308a5[_0xa271('0x26')]=moment()[_0xa271('0x46')](_0xa271('0xc6'));loggerPredictive[_0xa271('0x4a')](_0x2308a5[_0xa271('0x47')],_0xa271('0x1de'),_0x2308a5['startPredictive']);clearInterval(_0x2308a5['handlePredictive']);_0x2308a5[_0xa271('0x64')]=undefined;hopperUtils[_0xa271('0x1df')](_0x2308a5[_0xa271('0x1d2')])[_0xa271('0x40')](this[_0xa271('0x1db')](_0x2308a5))[_0xa271('0x40')](mergeDataErlangB(_0x2308a5))[_0xa271('0x40')](this[_0xa271('0x1dc')](_0x2308a5))[_0xa271('0xa1')](loggerCatchPredictive(_0xa271('0x1e0'),_0x2308a5));}else if(_0x2308a5[_0xa271('0x1c7')]&&_0x183b2c<_0x2308a5[_0xa271('0x1c7')]-_0x3bc3d5){clearPredictiveAttributes(_0x2308a5);loggerPredictive[_0xa271('0x4a')](_0x2308a5[_0xa271('0x47')],_0xa271('0x1e1'),_0x183b2c,_0xa271('0x1e2'),_0x2308a5[_0xa271('0x1c7')],'-',_0x3bc3d5,'=',_0x2308a5[_0xa271('0x1c7')]-_0x3bc3d5,')');}else if(_0x2308a5[_0xa271('0x1c7')]&&_0x183b2c>_0x2308a5['predictiveIntervalAvailable']+_0x1304f1){clearPredictiveAttributes(_0x2308a5);loggerPredictive['info'](_0x2308a5[_0xa271('0x47')],_0xa271('0x1e1'),_0x183b2c,_0xa271('0x1e3'),_0x2308a5[_0xa271('0x1c7')],'+',_0x1304f1,'=',_0x2308a5['predictiveIntervalAvailable']+_0x1304f1,')');}};Dialer['prototype'][_0xa271('0x1db')]=function(_0x34b18b){var _0x1bdd60=this;return function(_0x3cf2d8){return new Promise(function(_0xf329e,_0x46287d){_[_0xa271('0x60')](_0x34b18b,_0x3cf2d8[0x0]);if(checkGetDataPredictive(_0x3cf2d8[0x0])){var _0x54da19=_0x34b18b['predictiveIntervalAvailable']=_0x34b18b[_0xa271('0x1ca')]+_0x34b18b[_0xa271('0x13c')];var _0x3e76f4=_0x34b18b['dialPredictiveInterval']*0x3c;var _0x3b3252=_0x3cf2d8[0x0][_0xa271('0x54')]+_0x3cf2d8[0x0][_0xa271('0x52')];var _0x3d730c=(_0x3cf2d8[0x0][_0xa271('0x4d')]+_0x3cf2d8[0x0][_0xa271('0xd1')]+_0x3cf2d8[0x0][_0xa271('0x50')])/_0x3cf2d8[0x0][_0xa271('0x56')];_0x34b18b[_0xa271('0x1cd')]=_0x3d730c>0x0?_0x3d730c:0x1;switch(_0x34b18b[_0xa271('0x1d4')]){case'dropRate':var _0x3955f5=_0x34b18b['dialPredictiveOptimizationPercentage']/0x64;return _0x1bdd60[_0xa271('0x1e4')](_0x54da19,_0x3e76f4,_0x3b3252,_0x3d730c,_0x3955f5)[_0xa271('0x40')](function(_0x4286b7){return _0xf329e(_0x4286b7);});case _0xa271('0x1e5'):var _0x3beab5=_0x34b18b[_0xa271('0x1c6')]/0x64;return _0x1bdd60[_0xa271('0x1e6')](_0x54da19,_0x3e76f4,_0x3b3252,_0x3d730c,_0x3beab5)[_0xa271('0x40')](function(_0x2b53f3){return _0xf329e(_0x2b53f3);});default:return _0x46287d(msgResponse(_0xa271('0x1e7'),_0xa271('0x92'),_0xa271('0x1e8')));}}else{return _0x46287d(msgResponse(_0xa271('0x1e7'),'Failure',_0xa271('0x1e9')));}});};};Dialer[_0xa271('0x1a')][_0xa271('0x1ea')]=function(_0x4cb2d1){var _0x441a88=this;return function(_0x5b2625){return new Promise(function(_0x50ddc6,_0x3fbd84){_[_0xa271('0x60')](_0x4cb2d1,_0x5b2625[0x0]);if(checkGetDataPredictive(_0x5b2625[0x0])){loggerPredictive[_0xa271('0x4a')](JSON[_0xa271('0xa8')](_0x5b2625[0x0]));if(_0x4cb2d1['dialPredictiveOptimization']===_0xa271('0x1d5')){return _0x441a88[_0xa271('0x154')](_0x4cb2d1['id'])[_0xa271('0x40')](function(_0x36a78c){var _0x10a721=_0x4cb2d1['loggedIn']-_0x36a78c[0x0]['outboundQueuePauses'];var _0x11de22=_0x4cb2d1[_0xa271('0x1d2')]*0x3c;var _0x2199ab=_0x5b2625[0x0][_0xa271('0x54')]+_0x5b2625[0x0][_0xa271('0x52')];var _0x404796=(_0x5b2625[0x0][_0xa271('0x4d')]+_0x5b2625[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x5b2625[0x0][_0xa271('0x50')])/_0x5b2625[0x0]['predictiveIntervalTotalCalls'];var _0x14e3d6=_0x4cb2d1[_0xa271('0x1c6')]/0x64;_0x4cb2d1['predictiveIntervalPauses']=_0x36a78c[0x0][_0xa271('0x1eb')]||0x0;_0x4cb2d1['predictiveIntervalHitRate']=_0x404796>0x0?_0x404796:0x1;return _0x441a88['abandonmentRate'](_0x10a721,_0x11de22,_0x2199ab,_0x404796,_0x14e3d6);})[_0xa271('0x40')](function(_0x448704){return _0x50ddc6(_0x448704);})['catch'](function(_0x2059b0){return _0x3fbd84(msgResponse('[CatchErlangB]','Failure',JSON[_0xa271('0xa8')](_0x2059b0)));});}if(_0x4cb2d1[_0xa271('0x1d4')]===_0xa271('0x1e5')){return _0x441a88[_0xa271('0x154')](_0x4cb2d1['id'])['then'](function(_0x4c0035){var _0x1567f5=_0x4cb2d1[_0xa271('0x1ec')]-_0x4c0035[0x0][_0xa271('0x1eb')];var _0x17e672=_0x4cb2d1['dialPredictiveInterval']*0x3c;var _0x36f1ea=_0x5b2625[0x0][_0xa271('0x54')]+_0x5b2625[0x0][_0xa271('0x52')];var _0x50a8c0=(_0x5b2625[0x0][_0xa271('0x4d')]+_0x5b2625[0x0][_0xa271('0xd1')]+_0x5b2625[0x0][_0xa271('0x50')])/_0x5b2625[0x0][_0xa271('0x56')];var _0x1dab5d=_0x4cb2d1[_0xa271('0x1c6')]/0x64;_0x4cb2d1['predictiveIntervalPauses']=_0x4c0035[0x0][_0xa271('0x1eb')]||0x0;_0x4cb2d1[_0xa271('0x1cd')]=_0x50a8c0>0x0?_0x50a8c0:0x1;return _0x441a88[_0xa271('0x1e6')](_0x1567f5,_0x17e672,_0x36f1ea,_0x50a8c0,_0x1dab5d);})[_0xa271('0x40')](function(_0x221c86){return _0x50ddc6(_0x221c86);})[_0xa271('0xa1')](function(_0x2aa50e){return _0x3fbd84(msgResponse(_0xa271('0x1ed'),'Failure',JSON[_0xa271('0xa8')](_0x2aa50e)));});}}else{return _0x3fbd84(msgResponse(_0xa271('0x1e7'),_0xa271('0x92'),_0xa271('0x1e9')));}});};};Dialer[_0xa271('0x1a')][_0xa271('0x1dc')]=function(_0x58a01){var _0x527dd2=this;return function(){var _0x2c8d8b=0x0;var _0x3c72e1=Math['floor'](_0x58a01[_0xa271('0x5c')]*0x3e8);if(_0x3c72e1>0x0){_0x3c72e1=_0x3c72e1<0x64?0x64:_0x3c72e1;loggerPredictive[_0xa271('0x4a')](_0x58a01[_0xa271('0x47')],'one\x20call\x20every:',_0x3c72e1,_0xa271('0x1ee'));_0x58a01['handlePredictive']=setInterval(function(){_0x527dd2['handlePredictive'](_0x58a01);loggerPredictiveCalls['info'](_0xa271('0x1ef'),_0x2c8d8b+=0x1);},_0x3c72e1);}else{loggerPredictive['info'](_0x58a01[_0xa271('0x47')],_0xa271('0x1f0'));}};};Dialer['prototype'][_0xa271('0x1f1')]=function(_0x222498,_0x400df0){var _0x4a5379=this;return function(_0x3bfba5){if(_[_0xa271('0x49')](_0x3bfba5)){if(_[_0xa271('0xf7')](_0x400df0['UserId'])||!_0x400df0[_0xa271('0x1f2')]){if(_0x222498[_0xa271('0xb2')]===_0xa271('0xb5')){_0x222498[_0xa271('0x72')]=_[_0xa271('0x41')](_0x222498[_0xa271('0x72')])?!![]:_0x222498[_0xa271('0x72')];var _0x2589d9=uuid['v4']();_0x4a5379['actions'][_0x2589d9]=new Action(_0x222498,_0x400df0,_0x2589d9);loggerBooked['info'](_0xa271('0x1f3'),_0x2589d9,_0xa271('0x1f4'),JSON[_0xa271('0xa8')](_0x222498[_0xa271('0x72')]),_0xa271('0x1f5'),_0x222498['name']);if(_0x222498[_0xa271('0x72')]){_0x222498[_0xa271('0x72')]=![];_0x4a5379[_0xa271('0x29')][_0x4a5379[_0xa271('0x22')][_0x2589d9][_0xa271('0xc1')]]=[];ami['Action']({'actionid':_0x2589d9,'action':_0xa271('0x1f6'),'queue':_0x222498[_0xa271('0x47')]})[_0xa271('0xa1')](function(){_0x4a5379[_0xa271('0xc4')](_0x222498);hopperUtils[_0xa271('0xdd')]({'active':![],'ContactId':_0x4a5379[_0xa271('0x22')][_0x2589d9][_0xa271('0xe0')],'ListId':_0x4a5379[_0xa271('0x22')][_0x2589d9][_0xa271('0xe1')],'VoiceQueueId':_0x4a5379['actions'][_0x2589d9][_0xa271('0xfe')]||undefined,'CampaignId':_0x4a5379[_0xa271('0x22')][_0x2589d9]['CampaignId']||undefined})['catch'](loggerCatch(_0xa271('0x1f7')));delete _0x4a5379[_0xa271('0x22')][_0x2589d9];});}else{loggerBooked['info'](_0xa271('0x1f8'),JSON[_0xa271('0xa8')](_0x222498[_0xa271('0x72')]),_0xa271('0x1f5'),_0x222498[_0xa271('0x47')]);_0x4a5379[_0xa271('0xc4')](_0x222498);hopperUtils[_0xa271('0xdd')]({'active':![],'ContactId':_0x4a5379[_0xa271('0x22')][_0x2589d9][_0xa271('0xe0')],'ListId':_0x4a5379['actions'][_0x2589d9][_0xa271('0xe1')],'VoiceQueueId':_0x4a5379[_0xa271('0x22')][_0x2589d9]['VoiceQueueId']||undefined,'CampaignId':_0x4a5379[_0xa271('0x22')][_0x2589d9][_0xa271('0xe2')]||undefined})[_0xa271('0xa1')](loggerCatch(_0xa271('0x1f7')));delete _0x4a5379[_0xa271('0x22')][_0x2589d9];}}else{return _0x4a5379[_0xa271('0x1f9')](_0x222498,_0x400df0);}}else{if(utils[_0xa271('0x61')](undefined,_0x400df0['scheduledat'])<_0x222498[_0xa271('0x1fa')]*0x3c){if(_0x400df0[_0xa271('0x149')]&&!_0x400df0[_0xa271('0x149')][_0xa271('0x1fb')]){_0x4a5379[_0xa271('0x1d')][_0xa271('0xfc')](_0x400df0['id'])[_0xa271('0x1c')](function(){_0x4a5379[_0xa271('0xc4')](_0x222498);});}else{hopperUtils['unlockContact']({'active':![]},_0x400df0['id'],0x1)[_0xa271('0x1c')](function(){_0x4a5379[_0xa271('0xc4')](_0x222498);});}}else{_0x222498['outboundReCallsDay']+=0x1;_0x4a5379[_0xa271('0xc4')](_0x222498);if(_0x222498[_0xa271('0x1fc')]){hopperUtils['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x400df0['ContactId'],'ListId':_0x400df0[_0xa271('0xe1')],'VoiceQueueId':_0x400df0['VoiceQueueId']||undefined,'CampaignId':_0x400df0[_0xa271('0xe2')]||undefined})['catch'](loggerCatch(_0xa271('0x1fd')));hopperUtils[_0xa271('0xcb')](createObjHistory(_0x222498,_0x400df0,utils[_0xa271('0x6a')][_0xa271('0x1fe')],0x17,'RecallInQueue'))[_0xa271('0xa1')](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x4a5379[_0xa271('0x12c')](createObjHistory(_0x222498,_0x400df0,utils[_0xa271('0x6a')][_0xa271('0x1ff')],0x16,_0xa271('0x200')),_0xa271('0x201'),_0xa271('0x202'));}}}}else{_0x222498['outboundBlacklistCallsDay']+=0x1;_0x4a5379[_0xa271('0x12c')](createObjHistory(_0x222498,_0x400df0,utils[_0xa271('0x6a')][_0xa271('0x203')],0xd,'Blacklist'),_0xa271('0x204'),_0xa271('0x205'));throw'inBlackList';}};};Dialer[_0xa271('0x1a')][_0xa271('0x161')]=function(_0x2deded){var _0x39d60b=this;var _0x198379=_0x2deded[_0xa271('0x206')]-_0x2deded[_0xa271('0x156')];emitCampaignSummary(_0x2deded);if(_0x198379>0x0&&_0x2deded['temp']==0x0){if(_0x198379>this['maxNumberOriginate']){_0x198379=this[_0xa271('0x21')];}_0x2deded[_0xa271('0x68')]=0x1;hopperUtils['getContactDialerIvr'](_0x2deded,_0x198379)[_0xa271('0x40')](function(_0x48f671){_0x2deded[_0xa271('0x68')]=0x0;if(_0x48f671){if(!utils[_0xa271('0x207')](_0x48f671)){_0x2deded[_0xa271('0x69')]=utils[_0xa271('0x6a')][_0xa271('0x6d')];logger[_0xa271('0x4a')](_0xa271('0x208')+_0x2deded[_0xa271('0x47')]);}else{_0x2deded['originated']+=_0x48f671['length'];_0x2deded[_0xa271('0x69')]=utils[_0xa271('0x6a')][_0xa271('0x209')];for(var _0x1b39c9=0x0;_0x1b39c9<_0x48f671[_0xa271('0x100')];_0x1b39c9+=0x1){_0x2deded[_0xa271('0x20a')]+=0x1;if(_['isNil'](_0x48f671[_0x1b39c9])||_[_0xa271('0xf7')](_0x48f671[_0x1b39c9][_0xa271('0x181')])||_['isNil'](_0x48f671[_0x1b39c9][_0xa271('0x164')])){_0x39d60b[_0xa271('0x15a')](_0xa271('0x20b'),_0x2deded,_0x48f671[_0x1b39c9]);}else{hopperUtils[_0xa271('0x20c')](_[_0xa271('0x75')](_0x48f671[_0x1b39c9],[_0xa271('0xe2'),_0xa271('0x164')]))['then'](_0x39d60b['checkContactBlack'](_0x2deded,_0x48f671[_0x1b39c9]))['catch'](_0x39d60b['loggerHandler'](_0xa271('0x20d'),_0x2deded));}}}}})[_0xa271('0xa1')](loggerGetContactDialer('[getContactCampaign2]',_0x2deded,_0x198379));}};Dialer[_0xa271('0x1a')][_0xa271('0xb3')]=function(_0x122189,_0x588def){var _0x45dcf0=this;var _0x13e09e=[];if(_0x588def<0x1||_0x122189[_0xa271('0xb2')]==='booked'){_0x588def=0x1;}var _0x43e7e5=Math['floor'](_0x122189[_0xa271('0x13c')]*_0x588def)-_0x122189[_0xa271('0x156')];if(_0x122189[_0xa271('0x20e')]>0x0){var _0x33e8e1=_0x122189[_0xa271('0x20e')]-_0x122189['originated']-_0x122189[_0xa271('0x1ca')]-_0x122189[_0xa271('0x20f')];if(_0x43e7e5>_0x33e8e1){_0x43e7e5=_0x33e8e1;}}if(_0x43e7e5>0x0&&_0x122189[_0xa271('0x68')]==0x0){if(_0x122189['dialMethod']===_0xa271('0xb5')){_0x43e7e5=0x1;}if(_0x43e7e5>this['maxNumberOriginate']){_0x43e7e5=this[_0xa271('0x21')];}for(var _0x469fbe in this[_0xa271('0x1f')]){if(typeof this[_0xa271('0x1f')][_0x469fbe]!==_0xa271('0xab')){if(this[_0xa271('0x1f')][_0x469fbe][_0xa271('0x6f')]===_0xa271('0x210')&&this[_0xa271('0x1f')][_0x469fbe][_0xa271('0x88')]==='reachable'){_0x13e09e[_0xa271('0x9a')](this[_0xa271('0x1f')][_0x469fbe]['id']);}}}_0x122189[_0xa271('0x68')]=0x1;hopperUtils[_0xa271('0x211')](_0x122189,_0x13e09e,_0x43e7e5)[_0xa271('0x40')](function(_0x28eaa5){_0x122189['temp']=0x0;if(_0x28eaa5){if(!utils[_0xa271('0x207')](_0x28eaa5)){hopperUtils[_0xa271('0x212')](_0x122189)[_0xa271('0x40')](sendMessageReschedule(_0x122189))[_0xa271('0xa1')](loggerCatch(_0xa271('0x213')));}else{_0x122189['originated']+=_0x28eaa5['length'];_0x122189['message']=_0x122189[_0xa271('0xb2')]==='booked'?utils[_0xa271('0x6a')][_0xa271('0x13e')]:utils[_0xa271('0x6a')][_0xa271('0x209')];for(var _0x400196=0x0;_0x400196<_0x28eaa5[_0xa271('0x100')];_0x400196+=0x1){if(_[_0xa271('0xf7')](_0x28eaa5[_0x400196])||_[_0xa271('0xf7')](_0x28eaa5[_0x400196][_0xa271('0x181')])||_['isNil'](_0x28eaa5[_0x400196][_0xa271('0x164')])){_0x45dcf0['emptyContact'](_0xa271('0x20b'),_0x122189,_0x28eaa5[_0x400196]);}else{hopperUtils[_0xa271('0x214')](_[_0xa271('0x75')](_0x28eaa5[_0x400196],[_0xa271('0xfe'),_0xa271('0x164')]))[_0xa271('0x40')](_0x45dcf0['checkContactBlack'](_0x122189,_0x28eaa5[_0x400196]))[_0xa271('0xa1')](_0x45dcf0['loggerHandler']('[actionOriginate]\x20',_0x122189));}}}}})[_0xa271('0xa1')](loggerGetContactDialer('[getContactDialer2]',_0x122189,_0x43e7e5));}};Dialer[_0xa271('0x1a')][_0xa271('0x64')]=function(_0x198713){if(_0x198713[_0xa271('0x20e')]>0x0){var _0x2acf60=_0x198713[_0xa271('0x20e')]-_0x198713[_0xa271('0x156')]-_0x198713[_0xa271('0x1ca')];if(_0x2acf60>0x0&&_0x198713[_0xa271('0x68')]==0x0){this[_0xa271('0x215')](_0x198713);}else{loggerPredictiveCalls[_0xa271('0x4a')]('[handlePredictive][limitChannel]');}}else{this[_0xa271('0x215')](_0x198713);}};Dialer[_0xa271('0x1a')][_0xa271('0x215')]=function(_0x5a7458){var _0x15ad55=this;var _0x1083c2=[];_0x5a7458['originated']+=0x1;for(var _0x4f14c3 in this[_0xa271('0x1f')]){if(typeof this[_0xa271('0x1f')][_0x4f14c3]!==_0xa271('0xab')){if(this[_0xa271('0x1f')][_0x4f14c3]['state']==='not_inuse'&&this['agents'][_0x4f14c3]['status']===_0xa271('0x89')){_0x1083c2[_0xa271('0x9a')](this['agents'][_0x4f14c3]['id']);}}}_0x5a7458['temp']=0x1;return this['getContactDialer'](_0x5a7458['id'],_0x1083c2,0x1,_0x5a7458[_0xa271('0x216')],_0x5a7458)[_0xa271('0x40')](function(_0x3e23ec){_0x5a7458[_0xa271('0x68')]=0x1;if(_0x3e23ec){if(!utils[_0xa271('0x207')](_0x3e23ec)){utils[_0xa271('0x67')](_0x5a7458,0x1,0x0);return hopperUtils[_0xa271('0x212')](_0x5a7458)[_0xa271('0x40')](sendMessageReschedule(_0x5a7458))[_0xa271('0xa1')](loggerCatch(_0xa271('0x213')));}else{_0x5a7458['message']=utils[_0xa271('0x6a')]['RUNNING'];if(_[_0xa271('0xf7')](_0x3e23ec[0x0])||_[_0xa271('0xf7')](_0x3e23ec[0x0][_0xa271('0x181')])||_[_0xa271('0xf7')](_0x3e23ec[0x0][_0xa271('0x164')])){_0x15ad55[_0xa271('0x15a')](_0xa271('0x20b'),_0x5a7458,_0x3e23ec[0x0]);}else{return hopperUtils[_0xa271('0x214')](_[_0xa271('0x75')](_0x3e23ec[0x0],['VoiceQueueId',_0xa271('0x164')]))[_0xa271('0x40')](_0x15ad55[_0xa271('0x1f1')](_0x5a7458,_0x3e23ec[0x0]))[_0xa271('0xa1')](_0x15ad55['loggerHandler'](_0xa271('0x217'),_0x5a7458));}}}})['catch'](loggerGetContactDialer(_0xa271('0x218'),_0x5a7458,0x1));};Dialer['prototype'][_0xa271('0x1e4')]=function(_0x5b8de5,_0x14aa4c,_0x54689a,_0x813db4,_0x33dade,_0x407c62){loggerPredictive[_0xa271('0x4a')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0xa271('0x4a')]('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',_0x5b8de5);loggerPredictive[_0xa271('0x4a')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x14aa4c);loggerPredictive[_0xa271('0x4a')]('Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x54689a);loggerPredictive['info']('P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x813db4);loggerPredictive[_0xa271('0x4a')](_0xa271('0x219'),_0x33dade);loggerPredictive[_0xa271('0x4a')]('---------------------------');return new Promise(function(_0x3413bb,_0x44d048){if(_0x5b8de5<=0x0||isNaN(_0x5b8de5)){return _0x44d048(msgResponse(_0xa271('0x21a'),'Error',_0xa271('0x21b')+_0x5b8de5));}if(_0x54689a<=0x0||isNaN(_0x54689a)){return _0x44d048(msgResponse(_0xa271('0x21a'),_0xa271('0x84'),_0xa271('0x21c')+_0x54689a));}if(_0x813db4<=0x0||isNaN(_0x813db4)){return _0x44d048(msgResponse('[abandonmentRate]','Error',_0xa271('0x21d')+_0x813db4));}if(_0x14aa4c<=0x0||isNaN(_0x14aa4c)){return _0x44d048(msgResponse(_0xa271('0x21a'),_0xa271('0x84'),_0xa271('0x21e')+_0x14aa4c));}if(_0x33dade<=0x0||isNaN(_0x33dade)){return _0x44d048(msgResponse(_0xa271('0x21a'),_0xa271('0x84'),'Amax\x20=\x20'+_0x33dade));}_0x407c62=_0x407c62||0x0;var _0x5c4695=0x1/_0x54689a;var _0x52a5a4=0x0;var _0x19be44=0x0;var _0x5a7953=0x0;var _0x3ec706=0x0;for(var _0x569251=0x0;_0x5a7953<_0x33dade;_0x569251+=0x1){_0x19be44=_0x569251/_0x14aa4c;_0x52a5a4=(_0x813db4*_0x19be44+_0x407c62)/_0x5c4695;_0x5a7953=utils[_0xa271('0x21f')](_0x52a5a4,_0x5b8de5);_0x3ec706=_0x52a5a4/_0x5b8de5*(0x1-utils[_0xa271('0x21f')](_0x52a5a4,_0x5b8de5));}return _0x3413bb({'erlangCalls':_0x569251,'erlangCallToSecond':_0x14aa4c/_0x569251,'erlangAbandonmentRate':_0x5a7953,'erlangBusyFactor':_0x3ec706});});};Dialer[_0xa271('0x1a')][_0xa271('0x1e6')]=function(_0x106cd7,_0x3253cb,_0x1c4979,_0x55353e,_0x3c2cfd,_0x5ba578){loggerPredictive[_0xa271('0x4a')](_0xa271('0x220'));loggerPredictive[_0xa271('0x4a')](_0xa271('0x221'),_0x106cd7);loggerPredictive[_0xa271('0x4a')](_0xa271('0x222'),_0x3253cb);loggerPredictive[_0xa271('0x4a')](_0xa271('0x223'),_0x1c4979);loggerPredictive[_0xa271('0x4a')](_0xa271('0x224'),_0x55353e);loggerPredictive[_0xa271('0x4a')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3c2cfd);loggerPredictive[_0xa271('0x4a')](_0xa271('0x55'));return new Promise(function(_0x1a285c,_0x584111){if(_0x106cd7<=0x0||isNaN(_0x106cd7)){return _0x584111(msgResponse(_0xa271('0x225'),_0xa271('0x84'),'m\x20=\x20'+_0x106cd7));}if(_0x1c4979<=0x0||isNaN(_0x1c4979)){return _0x584111(msgResponse(_0xa271('0x225'),'Error','Ts\x20=\x20'+_0x1c4979));}if(_0x55353e<=0x0||isNaN(_0x55353e)){return _0x584111(msgResponse(_0xa271('0x225'),_0xa271('0x84'),_0xa271('0x21d')+_0x55353e));}if(_0x3253cb<=0x0||isNaN(_0x3253cb)){return _0x584111(msgResponse(_0xa271('0x225'),_0xa271('0x84'),'interval\x20=\x20'+_0x3253cb));}if(_0x3c2cfd<=0x0||isNaN(_0x3c2cfd)){return _0x584111(msgResponse('[busyFactor]',_0xa271('0x84'),_0xa271('0x226')+_0x3c2cfd));}_0x5ba578=_0x5ba578||0x0;var _0x2fe4c9=0x1/_0x1c4979;var _0xae9e4a=0x0;var _0x235328=0x0;var _0x288cb4=0x0;var _0x21d477=0x0;for(var _0x535430=0x0;_0x21d477<_0x3c2cfd;_0x535430+=0x1){_0x235328=_0x535430/_0x3253cb;_0xae9e4a=(_0x55353e*_0x235328+_0x5ba578)/_0x2fe4c9;_0x288cb4=utils[_0xa271('0x21f')](_0xae9e4a,_0x106cd7);_0x21d477=_0xae9e4a/_0x106cd7*(0x1-utils[_0xa271('0x21f')](_0xae9e4a,_0x106cd7));}return _0x1a285c({'erlangCalls':_0x535430,'erlangCallToSecond':_0x3253cb/_0x535430,'erlangAbandonmentRate':_0x288cb4,'erlangBusyFactor':_0x21d477});});};module[_0xa271('0x227')]=Dialer; \ No newline at end of file +var _0xe635=['erlangAbandonmentRate','merge','getSeconds','startProgressive','startProgressive\x20value\x20cleared','startPredictive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','stack','temp','contactsRescheduled','message','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','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:ivr:%s','campaign:save','sendMessageOneNotActive','originated','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20disactive','isTrunkReachable','active','format','SIP/%s','status','reachable','unmonitored','checkIsTrunkReachable','Trunk','TrunkBackup','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTimeIvr','ifTime','Failure','\x20Intervals\x20is\x20empty\x20','timezones','\x20Timezone\x20unknow\x20','isArray','length','push','Action','command','iftime\x20%s,%s','interval','content','indexOf','true','catch','all','OVERTIME_GLOBAL_INTERVAL','OVERTIME_INTERVAL','[ifTime][promiseAll]','\x20Interval\x20is\x20overtime:\x20','loopCampaigns','resetActiveCalls','undefined','resolve','dialTimezone','checkIfTimeIntervals','launchHandleIvr','[syncCampaigns]','dialMethod','progressive','handlePower','predictive','Queue','method\x20not\x20recognized','dialGlobalInterval','silly','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','intervalIftime','Global:\x20','Timezone:\x20','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','isGlobal','AMI\x20IfTime','[ifTime][Action]','Error','uniqueid','ivr','updateOriginated','queue','answertime','YYYY-MM-DD\x20HH:mm:ss','syncAgentComplete','outboundAnswerCallsDay','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','createHistory','moveContactManagedDialer','droptime','responsetime','dialQueueTimeout','predictiveIntervalDroppedCallsTimeout','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','TIMEOUT','countglobal','dialDropRetryFrequency','callAdditionalPhoneAfterMin','verifyAdditionalPhones','additional','countdropretry','queueCallerAbandonCreateState','rescheduleContact','add','minutes','ContactId','ListId','VoiceQueueId','[rescheduleContact][Drop]','calleridname','calleridnum','swapAdditionalPhones','outboundDropCallsDayCallersExit','Abandoned','dropreason','dialAbandonedRetryFrequency','voiceQueue','countabandonedretry','dialAbandonedMaxRetry','CampaignId','[syncAgentComplete][createHistory][11]','actions','channel','actionid','strategy','rrmemory','isNil','locked','paused','stateinterface','idHopper','roundrobin','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','contactAgent-idHopper:\x20','Agent:\x20','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','syncOriginateResponse','response','Success','callProgressDetecting','variable','xcally-motion-dialer','dialAMDActive','value','HANGUP','outboundAnswerAgiCallsDay','HangupInAMD','membername','AMD','emit','custom:amd','buildObj','amd','saveInDb','[syncHangupInAMD][createHistory]','MACHINE','countmachineretry','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','stateGlobal','reason19\x20machine....','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','Machine','countnosuchnumberretry','dialMachineMaxRetry','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','AnswerAGI','AGI','dialQueueProject','cause-txt','running','isPreviewCampaign','getQueueCampaignStatusMessage','statusMessage','available','inUse','pTalking','ACTIVE','checkDialMethod','[syncQueueSummary]','compareToOutboundQueue','queueSummaryCountersUpdated','updateReportFromOutboundQueue','assign','throttle','filter','dialPreviewRecallmeReminder','online','handlePreviewRecallNotifications','map','Agent','user:%s','user:dialPreviewRecallReminder','checkPreviewRecallReminder','clearZombieChannels','[uniqueid]','No\x20such\x20channel','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','[syncAgentComplete][createHistory]','[syncQueueCallerAbandon]\x20[Drop]','actionOriginate','object','phone','originate','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','isOutboundQueue','\x22%s,%s%s,,,%s\x22','dialQueueOptions','XMD-AMDINITIALSILENCE','XMD-AMDGREETING','dialAMDGreeting','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','XMD-CAMPAIGNID','Contact','getCallerId','callerid','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','extractCalleridName','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','outboundOriginateFailureCallsDay','[originate][error]','originate\x20action\x20Error','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialDropMaxRetry','[rescheduleContact][Abandoned]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','dialNoSuchNumberRetryFrequency','checkRetriveMax','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','busy','dialBusyRetryFrequency','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','outboundUnknownCallsDay','[syncAgentComplete][createHistory][?]','dialGlobalMaxRetry','Global','[moveContactManagedDialer][0]','round','predictiveIntervalMaxThreshold','predictiveIntervalAvailable','predictiveIntervalMinThreshold','talking','floor','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dropRate','Max\x20Drop\x20','started\x20in\x20predictive\x20at','avgHandleTime','getDataPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','startMethodPredictive','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','dialPredictiveOptimizationPercentage','abandonmentRate','[getDataPredictive]','check\x20failure','getDataPredictiveOld','loggedIn','outboundQueuePauses','[CatchErlangB]','agentBusyFactor','predictiveIntervalPauses','busyFactor','one\x20call\x20every:','milliseconds','checkContactBlack','UserId','queueStatusComplete:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','Queue:\x20','dialRecallMeTimeout','voicePause','unlockContact','outboundReCallsDay','dialRecallInQueue','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALL_TIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][historyBlacklist]','inBlackList','[getContactCampaign2][Empty]','RUNNING','checkIsBlackListIvr','[actionOriginateIvr]\x20','dialLimitQueue','getContactDialer','countReScheduled','[countReScheduled]\x20','[actionOriginate]\x20','checkIsBlackList','[getContactDialer2]','[handlePredictive][limitChannel]','tryOriginatePredictive','not_inuse','checkContactEmpty','checkContactLowerLimitOriginate','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','erlangb','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Umin\x20=\x20','exports','util','uuid','moment','ioredis','./utils','../../../config/environment/','../../../config/logger','dialer','booked','predictiveCalls','syncQueueSummary','redis','defaults','localhost','socket.io-emitter','../rpc/setting','../rpc/interval','./models/action','./models/history','./models/final','./models/queueCallerAbandon','env','XCALLY_IP_AGI','127.0.0.1','prototype','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','contactsId','uniqueId','startPredictive','ivrOriginated','queueBooked','queueBookedRR','queuesSummary','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','custom:queuesummary','syncQueueSummaryComplete','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','type','outbound','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','inspect','voice:queue:%s','name','voice_queue:save','isEmpty','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','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','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','isUndefined','predictiveIntervalAvgTalktime','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'];(function(_0x1a21db,_0x9489fb){var _0x13ea9b=function(_0xb91444){while(--_0xb91444){_0x1a21db['push'](_0x1a21db['shift']());}};_0x13ea9b(++_0x9489fb);}(_0xe635,0x1b7));var _0x5e63=function(_0x3cf5c7,_0x1eb319){_0x3cf5c7=_0x3cf5c7-0x0;var _0xf3d981=_0xe635[_0x3cf5c7];return _0xf3d981;};'use strict';var util=require(_0x5e63('0x0'));var _=require('lodash');var uuid=require(_0x5e63('0x1'));var moment=require(_0x5e63('0x2'));var rr=require('rr');var Redis=require(_0x5e63('0x3'));var utils=require(_0x5e63('0x4'));var hopperUtils=require('./utils/hopper');var ut=require('../preview/util/util');var config=require(_0x5e63('0x5'));var logger=require(_0x5e63('0x6'))(_0x5e63('0x7'));var loggerBooked=require(_0x5e63('0x6'))(_0x5e63('0x8'));var loggerPredictive=require(_0x5e63('0x6'))('predictive');var loggerPredictiveCalls=require(_0x5e63('0x6'))(_0x5e63('0x9'));var loggerSyncQueueSummary=require(_0x5e63('0x6'))(_0x5e63('0xa'));var ami=require('../ami');config[_0x5e63('0xb')]=_[_0x5e63('0xc')](config[_0x5e63('0xb')],{'host':_0x5e63('0xd'),'port':0x18eb});var io=require(_0x5e63('0xe'))(new Redis(config['redis']));var cmHopper=require('../rpc/cmHopper');var voiceQueueRt=require('../rpc/voiceQueueRt');var RpcSetting=require(_0x5e63('0xf'));var Interval=require(_0x5e63('0x10'));var Action=require(_0x5e63('0x11'));var History=require(_0x5e63('0x12'));var Final=require(_0x5e63('0x13'));var AgentComplete=require('./models/agentComplete');var QueueCallerAbandon=require(_0x5e63('0x14'));var Hangup=require('./models/hangup');var ipAgi=process[_0x5e63('0x15')][_0x5e63('0x16')]||_0x5e63('0x17');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x5e63('0x18')][_0x5e63('0x19')]=function(_0x4c1316){this[_0x5e63('0x1a')]=this[_0x5e63('0x1a')]?this['tail'][_0x5e63('0x1b')](_0x4c1316):_0x4c1316();};function Dialer(_0xf15ef3,_0x591c99){this[_0x5e63('0x1c')]=new Sequence();this[_0x5e63('0x1d')]=_0x591c99;this[_0x5e63('0x1e')]=_0xf15ef3[_0x5e63('0x1e')];this['campaigns']=_0xf15ef3[_0x5e63('0x1f')];this[_0x5e63('0x20')]=_0xf15ef3[_0x5e63('0x20')];this['trunks']=_0xf15ef3[_0x5e63('0x21')];this['maxNumberOriginate']=config[_0x5e63('0x22')]||0x2;this[_0x5e63('0x23')]={};this['actions']={};this[_0x5e63('0x24')]={};this[_0x5e63('0x25')]={};this['optionPredictive']={};this[_0x5e63('0x26')]={};this['startProgressive']={};this[_0x5e63('0x27')]={};this[_0x5e63('0x28')]={};this[_0x5e63('0x29')]={};this[_0x5e63('0x2a')]={};ami['on']('agentconnect',this[_0x5e63('0x2b')][_0x5e63('0x2c')](this));ami['on'](_0x5e63('0x2d'),this[_0x5e63('0x2e')][_0x5e63('0x2c')](this));ami['on'](_0x5e63('0x2f'),this['syncOriginateResponse'][_0x5e63('0x2c')](this));ami['on']('agentcomplete',this['syncAgentComplete'][_0x5e63('0x2c')](this));ami['on'](_0x5e63('0x30'),this['syncQueueSummary'][_0x5e63('0x2c')](this));ami['on']('custom:queuesummarycomplete',this[_0x5e63('0x31')][_0x5e63('0x2c')](this));ami['on'](_0x5e63('0x32'),this[_0x5e63('0x33')][_0x5e63('0x2c')](this));ami['on'](_0x5e63('0x34'),this[_0x5e63('0x35')][_0x5e63('0x2c')](this));ami['on'](_0x5e63('0x36'),this[_0x5e63('0x37')][_0x5e63('0x2c')](this));ami['on']('queuemember',this[_0x5e63('0x38')][_0x5e63('0x2c')](this));ami['on'](_0x5e63('0x39'),this[_0x5e63('0x3a')][_0x5e63('0x2c')](this));this['loopCampaigns']();this[_0x5e63('0x3b')]();RpcSetting[_0x5e63('0x3c')]()[_0x5e63('0x3d')](function(_0x6e492a){previewRecallmeReminderInterval=_0x6e492a[_0x5e63('0x3e')];});}function isNotNull(_0x2c8ad7){return _0x2c8ad7!==null&&!_['isUndefined'](_0x2c8ad7);}function msgResponse(_0xda1d60,_0x6730da,_0x3ef864){return{'action':_0xda1d60,'response':_0x6730da,'message':_0x3ef864,'stack':_0x3ef864};}function emit(_0x39cd8a,_0x2c3741,_0x1b8441){io['to'](_0x39cd8a)['emit'](_0x2c3741,_0x1b8441);}function emitOutboundVoiceQueueSummary(_0x1f8ca5){if(_0x1f8ca5[_0x5e63('0x3f')]===_0x5e63('0x40')){logger[_0x5e63('0x41')](_0x5e63('0x42'),util[_0x5e63('0x43')](_0x1f8ca5,{'showHidden':![],'depth':null}));emit(util['format'](_0x5e63('0x44'),_0x1f8ca5[_0x5e63('0x45')]),_0x5e63('0x46'),_0x1f8ca5);}}function checkGetDataPredictive(_0x952646){if(isNotNull(_0x952646)&&!_[_0x5e63('0x47')](_0x952646)){loggerPredictive[_0x5e63('0x48')]('-----\x20Stats\x20Predictive\x20---');loggerPredictive[_0x5e63('0x48')](_0x5e63('0x49'),_0x952646[_0x5e63('0x4a')]);loggerPredictive[_0x5e63('0x48')]('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x952646[_0x5e63('0x4b')]);loggerPredictive[_0x5e63('0x48')](_0x5e63('0x4c'),_0x952646['predictiveIntervalDroppedCallsTimeout']);loggerPredictive[_0x5e63('0x48')](_0x5e63('0x4d'),_0x952646[_0x5e63('0x4e')]);loggerPredictive[_0x5e63('0x48')](_0x5e63('0x4f'),_0x952646[_0x5e63('0x50')]);loggerPredictive[_0x5e63('0x48')](_0x5e63('0x51'),_0x952646['predictiveIntervalAvgTalktime']);loggerPredictive['info'](_0x5e63('0x52'));if(_0x952646[_0x5e63('0x4a')]>0x0){if(!_[_0x5e63('0x53')](_0x952646['predictiveIntervalAvgTalktime'])&&_0x952646[_0x5e63('0x54')]>0x0){return!![];}loggerPredictive[_0x5e63('0x48')](_0x5e63('0x55'));if(!_[_0x5e63('0x53')](_0x952646[_0x5e63('0x50')])&&_0x952646[_0x5e63('0x50')]>0x0){return!![];}loggerPredictive[_0x5e63('0x48')](_0x5e63('0x56'));}else{loggerPredictive[_0x5e63('0x48')](_0x5e63('0x57'));}}else{loggerPredictive['info'](_0x5e63('0x58'));}return![];}function mergeDataErlangB(_0x35210a){return function(_0x403d56){loggerPredictive[_0x5e63('0x48')](_0x5e63('0x59'));loggerPredictive['info'](_0x5e63('0x5a'),_0x403d56[_0x5e63('0x5b')]);loggerPredictive[_0x5e63('0x48')](_0x5e63('0x5c'),_0x403d56[_0x5e63('0x5d')]);loggerPredictive['info']('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x403d56['erlangAbandonmentRate']);loggerPredictive[_0x5e63('0x48')](_0x5e63('0x5e'),_0x403d56[_0x5e63('0x5f')]);loggerPredictive[_0x5e63('0x48')](_0x5e63('0x60'),_0x403d56[_0x5e63('0x61')]);loggerPredictive['info'](_0x5e63('0x52'));_[_0x5e63('0x62')](_0x35210a,_0x403d56);};}function ifInterval(_0x13598f,_0x38bc14){if(_[_0x5e63('0x53')](_0x38bc14)){return![];}return utils[_0x5e63('0x63')](undefined,_0x38bc14)<_0x13598f*0x3c;}function clearPredictiveAttributes(_0x593ece){if(_0x593ece[_0x5e63('0x64')]){_0x593ece['startProgressive']=undefined;loggerPredictive[_0x5e63('0x41')](_0x593ece[_0x5e63('0x45')],_0x5e63('0x65'));}if(_0x593ece[_0x5e63('0x26')]){_0x593ece[_0x5e63('0x26')]=undefined;loggerPredictive['debug'](_0x593ece['name'],_0x5e63('0x66'));}if(_0x593ece[_0x5e63('0x67')]){clearInterval(_0x593ece[_0x5e63('0x67')]);_0x593ece['handlePredictive']=undefined;loggerPredictive[_0x5e63('0x41')](_0x593ece[_0x5e63('0x45')],_0x5e63('0x68'));}}function loggerCatchPredictive(_0x330420,_0x1ebe45){return function(_0x4f850d){loggerPredictive[_0x5e63('0x69')](_0x1ebe45[_0x5e63('0x45')],_0x330420);loggerPredictive['error'](_0x4f850d[_0x5e63('0x6a')]);clearPredictiveAttributes(_0x1ebe45);};}function loggerCatch(_0x302063){return function(_0x28f564){logger['error'](_0x302063,util[_0x5e63('0x43')](_0x28f564,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x4ab4dc,_0x1d87f7,_0x3e976a){return function(_0x177b09){utils['checkContactLowerLimitOriginate'](_0x1d87f7,_0x3e976a,0x0);_0x1d87f7[_0x5e63('0x6b')]=0x0;logger[_0x5e63('0x69')](_0x4ab4dc,util[_0x5e63('0x43')](_0x177b09,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x49af48){return function(_0x111a81){if(isNotNull(_0x111a81)&&isNotNull(_0x111a81[0x0])){if(_0x111a81[0x0][_0x5e63('0x6c')]>0x0){_0x49af48[_0x5e63('0x6d')]=utils[_0x5e63('0x6e')][_0x5e63('0x6f')];logger['info'](_0x5e63('0x70')+_0x49af48[_0x5e63('0x45')],_0x111a81[0x0][_0x5e63('0x6c')],_0x5e63('0x71'));}else{_0x49af48[_0x5e63('0x6d')]=utils[_0x5e63('0x6e')][_0x5e63('0x72')];logger[_0x5e63('0x48')](_0x5e63('0x73')+_0x49af48[_0x5e63('0x45')]);}}};}function createObjHistory(_0xe0d4f9,_0x1e29b3,_0x4be53f,_0x3eb143,_0x187f7c){_0xe0d4f9[_0x5e63('0x6d')]=_0x4be53f;var _0x1d258b=new Action(_0xe0d4f9,_0x1e29b3);var _0x5778e0=new History(_0x1d258b);_0x5778e0[_0x5e63('0x74')]=_0x3eb143;_0x5778e0[_0x5e63('0x75')]=_0x187f7c;_0x5778e0[_0x5e63('0x76')]=_0x1d258b[_0x5e63('0x77')];return _0x5778e0;}function unlockQueueStatus(_0x26d57c,_0x3c40bc){setTimeout(function(){if(_[_0x5e63('0x53')](_0x26d57c[_0x5e63('0x78')])){loggerBooked[_0x5e63('0x69')](_0x5e63('0x79'),_0x3c40bc);}_0x26d57c[_0x5e63('0x78')]=!![];loggerBooked[_0x5e63('0x48')](_0x5e63('0x7a'),_0x3c40bc,JSON[_0x5e63('0x7b')](_[_0x5e63('0x7c')](_0x26d57c,['name',_0x5e63('0x78')])));},0x1f3);}function checkInterval(_0x3e6efb){return function(){if(!isNotNull(_0x3e6efb[_0x5e63('0x7d')])){_0x3e6efb[_0x5e63('0x6d')]=utils[_0x5e63('0x6e')]['NULL_INTERVAL'];throw _0x3e6efb['name']+_0x5e63('0x7e');}if(!isNotNull(_0x3e6efb[_0x5e63('0x7d')][_0x5e63('0x7f')])){_0x3e6efb[_0x5e63('0x6d')]=utils['CAMPAIGN_STATUS'][_0x5e63('0x80')];throw _0x3e6efb['name']+_0x5e63('0x7e');}if(!isNotNull(_[_0x5e63('0x47')](_0x3e6efb[_0x5e63('0x7d')][_0x5e63('0x7f')]))){_0x3e6efb[_0x5e63('0x6d')]=utils['CAMPAIGN_STATUS'][_0x5e63('0x80')];throw _0x3e6efb[_0x5e63('0x45')]+_0x5e63('0x7e');}};}function checkIsIVRCampaignActive(_0x21dba5){return function(){if(!utils['isIVRCampaignActive'](_0x21dba5)){_0x21dba5['message']=utils[_0x5e63('0x6e')][_0x5e63('0x81')];throw _0x21dba5[_0x5e63('0x45')]+_0x5e63('0x82');}};}function emitCampaignSummary(_0x5965cb){if(utils[_0x5e63('0x83')](_0x5965cb)){emit(util['format'](_0x5e63('0x84'),_0x5965cb[_0x5e63('0x45')]),_0x5e63('0x85'),_0x5965cb);}}function loggerCatchQueueSummary(_0x502044,_0x57b64c){return function(_0x12e5d6){clearPredictiveAttributes(_0x57b64c);emitCampaignSummary(_0x57b64c);loggerSyncQueueSummary[_0x5e63('0x41')](_0x502044,util[_0x5e63('0x43')](_0x12e5d6,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x11fd01){if(_0x11fd01[_0x5e63('0x86')]){if(_0x11fd01[_0x5e63('0x87')]===0x0){_0x11fd01[_0x5e63('0x86')]=![];_0x11fd01['message']=utils[_0x5e63('0x6e')][_0x5e63('0x81')];loggerSyncQueueSummary[_0x5e63('0x41')](_0x5e63('0x88'),_0x11fd01['name'],'is\x20not\x20active');}else{_0x11fd01[_0x5e63('0x6d')]=utils[_0x5e63('0x6e')]['DISACTIVED'];loggerSyncQueueSummary[_0x5e63('0x41')](_0x5e63('0x88'),_0x11fd01['name'],_0x5e63('0x89'));}emitCampaignSummary(_0x11fd01);}}function myreject(_0x510b26){return function(_0x1ad5ab){return _0x510b26(msgResponse('[ifTime][Action]','Error',JSON[_0x5e63('0x7b')](_0x1ad5ab)));};}Dialer[_0x5e63('0x18')][_0x5e63('0x8a')]=function(_0x3ee125){return!_[_0x5e63('0x53')](_0x3ee125)&&_0x3ee125&&!_['isUndefined'](_0x3ee125[_0x5e63('0x45')])&&!_[_0x5e63('0x53')](_0x3ee125[_0x5e63('0x8b')])&&_0x3ee125[_0x5e63('0x8b')]&&(this['trunks'][util[_0x5e63('0x8c')](_0x5e63('0x8d'),_0x3ee125[_0x5e63('0x45')])][_0x5e63('0x8e')]===_0x5e63('0x8f')||this['trunks'][util[_0x5e63('0x8c')](_0x5e63('0x8d'),_0x3ee125[_0x5e63('0x45')])]['status']===_0x5e63('0x90'));};Dialer[_0x5e63('0x18')][_0x5e63('0x91')]=function(_0x3ba3d5){var _0x22b969=this;return function(){if(!_0x22b969[_0x5e63('0x8a')](_0x3ba3d5[_0x5e63('0x92')])){if(!_0x22b969['isTrunkReachable'](_0x3ba3d5[_0x5e63('0x93')])){_0x3ba3d5[_0x5e63('0x6d')]=utils[_0x5e63('0x6e')][_0x5e63('0x94')];throw _0x3ba3d5['name']+_0x5e63('0x95');}}};};Dialer['prototype'][_0x5e63('0x96')]=function(_0x1378db,_0x8013a4,_0x4c879c,_0x4f69c8){var _0x5446fb=this;return function(){var _0x268a6d=!![];return _0x5446fb[_0x5e63('0x97')](_0x1378db,_0x8013a4,_0x4c879c,_0x4f69c8,_0x268a6d);};};Dialer[_0x5e63('0x18')]['checkIfTimeIntervals']=function(_0x16685c,_0x3286cb,_0x2e1e91,_0x4af23e){var _0x5d18f7=this;return function(){var _0x4cc4ec=![];return _0x5d18f7[_0x5e63('0x97')](_0x16685c['Intervals'],_0x3286cb,_0x2e1e91,_0x4af23e,_0x4cc4ec);};};Dialer['prototype'][_0x5e63('0x97')]=function(_0x4be2f8,_0x330ee3,_0x126412,_0x5ac4cd,_0x4da426){var _0x1d8257=[];return new Promise(function(_0x3ce6ca,_0x4f706f){if(!isNotNull(_0x4be2f8)){_0x5ac4cd[_0x5e63('0x6d')]=utils[_0x5e63('0x6e')]['NULL_INTERVAL'];return _0x4f706f(msgResponse(_0x5e63('0x98'),_0x5e63('0x99'),_0x126412+'\x20Intervals\x20is\x20null\x20'));}if(_[_0x5e63('0x47')](_0x4be2f8)){_0x5ac4cd[_0x5e63('0x6d')]=utils[_0x5e63('0x6e')]['EMPTY_INTERVAL'];return _0x4f706f(msgResponse(_0x5e63('0x98'),_0x5e63('0x99'),_0x126412+_0x5e63('0x9a')));}if(_0x330ee3&&_[_0x5e63('0x53')](config[_0x5e63('0x9b')][_0x330ee3])){_0x5ac4cd['message']=utils[_0x5e63('0x6e')]['UNKNOWN_TIMEZONE'];return _0x4f706f(msgResponse('ifTime',_0x5e63('0x99'),_0x126412+_0x5e63('0x9c')+_0x330ee3));}if(_[_0x5e63('0x9d')](_0x4be2f8)){for(var _0x1a8791=0x0;_0x1a8791<_0x4be2f8[_0x5e63('0x9e')];_0x1a8791+=0x1){_0x1d8257[_0x5e63('0x9f')](ami[_0x5e63('0xa0')]({'action':_0x5e63('0xa1'),'command':util[_0x5e63('0x8c')](_0x5e63('0xa2'),_0x4be2f8[_0x1a8791][_0x5e63('0xa3')],!_['isUndefined'](config['timezones'][_0x330ee3])?_0x330ee3:'')})[_0x5e63('0x3d')](function(_0x1c3684){return _0x1c3684[_0x5e63('0xa4')][_0x5e63('0xa5')](_0x5e63('0xa6'))>=0x0;})[_0x5e63('0xa7')](myreject(_0x4f706f)));}}else{_0x1d8257[_0x5e63('0x9f')](ami[_0x5e63('0xa0')]({'action':_0x5e63('0xa1'),'command':util[_0x5e63('0x8c')](_0x5e63('0xa2'),_0x4be2f8,!_[_0x5e63('0x53')](config[_0x5e63('0x9b')][_0x330ee3])?_0x330ee3:'')})[_0x5e63('0x3d')](function(_0x25e207){return _0x25e207[_0x5e63('0xa4')]['indexOf'](_0x5e63('0xa6'))>=0x0;})[_0x5e63('0xa7')](myreject(_0x4f706f)));}Promise[_0x5e63('0xa8')](_0x1d8257)[_0x5e63('0x3d')](function(_0x5915c1){var _0x2df0e8=_['some'](_0x5915c1);if(_0x2df0e8){return _0x3ce6ca(_0x2df0e8);}else{_0x5ac4cd['message']=_0x4da426?utils['CAMPAIGN_STATUS'][_0x5e63('0xa9')]:utils[_0x5e63('0x6e')][_0x5e63('0xaa')];return _0x4f706f(msgResponse(_0x5e63('0xab'),_0x5e63('0x99'),'Global:\x20'+_0x4da426+'\x20'+_0x126412+_0x5e63('0xac')+util[_0x5e63('0x43')](_0x4be2f8,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x330ee3));}})[_0x5e63('0xa7')](function(_0x4b6b21){return _0x4f706f(msgResponse('ifTime','Failure',JSON['stringify'](_0x4b6b21)));});});};Dialer[_0x5e63('0x18')][_0x5e63('0xad')]=function(){var _0x46b79e=this;return cmHopper[_0x5e63('0xae')]({'active':![]},{'where':{'active':!![]}})['then'](function(){setInterval(function(){_0x46b79e['syncCampaigns']();},0x3e8);});};Dialer[_0x5e63('0x18')]['syncCampaigns']=function(){var _0x41b91d=this;var _0x62fe9;for(var _0x17f573 in this[_0x5e63('0x1f')]){if(typeof this[_0x5e63('0x1f')][_0x17f573]!==_0x5e63('0xaf')){_0x62fe9=this[_0x5e63('0x1f')][_0x17f573];if(utils[_0x5e63('0x83')](_0x62fe9)&&utils['isIVRCampaignActive'](_0x62fe9)){_0x62fe9[_0x5e63('0x86')]=!![];Promise[_0x5e63('0xb0')]()['then'](checkIsIVRCampaignActive(_0x62fe9))[_0x5e63('0x3d')](checkInterval(_0x62fe9))[_0x5e63('0x3d')](_0x41b91d['checkIsTrunkReachable'](_0x62fe9))[_0x5e63('0x3d')](_0x41b91d[_0x5e63('0x96')](_0x62fe9['dialGlobalInterval'],_0x62fe9[_0x5e63('0xb1')],_0x62fe9['name'],_0x62fe9))['then'](_0x41b91d[_0x5e63('0xb2')](_0x62fe9['Interval'],_0x62fe9['dialTimezone'],_0x62fe9[_0x5e63('0x45')],_0x62fe9))['then'](_0x41b91d[_0x5e63('0xb3')](_0x62fe9))[_0x5e63('0xa7')](loggerCatchQueueSummary(_0x5e63('0xb4'),_0x62fe9));}else{notSendMessagesCampaign(_0x62fe9);}}}};Dialer[_0x5e63('0x18')]['checkDialMethod']=function(_0x5f2ab8){if(_0x5f2ab8[_0x5e63('0xb5')]!=='predictive'){clearPredictiveAttributes(_0x5f2ab8);}switch(_0x5f2ab8[_0x5e63('0xb5')]){case _0x5e63('0xb6'):this[_0x5e63('0xb7')](_0x5f2ab8,0x1);break;case'power':this['handlePower'](_0x5f2ab8,_0x5f2ab8['dialPowerLevel']);break;case _0x5e63('0xb8'):this[_0x5e63('0xb8')](_0x5f2ab8);break;case _0x5e63('0x8'):this[_0x5e63('0xb7')](_0x5f2ab8,0x1);break;default:logger[_0x5e63('0x69')](_0x5e63('0xb9'),_0x5f2ab8[_0x5e63('0x45')],_0x5e63('0xba'));}};Dialer['prototype'][_0x5e63('0x98')]=function(_0x287cc1,_0x46b67a){var _0x730b96=_0x287cc1[_0x5e63('0xb1')];var _0x5602c4=_0x46b67a?_0x287cc1[_0x5e63('0xbb')]:_0x287cc1[_0x5e63('0x7d')][_0x5e63('0x7f')];logger[_0x5e63('0xbc')](_0x5e63('0xbd'),_0x5602c4,_0x730b96,_0x287cc1[_0x5e63('0x45')],util[_0x5e63('0x8c')](_0x5e63('0xbe'),_0x287cc1[_0x5e63('0x45')],_0x287cc1['id']));var _0x5920e0=null;return Interval[_0x5e63('0xbf')](_0x5602c4,_0x730b96)['then'](function(_0x6c72bf){if(_0x6c72bf===!![]){return _0x6c72bf;}else{_0x287cc1[_0x5e63('0x6d')]=_0x46b67a?utils['CAMPAIGN_STATUS'][_0x5e63('0xa9')]:utils[_0x5e63('0x6e')]['OVERTIME_INTERVAL'];_0x5920e0=msgResponse(_0x5e63('0xab'),'Failure',_0x5e63('0xc0')+_0x46b67a+'\x20'+_0x287cc1[_0x5e63('0x45')]+_0x5e63('0xac')+util['inspect'](_0x5602c4,{'showHidden':![],'depth':null})+_0x5e63('0xc1')+_0x730b96);}if(_0x5920e0!==null){logger[_0x5e63('0xbc')](_0x5e63('0xc2'),_0x5920e0);_0x5920e0[_0x5e63('0xc3')]=_0x46b67a;throw _0x5920e0;}})[_0x5e63('0xa7')](function(_0x18cc2a){logger['error'](_0x5e63('0xc4'),_0x18cc2a);throw msgResponse(_0x5e63('0xc5'),_0x5e63('0xc6'),util[_0x5e63('0x43')](_0x18cc2a,{'showHidden':![],'depth':null}));});};Dialer[_0x5e63('0x18')][_0x5e63('0x2b')]=function(_0x3ff9ab){if(this[_0x5e63('0x1e')][_0x3ff9ab['queue']]){if(this['uniqueId'][_0x3ff9ab[_0x5e63('0xc7')]]&&this['uniqueId'][_0x3ff9ab['uniqueid']][_0x5e63('0x3f')]!==_0x5e63('0xc8')){this[_0x5e63('0xc9')](this[_0x5e63('0x1e')][_0x3ff9ab[_0x5e63('0xca')]]);this[_0x5e63('0x25')][_0x3ff9ab[_0x5e63('0xc7')]][_0x5e63('0xcb')]=moment()['format'](_0x5e63('0xcc'));}}};Dialer[_0x5e63('0x18')][_0x5e63('0xcd')]=function(_0x13fa40){var _0x26e2db=this['uniqueId'][_0x13fa40[_0x5e63('0xc7')]];if(this['voiceQueues'][_0x13fa40['queue']]){if(_0x26e2db&&_0x26e2db[_0x5e63('0x3f')]!==_0x5e63('0xc8')){delete this[_0x5e63('0x25')][_0x13fa40[_0x5e63('0xc7')]];this[_0x5e63('0x1e')][_0x13fa40[_0x5e63('0xca')]][_0x5e63('0xce')]+=0x1;var _0x59e30d=new AgentComplete(_0x26e2db,_0x13fa40);if(_0x13fa40[_0x5e63('0xcf')]===_0x5e63('0xd0')){_0x59e30d[_0x5e63('0xd1')]=this[_0x5e63('0x1e')][_0x13fa40[_0x5e63('0xca')]][_0x5e63('0xd2')]&&this[_0x5e63('0x1e')][_0x13fa40[_0x5e63('0xca')]][_0x5e63('0xd3')]?moment()['format'](_0x5e63('0xcc')):undefined;}hopperUtils[_0x5e63('0xd4')](_0x59e30d)[_0x5e63('0xa7')](loggerCatch('[syncAgentComplete][createHistory]'));hopperUtils[_0x5e63('0xd5')](_0x59e30d)['catch'](loggerCatch('[syncAgentComplete]'));}}};Dialer['prototype']['syncQueueCallerAbandon']=function(_0x5e3aab){var _0x3ea346=this['uniqueId'][_0x5e3aab['uniqueid']];var _0xb45413=this;var _0x5d3ee7=![];var _0x2ea537;var _0x6fb884;if(this[_0x5e63('0x1e')][_0x5e3aab['queue']]){if(_0x3ea346&&_0x3ea346[_0x5e63('0x3f')]!==_0x5e63('0xc8')){delete this[_0x5e63('0x25')][_0x5e3aab[_0x5e63('0xc7')]];this[_0x5e63('0xc9')](this[_0x5e63('0x1e')][_0x5e3aab['queue']]);_0x3ea346[_0x5e63('0xd6')]=moment()[_0x5e63('0x8c')](_0x5e63('0xcc'));var _0x279591=new QueueCallerAbandon(_0x3ea346,_0x5e3aab);if(utils[_0x5e63('0x63')](_0x3ea346[_0x5e63('0xd6')],_0x3ea346[_0x5e63('0xd7')])>=_0x3ea346[_0x5e63('0xd8')]){this[_0x5e63('0x1e')][_0x5e3aab[_0x5e63('0xca')]][_0x5e63('0xd9')]+=0x1;this[_0x5e63('0x1e')][_0x5e3aab[_0x5e63('0xca')]][_0x5e63('0xda')]+=0x1;this[_0x5e63('0x1e')][_0x5e3aab[_0x5e63('0xca')]][_0x5e63('0xdb')]+=0x1;_0x279591[_0x5e63('0x74')]=0xa;_0x279591[_0x5e63('0x75')]=_0x5e63('0xdc');_0x279591['dropreason']=_0x5e63('0xdd');_0x279591[_0x5e63('0xd1')]=this['voiceQueues'][_0x5e3aab[_0x5e63('0xca')]][_0x5e63('0xd2')]?moment()[_0x5e63('0x8c')](_0x5e63('0xcc')):undefined;_0x279591['countdropretry']+=0x1;_0x279591[_0x5e63('0xde')]+=0x1;_0x2ea537=this['voiceQueues'][_0x5e3aab[_0x5e63('0xca')]][_0x5e63('0xdf')];_0x6fb884=this[_0x5e63('0x1e')][_0x5e3aab[_0x5e63('0xca')]][_0x5e63('0xe0')];hopperUtils[_0x5e63('0xe1')](_0x279591,_0x279591[_0x5e63('0x74')],_0x3ea346['voiceQueue'])[_0x5e63('0x3d')](function(_0x35d6d6){_0x5d3ee7=_0x35d6d6[_0x5e63('0xe2')]==0x1;if(_0x279591[_0x5e63('0xe3')]>=_0xb45413['voiceQueues'][_0x5e3aab[_0x5e63('0xca')]]['dialDropMaxRetry']){_0xb45413[_0x5e63('0xe4')](_0x279591,_0x35d6d6['additional']);}else{hopperUtils[_0x5e63('0xe5')]({'active':![],'countdropretry':_0x279591[_0x5e63('0xe3')],'scheduledat':moment()[_0x5e63('0xe6')](_0xb45413[_0x5e63('0x1e')][_0x5e3aab[_0x5e63('0xca')]]['dialDropRetryFrequency'],_0x5e63('0xe7'))['format'](_0x5e63('0xcc')),'ContactId':_0x3ea346[_0x5e63('0xe8')],'ListId':_0x3ea346[_0x5e63('0xe9')],'VoiceQueueId':_0x3ea346[_0x5e63('0xea')]||undefined,'CampaignId':_0x3ea346['CampaignId']||undefined})['catch'](loggerCatch(_0x5e63('0xeb')));var _0x4fb1ac=new History(_0x279591);_0x4fb1ac[_0x5e63('0x74')]=0xa;_0x4fb1ac[_0x5e63('0x75')]=_0x5e63('0xdc');_0x4fb1ac[_0x5e63('0x77')]=moment()[_0x5e63('0x8c')](_0x5e63('0xcc'));_0x4fb1ac['endtime']=_0x4fb1ac[_0x5e63('0x77')];_0x4fb1ac[_0x5e63('0xec')]=_0x279591[_0x5e63('0xec')];_0x4fb1ac[_0x5e63('0xed')]=_0x279591['calleridnum'];hopperUtils[_0x5e63('0xd4')](_0x4fb1ac)[_0x5e63('0xa7')](loggerCatch('[syncAgentComplete][createHistory][10]'));}})[_0x5e63('0x3d')](function(){if(_0x5d3ee7)hopperUtils[_0x5e63('0xee')](_0x279591,_0x2ea537,_0x6fb884)[_0x5e63('0x3d')](function(){return 0x1;});});}else{this['voiceQueues'][_0x5e3aab[_0x5e63('0xca')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0x5e63('0x1e')][_0x5e3aab[_0x5e63('0xca')]][_0x5e63('0xef')]+=0x1;_0x279591[_0x5e63('0x74')]=0xb;_0x279591['statedesc']=_0x5e63('0xf0');_0x279591[_0x5e63('0xf1')]='CALLEREXIT';_0x279591['countabandonedretry']+=0x1;_0x279591['countglobal']+=0x1;_0x2ea537=this[_0x5e63('0x1e')][_0x5e3aab[_0x5e63('0xca')]][_0x5e63('0xf2')];_0x6fb884=this[_0x5e63('0x1e')][_0x5e3aab[_0x5e63('0xca')]][_0x5e63('0xe0')];hopperUtils[_0x5e63('0xe1')](_0x279591,_0x279591['state'],_0x3ea346[_0x5e63('0xf3')])[_0x5e63('0x3d')](function(_0x7f690d){if(_0x279591[_0x5e63('0xf4')]>=_0xb45413[_0x5e63('0x1e')][_0x5e3aab[_0x5e63('0xca')]][_0x5e63('0xf5')]){_0xb45413['queueCallerAbandonCreateState'](_0x279591,_0x7f690d['additional']);}else{hopperUtils[_0x5e63('0xe5')]({'active':![],'countabandonedretry':_0x279591['countabandonedretry'],'scheduledat':moment()[_0x5e63('0xe6')](_0xb45413[_0x5e63('0x1e')][_0x5e3aab[_0x5e63('0xca')]]['dialAbandonedRetryFrequency'],_0x5e63('0xe7'))[_0x5e63('0x8c')](_0x5e63('0xcc')),'ContactId':_0x3ea346[_0x5e63('0xe8')],'ListId':_0x3ea346['ListId'],'VoiceQueueId':_0x3ea346[_0x5e63('0xea')]||undefined,'CampaignId':_0x3ea346[_0x5e63('0xf6')]||undefined})[_0x5e63('0xa7')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x24f584=new History(_0x279591);_0x24f584[_0x5e63('0x74')]=0xb;_0x24f584[_0x5e63('0x75')]=_0x5e63('0xf0');_0x24f584[_0x5e63('0x77')]=moment()[_0x5e63('0x8c')](_0x5e63('0xcc'));_0x24f584[_0x5e63('0x76')]=_0x24f584[_0x5e63('0x77')];_0x24f584[_0x5e63('0xec')]=_0x279591[_0x5e63('0xec')];_0x24f584[_0x5e63('0xed')]=_0x279591['calleridnum'];hopperUtils['createHistory'](_0x24f584)[_0x5e63('0xa7')](loggerCatch(_0x5e63('0xf7')));}})[_0x5e63('0x3d')](function(){if(_0x5d3ee7)hopperUtils['swapAdditionalPhones'](_0x279591,_0x2ea537,_0x6fb884)['then'](function(){return 0x1;});});}}}};Dialer[_0x5e63('0x18')][_0x5e63('0x35')]=function(_0x4c55fa){if(this[_0x5e63('0xf8')][_0x4c55fa[_0x5e63('0xc7')]]){this['actions'][_0x4c55fa[_0x5e63('0xc7')]][_0x5e63('0xf9')]=_0x4c55fa[_0x5e63('0xf9')];}if(this['uniqueId'][_0x4c55fa['uniqueid']]){this['uniqueId'][_0x4c55fa[_0x5e63('0xc7')]]['channel']=_0x4c55fa[_0x5e63('0xf9')];}};Dialer[_0x5e63('0x18')][_0x5e63('0x38')]=function(_0x57a6ff){if(!this[_0x5e63('0xf8')][_0x57a6ff[_0x5e63('0xfa')]]){return;}var _0x9cf047=this[_0x5e63('0x1e')][this[_0x5e63('0xf8')][_0x57a6ff[_0x5e63('0xfa')]][_0x5e63('0xca')]][_0x5e63('0xfb')]||_0x5e63('0xfc');if(_0x9cf047==='roundrobin'){if(this[_0x5e63('0xf8')][_0x57a6ff['actionid']]&&_[_0x5e63('0xfd')](this[_0x5e63('0xf8')][_0x57a6ff[_0x5e63('0xfa')]][_0x5e63('0xfe')])&&_0x57a6ff[_0x5e63('0x8e')]==='1'&&_0x57a6ff[_0x5e63('0xff')]==='0'){if(this['agents'][_0x57a6ff[_0x5e63('0x100')]]){if(!this[_0x5e63('0x20')][_0x57a6ff[_0x5e63('0x100')]][_0x5e63('0xfe')]){this[_0x5e63('0x20')][_0x57a6ff[_0x5e63('0x100')]][_0x5e63('0xfe')]=!![];this[_0x5e63('0xf8')][_0x57a6ff['actionid']][_0x5e63('0xfe')]=!![];this[_0x5e63('0xf8')][_0x57a6ff['actionid']][_0x5e63('0x100')]=_0x57a6ff[_0x5e63('0x100')];}}}}else if(_0x9cf047===_0x5e63('0xfc')){if(this[_0x5e63('0xf8')][_0x57a6ff[_0x5e63('0xfa')]]){if(this[_0x5e63('0x20')][_0x57a6ff['stateinterface']]){this['actions'][_0x57a6ff['actionid']]['stateinterface']=_0x57a6ff[_0x5e63('0x100')];if(_[_0x5e63('0xfd')](this[_0x5e63('0x28')][this[_0x5e63('0xf8')][_0x57a6ff[_0x5e63('0xfa')]][_0x5e63('0xca')]])){this[_0x5e63('0x28')][this['actions'][_0x57a6ff['actionid']]['queue']]=[];}this['queueBooked'][this[_0x5e63('0xf8')][_0x57a6ff[_0x5e63('0xfa')]][_0x5e63('0xca')]][_0x5e63('0x9f')](_[_0x5e63('0x62')](_[_0x5e63('0x7c')](this['actions'][_0x57a6ff[_0x5e63('0xfa')]],[_0x5e63('0x101'),_0x5e63('0x100')]),{'status':_0x57a6ff[_0x5e63('0x8e')],'paused':_0x57a6ff[_0x5e63('0xff')]}));}}}};Dialer['prototype']['syncQueueStatusComplete']=function(_0x23d656){if(!this['actions'][_0x23d656[_0x5e63('0xfa')]]){return;}var _0x46ed64=this;var _0x33fe8c=this[_0x5e63('0x1e')][this[_0x5e63('0xf8')][_0x23d656[_0x5e63('0xfa')]][_0x5e63('0xca')]];var _0x21c824=_0x33fe8c[_0x5e63('0xfb')]||_0x5e63('0xfc');if(_0x21c824===_0x5e63('0x102')){if(this[_0x5e63('0xf8')][_0x23d656['actionid']]&&this[_0x5e63('0xf8')][_0x23d656[_0x5e63('0xfa')]]['stateinterface']){this['preview'][_0x5e63('0x103')](this[_0x5e63('0xf8')][_0x23d656['actionid']][_0x5e63('0x101')],this[_0x5e63('0xf8')][_0x23d656[_0x5e63('0xfa')]][_0x5e63('0x100')])[_0x5e63('0xa7')](function(_0x15e117){logger[_0x5e63('0x69')](_0x5e63('0x104'),util[_0x5e63('0x43')](_0x15e117,{'showHidden':![],'depth':null}));})[_0x5e63('0x1b')](function(){_0x46ed64[_0x5e63('0xc9')](_0x46ed64['voiceQueues'][_0x46ed64[_0x5e63('0xf8')][_0x23d656[_0x5e63('0xfa')]][_0x5e63('0xca')]]);_0x46ed64['agents'][_0x46ed64[_0x5e63('0xf8')][_0x23d656[_0x5e63('0xfa')]][_0x5e63('0x100')]][_0x5e63('0xfe')]=![];delete _0x46ed64[_0x5e63('0xf8')][_0x23d656['actionid']];unlockQueueStatus(_0x33fe8c);});}else{this[_0x5e63('0xc9')](this[_0x5e63('0x1e')][this['actions'][_0x23d656[_0x5e63('0xfa')]][_0x5e63('0xca')]]);hopperUtils[_0x5e63('0xe5')]({'active':![],'ContactId':this[_0x5e63('0xf8')][_0x23d656[_0x5e63('0xfa')]]['ContactId'],'ListId':this[_0x5e63('0xf8')][_0x23d656[_0x5e63('0xfa')]][_0x5e63('0xe9')],'VoiceQueueId':this['actions'][_0x23d656[_0x5e63('0xfa')]][_0x5e63('0xea')]||undefined,'CampaignId':this[_0x5e63('0xf8')][_0x23d656[_0x5e63('0xfa')]]['CampaignId']||undefined})[_0x5e63('0xa7')](loggerCatch(_0x5e63('0x105')));delete this['actions'][_0x23d656[_0x5e63('0xfa')]];unlockQueueStatus(_0x33fe8c);}}else if(_0x21c824===_0x5e63('0xfc')){var _0x3e5d65;if(this['actions'][_0x23d656[_0x5e63('0xfa')]]&&!_[_0x5e63('0x47')](this[_0x5e63('0x28')][this['actions'][_0x23d656[_0x5e63('0xfa')]][_0x5e63('0xca')]])){if(this[_0x5e63('0x29')][_0x46ed64[_0x5e63('0xf8')][_0x23d656[_0x5e63('0xfa')]][_0x5e63('0xca')]]){this[_0x5e63('0x29')][_0x46ed64['actions'][_0x23d656[_0x5e63('0xfa')]]['queue']]=this[_0x5e63('0x29')][this[_0x5e63('0xf8')][_0x23d656['actionid']][_0x5e63('0xca')]]?this['queueBookedRR'][this['actions'][_0x23d656[_0x5e63('0xfa')]][_0x5e63('0xca')]]:this[_0x5e63('0x28')][this[_0x5e63('0xf8')][_0x23d656[_0x5e63('0xfa')]][_0x5e63('0xca')]]?this[_0x5e63('0x28')][this[_0x5e63('0xf8')][_0x23d656[_0x5e63('0xfa')]]['queue']][_0x5e63('0x106')]||0x0:0x0;}this[_0x5e63('0x28')][this[_0x5e63('0xf8')][_0x23d656['actionid']][_0x5e63('0xca')]][_0x5e63('0x106')]=this[_0x5e63('0x29')][this[_0x5e63('0xf8')][_0x23d656[_0x5e63('0xfa')]][_0x5e63('0xca')]];for(var _0x4592eb=0x0;_0x4592eb=_0x583662['dialGlobalMaxRetry']){_0x57db43[_0x5e63('0x129')](_0x312d88,_0xb91258,_0x30aff8,_0x5e63('0x12a'));}else{if(_0x312d88['countmachineretry']>=_0x583662['dialMachineMaxRetry']){_0x57db43[_0x5e63('0x12b')](_0x312d88,_0xb91258,_0x30aff8,_0x5e63('0x12c'));}else{hopperUtils[_0x5e63('0xe5')]({'active':![],'countmachineretry':_0x312d88[_0x5e63('0x123')],'scheduledat':moment()[_0x5e63('0xe6')](_0x583662[_0x5e63('0x12d')],_0x5e63('0xe7'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x312d88[_0x5e63('0xe8')],'ListId':_0x312d88['ListId'],'VoiceQueueId':_0x312d88[_0x5e63('0xea')]||undefined,'CampaignId':_0x312d88[_0x5e63('0xf6')]||undefined})['catch'](loggerCatch(_0x5e63('0x12e')));_0xb91258({'reschedule':0x1});}}});}if(_0x53a921[_0x5e63('0x3f')]===_0x5e63('0xc8')&&this['campaigns'][_0x53a921[_0x5e63('0xca')]][_0x5e63('0x115')]&&_0x4cb291[_0x5e63('0x116')]===_0x5e63('0x117')){delete this['uniqueId'][_0x4cb291[_0x5e63('0xc7')]];this[_0x5e63('0xc9')](this[_0x5e63('0x1f')][_0x53a921[_0x5e63('0xca')]]);_0xb08754=new Hangup(_0x53a921,_0x4cb291);_0xb08754[_0x5e63('0x74')]=0x12;_0xb08754[_0x5e63('0x75')]=_0x5e63('0x119');_0xb08754[_0x5e63('0x11a')]='AMD';ami[_0x5e63('0x11c')](_0x5e63('0x11d'),ut[_0x5e63('0x11e')](_0xb08754,_0x5e63('0x11f')));this[_0x5e63('0x120')](_0xb08754,_0x5e63('0x12f'),_0x5e63('0x130'));}if(_0x53a921[_0x5e63('0x3f')]===_0x5e63('0xc8')&&this['campaigns'][_0x53a921[_0x5e63('0xca')]][_0x5e63('0x115')]&&_0x4cb291[_0x5e63('0x116')]==='MACHINE'){return new Promise(function(_0x36c711,_0x34bb96){delete _0x57db43[_0x5e63('0x25')][_0x4cb291['uniqueid']];_0x57db43[_0x5e63('0xc9')](_0x57db43[_0x5e63('0x1f')][_0x53a921[_0x5e63('0xca')]]);_0x57db43[_0x5e63('0x1f')][_0x53a921['queue']]['outboundAnswerCallsDay']+=0x1;_0x57db43[_0x5e63('0x1f')][_0x53a921[_0x5e63('0xca')]][_0x5e63('0x118')]+=0x1;var _0x9ffda=_0x57db43[_0x5e63('0x1f')][_0x53a921[_0x5e63('0xca')]];var _0x315875=new Hangup(_0x53a921,_0x4cb291);_0x315875[_0x5e63('0x74')]=0x13;_0x315875[_0x5e63('0x75')]=_0x5e63('0x131');_0x315875['membername']=_0x5e63('0x11b');_0x315875[_0x5e63('0x123')]+=0x1;_0x315875['countglobal']+=0x1;_0x315875[_0x5e63('0x11f')]=!![];ami['emit'](_0x5e63('0x11d'),ut[_0x5e63('0x11e')](_0x315875,_0x5e63('0x11f')));hopperUtils[_0x5e63('0xd4')](_0x315875)['catch'](loggerCatch(_0x5e63('0x124')));if(_0x315875[_0x5e63('0x125')]+_0x315875['countcongestionretry']+_0x315875[_0x5e63('0x127')]+_0x315875[_0x5e63('0x132')]+_0x315875[_0x5e63('0xe3')]+_0x315875[_0x5e63('0xf4')]+_0x315875[_0x5e63('0x123')]+_0x315875[_0x5e63('0x128')]>=_0x9ffda['dialGlobalMaxRetry']){_0x57db43[_0x5e63('0x129')](_0x315875,_0x36c711,_0x34bb96,'reason19\x20machine....');}else{if(_0x315875[_0x5e63('0x123')]>=_0x9ffda[_0x5e63('0x133')]){_0x57db43[_0x5e63('0x12b')](_0x315875,_0x36c711,_0x34bb96,_0x5e63('0x12c'));}else{hopperUtils[_0x5e63('0xe5')]({'active':![],'countmachineretry':_0x315875[_0x5e63('0x123')],'scheduledat':moment()[_0x5e63('0xe6')](_0x9ffda[_0x5e63('0x12d')],_0x5e63('0xe7'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x315875[_0x5e63('0xe8')],'ListId':_0x315875['ListId'],'VoiceQueueId':_0x315875[_0x5e63('0xea')]||undefined,'CampaignId':_0x315875[_0x5e63('0xf6')]||undefined})['catch'](loggerCatch(_0x5e63('0x12e')));_0x36c711({'reschedule':0x1});}}});}}};Dialer[_0x5e63('0x18')][_0x5e63('0x33')]=function(_0x1ccb43){var _0xaf8c5c=this[_0x5e63('0x25')][_0x1ccb43[_0x5e63('0xc7')]];var _0x13db6f;if(_0xaf8c5c&&_0xaf8c5c[_0x5e63('0x3f')]===_0x5e63('0xc8')){delete this[_0x5e63('0x25')][_0x1ccb43[_0x5e63('0xc7')]];this[_0x5e63('0xc9')](this[_0x5e63('0x1f')][_0xaf8c5c['queue']]);this[_0x5e63('0x1f')][_0xaf8c5c[_0x5e63('0xca')]][_0x5e63('0x134')]+=0x1;_0x13db6f=new Hangup(_0xaf8c5c,_0x1ccb43);hopperUtils[_0x5e63('0xd4')](_0x13db6f)[_0x5e63('0xa7')](loggerCatch(_0x5e63('0x135')));hopperUtils[_0x5e63('0xd5')](_0x13db6f)['catch'](loggerCatch(_0x5e63('0x136')));}if(_0xaf8c5c&&_0xaf8c5c[_0x5e63('0x3f')]!==_0x5e63('0xc8')&&isNotNull(this['voiceQueues'][_0xaf8c5c[_0x5e63('0xca')]]['dialQueueProject'])){delete this[_0x5e63('0x25')][_0x1ccb43[_0x5e63('0xc7')]];this[_0x5e63('0xc9')](this[_0x5e63('0x1e')][_0xaf8c5c[_0x5e63('0xca')]]);this[_0x5e63('0x1e')][_0xaf8c5c[_0x5e63('0xca')]]['outboundAnswerCallsDay']+=0x1;this[_0x5e63('0x1e')][_0xaf8c5c[_0x5e63('0xca')]]['outboundAnswerAgiCallsDay']+=0x1;_0x13db6f=new Hangup(_0xaf8c5c,_0x1ccb43);_0x13db6f[_0x5e63('0x74')]=0x10;_0x13db6f[_0x5e63('0x75')]=_0x5e63('0x137');_0x13db6f[_0x5e63('0x11a')]=_0x5e63('0x138');hopperUtils[_0x5e63('0xd4')](_0x13db6f)[_0x5e63('0xa7')](loggerCatch(_0x5e63('0x135')));hopperUtils['moveContactManagedDialer'](_0x13db6f)[_0x5e63('0xa7')](loggerCatch(_0x5e63('0x136')));}if(_0xaf8c5c&&_0xaf8c5c[_0x5e63('0x3f')]!==_0x5e63('0xc8')&&!isNotNull(this[_0x5e63('0x1e')][_0xaf8c5c[_0x5e63('0xca')]][_0x5e63('0x139')])){delete this[_0x5e63('0x25')][_0x1ccb43[_0x5e63('0xc7')]];this[_0x5e63('0xc9')](this[_0x5e63('0x1e')][_0xaf8c5c[_0x5e63('0xca')]]);this[_0x5e63('0x1e')][_0xaf8c5c[_0x5e63('0xca')]]['outboundUnknownCallsDay']+=0x1;_0x13db6f=new Hangup(_0xaf8c5c,_0x1ccb43);_0x13db6f[_0x5e63('0x74')]=0xc;_0x13db6f[_0x5e63('0x75')]=_0x1ccb43[_0x5e63('0x13a')];_0x13db6f[_0x5e63('0x11a')]='Unknow';hopperUtils[_0x5e63('0xd4')](_0x13db6f)[_0x5e63('0xa7')](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils[_0x5e63('0xd5')](_0x13db6f)[_0x5e63('0xa7')](loggerCatch('[syncHangupIvr]'));}};Dialer['prototype'][_0x5e63('0xa')]=function(_0x35370a){var _0x593ec0=this;if(!_0x593ec0[_0x5e63('0x2a')][_0x35370a['name']]){_0x593ec0[_0x5e63('0x2a')][_0x35370a[_0x5e63('0x45')]]={'running':![]};}else if(_0x593ec0['queuesSummary'][_0x35370a[_0x5e63('0x45')]][_0x5e63('0x13b')]===!![]){return;}else if(_0x593ec0[_0x5e63('0x2a')][_0x35370a[_0x5e63('0x45')]][_0x5e63('0x13b')]===![]){_0x593ec0['queuesSummary'][_0x35370a[_0x5e63('0x45')]][_0x5e63('0x13b')]=!![];}var _0x28cf8e=_0x593ec0[_0x5e63('0x1e')][_0x35370a[_0x5e63('0x45')]];var _0x35a7f8=_0x28cf8e['message']!==utils[_0x5e63('0x6e')][_0x5e63('0x81')];var _0x48b319=utils[_0x5e63('0x13c')](_0x28cf8e);_0x28cf8e['statusMessage']=utils[_0x5e63('0x13d')](_0x28cf8e,_0x593ec0[_0x5e63('0x21')]);Promise['resolve']()[_0x5e63('0x3d')](function(){if(_0x28cf8e[_0x5e63('0x13e')]===utils[_0x5e63('0x6e')]['INACTIVE']){if(_0x35a7f8){clearPredictiveAttributes(_0x28cf8e);_0x35370a[_0x5e63('0x26')]=undefined;_0x35370a[_0x5e63('0x64')]=undefined;}if(_0x28cf8e['statusMessage']===utils[_0x5e63('0x6e')]['INACTIVE']){_0x35370a[_0x5e63('0x13f')]=0x0;_0x35370a[_0x5e63('0xff')]=0x0;_0x35370a[_0x5e63('0x140')]=0x0;_0x35370a['talking']=0x0;_0x35370a[_0x5e63('0x141')]=0x0;}}else if(_0x28cf8e[_0x5e63('0x13e')]===utils['CAMPAIGN_STATUS'][_0x5e63('0x142')]&&!_0x48b319){return _0x593ec0[_0x5e63('0x98')](_0x28cf8e,!![])[_0x5e63('0x3d')](function(){return _0x593ec0[_0x5e63('0x98')](_0x28cf8e,![]);})['then'](function(){return _0x593ec0[_0x5e63('0x143')](_0x28cf8e);})[_0x5e63('0xa7')](function(_0x23edf4){loggerSyncQueueSummary['debug'](_0x5e63('0x144'),util[_0x5e63('0x43')](_0x23edf4,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x28cf8e);});}else{clearPredictiveAttributes(_0x28cf8e);}})['then'](function(){var _0x3db196=_0x35370a[_0x5e63('0x145')](_0x28cf8e);if(_0x3db196||_0x28cf8e['queueSummaryCountersUpdated']){_0x28cf8e[_0x5e63('0x146')]=![];_0x35370a[_0x5e63('0x147')](_0x28cf8e);Object[_0x5e63('0x148')](_0x28cf8e,_0x35370a);emitOutboundVoiceQueueSummary(_0x35370a);}_0x593ec0[_0x5e63('0x2a')][_0x28cf8e['name']][_0x5e63('0x13b')]=![];})[_0x5e63('0xa7')](function(_0x10019a){logger[_0x5e63('0x69')]('[syncQueueSummary]',util[_0x5e63('0x43')](_0x10019a,{'showHidden':![],'depth':null}));_0x593ec0[_0x5e63('0x2a')][_0x28cf8e[_0x5e63('0x45')]][_0x5e63('0x13b')]=![];});};Dialer['prototype'][_0x5e63('0x31')]=_[_0x5e63('0x149')](function(){var _0xa1c7c7=_[_0x5e63('0x14a')](this[_0x5e63('0x1e')],function(_0x3134d1){return _0x3134d1[_0x5e63('0x14b')];});var _0x2173a4=_[_0x5e63('0x14a')](this[_0x5e63('0x20')],function(_0x177f57){return _0x177f57[_0x5e63('0x14c')]&&_0x177f57[_0x5e63('0x8e')]==='reachable';});if(_0xa1c7c7[_0x5e63('0x9e')]>0x0&&_0x2173a4[_0x5e63('0x9e')]>0x0){return Promise[_0x5e63('0xb0')]()['then'](cmHopper[_0x5e63('0x14d')](_[_0x5e63('0x14e')](_0xa1c7c7,'id'),previewRecallmeReminderInterval,_[_0x5e63('0x14e')](_0x2173a4,'id')))['then'](function(_0x1e32f0){for(var _0x134518=0x0;_0x134518<_0x1e32f0[_0x5e63('0x9e')];_0x134518++){var _0xcf317a=_0x1e32f0[_0x134518][_0x5e63('0x14f')]['name'];if(_0xcf317a)io['to'](util[_0x5e63('0x8c')](_0x5e63('0x150'),_0xcf317a))[_0x5e63('0x11c')](_0x5e63('0x151'),{'hopper':_0x1e32f0[_0x134518]});}})[_0x5e63('0xa7')](function(_0x42356c){logger['error'](_0x5e63('0x152'),_0x42356c);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x5e63('0x18')][_0x5e63('0x3b')]=function(){var _0x564eed=this;setInterval(function(){_0x564eed[_0x5e63('0x153')](_0x564eed[_0x5e63('0x25')],_0x5e63('0x154'));_0x564eed[_0x5e63('0x153')](_0x564eed[_0x5e63('0xf8')],'[actions]');},0x32c8);};Dialer[_0x5e63('0x18')][_0x5e63('0x153')]=function(_0x404385,_0x115787){var _0x1cce7a=this;for(var _0x43d89a in _0x404385){if(typeof _0x404385[_0x43d89a]!==_0x5e63('0xaf')){this[_0x5e63('0x1c')][_0x5e63('0x19')](function(){if(!_[_0x5e63('0xfd')](_0x404385[_0x43d89a])){return ami[_0x5e63('0xa0')]({'action':_0x5e63('0x8e'),'channel':_0x404385[_0x43d89a][_0x5e63('0xf9')]})[_0x5e63('0xa7')](function(_0x5e1364){if(_0x5e1364[_0x5e63('0x6d')]===_0x5e63('0x155')){setTimeout(function(){if(_0x404385[_0x43d89a]&&_0x404385[_0x43d89a][_0x5e63('0x3f')]!==_0x5e63('0xc8')){_0x1cce7a[_0x5e63('0xc9')](_0x1cce7a[_0x5e63('0x1e')][_0x404385[_0x43d89a]['queue']]);logger['error'](_0x5e63('0x156'),_0x115787,_0x43d89a,_0x404385[_0x43d89a][_0x5e63('0xca')]);delete _0x404385[_0x43d89a];}if(_0x404385[_0x43d89a]&&_0x404385[_0x43d89a][_0x5e63('0x3f')]==='ivr'){_0x1cce7a['updateOriginated'](_0x1cce7a[_0x5e63('0x1f')][_0x404385[_0x43d89a][_0x5e63('0xca')]]);logger[_0x5e63('0x69')](_0x5e63('0x157'),_0x115787,_0x43d89a,_0x404385[_0x43d89a]['queue']);delete _0x404385[_0x43d89a];}},0x2328);}});}});}}};Dialer['prototype'][_0x5e63('0x158')]=function(_0x27749d){return Promise[_0x5e63('0xb0')]()[_0x5e63('0x3d')](voiceQueueRt['getVoiceQueueRtPauses'](_0x27749d))[_0x5e63('0xa7')](loggerCatch(_0x5e63('0x159')));};Dialer[_0x5e63('0x18')][_0x5e63('0xc9')]=function(_0x14fdc6){if(!_[_0x5e63('0x53')](_0x14fdc6)&&_0x14fdc6!==null){if(typeof _0x14fdc6[_0x5e63('0x87')]!=='undefined'){if(_0x14fdc6[_0x5e63('0x87')]>0x0){_0x14fdc6['originated']-=0x1;}else{logger['error'](_0x5e63('0x15a'));}}}else{logger[_0x5e63('0x69')](_0x5e63('0x15b'));}};Dialer[_0x5e63('0x18')][_0x5e63('0x15c')]=function(_0x139f81,_0x20e90c){var _0x4a1711=this;return function(_0x53611e){_0x4a1711[_0x5e63('0xc9')](_0x20e90c);logger[_0x5e63('0x69')](_0x139f81,util[_0x5e63('0x43')](_0x53611e,{'showHidden':![],'depth':null}));};};Dialer[_0x5e63('0x18')][_0x5e63('0x15d')]=function(_0x23adfe,_0x1449ee,_0x3922e4){var _0xa682f7={'state':0x19,'statedesc':_0x5e63('0x15e')};this[_0x5e63('0xc9')](_0x1449ee);this[_0x5e63('0x120')](_['merge'](_0xa682f7,_[_0x5e63('0x7c')](_0x3922e4,[_0x5e63('0xe8'),_0x5e63('0xe9'),'UserId',_0x5e63('0xea'),'CampaignId'])),'[emptyContact][createHistory]','[emptyContact]');logger['error'](_0x23adfe);};Dialer[_0x5e63('0x18')][_0x5e63('0x120')]=function(_0x3713da,_0x5a722b,_0x540585){hopperUtils['createHistory'](_0x3713da)['catch'](loggerCatch(_0x5a722b));hopperUtils[_0x5e63('0xd5')](_0x3713da)['catch'](loggerCatch(_0x540585));};Dialer['prototype'][_0x5e63('0xe4')]=function(_0x5502bb,_0x2c81d2){hopperUtils[_0x5e63('0xd4')](_0x5502bb)[_0x5e63('0xa7')](loggerCatch(_0x5e63('0x15f')));if(_0x2c81d2==0x0){hopperUtils[_0x5e63('0xd5')](_0x5502bb)['catch'](loggerCatch(_0x5e63('0x160')));}};Dialer[_0x5e63('0x18')][_0x5e63('0x152')]=function(_0x5b3ccb){return Promise['resolve']()[_0x5e63('0x3d')](cmHopper[_0x5e63('0x14d')](_0x5b3ccb['id'],previewRecallmeReminderInterval))['then'](function(_0x4ed7c2){for(var _0xbf4004=0x0;_0xbf4004<_0x4ed7c2['length'];_0xbf4004++){var _0x253998=_0x4ed7c2[_0xbf4004][_0x5e63('0x14f')][_0x5e63('0x45')];if(_0x253998)io['to'](util[_0x5e63('0x8c')](_0x5e63('0x150'),_0x253998))[_0x5e63('0x11c')](_0x5e63('0x151'),{'hopper':_0x4ed7c2[_0xbf4004]});}})[_0x5e63('0xa7')](function(){});};Dialer[_0x5e63('0x18')][_0x5e63('0xb3')]=function(_0x45cd05){var _0x343d13=this;return function(){_0x343d13['handleIvr'](_0x45cd05);};};Dialer[_0x5e63('0x18')][_0x5e63('0x161')]=function(_0x581fa7,_0x504444){var _0x2dd5e5=this;var _0x1c3e97=uuid['v4']();this['actions'][_0x1c3e97]=new Action(_0x581fa7,_0x504444,_0x1c3e97);return new Promise(function(_0xf85856,_0x1c26ad){if(_['isUndefined'](_0x581fa7)&&typeof _0x581fa7!==_0x5e63('0x162')){return _0x1c26ad(msgResponse('originate',_0x5e63('0x99'),'voiceQueue\x20is\x20undefine'));}if(_[_0x5e63('0x53')](_0x504444[_0x5e63('0x163')])||_0x504444[_0x5e63('0x163')]===null){return _0x1c26ad(msgResponse(_0x5e63('0x164'),_0x5e63('0x99'),_0x5e63('0x165')));}var _0x259f32={'XMD-CALLERID':_0x2dd5e5[_0x5e63('0xf8')][_0x1c3e97][_0x5e63('0x166')](),'XMD-AGI':_0x581fa7[_0x5e63('0x139')]?util[_0x5e63('0x8c')](_0x5e63('0x167'),ipAgi,_0x581fa7[_0x5e63('0x139')]):_0x5e63('0x168'),'XMD-AGIAFTER':_0x581fa7[_0x5e63('0xd2')]?util[_0x5e63('0x8c')]('\x22agi://%s/square,%s\x22',ipAgi,_0x581fa7[_0x5e63('0xd2')]):_0x5e63('0x168'),'XMD-QUEUE':utils[_0x5e63('0x169')](_0x581fa7)?util[_0x5e63('0x8c')](_0x5e63('0x16a'),_0x581fa7['name'],_0x581fa7[_0x5e63('0x16b')]||'',_0x581fa7[_0x5e63('0xd3')]?'c':'',_0x581fa7['dialQueueTimeout']||0x3):_0x5e63('0x168'),'XMD-CONTACTID':_0x504444[_0x5e63('0xe8')],'XMD-CDRTYPE':_0x5e63('0x7'),'CALLERID(all)':_0x2dd5e5['actions'][_0x1c3e97][_0x5e63('0x166')](),'XMD-AMD':_0x581fa7[_0x5e63('0x115')]?_0x5e63('0x142'):_0x5e63('0x168'),'XMD-DESTINATION':_0x5e63('0x114')};if(_0x581fa7['dialAMDActive']){_0x259f32[_0x5e63('0x16c')]=_0x581fa7['dialAMDInitialSilence']||0x9c4;_0x259f32[_0x5e63('0x16d')]=_0x581fa7[_0x5e63('0x16e')]||0x5dc;_0x259f32['XMD-AMDAFTERGREETINGSILENCE']=_0x581fa7[_0x5e63('0x16f')]||0x320;_0x259f32[_0x5e63('0x170')]=_0x581fa7[_0x5e63('0x171')]||0x1388;_0x259f32[_0x5e63('0x172')]=_0x581fa7[_0x5e63('0x173')]||0x64;_0x259f32[_0x5e63('0x174')]=_0x581fa7['dialAMDBetweenWordsSilence']||0x32;_0x259f32[_0x5e63('0x175')]=_0x581fa7['dialAMDMaximumNumberOfWords']||0x3;_0x259f32['XMD-AMDSILENCETHRESHOLD']=_0x581fa7[_0x5e63('0x176')]||0x100;_0x259f32[_0x5e63('0x177')]=_0x581fa7['dialAMDMaximumWordLength']||0x1388;}if(utils[_0x5e63('0x169')](_0x581fa7)){_0x259f32['XMD-VOICEQUEUEID']=_0x504444[_0x5e63('0xea')];}else{_0x259f32[_0x5e63('0x178')]=_0x504444['CampaignId'];}var _0x23922b=utils['setXMDContactVariables'](_0x504444[_0x5e63('0x179')]);Object[_0x5e63('0x148')](_0x259f32,_0x23922b);var _0x1ac5e8=_0x2dd5e5[_0x5e63('0x8a')](_0x581fa7[_0x5e63('0x92')])?utils[_0x5e63('0x17a')](_0x581fa7['Trunk'][_0x5e63('0x17b')],_0x581fa7[_0x5e63('0x17c')],_0x581fa7['dialRandomLastDigitCallerIdNumber']>0x0?utils['getCallerIdRandom'](_0x581fa7['dialOriginateCallerIdNumber'],_0x581fa7['dialRandomLastDigitCallerIdNumber']):_0x581fa7[_0x5e63('0x17d')]):utils[_0x5e63('0x17a')](_[_0x5e63('0xfd')](_0x581fa7['TrunkBackup'])?_0x581fa7[_0x5e63('0x92')][_0x5e63('0x17b')]:_0x581fa7[_0x5e63('0x93')][_0x5e63('0x17b')],_0x581fa7[_0x5e63('0x17c')],_0x581fa7['dialRandomLastDigitCallerIdNumber']>0x0?utils['getCallerIdRandom'](_0x581fa7[_0x5e63('0x17d')],_0x581fa7[_0x5e63('0x17e')]):_0x581fa7['dialOriginateCallerIdNumber']);if(_0x1ac5e8){_0x259f32[_0x5e63('0x17f')]=_0x2dd5e5[_0x5e63('0xf8')][_0x1c3e97][_0x5e63('0x180')]=utils[_0x5e63('0x181')](_0x1ac5e8);_0x259f32['XMD-ORIGINATECALLERIDNUM']=_0x504444[_0x5e63('0x163')];}_0x581fa7['variables']=_0x259f32;return ami['Action']({'actionid':_0x1c3e97,'action':'originate','channel':_0x2dd5e5[_0x5e63('0x8a')](_0x581fa7[_0x5e63('0x92')])?util[_0x5e63('0x8c')](_0x5e63('0x182'),_0x581fa7[_0x5e63('0x92')][_0x5e63('0x45')],isNotNull(_0x581fa7[_0x5e63('0x183')])?_0x581fa7['dialPrefix'][_0x5e63('0x184')]()||'':'',_0x581fa7[_0x5e63('0x185')]>0x0?_0x504444[_0x5e63('0x163')][_0x5e63('0x186')](_0x581fa7[_0x5e63('0x185')]):_0x504444[_0x5e63('0x163')]):util['format'](_0x5e63('0x182'),_[_0x5e63('0xfd')](_0x581fa7[_0x5e63('0x93')])?_0x581fa7[_0x5e63('0x92')][_0x5e63('0x45')]:_0x581fa7[_0x5e63('0x93')][_0x5e63('0x45')],isNotNull(_0x581fa7['dialPrefix'])?_0x581fa7[_0x5e63('0x183')][_0x5e63('0x184')]()||'':'',_0x581fa7['dialCutDigit']>0x0?_0x504444[_0x5e63('0x163')][_0x5e63('0x186')](_0x581fa7[_0x5e63('0x185')]):_0x504444['phone']),'callerid':_0x1ac5e8,'Exten':'xcally-motion-dialer','Context':'from-sip','Priority':'1','variable':_0x259f32,'timeout':(_0x581fa7['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x1c3e97})[_0x5e63('0x3d')](function(_0x43bd41){return _0xf85856(_0x43bd41);})[_0x5e63('0xa7')](function(_0x160b17){_0x581fa7[_0x5e63('0x187')]+=0x1;var _0x3b8116=new History(_0x2dd5e5[_0x5e63('0xf8')][_0x1c3e97]);logger[_0x5e63('0x69')](util[_0x5e63('0x8c')]('[originateError]:\x20%s',JSON[_0x5e63('0x7b')](_0x160b17)));_0x3b8116[_0x5e63('0x74')]=0xe;_0x3b8116['statedesc']='OriginateError';_0x3b8116[_0x5e63('0x77')]=moment()[_0x5e63('0x8c')](_0x5e63('0xcc'));_0x3b8116[_0x5e63('0x76')]=_0x3b8116['starttime'];hopperUtils['createHistory'](_0x3b8116)['catch'](loggerCatch(_0x5e63('0x188')));_0x2dd5e5['moveContactManagedDialer'](_0x3b8116)[_0x5e63('0xa7')](loggerCatch(_0x5e63('0x188')))[_0x5e63('0x1b')](function(){delete _0x2dd5e5['actions'][_0x1c3e97];return _0x1c26ad(msgResponse(_0x5e63('0x164'),'Error',_0x5e63('0x189')));});});});};Dialer[_0x5e63('0x18')]['checkRetriveMax']=function(_0x17133d,_0x1b4e4f,_0x1f1258){var _0x3a9cf9=new History(_0x1b4e4f);if(_0x3a9cf9[_0x5e63('0x125')]+_0x3a9cf9[_0x5e63('0x126')]+_0x3a9cf9[_0x5e63('0x127')]+_0x3a9cf9['countnosuchnumberretry']+_0x3a9cf9[_0x5e63('0xe3')]+_0x3a9cf9[_0x5e63('0xf4')]+_0x3a9cf9[_0x5e63('0x123')]+_0x3a9cf9[_0x5e63('0x128')]>=_0x1f1258['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x17133d){case 0x3:if(_0x3a9cf9[_0x5e63('0x127')]>=_0x1f1258['dialNoAnswerMaxRetry']-0x1){return!![];}hopperUtils[_0x5e63('0xe5')]({'active':![],'countnoanswerretry':_0x3a9cf9[_0x5e63('0x127')]+=0x1,'scheduledat':moment()[_0x5e63('0xe6')](_0x1f1258[_0x5e63('0x18a')],_0x5e63('0xe7'))[_0x5e63('0x8c')](_0x5e63('0xcc')),'ContactId':_0x3a9cf9[_0x5e63('0xe8')],'ListId':_0x3a9cf9['ListId'],'VoiceQueueId':_0x3a9cf9[_0x5e63('0xea')]||undefined,'CampaignId':_0x3a9cf9[_0x5e63('0xf6')]||undefined})[_0x5e63('0xa7')](loggerCatch(_0x5e63('0x18b')));break;case 0x5:if(_0x3a9cf9[_0x5e63('0x125')]>=_0x1f1258[_0x5e63('0x18c')]-0x1){return!![];}hopperUtils[_0x5e63('0xe5')]({'active':![],'countbusyretry':_0x3a9cf9[_0x5e63('0x125')]+=0x1,'scheduledat':moment()[_0x5e63('0xe6')](_0x1f1258['dialBusyRetryFrequency'],_0x5e63('0xe7'))[_0x5e63('0x8c')](_0x5e63('0xcc')),'ContactId':_0x3a9cf9[_0x5e63('0xe8')],'ListId':_0x3a9cf9[_0x5e63('0xe9')],'VoiceQueueId':_0x3a9cf9[_0x5e63('0xea')]||undefined,'CampaignId':_0x3a9cf9[_0x5e63('0xf6')]||undefined})[_0x5e63('0xa7')](loggerCatch(_0x5e63('0x18d')));break;case 0x8:if(_0x3a9cf9['countcongestionretry']>=_0x1f1258[_0x5e63('0x18e')]-0x1){return!![];}hopperUtils[_0x5e63('0xe5')]({'active':![],'countcongestionretry':_0x3a9cf9[_0x5e63('0x126')]+=0x1,'scheduledat':moment()['add'](_0x1f1258[_0x5e63('0x18f')],_0x5e63('0xe7'))[_0x5e63('0x8c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3a9cf9[_0x5e63('0xe8')],'ListId':_0x3a9cf9[_0x5e63('0xe9')],'VoiceQueueId':_0x3a9cf9[_0x5e63('0xea')]||undefined,'CampaignId':_0x3a9cf9[_0x5e63('0xf6')]||undefined})[_0x5e63('0xa7')](loggerCatch(_0x5e63('0x190')));break;case 0x0:if(_0x3a9cf9['countnosuchnumberretry']>=_0x1f1258[_0x5e63('0x191')]-0x1){return!![];}else{hopperUtils[_0x5e63('0xe5')]({'active':![],'countnosuchnumberretry':_0x3a9cf9[_0x5e63('0x132')]+=0x1,'scheduledat':moment()[_0x5e63('0xe6')](_0x1f1258['dialNoSuchNumberRetryFrequency'],_0x5e63('0xe7'))[_0x5e63('0x8c')](_0x5e63('0xcc')),'ContactId':_0x3a9cf9['ContactId'],'ListId':_0x3a9cf9[_0x5e63('0xe9')],'VoiceQueueId':_0x3a9cf9[_0x5e63('0xea')]||undefined,'CampaignId':_0x3a9cf9[_0x5e63('0xf6')]||undefined})[_0x5e63('0xa7')](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x3a9cf9['countdropretry']>=_0x1f1258[_0x5e63('0x192')]-0x1){return!![];}hopperUtils[_0x5e63('0xe5')]({'active':![],'countdropretry':_0x3a9cf9['countdropretry']+=0x1,'scheduledat':moment()[_0x5e63('0xe6')](_0x1f1258['dialDropRetryFrequency'],_0x5e63('0xe7'))[_0x5e63('0x8c')](_0x5e63('0xcc')),'ContactId':_0x3a9cf9[_0x5e63('0xe8')],'ListId':_0x3a9cf9[_0x5e63('0xe9')],'VoiceQueueId':_0x3a9cf9[_0x5e63('0xea')]||undefined,'CampaignId':_0x3a9cf9[_0x5e63('0xf6')]||undefined})[_0x5e63('0xa7')](loggerCatch(_0x5e63('0xeb')));break;case 0xb:if(_0x3a9cf9[_0x5e63('0xf4')]>=_0x1f1258[_0x5e63('0xf5')]-0x1){return!![];}hopperUtils[_0x5e63('0xe5')]({'active':![],'countabandonedretry':_0x3a9cf9[_0x5e63('0xf4')]+=0x1,'scheduledat':moment()[_0x5e63('0xe6')](_0x1f1258[_0x5e63('0xf2')],_0x5e63('0xe7'))[_0x5e63('0x8c')](_0x5e63('0xcc')),'ContactId':_0x3a9cf9['ContactId'],'ListId':_0x3a9cf9['ListId'],'VoiceQueueId':_0x3a9cf9[_0x5e63('0xea')]||undefined,'CampaignId':_0x3a9cf9['CampaignId']||undefined})[_0x5e63('0xa7')](loggerCatch(_0x5e63('0x193')));break;case 0x13:if(_0x3a9cf9[_0x5e63('0x123')]>=_0x1f1258[_0x5e63('0x133')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x3a9cf9[_0x5e63('0x123')]+=0x1,'scheduledat':moment()[_0x5e63('0xe6')](_0x1f1258[_0x5e63('0x12d')],_0x5e63('0xe7'))['format'](_0x5e63('0xcc')),'ContactId':_0x3a9cf9[_0x5e63('0xe8')],'ListId':_0x3a9cf9['ListId'],'VoiceQueueId':_0x3a9cf9[_0x5e63('0xea')]||undefined,'CampaignId':_0x3a9cf9[_0x5e63('0xf6')]||undefined})[_0x5e63('0xa7')](loggerCatch(_0x5e63('0x12e')));break;case 0x14:if(_0x3a9cf9[_0x5e63('0x128')]>=_0x1f1258[_0x5e63('0x194')]-0x1){return!![];}hopperUtils[_0x5e63('0xe5')]({'active':![],'countagentrejectretry':_0x3a9cf9[_0x5e63('0x128')]+=0x1,'scheduledat':moment()[_0x5e63('0xe6')](_0x1f1258[_0x5e63('0x195')],_0x5e63('0xe7'))['format'](_0x5e63('0xcc')),'ContactId':_0x3a9cf9[_0x5e63('0xe8')],'ListId':_0x3a9cf9[_0x5e63('0xe9')],'VoiceQueueId':_0x3a9cf9['VoiceQueueId']||undefined,'CampaignId':_0x3a9cf9[_0x5e63('0xf6')]||undefined})['catch'](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer['prototype'][_0x5e63('0x112')]=function(_0x1b803b,_0x2ae36f,_0x5363de){var _0xc21da2=this;var _0x30b312=new History(_0x1b803b);var _0x452d06=![];var _0x3313e1;var _0x113ee1;return new Promise(function(_0x21dc35,_0x2930a4){if(_[_0x5e63('0x53')](_0x2ae36f)&&typeof _0x2ae36f!==_0x5e63('0x162')){return _0x2930a4(msgResponse(_0x5e63('0x196'),'Failure',_0x5e63('0x197')));}if(_[_0x5e63('0x53')](_0x5363de)&&typeof _0x5363de!==_0x5e63('0x162')){return _0x2930a4(msgResponse('[callProgressDetecting]',_0x5e63('0x99'),_0x5e63('0x198')));}hopperUtils[_0x5e63('0xe1')](_0x30b312,_0x5363de['reason'],_0x2ae36f)[_0x5e63('0x3d')](function(_0x1552f3){if(_0x1552f3[_0x5e63('0xe2')]==0x1)_0x452d06=!![];switch(_0x5363de[_0x5e63('0xcf')]){case'0':_0x2ae36f[_0x5e63('0x199')]+=0x1;_0x30b312[_0x5e63('0x74')]=0x0;_0x30b312[_0x5e63('0x75')]=_0x5e63('0x19a');_0x30b312[_0x5e63('0x132')]+=0x1;_0x30b312['countglobal']+=0x1;ami[_0x5e63('0x11c')](_0x5e63('0x19b'),ut[_0x5e63('0x11e')](_0x1b803b,_0x5e63('0x19c')));_0x3313e1=_0x2ae36f[_0x5e63('0x19d')];_0x113ee1=_0x2ae36f[_0x5e63('0xe0')];hopperUtils[_0x5e63('0xd4')](_0x30b312)[_0x5e63('0xa7')](loggerCatch(_0x5e63('0x124')));if(_0xc21da2[_0x5e63('0x19e')](0x0,_0x1b803b,_0x2ae36f)&&!_0x452d06){if(_0x30b312[_0x5e63('0x132')]>=_0x2ae36f[_0x5e63('0x191')]){_0xc21da2['createStateFinal'](_0x30b312,_0x21dc35,_0x2930a4,_0x5e63('0x19f'));}else{_0xc21da2[_0x5e63('0x129')](_0x30b312,_0x21dc35,_0x2930a4,_0x5e63('0x19f'));}}break;case'3':_0x2ae36f[_0x5e63('0x1a0')]+=0x1;_0x30b312['state']=0x3;_0x30b312[_0x5e63('0x75')]='NoAnswer';_0x30b312['countnoanswerretry']+=0x1;_0x30b312[_0x5e63('0xde')]+=0x1;var _0x1e5cbb=ut['buildNoAnswerEventPayload'](_0x1b803b,_0x2ae36f);ami['emit'](_0x5e63('0x1a1'),_0x1e5cbb);_0x3313e1=_0x2ae36f[_0x5e63('0x18a')];_0x113ee1=_0x2ae36f[_0x5e63('0xe0')];hopperUtils['createHistory'](_0x30b312)[_0x5e63('0xa7')](loggerCatch(_0x5e63('0x1a2')));if(_0xc21da2[_0x5e63('0x19e')](0x3,_0x1b803b,_0x2ae36f)&&!_0x452d06){if(_0x30b312[_0x5e63('0x127')]>=_0x2ae36f['dialNoAnswerMaxRetry']){_0xc21da2[_0x5e63('0x12b')](_0x30b312,_0x21dc35,_0x2930a4,_0x5e63('0x1a3'));}else{_0xc21da2['stateGlobal'](_0x30b312,_0x21dc35,_0x2930a4,_0x5e63('0x1a3'));}}break;case'5':_0x2ae36f[_0x5e63('0x1a4')]+=0x1;_0x30b312[_0x5e63('0x74')]=0x5;_0x30b312[_0x5e63('0x75')]=_0x5e63('0x1a5');_0x30b312[_0x5e63('0x125')]+=0x1;_0x30b312['countglobal']+=0x1;ami[_0x5e63('0x11c')]('custom:agentbusy',ut['buildObj'](_0x1b803b,_0x5e63('0x1a6')));_0x3313e1=_0x2ae36f[_0x5e63('0x1a7')];_0x113ee1=_0x2ae36f[_0x5e63('0xe0')];hopperUtils[_0x5e63('0xd4')](_0x30b312)[_0x5e63('0xa7')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0xc21da2['checkRetriveMax'](0x5,_0x1b803b,_0x2ae36f)&&!_0x452d06){if(_0x30b312[_0x5e63('0x125')]>=_0x2ae36f['dialBusyMaxRetry']){_0xc21da2['createStateFinal'](_0x30b312,_0x21dc35,_0x2930a4,_0x5e63('0x1a8'));}else{_0xc21da2[_0x5e63('0x129')](_0x30b312,_0x21dc35,_0x2930a4,'reason\x205\x20busy');}}break;case'8':_0x2ae36f[_0x5e63('0x1a9')]+=0x1;_0x30b312[_0x5e63('0x74')]=0x8;_0x30b312[_0x5e63('0x75')]=_0x5e63('0x1aa');_0x30b312[_0x5e63('0x126')]+=0x1;_0x30b312[_0x5e63('0xde')]+=0x1;_0x3313e1=_0x2ae36f['dialCongestionRetryFrequency'];_0x113ee1=_0x2ae36f['callAdditionalPhoneAfterMin'];ami['emit'](_0x5e63('0x1ab'),ut[_0x5e63('0x11e')](_0x1b803b,_0x5e63('0x1ac')));hopperUtils[_0x5e63('0xd4')](_0x30b312)['catch'](loggerCatch(_0x5e63('0x1ad')));if(_0xc21da2[_0x5e63('0x19e')](0x8,_0x1b803b,_0x2ae36f)&&!_0x452d06){if(_0x30b312[_0x5e63('0x126')]>=_0x2ae36f[_0x5e63('0x18e')]){_0xc21da2['createStateFinal'](_0x30b312,_0x21dc35,_0x2930a4,_0x5e63('0x1ae'));}else{_0xc21da2[_0x5e63('0x129')](_0x30b312,_0x21dc35,_0x2930a4,'reason\x208\x20congestion');}}break;case'11':_0x2ae36f['outboundAbandonedCallsDay']+=0x1;_0x30b312[_0x5e63('0x74')]=0xb;_0x30b312[_0x5e63('0x75')]='Abandoned';_0x30b312[_0x5e63('0xf4')]+=0x1;_0x30b312[_0x5e63('0xde')]+=0x1;_0x3313e1=_0x2ae36f['dialAbandonedRetryFrequency'];_0x113ee1=_0x2ae36f[_0x5e63('0xe0')];hopperUtils[_0x5e63('0xd4')](_0x30b312)[_0x5e63('0xa7')](loggerCatch(_0x5e63('0xf7')));if(_0xc21da2['checkRetriveMax'](0xb,_0x1b803b,_0x2ae36f)&&!_0x452d06){if(_0x30b312[_0x5e63('0xf4')]>=_0x2ae36f[_0x5e63('0xf5')]){_0xc21da2[_0x5e63('0x12b')](_0x30b312,_0x21dc35,_0x2930a4,_0x5e63('0x1af'));}else{_0xc21da2['stateGlobal'](_0x30b312,_0x21dc35,_0x2930a4,_0x5e63('0x1af'));}}break;case'20':_0x2ae36f[_0x5e63('0x1b0')]+=0x1;_0x30b312[_0x5e63('0x74')]=0x14;_0x30b312['statedesc']=_0x5e63('0x1b1');_0x30b312[_0x5e63('0x128')]+=0x1;_0x30b312[_0x5e63('0xde')]+=0x1;_0x3313e1=_0x2ae36f[_0x5e63('0x195')];_0x113ee1=_0x2ae36f[_0x5e63('0xe0')];ami['emit'](_0x5e63('0x1b2'),ut[_0x5e63('0x11e')](_0x1b803b,_0x5e63('0x1b3')));hopperUtils[_0x5e63('0xd4')](_0x30b312)[_0x5e63('0xa7')](loggerCatch(_0x5e63('0x1b4')));if(_0xc21da2[_0x5e63('0x19e')](0x14,_0x1b803b,_0x2ae36f)&&!_0x452d06){if(_0x30b312['countagentrejectretry']>=_0x2ae36f[_0x5e63('0x194')]){_0xc21da2[_0x5e63('0x12b')](_0x30b312,_0x21dc35,_0x2930a4,'reason\x2020\x20agentreject');}else{_0xc21da2['stateGlobal'](_0x30b312,_0x21dc35,_0x2930a4,'reason\x2020\x20agentreject');}}break;default:_0x2ae36f[_0x5e63('0x1b5')]+=0x1;_0x30b312[_0x5e63('0x74')]=0xc;_0x30b312[_0x5e63('0x75')]=_0x5363de[_0x5e63('0xcf')];_0x3313e1=_0x2ae36f[_0x5e63('0x195')];_0x113ee1=_0x2ae36f[_0x5e63('0xe0')];hopperUtils[_0x5e63('0xd4')](_0x30b312)[_0x5e63('0xa7')](loggerCatch(_0x5e63('0x1b6')));if(_0xc21da2['checkRetriveMax'](_0x5363de[_0x5e63('0xcf')],_0x1b803b,_0x2ae36f)&&!_0x452d06){if(_0x30b312['countbusyretry']+_0x30b312[_0x5e63('0x126')]+_0x30b312[_0x5e63('0x127')]+_0x30b312['countnosuchnumberretry']+_0x30b312[_0x5e63('0xe3')]+_0x30b312[_0x5e63('0xf4')]+_0x30b312[_0x5e63('0x123')]+_0x30b312[_0x5e63('0x128')]>=_0x2ae36f[_0x5e63('0x1b7')]){_0xc21da2[_0x5e63('0x129')](_0x30b312,_0x21dc35,_0x2930a4,_0x5363de[_0x5e63('0xcf')]);}else{_0xc21da2[_0x5e63('0x12b')](_0x30b312,_0x21dc35,_0x2930a4,_0x5363de[_0x5e63('0xcf')]);}}}})[_0x5e63('0x3d')](function(){if(_0x452d06){hopperUtils['swapAdditionalPhones'](_0x30b312,_0x3313e1,_0x113ee1)[_0x5e63('0x3d')](function(){return _0x21dc35(0x1);});}});});};Dialer[_0x5e63('0x18')][_0x5e63('0x129')]=function(_0x533c88,_0x15b04b,_0x2ec9dd,_0x4ccbbc){var _0x2f6d85=new Final(_0x533c88);_0x2f6d85[_0x5e63('0x74')]=0xf;_0x2f6d85['statedesc']=_0x5e63('0x1b8');this[_0x5e63('0x12b')](_0x2f6d85,_0x15b04b,_0x2ec9dd,_0x4ccbbc);};Dialer[_0x5e63('0x18')][_0x5e63('0x12b')]=function(_0x45e10c,_0x418d1c,_0x412215,_0x5ce86b){hopperUtils[_0x5e63('0xd5')](_0x45e10c)[_0x5e63('0x3d')](function(){return _0x418d1c(msgResponse(_0x5e63('0x196'),'Success',_0x5ce86b));})['catch'](function(){return _0x412215(msgResponse(_0x5e63('0x1b9'),_0x5e63('0x99'),'contact\x20not\x20moved'));});};Dialer[_0x5e63('0x18')][_0x5e63('0xb8')]=function(_0x2c6989){var _0x21ba41=_0x2c6989['dialPredictiveOptimizationPercentage']/0x64;var _0x28055c=_0x2c6989[_0x5e63('0xda')]/(_0x2c6989[_0x5e63('0xda')]+_0x2c6989[_0x5e63('0xce')]);var _0x35aa80=Math[_0x5e63('0x1ba')](_0x2c6989['predictiveIntervalAvailable']*(_0x2c6989[_0x5e63('0x1bb')]/0x64));var _0x36ff64=Math[_0x5e63('0x1ba')](_0x2c6989[_0x5e63('0x1bc')]*(_0x2c6989[_0x5e63('0x1bd')]/0x64));var _0x2a89bc=_0x2c6989['available']+_0x2c6989[_0x5e63('0x1be')];var _0x74b347=Math[_0x5e63('0x1bf')](_0x2c6989[_0x5e63('0x5b')]*_0x2c6989[_0x5e63('0x61')]*_0x2c6989[_0x5e63('0x1c0')]*_0x2c6989[_0x5e63('0x1c1')]);if(_['isUndefined'](_0x2c6989['startProgressive'])){if(!_[_0x5e63('0x53')](_0x2c6989[_0x5e63('0x26')])){_0x2c6989[_0x5e63('0x26')]=undefined;loggerPredictive[_0x5e63('0x69')](_0x5e63('0x1c2'),'check\x20predictive\x20is\x20not\x20undefine');}if(!_[_0x5e63('0x53')](_0x2c6989[_0x5e63('0x67')])){loggerPredictive['error'](_0x5e63('0x1c2'),_0x5e63('0x1c3'));clearInterval(_0x2c6989[_0x5e63('0x67')]);_0x2c6989[_0x5e63('0x67')]=undefined;}_0x2c6989[_0x5e63('0x64')]=moment()['format'](_0x5e63('0xcc'));loggerPredictive['info'](_0x2c6989[_0x5e63('0x45')],'collection\x20data\x20in\x20progressive\x20at',_0x2c6989[_0x5e63('0x64')]);this[_0x5e63('0xb7')](_0x2c6989,0x1);}else if(ifInterval(_0x2c6989[_0x5e63('0x1c4')],_0x2c6989['startProgressive'])){this[_0x5e63('0xb7')](_0x2c6989,0x1);loggerPredictiveCalls[_0x5e63('0x48')](_0x5e63('0x1c5'),_0x2c6989[_0x5e63('0x64')],_0x2c6989[_0x5e63('0x45')]);_0x2c6989[_0x5e63('0x5b')]=0x0;_0x2c6989[_0x5e63('0xdb')]=0x0;}else if(_0x21ba41<_0x28055c&&_0x2c6989[_0x5e63('0x1c6')]==='dropRate'){clearPredictiveAttributes(_0x2c6989);loggerPredictive['info'](_0x5e63('0x1c7'),_0x5e63('0x1c8'),_0x28055c,_0x5e63('0x64'),_0x2c6989['name']);}else if(_0x74b347<_0x2c6989[_0x5e63('0xdb')]&&_0x2c6989['dialPredictiveOptimization']===_0x5e63('0x1c9')){clearPredictiveAttributes(_0x2c6989);loggerPredictive[_0x5e63('0x48')]('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0x5e63('0x1ca'),_0x74b347,'Drop\x20in\x20this\x20interval',_0x2c6989[_0x5e63('0xdb')],'startProgressive',_0x2c6989['name']);}else if(!ifInterval(_0x2c6989[_0x5e63('0x1c4')],_0x2c6989[_0x5e63('0x64')])&&_[_0x5e63('0x53')](_0x2c6989[_0x5e63('0x26')])&&!_[_0x5e63('0x53')](_0x2c6989[_0x5e63('0x64')])){_0x2c6989[_0x5e63('0x26')]=moment()[_0x5e63('0x8c')](_0x5e63('0xcc'));loggerPredictive['info'](_0x2c6989[_0x5e63('0x45')],_0x5e63('0x1cb'),_0x2c6989[_0x5e63('0x26')]);hopperUtils[_0x5e63('0x1cc')](_0x2c6989['dialPredictiveInterval'])[_0x5e63('0x3d')](this[_0x5e63('0x1cd')](_0x2c6989))['then'](mergeDataErlangB(_0x2c6989))[_0x5e63('0x3d')](this['startMethodPredictive'](_0x2c6989))[_0x5e63('0xa7')](loggerCatchPredictive(_0x5e63('0x1ce'),_0x2c6989));}else if(!ifInterval(_0x2c6989[_0x5e63('0x1c4')],_0x2c6989[_0x5e63('0x26')])){_0x2c6989[_0x5e63('0xdb')]=0x0;_0x2c6989[_0x5e63('0x26')]=moment()[_0x5e63('0x8c')](_0x5e63('0xcc'));loggerPredictive[_0x5e63('0x48')](_0x2c6989[_0x5e63('0x45')],_0x5e63('0x1cf'),_0x2c6989[_0x5e63('0x26')]);clearInterval(_0x2c6989[_0x5e63('0x67')]);_0x2c6989[_0x5e63('0x67')]=undefined;hopperUtils[_0x5e63('0x1cc')](_0x2c6989[_0x5e63('0x1c4')])[_0x5e63('0x3d')](this['getDataPredictive'](_0x2c6989))[_0x5e63('0x3d')](mergeDataErlangB(_0x2c6989))[_0x5e63('0x3d')](this[_0x5e63('0x1d0')](_0x2c6989))[_0x5e63('0xa7')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x2c6989));}else if(_0x2c6989[_0x5e63('0x1bc')]&&_0x2a89bc<_0x2c6989[_0x5e63('0x1bc')]-_0x36ff64){clearPredictiveAttributes(_0x2c6989);loggerPredictive[_0x5e63('0x48')](_0x2c6989[_0x5e63('0x45')],_0x5e63('0x1d1'),_0x2a89bc,')\x20are\x20less\x20than\x20threshold\x20(',_0x2c6989['predictiveIntervalAvailable'],'-',_0x36ff64,'=',_0x2c6989[_0x5e63('0x1bc')]-_0x36ff64,')');}else if(_0x2c6989[_0x5e63('0x1bc')]&&_0x2a89bc>_0x2c6989[_0x5e63('0x1bc')]+_0x35aa80){clearPredictiveAttributes(_0x2c6989);loggerPredictive['info'](_0x2c6989[_0x5e63('0x45')],_0x5e63('0x1d1'),_0x2a89bc,_0x5e63('0x1d2'),_0x2c6989['predictiveIntervalAvailable'],'+',_0x35aa80,'=',_0x2c6989[_0x5e63('0x1bc')]+_0x35aa80,')');}};Dialer['prototype'][_0x5e63('0x1cd')]=function(_0x1f73cb){var _0x2dc856=this;return function(_0x591890){return new Promise(function(_0x43b8a3,_0xe38f61){_[_0x5e63('0x62')](_0x1f73cb,_0x591890[0x0]);if(checkGetDataPredictive(_0x591890[0x0])){var _0x5bdc4d=_0x1f73cb['predictiveIntervalAvailable']=_0x1f73cb[_0x5e63('0x1be')]+_0x1f73cb['available'];var _0x2576ff=_0x1f73cb['dialPredictiveInterval']*0x3c;var _0x3d5bbe=_0x591890[0x0]['predictiveIntervalAvgTalktime']+_0x591890[0x0]['predictiveIntervalAvgHoldtime'];var _0x97ed53=(_0x591890[0x0][_0x5e63('0x4b')]+_0x591890[0x0][_0x5e63('0xd9')]+_0x591890[0x0][_0x5e63('0x4e')])/_0x591890[0x0][_0x5e63('0x4a')];_0x1f73cb[_0x5e63('0x1c0')]=_0x97ed53>0x0?_0x97ed53:0x1;switch(_0x1f73cb['dialPredictiveOptimization']){case'dropRate':var _0x209596=_0x1f73cb[_0x5e63('0x1d3')]/0x64;return _0x2dc856[_0x5e63('0x1d4')](_0x5bdc4d,_0x2576ff,_0x3d5bbe,_0x97ed53,_0x209596)['then'](function(_0x51ee95){return _0x43b8a3(_0x51ee95);});case'agentBusyFactor':var _0x20f7c1=_0x1f73cb[_0x5e63('0x1d3')]/0x64;return _0x2dc856['busyFactor'](_0x5bdc4d,_0x2576ff,_0x3d5bbe,_0x97ed53,_0x20f7c1)[_0x5e63('0x3d')](function(_0x1497d5){return _0x43b8a3(_0x1497d5);});default:return _0xe38f61(msgResponse(_0x5e63('0x1d5'),_0x5e63('0x99'),'Unknown\x20Predictive'));}}else{return _0xe38f61(msgResponse('[getDataPredictive]',_0x5e63('0x99'),_0x5e63('0x1d6')));}});};};Dialer[_0x5e63('0x18')][_0x5e63('0x1d7')]=function(_0x59fb29){var _0x3c3064=this;return function(_0x48557d){return new Promise(function(_0x23ca98,_0x3e1c8b){_[_0x5e63('0x62')](_0x59fb29,_0x48557d[0x0]);if(checkGetDataPredictive(_0x48557d[0x0])){loggerPredictive[_0x5e63('0x48')](JSON[_0x5e63('0x7b')](_0x48557d[0x0]));if(_0x59fb29['dialPredictiveOptimization']===_0x5e63('0x1c9')){return _0x3c3064[_0x5e63('0x158')](_0x59fb29['id'])[_0x5e63('0x3d')](function(_0x2e9812){var _0xb21fe=_0x59fb29[_0x5e63('0x1d8')]-_0x2e9812[0x0][_0x5e63('0x1d9')];var _0x14782e=_0x59fb29[_0x5e63('0x1c4')]*0x3c;var _0xf44324=_0x48557d[0x0]['predictiveIntervalAvgTalktime']+_0x48557d[0x0][_0x5e63('0x50')];var _0x44aef8=(_0x48557d[0x0][_0x5e63('0x4b')]+_0x48557d[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x48557d[0x0][_0x5e63('0x4e')])/_0x48557d[0x0][_0x5e63('0x4a')];var _0x1349b4=_0x59fb29[_0x5e63('0x1d3')]/0x64;_0x59fb29['predictiveIntervalPauses']=_0x2e9812[0x0][_0x5e63('0x1d9')]||0x0;_0x59fb29['predictiveIntervalHitRate']=_0x44aef8>0x0?_0x44aef8:0x1;return _0x3c3064[_0x5e63('0x1d4')](_0xb21fe,_0x14782e,_0xf44324,_0x44aef8,_0x1349b4);})[_0x5e63('0x3d')](function(_0x3ab39e){return _0x23ca98(_0x3ab39e);})['catch'](function(_0x5a4b05){return _0x3e1c8b(msgResponse(_0x5e63('0x1da'),'Failure',JSON[_0x5e63('0x7b')](_0x5a4b05)));});}if(_0x59fb29['dialPredictiveOptimization']===_0x5e63('0x1db')){return _0x3c3064[_0x5e63('0x158')](_0x59fb29['id'])[_0x5e63('0x3d')](function(_0x3ae7e8){var _0x2f2929=_0x59fb29['loggedIn']-_0x3ae7e8[0x0][_0x5e63('0x1d9')];var _0x3b1407=_0x59fb29[_0x5e63('0x1c4')]*0x3c;var _0x2dcb49=_0x48557d[0x0][_0x5e63('0x54')]+_0x48557d[0x0][_0x5e63('0x50')];var _0x2977d5=(_0x48557d[0x0][_0x5e63('0x4b')]+_0x48557d[0x0][_0x5e63('0xd9')]+_0x48557d[0x0][_0x5e63('0x4e')])/_0x48557d[0x0][_0x5e63('0x4a')];var _0x3b9781=_0x59fb29[_0x5e63('0x1d3')]/0x64;_0x59fb29[_0x5e63('0x1dc')]=_0x3ae7e8[0x0][_0x5e63('0x1d9')]||0x0;_0x59fb29[_0x5e63('0x1c0')]=_0x2977d5>0x0?_0x2977d5:0x1;return _0x3c3064[_0x5e63('0x1dd')](_0x2f2929,_0x3b1407,_0x2dcb49,_0x2977d5,_0x3b9781);})[_0x5e63('0x3d')](function(_0x56de05){return _0x23ca98(_0x56de05);})['catch'](function(_0x5e94c6){return _0x3e1c8b(msgResponse('[CatchErlangB]','Failure',JSON[_0x5e63('0x7b')](_0x5e94c6)));});}}else{return _0x3e1c8b(msgResponse(_0x5e63('0x1d5'),_0x5e63('0x99'),'check\x20failure'));}});};};Dialer[_0x5e63('0x18')][_0x5e63('0x1d0')]=function(_0x41b50f){var _0x4abd25=this;return function(){var _0x2e52b1=0x0;var _0x1f20e6=Math[_0x5e63('0x1bf')](_0x41b50f[_0x5e63('0x5d')]*0x3e8);if(_0x1f20e6>0x0){_0x1f20e6=_0x1f20e6<0x64?0x64:_0x1f20e6;loggerPredictive[_0x5e63('0x48')](_0x41b50f[_0x5e63('0x45')],_0x5e63('0x1de'),_0x1f20e6,_0x5e63('0x1df'));_0x41b50f[_0x5e63('0x67')]=setInterval(function(){_0x4abd25[_0x5e63('0x67')](_0x41b50f);loggerPredictiveCalls[_0x5e63('0x48')]('[handlePredictive]',_0x2e52b1+=0x1);},_0x1f20e6);}else{loggerPredictive['info'](_0x41b50f['name'],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0x5e63('0x18')][_0x5e63('0x1e0')]=function(_0x21e0cf,_0xc9c576){var _0x58dce6=this;return function(_0x216cb3){if(_[_0x5e63('0x47')](_0x216cb3)){if(_[_0x5e63('0xfd')](_0xc9c576[_0x5e63('0x1e1')])||!_0xc9c576['recallme']){if(_0x21e0cf[_0x5e63('0xb5')]==='booked'){_0x21e0cf[_0x5e63('0x78')]=_[_0x5e63('0x53')](_0x21e0cf[_0x5e63('0x78')])?!![]:_0x21e0cf[_0x5e63('0x78')];var _0x5cd87d=uuid['v4']();_0x58dce6[_0x5e63('0xf8')][_0x5cd87d]=new Action(_0x21e0cf,_0xc9c576,_0x5cd87d);loggerBooked[_0x5e63('0x48')]('[booked][checkContactBlack]',_0x5cd87d,_0x5e63('0x1e2'),JSON[_0x5e63('0x7b')](_0x21e0cf[_0x5e63('0x78')]),'Queue:\x20',_0x21e0cf['name']);if(_0x21e0cf['queueStatusComplete']){_0x21e0cf[_0x5e63('0x78')]=![];_0x58dce6[_0x5e63('0x28')][_0x58dce6['actions'][_0x5cd87d][_0x5e63('0xca')]]=[];ami[_0x5e63('0xa0')]({'actionid':_0x5cd87d,'action':_0x5e63('0x1e3'),'queue':_0x21e0cf[_0x5e63('0x45')]})[_0x5e63('0xa7')](function(){_0x58dce6['updateOriginated'](_0x21e0cf);hopperUtils[_0x5e63('0xe5')]({'active':![],'ContactId':_0x58dce6['actions'][_0x5cd87d][_0x5e63('0xe8')],'ListId':_0x58dce6[_0x5e63('0xf8')][_0x5cd87d]['ListId'],'VoiceQueueId':_0x58dce6['actions'][_0x5cd87d][_0x5e63('0xea')]||undefined,'CampaignId':_0x58dce6[_0x5e63('0xf8')][_0x5cd87d][_0x5e63('0xf6')]||undefined})[_0x5e63('0xa7')](loggerCatch(_0x5e63('0x1e4')));delete _0x58dce6[_0x5e63('0xf8')][_0x5cd87d];});}else{loggerBooked['info'](_0x5e63('0x1e5'),JSON[_0x5e63('0x7b')](_0x21e0cf[_0x5e63('0x78')]),_0x5e63('0x1e6'),_0x21e0cf[_0x5e63('0x45')]);_0x58dce6[_0x5e63('0xc9')](_0x21e0cf);hopperUtils['rescheduleContact']({'active':![],'ContactId':_0x58dce6[_0x5e63('0xf8')][_0x5cd87d]['ContactId'],'ListId':_0x58dce6['actions'][_0x5cd87d][_0x5e63('0xe9')],'VoiceQueueId':_0x58dce6['actions'][_0x5cd87d]['VoiceQueueId']||undefined,'CampaignId':_0x58dce6[_0x5e63('0xf8')][_0x5cd87d][_0x5e63('0xf6')]||undefined})[_0x5e63('0xa7')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x58dce6[_0x5e63('0xf8')][_0x5cd87d];}}else{return _0x58dce6['actionOriginate'](_0x21e0cf,_0xc9c576);}}else{if(utils['getSeconds'](undefined,_0xc9c576['scheduledat'])<_0x21e0cf[_0x5e63('0x1e7')]*0x3c){if(_0xc9c576[_0x5e63('0x14f')]&&!_0xc9c576['Agent'][_0x5e63('0x1e8')]){_0x58dce6[_0x5e63('0x1d')][_0x5e63('0x103')](_0xc9c576['id'])[_0x5e63('0x1b')](function(){_0x58dce6['updateOriginated'](_0x21e0cf);});}else{hopperUtils[_0x5e63('0x1e9')]({'active':![]},_0xc9c576['id'],0x1)[_0x5e63('0x1b')](function(){_0x58dce6[_0x5e63('0xc9')](_0x21e0cf);});}}else{_0x21e0cf[_0x5e63('0x1ea')]+=0x1;_0x58dce6[_0x5e63('0xc9')](_0x21e0cf);if(_0x21e0cf[_0x5e63('0x1eb')]){hopperUtils[_0x5e63('0xe5')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0xc9c576[_0x5e63('0xe8')],'ListId':_0xc9c576[_0x5e63('0xe9')],'VoiceQueueId':_0xc9c576['VoiceQueueId']||undefined,'CampaignId':_0xc9c576[_0x5e63('0xf6')]||undefined})['catch'](loggerCatch('[rescheduleContact][dialRecallInQueue]'));hopperUtils[_0x5e63('0xd4')](createObjHistory(_0x21e0cf,_0xc9c576,utils[_0x5e63('0x6e')]['QUEUE_RECALL'],0x17,_0x5e63('0x1ec')))[_0x5e63('0xa7')](loggerCatch(_0x5e63('0x1ed')));}else{_0x58dce6[_0x5e63('0x120')](createObjHistory(_0x21e0cf,_0xc9c576,utils[_0x5e63('0x6e')][_0x5e63('0x1ee')],0x16,_0x5e63('0x1ef')),_0x5e63('0x1f0'),_0x5e63('0x1f1'));}}}}else{_0x21e0cf[_0x5e63('0x1f2')]+=0x1;_0x58dce6[_0x5e63('0x120')](createObjHistory(_0x21e0cf,_0xc9c576,utils[_0x5e63('0x6e')][_0x5e63('0x1f3')],0xd,_0x5e63('0x1f4')),_0x5e63('0x1f5'),'[Originate][MoveBlacklist]');throw _0x5e63('0x1f6');}};};Dialer[_0x5e63('0x18')]['handleIvr']=function(_0x49d9f0){var _0x5c2ed4=this;var _0x2e622d=_0x49d9f0['limitCalls']-_0x49d9f0[_0x5e63('0x87')];emitCampaignSummary(_0x49d9f0);if(_0x2e622d>0x0&&_0x49d9f0[_0x5e63('0x6b')]==0x0){if(_0x2e622d>this[_0x5e63('0x22')]){_0x2e622d=this[_0x5e63('0x22')];}_0x49d9f0[_0x5e63('0x6b')]=0x1;hopperUtils['getContactDialerIvr'](_0x49d9f0,_0x2e622d)[_0x5e63('0x3d')](function(_0x53a12f){_0x49d9f0[_0x5e63('0x6b')]=0x0;if(_0x53a12f){if(!utils['checkContactEmpty'](_0x53a12f)){_0x49d9f0[_0x5e63('0x6d')]=utils['CAMPAIGN_STATUS']['NO_AVAILABLE_CONTACTS'];logger[_0x5e63('0x48')](_0x5e63('0x1f7')+_0x49d9f0['name']);}else{_0x49d9f0[_0x5e63('0x87')]+=_0x53a12f[_0x5e63('0x9e')];_0x49d9f0[_0x5e63('0x6d')]=utils[_0x5e63('0x6e')][_0x5e63('0x1f8')];for(var _0x23fded=0x0;_0x23fded<_0x53a12f['length'];_0x23fded+=0x1){_0x49d9f0['ivrTotalCallsDays']+=0x1;if(_[_0x5e63('0xfd')](_0x53a12f[_0x23fded])||_[_0x5e63('0xfd')](_0x53a12f[_0x23fded][_0x5e63('0x179')])||_[_0x5e63('0xfd')](_0x53a12f[_0x23fded]['phone'])){_0x5c2ed4[_0x5e63('0x15d')]('[actionOriginate]\x20',_0x49d9f0,_0x53a12f[_0x23fded]);}else{hopperUtils[_0x5e63('0x1f9')](_[_0x5e63('0x7c')](_0x53a12f[_0x23fded],[_0x5e63('0xf6'),_0x5e63('0x163')]))[_0x5e63('0x3d')](_0x5c2ed4[_0x5e63('0x1e0')](_0x49d9f0,_0x53a12f[_0x23fded]))[_0x5e63('0xa7')](_0x5c2ed4[_0x5e63('0x15c')](_0x5e63('0x1fa'),_0x49d9f0));}}}}})['catch'](loggerGetContactDialer('[getContactCampaign2]',_0x49d9f0,_0x2e622d));}};Dialer[_0x5e63('0x18')][_0x5e63('0xb7')]=function(_0x5efb2a,_0x11b820){var _0x243707=this;var _0x41e193=[];if(_0x11b820<0x1||_0x5efb2a['dialMethod']===_0x5e63('0x8')){_0x11b820=0x1;}var _0x454613=Math[_0x5e63('0x1bf')](_0x5efb2a[_0x5e63('0x13f')]*_0x11b820)-_0x5efb2a[_0x5e63('0x87')];if(_0x5efb2a[_0x5e63('0x1fb')]>0x0){var _0x4a14cb=_0x5efb2a[_0x5e63('0x1fb')]-_0x5efb2a[_0x5e63('0x87')]-_0x5efb2a[_0x5e63('0x1be')]-_0x5efb2a[_0x5e63('0x141')];if(_0x454613>_0x4a14cb){_0x454613=_0x4a14cb;}}if(_0x454613>0x0&&_0x5efb2a['temp']==0x0){if(_0x5efb2a[_0x5e63('0xb5')]===_0x5e63('0x8')){_0x454613=0x1;}if(_0x454613>this[_0x5e63('0x22')]){_0x454613=this[_0x5e63('0x22')];}for(var _0x30d816 in this['agents']){if(typeof this['agents'][_0x30d816]!==_0x5e63('0xaf')){if(this[_0x5e63('0x20')][_0x30d816][_0x5e63('0x74')]==='not_inuse'&&this[_0x5e63('0x20')][_0x30d816][_0x5e63('0x8e')]===_0x5e63('0x8f')){_0x41e193[_0x5e63('0x9f')](this[_0x5e63('0x20')][_0x30d816]['id']);}}}_0x5efb2a['temp']=0x1;hopperUtils[_0x5e63('0x1fc')](_0x5efb2a,_0x41e193,_0x454613)[_0x5e63('0x3d')](function(_0x3ee435){_0x5efb2a[_0x5e63('0x6b')]=0x0;if(_0x3ee435){if(!utils['checkContactEmpty'](_0x3ee435)){hopperUtils[_0x5e63('0x1fd')](_0x5efb2a)[_0x5e63('0x3d')](sendMessageReschedule(_0x5efb2a))[_0x5e63('0xa7')](loggerCatch(_0x5e63('0x1fe')));}else{_0x5efb2a[_0x5e63('0x87')]+=_0x3ee435[_0x5e63('0x9e')];_0x5efb2a[_0x5e63('0x6d')]=_0x5efb2a[_0x5e63('0xb5')]==='booked'?utils[_0x5e63('0x6e')][_0x5e63('0x142')]:utils[_0x5e63('0x6e')]['RUNNING'];for(var _0x27f813=0x0;_0x27f813<_0x3ee435['length'];_0x27f813+=0x1){if(_['isNil'](_0x3ee435[_0x27f813])||_['isNil'](_0x3ee435[_0x27f813][_0x5e63('0x179')])||_[_0x5e63('0xfd')](_0x3ee435[_0x27f813][_0x5e63('0x163')])){_0x243707[_0x5e63('0x15d')](_0x5e63('0x1ff'),_0x5efb2a,_0x3ee435[_0x27f813]);}else{hopperUtils[_0x5e63('0x200')](_[_0x5e63('0x7c')](_0x3ee435[_0x27f813],[_0x5e63('0xea'),'phone']))[_0x5e63('0x3d')](_0x243707['checkContactBlack'](_0x5efb2a,_0x3ee435[_0x27f813]))['catch'](_0x243707['loggerHandler']('[actionOriginate]\x20',_0x5efb2a));}}}}})[_0x5e63('0xa7')](loggerGetContactDialer(_0x5e63('0x201'),_0x5efb2a,_0x454613));}};Dialer[_0x5e63('0x18')][_0x5e63('0x67')]=function(_0x18bdd4){if(_0x18bdd4['dialLimitQueue']>0x0){var _0x2f394b=_0x18bdd4[_0x5e63('0x1fb')]-_0x18bdd4['originated']-_0x18bdd4[_0x5e63('0x1be')];if(_0x2f394b>0x0&&_0x18bdd4[_0x5e63('0x6b')]==0x0){this['tryOriginatePredictive'](_0x18bdd4);}else{loggerPredictiveCalls[_0x5e63('0x48')](_0x5e63('0x202'));}}else{this[_0x5e63('0x203')](_0x18bdd4);}};Dialer[_0x5e63('0x18')][_0x5e63('0x203')]=function(_0x1decfd){var _0x2c4f1a=this;var _0x104a3d=[];_0x1decfd['originated']+=0x1;for(var _0x166181 in this[_0x5e63('0x20')]){if(typeof this[_0x5e63('0x20')][_0x166181]!==_0x5e63('0xaf')){if(this[_0x5e63('0x20')][_0x166181][_0x5e63('0x74')]===_0x5e63('0x204')&&this[_0x5e63('0x20')][_0x166181]['status']===_0x5e63('0x8f')){_0x104a3d[_0x5e63('0x9f')](this[_0x5e63('0x20')][_0x166181]['id']);}}}_0x1decfd[_0x5e63('0x6b')]=0x1;return this[_0x5e63('0x1fc')](_0x1decfd['id'],_0x104a3d,0x1,_0x1decfd['dialOrderByScheduledAt'],_0x1decfd)[_0x5e63('0x3d')](function(_0x10dc9f){_0x1decfd[_0x5e63('0x6b')]=0x1;if(_0x10dc9f){if(!utils[_0x5e63('0x205')](_0x10dc9f)){utils[_0x5e63('0x206')](_0x1decfd,0x1,0x0);return hopperUtils['countReScheduled'](_0x1decfd)[_0x5e63('0x3d')](sendMessageReschedule(_0x1decfd))[_0x5e63('0xa7')](loggerCatch(_0x5e63('0x1fe')));}else{_0x1decfd[_0x5e63('0x6d')]=utils[_0x5e63('0x6e')][_0x5e63('0x1f8')];if(_['isNil'](_0x10dc9f[0x0])||_[_0x5e63('0xfd')](_0x10dc9f[0x0][_0x5e63('0x179')])||_[_0x5e63('0xfd')](_0x10dc9f[0x0][_0x5e63('0x163')])){_0x2c4f1a[_0x5e63('0x15d')](_0x5e63('0x1ff'),_0x1decfd,_0x10dc9f[0x0]);}else{return hopperUtils[_0x5e63('0x200')](_[_0x5e63('0x7c')](_0x10dc9f[0x0],[_0x5e63('0xea'),_0x5e63('0x163')]))['then'](_0x2c4f1a[_0x5e63('0x1e0')](_0x1decfd,_0x10dc9f[0x0]))['catch'](_0x2c4f1a['loggerHandler'](_0x5e63('0x207'),_0x1decfd));}}}})[_0x5e63('0xa7')](loggerGetContactDialer(_0x5e63('0x208'),_0x1decfd,0x1));};Dialer['prototype']['abandonmentRate']=function(_0x4fe9ba,_0x9e586c,_0x34deed,_0x4ec83d,_0x1c51a4,_0x21a6d4){loggerPredictive[_0x5e63('0x48')](_0x5e63('0x209'));loggerPredictive['info'](_0x5e63('0x20a'),_0x4fe9ba);loggerPredictive[_0x5e63('0x48')](_0x5e63('0x20b'),_0x9e586c);loggerPredictive[_0x5e63('0x48')](_0x5e63('0x20c'),_0x34deed);loggerPredictive[_0x5e63('0x48')](_0x5e63('0x20d'),_0x4ec83d);loggerPredictive['info'](_0x5e63('0x20e'),_0x1c51a4);loggerPredictive[_0x5e63('0x48')](_0x5e63('0x52'));return new Promise(function(_0x20df1c,_0x4e9e23){if(_0x4fe9ba<=0x0||isNaN(_0x4fe9ba)){return _0x4e9e23(msgResponse(_0x5e63('0x20f'),_0x5e63('0xc6'),'m\x20=\x20'+_0x4fe9ba));}if(_0x34deed<=0x0||isNaN(_0x34deed)){return _0x4e9e23(msgResponse(_0x5e63('0x20f'),_0x5e63('0xc6'),_0x5e63('0x210')+_0x34deed));}if(_0x4ec83d<=0x0||isNaN(_0x4ec83d)){return _0x4e9e23(msgResponse(_0x5e63('0x20f'),'Error',_0x5e63('0x211')+_0x4ec83d));}if(_0x9e586c<=0x0||isNaN(_0x9e586c)){return _0x4e9e23(msgResponse(_0x5e63('0x20f'),_0x5e63('0xc6'),_0x5e63('0x212')+_0x9e586c));}if(_0x1c51a4<=0x0||isNaN(_0x1c51a4)){return _0x4e9e23(msgResponse(_0x5e63('0x20f'),_0x5e63('0xc6'),'Amax\x20=\x20'+_0x1c51a4));}_0x21a6d4=_0x21a6d4||0x0;var _0x1d715b=0x1/_0x34deed;var _0x2ab797=0x0;var _0x46fd91=0x0;var _0x25b01b=0x0;var _0x157d54=0x0;for(var _0x4128e8=0x0;_0x25b01b<_0x1c51a4;_0x4128e8+=0x1){_0x46fd91=_0x4128e8/_0x9e586c;_0x2ab797=(_0x4ec83d*_0x46fd91+_0x21a6d4)/_0x1d715b;_0x25b01b=utils[_0x5e63('0x213')](_0x2ab797,_0x4fe9ba);_0x157d54=_0x2ab797/_0x4fe9ba*(0x1-utils['erlangb'](_0x2ab797,_0x4fe9ba));}return _0x20df1c({'erlangCalls':_0x4128e8,'erlangCallToSecond':_0x9e586c/_0x4128e8,'erlangAbandonmentRate':_0x25b01b,'erlangBusyFactor':_0x157d54});});};Dialer['prototype'][_0x5e63('0x1dd')]=function(_0x40b8e2,_0x428292,_0x5aae4b,_0x3ac9c4,_0x1044ca,_0x2109c7){loggerPredictive[_0x5e63('0x48')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0x5e63('0x48')](_0x5e63('0x20a'),_0x40b8e2);loggerPredictive['info'](_0x5e63('0x20b'),_0x428292);loggerPredictive[_0x5e63('0x48')](_0x5e63('0x20c'),_0x5aae4b);loggerPredictive[_0x5e63('0x48')](_0x5e63('0x20d'),_0x3ac9c4);loggerPredictive[_0x5e63('0x48')](_0x5e63('0x214'),_0x1044ca);loggerPredictive[_0x5e63('0x48')](_0x5e63('0x52'));return new Promise(function(_0x502ed2,_0x501cd4){if(_0x40b8e2<=0x0||isNaN(_0x40b8e2)){return _0x501cd4(msgResponse('[busyFactor]',_0x5e63('0xc6'),'m\x20=\x20'+_0x40b8e2));}if(_0x5aae4b<=0x0||isNaN(_0x5aae4b)){return _0x501cd4(msgResponse(_0x5e63('0x215'),_0x5e63('0xc6'),_0x5e63('0x210')+_0x5aae4b));}if(_0x3ac9c4<=0x0||isNaN(_0x3ac9c4)){return _0x501cd4(msgResponse(_0x5e63('0x215'),_0x5e63('0xc6'),'p\x20=\x20'+_0x3ac9c4));}if(_0x428292<=0x0||isNaN(_0x428292)){return _0x501cd4(msgResponse('[busyFactor]',_0x5e63('0xc6'),'interval\x20=\x20'+_0x428292));}if(_0x1044ca<=0x0||isNaN(_0x1044ca)){return _0x501cd4(msgResponse('[busyFactor]',_0x5e63('0xc6'),_0x5e63('0x216')+_0x1044ca));}_0x2109c7=_0x2109c7||0x0;var _0x3ff7f6=0x1/_0x5aae4b;var _0x530e87=0x0;var _0xd36af=0x0;var _0x543575=0x0;var _0x2a88d7=0x0;for(var _0x19e435=0x0;_0x2a88d7<_0x1044ca;_0x19e435+=0x1){_0xd36af=_0x19e435/_0x428292;_0x530e87=(_0x3ac9c4*_0xd36af+_0x2109c7)/_0x3ff7f6;_0x543575=utils[_0x5e63('0x213')](_0x530e87,_0x40b8e2);_0x2a88d7=_0x530e87/_0x40b8e2*(0x1-utils[_0x5e63('0x213')](_0x530e87,_0x40b8e2));}return _0x502ed2({'erlangCalls':_0x19e435,'erlangCallToSecond':_0x428292/_0x19e435,'erlangAbandonmentRate':_0x543575,'erlangBusyFactor':_0x2a88d7});});};module[_0x5e63('0x217')]=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 7705055..213ceb1 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 _0xb611=['CampaignId','idHopper','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','prototype','getCaller','\x22%s\x22\x20<%s>','name','substring','dialCutDigit','getQueue','queue','exports','util','lodash','isNil','string','voiceQueue','uniqueid','phone','Contact','firstName','lastName','number','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId'];(function(_0x30b25b,_0x3c5507){var _0xa04d5=function(_0x21b1b3){while(--_0x21b1b3){_0x30b25b['push'](_0x30b25b['shift']());}};_0xa04d5(++_0x3c5507);}(_0xb611,0xcb));var _0x1b61=function(_0x4c0d2b,_0x2ff906){_0x4c0d2b=_0x4c0d2b-0x0;var _0x58c4fe=_0xb611[_0x4c0d2b];return _0x58c4fe;};'use strict';var util=require(_0x1b61('0x0'));var _=require(_0x1b61('0x1'));var moment=require('moment');function checkNameSurname(_0x7f35d7,_0x4a7849,_0x2e0942){var _0x1a591b='';if(!_[_0x1b61('0x2')](_0x4a7849)&&_0x1b61('0x3')===typeof _0x4a7849){_0x1a591b+=_0x4a7849;}if(!_[_0x1b61('0x2')](_0x2e0942)&&_0x1b61('0x3')===typeof _0x2e0942){_0x1a591b+='\x20'+_0x2e0942;}if(_0x1a591b!==''){return _0x1a591b;}return _0x7f35d7;}function Action(_0x5b9598,_0x2bb619,_0x246925){this[_0x1b61('0x4')]=_0x5b9598;this[_0x1b61('0x5')]=_0x246925||undefined;this['name']=checkNameSurname(_0x2bb619['Contact'][_0x1b61('0x6')],_0x2bb619[_0x1b61('0x7')][_0x1b61('0x8')],_0x2bb619['Contact'][_0x1b61('0x9')]);this[_0x1b61('0xa')]=_0x2bb619['phone'];this['queue']=_0x5b9598['name'];this['active']=_0x2bb619[_0x1b61('0xb')]||![];this[_0x1b61('0xc')]=_0x5b9598[_0x1b61('0xc')];this[_0x1b61('0xd')]=_0x5b9598['dialQueueTimeout']||0x3;this['scheduledat']=_0x2bb619[_0x1b61('0xe')];this[_0x1b61('0xf')]=_0x2bb619[_0x1b61('0xf')];this[_0x1b61('0x10')]=_0x2bb619[_0x1b61('0x10')];this[_0x1b61('0x11')]=_0x2bb619[_0x1b61('0x11')];this['countnosuchnumberretry']=_0x2bb619[_0x1b61('0x12')];this[_0x1b61('0x13')]=_0x2bb619[_0x1b61('0x13')];this[_0x1b61('0x14')]=_0x2bb619[_0x1b61('0x14')];this[_0x1b61('0x15')]=_0x2bb619['countmachineretry'];this[_0x1b61('0x16')]=_0x2bb619['countagentrejectretry'];this['ContactId']=_0x2bb619[_0x1b61('0x17')];this[_0x1b61('0x18')]=_0x2bb619[_0x1b61('0x18')];this['UserId']=_0x2bb619[_0x1b61('0x19')];this[_0x1b61('0x1a')]=_0x2bb619['VoiceQueueId'];this[_0x1b61('0x1b')]=_0x2bb619['CampaignId'];this[_0x1b61('0x1c')]=_0x2bb619['id'];this['ContactFirstName']=_0x2bb619[_0x1b61('0x7')]['firstName']||'';this[_0x1b61('0x1d')]=moment()[_0x1b61('0x1e')](_0x1b61('0x1f'));this[_0x1b61('0x20')]=_0x2bb619[_0x1b61('0x20')];this[_0x1b61('0x21')]=_0x2bb619[_0x1b61('0x21')];this[_0x1b61('0x22')]=_0x2bb619['callbackat'];this[_0x1b61('0x23')]=_0x2bb619[_0x1b61('0x23')];this[_0x1b61('0x24')]='';this['originatecalleridname']='';}Action[_0x1b61('0x25')][_0x1b61('0x26')]=function(){return util[_0x1b61('0x1e')](_0x1b61('0x27'),this[_0x1b61('0x28')],this['voiceQueue']['dialCutDigit']>0x0?this['number'][_0x1b61('0x29')](this[_0x1b61('0x4')][_0x1b61('0x2a')]):this[_0x1b61('0xa')]);};Action[_0x1b61('0x25')][_0x1b61('0x2b')]=function(){return this[_0x1b61('0x2c')];};module[_0x1b61('0x2d')]=Action; \ No newline at end of file +var _0x7fd4=['countnosuchnumberretry','countdropretry','countabandonedretry','ContactId','ListId','VoiceQueueId','CampaignId','starttime','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','\x22%s\x22\x20<%s>','voiceQueue','dialCutDigit','substring','getQueue','exports','util','lodash','moment','isNil','string','uniqueid','name','Contact','phone','firstName','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x7fd4,0xe2));var _0x47fd=function(_0x3a73bc,_0x550aef){_0x3a73bc=_0x3a73bc-0x0;var _0x32891b=_0x7fd4[_0x3a73bc];return _0x32891b;};'use strict';var util=require(_0x47fd('0x0'));var _=require(_0x47fd('0x1'));var moment=require(_0x47fd('0x2'));function checkNameSurname(_0x19f6be,_0x3149bd,_0x16efa3){var _0x55cbb0='';if(!_[_0x47fd('0x3')](_0x3149bd)&&_0x47fd('0x4')===typeof _0x3149bd){_0x55cbb0+=_0x3149bd;}if(!_[_0x47fd('0x3')](_0x16efa3)&&_0x47fd('0x4')===typeof _0x16efa3){_0x55cbb0+='\x20'+_0x16efa3;}if(_0x55cbb0!==''){return _0x55cbb0;}return _0x19f6be;}function Action(_0x45d93f,_0x29bf8b,_0x20e752){this['voiceQueue']=_0x45d93f;this[_0x47fd('0x5')]=_0x20e752||undefined;this[_0x47fd('0x6')]=checkNameSurname(_0x29bf8b[_0x47fd('0x7')][_0x47fd('0x8')],_0x29bf8b[_0x47fd('0x7')][_0x47fd('0x9')],_0x29bf8b[_0x47fd('0x7')][_0x47fd('0xa')]);this[_0x47fd('0xb')]=_0x29bf8b['phone'];this[_0x47fd('0xc')]=_0x45d93f[_0x47fd('0x6')];this[_0x47fd('0xd')]=_0x29bf8b[_0x47fd('0xd')]||![];this[_0x47fd('0xe')]=_0x45d93f[_0x47fd('0xe')];this[_0x47fd('0xf')]=_0x45d93f[_0x47fd('0xf')]||0x3;this[_0x47fd('0x10')]=_0x29bf8b[_0x47fd('0x10')];this[_0x47fd('0x11')]=_0x29bf8b[_0x47fd('0x11')];this[_0x47fd('0x12')]=_0x29bf8b['countcongestionretry'];this[_0x47fd('0x13')]=_0x29bf8b['countnoanswerretry'];this[_0x47fd('0x14')]=_0x29bf8b['countnosuchnumberretry'];this[_0x47fd('0x15')]=_0x29bf8b[_0x47fd('0x15')];this[_0x47fd('0x16')]=_0x29bf8b[_0x47fd('0x16')];this['countmachineretry']=_0x29bf8b['countmachineretry'];this['countagentrejectretry']=_0x29bf8b['countagentrejectretry'];this[_0x47fd('0x17')]=_0x29bf8b[_0x47fd('0x17')];this[_0x47fd('0x18')]=_0x29bf8b[_0x47fd('0x18')];this['UserId']=_0x29bf8b['UserId'];this[_0x47fd('0x19')]=_0x29bf8b[_0x47fd('0x19')];this[_0x47fd('0x1a')]=_0x29bf8b['CampaignId'];this['idHopper']=_0x29bf8b['id'];this['ContactFirstName']=_0x29bf8b[_0x47fd('0x7')][_0x47fd('0x9')]||'';this[_0x47fd('0x1b')]=moment()['format'](_0x47fd('0x1c'));this[_0x47fd('0x1d')]=_0x29bf8b[_0x47fd('0x1d')];this[_0x47fd('0x1e')]=_0x29bf8b[_0x47fd('0x1e')];this[_0x47fd('0x1f')]=_0x29bf8b[_0x47fd('0x1f')];this['recallme']=_0x29bf8b[_0x47fd('0x20')];this[_0x47fd('0x21')]='';this[_0x47fd('0x22')]='';}Action['prototype']['getCaller']=function(){return util['format'](_0x47fd('0x23'),this[_0x47fd('0x6')],this[_0x47fd('0x24')][_0x47fd('0x25')]>0x0?this[_0x47fd('0xb')][_0x47fd('0x26')](this[_0x47fd('0x24')][_0x47fd('0x25')]):this['number']);};Action['prototype'][_0x47fd('0x27')]=function(){return this[_0x47fd('0xc')];};module[_0x47fd('0x28')]=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 90b97d6..94e6259 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 _0xda66=['CampaignId','originatecalleridnum','originatecalleridname','agiafterat','exports','moment','../utils','state','statedesc','Answer','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','number','starttime','responsetime','answertime','format','ringtime','getSeconds','holdtime','talktime','endtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId'];(function(_0x1647c0,_0x57c334){var _0x1dd8b1=function(_0x3694c7){while(--_0x3694c7){_0x1647c0['push'](_0x1647c0['shift']());}};_0x1dd8b1(++_0x57c334);}(_0xda66,0x15d));var _0x6da6=function(_0x13e1d9,_0x479e22){_0x13e1d9=_0x13e1d9-0x0;var _0x5e3c69=_0xda66[_0x13e1d9];return _0x5e3c69;};'use strict';var moment=require(_0x6da6('0x0'));var utils=require(_0x6da6('0x1'));function AgentComplete(_0x403b0a,_0xb0148a){this[_0x6da6('0x2')]=0x4;this[_0x6da6('0x3')]=_0x6da6('0x4');this['scheduledat']=_0x403b0a['scheduledat'];this['type']=_0x403b0a[_0x6da6('0x5')];this['campaigntype']=_0x403b0a[_0x6da6('0x5')]===_0x6da6('0x6')?_0x6da6('0x7'):_0x403b0a[_0x6da6('0x5')];this[_0x6da6('0x8')]=_0x403b0a[_0x6da6('0x8')];this[_0x6da6('0x9')]=_0x403b0a[_0x6da6('0x9')];this[_0x6da6('0xa')]=_0x403b0a[_0x6da6('0xa')];this['countglobal']=_0x403b0a['countbusyretry']+_0x403b0a['countcongestionretry']+_0x403b0a[_0x6da6('0xa')]+_0x403b0a[_0x6da6('0xb')]+_0x403b0a[_0x6da6('0xc')]+_0x403b0a[_0x6da6('0xd')]+_0x403b0a[_0x6da6('0xe')]+_0x403b0a[_0x6da6('0xf')];this[_0x6da6('0xb')]=_0x403b0a['countnosuchnumberretry'];this[_0x6da6('0xc')]=_0x403b0a[_0x6da6('0xc')];this[_0x6da6('0xd')]=_0x403b0a[_0x6da6('0xd')];this['countmachineretry']=_0x403b0a[_0x6da6('0xe')];this[_0x6da6('0xf')]=_0x403b0a[_0x6da6('0xf')];this['uniqueid']=_0xb0148a[_0x6da6('0x10')];this[_0x6da6('0x11')]=_0x403b0a[_0x6da6('0x12')];this['calleridnum']=_0x403b0a[_0x6da6('0x13')];this['starttime']=_0x403b0a[_0x6da6('0x14')];this[_0x6da6('0x15')]=_0x403b0a['responsetime'];this[_0x6da6('0x16')]=_0x403b0a[_0x6da6('0x16')];this['endtime']=moment()[_0x6da6('0x17')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x6da6('0x18')]=utils[_0x6da6('0x19')](_0x403b0a[_0x6da6('0x15')],_0x403b0a[_0x6da6('0x14')]);this[_0x6da6('0x1a')]=utils[_0x6da6('0x19')](_0x403b0a[_0x6da6('0x16')],_0x403b0a[_0x6da6('0x15')]);this[_0x6da6('0x1b')]=utils[_0x6da6('0x19')](this[_0x6da6('0x1c')],_0x403b0a[_0x6da6('0x16')]);this[_0x6da6('0x7')]=_0xb0148a['queue'];this[_0x6da6('0x1d')]=_0xb0148a[_0x6da6('0x1d')];this['reason']=_0xb0148a[_0x6da6('0x1e')];this[_0x6da6('0x1f')]=_0x403b0a[_0x6da6('0x1f')];this[_0x6da6('0x20')]=_0x403b0a['callbackuniqueid'];this[_0x6da6('0x21')]=_0x403b0a['callbackat'];this[_0x6da6('0x22')]=_0x403b0a[_0x6da6('0x22')];this[_0x6da6('0x23')]=_0x403b0a[_0x6da6('0x23')];this['ListId']=_0x403b0a['ListId'];this[_0x6da6('0x24')]=_0x403b0a[_0x6da6('0x24')];this['VoiceQueueId']=_0x403b0a[_0x6da6('0x25')];this['CampaignId']=_0x403b0a[_0x6da6('0x26')];this[_0x6da6('0x27')]=_0x403b0a[_0x6da6('0x27')]||'';this[_0x6da6('0x28')]=_0x403b0a[_0x6da6('0x28')]||'';this[_0x6da6('0x29')]=_0x403b0a[_0x6da6('0x29')];}module[_0x6da6('0x2a')]=AgentComplete; \ No newline at end of file +var _0x83ba=['countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','calleridnum','number','starttime','responsetime','answertime','format','getSeconds','holdtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','moment','../utils','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry'];(function(_0x2a4846,_0x3c4ca9){var _0x5c67b7=function(_0x2d2e10){while(--_0x2d2e10){_0x2a4846['push'](_0x2a4846['shift']());}};_0x5c67b7(++_0x3c4ca9);}(_0x83ba,0x99));var _0xa83b=function(_0x1b97b9,_0x5b71c4){_0x1b97b9=_0x1b97b9-0x0;var _0x214031=_0x83ba[_0x1b97b9];return _0x214031;};'use strict';var moment=require(_0xa83b('0x0'));var utils=require(_0xa83b('0x1'));function AgentComplete(_0x188402,_0x173db3){this['state']=0x4;this[_0xa83b('0x2')]=_0xa83b('0x3');this[_0xa83b('0x4')]=_0x188402[_0xa83b('0x4')];this['type']=_0x188402[_0xa83b('0x5')];this[_0xa83b('0x6')]=_0x188402['type']===_0xa83b('0x7')?_0xa83b('0x8'):_0x188402[_0xa83b('0x5')];this[_0xa83b('0x9')]=_0x188402[_0xa83b('0x9')];this[_0xa83b('0xa')]=_0x188402[_0xa83b('0xa')];this[_0xa83b('0xb')]=_0x188402[_0xa83b('0xb')];this['countglobal']=_0x188402['countbusyretry']+_0x188402[_0xa83b('0xa')]+_0x188402['countnoanswerretry']+_0x188402[_0xa83b('0xc')]+_0x188402[_0xa83b('0xd')]+_0x188402[_0xa83b('0xe')]+_0x188402[_0xa83b('0xf')]+_0x188402[_0xa83b('0x10')];this[_0xa83b('0xc')]=_0x188402[_0xa83b('0xc')];this[_0xa83b('0xd')]=_0x188402[_0xa83b('0xd')];this[_0xa83b('0xe')]=_0x188402['countabandonedretry'];this[_0xa83b('0xf')]=_0x188402[_0xa83b('0xf')];this[_0xa83b('0x10')]=_0x188402[_0xa83b('0x10')];this[_0xa83b('0x11')]=_0x173db3[_0xa83b('0x11')];this[_0xa83b('0x12')]=_0x188402['name'];this[_0xa83b('0x13')]=_0x188402[_0xa83b('0x14')];this[_0xa83b('0x15')]=_0x188402['starttime'];this['responsetime']=_0x188402[_0xa83b('0x16')];this[_0xa83b('0x17')]=_0x188402[_0xa83b('0x17')];this['endtime']=moment()[_0xa83b('0x18')]('YYYY-MM-DD\x20HH:mm:ss');this['ringtime']=utils[_0xa83b('0x19')](_0x188402[_0xa83b('0x16')],_0x188402[_0xa83b('0x15')]);this[_0xa83b('0x1a')]=utils['getSeconds'](_0x188402[_0xa83b('0x17')],_0x188402[_0xa83b('0x16')]);this[_0xa83b('0x1b')]=utils[_0xa83b('0x19')](this['endtime'],_0x188402[_0xa83b('0x17')]);this['queue']=_0x173db3[_0xa83b('0x8')];this['membername']=_0x173db3[_0xa83b('0x1c')];this[_0xa83b('0x1d')]=_0x173db3['reason'];this[_0xa83b('0x1e')]=_0x188402[_0xa83b('0x1e')];this[_0xa83b('0x1f')]=_0x188402['callbackuniqueid'];this[_0xa83b('0x20')]=_0x188402[_0xa83b('0x20')];this[_0xa83b('0x21')]=_0x188402[_0xa83b('0x21')];this['ContactId']=_0x188402[_0xa83b('0x22')];this[_0xa83b('0x23')]=_0x188402[_0xa83b('0x23')];this[_0xa83b('0x24')]=_0x188402[_0xa83b('0x24')];this['VoiceQueueId']=_0x188402['VoiceQueueId'];this[_0xa83b('0x25')]=_0x188402[_0xa83b('0x25')];this[_0xa83b('0x26')]=_0x188402[_0xa83b('0x26')]||'';this[_0xa83b('0x27')]=_0x188402[_0xa83b('0x27')]||'';this[_0xa83b('0x28')]=_0x188402[_0xa83b('0x28')];}module['exports']=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 53f6d03..0f8835b 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 _0xe916=['UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId'];(function(_0x39a1d2,_0x59899c){var _0x37217b=function(_0xed8216){while(--_0xed8216){_0x39a1d2['push'](_0x39a1d2['shift']());}};_0x37217b(++_0x59899c);}(_0xe916,0x104));var _0x6e91=function(_0x34abbd,_0x3854a9){_0x34abbd=_0x34abbd-0x0;var _0x59883a=_0xe916[_0x34abbd];return _0x59883a;};'use strict';function Final(_0x398a47){this[_0x6e91('0x0')]=_0x398a47[_0x6e91('0x0')];this[_0x6e91('0x1')]=_0x398a47['scheduledat'];this['type']=_0x398a47[_0x6e91('0x2')];this[_0x6e91('0x3')]=_0x398a47[_0x6e91('0x2')]===_0x6e91('0x4')?_0x6e91('0x5'):_0x398a47['type'];this[_0x6e91('0x6')]=_0x398a47[_0x6e91('0x6')];this[_0x6e91('0x7')]=_0x398a47[_0x6e91('0x7')];this[_0x6e91('0x8')]=_0x398a47[_0x6e91('0x8')];this[_0x6e91('0x9')]=_0x398a47[_0x6e91('0x6')]+_0x398a47['countcongestionretry']+_0x398a47[_0x6e91('0x8')]+_0x398a47[_0x6e91('0xa')]+_0x398a47[_0x6e91('0xb')]+_0x398a47['countabandonedretry']+_0x398a47['countmachineretry']+_0x398a47['countagentrejectretry'];this[_0x6e91('0xa')]=_0x398a47['countnosuchnumberretry'];this[_0x6e91('0xb')]=_0x398a47['countdropretry'];this[_0x6e91('0xc')]=_0x398a47['countabandonedretry'];this['countmachineretry']=_0x398a47['countmachineretry'];this[_0x6e91('0xd')]=_0x398a47['countagentrejectretry'];this[_0x6e91('0x5')]=_0x398a47[_0x6e91('0x5')];this[_0x6e91('0xe')]=_0x398a47['calleridname'];this[_0x6e91('0xf')]=_0x398a47['calleridnum'];this[_0x6e91('0x10')]=_0x398a47[_0x6e91('0x10')];this[_0x6e91('0x11')]=_0x398a47[_0x6e91('0x11')];this[_0x6e91('0x12')]=_0x398a47[_0x6e91('0x11')];this['ringtime']=_0x398a47[_0x6e91('0x13')]||0x0;this[_0x6e91('0x14')]=_0x398a47[_0x6e91('0x14')]||0x0;this[_0x6e91('0x15')]=_0x398a47[_0x6e91('0x15')]||0x0;this[_0x6e91('0x16')]=_0x398a47['callback'];this[_0x6e91('0x17')]=_0x398a47[_0x6e91('0x17')];this[_0x6e91('0x18')]=_0x398a47[_0x6e91('0x18')];this[_0x6e91('0x19')]=_0x398a47['recallme'];this[_0x6e91('0x1a')]=_0x398a47[_0x6e91('0x1a')];this['ListId']=_0x398a47[_0x6e91('0x1b')];this[_0x6e91('0x1c')]=_0x398a47[_0x6e91('0x1c')];this[_0x6e91('0x1d')]=_0x398a47['VoiceQueueId'];this[_0x6e91('0x1e')]=_0x398a47[_0x6e91('0x1e')];this[_0x6e91('0x1f')]=_0x398a47['originatecalleridnum']||'';this[_0x6e91('0x20')]=_0x398a47[_0x6e91('0x20')]||'';this[_0x6e91('0x21')]=_0x398a47[_0x6e91('0x21')];this[_0x6e91('0x22')]=_0x398a47[_0x6e91('0x22')];}module[_0x6e91('0x23')]=Final; \ No newline at end of file +var _0xab10=['countmachineretry','countagentrejectretry','countnosuchnumberretry','calleridname','calleridnum','starttime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry'];(function(_0x3b16be,_0xa33271){var _0x794427=function(_0x557c1f){while(--_0x557c1f){_0x3b16be['push'](_0x3b16be['shift']());}};_0x794427(++_0xa33271);}(_0xab10,0xcc));var _0x0ab1=function(_0x5560a4,_0x401901){_0x5560a4=_0x5560a4-0x0;var _0x59f87c=_0xab10[_0x5560a4];return _0x59f87c;};'use strict';function Final(_0x3e52d){this['uniqueid']=_0x3e52d[_0x0ab1('0x0')];this[_0x0ab1('0x1')]=_0x3e52d[_0x0ab1('0x1')];this['type']=_0x3e52d[_0x0ab1('0x2')];this[_0x0ab1('0x3')]=_0x3e52d[_0x0ab1('0x2')]===_0x0ab1('0x4')?_0x0ab1('0x5'):_0x3e52d['type'];this[_0x0ab1('0x6')]=_0x3e52d[_0x0ab1('0x6')];this['countcongestionretry']=_0x3e52d[_0x0ab1('0x7')];this[_0x0ab1('0x8')]=_0x3e52d['countnoanswerretry'];this[_0x0ab1('0x9')]=_0x3e52d['countbusyretry']+_0x3e52d[_0x0ab1('0x7')]+_0x3e52d[_0x0ab1('0x8')]+_0x3e52d['countnosuchnumberretry']+_0x3e52d[_0x0ab1('0xa')]+_0x3e52d[_0x0ab1('0xb')]+_0x3e52d[_0x0ab1('0xc')]+_0x3e52d[_0x0ab1('0xd')];this[_0x0ab1('0xe')]=_0x3e52d[_0x0ab1('0xe')];this[_0x0ab1('0xa')]=_0x3e52d[_0x0ab1('0xa')];this[_0x0ab1('0xb')]=_0x3e52d['countabandonedretry'];this[_0x0ab1('0xc')]=_0x3e52d[_0x0ab1('0xc')];this[_0x0ab1('0xd')]=_0x3e52d['countagentrejectretry'];this[_0x0ab1('0x5')]=_0x3e52d[_0x0ab1('0x5')];this[_0x0ab1('0xf')]=_0x3e52d['calleridname'];this[_0x0ab1('0x10')]=_0x3e52d['calleridnum'];this[_0x0ab1('0x11')]=_0x3e52d[_0x0ab1('0x11')];this[_0x0ab1('0x12')]=_0x3e52d[_0x0ab1('0x12')];this['endtime']=_0x3e52d[_0x0ab1('0x12')];this[_0x0ab1('0x13')]=_0x3e52d[_0x0ab1('0x13')]||0x0;this[_0x0ab1('0x14')]=_0x3e52d[_0x0ab1('0x14')]||0x0;this['talktime']=_0x3e52d[_0x0ab1('0x15')]||0x0;this[_0x0ab1('0x16')]=_0x3e52d['callback'];this['callbackuniqueid']=_0x3e52d[_0x0ab1('0x17')];this[_0x0ab1('0x18')]=_0x3e52d[_0x0ab1('0x18')];this[_0x0ab1('0x19')]=_0x3e52d[_0x0ab1('0x19')];this[_0x0ab1('0x1a')]=_0x3e52d[_0x0ab1('0x1a')];this[_0x0ab1('0x1b')]=_0x3e52d[_0x0ab1('0x1b')];this['UserId']=_0x3e52d[_0x0ab1('0x1c')];this[_0x0ab1('0x1d')]=_0x3e52d[_0x0ab1('0x1d')];this[_0x0ab1('0x1e')]=_0x3e52d['CampaignId'];this['originatecalleridnum']=_0x3e52d[_0x0ab1('0x1f')]||'';this[_0x0ab1('0x20')]=_0x3e52d[_0x0ab1('0x20')]||'';this[_0x0ab1('0x21')]=_0x3e52d['state'];this['statedesc']=_0x3e52d[_0x0ab1('0x22')];}module[_0x0ab1('0x23')]=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 5a0cd50..da909f1 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 _0xe1de=['cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','moment','../utils','statedesc','scheduledat','type','campaigntype','outbound','queue','amd','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridnum','number','starttime','responsetime','format','getSeconds','holdtime','talktime','membername','IVR','reason'];(function(_0x5d2350,_0x3ca177){var _0x4cfa11=function(_0x47bd27){while(--_0x47bd27){_0x5d2350['push'](_0x5d2350['shift']());}};_0x4cfa11(++_0x3ca177);}(_0xe1de,0xd3));var _0xee1d=function(_0xcf4569,_0x1ce755){_0xcf4569=_0xcf4569-0x0;var _0x7fef=_0xe1de[_0xcf4569];return _0x7fef;};'use strict';var moment=require(_0xee1d('0x0'));var utils=require(_0xee1d('0x1'));function Hangup(_0x1af42d,_0x5b3eda){this['state']=0x4;this[_0xee1d('0x2')]='Answer';this[_0xee1d('0x3')]=_0x1af42d[_0xee1d('0x3')];this[_0xee1d('0x4')]=_0x1af42d[_0xee1d('0x4')];this[_0xee1d('0x5')]=_0x1af42d['type']===_0xee1d('0x6')?_0xee1d('0x7'):_0x1af42d[_0xee1d('0x4')];this['amd']=_0x1af42d[_0xee1d('0x8')]||![];this['countbusyretry']=_0x1af42d[_0xee1d('0x9')];this['countcongestionretry']=_0x1af42d['countcongestionretry'];this[_0xee1d('0xa')]=_0x1af42d[_0xee1d('0xa')];this[_0xee1d('0xb')]=_0x1af42d[_0xee1d('0x9')]+_0x1af42d[_0xee1d('0xc')]+_0x1af42d[_0xee1d('0xa')]+_0x1af42d[_0xee1d('0xd')]+_0x1af42d[_0xee1d('0xe')]+_0x1af42d[_0xee1d('0xf')]+_0x1af42d[_0xee1d('0x10')]+_0x1af42d[_0xee1d('0x11')];this[_0xee1d('0xd')]=_0x1af42d['countnosuchnumberretry'];this['countdropretry']=_0x1af42d[_0xee1d('0xe')];this[_0xee1d('0xf')]=_0x1af42d[_0xee1d('0xf')];this[_0xee1d('0x10')]=_0x1af42d['countmachineretry'];this['countagentrejectretry']=_0x1af42d['countagentrejectretry'];this['uniqueid']=_0x5b3eda['uniqueid'];this['calleridname']=_0x1af42d['name'];this[_0xee1d('0x12')]=_0x1af42d[_0xee1d('0x13')];this[_0xee1d('0x14')]=_0x1af42d[_0xee1d('0x14')];this[_0xee1d('0x15')]=_0x1af42d['responsetime'];this['endtime']=moment()[_0xee1d('0x16')]('YYYY-MM-DD\x20HH:mm:ss');this['ringtime']=utils[_0xee1d('0x17')](_0x1af42d['responsetime'],_0x1af42d[_0xee1d('0x14')]);this[_0xee1d('0x18')]=0x0;this[_0xee1d('0x19')]=utils[_0xee1d('0x17')](this['endtime'],_0x1af42d['responsetime']);this[_0xee1d('0x7')]=_0x1af42d['queue'];this[_0xee1d('0x1a')]=_0xee1d('0x1b');this[_0xee1d('0x1c')]=_0x5b3eda[_0xee1d('0x1d')];this[_0xee1d('0x1e')]=_0x1af42d['callback'];this['callbackuniqueid']=_0x1af42d[_0xee1d('0x1f')];this[_0xee1d('0x20')]=_0x1af42d[_0xee1d('0x20')];this[_0xee1d('0x21')]=_0x1af42d[_0xee1d('0x21')];this[_0xee1d('0x22')]=_0x1af42d[_0xee1d('0x22')];this[_0xee1d('0x23')]=_0x1af42d[_0xee1d('0x23')];this[_0xee1d('0x24')]=_0x1af42d[_0xee1d('0x24')];this[_0xee1d('0x25')]=_0x1af42d[_0xee1d('0x25')];this[_0xee1d('0x26')]=_0x1af42d[_0xee1d('0x26')];}module[_0xee1d('0x27')]=Hangup; \ No newline at end of file +var _0xe377=['talktime','endtime','membername','IVR','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','../utils','statedesc','Answer','scheduledat','type','outbound','queue','amd','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countmachineretry','countagentrejectretry','countdropretry','countabandonedretry','uniqueid','name','calleridnum','number','starttime','responsetime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','holdtime'];(function(_0x3727b6,_0x44cf75){var _0x2e33a5=function(_0x78af85){while(--_0x78af85){_0x3727b6['push'](_0x3727b6['shift']());}};_0x2e33a5(++_0x44cf75);}(_0xe377,0x15e));var _0x7e37=function(_0x1a01bb,_0x1c6482){_0x1a01bb=_0x1a01bb-0x0;var _0x33022b=_0xe377[_0x1a01bb];return _0x33022b;};'use strict';var moment=require('moment');var utils=require(_0x7e37('0x0'));function Hangup(_0x4e3dbd,_0x168360){this['state']=0x4;this[_0x7e37('0x1')]=_0x7e37('0x2');this[_0x7e37('0x3')]=_0x4e3dbd['scheduledat'];this[_0x7e37('0x4')]=_0x4e3dbd['type'];this['campaigntype']=_0x4e3dbd['type']===_0x7e37('0x5')?_0x7e37('0x6'):_0x4e3dbd[_0x7e37('0x4')];this[_0x7e37('0x7')]=_0x4e3dbd[_0x7e37('0x7')]||![];this[_0x7e37('0x8')]=_0x4e3dbd[_0x7e37('0x8')];this[_0x7e37('0x9')]=_0x4e3dbd[_0x7e37('0x9')];this[_0x7e37('0xa')]=_0x4e3dbd[_0x7e37('0xa')];this[_0x7e37('0xb')]=_0x4e3dbd[_0x7e37('0x8')]+_0x4e3dbd[_0x7e37('0x9')]+_0x4e3dbd[_0x7e37('0xa')]+_0x4e3dbd[_0x7e37('0xc')]+_0x4e3dbd['countdropretry']+_0x4e3dbd['countabandonedretry']+_0x4e3dbd[_0x7e37('0xd')]+_0x4e3dbd[_0x7e37('0xe')];this[_0x7e37('0xc')]=_0x4e3dbd[_0x7e37('0xc')];this['countdropretry']=_0x4e3dbd[_0x7e37('0xf')];this[_0x7e37('0x10')]=_0x4e3dbd[_0x7e37('0x10')];this['countmachineretry']=_0x4e3dbd[_0x7e37('0xd')];this[_0x7e37('0xe')]=_0x4e3dbd[_0x7e37('0xe')];this[_0x7e37('0x11')]=_0x168360[_0x7e37('0x11')];this['calleridname']=_0x4e3dbd[_0x7e37('0x12')];this[_0x7e37('0x13')]=_0x4e3dbd[_0x7e37('0x14')];this[_0x7e37('0x15')]=_0x4e3dbd[_0x7e37('0x15')];this[_0x7e37('0x16')]=_0x4e3dbd[_0x7e37('0x16')];this['endtime']=moment()[_0x7e37('0x17')](_0x7e37('0x18'));this[_0x7e37('0x19')]=utils[_0x7e37('0x1a')](_0x4e3dbd[_0x7e37('0x16')],_0x4e3dbd[_0x7e37('0x15')]);this[_0x7e37('0x1b')]=0x0;this[_0x7e37('0x1c')]=utils[_0x7e37('0x1a')](this[_0x7e37('0x1d')],_0x4e3dbd[_0x7e37('0x16')]);this['queue']=_0x4e3dbd[_0x7e37('0x6')];this[_0x7e37('0x1e')]=_0x7e37('0x1f');this[_0x7e37('0x20')]=_0x168360['cause-txt'];this[_0x7e37('0x21')]=_0x4e3dbd['callback'];this[_0x7e37('0x22')]=_0x4e3dbd[_0x7e37('0x22')];this[_0x7e37('0x23')]=_0x4e3dbd[_0x7e37('0x23')];this[_0x7e37('0x24')]=_0x4e3dbd[_0x7e37('0x24')];this[_0x7e37('0x25')]=_0x4e3dbd['ContactId'];this[_0x7e37('0x26')]=_0x4e3dbd[_0x7e37('0x26')];this[_0x7e37('0x27')]=_0x4e3dbd['UserId'];this[_0x7e37('0x28')]=_0x4e3dbd[_0x7e37('0x28')];this[_0x7e37('0x29')]=_0x4e3dbd['CampaignId'];}module['exports']=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 de44619..b4ed8a2 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 _0x5000=['countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridnum','number','starttime','responsetime','getSeconds','holdtime','talktime','callback','callbackat','recallme','ContactId','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname','state','exports','../utils','uniqueid','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry'];(function(_0x32359e,_0x455e2d){var _0x3f0ad0=function(_0x572702){while(--_0x572702){_0x32359e['push'](_0x32359e['shift']());}};_0x3f0ad0(++_0x455e2d);}(_0x5000,0x1c5));var _0x0500=function(_0x165d61,_0x18426e){_0x165d61=_0x165d61-0x0;var _0x40c5f9=_0x5000[_0x165d61];return _0x40c5f9;};'use strict';var utils=require(_0x0500('0x0'));function History(_0x3bf066){this['uniqueid']=_0x3bf066[_0x0500('0x1')];this[_0x0500('0x2')]=_0x3bf066[_0x0500('0x2')]||undefined;this[_0x0500('0x3')]=_0x3bf066[_0x0500('0x3')];this[_0x0500('0x4')]=_0x3bf066['type']==='outbound'?_0x0500('0x5'):_0x3bf066['type'];this[_0x0500('0x6')]=_0x3bf066[_0x0500('0x6')];this[_0x0500('0x7')]=_0x3bf066[_0x0500('0x7')];this[_0x0500('0x8')]=_0x3bf066[_0x0500('0x8')];this[_0x0500('0x9')]=_0x3bf066[_0x0500('0x6')]+_0x3bf066[_0x0500('0x7')]+_0x3bf066[_0x0500('0x8')]+_0x3bf066[_0x0500('0xa')]+_0x3bf066[_0x0500('0xb')]+_0x3bf066[_0x0500('0xc')]+_0x3bf066[_0x0500('0xd')]+_0x3bf066['countagentrejectretry'];this[_0x0500('0xa')]=_0x3bf066[_0x0500('0xa')];this[_0x0500('0xb')]=_0x3bf066[_0x0500('0xb')];this[_0x0500('0xc')]=_0x3bf066[_0x0500('0xc')];this[_0x0500('0xd')]=_0x3bf066[_0x0500('0xd')];this['countagentrejectretry']=_0x3bf066[_0x0500('0xe')];this[_0x0500('0x5')]=_0x3bf066['queue'];this['calleridname']=_0x3bf066['name'];this[_0x0500('0xf')]=_0x3bf066[_0x0500('0x10')];this[_0x0500('0x11')]=_0x3bf066[_0x0500('0x11')];this['responsetime']=_0x3bf066[_0x0500('0x12')];this['endtime']=_0x3bf066['responsetime'];this['ringtime']=utils[_0x0500('0x13')](_0x3bf066[_0x0500('0x12')],_0x3bf066['starttime']);this[_0x0500('0x14')]=0x0;this[_0x0500('0x15')]=0x0;this[_0x0500('0x16')]=_0x3bf066['callback'];this['callbackuniqueid']=_0x3bf066['callbackuniqueid'];this['callbackat']=_0x3bf066[_0x0500('0x17')];this[_0x0500('0x18')]=_0x3bf066[_0x0500('0x18')];this[_0x0500('0x19')]=_0x3bf066[_0x0500('0x19')];this[_0x0500('0x1a')]=_0x3bf066[_0x0500('0x1a')];this[_0x0500('0x1b')]=_0x3bf066['UserId'];this['VoiceQueueId']=_0x3bf066['VoiceQueueId'];this[_0x0500('0x1c')]=_0x3bf066['CampaignId'];this[_0x0500('0x1d')]=_0x3bf066[_0x0500('0x1d')]||'';this['originatecalleridname']=_0x3bf066[_0x0500('0x1e')]||'';this[_0x0500('0x1f')]=_0x3bf066['state'];this['statedesc']=_0x3bf066['statedesc'];}module[_0x0500('0x20')]=History; \ No newline at end of file +var _0x083a=['originatecalleridname','state','statedesc','../utils','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','name','number','starttime','responsetime','endtime','getSeconds','holdtime','talktime','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum'];(function(_0x5d445e,_0x5cc839){var _0x506bfc=function(_0x2b638a){while(--_0x2b638a){_0x5d445e['push'](_0x5d445e['shift']());}};_0x506bfc(++_0x5cc839);}(_0x083a,0x1e4));var _0xa083=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x083a[_0x53ccf2];return _0x5a2964;};'use strict';var utils=require(_0xa083('0x0'));function History(_0x3c56e2){this[_0xa083('0x1')]=_0x3c56e2[_0xa083('0x1')];this['scheduledat']=_0x3c56e2[_0xa083('0x2')]||undefined;this['type']=_0x3c56e2[_0xa083('0x3')];this[_0xa083('0x4')]=_0x3c56e2[_0xa083('0x3')]===_0xa083('0x5')?_0xa083('0x6'):_0x3c56e2['type'];this[_0xa083('0x7')]=_0x3c56e2[_0xa083('0x7')];this[_0xa083('0x8')]=_0x3c56e2[_0xa083('0x8')];this[_0xa083('0x9')]=_0x3c56e2[_0xa083('0x9')];this[_0xa083('0xa')]=_0x3c56e2[_0xa083('0x7')]+_0x3c56e2[_0xa083('0x8')]+_0x3c56e2[_0xa083('0x9')]+_0x3c56e2[_0xa083('0xb')]+_0x3c56e2[_0xa083('0xc')]+_0x3c56e2[_0xa083('0xd')]+_0x3c56e2[_0xa083('0xe')]+_0x3c56e2[_0xa083('0xf')];this[_0xa083('0xb')]=_0x3c56e2['countnosuchnumberretry'];this['countdropretry']=_0x3c56e2[_0xa083('0xc')];this['countabandonedretry']=_0x3c56e2[_0xa083('0xd')];this[_0xa083('0xe')]=_0x3c56e2['countmachineretry'];this[_0xa083('0xf')]=_0x3c56e2[_0xa083('0xf')];this['queue']=_0x3c56e2[_0xa083('0x6')];this[_0xa083('0x10')]=_0x3c56e2[_0xa083('0x11')];this['calleridnum']=_0x3c56e2[_0xa083('0x12')];this[_0xa083('0x13')]=_0x3c56e2[_0xa083('0x13')];this[_0xa083('0x14')]=_0x3c56e2[_0xa083('0x14')];this[_0xa083('0x15')]=_0x3c56e2['responsetime'];this['ringtime']=utils[_0xa083('0x16')](_0x3c56e2[_0xa083('0x14')],_0x3c56e2[_0xa083('0x13')]);this[_0xa083('0x17')]=0x0;this[_0xa083('0x18')]=0x0;this[_0xa083('0x19')]=_0x3c56e2['callback'];this['callbackuniqueid']=_0x3c56e2['callbackuniqueid'];this[_0xa083('0x1a')]=_0x3c56e2[_0xa083('0x1a')];this[_0xa083('0x1b')]=_0x3c56e2[_0xa083('0x1b')];this['ContactId']=_0x3c56e2[_0xa083('0x1c')];this[_0xa083('0x1d')]=_0x3c56e2[_0xa083('0x1d')];this['UserId']=_0x3c56e2[_0xa083('0x1e')];this['VoiceQueueId']=_0x3c56e2[_0xa083('0x1f')];this[_0xa083('0x20')]=_0x3c56e2['CampaignId'];this[_0xa083('0x21')]=_0x3c56e2['originatecalleridnum']||'';this[_0xa083('0x22')]=_0x3c56e2[_0xa083('0x22')]||'';this[_0xa083('0x23')]=_0x3c56e2[_0xa083('0x23')];this['statedesc']=_0x3c56e2[_0xa083('0x24')];}module['exports']=History; \ No newline at end of file diff --git a/server/services/ami/dialer/models/queueCallerAbandon.js b/server/services/ami/dialer/models/queueCallerAbandon.js index fd6325b..b016340 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 _0x5aa1=['membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','state','statedesc','exports','../utils','scheduledat','type','campaigntype','queue','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','dropreason','ringtime','getSeconds','talktime'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0x5aa1,0x92));var _0x15aa=function(_0x3382ec,_0x1dcb70){_0x3382ec=_0x3382ec-0x0;var _0x5341f1=_0x5aa1[_0x3382ec];return _0x5341f1;};'use strict';var utils=require(_0x15aa('0x0'));function QueueCallerAbandon(_0x5c6f62,_0x2bc27f){this[_0x15aa('0x1')]=_0x5c6f62[_0x15aa('0x1')];this['type']=_0x5c6f62[_0x15aa('0x2')];this[_0x15aa('0x3')]=_0x5c6f62['type']==='outbound'?_0x15aa('0x4'):_0x5c6f62[_0x15aa('0x2')];this[_0x15aa('0x5')]=_0x5c6f62[_0x15aa('0x5')];this['countcongestionretry']=_0x5c6f62['countcongestionretry'];this[_0x15aa('0x6')]=_0x5c6f62[_0x15aa('0x6')];this[_0x15aa('0x7')]=_0x5c6f62[_0x15aa('0x5')]+_0x5c6f62[_0x15aa('0x8')]+_0x5c6f62[_0x15aa('0x6')]+_0x5c6f62[_0x15aa('0x9')]+_0x5c6f62[_0x15aa('0xa')]+_0x5c6f62[_0x15aa('0xb')]+_0x5c6f62[_0x15aa('0xc')]+_0x5c6f62[_0x15aa('0xd')];this['countnosuchnumberretry']=_0x5c6f62[_0x15aa('0x9')];this[_0x15aa('0xa')]=_0x5c6f62[_0x15aa('0xa')];this[_0x15aa('0xb')]=_0x5c6f62[_0x15aa('0xb')];this[_0x15aa('0xc')]=_0x5c6f62[_0x15aa('0xc')];this[_0x15aa('0xd')]=_0x5c6f62[_0x15aa('0xd')];this[_0x15aa('0xe')]=_0x2bc27f[_0x15aa('0xe')];this[_0x15aa('0xf')]=_0x5c6f62[_0x15aa('0x10')];this[_0x15aa('0x11')]=_0x5c6f62[_0x15aa('0x12')];this[_0x15aa('0x13')]=_0x5c6f62['starttime'];this[_0x15aa('0x14')]=_0x5c6f62['responsetime'];this[_0x15aa('0x15')]=_0x5c6f62['droptime'];this[_0x15aa('0x16')]=_0x5c6f62[_0x15aa('0x16')];this['endtime']=this[_0x15aa('0x15')];this[_0x15aa('0x17')]=utils[_0x15aa('0x18')](_0x5c6f62['responsetime'],_0x5c6f62[_0x15aa('0x13')]);this['holdtime']=utils[_0x15aa('0x18')](this['droptime'],_0x5c6f62[_0x15aa('0x14')]);this[_0x15aa('0x19')]=0x0;this[_0x15aa('0x4')]=_0x2bc27f['queue'];this[_0x15aa('0x1a')]=_0x2bc27f['connectedlinename'];this[_0x15aa('0x1b')]=_0x2bc27f[_0x15aa('0x1b')];this['callback']=_0x5c6f62[_0x15aa('0x1c')];this[_0x15aa('0x1d')]=_0x5c6f62['callbackuniqueid'];this[_0x15aa('0x1e')]=_0x5c6f62[_0x15aa('0x1e')];this['recallme']=_0x5c6f62[_0x15aa('0x1f')];this[_0x15aa('0x20')]=_0x5c6f62['ContactId'];this[_0x15aa('0x21')]=_0x5c6f62[_0x15aa('0x21')];this['UserId']=_0x5c6f62[_0x15aa('0x22')];this[_0x15aa('0x23')]=_0x5c6f62['VoiceQueueId'];this[_0x15aa('0x24')]=_0x5c6f62['CampaignId'];this[_0x15aa('0x25')]=_0x5c6f62['originatecalleridnum']||'';this[_0x15aa('0x26')]=_0x5c6f62['originatecalleridname']||'';this[_0x15aa('0x27')]=_0x5c6f62[_0x15aa('0x27')];this[_0x15aa('0x28')]=_0x5c6f62[_0x15aa('0x28')];this[_0x15aa('0x29')]=_0x5c6f62[_0x15aa('0x29')];}module[_0x15aa('0x2a')]=QueueCallerAbandon; \ No newline at end of file +var _0xb860=['VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','state','statedesc','exports','../utils','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countmachineretry','countagentrejectretry','countdropretry','countabandonedretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','dropreason','endtime','ringtime','getSeconds','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId'];(function(_0x3da832,_0x2133f1){var _0xe602f2=function(_0xb7b2f){while(--_0xb7b2f){_0x3da832['push'](_0x3da832['shift']());}};_0xe602f2(++_0x2133f1);}(_0xb860,0x14a));var _0x0b86=function(_0x4c9915,_0x406b1a){_0x4c9915=_0x4c9915-0x0;var _0x473218=_0xb860[_0x4c9915];return _0x473218;};'use strict';var utils=require(_0x0b86('0x0'));function QueueCallerAbandon(_0x517d61,_0x446394){this[_0x0b86('0x1')]=_0x517d61[_0x0b86('0x1')];this[_0x0b86('0x2')]=_0x517d61[_0x0b86('0x2')];this[_0x0b86('0x3')]=_0x517d61[_0x0b86('0x2')]===_0x0b86('0x4')?_0x0b86('0x5'):_0x517d61['type'];this[_0x0b86('0x6')]=_0x517d61['countbusyretry'];this[_0x0b86('0x7')]=_0x517d61[_0x0b86('0x7')];this[_0x0b86('0x8')]=_0x517d61[_0x0b86('0x8')];this[_0x0b86('0x9')]=_0x517d61[_0x0b86('0x6')]+_0x517d61[_0x0b86('0x7')]+_0x517d61[_0x0b86('0x8')]+_0x517d61[_0x0b86('0xa')]+_0x517d61['countdropretry']+_0x517d61['countabandonedretry']+_0x517d61[_0x0b86('0xb')]+_0x517d61[_0x0b86('0xc')];this[_0x0b86('0xa')]=_0x517d61[_0x0b86('0xa')];this[_0x0b86('0xd')]=_0x517d61[_0x0b86('0xd')];this[_0x0b86('0xe')]=_0x517d61[_0x0b86('0xe')];this[_0x0b86('0xb')]=_0x517d61[_0x0b86('0xb')];this[_0x0b86('0xc')]=_0x517d61[_0x0b86('0xc')];this[_0x0b86('0xf')]=_0x446394['uniqueid'];this[_0x0b86('0x10')]=_0x517d61[_0x0b86('0x11')];this[_0x0b86('0x12')]=_0x517d61[_0x0b86('0x13')];this[_0x0b86('0x14')]=_0x517d61[_0x0b86('0x14')];this['responsetime']=_0x517d61[_0x0b86('0x15')];this['droptime']=_0x517d61[_0x0b86('0x16')];this[_0x0b86('0x17')]=_0x517d61[_0x0b86('0x17')];this[_0x0b86('0x18')]=this['droptime'];this[_0x0b86('0x19')]=utils[_0x0b86('0x1a')](_0x517d61[_0x0b86('0x15')],_0x517d61[_0x0b86('0x14')]);this['holdtime']=utils[_0x0b86('0x1a')](this['droptime'],_0x517d61[_0x0b86('0x15')]);this[_0x0b86('0x1b')]=0x0;this[_0x0b86('0x5')]=_0x446394[_0x0b86('0x5')];this[_0x0b86('0x1c')]=_0x446394[_0x0b86('0x1d')];this[_0x0b86('0x1e')]=_0x446394[_0x0b86('0x1e')];this[_0x0b86('0x1f')]=_0x517d61[_0x0b86('0x1f')];this[_0x0b86('0x20')]=_0x517d61[_0x0b86('0x20')];this[_0x0b86('0x21')]=_0x517d61['callbackat'];this[_0x0b86('0x22')]=_0x517d61[_0x0b86('0x22')];this['ContactId']=_0x517d61[_0x0b86('0x23')];this[_0x0b86('0x24')]=_0x517d61[_0x0b86('0x24')];this['UserId']=_0x517d61[_0x0b86('0x25')];this[_0x0b86('0x26')]=_0x517d61[_0x0b86('0x26')];this[_0x0b86('0x27')]=_0x517d61[_0x0b86('0x27')];this[_0x0b86('0x28')]=_0x517d61['originatecalleridnum']||'';this[_0x0b86('0x29')]=_0x517d61[_0x0b86('0x29')]||'';this[_0x0b86('0x2a')]=_0x517d61[_0x0b86('0x2a')];this[_0x0b86('0x2b')]=_0x517d61[_0x0b86('0x2b')];this[_0x0b86('0x2c')]=_0x517d61[_0x0b86('0x2c')];}module[_0x0b86('0x2d')]=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 aef7ccf..502d6ce 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 _0x6a55=['temp','error','[getContactDialer]','getContactDialerIvr','[getContactDialerIvr]','countReScheduled','[countReScheduled]','[rescheduleContact]','rescheduleContact','unlockContact','[unlockContact]','moveContactManagedDialer','checkIsBlackList','[checkIsBlackList]','checkIsBlackListIvr','[checkIsBlackListIvr]','verifyAdditionalPhones','[verifyAdditionalPhone]','swapAdditionalPhones','[swapAdditionalPhone]','[avgHandleTime]','avgHandleTime','createHistory','util','../../rpc/cmHopperAdditionalPhone','getContactDialer','dialOrderByScheduledAt','catch'];(function(_0x254d9f,_0x54ddb5){var _0x1eedb9=function(_0x2d05f1){while(--_0x2d05f1){_0x254d9f['push'](_0x254d9f['shift']());}};_0x1eedb9(++_0x54ddb5);}(_0x6a55,0xdb));var _0x56a5=function(_0x15876c,_0x510dd4){_0x15876c=_0x15876c-0x0;var _0x39d91b=_0x6a55[_0x15876c];return _0x39d91b;};'use strict';var util=require(_0x56a5('0x0'));var logger=require('../../../../config/logger')('dialer');var cmHopper=require('../../rpc/cmHopper');var cmHopperAdditionalPhone=require(_0x56a5('0x1'));var cmHopperBlack=require('../../rpc/cmHopperBlack');var cmHopperHistory=require('../../rpc/cmHopperHistory');function inspectError(_0x116199){return util['inspect'](_0x116199,{'showHidden':![],'depth':null});}function getContactDialer(_0x3ff76a,_0x5171fa,_0x28bb2b){return cmHopper[_0x56a5('0x2')](_0x3ff76a['id'],_0x5171fa,_0x28bb2b,_0x3ff76a[_0x56a5('0x3')])[_0x56a5('0x4')](function(_0x444c65){_0x3ff76a[_0x56a5('0x5')]=0x0;logger[_0x56a5('0x6')](_0x56a5('0x7'),inspectError(_0x444c65));});}exports['getContactDialer']=getContactDialer;function getContactDialerIvr(_0x1c9e7a,_0xf15490){return cmHopper[_0x56a5('0x8')](_0x1c9e7a['id'],_0xf15490,_0x1c9e7a[_0x56a5('0x3')])[_0x56a5('0x4')](function(_0x3a721d){_0x1c9e7a[_0x56a5('0x5')]=0x0;logger[_0x56a5('0x6')](_0x56a5('0x9'),inspectError(_0x3a721d));});}exports['getContactDialerIvr']=getContactDialerIvr;function countReScheduled(_0x49711d){return cmHopper[_0x56a5('0xa')](_0x49711d)[_0x56a5('0x4')](function(_0x2b9d7d){logger[_0x56a5('0x6')](_0x56a5('0xb'),inspectError(_0x2b9d7d));});}exports[_0x56a5('0xa')]=countReScheduled;function rescheduleContact(_0x4db11b){return cmHopper['rescheduleContact'](_0x4db11b)[_0x56a5('0x4')](function(_0x1e416f){logger[_0x56a5('0x6')](_0x56a5('0xc'),inspectError(_0x1e416f));});}exports[_0x56a5('0xd')]=rescheduleContact;function unlockContact(_0x2db112,_0xe3091f,_0x5c4028){return cmHopper[_0x56a5('0xe')](_0x2db112,_0xe3091f,_0x5c4028)['catch'](function(_0x41e8b6){logger['error'](_0x56a5('0xf'),inspectError(_0x41e8b6));});}exports[_0x56a5('0xe')]=unlockContact;function moveContactManagedDialer(_0x173c65){return cmHopper[_0x56a5('0x10')](_0x173c65)[_0x56a5('0x4')](function(_0x143f3d){logger[_0x56a5('0x6')]('[moveContactManagedDialer]',inspectError(_0x143f3d));});}exports[_0x56a5('0x10')]=moveContactManagedDialer;function checkIsBlackList(_0x3db687){return cmHopperBlack[_0x56a5('0x11')](_0x3db687)[_0x56a5('0x4')](function(_0x52eee2){logger[_0x56a5('0x6')](_0x56a5('0x12'),inspectError(_0x52eee2));});}exports[_0x56a5('0x11')]=checkIsBlackList;function checkIsBlackListIvr(_0x15e469){return cmHopperBlack[_0x56a5('0x13')](_0x15e469)['catch'](function(_0x55579d){logger[_0x56a5('0x6')](_0x56a5('0x14'),inspectError(_0x55579d));});}exports['checkIsBlackListIvr']=checkIsBlackListIvr;function verifyAdditionalPhones(_0x1556eb,_0x309fa5,_0x615d49){return cmHopperAdditionalPhone[_0x56a5('0x15')](_0x1556eb,_0x309fa5,_0x615d49)[_0x56a5('0x4')](function(_0x616922){logger[_0x56a5('0x6')](_0x56a5('0x16'),inspectError(_0x616922));});}exports[_0x56a5('0x15')]=verifyAdditionalPhones;function swapAdditionalPhones(_0x2035c7,_0xcf212,_0x2f203f){return cmHopperAdditionalPhone[_0x56a5('0x17')](_0x2035c7,_0xcf212,_0x2f203f)['catch'](function(_0x5c76a7){logger[_0x56a5('0x6')](_0x56a5('0x18'),inspectError(_0x5c76a7));});}exports[_0x56a5('0x17')]=swapAdditionalPhones;function avgHandleTime(_0x43a815){return cmHopperHistory['avgHandleTime'](_0x43a815)[_0x56a5('0x4')](function(_0x54ec36){logger[_0x56a5('0x6')](_0x56a5('0x19'),inspectError(_0x54ec36));});}exports[_0x56a5('0x1a')]=avgHandleTime;function createHistory(_0x284ee5){return cmHopperHistory['createHistory'](_0x284ee5)[_0x56a5('0x4')](function(_0x1f7aeb){logger[_0x56a5('0x6')]('[createHistory]',inspectError(_0x1f7aeb));});}exports[_0x56a5('0x1b')]=createHistory; \ No newline at end of file +var _0x8f9d=['[createHistory]','createHistory','util','dialer','../../rpc/cmHopperAdditionalPhone','../../rpc/cmHopperBlack','../../rpc/cmHopperHistory','inspect','getContactDialer','dialOrderByScheduledAt','catch','temp','[getContactDialer]','error','[getContactDialerIvr]','getContactDialerIvr','[countReScheduled]','countReScheduled','rescheduleContact','unlockContact','checkIsBlackList','[checkIsBlackList]','checkIsBlackListIvr','[checkIsBlackListIvr]','verifyAdditionalPhones','[verifyAdditionalPhone]','swapAdditionalPhones','[swapAdditionalPhone]','avgHandleTime'];(function(_0x48f789,_0x41a455){var _0xd54cc9=function(_0x5c942c){while(--_0x5c942c){_0x48f789['push'](_0x48f789['shift']());}};_0xd54cc9(++_0x41a455);}(_0x8f9d,0x93));var _0xd8f9=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x8f9d[_0x19950b];return _0x3c6b41;};'use strict';var util=require(_0xd8f9('0x0'));var logger=require('../../../../config/logger')(_0xd8f9('0x1'));var cmHopper=require('../../rpc/cmHopper');var cmHopperAdditionalPhone=require(_0xd8f9('0x2'));var cmHopperBlack=require(_0xd8f9('0x3'));var cmHopperHistory=require(_0xd8f9('0x4'));function inspectError(_0x354c26){return util[_0xd8f9('0x5')](_0x354c26,{'showHidden':![],'depth':null});}function getContactDialer(_0x1b82b8,_0x1d6420,_0x5941ce){return cmHopper[_0xd8f9('0x6')](_0x1b82b8['id'],_0x1d6420,_0x5941ce,_0x1b82b8[_0xd8f9('0x7')])[_0xd8f9('0x8')](function(_0x241aaa){_0x1b82b8[_0xd8f9('0x9')]=0x0;logger['error'](_0xd8f9('0xa'),inspectError(_0x241aaa));});}exports[_0xd8f9('0x6')]=getContactDialer;function getContactDialerIvr(_0x4957ae,_0x33c31e){return cmHopper['getContactDialerIvr'](_0x4957ae['id'],_0x33c31e,_0x4957ae['dialOrderByScheduledAt'])[_0xd8f9('0x8')](function(_0x3d0bea){_0x4957ae[_0xd8f9('0x9')]=0x0;logger[_0xd8f9('0xb')](_0xd8f9('0xc'),inspectError(_0x3d0bea));});}exports[_0xd8f9('0xd')]=getContactDialerIvr;function countReScheduled(_0x14c630){return cmHopper['countReScheduled'](_0x14c630)[_0xd8f9('0x8')](function(_0x56e0d6){logger[_0xd8f9('0xb')](_0xd8f9('0xe'),inspectError(_0x56e0d6));});}exports[_0xd8f9('0xf')]=countReScheduled;function rescheduleContact(_0x5b01ce){return cmHopper[_0xd8f9('0x10')](_0x5b01ce)[_0xd8f9('0x8')](function(_0x4cfebf){logger[_0xd8f9('0xb')]('[rescheduleContact]',inspectError(_0x4cfebf));});}exports[_0xd8f9('0x10')]=rescheduleContact;function unlockContact(_0x1525d6,_0x234901,_0x10369c){return cmHopper[_0xd8f9('0x11')](_0x1525d6,_0x234901,_0x10369c)[_0xd8f9('0x8')](function(_0x566448){logger['error']('[unlockContact]',inspectError(_0x566448));});}exports[_0xd8f9('0x11')]=unlockContact;function moveContactManagedDialer(_0xc6a825){return cmHopper['moveContactManagedDialer'](_0xc6a825)[_0xd8f9('0x8')](function(_0x47bdea){logger[_0xd8f9('0xb')]('[moveContactManagedDialer]',inspectError(_0x47bdea));});}exports['moveContactManagedDialer']=moveContactManagedDialer;function checkIsBlackList(_0x58956e){return cmHopperBlack[_0xd8f9('0x12')](_0x58956e)['catch'](function(_0x37a252){logger[_0xd8f9('0xb')](_0xd8f9('0x13'),inspectError(_0x37a252));});}exports[_0xd8f9('0x12')]=checkIsBlackList;function checkIsBlackListIvr(_0x3b141a){return cmHopperBlack[_0xd8f9('0x14')](_0x3b141a)['catch'](function(_0x1de3cc){logger[_0xd8f9('0xb')](_0xd8f9('0x15'),inspectError(_0x1de3cc));});}exports[_0xd8f9('0x14')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x1bf210,_0x318d6a,_0x4c5808){return cmHopperAdditionalPhone[_0xd8f9('0x16')](_0x1bf210,_0x318d6a,_0x4c5808)[_0xd8f9('0x8')](function(_0x1fcd45){logger[_0xd8f9('0xb')](_0xd8f9('0x17'),inspectError(_0x1fcd45));});}exports['verifyAdditionalPhones']=verifyAdditionalPhones;function swapAdditionalPhones(_0xcc9b18,_0x1d6796,_0x28854a){return cmHopperAdditionalPhone[_0xd8f9('0x18')](_0xcc9b18,_0x1d6796,_0x28854a)[_0xd8f9('0x8')](function(_0x9e1d6d){logger[_0xd8f9('0xb')](_0xd8f9('0x19'),inspectError(_0x9e1d6d));});}exports['swapAdditionalPhones']=swapAdditionalPhones;function avgHandleTime(_0x464a6a){return cmHopperHistory[_0xd8f9('0x1a')](_0x464a6a)[_0xd8f9('0x8')](function(_0x58a3ca){logger['error']('[avgHandleTime]',inspectError(_0x58a3ca));});}exports[_0xd8f9('0x1a')]=avgHandleTime;function createHistory(_0x2c25c2){return cmHopperHistory['createHistory'](_0x2c25c2)[_0xd8f9('0x8')](function(_0x210cd1){logger['error'](_0xd8f9('0x1b'),inspectError(_0x210cd1));});}exports[_0xd8f9('0x1c')]=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 954db7c..d54b999 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 _0x936e=['isIVRCampaignActive','milliseconds','diff','seconds','getSeconds','message','available','loggedIn','loggedInDb','paused','pTalking','waiting','inUse','originated','Trunk','name','dialTimezone','isNil','dialGlobalInterval','Interval','Intervals','NULL_INTERVAL','isEmpty','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','SIP/','reachable','unmonitored','TrunkBackup','includes','status','INACTIVE','talking','DISACTIVED','getQueueCampaignStatusMessage','match','extractCalleridName','isUndefined','string','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','getCallerId','\x5cw{0,','pow','replace','random','toString','getCallerIdRandom','decrementOriginate','checkContactEmpty','erlangb','checkContactLowerLimitOriginate','createdAt','description','tags','updatedAt','undefined','%s%s','XMD-','toUpperCase','setXMDContactVariables','moment','util','../../../../config/logger','dialer','timezones','ACTIVE','BLACKLIST','RESCHEDULED_CONTACTS','DEACTIVATED','IS_DISACTIVED','INTERVAL_IS_EMPTY','AGENTS_NOT_LOGGED','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_OVERTIME','GLOBAL_INTERVAL_IS_OVERTIME','RECALLFAILEDTIMEOUT','TIMEZONE_UNKNOW','TRUNK_IS_NOT_REACHABLE','dialMethod','preview','isPreviewCampaign','type','ivr','isIVRCampaign','outbound','dialActive','isQueueCampaignActive','active'];(function(_0x1f2f61,_0x586f2f){var _0x10dabc=function(_0x3233b5){while(--_0x3233b5){_0x1f2f61['push'](_0x1f2f61['shift']());}};_0x10dabc(++_0x586f2f);}(_0x936e,0x14c));var _0xe936=function(_0x55af86,_0x5c8ff6){_0x55af86=_0x55af86-0x0;var _0x58df3b=_0x936e[_0x55af86];return _0x58df3b;};'use strict';var _=require('lodash');var moment=require(_0xe936('0x0'));var util=require(_0xe936('0x1'));var logger=require(_0xe936('0x2'))(_0xe936('0x3'));var timezones=require('../../../../config/environment/shared')[_0xe936('0x4')];var CAMPAIGN_STATUS={'ACTIVE':_0xe936('0x5'),'BLACKLIST':_0xe936('0x6'),'CONTACTS_RESCHEDULED':_0xe936('0x7'),'DEACTIVATED':_0xe936('0x8'),'DISACTIVED':_0xe936('0x9'),'EMPTY_INTERVAL':_0xe936('0xa'),'INACTIVE':'NOT_ACTIVE','NO_AGENTS_LOGGED':_0xe936('0xb'),'NO_AVAILABLE_CONTACTS':_0xe936('0xc'),'NULL_INTERVAL':'INTERVAL_IS_NULL','OVERTIME_INTERVAL':_0xe936('0xd'),'OVERTIME_GLOBAL_INTERVAL':_0xe936('0xe'),'QUEUE_RECALL':'RECALLINQUEUE','RECALL_TIMEOUT':_0xe936('0xf'),'RUNNING':'RUNNING','UNKNOWN_TIMEZONE':_0xe936('0x10'),'UNREACHABLE_TRUNK':_0xe936('0x11')};exports['CAMPAIGN_STATUS']=CAMPAIGN_STATUS;function isPreviewCampaign(_0x854191){return _0x854191[_0xe936('0x12')]===_0xe936('0x13');}exports[_0xe936('0x14')]=isPreviewCampaign;function isIVRCampaign(_0x6f5be8){return _0x6f5be8[_0xe936('0x15')]===_0xe936('0x16');}exports[_0xe936('0x17')]=isIVRCampaign;function isOutboundQueue(_0x4fb9ac){return _0x4fb9ac[_0xe936('0x15')]===_0xe936('0x18');}exports['isOutboundQueue']=isOutboundQueue;function isQueueCampaignActive(_0x52d8b5){return _0x52d8b5[_0xe936('0x19')];}exports[_0xe936('0x1a')]=isQueueCampaignActive;function isIVRCampaignActive(_0x28ccdc){return _0x28ccdc[_0xe936('0x1b')];}exports[_0xe936('0x1c')]=isIVRCampaignActive;function getSeconds(_0x35e63a,_0x4d5c02){var _0x9d8264=moment(_0x35e63a)[_0xe936('0x1d')](0x0);var _0x553b96=moment(_0x4d5c02)[_0xe936('0x1d')](0x0);return _0x9d8264[_0xe936('0x1e')](_0x553b96,_0xe936('0x1f'));}exports[_0xe936('0x20')]=getSeconds;function hasQueueCampaignDataChanged(_0x2ba38d,_0x5bee7d){var _0x1ab77d=![];var _0x5d8bb2=_0x2ba38d[_0xe936('0x12')]!==_0x5bee7d[_0xe936('0x12')]||_0x2ba38d[_0xe936('0x19')]!==_0x5bee7d[_0xe936('0x19')]||_0x2ba38d[_0xe936('0x21')]!==_0x5bee7d[_0xe936('0x21')];var _0x5b3355=_0x2ba38d[_0xe936('0x22')]!==_0x5bee7d[_0xe936('0x22')]||_0x2ba38d[_0xe936('0x23')]!==_0x5bee7d[_0xe936('0x23')]||_0x2ba38d[_0xe936('0x24')]!==_0x5bee7d['loggedInDb']||_0x2ba38d[_0xe936('0x25')]!==_0x5bee7d[_0xe936('0x25')]||_0x2ba38d['talking']!==_0x5bee7d['talking']||_0x2ba38d[_0xe936('0x26')]!==_0x5bee7d['pTalking']||_0x2ba38d['waiting']!==_0x5bee7d[_0xe936('0x27')]||_0x2ba38d[_0xe936('0x28')]!==_0x5bee7d['inUse']||_0x2ba38d[_0xe936('0x29')]!==_0x5bee7d[_0xe936('0x29')];if(_0x2ba38d[_0xe936('0x2a')]&&_0x5bee7d['Trunk']){_0x1ab77d=_0x2ba38d[_0xe936('0x2a')]['name']!==_0x5bee7d[_0xe936('0x2a')][_0xe936('0x2b')]||_0x2ba38d[_0xe936('0x2a')]['active']!==_0x5bee7d[_0xe936('0x2a')]['active'];}return _0x5d8bb2||_0x5b3355||_0x1ab77d;}exports['hasQueueCampaignDataChanged']=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x41e740){var _0x544378=null;var _0x47d19e=_0x41e740[_0xe936('0x2c')];if(_[_0xe936('0x2d')](_0x41e740[_0xe936('0x2e')])||_[_0xe936('0x2d')](_0x41e740[_0xe936('0x2f')])||_[_0xe936('0x2d')](_0x41e740[_0xe936('0x2f')][_0xe936('0x30')])){_0x544378=CAMPAIGN_STATUS[_0xe936('0x31')];}else if(_[_0xe936('0x32')](_0x41e740[_0xe936('0x2e')])||_['isEmpty'](_0x41e740['Interval'][_0xe936('0x30')])){_0x544378=CAMPAIGN_STATUS[_0xe936('0x33')];}else if(_0x47d19e&&!timezones[_0x47d19e]){_0x544378=CAMPAIGN_STATUS[_0xe936('0x34')];}return _0x544378;}function checkAnyValidTrunk(_0x4bccc5,_0x577334){var _0x2dbe88=null;var _0x1d3274=_0xe936('0x35');var _0x1f91d7=[_0xe936('0x36'),_0xe936('0x37')];var _0x2c40e1=!![];if(_0x4bccc5[_0xe936('0x2a')]&&_0x4bccc5[_0xe936('0x2a')]['active']){_0x1d3274+=_0x4bccc5['Trunk'][_0xe936('0x2b')];_0x2dbe88=_0x577334[_0x1d3274];_0x2c40e1=_0x1f91d7['includes'](_0x2dbe88['status']);}else if(_0x4bccc5[_0xe936('0x38')]&&_0x4bccc5[_0xe936('0x38')][_0xe936('0x1b')]){_0x1d3274+=_0x4bccc5[_0xe936('0x38')][_0xe936('0x2b')];_0x2dbe88=_0x577334[_0x1d3274];_0x2c40e1=_0x1f91d7[_0xe936('0x39')](_0x2dbe88[_0xe936('0x3a')]);}return _0x2c40e1;}function getQueueCampaignStatusMessage(_0x4706de,_0xaf9ac7){var _0x25d62c=CAMPAIGN_STATUS[_0xe936('0x5')];var _0xba5067=isPreviewCampaign(_0x4706de);if(!isQueueCampaignActive(_0x4706de)){if(_0xba5067){_0x25d62c=CAMPAIGN_STATUS[_0xe936('0x3b')];}else{if(_0x4706de[_0xe936('0x29')]===0x0&&_0x4706de[_0xe936('0x3c')]===0x0&&_0x4706de['waiting']===0x0&&(_0x4706de['pTalking']||0x0)===0x0){_0x25d62c=CAMPAIGN_STATUS[_0xe936('0x3b')];}else{_0x25d62c=CAMPAIGN_STATUS[_0xe936('0x3d')];}}}else if(_0x4706de[_0xe936('0x23')]===0x0){_0x25d62c=CAMPAIGN_STATUS['NO_AGENTS_LOGGED'];}else if(!checkAnyValidTrunk(_0x4706de,_0xaf9ac7)){_0x25d62c=CAMPAIGN_STATUS['UNREACHABLE_TRUNK'];}else if(!isPreviewCampaign(_0x4706de)){var _0x4cf477=checkAnyValidQueueCampaignInterval(_0x4706de);if(_0x4cf477){_0x25d62c=_0x4cf477;}}return _0x25d62c;}exports[_0xe936('0x3e')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x3395c4){var _0x1f9255=CAMPAIGN_STATUS['DISACTIVED'];if(_0x3395c4[_0xe936('0x29')]===0x0&&_0x3395c4['talking']===0x0&&_0x3395c4[_0xe936('0x27')]===0x0&&(_0x3395c4['pTalking']||0x0)===0x0){_0x1f9255=CAMPAIGN_STATUS['INACTIVE'];}return _0x1f9255;}exports['getQueueCampaignActiveStatusMessage']=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0xb3d08b){var _0x23c81c=_0xb3d08b[_0xe936('0x3f')](/"(.*?)"/);return _0x23c81c?_0x23c81c[0x1]:_0xb3d08b;}exports[_0xe936('0x40')]=extractCalleridName;function getCallerId(_0x3445f1,_0x5d8dd4,_0x4855e9){if(!_[_0xe936('0x41')](_0x4855e9)&&typeof _0x4855e9===_0xe936('0x42')&&!_[_0xe936('0x32')](_0x4855e9)){if(!_[_0xe936('0x41')](_0x5d8dd4)&&typeof _0x5d8dd4===_0xe936('0x42')&&!_[_0xe936('0x32')](_0x5d8dd4)){return util[_0xe936('0x43')](_0xe936('0x44'),_0x5d8dd4,_0x4855e9);}return util[_0xe936('0x43')](_0xe936('0x44'),_0x4855e9,_0x4855e9);}if(!_['isUndefined'](_0x3445f1)&&typeof _0x3445f1===_0xe936('0x42')&&!_[_0xe936('0x32')](_0x3445f1)){return _0x3445f1;}return _0xe936('0x45');}exports[_0xe936('0x46')]=getCallerId;function getCallerIdRandom(_0x458a80,_0x427b24){var _0x569363;var _0x50e2e0;var _0x23e1ca;if(_0x427b24<=0x0){_0x427b24=0x1;}_0x569363=new RegExp(_0xe936('0x47')+_0x427b24+'}$');_0x50e2e0=Math[_0xe936('0x48')](0xa,_0x427b24-0x1);_0x23e1ca=Math[_0xe936('0x48')](0xa,_0x427b24)-0x1;return util[_0xe936('0x43')]('%s',_[_0xe936('0x49')](_0x458a80,_0x569363,_[_0xe936('0x4a')](_0x50e2e0,_0x23e1ca)[_0xe936('0x4b')]()));}exports[_0xe936('0x4c')]=getCallerIdRandom;function decrementOriginate(_0x2e6ac0){if(_0x2e6ac0['originated']&&_0x2e6ac0['originated']>0x0){_0x2e6ac0[_0xe936('0x29')]-=0x1;}else{logger['error']('[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative');}}exports[_0xe936('0x4d')]=decrementOriginate;function checkContactEmpty(_0x1decf8){return _0x1decf8&&_0x1decf8['length']>0x0;}exports[_0xe936('0x4e')]=checkContactEmpty;function erlangb(_0x262dea,_0x2c7646){if(_0x2c7646===0x0){return 0x0;}var _0x4ccb42=0x1;for(var _0x2ee657=0x1;_0x2ee657<=_0x2c7646;_0x2ee657+=0x1){_0x4ccb42=0x1+_0x4ccb42*_0x2ee657/_0x262dea;}return 0x1/_0x4ccb42;}exports[_0xe936('0x4f')]=erlangb;function checkContactLowerLimitOriginate(_0x38c347,_0x1dbcd0,_0x635c47){if(_0x1dbcd0>_0x635c47){for(var _0x2fbb6b=0x0;_0x2fbb6b<_0x1dbcd0-_0x635c47;_0x2fbb6b+=0x1){decrementOriginate(_0x38c347);}}}exports[_0xe936('0x50')]=checkContactLowerLimitOriginate;function setXMDContactVariables(_0x57c81b){var _0x57b4c6={};var _0x4d34bb=['id',_0xe936('0x51'),_0xe936('0x52'),_0xe936('0x53'),_0xe936('0x54')];if(_0x57c81b){for(var _0x2217f2 in _0x57c81b){if(typeof _0x57c81b[_0x2217f2]!==_0xe936('0x55')){if(!_[_0xe936('0x2d')](_0x57c81b[_0x2217f2])&&!_0x4d34bb['includes'](_0x2217f2)){_0x57b4c6[util[_0xe936('0x43')](_0xe936('0x56'),_0xe936('0x57'),_0x2217f2[_0xe936('0x58')]())]=_0x57c81b[_0x2217f2];}}}}return _0x57b4c6;}exports[_0xe936('0x59')]=setXMDContactVariables; \ No newline at end of file +var _0xdb2e=['util','../../../../config/logger','dialer','../../../../config/environment/shared','timezones','BLACKLIST','RESCHEDULED_CONTACTS','DEACTIVATED','IS_DISACTIVED','INTERVAL_IS_EMPTY','NOT_ACTIVE','AGENTS_NOT_LOGGED','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','INTERVAL_IS_OVERTIME','GLOBAL_INTERVAL_IS_OVERTIME','RECALLINQUEUE','RECALLFAILEDTIMEOUT','RUNNING','TIMEZONE_UNKNOW','TRUNK_IS_NOT_REACHABLE','CAMPAIGN_STATUS','preview','type','isIVRCampaign','outbound','isOutboundQueue','dialActive','isQueueCampaignActive','active','isIVRCampaignActive','milliseconds','diff','seconds','getSeconds','dialMethod','message','available','loggedIn','loggedInDb','paused','talking','waiting','inUse','originated','Trunk','name','hasQueueCampaignDataChanged','dialTimezone','isNil','dialGlobalInterval','Interval','Intervals','NULL_INTERVAL','isEmpty','EMPTY_INTERVAL','SIP/','reachable','unmonitored','includes','status','TrunkBackup','ACTIVE','INACTIVE','pTalking','UNREACHABLE_TRUNK','getQueueCampaignStatusMessage','DISACTIVED','getQueueCampaignActiveStatusMessage','extractCalleridName','isUndefined','string','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','getCallerId','\x5cw{0,','pow','random','toString','getCallerIdRandom','error','decrementOriginate','length','checkContactEmpty','erlangb','checkContactLowerLimitOriginate','createdAt','description','tags','updatedAt','undefined','%s%s','XMD-','setXMDContactVariables','moment'];(function(_0x17474a,_0xd1a49c){var _0x3a5495=function(_0x10e1b4){while(--_0x10e1b4){_0x17474a['push'](_0x17474a['shift']());}};_0x3a5495(++_0xd1a49c);}(_0xdb2e,0x17f));var _0xedb2=function(_0x52a01f,_0x476c6a){_0x52a01f=_0x52a01f-0x0;var _0x37748f=_0xdb2e[_0x52a01f];return _0x37748f;};'use strict';var _=require('lodash');var moment=require(_0xedb2('0x0'));var util=require(_0xedb2('0x1'));var logger=require(_0xedb2('0x2'))(_0xedb2('0x3'));var timezones=require(_0xedb2('0x4'))[_0xedb2('0x5')];var CAMPAIGN_STATUS={'ACTIVE':'ACTIVE','BLACKLIST':_0xedb2('0x6'),'CONTACTS_RESCHEDULED':_0xedb2('0x7'),'DEACTIVATED':_0xedb2('0x8'),'DISACTIVED':_0xedb2('0x9'),'EMPTY_INTERVAL':_0xedb2('0xa'),'INACTIVE':_0xedb2('0xb'),'NO_AGENTS_LOGGED':_0xedb2('0xc'),'NO_AVAILABLE_CONTACTS':_0xedb2('0xd'),'NULL_INTERVAL':_0xedb2('0xe'),'OVERTIME_INTERVAL':_0xedb2('0xf'),'OVERTIME_GLOBAL_INTERVAL':_0xedb2('0x10'),'QUEUE_RECALL':_0xedb2('0x11'),'RECALL_TIMEOUT':_0xedb2('0x12'),'RUNNING':_0xedb2('0x13'),'UNKNOWN_TIMEZONE':_0xedb2('0x14'),'UNREACHABLE_TRUNK':_0xedb2('0x15')};exports[_0xedb2('0x16')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x58133f){return _0x58133f['dialMethod']===_0xedb2('0x17');}exports['isPreviewCampaign']=isPreviewCampaign;function isIVRCampaign(_0xe63b44){return _0xe63b44[_0xedb2('0x18')]==='ivr';}exports[_0xedb2('0x19')]=isIVRCampaign;function isOutboundQueue(_0x36040d){return _0x36040d[_0xedb2('0x18')]===_0xedb2('0x1a');}exports[_0xedb2('0x1b')]=isOutboundQueue;function isQueueCampaignActive(_0x34c317){return _0x34c317[_0xedb2('0x1c')];}exports[_0xedb2('0x1d')]=isQueueCampaignActive;function isIVRCampaignActive(_0x4bf04b){return _0x4bf04b[_0xedb2('0x1e')];}exports[_0xedb2('0x1f')]=isIVRCampaignActive;function getSeconds(_0x293a5b,_0x1cb3f6){var _0x23ac24=moment(_0x293a5b)[_0xedb2('0x20')](0x0);var _0x37149a=moment(_0x1cb3f6)[_0xedb2('0x20')](0x0);return _0x23ac24[_0xedb2('0x21')](_0x37149a,_0xedb2('0x22'));}exports[_0xedb2('0x23')]=getSeconds;function hasQueueCampaignDataChanged(_0x4d59da,_0x40d39f){var _0x2359dc=![];var _0x15edb6=_0x4d59da[_0xedb2('0x24')]!==_0x40d39f[_0xedb2('0x24')]||_0x4d59da[_0xedb2('0x1c')]!==_0x40d39f[_0xedb2('0x1c')]||_0x4d59da[_0xedb2('0x25')]!==_0x40d39f['message'];var _0x1f1553=_0x4d59da[_0xedb2('0x26')]!==_0x40d39f['available']||_0x4d59da[_0xedb2('0x27')]!==_0x40d39f[_0xedb2('0x27')]||_0x4d59da[_0xedb2('0x28')]!==_0x40d39f[_0xedb2('0x28')]||_0x4d59da[_0xedb2('0x29')]!==_0x40d39f[_0xedb2('0x29')]||_0x4d59da[_0xedb2('0x2a')]!==_0x40d39f[_0xedb2('0x2a')]||_0x4d59da['pTalking']!==_0x40d39f['pTalking']||_0x4d59da[_0xedb2('0x2b')]!==_0x40d39f[_0xedb2('0x2b')]||_0x4d59da[_0xedb2('0x2c')]!==_0x40d39f[_0xedb2('0x2c')]||_0x4d59da[_0xedb2('0x2d')]!==_0x40d39f['originated'];if(_0x4d59da[_0xedb2('0x2e')]&&_0x40d39f[_0xedb2('0x2e')]){_0x2359dc=_0x4d59da[_0xedb2('0x2e')]['name']!==_0x40d39f[_0xedb2('0x2e')][_0xedb2('0x2f')]||_0x4d59da[_0xedb2('0x2e')]['active']!==_0x40d39f[_0xedb2('0x2e')][_0xedb2('0x1e')];}return _0x15edb6||_0x1f1553||_0x2359dc;}exports[_0xedb2('0x30')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x5abe5b){var _0xf02956=null;var _0x171152=_0x5abe5b[_0xedb2('0x31')];if(_[_0xedb2('0x32')](_0x5abe5b[_0xedb2('0x33')])||_['isNil'](_0x5abe5b[_0xedb2('0x34')])||_[_0xedb2('0x32')](_0x5abe5b[_0xedb2('0x34')][_0xedb2('0x35')])){_0xf02956=CAMPAIGN_STATUS[_0xedb2('0x36')];}else if(_['isEmpty'](_0x5abe5b[_0xedb2('0x33')])||_[_0xedb2('0x37')](_0x5abe5b[_0xedb2('0x34')][_0xedb2('0x35')])){_0xf02956=CAMPAIGN_STATUS[_0xedb2('0x38')];}else if(_0x171152&&!timezones[_0x171152]){_0xf02956=CAMPAIGN_STATUS['UNKNOWN_TIMEZONE'];}return _0xf02956;}function checkAnyValidTrunk(_0x566b54,_0x29454d){var _0x2079d2=null;var _0x10cb1e=_0xedb2('0x39');var _0x50b8e7=[_0xedb2('0x3a'),_0xedb2('0x3b')];var _0x5d1ecc=!![];if(_0x566b54[_0xedb2('0x2e')]&&_0x566b54[_0xedb2('0x2e')][_0xedb2('0x1e')]){_0x10cb1e+=_0x566b54['Trunk']['name'];_0x2079d2=_0x29454d[_0x10cb1e];_0x5d1ecc=_0x50b8e7[_0xedb2('0x3c')](_0x2079d2[_0xedb2('0x3d')]);}else if(_0x566b54[_0xedb2('0x3e')]&&_0x566b54[_0xedb2('0x3e')][_0xedb2('0x1e')]){_0x10cb1e+=_0x566b54['TrunkBackup']['name'];_0x2079d2=_0x29454d[_0x10cb1e];_0x5d1ecc=_0x50b8e7[_0xedb2('0x3c')](_0x2079d2[_0xedb2('0x3d')]);}return _0x5d1ecc;}function getQueueCampaignStatusMessage(_0x1eaf83,_0x45ab70){var _0x4e086a=CAMPAIGN_STATUS[_0xedb2('0x3f')];var _0x5d798e=isPreviewCampaign(_0x1eaf83);if(!isQueueCampaignActive(_0x1eaf83)){if(_0x5d798e){_0x4e086a=CAMPAIGN_STATUS[_0xedb2('0x40')];}else{if(_0x1eaf83[_0xedb2('0x2d')]===0x0&&_0x1eaf83[_0xedb2('0x2a')]===0x0&&_0x1eaf83[_0xedb2('0x2b')]===0x0&&(_0x1eaf83[_0xedb2('0x41')]||0x0)===0x0){_0x4e086a=CAMPAIGN_STATUS['INACTIVE'];}else{_0x4e086a=CAMPAIGN_STATUS['DISACTIVED'];}}}else if(_0x1eaf83[_0xedb2('0x27')]===0x0){_0x4e086a=CAMPAIGN_STATUS['NO_AGENTS_LOGGED'];}else if(!checkAnyValidTrunk(_0x1eaf83,_0x45ab70)){_0x4e086a=CAMPAIGN_STATUS[_0xedb2('0x42')];}else if(!isPreviewCampaign(_0x1eaf83)){var _0x24215b=checkAnyValidQueueCampaignInterval(_0x1eaf83);if(_0x24215b){_0x4e086a=_0x24215b;}}return _0x4e086a;}exports[_0xedb2('0x43')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x2905dc){var _0xe4e1bb=CAMPAIGN_STATUS[_0xedb2('0x44')];if(_0x2905dc[_0xedb2('0x2d')]===0x0&&_0x2905dc['talking']===0x0&&_0x2905dc[_0xedb2('0x2b')]===0x0&&(_0x2905dc[_0xedb2('0x41')]||0x0)===0x0){_0xe4e1bb=CAMPAIGN_STATUS['INACTIVE'];}return _0xe4e1bb;}exports[_0xedb2('0x45')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x2c6172){var _0x582fa0=_0x2c6172['match'](/"(.*?)"/);return _0x582fa0?_0x582fa0[0x1]:_0x2c6172;}exports[_0xedb2('0x46')]=extractCalleridName;function getCallerId(_0x2972f9,_0xa6fcf4,_0x3de019){if(!_[_0xedb2('0x47')](_0x3de019)&&typeof _0x3de019===_0xedb2('0x48')&&!_['isEmpty'](_0x3de019)){if(!_[_0xedb2('0x47')](_0xa6fcf4)&&typeof _0xa6fcf4==='string'&&!_[_0xedb2('0x37')](_0xa6fcf4)){return util[_0xedb2('0x49')](_0xedb2('0x4a'),_0xa6fcf4,_0x3de019);}return util[_0xedb2('0x49')](_0xedb2('0x4a'),_0x3de019,_0x3de019);}if(!_[_0xedb2('0x47')](_0x2972f9)&&typeof _0x2972f9===_0xedb2('0x48')&&!_[_0xedb2('0x37')](_0x2972f9)){return _0x2972f9;}return _0xedb2('0x4b');}exports[_0xedb2('0x4c')]=getCallerId;function getCallerIdRandom(_0x2ac3b7,_0xbd770f){var _0x12902d;var _0x17cd48;var _0x71baa0;if(_0xbd770f<=0x0){_0xbd770f=0x1;}_0x12902d=new RegExp(_0xedb2('0x4d')+_0xbd770f+'}$');_0x17cd48=Math[_0xedb2('0x4e')](0xa,_0xbd770f-0x1);_0x71baa0=Math['pow'](0xa,_0xbd770f)-0x1;return util[_0xedb2('0x49')]('%s',_['replace'](_0x2ac3b7,_0x12902d,_[_0xedb2('0x4f')](_0x17cd48,_0x71baa0)[_0xedb2('0x50')]()));}exports[_0xedb2('0x51')]=getCallerIdRandom;function decrementOriginate(_0x1f5a5d){if(_0x1f5a5d[_0xedb2('0x2d')]&&_0x1f5a5d[_0xedb2('0x2d')]>0x0){_0x1f5a5d['originated']-=0x1;}else{logger[_0xedb2('0x52')]('[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative');}}exports[_0xedb2('0x53')]=decrementOriginate;function checkContactEmpty(_0x3085cb){return _0x3085cb&&_0x3085cb[_0xedb2('0x54')]>0x0;}exports[_0xedb2('0x55')]=checkContactEmpty;function erlangb(_0x4be291,_0x2f1dc1){if(_0x2f1dc1===0x0){return 0x0;}var _0x517f48=0x1;for(var _0xd41b35=0x1;_0xd41b35<=_0x2f1dc1;_0xd41b35+=0x1){_0x517f48=0x1+_0x517f48*_0xd41b35/_0x4be291;}return 0x1/_0x517f48;}exports[_0xedb2('0x56')]=erlangb;function checkContactLowerLimitOriginate(_0x5f27cc,_0x3c6efd,_0x3c963b){if(_0x3c6efd>_0x3c963b){for(var _0xa7185e=0x0;_0xa7185e<_0x3c6efd-_0x3c963b;_0xa7185e+=0x1){decrementOriginate(_0x5f27cc);}}}exports[_0xedb2('0x57')]=checkContactLowerLimitOriginate;function setXMDContactVariables(_0x4965ed){var _0x3cc44d={};var _0x5b706d=['id',_0xedb2('0x58'),_0xedb2('0x59'),_0xedb2('0x5a'),_0xedb2('0x5b')];if(_0x4965ed){for(var _0x8112d5 in _0x4965ed){if(typeof _0x4965ed[_0x8112d5]!==_0xedb2('0x5c')){if(!_[_0xedb2('0x32')](_0x4965ed[_0x8112d5])&&!_0x5b706d['includes'](_0x8112d5)){_0x3cc44d[util['format'](_0xedb2('0x5d'),_0xedb2('0x5e'),_0x8112d5['toUpperCase']())]=_0x4965ed[_0x8112d5];}}}}return _0x3cc44d;}exports[_0xedb2('0x5f')]=setXMDContactVariables; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 2d6f6a8..919bde8 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(_0x103d1f,_0x5502ae){var _0x4b2bd9=function(_0x371b89){while(--_0x371b89){_0x103d1f['push'](_0x103d1f['shift']());}};_0x4b2bd9(++_0x5502ae);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'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(_0x4c4a01,_0x365c6f){var _0x303469=function(_0x9b33f1){while(--_0x9b33f1){_0x4c4a01['push'](_0x4c4a01['shift']());}};_0x303469(++_0x365c6f);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'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 b2932e4..4f429c8 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 _0x537a=['./util/gs','fax','../ami','./channel','./util/util','./action','../rpc/attachment','../rpc/faxMessage','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','syncVarSet','newstate','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','syncReceiveFax','hangup','syncHangup','syncOriginateResponse','prototype','from-voip-provider','hasOwnProperty','localstationid','channels','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc','operation','remotestationid','pagestransferred','resolution','transferrate','filename','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','notify','catch','\x20notify\x20','error','\x20receiveFax\x20','stringify','pick','response','reason','AttachmentId','update','then','logger','[Fax][Message][Error][Updated]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','SENDING\x20FAILED:\x20','faxstatusstring','send','execOriginate','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','checkTrunk','FaxAccountId','Trunk','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','format','%s/%s.tif','dir','XMF-PATH','Action','variablesAction','ext','isTrunkReachable','active','SIP/%s','isNil','status','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','Empty\x20path','Is\x20Valid','exports','util','lodash','bluebird','uuid','moment','path','tiff2pdf'];(function(_0x4377d6,_0x4182a9){var _0x4a6884=function(_0xa244b7){while(--_0xa244b7){_0x4377d6['push'](_0x4377d6['shift']());}};_0x4a6884(++_0x4182a9);}(_0x537a,0x1c5));var _0xa537=function(_0x382e74,_0x3d3b73){_0x382e74=_0x382e74-0x0;var _0xff37f5=_0x537a[_0x382e74];return _0xff37f5;};'use strict';var util=require(_0xa537('0x0'));var _=require(_0xa537('0x1'));var BPromise=require(_0xa537('0x2'));var uuid=require(_0xa537('0x3'));var moment=require(_0xa537('0x4'));var path=require(_0xa537('0x5'));var tiff2pdf=require(_0xa537('0x6'));var gs=require(_0xa537('0x7'));var logger=require('../../../config/logger')(_0xa537('0x8'));var ami=require(_0xa537('0x9'));var rpcDb=require('./rpcDb');var Channel=require(_0xa537('0xa'));var ut=require(_0xa537('0xb'));var Action=require(_0xa537('0xc'));var faxAccount=require('../rpc/faxAccount');var attachment=require(_0xa537('0xd'));var faxMessage=require(_0xa537('0xe'));function Fax(_0x2b3040){this['channels']={};this[_0xa537('0xf')]=_0x2b3040['faxAccounts'];this[_0xa537('0x10')]=_0x2b3040[_0xa537('0x10')];this[_0xa537('0x11')]={};ami['on'](_0xa537('0x12'),this[_0xa537('0x13')][_0xa537('0x14')](this));ami['on']('varset',this[_0xa537('0x15')]['bind'](this));ami['on'](_0xa537('0x16'),this[_0xa537('0x17')][_0xa537('0x14')](this));ami['on'](_0xa537('0x18'),this[_0xa537('0x19')][_0xa537('0x14')](this));ami['on'](_0xa537('0x1a'),this[_0xa537('0x1b')][_0xa537('0x14')](this));ami['on']('receivefax',this[_0xa537('0x1c')][_0xa537('0x14')](this));ami['on'](_0xa537('0x1d'),this[_0xa537('0x1e')][_0xa537('0x14')](this));ami['on']('originateresponse',this[_0xa537('0x1f')]['bind'](this));}Fax[_0xa537('0x20')][_0xa537('0x13')]=function(_0x544fac){if(_0x544fac['context']===_0xa537('0x21')){for(var _0x4be019 in this[_0xa537('0xf')]){if(this['faxAccounts'][_0xa537('0x22')](_0x4be019)){if(_0x544fac['exten']===this[_0xa537('0xf')][_0x4be019][_0xa537('0x23')]){this[_0xa537('0x24')][_0x544fac[_0xa537('0x25')]]={};this['channels'][_0x544fac['uniqueid']][_0xa537('0x26')]=_0x544fac[_0xa537('0x26')];this['channels'][_0x544fac[_0xa537('0x25')]]['id']=this[_0xa537('0xf')][_0x4be019]['id'];this[_0xa537('0x24')][_0x544fac['uniqueid']][_0xa537('0x27')]=this[_0xa537('0xf')][_0x4be019][_0xa537('0x27')];logger[_0xa537('0x28')](_0x544fac['uniqueid'],_0xa537('0x29'));}}}}if(this['actions'][_0x544fac[_0xa537('0x25')]]){this[_0xa537('0x24')][_0x544fac[_0xa537('0x25')]]={};this[_0xa537('0x24')][_0x544fac['uniqueid']][_0xa537('0x26')]=_0x544fac[_0xa537('0x26')];logger[_0xa537('0x28')](_0x544fac[_0xa537('0x25')],'\x20syncNewchannel\x20');}};Fax[_0xa537('0x20')][_0xa537('0x15')]=function(_0x52297c){if(this[_0xa537('0x24')][_0x52297c[_0xa537('0x25')]]){for(var _0x2c3d52 in _0x52297c[_0xa537('0x2a')]){if(_0x52297c['variable']['hasOwnProperty'](_0x2c3d52)){this['channels'][_0x52297c[_0xa537('0x25')]][_0x2c3d52]=_0x52297c[_0xa537('0x2b')];}}}};Fax[_0xa537('0x20')][_0xa537('0x17')]=function(_0x49b51a){if(this['channels'][_0x49b51a[_0xa537('0x25')]]){this[_0xa537('0x24')][_0x49b51a[_0xa537('0x25')]][_0xa537('0x2c')]=_0x49b51a[_0xa537('0x2c')];this[_0xa537('0x24')][_0x49b51a[_0xa537('0x25')]][_0xa537('0x2d')]=_0x49b51a['channelstatedesc'];}};Fax[_0xa537('0x20')][_0xa537('0x19')]=function(_0xf5f38a){if(this[_0xa537('0x24')][_0xf5f38a[_0xa537('0x25')]]){for(var _0x227010 in _0xf5f38a[_0xa537('0x2a')]){if(_0xf5f38a['variable']['hasOwnProperty'](_0x227010)){this[_0xa537('0x24')][_0xf5f38a['uniqueid']][_0x227010]=_0xf5f38a[_0xa537('0x2b')];}}}};Fax[_0xa537('0x20')][_0xa537('0x1b')]=function(_0x3f1991){if(this['channels'][_0x3f1991[_0xa537('0x25')]]){this[_0xa537('0x24')][_0x3f1991['uniqueid']][_0xa537('0x2e')]=_0x3f1991['operation'];this[_0xa537('0x24')][_0x3f1991['uniqueid']]['status']=_0x3f1991['status'];this[_0xa537('0x24')][_0x3f1991['uniqueid']][_0xa537('0x23')]=_0x3f1991[_0xa537('0x23')];this[_0xa537('0x24')][_0x3f1991[_0xa537('0x25')]]['filename']=_0x3f1991['filename'];logger[_0xa537('0x28')](_0x3f1991[_0xa537('0x25')],'\x20syncFaxStatus\x20');}};Fax[_0xa537('0x20')][_0xa537('0x1c')]=function(_0x377722){var _0x58360a=this;if(this['channels'][_0x377722['uniqueid']]){var _0x5140ce=this['channels'][_0x377722[_0xa537('0x25')]]['id'];this[_0xa537('0x24')][_0x377722[_0xa537('0x25')]][_0xa537('0x2f')]=_0x377722[_0xa537('0x2f')];this['channels'][_0x377722[_0xa537('0x25')]][_0xa537('0x30')]=_0x377722[_0xa537('0x30')];this[_0xa537('0x24')][_0x377722[_0xa537('0x25')]]['localstationid']=_0x377722[_0xa537('0x23')];this['channels'][_0x377722[_0xa537('0x25')]]['resolution']=_0x377722[_0xa537('0x31')];this[_0xa537('0x24')][_0x377722[_0xa537('0x25')]][_0xa537('0x32')]=_0x377722[_0xa537('0x32')];this[_0xa537('0x24')][_0x377722[_0xa537('0x25')]]['filename']=_0x377722[_0xa537('0x33')];this[_0xa537('0x24')][_0x377722[_0xa537('0x25')]][_0xa537('0x34')]=_0x377722[_0xa537('0x34')];if(this['channels'][_0x377722[_0xa537('0x25')]]['pagestransferred']>0x0){tiff2pdf(_0x377722['filename'],_0xa537('0x35'),function(_0x2f6666){logger['info'](_0x377722[_0xa537('0x25')],_0xa537('0x36'),_0x2f6666[_0xa537('0x37')]);attachment[_0xa537('0x38')]({'name':path[_0xa537('0x39')](_0x377722[_0xa537('0x33')])['name'],'basename':path['parse'](_0x377722[_0xa537('0x33')])[_0xa537('0x27')]+_0xa537('0x3a'),'type':_0xa537('0x3b')})['then'](function(_0x4eb860){faxAccount[_0xa537('0x3c')](_0x5140ce,{'from':_0x377722[_0xa537('0x34')],'mapKey':_0xa537('0x8'),'body':path[_0xa537('0x39')](_0x377722[_0xa537('0x33')])[_0xa537('0x27')]+'.pdf','AttachmentId':_0x4eb860['id']})[_0xa537('0x3d')](function(_0x1928ba){logger['error'](_0x377722[_0xa537('0x25')],_0xa537('0x3e'),JSON['stringify'](_0x1928ba));});})[_0xa537('0x3d')](function(_0x22d6bc){logger[_0xa537('0x3f')](_0x377722[_0xa537('0x25')],_0xa537('0x40'),JSON[_0xa537('0x41')](_0x22d6bc));});});}logger[_0xa537('0x28')](_0x377722[_0xa537('0x25')],'\x20receiveFax\x20');}};Fax[_0xa537('0x20')][_0xa537('0x1f')]=function(_0x4bd6ce){if(this[_0xa537('0x11')][_0x4bd6ce[_0xa537('0x25')]]){_['merge'](this[_0xa537('0x24')][_0x4bd6ce[_0xa537('0x25')]],_[_0xa537('0x42')](_0x4bd6ce,[_0xa537('0x43'),_0xa537('0x44')]));}};function updateStatus(_0x2fc24e){if(_0x2fc24e[_0xa537('0x45')]){faxMessage[_0xa537('0x46')](_0x2fc24e[_0xa537('0x45')],{'failMessage':'SENDING\x20FAILED\x20'})[_0xa537('0x47')](function(_0x436c75){ut[_0xa537('0x48')](_0xa537('0x49'),_0x436c75);})[_0xa537('0x3d')](function(_0x3e64cb){ut[_0xa537('0x48')]('[Fax][Message][Error][NoUpdate1]',_0x3e64cb);});}else{ut['logger']('[Fax][Message][Error][NoUpdate2]');}}Fax[_0xa537('0x20')][_0xa537('0x4a')]=function(_0x3d3aad,_0x55b5cd,_0x148e80){var _0x5c41c5=this;var _0x3f6d9e={};if(_0x55b5cd){_0x3f6d9e={'read':_0x55b5cd};}else{_0x3f6d9e={'failMessage':_0x148e80};}if(this[_0xa537('0x11')][_0x3d3aad][_0xa537('0x45')]){faxMessage[_0xa537('0x46')](this[_0xa537('0x11')][_0x3d3aad][_0xa537('0x45')],_0x3f6d9e)['then'](function(_0x5e42ce){ut['logger'](_0xa537('0x4b'),_0x5e42ce);})['catch'](function(_0x425fb4){ut[_0xa537('0x48')](_0xa537('0x4c'),_0x425fb4);})['finally'](function(){delete _0x5c41c5[_0xa537('0x24')][_0x3d3aad];delete _0x5c41c5[_0xa537('0x11')][_0x3d3aad];});}else{ut[_0xa537('0x48')](_0xa537('0x4d'));delete this[_0xa537('0x24')][_0x3d3aad];delete this['actions'][_0x3d3aad];}};Fax['prototype'][_0xa537('0x1e')]=function(_0x478e82){var _0x94cdf1=this;if(this[_0xa537('0x24')][_0x478e82['uniqueid']]){if(this[_0xa537('0x11')][_0x478e82[_0xa537('0x25')]]){this[_0xa537('0x24')][_0x478e82[_0xa537('0x25')]]['id']=this[_0xa537('0x11')][_0x478e82['uniqueid']]['id'];this['channels'][_0x478e82[_0xa537('0x25')]][_0xa537('0x27')]=this[_0xa537('0x11')][_0x478e82[_0xa537('0x25')]][_0xa537('0x27')];}logger[_0xa537('0x28')](_0x478e82[_0xa537('0x25')],this[_0xa537('0x11')][_0x478e82[_0xa537('0x25')]]?_0xa537('0x4e'):_0xa537('0x4f'),JSON[_0xa537('0x41')](this[_0xa537('0x24')][_0x478e82[_0xa537('0x25')]]));if(this[_0xa537('0x11')][_0x478e82[_0xa537('0x25')]]){if(this['channels'][_0x478e82['uniqueid']][_0xa537('0x50')]>0x0&&this['channels'][_0x478e82['uniqueid']][_0xa537('0x1a')]===_0xa537('0x51')){this['updateStatus'](_0x478e82[_0xa537('0x25')],!![]);}else{this['updateStatus'](_0x478e82[_0xa537('0x25')],![],this[_0xa537('0x24')][_0x478e82['uniqueid']]['faxstatusstring']?_0xa537('0x52')+this[_0xa537('0x24')][_0x478e82[_0xa537('0x25')]][_0xa537('0x53')]:'SENDING\x20FAILED');}}}};Fax['prototype'][_0xa537('0x54')]=function(_0x1fda36){var _0x2c44c0=this;return new BPromise(function(_0x4ce16d,_0x4b45d3){_0x2c44c0[_0xa537('0x55')](_0x1fda36,_0x2c44c0['faxAccounts'][_0x1fda36['FaxAccountId']])['then'](function(_0x730c70){ut[_0xa537('0x48')](_0xa537('0x56'),_0x730c70);_0x4ce16d(ut[_0xa537('0x37')](_0xa537('0x57')));})['catch'](function(_0x1a6f8a){ut[_0xa537('0x48')](_0xa537('0x58'),_0x1a6f8a);updateStatus(_0x1fda36);_0x4b45d3(ut['message']('Fax\x20failed'));});});};Fax[_0xa537('0x20')]['checkAfterSend']=function(_0x5dbbf4){var _0x23dbd6=this;return new BPromise(function(_0x4947d5,_0x15408a){var _0x523cb4=_0x23dbd6[_0xa537('0x59')](_0x23dbd6[_0xa537('0xf')][_0x5dbbf4[_0xa537('0x5a')]][_0xa537('0x5b')],_0x5dbbf4);if(_0x523cb4[_0xa537('0x5c')]){_0x4947d5(ut[_0xa537('0x37')](_0xa537('0x5d')));}else{_0x15408a(ut[_0xa537('0x37')](_0x523cb4[_0xa537('0x37')]));}});};function originate(_0x53aa13,_0x398c10,_0x29b02e){return new BPromise(function(_0x56dcd2,_0x1d3269){if(_0x29b02e){var _0x552e40=util['format'](_0xa537('0x5e'),path[_0xa537('0x39')](_0x53aa13[_0xa537('0x5')])[_0xa537('0x27')],_0x53aa13[_0xa537('0x5')]);gs['execute'](_0x552e40)['then'](function(){_0x53aa13[_0xa537('0x5')]=util[_0xa537('0x5f')](_0xa537('0x60'),path[_0xa537('0x39')](_0x53aa13[_0xa537('0x5')])[_0xa537('0x61')],path['parse'](_0x53aa13[_0xa537('0x5')])[_0xa537('0x27')]);_0x398c10[_0xa537('0x62')]=_0x53aa13[_0xa537('0x5')];ut[_0xa537('0x48')]('Convert\x20pdf\x20to\x20tif','');ami[_0xa537('0x63')](ut['variablesAction'](_0x53aa13,_0x398c10))['then'](function(_0x3e479e){_0x56dcd2(_0x3e479e);})[_0xa537('0x3d')](function(_0x2a0f3b){_0x1d3269(_0x2a0f3b);});})['catch'](function(_0x479e20){_0x1d3269(_0x479e20);});}else{ami['Action'](ut[_0xa537('0x64')](_0x53aa13,_0x398c10))['then'](function(_0x1258e7){_0x56dcd2(_0x1258e7);})[_0xa537('0x3d')](function(_0x3448d6){_0x1d3269(_0x3448d6);});}});}Fax[_0xa537('0x20')][_0xa537('0x55')]=function(_0x5d1a5c,_0x19d45a){var _0x257560=this;return new BPromise(function(_0x3799bc,_0x20df7b){var _0x301ead=uuid['v4']();var _0x5ead28=ut['addVariables'](_0x5d1a5c,_0x19d45a);_0x257560[_0xa537('0x11')][_0x301ead]=new Action(_0x301ead,_0x19d45a,_0x5d1a5c);var _0x325215=_0x257560['actions'][_0x301ead];if(path[_0xa537('0x39')](_0x5d1a5c['path'])[_0xa537('0x65')]===_0xa537('0x3a')){originate(_0x325215,_0x5ead28,!![])[_0xa537('0x47')](function(_0x3db415){_0x3799bc(_0x3db415);})[_0xa537('0x3d')](function(_0x1828f2){_0x20df7b(_0x1828f2);});}else{originate(_0x325215,_0x5ead28,![])[_0xa537('0x47')](function(_0x1b5312){_0x3799bc(_0x1b5312);})[_0xa537('0x3d')](function(_0x30166b){_0x20df7b(_0x30166b);});}});};Fax[_0xa537('0x20')][_0xa537('0x66')]=function(_0x11e949){return!_['isNil'](_0x11e949)&&!_['isNil'](_0x11e949['name'])&&!_['isNil'](_0x11e949['active'])&&_0x11e949[_0xa537('0x67')]&&!_['isNil'](this[_0xa537('0x10')][util[_0xa537('0x5f')](_0xa537('0x68'),_0x11e949['name'])])&&!_[_0xa537('0x69')](this['trunks'][util['format']('SIP/%s',_0x11e949[_0xa537('0x27')])][_0xa537('0x6a')])&&(this[_0xa537('0x10')][util[_0xa537('0x5f')]('SIP/%s',_0x11e949['name'])][_0xa537('0x6a')]==='reachable'||this[_0xa537('0x10')][util[_0xa537('0x5f')]('SIP/%s',_0x11e949[_0xa537('0x27')])][_0xa537('0x6a')]===_0xa537('0x6b'));};Fax[_0xa537('0x20')]['checkTrunk']=function(_0x5891f4,_0xb04f5c){if(!this[_0xa537('0x66')](_0x5891f4)){ut[_0xa537('0x48')](_0xa537('0x6c'),_[_0xa537('0x69')](_0x5891f4)?'':_0x5891f4[_0xa537('0x27')]+_0xa537('0x6d'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}if(_[_0xa537('0x69')](_0xb04f5c[_0xa537('0x8')])){ut[_0xa537('0x48')](_0xa537('0x6e'),JSON['stringify'](_0xb04f5c));return{'isValid':![],'message':_0xa537('0x6f')};}if(_[_0xa537('0x69')](_0xb04f5c[_0xa537('0x5')])){ut[_0xa537('0x48')]('[Fax][checkTrunk][Empty\x20path]',JSON['stringify'](_0xb04f5c));return{'isValid':![],'message':_0xa537('0x70')};}return{'isValid':!![],'message':_0xa537('0x71')};};module[_0xa537('0x72')]=Fax; \ No newline at end of file +var _0x2a37=['[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','Empty\x20path','util','lodash','uuid','moment','path','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./util/util','./action','../rpc/faxAccount','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','syncVarSet','newstate','syncNewState','newexten','syncNewExten','faxstatus','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','context','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','\x20result\x20conversion\x20file\x20','message','create','parse','then','notify','.pdf','catch','stringify','error','\x20receiveFax\x20','response','AttachmentId','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','Trunk\x20Reachable','format','execute','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','execOriginate','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','unmonitored'];(function(_0x56e418,_0x2891e3){var _0x56163f=function(_0x465546){while(--_0x465546){_0x56e418['push'](_0x56e418['shift']());}};_0x56163f(++_0x2891e3);}(_0x2a37,0x14e));var _0x72a3=function(_0x18ee0b,_0x2b8921){_0x18ee0b=_0x18ee0b-0x0;var _0x2f3743=_0x2a37[_0x18ee0b];return _0x2f3743;};'use strict';var util=require(_0x72a3('0x0'));var _=require(_0x72a3('0x1'));var BPromise=require('bluebird');var uuid=require(_0x72a3('0x2'));var moment=require(_0x72a3('0x3'));var path=require(_0x72a3('0x4'));var tiff2pdf=require('tiff2pdf');var gs=require(_0x72a3('0x5'));var logger=require(_0x72a3('0x6'))(_0x72a3('0x7'));var ami=require(_0x72a3('0x8'));var rpcDb=require(_0x72a3('0x9'));var Channel=require('./channel');var ut=require(_0x72a3('0xa'));var Action=require(_0x72a3('0xb'));var faxAccount=require(_0x72a3('0xc'));var attachment=require('../rpc/attachment');var faxMessage=require(_0x72a3('0xd'));function Fax(_0xea1bf){this[_0x72a3('0xe')]={};this[_0x72a3('0xf')]=_0xea1bf[_0x72a3('0xf')];this[_0x72a3('0x10')]=_0xea1bf[_0x72a3('0x10')];this[_0x72a3('0x11')]={};ami['on'](_0x72a3('0x12'),this[_0x72a3('0x13')][_0x72a3('0x14')](this));ami['on']('varset',this[_0x72a3('0x15')][_0x72a3('0x14')](this));ami['on'](_0x72a3('0x16'),this[_0x72a3('0x17')][_0x72a3('0x14')](this));ami['on'](_0x72a3('0x18'),this[_0x72a3('0x19')]['bind'](this));ami['on'](_0x72a3('0x1a'),this['syncFaxStatus'][_0x72a3('0x14')](this));ami['on']('receivefax',this[_0x72a3('0x1b')][_0x72a3('0x14')](this));ami['on'](_0x72a3('0x1c'),this[_0x72a3('0x1d')][_0x72a3('0x14')](this));ami['on'](_0x72a3('0x1e'),this[_0x72a3('0x1f')][_0x72a3('0x14')](this));}Fax[_0x72a3('0x20')][_0x72a3('0x13')]=function(_0x594f87){if(_0x594f87[_0x72a3('0x21')]==='from-voip-provider'){for(var _0x2cabbe in this['faxAccounts']){if(this[_0x72a3('0xf')][_0x72a3('0x22')](_0x2cabbe)){if(_0x594f87[_0x72a3('0x23')]===this['faxAccounts'][_0x2cabbe][_0x72a3('0x24')]){this['channels'][_0x594f87[_0x72a3('0x25')]]={};this[_0x72a3('0xe')][_0x594f87[_0x72a3('0x25')]][_0x72a3('0x26')]=_0x594f87['channel'];this[_0x72a3('0xe')][_0x594f87[_0x72a3('0x25')]]['id']=this[_0x72a3('0xf')][_0x2cabbe]['id'];this[_0x72a3('0xe')][_0x594f87[_0x72a3('0x25')]][_0x72a3('0x27')]=this['faxAccounts'][_0x2cabbe][_0x72a3('0x27')];logger[_0x72a3('0x28')](_0x594f87[_0x72a3('0x25')],'\x20syncNewchannel\x20');}}}}if(this[_0x72a3('0x11')][_0x594f87['uniqueid']]){this[_0x72a3('0xe')][_0x594f87[_0x72a3('0x25')]]={};this[_0x72a3('0xe')][_0x594f87['uniqueid']][_0x72a3('0x26')]=_0x594f87[_0x72a3('0x26')];logger[_0x72a3('0x28')](_0x594f87[_0x72a3('0x25')],_0x72a3('0x29'));}};Fax[_0x72a3('0x20')][_0x72a3('0x15')]=function(_0x270d2d){if(this['channels'][_0x270d2d[_0x72a3('0x25')]]){for(var _0x24e1bd in _0x270d2d[_0x72a3('0x2a')]){if(_0x270d2d[_0x72a3('0x2a')][_0x72a3('0x22')](_0x24e1bd)){this[_0x72a3('0xe')][_0x270d2d[_0x72a3('0x25')]][_0x24e1bd]=_0x270d2d[_0x72a3('0x2b')];}}}};Fax[_0x72a3('0x20')][_0x72a3('0x17')]=function(_0x1d3aa8){if(this['channels'][_0x1d3aa8[_0x72a3('0x25')]]){this[_0x72a3('0xe')][_0x1d3aa8[_0x72a3('0x25')]][_0x72a3('0x2c')]=_0x1d3aa8['channelstate'];this[_0x72a3('0xe')][_0x1d3aa8[_0x72a3('0x25')]]['channelstatedesc']=_0x1d3aa8[_0x72a3('0x2d')];}};Fax[_0x72a3('0x20')][_0x72a3('0x19')]=function(_0x118206){if(this['channels'][_0x118206[_0x72a3('0x25')]]){for(var _0x13fcdf in _0x118206[_0x72a3('0x2a')]){if(_0x118206[_0x72a3('0x2a')]['hasOwnProperty'](_0x13fcdf)){this[_0x72a3('0xe')][_0x118206[_0x72a3('0x25')]][_0x13fcdf]=_0x118206[_0x72a3('0x2b')];}}}};Fax[_0x72a3('0x20')]['syncFaxStatus']=function(_0x1194b2){if(this['channels'][_0x1194b2[_0x72a3('0x25')]]){this[_0x72a3('0xe')][_0x1194b2[_0x72a3('0x25')]][_0x72a3('0x2e')]=_0x1194b2[_0x72a3('0x2e')];this[_0x72a3('0xe')][_0x1194b2['uniqueid']][_0x72a3('0x2f')]=_0x1194b2['status'];this[_0x72a3('0xe')][_0x1194b2[_0x72a3('0x25')]][_0x72a3('0x24')]=_0x1194b2[_0x72a3('0x24')];this[_0x72a3('0xe')][_0x1194b2['uniqueid']][_0x72a3('0x30')]=_0x1194b2[_0x72a3('0x30')];logger[_0x72a3('0x28')](_0x1194b2[_0x72a3('0x25')],_0x72a3('0x31'));}};Fax[_0x72a3('0x20')]['syncReceiveFax']=function(_0x41743b){var _0x58f240=this;if(this[_0x72a3('0xe')][_0x41743b[_0x72a3('0x25')]]){var _0x2251ec=this[_0x72a3('0xe')][_0x41743b[_0x72a3('0x25')]]['id'];this['channels'][_0x41743b[_0x72a3('0x25')]][_0x72a3('0x32')]=_0x41743b[_0x72a3('0x32')];this['channels'][_0x41743b[_0x72a3('0x25')]][_0x72a3('0x33')]=_0x41743b[_0x72a3('0x33')];this[_0x72a3('0xe')][_0x41743b[_0x72a3('0x25')]]['localstationid']=_0x41743b[_0x72a3('0x24')];this[_0x72a3('0xe')][_0x41743b[_0x72a3('0x25')]][_0x72a3('0x34')]=_0x41743b[_0x72a3('0x34')];this['channels'][_0x41743b['uniqueid']][_0x72a3('0x35')]=_0x41743b[_0x72a3('0x35')];this[_0x72a3('0xe')][_0x41743b[_0x72a3('0x25')]]['filename']=_0x41743b[_0x72a3('0x30')];this['channels'][_0x41743b[_0x72a3('0x25')]][_0x72a3('0x36')]=_0x41743b[_0x72a3('0x36')];if(this[_0x72a3('0xe')][_0x41743b[_0x72a3('0x25')]][_0x72a3('0x33')]>0x0){tiff2pdf(_0x41743b['filename'],'/var/opt/motion2/server/files/attachments/',function(_0x42ca21){logger[_0x72a3('0x28')](_0x41743b['uniqueid'],_0x72a3('0x37'),_0x42ca21[_0x72a3('0x38')]);attachment[_0x72a3('0x39')]({'name':path[_0x72a3('0x3a')](_0x41743b['filename'])[_0x72a3('0x27')],'basename':path[_0x72a3('0x3a')](_0x41743b[_0x72a3('0x30')])[_0x72a3('0x27')]+'.pdf','type':'application/pdf'})[_0x72a3('0x3b')](function(_0x666061){faxAccount[_0x72a3('0x3c')](_0x2251ec,{'from':_0x41743b[_0x72a3('0x36')],'mapKey':_0x72a3('0x7'),'body':path[_0x72a3('0x3a')](_0x41743b['filename'])['name']+_0x72a3('0x3d'),'AttachmentId':_0x666061['id']})[_0x72a3('0x3e')](function(_0x5baf01){logger['error'](_0x41743b[_0x72a3('0x25')],'\x20notify\x20',JSON[_0x72a3('0x3f')](_0x5baf01));});})[_0x72a3('0x3e')](function(_0x154f0e){logger[_0x72a3('0x40')](_0x41743b[_0x72a3('0x25')],_0x72a3('0x41'),JSON['stringify'](_0x154f0e));});});}logger['info'](_0x41743b[_0x72a3('0x25')],_0x72a3('0x41'));}};Fax[_0x72a3('0x20')][_0x72a3('0x1f')]=function(_0x3097b5){if(this['actions'][_0x3097b5[_0x72a3('0x25')]]){_['merge'](this[_0x72a3('0xe')][_0x3097b5['uniqueid']],_['pick'](_0x3097b5,[_0x72a3('0x42'),'reason']));}};function updateStatus(_0x430626){if(_0x430626[_0x72a3('0x43')]){faxMessage['update'](_0x430626['AttachmentId'],{'failMessage':_0x72a3('0x44')})[_0x72a3('0x3b')](function(_0x392858){ut[_0x72a3('0x45')]('[Fax][Message][Error][Updated]',_0x392858);})[_0x72a3('0x3e')](function(_0x301d48){ut[_0x72a3('0x45')](_0x72a3('0x46'),_0x301d48);});}else{ut[_0x72a3('0x45')](_0x72a3('0x47'));}}Fax[_0x72a3('0x20')][_0x72a3('0x48')]=function(_0x1833a9,_0x49926f,_0x1e461f){var _0x98e2d1=this;var _0x4adbbf={};if(_0x49926f){_0x4adbbf={'read':_0x49926f};}else{_0x4adbbf={'failMessage':_0x1e461f};}if(this[_0x72a3('0x11')][_0x1833a9]['AttachmentId']){faxMessage['update'](this[_0x72a3('0x11')][_0x1833a9][_0x72a3('0x43')],_0x4adbbf)[_0x72a3('0x3b')](function(_0x363bb3){ut['logger'](_0x72a3('0x49'),_0x363bb3);})[_0x72a3('0x3e')](function(_0x1a008f){ut[_0x72a3('0x45')]('[Fax][Message][NoUpdate1]',_0x1a008f);})['finally'](function(){delete _0x98e2d1[_0x72a3('0xe')][_0x1833a9];delete _0x98e2d1[_0x72a3('0x11')][_0x1833a9];});}else{ut['logger'](_0x72a3('0x4a'));delete this['channels'][_0x1833a9];delete this['actions'][_0x1833a9];}};Fax[_0x72a3('0x20')]['syncHangup']=function(_0x2a0907){var _0x168513=this;if(this['channels'][_0x2a0907[_0x72a3('0x25')]]){if(this[_0x72a3('0x11')][_0x2a0907['uniqueid']]){this[_0x72a3('0xe')][_0x2a0907['uniqueid']]['id']=this[_0x72a3('0x11')][_0x2a0907[_0x72a3('0x25')]]['id'];this[_0x72a3('0xe')][_0x2a0907[_0x72a3('0x25')]][_0x72a3('0x27')]=this[_0x72a3('0x11')][_0x2a0907[_0x72a3('0x25')]][_0x72a3('0x27')];}logger[_0x72a3('0x28')](_0x2a0907['uniqueid'],this[_0x72a3('0x11')][_0x2a0907[_0x72a3('0x25')]]?_0x72a3('0x4b'):_0x72a3('0x4c'),JSON['stringify'](this['channels'][_0x2a0907['uniqueid']]));if(this['actions'][_0x2a0907[_0x72a3('0x25')]]){if(this[_0x72a3('0xe')][_0x2a0907['uniqueid']][_0x72a3('0x4d')]>0x0&&this[_0x72a3('0xe')][_0x2a0907[_0x72a3('0x25')]]['faxstatus']===_0x72a3('0x4e')){this[_0x72a3('0x48')](_0x2a0907[_0x72a3('0x25')],!![]);}else{this[_0x72a3('0x48')](_0x2a0907[_0x72a3('0x25')],![],this[_0x72a3('0xe')][_0x2a0907[_0x72a3('0x25')]][_0x72a3('0x4f')]?_0x72a3('0x50')+this['channels'][_0x2a0907[_0x72a3('0x25')]][_0x72a3('0x4f')]:_0x72a3('0x51'));}}}};Fax[_0x72a3('0x20')][_0x72a3('0x52')]=function(_0x5cf7a9){var _0x57335e=this;return new BPromise(function(_0x698dfd,_0x44aaf4){_0x57335e['execOriginate'](_0x5cf7a9,_0x57335e[_0x72a3('0xf')][_0x5cf7a9[_0x72a3('0x53')]])[_0x72a3('0x3b')](function(_0x5efd82){ut[_0x72a3('0x45')](_0x72a3('0x54'),_0x5efd82);_0x698dfd(ut[_0x72a3('0x38')](_0x72a3('0x55')));})['catch'](function(_0x1df3ed){ut[_0x72a3('0x45')]('[Fax][execOriginate][failure]',_0x1df3ed);updateStatus(_0x5cf7a9);_0x44aaf4(ut[_0x72a3('0x38')](_0x72a3('0x56')));});});};Fax[_0x72a3('0x20')][_0x72a3('0x57')]=function(_0x4f6d9a){var _0x2090b6=this;return new BPromise(function(_0x1497dc,_0x21e151){var _0x525373=_0x2090b6[_0x72a3('0x58')](_0x2090b6['faxAccounts'][_0x4f6d9a[_0x72a3('0x53')]][_0x72a3('0x59')],_0x4f6d9a);if(_0x525373['isValid']){_0x1497dc(ut[_0x72a3('0x38')](_0x72a3('0x5a')));}else{_0x21e151(ut['message'](_0x525373[_0x72a3('0x38')]));}});};function originate(_0x488627,_0x2571a0,_0x2f901d){return new BPromise(function(_0x2342a1,_0x331bd2){if(_0x2f901d){var _0x55540e=util[_0x72a3('0x5b')]('gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit',path['parse'](_0x488627[_0x72a3('0x4')])[_0x72a3('0x27')],_0x488627['path']);gs[_0x72a3('0x5c')](_0x55540e)[_0x72a3('0x3b')](function(){_0x488627[_0x72a3('0x4')]=util[_0x72a3('0x5b')]('%s/%s.tif',path[_0x72a3('0x3a')](_0x488627['path'])[_0x72a3('0x5d')],path[_0x72a3('0x3a')](_0x488627[_0x72a3('0x4')])['name']);_0x2571a0[_0x72a3('0x5e')]=_0x488627[_0x72a3('0x4')];ut['logger'](_0x72a3('0x5f'),'');ami[_0x72a3('0x60')](ut[_0x72a3('0x61')](_0x488627,_0x2571a0))[_0x72a3('0x3b')](function(_0x52630c){_0x2342a1(_0x52630c);})[_0x72a3('0x3e')](function(_0x2c37f3){_0x331bd2(_0x2c37f3);});})[_0x72a3('0x3e')](function(_0x21aa1d){_0x331bd2(_0x21aa1d);});}else{ami[_0x72a3('0x60')](ut[_0x72a3('0x61')](_0x488627,_0x2571a0))[_0x72a3('0x3b')](function(_0xe2db7c){_0x2342a1(_0xe2db7c);})[_0x72a3('0x3e')](function(_0x4e75d7){_0x331bd2(_0x4e75d7);});}});}Fax['prototype'][_0x72a3('0x62')]=function(_0x24d70f,_0xee5222){var _0x10241a=this;return new BPromise(function(_0x123f41,_0x39a9a2){var _0x21e50e=uuid['v4']();var _0x3ef9e4=ut[_0x72a3('0x63')](_0x24d70f,_0xee5222);_0x10241a[_0x72a3('0x11')][_0x21e50e]=new Action(_0x21e50e,_0xee5222,_0x24d70f);var _0x330188=_0x10241a[_0x72a3('0x11')][_0x21e50e];if(path['parse'](_0x24d70f[_0x72a3('0x4')])[_0x72a3('0x64')]===_0x72a3('0x3d')){originate(_0x330188,_0x3ef9e4,!![])['then'](function(_0x4acbcb){_0x123f41(_0x4acbcb);})[_0x72a3('0x3e')](function(_0x56dfd4){_0x39a9a2(_0x56dfd4);});}else{originate(_0x330188,_0x3ef9e4,![])[_0x72a3('0x3b')](function(_0x32985a){_0x123f41(_0x32985a);})[_0x72a3('0x3e')](function(_0x33e9db){_0x39a9a2(_0x33e9db);});}});};Fax[_0x72a3('0x20')][_0x72a3('0x65')]=function(_0x43c11b){return!_[_0x72a3('0x66')](_0x43c11b)&&!_[_0x72a3('0x66')](_0x43c11b[_0x72a3('0x27')])&&!_[_0x72a3('0x66')](_0x43c11b[_0x72a3('0x67')])&&_0x43c11b['active']&&!_[_0x72a3('0x66')](this[_0x72a3('0x10')][util['format']('SIP/%s',_0x43c11b['name'])])&&!_[_0x72a3('0x66')](this[_0x72a3('0x10')][util['format']('SIP/%s',_0x43c11b[_0x72a3('0x27')])][_0x72a3('0x2f')])&&(this[_0x72a3('0x10')][util[_0x72a3('0x5b')]('SIP/%s',_0x43c11b[_0x72a3('0x27')])][_0x72a3('0x2f')]==='reachable'||this['trunks'][util[_0x72a3('0x5b')](_0x72a3('0x68'),_0x43c11b[_0x72a3('0x27')])][_0x72a3('0x2f')]===_0x72a3('0x69'));};Fax[_0x72a3('0x20')][_0x72a3('0x58')]=function(_0x4cc0e3,_0x3210f3){if(!this[_0x72a3('0x65')](_0x4cc0e3)){ut[_0x72a3('0x45')](_0x72a3('0x6a'),_[_0x72a3('0x66')](_0x4cc0e3)?'':_0x4cc0e3[_0x72a3('0x27')]+_0x72a3('0x6b'));return{'isValid':![],'message':_0x72a3('0x6c')};}if(_['isNil'](_0x3210f3[_0x72a3('0x7')])){ut[_0x72a3('0x45')]('[Fax][checkTrunk][Empty\x20Fax]',JSON[_0x72a3('0x3f')](_0x3210f3));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0x72a3('0x66')](_0x3210f3[_0x72a3('0x4')])){ut[_0x72a3('0x45')]('[Fax][checkTrunk][Empty\x20path]',JSON[_0x72a3('0x3f')](_0x3210f3));return{'isValid':![],'message':_0x72a3('0x6d')};}return{'isValid':!![],'message':'Is\x20Valid'};};module['exports']=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 6dba03a..ac71c93 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 _0x7340=['notify','then','catch','[Notify]\x20','util','bluebird','../rpc/faxAccount','inspect'];(function(_0x58f8f6,_0x207b30){var _0x1569dc=function(_0x494d51){while(--_0x494d51){_0x58f8f6['push'](_0x58f8f6['shift']());}};_0x1569dc(++_0x207b30);}(_0x7340,0x13c));var _0x0734=function(_0x49169b,_0x41b709){_0x49169b=_0x49169b-0x0;var _0x3475d9=_0x7340[_0x49169b];return _0x3475d9;};'use strict';var util=require(_0x0734('0x0'));var BPromise=require(_0x0734('0x1'));var logger=require('../../../config/logger')('preview');var _=require('lodash');var faxAccount=require(_0x0734('0x2'));function loggerCatch(_0x2c15c4){return function(_0x339446){logger['error'](_0x2c15c4,util[_0x0734('0x3')](_0x339446,{'showHidden':![],'depth':null}));};}exports[_0x0734('0x4')]=function(_0x43c713,_0x73344c){return BPromise['resolve']()[_0x0734('0x5')](faxAccount[_0x0734('0x4')](_0x43c713,_0x73344c))[_0x0734('0x6')](loggerCatch(_0x0734('0x7')));}; \ No newline at end of file +var _0x5df8=['inspect','notify','resolve','then','catch','[Notify]\x20','bluebird','../../../config/logger','preview','../rpc/faxAccount','error'];(function(_0x202404,_0x239143){var _0x4aacd9=function(_0x4c6107){while(--_0x4c6107){_0x202404['push'](_0x202404['shift']());}};_0x4aacd9(++_0x239143);}(_0x5df8,0x192));var _0x85df=function(_0x446ed4,_0x5875d9){_0x446ed4=_0x446ed4-0x0;var _0x4a26e5=_0x5df8[_0x446ed4];return _0x4a26e5;};'use strict';var util=require('util');var BPromise=require(_0x85df('0x0'));var logger=require(_0x85df('0x1'))(_0x85df('0x2'));var _=require('lodash');var faxAccount=require(_0x85df('0x3'));function loggerCatch(_0x227266){return function(_0x158850){logger[_0x85df('0x4')](_0x227266,util[_0x85df('0x5')](_0x158850,{'showHidden':![],'depth':null}));};}exports[_0x85df('0x6')]=function(_0x25a840,_0xb47f96){return BPromise[_0x85df('0x7')]()[_0x85df('0x8')](faxAccount['notify'](_0x25a840,_0xb47f96))[_0x85df('0x9')](loggerCatch(_0x85df('0xa')));}; \ No newline at end of file diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js index e8c658a..039fb8c 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 _0xb6db=['bluebird','exec','info','Exec\x20gs','../../../../config/logger','fax'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0xb6db,0x142));var _0xbb6d=function(_0x3ef1e2,_0x49939e){_0x3ef1e2=_0x3ef1e2-0x0;var _0x3f1966=_0xb6db[_0x3ef1e2];return _0x3f1966;};'use strict';var util=require('util');var logger=require(_0xbb6d('0x0'))(_0xbb6d('0x1'));var BPromise=require(_0xbb6d('0x2'));var exec=require('child_process')[_0xbb6d('0x3')];exports['execute']=function(_0x8ce9b5){return new BPromise(function(_0x200347,_0x3553e8){exec(_0x8ce9b5,function(_0x100e87,_0x3dfb6e,_0x59e76f){logger[_0xbb6d('0x4')](_0xbb6d('0x5'),_0x3dfb6e);if(_0x100e87){logger['info'](_0xbb6d('0x5'),'\x20Error\x20:',util['inspect'](_0x100e87,{'showHidden':![],'depth':null}),_0x3dfb6e,_0x59e76f);_0x3553e8(_0x100e87);}_0x200347(_0x3dfb6e);});});}; \ No newline at end of file +var _0x5365=['util','../../../../config/logger','exec','info','Exec\x20gs','\x20Error\x20:'];(function(_0x11c101,_0x14023b){var _0x8f65e4=function(_0x4c33b4){while(--_0x4c33b4){_0x11c101['push'](_0x11c101['shift']());}};_0x8f65e4(++_0x14023b);}(_0x5365,0xc6));var _0x5536=function(_0x11e238,_0x17ed9b){_0x11e238=_0x11e238-0x0;var _0x1e23ef=_0x5365[_0x11e238];return _0x1e23ef;};'use strict';var util=require(_0x5536('0x0'));var logger=require(_0x5536('0x1'))('fax');var BPromise=require('bluebird');var exec=require('child_process')[_0x5536('0x2')];exports['execute']=function(_0x56ae91){return new BPromise(function(_0x13ff37,_0x4563c5){exec(_0x56ae91,function(_0x149725,_0x151a58,_0x56ced5){logger[_0x5536('0x3')](_0x5536('0x4'),_0x151a58);if(_0x149725){logger[_0x5536('0x3')](_0x5536('0x4'),_0x5536('0x5'),util['inspect'](_0x149725,{'showHidden':![],'depth':null}),_0x151a58,_0x56ced5);_0x4563c5(_0x149725);}_0x13ff37(_0x151a58);});});}; \ 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 709a4e3..2155de9 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 _0x1eea=['headerinfo','format','\x22%s\x22','gateway','faxdetect','t38timeout','localstationid','path','variablesAction','originate','xcally-motion-fax','from-sip','uniqueid','../../../../config/logger','logger','inspect','addVariables','ecm'];(function(_0x5c864f,_0x19d4ad){var _0x1e032a=function(_0xa9b097){while(--_0xa9b097){_0x5c864f['push'](_0x5c864f['shift']());}};_0x1e032a(++_0x19d4ad);}(_0x1eea,0x13f));var _0xa1ee=function(_0x459b6b,_0x9616eb){_0x459b6b=_0x459b6b-0x0;var _0x3d93f1=_0x1eea[_0x459b6b];return _0x3d93f1;};'use strict';var util=require('util');var _=require('lodash');var moment=require('moment');var logger=require(_0xa1ee('0x0'))('fax');exports['message']=function(_0x5217f7){return{'message':_0x5217f7};};exports[_0xa1ee('0x1')]=function(_0x2688a3,_0x388714){logger['info'](_0x2688a3,util[_0xa1ee('0x2')](_0x388714,{'showHidden':![],'depth':null}));};exports[_0xa1ee('0x3')]=function(_0xcbbc65,_0x168ddb){var _0x53def1={'XMF-ECM':_0x168ddb[_0xa1ee('0x4')],'XMF-HEADERINFO':_0x168ddb[_0xa1ee('0x5')],'XMF-MINRATE':_0x168ddb['minrate'],'XMF-MAXRATE':_0x168ddb['maxrate'],'XMF-MODEM':util[_0xa1ee('0x6')](_0xa1ee('0x7'),_0x168ddb['modem']),'XMF-GATEWAY':_0x168ddb[_0xa1ee('0x8')],'XMF-FAXDETECT':_0x168ddb[_0xa1ee('0x9')],'XMF-T38TIMEOUT':_0x168ddb[_0xa1ee('0xa')],'XMF-LOCALSTATIONID':_0x168ddb[_0xa1ee('0xb')],'XMF-PATH':_0xcbbc65[_0xa1ee('0xc')]};return _0x53def1;};exports[_0xa1ee('0xd')]=function(_0x59a58f,_0x3f8f64){return{'actionid':_0x59a58f['uniqueid'],'action':_0xa1ee('0xe'),'channel':_0x59a58f['channel'],'Exten':_0xa1ee('0xf'),'Context':_0xa1ee('0x10'),'Priority':'1','callerid':util[_0xa1ee('0x6')]('\x22%s\x22\x20<%s>',_0x59a58f[_0xa1ee('0x5')]?_0x59a58f['headerinfo']:'',_0x59a58f[_0xa1ee('0xb')]),'variable':_0x3f8f64,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x59a58f[_0xa1ee('0x11')]};}; \ No newline at end of file +var _0x560e=['minrate','maxrate','\x22%s\x22','gateway','faxdetect','t38timeout','localstationid','variablesAction','uniqueid','originate','channel','xcally-motion-fax','from-sip','moment','message','logger','info','inspect','ecm','headerinfo'];(function(_0xc1ae88,_0x15f138){var _0x36795f=function(_0xd3958e){while(--_0xd3958e){_0xc1ae88['push'](_0xc1ae88['shift']());}};_0x36795f(++_0x15f138);}(_0x560e,0xd5));var _0xe560=function(_0xa74d52,_0x430427){_0xa74d52=_0xa74d52-0x0;var _0x1e1247=_0x560e[_0xa74d52];return _0x1e1247;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0xe560('0x0'));var logger=require('../../../../config/logger')('fax');exports[_0xe560('0x1')]=function(_0x32f33a){return{'message':_0x32f33a};};exports[_0xe560('0x2')]=function(_0x2d7ca4,_0x1d46d9){logger[_0xe560('0x3')](_0x2d7ca4,util[_0xe560('0x4')](_0x1d46d9,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x4529c5,_0x3bd7d1){var _0x4e3509={'XMF-ECM':_0x3bd7d1[_0xe560('0x5')],'XMF-HEADERINFO':_0x3bd7d1[_0xe560('0x6')],'XMF-MINRATE':_0x3bd7d1[_0xe560('0x7')],'XMF-MAXRATE':_0x3bd7d1[_0xe560('0x8')],'XMF-MODEM':util['format'](_0xe560('0x9'),_0x3bd7d1['modem']),'XMF-GATEWAY':_0x3bd7d1[_0xe560('0xa')],'XMF-FAXDETECT':_0x3bd7d1[_0xe560('0xb')],'XMF-T38TIMEOUT':_0x3bd7d1[_0xe560('0xc')],'XMF-LOCALSTATIONID':_0x3bd7d1[_0xe560('0xd')],'XMF-PATH':_0x4529c5['path']};return _0x4e3509;};exports[_0xe560('0xe')]=function(_0x37fcee,_0x4c4966){return{'actionid':_0x37fcee[_0xe560('0xf')],'action':_0xe560('0x10'),'channel':_0x37fcee[_0xe560('0x11')],'Exten':_0xe560('0x12'),'Context':_0xe560('0x13'),'Priority':'1','callerid':util['format']('\x22%s\x22\x20<%s>',_0x37fcee[_0xe560('0x6')]?_0x37fcee[_0xe560('0x6')]:'',_0x37fcee[_0xe560('0xd')]),'variable':_0x4c4966,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x37fcee[_0xe560('0xf')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 9e9b758..9c79b0f 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 _0xcc63=['[index.js][initParams]','inspect','sync','error','util','moment','./server','./realtime','./report','./acw','./trigger','./dialer','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/voiceExtension','./rpc/integrations/zendesk','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','get','hour','resolve','then','getTelephones','initTelephones','getTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','initTemplates','getZendeskAccounts','initZendeskAccounts','initSalesforceAccounts','getSugarcrmAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','initVoiceExtensions','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch'];(function(_0xf59a9a,_0x2a0960){var _0x165a54=function(_0x32f1c4){while(--_0x32f1c4){_0xf59a9a['push'](_0xf59a9a['shift']());}};_0x165a54(++_0x2a0960);}(_0xcc63,0x96));var _0x3cc6=function(_0x54ce7c,_0x47b6af){_0x54ce7c=_0x54ce7c-0x0;var _0xb0293c=_0xcc63[_0x54ce7c];return _0xb0293c;};'use strict';var util=require(_0x3cc6('0x0'));var moment=require(_0x3cc6('0x1'));var server=require(_0x3cc6('0x2'));var Realtime=require(_0x3cc6('0x3'));var Report=require(_0x3cc6('0x4'));var Acw=require(_0x3cc6('0x5'));var Trigger=require(_0x3cc6('0x6'));var Dialer=require(_0x3cc6('0x7'));var Preview=require('./preview');var Fax=require(_0x3cc6('0x8'));var user=require(_0x3cc6('0x9'));var voiceQueue=require(_0x3cc6('0xa'));var voiceQueueReport=require(_0x3cc6('0xb'));var voiceCallReport=require(_0x3cc6('0xc'));var trunk=require(_0x3cc6('0xd'));var trigger=require(_0x3cc6('0xe'));var template=require(_0x3cc6('0xf'));var cmHopperHistory=require(_0x3cc6('0x10'));var campaign=require('./rpc/campaign');var voiceExtension=require(_0x3cc6('0x11'));var faxAccount=require('./rpc/faxAccount');var zendesk=require(_0x3cc6('0x12'));var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require(_0x3cc6('0x13'));var freshdesk=require(_0x3cc6('0x14'));var desk=require(_0x3cc6('0x15'));var zoho=require(_0x3cc6('0x16'));var vtiger=require(_0x3cc6('0x17'));var freshsales=require('./rpc/integrations/freshsales');var servicenow=require(_0x3cc6('0x18'));var dynamics365=require(_0x3cc6('0x19'));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(_0x3cc6('0x1a'))('ami');var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x3cc6('0x1b')](_0x3cc6('0x1c'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get'](_0x3cc6('0x1c'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0x3cc6('0x1d')]()[_0x3cc6('0x1e')](user['getAgents']())['then'](realtime['initAgents']())[_0x3cc6('0x1e')](user[_0x3cc6('0x1f')]())[_0x3cc6('0x1e')](realtime[_0x3cc6('0x20')]())['then'](trunk[_0x3cc6('0x21')]())[_0x3cc6('0x1e')](realtime['initTrunks']())[_0x3cc6('0x1e')](voiceQueue[_0x3cc6('0x22')]())[_0x3cc6('0x1e')](realtime[_0x3cc6('0x23')]())[_0x3cc6('0x1e')](trigger[_0x3cc6('0x24')]())['then'](realtime[_0x3cc6('0x25')]())[_0x3cc6('0x1e')](template['getTemplates']())[_0x3cc6('0x1e')](realtime[_0x3cc6('0x26')]())['then'](zendesk[_0x3cc6('0x27')]())['then'](realtime[_0x3cc6('0x28')]())[_0x3cc6('0x1e')](salesforce['getSalesforceAccounts']())[_0x3cc6('0x1e')](realtime[_0x3cc6('0x29')]())['then'](sugarcrm[_0x3cc6('0x2a')]())[_0x3cc6('0x1e')](realtime['initSugarcrmAccounts']())[_0x3cc6('0x1e')](freshdesk['getFreshdeskAccounts']())['then'](realtime[_0x3cc6('0x2b')]())[_0x3cc6('0x1e')](desk[_0x3cc6('0x2c')]())[_0x3cc6('0x1e')](realtime[_0x3cc6('0x2d')]())[_0x3cc6('0x1e')](zoho[_0x3cc6('0x2e')]())['then'](realtime[_0x3cc6('0x2f')]())[_0x3cc6('0x1e')](vtiger[_0x3cc6('0x30')]())[_0x3cc6('0x1e')](realtime[_0x3cc6('0x31')]())[_0x3cc6('0x1e')](freshsales[_0x3cc6('0x32')]())['then'](realtime[_0x3cc6('0x33')]())['then'](servicenow[_0x3cc6('0x34')]())[_0x3cc6('0x1e')](realtime[_0x3cc6('0x35')]())[_0x3cc6('0x1e')](dynamics365[_0x3cc6('0x36')]())[_0x3cc6('0x1e')](realtime[_0x3cc6('0x37')]())[_0x3cc6('0x1e')](campaign[_0x3cc6('0x38')]())[_0x3cc6('0x1e')](realtime[_0x3cc6('0x39')]())[_0x3cc6('0x1e')](voiceExtension['getVoiceExtensions']())[_0x3cc6('0x1e')](realtime[_0x3cc6('0x3a')]())[_0x3cc6('0x1e')](faxAccount['getFaxAccounts']())[_0x3cc6('0x1e')](realtime[_0x3cc6('0x3b')]())['then'](function(){return realtime;});}function initParams(){return Promise['resolve']()[_0x3cc6('0x1e')](voiceQueueReport[_0x3cc6('0x3c')]())['then'](realtime[_0x3cc6('0x3d')]())[_0x3cc6('0x1e')](cmHopperHistory[_0x3cc6('0x3e')]())['then'](realtime[_0x3cc6('0x3f')]())[_0x3cc6('0x1e')](cmHopperHistory[_0x3cc6('0x40')]())[_0x3cc6('0x1e')](realtime[_0x3cc6('0x41')]())[_0x3cc6('0x1e')](voiceCallReport[_0x3cc6('0x42')]())[_0x3cc6('0x1e')](realtime[_0x3cc6('0x43')]())[_0x3cc6('0x44')](function(_0x2394ec){logger['error'](_0x3cc6('0x45'),util[_0x3cc6('0x46')](_0x2394ec,{'showHidden':![],'depth':null}));});}function main(){return server['listen'](realtime,preview,fax)['then'](function(){return initRealtime();})[_0x3cc6('0x1e')](function(){return initParams();})[_0x3cc6('0x1e')](function(){report[_0x3cc6('0x47')]();setInterval(initRealtime,0x1388);})[_0x3cc6('0x44')](function(_0x54aaed){logger[_0x3cc6('0x48')]('[index.js][main]',util['inspect'](_0x54aaed,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0xbfa7=['then','initAgents','getTelephones','initTrunks','getZendeskAccounts','getSalesforceAccounts','getFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initVoiceQueueReports','initVoiceQueueHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','error','[index.js][initParams]','inspect','catch','[index.js][main]','util','moment','./server','./report','./acw','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/faxAccount','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/dynamics365','../../config/logger','get','getAgents'];(function(_0x1cbead,_0x517429){var _0x568754=function(_0x39f319){while(--_0x39f319){_0x1cbead['push'](_0x1cbead['shift']());}};_0x568754(++_0x517429);}(_0xbfa7,0x98));var _0x7bfa=function(_0xb31c6c,_0x177eef){_0xb31c6c=_0xb31c6c-0x0;var _0x82d760=_0xbfa7[_0xb31c6c];return _0x82d760;};'use strict';var util=require(_0x7bfa('0x0'));var moment=require(_0x7bfa('0x1'));var server=require(_0x7bfa('0x2'));var Realtime=require('./realtime');var Report=require(_0x7bfa('0x3'));var Acw=require(_0x7bfa('0x4'));var Trigger=require(_0x7bfa('0x5'));var Dialer=require(_0x7bfa('0x6'));var Preview=require(_0x7bfa('0x7'));var Fax=require(_0x7bfa('0x8'));var user=require(_0x7bfa('0x9'));var voiceQueue=require(_0x7bfa('0xa'));var voiceQueueReport=require(_0x7bfa('0xb'));var voiceCallReport=require(_0x7bfa('0xc'));var trunk=require(_0x7bfa('0xd'));var trigger=require(_0x7bfa('0xe'));var template=require(_0x7bfa('0xf'));var cmHopperHistory=require(_0x7bfa('0x10'));var campaign=require(_0x7bfa('0x11'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0x7bfa('0x12'));var zendesk=require('./rpc/integrations/zendesk');var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require(_0x7bfa('0x13'));var freshdesk=require(_0x7bfa('0x14'));var desk=require('./rpc/integrations/desk');var zoho=require(_0x7bfa('0x15'));var vtiger=require(_0x7bfa('0x16'));var freshsales=require(_0x7bfa('0x17'));var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require(_0x7bfa('0x18'));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(_0x7bfa('0x19'))('ami');var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x7bfa('0x1a')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x7bfa('0x1a')]('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise['resolve']()['then'](user[_0x7bfa('0x1b')]())[_0x7bfa('0x1c')](realtime[_0x7bfa('0x1d')]())[_0x7bfa('0x1c')](user[_0x7bfa('0x1e')]())[_0x7bfa('0x1c')](realtime['initTelephones']())[_0x7bfa('0x1c')](trunk['getTrunks']())[_0x7bfa('0x1c')](realtime[_0x7bfa('0x1f')]())[_0x7bfa('0x1c')](voiceQueue['getVoiceQueues']())['then'](realtime['initVoiceQueues']())[_0x7bfa('0x1c')](trigger['getTriggers']())[_0x7bfa('0x1c')](realtime['initTriggers']())['then'](template['getTemplates']())['then'](realtime['initTemplates']())[_0x7bfa('0x1c')](zendesk[_0x7bfa('0x20')]())[_0x7bfa('0x1c')](realtime['initZendeskAccounts']())[_0x7bfa('0x1c')](salesforce[_0x7bfa('0x21')]())['then'](realtime['initSalesforceAccounts']())[_0x7bfa('0x1c')](sugarcrm['getSugarcrmAccounts']())[_0x7bfa('0x1c')](realtime['initSugarcrmAccounts']())['then'](freshdesk[_0x7bfa('0x22')]())[_0x7bfa('0x1c')](realtime['initFreshdeskAccounts']())[_0x7bfa('0x1c')](desk[_0x7bfa('0x23')]())[_0x7bfa('0x1c')](realtime[_0x7bfa('0x24')]())[_0x7bfa('0x1c')](zoho[_0x7bfa('0x25')]())[_0x7bfa('0x1c')](realtime[_0x7bfa('0x26')]())[_0x7bfa('0x1c')](vtiger[_0x7bfa('0x27')]())[_0x7bfa('0x1c')](realtime['initVtigerAccounts']())[_0x7bfa('0x1c')](freshsales[_0x7bfa('0x28')]())[_0x7bfa('0x1c')](realtime[_0x7bfa('0x29')]())[_0x7bfa('0x1c')](servicenow[_0x7bfa('0x2a')]())['then'](realtime[_0x7bfa('0x2b')]())[_0x7bfa('0x1c')](dynamics365[_0x7bfa('0x2c')]())[_0x7bfa('0x1c')](realtime[_0x7bfa('0x2d')]())[_0x7bfa('0x1c')](campaign['getCampaigns']())[_0x7bfa('0x1c')](realtime[_0x7bfa('0x2e')]())['then'](voiceExtension[_0x7bfa('0x2f')]())[_0x7bfa('0x1c')](realtime[_0x7bfa('0x30')]())['then'](faxAccount[_0x7bfa('0x31')]())[_0x7bfa('0x1c')](realtime['initFaxAccounts']())['then'](function(){return realtime;});}function initParams(){return Promise['resolve']()['then'](voiceQueueReport['getVoiceQueueReports']())[_0x7bfa('0x1c')](realtime[_0x7bfa('0x32')]())[_0x7bfa('0x1c')](cmHopperHistory['getVoiceQueueHopperHistory']())[_0x7bfa('0x1c')](realtime[_0x7bfa('0x33')]())[_0x7bfa('0x1c')](cmHopperHistory['getCampaignHopperHistory']())['then'](realtime[_0x7bfa('0x34')]())[_0x7bfa('0x1c')](voiceCallReport[_0x7bfa('0x35')]())[_0x7bfa('0x1c')](realtime[_0x7bfa('0x36')]())['catch'](function(_0xec30af){logger[_0x7bfa('0x37')](_0x7bfa('0x38'),util[_0x7bfa('0x39')](_0xec30af,{'showHidden':![],'depth':null}));});}function main(){return server['listen'](realtime,preview,fax)['then'](function(){return initRealtime();})[_0x7bfa('0x1c')](function(){return initParams();})['then'](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0x7bfa('0x3a')](function(_0x382448){logger[_0x7bfa('0x37')](_0x7bfa('0x3b'),util['inspect'](_0x382448,{'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 04890db..fb2101d 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 _0x37f8=['status','address','phone','interface','online','voiceStatus','voiceStatusQueue','onhold','local','prototype','updateStatusRealtime','toLowerCase','not_inuse','inuse','talking','statePause','toNumber','format','voiceStatusTime','voiceStatusCallerIdNumber','user:%s','emit','user:ami:update','user:presence','exports','util','moment','ioredis','../../../config/environment','defaults','name','email','accountcode','fullname','state','unknown','stateTime'];(function(_0x56c08a,_0x231c33){var _0x232a21=function(_0x3552fb){while(--_0x3552fb){_0x56c08a['push'](_0x56c08a['shift']());}};_0x232a21(++_0x231c33);}(_0x37f8,0xd2));var _0x837f=function(_0x205d4a,_0x570161){_0x205d4a=_0x205d4a-0x0;var _0x5b0319=_0x37f8[_0x205d4a];return _0x5b0319;};'use strict';var _=require('lodash');var util=require(_0x837f('0x0'));var moment=require(_0x837f('0x1'));var Redis=require(_0x837f('0x2'));var config=require(_0x837f('0x3'));config['redis']=_[_0x837f('0x4')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function Agent(_0x4e3d08){this['id']=_0x4e3d08['id']||0x0;this[_0x837f('0x5')]=_0x4e3d08[_0x837f('0x5')]||'';this[_0x837f('0x6')]=_0x4e3d08[_0x837f('0x6')]||'';this[_0x837f('0x7')]=_0x4e3d08[_0x837f('0x7')]||'';this[_0x837f('0x8')]=_0x4e3d08[_0x837f('0x8')]||'';this[_0x837f('0x9')]=_0x837f('0xa');this[_0x837f('0xb')]=0x0;this[_0x837f('0xc')]=_0x837f('0xa');this[_0x837f('0xd')]='';this[_0x837f('0xe')]='';this['mobile']='';this[_0x837f('0xf')]='';this[_0x837f('0x10')]=_0x4e3d08[_0x837f('0x10')]||![];this[_0x837f('0x11')]=_0x837f('0xa');this['voiceStatusTime']=0x0;this['voiceStatusCallerIdNumber']='';this[_0x837f('0x12')]='';this[_0x837f('0x13')]=![];this[_0x837f('0x14')]=![];}Agent[_0x837f('0x15')][_0x837f('0x16')]=function(_0x483267){if(!_0x483267[_0x837f('0x9')]){return;}var _0xb5b3f4=null;var _0x105f9c=_0x483267[_0x837f('0x9')][_0x837f('0x17')]();switch(_0x105f9c){case _0x837f('0x18'):_0x105f9c='idle';break;case _0x837f('0x19'):_0x105f9c=_0x837f('0x1a');break;}if(this['voiceStatus']!==_0x105f9c||_0x483267[_0x837f('0x1b')]){_0xb5b3f4=_[_0x837f('0x1c')](moment()[_0x837f('0x1d')]('x'));}var _0x1d17b3={'id':this['id'],'name':this['name'],'email':this[_0x837f('0x6')],'accountcode':this[_0x837f('0x7')],'fullname':this[_0x837f('0x8')],'state':this[_0x837f('0x9')],'stateTime':this[_0x837f('0xb')],'status':this['status'],'address':this[_0x837f('0xd')],'voiceStatus':_0x105f9c||this[_0x837f('0x11')],'voiceStatusTime':_0xb5b3f4||this[_0x837f('0x1e')],'voiceStatusCallerIdNumber':this[_0x837f('0x1f')],'voiceStatusQueue':this[_0x837f('0x12')],'interface':this['interface'],'onhold':this[_0x837f('0x13')]};if(this[_0x837f('0x11')]!==_0x105f9c){this[_0x837f('0x11')]=_0x105f9c;io['to'](util[_0x837f('0x1d')](_0x837f('0x20'),_0x1d17b3[_0x837f('0x5')]))[_0x837f('0x21')](_0x837f('0x22'),_0x1d17b3);io[_0x837f('0x21')](_0x837f('0x23'),_0x1d17b3);}};module[_0x837f('0x24')]=Agent; \ No newline at end of file +var _0xb201=['accountcode','fullname','state','unknown','stateTime','phone','online','voiceStatus','voiceStatusTime','voiceStatusQueue','onhold','local','prototype','updateStatusRealtime','toLowerCase','idle','inuse','statePause','toNumber','format','status','address','user:ami:update','user:presence','exports','lodash','moment','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','email'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xb201,0x1b1));var _0x1b20=function(_0x2a08c4,_0x58dab9){_0x2a08c4=_0x2a08c4-0x0;var _0x248457=_0xb201[_0x2a08c4];return _0x248457;};'use strict';var _=require(_0x1b20('0x0'));var util=require('util');var moment=require(_0x1b20('0x1'));var Redis=require(_0x1b20('0x2'));var config=require(_0x1b20('0x3'));config[_0x1b20('0x4')]=_[_0x1b20('0x5')](config[_0x1b20('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x1b20('0x6'))(new Redis(config[_0x1b20('0x4')]));function Agent(_0x34bde5){this['id']=_0x34bde5['id']||0x0;this['name']=_0x34bde5[_0x1b20('0x7')]||'';this['email']=_0x34bde5[_0x1b20('0x8')]||'';this[_0x1b20('0x9')]=_0x34bde5[_0x1b20('0x9')]||'';this[_0x1b20('0xa')]=_0x34bde5['fullname']||'';this[_0x1b20('0xb')]=_0x1b20('0xc');this[_0x1b20('0xd')]=0x0;this['status']=_0x1b20('0xc');this['address']='';this[_0x1b20('0xe')]='';this['mobile']='';this['interface']='';this[_0x1b20('0xf')]=_0x34bde5[_0x1b20('0xf')]||![];this[_0x1b20('0x10')]=_0x1b20('0xc');this[_0x1b20('0x11')]=0x0;this['voiceStatusCallerIdNumber']='';this[_0x1b20('0x12')]='';this[_0x1b20('0x13')]=![];this[_0x1b20('0x14')]=![];}Agent[_0x1b20('0x15')][_0x1b20('0x16')]=function(_0x4f4f28){if(!_0x4f4f28[_0x1b20('0xb')]){return;}var _0x24d8bf=null;var _0x341a93=_0x4f4f28['state'][_0x1b20('0x17')]();switch(_0x341a93){case'not_inuse':_0x341a93=_0x1b20('0x18');break;case _0x1b20('0x19'):_0x341a93='talking';break;}if(this[_0x1b20('0x10')]!==_0x341a93||_0x4f4f28[_0x1b20('0x1a')]){_0x24d8bf=_[_0x1b20('0x1b')](moment()[_0x1b20('0x1c')]('x'));}var _0xff7c72={'id':this['id'],'name':this[_0x1b20('0x7')],'email':this[_0x1b20('0x8')],'accountcode':this[_0x1b20('0x9')],'fullname':this[_0x1b20('0xa')],'state':this[_0x1b20('0xb')],'stateTime':this[_0x1b20('0xd')],'status':this[_0x1b20('0x1d')],'address':this[_0x1b20('0x1e')],'voiceStatus':_0x341a93||this[_0x1b20('0x10')],'voiceStatusTime':_0x24d8bf||this[_0x1b20('0x11')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x1b20('0x12')],'interface':this['interface'],'onhold':this['onhold']};if(this['voiceStatus']!==_0x341a93){this[_0x1b20('0x10')]=_0x341a93;io['to'](util['format']('user:%s',_0xff7c72[_0x1b20('0x7')]))['emit'](_0x1b20('0x1f'),_0xff7c72);io['emit'](_0x1b20('0x20'),_0xff7c72);}};module[_0x1b20('0x21')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 382f893..bfc9469 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 _0x13b6=['limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','ivrTotalCallsDays','sendMessageOneNotActive','active'];(function(_0x52d065,_0x31d24){var _0x49f7bc=function(_0x2f0966){while(--_0x2f0966){_0x52d065['push'](_0x52d065['shift']());}};_0x49f7bc(++_0x31d24);}(_0x13b6,0x189));var _0x613b=function(_0x5b94bb,_0x14c02d){_0x5b94bb=_0x5b94bb-0x0;var _0x265c28=_0x13b6[_0x5b94bb];return _0x265c28;};'use strict';function Campaign(_0x412c61){this['id']=_0x412c61['id']||0x0;this[_0x613b('0x0')]=_0x412c61[_0x613b('0x0')]||'';this[_0x613b('0x1')]=_0x412c61[_0x613b('0x1')]||_0x613b('0x2');this[_0x613b('0x3')]=0x0;this['temp']=0x0;this['ivrAnswerCallsDay']=0x0;this[_0x613b('0x4')]=0x0;this['message']='';this[_0x613b('0x5')]=!![];this[_0x613b('0x6')]=_0x412c61['active'];this['limitCalls']=_0x412c61[_0x613b('0x7')];this['dialTimezone']=_0x412c61[_0x613b('0x8')]||null;this[_0x613b('0x9')]=_0x412c61[_0x613b('0x9')]?_0x412c61[_0x613b('0x9')]:null;this['dialOriginateCallerIdName']=_0x412c61[_0x613b('0xa')];this[_0x613b('0xb')]=_0x412c61[_0x613b('0xb')];this[_0x613b('0xc')]=_0x412c61[_0x613b('0xc')]||0x1e;this['dialCongestionMaxRetry']=_0x412c61[_0x613b('0xd')];this[_0x613b('0xe')]=_0x412c61[_0x613b('0xe')];this[_0x613b('0xf')]=_0x412c61[_0x613b('0xf')];this[_0x613b('0x10')]=_0x412c61[_0x613b('0x10')];this['dialNoAnswerMaxRetry']=_0x412c61[_0x613b('0x11')];this[_0x613b('0x12')]=_0x412c61[_0x613b('0x12')];this[_0x613b('0x13')]=_0x412c61[_0x613b('0x13')];this[_0x613b('0x14')]=_0x412c61['dialNoSuchNumberMaxRetry']||0x3;this[_0x613b('0x15')]=_0x412c61[_0x613b('0x15')]||0x96;this[_0x613b('0x16')]=_0x412c61['dialDropMaxRetry']||0x3;this[_0x613b('0x17')]=_0x412c61[_0x613b('0x17')]||0x96;this[_0x613b('0x18')]=_0x412c61[_0x613b('0x18')]||0x3;this['dialAbandonedRetryFrequency']=_0x412c61['dialAbandonedRetryFrequency']||0x96;this[_0x613b('0x19')]=_0x412c61[_0x613b('0x19')]||0x3;this[_0x613b('0x1a')]=_0x412c61[_0x613b('0x1a')]||0x96;this[_0x613b('0x1b')]=_0x412c61[_0x613b('0x1b')]||0x3;this[_0x613b('0x1c')]=_0x412c61['dialAgentRejectRetryFrequency']||0x96;this[_0x613b('0x1d')]=_0x412c61['dialOrderByScheduledAt']||_0x613b('0x1e');this[_0x613b('0x1f')]=_0x412c61['dialPrefix']||undefined;this[_0x613b('0x20')]=_0x412c61[_0x613b('0x20')]||undefined;this[_0x613b('0x21')]=_0x412c61[_0x613b('0x21')]||undefined;this[_0x613b('0x22')]=_0x412c61[_0x613b('0x22')]?_0x412c61[_0x613b('0x22')]:undefined;this[_0x613b('0x23')]=_0x412c61[_0x613b('0x23')]?_0x412c61['Trunk']:undefined;this[_0x613b('0x24')]=_0x412c61[_0x613b('0x24')]?_0x412c61['Interval']:undefined;this[_0x613b('0x25')]=_0x412c61[_0x613b('0x25')]?_0x412c61[_0x613b('0x25')]:undefined;this[_0x613b('0x26')]=_0x412c61['SquareProject']?_0x412c61[_0x613b('0x25')][_0x613b('0x0')]:undefined;this[_0x613b('0x27')]=_0x412c61[_0x613b('0x27')]||![];this[_0x613b('0x28')]=_0x412c61[_0x613b('0x28')];this[_0x613b('0x29')]=_0x412c61[_0x613b('0x29')];this[_0x613b('0x2a')]=_0x412c61['dialAMDAfterGreetingSilence'];this[_0x613b('0x2b')]=_0x412c61['dialAMDTotalAnalysisTime'];this['dialAMDMinWordLength']=_0x412c61[_0x613b('0x2c')];this[_0x613b('0x2d')]=_0x412c61[_0x613b('0x2d')];this[_0x613b('0x2e')]=_0x412c61[_0x613b('0x2e')];this[_0x613b('0x2f')]=_0x412c61[_0x613b('0x2f')];this[_0x613b('0x30')]=_0x412c61[_0x613b('0x30')];}module[_0x613b('0x31')]=Campaign; \ No newline at end of file +var _0x5632=['type','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name'];(function(_0x4e1d03,_0x786f3a){var _0x362d4b=function(_0x1924d2){while(--_0x1924d2){_0x4e1d03['push'](_0x4e1d03['shift']());}};_0x362d4b(++_0x786f3a);}(_0x5632,0x177));var _0x2563=function(_0xdce248,_0x36a3cf){_0xdce248=_0xdce248-0x0;var _0x366ad0=_0x5632[_0xdce248];return _0x366ad0;};'use strict';function Campaign(_0x2e7f7e){this['id']=_0x2e7f7e['id']||0x0;this['name']=_0x2e7f7e[_0x2563('0x0')]||'';this[_0x2563('0x1')]=_0x2e7f7e['type']||_0x2563('0x2');this[_0x2563('0x3')]=0x0;this[_0x2563('0x4')]=0x0;this[_0x2563('0x5')]=0x0;this[_0x2563('0x6')]=0x0;this['message']='';this['sendMessageOneNotActive']=!![];this[_0x2563('0x7')]=_0x2e7f7e[_0x2563('0x7')];this['limitCalls']=_0x2e7f7e[_0x2563('0x8')];this[_0x2563('0x9')]=_0x2e7f7e['dialTimezone']||null;this['dialGlobalInterval']=_0x2e7f7e[_0x2563('0xa')]?_0x2e7f7e[_0x2563('0xa')]:null;this['dialOriginateCallerIdName']=_0x2e7f7e['dialOriginateCallerIdName'];this[_0x2563('0xb')]=_0x2e7f7e['dialOriginateCallerIdNumber'];this['dialOriginateTimeout']=_0x2e7f7e[_0x2563('0xc')]||0x1e;this['dialCongestionMaxRetry']=_0x2e7f7e[_0x2563('0xd')];this[_0x2563('0xe')]=_0x2e7f7e['dialCongestionRetryFrequency'];this[_0x2563('0xf')]=_0x2e7f7e[_0x2563('0xf')];this[_0x2563('0x10')]=_0x2e7f7e['dialBusyRetryFrequency'];this[_0x2563('0x11')]=_0x2e7f7e[_0x2563('0x11')];this[_0x2563('0x12')]=_0x2e7f7e[_0x2563('0x12')];this['dialGlobalMaxRetry']=_0x2e7f7e[_0x2563('0x13')];this[_0x2563('0x14')]=_0x2e7f7e[_0x2563('0x14')]||0x3;this[_0x2563('0x15')]=_0x2e7f7e[_0x2563('0x15')]||0x96;this[_0x2563('0x16')]=_0x2e7f7e[_0x2563('0x16')]||0x3;this[_0x2563('0x17')]=_0x2e7f7e[_0x2563('0x17')]||0x96;this[_0x2563('0x18')]=_0x2e7f7e[_0x2563('0x18')]||0x3;this[_0x2563('0x19')]=_0x2e7f7e['dialAbandonedRetryFrequency']||0x96;this[_0x2563('0x1a')]=_0x2e7f7e[_0x2563('0x1a')]||0x3;this[_0x2563('0x1b')]=_0x2e7f7e['dialMachineRetryFrequency']||0x96;this[_0x2563('0x1c')]=_0x2e7f7e[_0x2563('0x1c')]||0x3;this[_0x2563('0x1d')]=_0x2e7f7e[_0x2563('0x1d')]||0x96;this['dialOrderByScheduledAt']=_0x2e7f7e['dialOrderByScheduledAt']||'DESC';this[_0x2563('0x1e')]=_0x2e7f7e[_0x2563('0x1e')]||undefined;this[_0x2563('0x1f')]=_0x2e7f7e[_0x2563('0x1f')]||undefined;this[_0x2563('0x20')]=_0x2e7f7e[_0x2563('0x20')]||undefined;this[_0x2563('0x21')]=_0x2e7f7e[_0x2563('0x21')]?_0x2e7f7e[_0x2563('0x21')]:undefined;this[_0x2563('0x22')]=_0x2e7f7e['Trunk']?_0x2e7f7e[_0x2563('0x22')]:undefined;this[_0x2563('0x23')]=_0x2e7f7e[_0x2563('0x23')]?_0x2e7f7e['Interval']:undefined;this[_0x2563('0x24')]=_0x2e7f7e['SquareProject']?_0x2e7f7e['SquareProject']:undefined;this['dialQueueProject']=_0x2e7f7e[_0x2563('0x24')]?_0x2e7f7e['SquareProject'][_0x2563('0x0')]:undefined;this[_0x2563('0x25')]=_0x2e7f7e[_0x2563('0x25')]||![];this[_0x2563('0x26')]=_0x2e7f7e[_0x2563('0x26')];this['dialAMDGreeting']=_0x2e7f7e[_0x2563('0x27')];this[_0x2563('0x28')]=_0x2e7f7e[_0x2563('0x28')];this[_0x2563('0x29')]=_0x2e7f7e[_0x2563('0x29')];this['dialAMDMinWordLength']=_0x2e7f7e[_0x2563('0x2a')];this['dialAMDBetweenWordsSilence']=_0x2e7f7e['dialAMDBetweenWordsSilence'];this[_0x2563('0x2b')]=_0x2e7f7e[_0x2563('0x2b')];this[_0x2563('0x2c')]=_0x2e7f7e[_0x2563('0x2c')];this[_0x2563('0x2d')]=_0x2e7f7e[_0x2563('0x2d')];}module[_0x2563('0x2e')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index be815a9..f87800f 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 _0xd545=['transfercalleridnum','mohtime','starttime','calleridnum','calleridname','connectedlinename','accountcode','context','uniqueid','linkedid','exten','answered','answertime','endtime','lastdata','duration','billableseconds','holdtime','type','disposition','monitor','monitorFilename','queue'];(function(_0x1aa049,_0x9ae13c){var _0x357f29=function(_0xfd2f83){while(--_0xfd2f83){_0x1aa049['push'](_0x1aa049['shift']());}};_0x357f29(++_0x9ae13c);}(_0xd545,0xff));var _0x5d54=function(_0x54702c,_0x5e3194){_0x54702c=_0x54702c-0x0;var _0x4c1d06=_0xd545[_0x54702c];return _0x4c1d06;};'use strict';function Channel(){this[_0x5d54('0x0')]=null;this['channel']='';this['destinationchannel']='';this[_0x5d54('0x1')]=0x0;this[_0x5d54('0x2')]='';this['connectedlinenum']=undefined;this[_0x5d54('0x3')]=undefined;this[_0x5d54('0x4')]=0x0;this[_0x5d54('0x5')]='';this[_0x5d54('0x6')]=0x0;this[_0x5d54('0x7')]=0x0;this[_0x5d54('0x8')]=0x0;this[_0x5d54('0x9')]=![];this[_0x5d54('0xa')]=null;this[_0x5d54('0xb')]=null;this['unmanaged']=![];this['abandoned']=![];this['lastapplication']='';this[_0x5d54('0xc')]='';this[_0x5d54('0xd')]=0x0;this[_0x5d54('0xe')]=0x0;this[_0x5d54('0xf')]=0x0;this[_0x5d54('0x10')]=null;this['tag']=null;this[_0x5d54('0x11')]=null;this[_0x5d54('0x12')]=![];this[_0x5d54('0x13')]=null;this[_0x5d54('0x14')]=null;this['monitors']=[];this[_0x5d54('0x15')]=undefined;this['transferconnectedlinenum']=undefined;this['transferType']=undefined;this[_0x5d54('0x16')]=0x0;}module['exports']=Channel; \ No newline at end of file +var _0x5f7b=['accountcode','context','uniqueid','exten','answertime','endtime','abandoned','lastapplication','duration','billableseconds','holdtime','type','tag','disposition','monitor','queue','transferconnectedlinenum','transferType','starttime','channel','calleridnum','calleridname','connectedlinenum','connectedlinename'];(function(_0x1f6065,_0x43f318){var _0x4358c2=function(_0x328dca){while(--_0x328dca){_0x1f6065['push'](_0x1f6065['shift']());}};_0x4358c2(++_0x43f318);}(_0x5f7b,0x14a));var _0xb5f7=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0x5f7b[_0x4fbfd9];return _0x31dc94;};'use strict';function Channel(){this[_0xb5f7('0x0')]=null;this[_0xb5f7('0x1')]='';this['destinationchannel']='';this[_0xb5f7('0x2')]=0x0;this[_0xb5f7('0x3')]='';this[_0xb5f7('0x4')]=undefined;this[_0xb5f7('0x5')]=undefined;this[_0xb5f7('0x6')]=0x0;this[_0xb5f7('0x7')]='';this[_0xb5f7('0x8')]=0x0;this['linkedid']=0x0;this[_0xb5f7('0x9')]=0x0;this['answered']=![];this[_0xb5f7('0xa')]=null;this[_0xb5f7('0xb')]=null;this['unmanaged']=![];this[_0xb5f7('0xc')]=![];this[_0xb5f7('0xd')]='';this['lastdata']='';this[_0xb5f7('0xe')]=0x0;this[_0xb5f7('0xf')]=0x0;this[_0xb5f7('0x10')]=0x0;this[_0xb5f7('0x11')]=null;this[_0xb5f7('0x12')]=null;this[_0xb5f7('0x13')]=null;this[_0xb5f7('0x14')]=![];this['monitorFilename']=null;this[_0xb5f7('0x15')]=null;this['monitors']=[];this['transfercalleridnum']=undefined;this[_0xb5f7('0x16')]=undefined;this[_0xb5f7('0x17')]=undefined;this['mohtime']=0x0;}module['exports']=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 7852634..ea7c261 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 _0x5af7=['token','tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret'];(function(_0x4962d8,_0x5831a1){var _0x59aad4=function(_0x8a113){while(--_0x8a113){_0x4962d8['push'](_0x4962d8['shift']());}};_0x59aad4(++_0x5831a1);}(_0x5af7,0xc9));var _0x75af=function(_0xa388a2,_0x40bde6){_0xa388a2=_0xa388a2-0x0;var _0x7ce7f6=_0x5af7[_0xa388a2];return _0x7ce7f6;};'use strict';function DeskAccount(_0x5c0e8f){this['id']=_0x5c0e8f['id']||0x0;this[_0x75af('0x0')]=_0x5c0e8f[_0x75af('0x0')]||'';this['username']=_0x5c0e8f[_0x75af('0x1')]||'';this[_0x75af('0x2')]=_0x5c0e8f[_0x75af('0x2')]||'';this[_0x75af('0x3')]=_0x5c0e8f[_0x75af('0x3')]||'';this[_0x75af('0x4')]=_0x5c0e8f[_0x75af('0x4')]||'';this[_0x75af('0x5')]=_0x5c0e8f[_0x75af('0x5')]||'';this[_0x75af('0x6')]=_0x5c0e8f[_0x75af('0x6')]||'';this['token']=_0x5c0e8f[_0x75af('0x7')]||'';this[_0x75af('0x8')]=_0x5c0e8f['tokenSecret']||'';this[_0x75af('0x9')]=_0x5c0e8f[_0x75af('0x9')]||'';this[_0x75af('0xa')]=_0x5c0e8f[_0x75af('0xa')]||'';this[_0x75af('0xb')]=_0x5c0e8f[_0x75af('0xb')]||{};}module[_0x75af('0xc')]=DeskAccount; \ No newline at end of file +var _0x42fb=['Configurations','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret','tokenSecret','type','serverUrl'];(function(_0x5cf5d5,_0x428b05){var _0x24d043=function(_0x496b3d){while(--_0x496b3d){_0x5cf5d5['push'](_0x5cf5d5['shift']());}};_0x24d043(++_0x428b05);}(_0x42fb,0x116));var _0xb42f=function(_0x2e78db,_0x5ab8a1){_0x2e78db=_0x2e78db-0x0;var _0x195fb4=_0x42fb[_0x2e78db];return _0x195fb4;};'use strict';function DeskAccount(_0x5e9e96){this['id']=_0x5e9e96['id']||0x0;this[_0xb42f('0x0')]=_0x5e9e96[_0xb42f('0x0')]||'';this[_0xb42f('0x1')]=_0x5e9e96[_0xb42f('0x1')]||'';this[_0xb42f('0x2')]=_0x5e9e96['remoteUri']||'';this[_0xb42f('0x3')]=_0x5e9e96[_0xb42f('0x3')]||'';this[_0xb42f('0x4')]=_0x5e9e96[_0xb42f('0x4')]||'';this[_0xb42f('0x5')]=_0x5e9e96[_0xb42f('0x5')]||'';this[_0xb42f('0x6')]=_0x5e9e96['consumerSecret']||'';this['token']=_0x5e9e96['token']||'';this[_0xb42f('0x7')]=_0x5e9e96[_0xb42f('0x7')]||'';this['type']=_0x5e9e96[_0xb42f('0x8')]||'';this[_0xb42f('0x9')]=_0x5e9e96[_0xb42f('0x9')]||'';this[_0xb42f('0xa')]=_0x5e9e96[_0xb42f('0xa')]||{};}module[_0xb42f('0xb')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index 104cc1d..d8e660e 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 _0x6ad7=['name','username','password','remoteUri','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','exports'];(function(_0x2987ea,_0x3374f1){var _0xcb7a59=function(_0xc123a5){while(--_0xc123a5){_0x2987ea['push'](_0x2987ea['shift']());}};_0xcb7a59(++_0x3374f1);}(_0x6ad7,0x1b8));var _0x76ad=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6ad7[_0x3dd15e];return _0x231fd0;};'use strict';function Dynamics365Account(_0x3b9f55){this['id']=_0x3b9f55['id']||0x0;this[_0x76ad('0x0')]=_0x3b9f55[_0x76ad('0x0')]||'';this[_0x76ad('0x1')]=_0x3b9f55[_0x76ad('0x1')]||'';this[_0x76ad('0x2')]=_0x3b9f55[_0x76ad('0x2')]||'';this[_0x76ad('0x3')]=_0x3b9f55[_0x76ad('0x3')]||'';this['tenantId']=_0x3b9f55['tenantId']||'';this[_0x76ad('0x4')]=_0x3b9f55['clientId']||'';this['clientSecret']=_0x3b9f55[_0x76ad('0x5')]||{};this[_0x76ad('0x6')]=_0x3b9f55['serverUrl']||'';this[_0x76ad('0x7')]=_0x3b9f55[_0x76ad('0x7')]||![];this[_0x76ad('0x8')]=_0x3b9f55[_0x76ad('0x8')]||{};this[_0x76ad('0x9')]=_0x3b9f55['CloudProvider']||{};}module[_0x76ad('0xa')]=Dynamics365Account; \ No newline at end of file +var _0xbe3d=['username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','exports','name'];(function(_0xdb029f,_0x5f5490){var _0x2ce57d=function(_0x1857db){while(--_0x1857db){_0xdb029f['push'](_0xdb029f['shift']());}};_0x2ce57d(++_0x5f5490);}(_0xbe3d,0xbf));var _0xdbe3=function(_0x1b5c2a,_0x34789e){_0x1b5c2a=_0x1b5c2a-0x0;var _0x16c08a=_0xbe3d[_0x1b5c2a];return _0x16c08a;};'use strict';function Dynamics365Account(_0x4e67bb){this['id']=_0x4e67bb['id']||0x0;this['name']=_0x4e67bb[_0xdbe3('0x0')]||'';this[_0xdbe3('0x1')]=_0x4e67bb[_0xdbe3('0x1')]||'';this[_0xdbe3('0x2')]=_0x4e67bb[_0xdbe3('0x2')]||'';this[_0xdbe3('0x3')]=_0x4e67bb[_0xdbe3('0x3')]||'';this[_0xdbe3('0x4')]=_0x4e67bb[_0xdbe3('0x4')]||'';this[_0xdbe3('0x5')]=_0x4e67bb[_0xdbe3('0x5')]||'';this['clientSecret']=_0x4e67bb[_0xdbe3('0x6')]||{};this[_0xdbe3('0x7')]=_0x4e67bb['serverUrl']||'';this[_0xdbe3('0x8')]=_0x4e67bb[_0xdbe3('0x8')]||![];this[_0xdbe3('0x9')]=_0x4e67bb[_0xdbe3('0x9')]||{};this[_0xdbe3('0xa')]=_0x4e67bb[_0xdbe3('0xa')]||{};}module[_0xdbe3('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 3f79db9..da539f4 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 _0xa5fe=['t38timeout','tech','Trunk','ListId','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','v17,v27,v29','faxdetect'];(function(_0x41ba2c,_0xffc9c8){var _0x575bba=function(_0x230e65){while(--_0x230e65){_0x41ba2c['push'](_0x41ba2c['shift']());}};_0x575bba(++_0xffc9c8);}(_0xa5fe,0x163));var _0xea5f=function(_0x230e39,_0x5341){_0x230e39=_0x230e39-0x0;var _0xa804e=_0xa5fe[_0x230e39];return _0xa804e;};'use strict';function FaxAccount(_0x4fbc47){this['id']=_0x4fbc47['id']||0x0;this[_0xea5f('0x0')]=_0x4fbc47[_0xea5f('0x0')]||'';this[_0xea5f('0x1')]=_0x4fbc47['description'];this['ecm']=_0x4fbc47[_0xea5f('0x2')];this[_0xea5f('0x3')]=_0x4fbc47['headerinfo'];this[_0xea5f('0x4')]=_0x4fbc47[_0xea5f('0x4')];this[_0xea5f('0x5')]=_0x4fbc47[_0xea5f('0x5')]||0x960;this['maxrate']=_0x4fbc47[_0xea5f('0x6')]||0x3840;this['modem']=_0x4fbc47['modem']||_0xea5f('0x7');this['gateway']=_0x4fbc47['gateway']||'no';this['faxdetect']=_0x4fbc47[_0xea5f('0x8')]||'no';this[_0xea5f('0x9')]=_0x4fbc47[_0xea5f('0x9')]||0x1388;this[_0xea5f('0xa')]=_0x4fbc47[_0xea5f('0xa')]||'SIP';this[_0xea5f('0xb')]=_0x4fbc47[_0xea5f('0xb')]?_0x4fbc47[_0xea5f('0xb')]:undefined;this[_0xea5f('0xc')]=_0x4fbc47[_0xea5f('0xc')];this['key']=_0x4fbc47['key'];}module[_0xea5f('0xd')]=FaxAccount; \ No newline at end of file +var _0xfba8=['exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0xfba8,0xcd));var _0x8fba=function(_0xfd685,_0x380fc5){_0xfd685=_0xfd685-0x0;var _0x21f51f=_0xfba8[_0xfd685];return _0x21f51f;};'use strict';function FaxAccount(_0x38f4ac){this['id']=_0x38f4ac['id']||0x0;this[_0x8fba('0x0')]=_0x38f4ac['name']||'';this[_0x8fba('0x1')]=_0x38f4ac[_0x8fba('0x1')];this[_0x8fba('0x2')]=_0x38f4ac[_0x8fba('0x2')];this['headerinfo']=_0x38f4ac[_0x8fba('0x3')];this[_0x8fba('0x4')]=_0x38f4ac[_0x8fba('0x4')];this[_0x8fba('0x5')]=_0x38f4ac[_0x8fba('0x5')]||0x960;this['maxrate']=_0x38f4ac[_0x8fba('0x6')]||0x3840;this[_0x8fba('0x7')]=_0x38f4ac[_0x8fba('0x7')]||'v17,v27,v29';this[_0x8fba('0x8')]=_0x38f4ac[_0x8fba('0x8')]||'no';this[_0x8fba('0x9')]=_0x38f4ac[_0x8fba('0x9')]||'no';this[_0x8fba('0xa')]=_0x38f4ac['t38timeout']||0x1388;this[_0x8fba('0xb')]=_0x38f4ac[_0x8fba('0xb')]||_0x8fba('0xc');this[_0x8fba('0xd')]=_0x38f4ac['Trunk']?_0x38f4ac[_0x8fba('0xd')]:undefined;this['ListId']=_0x38f4ac[_0x8fba('0xe')];this['key']=_0x38f4ac[_0x8fba('0xf')];}module[_0x8fba('0x10')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index e8abf26..6ef2129 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 _0x75a9=['token','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x4fc70f,_0x37dcdc){var _0x3ea2fe=function(_0x27e793){while(--_0x27e793){_0x4fc70f['push'](_0x4fc70f['shift']());}};_0x3ea2fe(++_0x37dcdc);}(_0x75a9,0x194));var _0x975a=function(_0x2a3f63,_0x25d80c){_0x2a3f63=_0x2a3f63-0x0;var _0x4b32eb=_0x75a9[_0x2a3f63];return _0x4b32eb;};'use strict';function FreshdeskAccount(_0x43de71){this['id']=_0x43de71['id']||0x0;this['name']=_0x43de71[_0x975a('0x0')]||'';this[_0x975a('0x1')]=_0x43de71[_0x975a('0x1')]||'';this['apiKey']=_0x43de71[_0x975a('0x2')]||'';this[_0x975a('0x3')]=_0x43de71[_0x975a('0x3')]||'';this[_0x975a('0x4')]=_0x43de71[_0x975a('0x4')]||'';this[_0x975a('0x5')]=_0x43de71[_0x975a('0x5')]||{};}module[_0x975a('0x6')]=FreshdeskAccount; \ No newline at end of file +var _0xf3b0=['Configurations','exports','name','username','apiKey','remoteUri','serverUrl'];(function(_0x5321ab,_0x3efaca){var _0x3991ad=function(_0x5d9e0a){while(--_0x5d9e0a){_0x5321ab['push'](_0x5321ab['shift']());}};_0x3991ad(++_0x3efaca);}(_0xf3b0,0x18a));var _0x0f3b=function(_0xb8cfbe,_0x2e81b6){_0xb8cfbe=_0xb8cfbe-0x0;var _0x227d51=_0xf3b0[_0xb8cfbe];return _0x227d51;};'use strict';function FreshdeskAccount(_0x4b5f0d){this['id']=_0x4b5f0d['id']||0x0;this[_0x0f3b('0x0')]=_0x4b5f0d[_0x0f3b('0x0')]||'';this['username']=_0x4b5f0d[_0x0f3b('0x1')]||'';this[_0x0f3b('0x2')]=_0x4b5f0d['token']||'';this['remoteUri']=_0x4b5f0d[_0x0f3b('0x3')]||'';this[_0x0f3b('0x4')]=_0x4b5f0d[_0x0f3b('0x4')]||'';this['Configurations']=_0x4b5f0d[_0x0f3b('0x5')]||{};}module[_0x0f3b('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 d07bf1e..b9973e1 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 _0xdded=['name','username','apiKey','remoteUri','serverUrl','Configurations','exports'];(function(_0x38e146,_0x2714e7){var _0x3531cc=function(_0x11314e){while(--_0x11314e){_0x38e146['push'](_0x38e146['shift']());}};_0x3531cc(++_0x2714e7);}(_0xdded,0x17a));var _0xddde=function(_0x370c1c,_0x4e01d6){_0x370c1c=_0x370c1c-0x0;var _0x4d4010=_0xdded[_0x370c1c];return _0x4d4010;};'use strict';function FreshsalesAccount(_0x2b234e){this['id']=_0x2b234e['id']||0x0;this[_0xddde('0x0')]=_0x2b234e[_0xddde('0x0')]||'';this[_0xddde('0x1')]=_0x2b234e[_0xddde('0x1')]||'';this[_0xddde('0x2')]=_0x2b234e['token']||'';this[_0xddde('0x3')]=_0x2b234e[_0xddde('0x3')]||'';this[_0xddde('0x4')]=_0x2b234e[_0xddde('0x4')]||'';this[_0xddde('0x5')]=_0x2b234e[_0xddde('0x5')]||{};}module[_0xddde('0x6')]=FreshsalesAccount; \ No newline at end of file +var _0x83d0=['exports','name','username','apiKey','remoteUri','serverUrl','Configurations'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0x83d0,0xb7));var _0x083d=function(_0x3700b8,_0x4ff1d7){_0x3700b8=_0x3700b8-0x0;var _0x582af3=_0x83d0[_0x3700b8];return _0x582af3;};'use strict';function FreshsalesAccount(_0x351db6){this['id']=_0x351db6['id']||0x0;this[_0x083d('0x0')]=_0x351db6[_0x083d('0x0')]||'';this[_0x083d('0x1')]=_0x351db6[_0x083d('0x1')]||'';this[_0x083d('0x2')]=_0x351db6['token']||'';this[_0x083d('0x3')]=_0x351db6['remoteUri']||'';this['serverUrl']=_0x351db6[_0x083d('0x4')]||'';this[_0x083d('0x5')]=_0x351db6[_0x083d('0x5')]||{};}module[_0x083d('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 b4fc7c0..f7b0384 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 _0xb21d=['variables','exports','type','inbound','uniqueid','calleridnum','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','originalposition','channel','connectedlinenum','connectedlinename','context','exten','assigned','lastAssignedTo','motionChannel','voice','routealias','mohtime'];(function(_0x10004e,_0xd701e6){var _0x5af990=function(_0x4bab6a){while(--_0x4bab6a){_0x10004e['push'](_0x10004e['shift']());}};_0x5af990(++_0xd701e6);}(_0xb21d,0x1a2));var _0xdb21=function(_0x2086e4,_0x772cdc){_0x2086e4=_0x2086e4-0x0;var _0x8dd667=_0xb21d[_0x2086e4];return _0x8dd667;};'use strict';function QueueReport(){this[_0xdb21('0x0')]=_0xdb21('0x1');this[_0xdb21('0x2')]='';this[_0xdb21('0x3')]='';this['calleridname']='';this['queue']='';this[_0xdb21('0x4')]=null;this[_0xdb21('0x5')]=null;this[_0xdb21('0x6')]=0x1;this[_0xdb21('0x7')]=0x1;this[_0xdb21('0x8')]=![];this[_0xdb21('0x9')]=null;this[_0xdb21('0xa')]=![];this[_0xdb21('0xb')]=null;this['queuecallerexit']=![];this['queuecallerexitAt']=null;this[_0xdb21('0xc')]=0x1;this[_0xdb21('0xd')]='';this[_0xdb21('0xe')]='';this[_0xdb21('0xf')]='';this['accountcode']='';this[_0xdb21('0x10')]='';this[_0xdb21('0x11')]='';this['priority']='';this['holdtime']=0x0;this[_0xdb21('0x12')]=![];this[_0xdb21('0x13')]='';this[_0xdb21('0x14')]=_0xdb21('0x15');this[_0xdb21('0x16')]=null;this[_0xdb21('0x17')]=0x0;this[_0xdb21('0x18')]={};}module[_0xdb21('0x19')]=QueueReport; \ No newline at end of file +var _0xddd8=['mohtime','exports','type','inbound','uniqueid','calleridnum','queue','queuecallerjoinAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercompleteAt','queuecallerexitAt','channel','connectedlinenum','connectedlinename','accountcode','exten','priority','holdtime','assigned','lastAssignedTo','motionChannel','voice'];(function(_0x313b1a,_0x4555b3){var _0x22b208=function(_0x39783d){while(--_0x39783d){_0x313b1a['push'](_0x313b1a['shift']());}};_0x22b208(++_0x4555b3);}(_0xddd8,0xb1));var _0x8ddd=function(_0xc3b484,_0x490111){_0xc3b484=_0xc3b484-0x0;var _0x4b4c0c=_0xddd8[_0xc3b484];return _0x4b4c0c;};'use strict';function QueueReport(){this[_0x8ddd('0x0')]=_0x8ddd('0x1');this[_0x8ddd('0x2')]='';this[_0x8ddd('0x3')]='';this['calleridname']='';this[_0x8ddd('0x4')]='';this[_0x8ddd('0x5')]=null;this['queuecallerleaveAt']=null;this[_0x8ddd('0x6')]=0x1;this[_0x8ddd('0x7')]=0x1;this[_0x8ddd('0x8')]=![];this[_0x8ddd('0x9')]=null;this['queuecallercomplete']=![];this[_0x8ddd('0xa')]=null;this['queuecallerexit']=![];this[_0x8ddd('0xb')]=null;this['originalposition']=0x1;this[_0x8ddd('0xc')]='';this[_0x8ddd('0xd')]='';this[_0x8ddd('0xe')]='';this[_0x8ddd('0xf')]='';this['context']='';this[_0x8ddd('0x10')]='';this[_0x8ddd('0x11')]='';this[_0x8ddd('0x12')]=0x0;this[_0x8ddd('0x13')]=![];this[_0x8ddd('0x14')]='';this[_0x8ddd('0x15')]=_0x8ddd('0x16');this['routealias']=null;this[_0x8ddd('0x17')]=0x0;this['variables']={};}module[_0x8ddd('0x18')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index c44ace7..23dc3b8 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 _0x18b2=['exports','name','username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x18b2,0x85));var _0x218b=function(_0x400168,_0x7b7476){_0x400168=_0x400168-0x0;var _0x16e758=_0x18b2[_0x400168];return _0x16e758;};'use strict';function SalesforceAccount(_0x423d46){this['id']=_0x423d46['id']||0x0;this[_0x218b('0x0')]=_0x423d46[_0x218b('0x0')]||'';this[_0x218b('0x1')]=_0x423d46['username']||'';this[_0x218b('0x2')]=_0x423d46[_0x218b('0x2')]||'';this[_0x218b('0x3')]=_0x423d46[_0x218b('0x3')]||'';this[_0x218b('0x4')]=_0x423d46[_0x218b('0x4')]||'';this[_0x218b('0x5')]=_0x423d46[_0x218b('0x5')]||'';this[_0x218b('0x6')]=_0x423d46[_0x218b('0x6')]||'';this[_0x218b('0x7')]=_0x423d46[_0x218b('0x7')]||_0x218b('0x8');this[_0x218b('0x9')]=_0x423d46[_0x218b('0x9')]||'';this['Configurations']=_0x423d46[_0x218b('0xa')]||{};}module[_0x218b('0xb')]=SalesforceAccount; \ No newline at end of file +var _0x1bde=['username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports','name'];(function(_0x11dc39,_0x491115){var _0x457277=function(_0x1d77cd){while(--_0x1d77cd){_0x11dc39['push'](_0x11dc39['shift']());}};_0x457277(++_0x491115);}(_0x1bde,0xe3));var _0xe1bd=function(_0x3ecf0c,_0x5044a3){_0x3ecf0c=_0x3ecf0c-0x0;var _0x1a682b=_0x1bde[_0x3ecf0c];return _0x1a682b;};'use strict';function SalesforceAccount(_0x2a86cf){this['id']=_0x2a86cf['id']||0x0;this[_0xe1bd('0x0')]=_0x2a86cf[_0xe1bd('0x0')]||'';this[_0xe1bd('0x1')]=_0x2a86cf['username']||'';this['remoteUri']=_0x2a86cf[_0xe1bd('0x2')]||'';this[_0xe1bd('0x3')]=_0x2a86cf[_0xe1bd('0x3')]||'';this[_0xe1bd('0x4')]=_0x2a86cf['clientId']||'';this[_0xe1bd('0x5')]=_0x2a86cf[_0xe1bd('0x5')]||'';this[_0xe1bd('0x6')]=_0x2a86cf[_0xe1bd('0x6')]||'';this[_0xe1bd('0x7')]=_0x2a86cf[_0xe1bd('0x7')]||_0xe1bd('0x8');this['serverUrl']=_0x2a86cf[_0xe1bd('0x9')]||'';this['Configurations']=_0x2a86cf[_0xe1bd('0xa')]||{};}module[_0xe1bd('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 2d66ba4..d704153 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 _0x3d19=['password','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x26d018,_0xedb83d){var _0x296c00=function(_0x1471d2){while(--_0x1471d2){_0x26d018['push'](_0x26d018['shift']());}};_0x296c00(++_0xedb83d);}(_0x3d19,0xbb));var _0x93d1=function(_0x494d1f,_0x3f72ff){_0x494d1f=_0x494d1f-0x0;var _0x457b6e=_0x3d19[_0x494d1f];return _0x457b6e;};'use strict';function ServicenowAccount(_0x294f33){this['id']=_0x294f33['id']||0x0;this[_0x93d1('0x0')]=_0x294f33['name']||'';this[_0x93d1('0x1')]=_0x294f33[_0x93d1('0x1')]||'';this['password']=_0x294f33[_0x93d1('0x2')]||'';this['remoteUri']=_0x294f33[_0x93d1('0x3')]||'';this[_0x93d1('0x4')]=_0x294f33[_0x93d1('0x4')]||'';this[_0x93d1('0x5')]=_0x294f33['Configurations']||{};}module[_0x93d1('0x6')]=ServicenowAccount; \ No newline at end of file +var _0x8af8=['Configurations','exports','name','username','password','remoteUri','serverUrl'];(function(_0x4df671,_0x12b67f){var _0x3f9658=function(_0x26151d){while(--_0x26151d){_0x4df671['push'](_0x4df671['shift']());}};_0x3f9658(++_0x12b67f);}(_0x8af8,0xbf));var _0x88af=function(_0x4f0e5f,_0x3ded65){_0x4f0e5f=_0x4f0e5f-0x0;var _0x315d44=_0x8af8[_0x4f0e5f];return _0x315d44;};'use strict';function ServicenowAccount(_0x5e37b0){this['id']=_0x5e37b0['id']||0x0;this[_0x88af('0x0')]=_0x5e37b0[_0x88af('0x0')]||'';this[_0x88af('0x1')]=_0x5e37b0[_0x88af('0x1')]||'';this[_0x88af('0x2')]=_0x5e37b0[_0x88af('0x2')]||'';this[_0x88af('0x3')]=_0x5e37b0[_0x88af('0x3')]||'';this[_0x88af('0x4')]=_0x5e37b0[_0x88af('0x4')]||'';this[_0x88af('0x5')]=_0x5e37b0['Configurations']||{};}module[_0x88af('0x6')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index 9e74842..c67aa35 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 _0x35f7=['password','remoteUri','serverUrl','Configurations','name','username'];(function(_0x23386e,_0x881a85){var _0x5a03a7=function(_0x5d8073){while(--_0x5d8073){_0x23386e['push'](_0x23386e['shift']());}};_0x5a03a7(++_0x881a85);}(_0x35f7,0x88));var _0x735f=function(_0x5ac827,_0x40bdb3){_0x5ac827=_0x5ac827-0x0;var _0x3408fd=_0x35f7[_0x5ac827];return _0x3408fd;};'use strict';function SugarcrmAccount(_0x95f7c7){this['id']=_0x95f7c7['id']||0x0;this[_0x735f('0x0')]=_0x95f7c7[_0x735f('0x0')]||'';this[_0x735f('0x1')]=_0x95f7c7[_0x735f('0x1')]||'';this[_0x735f('0x2')]=_0x95f7c7['password']||'';this[_0x735f('0x3')]=_0x95f7c7[_0x735f('0x3')]||'';this['serverUrl']=_0x95f7c7[_0x735f('0x4')]||'';this[_0x735f('0x5')]=_0x95f7c7[_0x735f('0x5')]||{};}module['exports']=SugarcrmAccount; \ No newline at end of file +var _0x84e6=['username','password','serverUrl','Configurations','exports','name'];(function(_0x2cd7f7,_0x413e28){var _0x4adbcd=function(_0x53e44f){while(--_0x53e44f){_0x2cd7f7['push'](_0x2cd7f7['shift']());}};_0x4adbcd(++_0x413e28);}(_0x84e6,0x8f));var _0x684e=function(_0x4186a6,_0x33785c){_0x4186a6=_0x4186a6-0x0;var _0x4b29c6=_0x84e6[_0x4186a6];return _0x4b29c6;};'use strict';function SugarcrmAccount(_0x104d34){this['id']=_0x104d34['id']||0x0;this[_0x684e('0x0')]=_0x104d34[_0x684e('0x0')]||'';this[_0x684e('0x1')]=_0x104d34['username']||'';this['password']=_0x104d34[_0x684e('0x2')]||'';this['remoteUri']=_0x104d34['remoteUri']||'';this[_0x684e('0x3')]=_0x104d34[_0x684e('0x3')]||'';this[_0x684e('0x4')]=_0x104d34['Configurations']||{};}module[_0x684e('0x5')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index f46f221..15382ec 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 _0x56dc=['exports','name','accountcode','state','unknown','status','address'];(function(_0x26d386,_0x1660c0){var _0x4ef9a8=function(_0x55e2d3){while(--_0x55e2d3){_0x26d386['push'](_0x26d386['shift']());}};_0x4ef9a8(++_0x1660c0);}(_0x56dc,0xfd));var _0xc56d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x56dc[_0x3dd15e];return _0x231fd0;};'use strict';function Telephone(_0x5a5e07){this['id']=_0x5a5e07['id']||0x0;this['name']=_0x5a5e07[_0xc56d('0x0')]||'';this[_0xc56d('0x1')]=_0x5a5e07[_0xc56d('0x1')]||'';this[_0xc56d('0x2')]=_0xc56d('0x3');this['stateTime']=0x0;this[_0xc56d('0x4')]=_0xc56d('0x3');this[_0xc56d('0x5')]='';}module[_0xc56d('0x6')]=Telephone; \ No newline at end of file +var _0x05e3=['state','unknown','status','exports','name'];(function(_0x23cdd4,_0x859ecb){var _0x59cd04=function(_0xcdc529){while(--_0xcdc529){_0x23cdd4['push'](_0x23cdd4['shift']());}};_0x59cd04(++_0x859ecb);}(_0x05e3,0x86));var _0x305e=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0x05e3[_0x4ae6ef];return _0x3cbb4e;};'use strict';function Telephone(_0xffee6c){this['id']=_0xffee6c['id']||0x0;this[_0x305e('0x0')]=_0xffee6c[_0x305e('0x0')]||'';this['accountcode']=_0xffee6c['accountcode']||'';this[_0x305e('0x1')]=_0x305e('0x2');this['stateTime']=0x0;this[_0x305e('0x3')]=_0x305e('0x2');this['address']='';}module[_0x305e('0x4')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 1072ff0..eb62a2a 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(_0x5f5657,_0x3e8503){var _0x34cc6d=function(_0x42f153){while(--_0x42f153){_0x5f5657['push'](_0x5f5657['shift']());}};_0x34cc6d(++_0x3e8503);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'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(_0x35261e,_0x10037e){var _0x2044bf=function(_0x1566ec){while(--_0x1566ec){_0x35261e['push'](_0x35261e['shift']());}};_0x2044bf(++_0x10037e);}(_0xb10b,0x12a));var _0xbb10=function(_0x2d6d0f,_0x3cf2a5){_0x2d6d0f=_0x2d6d0f-0x0;var _0xd2bee6=_0xb10b[_0x2d6d0f];return _0xd2bee6;};'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 9e633ef..d33fc77 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 _0x14a0=['voice','status','AnyConditions','Actions','name','channel'];(function(_0x5412dc,_0x15b71a){var _0x2ad739=function(_0x41ec36){while(--_0x41ec36){_0x5412dc['push'](_0x5412dc['shift']());}};_0x2ad739(++_0x15b71a);}(_0x14a0,0x8e));var _0x014a=function(_0xe9275a,_0x290129){_0xe9275a=_0xe9275a-0x0;var _0x32f76b=_0x14a0[_0xe9275a];return _0x32f76b;};'use strict';function Trigger(_0x1ee939){this['id']=_0x1ee939['id']||0x0;this[_0x014a('0x0')]=_0x1ee939[_0x014a('0x0')]||'';this[_0x014a('0x1')]=_0x1ee939[_0x014a('0x1')]||_0x014a('0x2');this[_0x014a('0x3')]=_0x1ee939[_0x014a('0x3')]||![];this['AllConditions']=_0x1ee939['AllConditions']||[];this[_0x014a('0x4')]=_0x1ee939[_0x014a('0x4')]||[];this[_0x014a('0x5')]=_0x1ee939['Actions']||[];}module['exports']=Trigger; \ No newline at end of file +var _0xb7e7=['Actions','exports','name','channel','status','AllConditions','AnyConditions'];(function(_0xe6164f,_0x47e826){var _0x557c61=function(_0x303455){while(--_0x303455){_0xe6164f['push'](_0xe6164f['shift']());}};_0x557c61(++_0x47e826);}(_0xb7e7,0x121));var _0x7b7e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xb7e7[_0x2b4411];return _0x8e41ef;};'use strict';function Trigger(_0x2e5e07){this['id']=_0x2e5e07['id']||0x0;this['name']=_0x2e5e07[_0x7b7e('0x0')]||'';this['channel']=_0x2e5e07[_0x7b7e('0x1')]||'voice';this[_0x7b7e('0x2')]=_0x2e5e07['status']||![];this[_0x7b7e('0x3')]=_0x2e5e07[_0x7b7e('0x3')]||[];this[_0x7b7e('0x4')]=_0x2e5e07['AnyConditions']||[];this['Actions']=_0x2e5e07[_0x7b7e('0x5')]||[];}module[_0x7b7e('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 8228e55..8ba30c8 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 _0x45b3=['state','unknown','stateTime','status','registry','indexOf','split','host','port','domain','refresh','address','defaultuser','exports','active','name'];(function(_0x39af60,_0x26efba){var _0x58e386=function(_0x4bca7f){while(--_0x4bca7f){_0x39af60['push'](_0x39af60['shift']());}};_0x58e386(++_0x26efba);}(_0x45b3,0x15e));var _0x345b=function(_0x526580,_0xa9a3d7){_0x526580=_0x526580-0x0;var _0x165f87=_0x45b3[_0x526580];return _0x165f87;};'use strict';function Trunk(_0x17ea91){this['id']=_0x17ea91['id']||0x0;this['active']=_0x17ea91[_0x345b('0x0')]||![];this[_0x345b('0x1')]=_0x17ea91[_0x345b('0x1')]||'';this[_0x345b('0x2')]=_0x345b('0x3');this[_0x345b('0x4')]=0x0;this[_0x345b('0x5')]=_0x345b('0x3');this[_0x345b('0x6')]=_0x17ea91[_0x345b('0x6')]&&_0x17ea91[_0x345b('0x6')][_0x345b('0x7')](':')?_0x17ea91[_0x345b('0x6')][_0x345b('0x8')](':')[0x0]:'';this[_0x345b('0x9')]='';this[_0x345b('0xa')]='';this[_0x345b('0xb')]='';this['domainport']='';this[_0x345b('0xc')]='';this['stateRegistry']=_0x345b('0x3');this['registrationtime']='';this[_0x345b('0xd')]='';this[_0x345b('0xe')]=_0x17ea91[_0x345b('0xe')]||'';}module[_0x345b('0xf')]=Trunk; \ No newline at end of file +var _0xc751=['refresh','stateRegistry','registrationtime','address','defaultuser','active','name','state','unknown','registry','indexOf','split','host'];(function(_0x4460e2,_0x30e31e){var _0x431ee3=function(_0xcd2b25){while(--_0xcd2b25){_0x4460e2['push'](_0x4460e2['shift']());}};_0x431ee3(++_0x30e31e);}(_0xc751,0xef));var _0x1c75=function(_0x5e8282,_0x1f2962){_0x5e8282=_0x5e8282-0x0;var _0x5cd37d=_0xc751[_0x5e8282];return _0x5cd37d;};'use strict';function Trunk(_0x57fb84){this['id']=_0x57fb84['id']||0x0;this[_0x1c75('0x0')]=_0x57fb84[_0x1c75('0x0')]||![];this['name']=_0x57fb84[_0x1c75('0x1')]||'';this[_0x1c75('0x2')]=_0x1c75('0x3');this['stateTime']=0x0;this['status']=_0x1c75('0x3');this[_0x1c75('0x4')]=_0x57fb84['registry']&&_0x57fb84[_0x1c75('0x4')][_0x1c75('0x5')](':')?_0x57fb84['registry'][_0x1c75('0x6')](':')[0x0]:'';this[_0x1c75('0x7')]='';this['port']='';this['domain']='';this['domainport']='';this[_0x1c75('0x8')]='';this[_0x1c75('0x9')]=_0x1c75('0x3');this[_0x1c75('0xa')]='';this[_0x1c75('0xb')]='';this['defaultuser']=_0x57fb84[_0x1c75('0xc')]||'';}module['exports']=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index f5d0350..a1e4e91 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 _0x1c84=['exports','exten','recordingFormat','mandatoryDisposition'];(function(_0x59c172,_0x24b6a3){var _0x57bada=function(_0x380ace){while(--_0x380ace){_0x59c172['push'](_0x59c172['shift']());}};_0x57bada(++_0x24b6a3);}(_0x1c84,0x1e9));var _0x41c8=function(_0x36f2b2,_0x4dea08){_0x36f2b2=_0x36f2b2-0x0;var _0x4a0f99=_0x1c84[_0x36f2b2];return _0x4a0f99;};'use strict';function voiceExtension(_0x421ade){this['id']=_0x421ade['id']||0x0;this[_0x41c8('0x0')]=_0x421ade[_0x41c8('0x0')]||'';this[_0x41c8('0x1')]=_0x421ade[_0x41c8('0x1')]||'none';this[_0x41c8('0x2')]=_0x421ade['mandatoryDisposition']||![];}module[_0x41c8('0x3')]=voiceExtension; \ No newline at end of file +var _0xd21e=['exten','recordingFormat','none','mandatoryDisposition','exports'];(function(_0x5cb094,_0x8661b7){var _0x19c8e3=function(_0x120713){while(--_0x120713){_0x5cb094['push'](_0x5cb094['shift']());}};_0x19c8e3(++_0x8661b7);}(_0xd21e,0x1a9));var _0xed21=function(_0x479464,_0x47e3ca){_0x479464=_0x479464-0x0;var _0x16005a=_0xd21e[_0x479464];return _0x16005a;};'use strict';function voiceExtension(_0x4f6c15){this['id']=_0x4f6c15['id']||0x0;this[_0xed21('0x0')]=_0x4f6c15[_0xed21('0x0')]||'';this[_0xed21('0x1')]=_0x4f6c15[_0xed21('0x1')]||_0xed21('0x2');this[_0xed21('0x3')]=_0x4f6c15['mandatoryDisposition']||![];}module[_0xed21('0x4')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index af8dd0d..50ef621 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 _0x4bc6=['dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','monitor_format','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','exports','wav49','gsm','leastrecent','random','ringall','roundrobin','rrmemory','rrordered','wrandom','name','type','inbound','waiting','answered','sumDuration','sumHoldTime','unmanaged','abandoned','busy','invalid','loggedIn','notInUse','ringing','ringInUse','talking','unavailable','acw','acwTimeout','autopause','sendMessageOneNotActive','message','statusMessage','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber'];(function(_0x3a891f,_0x455a71){var _0x333894=function(_0x151e31){while(--_0x151e31){_0x3a891f['push'](_0x3a891f['shift']());}};_0x333894(++_0x455a71);}(_0x4bc6,0xd0));var _0x64bc=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0x4bc6[_0x1da527];return _0x40fc7c;};'use strict';var monitorFormat={'wav':'wav','wav49':_0x64bc('0x0'),'gsm':_0x64bc('0x1')};var strategy={'fewestcalls':'fewestcalls','leastrecent':_0x64bc('0x2'),'linear':'linear','random':_0x64bc('0x3'),'ringall':_0x64bc('0x4'),'rr':_0x64bc('0x5'),'rrmemory':_0x64bc('0x6'),'rrordered':_0x64bc('0x7'),'wrandom':_0x64bc('0x8')};function VoiceQueue(_0x1e5c2b){this['id']=_0x1e5c2b['id']||0x0;this[_0x64bc('0x9')]=_0x1e5c2b[_0x64bc('0x9')]||'';this['monitor_format']=_0x1e5c2b['monitor_format']||'';this['type']=_0x1e5c2b[_0x64bc('0xa')]||_0x64bc('0xb');this[_0x64bc('0xc')]=0x0;this['total']=0x0;this[_0x64bc('0xd')]=0x0;this[_0x64bc('0xe')]=0x0;this[_0x64bc('0xf')]=0x0;this['sumBillable']=0x0;this[_0x64bc('0x10')]=0x0;this[_0x64bc('0x11')]=0x0;this['available']=0x0;this[_0x64bc('0x12')]=0x0;this['inUse']=0x0;this[_0x64bc('0x13')]=0x0;this[_0x64bc('0x14')]=0x0;this[_0x64bc('0x15')]=0x0;this['onHold']=0x0;this['paused']=0x0;this[_0x64bc('0x16')]=0x0;this[_0x64bc('0x17')]=0x0;this[_0x64bc('0x18')]=0x0;this[_0x64bc('0x19')]=0x0;this['unknown']=0x0;this['acw']=_0x1e5c2b[_0x64bc('0x1a')]||![];this[_0x64bc('0x1b')]=_0x1e5c2b[_0x64bc('0x1b')]||0xa;this[_0x64bc('0x1c')]=_0x1e5c2b[_0x64bc('0x1c')]||'no';this[_0x64bc('0x1d')]=!![];this[_0x64bc('0x1e')]='';this[_0x64bc('0x1f')]='';this['originated']=0x0;this['temp']=0x0;this[_0x64bc('0x20')]=_0x1e5c2b[_0x64bc('0x20')]||null;this[_0x64bc('0x21')]=_0x1e5c2b[_0x64bc('0x21')]?_0x1e5c2b[_0x64bc('0x21')]:null;this[_0x64bc('0x22')]=_0x1e5c2b[_0x64bc('0x22')];this[_0x64bc('0x23')]=_0x1e5c2b['dialMethod']||_0x64bc('0x24');this[_0x64bc('0x25')]=_0x1e5c2b[_0x64bc('0x25')]||0x0;this[_0x64bc('0x26')]=_0x1e5c2b[_0x64bc('0x26')]||0x0;this[_0x64bc('0x27')]=_0x1e5c2b[_0x64bc('0x27')]||0x1;this[_0x64bc('0x28')]=_0x1e5c2b[_0x64bc('0x28')]||_0x64bc('0x29');this['dialPredictiveOptimizationPercentage']=_0x1e5c2b['dialPredictiveOptimizationPercentage']||0.03;this[_0x64bc('0x2a')]=_0x1e5c2b['dialPredictiveInterval']||0x258;this[_0x64bc('0x2b')]=_0x1e5c2b[_0x64bc('0x2b')]||_0x64bc('0x2c');this[_0x64bc('0x2d')]=_0x1e5c2b['dialOriginateCallerIdNumber']||_0x64bc('0x2c');this[_0x64bc('0x2e')]=_0x1e5c2b[_0x64bc('0x2e')]||0x1e;this[_0x64bc('0x2f')]=_0x1e5c2b[_0x64bc('0x2f')]||'tTxX';this[_0x64bc('0x30')]=_0x1e5c2b[_0x64bc('0x30')]||0x3;this['dialQueueProject']=_0x1e5c2b['dialQueueProject']||undefined;this[_0x64bc('0x31')]=_0x1e5c2b[_0x64bc('0x31')]||0x3;this['dialCongestionRetryFrequency']=_0x1e5c2b[_0x64bc('0x32')]||0x96;this[_0x64bc('0x33')]=_0x1e5c2b['dialBusyMaxRetry']||0x3;this[_0x64bc('0x34')]=_0x1e5c2b[_0x64bc('0x34')]||0x96;this[_0x64bc('0x35')]=_0x1e5c2b[_0x64bc('0x35')]||0x3;this['dialNoAnswerRetryFrequency']=_0x1e5c2b[_0x64bc('0x36')]||0x96;this[_0x64bc('0x37')]=_0x1e5c2b[_0x64bc('0x37')]||0x3;this[_0x64bc('0x38')]=_0x1e5c2b[_0x64bc('0x38')]||0x96;this[_0x64bc('0x39')]=_0x1e5c2b[_0x64bc('0x39')]||0x3;this[_0x64bc('0x3a')]=_0x1e5c2b[_0x64bc('0x3a')]||0x96;this['dialAbandonedMaxRetry']=_0x1e5c2b[_0x64bc('0x3b')]||0x3;this[_0x64bc('0x3c')]=_0x1e5c2b[_0x64bc('0x3c')]||0x96;this[_0x64bc('0x3d')]=_0x1e5c2b['dialMachineMaxRetry']||0x3;this['dialMachineRetryFrequency']=_0x1e5c2b[_0x64bc('0x3e')]||0x96;this[_0x64bc('0x3f')]=_0x1e5c2b[_0x64bc('0x3f')]||0x3;this[_0x64bc('0x40')]=_0x1e5c2b[_0x64bc('0x40')]||0x96;this[_0x64bc('0x41')]=_0x1e5c2b[_0x64bc('0x41')]||0x3;this[_0x64bc('0x42')]=_0x1e5c2b[_0x64bc('0x42')]||0x4;this[_0x64bc('0x43')]=_0x1e5c2b[_0x64bc('0x43')]?_0x1e5c2b[_0x64bc('0x43')]:undefined;this['TrunkBackup']=_0x1e5c2b[_0x64bc('0x44')]?_0x1e5c2b[_0x64bc('0x44')]:undefined;this['dialPrefix']=_0x1e5c2b[_0x64bc('0x45')]||undefined;this[_0x64bc('0x46')]=_0x1e5c2b[_0x64bc('0x46')]?_0x1e5c2b[_0x64bc('0x46')]:undefined;this[_0x64bc('0x47')]=_0x1e5c2b[_0x64bc('0x47')]||'DESC';this['dialRandomLastDigitCallerIdNumber']=_0x1e5c2b['dialRandomLastDigitCallerIdNumber']||undefined;this['dialCutDigit']=_0x1e5c2b[_0x64bc('0x48')]||undefined;this[_0x64bc('0x49')]=strategy[_0x1e5c2b['strategy']];this[_0x64bc('0x4a')]=!![];this[_0x64bc('0x4b')]=_0x1e5c2b[_0x64bc('0x4b')]||![];this[_0x64bc('0x4c')]=_0x1e5c2b[_0x64bc('0x4c')];this['dialAMDGreeting']=_0x1e5c2b[_0x64bc('0x4d')];this[_0x64bc('0x4e')]=_0x1e5c2b[_0x64bc('0x4e')];this[_0x64bc('0x4f')]=_0x1e5c2b[_0x64bc('0x4f')];this['dialAMDMinWordLength']=_0x1e5c2b[_0x64bc('0x50')];this[_0x64bc('0x51')]=_0x1e5c2b['dialAMDBetweenWordsSilence'];this[_0x64bc('0x52')]=_0x1e5c2b[_0x64bc('0x52')];this[_0x64bc('0x53')]=_0x1e5c2b[_0x64bc('0x53')];this['dialAMDMaximumWordLength']=_0x1e5c2b[_0x64bc('0x54')];this[_0x64bc('0x55')]=0x0;this[_0x64bc('0x56')]=0x0;this['timeout']=_0x1e5c2b[_0x64bc('0x57')];this[_0x64bc('0x58')]=0x0;this[_0x64bc('0x59')]=0x0;this[_0x64bc('0x5a')]=0x0;this['outboundBusyCallsDay']=0x0;this['outboundCongestionCallsDay']=0x0;this[_0x64bc('0x5b')]=0x0;this[_0x64bc('0x5c')]=0x0;this[_0x64bc('0x5d')]=0x0;this[_0x64bc('0x5e')]=0x0;this[_0x64bc('0x5f')]=0x0;this[_0x64bc('0x60')]=0x0;this['outboundDropCallsDayACS']=0x0;this['outboundReCallsDay']=0x0;this[_0x64bc('0x61')]=0x0;this[_0x64bc('0x62')]=undefined;this[_0x64bc('0x63')]=undefined;this[_0x64bc('0x64')]=undefined;this[_0x64bc('0x65')]=1.05;this[_0x64bc('0x66')]=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this[_0x64bc('0x67')]=0x0;this[_0x64bc('0x68')]=0x0;this[_0x64bc('0x69')]=0x0;this[_0x64bc('0x6a')]=0x0;this[_0x64bc('0x6b')]=0x0;this['predictiveIntervalAvailable']=0x0;this['predictiveIntervalMaxThreshold']=_0x1e5c2b[_0x64bc('0x6c')]||0x14;this['predictiveIntervalMinThreshold']=_0x1e5c2b['dialPredictiveIntervalMaxThreshold']||0xa;this[_0x64bc('0x6d')]=0x0;this[_0x64bc('0x6e')]=0x0;this['predictiveIntervalHitRate']=0x1;this[_0x64bc('0x6f')]=0x0;this[_0x64bc('0x70')]=0x0;this[_0x64bc('0x71')]=0x0;this[_0x64bc('0x72')]=0x0;this[_0x64bc('0x73')]=_0x1e5c2b['dialRecallMeTimeout']||0x1e;this[_0x64bc('0x74')]=_0x1e5c2b['dialRecallInQueue']||![];this[_0x64bc('0x75')]=!!_0x1e5c2b['dialPreviewAutoRecallMe']||![];this[_0x64bc('0x76')]=!!_0x1e5c2b[_0x64bc('0x76')]||![];this[_0x64bc('0x77')]=_0x1e5c2b[_0x64bc('0x77')]||undefined;this[_0x64bc('0x78')]=_0x1e5c2b['dialAgiAfterHangupClient']||![];this[_0x64bc('0x79')]=_0x1e5c2b['dialAgiAfterHangupAgent']||![];this[_0x64bc('0x7a')]=monitorFormat[_0x1e5c2b[_0x64bc('0x7a')]]?monitorFormat[_0x1e5c2b[_0x64bc('0x7a')]]:undefined;this[_0x64bc('0x7b')]=_0x1e5c2b['mandatoryDisposition']||![];this['mandatoryDispositionPause']=_0x1e5c2b[_0x64bc('0x7c')]?_0x1e5c2b[_0x64bc('0x7c')]:undefined;this[_0x64bc('0x7d')]=![];}module[_0x64bc('0x7e')]=VoiceQueue; \ No newline at end of file +var _0x326f=['dialOriginateCallerIdNumber','dialOriginateTimeout','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','exports','wav','fewestcalls','leastrecent','linear','random','ringall','roundrobin','rrmemory','rrordered','wrandom','name','monitor_format','type','total','answered','sumDuration','sumHoldTime','sumBillable','abandoned','busy','invalid','notInUse','onHold','ringing','ringInUse','talking','unavailable','acw','acwTimeout','autopause','sendMessageOneNotActive','message','statusMessage','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialLimitChannel','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveInterval','dialOriginateCallerIdName','anonymous'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x326f,0xd1));var _0xf326=function(_0x237671,_0x592f3e){_0x237671=_0x237671-0x0;var _0x42183b=_0x326f[_0x237671];return _0x42183b;};'use strict';var monitorFormat={'wav':_0xf326('0x0'),'wav49':'wav49','gsm':'gsm'};var strategy={'fewestcalls':_0xf326('0x1'),'leastrecent':_0xf326('0x2'),'linear':_0xf326('0x3'),'random':_0xf326('0x4'),'ringall':_0xf326('0x5'),'rr':_0xf326('0x6'),'rrmemory':_0xf326('0x7'),'rrordered':_0xf326('0x8'),'wrandom':_0xf326('0x9')};function VoiceQueue(_0x3ace29){this['id']=_0x3ace29['id']||0x0;this['name']=_0x3ace29[_0xf326('0xa')]||'';this[_0xf326('0xb')]=_0x3ace29[_0xf326('0xb')]||'';this[_0xf326('0xc')]=_0x3ace29['type']||'inbound';this['waiting']=0x0;this[_0xf326('0xd')]=0x0;this[_0xf326('0xe')]=0x0;this[_0xf326('0xf')]=0x0;this[_0xf326('0x10')]=0x0;this[_0xf326('0x11')]=0x0;this['unmanaged']=0x0;this[_0xf326('0x12')]=0x0;this['available']=0x0;this[_0xf326('0x13')]=0x0;this['inUse']=0x0;this[_0xf326('0x14')]=0x0;this['loggedIn']=0x0;this[_0xf326('0x15')]=0x0;this[_0xf326('0x16')]=0x0;this['paused']=0x0;this[_0xf326('0x17')]=0x0;this[_0xf326('0x18')]=0x0;this[_0xf326('0x19')]=0x0;this[_0xf326('0x1a')]=0x0;this['unknown']=0x0;this[_0xf326('0x1b')]=_0x3ace29['acw']||![];this['acwTimeout']=_0x3ace29[_0xf326('0x1c')]||0xa;this[_0xf326('0x1d')]=_0x3ace29[_0xf326('0x1d')]||'no';this[_0xf326('0x1e')]=!![];this[_0xf326('0x1f')]='';this[_0xf326('0x20')]='';this[_0xf326('0x21')]=0x0;this[_0xf326('0x22')]=0x0;this['dialTimezone']=_0x3ace29[_0xf326('0x23')]||null;this[_0xf326('0x24')]=_0x3ace29[_0xf326('0x24')]?_0x3ace29[_0xf326('0x24')]:null;this[_0xf326('0x25')]=_0x3ace29[_0xf326('0x25')];this['dialMethod']=_0x3ace29['dialMethod']||'progressive';this[_0xf326('0x26')]=_0x3ace29[_0xf326('0x26')]||0x0;this['dialLimitQueue']=_0x3ace29['dialLimitQueue']||0x0;this[_0xf326('0x27')]=_0x3ace29['dialPowerLevel']||0x1;this['dialPredictiveOptimization']=_0x3ace29[_0xf326('0x28')]||_0xf326('0x29');this['dialPredictiveOptimizationPercentage']=_0x3ace29['dialPredictiveOptimizationPercentage']||0.03;this[_0xf326('0x2a')]=_0x3ace29[_0xf326('0x2a')]||0x258;this['dialOriginateCallerIdName']=_0x3ace29[_0xf326('0x2b')]||_0xf326('0x2c');this[_0xf326('0x2d')]=_0x3ace29[_0xf326('0x2d')]||_0xf326('0x2c');this[_0xf326('0x2e')]=_0x3ace29['dialOriginateTimeout']||0x1e;this['dialQueueOptions']=_0x3ace29['dialQueueOptions']||_0xf326('0x2f');this[_0xf326('0x30')]=_0x3ace29[_0xf326('0x30')]||0x3;this[_0xf326('0x31')]=_0x3ace29[_0xf326('0x31')]||undefined;this[_0xf326('0x32')]=_0x3ace29['dialCongestionMaxRetry']||0x3;this[_0xf326('0x33')]=_0x3ace29[_0xf326('0x33')]||0x96;this[_0xf326('0x34')]=_0x3ace29['dialBusyMaxRetry']||0x3;this[_0xf326('0x35')]=_0x3ace29['dialBusyRetryFrequency']||0x96;this['dialNoAnswerMaxRetry']=_0x3ace29[_0xf326('0x36')]||0x3;this[_0xf326('0x37')]=_0x3ace29[_0xf326('0x37')]||0x96;this['dialNoSuchNumberMaxRetry']=_0x3ace29[_0xf326('0x38')]||0x3;this[_0xf326('0x39')]=_0x3ace29['dialNoSuchNumberRetryFrequency']||0x96;this[_0xf326('0x3a')]=_0x3ace29[_0xf326('0x3a')]||0x3;this[_0xf326('0x3b')]=_0x3ace29[_0xf326('0x3b')]||0x96;this[_0xf326('0x3c')]=_0x3ace29[_0xf326('0x3c')]||0x3;this[_0xf326('0x3d')]=_0x3ace29[_0xf326('0x3d')]||0x96;this[_0xf326('0x3e')]=_0x3ace29[_0xf326('0x3e')]||0x3;this['dialMachineRetryFrequency']=_0x3ace29[_0xf326('0x3f')]||0x96;this[_0xf326('0x40')]=_0x3ace29[_0xf326('0x40')]||0x3;this['dialAgentRejectRetryFrequency']=_0x3ace29[_0xf326('0x41')]||0x96;this[_0xf326('0x42')]=_0x3ace29[_0xf326('0x42')]||0x3;this['dialGlobalMaxRetry']=_0x3ace29['dialGlobalMaxRetry']||0x4;this[_0xf326('0x43')]=_0x3ace29[_0xf326('0x43')]?_0x3ace29[_0xf326('0x43')]:undefined;this[_0xf326('0x44')]=_0x3ace29[_0xf326('0x44')]?_0x3ace29[_0xf326('0x44')]:undefined;this[_0xf326('0x45')]=_0x3ace29[_0xf326('0x45')]||undefined;this['Interval']=_0x3ace29[_0xf326('0x46')]?_0x3ace29[_0xf326('0x46')]:undefined;this['dialOrderByScheduledAt']=_0x3ace29[_0xf326('0x47')]||'DESC';this[_0xf326('0x48')]=_0x3ace29['dialRandomLastDigitCallerIdNumber']||undefined;this['dialCutDigit']=_0x3ace29[_0xf326('0x49')]||undefined;this['strategy']=strategy[_0x3ace29[_0xf326('0x4a')]];this['queueStatusComplete']=!![];this[_0xf326('0x4b')]=_0x3ace29[_0xf326('0x4b')]||![];this[_0xf326('0x4c')]=_0x3ace29['dialAMDInitialSilence'];this[_0xf326('0x4d')]=_0x3ace29[_0xf326('0x4d')];this['dialAMDAfterGreetingSilence']=_0x3ace29[_0xf326('0x4e')];this[_0xf326('0x4f')]=_0x3ace29[_0xf326('0x4f')];this[_0xf326('0x50')]=_0x3ace29['dialAMDMinWordLength'];this[_0xf326('0x51')]=_0x3ace29[_0xf326('0x51')];this[_0xf326('0x52')]=_0x3ace29[_0xf326('0x52')];this[_0xf326('0x53')]=_0x3ace29['dialAMDSilenceThreshold'];this[_0xf326('0x54')]=_0x3ace29[_0xf326('0x54')];this['outboundRejectCallsDay']=0x0;this['pTalking']=0x0;this[_0xf326('0x55')]=_0x3ace29['timeout'];this['outboundAnswerCallsDay']=0x0;this[_0xf326('0x56')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0xf326('0x57')]=0x0;this[_0xf326('0x58')]=0x0;this[_0xf326('0x59')]=0x0;this[_0xf326('0x5a')]=0x0;this['outboundBlacklistCallsDay']=0x0;this[_0xf326('0x5b')]=0x0;this[_0xf326('0x5c')]=0x0;this[_0xf326('0x5d')]=0x0;this[_0xf326('0x5e')]=0x0;this[_0xf326('0x5f')]=0x0;this[_0xf326('0x60')]=0x0;this[_0xf326('0x61')]=undefined;this[_0xf326('0x62')]=undefined;this[_0xf326('0x63')]=undefined;this[_0xf326('0x64')]=1.05;this[_0xf326('0x65')]=0x0;this[_0xf326('0x66')]=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0xf326('0x67')]=0x0;this[_0xf326('0x68')]=0x0;this[_0xf326('0x69')]=0x0;this[_0xf326('0x6a')]=0x0;this[_0xf326('0x6b')]=0x0;this[_0xf326('0x6c')]=_0x3ace29['dialPredictiveIntervalMaxThreshold']||0x14;this[_0xf326('0x6d')]=_0x3ace29[_0xf326('0x6e')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0xf326('0x6f')]=0x0;this[_0xf326('0x70')]=0x1;this[_0xf326('0x71')]=0x0;this[_0xf326('0x72')]=0x0;this[_0xf326('0x73')]=0x0;this['erlangBusyFactor']=0x0;this['dialRecallMeTimeout']=_0x3ace29[_0xf326('0x74')]||0x1e;this[_0xf326('0x75')]=_0x3ace29['dialRecallInQueue']||![];this['dialPreviewAutoRecallMe']=!!_0x3ace29[_0xf326('0x76')]||![];this[_0xf326('0x77')]=!!_0x3ace29[_0xf326('0x77')]||![];this['dialQueueProject2']=_0x3ace29[_0xf326('0x78')]||undefined;this[_0xf326('0x79')]=_0x3ace29[_0xf326('0x79')]||![];this[_0xf326('0x7a')]=_0x3ace29[_0xf326('0x7a')]||![];this[_0xf326('0xb')]=monitorFormat[_0x3ace29[_0xf326('0xb')]]?monitorFormat[_0x3ace29[_0xf326('0xb')]]:undefined;this[_0xf326('0x7b')]=_0x3ace29[_0xf326('0x7b')]||![];this[_0xf326('0x7c')]=_0x3ace29[_0xf326('0x7c')]?_0x3ace29[_0xf326('0x7c')]:undefined;this[_0xf326('0x7d')]=![];}module[_0xf326('0x7e')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueueSummary.js b/server/services/ami/model/voiceQueueSummary.js index 3be58ff..25b47fb 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 _0x5b5a=['includes','status','keys','length','queue','dialer','exten','xcally-motion-preview','compareToInboundQueue','some','compareToOutboundQueue','preview','exports','loggedIn','loggedInDb','ringing','talking','waiting','available','answered','inUse','outboundAbandonedCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','paused','pTalking','name','strategy','abandoned','invalid','onHold','notInUse','ringInUse','sumBillable','sumDuration','sumHoldTime','total','type','unavailable','unknown','unmanaged','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','active','prototype','createReport','busy','loggedin','callers','SIP/','incall'];(function(_0x18217e,_0x22ab6f){var _0x119f66=function(_0x1e463b){while(--_0x1e463b){_0x18217e['push'](_0x18217e['shift']());}};_0x119f66(++_0x22ab6f);}(_0x5b5a,0xc3));var _0xa5b5=function(_0x558010,_0x4a71e6){_0x558010=_0x558010-0x0;var _0x3b9dba=_0x5b5a[_0x558010];return _0x3b9dba;};'use strict';var INBOUND_COUNTERS=['available',_0xa5b5('0x0'),_0xa5b5('0x1'),'paused',_0xa5b5('0x2'),_0xa5b5('0x3'),_0xa5b5('0x4')];var OUTBOUND_COUNTERS=[_0xa5b5('0x5'),_0xa5b5('0x6'),_0xa5b5('0x7'),_0xa5b5('0x0'),_0xa5b5('0x1'),'originated',_0xa5b5('0x8'),_0xa5b5('0x9'),'outboundBlacklistCallsDay',_0xa5b5('0xa'),_0xa5b5('0xb'),_0xa5b5('0xc'),_0xa5b5('0xd'),_0xa5b5('0xe'),_0xa5b5('0xf'),_0xa5b5('0x10'),_0xa5b5('0x11'),_0xa5b5('0x12'),_0xa5b5('0x3'),'sumBillable','sumDuration','total','waiting'];function VoiceQueueSummary(_0x1b988d){this['id']=_0x1b988d['id'];this['name']=_0x1b988d[_0xa5b5('0x13')];this['strategy']=_0x1b988d[_0xa5b5('0x14')];this[_0xa5b5('0x15')]=_0x1b988d[_0xa5b5('0x15')]||0x0;this[_0xa5b5('0x6')]=_0x1b988d[_0xa5b5('0x6')]||0x0;this[_0xa5b5('0x5')]=_0x1b988d[_0xa5b5('0x5')]||0x0;this['busy']=_0x1b988d['busy']||0x0;this[_0xa5b5('0x7')]=_0x1b988d['inUse']||0x0;this[_0xa5b5('0x16')]=_0x1b988d[_0xa5b5('0x16')]||0x0;this[_0xa5b5('0x0')]=_0x1b988d['loggedIn']||0x0;this['loggedInDb']=_0x1b988d['loggedInDb']||0x0;this['onHold']=_0x1b988d[_0xa5b5('0x17')]||0x0;this[_0xa5b5('0x18')]=_0x1b988d[_0xa5b5('0x18')]||0x0;this[_0xa5b5('0x11')]=_0x1b988d[_0xa5b5('0x11')]||0x0;this[_0xa5b5('0x2')]=_0x1b988d['ringing']||0x0;this[_0xa5b5('0x19')]=_0x1b988d[_0xa5b5('0x19')];this[_0xa5b5('0x1a')]=_0x1b988d['sumBillable'];this[_0xa5b5('0x1b')]=_0x1b988d[_0xa5b5('0x1b')];this[_0xa5b5('0x1c')]=_0x1b988d[_0xa5b5('0x1c')]||0x0;this[_0xa5b5('0x3')]=_0x1b988d[_0xa5b5('0x3')]||0x0;this[_0xa5b5('0x1d')]=_0x1b988d[_0xa5b5('0x1d')]||0x0;this[_0xa5b5('0x1e')]=_0x1b988d[_0xa5b5('0x1e')];this[_0xa5b5('0x1f')]=_0x1b988d[_0xa5b5('0x1f')]||0x0;this[_0xa5b5('0x20')]=_0x1b988d[_0xa5b5('0x20')]||0x0;this[_0xa5b5('0x21')]=_0x1b988d[_0xa5b5('0x21')]||0x0;this[_0xa5b5('0x4')]=_0x1b988d[_0xa5b5('0x4')]||0x0;if(_0x1b988d[_0xa5b5('0x1e')]===_0xa5b5('0x22')){this[_0xa5b5('0x12')]=_0x1b988d[_0xa5b5('0x12')]||0x0;this[_0xa5b5('0x23')]=_0x1b988d[_0xa5b5('0x23')];this[_0xa5b5('0x24')]=_0x1b988d[_0xa5b5('0x24')];this[_0xa5b5('0x25')]=_0x1b988d['dialOriginateCallerIdName'];this[_0xa5b5('0x26')]=_0x1b988d[_0xa5b5('0x26')];this[_0xa5b5('0x27')]=_0x1b988d[_0xa5b5('0x27')];this['dialPrefix']=_0x1b988d[_0xa5b5('0x28')];this[_0xa5b5('0x29')]=_0x1b988d[_0xa5b5('0x29')];this[_0xa5b5('0x2a')]=_0x1b988d[_0xa5b5('0x2a')];this['outboundAnswerCallsDay']=_0x1b988d[_0xa5b5('0x9')];this['outboundBlacklistCallsDay']=_0x1b988d[_0xa5b5('0x2b')];this[_0xa5b5('0xa')]=_0x1b988d[_0xa5b5('0xa')];this['outboundCongestionCallsDay']=_0x1b988d[_0xa5b5('0xb')];this['outboundDropCallsDayACS']=_0x1b988d[_0xa5b5('0x2c')];this[_0xa5b5('0x2d')]=_0x1b988d[_0xa5b5('0x2d')];this[_0xa5b5('0x2e')]=_0x1b988d[_0xa5b5('0x2e')];this[_0xa5b5('0xc')]=_0x1b988d['outboundNoAnswerCallsDay'];this[_0xa5b5('0xd')]=_0x1b988d[_0xa5b5('0xd')];this[_0xa5b5('0x2f')]=_0x1b988d[_0xa5b5('0x2f')];this[_0xa5b5('0xe')]=_0x1b988d[_0xa5b5('0xe')];this['outboundRejectCallsDay']=_0x1b988d[_0xa5b5('0xf')];this[_0xa5b5('0x10')]=_0x1b988d[_0xa5b5('0x10')];this[_0xa5b5('0x30')]=_0x1b988d[_0xa5b5('0x30')];this[_0xa5b5('0x31')]=_0x1b988d[_0xa5b5('0x31')];this[_0xa5b5('0x32')]=_0x1b988d[_0xa5b5('0x32')];this[_0xa5b5('0x33')]=_0x1b988d[_0xa5b5('0x33')];this[_0xa5b5('0x34')]=_0x1b988d[_0xa5b5('0x34')];this[_0xa5b5('0x35')]=_0x1b988d[_0xa5b5('0x35')];this[_0xa5b5('0x36')]=_0x1b988d['predictiveIntervalErlangCallsDroppedCalls'];this[_0xa5b5('0x37')]=_0x1b988d[_0xa5b5('0x37')];this[_0xa5b5('0x38')]=_0x1b988d['predictiveIntervalMultiplicativeFactor'];this[_0xa5b5('0x39')]=_0x1b988d[_0xa5b5('0x39')];this[_0xa5b5('0x3a')]=_0x1b988d[_0xa5b5('0x3a')];this[_0xa5b5('0x3b')]=_0x1b988d['predictiveIntervalTotalCalls'];this[_0xa5b5('0x3c')]=_0x1b988d[_0xa5b5('0x3c')];this[_0xa5b5('0x3d')]=_0x1b988d['erlangCalls'];this[_0xa5b5('0x3e')]=_0x1b988d['erlangCallToSecond'];this[_0xa5b5('0x3f')]=_0x1b988d[_0xa5b5('0x3f')];this[_0xa5b5('0x40')]=_0x1b988d[_0xa5b5('0x40')];this[_0xa5b5('0x41')]=_0x1b988d[_0xa5b5('0x41')];this[_0xa5b5('0x42')]=_0x1b988d[_0xa5b5('0x42')];this[_0xa5b5('0x43')]=_0x1b988d['message'];this[_0xa5b5('0x44')]=_0x1b988d[_0xa5b5('0x44')];}if(_0x1b988d['Trunk']){this[_0xa5b5('0x45')]={'id':_0x1b988d[_0xa5b5('0x45')]['id'],'name':_0x1b988d[_0xa5b5('0x45')]['name'],'active':_0x1b988d[_0xa5b5('0x45')][_0xa5b5('0x46')],'callerid':_0x1b988d[_0xa5b5('0x45')]['callerid']};}}VoiceQueueSummary[_0xa5b5('0x47')][_0xa5b5('0x48')]=function(_0x53c9bb,_0x24eeaf,_0x239ae2,_0x1d3a24){this[_0xa5b5('0x1')]=0x0;this[_0xa5b5('0x3')]=0x0;this[_0xa5b5('0x11')]=0x0;this['unknown']=0x0;this[_0xa5b5('0x18')]=0x0;this[_0xa5b5('0x7')]=0x0;this[_0xa5b5('0x49')]=0x0;this[_0xa5b5('0x16')]=0x0;this[_0xa5b5('0x1f')]=0x0;this[_0xa5b5('0x2')]=0x0;this[_0xa5b5('0x19')]=0x0;this[_0xa5b5('0x17')]=0x0;if(_0x239ae2){if(_0x239ae2['available']){this[_0xa5b5('0x5')]=Number(_0x239ae2[_0xa5b5('0x5')]);}if(_0x239ae2['loggedin']){this['loggedIn']=Number(_0x239ae2[_0xa5b5('0x4a')]);}if(_0x239ae2[_0xa5b5('0x4b')]){this[_0xa5b5('0x4')]=Number(_0x239ae2['callers']);}}for(var _0x14eea5=0x0;_0x14eea5<_0x53c9bb['length'];_0x14eea5++){var _0x40f8fb=_0x24eeaf[_0xa5b5('0x4c')+_0x53c9bb[_0x14eea5][_0xa5b5('0x13')]];if(_0x40f8fb&&_0x40f8fb['online']){this[_0xa5b5('0x1')]+=0x1;}if(_0x53c9bb[_0x14eea5][_0xa5b5('0x4d')]==='1'){this[_0xa5b5('0x3')]+=0x1;}if(_0x53c9bb[_0x14eea5][_0xa5b5('0x11')]==='1'&&!['2','7','8'][_0xa5b5('0x4e')](_0x53c9bb[_0x14eea5]['status'])){this[_0xa5b5('0x11')]+=0x1;}switch(_0x53c9bb[_0x14eea5][_0xa5b5('0x4f')]){case'0':this[_0xa5b5('0x20')]+=0x1;break;case'1':this[_0xa5b5('0x18')]+=0x1;break;case'2':this[_0xa5b5('0x7')]+=0x1;break;case'3':this[_0xa5b5('0x49')]+=0x1;break;case'4':this[_0xa5b5('0x16')]+=0x1;break;case'5':this[_0xa5b5('0x1f')]+=0x1;break;case'6':this['ringing']+=0x1;break;case'7':this[_0xa5b5('0x19')]+=0x1;break;case'8':this['onHold']+=0x1;break;}}if(this['dialMethod']==='booked'){var _0x56d7b2=Object[_0xa5b5('0x50')](_0x1d3a24);for(var _0x314b0e=0x0;_0x314b0e<_0x56d7b2[_0xa5b5('0x51')];_0x314b0e++){var _0x127545=_0x56d7b2[_0x314b0e];var _0x1ea95d=_0x1d3a24[_0x127545];if(_0x1ea95d[_0xa5b5('0x52')]===this['name']&&_0x1ea95d[_0xa5b5('0x1e')]===_0xa5b5('0x53')&&_0x1ea95d[_0xa5b5('0x54')]===_0xa5b5('0x55')){this[_0xa5b5('0x3')]+=0x1;}}if(this[_0xa5b5('0x3')]>this[_0xa5b5('0x7')]){this[_0xa5b5('0x3')]=this[_0xa5b5('0x7')];}this[_0xa5b5('0x12')]=0x0;}return this;};VoiceQueueSummary[_0xa5b5('0x47')][_0xa5b5('0x56')]=function(_0x397d75){var _0x1ed60a=![];if(_0x397d75){_0x1ed60a=INBOUND_COUNTERS[_0xa5b5('0x57')](function(_0x408dc6){return this[_0x408dc6]!==_0x397d75[_0x408dc6];},this);}return _0x1ed60a;};VoiceQueueSummary[_0xa5b5('0x47')][_0xa5b5('0x58')]=function(_0x37eca0){var _0x5c2bed=![];var _0x3ab32e=![];var _0x311c69=![];if(_0x37eca0){_0x5c2bed=this['dialMethod']!==_0x37eca0[_0xa5b5('0x24')]||this[_0xa5b5('0x23')]!==_0x37eca0[_0xa5b5('0x23')]||this[_0xa5b5('0x43')]!==_0x37eca0[_0xa5b5('0x43')]||this['statusMessage']!==_0x37eca0[_0xa5b5('0x44')];_0x3ab32e=OUTBOUND_COUNTERS['some'](function(_0x39e441){return this[_0x39e441]!==_0x37eca0[_0x39e441];},this);if(this[_0xa5b5('0x45')]&&_0x37eca0[_0xa5b5('0x45')]){_0x311c69=this['Trunk'][_0xa5b5('0x13')]!==_0x37eca0['Trunk'][_0xa5b5('0x13')]||this[_0xa5b5('0x45')][_0xa5b5('0x46')]!==_0x37eca0[_0xa5b5('0x45')][_0xa5b5('0x46')];}}return _0x5c2bed||_0x3ab32e||_0x311c69;};VoiceQueueSummary[_0xa5b5('0x47')]['updateReportFromOutboundQueue']=function(_0x8e795e){this['answered']=_0x8e795e[_0xa5b5('0x6')];this['message']=_0x8e795e[_0xa5b5('0x43')];this[_0xa5b5('0x44')]=_0x8e795e[_0xa5b5('0x44')];this[_0xa5b5('0x3c')]=_0x8e795e[_0xa5b5('0x3c')];this['outboundAbandonedCallsDay']=_0x8e795e[_0xa5b5('0x8')];this['outboundAnswerCallsDay']=_0x8e795e['outboundAnswerCallsDay'];this[_0xa5b5('0x2b')]=_0x8e795e[_0xa5b5('0x2b')];this['outboundBusyCallsDay']=_0x8e795e[_0xa5b5('0xa')];this[_0xa5b5('0xb')]=_0x8e795e[_0xa5b5('0xb')];this['outboundNoAnswerCallsDay']=_0x8e795e[_0xa5b5('0xc')];this[_0xa5b5('0xd')]=_0x8e795e[_0xa5b5('0xd')];this[_0xa5b5('0xe')]=_0x8e795e[_0xa5b5('0xe')];this[_0xa5b5('0xf')]=_0x8e795e['outboundRejectCallsDay'];this['outboundUnknownCallsDay']=_0x8e795e['outboundUnknownCallsDay'];this['sumBillable']=_0x8e795e['sumBillable'];this[_0xa5b5('0x1b')]=_0x8e795e['sumDuration'];this['total']=_0x8e795e[_0xa5b5('0x1d')];if(this[_0xa5b5('0x24')]===_0xa5b5('0x59')){this['pTalking']=_0x8e795e[_0xa5b5('0x12')];}};module[_0xa5b5('0x5a')]=VoiceQueueSummary; \ No newline at end of file +var _0x423b=['predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','message','Trunk','active','callerid','createReport','busy','loggedin','callers','length','SIP/','online','incall','includes','status','dialer','exten','xcally-motion-preview','prototype','some','statusMessage','updateReportFromOutboundQueue','preview','loggedIn','paused','talking','inUse','originated','outboundAbandonedCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','pTalking','sumBillable','sumDuration','total','name','strategy','abandoned','answered','available','invalid','loggedInDb','onHold','notInUse','ringing','ringInUse','sumHoldTime','type','unavailable','unknown','unmanaged','waiting','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit'];(function(_0x68361,_0x231f90){var _0xbb709a=function(_0x47e656){while(--_0x47e656){_0x68361['push'](_0x68361['shift']());}};_0xbb709a(++_0x231f90);}(_0x423b,0x12b));var _0xb423=function(_0x5ddaac,_0x2697a8){_0x5ddaac=_0x5ddaac-0x0;var _0x2a9c58=_0x423b[_0x5ddaac];return _0x2a9c58;};'use strict';var INBOUND_COUNTERS=['available',_0xb423('0x0'),'loggedInDb',_0xb423('0x1'),'ringing',_0xb423('0x2'),'waiting'];var OUTBOUND_COUNTERS=['available','answered',_0xb423('0x3'),_0xb423('0x0'),'loggedInDb',_0xb423('0x4'),_0xb423('0x5'),_0xb423('0x6'),_0xb423('0x7'),'outboundBusyCallsDay',_0xb423('0x8'),_0xb423('0x9'),_0xb423('0xa'),_0xb423('0xb'),_0xb423('0xc'),'outboundUnknownCallsDay','paused',_0xb423('0xd'),_0xb423('0x2'),_0xb423('0xe'),_0xb423('0xf'),_0xb423('0x10'),'waiting'];function VoiceQueueSummary(_0x95d9b7){this['id']=_0x95d9b7['id'];this[_0xb423('0x11')]=_0x95d9b7['name'];this[_0xb423('0x12')]=_0x95d9b7[_0xb423('0x12')];this[_0xb423('0x13')]=_0x95d9b7['abandoned']||0x0;this[_0xb423('0x14')]=_0x95d9b7['answered']||0x0;this[_0xb423('0x15')]=_0x95d9b7['available']||0x0;this['busy']=_0x95d9b7['busy']||0x0;this[_0xb423('0x3')]=_0x95d9b7[_0xb423('0x3')]||0x0;this[_0xb423('0x16')]=_0x95d9b7['invalid']||0x0;this[_0xb423('0x0')]=_0x95d9b7[_0xb423('0x0')]||0x0;this[_0xb423('0x17')]=_0x95d9b7[_0xb423('0x17')]||0x0;this['onHold']=_0x95d9b7[_0xb423('0x18')]||0x0;this[_0xb423('0x19')]=_0x95d9b7['notInUse']||0x0;this['paused']=_0x95d9b7[_0xb423('0x1')]||0x0;this['ringing']=_0x95d9b7[_0xb423('0x1a')]||0x0;this[_0xb423('0x1b')]=_0x95d9b7[_0xb423('0x1b')];this[_0xb423('0xe')]=_0x95d9b7[_0xb423('0xe')];this[_0xb423('0xf')]=_0x95d9b7[_0xb423('0xf')];this[_0xb423('0x1c')]=_0x95d9b7['sumHoldTime']||0x0;this[_0xb423('0x2')]=_0x95d9b7[_0xb423('0x2')]||0x0;this[_0xb423('0x10')]=_0x95d9b7['total']||0x0;this[_0xb423('0x1d')]=_0x95d9b7[_0xb423('0x1d')];this['unavailable']=_0x95d9b7[_0xb423('0x1e')]||0x0;this[_0xb423('0x1f')]=_0x95d9b7[_0xb423('0x1f')]||0x0;this['unmanaged']=_0x95d9b7[_0xb423('0x20')]||0x0;this['waiting']=_0x95d9b7[_0xb423('0x21')]||0x0;if(_0x95d9b7['type']===_0xb423('0x22')){this[_0xb423('0xd')]=_0x95d9b7['pTalking']||0x0;this[_0xb423('0x23')]=_0x95d9b7[_0xb423('0x23')];this[_0xb423('0x24')]=_0x95d9b7['dialMethod'];this['dialOriginateCallerIdName']=_0x95d9b7[_0xb423('0x25')];this['dialOriginateCallerIdNumber']=_0x95d9b7[_0xb423('0x26')];this['dialOriginateTimeout']=_0x95d9b7[_0xb423('0x27')];this[_0xb423('0x28')]=_0x95d9b7[_0xb423('0x28')];this[_0xb423('0x29')]=_0x95d9b7[_0xb423('0x29')];this['outboundAnswerAgiCallsDay']=_0x95d9b7[_0xb423('0x2a')];this['outboundAnswerCallsDay']=_0x95d9b7['outboundAnswerCallsDay'];this['outboundBlacklistCallsDay']=_0x95d9b7['outboundBlacklistCallsDay'];this[_0xb423('0x2b')]=_0x95d9b7[_0xb423('0x2b')];this[_0xb423('0x8')]=_0x95d9b7['outboundCongestionCallsDay'];this['outboundDropCallsDayACS']=_0x95d9b7[_0xb423('0x2c')];this[_0xb423('0x2d')]=_0x95d9b7['outboundDropCallsDayCallersExit'];this[_0xb423('0x2e')]=_0x95d9b7[_0xb423('0x2e')];this[_0xb423('0x9')]=_0x95d9b7[_0xb423('0x9')];this[_0xb423('0xa')]=_0x95d9b7['outboundNoSuchCallsDay'];this[_0xb423('0x2f')]=_0x95d9b7['outboundOriginateFailureCallsDay'];this[_0xb423('0xb')]=_0x95d9b7[_0xb423('0xb')];this[_0xb423('0xc')]=_0x95d9b7[_0xb423('0xc')];this[_0xb423('0x30')]=_0x95d9b7[_0xb423('0x30')];this['predictiveIntervalAnsweredCalls']=_0x95d9b7[_0xb423('0x31')];this[_0xb423('0x32')]=_0x95d9b7['predictiveIntervalAvgHoldtime'];this[_0xb423('0x33')]=_0x95d9b7['predictiveIntervalAvgTalktime'];this[_0xb423('0x34')]=_0x95d9b7[_0xb423('0x34')];this['predictiveIntervalDroppedCallsTimeout']=_0x95d9b7[_0xb423('0x35')];this['predictiveIntervalErlangCalls']=_0x95d9b7[_0xb423('0x36')];this[_0xb423('0x37')]=_0x95d9b7[_0xb423('0x37')];this[_0xb423('0x38')]=_0x95d9b7[_0xb423('0x38')];this['predictiveIntervalMultiplicativeFactor']=_0x95d9b7['predictiveIntervalMultiplicativeFactor'];this[_0xb423('0x39')]=_0x95d9b7[_0xb423('0x39')];this['predictiveIntervalAvailable']=_0x95d9b7[_0xb423('0x3a')];this[_0xb423('0x3b')]=_0x95d9b7['predictiveIntervalTotalCalls'];this[_0xb423('0x4')]=_0x95d9b7[_0xb423('0x4')];this[_0xb423('0x3c')]=_0x95d9b7[_0xb423('0x3c')];this[_0xb423('0x3d')]=_0x95d9b7[_0xb423('0x3d')];this[_0xb423('0x3e')]=_0x95d9b7[_0xb423('0x3e')];this[_0xb423('0x3f')]=_0x95d9b7[_0xb423('0x3f')];this[_0xb423('0x40')]=_0x95d9b7[_0xb423('0x40')];this[_0xb423('0x41')]=_0x95d9b7[_0xb423('0x41')];this['message']=_0x95d9b7[_0xb423('0x42')];this['statusMessage']=_0x95d9b7['statusMessage'];}if(_0x95d9b7['Trunk']){this['Trunk']={'id':_0x95d9b7[_0xb423('0x43')]['id'],'name':_0x95d9b7[_0xb423('0x43')]['name'],'active':_0x95d9b7[_0xb423('0x43')][_0xb423('0x44')],'callerid':_0x95d9b7[_0xb423('0x43')][_0xb423('0x45')]};}}VoiceQueueSummary['prototype'][_0xb423('0x46')]=function(_0x18a80e,_0x84d4a0,_0x5b3bca,_0x2dbd47){this[_0xb423('0x17')]=0x0;this['talking']=0x0;this['paused']=0x0;this[_0xb423('0x1f')]=0x0;this['notInUse']=0x0;this[_0xb423('0x3')]=0x0;this[_0xb423('0x47')]=0x0;this['invalid']=0x0;this[_0xb423('0x1e')]=0x0;this['ringing']=0x0;this[_0xb423('0x1b')]=0x0;this[_0xb423('0x18')]=0x0;if(_0x5b3bca){if(_0x5b3bca[_0xb423('0x15')]){this[_0xb423('0x15')]=Number(_0x5b3bca[_0xb423('0x15')]);}if(_0x5b3bca[_0xb423('0x48')]){this[_0xb423('0x0')]=Number(_0x5b3bca[_0xb423('0x48')]);}if(_0x5b3bca[_0xb423('0x49')]){this[_0xb423('0x21')]=Number(_0x5b3bca[_0xb423('0x49')]);}}for(var _0x6f7ec2=0x0;_0x6f7ec2<_0x18a80e[_0xb423('0x4a')];_0x6f7ec2++){var _0x298bd1=_0x84d4a0[_0xb423('0x4b')+_0x18a80e[_0x6f7ec2][_0xb423('0x11')]];if(_0x298bd1&&_0x298bd1[_0xb423('0x4c')]){this[_0xb423('0x17')]+=0x1;}if(_0x18a80e[_0x6f7ec2][_0xb423('0x4d')]==='1'){this['talking']+=0x1;}if(_0x18a80e[_0x6f7ec2][_0xb423('0x1')]==='1'&&!['2','7','8'][_0xb423('0x4e')](_0x18a80e[_0x6f7ec2][_0xb423('0x4f')])){this[_0xb423('0x1')]+=0x1;}switch(_0x18a80e[_0x6f7ec2][_0xb423('0x4f')]){case'0':this[_0xb423('0x1f')]+=0x1;break;case'1':this['notInUse']+=0x1;break;case'2':this['inUse']+=0x1;break;case'3':this['busy']+=0x1;break;case'4':this[_0xb423('0x16')]+=0x1;break;case'5':this[_0xb423('0x1e')]+=0x1;break;case'6':this[_0xb423('0x1a')]+=0x1;break;case'7':this[_0xb423('0x1b')]+=0x1;break;case'8':this[_0xb423('0x18')]+=0x1;break;}}if(this['dialMethod']==='booked'){var _0x2b309a=Object['keys'](_0x2dbd47);for(var _0x52081f=0x0;_0x52081f<_0x2b309a[_0xb423('0x4a')];_0x52081f++){var _0x3bc8d1=_0x2b309a[_0x52081f];var _0x379c55=_0x2dbd47[_0x3bc8d1];if(_0x379c55['queue']===this['name']&&_0x379c55[_0xb423('0x1d')]===_0xb423('0x50')&&_0x379c55[_0xb423('0x51')]===_0xb423('0x52')){this[_0xb423('0x2')]+=0x1;}}if(this['talking']>this['inUse']){this[_0xb423('0x2')]=this['inUse'];}this['pTalking']=0x0;}return this;};VoiceQueueSummary[_0xb423('0x53')]['compareToInboundQueue']=function(_0x55e68c){var _0x549f0a=![];if(_0x55e68c){_0x549f0a=INBOUND_COUNTERS[_0xb423('0x54')](function(_0x457150){return this[_0x457150]!==_0x55e68c[_0x457150];},this);}return _0x549f0a;};VoiceQueueSummary[_0xb423('0x53')]['compareToOutboundQueue']=function(_0x47e7df){var _0x3da9dd=![];var _0x399b87=![];var _0x3d049d=![];if(_0x47e7df){_0x3da9dd=this[_0xb423('0x24')]!==_0x47e7df[_0xb423('0x24')]||this[_0xb423('0x23')]!==_0x47e7df[_0xb423('0x23')]||this['message']!==_0x47e7df[_0xb423('0x42')]||this[_0xb423('0x55')]!==_0x47e7df[_0xb423('0x55')];_0x399b87=OUTBOUND_COUNTERS[_0xb423('0x54')](function(_0x2047c1){return this[_0x2047c1]!==_0x47e7df[_0x2047c1];},this);if(this[_0xb423('0x43')]&&_0x47e7df[_0xb423('0x43')]){_0x3d049d=this[_0xb423('0x43')][_0xb423('0x11')]!==_0x47e7df['Trunk']['name']||this['Trunk'][_0xb423('0x44')]!==_0x47e7df['Trunk'][_0xb423('0x44')];}}return _0x3da9dd||_0x399b87||_0x3d049d;};VoiceQueueSummary[_0xb423('0x53')][_0xb423('0x56')]=function(_0x4deadb){this[_0xb423('0x14')]=_0x4deadb['answered'];this[_0xb423('0x42')]=_0x4deadb[_0xb423('0x42')];this['statusMessage']=_0x4deadb[_0xb423('0x55')];this[_0xb423('0x4')]=_0x4deadb['originated'];this[_0xb423('0x5')]=_0x4deadb[_0xb423('0x5')];this[_0xb423('0x6')]=_0x4deadb[_0xb423('0x6')];this[_0xb423('0x7')]=_0x4deadb['outboundBlacklistCallsDay'];this[_0xb423('0x2b')]=_0x4deadb['outboundBusyCallsDay'];this[_0xb423('0x8')]=_0x4deadb[_0xb423('0x8')];this[_0xb423('0x9')]=_0x4deadb[_0xb423('0x9')];this[_0xb423('0xa')]=_0x4deadb['outboundNoSuchCallsDay'];this[_0xb423('0xb')]=_0x4deadb[_0xb423('0xb')];this[_0xb423('0xc')]=_0x4deadb[_0xb423('0xc')];this[_0xb423('0x30')]=_0x4deadb[_0xb423('0x30')];this[_0xb423('0xe')]=_0x4deadb['sumBillable'];this['sumDuration']=_0x4deadb['sumDuration'];this[_0xb423('0x10')]=_0x4deadb[_0xb423('0x10')];if(this[_0xb423('0x24')]===_0xb423('0x57')){this['pTalking']=_0x4deadb[_0xb423('0xd')];}};module['exports']=VoiceQueueSummary; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 43b54cf..fdbd10d 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 _0xa8c3=['username','accessKey','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x3228d8,_0x96beb9){var _0x58cbc5=function(_0x19a5c1){while(--_0x19a5c1){_0x3228d8['push'](_0x3228d8['shift']());}};_0x58cbc5(++_0x96beb9);}(_0xa8c3,0x16b));var _0x3a8c=function(_0x5b6cf1,_0x32fdcd){_0x5b6cf1=_0x5b6cf1-0x0;var _0x46278c=_0xa8c3[_0x5b6cf1];return _0x46278c;};'use strict';function VtigerAccount(_0x56c940){this['id']=_0x56c940['id']||0x0;this[_0x3a8c('0x0')]=_0x56c940[_0x3a8c('0x0')]||'';this[_0x3a8c('0x1')]=_0x56c940['username']||'';this[_0x3a8c('0x2')]=_0x56c940[_0x3a8c('0x2')]||'';this[_0x3a8c('0x3')]=_0x56c940[_0x3a8c('0x3')]||'';this['serverUrl']=_0x56c940[_0x3a8c('0x4')]||'';this[_0x3a8c('0x5')]=_0x56c940['Configurations']||{};}module[_0x3a8c('0x6')]=VtigerAccount; \ No newline at end of file +var _0xf210=['remoteUri','serverUrl','Configurations','name','username','accessKey'];(function(_0x42b759,_0x3393b6){var _0x5a4b40=function(_0x4d0a1c){while(--_0x4d0a1c){_0x42b759['push'](_0x42b759['shift']());}};_0x5a4b40(++_0x3393b6);}(_0xf210,0x18f));var _0x0f21=function(_0x459082,_0x4210b1){_0x459082=_0x459082-0x0;var _0x59aba2=_0xf210[_0x459082];return _0x59aba2;};'use strict';function VtigerAccount(_0x4b794d){this['id']=_0x4b794d['id']||0x0;this[_0x0f21('0x0')]=_0x4b794d[_0x0f21('0x0')]||'';this['username']=_0x4b794d[_0x0f21('0x1')]||'';this['accessKey']=_0x4b794d[_0x0f21('0x2')]||'';this[_0x0f21('0x3')]=_0x4b794d[_0x0f21('0x3')]||'';this[_0x0f21('0x4')]=_0x4b794d[_0x0f21('0x4')]||'';this[_0x0f21('0x5')]=_0x4b794d[_0x0f21('0x5')]||{};}module['exports']=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index aae488d..bf2f298 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 _0xbae5=['remoteUri','authType','type','integrationTab','Configurations','exports','name','username','password','token'];(function(_0x4455bc,_0x289f1b){var _0x558565=function(_0x3f87b6){while(--_0x3f87b6){_0x4455bc['push'](_0x4455bc['shift']());}};_0x558565(++_0x289f1b);}(_0xbae5,0x18c));var _0x5bae=function(_0x3c2722,_0x1c4748){_0x3c2722=_0x3c2722-0x0;var _0x99c954=_0xbae5[_0x3c2722];return _0x99c954;};'use strict';function ZendeskAccount(_0x57ba6c){this['id']=_0x57ba6c['id']||0x0;this[_0x5bae('0x0')]=_0x57ba6c[_0x5bae('0x0')]||'';this[_0x5bae('0x1')]=_0x57ba6c[_0x5bae('0x1')]||'';this[_0x5bae('0x2')]=_0x57ba6c['password']||'';this[_0x5bae('0x3')]=_0x57ba6c[_0x5bae('0x3')]||'';this[_0x5bae('0x4')]=_0x57ba6c[_0x5bae('0x4')]||'';this[_0x5bae('0x5')]=_0x57ba6c[_0x5bae('0x5')]||'';this[_0x5bae('0x6')]=_0x57ba6c[_0x5bae('0x6')]||_0x5bae('0x7');this['serverUrl']=_0x57ba6c['serverUrl']||'';this[_0x5bae('0x8')]=_0x57ba6c['Configurations']||{};}module[_0x5bae('0x9')]=ZendeskAccount; \ No newline at end of file +var _0x2e4d=['type','integrationTab','serverUrl','Configurations','exports','name','username','password','token','remoteUri','authType'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2e4d,0x191));var _0xd2e4=function(_0x159991,_0x16fd0d){_0x159991=_0x159991-0x0;var _0x3e71c1=_0x2e4d[_0x159991];return _0x3e71c1;};'use strict';function ZendeskAccount(_0x1575b1){this['id']=_0x1575b1['id']||0x0;this[_0xd2e4('0x0')]=_0x1575b1[_0xd2e4('0x0')]||'';this['username']=_0x1575b1[_0xd2e4('0x1')]||'';this[_0xd2e4('0x2')]=_0x1575b1[_0xd2e4('0x2')]||'';this[_0xd2e4('0x3')]=_0x1575b1[_0xd2e4('0x3')]||'';this[_0xd2e4('0x4')]=_0x1575b1[_0xd2e4('0x4')]||'';this[_0xd2e4('0x5')]=_0x1575b1[_0xd2e4('0x5')]||'';this[_0xd2e4('0x6')]=_0x1575b1[_0xd2e4('0x6')]||_0xd2e4('0x7');this[_0xd2e4('0x8')]=_0x1575b1['serverUrl']||'';this['Configurations']=_0x1575b1[_0xd2e4('0x9')]||{};}module[_0xd2e4('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 6bc0d06..23ef817 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 _0x646d=['refreshToken','Configurations','exports','name','description','host','zone','clientId','clientSecret','serverUrl','code'];(function(_0x2ed8f3,_0x4aa12f){var _0x525a55=function(_0x4cfb58){while(--_0x4cfb58){_0x2ed8f3['push'](_0x2ed8f3['shift']());}};_0x525a55(++_0x4aa12f);}(_0x646d,0x1f2));var _0xd646=function(_0x47f0ff,_0x2a11eb){_0x47f0ff=_0x47f0ff-0x0;var _0x180f39=_0x646d[_0x47f0ff];return _0x180f39;};'use strict';function ZohoAccount(_0x427c17){this['id']=_0x427c17['id']||0x0;this[_0xd646('0x0')]=_0x427c17[_0xd646('0x0')]||'';this[_0xd646('0x1')]=_0x427c17[_0xd646('0x1')]||'';this[_0xd646('0x2')]=_0x427c17['host']||'';this[_0xd646('0x3')]=_0x427c17[_0xd646('0x3')]||'';this[_0xd646('0x4')]=_0x427c17[_0xd646('0x4')]||'';this['clientSecret']=_0x427c17[_0xd646('0x5')]||'';this[_0xd646('0x6')]=_0x427c17['serverUrl']||'';this[_0xd646('0x7')]=_0x427c17[_0xd646('0x7')]||'';this[_0xd646('0x8')]=_0x427c17[_0xd646('0x8')]||'';this[_0xd646('0x9')]=_0x427c17['Configurations']||{};}module[_0xd646('0xa')]=ZohoAccount; \ No newline at end of file +var _0x959b=['clientId','clientSecret','serverUrl','code','Configurations','exports','name','description','host','zone'];(function(_0x5b8fe8,_0x102968){var _0x1819ab=function(_0x5de71e){while(--_0x5de71e){_0x5b8fe8['push'](_0x5b8fe8['shift']());}};_0x1819ab(++_0x102968);}(_0x959b,0xf6));var _0xb959=function(_0x2d9461,_0x4eccc9){_0x2d9461=_0x2d9461-0x0;var _0x2c25f6=_0x959b[_0x2d9461];return _0x2c25f6;};'use strict';function ZohoAccount(_0x3045d9){this['id']=_0x3045d9['id']||0x0;this[_0xb959('0x0')]=_0x3045d9['name']||'';this[_0xb959('0x1')]=_0x3045d9[_0xb959('0x1')]||'';this[_0xb959('0x2')]=_0x3045d9[_0xb959('0x2')]||'';this['zone']=_0x3045d9[_0xb959('0x3')]||'';this['clientId']=_0x3045d9[_0xb959('0x4')]||'';this[_0xb959('0x5')]=_0x3045d9[_0xb959('0x5')]||'';this[_0xb959('0x6')]=_0x3045d9[_0xb959('0x6')]||'';this[_0xb959('0x7')]=_0x3045d9['code']||'';this['refreshToken']=_0x3045d9['refreshToken']||'';this[_0xb959('0x8')]=_0x3045d9['Configurations']||{};}module[_0xb959('0x9')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 6512971..1dfc6f0 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 _0x7334=['scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countagentrejectretry','countnosuchnumberretry','countmachineretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridname','util','lodash','moment','isNil','string','uniqueid','idContact','queue','name','type','campaigntype','membername','Agent','channelAgent','format','SIP/%s','calleridname','Contact','lastName','active','calleridnum','phone'];(function(_0x3c7e74,_0x431a67){var _0x5e7924=function(_0x39e11f){while(--_0x39e11f){_0x3c7e74['push'](_0x3c7e74['shift']());}};_0x5e7924(++_0x431a67);}(_0x7334,0x184));var _0x4733=function(_0x3c9996,_0x1f015c){_0x3c9996=_0x3c9996-0x0;var _0x1ee926=_0x7334[_0x3c9996];return _0x1ee926;};'use strict';var util=require(_0x4733('0x0'));var _=require(_0x4733('0x1'));var moment=require(_0x4733('0x2'));function checkNameSurname(_0x5016ad,_0x59882e,_0x26b8f3){var _0x4b8b5a='';if(!_[_0x4733('0x3')](_0x59882e)&&_0x4733('0x4')===typeof _0x59882e){_0x4b8b5a+=_0x59882e;}if(!_[_0x4733('0x3')](_0x26b8f3)&&_0x4733('0x4')===typeof _0x26b8f3){_0x4b8b5a+='\x20'+_0x26b8f3;}if(_0x4b8b5a!==''){return _0x4b8b5a;}return _0x5016ad;}function Action(_0x2b146d,_0x449ead,_0x16d7cc,_0x283754,_0x12cafa){this[_0x4733('0x5')]=_0x16d7cc||undefined;this[_0x4733('0x6')]=_0x2b146d['id'];this[_0x4733('0x7')]=_0x449ead[_0x4733('0x8')];this[_0x4733('0x9')]=_0x449ead[_0x4733('0x9')];this[_0x4733('0xa')]=_0x4733('0x7');this['dialAnswer']=![];this[_0x4733('0xb')]=_[_0x4733('0x3')](_0x2b146d['Agent'])?undefined:_0x2b146d[_0x4733('0xc')]['name'];this[_0x4733('0xd')]=this[_0x4733('0xb')]?util[_0x4733('0xe')](_0x4733('0xf'),this[_0x4733('0xb')]):_0x283754||undefined;this[_0x4733('0x10')]=checkNameSurname(_0x2b146d[_0x4733('0x11')]['phone'],_0x2b146d[_0x4733('0x11')]['firstName'],_0x2b146d[_0x4733('0x11')][_0x4733('0x12')]);this[_0x4733('0x13')]=_0x2b146d[_0x4733('0x13')]||![];this[_0x4733('0x14')]=_0x2b146d[_0x4733('0x15')];this[_0x4733('0x16')]=_0x2b146d[_0x4733('0x16')];this[_0x4733('0x17')]=_0x2b146d['countbusyretry']||0x0;this[_0x4733('0x18')]=_0x2b146d[_0x4733('0x18')]||0x0;this['countnoanswerretry']=_0x2b146d[_0x4733('0x19')]||0x0;this[_0x4733('0x1a')]=(_0x2b146d[_0x4733('0x17')]||0x0)+(_0x2b146d[_0x4733('0x18')]||0x0)+(_0x2b146d['countnoanswerretry']||0x0)+(_0x2b146d['countnosuchnumberretry']||0x0)+(_0x2b146d[_0x4733('0x1b')]||0x0)+(_0x2b146d[_0x4733('0x1c')]||0x0)+(_0x2b146d['countmachineretry']||0x0)+(_0x2b146d[_0x4733('0x1d')]||0x0);this[_0x4733('0x1e')]=_0x2b146d[_0x4733('0x1e')]||0x0;this[_0x4733('0x1b')]=_0x2b146d['countdropretry']||0x0;this[_0x4733('0x1c')]=_0x2b146d[_0x4733('0x1c')]||0x0;this['countmachineretry']=_0x2b146d[_0x4733('0x1f')]||0x0;this[_0x4733('0x1d')]=_0x2b146d['countagentrejectretry']||0x0;this[_0x4733('0x20')]=_0x2b146d[_0x4733('0x20')];this[_0x4733('0x21')]=_0x2b146d[_0x4733('0x21')];this[_0x4733('0x22')]=_0x2b146d[_0x4733('0x22')];this[_0x4733('0x23')]=_0x2b146d[_0x4733('0x23')];this['ContactId']=_0x2b146d[_0x4733('0x24')];this[_0x4733('0x25')]=_0x2b146d[_0x4733('0x25')];this[_0x4733('0x26')]=_[_0x4733('0x3')](_0x2b146d[_0x4733('0xc')])?_0x2b146d[_0x4733('0x26')]:_0x2b146d[_0x4733('0xc')]['id'];this[_0x4733('0x27')]=_0x2b146d[_0x4733('0x27')];this['originatecalleridnum']='';this[_0x4733('0x28')]='';}Action['prototype']['getCaller']=function(){return util[_0x4733('0xe')]('\x22%s\x22\x20<%s>',this[_0x4733('0x10')],this['number']);};module['exports']=Action; \ No newline at end of file +var _0x065e=['callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','\x22%s\x22\x20<%s>','calleridname','number','util','isNil','string','uniqueid','queue','name','type','campaigntype','dialAnswer','membername','Agent','format','SIP/%s','Contact','phone','firstName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countabandonedretry','countagentrejectretry'];(function(_0x58f103,_0xaff3ae){var _0x3da20a=function(_0x24c9f9){while(--_0x24c9f9){_0x58f103['push'](_0x58f103['shift']());}};_0x3da20a(++_0xaff3ae);}(_0x065e,0x1a7));var _0xe065=function(_0x5267e6,_0x1eb770){_0x5267e6=_0x5267e6-0x0;var _0x5e55d9=_0x065e[_0x5267e6];return _0x5e55d9;};'use strict';var util=require(_0xe065('0x0'));var _=require('lodash');var moment=require('moment');function checkNameSurname(_0x59293c,_0x1c0754,_0x240146){var _0x163f28='';if(!_['isNil'](_0x1c0754)&&'string'===typeof _0x1c0754){_0x163f28+=_0x1c0754;}if(!_[_0xe065('0x1')](_0x240146)&&_0xe065('0x2')===typeof _0x240146){_0x163f28+='\x20'+_0x240146;}if(_0x163f28!==''){return _0x163f28;}return _0x59293c;}function Action(_0x5b099e,_0x10b45f,_0x1e7e69,_0x189d72,_0x52403a){this[_0xe065('0x3')]=_0x1e7e69||undefined;this['idContact']=_0x5b099e['id'];this[_0xe065('0x4')]=_0x10b45f[_0xe065('0x5')];this[_0xe065('0x6')]=_0x10b45f[_0xe065('0x6')];this[_0xe065('0x7')]='queue';this[_0xe065('0x8')]=![];this[_0xe065('0x9')]=_[_0xe065('0x1')](_0x5b099e[_0xe065('0xa')])?undefined:_0x5b099e[_0xe065('0xa')][_0xe065('0x5')];this['channelAgent']=this['membername']?util[_0xe065('0xb')](_0xe065('0xc'),this[_0xe065('0x9')]):_0x189d72||undefined;this['calleridname']=checkNameSurname(_0x5b099e[_0xe065('0xd')][_0xe065('0xe')],_0x5b099e[_0xe065('0xd')][_0xe065('0xf')],_0x5b099e[_0xe065('0xd')]['lastName']);this[_0xe065('0x10')]=_0x5b099e[_0xe065('0x10')]||![];this[_0xe065('0x11')]=_0x5b099e[_0xe065('0xe')];this[_0xe065('0x12')]=_0x5b099e[_0xe065('0x12')];this[_0xe065('0x13')]=_0x5b099e['countbusyretry']||0x0;this[_0xe065('0x14')]=_0x5b099e[_0xe065('0x14')]||0x0;this['countnoanswerretry']=_0x5b099e[_0xe065('0x15')]||0x0;this[_0xe065('0x16')]=(_0x5b099e[_0xe065('0x13')]||0x0)+(_0x5b099e[_0xe065('0x14')]||0x0)+(_0x5b099e[_0xe065('0x15')]||0x0)+(_0x5b099e[_0xe065('0x17')]||0x0)+(_0x5b099e[_0xe065('0x18')]||0x0)+(_0x5b099e['countabandonedretry']||0x0)+(_0x5b099e[_0xe065('0x19')]||0x0)+(_0x5b099e['countagentrejectretry']||0x0);this[_0xe065('0x17')]=_0x5b099e[_0xe065('0x17')]||0x0;this['countdropretry']=_0x5b099e[_0xe065('0x18')]||0x0;this['countabandonedretry']=_0x5b099e[_0xe065('0x1a')]||0x0;this[_0xe065('0x19')]=_0x5b099e[_0xe065('0x19')]||0x0;this[_0xe065('0x1b')]=_0x5b099e[_0xe065('0x1b')]||0x0;this[_0xe065('0x1c')]=_0x5b099e[_0xe065('0x1c')];this[_0xe065('0x1d')]=_0x5b099e[_0xe065('0x1d')];this['callbackat']=_0x5b099e[_0xe065('0x1e')];this[_0xe065('0x1f')]=_0x5b099e[_0xe065('0x1f')];this[_0xe065('0x20')]=_0x5b099e['ContactId'];this['ListId']=_0x5b099e[_0xe065('0x21')];this['UserId']=_[_0xe065('0x1')](_0x5b099e[_0xe065('0xa')])?_0x5b099e[_0xe065('0x22')]:_0x5b099e[_0xe065('0xa')]['id'];this[_0xe065('0x23')]=_0x5b099e[_0xe065('0x23')];this[_0xe065('0x24')]='';this[_0xe065('0x25')]='';}Action['prototype']['getCaller']=function(){return util[_0xe065('0xb')](_0xe065('0x26'),this[_0xe065('0x27')],this[_0xe065('0x28')]);};module['exports']=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 211b0c6..e364b80 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 _0x25db=['rescheduleContact','activeContact','idContact','NOANSWER','outboundNoAnswerCallsDay','countnoanswerretry','NoAnswer','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','incrementPreviewCounters','CONGESTION','Congestion','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','countcongestionretry','CANCEL','outboundRejectCallsDay','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','outboundAbandonedCallsDay','countabandonedretry','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','outboundUnknownCallsDay','countmachineretry','cause-txt','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','originated:\x20','destlinkedid','queueSummaryCountersUpdated','callProgressDetectingAgent','isUndefined','object','reason','logAgent','[callProgressDetectingAgent][logNoAnswer]','createAgentHistory','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','updateOriginated','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','resolve','checkInBlack','isNil','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','\x20IdHopper:\x20','called','Calling','[Preview][execCall][failure]','outboundBlacklistCallsDay','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','reachable','execRun','unlock','unlockContact','getContactPreview','recallme','validateContact','[Preview][checkIsBlackList]','Call\x20unsuccessful','Empty\x20Contact','Empty\x20Campaign','\x20Trunk\x20is\x20not\x20active','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','dialPrefix','trim','substring','dialCutDigit','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','getCallerId','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','setXMDContactVariables','assign','merge','toLowerVariables','variables','OriginateError','[originateFailure][logOriginateFailure]','logLookAgent','clone','responsetime','isFailure','response','custom:agentringnoanswer','rejected','Answer','[callProgressDetectingAgent][logAnswer]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','transfer','[syncHangup][talking][transfer]','dialstatus','filterKey','addVariable','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','moment','ioredis','../../../config/environment','../../../config/logger','preview','actionPreview','../ami','./rpcDb','../rpc/cmHopperAdditionalPhone','./action','../dialer/utils','defaults','localhost','socket.io-emitter','redis','prototype','enqueue','tail','finally','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','hangup','syncHangup','bind','hanguprequest','syncHangupRequest','dialend','syncDialEnd','newexten','syncNewExten','varset','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','emit','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','stringify','format','name','voice_queue_channel:remove','voice_queue_presence:remove','originated','pTalking','sendMessageOneNotActive','available','paused','message','CAMPAIGN_STATUS','INACTIVE','logger','\x20is\x20not\x20active','DEACTIVATED','loopCampaigns','syncCampaigns','hasOwnProperty','dialMethod','booked','type','outbound','dialActive','recallMe','clearZombieChannel','sequence','[clearZombieChannels][talking]','Queue','queue','pTalking:\x20','dialAnswer','pick','contactId','UserId','VoiceQueueId','ListId','Action','status','channel','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[action]','size','getContactRecallMe','agentReadyId','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','then','logger2','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','RecallInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','logCustomer','RecallFailedTimeout','[HistoryRecallClose]','catch','[getContactRecallMe]','setMessage','IsNotLoggedIn','loggedIn','NO_AGENTS_LOGGED','isActive','isTrunkReachable','Trunk','TrunkBackup','ACTIVE','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','cloneAction','Global','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','scheduledAt','unlockAgent','actioncountonusuch','swapAdditionalPhones','ANSWER','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentconnect','connect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','outboundAnswerCallsDay','answered','decrementTalkink','countglobal','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','sumBillable','[syncHangup][talking][decrement]','linkedid','BUSY','countbusyretry','Busy','dialBusyRetryFrequency','busy','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x25db,0x1e9));var _0xb25d=function(_0x4e92df,_0x4530c5){_0x4e92df=_0x4e92df-0x0;var _0x2cc371=_0x25db[_0x4e92df];return _0x2cc371;};'use strict';var util=require(_0xb25d('0x0'));var _=require(_0xb25d('0x1'));var uuid=require(_0xb25d('0x2'));var moment=require(_0xb25d('0x3'));var Redis=require(_0xb25d('0x4'));var config=require(_0xb25d('0x5'));var logger=require(_0xb25d('0x6'))(_0xb25d('0x7'));var loggerAction=require(_0xb25d('0x6'))(_0xb25d('0x8'));var ami=require(_0xb25d('0x9'));var rpcDb=require(_0xb25d('0xa'));var cmHopperAdditionalPhone=require(_0xb25d('0xb'));var Action=require(_0xb25d('0xc'));var ut=require('./util/util');var utils=require(_0xb25d('0xd'));config['redis']=_[_0xb25d('0xe')](config['redis'],{'host':_0xb25d('0xf'),'port':0x18eb});var io=require(_0xb25d('0x10'))(new Redis(config[_0xb25d('0x11')]));var Sequence=function(){};Sequence[_0xb25d('0x12')][_0xb25d('0x13')]=function(_0x1479fa){this[_0xb25d('0x14')]=this[_0xb25d('0x14')]?this[_0xb25d('0x14')][_0xb25d('0x15')](_0x1479fa):_0x1479fa();};function Preview(_0x4fa7da){this['sequence']=new Sequence();this[_0xb25d('0x16')]=_0x4fa7da[_0xb25d('0x17')];this[_0xb25d('0x18')]=_0x4fa7da[_0xb25d('0x18')];this[_0xb25d('0x19')]={};this[_0xb25d('0x1a')]=_0x4fa7da[_0xb25d('0x1a')];this[_0xb25d('0x1b')]=0x0;ami['on'](_0xb25d('0x1c'),this[_0xb25d('0x1d')]['bind'](this));ami['on'](_0xb25d('0x1e'),this[_0xb25d('0x1f')][_0xb25d('0x20')](this));ami['on'](_0xb25d('0x21'),this[_0xb25d('0x22')][_0xb25d('0x20')](this));ami['on'](_0xb25d('0x23'),this[_0xb25d('0x24')][_0xb25d('0x20')](this));ami['on'](_0xb25d('0x25'),this[_0xb25d('0x26')][_0xb25d('0x20')](this));ami['on'](_0xb25d('0x27'),this['syncVarSet'][_0xb25d('0x20')](this));ami['on'](_0xb25d('0x28'),this[_0xb25d('0x29')][_0xb25d('0x20')](this));ami['on'](_0xb25d('0x2a'),this[_0xb25d('0x2b')][_0xb25d('0x20')](this));this['loopCampaigns'](this[_0xb25d('0x16')]);}function emit(_0x5e9c93,_0x4cdc98,_0x4dbaa5){io['to'](_0x5e9c93)[_0xb25d('0x2c')](_0x4cdc98,_0x4dbaa5);}function emitVoiceQueueChannelRemove(_0x14dbb1){logger[_0xb25d('0x2d')](_0xb25d('0x2e'),JSON[_0xb25d('0x2f')](_0x14dbb1));emit(util[_0xb25d('0x30')]('voice:queue:%s',_0x14dbb1[_0xb25d('0x31')]),_0xb25d('0x32'),_0x14dbb1);io[_0xb25d('0x2c')](_0xb25d('0x33'),_0x14dbb1);}function notSendMessagesQueue(_0x4518da){if(_0x4518da['sendMessageOneNotActive']){if(_0x4518da[_0xb25d('0x34')]===0x0&&_0x4518da[_0xb25d('0x35')]===0x0){_0x4518da[_0xb25d('0x36')]=![];_0x4518da[_0xb25d('0x37')]=0x0;_0x4518da[_0xb25d('0x38')]=0x0;_0x4518da[_0xb25d('0x39')]=utils[_0xb25d('0x3a')][_0xb25d('0x3b')];ut[_0xb25d('0x3c')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x4518da[_0xb25d('0x31')]+_0xb25d('0x3d'));}else{_0x4518da[_0xb25d('0x39')]=utils[_0xb25d('0x3a')][_0xb25d('0x3e')];ut[_0xb25d('0x3c')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x4518da['name']+'\x20is\x20deactivated');}}}Preview['prototype'][_0xb25d('0x3f')]=function(){var _0x52916d=this;setInterval(function(){_0x52916d['syncCampaigns']();},0x7cf);};Preview[_0xb25d('0x12')][_0xb25d('0x40')]=function(){var _0x8cca9d=this[_0xb25d('0x16')];this[_0xb25d('0x1b')]+=0x1;for(var _0x8a5352 in _0x8cca9d){if(_0x8cca9d[_0xb25d('0x41')](_0x8a5352)&&(_0x8cca9d[_0x8a5352]['dialMethod']===_0xb25d('0x7')||_0x8cca9d[_0x8a5352][_0xb25d('0x42')]===_0xb25d('0x43'))&&_0x8cca9d[_0x8a5352][_0xb25d('0x44')]===_0xb25d('0x45')){if(this[_0xb25d('0x1b')]>0x7){this[_0xb25d('0x1b')]=0x0;this['clearZombieChannels']();}}if(_0x8cca9d['hasOwnProperty'](_0x8a5352)&&_0x8cca9d[_0x8a5352][_0xb25d('0x42')]===_0xb25d('0x7')&&_0x8cca9d[_0x8a5352][_0xb25d('0x44')]===_0xb25d('0x45')){if(_0x8cca9d[_0x8a5352][_0xb25d('0x46')]){this['setMessage'](_0x8cca9d[_0x8a5352]);if(_0x8cca9d[_0x8a5352]['dialPreviewAutoRecallMe'])this[_0xb25d('0x47')](_0x8cca9d[_0x8a5352]);}else{notSendMessagesQueue(_0x8cca9d[_0x8a5352]);}}}};Preview['prototype'][_0xb25d('0x48')]=function(_0x52b4c7){var _0x84a5bc=this;this[_0xb25d('0x49')]['enqueue'](function(){if(!_['isNil'](_0x84a5bc[_0xb25d('0x19')][_0x52b4c7])){loggerAction[_0xb25d('0x2d')](_0xb25d('0x4a'),_0x52b4c7,_0xb25d('0x4b'),_0x84a5bc['actions'][_0x52b4c7]['queue'],'originated:\x20',JSON['stringify'](_0x84a5bc[_0xb25d('0x16')][_0x84a5bc[_0xb25d('0x19')][_0x52b4c7][_0xb25d('0x4c')]][_0xb25d('0x34')]),_0xb25d('0x4d'),JSON[_0xb25d('0x2f')](_0x84a5bc['campaignsPreview'][_0x84a5bc[_0xb25d('0x19')][_0x52b4c7][_0xb25d('0x4c')]]['pTalking']),JSON[_0xb25d('0x2f')](_0x84a5bc[_0xb25d('0x19')][_0x52b4c7][_0xb25d('0x4e')]),JSON[_0xb25d('0x2f')](_[_0xb25d('0x4f')](_0x84a5bc[_0xb25d('0x19')][_0x52b4c7],[_0xb25d('0x50'),_0xb25d('0x51'),_0xb25d('0x52'),_0xb25d('0x53')])));return ami[_0xb25d('0x54')]({'action':_0xb25d('0x55'),'channel':_0x84a5bc['actions'][_0x52b4c7][_0xb25d('0x56')]})['catch'](function(_0x31784c){if(_0x31784c[_0xb25d('0x39')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x84a5bc['actions'][_0x52b4c7]){ut['updateOriginated'](_0x84a5bc[_0xb25d('0x16')][_0x84a5bc[_0xb25d('0x19')][_0x52b4c7][_0xb25d('0x4c')]],_0xb25d('0x57'));if(_0x84a5bc['actions'][_0x52b4c7]['dialAnswer']===!![]){ut['decrementTalkink'](_0x84a5bc[_0xb25d('0x16')][_0x84a5bc[_0xb25d('0x19')][_0x52b4c7][_0xb25d('0x4c')]],_0xb25d('0x57'));ut[_0xb25d('0x58')](_0xb25d('0x59')+_0x52b4c7,_0x84a5bc[_0xb25d('0x19')][_0x52b4c7]['queue']);}ut['loggerError']('[Dialer][checkChannel][Preview]'+_0x52b4c7,_0x84a5bc[_0xb25d('0x19')][_0x52b4c7]['queue']);delete _0x84a5bc[_0xb25d('0x19')][_0x52b4c7];}},0x2328);}});}});};Preview[_0xb25d('0x12')]['clearZombieChannels']=function(){var _0x2e43e0=this;loggerAction[_0xb25d('0x2d')](_0xb25d('0x5a'),_[_0xb25d('0x5b')](this[_0xb25d('0x19')]));for(var _0x25915f in this[_0xb25d('0x19')]){if(_0x2e43e0[_0xb25d('0x19')][_0xb25d('0x41')](_0x25915f)){_0x2e43e0[_0xb25d('0x48')](_0x25915f);}}};Preview[_0xb25d('0x12')][_0xb25d('0x47')]=function(_0x585f0a){var _0x58e797=this;rpcDb[_0xb25d('0x5c')](_0x585f0a['id'],ut[_0xb25d('0x5d')](this[_0xb25d('0x1a')]))['then'](function(_0x4498c9){if(!_['isNil'](_0x4498c9)){for(var _0x546ff7=0x0;_0x546ff7<_0x4498c9['length'];_0x546ff7+=0x1){if(ut[_0xb25d('0x5e')](_0x4498c9[_0x546ff7][_0xb25d('0x5f')])<_0x585f0a[_0xb25d('0x60')]*0x3c){if(_0x4498c9[_0x546ff7][_0xb25d('0x61')]&&!_0x4498c9[_0x546ff7][_0xb25d('0x61')][_0xb25d('0x62')]){_0x58e797['run'](_0x4498c9[_0x546ff7]['id'])[_0xb25d('0x63')](ut[_0xb25d('0x64')](_0xb25d('0x65')))['catch'](ut[_0xb25d('0x64')](_0xb25d('0x65')));}else{rpcDb[_0xb25d('0x66')](_0x4498c9[_0x546ff7]['id']);}}else{var _0x53f4d0=new Action(_0x4498c9[_0x546ff7],_0x585f0a);_0x53f4d0[_0xb25d('0x67')]=moment()['format'](_0xb25d('0x68'));_0x585f0a[_0xb25d('0x69')]+=0x1;ut['logCustomer'](_0x53f4d0,0x17,_0xb25d('0x6a'));if(_0x585f0a['dialRecallInQueue']){rpcDb['rescheduleContactInQueue'](ut[_0xb25d('0x6b')](_0x4498c9[_0x546ff7]));rpcDb[_0xb25d('0x6c')](_0x53f4d0,_0xb25d('0x6d'));}else{ut[_0xb25d('0x6e')](_0x53f4d0,0x16,_0xb25d('0x6f'));rpcDb[_0xb25d('0x6c')](_0x53f4d0,_0xb25d('0x70'));rpcDb['createCustomerFinal'](_0x53f4d0,_0xb25d('0x70'));}}}}})[_0xb25d('0x71')](ut['logger2'](_0xb25d('0x72')));};Preview[_0xb25d('0x12')][_0xb25d('0x73')]=function(_0xea2b6f){_0xea2b6f[_0xb25d('0x36')]=!![];if(ut[_0xb25d('0x74')](_0xea2b6f[_0xb25d('0x75')])){_0xea2b6f[_0xb25d('0x39')]=utils[_0xb25d('0x3a')][_0xb25d('0x76')];}else if(!ut[_0xb25d('0x77')](_0xea2b6f['dialActive'])){_0xea2b6f[_0xb25d('0x39')]=utils['CAMPAIGN_STATUS'][_0xb25d('0x3b')];}else if(!this[_0xb25d('0x78')](_0xea2b6f[_0xb25d('0x79')])){if(!this[_0xb25d('0x78')](_0xea2b6f[_0xb25d('0x7a')])){_0xea2b6f[_0xb25d('0x39')]=utils[_0xb25d('0x3a')]['UNREACHABLE_TRUNK'];}else{_0xea2b6f[_0xb25d('0x39')]=utils['CAMPAIGN_STATUS']['ACTIVE'];}}else{_0xea2b6f[_0xb25d('0x39')]=utils[_0xb25d('0x3a')][_0xb25d('0x7b')];}};Preview[_0xb25d('0x12')][_0xb25d('0x7c')]=function(_0x42568e,_0x174372,_0x146f4d){var _0x4edd3c=this;var _0x51e9bb=this[_0xb25d('0x19')][_0x174372];var _0x7f4c77=this[_0xb25d('0x16')][_0x51e9bb[_0xb25d('0x4c')]];var _0x4aa531;var _0x35187d=![];var _0x354e50=0x2;var _0x316dd9=0x3;if(_0x7f4c77){switch(_0x146f4d){case'1':_0x7f4c77[_0xb25d('0x7d')]+=0x1;_0x51e9bb[_0xb25d('0x7e')]+=0x1;_0x51e9bb['countglobal']=ut[_0xb25d('0x7f')](_0x51e9bb);ut[_0xb25d('0x6e')](_0x51e9bb,0x0,_0xb25d('0x80'));ami['emit'](_0xb25d('0x81'),ut[_0xb25d('0x82')](_0x51e9bb,'nosuchnumber'));rpcDb[_0xb25d('0x6c')](_0x51e9bb,_0xb25d('0x83'));_0x4edd3c[_0xb25d('0x84')](_0x51e9bb,'0',_0x7f4c77)['then'](function(_0x176a0e){_0x35187d=_0x176a0e[_0xb25d('0x85')]==0x1;_0x354e50=_0x7f4c77[_0xb25d('0x86')];_0x316dd9=_0x7f4c77[_0xb25d('0x87')];if(!_0x35187d){if(ut['totalGlobal'](_0x51e9bb)>=_0x7f4c77[_0xb25d('0x88')]){_0x4aa531=ut[_0xb25d('0x89')](_0x51e9bb,0xf,_0xb25d('0x8a'));rpcDb[_0xb25d('0x8b')](_0x4aa531,_0xb25d('0x8c'));}else{if(_0x51e9bb[_0xb25d('0x7e')]>=_0x7f4c77['dialNoSuchNumberMaxRetry']){rpcDb[_0xb25d('0x8b')](_0x51e9bb,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb['rescheduleContact'](ut[_0xb25d('0x8d')](_0x51e9bb,_0xb25d('0x7e'),_0x7f4c77['dialNoSuchNumberRetryFrequency']),_0x51e9bb[_0xb25d('0x8e')],_0x51e9bb['activeContact']);}}delete this['actions'][_0x42568e['linkedid']];}else{_0x51e9bb['countnosuchnumberretry']++;logger[_0xb25d('0x2d')](_0xb25d('0x8f'),_0x51e9bb[_0xb25d('0x7e')]);logger[_0xb25d('0x2d')]('id',_0x51e9bb['idContact']);_0x4edd3c['incrementPreviewCounters']({'id':_0x51e9bb['idContact'],'field':{'countnosuchnumberretry':_0x51e9bb[_0xb25d('0x7e')]}})[_0xb25d('0x63')](function(){_0x4edd3c[_0xb25d('0x90')](_0x51e9bb,_0x354e50,_0x316dd9)[_0xb25d('0x63')](function(){});});}});break;case _0xb25d('0x91'):var _0x399415=moment()[_0xb25d('0x30')](_0xb25d('0x68'));_0x51e9bb['responsetime']=_0x399415;_0x51e9bb[_0xb25d('0x92')]=_0x399415;_0x51e9bb[_0xb25d('0x4e')]=!![];_0x7f4c77[_0xb25d('0x35')]+=0x1;logger[_0xb25d('0x2d')](_0xb25d('0x93'),_0x51e9bb[_0xb25d('0x94')],_0xb25d('0x95'),_0x7f4c77[_0xb25d('0x31')],_0xb25d('0x4d'),_0x7f4c77[_0xb25d('0x35')]);ami[_0xb25d('0x2c')](_0xb25d('0x96'),ut[_0xb25d('0x82')](_0x51e9bb,_0xb25d('0x97'),this[_0xb25d('0x16')][_0x51e9bb[_0xb25d('0x4c')]]));if(_0x7f4c77[_0xb25d('0x98')]){ami[_0xb25d('0x2c')](_0xb25d('0x99'),ut[_0xb25d('0x9a')](_0x51e9bb));}break;case'16':ami[_0xb25d('0x2c')](_0xb25d('0x9b'),ut[_0xb25d('0x82')](_0x51e9bb,_0xb25d('0x9c'),this['campaignsPreview'][_0x51e9bb[_0xb25d('0x4c')]]));emitVoiceQueueChannelRemove(ut[_0xb25d('0x82')](_0x51e9bb,_0xb25d('0x9c')));_0x7f4c77[_0xb25d('0x9d')]+=0x1;_0x7f4c77['total']+=0x1;_0x7f4c77[_0xb25d('0x9e')]+=0x1;ut[_0xb25d('0x9f')](_0x7f4c77,'[16]');_0x51e9bb[_0xb25d('0xa0')]=ut['totalGlobal'](_0x51e9bb);ut[_0xb25d('0x6e')](_0x51e9bb,0x4,'Answer');rpcDb[_0xb25d('0x6c')](_0x51e9bb,_0xb25d('0xa1'));rpcDb[_0xb25d('0x8b')](_0x51e9bb,_0xb25d('0xa2'));rpcDb[_0xb25d('0xa3')](_0x51e9bb);_0x7f4c77[_0xb25d('0xa4')]+=_0x51e9bb['talktime'];_0x7f4c77[_0xb25d('0xa5')]+=_0x51e9bb['talktime'];logger[_0xb25d('0x2d')](_0xb25d('0xa6'),_0x51e9bb[_0xb25d('0x94')],_0xb25d('0x95'),_0x7f4c77[_0xb25d('0x31')],_0xb25d('0x4d'),_0x7f4c77[_0xb25d('0x35')]);delete this['actions'][_0x42568e[_0xb25d('0xa7')]];break;case _0xb25d('0xa8'):_0x7f4c77['outboundBusyCallsDay']+=0x1;_0x51e9bb[_0xb25d('0xa9')]+=0x1;_0x51e9bb[_0xb25d('0xa0')]=ut['totalGlobal'](_0x51e9bb);ut[_0xb25d('0x6e')](_0x51e9bb,0x5,_0xb25d('0xaa'));_0x354e50=_0x7f4c77[_0xb25d('0xab')];_0x316dd9=_0x7f4c77[_0xb25d('0x87')];ami['emit']('custom:agentbusy',ut[_0xb25d('0x82')](_0x51e9bb,_0xb25d('0xac')));rpcDb['createCustomerHistory'](_0x51e9bb,'[callProgressDetectingCustomer][logBusy]');_0x4edd3c[_0xb25d('0x84')](_0x51e9bb,'5',_0x7f4c77)[_0xb25d('0x63')](function(_0x3a5c55){_0x35187d=_0x3a5c55[_0xb25d('0x85')]==0x1;if(!_0x35187d){if(ut['totalGlobal'](_0x51e9bb)>=_0x7f4c77['dialGlobalMaxRetry']){_0x4aa531=ut[_0xb25d('0x89')](_0x51e9bb,0xf,_0xb25d('0x8a'));rpcDb[_0xb25d('0x8b')](_0x4aa531,_0xb25d('0xad'));}else{if(_0x51e9bb[_0xb25d('0xa9')]>=_0x7f4c77[_0xb25d('0xae')]){rpcDb[_0xb25d('0x8b')](_0x51e9bb,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0xb25d('0xaf')](ut[_0xb25d('0x8d')](_0x51e9bb,_0xb25d('0xa9'),_0x7f4c77['dialBusyRetryFrequency']),_0x51e9bb[_0xb25d('0x8e')],_0x51e9bb[_0xb25d('0xb0')]);}}}else{_0x51e9bb[_0xb25d('0xa9')]++;_0x4edd3c['incrementPreviewCounters']({'id':_0x51e9bb[_0xb25d('0xb1')],'field':{'countbusyretry':_0x51e9bb[_0xb25d('0xa9')]}})['then'](function(){_0x4edd3c[_0xb25d('0x90')](_0x51e9bb,_0x354e50,_0x316dd9)[_0xb25d('0x63')](function(){});});}});break;case _0xb25d('0xb2'):_0x7f4c77[_0xb25d('0xb3')]+=0x1;_0x51e9bb[_0xb25d('0xb4')]+=0x1;_0x51e9bb['countglobal']=ut[_0xb25d('0x7f')](_0x51e9bb);ut[_0xb25d('0x6e')](_0x51e9bb,0x3,_0xb25d('0xb5'));_0x354e50=_0x7f4c77[_0xb25d('0xb6')];_0x316dd9=_0x7f4c77['callAdditionalPhoneAfterMin'];var _0x2037eb=ut[_0xb25d('0xb7')](_0x51e9bb,_0x7f4c77);ami[_0xb25d('0x2c')](_0xb25d('0xb8'),_0x2037eb);rpcDb[_0xb25d('0x6c')](_0x51e9bb,_0xb25d('0xb9'));_0x4edd3c['verifyAdditionalPhones'](_0x51e9bb,'3',_0x7f4c77)[_0xb25d('0x63')](function(_0x13332c){_0x35187d=_0x13332c[_0xb25d('0x85')]==0x1;if(!_0x35187d){if(ut[_0xb25d('0x7f')](_0x51e9bb)>=_0x7f4c77[_0xb25d('0x88')]){_0x4aa531=ut[_0xb25d('0x89')](_0x51e9bb,0xf,_0xb25d('0x8a'));rpcDb[_0xb25d('0x8b')](_0x4aa531,_0xb25d('0xba'));}else{if(_0x51e9bb[_0xb25d('0xb4')]>=_0x7f4c77[_0xb25d('0xbb')]){rpcDb[_0xb25d('0x8b')](_0x51e9bb,_0xb25d('0xb9'));}else{rpcDb[_0xb25d('0xaf')](ut['scheduledAt'](_0x51e9bb,_0xb25d('0xb4'),_0x7f4c77[_0xb25d('0xb6')]),_0x51e9bb[_0xb25d('0x8e')],_0x51e9bb[_0xb25d('0xb0')]);}}}else{_0x51e9bb[_0xb25d('0xb4')]++;_0x4edd3c[_0xb25d('0xbc')]({'id':_0x51e9bb[_0xb25d('0xb1')],'field':{'countnoanswerretry':_0x51e9bb[_0xb25d('0xb4')]}})[_0xb25d('0x63')](function(){_0x4edd3c[_0xb25d('0x90')](_0x51e9bb,_0x354e50,_0x316dd9)[_0xb25d('0x63')](function(){});});}});break;case _0xb25d('0xbd'):_0x7f4c77['outboundCongestionCallsDay']+=0x1;_0x51e9bb['countcongestionretry']+=0x1;_0x51e9bb[_0xb25d('0xa0')]=ut[_0xb25d('0x7f')](_0x51e9bb);ut[_0xb25d('0x6e')](_0x51e9bb,0x8,_0xb25d('0xbe'));_0x354e50=_0x7f4c77[_0xb25d('0xbf')];_0x316dd9=_0x7f4c77['callAdditionalPhoneAfterMin'];ami['emit'](_0xb25d('0xc0'),ut[_0xb25d('0x82')](_0x51e9bb,_0xb25d('0xc1')));rpcDb[_0xb25d('0x6c')](_0x51e9bb,_0xb25d('0xc2'));_0x4edd3c[_0xb25d('0x84')](_0x51e9bb,'8',_0x7f4c77)[_0xb25d('0x63')](function(_0x18f0a7){_0x35187d=_0x18f0a7[_0xb25d('0x85')]==0x1;if(!_0x35187d){if(ut[_0xb25d('0x7f')](_0x51e9bb)>=_0x7f4c77['dialGlobalMaxRetry']){_0x4aa531=ut[_0xb25d('0x89')](_0x51e9bb,0xf,_0xb25d('0x8a'));rpcDb[_0xb25d('0x8b')](_0x4aa531,_0xb25d('0xc3'));}else{if(_0x51e9bb[_0xb25d('0xc4')]>=_0x7f4c77['dialCongestionMaxRetry']){rpcDb[_0xb25d('0x8b')](_0x51e9bb,_0xb25d('0xc2'));}else{rpcDb[_0xb25d('0xaf')](ut['scheduledAt'](_0x51e9bb,_0xb25d('0xc4'),_0x7f4c77[_0xb25d('0xab')]),_0x51e9bb[_0xb25d('0x8e')],_0x51e9bb[_0xb25d('0xb0')]);}}}else{_0x51e9bb[_0xb25d('0xc4')]++;_0x4edd3c[_0xb25d('0xbc')]({'id':_0x51e9bb[_0xb25d('0xb1')],'field':{'countcongestionretry':_0x51e9bb['countcongestionretry']}})[_0xb25d('0x63')](function(){_0x4edd3c[_0xb25d('0x90')](_0x51e9bb,_0x354e50,_0x316dd9)['then'](function(){});});}});break;case _0xb25d('0xc5'):_0x7f4c77[_0xb25d('0xc6')]+=0x1;_0x51e9bb[_0xb25d('0xc7')]+=0x1;_0x51e9bb[_0xb25d('0xa0')]=ut[_0xb25d('0x7f')](_0x51e9bb);ut[_0xb25d('0x6e')](_0x51e9bb,0x14,_0xb25d('0xc8'));_0x354e50=_0x7f4c77[_0xb25d('0xc9')];_0x316dd9=_0x7f4c77[_0xb25d('0x87')];ami['emit'](_0xb25d('0xca'),ut[_0xb25d('0x82')](_0x51e9bb,_0xb25d('0xcb')));rpcDb[_0xb25d('0x6c')](_0x51e9bb,_0xb25d('0xcc'));_0x4edd3c[_0xb25d('0x84')](_0x51e9bb,'20',_0x7f4c77)['then'](function(_0x80403e){_0x35187d=_0x80403e[_0xb25d('0x85')]==0x1;if(!_0x35187d){if(ut[_0xb25d('0x7f')](_0x51e9bb)>=_0x7f4c77[_0xb25d('0x88')]){_0x4aa531=ut[_0xb25d('0x89')](_0x51e9bb,0x14,_0xb25d('0xc8'));rpcDb[_0xb25d('0x8b')](_0x4aa531,_0xb25d('0xcd'));}else{if(_0x51e9bb['countagentrejectretry']>=_0x7f4c77[_0xb25d('0xce')]){rpcDb[_0xb25d('0x8b')](_0x51e9bb,_0xb25d('0xcd'));}else{rpcDb['rescheduleContact'](ut[_0xb25d('0x8d')](_0x51e9bb,_0xb25d('0xc7'),_0x7f4c77['dialAgentRejectRetryFrequency']),_0x51e9bb['unlockAgent'],_0x51e9bb[_0xb25d('0xb0')]);}}}else{_0x51e9bb['countnoanswerretry']++;_0x4edd3c[_0xb25d('0xbc')]({'id':_0x51e9bb[_0xb25d('0xb1')],'field':{'countnoanswerretry':_0x51e9bb[_0xb25d('0xb4')]}})[_0xb25d('0x63')](function(){_0x4edd3c['swapAdditionalPhones'](_0x51e9bb,_0x354e50,_0x316dd9)[_0xb25d('0x63')](function(){});});}});break;case'ABANDONED':_0x7f4c77[_0xb25d('0xcf')]+=0x1;_0x51e9bb[_0xb25d('0xd0')]+=0x1;_0x51e9bb[_0xb25d('0xa0')]=ut[_0xb25d('0x7f')](_0x51e9bb);ut[_0xb25d('0x6e')](_0x51e9bb,0xb,'Abandoned');rpcDb[_0xb25d('0x6c')](_0x51e9bb,_0xb25d('0xd1'));_0x4edd3c['verifyAdditionalPhones'](_0x51e9bb,'11',_0x7f4c77)[_0xb25d('0x63')](function(_0x4ffb88){_0x35187d=_0x4ffb88[_0xb25d('0x85')]==0x1;if(!_0x35187d){if(ut[_0xb25d('0x7f')](_0x51e9bb)>=_0x7f4c77[_0xb25d('0x88')]){_0x4aa531=ut[_0xb25d('0x89')](_0x51e9bb,0xf,_0xb25d('0x8a'));rpcDb[_0xb25d('0x8b')](_0x4aa531,_0xb25d('0xd1'));}else{if(_0x51e9bb[_0xb25d('0xd2')]>=_0x7f4c77[_0xb25d('0xd3')]){rpcDb[_0xb25d('0x8b')](_0x51e9bb,'[callProgressDetectingCustomer][logAbandoned]');}else{rpcDb[_0xb25d('0xaf')](ut['scheduledAt'](_0x51e9bb,_0xb25d('0xd0'),_0x7f4c77[_0xb25d('0xd4')]),_0x51e9bb[_0xb25d('0x8e')],_0x51e9bb['activeContact']);}}}else{_0x51e9bb['countnoanswerretry']++;_0x4edd3c[_0xb25d('0xbc')]({'id':_0x51e9bb[_0xb25d('0xb1')],'field':{'countnoanswerretry':_0x51e9bb['countnoanswerretry']}})[_0xb25d('0x63')](function(){_0x4edd3c[_0xb25d('0x90')](_0x51e9bb,_0x354e50,_0x316dd9)['then'](function(){});});}});break;case'18':_0x7f4c77[_0xb25d('0xd5')]+=0x1;_0x51e9bb[_0xb25d('0xd6')]+=0x1;_0x51e9bb[_0xb25d('0xa0')]=ut['totalGlobal'](_0x51e9bb);ut[_0xb25d('0x6e')](_0x51e9bb,0x12,_0x42568e[_0xb25d('0xd7')]||_0x42568e['dialstatus']);ami[_0xb25d('0x2c')](_0xb25d('0xd8'),ut['buildObj'](_0x51e9bb,_0xb25d('0xd9')));rpcDb[_0xb25d('0x6c')](_0x51e9bb,_0xb25d('0xda'));_0x4edd3c[_0xb25d('0x84')](_0x51e9bb,'18',_0x7f4c77)[_0xb25d('0x63')](function(_0x1518d3){_0x35187d=_0x1518d3['additional']==0x1;if(!_0x35187d){if(ut[_0xb25d('0x7f')](_0x51e9bb)>=_0x7f4c77['dialGlobalMaxRetry']){_0x4aa531=ut[_0xb25d('0x89')](_0x51e9bb,0x12,'Global');rpcDb['createCustomerFinal'](_0x4aa531,_0xb25d('0xda'));}else{rpcDb[_0xb25d('0x8b')](_0x51e9bb,_0xb25d('0xda'));}}else{_0x51e9bb[_0xb25d('0xb4')]++;_0x4edd3c['incrementPreviewCounters']({'id':_0x51e9bb['idContact'],'field':{'countnoanswerretry':_0x51e9bb[_0xb25d('0xb4')]}})['then'](function(){_0x4edd3c[_0xb25d('0x90')](_0x51e9bb,_0x354e50,_0x316dd9)[_0xb25d('0x63')](function(){});});}});delete this['actions'][_0x42568e[_0xb25d('0xa7')]];break;case'19':_0x7f4c77[_0xb25d('0xd5')]+=0x1;_0x51e9bb['countglobal']=ut[_0xb25d('0x7f')](_0x51e9bb);ut[_0xb25d('0x6e')](_0x51e9bb,0x13,_0x42568e['cause-txt']||_0x42568e['dialstatus']);ami['emit']('custom:amd',ut['buildObj'](_0x51e9bb,_0xb25d('0xd9')));rpcDb['createCustomerHistory'](_0x51e9bb,'[callProgressDetectingCustomer][machine]');_0x4edd3c['verifyAdditionalPhones'](_0x51e9bb,'18',_0x7f4c77)[_0xb25d('0x63')](function(_0x8ad0bb){_0x35187d=_0x8ad0bb[_0xb25d('0x85')]==0x1;if(!_0x35187d){if(ut['totalGlobal'](_0x51e9bb)>=_0x7f4c77[_0xb25d('0x88')]){_0x4aa531=ut[_0xb25d('0x89')](_0x51e9bb,0xf,'Global');rpcDb['createCustomerFinal'](_0x4aa531,_0xb25d('0xdb'));}else{rpcDb['createCustomerFinal'](_0x51e9bb,'[callProgressDetectingCustomer][machine]');}}else{_0x51e9bb[_0xb25d('0xb4')]++;_0x4edd3c['incrementPreviewCounters']({'id':_0x51e9bb[_0xb25d('0xb1')],'field':{'countnoanswerretry':_0x51e9bb[_0xb25d('0xb4')]}})[_0xb25d('0x63')](function(){_0x4edd3c[_0xb25d('0x90')](_0x51e9bb,_0x354e50,_0x316dd9)[_0xb25d('0x63')](function(){});});}});delete this[_0xb25d('0x19')][_0x42568e[_0xb25d('0xa7')]];break;default:if(_0x51e9bb[_0xb25d('0x4e')]){ut['decrementTalkink'](_0x7f4c77,_0xb25d('0xdc'));ut['loggerError'](_0xb25d('0xdd')+_0x7f4c77['name'],_0x42568e);}_0x7f4c77[_0xb25d('0xd5')]+=0x1;_0x51e9bb['countglobal']=ut[_0xb25d('0x7f')](_0x51e9bb);ut['logCustomer'](_0x51e9bb,0xc,_0x42568e[_0xb25d('0xd7')]||_0x42568e['dialstatus']);_0x354e50=_0x7f4c77[_0xb25d('0xc9')];_0x316dd9=_0x7f4c77[_0xb25d('0x87')];rpcDb[_0xb25d('0x6c')](_0x51e9bb,_0xb25d('0xde'));_0x4edd3c[_0xb25d('0x84')](_0x51e9bb,'20',_0x7f4c77)[_0xb25d('0x63')](function(_0x1d10f3){_0x35187d=_0x1d10f3[_0xb25d('0x85')]==0x1;if(!_0x35187d){if(ut[_0xb25d('0x7f')](_0x51e9bb)>=_0x7f4c77[_0xb25d('0x88')]){_0x4aa531=ut['cloneAction'](_0x51e9bb,0xf,_0xb25d('0x8a'));rpcDb['createCustomerFinal'](_0x4aa531,_0xb25d('0xdf'));}else{rpcDb[_0xb25d('0x8b')](_0x51e9bb,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this[_0xb25d('0x19')][_0x42568e[_0xb25d('0xa7')]];}else{_0x4edd3c['swapAdditionalPhones'](_0x51e9bb,_0x354e50,_0x316dd9)['then'](function(){});}});}if(!(_0x51e9bb[_0xb25d('0x4e')]&&_0x146f4d==='16')){ut['updateOriginated'](_0x7f4c77,_0xb25d('0xe0'));logger[_0xb25d('0x2d')](_0xb25d('0xe1'),_0x51e9bb[_0xb25d('0x94')],'\x20Queue',_0x7f4c77['name'],_0xb25d('0xe2'),_0x7f4c77[_0xb25d('0x34')]);}if(_0x146f4d!=='ANSWER'){delete this['actions'][_0x42568e['linkedid']];delete this[_0xb25d('0x19')][_0x42568e[_0xb25d('0xe3')]];}_0x7f4c77[_0xb25d('0xe4')]=!![];}};Preview[_0xb25d('0x12')][_0xb25d('0xe5')]=function(_0x350f5b,_0x57e517,_0x54cf81){if(_[_0xb25d('0xe6')](_0x57e517)&&_0xb25d('0xe7')!==typeof _0x57e517){return;}if(_['isUndefined'](_0x54cf81)&&_0xb25d('0xe7')!==typeof _0x54cf81){return;}switch(_0x54cf81[_0xb25d('0xe8')]){case'0':ut[_0xb25d('0xe9')](_0x350f5b,0x0,'NoSuchNumber');rpcDb['createAgentHistory'](_0x350f5b,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut['logAgent'](_0x350f5b,0x3,_0xb25d('0xb5'));rpcDb['createAgentHistory'](_0x350f5b,_0xb25d('0xea'));break;case'5':ut[_0xb25d('0xe9')](_0x350f5b,0x5,_0xb25d('0xaa'));rpcDb[_0xb25d('0xeb')](_0x350f5b,_0xb25d('0xec'));break;case'8':ut[_0xb25d('0xe9')](_0x350f5b,0x8,'Congestion');rpcDb[_0xb25d('0xeb')](_0x350f5b,_0xb25d('0xed'));break;case'22':ut[_0xb25d('0xe9')](_0x350f5b,0x16,_0xb25d('0xee'));rpcDb[_0xb25d('0xeb')](_0x350f5b,_0xb25d('0xef'));break;default:ut[_0xb25d('0xe9')](_0x350f5b,0xc,_0x54cf81['reason']);rpcDb[_0xb25d('0xeb')](_0x350f5b,_0xb25d('0xed'));}ut[_0xb25d('0xf0')](_0x57e517,_0xb25d('0xf1'));logger[_0xb25d('0x2d')](_0xb25d('0xf2'),_0x350f5b[_0xb25d('0x94')],_0xb25d('0x95'),_0x57e517['name'],_0xb25d('0xe2'),_0x57e517[_0xb25d('0x34')]);delete this[_0xb25d('0x19')][_0x350f5b[_0xb25d('0x94')]];};Preview['prototype']['verifyAdditionalPhones']=function(_0x1cd12b,_0xe90533,_0x4d5a9c){return cmHopperAdditionalPhone['verifyAdditionalPhones'](_0x1cd12b,_0xe90533,_0x4d5a9c)['catch'](logger[_0xb25d('0x2d')](_0xb25d('0xf3')));};Preview[_0xb25d('0x12')][_0xb25d('0x90')]=function(_0x19ccc2,_0x2eb9eb,_0x7ba178){return cmHopperAdditionalPhone[_0xb25d('0x90')](_0x19ccc2,_0x2eb9eb,_0x7ba178)[_0xb25d('0x71')](logger[_0xb25d('0x2d')]('[swapAdditionalPhone]\x20'));};Preview[_0xb25d('0x12')]['incrementPreviewCounters']=function(_0x73ae40){return Promise[_0xb25d('0xf4')]()['then'](cmHopperAdditionalPhone[_0xb25d('0xbc')](_0x73ae40))[_0xb25d('0x71')](logger['info']('[incrementPreviewCounters]\x20'));};Preview[_0xb25d('0x12')][_0xb25d('0xf5')]=function(_0x41d456,_0xbb010,_0x546ad4,_0x2e9769,_0x309292){var _0x4c96c5=this;return new Promise(function(_0x166516,_0x52c554){if(_[_0xb25d('0xf6')](_0xbb010)||_[_0xb25d('0xf6')](_0xbb010[_0xb25d('0xf7')])||_['isNil'](_0xbb010[_0xb25d('0xf8')])||_[_0xb25d('0xf6')](_0xbb010[_0xb25d('0x52')])){_0x52c554(ut[_0xb25d('0x39')](_0xb25d('0xf9'),_0x2e9769,_0x309292));return;}var _0x7551b=uuid['v4']();var _0x23e911=_0x4c96c5['campaignsPreview'][_0xbb010[_0xb25d('0x4b')][_0xb25d('0x31')]];var _0x54d7a7=_0x546ad4?_0x4c96c5['agents'][_0x546ad4]['id']:undefined;_0x4c96c5[_0xb25d('0x19')][_0x7551b]=new Action(_0xbb010,_0x23e911,_0x7551b,_0x546ad4,_0x54d7a7);var _0x43a1f3=_0x4c96c5[_0xb25d('0x19')][_0x7551b];_0x43a1f3[_0xb25d('0x8e')]=_0x2e9769;_0x43a1f3[_0xb25d('0xb0')]=_0x309292;_0x43a1f3[_0xb25d('0xfa')]=_0x546ad4;if(_[_0xb25d('0xfb')](_0x41d456)){_0x4c96c5[_0xb25d('0xfc')](_0x43a1f3,_0x23e911,_0xbb010,_0x546ad4)[_0xb25d('0x63')](function(_0x4ee570){logger[_0xb25d('0x2d')](_0xb25d('0xfd'),'Queue:\x20'+_0x43a1f3[_0xb25d('0x4c')]+_0xb25d('0xfe')+_0x43a1f3['idContact'],JSON[_0xb25d('0x2f')](_0x4ee570));ami[_0xb25d('0x2c')]('custom:agentcalled',ut[_0xb25d('0x82')](_0x43a1f3,_0xb25d('0xff'),_0x4c96c5[_0xb25d('0x16')][_0x43a1f3[_0xb25d('0x4c')]]));_0x166516(ut['message'](_0xb25d('0x100')));})[_0xb25d('0x71')](function(_0x59ee7d){ut['logger'](_0xb25d('0x101'),_0x59ee7d);_0x52c554(ut[_0xb25d('0x39')]('Call\x20failed',_0x2e9769,_0x309292));});}else{_0x23e911[_0xb25d('0x102')]+=0x1;ut[_0xb25d('0x103')](_0x43a1f3);rpcDb[_0xb25d('0x104')](_0x43a1f3,_0xb25d('0x105'));delete _0x4c96c5[_0xb25d('0x19')][_0x7551b];_0x52c554(ut[_0xb25d('0x39')](_0xb25d('0x106'),_0x2e9769,_0x309292));}});};Preview['prototype'][_0xb25d('0x78')]=function(_0x1b41e1){return!_['isNil'](_0x1b41e1)&&!_['isNil'](_0x1b41e1['name'])&&!_[_0xb25d('0xf6')](_0x1b41e1[_0xb25d('0x107')])&&_0x1b41e1[_0xb25d('0x107')]&&!_[_0xb25d('0xf6')](this[_0xb25d('0x18')][util[_0xb25d('0x30')](_0xb25d('0x108'),_0x1b41e1['name'])])&&!_[_0xb25d('0xf6')](this[_0xb25d('0x18')][util[_0xb25d('0x30')](_0xb25d('0x108'),_0x1b41e1[_0xb25d('0x31')])][_0xb25d('0x55')])&&(this[_0xb25d('0x18')][util[_0xb25d('0x30')](_0xb25d('0x108'),_0x1b41e1[_0xb25d('0x31')])][_0xb25d('0x55')]===_0xb25d('0x109')||this[_0xb25d('0x18')][util[_0xb25d('0x30')]('SIP/%s',_0x1b41e1[_0xb25d('0x31')])][_0xb25d('0x55')]==='unmonitored');};Preview[_0xb25d('0x12')]['run']=function(_0x2ab25f,_0x3fcdf9){return this[_0xb25d('0x10a')](_0x2ab25f,_0x3fcdf9)['then'](function(_0x41dc75){return _[_0xb25d('0x4f')](_0x41dc75,['message']);})[_0xb25d('0x71')](function(_0x57988e){if(_0x57988e[_0xb25d('0x10b')]){rpcDb[_0xb25d('0x10c')](_0x2ab25f);}if(_0x57988e[_0xb25d('0x107')]){rpcDb[_0xb25d('0x66')](_0x2ab25f);}throw _[_0xb25d('0x4f')](_0x57988e,[_0xb25d('0x39')]);});};Preview[_0xb25d('0x12')][_0xb25d('0x10a')]=function(_0x1e1973,_0x4192ce){var _0x50130e=this;var _0x2cd628,_0x4c203c;return rpcDb[_0xb25d('0x10d')](_0x1e1973)['then'](function(_0x9c958){if(!_[_0xb25d('0xf6')](_0x9c958[0x0])){_0x4c203c=_0x9c958[0x0][_0xb25d('0x10e')]?![]:!![];_0x2cd628=_0x9c958[0x0]['recallme']?!![]:![];_0x2cd628=_0x4192ce?!![]:_0x2cd628;}var _0x3f1313=_0x50130e[_0xb25d('0x10f')](_0x9c958);if(_0x3f1313['isValid']){rpcDb['checkIsBlackList'](_[_0xb25d('0x4f')](_0x9c958[0x0],[_0xb25d('0x52'),_0xb25d('0xf8')]))[_0xb25d('0x63')](function(_0xac1415){_0x50130e[_0xb25d('0xf5')](_0xac1415,_0x9c958[0x0],_0x4192ce,_0x4c203c,_0x2cd628)['then'](function(_0x4bd48f){return _0x4bd48f;})['catch'](function(_0x27afa7){throw _0x27afa7;});})['catch'](function(_0x49eaa2){ut['logger'](_0xb25d('0x110'),_0x49eaa2);throw ut[_0xb25d('0x39')]('Call\x20unsuccessful',_0x4c203c,_0x2cd628);});}else{throw ut[_0xb25d('0x39')](_0x3f1313[_0xb25d('0x39')],_0x4c203c,_0x2cd628);}})[_0xb25d('0x71')](function(_0x4c95c8){ut['logger']('[Preview][getContactPreview]',_0x4c95c8);throw ut[_0xb25d('0x39')](_0xb25d('0x111'),![],!![]);});};Preview[_0xb25d('0x12')][_0xb25d('0x10f')]=function(_0xab1c06){if(_[_0xb25d('0xf6')](_0xab1c06)||_[_0xb25d('0xfb')](_0xab1c06)||!_[_0xb25d('0xf6')](_0xab1c06[0x0][_0xb25d('0x61')])&&_[_0xb25d('0xf6')](_0xab1c06[0x0]['Agent'][_0xb25d('0x31')])){ut[_0xb25d('0x3c')]('[Preview][validateContact][Empty\x20Contact]',_0xab1c06);return{'isValid':![],'message':_0xb25d('0x112')};}var _0x57e148=this[_0xb25d('0x16')][_0xab1c06[0x0][_0xb25d('0x4b')]['name']];_0x57e148['message']=utils[_0xb25d('0x3a')][_0xb25d('0x7b')];if(_[_0xb25d('0xf6')](_0x57e148)){ut[_0xb25d('0x3c')]('[Preview][validateContact][Empty\x20Campaign]',_0x57e148);return{'isValid':![],'message':_0xb25d('0x113')};}if(!this['isTrunkReachable'](_0x57e148[_0xb25d('0x79')])){ut[_0xb25d('0x3c')]('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20'+_0x57e148[_0xb25d('0x31')]+_0xb25d('0x114'));if(!this['isTrunkReachable'](_0x57e148[_0xb25d('0x7a')])){ut['logger'](_0xb25d('0x115'),_0x57e148[_0xb25d('0x31')]+_0xb25d('0x116'));return{'isValid':![],'message':_0xb25d('0x117')};}}if(!ut[_0xb25d('0x77')](_0x57e148[_0xb25d('0x46')])){ut[_0xb25d('0x3c')](_0xb25d('0x118'),_0x57e148[_0xb25d('0x31')]+_0xb25d('0x119'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x57e148[_0xb25d('0x31')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0xb25d('0x11a')};};Preview[_0xb25d('0x12')][_0xb25d('0xfc')]=function(_0x4f2b2a,_0x1817a8,_0x3dd678,_0xda1735){var _0x3123fd=this;return new Promise(function(_0x134fc3,_0x524abe){var _0x348b63=_0x4f2b2a[_0xb25d('0x94')];var _0x3abf05=_0x3123fd[_0xb25d('0x78')](_0x1817a8[_0xb25d('0x79')])?util['format'](_0xb25d('0x11b'),_0x1817a8['Trunk'][_0xb25d('0x31')],_[_0xb25d('0xf6')](_0x1817a8[_0xb25d('0x11c')])?'':_0x1817a8[_0xb25d('0x11c')][_0xb25d('0x11d')]()||'',_0x1817a8['dialCutDigit']>0x0?_0x3dd678[_0xb25d('0xf8')][_0xb25d('0x11e')](_0x1817a8[_0xb25d('0x11f')]):_0x3dd678[_0xb25d('0xf8')]):util[_0xb25d('0x30')]('SIP/%s/%s%s',_[_0xb25d('0xf6')](_0x1817a8['TrunkBackup'])?_0x1817a8[_0xb25d('0x79')][_0xb25d('0x31')]:_0x1817a8[_0xb25d('0x7a')][_0xb25d('0x31')],_[_0xb25d('0xf6')](_0x1817a8[_0xb25d('0x11c')])?'':_0x1817a8['dialPrefix'][_0xb25d('0x11d')]()||'',_0x1817a8[_0xb25d('0x11f')]>0x0?_0x3dd678[_0xb25d('0xf8')][_0xb25d('0x11e')](_0x1817a8['dialCutDigit']):_0x3dd678[_0xb25d('0xf8')]);var _0x5b2e53=_0x3123fd[_0xb25d('0x78')](_0x1817a8[_0xb25d('0x79')])?ut['getCallerId'](_0x1817a8[_0xb25d('0x79')][_0xb25d('0x120')],_0x1817a8[_0xb25d('0x121')],_0x1817a8[_0xb25d('0x122')]>0x0?ut['getCallerIdRandom'](_0x1817a8[_0xb25d('0x123')],_0x1817a8[_0xb25d('0x122')]):_0x1817a8[_0xb25d('0x123')]):ut[_0xb25d('0x124')](_['isNil'](_0x1817a8['TrunkBackup'])?_0x1817a8[_0xb25d('0x79')]['callerid']:_0x1817a8[_0xb25d('0x7a')]['callerid'],_0x1817a8['dialOriginateCallerIdName'],_0x1817a8['dialRandomLastDigitCallerIdNumber']>0x0?ut['getCallerIdRandom'](_0x1817a8['dialOriginateCallerIdNumber'],_0x1817a8[_0xb25d('0x122')]):_0x1817a8['dialOriginateCallerIdNumber']);if(_0x5b2e53){_0x4f2b2a[_0xb25d('0x125')]=ut[_0xb25d('0x126')](_0x5b2e53);_0x4f2b2a[_0xb25d('0x127')]=ut[_0xb25d('0x128')](_0x5b2e53);}var _0x143151=ut[_0xb25d('0x129')](_0x1817a8,_0x3dd678,_0x3abf05,_0x5b2e53,_0x348b63,_0x4f2b2a);var _0x21e8c1=utils[_0xb25d('0x12a')](_0x3dd678[_0xb25d('0xf7')]);Object[_0xb25d('0x12b')](_0x143151,_0x21e8c1);_[_0xb25d('0x12c')](_0x4f2b2a,ut[_0xb25d('0x12d')](_0x143151));_0x4f2b2a[_0xb25d('0x67')]=moment()[_0xb25d('0x30')](_0xb25d('0x68'));_0x1817a8[_0xb25d('0x12e')]=_0x143151;var _0x2b158c=ut['variablesAction'](_0x4f2b2a,_0x1817a8,_0x143151,_0x4f2b2a[_0xb25d('0xb0')],_0xda1735);return ami['Action'](_0x2b158c)[_0xb25d('0x63')](function(_0x6b65){_0x1817a8[_0xb25d('0x34')]+=0x1;logger[_0xb25d('0x2d')]('[originated][increment]',_0x348b63,_0xb25d('0x95'),_0x1817a8[_0xb25d('0x31')],_0xb25d('0xe2'),_0x1817a8['originated']);_0x134fc3(_0x6b65);})[_0xb25d('0x71')](function(_0x1580df){ut[_0xb25d('0xe9')](_0x4f2b2a,0xe,_0xb25d('0x12f'));rpcDb[_0xb25d('0xeb')](_0x4f2b2a,_0xb25d('0x130'));_0x524abe(_0x1580df);});});};Preview['prototype'][_0xb25d('0x26')]=function(_0x4beda7){if(this[_0xb25d('0x19')][_0x4beda7[_0xb25d('0xa7')]]){this[_0xb25d('0x19')][_0x4beda7[_0xb25d('0xa7')]][_0xb25d('0x56')]=_0x4beda7[_0xb25d('0x56')];}};Preview[_0xb25d('0x12')]['syncOriginateResponse']=function(_0x489eb8){var _0x641864=this;var _0x315ce6=this['actions'][_0x489eb8['actionid']];if(_0x315ce6){if(_0x315ce6['lookAgent']&&this[_0xb25d('0x1a')][_0x315ce6[_0xb25d('0xfa')]]){ut[_0xb25d('0x131')](_0x315ce6,this['agents'][_0x315ce6[_0xb25d('0xfa')]][_0xb25d('0x31')],this[_0xb25d('0x1a')][_0x315ce6['lookAgent']]['id']);}var _0xf287e4=_[_0xb25d('0x132')](_0x315ce6);_0xf287e4[_0xb25d('0x133')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x1564f0=_0x641864[_0xb25d('0x16')][_0x315ce6['queue']];if(ut[_0xb25d('0x134')](_0x489eb8[_0xb25d('0x135')])){if(_0x315ce6['unlockAgent']){rpcDb['unlockContact'](_0x315ce6[_0xb25d('0xb1')]);}if(_0x315ce6[_0xb25d('0xb0')]){rpcDb[_0xb25d('0x66')](_0x315ce6['idContact']);}ami[_0xb25d('0x2c')](_0xb25d('0x136'),ut['buildObj'](_0x315ce6,_0xb25d('0x137'),this[_0xb25d('0x16')][_0x315ce6['queue']]));this['callProgressDetectingAgent'](_0xf287e4,_0x1564f0,_0x489eb8);}else{_0x315ce6['starttime']=moment()[_0xb25d('0x30')](_0xb25d('0x68'));ut['logAgent'](_0xf287e4,0x4,_0xb25d('0x138'));rpcDb['createAgentHistory'](_0xf287e4,_0xb25d('0x139'));}}};Preview[_0xb25d('0x12')]['syncHangup']=function(_0x47aad8){var _0x4909c9=this['actions'][_0x47aad8[_0xb25d('0xa7')]];var _0x4dbacc;if(_0x4909c9){_0x4dbacc=this['campaignsPreview'][_0x4909c9[_0xb25d('0x4c')]];logger['info']('[syncHangup][talking]',_0x47aad8['linkedid'],_0xb25d('0x95'),_0x4dbacc[_0xb25d('0x31')],_0xb25d('0x4d'),_0x4dbacc[_0xb25d('0x35')]);}if(this[_0xb25d('0x19')][_0x47aad8['linkedid']]&&_0x47aad8[_0xb25d('0xa7')]!==_0x47aad8[_0xb25d('0x94')]){if(_0x47aad8[_0xb25d('0x13a')]==='16'&&this[_0xb25d('0x19')][_0x47aad8['linkedid']][_0xb25d('0x4e')]){this[_0xb25d('0x7c')](_0x47aad8,_0x47aad8['linkedid'],_0x47aad8[_0xb25d('0x13a')]);}else if(this[_0xb25d('0x19')][_0x47aad8[_0xb25d('0xa7')]][_0xb25d('0x4e')]){logger[_0xb25d('0x2d')](_0xb25d('0x13b'),_0x47aad8[_0xb25d('0xa7')],_0x47aad8[_0xb25d('0x13a')],_0xb25d('0x95'),_0x4dbacc[_0xb25d('0x31')],_0xb25d('0x4d'),_0x4dbacc[_0xb25d('0x35')]);this['callProgressDetectingCustomer'](_0x47aad8,_0x47aad8[_0xb25d('0xa7')],_0x47aad8[_0xb25d('0x13a')]);}}else if(_0x4909c9&&_[_0xb25d('0xf6')](_0x4909c9[_0xb25d('0x13c')])&&_0x4dbacc[_0xb25d('0x13d')]&&_0x47aad8['linkedid']===_0x47aad8[_0xb25d('0x94')]&&_[_0xb25d('0xf6')](_0x47aad8[_0xb25d('0xe8')])&&_0x47aad8[_0xb25d('0x13a')]==='16'&&_0x47aad8['channelstate']==='6'&&_[_0xb25d('0xe6')](_0x4909c9[_0xb25d('0x13e')])){if(_0x4909c9['unlockAgent']){rpcDb[_0xb25d('0x10c')](_0x4909c9['idContact']);}if(_0x4909c9[_0xb25d('0xb0')]){rpcDb[_0xb25d('0x66')](_0x4909c9[_0xb25d('0xb1')]);}_0x47aad8[_0xb25d('0xe8')]='22';this[_0xb25d('0xe5')](_0x4909c9,_0x4dbacc,_0x47aad8);}else if(_0x4909c9&&_0x4909c9[_0xb25d('0x13e')]){if(_0x47aad8[_0xb25d('0x13a')]==='16'&&this[_0xb25d('0x19')][_0x47aad8[_0xb25d('0xa7')]][_0xb25d('0x4e')]){logger[_0xb25d('0x2d')](_0xb25d('0x13f'),_0x47aad8[_0xb25d('0xa7')],_0x47aad8[_0xb25d('0x13a')],_0xb25d('0x95'),_0x4dbacc[_0xb25d('0x31')],_0xb25d('0x4d'),_0x4dbacc['pTalking']);this[_0xb25d('0x7c')](_0x47aad8,_0x47aad8['linkedid'],_0x47aad8[_0xb25d('0x13a')]);}else if(this['actions'][_0x47aad8['linkedid']][_0xb25d('0x4e')]){logger[_0xb25d('0x2d')](_0xb25d('0x13b'),_0x47aad8[_0xb25d('0xa7')],_0x47aad8[_0xb25d('0x13a')],'\x20Queue',_0x4dbacc[_0xb25d('0x31')],_0xb25d('0x4d'),_0x4dbacc['pTalking']);this['callProgressDetectingCustomer'](_0x47aad8,_0x47aad8[_0xb25d('0xa7')],_0x47aad8[_0xb25d('0x13a')]);}}};Preview[_0xb25d('0x12')][_0xb25d('0x24')]=function(_0x159d10){if(this['actions'][_0x159d10[_0xb25d('0xe3')]]&&_0x159d10[_0xb25d('0xe3')]!==_0x159d10['destuniqueid']){this[_0xb25d('0x7c')](_0x159d10,_0x159d10[_0xb25d('0xe3')],_0x159d10[_0xb25d('0x140')]);}};Preview[_0xb25d('0x12')][_0xb25d('0x22')]=function(_0x13c026){if(this[_0xb25d('0x19')][_0x13c026[_0xb25d('0xa7')]]&&_0x13c026[_0xb25d('0xa7')]!==_0x13c026[_0xb25d('0x94')]&&!this['actions'][_0x13c026[_0xb25d('0xa7')]][_0xb25d('0x4e')]){if(_0x13c026[_0xb25d('0x13a')]==='1'){this[_0xb25d('0x7c')](_0x13c026,_0x13c026['linkedid'],_0x13c026[_0xb25d('0x13a')]);}}};Preview['prototype']['addVariable']=function(_0x22409c,_0x83a4fc,_0x553faf){if(this[_0xb25d('0x19')][_0x22409c]){if(_['isNil'](this['actions'][_0x22409c][_0xb25d('0x12e')])){this['actions'][_0x22409c][_0xb25d('0x12e')]={};}this[_0xb25d('0x19')][_0x22409c]['variables'][_0x83a4fc]=_0x553faf;}};Preview[_0xb25d('0x12')]['syncVarSet']=function(_0x234b08){try{if(!_[_0xb25d('0xf6')](_0x234b08)){if(ut[_0xb25d('0x141')](_['keys'](_0x234b08['variable'])[0x0])){this[_0xb25d('0x142')](_0x234b08[_0xb25d('0x94')],_[_0xb25d('0x143')](_0x234b08[_0xb25d('0x144')])[0x0],_0x234b08[_0xb25d('0x145')]);}}}catch(_0x4bd8d8){logger[_0xb25d('0x146')](_0xb25d('0x147'),util[_0xb25d('0x148')](_0x4bd8d8,{'showHidden':![],'depth':null}));}};Preview[_0xb25d('0x12')][_0xb25d('0x29')]=function(_0x4ae6e1){if(_0x4ae6e1){if(this[_0xb25d('0x19')][_0x4ae6e1[_0xb25d('0x149')]]){this['actions'][_0x4ae6e1[_0xb25d('0x149')]][_0xb25d('0x13e')]=!![];}}};Preview['prototype'][_0xb25d('0x2b')]=function(_0x4f273c){if(_0x4f273c){if(this[_0xb25d('0x19')][_0x4f273c['transfererlinkedid']]){this['actions'][_0x4f273c[_0xb25d('0x14a')]]['transfer']=!![];}}};module[_0xb25d('0x14b')]=Preview; \ No newline at end of file +var _0x0c80=['SIP/%s','reachable','unmonitored','execRun','pick','unlockContact','active','getContactPreview','recallme','checkIsBlackList','phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','ACTIVE','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','getCallerId','getCallerIdRandom','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','setXMDContactVariables','merge','toLowerVariables','variables','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','isFailure','response','custom:agentringnoanswer','rejected','starttime','[callProgressDetectingAgent][logAnswer]','syncHangup','cause','callProgressDetectingCustomer','statedesc','dialQueueProject','channelstate','[syncHangup][talking][transfer]','[syncHangup][talking][cause]','destlinkedid','destuniqueid','addVariable','filterKey','keys','variable','value','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfer','transfererlinkedid','exports','util','lodash','uuid','moment','ioredis','../../../config/logger','actionPreview','../ami','./rpcDb','../rpc/cmHopperAdditionalPhone','./util/util','../dialer/utils','redis','defaults','localhost','socket.io-emitter','tail','finally','voiceQueues','trunks','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','hanguprequest','syncHangupRequest','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','loopCampaigns','emit','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','stringify','format','voice:queue:%s','name','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','originated','pTalking','available','paused','message','CAMPAIGN_STATUS','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','DEACTIVATED','\x20is\x20deactivated','syncCampaigns','prototype','campaignsPreview','hasOwnProperty','dialMethod','preview','booked','type','outbound','setMessage','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','enqueue','isNil','actions','[clearZombieChannels][talking]','originated:\x20','pTalking:\x20','queue','contactId','VoiceQueueId','ListId','Action','status','channel','catch','updateOriginated','[clearZombieChannel]','dialAnswer','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','clearZombieChannels','info','[action]','size','getContactRecallMe','then','getDiff','scheduledat','Agent','voicePause','run','logger2','[RecallMe]','disableContact','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createCustomerHistory','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','loggedIn','NO_AGENTS_LOGGED','isActive','dialActive','Trunk','isTrunkReachable','TrunkBackup','UNREACHABLE_TRUNK','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','totalGlobal','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','additional','dialNoSuchNumberRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','unlockAgent','linkedid','actioncountonusuch','idContact','incrementPreviewCounters','swapAdditionalPhones','responsetime','uniqueid','\x20Queue','custom:agentconnect','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','outboundAnswerCallsDay','total','answered','decrementTalkink','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','sumBillable','[syncHangup][talking][decrement]','outboundBusyCallsDay','countbusyretry','Busy','dialBusyRetryFrequency','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','verifyAdditionalPhones','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','activeContact','NOANSWER','outboundNoAnswerCallsDay','countnoanswerretry','dialNoAnswerRetryFrequency','custom:agentnoanswer','cloneAction','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','CONGESTION','outboundCongestionCallsDay','Congestion','dialCongestionRetryFrequency','custom:agentcongestion','[callProgressDetectingCustomer][logCongestionGlobal]','countcongestionretry','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','CANCEL','outboundRejectCallsDay','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','ABANDONED','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','countmachineretry','cause-txt','dialstatus','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','outboundUnknownCallsDay','amd','[callProgressDetectingCustomer][machine]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[originated][decrement][callProgressDetectingCustomer]','ANSWER','queueSummaryCountersUpdated','callProgressDetectingAgent','isUndefined','object','reason','logAgent','NoSuchNumber','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','NoAnswer','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[incrementPreviewCounters]\x20','checkInBlack','Contact','Contact\x20is\x20undefined','Queue','lookAgent','execCall','custom:agentcalled','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List'];(function(_0xba44bf,_0x786486){var _0x27b391=function(_0x5c7067){while(--_0x5c7067){_0xba44bf['push'](_0xba44bf['shift']());}};_0x27b391(++_0x786486);}(_0x0c80,0x192));var _0x00c8=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x0c80[_0x5d6456];return _0x4d66c1;};'use strict';var util=require(_0x00c8('0x0'));var _=require(_0x00c8('0x1'));var uuid=require(_0x00c8('0x2'));var moment=require(_0x00c8('0x3'));var Redis=require(_0x00c8('0x4'));var config=require('../../../config/environment');var logger=require(_0x00c8('0x5'))('preview');var loggerAction=require('../../../config/logger')(_0x00c8('0x6'));var ami=require(_0x00c8('0x7'));var rpcDb=require(_0x00c8('0x8'));var cmHopperAdditionalPhone=require(_0x00c8('0x9'));var Action=require('./action');var ut=require(_0x00c8('0xa'));var utils=require(_0x00c8('0xb'));config[_0x00c8('0xc')]=_[_0x00c8('0xd')](config[_0x00c8('0xc')],{'host':_0x00c8('0xe'),'port':0x18eb});var io=require(_0x00c8('0xf'))(new Redis(config[_0x00c8('0xc')]));var Sequence=function(){};Sequence['prototype']['enqueue']=function(_0x45e6e6){this['tail']=this[_0x00c8('0x10')]?this[_0x00c8('0x10')][_0x00c8('0x11')](_0x45e6e6):_0x45e6e6();};function Preview(_0x5cba55){this['sequence']=new Sequence();this['campaignsPreview']=_0x5cba55[_0x00c8('0x12')];this[_0x00c8('0x13')]=_0x5cba55['trunks'];this['actions']={};this[_0x00c8('0x14')]=_0x5cba55['agents'];this[_0x00c8('0x15')]=0x0;ami['on'](_0x00c8('0x16'),this[_0x00c8('0x17')][_0x00c8('0x18')](this));ami['on'](_0x00c8('0x19'),this['syncHangup'][_0x00c8('0x18')](this));ami['on'](_0x00c8('0x1a'),this[_0x00c8('0x1b')]['bind'](this));ami['on']('dialend',this[_0x00c8('0x1c')][_0x00c8('0x18')](this));ami['on'](_0x00c8('0x1d'),this[_0x00c8('0x1e')]['bind'](this));ami['on'](_0x00c8('0x1f'),this[_0x00c8('0x20')]['bind'](this));ami['on'](_0x00c8('0x21'),this[_0x00c8('0x22')][_0x00c8('0x18')](this));ami['on'](_0x00c8('0x23'),this['syncBlindTransfer']['bind'](this));this[_0x00c8('0x24')](this['campaignsPreview']);}function emit(_0x3377a3,_0x588350,_0x277373){io['to'](_0x3377a3)[_0x00c8('0x25')](_0x588350,_0x277373);}function emitVoiceQueueChannelRemove(_0x12b86e){logger['info'](_0x00c8('0x26'),JSON[_0x00c8('0x27')](_0x12b86e));emit(util[_0x00c8('0x28')](_0x00c8('0x29'),_0x12b86e[_0x00c8('0x2a')]),_0x00c8('0x2b'),_0x12b86e);io[_0x00c8('0x25')](_0x00c8('0x2c'),_0x12b86e);}function notSendMessagesQueue(_0x37618a){if(_0x37618a[_0x00c8('0x2d')]){if(_0x37618a[_0x00c8('0x2e')]===0x0&&_0x37618a[_0x00c8('0x2f')]===0x0){_0x37618a['sendMessageOneNotActive']=![];_0x37618a[_0x00c8('0x30')]=0x0;_0x37618a[_0x00c8('0x31')]=0x0;_0x37618a[_0x00c8('0x32')]=utils[_0x00c8('0x33')]['INACTIVE'];ut[_0x00c8('0x34')](_0x00c8('0x35'),_0x37618a[_0x00c8('0x2a')]+_0x00c8('0x36'));}else{_0x37618a['message']=utils[_0x00c8('0x33')][_0x00c8('0x37')];ut['logger'](_0x00c8('0x35'),_0x37618a[_0x00c8('0x2a')]+_0x00c8('0x38'));}}}Preview['prototype'][_0x00c8('0x24')]=function(){var _0x18e511=this;setInterval(function(){_0x18e511[_0x00c8('0x39')]();},0x7cf);};Preview[_0x00c8('0x3a')][_0x00c8('0x39')]=function(){var _0x744505=this[_0x00c8('0x3b')];this['clockClearZombieChannels']+=0x1;for(var _0x491645 in _0x744505){if(_0x744505[_0x00c8('0x3c')](_0x491645)&&(_0x744505[_0x491645][_0x00c8('0x3d')]===_0x00c8('0x3e')||_0x744505[_0x491645][_0x00c8('0x3d')]===_0x00c8('0x3f'))&&_0x744505[_0x491645][_0x00c8('0x40')]==='outbound'){if(this[_0x00c8('0x15')]>0x7){this['clockClearZombieChannels']=0x0;this['clearZombieChannels']();}}if(_0x744505[_0x00c8('0x3c')](_0x491645)&&_0x744505[_0x491645][_0x00c8('0x3d')]===_0x00c8('0x3e')&&_0x744505[_0x491645][_0x00c8('0x40')]===_0x00c8('0x41')){if(_0x744505[_0x491645]['dialActive']){this[_0x00c8('0x42')](_0x744505[_0x491645]);if(_0x744505[_0x491645][_0x00c8('0x43')])this[_0x00c8('0x44')](_0x744505[_0x491645]);}else{notSendMessagesQueue(_0x744505[_0x491645]);}}}};Preview[_0x00c8('0x3a')][_0x00c8('0x45')]=function(_0x87d5d7){var _0x16044d=this;this['sequence'][_0x00c8('0x46')](function(){if(!_[_0x00c8('0x47')](_0x16044d[_0x00c8('0x48')][_0x87d5d7])){loggerAction['info'](_0x00c8('0x49'),_0x87d5d7,'Queue',_0x16044d['actions'][_0x87d5d7]['queue'],_0x00c8('0x4a'),JSON[_0x00c8('0x27')](_0x16044d[_0x00c8('0x3b')][_0x16044d[_0x00c8('0x48')][_0x87d5d7]['queue']][_0x00c8('0x2e')]),_0x00c8('0x4b'),JSON[_0x00c8('0x27')](_0x16044d['campaignsPreview'][_0x16044d['actions'][_0x87d5d7][_0x00c8('0x4c')]]['pTalking']),JSON[_0x00c8('0x27')](_0x16044d[_0x00c8('0x48')][_0x87d5d7]['dialAnswer']),JSON[_0x00c8('0x27')](_['pick'](_0x16044d[_0x00c8('0x48')][_0x87d5d7],[_0x00c8('0x4d'),'UserId',_0x00c8('0x4e'),_0x00c8('0x4f')])));return ami[_0x00c8('0x50')]({'action':_0x00c8('0x51'),'channel':_0x16044d[_0x00c8('0x48')][_0x87d5d7][_0x00c8('0x52')]})[_0x00c8('0x53')](function(_0x15cb60){if(_0x15cb60[_0x00c8('0x32')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x16044d['actions'][_0x87d5d7]){ut[_0x00c8('0x54')](_0x16044d[_0x00c8('0x3b')][_0x16044d[_0x00c8('0x48')][_0x87d5d7][_0x00c8('0x4c')]],_0x00c8('0x55'));if(_0x16044d[_0x00c8('0x48')][_0x87d5d7][_0x00c8('0x56')]===!![]){ut['decrementTalkink'](_0x16044d[_0x00c8('0x3b')][_0x16044d[_0x00c8('0x48')][_0x87d5d7][_0x00c8('0x4c')]],_0x00c8('0x55'));ut[_0x00c8('0x57')](_0x00c8('0x58')+_0x87d5d7,_0x16044d[_0x00c8('0x48')][_0x87d5d7]['queue']);}ut[_0x00c8('0x57')](_0x00c8('0x59')+_0x87d5d7,_0x16044d[_0x00c8('0x48')][_0x87d5d7][_0x00c8('0x4c')]);delete _0x16044d['actions'][_0x87d5d7];}},0x2328);}});}});};Preview['prototype'][_0x00c8('0x5a')]=function(){var _0x26e4da=this;loggerAction[_0x00c8('0x5b')](_0x00c8('0x5c'),_[_0x00c8('0x5d')](this[_0x00c8('0x48')]));for(var _0x48b35c in this['actions']){if(_0x26e4da[_0x00c8('0x48')][_0x00c8('0x3c')](_0x48b35c)){_0x26e4da[_0x00c8('0x45')](_0x48b35c);}}};Preview[_0x00c8('0x3a')][_0x00c8('0x44')]=function(_0x634612){var _0x13ffd2=this;rpcDb[_0x00c8('0x5e')](_0x634612['id'],ut['agentReadyId'](this[_0x00c8('0x14')]))[_0x00c8('0x5f')](function(_0x5fd77a){if(!_[_0x00c8('0x47')](_0x5fd77a)){for(var _0x2db9fb=0x0;_0x2db9fb<_0x5fd77a['length'];_0x2db9fb+=0x1){if(ut[_0x00c8('0x60')](_0x5fd77a[_0x2db9fb][_0x00c8('0x61')])<_0x634612['dialRecallMeTimeout']*0x3c){if(_0x5fd77a[_0x2db9fb]['Agent']&&!_0x5fd77a[_0x2db9fb][_0x00c8('0x62')][_0x00c8('0x63')]){_0x13ffd2[_0x00c8('0x64')](_0x5fd77a[_0x2db9fb]['id'])[_0x00c8('0x5f')](ut[_0x00c8('0x65')](_0x00c8('0x66')))['catch'](ut[_0x00c8('0x65')](_0x00c8('0x66')));}else{rpcDb[_0x00c8('0x67')](_0x5fd77a[_0x2db9fb]['id']);}}else{var _0x1d33b2=new Action(_0x5fd77a[_0x2db9fb],_0x634612);_0x1d33b2['starttime']=moment()[_0x00c8('0x28')](_0x00c8('0x68'));_0x634612[_0x00c8('0x69')]+=0x1;ut[_0x00c8('0x6a')](_0x1d33b2,0x17,_0x00c8('0x6b'));if(_0x634612[_0x00c8('0x6c')]){rpcDb[_0x00c8('0x6d')](ut['createBody'](_0x5fd77a[_0x2db9fb]));rpcDb['createCustomerHistory'](_0x1d33b2,'[HistoryDialRecallInQueue][historyCatch]');}else{ut[_0x00c8('0x6a')](_0x1d33b2,0x16,'RecallFailedTimeout');rpcDb[_0x00c8('0x6e')](_0x1d33b2,_0x00c8('0x6f'));rpcDb[_0x00c8('0x70')](_0x1d33b2,_0x00c8('0x6f'));}}}}})[_0x00c8('0x53')](ut['logger2'](_0x00c8('0x71')));};Preview[_0x00c8('0x3a')]['setMessage']=function(_0x2f4b59){_0x2f4b59[_0x00c8('0x2d')]=!![];if(ut[_0x00c8('0x72')](_0x2f4b59[_0x00c8('0x73')])){_0x2f4b59[_0x00c8('0x32')]=utils['CAMPAIGN_STATUS'][_0x00c8('0x74')];}else if(!ut[_0x00c8('0x75')](_0x2f4b59[_0x00c8('0x76')])){_0x2f4b59[_0x00c8('0x32')]=utils[_0x00c8('0x33')]['INACTIVE'];}else if(!this['isTrunkReachable'](_0x2f4b59[_0x00c8('0x77')])){if(!this[_0x00c8('0x78')](_0x2f4b59[_0x00c8('0x79')])){_0x2f4b59['message']=utils[_0x00c8('0x33')][_0x00c8('0x7a')];}else{_0x2f4b59[_0x00c8('0x32')]=utils['CAMPAIGN_STATUS']['ACTIVE'];}}else{_0x2f4b59[_0x00c8('0x32')]=utils['CAMPAIGN_STATUS']['ACTIVE'];}};Preview[_0x00c8('0x3a')]['callProgressDetectingCustomer']=function(_0x56e897,_0xbf7f32,_0x3fc450){var _0x57efca=this;var _0xedfbfa=this['actions'][_0xbf7f32];var _0x11f4db=this[_0x00c8('0x3b')][_0xedfbfa[_0x00c8('0x4c')]];var _0x3239ee;var _0x59f3df=![];var _0x2c000c=0x2;var _0x2aa8aa=0x3;if(_0x11f4db){switch(_0x3fc450){case'1':_0x11f4db[_0x00c8('0x7b')]+=0x1;_0xedfbfa[_0x00c8('0x7c')]+=0x1;_0xedfbfa[_0x00c8('0x7d')]=ut[_0x00c8('0x7e')](_0xedfbfa);ut['logCustomer'](_0xedfbfa,0x0,'NoSuchNumber');ami[_0x00c8('0x25')](_0x00c8('0x7f'),ut[_0x00c8('0x80')](_0xedfbfa,_0x00c8('0x81')));rpcDb[_0x00c8('0x6e')](_0xedfbfa,_0x00c8('0x82'));_0x57efca['verifyAdditionalPhones'](_0xedfbfa,'0',_0x11f4db)[_0x00c8('0x5f')](function(_0x42be64){_0x59f3df=_0x42be64[_0x00c8('0x83')]==0x1;_0x2c000c=_0x11f4db[_0x00c8('0x84')];_0x2aa8aa=_0x11f4db[_0x00c8('0x85')];if(!_0x59f3df){if(ut[_0x00c8('0x7e')](_0xedfbfa)>=_0x11f4db[_0x00c8('0x86')]){_0x3239ee=ut['cloneAction'](_0xedfbfa,0xf,_0x00c8('0x87'));rpcDb[_0x00c8('0x70')](_0x3239ee,_0x00c8('0x88'));}else{if(_0xedfbfa[_0x00c8('0x7c')]>=_0x11f4db[_0x00c8('0x89')]){rpcDb[_0x00c8('0x70')](_0xedfbfa,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb[_0x00c8('0x8a')](ut[_0x00c8('0x8b')](_0xedfbfa,_0x00c8('0x7c'),_0x11f4db[_0x00c8('0x84')]),_0xedfbfa[_0x00c8('0x8c')],_0xedfbfa['activeContact']);}}delete this[_0x00c8('0x48')][_0x56e897[_0x00c8('0x8d')]];}else{_0xedfbfa[_0x00c8('0x7c')]++;logger['info'](_0x00c8('0x8e'),_0xedfbfa[_0x00c8('0x7c')]);logger[_0x00c8('0x5b')]('id',_0xedfbfa[_0x00c8('0x8f')]);_0x57efca[_0x00c8('0x90')]({'id':_0xedfbfa['idContact'],'field':{'countnosuchnumberretry':_0xedfbfa[_0x00c8('0x7c')]}})[_0x00c8('0x5f')](function(){_0x57efca[_0x00c8('0x91')](_0xedfbfa,_0x2c000c,_0x2aa8aa)[_0x00c8('0x5f')](function(){});});}});break;case'ANSWER':var _0x1f191c=moment()[_0x00c8('0x28')](_0x00c8('0x68'));_0xedfbfa[_0x00c8('0x92')]=_0x1f191c;_0xedfbfa['answertime']=_0x1f191c;_0xedfbfa[_0x00c8('0x56')]=!![];_0x11f4db[_0x00c8('0x2f')]+=0x1;logger[_0x00c8('0x5b')]('[syncHangup][talking][increment]',_0xedfbfa[_0x00c8('0x93')],_0x00c8('0x94'),_0x11f4db[_0x00c8('0x2a')],_0x00c8('0x4b'),_0x11f4db[_0x00c8('0x2f')]);ami['emit'](_0x00c8('0x95'),ut[_0x00c8('0x80')](_0xedfbfa,'connect',this[_0x00c8('0x3b')][_0xedfbfa[_0x00c8('0x4c')]]));if(_0x11f4db['acw']){ami['emit'](_0x00c8('0x96'),ut[_0x00c8('0x97')](_0xedfbfa));}break;case'16':ami[_0x00c8('0x25')](_0x00c8('0x98'),ut[_0x00c8('0x80')](_0xedfbfa,_0x00c8('0x99'),this[_0x00c8('0x3b')][_0xedfbfa[_0x00c8('0x4c')]]));emitVoiceQueueChannelRemove(ut[_0x00c8('0x80')](_0xedfbfa,'complete'));_0x11f4db[_0x00c8('0x9a')]+=0x1;_0x11f4db[_0x00c8('0x9b')]+=0x1;_0x11f4db[_0x00c8('0x9c')]+=0x1;ut[_0x00c8('0x9d')](_0x11f4db,_0x00c8('0x9e'));_0xedfbfa[_0x00c8('0x7d')]=ut[_0x00c8('0x7e')](_0xedfbfa);ut[_0x00c8('0x6a')](_0xedfbfa,0x4,_0x00c8('0x9f'));rpcDb[_0x00c8('0x6e')](_0xedfbfa,_0x00c8('0xa0'));rpcDb[_0x00c8('0x70')](_0xedfbfa,_0x00c8('0xa1'));rpcDb[_0x00c8('0xa2')](_0xedfbfa);_0x11f4db[_0x00c8('0xa3')]+=_0xedfbfa[_0x00c8('0xa4')];_0x11f4db[_0x00c8('0xa5')]+=_0xedfbfa[_0x00c8('0xa4')];logger[_0x00c8('0x5b')](_0x00c8('0xa6'),_0xedfbfa[_0x00c8('0x93')],_0x00c8('0x94'),_0x11f4db[_0x00c8('0x2a')],_0x00c8('0x4b'),_0x11f4db[_0x00c8('0x2f')]);delete this[_0x00c8('0x48')][_0x56e897[_0x00c8('0x8d')]];break;case'BUSY':_0x11f4db[_0x00c8('0xa7')]+=0x1;_0xedfbfa[_0x00c8('0xa8')]+=0x1;_0xedfbfa[_0x00c8('0x7d')]=ut[_0x00c8('0x7e')](_0xedfbfa);ut[_0x00c8('0x6a')](_0xedfbfa,0x5,_0x00c8('0xa9'));_0x2c000c=_0x11f4db[_0x00c8('0xaa')];_0x2aa8aa=_0x11f4db[_0x00c8('0x85')];ami[_0x00c8('0x25')](_0x00c8('0xab'),ut[_0x00c8('0x80')](_0xedfbfa,_0x00c8('0xac')));rpcDb['createCustomerHistory'](_0xedfbfa,_0x00c8('0xad'));_0x57efca[_0x00c8('0xae')](_0xedfbfa,'5',_0x11f4db)['then'](function(_0x1aff90){_0x59f3df=_0x1aff90[_0x00c8('0x83')]==0x1;if(!_0x59f3df){if(ut[_0x00c8('0x7e')](_0xedfbfa)>=_0x11f4db[_0x00c8('0x86')]){_0x3239ee=ut['cloneAction'](_0xedfbfa,0xf,_0x00c8('0x87'));rpcDb[_0x00c8('0x70')](_0x3239ee,_0x00c8('0xaf'));}else{if(_0xedfbfa[_0x00c8('0xa8')]>=_0x11f4db[_0x00c8('0xb0')]){rpcDb[_0x00c8('0x70')](_0xedfbfa,_0x00c8('0xad'));}else{rpcDb['rescheduleContact'](ut[_0x00c8('0x8b')](_0xedfbfa,_0x00c8('0xa8'),_0x11f4db[_0x00c8('0xaa')]),_0xedfbfa[_0x00c8('0x8c')],_0xedfbfa[_0x00c8('0xb1')]);}}}else{_0xedfbfa[_0x00c8('0xa8')]++;_0x57efca[_0x00c8('0x90')]({'id':_0xedfbfa[_0x00c8('0x8f')],'field':{'countbusyretry':_0xedfbfa[_0x00c8('0xa8')]}})['then'](function(){_0x57efca['swapAdditionalPhones'](_0xedfbfa,_0x2c000c,_0x2aa8aa)[_0x00c8('0x5f')](function(){});});}});break;case _0x00c8('0xb2'):_0x11f4db[_0x00c8('0xb3')]+=0x1;_0xedfbfa[_0x00c8('0xb4')]+=0x1;_0xedfbfa[_0x00c8('0x7d')]=ut[_0x00c8('0x7e')](_0xedfbfa);ut[_0x00c8('0x6a')](_0xedfbfa,0x3,'NoAnswer');_0x2c000c=_0x11f4db[_0x00c8('0xb5')];_0x2aa8aa=_0x11f4db[_0x00c8('0x85')];var _0x1e412c=ut['buildNoAnswerEventPayload'](_0xedfbfa,_0x11f4db);ami[_0x00c8('0x25')](_0x00c8('0xb6'),_0x1e412c);rpcDb[_0x00c8('0x6e')](_0xedfbfa,'[callProgressDetectingCustomer][logNoAnswer]');_0x57efca['verifyAdditionalPhones'](_0xedfbfa,'3',_0x11f4db)['then'](function(_0x547370){_0x59f3df=_0x547370[_0x00c8('0x83')]==0x1;if(!_0x59f3df){if(ut[_0x00c8('0x7e')](_0xedfbfa)>=_0x11f4db[_0x00c8('0x86')]){_0x3239ee=ut[_0x00c8('0xb7')](_0xedfbfa,0xf,'Global');rpcDb[_0x00c8('0x70')](_0x3239ee,_0x00c8('0xb8'));}else{if(_0xedfbfa[_0x00c8('0xb4')]>=_0x11f4db[_0x00c8('0xb9')]){rpcDb[_0x00c8('0x70')](_0xedfbfa,_0x00c8('0xba'));}else{rpcDb[_0x00c8('0x8a')](ut[_0x00c8('0x8b')](_0xedfbfa,_0x00c8('0xb4'),_0x11f4db[_0x00c8('0xb5')]),_0xedfbfa[_0x00c8('0x8c')],_0xedfbfa['activeContact']);}}}else{_0xedfbfa['countnoanswerretry']++;_0x57efca[_0x00c8('0x90')]({'id':_0xedfbfa['idContact'],'field':{'countnoanswerretry':_0xedfbfa['countnoanswerretry']}})[_0x00c8('0x5f')](function(){_0x57efca['swapAdditionalPhones'](_0xedfbfa,_0x2c000c,_0x2aa8aa)[_0x00c8('0x5f')](function(){});});}});break;case _0x00c8('0xbb'):_0x11f4db[_0x00c8('0xbc')]+=0x1;_0xedfbfa['countcongestionretry']+=0x1;_0xedfbfa[_0x00c8('0x7d')]=ut[_0x00c8('0x7e')](_0xedfbfa);ut[_0x00c8('0x6a')](_0xedfbfa,0x8,_0x00c8('0xbd'));_0x2c000c=_0x11f4db[_0x00c8('0xbe')];_0x2aa8aa=_0x11f4db['callAdditionalPhoneAfterMin'];ami['emit'](_0x00c8('0xbf'),ut[_0x00c8('0x80')](_0xedfbfa,'congestion'));rpcDb['createCustomerHistory'](_0xedfbfa,'[callProgressDetectingCustomer][logCongestion]');_0x57efca[_0x00c8('0xae')](_0xedfbfa,'8',_0x11f4db)[_0x00c8('0x5f')](function(_0x43340c){_0x59f3df=_0x43340c[_0x00c8('0x83')]==0x1;if(!_0x59f3df){if(ut[_0x00c8('0x7e')](_0xedfbfa)>=_0x11f4db['dialGlobalMaxRetry']){_0x3239ee=ut[_0x00c8('0xb7')](_0xedfbfa,0xf,_0x00c8('0x87'));rpcDb[_0x00c8('0x70')](_0x3239ee,_0x00c8('0xc0'));}else{if(_0xedfbfa[_0x00c8('0xc1')]>=_0x11f4db[_0x00c8('0xc2')]){rpcDb[_0x00c8('0x70')](_0xedfbfa,_0x00c8('0xc3'));}else{rpcDb[_0x00c8('0x8a')](ut[_0x00c8('0x8b')](_0xedfbfa,_0x00c8('0xc1'),_0x11f4db[_0x00c8('0xaa')]),_0xedfbfa[_0x00c8('0x8c')],_0xedfbfa[_0x00c8('0xb1')]);}}}else{_0xedfbfa[_0x00c8('0xc1')]++;_0x57efca[_0x00c8('0x90')]({'id':_0xedfbfa['idContact'],'field':{'countcongestionretry':_0xedfbfa[_0x00c8('0xc1')]}})[_0x00c8('0x5f')](function(){_0x57efca[_0x00c8('0x91')](_0xedfbfa,_0x2c000c,_0x2aa8aa)[_0x00c8('0x5f')](function(){});});}});break;case _0x00c8('0xc4'):_0x11f4db[_0x00c8('0xc5')]+=0x1;_0xedfbfa[_0x00c8('0xc6')]+=0x1;_0xedfbfa[_0x00c8('0x7d')]=ut['totalGlobal'](_0xedfbfa);ut[_0x00c8('0x6a')](_0xedfbfa,0x14,_0x00c8('0xc7'));_0x2c000c=_0x11f4db[_0x00c8('0xc8')];_0x2aa8aa=_0x11f4db[_0x00c8('0x85')];ami[_0x00c8('0x25')](_0x00c8('0xc9'),ut[_0x00c8('0x80')](_0xedfbfa,_0x00c8('0xca')));rpcDb[_0x00c8('0x6e')](_0xedfbfa,_0x00c8('0xcb'));_0x57efca[_0x00c8('0xae')](_0xedfbfa,'20',_0x11f4db)[_0x00c8('0x5f')](function(_0x29b616){_0x59f3df=_0x29b616[_0x00c8('0x83')]==0x1;if(!_0x59f3df){if(ut[_0x00c8('0x7e')](_0xedfbfa)>=_0x11f4db[_0x00c8('0x86')]){_0x3239ee=ut[_0x00c8('0xb7')](_0xedfbfa,0x14,_0x00c8('0xc7'));rpcDb[_0x00c8('0x70')](_0x3239ee,_0x00c8('0xcc'));}else{if(_0xedfbfa[_0x00c8('0xc6')]>=_0x11f4db[_0x00c8('0xcd')]){rpcDb[_0x00c8('0x70')](_0xedfbfa,_0x00c8('0xcc'));}else{rpcDb[_0x00c8('0x8a')](ut[_0x00c8('0x8b')](_0xedfbfa,'countagentrejectretry',_0x11f4db[_0x00c8('0xc8')]),_0xedfbfa[_0x00c8('0x8c')],_0xedfbfa[_0x00c8('0xb1')]);}}}else{_0xedfbfa['countnoanswerretry']++;_0x57efca[_0x00c8('0x90')]({'id':_0xedfbfa[_0x00c8('0x8f')],'field':{'countnoanswerretry':_0xedfbfa[_0x00c8('0xb4')]}})[_0x00c8('0x5f')](function(){_0x57efca[_0x00c8('0x91')](_0xedfbfa,_0x2c000c,_0x2aa8aa)[_0x00c8('0x5f')](function(){});});}});break;case _0x00c8('0xce'):_0x11f4db['outboundAbandonedCallsDay']+=0x1;_0xedfbfa[_0x00c8('0xcf')]+=0x1;_0xedfbfa[_0x00c8('0x7d')]=ut['totalGlobal'](_0xedfbfa);ut[_0x00c8('0x6a')](_0xedfbfa,0xb,_0x00c8('0xd0'));rpcDb[_0x00c8('0x6e')](_0xedfbfa,_0x00c8('0xd1'));_0x57efca[_0x00c8('0xae')](_0xedfbfa,'11',_0x11f4db)[_0x00c8('0x5f')](function(_0x166f47){_0x59f3df=_0x166f47['additional']==0x1;if(!_0x59f3df){if(ut[_0x00c8('0x7e')](_0xedfbfa)>=_0x11f4db[_0x00c8('0x86')]){_0x3239ee=ut[_0x00c8('0xb7')](_0xedfbfa,0xf,_0x00c8('0x87'));rpcDb['createCustomerFinal'](_0x3239ee,_0x00c8('0xd1'));}else{if(_0xedfbfa[_0x00c8('0xd2')]>=_0x11f4db[_0x00c8('0xd3')]){rpcDb['createCustomerFinal'](_0xedfbfa,_0x00c8('0xd1'));}else{rpcDb[_0x00c8('0x8a')](ut[_0x00c8('0x8b')](_0xedfbfa,_0x00c8('0xcf'),_0x11f4db[_0x00c8('0xd4')]),_0xedfbfa[_0x00c8('0x8c')],_0xedfbfa['activeContact']);}}}else{_0xedfbfa['countnoanswerretry']++;_0x57efca[_0x00c8('0x90')]({'id':_0xedfbfa['idContact'],'field':{'countnoanswerretry':_0xedfbfa[_0x00c8('0xb4')]}})[_0x00c8('0x5f')](function(){_0x57efca['swapAdditionalPhones'](_0xedfbfa,_0x2c000c,_0x2aa8aa)['then'](function(){});});}});break;case'18':_0x11f4db['outboundUnknownCallsDay']+=0x1;_0xedfbfa[_0x00c8('0xd5')]+=0x1;_0xedfbfa[_0x00c8('0x7d')]=ut[_0x00c8('0x7e')](_0xedfbfa);ut['logCustomer'](_0xedfbfa,0x12,_0x56e897[_0x00c8('0xd6')]||_0x56e897[_0x00c8('0xd7')]);ami[_0x00c8('0x25')](_0x00c8('0xd8'),ut[_0x00c8('0x80')](_0xedfbfa,'amd'));rpcDb[_0x00c8('0x6e')](_0xedfbfa,_0x00c8('0xd9'));_0x57efca[_0x00c8('0xae')](_0xedfbfa,'18',_0x11f4db)[_0x00c8('0x5f')](function(_0x3f1d88){_0x59f3df=_0x3f1d88[_0x00c8('0x83')]==0x1;if(!_0x59f3df){if(ut['totalGlobal'](_0xedfbfa)>=_0x11f4db['dialGlobalMaxRetry']){_0x3239ee=ut[_0x00c8('0xb7')](_0xedfbfa,0x12,'Global');rpcDb[_0x00c8('0x70')](_0x3239ee,_0x00c8('0xd9'));}else{rpcDb[_0x00c8('0x70')](_0xedfbfa,_0x00c8('0xd9'));}}else{_0xedfbfa['countnoanswerretry']++;_0x57efca['incrementPreviewCounters']({'id':_0xedfbfa[_0x00c8('0x8f')],'field':{'countnoanswerretry':_0xedfbfa[_0x00c8('0xb4')]}})['then'](function(){_0x57efca[_0x00c8('0x91')](_0xedfbfa,_0x2c000c,_0x2aa8aa)['then'](function(){});});}});delete this[_0x00c8('0x48')][_0x56e897['linkedid']];break;case'19':_0x11f4db[_0x00c8('0xda')]+=0x1;_0xedfbfa[_0x00c8('0x7d')]=ut[_0x00c8('0x7e')](_0xedfbfa);ut['logCustomer'](_0xedfbfa,0x13,_0x56e897['cause-txt']||_0x56e897[_0x00c8('0xd7')]);ami[_0x00c8('0x25')](_0x00c8('0xd8'),ut['buildObj'](_0xedfbfa,_0x00c8('0xdb')));rpcDb['createCustomerHistory'](_0xedfbfa,'[callProgressDetectingCustomer][machine]');_0x57efca[_0x00c8('0xae')](_0xedfbfa,'18',_0x11f4db)[_0x00c8('0x5f')](function(_0x33cb48){_0x59f3df=_0x33cb48[_0x00c8('0x83')]==0x1;if(!_0x59f3df){if(ut[_0x00c8('0x7e')](_0xedfbfa)>=_0x11f4db[_0x00c8('0x86')]){_0x3239ee=ut[_0x00c8('0xb7')](_0xedfbfa,0xf,_0x00c8('0x87'));rpcDb[_0x00c8('0x70')](_0x3239ee,'[callProgressDetectingCustomer][machine]');}else{rpcDb[_0x00c8('0x70')](_0xedfbfa,_0x00c8('0xdc'));}}else{_0xedfbfa[_0x00c8('0xb4')]++;_0x57efca['incrementPreviewCounters']({'id':_0xedfbfa[_0x00c8('0x8f')],'field':{'countnoanswerretry':_0xedfbfa[_0x00c8('0xb4')]}})['then'](function(){_0x57efca[_0x00c8('0x91')](_0xedfbfa,_0x2c000c,_0x2aa8aa)['then'](function(){});});}});delete this[_0x00c8('0x48')][_0x56e897['linkedid']];break;default:if(_0xedfbfa[_0x00c8('0x56')]){ut[_0x00c8('0x9d')](_0x11f4db,'[default]');ut[_0x00c8('0x57')](_0x00c8('0xdd')+_0x11f4db['name'],_0x56e897);}_0x11f4db[_0x00c8('0xda')]+=0x1;_0xedfbfa[_0x00c8('0x7d')]=ut['totalGlobal'](_0xedfbfa);ut[_0x00c8('0x6a')](_0xedfbfa,0xc,_0x56e897[_0x00c8('0xd6')]||_0x56e897[_0x00c8('0xd7')]);_0x2c000c=_0x11f4db[_0x00c8('0xc8')];_0x2aa8aa=_0x11f4db[_0x00c8('0x85')];rpcDb[_0x00c8('0x6e')](_0xedfbfa,_0x00c8('0xde'));_0x57efca['verifyAdditionalPhones'](_0xedfbfa,'20',_0x11f4db)[_0x00c8('0x5f')](function(_0x51e7df){_0x59f3df=_0x51e7df[_0x00c8('0x83')]==0x1;if(!_0x59f3df){if(ut['totalGlobal'](_0xedfbfa)>=_0x11f4db['dialGlobalMaxRetry']){_0x3239ee=ut[_0x00c8('0xb7')](_0xedfbfa,0xf,'Global');rpcDb[_0x00c8('0x70')](_0x3239ee,_0x00c8('0xdf'));}else{rpcDb[_0x00c8('0x70')](_0xedfbfa,_0x00c8('0xdf'));}delete this[_0x00c8('0x48')][_0x56e897['linkedid']];}else{_0x57efca[_0x00c8('0x91')](_0xedfbfa,_0x2c000c,_0x2aa8aa)['then'](function(){});}});}if(!(_0xedfbfa['dialAnswer']&&_0x3fc450==='16')){ut[_0x00c8('0x54')](_0x11f4db,'[callProgressDetectingCustomer]');logger['info'](_0x00c8('0xe0'),_0xedfbfa[_0x00c8('0x93')],_0x00c8('0x94'),_0x11f4db['name'],_0x00c8('0x4a'),_0x11f4db[_0x00c8('0x2e')]);}if(_0x3fc450!==_0x00c8('0xe1')){delete this[_0x00c8('0x48')][_0x56e897[_0x00c8('0x8d')]];delete this[_0x00c8('0x48')][_0x56e897['destlinkedid']];}_0x11f4db[_0x00c8('0xe2')]=!![];}};Preview[_0x00c8('0x3a')][_0x00c8('0xe3')]=function(_0x2f6f58,_0x2dc0ea,_0x5a4d1a){if(_[_0x00c8('0xe4')](_0x2dc0ea)&&_0x00c8('0xe5')!==typeof _0x2dc0ea){return;}if(_[_0x00c8('0xe4')](_0x5a4d1a)&&_0x00c8('0xe5')!==typeof _0x5a4d1a){return;}switch(_0x5a4d1a[_0x00c8('0xe6')]){case'0':ut[_0x00c8('0xe7')](_0x2f6f58,0x0,_0x00c8('0xe8'));rpcDb[_0x00c8('0xe9')](_0x2f6f58,_0x00c8('0xea'));break;case'3':ut[_0x00c8('0xe7')](_0x2f6f58,0x3,_0x00c8('0xeb'));rpcDb[_0x00c8('0xe9')](_0x2f6f58,_0x00c8('0xec'));break;case'5':ut[_0x00c8('0xe7')](_0x2f6f58,0x5,'Busy');rpcDb['createAgentHistory'](_0x2f6f58,_0x00c8('0xed'));break;case'8':ut[_0x00c8('0xe7')](_0x2f6f58,0x8,_0x00c8('0xbd'));rpcDb[_0x00c8('0xe9')](_0x2f6f58,_0x00c8('0xee'));break;case'22':ut[_0x00c8('0xe7')](_0x2f6f58,0x16,_0x00c8('0xef'));rpcDb['createAgentHistory'](_0x2f6f58,_0x00c8('0xf0'));break;default:ut[_0x00c8('0xe7')](_0x2f6f58,0xc,_0x5a4d1a['reason']);rpcDb['createAgentHistory'](_0x2f6f58,_0x00c8('0xee'));}ut['updateOriginated'](_0x2dc0ea,_0x00c8('0xf1'));logger['info'](_0x00c8('0xf2'),_0x2f6f58['uniqueid'],_0x00c8('0x94'),_0x2dc0ea[_0x00c8('0x2a')],_0x00c8('0x4a'),_0x2dc0ea[_0x00c8('0x2e')]);delete this[_0x00c8('0x48')][_0x2f6f58[_0x00c8('0x93')]];};Preview[_0x00c8('0x3a')]['verifyAdditionalPhones']=function(_0x56f4a6,_0x552855,_0x3c4f1b){return cmHopperAdditionalPhone[_0x00c8('0xae')](_0x56f4a6,_0x552855,_0x3c4f1b)['catch'](logger['info'](_0x00c8('0xf3')));};Preview[_0x00c8('0x3a')]['swapAdditionalPhones']=function(_0x2632e1,_0x5ecf04,_0x334128){return cmHopperAdditionalPhone[_0x00c8('0x91')](_0x2632e1,_0x5ecf04,_0x334128)['catch'](logger[_0x00c8('0x5b')]('[swapAdditionalPhone]\x20'));};Preview[_0x00c8('0x3a')][_0x00c8('0x90')]=function(_0x5fc32c){return Promise['resolve']()[_0x00c8('0x5f')](cmHopperAdditionalPhone[_0x00c8('0x90')](_0x5fc32c))[_0x00c8('0x53')](logger['info'](_0x00c8('0xf4')));};Preview[_0x00c8('0x3a')][_0x00c8('0xf5')]=function(_0x151e4c,_0x10014b,_0x541ee5,_0x36445b,_0x45b258){var _0x58438d=this;return new Promise(function(_0x3d1c5f,_0x481604){if(_[_0x00c8('0x47')](_0x10014b)||_[_0x00c8('0x47')](_0x10014b[_0x00c8('0xf6')])||_[_0x00c8('0x47')](_0x10014b['phone'])||_[_0x00c8('0x47')](_0x10014b['VoiceQueueId'])){_0x481604(ut[_0x00c8('0x32')](_0x00c8('0xf7'),_0x36445b,_0x45b258));return;}var _0x1cc4e3=uuid['v4']();var _0x3fff02=_0x58438d[_0x00c8('0x3b')][_0x10014b[_0x00c8('0xf8')][_0x00c8('0x2a')]];var _0x16e339=_0x541ee5?_0x58438d[_0x00c8('0x14')][_0x541ee5]['id']:undefined;_0x58438d[_0x00c8('0x48')][_0x1cc4e3]=new Action(_0x10014b,_0x3fff02,_0x1cc4e3,_0x541ee5,_0x16e339);var _0x1d10bc=_0x58438d['actions'][_0x1cc4e3];_0x1d10bc['unlockAgent']=_0x36445b;_0x1d10bc[_0x00c8('0xb1')]=_0x45b258;_0x1d10bc[_0x00c8('0xf9')]=_0x541ee5;if(_['isEmpty'](_0x151e4c)){_0x58438d[_0x00c8('0xfa')](_0x1d10bc,_0x3fff02,_0x10014b,_0x541ee5)[_0x00c8('0x5f')](function(_0x1886cf){logger[_0x00c8('0x5b')]('[Preview][execCall][success]','Queue:\x20'+_0x1d10bc[_0x00c8('0x4c')]+'\x20IdHopper:\x20'+_0x1d10bc[_0x00c8('0x8f')],JSON['stringify'](_0x1886cf));ami[_0x00c8('0x25')](_0x00c8('0xfb'),ut[_0x00c8('0x80')](_0x1d10bc,'called',_0x58438d['campaignsPreview'][_0x1d10bc[_0x00c8('0x4c')]]));_0x3d1c5f(ut[_0x00c8('0x32')]('Calling'));})['catch'](function(_0x200f66){ut[_0x00c8('0x34')](_0x00c8('0xfc'),_0x200f66);_0x481604(ut[_0x00c8('0x32')](_0x00c8('0xfd'),_0x36445b,_0x45b258));});}else{_0x3fff02['outboundBlacklistCallsDay']+=0x1;ut[_0x00c8('0xfe')](_0x1d10bc);rpcDb[_0x00c8('0xff')](_0x1d10bc,_0x00c8('0x100'));delete _0x58438d[_0x00c8('0x48')][_0x1cc4e3];_0x481604(ut[_0x00c8('0x32')](_0x00c8('0x101'),_0x36445b,_0x45b258));}});};Preview['prototype'][_0x00c8('0x78')]=function(_0x54bf05){return!_[_0x00c8('0x47')](_0x54bf05)&&!_[_0x00c8('0x47')](_0x54bf05['name'])&&!_[_0x00c8('0x47')](_0x54bf05['active'])&&_0x54bf05['active']&&!_[_0x00c8('0x47')](this[_0x00c8('0x13')][util['format']('SIP/%s',_0x54bf05[_0x00c8('0x2a')])])&&!_[_0x00c8('0x47')](this[_0x00c8('0x13')][util[_0x00c8('0x28')](_0x00c8('0x102'),_0x54bf05['name'])][_0x00c8('0x51')])&&(this[_0x00c8('0x13')][util[_0x00c8('0x28')]('SIP/%s',_0x54bf05['name'])][_0x00c8('0x51')]===_0x00c8('0x103')||this[_0x00c8('0x13')][util[_0x00c8('0x28')](_0x00c8('0x102'),_0x54bf05[_0x00c8('0x2a')])][_0x00c8('0x51')]===_0x00c8('0x104'));};Preview[_0x00c8('0x3a')][_0x00c8('0x64')]=function(_0x3e6c6a,_0x1f8d25){return this[_0x00c8('0x105')](_0x3e6c6a,_0x1f8d25)['then'](function(_0x37014b){return _[_0x00c8('0x106')](_0x37014b,[_0x00c8('0x32')]);})[_0x00c8('0x53')](function(_0x40893b){if(_0x40893b['unlock']){rpcDb[_0x00c8('0x107')](_0x3e6c6a);}if(_0x40893b[_0x00c8('0x108')]){rpcDb[_0x00c8('0x67')](_0x3e6c6a);}throw _[_0x00c8('0x106')](_0x40893b,['message']);});};Preview[_0x00c8('0x3a')][_0x00c8('0x105')]=function(_0x5c72f3,_0x3aa328){var _0x13f27d=this;var _0xa21e29,_0x2984d6;return rpcDb[_0x00c8('0x109')](_0x5c72f3)[_0x00c8('0x5f')](function(_0x5072b8){if(!_['isNil'](_0x5072b8[0x0])){_0x2984d6=_0x5072b8[0x0][_0x00c8('0x10a')]?![]:!![];_0xa21e29=_0x5072b8[0x0][_0x00c8('0x10a')]?!![]:![];_0xa21e29=_0x3aa328?!![]:_0xa21e29;}var _0x451ecd=_0x13f27d['validateContact'](_0x5072b8);if(_0x451ecd['isValid']){rpcDb[_0x00c8('0x10b')](_[_0x00c8('0x106')](_0x5072b8[0x0],[_0x00c8('0x4e'),_0x00c8('0x10c')]))[_0x00c8('0x5f')](function(_0x5ec8d0){_0x13f27d['checkInBlack'](_0x5ec8d0,_0x5072b8[0x0],_0x3aa328,_0x2984d6,_0xa21e29)[_0x00c8('0x5f')](function(_0x52364a){return _0x52364a;})['catch'](function(_0x1ded7){throw _0x1ded7;});})[_0x00c8('0x53')](function(_0x1ca04e){ut[_0x00c8('0x34')](_0x00c8('0x10d'),_0x1ca04e);throw ut[_0x00c8('0x32')](_0x00c8('0x10e'),_0x2984d6,_0xa21e29);});}else{throw ut['message'](_0x451ecd['message'],_0x2984d6,_0xa21e29);}})[_0x00c8('0x53')](function(_0x13d84a){ut[_0x00c8('0x34')]('[Preview][getContactPreview]',_0x13d84a);throw ut[_0x00c8('0x32')]('Call\x20unsuccessful',![],!![]);});};Preview['prototype']['validateContact']=function(_0x315cce){if(_[_0x00c8('0x47')](_0x315cce)||_['isEmpty'](_0x315cce)||!_[_0x00c8('0x47')](_0x315cce[0x0]['Agent'])&&_[_0x00c8('0x47')](_0x315cce[0x0][_0x00c8('0x62')][_0x00c8('0x2a')])){ut[_0x00c8('0x34')](_0x00c8('0x10f'),_0x315cce);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x4f54a9=this[_0x00c8('0x3b')][_0x315cce[0x0]['Queue'][_0x00c8('0x2a')]];_0x4f54a9[_0x00c8('0x32')]=utils[_0x00c8('0x33')][_0x00c8('0x110')];if(_[_0x00c8('0x47')](_0x4f54a9)){ut[_0x00c8('0x34')]('[Preview][validateContact][Empty\x20Campaign]',_0x4f54a9);return{'isValid':![],'message':_0x00c8('0x111')};}if(!this[_0x00c8('0x78')](_0x4f54a9[_0x00c8('0x77')])){ut[_0x00c8('0x34')](_0x00c8('0x112'),_0x00c8('0x113')+_0x4f54a9[_0x00c8('0x2a')]+'\x20Trunk\x20is\x20not\x20active');if(!this['isTrunkReachable'](_0x4f54a9['TrunkBackup'])){ut[_0x00c8('0x34')](_0x00c8('0x112'),_0x4f54a9['name']+_0x00c8('0x114'));return{'isValid':![],'message':_0x00c8('0x115')};}}if(!ut['isActive'](_0x4f54a9[_0x00c8('0x76')])){ut['logger']('[Preview][validateContact][Campaign\x20Active]',_0x4f54a9[_0x00c8('0x2a')]+_0x00c8('0x116'));return{'isValid':![],'message':_0x00c8('0x113')+_0x4f54a9[_0x00c8('0x2a')]+_0x00c8('0x116')};}return{'isValid':!![],'message':_0x00c8('0x117')};};Preview[_0x00c8('0x3a')][_0x00c8('0xfa')]=function(_0x5d33b1,_0x14b9ff,_0x4af3a7,_0x356d79){var _0x226f99=this;return new Promise(function(_0x5a1e37,_0x142fd5){var _0x4f39c2=_0x5d33b1[_0x00c8('0x93')];var _0x51ee55=_0x226f99[_0x00c8('0x78')](_0x14b9ff[_0x00c8('0x77')])?util[_0x00c8('0x28')](_0x00c8('0x118'),_0x14b9ff[_0x00c8('0x77')][_0x00c8('0x2a')],_[_0x00c8('0x47')](_0x14b9ff[_0x00c8('0x119')])?'':_0x14b9ff[_0x00c8('0x119')][_0x00c8('0x11a')]()||'',_0x14b9ff[_0x00c8('0x11b')]>0x0?_0x4af3a7[_0x00c8('0x10c')][_0x00c8('0x11c')](_0x14b9ff[_0x00c8('0x11b')]):_0x4af3a7[_0x00c8('0x10c')]):util[_0x00c8('0x28')](_0x00c8('0x118'),_[_0x00c8('0x47')](_0x14b9ff[_0x00c8('0x79')])?_0x14b9ff[_0x00c8('0x77')][_0x00c8('0x2a')]:_0x14b9ff[_0x00c8('0x79')]['name'],_[_0x00c8('0x47')](_0x14b9ff[_0x00c8('0x119')])?'':_0x14b9ff[_0x00c8('0x119')]['trim']()||'',_0x14b9ff[_0x00c8('0x11b')]>0x0?_0x4af3a7[_0x00c8('0x10c')][_0x00c8('0x11c')](_0x14b9ff[_0x00c8('0x11b')]):_0x4af3a7[_0x00c8('0x10c')]);var _0xa7d877=_0x226f99[_0x00c8('0x78')](_0x14b9ff[_0x00c8('0x77')])?ut['getCallerId'](_0x14b9ff[_0x00c8('0x77')][_0x00c8('0x11d')],_0x14b9ff[_0x00c8('0x11e')],_0x14b9ff[_0x00c8('0x11f')]>0x0?ut['getCallerIdRandom'](_0x14b9ff[_0x00c8('0x120')],_0x14b9ff[_0x00c8('0x11f')]):_0x14b9ff[_0x00c8('0x120')]):ut[_0x00c8('0x121')](_[_0x00c8('0x47')](_0x14b9ff[_0x00c8('0x79')])?_0x14b9ff[_0x00c8('0x77')][_0x00c8('0x11d')]:_0x14b9ff[_0x00c8('0x79')][_0x00c8('0x11d')],_0x14b9ff[_0x00c8('0x11e')],_0x14b9ff[_0x00c8('0x11f')]>0x0?ut[_0x00c8('0x122')](_0x14b9ff['dialOriginateCallerIdNumber'],_0x14b9ff[_0x00c8('0x11f')]):_0x14b9ff['dialOriginateCallerIdNumber']);if(_0xa7d877){_0x5d33b1[_0x00c8('0x123')]=ut[_0x00c8('0x124')](_0xa7d877);_0x5d33b1[_0x00c8('0x125')]=ut[_0x00c8('0x126')](_0xa7d877);}var _0x982caf=ut[_0x00c8('0x127')](_0x14b9ff,_0x4af3a7,_0x51ee55,_0xa7d877,_0x4f39c2,_0x5d33b1);var _0x15db5c=utils[_0x00c8('0x128')](_0x4af3a7[_0x00c8('0xf6')]);Object['assign'](_0x982caf,_0x15db5c);_[_0x00c8('0x129')](_0x5d33b1,ut[_0x00c8('0x12a')](_0x982caf));_0x5d33b1['starttime']=moment()[_0x00c8('0x28')](_0x00c8('0x68'));_0x14b9ff[_0x00c8('0x12b')]=_0x982caf;var _0x399b6b=ut['variablesAction'](_0x5d33b1,_0x14b9ff,_0x982caf,_0x5d33b1[_0x00c8('0xb1')],_0x356d79);return ami[_0x00c8('0x50')](_0x399b6b)[_0x00c8('0x5f')](function(_0x5082b9){_0x14b9ff[_0x00c8('0x2e')]+=0x1;logger[_0x00c8('0x5b')](_0x00c8('0x12c'),_0x4f39c2,_0x00c8('0x94'),_0x14b9ff[_0x00c8('0x2a')],_0x00c8('0x4a'),_0x14b9ff[_0x00c8('0x2e')]);_0x5a1e37(_0x5082b9);})[_0x00c8('0x53')](function(_0x14907f){ut['logAgent'](_0x5d33b1,0xe,_0x00c8('0x12d'));rpcDb[_0x00c8('0xe9')](_0x5d33b1,_0x00c8('0x12e'));_0x142fd5(_0x14907f);});});};Preview['prototype']['syncNewExten']=function(_0x1574a1){if(this[_0x00c8('0x48')][_0x1574a1[_0x00c8('0x8d')]]){this[_0x00c8('0x48')][_0x1574a1[_0x00c8('0x8d')]][_0x00c8('0x52')]=_0x1574a1[_0x00c8('0x52')];}};Preview['prototype'][_0x00c8('0x17')]=function(_0x35031c){var _0xff661e=this;var _0x6cc56e=this[_0x00c8('0x48')][_0x35031c['actionid']];if(_0x6cc56e){if(_0x6cc56e[_0x00c8('0xf9')]&&this[_0x00c8('0x14')][_0x6cc56e[_0x00c8('0xf9')]]){ut['logLookAgent'](_0x6cc56e,this[_0x00c8('0x14')][_0x6cc56e['lookAgent']][_0x00c8('0x2a')],this[_0x00c8('0x14')][_0x6cc56e[_0x00c8('0xf9')]]['id']);}var _0x1ee104=_['clone'](_0x6cc56e);_0x1ee104['responsetime']=moment()[_0x00c8('0x28')]('YYYY-MM-DD\x20HH:mm:ss');var _0x3bb056=_0xff661e[_0x00c8('0x3b')][_0x6cc56e[_0x00c8('0x4c')]];if(ut[_0x00c8('0x12f')](_0x35031c[_0x00c8('0x130')])){if(_0x6cc56e[_0x00c8('0x8c')]){rpcDb[_0x00c8('0x107')](_0x6cc56e[_0x00c8('0x8f')]);}if(_0x6cc56e[_0x00c8('0xb1')]){rpcDb[_0x00c8('0x67')](_0x6cc56e[_0x00c8('0x8f')]);}ami[_0x00c8('0x25')](_0x00c8('0x131'),ut[_0x00c8('0x80')](_0x6cc56e,_0x00c8('0x132'),this[_0x00c8('0x3b')][_0x6cc56e['queue']]));this[_0x00c8('0xe3')](_0x1ee104,_0x3bb056,_0x35031c);}else{_0x6cc56e[_0x00c8('0x133')]=moment()[_0x00c8('0x28')](_0x00c8('0x68'));ut[_0x00c8('0xe7')](_0x1ee104,0x4,_0x00c8('0x9f'));rpcDb[_0x00c8('0xe9')](_0x1ee104,_0x00c8('0x134'));}}};Preview[_0x00c8('0x3a')][_0x00c8('0x135')]=function(_0x1c486f){var _0x453c6c=this['actions'][_0x1c486f[_0x00c8('0x8d')]];var _0x19be2a;if(_0x453c6c){_0x19be2a=this[_0x00c8('0x3b')][_0x453c6c['queue']];logger[_0x00c8('0x5b')]('[syncHangup][talking]',_0x1c486f['linkedid'],_0x00c8('0x94'),_0x19be2a[_0x00c8('0x2a')],_0x00c8('0x4b'),_0x19be2a[_0x00c8('0x2f')]);}if(this[_0x00c8('0x48')][_0x1c486f['linkedid']]&&_0x1c486f[_0x00c8('0x8d')]!==_0x1c486f[_0x00c8('0x93')]){if(_0x1c486f[_0x00c8('0x136')]==='16'&&this[_0x00c8('0x48')][_0x1c486f[_0x00c8('0x8d')]][_0x00c8('0x56')]){this['callProgressDetectingCustomer'](_0x1c486f,_0x1c486f[_0x00c8('0x8d')],_0x1c486f[_0x00c8('0x136')]);}else if(this['actions'][_0x1c486f['linkedid']][_0x00c8('0x56')]){logger['info']('[syncHangup][talking][cause]',_0x1c486f[_0x00c8('0x8d')],_0x1c486f[_0x00c8('0x136')],_0x00c8('0x94'),_0x19be2a[_0x00c8('0x2a')],_0x00c8('0x4b'),_0x19be2a[_0x00c8('0x2f')]);this[_0x00c8('0x137')](_0x1c486f,_0x1c486f[_0x00c8('0x8d')],_0x1c486f[_0x00c8('0x136')]);}}else if(_0x453c6c&&_[_0x00c8('0x47')](_0x453c6c[_0x00c8('0x138')])&&_0x19be2a[_0x00c8('0x139')]&&_0x1c486f[_0x00c8('0x8d')]===_0x1c486f[_0x00c8('0x93')]&&_[_0x00c8('0x47')](_0x1c486f[_0x00c8('0xe6')])&&_0x1c486f[_0x00c8('0x136')]==='16'&&_0x1c486f[_0x00c8('0x13a')]==='6'&&_[_0x00c8('0xe4')](_0x453c6c['transfer'])){if(_0x453c6c[_0x00c8('0x8c')]){rpcDb['unlockContact'](_0x453c6c[_0x00c8('0x8f')]);}if(_0x453c6c[_0x00c8('0xb1')]){rpcDb['disableContact'](_0x453c6c[_0x00c8('0x8f')]);}_0x1c486f[_0x00c8('0xe6')]='22';this[_0x00c8('0xe3')](_0x453c6c,_0x19be2a,_0x1c486f);}else if(_0x453c6c&&_0x453c6c['transfer']){if(_0x1c486f[_0x00c8('0x136')]==='16'&&this['actions'][_0x1c486f['linkedid']][_0x00c8('0x56')]){logger['info'](_0x00c8('0x13b'),_0x1c486f[_0x00c8('0x8d')],_0x1c486f[_0x00c8('0x136')],_0x00c8('0x94'),_0x19be2a[_0x00c8('0x2a')],_0x00c8('0x4b'),_0x19be2a[_0x00c8('0x2f')]);this['callProgressDetectingCustomer'](_0x1c486f,_0x1c486f['linkedid'],_0x1c486f[_0x00c8('0x136')]);}else if(this[_0x00c8('0x48')][_0x1c486f[_0x00c8('0x8d')]][_0x00c8('0x56')]){logger['info'](_0x00c8('0x13c'),_0x1c486f[_0x00c8('0x8d')],_0x1c486f['cause'],'\x20Queue',_0x19be2a[_0x00c8('0x2a')],'pTalking:\x20',_0x19be2a['pTalking']);this[_0x00c8('0x137')](_0x1c486f,_0x1c486f[_0x00c8('0x8d')],_0x1c486f['cause']);}}};Preview[_0x00c8('0x3a')][_0x00c8('0x1c')]=function(_0x56a600){if(this[_0x00c8('0x48')][_0x56a600[_0x00c8('0x13d')]]&&_0x56a600[_0x00c8('0x13d')]!==_0x56a600[_0x00c8('0x13e')]){this[_0x00c8('0x137')](_0x56a600,_0x56a600[_0x00c8('0x13d')],_0x56a600['dialstatus']);}};Preview[_0x00c8('0x3a')][_0x00c8('0x1b')]=function(_0x2a9bbb){if(this[_0x00c8('0x48')][_0x2a9bbb['linkedid']]&&_0x2a9bbb[_0x00c8('0x8d')]!==_0x2a9bbb[_0x00c8('0x93')]&&!this[_0x00c8('0x48')][_0x2a9bbb[_0x00c8('0x8d')]][_0x00c8('0x56')]){if(_0x2a9bbb[_0x00c8('0x136')]==='1'){this[_0x00c8('0x137')](_0x2a9bbb,_0x2a9bbb['linkedid'],_0x2a9bbb[_0x00c8('0x136')]);}}};Preview[_0x00c8('0x3a')][_0x00c8('0x13f')]=function(_0x2c7982,_0x552c55,_0x58549c){if(this[_0x00c8('0x48')][_0x2c7982]){if(_[_0x00c8('0x47')](this[_0x00c8('0x48')][_0x2c7982][_0x00c8('0x12b')])){this[_0x00c8('0x48')][_0x2c7982][_0x00c8('0x12b')]={};}this[_0x00c8('0x48')][_0x2c7982][_0x00c8('0x12b')][_0x552c55]=_0x58549c;}};Preview['prototype']['syncVarSet']=function(_0x3557b2){try{if(!_[_0x00c8('0x47')](_0x3557b2)){if(ut[_0x00c8('0x140')](_[_0x00c8('0x141')](_0x3557b2[_0x00c8('0x142')])[0x0])){this[_0x00c8('0x13f')](_0x3557b2[_0x00c8('0x93')],_['keys'](_0x3557b2[_0x00c8('0x142')])[0x0],_0x3557b2[_0x00c8('0x143')]);}}}catch(_0x35894c){logger['error'](_0x00c8('0x144'),util[_0x00c8('0x145')](_0x35894c,{'showHidden':![],'depth':null}));}};Preview[_0x00c8('0x3a')][_0x00c8('0x22')]=function(_0x2446e2){if(_0x2446e2){if(this[_0x00c8('0x48')][_0x2446e2[_0x00c8('0x146')]]){this['actions'][_0x2446e2['transfertargetlinkedid']][_0x00c8('0x147')]=!![];}}};Preview[_0x00c8('0x3a')]['syncBlindTransfer']=function(_0xdd4f63){if(_0xdd4f63){if(this[_0x00c8('0x48')][_0xdd4f63[_0x00c8('0x148')]]){this['actions'][_0xdd4f63[_0x00c8('0x148')]][_0x00c8('0x147')]=!![];}}};module[_0x00c8('0x149')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 2807fa6..3bc3e63 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 _0xdbcd=['connectedlinename','context','from-sip','exten','holdtime','assigned','queuecallerexitreason','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','rescheduleContact','[rescheduleContactInQueue]\x20','bluebird','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueReport','error','inspect','catch','[createHistory]\x20','resolve','then','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createHistory','createCustomerHistory','UserId','active','[rescheduleContact]\x20','countReScheduled','unlockContact','disableContact','[activeContact]\x20','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdbcd,0xe2));var _0xddbc=function(_0x3a5dd1,_0x5ed411){_0x3a5dd1=_0x3a5dd1-0x0;var _0x40878b=_0xdbcd[_0x3a5dd1];return _0x40878b;};'use strict';var util=require('util');var BPromise=require(_0xddbc('0x0'));var logger=require(_0xddbc('0x1'))(_0xddbc('0x2'));var cmHopper=require(_0xddbc('0x3'));var cmHopperHistory=require(_0xddbc('0x4'));var cmHopperBlack=require(_0xddbc('0x5'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0xddbc('0x6'));function loggerCatch(_0xb20ef3){return function(_0x48a769){logger[_0xddbc('0x7')](_0xb20ef3,util[_0xddbc('0x8')](_0x48a769,{'showHidden':![],'depth':null}));};}function create(_0x13b88c){return cmHopperHistory['createHistory'](_0x13b88c)[_0xddbc('0x9')](loggerCatch(_0xddbc('0xa')));}function createAgent(_0x2f56e3){return BPromise[_0xddbc('0xb')]()[_0xddbc('0xc')](agentReportPreview['createHistory'](_0x2f56e3))['catch'](loggerCatch(_0xddbc('0xa')));}function moveContact(_0x508cde){return cmHopper[_0xddbc('0xd')](_0x508cde,!![])[_0xddbc('0x9')](loggerCatch(_0xddbc('0xe')));}exports[_0xddbc('0xf')]=function(_0x127267){return cmHopperBlack[_0xddbc('0xf')](_0x127267)['catch'](loggerCatch(_0xddbc('0x10')));};exports['getContactPreview']=function(_0x54ffa2){return BPromise[_0xddbc('0xb')]()[_0xddbc('0xc')](cmHopper[_0xddbc('0x11')](_0x54ffa2))[_0xddbc('0x9')](loggerCatch(_0xddbc('0x12')));};exports[_0xddbc('0x13')]=function(_0x77ea4c,_0x449d8e){create(_0x77ea4c)[_0xddbc('0x9')](loggerCatch(_0x449d8e));moveContact(_0x77ea4c)[_0xddbc('0x9')](loggerCatch(_0x449d8e));};exports['createAgentHistory']=function(_0x171366,_0x1d8904){createAgent(_0x171366)['catch'](loggerCatch(_0x1d8904));};exports[_0xddbc('0x14')]=function(_0x572863,_0x2acf9d){create(_0x572863)[_0xddbc('0x9')](loggerCatch(_0x2acf9d));};exports['createCustomerFinal']=function(_0x3ed790,_0x33701a){moveContact(_0x3ed790)['catch'](loggerCatch(_0x33701a));};exports['rescheduleContact']=function(_0x48f427,_0x25eecd,_0x67ac91){if(_0x25eecd){_0x48f427[_0xddbc('0x15')]=null;}if(_0x67ac91){_0x48f427[_0xddbc('0x16')]=![];}return cmHopper['rescheduleContact'](_0x48f427)[_0xddbc('0x9')](loggerCatch(_0xddbc('0x17')));};exports[_0xddbc('0x18')]=function(_0x3ff471){return cmHopper['countReScheduled'](_0x3ff471)[_0xddbc('0x9')](loggerCatch('[countReScheduled]\x20'));};exports['unlockContact']=function(_0x458ecf){return cmHopper[_0xddbc('0x19')]({'UserId':null},_0x458ecf,0x1)['catch'](loggerCatch('[unlockContact]\x20'));};exports[_0xddbc('0x1a')]=function(_0x23e02){return cmHopper['unlockContact']({'active':![]},_0x23e02,0x1)[_0xddbc('0x9')](loggerCatch(_0xddbc('0x1b')));};exports['crateCustomerReportQueue']=function(_0x31ca92){var _0x438b80={};_0x438b80['type']=_0x31ca92[_0xddbc('0x1c')];_0x438b80[_0xddbc('0x1d')]=_0x31ca92[_0xddbc('0x1d')];_0x438b80[_0xddbc('0x1e')]=_0x31ca92['calleridnum'];_0x438b80['calleridname']=_0x31ca92[_0xddbc('0x1f')];_0x438b80[_0xddbc('0x20')]=_0x31ca92[_0xddbc('0x20')];_0x438b80[_0xddbc('0x21')]=_0x31ca92[_0xddbc('0x22')];_0x438b80[_0xddbc('0x23')]=_0x31ca92[_0xddbc('0x22')];_0x438b80[_0xddbc('0x24')]=0x1;_0x438b80[_0xddbc('0x25')]=_0x31ca92[_0xddbc('0x26')];_0x438b80[_0xddbc('0x27')]=_0x31ca92['membername'];_0x438b80[_0xddbc('0x28')]=_0xddbc('0x29');_0x438b80[_0xddbc('0x2a')]='xcally-motion-preview';_0x438b80[_0xddbc('0x2b')]=0x0;_0x438b80[_0xddbc('0x2c')]=0x1;_0x438b80['lastAssignedTo']=_0x31ca92['membername'];_0x438b80[_0xddbc('0x2d')]='COMPLETED';return BPromise['resolve']()[_0xddbc('0xc')](voiceQueueReport[_0xddbc('0x2e')](_0x438b80))[_0xddbc('0x9')](loggerCatch(_0xddbc('0x2f')));};exports[_0xddbc('0x30')]=function(_0x53b095,_0x233b0e){return BPromise['resolve']()[_0xddbc('0xc')](cmHopper[_0xddbc('0x30')](_0x53b095,_0x233b0e))['catch'](loggerCatch(_0xddbc('0x31')));};exports[_0xddbc('0x32')]=function(_0x11ebea){return cmHopper[_0xddbc('0x33')](_0x11ebea,!![],!![])[_0xddbc('0x9')](loggerCatch(_0xddbc('0x34')));}; \ No newline at end of file +var _0x5c37=['then','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','resolve','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','answertime','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','context','from-sip','exten','xcally-motion-preview','membername','queuecallerexitreason','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','util','bluebird','../../../config/logger','preview','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','createHistory','catch','[createHistory]\x20'];(function(_0x20593e,_0x2f8bde){var _0x4f8546=function(_0x41cac5){while(--_0x41cac5){_0x20593e['push'](_0x20593e['shift']());}};_0x4f8546(++_0x2f8bde);}(_0x5c37,0x9a));var _0x75c3=function(_0x50d84b,_0x1d7ea7){_0x50d84b=_0x50d84b-0x0;var _0x6d4270=_0x5c37[_0x50d84b];return _0x6d4270;};'use strict';var util=require(_0x75c3('0x0'));var BPromise=require(_0x75c3('0x1'));var logger=require(_0x75c3('0x2'))(_0x75c3('0x3'));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require('../rpc/cmHopperBlack');var agentReportPreview=require(_0x75c3('0x4'));var voiceQueueReport=require(_0x75c3('0x5'));function loggerCatch(_0x175923){return function(_0x76cb74){logger[_0x75c3('0x6')](_0x175923,util[_0x75c3('0x7')](_0x76cb74,{'showHidden':![],'depth':null}));};}function create(_0x3593d1){return cmHopperHistory[_0x75c3('0x8')](_0x3593d1)[_0x75c3('0x9')](loggerCatch(_0x75c3('0xa')));}function createAgent(_0x485931){return BPromise['resolve']()[_0x75c3('0xb')](agentReportPreview[_0x75c3('0x8')](_0x485931))[_0x75c3('0x9')](loggerCatch('[createHistory]\x20'));}function moveContact(_0x3eba43){return cmHopper[_0x75c3('0xc')](_0x3eba43,!![])['catch'](loggerCatch(_0x75c3('0xd')));}exports[_0x75c3('0xe')]=function(_0x2c1880){return cmHopperBlack[_0x75c3('0xe')](_0x2c1880)[_0x75c3('0x9')](loggerCatch(_0x75c3('0xf')));};exports['getContactPreview']=function(_0x20c7bc){return BPromise[_0x75c3('0x10')]()[_0x75c3('0xb')](cmHopper[_0x75c3('0x11')](_0x20c7bc))[_0x75c3('0x9')](loggerCatch(_0x75c3('0x12')));};exports['createHistory']=function(_0x1f01ae,_0x5b88d9){create(_0x1f01ae)[_0x75c3('0x9')](loggerCatch(_0x5b88d9));moveContact(_0x1f01ae)['catch'](loggerCatch(_0x5b88d9));};exports[_0x75c3('0x13')]=function(_0x2795d4,_0x2fd67a){createAgent(_0x2795d4)[_0x75c3('0x9')](loggerCatch(_0x2fd67a));};exports[_0x75c3('0x14')]=function(_0x2aaa87,_0x1412c4){create(_0x2aaa87)['catch'](loggerCatch(_0x1412c4));};exports[_0x75c3('0x15')]=function(_0xf9ad04,_0x3542a6){moveContact(_0xf9ad04)[_0x75c3('0x9')](loggerCatch(_0x3542a6));};exports[_0x75c3('0x16')]=function(_0x273972,_0x56207f,_0x305f06){if(_0x56207f){_0x273972[_0x75c3('0x17')]=null;}if(_0x305f06){_0x273972[_0x75c3('0x18')]=![];}return cmHopper[_0x75c3('0x16')](_0x273972)[_0x75c3('0x9')](loggerCatch(_0x75c3('0x19')));};exports['countReScheduled']=function(_0x4ad7a6){return cmHopper['countReScheduled'](_0x4ad7a6)[_0x75c3('0x9')](loggerCatch(_0x75c3('0x1a')));};exports['unlockContact']=function(_0x5901ba){return cmHopper[_0x75c3('0x1b')]({'UserId':null},_0x5901ba,0x1)[_0x75c3('0x9')](loggerCatch(_0x75c3('0x1c')));};exports[_0x75c3('0x1d')]=function(_0x24c5c1){return cmHopper[_0x75c3('0x1b')]({'active':![]},_0x24c5c1,0x1)[_0x75c3('0x9')](loggerCatch(_0x75c3('0x1e')));};exports[_0x75c3('0x1f')]=function(_0x19013d){var _0x86a3ba={};_0x86a3ba[_0x75c3('0x20')]=_0x19013d[_0x75c3('0x20')];_0x86a3ba[_0x75c3('0x21')]=_0x19013d[_0x75c3('0x21')];_0x86a3ba[_0x75c3('0x22')]=_0x19013d['calleridnum'];_0x86a3ba[_0x75c3('0x23')]=_0x19013d['calleridname'];_0x86a3ba[_0x75c3('0x24')]=_0x19013d[_0x75c3('0x24')];_0x86a3ba[_0x75c3('0x25')]=_0x19013d['answertime'];_0x86a3ba[_0x75c3('0x26')]=_0x19013d[_0x75c3('0x27')];_0x86a3ba[_0x75c3('0x28')]=0x1;_0x86a3ba[_0x75c3('0x29')]=_0x19013d[_0x75c3('0x2a')];_0x86a3ba[_0x75c3('0x2b')]=_0x19013d['membername'];_0x86a3ba[_0x75c3('0x2c')]=_0x75c3('0x2d');_0x86a3ba[_0x75c3('0x2e')]=_0x75c3('0x2f');_0x86a3ba['holdtime']=0x0;_0x86a3ba['assigned']=0x1;_0x86a3ba['lastAssignedTo']=_0x19013d[_0x75c3('0x30')];_0x86a3ba[_0x75c3('0x31')]='COMPLETED';return BPromise['resolve']()[_0x75c3('0xb')](voiceQueueReport[_0x75c3('0x32')](_0x86a3ba))[_0x75c3('0x9')](loggerCatch(_0x75c3('0x33')));};exports[_0x75c3('0x34')]=function(_0x11e03a,_0x5ba71e){return BPromise[_0x75c3('0x10')]()[_0x75c3('0xb')](cmHopper[_0x75c3('0x34')](_0x11e03a,_0x5ba71e))[_0x75c3('0x9')](loggerCatch(_0x75c3('0x35')));};exports[_0x75c3('0x36')]=function(_0x23b796){return cmHopper['rescheduleContact'](_0x23b796,!![],!![])[_0x75c3('0x9')](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ No newline at end of file diff --git a/server/services/ami/preview/util/util.js b/server/services/ami/preview/util/util.js index af849e3..21bf03d 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 _0xcfb9=['logger2','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isNil','addVariables','Queue','name','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','toLowerVariables','hasOwnProperty','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','responsetime','endtime','logAgent','ringtime','starttime','logLookAgent','UserId','logCustomer','talktime','answertime','isFailure','Failure','variablesAction','RECALL','BOOKED','uniqueid','originate','timeout','totalGlobal','countbusyretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','scheduledAt','scheduledat','add','minutes','ListId','pTalking','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','queue','channelAgent','motionChannel','voice','mandatoryDisposition','buildObj','buildAcw','interface','agentReadyId','not_inuse','reachable','push','getDiff','milliseconds','diff','createBody','CampaignId','filterKey','idContact','campaigntype','dialAnswer','membername','active','countcongestionretry','countglobal','callback','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-phone','xmd-listid','xmd-dialtimeout','xmd-dialoptions','xmd-contactid','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqoslossbridged','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','extractCalleridNumber','variables','keys','forEach','toLowerCase','lodash','moment','preview','env','XCALLY_IP_AGI','127.0.0.1','../../dialer/utils','loggerCatch','error','inspect','logger','info','loggerError'];(function(_0x3d5df9,_0x5b3623){var _0x50ba39=function(_0x3c0de0){while(--_0x3c0de0){_0x3d5df9['push'](_0x3d5df9['shift']());}};_0x50ba39(++_0x5b3623);}(_0xcfb9,0x115));var _0x9cfb=function(_0x11ba83,_0xd5611a){_0x11ba83=_0x11ba83-0x0;var _0x3f3925=_0xcfb9[_0x11ba83];return _0x3f3925;};'use strict';var util=require('util');var _=require(_0x9cfb('0x0'));var moment=require(_0x9cfb('0x1'));var logger=require('../../../../config/logger')(_0x9cfb('0x2'));var ipAgi=process[_0x9cfb('0x3')][_0x9cfb('0x4')]||_0x9cfb('0x5');var utils=require(_0x9cfb('0x6'));exports[_0x9cfb('0x7')]=function(_0x10a57c){return function(_0x567af0){logger[_0x9cfb('0x8')](_0x10a57c,util[_0x9cfb('0x9')](_0x567af0,{'showHidden':![],'depth':null}));};};exports[_0x9cfb('0xa')]=function(_0x3a2d0a,_0xa5ea9f){logger[_0x9cfb('0xb')](_0x3a2d0a,util[_0x9cfb('0x9')](_0xa5ea9f,{'showHidden':![],'depth':null}));};exports[_0x9cfb('0xc')]=function(_0x102fa1,_0x600e34){logger['error'](_0x102fa1,util[_0x9cfb('0x9')](_0x600e34,{'showHidden':![],'depth':null}));};exports[_0x9cfb('0xd')]=function(_0x5a28bf){return function(_0x5e0f2f){logger[_0x9cfb('0xb')](_0x5a28bf,util['inspect'](_0x5e0f2f,{'showHidden':![],'depth':null}));};};exports[_0x9cfb('0xe')]=function(_0x3ec60a,_0x4a942b,_0x3eb1ca){return{'message':_0x3ec60a,'unlock':_0x4a942b,'active':_0x3eb1ca};};exports[_0x9cfb('0xf')]=function(_0x40779d,_0x523408,_0x344838){if(!_[_0x9cfb('0x10')](_0x344838)&&_0x9cfb('0x11')===typeof _0x344838&&!_[_0x9cfb('0x12')](_0x344838)){if(!_[_0x9cfb('0x10')](_0x523408)&&_0x9cfb('0x11')===typeof _0x523408&&!_[_0x9cfb('0x12')](_0x523408)){return util[_0x9cfb('0x13')](_0x9cfb('0x14'),_0x523408,_0x344838);}return util['format'](_0x9cfb('0x14'),_0x344838,_0x344838);}if(!_[_0x9cfb('0x10')](_0x40779d)&&_0x9cfb('0x11')===typeof _0x40779d&&!_[_0x9cfb('0x12')](_0x40779d)){return _0x40779d;}return _0x9cfb('0x15');};exports['isActive']=function(_0x3babc2){if(_[_0x9cfb('0x16')](_0x3babc2)){return![];}return _0x3babc2;};exports[_0x9cfb('0x17')]=function(_0x2a780c,_0x3b6323,_0x40d461,_0x1f20c3,_0x28923a,_0x5ca9c0){var _0x448f7c={'XMD-QUEUE':_0x3b6323[_0x9cfb('0x18')]?_0x3b6323[_0x9cfb('0x18')][_0x9cfb('0x19')]:'','XMD-CALLERID':_0x1f20c3,'XMD-CALLERID-PREVIEW':_0x5ca9c0?util['format'](_0x9cfb('0x14'),_0x5ca9c0[_0x9cfb('0x1a')],_0x5ca9c0[_0x9cfb('0x1b')]):_0x1f20c3,'XMD-DIALID':_0x28923a,'XMD-CONTACTID':_0x3b6323[_0x9cfb('0x1c')],'XMD-CDRTYPE':_0x9cfb('0x1d'),'CALLERID(all)':_0x1f20c3,'XMD-VOICEQUEUEID':_0x3b6323[_0x9cfb('0x1e')],'XMD-DIALCHANNEL':_0x40d461,'XMD-DIALTIMEOUT':_0x2a780c[_0x9cfb('0x1f')]||0x1e,'XMD-DIALOPTIONS':util['format'](_0x9cfb('0x20'),_0x2a780c[_0x9cfb('0x21')]?'g':'',_[_0x9cfb('0x12')](_0x2a780c[_0x9cfb('0x22')])?'':_0x9cfb('0x23')),'XMD-DIALURL':_0x2a780c[_0x9cfb('0x24')]||'','XMD-AGI':_0x2a780c[_0x9cfb('0x25')]?util[_0x9cfb('0x13')](_0x9cfb('0x26'),ipAgi,_0x2a780c[_0x9cfb('0x25')]):_0x9cfb('0x27'),'XMD-AGIAFTER':_0x2a780c[_0x9cfb('0x21')]?util[_0x9cfb('0x13')]('\x22agi://%s/square,%s\x22',ipAgi,_0x2a780c[_0x9cfb('0x21')]):_0x9cfb('0x27'),'XMD-ORIGINATECALLERIDNUM':_0x5ca9c0?_0x5ca9c0['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x5ca9c0?_0x5ca9c0[_0x9cfb('0x28')]:'','XMD-DESTINATION':_0x9cfb('0x29'),'SIPADDHEADER':_0x9cfb('0x2a')};if(!_[_0x9cfb('0x12')](_0x2a780c[_0x9cfb('0x22')])){_0x448f7c[util[_0x9cfb('0x13')]('%s',_0x9cfb('0x2b'))]=_0x2a780c['monitor_format'];_0x448f7c[util[_0x9cfb('0x13')]('%s',_0x9cfb('0x2c'))]=_0x28923a;}return _0x448f7c;};exports[_0x9cfb('0x2d')]=function(_0x33976a){var _0x45d656={};for(var _0x282b5a in _0x33976a){if(_0x33976a[_0x9cfb('0x2e')](_0x282b5a)){_0x45d656[util[_0x9cfb('0x13')]('%s',_[_0x9cfb('0x2f')](_0x282b5a))]=_0x33976a[_0x282b5a];}}return{'variables':_0x45d656};};exports[_0x9cfb('0x30')]=function(_0x111b10,_0x462a8d){if(!_[_0x9cfb('0x16')](_0x111b10)){if(_0x111b10[_0x9cfb('0x2e')](_0x9cfb('0x31'))){if(_0x111b10[_0x9cfb('0x31')]>0x0){_0x111b10[_0x9cfb('0x31')]-=0x1;}else{logger[_0x9cfb('0x8')](_0x9cfb('0x32'),_0x462a8d);}}}else{logger[_0x9cfb('0x8')](_0x9cfb('0x33'),_0x462a8d);}};exports[_0x9cfb('0x34')]=function(_0x3c230b){var _0x54138f=moment()[_0x9cfb('0x13')](_0x9cfb('0x35'));_0x3c230b[_0x9cfb('0x36')]=0xd;_0x3c230b[_0x9cfb('0x37')]=_0x9cfb('0x38');_0x3c230b['starttime']=_0x54138f;_0x3c230b[_0x9cfb('0x39')]=_0x54138f;_0x3c230b[_0x9cfb('0x3a')]=_0x54138f;};exports[_0x9cfb('0x3b')]=function(_0x228b1f,_0x329401,_0x4d95be){var _0x1d56ae=moment()['format'](_0x9cfb('0x35'));_0x228b1f[_0x9cfb('0x36')]=_0x329401;_0x228b1f[_0x9cfb('0x37')]=_0x4d95be;_0x228b1f[_0x9cfb('0x39')]=_0x1d56ae;_0x228b1f[_0x9cfb('0x3c')]=utils['getSeconds'](_0x228b1f[_0x9cfb('0x39')],_0x228b1f[_0x9cfb('0x3d')]);};exports[_0x9cfb('0x3e')]=function(_0x17fae6,_0x330f6b,_0x37de3a){_0x17fae6['membername']=_0x330f6b;_0x17fae6[_0x9cfb('0x3f')]=_0x37de3a;};exports[_0x9cfb('0x40')]=function(_0x4ad349,_0x3cdb45,_0x391fd1){var _0x466205=moment()[_0x9cfb('0x13')](_0x9cfb('0x35'));_0x4ad349['state']=_0x3cdb45;_0x4ad349['statedesc']=_0x391fd1;_0x4ad349[_0x9cfb('0x39')]=_0x4ad349[_0x9cfb('0x39')]?_0x4ad349[_0x9cfb('0x39')]:_0x466205;_0x4ad349[_0x9cfb('0x3a')]=_0x4ad349[_0x9cfb('0x3a')]?_0x4ad349[_0x9cfb('0x3a')]:_0x466205;_0x4ad349['ringtime']=utils['getSeconds'](_0x4ad349[_0x9cfb('0x39')]||0x0,_0x4ad349[_0x9cfb('0x3d')]||0x0);_0x4ad349[_0x9cfb('0x41')]=_0x4ad349[_0x9cfb('0x42')]?utils['getSeconds'](_0x4ad349['endtime'],_0x4ad349[_0x9cfb('0x42')]):0x0;};exports[_0x9cfb('0x43')]=function(_0x49c761){return _0x49c761===_0x9cfb('0x44');};exports[_0x9cfb('0x45')]=function(_0xf7b79c,_0x11bece,_0xe8e8ea,_0xe3ce0,_0x1ad19c){var _0x1c9c57=_0xe3ce0?_0x9cfb('0x46'):_0xf7b79c[_0x9cfb('0x1a')];_0x1c9c57=_0x1ad19c?_0x9cfb('0x47'):_0x1c9c57;return{'actionid':_0xf7b79c[_0x9cfb('0x48')],'action':_0x9cfb('0x49'),'channel':_0xf7b79c['channelAgent'],'callerid':util[_0x9cfb('0x13')](_0x9cfb('0x14'),_0x1c9c57,_0xf7b79c['calleridnum']),'Exten':_0x9cfb('0x29'),'Context':'from-sip','Priority':'1','variable':_0xe8e8ea,'timeout':(_0x11bece[_0x9cfb('0x4a')]||0x1e)*0x3e8,'async':!![],'channelid':_0xf7b79c['uniqueid']};};exports[_0x9cfb('0x4b')]=function(_0x52172d){return _0x52172d[_0x9cfb('0x4c')]+_0x52172d['countcongestionretry']+_0x52172d[_0x9cfb('0x4d')]+_0x52172d[_0x9cfb('0x4e')]+_0x52172d[_0x9cfb('0x4f')];};exports[_0x9cfb('0x50')]=function(_0x304e42){var _0x2b142b=_['clone'](_0x304e42);_0x2b142b[_0x9cfb('0x36')]=0xf;_0x2b142b['statedesc']='Global';return _0x2b142b;};exports[_0x9cfb('0x51')]=function(_0x113528,_0x2e6db7,_0x4dd341){var _0x55f1bb={};_0x55f1bb[_0x2e6db7]=_0x113528[_0x2e6db7];_0x55f1bb['active']=![];_0x55f1bb[_0x9cfb('0x52')]=moment()[_0x9cfb('0x53')](_0x4dd341,_0x9cfb('0x54'))[_0x9cfb('0x13')](_0x9cfb('0x35'));_0x55f1bb['ContactId']=_0x113528['ContactId'];_0x55f1bb['ListId']=_0x113528[_0x9cfb('0x55')];_0x55f1bb['VoiceQueueId']=_0x113528[_0x9cfb('0x1e')]||undefined;return _0x55f1bb;};exports['decrementTalkink']=function(_0x472200,_0x5aa5da){if(!_[_0x9cfb('0x16')](_0x472200)){if(_0x472200[_0x9cfb('0x56')]>0x0){_0x472200[_0x9cfb('0x56')]-=0x1;}else{logger[_0x9cfb('0x8')](_0x5aa5da,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger['error'](_0x5aa5da,_0x9cfb('0x57'));}};exports[_0x9cfb('0x58')]=function(_0x2a3b25){if(_0x2a3b25<=0x0){return!![];}return![];};function buildObj(_0x325610,_0x5191b2,_0x1d3764){_0x325610['lastevent']=_0x5191b2;_0x325610[_0x9cfb('0x19')]=_0x325610[_0x9cfb('0x59')];_0x325610['interface']=_0x325610[_0x9cfb('0x5a')];_0x325610[_0x9cfb('0x5b')]=_0x9cfb('0x5c');if(_0x1d3764){_0x325610[_0x9cfb('0x5d')]=_0x1d3764[_0x9cfb('0x5d')];}return _0x325610;}exports[_0x9cfb('0x5e')]=buildObj;exports[_0x9cfb('0x5f')]=function(_0x4d9c74){var _0x34ce83={};_0x34ce83[_0x9cfb('0x59')]=_0x4d9c74[_0x9cfb('0x59')];_0x34ce83[_0x9cfb('0x60')]=_0x4d9c74[_0x9cfb('0x5a')];_0x34ce83[_0x9cfb('0x48')]=_0x4d9c74[_0x9cfb('0x48')];return _0x34ce83;};exports[_0x9cfb('0x61')]=function(_0x44fbfc){var _0x3e2487=[];for(var _0x5b1870 in _0x44fbfc){if(_0x44fbfc[_0x9cfb('0x2e')](_0x5b1870)){if(!_[_0x9cfb('0x16')](_0x44fbfc[_0x5b1870])&&_0x44fbfc[_0x5b1870][_0x9cfb('0x36')]===_0x9cfb('0x62')&&_0x44fbfc[_0x5b1870]['status']===_0x9cfb('0x63')){_0x3e2487[_0x9cfb('0x64')](_0x44fbfc[_0x5b1870]['id']);}}}return _0x3e2487;};exports[_0x9cfb('0x65')]=function(_0x2b1346){var _0x2e76da=moment()[_0x9cfb('0x66')](0x0);var _0x22f5c1=moment(_0x2b1346)['milliseconds'](0x0);return _0x2e76da[_0x9cfb('0x67')](_0x22f5c1,'seconds');};exports[_0x9cfb('0x68')]=function(_0x471949){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x471949[_0x9cfb('0x1c')],'ListId':_0x471949['ListId'],'VoiceQueueId':_0x471949['VoiceQueueId']||undefined,'CampaignId':_0x471949[_0x9cfb('0x69')]||undefined};};exports[_0x9cfb('0x6a')]=function(_0x3cb100){if(_0x3cb100===_0x9cfb('0x48')||_0x3cb100===_0x9cfb('0x6b')||_0x3cb100===_0x9cfb('0x59')||_0x3cb100==='type'||_0x3cb100===_0x9cfb('0x6c')||_0x3cb100===_0x9cfb('0x6d')||_0x3cb100===_0x9cfb('0x6e')||_0x3cb100===_0x9cfb('0x5a')||_0x3cb100==='calleridname'||_0x3cb100===_0x9cfb('0x6f')||_0x3cb100===_0x9cfb('0x1b')||_0x3cb100===_0x9cfb('0x52')||_0x3cb100===_0x9cfb('0x4c')||_0x3cb100===_0x9cfb('0x70')||_0x3cb100===_0x9cfb('0x4d')||_0x3cb100===_0x9cfb('0x71')||_0x3cb100===_0x9cfb('0x72')||_0x3cb100==='callbackuniqueid'||_0x3cb100===_0x9cfb('0x73')||_0x3cb100===_0x9cfb('0x74')||_0x3cb100===_0x9cfb('0x1c')||_0x3cb100==='ListId'||_0x3cb100===_0x9cfb('0x3f')||_0x3cb100===_0x9cfb('0x1e')||_0x3cb100===_0x9cfb('0x75')||_0x3cb100===_0x9cfb('0x76')||_0x3cb100==='xmd-queue'||_0x3cb100===_0x9cfb('0x77')||_0x3cb100===_0x9cfb('0x78')||_0x3cb100==='xmd-dialurl'||_0x3cb100===_0x9cfb('0x79')||_0x3cb100===_0x9cfb('0x7a')||_0x3cb100==='xmd-dialid'||_0x3cb100==='xmd-dialchannel'||_0x3cb100===_0x9cfb('0x7b')||_0x3cb100==='xmd-cdrtype'||_0x3cb100===_0x9cfb('0x7c')||_0x3cb100===_0x9cfb('0x7d')||_0x3cb100===_0x9cfb('0x7e')||_0x3cb100===_0x9cfb('0x7f')||_0x3cb100===_0x9cfb('0x80')||_0x3cb100===_0x9cfb('0x81')||_0x3cb100===_0x9cfb('0x82')||_0x3cb100===_0x9cfb('0x83')||_0x3cb100==='rtpaudioqoslossbridged'||_0x3cb100===_0x9cfb('0x84')||_0x3cb100===_0x9cfb('0x85')||_0x3cb100==='rtpaudioqos'||_0x3cb100===_0x9cfb('0x80')||_0x3cb100===_0x9cfb('0x81')||_0x3cb100===_0x9cfb('0x82')||_0x3cb100==='rtpaudioqosloss'||_0x3cb100===_0x9cfb('0x86')||_0x3cb100===_0x9cfb('0x84')||_0x3cb100===_0x9cfb('0x85')||_0x3cb100==='bridgepeer'||_0x3cb100===_0x9cfb('0x87')||_0x3cb100==='state'||_0x3cb100===_0x9cfb('0x37')){return![];}return!![];};exports[_0x9cfb('0x88')]=function(_0x50aa69,_0x37ecd9){var _0x41e1ba,_0x45edcb,_0x25a34b;if(_0x37ecd9<=0x0){_0x37ecd9=0x1;}_0x41e1ba=new RegExp(_0x9cfb('0x89')+_0x37ecd9+'}$');_0x45edcb=Math[_0x9cfb('0x8a')](0xa,_0x37ecd9-0x1);_0x25a34b=Math['pow'](0xa,_0x37ecd9)-0x1;return util[_0x9cfb('0x13')]('%s',_[_0x9cfb('0x8b')](_0x50aa69,_0x41e1ba,_['random'](_0x45edcb,_0x25a34b)));};exports['extractCalleridName']=function(_0x42bc1f){var _0x598b8b=_0x42bc1f['match'](/"(.*?)"/);return _0x598b8b?_0x598b8b[0x1]:_0x42bc1f;};exports[_0x9cfb('0x8c')]=function(_0xfed753){var _0x114637=_0xfed753['match'](/<(.*?)>/);return _0x114637?_0x114637[0x1]:_0xfed753;};function buildNoAnswerEventPayload(_0x36ae8a,_0x3d19cc){var _0xa18223=buildObj(_0x36ae8a,'noanswer');if(!_['isEmpty'](_0x3d19cc[_0x9cfb('0x8d')])){Object[_0x9cfb('0x8e')](_0x3d19cc[_0x9cfb('0x8d')])[_0x9cfb('0x8f')](function(_0x2da9c0){_0xa18223[_0x2da9c0[_0x9cfb('0x90')]()]=_0x3d19cc['variables'][_0x2da9c0];});}return _0xa18223;}exports['buildNoAnswerEventPayload']=buildNoAnswerEventPayload; \ No newline at end of file +var _0x2270=['noanswer','variables','keys','forEach','toLowerCase','lodash','moment','preview','env','../../dialer/utils','error','inspect','info','loggerError','logger2','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','isActive','addVariables','Queue','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','hasOwnProperty','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','logBlacklist','state','statedesc','Blacklist','starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','logLookAgent','UserId','answertime','isFailure','Failure','variablesAction','RECALL','BOOKED','uniqueid','xcally-motion-preview','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','Global','scheduledAt','scheduledat','minutes','ListId','isNil','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','IsNotLoggedIn','lastevent','name','queue','interface','channelAgent','motionChannel','mandatoryDisposition','buildObj','buildAcw','agentReadyId','not_inuse','status','reachable','milliseconds','diff','seconds','createBody','CampaignId','idContact','type','campaigntype','membername','active','callbackuniqueid','callbackat','recallme','sipcallid','xmd-queue','xmd-listid','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agi','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','bridgepeer','getCallerIdRandom','\x5cw{0,','pow','replace','random','match','extractCalleridNumber'];(function(_0x3ef449,_0x17a9c4){var _0x40689c=function(_0x3658fc){while(--_0x3658fc){_0x3ef449['push'](_0x3ef449['shift']());}};_0x40689c(++_0x17a9c4);}(_0x2270,0x90));var _0x0227=function(_0x56ba6a,_0x4def9e){_0x56ba6a=_0x56ba6a-0x0;var _0x405d76=_0x2270[_0x56ba6a];return _0x405d76;};'use strict';var util=require('util');var _=require(_0x0227('0x0'));var moment=require(_0x0227('0x1'));var logger=require('../../../../config/logger')(_0x0227('0x2'));var ipAgi=process[_0x0227('0x3')]['XCALLY_IP_AGI']||'127.0.0.1';var utils=require(_0x0227('0x4'));exports['loggerCatch']=function(_0x3c92ee){return function(_0x1fdc12){logger[_0x0227('0x5')](_0x3c92ee,util[_0x0227('0x6')](_0x1fdc12,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x4677ae,_0x48c85f){logger[_0x0227('0x7')](_0x4677ae,util[_0x0227('0x6')](_0x48c85f,{'showHidden':![],'depth':null}));};exports[_0x0227('0x8')]=function(_0x3c5ed9,_0x49dac2){logger[_0x0227('0x5')](_0x3c5ed9,util['inspect'](_0x49dac2,{'showHidden':![],'depth':null}));};exports[_0x0227('0x9')]=function(_0x26b1e6){return function(_0x3ef0cb){logger['info'](_0x26b1e6,util['inspect'](_0x3ef0cb,{'showHidden':![],'depth':null}));};};exports[_0x0227('0xa')]=function(_0x1fd4c5,_0x5284e6,_0x3b15c2){return{'message':_0x1fd4c5,'unlock':_0x5284e6,'active':_0x3b15c2};};exports[_0x0227('0xb')]=function(_0x1ad306,_0x417ca3,_0x2dfa29){if(!_[_0x0227('0xc')](_0x2dfa29)&&_0x0227('0xd')===typeof _0x2dfa29&&!_[_0x0227('0xe')](_0x2dfa29)){if(!_[_0x0227('0xc')](_0x417ca3)&&'string'===typeof _0x417ca3&&!_[_0x0227('0xe')](_0x417ca3)){return util[_0x0227('0xf')](_0x0227('0x10'),_0x417ca3,_0x2dfa29);}return util['format']('\x22%s\x22\x20<%s>',_0x2dfa29,_0x2dfa29);}if(!_[_0x0227('0xc')](_0x1ad306)&&_0x0227('0xd')===typeof _0x1ad306&&!_['isEmpty'](_0x1ad306)){return _0x1ad306;}return'\x22\x22\x20<>';};exports[_0x0227('0x11')]=function(_0x15e3b0){if(_['isNil'](_0x15e3b0)){return![];}return _0x15e3b0;};exports[_0x0227('0x12')]=function(_0x1a08d4,_0x272ded,_0x282983,_0x2f5218,_0x275654,_0x104291){var _0x2c1996={'XMD-QUEUE':_0x272ded['Queue']?_0x272ded[_0x0227('0x13')]['name']:'','XMD-CALLERID':_0x2f5218,'XMD-CALLERID-PREVIEW':_0x104291?util[_0x0227('0xf')](_0x0227('0x10'),_0x104291[_0x0227('0x14')],_0x104291[_0x0227('0x15')]):_0x2f5218,'XMD-DIALID':_0x275654,'XMD-CONTACTID':_0x272ded[_0x0227('0x16')],'XMD-CDRTYPE':_0x0227('0x17'),'CALLERID(all)':_0x2f5218,'XMD-VOICEQUEUEID':_0x272ded[_0x0227('0x18')],'XMD-DIALCHANNEL':_0x282983,'XMD-DIALTIMEOUT':_0x1a08d4[_0x0227('0x19')]||0x1e,'XMD-DIALOPTIONS':util[_0x0227('0xf')](_0x0227('0x1a'),_0x1a08d4[_0x0227('0x1b')]?'g':'',_[_0x0227('0xe')](_0x1a08d4[_0x0227('0x1c')])?'':_0x0227('0x1d')),'XMD-DIALURL':_0x1a08d4[_0x0227('0x1e')]||'','XMD-AGI':_0x1a08d4[_0x0227('0x1f')]?util[_0x0227('0xf')](_0x0227('0x20'),ipAgi,_0x1a08d4[_0x0227('0x1f')]):_0x0227('0x21'),'XMD-AGIAFTER':_0x1a08d4[_0x0227('0x1b')]?util['format'](_0x0227('0x20'),ipAgi,_0x1a08d4['dialQueueProject2']):_0x0227('0x21'),'XMD-ORIGINATECALLERIDNUM':_0x104291?_0x104291[_0x0227('0x22')]:'','XMD-ORIGINATECALLERIDNAME':_0x104291?_0x104291[_0x0227('0x23')]:'','XMD-DESTINATION':'xcally-motion-preview','SIPADDHEADER':_0x0227('0x24')};if(!_[_0x0227('0xe')](_0x1a08d4['monitor_format'])){_0x2c1996[util[_0x0227('0xf')]('%s',_0x0227('0x25'))]=_0x1a08d4['monitor_format'];_0x2c1996[util[_0x0227('0xf')]('%s',_0x0227('0x26'))]=_0x275654;}return _0x2c1996;};exports['toLowerVariables']=function(_0x1e3104){var _0x1ed960={};for(var _0x13a0a4 in _0x1e3104){if(_0x1e3104[_0x0227('0x27')](_0x13a0a4)){_0x1ed960[util[_0x0227('0xf')]('%s',_['toLower'](_0x13a0a4))]=_0x1e3104[_0x13a0a4];}}return{'variables':_0x1ed960};};exports['updateOriginated']=function(_0x2a10be,_0xb16a1){if(!_['isNil'](_0x2a10be)){if(_0x2a10be[_0x0227('0x27')](_0x0227('0x28'))){if(_0x2a10be[_0x0227('0x28')]>0x0){_0x2a10be[_0x0227('0x28')]-=0x1;}else{logger['error'](_0x0227('0x29'),_0xb16a1);}}}else{logger['error']('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0xb16a1);}};exports[_0x0227('0x2a')]=function(_0x464639){var _0x1a68fb=moment()[_0x0227('0xf')]('YYYY-MM-DD\x20HH:mm:ss');_0x464639[_0x0227('0x2b')]=0xd;_0x464639[_0x0227('0x2c')]=_0x0227('0x2d');_0x464639[_0x0227('0x2e')]=_0x1a68fb;_0x464639[_0x0227('0x2f')]=_0x1a68fb;_0x464639[_0x0227('0x30')]=_0x1a68fb;};exports['logAgent']=function(_0x9284b,_0x23839b,_0x130001){var _0xed3004=moment()['format'](_0x0227('0x31'));_0x9284b[_0x0227('0x2b')]=_0x23839b;_0x9284b[_0x0227('0x2c')]=_0x130001;_0x9284b[_0x0227('0x2f')]=_0xed3004;_0x9284b[_0x0227('0x32')]=utils[_0x0227('0x33')](_0x9284b[_0x0227('0x2f')],_0x9284b[_0x0227('0x2e')]);};exports[_0x0227('0x34')]=function(_0x53d42f,_0x16d356,_0x2994ff){_0x53d42f['membername']=_0x16d356;_0x53d42f[_0x0227('0x35')]=_0x2994ff;};exports['logCustomer']=function(_0x38746e,_0x4caf5c,_0x1e5153){var _0x3a339a=moment()[_0x0227('0xf')]('YYYY-MM-DD\x20HH:mm:ss');_0x38746e[_0x0227('0x2b')]=_0x4caf5c;_0x38746e[_0x0227('0x2c')]=_0x1e5153;_0x38746e['responsetime']=_0x38746e[_0x0227('0x2f')]?_0x38746e[_0x0227('0x2f')]:_0x3a339a;_0x38746e['endtime']=_0x38746e[_0x0227('0x30')]?_0x38746e[_0x0227('0x30')]:_0x3a339a;_0x38746e[_0x0227('0x32')]=utils['getSeconds'](_0x38746e['responsetime']||0x0,_0x38746e[_0x0227('0x2e')]||0x0);_0x38746e['talktime']=_0x38746e['answertime']?utils['getSeconds'](_0x38746e[_0x0227('0x30')],_0x38746e[_0x0227('0x36')]):0x0;};exports[_0x0227('0x37')]=function(_0x21cdcd){return _0x21cdcd===_0x0227('0x38');};exports[_0x0227('0x39')]=function(_0x267d34,_0xa8e732,_0x1bf4ba,_0x34412b,_0x31ba79){var _0x8405b3=_0x34412b?_0x0227('0x3a'):_0x267d34[_0x0227('0x14')];_0x8405b3=_0x31ba79?_0x0227('0x3b'):_0x8405b3;return{'actionid':_0x267d34[_0x0227('0x3c')],'action':'originate','channel':_0x267d34['channelAgent'],'callerid':util[_0x0227('0xf')](_0x0227('0x10'),_0x8405b3,_0x267d34[_0x0227('0x15')]),'Exten':_0x0227('0x3d'),'Context':_0x0227('0x3e'),'Priority':'1','variable':_0x1bf4ba,'timeout':(_0xa8e732[_0x0227('0x3f')]||0x1e)*0x3e8,'async':!![],'channelid':_0x267d34[_0x0227('0x3c')]};};exports[_0x0227('0x40')]=function(_0x1add29){return _0x1add29[_0x0227('0x41')]+_0x1add29[_0x0227('0x42')]+_0x1add29[_0x0227('0x43')]+_0x1add29[_0x0227('0x44')]+_0x1add29[_0x0227('0x45')];};exports[_0x0227('0x46')]=function(_0x5960cf){var _0x424a62=_[_0x0227('0x47')](_0x5960cf);_0x424a62[_0x0227('0x2b')]=0xf;_0x424a62[_0x0227('0x2c')]=_0x0227('0x48');return _0x424a62;};exports[_0x0227('0x49')]=function(_0x16700e,_0x11c5fa,_0x13431d){var _0x2ba3f2={};_0x2ba3f2[_0x11c5fa]=_0x16700e[_0x11c5fa];_0x2ba3f2['active']=![];_0x2ba3f2[_0x0227('0x4a')]=moment()['add'](_0x13431d,_0x0227('0x4b'))['format'](_0x0227('0x31'));_0x2ba3f2[_0x0227('0x16')]=_0x16700e[_0x0227('0x16')];_0x2ba3f2[_0x0227('0x4c')]=_0x16700e[_0x0227('0x4c')];_0x2ba3f2['VoiceQueueId']=_0x16700e[_0x0227('0x18')]||undefined;return _0x2ba3f2;};exports['decrementTalkink']=function(_0xa8edb2,_0x2f3a01){if(!_[_0x0227('0x4d')](_0xa8edb2)){if(_0xa8edb2[_0x0227('0x4e')]>0x0){_0xa8edb2['pTalking']-=0x1;}else{logger[_0x0227('0x5')](_0x2f3a01,_0x0227('0x4f'));}}else{logger[_0x0227('0x5')](_0x2f3a01,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports[_0x0227('0x50')]=function(_0x2c0350){if(_0x2c0350<=0x0){return!![];}return![];};function buildObj(_0x31b10b,_0x2b017f,_0x192057){_0x31b10b[_0x0227('0x51')]=_0x2b017f;_0x31b10b[_0x0227('0x52')]=_0x31b10b[_0x0227('0x53')];_0x31b10b[_0x0227('0x54')]=_0x31b10b[_0x0227('0x55')];_0x31b10b[_0x0227('0x56')]='voice';if(_0x192057){_0x31b10b[_0x0227('0x57')]=_0x192057[_0x0227('0x57')];}return _0x31b10b;}exports[_0x0227('0x58')]=buildObj;exports[_0x0227('0x59')]=function(_0x10c5e0){var _0x1892c8={};_0x1892c8[_0x0227('0x53')]=_0x10c5e0[_0x0227('0x53')];_0x1892c8[_0x0227('0x54')]=_0x10c5e0[_0x0227('0x55')];_0x1892c8['uniqueid']=_0x10c5e0[_0x0227('0x3c')];return _0x1892c8;};exports[_0x0227('0x5a')]=function(_0x557610){var _0x3b00dd=[];for(var _0x347d56 in _0x557610){if(_0x557610['hasOwnProperty'](_0x347d56)){if(!_[_0x0227('0x4d')](_0x557610[_0x347d56])&&_0x557610[_0x347d56][_0x0227('0x2b')]===_0x0227('0x5b')&&_0x557610[_0x347d56][_0x0227('0x5c')]===_0x0227('0x5d')){_0x3b00dd['push'](_0x557610[_0x347d56]['id']);}}}return _0x3b00dd;};exports['getDiff']=function(_0x35da1f){var _0x525eb5=moment()['milliseconds'](0x0);var _0x4cc01f=moment(_0x35da1f)[_0x0227('0x5e')](0x0);return _0x525eb5[_0x0227('0x5f')](_0x4cc01f,_0x0227('0x60'));};exports[_0x0227('0x61')]=function(_0x38353c){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x38353c[_0x0227('0x16')],'ListId':_0x38353c[_0x0227('0x4c')],'VoiceQueueId':_0x38353c[_0x0227('0x18')]||undefined,'CampaignId':_0x38353c[_0x0227('0x62')]||undefined};};exports['filterKey']=function(_0x1034ce){if(_0x1034ce===_0x0227('0x3c')||_0x1034ce===_0x0227('0x63')||_0x1034ce===_0x0227('0x53')||_0x1034ce===_0x0227('0x64')||_0x1034ce===_0x0227('0x65')||_0x1034ce==='dialAnswer'||_0x1034ce===_0x0227('0x66')||_0x1034ce===_0x0227('0x55')||_0x1034ce==='calleridname'||_0x1034ce===_0x0227('0x67')||_0x1034ce==='calleridnum'||_0x1034ce===_0x0227('0x4a')||_0x1034ce===_0x0227('0x41')||_0x1034ce==='countcongestionretry'||_0x1034ce===_0x0227('0x43')||_0x1034ce==='countglobal'||_0x1034ce==='callback'||_0x1034ce===_0x0227('0x68')||_0x1034ce===_0x0227('0x69')||_0x1034ce===_0x0227('0x6a')||_0x1034ce===_0x0227('0x16')||_0x1034ce===_0x0227('0x4c')||_0x1034ce===_0x0227('0x35')||_0x1034ce===_0x0227('0x18')||_0x1034ce===_0x0227('0x6b')||_0x1034ce==='xmd-voicequeueid'||_0x1034ce===_0x0227('0x6c')||_0x1034ce==='xmd-phone'||_0x1034ce===_0x0227('0x6d')||_0x1034ce==='xmd-dialurl'||_0x1034ce===_0x0227('0x6e')||_0x1034ce===_0x0227('0x6f')||_0x1034ce===_0x0227('0x70')||_0x1034ce===_0x0227('0x71')||_0x1034ce===_0x0227('0x72')||_0x1034ce===_0x0227('0x73')||_0x1034ce===_0x0227('0x74')||_0x1034ce==='xmd-agiafter'||_0x1034ce===_0x0227('0x75')||_0x1034ce==='rtpaudioqos'||_0x1034ce==='rtpaudioqosbridged'||_0x1034ce==='rtpaudioqosjitter'||_0x1034ce===_0x0227('0x76')||_0x1034ce===_0x0227('0x77')||_0x1034ce===_0x0227('0x78')||_0x1034ce===_0x0227('0x79')||_0x1034ce===_0x0227('0x7a')||_0x1034ce===_0x0227('0x7b')||_0x1034ce===_0x0227('0x7c')||_0x1034ce===_0x0227('0x7d')||_0x1034ce===_0x0227('0x76')||_0x1034ce===_0x0227('0x77')||_0x1034ce===_0x0227('0x78')||_0x1034ce===_0x0227('0x79')||_0x1034ce===_0x0227('0x7a')||_0x1034ce===_0x0227('0x7e')||_0x1034ce==='bridgepvtcallid'||_0x1034ce===_0x0227('0x2b')||_0x1034ce==='statedesc'){return![];}return!![];};exports[_0x0227('0x7f')]=function(_0x20dd31,_0x153c3a){var _0x30e3c6,_0x5a94fd,_0x55f3aa;if(_0x153c3a<=0x0){_0x153c3a=0x1;}_0x30e3c6=new RegExp(_0x0227('0x80')+_0x153c3a+'}$');_0x5a94fd=Math[_0x0227('0x81')](0xa,_0x153c3a-0x1);_0x55f3aa=Math[_0x0227('0x81')](0xa,_0x153c3a)-0x1;return util['format']('%s',_[_0x0227('0x82')](_0x20dd31,_0x30e3c6,_[_0x0227('0x83')](_0x5a94fd,_0x55f3aa)));};exports['extractCalleridName']=function(_0xd4b737){var _0x42adda=_0xd4b737[_0x0227('0x84')](/"(.*?)"/);return _0x42adda?_0x42adda[0x1]:_0xd4b737;};exports[_0x0227('0x85')]=function(_0x5a9e8a){var _0x1e4579=_0x5a9e8a[_0x0227('0x84')](/<(.*?)>/);return _0x1e4579?_0x1e4579[0x1]:_0x5a9e8a;};function buildNoAnswerEventPayload(_0x2f6db7,_0x24000f){var _0x11a4b9=buildObj(_0x2f6db7,_0x0227('0x86'));if(!_[_0x0227('0xe')](_0x24000f[_0x0227('0x87')])){Object[_0x0227('0x88')](_0x24000f[_0x0227('0x87')])[_0x0227('0x89')](function(_0x1064fb){_0x11a4b9[_0x1064fb[_0x0227('0x8a')]()]=_0x24000f[_0x0227('0x87')][_0x1064fb];});}return _0x11a4b9;}exports['buildNoAnswerEventPayload']=buildNoAnswerEventPayload; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index a5849bf..0b6e4f5 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 _0x2793=['queuepause','reload','voicequeuechannelhangup','voicequeuechannelredirect','string','number','boolean','queueremove'];(function(_0x40dd56,_0x726ca5){var _0x4f850f=function(_0x5f899e){while(--_0x5f899e){_0x40dd56['push'](_0x40dd56['shift']());}};_0x4f850f(++_0x726ca5);}(_0x2793,0x8c));var _0x3279=function(_0x291167,_0x482eff){_0x291167=_0x291167-0x0;var _0x102c7b=_0x2793[_0x291167];return _0x102c7b;};'use strict';exports['queueadd']={'queue':{'type':_0x3279('0x0'),'required':!![]},'interface':{'type':_0x3279('0x0'),'required':!![]},'membername':{'type':_0x3279('0x0'),'required':!![]},'penalty':{'type':_0x3279('0x1'),'required':![]},'paused':{'type':_0x3279('0x2'),'required':![]}};exports[_0x3279('0x3')]={'queue':{'type':_0x3279('0x0'),'required':!![]},'interface':{'type':_0x3279('0x0'),'required':!![]}};exports[_0x3279('0x4')]={'interface':{'type':_0x3279('0x0'),'required':!![]},'paused':{'type':'boolean'},'reason':{'type':_0x3279('0x0'),'required':![]}};exports[_0x3279('0x5')]={'module':{'type':_0x3279('0x0'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0x3279('0x0'),'required':!![]}};exports['voicechannel']={'uniqueid':{'type':'string','required':!![]},'filename':{'type':_0x3279('0x0')},'format':{'type':_0x3279('0x0')},'mixmonitorid':{'type':_0x3279('0x0')}};exports[_0x3279('0x6')]={'uniqueid':{'type':_0x3279('0x0'),'required':!![]}};exports[_0x3279('0x7')]={'uniqueid':{'type':'string','required':!![]},'exten':{'type':_0x3279('0x0'),'required':!![]},'context':{'type':_0x3279('0x0')}}; \ No newline at end of file +var _0xf067=['number','boolean','queueremove','voicequeuechannel','voicequeuechannelredirect','queueadd','string'];(function(_0x5b95e0,_0x1541bb){var _0x5e6218=function(_0x4185c3){while(--_0x4185c3){_0x5b95e0['push'](_0x5b95e0['shift']());}};_0x5e6218(++_0x1541bb);}(_0xf067,0x7c));var _0x7f06=function(_0x4189d5,_0x399787){_0x4189d5=_0x4189d5-0x0;var _0x4de644=_0xf067[_0x4189d5];return _0x4de644;};'use strict';exports[_0x7f06('0x0')]={'queue':{'type':_0x7f06('0x1'),'required':!![]},'interface':{'type':_0x7f06('0x1'),'required':!![]},'membername':{'type':_0x7f06('0x1'),'required':!![]},'penalty':{'type':_0x7f06('0x2'),'required':![]},'paused':{'type':_0x7f06('0x3'),'required':![]}};exports[_0x7f06('0x4')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0x7f06('0x1'),'required':!![]}};exports['queuepause']={'interface':{'type':_0x7f06('0x1'),'required':!![]},'paused':{'type':_0x7f06('0x3')},'reason':{'type':_0x7f06('0x1'),'required':![]}};exports['reload']={'module':{'type':'string','required':![]}};exports[_0x7f06('0x5')]={'uniqueid':{'type':'string','required':!![]}};exports['voicechannel']={'uniqueid':{'type':_0x7f06('0x1'),'required':!![]},'filename':{'type':'string'},'format':{'type':_0x7f06('0x1')},'mixmonitorid':{'type':_0x7f06('0x1')}};exports['voicequeuechannelhangup']={'uniqueid':{'type':_0x7f06('0x1'),'required':!![]}};exports[_0x7f06('0x6')]={'uniqueid':{'type':'string','required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':_0x7f06('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index b92d7b1..fdb9d9f 100644 --- a/server/services/ami/realtime/index.js +++ b/server/services/ami/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['initCampaignHopperHistory','merge','initFaxAccounts','initVoiceQueues','exports','lodash','moment','util','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/faxAccount','agents','telephones','voiceQueues','templates','outbound','channels','queueChannels','outboundChannels','timers','settings','zendeskAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','name','isNil','interface','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','total','answered','unmanaged','outboundAnswerAgiCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundRejectCallsDay','queueStatusComplete','prototype','mergeFromDatabase','length','isUndefined','initTelephones','SIP/%s','trunks','initTriggers','triggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','salesforceAccounts','initFreshdeskAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','servicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','abandoned','queuecallerleaveAt','diff','seconds','queuecallercompleteAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','initCampaigns','campaigns','dialQueueProject','SquareProject','initVoiceExtensions','voiceExtensions'];(function(_0x38eb27,_0x1f03c5){var _0x5eb72a=function(_0x25d2bb){while(--_0x25d2bb){_0x38eb27['push'](_0x38eb27['shift']());}};_0x5eb72a(++_0x1f03c5);}(_0x5f2f,0x73));var _0xf5f2=function(_0x21f24b,_0x4bd432){_0x21f24b=_0x21f24b-0x0;var _0x364efc=_0x5f2f[_0x21f24b];return _0x364efc;};'use strict';var _=require(_0xf5f2('0x0'));var moment=require(_0xf5f2('0x1'));var util=require(_0xf5f2('0x2'));var Agent=require(_0xf5f2('0x3'));var Telephone=require(_0xf5f2('0x4'));var Trunk=require(_0xf5f2('0x5'));var VoiceQueue=require(_0xf5f2('0x6'));var Trigger=require(_0xf5f2('0x7'));var Template=require('../model/template');var Campaign=require('../model/campaign');var VoiceExtension=require(_0xf5f2('0x8'));var ZendeskAccount=require(_0xf5f2('0x9'));var SalesforceAccount=require(_0xf5f2('0xa'));var FreshdeskAccount=require(_0xf5f2('0xb'));var SugarcrmAccount=require(_0xf5f2('0xc'));var ZohoAccount=require(_0xf5f2('0xd'));var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0xf5f2('0xe'));var ServicenowAccount=require(_0xf5f2('0xf'));var Dynamics365Account=require(_0xf5f2('0x10'));var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0xf5f2('0x11'));function Realtime(){this[_0xf5f2('0x12')]={};this[_0xf5f2('0x13')]={};this['trunks']={};this[_0xf5f2('0x14')]={};this['triggers']={};this['campaigns']={};this[_0xf5f2('0x15')]={};this[_0xf5f2('0x16')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0xf5f2('0x17')]={};this[_0xf5f2('0x18')]={};this[_0xf5f2('0x19')]={};this[_0xf5f2('0x1a')]={};this[_0xf5f2('0x1b')]={};this[_0xf5f2('0x1c')]={};this['salesforceAccounts']={};this[_0xf5f2('0x1d')]={};this[_0xf5f2('0x1e')]={};this[_0xf5f2('0x1f')]={};this[_0xf5f2('0x20')]={};this[_0xf5f2('0x21')]={};this['servicenowAccounts']={};this[_0xf5f2('0x22')]={};this[_0xf5f2('0x23')]={};this[_0xf5f2('0x24')]={};}function freeIsNotKey(_0x1b6dd2,_0x23e23a,_0x3a9dbb){var _0xdb61b3=_[_0xf5f2('0x25')](_0x1b6dd2,function(_0x11f702){return _0x11f702[_0x3a9dbb];});for(var _0x228ace in _0x23e23a){if(_0x23e23a[_0xf5f2('0x26')](_0x228ace)){if(!_0xdb61b3[_0x228ace]){delete _0x23e23a[_0x228ace];}}}}function freeIsNotKeySip(_0x28e097,_0x4ff59b){var _0x3ee69=_[_0xf5f2('0x25')](_0x28e097,function(_0x626999){return util[_0xf5f2('0x27')]('SIP/%s',_0x626999[_0xf5f2('0x28')]);});for(var _0x47101e in _0x4ff59b){if(_0x4ff59b['hasOwnProperty'](_0x47101e)){if(!_0x3ee69[_0x47101e]){delete _0x4ff59b[_0x47101e];}}}}function freeIsNotKeyAgent(_0x47acfc,_0x2d2805){var _0x388e6c=_['mapKeys'](_0x47acfc,function(_0x45b74f){var _0x170042=_[_0xf5f2('0x29')](_0x45b74f[_0xf5f2('0x2a')])?util[_0xf5f2('0x27')]('SIP/%s',_0x45b74f[_0xf5f2('0x28')]):_0x45b74f[_0xf5f2('0x2a')];return _0x170042;});for(var _0x4e8bda in _0x2d2805){if(_0x2d2805[_0xf5f2('0x26')](_0x4e8bda)){if(!_0x388e6c[_0x4e8bda]){delete _0x2d2805[_0x4e8bda];}}}}function clearVoiceCallReports(_0x287ad5){_0x287ad5['total']=0x0;_0x287ad5['answered']=0x0;_0x287ad5[_0xf5f2('0x2b')]=0x0;_0x287ad5[_0xf5f2('0x2c')]=0x0;_0x287ad5[_0xf5f2('0x2d')]=0x0;}function clearCampaigns(_0x1a5bb3){if(!_[_0xf5f2('0x2e')](_0x1a5bb3)){for(var _0x788a8d in _0x1a5bb3){if(_0x1a5bb3[_0xf5f2('0x26')](_0x788a8d)){_0x1a5bb3[_0x788a8d][_0xf5f2('0x2f')]=0x0;_0x1a5bb3[_0x788a8d][_0xf5f2('0x30')]=0x0;}}}}function clearVoiceQueues(_0x4ab014){if(!_[_0xf5f2('0x2e')](_0x4ab014)){for(var _0x102449 in _0x4ab014){if(_0x4ab014[_0xf5f2('0x26')](_0x102449)){_0x4ab014[_0x102449][_0xf5f2('0x31')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x32')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x33')]=0x0;_0x4ab014[_0x102449]['abandoned']=0x0;_0x4ab014[_0x102449]['sumHoldTime']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x2c')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x2d')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x34')]=0x0;_0x4ab014[_0x102449]['outboundNoAnswerCallsDay']=0x0;_0x4ab014[_0x102449]['outboundBusyCallsDay']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x35')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x36')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x37')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x38')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x39')]=0x0;_0x4ab014[_0x102449]['outboundBlacklistCallsDay']=0x0;_0x4ab014[_0x102449]['outboundOriginateFailureCallsDay']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x3a')]=0x0;_0x4ab014[_0x102449]['outboundReCallsDay']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x34')]=0x0;_0x4ab014[_0x102449]['outboundAnswerCallsDay']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x3b')]=!![];}}}}Realtime[_0xf5f2('0x3c')][_0xf5f2('0x3d')]=function(_0x428770,_0x256bd9){for(var _0x277eee in _0x256bd9){if(_0x428770[_0xf5f2('0x26')](_0x277eee)){_0x428770[_0x277eee]=_0x256bd9[_0x277eee];}}};Realtime[_0xf5f2('0x3c')]['initAgents']=function(){var _0x4149e6=this;return function(_0x43e4ff){if(_0x43e4ff){freeIsNotKeyAgent(_0x43e4ff,_0x4149e6[_0xf5f2('0x12')]);for(var _0x43c77d=0x0,_0x1408b9={};_0x43c77d<_0x43e4ff[_0xf5f2('0x3e')];_0x43c77d+=0x1){_0x1408b9=_0x43e4ff[_0x43c77d];var _0x297c0c=_['isNil'](_0x1408b9[_0xf5f2('0x2a')])?util[_0xf5f2('0x27')]('SIP/%s',_0x1408b9[_0xf5f2('0x28')]):_0x1408b9['interface'];if(_[_0xf5f2('0x3f')](_0x4149e6[_0xf5f2('0x12')][_0x297c0c])){_0x4149e6[_0xf5f2('0x12')][_0x297c0c]=new Agent(_0x1408b9);}else{_0x4149e6[_0xf5f2('0x3d')](_0x4149e6['agents'][_0x297c0c],_0x1408b9);}}}return _0x4149e6['agents'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x40')]=function(){var _0x20eb74=this;return function(_0x4ec8fb){if(_0x4ec8fb){freeIsNotKeySip(_0x4ec8fb,_0x20eb74[_0xf5f2('0x13')]);for(var _0x4f7f80=0x0,_0x9da533={};_0x4f7f80<_0x4ec8fb['length'];_0x4f7f80+=0x1){_0x9da533=_0x4ec8fb[_0x4f7f80];if(_[_0xf5f2('0x3f')](_0x20eb74[_0xf5f2('0x13')][util['format'](_0xf5f2('0x41'),_0x9da533[_0xf5f2('0x28')])])){_0x20eb74[_0xf5f2('0x13')][util[_0xf5f2('0x27')]('SIP/%s',_0x9da533['name'])]=new Telephone(_0x9da533);}else{_0x20eb74[_0xf5f2('0x3d')](_0x20eb74[_0xf5f2('0x13')][util[_0xf5f2('0x27')](_0xf5f2('0x41'),_0x9da533[_0xf5f2('0x28')])],_0x9da533);}}}return _0x20eb74[_0xf5f2('0x13')];};};Realtime[_0xf5f2('0x3c')]['initTrunks']=function(){var _0x110fe5=this;return function(_0x3b4ea6){if(_0x3b4ea6){freeIsNotKeySip(_0x3b4ea6,_0x110fe5['trunks']);for(var _0xc6a1ae=0x0,_0x3f3895={};_0xc6a1ae<_0x3b4ea6[_0xf5f2('0x3e')];_0xc6a1ae+=0x1){_0x3f3895=_0x3b4ea6[_0xc6a1ae];if(_[_0xf5f2('0x3f')](_0x110fe5[_0xf5f2('0x42')][util[_0xf5f2('0x27')](_0xf5f2('0x41'),_0x3f3895[_0xf5f2('0x28')])])){_0x110fe5['trunks'][util[_0xf5f2('0x27')](_0xf5f2('0x41'),_0x3f3895[_0xf5f2('0x28')])]=new Trunk(_0x3f3895);}else{_0x110fe5['mergeFromDatabase'](_0x110fe5['trunks'][util['format'](_0xf5f2('0x41'),_0x3f3895[_0xf5f2('0x28')])],_0x3f3895);}}}return _0x110fe5['trunks'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x43')]=function(){var _0x28e33f=this;return function(_0x31f86c){if(_0x31f86c){freeIsNotKey(_0x31f86c,_0x28e33f[_0xf5f2('0x44')],'id');for(var _0x2b3b1c=0x0,_0x1a6ec1={};_0x2b3b1c<_0x31f86c[_0xf5f2('0x3e')];_0x2b3b1c+=0x1){_0x1a6ec1=_0x31f86c[_0x2b3b1c];if(_[_0xf5f2('0x3f')](_0x28e33f[_0xf5f2('0x44')][_0x1a6ec1['id']])){_0x28e33f[_0xf5f2('0x44')][_0x1a6ec1['id']]=new Trigger(_0x1a6ec1);}else{_0x28e33f[_0xf5f2('0x3d')](_0x28e33f[_0xf5f2('0x44')][_0x1a6ec1['id']],_0x1a6ec1);}}}return _0x28e33f[_0xf5f2('0x44')];};};Realtime['prototype'][_0xf5f2('0x45')]=function(){var _0x578c93=this;return function(_0x3d62c1){if(_0x3d62c1){freeIsNotKey(_0x3d62c1,_0x578c93[_0xf5f2('0x15')],'id');for(var _0x218def=0x0,_0x36a4b0={};_0x218def<_0x3d62c1[_0xf5f2('0x3e')];_0x218def+=0x1){_0x36a4b0=_0x3d62c1[_0x218def];if(_[_0xf5f2('0x3f')](_0x578c93['templates'][_0x36a4b0['id']])){_0x578c93[_0xf5f2('0x15')][_0x36a4b0['id']]=new Template(_0x36a4b0);}else{_0x578c93[_0xf5f2('0x3d')](_0x578c93[_0xf5f2('0x15')][_0x36a4b0['id']],_0x36a4b0);}}}return _0x578c93[_0xf5f2('0x15')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x46')]=function(){var _0xf638ff=this;return function(_0x297f07){if(_0x297f07){freeIsNotKey(_0x297f07,_0xf638ff['zendeskAccounts'],'id');for(var _0x35dece=0x0,_0x33ec29={};_0x35dece<_0x297f07[_0xf5f2('0x3e')];_0x35dece+=0x1){_0x33ec29=_0x297f07[_0x35dece];if(_['isUndefined'](_0xf638ff[_0xf5f2('0x1c')][_0x33ec29['id']])){_0xf638ff[_0xf5f2('0x1c')][_0x33ec29['id']]=new ZendeskAccount(_0x33ec29);}else{_0xf638ff[_0xf5f2('0x3d')](_0xf638ff['zendeskAccounts'][_0x33ec29['id']],_0x33ec29);}}}return _0xf638ff['zendeskAccounts'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x47')]=function(){var _0x5db519=this;return function(_0x14aa81){if(_0x14aa81){freeIsNotKey(_0x14aa81,_0x5db519['salesforceAccounts'],'id');for(var _0x740321=0x0,_0x497eb8={};_0x740321<_0x14aa81[_0xf5f2('0x3e')];_0x740321+=0x1){_0x497eb8=_0x14aa81[_0x740321];if(_['isUndefined'](_0x5db519[_0xf5f2('0x48')][_0x497eb8['id']])){_0x5db519[_0xf5f2('0x48')][_0x497eb8['id']]=new SalesforceAccount(_0x497eb8);}else{_0x5db519[_0xf5f2('0x3d')](_0x5db519[_0xf5f2('0x48')][_0x497eb8['id']],_0x497eb8);}}}return _0x5db519['salesforceAccounts'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x49')]=function(){var _0x4f6b01=this;return function(_0x58213b){if(_0x58213b){freeIsNotKey(_0x58213b,_0x4f6b01[_0xf5f2('0x1e')],'id');for(var _0x3dc0c4=0x0,_0x57782c={};_0x3dc0c4<_0x58213b[_0xf5f2('0x3e')];_0x3dc0c4+=0x1){_0x57782c=_0x58213b[_0x3dc0c4];if(_[_0xf5f2('0x3f')](_0x4f6b01[_0xf5f2('0x1e')][_0x57782c['id']])){_0x4f6b01[_0xf5f2('0x1e')][_0x57782c['id']]=new FreshdeskAccount(_0x57782c);}else{_0x4f6b01['mergeFromDatabase'](_0x4f6b01['freshdeskAccounts'][_0x57782c['id']],_0x57782c);}}}return _0x4f6b01[_0xf5f2('0x1e')];};};Realtime[_0xf5f2('0x3c')]['initZohoAccounts']=function(){var _0x40eef=this;return function(_0x43fc49){if(_0x43fc49){freeIsNotKey(_0x43fc49,_0x40eef[_0xf5f2('0x1f')],'id');for(var _0x14029e=0x0,_0x2b038e={};_0x14029e<_0x43fc49[_0xf5f2('0x3e')];_0x14029e+=0x1){_0x2b038e=_0x43fc49[_0x14029e];if(_[_0xf5f2('0x3f')](_0x40eef['zohoAccounts'][_0x2b038e['id']])){_0x40eef['zohoAccounts'][_0x2b038e['id']]=new ZohoAccount(_0x2b038e);}else{_0x40eef[_0xf5f2('0x3d')](_0x40eef[_0xf5f2('0x1f')][_0x2b038e['id']],_0x2b038e);}}}return _0x40eef[_0xf5f2('0x1f')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x4a')]=function(){var _0x5a861d=this;return function(_0xdb1106){if(_0xdb1106){freeIsNotKey(_0xdb1106,_0x5a861d[_0xf5f2('0x20')],'id');for(var _0x18b124=0x0,_0x519c24={};_0x18b124<_0xdb1106[_0xf5f2('0x3e')];_0x18b124+=0x1){_0x519c24=_0xdb1106[_0x18b124];if(_['isUndefined'](_0x5a861d[_0xf5f2('0x20')][_0x519c24['id']])){_0x5a861d[_0xf5f2('0x20')][_0x519c24['id']]=new DeskAccount(_0x519c24);}else{_0x5a861d[_0xf5f2('0x3d')](_0x5a861d[_0xf5f2('0x20')][_0x519c24['id']],_0x519c24);}}}return _0x5a861d['deskAccounts'];};};Realtime['prototype'][_0xf5f2('0x4b')]=function(){var _0x4de303=this;return function(_0xa39c65){if(_0xa39c65){freeIsNotKey(_0xa39c65,_0x4de303[_0xf5f2('0x1d')],'id');for(var _0x572ec1=0x0,_0x3f0579={};_0x572ec1<_0xa39c65[_0xf5f2('0x3e')];_0x572ec1+=0x1){_0x3f0579=_0xa39c65[_0x572ec1];if(_[_0xf5f2('0x3f')](_0x4de303['sugarcrmAccounts'][_0x3f0579['id']])){_0x4de303[_0xf5f2('0x1d')][_0x3f0579['id']]=new SugarcrmAccount(_0x3f0579);}else{_0x4de303[_0xf5f2('0x3d')](_0x4de303[_0xf5f2('0x1d')][_0x3f0579['id']],_0x3f0579);}}}return _0x4de303[_0xf5f2('0x1d')];};};Realtime['prototype'][_0xf5f2('0x4c')]=function(){var _0x506fe5=this;return function(_0x2cbe1e){if(_0x2cbe1e){freeIsNotKey(_0x2cbe1e,_0x506fe5[_0xf5f2('0x21')],'id');for(var _0x2e6f5d=0x0,_0x380c08={};_0x2e6f5d<_0x2cbe1e[_0xf5f2('0x3e')];_0x2e6f5d+=0x1){_0x380c08=_0x2cbe1e[_0x2e6f5d];if(_['isUndefined'](_0x506fe5[_0xf5f2('0x21')][_0x380c08['id']])){_0x506fe5[_0xf5f2('0x21')][_0x380c08['id']]=new VtigerAccount(_0x380c08);}else{_0x506fe5[_0xf5f2('0x3d')](_0x506fe5[_0xf5f2('0x21')][_0x380c08['id']],_0x380c08);}}}return _0x506fe5[_0xf5f2('0x21')];};};Realtime['prototype'][_0xf5f2('0x4d')]=function(){var _0x5ee6bc=this;return function(_0x4c96ee){if(_0x4c96ee){freeIsNotKey(_0x4c96ee,_0x5ee6bc[_0xf5f2('0x4e')],'id');for(var _0x4802c5=0x0,_0x10f2b8={};_0x4802c5<_0x4c96ee[_0xf5f2('0x3e')];_0x4802c5+=0x1){_0x10f2b8=_0x4c96ee[_0x4802c5];if(_[_0xf5f2('0x3f')](_0x5ee6bc[_0xf5f2('0x4e')][_0x10f2b8['id']])){_0x5ee6bc['servicenowAccounts'][_0x10f2b8['id']]=new ServicenowAccount(_0x10f2b8);}else{_0x5ee6bc[_0xf5f2('0x3d')](_0x5ee6bc[_0xf5f2('0x4e')][_0x10f2b8['id']],_0x10f2b8);}}}return _0x5ee6bc[_0xf5f2('0x4e')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x4f')]=function(){var _0x35d868=this;return function(_0x158768){if(_0x158768){freeIsNotKey(_0x158768,_0x35d868['dynamics365Accounts'],'id');for(var _0x1f55af=0x0,_0x2d171d={};_0x1f55af<_0x158768[_0xf5f2('0x3e')];_0x1f55af+=0x1){_0x2d171d=_0x158768[_0x1f55af];if(_[_0xf5f2('0x3f')](_0x35d868['dynamics365Accounts'][_0x2d171d['id']])){_0x35d868[_0xf5f2('0x22')][_0x2d171d['id']]=new Dynamics365Account(_0x2d171d);}else{_0x35d868['mergeFromDatabase'](_0x35d868[_0xf5f2('0x22')][_0x2d171d['id']],_0x2d171d);}}}return _0x35d868[_0xf5f2('0x22')];};};Realtime['prototype'][_0xf5f2('0x50')]=function(){var _0x975bd8=this;return function(_0xa0c139){if(_0xa0c139){freeIsNotKey(_0xa0c139,_0x975bd8[_0xf5f2('0x23')],'id');for(var _0x146462=0x0,_0x4bd113={};_0x146462<_0xa0c139[_0xf5f2('0x3e')];_0x146462+=0x1){_0x4bd113=_0xa0c139[_0x146462];if(_[_0xf5f2('0x3f')](_0x975bd8[_0xf5f2('0x23')][_0x4bd113['id']])){_0x975bd8[_0xf5f2('0x23')][_0x4bd113['id']]=new FreshsalesAccount(_0x4bd113);}else{_0x975bd8[_0xf5f2('0x3d')](_0x975bd8[_0xf5f2('0x23')][_0x4bd113['id']],_0x4bd113);}}}return _0x975bd8['freshsalesAccounts'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x51')]=function(){var _0x4800fe=this;return function(_0x3f677e){for(var _0x36503c=0x0;_0x36503c<_0x3f677e[_0xf5f2('0x3e')];_0x36503c+=0x1){_['merge'](_0x4800fe['voiceQueues'][_0x3f677e[_0x36503c]['name']],_0x3f677e[_0x36503c]);}return _0x4800fe[_0xf5f2('0x14')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x52')]=function(){var _0x450691=this;return function(_0x55da4d){clearVoiceQueues(_0x450691['voiceQueues']);if(_0x55da4d){_0x55da4d=_[_0xf5f2('0x53')](_0x55da4d,_0xf5f2('0x54'));for(var _0xc10cf3 in _0x55da4d){if(_0x55da4d[_0xf5f2('0x26')](_0xc10cf3)){for(var _0x794e0c=0x0;_0x794e0c<_0x55da4d[_0xc10cf3][_0xf5f2('0x3e')];_0x794e0c+=0x1){var _0x11c302=_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x55')];if(_0x450691[_0xf5f2('0x14')][_0x11c302]){if(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x56')]){_0x450691[_0xf5f2('0x14')][_0x11c302]['unmanaged']+=0x1;}if(_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerabandon']){_0x450691['voiceQueues'][_0x11c302][_0xf5f2('0x57')]+=0x1;}_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2b')]+=moment(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x58')])[_0xf5f2('0x59')](moment(_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerjoinAt']),_0xf5f2('0x5a'))||0x0;if(_0x794e0c===_0x55da4d[_0xc10cf3][_0xf5f2('0x3e')]-0x1){_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2c')]+=moment(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x5b')]||_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerabandonAt']||_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x5c')])[_0xf5f2('0x59')](moment(_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerjoinAt']),_0xf5f2('0x5a'))||0x0;_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x31')]+=0x1;if(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x5d')]){_0x450691['voiceQueues'][_0x11c302][_0xf5f2('0x32')]+=0x1;_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2d')]+=moment(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x5b')])[_0xf5f2('0x59')](moment(_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerleaveAt']),'seconds')||0x0;}}else{_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2c')]+=_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2b')]||0x0;}}}}}}return _0x450691['voiceQueues'];};};Realtime['prototype'][_0xf5f2('0x5e')]=function(){var _0x4f2fcc=this;return function(_0x4c4420){clearVoiceCallReports(_0x4f2fcc['outbound']);if(_0x4c4420){for(var _0x57cb18=0x0;_0x57cb18<_0x4c4420[_0xf5f2('0x3e')];_0x57cb18+=0x1){_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x31')]+=0x1;_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x2c')]+=_0x4c4420[_0x57cb18][_0xf5f2('0x5f')];if(_0x4c4420[_0x57cb18][_0xf5f2('0x60')]===_0xf5f2('0x61')){_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x32')]+=0x1;_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x2b')]+=_0x4c4420[_0x57cb18][_0xf5f2('0x5f')]-_0x4c4420[_0x57cb18][_0xf5f2('0x62')]||0x0;_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x2d')]+=_0x4c4420[_0x57cb18][_0xf5f2('0x62')];}}}return _0x4f2fcc[_0xf5f2('0x16')];};};Realtime['prototype'][_0xf5f2('0x63')]=function(){var _0x35299d=this;return function(_0x21043b){if(_0x21043b){freeIsNotKey(_0x21043b,_0x35299d[_0xf5f2('0x64')],_0xf5f2('0x28'));for(var _0x308220=0x0,_0x16491c={};_0x308220<_0x21043b[_0xf5f2('0x3e')];_0x308220+=0x1){_0x16491c=_0x21043b[_0x308220];if(_['isUndefined'](_0x35299d[_0xf5f2('0x64')][_0x16491c['name']])){_0x35299d['campaigns'][_0x16491c['name']]=new Campaign(_0x16491c);}else{_0x35299d['mergeFromDatabase'](_0x35299d['campaigns'][_0x16491c['name']],_0x16491c);_0x35299d[_0xf5f2('0x64')][_0x16491c[_0xf5f2('0x28')]][_0xf5f2('0x65')]=_0x16491c[_0xf5f2('0x66')]?_0x16491c[_0xf5f2('0x66')][_0xf5f2('0x28')]:undefined;}}}return _0x35299d['campaigns'];};};Realtime['prototype'][_0xf5f2('0x67')]=function(){var _0x578a22=this;return function(_0x418ece){if(_0x418ece){freeIsNotKey(_0x418ece,_0x578a22[_0xf5f2('0x68')],'id');for(var _0x59161c=0x0,_0x4f3ad4={};_0x59161c<_0x418ece[_0xf5f2('0x3e')];_0x59161c+=0x1){_0x4f3ad4=_0x418ece[_0x59161c];if(_[_0xf5f2('0x3f')](_0x578a22['voiceExtensions'][_0x4f3ad4['id']])){_0x578a22[_0xf5f2('0x68')][_0x4f3ad4['id']]=new VoiceExtension(_0x4f3ad4);}else{_0x578a22[_0xf5f2('0x3d')](_0x578a22['voiceExtensions'][_0x4f3ad4['id']],_0x4f3ad4);}}}return _0x578a22[_0xf5f2('0x68')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x69')]=function(){var _0x4c1678=this;return function(_0x33e9ad){clearCampaigns(_0x4c1678[_0xf5f2('0x64')]);for(var _0x14db86=0x0;_0x14db86<_0x33e9ad[_0xf5f2('0x3e')];_0x14db86+=0x1){_[_0xf5f2('0x6a')](_0x4c1678[_0xf5f2('0x64')][_0x33e9ad[_0x14db86][_0xf5f2('0x28')]],_0x33e9ad[_0x14db86]);}return _0x4c1678[_0xf5f2('0x64')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x6b')]=function(){var _0x191af3=this;return function(_0x2601aa){if(_0x2601aa){freeIsNotKey(_0x2601aa,_0x191af3[_0xf5f2('0x24')],'id');for(var _0x407dd8=0x0,_0xe900ea={};_0x407dd8<_0x2601aa[_0xf5f2('0x3e')];_0x407dd8+=0x1){_0xe900ea=_0x2601aa[_0x407dd8];if(_[_0xf5f2('0x3f')](_0x191af3[_0xf5f2('0x24')][_0xe900ea['id']])){_0x191af3[_0xf5f2('0x24')][_0xe900ea['id']]=new FaxAccount(_0xe900ea);}else{_0x191af3[_0xf5f2('0x3d')](_0x191af3[_0xf5f2('0x24')][_0xe900ea['id']],_0xe900ea);}}}return _0x191af3['faxAccounts'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x6c')]=function(){var _0x5d6c6e=this;return function(_0x2e49ce){if(_0x2e49ce){freeIsNotKey(_0x2e49ce,_0x5d6c6e[_0xf5f2('0x14')],'name');for(var _0xb56304=0x0,_0x2f54eb={};_0xb56304<_0x2e49ce[_0xf5f2('0x3e')];_0xb56304+=0x1){_0x2f54eb=_0x2e49ce[_0xb56304];if(_['isUndefined'](_0x5d6c6e['voiceQueues'][_0x2f54eb[_0xf5f2('0x28')]])){_0x5d6c6e[_0xf5f2('0x14')][_0x2f54eb[_0xf5f2('0x28')]]=new VoiceQueue(_0x2f54eb);}else{_0x5d6c6e['mergeFromDatabase'](_0x5d6c6e['voiceQueues'][_0x2f54eb[_0xf5f2('0x28')]],_0x2f54eb);}}}return _0x5d6c6e[_0xf5f2('0x14')];};};module[_0xf5f2('0x6d')]=Realtime; \ No newline at end of file +var _0x5f66=['diff','seconds','disposition','ANSWERED','outbound','duration','billableseconds','initCampaigns','campaigns','dialQueueProject','SquareProject','voiceExtensions','initCampaignHopperHistory','initFaxAccounts','initVoiceQueues','exports','moment','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/campaign','../model/zendeskAccount','../model/salesforceAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','telephones','trunks','voiceQueues','triggers','templates','channels','outboundChannels','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','faxAccounts','mapKeys','hasOwnProperty','isNil','format','interface','total','answered','sumHoldTime','sumBillable','isEmpty','ivrAnswerCallsDay','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','agents','length','name','isUndefined','initTelephones','SIP/%s','initTriggers','initSalesforceAccounts','initFreshdeskAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','freshsalesAccounts','initVoiceQueueHopperHistory','initVoiceQueueReports','groupBy','queuecallerexit','queuecallerabandon','queuecallerleaveAt','queuecallerjoinAt','sumDuration','queuecallercompleteAt','queuecallerexitAt'];(function(_0x33f587,_0x6863ce){var _0x34a17d=function(_0x5f6130){while(--_0x5f6130){_0x33f587['push'](_0x33f587['shift']());}};_0x34a17d(++_0x6863ce);}(_0x5f66,0x1a0));var _0x65f6=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x5f66[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var moment=require(_0x65f6('0x0'));var util=require('util');var Agent=require(_0x65f6('0x1'));var Telephone=require(_0x65f6('0x2'));var Trunk=require(_0x65f6('0x3'));var VoiceQueue=require(_0x65f6('0x4'));var Trigger=require(_0x65f6('0x5'));var Template=require('../model/template');var Campaign=require(_0x65f6('0x6'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0x65f6('0x7'));var SalesforceAccount=require(_0x65f6('0x8'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require(_0x65f6('0x9'));var DeskAccount=require(_0x65f6('0xa'));var VtigerAccount=require(_0x65f6('0xb'));var ServicenowAccount=require(_0x65f6('0xc'));var Dynamics365Account=require(_0x65f6('0xd'));var FreshsalesAccount=require(_0x65f6('0xe'));var FaxAccount=require('../model/faxAccount');function Realtime(){this['agents']={};this[_0x65f6('0xf')]={};this[_0x65f6('0x10')]={};this[_0x65f6('0x11')]={};this[_0x65f6('0x12')]={};this['campaigns']={};this[_0x65f6('0x13')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0x65f6('0x14')]={};this['queueChannels']={};this[_0x65f6('0x15')]={};this['timers']={};this[_0x65f6('0x16')]={};this[_0x65f6('0x17')]={};this[_0x65f6('0x18')]={};this[_0x65f6('0x19')]={};this[_0x65f6('0x1a')]={};this[_0x65f6('0x1b')]={};this[_0x65f6('0x1c')]={};this[_0x65f6('0x1d')]={};this[_0x65f6('0x1e')]={};this[_0x65f6('0x1f')]={};this['freshsalesAccounts']={};this[_0x65f6('0x20')]={};}function freeIsNotKey(_0x49a913,_0x5dd324,_0x1693e6){var _0x5c69f8=_[_0x65f6('0x21')](_0x49a913,function(_0x1c955c){return _0x1c955c[_0x1693e6];});for(var _0x1b1cbb in _0x5dd324){if(_0x5dd324[_0x65f6('0x22')](_0x1b1cbb)){if(!_0x5c69f8[_0x1b1cbb]){delete _0x5dd324[_0x1b1cbb];}}}}function freeIsNotKeySip(_0xc8660c,_0x18380e){var _0x495dd6=_['mapKeys'](_0xc8660c,function(_0x2d538c){return util['format']('SIP/%s',_0x2d538c['name']);});for(var _0x365159 in _0x18380e){if(_0x18380e[_0x65f6('0x22')](_0x365159)){if(!_0x495dd6[_0x365159]){delete _0x18380e[_0x365159];}}}}function freeIsNotKeyAgent(_0x5114a4,_0x39e19f){var _0x270893=_[_0x65f6('0x21')](_0x5114a4,function(_0x3876ed){var _0x219ab2=_[_0x65f6('0x23')](_0x3876ed['interface'])?util[_0x65f6('0x24')]('SIP/%s',_0x3876ed['name']):_0x3876ed[_0x65f6('0x25')];return _0x219ab2;});for(var _0xd173f4 in _0x39e19f){if(_0x39e19f['hasOwnProperty'](_0xd173f4)){if(!_0x270893[_0xd173f4]){delete _0x39e19f[_0xd173f4];}}}}function clearVoiceCallReports(_0x1eeaaa){_0x1eeaaa[_0x65f6('0x26')]=0x0;_0x1eeaaa[_0x65f6('0x27')]=0x0;_0x1eeaaa[_0x65f6('0x28')]=0x0;_0x1eeaaa['sumDuration']=0x0;_0x1eeaaa[_0x65f6('0x29')]=0x0;}function clearCampaigns(_0x59ea32){if(!_[_0x65f6('0x2a')](_0x59ea32)){for(var _0x5963e0 in _0x59ea32){if(_0x59ea32['hasOwnProperty'](_0x5963e0)){_0x59ea32[_0x5963e0]['ivrTotalCallsDays']=0x0;_0x59ea32[_0x5963e0][_0x65f6('0x2b')]=0x0;}}}}function clearVoiceQueues(_0x16cde8){if(!_['isEmpty'](_0x16cde8)){for(var _0x296cd9 in _0x16cde8){if(_0x16cde8[_0x65f6('0x22')](_0x296cd9)){_0x16cde8[_0x296cd9]['total']=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x27')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x2c')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x2d')]=0x0;_0x16cde8[_0x296cd9]['sumHoldTime']=0x0;_0x16cde8[_0x296cd9]['sumDuration']=0x0;_0x16cde8[_0x296cd9]['sumBillable']=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x2e')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x2f')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x30')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x31')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x32')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x33')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x34')]=0x0;_0x16cde8[_0x296cd9]['outboundDropCallsDayCallersExit']=0x0;_0x16cde8[_0x296cd9]['outboundBlacklistCallsDay']=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x35')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x36')]=0x0;_0x16cde8[_0x296cd9]['outboundReCallsDay']=0x0;_0x16cde8[_0x296cd9]['outboundAnswerAgiCallsDay']=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x37')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x38')]=!![];}}}}Realtime[_0x65f6('0x39')][_0x65f6('0x3a')]=function(_0x1217fd,_0x2d32be){for(var _0x5792a0 in _0x2d32be){if(_0x1217fd[_0x65f6('0x22')](_0x5792a0)){_0x1217fd[_0x5792a0]=_0x2d32be[_0x5792a0];}}};Realtime[_0x65f6('0x39')][_0x65f6('0x3b')]=function(){var _0x4bc037=this;return function(_0x217f35){if(_0x217f35){freeIsNotKeyAgent(_0x217f35,_0x4bc037[_0x65f6('0x3c')]);for(var _0xbaed3c=0x0,_0x45510a={};_0xbaed3c<_0x217f35[_0x65f6('0x3d')];_0xbaed3c+=0x1){_0x45510a=_0x217f35[_0xbaed3c];var _0x2f054c=_['isNil'](_0x45510a[_0x65f6('0x25')])?util[_0x65f6('0x24')]('SIP/%s',_0x45510a[_0x65f6('0x3e')]):_0x45510a['interface'];if(_[_0x65f6('0x3f')](_0x4bc037['agents'][_0x2f054c])){_0x4bc037[_0x65f6('0x3c')][_0x2f054c]=new Agent(_0x45510a);}else{_0x4bc037[_0x65f6('0x3a')](_0x4bc037['agents'][_0x2f054c],_0x45510a);}}}return _0x4bc037[_0x65f6('0x3c')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x40')]=function(){var _0x515648=this;return function(_0x582c7e){if(_0x582c7e){freeIsNotKeySip(_0x582c7e,_0x515648[_0x65f6('0xf')]);for(var _0x4c0df4=0x0,_0x26de30={};_0x4c0df4<_0x582c7e['length'];_0x4c0df4+=0x1){_0x26de30=_0x582c7e[_0x4c0df4];if(_[_0x65f6('0x3f')](_0x515648[_0x65f6('0xf')][util['format'](_0x65f6('0x41'),_0x26de30['name'])])){_0x515648['telephones'][util[_0x65f6('0x24')](_0x65f6('0x41'),_0x26de30[_0x65f6('0x3e')])]=new Telephone(_0x26de30);}else{_0x515648[_0x65f6('0x3a')](_0x515648[_0x65f6('0xf')][util[_0x65f6('0x24')](_0x65f6('0x41'),_0x26de30[_0x65f6('0x3e')])],_0x26de30);}}}return _0x515648['telephones'];};};Realtime[_0x65f6('0x39')]['initTrunks']=function(){var _0x12a589=this;return function(_0xa4394a){if(_0xa4394a){freeIsNotKeySip(_0xa4394a,_0x12a589[_0x65f6('0x10')]);for(var _0x2ea7f7=0x0,_0x5ef5c2={};_0x2ea7f7<_0xa4394a[_0x65f6('0x3d')];_0x2ea7f7+=0x1){_0x5ef5c2=_0xa4394a[_0x2ea7f7];if(_[_0x65f6('0x3f')](_0x12a589[_0x65f6('0x10')][util[_0x65f6('0x24')](_0x65f6('0x41'),_0x5ef5c2[_0x65f6('0x3e')])])){_0x12a589[_0x65f6('0x10')][util[_0x65f6('0x24')](_0x65f6('0x41'),_0x5ef5c2['name'])]=new Trunk(_0x5ef5c2);}else{_0x12a589[_0x65f6('0x3a')](_0x12a589[_0x65f6('0x10')][util[_0x65f6('0x24')](_0x65f6('0x41'),_0x5ef5c2[_0x65f6('0x3e')])],_0x5ef5c2);}}}return _0x12a589[_0x65f6('0x10')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x42')]=function(){var _0x461393=this;return function(_0x2abbed){if(_0x2abbed){freeIsNotKey(_0x2abbed,_0x461393[_0x65f6('0x12')],'id');for(var _0x2c008a=0x0,_0x6c4d94={};_0x2c008a<_0x2abbed[_0x65f6('0x3d')];_0x2c008a+=0x1){_0x6c4d94=_0x2abbed[_0x2c008a];if(_[_0x65f6('0x3f')](_0x461393[_0x65f6('0x12')][_0x6c4d94['id']])){_0x461393['triggers'][_0x6c4d94['id']]=new Trigger(_0x6c4d94);}else{_0x461393[_0x65f6('0x3a')](_0x461393[_0x65f6('0x12')][_0x6c4d94['id']],_0x6c4d94);}}}return _0x461393[_0x65f6('0x12')];};};Realtime[_0x65f6('0x39')]['initTemplates']=function(){var _0x1bf5bf=this;return function(_0x2d0dac){if(_0x2d0dac){freeIsNotKey(_0x2d0dac,_0x1bf5bf[_0x65f6('0x13')],'id');for(var _0x5e69b4=0x0,_0x2dbab3={};_0x5e69b4<_0x2d0dac[_0x65f6('0x3d')];_0x5e69b4+=0x1){_0x2dbab3=_0x2d0dac[_0x5e69b4];if(_[_0x65f6('0x3f')](_0x1bf5bf[_0x65f6('0x13')][_0x2dbab3['id']])){_0x1bf5bf['templates'][_0x2dbab3['id']]=new Template(_0x2dbab3);}else{_0x1bf5bf[_0x65f6('0x3a')](_0x1bf5bf['templates'][_0x2dbab3['id']],_0x2dbab3);}}}return _0x1bf5bf[_0x65f6('0x13')];};};Realtime[_0x65f6('0x39')]['initZendeskAccounts']=function(){var _0xf754ee=this;return function(_0x5085db){if(_0x5085db){freeIsNotKey(_0x5085db,_0xf754ee[_0x65f6('0x17')],'id');for(var _0x4d9b76=0x0,_0x2d1706={};_0x4d9b76<_0x5085db[_0x65f6('0x3d')];_0x4d9b76+=0x1){_0x2d1706=_0x5085db[_0x4d9b76];if(_[_0x65f6('0x3f')](_0xf754ee[_0x65f6('0x17')][_0x2d1706['id']])){_0xf754ee['zendeskAccounts'][_0x2d1706['id']]=new ZendeskAccount(_0x2d1706);}else{_0xf754ee['mergeFromDatabase'](_0xf754ee[_0x65f6('0x17')][_0x2d1706['id']],_0x2d1706);}}}return _0xf754ee[_0x65f6('0x17')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x43')]=function(){var _0x3b907c=this;return function(_0x2d6ab9){if(_0x2d6ab9){freeIsNotKey(_0x2d6ab9,_0x3b907c[_0x65f6('0x18')],'id');for(var _0x41690c=0x0,_0x414f49={};_0x41690c<_0x2d6ab9['length'];_0x41690c+=0x1){_0x414f49=_0x2d6ab9[_0x41690c];if(_[_0x65f6('0x3f')](_0x3b907c[_0x65f6('0x18')][_0x414f49['id']])){_0x3b907c[_0x65f6('0x18')][_0x414f49['id']]=new SalesforceAccount(_0x414f49);}else{_0x3b907c['mergeFromDatabase'](_0x3b907c[_0x65f6('0x18')][_0x414f49['id']],_0x414f49);}}}return _0x3b907c[_0x65f6('0x18')];};};Realtime['prototype'][_0x65f6('0x44')]=function(){var _0x253d52=this;return function(_0x57eb04){if(_0x57eb04){freeIsNotKey(_0x57eb04,_0x253d52[_0x65f6('0x1a')],'id');for(var _0x4f96c4=0x0,_0x247be3={};_0x4f96c4<_0x57eb04[_0x65f6('0x3d')];_0x4f96c4+=0x1){_0x247be3=_0x57eb04[_0x4f96c4];if(_[_0x65f6('0x3f')](_0x253d52['freshdeskAccounts'][_0x247be3['id']])){_0x253d52[_0x65f6('0x1a')][_0x247be3['id']]=new FreshdeskAccount(_0x247be3);}else{_0x253d52[_0x65f6('0x3a')](_0x253d52['freshdeskAccounts'][_0x247be3['id']],_0x247be3);}}}return _0x253d52[_0x65f6('0x1a')];};};Realtime[_0x65f6('0x39')]['initZohoAccounts']=function(){var _0x34d6a9=this;return function(_0x344c0e){if(_0x344c0e){freeIsNotKey(_0x344c0e,_0x34d6a9[_0x65f6('0x1b')],'id');for(var _0x25d504=0x0,_0x234fa7={};_0x25d504<_0x344c0e[_0x65f6('0x3d')];_0x25d504+=0x1){_0x234fa7=_0x344c0e[_0x25d504];if(_[_0x65f6('0x3f')](_0x34d6a9[_0x65f6('0x1b')][_0x234fa7['id']])){_0x34d6a9['zohoAccounts'][_0x234fa7['id']]=new ZohoAccount(_0x234fa7);}else{_0x34d6a9['mergeFromDatabase'](_0x34d6a9['zohoAccounts'][_0x234fa7['id']],_0x234fa7);}}}return _0x34d6a9[_0x65f6('0x1b')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x45')]=function(){var _0x20c322=this;return function(_0x545445){if(_0x545445){freeIsNotKey(_0x545445,_0x20c322[_0x65f6('0x1c')],'id');for(var _0x2032b9=0x0,_0x9ff849={};_0x2032b9<_0x545445['length'];_0x2032b9+=0x1){_0x9ff849=_0x545445[_0x2032b9];if(_[_0x65f6('0x3f')](_0x20c322[_0x65f6('0x1c')][_0x9ff849['id']])){_0x20c322[_0x65f6('0x1c')][_0x9ff849['id']]=new DeskAccount(_0x9ff849);}else{_0x20c322['mergeFromDatabase'](_0x20c322['deskAccounts'][_0x9ff849['id']],_0x9ff849);}}}return _0x20c322[_0x65f6('0x1c')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x46')]=function(){var _0x39364f=this;return function(_0x2a76b3){if(_0x2a76b3){freeIsNotKey(_0x2a76b3,_0x39364f[_0x65f6('0x19')],'id');for(var _0x35d77f=0x0,_0x138334={};_0x35d77f<_0x2a76b3[_0x65f6('0x3d')];_0x35d77f+=0x1){_0x138334=_0x2a76b3[_0x35d77f];if(_[_0x65f6('0x3f')](_0x39364f[_0x65f6('0x19')][_0x138334['id']])){_0x39364f[_0x65f6('0x19')][_0x138334['id']]=new SugarcrmAccount(_0x138334);}else{_0x39364f[_0x65f6('0x3a')](_0x39364f[_0x65f6('0x19')][_0x138334['id']],_0x138334);}}}return _0x39364f['sugarcrmAccounts'];};};Realtime[_0x65f6('0x39')][_0x65f6('0x47')]=function(){var _0x42a805=this;return function(_0x4b4efe){if(_0x4b4efe){freeIsNotKey(_0x4b4efe,_0x42a805[_0x65f6('0x1d')],'id');for(var _0x16dec0=0x0,_0x4638c9={};_0x16dec0<_0x4b4efe[_0x65f6('0x3d')];_0x16dec0+=0x1){_0x4638c9=_0x4b4efe[_0x16dec0];if(_['isUndefined'](_0x42a805[_0x65f6('0x1d')][_0x4638c9['id']])){_0x42a805[_0x65f6('0x1d')][_0x4638c9['id']]=new VtigerAccount(_0x4638c9);}else{_0x42a805[_0x65f6('0x3a')](_0x42a805[_0x65f6('0x1d')][_0x4638c9['id']],_0x4638c9);}}}return _0x42a805['vtigerAccounts'];};};Realtime[_0x65f6('0x39')][_0x65f6('0x48')]=function(){var _0x5c55e4=this;return function(_0x28682b){if(_0x28682b){freeIsNotKey(_0x28682b,_0x5c55e4[_0x65f6('0x1e')],'id');for(var _0x36c316=0x0,_0x51549d={};_0x36c316<_0x28682b[_0x65f6('0x3d')];_0x36c316+=0x1){_0x51549d=_0x28682b[_0x36c316];if(_[_0x65f6('0x3f')](_0x5c55e4[_0x65f6('0x1e')][_0x51549d['id']])){_0x5c55e4[_0x65f6('0x1e')][_0x51549d['id']]=new ServicenowAccount(_0x51549d);}else{_0x5c55e4[_0x65f6('0x3a')](_0x5c55e4[_0x65f6('0x1e')][_0x51549d['id']],_0x51549d);}}}return _0x5c55e4['servicenowAccounts'];};};Realtime['prototype']['initDynamics365Accounts']=function(){var _0x336a7d=this;return function(_0x367d95){if(_0x367d95){freeIsNotKey(_0x367d95,_0x336a7d[_0x65f6('0x1f')],'id');for(var _0x471bec=0x0,_0xab6f0={};_0x471bec<_0x367d95[_0x65f6('0x3d')];_0x471bec+=0x1){_0xab6f0=_0x367d95[_0x471bec];if(_['isUndefined'](_0x336a7d[_0x65f6('0x1f')][_0xab6f0['id']])){_0x336a7d[_0x65f6('0x1f')][_0xab6f0['id']]=new Dynamics365Account(_0xab6f0);}else{_0x336a7d['mergeFromDatabase'](_0x336a7d[_0x65f6('0x1f')][_0xab6f0['id']],_0xab6f0);}}}return _0x336a7d[_0x65f6('0x1f')];};};Realtime[_0x65f6('0x39')]['initFreshsalesAccounts']=function(){var _0x23c441=this;return function(_0x448c9a){if(_0x448c9a){freeIsNotKey(_0x448c9a,_0x23c441['freshsalesAccounts'],'id');for(var _0x271d76=0x0,_0x3edc6b={};_0x271d76<_0x448c9a[_0x65f6('0x3d')];_0x271d76+=0x1){_0x3edc6b=_0x448c9a[_0x271d76];if(_[_0x65f6('0x3f')](_0x23c441[_0x65f6('0x49')][_0x3edc6b['id']])){_0x23c441[_0x65f6('0x49')][_0x3edc6b['id']]=new FreshsalesAccount(_0x3edc6b);}else{_0x23c441[_0x65f6('0x3a')](_0x23c441['freshsalesAccounts'][_0x3edc6b['id']],_0x3edc6b);}}}return _0x23c441['freshsalesAccounts'];};};Realtime[_0x65f6('0x39')][_0x65f6('0x4a')]=function(){var _0x4a9524=this;return function(_0x417ba5){for(var _0x5f3df9=0x0;_0x5f3df9<_0x417ba5[_0x65f6('0x3d')];_0x5f3df9+=0x1){_['merge'](_0x4a9524[_0x65f6('0x11')][_0x417ba5[_0x5f3df9][_0x65f6('0x3e')]],_0x417ba5[_0x5f3df9]);}return _0x4a9524[_0x65f6('0x11')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x4b')]=function(){var _0x264e6c=this;return function(_0x1aaf75){clearVoiceQueues(_0x264e6c[_0x65f6('0x11')]);if(_0x1aaf75){_0x1aaf75=_[_0x65f6('0x4c')](_0x1aaf75,'uniqueid');for(var _0x480190 in _0x1aaf75){if(_0x1aaf75[_0x65f6('0x22')](_0x480190)){for(var _0x13ee4b=0x0;_0x13ee4b<_0x1aaf75[_0x480190][_0x65f6('0x3d')];_0x13ee4b+=0x1){var _0x51497f=_0x1aaf75[_0x480190][_0x13ee4b]['queue'];if(_0x264e6c[_0x65f6('0x11')][_0x51497f]){if(_0x1aaf75[_0x480190][_0x13ee4b][_0x65f6('0x4d')]){_0x264e6c[_0x65f6('0x11')][_0x51497f][_0x65f6('0x2c')]+=0x1;}if(_0x1aaf75[_0x480190][_0x13ee4b][_0x65f6('0x4e')]){_0x264e6c[_0x65f6('0x11')][_0x51497f]['abandoned']+=0x1;}_0x264e6c['voiceQueues'][_0x51497f][_0x65f6('0x28')]+=moment(_0x1aaf75[_0x480190][_0x13ee4b][_0x65f6('0x4f')])['diff'](moment(_0x1aaf75[_0x480190][_0x13ee4b][_0x65f6('0x50')]),'seconds')||0x0;if(_0x13ee4b===_0x1aaf75[_0x480190][_0x65f6('0x3d')]-0x1){_0x264e6c[_0x65f6('0x11')][_0x51497f][_0x65f6('0x51')]+=moment(_0x1aaf75[_0x480190][_0x13ee4b][_0x65f6('0x52')]||_0x1aaf75[_0x480190][_0x13ee4b]['queuecallerabandonAt']||_0x1aaf75[_0x480190][_0x13ee4b][_0x65f6('0x53')])[_0x65f6('0x54')](moment(_0x1aaf75[_0x480190][_0x13ee4b][_0x65f6('0x50')]),'seconds')||0x0;_0x264e6c['voiceQueues'][_0x51497f][_0x65f6('0x26')]+=0x1;if(_0x1aaf75[_0x480190][_0x13ee4b]['queuecallercomplete']){_0x264e6c[_0x65f6('0x11')][_0x51497f][_0x65f6('0x27')]+=0x1;_0x264e6c[_0x65f6('0x11')][_0x51497f][_0x65f6('0x29')]+=moment(_0x1aaf75[_0x480190][_0x13ee4b]['queuecallercompleteAt'])['diff'](moment(_0x1aaf75[_0x480190][_0x13ee4b]['queuecallerleaveAt']),_0x65f6('0x55'))||0x0;}}else{_0x264e6c[_0x65f6('0x11')][_0x51497f][_0x65f6('0x51')]+=_0x264e6c['voiceQueues'][_0x51497f][_0x65f6('0x28')]||0x0;}}}}}}return _0x264e6c[_0x65f6('0x11')];};};Realtime[_0x65f6('0x39')]['initVoiceCallReports']=function(){var _0x40d0f7=this;return function(_0x15809e){clearVoiceCallReports(_0x40d0f7['outbound']);if(_0x15809e){for(var _0x758e80=0x0;_0x758e80<_0x15809e[_0x65f6('0x3d')];_0x758e80+=0x1){_0x40d0f7['outbound'][_0x65f6('0x26')]+=0x1;_0x40d0f7['outbound'][_0x65f6('0x51')]+=_0x15809e[_0x758e80]['duration'];if(_0x15809e[_0x758e80][_0x65f6('0x56')]===_0x65f6('0x57')){_0x40d0f7['outbound'][_0x65f6('0x27')]+=0x1;_0x40d0f7[_0x65f6('0x58')][_0x65f6('0x28')]+=_0x15809e[_0x758e80][_0x65f6('0x59')]-_0x15809e[_0x758e80][_0x65f6('0x5a')]||0x0;_0x40d0f7[_0x65f6('0x58')][_0x65f6('0x29')]+=_0x15809e[_0x758e80][_0x65f6('0x5a')];}}}return _0x40d0f7[_0x65f6('0x58')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x5b')]=function(){var _0x574d84=this;return function(_0x10a661){if(_0x10a661){freeIsNotKey(_0x10a661,_0x574d84[_0x65f6('0x5c')],_0x65f6('0x3e'));for(var _0x219e42=0x0,_0x5694f9={};_0x219e42<_0x10a661[_0x65f6('0x3d')];_0x219e42+=0x1){_0x5694f9=_0x10a661[_0x219e42];if(_[_0x65f6('0x3f')](_0x574d84['campaigns'][_0x5694f9[_0x65f6('0x3e')]])){_0x574d84['campaigns'][_0x5694f9[_0x65f6('0x3e')]]=new Campaign(_0x5694f9);}else{_0x574d84['mergeFromDatabase'](_0x574d84[_0x65f6('0x5c')][_0x5694f9[_0x65f6('0x3e')]],_0x5694f9);_0x574d84['campaigns'][_0x5694f9['name']][_0x65f6('0x5d')]=_0x5694f9[_0x65f6('0x5e')]?_0x5694f9['SquareProject'][_0x65f6('0x3e')]:undefined;}}}return _0x574d84[_0x65f6('0x5c')];};};Realtime[_0x65f6('0x39')]['initVoiceExtensions']=function(){var _0x1348ec=this;return function(_0x246510){if(_0x246510){freeIsNotKey(_0x246510,_0x1348ec['voiceExtensions'],'id');for(var _0x36b8de=0x0,_0x504b39={};_0x36b8de<_0x246510[_0x65f6('0x3d')];_0x36b8de+=0x1){_0x504b39=_0x246510[_0x36b8de];if(_['isUndefined'](_0x1348ec['voiceExtensions'][_0x504b39['id']])){_0x1348ec[_0x65f6('0x5f')][_0x504b39['id']]=new VoiceExtension(_0x504b39);}else{_0x1348ec[_0x65f6('0x3a')](_0x1348ec[_0x65f6('0x5f')][_0x504b39['id']],_0x504b39);}}}return _0x1348ec[_0x65f6('0x5f')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x60')]=function(){var _0x1ac46f=this;return function(_0x1f4e2c){clearCampaigns(_0x1ac46f['campaigns']);for(var _0x494904=0x0;_0x494904<_0x1f4e2c[_0x65f6('0x3d')];_0x494904+=0x1){_['merge'](_0x1ac46f[_0x65f6('0x5c')][_0x1f4e2c[_0x494904][_0x65f6('0x3e')]],_0x1f4e2c[_0x494904]);}return _0x1ac46f[_0x65f6('0x5c')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x61')]=function(){var _0x56bd9d=this;return function(_0x398cac){if(_0x398cac){freeIsNotKey(_0x398cac,_0x56bd9d[_0x65f6('0x20')],'id');for(var _0x14c908=0x0,_0x576ecd={};_0x14c908<_0x398cac[_0x65f6('0x3d')];_0x14c908+=0x1){_0x576ecd=_0x398cac[_0x14c908];if(_[_0x65f6('0x3f')](_0x56bd9d[_0x65f6('0x20')][_0x576ecd['id']])){_0x56bd9d[_0x65f6('0x20')][_0x576ecd['id']]=new FaxAccount(_0x576ecd);}else{_0x56bd9d[_0x65f6('0x3a')](_0x56bd9d[_0x65f6('0x20')][_0x576ecd['id']],_0x576ecd);}}}return _0x56bd9d['faxAccounts'];};};Realtime['prototype'][_0x65f6('0x62')]=function(){var _0x10d744=this;return function(_0x10c916){if(_0x10c916){freeIsNotKey(_0x10c916,_0x10d744[_0x65f6('0x11')],'name');for(var _0x4bda86=0x0,_0x336076={};_0x4bda86<_0x10c916[_0x65f6('0x3d')];_0x4bda86+=0x1){_0x336076=_0x10c916[_0x4bda86];if(_[_0x65f6('0x3f')](_0x10d744[_0x65f6('0x11')][_0x336076[_0x65f6('0x3e')]])){_0x10d744[_0x65f6('0x11')][_0x336076['name']]=new VoiceQueue(_0x336076);}else{_0x10d744['mergeFromDatabase'](_0x10d744['voiceQueues'][_0x336076[_0x65f6('0x3e')]],_0x336076);}}}return _0x10d744[_0x65f6('0x11')];};};module[_0x65f6('0x63')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/realtime/utils.js b/server/services/ami/realtime/utils.js index 5554f89..b1cada2 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 _0x012b=['assign','mergeDBDataToRealtime'];(function(_0x228748,_0x4863a4){var _0x295a16=function(_0x31606b){while(--_0x31606b){_0x228748['push'](_0x228748['shift']());}};_0x295a16(++_0x4863a4);}(_0x012b,0x160));var _0xb012=function(_0x138188,_0x58355e){_0x138188=_0x138188-0x0;var _0x277b25=_0x012b[_0x138188];return _0x277b25;};'use strict';function mergeDBDataToRealtime(_0x234118,_0x5072af){var _0x21e163=Object[_0xb012('0x0')]({},_0x234118);for(var _0x31f1b6 in _0x5072af){if(_0x21e163['hasOwnProperty'](_0x31f1b6)){_0x21e163[_0x31f1b6]=_0x5072af[_0x31f1b6];}}return _0x21e163;}exports[_0xb012('0x1')]=mergeDBDataToRealtime; \ No newline at end of file +var _0x3e6c=['assign','hasOwnProperty'];(function(_0x1589e0,_0x1d3537){var _0x37a9b2=function(_0x4d316c){while(--_0x4d316c){_0x1589e0['push'](_0x1589e0['shift']());}};_0x37a9b2(++_0x1d3537);}(_0x3e6c,0x168));var _0xc3e6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3e6c[_0x3dd15e];return _0x231fd0;};'use strict';function mergeDBDataToRealtime(_0x57e2b6,_0x30041a){var _0xad2940=Object[_0xc3e6('0x0')]({},_0x57e2b6);for(var _0x37396d in _0x30041a){if(_0xad2940[_0xc3e6('0x1')](_0x37396d)){_0xad2940[_0x37396d]=_0x30041a[_0x37396d];}}return _0xad2940;}exports['mergeDBDataToRealtime']=mergeDBDataToRealtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index b2d0a26..2737ba8 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 _0x1ff1=['create','monitor','monitors','monitorFilename','createdAt','connectedlinename','xcally-motion-dialer','forEach','startsWith','Local','substring','indexOf','phone','lastIndexOf','transfererlinkedid','lodash','moment','../../../config/environment','../ami','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceDialReport','realtime','agents','telephones','prototype','sync','xdr','disabled','voiceQueueReport','bind','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedTransfer','findAgent','find','accountcode','isNil','name','interface','format','SIP/%s','length','connectedlinenum','assigned','lastAssignedTo','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','match','getAgentByInternal','keys','getCallType','channel','split','calleridnum','internal','voiceCallReport','destination','exten','lastapplication','queue','lastdata','context','from-voip-provider','callerid','from-sip','originatecalleridnum','destinationchannel','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','type','UserId','membername'];(function(_0x396ef2,_0x525c3a){var _0x4e4add=function(_0x452cd5){while(--_0x452cd5){_0x396ef2['push'](_0x396ef2['shift']());}};_0x4e4add(++_0x525c3a);}(_0x1ff1,0x114));var _0x11ff=function(_0x19c9e4,_0x129545){_0x19c9e4=_0x19c9e4-0x0;var _0x61d737=_0x1ff1[_0x19c9e4];return _0x61d737;};'use strict';var _=require(_0x11ff('0x0'));var moment=require(_0x11ff('0x1'));var util=require('util');var config=require(_0x11ff('0x2'));var ami=require(_0x11ff('0x3'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0x11ff('0x4'));var RpcMemberReport=require(_0x11ff('0x5'));var RpcVoiceQueueReport=require(_0x11ff('0x6'));var RpcVoiceRecording=require(_0x11ff('0x7'));var RpcVoiceTransferReport=require(_0x11ff('0x8'));var VoiceQueueReport=require(_0x11ff('0x9'));var VoiceCallReport=require(_0x11ff('0xa'));var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require(_0x11ff('0xb'));var UserReport=require('./userReport');function Report(_0x66ba5f){this[_0x11ff('0xc')]=_0x66ba5f;this[_0x11ff('0xd')]=_0x66ba5f[_0x11ff('0xd')];this[_0x11ff('0xe')]=_0x66ba5f['telephones'];}Report[_0x11ff('0xf')][_0x11ff('0x10')]=function(_0x2df8ca){var _0x428d3e=new VoiceQueueReport(this['realtime']);var _0x2940f7=new VoiceAgentReport(this[_0x11ff('0xc')]);var _0x9975aa=new VoiceDialReport(this[_0x11ff('0xc')]);var _0x17d3f1=new VoiceCallReport(this[_0x11ff('0xc')]);var _0x37efa5=new UserReport(this[_0x11ff('0xc')]);if(config[_0x11ff('0x11')]&&config[_0x11ff('0x11')][_0x11ff('0x12')]){ami['on']('custom:voiceQueueReport',this[_0x11ff('0x13')][_0x11ff('0x14')](this));ami['on']('custom:voiceCallReport',this['voiceCallReport']['bind'](this));ami['on'](_0x11ff('0x15'),this[_0x11ff('0x16')][_0x11ff('0x14')](this));ami['on'](_0x11ff('0x17'),this[_0x11ff('0x18')]['bind'](this));ami['on'](_0x11ff('0x19'),this[_0x11ff('0x1a')]['bind'](this));ami['on']('attendedtransfer',this[_0x11ff('0x1b')][_0x11ff('0x14')](this));}};Report[_0x11ff('0xf')][_0x11ff('0x1c')]=function(_0x5a33b0){var _0x445d67;_0x445d67=_[_0x11ff('0x1d')](this[_0x11ff('0xd')],function(_0x1ee3a5){return _0x1ee3a5[_0x11ff('0x1e')]==_0x5a33b0||_0x1ee3a5['name']==_0x5a33b0;});if(_[_0x11ff('0x1f')](_0x445d67)){var _0xf759c4=_[_0x11ff('0x1d')](this['telephones'],function(_0x23b7fb){return _0x23b7fb[_0x11ff('0x1e')]==_0x5a33b0||_0x23b7fb[_0x11ff('0x20')]==_0x5a33b0;});if(_0xf759c4){_0x445d67=_['find'](this[_0x11ff('0xd')],function(_0x1c3a8f){return _0x1c3a8f[_0x11ff('0x21')]==util[_0x11ff('0x22')](_0x11ff('0x23'),_0xf759c4[_0x11ff('0x20')]);});}}return _0x445d67;};Report[_0x11ff('0xf')][_0x11ff('0x13')]=function(_0x35899d){for(var _0x150512=0x0;_0x150512<_0x35899d[_0x11ff('0x24')];_0x150512+=0x1){var _0x1b6834=this[_0x11ff('0x1c')](_0x35899d[_0x150512][_0x11ff('0x25')]);if(_0x1b6834){_0x35899d[_0x150512][_0x11ff('0x1e')]=_0x1b6834[_0x11ff('0x1e')];_0x35899d[_0x150512][_0x11ff('0x26')]=!![];_0x35899d[_0x150512][_0x11ff('0x27')]=_0x1b6834[_0x11ff('0x20')];_0x35899d[_0x150512]['interface']=_[_0x11ff('0x1f')](_0x1b6834[_0x11ff('0x21')])?util[_0x11ff('0x22')]('SIP/%s',_0x1b6834[_0x11ff('0x20')]):_0x1b6834[_0x11ff('0x21')];if(_0x35899d[_0x150512]['queuecallercomplete']){_0x35899d[_0x150512]['queuecallercompleteAt']=moment()['format'](_0x11ff('0x28'));}if(_0x35899d[_0x150512][_0x11ff('0x29')]){_0x35899d[_0x150512]['queuecallerexitAt']=moment()[_0x11ff('0x22')]('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport[_0x11ff('0x13')](_0x35899d[_0x150512]);}RpcVoiceQueueReport['create'](_0x35899d[_0x150512]);}};function extractCalleridNumber(_0x162576){var _0x10d538=_0x162576[_0x11ff('0x2a')](/<(.*?)>/);return _0x10d538?_0x10d538[0x1]:_0x162576;}Report[_0x11ff('0xf')][_0x11ff('0x2b')]=function(_0x52879f){for(var _0x3e2ee9=0x0;_0x3e2ee9','calleridname','transfers','linkedid','transfereelinkedid','UserId','monitors','createdAt','exten','xcally-motion-preview','connectedlinename','membername','xcally-motion-dialer','isArray','forEach','startsWith','Local','substring','indexOf','mobile','phone','lastIndexOf','transfererlinkedid','attendedTransfer','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport'];(function(_0x814ffb,_0x5e15bd){var _0x542f89=function(_0x13b20b){while(--_0x13b20b){_0x814ffb['push'](_0x814ffb['shift']());}};_0x542f89(++_0x5e15bd);}(_0xe12e,0x108));var _0xee12=function(_0x1acf4b,_0x5a750c){_0x1acf4b=_0x1acf4b-0x0;var _0x4eca09=_0xe12e[_0x1acf4b];return _0x4eca09;};'use strict';var _=require('lodash');var moment=require('moment');var util=require(_0xee12('0x0'));var config=require(_0xee12('0x1'));var ami=require(_0xee12('0x2'));var RpcVoiceAgentReport=require(_0xee12('0x3'));var RpcVoiceCallReport=require(_0xee12('0x4'));var RpcVoiceDialReport=require(_0xee12('0x5'));var RpcMemberReport=require(_0xee12('0x6'));var RpcVoiceQueueReport=require(_0xee12('0x7'));var RpcVoiceRecording=require(_0xee12('0x8'));var RpcVoiceTransferReport=require(_0xee12('0x9'));var VoiceQueueReport=require(_0xee12('0xa'));var VoiceCallReport=require(_0xee12('0xb'));var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require(_0xee12('0xc'));var UserReport=require(_0xee12('0xd'));function Report(_0x49c69b){this[_0xee12('0xe')]=_0x49c69b;this[_0xee12('0xf')]=_0x49c69b[_0xee12('0xf')];this[_0xee12('0x10')]=_0x49c69b[_0xee12('0x10')];}Report[_0xee12('0x11')][_0xee12('0x12')]=function(_0x19a286){var _0x4cc8ad=new VoiceQueueReport(this[_0xee12('0xe')]);var _0x4f8ff7=new VoiceAgentReport(this[_0xee12('0xe')]);var _0x163fa8=new VoiceDialReport(this[_0xee12('0xe')]);var _0x5cbc26=new VoiceCallReport(this[_0xee12('0xe')]);var _0x3b32d5=new UserReport(this['realtime']);if(config[_0xee12('0x13')]&&config[_0xee12('0x13')]['disabled']){ami['on']('custom:voiceQueueReport',this['voiceQueueReport'][_0xee12('0x14')](this));ami['on'](_0xee12('0x15'),this[_0xee12('0x16')]['bind'](this));ami['on'](_0xee12('0x17'),this[_0xee12('0x18')][_0xee12('0x14')](this));ami['on'](_0xee12('0x19'),this[_0xee12('0x1a')]['bind'](this));ami['on'](_0xee12('0x1b'),this[_0xee12('0x1c')][_0xee12('0x14')](this));ami['on']('attendedtransfer',this['attendedTransfer']['bind'](this));}};Report[_0xee12('0x11')][_0xee12('0x1d')]=function(_0x3d098f){var _0x16aedd;_0x16aedd=_[_0xee12('0x1e')](this['agents'],function(_0x5c71d9){return _0x5c71d9[_0xee12('0x1f')]==_0x3d098f||_0x5c71d9[_0xee12('0x20')]==_0x3d098f;});if(_[_0xee12('0x21')](_0x16aedd)){var _0x51c021=_['find'](this[_0xee12('0x10')],function(_0x39145f){return _0x39145f['accountcode']==_0x3d098f||_0x39145f[_0xee12('0x20')]==_0x3d098f;});if(_0x51c021){_0x16aedd=_[_0xee12('0x1e')](this['agents'],function(_0x5546fc){return _0x5546fc[_0xee12('0x22')]==util['format'](_0xee12('0x23'),_0x51c021[_0xee12('0x20')]);});}}return _0x16aedd;};Report[_0xee12('0x11')]['voiceQueueReport']=function(_0x35a32c){for(var _0x56731a=0x0;_0x56731a<_0x35a32c[_0xee12('0x24')];_0x56731a+=0x1){var _0x3ee98a=this[_0xee12('0x1d')](_0x35a32c[_0x56731a][_0xee12('0x25')]);if(_0x3ee98a){_0x35a32c[_0x56731a][_0xee12('0x1f')]=_0x3ee98a[_0xee12('0x1f')];_0x35a32c[_0x56731a][_0xee12('0x26')]=!![];_0x35a32c[_0x56731a]['lastAssignedTo']=_0x3ee98a[_0xee12('0x20')];_0x35a32c[_0x56731a]['interface']=_['isNil'](_0x3ee98a[_0xee12('0x22')])?util['format'](_0xee12('0x23'),_0x3ee98a['name']):_0x3ee98a[_0xee12('0x22')];if(_0x35a32c[_0x56731a][_0xee12('0x27')]){_0x35a32c[_0x56731a]['queuecallercompleteAt']=moment()[_0xee12('0x28')](_0xee12('0x29'));}if(_0x35a32c[_0x56731a][_0xee12('0x2a')]){_0x35a32c[_0x56731a][_0xee12('0x2b')]=moment()[_0xee12('0x28')](_0xee12('0x29'));}RpcMemberReport[_0xee12('0x2c')](_0x35a32c[_0x56731a]);}RpcVoiceQueueReport[_0xee12('0x2d')](_0x35a32c[_0x56731a]);}};function extractCalleridNumber(_0x509a58){var _0x5e124f=_0x509a58[_0xee12('0x2e')](/<(.*?)>/);return _0x5e124f?_0x5e124f[0x1]:_0x509a58;}Report[_0xee12('0x11')][_0xee12('0x2f')]=function(_0x3248e7){for(var _0x29eae7=0x0;_0x29eae70x0?!![]:![];if(!_0x3f30e2){return this['syncQueueSummaryComplete'](this[_0x0c6f('0x15')][_0x0c6f('0x71')]);}};VoiceQueueReport[_0x0c6f('0x3d')][_0x0c6f('0x72')]=function(_0x232c10){var _0x189d0c=this[_0x0c6f('0x15')]['id'];if(this[_0x0c6f('0x15')][_0x0c6f('0x68')][_0x189d0c]&&this[_0x0c6f('0x15')][_0x0c6f('0x68')][_0x189d0c][_0x232c10[_0x0c6f('0x67')]]){this[_0x0c6f('0x15')]['queuestatus'][_0x189d0c][_0x232c10[_0x0c6f('0x67')]]['agents'][_0x0c6f('0x73')](_0x232c10);}};VoiceQueueReport[_0x0c6f('0x3d')][_0x0c6f('0x74')]=function(_0x21e429){var _0x336033=this;try{if(this['isNotNull'](_0x21e429)&&this[_0x0c6f('0x60')](_0x21e429[_0x0c6f('0x53')])){logger['debug'](_0x0c6f('0x75'),util[_0x0c6f('0x44')](_0x21e429,{'showHidden':![],'depth':null}));var _0x37237a=this['voiceQueues'][_0x21e429['queue']];if(_0x37237a){logger[_0x0c6f('0x4e')](_0x0c6f('0x76'),_0x37237a[_0x0c6f('0x5e')]);this[_0x0c6f('0x15')][_0x0c6f('0x63')][_0x37237a[_0x0c6f('0x5e')]]={'summaryEvent':_0x21e429};this[_0x0c6f('0x15')][_0x0c6f('0x70')]+=0x1;return ami[_0x0c6f('0x62')]({'action':_0x0c6f('0x68'),'queue':_0x37237a[_0x0c6f('0x5e')]})[_0x0c6f('0x77')](function(_0x68160){if(!_0x336033[_0x0c6f('0x15')][_0x0c6f('0x68')][_0x21e429[_0x0c6f('0x67')]]){_0x336033['summary'][_0x0c6f('0x68')][_0x21e429['actionid']]={};}_0x336033[_0x0c6f('0x15')][_0x0c6f('0x68')][_0x21e429[_0x0c6f('0x67')]][_0x68160[_0x0c6f('0x67')]]={'queue':_0x37237a[_0x0c6f('0x5e')],'agents':[]};})['catch'](function(_0x2a98c5){throw _0x2a98c5;});}}}catch(_0x163f57){logger[_0x0c6f('0x42')](_0x0c6f('0x69'),util[_0x0c6f('0x44')](_0x163f57,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x0c6f('0x3d')][_0x0c6f('0x19')]=function(_0x4b52c3){if(this[_0x0c6f('0x15')][_0x0c6f('0x70')]>0x0){this[_0x0c6f('0x15')][_0x0c6f('0x71')]=_0x4b52c3;return;}logger['debug']('[voiceQueueReport][queuesummarycomplete]\x20event:',util[_0x0c6f('0x44')](_0x4b52c3,{'showHidden':![],'depth':null}));this[_0x0c6f('0x15')]=initializeSummary();ami[_0x0c6f('0x4c')](_0x0c6f('0x78'),{});};VoiceQueueReport[_0x0c6f('0x3d')][_0x0c6f('0x1e')]=function(_0x16988c){try{if(this['isNotNull'](_0x16988c)){logger[_0x0c6f('0x4e')](_0x0c6f('0x79'),_0x16988c[_0x0c6f('0x51')],util[_0x0c6f('0x44')](_0x16988c,{'showHidden':![],'depth':null}));if(_[_0x0c6f('0x61')](this[_0x0c6f('0x45')][_0x16988c['uniqueid']])){this['queueReports'][_0x16988c[_0x0c6f('0x51')]]=[];}if(_[_0x0c6f('0x61')](this[_0x0c6f('0x11')][_0x16988c['uniqueid']])){this['channels'][_0x16988c['uniqueid']]={};}var _0x1c2ec9=new QueueReport();_0x1c2ec9['queue']=_0x16988c[_0x0c6f('0x53')];_0x1c2ec9[_0x0c6f('0x5b')]=this[_0x0c6f('0x13')][_0x1c2ec9[_0x0c6f('0x53')]]&&this[_0x0c6f('0x13')][_0x1c2ec9[_0x0c6f('0x53')]][_0x0c6f('0x5b')]?this[_0x0c6f('0x13')][_0x1c2ec9[_0x0c6f('0x53')]][_0x0c6f('0x5b')]||'inbound':'inbound';_0x1c2ec9['queuecallerjoinAt']=moment()[_0x0c6f('0x58')]('YYYY-MM-DD\x20HH:mm:ss');_0x1c2ec9[_0x0c6f('0x7a')]=_0x16988c['position'];_0x1c2ec9[_0x0c6f('0x7b')]=_0x16988c[_0x0c6f('0x7b')];_0x1c2ec9['uniqueid']=_0x16988c[_0x0c6f('0x51')];_0x1c2ec9[_0x0c6f('0x7c')]=this[_0x0c6f('0x11')][_0x16988c[_0x0c6f('0x51')]][_0x0c6f('0x7c')];logger[_0x0c6f('0x7d')]('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x1c2ec9[_0x0c6f('0x53')],_0x1c2ec9[_0x0c6f('0x5b')]);Object['assign'](_0x1c2ec9,_[_0x0c6f('0x7e')](_0x16988c,_[_0x0c6f('0x7f')](_0x1c2ec9)));this[_0x0c6f('0x45')][_0x16988c[_0x0c6f('0x51')]][_0x0c6f('0x73')](_0x1c2ec9);this[_0x0c6f('0x11')][_0x16988c[_0x0c6f('0x51')]]=_0x1c2ec9;this[_0x0c6f('0x4d')](_0x1c2ec9,_0x0c6f('0x1d'));}}catch(_0x218690){logger[_0x0c6f('0x42')]('[%s][voiceQueueReport][queuecallerjoin]',_0x16988c[_0x0c6f('0x51')],util['inspect'](_0x218690,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x0c6f('0x3d')][_0x0c6f('0x80')]=function(_0x2bc8b5){try{if(this['isNotNull'](_0x2bc8b5)){logger[_0x0c6f('0x4e')](_0x0c6f('0x81'),_0x2bc8b5[_0x0c6f('0x51')],util[_0x0c6f('0x44')](_0x2bc8b5,{'showHidden':![],'depth':null}));if(this[_0x0c6f('0x45')][_0x2bc8b5[_0x0c6f('0x51')]]){var _0x45d409=_[_0x0c6f('0x82')](this[_0x0c6f('0x45')][_0x2bc8b5[_0x0c6f('0x51')]]);_0x45d409[_0x0c6f('0x3c')]=![];_0x45d409[_0x0c6f('0x83')]=null;_0x45d409[_0x0c6f('0x84')]=_0x2bc8b5[_0x0c6f('0x84')];_0x45d409[_0x0c6f('0x85')]=_0x2bc8b5['originalposition'];_0x45d409[_0x0c6f('0x1f')]=!![];_0x45d409[_0x0c6f('0x86')]=moment()[_0x0c6f('0x58')]('YYYY-MM-DD\x20HH:mm:ss');_0x45d409[_0x0c6f('0x56')]=_0x0c6f('0x87');_0x45d409['lastAssignedTo']=null;logger[_0x0c6f('0x7d')](_0x0c6f('0x88'),_0x45d409[_0x0c6f('0x53')],_0x45d409[_0x0c6f('0x5b')]);this[_0x0c6f('0x11')][_0x2bc8b5[_0x0c6f('0x51')]]=_0x45d409;this[_0x0c6f('0x4a')](_0x45d409,'queuecallerabandon');}}}catch(_0x338922){logger['error'](_0x0c6f('0x81'),_0x2bc8b5[_0x0c6f('0x51')],util[_0x0c6f('0x44')](_0x338922,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x0c6f('0x21')]=function(_0x1974ae){try{if(this[_0x0c6f('0x60')](_0x1974ae)){logger['debug']('[%s][voiceQueueReport][queuecallerleave]',_0x1974ae[_0x0c6f('0x51')],util[_0x0c6f('0x44')](_0x1974ae,{'showHidden':![],'depth':null}));if(this[_0x0c6f('0x45')][_0x1974ae[_0x0c6f('0x51')]]){var _0x589198=_[_0x0c6f('0x82')](this[_0x0c6f('0x45')][_0x1974ae[_0x0c6f('0x51')]]);_0x589198[_0x0c6f('0x89')]=moment()[_0x0c6f('0x58')]('YYYY-MM-DD\x20HH:mm:ss');_0x589198[_0x0c6f('0x8a')]=_0x1974ae[_0x0c6f('0x8a')];_0x589198[_0x0c6f('0x8b')]=_0x1974ae['connectedlinename'];logger[_0x0c6f('0x7d')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x589198[_0x0c6f('0x53')],_0x589198[_0x0c6f('0x5b')],_0x1974ae[_0x0c6f('0x8a')],_0x1974ae[_0x0c6f('0x8b')]);this[_0x0c6f('0x11')][_0x1974ae[_0x0c6f('0x51')]]=_0x589198;this[_0x0c6f('0x4d')](_0x589198,_0x0c6f('0x20'));}}}catch(_0x4a8977){logger[_0x0c6f('0x42')](_0x0c6f('0x8c'),_0x1974ae[_0x0c6f('0x51')],util[_0x0c6f('0x44')](_0x4a8977,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x0c6f('0x3d')][_0x0c6f('0x25')]=function(_0x858ac){try{if(this[_0x0c6f('0x60')](_0x858ac)){logger['debug'](_0x0c6f('0x8d'),_0x858ac['uniqueid'],util['inspect'](_0x858ac,{'showHidden':![],'depth':null}));if(this[_0x0c6f('0x45')][_0x858ac[_0x0c6f('0x51')]]){var _0x81644d=_[_0x0c6f('0x82')](this['queueReports'][_0x858ac[_0x0c6f('0x51')]]);_0x81644d[_0x0c6f('0x3c')]=!![];_0x81644d[_0x0c6f('0x56')]=_0x0c6f('0x8e');logger[_0x0c6f('0x7d')](_0x0c6f('0x8f'),_0x81644d[_0x0c6f('0x53')],_0x81644d[_0x0c6f('0x5b')]);}}}catch(_0x5957c5){logger[_0x0c6f('0x42')]('[%s][voiceQueueReport][agentconnect]',_0x858ac['uniqueid'],util['inspect'](_0x5957c5,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x0c6f('0x23')]=function(_0x2686cf){try{if(this[_0x0c6f('0x60')](_0x2686cf)){logger[_0x0c6f('0x4e')](_0x0c6f('0x90'),_0x2686cf['uniqueid'],util[_0x0c6f('0x44')](_0x2686cf,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x2686cf[_0x0c6f('0x51')]]){var _0x44664c=_[_0x0c6f('0x82')](this[_0x0c6f('0x45')][_0x2686cf[_0x0c6f('0x51')]]);_0x44664c['queuecallerabandon']=![];_0x44664c[_0x0c6f('0x86')]=null;_0x44664c[_0x0c6f('0x91')]=!![];_0x44664c[_0x0c6f('0x92')]=_0x2686cf[_0x0c6f('0x93')];_0x44664c[_0x0c6f('0x84')]=_0x2686cf[_0x0c6f('0x84')];_0x44664c[_0x0c6f('0x3c')]=!![];_0x44664c['queuecallerexit']=![];_0x44664c[_0x0c6f('0x94')]=null;if(!_0x44664c[_0x0c6f('0x95')]){if(_0x2686cf['reason']==_0x0c6f('0x95')){_0x44664c['queuecallerexitreason']=_0x0c6f('0x96');logger['info'](_0x0c6f('0x97'),_0x44664c[_0x0c6f('0x53')],_0x44664c['type']);}else{if(_[_0x0c6f('0x98')](_0x2686cf[_0x0c6f('0x99')][_0x0c6f('0x9a')](),'local/')){if(this['queueReports'][_0x2686cf[_0x0c6f('0x9b')]]){var _0x470989=_[_0x0c6f('0x82')](this['queueReports'][_0x2686cf[_0x0c6f('0x9b')]]);_0x470989[_0x0c6f('0x3c')]=![];_0x470989[_0x0c6f('0x9c')]=!![];_0x470989['queuecallerexitAt']=moment(_0x44664c[_0x0c6f('0x9d')])[_0x0c6f('0x9e')](_0x2686cf[_0x0c6f('0x84')],_0x0c6f('0x9f'))['format'](_0x0c6f('0xa0'));_0x470989['queuecallerexitreason']=_0x0c6f('0xa1');_0x470989[_0x0c6f('0x95')]=!![];_0x470989[_0x0c6f('0xa2')]=_0x0c6f('0xa3');_0x470989['transferexten']=_0x2686cf[_0x0c6f('0xa4')];_0x470989['transferuniqueid']=_0x2686cf[_0x0c6f('0x51')];logger[_0x0c6f('0x7d')](_0x0c6f('0xa5'),_0x470989['queue'],_0x470989[_0x0c6f('0x5b')]);var _0x237747=this[_0x0c6f('0x45')][_0x2686cf[_0x0c6f('0x9b')]];this[_0x0c6f('0x45')][_0x2686cf['linkedid']]=this[_0x0c6f('0x45')][_0x2686cf[_0x0c6f('0x51')]];this[_0x0c6f('0x45')][_0x2686cf[_0x0c6f('0x51')]]=_0x237747;}}else{_0x44664c[_0x0c6f('0x56')]=_0x0c6f('0xa6')+_0x2686cf[_0x0c6f('0xa7')][_0x0c6f('0xa8')]();logger[_0x0c6f('0x7d')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x44664c['queue'],_0x44664c[_0x0c6f('0x5b')],_0x44664c[_0x0c6f('0x56')]);}}}this[_0x0c6f('0x11')][_0x2686cf[_0x0c6f('0x51')]]=_0x44664c;}}}catch(_0x209e23){logger[_0x0c6f('0x42')](_0x0c6f('0x90'),_0x2686cf[_0x0c6f('0x51')],util[_0x0c6f('0x44')](_0x209e23,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x0c6f('0x3d')]['syncVarSet']=function(_0x2bc4a1){try{if(this[_0x0c6f('0x60')](_0x2bc4a1)){logger[_0x0c6f('0x4e')]('[%s][voiceQueueReport][varset]',_0x2bc4a1[_0x0c6f('0x51')],util[_0x0c6f('0x44')](_0x2bc4a1,{'showHidden':![],'depth':null}));this[_0x0c6f('0xa9')](_0x2bc4a1['uniqueid'],_[_0x0c6f('0x7f')](_0x2bc4a1[_0x0c6f('0xaa')])[0x0],_0x2bc4a1['value']);if(this[_0x0c6f('0x45')][_0x2bc4a1[_0x0c6f('0x51')]]){var _0x4a5a5b=_[_0x0c6f('0x82')](this[_0x0c6f('0x45')][_0x2bc4a1[_0x0c6f('0x51')]]);if(_0x4a5a5b){if(this[_0x0c6f('0x60')](_0x2bc4a1[_0x0c6f('0xaa')])&&this[_0x0c6f('0x60')](_0x2bc4a1[_0x0c6f('0xaa')]['queuestatus'])){switch(_0x2bc4a1['value']){case _0x0c6f('0xab'):_0x4a5a5b['queuecallerexit']=![];_0x4a5a5b[_0x0c6f('0x94')]=null;break;case _0x0c6f('0xac'):_0x4a5a5b['lastevent']=_0x0c6f('0xad');_0x4a5a5b[_0x0c6f('0x9c')]=!![];_0x4a5a5b[_0x0c6f('0x94')]=moment()['format'](_0x0c6f('0xa0'));_0x4a5a5b[_0x0c6f('0x89')]=moment()[_0x0c6f('0x58')](_0x0c6f('0xa0'));logger['debug'](_0x0c6f('0xae'),_0x2bc4a1[_0x0c6f('0x51')],util['inspect'](_0x4a5a5b,{'showHidden':![],'depth':null}));ami['emit'](_0x0c6f('0xaf'),_0x4a5a5b);break;default:_0x4a5a5b[_0x0c6f('0x9c')]=!![];_0x4a5a5b[_0x0c6f('0x94')]=moment()[_0x0c6f('0x58')](_0x0c6f('0xa0'));_0x4a5a5b[_0x0c6f('0x89')]=moment()[_0x0c6f('0x58')]('YYYY-MM-DD\x20HH:mm:ss');}_0x4a5a5b[_0x0c6f('0x1f')]=![];_0x4a5a5b['queuecallerabandonAt']=null;_0x4a5a5b[_0x0c6f('0x56')]=_0x2bc4a1[_0x0c6f('0xb0')];this[_0x0c6f('0x11')][_0x2bc4a1[_0x0c6f('0x51')]]=_0x4a5a5b;this[_0x0c6f('0x4a')](_0x4a5a5b,_0x0c6f('0x26'));}else if(this['isNotNull'](_0x2bc4a1[_0x0c6f('0xaa')])&&this[_0x0c6f('0x60')](_0x2bc4a1[_0x0c6f('0xaa')][_0x0c6f('0xb1')])){if(!_0x4a5a5b['queuecallerabandon']){_0x4a5a5b['queuecallerexit']=!![];_0x4a5a5b[_0x0c6f('0x94')]=moment()['format'](_0x0c6f('0xa0'));_0x4a5a5b['queuecallerexitreason']='EXITWITHKEY';_0x4a5a5b[_0x0c6f('0x89')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x0c6f('0x11')][_0x2bc4a1[_0x0c6f('0x51')]]=_0x4a5a5b;}}logger[_0x0c6f('0x7d')]('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x2bc4a1[_0x0c6f('0x51')],_0x4a5a5b[_0x0c6f('0x53')],_0x4a5a5b[_0x0c6f('0x5b')],_[_0x0c6f('0x7f')](_0x2bc4a1[_0x0c6f('0xaa')])[0x0],_0x2bc4a1[_0x0c6f('0xb0')]);_0x4a5a5b[_0x0c6f('0x16')]=this[_0x0c6f('0x16')][_0x2bc4a1[_0x0c6f('0x51')]];}}}}catch(_0x31e6f6){logger[_0x0c6f('0x42')](_0x0c6f('0xb2'),_0x2bc4a1[_0x0c6f('0x51')],util[_0x0c6f('0x44')](_0x31e6f6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x0c6f('0x3d')][_0x0c6f('0xa9')]=function(_0x17b299,_0x98d954,_0x1960f0){var _0x2003f8=[_0x0c6f('0xb3'),_0x0c6f('0xb4'),_0x0c6f('0xb5'),_0x0c6f('0xb6'),'rtpaudioqosloss',_0x0c6f('0xb7'),_0x0c6f('0xb8'),'rtpaudioqosrttbridged',_0x0c6f('0xb9'),'sipuri',_0x0c6f('0xba'),_0x0c6f('0xbb'),_0x0c6f('0xbc'),_0x0c6f('0xbd'),'memberinterface',_0x0c6f('0xbe'),_0x0c6f('0x93'),_0x0c6f('0xbf'),_0x0c6f('0xc0')];if(!_[_0x0c6f('0x3f')](_0x98d954)&&!_[_0x0c6f('0xc1')](_0x2003f8,_0x98d954)){if(_[_0x0c6f('0x61')](this[_0x0c6f('0x16')][_0x17b299])){this[_0x0c6f('0x16')][_0x17b299]={};}this[_0x0c6f('0x16')][_0x17b299][_0x98d954]=_0x1960f0;}};VoiceQueueReport[_0x0c6f('0x3d')][_0x0c6f('0xc2')]=function(_0x32a35c,_0x22d45c,_0x1fa3ca){try{var _0x50da8a={};if(this[_0x0c6f('0x45')][_0x32a35c]){for(var _0x3ada27=0x0;_0x3ada270x0?!![]:![];if(!_0x3c9934){return this[_0xa907('0x6c')](this['summary'][_0xa907('0x6d')]);}};VoiceQueueReport[_0xa907('0x36')][_0xa907('0x6e')]=function(_0x13884f){var _0x48aa2c=this[_0xa907('0x12')]['id'];if(this[_0xa907('0x12')][_0xa907('0x5f')][_0x48aa2c]&&this[_0xa907('0x12')]['queuestatus'][_0x48aa2c][_0x13884f[_0xa907('0x5e')]]){this[_0xa907('0x12')][_0xa907('0x5f')][_0x48aa2c][_0x13884f['actionid']][_0xa907('0xe')][_0xa907('0x6f')](_0x13884f);}};VoiceQueueReport['prototype'][_0xa907('0x14')]=function(_0x36670e){var _0x1ae6cf=this;try{if(this['isNotNull'](_0x36670e)&&this['isNotNull'](_0x36670e[_0xa907('0x53')])){logger[_0xa907('0x4c')]('[voiceQueueReport][queuesummary]\x20event:',util[_0xa907('0x44')](_0x36670e,{'showHidden':![],'depth':null}));var _0x4a0fe8=this[_0xa907('0x10')][_0x36670e[_0xa907('0x53')]];if(_0x4a0fe8){logger[_0xa907('0x4c')]('[voiceQueueReport][queuesummary]\x20name:%s',_0x4a0fe8[_0xa907('0x59')]);this[_0xa907('0x12')][_0xa907('0x61')][_0x4a0fe8[_0xa907('0x59')]]={'summaryEvent':_0x36670e};this['summary']['statusRequests']+=0x1;return ami[_0xa907('0x3c')]({'action':_0xa907('0x5f'),'queue':_0x4a0fe8[_0xa907('0x59')]})[_0xa907('0x5d')](function(_0x4b109d){if(!_0x1ae6cf[_0xa907('0x12')][_0xa907('0x5f')][_0x36670e['actionid']]){_0x1ae6cf[_0xa907('0x12')][_0xa907('0x5f')][_0x36670e[_0xa907('0x5e')]]={};}_0x1ae6cf['summary']['queuestatus'][_0x36670e[_0xa907('0x5e')]][_0x4b109d['actionid']]={'queue':_0x4a0fe8[_0xa907('0x59')],'agents':[]};})[_0xa907('0x3f')](function(_0x2e16b5){throw _0x2e16b5;});}}}catch(_0x487e49){logger[_0xa907('0x42')]('[voiceQueueReport][queuesummary]',util[_0xa907('0x44')](_0x487e49,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa907('0x36')][_0xa907('0x6c')]=function(_0x12b7e3){if(this['summary'][_0xa907('0x6b')]>0x0){this[_0xa907('0x12')][_0xa907('0x6d')]=_0x12b7e3;return;}logger[_0xa907('0x4c')](_0xa907('0x70'),util[_0xa907('0x44')](_0x12b7e3,{'showHidden':![],'depth':null}));this[_0xa907('0x12')]=initializeSummary();ami[_0xa907('0x4a')](_0xa907('0x71'),{});};VoiceQueueReport[_0xa907('0x36')][_0xa907('0x1a')]=function(_0x3dcc0f){try{if(this['isNotNull'](_0x3dcc0f)){logger['debug'](_0xa907('0x72'),_0x3dcc0f['uniqueid'],util[_0xa907('0x44')](_0x3dcc0f,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0xa907('0xd')][_0x3dcc0f['uniqueid']])){this[_0xa907('0xd')][_0x3dcc0f[_0xa907('0x4f')]]=[];}if(_[_0xa907('0x73')](this[_0xa907('0x38')][_0x3dcc0f[_0xa907('0x4f')]])){this[_0xa907('0x38')][_0x3dcc0f[_0xa907('0x4f')]]={};}var _0x3a2928=new QueueReport();_0x3a2928[_0xa907('0x53')]=_0x3dcc0f[_0xa907('0x53')];_0x3a2928[_0xa907('0x56')]=this['voiceQueues'][_0x3a2928['queue']]&&this[_0xa907('0x10')][_0x3a2928[_0xa907('0x53')]]['type']?this[_0xa907('0x10')][_0x3a2928[_0xa907('0x53')]]['type']||_0xa907('0x57'):_0xa907('0x57');_0x3a2928[_0xa907('0x74')]=moment()[_0xa907('0x50')](_0xa907('0x75'));_0x3a2928['position']=_0x3dcc0f['position'];_0x3a2928[_0xa907('0x76')]=_0x3dcc0f[_0xa907('0x76')];_0x3a2928['uniqueid']=_0x3dcc0f['uniqueid'];_0x3a2928[_0xa907('0x77')]=this[_0xa907('0x38')][_0x3dcc0f['uniqueid']][_0xa907('0x77')];logger[_0xa907('0x78')](_0xa907('0x79'),_0x3a2928['queue'],_0x3a2928['type']);Object[_0xa907('0x68')](_0x3a2928,_[_0xa907('0x7a')](_0x3dcc0f,_['keys'](_0x3a2928)));this[_0xa907('0xd')][_0x3dcc0f[_0xa907('0x4f')]]['push'](_0x3a2928);this[_0xa907('0x38')][_0x3dcc0f[_0xa907('0x4f')]]=_0x3a2928;this[_0xa907('0x4b')](_0x3a2928,'queuecallerjoin');}}catch(_0x1e1225){logger[_0xa907('0x42')](_0xa907('0x72'),_0x3dcc0f[_0xa907('0x4f')],util[_0xa907('0x44')](_0x1e1225,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueCallerAbandon']=function(_0x3434ab){try{if(this['isNotNull'](_0x3434ab)){logger[_0xa907('0x4c')](_0xa907('0x7b'),_0x3434ab['uniqueid'],util['inspect'](_0x3434ab,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x3434ab[_0xa907('0x4f')]]){var _0x5bbfda=_[_0xa907('0x7c')](this[_0xa907('0xd')][_0x3434ab[_0xa907('0x4f')]]);_0x5bbfda[_0xa907('0x35')]=![];_0x5bbfda[_0xa907('0x7d')]=null;_0x5bbfda[_0xa907('0x7e')]=_0x3434ab[_0xa907('0x7e')];_0x5bbfda[_0xa907('0x7f')]=_0x3434ab[_0xa907('0x7f')];_0x5bbfda[_0xa907('0x1b')]=!![];_0x5bbfda[_0xa907('0x80')]=moment()[_0xa907('0x50')](_0xa907('0x75'));_0x5bbfda[_0xa907('0x81')]=_0xa907('0x82');_0x5bbfda[_0xa907('0x83')]=null;logger['info'](_0xa907('0x84'),_0x5bbfda[_0xa907('0x53')],_0x5bbfda[_0xa907('0x56')]);this[_0xa907('0x38')][_0x3434ab['uniqueid']]=_0x5bbfda;this[_0xa907('0x49')](_0x5bbfda,_0xa907('0x1b'));}}}catch(_0x43a6d9){logger[_0xa907('0x42')]('[%s][voiceQueueReport][queuecallerabandon]',_0x3434ab[_0xa907('0x4f')],util[_0xa907('0x44')](_0x43a6d9,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa907('0x36')][_0xa907('0x1e')]=function(_0x5d84a6){try{if(this['isNotNull'](_0x5d84a6)){logger[_0xa907('0x4c')](_0xa907('0x85'),_0x5d84a6[_0xa907('0x4f')],util[_0xa907('0x44')](_0x5d84a6,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x5d84a6['uniqueid']]){var _0x340afd=_[_0xa907('0x7c')](this[_0xa907('0xd')][_0x5d84a6[_0xa907('0x4f')]]);_0x340afd[_0xa907('0x86')]=moment()[_0xa907('0x50')](_0xa907('0x75'));_0x340afd[_0xa907('0x87')]=_0x5d84a6[_0xa907('0x87')];_0x340afd[_0xa907('0x88')]=_0x5d84a6[_0xa907('0x88')];logger[_0xa907('0x78')](_0xa907('0x89'),_0x340afd[_0xa907('0x53')],_0x340afd[_0xa907('0x56')],_0x5d84a6[_0xa907('0x87')],_0x5d84a6['connectedlinename']);this[_0xa907('0x38')][_0x5d84a6[_0xa907('0x4f')]]=_0x340afd;this[_0xa907('0x4b')](_0x340afd,'queuecallerleave');}}}catch(_0x476c0e){logger[_0xa907('0x42')](_0xa907('0x85'),_0x5d84a6['uniqueid'],util[_0xa907('0x44')](_0x476c0e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa907('0x36')][_0xa907('0x8a')]=function(_0x4e9a01){try{if(this[_0xa907('0x8b')](_0x4e9a01)){logger[_0xa907('0x4c')](_0xa907('0x8c'),_0x4e9a01[_0xa907('0x4f')],util['inspect'](_0x4e9a01,{'showHidden':![],'depth':null}));if(this[_0xa907('0xd')][_0x4e9a01['uniqueid']]){var _0x30d099=_[_0xa907('0x7c')](this['queueReports'][_0x4e9a01[_0xa907('0x4f')]]);_0x30d099[_0xa907('0x35')]=!![];_0x30d099['queuecallerexitreason']=_0xa907('0x8d');logger['info'](_0xa907('0x8e'),_0x30d099['queue'],_0x30d099[_0xa907('0x56')]);}}}catch(_0x184da7){logger[_0xa907('0x42')](_0xa907('0x8c'),_0x4e9a01['uniqueid'],util[_0xa907('0x44')](_0x184da7,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa907('0x36')][_0xa907('0x8f')]=function(_0x437656){try{if(this['isNotNull'](_0x437656)){logger[_0xa907('0x4c')]('[%s][voiceQueueReport][agentcomplete]',_0x437656[_0xa907('0x4f')],util[_0xa907('0x44')](_0x437656,{'showHidden':![],'depth':null}));if(this[_0xa907('0xd')][_0x437656[_0xa907('0x4f')]]){var _0x39794e=_[_0xa907('0x7c')](this[_0xa907('0xd')][_0x437656[_0xa907('0x4f')]]);_0x39794e['queuecallerabandon']=![];_0x39794e[_0xa907('0x80')]=null;_0x39794e[_0xa907('0x90')]=!![];_0x39794e['lastAssignedTo']=_0x437656[_0xa907('0x91')];_0x39794e['holdtime']=_0x437656[_0xa907('0x7e')];_0x39794e['queuecallercomplete']=!![];_0x39794e[_0xa907('0x92')]=![];_0x39794e['queuecallerexitAt']=null;if(!_0x39794e[_0xa907('0x93')]){if(_0x437656['reason']==_0xa907('0x93')){_0x39794e[_0xa907('0x81')]=_0xa907('0x94');logger[_0xa907('0x78')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x39794e[_0xa907('0x53')],_0x39794e[_0xa907('0x56')]);}else{if(_[_0xa907('0x95')](_0x437656[_0xa907('0x3e')][_0xa907('0x96')](),_0xa907('0x97'))){if(this[_0xa907('0xd')][_0x437656[_0xa907('0x98')]]){var _0xd75861=_[_0xa907('0x7c')](this[_0xa907('0xd')][_0x437656['linkedid']]);_0xd75861[_0xa907('0x35')]=![];_0xd75861['queuecallerexit']=!![];_0xd75861['queuecallerexitAt']=moment(_0x39794e[_0xa907('0x74')])[_0xa907('0x99')](_0x437656[_0xa907('0x7e')],_0xa907('0x9a'))[_0xa907('0x50')](_0xa907('0x75'));_0xd75861[_0xa907('0x81')]='FORWARDTRANSFER';_0xd75861[_0xa907('0x93')]=!![];_0xd75861[_0xa907('0x9b')]=_0xa907('0x9c');_0xd75861['transferexten']=_0x437656[_0xa907('0x9d')];_0xd75861[_0xa907('0x9e')]=_0x437656[_0xa907('0x4f')];logger[_0xa907('0x78')](_0xa907('0x9f'),_0xd75861[_0xa907('0x53')],_0xd75861[_0xa907('0x56')]);var _0x275d3c=this['queueReports'][_0x437656[_0xa907('0x98')]];this['queueReports'][_0x437656[_0xa907('0x98')]]=this[_0xa907('0xd')][_0x437656['uniqueid']];this[_0xa907('0xd')][_0x437656[_0xa907('0x4f')]]=_0x275d3c;}}else{_0x39794e[_0xa907('0x81')]=_0xa907('0xa0')+_0x437656[_0xa907('0xa1')]['toUpperCase']();logger[_0xa907('0x78')](_0xa907('0xa2'),_0x39794e[_0xa907('0x53')],_0x39794e[_0xa907('0x56')],_0x39794e['queuecallerexitreason']);}}}this[_0xa907('0x38')][_0x437656[_0xa907('0x4f')]]=_0x39794e;}}}catch(_0x33c0bd){logger['error'](_0xa907('0xa3'),_0x437656['uniqueid'],util['inspect'](_0x33c0bd,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa907('0x36')][_0xa907('0xa4')]=function(_0x1a6129){try{if(this['isNotNull'](_0x1a6129)){logger[_0xa907('0x4c')](_0xa907('0xa5'),_0x1a6129[_0xa907('0x4f')],util[_0xa907('0x44')](_0x1a6129,{'showHidden':![],'depth':null}));this['addVariable'](_0x1a6129[_0xa907('0x4f')],_['keys'](_0x1a6129[_0xa907('0xa6')])[0x0],_0x1a6129[_0xa907('0xa7')]);if(this[_0xa907('0xd')][_0x1a6129[_0xa907('0x4f')]]){var _0x2d8c18=_[_0xa907('0x7c')](this[_0xa907('0xd')][_0x1a6129[_0xa907('0x4f')]]);if(_0x2d8c18){if(this[_0xa907('0x8b')](_0x1a6129[_0xa907('0xa6')])&&this[_0xa907('0x8b')](_0x1a6129[_0xa907('0xa6')][_0xa907('0x5f')])){switch(_0x1a6129['value']){case'CONTINUE':_0x2d8c18[_0xa907('0x92')]=![];_0x2d8c18[_0xa907('0xa8')]=null;break;case _0xa907('0xa9'):_0x2d8c18[_0xa907('0xaa')]=_0xa907('0xab');_0x2d8c18[_0xa907('0x92')]=!![];_0x2d8c18[_0xa907('0xa8')]=moment()[_0xa907('0x50')]('YYYY-MM-DD\x20HH:mm:ss');_0x2d8c18[_0xa907('0x86')]=moment()[_0xa907('0x50')]('YYYY-MM-DD\x20HH:mm:ss');logger[_0xa907('0x4c')](_0xa907('0xac'),_0x1a6129[_0xa907('0x4f')],util[_0xa907('0x44')](_0x2d8c18,{'showHidden':![],'depth':null}));ami['emit'](_0xa907('0xad'),_0x2d8c18);break;default:_0x2d8c18[_0xa907('0x92')]=!![];_0x2d8c18['queuecallerexitAt']=moment()[_0xa907('0x50')]('YYYY-MM-DD\x20HH:mm:ss');_0x2d8c18[_0xa907('0x86')]=moment()[_0xa907('0x50')]('YYYY-MM-DD\x20HH:mm:ss');}_0x2d8c18['queuecallerabandon']=![];_0x2d8c18[_0xa907('0x80')]=null;_0x2d8c18['queuecallerexitreason']=_0x1a6129[_0xa907('0xa7')];this[_0xa907('0x38')][_0x1a6129[_0xa907('0x4f')]]=_0x2d8c18;this[_0xa907('0x49')](_0x2d8c18,_0xa907('0x21'));}else if(this['isNotNull'](_0x1a6129[_0xa907('0xa6')])&&this[_0xa907('0x8b')](_0x1a6129[_0xa907('0xa6')]['queueposition'])){if(!_0x2d8c18[_0xa907('0x1b')]){_0x2d8c18[_0xa907('0x92')]=!![];_0x2d8c18['queuecallerexitAt']=moment()[_0xa907('0x50')](_0xa907('0x75'));_0x2d8c18[_0xa907('0x81')]='EXITWITHKEY';_0x2d8c18[_0xa907('0x86')]=moment()['format'](_0xa907('0x75'));this[_0xa907('0x38')][_0x1a6129[_0xa907('0x4f')]]=_0x2d8c18;}}logger[_0xa907('0x78')](_0xa907('0xae'),_0x1a6129[_0xa907('0x4f')],_0x2d8c18[_0xa907('0x53')],_0x2d8c18[_0xa907('0x56')],_[_0xa907('0xaf')](_0x1a6129['variable'])[0x0],_0x1a6129[_0xa907('0xa7')]);_0x2d8c18[_0xa907('0x45')]=this[_0xa907('0x45')][_0x1a6129[_0xa907('0x4f')]];}}}}catch(_0x2989dd){logger[_0xa907('0x42')](_0xa907('0xa5'),_0x1a6129[_0xa907('0x4f')],util[_0xa907('0x44')](_0x2989dd,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa907('0x36')][_0xa907('0xb0')]=function(_0x265284,_0x3efb30,_0x4a2540){var _0x59fc9d=[_0xa907('0xb1'),_0xa907('0xb2'),_0xa907('0xb3'),'rtpaudioqosjitterbridged',_0xa907('0xb4'),_0xa907('0xb5'),_0xa907('0xb6'),_0xa907('0xb7'),_0xa907('0xb8'),'sipuri','bridgepeer',_0xa907('0xb9'),_0xa907('0xba'),'memberdynamic',_0xa907('0xbb'),_0xa907('0xbc'),'membername',_0xa907('0xbd'),_0xa907('0xbe')];if(!_[_0xa907('0xbf')](_0x3efb30)&&!_[_0xa907('0xc0')](_0x59fc9d,_0x3efb30)){if(_['isUndefined'](this['variables'][_0x265284])){this['variables'][_0x265284]={};}this[_0xa907('0x45')][_0x265284][_0x3efb30]=_0x4a2540;}};VoiceQueueReport[_0xa907('0x36')][_0xa907('0xc1')]=function(_0x30a398,_0xc50b49,_0x5ab8e6){try{var _0x2a8722={};if(this[_0xa907('0xd')][_0x30a398]){for(var _0x3a6736=0x0;_0x3a6736=0x0?moment(_0x26c014[_0x0211('0x14')])['diff'](_0x26c014[_0x0211('0x13')],_0x0211('0x15')):null,'data1':_0x0211('0x16'),'data2':_0x26c014[_0x0211('0xf')],'data3':_0x26c014[_0x0211('0x17')],'data4':_0x26c014[_0x0211('0x18')]||null,'role':_0x0211('0xe'),'internal':_0x26c014[_0x0211('0xf')]?_[_0x0211('0x19')](_0x26c014[_0x0211('0xf')]):undefined,'uniqueid':_0x26c014[_0x0211('0x10')]},'log':_0x0211('0x2')});}; \ No newline at end of file +var _0x7d28=['starttime','endtime','outbound','uniqueid','util','../client','voiceQueueReport','queuecallerexitAt','Request','CreateMemberReport','voice','lastAssignedTo','isNil','interface','format','SIP/%s','diff','queuecallerleaveAt','seconds','calleridnum','exten','queue','toNumber','accountcode','voiceDialReport','TALKING'];(function(_0x9041a8,_0x56f039){var _0x44c73d=function(_0x3a491c){while(--_0x3a491c){_0x9041a8['push'](_0x9041a8['shift']());}};_0x44c73d(++_0x56f039);}(_0x7d28,0x1be));var _0x87d2=function(_0x526786,_0x105cbf){_0x526786=_0x526786-0x0;var _0x3a512d=_0x7d28[_0x526786];return _0x3a512d;};'use strict';var moment=require('moment');var _=require('lodash');var util=require(_0x87d2('0x0'));var client=require(_0x87d2('0x1'));exports[_0x87d2('0x2')]=function(_0x37725f){var _0x86771=_0x37725f['queuecallercompleteAt']||_0x37725f[_0x87d2('0x3')];return client[_0x87d2('0x4')](_0x87d2('0x5'),{'body':{'channel':_0x87d2('0x6'),'membername':_0x37725f[_0x87d2('0x7')],'interface':_[_0x87d2('0x8')](_0x37725f[_0x87d2('0x9')])?util[_0x87d2('0xa')](_0x87d2('0xb'),_0x37725f['lastAssignedTo']):_0x37725f[_0x87d2('0x9')],'type':'TALKING','enterAt':_0x37725f['queuecallerleaveAt'],'exitAt':_0x86771,'duration':moment(_0x86771)[_0x87d2('0xc')](_0x37725f[_0x87d2('0xd')],_0x87d2('0xe')),'data1':'inbound','data2':_0x37725f[_0x87d2('0xf')],'data3':_0x37725f[_0x87d2('0x10')],'data4':null,'data5':_0x37725f[_0x87d2('0x11')],'role':'agent','internal':_0x37725f['accountcode']?_[_0x87d2('0x12')](_0x37725f[_0x87d2('0x13')]):undefined,'uniqueid':_0x37725f['uniqueid']},'log':_0x87d2('0x5')});};exports[_0x87d2('0x14')]=function(_0x1e125c){return client[_0x87d2('0x4')](_0x87d2('0x5'),{'body':{'channel':_0x87d2('0x6'),'membername':_0x1e125c['membername'],'interface':_0x1e125c[_0x87d2('0x9')],'type':_0x87d2('0x15'),'enterAt':_0x1e125c[_0x87d2('0x16')],'exitAt':_0x1e125c[_0x87d2('0x17')],'duration':moment(_0x1e125c[_0x87d2('0x17')])[_0x87d2('0xc')](_0x1e125c[_0x87d2('0x16')],'seconds')>=0x0?moment(_0x1e125c[_0x87d2('0x17')])['diff'](_0x1e125c[_0x87d2('0x16')],_0x87d2('0xe')):null,'data1':_0x87d2('0x18'),'data2':_0x1e125c['accountcode'],'data3':_0x1e125c[_0x87d2('0x10')],'data4':_0x1e125c['dialstring']||null,'role':'agent','internal':_0x1e125c[_0x87d2('0x13')]?_[_0x87d2('0x12')](_0x1e125c[_0x87d2('0x13')]):undefined,'uniqueid':_0x1e125c[_0x87d2('0x19')]},'log':'CreateMemberReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 5f858fa..5516114 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 _0x2a5c=['GetSettings','../client','getSettings','Request','ShowSetting','stopRecordingOnTransfer'];(function(_0xe1b12b,_0x241bd1){var _0x1b697a=function(_0x1ce999){while(--_0x1ce999){_0xe1b12b['push'](_0xe1b12b['shift']());}};_0x1b697a(++_0x241bd1);}(_0x2a5c,0x1f3));var _0xc2a5=function(_0x4a5712,_0x3a4650){_0x4a5712=_0x4a5712-0x0;var _0x10eaeb=_0x2a5c[_0x4a5712];return _0x10eaeb;};'use strict';var client=require(_0xc2a5('0x0'));exports[_0xc2a5('0x1')]=function(){return client[_0xc2a5('0x2')](_0xc2a5('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xc2a5('0x4'),'previewRecallmeReminderInterval']},'log':_0xc2a5('0x5')});}; \ No newline at end of file +var _0x3c91=['GetSettings','../client','getSettings','Request','previewRecallmeReminderInterval'];(function(_0x23f74e,_0xa0b5cb){var _0x368123=function(_0xb4acf4){while(--_0xb4acf4){_0x23f74e['push'](_0x23f74e['shift']());}};_0x368123(++_0xa0b5cb);}(_0x3c91,0x1af));var _0x13c9=function(_0x4fb769,_0x343596){_0x4fb769=_0x4fb769-0x0;var _0x46a376=_0x3c91[_0x4fb769];return _0x46a376;};'use strict';var client=require(_0x13c9('0x0'));exports[_0x13c9('0x1')]=function(){return client[_0x13c9('0x2')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer',_0x13c9('0x3')]},'log':_0x13c9('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 5894fbb..ce9102d 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 _0xb22d=['name','html','../client','Request','GetTemplate'];(function(_0x17a524,_0x523821){var _0x2869c9=function(_0x4977f8){while(--_0x4977f8){_0x17a524['push'](_0x17a524['shift']());}};_0x2869c9(++_0x523821);}(_0xb22d,0x75));var _0xdb22=function(_0x18afca,_0x4219d9){_0x18afca=_0x18afca-0x0;var _0x11603f=_0xb22d[_0x18afca];return _0x11603f;};'use strict';var client=require(_0xdb22('0x0'));exports['getTemplates']=function(_0x50cd19){return function(_0x12c73f){return client[_0xdb22('0x1')](_0xdb22('0x2'),{'options':{'raw':!![],'attributes':['id',_0xdb22('0x3'),_0xdb22('0x4')]},'log':_0xdb22('0x2')});};}; \ No newline at end of file +var _0xf9ae=['Request','GetTemplate','name','../client','getTemplates'];(function(_0x166b3d,_0x2cce08){var _0x327075=function(_0xfb763e){while(--_0xfb763e){_0x166b3d['push'](_0x166b3d['shift']());}};_0x327075(++_0x2cce08);}(_0xf9ae,0x85));var _0xef9a=function(_0x5d781a,_0x6551f0){_0x5d781a=_0x5d781a-0x0;var _0x7a3c8d=_0xf9ae[_0x5d781a];return _0x7a3c8d;};'use strict';var client=require(_0xef9a('0x0'));exports[_0xef9a('0x1')]=function(_0x59c80a){return function(_0x29291d){return client[_0xef9a('0x2')](_0xef9a('0x3'),{'options':{'raw':!![],'attributes':['id',_0xef9a('0x4'),'html']},'log':_0xef9a('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index a4916c4..23e5faf 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 _0x3d90=['action','data2','data4','data5','data6','data7','../client','getTriggers','Request','GetTrigger','name','Condition','AllConditions','field','operator','value','AnyConditions','Action'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3d90,0x180));var _0x03d9=function(_0x43b596,_0x59af26){_0x43b596=_0x43b596-0x0;var _0x71232d=_0x3d90[_0x43b596];return _0x71232d;};'use strict';var client=require(_0x03d9('0x0'));exports[_0x03d9('0x1')]=function(_0x18c8ad){return function(_0x38d13e){return client[_0x03d9('0x2')](_0x03d9('0x3'),{'options':{'raw':![],'attributes':['id',_0x03d9('0x4'),'channel','status'],'include':[{'model':_0x03d9('0x5'),'as':_0x03d9('0x6'),'attributes':['id',_0x03d9('0x7'),_0x03d9('0x8'),_0x03d9('0x9')]},{'model':_0x03d9('0x5'),'as':_0x03d9('0xa'),'attributes':['id',_0x03d9('0x7'),'operator',_0x03d9('0x9')]},{'model':_0x03d9('0xb'),'as':'Actions','attributes':['id',_0x03d9('0xc'),'data1',_0x03d9('0xd'),'data3',_0x03d9('0xe'),_0x03d9('0xf'),_0x03d9('0x10'),_0x03d9('0x11')]}]},'log':'GetTrigger'});};}; \ No newline at end of file +var _0x5421=['../client','getTriggers','GetTrigger','name','status','Condition','AllConditions','operator','value','AnyConditions','field','Action','Actions','action','data1','data2','data3','data7'];(function(_0x24fe48,_0x10e97e){var _0x51e7d5=function(_0x5826c1){while(--_0x5826c1){_0x24fe48['push'](_0x24fe48['shift']());}};_0x51e7d5(++_0x10e97e);}(_0x5421,0x18c));var _0x1542=function(_0x238671,_0x34aea0){_0x238671=_0x238671-0x0;var _0x474844=_0x5421[_0x238671];return _0x474844;};'use strict';var client=require(_0x1542('0x0'));exports[_0x1542('0x1')]=function(_0x18ec09){return function(_0x242678){return client['Request'](_0x1542('0x2'),{'options':{'raw':![],'attributes':['id',_0x1542('0x3'),'channel',_0x1542('0x4')],'include':[{'model':_0x1542('0x5'),'as':_0x1542('0x6'),'attributes':['id','field',_0x1542('0x7'),_0x1542('0x8')]},{'model':'Condition','as':_0x1542('0x9'),'attributes':['id',_0x1542('0xa'),_0x1542('0x7'),'value']},{'model':_0x1542('0xb'),'as':_0x1542('0xc'),'attributes':['id',_0x1542('0xd'),_0x1542('0xe'),_0x1542('0xf'),_0x1542('0x10'),'data4','data5','data6',_0x1542('0x11')]}]},'log':_0x1542('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 19433da..94ae88f 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 _0x27c9=['GetTrunk','name','registry','defaultuser','../client','getTrunks','Request'];(function(_0x1b17ae,_0xaaee25){var _0x4e3ced=function(_0x4f40fb){while(--_0x4f40fb){_0x1b17ae['push'](_0x1b17ae['shift']());}};_0x4e3ced(++_0xaaee25);}(_0x27c9,0x1e7));var _0x927c=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x27c9[_0x4cf98e];return _0x1623ac;};'use strict';var client=require(_0x927c('0x0'));exports[_0x927c('0x1')]=function(_0x1dcf98){return function(_0x5ed6b3){return client[_0x927c('0x2')](_0x927c('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x927c('0x4'),_0x927c('0x5'),_0x927c('0x6')]},'log':_0x927c('0x3')});};}; \ No newline at end of file +var _0xe14f=['name','registry','defaultuser','../client','getTrunks','Request','GetTrunk'];(function(_0x40ff89,_0x22ea0c){var _0x462cab=function(_0x1a7edf){while(--_0x1a7edf){_0x40ff89['push'](_0x40ff89['shift']());}};_0x462cab(++_0x22ea0c);}(_0xe14f,0xea));var _0xfe14=function(_0x55274d,_0x545216){_0x55274d=_0x55274d-0x0;var _0x1bbe72=_0xe14f[_0x55274d];return _0x1bbe72;};'use strict';var client=require(_0xfe14('0x0'));exports[_0xfe14('0x1')]=function(_0x33ee9b){return function(_0x2d348b){return client[_0xfe14('0x2')](_0xfe14('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xfe14('0x4'),_0xfe14('0x5'),_0xfe14('0x6')]},'log':'GetTrunk'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 92b278f..986c421 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(_0x24ab7b,_0x3b7371){var _0x385f5a=function(_0x38d1df){while(--_0x38d1df){_0x24ab7b['push'](_0x24ab7b['shift']());}};_0x385f5a(++_0x3b7371);}(_0x9c44,0x178));var _0x49c4=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x9c44[_0x273c39];return _0x46d6b5;};'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 _0xe706=['internal','savePause','PauseUser','saveUnpause','UnpauseUser','ShowUser','getAgent','../client','getAgents','Request','agent','name','email','accountcode','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','GetUser','telephone'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xe706,0xa3));var _0x6e70=function(_0x4738d7,_0x46a6e0){_0x4738d7=_0x4738d7-0x0;var _0x27ab9b=_0xe706[_0x4738d7];return _0x27ab9b;};'use strict';var client=require(_0x6e70('0x0'));exports[_0x6e70('0x1')]=function(){return function(){return client[_0x6e70('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':_0x6e70('0x3')},'attributes':['id',_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6'),_0x6e70('0x7'),_0x6e70('0x8'),_0x6e70('0x9'),_0x6e70('0xa'),_0x6e70('0xb'),_0x6e70('0xc'),_0x6e70('0xd'),_0x6e70('0xe'),_0x6e70('0xf')]},'log':_0x6e70('0x1')});};};exports[_0x6e70('0x10')]=function(){return function(){return client[_0x6e70('0x2')](_0x6e70('0x11'),{'options':{'raw':!![],'where':{'role':_0x6e70('0x12')},'attributes':['id',_0x6e70('0x4'),_0x6e70('0x6'),_0x6e70('0x13')]},'log':_0x6e70('0x10')});};};exports[_0x6e70('0x14')]=function(_0x4600f9,_0x5b3d07,_0x47f6b2){return client[_0x6e70('0x2')](_0x6e70('0x15'),{'body':{'type':_0x5b3d07,'uniqueid':_0x47f6b2},'options':{'where':{'id':_0x4600f9['id']}},'log':_0x6e70('0x14')});};exports[_0x6e70('0x16')]=function(_0x3b38f3){return client[_0x6e70('0x2')](_0x6e70('0x17'),{'body':{},'options':{'where':{'id':_0x3b38f3['id']}},'log':_0x6e70('0x14')});};exports['getAgent']=function(_0x52737e){return client['Request'](_0x6e70('0x18'),{'options':{'raw':![],'where':{'role':'agent','id':_0x52737e},'attributes':['id','name',_0x6e70('0x5'),_0x6e70('0x6'),'fullname',_0x6e70('0x8'),'lastLoginAt',_0x6e70('0xa'),_0x6e70('0xb'),'voicePause','interface']},'log':_0x6e70('0x19')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index db6d53f..4240442 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 _0x3aaa=['create','Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport','../client'];(function(_0xb4603b,_0x17bae3){var _0x599e97=function(_0x54bef5){while(--_0x54bef5){_0xb4603b['push'](_0xb4603b['shift']());}};_0x599e97(++_0x17bae3);}(_0x3aaa,0x17f));var _0xa3aa=function(_0xf5484a,_0x542b83){_0xf5484a=_0xf5484a-0x0;var _0x2b7591=_0x3aaa[_0xf5484a];return _0x2b7591;};'use strict';var client=require(_0xa3aa('0x0'));exports[_0xa3aa('0x1')]=function(_0xb51040){return client[_0xa3aa('0x2')](_0xa3aa('0x3'),{'body':_0xb51040,'log':'CreateVoiceAgentReport'});};exports[_0xa3aa('0x4')]=function(_0x4cf466,_0x57c950,_0x2eaaae){return client[_0xa3aa('0x2')]('UpdateVoiceAgentReport',{'body':_0x4cf466,'options':{'where':{'uniqueid':_0x57c950,'interface':_0x2eaaae,'agentcomplete':!![]}},'log':_0xa3aa('0x5')});}; \ No newline at end of file +var _0x5c0c=['update','UpdateVoiceAgentReport','../client','create','Request','CreateVoiceAgentReport'];(function(_0x3a7bdf,_0x58bdd8){var _0x35a9a8=function(_0x21da98){while(--_0x21da98){_0x3a7bdf['push'](_0x3a7bdf['shift']());}};_0x35a9a8(++_0x58bdd8);}(_0x5c0c,0x1a6));var _0xc5c0=function(_0x3c5155,_0xa8338f){_0x3c5155=_0x3c5155-0x0;var _0x287fe3=_0x5c0c[_0x3c5155];return _0x287fe3;};'use strict';var client=require(_0xc5c0('0x0'));exports[_0xc5c0('0x1')]=function(_0x31cdd9){return client[_0xc5c0('0x2')](_0xc5c0('0x3'),{'body':_0x31cdd9,'log':_0xc5c0('0x3')});};exports[_0xc5c0('0x4')]=function(_0x4372fc,_0x359d3a,_0xbe3e81){return client[_0xc5c0('0x2')](_0xc5c0('0x5'),{'body':_0x4372fc,'options':{'where':{'uniqueid':_0x359d3a,'interface':_0xbe3e81,'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 c405b0a..1a543c3 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 _0xc9b4=['disposition','duration','billableseconds','moment','../client','Request','CreateVoiceCallReport','context','callerid','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','format','day','YYYY-MM-DD\x20HH:mm:ss','type'];(function(_0x5cc7d3,_0x5c6457){var _0x5c9138=function(_0x986b6c){while(--_0x986b6c){_0x5cc7d3['push'](_0x5cc7d3['shift']());}};_0x5c9138(++_0x5c6457);}(_0xc9b4,0x19b));var _0x4c9b=function(_0x490be3,_0xf0fca3){_0x490be3=_0x490be3-0x0;var _0x3f5140=_0xc9b4[_0x490be3];return _0x3f5140;};'use strict';var moment=require(_0x4c9b('0x0'));var util=require('util');var _=require('lodash');var client=require(_0x4c9b('0x1'));exports['create']=function(_0x3404cf){return client[_0x4c9b('0x2')](_0x4c9b('0x3'),{'body':_['merge'](_0x3404cf,{'source':_0x3404cf['calleridnum'],'destinationcontext':_0x3404cf[_0x4c9b('0x4')],'callerid':_0x3404cf[_0x4c9b('0x5')],'amaflags':'DOCUMENTATION'}),'log':'CreateVoiceCallReport'});};exports[_0x4c9b('0x6')]=function(){return function(){return client[_0x4c9b('0x2')](_0x4c9b('0x7'),{'options':{'where':{'type':[_0x4c9b('0x8')],'createdAt':{'$between':[moment()[_0x4c9b('0x9')]('day')[_0x4c9b('0xa')]('YYYY-MM-DD\x20HH:mm:ss'),moment()['endOf'](_0x4c9b('0xb'))[_0x4c9b('0xa')](_0x4c9b('0xc'))]}},'attributes':[_0x4c9b('0xd'),_0x4c9b('0xe'),_0x4c9b('0xf'),_0x4c9b('0x10')]},'log':'GetVoiceCallReports'});};}; \ No newline at end of file +var _0x6ada=['getVoiceCallReports','GetVoiceCallReport','outbound','startOf','format','endOf','YYYY-MM-DD\x20HH:mm:ss','type','disposition','duration','billableseconds','GetVoiceCallReports','util','lodash','create','Request','CreateVoiceCallReport','calleridnum','context'];(function(_0x57aad5,_0x22dbe2){var _0x2a6229=function(_0x1c038f){while(--_0x1c038f){_0x57aad5['push'](_0x57aad5['shift']());}};_0x2a6229(++_0x22dbe2);}(_0x6ada,0x14f));var _0xa6ad=function(_0xa6a43a,_0x2315ad){_0xa6a43a=_0xa6a43a-0x0;var _0x17fa20=_0x6ada[_0xa6a43a];return _0x17fa20;};'use strict';var moment=require('moment');var util=require(_0xa6ad('0x0'));var _=require(_0xa6ad('0x1'));var client=require('../client');exports[_0xa6ad('0x2')]=function(_0x399ea6){return client[_0xa6ad('0x3')](_0xa6ad('0x4'),{'body':_['merge'](_0x399ea6,{'source':_0x399ea6[_0xa6ad('0x5')],'destinationcontext':_0x399ea6[_0xa6ad('0x6')],'callerid':_0x399ea6['callerid'],'amaflags':'DOCUMENTATION'}),'log':_0xa6ad('0x4')});};exports[_0xa6ad('0x7')]=function(){return function(){return client[_0xa6ad('0x3')](_0xa6ad('0x8'),{'options':{'where':{'type':[_0xa6ad('0x9')],'createdAt':{'$between':[moment()[_0xa6ad('0xa')]('day')[_0xa6ad('0xb')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0xa6ad('0xc')]('day')[_0xa6ad('0xb')](_0xa6ad('0xd'))]}},'attributes':[_0xa6ad('0xe'),_0xa6ad('0xf'),_0xa6ad('0x10'),_0xa6ad('0x11')]},'log':_0xa6ad('0x12')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index fcac246..8b9ddb6 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 _0xa320=['CreateVoiceDialReport','Request'];(function(_0x5e1c9d,_0x584487){var _0x2ba084=function(_0x2c0df3){while(--_0x2c0df3){_0x5e1c9d['push'](_0x5e1c9d['shift']());}};_0x2ba084(++_0x584487);}(_0xa320,0x1c3));var _0x0a32=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0xa320[_0xa148b7];return _0x51efd3;};'use strict';var client=require('../client');exports['create']=function(_0x492afe){return client[_0x0a32('0x0')](_0x0a32('0x1'),{'body':_0x492afe,'log':_0x0a32('0x1')});}; \ No newline at end of file +var _0x4157=['CreateVoiceDialReport','../client'];(function(_0x4fef8c,_0x43b28f){var _0x438750=function(_0x489493){while(--_0x489493){_0x4fef8c['push'](_0x4fef8c['shift']());}};_0x438750(++_0x43b28f);}(_0x4157,0x115));var _0x7415=function(_0x46960,_0x31ef0c){_0x46960=_0x46960-0x0;var _0x500df9=_0x4157[_0x46960];return _0x500df9;};'use strict';var client=require(_0x7415('0x0'));exports['create']=function(_0x3e23e4){return client['Request'](_0x7415('0x1'),{'body':_0x3e23e4,'log':'CreateVoiceDialReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index c9d8ccd..0f77ba9 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 _0xffda=['../client','getVoiceExtensions','Request','GetVoiceExtension','recordingFormat'];(function(_0x102f2e,_0x206d67){var _0x1df925=function(_0x4650a6){while(--_0x4650a6){_0x102f2e['push'](_0x102f2e['shift']());}};_0x1df925(++_0x206d67);}(_0xffda,0x73));var _0xaffd=function(_0x433ee9,_0x707f01){_0x433ee9=_0x433ee9-0x0;var _0x43abd3=_0xffda[_0x433ee9];return _0x43abd3;};'use strict';var client=require(_0xaffd('0x0'));exports[_0xaffd('0x1')]=function(){return function(){return client[_0xaffd('0x2')](_0xaffd('0x3'),{'options':{'raw':!![],'attributes':['id','exten',_0xaffd('0x4')],'where':{'VoiceExtensionId':null}},'log':_0xaffd('0x1')});};}; \ No newline at end of file +var _0x3f19=['../client','exten','getVoiceExtensions'];(function(_0x49a57c,_0x2eb02c){var _0x4e0316=function(_0x37e2e5){while(--_0x37e2e5){_0x49a57c['push'](_0x49a57c['shift']());}};_0x4e0316(++_0x2eb02c);}(_0x3f19,0xc0));var _0x93f1=function(_0x3a0863,_0x4cd5ef){_0x3a0863=_0x3a0863-0x0;var _0x85c557=_0x3f19[_0x3a0863];return _0x85c557;};'use strict';var client=require(_0x93f1('0x0'));exports['getVoiceExtensions']=function(){return function(){return client['Request']('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0x93f1('0x1'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0x93f1('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 07b1497..5e6b973 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 _0x28a1=['dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','active','Pause','TrunkBackup','callerid','Interval','interval','../client','getVoiceQueues','GetVoiceQueue','name','acw','acwTimeout','autopause','monitor_format','type','dialActive','dialMethod','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','strategy','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialPredictiveIntervalMaxThreshold'];(function(_0x2b0a08,_0x322d00){var _0x412dcf=function(_0x3c9969){while(--_0x3c9969){_0x2b0a08['push'](_0x2b0a08['shift']());}};_0x412dcf(++_0x322d00);}(_0x28a1,0x145));var _0x128a=function(_0x187279,_0x26d152){_0x187279=_0x187279-0x0;var _0x3da59d=_0x28a1[_0x187279];return _0x3da59d;};'use strict';var client=require(_0x128a('0x0'));exports[_0x128a('0x1')]=function(){return function(){return client['Request'](_0x128a('0x2'),{'options':{'raw':![],'attributes':['id',_0x128a('0x3'),_0x128a('0x4'),_0x128a('0x5'),_0x128a('0x6'),_0x128a('0x7'),_0x128a('0x8'),_0x128a('0x9'),_0x128a('0xa'),'dialLimitChannel',_0x128a('0xb'),_0x128a('0xc'),_0x128a('0xd'),_0x128a('0xe'),_0x128a('0xf'),_0x128a('0x10'),_0x128a('0x11'),'dialOriginateTimeout',_0x128a('0x12'),_0x128a('0x13'),_0x128a('0x14'),'dialCongestionMaxRetry','dialCongestionRetryFrequency',_0x128a('0x15'),_0x128a('0x16'),_0x128a('0x17'),_0x128a('0x18'),_0x128a('0x19'),_0x128a('0x1a'),_0x128a('0x1b'),_0x128a('0x1c'),'dialCheckDuplicateType','dialAMDActive',_0x128a('0x1d'),_0x128a('0x1e'),_0x128a('0x1f'),_0x128a('0x20'),_0x128a('0x21'),_0x128a('0x22'),_0x128a('0x23'),_0x128a('0x24'),_0x128a('0x25'),_0x128a('0x26'),_0x128a('0x27'),_0x128a('0x28'),_0x128a('0x29'),_0x128a('0x2a'),_0x128a('0x2b'),'dialQueueProject2',_0x128a('0x7'),_0x128a('0x2c'),'dialRandomLastDigitCallerIdNumber','dialCutDigit',_0x128a('0x2d'),'dialNoSuchNumberRetryFrequency',_0x128a('0x2e'),_0x128a('0x2f'),_0x128a('0x30'),'dialAbandonedRetryFrequency',_0x128a('0x31'),'dialMachineRetryFrequency',_0x128a('0x32'),_0x128a('0x33'),'mandatoryDisposition',_0x128a('0x34'),_0x128a('0x35'),_0x128a('0x36'),_0x128a('0x37')],'include':[{'model':_0x128a('0x38'),'as':_0x128a('0x38'),'attributes':['id',_0x128a('0x3'),'callerid',_0x128a('0x39')]},{'model':_0x128a('0x3a'),'as':'mandatoryDispositionPause','attributes':['id',_0x128a('0x3')]},{'model':_0x128a('0x38'),'as':_0x128a('0x3b'),'attributes':['id','name',_0x128a('0x3c'),_0x128a('0x39')]},{'model':_0x128a('0x3d'),'as':_0x128a('0x3d'),'attributes':['id',_0x128a('0x3')],'include':[{'model':_0x128a('0x3d'),'as':'Intervals','attributes':['id',_0x128a('0x3'),_0x128a('0x3e')]}]}]},'log':_0x128a('0x1')});};}; \ No newline at end of file +var _0xe144=['name','acwTimeout','autopause','type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','monitor_format','strategy','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialPredictiveIntervalMaxThreshold','dialPreviewAutoRecallMe','Trunk','callerid','Pause','TrunkBackup','active','Interval','Intervals','interval','../client','getVoiceQueues','GetVoiceQueue'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xe144,0x15f));var _0x4e14=function(_0x3b0c9d,_0x3ddeb5){_0x3b0c9d=_0x3b0c9d-0x0;var _0xcfc8d7=_0xe144[_0x3b0c9d];return _0xcfc8d7;};'use strict';var client=require(_0x4e14('0x0'));exports[_0x4e14('0x1')]=function(){return function(){return client['Request'](_0x4e14('0x2'),{'options':{'raw':![],'attributes':['id',_0x4e14('0x3'),'acw',_0x4e14('0x4'),_0x4e14('0x5'),'monitor_format',_0x4e14('0x6'),_0x4e14('0x7'),_0x4e14('0x8'),_0x4e14('0x9'),_0x4e14('0xa'),_0x4e14('0xb'),'dialPredictiveOptimization',_0x4e14('0xc'),_0x4e14('0xd'),_0x4e14('0xe'),_0x4e14('0xf'),'dialOriginateTimeout',_0x4e14('0x10'),_0x4e14('0x11'),_0x4e14('0x12'),_0x4e14('0x13'),_0x4e14('0x14'),_0x4e14('0x15'),_0x4e14('0x16'),_0x4e14('0x17'),_0x4e14('0x18'),'dialGlobalMaxRetry','dialTimezone',_0x4e14('0x19'),_0x4e14('0x1a'),_0x4e14('0x1b'),'dialAMDActive',_0x4e14('0x1c'),_0x4e14('0x1d'),_0x4e14('0x1e'),_0x4e14('0x1f'),_0x4e14('0x20'),_0x4e14('0x21'),_0x4e14('0x22'),_0x4e14('0x23'),'dialAMDMaximumWordLength',_0x4e14('0x24'),_0x4e14('0x25'),_0x4e14('0x26'),_0x4e14('0x27'),_0x4e14('0x28'),_0x4e14('0x29'),_0x4e14('0x2a'),_0x4e14('0x2b'),_0x4e14('0x2c'),'dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry',_0x4e14('0x2d'),'dialDropMaxRetry',_0x4e14('0x2e'),'dialAbandonedMaxRetry',_0x4e14('0x2f'),'dialMachineMaxRetry',_0x4e14('0x30'),'dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition',_0x4e14('0x31'),'dialPredictiveIntervalMinThreshold',_0x4e14('0x32'),'dialPreviewRecallmeReminder'],'include':[{'model':'Trunk','as':_0x4e14('0x33'),'attributes':['id',_0x4e14('0x3'),_0x4e14('0x34'),'active']},{'model':_0x4e14('0x35'),'as':'mandatoryDispositionPause','attributes':['id',_0x4e14('0x3')]},{'model':_0x4e14('0x33'),'as':_0x4e14('0x36'),'attributes':['id',_0x4e14('0x3'),_0x4e14('0x34'),_0x4e14('0x37')]},{'model':_0x4e14('0x38'),'as':_0x4e14('0x38'),'attributes':['id',_0x4e14('0x3')],'include':[{'model':'Interval','as':_0x4e14('0x39'),'attributes':['id','name',_0x4e14('0x3a')]}]}]},'log':_0x4e14('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 2390a3f..54258d3 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(_0x4ed09d,_0x85727d){var _0x563c9d=function(_0xd076af){while(--_0xd076af){_0x4ed09d['push'](_0x4ed09d['shift']());}};_0x563c9d(++_0x85727d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'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(_0x1c35d7,_0x4fe330){var _0x206756=function(_0x3c6f0a){while(--_0x3c6f0a){_0x1c35d7['push'](_0x1c35d7['shift']());}};_0x206756(++_0x4fe330);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'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 d336ae6..45cc054 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 _0x64bc=['getVoiceQueueRtPauses','../client','Request'];(function(_0x44d607,_0x582c4c){var _0x1e90a7=function(_0x26afda){while(--_0x26afda){_0x44d607['push'](_0x44d607['shift']());}};_0x1e90a7(++_0x582c4c);}(_0x64bc,0x19c));var _0xc64b=function(_0x237ee8,_0x530fdc){_0x237ee8=_0x237ee8-0x0;var _0x4f93b7=_0x64bc[_0x237ee8];return _0x4f93b7;};'use strict';var client=require(_0xc64b('0x0'));exports['getVoiceQueueRtPauses']=function(_0x12641a){return function(){return client[_0xc64b('0x1')]('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x12641a,'paused':!![]},'raw':!![]},'log':_0xc64b('0x2')});};}; \ No newline at end of file +var _0xc502=['GetVoiceQueueRtPauses','getVoiceQueueRtPauses','../client','Request'];(function(_0x1f8961,_0x23189a){var _0x5a9abb=function(_0x2e1982){while(--_0x2e1982){_0x1f8961['push'](_0x1f8961['shift']());}};_0x5a9abb(++_0x23189a);}(_0xc502,0xba));var _0x2c50=function(_0x37dd78,_0x6e31b7){_0x37dd78=_0x37dd78-0x0;var _0x39cd1b=_0xc502[_0x37dd78];return _0x39cd1b;};'use strict';var client=require(_0x2c50('0x0'));exports['getVoiceQueueRtPauses']=function(_0x2edbfd){return function(){return client[_0x2c50('0x1')](_0x2c50('0x2'),{'options':{'where':{'VoiceQueueId':_0x2edbfd,'paused':!![]},'raw':!![]},'log':_0x2c50('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 3b15ac2..1fcd18a 100644 --- a/server/services/ami/rpc/voiceRecording.js +++ b/server/services/ami/rpc/voiceRecording.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x9b09ab,_0x1d1961){var _0x28670d=function(_0x343374){while(--_0x343374){_0x9b09ab['push'](_0x9b09ab['shift']());}};_0x28670d(++_0x1d1961);}(_0x7a54,0x106));var _0x47a5=function(_0x16d6fa,_0x1fd45f){_0x16d6fa=_0x16d6fa-0x0;var _0x4973d4=_0x7a54[_0x16d6fa];return _0x4973d4;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file +var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x2de598,_0x482e79){var _0x1430bc=function(_0xf2728d){while(--_0xf2728d){_0x2de598['push'](_0x2de598['shift']());}};_0x1430bc(++_0x482e79);}(_0x7a54,0x106));var _0x47a5=function(_0x3c6916,_0x2fd99d){_0x3c6916=_0x3c6916-0x0;var _0x555443=_0x7a54[_0x3c6916];return _0x555443;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index a60fb61..838aa8f 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 _0xb39a=['transfereraccountcode','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridname','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','context','extension','attendedTransfer','result','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client','blindTransfer','Request','CreateVoiceTransferReport','transfererchannel','transferercalleridnum','transferercalleridname'];(function(_0x2313f3,_0x2549de){var _0x4bb913=function(_0x1b5dd1){while(--_0x1b5dd1){_0x2313f3['push'](_0x2313f3['shift']());}};_0x4bb913(++_0x2549de);}(_0xb39a,0x19d));var _0xab39=function(_0x15dc4a,_0x37ac48){_0x15dc4a=_0x15dc4a-0x0;var _0x23c048=_0xb39a[_0x15dc4a];return _0x23c048;};'use strict';var client=require(_0xab39('0x0'));exports['transfers']={};exports[_0xab39('0x1')]=function(_0x2e0b7e){return client[_0xab39('0x2')](_0xab39('0x3'),{'body':{'result':_0x2e0b7e['result'],'transfererchannel':_0x2e0b7e[_0xab39('0x4')],'transferercalleridnum':_0x2e0b7e[_0xab39('0x5')],'transferercalleridname':_0x2e0b7e[_0xab39('0x6')],'transfererconnectedlinenum':_0x2e0b7e['transfererconnectedlinenum'],'transfererconnectedlinename':_0x2e0b7e['transfererconnectedlinename'],'transfereraccountcode':_0x2e0b7e[_0xab39('0x7')],'transferercontext':_0x2e0b7e['transferercontext'],'transfererexten':_0x2e0b7e[_0xab39('0x8')],'transfererlinkedid':_0x2e0b7e[_0xab39('0x9')],'transfereechannel':_0x2e0b7e[_0xab39('0xa')],'transfereecalleridnum':_0x2e0b7e['transfereecalleridnum'],'transfereecalleridname':_0x2e0b7e[_0xab39('0xb')],'transfereeconnectedlinenum':_0x2e0b7e['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x2e0b7e['transfereeconnectedlinename'],'transfereeaccountcode':_0x2e0b7e[_0xab39('0xc')],'transfereecontext':_0x2e0b7e[_0xab39('0xd')],'transfereeexten':_0x2e0b7e[_0xab39('0xe')],'transfereelinkedid':_0x2e0b7e[_0xab39('0xf')],'isexternal':_0x2e0b7e['isexternal'],'context':_0x2e0b7e[_0xab39('0x10')],'extension':_0x2e0b7e[_0xab39('0x11')],'type':'blind'},'log':'CreateVoiceTransferReport'});};exports[_0xab39('0x12')]=function(_0x44e536){return client[_0xab39('0x2')]('CreateVoiceTransferReport',{'body':{'result':_0x44e536[_0xab39('0x13')],'transfererchannel':_0x44e536['origtransfererchannel'],'transferercalleridnum':_0x44e536[_0xab39('0x14')],'transferercalleridname':_0x44e536[_0xab39('0x15')],'transfererconnectedlinenum':_0x44e536[_0xab39('0x16')],'transfererconnectedlinename':_0x44e536[_0xab39('0x17')],'transfereraccountcode':_0x44e536[_0xab39('0x18')],'transferercontext':_0x44e536['secondtransferercontext'],'transfererexten':_0x44e536['secondtransfererexten'],'transfererlinkedid':_0x44e536['origtransfererlinkedid'],'transfereechannel':_0x44e536['transfertargetchannel'],'transfereecalleridnum':_0x44e536[_0xab39('0x19')],'transfereecalleridname':_0x44e536[_0xab39('0x1a')],'transfereeconnectedlinenum':_0x44e536[_0xab39('0x1b')],'transfereeconnectedlinename':_0x44e536[_0xab39('0x1c')],'transfereeaccountcode':_0x44e536['transfertargetaccountcode'],'transfereecontext':_0x44e536[_0xab39('0x1d')],'transfereeexten':_0x44e536[_0xab39('0x1e')],'transfereelinkedid':_0x44e536[_0xab39('0x1f')],'isexternal':_0x44e536['isexternal'],'context':_0x44e536[_0xab39('0x20')],'extension':_0x44e536[_0xab39('0x21')],'type':_0xab39('0x22')},'log':'CreateVoiceTransferReport'});}; \ No newline at end of file +var _0xa225=['origtransferercalleridnum','origtransferercalleridname','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','../client','blindTransfer','Request','CreateVoiceTransferReport','result','transferercalleridnum','transferercalleridname','transferercontext','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereeexten','transfereelinkedid','isexternal','context','extension','blind','attendedTransfer','origtransfererchannel'];(function(_0x5e29ee,_0x17d6fb){var _0x53a7a9=function(_0xabb6bc){while(--_0xabb6bc){_0x5e29ee['push'](_0x5e29ee['shift']());}};_0x53a7a9(++_0x17d6fb);}(_0xa225,0x136));var _0x5a22=function(_0x11b4fb,_0x10c784){_0x11b4fb=_0x11b4fb-0x0;var _0x56cbb5=_0xa225[_0x11b4fb];return _0x56cbb5;};'use strict';var client=require(_0x5a22('0x0'));exports['transfers']={};exports[_0x5a22('0x1')]=function(_0x5704a0){return client[_0x5a22('0x2')](_0x5a22('0x3'),{'body':{'result':_0x5704a0[_0x5a22('0x4')],'transfererchannel':_0x5704a0['transfererchannel'],'transferercalleridnum':_0x5704a0[_0x5a22('0x5')],'transferercalleridname':_0x5704a0[_0x5a22('0x6')],'transfererconnectedlinenum':_0x5704a0['transfererconnectedlinenum'],'transfererconnectedlinename':_0x5704a0['transfererconnectedlinename'],'transfereraccountcode':_0x5704a0['transfereraccountcode'],'transferercontext':_0x5704a0[_0x5a22('0x7')],'transfererexten':_0x5704a0['transfererexten'],'transfererlinkedid':_0x5704a0[_0x5a22('0x8')],'transfereechannel':_0x5704a0[_0x5a22('0x9')],'transfereecalleridnum':_0x5704a0[_0x5a22('0xa')],'transfereecalleridname':_0x5704a0[_0x5a22('0xb')],'transfereeconnectedlinenum':_0x5704a0[_0x5a22('0xc')],'transfereeconnectedlinename':_0x5704a0[_0x5a22('0xd')],'transfereeaccountcode':_0x5704a0[_0x5a22('0xe')],'transfereecontext':_0x5704a0['transfereecontext'],'transfereeexten':_0x5704a0[_0x5a22('0xf')],'transfereelinkedid':_0x5704a0[_0x5a22('0x10')],'isexternal':_0x5704a0[_0x5a22('0x11')],'context':_0x5704a0[_0x5a22('0x12')],'extension':_0x5704a0[_0x5a22('0x13')],'type':_0x5a22('0x14')},'log':_0x5a22('0x3')});};exports[_0x5a22('0x15')]=function(_0x59d6e2){return client[_0x5a22('0x2')](_0x5a22('0x3'),{'body':{'result':_0x59d6e2[_0x5a22('0x4')],'transfererchannel':_0x59d6e2[_0x5a22('0x16')],'transferercalleridnum':_0x59d6e2[_0x5a22('0x17')],'transferercalleridname':_0x59d6e2[_0x5a22('0x18')],'transfererconnectedlinenum':_0x59d6e2['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x59d6e2['secondtransfererconnectedlinename'],'transfereraccountcode':_0x59d6e2[_0x5a22('0x19')],'transferercontext':_0x59d6e2[_0x5a22('0x1a')],'transfererexten':_0x59d6e2[_0x5a22('0x1b')],'transfererlinkedid':_0x59d6e2[_0x5a22('0x1c')],'transfereechannel':_0x59d6e2[_0x5a22('0x1d')],'transfereecalleridnum':_0x59d6e2[_0x5a22('0x1e')],'transfereecalleridname':_0x59d6e2[_0x5a22('0x1f')],'transfereeconnectedlinenum':_0x59d6e2[_0x5a22('0x20')],'transfereeconnectedlinename':_0x59d6e2['transfertargetconnectedlinename'],'transfereeaccountcode':_0x59d6e2['transfertargetaccountcode'],'transfereecontext':_0x59d6e2[_0x5a22('0x21')],'transfereeexten':_0x59d6e2[_0x5a22('0x22')],'transfereelinkedid':_0x59d6e2[_0x5a22('0x23')],'isexternal':_0x59d6e2[_0x5a22('0x11')],'context':_0x59d6e2[_0x5a22('0x24')],'extension':_0x59d6e2['origtransfererexten'],'type':'attended'},'log':_0x5a22('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 16ff8d9..c573b63 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 _0xb10b=['type','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','filter','count','rows','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','telephones','trunks','run','event','Event\x20name\x20mandatory','faxAccounts','send','checkAfterSend','server','http','127.0.0.1','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','validate','moment','../properties','../ami','../model/voiceQueueSummary','listen','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','voiceStatus','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Reload','Action','then','message','catch','command','Command','content','voiceQueues','hasOwnProperty','push','length','find','omit','undefined','values','voicechannel','map','channels','uniqueid','channel','%s.%s','filename','wav','ai(mixmonitorid)','/var/spool/asterisk/monitor/','toLowerCase','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','monitors','stop','queueChannels','inbound','outbound','includes'];(function(_0x240377,_0x11c4ec){var _0x357712=function(_0x570fa0){while(--_0x570fa0){_0x240377['push'](_0x240377['shift']());}};_0x357712(++_0x11c4ec);}(_0xb10b,0x12a));var _0xbb10=function(_0xdee7ec,_0x29d552){_0xdee7ec=_0xdee7ec-0x0;var _0x1879b6=_0xb10b[_0xdee7ec];return _0x1879b6;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var jayson=require(_0xbb10('0x1'));var schema=require(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var config=require('../../../config/environment');var properties=require(_0xbb10('0x4'));var ami=require(_0xbb10('0x5'));var VoiceQueueSummary=require(_0xbb10('0x6'));exports[_0xbb10('0x7')]=function(_0x49baf4,_0x312b72,_0x481979){return new Promise(function(_0x328583,_0x3cdd53){var _0x513741={'QueuePause':function(_0x1b9e94){return new Promise(function(_0x3fb675){var _0x21370f=util[_0xbb10('0x8')](_0xbb10('0x9'),_0xbb10('0xa'),_0x1b9e94[_0xbb10('0xb')]);if(_0x49baf4[_0xbb10('0xc')]&&_0x49baf4['timers'][_0x21370f]&&_0x49baf4['timers'][_0x21370f][_0xbb10('0xd')]){_0x49baf4[_0xbb10('0xc')][_0x21370f][_0xbb10('0xe')]();}if(_0x49baf4['agents'][_0x21370f]){_0x49baf4[_0xbb10('0xf')][_0x21370f]['updateStatusRealtime']({'state':_0x49baf4[_0xbb10('0xf')][_0x21370f][_0xbb10('0x10')],'statePause':_0x1b9e94[_0xbb10('0x11')]?!![]:![]});}_0x3fb675({'code':0xc8,'message':_0xbb10('0x12')});});},'Reload':function(_0x442548){var _0x147230=this;return new Promise(function(_0x58a612,_0x26e021){if(ami[_0xbb10('0x13')]()==![]){return _0x26e021(_0x147230[_0xbb10('0x14')](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}_0x442548=_[_0xbb10('0x19')](_0x442548,_[_0xbb10('0x1a')](properties['reload'][_0xbb10('0x1b')]));_0x442548[_0xbb10('0x1c')]=_0xbb10('0x1d');return ami[_0xbb10('0x1e')](_0x442548)[_0xbb10('0x1f')](function(_0x1682a4){_0x58a612({'code':0xc8,'message':_0x1682a4[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0xbf2906){_0x26e021(_0x147230[_0xbb10('0x14')](0x1f5,_0xbf2906['message']));});});},'Command':function(_0x5ff0cf){var _0x19f48d=this;return new Promise(function(_0x388fab,_0x109908){if(ami[_0xbb10('0x13')]()==![]){return _0x109908(_0x19f48d[_0xbb10('0x14')](0x1f4,[config['asterisk']['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],'ami\x20disconnected']['join']('\x20')));}_0x5ff0cf=_[_0xbb10('0x19')](_0x5ff0cf,_0xbb10('0x22'));_0x5ff0cf[_0xbb10('0x1c')]=_0xbb10('0x23');return ami[_0xbb10('0x1e')](_0x5ff0cf)[_0xbb10('0x1f')](function(_0x407cb4){_0x388fab({'code':0xc8,'message':_0x407cb4[_0xbb10('0x24')]});})[_0xbb10('0x21')](function(_0x395404){_0x109908(_0x19f48d[_0xbb10('0x14')](0x1f5,_0x395404[_0xbb10('0x20')]));});});},'VoiceQueues':function(){return new Promise(function(_0x537898){var _0x4fedac=[];for(var _0x4fb5e0 in _0x49baf4[_0xbb10('0x25')]){if(_0x49baf4[_0xbb10('0x25')][_0xbb10('0x26')](_0x4fb5e0)){var _0x4e25ff=_0x49baf4[_0xbb10('0x25')][_0x4fb5e0];var _0x24d586=new VoiceQueueSummary(_0x4e25ff);_0x4fedac[_0xbb10('0x27')](_0x24d586);}}_0x537898({'count':_0x4fedac[_0xbb10('0x28')],'rows':_0x4fedac});});},'UpdateVoiceQueue':function(_0x1acce9){return new Promise(function(_0x20d946,_0x2a0e8b){var _0x4aabb9=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x25')],{'id':parseInt(_0x1acce9['id'])});var _0xfc3595=_[_0xbb10('0x2a')](_0x1acce9,['id']);if(_0x4aabb9){for(var _0x1d30aa in _0xfc3595){if(typeof _0xfc3595[_0x1d30aa]!==_0xbb10('0x2b')&&typeof _0x4aabb9[_0x1d30aa]!=='undefined'){_0x4aabb9[_0x1d30aa]=_0xfc3595[_0x1d30aa];}}_0x20d946(_0x4aabb9);}else{_0x2a0e8b();}});},'VoiceChannels':function(){return new Promise(function(_0x221624){var _0x4ee02e=_[_0xbb10('0x2c')](_0x49baf4['channels']);_0x221624({'count':_0x4ee02e[_0xbb10('0x28')],'rows':_0x4ee02e});});},'VoiceChannelMixMonitor':function(_0x1dcc9c){var _0x1b59f9=this;return new Promise(function(_0x491db4,_0x518d47){if(ami[_0xbb10('0x13')]()==![]){return _0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f4,[config['asterisk']['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}var _0x37a83f=schema(properties[_0xbb10('0x2d')])[_0xbb10('0x2')](_0x1dcc9c);if(_0x37a83f['length']>0x0){return _0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x37a83f,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0xfb2c5e=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x2f')],{'uniqueid':_0x1dcc9c[_0xbb10('0x30')]});if(_0xfb2c5e&&_0xfb2c5e[_0xbb10('0x31')]){var _0x56943c=util[_0xbb10('0x8')](_0xbb10('0x32'),_0x1dcc9c[_0xbb10('0x33')]||_0x1dcc9c[_0xbb10('0x30')],_0x1dcc9c['format']||_0xbb10('0x34'));return ami['Action']({'action':'MixMonitor','channel':_0xfb2c5e[_0xbb10('0x31')],'file':_0x56943c,'options':_0xbb10('0x35')})[_0xbb10('0x1f')](function(_0x120d21){var _0x15d895=_[_0xbb10('0x29')](_0xfb2c5e['monitors'],{'filename':_0xbb10('0x36')+_0x56943c[_0xbb10('0x37')]()});if(_['isNil'](_0x15d895)){_0xfb2c5e['monitors']['push']({'filename':_0xbb10('0x36')+_0x56943c[_0xbb10('0x37')](),'createdAt':moment()[_0xbb10('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x120d21[_0xbb10('0x38')],'status':_0xbb10('0x39')});}else{_0x15d895[_0xbb10('0x38')]=_0x120d21['mixmonitorid'];_0x15d895[_0xbb10('0x3a')]=_0xbb10('0x39');}_0x491db4({'code':0xc8,'message':[_0x1dcc9c[_0xbb10('0x30')],_0xbb10('0x3b'),_0x120d21['mixmonitorid']][_0xbb10('0x18')]('\x20'),'mixmonitorid':_0x120d21[_0xbb10('0x38')]});})['catch'](function(_0xe2040f){_0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f5,[_0x1dcc9c[_0xbb10('0x30')],_0xe2040f[_0xbb10('0x20')][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')));});}else{return _0x518d47(_0x1b59f9['error'](0x1f5,_0xbb10('0x3c')));}});},'VoiceChannelStopMixMonitor':function(_0x1c7fae){var _0x3e7b4c=this;return new Promise(function(_0x3d3c41,_0x4943d9){if(ami[_0xbb10('0x13')]()==![]){return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')]['username'],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}var _0x54ac18=schema(properties['voicechannel'])[_0xbb10('0x2')](_0x1c7fae);if(_0x54ac18['length']>0x0){return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x54ac18,'message')[_0xbb10('0x18')](',\x20')));}var _0x1d82bf=_[_0xbb10('0x29')](_0x49baf4['channels'],{'uniqueid':_0x1c7fae[_0xbb10('0x30')]});if(_0x1d82bf){return Promise[_0xbb10('0x3d')]()[_0xbb10('0x1f')](function(){if(_0x1d82bf[_0xbb10('0x31')]){return ami[_0xbb10('0x1e')]({'action':_0xbb10('0x3e'),'channel':_0x1d82bf[_0xbb10('0x31')],'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]})[_0xbb10('0x21')](function(){});}})[_0xbb10('0x1f')](function(){if(_0x1d82bf[_0xbb10('0x3f')]){return ami[_0xbb10('0x1e')]({'action':'StopMixMonitor','channel':_0x1d82bf[_0xbb10('0x3f')],'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]})['catch'](function(){});}})[_0xbb10('0x1f')](function(){var _0x2f5027=_[_0xbb10('0x29')](_0x1d82bf[_0xbb10('0x40')],{'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]});if(_0x2f5027){_0x2f5027[_0xbb10('0x3a')]=_0xbb10('0x41');}})['then'](function(){var _0x4a9793=util[_0xbb10('0x8')](_0xbb10('0x32'),_0x1c7fae[_0xbb10('0x33')]||_0x1c7fae['uniqueid'],_0x1c7fae['format']||_0xbb10('0x34'));var _0x34cf4e=_[_0xbb10('0x29')](_0x1d82bf[_0xbb10('0x40')],{'filename':_0xbb10('0x36')+_0x4a9793[_0xbb10('0x37')]()});if(_0x34cf4e){_0x34cf4e[_0xbb10('0x3a')]=_0xbb10('0x41');}})[_0xbb10('0x1f')](function(){_0x3d3c41({'code':0xc8,'message':[_0x1c7fae[_0xbb10('0x30')],'StopMixMonitor\x20Success']['join']('\x20')});})[_0xbb10('0x21')](function(_0x467dba){_0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f5,[_0x1c7fae[_0xbb10('0x30')],_0x467dba[_0xbb10('0x20')][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')));});}else{return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannels':function(_0x1214f7){var _0x19ca3e=this;return new Promise(function(_0x20e18a){var _0x61e689=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x42')]);var _0x547a7a={'count':_0x61e689[_0xbb10('0x28')],'rows':_0x61e689};if(_0x1214f7&&_0x1214f7['type']){if(![_0xbb10('0x43'),_0xbb10('0x44')][_0xbb10('0x45')](_0x1214f7[_0xbb10('0x46')])){return _0x3cdd53(_0x19ca3e[_0xbb10('0x14')](0x190,_0xbb10('0x47')));}var _0x2e3326=_[_0xbb10('0x48')](_0x61e689,function(_0x180400){return _0x180400[_0xbb10('0x46')]===_0x1214f7[_0xbb10('0x46')];});_0x547a7a[_0xbb10('0x49')]=_0x2e3326[_0xbb10('0x28')];_0x547a7a[_0xbb10('0x4a')]=_0x2e3326;}_0x20e18a(_0x547a7a);});},'VoiceQueuesChannel':function(_0x4475e1){var _0x5de0cc=this;return new Promise(function(_0x4571b6,_0x466eb7){var _0x1b83a9=schema(properties[_0xbb10('0x4b')])[_0xbb10('0x2')](_0x4475e1);if(_0x1b83a9[_0xbb10('0x28')]>0x0){return _0x466eb7(_0x5de0cc['error'](0x1f4,_[_0xbb10('0x2e')](_0x1b83a9,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x14fed3=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x4475e1[_0xbb10('0x30')]});if(_0x14fed3){_0x4571b6(_0x14fed3);}else{return _0x466eb7(_0x5de0cc[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannelHangup':function(_0x40c4fb){var _0x2eb05a=this;return new Promise(function(_0x2a1ce1,_0x16932f){if(ami['isConnected']()==![]){return _0x16932f(_0x2eb05a['error'](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')]['join']('\x20')));}var _0x506498=schema(properties[_0xbb10('0x4c')])[_0xbb10('0x2')](_0x40c4fb);if(_0x506498[_0xbb10('0x28')]>0x0){return _0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x506498,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x4a5fb9=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x40c4fb['uniqueid']});if(_0x4a5fb9&&_0x4a5fb9['channel']){return ami['Action']({'action':_0xbb10('0x4d'),'channel':_0x4a5fb9[_0xbb10('0x31')]})[_0xbb10('0x1f')](function(_0x5bd1c0){_0x2a1ce1({'code':0xc8,'message':[_0x40c4fb['uniqueid'],_0x5bd1c0['message'][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')});})[_0xbb10('0x21')](function(_0x4e9fbd){_0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f5,[_0x40c4fb[_0xbb10('0x30')],_0x4e9fbd['message']['toLowerCase']()][_0xbb10('0x18')]('\x20')));});}else{return _0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannelRedirect':function(_0x237246){var _0x54b7c5=this;return new Promise(function(_0x43eaec,_0xec48ac){if(ami[_0xbb10('0x13')]()==![]){return _0xec48ac(_0x54b7c5['error'](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],'ami\x20disconnected'][_0xbb10('0x18')]('\x20')));}var _0x31e85e=schema(properties[_0xbb10('0x4e')])[_0xbb10('0x2')](_0x237246);if(_0x31e85e['length']>0x0){return _0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x31e85e,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x56b3a3=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x237246[_0xbb10('0x30')]});if(_0x56b3a3&&_0x56b3a3[_0xbb10('0x31')]){return ami[_0xbb10('0x1e')]({'action':_0xbb10('0x4f'),'channel':_0x56b3a3[_0xbb10('0x31')],'exten':_0x237246['exten'],'context':_0x237246['context']||_0x56b3a3['context'],'priority':0x1})[_0xbb10('0x1f')](function(_0x9c672d){_0x43eaec({'code':0xc8,'message':[_0x237246[_0xbb10('0x30')],_0x9c672d['message']['toLowerCase']()][_0xbb10('0x18')]('\x20')});})[_0xbb10('0x21')](function(_0xd9e743){_0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f5,[_0x237246[_0xbb10('0x30')],_0xd9e743[_0xbb10('0x20')]['toLowerCase']()][_0xbb10('0x18')]('\x20')));});}else{return _0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'Agents':function(_0x14f16b){return new Promise(function(_0x2aaaa6){var _0x5bfc68=_['values'](_0x49baf4['agents']);if(_0x14f16b&&_0x14f16b['id']){var _0x329da7=_[_0xbb10('0x29')](_0x5bfc68,function(_0x36917f){return _0x36917f['id']===_0x14f16b['id'];});_0x2aaaa6(_0x329da7);}else{_0x2aaaa6({'count':_0x5bfc68[_0xbb10('0x28')],'rows':_0x5bfc68});}});},'Telephones':function(){return new Promise(function(_0x2f7d2a){var _0x1d40b8=_['values'](_0x49baf4[_0xbb10('0x50')]);_0x2f7d2a({'count':_0x1d40b8['length'],'rows':_0x1d40b8});});},'Trunks':function(){return new Promise(function(_0x4fe3b5){var _0x519a54=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x51')]);_0x4fe3b5({'count':_0x519a54[_0xbb10('0x28')],'rows':_0x519a54});});},'OutboundChannels':function(){return new Promise(function(_0x108f99){var _0x5ce94f=_[_0xbb10('0x2c')](_0x49baf4['outboundChannels']);_0x108f99({'count':_0x5ce94f['length'],'rows':_0x5ce94f});});},'Outbound':function(){return new Promise(function(_0x165fe9){_0x165fe9(_0x49baf4[_0xbb10('0x44')]);});},'Campaigns':function(){return new Promise(function(_0x29529c){var _0x2bd2ab=_[_0xbb10('0x2c')](_0x49baf4['campaigns']);_0x29529c({'count':_0x2bd2ab[_0xbb10('0x28')],'rows':_0x2bd2ab});});},'VoiceQueuesPreview':function(_0x19fcec){var _0x2c6429=this;return new Promise(function(_0x3f3d38,_0x43cdb7){_0x312b72[_0xbb10('0x52')](_0x19fcec['id'])[_0xbb10('0x1f')](function(_0x53fa98){_0x3f3d38({'code':0xc8,'message':_0x53fa98[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0x30f3ea){_0x43cdb7(_0x2c6429[_0xbb10('0x14')](0x1f4,_0x30f3ea[_0xbb10('0x20')]));});});},'EventManager':function(_0x172be3){var _0xa3b23=this;return new Promise(function(_0x312a08,_0x5a4429){if(!_0x172be3[_0xbb10('0x53')]){return _0x5a4429(_0xa3b23[_0xbb10('0x14')](0x1f4,_0xbb10('0x54')));}ami['emit']('custom:'+_0x172be3['event'],_0x172be3[_0xbb10('0x20')]);_0x312a08({'code':0xc8,'message':_0x172be3});});},'FaxAccounts':function(){return new Promise(function(_0x5a3c44){var _0x4e3d6a=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x55')]);_0x5a3c44({'count':_0x4e3d6a[_0xbb10('0x28')],'rows':_0x4e3d6a});});},'SendFax':function(_0x12ed63){var _0x32ec27=this;return new Promise(function(_0x24dca6,_0x33116){_0x481979[_0xbb10('0x56')](_0x12ed63)[_0xbb10('0x1f')](function(_0x5206e1){_0x24dca6({'code':0xc8,'message':_0x5206e1[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0x46b6d2){_0x33116(_0x32ec27[_0xbb10('0x14')](0x1f4,_0x46b6d2['message']));});});},'CheckAfterSend':function(_0x4c0795){var _0x3547a3=this;return new Promise(function(_0x2280bd,_0x30f0a4){_0x481979[_0xbb10('0x57')](_0x4c0795)['then'](function(_0x17d596){_0x2280bd({'code':0xc8,'message':_0x17d596[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0xf7b3e1){_0x30f0a4(_0x3547a3[_0xbb10('0x14')](0x1f4,_0xf7b3e1['message']));});});}};var _0x5f0691=jayson[_0xbb10('0x58')](_0x513741)[_0xbb10('0x59')]();_0x5f0691['on'](_0xbb10('0x14'),function(_0x5239da){return _0x3cdd53(_0x5239da);});_0x5f0691[_0xbb10('0x7')](0x232a,_0xbb10('0x5a'),function(){console['log']('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x328583(_0xbb10('0x5b')+0x232a);});});}; \ No newline at end of file +var _0x7a54=['http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','moment','../../../config/environment','../ami','../model/voiceQueueSummary','listen','name','timers','updateAcw','agents','updateStatusRealtime','voiceStatus','pause','isConnected','error','asterisk','ami\x20disconnected','join','pick','keys','reload','Reload','message','catch','username','command','action','Command','then','voiceQueues','hasOwnProperty','push','length','find','omit','undefined','values','channels','validate','map','uniqueid','channel','format','wav','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','isNil','toLowerCase','mixmonitorid','rec','status','Channel\x20doesn\x27t\x20exist','Action','StopMixMonitor','destinationchannel','stop','filename','queueChannels','type','outbound','includes','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','filter','count','rows','voicequeuechannelhangup','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','outboundChannels','run','custom:','event','faxAccounts','send'];(function(_0x49ca9a,_0x302bdb){var _0x1ee935=function(_0x469fb7){while(--_0x469fb7){_0x49ca9a['push'](_0x49ca9a['shift']());}};_0x1ee935(++_0x302bdb);}(_0x7a54,0x106));var _0x47a5=function(_0x40880b,_0x3d7fc2){_0x40880b=_0x40880b-0x0;var _0x40d76c=_0x7a54[_0x40880b];return _0x40d76c;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var jayson=require(_0x47a5('0x2'));var schema=require('validate');var moment=require(_0x47a5('0x3'));var config=require(_0x47a5('0x4'));var properties=require('../properties');var ami=require(_0x47a5('0x5'));var VoiceQueueSummary=require(_0x47a5('0x6'));exports[_0x47a5('0x7')]=function(_0x3717e1,_0xfdf934,_0x545a97){return new Promise(function(_0x3d5629,_0x59199c){var _0x343372={'QueuePause':function(_0x30e405){return new Promise(function(_0x506eda){var _0x194fb0=util['format']('%s/%s','SIP',_0x30e405[_0x47a5('0x8')]);if(_0x3717e1[_0x47a5('0x9')]&&_0x3717e1['timers'][_0x194fb0]&&_0x3717e1[_0x47a5('0x9')][_0x194fb0]['timer']){_0x3717e1['timers'][_0x194fb0][_0x47a5('0xa')]();}if(_0x3717e1[_0x47a5('0xb')][_0x194fb0]){_0x3717e1[_0x47a5('0xb')][_0x194fb0][_0x47a5('0xc')]({'state':_0x3717e1[_0x47a5('0xb')][_0x194fb0][_0x47a5('0xd')],'statePause':_0x30e405[_0x47a5('0xe')]?!![]:![]});}_0x506eda({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x44bd3e){var _0x221b54=this;return new Promise(function(_0x1cf309,_0x711793){if(ami[_0x47a5('0xf')]()==![]){return _0x711793(_0x221b54[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}_0x44bd3e=_[_0x47a5('0x14')](_0x44bd3e,_[_0x47a5('0x15')](properties[_0x47a5('0x16')]['module']));_0x44bd3e['action']=_0x47a5('0x17');return ami['Action'](_0x44bd3e)['then'](function(_0x423a81){_0x1cf309({'code':0xc8,'message':_0x423a81[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x1ef371){_0x711793(_0x221b54[_0x47a5('0x10')](0x1f5,_0x1ef371[_0x47a5('0x18')]));});});},'Command':function(_0x2763d6){var _0xe3c618=this;return new Promise(function(_0x3aed38,_0x4a9fcb){if(ami[_0x47a5('0xf')]()==![]){return _0x4a9fcb(_0xe3c618[_0x47a5('0x10')](0x1f4,[config['asterisk']['ip'],config[_0x47a5('0x11')][_0x47a5('0x1a')],_0x47a5('0x12')]['join']('\x20')));}_0x2763d6=_[_0x47a5('0x14')](_0x2763d6,_0x47a5('0x1b'));_0x2763d6[_0x47a5('0x1c')]=_0x47a5('0x1d');return ami['Action'](_0x2763d6)[_0x47a5('0x1e')](function(_0x385687){_0x3aed38({'code':0xc8,'message':_0x385687['content']});})[_0x47a5('0x19')](function(_0xc4cd63){_0x4a9fcb(_0xe3c618[_0x47a5('0x10')](0x1f5,_0xc4cd63[_0x47a5('0x18')]));});});},'VoiceQueues':function(){return new Promise(function(_0x3abd6a){var _0x50bf17=[];for(var _0x53078a in _0x3717e1[_0x47a5('0x1f')]){if(_0x3717e1['voiceQueues'][_0x47a5('0x20')](_0x53078a)){var _0x5b6c4e=_0x3717e1[_0x47a5('0x1f')][_0x53078a];var _0x378208=new VoiceQueueSummary(_0x5b6c4e);_0x50bf17[_0x47a5('0x21')](_0x378208);}}_0x3abd6a({'count':_0x50bf17[_0x47a5('0x22')],'rows':_0x50bf17});});},'UpdateVoiceQueue':function(_0x21f296){return new Promise(function(_0x3ba0b7,_0x24b162){var _0x136b14=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x1f')],{'id':parseInt(_0x21f296['id'])});var _0x1127f8=_[_0x47a5('0x24')](_0x21f296,['id']);if(_0x136b14){for(var _0x3ad507 in _0x1127f8){if(typeof _0x1127f8[_0x3ad507]!=='undefined'&&typeof _0x136b14[_0x3ad507]!==_0x47a5('0x25')){_0x136b14[_0x3ad507]=_0x1127f8[_0x3ad507];}}_0x3ba0b7(_0x136b14);}else{_0x24b162();}});},'VoiceChannels':function(){return new Promise(function(_0x51833b){var _0x2ef875=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x27')]);_0x51833b({'count':_0x2ef875['length'],'rows':_0x2ef875});});},'VoiceChannelMixMonitor':function(_0x256650){var _0x625952=this;return new Promise(function(_0x39b50b,_0x1f1c68){if(ami['isConnected']()==![]){return _0x1f1c68(_0x625952['error'](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],'ami\x20disconnected'][_0x47a5('0x13')]('\x20')));}var _0x51544e=schema(properties['voicechannel'])[_0x47a5('0x28')](_0x256650);if(_0x51544e['length']>0x0){return _0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x51544e,'message')['join'](',\x20')));}var _0x274e34=_['find'](_0x3717e1[_0x47a5('0x27')],{'uniqueid':_0x256650[_0x47a5('0x2a')]});if(_0x274e34&&_0x274e34[_0x47a5('0x2b')]){var _0x52749b=util[_0x47a5('0x2c')]('%s.%s',_0x256650['filename']||_0x256650[_0x47a5('0x2a')],_0x256650['format']||_0x47a5('0x2d'));return ami['Action']({'action':_0x47a5('0x2e'),'channel':_0x274e34[_0x47a5('0x2b')],'file':_0x52749b,'options':_0x47a5('0x2f')})[_0x47a5('0x1e')](function(_0x36add5){var _0xed6320=_[_0x47a5('0x23')](_0x274e34[_0x47a5('0x30')],{'filename':_0x47a5('0x31')+_0x52749b['toLowerCase']()});if(_[_0x47a5('0x32')](_0xed6320)){_0x274e34[_0x47a5('0x30')]['push']({'filename':_0x47a5('0x31')+_0x52749b[_0x47a5('0x33')](),'createdAt':moment()[_0x47a5('0x2c')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x36add5[_0x47a5('0x34')],'status':_0x47a5('0x35')});}else{_0xed6320['mixmonitorid']=_0x36add5[_0x47a5('0x34')];_0xed6320[_0x47a5('0x36')]='rec';}_0x39b50b({'code':0xc8,'message':[_0x256650['uniqueid'],'MixMonitor\x20Success',_0x36add5[_0x47a5('0x34')]]['join']('\x20'),'mixmonitorid':_0x36add5[_0x47a5('0x34')]});})[_0x47a5('0x19')](function(_0x301a85){_0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f5,[_0x256650[_0x47a5('0x2a')],_0x301a85[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f5,_0x47a5('0x37')));}});},'VoiceChannelStopMixMonitor':function(_0x280500){var _0x1658e8=this;return new Promise(function(_0x23d6d8,_0x56dbbd){if(ami[_0x47a5('0xf')]()==![]){return _0x56dbbd(_0x1658e8[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],_0x47a5('0x12')]['join']('\x20')));}var _0x47c7a2=schema(properties['voicechannel'])['validate'](_0x280500);if(_0x47c7a2[_0x47a5('0x22')]>0x0){return _0x56dbbd(_0x1658e8['error'](0x1f4,_[_0x47a5('0x29')](_0x47c7a2,_0x47a5('0x18'))[_0x47a5('0x13')](',\x20')));}var _0x494526=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x27')],{'uniqueid':_0x280500['uniqueid']});if(_0x494526){return Promise['resolve']()[_0x47a5('0x1e')](function(){if(_0x494526['channel']){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x39'),'channel':_0x494526[_0x47a5('0x2b')],'mixmonitorid':_0x280500[_0x47a5('0x34')]})[_0x47a5('0x19')](function(){});}})[_0x47a5('0x1e')](function(){if(_0x494526[_0x47a5('0x3a')]){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x39'),'channel':_0x494526[_0x47a5('0x3a')],'mixmonitorid':_0x280500[_0x47a5('0x34')]})[_0x47a5('0x19')](function(){});}})[_0x47a5('0x1e')](function(){var _0x3574d4=_[_0x47a5('0x23')](_0x494526[_0x47a5('0x30')],{'mixmonitorid':_0x280500['mixmonitorid']});if(_0x3574d4){_0x3574d4[_0x47a5('0x36')]=_0x47a5('0x3b');}})['then'](function(){var _0x52b3a8=util[_0x47a5('0x2c')]('%s.%s',_0x280500[_0x47a5('0x3c')]||_0x280500[_0x47a5('0x2a')],_0x280500['format']||'wav');var _0x3d85cc=_['find'](_0x494526[_0x47a5('0x30')],{'filename':_0x47a5('0x31')+_0x52b3a8[_0x47a5('0x33')]()});if(_0x3d85cc){_0x3d85cc[_0x47a5('0x36')]=_0x47a5('0x3b');}})[_0x47a5('0x1e')](function(){_0x23d6d8({'code':0xc8,'message':[_0x280500[_0x47a5('0x2a')],'StopMixMonitor\x20Success']['join']('\x20')});})[_0x47a5('0x19')](function(_0x411230){_0x56dbbd(_0x1658e8[_0x47a5('0x10')](0x1f5,[_0x280500[_0x47a5('0x2a')],_0x411230[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x56dbbd(_0x1658e8['error'](0x1f5,_0x47a5('0x37')));}});},'VoiceQueuesChannels':function(_0x1c9a62){var _0x5f6a=this;return new Promise(function(_0x5c3c75){var _0x12ca40=_['values'](_0x3717e1[_0x47a5('0x3d')]);var _0xe31817={'count':_0x12ca40[_0x47a5('0x22')],'rows':_0x12ca40};if(_0x1c9a62&&_0x1c9a62[_0x47a5('0x3e')]){if(!['inbound',_0x47a5('0x3f')][_0x47a5('0x40')](_0x1c9a62[_0x47a5('0x3e')])){return _0x59199c(_0x5f6a[_0x47a5('0x10')](0x190,_0x47a5('0x41')));}var _0x6a53b3=_[_0x47a5('0x42')](_0x12ca40,function(_0x481089){return _0x481089[_0x47a5('0x3e')]===_0x1c9a62[_0x47a5('0x3e')];});_0xe31817[_0x47a5('0x43')]=_0x6a53b3[_0x47a5('0x22')];_0xe31817[_0x47a5('0x44')]=_0x6a53b3;}_0x5c3c75(_0xe31817);});},'VoiceQueuesChannel':function(_0x1ab0bf){var _0x572233=this;return new Promise(function(_0x1ad6a9,_0x245a15){var _0x1aa581=schema(properties['voicequeuechannel'])[_0x47a5('0x28')](_0x1ab0bf);if(_0x1aa581[_0x47a5('0x22')]>0x0){return _0x245a15(_0x572233[_0x47a5('0x10')](0x1f4,_['map'](_0x1aa581,'message')[_0x47a5('0x13')](',\x20')));}var _0x376e1d=_['find'](_0x3717e1['queueChannels'],{'uniqueid':_0x1ab0bf[_0x47a5('0x2a')]});if(_0x376e1d){_0x1ad6a9(_0x376e1d);}else{return _0x245a15(_0x572233['error'](0x1f5,_0x47a5('0x37')));}});},'VoiceQueuesChannelHangup':function(_0x5d383d){var _0x482de6=this;return new Promise(function(_0x389ed9,_0x46d2d3){if(ami['isConnected']()==![]){return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config['asterisk']['username'],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}var _0x867da0=schema(properties[_0x47a5('0x45')])['validate'](_0x5d383d);if(_0x867da0[_0x47a5('0x22')]>0x0){return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x867da0,'message')[_0x47a5('0x13')](',\x20')));}var _0x4db625=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x3d')],{'uniqueid':_0x5d383d[_0x47a5('0x2a')]});if(_0x4db625&&_0x4db625[_0x47a5('0x2b')]){return ami[_0x47a5('0x38')]({'action':'Hangup','channel':_0x4db625[_0x47a5('0x2b')]})['then'](function(_0x5cbe97){_0x389ed9({'code':0xc8,'message':[_0x5d383d['uniqueid'],_0x5cbe97['message'][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')});})[_0x47a5('0x19')](function(_0x52e3ee){_0x46d2d3(_0x482de6['error'](0x1f5,[_0x5d383d[_0x47a5('0x2a')],_0x52e3ee[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x3474b7){var _0x519e9e=this;return new Promise(function(_0x22c886,_0x274d31){if(ami['isConnected']()==![]){return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')][_0x47a5('0x1a')],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}var _0x35cca8=schema(properties[_0x47a5('0x46')])['validate'](_0x3474b7);if(_0x35cca8[_0x47a5('0x22')]>0x0){return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x35cca8,_0x47a5('0x18'))[_0x47a5('0x13')](',\x20')));}var _0x4bbe14=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x3d')],{'uniqueid':_0x3474b7[_0x47a5('0x2a')]});if(_0x4bbe14&&_0x4bbe14[_0x47a5('0x2b')]){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x47'),'channel':_0x4bbe14[_0x47a5('0x2b')],'exten':_0x3474b7[_0x47a5('0x48')],'context':_0x3474b7[_0x47a5('0x49')]||_0x4bbe14[_0x47a5('0x49')],'priority':0x1})[_0x47a5('0x1e')](function(_0x44fda9){_0x22c886({'code':0xc8,'message':[_0x3474b7[_0x47a5('0x2a')],_0x44fda9[_0x47a5('0x18')][_0x47a5('0x33')]()]['join']('\x20')});})[_0x47a5('0x19')](function(_0x284fb8){_0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f5,[_0x3474b7['uniqueid'],_0x284fb8[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x3ac402){return new Promise(function(_0x522ccf){var _0x2d5ee6=_['values'](_0x3717e1[_0x47a5('0xb')]);if(_0x3ac402&&_0x3ac402['id']){var _0x4cf7c5=_[_0x47a5('0x23')](_0x2d5ee6,function(_0x2f27c3){return _0x2f27c3['id']===_0x3ac402['id'];});_0x522ccf(_0x4cf7c5);}else{_0x522ccf({'count':_0x2d5ee6[_0x47a5('0x22')],'rows':_0x2d5ee6});}});},'Telephones':function(){return new Promise(function(_0x58473b){var _0x4af557=_['values'](_0x3717e1[_0x47a5('0x4a')]);_0x58473b({'count':_0x4af557[_0x47a5('0x22')],'rows':_0x4af557});});},'Trunks':function(){return new Promise(function(_0xe3c0a7){var _0x117510=_['values'](_0x3717e1[_0x47a5('0x4b')]);_0xe3c0a7({'count':_0x117510[_0x47a5('0x22')],'rows':_0x117510});});},'OutboundChannels':function(){return new Promise(function(_0x390bc0){var _0xd5b23f=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x4c')]);_0x390bc0({'count':_0xd5b23f[_0x47a5('0x22')],'rows':_0xd5b23f});});},'Outbound':function(){return new Promise(function(_0x39939a){_0x39939a(_0x3717e1[_0x47a5('0x3f')]);});},'Campaigns':function(){return new Promise(function(_0xc69a68){var _0x2e6fcc=_[_0x47a5('0x26')](_0x3717e1['campaigns']);_0xc69a68({'count':_0x2e6fcc[_0x47a5('0x22')],'rows':_0x2e6fcc});});},'VoiceQueuesPreview':function(_0x4833be){var _0x2ad00a=this;return new Promise(function(_0x2ac30f,_0x281e5f){_0xfdf934[_0x47a5('0x4d')](_0x4833be['id'])[_0x47a5('0x1e')](function(_0xa9c853){_0x2ac30f({'code':0xc8,'message':_0xa9c853[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x11c1db){_0x281e5f(_0x2ad00a[_0x47a5('0x10')](0x1f4,_0x11c1db[_0x47a5('0x18')]));});});},'EventManager':function(_0x1f07ac){var _0x8f0035=this;return new Promise(function(_0x2d434c,_0x441d64){if(!_0x1f07ac['event']){return _0x441d64(_0x8f0035['error'](0x1f4,'Event\x20name\x20mandatory'));}ami['emit'](_0x47a5('0x4e')+_0x1f07ac[_0x47a5('0x4f')],_0x1f07ac['message']);_0x2d434c({'code':0xc8,'message':_0x1f07ac});});},'FaxAccounts':function(){return new Promise(function(_0x732e00){var _0x44dda2=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x50')]);_0x732e00({'count':_0x44dda2[_0x47a5('0x22')],'rows':_0x44dda2});});},'SendFax':function(_0x930d25){var _0x218dfa=this;return new Promise(function(_0x1c7302,_0x2e9a96){_0x545a97[_0x47a5('0x51')](_0x930d25)[_0x47a5('0x1e')](function(_0x5e5f16){_0x1c7302({'code':0xc8,'message':_0x5e5f16[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x420671){_0x2e9a96(_0x218dfa['error'](0x1f4,_0x420671[_0x47a5('0x18')]));});});},'CheckAfterSend':function(_0x32f393){var _0x17b61d=this;return new Promise(function(_0x5d41d8,_0x19dc8c){_0x545a97['checkAfterSend'](_0x32f393)['then'](function(_0x356e16){_0x5d41d8({'code':0xc8,'message':_0x356e16[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x27333e){_0x19dc8c(_0x17b61d[_0x47a5('0x10')](0x1f4,_0x27333e[_0x47a5('0x18')]));});});}};var _0x479a82=jayson['server'](_0x343372)[_0x47a5('0x52')]();_0x479a82['on']('error',function(_0x24dbee){return _0x59199c(_0x24dbee);});_0x479a82[_0x47a5('0x7')](0x232a,_0x47a5('0x53'),function(){console[_0x47a5('0x54')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x3d5629(_0x47a5('0x55')+0x232a);});});}; \ No newline at end of file diff --git a/server/services/ami/trigger/cmContact/index.js b/server/services/ami/trigger/cmContact/index.js index 60805e3..7861296 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 _0x1dda=['emit','data1','data2','data5','xmd-contactid','ListId','data3','split','phone','map','destcalleridnum','routeId','calleridnum','firstName','lastName','mobile','createdAt','updatedAt','union','resolve','then','isEmpty','length','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','[CM][%s][%s]\x20Contact\x20not\x20found','data4','isNil','','Unknown','destcalleridname','createContact','push','calleridname','format','trigger:%s','action','merge','bluebird','ioredis','../../../../config/environment','../../../../config/logger','../../rpc/cmContact','defaults','redis','localhost','socket.io-emitter','info','[CM][%s][%s]'];(function(_0x566bdf,_0x1f4861){var _0x331215=function(_0x524d0d){while(--_0x524d0d){_0x566bdf['push'](_0x566bdf['shift']());}};_0x331215(++_0x1f4861);}(_0x1dda,0xb9));var _0xa1dd=function(_0x3042c5,_0x36cb88){_0x3042c5=_0x3042c5-0x0;var _0x7cd140=_0x1dda[_0x3042c5];return _0x7cd140;};'use strict';var _=require('lodash');var BPromise=require(_0xa1dd('0x0'));var Redis=require(_0xa1dd('0x1'));var util=require('util');var config=require(_0xa1dd('0x2'));var logger=require(_0xa1dd('0x3'))('trigger');var cmContactRpc=require(_0xa1dd('0x4'));config['redis']=_[_0xa1dd('0x5')](config[_0xa1dd('0x6')],{'host':_0xa1dd('0x7'),'port':0x18eb});var io=require(_0xa1dd('0x8'))(new Redis(config[_0xa1dd('0x6')]));function emit(_0x2b5490,_0x281a11,_0x2a8c69,_0x4b20eb,_0x3dd9e6){logger[_0xa1dd('0x9')](_0xa1dd('0xa'),_0x2b5490,_0x281a11['id'],_0x2a8c69,_0x4b20eb,JSON['stringify'](_0x3dd9e6));io['to'](_0x2a8c69)[_0xa1dd('0xb')](_0x4b20eb,_0x3dd9e6);}exports['exec']=function(_0x344a13,_0x3ed256,_0x5922e1,_0x4cab86){var _0x295c16,_0x3f3d13;var _0x397c39={};var _0x5c83b0;var _0x2fc3de=Number(_0x5922e1[_0xa1dd('0xc')]);var _0x5ee586=_0x5922e1[_0xa1dd('0xd')]?Boolean(Number(_0x5922e1[_0xa1dd('0xd')])):![];var _0x4683db;var _0x2c2179=![];if(!_['isNil'](_0x5922e1['data5'])){if(_0x5922e1[_0xa1dd('0xe')]=='1')_0x2c2179=!![];}if(!_0x2c2179){if(_0x4cab86['xmd-contactid']){_0x397c39['id']=_0x4cab86[_0xa1dd('0xf')];}}if(!_0x397c39['id']){_0x397c39[_0xa1dd('0x10')]=_0x2fc3de;_0x4683db=_0x5922e1['data3']&&_0x5922e1[_0xa1dd('0x11')]!=='0'?_0x5922e1['data3'][_0xa1dd('0x12')](','):[_0xa1dd('0x13')];_0x397c39['$or']=_[_0xa1dd('0x14')](_0x4683db,function(_0x5b31f2){var _0x33946={};_0x33946[_0x5b31f2]=_0x4cab86['routeId']?_0x4cab86[_0xa1dd('0x15')]:_0x4cab86['calleridnum'];return _0x33946;});_0x5c83b0=_0x4cab86[_0xa1dd('0x16')]?_0x4cab86[_0xa1dd('0x15')]:_0x4cab86[_0xa1dd('0x17')];}var _0x526c11=['id',_0xa1dd('0x18'),_0xa1dd('0x19'),_0xa1dd('0x13'),_0xa1dd('0x1a'),'fax','ListId',_0xa1dd('0x1b'),'scheduledAt',_0xa1dd('0x1c')];var _0x3bafeb=_[_0xa1dd('0x1d')](_0x526c11,_0x4683db);BPromise[_0xa1dd('0x1e')]()['then'](cmContactRpc['getContacts']({'attributes':_0x3bafeb,'where':_0x397c39,'phone':_0x5c83b0}))[_0xa1dd('0x1f')](function(_0x21868d){_0x3f3d13=_0x21868d;if(!_[_0xa1dd('0x20')](_0x3f3d13)){if(_0x3f3d13[_0xa1dd('0x21')]===0x1){_0x295c16=_0x3f3d13[0x0];logger[_0xa1dd('0x9')]('[CM][%s][%s]\x20Contact\x20found:%s',_0x4cab86[_0xa1dd('0x22')],_0x3ed256['id'],_0x295c16['id']);}else{logger[_0xa1dd('0x9')](_0xa1dd('0x23'),_0x4cab86[_0xa1dd('0x22')],_0x3ed256['id'],_['map'](_0x3f3d13,'id')['join'](','));}return;}else{logger[_0xa1dd('0x9')](_0xa1dd('0x24'),_0x4cab86[_0xa1dd('0x22')],_0x3ed256['id']);var _0x5dadc8={'ListId':_0x2fc3de};var _0x13cf5b=_0x5922e1['data4']&&_0x5922e1[_0xa1dd('0x25')]!=='0'?_0x5922e1[_0xa1dd('0x25')]:_0xa1dd('0x13');if(_0x5ee586){logger[_0xa1dd('0x9')]('[CM][%s][%s]\x20Autocreate\x20enabled',_0x4cab86[_0xa1dd('0x22')],_0x3ed256['id']);_0x5dadc8[_0x13cf5b]=_[_0xa1dd('0x26')](_0x4cab86[_0xa1dd('0x16')])?_0x4cab86['calleridnum']:_0x4cab86[_0xa1dd('0x15')];if(_[_0xa1dd('0x26')](_0x4cab86[_0xa1dd('0x16')])){_0x5dadc8['firstName']=_0x4cab86['calleridname']&&_0x4cab86['calleridname']!==_0xa1dd('0x27')?_0x4cab86['calleridname']:_0xa1dd('0x28');}else{_0x5dadc8[_0xa1dd('0x18')]=_0x4cab86[_0xa1dd('0x29')]&&_0x4cab86[_0xa1dd('0x29')]!==_0xa1dd('0x27')?_0x4cab86[_0xa1dd('0x29')]:_0xa1dd('0x28');}return BPromise[_0xa1dd('0x1e')]()[_0xa1dd('0x1f')](cmContactRpc[_0xa1dd('0x2a')](_0x5dadc8))['then'](function(_0x54b176){_0x295c16=_0x54b176;_0x3f3d13[_0xa1dd('0x2b')](_0x54b176);if(_0x295c16){logger[_0xa1dd('0x9')]('[CM][%s][%s]\x20Contact\x20created:%s',_0x4cab86[_0xa1dd('0x22')],_0x3ed256['id'],_0x295c16['id']);}return;});}else{logger[_0xa1dd('0x9')]('[CM][%s][%s]\x20Autocreate\x20disabled',_0x4cab86['uniqueid'],_0x3ed256['id']);_0x5dadc8[_0x13cf5b]=_[_0xa1dd('0x26')](_0x4cab86[_0xa1dd('0x16')])?_0x4cab86[_0xa1dd('0x17')]:_0x4cab86[_0xa1dd('0x15')];if(_[_0xa1dd('0x26')](_0x4cab86[_0xa1dd('0x16')])){_0x5dadc8['firstName']=_0x4cab86[_0xa1dd('0x2c')]&&_0x4cab86[_0xa1dd('0x2c')]!==_0xa1dd('0x27')?_0x4cab86[_0xa1dd('0x2c')]:_0xa1dd('0x28');}else{_0x5dadc8[_0xa1dd('0x18')]=_0x4cab86[_0xa1dd('0x29')]&&_0x4cab86[_0xa1dd('0x29')]!==''?_0x4cab86[_0xa1dd('0x29')]:_0xa1dd('0x28');}_0x295c16=_0x5dadc8;_0x3f3d13[_0xa1dd('0x2b')](_0x5dadc8);return;}}})[_0xa1dd('0x1f')](function(){if(_0x344a13){emit(_0x4cab86[_0xa1dd('0x22')],_0x3ed256,util[_0xa1dd('0x2d')]('user:%s',_0x344a13['name']),util[_0xa1dd('0x2d')](_0xa1dd('0x2e'),_0x5922e1[_0xa1dd('0x2f')]['toLowerCase']()),{'evt':_[_0xa1dd('0x30')](_0x4cab86,{'autoCreate':_0x5ee586}),'contact':_0x295c16===undefined?{}:_0x295c16,'contacts':_0x3f3d13[_0xa1dd('0x21')]===0x0?undefined:_0x3f3d13});}});}; \ No newline at end of file +var _0x68b4=['','Unknown','destcalleridname','createContact','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','push','user:%s','name','format','trigger:%s','action','toLowerCase','merge','length','lodash','bluebird','ioredis','util','../../../../config/environment','../../../../config/logger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','info','[CM][%s][%s]','stringify','emit','data2','isNil','data5','xmd-contactid','ListId','data3','split','phone','map','routeId','destcalleridnum','calleridnum','firstName','lastName','mobile','fax','createdAt','scheduledAt','updatedAt','union','resolve','then','getContacts','[CM][%s][%s]\x20Contact\x20found:%s','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','uniqueid','calleridname'];(function(_0x4b994c,_0x524cc4){var _0x3c8f68=function(_0x775b40){while(--_0x775b40){_0x4b994c['push'](_0x4b994c['shift']());}};_0x3c8f68(++_0x524cc4);}(_0x68b4,0xff));var _0x468b=function(_0x5d2f30,_0x4df2e1){_0x5d2f30=_0x5d2f30-0x0;var _0x1040fd=_0x68b4[_0x5d2f30];return _0x1040fd;};'use strict';var _=require(_0x468b('0x0'));var BPromise=require(_0x468b('0x1'));var Redis=require(_0x468b('0x2'));var util=require(_0x468b('0x3'));var config=require(_0x468b('0x4'));var logger=require(_0x468b('0x5'))('trigger');var cmContactRpc=require(_0x468b('0x6'));config[_0x468b('0x7')]=_[_0x468b('0x8')](config[_0x468b('0x7')],{'host':_0x468b('0x9'),'port':0x18eb});var io=require(_0x468b('0xa'))(new Redis(config[_0x468b('0x7')]));function emit(_0x64d62e,_0x25ed63,_0x281e5e,_0x43328a,_0x4e9916){logger[_0x468b('0xb')](_0x468b('0xc'),_0x64d62e,_0x25ed63['id'],_0x281e5e,_0x43328a,JSON[_0x468b('0xd')](_0x4e9916));io['to'](_0x281e5e)[_0x468b('0xe')](_0x43328a,_0x4e9916);}exports['exec']=function(_0x242d88,_0x515aef,_0x1154b8,_0x1708b1){var _0x5ea38d,_0x1b8032;var _0x21adbd={};var _0x5e6eb0;var _0x198b92=Number(_0x1154b8['data1']);var _0x1933c1=_0x1154b8[_0x468b('0xf')]?Boolean(Number(_0x1154b8['data2'])):![];var _0x38335d;var _0x3b6809=![];if(!_[_0x468b('0x10')](_0x1154b8['data5'])){if(_0x1154b8[_0x468b('0x11')]=='1')_0x3b6809=!![];}if(!_0x3b6809){if(_0x1708b1[_0x468b('0x12')]){_0x21adbd['id']=_0x1708b1[_0x468b('0x12')];}}if(!_0x21adbd['id']){_0x21adbd[_0x468b('0x13')]=_0x198b92;_0x38335d=_0x1154b8['data3']&&_0x1154b8['data3']!=='0'?_0x1154b8[_0x468b('0x14')][_0x468b('0x15')](','):[_0x468b('0x16')];_0x21adbd['$or']=_[_0x468b('0x17')](_0x38335d,function(_0x436f27){var _0x28308f={};_0x28308f[_0x436f27]=_0x1708b1[_0x468b('0x18')]?_0x1708b1[_0x468b('0x19')]:_0x1708b1[_0x468b('0x1a')];return _0x28308f;});_0x5e6eb0=_0x1708b1[_0x468b('0x18')]?_0x1708b1[_0x468b('0x19')]:_0x1708b1['calleridnum'];}var _0xc1ec7d=['id',_0x468b('0x1b'),_0x468b('0x1c'),_0x468b('0x16'),_0x468b('0x1d'),_0x468b('0x1e'),_0x468b('0x13'),_0x468b('0x1f'),_0x468b('0x20'),_0x468b('0x21')];var _0x3a7500=_[_0x468b('0x22')](_0xc1ec7d,_0x38335d);BPromise[_0x468b('0x23')]()[_0x468b('0x24')](cmContactRpc[_0x468b('0x25')]({'attributes':_0x3a7500,'where':_0x21adbd,'phone':_0x5e6eb0}))['then'](function(_0x283a85){_0x1b8032=_0x283a85;if(!_['isEmpty'](_0x1b8032)){if(_0x1b8032['length']===0x1){_0x5ea38d=_0x1b8032[0x0];logger['info'](_0x468b('0x26'),_0x1708b1['uniqueid'],_0x515aef['id'],_0x5ea38d['id']);}else{logger[_0x468b('0xb')](_0x468b('0x27'),_0x1708b1['uniqueid'],_0x515aef['id'],_['map'](_0x1b8032,'id')[_0x468b('0x28')](','));}return;}else{logger[_0x468b('0xb')](_0x468b('0x29'),_0x1708b1['uniqueid'],_0x515aef['id']);var _0x11fa41={'ListId':_0x198b92};var _0x49c137=_0x1154b8[_0x468b('0x2a')]&&_0x1154b8[_0x468b('0x2a')]!=='0'?_0x1154b8[_0x468b('0x2a')]:_0x468b('0x16');if(_0x1933c1){logger[_0x468b('0xb')]('[CM][%s][%s]\x20Autocreate\x20enabled',_0x1708b1[_0x468b('0x2b')],_0x515aef['id']);_0x11fa41[_0x49c137]=_[_0x468b('0x10')](_0x1708b1[_0x468b('0x18')])?_0x1708b1['calleridnum']:_0x1708b1[_0x468b('0x19')];if(_[_0x468b('0x10')](_0x1708b1[_0x468b('0x18')])){_0x11fa41['firstName']=_0x1708b1[_0x468b('0x2c')]&&_0x1708b1[_0x468b('0x2c')]!==_0x468b('0x2d')?_0x1708b1[_0x468b('0x2c')]:_0x468b('0x2e');}else{_0x11fa41['firstName']=_0x1708b1[_0x468b('0x2f')]&&_0x1708b1[_0x468b('0x2f')]!==_0x468b('0x2d')?_0x1708b1['destcalleridname']:_0x468b('0x2e');}return BPromise[_0x468b('0x23')]()[_0x468b('0x24')](cmContactRpc[_0x468b('0x30')](_0x11fa41))[_0x468b('0x24')](function(_0x1faf0e){_0x5ea38d=_0x1faf0e;_0x1b8032['push'](_0x1faf0e);if(_0x5ea38d){logger['info'](_0x468b('0x31'),_0x1708b1[_0x468b('0x2b')],_0x515aef['id'],_0x5ea38d['id']);}return;});}else{logger['info'](_0x468b('0x32'),_0x1708b1['uniqueid'],_0x515aef['id']);_0x11fa41[_0x49c137]=_[_0x468b('0x10')](_0x1708b1['routeId'])?_0x1708b1[_0x468b('0x1a')]:_0x1708b1[_0x468b('0x19')];if(_['isNil'](_0x1708b1['routeId'])){_0x11fa41[_0x468b('0x1b')]=_0x1708b1[_0x468b('0x2c')]&&_0x1708b1['calleridname']!==''?_0x1708b1[_0x468b('0x2c')]:_0x468b('0x2e');}else{_0x11fa41[_0x468b('0x1b')]=_0x1708b1['destcalleridname']&&_0x1708b1['destcalleridname']!==_0x468b('0x2d')?_0x1708b1['destcalleridname']:_0x468b('0x2e');}_0x5ea38d=_0x11fa41;_0x1b8032[_0x468b('0x33')](_0x11fa41);return;}}})[_0x468b('0x24')](function(){if(_0x242d88){emit(_0x1708b1[_0x468b('0x2b')],_0x515aef,util['format'](_0x468b('0x34'),_0x242d88[_0x468b('0x35')]),util[_0x468b('0x36')](_0x468b('0x37'),_0x1154b8[_0x468b('0x38')][_0x468b('0x39')]()),{'evt':_[_0x468b('0x3a')](_0x1708b1,{'autoCreate':_0x1933c1}),'contact':_0x5ea38d===undefined?{}:_0x5ea38d,'contacts':_0x1b8032[_0x468b('0x3b')]===0x0?undefined:_0x1b8032});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 2c0dfcc..2de1c01 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 _0xe070=['freshsalesAccounts','custom:agentcalled','custom:agentconnect','syncCustomEvent','bind','custom:agentringnoanswer','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialend','custom:newinteraction','custom:substatus','custom:incomingmessage','custom:rejectmessage','custom:offlineMessage','prototype','info','stringify','emit','motionChannel','voice','inspect','checkTriggers','interface','hasOwnProperty','checkTrigger','merge','variables','Actions','length','toLowerCase','contactmanager','motionbar','browser','data1','data2','templates','render','html','template\x20not\x20found','data3','isNil','data4','location','uriLocation','windowWidth','data5','800','data6','600','winApplication','winArguments','format','user:%s','name','trigger:%s:%s','action','trigger:%s','exec','integration','accounts','voiceQueues','queue','routeId','urlforward','script','query','search','replace','channel','AllConditions','checkConditions','AnyConditions','some','debug','checkTrigger:\x20trigger','evt','field','ChatWebsiteId','value','upperFirst','operator','message','event','agent','membername','lastevent','mailSubstatus','null','undefined','substatus','offlineMessage','created','equals','util','lodash','url','mustache','ioredis','./urlforward','./integration','../../../config/environment','trigger','../ami','redis','defaults','localhost','socket.io-emitter','popup','winapp','triggers','agents','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts'];(function(_0x338782,_0x608258){var _0x3555ee=function(_0xd9b657){while(--_0xd9b657){_0x338782['push'](_0x338782['shift']());}};_0x3555ee(++_0x608258);}(_0xe070,0x167));var _0x0e07=function(_0x125233,_0x522bf1){_0x125233=_0x125233-0x0;var _0x42d385=_0xe070[_0x125233];return _0x42d385;};'use strict';var util=require(_0x0e07('0x0'));var _=require(_0x0e07('0x1'));var url=require(_0x0e07('0x2'));var Mustache=require(_0x0e07('0x3'));var Redis=require(_0x0e07('0x4'));var urlforward=require(_0x0e07('0x5'));var integration=require(_0x0e07('0x6'));var cmContact=require('./cmContact');var script=require('./script');var config=require(_0x0e07('0x7'));var logger=require('../../../config/logger')(_0x0e07('0x8'));var ami=require(_0x0e07('0x9'));config[_0x0e07('0xa')]=_[_0x0e07('0xb')](config[_0x0e07('0xa')],{'host':_0x0e07('0xc'),'port':0x18eb});var io=require(_0x0e07('0xd'))(new Redis(config[_0x0e07('0xa')]));var operators={'equals':function(_0x5a96cc,_0x21ed7f){return _0x5a96cc==_0x21ed7f;},'not_equals':function(_0x5d034b,_0x1aeb97){return _0x5d034b!=_0x1aeb97;}};var barAndWebActions=[_0x0e07('0xe'),_0x0e07('0x2'),_0x0e07('0xf')];function Trigger(_0x854061){this[_0x0e07('0x10')]=_0x854061['triggers'];this[_0x0e07('0x11')]=_0x854061['agents'];this['voiceQueues']=_0x854061['voiceQueues'];this['templates']=_0x854061['templates'];this['voiceExtensions']=_0x854061[_0x0e07('0x12')];this[_0x0e07('0x13')]=_0x854061[_0x0e07('0x13')];this['freshdeskAccounts']=_0x854061[_0x0e07('0x14')];this[_0x0e07('0x15')]=_0x854061['salesforceAccounts'];this[_0x0e07('0x16')]=_0x854061[_0x0e07('0x16')];this[_0x0e07('0x17')]=_0x854061[_0x0e07('0x17')];this[_0x0e07('0x18')]=_0x854061[_0x0e07('0x18')];this[_0x0e07('0x19')]=_0x854061[_0x0e07('0x19')];this[_0x0e07('0x1a')]=_0x854061[_0x0e07('0x1a')];this[_0x0e07('0x1b')]=_0x854061[_0x0e07('0x1b')];this[_0x0e07('0x1c')]=_0x854061['freshsalesAccounts'];this['accounts']={'zendesk':this[_0x0e07('0x13')],'salesforce':this['salesforceAccounts'],'freshdesk':this[_0x0e07('0x14')],'sugarcrm':this['sugarcrmAccounts'],'zoho':this[_0x0e07('0x17')],'desk':this[_0x0e07('0x18')],'vtiger':this['vtigerAccounts'],'dynamics365':this[_0x0e07('0x1b')],'freshsales':this[_0x0e07('0x1c')],'servicenow':this['servicenowAccounts']};ami['on'](_0x0e07('0x1d'),this['syncCustomEvent']['bind'](this));ami['on'](_0x0e07('0x1e'),this[_0x0e07('0x1f')][_0x0e07('0x20')](this));ami['on'](_0x0e07('0x21'),this['syncCustomEvent'][_0x0e07('0x20')](this));ami['on']('custom:agentcomplete',this[_0x0e07('0x1f')]['bind'](this));ami['on'](_0x0e07('0x22'),this['syncCustomEvent'][_0x0e07('0x20')](this));ami['on'](_0x0e07('0x23'),this[_0x0e07('0x1f')][_0x0e07('0x20')](this));ami['on'](_0x0e07('0x24'),this[_0x0e07('0x1f')][_0x0e07('0x20')](this));ami['on'](_0x0e07('0x25'),this[_0x0e07('0x1f')][_0x0e07('0x20')](this));ami['on'](_0x0e07('0x26'),this[_0x0e07('0x1f')][_0x0e07('0x20')](this));ami['on'](_0x0e07('0x27'),this[_0x0e07('0x1f')][_0x0e07('0x20')](this));ami['on'](_0x0e07('0x28'),this[_0x0e07('0x1f')][_0x0e07('0x20')](this));ami['on'](_0x0e07('0x29'),this[_0x0e07('0x1f')][_0x0e07('0x20')](this));ami['on'](_0x0e07('0x2a'),this[_0x0e07('0x2b')][_0x0e07('0x20')](this));ami['on']('custom:dialconnect',this['syncAgentDial'][_0x0e07('0x20')](this));ami['on'](_0x0e07('0x2c'),this[_0x0e07('0x2b')][_0x0e07('0x20')](this));ami['on'](_0x0e07('0x2d'),this[_0x0e07('0x1f')][_0x0e07('0x20')](this));ami['on']('custom:closedinteraction',this[_0x0e07('0x1f')][_0x0e07('0x20')](this));ami['on'](_0x0e07('0x2e'),this[_0x0e07('0x1f')][_0x0e07('0x20')](this));ami['on'](_0x0e07('0x2f'),this[_0x0e07('0x1f')]['bind'](this));ami['on']('custom:outgoingmessage',this['syncCustomEvent']['bind'](this));ami['on']('custom:acceptmessage',this['syncCustomEvent'][_0x0e07('0x20')](this));ami['on'](_0x0e07('0x30'),this[_0x0e07('0x1f')][_0x0e07('0x20')](this));ami['on'](_0x0e07('0x31'),this[_0x0e07('0x1f')]['bind'](this));}Trigger[_0x0e07('0x32')]['emit']=function(_0x5a403f,_0x9e3cb5,_0x4054b2){logger[_0x0e07('0x33')](_0x5a403f,_0x9e3cb5,JSON[_0x0e07('0x34')](_0x4054b2));io['to'](_0x5a403f)[_0x0e07('0x35')](_0x9e3cb5,_0x4054b2);};Trigger[_0x0e07('0x32')][_0x0e07('0x1f')]=function(_0xafe58d){var _0x17fe77=_['clone'](_0xafe58d);if(typeof _0x17fe77[_0x0e07('0x36')]==='undefined'){_0x17fe77['motionChannel']=_0x0e07('0x37');}logger['debug']('syncCustomEvent',util[_0x0e07('0x38')](_0x17fe77,{'showHidden':!![],'depth':null}));this[_0x0e07('0x39')](_0x17fe77);};Trigger[_0x0e07('0x32')][_0x0e07('0x2b')]=function(_0x25d033){if(this['agents'][_0x25d033[_0x0e07('0x3a')]]){this[_0x0e07('0x1f')](_0x25d033);}};Trigger[_0x0e07('0x32')][_0x0e07('0x39')]=function(_0x3cd74a){var _0x4ba473;for(var _0x1adf34 in this[_0x0e07('0x10')]){if(this[_0x0e07('0x10')][_0x0e07('0x3b')](_0x1adf34)){if(this['triggers'][_0x1adf34]['status']){_0x4ba473=this[_0x0e07('0x3c')](this[_0x0e07('0x10')][_0x1adf34],_0x3cd74a);if(_0x4ba473){_[_0x0e07('0x3d')](_0x3cd74a,_0x3cd74a[_0x0e07('0x3e')]);for(var _0x37a93f=0x0,_0xec4b44,_0x33ec73,_0x425f95;_0x37a93f0x0){_0x328a08=_[_0xb814('0x2c')](_0x5a6291,_0x271aa8);}return _0x328a08;}function getCustomFields(_0x37d24d,_0x530744){var _0x499f22=[];var _0x20577b={'custom_fields':{}};if(_0x37d24d[_0xb814('0x2d')]>0x0){_['forEach'](_0x37d24d,function(_0x338a28){if(_['includes']([_0xb814('0x2e'),'picklist'],_0x338a28['type'])&&_0x338a28[_0xb814('0x2f')]&&!_0x338a28['customField']){_0x20577b[_0x338a28[_0xb814('0x2f')][_0xb814('0x30')]()]=_0x338a28[_0xb814('0x31')]['toString']();}else if(_['includes']([_0xb814('0x2e'),_0xb814('0x32')],_0x338a28['type'])&&_0x338a28[_0xb814('0x33')]&&_0x338a28[_0xb814('0x34')]){_0x20577b[_0xb814('0x35')][_0x338a28[_0xb814('0x33')]]=_0x338a28[_0xb814('0x31')][_0xb814('0x23')]();}else if(_0x338a28[_0xb814('0x36')]==='variable'&&_0x338a28[_0xb814('0x37')]&&_0x338a28[_0xb814('0x33')]&&_0x338a28[_0xb814('0x34')]){_0x530744[_0x338a28[_0xb814('0x37')]]&&(_0x20577b[_0xb814('0x35')][_0x338a28['idField']]=_0x530744[_0x338a28[_0xb814('0x37')]]['toString']());}else if(_0x338a28[_0xb814('0x36')]===_0xb814('0x38')&&_0x338a28[_0xb814('0x39')]&&_0x338a28['Variable'][_0xb814('0x3a')]&&_0x338a28[_0xb814('0x33')]&&_0x338a28['customField']){_0x530744[_0x338a28[_0xb814('0x39')][_0xb814('0x3a')][_0xb814('0x30')]()]&&(_0x20577b[_0xb814('0x35')][_0x338a28[_0xb814('0x33')]]=_0x530744[_0x338a28[_0xb814('0x39')]['name'][_0xb814('0x30')]()]['toString']());}});}if(_0x20577b[_0xb814('0x3b')]){_0x20577b['priority']=Number(_0x20577b[_0xb814('0x3b')]);}return _0x20577b;}function getTicket(_0x4b9233,_0x2f8a2e,_0x26675a,_0x54a7fb,_0x4d308a){logger['info']('Creating\x20new\x20ticket...');var _0x17549e=_[_0xb814('0x3c')]({'subject':intUtil[_0xb814('0x3d')](_0x54a7fb[_0xb814('0x3e')],_0x4d308a,'\x20'),'type':'phone','status':'new','labels':[_0xb814('0x3f'),'Motion',_0xb814('0x40')][_0xb814('0x41')](getTags(_0x54a7fb[_0xb814('0x42')],_0xb814('0x3a'))),'description':intUtil[_0xb814('0x3d')](_0x54a7fb[_0xb814('0x43')],_0x4d308a,'\x0a'),'_links':{'assigned_user':{'href':util[_0xb814('0x10')](_0xb814('0x44'),_0x2f8a2e['id']),'class':_0xb814('0x45')}},'message':{'direction':'in','body':intUtil['getString'](_0x54a7fb['Descriptions'],_0x4d308a,'\x0a')}},getCustomFields(_0x54a7fb['Fields'],_0x4d308a));return request({'uri':util[_0xb814('0x10')]('%s/customers/%d/cases',_0x4b9233[_0xb814('0x1a')],_0x26675a['id']),'method':'POST','body':_0x17549e});}exports[_0xb814('0x46')]=function(_0x44ff56,_0x9ef639,_0x2e97cc,_0x4fae23,_0x30fc57,_0x15f01a){var _0x2b23c7,_0x22cf27;_0x15f01a[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x15f01a['remoteUri']);_0x15f01a[_0xb814('0x48')]=intUtil[_0xb814('0x47')](_0x15f01a[_0xb814('0x48')]);if(_0x30fc57&&_0x30fc57[_0xb814('0x49')]){logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x4b'));_0x9ef639['recordingURL']=util['format'](_0xb814('0x4c'),_0x15f01a[_0xb814('0x48')],_0x9ef639[_0xb814('0x4d')],md5(_0x9ef639[_0xb814('0x4d')]));}else{_0x9ef639[_0xb814('0x4e')]='';}headers[_0xb814('0x4f')]=getAuth(_0x15f01a);return getUser(_0x15f01a,_0x4fae23[_0xb814('0x50')])[_0xb814('0x12')](function(_0x2eb9b6){_0x2b23c7=_0x2eb9b6;logger[_0xb814('0xe')](_0xb814('0x51'),_0x2b23c7['id']);return getEndUser(_0x15f01a,_0x9ef639['calleridname'],_0x9ef639[_0xb814('0x52')]);})[_0xb814('0x12')](function(_0x4a76bb){_0x22cf27=_0x4a76bb;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x22cf27['id']);return getTicket(_0x15f01a,_0x2b23c7,_0x22cf27,_0x2e97cc,_0x9ef639);})[_0xb814('0x12')](function(_0x37866f){if(_0x37866f){logger[_0xb814('0xe')](_0xb814('0x53'));logger[_0xb814('0xe')](_0xb814('0x54'),_0x37866f['id']);switch(_0x15f01a[_0xb814('0x36')]){case _0xb814('0x55'):logger[_0xb814('0xe')](_0xb814('0x4a'),'Displaying\x20ticket\x20to\x20agent...');emit(util['format'](_0xb814('0x56'),_0x4fae23[_0xb814('0x3a')]),_0xb814('0x57'),{'recordId':_0x37866f['id']});break;case _0xb814('0x58'):logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x59'));emit(util['format'](_0xb814('0x56'),_0x4fae23[_0xb814('0x3a')]),_0xb814('0x5a'),{'uri':util['format'](_0xb814('0x5b'),_0x37866f['id'])});break;default:logger['error'](_0xb814('0x4a'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0xb814('0x5c')](function(_0x3cf8f8){console['error'](_0x3cf8f8);logger[_0xb814('0x5d')](_0xb814('0x4a'),JSON[_0xb814('0x5e')](_0x3cf8f8));});};exports['outbound']=function(_0x3da050,_0x5f0e58,_0x13bdcf,_0x158893,_0x4aed78,_0x39952d,_0x4a3f84){var _0x539be7,_0x3b9709;_0x39952d[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x39952d['remoteUri']);_0x39952d[_0xb814('0x48')]=intUtil['stripTrailingSlash'](_0x39952d[_0xb814('0x48')]);if(_0x4a3f84&&_0x4a3f84[_0xb814('0x5f')]&&_0x4a3f84['recordingFormat']!==_0xb814('0x60')){logger['info'](_0xb814('0x61'),_0xb814('0x4b'));_0x5f0e58[_0xb814('0x4e')]=util[_0xb814('0x10')](_0xb814('0x4c'),_0x39952d[_0xb814('0x48')],_0x5f0e58[_0xb814('0x4d')],md5(_0x5f0e58[_0xb814('0x4d')]));}headers['Authorization']=getAuth(_0x39952d);return getUser(_0x39952d,_0x158893[_0xb814('0x50')])[_0xb814('0x12')](function(_0x5d71d5){_0x539be7=_0x5d71d5;logger[_0xb814('0xe')](_0xb814('0x51'),_0x539be7['id']);return getEndUser(_0x39952d,_0x5f0e58['destcalleridname'],_0x5f0e58[_0xb814('0x62')]);})['then'](function(_0x48362c){_0x3b9709=_0x48362c;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x3b9709['id']);return getTicket(_0x39952d,_0x539be7,_0x3b9709,_0x13bdcf,_0x5f0e58);})[_0xb814('0x12')](function(_0xd1cd8b){if(_0xd1cd8b){logger[_0xb814('0xe')]('Ticket\x20created!');logger[_0xb814('0xe')]('The\x20Ticket\x20ID\x20is:',_0xd1cd8b['id']);switch(_0x39952d[_0xb814('0x36')]){case _0xb814('0x55'):logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x63'));emit(util[_0xb814('0x10')](_0xb814('0x56'),_0x158893[_0xb814('0x3a')]),_0xb814('0x57'),{'recordId':_0xd1cd8b['id']});break;case'newTab':logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x59'));emit(util[_0xb814('0x10')](_0xb814('0x56'),_0x158893[_0xb814('0x3a')]),'trigger:browser:url',{'uri':util[_0xb814('0x10')]('%s/agent/tickets/%s',_0x39952d[_0xb814('0x1a')],_0xd1cd8b['id'])});break;default:logger[_0xb814('0x5d')](_0xb814('0x61'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0xb814('0x5c')](function(_0x579351){logger[_0xb814('0x5d')]('[OUTBOUND]',JSON[_0xb814('0x5e')](_0x579351));});};exports[_0xb814('0x64')]=function(_0xa03cd2,_0x1b024f,_0x3377d4,_0x167d82,_0x143518,_0x4d44e3){var _0x44088d,_0x51ca51;_0x4d44e3[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x4d44e3[_0xb814('0x1a')]);_0x4d44e3[_0xb814('0x48')]=intUtil[_0xb814('0x47')](_0x4d44e3[_0xb814('0x48')]);if(_0x143518&&_0x143518['monitor_format']){logger[_0xb814('0xe')]('['+_0x1b024f[_0xb814('0x65')]['toUpperCase']()+']',_0xb814('0x4b'));_0x1b024f[_0xb814('0x4e')]=util[_0xb814('0x10')](_0xb814('0x4c'),_0x4d44e3[_0xb814('0x48')],_0x1b024f['uniqueid'],md5(_0x1b024f[_0xb814('0x4d')]));}else{_0x1b024f['recordingURL']='';}headers[_0xb814('0x4f')]=getAuth(_0x4d44e3);return getUser(_0x4d44e3)[_0xb814('0x12')](function(_0x2645f6){_0x44088d=_0x2645f6;logger[_0xb814('0xe')](_0xb814('0x51'),_0x44088d['id']);return getEndUser(_0x4d44e3,_0x1b024f[_0xb814('0x66')],_0x1b024f['calleridnum']);})['then'](function(_0x5d064b){_0x51ca51=_0x5d064b;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x51ca51['id']);return getTicket(_0x4d44e3,_0x44088d,_0x51ca51,_0x3377d4,_0x1b024f);})[_0xb814('0x12')](function(_0x1d3954){if(_0x1d3954){logger[_0xb814('0xe')]('Ticket\x20created!');logger[_0xb814('0xe')](_0xb814('0x54'),_0x1d3954['id']);}})[_0xb814('0x5c')](function(_0x5aabbe){logger[_0xb814('0x5d')]('['+_0x1b024f[_0xb814('0x65')][_0xb814('0x67')]()+']',JSON[_0xb814('0x5e')](_0x5aabbe));});}; \ No newline at end of file +var _0x3e74=['customField','content','idField','custom_fields','variable','variableName','name','Variable','toLowerCase','priority','Creating\x20new\x20ticket...','getString','phone','new','xCALLY','Motion','CTI','concat','Descriptions','/api/v2/users/%d','user','Fields','%s/customers/%d/cases','stripTrailingSlash','serverUrl','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','integrationTab','user:%s','newTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','https://xcally.desk.com/web/agent/case/%d','error','Desk\x20account\x20type\x20not\x20recognized','catch','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridnum','The\x20Enduser\x20ID\x20is:','trigger:desk:display','trigger:browser:url','%s/agent/tickets/%s','stringify','unmanaged','monitor_format','lastevent','toUpperCase','calleridnum','lodash','md5','util','ioredis','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','Getting\x20agent\x20with\x20email','%s/users','then','find','_embedded','entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','remoteUri','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','format','debug','[HTTP]','GET','authType','basic','%s:%s','username','password','token','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','total_entries','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','length','forEach','includes','string','picklist','type','nameField'];(function(_0x31359b,_0x4cc80c){var _0x480f17=function(_0x1e4d51){while(--_0x1e4d51){_0x31359b['push'](_0x31359b['shift']());}};_0x480f17(++_0x4cc80c);}(_0x3e74,0x175));var _0x43e7=function(_0x5c00d8,_0x480c89){_0x5c00d8=_0x5c00d8-0x0;var _0x124c7e=_0x3e74[_0x5c00d8];return _0x124c7e;};'use strict';var _=require(_0x43e7('0x0'));var rp=require('request-promise');var md5=require(_0x43e7('0x1'));var util=require(_0x43e7('0x2'));var Redis=require(_0x43e7('0x3'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x43e7('0x4'))('desk');config[_0x43e7('0x5')]=_[_0x43e7('0x6')](config[_0x43e7('0x5')],{'host':_0x43e7('0x7'),'port':0x18eb});var io=require(_0x43e7('0x8'))(new Redis(config['redis']));function emit(_0x45a0d1,_0x3491d6,_0x2ede2d){io['to'](_0x45a0d1)[_0x43e7('0x9')](_0x3491d6,_0x2ede2d);}var headers={'Content-Type':_0x43e7('0xa'),'Accept':'application/json'};function getUser(_0x212c6c,_0x554d44){if(intUtil['validateEmail'](_0x554d44)===!![]){logger[_0x43e7('0xb')](_0x43e7('0xc'),_0x554d44);return request({'uri':util['format'](_0x43e7('0xd'),_0x212c6c['remoteUri'])})[_0x43e7('0xe')](function(_0x37302c){if(_0x37302c['total_entries']){return _[_0x43e7('0xf')](_0x37302c[_0x43e7('0x10')][_0x43e7('0x11')],{'email':_0x554d44});}})[_0x43e7('0xe')](function(_0x4e008c){if(_0x4e008c){logger['info'](_0x43e7('0x12'));return _0x4e008c;}else{logger[_0x43e7('0xb')](_0x43e7('0x13'));return request({'uri':util['format']('%s/users/me',_0x212c6c[_0x43e7('0x14')])});}});}else{logger[_0x43e7('0xb')](_0x43e7('0x15'));return request({'uri':util[_0x43e7('0x16')]('%s/users/me',_0x212c6c['remoteUri'])});}}function request(_0xdf16c){logger[_0x43e7('0x17')](_0x43e7('0x18'),JSON['stringify'](_0xdf16c));return rp(_['defaults'](_0xdf16c,{'method':_0x43e7('0x19'),'headers':headers,'json':!![]}));}function getAuth(_0x1ca758){var _0x9037d3;if(_0x1ca758[_0x43e7('0x1a')]===_0x43e7('0x1b')){_0x9037d3=util[_0x43e7('0x16')](_0x43e7('0x1c'),_0x1ca758[_0x43e7('0x1d')],_0x1ca758[_0x43e7('0x1e')]);}else if(_0x1ca758[_0x43e7('0x1a')]===_0x43e7('0x1f')){_0x9037d3=util[_0x43e7('0x16')]('%s/token:%s',_0x1ca758[_0x43e7('0x1d')],_0x1ca758[_0x43e7('0x1f')]);}return util['format'](_0x43e7('0x20'),new Buffer(_0x9037d3)[_0x43e7('0x21')](_0x43e7('0x22')));}function getEndUser(_0x28aacc,_0x4077fb,_0x2f4cb4){logger['info'](_0x43e7('0x23'),_0x2f4cb4);return request({'uri':util['format']('%s/customers/search',_0x28aacc[_0x43e7('0x14')]),'qs':{'phone':_0x2f4cb4}})[_0x43e7('0xe')](function(_0x4b2b9f){if(_0x4b2b9f[_0x43e7('0x24')]){logger['info'](_0x43e7('0x25'));return _0x4b2b9f['_embedded'][_0x43e7('0x11')][0x0];}else{logger[_0x43e7('0xb')](_0x43e7('0x26'));return request({'uri':util[_0x43e7('0x16')]('%s/customers',_0x28aacc['remoteUri']),'method':_0x43e7('0x27'),'body':{'first_name':_0x4077fb,'title':_0x4077fb,'phone_numbers':[{'type':'work','value':_0x2f4cb4}]}});}});}function getTags(_0x2dd5f,_0x40dc8f){var _0x3565cf=[];if(_0x2dd5f&&_0x2dd5f[_0x43e7('0x28')]>0x0){_0x3565cf=_['map'](_0x2dd5f,_0x40dc8f);}return _0x3565cf;}function getCustomFields(_0x33a1a5,_0x4690a6){var _0x45b675=[];var _0x50f9f5={'custom_fields':{}};if(_0x33a1a5[_0x43e7('0x28')]>0x0){_[_0x43e7('0x29')](_0x33a1a5,function(_0x2b85a5){if(_[_0x43e7('0x2a')]([_0x43e7('0x2b'),_0x43e7('0x2c')],_0x2b85a5[_0x43e7('0x2d')])&&_0x2b85a5[_0x43e7('0x2e')]&&!_0x2b85a5[_0x43e7('0x2f')]){_0x50f9f5[_0x2b85a5[_0x43e7('0x2e')]['toLowerCase']()]=_0x2b85a5[_0x43e7('0x30')][_0x43e7('0x21')]();}else if(_[_0x43e7('0x2a')]([_0x43e7('0x2b'),_0x43e7('0x2c')],_0x2b85a5['type'])&&_0x2b85a5[_0x43e7('0x31')]&&_0x2b85a5[_0x43e7('0x2f')]){_0x50f9f5[_0x43e7('0x32')][_0x2b85a5[_0x43e7('0x31')]]=_0x2b85a5['content']['toString']();}else if(_0x2b85a5['type']===_0x43e7('0x33')&&_0x2b85a5[_0x43e7('0x34')]&&_0x2b85a5[_0x43e7('0x31')]&&_0x2b85a5[_0x43e7('0x2f')]){_0x4690a6[_0x2b85a5[_0x43e7('0x34')]]&&(_0x50f9f5[_0x43e7('0x32')][_0x2b85a5['idField']]=_0x4690a6[_0x2b85a5['variableName']]['toString']());}else if(_0x2b85a5['type']==='customVariable'&&_0x2b85a5['Variable']&&_0x2b85a5['Variable'][_0x43e7('0x35')]&&_0x2b85a5['idField']&&_0x2b85a5[_0x43e7('0x2f')]){_0x4690a6[_0x2b85a5[_0x43e7('0x36')][_0x43e7('0x35')][_0x43e7('0x37')]()]&&(_0x50f9f5[_0x43e7('0x32')][_0x2b85a5[_0x43e7('0x31')]]=_0x4690a6[_0x2b85a5[_0x43e7('0x36')]['name']['toLowerCase']()]['toString']());}});}if(_0x50f9f5[_0x43e7('0x38')]){_0x50f9f5[_0x43e7('0x38')]=Number(_0x50f9f5[_0x43e7('0x38')]);}return _0x50f9f5;}function getTicket(_0x16cdba,_0x1b1440,_0x1ed538,_0x1d4589,_0x2ffd43){logger['info'](_0x43e7('0x39'));var _0x2b0ffe=_['merge']({'subject':intUtil[_0x43e7('0x3a')](_0x1d4589['Subjects'],_0x2ffd43,'\x20'),'type':_0x43e7('0x3b'),'status':_0x43e7('0x3c'),'labels':[_0x43e7('0x3d'),_0x43e7('0x3e'),_0x43e7('0x3f')][_0x43e7('0x40')](getTags(_0x1d4589['Tags'],'name')),'description':intUtil[_0x43e7('0x3a')](_0x1d4589[_0x43e7('0x41')],_0x2ffd43,'\x0a'),'_links':{'assigned_user':{'href':util[_0x43e7('0x16')](_0x43e7('0x42'),_0x1b1440['id']),'class':_0x43e7('0x43')}},'message':{'direction':'in','body':intUtil['getString'](_0x1d4589[_0x43e7('0x41')],_0x2ffd43,'\x0a')}},getCustomFields(_0x1d4589[_0x43e7('0x44')],_0x2ffd43));return request({'uri':util['format'](_0x43e7('0x45'),_0x16cdba['remoteUri'],_0x1ed538['id']),'method':_0x43e7('0x27'),'body':_0x2b0ffe});}exports['queue']=function(_0x3d81ae,_0x3b4235,_0x3a5807,_0x1c2c6b,_0x49b866,_0x47d6a1){var _0x103393,_0x40c509;_0x47d6a1[_0x43e7('0x14')]=intUtil[_0x43e7('0x46')](_0x47d6a1['remoteUri']);_0x47d6a1['serverUrl']=intUtil['stripTrailingSlash'](_0x47d6a1[_0x43e7('0x47')]);if(_0x49b866&&_0x49b866['monitor_format']){logger[_0x43e7('0xb')]('[QUEUE]','Recording\x20is\x20enabled!');_0x3b4235[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x47d6a1[_0x43e7('0x47')],_0x3b4235[_0x43e7('0x4a')],md5(_0x3b4235[_0x43e7('0x4a')]));}else{_0x3b4235['recordingURL']='';}headers[_0x43e7('0x4b')]=getAuth(_0x47d6a1);return getUser(_0x47d6a1,_0x1c2c6b[_0x43e7('0x4c')])[_0x43e7('0xe')](function(_0x1fd277){_0x103393=_0x1fd277;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0x103393['id']);return getEndUser(_0x47d6a1,_0x3b4235['calleridname'],_0x3b4235['calleridnum']);})[_0x43e7('0xe')](function(_0x36a09e){_0x40c509=_0x36a09e;logger[_0x43e7('0xb')]('The\x20Enduser\x20ID\x20is:',_0x40c509['id']);return getTicket(_0x47d6a1,_0x103393,_0x40c509,_0x3a5807,_0x3b4235);})['then'](function(_0x56489b){if(_0x56489b){logger[_0x43e7('0xb')](_0x43e7('0x4e'));logger['info'](_0x43e7('0x4f'),_0x56489b['id']);switch(_0x47d6a1[_0x43e7('0x2d')]){case _0x43e7('0x50'):logger['info']('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');emit(util['format'](_0x43e7('0x51'),_0x1c2c6b[_0x43e7('0x35')]),'trigger:desk:display',{'recordId':_0x56489b['id']});break;case _0x43e7('0x52'):logger[_0x43e7('0xb')](_0x43e7('0x53'),_0x43e7('0x54'));emit(util['format'](_0x43e7('0x51'),_0x1c2c6b['name']),'trigger:browser:url',{'uri':util[_0x43e7('0x16')](_0x43e7('0x55'),_0x56489b['id'])});break;default:logger[_0x43e7('0x56')](_0x43e7('0x53'),_0x43e7('0x57'));}}})[_0x43e7('0x58')](function(_0x1cd87c){console[_0x43e7('0x56')](_0x1cd87c);logger[_0x43e7('0x56')](_0x43e7('0x53'),JSON['stringify'](_0x1cd87c));});};exports[_0x43e7('0x59')]=function(_0x46c910,_0x499c03,_0x39e3ca,_0x4e6f6d,_0x35b799,_0x520857,_0x34e2ec){var _0x1f561f,_0xfe13fa;_0x520857['remoteUri']=intUtil['stripTrailingSlash'](_0x520857[_0x43e7('0x14')]);_0x520857[_0x43e7('0x47')]=intUtil[_0x43e7('0x46')](_0x520857[_0x43e7('0x47')]);if(_0x34e2ec&&_0x34e2ec[_0x43e7('0x5a')]&&_0x34e2ec[_0x43e7('0x5a')]!==_0x43e7('0x5b')){logger[_0x43e7('0xb')](_0x43e7('0x5c'),_0x43e7('0x5d'));_0x499c03[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x520857[_0x43e7('0x47')],_0x499c03['uniqueid'],md5(_0x499c03[_0x43e7('0x4a')]));}headers[_0x43e7('0x4b')]=getAuth(_0x520857);return getUser(_0x520857,_0x4e6f6d[_0x43e7('0x4c')])['then'](function(_0x5d63c6){_0x1f561f=_0x5d63c6;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0x1f561f['id']);return getEndUser(_0x520857,_0x499c03['destcalleridname'],_0x499c03[_0x43e7('0x5e')]);})['then'](function(_0x49a6ce){_0xfe13fa=_0x49a6ce;logger[_0x43e7('0xb')](_0x43e7('0x5f'),_0xfe13fa['id']);return getTicket(_0x520857,_0x1f561f,_0xfe13fa,_0x39e3ca,_0x499c03);})[_0x43e7('0xe')](function(_0x40155c){if(_0x40155c){logger[_0x43e7('0xb')]('Ticket\x20created!');logger[_0x43e7('0xb')](_0x43e7('0x4f'),_0x40155c['id']);switch(_0x520857['type']){case _0x43e7('0x50'):logger[_0x43e7('0xb')](_0x43e7('0x53'),'Displaying\x20ticket\x20to\x20agent...');emit(util['format']('user:%s',_0x4e6f6d[_0x43e7('0x35')]),_0x43e7('0x60'),{'recordId':_0x40155c['id']});break;case _0x43e7('0x52'):logger[_0x43e7('0xb')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x43e7('0x16')](_0x43e7('0x51'),_0x4e6f6d[_0x43e7('0x35')]),_0x43e7('0x61'),{'uri':util['format'](_0x43e7('0x62'),_0x520857[_0x43e7('0x14')],_0x40155c['id'])});break;default:logger[_0x43e7('0x56')](_0x43e7('0x5c'),_0x43e7('0x57'));}}})[_0x43e7('0x58')](function(_0x4665db){logger[_0x43e7('0x56')](_0x43e7('0x5c'),JSON[_0x43e7('0x63')](_0x4665db));});};exports[_0x43e7('0x64')]=function(_0x57fdfe,_0x5f3824,_0x2b0711,_0x58a3a8,_0x501616,_0x50edb2){var _0xb3e981,_0xe666b0;_0x50edb2['remoteUri']=intUtil[_0x43e7('0x46')](_0x50edb2[_0x43e7('0x14')]);_0x50edb2[_0x43e7('0x47')]=intUtil['stripTrailingSlash'](_0x50edb2[_0x43e7('0x47')]);if(_0x501616&&_0x501616[_0x43e7('0x65')]){logger[_0x43e7('0xb')]('['+_0x5f3824[_0x43e7('0x66')][_0x43e7('0x67')]()+']',_0x43e7('0x5d'));_0x5f3824[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x50edb2[_0x43e7('0x47')],_0x5f3824[_0x43e7('0x4a')],md5(_0x5f3824['uniqueid']));}else{_0x5f3824['recordingURL']='';}headers[_0x43e7('0x4b')]=getAuth(_0x50edb2);return getUser(_0x50edb2)['then'](function(_0x5cb26e){_0xb3e981=_0x5cb26e;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0xb3e981['id']);return getEndUser(_0x50edb2,_0x5f3824['calleridname'],_0x5f3824[_0x43e7('0x68')]);})[_0x43e7('0xe')](function(_0x1e2fed){_0xe666b0=_0x1e2fed;logger[_0x43e7('0xb')](_0x43e7('0x5f'),_0xe666b0['id']);return getTicket(_0x50edb2,_0xb3e981,_0xe666b0,_0x2b0711,_0x5f3824);})[_0x43e7('0xe')](function(_0x398a78){if(_0x398a78){logger['info'](_0x43e7('0x4e'));logger[_0x43e7('0xb')]('The\x20Ticket\x20ID\x20is:',_0x398a78['id']);}})[_0x43e7('0x58')](function(_0x5c2c5f){logger[_0x43e7('0x56')]('['+_0x5f3824[_0x43e7('0x66')][_0x43e7('0x67')]()+']',JSON[_0x43e7('0x63')](_0x5c2c5f));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index 3e36257..ee303fe 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 _0x95e5=['userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','message','toLowerCase','outbound','destcalleridnum','calleridnum','/systemusers(','4.0','body','headers','odata-entityid','lastIndexOf','GET','contacts?$select=','&$filter=','\x20eq\x20\x27','replace','%2b','enduserId','nothing',']\x20Enduser\x20created!','forEach','string','picklist','type','nameField','idField','substring','indexOf','content','ticketType','incident','incidents','assign','getString','Subjects','Descriptions','/contacts(','Fields','phonecall','queue','phonecalls','callDirection','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/','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','util','./util','ioredis','dynamics365','../../../../config/environment','redis','localhost','socket.io-emitter','modernAuthentication','remoteUri','CloudProvider','data7','tenantId','data2','resolve','POST','clientId','username','password','clientSecret','then','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','value','isNil','validateEmail','email','userEmail','length','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','systemuserid'];(function(_0x4a103f,_0x4f936b){var _0x39fc53=function(_0x2d048f){while(--_0x2d048f){_0x4a103f['push'](_0x4a103f['shift']());}};_0x39fc53(++_0x4f936b);}(_0x95e5,0x197));var _0x595e=function(_0x128cf1,_0x2a0fb0){_0x128cf1=_0x128cf1-0x0;var _0x3992ed=_0x95e5[_0x128cf1];return _0x3992ed;};'use strict';var _=require(_0x595e('0x0'));var rp=require(_0x595e('0x1'));var util=require(_0x595e('0x2'));var intUtil=require(_0x595e('0x3'));var md5=require('md5');var Redis=require(_0x595e('0x4'));var logger=require('../../../../config/logger')(_0x595e('0x5'));var config=require(_0x595e('0x6'));config[_0x595e('0x7')]=_['defaults'](config['redis'],{'host':_0x595e('0x8'),'port':0x18eb});var io=require(_0x595e('0x9'))(new Redis(config['redis']));function getAuthToken(_0x421fa3,_0x345ad6,_0x3e287f){if(_0x421fa3[_0x595e('0xa')]){_0x421fa3[_0x595e('0xb')]=_0x421fa3[_0x595e('0xc')][_0x595e('0xd')];_0x421fa3[_0x595e('0xe')]=_0x421fa3[_0x595e('0xc')][_0x595e('0xf')];return Promise[_0x595e('0x10')](_0x421fa3[_0x595e('0xc')]['data5']);}var _0x10c0a8={'method':_0x595e('0x11'),'uri':_0x345ad6,'form':{'client_id':_0x421fa3[_0x595e('0x12')],'resource':_0x421fa3[_0x595e('0xb')],'username':_0x421fa3[_0x595e('0x13')],'password':_0x421fa3[_0x595e('0x14')],'grant_type':_0x595e('0x14'),'client_secret':_0x421fa3[_0x595e('0x15')]},'json':!![]};return rp(_0x10c0a8)[_0x595e('0x16')](function(_0x27ada6){return _0x27ada6[_0x595e('0x17')];})[_0x595e('0x18')](function(_0x482062){logger[_0x595e('0x19')]('['+[_0x3e287f[_0x595e('0x1a')]()]+_0x595e('0x1b'));return _0x482062['message'];});}function getUser(_0x340ea0,_0x2d3f29,_0x13cc9f,_0x4773d8,_0x100e92,_0x27f457){return new Promise(function(_0x3ee126,_0x54c92b){return getAuthToken(_0x2d3f29,_0x4773d8,_0x27f457)[_0x595e('0x16')](function(_0x28f07d){var _0x31ffc5={'method':'GET','uri':_0x100e92+_0x595e('0x1c'),'headers':{'Authorization':_0x595e('0x1d')+_0x28f07d,'OData-Version':'4.0'},'json':!![]};return rp(_0x31ffc5);})[_0x595e('0x16')](function(_0x1632d0){var _0x9ae8ce=_0x1632d0[_0x595e('0x1e')];var _0x3ba71f=![];var _0x16681d=null;if(!_[_0x595e('0x1f')](_0x13cc9f)){if(intUtil[_0x595e('0x20')](_0x13cc9f[_0x595e('0x21')])){_0x340ea0[_0x595e('0x22')]=_0x13cc9f[_0x595e('0x21')];for(_0x16681d=0x0;_0x16681d<_0x9ae8ce[_0x595e('0x23')];_0x16681d++){if(_0x9ae8ce[_0x16681d][_0x595e('0x24')]===_0x13cc9f[_0x595e('0x21')]&&!_0x9ae8ce[_0x16681d][_0x595e('0x25')]){_0x3ba71f=!![];logger[_0x595e('0x26')]('['+[_0x27f457[_0x595e('0x1a')]()]+_0x595e('0x27')+_0x9ae8ce[_0x16681d][_0x595e('0x28')]+'!');_0x340ea0[_0x595e('0x29')]=_0x9ae8ce[_0x16681d][_0x595e('0x28')];}}}}if(!_0x3ba71f){logger[_0x595e('0x26')]('['+[_0x27f457[_0x595e('0x1a')]()]+_0x595e('0x2a'));_0x340ea0[_0x595e('0x22')]=_0x2d3f29[_0x595e('0x13')];for(_0x16681d=0x0;_0x16681d<_0x9ae8ce[_0x595e('0x23')];_0x16681d++){if(_0x9ae8ce[_0x16681d][_0x595e('0x24')]===_0x2d3f29[_0x595e('0x13')]){_0x340ea0['userId']=_0x9ae8ce[_0x16681d][_0x595e('0x28')];}}}_0x3ee126(_0x340ea0);})[_0x595e('0x18')](function(_0xec7ca9){_0x54c92b(_0xec7ca9[_0x595e('0x2b')]);});});}function createEndUser(_0x27773c,_0x869e2b,_0x2e1095,_0x5eae88,_0x3d71a2,_0x2ad530,_0x34137a){return new Promise(function(_0x1ddd48,_0x23e140){return getAuthToken(_0x869e2b,_0x2e1095,_0x2ad530)[_0x595e('0x16')](function(_0x4473d9){var _0x5a75af=_0x2ad530[_0x595e('0x2c')]()===_0x595e('0x2d')?_0x3d71a2[_0x595e('0x2e')]:_0x3d71a2[_0x595e('0x2f')];var _0xd80269={'method':'POST','uri':_0x5eae88+'contacts','body':{'fullname':_0x5a75af,'firstname':_0x5a75af,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x595e('0x30')+_0x27773c[_0x595e('0x29')]+')'},'headers':{'Authorization':_0x595e('0x1d')+_0x4473d9,'OData-Version':_0x595e('0x31')},'json':!![],'resolveWithFullResponse':!![]};_0xd80269[_0x595e('0x32')][_0x34137a]=_0x5a75af;return rp(_0xd80269);})[_0x595e('0x16')](function(_0x3ba880){var _0x500d97=_0x3ba880[_0x595e('0x33')][_0x595e('0x34')];var _0x43fda6=_0x500d97['substring'](_0x500d97['lastIndexOf']('(')+0x1,_0x500d97[_0x595e('0x35')](')'));_0x27773c['enduserId']=_0x43fda6;_0x1ddd48(_0x27773c);})[_0x595e('0x18')](function(_0x572737){_0x23e140(_0x572737[_0x595e('0x2b')]);});});}function getEndUser(_0x419708,_0x35ffab,_0x429afc,_0x1063cb,_0x2949af,_0x16edfb,_0x16dd82,_0x308f24){var _0x3ce383=_0x16edfb[_0x595e('0x2c')]()===_0x595e('0x2d')?_0x2949af['destcalleridnum']:_0x2949af[_0x595e('0x2f')];return getAuthToken(_0x35ffab,_0x429afc,_0x16edfb)[_0x595e('0x16')](function(_0x3cddba){_0x308f24=_0x308f24?_0x308f24:'telephone1';var _0x6f0fb1={'method':_0x595e('0x36'),'uri':_0x1063cb+_0x595e('0x37')+_0x308f24+_0x595e('0x38')+_0x308f24+_0x595e('0x39')+_0x3ce383[_0x595e('0x3a')]('+',_0x595e('0x3b'))+'\x27','headers':{'Authorization':_0x595e('0x1d')+_0x3cddba,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x6f0fb1);})[_0x595e('0x16')](function(_0x77e3fd){var _0x39eb6f=![];if(!_0x77e3fd)return _0x39eb6f;var _0x5a3f86=_0x77e3fd[_0x595e('0x1e')];for(var _0x23cd72=0x0;_0x23cd72<_0x5a3f86[_0x595e('0x23')];_0x23cd72++){if(_0x5a3f86[_0x23cd72][_0x308f24]===_0x3ce383){_0x39eb6f=!![];_0x419708[_0x595e('0x3c')]=_0x5a3f86[_0x23cd72]['contactid'];}}return _0x39eb6f;})[_0x595e('0x16')](function(_0x25acd4){if(_0x25acd4)return _0x419708;if(_0x16dd82===_0x595e('0x3d')){logger[_0x595e('0x26')]('['+[_0x16edfb['toUpperCase']()]+']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing');return _0x419708;}return createEndUser(_0x419708,_0x35ffab,_0x429afc,_0x1063cb,_0x2949af,_0x16edfb,_0x308f24)[_0x595e('0x16')](function(_0xf2509a){logger['info']('['+[_0x16edfb[_0x595e('0x1a')]()]+_0x595e('0x3e'),_0xf2509a['enduserId']);return _0xf2509a;});});}function getCustomFields(_0x5ce635,_0xa9c558,_0x3373a5){var _0x30b69b={};if(_0x5ce635[_0x595e('0x23')]>0x0){_[_0x595e('0x3f')](_0x5ce635,function(_0x2ac58c){if(_['includes']([_0x595e('0x40'),_0x595e('0x41')],_0x2ac58c[_0x595e('0x42')])&&_0x2ac58c[_0x595e('0x43')]&&!_0x2ac58c['customField']){var _0x240e39=_0x2ac58c[_0x595e('0x44')]['toLowerCase']();var _0x530d6f=_0x240e39[_0x595e('0x45')](0x0,_0x240e39[_0x595e('0x46')]('_'));var _0x299494=_0x240e39[_0x595e('0x45')](_0x240e39[_0x595e('0x46')]('_')+0x1);if(_0x530d6f===_0x3373a5){_0x30b69b[_0x299494]=_0x2ac58c[_0x595e('0x47')];}}});}return _0x30b69b;}function getTicket(_0x517065,_0xcc4d41,_0x40dd24,_0x443796,_0x35f81a,_0x2da76e,_0xaf44cf){return new Promise(function(_0xc7b747,_0x5e0ef2){var _0x45ec3d;return getAuthToken(_0xcc4d41,_0x40dd24,_0xaf44cf)[_0x595e('0x16')](function(_0x44ac54){if(_0x2da76e[_0x595e('0x48')]===_0x595e('0x49')){_0x45ec3d={'method':_0x595e('0x11'),'uri':_0x443796+_0x595e('0x4a'),'body':Object[_0x595e('0x4b')]({},{'title':intUtil[_0x595e('0x4c')](_0x2da76e[_0x595e('0x4d')],_0x35f81a,'\x20'),'description':intUtil['getString'](_0x2da76e[_0x595e('0x4e')],_0x35f81a,'\x0a'),'customerid_contact@odata.bind':_0x517065['enduserId']?_0x595e('0x4f')+_0x517065[_0x595e('0x3c')]+')':undefined,'ownerid@odata.bind':_0x595e('0x30')+_0x517065[_0x595e('0x29')]+')','caseorigincode':'1'},getCustomFields(_0x2da76e[_0x595e('0x50')],_0x35f81a,_0x2da76e[_0x595e('0x48')])),'headers':{'Authorization':_0x595e('0x1d')+_0x44ac54,'OData-Version':_0x595e('0x31')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x2da76e[_0x595e('0x48')]===_0x595e('0x51')){var _0x366941=_0x517065['enduserId']?[{'partyid_systemuser@odata.bind':_0x595e('0x30')+_0x517065['userId']+')','participationtypemask':_0x517065['callDirection']==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0x595e('0x4f')+_0x517065[_0x595e('0x3c')]+')','participationtypemask':_0x517065['callDirection']===_0x595e('0x52')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x595e('0x30')+_0x517065[_0x595e('0x29')]+')','participationtypemask':_0x517065['callDirection']===_0x595e('0x52')?0x2:0x1}];_0x45ec3d={'method':_0x595e('0x11'),'uri':_0x443796+_0x595e('0x53'),'body':Object['assign']({},{'subject':intUtil[_0x595e('0x4c')](_0x2da76e[_0x595e('0x4d')],_0x35f81a,'\x20'),'phonenumber':String(_0x35f81a[_0x595e('0x2f')]),'description':intUtil[_0x595e('0x4c')](_0x2da76e[_0x595e('0x4e')],_0x35f81a,'\x0a'),'regardingobjectid_contact@odata.bind':_0x517065['enduserId']?'/contacts('+_0x517065[_0x595e('0x3c')]+')':undefined,'ownerid@odata.bind':_0x595e('0x30')+_0x517065['userId']+')','directioncode':_0x517065[_0x595e('0x54')]==='queue'?![]:!![],'phonecall_activity_parties':_0x366941},getCustomFields(_0x2da76e[_0x595e('0x50')],_0x35f81a,_0x2da76e[_0x595e('0x48')])),'headers':{'Authorization':_0x595e('0x1d')+_0x44ac54,'OData-Version':_0x595e('0x31')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x45ec3d);})[_0x595e('0x16')](function(_0x42ef50){var _0x401500=_0x42ef50[_0x595e('0x33')][_0x595e('0x34')];var _0x3c3734=_0x401500[_0x595e('0x45')](_0x401500[_0x595e('0x35')]('(')+0x1,_0x401500[_0x595e('0x35')](')'));_0x517065[_0x595e('0x55')]=_0x3c3734;_0xc7b747(_0x517065);})[_0x595e('0x18')](function(_0x14b0e0){_0x5e0ef2(_0x14b0e0[_0x595e('0x2b')]);});});}function emit(_0x1b78b5,_0x10ced2,_0xfd763c,_0x136b62){var _0xfa2afd={'uri':util[_0x595e('0x56')](_0x595e('0x57'),_0x1b78b5,_0xfd763c,_0x136b62)};io['to'](util[_0x595e('0x56')](_0x595e('0x58'),_0x10ced2))[_0x595e('0x59')](_0x595e('0x5a'),_0xfa2afd);}exports['cs']=function(_0x2a6889,_0x29cf28,_0x7f8544,_0x457392,_0x28c79f,_0x1ec2f9,_0x352d63,_0x451d62){var _0xabcf63={};_0x1ec2f9[_0x595e('0xb')]=_0x1ec2f9[_0x595e('0xa')]?intUtil[_0x595e('0x5b')](_0x1ec2f9[_0x595e('0xc')][_0x595e('0xd')]):intUtil['stripTrailingSlash'](_0x1ec2f9[_0x595e('0xb')]);_0x1ec2f9[_0x595e('0x5c')]=intUtil[_0x595e('0x5b')](_0x1ec2f9[_0x595e('0x5c')]);_0xabcf63[_0x595e('0x54')]=_0x451d62===_0x595e('0x52')||_0x451d62===_0x595e('0x5d')?_0x595e('0x52'):'outbound';var _0x30580a=_0x1ec2f9[_0x595e('0xa')]?util[_0x595e('0x56')](_0x595e('0x5e'),_0x1ec2f9[_0x595e('0xc')][_0x595e('0xd')]):util[_0x595e('0x56')]('%s/api/data/v9.0/',_0x1ec2f9['remoteUri']);var _0x22d974=util['format']('https://login.microsoftonline.com/%s/oauth2/token',_0x1ec2f9[_0x595e('0xe')]);var _0x4120c0=util[_0x595e('0x56')](_0x595e('0x5f'),_0x1ec2f9[_0x595e('0x5c')],_0x29cf28['uniqueid'],md5(_0x29cf28[_0x595e('0x60')]));if(_0x28c79f&&_0x28c79f['monitor_format']){logger[_0x595e('0x26')]('[QUEUE]','Recording\x20is\x20enabled!');_0x29cf28[_0x595e('0x61')]=_0x4120c0;}else if(_0x352d63&&_0x352d63[_0x595e('0x62')]&&_0x352d63[_0x595e('0x62')]!=='none'){logger[_0x595e('0x26')](_0x595e('0x63'),_0x595e('0x64'));_0x29cf28['recordingURL']=_0x4120c0;}else{_0x29cf28[_0x595e('0x61')]='';}return getUser(_0xabcf63,_0x1ec2f9,_0x457392,_0x22d974,_0x30580a,_0x451d62)[_0x595e('0x16')](function(_0x5d7d9b){logger[_0x595e('0x26')]('['+_0x451d62[_0x595e('0x1a')]()+_0x595e('0x65'),_0x5d7d9b['userId']);logger['info']('['+_0x451d62[_0x595e('0x1a')]()+_0x595e('0x66'),_0x5d7d9b['userEmail']);return getEndUser(_0x5d7d9b,_0x1ec2f9,_0x22d974,_0x30580a,_0x29cf28,_0x451d62,_0x7f8544[_0x595e('0x67')],_0x7f8544[_0x595e('0x68')]);})[_0x595e('0x16')](function(_0x3a5986){logger[_0x595e('0x26')]('['+_0x451d62[_0x595e('0x1a')]()+']\x20The\x20Enduser\x20ID\x20is:',_0x3a5986['enduserId']);logger[_0x595e('0x26')]('['+_0x451d62[_0x595e('0x1a')]()+_0x595e('0x69'),_0x29cf28[_0x595e('0x2f')]);return getTicket(_0x3a5986,_0x1ec2f9,_0x22d974,_0x30580a,_0x29cf28,_0x7f8544,_0x451d62);})[_0x595e('0x16')](function(_0x8f175a){logger[_0x595e('0x26')](util[_0x595e('0x56')]('['+_0x451d62[_0x595e('0x1a')]()+_0x595e('0x6a'),_0x7f8544[_0x595e('0x48')],_0x8f175a[_0x595e('0x55')]));logger[_0x595e('0x26')](util['format']('['+_0x451d62[_0x595e('0x1a')]()+_0x595e('0x6b'),_0x451d62));if(_0x451d62!==_0x595e('0x5d')&&_0x7f8544[_0x595e('0x6c')]){logger[_0x595e('0x26')]('['+_0x451d62['toUpperCase']()+']',_0x595e('0x6d'));emit(_0x1ec2f9[_0x595e('0xb')],_0x457392[_0x595e('0x6e')],_0x7f8544['ticketType'],_0x8f175a['ticketId']);}})[_0x595e('0x18')](function(_0x3e7682){logger[_0x595e('0x19')]('['+_0x451d62[_0x595e('0x1a')]()+']\x20Error\x20running\x20Dynamics365\x20integration',_0x3e7682[_0x595e('0x2b')]);console[_0x595e('0x19')](_0x595e('0x6f'),_0x3e7682);});}; \ No newline at end of file +var _0xfb9d=['toLowerCase','contacts?$select=','\x20eq\x20\x27','replace','%2b','contactid','nothing','info',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing','forEach','includes','picklist','type','nameField','customField','idField','indexOf','content','ticketType','incidents','assign','getString','Subjects','Descriptions','/contacts(','Fields','phonecall','callDirection','queue','POST','phonecalls','headers','ticketId','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','format','user:%s','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20Call\x20direction:\x20%s','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Dynamics365\x20integration','request-promise','util','./util','ioredis','../../../../config/logger','dynamics365','redis','localhost','socket.io-emitter','remoteUri','CloudProvider','data7','tenantId','data2','data5','clientId','username','password','clientSecret','then','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','validateEmail','email','userEmail','length','internalemailaddress','isdisabled',']\x20Agent\x20found\x20','userId','systemuserid','outbound','destcalleridnum','calleridnum','contacts','/systemusers(','body','odata-entityid','substring','lastIndexOf','enduserId'];(function(_0x1f1a0b,_0x3aa5e9){var _0x41eb33=function(_0x140df8){while(--_0x140df8){_0x1f1a0b['push'](_0x1f1a0b['shift']());}};_0x41eb33(++_0x3aa5e9);}(_0xfb9d,0x182));var _0xdfb9=function(_0x5c8f9f,_0x7f84ae){_0x5c8f9f=_0x5c8f9f-0x0;var _0x44e15c=_0xfb9d[_0x5c8f9f];return _0x44e15c;};'use strict';var _=require('lodash');var rp=require(_0xdfb9('0x0'));var util=require(_0xdfb9('0x1'));var intUtil=require(_0xdfb9('0x2'));var md5=require('md5');var Redis=require(_0xdfb9('0x3'));var logger=require(_0xdfb9('0x4'))(_0xdfb9('0x5'));var config=require('../../../../config/environment');config[_0xdfb9('0x6')]=_['defaults'](config[_0xdfb9('0x6')],{'host':_0xdfb9('0x7'),'port':0x18eb});var io=require(_0xdfb9('0x8'))(new Redis(config[_0xdfb9('0x6')]));function getAuthToken(_0x43ed9c,_0x36fb37,_0x45685b){if(_0x43ed9c['modernAuthentication']){_0x43ed9c[_0xdfb9('0x9')]=_0x43ed9c[_0xdfb9('0xa')][_0xdfb9('0xb')];_0x43ed9c[_0xdfb9('0xc')]=_0x43ed9c[_0xdfb9('0xa')][_0xdfb9('0xd')];return Promise['resolve'](_0x43ed9c['CloudProvider'][_0xdfb9('0xe')]);}var _0x10b53f={'method':'POST','uri':_0x36fb37,'form':{'client_id':_0x43ed9c[_0xdfb9('0xf')],'resource':_0x43ed9c[_0xdfb9('0x9')],'username':_0x43ed9c[_0xdfb9('0x10')],'password':_0x43ed9c['password'],'grant_type':_0xdfb9('0x11'),'client_secret':_0x43ed9c[_0xdfb9('0x12')]},'json':!![]};return rp(_0x10b53f)[_0xdfb9('0x13')](function(_0x54f679){return _0x54f679['access_token'];})[_0xdfb9('0x14')](function(_0x5d0019){logger[_0xdfb9('0x15')]('['+[_0x45685b[_0xdfb9('0x16')]()]+_0xdfb9('0x17'));return _0x5d0019[_0xdfb9('0x18')];});}function getUser(_0x37a8d1,_0x523bf3,_0x235a53,_0x513b52,_0xf31e54,_0x478fe0){return new Promise(function(_0x4d3809,_0xae8cb0){return getAuthToken(_0x523bf3,_0x513b52,_0x478fe0)[_0xdfb9('0x13')](function(_0x405985){var _0x135100={'method':_0xdfb9('0x19'),'uri':_0xf31e54+_0xdfb9('0x1a'),'headers':{'Authorization':_0xdfb9('0x1b')+_0x405985,'OData-Version':_0xdfb9('0x1c')},'json':!![]};return rp(_0x135100);})['then'](function(_0x409614){var _0x4dca3d=_0x409614[_0xdfb9('0x1d')];var _0x660fef=![];var _0x5c2538=null;if(!_[_0xdfb9('0x1e')](_0x235a53)){if(intUtil[_0xdfb9('0x1f')](_0x235a53[_0xdfb9('0x20')])){_0x37a8d1[_0xdfb9('0x21')]=_0x235a53['email'];for(_0x5c2538=0x0;_0x5c2538<_0x4dca3d[_0xdfb9('0x22')];_0x5c2538++){if(_0x4dca3d[_0x5c2538][_0xdfb9('0x23')]===_0x235a53[_0xdfb9('0x20')]&&!_0x4dca3d[_0x5c2538][_0xdfb9('0x24')]){_0x660fef=!![];logger['info']('['+[_0x478fe0[_0xdfb9('0x16')]()]+_0xdfb9('0x25')+_0x4dca3d[_0x5c2538]['systemuserid']+'!');_0x37a8d1[_0xdfb9('0x26')]=_0x4dca3d[_0x5c2538]['systemuserid'];}}}}if(!_0x660fef){logger['info']('['+[_0x478fe0[_0xdfb9('0x16')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x37a8d1[_0xdfb9('0x21')]=_0x523bf3['username'];for(_0x5c2538=0x0;_0x5c2538<_0x4dca3d[_0xdfb9('0x22')];_0x5c2538++){if(_0x4dca3d[_0x5c2538]['internalemailaddress']===_0x523bf3[_0xdfb9('0x10')]){_0x37a8d1[_0xdfb9('0x26')]=_0x4dca3d[_0x5c2538][_0xdfb9('0x27')];}}}_0x4d3809(_0x37a8d1);})['catch'](function(_0x2ef25b){_0xae8cb0(_0x2ef25b[_0xdfb9('0x18')]);});});}function createEndUser(_0x11fd18,_0xc0be20,_0x23d442,_0x2de717,_0x2725c2,_0x208552,_0x5095e0){return new Promise(function(_0xe0d1c6,_0x26ffc3){return getAuthToken(_0xc0be20,_0x23d442,_0x208552)['then'](function(_0x52f99c){var _0x1252cb=_0x208552['toLowerCase']()===_0xdfb9('0x28')?_0x2725c2[_0xdfb9('0x29')]:_0x2725c2[_0xdfb9('0x2a')];var _0x153c8b={'method':'POST','uri':_0x2de717+_0xdfb9('0x2b'),'body':{'fullname':_0x1252cb,'firstname':_0x1252cb,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xdfb9('0x2c')+_0x11fd18[_0xdfb9('0x26')]+')'},'headers':{'Authorization':_0xdfb9('0x1b')+_0x52f99c,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};_0x153c8b[_0xdfb9('0x2d')][_0x5095e0]=_0x1252cb;return rp(_0x153c8b);})[_0xdfb9('0x13')](function(_0x3e8617){var _0x5a1b95=_0x3e8617['headers'][_0xdfb9('0x2e')];var _0x2c4957=_0x5a1b95[_0xdfb9('0x2f')](_0x5a1b95['lastIndexOf']('(')+0x1,_0x5a1b95[_0xdfb9('0x30')](')'));_0x11fd18[_0xdfb9('0x31')]=_0x2c4957;_0xe0d1c6(_0x11fd18);})[_0xdfb9('0x14')](function(_0x875c8f){_0x26ffc3(_0x875c8f['message']);});});}function getEndUser(_0x2e91b0,_0x5054ee,_0x48a934,_0x2fb665,_0x6d9349,_0x431abc,_0x343143,_0x509da8){var _0x1a6074=_0x431abc[_0xdfb9('0x32')]()===_0xdfb9('0x28')?_0x6d9349[_0xdfb9('0x29')]:_0x6d9349[_0xdfb9('0x2a')];return getAuthToken(_0x5054ee,_0x48a934,_0x431abc)[_0xdfb9('0x13')](function(_0x5538cf){_0x509da8=_0x509da8?_0x509da8:'telephone1';var _0x2583ae={'method':'GET','uri':_0x2fb665+_0xdfb9('0x33')+_0x509da8+'&$filter='+_0x509da8+_0xdfb9('0x34')+_0x1a6074[_0xdfb9('0x35')]('+',_0xdfb9('0x36'))+'\x27','headers':{'Authorization':_0xdfb9('0x1b')+_0x5538cf,'If-None-Match':null,'OData-Version':_0xdfb9('0x1c')},'json':!![]};return rp(_0x2583ae);})['then'](function(_0x5deb9c){var _0x407c91=![];if(!_0x5deb9c)return _0x407c91;var _0x5eb2e8=_0x5deb9c['value'];for(var _0x117ef3=0x0;_0x117ef3<_0x5eb2e8[_0xdfb9('0x22')];_0x117ef3++){if(_0x5eb2e8[_0x117ef3][_0x509da8]===_0x1a6074){_0x407c91=!![];_0x2e91b0[_0xdfb9('0x31')]=_0x5eb2e8[_0x117ef3][_0xdfb9('0x37')];}}return _0x407c91;})[_0xdfb9('0x13')](function(_0x2cdb67){if(_0x2cdb67)return _0x2e91b0;if(_0x343143===_0xdfb9('0x38')){logger[_0xdfb9('0x39')]('['+[_0x431abc[_0xdfb9('0x16')]()]+_0xdfb9('0x3a'));return _0x2e91b0;}return createEndUser(_0x2e91b0,_0x5054ee,_0x48a934,_0x2fb665,_0x6d9349,_0x431abc,_0x509da8)[_0xdfb9('0x13')](function(_0x309ab7){logger[_0xdfb9('0x39')]('['+[_0x431abc[_0xdfb9('0x16')]()]+']\x20Enduser\x20created!',_0x309ab7[_0xdfb9('0x31')]);return _0x309ab7;});});}function getCustomFields(_0x195ec2,_0x3273a2,_0xbefa85){var _0x47061f={};if(_0x195ec2['length']>0x0){_[_0xdfb9('0x3b')](_0x195ec2,function(_0x4913ad){if(_[_0xdfb9('0x3c')](['string',_0xdfb9('0x3d')],_0x4913ad[_0xdfb9('0x3e')])&&_0x4913ad[_0xdfb9('0x3f')]&&!_0x4913ad[_0xdfb9('0x40')]){var _0x1a13e7=_0x4913ad[_0xdfb9('0x41')][_0xdfb9('0x32')]();var _0x4487d4=_0x1a13e7['substring'](0x0,_0x1a13e7[_0xdfb9('0x42')]('_'));var _0x1883e9=_0x1a13e7[_0xdfb9('0x2f')](_0x1a13e7[_0xdfb9('0x42')]('_')+0x1);if(_0x4487d4===_0xbefa85){_0x47061f[_0x1883e9]=_0x4913ad[_0xdfb9('0x43')];}}});}return _0x47061f;}function getTicket(_0x36fda5,_0x494a9a,_0x391754,_0x150643,_0x2a92ca,_0x4a7370,_0x36b970){return new Promise(function(_0x26817a,_0x3707c2){var _0x1255b7;return getAuthToken(_0x494a9a,_0x391754,_0x36b970)[_0xdfb9('0x13')](function(_0x875a5d){if(_0x4a7370[_0xdfb9('0x44')]==='incident'){_0x1255b7={'method':'POST','uri':_0x150643+_0xdfb9('0x45'),'body':Object[_0xdfb9('0x46')]({},{'title':intUtil[_0xdfb9('0x47')](_0x4a7370[_0xdfb9('0x48')],_0x2a92ca,'\x20'),'description':intUtil['getString'](_0x4a7370[_0xdfb9('0x49')],_0x2a92ca,'\x0a'),'customerid_contact@odata.bind':_0x36fda5[_0xdfb9('0x31')]?_0xdfb9('0x4a')+_0x36fda5[_0xdfb9('0x31')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x36fda5[_0xdfb9('0x26')]+')','caseorigincode':'1'},getCustomFields(_0x4a7370[_0xdfb9('0x4b')],_0x2a92ca,_0x4a7370[_0xdfb9('0x44')])),'headers':{'Authorization':_0xdfb9('0x1b')+_0x875a5d,'OData-Version':_0xdfb9('0x1c')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x4a7370[_0xdfb9('0x44')]===_0xdfb9('0x4c')){var _0x39dd36=_0x36fda5[_0xdfb9('0x31')]?[{'partyid_systemuser@odata.bind':'/systemusers('+_0x36fda5[_0xdfb9('0x26')]+')','participationtypemask':_0x36fda5[_0xdfb9('0x4d')]===_0xdfb9('0x4e')?0x2:0x1},{'partyid_contact@odata.bind':_0xdfb9('0x4a')+_0x36fda5[_0xdfb9('0x31')]+')','participationtypemask':_0x36fda5[_0xdfb9('0x4d')]===_0xdfb9('0x4e')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':'/systemusers('+_0x36fda5[_0xdfb9('0x26')]+')','participationtypemask':_0x36fda5[_0xdfb9('0x4d')]===_0xdfb9('0x4e')?0x2:0x1}];_0x1255b7={'method':_0xdfb9('0x4f'),'uri':_0x150643+_0xdfb9('0x50'),'body':Object[_0xdfb9('0x46')]({},{'subject':intUtil[_0xdfb9('0x47')](_0x4a7370[_0xdfb9('0x48')],_0x2a92ca,'\x20'),'phonenumber':String(_0x2a92ca[_0xdfb9('0x2a')]),'description':intUtil[_0xdfb9('0x47')](_0x4a7370[_0xdfb9('0x49')],_0x2a92ca,'\x0a'),'regardingobjectid_contact@odata.bind':_0x36fda5[_0xdfb9('0x31')]?_0xdfb9('0x4a')+_0x36fda5[_0xdfb9('0x31')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x36fda5['userId']+')','directioncode':_0x36fda5['callDirection']==='queue'?![]:!![],'phonecall_activity_parties':_0x39dd36},getCustomFields(_0x4a7370['Fields'],_0x2a92ca,_0x4a7370[_0xdfb9('0x44')])),'headers':{'Authorization':_0xdfb9('0x1b')+_0x875a5d,'OData-Version':_0xdfb9('0x1c')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x1255b7);})[_0xdfb9('0x13')](function(_0x2e38e0){var _0x4cdf27=_0x2e38e0[_0xdfb9('0x51')][_0xdfb9('0x2e')];var _0x39a7d1=_0x4cdf27[_0xdfb9('0x2f')](_0x4cdf27[_0xdfb9('0x30')]('(')+0x1,_0x4cdf27['lastIndexOf'](')'));_0x36fda5[_0xdfb9('0x52')]=_0x39a7d1;_0x26817a(_0x36fda5);})['catch'](function(_0x288800){_0x3707c2(_0x288800['message']);});});}function emit(_0x183b7d,_0x50a9a7,_0x4cb8f7,_0x111a75){var _0x1d6b4a={'uri':util['format'](_0xdfb9('0x53'),_0x183b7d,_0x4cb8f7,_0x111a75)};io['to'](util[_0xdfb9('0x54')](_0xdfb9('0x55'),_0x50a9a7))['emit'](_0xdfb9('0x56'),_0x1d6b4a);}exports['cs']=function(_0x3ee01d,_0x1c0293,_0x1139ee,_0x42cc56,_0x27b515,_0x10ed7d,_0x5e15e2,_0x257de0){var _0x96b524={};_0x10ed7d['remoteUri']=_0x10ed7d['modernAuthentication']?intUtil[_0xdfb9('0x57')](_0x10ed7d[_0xdfb9('0xa')][_0xdfb9('0xb')]):intUtil[_0xdfb9('0x57')](_0x10ed7d[_0xdfb9('0x9')]);_0x10ed7d[_0xdfb9('0x58')]=intUtil[_0xdfb9('0x57')](_0x10ed7d[_0xdfb9('0x58')]);_0x96b524['callDirection']=_0x257de0===_0xdfb9('0x4e')||_0x257de0===_0xdfb9('0x59')?_0xdfb9('0x4e'):_0xdfb9('0x28');var _0x185e8b=_0x10ed7d['modernAuthentication']?util['format'](_0xdfb9('0x5a'),_0x10ed7d[_0xdfb9('0xa')]['data7']):util[_0xdfb9('0x54')](_0xdfb9('0x5a'),_0x10ed7d[_0xdfb9('0x9')]);var _0x358f69=util[_0xdfb9('0x54')](_0xdfb9('0x5b'),_0x10ed7d[_0xdfb9('0xc')]);var _0x301d93=util[_0xdfb9('0x54')](_0xdfb9('0x5c'),_0x10ed7d[_0xdfb9('0x58')],_0x1c0293['uniqueid'],md5(_0x1c0293[_0xdfb9('0x5d')]));if(_0x27b515&&_0x27b515[_0xdfb9('0x5e')]){logger[_0xdfb9('0x39')](_0xdfb9('0x5f'),_0xdfb9('0x60'));_0x1c0293[_0xdfb9('0x61')]=_0x301d93;}else if(_0x5e15e2&&_0x5e15e2['recordingFormat']&&_0x5e15e2[_0xdfb9('0x62')]!==_0xdfb9('0x63')){logger['info'](_0xdfb9('0x64'),'Recording\x20is\x20enabled!');_0x1c0293[_0xdfb9('0x61')]=_0x301d93;}else{_0x1c0293[_0xdfb9('0x61')]='';}return getUser(_0x96b524,_0x10ed7d,_0x42cc56,_0x358f69,_0x185e8b,_0x257de0)[_0xdfb9('0x13')](function(_0x4d3cee){logger[_0xdfb9('0x39')]('['+_0x257de0[_0xdfb9('0x16')]()+_0xdfb9('0x65'),_0x4d3cee[_0xdfb9('0x26')]);logger[_0xdfb9('0x39')]('['+_0x257de0[_0xdfb9('0x16')]()+_0xdfb9('0x66'),_0x4d3cee['userEmail']);return getEndUser(_0x4d3cee,_0x10ed7d,_0x358f69,_0x185e8b,_0x1c0293,_0x257de0,_0x1139ee['moduleCreate'],_0x1139ee[_0xdfb9('0x67')]);})['then'](function(_0x1fc272){logger[_0xdfb9('0x39')]('['+_0x257de0[_0xdfb9('0x16')]()+_0xdfb9('0x68'),_0x1fc272[_0xdfb9('0x31')]);logger[_0xdfb9('0x39')]('['+_0x257de0[_0xdfb9('0x16')]()+']\x20The\x20Enduser\x20phone\x20is:',_0x1c0293[_0xdfb9('0x2a')]);return getTicket(_0x1fc272,_0x10ed7d,_0x358f69,_0x185e8b,_0x1c0293,_0x1139ee,_0x257de0);})[_0xdfb9('0x13')](function(_0x136fef){logger['info'](util[_0xdfb9('0x54')]('['+_0x257de0[_0xdfb9('0x16')]()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x1139ee[_0xdfb9('0x44')],_0x136fef['ticketId']));logger[_0xdfb9('0x39')](util['format']('['+_0x257de0[_0xdfb9('0x16')]()+_0xdfb9('0x69'),_0x257de0));if(_0x257de0!==_0xdfb9('0x59')&&_0x1139ee[_0xdfb9('0x6a')]){logger['info']('['+_0x257de0[_0xdfb9('0x16')]()+']',_0xdfb9('0x6b'));emit(_0x10ed7d[_0xdfb9('0x9')],_0x42cc56['name'],_0x1139ee[_0xdfb9('0x44')],_0x136fef[_0xdfb9('0x52')]);}})[_0xdfb9('0x14')](function(_0x49f21a){logger['error']('['+_0x257de0[_0xdfb9('0x16')]()+_0xdfb9('0x6c'),_0x49f21a[_0xdfb9('0x18')]);console[_0xdfb9('0x15')]('Error\x20running\x20Dynamics365\x20integration',_0x49f21a);});}; \ 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 c34bf96..ab1e540 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 _0x60bd=['idField','customField','push','variable','variableName','customVariable','Variable','toLowerCase','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','user:%s','%s/helpdesk/tickets/%d','catch','error','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','trigger:browser:url','unmanaged','monitor_format','lastevent','toUpperCase','lodash','request-promise','md5','util','ioredis','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','Descriptions','
','name','Fields','custom_fields','keyBy','%s/api/v2/tickets','remoteUri','POST','then','Ticket\x20created!','length','Agent\x20found!','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','find','%s/api/v2/contacts','Basic\x20%s','apiKey','toString','[HTTP]','stringify','GET','map','string','type','nameField','content','includes','picklist'];(function(_0x5f53c8,_0x969c3e){var _0xe7c72b=function(_0x458657){while(--_0x458657){_0x5f53c8['push'](_0x5f53c8['shift']());}};_0xe7c72b(++_0x969c3e);}(_0x60bd,0xd8));var _0xd60b=function(_0x850e56,_0xd3490e){_0x850e56=_0x850e56-0x0;var _0x269ddd=_0x60bd[_0x850e56];return _0x269ddd;};'use strict';var _=require(_0xd60b('0x0'));var rp=require(_0xd60b('0x1'));var md5=require(_0xd60b('0x2'));var util=require(_0xd60b('0x3'));var Redis=require(_0xd60b('0x4'));var intUtil=require('./util');var config=require(_0xd60b('0x5'));var logger=require(_0xd60b('0x6'))(_0xd60b('0x7'));config[_0xd60b('0x8')]=_[_0xd60b('0x9')](config['redis'],{'host':_0xd60b('0xa'),'port':0x18eb});var io=require(_0xd60b('0xb'))(new Redis(config['redis']));var headers={'Content-Type':'application/json','Accept':_0xd60b('0xc')};function emit(_0x1507d8,_0x148b08,_0x34691b){io['to'](_0x1507d8)[_0xd60b('0xd')](_0x148b08,_0x34691b);}function getTicket(_0x18810d,_0x5f0e4c,_0x145eab,_0x24e3cc,_0x4f8b3a){logger[_0xd60b('0xe')](_0xd60b('0xf'));var _0x514505=_[_0xd60b('0x10')]({'responder_id':_0x5f0e4c['id'],'requester_id':_0x145eab['id'],'name':util[_0xd60b('0x11')](_0xd60b('0x12'),_0x4f8b3a[_0xd60b('0x13')]),'phone':_0x4f8b3a[_0xd60b('0x14')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xd60b('0x15')](_0x24e3cc[_0xd60b('0x16')],_0x4f8b3a,'\x20'),'description':intUtil[_0xd60b('0x15')](_0x24e3cc[_0xd60b('0x17')],_0x4f8b3a,_0xd60b('0x18')),'tags':getTags(_0x24e3cc['Tags'],_0xd60b('0x19'))},getCustomFields(_0x24e3cc[_0xd60b('0x1a')],_0x4f8b3a));_0x514505[_0xd60b('0x1b')]=_['mapValues'](_[_0xd60b('0x1c')](_0x514505[_0xd60b('0x1b')],'id'),'value');return request({'uri':util['format'](_0xd60b('0x1d'),_0x18810d[_0xd60b('0x1e')]),'method':_0xd60b('0x1f'),'body':_0x514505})[_0xd60b('0x20')](function(_0x556c2b){logger[_0xd60b('0xe')](_0xd60b('0x21'));return _0x556c2b;});}function getUser(_0x18660a,_0x3422f1){if(intUtil['validateEmail'](_0x3422f1)){return request({'uri':util[_0xd60b('0x11')]('%s/api/v2/agents',_0x18660a[_0xd60b('0x1e')]),'qs':{'email':_0x3422f1}})[_0xd60b('0x20')](function(_0x2f2a12){if(_0x2f2a12[_0xd60b('0x22')]){logger['info'](_0xd60b('0x23'));return _['find'](_0x2f2a12,function(_0x5c93a9){return _0x5c93a9['contact'][_0xd60b('0x24')]===_0x3422f1;});}else{logger['info'](_0xd60b('0x25'));return request({'uri':util[_0xd60b('0x11')](_0xd60b('0x26'),_0x18660a[_0xd60b('0x1e')])})[_0xd60b('0x20')](function(_0x1c768d){logger['info'](_0xd60b('0x27'));return _0x1c768d;});}});}else{logger[_0xd60b('0xe')](_0xd60b('0x28'));return request({'uri':util[_0xd60b('0x11')]('%s/api/v2/agents/me',_0x18660a[_0xd60b('0x1e')])})[_0xd60b('0x20')](function(_0x1439d3){logger['info'](_0xd60b('0x27'));return _0x1439d3;});}}function getEndUser(_0x5c13c7,_0x4fe8e2,_0x2e26f3){logger[_0xd60b('0xe')](_0xd60b('0x29'),_0x2e26f3);return request({'uri':util[_0xd60b('0x11')]('%s/api/v2/contacts',_0x5c13c7['remoteUri']),'qs':{'phone':_0x2e26f3}})['then'](function(_0x499dd7){if(_0x499dd7[_0xd60b('0x22')]){logger[_0xd60b('0xe')]('Enduser\x20found!');return _[_0xd60b('0x2a')](_0x499dd7,{'phone':_0x2e26f3});}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0xd60b('0x11')](_0xd60b('0x2b'),_0x5c13c7[_0xd60b('0x1e')]),'method':_0xd60b('0x1f'),'body':{'name':_0x4fe8e2,'phone':_0x2e26f3}})[_0xd60b('0x20')](function(_0x285830){logger['info']('Enduser\x20created.');return _0x285830;});}});}function getAuth(_0x8d8863){return util[_0xd60b('0x11')](_0xd60b('0x2c'),new Buffer(_0x8d8863[_0xd60b('0x2d')]+':X')[_0xd60b('0x2e')]('base64'));}function request(_0x2fef28){logger['debug'](_0xd60b('0x2f'),JSON[_0xd60b('0x30')](_0x2fef28));return rp(_[_0xd60b('0x9')](_0x2fef28,{'method':_0xd60b('0x31'),'headers':headers,'json':!![]}));}function getTags(_0x5a6541,_0xeb2260){var _0x2b2d4f=[];if(_0x5a6541&&_0x5a6541[_0xd60b('0x22')]>0x0){_0x2b2d4f=_[_0xd60b('0x32')](_0x5a6541,_0xeb2260);}return _0x2b2d4f;}function getCustomFields(_0x36e4cd,_0x8b88d3){var _0xf1548a=[];var _0x1be059={'custom_fields':[]};if(_0x36e4cd['length']>0x0){_['forEach'](_0x36e4cd,function(_0x3f7077){if(_['includes']([_0xd60b('0x33'),'picklist'],_0x3f7077[_0xd60b('0x34')])&&_0x3f7077[_0xd60b('0x35')]&&!_0x3f7077['customField']){_0x1be059[_0x3f7077['nameField']['toLowerCase']()]=_0x3f7077[_0xd60b('0x36')][_0xd60b('0x2e')]();}else if(_[_0xd60b('0x37')]([_0xd60b('0x33'),_0xd60b('0x38')],_0x3f7077[_0xd60b('0x34')])&&_0x3f7077[_0xd60b('0x39')]&&_0x3f7077[_0xd60b('0x3a')]){_0x1be059[_0xd60b('0x1b')][_0xd60b('0x3b')]({'id':_0x3f7077[_0xd60b('0x39')],'value':_0x3f7077[_0xd60b('0x36')][_0xd60b('0x2e')]()});}else if(_0x3f7077[_0xd60b('0x34')]===_0xd60b('0x3c')&&_0x3f7077['variableName']&&_0x3f7077[_0xd60b('0x39')]&&_0x3f7077[_0xd60b('0x3a')]){_0x8b88d3[_0x3f7077[_0xd60b('0x3d')]]&&_0x1be059[_0xd60b('0x1b')][_0xd60b('0x3b')]({'id':_0x3f7077['idField'],'value':_0x8b88d3[_0x3f7077['variableName']][_0xd60b('0x2e')]()});}else if(_0x3f7077[_0xd60b('0x34')]===_0xd60b('0x3e')&&_0x3f7077['Variable']&&_0x3f7077[_0xd60b('0x3f')][_0xd60b('0x19')]&&_0x3f7077['idField']&&_0x3f7077[_0xd60b('0x3a')]){_0x8b88d3[_0x3f7077['Variable'][_0xd60b('0x19')]['toLowerCase']()]&&_0x1be059[_0xd60b('0x1b')][_0xd60b('0x3b')]({'id':_0x3f7077[_0xd60b('0x39')],'value':_0x8b88d3[_0x3f7077['Variable'][_0xd60b('0x19')][_0xd60b('0x40')]()][_0xd60b('0x2e')]()});}});}return _0x1be059;}exports[_0xd60b('0x41')]=function(_0x3f90b4,_0x80daa7,_0x333286,_0xe69ad8,_0x480035,_0x4bc390){var _0x4eab9c,_0x31a30f;_0x4bc390[_0xd60b('0x1e')]=intUtil[_0xd60b('0x42')](_0x4bc390['remoteUri']);_0x4bc390[_0xd60b('0x43')]=intUtil[_0xd60b('0x42')](_0x4bc390['serverUrl']);if(_0x480035&&_0x480035['monitor_format']){logger[_0xd60b('0xe')](_0xd60b('0x44'),_0xd60b('0x45'));_0x80daa7[_0xd60b('0x46')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4bc390['serverUrl'],_0x80daa7[_0xd60b('0x47')],md5(_0x80daa7[_0xd60b('0x47')]));}else{_0x80daa7['recordingURL']='';}headers[_0xd60b('0x48')]=getAuth(_0x4bc390);return getUser(_0x4bc390,_0xe69ad8[_0xd60b('0x24')])['then'](function(_0x358b8f){_0x4eab9c=_0x358b8f;logger[_0xd60b('0xe')](_0xd60b('0x49'),_0x4eab9c['id']);return getEndUser(_0x4bc390,_0x80daa7[_0xd60b('0x13')],_0x80daa7['calleridnum']);})['then'](function(_0x37788e){_0x31a30f=_0x37788e;logger[_0xd60b('0xe')](_0xd60b('0x4a'),_0x31a30f['id']);return getTicket(_0x4bc390,_0x4eab9c,_0x31a30f,_0x333286,_0x80daa7);})[_0xd60b('0x20')](function(_0xcd493){if(_0xcd493&&_0xcd493['id']){logger[_0xd60b('0xe')](_0xd60b('0x21'));logger[_0xd60b('0xe')](_0xd60b('0x4b'),_0xcd493['id']);logger['info'](_0xd60b('0x44'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0xd60b('0x4c'),_0xe69ad8['name']),'trigger:browser:url',{'uri':util[_0xd60b('0x11')](_0xd60b('0x4d'),_0x4bc390[_0xd60b('0x1e')],_0xcd493['id'])});}})[_0xd60b('0x4e')](function(_0x28f5fd){logger[_0xd60b('0x4f')](_0xd60b('0x44'),JSON[_0xd60b('0x30')](_0x28f5fd));});};exports['outbound']=function(_0x2aed54,_0x20d719,_0x4231b9,_0x1e9a67,_0xa9ee18,_0x3fbe12,_0x4fea2d){var _0x3abb28,_0x49760e;_0x3fbe12[_0xd60b('0x1e')]=intUtil[_0xd60b('0x42')](_0x3fbe12[_0xd60b('0x1e')]);_0x3fbe12[_0xd60b('0x43')]=intUtil[_0xd60b('0x42')](_0x3fbe12[_0xd60b('0x43')]);if(_0x4fea2d&&_0x4fea2d[_0xd60b('0x50')]&&_0x4fea2d[_0xd60b('0x50')]!==_0xd60b('0x51')){logger[_0xd60b('0xe')](_0xd60b('0x52'),_0xd60b('0x45'));_0x20d719[_0xd60b('0x46')]=util[_0xd60b('0x11')](_0xd60b('0x53'),_0x3fbe12[_0xd60b('0x43')],_0x20d719[_0xd60b('0x47')],md5(_0x20d719['uniqueid']));}headers['Authorization']=getAuth(_0x3fbe12);return getUser(_0x3fbe12,_0x1e9a67['email'])['then'](function(_0x2a1ccb){_0x3abb28=_0x2a1ccb;logger[_0xd60b('0xe')]('The\x20User\x20ID\x20is:',_0x3abb28['id']);return getEndUser(_0x3fbe12,_0x20d719[_0xd60b('0x54')],_0x20d719[_0xd60b('0x55')]);})[_0xd60b('0x20')](function(_0x1fda8a){_0x49760e=_0x1fda8a;logger[_0xd60b('0xe')](_0xd60b('0x4a'),_0x49760e['id']);return getTicket(_0x3fbe12,_0x3abb28,_0x49760e,_0x4231b9,_0x20d719);})[_0xd60b('0x20')](function(_0x5d80a6){if(_0x5d80a6&&_0x5d80a6['id']){logger[_0xd60b('0xe')](_0xd60b('0x21'));logger[_0xd60b('0xe')](_0xd60b('0x4b'),_0x5d80a6['id']);logger[_0xd60b('0xe')](_0xd60b('0x52'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xd60b('0x11')](_0xd60b('0x4c'),_0x1e9a67[_0xd60b('0x19')]),_0xd60b('0x56'),{'uri':util[_0xd60b('0x11')](_0xd60b('0x4d'),_0x3fbe12[_0xd60b('0x1e')],_0x5d80a6['id'])});}})[_0xd60b('0x4e')](function(_0x395d29){logger[_0xd60b('0x4f')]('[OUTBOUND]',JSON[_0xd60b('0x30')](_0x395d29));});};exports[_0xd60b('0x57')]=function(_0x5c6dc7,_0x1475e0,_0x5379b6,_0x1f5737,_0x4e8aee,_0x44f864){var _0x2d64a1,_0x4f3070;_0x44f864[_0xd60b('0x1e')]=intUtil[_0xd60b('0x42')](_0x44f864[_0xd60b('0x1e')]);_0x44f864[_0xd60b('0x43')]=intUtil[_0xd60b('0x42')](_0x44f864[_0xd60b('0x43')]);if(_0x4e8aee&&_0x4e8aee[_0xd60b('0x58')]){logger[_0xd60b('0xe')]('['+_0x1475e0[_0xd60b('0x59')][_0xd60b('0x5a')]()+']',_0xd60b('0x45'));_0x1475e0[_0xd60b('0x46')]=util[_0xd60b('0x11')](_0xd60b('0x53'),_0x44f864[_0xd60b('0x43')],_0x1475e0[_0xd60b('0x47')],md5(_0x1475e0[_0xd60b('0x47')]));}else{_0x1475e0[_0xd60b('0x46')]='';}headers[_0xd60b('0x48')]=getAuth(_0x44f864);return getUser(_0x44f864,'')[_0xd60b('0x20')](function(_0x4c350f){_0x2d64a1=_0x4c350f;logger[_0xd60b('0xe')]('The\x20User\x20ID\x20is:',_0x2d64a1['id']);return getEndUser(_0x44f864,_0x1475e0[_0xd60b('0x13')],_0x1475e0[_0xd60b('0x14')]);})[_0xd60b('0x20')](function(_0x4c23c2){_0x4f3070=_0x4c23c2;logger[_0xd60b('0xe')](_0xd60b('0x4a'),_0x4f3070['id']);return getTicket(_0x44f864,_0x2d64a1,_0x4f3070,_0x5379b6,_0x1475e0);})[_0xd60b('0x20')](function(_0x33ca37){if(_0x33ca37){logger[_0xd60b('0xe')](_0xd60b('0x21'));logger['info'](_0xd60b('0x4b'),_0x33ca37['id']);}})[_0xd60b('0x4e')](function(_0x4ddd33){logger[_0xd60b('0x4f')]('['+_0x1475e0['lastevent']['toUpperCase']()+']',JSON[_0xd60b('0x30')](_0x4ddd33));});}; \ No newline at end of file +var _0x4e24=['recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','catch','error','stringify','outbound','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Ticket\x20created!','user:%s','%s/helpdesk/tickets/%d','unmanaged','lastevent','toUpperCase','lodash','request-promise','md5','ioredis','./util','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','Descriptions','
','Tags','name','Fields','custom_fields','format','POST','then','validateEmail','%s/api/v2/agents','remoteUri','length','Agent\x20found!','find','contact','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','Enduser\x20found!','%s/api/v2/contacts','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','debug','map','includes','string','picklist','type','nameField','toLowerCase','content','customField','idField','variableName','push','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!'];(function(_0x4fd131,_0x41e021){var _0x2820c2=function(_0xadfbd5){while(--_0xadfbd5){_0x4fd131['push'](_0x4fd131['shift']());}};_0x2820c2(++_0x41e021);}(_0x4e24,0xd3));var _0x44e2=function(_0x18d175,_0x151261){_0x18d175=_0x18d175-0x0;var _0x22e7af=_0x4e24[_0x18d175];return _0x22e7af;};'use strict';var _=require(_0x44e2('0x0'));var rp=require(_0x44e2('0x1'));var md5=require(_0x44e2('0x2'));var util=require('util');var Redis=require(_0x44e2('0x3'));var intUtil=require(_0x44e2('0x4'));var config=require('../../../../config/environment');var logger=require(_0x44e2('0x5'))(_0x44e2('0x6'));config[_0x44e2('0x7')]=_[_0x44e2('0x8')](config[_0x44e2('0x7')],{'host':_0x44e2('0x9'),'port':0x18eb});var io=require(_0x44e2('0xa'))(new Redis(config[_0x44e2('0x7')]));var headers={'Content-Type':_0x44e2('0xb'),'Accept':'application/json'};function emit(_0x52a557,_0x352b6b,_0x2268e2){io['to'](_0x52a557)[_0x44e2('0xc')](_0x352b6b,_0x2268e2);}function getTicket(_0x2fb1df,_0xc8f5c7,_0x29020d,_0x600acc,_0x24b774){logger[_0x44e2('0xd')](_0x44e2('0xe'));var _0x351286=_['merge']({'responder_id':_0xc8f5c7['id'],'requester_id':_0x29020d['id'],'name':util['format'](_0x44e2('0xf'),_0x24b774[_0x44e2('0x10')]),'phone':_0x24b774[_0x44e2('0x11')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x44e2('0x12')](_0x600acc[_0x44e2('0x13')],_0x24b774,'\x20'),'description':intUtil[_0x44e2('0x12')](_0x600acc[_0x44e2('0x14')],_0x24b774,_0x44e2('0x15')),'tags':getTags(_0x600acc[_0x44e2('0x16')],_0x44e2('0x17'))},getCustomFields(_0x600acc[_0x44e2('0x18')],_0x24b774));_0x351286[_0x44e2('0x19')]=_['mapValues'](_['keyBy'](_0x351286[_0x44e2('0x19')],'id'),'value');return request({'uri':util[_0x44e2('0x1a')]('%s/api/v2/tickets',_0x2fb1df['remoteUri']),'method':_0x44e2('0x1b'),'body':_0x351286})[_0x44e2('0x1c')](function(_0x325003){logger['info']('Ticket\x20created!');return _0x325003;});}function getUser(_0x557ebf,_0x307a00){if(intUtil[_0x44e2('0x1d')](_0x307a00)){return request({'uri':util['format'](_0x44e2('0x1e'),_0x557ebf[_0x44e2('0x1f')]),'qs':{'email':_0x307a00}})[_0x44e2('0x1c')](function(_0xefd60b){if(_0xefd60b[_0x44e2('0x20')]){logger[_0x44e2('0xd')](_0x44e2('0x21'));return _[_0x44e2('0x22')](_0xefd60b,function(_0x518b6f){return _0x518b6f[_0x44e2('0x23')]['email']===_0x307a00;});}else{logger[_0x44e2('0xd')](_0x44e2('0x24'));return request({'uri':util['format'](_0x44e2('0x25'),_0x557ebf[_0x44e2('0x1f')])})['then'](function(_0x3c7c87){logger[_0x44e2('0xd')](_0x44e2('0x26'));return _0x3c7c87;});}});}else{logger['info']('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format']('%s/api/v2/agents/me',_0x557ebf[_0x44e2('0x1f')])})['then'](function(_0x9aa327){logger[_0x44e2('0xd')](_0x44e2('0x26'));return _0x9aa327;});}}function getEndUser(_0x1e306e,_0x4ca388,_0x12a910){logger[_0x44e2('0xd')](_0x44e2('0x27'),_0x12a910);return request({'uri':util['format']('%s/api/v2/contacts',_0x1e306e['remoteUri']),'qs':{'phone':_0x12a910}})['then'](function(_0x3fa577){if(_0x3fa577[_0x44e2('0x20')]){logger[_0x44e2('0xd')](_0x44e2('0x28'));return _['find'](_0x3fa577,{'phone':_0x12a910});}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x44e2('0x1a')](_0x44e2('0x29'),_0x1e306e[_0x44e2('0x1f')]),'method':_0x44e2('0x1b'),'body':{'name':_0x4ca388,'phone':_0x12a910}})[_0x44e2('0x1c')](function(_0x329802){logger[_0x44e2('0xd')](_0x44e2('0x2a'));return _0x329802;});}});}function getAuth(_0xacf9a5){return util[_0x44e2('0x1a')](_0x44e2('0x2b'),new Buffer(_0xacf9a5[_0x44e2('0x2c')]+':X')[_0x44e2('0x2d')](_0x44e2('0x2e')));}function request(_0x3e3fb2){logger[_0x44e2('0x2f')]('[HTTP]',JSON['stringify'](_0x3e3fb2));return rp(_[_0x44e2('0x8')](_0x3e3fb2,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0xa9d294,_0x1939a0){var _0xab5ed4=[];if(_0xa9d294&&_0xa9d294[_0x44e2('0x20')]>0x0){_0xab5ed4=_[_0x44e2('0x30')](_0xa9d294,_0x1939a0);}return _0xab5ed4;}function getCustomFields(_0x51680c,_0x4b256a){var _0x2b37b3=[];var _0x1b4b0b={'custom_fields':[]};if(_0x51680c[_0x44e2('0x20')]>0x0){_['forEach'](_0x51680c,function(_0x2fffff){if(_[_0x44e2('0x31')]([_0x44e2('0x32'),_0x44e2('0x33')],_0x2fffff[_0x44e2('0x34')])&&_0x2fffff[_0x44e2('0x35')]&&!_0x2fffff['customField']){_0x1b4b0b[_0x2fffff['nameField'][_0x44e2('0x36')]()]=_0x2fffff[_0x44e2('0x37')][_0x44e2('0x2d')]();}else if(_[_0x44e2('0x31')]([_0x44e2('0x32'),_0x44e2('0x33')],_0x2fffff['type'])&&_0x2fffff['idField']&&_0x2fffff[_0x44e2('0x38')]){_0x1b4b0b[_0x44e2('0x19')]['push']({'id':_0x2fffff[_0x44e2('0x39')],'value':_0x2fffff[_0x44e2('0x37')]['toString']()});}else if(_0x2fffff[_0x44e2('0x34')]==='variable'&&_0x2fffff['variableName']&&_0x2fffff[_0x44e2('0x39')]&&_0x2fffff[_0x44e2('0x38')]){_0x4b256a[_0x2fffff[_0x44e2('0x3a')]]&&_0x1b4b0b[_0x44e2('0x19')][_0x44e2('0x3b')]({'id':_0x2fffff[_0x44e2('0x39')],'value':_0x4b256a[_0x2fffff[_0x44e2('0x3a')]][_0x44e2('0x2d')]()});}else if(_0x2fffff['type']===_0x44e2('0x3c')&&_0x2fffff[_0x44e2('0x3d')]&&_0x2fffff[_0x44e2('0x3d')][_0x44e2('0x17')]&&_0x2fffff[_0x44e2('0x39')]&&_0x2fffff['customField']){_0x4b256a[_0x2fffff[_0x44e2('0x3d')]['name'][_0x44e2('0x36')]()]&&_0x1b4b0b[_0x44e2('0x19')]['push']({'id':_0x2fffff[_0x44e2('0x39')],'value':_0x4b256a[_0x2fffff[_0x44e2('0x3d')]['name']['toLowerCase']()]['toString']()});}});}return _0x1b4b0b;}exports[_0x44e2('0x3e')]=function(_0x193774,_0x599bf4,_0x223bff,_0xf9d790,_0x4235bf,_0x520b29){var _0x2cda28,_0x245651;_0x520b29[_0x44e2('0x1f')]=intUtil[_0x44e2('0x3f')](_0x520b29[_0x44e2('0x1f')]);_0x520b29[_0x44e2('0x40')]=intUtil['stripTrailingSlash'](_0x520b29[_0x44e2('0x40')]);if(_0x4235bf&&_0x4235bf[_0x44e2('0x41')]){logger[_0x44e2('0xd')](_0x44e2('0x42'),_0x44e2('0x43'));_0x599bf4[_0x44e2('0x44')]=util[_0x44e2('0x1a')](_0x44e2('0x45'),_0x520b29[_0x44e2('0x40')],_0x599bf4['uniqueid'],md5(_0x599bf4[_0x44e2('0x46')]));}else{_0x599bf4[_0x44e2('0x44')]='';}headers[_0x44e2('0x47')]=getAuth(_0x520b29);return getUser(_0x520b29,_0xf9d790[_0x44e2('0x48')])['then'](function(_0x12fa1c){_0x2cda28=_0x12fa1c;logger['info']('The\x20User\x20ID\x20is:',_0x2cda28['id']);return getEndUser(_0x520b29,_0x599bf4['calleridname'],_0x599bf4['calleridnum']);})[_0x44e2('0x1c')](function(_0x326f79){_0x245651=_0x326f79;logger[_0x44e2('0xd')](_0x44e2('0x49'),_0x245651['id']);return getTicket(_0x520b29,_0x2cda28,_0x245651,_0x223bff,_0x599bf4);})[_0x44e2('0x1c')](function(_0x32154e){if(_0x32154e&&_0x32154e['id']){logger['info']('Ticket\x20created!');logger[_0x44e2('0xd')](_0x44e2('0x4a'),_0x32154e['id']);logger['info'](_0x44e2('0x42'),_0x44e2('0x4b'));emit(util[_0x44e2('0x1a')]('user:%s',_0xf9d790[_0x44e2('0x17')]),_0x44e2('0x4c'),{'uri':util[_0x44e2('0x1a')]('%s/helpdesk/tickets/%d',_0x520b29[_0x44e2('0x1f')],_0x32154e['id'])});}})[_0x44e2('0x4d')](function(_0x5a4866){logger[_0x44e2('0x4e')]('[QUEUE]',JSON[_0x44e2('0x4f')](_0x5a4866));});};exports[_0x44e2('0x50')]=function(_0x1a4a86,_0x4f2c5f,_0x48146d,_0x30545a,_0x5b049f,_0xa336c4,_0x99432b){var _0x10691e,_0x191550;_0xa336c4[_0x44e2('0x1f')]=intUtil[_0x44e2('0x3f')](_0xa336c4[_0x44e2('0x1f')]);_0xa336c4[_0x44e2('0x40')]=intUtil[_0x44e2('0x3f')](_0xa336c4[_0x44e2('0x40')]);if(_0x99432b&&_0x99432b[_0x44e2('0x51')]&&_0x99432b[_0x44e2('0x51')]!==_0x44e2('0x52')){logger[_0x44e2('0xd')](_0x44e2('0x53'),_0x44e2('0x43'));_0x4f2c5f[_0x44e2('0x44')]=util[_0x44e2('0x1a')](_0x44e2('0x45'),_0xa336c4[_0x44e2('0x40')],_0x4f2c5f[_0x44e2('0x46')],md5(_0x4f2c5f['uniqueid']));}headers[_0x44e2('0x47')]=getAuth(_0xa336c4);return getUser(_0xa336c4,_0x30545a[_0x44e2('0x48')])[_0x44e2('0x1c')](function(_0x25eb04){_0x10691e=_0x25eb04;logger['info'](_0x44e2('0x54'),_0x10691e['id']);return getEndUser(_0xa336c4,_0x4f2c5f[_0x44e2('0x55')],_0x4f2c5f[_0x44e2('0x56')]);})['then'](function(_0x485bb6){_0x191550=_0x485bb6;logger[_0x44e2('0xd')](_0x44e2('0x49'),_0x191550['id']);return getTicket(_0xa336c4,_0x10691e,_0x191550,_0x48146d,_0x4f2c5f);})['then'](function(_0x3990e5){if(_0x3990e5&&_0x3990e5['id']){logger[_0x44e2('0xd')](_0x44e2('0x57'));logger['info'](_0x44e2('0x4a'),_0x3990e5['id']);logger[_0x44e2('0xd')](_0x44e2('0x53'),_0x44e2('0x4b'));emit(util['format'](_0x44e2('0x58'),_0x30545a[_0x44e2('0x17')]),_0x44e2('0x4c'),{'uri':util[_0x44e2('0x1a')](_0x44e2('0x59'),_0xa336c4['remoteUri'],_0x3990e5['id'])});}})[_0x44e2('0x4d')](function(_0x7ec155){logger[_0x44e2('0x4e')](_0x44e2('0x53'),JSON[_0x44e2('0x4f')](_0x7ec155));});};exports[_0x44e2('0x5a')]=function(_0x17f7cb,_0x381529,_0x58f043,_0x27877c,_0x772711,_0x3152dd){var _0x3d50ec,_0x3a58d8;_0x3152dd[_0x44e2('0x1f')]=intUtil[_0x44e2('0x3f')](_0x3152dd['remoteUri']);_0x3152dd[_0x44e2('0x40')]=intUtil[_0x44e2('0x3f')](_0x3152dd[_0x44e2('0x40')]);if(_0x772711&&_0x772711['monitor_format']){logger[_0x44e2('0xd')]('['+_0x381529[_0x44e2('0x5b')]['toUpperCase']()+']',_0x44e2('0x43'));_0x381529[_0x44e2('0x44')]=util[_0x44e2('0x1a')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3152dd[_0x44e2('0x40')],_0x381529['uniqueid'],md5(_0x381529[_0x44e2('0x46')]));}else{_0x381529[_0x44e2('0x44')]='';}headers['Authorization']=getAuth(_0x3152dd);return getUser(_0x3152dd,'')['then'](function(_0x305345){_0x3d50ec=_0x305345;logger[_0x44e2('0xd')](_0x44e2('0x54'),_0x3d50ec['id']);return getEndUser(_0x3152dd,_0x381529[_0x44e2('0x10')],_0x381529['calleridnum']);})[_0x44e2('0x1c')](function(_0x2cdc4f){_0x3a58d8=_0x2cdc4f;logger[_0x44e2('0xd')]('The\x20Enduser\x20ID\x20is:',_0x3a58d8['id']);return getTicket(_0x3152dd,_0x3d50ec,_0x3a58d8,_0x58f043,_0x381529);})['then'](function(_0x5d12b0){if(_0x5d12b0){logger[_0x44e2('0xd')](_0x44e2('0x57'));logger[_0x44e2('0xd')]('The\x20Ticket\x20ID\x20is:',_0x5d12b0['id']);}})['catch'](function(_0x4131f0){logger['error']('['+_0x381529[_0x44e2('0x5b')][_0x44e2('0x5c')]()+']',JSON[_0x44e2('0x4f')](_0x4131f0));});}; \ 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 ff32eb4..3ca7b7d 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 _0x3954=['bluebird','./util','../../../../config/environment','../../../../config/logger','freshsales','redis','localhost','GET','/api/selector/owners','headers','Getting\x20admin\x20information','users','length','email','adminEmail','adminId','info','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','agentEmail','Getting\x20user\x20with\x20email','userEmail','userId','Admin\x20selected','/api/lookup?q=','&f=','then','find','contacts','format','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','Subjects','getString','Descriptions','Contact','add','task','Task\x20created:','ticketId','/contacts/','user:%s','trigger:browser:url','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','outbound','callDirection','unmanaged','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name','inspect','lodash','request-promise','md5','util','moment'];(function(_0x3d5a86,_0x1843c4){var _0x4e0cff=function(_0x2222a5){while(--_0x2222a5){_0x3d5a86['push'](_0x3d5a86['shift']());}};_0x4e0cff(++_0x1843c4);}(_0x3954,0x19f));var _0x4395=function(_0x255d40,_0xc2978a){_0x255d40=_0x255d40-0x0;var _0x46e64b=_0x3954[_0x255d40];return _0x46e64b;};'use strict';var _=require(_0x4395('0x0'));var rp=require(_0x4395('0x1'));var md5=require(_0x4395('0x2'));var util=require(_0x4395('0x3'));var moment=require(_0x4395('0x4'));var Promise=require(_0x4395('0x5'));var Redis=require('ioredis');var intUtil=require(_0x4395('0x6'));var config=require(_0x4395('0x7'));var logger=require(_0x4395('0x8'))(_0x4395('0x9'));config[_0x4395('0xa')]=_['defaults'](config[_0x4395('0xa')],{'host':_0x4395('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function getAdminId(_0x4812f4,_0x36f24c,_0x4dc2f7,_0x1042c4){return new Promise(function(_0x5bc949,_0x57d611){var _0x51b55c=![];var _0x3b3134={'method':_0x4395('0xc'),'uri':_0x1042c4+_0x4395('0xd'),'json':!![]};_0x3b3134[_0x4395('0xe')]=_0x4dc2f7;logger['info'](_0x4395('0xf'));return rp(_0x3b3134)['then'](function(_0x41f51d){if(_0x41f51d){var _0x5694c7=_0x41f51d[_0x4395('0x10')];var _0x6bad32=null;for(_0x6bad32=0x0;_0x6bad32<_0x5694c7[_0x4395('0x11')];_0x6bad32++){if(_0x5694c7[_0x6bad32][_0x4395('0x12')]===_0x4812f4[_0x4395('0x13')]){_0x4812f4[_0x4395('0x14')]=_0x5694c7[_0x6bad32]['id'];_0x51b55c=!![];}}if(_0x51b55c){logger[_0x4395('0x15')](_0x4395('0x16'),_0x4812f4['adminId']);_0x5bc949(_0x4812f4);}else{_0x57d611({'statusCode':0x194,'message':_0x4395('0x17')});}}else{_0x57d611({'statusCode':0x194,'message':_0x4395('0x17')});}})[_0x4395('0x18')](function(_0x4fe0dc){logger[_0x4395('0x19')]('['+[_0x36f24c[_0x4395('0x1a')]()]+']',_0x4fe0dc[_0x4395('0x1b')]);_0x57d611(_0x4fe0dc);});});}function getUser(_0x19c84a,_0x2387af,_0x512891){return function(_0x41bef2){return new Promise(function(_0x563620,_0x3f9f98){var _0x1b7dec={'method':_0x4395('0xc'),'uri':_0x512891+_0x4395('0xd'),'json':!![]};_0x1b7dec[_0x4395('0xe')]=_0x2387af;logger[_0x4395('0x15')]('Getting\x20user\x20list');return rp(_0x1b7dec)['then'](function(_0x5d5478){if(_0x5d5478){var _0x444732=_0x5d5478[_0x4395('0x10')];var _0xc67402=![];var _0x3df849=null;if(_0x41bef2[_0x4395('0x1c')]!==null){logger[_0x4395('0x15')](_0x4395('0x1d'),_0x41bef2['agentEmail']);_0x41bef2[_0x4395('0x1e')]=_0x41bef2[_0x4395('0x1c')];for(_0x3df849=0x0;_0x3df849<_0x444732[_0x4395('0x11')];_0x3df849++){if(_0x444732[_0x3df849][_0x4395('0x12')]===_0x41bef2['agentEmail']){_0xc67402=!![];_0x41bef2['userId']=_0x444732[_0x3df849]['id'];logger[_0x4395('0x15')]('User\x20found:',_0x41bef2[_0x4395('0x1f')]);}}}if(!_0xc67402){logger['info'](_0x4395('0x20'));_0x41bef2[_0x4395('0x1e')]=_0x41bef2[_0x4395('0x13')];_0x41bef2[_0x4395('0x1f')]=_0x41bef2['adminId'];_0xc67402=!![];}if(_0xc67402){_0x563620(_0x41bef2);}else{_0x3f9f98({'statusCode':0x194,'message':_0x4395('0x17')});}}else{_0x3f9f98({'statusCode':0x194,'message':_0x4395('0x17')});}})[_0x4395('0x18')](function(_0x39b380){logger['error']('['+[_0x19c84a[_0x4395('0x1a')]()]+']',_0x39b380[_0x4395('0x1b')]);_0x3f9f98(_0x39b380);});});};}function searchContact(_0x3efdd7,_0x24f475,_0x2833f6,_0xfbef65){return new Promise(function(_0x291d8f,_0x462f02){var _0x39736f={'method':_0x4395('0xc'),'headers':_0x24f475,'uri':_0x3efdd7+_0x4395('0x21')+_0xfbef65+_0x4395('0x22')+_0x2833f6+'&entities=contact','json':!![]};rp(_0x39736f)[_0x4395('0x23')](function(_0x48b70c){var _0x10ec0d=_[_0x4395('0x24')](_0x48b70c[_0x4395('0x25')]['contacts'],[_0x2833f6,_0xfbef65]);_0x291d8f(_0x10ec0d);})[_0x4395('0x18')](function(_0xa3dc78){_0x462f02(_0xa3dc78);});});}function getEndUser(_0x211523,_0x63dc4d,_0x10590c){return function(_0x1fd6ea){return new Promise(function(_0x1d2a81,_0x2d85b9){logger[_0x4395('0x15')](util[_0x4395('0x26')]('Searching\x20contact\x20with\x20phone\x20%s',_0x1fd6ea[_0x4395('0x27')]));searchContact(_0x10590c,_0x63dc4d,_0x4395('0x28'),_0x1fd6ea['contactNumber'])[_0x4395('0x23')](function(_0x2fa954){if(_0x2fa954){_0x1fd6ea[_0x4395('0x29')]=_0x2fa954['id'];logger[_0x4395('0x15')](_0x4395('0x2a'),_0x1fd6ea[_0x4395('0x29')]);return _0x1d2a81(_0x1fd6ea);}searchContact(_0x10590c,_0x63dc4d,_0x4395('0x2b'),_0x1fd6ea[_0x4395('0x27')])[_0x4395('0x23')](function(_0x53e6f2){if(_0x53e6f2){_0x1fd6ea[_0x4395('0x29')]=_0x53e6f2['id'];logger['info'](_0x4395('0x2c'),_0x1fd6ea[_0x4395('0x29')]);return _0x1d2a81(_0x1fd6ea);}createEndUser(_0x1fd6ea,_0x211523,_0x63dc4d,_0x10590c)[_0x4395('0x23')](function(_0x237992){logger[_0x4395('0x15')](_0x4395('0x2d'),_0x237992[_0x4395('0x29')]);return _0x1d2a81(_0x237992);});});})['catch'](function(_0x299f46){_0x2d85b9(_0x299f46);});});};}function createEndUser(_0x52fb93,_0x3c9a39,_0x464d89,_0x41d90c){return new Promise(function(_0x333c95,_0x4e33cf){var _0x9d20de=moment();var _0x1249e6={'method':_0x4395('0x2e'),'uri':_0x41d90c+_0x4395('0x2f'),'body':{'contact':{'last_name':_0x52fb93['contactNumber'],'work_number':_0x52fb93[_0x4395('0x27')],'mobile_number':_0x52fb93[_0x4395('0x27')],'owner_id':_0x52fb93[_0x4395('0x1f')],'created_at':_0x9d20de['format'](_0x4395('0x30'))}},'json':!![]};_0x1249e6[_0x4395('0xe')]=_0x464d89;logger[_0x4395('0x15')](_0x4395('0x31'));return rp(_0x1249e6)[_0x4395('0x23')](function(_0x2b5c3e){_0x52fb93[_0x4395('0x29')]=_0x2b5c3e[_0x4395('0x32')]['id'];_0x333c95(_0x52fb93);})[_0x4395('0x18')](function(_0x4143ee){logger[_0x4395('0x19')]('['+[_0x3c9a39[_0x4395('0x1a')]()]+']',_0x4143ee[_0x4395('0x1b')]);_0x4e33cf(_0x4143ee[_0x4395('0x1b')]);});});}function getTicket(_0x218358,_0x307bea,_0x1c2074,_0xbf46c0,_0x1d4821){return function(_0x375a6c){logger[_0x4395('0x15')](_0x4395('0x33'));return new Promise(function(_0x41554d,_0x56a903){var _0x54008f=moment();var _0x471faf={'method':_0x4395('0x2e'),'uri':_0x1c2074+_0x4395('0x34'),'body':{'title':intUtil['getString'](_0xbf46c0[_0x4395('0x35')],_0x1d4821,'\x20'),'description':intUtil[_0x4395('0x36')](_0xbf46c0[_0x4395('0x37')],_0x1d4821,'\x0a'),'owner_id':_0x375a6c[_0x4395('0x1f')],'creater_id':_0x375a6c[_0x4395('0x14')],'targetable_id':_0x375a6c[_0x4395('0x29')],'targetable_type':_0x4395('0x38'),'created_at':_0x54008f[_0x4395('0x26')]('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x54008f[_0x4395('0x39')](0x1e,'m')[_0x4395('0x26')](_0x4395('0x30'))},'json':!![]};_0x471faf[_0x4395('0xe')]=_0x307bea;return rp(_0x471faf)['then'](function(_0x198b8f){_0x375a6c['ticketId']=_0x198b8f[_0x4395('0x3a')]['id'];logger['info'](_0x4395('0x3b'),_0x375a6c[_0x4395('0x3c')]);_0x41554d(_0x375a6c);})[_0x4395('0x18')](function(_0x482c3c){logger[_0x4395('0x19')]('['+[_0x218358[_0x4395('0x1a')]()]+']',_0x482c3c[_0x4395('0x1b')]);_0x56a903(_0x482c3c[_0x4395('0x1b')]);});});};}function emit(_0x21e4d9,_0x4040ef,_0x4d2ee3){var _0x4f934f={'uri':_0x21e4d9+_0x4395('0x3d')+_0x4d2ee3};io['to'](util['format'](_0x4395('0x3e'),_0x4040ef))['emit'](_0x4395('0x3f'),_0x4f934f);}exports['cs']=function(_0x119bbe,_0x49afc9,_0x360ff9,_0x43f743,_0x588d72,_0x188f8a,_0x658b83,_0x12c4de){var _0x5445b6={};var _0xf0ee41={'Authorization':'Token\x20token='+_0x188f8a[_0x4395('0x40')]};_0x188f8a[_0x4395('0x41')]=intUtil[_0x4395('0x42')](_0x188f8a['remoteUri']);_0x188f8a['serverUrl']=intUtil[_0x4395('0x42')](_0x188f8a[_0x4395('0x43')]);var _0x4c1de1=_0x188f8a[_0x4395('0x41')];_0x5445b6[_0x4395('0x13')]=_0x188f8a[_0x4395('0x44')];_0x5445b6[_0x4395('0x27')]=_0x12c4de[_0x4395('0x45')]()===_0x4395('0x46')?_0x49afc9['destcalleridnum']:_0x49afc9['calleridnum'];_0x5445b6[_0x4395('0x47')]=_0x12c4de==='queue'||_0x12c4de===_0x4395('0x48')?_0x4395('0x49'):_0x4395('0x46');if(_0x43f743){_0x5445b6['agentEmail']=_0x43f743[_0x4395('0x12')];}var _0xea641d=util['format'](_0x4395('0x4a'),_0x188f8a['serverUrl'],_0x49afc9['uniqueid'],md5(_0x49afc9[_0x4395('0x4b')]));if(_0x588d72&&_0x588d72[_0x4395('0x4c')]){logger[_0x4395('0x15')](_0x4395('0x4d'),'Recording\x20is\x20enabled!');_0x49afc9[_0x4395('0x4e')]=_0xea641d;}else if(_0x658b83&&_0x658b83[_0x4395('0x4f')]&&_0x658b83['recordingFormat']!=='none'){logger['info']('[OUTBOUND]','Recording\x20is\x20enabled!');_0x49afc9[_0x4395('0x4e')]=_0xea641d;}else{_0x49afc9['recordingURL']='';}return getAdminId(_0x5445b6,_0x12c4de,_0xf0ee41,_0x4c1de1)[_0x4395('0x23')](getUser(_0x12c4de,_0xf0ee41,_0x4c1de1))[_0x4395('0x23')](getEndUser(_0x12c4de,_0xf0ee41,_0x4c1de1))[_0x4395('0x23')](getTicket(_0x12c4de,_0xf0ee41,_0x4c1de1,_0x360ff9,_0x49afc9))['then'](function(_0x178414){logger['info'](util[_0x4395('0x26')](_0x4395('0x50'),_0x178414[_0x4395('0x3c')]));if(_0x12c4de!==_0x4395('0x48')){logger['info']('['+[_0x12c4de['toUpperCase']()]+']',_0x4395('0x51'));emit(_0x4c1de1,_0x43f743[_0x4395('0x52')],_0x178414[_0x4395('0x29')]);}})[_0x4395('0x18')](function(_0x5238f3){logger[_0x4395('0x19')]('['+[_0x12c4de['toUpperCase']()]+']\x20Error\x20running\x20Freshsales\x20integration',util[_0x4395('0x53')](_0x5238f3,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x4b7f=['/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','destcalleridnum','calleridnum','queue','unmanaged','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','inspect','lodash','request-promise','util','moment','bluebird','./util','../../../../config/logger','freshsales','defaults','redis','socket.io-emitter','GET','info','Getting\x20admin\x20information','then','users','length','email','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','/api/selector/owners','headers','Getting\x20user\x20list','Getting\x20user\x20with\x20email','agentEmail','userEmail','userId','User\x20found:','Admin\x20selected','toUpperCase','/api/lookup?q=','&f=','&entities=contact','find','contacts','catch','format','Searching\x20contact\x20with\x20phone\x20%s','mobile_number','contactNumber','endUserId','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','message','Creating\x20new\x20task','/api/tasks','getString','Subjects','Descriptions','add','task','Task\x20created:','ticketId','error'];(function(_0x487863,_0xbc1a23){var _0x3ea533=function(_0x15c238){while(--_0x15c238){_0x487863['push'](_0x487863['shift']());}};_0x3ea533(++_0xbc1a23);}(_0x4b7f,0xc9));var _0xf4b7=function(_0x5f4168,_0x128bfe){_0x5f4168=_0x5f4168-0x0;var _0x896861=_0x4b7f[_0x5f4168];return _0x896861;};'use strict';var _=require(_0xf4b7('0x0'));var rp=require(_0xf4b7('0x1'));var md5=require('md5');var util=require(_0xf4b7('0x2'));var moment=require(_0xf4b7('0x3'));var Promise=require(_0xf4b7('0x4'));var Redis=require('ioredis');var intUtil=require(_0xf4b7('0x5'));var config=require('../../../../config/environment');var logger=require(_0xf4b7('0x6'))(_0xf4b7('0x7'));config['redis']=_[_0xf4b7('0x8')](config[_0xf4b7('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0xf4b7('0xa'))(new Redis(config['redis']));function getAdminId(_0x4f5686,_0x1b05db,_0x485cac,_0xc60d39){return new Promise(function(_0x2739b2,_0x1324c){var _0xe582d9=![];var _0x1364dc={'method':_0xf4b7('0xb'),'uri':_0xc60d39+'/api/selector/owners','json':!![]};_0x1364dc['headers']=_0x485cac;logger[_0xf4b7('0xc')](_0xf4b7('0xd'));return rp(_0x1364dc)[_0xf4b7('0xe')](function(_0x5b6939){if(_0x5b6939){var _0x4dd250=_0x5b6939[_0xf4b7('0xf')];var _0x369aa3=null;for(_0x369aa3=0x0;_0x369aa3<_0x4dd250[_0xf4b7('0x10')];_0x369aa3++){if(_0x4dd250[_0x369aa3][_0xf4b7('0x11')]===_0x4f5686[_0xf4b7('0x12')]){_0x4f5686[_0xf4b7('0x13')]=_0x4dd250[_0x369aa3]['id'];_0xe582d9=!![];}}if(_0xe582d9){logger['info'](_0xf4b7('0x14'),_0x4f5686[_0xf4b7('0x13')]);_0x2739b2(_0x4f5686);}else{_0x1324c({'statusCode':0x194,'message':_0xf4b7('0x15')});}}else{_0x1324c({'statusCode':0x194,'message':_0xf4b7('0x15')});}})['catch'](function(_0x34ec49){logger['error']('['+[_0x1b05db['toUpperCase']()]+']',_0x34ec49['message']);_0x1324c(_0x34ec49);});});}function getUser(_0x297ddb,_0x7be712,_0x13c4a6){return function(_0x48c6a6){return new Promise(function(_0x13d1ee,_0x38f7ca){var _0x54c77c={'method':_0xf4b7('0xb'),'uri':_0x13c4a6+_0xf4b7('0x16'),'json':!![]};_0x54c77c[_0xf4b7('0x17')]=_0x7be712;logger[_0xf4b7('0xc')](_0xf4b7('0x18'));return rp(_0x54c77c)[_0xf4b7('0xe')](function(_0x2b4c6e){if(_0x2b4c6e){var _0x3f8ba6=_0x2b4c6e[_0xf4b7('0xf')];var _0x8258b0=![];var _0x14bfdb=null;if(_0x48c6a6['agentEmail']!==null){logger[_0xf4b7('0xc')](_0xf4b7('0x19'),_0x48c6a6[_0xf4b7('0x1a')]);_0x48c6a6[_0xf4b7('0x1b')]=_0x48c6a6[_0xf4b7('0x1a')];for(_0x14bfdb=0x0;_0x14bfdb<_0x3f8ba6[_0xf4b7('0x10')];_0x14bfdb++){if(_0x3f8ba6[_0x14bfdb][_0xf4b7('0x11')]===_0x48c6a6['agentEmail']){_0x8258b0=!![];_0x48c6a6[_0xf4b7('0x1c')]=_0x3f8ba6[_0x14bfdb]['id'];logger[_0xf4b7('0xc')](_0xf4b7('0x1d'),_0x48c6a6[_0xf4b7('0x1c')]);}}}if(!_0x8258b0){logger['info'](_0xf4b7('0x1e'));_0x48c6a6[_0xf4b7('0x1b')]=_0x48c6a6[_0xf4b7('0x12')];_0x48c6a6[_0xf4b7('0x1c')]=_0x48c6a6[_0xf4b7('0x13')];_0x8258b0=!![];}if(_0x8258b0){_0x13d1ee(_0x48c6a6);}else{_0x38f7ca({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x38f7ca({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})['catch'](function(_0x37b314){logger['error']('['+[_0x297ddb[_0xf4b7('0x1f')]()]+']',_0x37b314['message']);_0x38f7ca(_0x37b314);});});};}function searchContact(_0x1180e6,_0x24541d,_0x32e6fe,_0x27c3e7){return new Promise(function(_0x199544,_0x48dc5f){var _0x16344a={'method':_0xf4b7('0xb'),'headers':_0x24541d,'uri':_0x1180e6+_0xf4b7('0x20')+_0x27c3e7+_0xf4b7('0x21')+_0x32e6fe+_0xf4b7('0x22'),'json':!![]};rp(_0x16344a)['then'](function(_0x43061e){var _0x45c2c8=_[_0xf4b7('0x23')](_0x43061e[_0xf4b7('0x24')]['contacts'],[_0x32e6fe,_0x27c3e7]);_0x199544(_0x45c2c8);})[_0xf4b7('0x25')](function(_0x48af1c){_0x48dc5f(_0x48af1c);});});}function getEndUser(_0x415a3e,_0x241763,_0x41f8a5){return function(_0x25061a){return new Promise(function(_0x3d38fe,_0x5e23c8){logger['info'](util[_0xf4b7('0x26')](_0xf4b7('0x27'),_0x25061a['contactNumber']));searchContact(_0x41f8a5,_0x241763,_0xf4b7('0x28'),_0x25061a[_0xf4b7('0x29')])[_0xf4b7('0xe')](function(_0x313cd5){if(_0x313cd5){_0x25061a[_0xf4b7('0x2a')]=_0x313cd5['id'];logger[_0xf4b7('0xc')]('Contact\x20found\x20mobile_number:',_0x25061a[_0xf4b7('0x2a')]);return _0x3d38fe(_0x25061a);}searchContact(_0x41f8a5,_0x241763,'work_number',_0x25061a[_0xf4b7('0x29')])['then'](function(_0x1b3876){if(_0x1b3876){_0x25061a[_0xf4b7('0x2a')]=_0x1b3876['id'];logger[_0xf4b7('0xc')](_0xf4b7('0x2b'),_0x25061a[_0xf4b7('0x2a')]);return _0x3d38fe(_0x25061a);}createEndUser(_0x25061a,_0x415a3e,_0x241763,_0x41f8a5)[_0xf4b7('0xe')](function(_0x17b91b){logger[_0xf4b7('0xc')](_0xf4b7('0x2c'),_0x17b91b[_0xf4b7('0x2a')]);return _0x3d38fe(_0x17b91b);});});})['catch'](function(_0x1ab41b){_0x5e23c8(_0x1ab41b);});});};}function createEndUser(_0x40621d,_0x4be3d5,_0x513aa1,_0x380616){return new Promise(function(_0x5f3421,_0x4e6037){var _0x4ba469=moment();var _0x5cdede={'method':_0xf4b7('0x2d'),'uri':_0x380616+_0xf4b7('0x2e'),'body':{'contact':{'last_name':_0x40621d[_0xf4b7('0x29')],'work_number':_0x40621d[_0xf4b7('0x29')],'mobile_number':_0x40621d[_0xf4b7('0x29')],'owner_id':_0x40621d['userId'],'created_at':_0x4ba469[_0xf4b7('0x26')](_0xf4b7('0x2f'))}},'json':!![]};_0x5cdede[_0xf4b7('0x17')]=_0x513aa1;logger['info'](_0xf4b7('0x30'));return rp(_0x5cdede)[_0xf4b7('0xe')](function(_0x2c2db3){_0x40621d[_0xf4b7('0x2a')]=_0x2c2db3['contact']['id'];_0x5f3421(_0x40621d);})['catch'](function(_0x2494aa){logger['error']('['+[_0x4be3d5['toUpperCase']()]+']',_0x2494aa[_0xf4b7('0x31')]);_0x4e6037(_0x2494aa[_0xf4b7('0x31')]);});});}function getTicket(_0xf36680,_0x4ab05f,_0x4d66b0,_0x270ef9,_0x516008){return function(_0x2ab884){logger['info'](_0xf4b7('0x32'));return new Promise(function(_0x17749c,_0x1422db){var _0xaf4b97=moment();var _0x4b66b6={'method':'POST','uri':_0x4d66b0+_0xf4b7('0x33'),'body':{'title':intUtil[_0xf4b7('0x34')](_0x270ef9[_0xf4b7('0x35')],_0x516008,'\x20'),'description':intUtil[_0xf4b7('0x34')](_0x270ef9[_0xf4b7('0x36')],_0x516008,'\x0a'),'owner_id':_0x2ab884['userId'],'creater_id':_0x2ab884['adminId'],'targetable_id':_0x2ab884['endUserId'],'targetable_type':'Contact','created_at':_0xaf4b97[_0xf4b7('0x26')](_0xf4b7('0x2f')),'due_date':_0xaf4b97[_0xf4b7('0x37')](0x1e,'m')[_0xf4b7('0x26')](_0xf4b7('0x2f'))},'json':!![]};_0x4b66b6[_0xf4b7('0x17')]=_0x4ab05f;return rp(_0x4b66b6)[_0xf4b7('0xe')](function(_0xd75e9c){_0x2ab884['ticketId']=_0xd75e9c[_0xf4b7('0x38')]['id'];logger[_0xf4b7('0xc')](_0xf4b7('0x39'),_0x2ab884[_0xf4b7('0x3a')]);_0x17749c(_0x2ab884);})[_0xf4b7('0x25')](function(_0x267694){logger[_0xf4b7('0x3b')]('['+[_0xf36680[_0xf4b7('0x1f')]()]+']',_0x267694[_0xf4b7('0x31')]);_0x1422db(_0x267694[_0xf4b7('0x31')]);});});};}function emit(_0x47eddc,_0x15a5ed,_0x4d5adf){var _0x5da3e7={'uri':_0x47eddc+_0xf4b7('0x3c')+_0x4d5adf};io['to'](util[_0xf4b7('0x26')](_0xf4b7('0x3d'),_0x15a5ed))[_0xf4b7('0x3e')](_0xf4b7('0x3f'),_0x5da3e7);}exports['cs']=function(_0x3027d2,_0x564a24,_0x447002,_0x2e642d,_0x24b1e4,_0x2e5d50,_0x429099,_0x46f5b0){var _0x1e077c={};var _0x29a4e4={'Authorization':_0xf4b7('0x40')+_0x2e5d50[_0xf4b7('0x41')]};_0x2e5d50[_0xf4b7('0x42')]=intUtil[_0xf4b7('0x43')](_0x2e5d50['remoteUri']);_0x2e5d50['serverUrl']=intUtil['stripTrailingSlash'](_0x2e5d50[_0xf4b7('0x44')]);var _0xc44b39=_0x2e5d50[_0xf4b7('0x42')];_0x1e077c[_0xf4b7('0x12')]=_0x2e5d50[_0xf4b7('0x45')];_0x1e077c['contactNumber']=_0x46f5b0['toLowerCase']()==='outbound'?_0x564a24[_0xf4b7('0x46')]:_0x564a24[_0xf4b7('0x47')];_0x1e077c['callDirection']=_0x46f5b0===_0xf4b7('0x48')||_0x46f5b0===_0xf4b7('0x49')?_0xf4b7('0x48'):_0xf4b7('0x4a');if(_0x2e642d){_0x1e077c['agentEmail']=_0x2e642d[_0xf4b7('0x11')];}var _0x4291fd=util[_0xf4b7('0x26')](_0xf4b7('0x4b'),_0x2e5d50['serverUrl'],_0x564a24[_0xf4b7('0x4c')],md5(_0x564a24[_0xf4b7('0x4c')]));if(_0x24b1e4&&_0x24b1e4[_0xf4b7('0x4d')]){logger['info'](_0xf4b7('0x4e'),_0xf4b7('0x4f'));_0x564a24[_0xf4b7('0x50')]=_0x4291fd;}else if(_0x429099&&_0x429099[_0xf4b7('0x51')]&&_0x429099[_0xf4b7('0x51')]!==_0xf4b7('0x52')){logger['info'](_0xf4b7('0x53'),_0xf4b7('0x4f'));_0x564a24['recordingURL']=_0x4291fd;}else{_0x564a24['recordingURL']='';}return getAdminId(_0x1e077c,_0x46f5b0,_0x29a4e4,_0xc44b39)[_0xf4b7('0xe')](getUser(_0x46f5b0,_0x29a4e4,_0xc44b39))[_0xf4b7('0xe')](getEndUser(_0x46f5b0,_0x29a4e4,_0xc44b39))[_0xf4b7('0xe')](getTicket(_0x46f5b0,_0x29a4e4,_0xc44b39,_0x447002,_0x564a24))[_0xf4b7('0xe')](function(_0x3e46a0){logger[_0xf4b7('0xc')](util[_0xf4b7('0x26')](_0xf4b7('0x54'),_0x3e46a0[_0xf4b7('0x3a')]));if(_0x46f5b0!==_0xf4b7('0x49')){logger['info']('['+[_0x46f5b0[_0xf4b7('0x1f')]()]+']',_0xf4b7('0x55'));emit(_0xc44b39,_0x2e642d['name'],_0x3e46a0[_0xf4b7('0x2a')]);}})[_0xf4b7('0x25')](function(_0x1960eb){logger['error']('['+[_0x46f5b0[_0xf4b7('0x1f')]()]+']\x20Error\x20running\x20Freshsales\x20integration',util[_0xf4b7('0x56')](_0x1960eb,{'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 79b8025..b3b4180 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 _0xb234=['%s\x20configuration\x20#%s\x20not\x20found','data3','../../../../config/logger','%s\x20account\x20#%s\x20not\x20found','lodash','util','./salesforce','./sugarcrm','./freshdesk','./zoho','./servicenow','./dynamics365','zendesk','sugarcrm','desk','vtiger','freshsales','servicenow','data1','toLowerCase','data2','find','Configurations','queue','routeId','outbound','log','unmanaged','salesforce','zoho','dynamics365','unknown\x20integration','error','[EXEC]','format'];(function(_0x12d6bb,_0x170e26){var _0x10d35f=function(_0x17bc2a){while(--_0x17bc2a){_0x12d6bb['push'](_0x12d6bb['shift']());}};_0x10d35f(++_0x170e26);}(_0xb234,0x13f));var _0x4b23=function(_0x4247d1,_0x1c604f){_0x4247d1=_0x4247d1-0x0;var _0x22bd62=_0xb234[_0x4247d1];return _0x22bd62;};'use strict';var _=require(_0x4b23('0x0'));var util=require(_0x4b23('0x1'));var zendesk=require('./zendesk');var salesforce=require(_0x4b23('0x2'));var sugarcrm=require(_0x4b23('0x3'));var freshdesk=require(_0x4b23('0x4'));var zoho=require(_0x4b23('0x5'));var desk=require('./desk');var vtiger=require('./vtiger');var servicenow=require(_0x4b23('0x6'));var dynamics365=require(_0x4b23('0x7'));var freshsales=require('./freshsales');var integrations=[_0x4b23('0x8'),'salesforce',_0x4b23('0x9'),'freshdesk','zoho',_0x4b23('0xa'),_0x4b23('0xb'),'dynamics365',_0x4b23('0xc'),_0x4b23('0xd')];exports['exec']=function(_0x1b2467,_0x5daa80,_0x27b828,_0x1b4bd9,_0x1176f4,_0x10bf79){if(_0x27b828){if(_['includes'](integrations,_0x1b2467['data1']['toLowerCase']())){try{var _0x2cfc3b=null;var _0x1a6f01='';var _0x171648=_0x27b828[_0x1b2467[_0x4b23('0xe')][_0x4b23('0xf')]()];if(_0x171648){var _0x149e95=_0x171648[_0x1b2467[_0x4b23('0x10')]];if(_0x149e95){var _0x3d9d2a=_[_0x4b23('0x11')](_0x149e95[_0x4b23('0x12')],{'id':parseInt(_0x1b2467['data3'],0xa)});if(_0x3d9d2a){if(_0x1b4bd9){if(_0x1176f4&&_0x5daa80[_0x4b23('0x13')]){_0x1a6f01=_0x4b23('0x13');}else if(_0x5daa80[_0x4b23('0x14')]){_0x1a6f01=_0x4b23('0x15');}else{console[_0x4b23('0x16')]('EVENT\x20UNKNOWN',_0x5daa80);}}else{_0x1a6f01=_0x4b23('0x17');}switch(_0x1b2467[_0x4b23('0xe')][_0x4b23('0xf')]()){case _0x4b23('0x8'):zendesk[_0x1a6f01](_0x1b2467,_0x5daa80,_0x3d9d2a,_0x1b4bd9,_0x1176f4,_0x149e95,_0x10bf79);break;case _0x4b23('0x18'):salesforce[_0x1a6f01](_0x1b2467,_0x5daa80,_0x3d9d2a,_0x1b4bd9,_0x1176f4,_0x149e95,_0x10bf79);break;case _0x4b23('0x9'):sugarcrm[_0x1a6f01](_0x1b2467,_0x5daa80,_0x3d9d2a,_0x1b4bd9,_0x1176f4,_0x149e95,_0x10bf79);break;case'freshdesk':freshdesk[_0x1a6f01](_0x1b2467,_0x5daa80,_0x3d9d2a,_0x1b4bd9,_0x1176f4,_0x149e95,_0x10bf79);break;case _0x4b23('0x19'):zoho[_0x1a6f01](_0x1b2467,_0x5daa80,_0x3d9d2a,_0x1b4bd9,_0x1176f4,_0x149e95,_0x10bf79);break;case _0x4b23('0xa'):desk[_0x1a6f01](_0x1b2467,_0x5daa80,_0x3d9d2a,_0x1b4bd9,_0x1176f4,_0x149e95,_0x10bf79);break;case _0x4b23('0xb'):vtiger[_0x1a6f01](_0x1b2467,_0x5daa80,_0x3d9d2a,_0x1b4bd9,_0x1176f4,_0x149e95,_0x10bf79);break;case _0x4b23('0xc'):freshsales['cs'](_0x1b2467,_0x5daa80,_0x3d9d2a,_0x1b4bd9,_0x1176f4,_0x149e95,_0x10bf79,_0x1a6f01);break;case _0x4b23('0xd'):servicenow['cs'](_0x1b2467,_0x5daa80,_0x3d9d2a,_0x1b4bd9,_0x1176f4,_0x149e95,_0x10bf79,_0x1a6f01);break;case _0x4b23('0x1a'):dynamics365['cs'](_0x1b2467,_0x5daa80,_0x3d9d2a,_0x1b4bd9,_0x1176f4,_0x149e95,_0x10bf79,_0x1a6f01);break;default:console[_0x4b23('0x16')](_0x4b23('0x1b'));}}else{_0x2cfc3b=require('../../../../config/logger')(_0x1b2467['data1'][_0x4b23('0xf')]());_0x2cfc3b[_0x4b23('0x1c')](_0x4b23('0x1d'),util[_0x4b23('0x1e')](_0x4b23('0x1f'),_0x1b2467[_0x4b23('0xe')][_0x4b23('0xf')](),_0x1b2467[_0x4b23('0x20')]));}}else{_0x2cfc3b=require(_0x4b23('0x21'))(_0x1b2467[_0x4b23('0xe')]['toLowerCase']());_0x2cfc3b[_0x4b23('0x1c')]('[EXEC]',util[_0x4b23('0x1e')](_0x4b23('0x22'),_0x1b2467['data1'][_0x4b23('0xf')](),_0x1b2467[_0x4b23('0x10')]));}}else{}}catch(_0x5331c2){console['error'](_0x5331c2);}}}}; \ No newline at end of file +var _0xa57c=['EVENT\x20UNKNOWN','unmanaged','dynamics365','../../../../config/logger','error','[EXEC]','format','%s\x20account\x20#%s\x20not\x20found','data2','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','./servicenow','./freshsales','zendesk','salesforce','sugarcrm','freshdesk','zoho','desk','vtiger','servicenow','exec','includes','data1','toLowerCase','find','Configurations','data3','log'];(function(_0x523bd0,_0x2eca3d){var _0x494ba7=function(_0x39c583){while(--_0x39c583){_0x523bd0['push'](_0x523bd0['shift']());}};_0x494ba7(++_0x2eca3d);}(_0xa57c,0xb8));var _0xca57=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0xa57c[_0x599f41];return _0x2e4d58;};'use strict';var _=require('lodash');var util=require(_0xca57('0x0'));var zendesk=require(_0xca57('0x1'));var salesforce=require(_0xca57('0x2'));var sugarcrm=require(_0xca57('0x3'));var freshdesk=require(_0xca57('0x4'));var zoho=require(_0xca57('0x5'));var desk=require(_0xca57('0x6'));var vtiger=require(_0xca57('0x7'));var servicenow=require(_0xca57('0x8'));var dynamics365=require('./dynamics365');var freshsales=require(_0xca57('0x9'));var integrations=[_0xca57('0xa'),_0xca57('0xb'),_0xca57('0xc'),_0xca57('0xd'),_0xca57('0xe'),_0xca57('0xf'),_0xca57('0x10'),'dynamics365','freshsales',_0xca57('0x11')];exports[_0xca57('0x12')]=function(_0x434bde,_0x1c2044,_0x400dc3,_0x4c6813,_0x2cbfc1,_0x20a63f){if(_0x400dc3){if(_[_0xca57('0x13')](integrations,_0x434bde[_0xca57('0x14')][_0xca57('0x15')]())){try{var _0x17dbe5=null;var _0x41c46f='';var _0x244ead=_0x400dc3[_0x434bde[_0xca57('0x14')][_0xca57('0x15')]()];if(_0x244ead){var _0x4111be=_0x244ead[_0x434bde['data2']];if(_0x4111be){var _0x466233=_[_0xca57('0x16')](_0x4111be[_0xca57('0x17')],{'id':parseInt(_0x434bde[_0xca57('0x18')],0xa)});if(_0x466233){if(_0x4c6813){if(_0x2cbfc1&&_0x1c2044['queue']){_0x41c46f='queue';}else if(_0x1c2044['routeId']){_0x41c46f='outbound';}else{console[_0xca57('0x19')](_0xca57('0x1a'),_0x1c2044);}}else{_0x41c46f=_0xca57('0x1b');}switch(_0x434bde[_0xca57('0x14')][_0xca57('0x15')]()){case _0xca57('0xa'):zendesk[_0x41c46f](_0x434bde,_0x1c2044,_0x466233,_0x4c6813,_0x2cbfc1,_0x4111be,_0x20a63f);break;case _0xca57('0xb'):salesforce[_0x41c46f](_0x434bde,_0x1c2044,_0x466233,_0x4c6813,_0x2cbfc1,_0x4111be,_0x20a63f);break;case _0xca57('0xc'):sugarcrm[_0x41c46f](_0x434bde,_0x1c2044,_0x466233,_0x4c6813,_0x2cbfc1,_0x4111be,_0x20a63f);break;case'freshdesk':freshdesk[_0x41c46f](_0x434bde,_0x1c2044,_0x466233,_0x4c6813,_0x2cbfc1,_0x4111be,_0x20a63f);break;case'zoho':zoho[_0x41c46f](_0x434bde,_0x1c2044,_0x466233,_0x4c6813,_0x2cbfc1,_0x4111be,_0x20a63f);break;case _0xca57('0xf'):desk[_0x41c46f](_0x434bde,_0x1c2044,_0x466233,_0x4c6813,_0x2cbfc1,_0x4111be,_0x20a63f);break;case _0xca57('0x10'):vtiger[_0x41c46f](_0x434bde,_0x1c2044,_0x466233,_0x4c6813,_0x2cbfc1,_0x4111be,_0x20a63f);break;case'freshsales':freshsales['cs'](_0x434bde,_0x1c2044,_0x466233,_0x4c6813,_0x2cbfc1,_0x4111be,_0x20a63f,_0x41c46f);break;case'servicenow':servicenow['cs'](_0x434bde,_0x1c2044,_0x466233,_0x4c6813,_0x2cbfc1,_0x4111be,_0x20a63f,_0x41c46f);break;case _0xca57('0x1c'):dynamics365['cs'](_0x434bde,_0x1c2044,_0x466233,_0x4c6813,_0x2cbfc1,_0x4111be,_0x20a63f,_0x41c46f);break;default:console['log']('unknown\x20integration');}}else{_0x17dbe5=require(_0xca57('0x1d'))(_0x434bde[_0xca57('0x14')][_0xca57('0x15')]());_0x17dbe5[_0xca57('0x1e')](_0xca57('0x1f'),util['format']('%s\x20configuration\x20#%s\x20not\x20found',_0x434bde[_0xca57('0x14')]['toLowerCase'](),_0x434bde[_0xca57('0x18')]));}}else{_0x17dbe5=require(_0xca57('0x1d'))(_0x434bde[_0xca57('0x14')][_0xca57('0x15')]());_0x17dbe5[_0xca57('0x1e')](_0xca57('0x1f'),util[_0xca57('0x20')](_0xca57('0x21'),_0x434bde['data1'][_0xca57('0x15')](),_0x434bde[_0xca57('0x22')]));}}else{}}catch(_0x361dbe){console[_0xca57('0x1e')](_0x361dbe);}}}}; \ 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 7d2c0a7..b7e3a81 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 _0x766a=['../../../../config/environment','../../../../config/logger','salesforce','redis','localhost','socket.io-emitter','emit','assign','getString','Descriptions','Task','ActivityDate','utc','IsReminderSet','IsRecurrence','contact','endUserType','lead','WhoId','ticketType','Case','ContactId','account','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','isNil','validateEmail','User','find','then','Email','Agent\x20%s\x20found.','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','resolve','display_name','moduleSearch','cloneDeep','additionalSearchContact','$or','Contact','execute','length','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','merge','Account','first','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s','Company','No\x20Company','create','forEach','includes','string','picklist','idField','content','variable','variableName','toString','customVariable','Variable','name','password','concat','securityToken','Connection','https://login.salesforce.com','clientId','login','username','Connection\x20established.','queue','stripTrailingSlash','serverUrl','remoteUri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','email','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','trigger:browser:url','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','newTab','%s/%s/e','Salesforce\x20account\x20type\x20not\x20recognized','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.','lodash','request-promise','bluebird','md5','jsforce','util','ioredis'];(function(_0x551ead,_0x19baa5){var _0x366c3f=function(_0x1c055d){while(--_0x1c055d){_0x551ead['push'](_0x551ead['shift']());}};_0x366c3f(++_0x19baa5);}(_0x766a,0x7c));var _0xa766=function(_0x18cac4,_0x57a4d5){_0x18cac4=_0x18cac4-0x0;var _0x2227c6=_0x766a[_0x18cac4];return _0x2227c6;};'use strict';var _=require(_0xa766('0x0'));var rp=require(_0xa766('0x1'));var moment=require('moment');var BPromise=require(_0xa766('0x2'));var md5=require(_0xa766('0x3'));var jsforce=require(_0xa766('0x4'));var util=require(_0xa766('0x5'));var Redis=require(_0xa766('0x6'));var intUtil=require('./util');var config=require(_0xa766('0x7'));var logger=require(_0xa766('0x8'))(_0xa766('0x9'));config[_0xa766('0xa')]=_['defaults'](config[_0xa766('0xa')],{'host':_0xa766('0xb'),'port':0x18eb});var io=require(_0xa766('0xc'))(new Redis(config[_0xa766('0xa')]));function emit(_0x4da1aa,_0x3633e5,_0x46e995){io['to'](_0x4da1aa)[_0xa766('0xd')](_0x3633e5,_0x46e995);}function getTicket(_0x4ec268,_0x1f7a70,_0x1de179,_0x2c37f3,_0x3454a2,_0x4ba37f,_0x207d96,_0x3d16c8){var _0x5d9066=Object[_0xa766('0xe')]({},{'OwnerId':_0x1f7a70['id'],'Subject':intUtil['getString'](_0x2c37f3['Subjects'],_0x3454a2,'\x20'),'Description':intUtil[_0xa766('0xf')](_0x2c37f3[_0xa766('0x10')],_0x3454a2,'\x0a')},getCustomFields(_0x4ba37f,_0x3454a2));if(_0x1de179){if(_0x2c37f3['ticketType']===_0xa766('0x11')){_0x5d9066[_0xa766('0x12')]=moment[_0xa766('0x13')]();_0x5d9066[_0xa766('0x14')]=![];_0x5d9066[_0xa766('0x15')]=![];if(_0x1de179['endUserType']===_0xa766('0x16')||_0x1de179[_0xa766('0x17')]===_0xa766('0x18')){_0x5d9066[_0xa766('0x19')]=_0x1de179['id'];}else if(_0x1de179[_0xa766('0x17')]==='account'){_0x5d9066['WhatId']=_0x1de179['id'];}}else if(_0x2c37f3[_0xa766('0x1a')]===_0xa766('0x1b')){if(_0x1de179[_0xa766('0x17')]===_0xa766('0x16')){_0x5d9066[_0xa766('0x1c')]=_0x1de179['id'];}else if(_0x1de179[_0xa766('0x17')]===_0xa766('0x1d')){_0x5d9066[_0xa766('0x1e')]=_0x1de179['id'];}else if(_0x1de179[_0xa766('0x17')]===_0xa766('0x18')&&_0x2c37f3[_0xa766('0x1f')]){_0x5d9066[_0x2c37f3['leadId']]=_0x1de179['id'];}else{logger[_0xa766('0x20')](_0xa766('0x21'));}}}return _0x207d96[_0xa766('0x22')](_0x2c37f3[_0xa766('0x1a')])['create'](_0x5d9066);}function getUser(_0xef0b21,_0xf1cc24,_0x139df6){if(!_[_0xa766('0x23')](_0xf1cc24)&&intUtil[_0xa766('0x24')](_0xf1cc24)){var _0x4342f9={'Email':_0xf1cc24};var _0x1f087f={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x139df6[_0xa766('0x22')](_0xa766('0x25'))[_0xa766('0x26')](_0x4342f9,_0x1f087f)['execute']()[_0xa766('0x27')](function(_0xcb73af){if(_0xcb73af['length']){var _0x51f80b=_['find'](_0xcb73af,function(_0x502091){return _0x502091[_0xa766('0x28')]===_0xf1cc24;});if(_0x51f80b){logger['info'](_0xa766('0x29'),_0xf1cc24);return BPromise['resolve']({'id':_0x51f80b['Id'],'name':_0x51f80b[_0xa766('0x2a')]});}}else{logger['info'](_0xa766('0x2b'),_0xf1cc24);return _0x139df6['identity']()[_0xa766('0x27')](function(_0x4132c7){return BPromise[_0xa766('0x2c')]({'id':_0x4132c7['user_id'],'name':_0x4132c7[_0xa766('0x2d')]});});}});}else{logger[_0xa766('0x20')](_0xa766('0x2b'),_0xf1cc24);return _0x139df6['identity']()[_0xa766('0x27')](function(_0x4d82de){return BPromise[_0xa766('0x2c')]({'id':_0x4d82de['user_id'],'name':_0x4d82de[_0xa766('0x2d')]});});}}function getEndUser(_0x2cdadb,_0x518c17,_0x104722,_0xf3c9f3,_0x615c24){var _0xf8d939={'$or':{'Phone':_0xf3c9f3}};var _0x4ad11d={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()[_0xa766('0x27')](function(){logger['info']('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0xf3c9f3,_0x518c17[_0xa766('0x2e')]);switch(_0x518c17[_0xa766('0x2e')]){case'contact_lead':var _0x3763ff=_[_0xa766('0x2f')](_0xf8d939);if(_0x518c17['additionalSearchContact']){var _0x51c0ef={};_0x51c0ef[_0x518c17[_0xa766('0x30')]]=_0xf3c9f3;_['merge'](_0x3763ff[_0xa766('0x31')],_0x51c0ef);}return _0x615c24['sobject'](_0xa766('0x32'))[_0xa766('0x26')](_0x3763ff,_0x4ad11d)[_0xa766('0x33')]()[_0xa766('0x27')](function(_0x5ac065){if(_0x5ac065&&_0x5ac065[_0xa766('0x34')]){return _0x5ac065;}else{var _0x58f825=_['cloneDeep'](_0xf8d939);if(_0x518c17['additionalSearchLead']){var _0x3d3f59={};_0x3d3f59[_0x518c17[_0xa766('0x35')]]=_0xf3c9f3;_['merge'](_0x58f825['$or'],_0x3d3f59);}return _0x615c24['sobject'](_0xa766('0x36'))[_0xa766('0x26')](_0x58f825,_0x4ad11d);}});case _0xa766('0x37'):var _0x3115fc=_[_0xa766('0x2f')](_0xf8d939);if(_0x518c17[_0xa766('0x38')]){var _0x51c0ef={};_0x51c0ef[_0x518c17[_0xa766('0x38')]]=_0xf3c9f3;_['merge'](_0x3115fc['$or'],_0x51c0ef);}return _0x615c24[_0xa766('0x22')]('Account')['find'](_0x3115fc,_0x4ad11d)['execute']()[_0xa766('0x27')](function(_0x46b145){if(_0x46b145&&_0x46b145['length']){return _0x46b145;}else{var _0x699b31=_['cloneDeep'](_0xf8d939);if(_0x518c17['additionalSearchContact']){var _0x291072={};_0x291072[_0x518c17[_0xa766('0x30')]]=_0xf3c9f3;_['merge'](_0x699b31[_0xa766('0x31')],_0x291072);}return _0x615c24['sobject'](_0xa766('0x32'))[_0xa766('0x26')](_0x699b31,_0x4ad11d)[_0xa766('0x27')](function(_0x1b1ae0){if(_0x1b1ae0&&_0x1b1ae0[_0xa766('0x34')]){return _0x1b1ae0;}else{var _0x3e73b4=_['cloneDeep'](_0xf8d939);if(_0x518c17[_0xa766('0x35')]){var _0x4abb22={};_0x4abb22[_0x518c17[_0xa766('0x35')]]=_0xf3c9f3;_[_0xa766('0x39')](_0x3e73b4['$or'],_0x4abb22);}return _0x615c24[_0xa766('0x22')]('Lead')['find'](_0x3e73b4,_0x4ad11d);}});}});case _0xa766('0x16'):var _0x3763ff=_[_0xa766('0x2f')](_0xf8d939);if(_0x518c17['additionalSearchContact']){var _0x51c0ef={};_0x51c0ef[_0x518c17['additionalSearchContact']]=_0xf3c9f3;_[_0xa766('0x39')](_0x3763ff[_0xa766('0x31')],_0x51c0ef);}return _0x615c24['sobject'](_0xa766('0x32'))[_0xa766('0x26')](_0x3763ff,_0x4ad11d)[_0xa766('0x33')]();case'lead':var _0x336f1b=_[_0xa766('0x2f')](_0xf8d939);if(_0x518c17[_0xa766('0x35')]){var _0x51c0ef={};_0x51c0ef[_0x518c17[_0xa766('0x35')]]=_0xf3c9f3;_[_0xa766('0x39')](_0x336f1b[_0xa766('0x31')],_0x51c0ef);}return _0x615c24['sobject'](_0xa766('0x36'))[_0xa766('0x26')](_0x336f1b,_0x4ad11d);case _0xa766('0x1d'):var _0x3115fc=_[_0xa766('0x2f')](_0xf8d939);if(_0x518c17['additionalSearchAccount']){var _0x51c0ef={};_0x51c0ef[_0x518c17[_0xa766('0x38')]]=_0xf3c9f3;_['merge'](_0x3115fc['$or'],_0x51c0ef);}return _0x615c24['sobject'](_0xa766('0x3a'))[_0xa766('0x26')](_0x3115fc,_0x4ad11d);default:return null;}})[_0xa766('0x27')](function(_0x45d725){if(_0x45d725&&_0x45d725['length']){var _0x2b301c=_[_0xa766('0x3b')](_0x45d725);if(_0x2b301c){return BPromise[_0xa766('0x2c')]({'id':_0x2b301c['Id'],'name':_0x2b301c[_0xa766('0x2a')],'phone':_0x2b301c['Phone'],'endUserType':_0x2b301c[_0xa766('0x3c')][_0xa766('0x3d')][_0xa766('0x3e')]()});}}})[_0xa766('0x27')](function(_0x459d7a){if(_0x459d7a){logger[_0xa766('0x20')](_0xa766('0x3f'),_0x459d7a[_0xa766('0x17')],_0xf3c9f3);return BPromise[_0xa766('0x2c')](_0x459d7a);}else{logger[_0xa766('0x20')](_0xa766('0x40'),_0xf3c9f3);var _0x16cf8d={'Phone':_0xf3c9f3};if(_0x518c17['moduleCreate']){if(_0x518c17[_0xa766('0x41')]===_0xa766('0x16')){logger[_0xa766('0x20')](_0xa766('0x42'),_0xf3c9f3,_0x518c17[_0xa766('0x41')]);_0x16cf8d[_0xa766('0x43')]=_0x104722!==_0xa766('0x44')?_0x104722:util[_0xa766('0x45')](_0xa766('0x46'),_0xf3c9f3);}else if(_0x518c17[_0xa766('0x41')]===_0xa766('0x18')){logger[_0xa766('0x20')](_0xa766('0x42'),_0xf3c9f3,_0x518c17[_0xa766('0x41')]);_0x16cf8d[_0xa766('0x43')]=_0x104722!==''?_0x104722:util[_0xa766('0x45')](_0xa766('0x46'),_0xf3c9f3);_0x16cf8d[_0xa766('0x47')]=_0xa766('0x48');}else if(_0x518c17[_0xa766('0x41')]==='account'){logger[_0xa766('0x20')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0xf3c9f3,_0x518c17[_0xa766('0x41')]);_0x16cf8d[_0xa766('0x2a')]=_0x104722!==''?_0x104722:util['format'](_0xa766('0x46'),_0xf3c9f3);}else{return null;}}return _0x615c24[_0xa766('0x22')](_['upperFirst'](_0x518c17[_0xa766('0x41')]))[_0xa766('0x49')](_0x16cf8d)[_0xa766('0x27')](function(_0x5356b8){return BPromise[_0xa766('0x2c')]({'id':_0x5356b8['id'],'endUserType':_0x518c17['moduleCreate']});});}});}function getCustomFields(_0x29b1f0,_0x55bf41){var _0x3167f0={};if(_0x29b1f0[_0xa766('0x34')]>0x0){_[_0xa766('0x4a')](_0x29b1f0,function(_0x384255){if(_[_0xa766('0x4b')]([_0xa766('0x4c'),_0xa766('0x4d')],_0x384255[_0xa766('0x3d')])&&_0x384255[_0xa766('0x4e')]){_0x3167f0[_0x384255['idField']]=_0x384255[_0xa766('0x4f')]['toString']();}else if(_0x384255[_0xa766('0x3d')]===_0xa766('0x50')&&_0x384255[_0xa766('0x51')]&&_0x384255[_0xa766('0x4e')]){_0x55bf41[_0x384255[_0xa766('0x51')]]&&(_0x3167f0[_0x384255['idField']]=_0x55bf41[_0x384255['variableName']][_0xa766('0x52')]());}else if(_0x384255[_0xa766('0x3d')]===_0xa766('0x53')&&_0x384255[_0xa766('0x54')]&&_0x384255[_0xa766('0x54')][_0xa766('0x55')]&&_0x384255['idField']){_0x55bf41[_0x384255[_0xa766('0x54')]['name'][_0xa766('0x3e')]()]&&(_0x3167f0[_0x384255[_0xa766('0x4e')]]=_0x55bf41[_0x384255['Variable']['name']['toLowerCase']()][_0xa766('0x52')]());}});}return _0x3167f0;}function getConnection(_0x474e40){var _0x496ba1=_0x474e40[_0xa766('0x56')][_0xa766('0x57')](_0x474e40[_0xa766('0x58')]);var _0x3014c1=new jsforce[(_0xa766('0x59'))]({'oauth2':{'loginUrl':_0x474e40['remoteUri']||_0xa766('0x5a'),'clientId':_0x474e40[_0xa766('0x5b')],'clientSecret':_0x474e40['clientSecret']}});return _0x3014c1[_0xa766('0x5c')](_0x474e40[_0xa766('0x5d')],_0x496ba1)['then'](function(){logger[_0xa766('0x20')](_0xa766('0x5e'));return _0x3014c1;});}exports[_0xa766('0x5f')]=function(_0x3615a0,_0x3fabec,_0x41cc84,_0x3ecab1,_0x47da0f,_0x2b8ac1){var _0x46e908,_0x2fdd06,_0x21dcb2,_0x5d07ad;_0x2b8ac1['serverUrl']=intUtil[_0xa766('0x60')](_0x2b8ac1[_0xa766('0x61')]);_0x2b8ac1[_0xa766('0x62')]=intUtil[_0xa766('0x60')](_0x2b8ac1[_0xa766('0x62')]);if(_0x47da0f&&_0x47da0f[_0xa766('0x63')]){logger['info'](_0xa766('0x64'),_0xa766('0x65'));_0x3fabec[_0xa766('0x66')]=util[_0xa766('0x45')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2b8ac1[_0xa766('0x61')],_0x3fabec[_0xa766('0x67')],md5(_0x3fabec[_0xa766('0x67')]));}else{_0x3fabec['recordingURL']='';}return getConnection(_0x2b8ac1)[_0xa766('0x27')](function(_0xaa269d){_0x5d07ad=_0xaa269d;return getUser(_0x2b8ac1,_0x3ecab1[_0xa766('0x68')],_0x5d07ad);})[_0xa766('0x27')](function(_0x9172eb){_0x46e908=_0x9172eb;return getEndUser(_0x2b8ac1,_0x41cc84,_0x3fabec[_0xa766('0x69')],_0x3fabec[_0xa766('0x6a')],_0x5d07ad);})[_0xa766('0x27')](function(_0x167cc4){_0x2fdd06=_0x167cc4;return getTicket(_0x2b8ac1,_0x46e908,_0x2fdd06,_0x41cc84,_0x3fabec,_0x41cc84[_0xa766('0x6b')],_0x5d07ad,'queue');})['then'](function(_0x41bc34){_0x21dcb2=_0x41bc34;logger[_0xa766('0x20')](_0xa766('0x6c'),_0x21dcb2['id']);logger[_0xa766('0x20')](_0xa766('0x6d'),_0x21dcb2['id'],_0x3ecab1[_0xa766('0x55')],_0x2b8ac1[_0xa766('0x3d')]);switch(_0x2b8ac1['type']){case _0xa766('0x6e'):emit(util['format'](_0xa766('0x6f'),_0x3ecab1[_0xa766('0x55')]),_0xa766('0x70'),{'recordId':_0x21dcb2['id']});break;case'newTab':emit(util['format'](_0xa766('0x6f'),_0x3ecab1[_0xa766('0x55')]),_0xa766('0x71'),{'uri':util['format']('%s/%s/e',_0x5d07ad[_0xa766('0x72')],_0x21dcb2['id'])});break;default:logger[_0xa766('0x73')](_0xa766('0x74'));}})[_0xa766('0x75')](function(_0x13ac0a){logger[_0xa766('0x73')](_0xa766('0x64'),_0x13ac0a);});};exports[_0xa766('0x76')]=function(_0x4d066b,_0x10fffa,_0x2c287d,_0x4b7738,_0x2a0666,_0xb0d0aa,_0x4e9219){var _0x4a1965,_0x351f40,_0x2918d0,_0x411c31;_0xb0d0aa[_0xa766('0x61')]=intUtil[_0xa766('0x60')](_0xb0d0aa[_0xa766('0x61')]);_0xb0d0aa[_0xa766('0x62')]=intUtil['stripTrailingSlash'](_0xb0d0aa[_0xa766('0x62')]);if(_0x4e9219&&_0x4e9219[_0xa766('0x77')]&&_0x4e9219[_0xa766('0x77')]!==_0xa766('0x78')){logger[_0xa766('0x20')](_0xa766('0x79'),_0xa766('0x65'));_0x10fffa[_0xa766('0x66')]=util['format'](_0xa766('0x7a'),_0xb0d0aa[_0xa766('0x61')],_0x10fffa[_0xa766('0x67')],md5(_0x10fffa[_0xa766('0x67')]));}return getConnection(_0xb0d0aa)[_0xa766('0x27')](function(_0x4a37b0){_0x411c31=_0x4a37b0;return getUser(_0xb0d0aa,_0x4b7738[_0xa766('0x68')],_0x411c31);})[_0xa766('0x27')](function(_0x43b594){_0x4a1965=_0x43b594;return getEndUser(_0xb0d0aa,_0x2c287d,_0x10fffa[_0xa766('0x7b')],_0x10fffa[_0xa766('0x7c')],_0x411c31);})[_0xa766('0x27')](function(_0x18d0bc){_0x351f40=_0x18d0bc;return getTicket(_0xb0d0aa,_0x4a1965,_0x351f40,_0x2c287d,_0x10fffa,_0x2c287d[_0xa766('0x6b')],_0x411c31,_0xa766('0x76'));})[_0xa766('0x27')](function(_0x5c2caa){_0x2918d0=_0x5c2caa;logger[_0xa766('0x20')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x2918d0['id']);logger[_0xa766('0x20')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x2918d0['id'],_0x4b7738[_0xa766('0x55')],_0xb0d0aa[_0xa766('0x3d')]);switch(_0xb0d0aa[_0xa766('0x3d')]){case _0xa766('0x6e'):emit(util['format'](_0xa766('0x6f'),_0x4b7738[_0xa766('0x55')]),_0xa766('0x70'),{'recordId':_0x2918d0['id']});break;case _0xa766('0x7d'):emit(util['format'](_0xa766('0x6f'),_0x4b7738[_0xa766('0x55')]),_0xa766('0x71'),{'uri':util[_0xa766('0x45')](_0xa766('0x7e'),_0x411c31[_0xa766('0x72')],_0x2918d0['id'])});break;default:logger[_0xa766('0x73')]('[OUTBOUND]',_0xa766('0x7f'));}})[_0xa766('0x75')](function(_0x259287){logger['error'](_0xa766('0x79'),_0x259287);});};exports['unmanaged']=function(_0x57340a,_0x5bb12a,_0x2c0cd6,_0x3f36c3,_0x18fb6e,_0x558380){var _0x2fca65,_0x50ab5e,_0x53016b,_0x5a907c;_0x558380[_0xa766('0x61')]=intUtil['stripTrailingSlash'](_0x558380[_0xa766('0x61')]);_0x558380[_0xa766('0x62')]=intUtil[_0xa766('0x60')](_0x558380[_0xa766('0x62')]);if(_0x18fb6e&&_0x18fb6e[_0xa766('0x63')]){logger[_0xa766('0x20')]('['+_0x5bb12a[_0xa766('0x80')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x5bb12a[_0xa766('0x66')]=util[_0xa766('0x45')](_0xa766('0x7a'),_0x558380['serverUrl'],_0x5bb12a['uniqueid'],md5(_0x5bb12a[_0xa766('0x67')]));}else{_0x5bb12a[_0xa766('0x66')]='';}return getConnection(_0x558380)[_0xa766('0x27')](function(_0x4bb49e){_0x5a907c=_0x4bb49e;if(!_[_0xa766('0x23')](_0x3f36c3)){return getUser(_0x558380,_0x3f36c3[_0xa766('0x55')],_0x5a907c);}else{return getUser(_0x558380,null,_0x5a907c);}})[_0xa766('0x27')](function(_0x4caa8a){_0x2fca65=_0x4caa8a;return getEndUser(_0x558380,_0x2c0cd6,_0x5bb12a[_0xa766('0x69')],_0x5bb12a[_0xa766('0x6a')],_0x5a907c);})[_0xa766('0x27')](function(_0x43a22){_0x50ab5e=_0x43a22;return getTicket(_0x558380,_0x2fca65,_0x50ab5e,_0x2c0cd6,_0x5bb12a,_0x2c0cd6[_0xa766('0x6b')],_0x5a907c);})[_0xa766('0x27')](function(_0x3e35c4){_0x53016b=_0x3e35c4;logger['info']('['+_0x5bb12a[_0xa766('0x80')][_0xa766('0x81')]()+_0xa766('0x82'),_0x53016b['id']);logger['info']('['+_0x5bb12a[_0xa766('0x80')][_0xa766('0x81')]()+']\x20Integration\x20account\x20type\x20%s.',_0x558380[_0xa766('0x3d')]);})[_0xa766('0x75')](function(_0x7a32e8){logger[_0xa766('0x73')]('['+_0x5bb12a['lastevent']['toUpperCase']()+']',_0x7a32e8);});}; \ No newline at end of file +var _0x1671=['queue','[QUEUE]\x20Ticket\x20%s\x20created','user:%s','newTab','%s/%s/e','instanceUrl','error','catch','[QUEUE]','outbound','recordingFormat','none','[OUTBOUND]','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:salesforce:display','trigger:browser:url','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','md5','jsforce','util','ioredis','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','assign','getString','Subjects','ticketType','Task','ActivityDate','utc','IsReminderSet','IsRecurrence','contact','endUserType','lead','WhoId','account','WhatId','Case','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','isNil','validateEmail','User','find','execute','then','length','Agent\x20%s\x20found.','resolve','Name','identity','user_id','display_name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','Contact','additionalSearchLead','account_contact_lead','additionalSearchAccount','Account','Lead','first','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','format','Caller\x20-\x20%s','','upperFirst','forEach','picklist','idField','variable','variableName','toString','Variable','name','password','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientSecret','username','serverUrl','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','email','calleridname','calleridnum','Fields'];(function(_0x24c654,_0x3289ba){var _0x509d87=function(_0x8c02f0){while(--_0x8c02f0){_0x24c654['push'](_0x24c654['shift']());}};_0x509d87(++_0x3289ba);}(_0x1671,0x90));var _0x1167=function(_0x572415,_0x177386){_0x572415=_0x572415-0x0;var _0x3d52fb=_0x1671[_0x572415];return _0x3d52fb;};'use strict';var _=require(_0x1167('0x0'));var rp=require(_0x1167('0x1'));var moment=require(_0x1167('0x2'));var BPromise=require('bluebird');var md5=require(_0x1167('0x3'));var jsforce=require(_0x1167('0x4'));var util=require(_0x1167('0x5'));var Redis=require(_0x1167('0x6'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x1167('0x7'))('salesforce');config[_0x1167('0x8')]=_[_0x1167('0x9')](config[_0x1167('0x8')],{'host':_0x1167('0xa'),'port':0x18eb});var io=require(_0x1167('0xb'))(new Redis(config[_0x1167('0x8')]));function emit(_0x2d296a,_0x259b8b,_0x158a56){io['to'](_0x2d296a)[_0x1167('0xc')](_0x259b8b,_0x158a56);}function getTicket(_0x15e502,_0x23da27,_0x6fd296,_0x34f8cb,_0x50b717,_0x320fe9,_0x385359,_0x531794){var _0x234819=Object[_0x1167('0xd')]({},{'OwnerId':_0x23da27['id'],'Subject':intUtil[_0x1167('0xe')](_0x34f8cb[_0x1167('0xf')],_0x50b717,'\x20'),'Description':intUtil[_0x1167('0xe')](_0x34f8cb['Descriptions'],_0x50b717,'\x0a')},getCustomFields(_0x320fe9,_0x50b717));if(_0x6fd296){if(_0x34f8cb[_0x1167('0x10')]===_0x1167('0x11')){_0x234819[_0x1167('0x12')]=moment[_0x1167('0x13')]();_0x234819[_0x1167('0x14')]=![];_0x234819[_0x1167('0x15')]=![];if(_0x6fd296['endUserType']===_0x1167('0x16')||_0x6fd296[_0x1167('0x17')]===_0x1167('0x18')){_0x234819[_0x1167('0x19')]=_0x6fd296['id'];}else if(_0x6fd296['endUserType']===_0x1167('0x1a')){_0x234819[_0x1167('0x1b')]=_0x6fd296['id'];}}else if(_0x34f8cb[_0x1167('0x10')]===_0x1167('0x1c')){if(_0x6fd296[_0x1167('0x17')]===_0x1167('0x16')){_0x234819['ContactId']=_0x6fd296['id'];}else if(_0x6fd296[_0x1167('0x17')]===_0x1167('0x1a')){_0x234819[_0x1167('0x1d')]=_0x6fd296['id'];}else if(_0x6fd296['endUserType']===_0x1167('0x18')&&_0x34f8cb[_0x1167('0x1e')]){_0x234819[_0x34f8cb[_0x1167('0x1e')]]=_0x6fd296['id'];}else{logger[_0x1167('0x1f')](_0x1167('0x20'));}}}return _0x385359[_0x1167('0x21')](_0x34f8cb[_0x1167('0x10')])['create'](_0x234819);}function getUser(_0x22eec5,_0x262637,_0x270507){if(!_[_0x1167('0x22')](_0x262637)&&intUtil[_0x1167('0x23')](_0x262637)){var _0x4da5b2={'Email':_0x262637};var _0x399650={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x270507['sobject'](_0x1167('0x24'))[_0x1167('0x25')](_0x4da5b2,_0x399650)[_0x1167('0x26')]()[_0x1167('0x27')](function(_0x1971d9){if(_0x1971d9[_0x1167('0x28')]){var _0x21d705=_[_0x1167('0x25')](_0x1971d9,function(_0x2fe7b0){return _0x2fe7b0['Email']===_0x262637;});if(_0x21d705){logger[_0x1167('0x1f')](_0x1167('0x29'),_0x262637);return BPromise[_0x1167('0x2a')]({'id':_0x21d705['Id'],'name':_0x21d705[_0x1167('0x2b')]});}}else{logger[_0x1167('0x1f')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x262637);return _0x270507[_0x1167('0x2c')]()[_0x1167('0x27')](function(_0x31124e){return BPromise[_0x1167('0x2a')]({'id':_0x31124e[_0x1167('0x2d')],'name':_0x31124e[_0x1167('0x2e')]});});}});}else{logger['info'](_0x1167('0x2f'),_0x262637);return _0x270507[_0x1167('0x2c')]()[_0x1167('0x27')](function(_0x5246b4){return BPromise[_0x1167('0x2a')]({'id':_0x5246b4[_0x1167('0x2d')],'name':_0x5246b4[_0x1167('0x2e')]});});}}function getEndUser(_0x4ea0b8,_0x4fa50a,_0x2c9bdc,_0x591dcd,_0x16ffc0){var _0x1968d0={'$or':{'Phone':_0x591dcd}};var _0x4798cd={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x1167('0x2a')]()[_0x1167('0x27')](function(){logger[_0x1167('0x1f')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x591dcd,_0x4fa50a[_0x1167('0x30')]);switch(_0x4fa50a[_0x1167('0x30')]){case _0x1167('0x31'):var _0x1a5096=_[_0x1167('0x32')](_0x1968d0);if(_0x4fa50a['additionalSearchContact']){var _0x17a87f={};_0x17a87f[_0x4fa50a[_0x1167('0x33')]]=_0x591dcd;_[_0x1167('0x34')](_0x1a5096[_0x1167('0x35')],_0x17a87f);}return _0x16ffc0['sobject'](_0x1167('0x36'))[_0x1167('0x25')](_0x1a5096,_0x4798cd)[_0x1167('0x26')]()[_0x1167('0x27')](function(_0x4719e8){if(_0x4719e8&&_0x4719e8['length']){return _0x4719e8;}else{var _0x46a6dd=_['cloneDeep'](_0x1968d0);if(_0x4fa50a[_0x1167('0x37')]){var _0x387fa5={};_0x387fa5[_0x4fa50a[_0x1167('0x37')]]=_0x591dcd;_[_0x1167('0x34')](_0x46a6dd['$or'],_0x387fa5);}return _0x16ffc0['sobject']('Lead')['find'](_0x46a6dd,_0x4798cd);}});case _0x1167('0x38'):var _0x193bb8=_[_0x1167('0x32')](_0x1968d0);if(_0x4fa50a[_0x1167('0x39')]){var _0x17a87f={};_0x17a87f[_0x4fa50a['additionalSearchAccount']]=_0x591dcd;_[_0x1167('0x34')](_0x193bb8[_0x1167('0x35')],_0x17a87f);}return _0x16ffc0[_0x1167('0x21')](_0x1167('0x3a'))[_0x1167('0x25')](_0x193bb8,_0x4798cd)[_0x1167('0x26')]()[_0x1167('0x27')](function(_0x472fb3){if(_0x472fb3&&_0x472fb3[_0x1167('0x28')]){return _0x472fb3;}else{var _0x335651=_[_0x1167('0x32')](_0x1968d0);if(_0x4fa50a[_0x1167('0x33')]){var _0x42c3ef={};_0x42c3ef[_0x4fa50a[_0x1167('0x33')]]=_0x591dcd;_[_0x1167('0x34')](_0x335651[_0x1167('0x35')],_0x42c3ef);}return _0x16ffc0[_0x1167('0x21')]('Contact')[_0x1167('0x25')](_0x335651,_0x4798cd)[_0x1167('0x27')](function(_0x556f1f){if(_0x556f1f&&_0x556f1f[_0x1167('0x28')]){return _0x556f1f;}else{var _0x2b00c3=_['cloneDeep'](_0x1968d0);if(_0x4fa50a['additionalSearchLead']){var _0x3f90a8={};_0x3f90a8[_0x4fa50a[_0x1167('0x37')]]=_0x591dcd;_[_0x1167('0x34')](_0x2b00c3[_0x1167('0x35')],_0x3f90a8);}return _0x16ffc0[_0x1167('0x21')](_0x1167('0x3b'))[_0x1167('0x25')](_0x2b00c3,_0x4798cd);}});}});case'contact':var _0x1a5096=_['cloneDeep'](_0x1968d0);if(_0x4fa50a[_0x1167('0x33')]){var _0x17a87f={};_0x17a87f[_0x4fa50a['additionalSearchContact']]=_0x591dcd;_[_0x1167('0x34')](_0x1a5096[_0x1167('0x35')],_0x17a87f);}return _0x16ffc0['sobject'](_0x1167('0x36'))[_0x1167('0x25')](_0x1a5096,_0x4798cd)[_0x1167('0x26')]();case _0x1167('0x18'):var _0x38db29=_[_0x1167('0x32')](_0x1968d0);if(_0x4fa50a[_0x1167('0x37')]){var _0x17a87f={};_0x17a87f[_0x4fa50a['additionalSearchLead']]=_0x591dcd;_[_0x1167('0x34')](_0x38db29[_0x1167('0x35')],_0x17a87f);}return _0x16ffc0[_0x1167('0x21')](_0x1167('0x3b'))[_0x1167('0x25')](_0x38db29,_0x4798cd);case _0x1167('0x1a'):var _0x193bb8=_[_0x1167('0x32')](_0x1968d0);if(_0x4fa50a['additionalSearchAccount']){var _0x17a87f={};_0x17a87f[_0x4fa50a['additionalSearchAccount']]=_0x591dcd;_['merge'](_0x193bb8[_0x1167('0x35')],_0x17a87f);}return _0x16ffc0[_0x1167('0x21')](_0x1167('0x3a'))[_0x1167('0x25')](_0x193bb8,_0x4798cd);default:return null;}})[_0x1167('0x27')](function(_0x350967){if(_0x350967&&_0x350967[_0x1167('0x28')]){var _0x2d99f3=_[_0x1167('0x3c')](_0x350967);if(_0x2d99f3){return BPromise[_0x1167('0x2a')]({'id':_0x2d99f3['Id'],'name':_0x2d99f3['Name'],'phone':_0x2d99f3['Phone'],'endUserType':_0x2d99f3[_0x1167('0x3d')][_0x1167('0x3e')][_0x1167('0x3f')]()});}}})[_0x1167('0x27')](function(_0x5d6789){if(_0x5d6789){logger['info'](_0x1167('0x40'),_0x5d6789[_0x1167('0x17')],_0x591dcd);return BPromise['resolve'](_0x5d6789);}else{logger[_0x1167('0x1f')](_0x1167('0x41'),_0x591dcd);var _0x1f95e3={'Phone':_0x591dcd};if(_0x4fa50a[_0x1167('0x42')]){if(_0x4fa50a['moduleCreate']===_0x1167('0x16')){logger['info'](_0x1167('0x43'),_0x591dcd,_0x4fa50a[_0x1167('0x42')]);_0x1f95e3[_0x1167('0x44')]=_0x2c9bdc!==''?_0x2c9bdc:util[_0x1167('0x45')](_0x1167('0x46'),_0x591dcd);}else if(_0x4fa50a[_0x1167('0x42')]===_0x1167('0x18')){logger['info']('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x591dcd,_0x4fa50a[_0x1167('0x42')]);_0x1f95e3[_0x1167('0x44')]=_0x2c9bdc!==_0x1167('0x47')?_0x2c9bdc:util[_0x1167('0x45')](_0x1167('0x46'),_0x591dcd);_0x1f95e3['Company']='No\x20Company';}else if(_0x4fa50a[_0x1167('0x42')]==='account'){logger[_0x1167('0x1f')](_0x1167('0x43'),_0x591dcd,_0x4fa50a['moduleCreate']);_0x1f95e3[_0x1167('0x2b')]=_0x2c9bdc!==''?_0x2c9bdc:util[_0x1167('0x45')](_0x1167('0x46'),_0x591dcd);}else{return null;}}return _0x16ffc0[_0x1167('0x21')](_[_0x1167('0x48')](_0x4fa50a[_0x1167('0x42')]))['create'](_0x1f95e3)[_0x1167('0x27')](function(_0x2530d9){return BPromise[_0x1167('0x2a')]({'id':_0x2530d9['id'],'endUserType':_0x4fa50a[_0x1167('0x42')]});});}});}function getCustomFields(_0x324cc8,_0x513415){var _0x4572c4={};if(_0x324cc8[_0x1167('0x28')]>0x0){_[_0x1167('0x49')](_0x324cc8,function(_0x4c846c){if(_['includes'](['string',_0x1167('0x4a')],_0x4c846c[_0x1167('0x3e')])&&_0x4c846c[_0x1167('0x4b')]){_0x4572c4[_0x4c846c[_0x1167('0x4b')]]=_0x4c846c['content']['toString']();}else if(_0x4c846c[_0x1167('0x3e')]===_0x1167('0x4c')&&_0x4c846c['variableName']&&_0x4c846c[_0x1167('0x4b')]){_0x513415[_0x4c846c[_0x1167('0x4d')]]&&(_0x4572c4[_0x4c846c['idField']]=_0x513415[_0x4c846c[_0x1167('0x4d')]][_0x1167('0x4e')]());}else if(_0x4c846c['type']==='customVariable'&&_0x4c846c[_0x1167('0x4f')]&&_0x4c846c[_0x1167('0x4f')][_0x1167('0x50')]&&_0x4c846c['idField']){_0x513415[_0x4c846c[_0x1167('0x4f')][_0x1167('0x50')][_0x1167('0x3f')]()]&&(_0x4572c4[_0x4c846c[_0x1167('0x4b')]]=_0x513415[_0x4c846c[_0x1167('0x4f')][_0x1167('0x50')]['toLowerCase']()][_0x1167('0x4e')]());}});}return _0x4572c4;}function getConnection(_0x55d1b3){var _0x49136c=_0x55d1b3[_0x1167('0x51')][_0x1167('0x52')](_0x55d1b3[_0x1167('0x53')]);var _0x21ed95=new jsforce[(_0x1167('0x54'))]({'oauth2':{'loginUrl':_0x55d1b3[_0x1167('0x55')]||_0x1167('0x56'),'clientId':_0x55d1b3['clientId'],'clientSecret':_0x55d1b3[_0x1167('0x57')]}});return _0x21ed95['login'](_0x55d1b3[_0x1167('0x58')],_0x49136c)[_0x1167('0x27')](function(){logger['info']('Connection\x20established.');return _0x21ed95;});}exports['queue']=function(_0x191a06,_0x44ff71,_0x31beeb,_0x521836,_0x3ca7e7,_0x3d0bbc){var _0xd7f523,_0x5a5736,_0x5bf778,_0x3c4ae3;_0x3d0bbc[_0x1167('0x59')]=intUtil[_0x1167('0x5a')](_0x3d0bbc[_0x1167('0x59')]);_0x3d0bbc[_0x1167('0x55')]=intUtil['stripTrailingSlash'](_0x3d0bbc[_0x1167('0x55')]);if(_0x3ca7e7&&_0x3ca7e7[_0x1167('0x5b')]){logger[_0x1167('0x1f')]('[QUEUE]',_0x1167('0x5c'));_0x44ff71['recordingURL']=util[_0x1167('0x45')](_0x1167('0x5d'),_0x3d0bbc[_0x1167('0x59')],_0x44ff71[_0x1167('0x5e')],md5(_0x44ff71['uniqueid']));}else{_0x44ff71[_0x1167('0x5f')]='';}return getConnection(_0x3d0bbc)[_0x1167('0x27')](function(_0x5965c7){_0x3c4ae3=_0x5965c7;return getUser(_0x3d0bbc,_0x521836[_0x1167('0x60')],_0x3c4ae3);})['then'](function(_0x3e1c42){_0xd7f523=_0x3e1c42;return getEndUser(_0x3d0bbc,_0x31beeb,_0x44ff71[_0x1167('0x61')],_0x44ff71[_0x1167('0x62')],_0x3c4ae3);})['then'](function(_0x298466){_0x5a5736=_0x298466;return getTicket(_0x3d0bbc,_0xd7f523,_0x5a5736,_0x31beeb,_0x44ff71,_0x31beeb[_0x1167('0x63')],_0x3c4ae3,_0x1167('0x64'));})['then'](function(_0x254cb8){_0x5bf778=_0x254cb8;logger['info'](_0x1167('0x65'),_0x5bf778['id']);logger['info']('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x5bf778['id'],_0x521836[_0x1167('0x50')],_0x3d0bbc[_0x1167('0x3e')]);switch(_0x3d0bbc[_0x1167('0x3e')]){case'integrationTab':emit(util['format'](_0x1167('0x66'),_0x521836[_0x1167('0x50')]),'trigger:salesforce:display',{'recordId':_0x5bf778['id']});break;case _0x1167('0x67'):emit(util[_0x1167('0x45')](_0x1167('0x66'),_0x521836['name']),'trigger:browser:url',{'uri':util[_0x1167('0x45')](_0x1167('0x68'),_0x3c4ae3[_0x1167('0x69')],_0x5bf778['id'])});break;default:logger[_0x1167('0x6a')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0x1167('0x6b')](function(_0x58b87c){logger[_0x1167('0x6a')](_0x1167('0x6c'),_0x58b87c);});};exports[_0x1167('0x6d')]=function(_0x3c552a,_0x17e83b,_0x2d91bd,_0xfcb67b,_0x454286,_0x41df4a,_0x51aa11){var _0x1019b6,_0x3520df,_0x2d3168,_0x125d0c;_0x41df4a[_0x1167('0x59')]=intUtil[_0x1167('0x5a')](_0x41df4a[_0x1167('0x59')]);_0x41df4a[_0x1167('0x55')]=intUtil[_0x1167('0x5a')](_0x41df4a[_0x1167('0x55')]);if(_0x51aa11&&_0x51aa11[_0x1167('0x6e')]&&_0x51aa11[_0x1167('0x6e')]!==_0x1167('0x6f')){logger[_0x1167('0x1f')](_0x1167('0x70'),_0x1167('0x5c'));_0x17e83b['recordingURL']=util[_0x1167('0x45')](_0x1167('0x5d'),_0x41df4a['serverUrl'],_0x17e83b[_0x1167('0x5e')],md5(_0x17e83b['uniqueid']));}return getConnection(_0x41df4a)[_0x1167('0x27')](function(_0xa9f2ad){_0x125d0c=_0xa9f2ad;return getUser(_0x41df4a,_0xfcb67b['email'],_0x125d0c);})[_0x1167('0x27')](function(_0x1c5007){_0x1019b6=_0x1c5007;return getEndUser(_0x41df4a,_0x2d91bd,_0x17e83b['destcalleridname'],_0x17e83b['destcalleridnum'],_0x125d0c);})[_0x1167('0x27')](function(_0x598d3b){_0x3520df=_0x598d3b;return getTicket(_0x41df4a,_0x1019b6,_0x3520df,_0x2d91bd,_0x17e83b,_0x2d91bd[_0x1167('0x63')],_0x125d0c,'outbound');})[_0x1167('0x27')](function(_0x47b5ae){_0x2d3168=_0x47b5ae;logger[_0x1167('0x1f')](_0x1167('0x71'),_0x2d3168['id']);logger[_0x1167('0x1f')](_0x1167('0x72'),_0x2d3168['id'],_0xfcb67b[_0x1167('0x50')],_0x41df4a[_0x1167('0x3e')]);switch(_0x41df4a[_0x1167('0x3e')]){case'integrationTab':emit(util[_0x1167('0x45')](_0x1167('0x66'),_0xfcb67b[_0x1167('0x50')]),_0x1167('0x73'),{'recordId':_0x2d3168['id']});break;case _0x1167('0x67'):emit(util[_0x1167('0x45')]('user:%s',_0xfcb67b[_0x1167('0x50')]),_0x1167('0x74'),{'uri':util[_0x1167('0x45')](_0x1167('0x68'),_0x125d0c[_0x1167('0x69')],_0x2d3168['id'])});break;default:logger[_0x1167('0x6a')](_0x1167('0x70'),_0x1167('0x75'));}})[_0x1167('0x6b')](function(_0x146f41){logger['error'](_0x1167('0x70'),_0x146f41);});};exports[_0x1167('0x76')]=function(_0x4da83e,_0x352b72,_0x19988d,_0xbe4e9d,_0x32f655,_0x222f1a){var _0x1d2310,_0x4155a9,_0x22018a,_0x3e2b40;_0x222f1a[_0x1167('0x59')]=intUtil[_0x1167('0x5a')](_0x222f1a[_0x1167('0x59')]);_0x222f1a[_0x1167('0x55')]=intUtil[_0x1167('0x5a')](_0x222f1a[_0x1167('0x55')]);if(_0x32f655&&_0x32f655[_0x1167('0x5b')]){logger['info']('['+_0x352b72[_0x1167('0x77')][_0x1167('0x78')]()+']',_0x1167('0x5c'));_0x352b72[_0x1167('0x5f')]=util[_0x1167('0x45')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x222f1a[_0x1167('0x59')],_0x352b72[_0x1167('0x5e')],md5(_0x352b72['uniqueid']));}else{_0x352b72['recordingURL']='';}return getConnection(_0x222f1a)[_0x1167('0x27')](function(_0x3785e6){_0x3e2b40=_0x3785e6;if(!_[_0x1167('0x22')](_0xbe4e9d)){return getUser(_0x222f1a,_0xbe4e9d['name'],_0x3e2b40);}else{return getUser(_0x222f1a,null,_0x3e2b40);}})[_0x1167('0x27')](function(_0x25fec1){_0x1d2310=_0x25fec1;return getEndUser(_0x222f1a,_0x19988d,_0x352b72['calleridname'],_0x352b72[_0x1167('0x62')],_0x3e2b40);})['then'](function(_0x11ee41){_0x4155a9=_0x11ee41;return getTicket(_0x222f1a,_0x1d2310,_0x4155a9,_0x19988d,_0x352b72,_0x19988d[_0x1167('0x63')],_0x3e2b40);})[_0x1167('0x27')](function(_0x3325b1){_0x22018a=_0x3325b1;logger[_0x1167('0x1f')]('['+_0x352b72[_0x1167('0x77')]['toUpperCase']()+']\x20Ticket\x20%s\x20created.',_0x22018a['id']);logger[_0x1167('0x1f')]('['+_0x352b72[_0x1167('0x77')][_0x1167('0x78')]()+_0x1167('0x79'),_0x222f1a[_0x1167('0x3e')]);})['catch'](function(_0x484de8){logger['error']('['+_0x352b72['lastevent'][_0x1167('0x78')]()+']',_0x484de8);});}; \ 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 109d607..d3057ae 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 _0x2b2b=['],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','picklist','type','nameField','customField','toLowerCase','string','idField','content','toString','variable','variableName','Variable','name','incident','assign','true','getString','Subjects','Descriptions','Fields','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','Incident','Incident\x20-\x20','push','all','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','remoteUri','serverUrl','stripTrailingSlash','format','%s/api/now/table/','isNil','email','destcalleridnum','calleridnum','callDirection','queue','unmanaged','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Recording\x20is\x20enabled!','recordingFormat','none','The\x20ticket\x20ID\x20is:\x20%s','ticketId','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','inspect','lodash','request-promise','util','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','sys_user?sysparm_query=user_name%3Dadmin','then','result','adminId','sys_id','info','toUpperCase','catch','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','GET','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','length','active','userId','adminEmail','error',']\x20using\x20admin\x20profile','POST','sys_user?','endUserNumber','user'];(function(_0x5b417e,_0x165546){var _0x250a51=function(_0x4f8297){while(--_0x4f8297){_0x5b417e['push'](_0x5b417e['shift']());}};_0x250a51(++_0x165546);}(_0x2b2b,0xb5));var _0xb2b2=function(_0x44657e,_0x5e5bac){_0x44657e=_0x44657e-0x0;var _0x46855c=_0x2b2b[_0x44657e];return _0x46855c;};'use strict';var _=require(_0xb2b2('0x0'));var Promise=require('bluebird');var rp=require(_0xb2b2('0x1'));var util=require(_0xb2b2('0x2'));var md5=require(_0xb2b2('0x3'));var Redis=require(_0xb2b2('0x4'));var intUtil=require(_0xb2b2('0x5'));var config=require(_0xb2b2('0x6'));var logger=require(_0xb2b2('0x7'))(_0xb2b2('0x8'));config[_0xb2b2('0x9')]=_[_0xb2b2('0xa')](config[_0xb2b2('0x9')],{'host':_0xb2b2('0xb'),'port':0x18eb});var io=require(_0xb2b2('0xc'))(new Redis(config[_0xb2b2('0x9')]));function getAdminUser(_0x346f79,_0x4c8d3,_0x2c4674,_0x285788,_0x47755e,_0x334921){return new Promise(function(_0x255faf,_0x32f72e){var _0x4286b8={'method':'GET','uri':_0x285788+_0xb2b2('0xd')+'&'+_0x47755e+'&'+_0x334921,'auth':_0x4c8d3,'json':!![]};return rp(_0x4286b8)[_0xb2b2('0xe')](function(_0x1e755b){if(_0x1e755b[_0xb2b2('0xf')]['length']>0x0){_0x2c4674[_0xb2b2('0x10')]=_0x1e755b[_0xb2b2('0xf')][0x0][_0xb2b2('0x11')];}logger[_0xb2b2('0x12')]('['+[_0x346f79[_0xb2b2('0x13')]()]+'],\x20getAdminUser\x20crm',_0x2c4674);_0x255faf(_0x2c4674);})[_0xb2b2('0x14')](function(_0x4aff0e){logger['error']('['+[_0x346f79['toUpperCase']()]+']',_0x4aff0e[_0xb2b2('0x15')]);_0x32f72e(_0x4aff0e['message']);});});}function getUser(_0x385a37,_0x4e5a00,_0x1b058b,_0x15c187,_0x1554db){return function(_0x5089b7){logger[_0xb2b2('0x12')]('['+[_0x385a37[_0xb2b2('0x13')]()]+_0xb2b2('0x16'),_0x5089b7);return new Promise(function(_0x332eba,_0x4f2a75){if(intUtil[_0xb2b2('0x17')](_0x5089b7[_0xb2b2('0x18')])){var _0x20509e={'method':_0xb2b2('0x19'),'uri':_0x1b058b+_0xb2b2('0x1a')+_0x5089b7[_0xb2b2('0x18')]+'&'+_0x15c187+'&'+_0x1554db,'auth':_0x4e5a00,'json':!![]};logger['info']('['+[_0x385a37[_0xb2b2('0x13')]()]+_0xb2b2('0x1b'),_0x20509e);return rp(_0x20509e)['then'](function(_0x55ec95){logger[_0xb2b2('0x12')]('['+[_0x385a37[_0xb2b2('0x13')]()]+_0xb2b2('0x1c'),_0x55ec95);if(_0x55ec95[_0xb2b2('0xf')][_0xb2b2('0x1d')]>0x0&&String(_0x55ec95[_0xb2b2('0xf')][0x0][_0xb2b2('0x1e')])==='true'){_0x5089b7['userId']=_0x55ec95['result'][0x0]['sys_id'];}else{_0x5089b7[_0xb2b2('0x1f')]=_0x5089b7['adminId'];_0x5089b7['userEmail']=_0x5089b7[_0xb2b2('0x20')];}logger[_0xb2b2('0x12')]('['+[_0x385a37[_0xb2b2('0x13')]()]+'],\x20getUser\x20crm',_0x5089b7);_0x332eba(_0x5089b7);})[_0xb2b2('0x14')](function(_0x1e0c35){logger[_0xb2b2('0x21')]('['+[_0x385a37[_0xb2b2('0x13')]()]+']',_0x1e0c35[_0xb2b2('0x15')]);_0x4f2a75(_0x1e0c35[_0xb2b2('0x15')]);});}else{logger[_0xb2b2('0x12')]('['+[_0x385a37[_0xb2b2('0x13')]()]+_0xb2b2('0x22'));_0x5089b7[_0xb2b2('0x1f')]=_0x5089b7['adminId'];_0x5089b7['userEmail']=_0x5089b7[_0xb2b2('0x20')];_0x332eba(_0x5089b7);}});};}function createEndUser(_0x56052c,_0x2bb7b8,_0x560940,_0xd2ba31,_0x36da2f){logger['info']('['+[_0x56052c[_0xb2b2('0x13')]()]+'],\x20createEndUser\x20input\x20crm',_0x560940);return new Promise(function(_0x34b51f,_0x5d017a){var _0x5c59b4={'method':_0xb2b2('0x23'),'uri':_0xd2ba31+_0xb2b2('0x24')+_0x36da2f,'body':{'user_name':_0x560940[_0xb2b2('0x25')],'roles':_0xb2b2('0x26'),'first_name':_0x560940[_0xb2b2('0x25')],'active':'true','date_format':'System','phone':_0x560940[_0xb2b2('0x25')]},'auth':_0x2bb7b8,'json':!![]};return rp(_0x5c59b4)[_0xb2b2('0xe')](function(_0x497934){logger['info']('['+[_0x56052c['toUpperCase']()]+_0xb2b2('0x27'),_0x497934['result']);_0x560940[_0xb2b2('0x28')]=_0x497934[_0xb2b2('0xf')][_0xb2b2('0x11')];_0x34b51f(_0x560940);})[_0xb2b2('0x14')](function(_0xa1fec0){logger['error']('['+[_0x56052c['toUpperCase']()]+']',_0xa1fec0[_0xb2b2('0x15')]);_0x5d017a(_0xa1fec0[_0xb2b2('0x15')]);});});}function getEndUser(_0x2f6674,_0x1d6bbe,_0x4d0bdd,_0x4e8837,_0x2bd292){return function(_0xbee1b1){logger['info']('['+[_0x2f6674[_0xb2b2('0x13')]()]+_0xb2b2('0x29'),_0xbee1b1);return new Promise(function(_0x39c4d9,_0x55ac74){var _0x4ffa4a={'method':_0xb2b2('0x19'),'uri':_0x4d0bdd+_0xb2b2('0x2a')+_0xbee1b1[_0xb2b2('0x25')]+'&'+_0x4e8837+'&'+_0x2bd292,'auth':_0x1d6bbe,'json':!![]};return rp(_0x4ffa4a)[_0xb2b2('0xe')](function(_0x4d41b0){if(_0x4d41b0[_0xb2b2('0xf')][_0xb2b2('0x1d')]>0x0){_0xbee1b1[_0xb2b2('0x28')]=_0x4d41b0[_0xb2b2('0xf')][0x0][_0xb2b2('0x11')];logger[_0xb2b2('0x12')]('['+[_0x2f6674[_0xb2b2('0x13')]()]+_0xb2b2('0x2b'),_0xbee1b1);_0x39c4d9(_0xbee1b1);}else{return createEndUser(_0x2f6674,_0x1d6bbe,_0xbee1b1,_0x4d0bdd,_0x4e8837)[_0xb2b2('0xe')](function(_0x341b7f){logger[_0xb2b2('0x12')]('['+[_0x2f6674[_0xb2b2('0x13')]()]+_0xb2b2('0x2c'),_0x341b7f);_0x39c4d9(_0x341b7f);});}})['catch'](function(_0x100e52){logger[_0xb2b2('0x21')]('['+[_0x2f6674[_0xb2b2('0x13')]()]+']',_0x100e52[_0xb2b2('0x15')]);_0x55ac74(_0x100e52[_0xb2b2('0x15')]);});});};}function getCustomFields(_0x3632f1,_0x4f4761){var _0xff1d59={};if(_0x3632f1[_0xb2b2('0x1d')]>0x0){_[_0xb2b2('0x2d')](_0x3632f1,function(_0x46422f){if(_[_0xb2b2('0x2e')](['string',_0xb2b2('0x2f')],_0x46422f[_0xb2b2('0x30')])&&_0x46422f[_0xb2b2('0x31')]&&!_0x46422f[_0xb2b2('0x32')]){_0xff1d59[_0x46422f[_0xb2b2('0x31')][_0xb2b2('0x33')]()]=_0x46422f['content']['toString']();}else if(_[_0xb2b2('0x2e')]([_0xb2b2('0x34'),_0xb2b2('0x2f')],_0x46422f[_0xb2b2('0x30')])&&_0x46422f[_0xb2b2('0x35')]&&_0x46422f['customField']){_0xff1d59[_0x46422f[_0xb2b2('0x35')][_0xb2b2('0x33')]()]=_0x46422f[_0xb2b2('0x36')][_0xb2b2('0x37')]();}else if(_0x46422f['type']===_0xb2b2('0x38')&&_0x46422f[_0xb2b2('0x39')]&&_0x46422f['idField']&&_0x46422f['customField']){_0xff1d59[_0x46422f[_0xb2b2('0x35')][_0xb2b2('0x33')]()]=_0x4f4761[_0x46422f['variableName']][_0xb2b2('0x37')]();}else if(_0x46422f[_0xb2b2('0x30')]==='customVariable'&&_0x46422f['Variable']&&_0x46422f[_0xb2b2('0x3a')]['name']&&_0x46422f[_0xb2b2('0x35')]&&_0x46422f['customField']){_0xff1d59[_0x46422f[_0xb2b2('0x35')][_0xb2b2('0x33')]()]=_0x4f4761[_0x46422f['Variable'][_0xb2b2('0x3b')][_0xb2b2('0x33')]()][_0xb2b2('0x37')]();}});}return _0xff1d59;}function getTicket(_0x5da63c,_0xcbd032,_0x3cdfec,_0x44a737,_0x34e170,_0x5525d4){return function(_0x366518){logger[_0xb2b2('0x12')]('['+[_0x5da63c[_0xb2b2('0x13')]()]+']\x20getTicket\x20input\x20crm',_0x366518);return new Promise(function(_0x549d7d,_0x4a543d){var _0x475203=_0x5da63c[_0xb2b2('0x33')]()==='outbound'?_0x366518[_0xb2b2('0x1f')]:_0x366518[_0xb2b2('0x28')];var _0x5378d1={'method':'POST','uri':_0x3cdfec+_0xb2b2('0x3c')+'?'+_0x5525d4,'body':Object[_0xb2b2('0x3d')]({},{'active':_0xb2b2('0x3e'),'caller_id':_0x475203,'assigned_to':_0x366518[_0xb2b2('0x1f')],'short_description':intUtil[_0xb2b2('0x3f')](_0x44a737[_0xb2b2('0x40')],_0x34e170,'\x20'),'description':intUtil[_0xb2b2('0x3f')](_0x44a737[_0xb2b2('0x41')],_0x34e170,'\x0a')},getCustomFields(_0x44a737[_0xb2b2('0x42')],_0x34e170)),'auth':_0xcbd032,'json':!![]};return rp(_0x5378d1)[_0xb2b2('0xe')](function(_0x469d27){logger[_0xb2b2('0x12')]('['+[_0x5da63c[_0xb2b2('0x13')]()]+']\x20POST\x20incident\x20entity\x20schema',_0x469d27[_0xb2b2('0xf')]);_0x366518['ticketId']=_0x469d27[_0xb2b2('0xf')][_0xb2b2('0x11')];_0x366518[_0xb2b2('0x43')]=_0x469d27['result'][_0xb2b2('0x44')];logger[_0xb2b2('0x12')]('['+[_0x5da63c[_0xb2b2('0x13')]()]+_0xb2b2('0x45'),_0x366518);_0x549d7d(_0x366518);})[_0xb2b2('0x14')](function(_0x2a7f54){logger['error']('['+[_0x5da63c[_0xb2b2('0x13')]()]+']',_0x2a7f54['message']);_0x4a543d(_0x2a7f54[_0xb2b2('0x15')]);});});};}function createRemoteTag(_0x39765c,_0x134d64,_0x4d909c,_0x5dc6f3){return new Promise(function(_0x5e4c66,_0x3addd8){var _0x524aea={'method':'POST','uri':_0x4d909c+'label'+'?'+_0x5dc6f3,'body':{'short_description':_0x39765c,'global':!![],'active':!![],'name':_0x39765c},'auth':_0x134d64,'json':!![]};return rp(_0x524aea)[_0xb2b2('0xe')](function(_0x581f18){var _0x56a169=_0x581f18[_0xb2b2('0xf')][_0xb2b2('0x11')];_0x5e4c66(_0x56a169);});});}function getRemoteTag(_0xe235c0,_0x242635,_0x2f7433,_0x37ecaf,_0x5ee6a1){return new Promise(function(_0x4cea5f,_0x368151){var _0x3fa1e1={'method':_0xb2b2('0x19'),'uri':_0x2f7433+_0xb2b2('0x46')+_0xb2b2('0x47')+_0xe235c0+'&'+_0x37ecaf,'auth':_0x242635,'json':!![]};return rp(_0x3fa1e1)[_0xb2b2('0xe')](function(_0x2a897b){if(_0x2a897b['result'][_0xb2b2('0x1d')]>0x0){var _0x32ed85=_0x2a897b[_0xb2b2('0xf')][0x0][_0xb2b2('0x11')];_0x4cea5f(_0x32ed85);}else{return createRemoteTag(_0xe235c0,_0x242635,_0x2f7433,_0x37ecaf)['then'](function(_0x480e05){_0x4cea5f(_0x480e05);});}});});}function assignTagToIncident(_0x4b9838,_0xbfb6b7,_0x3621e0,_0x388985,_0x43fbdc){return new Promise(function(_0x581c4f,_0x12a4c9){var _0x5b59c9={'method':_0xb2b2('0x23'),'uri':_0x3621e0+_0xb2b2('0x48')+'?'+_0x43fbdc,'body':{'label':_0x4b9838,'table':'incident','id_type':_0xb2b2('0x49'),'table_key':_0x388985['ticketId'],'title':_0xb2b2('0x4a')+_0x388985[_0xb2b2('0x43')],'id_display':_0x388985[_0xb2b2('0x43')]},'auth':_0xbfb6b7,'json':!![]};return rp(_0x5b59c9)['then'](function(_0x1aec9b){_0x581c4f();})[_0xb2b2('0x14')](function(){_0x581c4f();});});}function manageTags(_0x1ab04b,_0xad2a67,_0x38f2d5,_0x42c178,_0x22991b,_0x1765f0,_0x553ce8){return new Promise(function(_0x439175,_0x33e5ed){var _0x4a5302=[];_0xad2a67[_0xb2b2('0x2d')](function(_0x5756d6){_0x4a5302[_0xb2b2('0x4b')](getRemoteTag(_0x5756d6,_0x38f2d5,_0x42c178,_0x1765f0,_0x553ce8));});return Promise[_0xb2b2('0x4c')](_0x4a5302)[_0xb2b2('0xe')](function(_0x5ee6dd){if(_0x5ee6dd[_0xb2b2('0x1d')]){logger[_0xb2b2('0x12')]('['+[_0x1ab04b[_0xb2b2('0x13')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x5ee6dd);var _0x15d522=[];_0x5ee6dd['forEach'](function(_0x467318){_0x15d522[_0xb2b2('0x4b')](assignTagToIncident(_0x467318,_0x38f2d5,_0x42c178,_0x22991b,_0x1765f0));});return Promise[_0xb2b2('0x4c')](_0x15d522)['then'](function(){_0x439175();})[_0xb2b2('0x14')](function(){_0x439175();});}else{_0x439175();}});});}function getTags(_0x109c10,_0x29fa00,_0x56224d,_0xd20039,_0xd1a443,_0x155ce7){return function(_0x70729a){return new Promise(function(_0x2a093e,_0x3c8a01){var _0x440781=[];var _0x1265ab=_0xd20039['Tags'];if(_0x1265ab&&_0x1265ab[_0xb2b2('0x1d')]>0x0){_0x440781=_[_0xb2b2('0x4d')](_0x1265ab,'name');}if(_0x440781['length']>0x0){return manageTags(_0x109c10,_0x440781,_0x29fa00,_0x56224d,_0x70729a,_0xd1a443,_0x155ce7)[_0xb2b2('0xe')](function(){_0x2a093e(_0x70729a);});}else{_0x2a093e(_0x70729a);}});};}function emit(_0x2d5aa2,_0x5e59a4,_0x21372e){var _0x32fad3=_0xb2b2('0x4e')+_0xb2b2('0x4f')+_0xb2b2('0x50')+_0xb2b2('0x51');var _0x2bb3ba={'uri':_0x2d5aa2+_0xb2b2('0x52')+_0x21372e+_0x32fad3};io['to'](util['format'](_0xb2b2('0x53'),_0x5e59a4))['emit'](_0xb2b2('0x54'),_0x2bb3ba);}exports['cs']=function(_0x28f2a8,_0x127cbe,_0x3a1397,_0x40f070,_0x562165,_0x1392b4,_0x1438bc,_0x1f6f14){var _0x1669e5={};var _0xb5a958={'user':_0x1392b4[_0xb2b2('0x55')],'pass':_0x1392b4[_0xb2b2('0x56')]};var _0x598ee8='sysparm_limit=1';var _0x5bea56='sysparm_display_value=true';_0x1392b4[_0xb2b2('0x57')]=intUtil['stripTrailingSlash'](_0x1392b4[_0xb2b2('0x57')]);_0x1392b4[_0xb2b2('0x58')]=intUtil[_0xb2b2('0x59')](_0x1392b4[_0xb2b2('0x58')]);var _0x29e72e=util[_0xb2b2('0x5a')](_0xb2b2('0x5b'),_0x1392b4[_0xb2b2('0x57')]);_0x1669e5[_0xb2b2('0x18')]=!_[_0xb2b2('0x5c')](_0x40f070)?_0x40f070[_0xb2b2('0x5d')]:null;_0x1669e5[_0xb2b2('0x20')]=_0x1392b4[_0xb2b2('0x5d')];_0x1669e5[_0xb2b2('0x25')]=_0x1f6f14['toLowerCase']()==='outbound'?_0x127cbe[_0xb2b2('0x5e')]:_0x127cbe[_0xb2b2('0x5f')];_0x1669e5[_0xb2b2('0x60')]=_0x1f6f14===_0xb2b2('0x61')||_0x1f6f14===_0xb2b2('0x62')?_0xb2b2('0x61'):_0xb2b2('0x63');var _0x33a8b0=util[_0xb2b2('0x5a')](_0xb2b2('0x64'),_0x1392b4[_0xb2b2('0x58')],_0x127cbe[_0xb2b2('0x65')],md5(_0x127cbe[_0xb2b2('0x65')]));if(_0x562165&&_0x562165['monitor_format']){logger['info']('[QUEUE]',_0xb2b2('0x66'));_0x127cbe['recordingURL']=_0x33a8b0;}else if(_0x1438bc&&_0x1438bc[_0xb2b2('0x67')]&&_0x1438bc[_0xb2b2('0x67')]!==_0xb2b2('0x68')){logger[_0xb2b2('0x12')]('[OUTBOUND]',_0xb2b2('0x66'));_0x127cbe['recordingURL']=_0x33a8b0;}else{_0x127cbe['recordingURL']='';}return getAdminUser(_0x1f6f14,_0xb5a958,_0x1669e5,_0x29e72e,_0x5bea56,_0x598ee8)[_0xb2b2('0xe')](getUser(_0x1f6f14,_0xb5a958,_0x29e72e,_0x5bea56,_0x598ee8))[_0xb2b2('0xe')](getEndUser(_0x1f6f14,_0xb5a958,_0x29e72e,_0x5bea56,_0x598ee8))[_0xb2b2('0xe')](getTicket(_0x1f6f14,_0xb5a958,_0x29e72e,_0x3a1397,_0x127cbe,_0x5bea56))['then'](function(_0x24b94e){logger[_0xb2b2('0x12')](util[_0xb2b2('0x5a')](_0xb2b2('0x69'),_0x24b94e[_0xb2b2('0x6a')]));logger[_0xb2b2('0x12')](util[_0xb2b2('0x5a')](_0xb2b2('0x6b'),_0x1f6f14));if(_0x1f6f14!==_0xb2b2('0x62')){logger[_0xb2b2('0x12')]('['+[_0x1f6f14[_0xb2b2('0x13')]()]+']',_0xb2b2('0x6c'));emit(_0x1392b4[_0xb2b2('0x57')],_0x40f070[_0xb2b2('0x3b')],_0x24b94e[_0xb2b2('0x6a')]);}})[_0xb2b2('0x14')](function(_0x5f0555){logger[_0xb2b2('0x21')]('['+[_0x1f6f14[_0xb2b2('0x13')]()]+']\x20Error\x20running\x20ServiceNow\x20integration',util[_0xb2b2('0x6d')](_0x5f0555,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x04a6=['call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','ioredis','./util','../../../../config/logger','servicenow','defaults','localhost','socket.io-emitter','redis','then','length','adminId','info','toUpperCase','],\x20getAdminUser\x20crm','catch','message','],\x20getUser\x20input\x20crm','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','result','active','true','userId','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','user','endUserNumber','],\x20EndUser\x20schema','sys_id','error','GET','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','picklist','customField','nameField','toLowerCase','content','toString','includes','string','type','idField','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','endUserId','incident','assign','Subjects','Descriptions','Fields','ticketId','ticketNumber','label','?sysparm_query=name%3D','label_entry','Incident','Incident\x20-\x20','push','all','Tags','map','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%255EORDERBYDESCnumber','format','emit','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','email','callDirection','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','recordingFormat','none','recordingURL','The\x20ticket\x20ID\x20is:\x20%s'];(function(_0x5660ef,_0x1ac1d5){var _0x56be26=function(_0x5edbac){while(--_0x5edbac){_0x5660ef['push'](_0x5660ef['shift']());}};_0x56be26(++_0x1ac1d5);}(_0x04a6,0x1a4));var _0x604a=function(_0x4c0dd3,_0x541482){_0x4c0dd3=_0x4c0dd3-0x0;var _0x5df06b=_0x04a6[_0x4c0dd3];return _0x5df06b;};'use strict';var _=require(_0x604a('0x0'));var Promise=require(_0x604a('0x1'));var rp=require('request-promise');var util=require('util');var md5=require('md5');var Redis=require(_0x604a('0x2'));var intUtil=require(_0x604a('0x3'));var config=require('../../../../config/environment');var logger=require(_0x604a('0x4'))(_0x604a('0x5'));config['redis']=_[_0x604a('0x6')](config['redis'],{'host':_0x604a('0x7'),'port':0x18eb});var io=require(_0x604a('0x8'))(new Redis(config[_0x604a('0x9')]));function getAdminUser(_0x27398d,_0x4a1bf9,_0x27c8a6,_0x2d4f73,_0x1f0674,_0x179792){return new Promise(function(_0x45d3ae,_0x34dcf5){var _0x28d2a7={'method':'GET','uri':_0x2d4f73+'sys_user?sysparm_query=user_name%3Dadmin'+'&'+_0x1f0674+'&'+_0x179792,'auth':_0x4a1bf9,'json':!![]};return rp(_0x28d2a7)[_0x604a('0xa')](function(_0x55ef3a){if(_0x55ef3a['result'][_0x604a('0xb')]>0x0){_0x27c8a6[_0x604a('0xc')]=_0x55ef3a['result'][0x0]['sys_id'];}logger[_0x604a('0xd')]('['+[_0x27398d[_0x604a('0xe')]()]+_0x604a('0xf'),_0x27c8a6);_0x45d3ae(_0x27c8a6);})[_0x604a('0x10')](function(_0x236c58){logger['error']('['+[_0x27398d[_0x604a('0xe')]()]+']',_0x236c58[_0x604a('0x11')]);_0x34dcf5(_0x236c58['message']);});});}function getUser(_0x33a2d3,_0x3e1444,_0x58c253,_0x56215a,_0x4520b2){return function(_0x3298f4){logger[_0x604a('0xd')]('['+[_0x33a2d3[_0x604a('0xe')]()]+_0x604a('0x12'),_0x3298f4);return new Promise(function(_0x49f406,_0x493433){if(intUtil['validateEmail'](_0x3298f4[_0x604a('0x13')])){var _0x51e26d={'method':'GET','uri':_0x58c253+_0x604a('0x14')+_0x3298f4[_0x604a('0x13')]+'&'+_0x56215a+'&'+_0x4520b2,'auth':_0x3e1444,'json':!![]};logger[_0x604a('0xd')]('['+[_0x33a2d3['toUpperCase']()]+_0x604a('0x15'),_0x51e26d);return rp(_0x51e26d)[_0x604a('0xa')](function(_0x2bc0cd){logger[_0x604a('0xd')]('['+[_0x33a2d3[_0x604a('0xe')]()]+_0x604a('0x16'),_0x2bc0cd);if(_0x2bc0cd[_0x604a('0x17')][_0x604a('0xb')]>0x0&&String(_0x2bc0cd[_0x604a('0x17')][0x0][_0x604a('0x18')])===_0x604a('0x19')){_0x3298f4[_0x604a('0x1a')]=_0x2bc0cd[_0x604a('0x17')][0x0]['sys_id'];}else{_0x3298f4[_0x604a('0x1a')]=_0x3298f4[_0x604a('0xc')];_0x3298f4[_0x604a('0x13')]=_0x3298f4[_0x604a('0x1b')];}logger['info']('['+[_0x33a2d3[_0x604a('0xe')]()]+_0x604a('0x1c'),_0x3298f4);_0x49f406(_0x3298f4);})[_0x604a('0x10')](function(_0xfaf86b){logger['error']('['+[_0x33a2d3[_0x604a('0xe')]()]+']',_0xfaf86b[_0x604a('0x11')]);_0x493433(_0xfaf86b[_0x604a('0x11')]);});}else{logger[_0x604a('0xd')]('['+[_0x33a2d3[_0x604a('0xe')]()]+_0x604a('0x1d'));_0x3298f4['userId']=_0x3298f4[_0x604a('0xc')];_0x3298f4['userEmail']=_0x3298f4[_0x604a('0x1b')];_0x49f406(_0x3298f4);}});};}function createEndUser(_0x50aa57,_0x2538e3,_0x2bfb58,_0x836b96,_0x197bbf){logger[_0x604a('0xd')]('['+[_0x50aa57[_0x604a('0xe')]()]+_0x604a('0x1e'),_0x2bfb58);return new Promise(function(_0xec6474,_0x542a2b){var _0x23c3ad={'method':_0x604a('0x1f'),'uri':_0x836b96+_0x604a('0x20')+_0x197bbf,'body':{'user_name':_0x2bfb58['endUserNumber'],'roles':_0x604a('0x21'),'first_name':_0x2bfb58[_0x604a('0x22')],'active':'true','date_format':'System','phone':_0x2bfb58[_0x604a('0x22')]},'auth':_0x2538e3,'json':!![]};return rp(_0x23c3ad)['then'](function(_0x31be93){logger[_0x604a('0xd')]('['+[_0x50aa57[_0x604a('0xe')]()]+_0x604a('0x23'),_0x31be93['result']);_0x2bfb58['endUserId']=_0x31be93[_0x604a('0x17')][_0x604a('0x24')];_0xec6474(_0x2bfb58);})[_0x604a('0x10')](function(_0x581c28){logger[_0x604a('0x25')]('['+[_0x50aa57[_0x604a('0xe')]()]+']',_0x581c28[_0x604a('0x11')]);_0x542a2b(_0x581c28[_0x604a('0x11')]);});});}function getEndUser(_0x30db30,_0x52f60a,_0x1ea2e7,_0x494070,_0x3b1796){return function(_0x5f0b8a){logger[_0x604a('0xd')]('['+[_0x30db30['toUpperCase']()]+'],\x20getEndUser\x20input\x20crm',_0x5f0b8a);return new Promise(function(_0x5e5e27,_0x4ea303){var _0x3e311a={'method':_0x604a('0x26'),'uri':_0x1ea2e7+_0x604a('0x27')+_0x5f0b8a[_0x604a('0x22')]+'&'+_0x494070+'&'+_0x3b1796,'auth':_0x52f60a,'json':!![]};return rp(_0x3e311a)[_0x604a('0xa')](function(_0x1a54c0){if(_0x1a54c0['result'][_0x604a('0xb')]>0x0){_0x5f0b8a['endUserId']=_0x1a54c0[_0x604a('0x17')][0x0][_0x604a('0x24')];logger[_0x604a('0xd')]('['+[_0x30db30[_0x604a('0xe')]()]+_0x604a('0x28'),_0x5f0b8a);_0x5e5e27(_0x5f0b8a);}else{return createEndUser(_0x30db30,_0x52f60a,_0x5f0b8a,_0x1ea2e7,_0x494070)[_0x604a('0xa')](function(_0x2ea160){logger[_0x604a('0xd')]('['+[_0x30db30[_0x604a('0xe')]()]+_0x604a('0x29'),_0x2ea160);_0x5e5e27(_0x2ea160);});}})['catch'](function(_0x454c18){logger[_0x604a('0x25')]('['+[_0x30db30['toUpperCase']()]+']',_0x454c18[_0x604a('0x11')]);_0x4ea303(_0x454c18[_0x604a('0x11')]);});});};}function getCustomFields(_0x4ba7f2,_0x405d42){var _0x3515c9={};if(_0x4ba7f2['length']>0x0){_[_0x604a('0x2a')](_0x4ba7f2,function(_0x36c93b){if(_['includes'](['string',_0x604a('0x2b')],_0x36c93b['type'])&&_0x36c93b['nameField']&&!_0x36c93b[_0x604a('0x2c')]){_0x3515c9[_0x36c93b[_0x604a('0x2d')][_0x604a('0x2e')]()]=_0x36c93b[_0x604a('0x2f')][_0x604a('0x30')]();}else if(_[_0x604a('0x31')]([_0x604a('0x32'),_0x604a('0x2b')],_0x36c93b[_0x604a('0x33')])&&_0x36c93b['idField']&&_0x36c93b[_0x604a('0x2c')]){_0x3515c9[_0x36c93b[_0x604a('0x34')][_0x604a('0x2e')]()]=_0x36c93b[_0x604a('0x2f')][_0x604a('0x30')]();}else if(_0x36c93b[_0x604a('0x33')]===_0x604a('0x35')&&_0x36c93b[_0x604a('0x36')]&&_0x36c93b['idField']&&_0x36c93b[_0x604a('0x2c')]){_0x3515c9[_0x36c93b[_0x604a('0x34')][_0x604a('0x2e')]()]=_0x405d42[_0x36c93b['variableName']][_0x604a('0x30')]();}else if(_0x36c93b[_0x604a('0x33')]===_0x604a('0x37')&&_0x36c93b['Variable']&&_0x36c93b[_0x604a('0x38')][_0x604a('0x39')]&&_0x36c93b[_0x604a('0x34')]&&_0x36c93b[_0x604a('0x2c')]){_0x3515c9[_0x36c93b[_0x604a('0x34')][_0x604a('0x2e')]()]=_0x405d42[_0x36c93b['Variable'][_0x604a('0x39')][_0x604a('0x2e')]()][_0x604a('0x30')]();}});}return _0x3515c9;}function getTicket(_0x305dbe,_0x157e7f,_0x4c0b96,_0x4cf044,_0x33b74e,_0x5cdc30){return function(_0x2a52c9){logger['info']('['+[_0x305dbe['toUpperCase']()]+_0x604a('0x3a'),_0x2a52c9);return new Promise(function(_0x27f28a,_0x3773c2){var _0x4defb6=_0x305dbe[_0x604a('0x2e')]()===_0x604a('0x3b')?_0x2a52c9[_0x604a('0x1a')]:_0x2a52c9[_0x604a('0x3c')];var _0x97ec4a={'method':_0x604a('0x1f'),'uri':_0x4c0b96+_0x604a('0x3d')+'?'+_0x5cdc30,'body':Object[_0x604a('0x3e')]({},{'active':_0x604a('0x19'),'caller_id':_0x4defb6,'assigned_to':_0x2a52c9[_0x604a('0x1a')],'short_description':intUtil['getString'](_0x4cf044[_0x604a('0x3f')],_0x33b74e,'\x20'),'description':intUtil['getString'](_0x4cf044[_0x604a('0x40')],_0x33b74e,'\x0a')},getCustomFields(_0x4cf044[_0x604a('0x41')],_0x33b74e)),'auth':_0x157e7f,'json':!![]};return rp(_0x97ec4a)[_0x604a('0xa')](function(_0x2276dc){logger[_0x604a('0xd')]('['+[_0x305dbe[_0x604a('0xe')]()]+']\x20POST\x20incident\x20entity\x20schema',_0x2276dc[_0x604a('0x17')]);_0x2a52c9[_0x604a('0x42')]=_0x2276dc[_0x604a('0x17')][_0x604a('0x24')];_0x2a52c9[_0x604a('0x43')]=_0x2276dc[_0x604a('0x17')]['number'];logger[_0x604a('0xd')]('['+[_0x305dbe[_0x604a('0xe')]()]+']\x20getTicket\x20crm',_0x2a52c9);_0x27f28a(_0x2a52c9);})[_0x604a('0x10')](function(_0x513f76){logger[_0x604a('0x25')]('['+[_0x305dbe[_0x604a('0xe')]()]+']',_0x513f76[_0x604a('0x11')]);_0x3773c2(_0x513f76['message']);});});};}function createRemoteTag(_0x393870,_0x390813,_0x261011,_0x34607b){return new Promise(function(_0x1c6bfe,_0x1347ca){var _0x19f80e={'method':'POST','uri':_0x261011+'label'+'?'+_0x34607b,'body':{'short_description':_0x393870,'global':!![],'active':!![],'name':_0x393870},'auth':_0x390813,'json':!![]};return rp(_0x19f80e)[_0x604a('0xa')](function(_0x1fd281){var _0x4e7ca6=_0x1fd281[_0x604a('0x17')]['sys_id'];_0x1c6bfe(_0x4e7ca6);});});}function getRemoteTag(_0x16af15,_0x5da60e,_0x57122e,_0x2e74f6,_0x20542e){return new Promise(function(_0x4833e1,_0x5aa546){var _0x4675ee={'method':_0x604a('0x26'),'uri':_0x57122e+_0x604a('0x44')+_0x604a('0x45')+_0x16af15+'&'+_0x2e74f6,'auth':_0x5da60e,'json':!![]};return rp(_0x4675ee)[_0x604a('0xa')](function(_0x4b7c6c){if(_0x4b7c6c[_0x604a('0x17')][_0x604a('0xb')]>0x0){var _0x1777c1=_0x4b7c6c[_0x604a('0x17')][0x0][_0x604a('0x24')];_0x4833e1(_0x1777c1);}else{return createRemoteTag(_0x16af15,_0x5da60e,_0x57122e,_0x2e74f6)[_0x604a('0xa')](function(_0xf4bf90){_0x4833e1(_0xf4bf90);});}});});}function assignTagToIncident(_0x577dad,_0x3a0326,_0x5c8209,_0x48c2d5,_0x2d8a09){return new Promise(function(_0x1c7391,_0x3423ac){var _0x4ae3ab={'method':_0x604a('0x1f'),'uri':_0x5c8209+_0x604a('0x46')+'?'+_0x2d8a09,'body':{'label':_0x577dad,'table':'incident','id_type':_0x604a('0x47'),'table_key':_0x48c2d5[_0x604a('0x42')],'title':_0x604a('0x48')+_0x48c2d5[_0x604a('0x43')],'id_display':_0x48c2d5[_0x604a('0x43')]},'auth':_0x3a0326,'json':!![]};return rp(_0x4ae3ab)[_0x604a('0xa')](function(_0x75027d){_0x1c7391();})[_0x604a('0x10')](function(){_0x1c7391();});});}function manageTags(_0x196655,_0x6379b4,_0x48135b,_0x592788,_0x5245e9,_0x223f89,_0x1a5c65){return new Promise(function(_0x209f25,_0x12cc7a){var _0x162c3e=[];_0x6379b4[_0x604a('0x2a')](function(_0x302aae){_0x162c3e[_0x604a('0x49')](getRemoteTag(_0x302aae,_0x48135b,_0x592788,_0x223f89,_0x1a5c65));});return Promise[_0x604a('0x4a')](_0x162c3e)[_0x604a('0xa')](function(_0x11ee3d){if(_0x11ee3d['length']){logger[_0x604a('0xd')]('['+[_0x196655['toUpperCase']()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x11ee3d);var _0x5cf41d=[];_0x11ee3d[_0x604a('0x2a')](function(_0x199505){_0x5cf41d[_0x604a('0x49')](assignTagToIncident(_0x199505,_0x48135b,_0x592788,_0x5245e9,_0x223f89));});return Promise[_0x604a('0x4a')](_0x5cf41d)['then'](function(){_0x209f25();})[_0x604a('0x10')](function(){_0x209f25();});}else{_0x209f25();}});});}function getTags(_0x182b65,_0x195471,_0x3d13f5,_0x3554d4,_0x1db26c,_0x3fd4e8){return function(_0x1f0a39){return new Promise(function(_0x132905,_0x324b6c){var _0x574508=[];var _0x34f393=_0x3554d4[_0x604a('0x4b')];if(_0x34f393&&_0x34f393[_0x604a('0xb')]>0x0){_0x574508=_[_0x604a('0x4c')](_0x34f393,_0x604a('0x39'));}if(_0x574508['length']>0x0){return manageTags(_0x182b65,_0x574508,_0x195471,_0x3d13f5,_0x1f0a39,_0x1db26c,_0x3fd4e8)[_0x604a('0xa')](function(){_0x132905(_0x1f0a39);});}else{_0x132905(_0x1f0a39);}});};}function emit(_0xbb557c,_0xcfe0d3,_0x2c1897){var _0x8fe73d='%26sysparm_record_target%3Dincident'+_0x604a('0x4d')+'%26sysparm_record_list%3Dactive%253Dtrue'+_0x604a('0x4e');var _0x2b7e9b={'uri':_0xbb557c+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x2c1897+_0x8fe73d};io['to'](util[_0x604a('0x4f')]('user:%s',_0xcfe0d3))[_0x604a('0x50')](_0x604a('0x51'),_0x2b7e9b);}exports['cs']=function(_0x13b125,_0x23c885,_0x4ff949,_0x47a585,_0x19149d,_0x3d8170,_0x7f169e,_0x329248){var _0x241bc4={};var _0x1b8394={'user':_0x3d8170[_0x604a('0x52')],'pass':_0x3d8170[_0x604a('0x53')]};var _0x579db5=_0x604a('0x54');var _0x25fcc4=_0x604a('0x55');_0x3d8170[_0x604a('0x56')]=intUtil[_0x604a('0x57')](_0x3d8170['remoteUri']);_0x3d8170['serverUrl']=intUtil[_0x604a('0x57')](_0x3d8170[_0x604a('0x58')]);var _0x21bcfd=util[_0x604a('0x4f')](_0x604a('0x59'),_0x3d8170['remoteUri']);_0x241bc4[_0x604a('0x13')]=!_['isNil'](_0x47a585)?_0x47a585[_0x604a('0x5a')]:null;_0x241bc4[_0x604a('0x1b')]=_0x3d8170['email'];_0x241bc4[_0x604a('0x22')]=_0x329248[_0x604a('0x2e')]()==='outbound'?_0x23c885['destcalleridnum']:_0x23c885['calleridnum'];_0x241bc4[_0x604a('0x5b')]=_0x329248===_0x604a('0x5c')||_0x329248==='unmanaged'?_0x604a('0x5c'):_0x604a('0x3b');var _0x2313a6=util['format'](_0x604a('0x5d'),_0x3d8170[_0x604a('0x58')],_0x23c885[_0x604a('0x5e')],md5(_0x23c885[_0x604a('0x5e')]));if(_0x19149d&&_0x19149d[_0x604a('0x5f')]){logger[_0x604a('0xd')]('[QUEUE]','Recording\x20is\x20enabled!');_0x23c885['recordingURL']=_0x2313a6;}else if(_0x7f169e&&_0x7f169e['recordingFormat']&&_0x7f169e[_0x604a('0x60')]!==_0x604a('0x61')){logger['info']('[OUTBOUND]','Recording\x20is\x20enabled!');_0x23c885[_0x604a('0x62')]=_0x2313a6;}else{_0x23c885[_0x604a('0x62')]='';}return getAdminUser(_0x329248,_0x1b8394,_0x241bc4,_0x21bcfd,_0x25fcc4,_0x579db5)[_0x604a('0xa')](getUser(_0x329248,_0x1b8394,_0x21bcfd,_0x25fcc4,_0x579db5))['then'](getEndUser(_0x329248,_0x1b8394,_0x21bcfd,_0x25fcc4,_0x579db5))[_0x604a('0xa')](getTicket(_0x329248,_0x1b8394,_0x21bcfd,_0x4ff949,_0x23c885,_0x25fcc4))[_0x604a('0xa')](function(_0x5f13fe){logger[_0x604a('0xd')](util[_0x604a('0x4f')](_0x604a('0x63'),_0x5f13fe[_0x604a('0x42')]));logger[_0x604a('0xd')](util[_0x604a('0x4f')](_0x604a('0x64'),_0x329248));if(_0x329248!=='unmanaged'){logger['info']('['+[_0x329248[_0x604a('0xe')]()]+']',_0x604a('0x65'));emit(_0x3d8170[_0x604a('0x56')],_0x47a585['name'],_0x5f13fe[_0x604a('0x42')]);}})['catch'](function(_0x3a23c0){logger[_0x604a('0x25')]('['+[_0x329248[_0x604a('0xe')]()]+_0x604a('0x66'),util[_0x604a('0x67')](_0x3a23c0,{'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 91b4995..75d5a42 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 _0x0a51=['serverUrl','stripTrailingSlash','uri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','contacts','version','charAt','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','outbound','%s/service/v4_1/rest.php','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','users','%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','unmanaged','lastevent','toUpperCase','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','Fields','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','sugarcrm','redis','defaults','localhost','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','description','Descriptions','date_start','toISOString','slice','duration_hours','duration_minutes','parent_id','parent_type','Contacts','parent_name','direction','length','forEach','push','set_entry','JSON','Calls','Basic\x20%s','toString','base64','get_server_info','stringify','get_entry_list','Employees','format','find','entry_list','name_value_list','user_name','value','Agent\x20found!','resolve','user_id','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','then','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','debug','[HTTP]','merge','map','type','string','nameField','toLowerCase','content','idField','customField','variableName','customVariable','Variable','login','username','PLAIN','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri'];(function(_0x48093a,_0x2adbf8){var _0xdb3f0a=function(_0x2d3482){while(--_0x2d3482){_0x48093a['push'](_0x48093a['shift']());}};_0xdb3f0a(++_0x2adbf8);}(_0x0a51,0x11a));var _0x10a5=function(_0x2d5d33,_0x15716a){_0x2d5d33=_0x2d5d33-0x0;var _0x3b9ebe=_0x0a51[_0x2d5d33];return _0x3b9ebe;};'use strict';var _=require(_0x10a5('0x0'));var rp=require(_0x10a5('0x1'));var BPromise=require('bluebird');var md5=require(_0x10a5('0x2'));var util=require(_0x10a5('0x3'));var Redis=require(_0x10a5('0x4'));var intUtil=require(_0x10a5('0x5'));var config=require(_0x10a5('0x6'));var logger=require('../../../../config/logger')(_0x10a5('0x7'));config[_0x10a5('0x8')]=_[_0x10a5('0x9')](config[_0x10a5('0x8')],{'host':_0x10a5('0xa'),'port':0x18eb});var io=require(_0x10a5('0xb'))(new Redis(config[_0x10a5('0x8')]));var def={'method':_0x10a5('0xc'),'json':!![]};function emit(_0x2a3c2d,_0x53a5b0,_0xd6118c){io['to'](_0x2a3c2d)[_0x10a5('0xd')](_0x53a5b0,_0xd6118c);}function getTicket(_0x23ca85,_0x47d523,_0x230e5d,_0x7e74e2,_0x31693c,_0x418176,_0x3bdbb9,_0x47c019){logger[_0x10a5('0xe')](_0x10a5('0xf'));var _0x33c03c=new Date();var _0x41d1fb=[{'name':_0x10a5('0x10'),'value':intUtil[_0x10a5('0x11')](_0x7e74e2[_0x10a5('0x12')],_0x31693c,'\x20')},{'name':_0x10a5('0x13'),'value':_0x47d523['id']},{'name':'created_by','value':_0x47d523['id']},{'name':_0x10a5('0x14'),'value':intUtil[_0x10a5('0x11')](_0x7e74e2[_0x10a5('0x15')],_0x31693c,'\x0a')},{'name':_0x10a5('0x16'),'value':_0x33c03c[_0x10a5('0x17')]()[_0x10a5('0x18')](0x0,0x13)['replace']('T','\x20')},{'name':_0x10a5('0x19'),'value':'0'},{'name':_0x10a5('0x1a'),'value':'15'},{'name':_0x10a5('0x1b'),'value':_0x230e5d['id']},{'name':_0x10a5('0x1c'),'value':_0x10a5('0x1d')},{'name':_0x10a5('0x1e'),'value':_0x230e5d[_0x10a5('0x10')]},{'name':_0x10a5('0x1f'),'value':_0x47c019}];if(_0x418176[_0x10a5('0x20')]){_[_0x10a5('0x21')](_0x418176,function(_0x1274c0){if(_0x31693c[_0x1274c0['variableName']]){_0x41d1fb[_0x10a5('0x22')]({'name':_0x1274c0['idField'],'value':_0x31693c[_0x1274c0['variableName']]});}});}return request({'form':{'method':_0x10a5('0x23'),'input_type':_0x10a5('0x24'),'response_type':_0x10a5('0x24'),'rest_data':JSON['stringify']({'session':_0x3bdbb9['id'],'module_name':_0x10a5('0x25'),'name_value_list':_0x41d1fb})}});}function getAuth(_0xe962fe){return util['format'](_0x10a5('0x26'),new Buffer(_0xe962fe['apiKey']+':X')[_0x10a5('0x27')](_0x10a5('0x28')));}function getServerInfo(_0x3e8e20){return request({'form':{'method':_0x10a5('0x29'),'input_type':_0x10a5('0x24'),'response_type':_0x10a5('0x24'),'rest_data':JSON[_0x10a5('0x2a')]({'session':_0x3e8e20['id']})}});}function getUser(_0x333449,_0x4947d5,_0x33a3fa){if(!_['isNil'](_0x4947d5)){logger['info']('Getting\x20agent\x20with\x20name',_0x4947d5);return request({'form':{'method':_0x10a5('0x2b'),'input_type':'JSON','response_type':_0x10a5('0x24'),'rest_data':JSON[_0x10a5('0x2a')]({'session':_0x33a3fa['id'],'module_name':_0x10a5('0x2c'),'query':util[_0x10a5('0x2d')]('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x4947d5),'order_by':'','offset':'0','select_fields':['id',_0x10a5('0x10'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x37aca8){if(_0x37aca8['entry_list'][_0x10a5('0x20')]){var _0x326e39=_[_0x10a5('0x2e')](_0x37aca8[_0x10a5('0x2f')],function(_0x3f957c){return _0x3f957c[_0x10a5('0x30')][_0x10a5('0x31')][_0x10a5('0x32')]===_0x4947d5;});if(_0x326e39){logger[_0x10a5('0xe')](_0x10a5('0x33'));return BPromise['resolve']({'id':_0x326e39[_0x10a5('0x30')]['id']['value'],'name':_0x326e39[_0x10a5('0x30')][_0x10a5('0x10')]['value']});}}logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x10a5('0x34')]({'id':_0x33a3fa['name_value_list'][_0x10a5('0x35')][_0x10a5('0x32')],'name':_0x33a3fa[_0x10a5('0x30')][_0x10a5('0x31')]['value']});});}else{logger['info']('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise[_0x10a5('0x34')]({'id':_0x33a3fa[_0x10a5('0x30')]['user_id'][_0x10a5('0x32')],'name':_0x33a3fa['name_value_list'][_0x10a5('0x31')][_0x10a5('0x32')]});}}function getEndUser(_0x29505a,_0x2d4431,_0x45275d,_0x1aa78f){logger[_0x10a5('0xe')](_0x10a5('0x36'),_0x45275d);return request({'form':{'method':'get_entry_list','input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x10a5('0x2a')]({'session':_0x1aa78f['id'],'module_name':_0x10a5('0x1d'),'query':util[_0x10a5('0x2d')](_0x10a5('0x37'),_0x45275d),'order_by':'','offset':'0','select_fields':['id','name',_0x10a5('0x38')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x10a5('0x39')](function(_0x45bc59){if(_0x45bc59['entry_list'][_0x10a5('0x20')]){var _0x4d86ce=_[_0x10a5('0x2e')](_0x45bc59['entry_list'],function(_0x40f297){return _0x40f297[_0x10a5('0x30')]['phone_home'][_0x10a5('0x32')]===_0x45275d;});if(_0x4d86ce){logger[_0x10a5('0xe')]('Enduser\x20found!');return BPromise['resolve']({'id':_0x4d86ce[_0x10a5('0x30')]['id'][_0x10a5('0x32')],'name':_0x4d86ce[_0x10a5('0x30')][_0x10a5('0x10')]['value'],'phone':_0x4d86ce['name_value_list']['phone_home'][_0x10a5('0x32')]});}}else{logger[_0x10a5('0xe')](_0x10a5('0x3a'));return request({'form':{'method':_0x10a5('0x23'),'input_type':_0x10a5('0x24'),'response_type':'JSON','rest_data':JSON[_0x10a5('0x2a')]({'session':_0x1aa78f['id'],'module_name':_0x10a5('0x1d'),'name_value_list':[{'name':_0x10a5('0x3b'),'value':_0x2d4431!==_0x10a5('0x3c')?_0x2d4431:util[_0x10a5('0x2d')](_0x10a5('0x3d'),_0x45275d)},{'name':'phone_home','value':_0x45275d}]})}})[_0x10a5('0x39')](function(_0x40d6dd){logger['info']('Enduser\x20created.');return BPromise[_0x10a5('0x34')]({'id':_0x40d6dd['id'],'name':_0x40d6dd['entry_list'][_0x10a5('0x3b')][_0x10a5('0x32')],'phone':_0x40d6dd['entry_list'][_0x10a5('0x38')]['value']});});}});}function request(_0x33d000){logger[_0x10a5('0x3e')](_0x10a5('0x3f'),JSON[_0x10a5('0x2a')](_0x33d000));return rp(_[_0x10a5('0x40')](def,_0x33d000));}function getTags(_0x1fa9d8,_0x542cbf){var _0x89fcf6=[];if(_0x1fa9d8&&_0x1fa9d8[_0x10a5('0x20')]>0x0){_0x89fcf6=_[_0x10a5('0x41')](_0x1fa9d8,_0x542cbf);}return _0x89fcf6;}function getCustomFields(_0x22ca41,_0x1256b1){var _0x5f328e=[];var _0x96d465={'custom_fields':[]};if(_0x22ca41['length']>0x0){_['forEach'](_0x22ca41,function(_0x4fc725){if(_0x4fc725[_0x10a5('0x42')]===_0x10a5('0x43')&&_0x4fc725[_0x10a5('0x44')]&&!_0x4fc725['customField']){_0x96d465[_0x4fc725['nameField'][_0x10a5('0x45')]()]=_0x4fc725[_0x10a5('0x46')][_0x10a5('0x27')]();}else if(_0x4fc725[_0x10a5('0x42')]===_0x10a5('0x43')&&_0x4fc725[_0x10a5('0x47')]&&_0x4fc725[_0x10a5('0x48')]){_0x96d465['custom_fields'][_0x10a5('0x22')]({'id':_0x4fc725[_0x10a5('0x47')],'value':_0x4fc725['content'][_0x10a5('0x27')]()});}else if(_0x4fc725[_0x10a5('0x42')]==='variable'&&_0x4fc725['variableName']&&_0x4fc725[_0x10a5('0x47')]&&_0x4fc725[_0x10a5('0x48')]){_0x1256b1[_0x4fc725[_0x10a5('0x49')]]&&_0x96d465['custom_fields'][_0x10a5('0x22')]({'id':_0x4fc725['idField'],'value':_0x1256b1[_0x4fc725[_0x10a5('0x49')]][_0x10a5('0x27')]()});}else if(_0x4fc725[_0x10a5('0x42')]===_0x10a5('0x4a')&&_0x4fc725[_0x10a5('0x4b')]&&_0x4fc725[_0x10a5('0x4b')][_0x10a5('0x10')]&&_0x4fc725[_0x10a5('0x47')]&&_0x4fc725['customField']){_0x1256b1[_0x4fc725['Variable'][_0x10a5('0x10')]['toLowerCase']()]&&_0x96d465['custom_fields']['push']({'id':_0x4fc725[_0x10a5('0x47')],'value':_0x1256b1[_0x4fc725['Variable']['name']['toLowerCase']()][_0x10a5('0x27')]()});}});}return _0x96d465;}function getConnection(_0x947ca3){return request({'method':'POST','form':{'method':_0x10a5('0x4c'),'input_type':'JSON','response_type':_0x10a5('0x24'),'rest_data':JSON[_0x10a5('0x2a')]({'user_auth':{'user_name':_0x947ca3[_0x10a5('0x4d')],'password':_0x947ca3['password'],'encryption':_0x10a5('0x4e')},'application':'xCALLY\x20Motion\x20integration'})}})[_0x10a5('0x39')](function(_0x53f38a){var _0x36901a=_0x53f38a;if(_0x36901a['id']){def[_0x10a5('0x4f')]=_0x36901a['id'];return BPromise['resolve'](_0x36901a);}else{throw new Error(util[_0x10a5('0x2d')](_0x10a5('0x50'),_0x947ca3['id']));}});}function setRelationship(_0xe6587c,_0x9e1a8b,_0x34cc40,_0x290a67){return request({'form':{'method':_0x10a5('0x51'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x10a5('0x2a')]({'session':_0xe6587c['id'],'module_name':_0x10a5('0x25'),'module_id':_0x34cc40['id'],'link_field_name':_0x290a67,'related_ids':[_0x9e1a8b['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x10a5('0x52')]=function(_0x19c3fe,_0x1be92f,_0x130345,_0x213267,_0x12c990,_0x10007e){var _0x3418eb,_0x43b3aa,_0x2f0f32,_0x292e6f;_0x10007e['remoteUri']=intUtil['stripTrailingSlash'](_0x10007e[_0x10a5('0x53')]);_0x10007e[_0x10a5('0x54')]=intUtil[_0x10a5('0x55')](_0x10007e['serverUrl']);def[_0x10a5('0x56')]=util[_0x10a5('0x2d')]('%s/service/v4_1/rest.php',_0x10007e[_0x10a5('0x53')]);if(_0x12c990&&_0x12c990[_0x10a5('0x57')]){logger[_0x10a5('0xe')](_0x10a5('0x58'),_0x10a5('0x59'));_0x1be92f[_0x10a5('0x5a')]=util[_0x10a5('0x2d')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x10007e[_0x10a5('0x54')],_0x1be92f[_0x10a5('0x5b')],md5(_0x1be92f[_0x10a5('0x5b')]));}else{_0x1be92f[_0x10a5('0x5a')]='';}return getConnection(_0x10007e)[_0x10a5('0x39')](function(_0x49af1e){_0x292e6f=_0x49af1e;return getUser(_0x10007e,_0x213267[_0x10a5('0x10')],_0x292e6f);})['then'](function(_0x101ec6){_0x3418eb=_0x101ec6;logger[_0x10a5('0xe')](_0x10a5('0x5c'),_0x3418eb['id']);return getEndUser(_0x10007e,_0x1be92f[_0x10a5('0x5d')],_0x1be92f[_0x10a5('0x5e')],_0x292e6f);})['then'](function(_0x5eef37){_0x43b3aa=_0x5eef37;logger[_0x10a5('0xe')](_0x10a5('0x5f'),_0x43b3aa['id']);return getTicket(_0x10007e,_0x3418eb,_0x43b3aa,_0x130345,_0x1be92f,_0x130345['Fields'],_0x292e6f,_0x10a5('0x60'));})[_0x10a5('0x39')](function(_0xab40d){_0x2f0f32=_0xab40d;logger[_0x10a5('0xe')](_0x10a5('0x61'));logger['info'](_0x10a5('0x62'),_0x2f0f32['id']);return setRelationship(_0x292e6f,_0x3418eb,_0x2f0f32,'users');})[_0x10a5('0x39')](function(){return setRelationship(_0x292e6f,_0x43b3aa,_0x2f0f32,_0x10a5('0x63'));})[_0x10a5('0x39')](function(){return getServerInfo(_0x292e6f);})['then'](function(_0x5bd4f2){var _0x27f85b=parseInt(_0x5bd4f2[_0x10a5('0x64')][_0x10a5('0x65')](0x0));var _0x17ec9c=util['format']('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x10007e[_0x10a5('0x53')],_0x2f0f32['id']);if(_0x27f85b>0x6){_0x17ec9c=util[_0x10a5('0x2d')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x10007e[_0x10a5('0x53')],_0x2f0f32['id']);}logger[_0x10a5('0xe')]('[QUEUE]',_0x10a5('0x66'));emit(util[_0x10a5('0x2d')](_0x10a5('0x67'),_0x213267[_0x10a5('0x10')]),_0x10a5('0x68'),{'uri':_0x17ec9c});})[_0x10a5('0x69')](function(_0x261c67){logger[_0x10a5('0x6a')](_0x10a5('0x58'),JSON[_0x10a5('0x2a')](_0x261c67));});};exports[_0x10a5('0x6b')]=function(_0x3d03bc,_0x395194,_0x49b8b2,_0x16af44,_0xfa4d09,_0x721020,_0x718ca1){var _0x17adc7,_0x59cbc4,_0x231d00,_0x46443f;_0x721020[_0x10a5('0x53')]=intUtil[_0x10a5('0x55')](_0x721020[_0x10a5('0x53')]);_0x721020[_0x10a5('0x54')]=intUtil['stripTrailingSlash'](_0x721020[_0x10a5('0x54')]);def['uri']=util[_0x10a5('0x2d')](_0x10a5('0x6c'),_0x721020[_0x10a5('0x53')]);if(_0x718ca1&&_0x718ca1[_0x10a5('0x6d')]&&_0x718ca1[_0x10a5('0x6d')]!==_0x10a5('0x6e')){logger[_0x10a5('0xe')](_0x10a5('0x6f'),_0x10a5('0x59'));_0x395194['recordingURL']=util[_0x10a5('0x2d')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x721020['serverUrl'],_0x395194[_0x10a5('0x5b')],md5(_0x395194['uniqueid']));}return getConnection(_0x721020)[_0x10a5('0x39')](function(_0x2cb63f){_0x46443f=_0x2cb63f;return getUser(_0x721020,_0x16af44[_0x10a5('0x10')],_0x46443f);})[_0x10a5('0x39')](function(_0x32ac7c){_0x17adc7=_0x32ac7c;logger[_0x10a5('0xe')](_0x10a5('0x5c'),_0x17adc7['id']);return getEndUser(_0x721020,_0x395194[_0x10a5('0x70')],_0x395194[_0x10a5('0x71')],_0x46443f);})[_0x10a5('0x39')](function(_0x2a98b2){_0x59cbc4=_0x2a98b2;logger[_0x10a5('0xe')](_0x10a5('0x5f'),_0x59cbc4['id']);return getTicket(_0x721020,_0x17adc7,_0x59cbc4,_0x49b8b2,_0x395194,_0x49b8b2['Fields'],_0x46443f,'Outbound');})[_0x10a5('0x39')](function(_0x45a97a){_0x231d00=_0x45a97a;logger[_0x10a5('0xe')](_0x10a5('0x61'));logger[_0x10a5('0xe')](_0x10a5('0x62'),_0x231d00['id']);return setRelationship(_0x46443f,_0x17adc7,_0x231d00,_0x10a5('0x72'));})[_0x10a5('0x39')](function(){return setRelationship(_0x46443f,_0x59cbc4,_0x231d00,'contacts');})[_0x10a5('0x39')](function(){return getServerInfo(_0x46443f);})[_0x10a5('0x39')](function(_0xd7b3b0){var _0x42a9ff=parseInt(_0xd7b3b0[_0x10a5('0x64')][_0x10a5('0x65')](0x0));var _0x287f04=util[_0x10a5('0x2d')](_0x10a5('0x73'),_0x721020[_0x10a5('0x53')],_0x231d00['id']);if(_0x42a9ff>0x6){_0x287f04=util[_0x10a5('0x2d')](_0x10a5('0x74'),_0x721020[_0x10a5('0x53')],_0x231d00['id']);}logger[_0x10a5('0xe')](_0x10a5('0x6f'),_0x10a5('0x66'));emit(util['format'](_0x10a5('0x67'),_0x16af44[_0x10a5('0x10')]),'trigger:browser:url',{'uri':_0x287f04});})[_0x10a5('0x69')](function(_0x2a8279){logger[_0x10a5('0x6a')](_0x10a5('0x6f'),JSON[_0x10a5('0x2a')](_0x2a8279));});};exports[_0x10a5('0x75')]=function(_0x1300ce,_0x425249,_0x4bb7ba,_0x1d7e22,_0x48add4,_0x44d7a0){var _0x99133,_0x4c35ab,_0x2b6068,_0x325c02;_0x44d7a0['remoteUri']=intUtil[_0x10a5('0x55')](_0x44d7a0[_0x10a5('0x53')]);_0x44d7a0['serverUrl']=intUtil['stripTrailingSlash'](_0x44d7a0['serverUrl']);def[_0x10a5('0x56')]=util[_0x10a5('0x2d')](_0x10a5('0x6c'),_0x44d7a0['remoteUri']);if(_0x48add4&&_0x48add4[_0x10a5('0x57')]){logger[_0x10a5('0xe')]('['+_0x425249[_0x10a5('0x76')][_0x10a5('0x77')]()+']',_0x10a5('0x59'));_0x425249[_0x10a5('0x5a')]=util[_0x10a5('0x2d')](_0x10a5('0x78'),_0x44d7a0[_0x10a5('0x54')],_0x425249[_0x10a5('0x5b')],md5(_0x425249[_0x10a5('0x5b')]));}else{_0x425249[_0x10a5('0x5a')]='';}return getConnection(_0x44d7a0)['then'](function(_0x36ac09){_0x325c02=_0x36ac09;if(!_['isNil'](_0x1d7e22)){return getUser(_0x44d7a0,_0x1d7e22[_0x10a5('0x10')],_0x325c02);}else{return getUser(_0x44d7a0,null,_0x325c02);}})[_0x10a5('0x39')](function(_0x2d2674){_0x99133=_0x2d2674;logger[_0x10a5('0xe')]('The\x20User\x20ID\x20is:',_0x99133['id']);return getEndUser(_0x44d7a0,_0x425249[_0x10a5('0x5d')],_0x425249[_0x10a5('0x5e')],_0x325c02);})[_0x10a5('0x39')](function(_0x596fd0){_0x4c35ab=_0x596fd0;logger['info'](_0x10a5('0x5f'),_0x4c35ab['id']);return getTicket(_0x44d7a0,_0x99133,_0x4c35ab,_0x4bb7ba,_0x425249,_0x4bb7ba[_0x10a5('0x79')],_0x325c02,_0x10a5('0x60'));})[_0x10a5('0x39')](function(_0x36fb3d){_0x2b6068=_0x36fb3d;logger[_0x10a5('0xe')](_0x10a5('0x61'));logger[_0x10a5('0xe')](_0x10a5('0x62'),_0x2b6068['id']);return setRelationship(_0x325c02,_0x99133,_0x2b6068,_0x10a5('0x72'));})[_0x10a5('0x39')](function(){return setRelationship(_0x325c02,_0x4c35ab,_0x2b6068,_0x10a5('0x63'));})[_0x10a5('0x39')](function(){return getServerInfo(_0x325c02);})['catch'](function(_0x1eea3e){logger['error']('['+_0x425249[_0x10a5('0x76')][_0x10a5('0x77')]()+']',JSON['stringify'](_0x1eea3e));});}; \ No newline at end of file +var _0x709b=['Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','version','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','catch','error','recordingFormat','[OUTBOUND]','recordingURL','destcalleridname','destcalleridnum','Outbound','contacts','trigger:browser:url','unmanaged','monitor_format','lastevent','isNil','The\x20User\x20ID\x20is:','calleridnum','toUpperCase','lodash','request-promise','md5','util','ioredis','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter','POST','info','Creating\x20new\x20ticket...','getString','created_by','description','date_start','toISOString','replace','duration_hours','duration_minutes','parent_id','parent_type','Contacts','parent_name','name','direction','length','forEach','variableName','push','idField','set_entry','JSON','stringify','Calls','format','apiKey','toString','base64','get_server_info','Getting\x20agent\x20with\x20name','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','find','name_value_list','Agent\x20found!','resolve','value','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','user_id','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','Caller\x20-\x20%s','phone_home','Enduser\x20created.','debug','[HTTP]','merge','map','type','nameField','content','string','customField','custom_fields','variable','customVariable','Variable','toLowerCase','login','username','password','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','The\x20Enduser\x20ID\x20is:','Fields'];(function(_0x24259d,_0x64a194){var _0x5a701=function(_0x204516){while(--_0x204516){_0x24259d['push'](_0x24259d['shift']());}};_0x5a701(++_0x64a194);}(_0x709b,0x113));var _0xb709=function(_0x5ad636,_0x1c6bc2){_0x5ad636=_0x5ad636-0x0;var _0x59cecf=_0x709b[_0x5ad636];return _0x59cecf;};'use strict';var _=require(_0xb709('0x0'));var rp=require(_0xb709('0x1'));var BPromise=require('bluebird');var md5=require(_0xb709('0x2'));var util=require(_0xb709('0x3'));var Redis=require(_0xb709('0x4'));var intUtil=require('./util');var config=require(_0xb709('0x5'));var logger=require(_0xb709('0x6'))(_0xb709('0x7'));config[_0xb709('0x8')]=_[_0xb709('0x9')](config[_0xb709('0x8')],{'host':_0xb709('0xa'),'port':0x18eb});var io=require(_0xb709('0xb'))(new Redis(config[_0xb709('0x8')]));var def={'method':_0xb709('0xc'),'json':!![]};function emit(_0x38c40e,_0x57f342,_0x351ac3){io['to'](_0x38c40e)['emit'](_0x57f342,_0x351ac3);}function getTicket(_0x1c2aad,_0x5476b0,_0x4780e9,_0x3c6d41,_0x471ef2,_0x1c35c9,_0x47e9ce,_0x3c6923){logger[_0xb709('0xd')](_0xb709('0xe'));var _0x52e32d=new Date();var _0x29d34e=[{'name':'name','value':intUtil[_0xb709('0xf')](_0x3c6d41['Subjects'],_0x471ef2,'\x20')},{'name':'assigned_user_id','value':_0x5476b0['id']},{'name':_0xb709('0x10'),'value':_0x5476b0['id']},{'name':_0xb709('0x11'),'value':intUtil['getString'](_0x3c6d41['Descriptions'],_0x471ef2,'\x0a')},{'name':_0xb709('0x12'),'value':_0x52e32d[_0xb709('0x13')]()['slice'](0x0,0x13)[_0xb709('0x14')]('T','\x20')},{'name':_0xb709('0x15'),'value':'0'},{'name':_0xb709('0x16'),'value':'15'},{'name':_0xb709('0x17'),'value':_0x4780e9['id']},{'name':_0xb709('0x18'),'value':_0xb709('0x19')},{'name':_0xb709('0x1a'),'value':_0x4780e9[_0xb709('0x1b')]},{'name':_0xb709('0x1c'),'value':_0x3c6923}];if(_0x1c35c9[_0xb709('0x1d')]){_[_0xb709('0x1e')](_0x1c35c9,function(_0x1886b2){if(_0x471ef2[_0x1886b2[_0xb709('0x1f')]]){_0x29d34e[_0xb709('0x20')]({'name':_0x1886b2[_0xb709('0x21')],'value':_0x471ef2[_0x1886b2[_0xb709('0x1f')]]});}});}return request({'form':{'method':_0xb709('0x22'),'input_type':'JSON','response_type':_0xb709('0x23'),'rest_data':JSON[_0xb709('0x24')]({'session':_0x47e9ce['id'],'module_name':_0xb709('0x25'),'name_value_list':_0x29d34e})}});}function getAuth(_0x30c52a){return util[_0xb709('0x26')]('Basic\x20%s',new Buffer(_0x30c52a[_0xb709('0x27')]+':X')[_0xb709('0x28')](_0xb709('0x29')));}function getServerInfo(_0x3df7b5){return request({'form':{'method':_0xb709('0x2a'),'input_type':_0xb709('0x23'),'response_type':_0xb709('0x23'),'rest_data':JSON[_0xb709('0x24')]({'session':_0x3df7b5['id']})}});}function getUser(_0x5ba12d,_0x92f22,_0x261951){if(!_['isNil'](_0x92f22)){logger[_0xb709('0xd')](_0xb709('0x2b'),_0x92f22);return request({'form':{'method':'get_entry_list','input_type':_0xb709('0x23'),'response_type':_0xb709('0x23'),'rest_data':JSON[_0xb709('0x24')]({'session':_0x261951['id'],'module_name':'Employees','query':util[_0xb709('0x26')](_0xb709('0x2c'),_0x92f22),'order_by':'','offset':'0','select_fields':['id',_0xb709('0x1b'),_0xb709('0x2d')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xb709('0x2e')](function(_0x53a5db){if(_0x53a5db[_0xb709('0x2f')][_0xb709('0x1d')]){var _0x16b5f1=_[_0xb709('0x30')](_0x53a5db[_0xb709('0x2f')],function(_0x1d43f3){return _0x1d43f3[_0xb709('0x31')]['user_name']['value']===_0x92f22;});if(_0x16b5f1){logger['info'](_0xb709('0x32'));return BPromise[_0xb709('0x33')]({'id':_0x16b5f1[_0xb709('0x31')]['id'][_0xb709('0x34')],'name':_0x16b5f1['name_value_list'][_0xb709('0x1b')][_0xb709('0x34')]});}}logger[_0xb709('0xd')](_0xb709('0x35'));return BPromise[_0xb709('0x33')]({'id':_0x261951[_0xb709('0x31')]['user_id'][_0xb709('0x34')],'name':_0x261951[_0xb709('0x31')][_0xb709('0x2d')][_0xb709('0x34')]});});}else{logger[_0xb709('0xd')](_0xb709('0x36'));return BPromise[_0xb709('0x33')]({'id':_0x261951[_0xb709('0x31')][_0xb709('0x37')][_0xb709('0x34')],'name':_0x261951['name_value_list'][_0xb709('0x2d')][_0xb709('0x34')]});}}function getEndUser(_0x565ed9,_0x3a5dce,_0x440410,_0x320149){logger[_0xb709('0xd')](_0xb709('0x38'),_0x440410);return request({'form':{'method':'get_entry_list','input_type':_0xb709('0x23'),'response_type':'JSON','rest_data':JSON[_0xb709('0x24')]({'session':_0x320149['id'],'module_name':_0xb709('0x19'),'query':util[_0xb709('0x26')](_0xb709('0x39'),_0x440410),'order_by':'','offset':'0','select_fields':['id',_0xb709('0x1b'),'phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xb709('0x2e')](function(_0x3975dd){if(_0x3975dd['entry_list'][_0xb709('0x1d')]){var _0x116f3d=_[_0xb709('0x30')](_0x3975dd[_0xb709('0x2f')],function(_0x1aed8d){return _0x1aed8d[_0xb709('0x31')]['phone_home'][_0xb709('0x34')]===_0x440410;});if(_0x116f3d){logger[_0xb709('0xd')](_0xb709('0x3a'));return BPromise[_0xb709('0x33')]({'id':_0x116f3d['name_value_list']['id'][_0xb709('0x34')],'name':_0x116f3d[_0xb709('0x31')][_0xb709('0x1b')][_0xb709('0x34')],'phone':_0x116f3d['name_value_list']['phone_home'][_0xb709('0x34')]});}}else{logger[_0xb709('0xd')](_0xb709('0x3b'));return request({'form':{'method':_0xb709('0x22'),'input_type':_0xb709('0x23'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x320149['id'],'module_name':_0xb709('0x19'),'name_value_list':[{'name':_0xb709('0x3c'),'value':_0x3a5dce!==''?_0x3a5dce:util[_0xb709('0x26')](_0xb709('0x3d'),_0x440410)},{'name':_0xb709('0x3e'),'value':_0x440410}]})}})['then'](function(_0x37df8b){logger['info'](_0xb709('0x3f'));return BPromise[_0xb709('0x33')]({'id':_0x37df8b['id'],'name':_0x37df8b['entry_list'][_0xb709('0x3c')]['value'],'phone':_0x37df8b['entry_list'][_0xb709('0x3e')][_0xb709('0x34')]});});}});}function request(_0xce6437){logger[_0xb709('0x40')](_0xb709('0x41'),JSON['stringify'](_0xce6437));return rp(_[_0xb709('0x42')](def,_0xce6437));}function getTags(_0x282ebe,_0x1198c1){var _0x5c4206=[];if(_0x282ebe&&_0x282ebe['length']>0x0){_0x5c4206=_[_0xb709('0x43')](_0x282ebe,_0x1198c1);}return _0x5c4206;}function getCustomFields(_0x451675,_0x2952cf){var _0x2d7d02=[];var _0x5ce66b={'custom_fields':[]};if(_0x451675[_0xb709('0x1d')]>0x0){_[_0xb709('0x1e')](_0x451675,function(_0x2ff0e5){if(_0x2ff0e5[_0xb709('0x44')]==='string'&&_0x2ff0e5[_0xb709('0x45')]&&!_0x2ff0e5['customField']){_0x5ce66b[_0x2ff0e5[_0xb709('0x45')]['toLowerCase']()]=_0x2ff0e5[_0xb709('0x46')][_0xb709('0x28')]();}else if(_0x2ff0e5[_0xb709('0x44')]===_0xb709('0x47')&&_0x2ff0e5[_0xb709('0x21')]&&_0x2ff0e5[_0xb709('0x48')]){_0x5ce66b[_0xb709('0x49')][_0xb709('0x20')]({'id':_0x2ff0e5[_0xb709('0x21')],'value':_0x2ff0e5[_0xb709('0x46')][_0xb709('0x28')]()});}else if(_0x2ff0e5[_0xb709('0x44')]===_0xb709('0x4a')&&_0x2ff0e5[_0xb709('0x1f')]&&_0x2ff0e5[_0xb709('0x21')]&&_0x2ff0e5[_0xb709('0x48')]){_0x2952cf[_0x2ff0e5[_0xb709('0x1f')]]&&_0x5ce66b[_0xb709('0x49')][_0xb709('0x20')]({'id':_0x2ff0e5['idField'],'value':_0x2952cf[_0x2ff0e5[_0xb709('0x1f')]][_0xb709('0x28')]()});}else if(_0x2ff0e5[_0xb709('0x44')]===_0xb709('0x4b')&&_0x2ff0e5['Variable']&&_0x2ff0e5[_0xb709('0x4c')][_0xb709('0x1b')]&&_0x2ff0e5['idField']&&_0x2ff0e5[_0xb709('0x48')]){_0x2952cf[_0x2ff0e5[_0xb709('0x4c')][_0xb709('0x1b')][_0xb709('0x4d')]()]&&_0x5ce66b[_0xb709('0x49')][_0xb709('0x20')]({'id':_0x2ff0e5[_0xb709('0x21')],'value':_0x2952cf[_0x2ff0e5['Variable']['name'][_0xb709('0x4d')]()]['toString']()});}});}return _0x5ce66b;}function getConnection(_0x25ed92){return request({'method':_0xb709('0xc'),'form':{'method':_0xb709('0x4e'),'input_type':_0xb709('0x23'),'response_type':'JSON','rest_data':JSON[_0xb709('0x24')]({'user_auth':{'user_name':_0x25ed92[_0xb709('0x4f')],'password':_0x25ed92[_0xb709('0x50')],'encryption':'PLAIN'},'application':_0xb709('0x51')})}})[_0xb709('0x2e')](function(_0x58d9e6){var _0x157999=_0x58d9e6;if(_0x157999['id']){def[_0xb709('0x52')]=_0x157999['id'];return BPromise[_0xb709('0x33')](_0x157999);}else{throw new Error(util[_0xb709('0x26')](_0xb709('0x53'),_0x25ed92['id']));}});}function setRelationship(_0x48c533,_0x1c2636,_0x486380,_0xfdd067){return request({'form':{'method':_0xb709('0x54'),'input_type':_0xb709('0x23'),'response_type':_0xb709('0x23'),'rest_data':JSON['stringify']({'session':_0x48c533['id'],'module_name':'Calls','module_id':_0x486380['id'],'link_field_name':_0xfdd067,'related_ids':[_0x1c2636['id']],'name_value_list':[],'delete':0x0})}});}exports[_0xb709('0x55')]=function(_0x32b77d,_0x228792,_0x230a2f,_0x1f7f40,_0x1d867c,_0x3e8340){var _0x36d54c,_0x2682e0,_0xc48894,_0x68a3c9;_0x3e8340[_0xb709('0x56')]=intUtil[_0xb709('0x57')](_0x3e8340[_0xb709('0x56')]);_0x3e8340['serverUrl']=intUtil['stripTrailingSlash'](_0x3e8340[_0xb709('0x58')]);def[_0xb709('0x59')]=util[_0xb709('0x26')](_0xb709('0x5a'),_0x3e8340[_0xb709('0x56')]);if(_0x1d867c&&_0x1d867c['monitor_format']){logger['info']('[QUEUE]',_0xb709('0x5b'));_0x228792['recordingURL']=util[_0xb709('0x26')](_0xb709('0x5c'),_0x3e8340['serverUrl'],_0x228792[_0xb709('0x5d')],md5(_0x228792[_0xb709('0x5d')]));}else{_0x228792['recordingURL']='';}return getConnection(_0x3e8340)[_0xb709('0x2e')](function(_0x17e3cd){_0x68a3c9=_0x17e3cd;return getUser(_0x3e8340,_0x1f7f40[_0xb709('0x1b')],_0x68a3c9);})[_0xb709('0x2e')](function(_0x115efe){_0x36d54c=_0x115efe;logger['info']('The\x20User\x20ID\x20is:',_0x36d54c['id']);return getEndUser(_0x3e8340,_0x228792[_0xb709('0x5e')],_0x228792['calleridnum'],_0x68a3c9);})[_0xb709('0x2e')](function(_0x8b6c08){_0x2682e0=_0x8b6c08;logger[_0xb709('0xd')](_0xb709('0x5f'),_0x2682e0['id']);return getTicket(_0x3e8340,_0x36d54c,_0x2682e0,_0x230a2f,_0x228792,_0x230a2f[_0xb709('0x60')],_0x68a3c9,_0xb709('0x61'));})[_0xb709('0x2e')](function(_0x372eb0){_0xc48894=_0x372eb0;logger[_0xb709('0xd')](_0xb709('0x62'));logger[_0xb709('0xd')](_0xb709('0x63'),_0xc48894['id']);return setRelationship(_0x68a3c9,_0x36d54c,_0xc48894,_0xb709('0x64'));})[_0xb709('0x2e')](function(){return setRelationship(_0x68a3c9,_0x2682e0,_0xc48894,'contacts');})[_0xb709('0x2e')](function(){return getServerInfo(_0x68a3c9);})[_0xb709('0x2e')](function(_0x57885d){var _0x1fafb3=parseInt(_0x57885d[_0xb709('0x65')]['charAt'](0x0));var _0x3c4023=util[_0xb709('0x26')](_0xb709('0x66'),_0x3e8340[_0xb709('0x56')],_0xc48894['id']);if(_0x1fafb3>0x6){_0x3c4023=util[_0xb709('0x26')](_0xb709('0x67'),_0x3e8340['remoteUri'],_0xc48894['id']);}logger[_0xb709('0xd')](_0xb709('0x68'),_0xb709('0x69'));emit(util['format'](_0xb709('0x6a'),_0x1f7f40['name']),'trigger:browser:url',{'uri':_0x3c4023});})[_0xb709('0x6b')](function(_0x2c573e){logger[_0xb709('0x6c')](_0xb709('0x68'),JSON['stringify'](_0x2c573e));});};exports['outbound']=function(_0x203f50,_0x585f62,_0x183398,_0x1d022d,_0x1a1395,_0x4dbef2,_0x5db025){var _0x4e5bcc,_0x1e3b2d,_0x288f3b,_0x572a61;_0x4dbef2[_0xb709('0x56')]=intUtil[_0xb709('0x57')](_0x4dbef2['remoteUri']);_0x4dbef2[_0xb709('0x58')]=intUtil['stripTrailingSlash'](_0x4dbef2['serverUrl']);def[_0xb709('0x59')]=util[_0xb709('0x26')]('%s/service/v4_1/rest.php',_0x4dbef2[_0xb709('0x56')]);if(_0x5db025&&_0x5db025['recordingFormat']&&_0x5db025[_0xb709('0x6d')]!=='none'){logger[_0xb709('0xd')](_0xb709('0x6e'),'Recording\x20is\x20enabled!');_0x585f62[_0xb709('0x6f')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4dbef2[_0xb709('0x58')],_0x585f62[_0xb709('0x5d')],md5(_0x585f62['uniqueid']));}return getConnection(_0x4dbef2)[_0xb709('0x2e')](function(_0x30cdd9){_0x572a61=_0x30cdd9;return getUser(_0x4dbef2,_0x1d022d['name'],_0x572a61);})['then'](function(_0x336077){_0x4e5bcc=_0x336077;logger[_0xb709('0xd')]('The\x20User\x20ID\x20is:',_0x4e5bcc['id']);return getEndUser(_0x4dbef2,_0x585f62[_0xb709('0x70')],_0x585f62[_0xb709('0x71')],_0x572a61);})[_0xb709('0x2e')](function(_0x402f7b){_0x1e3b2d=_0x402f7b;logger[_0xb709('0xd')]('The\x20Enduser\x20ID\x20is:',_0x1e3b2d['id']);return getTicket(_0x4dbef2,_0x4e5bcc,_0x1e3b2d,_0x183398,_0x585f62,_0x183398[_0xb709('0x60')],_0x572a61,_0xb709('0x72'));})['then'](function(_0x5cc6a1){_0x288f3b=_0x5cc6a1;logger[_0xb709('0xd')](_0xb709('0x62'));logger[_0xb709('0xd')](_0xb709('0x63'),_0x288f3b['id']);return setRelationship(_0x572a61,_0x4e5bcc,_0x288f3b,_0xb709('0x64'));})[_0xb709('0x2e')](function(){return setRelationship(_0x572a61,_0x1e3b2d,_0x288f3b,_0xb709('0x73'));})[_0xb709('0x2e')](function(){return getServerInfo(_0x572a61);})['then'](function(_0x15d857){var _0x44bdd0=parseInt(_0x15d857[_0xb709('0x65')]['charAt'](0x0));var _0x1b5665=util[_0xb709('0x26')](_0xb709('0x66'),_0x4dbef2[_0xb709('0x56')],_0x288f3b['id']);if(_0x44bdd0>0x6){_0x1b5665=util[_0xb709('0x26')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x4dbef2[_0xb709('0x56')],_0x288f3b['id']);}logger['info']('[OUTBOUND]',_0xb709('0x69'));emit(util['format']('user:%s',_0x1d022d[_0xb709('0x1b')]),_0xb709('0x74'),{'uri':_0x1b5665});})['catch'](function(_0x3b6650){logger['error'](_0xb709('0x6e'),JSON[_0xb709('0x24')](_0x3b6650));});};exports[_0xb709('0x75')]=function(_0x2056d0,_0x40cb48,_0x48bca7,_0x23064b,_0x3dfd3a,_0x47f7ab){var _0x458a04,_0x51c030,_0x1893a1,_0x5ae183;_0x47f7ab[_0xb709('0x56')]=intUtil[_0xb709('0x57')](_0x47f7ab[_0xb709('0x56')]);_0x47f7ab[_0xb709('0x58')]=intUtil[_0xb709('0x57')](_0x47f7ab['serverUrl']);def[_0xb709('0x59')]=util[_0xb709('0x26')](_0xb709('0x5a'),_0x47f7ab[_0xb709('0x56')]);if(_0x3dfd3a&&_0x3dfd3a[_0xb709('0x76')]){logger[_0xb709('0xd')]('['+_0x40cb48[_0xb709('0x77')]['toUpperCase']()+']',_0xb709('0x5b'));_0x40cb48[_0xb709('0x6f')]=util[_0xb709('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x47f7ab[_0xb709('0x58')],_0x40cb48[_0xb709('0x5d')],md5(_0x40cb48['uniqueid']));}else{_0x40cb48['recordingURL']='';}return getConnection(_0x47f7ab)[_0xb709('0x2e')](function(_0xf3dcd2){_0x5ae183=_0xf3dcd2;if(!_[_0xb709('0x78')](_0x23064b)){return getUser(_0x47f7ab,_0x23064b['name'],_0x5ae183);}else{return getUser(_0x47f7ab,null,_0x5ae183);}})[_0xb709('0x2e')](function(_0x5edea8){_0x458a04=_0x5edea8;logger[_0xb709('0xd')](_0xb709('0x79'),_0x458a04['id']);return getEndUser(_0x47f7ab,_0x40cb48[_0xb709('0x5e')],_0x40cb48[_0xb709('0x7a')],_0x5ae183);})[_0xb709('0x2e')](function(_0xff1c1f){_0x51c030=_0xff1c1f;logger['info'](_0xb709('0x5f'),_0x51c030['id']);return getTicket(_0x47f7ab,_0x458a04,_0x51c030,_0x48bca7,_0x40cb48,_0x48bca7[_0xb709('0x60')],_0x5ae183,'Inbound');})['then'](function(_0x5172e3){_0x1893a1=_0x5172e3;logger[_0xb709('0xd')](_0xb709('0x62'));logger[_0xb709('0xd')](_0xb709('0x63'),_0x1893a1['id']);return setRelationship(_0x5ae183,_0x458a04,_0x1893a1,_0xb709('0x64'));})[_0xb709('0x2e')](function(){return setRelationship(_0x5ae183,_0x51c030,_0x1893a1,_0xb709('0x73'));})[_0xb709('0x2e')](function(){return getServerInfo(_0x5ae183);})['catch'](function(_0x5d6a4e){logger[_0xb709('0x6c')]('['+_0x40cb48[_0xb709('0x77')][_0xb709('0x7b')]()+']',JSON[_0xb709('0x24')](_0x5d6a4e));});}; \ 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 c200156..4ba1be5 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 _0x6a87=['toLowerCase','keyValue','keyType','key','format','%s:\x20%s','keyContent','variable','slice','substring','validateEmail','isNil','test','lodash','util','getString','length','type','string','content','variableName','push','toString','customVariable','Variable','name'];(function(_0x17a32f,_0x5a51a){var _0x15a293=function(_0x55fbd3){while(--_0x55fbd3){_0x17a32f['push'](_0x17a32f['shift']());}};_0x15a293(++_0x5a51a);}(_0x6a87,0x179));var _0x76a8=function(_0x7ed31e,_0x38d916){_0x7ed31e=_0x7ed31e-0x0;var _0x1f7755=_0x6a87[_0x7ed31e];return _0x1f7755;};'use strict';var _=require(_0x76a8('0x0'));var util=require(_0x76a8('0x1'));exports[_0x76a8('0x2')]=function(_0x4d3a51,_0x4958a0,_0x4f4410){var _0x4cfe16=[];if(_0x4d3a51[_0x76a8('0x3')]>0x0){var _0x280b39=_['sortBy'](_0x4d3a51,['id']);for(var _0x48d8cd=0x0;_0x48d8cd<_0x280b39[_0x76a8('0x3')];_0x48d8cd++){var _0x397094=_0x280b39[_0x48d8cd];if(_0x397094[_0x76a8('0x4')]===_0x76a8('0x5')){_0x4cfe16['push'](_0x397094[_0x76a8('0x6')]);}else if(_0x397094[_0x76a8('0x4')]==='variable'&&_0x397094[_0x76a8('0x7')]){_0x4958a0[_0x397094[_0x76a8('0x7')]]&&_0x4cfe16[_0x76a8('0x8')](_0x4958a0[_0x397094[_0x76a8('0x7')]][_0x76a8('0x9')]());}else if(_0x397094[_0x76a8('0x4')]===_0x76a8('0xa')&&_0x397094[_0x76a8('0xb')]&&_0x397094[_0x76a8('0xb')][_0x76a8('0xc')]){_0x4958a0[_0x397094[_0x76a8('0xb')][_0x76a8('0xc')][_0x76a8('0xd')]()]&&_0x4cfe16[_0x76a8('0x8')](_0x4958a0[_0x397094[_0x76a8('0xb')][_0x76a8('0xc')][_0x76a8('0xd')]()][_0x76a8('0x9')]());}else if(_0x397094[_0x76a8('0x4')]===_0x76a8('0xe')){if(_0x397094[_0x76a8('0xf')]===_0x76a8('0x5')&&_0x397094[_0x76a8('0x10')]){_0x4cfe16['push'](util[_0x76a8('0x11')](_0x76a8('0x12'),_0x397094['key'],_0x397094[_0x76a8('0x13')]));}else if(_0x397094[_0x76a8('0xf')]===_0x76a8('0x14')&&_0x397094['variableName']&&_0x397094[_0x76a8('0x10')]){_0x4958a0[_0x397094[_0x76a8('0x7')]]&&_0x4cfe16['push'](util[_0x76a8('0x11')](_0x76a8('0x12'),_0x397094[_0x76a8('0x10')],_0x4958a0[_0x397094[_0x76a8('0x7')]]));}else if(_0x397094['keyType']===_0x76a8('0xa')&&_0x397094[_0x76a8('0xb')]&&_0x397094['Variable'][_0x76a8('0xc')]&&_0x397094[_0x76a8('0x10')]){_0x4958a0[_0x397094[_0x76a8('0xb')][_0x76a8('0xc')][_0x76a8('0xd')]()]&&_0x4cfe16[_0x76a8('0x8')](util['format'](_0x76a8('0x12'),_0x397094[_0x76a8('0x10')],_0x4958a0[_0x397094[_0x76a8('0xb')][_0x76a8('0xc')][_0x76a8('0xd')]()]));}}}}return _0x4cfe16['join'](_0x4f4410);};exports['stripTrailingSlash']=function(_0x51e8de){var _0x5bd8cc=_0x51e8de[_0x76a8('0x15')](-0x1);if(_0x5bd8cc==='/'){_0x51e8de=_0x51e8de[_0x76a8('0x16')](0x0,_0x51e8de['lastIndexOf'](_0x5bd8cc));}return _0x51e8de;};exports[_0x76a8('0x17')]=function(_0x455a84){if(!_[_0x76a8('0x18')](_0x455a84)&&_0x455a84!==''){var _0x5deaaf=/^(([^<>()\[\]\\.,;:\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 _0x5deaaf[_0x76a8('0x19')](String(_0x455a84)[_0x76a8('0xd')]());}else{return![];}}; \ No newline at end of file +var _0x5813=['isNil','test','util','getString','length','sortBy','type','push','content','variable','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType','string','key','format','%s:\x20%s','keyContent','join','stripTrailingSlash','slice','lastIndexOf','validateEmail'];(function(_0x10d670,_0x178996){var _0x20d6f8=function(_0x4a4b87){while(--_0x4a4b87){_0x10d670['push'](_0x10d670['shift']());}};_0x20d6f8(++_0x178996);}(_0x5813,0x136));var _0x3581=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x5813[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require(_0x3581('0x0'));exports[_0x3581('0x1')]=function(_0x58871a,_0x77beb1,_0x238d54){var _0x2c3517=[];if(_0x58871a[_0x3581('0x2')]>0x0){var _0x4d29f5=_[_0x3581('0x3')](_0x58871a,['id']);for(var _0x33ecfc=0x0;_0x33ecfc<_0x4d29f5[_0x3581('0x2')];_0x33ecfc++){var _0x5c9aca=_0x4d29f5[_0x33ecfc];if(_0x5c9aca[_0x3581('0x4')]==='string'){_0x2c3517[_0x3581('0x5')](_0x5c9aca[_0x3581('0x6')]);}else if(_0x5c9aca[_0x3581('0x4')]===_0x3581('0x7')&&_0x5c9aca[_0x3581('0x8')]){_0x77beb1[_0x5c9aca[_0x3581('0x8')]]&&_0x2c3517[_0x3581('0x5')](_0x77beb1[_0x5c9aca[_0x3581('0x8')]][_0x3581('0x9')]());}else if(_0x5c9aca[_0x3581('0x4')]===_0x3581('0xa')&&_0x5c9aca[_0x3581('0xb')]&&_0x5c9aca['Variable'][_0x3581('0xc')]){_0x77beb1[_0x5c9aca[_0x3581('0xb')][_0x3581('0xc')]['toLowerCase']()]&&_0x2c3517[_0x3581('0x5')](_0x77beb1[_0x5c9aca[_0x3581('0xb')][_0x3581('0xc')][_0x3581('0xd')]()]['toString']());}else if(_0x5c9aca[_0x3581('0x4')]===_0x3581('0xe')){if(_0x5c9aca[_0x3581('0xf')]===_0x3581('0x10')&&_0x5c9aca[_0x3581('0x11')]){_0x2c3517['push'](util[_0x3581('0x12')](_0x3581('0x13'),_0x5c9aca['key'],_0x5c9aca[_0x3581('0x14')]));}else if(_0x5c9aca[_0x3581('0xf')]===_0x3581('0x7')&&_0x5c9aca['variableName']&&_0x5c9aca[_0x3581('0x11')]){_0x77beb1[_0x5c9aca[_0x3581('0x8')]]&&_0x2c3517['push'](util[_0x3581('0x12')](_0x3581('0x13'),_0x5c9aca[_0x3581('0x11')],_0x77beb1[_0x5c9aca[_0x3581('0x8')]]));}else if(_0x5c9aca[_0x3581('0xf')]===_0x3581('0xa')&&_0x5c9aca['Variable']&&_0x5c9aca[_0x3581('0xb')]['name']&&_0x5c9aca[_0x3581('0x11')]){_0x77beb1[_0x5c9aca[_0x3581('0xb')][_0x3581('0xc')][_0x3581('0xd')]()]&&_0x2c3517['push'](util[_0x3581('0x12')]('%s:\x20%s',_0x5c9aca[_0x3581('0x11')],_0x77beb1[_0x5c9aca['Variable'][_0x3581('0xc')]['toLowerCase']()]));}}}}return _0x2c3517[_0x3581('0x15')](_0x238d54);};exports[_0x3581('0x16')]=function(_0x52f2c2){var _0x660ba4=_0x52f2c2[_0x3581('0x17')](-0x1);if(_0x660ba4==='/'){_0x52f2c2=_0x52f2c2['substring'](0x0,_0x52f2c2[_0x3581('0x18')](_0x660ba4));}return _0x52f2c2;};exports[_0x3581('0x19')]=function(_0xef5685){if(!_[_0x3581('0x1a')](_0xef5685)&&_0xef5685!==''){var _0x13be7e=/^(([^<>()\[\]\\.,;:\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 _0x13be7e[_0x3581('0x1b')](String(_0xef5685)['toLowerCase']());}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 d1793ae..2875664 100644 --- a/server/services/ami/trigger/integration/vtiger.js +++ b/server/services/ami/trigger/integration/vtiger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['redis','defaults','localhost','emit','length','forEach','includes','string','picklist','type','idField','toString','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','getString','Subjects','POST','format','remoteUri','create','sessionName','HelpDesk','stringify','success','error','catch','statusCode','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','query','username','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','result','Agent\x20found!','resolve','email1','first_name','last_name','userId','[vTiger],\x20%s,\x20%s,\x20%s','getUser','admin','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','phone','getEndUser','accessKey','getchallenge','then','login','token','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','recordingURL','email','The\x20User\x20ID\x20is:','calleridnum','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','outbound','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','uniqueid','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','split','unmanaged','lastevent','toUpperCase','calleridname','lodash','request-promise','bluebird','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger'];(function(_0x135dcb,_0x1434ba){var _0x273915=function(_0x468de8){while(--_0x468de8){_0x135dcb['push'](_0x135dcb['shift']());}};_0x273915(++_0x1434ba);}(_0x34e8,0x12c));var _0x834e=function(_0x4ce599,_0x2bc953){_0x4ce599=_0x4ce599-0x0;var _0x29120b=_0x34e8[_0x4ce599];return _0x29120b;};'use strict';var _=require(_0x834e('0x0'));var rp=require(_0x834e('0x1'));var BPromise=require(_0x834e('0x2'));var md5=require(_0x834e('0x3'));var util=require('util');var Redis=require(_0x834e('0x4'));var intUtil=require(_0x834e('0x5'));var config=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));config[_0x834e('0x9')]=_[_0x834e('0xa')](config['redis'],{'host':_0x834e('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x834e('0x9')]));function emit(_0x3cc2e3,_0x3a3ef6,_0x2e69e2){io['to'](_0x3cc2e3)[_0x834e('0xc')](_0x3a3ef6,_0x2e69e2);}function getCustomFields(_0x23501c,_0x363786){var _0x1af45a={};if(_0x23501c[_0x834e('0xd')]>0x0){_[_0x834e('0xe')](_0x23501c,function(_0x1e41fe){if(_[_0x834e('0xf')]([_0x834e('0x10'),_0x834e('0x11')],_0x1e41fe[_0x834e('0x12')])&&_0x1e41fe[_0x834e('0x13')]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x1e41fe['content'][_0x834e('0x14')]();}else if(_0x1e41fe[_0x834e('0x12')]==='variable'&&_0x1e41fe[_0x834e('0x15')]&&_0x1e41fe[_0x834e('0x13')]&&_0x363786[_0x1e41fe[_0x834e('0x15')]]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x363786[_0x1e41fe['variableName']][_0x834e('0x14')]();}else if(_0x1e41fe[_0x834e('0x12')]==='customVariable'&&_0x1e41fe[_0x834e('0x16')]&&_0x1e41fe['Variable'][_0x834e('0x17')]&&_0x1e41fe[_0x834e('0x13')]&&_0x363786[_0x1e41fe['Variable'][_0x834e('0x17')][_0x834e('0x18')]()]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x363786[_0x1e41fe['Variable'][_0x834e('0x17')][_0x834e('0x18')]()][_0x834e('0x14')]();}});}return _0x1af45a;}function createTicket(_0xb993a1,_0x237947,_0x254677,_0x1dd214,_0x595515,_0x2545b4,_0x1fd2c6){logger[_0x834e('0x19')](_0x834e('0x1a'));var _0x4ab05d=_[_0x834e('0x1b')]({'parent_id':'','assigned_user_id':_0x237947['id'],'ticketpriorities':_0x834e('0x1c'),'ticketstatus':'Open','ticket_title':intUtil[_0x834e('0x1d')](_0x1dd214[_0x834e('0x1e')],_0x595515,'\x20'),'description':intUtil[_0x834e('0x1d')](_0x1dd214['Descriptions'],_0x595515,'\x0a'),'contact_id':_0x254677['id']},getCustomFields(_0x2545b4,_0x595515));var _0x4e3f48={'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')]('%s/webservice.php',_0xb993a1[_0x834e('0x21')]),'form':{'operation':_0x834e('0x22'),'username':_0xb993a1['username'],'sessionName':_0x1fd2c6[_0x834e('0x23')],'elementType':_0x834e('0x24'),'element':JSON[_0x834e('0x25')](_0x4ab05d)},'json':!![]};return request(_0x4e3f48)['then'](function(_0x24fcf7){if(_0x24fcf7[_0x834e('0x26')]){return BPromise['resolve']({'id':_0x24fcf7['result']['id']});}else{throw new Error(util[_0x834e('0x20')]('Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s',JSON[_0x834e('0x25')](_0x24fcf7[_0x834e('0x27')])));}})[_0x834e('0x28')](function(_0x2cc2eb){var _0x3cd928=_0x2cc2eb[_0x834e('0x29')]||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s','createTicket',_0x3cd928,JSON['stringify'](_0x2cc2eb));});}function getUser(_0x2c7a8d,_0x567cea,_0x106d6a){if(intUtil['validateEmail'](_0x567cea)){logger[_0x834e('0x19')](_0x834e('0x2a'),_0x567cea);return request({'method':_0x834e('0x2b'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x2c7a8d[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x2d'),'username':_0x2c7a8d[_0x834e('0x2e')],'sessionName':_0x106d6a[_0x834e('0x23')],'query':util['format'](_0x834e('0x2f'),_0x567cea)},'json':!![]})['then'](function(_0x2c75c2){if(_0x2c75c2[_0x834e('0x26')]&&_0x2c75c2[_0x834e('0x30')][_0x834e('0xd')]){logger[_0x834e('0x19')](_0x834e('0x31'));return BPromise[_0x834e('0x32')]({'id':_0x2c75c2[_0x834e('0x30')][0x0]['id'],'email':_0x2c75c2[_0x834e('0x30')][0x0][_0x834e('0x33')],'name':_0x2c75c2['result'][0x0][_0x834e('0x34')]+'\x20'+_0x2c75c2[_0x834e('0x30')][_0x834e('0x35')]});}else{logger[_0x834e('0x19')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x834e('0x32')]({'id':_0x106d6a[_0x834e('0x36')],'email':_0x2c7a8d['username'],'name':'admin'});}})['catch'](function(_0x3e58fa){var _0x41bf4d=_0x3e58fa[_0x834e('0x29')]||0x1f4;logger[_0x834e('0x27')](_0x834e('0x37'),_0x834e('0x38'),_0x41bf4d,JSON['stringify'](_0x3e58fa));});}else{logger[_0x834e('0x19')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x834e('0x32')]({'id':_0x106d6a[_0x834e('0x36')],'email':_0x2c7a8d['username'],'name':_0x834e('0x39')})[_0x834e('0x28')](function(_0x491c28){var _0x481f70=_0x491c28[_0x834e('0x29')]||0x1f4;logger[_0x834e('0x27')](_0x834e('0x37'),_0x834e('0x38'),_0x481f70,JSON[_0x834e('0x25')](_0x491c28));});}}function getEndUser(_0x4ca43c,_0x1c5ed6,_0x548d1d,_0x50c243){logger[_0x834e('0x19')]('Searching\x20end\x20user\x20with\x20phone',_0x548d1d);return request({'method':_0x834e('0x2b'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x4ca43c[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x2d'),'username':_0x4ca43c['username'],'sessionName':_0x50c243[_0x834e('0x23')],'query':util[_0x834e('0x20')](_0x834e('0x3a'),_0x548d1d,_0x548d1d,_0x548d1d,_0x548d1d,_0x548d1d)},'json':!![]})['then'](function(_0x35380e){if(_0x35380e[_0x834e('0x26')]&&_0x35380e['result'][_0x834e('0xd')]){logger['info'](_0x834e('0x3b'));return BPromise[_0x834e('0x32')]({'id':_0x35380e['result'][0x0]['id'],'name':_0x35380e['result'][0x0][_0x834e('0x3c')]+'\x20'+_0x35380e[_0x834e('0x30')][0x0][_0x834e('0x3d')],'phone':_0x548d1d});}else{logger[_0x834e('0x19')](_0x834e('0x3e'));return request({'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')]('%s/webservice.php',_0x4ca43c[_0x834e('0x21')]),'form':{'operation':'create','sessionName':_0x50c243[_0x834e('0x23')],'elementType':'Contacts','element':JSON[_0x834e('0x25')]({'lastname':_0x1c5ed6,'phone':_0x548d1d,'assigned_user_id':'\x20'})},'json':!![]})['then'](function(_0x361f60){logger[_0x834e('0x19')]('Enduser\x20created.');return BPromise[_0x834e('0x32')]({'id':_0x361f60[_0x834e('0x30')]['id'],'name':_0x361f60[_0x834e('0x30')][_0x834e('0x3d')],'phone':_0x361f60[_0x834e('0x30')][_0x834e('0x3f')]});})[_0x834e('0x28')](function(_0x3ccd8e){var _0x5dc63b=_0x3ccd8e[_0x834e('0x29')]||0x1f4;logger['error'](_0x834e('0x37'),_0x834e('0x40'),_0x5dc63b,JSON['stringify'](_0x3ccd8e));});}});}function getConnection(_0x112306){var _0x42fd90=_0x112306[_0x834e('0x2e')];var _0x2112d5=_0x112306[_0x834e('0x41')];return request({'method':_0x834e('0x2b'),'uri':util['format']('%s/webservice.php',_0x112306[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x42'),'username':_0x42fd90},'json':!![]})[_0x834e('0x43')](function(_0x40ff5a){if(_0x40ff5a[_0x834e('0x26')]){return request({'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x112306[_0x834e('0x21')]),'form':{'operation':_0x834e('0x44'),'username':_0x42fd90,'accessKey':md5(_0x40ff5a[_0x834e('0x30')][_0x834e('0x45')]+_0x2112d5)},'json':!![]});}})[_0x834e('0x43')](function(_0x1a3237){if(_0x1a3237[_0x834e('0x26')]){return BPromise[_0x834e('0x32')](_0x1a3237[_0x834e('0x30')]);}else{throw new Error(util[_0x834e('0x20')](_0x834e('0x46'),_0x112306['id']));}})[_0x834e('0x28')](function(_0x4cfacd){var _0x1cc0b8=_0x4cfacd[_0x834e('0x29')]||0x1f4;logger['error'](_0x834e('0x37'),_0x834e('0x47'),_0x1cc0b8,JSON['stringify'](_0x4cfacd));});}function request(_0x3dcca3){logger[_0x834e('0x19')](_0x834e('0x48'),JSON[_0x834e('0x25')](_0x3dcca3));return rp(_0x3dcca3);}exports[_0x834e('0x49')]=function(_0xb77aab,_0x4549ba,_0x4a8b32,_0x1ad7fe,_0x8bc6c6,_0x3e0550){var _0x363675,_0x86ad2b,_0x396bbe,_0x344b51;_0x3e0550[_0x834e('0x21')]=intUtil['stripTrailingSlash'](_0x3e0550[_0x834e('0x21')]);if(_0x8bc6c6&&_0x8bc6c6['monitor_format']){logger[_0x834e('0x19')]('[QUEUE]',_0x834e('0x4a'));_0x4549ba['recordingURL']=util['format'](_0x834e('0x4b'),_0x3e0550[_0x834e('0x4c')],_0x4549ba['uniqueid'],md5(_0x4549ba['uniqueid']));}else{_0x4549ba[_0x834e('0x4d')]='';}return getConnection(_0x3e0550)[_0x834e('0x43')](function(_0x138ed2){_0x344b51=_0x138ed2;return getUser(_0x3e0550,_0x1ad7fe[_0x834e('0x4e')],_0x344b51);})[_0x834e('0x43')](function(_0x315858){_0x363675=_0x315858;logger[_0x834e('0x19')](_0x834e('0x4f'),_0x363675['id']);return getEndUser(_0x3e0550,_0x4549ba['calleridname'],_0x4549ba[_0x834e('0x50')],_0x344b51);})[_0x834e('0x43')](function(_0x5d5ac2){_0x86ad2b=_0x5d5ac2;logger[_0x834e('0x19')]('The\x20Enduser\x20ID\x20is:',_0x86ad2b['id']);return createTicket(_0x3e0550,_0x363675,_0x86ad2b,_0x4a8b32,_0x4549ba,_0x4a8b32[_0x834e('0x51')],_0x344b51);})[_0x834e('0x43')](function(_0x5160c4){_0x396bbe=_0x5160c4;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')](_0x834e('0x53'),_0x396bbe['id']);var _0x5a2924=util[_0x834e('0x20')](_0x834e('0x54'),_0x3e0550[_0x834e('0x21')],_['split'](_0x396bbe['id'],'x')[0x1]);logger[_0x834e('0x19')](_0x834e('0x55'),_0x834e('0x56'));emit(util[_0x834e('0x20')](_0x834e('0x57'),_0x1ad7fe[_0x834e('0x17')]),_0x834e('0x58'),{'uri':_0x5a2924});})[_0x834e('0x28')](function(_0x208c21){logger[_0x834e('0x27')](_0x834e('0x55'),JSON[_0x834e('0x25')](_0x208c21));});};exports[_0x834e('0x59')]=function(_0x1659c8,_0x460a7a,_0x17b8e3,_0x297cce,_0x14ed83,_0x193a15,_0x3e3467){var _0xed4081,_0x2cb233,_0x5c83eb,_0x2145cf;_0x193a15[_0x834e('0x21')]=intUtil[_0x834e('0x5a')](_0x193a15[_0x834e('0x21')]);_0x193a15['serverUrl']=intUtil[_0x834e('0x5a')](_0x193a15['serverUrl']);if(_0x3e3467&&_0x3e3467['recordingFormat']&&_0x3e3467[_0x834e('0x5b')]!==_0x834e('0x5c')){logger[_0x834e('0x19')](_0x834e('0x5d'),_0x834e('0x4a'));_0x460a7a[_0x834e('0x4d')]=util[_0x834e('0x20')](_0x834e('0x4b'),_0x193a15['serverUrl'],_0x460a7a[_0x834e('0x5e')],md5(_0x460a7a['uniqueid']));}return getConnection(_0x193a15)[_0x834e('0x43')](function(_0xd35dda){_0x2145cf=_0xd35dda;return getUser(_0x193a15,_0x297cce['email'],_0x2145cf);})['then'](function(_0x4a4def){_0xed4081=_0x4a4def;logger[_0x834e('0x19')](_0x834e('0x4f'),_0xed4081['id']);return getEndUser(_0x193a15,_0x460a7a[_0x834e('0x5f')],_0x460a7a[_0x834e('0x60')],_0x2145cf);})['then'](function(_0x2b0d93){_0x2cb233=_0x2b0d93;logger[_0x834e('0x19')](_0x834e('0x61'),_0x2cb233['id']);return createTicket(_0x193a15,_0xed4081,_0x2cb233,_0x17b8e3,_0x460a7a,_0x17b8e3[_0x834e('0x51')],_0x2145cf);})[_0x834e('0x43')](function(_0x28b5c9){_0x5c83eb=_0x28b5c9;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')](_0x834e('0x53'),_0x5c83eb['id']);var _0x5b2bf6=util[_0x834e('0x20')](_0x834e('0x54'),_0x193a15[_0x834e('0x21')],_[_0x834e('0x62')](_0x5c83eb['id'],'x')[0x1]);logger['info'](_0x834e('0x5d'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x297cce[_0x834e('0x17')]),_0x834e('0x58'),{'uri':_0x5b2bf6});})['catch'](function(_0x2645df){logger[_0x834e('0x27')]('[OUTBOUND]',JSON[_0x834e('0x25')](_0x2645df));});};exports[_0x834e('0x63')]=function(_0x4b88e7,_0x5df169,_0x346be5,_0x2a42a3,_0x8bc7d9,_0x44c909){var _0x1d8e7,_0x493239,_0x264a6f,_0x520367;_0x44c909[_0x834e('0x21')]=intUtil[_0x834e('0x5a')](_0x44c909[_0x834e('0x21')]);_0x44c909['serverUrl']=intUtil[_0x834e('0x5a')](_0x44c909[_0x834e('0x4c')]);if(_0x8bc7d9&&_0x8bc7d9['monitor_format']){logger[_0x834e('0x19')]('['+_0x5df169[_0x834e('0x64')][_0x834e('0x65')]()+']','Recording\x20is\x20enabled!');_0x5df169[_0x834e('0x4d')]=util[_0x834e('0x20')](_0x834e('0x4b'),_0x44c909[_0x834e('0x4c')],_0x5df169[_0x834e('0x5e')],md5(_0x5df169[_0x834e('0x5e')]));}else{_0x5df169[_0x834e('0x4d')]='';}return getConnection(_0x44c909)[_0x834e('0x43')](function(_0xd49002){_0x520367=_0xd49002;return getUser(_0x44c909,'',_0x520367);})[_0x834e('0x43')](function(_0x57d898){_0x1d8e7=_0x57d898;logger['info']('The\x20User\x20ID\x20is:',_0x1d8e7['id']);return getEndUser(_0x44c909,_0x5df169[_0x834e('0x66')],_0x5df169[_0x834e('0x50')],_0x520367);})[_0x834e('0x43')](function(_0x37fa2c){_0x493239=_0x37fa2c;logger[_0x834e('0x19')]('The\x20Enduser\x20ID\x20is:',_0x493239['id']);return createTicket(_0x44c909,_0x1d8e7,_0x493239,_0x346be5,_0x5df169,_0x346be5['Fields'],_0x520367);})[_0x834e('0x43')](function(_0x1ad428){_0x264a6f=_0x1ad428;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')]('The\x20Ticket\x20ID\x20is:',_0x264a6f['id']);})[_0x834e('0x28')](function(_0x2b162a){logger[_0x834e('0x27')]('['+_0x5df169['lastevent'][_0x834e('0x65')]()+']',JSON[_0x834e('0x25')](_0x2b162a));});}; \ No newline at end of file +var _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(_0x1ed702,_0x49616f){var _0x353abd=function(_0xd9a652){while(--_0xd9a652){_0x1ed702['push'](_0x1ed702['shift']());}};_0x353abd(++_0x49616f);}(_0x9c44,0x178));var _0x49c4=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x9c44[_0x279d37];return _0x530173;};'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 665db24..db1443d 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 _0x11e3=['destcalleridnum','[OUTBOUND]','newTab','%s/agent/tickets/%s','catch','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','util','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','localhost','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','merge','Tags','Subjects','getString','Descriptions','Fields','validateEmail','Getting\x20agent\x20with\x20email','then','count','Agent\x20found!','find','results','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','user','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','%s/search.json','type:user\x20role:end-user\x20phone:%s','filter','length','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Caller\x20-\x20%s','authType','password','%s:%s','username','token','%s/token:%s','toString','base64','debug','stringify','GET','forEach','includes','string','nameField','toLowerCase','type','idField','customField','push','content','variable','variableName','custom_fields','customVariable','Variable','name','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','recordingURL','Authorization','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','%s/channels/voice/agents/%d/tickets/%d/display.json','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','inspect','outbound','recordingFormat','none','Recording\x20is\x20enabled!','uniqueid','destcalleridname'];(function(_0x2073a8,_0x13456a){var _0x573180=function(_0x4296a8){while(--_0x4296a8){_0x2073a8['push'](_0x2073a8['shift']());}};_0x573180(++_0x13456a);}(_0x11e3,0x77));var _0x311e=function(_0x54f98f,_0x48913d){_0x54f98f=_0x54f98f-0x0;var _0x405c24=_0x11e3[_0x54f98f];return _0x405c24;};'use strict';var _=require(_0x311e('0x0'));var rp=require(_0x311e('0x1'));var md5=require('md5');var util=require(_0x311e('0x2'));var Redis=require('ioredis');var intUtil=require(_0x311e('0x3'));var config=require(_0x311e('0x4'));var logger=require(_0x311e('0x5'))(_0x311e('0x6'));config[_0x311e('0x7')]=_[_0x311e('0x8')](config[_0x311e('0x7')],{'host':_0x311e('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x311e('0x7')]));function emit(_0x4533b9,_0x573c44,_0x2176cb){io['to'](_0x4533b9)[_0x311e('0xa')](_0x573c44,_0x2176cb);}var headers={'Content-Type':_0x311e('0xb'),'Accept':'application/json'};function getTicket(_0x39fb82,_0x12a305,_0x3b417f,_0x3e3fc0,_0x22cca3){logger[_0x311e('0xc')](_0x311e('0xd'));return request({'uri':util[_0x311e('0xe')](_0x311e('0xf'),_0x39fb82[_0x311e('0x10')]),'method':_0x311e('0x11'),'body':{'ticket':_[_0x311e('0x12')]({'requester_id':_0x3b417f['id'],'submitter_id':_0x12a305?_0x12a305['id']:undefined,'assignee_id':_0x12a305?_0x12a305['id']:undefined,'tags':getTags(_0x3e3fc0[_0x311e('0x13')],'name'),'subject':intUtil['getString'](_0x3e3fc0[_0x311e('0x14')],_0x22cca3,'\x20'),'description':intUtil[_0x311e('0x15')](_0x3e3fc0[_0x311e('0x16')],_0x22cca3,'\x0a'),'comment':{'public':![],'body':intUtil[_0x311e('0x15')](_0x3e3fc0[_0x311e('0x16')],_0x22cca3,'\x0a')}},getCustomFields(_0x3e3fc0[_0x311e('0x17')],_0x22cca3))}})['then'](function(_0x320bfb){logger['info']('Ticket\x20created!');return _0x320bfb['ticket'];});}function getUser(_0x4f7687,_0x4e6ffd){if(intUtil[_0x311e('0x18')](_0x4e6ffd)){logger[_0x311e('0xc')](_0x311e('0x19'),_0x4e6ffd);return request({'uri':util['format']('%s/search.json',_0x4f7687['remoteUri']),'qs':{'query':util[_0x311e('0xe')]('type:user\x20role:agent\x20email:%s',_0x4e6ffd)}})[_0x311e('0x1a')](function(_0x5b33c6){if(_0x5b33c6[_0x311e('0x1b')]){logger['info'](_0x311e('0x1c'));return _[_0x311e('0x1d')](_0x5b33c6[_0x311e('0x1e')],{'email':_0x4e6ffd,'role':'agent'});}else{logger[_0x311e('0xc')](_0x311e('0x1f'));return request({'uri':util['format'](_0x311e('0x20'),_0x4f7687['remoteUri'])})['then'](function(_0x445a91){logger[_0x311e('0xc')]('Admin\x20account\x20selected.');return _0x445a91[_0x311e('0x21')];});}});}else{logger[_0x311e('0xc')](_0x311e('0x1f'));return request({'uri':util[_0x311e('0xe')]('%s/users/me.json',_0x4f7687[_0x311e('0x10')])})[_0x311e('0x1a')](function(_0xa70656){logger[_0x311e('0xc')](_0x311e('0x22'));return _0xa70656['user'];});}}function getEndUser(_0x236506,_0x3a3a3c,_0x52fcb4){logger[_0x311e('0xc')](_0x311e('0x23'),_0x52fcb4);return request({'uri':util[_0x311e('0xe')](_0x311e('0x24'),_0x236506[_0x311e('0x10')]),'qs':{'query':util[_0x311e('0xe')](_0x311e('0x25'),_0x52fcb4)}})[_0x311e('0x1a')](function(_0x3206c9){var _0x4f2e9a;if(_0x3206c9['results']['length']){_0x3206c9['results']=_[_0x311e('0x26')](_0x3206c9[_0x311e('0x1e')],{'suspended':![],'role':'end-user'});if(_0x3206c9[_0x311e('0x1e')][_0x311e('0x27')]){_0x4f2e9a=_[_0x311e('0x28')](_0x3206c9[_0x311e('0x1e')]);}}if(_0x4f2e9a){logger['info'](_0x311e('0x29'));return _0x4f2e9a;}else{logger[_0x311e('0xc')](_0x311e('0x2a'));return request({'uri':util[_0x311e('0xe')]('%s/users.json',_0x236506[_0x311e('0x10')]),'method':_0x311e('0x11'),'body':{'user':{'role':'end-user','name':util['format'](_0x311e('0x2b'),_0x3a3a3c||_0x52fcb4),'phone':_0x52fcb4}}})['then'](function(_0x15eaca){logger[_0x311e('0xc')]('Enduser\x20created.');return _0x15eaca[_0x311e('0x21')];});}});}function getAuth(_0x509606){var _0x361d95;if(_0x509606[_0x311e('0x2c')]===_0x311e('0x2d')){_0x361d95=util[_0x311e('0xe')](_0x311e('0x2e'),_0x509606[_0x311e('0x2f')],_0x509606[_0x311e('0x2d')]);}else if(_0x509606[_0x311e('0x2c')]===_0x311e('0x30')){_0x361d95=util[_0x311e('0xe')](_0x311e('0x31'),_0x509606[_0x311e('0x2f')],_0x509606[_0x311e('0x30')]);}return util[_0x311e('0xe')]('Basic\x20%s',new Buffer(_0x361d95)[_0x311e('0x32')](_0x311e('0x33')));}function request(_0x296091){logger[_0x311e('0x34')]('[HTTP]',JSON[_0x311e('0x35')](_0x296091));return rp(_[_0x311e('0x8')](_0x296091,{'method':_0x311e('0x36'),'headers':headers,'json':!![]}));}function getTags(_0x1b0237,_0x1825bb){var _0x159f92=[];if(_0x1b0237&&_0x1b0237[_0x311e('0x27')]>0x0){_0x159f92=_['map'](_0x1b0237,_0x1825bb);}return _0x159f92;}function getCustomFields(_0x5943b3,_0x594d8a){var _0xab8184=[];var _0x4dec4e={'custom_fields':[]};if(_0x5943b3[_0x311e('0x27')]>0x0){_[_0x311e('0x37')](_0x5943b3,function(_0x3a7799){if(_[_0x311e('0x38')]([_0x311e('0x39'),'picklist'],_0x3a7799['type'])&&_0x3a7799[_0x311e('0x3a')]&&!_0x3a7799['customField']){_0x4dec4e[_0x3a7799['nameField'][_0x311e('0x3b')]()]=_0x3a7799['content'][_0x311e('0x32')]();}else if(_[_0x311e('0x38')]([_0x311e('0x39'),'picklist'],_0x3a7799[_0x311e('0x3c')])&&_0x3a7799[_0x311e('0x3d')]&&_0x3a7799[_0x311e('0x3e')]){_0x4dec4e['custom_fields'][_0x311e('0x3f')]({'id':_0x3a7799[_0x311e('0x3d')],'value':_0x3a7799[_0x311e('0x40')][_0x311e('0x32')]()});}else if(_0x3a7799['type']===_0x311e('0x41')&&_0x3a7799['variableName']&&_0x3a7799[_0x311e('0x3d')]&&_0x3a7799['customField']){_0x594d8a[_0x3a7799[_0x311e('0x42')]]&&_0x4dec4e[_0x311e('0x43')]['push']({'id':_0x3a7799[_0x311e('0x3d')],'value':_0x594d8a[_0x3a7799[_0x311e('0x42')]]['toString']()});}else if(_0x3a7799['type']===_0x311e('0x44')&&_0x3a7799['Variable']&&_0x3a7799[_0x311e('0x45')][_0x311e('0x46')]&&_0x3a7799['idField']&&_0x3a7799[_0x311e('0x3e')]){_0x594d8a[_0x3a7799[_0x311e('0x45')]['name'][_0x311e('0x3b')]()]&&_0x4dec4e[_0x311e('0x43')][_0x311e('0x3f')]({'id':_0x3a7799['idField'],'value':_0x594d8a[_0x3a7799[_0x311e('0x45')][_0x311e('0x46')][_0x311e('0x3b')]()]['toString']()});}});}return _0x4dec4e;}exports['queue']=function(_0x589c2c,_0x317665,_0x5da11e,_0x2bd319,_0x47f908,_0x3bb006){var _0x6f8ed5,_0x2d03cf;_0x3bb006[_0x311e('0x10')]=intUtil[_0x311e('0x47')](_0x3bb006[_0x311e('0x10')]);_0x3bb006[_0x311e('0x48')]=intUtil[_0x311e('0x47')](_0x3bb006[_0x311e('0x48')]);if(_0x47f908&&_0x47f908[_0x311e('0x49')]){logger[_0x311e('0xc')](_0x311e('0x4a'),'Recording\x20is\x20enabled!');_0x317665['recordingURL']=util[_0x311e('0xe')](_0x311e('0x4b'),_0x3bb006[_0x311e('0x48')],_0x317665['uniqueid'],md5(_0x317665['uniqueid']));}else{_0x317665[_0x311e('0x4c')]='';}headers[_0x311e('0x4d')]=getAuth(_0x3bb006);return getUser(_0x3bb006,_0x2bd319['email'])['then'](function(_0x1c8097){_0x6f8ed5=_0x1c8097;logger[_0x311e('0xc')](_0x311e('0x4e'),_0x6f8ed5['id']);return getEndUser(_0x3bb006,_0x317665[_0x311e('0x4f')],_0x317665[_0x311e('0x50')]);})[_0x311e('0x1a')](function(_0xb063ce){_0x2d03cf=_0xb063ce;logger[_0x311e('0xc')](_0x311e('0x51'),_0x2d03cf['id']);return getTicket(_0x3bb006,_0x6f8ed5,_0x2d03cf,_0x5da11e,_0x317665);})[_0x311e('0x1a')](function(_0x97141){if(_0x97141){logger[_0x311e('0xc')](_0x311e('0x52'),_0x97141['id']);switch(_0x3bb006[_0x311e('0x3c')]){case _0x311e('0x53'):logger[_0x311e('0xc')](_0x311e('0x4a'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x311e('0xe')](_0x311e('0x54'),_0x3bb006[_0x311e('0x10')],_0x6f8ed5['id'],_0x97141['id']),'method':'POST'});case'newTab':logger[_0x311e('0xc')](_0x311e('0x4a'),_0x311e('0x55'));emit(util[_0x311e('0xe')](_0x311e('0x56'),_0x2bd319['name']),_0x311e('0x57'),{'uri':util[_0x311e('0xe')]('%s/agent/tickets/%s',_0x3bb006['remoteUri'][_0x311e('0x58')](_0x311e('0x59'),''),_0x97141['id'])});break;default:logger[_0x311e('0x5a')](_0x311e('0x4a'),_0x311e('0x5b'));}}})['catch'](function(_0x68f57f){logger[_0x311e('0x5a')]('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util[_0x311e('0x5c')](_0x68f57f,{'showHidden':!![],'depth':null}));});};exports[_0x311e('0x5d')]=function(_0x27f0a4,_0x61075d,_0x398ea3,_0x102753,_0x14385e,_0x155f05,_0x29a86b){var _0xd0afbe,_0x243827;_0x155f05['remoteUri']=intUtil[_0x311e('0x47')](_0x155f05[_0x311e('0x10')]);_0x155f05['serverUrl']=intUtil['stripTrailingSlash'](_0x155f05[_0x311e('0x48')]);if(_0x29a86b&&_0x29a86b[_0x311e('0x5e')]&&_0x29a86b[_0x311e('0x5e')]!==_0x311e('0x5f')){logger[_0x311e('0xc')]('[OUTBOUND]',_0x311e('0x60'));_0x61075d[_0x311e('0x4c')]=util[_0x311e('0xe')](_0x311e('0x4b'),_0x155f05['serverUrl'],_0x61075d[_0x311e('0x61')],md5(_0x61075d[_0x311e('0x61')]));}headers[_0x311e('0x4d')]=getAuth(_0x155f05);return getUser(_0x155f05,_0x102753['email'])[_0x311e('0x1a')](function(_0xf20fcc){_0xd0afbe=_0xf20fcc;logger[_0x311e('0xc')](_0x311e('0x4e'),_0xd0afbe['id']);return getEndUser(_0x155f05,_0x61075d[_0x311e('0x62')],_0x61075d[_0x311e('0x63')]);})[_0x311e('0x1a')](function(_0x191f1f){_0x243827=_0x191f1f;logger[_0x311e('0xc')]('The\x20Enduser\x20ID\x20is:',_0x243827['id']);return getTicket(_0x155f05,_0xd0afbe,_0x243827,_0x398ea3,_0x61075d);})[_0x311e('0x1a')](function(_0x492116){if(_0x492116){logger[_0x311e('0xc')](_0x311e('0x52'),_0x492116['id']);switch(_0x155f05[_0x311e('0x3c')]){case _0x311e('0x53'):logger[_0x311e('0xc')](_0x311e('0x64'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x311e('0xe')](_0x311e('0x54'),_0x155f05['remoteUri'],_0xd0afbe['id'],_0x492116['id']),'method':_0x311e('0x11')});case _0x311e('0x65'):logger['info'](_0x311e('0x64'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x311e('0xe')](_0x311e('0x56'),_0x102753[_0x311e('0x46')]),_0x311e('0x57'),{'uri':util[_0x311e('0xe')](_0x311e('0x66'),_0x155f05['remoteUri'][_0x311e('0x58')]('/api/v2',''),_0x492116['id'])});break;default:logger[_0x311e('0x5a')](_0x311e('0x64'),_0x311e('0x5b'));}}})[_0x311e('0x67')](function(_0x23b0e8){logger[_0x311e('0x5a')](_0x311e('0x68'),util['inspect'](_0x23b0e8,{'showHidden':!![],'depth':null}));});};exports[_0x311e('0x69')]=function(_0x445f61,_0x303bf1,_0x40595e,_0x3b0674,_0x5dd03b,_0x498f7f){var _0x29802a,_0xdc7b02;_0x498f7f[_0x311e('0x10')]=intUtil[_0x311e('0x47')](_0x498f7f['remoteUri']);_0x498f7f[_0x311e('0x48')]=intUtil[_0x311e('0x47')](_0x498f7f['serverUrl']);if(_0x5dd03b&&_0x5dd03b[_0x311e('0x49')]){logger[_0x311e('0xc')]('['+_0x303bf1[_0x311e('0x6a')][_0x311e('0x6b')]()+']',_0x311e('0x60'));_0x303bf1[_0x311e('0x4c')]=util[_0x311e('0xe')](_0x311e('0x4b'),_0x498f7f[_0x311e('0x48')],_0x303bf1['uniqueid'],md5(_0x303bf1[_0x311e('0x61')]));}else{_0x303bf1[_0x311e('0x4c')]='';}headers[_0x311e('0x4d')]=getAuth(_0x498f7f);return getUser(_0x498f7f)['then'](function(_0x300d2a){_0x29802a=_0x300d2a;logger[_0x311e('0xc')](_0x311e('0x4e'),_0x29802a['id']);return getEndUser(_0x498f7f,_0x303bf1[_0x311e('0x4f')],_0x303bf1[_0x311e('0x50')]);})[_0x311e('0x1a')](function(_0x526ca7){_0xdc7b02=_0x526ca7;logger[_0x311e('0xc')](_0x311e('0x51'),_0xdc7b02['id']);return getTicket(_0x498f7f,_0x29802a,_0xdc7b02,_0x40595e,_0x303bf1);})['then'](function(_0x2791f5){if(_0x2791f5){logger[_0x311e('0xc')](_0x311e('0x52'),_0x2791f5['id']);}})['catch'](function(_0x382a79){logger[_0x311e('0x5a')]('['+_0x303bf1[_0x311e('0x6a')][_0x311e('0x6b')]()+']'+_0x311e('0x6c'),util[_0x311e('0x5c')](_0x382a79,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x68ea=['application/json','Creating\x20new\x20ticket...','format','%s/tickets.json','POST','merge','Tags','name','getString','Descriptions','then','info','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','remoteUri','type:user\x20role:agent\x20email:%s','find','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','results','end-user','first','Enduser\x20found!','%s/users.json','Caller\x20-\x20%s','authType','password','%s:%s','username','token','toString','base64','debug','[HTTP]','stringify','GET','length','map','forEach','includes','string','picklist','type','customField','content','idField','custom_fields','push','variable','variableName','customVariable','Variable','toLowerCase','serverUrl','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','calleridname','calleridnum','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20User\x20ID\x20is:','destcalleridnum','%s/channels/voice/agents/%d/tickets/%d/display.json','unmanaged','monitor_format','lastevent','toUpperCase','The\x20Enduser\x20ID\x20is:','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','util','../../../../config/environment','zendesk','redis','defaults','socket.io-emitter'];(function(_0x1e8c08,_0x4cbb99){var _0x1a5abf=function(_0x7549c0){while(--_0x7549c0){_0x1e8c08['push'](_0x1e8c08['shift']());}};_0x1a5abf(++_0x4cbb99);}(_0x68ea,0xca));var _0xa68e=function(_0x15830e,_0x4a3dd1){_0x15830e=_0x15830e-0x0;var _0x257de7=_0x68ea[_0x15830e];return _0x257de7;};'use strict';var _=require(_0xa68e('0x0'));var rp=require(_0xa68e('0x1'));var md5=require('md5');var util=require(_0xa68e('0x2'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0xa68e('0x3'));var logger=require('../../../../config/logger')(_0xa68e('0x4'));config[_0xa68e('0x5')]=_[_0xa68e('0x6')](config[_0xa68e('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xa68e('0x7'))(new Redis(config[_0xa68e('0x5')]));function emit(_0x44c9e4,_0x142bd3,_0x398b45){io['to'](_0x44c9e4)['emit'](_0x142bd3,_0x398b45);}var headers={'Content-Type':_0xa68e('0x8'),'Accept':'application/json'};function getTicket(_0x1442f7,_0xe7c9e,_0x5136f6,_0x4892d0,_0x18a20d){logger['info'](_0xa68e('0x9'));return request({'uri':util[_0xa68e('0xa')](_0xa68e('0xb'),_0x1442f7['remoteUri']),'method':_0xa68e('0xc'),'body':{'ticket':_[_0xa68e('0xd')]({'requester_id':_0x5136f6['id'],'submitter_id':_0xe7c9e?_0xe7c9e['id']:undefined,'assignee_id':_0xe7c9e?_0xe7c9e['id']:undefined,'tags':getTags(_0x4892d0[_0xa68e('0xe')],_0xa68e('0xf')),'subject':intUtil['getString'](_0x4892d0['Subjects'],_0x18a20d,'\x20'),'description':intUtil[_0xa68e('0x10')](_0x4892d0[_0xa68e('0x11')],_0x18a20d,'\x0a'),'comment':{'public':![],'body':intUtil[_0xa68e('0x10')](_0x4892d0[_0xa68e('0x11')],_0x18a20d,'\x0a')}},getCustomFields(_0x4892d0['Fields'],_0x18a20d))}})[_0xa68e('0x12')](function(_0x25b33d){logger[_0xa68e('0x13')](_0xa68e('0x14'));return _0x25b33d[_0xa68e('0x15')];});}function getUser(_0x4a4b88,_0x1da164){if(intUtil[_0xa68e('0x16')](_0x1da164)){logger[_0xa68e('0x13')](_0xa68e('0x17'),_0x1da164);return request({'uri':util[_0xa68e('0xa')](_0xa68e('0x18'),_0x4a4b88[_0xa68e('0x19')]),'qs':{'query':util['format'](_0xa68e('0x1a'),_0x1da164)}})[_0xa68e('0x12')](function(_0xe7a935){if(_0xe7a935['count']){logger['info']('Agent\x20found!');return _[_0xa68e('0x1b')](_0xe7a935['results'],{'email':_0x1da164,'role':_0xa68e('0x1c')});}else{logger[_0xa68e('0x13')](_0xa68e('0x1d'));return request({'uri':util['format'](_0xa68e('0x1e'),_0x4a4b88[_0xa68e('0x19')])})['then'](function(_0x2b061b){logger[_0xa68e('0x13')](_0xa68e('0x1f'));return _0x2b061b[_0xa68e('0x20')];});}});}else{logger[_0xa68e('0x13')](_0xa68e('0x1d'));return request({'uri':util[_0xa68e('0xa')](_0xa68e('0x1e'),_0x4a4b88[_0xa68e('0x19')])})[_0xa68e('0x12')](function(_0x4a600c){logger[_0xa68e('0x13')](_0xa68e('0x1f'));return _0x4a600c['user'];});}}function getEndUser(_0x18bbb2,_0x1b11ee,_0x373699){logger[_0xa68e('0x13')]('Searching\x20enduser\x20with\x20phone',_0x373699);return request({'uri':util['format'](_0xa68e('0x18'),_0x18bbb2[_0xa68e('0x19')]),'qs':{'query':util[_0xa68e('0xa')]('type:user\x20role:end-user\x20phone:%s',_0x373699)}})[_0xa68e('0x12')](function(_0x3256d8){var _0x11d807;if(_0x3256d8[_0xa68e('0x21')]['length']){_0x3256d8[_0xa68e('0x21')]=_['filter'](_0x3256d8[_0xa68e('0x21')],{'suspended':![],'role':_0xa68e('0x22')});if(_0x3256d8[_0xa68e('0x21')]['length']){_0x11d807=_[_0xa68e('0x23')](_0x3256d8[_0xa68e('0x21')]);}}if(_0x11d807){logger[_0xa68e('0x13')](_0xa68e('0x24'));return _0x11d807;}else{logger[_0xa68e('0x13')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0xa68e('0xa')](_0xa68e('0x25'),_0x18bbb2[_0xa68e('0x19')]),'method':_0xa68e('0xc'),'body':{'user':{'role':_0xa68e('0x22'),'name':util['format'](_0xa68e('0x26'),_0x1b11ee||_0x373699),'phone':_0x373699}}})['then'](function(_0x17acca){logger[_0xa68e('0x13')]('Enduser\x20created.');return _0x17acca['user'];});}});}function getAuth(_0x514051){var _0xdae897;if(_0x514051[_0xa68e('0x27')]===_0xa68e('0x28')){_0xdae897=util['format'](_0xa68e('0x29'),_0x514051[_0xa68e('0x2a')],_0x514051[_0xa68e('0x28')]);}else if(_0x514051[_0xa68e('0x27')]===_0xa68e('0x2b')){_0xdae897=util[_0xa68e('0xa')]('%s/token:%s',_0x514051['username'],_0x514051[_0xa68e('0x2b')]);}return util[_0xa68e('0xa')]('Basic\x20%s',new Buffer(_0xdae897)[_0xa68e('0x2c')](_0xa68e('0x2d')));}function request(_0x595670){logger[_0xa68e('0x2e')](_0xa68e('0x2f'),JSON[_0xa68e('0x30')](_0x595670));return rp(_[_0xa68e('0x6')](_0x595670,{'method':_0xa68e('0x31'),'headers':headers,'json':!![]}));}function getTags(_0x3f16d1,_0x35de95){var _0x18fa16=[];if(_0x3f16d1&&_0x3f16d1[_0xa68e('0x32')]>0x0){_0x18fa16=_[_0xa68e('0x33')](_0x3f16d1,_0x35de95);}return _0x18fa16;}function getCustomFields(_0x1d5ce2,_0x2bf5df){var _0x1cf532=[];var _0x546cf9={'custom_fields':[]};if(_0x1d5ce2['length']>0x0){_[_0xa68e('0x34')](_0x1d5ce2,function(_0x3a536a){if(_[_0xa68e('0x35')]([_0xa68e('0x36'),_0xa68e('0x37')],_0x3a536a[_0xa68e('0x38')])&&_0x3a536a['nameField']&&!_0x3a536a[_0xa68e('0x39')]){_0x546cf9[_0x3a536a['nameField']['toLowerCase']()]=_0x3a536a[_0xa68e('0x3a')][_0xa68e('0x2c')]();}else if(_[_0xa68e('0x35')]([_0xa68e('0x36'),_0xa68e('0x37')],_0x3a536a[_0xa68e('0x38')])&&_0x3a536a[_0xa68e('0x3b')]&&_0x3a536a['customField']){_0x546cf9[_0xa68e('0x3c')][_0xa68e('0x3d')]({'id':_0x3a536a[_0xa68e('0x3b')],'value':_0x3a536a[_0xa68e('0x3a')][_0xa68e('0x2c')]()});}else if(_0x3a536a[_0xa68e('0x38')]===_0xa68e('0x3e')&&_0x3a536a[_0xa68e('0x3f')]&&_0x3a536a[_0xa68e('0x3b')]&&_0x3a536a[_0xa68e('0x39')]){_0x2bf5df[_0x3a536a[_0xa68e('0x3f')]]&&_0x546cf9[_0xa68e('0x3c')][_0xa68e('0x3d')]({'id':_0x3a536a[_0xa68e('0x3b')],'value':_0x2bf5df[_0x3a536a['variableName']][_0xa68e('0x2c')]()});}else if(_0x3a536a[_0xa68e('0x38')]===_0xa68e('0x40')&&_0x3a536a[_0xa68e('0x41')]&&_0x3a536a['Variable'][_0xa68e('0xf')]&&_0x3a536a['idField']&&_0x3a536a[_0xa68e('0x39')]){_0x2bf5df[_0x3a536a[_0xa68e('0x41')][_0xa68e('0xf')][_0xa68e('0x42')]()]&&_0x546cf9['custom_fields']['push']({'id':_0x3a536a[_0xa68e('0x3b')],'value':_0x2bf5df[_0x3a536a[_0xa68e('0x41')]['name'][_0xa68e('0x42')]()][_0xa68e('0x2c')]()});}});}return _0x546cf9;}exports['queue']=function(_0x56182a,_0x116994,_0x3ad4f5,_0x262832,_0x2f93c8,_0x1fb936){var _0x316093,_0x464f06;_0x1fb936[_0xa68e('0x19')]=intUtil['stripTrailingSlash'](_0x1fb936[_0xa68e('0x19')]);_0x1fb936[_0xa68e('0x43')]=intUtil[_0xa68e('0x44')](_0x1fb936[_0xa68e('0x43')]);if(_0x2f93c8&&_0x2f93c8['monitor_format']){logger[_0xa68e('0x13')](_0xa68e('0x45'),'Recording\x20is\x20enabled!');_0x116994[_0xa68e('0x46')]=util[_0xa68e('0xa')](_0xa68e('0x47'),_0x1fb936[_0xa68e('0x43')],_0x116994[_0xa68e('0x48')],md5(_0x116994[_0xa68e('0x48')]));}else{_0x116994[_0xa68e('0x46')]='';}headers[_0xa68e('0x49')]=getAuth(_0x1fb936);return getUser(_0x1fb936,_0x262832[_0xa68e('0x4a')])[_0xa68e('0x12')](function(_0x65c523){_0x316093=_0x65c523;logger[_0xa68e('0x13')]('The\x20User\x20ID\x20is:',_0x316093['id']);return getEndUser(_0x1fb936,_0x116994[_0xa68e('0x4b')],_0x116994[_0xa68e('0x4c')]);})['then'](function(_0xb1fe0b){_0x464f06=_0xb1fe0b;logger[_0xa68e('0x13')]('The\x20Enduser\x20ID\x20is:',_0x464f06['id']);return getTicket(_0x1fb936,_0x316093,_0x464f06,_0x3ad4f5,_0x116994);})['then'](function(_0x38196c){if(_0x38196c){logger[_0xa68e('0x13')](_0xa68e('0x4d'),_0x38196c['id']);switch(_0x1fb936[_0xa68e('0x38')]){case _0xa68e('0x4e'):logger['info'](_0xa68e('0x45'),_0xa68e('0x4f'));return request({'uri':util['format']('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x1fb936[_0xa68e('0x19')],_0x316093['id'],_0x38196c['id']),'method':_0xa68e('0xc')});case'newTab':logger['info'](_0xa68e('0x45'),_0xa68e('0x50'));emit(util[_0xa68e('0xa')](_0xa68e('0x51'),_0x262832[_0xa68e('0xf')]),_0xa68e('0x52'),{'uri':util['format'](_0xa68e('0x53'),_0x1fb936[_0xa68e('0x19')][_0xa68e('0x54')](_0xa68e('0x55'),''),_0x38196c['id'])});break;default:logger[_0xa68e('0x56')]('[QUEUE]',_0xa68e('0x57'));}}})[_0xa68e('0x58')](function(_0x1703b5){logger['error'](_0xa68e('0x59'),util[_0xa68e('0x5a')](_0x1703b5,{'showHidden':!![],'depth':null}));});};exports[_0xa68e('0x5b')]=function(_0x481bf0,_0x2a3442,_0x5bde0d,_0x17a67a,_0x3322b3,_0x51cce6,_0x45b57c){var _0x313d44,_0x4a8098;_0x51cce6[_0xa68e('0x19')]=intUtil[_0xa68e('0x44')](_0x51cce6[_0xa68e('0x19')]);_0x51cce6[_0xa68e('0x43')]=intUtil['stripTrailingSlash'](_0x51cce6[_0xa68e('0x43')]);if(_0x45b57c&&_0x45b57c['recordingFormat']&&_0x45b57c[_0xa68e('0x5c')]!==_0xa68e('0x5d')){logger['info'](_0xa68e('0x5e'),_0xa68e('0x5f'));_0x2a3442['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x51cce6['serverUrl'],_0x2a3442['uniqueid'],md5(_0x2a3442[_0xa68e('0x48')]));}headers[_0xa68e('0x49')]=getAuth(_0x51cce6);return getUser(_0x51cce6,_0x17a67a[_0xa68e('0x4a')])['then'](function(_0x170d0f){_0x313d44=_0x170d0f;logger['info'](_0xa68e('0x60'),_0x313d44['id']);return getEndUser(_0x51cce6,_0x2a3442['destcalleridname'],_0x2a3442[_0xa68e('0x61')]);})[_0xa68e('0x12')](function(_0x5865c3){_0x4a8098=_0x5865c3;logger[_0xa68e('0x13')]('The\x20Enduser\x20ID\x20is:',_0x4a8098['id']);return getTicket(_0x51cce6,_0x313d44,_0x4a8098,_0x5bde0d,_0x2a3442);})['then'](function(_0x54082e){if(_0x54082e){logger[_0xa68e('0x13')](_0xa68e('0x4d'),_0x54082e['id']);switch(_0x51cce6[_0xa68e('0x38')]){case _0xa68e('0x4e'):logger[_0xa68e('0x13')](_0xa68e('0x5e'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0xa68e('0xa')](_0xa68e('0x62'),_0x51cce6[_0xa68e('0x19')],_0x313d44['id'],_0x54082e['id']),'method':_0xa68e('0xc')});case'newTab':logger['info'](_0xa68e('0x5e'),_0xa68e('0x50'));emit(util[_0xa68e('0xa')](_0xa68e('0x51'),_0x17a67a[_0xa68e('0xf')]),_0xa68e('0x52'),{'uri':util['format']('%s/agent/tickets/%s',_0x51cce6['remoteUri']['replace'](_0xa68e('0x55'),''),_0x54082e['id'])});break;default:logger[_0xa68e('0x56')](_0xa68e('0x5e'),_0xa68e('0x57'));}}})[_0xa68e('0x58')](function(_0x2d6228){logger[_0xa68e('0x56')]('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util[_0xa68e('0x5a')](_0x2d6228,{'showHidden':!![],'depth':null}));});};exports[_0xa68e('0x63')]=function(_0x41574a,_0x24c95e,_0xe0f8d6,_0x586603,_0x21798b,_0x4a29da){var _0x736979,_0x12a3b9;_0x4a29da[_0xa68e('0x19')]=intUtil['stripTrailingSlash'](_0x4a29da[_0xa68e('0x19')]);_0x4a29da[_0xa68e('0x43')]=intUtil[_0xa68e('0x44')](_0x4a29da[_0xa68e('0x43')]);if(_0x21798b&&_0x21798b[_0xa68e('0x64')]){logger[_0xa68e('0x13')]('['+_0x24c95e[_0xa68e('0x65')][_0xa68e('0x66')]()+']',_0xa68e('0x5f'));_0x24c95e['recordingURL']=util[_0xa68e('0xa')](_0xa68e('0x47'),_0x4a29da[_0xa68e('0x43')],_0x24c95e['uniqueid'],md5(_0x24c95e[_0xa68e('0x48')]));}else{_0x24c95e['recordingURL']='';}headers[_0xa68e('0x49')]=getAuth(_0x4a29da);return getUser(_0x4a29da)[_0xa68e('0x12')](function(_0x496528){_0x736979=_0x496528;logger[_0xa68e('0x13')](_0xa68e('0x60'),_0x736979['id']);return getEndUser(_0x4a29da,_0x24c95e['calleridname'],_0x24c95e['calleridnum']);})[_0xa68e('0x12')](function(_0x33e847){_0x12a3b9=_0x33e847;logger[_0xa68e('0x13')](_0xa68e('0x67'),_0x12a3b9['id']);return getTicket(_0x4a29da,_0x736979,_0x12a3b9,_0xe0f8d6,_0x24c95e);})[_0xa68e('0x12')](function(_0x1b6917){if(_0x1b6917){logger[_0xa68e('0x13')](_0xa68e('0x4d'),_0x1b6917['id']);}})['catch'](function(_0x1490f0){logger[_0xa68e('0x56')]('['+_0x24c95e[_0xa68e('0x65')][_0xa68e('0x66')]()+']'+_0xa68e('0x68'),util[_0xa68e('0x5a')](_0x1490f0,{'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 0d42fb6..2fafe8c 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 _0x00b3=['administrator','Subject','getString','Subjects','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','enduserType','What_Id','$se_module','Call_Duration','utc','mm:ss','answertime','YYYY-MM-DDTHH:mm:ss','starttime','lastevent','called','Call_Result','Called','complete','connect','Answered','rejected','Rejected','abandoned','Abandoned','timeout','Timeout','Call_Start_Time','outbound','agentcalledAt','Call_Type','Inbound','merge','Call\x20created!','err','queue','host','stripTrailingSlash','serverUrl','monitor_format','recordingURL','/api/voice/recordings/','/downloads?type=uniqueid&token=','zoho.eu','com','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','https://crm.','/crm/EntityInfo.do?module=Calls&id=','none','[OUTBOUND]','Recording\x20is\x20enabled!','uniqueid','destcalleridname','Outbound','The\x20Call\x20ID\x20is:','trigger:browser:url','unmanaged','toUpperCase','request-promise','md5','util','./util','ioredis','../../../../config/environment','zoho','redis','defaults','emit','[HTTP]','stringify','length','forEach','string','picklist','type','idField','content','toString','variableName','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','refreshToken','clientId','clientSecret','refresh_token','add','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','Zoho-oauthtoken\x20','isArrayLikeObject','findIndex','info','Agent\x20found!','Using\x20the\x20admin\x20account!','users','user','Administrator','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','The\x20failing\x20result\x20is','then','data','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','code','SUCCESS','details','Error:\x20','log','CREATE\x20ERROR','moduleSearch','uri','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','contact','nothing','lead','Owner','profile'];(function(_0x2ec760,_0x241d60){var _0x3ac489=function(_0x33af38){while(--_0x33af38){_0x2ec760['push'](_0x2ec760['shift']());}};_0x3ac489(++_0x241d60);}(_0x00b3,0x17a));var _0x300b=function(_0x1db58a,_0x28342e){_0x1db58a=_0x1db58a-0x0;var _0x545de6=_0x00b3[_0x1db58a];return _0x545de6;};'use strict';var _=require('lodash');var rp=require(_0x300b('0x0'));var md5=require(_0x300b('0x1'));var util=require(_0x300b('0x2'));var intUtil=require(_0x300b('0x3'));var moment=require('moment');var Redis=require(_0x300b('0x4'));var BPromise=require('bluebird');var config=require(_0x300b('0x5'));var logger=require('../../../../config/logger')(_0x300b('0x6'));config[_0x300b('0x7')]=_[_0x300b('0x8')](config[_0x300b('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x300b('0x7')]));function emit(_0x590c4d,_0x5e283c,_0x162843){io['to'](_0x590c4d)[_0x300b('0x9')](_0x5e283c,_0x162843);}function request(_0x457aa3){logger['debug'](_0x300b('0xa'),JSON[_0x300b('0xb')](_0x457aa3));return rp(_0x457aa3);}function getCustomFields(_0x243abf,_0x212b2b){var _0x566fb9={};if(_0x243abf[_0x300b('0xc')]>0x0){_[_0x300b('0xd')](_0x243abf,function(_0x3e5c83){if(_['includes']([_0x300b('0xe'),_0x300b('0xf')],_0x3e5c83[_0x300b('0x10')])&&_0x3e5c83[_0x300b('0x11')]){_0x566fb9[_0x3e5c83[_0x300b('0x11')]]=_0x3e5c83[_0x300b('0x12')][_0x300b('0x13')]();}else if(_0x3e5c83[_0x300b('0x10')]==='variable'&&_0x3e5c83['variableName']&&_0x3e5c83['idField']&&_0x212b2b[_0x3e5c83['variableName']]){_0x566fb9[_0x3e5c83[_0x300b('0x11')]]=_0x212b2b[_0x3e5c83[_0x300b('0x14')]][_0x300b('0x13')]();}else if(_0x3e5c83[_0x300b('0x10')]==='customVariable'&&_0x3e5c83['Variable']&&_0x3e5c83[_0x300b('0x15')][_0x300b('0x16')]&&_0x3e5c83[_0x300b('0x11')]&&_0x212b2b[_0x3e5c83[_0x300b('0x15')]['name'][_0x300b('0x17')]()]){_0x566fb9[_0x3e5c83[_0x300b('0x11')]]=_0x212b2b[_0x3e5c83[_0x300b('0x15')]['name'][_0x300b('0x17')]()][_0x300b('0x13')]();}});}return _0x566fb9;}function getName(_0x41783b){if(_0x41783b[_0x300b('0x18')]('\x20')>0x0){var _0x56d765=_0x41783b[_0x300b('0x19')](/ (.+)/);if(_0x56d765[0x1]){return _0x56d765;}}return[_0x41783b,_0x41783b];}var accountsTokens={};function getAccessToken(_0x16bfc6){return new Promise(function(_0x971d15,_0x4a5f75){if(!_[_0x300b('0x1a')](accountsTokens[_0x16bfc6['id']])&&!_[_0x300b('0x1a')](accountsTokens[_0x16bfc6['id']][_0x300b('0x1b')])){if(moment()[_0x300b('0x1c')](accountsTokens[_0x16bfc6['id']][_0x300b('0x1d')])){_0x971d15(accountsTokens[_0x16bfc6['id']]['access_token']);}}var _0x4869d9;switch(_0x16bfc6[_0x300b('0x1e')]){case'US':_0x4869d9=_0x300b('0x1f');break;case'AU':_0x4869d9=_0x300b('0x20');break;case'EU':_0x4869d9=_0x300b('0x21');break;case'IN':_0x4869d9=_0x300b('0x22');break;case'CN':_0x4869d9=_0x300b('0x23');break;default:_0x4869d9=_0x300b('0x21');break;}var _0x2fa577={'method':_0x300b('0x24'),'uri':_0x4869d9+'/oauth/v2/token','qs':{'refresh_token':_0x16bfc6[_0x300b('0x25')],'client_id':_0x16bfc6[_0x300b('0x26')],'client_secret':_0x16bfc6[_0x300b('0x27')],'grant_type':_0x300b('0x28')},'json':!![]};return rp(_0x2fa577)['then'](function(_0x4f50b0){accountsTokens[_0x16bfc6['id']]={'access_token':_0x4f50b0['access_token'],'expires_in':moment()[_0x300b('0x29')](_0x4f50b0['expires_in'],_0x300b('0x2a'))};_0x971d15(_0x4f50b0[_0x300b('0x1b')]);})[_0x300b('0x2b')](function(_0x30b260){logger[_0x300b('0x2c')](_0x300b('0x2d'),_0x30b260[_0x300b('0x2e')]);_0x4a5f75(_0x30b260);});});}function getUser(_0x159b63,_0x1cdc8b,_0x3210cd,_0x485952){logger['info'](_0x300b('0x2f'));return request({'method':_0x300b('0x30'),'uri':util[_0x300b('0x31')](_0x300b('0x32'),_0x1cdc8b),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':_0x300b('0x33')+_0x159b63},'json':!![]})['then'](function(_0x4907da){if(_0x4907da['users']){var _0x27d2de=-0x1;if(_[_0x300b('0x34')](_0x4907da['users'])){if(!_[_0x300b('0x1a')](_0x485952)){_0x27d2de=_[_0x300b('0x35')](_0x4907da['users'],function(_0x44be92){return _0x44be92['email']===_0x485952;});}if(_0x27d2de>=0x0){logger[_0x300b('0x36')](_0x300b('0x37'));}else{logger[_0x300b('0x36')](_0x300b('0x38'));_0x27d2de=_[_0x300b('0x35')](_0x4907da[_0x300b('0x39')],function(_0x3fabbf){return _0x3fabbf['profile'][_0x300b('0x16')]==='Administrator';});}return _0x4907da[_0x300b('0x39')][_0x27d2de];}else{if(_0x4907da[_0x300b('0x3a')]['profile'][_0x300b('0x16')]===_0x300b('0x3b')){logger['info'](_0x300b('0x38'));user=_0x4907da[_0x300b('0x3a')];return user;}else{logger[_0x300b('0x2c')]('The\x20failing\x20result\x20is',JSON[_0x300b('0xb')](_0x4907da));throw new Error(_0x300b('0x3c')+JSON[_0x300b('0xb')](_0x4907da));}}}else{logger[_0x300b('0x2c')](_0x300b('0x3d'),JSON[_0x300b('0xb')](_0x4907da));throw new Error(_0x300b('0x3c')+JSON['stringify'](_0x4907da));}})[_0x300b('0x2b')](function(_0x30b72){console['error'](_0x30b72);});}function getZohoUser(_0x3364e5,_0x5dc5e2){return new BPromise(function(_0x5987da,_0x2db646){request(_0x3364e5)[_0x300b('0x3e')](function(_0x295789){var _0x662dad=null;if(_0x295789){_0x662dad=_0x295789[_0x300b('0x3f')][0x0];_0x662dad['enduserType']=_0x5dc5e2;}_0x5987da(_0x662dad);})[_0x300b('0x2b')](function(_0xafc4d4){_0x2db646(_0xafc4d4);});});}function createEndUser(_0x55b4da,_0x43af8f,_0x479561,_0x145f9c,_0x262ddb,_0x45d889){var _0x479561=getName(_0x479561);return request({'method':_0x300b('0x24'),'uri':_0x300b('0x40')+_0x43af8f+_0x300b('0x41')+_[_0x300b('0x42')](_0x45d889[_0x300b('0x43')])+'s','body':{'data':[{'Last_Name':_0x479561[0x1],'First_Name':_0x479561[0x0],'Phone':_0x145f9c,'Owner':{'name':!_[_0x300b('0x1a')](_0x262ddb[_0x300b('0x44')]['name'])?_0x262ddb['role'][_0x300b('0x16')]:!_['isNil'](_0x262ddb['first_name'])?_0x262ddb[_0x300b('0x45')]+'\x20'+_0x262ddb[_0x300b('0x46')]:_0x262ddb[_0x300b('0x46')],'id':_0x262ddb['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x55b4da},'json':!![]})[_0x300b('0x3e')](function(_0x598752){if(_0x598752&&_0x598752['data'][0x0][_0x300b('0x47')]===_0x300b('0x48')){var _0x5f0fd1=_0x598752[_0x300b('0x3f')][0x0][_0x300b('0x49')];_0x5f0fd1['enduserType']=_[_0x300b('0x42')](_0x45d889[_0x300b('0x43')])+'s';return _0x5f0fd1;}logger['error'](_0x300b('0x3d'),JSON[_0x300b('0xb')](data));throw new Error(_0x300b('0x4a')+JSON[_0x300b('0xb')](data));})[_0x300b('0x2b')](function(_0x7f86f){console[_0x300b('0x4b')](_0x300b('0x4c'),_0x7f86f);});}function getEndUser(_0x4ee62f,_0x5a1fdf,_0x1b38ee,_0x58aa0b,_0x554130,_0x3379cb,_0x3028c0){var _0x2ec213={'method':_0x300b('0x30'),'uri':'','headers':{'Authorization':_0x300b('0x33')+_0x4ee62f},'json':!![]};switch(_0x3028c0[_0x300b('0x4d')]){case'contact_lead':_0x2ec213[_0x300b('0x4e')]='https://www.zohoapis.'+_0x5a1fdf+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x554130+'))';return getZohoUser(_0x2ec213,_0x300b('0x4f'))[_0x300b('0x3e')](function(_0x5814dc){if(_0x5814dc)return _0x5814dc;_0x2ec213[_0x300b('0x4e')]=_0x300b('0x40')+_0x5a1fdf+_0x300b('0x50')+_0x554130+'))';return getZohoUser(_0x2ec213,_0x300b('0x51'))['then'](function(_0x389256){if(_0x389256)return _0x389256;if(_0x3028c0[_0x300b('0x43')]!='nothing'){return createEndUser(_0x4ee62f,_0x5a1fdf,_0x58aa0b,_0x554130,_0x3379cb,_0x3028c0);}else{return{};}});});break;case _0x300b('0x52'):_0x2ec213[_0x300b('0x4e')]=_0x300b('0x40')+_0x5a1fdf+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x554130+'))';return getZohoUser(_0x2ec213,_0x300b('0x4f'))[_0x300b('0x3e')](function(_0x22a1a9){if(_0x22a1a9)return _0x22a1a9;if(_0x3028c0[_0x300b('0x43')]!=_0x300b('0x53')){return createEndUser(_0x4ee62f,_0x5a1fdf,_0x58aa0b,_0x554130,_0x3379cb,_0x3028c0);}else{return{};}});break;case _0x300b('0x54'):_0x2ec213[_0x300b('0x4e')]=_0x300b('0x40')+_0x5a1fdf+_0x300b('0x50')+_0x554130+'))';return getZohoUser(_0x2ec213,_0x300b('0x51'))[_0x300b('0x3e')](function(_0x377ca8){if(_0x377ca8)return _0x377ca8;if(_0x3028c0[_0x300b('0x43')]!='nothing'){return createEndUser(_0x4ee62f,_0x5a1fdf,_0x58aa0b,_0x554130,_0x3379cb,_0x3028c0);}else{return{};}});break;}}function getCall(_0x5ae549,_0x20ac11,_0x9320c5,_0x124229,_0x55ca18,_0x151529,_0x543035,_0x27c71b){logger[_0x300b('0x36')]('Creating\x20new\x20call...');var _0x31aba8={};_0x31aba8[_0x300b('0x55')]={'name':!_[_0x300b('0x1a')](_0x124229[_0x300b('0x44')]['name'])&&!_[_0x300b('0x1a')](_0x124229['profile'][_0x300b('0x16')])&&_0x124229[_0x300b('0x56')][_0x300b('0x16')]===_0x300b('0x57')?_0x124229[_0x300b('0x44')][_0x300b('0x16')]:!_[_0x300b('0x1a')](_0x124229[_0x300b('0x45')])?_0x124229[_0x300b('0x45')]+'\x20'+_0x124229[_0x300b('0x46')]:_0x124229[_0x300b('0x46')],'id':_0x124229['id']};_0x31aba8[_0x300b('0x58')]=intUtil[_0x300b('0x59')](_0x151529[_0x300b('0x5a')],_0x543035,'\x20');_0x31aba8['Description']=intUtil[_0x300b('0x59')](_0x151529[_0x300b('0x5b')],_0x543035,'\x0a');if(_0x55ca18['enduserType']==='Contacts'){_0x31aba8[_0x300b('0x5c')]={'name':!_[_0x300b('0x1a')](_0x55ca18[_0x300b('0x5d')])?_0x55ca18[_0x300b('0x5d')]:!_[_0x300b('0x1a')](_0x55ca18[_0x300b('0x5e')])?_0x55ca18[_0x300b('0x5e')]+'\x20'+_0x55ca18['Last_Name']:_0x55ca18[_0x300b('0x5f')],'id':_0x55ca18['id']};}if(_0x55ca18[_0x300b('0x60')]==='Leads'){_0x31aba8[_0x300b('0x61')]={'name':!_['isNil'](_0x55ca18[_0x300b('0x5d')])?_0x55ca18[_0x300b('0x5d')]:!_[_0x300b('0x1a')](_0x55ca18['First_Name'])?_0x55ca18[_0x300b('0x5e')]+'\x20'+_0x55ca18[_0x300b('0x5f')]:_0x55ca18[_0x300b('0x5f')],'id':_0x55ca18['id']};_0x31aba8[_0x300b('0x62')]=_['startCase'](_0x55ca18[_0x300b('0x60')]);}if(_0x543035['talktime']){_0x31aba8[_0x300b('0x63')]=moment[_0x300b('0x64')](parseInt(_0x543035['talktime'])*0x3e8)[_0x300b('0x31')](_0x300b('0x65'));}else if(_0x543035[_0x300b('0x66')]&&_0x543035['endtime']){_0x31aba8[_0x300b('0x63')]=moment[_0x300b('0x64')](moment(_0x543035['endtime'],_0x300b('0x67'))['diff'](moment(_0x543035[_0x300b('0x68')],_0x300b('0x67'))))[_0x300b('0x31')](_0x300b('0x65'));}switch(_0x543035[_0x300b('0x69')]){case _0x300b('0x6a'):_0x31aba8[_0x300b('0x6b')]=_0x300b('0x6c');break;case _0x300b('0x6d'):case _0x300b('0x6e'):_0x31aba8[_0x300b('0x6b')]=_0x300b('0x6f');break;case _0x300b('0x70'):_0x31aba8[_0x300b('0x6b')]=_0x300b('0x71');break;case _0x300b('0x72'):_0x31aba8[_0x300b('0x6b')]=_0x300b('0x73');break;case _0x300b('0x74'):_0x31aba8[_0x300b('0x6b')]=_0x300b('0x75');default:}_0x31aba8[_0x300b('0x76')]=(_0x27c71b===_0x300b('0x77')?moment(_0x543035['starttime'])[_0x300b('0x31')]('YYYY-MM-DDTHH:mm:ss'):moment(_0x543035[_0x300b('0x78')])[_0x300b('0x31')](_0x300b('0x67')))||moment()[_0x300b('0x31')](_0x300b('0x67'));_0x31aba8[_0x300b('0x79')]=_0x27c71b||_0x300b('0x7a');_0x31aba8=_[_0x300b('0x7b')](_0x31aba8,getCustomFields(_0x151529['Fields'],_0x543035));return request({'method':_0x300b('0x24'),'uri':'https://www.zohoapis.'+_0x20ac11+'/crm/v2/Calls','headers':{'Authorization':_0x300b('0x33')+_0x5ae549},'body':{'data':[_0x31aba8]},'json':!![]})[_0x300b('0x3e')](function(_0x46600a){if(_0x46600a&&_0x46600a[_0x300b('0x3f')][0x0][_0x300b('0x47')]==='SUCCESS'){logger[_0x300b('0x36')](_0x300b('0x7c'));return{'id':_0x46600a[_0x300b('0x3f')][0x0][_0x300b('0x49')]['id']};}})[_0x300b('0x2b')](function(_0x2760a5){logger[_0x300b('0x36')]('err',_0x2760a5[_0x300b('0x2e')]);console[_0x300b('0x4b')](_0x300b('0x7d'),_0x2760a5);});}exports[_0x300b('0x7e')]=function(_0x37935f,_0x2bc3a6,_0x1be4e1,_0x177a99,_0x52e1f0,_0x484c3d){var _0xd9b444,_0x43392f,_0x42434a;_0x484c3d[_0x300b('0x7f')]=intUtil[_0x300b('0x80')](_0x484c3d[_0x300b('0x7f')]);_0x484c3d[_0x300b('0x81')]=intUtil[_0x300b('0x80')](_0x484c3d[_0x300b('0x81')]);if(_0x52e1f0&&_0x52e1f0[_0x300b('0x82')]){logger[_0x300b('0x36')]('[QUEUE]','Recording\x20is\x20enabled!');_0x2bc3a6[_0x300b('0x83')]=_0x484c3d[_0x300b('0x81')]+_0x300b('0x84')+_0x2bc3a6['uniqueid']+_0x300b('0x85')+md5(_0x2bc3a6['uniqueid']);}else{_0x2bc3a6['recordingURL']='';}var _0xc845ea=_0x484c3d[_0x300b('0x7f')]===_0x300b('0x86')?'eu':_0x300b('0x87');return getAccessToken(_0x484c3d)['then'](function(_0x489bff){_0x42434a=_0x489bff;return getUser(_0x42434a,_0xc845ea,_0x484c3d,_0x177a99[_0x300b('0x88')]);})[_0x300b('0x3e')](function(_0x1b8f47){_0xd9b444=_0x1b8f47;logger[_0x300b('0x36')](_0x300b('0x89'),_0xd9b444['id']);return getEndUser(_0x42434a,_0xc845ea,_0x484c3d,_0x2bc3a6[_0x300b('0x8a')],_0x2bc3a6[_0x300b('0x8b')],_0xd9b444,_0x1be4e1);})[_0x300b('0x3e')](function(_0x2e0042){_0x43392f=_0x2e0042;return getCall(_0x42434a,_0xc845ea,_0x484c3d,_0xd9b444,_0x43392f,_0x1be4e1,_0x2bc3a6,'Inbound');})['then'](function(_0x27c82b){if(_0x27c82b){logger['info']('The\x20Call\x20ID\x20is:',_0x27c82b['id']);logger[_0x300b('0x36')](_0x300b('0x8c'),_0x300b('0x8d'));emit(util['format'](_0x300b('0x8e'),_0x177a99[_0x300b('0x16')]),'trigger:browser:url',{'uri':_0x300b('0x8f')+_0x484c3d[_0x300b('0x7f')]+_0x300b('0x90')+_0x27c82b['id']});}})[_0x300b('0x2b')](function(_0x3e20f1){logger[_0x300b('0x2c')]('[QUEUE]',JSON['stringify'](_0x3e20f1));});};exports['outbound']=function(_0x62de24,_0x1ab4cf,_0xe0842b,_0x113bbf,_0x44d7c8,_0x57a334,_0x2c69b5){var _0x4668e3,_0x5c12b2,_0x246ad8;_0x57a334[_0x300b('0x7f')]=intUtil[_0x300b('0x80')](_0x57a334[_0x300b('0x7f')]);_0x57a334[_0x300b('0x81')]=intUtil[_0x300b('0x80')](_0x57a334[_0x300b('0x81')]);if(_0x2c69b5&&_0x2c69b5['recordingFormat']&&_0x2c69b5['recordingFormat']!==_0x300b('0x91')){logger[_0x300b('0x36')](_0x300b('0x92'),_0x300b('0x93'));_0x1ab4cf['recordingURL']=_0x57a334[_0x300b('0x81')]+'/api/voice/recordings/'+_0x1ab4cf[_0x300b('0x94')]+'/downloads?type=uniqueid&token='+md5(_0x1ab4cf['uniqueid']);}var _0x390850=_0x57a334['host']==='zoho.eu'?'eu':_0x300b('0x87');return getAccessToken(_0x57a334)[_0x300b('0x3e')](function(_0x379f97){_0x246ad8=_0x379f97;return getUser(_0x246ad8,_0x390850,_0x57a334,_0x113bbf[_0x300b('0x88')]);})[_0x300b('0x3e')](function(_0x2caa05){_0x4668e3=_0x2caa05;logger[_0x300b('0x36')](_0x300b('0x89'),_0x4668e3['id']);return getEndUser(_0x246ad8,_0x390850,_0x57a334,_0x1ab4cf[_0x300b('0x95')],_0x1ab4cf['destcalleridnum'],_0x4668e3,_0xe0842b);})[_0x300b('0x3e')](function(_0x40970a){_0x5c12b2=_0x40970a;return getCall(_0x246ad8,_0x390850,_0x57a334,_0x4668e3,_0x5c12b2,_0xe0842b,_0x1ab4cf,_0x300b('0x96'));})[_0x300b('0x3e')](function(_0x11e53d){if(_0x11e53d){logger['info'](_0x300b('0x97'),_0x11e53d['id']);logger[_0x300b('0x36')](_0x300b('0x92'),_0x300b('0x8d'));emit(util[_0x300b('0x31')](_0x300b('0x8e'),_0x113bbf[_0x300b('0x16')]),_0x300b('0x98'),{'uri':_0x300b('0x8f')+_0x57a334[_0x300b('0x7f')]+_0x300b('0x90')+_0x11e53d['id']});}})[_0x300b('0x2b')](function(_0x73fec6){logger[_0x300b('0x2c')]('[OUTBOUND]',JSON[_0x300b('0xb')](_0x73fec6));});};exports[_0x300b('0x99')]=function(_0x2c0591,_0x313f35,_0x5d706c,_0x176452,_0x1c8b40,_0x281afa){var _0x3f3c6b,_0x59b376,_0x46dab5;_0x281afa[_0x300b('0x7f')]=intUtil[_0x300b('0x80')](_0x281afa['host']);_0x281afa['serverUrl']=intUtil[_0x300b('0x80')](_0x281afa[_0x300b('0x81')]);if(_0x1c8b40&&_0x1c8b40[_0x300b('0x82')]){logger[_0x300b('0x36')]('['+_0x313f35['lastevent']['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x313f35[_0x300b('0x83')]=_0x281afa['serverUrl']+_0x300b('0x84')+_0x313f35[_0x300b('0x94')]+'/downloads?type=uniqueid&token='+md5(_0x313f35[_0x300b('0x94')]);}else{_0x313f35['recordingURL']='';}var _0x44886a=_0x281afa[_0x300b('0x7f')]==='zoho.eu'?'eu':_0x300b('0x87');return getAccessToken(_0x281afa)[_0x300b('0x3e')](function(_0x3e2b8f){_0x46dab5=_0x3e2b8f;return getUser(_0x46dab5,_0x44886a,_0x281afa);})[_0x300b('0x3e')](function(_0x3405fb){_0x3f3c6b=_0x3405fb;logger['info']('The\x20User\x20ID\x20is:',_0x3f3c6b['id']);return getEndUser(_0x46dab5,_0x44886a,_0x281afa,_0x313f35['calleridname'],_0x313f35['calleridnum'],_0x3f3c6b,_0x5d706c);})['then'](function(_0x18b577){_0x59b376=_0x18b577;return getCall(_0x46dab5,_0x44886a,_0x281afa,_0x3f3c6b,_0x59b376,_0x5d706c,_0x313f35,_0x300b('0x7a'));})['then'](function(_0x5396b1){if(_0x5396b1){logger[_0x300b('0x36')](_0x300b('0x97'),_0x5396b1['id']);}})[_0x300b('0x2b')](function(_0x7d8dd2){logger[_0x300b('0x2c')]('['+_0x313f35[_0x300b('0x69')][_0x300b('0x9a')]()+']',JSON['stringify'](_0x7d8dd2));});}; \ No newline at end of file +var _0x0c24=['destcalleridname','destcalleridnum','Outbound','https://crm.','unmanaged','monitor_format','toUpperCase','md5','util','moment','../../../../config/environment','../../../../config/logger','zoho','defaults','redis','localhost','socket.io-emitter','emit','debug','[HTTP]','stringify','length','includes','string','picklist','type','toString','variableName','customVariable','name','Variable','toLowerCase','split','access_token','isBefore','expires_in','zone','https://accounts.zoho.com.au','https://accounts.zoho.in','POST','/oauth/v2/token','clientId','clientSecret','refresh_token','then','add','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','Zoho-oauthtoken\x20','isArrayLikeObject','users','isNil','findIndex','Using\x20the\x20admin\x20account!','Administrator','user','profile','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','/crm/v2/','startCase','moduleCreate','first_name','last_name','SUCCESS','details','Error:\x20','log','moduleSearch','contact_lead','uri','https://www.zohoapis.','Contacts','Leads','nothing','contact','/crm/v2/Contacts/search?criteria=((Phone:equals:','lead','/crm/v2/Leads/search?criteria=((Phone:equals:','Creating\x20new\x20call...','Owner','role','Subject','getString','Subjects','Description','Who_Id','Full_Name','First_Name','Last_Name','$se_module','talktime','Call_Duration','utc','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','lastevent','called','Call_Result','Called','complete','connect','Answered','rejected','Rejected','abandoned','Abandoned','timeout','Timeout','Call_Start_Time','outbound','starttime','agentcalledAt','Call_Type','Inbound','/crm/v2/Calls','code','Call\x20created!','err','stripTrailingSlash','host','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','/api/voice/recordings/','/downloads?type=uniqueid&token=','uniqueid','recordingURL','zoho.eu','com','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]'];(function(_0x3fd58e,_0x22eb35){var _0x391aaf=function(_0x5d6197){while(--_0x5d6197){_0x3fd58e['push'](_0x3fd58e['shift']());}};_0x391aaf(++_0x22eb35);}(_0x0c24,0x13b));var _0x40c2=function(_0x504df1,_0x289598){_0x504df1=_0x504df1-0x0;var _0x1063b5=_0x0c24[_0x504df1];return _0x1063b5;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0x40c2('0x0'));var util=require(_0x40c2('0x1'));var intUtil=require('./util');var moment=require(_0x40c2('0x2'));var Redis=require('ioredis');var BPromise=require('bluebird');var config=require(_0x40c2('0x3'));var logger=require(_0x40c2('0x4'))(_0x40c2('0x5'));config['redis']=_[_0x40c2('0x6')](config[_0x40c2('0x7')],{'host':_0x40c2('0x8'),'port':0x18eb});var io=require(_0x40c2('0x9'))(new Redis(config[_0x40c2('0x7')]));function emit(_0x38cc37,_0x5dfb8c,_0x34e7b4){io['to'](_0x38cc37)[_0x40c2('0xa')](_0x5dfb8c,_0x34e7b4);}function request(_0x34bc74){logger[_0x40c2('0xb')](_0x40c2('0xc'),JSON[_0x40c2('0xd')](_0x34bc74));return rp(_0x34bc74);}function getCustomFields(_0x2f8d0d,_0x3f7ff3){var _0x1bc2b6={};if(_0x2f8d0d[_0x40c2('0xe')]>0x0){_['forEach'](_0x2f8d0d,function(_0x784016){if(_[_0x40c2('0xf')]([_0x40c2('0x10'),_0x40c2('0x11')],_0x784016[_0x40c2('0x12')])&&_0x784016['idField']){_0x1bc2b6[_0x784016['idField']]=_0x784016['content'][_0x40c2('0x13')]();}else if(_0x784016[_0x40c2('0x12')]==='variable'&&_0x784016['variableName']&&_0x784016['idField']&&_0x3f7ff3[_0x784016[_0x40c2('0x14')]]){_0x1bc2b6[_0x784016['idField']]=_0x3f7ff3[_0x784016[_0x40c2('0x14')]][_0x40c2('0x13')]();}else if(_0x784016[_0x40c2('0x12')]===_0x40c2('0x15')&&_0x784016['Variable']&&_0x784016['Variable'][_0x40c2('0x16')]&&_0x784016['idField']&&_0x3f7ff3[_0x784016[_0x40c2('0x17')]['name'][_0x40c2('0x18')]()]){_0x1bc2b6[_0x784016['idField']]=_0x3f7ff3[_0x784016[_0x40c2('0x17')]['name']['toLowerCase']()][_0x40c2('0x13')]();}});}return _0x1bc2b6;}function getName(_0x3eaab5){if(_0x3eaab5['indexOf']('\x20')>0x0){var _0x1ccb18=_0x3eaab5[_0x40c2('0x19')](/ (.+)/);if(_0x1ccb18[0x1]){return _0x1ccb18;}}return[_0x3eaab5,_0x3eaab5];}var accountsTokens={};function getAccessToken(_0x1a6a4b){return new Promise(function(_0x131093,_0x216412){if(!_['isNil'](accountsTokens[_0x1a6a4b['id']])&&!_['isNil'](accountsTokens[_0x1a6a4b['id']][_0x40c2('0x1a')])){if(moment()[_0x40c2('0x1b')](accountsTokens[_0x1a6a4b['id']][_0x40c2('0x1c')])){_0x131093(accountsTokens[_0x1a6a4b['id']][_0x40c2('0x1a')]);}}var _0x4354d7;switch(_0x1a6a4b[_0x40c2('0x1d')]){case'US':_0x4354d7='https://accounts.zoho.com';break;case'AU':_0x4354d7=_0x40c2('0x1e');break;case'EU':_0x4354d7='https://accounts.zoho.eu';break;case'IN':_0x4354d7=_0x40c2('0x1f');break;case'CN':_0x4354d7='https://accounts.zoho.com.cn';break;default:_0x4354d7='https://accounts.zoho.eu';break;}var _0x300bba={'method':_0x40c2('0x20'),'uri':_0x4354d7+_0x40c2('0x21'),'qs':{'refresh_token':_0x1a6a4b['refreshToken'],'client_id':_0x1a6a4b[_0x40c2('0x22')],'client_secret':_0x1a6a4b[_0x40c2('0x23')],'grant_type':_0x40c2('0x24')},'json':!![]};return rp(_0x300bba)[_0x40c2('0x25')](function(_0x2e4e66){accountsTokens[_0x1a6a4b['id']]={'access_token':_0x2e4e66['access_token'],'expires_in':moment()[_0x40c2('0x26')](_0x2e4e66['expires_in'],_0x40c2('0x27'))};_0x131093(_0x2e4e66[_0x40c2('0x1a')]);})[_0x40c2('0x28')](function(_0x247f6c){logger[_0x40c2('0x29')](_0x40c2('0x2a'),_0x247f6c[_0x40c2('0x2b')]);_0x216412(_0x247f6c);});});}function getUser(_0x371b62,_0x38f2b5,_0x3bd29f,_0x422a6a){logger[_0x40c2('0x2c')](_0x40c2('0x2d'));return request({'method':_0x40c2('0x2e'),'uri':util[_0x40c2('0x2f')](_0x40c2('0x30'),_0x38f2b5),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':_0x40c2('0x31')+_0x371b62},'json':!![]})['then'](function(_0x4f2f43){if(_0x4f2f43['users']){var _0x56068f=-0x1;if(_[_0x40c2('0x32')](_0x4f2f43[_0x40c2('0x33')])){if(!_[_0x40c2('0x34')](_0x422a6a)){_0x56068f=_[_0x40c2('0x35')](_0x4f2f43[_0x40c2('0x33')],function(_0x10a75c){return _0x10a75c['email']===_0x422a6a;});}if(_0x56068f>=0x0){logger[_0x40c2('0x2c')]('Agent\x20found!');}else{logger[_0x40c2('0x2c')](_0x40c2('0x36'));_0x56068f=_[_0x40c2('0x35')](_0x4f2f43[_0x40c2('0x33')],function(_0x22f50d){return _0x22f50d['profile'][_0x40c2('0x16')]===_0x40c2('0x37');});}return _0x4f2f43[_0x40c2('0x33')][_0x56068f];}else{if(_0x4f2f43[_0x40c2('0x38')][_0x40c2('0x39')][_0x40c2('0x16')]==='Administrator'){logger[_0x40c2('0x2c')](_0x40c2('0x36'));user=_0x4f2f43['user'];return user;}else{logger[_0x40c2('0x29')](_0x40c2('0x3a'),JSON[_0x40c2('0xd')](_0x4f2f43));throw new Error(_0x40c2('0x3b')+JSON[_0x40c2('0xd')](_0x4f2f43));}}}else{logger[_0x40c2('0x29')]('The\x20failing\x20result\x20is',JSON[_0x40c2('0xd')](_0x4f2f43));throw new Error(_0x40c2('0x3b')+JSON['stringify'](_0x4f2f43));}})[_0x40c2('0x28')](function(_0x494e29){console['error'](_0x494e29);});}function getZohoUser(_0x4ade6c,_0x41714a){return new BPromise(function(_0x80001,_0x198c3e){request(_0x4ade6c)[_0x40c2('0x25')](function(_0x1991d2){var _0x4b34f2=null;if(_0x1991d2){_0x4b34f2=_0x1991d2[_0x40c2('0x3c')][0x0];_0x4b34f2[_0x40c2('0x3d')]=_0x41714a;}_0x80001(_0x4b34f2);})[_0x40c2('0x28')](function(_0xd78f73){_0x198c3e(_0xd78f73);});});}function createEndUser(_0x114f59,_0x5ed435,_0x2b8cd7,_0x139d4f,_0x9b69fa,_0x37f5c3){var _0x2b8cd7=getName(_0x2b8cd7);return request({'method':_0x40c2('0x20'),'uri':'https://www.zohoapis.'+_0x5ed435+_0x40c2('0x3e')+_[_0x40c2('0x3f')](_0x37f5c3[_0x40c2('0x40')])+'s','body':{'data':[{'Last_Name':_0x2b8cd7[0x1],'First_Name':_0x2b8cd7[0x0],'Phone':_0x139d4f,'Owner':{'name':!_[_0x40c2('0x34')](_0x9b69fa['role'][_0x40c2('0x16')])?_0x9b69fa['role'][_0x40c2('0x16')]:!_[_0x40c2('0x34')](_0x9b69fa[_0x40c2('0x41')])?_0x9b69fa[_0x40c2('0x41')]+'\x20'+_0x9b69fa[_0x40c2('0x42')]:_0x9b69fa[_0x40c2('0x42')],'id':_0x9b69fa['id']}}]},'headers':{'Authorization':_0x40c2('0x31')+_0x114f59},'json':!![]})[_0x40c2('0x25')](function(_0x5afc59){if(_0x5afc59&&_0x5afc59[_0x40c2('0x3c')][0x0]['code']===_0x40c2('0x43')){var _0x23493e=_0x5afc59[_0x40c2('0x3c')][0x0][_0x40c2('0x44')];_0x23493e[_0x40c2('0x3d')]=_[_0x40c2('0x3f')](_0x37f5c3['moduleCreate'])+'s';return _0x23493e;}logger[_0x40c2('0x29')](_0x40c2('0x3a'),JSON['stringify'](data));throw new Error(_0x40c2('0x45')+JSON[_0x40c2('0xd')](data));})[_0x40c2('0x28')](function(_0x4d75c7){console[_0x40c2('0x46')]('CREATE\x20ERROR',_0x4d75c7);});}function getEndUser(_0xcd794a,_0x57df70,_0xce81c3,_0x4d6250,_0x2076bb,_0x509191,_0x12055f){var _0x59c559={'method':_0x40c2('0x2e'),'uri':'','headers':{'Authorization':_0x40c2('0x31')+_0xcd794a},'json':!![]};switch(_0x12055f[_0x40c2('0x47')]){case _0x40c2('0x48'):_0x59c559[_0x40c2('0x49')]=_0x40c2('0x4a')+_0x57df70+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x2076bb+'))';return getZohoUser(_0x59c559,_0x40c2('0x4b'))['then'](function(_0x333541){if(_0x333541)return _0x333541;_0x59c559[_0x40c2('0x49')]='https://www.zohoapis.'+_0x57df70+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x2076bb+'))';return getZohoUser(_0x59c559,_0x40c2('0x4c'))['then'](function(_0x167a59){if(_0x167a59)return _0x167a59;if(_0x12055f['moduleCreate']!=_0x40c2('0x4d')){return createEndUser(_0xcd794a,_0x57df70,_0x4d6250,_0x2076bb,_0x509191,_0x12055f);}else{return{};}});});break;case _0x40c2('0x4e'):_0x59c559['uri']='https://www.zohoapis.'+_0x57df70+_0x40c2('0x4f')+_0x2076bb+'))';return getZohoUser(_0x59c559,_0x40c2('0x4b'))[_0x40c2('0x25')](function(_0x116e9f){if(_0x116e9f)return _0x116e9f;if(_0x12055f['moduleCreate']!=_0x40c2('0x4d')){return createEndUser(_0xcd794a,_0x57df70,_0x4d6250,_0x2076bb,_0x509191,_0x12055f);}else{return{};}});break;case _0x40c2('0x50'):_0x59c559[_0x40c2('0x49')]='https://www.zohoapis.'+_0x57df70+_0x40c2('0x51')+_0x2076bb+'))';return getZohoUser(_0x59c559,_0x40c2('0x4c'))[_0x40c2('0x25')](function(_0x4c4d37){if(_0x4c4d37)return _0x4c4d37;if(_0x12055f[_0x40c2('0x40')]!=_0x40c2('0x4d')){return createEndUser(_0xcd794a,_0x57df70,_0x4d6250,_0x2076bb,_0x509191,_0x12055f);}else{return{};}});break;}}function getCall(_0x1215f1,_0x37d680,_0x94f11c,_0x27635c,_0x2a9100,_0x1dc758,_0x44980d,_0x48b00c){logger[_0x40c2('0x2c')](_0x40c2('0x52'));var _0x419509={};_0x419509[_0x40c2('0x53')]={'name':!_[_0x40c2('0x34')](_0x27635c[_0x40c2('0x54')][_0x40c2('0x16')])&&!_[_0x40c2('0x34')](_0x27635c[_0x40c2('0x39')][_0x40c2('0x16')])&&_0x27635c[_0x40c2('0x39')][_0x40c2('0x16')]==='administrator'?_0x27635c[_0x40c2('0x54')][_0x40c2('0x16')]:!_[_0x40c2('0x34')](_0x27635c['first_name'])?_0x27635c[_0x40c2('0x41')]+'\x20'+_0x27635c[_0x40c2('0x42')]:_0x27635c[_0x40c2('0x42')],'id':_0x27635c['id']};_0x419509[_0x40c2('0x55')]=intUtil[_0x40c2('0x56')](_0x1dc758[_0x40c2('0x57')],_0x44980d,'\x20');_0x419509[_0x40c2('0x58')]=intUtil['getString'](_0x1dc758['Descriptions'],_0x44980d,'\x0a');if(_0x2a9100[_0x40c2('0x3d')]===_0x40c2('0x4b')){_0x419509[_0x40c2('0x59')]={'name':!_[_0x40c2('0x34')](_0x2a9100[_0x40c2('0x5a')])?_0x2a9100['Full_Name']:!_[_0x40c2('0x34')](_0x2a9100[_0x40c2('0x5b')])?_0x2a9100[_0x40c2('0x5b')]+'\x20'+_0x2a9100[_0x40c2('0x5c')]:_0x2a9100['Last_Name'],'id':_0x2a9100['id']};}if(_0x2a9100[_0x40c2('0x3d')]===_0x40c2('0x4c')){_0x419509['What_Id']={'name':!_['isNil'](_0x2a9100[_0x40c2('0x5a')])?_0x2a9100[_0x40c2('0x5a')]:!_[_0x40c2('0x34')](_0x2a9100[_0x40c2('0x5b')])?_0x2a9100[_0x40c2('0x5b')]+'\x20'+_0x2a9100[_0x40c2('0x5c')]:_0x2a9100[_0x40c2('0x5c')],'id':_0x2a9100['id']};_0x419509[_0x40c2('0x5d')]=_[_0x40c2('0x3f')](_0x2a9100[_0x40c2('0x3d')]);}if(_0x44980d[_0x40c2('0x5e')]){_0x419509[_0x40c2('0x5f')]=moment[_0x40c2('0x60')](parseInt(_0x44980d[_0x40c2('0x5e')])*0x3e8)[_0x40c2('0x2f')]('mm:ss');}else if(_0x44980d[_0x40c2('0x61')]&&_0x44980d['endtime']){_0x419509['Call_Duration']=moment[_0x40c2('0x60')](moment(_0x44980d[_0x40c2('0x62')],_0x40c2('0x63'))[_0x40c2('0x64')](moment(_0x44980d['starttime'],_0x40c2('0x63'))))['format']('mm:ss');}switch(_0x44980d[_0x40c2('0x65')]){case _0x40c2('0x66'):_0x419509[_0x40c2('0x67')]=_0x40c2('0x68');break;case _0x40c2('0x69'):case _0x40c2('0x6a'):_0x419509[_0x40c2('0x67')]=_0x40c2('0x6b');break;case _0x40c2('0x6c'):_0x419509[_0x40c2('0x67')]=_0x40c2('0x6d');break;case _0x40c2('0x6e'):_0x419509['Call_Result']=_0x40c2('0x6f');break;case _0x40c2('0x70'):_0x419509[_0x40c2('0x67')]=_0x40c2('0x71');default:}_0x419509[_0x40c2('0x72')]=(_0x48b00c===_0x40c2('0x73')?moment(_0x44980d[_0x40c2('0x74')])['format'](_0x40c2('0x63')):moment(_0x44980d[_0x40c2('0x75')])[_0x40c2('0x2f')]('YYYY-MM-DDTHH:mm:ss'))||moment()['format'](_0x40c2('0x63'));_0x419509[_0x40c2('0x76')]=_0x48b00c||_0x40c2('0x77');_0x419509=_['merge'](_0x419509,getCustomFields(_0x1dc758['Fields'],_0x44980d));return request({'method':_0x40c2('0x20'),'uri':_0x40c2('0x4a')+_0x37d680+_0x40c2('0x78'),'headers':{'Authorization':_0x40c2('0x31')+_0x1215f1},'body':{'data':[_0x419509]},'json':!![]})[_0x40c2('0x25')](function(_0x234fa2){if(_0x234fa2&&_0x234fa2['data'][0x0][_0x40c2('0x79')]===_0x40c2('0x43')){logger[_0x40c2('0x2c')](_0x40c2('0x7a'));return{'id':_0x234fa2[_0x40c2('0x3c')][0x0]['details']['id']};}})['catch'](function(_0x21d753){logger[_0x40c2('0x2c')](_0x40c2('0x7b'),_0x21d753[_0x40c2('0x2b')]);console[_0x40c2('0x46')]('err',_0x21d753);});}exports['queue']=function(_0x1b988e,_0x3c5144,_0x4aaebd,_0x5da675,_0x112e5a,_0x3a1c6a){var _0x559de1,_0x551278,_0x421dc3;_0x3a1c6a['host']=intUtil[_0x40c2('0x7c')](_0x3a1c6a[_0x40c2('0x7d')]);_0x3a1c6a[_0x40c2('0x7e')]=intUtil[_0x40c2('0x7c')](_0x3a1c6a['serverUrl']);if(_0x112e5a&&_0x112e5a['monitor_format']){logger[_0x40c2('0x2c')](_0x40c2('0x7f'),_0x40c2('0x80'));_0x3c5144['recordingURL']=_0x3a1c6a[_0x40c2('0x7e')]+_0x40c2('0x81')+_0x3c5144['uniqueid']+_0x40c2('0x82')+md5(_0x3c5144[_0x40c2('0x83')]);}else{_0x3c5144[_0x40c2('0x84')]='';}var _0x7dd18c=_0x3a1c6a[_0x40c2('0x7d')]===_0x40c2('0x85')?'eu':_0x40c2('0x86');return getAccessToken(_0x3a1c6a)[_0x40c2('0x25')](function(_0x4fca98){_0x421dc3=_0x4fca98;return getUser(_0x421dc3,_0x7dd18c,_0x3a1c6a,_0x5da675[_0x40c2('0x87')]);})[_0x40c2('0x25')](function(_0x16f23e){_0x559de1=_0x16f23e;logger['info'](_0x40c2('0x88'),_0x559de1['id']);return getEndUser(_0x421dc3,_0x7dd18c,_0x3a1c6a,_0x3c5144[_0x40c2('0x89')],_0x3c5144[_0x40c2('0x8a')],_0x559de1,_0x4aaebd);})[_0x40c2('0x25')](function(_0x5778a9){_0x551278=_0x5778a9;return getCall(_0x421dc3,_0x7dd18c,_0x3a1c6a,_0x559de1,_0x551278,_0x4aaebd,_0x3c5144,_0x40c2('0x77'));})[_0x40c2('0x25')](function(_0x5f341e){if(_0x5f341e){logger[_0x40c2('0x2c')](_0x40c2('0x8b'),_0x5f341e['id']);logger[_0x40c2('0x2c')](_0x40c2('0x7f'),_0x40c2('0x8c'));emit(util['format'](_0x40c2('0x8d'),_0x5da675['name']),_0x40c2('0x8e'),{'uri':'https://crm.'+_0x3a1c6a[_0x40c2('0x7d')]+_0x40c2('0x8f')+_0x5f341e['id']});}})[_0x40c2('0x28')](function(_0x16ffea){logger[_0x40c2('0x29')]('[QUEUE]',JSON[_0x40c2('0xd')](_0x16ffea));});};exports[_0x40c2('0x73')]=function(_0x3932b7,_0x24c990,_0x408e14,_0x101c43,_0x49f46a,_0x4e3740,_0x3909e1){var _0x4edebb,_0x12b971,_0x161e6f;_0x4e3740[_0x40c2('0x7d')]=intUtil[_0x40c2('0x7c')](_0x4e3740[_0x40c2('0x7d')]);_0x4e3740['serverUrl']=intUtil[_0x40c2('0x7c')](_0x4e3740[_0x40c2('0x7e')]);if(_0x3909e1&&_0x3909e1[_0x40c2('0x90')]&&_0x3909e1[_0x40c2('0x90')]!==_0x40c2('0x91')){logger[_0x40c2('0x2c')](_0x40c2('0x92'),_0x40c2('0x80'));_0x24c990['recordingURL']=_0x4e3740[_0x40c2('0x7e')]+_0x40c2('0x81')+_0x24c990[_0x40c2('0x83')]+'/downloads?type=uniqueid&token='+md5(_0x24c990['uniqueid']);}var _0x161b5e=_0x4e3740[_0x40c2('0x7d')]===_0x40c2('0x85')?'eu':_0x40c2('0x86');return getAccessToken(_0x4e3740)['then'](function(_0x4d7115){_0x161e6f=_0x4d7115;return getUser(_0x161e6f,_0x161b5e,_0x4e3740,_0x101c43['email']);})[_0x40c2('0x25')](function(_0x36b713){_0x4edebb=_0x36b713;logger[_0x40c2('0x2c')](_0x40c2('0x88'),_0x4edebb['id']);return getEndUser(_0x161e6f,_0x161b5e,_0x4e3740,_0x24c990[_0x40c2('0x93')],_0x24c990[_0x40c2('0x94')],_0x4edebb,_0x408e14);})['then'](function(_0x90cfa7){_0x12b971=_0x90cfa7;return getCall(_0x161e6f,_0x161b5e,_0x4e3740,_0x4edebb,_0x12b971,_0x408e14,_0x24c990,_0x40c2('0x95'));})[_0x40c2('0x25')](function(_0x3a0309){if(_0x3a0309){logger['info'](_0x40c2('0x8b'),_0x3a0309['id']);logger[_0x40c2('0x2c')]('[OUTBOUND]',_0x40c2('0x8c'));emit(util[_0x40c2('0x2f')](_0x40c2('0x8d'),_0x101c43[_0x40c2('0x16')]),_0x40c2('0x8e'),{'uri':_0x40c2('0x96')+_0x4e3740[_0x40c2('0x7d')]+'/crm/EntityInfo.do?module=Calls&id='+_0x3a0309['id']});}})[_0x40c2('0x28')](function(_0x431d38){logger[_0x40c2('0x29')]('[OUTBOUND]',JSON[_0x40c2('0xd')](_0x431d38));});};exports[_0x40c2('0x97')]=function(_0x34df2a,_0x2b1305,_0xc5e3fd,_0x41310f,_0x344f4b,_0x3e0fce){var _0xc10294,_0x1730f9,_0x47c991;_0x3e0fce['host']=intUtil['stripTrailingSlash'](_0x3e0fce[_0x40c2('0x7d')]);_0x3e0fce[_0x40c2('0x7e')]=intUtil[_0x40c2('0x7c')](_0x3e0fce['serverUrl']);if(_0x344f4b&&_0x344f4b[_0x40c2('0x98')]){logger[_0x40c2('0x2c')]('['+_0x2b1305[_0x40c2('0x65')][_0x40c2('0x99')]()+']',_0x40c2('0x80'));_0x2b1305[_0x40c2('0x84')]=_0x3e0fce[_0x40c2('0x7e')]+_0x40c2('0x81')+_0x2b1305[_0x40c2('0x83')]+_0x40c2('0x82')+md5(_0x2b1305[_0x40c2('0x83')]);}else{_0x2b1305['recordingURL']='';}var _0x522c51=_0x3e0fce[_0x40c2('0x7d')]===_0x40c2('0x85')?'eu':_0x40c2('0x86');return getAccessToken(_0x3e0fce)[_0x40c2('0x25')](function(_0x10fb63){_0x47c991=_0x10fb63;return getUser(_0x47c991,_0x522c51,_0x3e0fce);})['then'](function(_0x44dfa4){_0xc10294=_0x44dfa4;logger[_0x40c2('0x2c')](_0x40c2('0x88'),_0xc10294['id']);return getEndUser(_0x47c991,_0x522c51,_0x3e0fce,_0x2b1305[_0x40c2('0x89')],_0x2b1305['calleridnum'],_0xc10294,_0xc5e3fd);})[_0x40c2('0x25')](function(_0x477b47){_0x1730f9=_0x477b47;return getCall(_0x47c991,_0x522c51,_0x3e0fce,_0xc10294,_0x1730f9,_0xc5e3fd,_0x2b1305,'Inbound');})[_0x40c2('0x25')](function(_0x4b2340){if(_0x4b2340){logger[_0x40c2('0x2c')](_0x40c2('0x8b'),_0x4b2340['id']);}})[_0x40c2('0x28')](function(_0x5aa661){logger[_0x40c2('0x29')]('['+_0x2b1305[_0x40c2('0x65')][_0x40c2('0x99')]()+']',JSON[_0x40c2('0xd')](_0x5aa661));});}; \ 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 0365471..19fdf81 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 _0xabd9=['mustache','trigger','exec','data2','data3','render','error','format','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs'];(function(_0x11f648,_0x164bfe){var _0xa31ce3=function(_0x286d71){while(--_0x286d71){_0x11f648['push'](_0x11f648['shift']());}};_0xa31ce3(++_0x164bfe);}(_0xabd9,0xca));var _0x9abd=function(_0x2eb804,_0xb89212){_0x2eb804=_0x2eb804-0x0;var _0x836ffd=_0xabd9[_0x2eb804];return _0x836ffd;};'use strict';var util=require(_0x9abd('0x0'));var sh=require(_0x9abd('0x1'));var Mustache=require(_0x9abd('0x2'));var logger=require('../../../../config/logger')(_0x9abd('0x3'));exports[_0x9abd('0x4')]=function(_0x5658a1,_0x281210){var _0x531266=_0x5658a1[_0x9abd('0x5')]?_0x5658a1[_0x9abd('0x5')]:'Script';var _0x96a276=_0x5658a1[_0x9abd('0x6')]?Mustache[_0x9abd('0x7')](_0x5658a1['data3'],_0x281210):_0x281210;sh[_0x9abd('0x4')](_0x96a276,function(_0x2b201c,_0x13c604,_0xc2cc42){if(_0x2b201c!==0x0){logger[_0x9abd('0x8')](util[_0x9abd('0x9')]('%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s',_0x531266,_0x96a276,_0x2b201c,_0xc2cc42));}else{logger[_0x9abd('0xa')](util[_0x9abd('0x9')](_0x9abd('0xb'),_0x531266,_0x96a276,_0x13c604));}});}; \ No newline at end of file +var _0xe197=['data3','render','error','format','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','shelljs','mustache','../../../../config/logger','trigger','exec','data2','Script'];(function(_0x2e90b6,_0x33096d){var _0x45b513=function(_0x1f7889){while(--_0x1f7889){_0x2e90b6['push'](_0x2e90b6['shift']());}};_0x45b513(++_0x33096d);}(_0xe197,0x1b3));var _0x7e19=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe197[_0x14add3];return _0x4a174f;};'use strict';var util=require('util');var sh=require(_0x7e19('0x0'));var Mustache=require(_0x7e19('0x1'));var logger=require(_0x7e19('0x2'))(_0x7e19('0x3'));exports[_0x7e19('0x4')]=function(_0x346283,_0x30c2ac){var _0x5aeb40=_0x346283[_0x7e19('0x5')]?_0x346283[_0x7e19('0x5')]:_0x7e19('0x6');var _0x4b1f4d=_0x346283[_0x7e19('0x7')]?Mustache[_0x7e19('0x8')](_0x346283[_0x7e19('0x7')],_0x30c2ac):_0x30c2ac;sh[_0x7e19('0x4')](_0x4b1f4d,function(_0x3b9a2f,_0x5892ee,_0x48ecf6){if(_0x3b9a2f!==0x0){logger[_0x7e19('0x9')](util[_0x7e19('0xa')]('%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s',_0x5aeb40,_0x4b1f4d,_0x3b9a2f,_0x48ecf6));}else{logger[_0x7e19('0xb')](util[_0x7e19('0xa')](_0x7e19('0xc'),_0x5aeb40,_0x4b1f4d,_0x5892ee));}});}; \ 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 b8d3ae5..f22fb42 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 _0xb247=['error','data1','GET','DELETE','PUT','data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','data2','stringify','then','isNil','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','statusCode','name','message','request-promise','util','mustache','../../../../config/logger','exec','toUpperCase','render','data5','headers','parse','data6'];(function(_0x20837d,_0x38a78c){var _0x1aefea=function(_0x9a9a2c){while(--_0x9a9a2c){_0x20837d['push'](_0x20837d['shift']());}};_0x1aefea(++_0x38a78c);}(_0xb247,0x1f3));var _0x7b24=function(_0x17e3c4,_0x821010){_0x17e3c4=_0x17e3c4-0x0;var _0x2211b9=_0xb247[_0x17e3c4];return _0x2211b9;};'use strict';var rp=require(_0x7b24('0x0'));var util=require(_0x7b24('0x1'));var _=require('lodash');var Mustache=require(_0x7b24('0x2'));var logger=require(_0x7b24('0x3'))('trigger');exports[_0x7b24('0x4')]=function(_0x475cea,_0xa45b61){var _0x4b0e2a,_0x277280;var _0x3ee758={'method':_0x475cea['data1'][_0x7b24('0x5')](),'uri':Mustache[_0x7b24('0x6')](_0x475cea['data2'],_0xa45b61),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x475cea['data5'])==='number'&&parseInt(_0x475cea['data5'])>=0x1&&parseInt(_0x475cea['data5'])<=0xa?parseInt(_0x475cea[_0x7b24('0x7')])*0x3e8:0x5*0x3e8};try{_0x3ee758[_0x7b24('0x8')]=_0x475cea['data6']?JSON[_0x7b24('0x9')](Mustache['render'](_0x475cea[_0x7b24('0xa')],_0xa45b61)):{};}catch(_0x153a60){logger[_0x7b24('0xb')](_0x153a60['stack']);}switch(_0x475cea[_0x7b24('0xc')][_0x7b24('0x5')]()){case _0x7b24('0xd'):case _0x7b24('0xe'):_0x4b0e2a=null;_0x3ee758['qs']=_0xa45b61;break;case'POST':case _0x7b24('0xf'):if(_0x475cea[_0x7b24('0x10')]){try{_0x4b0e2a=JSON['parse'](Mustache[_0x7b24('0x6')](_0x475cea[_0x7b24('0x10')],_0xa45b61));_0x3ee758[_0x7b24('0x11')]=_0x4b0e2a;}catch(_0x145bd7){logger[_0x7b24('0xb')](_0x145bd7['stack']);logger[_0x7b24('0xb')](_0x7b24('0x12'));}}else{_0x4b0e2a=_0xa45b61;_0x3ee758[_0x7b24('0x11')]=_0x4b0e2a;}break;}logger['info'](util[_0x7b24('0x13')](_0x7b24('0x14'),_0x475cea[_0x7b24('0xc')],_0x475cea[_0x7b24('0x15')],JSON[_0x7b24('0x16')](_0x3ee758)));rp(_0x3ee758)[_0x7b24('0x17')](function(_0x3096ca){_0x4b0e2a=!_[_0x7b24('0x18')](_0x4b0e2a)?',\x20request\x20body:\x20'+_0x4b0e2a:'';_0x277280=typeof _0x3096ca['body']==='object'?JSON[_0x7b24('0x16')](_0x3096ca[_0x7b24('0x11')]):_0x3096ca[_0x7b24('0x11')];logger['info'](util[_0x7b24('0x13')](_0x7b24('0x19'),_0x475cea[_0x7b24('0xc')],_0x475cea[_0x7b24('0x15')],_0x3096ca['statusCode'],_0x277280));})['catch'](function(_0x5dfc2d){logger[_0x7b24('0xb')](util[_0x7b24('0x13')](_0x7b24('0x1a'),_0x475cea[_0x7b24('0xc')],_0x475cea[_0x7b24('0x15')],_0x5dfc2d[_0x7b24('0x1b')],_0x5dfc2d[_0x7b24('0x1c')],_0x5dfc2d[_0x7b24('0x1d')]));});}; \ No newline at end of file +var _0xf171=['%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','util','mustache','exec','toUpperCase','render','data5','number','headers','data6','parse','error','stack','data1','GET','DELETE','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','stringify','then','isNil','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode'];(function(_0x15abe5,_0x39c0a0){var _0x5c9077=function(_0x5a7f9d){while(--_0x5a7f9d){_0x15abe5['push'](_0x15abe5['shift']());}};_0x5c9077(++_0x39c0a0);}(_0xf171,0x11a));var _0x1f17=function(_0x5a9017,_0x4312fc){_0x5a9017=_0x5a9017-0x0;var _0x596e52=_0xf171[_0x5a9017];return _0x596e52;};'use strict';var rp=require(_0x1f17('0x0'));var util=require(_0x1f17('0x1'));var _=require('lodash');var Mustache=require(_0x1f17('0x2'));var logger=require('../../../../config/logger')('trigger');exports[_0x1f17('0x3')]=function(_0x32904b,_0x220462){var _0x63d569,_0x2209f5;var _0x55697f={'method':_0x32904b['data1'][_0x1f17('0x4')](),'uri':Mustache[_0x1f17('0x5')](_0x32904b['data2'],_0x220462),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x32904b[_0x1f17('0x6')])===_0x1f17('0x7')&&parseInt(_0x32904b[_0x1f17('0x6')])>=0x1&&parseInt(_0x32904b[_0x1f17('0x6')])<=0xa?parseInt(_0x32904b[_0x1f17('0x6')])*0x3e8:0x5*0x3e8};try{_0x55697f[_0x1f17('0x8')]=_0x32904b[_0x1f17('0x9')]?JSON[_0x1f17('0xa')](Mustache[_0x1f17('0x5')](_0x32904b['data6'],_0x220462)):{};}catch(_0x529a96){logger[_0x1f17('0xb')](_0x529a96[_0x1f17('0xc')]);}switch(_0x32904b[_0x1f17('0xd')][_0x1f17('0x4')]()){case _0x1f17('0xe'):case _0x1f17('0xf'):_0x63d569=null;_0x55697f['qs']=_0x220462;break;case'POST':case'PUT':if(_0x32904b[_0x1f17('0x10')]){try{_0x63d569=JSON[_0x1f17('0xa')](Mustache[_0x1f17('0x5')](_0x32904b['data7'],_0x220462));_0x55697f[_0x1f17('0x11')]=_0x63d569;}catch(_0x5e0737){logger[_0x1f17('0xb')](_0x5e0737[_0x1f17('0xc')]);logger['error'](_0x1f17('0x12'));}}else{_0x63d569=_0x220462;_0x55697f[_0x1f17('0x11')]=_0x63d569;}break;}logger[_0x1f17('0x13')](util[_0x1f17('0x14')](_0x1f17('0x15'),_0x32904b[_0x1f17('0xd')],_0x32904b[_0x1f17('0x16')],JSON[_0x1f17('0x17')](_0x55697f)));rp(_0x55697f)[_0x1f17('0x18')](function(_0xd4dc36){_0x63d569=!_[_0x1f17('0x19')](_0x63d569)?',\x20request\x20body:\x20'+_0x63d569:'';_0x2209f5=typeof _0xd4dc36[_0x1f17('0x11')]==='object'?JSON['stringify'](_0xd4dc36[_0x1f17('0x11')]):_0xd4dc36['body'];logger[_0x1f17('0x13')](util[_0x1f17('0x14')](_0x1f17('0x1a'),_0x32904b[_0x1f17('0xd')],_0x32904b[_0x1f17('0x16')],_0xd4dc36[_0x1f17('0x1b')],_0x2209f5));})['catch'](function(_0x43eb9c){logger[_0x1f17('0xb')](util[_0x1f17('0x14')](_0x1f17('0x1c'),_0x32904b[_0x1f17('0xd')],_0x32904b['data2'],_0x43eb9c['statusCode'],_0x43eb9c[_0x1f17('0x1d')],_0x43eb9c[_0x1f17('0x1e')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 8edbbc3..df9b3c7 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 _0x3eab=['error','rpc','message','result','exports','jayson/promise','bluebird','http','request','routing'];(function(_0x302cee,_0x38d1ae){var _0x17686a=function(_0x4fc9ce){while(--_0x4fc9ce){_0x302cee['push'](_0x302cee['shift']());}};_0x17686a(++_0x38d1ae);}(_0x3eab,0x113));var _0xb3ea=function(_0x49ee8c,_0x42cdd9){_0x49ee8c=_0x49ee8c-0x0;var _0x14b868=_0x3eab[_0x49ee8c];return _0x14b868;};'use strict';var jayson=require(_0xb3ea('0x0'));var BPromise=require(_0xb3ea('0x1'));var logger=require('../../config/logger')('routing');var client=jayson['client'][_0xb3ea('0x2')]({'port':0x2329});client['Request']=function(_0x3f47aa,_0x86d026){return new BPromise(function(_0x1c39df,_0x16ca04){return client[_0xb3ea('0x3')](_0x3f47aa,_0x86d026)['then'](function(_0x5bbd78){logger['debug']('rpc',_0xb3ea('0x4'),_0x3f47aa,_0x86d026,_0x5bbd78);if(_0x5bbd78['error']){logger[_0xb3ea('0x5')](_0xb3ea('0x6'),_0xb3ea('0x4'),_0x3f47aa,_0x5bbd78[_0xb3ea('0x5')][_0xb3ea('0x7')],_0x86d026);return _0x16ca04(_0x5bbd78['error']['message']);}else{return _0x1c39df(_0x5bbd78[_0xb3ea('0x8')]);}})['catch'](function(_0x26f805){logger[_0xb3ea('0x5')](_0xb3ea('0x6'),_0xb3ea('0x4'),_0x3f47aa,_0x26f805,_0x86d026);return _0x16ca04(_0x26f805);});});};module[_0xb3ea('0x9')]=client; \ No newline at end of file +var _0x2092=['routing','client','http','Request','debug','error','rpc','message','catch','exports','jayson/promise','../../config/logger'];(function(_0x540e7b,_0x57d500){var _0x526bd4=function(_0x231bb3){while(--_0x231bb3){_0x540e7b['push'](_0x540e7b['shift']());}};_0x526bd4(++_0x57d500);}(_0x2092,0xfa));var _0x2209=function(_0x1a1ab0,_0x1f1820){_0x1a1ab0=_0x1a1ab0-0x0;var _0x359a17=_0x2092[_0x1a1ab0];return _0x359a17;};'use strict';var jayson=require(_0x2209('0x0'));var BPromise=require('bluebird');var logger=require(_0x2209('0x1'))(_0x2209('0x2'));var client=jayson[_0x2209('0x3')][_0x2209('0x4')]({'port':0x2329});client[_0x2209('0x5')]=function(_0x3588c8,_0x389c4a){return new BPromise(function(_0x510b8b,_0x376d8e){return client['request'](_0x3588c8,_0x389c4a)['then'](function(_0x3c0535){logger[_0x2209('0x6')]('rpc',_0x2209('0x2'),_0x3588c8,_0x389c4a,_0x3c0535);if(_0x3c0535['error']){logger[_0x2209('0x7')](_0x2209('0x8'),_0x2209('0x2'),_0x3588c8,_0x3c0535[_0x2209('0x7')]['message'],_0x389c4a);return _0x376d8e(_0x3c0535[_0x2209('0x7')][_0x2209('0x9')]);}else{return _0x510b8b(_0x3c0535['result']);}})[_0x2209('0xa')](function(_0x2cc841){logger[_0x2209('0x7')](_0x2209('0x8'),_0x2209('0x2'),_0x3588c8,_0x2cc841,_0x389c4a);return _0x376d8e(_0x2cc841);});});};module[_0x2209('0xb')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index e7f6cea..8ec0a56 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 _0x356b=['./rpc/setting','../../config/logger','email','resolve','getMailAccounts','then','initMailAccounts','refresh','mailAccounts','getSettings','loginMailFrequency','catch','error','./server','./rpc/mailAccount'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x356b,0x67));var _0xb356=function(_0x414d55,_0x12d9ba){_0x414d55=_0x414d55-0x0;var _0x5530f4=_0x356b[_0x414d55];return _0x5530f4;};'use strict';var server=require(_0xb356('0x0'));var Realtime=require('./realtime');var EmailChannel=require('./lib/email');var mailAccount=require(_0xb356('0x1'));var setting=require(_0xb356('0x2'));var logger=require(_0xb356('0x3'))(_0xb356('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0xb356('0x5')]()['then'](mailAccount[_0xb356('0x6')]())[_0xb356('0x7')](realtime[_0xb356('0x8')]())[_0xb356('0x7')](function(){email[_0xb356('0x9')](realtime[_0xb356('0xa')]);return realtime;});}function main(){return server['listen'](realtime,email)[_0xb356('0x7')](function(){return initRealtime();})[_0xb356('0x7')](function(){return setting[_0xb356('0xb')]();})[_0xb356('0x7')](function(_0x27113c){return setInterval(initRealtime,_0x27113c[_0xb356('0xc')]*0x3e8);})[_0xb356('0xd')](function(_0x1eeb40){logger[_0xb356('0xe')]('Email\x20service\x20initialization',_0x1eeb40);});}main(); \ No newline at end of file +var _0xbc28=['./lib/email','./rpc/mailAccount','./rpc/setting','../../config/logger','email','resolve','getMailAccounts','then','initMailAccounts','refresh','listen','loginMailFrequency','catch','error','Email\x20service\x20initialization','./server','./realtime'];(function(_0x50ea69,_0x17ef8d){var _0x1e7892=function(_0x5bebf8){while(--_0x5bebf8){_0x50ea69['push'](_0x50ea69['shift']());}};_0x1e7892(++_0x17ef8d);}(_0xbc28,0xec));var _0x8bc2=function(_0x3ae385,_0x19ea21){_0x3ae385=_0x3ae385-0x0;var _0x268d1d=_0xbc28[_0x3ae385];return _0x268d1d;};'use strict';var server=require(_0x8bc2('0x0'));var Realtime=require(_0x8bc2('0x1'));var EmailChannel=require(_0x8bc2('0x2'));var mailAccount=require(_0x8bc2('0x3'));var setting=require(_0x8bc2('0x4'));var logger=require(_0x8bc2('0x5'))(_0x8bc2('0x6'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x8bc2('0x7')]()['then'](mailAccount[_0x8bc2('0x8')]())[_0x8bc2('0x9')](realtime[_0x8bc2('0xa')]())[_0x8bc2('0x9')](function(){email[_0x8bc2('0xb')](realtime['mailAccounts']);return realtime;});}function main(){return server[_0x8bc2('0xc')](realtime,email)['then'](function(){return initRealtime();})[_0x8bc2('0x9')](function(){return setting['getSettings']();})[_0x8bc2('0x9')](function(_0x3f1979){return setInterval(initRealtime,_0x3f1979[_0x8bc2('0xd')]*0x3e8);})[_0x8bc2('0xe')](function(_0x4a2d93){logger[_0x8bc2('0xf')](_0x8bc2('0x10'),_0x4a2d93);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index f8d0a40..79b8484 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 _0x304d=['firstName','from','notify','Mail\x20accepted\x20from\x20routing','Mail\x20not\x20accepted\x20from\x20routing\x20%s','stringify','lastSync','sendMail','verifySmtp','Smtp','verify','then','catch','exports','moment','md5','ioredis','../../../config/environment','../../../config/logger','email','redis','defaults','localhost','socket.io-emitter','../rpc/mailAccount','mailAccounts','imapAccounts','smtp','prototype','emit','key','active','Imap','status','messageStatus','total','isNil','mailAccount:update','hasOwnProperty','service','custom','handleImapBox','handleImapEmail','end','handleImapEnd','bind','error','handleImapError','disabled','connected','messages','info','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x304d,0x117));var _0xd304=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x304d[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var moment=require(_0xd304('0x0'));var BPromise=require('bluebird');var md5=require(_0xd304('0x1'));var Redis=require(_0xd304('0x2'));var config=require(_0xd304('0x3'));var logger=require(_0xd304('0x4'))(_0xd304('0x5'));config[_0xd304('0x6')]=_[_0xd304('0x7')](config[_0xd304('0x6')],{'host':_0xd304('0x8'),'port':0x18eb});var io=require(_0xd304('0x9'))(new Redis(config[_0xd304('0x6')]));var EmailImap=require('./imap');var EmailSmtp=require('./smtp');var mailAccount=require(_0xd304('0xa'));var md5Accounts={};function EmailChannel(_0x2c2e3f){logger['info']('start\x20email\x20channel');this[_0xd304('0xb')]=_0x2c2e3f['mailAccounts'];this[_0xd304('0xc')]={};this[_0xd304('0xd')]=new EmailSmtp();}EmailChannel[_0xd304('0xe')][_0xd304('0xf')]=function(_0x306c5c){var _0x2d6366=this['mailAccounts'][_0x306c5c];var _0x516522={'id':_0x2d6366['id'],'name':_0x2d6366['name'],'key':_0x2d6366[_0xd304('0x10')],'active':_0x2d6366[_0xd304('0x11')],'Imap':{'status':_0x2d6366[_0xd304('0x12')][_0xd304('0x13')],'messageStatus':_0x2d6366[_0xd304('0x12')][_0xd304('0x14')],'total':_0x2d6366[_0xd304('0x12')][_0xd304('0x15')]}};if(_[_0xd304('0x16')](md5Accounts[_0x306c5c])){md5Accounts[_0x306c5c]={};}var _0x3b70ff=md5(JSON['stringify'](_0x516522));if(md5Accounts[_0x306c5c][_0xd304('0x1')]!==_0x3b70ff){md5Accounts[_0x306c5c][_0xd304('0x1')]=_0x3b70ff;io[_0xd304('0xf')](_0xd304('0x17'),_0x516522);}};EmailChannel[_0xd304('0xe')]['refresh']=function(_0x5a43b6){for(var _0x4fe51c in _0x5a43b6){if(_0x5a43b6[_0xd304('0x18')](_0x4fe51c)){if(_0x5a43b6[_0x4fe51c][_0xd304('0x12')]&&_0x5a43b6[_0x4fe51c][_0xd304('0x11')]){var _0x978b2a=_0x5a43b6[_0x4fe51c]['Imap'];if(!_0x978b2a[_0xd304('0x19')]&&_0x5a43b6[_0x4fe51c]['provider']!==_0xd304('0x1a'))_0x978b2a[_0xd304('0x19')]=_0x5a43b6[_0x4fe51c]['provider'];if(!this['imapAccounts']['hasOwnProperty'](_0x978b2a['id'])){this[_0xd304('0xc')][_0x978b2a['id']]=new EmailImap(_0x978b2a,_0x5a43b6[_0x4fe51c][_0xd304('0x5')]);this[_0xd304('0xc')][_0x978b2a['id']]['on']('box',this[_0xd304('0x1b')]['bind'](this,_0x4fe51c));this[_0xd304('0xc')][_0x978b2a['id']]['on'](_0xd304('0x5'),this[_0xd304('0x1c')]['bind'](this,_0x4fe51c));this[_0xd304('0xc')][_0x978b2a['id']]['on'](_0xd304('0x1d'),this[_0xd304('0x1e')][_0xd304('0x1f')](this,_0x4fe51c));this['imapAccounts'][_0x978b2a['id']]['on'](_0xd304('0x20'),this[_0xd304('0x21')]['bind'](this,_0x4fe51c));}}else{if(_[_0xd304('0x16')](this['mailAccounts'][_0x4fe51c][_0xd304('0x12')])){this[_0xd304('0xb')][_0x4fe51c][_0xd304('0x12')]={};}this[_0xd304('0xb')][_0x4fe51c][_0xd304('0x12')][_0xd304('0x13')]=_0xd304('0x22');this['mailAccounts'][_0x4fe51c][_0xd304('0x12')]['messageStatus']='';this[_0xd304('0xf')](_0x4fe51c);}}}};EmailChannel[_0xd304('0xe')][_0xd304('0x1b')]=function(_0x7d883e,_0x1b2b8c){if(this[_0xd304('0xb')][_0x7d883e]){this[_0xd304('0xb')][_0x7d883e][_0xd304('0x12')][_0xd304('0x13')]=_0xd304('0x23');this[_0xd304('0xb')][_0x7d883e][_0xd304('0x12')][_0xd304('0x14')]=_0x1b2b8c['name'];if(_0x1b2b8c[_0xd304('0x24')]){this[_0xd304('0xb')][_0x7d883e]['Imap'][_0xd304('0x15')]=_0x1b2b8c['messages']['total'];}return this['emit'](_0x7d883e);}};EmailChannel[_0xd304('0xe')][_0xd304('0x1c')]=function(_0x366e46,_0x2b9668){logger[_0xd304('0x25')](_0xd304('0x26'),_0x2b9668[_0xd304('0x27')],_0x2b9668['lastName'],_0x2b9668[_0xd304('0x28')],_0x366e46);if(this[_0xd304('0xb')][_0x366e46]){return mailAccount[_0xd304('0x29')](_0x366e46,_0x2b9668)['then'](function(_0x1937bd){if(_0x1937bd){logger[_0xd304('0x25')](_0xd304('0x2a'));}})['catch'](function(_0x471d98){logger[_0xd304('0x20')](_0xd304('0x2b'),JSON[_0xd304('0x2c')](_0x471d98));});}};EmailChannel[_0xd304('0xe')]['handleImapEnd']=function(_0x4c6ecd){if(this[_0xd304('0xb')][_0x4c6ecd]&&this[_0xd304('0xb')][_0x4c6ecd]['Imap']){if(this['imapAccounts'][this[_0xd304('0xb')][_0x4c6ecd][_0xd304('0x12')]['id']]){delete this[_0xd304('0xc')][this[_0xd304('0xb')][_0x4c6ecd][_0xd304('0x12')]['id']];}this[_0xd304('0xb')][_0x4c6ecd][_0xd304('0x12')][_0xd304('0x2d')]=moment();this[_0xd304('0xf')](_0x4c6ecd);}};EmailChannel[_0xd304('0xe')][_0xd304('0x21')]=function(_0x29682e,_0x403029){if(this[_0xd304('0xb')][_0x29682e]){this[_0xd304('0xb')][_0x29682e][_0xd304('0x12')][_0xd304('0x13')]=_0xd304('0x20');this[_0xd304('0xb')][_0x29682e][_0xd304('0x12')][_0xd304('0x14')]=_0x403029;return this[_0xd304('0xf')](_0x29682e);}};EmailChannel[_0xd304('0xe')][_0xd304('0x2e')]=function(_0x5ae9fe,_0x5c9bca){return this[_0xd304('0xd')]['send'](_0x5ae9fe,_0x5c9bca);};EmailChannel['prototype'][_0xd304('0x2f')]=function(_0x26eda4){var _0x4b1d1a=this;if(this['mailAccounts'][_0x26eda4['id']]){if(_[_0xd304('0x16')](this[_0xd304('0xb')][_0x26eda4['id']][_0xd304('0x30')])){this['mailAccounts'][_0x26eda4['id']][_0xd304('0x30')]={};}this[_0xd304('0xb')][_0x26eda4['id']][_0xd304('0x30')][_0xd304('0x2d')]=moment();return new BPromise(function(_0x2c112b,_0x2df3af){return _0x4b1d1a['smtp'][_0xd304('0x31')](_0x26eda4)[_0xd304('0x32')](function(_0x4bfda3){_0x4b1d1a[_0xd304('0xb')][_0x26eda4['id']][_0xd304('0x30')]['status']='verified';_0x4b1d1a[_0xd304('0xb')][_0x26eda4['id']][_0xd304('0x30')][_0xd304('0x14')]='';_0x4b1d1a['emit'](_0x26eda4['id']);_0x2c112b(_0x4bfda3);})[_0xd304('0x33')](function(_0x3eb278){_0x4b1d1a[_0xd304('0xb')][_0x26eda4['id']][_0xd304('0x30')][_0xd304('0x13')]=_0xd304('0x20');_0x4b1d1a[_0xd304('0xb')][_0x26eda4['id']][_0xd304('0x30')]['messageStatus']=_0x3eb278;_0x4b1d1a['emit'](_0x26eda4['id']);_0x2df3af(_0x3eb278);});});}return this[_0xd304('0xd')][_0xd304('0x31')](_0x26eda4);};module[_0xd304('0x34')]=EmailChannel; \ No newline at end of file +var _0x4595=['bind','handleImapEmail','handleImapEnd','handleImapError','messageStatus','connected','name','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','notify','then','catch','error','stringify','lastSync','sendMail','send','verifySmtp','Smtp','verify','verified','exports','moment','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','email','defaults','redis','localhost','socket.io-emitter','./imap','../rpc/mailAccount','info','mailAccounts','imapAccounts','smtp','emit','active','Imap','status','total','isNil','mailAccount:update','prototype','refresh','hasOwnProperty','service','custom','provider','handleImapBox'];(function(_0xceb6c0,_0x8452da){var _0x5c010f=function(_0x275997){while(--_0x275997){_0xceb6c0['push'](_0xceb6c0['shift']());}};_0x5c010f(++_0x8452da);}(_0x4595,0x191));var _0x5459=function(_0x3956a2,_0x4a8d1c){_0x3956a2=_0x3956a2-0x0;var _0xae6aae=_0x4595[_0x3956a2];return _0xae6aae;};'use strict';var _=require('lodash');var moment=require(_0x5459('0x0'));var BPromise=require(_0x5459('0x1'));var md5=require(_0x5459('0x2'));var Redis=require(_0x5459('0x3'));var config=require(_0x5459('0x4'));var logger=require(_0x5459('0x5'))(_0x5459('0x6'));config['redis']=_[_0x5459('0x7')](config[_0x5459('0x8')],{'host':_0x5459('0x9'),'port':0x18eb});var io=require(_0x5459('0xa'))(new Redis(config[_0x5459('0x8')]));var EmailImap=require(_0x5459('0xb'));var EmailSmtp=require('./smtp');var mailAccount=require(_0x5459('0xc'));var md5Accounts={};function EmailChannel(_0x38565d){logger[_0x5459('0xd')]('start\x20email\x20channel');this[_0x5459('0xe')]=_0x38565d[_0x5459('0xe')];this[_0x5459('0xf')]={};this[_0x5459('0x10')]=new EmailSmtp();}EmailChannel['prototype'][_0x5459('0x11')]=function(_0x130026){var _0x20f8da=this[_0x5459('0xe')][_0x130026];var _0x45b5e3={'id':_0x20f8da['id'],'name':_0x20f8da['name'],'key':_0x20f8da['key'],'active':_0x20f8da[_0x5459('0x12')],'Imap':{'status':_0x20f8da[_0x5459('0x13')][_0x5459('0x14')],'messageStatus':_0x20f8da[_0x5459('0x13')]['messageStatus'],'total':_0x20f8da[_0x5459('0x13')][_0x5459('0x15')]}};if(_[_0x5459('0x16')](md5Accounts[_0x130026])){md5Accounts[_0x130026]={};}var _0x29d044=md5(JSON['stringify'](_0x45b5e3));if(md5Accounts[_0x130026][_0x5459('0x2')]!==_0x29d044){md5Accounts[_0x130026][_0x5459('0x2')]=_0x29d044;io[_0x5459('0x11')](_0x5459('0x17'),_0x45b5e3);}};EmailChannel[_0x5459('0x18')][_0x5459('0x19')]=function(_0x1d1b4b){for(var _0xb8c79f in _0x1d1b4b){if(_0x1d1b4b[_0x5459('0x1a')](_0xb8c79f)){if(_0x1d1b4b[_0xb8c79f][_0x5459('0x13')]&&_0x1d1b4b[_0xb8c79f][_0x5459('0x12')]){var _0x39311a=_0x1d1b4b[_0xb8c79f][_0x5459('0x13')];if(!_0x39311a[_0x5459('0x1b')]&&_0x1d1b4b[_0xb8c79f]['provider']!==_0x5459('0x1c'))_0x39311a['service']=_0x1d1b4b[_0xb8c79f][_0x5459('0x1d')];if(!this[_0x5459('0xf')][_0x5459('0x1a')](_0x39311a['id'])){this[_0x5459('0xf')][_0x39311a['id']]=new EmailImap(_0x39311a,_0x1d1b4b[_0xb8c79f][_0x5459('0x6')]);this[_0x5459('0xf')][_0x39311a['id']]['on']('box',this[_0x5459('0x1e')][_0x5459('0x1f')](this,_0xb8c79f));this[_0x5459('0xf')][_0x39311a['id']]['on'](_0x5459('0x6'),this[_0x5459('0x20')][_0x5459('0x1f')](this,_0xb8c79f));this['imapAccounts'][_0x39311a['id']]['on']('end',this[_0x5459('0x21')]['bind'](this,_0xb8c79f));this['imapAccounts'][_0x39311a['id']]['on']('error',this[_0x5459('0x22')][_0x5459('0x1f')](this,_0xb8c79f));}}else{if(_[_0x5459('0x16')](this['mailAccounts'][_0xb8c79f]['Imap'])){this['mailAccounts'][_0xb8c79f][_0x5459('0x13')]={};}this[_0x5459('0xe')][_0xb8c79f]['Imap'][_0x5459('0x14')]='disabled';this[_0x5459('0xe')][_0xb8c79f][_0x5459('0x13')][_0x5459('0x23')]='';this[_0x5459('0x11')](_0xb8c79f);}}}};EmailChannel[_0x5459('0x18')]['handleImapBox']=function(_0x55a736,_0x22ab9a){if(this[_0x5459('0xe')][_0x55a736]){this[_0x5459('0xe')][_0x55a736][_0x5459('0x13')][_0x5459('0x14')]=_0x5459('0x24');this[_0x5459('0xe')][_0x55a736][_0x5459('0x13')]['messageStatus']=_0x22ab9a[_0x5459('0x25')];if(_0x22ab9a[_0x5459('0x26')]){this['mailAccounts'][_0x55a736][_0x5459('0x13')][_0x5459('0x15')]=_0x22ab9a['messages']['total'];}return this['emit'](_0x55a736);}};EmailChannel[_0x5459('0x18')][_0x5459('0x20')]=function(_0x11b026,_0x22beb0){logger[_0x5459('0xd')](_0x5459('0x27'),_0x22beb0[_0x5459('0x28')],_0x22beb0['lastName'],_0x22beb0['from'],_0x11b026);if(this[_0x5459('0xe')][_0x11b026]){return mailAccount[_0x5459('0x29')](_0x11b026,_0x22beb0)[_0x5459('0x2a')](function(_0x186b78){if(_0x186b78){logger[_0x5459('0xd')]('Mail\x20accepted\x20from\x20routing');}})[_0x5459('0x2b')](function(_0x314956){logger[_0x5459('0x2c')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0x5459('0x2d')](_0x314956));});}};EmailChannel[_0x5459('0x18')][_0x5459('0x21')]=function(_0x5ce316){if(this[_0x5459('0xe')][_0x5ce316]&&this[_0x5459('0xe')][_0x5ce316]['Imap']){if(this[_0x5459('0xf')][this[_0x5459('0xe')][_0x5ce316]['Imap']['id']]){delete this[_0x5459('0xf')][this[_0x5459('0xe')][_0x5ce316][_0x5459('0x13')]['id']];}this[_0x5459('0xe')][_0x5ce316][_0x5459('0x13')][_0x5459('0x2e')]=moment();this[_0x5459('0x11')](_0x5ce316);}};EmailChannel['prototype']['handleImapError']=function(_0x2bc235,_0x164fba){if(this[_0x5459('0xe')][_0x2bc235]){this[_0x5459('0xe')][_0x2bc235][_0x5459('0x13')][_0x5459('0x14')]=_0x5459('0x2c');this['mailAccounts'][_0x2bc235][_0x5459('0x13')][_0x5459('0x23')]=_0x164fba;return this[_0x5459('0x11')](_0x2bc235);}};EmailChannel[_0x5459('0x18')][_0x5459('0x2f')]=function(_0x1eee18,_0xb60a89){return this[_0x5459('0x10')][_0x5459('0x30')](_0x1eee18,_0xb60a89);};EmailChannel[_0x5459('0x18')][_0x5459('0x31')]=function(_0x49e205){var _0x109f2b=this;if(this[_0x5459('0xe')][_0x49e205['id']]){if(_[_0x5459('0x16')](this[_0x5459('0xe')][_0x49e205['id']][_0x5459('0x32')])){this[_0x5459('0xe')][_0x49e205['id']][_0x5459('0x32')]={};}this[_0x5459('0xe')][_0x49e205['id']]['Smtp'][_0x5459('0x2e')]=moment();return new BPromise(function(_0x304deb,_0x543ef0){return _0x109f2b['smtp'][_0x5459('0x33')](_0x49e205)[_0x5459('0x2a')](function(_0x378707){_0x109f2b['mailAccounts'][_0x49e205['id']][_0x5459('0x32')][_0x5459('0x14')]=_0x5459('0x34');_0x109f2b[_0x5459('0xe')][_0x49e205['id']]['Smtp']['messageStatus']='';_0x109f2b[_0x5459('0x11')](_0x49e205['id']);_0x304deb(_0x378707);})['catch'](function(_0x3c3f02){_0x109f2b[_0x5459('0xe')][_0x49e205['id']]['Smtp'][_0x5459('0x14')]='error';_0x109f2b['mailAccounts'][_0x49e205['id']][_0x5459('0x32')][_0x5459('0x23')]=_0x3c3f02;_0x109f2b[_0x5459('0x11')](_0x49e205['id']);_0x543ef0(_0x3c3f02);});});}return this[_0x5459('0x10')][_0x5459('0x33')](_0x49e205);};module[_0x5459('0x35')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 50ea04d..545e814 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 _0x82ef=['emit','textCode','hasOwnProperty','upperFirst','exports','lodash','imap','mailparser','iconv','Iconv','events','EventEmitter','./utils','email','mailbox','account','once','handleReady','bind','end','error','getAccount','connTimeout','authTimeout','service','user','modernAuthentication','xoauth2','generateXOAuth2Token','CloudProvider','data5','authentication','password','anonymous@xcally.com','host','port','tls','autotls','required','prototype','handleError','handleCloseBox','readUnseen','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','handleFetchError','handleFetchEnd','body','handleSimpleParser','handleMessageAttributes','handleMessageEnd','closeBox','handleEnd'];(function(_0xb11548,_0x1d98d1){var _0x5cc8f4=function(_0xe6d41c){while(--_0xe6d41c){_0xb11548['push'](_0xb11548['shift']());}};_0x5cc8f4(++_0x1d98d1);}(_0x82ef,0x1d5));var _0xf82e=function(_0x566b58,_0x41c15f){_0x566b58=_0x566b58-0x0;var _0x4fdd3c=_0x82ef[_0x566b58];return _0x4fdd3c;};'use strict';var _=require(_0xf82e('0x0'));var util=require('util');var Imap=require(_0xf82e('0x1'));var simpleParser=require(_0xf82e('0x2'))['simpleParser'];var Iconv=require(_0xf82e('0x3'))[_0xf82e('0x4')];var EventEmitter=require(_0xf82e('0x5'))[_0xf82e('0x6')];var utils=require(_0xf82e('0x7'));var logger=require('../../../config/logger')(_0xf82e('0x8'));function EmailImap(_0x41033b,_0x511f73){this['mailbox']=_0x41033b[_0xf82e('0x9')];this[_0xf82e('0xa')]=this['getAccount'](_0x41033b,_0x511f73);this['imap']=new Imap(this['account']);this['imap'][_0xf82e('0xb')]('ready',this[_0xf82e('0xc')][_0xf82e('0xd')](this));this['imap'][_0xf82e('0xb')](_0xf82e('0xe'),this['handleEnd'][_0xf82e('0xd')](this));this[_0xf82e('0x1')]['on'](_0xf82e('0xf'),this['handleError'][_0xf82e('0xd')](this));this['imap']['connect']();}util['inherits'](EmailImap,EventEmitter);EmailImap['prototype'][_0xf82e('0x10')]=function(_0xcadf0e,_0x3c14a6){var _0x125090={'connTimeout':_0xcadf0e['connTimeout']?_0xcadf0e[_0xf82e('0x11')]*0x3e8:0x2710,'authTimeout':_0xcadf0e['authTimeout']?_0xcadf0e[_0xf82e('0x12')]*0x3e8:0x1388};if(_0xcadf0e[_0xf82e('0x13')]){_0x125090[_0xf82e('0x14')]=_0xcadf0e[_0xf82e('0x14')];if(_0xcadf0e[_0xf82e('0x15')]){_0x125090[_0xf82e('0x16')]=utils[_0xf82e('0x17')](_0xcadf0e[_0xf82e('0x18')][_0xf82e('0x19')],_0xcadf0e[_0xf82e('0x14')]);}else{_0x125090['password']=_0xcadf0e['password'];}}else{if(_0xcadf0e[_0xf82e('0x1a')]){_0x125090['user']=_0xcadf0e['user'];_0x125090[_0xf82e('0x1b')]=_0xcadf0e['password'];}}_0x125090[_0xf82e('0x8')]=_0x3c14a6||_0xcadf0e[_0xf82e('0x14')]||_0xf82e('0x1c');_0x125090[_0xf82e('0x1d')]=_0xcadf0e[_0xf82e('0x1d')];_0x125090[_0xf82e('0x1e')]=_0xcadf0e[_0xf82e('0x1e')]||0x3e1;if(_0xcadf0e[_0xf82e('0x1f')]){_0x125090[_0xf82e('0x1f')]=!![];}else{_0x125090[_0xf82e('0x1f')]=![];_0x125090[_0xf82e('0x20')]=_0xf82e('0x21');}return _0x125090;};EmailImap[_0xf82e('0x22')][_0xf82e('0xc')]=function(){this[_0xf82e('0x1')]['openBox'](this[_0xf82e('0x9')],![],this['handleOpenBox'][_0xf82e('0xd')](this));};EmailImap[_0xf82e('0x22')]['handleOpenBox']=function(_0x3ba067,_0x5c5243){if(_0x3ba067){this[_0xf82e('0x23')](_0x3ba067,!![]);}else{this['emit']('box',_0x5c5243);this['readUnseen']();}};EmailImap['prototype'][_0xf82e('0x24')]=function(_0x1e132a){if(_0x1e132a){this[_0xf82e('0x23')](_0x1e132a,!![]);}else{this[_0xf82e('0x1')]['end']();}};EmailImap[_0xf82e('0x22')][_0xf82e('0x25')]=function(){this[_0xf82e('0x1')][_0xf82e('0x26')]([_0xf82e('0x27')],this[_0xf82e('0x28')][_0xf82e('0xd')](this));};EmailImap[_0xf82e('0x22')][_0xf82e('0x28')]=function(_0x52fe12,_0x4007e3){if(_0x52fe12){this[_0xf82e('0x23')](_0x52fe12,!![]);}else{if(_0x4007e3[_0xf82e('0x29')]){try{var _0x198961=this['imap'][_0xf82e('0x2a')](_0x4007e3,{'bodies':'','markSeen':!![]});_0x198961['on'](_0xf82e('0x2b'),this[_0xf82e('0x2c')][_0xf82e('0xd')](this));_0x198961[_0xf82e('0xb')]('error',this[_0xf82e('0x2d')][_0xf82e('0xd')](this));_0x198961[_0xf82e('0xb')](_0xf82e('0xe'),this[_0xf82e('0x2e')][_0xf82e('0xd')](this));}catch(_0x4f4fb7){logger['error'](_0x4f4fb7);}}else{this[_0xf82e('0x1')]['closeBox'](!![],this[_0xf82e('0x24')][_0xf82e('0xd')](this));}}};EmailImap[_0xf82e('0x22')]['handleFetchMessage']=function(_0x130db3){_0x130db3['on'](_0xf82e('0x2f'),this['handleMessageBody'][_0xf82e('0xd')](this));_0x130db3['once']('attributes',this['handleMessageAttributes']['bind'](this));_0x130db3['once'](_0xf82e('0xe'),this['handleMessageEnd'][_0xf82e('0xd')](this));};EmailImap[_0xf82e('0x22')]['handleMessageBody']=function(_0x54197d){simpleParser(_0x54197d,{'Iconv':Iconv},this[_0xf82e('0x30')]['bind'](this));};EmailImap[_0xf82e('0x22')][_0xf82e('0x31')]=function(){};EmailImap['prototype'][_0xf82e('0x32')]=function(){};EmailImap[_0xf82e('0x22')]['handleSimpleParser']=function(_0x49827c,_0x4ff3fd){if(_0x49827c){logger[_0xf82e('0xf')](_0x49827c);}else{var _0x536419=this;utils['parser'](this[_0xf82e('0xa')],_0x4ff3fd,function(_0x42176a){_0x536419['emit'](_0xf82e('0x8'),_0x42176a);});}};EmailImap[_0xf82e('0x22')]['handleFetchEnd']=function(){this[_0xf82e('0x1')][_0xf82e('0x33')](!![],this[_0xf82e('0x24')][_0xf82e('0xd')](this));};EmailImap[_0xf82e('0x22')]['handleFetchError']=function(_0x120729){this[_0xf82e('0x23')](_0x120729);this[_0xf82e('0x1')][_0xf82e('0x33')](!![],this[_0xf82e('0x24')]['bind'](this));};EmailImap[_0xf82e('0x22')][_0xf82e('0x34')]=function(){this[_0xf82e('0x35')](_0xf82e('0xe'));};EmailImap[_0xf82e('0x22')][_0xf82e('0x23')]=function(_0x452e93,_0x44b17f){logger[_0xf82e('0xf')](_0xf82e('0x23'),this['account'][_0xf82e('0x8')],JSON['stringify'](_0x452e93));var _0x3cc494='';if(_0x452e93){if(_0x452e93['textCode']){_0x3cc494=_0x452e93[_0xf82e('0x36')];}else{for(var _0x1d1599 in _0x452e93){if(_0x452e93[_0xf82e('0x37')](_0x1d1599)){_0x3cc494+=_[_0xf82e('0x38')](_0x1d1599)+':\x20'+_0x452e93[_0x1d1599]+'\x0a';}}}}if(_0x44b17f){this['imap']['end']();}else{this[_0xf82e('0x35')](_0xf82e('0xf'),_0x3cc494);this['emit']('end');}};module[_0xf82e('0x39')]=EmailImap; \ No newline at end of file +var _0x85d7=['closeBox','handleFetchMessage','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','stringify','textCode','exports','lodash','imap','mailparser','simpleParser','Iconv','events','EventEmitter','./utils','email','mailbox','account','getAccount','once','ready','handleReady','bind','end','handleEnd','error','handleError','connect','inherits','prototype','connTimeout','authTimeout','service','user','modernAuthentication','generateXOAuth2Token','data5','password','anonymous@xcally.com','host','port','tls','autotls','handleOpenBox','emit','box','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','length','message','handleFetchError','handleFetchEnd'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x85d7,0x16d));var _0x785d=function(_0x2079e7,_0xdc5145){_0x2079e7=_0x2079e7-0x0;var _0x5a26c9=_0x85d7[_0x2079e7];return _0x5a26c9;};'use strict';var _=require(_0x785d('0x0'));var util=require('util');var Imap=require(_0x785d('0x1'));var simpleParser=require(_0x785d('0x2'))[_0x785d('0x3')];var Iconv=require('iconv')[_0x785d('0x4')];var EventEmitter=require(_0x785d('0x5'))[_0x785d('0x6')];var utils=require(_0x785d('0x7'));var logger=require('../../../config/logger')(_0x785d('0x8'));function EmailImap(_0xf91dc1,_0x47936f){this[_0x785d('0x9')]=_0xf91dc1[_0x785d('0x9')];this[_0x785d('0xa')]=this[_0x785d('0xb')](_0xf91dc1,_0x47936f);this[_0x785d('0x1')]=new Imap(this[_0x785d('0xa')]);this[_0x785d('0x1')][_0x785d('0xc')](_0x785d('0xd'),this[_0x785d('0xe')][_0x785d('0xf')](this));this['imap'][_0x785d('0xc')](_0x785d('0x10'),this[_0x785d('0x11')][_0x785d('0xf')](this));this[_0x785d('0x1')]['on'](_0x785d('0x12'),this[_0x785d('0x13')]['bind'](this));this[_0x785d('0x1')][_0x785d('0x14')]();}util[_0x785d('0x15')](EmailImap,EventEmitter);EmailImap[_0x785d('0x16')]['getAccount']=function(_0x4ae288,_0x3ab246){var _0x25157d={'connTimeout':_0x4ae288['connTimeout']?_0x4ae288[_0x785d('0x17')]*0x3e8:0x2710,'authTimeout':_0x4ae288[_0x785d('0x18')]?_0x4ae288[_0x785d('0x18')]*0x3e8:0x1388};if(_0x4ae288[_0x785d('0x19')]){_0x25157d[_0x785d('0x1a')]=_0x4ae288[_0x785d('0x1a')];if(_0x4ae288[_0x785d('0x1b')]){_0x25157d['xoauth2']=utils[_0x785d('0x1c')](_0x4ae288['CloudProvider'][_0x785d('0x1d')],_0x4ae288['user']);}else{_0x25157d[_0x785d('0x1e')]=_0x4ae288['password'];}}else{if(_0x4ae288['authentication']){_0x25157d[_0x785d('0x1a')]=_0x4ae288[_0x785d('0x1a')];_0x25157d[_0x785d('0x1e')]=_0x4ae288[_0x785d('0x1e')];}}_0x25157d[_0x785d('0x8')]=_0x3ab246||_0x4ae288['user']||_0x785d('0x1f');_0x25157d[_0x785d('0x20')]=_0x4ae288['host'];_0x25157d[_0x785d('0x21')]=_0x4ae288[_0x785d('0x21')]||0x3e1;if(_0x4ae288[_0x785d('0x22')]){_0x25157d[_0x785d('0x22')]=!![];}else{_0x25157d[_0x785d('0x22')]=![];_0x25157d[_0x785d('0x23')]='required';}return _0x25157d;};EmailImap['prototype'][_0x785d('0xe')]=function(){this['imap']['openBox'](this[_0x785d('0x9')],![],this[_0x785d('0x24')]['bind'](this));};EmailImap[_0x785d('0x16')][_0x785d('0x24')]=function(_0x12c743,_0x3916b8){if(_0x12c743){this[_0x785d('0x13')](_0x12c743,!![]);}else{this[_0x785d('0x25')](_0x785d('0x26'),_0x3916b8);this[_0x785d('0x27')]();}};EmailImap[_0x785d('0x16')][_0x785d('0x28')]=function(_0x46adc7){if(_0x46adc7){this[_0x785d('0x13')](_0x46adc7,!![]);}else{this[_0x785d('0x1')][_0x785d('0x10')]();}};EmailImap[_0x785d('0x16')][_0x785d('0x27')]=function(){this[_0x785d('0x1')][_0x785d('0x29')]([_0x785d('0x2a')],this['handleReadUnseen'][_0x785d('0xf')](this));};EmailImap[_0x785d('0x16')][_0x785d('0x2b')]=function(_0xb92be2,_0x47332c){if(_0xb92be2){this['handleError'](_0xb92be2,!![]);}else{if(_0x47332c[_0x785d('0x2c')]){try{var _0x2632d6=this[_0x785d('0x1')]['fetch'](_0x47332c,{'bodies':'','markSeen':!![]});_0x2632d6['on'](_0x785d('0x2d'),this['handleFetchMessage']['bind'](this));_0x2632d6[_0x785d('0xc')](_0x785d('0x12'),this[_0x785d('0x2e')][_0x785d('0xf')](this));_0x2632d6[_0x785d('0xc')](_0x785d('0x10'),this[_0x785d('0x2f')][_0x785d('0xf')](this));}catch(_0x555a51){logger['error'](_0x555a51);}}else{this[_0x785d('0x1')][_0x785d('0x30')](!![],this['handleCloseBox'][_0x785d('0xf')](this));}}};EmailImap[_0x785d('0x16')][_0x785d('0x31')]=function(_0xcb3b47){_0xcb3b47['on']('body',this[_0x785d('0x32')]['bind'](this));_0xcb3b47[_0x785d('0xc')](_0x785d('0x33'),this[_0x785d('0x34')][_0x785d('0xf')](this));_0xcb3b47['once'](_0x785d('0x10'),this['handleMessageEnd'][_0x785d('0xf')](this));};EmailImap[_0x785d('0x16')][_0x785d('0x32')]=function(_0x424dae){simpleParser(_0x424dae,{'Iconv':Iconv},this['handleSimpleParser']['bind'](this));};EmailImap[_0x785d('0x16')]['handleMessageAttributes']=function(){};EmailImap['prototype'][_0x785d('0x35')]=function(){};EmailImap['prototype'][_0x785d('0x36')]=function(_0xb9e14d,_0x39d65c){if(_0xb9e14d){logger[_0x785d('0x12')](_0xb9e14d);}else{var _0x2d924=this;utils[_0x785d('0x37')](this['account'],_0x39d65c,function(_0x202738){_0x2d924['emit'](_0x785d('0x8'),_0x202738);});}};EmailImap[_0x785d('0x16')][_0x785d('0x2f')]=function(){this['imap']['closeBox'](!![],this[_0x785d('0x28')][_0x785d('0xf')](this));};EmailImap[_0x785d('0x16')][_0x785d('0x2e')]=function(_0x3a7d8d){this['handleError'](_0x3a7d8d);this[_0x785d('0x1')][_0x785d('0x30')](!![],this[_0x785d('0x28')][_0x785d('0xf')](this));};EmailImap['prototype'][_0x785d('0x11')]=function(){this[_0x785d('0x25')](_0x785d('0x10'));};EmailImap[_0x785d('0x16')][_0x785d('0x13')]=function(_0x150045,_0x4fbe57){logger[_0x785d('0x12')](_0x785d('0x13'),this[_0x785d('0xa')][_0x785d('0x8')],JSON[_0x785d('0x38')](_0x150045));var _0x43f9f1='';if(_0x150045){if(_0x150045[_0x785d('0x39')]){_0x43f9f1=_0x150045[_0x785d('0x39')];}else{for(var _0x47e430 in _0x150045){if(_0x150045['hasOwnProperty'](_0x47e430)){_0x43f9f1+=_['upperFirst'](_0x47e430)+':\x20'+_0x150045[_0x47e430]+'\x0a';}}}}if(_0x4fbe57){this[_0x785d('0x1')]['end']();}else{this[_0x785d('0x25')](_0x785d('0x12'),_0x43f9f1);this['emit'](_0x785d('0x10'));}};module[_0x785d('0x3a')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index dc34c48..c3895e9 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 _0x09ef=['exports','nodemailer','send','createTransport','use','sendMail','prototype','verify'];(function(_0xb1d101,_0x2c9a97){var _0x13bb60=function(_0x16911d){while(--_0x16911d){_0xb1d101['push'](_0xb1d101['shift']());}};_0x13bb60(++_0x2c9a97);}(_0x09ef,0x69));var _0xf09e=function(_0x5bec06,_0x31dce2){_0x5bec06=_0x5bec06-0x0;var _0x5c3560=_0x09ef[_0x5bec06];return _0x5c3560;};'use strict';var nodemailer=require(_0xf09e('0x0'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp['prototype'][_0xf09e('0x1')]=function(_0xa26f86,_0x3449c0){return new Promise(function(_0x2e0c73,_0x57af80){var _0x1a8cff=nodemailer[_0xf09e('0x2')](_0xa26f86);_0x1a8cff[_0xf09e('0x3')]('compile',inlineBase64());_0x1a8cff[_0xf09e('0x4')](_0x3449c0,function(_0x1826e5,_0x4ce3d1){if(_0x1826e5){_0x57af80(_0x1826e5['toString']());}else{_0x2e0c73(_0x4ce3d1);}});});};EmailSmtp[_0xf09e('0x5')][_0xf09e('0x6')]=function(_0x34d461){return new Promise(function(_0x97507a,_0x36e76f){var _0x3df54a=nodemailer['createTransport'](_0x34d461);_0x3df54a[_0xf09e('0x6')](function(_0x40641e,_0x38cd73){if(_0x40641e){_0x36e76f(_0x40641e['toString']());}else{if(_0x38cd73){_0x97507a(_0x38cd73);}else{_0x36e76f('Not\x20verifired');}}});});};module[_0xf09e('0x7')]=EmailSmtp; \ No newline at end of file +var _0x784c=['compile','sendMail','toString','prototype','verify','Not\x20verifired','exports','nodemailer','send','createTransport'];(function(_0x4c6557,_0x57c383){var _0x41c1ae=function(_0x56f7f1){while(--_0x56f7f1){_0x4c6557['push'](_0x4c6557['shift']());}};_0x41c1ae(++_0x57c383);}(_0x784c,0x183));var _0xc784=function(_0x570556,_0x1c1177){_0x570556=_0x570556-0x0;var _0x3ede4e=_0x784c[_0x570556];return _0x3ede4e;};'use strict';var nodemailer=require(_0xc784('0x0'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp['prototype'][_0xc784('0x1')]=function(_0x3e698c,_0x552065){return new Promise(function(_0x3ef0dd,_0x49d4e5){var _0x3256e6=nodemailer[_0xc784('0x2')](_0x3e698c);_0x3256e6['use'](_0xc784('0x3'),inlineBase64());_0x3256e6[_0xc784('0x4')](_0x552065,function(_0x5954d1,_0x3b4e18){if(_0x5954d1){_0x49d4e5(_0x5954d1[_0xc784('0x5')]());}else{_0x3ef0dd(_0x3b4e18);}});});};EmailSmtp[_0xc784('0x6')]['verify']=function(_0x1632cb){return new Promise(function(_0x5da92f,_0x227fa0){var _0x4cae87=nodemailer[_0xc784('0x2')](_0x1632cb);_0x4cae87[_0xc784('0x7')](function(_0x51fbcc,_0x5ac22a){if(_0x51fbcc){_0x227fa0(_0x51fbcc['toString']());}else{if(_0x5ac22a){_0x5da92f(_0x5ac22a);}else{_0x227fa0(_0xc784('0x8'));}}});});};module[_0xc784('0x9')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 04bd498..19937fd 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 _0x1bb5=['utf-8','toString','lodash','moment','path','util','email','head','value','address','generate','@xcally.com','name','substring','split','slice','join','length','pop','isEmpty','test','html','replace','includes','\x20[Attachment:\x20','\x20]','body','textAsHtml','Empty\x20message

','auth=Bearer\x20'];(function(_0x83a9c5,_0x5c73e2){var _0x5b758c=function(_0x458e5c){while(--_0x458e5c){_0x83a9c5['push'](_0x83a9c5['shift']());}};_0x5b758c(++_0x5c73e2);}(_0x1bb5,0xcb));var _0x51bb=function(_0x5bacf1,_0x5bae9a){_0x5bacf1=_0x5bacf1-0x0;var _0x4b65d3=_0x1bb5[_0x5bacf1];return _0x4b65d3;};'use strict';var _=require(_0x51bb('0x0'));var moment=require(_0x51bb('0x1'));var random=require('randomstring');var fs=require('fs');var path=require(_0x51bb('0x2'));var util=require(_0x51bb('0x3'));var tnef=require('node-tnef');var logger=require('../../../config/logger')(_0x51bb('0x4'));var config=require('../../../config/environment');function getAddress(_0x48c49d){var _0x2bf695=_[_0x51bb('0x5')](_0x48c49d[_0x51bb('0x6')]);return _0x2bf695&&_0x2bf695[_0x51bb('0x7')]?_0x2bf695[_0x51bb('0x7')]:'anonymous'+random[_0x51bb('0x8')](0x6)+_0x51bb('0x9');}function getFirstName(_0x4ea2ac){var _0xbeea9c=_[_0x51bb('0x5')](_0x4ea2ac['value']);if(_0xbeea9c&&_0xbeea9c[_0x51bb('0xa')]){if(_0xbeea9c[_0x51bb('0xa')]==_0xbeea9c['address']){return _0xbeea9c[_0x51bb('0xa')][_0x51bb('0xb')](0x0,_0xbeea9c[_0x51bb('0xa')]['indexOf']('@'));}var _0x59e102=_0xbeea9c[_0x51bb('0xa')][_0x51bb('0xc')](/\s+/);return _0x59e102['length']>0x1?_0x59e102[_0x51bb('0xd')](0x0,-0x1)[_0x51bb('0xe')]('\x20'):_0xbeea9c['name'];}return'Anonymous';}function getLastName(_0x10601f){var _0x58f370=_['head'](_0x10601f[_0x51bb('0x6')]);if(_0x58f370&&_0x58f370[_0x51bb('0xa')]){var _0x4cd99d=_0x58f370[_0x51bb('0xa')][_0x51bb('0xc')](/\s+/);return _0x4cd99d[_0x51bb('0xf')]>0x1?_0x4cd99d[_0x51bb('0x10')]():'';}return'';}function getMails(_0x4737b6,_0x7f79f8){var _0x2aed54='';for(var _0x5093f5=0x0;_0x5093f5<_0x7f79f8[_0x51bb('0x6')]['length'];_0x5093f5+=0x1){if(_0x7f79f8[_0x51bb('0x6')][_0x5093f5][_0x51bb('0x7')]!==_0x4737b6){if(!_[_0x51bb('0x11')](_0x2aed54)){_0x2aed54+=',';}_0x2aed54+=_0x7f79f8[_0x51bb('0x6')][_0x5093f5]['name']||_0x7f79f8[_0x51bb('0x6')][_0x5093f5][_0x51bb('0x7')]||'';_0x2aed54+='\x20<';_0x2aed54+=_0x7f79f8[_0x51bb('0x6')][_0x5093f5][_0x51bb('0x7')]?_0x7f79f8[_0x51bb('0x6')][_0x5093f5][_0x51bb('0x7')]:'anonymous'+random[_0x51bb('0x8')](0x6)+'@xcally.com';_0x2aed54+='>';}}return _0x2aed54;}function parseEmail(_0x3c0458,_0x23b93d,_0x24c6b8){if(_0x23b93d['html']){var _0x5ea79d=/)<[^<]*)*<\/script>/gi;while(_0x5ea79d[_0x51bb('0x12')](_0x23b93d[_0x51bb('0x13')])){_0x23b93d['html']=_0x23b93d[_0x51bb('0x13')][_0x51bb('0x14')](_0x5ea79d,'');}if(_0x23b93d[_0x51bb('0x13')][_0x51bb('0x15')](_0x51bb('0x16'))){var _0xe4ae74=[];_0x23b93d[_0x51bb('0x17')][_0x51bb('0x18')](_0x182e14=>{_0xe4ae74[_0x51bb('0x19')](_0x182e14[_0x51bb('0x1a')]);});var _0x3f81e1=/]+>/g;var _0x451fe3=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x582a51=_0x23b93d[_0x51bb('0x13')][_0x51bb('0x14')](_0x451fe3,'_SRC');var _0x48e78a=_0x582a51[_0x51bb('0x14')](_0x3f81e1,_0x51bb('0x1b'));for(let _0x1cf7a5=0x0;_0x1cf7a5<_0xe4ae74[_0x51bb('0xf')];_0x1cf7a5++){var _0x5de1ba=_0x48e78a[_0x51bb('0x14')](_0x51bb('0x1b'),_0x51bb('0x1c')+_0xe4ae74[_0x1cf7a5]+_0x51bb('0x1d'));_0x48e78a=_0x5de1ba;}_0x23b93d[_0x51bb('0x13')]=_0x48e78a;}_0x24c6b8[_0x51bb('0x1e')]=_0x23b93d[_0x51bb('0x13')];}else{_0x24c6b8['body']=_0x23b93d[_0x51bb('0x1f')];}if(_0x24c6b8[_0x51bb('0x1e')]){_0x24c6b8[_0x51bb('0x1e')]=_0x24c6b8['body'][_0x51bb('0x14')](/0x0){var _0xf600e7=[_0x51bb('0x2d'),'X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply'];for(var _0x5a5cb6=0x0;_0x5a5cb6<_0x23b93d[_0x51bb('0x2c')][_0x51bb('0xf')];_0x5a5cb6++){var _0x38d6f2=_[_0x51bb('0x2e')](_0xf600e7,_0x23b93d['headerLines'][_0x5a5cb6]['line']);if(_0x38d6f2>=0x0){_0x24c6b8[_0x51bb('0x2f')]=!![];}}}return _0x24c6b8;}exports['parser']=function(_0x5e07d4,_0x1786d7,_0x2f84ed){var _0x444d8b={'from':getAddress(_0x1786d7['from']),'firstName':getFirstName(_0x1786d7['from']),'lastName':getLastName(_0x1786d7[_0x51bb('0x30')]),'mapKey':'email','message':{'from':getMails(_0x5e07d4['email'],_0x1786d7[_0x51bb('0x30')]),'to':_0x5e07d4[_0x51bb('0x4')],'cc':'','subject':_0x1786d7[_0x51bb('0x31')]||'','messageId':_0x1786d7['messageId'],'inReplyTo':_0x1786d7[_0x51bb('0x32')],'sentAt':moment(_0x1786d7[_0x51bb('0x33')])['format'](_0x51bb('0x34')),'attach':![],'attachments':[]}};if(!_0x1786d7[_0x51bb('0x13')]&&!_0x1786d7[_0x51bb('0x1f')]){var _0x305099=_[_0x51bb('0x35')](_0x1786d7[_0x51bb('0x17')],{'contentType':_0x51bb('0x36')});if(_0x305099[_0x51bb('0xf')]){logger[_0x51bb('0x37')](util[_0x51bb('0x38')](_0x51bb('0x39'),_0x1786d7[_0x51bb('0x3a')]));tnef['parseBuffer'](_[_0x51bb('0x3b')](_0x305099)[_0x51bb('0x2b')],function(_0x5c1a22,_0x237c5e){if(_0x237c5e){_0x1786d7[_0x51bb('0x13')]=_0x237c5e[_0x51bb('0x3c')]||'

Empty\x20message

';if(_0x237c5e[_0x51bb('0x3d')]){for(var _0x5db5d4=0x0;_0x5db5d4<_0x237c5e[_0x51bb('0x3d')][_0x51bb('0xf')];_0x5db5d4++){var _0x1fb50b=_0x237c5e[_0x51bb('0x3d')][_0x5db5d4];_0x444d8b[_0x51bb('0x21')]['attachments']['push']({'filename':_0x1fb50b['Title'],'content':Buffer[_0x51bb('0x30')](_0x1fb50b[_0x51bb('0x3e')])});}}}_0x2f84ed(parseEmail(_0x5e07d4,_0x1786d7,_0x444d8b));});}else{_0x1786d7[_0x51bb('0x13')]=_0x51bb('0x3f');_0x2f84ed(parseEmail(_0x5e07d4,_0x1786d7,_0x444d8b));}}else{_0x2f84ed(parseEmail(_0x5e07d4,_0x1786d7,_0x444d8b));}};exports['generateXOAuth2Token']=function(_0x3f19b6,_0x53333f){var _0x186f96=['user='+(_0x53333f||''),_0x51bb('0x40')+_0x3f19b6,'',''];return Buffer[_0x51bb('0x30')](_0x186f96['join'](''),_0x51bb('0x41'))[_0x51bb('0x42')]('base64');}; \ No newline at end of file +var _0x6f49=['replace','includes','Empty\x20message

','generateXOAuth2Token','user=','utf-8','toString','base64','lodash','moment','randomstring','util','node-tnef','../../../config/logger','head','address','anonymous','generate','value','name','indexOf','split','length','slice','join','isEmpty','@xcally.com','html','test'];(function(_0x2718c7,_0x5a1636){var _0x59d89c=function(_0x4d4f49){while(--_0x4d4f49){_0x2718c7['push'](_0x2718c7['shift']());}};_0x59d89c(++_0x5a1636);}(_0x6f49,0x18f));var _0x96f4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6f49[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x96f4('0x0'));var moment=require(_0x96f4('0x1'));var random=require(_0x96f4('0x2'));var fs=require('fs');var path=require('path');var util=require(_0x96f4('0x3'));var tnef=require(_0x96f4('0x4'));var logger=require(_0x96f4('0x5'))('email');var config=require('../../../config/environment');function getAddress(_0xe512df){var _0x45d8d1=_[_0x96f4('0x6')](_0xe512df['value']);return _0x45d8d1&&_0x45d8d1['address']?_0x45d8d1[_0x96f4('0x7')]:_0x96f4('0x8')+random[_0x96f4('0x9')](0x6)+'@xcally.com';}function getFirstName(_0x42aced){var _0x3ea670=_[_0x96f4('0x6')](_0x42aced[_0x96f4('0xa')]);if(_0x3ea670&&_0x3ea670['name']){if(_0x3ea670[_0x96f4('0xb')]==_0x3ea670['address']){return _0x3ea670[_0x96f4('0xb')]['substring'](0x0,_0x3ea670[_0x96f4('0xb')][_0x96f4('0xc')]('@'));}var _0x33221f=_0x3ea670[_0x96f4('0xb')][_0x96f4('0xd')](/\s+/);return _0x33221f[_0x96f4('0xe')]>0x1?_0x33221f[_0x96f4('0xf')](0x0,-0x1)[_0x96f4('0x10')]('\x20'):_0x3ea670[_0x96f4('0xb')];}return'Anonymous';}function getLastName(_0x253807){var _0x1c6d28=_[_0x96f4('0x6')](_0x253807[_0x96f4('0xa')]);if(_0x1c6d28&&_0x1c6d28[_0x96f4('0xb')]){var _0x3e7316=_0x1c6d28[_0x96f4('0xb')][_0x96f4('0xd')](/\s+/);return _0x3e7316['length']>0x1?_0x3e7316['pop']():'';}return'';}function getMails(_0x451d3d,_0x4ab719){var _0x3b30c2='';for(var _0x531197=0x0;_0x531197<_0x4ab719[_0x96f4('0xa')][_0x96f4('0xe')];_0x531197+=0x1){if(_0x4ab719[_0x96f4('0xa')][_0x531197][_0x96f4('0x7')]!==_0x451d3d){if(!_[_0x96f4('0x11')](_0x3b30c2)){_0x3b30c2+=',';}_0x3b30c2+=_0x4ab719[_0x96f4('0xa')][_0x531197][_0x96f4('0xb')]||_0x4ab719[_0x96f4('0xa')][_0x531197][_0x96f4('0x7')]||'';_0x3b30c2+='\x20<';_0x3b30c2+=_0x4ab719[_0x96f4('0xa')][_0x531197][_0x96f4('0x7')]?_0x4ab719[_0x96f4('0xa')][_0x531197][_0x96f4('0x7')]:_0x96f4('0x8')+random[_0x96f4('0x9')](0x6)+_0x96f4('0x12');_0x3b30c2+='>';}}return _0x3b30c2;}function parseEmail(_0x1baf3b,_0x1b8f4d,_0x3a57a4){if(_0x1b8f4d[_0x96f4('0x13')]){var _0x3c332b=/)<[^<]*)*<\/script>/gi;while(_0x3c332b[_0x96f4('0x14')](_0x1b8f4d[_0x96f4('0x13')])){_0x1b8f4d['html']=_0x1b8f4d[_0x96f4('0x13')][_0x96f4('0x15')](_0x3c332b,'');}if(_0x1b8f4d[_0x96f4('0x13')][_0x96f4('0x16')](_0x96f4('0x17'))){var _0x50a86d=[];_0x1b8f4d['attachments']['forEach'](_0x4e1b79=>{_0x50a86d[_0x96f4('0x18')](_0x4e1b79[_0x96f4('0x19')]);});var _0xcc698b=/]+>/g;var _0xfaa01d=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x3c8757=_0x1b8f4d[_0x96f4('0x13')]['replace'](_0xfaa01d,_0x96f4('0x1a'));var _0x139d26=_0x3c8757[_0x96f4('0x15')](_0xcc698b,_0x96f4('0x1b'));for(let _0x5ce7e8=0x0;_0x5ce7e8<_0x50a86d[_0x96f4('0xe')];_0x5ce7e8++){var _0x111dae=_0x139d26[_0x96f4('0x15')](_0x96f4('0x1b'),'\x20[Attachment:\x20'+_0x50a86d[_0x5ce7e8]+'\x20]');_0x139d26=_0x111dae;}_0x1b8f4d[_0x96f4('0x13')]=_0x139d26;}_0x3a57a4['body']=_0x1b8f4d['html'];}else{_0x3a57a4[_0x96f4('0x1c')]=_0x1b8f4d[_0x96f4('0x1d')];}if(_0x3a57a4[_0x96f4('0x1c')]){_0x3a57a4[_0x96f4('0x1c')]=_0x3a57a4[_0x96f4('0x1c')][_0x96f4('0x15')](/0x0){var _0x54ac2c=[_0x96f4('0x2e'),'X-Auto-Response-Suppress:\x20All',_0x96f4('0x2f')];for(var _0x5c1085=0x0;_0x5c1085<_0x1b8f4d[_0x96f4('0x2d')][_0x96f4('0xe')];_0x5c1085++){var _0x2a5452=_['indexOf'](_0x54ac2c,_0x1b8f4d['headerLines'][_0x5c1085]['line']);if(_0x2a5452>=0x0){_0x3a57a4[_0x96f4('0x30')]=!![];}}}return _0x3a57a4;}exports[_0x96f4('0x31')]=function(_0x50b049,_0x2da86f,_0x40c1b4){var _0x5078d4={'from':getAddress(_0x2da86f[_0x96f4('0x32')]),'firstName':getFirstName(_0x2da86f[_0x96f4('0x32')]),'lastName':getLastName(_0x2da86f['from']),'mapKey':_0x96f4('0x21'),'message':{'from':getMails(_0x50b049[_0x96f4('0x21')],_0x2da86f['from']),'to':_0x50b049[_0x96f4('0x21')],'cc':'','subject':_0x2da86f['subject']||'','messageId':_0x2da86f[_0x96f4('0x33')],'inReplyTo':_0x2da86f[_0x96f4('0x34')],'sentAt':moment(_0x2da86f[_0x96f4('0x35')])[_0x96f4('0x27')](_0x96f4('0x36')),'attach':![],'attachments':[]}};if(!_0x2da86f[_0x96f4('0x13')]&&!_0x2da86f[_0x96f4('0x1d')]){var _0x43667a=_[_0x96f4('0x37')](_0x2da86f['attachments'],{'contentType':_0x96f4('0x38')});if(_0x43667a[_0x96f4('0xe')]){logger[_0x96f4('0x39')](util['format'](_0x96f4('0x3a'),_0x2da86f[_0x96f4('0x33')]));tnef[_0x96f4('0x3b')](_['first'](_0x43667a)[_0x96f4('0x2b')],function(_0x45e89f,_0x1f370e){if(_0x1f370e){_0x2da86f[_0x96f4('0x13')]=_0x1f370e[_0x96f4('0x3c')]||'

Empty\x20message

';if(_0x1f370e['Attachments']){for(var _0x3b7754=0x0;_0x3b7754<_0x1f370e['Attachments'][_0x96f4('0xe')];_0x3b7754++){var _0xded5ea=_0x1f370e[_0x96f4('0x3d')][_0x3b7754];_0x5078d4[_0x96f4('0x1f')][_0x96f4('0x24')][_0x96f4('0x18')]({'filename':_0xded5ea[_0x96f4('0x3e')],'content':Buffer['from'](_0xded5ea[_0x96f4('0x3f')])});}}}_0x40c1b4(parseEmail(_0x50b049,_0x2da86f,_0x5078d4));});}else{_0x2da86f[_0x96f4('0x13')]=_0x96f4('0x40');_0x40c1b4(parseEmail(_0x50b049,_0x2da86f,_0x5078d4));}}else{_0x40c1b4(parseEmail(_0x50b049,_0x2da86f,_0x5078d4));}};exports[_0x96f4('0x41')]=function(_0x34ddaf,_0x5d39bd){var _0x93fdca=[_0x96f4('0x42')+(_0x5d39bd||''),'auth=Bearer\x20'+_0x34ddaf,'',''];return Buffer['from'](_0x93fdca[_0x96f4('0x10')](''),_0x96f4('0x43'))[_0x96f4('0x44')](_0x96f4('0x45'));}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index ef9a536..5743fbb 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 _0x4f75=['Service','SERV','active','Imap','Smtp','lodash','name'];(function(_0x211f31,_0x4d996d){var _0x30eee3=function(_0xb3553d){while(--_0xb3553d){_0x211f31['push'](_0x211f31['shift']());}};_0x30eee3(++_0x4d996d);}(_0x4f75,0x139));var _0x54f7=function(_0x45e711,_0x395423){_0x45e711=_0x45e711-0x0;var _0xe0e866=_0x4f75[_0x45e711];return _0xe0e866;};'use strict';var _=require(_0x54f7('0x0'));function MailAccount(_0x48a663){this['id']=_0x48a663['id']||0x0;this[_0x54f7('0x1')]=_0x48a663['name']||_0x54f7('0x2');this['key']=_0x48a663['key']||_0x54f7('0x3');this[_0x54f7('0x4')]=_0x48a663[_0x54f7('0x4')]||![];this[_0x54f7('0x5')]=_0x48a663[_0x54f7('0x5')]||[];this[_0x54f7('0x6')]=_0x48a663[_0x54f7('0x6')]||[];}module['exports']=MailAccount; \ No newline at end of file +var _0xac09=['lodash','name','Service','key','active','Imap','Smtp'];(function(_0x146a69,_0x352c92){var _0x23e982=function(_0x454f64){while(--_0x454f64){_0x146a69['push'](_0x146a69['shift']());}};_0x23e982(++_0x352c92);}(_0xac09,0x150));var _0x9ac0=function(_0x2e7a1c,_0x1dc531){_0x2e7a1c=_0x2e7a1c-0x0;var _0x33a247=_0xac09[_0x2e7a1c];return _0x33a247;};'use strict';var _=require(_0x9ac0('0x0'));function MailAccount(_0x32a8a8){this['id']=_0x32a8a8['id']||0x0;this[_0x9ac0('0x1')]=_0x32a8a8[_0x9ac0('0x1')]||_0x9ac0('0x2');this['key']=_0x32a8a8[_0x9ac0('0x3')]||'SERV';this[_0x9ac0('0x4')]=_0x32a8a8[_0x9ac0('0x4')]||![];this['Imap']=_0x32a8a8[_0x9ac0('0x5')]||[];this[_0x9ac0('0x6')]=_0x32a8a8[_0x9ac0('0x6')]||[];}module['exports']=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index 30a61b5..c996760 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 _0xb2ba=['merge','exports','mapKeys','hasOwnProperty','mergeFromDatabase','initMailAccounts','mailAccounts','length'];(function(_0x19ed31,_0x76dfd6){var _0x18d472=function(_0x4fb20c){while(--_0x4fb20c){_0x19ed31['push'](_0x19ed31['shift']());}};_0x18d472(++_0x76dfd6);}(_0xb2ba,0x162));var _0xab2b=function(_0x3dbddc,_0x53011c){_0x3dbddc=_0x3dbddc-0x0;var _0x351210=_0xb2ba[_0x3dbddc];return _0x351210;};'use strict';var _=require('lodash');var MailAccount=require('../model/mailAccount');var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x1291cb,_0x3cff7b,_0x300c16){var _0x33bad6=_[_0xab2b('0x0')](_0x1291cb,function(_0x3adae9,_0x5d4e11){return _0x3adae9[_0x300c16];});for(var _0x52a7bf in _0x3cff7b){if(_0x3cff7b[_0xab2b('0x1')](_0x52a7bf)){if(!_0x33bad6[_0x52a7bf]){delete _0x3cff7b[_0x52a7bf];}}}}Realtime['prototype'][_0xab2b('0x2')]=function(_0x210791,_0x5f5b26){for(var _0x253d34 in _0x5f5b26){if(_0x210791[_0xab2b('0x1')](_0x253d34)){_0x210791[_0x253d34]=_0x5f5b26[_0x253d34];}}};Realtime['prototype'][_0xab2b('0x3')]=function(){var _0x237096=this;return function(_0x340b8d){if(_0x340b8d){freeIsNotKey(_0x340b8d,_0x237096[_0xab2b('0x4')],'id');for(var _0x52bd3e=0x0,_0x5a2ee9={},_0x42bd24={};_0x52bd3e<_0x340b8d[_0xab2b('0x5')];_0x52bd3e+=0x1){_0x5a2ee9=_0x340b8d[_0x52bd3e];if(_['isUndefined'](_0x237096[_0xab2b('0x4')][_0x5a2ee9['id']])){_0x237096[_0xab2b('0x4')][_0x5a2ee9['id']]=new MailAccount(_0x5a2ee9);}else{_[_0xab2b('0x6')](_0x237096[_0xab2b('0x4')][_0x5a2ee9['id']],_0x5a2ee9);}}}return _0x237096[_0xab2b('0x4')];};};module[_0xab2b('0x7')]=Realtime; \ No newline at end of file +var _0x9795=['mergeFromDatabase','length','merge','exports','lodash','mailAccounts','mapKeys','hasOwnProperty'];(function(_0x15ceb7,_0x961934){var _0x1d9eaa=function(_0x532231){while(--_0x532231){_0x15ceb7['push'](_0x15ceb7['shift']());}};_0x1d9eaa(++_0x961934);}(_0x9795,0xb4));var _0x5979=function(_0x71c5e9,_0x531780){_0x71c5e9=_0x71c5e9-0x0;var _0x5623ed=_0x9795[_0x71c5e9];return _0x5623ed;};'use strict';var _=require(_0x5979('0x0'));var MailAccount=require('../model/mailAccount');var Realtime=function(){this[_0x5979('0x1')]={};};function freeIsNotKey(_0x39e552,_0x259fa9,_0x690e5c){var _0x50c8ec=_[_0x5979('0x2')](_0x39e552,function(_0x36f6e6,_0x122bd4){return _0x36f6e6[_0x690e5c];});for(var _0x4d4235 in _0x259fa9){if(_0x259fa9[_0x5979('0x3')](_0x4d4235)){if(!_0x50c8ec[_0x4d4235]){delete _0x259fa9[_0x4d4235];}}}}Realtime['prototype'][_0x5979('0x4')]=function(_0x18daf1,_0x3a65f6){for(var _0x495483 in _0x3a65f6){if(_0x18daf1['hasOwnProperty'](_0x495483)){_0x18daf1[_0x495483]=_0x3a65f6[_0x495483];}}};Realtime['prototype']['initMailAccounts']=function(){var _0x3574a8=this;return function(_0x294268){if(_0x294268){freeIsNotKey(_0x294268,_0x3574a8[_0x5979('0x1')],'id');for(var _0x4d90f0=0x0,_0x4afa5d={},_0x440003={};_0x4d90f0<_0x294268[_0x5979('0x5')];_0x4d90f0+=0x1){_0x4afa5d=_0x294268[_0x4d90f0];if(_['isUndefined'](_0x3574a8[_0x5979('0x1')][_0x4afa5d['id']])){_0x3574a8[_0x5979('0x1')][_0x4afa5d['id']]=new MailAccount(_0x4afa5d);}else{_[_0x5979('0x6')](_0x3574a8[_0x5979('0x1')][_0x4afa5d['id']],_0x4afa5d);}}}return _0x3574a8[_0x5979('0x1')];};};module[_0x5979('0x7')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index 580bf25..b661934 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 _0xf47e=['type','data5','MailServerOut','Smtp','getMailAccount','notify','Request','../client','getMailAccounts','GetMailAccount','name','provider','email','active','key','ListId','MailServerIn','Imap','CloudProvider','service'];(function(_0x2b5ee5,_0x3741bf){var _0x1c480b=function(_0x437a18){while(--_0x437a18){_0x2b5ee5['push'](_0x2b5ee5['shift']());}};_0x1c480b(++_0x3741bf);}(_0xf47e,0x1bf));var _0xef47=function(_0x4854c8,_0x31c55a){_0x4854c8=_0x4854c8-0x0;var _0x1e6912=_0xf47e[_0x4854c8];return _0x1e6912;};'use strict';var client=require(_0xef47('0x0'));exports[_0xef47('0x1')]=function(){return function(){return client['Request'](_0xef47('0x2'),{'options':{'attributes':['id',_0xef47('0x3'),_0xef47('0x4'),'service',_0xef47('0x5'),_0xef47('0x6'),_0xef47('0x7'),_0xef47('0x8'),'TemplateId'],'raw':![],'include':[{'model':_0xef47('0x9'),'as':_0xef47('0xa'),'include':[{'model':_0xef47('0xb'),'attributes':['id',_0xef47('0x3'),_0xef47('0xc'),_0xef47('0xd'),_0xef47('0xe')],'as':_0xef47('0xb')}]},{'model':_0xef47('0xf'),'as':_0xef47('0x10'),'include':[{'model':_0xef47('0xb'),'attributes':['id',_0xef47('0x3'),_0xef47('0xc'),_0xef47('0xd'),_0xef47('0xe')],'as':_0xef47('0xb')}]}]},'log':_0xef47('0x11')});};};exports[_0xef47('0x12')]=function(_0xc43ccb,_0x246130){return client[_0xef47('0x13')]('NotifyMailAccount',{'account':{'id':_0xc43ccb},'body':_0x246130,'log':'NotifyMailAccount'});}; \ No newline at end of file +var _0xfb67=['active','key','ListId','TemplateId','MailServerIn','CloudProvider','data5','Smtp','type','getMailAccount','notify','NotifyMailAccount','../client','getMailAccounts','Request','GetMailAccount','name','provider','service'];(function(_0x113c36,_0x79db30){var _0x15edb3=function(_0x2ef90c){while(--_0x2ef90c){_0x113c36['push'](_0x113c36['shift']());}};_0x15edb3(++_0x79db30);}(_0xfb67,0xdd));var _0x7fb6=function(_0x421d45,_0x2623fa){_0x421d45=_0x421d45-0x0;var _0x288a28=_0xfb67[_0x421d45];return _0x288a28;};'use strict';var client=require(_0x7fb6('0x0'));exports[_0x7fb6('0x1')]=function(){return function(){return client[_0x7fb6('0x2')](_0x7fb6('0x3'),{'options':{'attributes':['id',_0x7fb6('0x4'),_0x7fb6('0x5'),_0x7fb6('0x6'),'email',_0x7fb6('0x7'),_0x7fb6('0x8'),_0x7fb6('0x9'),_0x7fb6('0xa')],'raw':![],'include':[{'model':_0x7fb6('0xb'),'as':'Imap','include':[{'model':_0x7fb6('0xc'),'attributes':['id',_0x7fb6('0x4'),_0x7fb6('0x6'),'type',_0x7fb6('0xd')],'as':_0x7fb6('0xc')}]},{'model':'MailServerOut','as':_0x7fb6('0xe'),'include':[{'model':_0x7fb6('0xc'),'attributes':['id',_0x7fb6('0x4'),'service',_0x7fb6('0xf'),'data5'],'as':_0x7fb6('0xc')}]}]},'log':_0x7fb6('0x10')});};};exports[_0x7fb6('0x11')]=function(_0x3f1569,_0x584517){return client[_0x7fb6('0x2')](_0x7fb6('0x12'),{'account':{'id':_0x3f1569},'body':_0x584517,'log':_0x7fb6('0x12')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index c323649..6e1b5a8 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 _0x1e03=['getSettings','ShowSetting','loginMailFrequency','../client'];(function(_0x447b59,_0x4cccf8){var _0x12c924=function(_0x4df3ec){while(--_0x4df3ec){_0x447b59['push'](_0x447b59['shift']());}};_0x12c924(++_0x4cccf8);}(_0x1e03,0x187));var _0x31e0=function(_0x5145ea,_0x4dac5c){_0x5145ea=_0x5145ea-0x0;var _0x4812e0=_0x1e03[_0x5145ea];return _0x4812e0;};'use strict';var client=require(_0x31e0('0x0'));exports[_0x31e0('0x1')]=function(){return client['Request'](_0x31e0('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x31e0('0x3')]},'log':'GetSettings'});}; \ No newline at end of file +var _0xf42e=['loginMailFrequency','GetSettings','../client','getSettings','Request'];(function(_0x865f,_0x294226){var _0x1ae2e4=function(_0x4f2642){while(--_0x4f2642){_0x865f['push'](_0x865f['shift']());}};_0x1ae2e4(++_0x294226);}(_0xf42e,0x1f1));var _0xef42=function(_0x1e3638,_0x4f251d){_0x1e3638=_0x1e3638-0x0;var _0x258dd2=_0xf42e[_0x1e3638];return _0x258dd2;};'use strict';var client=require(_0xef42('0x0'));exports[_0xef42('0x1')]=function(){return client[_0xef42('0x2')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xef42('0x3')]},'log':_0xef42('0x4')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index d282507..87be7fe 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(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xa9e0[_0x2f3848];return _0x102668;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});}; \ No newline at end of file +var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'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 7116c4c..5130f5e 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 _0xdbe1=['defaults','localhost','adapter','redis','../../config/triggers','default','../../config/socketio','../../config/express','../../routes','once','listening','log','lodash','http','express','sticky-session','ioredis','createServer','timeout','listen','port','websocket'];(function(_0xf3b099,_0x3a71f5){var _0x153f16=function(_0x3fc365){while(--_0x3fc365){_0xf3b099['push'](_0xf3b099['shift']());}};_0x153f16(++_0x3a71f5);}(_0xdbe1,0xe8));var _0x1dbe=function(_0x1604d4,_0x457f77){_0x1604d4=_0x1604d4-0x0;var _0x10bd24=_0xdbe1[_0x1604d4];return _0x10bd24;};'use strict';var _=require(_0x1dbe('0x0'));var http=require(_0x1dbe('0x1'));var express=require(_0x1dbe('0x2'));var sticky=require(_0x1dbe('0x3'));var Redis=require(_0x1dbe('0x4'));var config=require('../../config/environment');var app=express();var server=http[_0x1dbe('0x5')](app);server[_0x1dbe('0x6')]=0xdbba0;if(sticky[_0x1dbe('0x7')](server,config[_0x1dbe('0x8')])){var socketio=require('socket.io')(server,{'transports':[_0x1dbe('0x9'),'polling']});config['redis']=_[_0x1dbe('0xa')](config['redis'],{'host':_0x1dbe('0xb'),'port':0x18eb});socketio[_0x1dbe('0xc')](require('socket.io-redis')({'pubClient':new Redis(config['redis']),'subClient':new Redis(config[_0x1dbe('0xd')])}));require(_0x1dbe('0xe'))[_0x1dbe('0xf')]();require(_0x1dbe('0x10'))['default'](socketio);require(_0x1dbe('0x11'))['default'](app);require(_0x1dbe('0x12'))['default'](app);}else{server[_0x1dbe('0x13')](_0x1dbe('0x14'),function(){console[_0x1dbe('0x15')]('Express\x20server\x20listening\x20on\x20port\x20%d!',config[_0x1dbe('0x8')]);});}exports=module['exports']=app; \ No newline at end of file +var _0xa145=['polling','redis','defaults','adapter','../../config/triggers','default','../../config/socketio','../../config/express','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http','sticky-session','ioredis','../../config/environment','createServer','timeout','listen','port','socket.io','websocket'];(function(_0x126fee,_0x54bf95){var _0x18eade=function(_0x4f3c47){while(--_0x4f3c47){_0x126fee['push'](_0x126fee['shift']());}};_0x18eade(++_0x54bf95);}(_0xa145,0x121));var _0x5a14=function(_0x40a825,_0x3bac79){_0x40a825=_0x40a825-0x0;var _0x273a54=_0xa145[_0x40a825];return _0x273a54;};'use strict';var _=require(_0x5a14('0x0'));var http=require(_0x5a14('0x1'));var express=require('express');var sticky=require(_0x5a14('0x2'));var Redis=require(_0x5a14('0x3'));var config=require(_0x5a14('0x4'));var app=express();var server=http[_0x5a14('0x5')](app);server[_0x5a14('0x6')]=0xdbba0;if(sticky[_0x5a14('0x7')](server,config[_0x5a14('0x8')])){var socketio=require(_0x5a14('0x9'))(server,{'transports':[_0x5a14('0xa'),_0x5a14('0xb')]});config[_0x5a14('0xc')]=_[_0x5a14('0xd')](config['redis'],{'host':'localhost','port':0x18eb});socketio[_0x5a14('0xe')](require('socket.io-redis')({'pubClient':new Redis(config['redis']),'subClient':new Redis(config['redis'])}));require(_0x5a14('0xf'))[_0x5a14('0x10')]();require(_0x5a14('0x11'))[_0x5a14('0x10')](socketio);require(_0x5a14('0x12'))[_0x5a14('0x10')](app);require(_0x5a14('0x13'))[_0x5a14('0x10')](app);}else{server[_0x5a14('0x14')](_0x5a14('0x15'),function(){console[_0x5a14('0x16')](_0x5a14('0x17'),config[_0x5a14('0x8')]);});}exports=module[_0x5a14('0x18')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index 9540dde..c62e667 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 _0x8176=['message','result','catch','bluebird','routing','client','http','Request','debug','rpc','error'];(function(_0x84ed63,_0x2c32a8){var _0xd81c5e=function(_0x4d13cb){while(--_0x4d13cb){_0x84ed63['push'](_0x84ed63['shift']());}};_0xd81c5e(++_0x2c32a8);}(_0x8176,0x1bb));var _0x6817=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x8176[_0xbca1b1];return _0x4e1686;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x6817('0x0'));var logger=require('../../config/logger')(_0x6817('0x1'));var client=jayson[_0x6817('0x2')][_0x6817('0x3')]({'port':0x2329});client[_0x6817('0x4')]=function(_0x3e6a13,_0x9e9dde){return new BPromise(function(_0x3306ef,_0xda9060){return client['request'](_0x3e6a13,_0x9e9dde)['then'](function(_0x7c8971){logger[_0x6817('0x5')](_0x6817('0x6'),_0x6817('0x1'),_0x3e6a13,_0x9e9dde,_0x7c8971);if(_0x7c8971[_0x6817('0x7')]){logger[_0x6817('0x7')]('rpc','routing',_0x3e6a13,_0x7c8971[_0x6817('0x7')][_0x6817('0x8')],_0x9e9dde);return _0xda9060(_0x7c8971[_0x6817('0x7')]['message']);}else{return _0x3306ef(_0x7c8971[_0x6817('0x9')]);}})[_0x6817('0xa')](function(_0x3c4121){logger['error'](_0x6817('0x6'),_0x6817('0x1'),_0x3e6a13,_0x3c4121,_0x9e9dde);return _0xda9060(_0x3c4121);});});};module['exports']=client; \ No newline at end of file +var _0x30bc=['catch','exports','jayson/promise','bluebird','../../config/logger','routing','Request','request','then','rpc','error','message','result'];(function(_0x32d30e,_0x2b0c4a){var _0x284135=function(_0x565e99){while(--_0x565e99){_0x32d30e['push'](_0x32d30e['shift']());}};_0x284135(++_0x2b0c4a);}(_0x30bc,0x195));var _0xc30b=function(_0x571bbc,_0x242132){_0x571bbc=_0x571bbc-0x0;var _0x3e8edb=_0x30bc[_0x571bbc];return _0x3e8edb;};'use strict';var jayson=require(_0xc30b('0x0'));var BPromise=require(_0xc30b('0x1'));var logger=require(_0xc30b('0x2'))(_0xc30b('0x3'));var client=jayson['client']['http']({'port':0x2329});client[_0xc30b('0x4')]=function(_0x4b37df,_0x2103ae){return new BPromise(function(_0x1adc8a,_0x380004){return client[_0xc30b('0x5')](_0x4b37df,_0x2103ae)[_0xc30b('0x6')](function(_0x3a9c95){logger['debug'](_0xc30b('0x7'),_0xc30b('0x3'),_0x4b37df,_0x2103ae,_0x3a9c95);if(_0x3a9c95[_0xc30b('0x8')]){logger['error']('rpc','routing',_0x4b37df,_0x3a9c95['error'][_0xc30b('0x9')],_0x2103ae);return _0x380004(_0x3a9c95[_0xc30b('0x8')][_0xc30b('0x9')]);}else{return _0x1adc8a(_0x3a9c95[_0xc30b('0xa')]);}})[_0xc30b('0xb')](function(_0x9778ac){logger[_0xc30b('0x8')](_0xc30b('0x7'),'routing',_0x4b37df,_0x9778ac,_0x2103ae);return _0x380004(_0x9778ac);});});};module[_0xc30b('0xc')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 146b921..047eff1 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 _0xf83f=['getAgents','initAgents','getIntervals','getOpenchannelQueues','initOpenchannelQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','listen','catch','log','bluebird','./realtime','./rpc/user','./rpc/interval','./rpc/smsQueue','./rpc/faxQueue','resolve','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf83f,0x1f0));var _0xff83=function(_0x5d5010,_0x47d25c){_0x5d5010=_0x5d5010-0x0;var _0x27e011=_0xf83f[_0x5d5010];return _0x27e011;};'use strict';var BPromise=require(_0xff83('0x0'));var server=require('./server');var Realtime=require(_0xff83('0x1'));var user=require(_0xff83('0x2'));var interval=require(_0xff83('0x3'));var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require('./rpc/chatQueue');var smsQueue=require(_0xff83('0x4'));var mailQueue=require('./rpc/mailQueue');var faxQueue=require(_0xff83('0x5'));var whatsappQueue=require('./rpc/whatsappQueue');var realtime=new Realtime();function initRealtime(){return BPromise[_0xff83('0x6')]()[_0xff83('0x7')](user[_0xff83('0x8')]())[_0xff83('0x7')](realtime[_0xff83('0x9')]())['then'](interval[_0xff83('0xa')]())[_0xff83('0x7')](realtime['initIntervals']())['then'](openchannelQueue[_0xff83('0xb')]())[_0xff83('0x7')](realtime[_0xff83('0xc')]())[_0xff83('0x7')](chatQueue['getChatQueues']())[_0xff83('0x7')](realtime[_0xff83('0xd')]())[_0xff83('0x7')](smsQueue[_0xff83('0xe')]())[_0xff83('0x7')](realtime[_0xff83('0xf')]())[_0xff83('0x7')](mailQueue[_0xff83('0x10')]())[_0xff83('0x7')](realtime[_0xff83('0x11')]())['then'](faxQueue[_0xff83('0x12')]())[_0xff83('0x7')](realtime[_0xff83('0x13')]())[_0xff83('0x7')](whatsappQueue[_0xff83('0x14')]())[_0xff83('0x7')](realtime['initWhatsappQueues']())[_0xff83('0x7')](function(){return realtime;});}function main(){return server[_0xff83('0x15')](realtime)[_0xff83('0x7')](function(_0x2a3d11){return initRealtime();})[_0xff83('0x7')](function(_0x3a9627){return setInterval(initRealtime,0x1388);})[_0xff83('0x16')](function(_0xfa0df5){console[_0xff83('0x17')](_0xfa0df5);});}main(); \ No newline at end of file +var _0x51ad=['./rpc/openchannelQueue','./rpc/smsQueue','./rpc/faxQueue','./rpc/whatsappQueue','then','initAgents','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','getMailQueues','initFaxQueues','initWhatsappQueues','listen','log','bluebird','./server','./realtime','./rpc/user','./rpc/interval'];(function(_0x562f26,_0x9062ab){var _0x10a648=function(_0x4885dd){while(--_0x4885dd){_0x562f26['push'](_0x562f26['shift']());}};_0x10a648(++_0x9062ab);}(_0x51ad,0xed));var _0xd51a=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x51ad[_0x2641f9];return _0x585741;};'use strict';var BPromise=require(_0xd51a('0x0'));var server=require(_0xd51a('0x1'));var Realtime=require(_0xd51a('0x2'));var user=require(_0xd51a('0x3'));var interval=require(_0xd51a('0x4'));var openchannelQueue=require(_0xd51a('0x5'));var chatQueue=require('./rpc/chatQueue');var smsQueue=require(_0xd51a('0x6'));var mailQueue=require('./rpc/mailQueue');var faxQueue=require(_0xd51a('0x7'));var whatsappQueue=require(_0xd51a('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise['resolve']()[_0xd51a('0x9')](user['getAgents']())[_0xd51a('0x9')](realtime[_0xd51a('0xa')]())['then'](interval['getIntervals']())['then'](realtime[_0xd51a('0xb')]())[_0xd51a('0x9')](openchannelQueue[_0xd51a('0xc')]())[_0xd51a('0x9')](realtime[_0xd51a('0xd')]())[_0xd51a('0x9')](chatQueue[_0xd51a('0xe')]())[_0xd51a('0x9')](realtime[_0xd51a('0xf')]())[_0xd51a('0x9')](smsQueue[_0xd51a('0x10')]())[_0xd51a('0x9')](realtime['initSmsQueues']())[_0xd51a('0x9')](mailQueue[_0xd51a('0x11')]())['then'](realtime['initMailQueues']())[_0xd51a('0x9')](faxQueue['getFaxQueues']())['then'](realtime[_0xd51a('0x12')]())[_0xd51a('0x9')](whatsappQueue['getWhatsappQueues']())['then'](realtime[_0xd51a('0x13')]())['then'](function(){return realtime;});}function main(){return server[_0xd51a('0x14')](realtime)[_0xd51a('0x9')](function(_0x2108e0){return initRealtime();})[_0xd51a('0x9')](function(_0x53e083){return setInterval(initRealtime,0x1388);})['catch'](function(_0x10a034){console[_0xd51a('0x15')](_0x10a034);});}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 1c08db4..343adfc 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 _0x814b=['init','parse','map','object','lodash','util','events','EventEmitter','isNil','register','ignoreFactChanges','inherits','prototype','rules','isArray','concat','isObject','push','sync','filter','activeRules','orderBy','asc','execute','result','clone','name','ruleRef','call','next','isEqual','nextTick','restart','length','condition','matchPath','noop','findRules','matches','turn','prioritize','priority','toJSON','toString','consequence','fromJSON'];(function(_0x13932d,_0xf930d3){var _0x1a7b81=function(_0x5c7b67){while(--_0x5c7b67){_0x13932d['push'](_0x13932d['shift']());}};_0x1a7b81(++_0xf930d3);}(_0x814b,0x1a2));var _0xb814=function(_0x30abff,_0x5f2c5f){_0x30abff=_0x30abff-0x0;var _0x4c571e=_0x814b[_0x30abff];return _0x4c571e;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var EventEmitter=require(_0xb814('0x2'))[_0xb814('0x3')];function RuleEngine(_0xfbb64b,_0x477725){this['init']();if(!_[_0xb814('0x4')](_0xfbb64b)){this[_0xb814('0x5')](_0xfbb64b);}if(_0x477725){this[_0xb814('0x6')]=_0x477725[_0xb814('0x6')];}return this;}util[_0xb814('0x7')](RuleEngine,EventEmitter);RuleEngine[_0xb814('0x8')]['init']=function(_0x3b0829){this[_0xb814('0x9')]=[];this['activeRules']=[];};RuleEngine[_0xb814('0x8')][_0xb814('0x5')]=function(_0x186d5a){if(Array[_0xb814('0xa')](_0x186d5a)){this[_0xb814('0x9')]=this[_0xb814('0x9')][_0xb814('0xb')](_0x186d5a);}else if(_0x186d5a!==null&&_[_0xb814('0xc')](_0x186d5a)){this[_0xb814('0x9')][_0xb814('0xd')](_0x186d5a);}this[_0xb814('0xe')]();};RuleEngine['prototype'][_0xb814('0xe')]=function(){this['activeRules']=this[_0xb814('0x9')][_0xb814('0xf')](function(_0x35b10d){if(_[_0xb814('0x4')](_0x35b10d['on'])){_0x35b10d['on']=!![];}if(_0x35b10d['on']===!![]){return _0x35b10d;}});this[_0xb814('0x10')]=_[_0xb814('0x11')](this[_0xb814('0x10')],['p'],[_0xb814('0x12')]);};RuleEngine[_0xb814('0x8')][_0xb814('0x13')]=function(_0x3f4881,_0x44fb96){var _0x17f5bd=![];_0x3f4881[_0xb814('0x14')]=!![];var _0x303aca=_[_0xb814('0x15')](_0x3f4881);var _0x45e0d0=_[_0xb814('0x15')](_0x3f4881);var _0x125ce2=this[_0xb814('0x10')];var _0x7a21ef=[];var _0x48c9df=this[_0xb814('0x6')];(function FnRuleLoop(_0x55ba16){var _0x270598={'rules':function(){return _0x125ce2;},'rule':function(){return _0x125ce2[_0x55ba16];},'when':function(_0xfac75b){if(_0xfac75b){var _0x4c3007=_0x125ce2[_0x55ba16]['consequence'];_0x4c3007['ruleRef']=_0x125ce2[_0x55ba16]['id']||_0x125ce2[_0x55ba16][_0xb814('0x16')]||'index_'+_0x55ba16;process['nextTick'](function(){_0x7a21ef[_0xb814('0xd')](_0x4c3007[_0xb814('0x17')]);_0x4c3007[_0xb814('0x18')](_0x303aca,_0x270598);});}else{process['nextTick'](function(){_0x270598[_0xb814('0x19')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x17f5bd=!![];return FnRuleLoop(0x0);},'next':function(_0x531032){if(!_0x48c9df&&!_[_0xb814('0x1a')](_0x45e0d0,_0x303aca)){_0x45e0d0=_[_0xb814('0x15')](_0x303aca);process[_0xb814('0x1b')](function(){_0x270598[_0xb814('0x1c')]();});}else{process[_0xb814('0x1b')](function(){if(_[_0xb814('0x4')](_0x531032)){return FnRuleLoop(_0x55ba16+0x1);}else{return FnRuleLoop(_0x531032);}});}}};if(_0x55ba16<_0x125ce2[_0xb814('0x1d')]&&_0x17f5bd===![]){var _0x594470=_0x125ce2[_0x55ba16][_0xb814('0x1e')];_0x594470['call'](_0x303aca,_0x270598);}else{process[_0xb814('0x1b')](function(){_0x303aca[_0xb814('0x1f')]=_0x7a21ef;return _0x44fb96?_0x44fb96(_0x303aca):_[_0xb814('0x20')]();});}}(0x0));};RuleEngine[_0xb814('0x8')][_0xb814('0x21')]=function(_0xb9e57d){if(_[_0xb814('0x4')](_0xb9e57d)){return this['rules'];}else{var _0x392222=_[_0xb814('0x22')](_0xb9e57d);return _[_0xb814('0xf')](this[_0xb814('0x9')],_0x392222);}};RuleEngine[_0xb814('0x8')][_0xb814('0x23')]=function(_0x3f0150,_0x1e4e89){var _0x5a6291=_0x3f0150==='on'||_0x3f0150==='ON'?!![]:![];var _0x271aa8=this[_0xb814('0x21')](_0x1e4e89);for(var _0x52ed64=0x0,_0x9008b2=_0x271aa8[_0xb814('0x1d')];_0x52ed64<_0x9008b2;_0x52ed64+=0x1){_0x271aa8[_0x52ed64]['on']=_0x5a6291;}this[_0xb814('0xe')]();};RuleEngine['prototype'][_0xb814('0x24')]=function(_0x2051d0,_0x58c3ca){_0x2051d0=parseInt(_0x2051d0,0xa);var _0x338a28=this['findRules'](_0x58c3ca);for(var _0x6efe9a=0x0,_0x5f3e9b=_0x338a28['length'];_0x6efe9a<_0x5f3e9b;_0x6efe9a+=0x1){_0x338a28[_0x6efe9a][_0xb814('0x25')]=_0x2051d0;}this['sync']();};RuleEngine[_0xb814('0x8')][_0xb814('0x26')]=function(){var _0x2b91bd=this['rules'];if(_0x2b91bd instanceof Array){_0x2b91bd=_0x2b91bd['map'](function(_0x26d3a9){_0x26d3a9[_0xb814('0x1e')]=_0x26d3a9['condition'][_0xb814('0x27')]();_0x26d3a9[_0xb814('0x28')]=_0x26d3a9[_0xb814('0x28')][_0xb814('0x27')]();return _0x26d3a9;});}else if(!_[_0xb814('0x4')](_0x2b91bd)){_0x2b91bd[_0xb814('0x1e')]=_0x2b91bd[_0xb814('0x1e')]['toString']();_0x2b91bd[_0xb814('0x28')]=_0x2b91bd[_0xb814('0x28')][_0xb814('0x27')]();}return _0x2b91bd;};RuleEngine[_0xb814('0x8')][_0xb814('0x29')]=function(_0x4ff31a){this[_0xb814('0x2a')]();if(_['isString'](_0x4ff31a)){_0x4ff31a=JSON[_0xb814('0x2b')](_0x4ff31a);}if(_0x4ff31a instanceof Array){_0x4ff31a=_0x4ff31a[_0xb814('0x2c')](function(_0xe0f509){_0xe0f509['condition']=eval('('+_0xe0f509[_0xb814('0x1e')]+')');_0xe0f509[_0xb814('0x28')]=eval('('+_0xe0f509['consequence']+')');return _0xe0f509;});}else if(_0x4ff31a!==null&&typeof _0x4ff31a==_0xb814('0x2d')){_0x4ff31a[_0xb814('0x1e')]=eval('('+_0x4ff31a[_0xb814('0x1e')]+')');_0x4ff31a[_0xb814('0x28')]=eval('('+_0x4ff31a[_0xb814('0x28')]+')');}this[_0xb814('0x5')](_0x4ff31a);};module['exports']=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(_0x14d416,_0x34b105){var _0xe7f438=function(_0x3668f6){while(--_0x3668f6){_0x14d416['push'](_0x14d416['shift']());}};_0xe7f438(++_0x34b105);}(_0x7a54,0x106));var _0x47a5=function(_0x5c340a,_0x15b81d){_0x5c340a=_0x5c340a-0x0;var _0x2133a7=_0x7a54[_0x5c340a];return _0x2133a7;};'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 c98eda3..afe3022 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 _0xb339=['catch','sendMailMessage','SendMail','bluebird','client','http','request','then','error','message','result'];(function(_0x51d2ff,_0x32aa22){var _0x48ad86=function(_0x499f1b){while(--_0x499f1b){_0x51d2ff['push'](_0x51d2ff['shift']());}};_0x48ad86(++_0x32aa22);}(_0xb339,0x71));var _0x9b33=function(_0x525798,_0x77a707){_0x525798=_0x525798-0x0;var _0x57da9a=_0xb339[_0x525798];return _0x57da9a;};'use strict';var BPromise=require(_0x9b33('0x0'));var jayson=require('jayson/promise');var client=jayson[_0x9b33('0x1')][_0x9b33('0x2')]({'port':0x232b});function request(_0x54a94f,_0x352bf0){return new BPromise(function(_0x583cb4,_0x2c6832){return client[_0x9b33('0x3')](_0x54a94f,_0x352bf0)[_0x9b33('0x4')](function(_0x3553ad){if(_0x3553ad[_0x9b33('0x5')]){return _0x2c6832(_0x3553ad[_0x9b33('0x5')][_0x9b33('0x6')]);}else{return _0x583cb4(_0x3553ad[_0x9b33('0x7')]);}})[_0x9b33('0x8')](function(_0x28cfe8){return _0x2c6832(_0x28cfe8);});});}exports[_0x9b33('0x9')]=function(_0x18be74,_0x4d80a3){return request(_0x9b33('0xa'),{'account':_0x18be74,'message':_0x4d80a3});}; \ No newline at end of file +var _0x3308=['message','sendMailMessage','SendMail','bluebird','http','request','then','error'];(function(_0x3f328d,_0x36cc6a){var _0x84a78f=function(_0x11ca4e){while(--_0x11ca4e){_0x3f328d['push'](_0x3f328d['shift']());}};_0x84a78f(++_0x36cc6a);}(_0x3308,0x16b));var _0x8330=function(_0x416886,_0x40e26a){_0x416886=_0x416886-0x0;var _0xe11111=_0x3308[_0x416886];return _0xe11111;};'use strict';var BPromise=require(_0x8330('0x0'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8330('0x1')]({'port':0x232b});function request(_0x47566d,_0x12e0b1){return new BPromise(function(_0xa720da,_0x1776cb){return client[_0x8330('0x2')](_0x47566d,_0x12e0b1)[_0x8330('0x3')](function(_0x23363c){if(_0x23363c['error']){return _0x1776cb(_0x23363c[_0x8330('0x4')][_0x8330('0x5')]);}else{return _0xa720da(_0x23363c['result']);}})['catch'](function(_0x2891ab){return _0x1776cb(_0x2891ab);});});}exports[_0x8330('0x6')]=function(_0x414bae,_0x3dc089){return request(_0x8330('0x7'),{'account':_0x414bae,'message':_0x3dc089});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index a2c280a..46eeec1 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 _0x81f7=['name','voicePause','chatPause','mailPause','faxPause','openchannelPause','chatStatus','chatCapacity','chatCurrentCapacity','mailStatus','unknown','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatusTime','openchannelCapacity','busy','md5','chatWaitingInteractions','faxWaitingInteractions','openchannelWaitingInteractions','smsWaitingInteractions','whatsappWaitingInteractions','updateRealtime','getChannelStatus','Capacity','CurrentCapacity','maxcapacity','working','idle','prototype','mail','openchannel','fax','length','Status','StatusTime','toNumber','format','online','smsPause','whatsappStatus','busyQueue','mailWaitingInteractions','stringify','emit','lodash','moment','ioredis','redis','localhost','socket.io-emitter'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x81f7,0xb7));var _0x781f=function(_0x1bdd32,_0x1f2470){_0x1bdd32=_0x1bdd32-0x0;var _0x2ae146=_0x81f7[_0x1bdd32];return _0x2ae146;};'use strict';var _=require(_0x781f('0x0'));var moment=require(_0x781f('0x1'));var md5=require('md5');var Redis=require(_0x781f('0x2'));var config=require('../../../config/environment');config[_0x781f('0x3')]=_['defaults'](config[_0x781f('0x3')],{'host':_0x781f('0x4'),'port':0x18eb});var io=require(_0x781f('0x5'))(new Redis(config[_0x781f('0x3')]));function Agent(_0xf9fb57){this['id']=_0xf9fb57['id']||0x0;this[_0x781f('0x6')]=_0xf9fb57[_0x781f('0x6')]||'';this[_0x781f('0x7')]=_0xf9fb57[_0x781f('0x7')]||![];this[_0x781f('0x8')]=_0xf9fb57['chatPause']||![];this['mailPause']=_0xf9fb57[_0x781f('0x9')]||![];this['faxPause']=_0xf9fb57[_0x781f('0xa')]||![];this['smsPause']=_0xf9fb57['smsPause']||![];this[_0x781f('0xb')]=_0xf9fb57[_0x781f('0xb')]||![];this[_0x781f('0xc')]='unknown';this['chatStatusTime']=0x0;this['chatCapacity']=_0xf9fb57[_0x781f('0xd')]||0x0;this[_0x781f('0xe')]=0x0;this[_0x781f('0xf')]=_0x781f('0x10');this[_0x781f('0x11')]=0x0;this[_0x781f('0x12')]=_0xf9fb57[_0x781f('0x12')]||0x0;this[_0x781f('0x13')]=0x0;this[_0x781f('0x14')]=_0x781f('0x10');this[_0x781f('0x15')]=0x0;this['faxCapacity']=_0xf9fb57[_0x781f('0x16')]||0x0;this[_0x781f('0x17')]=0x0;this[_0x781f('0x18')]='unknown';this[_0x781f('0x19')]=0x0;this[_0x781f('0x1a')]=_0xf9fb57[_0x781f('0x1a')]||0x0;this[_0x781f('0x1b')]=0x0;this['whatsappStatus']=_0x781f('0x10');this[_0x781f('0x1c')]=0x0;this[_0x781f('0x1d')]=_0xf9fb57[_0x781f('0x1d')]||0x0;this[_0x781f('0x1e')]=0x0;this['openchannelStatus']='unknown';this[_0x781f('0x1f')]=0x0;this['openchannelCapacity']=_0xf9fb57[_0x781f('0x20')]||0x0;this['openchannelCurrentCapacity']=0x0;this[_0x781f('0x21')]=![];this['busyQueue']=undefined;this[_0x781f('0x22')]='';this[_0x781f('0x23')]={};this[_0x781f('0x24')]={};this['mailWaitingInteractions']={};this[_0x781f('0x25')]={};this[_0x781f('0x26')]={};this[_0x781f('0x27')]={};this[_0x781f('0x28')]();}Agent['prototype'][_0x781f('0x29')]=function(_0x36219e){if(this[_0x36219e+'CurrentCapacity']>0x0){if(this[_0x36219e+_0x781f('0x2a')]>0x0&&this[_0x36219e+_0x781f('0x2b')]>=this[_0x36219e+_0x781f('0x2a')]){return _0x781f('0x2c');}else{return _0x781f('0x2d');}}else{return _0x781f('0x2e');}};Agent[_0x781f('0x2f')]['updateRealtime']=function(){var _0x57104c=[_0x781f('0x30'),'chat',_0x781f('0x31'),_0x781f('0x32'),'sms','whatsapp'];for(var _0x1695df=0x0;_0x1695df<_0x57104c[_0x781f('0x33')];_0x1695df+=0x1){var _0x52c34e=this[_0x781f('0x29')](_0x57104c[_0x1695df]);if(this[_0x57104c[_0x1695df]+_0x781f('0x34')]!==_0x52c34e){this[_0x57104c[_0x1695df]+_0x781f('0x35')]=_[_0x781f('0x36')](moment()[_0x781f('0x37')]('x'));}this[_0x57104c[_0x1695df]+_0x781f('0x34')]=_0x52c34e;}var _0x5a8140={'id':this['id'],'name':this[_0x781f('0x6')],'online':this[_0x781f('0x38')],'voicePause':this[_0x781f('0x7')],'chatPause':this[_0x781f('0x8')],'mailPause':this[_0x781f('0x9')],'smsPause':this[_0x781f('0x39')],'faxPause':this[_0x781f('0xa')],'openchannelPause':this[_0x781f('0xb')],'chatStatus':this[_0x781f('0xc')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0x781f('0xd')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0x781f('0xf')],'mailStatusTime':this[_0x781f('0x11')],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0x781f('0x14')],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0x781f('0x17')],'smsStatus':this[_0x781f('0x18')],'smsStatusTime':this[_0x781f('0x19')],'smsCapacity':this[_0x781f('0x1a')],'smsCurrentCapacity':this[_0x781f('0x1b')],'whatsappStatus':this[_0x781f('0x3a')],'whatsappStatusTime':this['whatsappStatusTime'],'whatsappCapacity':this[_0x781f('0x1d')],'whatsappCurrentCapacity':this[_0x781f('0x1e')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0x781f('0x1f')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this[_0x781f('0x21')],'busyQueue':this[_0x781f('0x3b')],'chatWaitingInteractions':this[_0x781f('0x23')],'faxWaitingInteractions':this[_0x781f('0x24')],'mailWaitingInteractions':this[_0x781f('0x3c')],'openchannelWaitingInteractions':this[_0x781f('0x25')],'smsWaitingInteractions':this[_0x781f('0x26')],'whatsappWaitingInteractions':this[_0x781f('0x27')]};var _0x23eacb=md5(JSON[_0x781f('0x3d')](_0x5a8140));if(this['md5']!==_0x23eacb){this[_0x781f('0x22')]=_0x23eacb;io[_0x781f('0x3e')]('user:routing:update',_0x5a8140);}};module['exports']=Agent; \ No newline at end of file +var _0xffd6=['idle','mail','openchannel','fax','length','StatusTime','format','Status','chatStatusTime','chatCurrentCapacity','faxStatus','faxStatusTime','smsStatus','whatsappCurrentCapacity','openchannelStatus','busy','busyQueue','faxWaitingInteractions','whatsappWaitingInteractions','stringify','user:routing:update','omit','exports','lodash','md5','moment','redis','defaults','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxCapacity','faxCurrentCapacity','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','chatWaitingInteractions','mailWaitingInteractions','openchannelWaitingInteractions','smsWaitingInteractions','updateRealtime','prototype','CurrentCapacity','Capacity','maxcapacity'];(function(_0x4e6657,_0x4997eb){var _0x4fba8e=function(_0x5eb835){while(--_0x5eb835){_0x4e6657['push'](_0x4e6657['shift']());}};_0x4fba8e(++_0x4997eb);}(_0xffd6,0x97));var _0x6ffd=function(_0x15ca1a,_0x30fc82){_0x15ca1a=_0x15ca1a-0x0;var _0x507626=_0xffd6[_0x15ca1a];return _0x507626;};'use strict';var _=require(_0x6ffd('0x0'));var md5=require(_0x6ffd('0x1'));var moment=require(_0x6ffd('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x6ffd('0x3')]=_[_0x6ffd('0x4')](config[_0x6ffd('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0x6ffd('0x5'))(new Redis(config[_0x6ffd('0x3')]));function Agent(_0x3b8a46){this['id']=_0x3b8a46['id']||0x0;this[_0x6ffd('0x6')]=_0x3b8a46['name']||'';this[_0x6ffd('0x7')]=_0x3b8a46[_0x6ffd('0x7')]||!![];this[_0x6ffd('0x8')]=_0x3b8a46[_0x6ffd('0x8')]||![];this[_0x6ffd('0x9')]=_0x3b8a46['chatPause']||![];this[_0x6ffd('0xa')]=_0x3b8a46[_0x6ffd('0xa')]||![];this['faxPause']=_0x3b8a46[_0x6ffd('0xb')]||![];this[_0x6ffd('0xc')]=_0x3b8a46[_0x6ffd('0xc')]||![];this[_0x6ffd('0xd')]=_0x3b8a46[_0x6ffd('0xd')]||![];this[_0x6ffd('0xe')]=_0x6ffd('0xf');this['chatStatusTime']=0x0;this[_0x6ffd('0x10')]=_0x3b8a46[_0x6ffd('0x10')]||0x0;this['chatCurrentCapacity']=0x0;this[_0x6ffd('0x11')]=_0x6ffd('0xf');this[_0x6ffd('0x12')]=0x0;this[_0x6ffd('0x13')]=_0x3b8a46['mailCapacity']||0x0;this[_0x6ffd('0x14')]=0x0;this['faxStatus']=_0x6ffd('0xf');this['faxStatusTime']=0x0;this[_0x6ffd('0x15')]=_0x3b8a46[_0x6ffd('0x15')]||0x0;this[_0x6ffd('0x16')]=0x0;this['smsStatus']=_0x6ffd('0xf');this[_0x6ffd('0x17')]=0x0;this[_0x6ffd('0x18')]=_0x3b8a46[_0x6ffd('0x18')]||0x0;this[_0x6ffd('0x19')]=0x0;this[_0x6ffd('0x1a')]=_0x6ffd('0xf');this[_0x6ffd('0x1b')]=0x0;this['whatsappCapacity']=_0x3b8a46[_0x6ffd('0x1c')]||0x0;this['whatsappCurrentCapacity']=0x0;this['openchannelStatus']=_0x6ffd('0xf');this[_0x6ffd('0x1d')]=0x0;this['openchannelCapacity']=_0x3b8a46[_0x6ffd('0x1e')]||0x0;this[_0x6ffd('0x1f')]=0x0;this['busy']=![];this['busyQueue']=undefined;this[_0x6ffd('0x1')]='';this[_0x6ffd('0x20')]={};this['faxWaitingInteractions']={};this[_0x6ffd('0x21')]={};this[_0x6ffd('0x22')]={};this[_0x6ffd('0x23')]={};this['whatsappWaitingInteractions']={};this[_0x6ffd('0x24')]();}Agent[_0x6ffd('0x25')]['getChannelStatus']=function(_0x356c9c){if(this[_0x356c9c+_0x6ffd('0x26')]>0x0){if(this[_0x356c9c+'Capacity']>0x0&&this[_0x356c9c+_0x6ffd('0x26')]>=this[_0x356c9c+_0x6ffd('0x27')]){return _0x6ffd('0x28');}else{return'working';}}else{return _0x6ffd('0x29');}};Agent[_0x6ffd('0x25')][_0x6ffd('0x24')]=function(){var _0x4ae7ac=[_0x6ffd('0x2a'),'chat',_0x6ffd('0x2b'),_0x6ffd('0x2c'),'sms','whatsapp'];for(var _0x252201=0x0;_0x252201<_0x4ae7ac[_0x6ffd('0x2d')];_0x252201+=0x1){var _0x1934d4=this['getChannelStatus'](_0x4ae7ac[_0x252201]);if(this[_0x4ae7ac[_0x252201]+'Status']!==_0x1934d4){this[_0x4ae7ac[_0x252201]+_0x6ffd('0x2e')]=_['toNumber'](moment()[_0x6ffd('0x2f')]('x'));}this[_0x4ae7ac[_0x252201]+_0x6ffd('0x30')]=_0x1934d4;}var _0x51fdb6={'id':this['id'],'name':this[_0x6ffd('0x6')],'online':this[_0x6ffd('0x7')],'voicePause':this[_0x6ffd('0x8')],'chatPause':this[_0x6ffd('0x9')],'mailPause':this[_0x6ffd('0xa')],'smsPause':this[_0x6ffd('0xc')],'faxPause':this[_0x6ffd('0xb')],'openchannelPause':this[_0x6ffd('0xd')],'chatStatus':this[_0x6ffd('0xe')],'chatStatusTime':this[_0x6ffd('0x31')],'chatCapacity':this[_0x6ffd('0x10')],'chatCurrentCapacity':this[_0x6ffd('0x32')],'mailStatus':this[_0x6ffd('0x11')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0x6ffd('0x33')],'faxStatusTime':this[_0x6ffd('0x34')],'faxCapacity':this[_0x6ffd('0x15')],'faxCurrentCapacity':this[_0x6ffd('0x16')],'smsStatus':this[_0x6ffd('0x35')],'smsStatusTime':this[_0x6ffd('0x17')],'smsCapacity':this[_0x6ffd('0x18')],'smsCurrentCapacity':this[_0x6ffd('0x19')],'whatsappStatus':this[_0x6ffd('0x1a')],'whatsappStatusTime':this[_0x6ffd('0x1b')],'whatsappCapacity':this[_0x6ffd('0x1c')],'whatsappCurrentCapacity':this[_0x6ffd('0x36')],'openchannelStatus':this[_0x6ffd('0x37')],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this[_0x6ffd('0x1e')],'openchannelCurrentCapacity':this[_0x6ffd('0x1f')],'busy':this[_0x6ffd('0x38')],'busyQueue':this[_0x6ffd('0x39')],'chatWaitingInteractions':this['chatWaitingInteractions'],'faxWaitingInteractions':this[_0x6ffd('0x3a')],'mailWaitingInteractions':this['mailWaitingInteractions'],'openchannelWaitingInteractions':this['openchannelWaitingInteractions'],'smsWaitingInteractions':this[_0x6ffd('0x23')],'whatsappWaitingInteractions':this[_0x6ffd('0x3b')]};var _0x25bc7c=md5(JSON[_0x6ffd('0x3c')](_0x51fdb6));if(this['md5']!==_0x25bc7c){this[_0x6ffd('0x1')]=_0x25bc7c;io['emit'](_0x6ffd('0x3d'),_[_0x6ffd('0x3e')](_0x51fdb6,[_0x6ffd('0x7')]));}};module[_0x6ffd('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 123c1f4..5411423 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 _0xbe15=['lodash','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','paused','length','available','loggedIn','format','chat:queue:%s','emit','chat_queue:save','exports'];(function(_0x5865e3,_0x169bc5){var _0x22eb75=function(_0x2b2973){while(--_0x2b2973){_0x5865e3['push'](_0x5865e3['shift']());}};_0x22eb75(++_0x169bc5);}(_0xbe15,0xe8));var _0x5be1=function(_0x113155,_0x322000){_0x113155=_0x113155-0x0;var _0x1965cf=_0xbe15[_0x113155];return _0x1965cf;};'use strict';var _=require(_0x5be1('0x0'));var md5=require(_0x5be1('0x1'));var util=require('util');var Redis=require(_0x5be1('0x2'));var config=require(_0x5be1('0x3'));config[_0x5be1('0x4')]=_[_0x5be1('0x5')](config[_0x5be1('0x4')],{'host':_0x5be1('0x6'),'port':0x18eb});var io=require(_0x5be1('0x7'))(new Redis(config[_0x5be1('0x4')]));function ChatQueue(_0x5c7885){this['id']=_0x5c7885['id']||0x0;this[_0x5be1('0x8')]=_0x5c7885[_0x5be1('0x8')]||'';this[_0x5be1('0x9')]=_0x5c7885['timeout']||0xa;this[_0x5be1('0xa')]=_0x5c7885[_0x5be1('0xa')]||_0x5be1('0xb');this['Agents']=_0x5c7885[_0x5be1('0xc')];this[_0x5be1('0xd')]={};this[_0x5be1('0xe')]=0x0;this[_0x5be1('0x1')]='';this[_0x5be1('0xf')]();this[_0x5be1('0x10')]();}ChatQueue[_0x5be1('0x11')][_0x5be1('0xf')]=function(){var _0x58e2c4=this[_0x5be1('0xd')][_0x5be1('0x12')];this[_0x5be1('0xd')]=_[_0x5be1('0x13')](this[_0x5be1('0xc')],'id');this[_0x5be1('0xd')]['_rr']=_0x58e2c4;};ChatQueue['prototype'][_0x5be1('0x10')]=function(){this['loggedIn']=0x0;this[_0x5be1('0x14')]=0x0;for(var _0x314525=0x0;_0x314525=0x0?this[_0x5be1('0x16')]:0x0;var _0x22e0cd={'id':this['id'],'available':this[_0x5be1('0x16')],'loggedIn':this[_0x5be1('0x17')],'name':this[_0x5be1('0x8')],'paused':this[_0x5be1('0x14')],'waiting':this['waiting']};var _0x2eac58=md5(JSON['stringify'](_0x22e0cd));if(this['md5']!==_0x2eac58){this[_0x5be1('0x1')]=_0x2eac58;io['to'](util[_0x5be1('0x18')](_0x5be1('0x19'),_0x22e0cd[_0x5be1('0x8')]))[_0x5be1('0x1a')](_0x5be1('0x1b'),_0x22e0cd);}};module[_0x5be1('0x1c')]=ChatQueue; \ No newline at end of file +var _0x8811=['paused','available','name','waiting','stringify','format','chat:queue:%s','emit','chat_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','timeout','strategy','Agents','mapAgentsId','updateRouting','updateRealtime','_rr','map','prototype','loggedIn','length'];(function(_0x1d1f41,_0x14ad2b){var _0x58a58f=function(_0x34af33){while(--_0x34af33){_0x1d1f41['push'](_0x1d1f41['shift']());}};_0x58a58f(++_0x14ad2b);}(_0x8811,0x95));var _0x1881=function(_0x1fae32,_0x7d7808){_0x1fae32=_0x1fae32-0x0;var _0x257b59=_0x8811[_0x1fae32];return _0x257b59;};'use strict';var _=require(_0x1881('0x0'));var md5=require(_0x1881('0x1'));var util=require(_0x1881('0x2'));var Redis=require(_0x1881('0x3'));var config=require(_0x1881('0x4'));config[_0x1881('0x5')]=_[_0x1881('0x6')](config[_0x1881('0x5')],{'host':_0x1881('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function ChatQueue(_0xe16b67){this['id']=_0xe16b67['id']||0x0;this['name']=_0xe16b67['name']||'';this[_0x1881('0x8')]=_0xe16b67[_0x1881('0x8')]||0xa;this[_0x1881('0x9')]=_0xe16b67[_0x1881('0x9')]||'beepall';this[_0x1881('0xa')]=_0xe16b67['Agents'];this[_0x1881('0xb')]={};this['waiting']=0x0;this[_0x1881('0x1')]='';this[_0x1881('0xc')]();this[_0x1881('0xd')]();}ChatQueue['prototype'][_0x1881('0xc')]=function(){var _0x48d197=this[_0x1881('0xb')][_0x1881('0xe')];this[_0x1881('0xb')]=_[_0x1881('0xf')](this[_0x1881('0xa')],'id');this[_0x1881('0xb')][_0x1881('0xe')]=_0x48d197;};ChatQueue[_0x1881('0x10')][_0x1881('0xd')]=function(){this[_0x1881('0x11')]=0x0;this['paused']=0x0;for(var _0x197063=0x0;_0x197063=0x0?this[_0x1881('0x14')]:0x0;var _0x3d04f2={'id':this['id'],'available':this[_0x1881('0x14')],'loggedIn':this[_0x1881('0x11')],'name':this[_0x1881('0x15')],'paused':this[_0x1881('0x13')],'waiting':this[_0x1881('0x16')]};var _0x35e3bb=md5(JSON[_0x1881('0x17')](_0x3d04f2));if(this[_0x1881('0x1')]!==_0x35e3bb){this[_0x1881('0x1')]=_0x35e3bb;io['to'](util[_0x1881('0x18')](_0x1881('0x19'),_0x3d04f2['name']))[_0x1881('0x1a')](_0x1881('0x1b'),_0x3d04f2);}};module['exports']=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 308768a..c41fad7 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 _0x5e60=['md5','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','length','online','faxPause','paused','available','stringify','format','fax:queue:%s','emit','fax_queue:save','exports','lodash','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting'];(function(_0x4e29fe,_0x5688c4){var _0x247a8d=function(_0x4cfa8e){while(--_0x4cfa8e){_0x4e29fe['push'](_0x4e29fe['shift']());}};_0x247a8d(++_0x5688c4);}(_0x5e60,0x1f2));var _0x05e6=function(_0x490c25,_0x257005){_0x490c25=_0x490c25-0x0;var _0x22524a=_0x5e60[_0x490c25];return _0x22524a;};'use strict';var _=require(_0x05e6('0x0'));var md5=require('md5');var util=require(_0x05e6('0x1'));var Redis=require(_0x05e6('0x2'));var config=require(_0x05e6('0x3'));config[_0x05e6('0x4')]=_[_0x05e6('0x5')](config[_0x05e6('0x4')],{'host':_0x05e6('0x6'),'port':0x18eb});var io=require(_0x05e6('0x7'))(new Redis(config[_0x05e6('0x4')]));function FaxQueue(_0xb91ec6){this['id']=_0xb91ec6['id']||0x0;this[_0x05e6('0x8')]=_0xb91ec6[_0x05e6('0x8')]||'';this[_0x05e6('0x9')]=_0xb91ec6['timeout']||0xa;this[_0x05e6('0xa')]=_0xb91ec6[_0x05e6('0xa')]||'beepall';this['Agents']=_0xb91ec6[_0x05e6('0xb')];this[_0x05e6('0xc')]={};this[_0x05e6('0xd')]=0x0;this[_0x05e6('0xe')]='';this[_0x05e6('0xf')]();this[_0x05e6('0x10')]();}FaxQueue[_0x05e6('0x11')]['updateRouting']=function(){var _0x26f1d6=this[_0x05e6('0xc')][_0x05e6('0x12')];this[_0x05e6('0xc')]=_[_0x05e6('0x13')](this[_0x05e6('0xb')],'id');this[_0x05e6('0xc')]['_rr']=_0x26f1d6;};FaxQueue[_0x05e6('0x11')][_0x05e6('0x10')]=function(){this[_0x05e6('0x14')]=0x0;this['paused']=0x0;for(var _0xc57e1=0x0;_0xc57e1=0x0?this[_0x05e6('0x19')]:0x0;var _0x4c1368={'id':this['id'],'available':this[_0x05e6('0x19')],'loggedIn':this[_0x05e6('0x14')],'name':this['name'],'paused':this[_0x05e6('0x18')],'waiting':this[_0x05e6('0xd')]};var _0x1e5b58=md5(JSON[_0x05e6('0x1a')](_0x4c1368));if(this[_0x05e6('0xe')]!==_0x1e5b58){this[_0x05e6('0xe')]=_0x1e5b58;io['to'](util[_0x05e6('0x1b')](_0x05e6('0x1c'),_0x4c1368['name']))[_0x05e6('0x1d')](_0x05e6('0x1e'),_0x4c1368);}};module[_0x05e6('0x1f')]=FaxQueue; \ No newline at end of file +var _0x7928=['paused','available','stringify','format','emit','fax_queue:save','lodash','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','prototype','_rr','map','updateRealtime','loggedIn','length','online','faxPause'];(function(_0x470967,_0x4e495b){var _0xe1e694=function(_0x3356d8){while(--_0x3356d8){_0x470967['push'](_0x470967['shift']());}};_0xe1e694(++_0x4e495b);}(_0x7928,0x10b));var _0x8792=function(_0x574db1,_0x5cc02c){_0x574db1=_0x574db1-0x0;var _0x395be0=_0x7928[_0x574db1];return _0x395be0;};'use strict';var _=require(_0x8792('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0x8792('0x1'));var config=require(_0x8792('0x2'));config[_0x8792('0x3')]=_['defaults'](config[_0x8792('0x3')],{'host':_0x8792('0x4'),'port':0x18eb});var io=require(_0x8792('0x5'))(new Redis(config[_0x8792('0x3')]));function FaxQueue(_0x3629a9){this['id']=_0x3629a9['id']||0x0;this[_0x8792('0x6')]=_0x3629a9[_0x8792('0x6')]||'';this['timeout']=_0x3629a9[_0x8792('0x7')]||0xa;this[_0x8792('0x8')]=_0x3629a9[_0x8792('0x8')]||_0x8792('0x9');this[_0x8792('0xa')]=_0x3629a9[_0x8792('0xa')];this[_0x8792('0xb')]={};this[_0x8792('0xc')]=0x0;this[_0x8792('0xd')]='';this[_0x8792('0xe')]();this['updateRealtime']();}FaxQueue[_0x8792('0xf')]['updateRouting']=function(){var _0x24a51a=this['mapAgentsId'][_0x8792('0x10')];this[_0x8792('0xb')]=_[_0x8792('0x11')](this['Agents'],'id');this['mapAgentsId'][_0x8792('0x10')]=_0x24a51a;};FaxQueue['prototype'][_0x8792('0x12')]=function(){this[_0x8792('0x13')]=0x0;this['paused']=0x0;for(var _0x248dae=0x0;_0x248dae=0x0?this[_0x8792('0x18')]:0x0;var _0x49eca4={'id':this['id'],'available':this[_0x8792('0x18')],'loggedIn':this[_0x8792('0x13')],'name':this[_0x8792('0x6')],'paused':this['paused'],'waiting':this[_0x8792('0xc')]};var _0x1fb8f4=md5(JSON[_0x8792('0x19')](_0x49eca4));if(this[_0x8792('0xd')]!==_0x1fb8f4){this[_0x8792('0xd')]=_0x1fb8f4;io['to'](util[_0x8792('0x1a')]('fax:queue:%s',_0x49eca4[_0x8792('0x6')]))[_0x8792('0x1b')](_0x8792('0x1c'),_0x49eca4);}};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 2bf7c6b..2fa005f 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 _0x438d=['Intervals','exports'];(function(_0x36e2dc,_0x441792){var _0xe33a3=function(_0x4e3c72){while(--_0x4e3c72){_0x36e2dc['push'](_0x36e2dc['shift']());}};_0xe33a3(++_0x441792);}(_0x438d,0xa0));var _0xd438=function(_0x13eca7,_0x29b30d){_0x13eca7=_0x13eca7-0x0;var _0x1abd34=_0x438d[_0x13eca7];return _0x1abd34;};'use strict';function Interval(_0x2f1a8c){this['id']=_0x2f1a8c['id']||0x0;this['name']=_0x2f1a8c['name']||'';this['Intervals']=_0x2f1a8c[_0xd438('0x0')]||{};}module[_0xd438('0x1')]=Interval; \ No newline at end of file +var _0xb482=['name','Intervals','exports'];(function(_0x3ce97d,_0x2e687e){var _0x4d41fa=function(_0x132d24){while(--_0x132d24){_0x3ce97d['push'](_0x3ce97d['shift']());}};_0x4d41fa(++_0x2e687e);}(_0xb482,0xf0));var _0x2b48=function(_0x4603e9,_0x5059f3){_0x4603e9=_0x4603e9-0x0;var _0xd79141=_0xb482[_0x4603e9];return _0xd79141;};'use strict';function Interval(_0x46f7cf){this['id']=_0x46f7cf['id']||0x0;this[_0x2b48('0x0')]=_0x46f7cf[_0x2b48('0x0')]||'';this[_0x2b48('0x1')]=_0x46f7cf['Intervals']||{};}module[_0x2b48('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 3e4252d..c6b00b4 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 _0x4392=['loggedIn','mailPause','available','stringify','format','mail:queue:%s','mail_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','map','prototype','paused','length','online'];(function(_0x5bb077,_0x314590){var _0x487afc=function(_0x1293b3){while(--_0x1293b3){_0x5bb077['push'](_0x5bb077['shift']());}};_0x487afc(++_0x314590);}(_0x4392,0x10d));var _0x2439=function(_0x2a6a6a,_0x245612){_0x2a6a6a=_0x2a6a6a-0x0;var _0x10a12d=_0x4392[_0x2a6a6a];return _0x10a12d;};'use strict';var _=require(_0x2439('0x0'));var md5=require(_0x2439('0x1'));var util=require(_0x2439('0x2'));var Redis=require(_0x2439('0x3'));var config=require(_0x2439('0x4'));config[_0x2439('0x5')]=_['defaults'](config['redis'],{'host':_0x2439('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function MailQueue(_0x3a3c40){this['id']=_0x3a3c40['id']||0x0;this[_0x2439('0x7')]=_0x3a3c40[_0x2439('0x7')]||'';this[_0x2439('0x8')]=_0x3a3c40[_0x2439('0x8')]||0xa;this[_0x2439('0x9')]=_0x3a3c40[_0x2439('0x9')]||'beepall';this[_0x2439('0xa')]=_0x3a3c40[_0x2439('0xa')];this[_0x2439('0xb')]={};this[_0x2439('0xc')]=0x0;this[_0x2439('0x1')]='';this[_0x2439('0xd')]();this[_0x2439('0xe')]();}MailQueue['prototype'][_0x2439('0xd')]=function(){var _0x533330=this['mapAgentsId'][_0x2439('0xf')];this[_0x2439('0xb')]=_[_0x2439('0x10')](this['Agents'],'id');this[_0x2439('0xb')]['_rr']=_0x533330;};MailQueue[_0x2439('0x11')][_0x2439('0xe')]=function(){this['loggedIn']=0x0;this[_0x2439('0x12')]=0x0;for(var _0x5b3f66=0x0;_0x5b3f66=0x0?this[_0x2439('0x17')]:0x0;var _0x23ef9b={'id':this['id'],'available':this[_0x2439('0x17')],'loggedIn':this[_0x2439('0x15')],'name':this[_0x2439('0x7')],'paused':this['paused'],'waiting':this['waiting']};var _0x5a6d84=md5(JSON[_0x2439('0x18')](_0x23ef9b));if(this[_0x2439('0x1')]!==_0x5a6d84){this[_0x2439('0x1')]=_0x5a6d84;io['to'](util[_0x2439('0x19')](_0x2439('0x1a'),_0x23ef9b[_0x2439('0x7')]))['emit'](_0x2439('0x1b'),_0x23ef9b);}};module[_0x2439('0x1c')]=MailQueue; \ No newline at end of file +var _0x22de=['socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','map','online','loggedIn','available','paused','stringify','format','emit','mail_queue:save','exports','lodash','md5','util','../../../config/environment','redis'];(function(_0x28d7dc,_0x54ea06){var _0x28de2f=function(_0x4b3d85){while(--_0x4b3d85){_0x28d7dc['push'](_0x28d7dc['shift']());}};_0x28de2f(++_0x54ea06);}(_0x22de,0x1ef));var _0xe22d=function(_0x414c42,_0x54b0b3){_0x414c42=_0x414c42-0x0;var _0x571420=_0x22de[_0x414c42];return _0x571420;};'use strict';var _=require(_0xe22d('0x0'));var md5=require(_0xe22d('0x1'));var util=require(_0xe22d('0x2'));var Redis=require('ioredis');var config=require(_0xe22d('0x3'));config[_0xe22d('0x4')]=_['defaults'](config[_0xe22d('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0xe22d('0x5'))(new Redis(config['redis']));function MailQueue(_0x14f479){this['id']=_0x14f479['id']||0x0;this[_0xe22d('0x6')]=_0x14f479['name']||'';this['timeout']=_0x14f479[_0xe22d('0x7')]||0xa;this[_0xe22d('0x8')]=_0x14f479[_0xe22d('0x8')]||'beepall';this['Agents']=_0x14f479[_0xe22d('0x9')];this[_0xe22d('0xa')]={};this[_0xe22d('0xb')]=0x0;this[_0xe22d('0x1')]='';this[_0xe22d('0xc')]();this[_0xe22d('0xd')]();}MailQueue['prototype'][_0xe22d('0xc')]=function(){var _0x46c4f5=this[_0xe22d('0xa')][_0xe22d('0xe')];this[_0xe22d('0xa')]=_[_0xe22d('0xf')](this[_0xe22d('0x9')],'id');this[_0xe22d('0xa')][_0xe22d('0xe')]=_0x46c4f5;};MailQueue['prototype'][_0xe22d('0xd')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x290458=0x0;_0x290458=0x0?this['available']:0x0;var _0x4bf2db={'id':this['id'],'available':this['available'],'loggedIn':this[_0xe22d('0x11')],'name':this[_0xe22d('0x6')],'paused':this[_0xe22d('0x13')],'waiting':this['waiting']};var _0x5daaf0=md5(JSON[_0xe22d('0x14')](_0x4bf2db));if(this[_0xe22d('0x1')]!==_0x5daaf0){this['md5']=_0x5daaf0;io['to'](util[_0xe22d('0x15')]('mail:queue:%s',_0x4bf2db['name']))[_0xe22d('0x16')](_0xe22d('0x17'),_0x4bf2db);}};module[_0xe22d('0x18')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 19119f7..82d26f3 100644 --- a/server/services/routing/model/openchannelQueue.js +++ b/server/services/routing/model/openchannelQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['exports','lodash','md5','util','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','waiting','updateRealtime','mapAgentsId','_rr','map','Agents','prototype','loggedIn','paused','length','openchannelPause','available','stringify','format','openchannel:queue:%s','emit','openchannel_queue:save'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x7a54,0x106));var _0x47a5=function(_0x348972,_0x4c51e2){_0x348972=_0x348972-0x0;var _0x57b141=_0x7a54[_0x348972];return _0x57b141;};'use strict';var _=require(_0x47a5('0x0'));var md5=require(_0x47a5('0x1'));var util=require(_0x47a5('0x2'));var Redis=require('ioredis');var config=require(_0x47a5('0x3'));config[_0x47a5('0x4')]=_['defaults'](config[_0x47a5('0x4')],{'host':_0x47a5('0x5'),'port':0x18eb});var io=require(_0x47a5('0x6'))(new Redis(config[_0x47a5('0x4')]));function OpenchannelQueue(_0xfdf934){this['id']=_0xfdf934['id']||0x0;this['name']=_0xfdf934[_0x47a5('0x7')]||'';this['timeout']=_0xfdf934[_0x47a5('0x8')]||0xa;this[_0x47a5('0x9')]=_0xfdf934['strategy']||_0x47a5('0xa');this['Agents']=_0xfdf934['Agents'];this['mapAgentsId']={};this[_0x47a5('0xb')]=0x0;this[_0x47a5('0x1')]='';this['updateRouting']();this[_0x47a5('0xc')]();}OpenchannelQueue['prototype']['updateRouting']=function(){var _0x1f47f4=this[_0x47a5('0xd')][_0x47a5('0xe')];this[_0x47a5('0xd')]=_[_0x47a5('0xf')](this[_0x47a5('0x10')],'id');this[_0x47a5('0xd')]['_rr']=_0x1f47f4;};OpenchannelQueue[_0x47a5('0x11')][_0x47a5('0xc')]=function(){this[_0x47a5('0x12')]=0x0;this[_0x47a5('0x13')]=0x0;for(var _0x139f25=0x0;_0x139f25=0x0?this['available']:0x0;var _0x423a81={'id':this['id'],'available':this[_0x47a5('0x16')],'loggedIn':this[_0x47a5('0x12')],'name':this[_0x47a5('0x7')],'paused':this[_0x47a5('0x13')],'waiting':this[_0x47a5('0xb')]};var _0x2763d6=md5(JSON[_0x47a5('0x17')](_0x423a81));if(this[_0x47a5('0x1')]!==_0x2763d6){this['md5']=_0x2763d6;io['to'](util[_0x47a5('0x18')](_0x47a5('0x19'),_0x423a81['name']))[_0x47a5('0x1a')](_0x47a5('0x1b'),_0x423a81);}};module[_0x47a5('0x1c')]=OpenchannelQueue; \ No newline at end of file +var _0x2ef3=['stringify','format','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','timeout','strategy','beepall','Agents','mapAgentsId','waiting','prototype','updateRouting','_rr','paused','length','online','available','loggedIn','name'];(function(_0x47a40b,_0x443ecf){var _0x19610c=function(_0x4b8ce1){while(--_0x4b8ce1){_0x47a40b['push'](_0x47a40b['shift']());}};_0x19610c(++_0x443ecf);}(_0x2ef3,0xba));var _0x32ef=function(_0x372a0b,_0x253fba){_0x372a0b=_0x372a0b-0x0;var _0x1fad0a=_0x2ef3[_0x372a0b];return _0x1fad0a;};'use strict';var _=require(_0x32ef('0x0'));var md5=require(_0x32ef('0x1'));var util=require(_0x32ef('0x2'));var Redis=require(_0x32ef('0x3'));var config=require(_0x32ef('0x4'));config[_0x32ef('0x5')]=_['defaults'](config[_0x32ef('0x5')],{'host':_0x32ef('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x32ef('0x5')]));function OpenchannelQueue(_0x37dd1d){this['id']=_0x37dd1d['id']||0x0;this['name']=_0x37dd1d['name']||'';this[_0x32ef('0x7')]=_0x37dd1d[_0x32ef('0x7')]||0xa;this[_0x32ef('0x8')]=_0x37dd1d[_0x32ef('0x8')]||_0x32ef('0x9');this[_0x32ef('0xa')]=_0x37dd1d[_0x32ef('0xa')];this[_0x32ef('0xb')]={};this[_0x32ef('0xc')]=0x0;this[_0x32ef('0x1')]='';this['updateRouting']();this['updateRealtime']();}OpenchannelQueue[_0x32ef('0xd')][_0x32ef('0xe')]=function(){var _0x45bfd5=this[_0x32ef('0xb')]['_rr'];this[_0x32ef('0xb')]=_['map'](this[_0x32ef('0xa')],'id');this['mapAgentsId'][_0x32ef('0xf')]=_0x45bfd5;};OpenchannelQueue[_0x32ef('0xd')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x32ef('0x10')]=0x0;for(var _0x4d8009=0x0;_0x4d8009=0x0?this[_0x32ef('0x13')]:0x0;var _0x286bfb={'id':this['id'],'available':this['available'],'loggedIn':this[_0x32ef('0x14')],'name':this[_0x32ef('0x15')],'paused':this['paused'],'waiting':this[_0x32ef('0xc')]};var _0x314ef1=md5(JSON[_0x32ef('0x16')](_0x286bfb));if(this[_0x32ef('0x1')]!==_0x314ef1){this[_0x32ef('0x1')]=_0x314ef1;io['to'](util[_0x32ef('0x17')]('openchannel:queue:%s',_0x286bfb[_0x32ef('0x15')]))['emit'](_0x32ef('0x18'),_0x286bfb);}};module[_0x32ef('0x19')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 28935cf..8cc5ef8 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 _0xc818=['strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','prototype','map','_rr','updateRealtime','loggedIn','paused','length','online','smsPause','available','format','emit','exports','lodash','md5','util','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout'];(function(_0x8bd5e8,_0x220f83){var _0x15540f=function(_0x457fda){while(--_0x457fda){_0x8bd5e8['push'](_0x8bd5e8['shift']());}};_0x15540f(++_0x220f83);}(_0xc818,0x1e3));var _0x8c81=function(_0x2cb170,_0x5bc22e){_0x2cb170=_0x2cb170-0x0;var _0x5a4f5e=_0xc818[_0x2cb170];return _0x5a4f5e;};'use strict';var _=require(_0x8c81('0x0'));var md5=require(_0x8c81('0x1'));var util=require(_0x8c81('0x2'));var Redis=require(_0x8c81('0x3'));var config=require('../../../config/environment');config[_0x8c81('0x4')]=_[_0x8c81('0x5')](config[_0x8c81('0x4')],{'host':_0x8c81('0x6'),'port':0x18eb});var io=require(_0x8c81('0x7'))(new Redis(config[_0x8c81('0x4')]));function SmsQueue(_0x377b23){this['id']=_0x377b23['id']||0x0;this['name']=_0x377b23[_0x8c81('0x8')]||'';this[_0x8c81('0x9')]=_0x377b23[_0x8c81('0x9')]||0xa;this[_0x8c81('0xa')]=_0x377b23['strategy']||_0x8c81('0xb');this[_0x8c81('0xc')]=_0x377b23[_0x8c81('0xc')];this[_0x8c81('0xd')]={};this[_0x8c81('0xe')]=0x0;this[_0x8c81('0x1')]='';this[_0x8c81('0xf')]();this['updateRealtime']();}SmsQueue[_0x8c81('0x10')][_0x8c81('0xf')]=function(){var _0x639c8f=this[_0x8c81('0xd')]['_rr'];this[_0x8c81('0xd')]=_[_0x8c81('0x11')](this[_0x8c81('0xc')],'id');this[_0x8c81('0xd')][_0x8c81('0x12')]=_0x639c8f;};SmsQueue[_0x8c81('0x10')][_0x8c81('0x13')]=function(){this[_0x8c81('0x14')]=0x0;this[_0x8c81('0x15')]=0x0;for(var _0x5a6e72=0x0;_0x5a6e72=0x0?this['available']:0x0;var _0x31069a={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0x8c81('0x15')],'waiting':this[_0x8c81('0xe')]};var _0x2c3da3=md5(JSON['stringify'](_0x31069a));if(this[_0x8c81('0x1')]!==_0x2c3da3){this[_0x8c81('0x1')]=_0x2c3da3;io['to'](util[_0x8c81('0x1a')]('sms:queue:%s',_0x31069a[_0x8c81('0x8')]))[_0x8c81('0x1b')]('sms_queue:save',_0x31069a);}};module[_0x8c81('0x1c')]=SmsQueue; \ No newline at end of file +var _0x4b1f=['waiting','updateRealtime','prototype','updateRouting','mapAgentsId','_rr','map','paused','available','loggedIn','stringify','format','emit','sms_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','Agents'];(function(_0x3f55de,_0x3ae98f){var _0x2698de=function(_0x48f021){while(--_0x48f021){_0x3f55de['push'](_0x3f55de['shift']());}};_0x2698de(++_0x3ae98f);}(_0x4b1f,0x195));var _0xf4b1=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0x4b1f[_0x1589dd];return _0x1bddd1;};'use strict';var _=require(_0xf4b1('0x0'));var md5=require(_0xf4b1('0x1'));var util=require('util');var Redis=require(_0xf4b1('0x2'));var config=require(_0xf4b1('0x3'));config[_0xf4b1('0x4')]=_['defaults'](config[_0xf4b1('0x4')],{'host':_0xf4b1('0x5'),'port':0x18eb});var io=require(_0xf4b1('0x6'))(new Redis(config['redis']));function SmsQueue(_0x5f26a3){this['id']=_0x5f26a3['id']||0x0;this[_0xf4b1('0x7')]=_0x5f26a3[_0xf4b1('0x7')]||'';this[_0xf4b1('0x8')]=_0x5f26a3[_0xf4b1('0x8')]||0xa;this[_0xf4b1('0x9')]=_0x5f26a3['strategy']||'beepall';this['Agents']=_0x5f26a3[_0xf4b1('0xa')];this['mapAgentsId']={};this[_0xf4b1('0xb')]=0x0;this['md5']='';this['updateRouting']();this[_0xf4b1('0xc')]();}SmsQueue[_0xf4b1('0xd')][_0xf4b1('0xe')]=function(){var _0x253fa8=this[_0xf4b1('0xf')][_0xf4b1('0x10')];this[_0xf4b1('0xf')]=_[_0xf4b1('0x11')](this[_0xf4b1('0xa')],'id');this[_0xf4b1('0xf')][_0xf4b1('0x10')]=_0x253fa8;};SmsQueue[_0xf4b1('0xd')][_0xf4b1('0xc')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x3ea6f3=0x0;_0x3ea6f3=0x0?this[_0xf4b1('0x13')]:0x0;var _0x420f9e={'id':this['id'],'available':this[_0xf4b1('0x13')],'loggedIn':this[_0xf4b1('0x14')],'name':this[_0xf4b1('0x7')],'paused':this[_0xf4b1('0x12')],'waiting':this['waiting']};var _0x220cad=md5(JSON[_0xf4b1('0x15')](_0x420f9e));if(this['md5']!==_0x220cad){this[_0xf4b1('0x1')]=_0x220cad;io['to'](util[_0xf4b1('0x16')]('sms:queue:%s',_0x420f9e[_0xf4b1('0x7')]))[_0xf4b1('0x17')](_0xf4b1('0x18'),_0x420f9e);}};module[_0xf4b1('0x19')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index b316eaf..793364c 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 _0xf640=['name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','available','stringify','format','whatsapp:queue:%s','emit','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0xf640,0x1c8));var _0x0f64=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf640[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x0f64('0x0'));var md5=require(_0x0f64('0x1'));var util=require(_0x0f64('0x2'));var Redis=require(_0x0f64('0x3'));var config=require(_0x0f64('0x4'));config[_0x0f64('0x5')]=_[_0x0f64('0x6')](config[_0x0f64('0x5')],{'host':_0x0f64('0x7'),'port':0x18eb});var io=require(_0x0f64('0x8'))(new Redis(config[_0x0f64('0x5')]));function WhatsappQueue(_0x33f1cd){this['id']=_0x33f1cd['id']||0x0;this[_0x0f64('0x9')]=_0x33f1cd[_0x0f64('0x9')]||'';this[_0x0f64('0xa')]=_0x33f1cd[_0x0f64('0xa')]||0xa;this[_0x0f64('0xb')]=_0x33f1cd[_0x0f64('0xb')]||_0x0f64('0xc');this[_0x0f64('0xd')]=_0x33f1cd[_0x0f64('0xd')];this[_0x0f64('0xe')]={};this[_0x0f64('0xf')]=0x0;this[_0x0f64('0x1')]='';this[_0x0f64('0x10')]();this[_0x0f64('0x11')]();}WhatsappQueue[_0x0f64('0x12')]['updateRouting']=function(){var _0x1c72ac=this[_0x0f64('0xe')][_0x0f64('0x13')];this['mapAgentsId']=_[_0x0f64('0x14')](this['Agents'],'id');this['mapAgentsId'][_0x0f64('0x13')]=_0x1c72ac;};WhatsappQueue[_0x0f64('0x12')][_0x0f64('0x11')]=function(){this[_0x0f64('0x15')]=0x0;this[_0x0f64('0x16')]=0x0;for(var _0x43cdf1=0x0;_0x43cdf1=0x0?this['available']:0x0;var _0x3b45ca={'id':this['id'],'available':this[_0x0f64('0x19')],'loggedIn':this[_0x0f64('0x15')],'name':this['name'],'paused':this[_0x0f64('0x16')],'waiting':this['waiting']};var _0x42335d=md5(JSON[_0x0f64('0x1a')](_0x3b45ca));if(this[_0x0f64('0x1')]!==_0x42335d){this['md5']=_0x42335d;io['to'](util[_0x0f64('0x1b')](_0x0f64('0x1c'),_0x3b45ca['name']))[_0x0f64('0x1d')]('whatsapp_queue:save',_0x3b45ca);}};module[_0x0f64('0x1e')]=WhatsappQueue; \ No newline at end of file +var _0xd228=['socket.io-emitter','redis','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRealtime','prototype','updateRouting','map','_rr','paused','length','online','available','loggedIn','waiting','format','emit','exports','md5','ioredis','defaults'];(function(_0x232d90,_0x2525ee){var _0x1516c1=function(_0x2e1fce){while(--_0x2e1fce){_0x232d90['push'](_0x232d90['shift']());}};_0x1516c1(++_0x2525ee);}(_0xd228,0x142));var _0x8d22=function(_0x110bb7,_0x56c479){_0x110bb7=_0x110bb7-0x0;var _0x1e6ac2=_0xd228[_0x110bb7];return _0x1e6ac2;};'use strict';var _=require('lodash');var md5=require(_0x8d22('0x0'));var util=require('util');var Redis=require(_0x8d22('0x1'));var config=require('../../../config/environment');config['redis']=_[_0x8d22('0x2')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x8d22('0x3'))(new Redis(config[_0x8d22('0x4')]));function WhatsappQueue(_0x4b927b){this['id']=_0x4b927b['id']||0x0;this[_0x8d22('0x5')]=_0x4b927b['name']||'';this[_0x8d22('0x6')]=_0x4b927b[_0x8d22('0x6')]||0xa;this[_0x8d22('0x7')]=_0x4b927b[_0x8d22('0x7')]||_0x8d22('0x8');this[_0x8d22('0x9')]=_0x4b927b['Agents'];this[_0x8d22('0xa')]={};this['waiting']=0x0;this[_0x8d22('0x0')]='';this['updateRouting']();this[_0x8d22('0xb')]();}WhatsappQueue[_0x8d22('0xc')][_0x8d22('0xd')]=function(){var _0x14d4df=this[_0x8d22('0xa')]['_rr'];this['mapAgentsId']=_[_0x8d22('0xe')](this['Agents'],'id');this['mapAgentsId'][_0x8d22('0xf')]=_0x14d4df;};WhatsappQueue[_0x8d22('0xc')][_0x8d22('0xb')]=function(){this['loggedIn']=0x0;this[_0x8d22('0x10')]=0x0;for(var _0x5d5c14=0x0;_0x5d5c14=0x0?this['available']:0x0;var _0x5ae9d0={'id':this['id'],'available':this[_0x8d22('0x13')],'loggedIn':this[_0x8d22('0x14')],'name':this[_0x8d22('0x5')],'paused':this[_0x8d22('0x10')],'waiting':this[_0x8d22('0x15')]};var _0x2d8c42=md5(JSON['stringify'](_0x5ae9d0));if(this[_0x8d22('0x0')]!==_0x2d8c42){this['md5']=_0x2d8c42;io['to'](util[_0x8d22('0x16')]('whatsapp:queue:%s',_0x5ae9d0[_0x8d22('0x5')]))[_0x8d22('0x17')]('whatsapp_queue:save',_0x5ae9d0);}};module[_0x8d22('0x18')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index a955890..f015a17 100644 --- a/server/services/routing/realtime/index.js +++ b/server/services/routing/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'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(_0x1a4c9a,_0x4434f3){var _0x5a59fb=function(_0x3ad272){while(--_0x3ad272){_0x1a4c9a['push'](_0x1a4c9a['shift']());}};_0x5a59fb(++_0x4434f3);}(_0xb10b,0x12a));var _0xbb10=function(_0xe155f0,_0x2989c8){_0xe155f0=_0xe155f0-0x0;var _0x453005=_0xb10b[_0xe155f0];return _0x453005;};'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 92d7ef6..d567153 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 _0x9c94=['addTags','AddTagsToChatInteraction','../client','update','Request','UpdateChatInteraction','updateChatInteraction'];(function(_0x1f05be,_0x42ba89){var _0x387f12=function(_0x243be9){while(--_0x243be9){_0x1f05be['push'](_0x1f05be['shift']());}};_0x387f12(++_0x42ba89);}(_0x9c94,0x152));var _0x49c9=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0x9c94[_0x4b2436];return _0x4f5ab2;};'use strict';var client=require(_0x49c9('0x0'));exports[_0x49c9('0x1')]=function(_0x5d91cc,_0x37ac7b){return client[_0x49c9('0x2')](_0x49c9('0x3'),{'body':_0x37ac7b,'options':{'where':{'id':_0x5d91cc}},'log':_0x49c9('0x4')});};exports[_0x49c9('0x5')]=function(_0x5d5e67,_0x288ffd){return client[_0x49c9('0x2')](_0x49c9('0x6'),{'body':_0x288ffd,'options':{'where':{'id':_0x5d5e67}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0xf639=['Request','updateChatInteraction','addTags','AddTagsToChatInteraction','../client','update'];(function(_0x2a76e8,_0x5863df){var _0x12f2df=function(_0xd8a67d){while(--_0xd8a67d){_0x2a76e8['push'](_0x2a76e8['shift']());}};_0x12f2df(++_0x5863df);}(_0xf639,0x88));var _0x9f63=function(_0x33c3d3,_0x51eed3){_0x33c3d3=_0x33c3d3-0x0;var _0xf3a17f=_0xf639[_0x33c3d3];return _0xf3a17f;};'use strict';var client=require(_0x9f63('0x0'));exports[_0x9f63('0x1')]=function(_0x366582,_0x1c9bde){return client[_0x9f63('0x2')]('UpdateChatInteraction',{'body':_0x1c9bde,'options':{'where':{'id':_0x366582}},'log':_0x9f63('0x3')});};exports[_0x9f63('0x4')]=function(_0x17670d,_0x31b898){return client['Request'](_0x9f63('0x5'),{'body':_0x31b898,'options':{'where':{'id':_0x17670d}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index a306da3..336483d 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 _0xc03a=['createChatMessage','../client','create','Request'];(function(_0x538d62,_0xa0f3c0){var _0xd94905=function(_0x390458){while(--_0x390458){_0x538d62['push'](_0x538d62['shift']());}};_0xd94905(++_0xa0f3c0);}(_0xc03a,0x13d));var _0xac03=function(_0x5bca5f,_0x3ed435){_0x5bca5f=_0x5bca5f-0x0;var _0x22cd63=_0xc03a[_0x5bca5f];return _0x22cd63;};'use strict';var client=require(_0xac03('0x0'));exports[_0xac03('0x1')]=function(_0x28f030){return client[_0xac03('0x2')]('CreateChatMessage',{'body':_0x28f030,'log':_0xac03('0x3')});}; \ No newline at end of file +var _0xd778=['../client','Request','CreateChatMessage','createChatMessage'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0xd778,0x108));var _0x8d77=function(_0x245d02,_0x37dc04){_0x245d02=_0x245d02-0x0;var _0x46f057=_0xd778[_0x245d02];return _0x46f057;};'use strict';var client=require(_0x8d77('0x0'));exports['create']=function(_0xa800fa){return client[_0x8d77('0x1')](_0x8d77('0x2'),{'body':_0xa800fa,'log':_0x8d77('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 944c719..d3413da 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 _0xfd0f=['../client','getChatQueues','GetChatQueue','name','timeout','User','online','chatPause'];(function(_0x3f286c,_0x57345e){var _0x192c2b=function(_0x5d80a3){while(--_0x5d80a3){_0x3f286c['push'](_0x3f286c['shift']());}};_0x192c2b(++_0x57345e);}(_0xfd0f,0x1b8));var _0xffd0=function(_0x48b167,_0x17670e){_0x48b167=_0x48b167-0x0;var _0xfac0a4=_0xfd0f[_0x48b167];return _0xfac0a4;};'use strict';var client=require(_0xffd0('0x0'));exports[_0xffd0('0x1')]=function(){return function(){return client['Request'](_0xffd0('0x2'),{'options':{'raw':![],'attributes':['id',_0xffd0('0x3'),_0xffd0('0x4'),'strategy'],'include':[{'model':_0xffd0('0x5'),'as':'Agents','attributes':['id',_0xffd0('0x3'),_0xffd0('0x6'),_0xffd0('0x7')]}]},'log':_0xffd0('0x1')});};}; \ No newline at end of file +var _0x0763=['User','Agents','online','chatPause','getChatQueues','../client','Request','GetChatQueue','timeout','strategy'];(function(_0x2177e4,_0x47103a){var _0x2390f8=function(_0x15ea95){while(--_0x15ea95){_0x2177e4['push'](_0x2177e4['shift']());}};_0x2390f8(++_0x47103a);}(_0x0763,0x87));var _0x3076=function(_0x416cdc,_0x213b87){_0x416cdc=_0x416cdc-0x0;var _0x1931ce=_0x0763[_0x416cdc];return _0x1931ce;};'use strict';var client=require(_0x3076('0x0'));exports['getChatQueues']=function(){return function(){return client[_0x3076('0x1')](_0x3076('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x3076('0x3'),_0x3076('0x4')],'include':[{'model':_0x3076('0x5'),'as':_0x3076('0x6'),'attributes':['id','name',_0x3076('0x7'),_0x3076('0x8')]}]},'log':_0x3076('0x9')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 10b674d..5e722d9 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 _0x6ae0=['../client','create','Request','update','UpdateChatQueueReport','DESC'];(function(_0x3d4e04,_0x1dd6cd){var _0xd03747=function(_0x397f27){while(--_0x397f27){_0x3d4e04['push'](_0x3d4e04['shift']());}};_0xd03747(++_0x1dd6cd);}(_0x6ae0,0x192));var _0x06ae=function(_0x4940c4,_0x44bf9e){_0x4940c4=_0x4940c4-0x0;var _0x1f8347=_0x6ae0[_0x4940c4];return _0x1f8347;};'use strict';var client=require(_0x06ae('0x0'));exports[_0x06ae('0x1')]=function(_0x38d9c8){return client[_0x06ae('0x2')]('CreateChatQueueReport',{'body':_0x38d9c8,'log':'CreateChatQueueReport'});};exports[_0x06ae('0x3')]=function(_0x58c780,_0x104bb4){return client['Request'](_0x06ae('0x4'),{'body':_0x104bb4,'options':{'where':{'uniqueid':_0x58c780},'order':[['id',_0x06ae('0x5')]],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file +var _0x9cff=['create','Request','CreateChatQueueReport','update','UpdateChatQueueReport','DESC'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x9cff,0x1b0));var _0xf9cf=function(_0x316324,_0x3dfffe){_0x316324=_0x316324-0x0;var _0x3fb2da=_0x9cff[_0x316324];return _0x3fb2da;};'use strict';var client=require('../client');exports[_0xf9cf('0x0')]=function(_0x1e4896){return client[_0xf9cf('0x1')]('CreateChatQueueReport',{'body':_0x1e4896,'log':_0xf9cf('0x2')});};exports[_0xf9cf('0x3')]=function(_0x41a299,_0x5060e0){return client[_0xf9cf('0x1')](_0xf9cf('0x4'),{'body':_0x5060e0,'options':{'where':{'uniqueid':_0x41a299},'order':[['id',_0xf9cf('0x5')]],'limit':0x1},'log':_0xf9cf('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index da620ed..4ba7968 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(_0x1d83db,_0x89d115){var _0x2dc1d1=function(_0x13fdc3){while(--_0x13fdc3){_0x1d83db['push'](_0x1d83db['shift']());}};_0x2dc1d1(++_0x89d115);}(_0x7a54,0x106));var _0x47a5=function(_0x9c36a2,_0xaa7a06){_0x9c36a2=_0x9c36a2-0x0;var _0x15d57b=_0x7a54[_0x9c36a2];return _0x15d57b;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file +var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x43776a,_0x4eb74c){var _0x18eb8f=function(_0x319afb){while(--_0x319afb){_0x43776a['push'](_0x43776a['shift']());}};_0x18eb8f(++_0x4eb74c);}(_0x7a54,0x106));var _0x47a5=function(_0x4a71ed,_0x215219){_0x4a71ed=_0x4a71ed-0x0;var _0x7ef9b0=_0x7a54[_0x4a71ed];return _0x7ef9b0;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index 83b4bdf..1752a50 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 _0x91aa=['CreateFaxMessage','createFaxMessage','../client','create'];(function(_0x5a19fc,_0x58f9f4){var _0x34b413=function(_0x344feb){while(--_0x344feb){_0x5a19fc['push'](_0x5a19fc['shift']());}};_0x34b413(++_0x58f9f4);}(_0x91aa,0x1de));var _0xa91a=function(_0x1538b7,_0x236cf2){_0x1538b7=_0x1538b7-0x0;var _0x22baff=_0x91aa[_0x1538b7];return _0x22baff;};'use strict';var client=require(_0xa91a('0x0'));exports[_0xa91a('0x1')]=function(_0x4cfc6f){return client['Request'](_0xa91a('0x2'),{'body':_0x4cfc6f,'log':_0xa91a('0x3')});}; \ No newline at end of file +var _0xc20d=['CreateFaxMessage','createFaxMessage','Request'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xc20d,0x15e));var _0xdc20=function(_0x1b2422,_0x1e98d4){_0x1b2422=_0x1b2422-0x0;var _0x376573=_0xc20d[_0x1b2422];return _0x376573;};'use strict';var client=require('../client');exports['create']=function(_0x175204){return client[_0xdc20('0x0')](_0xdc20('0x1'),{'body':_0x175204,'log':_0xdc20('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 28bc205..ae74136 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 _0x409f=['online','faxPause','getFaxQueues','../client','GetFaxQueue','name','timeout','User'];(function(_0x50e81e,_0x1122d9){var _0x1b8401=function(_0x48b9ae){while(--_0x48b9ae){_0x50e81e['push'](_0x50e81e['shift']());}};_0x1b8401(++_0x1122d9);}(_0x409f,0x8b));var _0xf409=function(_0x24c914,_0x29257c){_0x24c914=_0x24c914-0x0;var _0x5af158=_0x409f[_0x24c914];return _0x5af158;};'use strict';var client=require(_0xf409('0x0'));exports['getFaxQueues']=function(){return function(){return client['Request'](_0xf409('0x1'),{'options':{'raw':![],'attributes':['id',_0xf409('0x2'),_0xf409('0x3'),'strategy'],'include':[{'model':_0xf409('0x4'),'as':'Agents','attributes':['id',_0xf409('0x2'),_0xf409('0x5'),_0xf409('0x6')]}]},'log':_0xf409('0x7')});};}; \ No newline at end of file +var _0x4c28=['../client','getFaxQueues','Request','GetFaxQueue','timeout','User','Agents','online'];(function(_0x5d8444,_0x3547b0){var _0x3801bf=function(_0x206291){while(--_0x206291){_0x5d8444['push'](_0x5d8444['shift']());}};_0x3801bf(++_0x3547b0);}(_0x4c28,0xc8));var _0x84c2=function(_0x2eec9c,_0x1b6425){_0x2eec9c=_0x2eec9c-0x0;var _0x5e6c2e=_0x4c28[_0x2eec9c];return _0x5e6c2e;};'use strict';var client=require(_0x84c2('0x0'));exports[_0x84c2('0x1')]=function(){return function(){return client[_0x84c2('0x2')](_0x84c2('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x84c2('0x4'),'strategy'],'include':[{'model':_0x84c2('0x5'),'as':_0x84c2('0x6'),'attributes':['id','name',_0x84c2('0x7'),'faxPause']}]},'log':_0x84c2('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index c5a60e5..537bea1 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 _0xf363=['UpdateFaxQueueReport','DESC','create','Request','CreateFaxQueueReport'];(function(_0x120ae5,_0x2be519){var _0x3878c6=function(_0x403a6e){while(--_0x403a6e){_0x120ae5['push'](_0x120ae5['shift']());}};_0x3878c6(++_0x2be519);}(_0xf363,0xd9));var _0x3f36=function(_0x4e6617,_0x2bc537){_0x4e6617=_0x4e6617-0x0;var _0x29cbf9=_0xf363[_0x4e6617];return _0x29cbf9;};'use strict';var client=require('../client');exports[_0x3f36('0x0')]=function(_0x1f935d){return client[_0x3f36('0x1')](_0x3f36('0x2'),{'body':_0x1f935d,'log':_0x3f36('0x2')});};exports['update']=function(_0x140a32,_0x46d735){return client[_0x3f36('0x1')](_0x3f36('0x3'),{'body':_0x46d735,'options':{'where':{'uniqueid':_0x140a32},'order':[['id',_0x3f36('0x4')]],'limit':0x1},'log':_0x3f36('0x3')});}; \ No newline at end of file +var _0x66c9=['UpdateFaxQueueReport','DESC','create','Request','CreateFaxQueueReport'];(function(_0x22ffaa,_0x1ec95c){var _0x4e0e23=function(_0x555575){while(--_0x555575){_0x22ffaa['push'](_0x22ffaa['shift']());}};_0x4e0e23(++_0x1ec95c);}(_0x66c9,0x16a));var _0x966c=function(_0x2365ae,_0xc2762b){_0x2365ae=_0x2365ae-0x0;var _0xf4a76b=_0x66c9[_0x2365ae];return _0xf4a76b;};'use strict';var client=require('../client');exports[_0x966c('0x0')]=function(_0x15d5f2){return client[_0x966c('0x1')](_0x966c('0x2'),{'body':_0x15d5f2,'log':'CreateFaxQueueReport'});};exports['update']=function(_0x44696e,_0xf89d9){return client[_0x966c('0x1')](_0x966c('0x3'),{'body':_0xf89d9,'options':{'where':{'uniqueid':_0x44696e},'order':[['id',_0x966c('0x4')]],'limit':0x1},'log':_0x966c('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 77aa828..b6cc615 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 _0xcc6c=['name','getIntervals','Request','GetInterval','Interval'];(function(_0x46d80d,_0x485a53){var _0x2089ee=function(_0x4b4ec2){while(--_0x4b4ec2){_0x46d80d['push'](_0x46d80d['shift']());}};_0x2089ee(++_0x485a53);}(_0xcc6c,0x128));var _0xccc6=function(_0x4d9584,_0x247d9a){_0x4d9584=_0x4d9584-0x0;var _0x4e9ef3=_0xcc6c[_0x4d9584];return _0x4e9ef3;};'use strict';var client=require('../client');exports[_0xccc6('0x0')]=function(){return function(){return client[_0xccc6('0x1')](_0xccc6('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0xccc6('0x3'),'as':'Intervals','attributes':['id',_0xccc6('0x4'),'interval']}]},'log':_0xccc6('0x0')});};}; \ No newline at end of file +var _0x0282=['name','Interval','Intervals','interval','../client','getIntervals','Request'];(function(_0x2a2166,_0x3a077f){var _0x3bcf50=function(_0x3f0300){while(--_0x3f0300){_0x2a2166['push'](_0x2a2166['shift']());}};_0x3bcf50(++_0x3a077f);}(_0x0282,0x17e));var _0x2028=function(_0x43c668,_0x51242f){_0x43c668=_0x43c668-0x0;var _0x48adab=_0x0282[_0x43c668];return _0x48adab;};'use strict';var client=require(_0x2028('0x0'));exports[_0x2028('0x1')]=function(){return function(){return client[_0x2028('0x2')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x2028('0x3')],'include':[{'model':_0x2028('0x4'),'as':_0x2028('0x5'),'attributes':['id','name',_0x2028('0x6')]}]},'log':_0x2028('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 216a897..e924ede 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 _0x4b17=['addTagsToChatInteraction','../client','Request','UpdateMailInteraction','addTags','AddTagsToMailInteraction'];(function(_0x38cd4c,_0x2702cf){var _0x31f5a4=function(_0x5cbeb0){while(--_0x5cbeb0){_0x38cd4c['push'](_0x38cd4c['shift']());}};_0x31f5a4(++_0x2702cf);}(_0x4b17,0x10f));var _0x74b1=function(_0x470b0a,_0x2889d6){_0x470b0a=_0x470b0a-0x0;var _0x4463f6=_0x4b17[_0x470b0a];return _0x4463f6;};'use strict';var client=require(_0x74b1('0x0'));exports['update']=function(_0xd6951,_0x5483a2){return client[_0x74b1('0x1')](_0x74b1('0x2'),{'body':_0x5483a2,'options':{'where':{'id':_0xd6951}},'log':'updateMailInteraction'});};exports[_0x74b1('0x3')]=function(_0x4f206f,_0x4fdea2){return client[_0x74b1('0x1')](_0x74b1('0x4'),{'body':_0x4fdea2,'options':{'where':{'id':_0x4f206f}},'log':_0x74b1('0x5')});}; \ No newline at end of file +var _0xf4f4=['addTags','AddTagsToMailInteraction','addTagsToChatInteraction','../client','update','Request','UpdateMailInteraction','updateMailInteraction'];(function(_0x235405,_0x419c23){var _0x2f4018=function(_0x252ecb){while(--_0x252ecb){_0x235405['push'](_0x235405['shift']());}};_0x2f4018(++_0x419c23);}(_0xf4f4,0xe3));var _0x4f4f=function(_0xba83b1,_0x3f81d1){_0xba83b1=_0xba83b1-0x0;var _0x60e057=_0xf4f4[_0xba83b1];return _0x60e057;};'use strict';var client=require(_0x4f4f('0x0'));exports[_0x4f4f('0x1')]=function(_0x533895,_0x16a496){return client[_0x4f4f('0x2')](_0x4f4f('0x3'),{'body':_0x16a496,'options':{'where':{'id':_0x533895}},'log':_0x4f4f('0x4')});};exports[_0x4f4f('0x5')]=function(_0x510b24,_0x5a752b){return client['Request'](_0x4f4f('0x6'),{'body':_0x5a752b,'options':{'where':{'id':_0x510b24}},'log':_0x4f4f('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index bf3c895..47cb043 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 _0x459e=['Request','createMailMessage','../client','create'];(function(_0x2002b3,_0x11e91c){var _0x2756f0=function(_0x4bf0b3){while(--_0x4bf0b3){_0x2002b3['push'](_0x2002b3['shift']());}};_0x2756f0(++_0x11e91c);}(_0x459e,0x196));var _0xe459=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x459e[_0x42cae2];return _0x5f256f;};'use strict';var client=require(_0xe459('0x0'));exports[_0xe459('0x1')]=function(_0x48e582){return client[_0xe459('0x2')]('CreateMailMessage',{'body':_0x48e582,'log':_0xe459('0x3')});}; \ No newline at end of file +var _0x5be5=['create','Request','CreateMailMessage'];(function(_0x27c6d9,_0x2847a8){var _0x35bc6c=function(_0x1bbfbe){while(--_0x1bbfbe){_0x27c6d9['push'](_0x27c6d9['shift']());}};_0x35bc6c(++_0x2847a8);}(_0x5be5,0x1a7));var _0x55be=function(_0x2947cc,_0x1b8829){_0x2947cc=_0x2947cc-0x0;var _0x3976be=_0x5be5[_0x2947cc];return _0x3976be;};'use strict';var client=require('../client');exports[_0x55be('0x0')]=function(_0x476ab4){return client[_0x55be('0x1')](_0x55be('0x2'),{'body':_0x476ab4,'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 ede36d4..9ea4b04 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 _0xba2f=['User','name','getMailQueues','Request','GetMailQueue','timeout','strategy'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0xba2f,0x106));var _0xfba2=function(_0x598e41,_0x4ae0cb){_0x598e41=_0x598e41-0x0;var _0x50a97b=_0xba2f[_0x598e41];return _0x50a97b;};'use strict';var client=require('../client');exports['getMailQueues']=function(){return function(){return client[_0xfba2('0x0')](_0xfba2('0x1'),{'options':{'raw':![],'attributes':['id','name',_0xfba2('0x2'),_0xfba2('0x3')],'include':[{'model':_0xfba2('0x4'),'as':'Agents','attributes':['id',_0xfba2('0x5'),'online','mailPause']}]},'log':_0xfba2('0x6')});};}; \ No newline at end of file +var _0x5a0f=['Agents','online','mailPause','getMailQueues','../client','Request','GetMailQueue','User'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x5a0f,0x1e4));var _0xf5a0=function(_0x14062c,_0x3d4816){_0x14062c=_0x14062c-0x0;var _0x52505=_0x5a0f[_0x14062c];return _0x52505;};'use strict';var client=require(_0xf5a0('0x0'));exports['getMailQueues']=function(){return function(){return client[_0xf5a0('0x1')](_0xf5a0('0x2'),{'options':{'raw':![],'attributes':['id','name','timeout','strategy'],'include':[{'model':_0xf5a0('0x3'),'as':_0xf5a0('0x4'),'attributes':['id','name',_0xf5a0('0x5'),_0xf5a0('0x6')]}]},'log':_0xf5a0('0x7')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 916321b..3dfd87b 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 _0x00a8=['CreateMailQueueReport','UpdateMailQueueReport','Request'];(function(_0x5ad0c6,_0x56ee17){var _0x167958=function(_0x32dd81){while(--_0x32dd81){_0x5ad0c6['push'](_0x5ad0c6['shift']());}};_0x167958(++_0x56ee17);}(_0x00a8,0xc8));var _0x800a=function(_0x4dbaf9,_0x22b711){_0x4dbaf9=_0x4dbaf9-0x0;var _0x502d7f=_0x00a8[_0x4dbaf9];return _0x502d7f;};'use strict';var client=require('../client');exports['create']=function(_0x5d9fd0){return client[_0x800a('0x0')](_0x800a('0x1'),{'body':_0x5d9fd0,'log':_0x800a('0x1')});};exports['update']=function(_0x4f58e1,_0x21fef0){return client[_0x800a('0x0')](_0x800a('0x2'),{'body':_0x21fef0,'options':{'where':{'uniqueid':_0x4f58e1},'order':[['id','DESC']],'limit':0x1},'log':_0x800a('0x2')});}; \ No newline at end of file +var _0xbe67=['DESC','../client','create','Request','CreateMailQueueReport','update','UpdateMailQueueReport'];(function(_0x397bd6,_0x5d161c){var _0x5bff33=function(_0x58043d){while(--_0x58043d){_0x397bd6['push'](_0x397bd6['shift']());}};_0x5bff33(++_0x5d161c);}(_0xbe67,0x15f));var _0x7be6=function(_0x32fe45,_0x20cc79){_0x32fe45=_0x32fe45-0x0;var _0xc98e1f=_0xbe67[_0x32fe45];return _0xc98e1f;};'use strict';var client=require(_0x7be6('0x0'));exports[_0x7be6('0x1')]=function(_0x4e757a){return client[_0x7be6('0x2')](_0x7be6('0x3'),{'body':_0x4e757a,'log':'CreateMailQueueReport'});};exports[_0x7be6('0x4')]=function(_0x4cd1ff,_0x4b3368){return client[_0x7be6('0x2')](_0x7be6('0x5'),{'body':_0x4b3368,'options':{'where':{'uniqueid':_0x4cd1ff},'order':[['id',_0x7be6('0x6')]],'limit':0x1},'log':_0x7be6('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 48206c0..943f42a 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 _0x5f60=['Request','updateOpenchannelInteraction','AddTagsToOpenchannelInteraction','../client','update'];(function(_0x4bfea8,_0x3e536b){var _0x4bc63f=function(_0x99971a){while(--_0x99971a){_0x4bfea8['push'](_0x4bfea8['shift']());}};_0x4bc63f(++_0x3e536b);}(_0x5f60,0xda));var _0x05f6=function(_0x433650,_0x2780ed){_0x433650=_0x433650-0x0;var _0x13ce1d=_0x5f60[_0x433650];return _0x13ce1d;};'use strict';var client=require(_0x05f6('0x0'));exports[_0x05f6('0x1')]=function(_0x586f5e,_0x17b147){return client[_0x05f6('0x2')]('UpdateOpenchannelInteraction',{'body':_0x17b147,'options':{'where':{'id':_0x586f5e}},'log':_0x05f6('0x3')});};exports['addTags']=function(_0x57fdd0,_0x2ddde5){return client['Request'](_0x05f6('0x4'),{'body':_0x2ddde5,'options':{'where':{'id':_0x57fdd0}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x7816=['update','Request','UpdateOpenchannelInteraction','addTags','addTagsToChatInteraction','../client'];(function(_0x48af81,_0x5bced3){var _0x3b038d=function(_0x5cb437){while(--_0x5cb437){_0x48af81['push'](_0x48af81['shift']());}};_0x3b038d(++_0x5bced3);}(_0x7816,0x197));var _0x6781=function(_0x47024a,_0x2cc60a){_0x47024a=_0x47024a-0x0;var _0xc021b8=_0x7816[_0x47024a];return _0xc021b8;};'use strict';var client=require(_0x6781('0x0'));exports[_0x6781('0x1')]=function(_0x2a86e5,_0x42decf){return client[_0x6781('0x2')](_0x6781('0x3'),{'body':_0x42decf,'options':{'where':{'id':_0x2a86e5}},'log':'updateOpenchannelInteraction'});};exports[_0x6781('0x4')]=function(_0xd3c6c4,_0x4147c8){return client[_0x6781('0x2')]('AddTagsToOpenchannelInteraction',{'body':_0x4147c8,'options':{'where':{'id':_0xd3c6c4}},'log':_0x6781('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index bc8f736..7c32572 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 _0x3ebe=['create','Request','CreateOpenchannelMessage','createOpenchannelMessage','../client'];(function(_0x10a4e4,_0x45e7de){var _0x1b9928=function(_0x470af1){while(--_0x470af1){_0x10a4e4['push'](_0x10a4e4['shift']());}};_0x1b9928(++_0x45e7de);}(_0x3ebe,0x1e9));var _0xe3eb=function(_0x3624ec,_0x526eda){_0x3624ec=_0x3624ec-0x0;var _0x528c68=_0x3ebe[_0x3624ec];return _0x528c68;};'use strict';var client=require(_0xe3eb('0x0'));exports[_0xe3eb('0x1')]=function(_0x3f9a5a){return client[_0xe3eb('0x2')](_0xe3eb('0x3'),{'body':_0x3f9a5a,'log':_0xe3eb('0x4')});}; \ No newline at end of file +var _0x3971=['create','Request','createOpenchannelMessage','../client'];(function(_0x474cb4,_0x1b5827){var _0x3a47bf=function(_0x5cb548){while(--_0x5cb548){_0x474cb4['push'](_0x474cb4['shift']());}};_0x3a47bf(++_0x1b5827);}(_0x3971,0x1b3));var _0x1397=function(_0x531d15,_0x599af5){_0x531d15=_0x531d15-0x0;var _0x271a18=_0x3971[_0x531d15];return _0x271a18;};'use strict';var client=require(_0x1397('0x0'));exports[_0x1397('0x1')]=function(_0x5ce6aa){return client[_0x1397('0x2')]('CreateOpenchannelMessage',{'body':_0x5ce6aa,'log':_0x1397('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 1ecd36a..e90f111 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 _0xf123=['getOpenchannelQueues','GetOpenchannelQueue','name','timeout','strategy','Agents','openchannelPause'];(function(_0x22b202,_0x45f344){var _0x4504d7=function(_0x282617){while(--_0x282617){_0x22b202['push'](_0x22b202['shift']());}};_0x4504d7(++_0x45f344);}(_0xf123,0x134));var _0x3f12=function(_0x568cf0,_0x1a44cb){_0x568cf0=_0x568cf0-0x0;var _0x360f81=_0xf123[_0x568cf0];return _0x360f81;};'use strict';var client=require('../client');exports[_0x3f12('0x0')]=function(){return function(){return client['Request'](_0x3f12('0x1'),{'options':{'raw':![],'attributes':['id',_0x3f12('0x2'),_0x3f12('0x3'),_0x3f12('0x4')],'include':[{'model':'User','as':_0x3f12('0x5'),'attributes':['id',_0x3f12('0x2'),'online',_0x3f12('0x6')]}]},'log':_0x3f12('0x0')});};}; \ No newline at end of file +var _0x7f8b=['User','Agents','online','../client','getOpenchannelQueues','Request','name','strategy'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x7f8b,0x10b));var _0xb7f8=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x7f8b[_0x126558];return _0x1f6d14;};'use strict';var client=require(_0xb7f8('0x0'));exports[_0xb7f8('0x1')]=function(){return function(){return client[_0xb7f8('0x2')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0xb7f8('0x3'),'timeout',_0xb7f8('0x4')],'include':[{'model':_0xb7f8('0x5'),'as':_0xb7f8('0x6'),'attributes':['id',_0xb7f8('0x3'),_0xb7f8('0x7'),'openchannelPause']}]},'log':_0xb7f8('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 4ddbcf2..3157d2d 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 _0x0f37=['DESC','UpdateOpenchannelQueueReport','create','CreateOpenchannelQueueReport','Request'];(function(_0x471057,_0x5d366a){var _0x8fd9fd=function(_0x58c995){while(--_0x58c995){_0x471057['push'](_0x471057['shift']());}};_0x8fd9fd(++_0x5d366a);}(_0x0f37,0x1c4));var _0x70f3=function(_0x9cbfe0,_0x56aada){_0x9cbfe0=_0x9cbfe0-0x0;var _0x1f1534=_0x0f37[_0x9cbfe0];return _0x1f1534;};'use strict';var client=require('../client');exports[_0x70f3('0x0')]=function(_0xbb3879){return client['Request'](_0x70f3('0x1'),{'body':_0xbb3879,'log':'CreateOpenchannelQueueReport'});};exports['update']=function(_0x389f98,_0x569676){return client[_0x70f3('0x2')]('UpdateOpenchannelQueueReport',{'body':_0x569676,'options':{'where':{'uniqueid':_0x389f98},'order':[['id',_0x70f3('0x3')]],'limit':0x1},'log':_0x70f3('0x4')});}; \ No newline at end of file +var _0x3590=['update','UpdateOpenchannelQueueReport','DESC','Request','CreateOpenchannelQueueReport'];(function(_0xb5b99e,_0x188991){var _0xb0817b=function(_0x32048b){while(--_0x32048b){_0xb5b99e['push'](_0xb5b99e['shift']());}};_0xb0817b(++_0x188991);}(_0x3590,0x120));var _0x0359=function(_0x238bc9,_0x53f9b1){_0x238bc9=_0x238bc9-0x0;var _0xda1eac=_0x3590[_0x238bc9];return _0xda1eac;};'use strict';var client=require('../client');exports['create']=function(_0x5b2698){return client[_0x0359('0x0')](_0x0359('0x1'),{'body':_0x5b2698,'log':_0x0359('0x1')});};exports[_0x0359('0x2')]=function(_0x2d7e38,_0x37e8ff){return client[_0x0359('0x0')](_0x0359('0x3'),{'body':_0x37e8ff,'options':{'where':{'uniqueid':_0x2d7e38},'order':[['id',_0x0359('0x4')]],'limit':0x1},'log':_0x0359('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 49dfcfd..26ff84d 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 _0xe4d9=['AddTagsToSmsInteraction','../client','update','Request','addTags'];(function(_0x493f1d,_0x5909d1){var _0x1326af=function(_0x28d7dd){while(--_0x28d7dd){_0x493f1d['push'](_0x493f1d['shift']());}};_0x1326af(++_0x5909d1);}(_0xe4d9,0x141));var _0x9e4d=function(_0x433c2c,_0x4255d7){_0x433c2c=_0x433c2c-0x0;var _0x1255a0=_0xe4d9[_0x433c2c];return _0x1255a0;};'use strict';var client=require(_0x9e4d('0x0'));exports[_0x9e4d('0x1')]=function(_0x1dadc1,_0x484e02){return client[_0x9e4d('0x2')]('UpdateSmsInteraction',{'body':_0x484e02,'options':{'where':{'id':_0x1dadc1}},'log':'updateSmsInteraction'});};exports[_0x9e4d('0x3')]=function(_0x228328,_0x581985){return client[_0x9e4d('0x2')](_0x9e4d('0x4'),{'body':_0x581985,'options':{'where':{'id':_0x228328}},'log':'addTagsToSmsInteraction'});}; \ No newline at end of file +var _0xc818=['../client','update','UpdateSmsInteraction','updateSmsInteraction','addTags','Request','AddTagsToSmsInteraction'];(function(_0x48e71a,_0x4fa4c3){var _0x28672d=function(_0x2da5f8){while(--_0x2da5f8){_0x48e71a['push'](_0x48e71a['shift']());}};_0x28672d(++_0x4fa4c3);}(_0xc818,0x1e3));var _0x8c81=function(_0x3cf613,_0x1a4481){_0x3cf613=_0x3cf613-0x0;var _0x6822c9=_0xc818[_0x3cf613];return _0x6822c9;};'use strict';var client=require(_0x8c81('0x0'));exports[_0x8c81('0x1')]=function(_0x2ebf7a,_0x42192c){return client['Request'](_0x8c81('0x2'),{'body':_0x42192c,'options':{'where':{'id':_0x2ebf7a}},'log':_0x8c81('0x3')});};exports[_0x8c81('0x4')]=function(_0x7e329f,_0x1a61ab){return client[_0x8c81('0x5')](_0x8c81('0x6'),{'body':_0x1a61ab,'options':{'where':{'id':_0x7e329f}},'log':'addTagsToSmsInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 1301575..4917f9f 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 _0x7358=['Request','CreateSmsMessage','createSmsMessage','../client'];(function(_0x426eb4,_0x3cbca3){var _0x5a7a7c=function(_0x4c28ef){while(--_0x4c28ef){_0x426eb4['push'](_0x426eb4['shift']());}};_0x5a7a7c(++_0x3cbca3);}(_0x7358,0x133));var _0x8735=function(_0x1e1ceb,_0x2c7a51){_0x1e1ceb=_0x1e1ceb-0x0;var _0x5288b0=_0x7358[_0x1e1ceb];return _0x5288b0;};'use strict';var client=require(_0x8735('0x0'));exports['create']=function(_0x1566ec){return client[_0x8735('0x1')](_0x8735('0x2'),{'body':_0x1566ec,'log':_0x8735('0x3')});}; \ No newline at end of file +var _0x4577=['create','Request','../client'];(function(_0x2bd701,_0x436750){var _0x4778d2=function(_0x2203a9){while(--_0x2203a9){_0x2bd701['push'](_0x2bd701['shift']());}};_0x4778d2(++_0x436750);}(_0x4577,0x164));var _0x7457=function(_0x1232ec,_0x2df4b1){_0x1232ec=_0x1232ec-0x0;var _0x4483b4=_0x4577[_0x1232ec];return _0x4483b4;};'use strict';var client=require(_0x7457('0x0'));exports[_0x7457('0x1')]=function(_0x2586f5){return client[_0x7457('0x2')]('CreateSmsMessage',{'body':_0x2586f5,'log':'createSmsMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 34367f8..bd2c119 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 _0xa9e0=['name','online','smsPause','../client','getSmsQueues','Request','timeout','User','Agents'];(function(_0x5267c3,_0x129f30){var _0x34b129=function(_0x266e60){while(--_0x266e60){_0x5267c3['push'](_0x5267c3['shift']());}};_0x34b129(++_0x129f30);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'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 +var _0x0713=['getSmsQueues','Request','GetSmsQueue','name','timeout','strategy','Agents','online','smsPause'];(function(_0x12d013,_0x286e4c){var _0x54220c=function(_0x31d518){while(--_0x31d518){_0x12d013['push'](_0x12d013['shift']());}};_0x54220c(++_0x286e4c);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':![],'attributes':['id',_0x3071('0x2'),_0x3071('0x3'),_0x3071('0x4')],'include':[{'model':'User','as':_0x3071('0x5'),'attributes':['id',_0x3071('0x2'),_0x3071('0x6'),_0x3071('0x7')]}]},'log':_0x3071('0x8')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index f395e8c..98970ce 100644 --- a/server/services/routing/rpc/smsQueueReport.js +++ b/server/services/routing/rpc/smsQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['create','CreateSmsQueueReport','update','UpdateSmsQueueReport','../client'];(function(_0x295578,_0x3fb00f){var _0x39947c=function(_0xfc5e8d){while(--_0xfc5e8d){_0x295578['push'](_0x295578['shift']());}};_0x39947c(++_0x3fb00f);}(_0x70e0,0x17b));var _0x070e=function(_0x57da56,_0x4a52cd){_0x57da56=_0x57da56-0x0;var _0x5cf252=_0x70e0[_0x57da56];return _0x5cf252;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(_0x198c2e){return client['Request']('CreateSmsQueueReport',{'body':_0x198c2e,'log':_0x070e('0x2')});};exports[_0x070e('0x3')]=function(_0x277d32,_0x2593e5){return client['Request'](_0x070e('0x4'),{'body':_0x2593e5,'options':{'where':{'uniqueid':_0x277d32},'order':[['id','DESC']],'limit':0x1},'log':_0x070e('0x4')});}; \ No newline at end of file +var _0x3e74=['CreateSmsQueueReport','UpdateSmsQueueReport','DESC','../client','Request'];(function(_0x1689be,_0x5d145b){var _0xa488a3=function(_0x54a5e8){while(--_0x54a5e8){_0x1689be['push'](_0x1689be['shift']());}};_0xa488a3(++_0x5d145b);}(_0x3e74,0x175));var _0x43e7=function(_0x3d69ba,_0x34bc7c){_0x3d69ba=_0x3d69ba-0x0;var _0x1d11f8=_0x3e74[_0x3d69ba];return _0x1d11f8;};'use strict';var client=require(_0x43e7('0x0'));exports['create']=function(_0x349480){return client[_0x43e7('0x1')](_0x43e7('0x2'),{'body':_0x349480,'log':'CreateSmsQueueReport'});};exports['update']=function(_0xc58479,_0x4f9bbe){return client[_0x43e7('0x1')](_0x43e7('0x3'),{'body':_0x4f9bbe,'options':{'where':{'uniqueid':_0xc58479},'order':[['id',_0x43e7('0x4')]],'limit':0x1},'log':_0x43e7('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 089d3a6..cc29ec5 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(_0x4080d8,_0x298f9b){var _0x3d3bab=function(_0x159ef4){while(--_0x159ef4){_0x4080d8['push'](_0x4080d8['shift']());}};_0x3d3bab(++_0x298f9b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'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(_0x3139d0,_0x8b561b){var _0x42a463=function(_0x21fac8){while(--_0x21fac8){_0x3139d0['push'](_0x3139d0['shift']());}};_0x42a463(++_0x8b561b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'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 5a9beaa..782f0d7 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 _0xb422=['addTagsToWhatsappInteraction','updateWhatsappInteraction','Request'];(function(_0x105ed5,_0x48bff3){var _0x493752=function(_0x338eac){while(--_0x338eac){_0x105ed5['push'](_0x105ed5['shift']());}};_0x493752(++_0x48bff3);}(_0xb422,0x85));var _0x2b42=function(_0x3c58da,_0x50e809){_0x3c58da=_0x3c58da-0x0;var _0x17697e=_0xb422[_0x3c58da];return _0x17697e;};'use strict';var client=require('../client');exports['update']=function(_0x52ac9f,_0xcb2f7f){return client['Request']('UpdateWhatsappInteraction',{'body':_0xcb2f7f,'options':{'where':{'id':_0x52ac9f}},'log':_0x2b42('0x0')});};exports['addTags']=function(_0x14330f,_0x5df2d3){return client[_0x2b42('0x1')]('AddTagsToWhatsappInteraction',{'body':_0x5df2d3,'options':{'where':{'id':_0x14330f}},'log':_0x2b42('0x2')});}; \ No newline at end of file +var _0x6657=['Request','UpdateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client'];(function(_0x378f89,_0x13f5c7){var _0x3239d5=function(_0xd0423c){while(--_0xd0423c){_0x378f89['push'](_0x378f89['shift']());}};_0x3239d5(++_0x13f5c7);}(_0x6657,0x17f));var _0x7665=function(_0x403e73,_0x43a5df){_0x403e73=_0x403e73-0x0;var _0x5d59e2=_0x6657[_0x403e73];return _0x5d59e2;};'use strict';var client=require(_0x7665('0x0'));exports['update']=function(_0x1b588b,_0x43c954){return client[_0x7665('0x1')](_0x7665('0x2'),{'body':_0x43c954,'options':{'where':{'id':_0x1b588b}},'log':'updateWhatsappInteraction'});};exports[_0x7665('0x3')]=function(_0x2ed8cb,_0x26acc4){return client[_0x7665('0x1')](_0x7665('0x4'),{'body':_0x26acc4,'options':{'where':{'id':_0x2ed8cb}},'log':_0x7665('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index b7d6779..552652d 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 _0xf00c=['createWhatsappMessage','../client','create','Request','CreateWhatsappMessage'];(function(_0x16cd5b,_0x13f42c){var _0x10a472=function(_0x20a542){while(--_0x20a542){_0x16cd5b['push'](_0x16cd5b['shift']());}};_0x10a472(++_0x13f42c);}(_0xf00c,0x13c));var _0xcf00=function(_0x22d11f,_0x2145f2){_0x22d11f=_0x22d11f-0x0;var _0x1eb71a=_0xf00c[_0x22d11f];return _0x1eb71a;};'use strict';var client=require(_0xcf00('0x0'));exports[_0xcf00('0x1')]=function(_0x25a684){return client[_0xcf00('0x2')](_0xcf00('0x3'),{'body':_0x25a684,'log':_0xcf00('0x4')});}; \ No newline at end of file +var _0xf524=['CreateWhatsappMessage','createWhatsappMessage','create','Request'];(function(_0x4636e3,_0x970e9c){var _0x4f3a50=function(_0x308f1d){while(--_0x308f1d){_0x4636e3['push'](_0x4636e3['shift']());}};_0x4f3a50(++_0x970e9c);}(_0xf524,0x106));var _0x4f52=function(_0x4b1bb0,_0x7dc32b){_0x4b1bb0=_0x4b1bb0-0x0;var _0x549407=_0xf524[_0x4b1bb0];return _0x549407;};'use strict';var client=require('../client');exports[_0x4f52('0x0')]=function(_0x3f0d69){return client[_0x4f52('0x1')](_0x4f52('0x2'),{'body':_0x3f0d69,'log':_0x4f52('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 0f97b49..b9653c8 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 _0xce7f=['getWhatsappQueues','Request','GetWhatsappQueue','name','timeout','strategy','Agents','online','whatsappPause'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0xce7f,0x90));var _0xfce7=function(_0x3358ba,_0x24c5fc){_0x3358ba=_0x3358ba-0x0;var _0x296e73=_0xce7f[_0x3358ba];return _0x296e73;};'use strict';var client=require('../client');exports[_0xfce7('0x0')]=function(){return function(){return client[_0xfce7('0x1')](_0xfce7('0x2'),{'options':{'raw':![],'attributes':['id',_0xfce7('0x3'),_0xfce7('0x4'),_0xfce7('0x5')],'include':[{'model':'User','as':_0xfce7('0x6'),'attributes':['id',_0xfce7('0x3'),_0xfce7('0x7'),_0xfce7('0x8')]}]},'log':_0xfce7('0x0')});};}; \ No newline at end of file +var _0x2171=['getWhatsappQueues','Request','name','timeout','User','Agents','online','whatsappPause','../client'];(function(_0x319c12,_0x2a71a9){var _0x4cdc50=function(_0x9f1788){while(--_0x9f1788){_0x319c12['push'](_0x319c12['shift']());}};_0x4cdc50(++_0x2a71a9);}(_0x2171,0x8f));var _0x1217=function(_0x200960,_0x36ea91){_0x200960=_0x200960-0x0;var _0x188d9f=_0x2171[_0x200960];return _0x188d9f;};'use strict';var client=require(_0x1217('0x0'));exports[_0x1217('0x1')]=function(){return function(){return client[_0x1217('0x2')]('GetWhatsappQueue',{'options':{'raw':![],'attributes':['id',_0x1217('0x3'),_0x1217('0x4'),'strategy'],'include':[{'model':_0x1217('0x5'),'as':_0x1217('0x6'),'attributes':['id','name',_0x1217('0x7'),_0x1217('0x8')]}]},'log':_0x1217('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index a1646bb..be72112 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 _0xfb70=['CreateWhatsappQueueReport','UpdateWhatsappQueueReport','Request'];(function(_0x5756c6,_0x58290a){var _0x4b5806=function(_0x193246){while(--_0x193246){_0x5756c6['push'](_0x5756c6['shift']());}};_0x4b5806(++_0x58290a);}(_0xfb70,0x9e));var _0x0fb7=function(_0x398874,_0x598680){_0x398874=_0x398874-0x0;var _0x582b67=_0xfb70[_0x398874];return _0x582b67;};'use strict';var client=require('../client');exports['create']=function(_0x30ae25){return client[_0x0fb7('0x0')](_0x0fb7('0x1'),{'body':_0x30ae25,'log':_0x0fb7('0x1')});};exports['update']=function(_0x4668e5,_0x5f48c1){return client[_0x0fb7('0x0')](_0x0fb7('0x2'),{'body':_0x5f48c1,'options':{'where':{'uniqueid':_0x4668e5},'order':[['id','DESC']],'limit':0x1},'log':'UpdateWhatsappQueueReport'});}; \ No newline at end of file +var _0xd1b1=['CreateWhatsappQueueReport','update','DESC','../client','Request'];(function(_0x1bb2b4,_0x34a8ea){var _0x5b148a=function(_0x93e7e6){while(--_0x93e7e6){_0x1bb2b4['push'](_0x1bb2b4['shift']());}};_0x5b148a(++_0x34a8ea);}(_0xd1b1,0x1de));var _0x1d1b=function(_0x25ec63,_0x4e83d7){_0x25ec63=_0x25ec63-0x0;var _0x726048=_0xd1b1[_0x25ec63];return _0x726048;};'use strict';var client=require(_0x1d1b('0x0'));exports['create']=function(_0x1ad85a){return client[_0x1d1b('0x1')](_0x1d1b('0x2'),{'body':_0x1ad85a,'log':_0x1d1b('0x2')});};exports[_0x1d1b('0x3')]=function(_0x5a08cc,_0x5da558){return client[_0x1d1b('0x1')]('UpdateWhatsappQueueReport',{'body':_0x5da558,'options':{'where':{'uniqueid':_0x5a08cc},'order':[['id',_0x1d1b('0x4')]],'limit':0x1},'log':'UpdateWhatsappQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/server/applications/agent.js b/server/services/routing/server/applications/agent.js index ab846fe..a8bdf74 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 _0xf24f=['error','[%s][AGENT]\x20%s','map','join','stop','find','agents','timeout','createQueue','atimeout','channel','START:%s','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','rules','complete','[%s][AGENT]\x20ROUTING\x20END','next','agent','log','[%s][QUEUE]\x20%s','validate','lodash','seq-queue','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','format','name','toLowerCase','consequence','length'];(function(_0x313927,_0x2b3a6d){var _0x545b28=function(_0x1be96e){while(--_0x1be96e){_0x313927['push'](_0x313927['shift']());}};_0x545b28(++_0x2b3a6d);}(_0xf24f,0x192));var _0xff24=function(_0x2e7a43,_0x3b3df4){_0x2e7a43=_0x2e7a43-0x0;var _0x52e9e1=_0xf24f[_0x2e7a43];return _0x52e9e1;};'use strict';var schema=require(_0xff24('0x0'));var _=require(_0xff24('0x1'));var util=require('util');var seqqueue=require(_0xff24('0x2'));var logger=require(_0xff24('0x3'))(_0xff24('0x4'));var strategy=require(_0xff24('0x5'));var queue=schema({'name':{'type':_0xff24('0x6'),'required':!![],'message':_0xff24('0x7')},'timeout':{'type':_0xff24('0x8'),'message':_0xff24('0x9')}});function writeLog(_0x3b3766,_0x288a52,_0x259895){return logger[_0xff24('0xa')](util[_0xff24('0xb')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0x3b3766,_0x288a52['name'],_0x259895));}function handleFindAgent(_0x4c2904){return function(_0x2748c4){return _0x2748c4[_0xff24('0xc')]['toLowerCase']()===_0x4c2904[_0xff24('0xd')]();};}exports[_0xff24('0xe')]=function(_0x29a80e,_0x4ec4eb,_0x3fe8d2,_0x2c204a){return function(_0x3e0e92){try{var _0x19a968={'name':_0x4ec4eb[0x0],'timeout':_0x4ec4eb[0x1]};var _0x2f5b86=queue[_0xff24('0x0')](_0x19a968,{'typecast':!![]});if(_0x2f5b86[_0xff24('0xf')]){logger[_0xff24('0x10')](_0xff24('0x11'),_0x29a80e,_[_0xff24('0x12')](_0x2f5b86,'message')[_0xff24('0x13')](',\x20'));_0x3e0e92[_0xff24('0x14')]();}else{var _0x3693c8=_[_0xff24('0x15')](_0x3fe8d2[_0xff24('0x16')],handleFindAgent(_0x19a968[_0xff24('0xc')]));if(_0x3693c8){var _0x47e091=(_0x19a968[_0xff24('0x17')]||0xa)*0x3e8;var _0x4f89fa,_0x3c237d;var _0x313dec=seqqueue[_0xff24('0x18')](_0x47e091);_0x313dec['id']=_0x29a80e;_0x313dec[_0xff24('0x19')]=_0x47e091;_0x313dec[_0xff24('0x1a')]=_0x2c204a['channel'];writeLog(_0x29a80e,_0x3693c8,util['format'](_0xff24('0x1b'),_0x47e091));_0x3fe8d2['rules'][_0x29a80e]['on'](_0xff24('0x1c'),function(){logger['info'](_0xff24('0x1d'),_0x29a80e);clearTimeout(_0x3c237d);_0x3c237d=undefined;_0x313dec[_0xff24('0x1e')]();if(_0x3fe8d2['rules'][_0x29a80e]){delete _0x3fe8d2[_0xff24('0x1f')][_0x29a80e];}_0x3e0e92[_0xff24('0x14')]();});_0x3fe8d2[_0xff24('0x1f')][_0x29a80e]['on'](_0xff24('0x20'),function(){if(_0x3fe8d2[_0xff24('0x1f')][_0x29a80e]){delete _0x3fe8d2['rules'][_0x29a80e];}});_0x3c237d=setTimeout(function(){logger[_0xff24('0xa')](_0xff24('0x21'),_0x29a80e);clearTimeout(_0x3c237d);_0x313dec[_0xff24('0x1e')]();_0x3e0e92[_0xff24('0x22')]();},_0x47e091);strategy[_0xff24('0x23')](_0x313dec,_0x3693c8,_0x3fe8d2,_0x2c204a);}else{logger[_0xff24('0x10')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x29a80e,_0x19a968[_0xff24('0xc')]);_0x3e0e92['stop']();}}}catch(_0x102b13){console[_0xff24('0x24')](_0x102b13);logger[_0xff24('0x10')](_0xff24('0x25'),_0x29a80e,_0x102b13['stack']);_0x3e0e92[_0xff24('0x14')]();}};}; \ No newline at end of file +var _0xebca=['agents','timeout','createQueue','atimeout','channel','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20END','next','agent','log','stack','validate','lodash','../../../../config/logger','routing','./strategy','string','number','info','format','name','toLowerCase','error','[%s][AGENT]\x20%s','map','message','join','stop','find'];(function(_0x1ae4c0,_0x2212ed){var _0xe6b31b=function(_0x4320a0){while(--_0x4320a0){_0x1ae4c0['push'](_0x1ae4c0['shift']());}};_0xe6b31b(++_0x2212ed);}(_0xebca,0x1bf));var _0xaebc=function(_0x38fbc2,_0x641aa1){_0x38fbc2=_0x38fbc2-0x0;var _0x43c7d4=_0xebca[_0x38fbc2];return _0x43c7d4;};'use strict';var schema=require(_0xaebc('0x0'));var _=require(_0xaebc('0x1'));var util=require('util');var seqqueue=require('seq-queue');var logger=require(_0xaebc('0x2'))(_0xaebc('0x3'));var strategy=require(_0xaebc('0x4'));var queue=schema({'name':{'type':_0xaebc('0x5'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0xaebc('0x6'),'message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x25a4ed,_0x27a518,_0x8ab3f5){return logger[_0xaebc('0x7')](util[_0xaebc('0x8')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0x25a4ed,_0x27a518['name'],_0x8ab3f5));}function handleFindAgent(_0x2af5fb){return function(_0x3f8d68){return _0x3f8d68[_0xaebc('0x9')][_0xaebc('0xa')]()===_0x2af5fb[_0xaebc('0xa')]();};}exports['consequence']=function(_0x2122f,_0x9af3c3,_0x42bfa5,_0x2053cf){return function(_0x3122f4){try{var _0x40bd06={'name':_0x9af3c3[0x0],'timeout':_0x9af3c3[0x1]};var _0x3cb73b=queue[_0xaebc('0x0')](_0x40bd06,{'typecast':!![]});if(_0x3cb73b['length']){logger[_0xaebc('0xb')](_0xaebc('0xc'),_0x2122f,_[_0xaebc('0xd')](_0x3cb73b,_0xaebc('0xe'))[_0xaebc('0xf')](',\x20'));_0x3122f4[_0xaebc('0x10')]();}else{var _0xbf8820=_[_0xaebc('0x11')](_0x42bfa5[_0xaebc('0x12')],handleFindAgent(_0x40bd06[_0xaebc('0x9')]));if(_0xbf8820){var _0xe93210=(_0x40bd06[_0xaebc('0x13')]||0xa)*0x3e8;var _0x5ef043,_0x4fe1fd;var _0x5b9a12=seqqueue[_0xaebc('0x14')](_0xe93210);_0x5b9a12['id']=_0x2122f;_0x5b9a12[_0xaebc('0x15')]=_0xe93210;_0x5b9a12[_0xaebc('0x16')]=_0x2053cf[_0xaebc('0x16')];writeLog(_0x2122f,_0xbf8820,util[_0xaebc('0x8')](_0xaebc('0x17'),_0xe93210));_0x42bfa5[_0xaebc('0x18')][_0x2122f]['on'](_0xaebc('0x19'),function(){logger[_0xaebc('0x7')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x2122f);clearTimeout(_0x4fe1fd);_0x4fe1fd=undefined;_0x5b9a12['close']();if(_0x42bfa5[_0xaebc('0x18')][_0x2122f]){delete _0x42bfa5[_0xaebc('0x18')][_0x2122f];}_0x3122f4['stop']();});_0x42bfa5['rules'][_0x2122f]['on']('complete',function(){if(_0x42bfa5[_0xaebc('0x18')][_0x2122f]){delete _0x42bfa5[_0xaebc('0x18')][_0x2122f];}});_0x4fe1fd=setTimeout(function(){logger[_0xaebc('0x7')](_0xaebc('0x1a'),_0x2122f);clearTimeout(_0x4fe1fd);_0x5b9a12['close']();_0x3122f4[_0xaebc('0x1b')]();},_0xe93210);strategy[_0xaebc('0x1c')](_0x5b9a12,_0xbf8820,_0x42bfa5,_0x2053cf);}else{logger['error']('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x2122f,_0x40bd06[_0xaebc('0x9')]);_0x3122f4[_0xaebc('0x10')]();}}}catch(_0x2b3151){console[_0xaebc('0x1d')](_0x2b3151);logger['error']('[%s][QUEUE]\x20%s',_0x2122f,_0x2b3151[_0xaebc('0x1e')]);_0x3122f4[_0xaebc('0x10')]();}};}; \ 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 f68b9f1..7c69d61 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 _0xc9e3=['whatsapp','chat','ChatWebsiteId','AccountId','upperFirst','InteractionId','created','isEmpty','body','getMustacheRender','Message','create','then','[%s][AMAZONLEX]\x20%s','error','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','toString','postText','next','amazonlex','providerName','providerResponse','stringify','dialogState','Failed','catch','lodash','moment','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms'];(function(_0x5b0d2b,_0x3f8f19){var _0x378478=function(_0x28cfd2){while(--_0x28cfd2){_0x5b0d2b['push'](_0x5b0d2b['shift']());}};_0x378478(++_0x3f8f19);}(_0xc9e3,0x164));var _0x3c9e=function(_0xa0263b,_0x55c459){_0xa0263b=_0xa0263b-0x0;var _0x49f810=_0xc9e3[_0xa0263b];return _0x49f810;};'use strict';var _=require(_0x3c9e('0x0'));var moment=require(_0x3c9e('0x1'));var AWS=require(_0x3c9e('0x2'));var utils=require(_0x3c9e('0x3'));var logger=require(_0x3c9e('0x4'))(_0x3c9e('0x5'));var rpc={'chatMessage':require(_0x3c9e('0x6')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x3c9e('0x7')),'smsMessage':require(_0x3c9e('0x8')),'faxMessage':require(_0x3c9e('0x9')),'whatsappMessage':require(_0x3c9e('0xa'))};exports[_0x3c9e('0xb')]=function(_0x30ba22,_0x15397a){return function(_0x2bd90d){try{if(!_[_0x3c9e('0xc')](this[_0x3c9e('0xd')]['UserId'])){logger[_0x3c9e('0xe')]('[%s][AMAZONLEX]\x20%s',_0x30ba22,_0x3c9e('0xf'));return _0x2bd90d['next']();}var _0x1e4795={'ContactId':this[_0x3c9e('0x10')]['id'],'sentAt':moment()[_0x3c9e('0x11')](_0x3c9e('0x12')),'direction':_0x3c9e('0x13')};if(this[_0x3c9e('0x14')]===_0x3c9e('0x15')||this[_0x3c9e('0x14')]===_0x3c9e('0x16')){_0x1e4795['phone']=this[_0x3c9e('0xd')]['phone'];}var _0xfa5bc4=this[_0x3c9e('0x14')];if(_0xfa5bc4===_0x3c9e('0x17')){_0x1e4795[_0x3c9e('0x18')]=this['account']['id'];}else{_0x1e4795[_['upperFirst'](_0xfa5bc4)+_0x3c9e('0x19')]=this['account']['id'];}_0x1e4795[_[_0x3c9e('0x1a')](_0xfa5bc4)+_0x3c9e('0x1b')]=this['interaction']['id'];if(this[_0x3c9e('0xd')][_0x3c9e('0x1c')]){var _0x154de9=_0x15397a[0x4];if(!_[_0x3c9e('0x1d')](_0x154de9)){_0x1e4795[_0x3c9e('0x1e')]=utils[_0x3c9e('0x1f')](_0x154de9,this);return rpc[_0xfa5bc4+_0x3c9e('0x20')][_0x3c9e('0x21')](_0x1e4795)[_0x3c9e('0x22')](function(_0x5cb5ef){logger[_0x3c9e('0xe')](_0x3c9e('0x23'),_0x30ba22,_0x1e4795['body']);})['catch'](function(_0x124880){logger[_0x3c9e('0x24')](_0x3c9e('0x23'),_0x30ba22,JSON['stringify'](_0x124880));})[_0x3c9e('0x25')](function(){logger[_0x3c9e('0xe')](_0x3c9e('0x26'),_0x30ba22);_0x2bd90d[_0x3c9e('0x27')]();});}else{logger[_0x3c9e('0xe')](_0x3c9e('0x28'),_0x30ba22);_0x2bd90d[_0x3c9e('0x27')]();}}else{var _0x5c9837=this;var _0x46bf2d=new AWS[(_0x3c9e('0x29'))]({'accessKeyId':_0x15397a[0x0],'secretAccessKey':_0x15397a[0x1],'region':_0x15397a[0x2]});var _0x3b76ad={'botAlias':_0x3c9e('0x2a'),'botName':_0x15397a[0x3],'inputText':this[_0x3c9e('0x2b')]['body'],'userId':this[_0x3c9e('0x14')]+':'+this[_0x3c9e('0xd')]['id'][_0x3c9e('0x2c')]()};_0x46bf2d[_0x3c9e('0x2d')](_0x3b76ad,function(_0x5ec2e8,_0x447b64){if(_0x5ec2e8){logger[_0x3c9e('0x24')](_0x3c9e('0x23'),_0x30ba22,_0x5ec2e8[_0x3c9e('0x2b')]);_0x2bd90d[_0x3c9e('0x2e')]();}else if(_0x447b64&&_0x447b64[_0x3c9e('0x2b')]){_0x5c9837[_0x3c9e('0x1e')][_0x3c9e('0x2f')]=_0x447b64;_0x1e4795['body']=_0x447b64[_0x3c9e('0x2b')];_0x1e4795[_0x3c9e('0x30')]='amazonlex';_0x1e4795[_0x3c9e('0x31')]=JSON[_0x3c9e('0x32')](_0x447b64);return rpc[_0xfa5bc4+'Message']['create'](_0x1e4795)[_0x3c9e('0x22')](function(_0x42239a){logger[_0x3c9e('0xe')](_0x3c9e('0x23'),_0x30ba22,_0x1e4795[_0x3c9e('0x1e')]);if(_0x447b64[_0x3c9e('0x33')]==_0x3c9e('0x34')){_0x2bd90d[_0x3c9e('0x2e')]();}else{_0x2bd90d[_0x3c9e('0x27')]();}})[_0x3c9e('0x35')](function(_0x511ef9){logger[_0x3c9e('0x24')](_0x3c9e('0x23'),_0x30ba22,JSON['stringify'](_0x511ef9));_0x2bd90d[_0x3c9e('0x2e')]();});}else{_0x2bd90d[_0x3c9e('0x2e')]();}});}}catch(_0xdf2479){logger['error'](_0x3c9e('0x23'),_0x30ba22,JSON[_0x3c9e('0x32')](_0xdf2479));_0x2bd90d[_0x3c9e('0x27')]();}};}; \ No newline at end of file +var _0xdf4f=['upperFirst','InteractionId','created','isEmpty','body','getMustacheRender','then','catch','error','stringify','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','message','toString','postText','next','amazonlex','providerResponse','Message','lodash','moment','aws-sdk','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','YYYY-MM-DD\x20HH:mm:ss','channel','phone','chat','account'];(function(_0x564821,_0x4d037e){var _0x2b604d=function(_0x26fabf){while(--_0x26fabf){_0x564821['push'](_0x564821['shift']());}};_0x2b604d(++_0x4d037e);}(_0xdf4f,0x8b));var _0xfdf4=function(_0x1eb030,_0x16e60c){_0x1eb030=_0x1eb030-0x0;var _0x3f0845=_0xdf4f[_0x1eb030];return _0x3f0845;};'use strict';var _=require(_0xfdf4('0x0'));var moment=require(_0xfdf4('0x1'));var AWS=require(_0xfdf4('0x2'));var utils=require(_0xfdf4('0x3'));var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require(_0xfdf4('0x4')),'openchannelMessage':require(_0xfdf4('0x5')),'mailMessage':require(_0xfdf4('0x6')),'smsMessage':require(_0xfdf4('0x7')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage')};exports['consequence']=function(_0x400910,_0x3df50e){return function(_0x46d2fb){try{if(!_[_0xfdf4('0x8')](this[_0xfdf4('0x9')][_0xfdf4('0xa')])){logger[_0xfdf4('0xb')](_0xfdf4('0xc'),_0x400910,_0xfdf4('0xd'));return _0x46d2fb['next']();}var _0x547ea7={'ContactId':this[_0xfdf4('0xe')]['id'],'sentAt':moment()[_0xfdf4('0xf')](_0xfdf4('0x10')),'direction':'out'};if(this[_0xfdf4('0x11')]==='sms'||this[_0xfdf4('0x11')]==='whatsapp'){_0x547ea7[_0xfdf4('0x12')]=this[_0xfdf4('0x9')][_0xfdf4('0x12')];}var _0x33ea1b=this[_0xfdf4('0x11')];if(_0x33ea1b===_0xfdf4('0x13')){_0x547ea7['ChatWebsiteId']=this[_0xfdf4('0x14')]['id'];}else{_0x547ea7[_[_0xfdf4('0x15')](_0x33ea1b)+'AccountId']=this['account']['id'];}_0x547ea7[_['upperFirst'](_0x33ea1b)+_0xfdf4('0x16')]=this[_0xfdf4('0x9')]['id'];if(this[_0xfdf4('0x9')][_0xfdf4('0x17')]){var _0x13c351=_0x3df50e[0x4];if(!_[_0xfdf4('0x18')](_0x13c351)){_0x547ea7[_0xfdf4('0x19')]=utils[_0xfdf4('0x1a')](_0x13c351,this);return rpc[_0x33ea1b+'Message']['create'](_0x547ea7)[_0xfdf4('0x1b')](function(_0x192d96){logger[_0xfdf4('0xb')](_0xfdf4('0xc'),_0x400910,_0x547ea7[_0xfdf4('0x19')]);})[_0xfdf4('0x1c')](function(_0x234f4e){logger[_0xfdf4('0x1d')](_0xfdf4('0xc'),_0x400910,JSON[_0xfdf4('0x1e')](_0x234f4e));})['finally'](function(){logger[_0xfdf4('0xb')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x400910);_0x46d2fb[_0xfdf4('0x1f')]();});}else{logger['info'](_0xfdf4('0x20'),_0x400910);_0x46d2fb[_0xfdf4('0x1f')]();}}else{var _0x3d879e=this;var _0xb9abe4=new AWS['LexRuntime']({'accessKeyId':_0x3df50e[0x0],'secretAccessKey':_0x3df50e[0x1],'region':_0x3df50e[0x2]});var _0x22ed0d={'botAlias':'$LATEST','botName':_0x3df50e[0x3],'inputText':this[_0xfdf4('0x21')][_0xfdf4('0x19')],'userId':this[_0xfdf4('0x11')]+':'+this[_0xfdf4('0x9')]['id'][_0xfdf4('0x22')]()};_0xb9abe4[_0xfdf4('0x23')](_0x22ed0d,function(_0xd47961,_0x23fe3a){if(_0xd47961){logger['error']('[%s][AMAZONLEX]\x20%s',_0x400910,_0xd47961['message']);_0x46d2fb[_0xfdf4('0x24')]();}else if(_0x23fe3a&&_0x23fe3a[_0xfdf4('0x21')]){_0x3d879e[_0xfdf4('0x19')][_0xfdf4('0x25')]=_0x23fe3a;_0x547ea7[_0xfdf4('0x19')]=_0x23fe3a[_0xfdf4('0x21')];_0x547ea7['providerName']=_0xfdf4('0x25');_0x547ea7[_0xfdf4('0x26')]=JSON[_0xfdf4('0x1e')](_0x23fe3a);return rpc[_0x33ea1b+_0xfdf4('0x27')]['create'](_0x547ea7)['then'](function(_0x5390dc){logger['info'](_0xfdf4('0xc'),_0x400910,_0x547ea7[_0xfdf4('0x19')]);if(_0x23fe3a['dialogState']=='Failed'){_0x46d2fb[_0xfdf4('0x24')]();}else{_0x46d2fb[_0xfdf4('0x1f')]();}})['catch'](function(_0x22ea33){logger['error']('[%s][AMAZONLEX]\x20%s',_0x400910,JSON[_0xfdf4('0x1e')](_0x22ea33));_0x46d2fb[_0xfdf4('0x24')]();});}else{_0x46d2fb['next']();}});}}catch(_0x1e2737){logger[_0xfdf4('0x1d')](_0xfdf4('0xc'),_0x400910,JSON['stringify'](_0x1e2737));_0x46d2fb['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/autoreply.js b/server/services/routing/server/applications/autoreply.js index b89a296..e66f99f 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 _0xdcec=['catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','autoreplyExecuted','Interaction','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','create','stop','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','channel','isAutoreply','info','next','isNil','interaction','created','[%s][AUTOREPLY]\x20%s','Autoreply\x20already\x20sent','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','YYYY-MM-DD\x20HH:mm:ss','out','body','getMustacheRender','message','from','mail','phone','read','subject','Re:','Re:\x20','chat','account','upperFirst','InteractionId','Message','inReplyTo','messageId','html','','','headers','All','auto_reply','smtpOptions','then','stringify'];(function(_0x2f47b7,_0x49dd70){var _0x27f574=function(_0x15fd49){while(--_0x15fd49){_0x2f47b7['push'](_0x2f47b7['shift']());}};_0x27f574(++_0x49dd70);}(_0xdcec,0x112));var _0xcdce=function(_0x1b64dd,_0x2cf769){_0x1b64dd=_0x1b64dd-0x0;var _0xeb464c=_0xdcec[_0x1b64dd];return _0xeb464c;};'use strict';var _=require(_0xcdce('0x0'));var moment=require(_0xcdce('0x1'));var utils=require(_0xcdce('0x2'));var logger=require(_0xcdce('0x3'))(_0xcdce('0x4'));var rpc={'chatMessage':require(_0xcdce('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xcdce('0x6')),'smsMessage':require(_0xcdce('0x7')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xcdce('0x8')),'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0xcdce('0x9')),'mailInteraction':require(_0xcdce('0xa')),'smsInteraction':require(_0xcdce('0xb')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0xcdce('0xc'))};var mailRpc=require(_0xcdce('0xd'));exports[_0xcdce('0xe')]=function(_0x4df26e,_0x11957c,_0x2daee6,_0xc93033){return function(_0x4828df){try{var _0x4591cf=this[_0xcdce('0xf')];if(_0x4591cf==='mail'&&_0xc93033['body'][_0xcdce('0x10')]){logger[_0xcdce('0x11')]('[%s][AUTOREPLY]\x20%s',_0x4df26e,'Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)');return _0x4828df[_0xcdce('0x12')]();}if(_0x11957c[0x0]==='1'&&(_[_0xcdce('0x13')](this[_0xcdce('0x14')]['created'])||!this[_0xcdce('0x14')][_0xcdce('0x15')])){logger[_0xcdce('0x11')](_0xcdce('0x16'),_0x4df26e,_0xcdce('0x17'));return _0x4828df[_0xcdce('0x12')]();}if(_0x11957c[0x0]==='2'&&this[_0xcdce('0x14')]['autoreplyExecuted']){logger[_0xcdce('0x11')](_0xcdce('0x18'),_0x4df26e,_0xcdce('0x19'));return _0x4828df['next']();}var _0x3d60d6={'ContactId':this[_0xcdce('0x1a')]['id'],'sentAt':moment()['format'](_0xcdce('0x1b')),'direction':_0xcdce('0x1c')};if(this[_0xcdce('0xf')]==='mail'){_0x3d60d6[_0xcdce('0x1d')]=utils[_0xcdce('0x1e')](_0x11957c[0x2],this);}else{_0x3d60d6['body']=utils[_0xcdce('0x1e')](_0x11957c[0x1],this);}if(this[_0xcdce('0x1f')]){_0x3d60d6['to']=this[_0xcdce('0x1f')][_0xcdce('0x20')]||'';if(this['channel']===_0xcdce('0x21')&&_0x11957c[0x1]==='1'){_0x3d60d6['cc']=this['message']['cc']||'';}_0x3d60d6['from']=this[_0xcdce('0x1f')]['to']||'';_0x3d60d6[_0xcdce('0x22')]=this[_0xcdce('0x1f')][_0xcdce('0x22')]||'';_0x3d60d6[_0xcdce('0x23')]=!![];if(this[_0xcdce('0x1f')]['subject']){_0x3d60d6['subject']='';_0x3d60d6[_0xcdce('0x24')]+=_['startsWith'](this[_0xcdce('0x1f')][_0xcdce('0x24')],_0xcdce('0x25'))?'':_0xcdce('0x26');_0x3d60d6[_0xcdce('0x24')]+=this[_0xcdce('0x1f')]['subject'];}}if(this[_0xcdce('0xf')]===_0xcdce('0x27')){_0x3d60d6['ChatWebsiteId']=this[_0xcdce('0x28')]['id'];}else{_0x3d60d6[_[_0xcdce('0x29')](this[_0xcdce('0xf')])+'AccountId']=this['account']['id'];}_0x3d60d6[_['upperFirst'](this[_0xcdce('0xf')])+_0xcdce('0x2a')]=this[_0xcdce('0x14')]['id'];var _0x45df23=this[_0xcdce('0x14')];if(rpc[this['channel']+_0xcdce('0x2b')]){if(this[_0xcdce('0xf')]===_0xcdce('0x21')){_0x3d60d6[_0xcdce('0x2c')]=this[_0xcdce('0x1f')][_0xcdce('0x2d')];_0x3d60d6[_0xcdce('0x2e')]=_0xcdce('0x2f')+_['replace'](_0x3d60d6[_0xcdce('0x1d')],'','replace','','headers','auto-replied','All','sendMailMessage','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','messageId','create','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','Interaction','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','update','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','channel','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil'];(function(_0x5bb4e8,_0x44b756){var _0x2a86f2=function(_0x279ab2){while(--_0x279ab2){_0x5bb4e8['push'](_0x5bb4e8['shift']());}};_0x2a86f2(++_0x44b756);}(_0x7816,0x197));var _0x6781=function(_0x57ebf5,_0x3de518){_0x57ebf5=_0x57ebf5-0x0;var _0x2523c6=_0x7816[_0x57ebf5];return _0x2523c6;};'use strict';var _=require(_0x6781('0x0'));var moment=require(_0x6781('0x1'));var utils=require(_0x6781('0x2'));var logger=require(_0x6781('0x3'))(_0x6781('0x4'));var rpc={'chatMessage':require(_0x6781('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x6781('0x6')),'smsMessage':require(_0x6781('0x7')),'faxMessage':require(_0x6781('0x8')),'whatsappMessage':require(_0x6781('0x9')),'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x6781('0xa')),'mailInteraction':require(_0x6781('0xb')),'smsInteraction':require(_0x6781('0xc')),'faxInteraction':require(_0x6781('0xd')),'whatsappInteraction':require(_0x6781('0xe'))};var mailRpc=require(_0x6781('0xf'));exports[_0x6781('0x10')]=function(_0x46b3a4,_0x21b6d2,_0x35b5a1,_0x24a02e){return function(_0x172bf4){try{var _0x42b78d=this[_0x6781('0x11')];if(_0x42b78d==='mail'&&_0x24a02e[_0x6781('0x12')][_0x6781('0x13')]){logger[_0x6781('0x14')](_0x6781('0x15'),_0x46b3a4,_0x6781('0x16'));return _0x172bf4[_0x6781('0x17')]();}if(_0x21b6d2[0x0]==='1'&&(_[_0x6781('0x18')](this['interaction'][_0x6781('0x19')])||!this[_0x6781('0x1a')][_0x6781('0x19')])){logger[_0x6781('0x14')]('[%s][AUTOREPLY]\x20%s',_0x46b3a4,'Autoreply\x20already\x20sent');return _0x172bf4[_0x6781('0x17')]();}if(_0x21b6d2[0x0]==='2'&&this[_0x6781('0x1a')][_0x6781('0x1b')]){logger[_0x6781('0x14')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x46b3a4,_0x6781('0x1c'));return _0x172bf4[_0x6781('0x17')]();}var _0x559a09={'ContactId':this[_0x6781('0x1d')]['id'],'sentAt':moment()[_0x6781('0x1e')](_0x6781('0x1f')),'direction':'out'};if(this[_0x6781('0x11')]===_0x6781('0x20')){_0x559a09[_0x6781('0x12')]=utils[_0x6781('0x21')](_0x21b6d2[0x2],this);}else{_0x559a09[_0x6781('0x12')]=utils[_0x6781('0x21')](_0x21b6d2[0x1],this);}if(this['message']){_0x559a09['to']=this['message'][_0x6781('0x22')]||'';if(this[_0x6781('0x11')]===_0x6781('0x20')&&_0x21b6d2[0x1]==='1'){_0x559a09['cc']=this[_0x6781('0x23')]['cc']||'';}_0x559a09[_0x6781('0x22')]=this[_0x6781('0x23')]['to']||'';_0x559a09['phone']=this[_0x6781('0x23')][_0x6781('0x24')]||'';_0x559a09[_0x6781('0x25')]=!![];if(this['message'][_0x6781('0x26')]){_0x559a09['subject']='';_0x559a09['subject']+=_[_0x6781('0x27')](this[_0x6781('0x23')]['subject'],_0x6781('0x28'))?'':'Re:\x20';_0x559a09[_0x6781('0x26')]+=this[_0x6781('0x23')][_0x6781('0x26')];}}if(this[_0x6781('0x11')]===_0x6781('0x29')){_0x559a09['ChatWebsiteId']=this[_0x6781('0x2a')]['id'];}else{_0x559a09[_[_0x6781('0x2b')](this[_0x6781('0x11')])+_0x6781('0x2c')]=this['account']['id'];}_0x559a09[_[_0x6781('0x2b')](this[_0x6781('0x11')])+_0x6781('0x2d')]=this[_0x6781('0x1a')]['id'];var _0x106828=this[_0x6781('0x1a')];if(rpc[this[_0x6781('0x11')]+_0x6781('0x2e')]){if(this[_0x6781('0x11')]===_0x6781('0x20')){_0x559a09['inReplyTo']=this[_0x6781('0x23')]['messageId'];_0x559a09[_0x6781('0x2f')]=_0x6781('0x30')+_[_0x6781('0x31')](_0x559a09[_0x6781('0x12')],_0x6781('0x32'),_0x6781('0x33'))+_0x6781('0x34');_0x559a09[_0x6781('0x35')]={'Auto-Submitted':_0x6781('0x36'),'X-Auto-Response-Suppress':_0x6781('0x37'),'Precedence':'auto_reply'};return mailRpc[_0x6781('0x38')](this['account']['smtpOptions'],_0x559a09)[_0x6781('0x39')](function(_0x12f7f4){logger[_0x6781('0x14')](_0x6781('0x3a'),_0x46b3a4);_0x559a09[_0x6781('0x3b')]=_0x12f7f4[_0x6781('0x23')]['messageId'];return rpc[_0x42b78d+_0x6781('0x2e')][_0x6781('0x3c')](_0x559a09);})[_0x6781('0x39')](function(_0x4b9929){logger[_0x6781('0x14')](_0x6781('0x15'),_0x46b3a4,JSON[_0x6781('0x3d')](_0x4b9929));})[_0x6781('0x3e')](function(_0x2b4264){logger[_0x6781('0x3f')](_0x6781('0x40'),_0x46b3a4,JSON['stringify'](_0x2b4264));})[_0x6781('0x41')](function(){Promise[_0x6781('0x42')]()[_0x6781('0x39')](function(){if(_0x21b6d2[0x0]!=='2'||_0x106828[_0x6781('0x1b')])return;return rpc[_0x42b78d+_0x6781('0x43')]['update'](_0x106828['id'],{'autoreplyExecuted':!![]})[_0x6781('0x39')](function(_0x129f45){logger['info']('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x46b3a4,JSON[_0x6781('0x3d')](_0x129f45));})[_0x6781('0x3e')](function(_0x23c5e1){logger[_0x6781('0x3f')](_0x6781('0x44'),_0x46b3a4,JSON[_0x6781('0x3d')](_0x23c5e1));});})[_0x6781('0x39')](function(){_0x172bf4[_0x6781('0x17')]();});});}else{return rpc[this['channel']+'Message'][_0x6781('0x3c')](_0x559a09)[_0x6781('0x39')](function(){logger[_0x6781('0x14')](_0x6781('0x15'),_0x46b3a4,_0x559a09[_0x6781('0x12')]);})[_0x6781('0x3e')](function(_0x20e7ed){logger[_0x6781('0x3f')](_0x6781('0x15'),_0x46b3a4,JSON['stringify'](_0x20e7ed));})[_0x6781('0x41')](function(){Promise[_0x6781('0x42')]()[_0x6781('0x39')](function(){if(_0x21b6d2[0x0]!=='2'||_0x106828['autoreplyExecuted'])return;return rpc[_0x42b78d+_0x6781('0x43')][_0x6781('0x45')](_0x106828['id'],{'autoreplyExecuted':!![]})[_0x6781('0x39')](function(_0x503654){logger[_0x6781('0x14')](_0x6781('0x46'),_0x46b3a4,JSON[_0x6781('0x3d')](_0x503654));})[_0x6781('0x3e')](function(_0x4ce44c){logger[_0x6781('0x3f')](_0x6781('0x44'),_0x46b3a4,JSON[_0x6781('0x3d')](_0x4ce44c));});})[_0x6781('0x39')](function(){_0x172bf4[_0x6781('0x17')]();});});}}}catch(_0x286a7a){logger[_0x6781('0x3f')](_0x6781('0x15'),_0x46b3a4,JSON['stringify'](_0x286a7a));_0x172bf4[_0x6781('0x47')]();}};}; \ 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 7d6844c..e768bc8 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 _0x0743=['../../../../config/logger','routing','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','YYYY-MM-DD\x20HH:mm:ss','channel','Interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','interaction','catch','error','[%s][CLOSE]\x20%s','stringify','stop','moment'];(function(_0x4fabbe,_0xc514f3){var _0x5510dd=function(_0x1e7d23){while(--_0x1e7d23){_0x4fabbe['push'](_0x4fabbe['shift']());}};_0x5510dd(++_0xc514f3);}(_0x0743,0x1f3));var _0x3074=function(_0x3b611b,_0x5a8fa0){_0x3b611b=_0x3b611b-0x0;var _0x8c8d11=_0x0743[_0x3b611b];return _0x8c8d11;};'use strict';var moment=require(_0x3074('0x0'));var logger=require(_0x3074('0x1'))(_0x3074('0x2'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x3074('0x3')),'smsInteraction':require(_0x3074('0x4')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x3074('0x5'))};exports[_0x3074('0x6')]=function(_0x1d0f5d,_0x3100a0,_0x7517dc,_0x154d17){return function(_0x578ee8){try{logger[_0x3074('0x7')](_0x3074('0x8'),_0x1d0f5d,_0x3100a0[0x0]);var _0x1a6db2={'closed':0x1,'closedAt':moment()['format'](_0x3074('0x9')),'closeReason':'system','disposition':_0x3100a0[0x0]};if(rpc[_0x154d17[_0x3074('0xa')]+_0x3074('0xb')]){rpc[_0x154d17['channel']+'Interaction']['update'](_0x154d17['interaction']['id'],_0x1a6db2)[_0x3074('0xc')](function(_0x1940d8){logger[_0x3074('0x7')](_0x3074('0xd'),_0x1d0f5d,_0x154d17[_0x3074('0xe')]['id']);})[_0x3074('0xf')](function(_0x3fd597){logger[_0x3074('0x10')](_0x3074('0x11'),_0x1d0f5d,JSON[_0x3074('0x12')](_0x3fd597));})['finally'](function(){_0x578ee8['stop']();});}}catch(_0x34af89){logger['error'](_0x3074('0x11'),_0x1d0f5d,JSON[_0x3074('0x12')](_0x34af89));_0x578ee8[_0x3074('0x13')]();}};}; \ No newline at end of file +var _0xf58a=['error','[%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','format','YYYY-MM-DD\x20HH:mm:ss','channel','Interaction','update','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch'];(function(_0x8efae4,_0x2b8c5e){var _0x2b8926=function(_0x2d317a){while(--_0x2d317a){_0x8efae4['push'](_0x8efae4['shift']());}};_0x2b8926(++_0x2b8c5e);}(_0xf58a,0x147));var _0xaf58=function(_0x42a0fd,_0x6f3cb3){_0x42a0fd=_0x42a0fd-0x0;var _0x18181b=_0xf58a[_0x42a0fd];return _0x18181b;};'use strict';var moment=require(_0xaf58('0x0'));var logger=require(_0xaf58('0x1'))('routing');var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0xaf58('0x2')),'mailInteraction':require(_0xaf58('0x3')),'faxInteraction':require(_0xaf58('0x4')),'whatsappInteraction':require(_0xaf58('0x5'))};exports[_0xaf58('0x6')]=function(_0x5b150a,_0x82a3a5,_0x367617,_0xa2a6e9){return function(_0x3f37da){try{logger[_0xaf58('0x7')](_0xaf58('0x8'),_0x5b150a,_0x82a3a5[0x0]);var _0x2264e8={'closed':0x1,'closedAt':moment()[_0xaf58('0x9')](_0xaf58('0xa')),'closeReason':'system','disposition':_0x82a3a5[0x0]};if(rpc[_0xa2a6e9[_0xaf58('0xb')]+_0xaf58('0xc')]){rpc[_0xa2a6e9['channel']+'Interaction'][_0xaf58('0xd')](_0xa2a6e9[_0xaf58('0xe')]['id'],_0x2264e8)[_0xaf58('0xf')](function(_0x444d02){logger[_0xaf58('0x7')](_0xaf58('0x10'),_0x5b150a,_0xa2a6e9['interaction']['id']);})[_0xaf58('0x11')](function(_0x4c90d5){logger[_0xaf58('0x12')](_0xaf58('0x13'),_0x5b150a,JSON[_0xaf58('0x14')](_0x4c90d5));})[_0xaf58('0x15')](function(){_0x3f37da[_0xaf58('0x16')]();});}}catch(_0xfa5a31){logger['error'](_0xaf58('0x13'),_0x5b150a,JSON['stringify'](_0xfa5a31));_0x3f37da['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 ce791e8..61063f9 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 _0xee8f=['format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','phone','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','Message','create','body','error','[%s][DIALOGFLOW]\x20%s','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','fulfillment','speech','providerResponse','result','metadata','endConversation','catch','moment','md5','./utils','../../../../config/logger','routing','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','interaction','UserId','info','next','contact'];(function(_0xc67528,_0x24e2fb){var _0x38e26d=function(_0x1b0efe){while(--_0x1b0efe){_0xc67528['push'](_0xc67528['shift']());}};_0x38e26d(++_0x24e2fb);}(_0xee8f,0x1ed));var _0xfee8=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xee8f[_0x502c7d];return _0x30b7ed;};'use strict';var _=require('lodash');var moment=require(_0xfee8('0x0'));var apiai=require('apiai-promise');var md5=require(_0xfee8('0x1'));var utils=require(_0xfee8('0x2'));var logger=require(_0xfee8('0x3'))(_0xfee8('0x4'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xfee8('0x5')),'faxMessage':require(_0xfee8('0x6')),'whatsappMessage':require(_0xfee8('0x7'))};exports['consequence']=function(_0x1edd18,_0x38d68c){return function(_0x5d9ae1){try{if(!_['isNil'](this[_0xfee8('0x8')][_0xfee8('0x9')])){logger[_0xfee8('0xa')]('[%s][DIALOGFLOW]\x20%s',_0x1edd18,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x5d9ae1[_0xfee8('0xb')]();}var _0x24e24c={'ContactId':this[_0xfee8('0xc')]['id'],'sentAt':moment()[_0xfee8('0xd')](_0xfee8('0xe')),'direction':_0xfee8('0xf')};if(this[_0xfee8('0x10')]===_0xfee8('0x11')||this['channel']==='whatsapp'){_0x24e24c['phone']=this[_0xfee8('0x8')][_0xfee8('0x12')];}var _0x25c0cf=this['channel'];if(_0x25c0cf==='chat'){_0x24e24c[_0xfee8('0x13')]=this[_0xfee8('0x14')]['id'];}else{_0x24e24c[_[_0xfee8('0x15')](_0x25c0cf)+_0xfee8('0x16')]=this[_0xfee8('0x14')]['id'];}_0x24e24c[_[_0xfee8('0x15')](_0x25c0cf)+_0xfee8('0x17')]=this[_0xfee8('0x8')]['id'];if(this[_0xfee8('0x8')][_0xfee8('0x18')]){var _0x3e3c76=_0x38d68c[0x2];if(!_[_0xfee8('0x19')](_0x3e3c76)){_0x24e24c['body']=utils['getMustacheRender'](_0x3e3c76,this);return rpc[_0x25c0cf+_0xfee8('0x1a')][_0xfee8('0x1b')](_0x24e24c)['then'](function(_0x2c0d1e){logger[_0xfee8('0xa')]('[%s][DIALOGFLOW]\x20%s',_0x1edd18,_0x24e24c[_0xfee8('0x1c')]);})['catch'](function(_0x5bc4ef){logger[_0xfee8('0x1d')](_0xfee8('0x1e'),_0x1edd18,JSON[_0xfee8('0x1f')](_0x5bc4ef));})[_0xfee8('0x20')](function(){logger['info'](_0xfee8('0x21'),_0x1edd18);_0x5d9ae1[_0xfee8('0x22')]();});}else{logger[_0xfee8('0xa')](_0xfee8('0x23'),_0x1edd18);_0x5d9ae1[_0xfee8('0x22')]();}}else{var _0x2401a3=this;var _0xe48425=apiai(_0x38d68c[0x0],{'language':_0x38d68c[0x1]||'en'});return _0xe48425[_0xfee8('0x24')](this[_0xfee8('0x25')]['body'],{'sessionId':md5(this[_0xfee8('0x8')]['id'])})['then'](function(_0x21d42c){_0x2401a3['body'][_0xfee8('0x26')]=_0x21d42c;_0x24e24c[_0xfee8('0x1c')]=_0x21d42c['result'][_0xfee8('0x27')][_0xfee8('0x28')];_0x24e24c['providerName']=_0xfee8('0x26');_0x24e24c[_0xfee8('0x29')]=JSON[_0xfee8('0x1f')](_0x21d42c);return rpc[_0x25c0cf+_0xfee8('0x1a')][_0xfee8('0x1b')](_0x24e24c)['then'](function(_0x14a335){logger[_0xfee8('0xa')](_0xfee8('0x1e'),_0x1edd18,_0x24e24c[_0xfee8('0x1c')]);if(_0x21d42c[_0xfee8('0x2a')][_0xfee8('0x2b')][_0xfee8('0x2c')]){_0x5d9ae1[_0xfee8('0xb')]();}else{_0x5d9ae1[_0xfee8('0x22')]();}})[_0xfee8('0x2d')](function(_0x180f83){logger[_0xfee8('0x1d')]('[%s][DIALOGFLOW]\x20%s',_0x1edd18,JSON[_0xfee8('0x1f')](_0x180f83));_0x5d9ae1[_0xfee8('0xb')]();});})['catch'](function(_0x3ef5ae){logger['error']('[%s][DIALOGFLOW]\x20%s',_0x1edd18,_0x3ef5ae[_0xfee8('0x25')]);_0x5d9ae1[_0xfee8('0xb')]();});}}catch(_0x29d3b4){logger[_0xfee8('0x1d')](_0xfee8('0x1e'),_0x1edd18,JSON[_0xfee8('0x1f')](_0x29d3b4));_0x5d9ae1['stop']();}};}; \ No newline at end of file +var _0x00cd=['dialogflow','result','speech','providerName','then','endConversation','catch','message','lodash','moment','apiai-promise','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','next','contact','format','out','sms','channel','chat','account','AccountId','upperFirst','created','isEmpty','body','getMustacheRender','Message','create','[%s][DIALOGFLOW]\x20%s','error','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop'];(function(_0xb3d0ca,_0x28b0bc){var _0x5dc753=function(_0x38da75){while(--_0x38da75){_0xb3d0ca['push'](_0xb3d0ca['shift']());}};_0x5dc753(++_0x28b0bc);}(_0x00cd,0xee));var _0xd00c=function(_0x4a96ca,_0x13754e){_0x4a96ca=_0x4a96ca-0x0;var _0x2aed48=_0x00cd[_0x4a96ca];return _0x2aed48;};'use strict';var _=require(_0xd00c('0x0'));var moment=require(_0xd00c('0x1'));var apiai=require(_0xd00c('0x2'));var md5=require('md5');var utils=require('./utils');var logger=require(_0xd00c('0x3'))(_0xd00c('0x4'));var rpc={'chatMessage':require(_0xd00c('0x5')),'openchannelMessage':require(_0xd00c('0x6')),'mailMessage':require(_0xd00c('0x7')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xd00c('0x8')),'whatsappMessage':require(_0xd00c('0x9'))};exports[_0xd00c('0xa')]=function(_0x6af060,_0x32bead){return function(_0x751801){try{if(!_[_0xd00c('0xb')](this[_0xd00c('0xc')][_0xd00c('0xd')])){logger[_0xd00c('0xe')]('[%s][DIALOGFLOW]\x20%s',_0x6af060,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x751801[_0xd00c('0xf')]();}var _0x267343={'ContactId':this[_0xd00c('0x10')]['id'],'sentAt':moment()[_0xd00c('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xd00c('0x12')};if(this['channel']===_0xd00c('0x13')||this[_0xd00c('0x14')]==='whatsapp'){_0x267343['phone']=this['interaction']['phone'];}var _0x32e3ab=this[_0xd00c('0x14')];if(_0x32e3ab===_0xd00c('0x15')){_0x267343['ChatWebsiteId']=this[_0xd00c('0x16')]['id'];}else{_0x267343[_['upperFirst'](_0x32e3ab)+_0xd00c('0x17')]=this[_0xd00c('0x16')]['id'];}_0x267343[_[_0xd00c('0x18')](_0x32e3ab)+'InteractionId']=this['interaction']['id'];if(this[_0xd00c('0xc')][_0xd00c('0x19')]){var _0x15fddd=_0x32bead[0x2];if(!_[_0xd00c('0x1a')](_0x15fddd)){_0x267343[_0xd00c('0x1b')]=utils[_0xd00c('0x1c')](_0x15fddd,this);return rpc[_0x32e3ab+_0xd00c('0x1d')][_0xd00c('0x1e')](_0x267343)['then'](function(_0x2b167a){logger[_0xd00c('0xe')](_0xd00c('0x1f'),_0x6af060,_0x267343['body']);})['catch'](function(_0x4693a1){logger[_0xd00c('0x20')](_0xd00c('0x1f'),_0x6af060,JSON[_0xd00c('0x21')](_0x4693a1));})[_0xd00c('0x22')](function(){logger[_0xd00c('0xe')](_0xd00c('0x23'),_0x6af060);_0x751801['stop']();});}else{logger[_0xd00c('0xe')](_0xd00c('0x24'),_0x6af060);_0x751801[_0xd00c('0x25')]();}}else{var _0x3807fb=this;var _0x10d08d=apiai(_0x32bead[0x0],{'language':_0x32bead[0x1]||'en'});return _0x10d08d['textRequest'](this['message'][_0xd00c('0x1b')],{'sessionId':md5(this[_0xd00c('0xc')]['id'])})['then'](function(_0x4a6c84){_0x3807fb['body'][_0xd00c('0x26')]=_0x4a6c84;_0x267343['body']=_0x4a6c84[_0xd00c('0x27')]['fulfillment'][_0xd00c('0x28')];_0x267343[_0xd00c('0x29')]='dialogflow';_0x267343['providerResponse']=JSON[_0xd00c('0x21')](_0x4a6c84);return rpc[_0x32e3ab+_0xd00c('0x1d')][_0xd00c('0x1e')](_0x267343)[_0xd00c('0x2a')](function(_0x56f50f){logger[_0xd00c('0xe')](_0xd00c('0x1f'),_0x6af060,_0x267343[_0xd00c('0x1b')]);if(_0x4a6c84[_0xd00c('0x27')]['metadata'][_0xd00c('0x2b')]){_0x751801['next']();}else{_0x751801[_0xd00c('0x25')]();}})[_0xd00c('0x2c')](function(_0x291b71){logger[_0xd00c('0x20')](_0xd00c('0x1f'),_0x6af060,JSON[_0xd00c('0x21')](_0x291b71));_0x751801[_0xd00c('0xf')]();});})[_0xd00c('0x2c')](function(_0x1345dd){logger[_0xd00c('0x20')](_0xd00c('0x1f'),_0x6af060,_0x1345dd[_0xd00c('0x2d')]);_0x751801[_0xd00c('0xf')]();});}}catch(_0x3a0837){logger[_0xd00c('0x20')](_0xd00c('0x1f'),_0x6af060,JSON[_0xd00c('0x21')](_0x3a0837));_0x751801[_0xd00c('0x25')]();}};}; \ 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 a04f988..8a36302 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 _0xa018=['providerName','providerResponse','length','fulfillmentText','push','all','next','message','stack','moment','bluebird','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','body','Message','create','then','info','catch','error','[%s][DIALOGFLOWV2]\x20%s','stringify','consequence','isNil','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','format','YYYY-MM-DD\x20HH:mm:ss','channel','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','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','sessionPath','detectIntent','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','boolValue','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','name','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','intent','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence'];(function(_0x35e534,_0x6337d9){var _0x1304e4=function(_0x2a6a4d){while(--_0x2a6a4d){_0x35e534['push'](_0x35e534['shift']());}};_0x1304e4(++_0x6337d9);}(_0xa018,0x9f));var _0x8a01=function(_0x17794f,_0x5c6747){_0x17794f=_0x17794f-0x0;var _0x1a2bec=_0xa018[_0x17794f];return _0x1a2bec;};'use strict';var _=require('lodash');var dialogflow=require('dialogflow');var md5=require('md5');var moment=require(_0x8a01('0x0'));var Promise=require(_0x8a01('0x1'));var logger=require(_0x8a01('0x2'))(_0x8a01('0x3'));var utils=require('./utils');var rpc={'chatMessage':require(_0x8a01('0x4')),'openchannelMessage':require(_0x8a01('0x5')),'mailMessage':require(_0x8a01('0x6')),'smsMessage':require(_0x8a01('0x7')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x8a01('0x8'))};function createMessage(_0x26f086,_0x34c096,_0x6cdaa6,_0x4d258c){return new Promise(function(_0x2e8a16,_0x6d9c6f){var _0x39893c=_['clone'](_0x6cdaa6);_0x39893c[_0x8a01('0x9')]=_0x4d258c;return rpc[_0x34c096+_0x8a01('0xa')][_0x8a01('0xb')](_0x39893c)[_0x8a01('0xc')](function(){logger[_0x8a01('0xd')]('[%s][DIALOGFLOWV2]\x20%s',_0x26f086,_0x39893c['body']);_0x2e8a16();})[_0x8a01('0xe')](function(_0x567899){logger[_0x8a01('0xf')](_0x8a01('0x10'),_0x26f086,JSON[_0x8a01('0x11')](_0x567899));_0x6d9c6f(_0x567899);});});}exports[_0x8a01('0x12')]=function(_0x176bf4,_0x5f05fc){return function(_0xcb665f){try{if(!_[_0x8a01('0x13')](this[_0x8a01('0x14')][_0x8a01('0x15')])){logger[_0x8a01('0xd')](_0x8a01('0x10'),_0x176bf4,_0x8a01('0x16'));return _0xcb665f['next']();}var _0x55eb21={'ContactId':this['contact']['id'],'sentAt':moment()[_0x8a01('0x17')](_0x8a01('0x18')),'direction':'out'};if(this['channel']==='sms'||this[_0x8a01('0x19')]===_0x8a01('0x1a')){_0x55eb21[_0x8a01('0x1b')]=this['interaction'][_0x8a01('0x1b')];}var _0x53a0a2=this[_0x8a01('0x19')];if(_0x53a0a2===_0x8a01('0x1c')){_0x55eb21[_0x8a01('0x1d')]=this[_0x8a01('0x1e')]['id'];}else{_0x55eb21[_[_0x8a01('0x1f')](_0x53a0a2)+_0x8a01('0x20')]=this[_0x8a01('0x1e')]['id'];}_0x55eb21[_[_0x8a01('0x1f')](_0x53a0a2)+_0x8a01('0x21')]=this['interaction']['id'];if(this[_0x8a01('0x14')][_0x8a01('0x22')]){var _0x46cdd6=_0x5f05fc[0x4];if(!_[_0x8a01('0x23')](_0x46cdd6)){_0x55eb21[_0x8a01('0x9')]=utils[_0x8a01('0x24')](_0x46cdd6,this);return rpc[_0x53a0a2+_0x8a01('0xa')]['create'](_0x55eb21)[_0x8a01('0xc')](function(_0x4c9a4f){logger['info'](_0x8a01('0x10'),_0x176bf4,_0x55eb21['body']);})['catch'](function(_0x3e99e1){logger[_0x8a01('0xf')](_0x8a01('0x10'),_0x176bf4,JSON[_0x8a01('0x11')](_0x3e99e1));})[_0x8a01('0x25')](function(){logger[_0x8a01('0xd')](_0x8a01('0x26'),_0x176bf4);_0xcb665f[_0x8a01('0x27')]();});}else{logger[_0x8a01('0xd')](_0x8a01('0x28'),_0x176bf4);_0xcb665f[_0x8a01('0x27')]();}}else{var _0x475292=this;var _0x58665f=_0x5f05fc[0x2][_0x8a01('0x29')](/\\n/g,'\x0a');var _0x3fe251={'credentials':{'private_key':_0x58665f,'client_email':_0x5f05fc[0x1]}};var _0x2426c5=new dialogflow[(_0x8a01('0x2a'))](_0x3fe251);var _0x40282c=_0x2426c5[_0x8a01('0x2b')](_0x5f05fc[0x0],md5(_0x475292[_0x8a01('0x14')]['id']));var _0x5b3e6b={'session':_0x40282c,'queryInput':{'text':{'text':_0x475292['message'][_0x8a01('0x9')],'languageCode':_0x5f05fc[0x3]||'en'}}};return _0x2426c5[_0x8a01('0x2c')](_0x5b3e6b)[_0x8a01('0xc')](function(_0x492ff8){if(_0x492ff8&&_0x492ff8['length']){_0x475292[_0x8a01('0x9')][_0x8a01('0x2d')]=_0x492ff8;var _0x362f51=_0x492ff8[0x0];var _0x1513a0=_0x362f51[_0x8a01('0x2e')][_0x8a01('0x2f')]&&_0x362f51['queryResult']['diagnosticInfo']['fields']?_0x362f51[_0x8a01('0x2e')][_0x8a01('0x2f')][_0x8a01('0x30')][_0x8a01('0x31')][_0x8a01('0x32')]:![];_0x475292[_0x8a01('0x9')][_0x8a01('0x33')]=_0x362f51[_0x8a01('0x2e')][_0x8a01('0x34')];_0x475292[_0x8a01('0x9')][_0x8a01('0x35')]=_0x362f51[_0x8a01('0x2e')][_0x8a01('0x36')];_0x475292[_0x8a01('0x9')]['DIALOGFLOWV2_ENDCONVERSATION']=_0x362f51[_0x8a01('0x2e')]['diagnosticInfo']&&_0x362f51[_0x8a01('0x2e')][_0x8a01('0x2f')]['fields']?_0x362f51[_0x8a01('0x2e')][_0x8a01('0x2f')]['fields'][_0x8a01('0x31')][_0x8a01('0x32')]:![];_0x475292[_0x8a01('0x9')]['DIALOGFLOWV2_INTENTNAME']=_0x362f51[_0x8a01('0x2e')]['intent'][_0x8a01('0x37')];_0x475292['body']['DIALOGFLOWV2_INTENTDISPLAYNAME']=_0x362f51['queryResult']['intent'][_0x8a01('0x38')];_0x475292[_0x8a01('0x9')][_0x8a01('0x39')]=_0x362f51[_0x8a01('0x2e')][_0x8a01('0x3a')][_0x8a01('0x3b')];_0x475292[_0x8a01('0x9')][_0x8a01('0x3c')]=_0x362f51['queryResult'][_0x8a01('0x3d')];_0x475292[_0x8a01('0x9')][_0x8a01('0x3e')]=_0x362f51[_0x8a01('0x2e')][_0x8a01('0x3f')];_0x475292[_0x8a01('0x9')][_0x8a01('0x40')]=_0x362f51[_0x8a01('0x2e')][_0x8a01('0x41')];_0x55eb21[_0x8a01('0x42')]=_0x8a01('0x2d');_0x55eb21[_0x8a01('0x43')]=JSON['stringify'](_0x492ff8);var _0x2762be=[];for(var _0x500969=0x0;_0x500969<_0x492ff8[_0x8a01('0x44')];_0x500969++){var _0x38654a=_0x492ff8[_0x500969];if(_0x38654a&&_0x38654a[_0x8a01('0x2e')]&&_0x38654a[_0x8a01('0x2e')][_0x8a01('0x45')]){_0x2762be[_0x8a01('0x46')](createMessage(_0x176bf4,_0x53a0a2,_0x55eb21,_0x38654a['queryResult']['fulfillmentText']));}}return Promise[_0x8a01('0x47')](_0x2762be)['then'](function(){if(_0x1513a0){_0xcb665f['next']();}else{_0xcb665f[_0x8a01('0x27')]();}})['catch'](function(_0x360fb2){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0x176bf4,JSON[_0x8a01('0x11')](_0x360fb2));_0xcb665f[_0x8a01('0x48')]();});}})[_0x8a01('0xe')](function(_0x30f355){logger[_0x8a01('0xf')](_0x8a01('0x10'),_0x176bf4,_0x30f355[_0x8a01('0x49')],_0x30f355[_0x8a01('0x4a')]);_0xcb665f[_0x8a01('0x48')]();});}}catch(_0x184f44){logger[_0x8a01('0xf')](_0x8a01('0x10'),_0x176bf4,JSON[_0x8a01('0x11')](_0x184f44));_0xcb665f[_0x8a01('0x27')]();}};}; \ No newline at end of file +var _0x962a=['InteractionId','created','isEmpty','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','replace','SessionsClient','sessionPath','message','detectIntent','dialogflowV2','queryResult','diagnosticInfo','fields','boolValue','DIALOGFLOWV2_ACTION','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','end_conversation','DIALOGFLOWV2_INTENTNAME','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','languageCode','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','push','fulfillmentText','all','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','clone','body','Message','create','then','info','[%s][DIALOGFLOWV2]\x20%s','catch','error','stringify','isNil','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','sms','interaction','phone','chat','ChatWebsiteId','account','upperFirst','AccountId'];(function(_0x4d9286,_0x427f2d){var _0x4af0c8=function(_0x11280f){while(--_0x11280f){_0x4d9286['push'](_0x4d9286['shift']());}};_0x4af0c8(++_0x427f2d);}(_0x962a,0x12f));var _0xa962=function(_0x4f1bd2,_0x3b369a){_0x4f1bd2=_0x4f1bd2-0x0;var _0x539722=_0x962a[_0x4f1bd2];return _0x539722;};'use strict';var _=require('lodash');var dialogflow=require('dialogflow');var md5=require('md5');var moment=require('moment');var Promise=require('bluebird');var logger=require(_0xa962('0x0'))(_0xa962('0x1'));var utils=require('./utils');var rpc={'chatMessage':require(_0xa962('0x2')),'openchannelMessage':require(_0xa962('0x3')),'mailMessage':require(_0xa962('0x4')),'smsMessage':require(_0xa962('0x5')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xa962('0x6'))};function createMessage(_0x36dd07,_0x43579f,_0xe17b4a,_0xce201f){return new Promise(function(_0x826dba,_0x5c8642){var _0x4dbc42=_[_0xa962('0x7')](_0xe17b4a);_0x4dbc42[_0xa962('0x8')]=_0xce201f;return rpc[_0x43579f+_0xa962('0x9')][_0xa962('0xa')](_0x4dbc42)[_0xa962('0xb')](function(){logger[_0xa962('0xc')](_0xa962('0xd'),_0x36dd07,_0x4dbc42[_0xa962('0x8')]);_0x826dba();})[_0xa962('0xe')](function(_0x123e1a){logger[_0xa962('0xf')](_0xa962('0xd'),_0x36dd07,JSON[_0xa962('0x10')](_0x123e1a));_0x5c8642(_0x123e1a);});});}exports['consequence']=function(_0x57cecd,_0xea819e){return function(_0x5ce53e){try{if(!_[_0xa962('0x11')](this['interaction'][_0xa962('0x12')])){logger['info'](_0xa962('0xd'),_0x57cecd,_0xa962('0x13'));return _0x5ce53e[_0xa962('0x14')]();}var _0x24d526={'ContactId':this[_0xa962('0x15')]['id'],'sentAt':moment()[_0xa962('0x16')](_0xa962('0x17')),'direction':'out'};if(this['channel']===_0xa962('0x18')||this['channel']==='whatsapp'){_0x24d526['phone']=this[_0xa962('0x19')][_0xa962('0x1a')];}var _0x6f8ecc=this['channel'];if(_0x6f8ecc===_0xa962('0x1b')){_0x24d526[_0xa962('0x1c')]=this[_0xa962('0x1d')]['id'];}else{_0x24d526[_[_0xa962('0x1e')](_0x6f8ecc)+_0xa962('0x1f')]=this[_0xa962('0x1d')]['id'];}_0x24d526[_[_0xa962('0x1e')](_0x6f8ecc)+_0xa962('0x20')]=this['interaction']['id'];if(this[_0xa962('0x19')][_0xa962('0x21')]){var _0x5eddee=_0xea819e[0x4];if(!_[_0xa962('0x22')](_0x5eddee)){_0x24d526[_0xa962('0x8')]=utils['getMustacheRender'](_0x5eddee,this);return rpc[_0x6f8ecc+_0xa962('0x9')]['create'](_0x24d526)['then'](function(_0x42ccad){logger[_0xa962('0xc')]('[%s][DIALOGFLOWV2]\x20%s',_0x57cecd,_0x24d526[_0xa962('0x8')]);})[_0xa962('0xe')](function(_0x34f293){logger[_0xa962('0xf')]('[%s][DIALOGFLOWV2]\x20%s',_0x57cecd,JSON[_0xa962('0x10')](_0x34f293));})[_0xa962('0x23')](function(){logger[_0xa962('0xc')](_0xa962('0x24'),_0x57cecd);_0x5ce53e[_0xa962('0x25')]();});}else{logger['info']('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x57cecd);_0x5ce53e[_0xa962('0x25')]();}}else{var _0x1303b9=this;var _0x3f4d22=_0xea819e[0x2][_0xa962('0x26')](/\\n/g,'\x0a');var _0x2e3c5d={'credentials':{'private_key':_0x3f4d22,'client_email':_0xea819e[0x1]}};var _0x5ed3ec=new dialogflow[(_0xa962('0x27'))](_0x2e3c5d);var _0x54805f=_0x5ed3ec[_0xa962('0x28')](_0xea819e[0x0],md5(_0x1303b9['interaction']['id']));var _0x51b549={'session':_0x54805f,'queryInput':{'text':{'text':_0x1303b9[_0xa962('0x29')][_0xa962('0x8')],'languageCode':_0xea819e[0x3]||'en'}}};return _0x5ed3ec[_0xa962('0x2a')](_0x51b549)[_0xa962('0xb')](function(_0x140da4){if(_0x140da4&&_0x140da4['length']){_0x1303b9['body'][_0xa962('0x2b')]=_0x140da4;var _0x5c3340=_0x140da4[0x0];var _0x4fafdb=_0x5c3340[_0xa962('0x2c')][_0xa962('0x2d')]&&_0x5c3340[_0xa962('0x2c')][_0xa962('0x2d')]['fields']?_0x5c3340['queryResult']['diagnosticInfo'][_0xa962('0x2e')]['end_conversation'][_0xa962('0x2f')]:![];_0x1303b9['body'][_0xa962('0x30')]=_0x5c3340['queryResult']['action'];_0x1303b9[_0xa962('0x8')][_0xa962('0x31')]=_0x5c3340['queryResult'][_0xa962('0x32')];_0x1303b9[_0xa962('0x8')][_0xa962('0x33')]=_0x5c3340[_0xa962('0x2c')][_0xa962('0x2d')]&&_0x5c3340['queryResult'][_0xa962('0x2d')]['fields']?_0x5c3340[_0xa962('0x2c')][_0xa962('0x2d')][_0xa962('0x2e')][_0xa962('0x34')][_0xa962('0x2f')]:![];_0x1303b9[_0xa962('0x8')][_0xa962('0x35')]=_0x5c3340[_0xa962('0x2c')][_0xa962('0x36')][_0xa962('0x37')];_0x1303b9[_0xa962('0x8')][_0xa962('0x38')]=_0x5c3340['queryResult'][_0xa962('0x36')][_0xa962('0x39')];_0x1303b9[_0xa962('0x8')][_0xa962('0x3a')]=_0x5c3340[_0xa962('0x2c')]['intent'][_0xa962('0x3b')];_0x1303b9[_0xa962('0x8')]['DIALOGFLOWV2_LANGUAGECODE']=_0x5c3340[_0xa962('0x2c')][_0xa962('0x3c')];_0x1303b9['body']['DIALOGFLOWV2_QUERYTEXT']=_0x5c3340[_0xa962('0x2c')][_0xa962('0x3d')];_0x1303b9['body'][_0xa962('0x3e')]=_0x5c3340[_0xa962('0x2c')][_0xa962('0x3f')];_0x24d526['providerName']='dialogflowV2';_0x24d526['providerResponse']=JSON[_0xa962('0x10')](_0x140da4);var _0x3f54fb=[];for(var _0x321a74=0x0;_0x321a74<_0x140da4['length'];_0x321a74++){var _0x36ba08=_0x140da4[_0x321a74];if(_0x36ba08&&_0x36ba08[_0xa962('0x2c')]&&_0x36ba08[_0xa962('0x2c')]['fulfillmentText']){_0x3f54fb[_0xa962('0x40')](createMessage(_0x57cecd,_0x6f8ecc,_0x24d526,_0x36ba08['queryResult'][_0xa962('0x41')]));}}return Promise[_0xa962('0x42')](_0x3f54fb)[_0xa962('0xb')](function(){if(_0x4fafdb){_0x5ce53e[_0xa962('0x14')]();}else{_0x5ce53e[_0xa962('0x25')]();}})[_0xa962('0xe')](function(_0xd23d1){logger[_0xa962('0xf')](_0xa962('0xd'),_0x57cecd,JSON[_0xa962('0x10')](_0xd23d1));_0x5ce53e['next']();});}})['catch'](function(_0x22f710){logger[_0xa962('0xf')](_0xa962('0xd'),_0x57cecd,_0x22f710['message'],_0x22f710['stack']);_0x5ce53e[_0xa962('0x14')]();});}}catch(_0x13008f){logger[_0xa962('0xf')](_0xa962('0xd'),_0x57cecd,JSON['stringify'](_0x13008f));_0x5ce53e[_0xa962('0x25')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotoif.js b/server/services/routing/server/applications/gotoif.js index 5860c78..16069f7 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 _0x7ed0=['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','[%s][GOTOIF]\x20eval\x20error:\x20%s','validate','lodash','html-to-text','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','getMustacheRender','replace','length','error','[%s][GOTOIF]\x20%s','map','message','stop','condition','priorityTrue'];(function(_0x399b24,_0x2d6c6a){var _0x5971c7=function(_0x268fa7){while(--_0x268fa7){_0x399b24['push'](_0x399b24['shift']());}};_0x5971c7(++_0x2d6c6a);}(_0x7ed0,0x1e8));var _0x07ed=function(_0x982f21,_0x226f9f){_0x982f21=_0x982f21-0x0;var _0x374c68=_0x7ed0[_0x982f21];return _0x374c68;};'use strict';var schema=require(_0x07ed('0x0'));var _=require(_0x07ed('0x1'));var htmlToText=require(_0x07ed('0x2'));var utils=require(_0x07ed('0x3'));var logger=require(_0x07ed('0x4'))(_0x07ed('0x5'));var gotoif=schema({'condition':{'type':_0x07ed('0x6'),'required':!![],'message':_0x07ed('0x7')},'priorityTrue':{'type':_0x07ed('0x8'),'message':_0x07ed('0x9')},'priorityFalse':{'type':'number','message':_0x07ed('0xa')}});exports[_0x07ed('0xb')]=function(_0x19f0d9,_0x138b53){return function(_0x2f18b5){try{var _0x3f8792={'condition':htmlToText['fromString'](utils[_0x07ed('0xc')](_0x138b53[0x0],this),{'wordwrap':![]})[_0x07ed('0xd')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x138b53[0x1],'priorityFalse':_0x138b53[0x2]};var _0x5f530d=gotoif[_0x07ed('0x0')](_0x3f8792,{'typecast':!![]});if(_0x5f530d[_0x07ed('0xe')]){logger[_0x07ed('0xf')](_0x07ed('0x10'),_0x19f0d9,_[_0x07ed('0x11')](_0x5f530d,_0x07ed('0x12'))['join'](',\x20'));_0x2f18b5[_0x07ed('0x13')]();}else{try{var _0x19e79f=eval('('+_0x3f8792[_0x07ed('0x14')]+')');var _0x28dbd1=_0x19e79f?_0x3f8792[_0x07ed('0x15')]:_0x3f8792[_0x07ed('0x16')];logger[_0x07ed('0x17')](_0x07ed('0x18'),_0x19f0d9,_0x3f8792[_0x07ed('0x14')],_0x19e79f,_0x28dbd1||_0x07ed('0x19'));if(_0x28dbd1){var _0xa216a3=_[_0x07ed('0x1a')](_0x2f18b5['rules'](),{'p':_0x28dbd1});if(_0xa216a3>=0x0){logger[_0x07ed('0x17')](_0x07ed('0x1b'),_0x19f0d9,_0x28dbd1||_0x07ed('0x19'),_0xa216a3);_0x2f18b5[_0x07ed('0x19')](_0xa216a3);}else{logger[_0x07ed('0x17')](_0x07ed('0x1c'),_0x19f0d9,_0x28dbd1||_0x07ed('0x19'));_0x2f18b5[_0x07ed('0x13')]();}}else{_0x2f18b5[_0x07ed('0x19')]();}}catch(_0x4a515b){logger[_0x07ed('0xf')](_0x07ed('0x1d'),_0x19f0d9,_0x4a515b['message']);_0x2f18b5[_0x07ed('0x13')]();}}}catch(_0x408195){logger[_0x07ed('0xf')](_0x07ed('0x10'),_0x19f0d9,JSON['stringify'](_0x408195));_0x2f18b5['stop']();}};}; \ No newline at end of file +var _0x982a=['[%s][GOTOIF]\x20%s','map','message','join','stop','condition','priorityTrue','priorityFalse','info','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','error','stringify','validate','lodash','html-to-text','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','priority\x20true\x20is\x20a\x20number','number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','replace','length'];(function(_0x5ebf2f,_0x576bdc){var _0x3799b8=function(_0x66c26b){while(--_0x66c26b){_0x5ebf2f['push'](_0x5ebf2f['shift']());}};_0x3799b8(++_0x576bdc);}(_0x982a,0x184));var _0xa982=function(_0x53d68f,_0x4aa5c4){_0x53d68f=_0x53d68f-0x0;var _0x5c61b3=_0x982a[_0x53d68f];return _0x5c61b3;};'use strict';var schema=require(_0xa982('0x0'));var _=require(_0xa982('0x1'));var htmlToText=require(_0xa982('0x2'));var utils=require('./utils');var logger=require(_0xa982('0x3'))(_0xa982('0x4'));var gotoif=schema({'condition':{'type':_0xa982('0x5'),'required':!![],'message':_0xa982('0x6')},'priorityTrue':{'type':'number','message':_0xa982('0x7')},'priorityFalse':{'type':_0xa982('0x8'),'message':_0xa982('0x9')}});exports[_0xa982('0xa')]=function(_0x49ffaa,_0x456e24){return function(_0x45389f){try{var _0x16e215={'condition':htmlToText[_0xa982('0xb')](utils[_0xa982('0xc')](_0x456e24[0x0],this),{'wordwrap':![]})[_0xa982('0xd')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x456e24[0x1],'priorityFalse':_0x456e24[0x2]};var _0x27364e=gotoif[_0xa982('0x0')](_0x16e215,{'typecast':!![]});if(_0x27364e[_0xa982('0xe')]){logger['error'](_0xa982('0xf'),_0x49ffaa,_[_0xa982('0x10')](_0x27364e,_0xa982('0x11'))[_0xa982('0x12')](',\x20'));_0x45389f[_0xa982('0x13')]();}else{try{var _0x1fd613=eval('('+_0x16e215[_0xa982('0x14')]+')');var _0x27344e=_0x1fd613?_0x16e215[_0xa982('0x15')]:_0x16e215[_0xa982('0x16')];logger[_0xa982('0x17')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x49ffaa,_0x16e215[_0xa982('0x14')],_0x1fd613,_0x27344e||_0xa982('0x18'));if(_0x27344e){var _0x1ab35e=_[_0xa982('0x19')](_0x45389f[_0xa982('0x1a')](),{'p':_0x27344e});if(_0x1ab35e>=0x0){logger['info'](_0xa982('0x1b'),_0x49ffaa,_0x27344e||_0xa982('0x18'),_0x1ab35e);_0x45389f[_0xa982('0x18')](_0x1ab35e);}else{logger[_0xa982('0x17')](_0xa982('0x1c'),_0x49ffaa,_0x27344e||_0xa982('0x18'));_0x45389f[_0xa982('0x13')]();}}else{_0x45389f[_0xa982('0x18')]();}}catch(_0x5b302c){logger['error']('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x49ffaa,_0x5b302c['message']);_0x45389f[_0xa982('0x13')]();}}}catch(_0x2b1236){logger[_0xa982('0x1d')](_0xa982('0xf'),_0x49ffaa,JSON[_0xa982('0x1e')](_0x2b1236));_0x45389f[_0xa982('0x13')]();}};}; \ 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 47c7b39..0ae8c20 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 _0x8369=['stringify','validate','lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','length','[%s][GOTOP]\x20%s','map','message','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found'];(function(_0x383f4a,_0x63e86e){var _0x2abf2d=function(_0x5449e8){while(--_0x5449e8){_0x383f4a['push'](_0x383f4a['shift']());}};_0x2abf2d(++_0x63e86e);}(_0x8369,0x1e4));var _0x9836=function(_0x4130cd,_0xcd52e){_0x4130cd=_0x4130cd-0x0;var _0x3f6859=_0x8369[_0x4130cd];return _0x3f6859;};'use strict';var schema=require(_0x9836('0x0'));var _=require(_0x9836('0x1'));var logger=require(_0x9836('0x2'))(_0x9836('0x3'));var gotop=schema({'priority':{'type':_0x9836('0x4'),'required':!![],'message':_0x9836('0x5')}});exports['consequence']=function(_0x378e31,_0x5becb0){return function(_0x432c7e){try{var _0x5577d2={'priority':_0x5becb0[0x0]};var _0x204af3=gotop[_0x9836('0x0')](_0x5577d2,{'typecast':!![]});if(_0x204af3[_0x9836('0x6')]){logger['error'](_0x9836('0x7'),_0x378e31,_[_0x9836('0x8')](_0x204af3,_0x9836('0x9'))[_0x9836('0xa')](',\x20'));_0x432c7e[_0x9836('0xb')]();}else{logger[_0x9836('0xc')](_0x9836('0xd'),_0x378e31,_0x5577d2[_0x9836('0xe')]);if(_0x5577d2[_0x9836('0xe')]){var _0x48b070=_[_0x9836('0xf')](_0x432c7e[_0x9836('0x10')](),{'p':_0x5577d2[_0x9836('0xe')]});if(_0x48b070>=0x0){logger[_0x9836('0xc')](_0x9836('0x11'),_0x378e31,_0x5577d2['priority']||_0x9836('0x12'),_0x48b070);_0x432c7e[_0x9836('0x12')](_0x48b070);}else{logger[_0x9836('0xc')](_0x9836('0x13'),_0x378e31,_0x5577d2[_0x9836('0xe')]||_0x9836('0x12'));_0x432c7e[_0x9836('0xb')]();}}else{_0x432c7e[_0x9836('0x12')]();}}}catch(_0x1bcddf){logger['error'](_0x9836('0x7'),_0x378e31,JSON[_0x9836('0x14')](_0x1bcddf));_0x432c7e['stop']();}};}; \ No newline at end of file +var _0xf84e=['join','stop','info','[%s][GOTOP]\x20priority\x20%s','findIndex','priority','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','validate','lodash','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','length','error','[%s][GOTOP]\x20%s','map','message'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xf84e,0x96));var _0xef84=function(_0x38b100,_0x177901){_0x38b100=_0x38b100-0x0;var _0x2bece2=_0xf84e[_0x38b100];return _0x2bece2;};'use strict';var schema=require(_0xef84('0x0'));var _=require(_0xef84('0x1'));var logger=require('../../../../config/logger')(_0xef84('0x2'));var gotop=schema({'priority':{'type':_0xef84('0x3'),'required':!![],'message':_0xef84('0x4')}});exports['consequence']=function(_0x592272,_0x2571d3){return function(_0x18a403){try{var _0x398640={'priority':_0x2571d3[0x0]};var _0x458bf5=gotop[_0xef84('0x0')](_0x398640,{'typecast':!![]});if(_0x458bf5[_0xef84('0x5')]){logger[_0xef84('0x6')](_0xef84('0x7'),_0x592272,_[_0xef84('0x8')](_0x458bf5,_0xef84('0x9'))[_0xef84('0xa')](',\x20'));_0x18a403[_0xef84('0xb')]();}else{logger[_0xef84('0xc')](_0xef84('0xd'),_0x592272,_0x398640['priority']);if(_0x398640['priority']){var _0xb73f3d=_[_0xef84('0xe')](_0x18a403['rules'](),{'p':_0x398640[_0xef84('0xf')]});if(_0xb73f3d>=0x0){logger[_0xef84('0xc')](_0xef84('0x10'),_0x592272,_0x398640['priority']||_0xef84('0x11'),_0xb73f3d);_0x18a403[_0xef84('0x11')](_0xb73f3d);}else{logger['info'](_0xef84('0x12'),_0x592272,_0x398640[_0xef84('0xf')]||_0xef84('0x11'));_0x18a403[_0xef84('0xb')]();}}else{_0x18a403[_0xef84('0x11')]();}}}catch(_0x5845bc){logger['error'](_0xef84('0x7'),_0x592272,JSON[_0xef84('0x13')](_0x5845bc));_0x18a403[_0xef84('0xb')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/message.js b/server/services/routing/server/applications/message.js index 51f85b7..c85e972 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 _0xe806=['Message','create','info','[%s][MESSAGE]\x20%s','body','next','catch','error','stringify','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact','channel','chat','account','upperFirst','AccountId','InteractionId','interaction'];(function(_0xd31268,_0x2e6b05){var _0x1b10db=function(_0x218c10){while(--_0x218c10){_0xd31268['push'](_0xd31268['shift']());}};_0x1b10db(++_0x2e6b05);}(_0xe806,0x1bd));var _0x6e80=function(_0x39d644,_0x3fb1f2){_0x39d644=_0x39d644-0x0;var _0xc30796=_0xe806[_0x39d644];return _0xc30796;};'use strict';var _=require(_0x6e80('0x0'));var utils=require(_0x6e80('0x1'));var logger=require(_0x6e80('0x2'))(_0x6e80('0x3'));var rpc={'chatMessage':require(_0x6e80('0x4')),'openchannelMessage':require(_0x6e80('0x5')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x6e80('0x6')),'faxMessage':require(_0x6e80('0x7')),'whatsappMessage':require(_0x6e80('0x8'))};exports[_0x6e80('0x9')]=function(_0xe527a7,_0x3cedad){return function(_0x30c382){try{var _0x5588cd={'body':utils[_0x6e80('0xa')](_0x3cedad[0x0],this),'ContactId':this[_0x6e80('0xb')]['id']};if(this[_0x6e80('0xc')]===_0x6e80('0xd')){_0x5588cd['ChatWebsiteId']=this[_0x6e80('0xe')]['id'];}else{_0x5588cd[_[_0x6e80('0xf')](this['channel'])+_0x6e80('0x10')]=this[_0x6e80('0xe')]['id'];}_0x5588cd[_[_0x6e80('0xf')](this['channel'])+_0x6e80('0x11')]=this[_0x6e80('0x12')]['id'];if(rpc[this[_0x6e80('0xc')]+'Message']){return rpc[this[_0x6e80('0xc')]+_0x6e80('0x13')][_0x6e80('0x14')](_0x5588cd)['then'](function(_0x2f34dc){logger[_0x6e80('0x15')](_0x6e80('0x16'),_0xe527a7,_0x5588cd[_0x6e80('0x17')]);_0x30c382[_0x6e80('0x18')]();})[_0x6e80('0x19')](function(_0x52d7e3){logger[_0x6e80('0x1a')](_0x6e80('0x16'),_0xe527a7,JSON[_0x6e80('0x1b')](_0x52d7e3));_0x30c382[_0x6e80('0x1c')]();});}}catch(_0x1b9fb3){logger[_0x6e80('0x1a')](_0x6e80('0x16'),_0xe527a7,JSON[_0x6e80('0x1b')](_0x1b9fb3));_0x30c382[_0x6e80('0x1c')]();}};}; \ No newline at end of file +var _0x1376=['../../rpc/faxMessage','consequence','getMustacheRender','contact','channel','ChatWebsiteId','account','upperFirst','InteractionId','Message','create','info','[%s][MESSAGE]\x20%s','next','catch','stringify','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1376,0xc0));var _0x6137=function(_0x17c650,_0x16e25d){_0x17c650=_0x17c650-0x0;var _0x30e682=_0x1376[_0x17c650];return _0x30e682;};'use strict';var _=require(_0x6137('0x0'));var utils=require(_0x6137('0x1'));var logger=require(_0x6137('0x2'))(_0x6137('0x3'));var rpc={'chatMessage':require(_0x6137('0x4')),'openchannelMessage':require(_0x6137('0x5')),'mailMessage':require(_0x6137('0x6')),'smsMessage':require(_0x6137('0x7')),'faxMessage':require(_0x6137('0x8')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x6137('0x9')]=function(_0x12eb6a,_0x2b4bf0){return function(_0x5375c4){try{var _0xe295e5={'body':utils[_0x6137('0xa')](_0x2b4bf0[0x0],this),'ContactId':this[_0x6137('0xb')]['id']};if(this[_0x6137('0xc')]==='chat'){_0xe295e5[_0x6137('0xd')]=this[_0x6137('0xe')]['id'];}else{_0xe295e5[_['upperFirst'](this[_0x6137('0xc')])+'AccountId']=this[_0x6137('0xe')]['id'];}_0xe295e5[_[_0x6137('0xf')](this[_0x6137('0xc')])+_0x6137('0x10')]=this['interaction']['id'];if(rpc[this['channel']+_0x6137('0x11')]){return rpc[this[_0x6137('0xc')]+_0x6137('0x11')][_0x6137('0x12')](_0xe295e5)['then'](function(_0x16f823){logger[_0x6137('0x13')](_0x6137('0x14'),_0x12eb6a,_0xe295e5['body']);_0x5375c4[_0x6137('0x15')]();})[_0x6137('0x16')](function(_0x235158){logger['error'](_0x6137('0x14'),_0x12eb6a,JSON[_0x6137('0x17')](_0x235158));_0x5375c4['stop']();});}}catch(_0xa1a89d){logger['error'](_0x6137('0x14'),_0x12eb6a,JSON[_0x6137('0x17')](_0xa1a89d));_0x5375c4[_0x6137('0x18')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/noop.js b/server/services/routing/server/applications/noop.js index 4a3edd8..45d99d1 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 _0x9b63=['error','stringify','./utils','../../../../config/logger','routing','getMustacheRender'];(function(_0x59aaea,_0x385797){var _0x487b27=function(_0x4430d8){while(--_0x4430d8){_0x59aaea['push'](_0x59aaea['shift']());}};_0x487b27(++_0x385797);}(_0x9b63,0x74));var _0x39b6=function(_0x1925dd,_0x31525a){_0x1925dd=_0x1925dd-0x0;var _0x12523e=_0x9b63[_0x1925dd];return _0x12523e;};'use strict';var utils=require(_0x39b6('0x0'));var logger=require(_0x39b6('0x1'))(_0x39b6('0x2'));exports['consequence']=function(_0x10d42a,_0x62f06c){return function(_0x28a3b9){try{logger['info']('[%s][NOOP]\x20%s',_0x10d42a,utils[_0x39b6('0x3')](_0x62f06c[0x0],this));_0x28a3b9['next']();}catch(_0x459ce2){logger[_0x39b6('0x4')]('[%s][NOOP]\x20%s',_0x10d42a,JSON[_0x39b6('0x5')](_0x459ce2));_0x28a3b9['stop']();}};}; \ No newline at end of file +var _0x5588=['getMustacheRender','next','stringify','./utils','../../../../config/logger','routing','consequence','[%s][NOOP]\x20%s'];(function(_0x1017e3,_0xbe01e5){var _0xfc8f72=function(_0x596bca){while(--_0x596bca){_0x1017e3['push'](_0x1017e3['shift']());}};_0xfc8f72(++_0xbe01e5);}(_0x5588,0x8b));var _0x8558=function(_0x5bb740,_0x489442){_0x5bb740=_0x5bb740-0x0;var _0x245e2e=_0x5588[_0x5bb740];return _0x245e2e;};'use strict';var utils=require(_0x8558('0x0'));var logger=require(_0x8558('0x1'))(_0x8558('0x2'));exports[_0x8558('0x3')]=function(_0xd292a6,_0x4a632b){return function(_0xd0b579){try{logger['info'](_0x8558('0x4'),_0xd292a6,utils[_0x8558('0x5')](_0x4a632b[0x0],this));_0xd0b579[_0x8558('0x6')]();}catch(_0x4d2c79){logger['error'](_0x8558('0x4'),_0xd292a6,JSON[_0x8558('0x7')](_0x4d2c79));_0xd0b579['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/queue.js b/server/services/routing/server/applications/queue.js index 5766ecf..4b9e668 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 _0xd4c6=['push','capitalize','%sQueuesWaitingInteractions','pick','format','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','../../rpc/chatInteraction','../../rpc/faxInteraction','../../rpc/mailInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','waiting','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','QueueId','channel','InteractionId','interaction','message','chat','AccountId','WebsiteId','account','info','name','QueueReport','catch','error','accepted','[%s][STOP:QUEUE][NAME:%s]','body','Interaction','then','update','update\x20queue\x20report','[%s][END:QUEUE][NAME:%s]','toLowerCase','length','[%s][QUEUE]\x20%s','join','stop','find','timeout','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','stack','validate','util','seq-queue','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','localhost','socket.io-emitter','queue','from','joinAt','emit','clone','queue_id'];(function(_0xb84c03,_0x5d1979){var _0x30e5e7=function(_0x27d3e8){while(--_0x27d3e8){_0xb84c03['push'](_0xb84c03['shift']());}};_0x30e5e7(++_0x5d1979);}(_0xd4c6,0x9c));var _0x6d4c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd4c6[_0x20a584];return _0x4b41a8;};'use strict';var schema=require(_0x6d4c('0x0'));var _=require('lodash');var util=require(_0x6d4c('0x1'));var seqqueue=require(_0x6d4c('0x2'));var moment=require('moment');var Redis=require(_0x6d4c('0x3'));var config=require(_0x6d4c('0x4'));var logger=require(_0x6d4c('0x5'))(_0x6d4c('0x6'));var strategy=require(_0x6d4c('0x7'));config[_0x6d4c('0x8')]=_[_0x6d4c('0x9')](config[_0x6d4c('0x8')],{'host':_0x6d4c('0xa'),'port':0x18eb});var io=require(_0x6d4c('0xb'))(new Redis(config[_0x6d4c('0x8')]));var attributes=['id','queue_id','account',_0x6d4c('0xc'),_0x6d4c('0xd'),_0x6d4c('0xe')];function emit(_0x512e12,_0x3b680c,_0x2ae9c4){io['to'](_0x512e12)[_0x6d4c('0xf')](_0x3b680c,_0x2ae9c4);}function emitChannelQueueInteraction(_0xe05b7a,_0x488b1f,_0xc284f7,_0x5bfabc,_0x2add72,_0x5da6b5,_0x2e1033,_0x5d38ac){var _0x387f8c=_[_0x6d4c('0x10')](_0xc284f7);_0x387f8c[_0x6d4c('0x11')]=_0x5d38ac;_0x387f8c[_0x6d4c('0xc')]=_0x488b1f;_0x387f8c['account']=_0x5bfabc;_0x387f8c['id']=_0x2add72;if(_0x5da6b5){attributes[_0x6d4c('0x12')](_[_0x6d4c('0x13')](_0xe05b7a)+'InteractionId');_0x2e1033[util['format'](_0x6d4c('0x14'),_0xe05b7a)][_0x2add72]=_[_0x6d4c('0x15')](_0x387f8c,attributes);}else{delete _0x2e1033[util[_0x6d4c('0x16')]('%sQueuesWaitingInteractions',_0xe05b7a)][_0x2add72];}emit(util[_0x6d4c('0x16')](_0x6d4c('0x17'),_0xe05b7a,_0x488b1f),util[_0x6d4c('0x16')](_0x6d4c('0x18'),_0xe05b7a,_0x5da6b5?_0x6d4c('0x19'):_0x6d4c('0x1a')),_[_0x6d4c('0x15')](_0x387f8c,attributes));}var rpc={'openchannelQueueReport':require(_0x6d4c('0x1b')),'mailQueueReport':require(_0x6d4c('0x1c')),'chatQueueReport':require(_0x6d4c('0x1d')),'smsQueueReport':require(_0x6d4c('0x1e')),'faxQueueReport':require(_0x6d4c('0x1f')),'whatsappQueueReport':require(_0x6d4c('0x20')),'chatInteraction':require(_0x6d4c('0x21')),'faxInteraction':require(_0x6d4c('0x22')),'mailInteraction':require(_0x6d4c('0x23')),'openchannelInteraction':require(_0x6d4c('0x24')),'smsInteraction':require(_0x6d4c('0x25')),'whatsappInteraction':require(_0x6d4c('0x26'))};var queue=schema({'name':{'type':_0x6d4c('0x27'),'required':!![],'message':_0x6d4c('0x28')},'timeout':{'type':'number','message':_0x6d4c('0x29')}});function startRouting(_0x126c61,_0x4b465e,_0x52eb04,_0x54b5d2){if(_0x126c61&&_0x4b465e&&_0x52eb04){_0x4b465e[_0x6d4c('0x2a')]+=0x1;var _0x29a887={'uniqueid':_0x126c61,'from':_0x52eb04['body']?_0x52eb04['body'][_0x6d4c('0xd')]:'','joinAt':moment()[_0x6d4c('0x16')](_0x6d4c('0x2b')),'ContactId':_0x52eb04[_0x6d4c('0x2c')]?_0x52eb04[_0x6d4c('0x2c')]['id']:null,'ListId':_0x52eb04[_0x6d4c('0x2d')]?_0x52eb04[_0x6d4c('0x2d')]['id']:null};_0x29a887[_[_0x6d4c('0x2e')](_0x52eb04['channel'])+_0x6d4c('0x2f')]=_0x4b465e['id']||null;_0x29a887[_['upperFirst'](_0x52eb04[_0x6d4c('0x30')])+_0x6d4c('0x31')]=_0x52eb04[_0x6d4c('0x32')]?_0x52eb04[_0x6d4c('0x32')]['id']:null;_0x29a887[_[_0x6d4c('0x2e')](_0x52eb04[_0x6d4c('0x30')])+'MessageId']=_0x52eb04['message']?_0x52eb04[_0x6d4c('0x33')]['id']:null;_0x29a887[_['upperFirst'](_0x52eb04[_0x6d4c('0x30')])+(_0x52eb04[_0x6d4c('0x30')]!==_0x6d4c('0x34')?_0x6d4c('0x35'):_0x6d4c('0x36'))]=_0x52eb04[_0x6d4c('0x37')]?_0x52eb04[_0x6d4c('0x37')]['id']:null;logger[_0x6d4c('0x38')](util['format']('[%s][START:QUEUE][NAME:%s]',_0x126c61,_0x4b465e[_0x6d4c('0x39')]));emitChannelQueueInteraction(_0x52eb04[_0x6d4c('0x30')],_0x4b465e[_0x6d4c('0x39')],_0x29a887,_0x52eb04[_0x6d4c('0x37')][_0x6d4c('0x39')],_0x52eb04[_0x6d4c('0x33')]['id'],!![],_0x54b5d2,_0x4b465e['id']);if(rpc[_0x52eb04[_0x6d4c('0x30')]+_0x6d4c('0x3a')]){return rpc[_0x52eb04[_0x6d4c('0x30')]+'QueueReport']['create'](_0x29a887)[_0x6d4c('0x3b')](function(_0x254a4f){logger[_0x6d4c('0x3c')]('create\x20queue\x20report',_0x254a4f);});}}}function stopRouting(_0x114bbe,_0x3b859d,_0x5e5eff,_0x113c40){if(_0x114bbe&&_0x3b859d){_0x3b859d['waiting']-=0x1;var _0x239f4a={'leaveAt':moment()[_0x6d4c('0x16')](_0x6d4c('0x2b')),'acceptAt':moment()['format'](_0x6d4c('0x2b')),'reason':_0x6d4c('0x3d')};logger[_0x6d4c('0x38')](util[_0x6d4c('0x16')](_0x6d4c('0x3e'),_0x114bbe,_0x3b859d[_0x6d4c('0x39')]));emitChannelQueueInteraction(_0x5e5eff['channel'],_0x3b859d[_0x6d4c('0x39')],_0x5e5eff[_0x6d4c('0x3f')],_0x5e5eff[_0x6d4c('0x37')]['name'],_0x5e5eff[_0x6d4c('0x33')]['id'],![],_0x113c40,_0x3b859d['id']);return rpc[_0x5e5eff[_0x6d4c('0x30')]+_0x6d4c('0x40')]['update'](_0x5e5eff['interaction']['id'],{'queueId':_0x3b859d['id']})[_0x6d4c('0x41')](function(){if(rpc[_0x5e5eff['channel']+_0x6d4c('0x3a')]){return rpc[_0x5e5eff[_0x6d4c('0x30')]+_0x6d4c('0x3a')][_0x6d4c('0x42')](_0x114bbe,_0x239f4a)[_0x6d4c('0x3b')](function(_0x50e7a8){logger[_0x6d4c('0x3c')](_0x6d4c('0x43'),_0x50e7a8);});}});}}function endRouting(_0x386b70,_0x390627,_0x48d099,_0x3cc4c4){if(_0x386b70&&_0x390627){_0x390627['waiting']-=0x1;var _0x317cca={'leaveAt':moment()['format'](_0x6d4c('0x2b')),'exitAt':moment()[_0x6d4c('0x16')](_0x6d4c('0x2b')),'reason':'timeout'};logger['info'](util[_0x6d4c('0x16')](_0x6d4c('0x44'),_0x386b70,_0x390627['name']));emitChannelQueueInteraction(_0x48d099[_0x6d4c('0x30')],_0x390627['name'],_0x48d099[_0x6d4c('0x3f')],_0x48d099[_0x6d4c('0x37')]['name'],_0x48d099[_0x6d4c('0x33')]['id'],![],_0x3cc4c4);if(rpc[_0x48d099[_0x6d4c('0x30')]+'QueueReport']){return rpc[_0x48d099[_0x6d4c('0x30')]+'QueueReport'][_0x6d4c('0x42')](_0x386b70,_0x317cca)[_0x6d4c('0x3b')](function(_0x1be16b){logger[_0x6d4c('0x3c')](_0x6d4c('0x43'),_0x1be16b);});}}}function handleFindQueue(_0x12d4aa){return function(_0x3e20aa){return _0x3e20aa[_0x6d4c('0x39')]['toLowerCase']()===_0x12d4aa[_0x6d4c('0x45')]();};}exports['consequence']=function(_0x12bd49,_0xcc02d4,_0x3b1e69,_0x1b6d63){return function(_0x180416){try{var _0x59dcf4={'name':_0xcc02d4[0x0],'timeout':_0xcc02d4[0x1]};var _0xc66aae=queue['validate'](_0x59dcf4,{'typecast':!![]});if(_0xc66aae[_0x6d4c('0x46')]){logger[_0x6d4c('0x3c')](_0x6d4c('0x47'),_0x12bd49,_['map'](_0xc66aae,_0x6d4c('0x33'))[_0x6d4c('0x48')](',\x20'));_0x180416[_0x6d4c('0x49')]();}else{var _0x411f12=_[_0x6d4c('0x4a')](_0x3b1e69[_0x1b6d63[_0x6d4c('0x30')]+'Queues'],handleFindQueue(_0x59dcf4[_0x6d4c('0x39')]));if(_0x411f12){startRouting(_0x12bd49,_0x411f12,_0x1b6d63,_0x3b1e69);var _0x10caac=(_0x411f12[_0x6d4c('0x4b')]||0xa)*0x3e8;var _0x106fff=(_0x59dcf4['timeout']||0x14)*0x3e8;var _0x2a67fb;if(_0x10caac>_0x106fff){_0x106fff=_0x10caac;}var _0xb89e7c=seqqueue['createQueue'](_0x10caac);_0xb89e7c['id']=_0x12bd49;_0xb89e7c[_0x6d4c('0x4c')]=_0x10caac;_0xb89e7c[_0x6d4c('0x4d')]=_0x106fff;_0xb89e7c[_0x6d4c('0x30')]=_0x1b6d63[_0x6d4c('0x30')];_0x3b1e69[_0x6d4c('0x4e')][_0x12bd49]['on'](_0x6d4c('0x4f'),function(){logger['info'](_0x6d4c('0x50'),_0x12bd49);stopRouting(_0x12bd49,_0x411f12,_0x1b6d63,_0x3b1e69);clearTimeout(_0x2a67fb);_0x2a67fb=undefined;_0xb89e7c[_0x6d4c('0x51')](!![]);if(_0x3b1e69['rules'][_0x12bd49]){delete _0x3b1e69[_0x6d4c('0x4e')][_0x12bd49];}_0x180416[_0x6d4c('0x49')]();});_0x3b1e69[_0x6d4c('0x4e')][_0x12bd49]['on']('complete',function(){if(_0x3b1e69['rules'][_0x12bd49]){delete _0x3b1e69['rules'][_0x12bd49];}});_0x2a67fb=setTimeout(function(){logger[_0x6d4c('0x38')](_0x6d4c('0x52'),_0x12bd49);endRouting(_0x12bd49,_0x411f12,_0x1b6d63,_0x3b1e69);clearTimeout(_0x2a67fb);_0xb89e7c[_0x6d4c('0x51')](!![]);_0x180416[_0x6d4c('0x53')]();},_0x106fff);switch(_0x411f12[_0x6d4c('0x54')]){case _0x6d4c('0x55'):strategy[_0x6d4c('0x55')](_0xb89e7c,_0x411f12,_0x3b1e69,_0x1b6d63);break;default:strategy['beepall'](_0xb89e7c,_0x411f12,_0x3b1e69,_0x1b6d63);}}else{logger[_0x6d4c('0x3c')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x12bd49,_0x59dcf4[_0x6d4c('0x39')]);_0x180416['stop']();}}}catch(_0x328aa4){logger[_0x6d4c('0x3c')](_0x6d4c('0x47'),_0x12bd49,_0x328aa4[_0x6d4c('0x56')]);_0x180416[_0x6d4c('0x49')]();}};}; \ No newline at end of file +var _0x1a03=['[%s][STOP:QUEUE][NAME:%s]','Interaction','interaction','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','update','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','join','stop','find','Queues','atimeout','qtimeout','rules','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stack','validate','util','seq-queue','moment','../../../../config/environment','../../../../config/logger','redis','socket.io-emitter','account','queue','from','joinAt','emit','clone','queue_id','capitalize','InteractionId','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','../../rpc/chatInteraction','../../rpc/faxInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','MessageId','message','channel','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','create\x20queue\x20report','accepted'];(function(_0x76049f,_0x4400f9){var _0x3f66a6=function(_0x52c3a2){while(--_0x52c3a2){_0x76049f['push'](_0x76049f['shift']());}};_0x3f66a6(++_0x4400f9);}(_0x1a03,0xbf));var _0x31a0=function(_0xbf8ebe,_0x3b69a5){_0xbf8ebe=_0xbf8ebe-0x0;var _0x1e25e8=_0x1a03[_0xbf8ebe];return _0x1e25e8;};'use strict';var schema=require(_0x31a0('0x0'));var _=require('lodash');var util=require(_0x31a0('0x1'));var seqqueue=require(_0x31a0('0x2'));var moment=require(_0x31a0('0x3'));var Redis=require('ioredis');var config=require(_0x31a0('0x4'));var logger=require(_0x31a0('0x5'))('routing');var strategy=require('./strategy');config[_0x31a0('0x6')]=_['defaults'](config[_0x31a0('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x31a0('0x7'))(new Redis(config[_0x31a0('0x6')]));var attributes=['id','queue_id',_0x31a0('0x8'),_0x31a0('0x9'),_0x31a0('0xa'),_0x31a0('0xb')];function emit(_0x53fcb9,_0x22f4c0,_0x1e830a){io['to'](_0x53fcb9)[_0x31a0('0xc')](_0x22f4c0,_0x1e830a);}function emitChannelQueueInteraction(_0x18ab76,_0x2dcd4f,_0x5590c6,_0x29cd64,_0x55b53a,_0x44b184,_0xd86240,_0x777cce){var _0x174c02=_[_0x31a0('0xd')](_0x5590c6);_0x174c02[_0x31a0('0xe')]=_0x777cce;_0x174c02['queue']=_0x2dcd4f;_0x174c02['account']=_0x29cd64;_0x174c02['id']=_0x55b53a;if(_0x44b184){attributes['push'](_[_0x31a0('0xf')](_0x18ab76)+_0x31a0('0x10'));_0xd86240[util[_0x31a0('0x11')](_0x31a0('0x12'),_0x18ab76)][_0x55b53a]=_[_0x31a0('0x13')](_0x174c02,attributes);}else{delete _0xd86240[util['format'](_0x31a0('0x12'),_0x18ab76)][_0x55b53a];}emit(util['format'](_0x31a0('0x14'),_0x18ab76,_0x2dcd4f),util['format'](_0x31a0('0x15'),_0x18ab76,_0x44b184?_0x31a0('0x16'):_0x31a0('0x17')),_[_0x31a0('0x13')](_0x174c02,attributes));}var rpc={'openchannelQueueReport':require(_0x31a0('0x18')),'mailQueueReport':require(_0x31a0('0x19')),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require(_0x31a0('0x1a')),'faxQueueReport':require(_0x31a0('0x1b')),'whatsappQueueReport':require(_0x31a0('0x1c')),'chatInteraction':require(_0x31a0('0x1d')),'faxInteraction':require(_0x31a0('0x1e')),'mailInteraction':require('../../rpc/mailInteraction'),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x31a0('0x1f')),'whatsappInteraction':require(_0x31a0('0x20'))};var queue=schema({'name':{'type':_0x31a0('0x21'),'required':!![],'message':_0x31a0('0x22')},'timeout':{'type':'number','message':_0x31a0('0x23')}});function startRouting(_0x356930,_0x1d5d1e,_0x4948f3,_0x3f8b9e){if(_0x356930&&_0x1d5d1e&&_0x4948f3){_0x1d5d1e[_0x31a0('0x24')]+=0x1;var _0x3ba81c={'uniqueid':_0x356930,'from':_0x4948f3[_0x31a0('0x25')]?_0x4948f3[_0x31a0('0x25')][_0x31a0('0xa')]:'','joinAt':moment()[_0x31a0('0x11')](_0x31a0('0x26')),'ContactId':_0x4948f3[_0x31a0('0x27')]?_0x4948f3[_0x31a0('0x27')]['id']:null,'ListId':_0x4948f3[_0x31a0('0x28')]?_0x4948f3['list']['id']:null};_0x3ba81c[_['upperFirst'](_0x4948f3['channel'])+'QueueId']=_0x1d5d1e['id']||null;_0x3ba81c[_[_0x31a0('0x29')](_0x4948f3['channel'])+_0x31a0('0x10')]=_0x4948f3['interaction']?_0x4948f3['interaction']['id']:null;_0x3ba81c[_[_0x31a0('0x29')](_0x4948f3['channel'])+_0x31a0('0x2a')]=_0x4948f3[_0x31a0('0x2b')]?_0x4948f3[_0x31a0('0x2b')]['id']:null;_0x3ba81c[_[_0x31a0('0x29')](_0x4948f3[_0x31a0('0x2c')])+(_0x4948f3['channel']!=='chat'?'AccountId':_0x31a0('0x2d'))]=_0x4948f3[_0x31a0('0x8')]?_0x4948f3[_0x31a0('0x8')]['id']:null;logger[_0x31a0('0x2e')](util[_0x31a0('0x11')](_0x31a0('0x2f'),_0x356930,_0x1d5d1e[_0x31a0('0x30')]));emitChannelQueueInteraction(_0x4948f3[_0x31a0('0x2c')],_0x1d5d1e[_0x31a0('0x30')],_0x3ba81c,_0x4948f3['account']['name'],_0x4948f3['message']['id'],!![],_0x3f8b9e,_0x1d5d1e['id']);if(rpc[_0x4948f3[_0x31a0('0x2c')]+_0x31a0('0x31')]){return rpc[_0x4948f3[_0x31a0('0x2c')]+_0x31a0('0x31')][_0x31a0('0x32')](_0x3ba81c)[_0x31a0('0x33')](function(_0x4840a0){logger[_0x31a0('0x34')](_0x31a0('0x35'),_0x4840a0);});}}}function stopRouting(_0x320022,_0x65ad13,_0x329fe7,_0x68ab7){if(_0x320022&&_0x65ad13){_0x65ad13[_0x31a0('0x24')]-=0x1;var _0x4e55f7={'leaveAt':moment()[_0x31a0('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x31a0('0x36')};logger[_0x31a0('0x2e')](util['format'](_0x31a0('0x37'),_0x320022,_0x65ad13[_0x31a0('0x30')]));emitChannelQueueInteraction(_0x329fe7['channel'],_0x65ad13[_0x31a0('0x30')],_0x329fe7[_0x31a0('0x25')],_0x329fe7['account'][_0x31a0('0x30')],_0x329fe7[_0x31a0('0x2b')]['id'],![],_0x68ab7,_0x65ad13['id']);return rpc[_0x329fe7[_0x31a0('0x2c')]+_0x31a0('0x38')]['update'](_0x329fe7[_0x31a0('0x39')]['id'],{'queueId':_0x65ad13['id']})['then'](function(){if(rpc[_0x329fe7[_0x31a0('0x2c')]+_0x31a0('0x31')]){return rpc[_0x329fe7[_0x31a0('0x2c')]+_0x31a0('0x31')]['update'](_0x320022,_0x4e55f7)[_0x31a0('0x33')](function(_0x49785b){logger[_0x31a0('0x34')](_0x31a0('0x3a'),_0x49785b);});}});}}function endRouting(_0x3b8332,_0x59c58e,_0xb446c4,_0x5ae72e){if(_0x3b8332&&_0x59c58e){_0x59c58e[_0x31a0('0x24')]-=0x1;var _0x364aee={'leaveAt':moment()['format'](_0x31a0('0x26')),'exitAt':moment()[_0x31a0('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x31a0('0x3b')};logger[_0x31a0('0x2e')](util['format'](_0x31a0('0x3c'),_0x3b8332,_0x59c58e[_0x31a0('0x30')]));emitChannelQueueInteraction(_0xb446c4[_0x31a0('0x2c')],_0x59c58e[_0x31a0('0x30')],_0xb446c4[_0x31a0('0x25')],_0xb446c4[_0x31a0('0x8')][_0x31a0('0x30')],_0xb446c4[_0x31a0('0x2b')]['id'],![],_0x5ae72e);if(rpc[_0xb446c4[_0x31a0('0x2c')]+_0x31a0('0x31')]){return rpc[_0xb446c4[_0x31a0('0x2c')]+'QueueReport'][_0x31a0('0x3d')](_0x3b8332,_0x364aee)[_0x31a0('0x33')](function(_0x2b169a){logger[_0x31a0('0x34')](_0x31a0('0x3a'),_0x2b169a);});}}}function handleFindQueue(_0xfcda1e){return function(_0x445500){return _0x445500[_0x31a0('0x30')][_0x31a0('0x3e')]()===_0xfcda1e[_0x31a0('0x3e')]();};}exports[_0x31a0('0x3f')]=function(_0x162260,_0x213b8e,_0x441f7a,_0x501a69){return function(_0x2c4a6d){try{var _0x297811={'name':_0x213b8e[0x0],'timeout':_0x213b8e[0x1]};var _0x3e762e=queue[_0x31a0('0x0')](_0x297811,{'typecast':!![]});if(_0x3e762e[_0x31a0('0x40')]){logger[_0x31a0('0x34')](_0x31a0('0x41'),_0x162260,_['map'](_0x3e762e,_0x31a0('0x2b'))[_0x31a0('0x42')](',\x20'));_0x2c4a6d[_0x31a0('0x43')]();}else{var _0x31d0d8=_[_0x31a0('0x44')](_0x441f7a[_0x501a69[_0x31a0('0x2c')]+_0x31a0('0x45')],handleFindQueue(_0x297811[_0x31a0('0x30')]));if(_0x31d0d8){startRouting(_0x162260,_0x31d0d8,_0x501a69,_0x441f7a);var _0x28b45c=(_0x31d0d8[_0x31a0('0x3b')]||0xa)*0x3e8;var _0x54a15a=(_0x297811[_0x31a0('0x3b')]||0x14)*0x3e8;var _0x4a2afc;if(_0x28b45c>_0x54a15a){_0x54a15a=_0x28b45c;}var _0x501da1=seqqueue['createQueue'](_0x28b45c);_0x501da1['id']=_0x162260;_0x501da1[_0x31a0('0x46')]=_0x28b45c;_0x501da1[_0x31a0('0x47')]=_0x54a15a;_0x501da1[_0x31a0('0x2c')]=_0x501a69[_0x31a0('0x2c')];_0x441f7a[_0x31a0('0x48')][_0x162260]['on']('end',function(){logger['info'](_0x31a0('0x49'),_0x162260);stopRouting(_0x162260,_0x31d0d8,_0x501a69,_0x441f7a);clearTimeout(_0x4a2afc);_0x4a2afc=undefined;_0x501da1[_0x31a0('0x4a')](!![]);if(_0x441f7a[_0x31a0('0x48')][_0x162260]){delete _0x441f7a[_0x31a0('0x48')][_0x162260];}_0x2c4a6d['stop']();});_0x441f7a['rules'][_0x162260]['on']('complete',function(){if(_0x441f7a[_0x31a0('0x48')][_0x162260]){delete _0x441f7a[_0x31a0('0x48')][_0x162260];}});_0x4a2afc=setTimeout(function(){logger[_0x31a0('0x2e')](_0x31a0('0x4b'),_0x162260);endRouting(_0x162260,_0x31d0d8,_0x501a69,_0x441f7a);clearTimeout(_0x4a2afc);_0x501da1[_0x31a0('0x4a')](!![]);_0x2c4a6d[_0x31a0('0x4c')]();},_0x54a15a);switch(_0x31d0d8[_0x31a0('0x4d')]){case _0x31a0('0x4e'):strategy[_0x31a0('0x4e')](_0x501da1,_0x31d0d8,_0x441f7a,_0x501a69);break;default:strategy[_0x31a0('0x4f')](_0x501da1,_0x31d0d8,_0x441f7a,_0x501a69);}}else{logger[_0x31a0('0x34')](_0x31a0('0x50'),_0x162260,_0x297811['name']);_0x2c4a6d['stop']();}}}catch(_0x5d4ef3){logger[_0x31a0('0x34')]('[%s][QUEUE]\x20%s',_0x162260,_0x5d4ef3[_0x31a0('0x51')]);_0x2c4a6d[_0x31a0('0x43')]();}};}; \ 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 395090a..bb0dfb2 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 _0xf873=['RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','hideNotification','busy','STOP','TIMEOUT','exports','uuid','./util','../../../../../config/logger','routing','notificationId','agent','realtime','push','handleRun','bind','handleTimeout','squeue','drained','handleDrained','prototype','debug','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','saveWaitingNotification','showNotification','writeLog'];(function(_0x4e1119,_0x32dc78){var _0x35f53d=function(_0x2bbfe0){while(--_0x2bbfe0){_0x4e1119['push'](_0x4e1119['shift']());}};_0x35f53d(++_0x32dc78);}(_0xf873,0xb2));var _0x3f87=function(_0x44c237,_0x1ea451){_0x44c237=_0x44c237-0x0;var _0x46c96a=_0xf873[_0x44c237];return _0x46c96a;};'use strict';var _=require('lodash');var uuid=require(_0x3f87('0x0'));var util=require(_0x3f87('0x1'));var logger=require(_0x3f87('0x2'))(_0x3f87('0x3'));var Agent=function(_0x1c56a3,_0xd4592c,_0x2fbb4f,_0x1d68dd){this[_0x3f87('0x4')]=uuid['v4']();this['squeue']=_0x1c56a3;this[_0x3f87('0x5')]=_0xd4592c;this[_0x3f87('0x6')]=_0x2fbb4f;this[_0x3f87('0x3')]=_0x1d68dd;this['squeue'][_0x3f87('0x7')](this[_0x3f87('0x8')][_0x3f87('0x9')](this),this[_0x3f87('0xa')][_0x3f87('0x9')](this));this[_0x3f87('0xb')]['on']('timeout',this[_0x3f87('0xa')][_0x3f87('0x9')](this));this[_0x3f87('0xb')]['on'](_0x3f87('0xc'),this[_0x3f87('0xd')][_0x3f87('0x9')](this));};Agent[_0x3f87('0xe')][_0x3f87('0x7')]=function(){this[_0x3f87('0xb')][_0x3f87('0x7')](this[_0x3f87('0x8')][_0x3f87('0x9')](this),this[_0x3f87('0xa')][_0x3f87('0x9')](this));};Agent['prototype'][_0x3f87('0xd')]=function(){this[_0x3f87('0xa')](!![]);};Agent['prototype'][_0x3f87('0x8')]=function(){logger[_0x3f87('0xf')](_0x3f87('0x10'),this[_0x3f87('0xb')]['id'],this[_0x3f87('0x5')]['id']);if(_[_0x3f87('0x11')](this[_0x3f87('0x6')][_0x3f87('0x12')][this['agent']['id']])){logger[_0x3f87('0xf')](_0x3f87('0x13'),this[_0x3f87('0xb')]['id'],this['agent']['id']);setTimeout(this[_0x3f87('0x7')]['bind'](this),0x3e8);}else{if(this[_0x3f87('0x3')][_0x3f87('0x14')]||util[_0x3f87('0x15')](this[_0x3f87('0xb')]['id'],this[_0x3f87('0x6')]['agents'][this[_0x3f87('0x5')]['id']],this[_0x3f87('0xb')][_0x3f87('0x16')],![])){this[_0x3f87('0x6')]['agents'][this['agent']['id']]['busy']=!![];this[_0x3f87('0x6')][_0x3f87('0x12')][this[_0x3f87('0x5')]['id']]['busyQueue']=undefined;util[_0x3f87('0x17')](this[_0x3f87('0x6')],this[_0x3f87('0x3')],this[_0x3f87('0x5')],this[_0x3f87('0xb')][_0x3f87('0x16')]);util[_0x3f87('0x18')](this[_0x3f87('0x4')],this[_0x3f87('0xb')]['id'],this[_0x3f87('0x6')][_0x3f87('0x12')][this[_0x3f87('0x5')]['id']],null,this['routing']);util[_0x3f87('0x19')](this[_0x3f87('0xb')]['id'],this[_0x3f87('0x6')]['agents'][this['agent']['id']],_0x3f87('0x1a')+(this[_0x3f87('0x3')][_0x3f87('0x14')]?_0x3f87('0x1b'):''));}else{logger[_0x3f87('0xf')](_0x3f87('0x1c'),this[_0x3f87('0xb')]['id'],this[_0x3f87('0x5')]['id']);setTimeout(this[_0x3f87('0x7')][_0x3f87('0x9')](this),0x3e8);}}};Agent[_0x3f87('0xe')][_0x3f87('0xa')]=function(_0x439a7d){if(_[_0x3f87('0x11')](this[_0x3f87('0x6')][_0x3f87('0x12')][this['agent']['id']])){return logger[_0x3f87('0xf')](_0x3f87('0x13'),this[_0x3f87('0xb')]['id'],this[_0x3f87('0x5')]['id']);}else{logger['debug']('[%s][AGENT]\x20timeout\x20with\x20%s',this['squeue']['id'],this[_0x3f87('0x5')]['id']);util[_0x3f87('0x1d')](this[_0x3f87('0x4')],this[_0x3f87('0xb')]['id'],this[_0x3f87('0x6')]['agents'][this[_0x3f87('0x5')]['id']],null,this['routing']);this[_0x3f87('0x6')][_0x3f87('0x12')][this[_0x3f87('0x5')]['id']][_0x3f87('0x1e')]=![];this[_0x3f87('0x6')][_0x3f87('0x12')][this[_0x3f87('0x5')]['id']]['busyQueue']=undefined;util['removeWaitingNotification'](this[_0x3f87('0x6')],this[_0x3f87('0x3')],this[_0x3f87('0x5')],this[_0x3f87('0xb')][_0x3f87('0x16')]);util[_0x3f87('0x19')](this[_0x3f87('0xb')]['id'],this['realtime'][_0x3f87('0x12')][this['agent']['id']],_0x439a7d?_0x3f87('0x1f'):_0x3f87('0x20'));}if(!_0x439a7d){setTimeout(this[_0x3f87('0x7')][_0x3f87('0x9')](this),0x3e8);}};function agent(_0x51a33d,_0x3bc7f6,_0x54fe61,_0x1c3fe8){return new Agent(_0x51a33d,_0x3bc7f6,_0x54fe61,_0x1c3fe8);}module[_0x3f87('0x21')]=agent; \ No newline at end of file +var _0x0faf=['showNotification','writeLog','RINGING','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','removeWaitingNotification','STOP','TIMEOUT','exports','lodash','./util','../../../../../config/logger','routing','notificationId','squeue','realtime','push','handleRun','handleTimeout','bind','drained','handleDrained','prototype','[%s][AGENT]\x20try\x20with\x20%s','agent','isNil','agents','debug','forcedOwnership','channel','busy','busyQueue','saveWaitingNotification'];(function(_0x1e6fba,_0x52472a){var _0x92330f=function(_0x27981b){while(--_0x27981b){_0x1e6fba['push'](_0x1e6fba['shift']());}};_0x92330f(++_0x52472a);}(_0x0faf,0x132));var _0xf0fa=function(_0x4c3ece,_0x57053e){_0x4c3ece=_0x4c3ece-0x0;var _0x409c1d=_0x0faf[_0x4c3ece];return _0x409c1d;};'use strict';var _=require(_0xf0fa('0x0'));var uuid=require('uuid');var util=require(_0xf0fa('0x1'));var logger=require(_0xf0fa('0x2'))(_0xf0fa('0x3'));var Agent=function(_0x35a260,_0xccb93e,_0xdc9ce3,_0x515b12){this[_0xf0fa('0x4')]=uuid['v4']();this[_0xf0fa('0x5')]=_0x35a260;this['agent']=_0xccb93e;this[_0xf0fa('0x6')]=_0xdc9ce3;this[_0xf0fa('0x3')]=_0x515b12;this[_0xf0fa('0x5')][_0xf0fa('0x7')](this[_0xf0fa('0x8')]['bind'](this),this[_0xf0fa('0x9')][_0xf0fa('0xa')](this));this['squeue']['on']('timeout',this[_0xf0fa('0x9')][_0xf0fa('0xa')](this));this[_0xf0fa('0x5')]['on'](_0xf0fa('0xb'),this[_0xf0fa('0xc')][_0xf0fa('0xa')](this));};Agent[_0xf0fa('0xd')][_0xf0fa('0x7')]=function(){this['squeue'][_0xf0fa('0x7')](this['handleRun'][_0xf0fa('0xa')](this),this['handleTimeout'][_0xf0fa('0xa')](this));};Agent[_0xf0fa('0xd')][_0xf0fa('0xc')]=function(){this['handleTimeout'](!![]);};Agent['prototype'][_0xf0fa('0x8')]=function(){logger['debug'](_0xf0fa('0xe'),this[_0xf0fa('0x5')]['id'],this[_0xf0fa('0xf')]['id']);if(_[_0xf0fa('0x10')](this[_0xf0fa('0x6')][_0xf0fa('0x11')][this[_0xf0fa('0xf')]['id']])){logger[_0xf0fa('0x12')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0xf0fa('0x5')]['id'],this[_0xf0fa('0xf')]['id']);setTimeout(this[_0xf0fa('0x7')][_0xf0fa('0xa')](this),0x3e8);}else{if(this[_0xf0fa('0x3')][_0xf0fa('0x13')]||util['isAgentAvailable'](this['squeue']['id'],this[_0xf0fa('0x6')][_0xf0fa('0x11')][this[_0xf0fa('0xf')]['id']],this[_0xf0fa('0x5')][_0xf0fa('0x14')],![])){this[_0xf0fa('0x6')][_0xf0fa('0x11')][this[_0xf0fa('0xf')]['id']][_0xf0fa('0x15')]=!![];this[_0xf0fa('0x6')][_0xf0fa('0x11')][this['agent']['id']][_0xf0fa('0x16')]=undefined;util[_0xf0fa('0x17')](this[_0xf0fa('0x6')],this[_0xf0fa('0x3')],this[_0xf0fa('0xf')],this[_0xf0fa('0x5')][_0xf0fa('0x14')]);util[_0xf0fa('0x18')](this[_0xf0fa('0x4')],this['squeue']['id'],this[_0xf0fa('0x6')][_0xf0fa('0x11')][this['agent']['id']],null,this[_0xf0fa('0x3')]);util[_0xf0fa('0x19')](this[_0xf0fa('0x5')]['id'],this['realtime'][_0xf0fa('0x11')][this[_0xf0fa('0xf')]['id']],_0xf0fa('0x1a')+(this[_0xf0fa('0x3')]['forcedOwnership']?':FORCED':''));}else{logger[_0xf0fa('0x12')](_0xf0fa('0x1b'),this[_0xf0fa('0x5')]['id'],this[_0xf0fa('0xf')]['id']);setTimeout(this['push'][_0xf0fa('0xa')](this),0x3e8);}}};Agent[_0xf0fa('0xd')][_0xf0fa('0x9')]=function(_0x5a4fd3){if(_[_0xf0fa('0x10')](this['realtime'][_0xf0fa('0x11')][this[_0xf0fa('0xf')]['id']])){return logger[_0xf0fa('0x12')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0xf0fa('0x5')]['id'],this[_0xf0fa('0xf')]['id']);}else{logger[_0xf0fa('0x12')](_0xf0fa('0x1c'),this[_0xf0fa('0x5')]['id'],this[_0xf0fa('0xf')]['id']);util['hideNotification'](this['notificationId'],this[_0xf0fa('0x5')]['id'],this[_0xf0fa('0x6')]['agents'][this[_0xf0fa('0xf')]['id']],null,this['routing']);this['realtime']['agents'][this[_0xf0fa('0xf')]['id']]['busy']=![];this[_0xf0fa('0x6')][_0xf0fa('0x11')][this[_0xf0fa('0xf')]['id']][_0xf0fa('0x16')]=undefined;util[_0xf0fa('0x1d')](this[_0xf0fa('0x6')],this[_0xf0fa('0x3')],this[_0xf0fa('0xf')],this['squeue'][_0xf0fa('0x14')]);util[_0xf0fa('0x19')](this[_0xf0fa('0x5')]['id'],this['realtime'][_0xf0fa('0x11')][this[_0xf0fa('0xf')]['id']],_0x5a4fd3?_0xf0fa('0x1e'):_0xf0fa('0x1f'));}if(!_0x5a4fd3){setTimeout(this['push']['bind'](this),0x3e8);}};function agent(_0x2a9f4b,_0x68b3fe,_0x2a6560,_0x47486f){return new Agent(_0x2a9f4b,_0x68b3fe,_0x2a6560,_0x47486f);}module[_0xf0fa('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 e1f19a8..e5825da 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 _0x2c58=['handleDrained','isNil','Agents','length','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','agents','channel','writeLog','RINGING','busy','busyQueue','name','saveWaitingNotification','showNotification','notificationId','debug','[%s][QUEUE]\x20EMPTY','STOP','TIMEOUT','exports','uuid','./util','../../../../../config/logger','routing','squeue','queue','realtime','push','bind','handleTimeout','timeout','drained','prototype','handleRun'];(function(_0x3ee1fe,_0x59f2a1){var _0x1ae57a=function(_0x1ef0c4){while(--_0x1ef0c4){_0x3ee1fe['push'](_0x3ee1fe['shift']());}};_0x1ae57a(++_0x59f2a1);}(_0x2c58,0x12d));var _0x82c5=function(_0x1e3db5,_0x304c75){_0x1e3db5=_0x1e3db5-0x0;var _0x2d7210=_0x2c58[_0x1e3db5];return _0x2d7210;};'use strict';var _=require('lodash');var uuid=require(_0x82c5('0x0'));var util=require(_0x82c5('0x1'));var logger=require(_0x82c5('0x2'))(_0x82c5('0x3'));var Beepall=function(_0x112d81,_0x3e38a4,_0x4f8363,_0x5d56b0){this['notificationId']=uuid['v4']();this[_0x82c5('0x4')]=_0x112d81;this[_0x82c5('0x5')]=_0x3e38a4;this[_0x82c5('0x6')]=_0x4f8363;this[_0x82c5('0x3')]=_0x5d56b0;this['squeue'][_0x82c5('0x7')](this['handleRun'][_0x82c5('0x8')](this),this[_0x82c5('0x9')]['bind'](this));this[_0x82c5('0x4')]['on'](_0x82c5('0xa'),this['handleTimeout']['bind'](this));this['squeue']['on'](_0x82c5('0xb'),this['handleDrained'][_0x82c5('0x8')](this));};Beepall[_0x82c5('0xc')][_0x82c5('0x7')]=function(){this[_0x82c5('0x4')][_0x82c5('0x7')](this[_0x82c5('0xd')][_0x82c5('0x8')](this),this['handleTimeout'][_0x82c5('0x8')](this));};Beepall[_0x82c5('0xc')][_0x82c5('0xe')]=function(){this['handleTimeout'](!![]);};Beepall[_0x82c5('0xc')][_0x82c5('0xd')]=function(){var _0x3543de=!![];if(!_[_0x82c5('0xf')](this[_0x82c5('0x5')])&&!_[_0x82c5('0xf')](this['queue'][_0x82c5('0x10')])&&this[_0x82c5('0x5')][_0x82c5('0x10')]['length']>0x0){for(var _0x24f5c8=0x0,_0x1b3588;_0x24f5c80x0){for(var _0x7f26fe=0x0,_0x2eaae7;_0x7f26fe0x0&&_0x2dffa4[_0x1d35d1+_0x6cb6('0x20')]>=_0x2dffa4[_0x1d35d1+_0x6cb6('0x21')]){writeLog(_0x520c9e,_0x2dffa4,_0x1d35d1[_0x6cb6('0x22')]()+_0x6cb6('0x23'));return![];}}return!![];};exports[_0x6cb6('0x24')]=function(_0x1cc1ed,_0x112e47,_0x47a81b,_0x5c525b,_0x4ea573){return sendNotification(!![],_0x1cc1ed,_0x112e47,_0x47a81b,_0x5c525b,_0x4ea573);};exports[_0x6cb6('0x25')]=function(_0x462dbf,_0xf07150,_0x151c69,_0x1f8c9d,_0x3b62e6){return sendNotification(![],_0x462dbf,_0xf07150,_0x151c69,_0x1f8c9d,_0x3b62e6);};exports['checkWaitingNotifications']=function(_0x124291,_0x4d4ad9,_0x2b2c4b){var _0x4d5471=_0x4d4ad9[_0x6cb6('0x26')][_0x6cb6('0x27')];if(!_0x4d5471&&_0x2b2c4b){_0x4d5471=_0x2b2c4b['id'];}var _0x32c373=_['some'](_0x124291[_0x4d4ad9[_0x6cb6('0x28')]+_0x6cb6('0x29')],function(_0x8de1a0){var _0x4a3785=_[_0x6cb6('0x2a')](_0x4d4ad9[_0x6cb6('0x28')])+_0x6cb6('0x2b');return _0x8de1a0[_0x4a3785]===_0x4d4ad9['interaction']['id'];});if(!_0x32c373&&_0x4d5471&&_0x124291[_0x6cb6('0x2c')][_0x4d5471]){_0x32c373=_[_0x6cb6('0x2d')](_0x124291['agents'][_0x4d5471][_0x4d4ad9[_0x6cb6('0x28')]+_0x6cb6('0x2e')],function(_0x98abe0){return _0x98abe0['id']===_0x4d4ad9[_0x6cb6('0x26')]['id'];});}return _0x32c373;};exports[_0x6cb6('0x2f')]=function(_0xb463fd,_0x3b05fe,_0xc97145,_0x40030e){if(_0xc97145&&_0xc97145['id']&&_0xb463fd[_0x6cb6('0x2c')]&&_0xb463fd['agents'][_0xc97145['id']]){_0xb463fd[_0x6cb6('0x2c')][_0xc97145['id']][_0x40030e+_0x6cb6('0x2e')][_0x3b05fe[_0x6cb6('0x19')]['id']]={'id':_0x3b05fe[_0x6cb6('0x26')]['id']};}};exports['removeWaitingNotification']=function(_0x558494,_0x59dd76,_0x3504ef,_0x21b495){if(_0x3504ef&&_0x3504ef['id']&&_0x558494[_0x6cb6('0x2c')]&&_0x558494[_0x6cb6('0x2c')][_0x3504ef['id']]){delete _0x558494[_0x6cb6('0x2c')][_0x3504ef['id']][_0x21b495+_0x6cb6('0x2e')][_0x59dd76[_0x6cb6('0x19')]['id']];}};exports[_0x6cb6('0x30')]=writeLog; \ No newline at end of file +var _0x2d17=['format','busy','online','OFFLINE','Pause','PAUSE','hasOwnProperty','CurrentCapacity','Capacity','toUpperCase','\x20MAXCAPACITY','showNotification','hideNotification','checkWaitingNotifications','UserId','channel','QueuesWaitingInteractions','capitalize','InteractionId','interaction','agents','saveWaitingNotification','WaitingInteractions','removeWaitingNotification','writeLog','lodash','util','ioredis','../../../../../config/environment','routing','redis','socket.io-emitter','user:%s','name','emit','split','\x20interaction','account','notificationSound','notificationShake','body','queue','msg','getMustacheRender','notificationTemplate','error','[%s][QUEUE]\x20%s','message','save','remove','debug'];(function(_0x482214,_0x2550ff){var _0x38d0cb=function(_0x2ba281){while(--_0x2ba281){_0x482214['push'](_0x482214['shift']());}};_0x38d0cb(++_0x2550ff);}(_0x2d17,0x17e));var _0x72d1=function(_0x4ef099,_0x1e8423){_0x4ef099=_0x4ef099-0x0;var _0x14795a=_0x2d17[_0x4ef099];return _0x14795a;};'use strict';var _=require(_0x72d1('0x0'));var util=require(_0x72d1('0x1'));var utils=require('../utils');var Redis=require(_0x72d1('0x2'));var config=require(_0x72d1('0x3'));var logger=require('../../../../../config/logger')(_0x72d1('0x4'));config[_0x72d1('0x5')]=_['defaults'](config[_0x72d1('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x72d1('0x6'))(new Redis(config['redis']));function sendNotification(_0x139ba0,_0x239d1f,_0x5b40a9,_0x477264,_0x422f5a,_0x19e248){io['to'](util['format'](_0x72d1('0x7'),_0x477264[_0x72d1('0x8')]))[_0x72d1('0x9')]('user:save',_0x477264);var _0x1d7520=_0x19e248||{};var _0x3a35c6=_0x5b40a9[_0x72d1('0xa')]('.');var _0x14a41e={'uniqueid':_0x239d1f,'channel':_0x3a35c6[0x0],'id':_0x3a35c6[0x1],'title':_0x3a35c6[0x0]+_0x72d1('0xb'),'interactionId':_0x3a35c6[0x2],'queue':_0x422f5a?_0x422f5a[_0x72d1('0x8')]:null,'sound':_0x1d7520[_0x72d1('0xc')][_0x72d1('0xd')],'shake':_0x1d7520[_0x72d1('0xc')][_0x72d1('0xe')]};try{if(!_0x1d7520['body']){_0x1d7520[_0x72d1('0xf')]={};}if(_0x422f5a){_0x1d7520[_0x72d1('0xf')][_0x72d1('0x10')]=_0x422f5a;}else if(_0x1d7520[_0x72d1('0xf')][_0x72d1('0x10')]){delete _0x1d7520[_0x72d1('0xf')][_0x72d1('0x10')];}_0x14a41e[_0x72d1('0x11')]=utils[_0x72d1('0x12')](_0x1d7520[_0x72d1('0xc')][_0x72d1('0x13')],_0x1d7520);}catch(_0x23a238){_0x14a41e[_0x72d1('0x11')]='I\x20can\x27t\x20render\x20your\x20template';logger[_0x72d1('0x14')](util['format'](_0x72d1('0x15'),_0x239d1f,_0x23a238[_0x72d1('0x16')]));}io['to'](util['format'](_0x72d1('0x7'),_0x477264[_0x72d1('0x8')]))[_0x72d1('0x9')](util['format']('notification:%s',_0x139ba0?_0x72d1('0x17'):_0x72d1('0x18')),_0x14a41e);}function writeLog(_0x2233cb,_0x1865c1,_0x8d6890){return logger[_0x72d1('0x19')](util[_0x72d1('0x1a')]('[%s][QUEUE][AGENT:%s][STATUS:%s]',_0x2233cb,_0x1865c1[_0x72d1('0x8')],_0x8d6890));}exports['isAgentAvailable']=function(_0x506062,_0x5b85cc,_0x585243,_0x445985){if(_0x5b85cc[_0x72d1('0x1b')]){writeLog(_0x506062,_0x5b85cc,'BUSY');return![];}if(!_0x5b85cc[_0x72d1('0x1c')]){writeLog(_0x506062,_0x5b85cc,_0x72d1('0x1d'));return![];}if(_0x5b85cc[_0x585243+_0x72d1('0x1e')]){writeLog(_0x506062,_0x5b85cc,_0x72d1('0x1f'));return![];}if(_0x445985&&_0x5b85cc[_0x72d1('0x20')](_0x585243+'Capacity')&&_0x5b85cc['hasOwnProperty'](_0x585243+_0x72d1('0x21'))){if(_0x5b85cc[_0x585243+_0x72d1('0x22')]>0x0&&_0x5b85cc[_0x585243+_0x72d1('0x21')]>=_0x5b85cc[_0x585243+_0x72d1('0x22')]){writeLog(_0x506062,_0x5b85cc,_0x585243[_0x72d1('0x23')]()+_0x72d1('0x24'));return![];}}return!![];};exports[_0x72d1('0x25')]=function(_0x589f7c,_0x57ec9e,_0x1ba258,_0x482cb8,_0x18ca85){return sendNotification(!![],_0x589f7c,_0x57ec9e,_0x1ba258,_0x482cb8,_0x18ca85);};exports[_0x72d1('0x26')]=function(_0x2c113d,_0x4da489,_0x1c4b21,_0x4c4c41,_0x707cd0){return sendNotification(![],_0x2c113d,_0x4da489,_0x1c4b21,_0x4c4c41,_0x707cd0);};exports[_0x72d1('0x27')]=function(_0x32588f,_0x2cc0c8,_0x51242b){var _0x37617e=_0x2cc0c8['interaction'][_0x72d1('0x28')];if(!_0x37617e&&_0x51242b){_0x37617e=_0x51242b['id'];}var _0x32dc5e=_['some'](_0x32588f[_0x2cc0c8[_0x72d1('0x29')]+_0x72d1('0x2a')],function(_0xf9f890){var _0x11ea2f=_[_0x72d1('0x2b')](_0x2cc0c8['channel'])+_0x72d1('0x2c');return _0xf9f890[_0x11ea2f]===_0x2cc0c8[_0x72d1('0x2d')]['id'];});if(!_0x32dc5e&&_0x37617e&&_0x32588f[_0x72d1('0x2e')][_0x37617e]){_0x32dc5e=_['some'](_0x32588f[_0x72d1('0x2e')][_0x37617e][_0x2cc0c8[_0x72d1('0x29')]+'WaitingInteractions'],function(_0x3372a5){return _0x3372a5['id']===_0x2cc0c8[_0x72d1('0x2d')]['id'];});}return _0x32dc5e;};exports[_0x72d1('0x2f')]=function(_0x5a63d9,_0x348692,_0x4d4236,_0x260e71){if(_0x4d4236&&_0x4d4236['id']&&_0x5a63d9[_0x72d1('0x2e')]&&_0x5a63d9[_0x72d1('0x2e')][_0x4d4236['id']]){_0x5a63d9[_0x72d1('0x2e')][_0x4d4236['id']][_0x260e71+_0x72d1('0x30')][_0x348692[_0x72d1('0x16')]['id']]={'id':_0x348692[_0x72d1('0x2d')]['id']};}};exports[_0x72d1('0x31')]=function(_0x4006b9,_0x24be04,_0x2029b5,_0x58a211){if(_0x2029b5&&_0x2029b5['id']&&_0x4006b9[_0x72d1('0x2e')]&&_0x4006b9[_0x72d1('0x2e')][_0x2029b5['id']]){delete _0x4006b9[_0x72d1('0x2e')][_0x2029b5['id']][_0x58a211+_0x72d1('0x30')][_0x24be04['message']['id']];}};exports[_0x72d1('0x32')]=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 e197c90..0df3b79 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 _0x32c9=['stringify','validate','shelljs','lodash','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][SYSTEM]\x20%s','message','join','info','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','next'];(function(_0x56eba1,_0x574883){var _0x1550c9=function(_0x461bf6){while(--_0x461bf6){_0x56eba1['push'](_0x56eba1['shift']());}};_0x1550c9(++_0x574883);}(_0x32c9,0x105));var _0x932c=function(_0x462926,_0x549149){_0x462926=_0x462926-0x0;var _0x1c995f=_0x32c9[_0x462926];return _0x1c995f;};'use strict';var schema=require(_0x932c('0x0'));var sh=require(_0x932c('0x1'));var _=require(_0x932c('0x2'));var utils=require(_0x932c('0x3'));var logger=require(_0x932c('0x4'))(_0x932c('0x5'));var system=schema({'command':{'type':_0x932c('0x6'),'required':!![],'message':_0x932c('0x7')}});exports[_0x932c('0x8')]=function(_0x2033f6,_0x5ea167){return function(_0xd8080d){try{var _0x24419d={'command':_0x5ea167[0x0]};var _0x4918a6=system[_0x932c('0x0')](_0x24419d,{'typecast':!![]});if(_0x4918a6[_0x932c('0x9')]){logger[_0x932c('0xa')](_0x932c('0xb'),_0x2033f6,_['map'](_0x4918a6,_0x932c('0xc'))[_0x932c('0xd')](',\x20'));logger[_0x932c('0xe')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x2033f6);_0xd8080d['next']();}else{var _0x247160=this;var _0x4d64d6=utils[_0x932c('0xf')](_0x5ea167[0x0],this);logger['info'](_0x932c('0x10'),_0x2033f6,_0x4d64d6);sh['exec'](_[_0x932c('0x11')](_0x4d64d6),function(_0x3eff90,_0x26b961){logger['info'](_0x932c('0x12'),_0x2033f6,_0x3eff90);if(_0x3eff90==0x0){var _0x2cc737=_0x26b961[_0x932c('0x13')](/(\r\n|\n|\r)/gm,'');if(_[_0x932c('0x14')](_0x5ea167[0x1])||_['isEmpty'](_0x5ea167[0x1])){logger[_0x932c('0xe')](_0x932c('0x15'),_0x2033f6);_0x247160[_0x932c('0x16')][_0x5ea167[0x1]]=_0x2cc737;}else{logger['info'](_0x932c('0x17'),_0x2033f6,_0x5ea167[0x1],_0x2cc737);_0x247160['body'][_0x5ea167[0x1]]=_0x2cc737;}}_0xd8080d[_0x932c('0x18')]();});}}catch(_0x3d8fc5){logger[_0x932c('0xa')]('[%s][SYSTEM]\x20%s',_0x2033f6,_['isObject'](_0x3d8fc5)?JSON[_0x932c('0x19')](_0x3d8fc5):_0x3d8fc5);logger[_0x932c('0xe')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x2033f6);_0xd8080d[_0x932c('0x18')]();}};}; \ No newline at end of file +var _0x1e43=['trim','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','error','stringify','validate','shelljs','../../../../config/logger','routing','consequence','length','[%s][SYSTEM]\x20%s','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec'];(function(_0x2ad535,_0x1be5fe){var _0x4d3190=function(_0x30384e){while(--_0x30384e){_0x2ad535['push'](_0x2ad535['shift']());}};_0x4d3190(++_0x1be5fe);}(_0x1e43,0x1d1));var _0x31e4=function(_0x29f730,_0x23d7ed){_0x29f730=_0x29f730-0x0;var _0x189806=_0x1e43[_0x29f730];return _0x189806;};'use strict';var schema=require(_0x31e4('0x0'));var sh=require(_0x31e4('0x1'));var _=require('lodash');var utils=require('./utils');var logger=require(_0x31e4('0x2'))(_0x31e4('0x3'));var system=schema({'command':{'type':'string','required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0x31e4('0x4')]=function(_0x346afb,_0xb6869d){return function(_0x105676){try{var _0x274a52={'command':_0xb6869d[0x0]};var _0x6e71fe=system[_0x31e4('0x0')](_0x274a52,{'typecast':!![]});if(_0x6e71fe[_0x31e4('0x5')]){logger['error'](_0x31e4('0x6'),_0x346afb,_['map'](_0x6e71fe,_0x31e4('0x7'))[_0x31e4('0x8')](',\x20'));logger[_0x31e4('0x9')](_0x31e4('0xa'),_0x346afb);_0x105676[_0x31e4('0xb')]();}else{var _0x23b177=this;var _0xd79489=utils[_0x31e4('0xc')](_0xb6869d[0x0],this);logger[_0x31e4('0x9')](_0x31e4('0xd'),_0x346afb,_0xd79489);sh[_0x31e4('0xe')](_[_0x31e4('0xf')](_0xd79489),function(_0x3f99ca,_0x2eef97){logger[_0x31e4('0x9')]('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x346afb,_0x3f99ca);if(_0x3f99ca==0x0){var _0x508cb9=_0x2eef97[_0x31e4('0x10')](/(\r\n|\n|\r)/gm,'');if(_[_0x31e4('0x11')](_0xb6869d[0x1])||_[_0x31e4('0x12')](_0xb6869d[0x1])){logger[_0x31e4('0x9')](_0x31e4('0x13'),_0x346afb);_0x23b177[_0x31e4('0x14')][_0xb6869d[0x1]]=_0x508cb9;}else{logger[_0x31e4('0x9')](_0x31e4('0x15'),_0x346afb,_0xb6869d[0x1],_0x508cb9);_0x23b177['body'][_0xb6869d[0x1]]=_0x508cb9;}}_0x105676[_0x31e4('0xb')]();});}}catch(_0x5e67a0){logger[_0x31e4('0x16')](_0x31e4('0x6'),_0x346afb,_['isObject'](_0x5e67a0)?JSON[_0x31e4('0x17')](_0x5e67a0):_0x5e67a0);logger['info'](_0x31e4('0xa'),_0x346afb);_0x105676[_0x31e4('0xb')]();}};}; \ 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 1c1ee51..b4223dc 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 _0x9aab=['next','channel','Interaction','addTags','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','error','[%s][TAG]\x20%s','stringify','info','finally','isObject','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','map','message','join','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next'];(function(_0x26733f,_0x16b677){var _0x388e17=function(_0xa92133){while(--_0xa92133){_0x26733f['push'](_0x26733f['shift']());}};_0x388e17(++_0x16b677);}(_0x9aab,0x145));var _0xb9aa=function(_0x4c3cf2,_0x43958a){_0x4c3cf2=_0x4c3cf2-0x0;var _0xebae27=_0x9aab[_0x4c3cf2];return _0xebae27;};'use strict';var schema=require('validate');var _=require('lodash');var rpc={'chatInteraction':require(_0xb9aa('0x0')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0xb9aa('0x1')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0xb9aa('0x2')),'whatsappInteraction':require(_0xb9aa('0x3'))};var logger=require('../../../../config/logger')(_0xb9aa('0x4'));var tag=schema({'tag':{'type':_0xb9aa('0x5'),'required':!![],'message':_0xb9aa('0x6')}});exports[_0xb9aa('0x7')]=function(_0x5b1824,_0x457234,_0x298628,_0xee634c){return function(_0x400ad3){try{var _0x17d3f2={'tag':_0x457234[0x0]};var _0x16ddce=tag['validate'](_0x17d3f2,{'typecast':!![]});if(_0x16ddce[_0xb9aa('0x8')]){logger['error']('[%s][TAG]\x20%s',_0x5b1824,_[_0xb9aa('0x9')](_0x16ddce,_0xb9aa('0xa'))[_0xb9aa('0xb')](',\x20'));logger['info'](_0xb9aa('0xc'),_0x5b1824);_0x400ad3[_0xb9aa('0xd')]();}else{var _0x37e3a0={'ids':[_0x457234[0x0]]};if(rpc[_0xee634c[_0xb9aa('0xe')]+_0xb9aa('0xf')]){rpc[_0xee634c[_0xb9aa('0xe')]+_0xb9aa('0xf')][_0xb9aa('0x10')](_0xee634c[_0xb9aa('0x11')]['id'],_0x37e3a0)[_0xb9aa('0x12')](function(_0x55a3d2){logger['info'](_0xb9aa('0x13'),_0x5b1824,_0x457234[0x1],_0xee634c[_0xb9aa('0xe')],_0xee634c[_0xb9aa('0x11')]['id']);})['catch'](function(_0x27aac3){logger[_0xb9aa('0x14')](_0xb9aa('0x15'),_0x5b1824,JSON[_0xb9aa('0x16')](_0x27aac3));logger[_0xb9aa('0x17')](_0xb9aa('0xc'),_0x5b1824);})[_0xb9aa('0x18')](function(){_0x400ad3[_0xb9aa('0xd')]();});}}}catch(_0x474581){logger['error'](_0xb9aa('0x15'),_0x5b1824,_[_0xb9aa('0x19')](_0x474581)?JSON['stringify'](_0x474581):_0x474581);logger['info'](_0xb9aa('0xc'),_0x5b1824);_0x400ad3[_0xb9aa('0xd')]();}};}; \ No newline at end of file +var _0x3547=['../../rpc/whatsappInteraction','../../../../config/logger','routing','number','consequence','length','[%s][TAG]\x20%s','map','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','then','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','interaction','catch','error','stringify','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction'];(function(_0x4228cc,_0x212880){var _0x364f1a=function(_0x597e77){while(--_0x597e77){_0x4228cc['push'](_0x4228cc['shift']());}};_0x364f1a(++_0x212880);}(_0x3547,0x123));var _0x7354=function(_0x10b89c,_0x167c8a){_0x10b89c=_0x10b89c-0x0;var _0x340b0d=_0x3547[_0x10b89c];return _0x340b0d;};'use strict';var schema=require(_0x7354('0x0'));var _=require(_0x7354('0x1'));var rpc={'chatInteraction':require(_0x7354('0x2')),'openchannelInteraction':require(_0x7354('0x3')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x7354('0x4')),'faxInteraction':require(_0x7354('0x5')),'whatsappInteraction':require(_0x7354('0x6'))};var logger=require(_0x7354('0x7'))(_0x7354('0x8'));var tag=schema({'tag':{'type':_0x7354('0x9'),'required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0x7354('0xa')]=function(_0x9c1139,_0x3a947f,_0x34f930,_0xb3c979){return function(_0x1e6580){try{var _0x5109a3={'tag':_0x3a947f[0x0]};var _0x50991e=tag[_0x7354('0x0')](_0x5109a3,{'typecast':!![]});if(_0x50991e[_0x7354('0xb')]){logger['error'](_0x7354('0xc'),_0x9c1139,_[_0x7354('0xd')](_0x50991e,'message')['join'](',\x20'));logger['info'](_0x7354('0xe'),_0x9c1139);_0x1e6580[_0x7354('0xf')]();}else{var _0x3a0fcc={'ids':[_0x3a947f[0x0]]};if(rpc[_0xb3c979[_0x7354('0x10')]+'Interaction']){rpc[_0xb3c979[_0x7354('0x10')]+_0x7354('0x11')][_0x7354('0x12')](_0xb3c979['interaction']['id'],_0x3a0fcc)[_0x7354('0x13')](function(_0x2e13f0){logger[_0x7354('0x14')](_0x7354('0x15'),_0x9c1139,_0x3a947f[0x1],_0xb3c979[_0x7354('0x10')],_0xb3c979[_0x7354('0x16')]['id']);})[_0x7354('0x17')](function(_0x1455a4){logger[_0x7354('0x18')](_0x7354('0xc'),_0x9c1139,JSON[_0x7354('0x19')](_0x1455a4));logger[_0x7354('0x14')](_0x7354('0xe'),_0x9c1139);})['finally'](function(){_0x1e6580[_0x7354('0xf')]();});}}}catch(_0x15dfbe){logger[_0x7354('0x18')]('[%s][TAG]\x20%s',_0x9c1139,_[_0x7354('0x1a')](_0x15dfbe)?JSON[_0x7354('0x19')](_0x15dfbe):_0x15dfbe);logger[_0x7354('0x14')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x9c1139);_0x1e6580[_0x7354('0xf')]();}};}; \ 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 c64e3c0..6eccea1 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 _0x6af0=['consequence','replace','\x20-\x20','includes','?params=','urlOnRing','title','jsonrpc','2.0','method','login','push','params','stringify','application/json-rpc','parse','result','logged','channelId=','&serviceId=','&sessionId=','&data=','then','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','catch','[%s][TVOX]\x20%s','stop','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','routing','lodash'];(function(_0x781e78,_0x4e9979){var _0x13b63f=function(_0x1df44b){while(--_0x1df44b){_0x781e78['push'](_0x781e78['shift']());}};_0x13b63f(++_0x4e9979);}(_0x6af0,0x7a));var _0x06af=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0x6af0[_0x88cd7b];return _0x56fcc8;};'use strict';var rp=require('request-promise');var logger=require('../../../../config/logger')(_0x06af('0x0'));var _=require(_0x06af('0x1'));var arr=[];exports[_0x06af('0x2')]=function(_0x310bc5,_0x3f7ae0){return function(_0x9c41b1){var _0x21decf=_0x3f7ae0[0xa];var _0x4ef20f=_0x3f7ae0[0xb];var _0x4a9265=_0x3f7ae0[0xc];var _0x2deb06=_0x3f7ae0[0xd];var _0x519327=_0x3f7ae0[0xe];var _0x11dfec=_0x3f7ae0[0xf][_0x06af('0x3')](/\n/g,_0x06af('0x4'));var _0x1b9d45=_0x3f7ae0[0x10][_0x06af('0x3')](/\n/g,'\x20');if(!arr[_0x06af('0x5')](_0x4ef20f)){arr['push'](_0x4ef20f);var _0x1c2b52=_0x3f7ae0[0x3];var _0x177bdd=_0x3f7ae0[0x4];var _0x14d66f=_0x3f7ae0[0x1];var _0x445390=_0x3f7ae0[0x0];var _0x59fe38={};_0x59fe38['urlOnAnswer']=_0x3f7ae0[0x8]+_0x06af('0x6')+_0x4a9265+'|'+_0x21decf+'|'+_0x2deb06+'|'+_0x4ef20f+'|'+_0x519327;_0x59fe38[_0x06af('0x7')]=_0x3f7ae0[0x7]+'?params='+_0x4a9265+'|'+_0x21decf+'|'+_0x2deb06+'|'+_0x4ef20f+'|'+_0x519327+'|'+_0x11dfec+'|'+_0x1b9d45;_0x59fe38[_0x06af('0x8')]=_0x3f7ae0[0x9];var _0x1dc128={};_0x1dc128[_0x06af('0x9')]=_0x06af('0xa');_0x1dc128[_0x06af('0xb')]=_0x06af('0xc');var _0xdf8c32=[];_0xdf8c32[_0x06af('0xd')](_0x3f7ae0[0x2]);_0xdf8c32[_0x06af('0xd')](_0x3f7ae0[0x5]);_0xdf8c32[_0x06af('0xd')](_0x3f7ae0[0x6]);_0x1dc128[_0x06af('0xe')]=_0xdf8c32;_0x1dc128['id']=0x1;var _0x2f3692=JSON[_0x06af('0xf')](_0x1dc128);var _0xe4dfa5={'encoding':'utf8','method':'POST','timeout':0x2710,'url':_0x1c2b52,'headers':{'Content-Type':_0x06af('0x10')},'body':_0x2f3692};return rp(_0xe4dfa5)['then'](function(_0x318f5b){const _0x1a49b6=JSON[_0x06af('0x11')](_0x318f5b);if(!_0x1a49b6[_0x06af('0x12')][_0x06af('0x13')]){throw new Error('Unable\x20to\x20login\x20with\x20TVox\x20application');}var _0xa854=_0x4ef20f;var _0x194500=_0x06af('0x14')+_0x14d66f+_0x06af('0x15')+_0x445390+_0x06af('0x16')+_0xa854+_0x06af('0x17')+JSON[_0x06af('0xf')](_0x59fe38);var _0x307b90=_0x177bdd+'?'+_0x194500;return rp(_0x307b90);})[_0x06af('0x18')](function(_0x15c28a){logger[_0x06af('0x19')](_0x06af('0x1a'),_0x310bc5,_0x15c28a);_0x9c41b1['stop']();})[_0x06af('0x1b')](function(_0x38519e){logger['error'](_0x06af('0x1c'),_0x310bc5,_['isObject'](_0x38519e)?JSON[_0x06af('0xf')](_0x38519e):_0x38519e);_0x9c41b1[_0x06af('0x1d')]();});}else{logger[_0x06af('0x19')](_0x06af('0x1e'),_0x310bc5);_0x9c41b1['next']();}};}; \ No newline at end of file +var _0x1fde=['push','?params=','urlOnRing','title','jsonrpc','2.0','login','params','stringify','utf8','then','parse','result','Unable\x20to\x20login\x20with\x20TVox\x20application','&serviceId=','&sessionId=','&data=','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','isObject','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','../../../../config/logger','routing','consequence','replace','\x20-\x20','includes'];(function(_0xf34109,_0x380779){var _0x570bfc=function(_0x1ad086){while(--_0x1ad086){_0xf34109['push'](_0xf34109['shift']());}};_0x570bfc(++_0x380779);}(_0x1fde,0x162));var _0xe1fd=function(_0x231b2e,_0x2a33f9){_0x231b2e=_0x231b2e-0x0;var _0x3feb2a=_0x1fde[_0x231b2e];return _0x3feb2a;};'use strict';var rp=require('request-promise');var logger=require(_0xe1fd('0x0'))(_0xe1fd('0x1'));var _=require('lodash');var arr=[];exports[_0xe1fd('0x2')]=function(_0xd6f4e5,_0x556243){return function(_0x152c02){var _0x2b1b2f=_0x556243[0xa];var _0x2de091=_0x556243[0xb];var _0x1291da=_0x556243[0xc];var _0x5b2b8e=_0x556243[0xd];var _0x32d0ff=_0x556243[0xe];var _0x4e923c=_0x556243[0xf][_0xe1fd('0x3')](/\n/g,_0xe1fd('0x4'));var _0x24a444=_0x556243[0x10][_0xe1fd('0x3')](/\n/g,'\x20');if(!arr[_0xe1fd('0x5')](_0x2de091)){arr[_0xe1fd('0x6')](_0x2de091);var _0x171b50=_0x556243[0x3];var _0x287c35=_0x556243[0x4];var _0x472faa=_0x556243[0x1];var _0x469a9d=_0x556243[0x0];var _0x597f5c={};_0x597f5c['urlOnAnswer']=_0x556243[0x8]+_0xe1fd('0x7')+_0x1291da+'|'+_0x2b1b2f+'|'+_0x5b2b8e+'|'+_0x2de091+'|'+_0x32d0ff;_0x597f5c[_0xe1fd('0x8')]=_0x556243[0x7]+_0xe1fd('0x7')+_0x1291da+'|'+_0x2b1b2f+'|'+_0x5b2b8e+'|'+_0x2de091+'|'+_0x32d0ff+'|'+_0x4e923c+'|'+_0x24a444;_0x597f5c[_0xe1fd('0x9')]=_0x556243[0x9];var _0x4b186b={};_0x4b186b[_0xe1fd('0xa')]=_0xe1fd('0xb');_0x4b186b['method']=_0xe1fd('0xc');var _0x90f50a=[];_0x90f50a[_0xe1fd('0x6')](_0x556243[0x2]);_0x90f50a[_0xe1fd('0x6')](_0x556243[0x5]);_0x90f50a[_0xe1fd('0x6')](_0x556243[0x6]);_0x4b186b[_0xe1fd('0xd')]=_0x90f50a;_0x4b186b['id']=0x1;var _0x50ca74=JSON[_0xe1fd('0xe')](_0x4b186b);var _0x2b29ad={'encoding':_0xe1fd('0xf'),'method':'POST','timeout':0x2710,'url':_0x171b50,'headers':{'Content-Type':'application/json-rpc'},'body':_0x50ca74};return rp(_0x2b29ad)[_0xe1fd('0x10')](function(_0x34a995){const _0x1444ba=JSON[_0xe1fd('0x11')](_0x34a995);if(!_0x1444ba[_0xe1fd('0x12')]['logged']){throw new Error(_0xe1fd('0x13'));}var _0x184b24=_0x2de091;var _0x522934='channelId='+_0x472faa+_0xe1fd('0x14')+_0x469a9d+_0xe1fd('0x15')+_0x184b24+_0xe1fd('0x16')+JSON['stringify'](_0x597f5c);var _0x284280=_0x287c35+'?'+_0x522934;return rp(_0x284280);})['then'](function(_0x483dec){logger[_0xe1fd('0x17')](_0xe1fd('0x18'),_0xd6f4e5,_0x483dec);_0x152c02[_0xe1fd('0x19')]();})[_0xe1fd('0x1a')](function(_0x17c1a3){logger['error']('[%s][TVOX]\x20%s',_0xd6f4e5,_[_0xe1fd('0x1b')](_0x17c1a3)?JSON['stringify'](_0x17c1a3):_0x17c1a3);_0x152c02['stop']();});}else{logger[_0xe1fd('0x17')](_0xe1fd('0x1c'),_0xd6f4e5);_0x152c02[_0xe1fd('0x1d')]();}};}; \ 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 143a3f1..7cf2eaf 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(_0x4b93cf,_0x4bc0c6){var _0x568ef3=function(_0xee6f99){while(--_0xee6f99){_0x4b93cf['push'](_0x4b93cf['shift']());}};_0x568ef3(++_0x4bc0c6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'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 _0xa9e0=['message','account','interaction','mustache','lodash','exports','render','body','contact'];(function(_0x5b7e0e,_0x260f79){var _0x154f09=function(_0x283e44){while(--_0x283e44){_0x5b7e0e['push'](_0x5b7e0e['shift']());}};_0x154f09(++_0x260f79);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'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 diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 3b0764e..9faf140 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 _0xfc00=['mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','server','listen','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','./applications/utils','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','IntervalId','isNil','Intervals','interval','rules','channel','message','interaction','checkWaitingNotifications','isArray','applications','join','app','toLowerCase','appdata','mail','push','slice','length','dialogflow','split','dialogflowv2','tag','TagId','tvox','getMustacheRender','account','notificationTemplate','ChatWebsiteId','ContactId','body','%s:%s:%s','./interval','condition','intervals','./applications/','priority','info','Push\x20new\x20rule','on\x20interval','error','.js','execute','Applications\x20executed','stringify','matchPath','emit','complete','Skipped\x20routing\x20for\x20%s','No\x20applications\x20to\x20execute','stack','agent','agents','busyQueue','QueueReport','UserId','catch','message\x20is\x20empty','busy','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','find','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfc00,0x13a));var _0x0fc0=function(_0x2181b1,_0x569637){_0x2181b1=_0x2181b1-0x0;var _0x530548=_0xfc00[_0x2181b1];return _0x530548;};'use strict';var _=require(_0x0fc0('0x0'));var util=require(_0x0fc0('0x1'));var path=require(_0x0fc0('0x2'));var fs=require('fs');var jayson=require(_0x0fc0('0x3'));var BPromise=require(_0x0fc0('0x4'));var utils=require(_0x0fc0('0x5'));var sUtils=require('./applications/strategy/util');var logger=require('../../../config/logger')(_0x0fc0('0x6'));var rpc={'openchannelQueueReport':require(_0x0fc0('0x7')),'mailQueueReport':require(_0x0fc0('0x8')),'chatQueueReport':require(_0x0fc0('0x9')),'smsQueueReport':require(_0x0fc0('0xa')),'faxQueueReport':require(_0x0fc0('0xb')),'whatsappQueueReport':require(_0x0fc0('0xc'))};var RuleEngine=require(_0x0fc0('0xd'));function getId(_0x2ca912,_0x3b5f2d,_0x2e23ab){return util[_0x0fc0('0xe')](_0x0fc0('0xf'),_0x2ca912,_0x3b5f2d||0x0,_0x2e23ab||0x0);}function getIntervals(_0x1b40eb,_0x23df64){var _0x2658d6=[];if(!_['isNil'](_0x23df64[_0x0fc0('0x10')])&&!_[_0x0fc0('0x11')](_0x1b40eb[_0x23df64[_0x0fc0('0x10')]])&&!_[_0x0fc0('0x11')](_0x1b40eb[_0x23df64[_0x0fc0('0x10')]][_0x0fc0('0x12')])){_0x2658d6=_['map'](_0x1b40eb[_0x23df64[_0x0fc0('0x10')]][_0x0fc0('0x12')],_0x0fc0('0x13'));}else if(!_['isNil'](_0x23df64[_0x0fc0('0x13')])){_0x2658d6=[_0x23df64[_0x0fc0('0x13')]];}return _0x2658d6;}exports['listen']=function(_0x2f0d8d){_0x2f0d8d[_0x0fc0('0x14')]={};return new BPromise(function(_0x28b225,_0x58c08d){var _0x37f18f={'Start':function(_0x2d3893){var _0x27d566=this;return new Promise(function(_0x5404b1,_0x4df151){if(_0x2d3893){try{var _0x4fd617=[];var _0x428be5=getId(_0x2d3893[_0x0fc0('0x15')],_0x2d3893['message']?_0x2d3893[_0x0fc0('0x16')]['id']:0x0,_0x2d3893[_0x0fc0('0x17')]?_0x2d3893[_0x0fc0('0x17')]['id']:0x0);var _0x2610e9=sUtils[_0x0fc0('0x18')](_0x2f0d8d,_0x2d3893);if(!_0x2610e9&&_0x2d3893['applications']&&_[_0x0fc0('0x19')](_0x2d3893[_0x0fc0('0x1a')])&&_0x2d3893[_0x0fc0('0x1a')]['length']){for(var _0x4ca2a9=0x0;_0x4ca2a9<_0x2d3893[_0x0fc0('0x1a')]['length'];_0x4ca2a9+=0x1){var _0x2ea314=_0x2d3893[_0x0fc0('0x1a')][_0x4ca2a9];if(fs['existsSync'](path[_0x0fc0('0x1b')](__dirname,'applications',_0x2ea314[_0x0fc0('0x1c')]+'.js'))){var _0x5c8de9=[];switch(_0x2ea314[_0x0fc0('0x1c')][_0x0fc0('0x1d')]()){case'autoreply':var _0x5dc96d=_0x2ea314[_0x0fc0('0x1e')]['split'](',');if(_0x2d3893[_0x0fc0('0x15')]===_0x0fc0('0x1f')){_0x5c8de9['push'](_0x5dc96d[0x0]);_0x5c8de9[_0x0fc0('0x20')](_0x5dc96d[0x1]);_0x5c8de9[_0x0fc0('0x20')](_0x5dc96d[_0x0fc0('0x21')](0x2,_0x5dc96d['length'])[_0x0fc0('0x1b')](','));}else{_0x5c8de9['push'](_0x5dc96d[0x0]);_0x5c8de9[_0x0fc0('0x20')](_0x5dc96d['slice'](0x1,_0x5dc96d[_0x0fc0('0x22')])[_0x0fc0('0x1b')](','));}break;case _0x0fc0('0x23'):var _0x397dd9=_0x2ea314[_0x0fc0('0x1e')][_0x0fc0('0x24')](',');_0x5c8de9['push'](_0x397dd9[0x0]);_0x5c8de9[_0x0fc0('0x20')](_0x397dd9[0x1]);_0x5c8de9[_0x0fc0('0x20')](_0x397dd9[_0x0fc0('0x21')](0x2,_0x397dd9['length'])[_0x0fc0('0x1b')](','));break;case _0x0fc0('0x25'):var _0x4ec5b6=_0x2ea314[_0x0fc0('0x1e')][_0x0fc0('0x24')](',');_0x5c8de9[_0x0fc0('0x20')](_0x4ec5b6[0x0]);_0x5c8de9['push'](_0x4ec5b6[0x1]);_0x5c8de9['push'](_0x4ec5b6[0x2]);_0x5c8de9[_0x0fc0('0x20')](_0x4ec5b6[0x3]);_0x5c8de9[_0x0fc0('0x20')](_0x4ec5b6[_0x0fc0('0x21')](0x4,_0x4ec5b6[_0x0fc0('0x22')])[_0x0fc0('0x1b')](','));break;case'amazonlex':var _0x28cb38=_0x2ea314[_0x0fc0('0x1e')][_0x0fc0('0x24')](',');_0x5c8de9[_0x0fc0('0x20')](_0x28cb38[0x0]);_0x5c8de9['push'](_0x28cb38[0x1]);_0x5c8de9[_0x0fc0('0x20')](_0x28cb38[0x2]);_0x5c8de9[_0x0fc0('0x20')](_0x28cb38[0x3]);_0x5c8de9['push'](_0x28cb38[_0x0fc0('0x21')](0x4,_0x28cb38[_0x0fc0('0x22')])['join'](','));break;case _0x0fc0('0x16'):_0x5c8de9['push'](_0x2ea314[_0x0fc0('0x1e')]);break;case _0x0fc0('0x26'):_0x5c8de9[_0x0fc0('0x20')](_0x2ea314[_0x0fc0('0x27')]);_0x5c8de9[_0x0fc0('0x20')](_0x2ea314[_0x0fc0('0x1e')]);break;case _0x0fc0('0x28'):var _0x1a8dd4=utils[_0x0fc0('0x29')](_0x2d3893[_0x0fc0('0x2a')][_0x0fc0('0x2b')],_0x2d3893);var _0x439e04=_0x2ea314[_0x0fc0('0x1e')]['split'](',');_0x5c8de9[_0x0fc0('0x20')](_0x439e04[0x0]);_0x5c8de9[_0x0fc0('0x20')](_0x439e04[0x1]);_0x5c8de9['push'](_0x439e04[0x2]);_0x5c8de9[_0x0fc0('0x20')](_0x439e04[0x3]);_0x5c8de9[_0x0fc0('0x20')](_0x439e04[0x4]);_0x5c8de9['push'](_0x439e04[0x5]);_0x5c8de9['push'](_0x439e04[0x6]);_0x5c8de9['push'](_0x439e04[0x7]);_0x5c8de9[_0x0fc0('0x20')](_0x439e04[0x8]);_0x5c8de9['push'](_0x439e04[0x9]);_0x5c8de9[_0x0fc0('0x20')](_0x439e04[0xa]);_0x5c8de9[_0x0fc0('0x20')](_0x2d3893[_0x0fc0('0x17')]['id']);_0x5c8de9[_0x0fc0('0x20')](_0x2d3893[_0x0fc0('0x16')]['id']);_0x5c8de9['push'](_0x2ea314[_0x0fc0('0x2c')]);_0x5c8de9[_0x0fc0('0x20')](_0x2d3893['interaction'][_0x0fc0('0x2d')]);_0x5c8de9[_0x0fc0('0x20')](_0x2d3893[_0x0fc0('0x2e')][_0x0fc0('0x2e')]);_0x5c8de9['push'](_0x1a8dd4);break;default:_0x5c8de9=_[_0x0fc0('0x11')](_0x2ea314[_0x0fc0('0x1e')])?[]:_0x2ea314[_0x0fc0('0x1e')][_0x0fc0('0x24')](',');}var _0x2e2d6e={'id':util[_0x0fc0('0xe')](_0x0fc0('0x2f'),_0x428be5,_0x2ea314['id'],_0x2ea314['app']),'condition':require(_0x0fc0('0x30'))[_0x0fc0('0x31')](_0x428be5,getIntervals(_0x2f0d8d[_0x0fc0('0x32')],_0x2ea314),_0x2f0d8d),'consequence':require(_0x0fc0('0x33')+_0x2ea314[_0x0fc0('0x1c')])['consequence'](_0x428be5,_0x5c8de9,_0x2f0d8d,_0x2d3893),'p':_0x2ea314[_0x0fc0('0x34')]||0x0};logger[_0x0fc0('0x35')](_0x0fc0('0x36'),_0x2e2d6e['id'],_0x0fc0('0x37'),getIntervals(_0x2f0d8d[_0x0fc0('0x32')],_0x2ea314)['join']('\x20|\x20'));_0x4fd617[_0x0fc0('0x20')](_0x2e2d6e);}else{logger[_0x0fc0('0x38')]('Please\x20create\x20a\x20new\x20file\x20under',path[_0x0fc0('0x1b')](__dirname,_0x0fc0('0x1a'),_0x2ea314[_0x0fc0('0x1c')]+_0x0fc0('0x39')));}}_0x2f0d8d[_0x0fc0('0x14')][_0x428be5]=new RuleEngine(_0x4fd617);_0x2f0d8d['rules'][_0x428be5][_0x0fc0('0x3a')](_0x2d3893,function(_0xf645e9){logger[_0x0fc0('0x35')](_0x0fc0('0x3b'),JSON[_0x0fc0('0x3c')](_0xf645e9[_0x0fc0('0x3d')]));if(_0x2f0d8d[_0x0fc0('0x14')][_0x428be5]){_0x2f0d8d['rules'][_0x428be5][_0x0fc0('0x3e')](_0x0fc0('0x3f'));}});return _0x5404b1({'code':0xc8,'message':_0x2d3893});}else{if(_0x2610e9){logger['info'](util[_0x0fc0('0xe')](_0x0fc0('0x40'),_0x428be5));}else{logger[_0x0fc0('0x35')](_0x0fc0('0x41'));}return _0x5404b1({'code':0xc8,'message':_0x2d3893});}}catch(_0x10a90c){logger[_0x0fc0('0x38')](_0x10a90c[_0x0fc0('0x42')]);return _0x4df151(_0x27d566['error'](0x1f4,_0x10a90c));}}return _0x4df151('routing\x20is\x20empty');});},'AcceptMessage':function(_0x2442d8){var _0x5c7799=this;return new Promise(function(_0x2a01d6,_0x537196){if(_0x2442d8[_0x0fc0('0x43')]&&_0x2442d8[_0x0fc0('0x43')]['id']){if(_0x2f0d8d[_0x0fc0('0x44')][_0x2442d8[_0x0fc0('0x43')]['id']]){_0x2f0d8d[_0x0fc0('0x44')][_0x2442d8[_0x0fc0('0x43')]['id']]['busy']=![];_0x2f0d8d['agents'][_0x2442d8[_0x0fc0('0x43')]['id']][_0x0fc0('0x45')]=undefined;}}if(_0x2442d8[_0x0fc0('0x16')]&&_0x2442d8['message']['id']){try{var _0x2049bf=getId(_0x2442d8[_0x0fc0('0x15')],_0x2442d8[_0x0fc0('0x16')]?_0x2442d8[_0x0fc0('0x16')]['id']:0x0,_0x2442d8[_0x0fc0('0x17')]?_0x2442d8[_0x0fc0('0x17')]['id']:0x0);if(_0x2f0d8d[_0x0fc0('0x14')][_0x2049bf]){_0x2f0d8d['rules'][_0x2049bf][_0x0fc0('0x3e')]('end');if(rpc[_0x2442d8[_0x0fc0('0x15')]+_0x0fc0('0x46')]){rpc[_0x2442d8[_0x0fc0('0x15')]+_0x0fc0('0x46')]['update'](_0x2049bf,{'UserId':_0x2442d8[_0x0fc0('0x16')][_0x0fc0('0x47')]})[_0x0fc0('0x48')](function(){logger['error']('error\x20update\x20queue\x20report');});}}return _0x2a01d6({'code':0xc8,'message':_0x2442d8});}catch(_0x24ff48){logger[_0x0fc0('0x38')](_0x24ff48[_0x0fc0('0x42')]);return _0x537196(_0x5c7799[_0x0fc0('0x38')](0x1f4,_0x24ff48));}}logger['error'](_0x0fc0('0x49'));return _0x537196(_0x5c7799['error'](0x1f4,_0x0fc0('0x49')));});},'RejectMessage':function(_0x40dec6){var _0x1e2884=this;return new Promise(function(_0x492bc1,_0x2d4ffa){if(_0x40dec6['agent']&&_0x40dec6[_0x0fc0('0x43')]['id']){try{if(_0x2f0d8d[_0x0fc0('0x44')][_0x40dec6[_0x0fc0('0x43')]['id']]){_0x2f0d8d['agents'][_0x40dec6['agent']['id']][_0x0fc0('0x4a')]=![];_0x2f0d8d['agents'][_0x40dec6[_0x0fc0('0x43')]['id']]['busyQueue']=undefined;}return _0x492bc1({'code':0xc8,'message':_0x40dec6});}catch(_0x59f129){logger[_0x0fc0('0x38')](_0x59f129[_0x0fc0('0x42')]);return _0x2d4ffa(_0x1e2884['error'](0x1f4,_0x59f129));}}logger[_0x0fc0('0x38')](_0x0fc0('0x49'));return _0x2d4ffa(_0x1e2884['error'](0x1f4,_0x0fc0('0x49')));});},'AbandonInteraction':function(_0x56acb8){var _0x43b946=this;return new Promise(function(_0x2520a1,_0x5c2be0){if(_0x56acb8[_0x0fc0('0x15')]&&_0x56acb8[_0x0fc0('0x17')]&&_0x56acb8[_0x0fc0('0x17')]['id']){try{var _0xecee95=getId(_0x56acb8[_0x0fc0('0x15')],_0x56acb8[_0x0fc0('0x16')]?_0x56acb8[_0x0fc0('0x16')]['id']:0x0,_0x56acb8[_0x0fc0('0x17')]?_0x56acb8['interaction']['id']:0x0);if(_0x2f0d8d['rules'][_0xecee95]){_0x2f0d8d['rules'][_0xecee95][_0x0fc0('0x3e')]('end');}return _0x2520a1({'code':0xc8,'message':_0x56acb8});}catch(_0x1d6c82){logger['error'](_0x1d6c82['stack']);return _0x5c2be0(_0x43b946[_0x0fc0('0x38')](0x1f4,_0x1d6c82));}}logger[_0x0fc0('0x38')](_0x0fc0('0x49'));return _0x5c2be0(_0x43b946[_0x0fc0('0x38')](0x1f4,_0x0fc0('0x49')));});},'AgentCapacity':function(_0xb2258b){var _0x5542d8=this;return new Promise(function(_0xb5dbc5,_0x31e066){if(_0x2f0d8d[_0x0fc0('0x44')][_0x0fc0('0x4b')](_0xb2258b['id'])){for(var _0x2b1d77 in _0xb2258b[_0x0fc0('0x4c')]){if(_0xb2258b[_0x0fc0('0x4c')][_0x0fc0('0x4b')](_0x2b1d77)){if(_0x2f0d8d[_0x0fc0('0x44')][_0xb2258b['id']]['hasOwnProperty'](_0x2b1d77+_0x0fc0('0x4d'))){_0x2f0d8d[_0x0fc0('0x44')][_0xb2258b['id']][_0x2b1d77+_0x0fc0('0x4d')]=parseInt(_0xb2258b[_0x0fc0('0x4c')][_0x2b1d77],0xa);}}}_0x2f0d8d[_0x0fc0('0x44')][_0xb2258b['id']][_0x0fc0('0x4e')]();return _0xb5dbc5({'code':0xc8,'message':_0x2f0d8d[_0x0fc0('0x44')][_0xb2258b['id']]});}else{return _0x31e066(_0x5542d8['error'](0x1f4,_0x0fc0('0x4f')));}});},'Agents':function(_0x4782f7){return new Promise(function(_0x358f70){var _0x59def1=_[_0x0fc0('0x50')](_0x2f0d8d[_0x0fc0('0x44')]);if(_0x4782f7&&_0x4782f7['id']){var _0x31c39e=_[_0x0fc0('0x51')](_0x59def1,function(_0x29fdfc){return _0x29fdfc['id']===_0x4782f7['id'];});_0x358f70(_0x31c39e);}else{_0x358f70({'count':_0x59def1[_0x0fc0('0x22')],'rows':_0x59def1});}});},'ChatQueues':function(){return new Promise(function(_0x40826a){var _0x366860=[];for(var _0x125ddd in _0x2f0d8d[_0x0fc0('0x52')]){if(_0x2f0d8d[_0x0fc0('0x52')]['hasOwnProperty'](_0x125ddd)){var _0x49733f=_0x2f0d8d[_0x0fc0('0x52')][_0x125ddd];var _0x210fd7={'id':_0x49733f['id'],'available':_0x49733f[_0x0fc0('0x53')],'loggedIn':_0x49733f[_0x0fc0('0x54')],'name':_0x49733f[_0x0fc0('0x55')],'paused':_0x49733f[_0x0fc0('0x56')],'waiting':_0x49733f[_0x0fc0('0x57')]};_0x366860[_0x0fc0('0x20')](_0x210fd7);}}_0x40826a({'count':_0x366860[_0x0fc0('0x22')],'rows':_0x366860});});},'MailQueues':function(){return new Promise(function(_0x1ccc0e){var _0xd10f22=[];for(var _0x23264f in _0x2f0d8d[_0x0fc0('0x58')]){if(_0x2f0d8d[_0x0fc0('0x58')][_0x0fc0('0x4b')](_0x23264f)){var _0x443f08=_0x2f0d8d['mailQueues'][_0x23264f];var _0x3a0930={'id':_0x443f08['id'],'available':_0x443f08[_0x0fc0('0x53')],'loggedIn':_0x443f08[_0x0fc0('0x54')],'name':_0x443f08[_0x0fc0('0x55')],'paused':_0x443f08[_0x0fc0('0x56')],'waiting':_0x443f08[_0x0fc0('0x57')]};_0xd10f22[_0x0fc0('0x20')](_0x3a0930);}}_0x1ccc0e({'count':_0xd10f22[_0x0fc0('0x22')],'rows':_0xd10f22});});},'OpenchannelQueues':function(){return new Promise(function(_0x33cff3){var _0x128cda=[];for(var _0x23205b in _0x2f0d8d[_0x0fc0('0x59')]){if(_0x2f0d8d[_0x0fc0('0x59')]['hasOwnProperty'](_0x23205b)){var _0x4e87de=_0x2f0d8d[_0x0fc0('0x59')][_0x23205b];var _0x14f65d={'id':_0x4e87de['id'],'available':_0x4e87de[_0x0fc0('0x53')],'loggedIn':_0x4e87de[_0x0fc0('0x54')],'name':_0x4e87de[_0x0fc0('0x55')],'paused':_0x4e87de[_0x0fc0('0x56')],'waiting':_0x4e87de[_0x0fc0('0x57')]};_0x128cda[_0x0fc0('0x20')](_0x14f65d);}}_0x33cff3({'count':_0x128cda['length'],'rows':_0x128cda});});},'SmsQueues':function(){return new Promise(function(_0x1e8ad8){var _0x142164=[];for(var _0x178cc5 in _0x2f0d8d[_0x0fc0('0x5a')]){if(_0x2f0d8d['smsQueues'][_0x0fc0('0x4b')](_0x178cc5)){var _0x4dd047=_0x2f0d8d[_0x0fc0('0x5a')][_0x178cc5];var _0x534355={'id':_0x4dd047['id'],'available':_0x4dd047['available'],'loggedIn':_0x4dd047['loggedIn'],'name':_0x4dd047[_0x0fc0('0x55')],'paused':_0x4dd047['paused'],'waiting':_0x4dd047[_0x0fc0('0x57')]};_0x142164['push'](_0x534355);}}_0x1e8ad8({'count':_0x142164['length'],'rows':_0x142164});});},'FaxQueues':function(){return new Promise(function(_0x40d76c){var _0x2c2e90=[];for(var _0x53986f in _0x2f0d8d[_0x0fc0('0x5b')]){if(_0x2f0d8d[_0x0fc0('0x5b')]['hasOwnProperty'](_0x53986f)){var _0x2d2495=_0x2f0d8d['faxQueues'][_0x53986f];var _0x69ecf0={'id':_0x2d2495['id'],'available':_0x2d2495[_0x0fc0('0x53')],'loggedIn':_0x2d2495[_0x0fc0('0x54')],'name':_0x2d2495[_0x0fc0('0x55')],'paused':_0x2d2495[_0x0fc0('0x56')],'waiting':_0x2d2495[_0x0fc0('0x57')]};_0x2c2e90[_0x0fc0('0x20')](_0x69ecf0);}}_0x40d76c({'count':_0x2c2e90[_0x0fc0('0x22')],'rows':_0x2c2e90});});},'WhatsappQueues':function(){return new Promise(function(_0x570929){var _0x10724a=[];for(var _0x2b872d in _0x2f0d8d['whatsappQueues']){if(_0x2f0d8d[_0x0fc0('0x5c')][_0x0fc0('0x4b')](_0x2b872d)){var _0x4af7aa=_0x2f0d8d[_0x0fc0('0x5c')][_0x2b872d];var _0xc0163b={'id':_0x4af7aa['id'],'available':_0x4af7aa[_0x0fc0('0x53')],'loggedIn':_0x4af7aa['loggedIn'],'name':_0x4af7aa[_0x0fc0('0x55')],'paused':_0x4af7aa[_0x0fc0('0x56')],'waiting':_0x4af7aa[_0x0fc0('0x57')]};_0x10724a[_0x0fc0('0x20')](_0xc0163b);}}_0x570929({'count':_0x10724a[_0x0fc0('0x22')],'rows':_0x10724a});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x31f237){var _0x37f8e8=_[_0x0fc0('0x50')](_0x2f0d8d[_0x0fc0('0x5d')]);_0x31f237({'count':_0x37f8e8[_0x0fc0('0x22')],'rows':_0x37f8e8});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x3117a0){var _0x23a70e=_[_0x0fc0('0x50')](_0x2f0d8d[_0x0fc0('0x5e')]);_0x3117a0({'count':_0x23a70e['length'],'rows':_0x23a70e});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0xb5a8ba){var _0x788de9=_[_0x0fc0('0x50')](_0x2f0d8d[_0x0fc0('0x5f')]);_0xb5a8ba({'count':_0x788de9[_0x0fc0('0x22')],'rows':_0x788de9});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x5a2cfb){var _0x1470db=_[_0x0fc0('0x50')](_0x2f0d8d[_0x0fc0('0x60')]);_0x5a2cfb({'count':_0x1470db[_0x0fc0('0x22')],'rows':_0x1470db});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x23fe7b){var _0x2b313c=_[_0x0fc0('0x50')](_0x2f0d8d['faxQueuesWaitingInteractions']);_0x23fe7b({'count':_0x2b313c[_0x0fc0('0x22')],'rows':_0x2b313c});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x372fbb){var _0x4ce9a0=_[_0x0fc0('0x50')](_0x2f0d8d['whatsappQueuesWaitingInteractions']);_0x372fbb({'count':_0x4ce9a0[_0x0fc0('0x22')],'rows':_0x4ce9a0});});}};var _0x20060b=jayson[_0x0fc0('0x61')](_0x37f18f)['http']();_0x20060b['on'](_0x0fc0('0x38'),function(_0x44119b){logger[_0x0fc0('0x38')](JSON[_0x0fc0('0x3c')](_0x44119b));return _0x58c08d(_0x44119b);});_0x20060b[_0x0fc0('0x62')](0x232c,'127.0.0.1',function(){console[_0x0fc0('0x63')](_0x0fc0('0x64'),0x232c);return _0x28b225(_0x0fc0('0x65')+0x232c);});});}; \ No newline at end of file +var _0x605a=['../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','rules','channel','message','interaction','checkWaitingNotifications','transfer','isArray','applications','length','existsSync','join','toLowerCase','autoreply','mail','push','slice','dialogflow','appdata','split','amazonlex','tag','TagId','tvox','getMustacheRender','ChatWebsiteId','ContactId','body','%s:%s:%s','app','./interval','condition','intervals','./applications/','consequence','info','Push\x20new\x20rule','on\x20interval','execute','Applications\x20executed','matchPath','emit','complete','error','stack','agent','agents','busyQueue','end','QueueReport','UserId','error\x20update\x20queue\x20report','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','find','chatQueues','loggedIn','name','paused','waiting','mailQueues','available','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','server','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','./applications/utils','./applications/strategy/util','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport'];(function(_0x25eec1,_0x265aef){var _0xeabff=function(_0x12f766){while(--_0x12f766){_0x25eec1['push'](_0x25eec1['shift']());}};_0xeabff(++_0x265aef);}(_0x605a,0x126));var _0xa605=function(_0x25651c,_0x54137c){_0x25651c=_0x25651c-0x0;var _0x51c0c3=_0x605a[_0x25651c];return _0x51c0c3;};'use strict';var _=require(_0xa605('0x0'));var util=require(_0xa605('0x1'));var path=require(_0xa605('0x2'));var fs=require('fs');var jayson=require(_0xa605('0x3'));var BPromise=require(_0xa605('0x4'));var utils=require(_0xa605('0x5'));var sUtils=require(_0xa605('0x6'));var logger=require('../../../config/logger')(_0xa605('0x7'));var rpc={'openchannelQueueReport':require(_0xa605('0x8')),'mailQueueReport':require(_0xa605('0x9')),'chatQueueReport':require(_0xa605('0xa')),'smsQueueReport':require(_0xa605('0xb')),'faxQueueReport':require(_0xa605('0xc')),'whatsappQueueReport':require(_0xa605('0xd'))};var RuleEngine=require(_0xa605('0xe'));function getId(_0x5ed4e0,_0x38f9ef,_0x153cf4){return util[_0xa605('0xf')](_0xa605('0x10'),_0x5ed4e0,_0x38f9ef||0x0,_0x153cf4||0x0);}function getIntervals(_0x16ad5b,_0x518988){var _0x4a3601=[];if(!_[_0xa605('0x11')](_0x518988[_0xa605('0x12')])&&!_[_0xa605('0x11')](_0x16ad5b[_0x518988[_0xa605('0x12')]])&&!_[_0xa605('0x11')](_0x16ad5b[_0x518988[_0xa605('0x12')]][_0xa605('0x13')])){_0x4a3601=_[_0xa605('0x14')](_0x16ad5b[_0x518988[_0xa605('0x12')]][_0xa605('0x13')],'interval');}else if(!_['isNil'](_0x518988[_0xa605('0x15')])){_0x4a3601=[_0x518988[_0xa605('0x15')]];}return _0x4a3601;}exports[_0xa605('0x16')]=function(_0x316da3){_0x316da3[_0xa605('0x17')]={};return new BPromise(function(_0x1a0f67,_0x4d178b){var _0x410eba={'Start':function(_0x4c417f){var _0x4edb0c=this;return new Promise(function(_0x1103e6,_0x24a6a3){if(_0x4c417f){try{var _0x471c80=[];var _0x364d8a=getId(_0x4c417f[_0xa605('0x18')],_0x4c417f[_0xa605('0x19')]?_0x4c417f[_0xa605('0x19')]['id']:0x0,_0x4c417f[_0xa605('0x1a')]?_0x4c417f[_0xa605('0x1a')]['id']:0x0);var _0x47dd15=sUtils[_0xa605('0x1b')](_0x316da3,_0x4c417f);if(_0x4c417f[_0xa605('0x1c')]||!_0x47dd15&&_0x4c417f['applications']&&_[_0xa605('0x1d')](_0x4c417f[_0xa605('0x1e')])&&_0x4c417f['applications'][_0xa605('0x1f')]){for(var _0x50f88b=0x0;_0x50f88b<_0x4c417f[_0xa605('0x1e')][_0xa605('0x1f')];_0x50f88b+=0x1){var _0x5852c0=_0x4c417f['applications'][_0x50f88b];if(fs[_0xa605('0x20')](path[_0xa605('0x21')](__dirname,_0xa605('0x1e'),_0x5852c0['app']+'.js'))){var _0x276ff8=[];switch(_0x5852c0['app'][_0xa605('0x22')]()){case _0xa605('0x23'):var _0x261d0d=_0x5852c0['appdata']['split'](',');if(_0x4c417f['channel']===_0xa605('0x24')){_0x276ff8['push'](_0x261d0d[0x0]);_0x276ff8[_0xa605('0x25')](_0x261d0d[0x1]);_0x276ff8['push'](_0x261d0d[_0xa605('0x26')](0x2,_0x261d0d['length'])[_0xa605('0x21')](','));}else{_0x276ff8[_0xa605('0x25')](_0x261d0d[0x0]);_0x276ff8[_0xa605('0x25')](_0x261d0d[_0xa605('0x26')](0x1,_0x261d0d[_0xa605('0x1f')])[_0xa605('0x21')](','));}break;case _0xa605('0x27'):var _0x5be0df=_0x5852c0[_0xa605('0x28')][_0xa605('0x29')](',');_0x276ff8[_0xa605('0x25')](_0x5be0df[0x0]);_0x276ff8[_0xa605('0x25')](_0x5be0df[0x1]);_0x276ff8[_0xa605('0x25')](_0x5be0df[_0xa605('0x26')](0x2,_0x5be0df[_0xa605('0x1f')])[_0xa605('0x21')](','));break;case'dialogflowv2':var _0x5eb850=_0x5852c0[_0xa605('0x28')][_0xa605('0x29')](',');_0x276ff8[_0xa605('0x25')](_0x5eb850[0x0]);_0x276ff8[_0xa605('0x25')](_0x5eb850[0x1]);_0x276ff8[_0xa605('0x25')](_0x5eb850[0x2]);_0x276ff8[_0xa605('0x25')](_0x5eb850[0x3]);_0x276ff8[_0xa605('0x25')](_0x5eb850[_0xa605('0x26')](0x4,_0x5eb850[_0xa605('0x1f')])[_0xa605('0x21')](','));break;case _0xa605('0x2a'):var _0x2010af=_0x5852c0[_0xa605('0x28')][_0xa605('0x29')](',');_0x276ff8[_0xa605('0x25')](_0x2010af[0x0]);_0x276ff8[_0xa605('0x25')](_0x2010af[0x1]);_0x276ff8[_0xa605('0x25')](_0x2010af[0x2]);_0x276ff8[_0xa605('0x25')](_0x2010af[0x3]);_0x276ff8[_0xa605('0x25')](_0x2010af[_0xa605('0x26')](0x4,_0x2010af[_0xa605('0x1f')])[_0xa605('0x21')](','));break;case _0xa605('0x19'):_0x276ff8[_0xa605('0x25')](_0x5852c0[_0xa605('0x28')]);break;case _0xa605('0x2b'):_0x276ff8[_0xa605('0x25')](_0x5852c0[_0xa605('0x2c')]);_0x276ff8[_0xa605('0x25')](_0x5852c0['appdata']);break;case _0xa605('0x2d'):var _0x12030c=utils[_0xa605('0x2e')](_0x4c417f['account']['notificationTemplate'],_0x4c417f);var _0x354ded=_0x5852c0[_0xa605('0x28')][_0xa605('0x29')](',');_0x276ff8[_0xa605('0x25')](_0x354ded[0x0]);_0x276ff8[_0xa605('0x25')](_0x354ded[0x1]);_0x276ff8[_0xa605('0x25')](_0x354ded[0x2]);_0x276ff8[_0xa605('0x25')](_0x354ded[0x3]);_0x276ff8[_0xa605('0x25')](_0x354ded[0x4]);_0x276ff8[_0xa605('0x25')](_0x354ded[0x5]);_0x276ff8['push'](_0x354ded[0x6]);_0x276ff8[_0xa605('0x25')](_0x354ded[0x7]);_0x276ff8[_0xa605('0x25')](_0x354ded[0x8]);_0x276ff8[_0xa605('0x25')](_0x354ded[0x9]);_0x276ff8[_0xa605('0x25')](_0x354ded[0xa]);_0x276ff8[_0xa605('0x25')](_0x4c417f[_0xa605('0x1a')]['id']);_0x276ff8[_0xa605('0x25')](_0x4c417f[_0xa605('0x19')]['id']);_0x276ff8[_0xa605('0x25')](_0x5852c0[_0xa605('0x2f')]);_0x276ff8['push'](_0x4c417f['interaction'][_0xa605('0x30')]);_0x276ff8['push'](_0x4c417f[_0xa605('0x31')][_0xa605('0x31')]);_0x276ff8['push'](_0x12030c);break;default:_0x276ff8=_['isNil'](_0x5852c0[_0xa605('0x28')])?[]:_0x5852c0[_0xa605('0x28')][_0xa605('0x29')](',');}var _0x8737ea={'id':util['format'](_0xa605('0x32'),_0x364d8a,_0x5852c0['id'],_0x5852c0[_0xa605('0x33')]),'condition':require(_0xa605('0x34'))[_0xa605('0x35')](_0x364d8a,getIntervals(_0x316da3[_0xa605('0x36')],_0x5852c0),_0x316da3),'consequence':require(_0xa605('0x37')+_0x5852c0[_0xa605('0x33')])[_0xa605('0x38')](_0x364d8a,_0x276ff8,_0x316da3,_0x4c417f),'p':_0x5852c0['priority']||0x0};logger[_0xa605('0x39')](_0xa605('0x3a'),_0x8737ea['id'],_0xa605('0x3b'),getIntervals(_0x316da3[_0xa605('0x36')],_0x5852c0)[_0xa605('0x21')]('\x20|\x20'));_0x471c80[_0xa605('0x25')](_0x8737ea);}else{logger['error']('Please\x20create\x20a\x20new\x20file\x20under',path[_0xa605('0x21')](__dirname,_0xa605('0x1e'),_0x5852c0[_0xa605('0x33')]+'.js'));}}_0x316da3['rules'][_0x364d8a]=new RuleEngine(_0x471c80);_0x316da3[_0xa605('0x17')][_0x364d8a][_0xa605('0x3c')](_0x4c417f,function(_0x37624d){logger['info'](_0xa605('0x3d'),JSON['stringify'](_0x37624d[_0xa605('0x3e')]));if(_0x316da3['rules'][_0x364d8a]){_0x316da3[_0xa605('0x17')][_0x364d8a][_0xa605('0x3f')](_0xa605('0x40'));}});return _0x1103e6({'code':0xc8,'message':_0x4c417f});}else{if(_0x47dd15){logger[_0xa605('0x39')](util[_0xa605('0xf')]('Skipped\x20routing\x20for\x20%s',_0x364d8a));}else{logger[_0xa605('0x39')]('No\x20applications\x20to\x20execute');}return _0x1103e6({'code':0xc8,'message':_0x4c417f});}}catch(_0x118d41){logger[_0xa605('0x41')](_0x118d41[_0xa605('0x42')]);return _0x24a6a3(_0x4edb0c['error'](0x1f4,_0x118d41));}}return _0x24a6a3('routing\x20is\x20empty');});},'AcceptMessage':function(_0x57bdb3){var _0x47e741=this;return new Promise(function(_0x50cb7e,_0x31a9d5){if(_0x57bdb3['agent']&&_0x57bdb3['agent']['id']){if(_0x316da3['agents'][_0x57bdb3[_0xa605('0x43')]['id']]){_0x316da3[_0xa605('0x44')][_0x57bdb3[_0xa605('0x43')]['id']]['busy']=![];_0x316da3[_0xa605('0x44')][_0x57bdb3['agent']['id']][_0xa605('0x45')]=undefined;}}if(_0x57bdb3['message']&&_0x57bdb3['message']['id']){try{var _0x3e62ac=getId(_0x57bdb3[_0xa605('0x18')],_0x57bdb3[_0xa605('0x19')]?_0x57bdb3[_0xa605('0x19')]['id']:0x0,_0x57bdb3[_0xa605('0x1a')]?_0x57bdb3[_0xa605('0x1a')]['id']:0x0);if(_0x316da3['rules'][_0x3e62ac]){_0x316da3[_0xa605('0x17')][_0x3e62ac][_0xa605('0x3f')](_0xa605('0x46'));if(rpc[_0x57bdb3[_0xa605('0x18')]+_0xa605('0x47')]){rpc[_0x57bdb3[_0xa605('0x18')]+'QueueReport']['update'](_0x3e62ac,{'UserId':_0x57bdb3[_0xa605('0x19')][_0xa605('0x48')]})['catch'](function(){logger[_0xa605('0x41')](_0xa605('0x49'));});}}return _0x50cb7e({'code':0xc8,'message':_0x57bdb3});}catch(_0x51bb0e){logger[_0xa605('0x41')](_0x51bb0e[_0xa605('0x42')]);return _0x31a9d5(_0x47e741[_0xa605('0x41')](0x1f4,_0x51bb0e));}}logger['error'](_0xa605('0x4a'));return _0x31a9d5(_0x47e741[_0xa605('0x41')](0x1f4,_0xa605('0x4a')));});},'RejectMessage':function(_0x42359f){var _0x3bf423=this;return new Promise(function(_0x307073,_0x4bba4a){if(_0x42359f['agent']&&_0x42359f[_0xa605('0x43')]['id']){try{if(_0x316da3[_0xa605('0x44')][_0x42359f['agent']['id']]){_0x316da3['agents'][_0x42359f['agent']['id']]['busy']=![];_0x316da3[_0xa605('0x44')][_0x42359f[_0xa605('0x43')]['id']][_0xa605('0x45')]=undefined;}return _0x307073({'code':0xc8,'message':_0x42359f});}catch(_0x447c25){logger[_0xa605('0x41')](_0x447c25['stack']);return _0x4bba4a(_0x3bf423['error'](0x1f4,_0x447c25));}}logger[_0xa605('0x41')](_0xa605('0x4a'));return _0x4bba4a(_0x3bf423[_0xa605('0x41')](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0xec102a){var _0x1575e3=this;return new Promise(function(_0x29a695,_0x31f372){if(_0xec102a[_0xa605('0x18')]&&_0xec102a[_0xa605('0x1a')]&&_0xec102a[_0xa605('0x1a')]['id']){try{var _0x3e85c9=getId(_0xec102a[_0xa605('0x18')],_0xec102a['message']?_0xec102a[_0xa605('0x19')]['id']:0x0,_0xec102a['interaction']?_0xec102a[_0xa605('0x1a')]['id']:0x0);if(_0x316da3[_0xa605('0x17')][_0x3e85c9]){_0x316da3['rules'][_0x3e85c9]['emit'](_0xa605('0x46'));}return _0x29a695({'code':0xc8,'message':_0xec102a});}catch(_0x259a05){logger[_0xa605('0x41')](_0x259a05[_0xa605('0x42')]);return _0x31f372(_0x1575e3['error'](0x1f4,_0x259a05));}}logger['error'](_0xa605('0x4a'));return _0x31f372(_0x1575e3[_0xa605('0x41')](0x1f4,_0xa605('0x4a')));});},'AgentCapacity':function(_0x3aa8cb){var _0x2b2928=this;return new Promise(function(_0x5b1bb5,_0x4a27ee){if(_0x316da3[_0xa605('0x44')][_0xa605('0x4b')](_0x3aa8cb['id'])){for(var _0x499b05 in _0x3aa8cb['capacity']){if(_0x3aa8cb[_0xa605('0x4c')][_0xa605('0x4b')](_0x499b05)){if(_0x316da3[_0xa605('0x44')][_0x3aa8cb['id']][_0xa605('0x4b')](_0x499b05+_0xa605('0x4d'))){_0x316da3[_0xa605('0x44')][_0x3aa8cb['id']][_0x499b05+_0xa605('0x4d')]=parseInt(_0x3aa8cb['capacity'][_0x499b05],0xa);}}}_0x316da3[_0xa605('0x44')][_0x3aa8cb['id']][_0xa605('0x4e')]();return _0x5b1bb5({'code':0xc8,'message':_0x316da3[_0xa605('0x44')][_0x3aa8cb['id']]});}else{return _0x4a27ee(_0x2b2928[_0xa605('0x41')](0x1f4,_0xa605('0x4f')));}});},'Agents':function(_0x27b251){return new Promise(function(_0x2540b1){var _0x34a922=_[_0xa605('0x50')](_0x316da3['agents']);if(_0x27b251&&_0x27b251['id']){var _0x186fcb=_[_0xa605('0x51')](_0x34a922,function(_0x373c5e){return _0x373c5e['id']===_0x27b251['id'];});_0x2540b1(_0x186fcb);}else{_0x2540b1({'count':_0x34a922[_0xa605('0x1f')],'rows':_0x34a922});}});},'ChatQueues':function(){return new Promise(function(_0x535f07){var _0x5e8778=[];for(var _0x1f9923 in _0x316da3['chatQueues']){if(_0x316da3[_0xa605('0x52')][_0xa605('0x4b')](_0x1f9923)){var _0x4a6ce8=_0x316da3[_0xa605('0x52')][_0x1f9923];var _0x4971e4={'id':_0x4a6ce8['id'],'available':_0x4a6ce8['available'],'loggedIn':_0x4a6ce8[_0xa605('0x53')],'name':_0x4a6ce8[_0xa605('0x54')],'paused':_0x4a6ce8[_0xa605('0x55')],'waiting':_0x4a6ce8[_0xa605('0x56')]};_0x5e8778[_0xa605('0x25')](_0x4971e4);}}_0x535f07({'count':_0x5e8778['length'],'rows':_0x5e8778});});},'MailQueues':function(){return new Promise(function(_0x421837){var _0x2a1105=[];for(var _0x47e9f0 in _0x316da3['mailQueues']){if(_0x316da3[_0xa605('0x57')][_0xa605('0x4b')](_0x47e9f0)){var _0x1cf052=_0x316da3[_0xa605('0x57')][_0x47e9f0];var _0xec3a3a={'id':_0x1cf052['id'],'available':_0x1cf052[_0xa605('0x58')],'loggedIn':_0x1cf052[_0xa605('0x53')],'name':_0x1cf052[_0xa605('0x54')],'paused':_0x1cf052['paused'],'waiting':_0x1cf052[_0xa605('0x56')]};_0x2a1105['push'](_0xec3a3a);}}_0x421837({'count':_0x2a1105[_0xa605('0x1f')],'rows':_0x2a1105});});},'OpenchannelQueues':function(){return new Promise(function(_0x4a428c){var _0x5065ad=[];for(var _0x1b47e2 in _0x316da3[_0xa605('0x59')]){if(_0x316da3[_0xa605('0x59')][_0xa605('0x4b')](_0x1b47e2)){var _0x4e781f=_0x316da3[_0xa605('0x59')][_0x1b47e2];var _0x49f19e={'id':_0x4e781f['id'],'available':_0x4e781f[_0xa605('0x58')],'loggedIn':_0x4e781f[_0xa605('0x53')],'name':_0x4e781f[_0xa605('0x54')],'paused':_0x4e781f[_0xa605('0x55')],'waiting':_0x4e781f[_0xa605('0x56')]};_0x5065ad[_0xa605('0x25')](_0x49f19e);}}_0x4a428c({'count':_0x5065ad[_0xa605('0x1f')],'rows':_0x5065ad});});},'SmsQueues':function(){return new Promise(function(_0x4e0749){var _0x5495d2=[];for(var _0x417cdf in _0x316da3[_0xa605('0x5a')]){if(_0x316da3[_0xa605('0x5a')][_0xa605('0x4b')](_0x417cdf)){var _0x527b66=_0x316da3[_0xa605('0x5a')][_0x417cdf];var _0x50a469={'id':_0x527b66['id'],'available':_0x527b66[_0xa605('0x58')],'loggedIn':_0x527b66[_0xa605('0x53')],'name':_0x527b66[_0xa605('0x54')],'paused':_0x527b66['paused'],'waiting':_0x527b66[_0xa605('0x56')]};_0x5495d2['push'](_0x50a469);}}_0x4e0749({'count':_0x5495d2['length'],'rows':_0x5495d2});});},'FaxQueues':function(){return new Promise(function(_0x529467){var _0x364998=[];for(var _0x42c655 in _0x316da3[_0xa605('0x5b')]){if(_0x316da3[_0xa605('0x5b')]['hasOwnProperty'](_0x42c655)){var _0x2a05c4=_0x316da3[_0xa605('0x5b')][_0x42c655];var _0x23e60={'id':_0x2a05c4['id'],'available':_0x2a05c4['available'],'loggedIn':_0x2a05c4[_0xa605('0x53')],'name':_0x2a05c4[_0xa605('0x54')],'paused':_0x2a05c4[_0xa605('0x55')],'waiting':_0x2a05c4[_0xa605('0x56')]};_0x364998['push'](_0x23e60);}}_0x529467({'count':_0x364998[_0xa605('0x1f')],'rows':_0x364998});});},'WhatsappQueues':function(){return new Promise(function(_0x22c5fb){var _0x1016dc=[];for(var _0x54cf9b in _0x316da3['whatsappQueues']){if(_0x316da3['whatsappQueues'][_0xa605('0x4b')](_0x54cf9b)){var _0x6bdf58=_0x316da3[_0xa605('0x5c')][_0x54cf9b];var _0x327772={'id':_0x6bdf58['id'],'available':_0x6bdf58[_0xa605('0x58')],'loggedIn':_0x6bdf58[_0xa605('0x53')],'name':_0x6bdf58[_0xa605('0x54')],'paused':_0x6bdf58[_0xa605('0x55')],'waiting':_0x6bdf58[_0xa605('0x56')]};_0x1016dc['push'](_0x327772);}}_0x22c5fb({'count':_0x1016dc[_0xa605('0x1f')],'rows':_0x1016dc});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x1770a9){var _0xdae10d=_['values'](_0x316da3[_0xa605('0x5d')]);_0x1770a9({'count':_0xdae10d[_0xa605('0x1f')],'rows':_0xdae10d});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x4ff86b){var _0xaab346=_[_0xa605('0x50')](_0x316da3[_0xa605('0x5e')]);_0x4ff86b({'count':_0xaab346['length'],'rows':_0xaab346});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x2625e0){var _0x4b37e3=_[_0xa605('0x50')](_0x316da3[_0xa605('0x5f')]);_0x2625e0({'count':_0x4b37e3[_0xa605('0x1f')],'rows':_0x4b37e3});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x83f073){var _0x2fdfa6=_[_0xa605('0x50')](_0x316da3[_0xa605('0x60')]);_0x83f073({'count':_0x2fdfa6[_0xa605('0x1f')],'rows':_0x2fdfa6});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x36da64){var _0xed9f17=_[_0xa605('0x50')](_0x316da3['faxQueuesWaitingInteractions']);_0x36da64({'count':_0xed9f17[_0xa605('0x1f')],'rows':_0xed9f17});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x148ecd){var _0x261d5b=_['values'](_0x316da3['whatsappQueuesWaitingInteractions']);_0x148ecd({'count':_0x261d5b[_0xa605('0x1f')],'rows':_0x261d5b});});}};var _0x324981=jayson[_0xa605('0x61')](_0x410eba)['http']();_0x324981['on'](_0xa605('0x41'),function(_0x5dd275){logger[_0xa605('0x41')](JSON['stringify'](_0x5dd275));return _0x4d178b(_0x5dd275);});_0x324981[_0xa605('0x16')](0x232c,_0xa605('0x62'),function(){console[_0xa605('0x63')](_0xa605('0x64'),0x232c);return _0x1a0f67(_0xa605('0x65')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 70dc207..3f4dce6 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 _0xc669=['stop','Command','message','true','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','log','stack','util','bluebird','jayson/promise','lodash','../../../config/logger','routing','client','request','then','error','result','catch','rules','info'];(function(_0x4bed75,_0x211cc7){var _0x2dd8e8=function(_0x6369c7){while(--_0x6369c7){_0x4bed75['push'](_0x4bed75['shift']());}};_0x2dd8e8(++_0x211cc7);}(_0xc669,0x94));var _0x9c66=function(_0x5309ea,_0x3bff66){_0x5309ea=_0x5309ea-0x0;var _0xb0b0f1=_0xc669[_0x5309ea];return _0xb0b0f1;};'use strict';var util=require(_0x9c66('0x0'));var BPromise=require(_0x9c66('0x1'));var jayson=require(_0x9c66('0x2'));var _=require(_0x9c66('0x3'));var logger=require(_0x9c66('0x4'))(_0x9c66('0x5'));var client=jayson[_0x9c66('0x6')]['http']({'port':0x232a});function request(_0x1534b8,_0x93edae){return new BPromise(function(_0x32ed4f,_0x5ba1e2){return client[_0x9c66('0x7')](_0x1534b8,_0x93edae)[_0x9c66('0x8')](function(_0x4f59d4){if(_0x4f59d4['error']){return _0x5ba1e2(_0x4f59d4[_0x9c66('0x9')]['message']);}else{return _0x32ed4f(_0x4f59d4[_0x9c66('0xa')]);}})[_0x9c66('0xb')](function(_0x832985){return _0x5ba1e2(_0x832985);});});}exports['condition']=function(_0x1e1968,_0x265634,_0x586a81){return function(_0x121d0b){if(_0x586a81[_0x9c66('0xc')]&&!_0x586a81['rules'][_0x1e1968]){logger[_0x9c66('0xd')]('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x1e1968);return _0x121d0b[_0x9c66('0xe')]();}var _0x11db0b=[];for(var _0x3f5e7b=0x0;_0x3f5e7b<_0x265634['length'];_0x3f5e7b+=0x1){_0x11db0b['push'](request(_0x9c66('0xf'),{'command':util['format']('iftime\x20%s',_0x265634[_0x3f5e7b])})['then'](function(_0x4fc53c){return _0x4fc53c&&_0x4fc53c['message']&&_0x4fc53c[_0x9c66('0x10')]['indexOf'](_0x9c66('0x11'))>=0x0?!![]:![];})[_0x9c66('0xb')](function(_0x47cda4){logger[_0x9c66('0x9')](_0x9c66('0x12'),_0x1e1968,_0x265634[_0x3f5e7b]);}));}BPromise[_0x9c66('0x13')](_0x11db0b)[_0x9c66('0x8')](function(_0x18f1e9){var _0x3b4ffa=_[_0x9c66('0x14')](_0x18f1e9);logger[_0x9c66('0xd')](_0x9c66('0x15'),_0x1e1968,_0x265634[_0x9c66('0x16')](_0x9c66('0x17')),_0x3b4ffa);_0x121d0b[_0x9c66('0x18')](_0x3b4ffa);})[_0x9c66('0xb')](function(_0x2d1c36){console[_0x9c66('0x19')](_0x2d1c36);logger[_0x9c66('0x9')](_0x9c66('0x15'),_0x1e1968,_0x265634[_0x9c66('0x16')](_0x9c66('0x17')),_0x2d1c36[_0x9c66('0x1a')]);_0x121d0b['stop']();});};}; \ No newline at end of file +var _0xe00f=['some','[%s][INTERVAL\x20VALID]\x20%s\x20%s','\x20|\x20','when','[%s][INTERVAL\x20NOT\x20VALID]\x20%s\x20%s','stop','lodash','../../../utils/iftime','../../../config/logger','routing','condition','rules','map'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe00f,0x14b));var _0xfe00=function(_0x17c483,_0xc69535){_0x17c483=_0x17c483-0x0;var _0x112bdb=_0xe00f[_0x17c483];return _0x112bdb;};'use strict';var _=require(_0xfe00('0x0'));var iftime=require(_0xfe00('0x1'))['iftime'];var logger=require(_0xfe00('0x2'))(_0xfe00('0x3'));exports[_0xfe00('0x4')]=function(_0x363c51,_0xe93197,_0x1e6109){return function(_0x2f56c1){if(_0x1e6109['rules']&&!_0x1e6109[_0xfe00('0x5')][_0x363c51]){logger['info']('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x363c51);return _0x2f56c1['stop']();}var _0x49731b=_0xe93197[_0xfe00('0x6')](function(_0x36db80){return iftime(_0x36db80);});var _0x1908a1=_[_0xfe00('0x7')](_0x49731b);if(_0x1908a1){logger['info'](_0xfe00('0x8'),_0x363c51,_0xe93197['join'](_0xfe00('0x9')),_0x1908a1);_0x2f56c1[_0xfe00('0xa')](_0x1908a1);}else{logger['info'](_0xfe00('0xb'),_0x363c51,_0xe93197['join'](_0xfe00('0x9')));_0x2f56c1[_0xfe00('0xc')]();}};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 575f9f7..95e335e 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 _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(_0x2fd2f8,_0x8b1a2){var _0x222cd1=function(_0x22046c){while(--_0x22046c){_0x2fd2f8['push'](_0x2fd2f8['shift']());}};_0x222cd1(++_0x8b1a2);}(_0xa74f,0x9a));var _0xfa74=function(_0x284807,_0x4be925){_0x284807=_0x284807-0x0;var _0x50c774=_0xa74f[_0x284807];return _0x50c774;};'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 +var _0xbee3=['answeredelsewheremembername','[%s][agents][agentconnect]','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diffTime','complete','blindtransfer','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfereruniqueid','transfer','extension','transferuniqueid','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','ATTENDED','transferexten','transfereeuniqueid','agententerreason','clone','calleridnum','secondtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfererexten','transfertargetuniqueid','calleridname','agentconnectAt','hangup','[%s][agents][hangup]','timeout','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agentcompleteAt','agent','util','info','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','membername','interface','connectedlinenum','lastevent','queue','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw','acwtime','request','CreateVoiceAgentReport','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','agentcalledAt','format','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswer','agentringnoanswerAt','now','reason','holdtime','ringtime','talktime','push','queuecallerabandon','forIn','includes','abandoned','[%s][agents][queuecallerabandon]','agentconnect','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','connectedlinename','answered_elsewhere','answeredelsewheredestinationuniqueid'];(function(_0x56478c,_0x395503){var _0x296485=function(_0x20525e){while(--_0x20525e){_0x56478c['push'](_0x56478c['shift']());}};_0x296485(++_0x395503);}(_0xbee3,0xd5));var _0x3bee=function(_0x302c92,_0x42d6dd){_0x302c92=_0x302c92-0x0;var _0x8f022f=_0xbee3[_0x302c92];return _0x8f022f;};'use strict';var _=require('lodash');var util=require(_0x3bee('0x0'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x56a879,_0x45a1bf){utils[_0x3bee('0x1')](util['format'](_0x3bee('0x2'),_0x56a879[_0x3bee('0x3')],_0x56a879[_0x3bee('0x4')],_0x56a879['queue'],_0x56a879[_0x3bee('0x5')],_0x56a879[_0x3bee('0x6')],_0x56a879['calleridnum'],_0x56a879[_0x3bee('0x7')],_0x56a879[_0x3bee('0x8')]));if(_0x56a879[_0x3bee('0x9')]){utils[_0x3bee('0xa')](_0x56a879[_0x3bee('0x9')])[_0x3bee('0xb')](function(_0x3485b8){if(_0x3485b8){_0x56a879['type']=_0x3485b8[_0x3bee('0xc')];_0x56a879[_0x3bee('0xd')]=_0x56a879[_0x3bee('0xe')]?_0x3485b8[_0x3bee('0xf')]:![];_0x56a879[_0x3bee('0x10')]=_0x56a879[_0x3bee('0xd')]?_0x3485b8['acwTimeout']:0x0;}utils[_0x3bee('0x11')]('CreateVoiceAgentReport',_0x56a879);});}else{utils[_0x3bee('0x11')](_0x3bee('0x12'),_0x56a879);}if(_0x45a1bf){delete transfers[_0x56a879[_0x3bee('0x3')]];}else{delete agents[_0x56a879[_0x3bee('0x13')]];}}exports[_0x3bee('0x14')]=function(_0x459129){try{utils[_0x3bee('0x15')](util['format'](_0x3bee('0x16'),_0x459129[_0x3bee('0x3')]),_0x459129);agents[_0x459129[_0x3bee('0x13')]]=_0x459129;agents[_0x459129[_0x3bee('0x13')]][_0x3bee('0x17')]=utils['now']();agents[_0x459129['destuniqueid']][_0x3bee('0x8')]='called';agents[_0x459129[_0x3bee('0x13')]][_0x3bee('0x7')]=null;agents[_0x459129['destuniqueid']]['connectedlinename']=null;utils[_0x3bee('0x1')](util[_0x3bee('0x18')](_0x3bee('0x19'),_0x459129[_0x3bee('0x3')],agents[_0x459129['destuniqueid']][_0x3bee('0x5')],_0x459129[_0x3bee('0x13')]));}catch(_0x440644){utils[_0x3bee('0x1a')](util[_0x3bee('0x18')](_0x3bee('0x16'),_0x459129[_0x3bee('0x3')]),_0x440644);}};exports['agentringnoanswer']=function(_0x4f36af){try{if(!_[_0x3bee('0x1b')](agents[_0x4f36af[_0x3bee('0x13')]])){utils['debug'](util[_0x3bee('0x18')](_0x3bee('0x1c'),_0x4f36af[_0x3bee('0x3')]),_0x4f36af);utils[_0x3bee('0x1')](util[_0x3bee('0x18')](_0x3bee('0x1d'),_0x4f36af[_0x3bee('0x3')],agents[_0x4f36af['destuniqueid']][_0x3bee('0x5')],_0x4f36af[_0x3bee('0x13')]));agents[_0x4f36af[_0x3bee('0x13')]][_0x3bee('0x1e')]=!![];agents[_0x4f36af['destuniqueid']][_0x3bee('0x1f')]=utils[_0x3bee('0x20')]();agents[_0x4f36af[_0x3bee('0x13')]]['lastevent']='timeout';agents[_0x4f36af[_0x3bee('0x13')]][_0x3bee('0x21')]='timeout';agents[_0x4f36af[_0x3bee('0x13')]][_0x3bee('0x22')]=_0x4f36af[_0x3bee('0x23')]?parseInt(_0x4f36af['ringtime'])/0x3e8:0x0;agents[_0x4f36af[_0x3bee('0x13')]][_0x3bee('0x24')]=0x0;unanswered[_0x3bee('0x25')](_0x4f36af['destuniqueid']);}}catch(_0x239fa4){utils[_0x3bee('0x1a')](util[_0x3bee('0x18')]('[%s][agents][agentringnoanswer]',_0x4f36af[_0x3bee('0x3')]),_0x239fa4);}};exports[_0x3bee('0x26')]=function(_0x27ed99){try{_[_0x3bee('0x27')](agents,function(_0x3433aa,_0x559c2b){if(_0x3433aa['uniqueid']==_0x27ed99[_0x3bee('0x3')]&&!_[_0x3bee('0x28')](unanswered,_0x3433aa[_0x3bee('0x13')])){utils[_0x3bee('0x15')](util['format']('[%s][agents][queuecallerabandon]',_0x27ed99[_0x3bee('0x3')]),_0x27ed99);utils[_0x3bee('0x1')](util['format']('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x27ed99[_0x3bee('0x3')],_0x3433aa[_0x3bee('0x5')],_0x3433aa[_0x3bee('0x13')]));_0x3433aa[_0x3bee('0x1e')]=!![];_0x3433aa[_0x3bee('0x1f')]=utils[_0x3bee('0x20')]();_0x3433aa[_0x3bee('0x8')]=_0x3bee('0x29');_0x3433aa[_0x3bee('0x21')]=_0x3bee('0x29');_0x3433aa['holdtime']=_0x27ed99['holdtime'];_0x3433aa[_0x3bee('0x24')]=0x0;writeDB(_0x3433aa);}});}catch(_0x4a4706){utils['error'](util[_0x3bee('0x18')](_0x3bee('0x2a'),_0x27ed99[_0x3bee('0x3')]),_0x4a4706);}};exports[_0x3bee('0x2b')]=function(_0xd926f8){try{if(agents[_0xd926f8[_0x3bee('0x13')]]){utils[_0x3bee('0x15')](util[_0x3bee('0x18')]('[%s][agents][agentconnect]',_0xd926f8[_0x3bee('0x3')]),_0xd926f8);utils[_0x3bee('0x1')](util['format'](_0x3bee('0x2c'),_0xd926f8[_0x3bee('0x3')],agents[_0xd926f8[_0x3bee('0x13')]][_0x3bee('0x5')],_0xd926f8[_0x3bee('0x13')]));agents[_0xd926f8['destuniqueid']]['agentconnectAt']=utils[_0x3bee('0x20')]();agents[_0xd926f8[_0x3bee('0x13')]][_0x3bee('0x7')]=_0xd926f8[_0x3bee('0x7')];agents[_0xd926f8[_0x3bee('0x13')]][_0x3bee('0x2d')]=_0xd926f8[_0x3bee('0x2d')];agents[_0xd926f8[_0x3bee('0x13')]][_0x3bee('0x22')]=_0xd926f8[_0x3bee('0x23')];agents[_0xd926f8[_0x3bee('0x13')]][_0x3bee('0x8')]='connect';_[_0x3bee('0x27')](agents,function(_0x1b5eca,_0x25158b){if(_0x1b5eca[_0x3bee('0x13')]!=_0xd926f8[_0x3bee('0x13')]&&_0x1b5eca[_0x3bee('0x3')]==_0xd926f8[_0x3bee('0x3')]){_0x1b5eca[_0x3bee('0x24')]=0x0;_0x1b5eca[_0x3bee('0x22')]=_0xd926f8[_0x3bee('0x23')];_0x1b5eca[_0x3bee('0x1e')]=!![];_0x1b5eca[_0x3bee('0x1f')]=utils[_0x3bee('0x20')]();_0x1b5eca['lastevent']=_0x3bee('0x2e');_0x1b5eca[_0x3bee('0x21')]=_0x3bee('0x2e');_0x1b5eca[_0x3bee('0x2f')]=_0xd926f8[_0x3bee('0x13')];_0x1b5eca[_0x3bee('0x30')]=_0xd926f8[_0x3bee('0x5')];writeDB(_0x1b5eca);}});}}catch(_0xd1140d){utils['error'](util[_0x3bee('0x18')](_0x3bee('0x31'),_0xd926f8[_0x3bee('0x3')]),_0xd1140d);}};exports['agentcomplete']=function(_0x4567f2){try{if(!_['isNil'](agents[_0x4567f2[_0x3bee('0x13')]])){utils['debug'](util['format'](_0x3bee('0x32'),_0x4567f2[_0x3bee('0x3')]),_0x4567f2);utils[_0x3bee('0x1')](util[_0x3bee('0x18')](_0x3bee('0x33'),_0x4567f2['uniqueid'],agents[_0x4567f2['destuniqueid']][_0x3bee('0x5')],_0x4567f2['destuniqueid']));agents[_0x4567f2[_0x3bee('0x13')]]['agentcomplete']=!![];agents[_0x4567f2[_0x3bee('0x13')]]['agentcompleteAt']=utils[_0x3bee('0x20')]();agents[_0x4567f2[_0x3bee('0x13')]][_0x3bee('0x24')]=utils[_0x3bee('0x34')](agents[_0x4567f2['destuniqueid']]['agentcompleteAt'],agents[_0x4567f2[_0x3bee('0x13')]]['agentconnectAt']);agents[_0x4567f2['destuniqueid']]['reason']=_0x4567f2[_0x3bee('0x21')];agents[_0x4567f2['destuniqueid']][_0x3bee('0x8')]=_0x3bee('0x35');writeDB(agents[_0x4567f2[_0x3bee('0x13')]]);}}catch(_0x593427){utils[_0x3bee('0x1a')](util['format'](_0x3bee('0x32'),_0x4567f2['uniqueid']),_0x593427);}};exports[_0x3bee('0x36')]=function(_0x16b096){try{if(!_[_0x3bee('0x1b')](agents[_0x16b096['transfereruniqueid']])){utils[_0x3bee('0x15')](util[_0x3bee('0x18')](_0x3bee('0x37'),_0x16b096['uniqueid']),_0x16b096);utils['info'](util[_0x3bee('0x18')](_0x3bee('0x38'),_0x16b096[_0x3bee('0x3')],agents[_0x16b096[_0x3bee('0x39')]][_0x3bee('0x5')],agents[_0x16b096[_0x3bee('0x39')]][_0x3bee('0x3')]));agents[_0x16b096['transfereruniqueid']][_0x3bee('0x3a')]=!![];agents[_0x16b096[_0x3bee('0x39')]]['transfertype']='blind';agents[_0x16b096[_0x3bee('0x39')]]['transferexten']=_0x16b096[_0x3bee('0x3b')];agents[_0x16b096[_0x3bee('0x39')]][_0x3bee('0x3c')]=agents[_0x16b096['transfereruniqueid']][_0x3bee('0x3')];}}catch(_0x3beac9){utils[_0x3bee('0x1a')](util['format'](_0x3bee('0x37'),_0x16b096[_0x3bee('0x3')]),_0x3beac9);}};exports['attendedtransfer']=function(_0x7e37ed){try{utils[_0x3bee('0x15')](util['format'](_0x3bee('0x3d'),_0x7e37ed[_0x3bee('0x3e')]),_0x7e37ed);if(_0x7e37ed[_0x3bee('0x3e')]==_0x7e37ed[_0x3bee('0x3f')]){if(!_[_0x3bee('0x1b')](agents[_0x7e37ed[_0x3bee('0x40')]])){utils[_0x3bee('0x1')](util[_0x3bee('0x18')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x7e37ed['origtransfereruniqueid'],agents[_0x7e37ed[_0x3bee('0x40')]]['membername']));agents[_0x7e37ed[_0x3bee('0x40')]][_0x3bee('0x3a')]=!![];agents[_0x7e37ed[_0x3bee('0x40')]]['transfertype']=_0x3bee('0x41');agents[_0x7e37ed[_0x3bee('0x40')]][_0x3bee('0x42')]=_0x7e37ed['origtransfererexten'];agents[_0x7e37ed[_0x3bee('0x40')]]['transferuniqueid']=_0x7e37ed[_0x3bee('0x3e')];}if(_0x7e37ed[_0x3bee('0x43')]&&agents[_0x7e37ed[_0x3bee('0x43')]]){agents[_0x7e37ed['transfereeuniqueid']][_0x3bee('0x44')]=0x1;transfers[_0x7e37ed[_0x3bee('0x43')]]=_[_0x3bee('0x45')](agents[_0x7e37ed['transfereeuniqueid']]);transfers[_0x7e37ed['transfereeuniqueid']][_0x3bee('0x46')]=agents[_0x7e37ed[_0x3bee('0x40')]][_0x3bee('0x46')];transfers[_0x7e37ed['transfereeuniqueid']]['calleridname']=agents[_0x7e37ed[_0x3bee('0x40')]]['calleridname'];transfers[_0x7e37ed['transfereeuniqueid']][_0x3bee('0x17')]=utils[_0x3bee('0x20')]();transfers[_0x7e37ed[_0x3bee('0x43')]]['agentconnectAt']=utils['now']();transfers[_0x7e37ed[_0x3bee('0x43')]][_0x3bee('0x22')]=0x0;transfers[_0x7e37ed['transfereeuniqueid']][_0x3bee('0x44')]=0x2;}}else if(_0x7e37ed['secondtransfereruniqueid']==_0x7e37ed[_0x3bee('0x47')]){if(!_[_0x3bee('0x1b')](agents[_0x7e37ed[_0x3bee('0x3e')]])){utils[_0x3bee('0x1')](util[_0x3bee('0x18')](_0x3bee('0x48'),_0x7e37ed[_0x3bee('0x3e')],agents[_0x7e37ed[_0x3bee('0x3e')]][_0x3bee('0x5')]));agents[_0x7e37ed[_0x3bee('0x3e')]][_0x3bee('0x3a')]=!![];agents[_0x7e37ed['origtransfereruniqueid']]['transfertype']='ATTENDED';agents[_0x7e37ed[_0x3bee('0x3e')]][_0x3bee('0x42')]=_0x7e37ed[_0x3bee('0x49')];agents[_0x7e37ed[_0x3bee('0x3e')]]['transferuniqueid']=_0x7e37ed[_0x3bee('0x40')];}if(_0x7e37ed[_0x3bee('0x4a')]&&agents[_0x7e37ed['transfertargetuniqueid']]){agents[_0x7e37ed['transfertargetuniqueid']][_0x3bee('0x44')]=0x1;transfers[_0x7e37ed[_0x3bee('0x4a')]]=_[_0x3bee('0x45')](agents[_0x7e37ed['transfertargetuniqueid']]);transfers[_0x7e37ed[_0x3bee('0x4a')]][_0x3bee('0x46')]=agents[_0x7e37ed[_0x3bee('0x3e')]]['calleridnum'];transfers[_0x7e37ed[_0x3bee('0x4a')]][_0x3bee('0x4b')]=agents[_0x7e37ed[_0x3bee('0x3e')]][_0x3bee('0x4b')];transfers[_0x7e37ed['transfertargetuniqueid']]['agentcalledAt']=utils[_0x3bee('0x20')]();transfers[_0x7e37ed[_0x3bee('0x4a')]][_0x3bee('0x4c')]=utils[_0x3bee('0x20')]();transfers[_0x7e37ed[_0x3bee('0x4a')]]['holdtime']=0x0;transfers[_0x7e37ed[_0x3bee('0x4a')]]['agententerreason']=0x2;}}}catch(_0xddc56b){utils[_0x3bee('0x1a')](util[_0x3bee('0x18')](_0x3bee('0x3d'),_0x7e37ed[_0x3bee('0x3e')]),_0xddc56b);}};exports[_0x3bee('0x4d')]=function(_0x3f7dad){try{utils['debug'](util[_0x3bee('0x18')](_0x3bee('0x4e'),_0x3f7dad[_0x3bee('0x3')]),_0x3f7dad);if(agents[_0x3f7dad[_0x3bee('0x3')]]&&agents[_0x3f7dad['uniqueid']][_0x3bee('0x21')]===_0x3bee('0x4f')){if(_0x3f7dad[_0x3bee('0x50')]==='21'){agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x21')]=_0x3bee('0x51');agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x8')]='rejected';}utils[_0x3bee('0x1')](util[_0x3bee('0x18')](_0x3bee('0x52'),_0x3f7dad['uniqueid'],agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x5')],agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x21')],agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x8')]));writeDB(agents[_0x3f7dad[_0x3bee('0x3')]]);var _0x204843=unanswered[_0x3bee('0x53')](_0x3f7dad[_0x3bee('0x3')]);if(_0x204843>-0x1){unanswered[_0x3bee('0x54')](_0x204843,0x1);}}if(transfers[_0x3f7dad[_0x3bee('0x3')]]){transfers[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0xe')]=!![];transfers[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x55')]=utils[_0x3bee('0x20')]();transfers[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x24')]=utils[_0x3bee('0x34')](transfers[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x55')],transfers[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x4c')]);transfers[_0x3f7dad[_0x3bee('0x3')]]['reason']=_0x3bee('0x56');transfers[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x8')]=_0x3bee('0x35');utils[_0x3bee('0x1')](util[_0x3bee('0x18')](_0x3bee('0x52'),_0x3f7dad[_0x3bee('0x3')],transfers[_0x3f7dad[_0x3bee('0x3')]]['membername'],transfers[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x21')],transfers[_0x3f7dad['uniqueid']][_0x3bee('0x8')]));writeDB(transfers[_0x3f7dad['uniqueid']],!![]);}if(agents[_0x3f7dad[_0x3bee('0x3')]]&&agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x4c')]){agents[_0x3f7dad['uniqueid']]['agentcomplete']=!![];agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x55')]=utils[_0x3bee('0x20')]();agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x24')]=utils[_0x3bee('0x34')](agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x55')],agents[_0x3f7dad['uniqueid']][_0x3bee('0x4c')]);agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x21')]=agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x3a')]?_0x3bee('0x3a'):_0x3bee('0x56');agents[_0x3f7dad['uniqueid']][_0x3bee('0x8')]=_0x3bee('0x35');utils['info'](util[_0x3bee('0x18')](_0x3bee('0x52'),_0x3f7dad['uniqueid'],agents[_0x3f7dad[_0x3bee('0x3')]]['membername'],agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x21')],agents[_0x3f7dad[_0x3bee('0x3')]][_0x3bee('0x8')]));writeDB(agents[_0x3f7dad['uniqueid']]);}}catch(_0x62900b){utils[_0x3bee('0x1a')](util[_0x3bee('0x18')]('[%s][agents][hangup]',_0x3f7dad[_0x3bee('0x3')]),_0x62900b);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 8e987b4..2b5a577 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 _0x77ec=['transfer','destinationchannel','answertime','disposition','toNumber','hangup','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','starttime','billableseconds','diffTime','localtwolinkedid','origtransfereruniqueid','secondtransfererchannel','userfield','_attended','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfererchannel','[%s][calls][attendedtransfer]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','[%s][calls][musiconholdstart]','musiconholdstop','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][musiconholdstop]','varset','[%s][calls][varset]','variable','value','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','lastapplication','Queue','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','set','startsWith','toLowerCase','cdr','lastIndexOf','includes','noop','execif','gotoif','lastdata','[%s][calls][newexten]','lodash','util','./utils','FAILED','NO\x20ANSWER','ANSWERED','BUSY','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','calleridnum','connectedlinenum','lastevent','accountcode','getUserByInternal','then','UserId','request','CreateVoiceCallReport','newchannel','debug','[%s][calls][newchannel]','linkedid','info','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','error','isNil','systemanswertime','channelstate'];(function(_0x2bfd4f,_0x1bbf2c){var _0x341849=function(_0x4c246e){while(--_0x4c246e){_0x2bfd4f['push'](_0x2bfd4f['shift']());}};_0x341849(++_0x1bbf2c);}(_0x77ec,0x117));var _0xc77e=function(_0x19a5d4,_0x5e7d31){_0x19a5d4=_0x19a5d4-0x0;var _0x1c6a1b=_0x77ec[_0x19a5d4];return _0x1c6a1b;};'use strict';var _=require(_0xc77e('0x0'));var util=require(_0xc77e('0x1'));var utils=require(_0xc77e('0x2'));var dispositions=['NO\x20ANSWER',_0xc77e('0x3'),_0xc77e('0x3'),'NO\x20ANSWER',_0xc77e('0x4'),'NO\x20ANSWER',_0xc77e('0x5'),_0xc77e('0x6'),'FAILED',_0xc77e('0x3'),_0xc77e('0x3')];var channels={};function writeDB(_0x4836ae){utils['info'](util[_0xc77e('0x7')](_0xc77e('0x8'),_0x4836ae[_0xc77e('0x9')],_0x4836ae[_0xc77e('0xa')],_0x4836ae[_0xc77e('0xb')],_0x4836ae[_0xc77e('0xc')],_0x4836ae['interface'],_0x4836ae[_0xc77e('0xd')],_0x4836ae[_0xc77e('0xe')],_0x4836ae[_0xc77e('0xf')]));if(_0x4836ae[_0xc77e('0x10')]){utils[_0xc77e('0x11')](_0x4836ae['accountcode'])[_0xc77e('0x12')](function(_0x2d5ae5){if(_0x2d5ae5){_0x4836ae[_0xc77e('0x13')]=_0x2d5ae5['id'];}utils[_0xc77e('0x14')](_0xc77e('0x15'),_0x4836ae);});}else{utils[_0xc77e('0x14')](_0xc77e('0x15'),_0x4836ae);}if(channels[_0x4836ae[_0xc77e('0x9')]]){delete channels[_0x4836ae['uniqueid']];}}exports[_0xc77e('0x16')]=function(_0x1a8ebb){try{utils[_0xc77e('0x17')](util[_0xc77e('0x7')](_0xc77e('0x18'),_0x1a8ebb['uniqueid']),_0x1a8ebb);if(_0x1a8ebb['uniqueid']==_0x1a8ebb[_0xc77e('0x19')]&&_0x1a8ebb[_0xc77e('0xa')]!='OutgoingSpoolFailed'){utils[_0xc77e('0x1a')](util[_0xc77e('0x7')](_0xc77e('0x1b'),_0x1a8ebb[_0xc77e('0x9')],_0x1a8ebb[_0xc77e('0x1c')],_0x1a8ebb[_0xc77e('0x1d')]));channels[_0x1a8ebb[_0xc77e('0x9')]]={'uniqueid':_0x1a8ebb[_0xc77e('0x9')],'accountcode':_0x1a8ebb[_0xc77e('0x10')],'source':_0x1a8ebb[_0xc77e('0xd')],'destination':_0x1a8ebb[_0xc77e('0x1d')],'destinationcontext':_0x1a8ebb[_0xc77e('0x1c')],'channel':_0x1a8ebb[_0xc77e('0xa')],'starttime':utils[_0xc77e('0x1e')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xc77e('0x4'),'amaflags':_0xc77e('0x1f')};}}catch(_0x3eb810){utils[_0xc77e('0x20')](util[_0xc77e('0x7')](_0xc77e('0x18'),_0x1a8ebb[_0xc77e('0x9')]),_0x3eb810);}};exports['newstate']=function(_0x3a007f){try{utils[_0xc77e('0x17')](util['format']('[%s][calls][newstate]',_0x3a007f[_0xc77e('0x9')]),_0x3a007f);if(!_[_0xc77e('0x21')](channels[_0x3a007f[_0xc77e('0x9')]])&&_0x3a007f['channelstate']==0x6){utils['info'](util[_0xc77e('0x7')]('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x3a007f[_0xc77e('0x9')],_0x3a007f[_0xc77e('0x1c')],_0x3a007f[_0xc77e('0xa')]));if(_[_0xc77e('0x21')](channels[_0x3a007f[_0xc77e('0x9')]][_0xc77e('0x22')])){channels[_0x3a007f[_0xc77e('0x9')]]['systemanswertime']=utils[_0xc77e('0x1e')]();}}else if(!_['isNil'](channels[_0x3a007f[_0xc77e('0x19')]])&&_0x3a007f[_0xc77e('0x23')]==0x6&&_0x3a007f['context']!=_0xc77e('0x24')){utils[_0xc77e('0x1a')](util[_0xc77e('0x7')]('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x3a007f['uniqueid'],_0x3a007f[_0xc77e('0x19')],_0x3a007f[_0xc77e('0x1c')],_0x3a007f['channel']));channels[_0x3a007f[_0xc77e('0x19')]][_0xc77e('0x10')]=_0x3a007f[_0xc77e('0x10')];channels[_0x3a007f[_0xc77e('0x19')]][_0xc77e('0x25')]=_0x3a007f[_0xc77e('0xa')];if(_['isNil'](channels[_0x3a007f[_0xc77e('0x19')]][_0xc77e('0x26')])){channels[_0x3a007f['linkedid']][_0xc77e('0x26')]=utils['now']();}channels[_0x3a007f[_0xc77e('0x19')]][_0xc77e('0x27')]=dispositions[_[_0xc77e('0x28')](_0x3a007f[_0xc77e('0x23')])]||_0xc77e('0x5');}}catch(_0xc01712){utils[_0xc77e('0x20')](util[_0xc77e('0x7')]('[%s][calls][newstate]',_0x3a007f['uniqueid']),_0xc01712);}};exports[_0xc77e('0x29')]=function(_0x49c724){try{if(!_['isNil'](channels[_0x49c724[_0xc77e('0x9')]])){utils[_0xc77e('0x17')](util[_0xc77e('0x7')](_0xc77e('0x2a'),_0x49c724[_0xc77e('0x9')]),_0x49c724);if(_[_0xc77e('0x21')](channels[_0x49c724[_0xc77e('0x9')]][_0xc77e('0x2b')])){channels[_0x49c724[_0xc77e('0x9')]][_0xc77e('0x2b')]=_0x49c724[_0xc77e('0x2c')]+'\x20<'+_0x49c724[_0xc77e('0xd')]+'>';}utils[_0xc77e('0x1a')](util['format'](_0xc77e('0x2d'),_0x49c724[_0xc77e('0x9')],channels[_0x49c724[_0xc77e('0x9')]]['callerid'],_0x49c724[_0xc77e('0x2e')]));channels[_0x49c724[_0xc77e('0x9')]][_0xc77e('0x2f')]=utils['now']();channels[_0x49c724['uniqueid']][_0xc77e('0x30')]=utils['diffTime'](channels[_0x49c724[_0xc77e('0x9')]][_0xc77e('0x2f')],channels[_0x49c724['uniqueid']][_0xc77e('0x31')]);channels[_0x49c724[_0xc77e('0x9')]][_0xc77e('0x32')]=channels[_0x49c724[_0xc77e('0x9')]][_0xc77e('0x26')]?utils[_0xc77e('0x33')](channels[_0x49c724['uniqueid']]['endtime'],channels[_0x49c724[_0xc77e('0x9')]][_0xc77e('0x26')]):0x0;writeDB(channels[_0x49c724[_0xc77e('0x9')]]);}}catch(_0x532b2a){utils[_0xc77e('0x20')](util[_0xc77e('0x7')](_0xc77e('0x2a'),_0x49c724[_0xc77e('0x9')]),_0x532b2a);}};exports['attendedtransfer']=function(_0x147fdf){try{if(!_['isNil'](channels[_0x147fdf[_0xc77e('0x34')]])){utils[_0xc77e('0x17')](util[_0xc77e('0x7')]('[%s][calls][attendedtransfer]',_0x147fdf[_0xc77e('0x35')]),_0x147fdf);if(channels[_0x147fdf[_0xc77e('0x34')]][_0xc77e('0xa')]==_0x147fdf['transfereechannel']){utils[_0xc77e('0x1a')](util[_0xc77e('0x7')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x147fdf[_0xc77e('0x35')],_0x147fdf['localtwolinkedid'],_0x147fdf[_0xc77e('0x36')]));channels[_0x147fdf[_0xc77e('0x34')]][_0xc77e('0x25')]=_0x147fdf[_0xc77e('0x36')];channels[_0x147fdf[_0xc77e('0x34')]][_0xc77e('0x37')]=_0xc77e('0x38');}else if(channels[_0x147fdf[_0xc77e('0x34')]]['channel']=_0x147fdf['transfertargetchannel']){utils[_0xc77e('0x1a')](util['format'](_0xc77e('0x39'),_0x147fdf[_0xc77e('0x35')],_0x147fdf[_0xc77e('0x34')],_0x147fdf[_0xc77e('0x3a')]));channels[_0x147fdf[_0xc77e('0x34')]]['destinationchannel']=_0x147fdf[_0xc77e('0x3a')];channels[_0x147fdf['localtwolinkedid']]['userfield']='_attended';}}}catch(_0x2cac85){utils[_0xc77e('0x20')](util['format'](_0xc77e('0x3b'),_0x147fdf[_0xc77e('0x35')]),_0x2cac85);}};exports['musiconholdstart']=function(_0x521e74){try{if(!_[_0xc77e('0x21')](channels[_0x521e74[_0xc77e('0x9')]])){utils[_0xc77e('0x17')](util[_0xc77e('0x7')]('[%s][calls][musiconholdstart]',_0x521e74['uniqueid']),_0x521e74);channels[_0x521e74[_0xc77e('0x9')]][_0xc77e('0x3c')]=utils['now']();utils['info'](util['format'](_0xc77e('0x3d'),_0x521e74['uniqueid'],channels[_0x521e74[_0xc77e('0x9')]][_0xc77e('0x3c')]));}}catch(_0x1663de){utils['error'](util[_0xc77e('0x7')](_0xc77e('0x3e'),_0x521e74[_0xc77e('0x9')]),_0x1663de);}};exports[_0xc77e('0x3f')]=function(_0x4595a9){try{if(!_[_0xc77e('0x21')](channels[_0x4595a9[_0xc77e('0x9')]])){utils[_0xc77e('0x17')](util[_0xc77e('0x7')]('[%s][calls][musiconholdstop]',_0x4595a9[_0xc77e('0x9')]),_0x4595a9);if(!_[_0xc77e('0x21')](channels[_0x4595a9[_0xc77e('0x9')]][_0xc77e('0x3c')])){channels[_0x4595a9[_0xc77e('0x9')]][_0xc77e('0x40')]+=utils['diffTime'](utils[_0xc77e('0x1e')](),channels[_0x4595a9[_0xc77e('0x9')]][_0xc77e('0x3c')]);utils['info'](util[_0xc77e('0x7')](_0xc77e('0x41'),_0x4595a9[_0xc77e('0x9')],channels[_0x4595a9[_0xc77e('0x9')]][_0xc77e('0x40')]));delete channels[_0x4595a9['uniqueid']]['musiconholdstartAt'];}}}catch(_0x44bfc3){utils[_0xc77e('0x20')](util[_0xc77e('0x7')](_0xc77e('0x42'),_0x4595a9['uniqueid']),_0x44bfc3);}};exports[_0xc77e('0x43')]=function(_0x39040f){try{if(!_[_0xc77e('0x21')](channels[_0x39040f[_0xc77e('0x9')]])){utils[_0xc77e('0x17')](util[_0xc77e('0x7')](_0xc77e('0x44'),_0x39040f[_0xc77e('0x9')]),_0x39040f);if(!_['isNil'](_0x39040f[_0xc77e('0x45')]['xmd-originatecalleridnum'])){utils[_0xc77e('0x1a')](util['format']('[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x39040f[_0xc77e('0x9')],_0x39040f[_0xc77e('0x46')]));channels[_0x39040f[_0xc77e('0x9')]]['source']=_0x39040f[_0xc77e('0x46')];}if(!_['isNil'](_0x39040f[_0xc77e('0x45')][_0xc77e('0x47')])){utils[_0xc77e('0x1a')](util[_0xc77e('0x7')](_0xc77e('0x48'),_0x39040f['uniqueid'],_0x39040f[_0xc77e('0x46')]));channels[_0x39040f[_0xc77e('0x9')]][_0xc77e('0x49')]=_0x39040f['value'];channels[_0x39040f[_0xc77e('0x9')]][_0xc77e('0x2b')]='\x22'+_0x39040f[_0xc77e('0x46')]+_0xc77e('0x4a')+_0x39040f['value']+'>';}if(!_[_0xc77e('0x21')](_0x39040f['variable'][_0xc77e('0x4b')])||!_[_0xc77e('0x21')](_0x39040f['variable'][_0xc77e('0x4c')])){utils['info'](util[_0xc77e('0x7')](_0xc77e('0x4d'),_0x39040f[_0xc77e('0x9')],!_['isNil'](_0x39040f[_0xc77e('0x45')][_0xc77e('0x4b')])?_0xc77e('0x4b'):_0xc77e('0x4c'),_0x39040f[_0xc77e('0x46')]));channels[_0x39040f[_0xc77e('0x9')]]['callerid']=_0x39040f['value'];}if(!_['isNil'](_0x39040f[_0xc77e('0x45')][_0xc77e('0x4e')])||!_[_0xc77e('0x21')](_0x39040f[_0xc77e('0x45')]['xmcs-queue'])){utils['info'](util[_0xc77e('0x7')](_0xc77e('0x4d'),_0x39040f[_0xc77e('0x9')],!_['isNil'](_0x39040f[_0xc77e('0x45')][_0xc77e('0x4e')])?_0xc77e('0x4e'):'xmcs-queue',_0x39040f['value']));channels[_0x39040f[_0xc77e('0x9')]][_0xc77e('0x4f')]=_0xc77e('0x50');channels[_0x39040f[_0xc77e('0x9')]]['lastdata']=_0x39040f[_0xc77e('0x46')];channels[_0x39040f['uniqueid']][_0xc77e('0xb')]=!![];}if(!_[_0xc77e('0x21')](_0x39040f['variable'][_0xc77e('0x51')])){utils['info'](util[_0xc77e('0x7')](_0xc77e('0x52'),_0x39040f[_0xc77e('0x9')],_0x39040f[_0xc77e('0x46')]));channels[_0x39040f[_0xc77e('0x9')]][_0xc77e('0x53')]=_0x39040f[_0xc77e('0x46')];}if(!_[_0xc77e('0x21')](_0x39040f[_0xc77e('0x45')][_0xc77e('0x54')])){utils[_0xc77e('0x1a')](util[_0xc77e('0x7')](_0xc77e('0x55'),_0x39040f[_0xc77e('0x9')],_0x39040f['value']));channels[_0x39040f[_0xc77e('0x9')]]['type']=_0x39040f['value'];}if(!_['isNil'](_0x39040f['variable'][_0xc77e('0x56')])){utils[_0xc77e('0x1a')](util['format'](_0xc77e('0x57'),_0x39040f['uniqueid'],_0x39040f[_0xc77e('0x46')]));channels[_0x39040f[_0xc77e('0x9')]][_0xc77e('0x58')]=_0x39040f[_0xc77e('0x46')];}if(!_[_0xc77e('0x21')](_0x39040f[_0xc77e('0x45')]['sipcallid'])){utils['info'](util[_0xc77e('0x7')](_0xc77e('0x59'),_0x39040f[_0xc77e('0x9')],_0x39040f[_0xc77e('0x46')]));channels[_0x39040f[_0xc77e('0x9')]]['sipcallid']=_0x39040f['value'];}}}catch(_0x14df7a){utils[_0xc77e('0x20')](util[_0xc77e('0x7')](_0xc77e('0x44'),_0x39040f['uniqueid']),_0x14df7a);}};exports[_0xc77e('0x5a')]=function(_0x245d74){try{if(!_[_0xc77e('0x21')](channels[_0x245d74['uniqueid']])){utils[_0xc77e('0x17')](util['format']('[%s][calls][newexten]',_0x245d74['uniqueid']),_0x245d74);utils[_0xc77e('0x1a')](util['format'](_0xc77e('0x5b'),_0x245d74[_0xc77e('0x9')],_0x245d74[_0xc77e('0x5c')],_0x245d74[_0xc77e('0x5d')]));if(_0x245d74['application']['toLowerCase']()==_0xc77e('0x5e')&&_[_0xc77e('0x5f')](_0x245d74['appdata'][_0xc77e('0x60')](),_0xc77e('0x61'))){var _0xcfb866=_0x245d74['appdata']['split']('=');var _0x6c0c25=_0xcfb866[0x0]['substring'](_0xcfb866[0x0]['lastIndexOf']('(')+0x1,_0xcfb866[0x0][_0xc77e('0x62')](')'));var _0x154510=_0xcfb866[0x1];channels[_0x245d74[_0xc77e('0x9')]][_0x6c0c25]=_0x154510;}if(!_[_0xc77e('0x63')]([_0xc77e('0x29'),_0xc77e('0x64'),_0xc77e('0x65'),_0xc77e('0x5e'),_0xc77e('0x66')],_0x245d74[_0xc77e('0x5c')][_0xc77e('0x60')]())){channels[_0x245d74[_0xc77e('0x9')]][_0xc77e('0x4f')]=_0x245d74['application'];channels[_0x245d74[_0xc77e('0x9')]][_0xc77e('0x67')]=_0x245d74['appdata'];}}}catch(_0xb4b988){utils['error'](util[_0xc77e('0x7')](_0xc77e('0x68'),_0x245d74[_0xc77e('0x9')]),_0xb4b988);}}; \ No newline at end of file +var _0xe92d=['type','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','cdr','split','substring','lastIndexOf','includes','noop','gotoif','lodash','util','./utils','NO\x20ANSWER','FAILED','ANSWERED','info','uniqueid','channel','interface','calleridnum','connectedlinenum','accountcode','getUserByInternal','UserId','request','CreateVoiceCallReport','debug','linkedid','OutgoingSpoolFailed','format','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','error','[%s][calls][newchannel]','[%s][calls][newstate]','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','answertime','disposition','toNumber','hangup','callerid','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','endtime','diffTime','starttime','billableseconds','[%s][calls][hangup]','attendedtransfer','[%s][calls][attendedtransfer]','origtransfereruniqueid','localtwolinkedid','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','destinationchannel','userfield','_attended','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]','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','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','queue','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s'];(function(_0x36bf1b,_0x1b8bc9){var _0x49c980=function(_0xd2122f){while(--_0xd2122f){_0x36bf1b['push'](_0x36bf1b['shift']());}};_0x49c980(++_0x1b8bc9);}(_0xe92d,0x1b1));var _0xde92=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xe92d[_0x126558];return _0x1f6d14;};'use strict';var _=require(_0xde92('0x0'));var util=require(_0xde92('0x1'));var utils=require(_0xde92('0x2'));var dispositions=[_0xde92('0x3'),_0xde92('0x4'),'FAILED','NO\x20ANSWER',_0xde92('0x3'),_0xde92('0x3'),_0xde92('0x5'),'BUSY','FAILED',_0xde92('0x4'),'FAILED'];var channels={};function writeDB(_0x352e99){utils[_0xde92('0x6')](util['format']('[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x352e99[_0xde92('0x7')],_0x352e99[_0xde92('0x8')],_0x352e99['queue'],_0x352e99['membername'],_0x352e99[_0xde92('0x9')],_0x352e99[_0xde92('0xa')],_0x352e99[_0xde92('0xb')],_0x352e99['lastevent']));if(_0x352e99[_0xde92('0xc')]){utils[_0xde92('0xd')](_0x352e99['accountcode'])['then'](function(_0x3f748){if(_0x3f748){_0x352e99[_0xde92('0xe')]=_0x3f748['id'];}utils[_0xde92('0xf')](_0xde92('0x10'),_0x352e99);});}else{utils['request']('CreateVoiceCallReport',_0x352e99);}if(channels[_0x352e99[_0xde92('0x7')]]){delete channels[_0x352e99[_0xde92('0x7')]];}}exports['newchannel']=function(_0x47ba87){try{utils[_0xde92('0x11')](util['format']('[%s][calls][newchannel]',_0x47ba87[_0xde92('0x7')]),_0x47ba87);if(_0x47ba87[_0xde92('0x7')]==_0x47ba87[_0xde92('0x12')]&&_0x47ba87[_0xde92('0x8')]!=_0xde92('0x13')){utils[_0xde92('0x6')](util[_0xde92('0x14')](_0xde92('0x15'),_0x47ba87[_0xde92('0x7')],_0x47ba87[_0xde92('0x16')],_0x47ba87[_0xde92('0x17')]));channels[_0x47ba87['uniqueid']]={'uniqueid':_0x47ba87['uniqueid'],'accountcode':_0x47ba87['accountcode'],'source':_0x47ba87[_0xde92('0xa')],'destination':_0x47ba87[_0xde92('0x17')],'destinationcontext':_0x47ba87[_0xde92('0x16')],'channel':_0x47ba87[_0xde92('0x8')],'starttime':utils[_0xde92('0x18')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xde92('0x3'),'amaflags':_0xde92('0x19')};}}catch(_0x40033d){utils[_0xde92('0x1a')](util[_0xde92('0x14')](_0xde92('0x1b'),_0x47ba87[_0xde92('0x7')]),_0x40033d);}};exports['newstate']=function(_0x16a52b){try{utils['debug'](util[_0xde92('0x14')](_0xde92('0x1c'),_0x16a52b['uniqueid']),_0x16a52b);if(!_[_0xde92('0x1d')](channels[_0x16a52b[_0xde92('0x7')]])&&_0x16a52b[_0xde92('0x1e')]==0x6){utils[_0xde92('0x6')](util[_0xde92('0x14')](_0xde92('0x1f'),_0x16a52b[_0xde92('0x7')],_0x16a52b['context'],_0x16a52b[_0xde92('0x8')]));if(_[_0xde92('0x1d')](channels[_0x16a52b[_0xde92('0x7')]][_0xde92('0x20')])){channels[_0x16a52b[_0xde92('0x7')]][_0xde92('0x20')]=utils[_0xde92('0x18')]();}}else if(!_[_0xde92('0x1d')](channels[_0x16a52b[_0xde92('0x12')]])&&_0x16a52b['channelstate']==0x6&&_0x16a52b[_0xde92('0x16')]!=_0xde92('0x21')){utils[_0xde92('0x6')](util[_0xde92('0x14')](_0xde92('0x22'),_0x16a52b[_0xde92('0x7')],_0x16a52b[_0xde92('0x12')],_0x16a52b[_0xde92('0x16')],_0x16a52b[_0xde92('0x8')]));channels[_0x16a52b[_0xde92('0x12')]]['accountcode']=_0x16a52b[_0xde92('0xc')];channels[_0x16a52b['linkedid']]['destinationchannel']=_0x16a52b['channel'];if(_['isNil'](channels[_0x16a52b[_0xde92('0x12')]][_0xde92('0x23')])){channels[_0x16a52b[_0xde92('0x12')]][_0xde92('0x23')]=utils[_0xde92('0x18')]();}channels[_0x16a52b[_0xde92('0x12')]][_0xde92('0x24')]=dispositions[_[_0xde92('0x25')](_0x16a52b[_0xde92('0x1e')])]||'ANSWERED';}}catch(_0x4a6264){utils[_0xde92('0x1a')](util[_0xde92('0x14')](_0xde92('0x1c'),_0x16a52b[_0xde92('0x7')]),_0x4a6264);}};exports[_0xde92('0x26')]=function(_0x147433){try{if(!_[_0xde92('0x1d')](channels[_0x147433[_0xde92('0x7')]])){utils['debug'](util[_0xde92('0x14')]('[%s][calls][hangup]',_0x147433['uniqueid']),_0x147433);if(_[_0xde92('0x1d')](channels[_0x147433['uniqueid']][_0xde92('0x27')])){channels[_0x147433[_0xde92('0x7')]]['callerid']=_0x147433['calleridname']+'\x20<'+_0x147433[_0xde92('0xa')]+'>';}utils[_0xde92('0x6')](util[_0xde92('0x14')](_0xde92('0x28'),_0x147433[_0xde92('0x7')],channels[_0x147433[_0xde92('0x7')]][_0xde92('0x27')],_0x147433['cause-txt']));channels[_0x147433[_0xde92('0x7')]][_0xde92('0x29')]=utils[_0xde92('0x18')]();channels[_0x147433[_0xde92('0x7')]]['duration']=utils[_0xde92('0x2a')](channels[_0x147433[_0xde92('0x7')]][_0xde92('0x29')],channels[_0x147433[_0xde92('0x7')]][_0xde92('0x2b')]);channels[_0x147433[_0xde92('0x7')]][_0xde92('0x2c')]=channels[_0x147433[_0xde92('0x7')]][_0xde92('0x23')]?utils['diffTime'](channels[_0x147433[_0xde92('0x7')]]['endtime'],channels[_0x147433['uniqueid']][_0xde92('0x23')]):0x0;writeDB(channels[_0x147433[_0xde92('0x7')]]);}}catch(_0x30f702){utils[_0xde92('0x1a')](util[_0xde92('0x14')](_0xde92('0x2d'),_0x147433['uniqueid']),_0x30f702);}};exports[_0xde92('0x2e')]=function(_0x28e6a0){try{if(!_[_0xde92('0x1d')](channels[_0x28e6a0['localtwolinkedid']])){utils[_0xde92('0x11')](util['format'](_0xde92('0x2f'),_0x28e6a0[_0xde92('0x30')]),_0x28e6a0);if(channels[_0x28e6a0[_0xde92('0x31')]][_0xde92('0x8')]==_0x28e6a0['transfereechannel']){utils['info'](util[_0xde92('0x14')](_0xde92('0x32'),_0x28e6a0[_0xde92('0x30')],_0x28e6a0[_0xde92('0x31')],_0x28e6a0[_0xde92('0x33')]));channels[_0x28e6a0[_0xde92('0x31')]][_0xde92('0x34')]=_0x28e6a0[_0xde92('0x33')];channels[_0x28e6a0[_0xde92('0x31')]][_0xde92('0x35')]=_0xde92('0x36');}else if(channels[_0x28e6a0[_0xde92('0x31')]][_0xde92('0x8')]=_0x28e6a0['transfertargetchannel']){utils[_0xde92('0x6')](util[_0xde92('0x14')](_0xde92('0x32'),_0x28e6a0[_0xde92('0x30')],_0x28e6a0['localtwolinkedid'],_0x28e6a0[_0xde92('0x37')]));channels[_0x28e6a0['localtwolinkedid']][_0xde92('0x34')]=_0x28e6a0['origtransfererchannel'];channels[_0x28e6a0[_0xde92('0x31')]][_0xde92('0x35')]=_0xde92('0x36');}}}catch(_0x1bbd15){utils['error'](util['format'](_0xde92('0x2f'),_0x28e6a0[_0xde92('0x30')]),_0x1bbd15);}};exports[_0xde92('0x38')]=function(_0x360a46){try{if(!_['isNil'](channels[_0x360a46[_0xde92('0x7')]])){utils[_0xde92('0x11')](util[_0xde92('0x14')](_0xde92('0x39'),_0x360a46[_0xde92('0x7')]),_0x360a46);channels[_0x360a46[_0xde92('0x7')]][_0xde92('0x3a')]=utils[_0xde92('0x18')]();utils[_0xde92('0x6')](util[_0xde92('0x14')](_0xde92('0x3b'),_0x360a46[_0xde92('0x7')],channels[_0x360a46[_0xde92('0x7')]]['musiconholdstartAt']));}}catch(_0x1a8bf5){utils[_0xde92('0x1a')](util[_0xde92('0x14')](_0xde92('0x39'),_0x360a46[_0xde92('0x7')]),_0x1a8bf5);}};exports['musiconholdstop']=function(_0x7985ce){try{if(!_[_0xde92('0x1d')](channels[_0x7985ce['uniqueid']])){utils[_0xde92('0x11')](util[_0xde92('0x14')](_0xde92('0x3c'),_0x7985ce['uniqueid']),_0x7985ce);if(!_[_0xde92('0x1d')](channels[_0x7985ce[_0xde92('0x7')]][_0xde92('0x3a')])){channels[_0x7985ce[_0xde92('0x7')]][_0xde92('0x3d')]+=utils['diffTime'](utils[_0xde92('0x18')](),channels[_0x7985ce[_0xde92('0x7')]][_0xde92('0x3a')]);utils[_0xde92('0x6')](util[_0xde92('0x14')](_0xde92('0x3e'),_0x7985ce[_0xde92('0x7')],channels[_0x7985ce[_0xde92('0x7')]][_0xde92('0x3d')]));delete channels[_0x7985ce[_0xde92('0x7')]]['musiconholdstartAt'];}}}catch(_0x4a7f27){utils['error'](util[_0xde92('0x14')](_0xde92('0x3c'),_0x7985ce[_0xde92('0x7')]),_0x4a7f27);}};exports[_0xde92('0x3f')]=function(_0x51bf60){try{if(!_[_0xde92('0x1d')](channels[_0x51bf60[_0xde92('0x7')]])){utils[_0xde92('0x11')](util[_0xde92('0x14')](_0xde92('0x40'),_0x51bf60['uniqueid']),_0x51bf60);if(!_['isNil'](_0x51bf60[_0xde92('0x41')]['xmd-originatecalleridnum'])){utils[_0xde92('0x6')](util[_0xde92('0x14')](_0xde92('0x42'),_0x51bf60['uniqueid'],_0x51bf60[_0xde92('0x43')]));channels[_0x51bf60['uniqueid']][_0xde92('0x44')]=_0x51bf60[_0xde92('0x43')];}if(!_[_0xde92('0x1d')](_0x51bf60[_0xde92('0x41')][_0xde92('0x45')])){utils[_0xde92('0x6')](util[_0xde92('0x14')](_0xde92('0x46'),_0x51bf60[_0xde92('0x7')],_0x51bf60['value']));channels[_0x51bf60['uniqueid']][_0xde92('0x47')]=_0x51bf60['value'];channels[_0x51bf60['uniqueid']][_0xde92('0x27')]='\x22'+_0x51bf60[_0xde92('0x43')]+_0xde92('0x48')+_0x51bf60[_0xde92('0x43')]+'>';}if(!_[_0xde92('0x1d')](_0x51bf60[_0xde92('0x41')][_0xde92('0x49')])||!_[_0xde92('0x1d')](_0x51bf60[_0xde92('0x41')]['xmd-callerid'])){utils[_0xde92('0x6')](util[_0xde92('0x14')](_0xde92('0x4a'),_0x51bf60[_0xde92('0x7')],!_[_0xde92('0x1d')](_0x51bf60[_0xde92('0x41')][_0xde92('0x49')])?'xmd-callerid-preview':_0xde92('0x4b'),_0x51bf60[_0xde92('0x43')]));channels[_0x51bf60[_0xde92('0x7')]]['callerid']=_0x51bf60[_0xde92('0x43')];}if(!_[_0xde92('0x1d')](_0x51bf60['variable'][_0xde92('0x4c')])||!_[_0xde92('0x1d')](_0x51bf60[_0xde92('0x41')][_0xde92('0x4d')])){utils[_0xde92('0x6')](util[_0xde92('0x14')](_0xde92('0x4a'),_0x51bf60['uniqueid'],!_[_0xde92('0x1d')](_0x51bf60[_0xde92('0x41')]['xmd-queue'])?_0xde92('0x4c'):_0xde92('0x4d'),_0x51bf60[_0xde92('0x43')]));channels[_0x51bf60['uniqueid']][_0xde92('0x4e')]=_0xde92('0x4f');channels[_0x51bf60[_0xde92('0x7')]][_0xde92('0x50')]=_0x51bf60[_0xde92('0x43')];channels[_0x51bf60[_0xde92('0x7')]][_0xde92('0x51')]=!![];}if(!_[_0xde92('0x1d')](_0x51bf60[_0xde92('0x41')][_0xde92('0x52')])){utils[_0xde92('0x6')](util[_0xde92('0x14')](_0xde92('0x53'),_0x51bf60[_0xde92('0x7')],_0x51bf60['value']));channels[_0x51bf60[_0xde92('0x7')]][_0xde92('0x54')]=_0x51bf60[_0xde92('0x43')];}if(!_[_0xde92('0x1d')](_0x51bf60[_0xde92('0x41')][_0xde92('0x55')])){utils[_0xde92('0x6')](util[_0xde92('0x14')](_0xde92('0x56'),_0x51bf60[_0xde92('0x7')],_0x51bf60['value']));channels[_0x51bf60[_0xde92('0x7')]][_0xde92('0x57')]=_0x51bf60[_0xde92('0x43')];}if(!_['isNil'](_0x51bf60[_0xde92('0x41')]['outboundrouteid'])){utils[_0xde92('0x6')](util[_0xde92('0x14')](_0xde92('0x58'),_0x51bf60[_0xde92('0x7')],_0x51bf60[_0xde92('0x43')]));channels[_0x51bf60[_0xde92('0x7')]][_0xde92('0x59')]=_0x51bf60[_0xde92('0x43')];}if(!_[_0xde92('0x1d')](_0x51bf60['variable'][_0xde92('0x5a')])){utils[_0xde92('0x6')](util[_0xde92('0x14')]('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0x51bf60[_0xde92('0x7')],_0x51bf60[_0xde92('0x43')]));channels[_0x51bf60['uniqueid']][_0xde92('0x5a')]=_0x51bf60['value'];}}}catch(_0x43aabe){utils[_0xde92('0x1a')](util['format'](_0xde92('0x40'),_0x51bf60[_0xde92('0x7')]),_0x43aabe);}};exports['newexten']=function(_0x4bbe65){try{if(!_[_0xde92('0x1d')](channels[_0x4bbe65['uniqueid']])){utils[_0xde92('0x11')](util[_0xde92('0x14')](_0xde92('0x5b'),_0x4bbe65[_0xde92('0x7')]),_0x4bbe65);utils[_0xde92('0x6')](util[_0xde92('0x14')](_0xde92('0x5c'),_0x4bbe65[_0xde92('0x7')],_0x4bbe65[_0xde92('0x5d')],_0x4bbe65[_0xde92('0x5e')]));if(_0x4bbe65[_0xde92('0x5d')][_0xde92('0x5f')]()==_0xde92('0x60')&&_['startsWith'](_0x4bbe65['appdata'][_0xde92('0x5f')](),_0xde92('0x61'))){var _0x3db0c3=_0x4bbe65[_0xde92('0x5e')][_0xde92('0x62')]('=');var _0x475918=_0x3db0c3[0x0][_0xde92('0x63')](_0x3db0c3[0x0][_0xde92('0x64')]('(')+0x1,_0x3db0c3[0x0][_0xde92('0x64')](')'));var _0x45b5bf=_0x3db0c3[0x1];channels[_0x4bbe65[_0xde92('0x7')]][_0x475918]=_0x45b5bf;}if(!_[_0xde92('0x65')]([_0xde92('0x26'),_0xde92('0x66'),'execif',_0xde92('0x60'),_0xde92('0x67')],_0x4bbe65['application'][_0xde92('0x5f')]())){channels[_0x4bbe65[_0xde92('0x7')]][_0xde92('0x4e')]=_0x4bbe65[_0xde92('0x5d')];channels[_0x4bbe65['uniqueid']][_0xde92('0x50')]=_0x4bbe65['appdata'];}}}catch(_0xc0b26c){utils[_0xde92('0x1a')](util[_0xde92('0x14')](_0xde92('0x5b'),_0x4bbe65[_0xde92('0x7')]),_0xc0b26c);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index cf40108..3428737 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 _0x2d12=['[core]\x20shutdown','fullybooted','./utils','connect','[core]\x20connected','shutdown','info'];(function(_0x15d18f,_0x126b0e){var _0xd12bf7=function(_0x19e661){while(--_0x19e661){_0x15d18f['push'](_0x15d18f['shift']());}};_0xd12bf7(++_0x126b0e);}(_0x2d12,0x10c));var _0x22d1=function(_0x15d227,_0x457270){_0x15d227=_0x15d227-0x0;var _0x5f003e=_0x2d12[_0x15d227];return _0x5f003e;};'use strict';var utils=require(_0x22d1('0x0'));exports[_0x22d1('0x1')]=function(){utils['info'](_0x22d1('0x2'));};exports[_0x22d1('0x3')]=function(){utils[_0x22d1('0x4')](_0x22d1('0x5'));};exports[_0x22d1('0x6')]=function(){utils['info']('[core]\x20fullybooted');};exports['error']=function(_0x15a5b8){utils['error']('[core]\x20error',_0x15a5b8);};exports['close']=function(){utils[_0x22d1('0x4')]('[core]\x20close');};exports['managerevent']=function(_0x6737db){}; \ No newline at end of file +var _0x9cde=['[core]\x20fullybooted','error','[core]\x20error','[core]\x20close','managerevent','./utils','connect','info','[core]\x20connected','shutdown','[core]\x20shutdown'];(function(_0x4d8fe1,_0x3ed474){var _0x46685e=function(_0x268c73){while(--_0x268c73){_0x4d8fe1['push'](_0x4d8fe1['shift']());}};_0x46685e(++_0x3ed474);}(_0x9cde,0x165));var _0xe9cd=function(_0x32f38b,_0x1b4fc7){_0x32f38b=_0x32f38b-0x0;var _0x15ec9b=_0x9cde[_0x32f38b];return _0x15ec9b;};'use strict';var utils=require(_0xe9cd('0x0'));exports[_0xe9cd('0x1')]=function(){utils[_0xe9cd('0x2')](_0xe9cd('0x3'));};exports[_0xe9cd('0x4')]=function(){utils[_0xe9cd('0x2')](_0xe9cd('0x5'));};exports['fullybooted']=function(){utils[_0xe9cd('0x2')](_0xe9cd('0x6'));};exports[_0xe9cd('0x7')]=function(_0x1e4621){utils['error'](_0xe9cd('0x8'),_0x1e4621);};exports['close']=function(){utils[_0xe9cd('0x2')](_0xe9cd('0x9'));};exports[_0xe9cd('0xa')]=function(_0x5661f6){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 83525f6..8e66809 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 _0xd73a=['[%s][dials][dialend]','ANSWER','assign','answertime','now','lastevent','connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete','duration','diffTime','endtime','holdtime','billableseconds','lodash','util','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','newexten','debug','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','set','startsWith','toLowerCase','split','varset','[%s][dials][varset]','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','error','dialbegin','[%s][dials][dialbegin]','starttime','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called'];(function(_0x5d32a2,_0x4d06d3){var _0x24f65f=function(_0x137757){while(--_0x137757){_0x5d32a2['push'](_0x5d32a2['shift']());}};_0x24f65f(++_0x4d06d3);}(_0xd73a,0xe7));var _0xad73=function(_0x43c335,_0x378dea){_0x43c335=_0x43c335-0x0;var _0x1c24b2=_0xd73a[_0x43c335];return _0x1c24b2;};'use strict';var _=require(_0xad73('0x0'));var util=require(_0xad73('0x1'));var utils=require(_0xad73('0x2'));var dials={};function writeDB(_0x9c6a76){utils[_0xad73('0x3')](util[_0xad73('0x4')](_0xad73('0x5'),_0x9c6a76[_0xad73('0x6')],_0x9c6a76['channel'],_0x9c6a76['dialstring'],_0x9c6a76[_0xad73('0x7')],_0x9c6a76[_0xad73('0x8')],_0x9c6a76[_0xad73('0x9')]));utils[_0xad73('0xa')](_0xad73('0xb'),_0x9c6a76);delete dials[_0x9c6a76['uniqueid']];}exports[_0xad73('0xc')]=function(_0x260f5e){try{utils[_0xad73('0xd')](util[_0xad73('0x4')]('[%s][dials][newexten]',_0x260f5e[_0xad73('0x6')]),_0x260f5e);utils['info'](util[_0xad73('0x4')](_0xad73('0xe'),_0x260f5e[_0xad73('0x6')],_0x260f5e[_0xad73('0xf')],_0x260f5e[_0xad73('0x10')]));if(_0x260f5e['application']['toLowerCase']()==_0xad73('0x11')&&_[_0xad73('0x12')](_0x260f5e[_0xad73('0x10')][_0xad73('0x13')](),'cdr(routeid)')){var _0x254964=_0x260f5e['appdata'][_0xad73('0x14')]('=');dials[_0x260f5e[_0xad73('0x6')]]={'routeId':_0x254964[0x1]};}}catch(_0x12d17d){utils['error'](util['format']('[%s][dials][newexten]',_0x260f5e[_0xad73('0x6')]),_0x12d17d);}};exports[_0xad73('0x15')]=function(_0x4e40fe){try{utils[_0xad73('0xd')](util[_0xad73('0x4')](_0xad73('0x16'),_0x4e40fe[_0xad73('0x6')]),_0x4e40fe);if(!_[_0xad73('0x17')](_0x4e40fe[_0xad73('0x18')][_0xad73('0x19')])){utils['info'](util[_0xad73('0x4')](_0xad73('0x1a'),_0x4e40fe[_0xad73('0x6')],_0x4e40fe[_0xad73('0x1b')]));dials[_0x4e40fe['uniqueid']]={'routeId':_0x4e40fe[_0xad73('0x1b')]};}}catch(_0xa5f80){utils[_0xad73('0x1c')](util[_0xad73('0x4')](_0xad73('0x16'),_0x4e40fe['uniqueid']),_0xa5f80);}};exports[_0xad73('0x1d')]=function(_0x2f2883){try{if(!_[_0xad73('0x17')](dials[_0x2f2883['uniqueid']])){utils[_0xad73('0xd')](util['format'](_0xad73('0x1e'),_0x2f2883[_0xad73('0x6')]),_0x2f2883);dials[_0x2f2883[_0xad73('0x6')]]=_['assign'](dials[_0x2f2883[_0xad73('0x6')]],_0x2f2883);dials[_0x2f2883['uniqueid']][_0xad73('0x1f')]=utils['now']();dials[_0x2f2883[_0xad73('0x6')]]['lastevent']=_0xad73('0x20');utils['info'](util[_0xad73('0x4')](_0xad73('0x21'),_0x2f2883[_0xad73('0x6')],dials[_0x2f2883['uniqueid']][_0xad73('0x1f')]));}}catch(_0x1dd6bf){utils[_0xad73('0x1c')](util[_0xad73('0x4')](_0xad73('0x1e'),_0x2f2883['uniqueid']),_0x1dd6bf);}};exports['dialend']=function(_0x1a5ba6){try{if(!_[_0xad73('0x17')](dials[_0x1a5ba6[_0xad73('0x6')]])){utils[_0xad73('0xd')](util['format'](_0xad73('0x22'),_0x1a5ba6[_0xad73('0x6')]),_0x1a5ba6);dials[_0x1a5ba6[_0xad73('0x6')]][_0xad73('0x9')]=_0x1a5ba6['dialstatus'];if(_0x1a5ba6[_0xad73('0x9')]==_0xad73('0x23')){dials[_0x1a5ba6[_0xad73('0x6')]]=_[_0xad73('0x24')](dials[_0x1a5ba6[_0xad73('0x6')]],_0x1a5ba6);dials[_0x1a5ba6['uniqueid']][_0xad73('0x25')]=utils[_0xad73('0x26')]();dials[_0x1a5ba6[_0xad73('0x6')]][_0xad73('0x27')]=_0xad73('0x28');utils[_0xad73('0x3')](util['format']('[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect',_0x1a5ba6[_0xad73('0x6')],_0x1a5ba6[_0xad73('0x9')],dials[_0x1a5ba6[_0xad73('0x6')]][_0xad73('0x25')]));}else{utils[_0xad73('0x3')](util[_0xad73('0x4')](_0xad73('0x29'),_0x1a5ba6[_0xad73('0x6')],_0x1a5ba6[_0xad73('0x9')]));}}}catch(_0x18f89c){utils[_0xad73('0x1c')](util[_0xad73('0x4')]('[%s][dials][dialend]',_0x1a5ba6['uniqueid']),_0x18f89c);}};exports[_0xad73('0x2a')]=function(_0x4b4b36){try{if(!_['isNil'](dials[_0x4b4b36[_0xad73('0x6')]])){utils['debug'](util[_0xad73('0x4')](_0xad73('0x2b'),_0x4b4b36[_0xad73('0x6')]),_0x4b4b36);utils[_0xad73('0x3')](util[_0xad73('0x4')](_0xad73('0x2c'),_0x4b4b36[_0xad73('0x6')],_0x4b4b36[_0xad73('0x7')],_0x4b4b36[_0xad73('0x2d')],_0x4b4b36[_0xad73('0x2e')]));dials[_0x4b4b36['uniqueid']]=_[_0xad73('0x24')](dials[_0x4b4b36[_0xad73('0x6')]],{'endtime':utils[_0xad73('0x26')](),'lastevent':_0xad73('0x2f')});dials[_0x4b4b36['uniqueid']][_0xad73('0x30')]=utils[_0xad73('0x31')](dials[_0x4b4b36['uniqueid']][_0xad73('0x32')],dials[_0x4b4b36[_0xad73('0x6')]][_0xad73('0x1f')]);dials[_0x4b4b36[_0xad73('0x6')]][_0xad73('0x33')]=utils['diffTime'](dials[_0x4b4b36[_0xad73('0x6')]][_0xad73('0x25')]||dials[_0x4b4b36[_0xad73('0x6')]][_0xad73('0x32')],dials[_0x4b4b36[_0xad73('0x6')]][_0xad73('0x1f')]);dials[_0x4b4b36[_0xad73('0x6')]][_0xad73('0x34')]=dials[_0x4b4b36[_0xad73('0x6')]][_0xad73('0x25')]?utils[_0xad73('0x31')](dials[_0x4b4b36[_0xad73('0x6')]]['endtime'],dials[_0x4b4b36['uniqueid']][_0xad73('0x25')]):0x0;writeDB(dials[_0x4b4b36[_0xad73('0x6')]]);}}catch(_0x165d47){utils[_0xad73('0x1c')](util[_0xad73('0x4')](_0xad73('0x2b'),_0x4b4b36[_0xad73('0x6')]),_0x165d47);}}; \ No newline at end of file +var _0xbdc8=['application','appdata','set','toLowerCase','cdr(routeid)','error','[%s][dials][newexten]','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','[%s][dials][dialbegin]','assign','starttime','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','[%s][dials][dialend]','dialstatus','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','hangup','[%s][dials][hangup]','calleridname','cause-txt','complete','diffTime','endtime','billableseconds','util','./utils','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','calleridnum','connectedlinenum','CreateVoiceDialReport','newexten','debug','info','[%s][dials][newexten]\x20application:%s\x20appdata:%s'];(function(_0x35c8bd,_0x5c930d){var _0x231cc4=function(_0x138a96){while(--_0x138a96){_0x35c8bd['push'](_0x35c8bd['shift']());}};_0x231cc4(++_0x5c930d);}(_0xbdc8,0x1c9));var _0x8bdc=function(_0x4c5ae2,_0x4efdad){_0x4c5ae2=_0x4c5ae2-0x0;var _0x4f6004=_0xbdc8[_0x4c5ae2];return _0x4f6004;};'use strict';var _=require('lodash');var util=require(_0x8bdc('0x0'));var utils=require(_0x8bdc('0x1'));var dials={};function writeDB(_0x536694){utils['info'](util[_0x8bdc('0x2')](_0x8bdc('0x3'),_0x536694[_0x8bdc('0x4')],_0x536694[_0x8bdc('0x5')],_0x536694['dialstring'],_0x536694[_0x8bdc('0x6')],_0x536694[_0x8bdc('0x7')],_0x536694['dialstatus']));utils['request'](_0x8bdc('0x8'),_0x536694);delete dials[_0x536694[_0x8bdc('0x4')]];}exports[_0x8bdc('0x9')]=function(_0x43226f){try{utils[_0x8bdc('0xa')](util[_0x8bdc('0x2')]('[%s][dials][newexten]',_0x43226f[_0x8bdc('0x4')]),_0x43226f);utils[_0x8bdc('0xb')](util['format'](_0x8bdc('0xc'),_0x43226f[_0x8bdc('0x4')],_0x43226f[_0x8bdc('0xd')],_0x43226f[_0x8bdc('0xe')]));if(_0x43226f[_0x8bdc('0xd')]['toLowerCase']()==_0x8bdc('0xf')&&_['startsWith'](_0x43226f[_0x8bdc('0xe')][_0x8bdc('0x10')](),_0x8bdc('0x11'))){var _0x33d77f=_0x43226f[_0x8bdc('0xe')]['split']('=');dials[_0x43226f[_0x8bdc('0x4')]]={'routeId':_0x33d77f[0x1]};}}catch(_0x3c4b0e){utils[_0x8bdc('0x12')](util['format'](_0x8bdc('0x13'),_0x43226f[_0x8bdc('0x4')]),_0x3c4b0e);}};exports['varset']=function(_0x3513dc){try{utils[_0x8bdc('0xa')](util[_0x8bdc('0x2')]('[%s][dials][varset]',_0x3513dc[_0x8bdc('0x4')]),_0x3513dc);if(!_[_0x8bdc('0x14')](_0x3513dc[_0x8bdc('0x15')][_0x8bdc('0x16')])){utils[_0x8bdc('0xb')](util[_0x8bdc('0x2')](_0x8bdc('0x17'),_0x3513dc[_0x8bdc('0x4')],_0x3513dc[_0x8bdc('0x18')]));dials[_0x3513dc[_0x8bdc('0x4')]]={'routeId':_0x3513dc[_0x8bdc('0x18')]};}}catch(_0x46a966){utils[_0x8bdc('0x12')](util[_0x8bdc('0x2')]('[%s][dials][varset]',_0x3513dc[_0x8bdc('0x4')]),_0x46a966);}};exports[_0x8bdc('0x19')]=function(_0x20f716){try{if(!_[_0x8bdc('0x14')](dials[_0x20f716[_0x8bdc('0x4')]])){utils[_0x8bdc('0xa')](util[_0x8bdc('0x2')](_0x8bdc('0x1a'),_0x20f716['uniqueid']),_0x20f716);dials[_0x20f716[_0x8bdc('0x4')]]=_[_0x8bdc('0x1b')](dials[_0x20f716[_0x8bdc('0x4')]],_0x20f716);dials[_0x20f716[_0x8bdc('0x4')]][_0x8bdc('0x1c')]=utils[_0x8bdc('0x1d')]();dials[_0x20f716[_0x8bdc('0x4')]][_0x8bdc('0x1e')]=_0x8bdc('0x1f');utils[_0x8bdc('0xb')](util[_0x8bdc('0x2')](_0x8bdc('0x20'),_0x20f716[_0x8bdc('0x4')],dials[_0x20f716[_0x8bdc('0x4')]][_0x8bdc('0x1c')]));}}catch(_0xaaef1){utils[_0x8bdc('0x12')](util[_0x8bdc('0x2')]('[%s][dials][dialbegin]',_0x20f716[_0x8bdc('0x4')]),_0xaaef1);}};exports[_0x8bdc('0x21')]=function(_0x53ff75){try{if(!_[_0x8bdc('0x14')](dials[_0x53ff75[_0x8bdc('0x4')]])){utils['debug'](util[_0x8bdc('0x2')](_0x8bdc('0x22'),_0x53ff75['uniqueid']),_0x53ff75);dials[_0x53ff75[_0x8bdc('0x4')]][_0x8bdc('0x23')]=_0x53ff75[_0x8bdc('0x23')];if(_0x53ff75[_0x8bdc('0x23')]=='ANSWER'){dials[_0x53ff75[_0x8bdc('0x4')]]=_[_0x8bdc('0x1b')](dials[_0x53ff75['uniqueid']],_0x53ff75);dials[_0x53ff75[_0x8bdc('0x4')]][_0x8bdc('0x24')]=utils[_0x8bdc('0x1d')]();dials[_0x53ff75[_0x8bdc('0x4')]]['lastevent']=_0x8bdc('0x25');utils[_0x8bdc('0xb')](util[_0x8bdc('0x2')](_0x8bdc('0x26'),_0x53ff75[_0x8bdc('0x4')],_0x53ff75[_0x8bdc('0x23')],dials[_0x53ff75[_0x8bdc('0x4')]][_0x8bdc('0x24')]));}else{utils[_0x8bdc('0xb')](util['format']('[%s][dials][dialend]\x20dialstatus:%s',_0x53ff75[_0x8bdc('0x4')],_0x53ff75[_0x8bdc('0x23')]));}}}catch(_0x539786){utils[_0x8bdc('0x12')](util[_0x8bdc('0x2')](_0x8bdc('0x22'),_0x53ff75[_0x8bdc('0x4')]),_0x539786);}};exports[_0x8bdc('0x27')]=function(_0x51d509){try{if(!_[_0x8bdc('0x14')](dials[_0x51d509[_0x8bdc('0x4')]])){utils[_0x8bdc('0xa')](util[_0x8bdc('0x2')](_0x8bdc('0x28'),_0x51d509['uniqueid']),_0x51d509);utils[_0x8bdc('0xb')](util[_0x8bdc('0x2')]('[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s',_0x51d509[_0x8bdc('0x4')],_0x51d509['calleridnum'],_0x51d509[_0x8bdc('0x29')],_0x51d509[_0x8bdc('0x2a')]));dials[_0x51d509[_0x8bdc('0x4')]]=_[_0x8bdc('0x1b')](dials[_0x51d509[_0x8bdc('0x4')]],{'endtime':utils['now'](),'lastevent':_0x8bdc('0x2b')});dials[_0x51d509[_0x8bdc('0x4')]]['duration']=utils[_0x8bdc('0x2c')](dials[_0x51d509[_0x8bdc('0x4')]][_0x8bdc('0x2d')],dials[_0x51d509['uniqueid']]['starttime']);dials[_0x51d509[_0x8bdc('0x4')]]['holdtime']=utils[_0x8bdc('0x2c')](dials[_0x51d509[_0x8bdc('0x4')]][_0x8bdc('0x24')]||dials[_0x51d509[_0x8bdc('0x4')]]['endtime'],dials[_0x51d509[_0x8bdc('0x4')]][_0x8bdc('0x1c')]);dials[_0x51d509[_0x8bdc('0x4')]][_0x8bdc('0x2e')]=dials[_0x51d509[_0x8bdc('0x4')]][_0x8bdc('0x24')]?utils[_0x8bdc('0x2c')](dials[_0x51d509[_0x8bdc('0x4')]][_0x8bdc('0x2d')],dials[_0x51d509['uniqueid']][_0x8bdc('0x24')]):0x0;writeDB(dials[_0x51d509[_0x8bdc('0x4')]]);}}catch(_0x37b985){utils[_0x8bdc('0x12')](util[_0x8bdc('0x2')](_0x8bdc('0x28'),_0x51d509[_0x8bdc('0x4')]),_0x37b985);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 610de5c..7a75056 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 _0x06e3=['agentconnect','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','[%s][index][blindtransfer]','blindtransfer','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','[%s][index][newexten]','newexten','[%s][index][newchannel]','newchannel','dialbegin','[%s][index][dialend]','dialend','../../config/environment','./utils','util','xdr','disabled','local','port','asterisk','keepConnected','info','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./calls.controller','./recordings.controller','./members.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','debug','format','[%s][index][devicestatechange]','device','devicestatechange','agentcalled','uniqueid','[%s][index][agentcalled]','[%s][index][agentringnoanswer]','[%s][index][agentconnect]'];(function(_0x5ac1e5,_0x4b5012){var _0x1bccc6=function(_0x102562){while(--_0x102562){_0x5ac1e5['push'](_0x5ac1e5['shift']());}};_0x1bccc6(++_0x4b5012);}(_0x06e3,0x1b3));var _0x306e=function(_0x2b0ab9,_0x31dd5d){_0x2b0ab9=_0x2b0ab9-0x0;var _0x1e0926=_0x06e3[_0x2b0ab9];return _0x1e0926;};var AsteriskManager=require('asterisk-manager');var config=require(_0x306e('0x0'));var utils=require(_0x306e('0x1'));var util=require(_0x306e('0x2'));var isXDREnabled=config[_0x306e('0x3')]&&config[_0x306e('0x3')][_0x306e('0x4')]?!config[_0x306e('0x3')][_0x306e('0x4')]:!![];var isProduction=config['env']==='production'||![];var isLocalAsterisk=config[_0x306e('0x3')]&&config[_0x306e('0x3')][_0x306e('0x5')]===!![]||![];var ami=new AsteriskManager(config['asterisk'][_0x306e('0x6')],config[_0x306e('0x7')]['ip'],config[_0x306e('0x7')]['username'],config[_0x306e('0x7')]['password'],!![]);ami[_0x306e('0x8')]();if(!isXDREnabled){utils[_0x306e('0x9')](_0x306e('0xa'));}else if(!isProduction&&!isLocalAsterisk){utils[_0x306e('0x9')](_0x306e('0xb'));}else{var agents=require(_0x306e('0xc'));var calls=require(_0x306e('0xd'));var queues=require('./queues.controller');var recordings=require(_0x306e('0xe'));var members=require(_0x306e('0xf'));var dials=require('./dials.controller');var transfers=require(_0x306e('0x10'));var core=require(_0x306e('0x11'));ami['on'](_0x306e('0x12'),core[_0x306e('0x12')]);ami['on'](_0x306e('0x13'),core[_0x306e('0x13')]);ami['on']('fullybooted',core[_0x306e('0x14')]);ami['on']('error',core[_0x306e('0x15')]);ami['on'](_0x306e('0x16'),core[_0x306e('0x16')]);ami['on'](_0x306e('0x17'),core['managerevent']);ami['on']('devicestatechange',function(_0x31a2eb){try{utils[_0x306e('0x18')](util[_0x306e('0x19')](_0x306e('0x1a'),_0x31a2eb[_0x306e('0x1b')]),_0x31a2eb);members[_0x306e('0x1c')](_0x31a2eb);}catch(_0xc013a2){utils[_0x306e('0x15')](util['format'](_0x306e('0x1a'),_0x31a2eb[_0x306e('0x1b')]),_0xc013a2);}});ami['on'](_0x306e('0x1d'),function(_0x3398ea){try{utils[_0x306e('0x18')](util[_0x306e('0x19')]('[%s][index][agentcalled]',_0x3398ea[_0x306e('0x1e')]),_0x3398ea);agents[_0x306e('0x1d')](_0x3398ea);}catch(_0x3ec80e){utils[_0x306e('0x15')](util[_0x306e('0x19')](_0x306e('0x1f'),_0x3398ea['uniqueid']),_0x3ec80e);}});ami['on']('agentringnoanswer',function(_0x1e7507){try{utils['debug'](util[_0x306e('0x19')]('[%s][index][agentringnoanswer]',_0x1e7507[_0x306e('0x1e')]),_0x1e7507);agents['agentringnoanswer'](_0x1e7507);}catch(_0x22b264){utils['error'](util[_0x306e('0x19')](_0x306e('0x20'),_0x1e7507[_0x306e('0x1e')]),_0x22b264);}});ami['on']('agentconnect',function(_0x562eb4){try{utils[_0x306e('0x18')](util['format'](_0x306e('0x21'),_0x562eb4[_0x306e('0x1e')]),_0x562eb4);agents['agentconnect'](_0x562eb4);queues[_0x306e('0x22')](_0x562eb4);}catch(_0x25bf1e){utils[_0x306e('0x15')](util[_0x306e('0x19')](_0x306e('0x21'),_0x562eb4[_0x306e('0x1e')]),_0x25bf1e);}});ami['on'](_0x306e('0x23'),function(_0xe62617){try{utils[_0x306e('0x18')](util[_0x306e('0x19')]('[%s][index][agentcomplete]',_0xe62617[_0x306e('0x1e')]),_0xe62617);agents[_0x306e('0x23')](_0xe62617);queues[_0x306e('0x23')](_0xe62617);members[_0x306e('0x23')](_0xe62617);}catch(_0x4fa86b){utils[_0x306e('0x15')](util[_0x306e('0x19')](_0x306e('0x24'),_0xe62617['uniqueid']),_0x4fa86b);}});ami['on'](_0x306e('0x25'),function(_0x421367){try{utils[_0x306e('0x18')](util[_0x306e('0x19')](_0x306e('0x26'),_0x421367[_0x306e('0x1e')]),_0x421367);agents[_0x306e('0x25')](_0x421367);queues[_0x306e('0x25')](_0x421367);}catch(_0x20f112){utils['error'](util['format']('[%s][index][queuecallerabandon]',_0x421367[_0x306e('0x1e')]),_0x20f112);}});ami['on'](_0x306e('0x27'),function(_0x58bf80){try{utils[_0x306e('0x18')](util[_0x306e('0x19')](_0x306e('0x28'),_0x58bf80[_0x306e('0x1e')]),_0x58bf80);queues[_0x306e('0x27')](_0x58bf80);recordings[_0x306e('0x27')](_0x58bf80);}catch(_0x3037dc){utils[_0x306e('0x15')](util[_0x306e('0x19')](_0x306e('0x28'),_0x58bf80['uniqueid']),_0x3037dc);}});ami['on'](_0x306e('0x29'),function(_0x1ef9e5){try{utils[_0x306e('0x18')](util[_0x306e('0x19')](_0x306e('0x2a'),_0x1ef9e5[_0x306e('0x1e')]),_0x1ef9e5);queues[_0x306e('0x29')](_0x1ef9e5);}catch(_0xb65001){utils[_0x306e('0x15')](util[_0x306e('0x19')](_0x306e('0x2a'),_0x1ef9e5[_0x306e('0x1e')]),_0xb65001);}});ami['on'](_0x306e('0x2b'),function(_0x18c707){try{utils[_0x306e('0x18')](util['format'](_0x306e('0x2c'),_0x18c707[_0x306e('0x1e')]),_0x18c707);queues[_0x306e('0x2b')](_0x18c707);calls['musiconholdstart'](_0x18c707);}catch(_0x1c58db){utils[_0x306e('0x15')](util['format'](_0x306e('0x2c'),_0x18c707['uniqueid']),_0x1c58db);}});ami['on']('musiconholdstop',function(_0x33ca38){try{utils[_0x306e('0x18')](util['format']('[%s][index][musiconholdstop]',_0x33ca38['uniqueid']),_0x33ca38);queues['musiconholdstop'](_0x33ca38);calls[_0x306e('0x2d')](_0x33ca38);}catch(_0x5cabe2){utils['error'](util['format'](_0x306e('0x2e'),_0x33ca38[_0x306e('0x1e')]),_0x5cabe2);}});ami['on'](_0x306e('0x2f'),function(_0x2ac99c){try{utils['debug'](util[_0x306e('0x19')](_0x306e('0x30'),_0x2ac99c[_0x306e('0x1e')]),_0x2ac99c);calls[_0x306e('0x2f')](_0x2ac99c);recordings['newstate'](_0x2ac99c);}catch(_0x19992f){utils[_0x306e('0x15')](util['format'](_0x306e('0x30'),_0x2ac99c['uniqueid']),_0x19992f);}});ami['on'](_0x306e('0x31'),function(_0x2aec3c){try{utils['debug'](util['format'](_0x306e('0x32'),_0x2aec3c[_0x306e('0x1e')]),_0x2aec3c);calls[_0x306e('0x31')](_0x2aec3c);recordings[_0x306e('0x31')](_0x2aec3c);dials[_0x306e('0x31')](_0x2aec3c);agents[_0x306e('0x31')](_0x2aec3c);queues[_0x306e('0x31')](_0x2aec3c);}catch(_0x2b116b){utils[_0x306e('0x15')](util['format'](_0x306e('0x32'),_0x2aec3c['uniqueid']),_0x2b116b);}});ami['on'](_0x306e('0x33'),function(_0x3066ae){try{utils[_0x306e('0x18')](util[_0x306e('0x19')](_0x306e('0x34'),_0x3066ae[_0x306e('0x1e')]),_0x3066ae);members['cdr'](_0x3066ae);}catch(_0x580dcf){utils[_0x306e('0x15')](util[_0x306e('0x19')]('[%s][index][cdr]',_0x3066ae[_0x306e('0x1e')]),_0x580dcf);}});ami['on']('blindtransfer',function(_0x5243b7){try{utils[_0x306e('0x18')](util[_0x306e('0x19')](_0x306e('0x35'),_0x5243b7[_0x306e('0x1e')]),_0x5243b7);queues[_0x306e('0x36')](_0x5243b7);agents[_0x306e('0x36')](_0x5243b7);transfers[_0x306e('0x36')](_0x5243b7);}catch(_0x18a4d0){utils[_0x306e('0x15')](util[_0x306e('0x19')](_0x306e('0x35'),_0x5243b7[_0x306e('0x1e')]),_0x18a4d0);}});ami['on'](_0x306e('0x37'),function(_0x738fba){try{utils[_0x306e('0x18')](util[_0x306e('0x19')]('[%s][index][attendedtransfer]',_0x738fba['origtransfereruniqueid']),_0x738fba);queues['attendedtransfer'](_0x738fba);transfers['attendedtransfer'](_0x738fba);agents[_0x306e('0x37')](_0x738fba);calls['attendedtransfer'](_0x738fba);}catch(_0x1077d1){utils[_0x306e('0x15')](util[_0x306e('0x19')](_0x306e('0x38'),_0x738fba[_0x306e('0x39')]),_0x1077d1);}});ami['on'](_0x306e('0x3a'),function(_0xd0a869){try{utils[_0x306e('0x18')](util[_0x306e('0x19')](_0x306e('0x3b'),_0xd0a869[_0x306e('0x1e')]),_0xd0a869);queues[_0x306e('0x3a')](_0xd0a869);recordings[_0x306e('0x3a')](_0xd0a869);calls[_0x306e('0x3a')](_0xd0a869);dials['varset'](_0xd0a869);}catch(_0x1ca959){utils[_0x306e('0x15')](util[_0x306e('0x19')]('[%s][index][varset]',_0xd0a869[_0x306e('0x1e')]),_0x1ca959);}});ami['on']('newexten',function(_0x3b1347){try{utils[_0x306e('0x18')](util[_0x306e('0x19')](_0x306e('0x3c'),_0x3b1347[_0x306e('0x1e')]),_0x3b1347);calls[_0x306e('0x3d')](_0x3b1347);recordings[_0x306e('0x3d')](_0x3b1347);dials[_0x306e('0x3d')](_0x3b1347);}catch(_0x267a9e){utils[_0x306e('0x15')](util['format']('[%s][index][newexten]',_0x3b1347[_0x306e('0x1e')]),_0x267a9e);}});ami['on']('newchannel',function(_0x3984a1){try{utils[_0x306e('0x18')](util[_0x306e('0x19')](_0x306e('0x3e'),_0x3984a1[_0x306e('0x1e')]),_0x3984a1);calls[_0x306e('0x3f')](_0x3984a1);recordings[_0x306e('0x3f')](_0x3984a1);}catch(_0x4a9254){utils[_0x306e('0x15')](util[_0x306e('0x19')](_0x306e('0x3e'),_0x3984a1[_0x306e('0x1e')]),_0x4a9254);}});ami['on'](_0x306e('0x40'),function(_0x555f4c){try{utils['debug'](util[_0x306e('0x19')]('[%s][index][dialbegin]',_0x555f4c[_0x306e('0x1e')]),_0x555f4c);dials[_0x306e('0x40')](_0x555f4c);}catch(_0x5c5005){utils[_0x306e('0x15')](util[_0x306e('0x19')]('[%s]dialbegin',_0x555f4c[_0x306e('0x1e')]),_0x5c5005);}});ami['on']('dialend',function(_0x1d95f7){try{utils[_0x306e('0x18')](util[_0x306e('0x19')](_0x306e('0x41'),_0x1d95f7['uniqueid']),_0x1d95f7);dials[_0x306e('0x42')](_0x1d95f7);}catch(_0x33e6cf){utils['error'](util[_0x306e('0x19')]('[%s][index][dialend]',_0x1d95f7[_0x306e('0x1e')]),_0x33e6cf);}});} \ No newline at end of file +var _0x625d=['newstate','[%s][index][newstate]','hangup','[%s][index][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][index][dialbegin]','dialend','asterisk-manager','../../config/environment','xdr','disabled','env','production','local','asterisk','port','username','password','keepConnected','XDR\x20DISABLED','info','./agents.controller','./queues.controller','./recordings.controller','./members.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','format','[%s][index][devicestatechange]','device','agentcalled','[%s][index][agentcalled]','agentringnoanswer','debug','[%s][index][agentringnoanswer]','uniqueid','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','[%s][index][queuecallerleave]','queuecallerleave','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]'];(function(_0x34b245,_0xfe65b4){var _0x3a8984=function(_0x12c6a8){while(--_0x12c6a8){_0x34b245['push'](_0x34b245['shift']());}};_0x3a8984(++_0xfe65b4);}(_0x625d,0xe6));var _0xd625=function(_0x27d675,_0x4f1135){_0x27d675=_0x27d675-0x0;var _0x35b1d5=_0x625d[_0x27d675];return _0x35b1d5;};var AsteriskManager=require(_0xd625('0x0'));var config=require(_0xd625('0x1'));var utils=require('./utils');var util=require('util');var isXDREnabled=config['xdr']&&config[_0xd625('0x2')]['disabled']?!config[_0xd625('0x2')][_0xd625('0x3')]:!![];var isProduction=config[_0xd625('0x4')]===_0xd625('0x5')||![];var isLocalAsterisk=config[_0xd625('0x2')]&&config['xdr'][_0xd625('0x6')]===!![]||![];var ami=new AsteriskManager(config[_0xd625('0x7')][_0xd625('0x8')],config[_0xd625('0x7')]['ip'],config['asterisk'][_0xd625('0x9')],config[_0xd625('0x7')][_0xd625('0xa')],!![]);ami[_0xd625('0xb')]();if(!isXDREnabled){utils['info'](_0xd625('0xc'));}else if(!isProduction&&!isLocalAsterisk){utils[_0xd625('0xd')]('Asterisk\x20disabled\x20on\x20localhost');}else{var agents=require(_0xd625('0xe'));var calls=require('./calls.controller');var queues=require(_0xd625('0xf'));var recordings=require(_0xd625('0x10'));var members=require(_0xd625('0x11'));var dials=require('./dials.controller');var transfers=require(_0xd625('0x12'));var core=require(_0xd625('0x13'));ami['on']('connect',core[_0xd625('0x14')]);ami['on'](_0xd625('0x15'),core['shutdown']);ami['on'](_0xd625('0x16'),core[_0xd625('0x16')]);ami['on']('error',core[_0xd625('0x17')]);ami['on']('close',core[_0xd625('0x18')]);ami['on']('managerevent',core[_0xd625('0x19')]);ami['on'](_0xd625('0x1a'),function(_0x1d0075){try{utils['debug'](util[_0xd625('0x1b')](_0xd625('0x1c'),_0x1d0075['device']),_0x1d0075);members[_0xd625('0x1a')](_0x1d0075);}catch(_0x6f406c){utils[_0xd625('0x17')](util[_0xd625('0x1b')](_0xd625('0x1c'),_0x1d0075[_0xd625('0x1d')]),_0x6f406c);}});ami['on'](_0xd625('0x1e'),function(_0x19d3f9){try{utils['debug'](util['format'](_0xd625('0x1f'),_0x19d3f9['uniqueid']),_0x19d3f9);agents['agentcalled'](_0x19d3f9);}catch(_0x4933b6){utils['error'](util[_0xd625('0x1b')]('[%s][index][agentcalled]',_0x19d3f9['uniqueid']),_0x4933b6);}});ami['on'](_0xd625('0x20'),function(_0x34802c){try{utils[_0xd625('0x21')](util[_0xd625('0x1b')](_0xd625('0x22'),_0x34802c[_0xd625('0x23')]),_0x34802c);agents[_0xd625('0x20')](_0x34802c);}catch(_0x5f3da9){utils[_0xd625('0x17')](util[_0xd625('0x1b')]('[%s][index][agentringnoanswer]',_0x34802c[_0xd625('0x23')]),_0x5f3da9);}});ami['on'](_0xd625('0x24'),function(_0x25f5d7){try{utils[_0xd625('0x21')](util[_0xd625('0x1b')](_0xd625('0x25'),_0x25f5d7[_0xd625('0x23')]),_0x25f5d7);agents[_0xd625('0x24')](_0x25f5d7);queues['agentconnect'](_0x25f5d7);}catch(_0x58cf03){utils['error'](util[_0xd625('0x1b')](_0xd625('0x25'),_0x25f5d7[_0xd625('0x23')]),_0x58cf03);}});ami['on'](_0xd625('0x26'),function(_0x12988d){try{utils[_0xd625('0x21')](util[_0xd625('0x1b')](_0xd625('0x27'),_0x12988d[_0xd625('0x23')]),_0x12988d);agents['agentcomplete'](_0x12988d);queues[_0xd625('0x26')](_0x12988d);members[_0xd625('0x26')](_0x12988d);}catch(_0x455f82){utils[_0xd625('0x17')](util[_0xd625('0x1b')](_0xd625('0x27'),_0x12988d[_0xd625('0x23')]),_0x455f82);}});ami['on'](_0xd625('0x28'),function(_0x9366f2){try{utils[_0xd625('0x21')](util[_0xd625('0x1b')](_0xd625('0x29'),_0x9366f2['uniqueid']),_0x9366f2);agents[_0xd625('0x28')](_0x9366f2);queues['queuecallerabandon'](_0x9366f2);}catch(_0x1ae30e){utils[_0xd625('0x17')](util[_0xd625('0x1b')](_0xd625('0x29'),_0x9366f2['uniqueid']),_0x1ae30e);}});ami['on'](_0xd625('0x2a'),function(_0x9556d0){try{utils[_0xd625('0x21')](util[_0xd625('0x1b')](_0xd625('0x2b'),_0x9556d0[_0xd625('0x23')]),_0x9556d0);queues[_0xd625('0x2a')](_0x9556d0);recordings[_0xd625('0x2a')](_0x9556d0);}catch(_0x101b46){utils[_0xd625('0x17')](util[_0xd625('0x1b')](_0xd625('0x2b'),_0x9556d0[_0xd625('0x23')]),_0x101b46);}});ami['on']('queuecallerleave',function(_0xe1b4dc){try{utils[_0xd625('0x21')](util[_0xd625('0x1b')](_0xd625('0x2c'),_0xe1b4dc[_0xd625('0x23')]),_0xe1b4dc);queues[_0xd625('0x2d')](_0xe1b4dc);}catch(_0x14f6cc){utils['error'](util[_0xd625('0x1b')](_0xd625('0x2c'),_0xe1b4dc[_0xd625('0x23')]),_0x14f6cc);}});ami['on'](_0xd625('0x2e'),function(_0x11eb1d){try{utils['debug'](util[_0xd625('0x1b')]('[%s][index][musiconholdstart]',_0x11eb1d[_0xd625('0x23')]),_0x11eb1d);queues[_0xd625('0x2e')](_0x11eb1d);calls['musiconholdstart'](_0x11eb1d);}catch(_0x2c13f1){utils['error'](util[_0xd625('0x1b')](_0xd625('0x2f'),_0x11eb1d[_0xd625('0x23')]),_0x2c13f1);}});ami['on'](_0xd625('0x30'),function(_0x293b0a){try{utils['debug'](util['format'](_0xd625('0x31'),_0x293b0a[_0xd625('0x23')]),_0x293b0a);queues[_0xd625('0x30')](_0x293b0a);calls['musiconholdstop'](_0x293b0a);}catch(_0x4cbbb4){utils[_0xd625('0x17')](util[_0xd625('0x1b')](_0xd625('0x31'),_0x293b0a[_0xd625('0x23')]),_0x4cbbb4);}});ami['on'](_0xd625('0x32'),function(_0x17b957){try{utils[_0xd625('0x21')](util[_0xd625('0x1b')](_0xd625('0x33'),_0x17b957[_0xd625('0x23')]),_0x17b957);calls[_0xd625('0x32')](_0x17b957);recordings[_0xd625('0x32')](_0x17b957);}catch(_0x28331f){utils[_0xd625('0x17')](util['format'](_0xd625('0x33'),_0x17b957[_0xd625('0x23')]),_0x28331f);}});ami['on'](_0xd625('0x34'),function(_0xa65952){try{utils[_0xd625('0x21')](util[_0xd625('0x1b')](_0xd625('0x35'),_0xa65952[_0xd625('0x23')]),_0xa65952);calls[_0xd625('0x34')](_0xa65952);recordings[_0xd625('0x34')](_0xa65952);dials[_0xd625('0x34')](_0xa65952);agents[_0xd625('0x34')](_0xa65952);queues[_0xd625('0x34')](_0xa65952);}catch(_0x5bb2f0){utils['error'](util['format'](_0xd625('0x35'),_0xa65952[_0xd625('0x23')]),_0x5bb2f0);}});ami['on'](_0xd625('0x36'),function(_0x45c889){try{utils[_0xd625('0x21')](util['format'](_0xd625('0x37'),_0x45c889[_0xd625('0x23')]),_0x45c889);members[_0xd625('0x36')](_0x45c889);}catch(_0x228b4a){utils[_0xd625('0x17')](util[_0xd625('0x1b')](_0xd625('0x37'),_0x45c889[_0xd625('0x23')]),_0x228b4a);}});ami['on'](_0xd625('0x38'),function(_0x2f3472){try{utils['debug'](util[_0xd625('0x1b')](_0xd625('0x39'),_0x2f3472[_0xd625('0x23')]),_0x2f3472);queues['blindtransfer'](_0x2f3472);agents[_0xd625('0x38')](_0x2f3472);transfers[_0xd625('0x38')](_0x2f3472);}catch(_0x4f9752){utils[_0xd625('0x17')](util[_0xd625('0x1b')](_0xd625('0x39'),_0x2f3472['uniqueid']),_0x4f9752);}});ami['on'](_0xd625('0x3a'),function(_0x548f4e){try{utils[_0xd625('0x21')](util['format'](_0xd625('0x3b'),_0x548f4e[_0xd625('0x3c')]),_0x548f4e);queues[_0xd625('0x3a')](_0x548f4e);transfers[_0xd625('0x3a')](_0x548f4e);agents[_0xd625('0x3a')](_0x548f4e);calls[_0xd625('0x3a')](_0x548f4e);}catch(_0x1345d1){utils[_0xd625('0x17')](util['format'](_0xd625('0x3b'),_0x548f4e[_0xd625('0x3c')]),_0x1345d1);}});ami['on'](_0xd625('0x3d'),function(_0x34a9eb){try{utils[_0xd625('0x21')](util[_0xd625('0x1b')](_0xd625('0x3e'),_0x34a9eb[_0xd625('0x23')]),_0x34a9eb);queues[_0xd625('0x3d')](_0x34a9eb);recordings[_0xd625('0x3d')](_0x34a9eb);calls[_0xd625('0x3d')](_0x34a9eb);dials[_0xd625('0x3d')](_0x34a9eb);}catch(_0x270039){utils[_0xd625('0x17')](util[_0xd625('0x1b')]('[%s][index][varset]',_0x34a9eb['uniqueid']),_0x270039);}});ami['on'](_0xd625('0x3f'),function(_0x4550da){try{utils[_0xd625('0x21')](util[_0xd625('0x1b')](_0xd625('0x40'),_0x4550da['uniqueid']),_0x4550da);calls[_0xd625('0x3f')](_0x4550da);recordings[_0xd625('0x3f')](_0x4550da);dials[_0xd625('0x3f')](_0x4550da);}catch(_0x5ba477){utils['error'](util[_0xd625('0x1b')](_0xd625('0x40'),_0x4550da[_0xd625('0x23')]),_0x5ba477);}});ami['on'](_0xd625('0x41'),function(_0x131e6e){try{utils[_0xd625('0x21')](util['format'](_0xd625('0x42'),_0x131e6e[_0xd625('0x23')]),_0x131e6e);calls['newchannel'](_0x131e6e);recordings[_0xd625('0x41')](_0x131e6e);}catch(_0x14654a){utils['error'](util[_0xd625('0x1b')]('[%s][index][newchannel]',_0x131e6e['uniqueid']),_0x14654a);}});ami['on'](_0xd625('0x43'),function(_0x402ed8){try{utils[_0xd625('0x21')](util['format'](_0xd625('0x44'),_0x402ed8[_0xd625('0x23')]),_0x402ed8);dials['dialbegin'](_0x402ed8);}catch(_0x2bf486){utils['error'](util[_0xd625('0x1b')]('[%s]dialbegin',_0x402ed8[_0xd625('0x23')]),_0x2bf486);}});ami['on'](_0xd625('0x45'),function(_0xcc99c0){try{utils[_0xd625('0x21')](util['format']('[%s][index][dialend]',_0xcc99c0[_0xd625('0x23')]),_0xcc99c0);dials['dialend'](_0xcc99c0);}catch(_0x1951f4){utils[_0xd625('0x17')](util['format']('[%s][index][dialend]',_0xcc99c0['uniqueid']),_0x1951f4);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 1a5a485..6f75a2a 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 _0xa75b=['debug','device','state','BUSY','voice','now','agent','NOT_INUSE','isNil','duration','diffTime','exitAt','enterAt','agentcomplete','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','cdr','[%s][members][cdr]','data1','source','data3','destination','destinationchannel','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','lodash','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','data2','membername','type','then','name','internal','request','CreateMemberReport','getUserByName','split','catch','error','[%s][members][writeDB]','some','startsWith'];(function(_0x1b1b45,_0x438fc2){var _0x3654a7=function(_0x267ab7){while(--_0x267ab7){_0x1b1b45['push'](_0x1b1b45['shift']());}};_0x3654a7(++_0x438fc2);}(_0xa75b,0x170));var _0xba75=function(_0x768f74,_0x45863e){_0x768f74=_0x768f74-0x0;var _0x401575=_0xa75b[_0x768f74];return _0x401575;};'use strict';var _=require(_0xba75('0x0'));var util=require('util');var utils=require('./utils');var members={};var exclude=[_0xba75('0x1'),_0xba75('0x2')];function writeDB(_0x17b666){utils[_0xba75('0x3')](util[_0xba75('0x4')](_0xba75('0x5'),_0x17b666[_0xba75('0x6')],_0x17b666[_0xba75('0x7')],_0x17b666[_0xba75('0x8')],_0x17b666[_0xba75('0x9')],_0x17b666[_0xba75('0xa')],_0x17b666[_0xba75('0xb')]));if(_0x17b666[_0xba75('0x7')]){utils['getUserByInterface'](_0x17b666['interface'])[_0xba75('0xc')](function(_0x52669f){if(_0x52669f){_0x17b666['membername']=_0x52669f[_0xba75('0xd')];_0x17b666['internal']=_0x52669f[_0xba75('0xe')];utils[_0xba75('0xf')](_0xba75('0x10'),_0x17b666);}else{utils[_0xba75('0x11')](_0x17b666[_0xba75('0x7')][_0xba75('0x12')]('/')[0x1])[_0xba75('0xc')](function(_0x2538eb){if(_0x2538eb){_0x17b666[_0xba75('0xa')]=_0x2538eb[_0xba75('0xd')];_0x17b666[_0xba75('0xe')]=_0x2538eb[_0xba75('0xe')];utils['request']('CreateMemberReport',_0x17b666);}});}})[_0xba75('0x13')](function(_0x5262ec){utils[_0xba75('0x14')](util[_0xba75('0x4')](_0xba75('0x15'),_0x17b666[_0xba75('0x6')]),_0x5262ec);});}delete members[_0x17b666['interface']];}function startsWith(_0x31b3b3,_0x18bab2){return _[_0xba75('0x16')](_0x31b3b3,function(_0x4028f9){return _[_0xba75('0x17')](_0x18bab2,_0x4028f9);});}exports['devicestatechange']=function(_0x350a9d){try{utils[_0xba75('0x18')](util[_0xba75('0x4')]('[%s][members][devicestatechange]',members[_0x350a9d[_0xba75('0x19')]]?members[_0x350a9d[_0xba75('0x19')]][_0xba75('0x6')]:_0x350a9d[_0xba75('0x19')]),_0x350a9d);utils[_0xba75('0x3')](util[_0xba75('0x4')]('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x350a9d[_0xba75('0x19')]]?members[_0x350a9d[_0xba75('0x19')]]['uniqueid']:_0x350a9d['device'],_0x350a9d[_0xba75('0x1a')],_0x350a9d[_0xba75('0x19')]));switch(_0x350a9d['state']){case'INUSE':case _0xba75('0x1b'):if(!startsWith(exclude,_0x350a9d['device'])){members[_0x350a9d[_0xba75('0x19')]]={'channel':_0xba75('0x1c'),'interface':_0x350a9d[_0xba75('0x19')],'type':'TALKING','enterAt':utils[_0xba75('0x1d')](),'role':_0xba75('0x1e')};}break;case _0xba75('0x1f'):if(!_[_0xba75('0x20')](members[_0x350a9d[_0xba75('0x19')]])){members[_0x350a9d[_0xba75('0x19')]]['exitAt']=utils[_0xba75('0x1d')]();members[_0x350a9d[_0xba75('0x19')]][_0xba75('0x21')]=utils[_0xba75('0x22')](members[_0x350a9d[_0xba75('0x19')]][_0xba75('0x23')],members[_0x350a9d[_0xba75('0x19')]][_0xba75('0x24')]);if(members[_0x350a9d[_0xba75('0x19')]][_0xba75('0x6')]){writeDB(members[_0x350a9d['device']]);}}break;default:break;}}catch(_0x4c8d02){utils['error'](util[_0xba75('0x4')]('[%s][members][devicestatechange]',members[_0x350a9d[_0xba75('0x19')]]?members[_0x350a9d['device']][_0xba75('0x6')]:_0x350a9d[_0xba75('0x19')]),_0x4c8d02);}};exports[_0xba75('0x25')]=function(_0x4edc2e){try{if(!_[_0xba75('0x20')](members[_0x4edc2e[_0xba75('0x7')]])){utils[_0xba75('0x18')](util[_0xba75('0x4')]('[%s][members][agentcomplete]',_0x4edc2e['uniqueid']),_0x4edc2e);utils[_0xba75('0x3')](util['format'](_0xba75('0x26'),_0x4edc2e[_0xba75('0x6')],_0x4edc2e[_0xba75('0x7')],_0x4edc2e[_0xba75('0x27')]));members[_0x4edc2e['interface']]=_[_0xba75('0x28')](members[_0x4edc2e[_0xba75('0x7')]],{'data4':_0x4edc2e['queue'],'uniqueid':_0x4edc2e[_0xba75('0x6')]});}}catch(_0x37d6bb){utils[_0xba75('0x14')](util[_0xba75('0x4')]('[%s][members][agentcomplete]',_0x4edc2e[_0xba75('0x6')]),_0x37d6bb);}};exports[_0xba75('0x29')]=function(_0x483db2){try{utils[_0xba75('0x18')](util[_0xba75('0x4')](_0xba75('0x2a'),_0x483db2['uniqueid']),_0x483db2);if(_0x483db2[_0xba75('0x8')]){var _0x282f98=_0x483db2[_0xba75('0x8')][_0xba75('0x12')]('-')[0x0];if(!_[_0xba75('0x20')](members[_0x282f98])){members[_0x282f98]=_[_0xba75('0x28')](members[_0x282f98],{'data1':members[_0x282f98][_0xba75('0x2b')]||_0x483db2['type'],'data2':members[_0x282f98]['data2']||_0x483db2[_0xba75('0x2c')],'data3':members[_0x282f98][_0xba75('0x2d')]||_0x483db2[_0xba75('0x2e')],'uniqueid':members[_0x282f98]['uniqueid']||_0x483db2[_0xba75('0x6')]});utils[_0xba75('0x3')](util['format']('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x483db2[_0xba75('0x6')],members[_0x282f98][_0xba75('0x2b')],members[_0x282f98][_0xba75('0x9')],members[_0x282f98][_0xba75('0x2d')]));if(members[_0x282f98][_0xba75('0x23')]){writeDB(members[_0x282f98]);}}}if(_0x483db2['destinationchannel']){var _0x491953=_0x483db2[_0xba75('0x2f')][_0xba75('0x12')]('-')[0x0];if(!_[_0xba75('0x20')](members[_0x491953])){members[_0x491953]=_[_0xba75('0x28')](members[_0x491953],{'data1':members[_0x491953][_0xba75('0x2b')]||_0x483db2[_0xba75('0xb')],'data2':members[_0x491953][_0xba75('0x9')]||_0x483db2['source'],'data3':members[_0x491953][_0xba75('0x2d')]||_0x483db2[_0xba75('0x2e')],'uniqueid':members[_0x491953]['uniqueid']||_0x483db2[_0xba75('0x6')]});utils[_0xba75('0x3')](util[_0xba75('0x4')](_0xba75('0x30'),_0x483db2[_0xba75('0x6')],members[_0x491953][_0xba75('0x2b')],members[_0x491953][_0xba75('0x9')],members[_0x491953]['data3']));if(members[_0x491953][_0xba75('0x23')]){writeDB(members[_0x491953]);}}}}catch(_0x59d005){utils[_0xba75('0x14')](util['format'](_0xba75('0x2a'),_0x483db2[_0xba75('0x6')]),_0x59d005);}}; \ No newline at end of file +var _0xff91=['exitAt','now','diffTime','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','cdr','channel','split','assign','data1','source','destinationchannel','data3','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','util','./utils','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','data2','membername','type','getUserByInterface','interface','then','name','internal','request','CreateMemberReport','getUserByName','catch','error','[%s][members][writeDB]','uniqueid','some','startsWith','devicestatechange','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','BUSY','voice','TALKING','NOT_INUSE','isNil'];(function(_0x4b2231,_0x379f87){var _0xb11ccc=function(_0x208f06){while(--_0x208f06){_0x4b2231['push'](_0x4b2231['shift']());}};_0xb11ccc(++_0x379f87);}(_0xff91,0x1d1));var _0x1ff9=function(_0x80b0e,_0xb38004){_0x80b0e=_0x80b0e-0x0;var _0x15d922=_0xff91[_0x80b0e];return _0x15d922;};'use strict';var _=require('lodash');var util=require(_0x1ff9('0x0'));var utils=require(_0x1ff9('0x1'));var members={};var exclude=[_0x1ff9('0x2'),_0x1ff9('0x3')];function writeDB(_0x3f1a73){utils[_0x1ff9('0x4')](util[_0x1ff9('0x5')](_0x1ff9('0x6'),_0x3f1a73['uniqueid'],_0x3f1a73['interface'],_0x3f1a73['channel'],_0x3f1a73[_0x1ff9('0x7')],_0x3f1a73[_0x1ff9('0x8')],_0x3f1a73[_0x1ff9('0x9')]));if(_0x3f1a73['interface']){utils[_0x1ff9('0xa')](_0x3f1a73[_0x1ff9('0xb')])[_0x1ff9('0xc')](function(_0x2c90da){if(_0x2c90da){_0x3f1a73[_0x1ff9('0x8')]=_0x2c90da[_0x1ff9('0xd')];_0x3f1a73[_0x1ff9('0xe')]=_0x2c90da['internal'];utils[_0x1ff9('0xf')](_0x1ff9('0x10'),_0x3f1a73);}else{utils[_0x1ff9('0x11')](_0x3f1a73[_0x1ff9('0xb')]['split']('/')[0x1])[_0x1ff9('0xc')](function(_0x589794){if(_0x589794){_0x3f1a73[_0x1ff9('0x8')]=_0x589794[_0x1ff9('0xd')];_0x3f1a73['internal']=_0x589794[_0x1ff9('0xe')];utils['request'](_0x1ff9('0x10'),_0x3f1a73);}});}})[_0x1ff9('0x12')](function(_0x3d2a97){utils[_0x1ff9('0x13')](util[_0x1ff9('0x5')](_0x1ff9('0x14'),_0x3f1a73[_0x1ff9('0x15')]),_0x3d2a97);});}delete members[_0x3f1a73[_0x1ff9('0xb')]];}function startsWith(_0x196b16,_0x13804b){return _[_0x1ff9('0x16')](_0x196b16,function(_0x41af65){return _[_0x1ff9('0x17')](_0x13804b,_0x41af65);});}exports[_0x1ff9('0x18')]=function(_0x2c959e){try{utils[_0x1ff9('0x19')](util['format'](_0x1ff9('0x1a'),members[_0x2c959e['device']]?members[_0x2c959e[_0x1ff9('0x1b')]][_0x1ff9('0x15')]:_0x2c959e[_0x1ff9('0x1b')]),_0x2c959e);utils[_0x1ff9('0x4')](util[_0x1ff9('0x5')](_0x1ff9('0x1c'),members[_0x2c959e[_0x1ff9('0x1b')]]?members[_0x2c959e[_0x1ff9('0x1b')]]['uniqueid']:_0x2c959e[_0x1ff9('0x1b')],_0x2c959e['state'],_0x2c959e['device']));switch(_0x2c959e[_0x1ff9('0x1d')]){case'INUSE':case _0x1ff9('0x1e'):if(!startsWith(exclude,_0x2c959e['device'])){members[_0x2c959e[_0x1ff9('0x1b')]]={'channel':_0x1ff9('0x1f'),'interface':_0x2c959e[_0x1ff9('0x1b')],'type':_0x1ff9('0x20'),'enterAt':utils['now'](),'role':'agent'};}break;case _0x1ff9('0x21'):if(!_[_0x1ff9('0x22')](members[_0x2c959e[_0x1ff9('0x1b')]])){members[_0x2c959e['device']][_0x1ff9('0x23')]=utils[_0x1ff9('0x24')]();members[_0x2c959e['device']]['duration']=utils[_0x1ff9('0x25')](members[_0x2c959e[_0x1ff9('0x1b')]][_0x1ff9('0x23')],members[_0x2c959e[_0x1ff9('0x1b')]]['enterAt']);if(members[_0x2c959e['device']]['uniqueid']){writeDB(members[_0x2c959e[_0x1ff9('0x1b')]]);}}break;default:break;}}catch(_0x51d6c7){utils[_0x1ff9('0x13')](util['format'](_0x1ff9('0x1a'),members[_0x2c959e[_0x1ff9('0x1b')]]?members[_0x2c959e['device']][_0x1ff9('0x15')]:_0x2c959e[_0x1ff9('0x1b')]),_0x51d6c7);}};exports['agentcomplete']=function(_0x11e986){try{if(!_[_0x1ff9('0x22')](members[_0x11e986[_0x1ff9('0xb')]])){utils[_0x1ff9('0x19')](util[_0x1ff9('0x5')](_0x1ff9('0x26'),_0x11e986[_0x1ff9('0x15')]),_0x11e986);utils[_0x1ff9('0x4')](util[_0x1ff9('0x5')](_0x1ff9('0x27'),_0x11e986[_0x1ff9('0x15')],_0x11e986[_0x1ff9('0xb')],_0x11e986[_0x1ff9('0x28')]));members[_0x11e986[_0x1ff9('0xb')]]=_['assign'](members[_0x11e986[_0x1ff9('0xb')]],{'data4':_0x11e986['queue'],'uniqueid':_0x11e986[_0x1ff9('0x15')]});}}catch(_0x720724){utils[_0x1ff9('0x13')](util[_0x1ff9('0x5')](_0x1ff9('0x26'),_0x11e986[_0x1ff9('0x15')]),_0x720724);}};exports[_0x1ff9('0x29')]=function(_0x4c53d2){try{utils[_0x1ff9('0x19')](util[_0x1ff9('0x5')]('[%s][members][cdr]',_0x4c53d2['uniqueid']),_0x4c53d2);if(_0x4c53d2[_0x1ff9('0x2a')]){var _0x212d77=_0x4c53d2[_0x1ff9('0x2a')][_0x1ff9('0x2b')]('-')[0x0];if(!_[_0x1ff9('0x22')](members[_0x212d77])){members[_0x212d77]=_[_0x1ff9('0x2c')](members[_0x212d77],{'data1':members[_0x212d77][_0x1ff9('0x2d')]||_0x4c53d2[_0x1ff9('0x9')],'data2':members[_0x212d77][_0x1ff9('0x7')]||_0x4c53d2[_0x1ff9('0x2e')],'data3':members[_0x212d77]['data3']||_0x4c53d2['destination'],'uniqueid':members[_0x212d77]['uniqueid']||_0x4c53d2['uniqueid']});utils[_0x1ff9('0x4')](util[_0x1ff9('0x5')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x4c53d2[_0x1ff9('0x15')],members[_0x212d77][_0x1ff9('0x2d')],members[_0x212d77][_0x1ff9('0x7')],members[_0x212d77]['data3']));if(members[_0x212d77]['exitAt']){writeDB(members[_0x212d77]);}}}if(_0x4c53d2[_0x1ff9('0x2f')]){var _0x28fb0d=_0x4c53d2[_0x1ff9('0x2f')]['split']('-')[0x0];if(!_[_0x1ff9('0x22')](members[_0x28fb0d])){members[_0x28fb0d]=_[_0x1ff9('0x2c')](members[_0x28fb0d],{'data1':members[_0x28fb0d][_0x1ff9('0x2d')]||_0x4c53d2[_0x1ff9('0x9')],'data2':members[_0x28fb0d][_0x1ff9('0x7')]||_0x4c53d2[_0x1ff9('0x2e')],'data3':members[_0x28fb0d][_0x1ff9('0x30')]||_0x4c53d2['destination'],'uniqueid':members[_0x28fb0d]['uniqueid']||_0x4c53d2[_0x1ff9('0x15')]});utils[_0x1ff9('0x4')](util[_0x1ff9('0x5')](_0x1ff9('0x31'),_0x4c53d2[_0x1ff9('0x15')],members[_0x28fb0d][_0x1ff9('0x2d')],members[_0x28fb0d][_0x1ff9('0x7')],members[_0x28fb0d][_0x1ff9('0x30')]));if(members[_0x28fb0d]['exitAt']){writeDB(members[_0x28fb0d]);}}}}catch(_0x28800a){utils[_0x1ff9('0x13')](util['format']('[%s][members][cdr]',_0x4c53d2[_0x1ff9('0x15')]),_0x28800a);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 911fe9d..61afc3e 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 _0x67d3=['[%s][queues][attendedtransfer]','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','error','queuecallerabandon','queuecallerexit','queuecallercomplete','now','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','name','queuecallerenterreason','[%s][queues][hangup]','varset','[%s][queues][varset]','isNil','variable','queuestatus','queuecallerexitAt','value','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','queuecallerabandonAt','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','queuecallerleaveAt','diffTime','queuecallerjoinAt','count','connectedlinename','agentconnect','destaccountcode','assigned','[%s][queues][agentconnect]','membername','queuecallercompleteAt','transfer','reason','toUpperCase','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','[%s][queues][agentcomplete]','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','transferexten','extension','transferuniqueid','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','ATTENDED','origtransfererexten','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid'];(function(_0x5a8c82,_0x2a712c){var _0x242535=function(_0xd591e9){while(--_0xd591e9){_0x5a8c82['push'](_0x5a8c82['shift']());}};_0x242535(++_0x2a712c);}(_0x67d3,0x1a4));var _0x367d=function(_0x2a6cb5,_0x19012c){_0x2a6cb5=_0x2a6cb5-0x0;var _0x4fc327=_0x67d3[_0x2a6cb5];return _0x4fc327;};'use strict';var _=require(_0x367d('0x0'));var util=require(_0x367d('0x1'));var utils=require(_0x367d('0x2'));var queues={};function writeDB(_0x4b68e5){utils[_0x367d('0x3')](util[_0x367d('0x4')](_0x367d('0x5'),_0x4b68e5[_0x367d('0x6')],_0x4b68e5[_0x367d('0x7')],_0x4b68e5[_0x367d('0x8')],_0x4b68e5[_0x367d('0x9')],_0x4b68e5[_0x367d('0xa')],_0x4b68e5[_0x367d('0xb')],_0x4b68e5[_0x367d('0xc')]));if(_0x4b68e5[_0x367d('0x8')]){utils[_0x367d('0xd')](_0x4b68e5[_0x367d('0x8')])[_0x367d('0xe')](function(_0x5d69f0){if(_0x5d69f0){_0x4b68e5[_0x367d('0xf')]=_0x5d69f0[_0x367d('0xf')];}utils[_0x367d('0x10')]('CreateVoiceQueueReport',_0x4b68e5);});}else{utils[_0x367d('0x10')](_0x367d('0x11'),_0x4b68e5);}if(_0x4b68e5[_0x367d('0x12')]){delete queues[_0x4b68e5[_0x367d('0x12')]];}else{delete queues[_0x4b68e5[_0x367d('0x6')]];}}exports[_0x367d('0x13')]=function(_0x3f75b7){try{utils[_0x367d('0x14')](util[_0x367d('0x4')]('[%s][queues][queuecallerjoin]',_0x3f75b7['uniqueid']),_0x3f75b7);utils[_0x367d('0x3')](util[_0x367d('0x4')](_0x367d('0x15'),_0x3f75b7[_0x367d('0x6')],_0x3f75b7['queue'],_0x3f75b7[_0x367d('0x16')]));queues[_0x3f75b7[_0x367d('0x6')]]=_['assign'](_0x3f75b7,{'originalposition':_0x3f75b7[_0x367d('0x16')],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});}catch(_0x1cb2e5){utils[_0x367d('0x17')](util[_0x367d('0x4')]('[%s][queues][queuecallerjoin]',_0x3f75b7[_0x367d('0x6')]),_0x1cb2e5);}};exports['hangup']=function(_0x4f5b9c){try{if(!_['isNil'](queues[_0x4f5b9c[_0x367d('0x6')]])){utils[_0x367d('0x14')](util['format']('[%s][queues][hangup]',_0x4f5b9c[_0x367d('0x6')]),_0x4f5b9c);if(queues[_0x4f5b9c[_0x367d('0x6')]]['queuecallerleaveAt']){if(!queues[_0x4f5b9c[_0x367d('0x6')]][_0x367d('0x18')]&&!queues[_0x4f5b9c[_0x367d('0x6')]][_0x367d('0x19')]){queues[_0x4f5b9c[_0x367d('0x6')]][_0x367d('0x1a')]=!![];queues[_0x4f5b9c['uniqueid']]['queuecallercompleteAt']=utils[_0x367d('0x1b')]();queues[_0x4f5b9c[_0x367d('0x6')]][_0x367d('0xc')]=_0x367d('0x1c');}utils[_0x367d('0x3')](util[_0x367d('0x4')]('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0x4f5b9c[_0x367d('0x6')],queues[_0x4f5b9c[_0x367d('0x6')]]['name'],queues[_0x4f5b9c[_0x367d('0x6')]][_0x367d('0xc')]));writeDB(queues[_0x4f5b9c[_0x367d('0x6')]]);}else if(queues[_0x4f5b9c[_0x367d('0x6')]][_0x367d('0x12')]){utils[_0x367d('0x3')](util['format'](_0x367d('0x1d'),_0x4f5b9c['uniqueid'],queues[_0x4f5b9c[_0x367d('0x6')]][_0x367d('0x1e')],queues[_0x4f5b9c[_0x367d('0x6')]][_0x367d('0x12')]));queues[queues[_0x4f5b9c[_0x367d('0x6')]][_0x367d('0x12')]]=queues[_0x4f5b9c[_0x367d('0x6')]];queues[queues[_0x4f5b9c[_0x367d('0x6')]]['transfereduniqueid']][_0x367d('0x1f')]=0x2;delete queues[_0x4f5b9c['uniqueid']];}}}catch(_0x189a4b){utils['error'](util['format'](_0x367d('0x20'),_0x4f5b9c[_0x367d('0x6')]),_0x189a4b);}};exports[_0x367d('0x21')]=function(_0x5935cb){try{utils[_0x367d('0x14')](util['format'](_0x367d('0x22'),_0x5935cb['uniqueid']),_0x5935cb);if(!_[_0x367d('0x23')](_0x5935cb[_0x367d('0x24')][_0x367d('0x25')])&&_0x5935cb['value']['toUpperCase']()!=='CONTINUE'){if(!_['isNil'](queues[_0x5935cb[_0x367d('0x6')]])){queues[_0x5935cb[_0x367d('0x6')]][_0x367d('0x18')]=![];queues[_0x5935cb['uniqueid']]['queuecallerabandonAt']=null;queues[_0x5935cb[_0x367d('0x6')]][_0x367d('0x19')]=!![];queues[_0x5935cb['uniqueid']][_0x367d('0x26')]=utils[_0x367d('0x1b')]();queues[_0x5935cb['uniqueid']][_0x367d('0xc')]=_0x5935cb[_0x367d('0x27')]['toUpperCase']();utils['info'](util[_0x367d('0x4')](_0x367d('0x28'),_0x5935cb['uniqueid'],queues[_0x5935cb[_0x367d('0x6')]][_0x367d('0x1e')],_0x5935cb[_0x367d('0x27')],queues[_0x5935cb['uniqueid']]['queuecallerexitreason']));writeDB(queues[_0x5935cb[_0x367d('0x6')]]);}}else if(!_[_0x367d('0x23')](_0x5935cb[_0x367d('0x24')][_0x367d('0x29')])){if(!_['isNil'](queues[_0x5935cb[_0x367d('0x6')]])&&!queues[_0x5935cb[_0x367d('0x6')]][_0x367d('0x18')]){queues[_0x5935cb[_0x367d('0x6')]][_0x367d('0x18')]=![];queues[_0x5935cb[_0x367d('0x6')]][_0x367d('0x2a')]=null;queues[_0x5935cb[_0x367d('0x6')]][_0x367d('0x19')]=!![];queues[_0x5935cb[_0x367d('0x6')]][_0x367d('0x26')]=utils[_0x367d('0x1b')]();queues[_0x5935cb[_0x367d('0x6')]]['queuecallerexitreason']='EXITWITHKEY';utils[_0x367d('0x3')](util[_0x367d('0x4')](_0x367d('0x2b'),_0x5935cb[_0x367d('0x6')],queues[_0x5935cb[_0x367d('0x6')]][_0x367d('0x1e')],_0x5935cb[_0x367d('0x27')],queues[_0x5935cb[_0x367d('0x6')]][_0x367d('0xc')]));}}}catch(_0xb100fd){utils[_0x367d('0x17')](util['format']('[%s][queues][varset]',_0x5935cb['uniqueid']),_0xb100fd);}};exports[_0x367d('0x18')]=function(_0x477e9b){try{if(!_[_0x367d('0x23')](queues[_0x477e9b[_0x367d('0x6')]])){utils['debug'](util[_0x367d('0x4')](_0x367d('0x2c'),_0x477e9b[_0x367d('0x6')]),_0x477e9b);queues[_0x477e9b[_0x367d('0x6')]][_0x367d('0x19')]=![];queues[_0x477e9b[_0x367d('0x6')]]['queuecallerexitAt']=null;queues[_0x477e9b[_0x367d('0x6')]][_0x367d('0x18')]=!![];queues[_0x477e9b[_0x367d('0x6')]]['queuecallerabandonAt']=utils[_0x367d('0x1b')]();queues[_0x477e9b[_0x367d('0x6')]]['queuecallerexitreason']=_0x367d('0x2d');utils['info'](util[_0x367d('0x4')](_0x367d('0x2e'),_0x477e9b[_0x367d('0x6')],queues[_0x477e9b[_0x367d('0x6')]][_0x367d('0x1e')],queues[_0x477e9b[_0x367d('0x6')]][_0x367d('0xc')]));}}catch(_0x28c753){utils[_0x367d('0x17')](util[_0x367d('0x4')]('[%s][queues][queuecallerabandon]',_0x477e9b['uniqueid']),_0x28c753);}};exports[_0x367d('0x2f')]=function(_0x14b7ca){try{if(!_[_0x367d('0x23')](queues[_0x14b7ca['uniqueid']])){utils[_0x367d('0x14')](util[_0x367d('0x4')](_0x367d('0x30'),_0x14b7ca[_0x367d('0x6')]),_0x14b7ca);utils[_0x367d('0x3')](util['format'](_0x367d('0x31'),_0x14b7ca[_0x367d('0x6')],queues[_0x14b7ca[_0x367d('0x6')]]['name'],_0x14b7ca[_0x367d('0x32')],_0x14b7ca['connectedlinename']));queues[_0x14b7ca[_0x367d('0x6')]][_0x367d('0x2f')]=!![];queues[_0x14b7ca[_0x367d('0x6')]][_0x367d('0x33')]=utils[_0x367d('0x1b')]();queues[_0x14b7ca[_0x367d('0x6')]]['holdtime']=utils[_0x367d('0x34')](queues[_0x14b7ca[_0x367d('0x6')]][_0x367d('0x33')],queues[_0x14b7ca[_0x367d('0x6')]][_0x367d('0x35')]);queues[_0x14b7ca[_0x367d('0x6')]][_0x367d('0x16')]=_0x14b7ca[_0x367d('0x16')];queues[_0x14b7ca['uniqueid']]['count']=_0x14b7ca[_0x367d('0x36')];queues[_0x14b7ca[_0x367d('0x6')]]['connectedlinenum']=_0x14b7ca[_0x367d('0x32')];queues[_0x14b7ca[_0x367d('0x6')]][_0x367d('0x37')]=_0x14b7ca[_0x367d('0x37')];}}catch(_0x47d15c){utils[_0x367d('0x17')](util[_0x367d('0x4')]('[%s][queues][queuecallerleave]',_0x14b7ca[_0x367d('0x6')]),_0x47d15c);}};exports[_0x367d('0x38')]=function(_0x2564f2){try{if(!_[_0x367d('0x23')](queues[_0x2564f2[_0x367d('0x6')]])){utils[_0x367d('0x14')](util[_0x367d('0x4')]('[%s][queues][agentconnect]',_0x2564f2[_0x367d('0x6')]),_0x2564f2);utils[_0x367d('0x3')](util[_0x367d('0x4')]('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x2564f2[_0x367d('0x6')],queues[_0x2564f2[_0x367d('0x6')]][_0x367d('0x1e')],_0x2564f2['membername'],_0x2564f2[_0x367d('0x39')]));queues[_0x2564f2[_0x367d('0x6')]][_0x367d('0x18')]=![];queues[_0x2564f2['uniqueid']]['queuecallerabandon']=![];queues[_0x2564f2[_0x367d('0x6')]][_0x367d('0x2a')]=null;queues[_0x2564f2[_0x367d('0x6')]]['queuecallerexit']=![];queues[_0x2564f2[_0x367d('0x6')]][_0x367d('0xc')]=null;queues[_0x2564f2[_0x367d('0x6')]][_0x367d('0x26')]=null;queues[_0x2564f2[_0x367d('0x6')]][_0x367d('0x3a')]=!![];queues[_0x2564f2[_0x367d('0x6')]][_0x367d('0xb')]=_0x2564f2[_0x367d('0x39')];queues[_0x2564f2[_0x367d('0x6')]][_0x367d('0x9')]=_0x2564f2['membername'];}}catch(_0x2ce598){utils[_0x367d('0x17')](util[_0x367d('0x4')](_0x367d('0x3b'),_0x2564f2[_0x367d('0x6')]),_0x2ce598);}};exports['agentcomplete']=function(_0x586034){try{if(!_[_0x367d('0x23')](queues[_0x586034[_0x367d('0x6')]])){if(queues[_0x586034['uniqueid']][_0x367d('0x33')]){utils['debug'](util['format']('[%s][queues][agentcomplete]',_0x586034[_0x367d('0x6')]),_0x586034);queues[_0x586034['uniqueid']][_0x367d('0x18')]=![];queues[_0x586034['uniqueid']]['queuecallerabandon']=![];queues[_0x586034[_0x367d('0x6')]][_0x367d('0x2a')]=null;queues[_0x586034[_0x367d('0x6')]][_0x367d('0x19')]=![];queues[_0x586034[_0x367d('0x6')]]['queuecallerexitAt']=null;queues[_0x586034[_0x367d('0x6')]][_0x367d('0x3a')]=!![];queues[_0x586034[_0x367d('0x6')]][_0x367d('0x9')]=_0x586034[_0x367d('0x3c')];queues[_0x586034[_0x367d('0x6')]][_0x367d('0x1a')]=!![];queues[_0x586034[_0x367d('0x6')]][_0x367d('0x3d')]=utils['now']();if(_0x586034['reason']==_0x367d('0x3e')){if(!queues[_0x586034['uniqueid']][_0x367d('0x3e')]){queues[_0x586034[_0x367d('0x6')]][_0x367d('0xc')]='TRANSFER';}}else{queues[_0x586034['uniqueid']]['queuecallerexitreason']='COMPLETEDBY'+_0x586034[_0x367d('0x3f')][_0x367d('0x40')]();}utils[_0x367d('0x3')](util[_0x367d('0x4')](_0x367d('0x41'),_0x586034[_0x367d('0x6')],queues[_0x586034[_0x367d('0x6')]]['name'],_0x586034[_0x367d('0x3c')],queues[_0x586034['uniqueid']][_0x367d('0xc')]));writeDB(queues[_0x586034[_0x367d('0x6')]]);}}}catch(_0x410de7){utils[_0x367d('0x17')](util['format'](_0x367d('0x42'),_0x586034[_0x367d('0x6')]),_0x410de7);}};exports[_0x367d('0x43')]=function(_0x37a052){try{if(!_[_0x367d('0x23')](queues[_0x37a052[_0x367d('0x44')]])){utils[_0x367d('0x14')](util['format'](_0x367d('0x45'),_0x37a052[_0x367d('0x6')]),_0x37a052);queues[_0x37a052[_0x367d('0x44')]]['transfer']=!![];queues[_0x37a052['transfereeuniqueid']][_0x367d('0x46')]=_0x367d('0x47');queues[_0x37a052[_0x367d('0x44')]][_0x367d('0x48')]=_0x37a052[_0x367d('0x49')];queues[_0x37a052[_0x367d('0x44')]][_0x367d('0x4a')]=_0x37a052[_0x367d('0x44')];queues[_0x37a052[_0x367d('0x44')]][_0x367d('0xc')]='BLINDTRANSFER';utils[_0x367d('0x3')](util[_0x367d('0x4')](_0x367d('0x4b'),_0x37a052['uniqueid'],queues[_0x37a052[_0x367d('0x44')]][_0x367d('0x1e')],_0x37a052[_0x367d('0x44')],_0x37a052['extension']));}}catch(_0x1916f0){utils[_0x367d('0x17')](util[_0x367d('0x4')](_0x367d('0x45'),_0x37a052['uniqueid']),_0x1916f0);}};exports[_0x367d('0x4c')]=function(_0x108d64){try{utils[_0x367d('0x14')](util[_0x367d('0x4')]('[%s][queues][attendedtransfer]',_0x108d64[_0x367d('0x4d')]),_0x108d64);if(_0x108d64[_0x367d('0x4d')]==_0x108d64[_0x367d('0x4e')]){if(!_['isNil'](queues[_0x108d64[_0x367d('0x4f')]])){utils[_0x367d('0x3')](util[_0x367d('0x4')](_0x367d('0x50'),_0x108d64[_0x367d('0x4d')],queues[_0x108d64[_0x367d('0x4f')]][_0x367d('0x1e')],_0x108d64['origtransfererexten']));queues[_0x108d64[_0x367d('0x4f')]][_0x367d('0x3e')]=!![];queues[_0x108d64[_0x367d('0x4f')]][_0x367d('0x46')]=_0x367d('0x51');queues[_0x108d64[_0x367d('0x4f')]][_0x367d('0x48')]=_0x108d64[_0x367d('0x52')];queues[_0x108d64[_0x367d('0x4f')]][_0x367d('0x4a')]=_0x108d64[_0x367d('0x4d')];queues[_0x108d64[_0x367d('0x4f')]][_0x367d('0xc')]=_0x367d('0x53');}if(!_['isNil'](queues[_0x108d64[_0x367d('0x4e')]])){if(_0x108d64[_0x367d('0x54')]&&queues[_0x108d64[_0x367d('0x54')]]){queues[_0x108d64[_0x367d('0x54')]]['queuecallerenterreason']=0x1;queues[_0x108d64[_0x367d('0x44')]]=_[_0x367d('0x55')](queues[_0x108d64[_0x367d('0x54')]]);queues[_0x108d64[_0x367d('0x44')]]['transfereduniqueid']=_0x108d64[_0x367d('0x56')];queues[_0x108d64[_0x367d('0x44')]][_0x367d('0x1f')]=0x2;queues[_0x108d64[_0x367d('0x44')]]['calleridnum']=queues[_0x108d64[_0x367d('0x4f')]][_0x367d('0xa')];queues[_0x108d64['transfereeuniqueid']][_0x367d('0x57')]=queues[_0x108d64[_0x367d('0x4f')]][_0x367d('0x57')];queues[_0x108d64[_0x367d('0x44')]][_0x367d('0x35')]=utils['now']();queues[_0x108d64[_0x367d('0x44')]][_0x367d('0x33')]=utils[_0x367d('0x1b')]();queues[_0x108d64[_0x367d('0x44')]]['holdtime']=0x0;queues[_0x108d64[_0x367d('0x44')]][_0x367d('0x58')]=0x0;utils[_0x367d('0x3')](util[_0x367d('0x4')](_0x367d('0x59'),_0x108d64[_0x367d('0x4d')],queues[_0x108d64['transfereeuniqueid']][_0x367d('0x1e')],queues[_0x108d64['transfereeuniqueid']][_0x367d('0xa')],queues[_0x108d64['transfereeuniqueid']][_0x367d('0x57')]));}else{utils['info'](util['format'](_0x367d('0x5a'),_0x108d64['origtransfereruniqueid'],queues[_0x108d64[_0x367d('0x4e')]][_0x367d('0x1e')],_0x108d64['secondtransfererlinkedid']));queues[_0x108d64['origtransfererlinkedid']][_0x367d('0x12')]=_0x108d64[_0x367d('0x4f')];}}}else if(_0x108d64[_0x367d('0x5b')]==_0x108d64['secondtransfererlinkedid']){if(!_['isNil'](queues[_0x108d64['origtransfererlinkedid']])){utils[_0x367d('0x3')](util[_0x367d('0x4')](_0x367d('0x5c'),_0x108d64[_0x367d('0x4d')],queues[_0x108d64['origtransfererlinkedid']][_0x367d('0x1e')],_0x108d64['secondtransfereruniqueid'],_0x108d64[_0x367d('0x5d')]));queues[_0x108d64[_0x367d('0x4e')]][_0x367d('0x3e')]=!![];queues[_0x108d64[_0x367d('0x4e')]][_0x367d('0x46')]=_0x367d('0x51');queues[_0x108d64[_0x367d('0x4e')]][_0x367d('0x48')]=_0x108d64['secondtransfererexten'];queues[_0x108d64[_0x367d('0x4e')]]['transferuniqueid']=_0x108d64[_0x367d('0x5b')];queues[_0x108d64[_0x367d('0x4e')]][_0x367d('0xc')]=_0x367d('0x53');}if(!_['isNil'](queues[_0x108d64['secondtransfererlinkedid']])){if(_0x108d64['transfertargetlinkedid']&&queues[_0x108d64[_0x367d('0x5e')]]){queues[_0x108d64[_0x367d('0x5e')]][_0x367d('0x1f')]=0x1;queues[_0x108d64['transfertargetuniqueid']]=_[_0x367d('0x55')](queues[_0x108d64[_0x367d('0x5e')]]);queues[_0x108d64['transfertargetuniqueid']][_0x367d('0x12')]=_0x108d64[_0x367d('0x56')];queues[_0x108d64[_0x367d('0x56')]][_0x367d('0x1f')]=0x2;queues[_0x108d64[_0x367d('0x56')]][_0x367d('0xa')]=queues[_0x108d64['origtransfererlinkedid']][_0x367d('0xa')];queues[_0x108d64[_0x367d('0x56')]][_0x367d('0x57')]=queues[_0x108d64[_0x367d('0x4e')]][_0x367d('0x57')];queues[_0x108d64[_0x367d('0x56')]][_0x367d('0x35')]=utils[_0x367d('0x1b')]();queues[_0x108d64[_0x367d('0x56')]][_0x367d('0x33')]=utils[_0x367d('0x1b')]();queues[_0x108d64[_0x367d('0x56')]]['holdtime']=0x0;queues[_0x108d64['transfertargetuniqueid']][_0x367d('0x58')]=0x0;utils[_0x367d('0x3')](util[_0x367d('0x4')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s',_0x108d64[_0x367d('0x4d')],queues[_0x108d64[_0x367d('0x56')]][_0x367d('0x1e')],queues[_0x108d64[_0x367d('0x56')]]['transfereduniqueid'],queues[_0x108d64['transfertargetuniqueid']][_0x367d('0xa')],queues[_0x108d64[_0x367d('0x56')]]['calleridname']));}else{utils[_0x367d('0x3')](util['format'](_0x367d('0x5a'),_0x108d64[_0x367d('0x4d')],queues[_0x108d64[_0x367d('0x4f')]][_0x367d('0x1e')],_0x108d64[_0x367d('0x4e')]));queues[_0x108d64[_0x367d('0x4f')]][_0x367d('0x12')]=_0x108d64['origtransfererlinkedid'];}}}}catch(_0x14382f){utils[_0x367d('0x17')](util['format'](_0x367d('0x5f'),_0x108d64[_0x367d('0x4d')]),_0x14382f);}};exports[_0x367d('0x60')]=function(_0x2c2415){try{if(!_['isNil'](queues[_0x2c2415['uniqueid']])){utils[_0x367d('0x14')](util[_0x367d('0x4')](_0x367d('0x61'),_0x2c2415[_0x367d('0x6')]),_0x2c2415);queues[_0x2c2415[_0x367d('0x6')]][_0x367d('0x62')]=utils[_0x367d('0x1b')]();utils[_0x367d('0x3')](util[_0x367d('0x4')](_0x367d('0x63'),_0x2c2415[_0x367d('0x6')],queues[_0x2c2415[_0x367d('0x6')]][_0x367d('0x1e')],queues[_0x2c2415[_0x367d('0x6')]][_0x367d('0x62')]));}}catch(_0x479143){utils[_0x367d('0x17')](util['format'](_0x367d('0x61'),_0x2c2415[_0x367d('0x6')]),_0x479143);}};exports[_0x367d('0x64')]=function(_0x4c456c){try{if(!_[_0x367d('0x23')](queues[_0x4c456c[_0x367d('0x6')]])){if(!_['isNil'](queues[_0x4c456c[_0x367d('0x6')]]['musiconholdstartAt'])){utils[_0x367d('0x14')](util[_0x367d('0x4')](_0x367d('0x65'),_0x4c456c[_0x367d('0x6')]),_0x4c456c);queues[_0x4c456c['uniqueid']][_0x367d('0x58')]+=utils[_0x367d('0x34')](utils[_0x367d('0x1b')](),queues[_0x4c456c[_0x367d('0x6')]][_0x367d('0x62')]);utils[_0x367d('0x3')](util[_0x367d('0x4')](_0x367d('0x66'),_0x4c456c[_0x367d('0x6')],queues[_0x4c456c[_0x367d('0x6')]][_0x367d('0x1e')],queues[_0x4c456c[_0x367d('0x6')]][_0x367d('0x58')]));delete queues[_0x4c456c[_0x367d('0x6')]][_0x367d('0x62')];}}}catch(_0xbdd4a6){utils['error'](util[_0x367d('0x4')]('[%s][queues][musiconholdstop]',_0x4c456c[_0x367d('0x6')]),_0xbdd4a6);}}; \ No newline at end of file +var _0x9014=['holdtime','diffTime','queuecallerjoinAt','count','connectedlinenum','[%s][queues][queuecallerleave]','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','agentcomplete','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','[%s][queues][agentcomplete]','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','transfertype','ATTENDED','transfereelinkedid','clone','transfertargetuniqueid','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','ATTENDEDTRANSFER','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','queue','lastAssignedTo','calleridnum','accountcode','getVoiceQueueByName','request','CreateVoiceQueueReport','queuecallerjoin','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','assign','position','now','hangup','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallerexitreason','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','transfereduniqueid','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','error','[%s][queues][hangup]','varset','isNil','variable','queuestatus','toUpperCase','queuecallerexitAt','value','queueposition','queuecallerabandonAt','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','debug','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','connectedlinename'];(function(_0x4ec05f,_0x1d7fd3){var _0x29c86d=function(_0x10029a){while(--_0x10029a){_0x4ec05f['push'](_0x4ec05f['shift']());}};_0x29c86d(++_0x1d7fd3);}(_0x9014,0x10c));var _0x4901=function(_0xbd6442,_0x29b186){_0xbd6442=_0xbd6442-0x0;var _0x5888d1=_0x9014[_0xbd6442];return _0x5888d1;};'use strict';var _=require(_0x4901('0x0'));var util=require('util');var utils=require(_0x4901('0x1'));var queues={};function writeDB(_0x1609bc){utils[_0x4901('0x2')](util[_0x4901('0x3')](_0x4901('0x4'),_0x1609bc[_0x4901('0x5')],_0x1609bc['channel'],_0x1609bc[_0x4901('0x6')],_0x1609bc[_0x4901('0x7')],_0x1609bc[_0x4901('0x8')],_0x1609bc[_0x4901('0x9')],_0x1609bc['queuecallerexitreason']));if(_0x1609bc[_0x4901('0x6')]){utils[_0x4901('0xa')](_0x1609bc[_0x4901('0x6')])['then'](function(_0x50e5c1){if(_0x50e5c1){_0x1609bc['type']=_0x50e5c1['type'];}utils[_0x4901('0xb')](_0x4901('0xc'),_0x1609bc);});}else{utils[_0x4901('0xb')]('CreateVoiceQueueReport',_0x1609bc);}if(_0x1609bc['transfereduniqueid']){delete queues[_0x1609bc['transfereduniqueid']];}else{delete queues[_0x1609bc[_0x4901('0x5')]];}}exports[_0x4901('0xd')]=function(_0x41cc86){try{utils['debug'](util[_0x4901('0x3')](_0x4901('0xe'),_0x41cc86[_0x4901('0x5')]),_0x41cc86);utils[_0x4901('0x2')](util[_0x4901('0x3')](_0x4901('0xf'),_0x41cc86[_0x4901('0x5')],_0x41cc86['queue'],_0x41cc86['position']));queues[_0x41cc86[_0x4901('0x5')]]=_[_0x4901('0x10')](_0x41cc86,{'originalposition':_0x41cc86[_0x4901('0x11')],'queuecallerjoinAt':utils[_0x4901('0x12')](),'mohtime':0x0});}catch(_0x54e36d){utils['error'](util[_0x4901('0x3')]('[%s][queues][queuecallerjoin]',_0x41cc86[_0x4901('0x5')]),_0x54e36d);}};exports[_0x4901('0x13')]=function(_0x5b1adc){try{if(!_['isNil'](queues[_0x5b1adc[_0x4901('0x5')]])){utils['debug'](util[_0x4901('0x3')]('[%s][queues][hangup]',_0x5b1adc[_0x4901('0x5')]),_0x5b1adc);if(queues[_0x5b1adc[_0x4901('0x5')]][_0x4901('0x14')]){if(!queues[_0x5b1adc[_0x4901('0x5')]][_0x4901('0x15')]&&!queues[_0x5b1adc[_0x4901('0x5')]][_0x4901('0x16')]){queues[_0x5b1adc[_0x4901('0x5')]][_0x4901('0x17')]=!![];queues[_0x5b1adc[_0x4901('0x5')]]['queuecallercompleteAt']=utils['now']();queues[_0x5b1adc[_0x4901('0x5')]][_0x4901('0x18')]=_0x4901('0x19');}utils[_0x4901('0x2')](util[_0x4901('0x3')](_0x4901('0x1a'),_0x5b1adc[_0x4901('0x5')],queues[_0x5b1adc[_0x4901('0x5')]][_0x4901('0x1b')],queues[_0x5b1adc[_0x4901('0x5')]][_0x4901('0x18')]));writeDB(queues[_0x5b1adc[_0x4901('0x5')]]);}else if(queues[_0x5b1adc[_0x4901('0x5')]][_0x4901('0x1c')]){utils[_0x4901('0x2')](util[_0x4901('0x3')](_0x4901('0x1d'),_0x5b1adc[_0x4901('0x5')],queues[_0x5b1adc[_0x4901('0x5')]][_0x4901('0x1b')],queues[_0x5b1adc[_0x4901('0x5')]][_0x4901('0x1c')]));queues[queues[_0x5b1adc['uniqueid']]['transfereduniqueid']]=queues[_0x5b1adc[_0x4901('0x5')]];queues[queues[_0x5b1adc[_0x4901('0x5')]][_0x4901('0x1c')]][_0x4901('0x1e')]=0x2;delete queues[_0x5b1adc['uniqueid']];}}}catch(_0x59bf6a){utils[_0x4901('0x1f')](util[_0x4901('0x3')](_0x4901('0x20'),_0x5b1adc[_0x4901('0x5')]),_0x59bf6a);}};exports[_0x4901('0x21')]=function(_0x824756){try{utils['debug'](util[_0x4901('0x3')]('[%s][queues][varset]',_0x824756['uniqueid']),_0x824756);if(!_[_0x4901('0x22')](_0x824756[_0x4901('0x23')][_0x4901('0x24')])&&_0x824756['value'][_0x4901('0x25')]()!=='CONTINUE'){if(!_['isNil'](queues[_0x824756[_0x4901('0x5')]])){queues[_0x824756[_0x4901('0x5')]][_0x4901('0x15')]=![];queues[_0x824756[_0x4901('0x5')]]['queuecallerabandonAt']=null;queues[_0x824756['uniqueid']][_0x4901('0x16')]=!![];queues[_0x824756[_0x4901('0x5')]][_0x4901('0x26')]=utils['now']();queues[_0x824756['uniqueid']][_0x4901('0x18')]=_0x824756[_0x4901('0x27')][_0x4901('0x25')]();utils[_0x4901('0x2')](util[_0x4901('0x3')]('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0x824756[_0x4901('0x5')],queues[_0x824756['uniqueid']][_0x4901('0x1b')],_0x824756[_0x4901('0x27')],queues[_0x824756[_0x4901('0x5')]][_0x4901('0x18')]));writeDB(queues[_0x824756['uniqueid']]);}}else if(!_['isNil'](_0x824756['variable'][_0x4901('0x28')])){if(!_[_0x4901('0x22')](queues[_0x824756[_0x4901('0x5')]])&&!queues[_0x824756[_0x4901('0x5')]]['queuecallerabandon']){queues[_0x824756[_0x4901('0x5')]][_0x4901('0x15')]=![];queues[_0x824756['uniqueid']][_0x4901('0x29')]=null;queues[_0x824756[_0x4901('0x5')]]['queuecallerexit']=!![];queues[_0x824756[_0x4901('0x5')]][_0x4901('0x26')]=utils[_0x4901('0x12')]();queues[_0x824756[_0x4901('0x5')]]['queuecallerexitreason']=_0x4901('0x2a');utils['info'](util['format'](_0x4901('0x2b'),_0x824756[_0x4901('0x5')],queues[_0x824756['uniqueid']][_0x4901('0x1b')],_0x824756[_0x4901('0x27')],queues[_0x824756[_0x4901('0x5')]][_0x4901('0x18')]));}}}catch(_0x38c169){utils[_0x4901('0x1f')](util[_0x4901('0x3')]('[%s][queues][varset]',_0x824756['uniqueid']),_0x38c169);}};exports[_0x4901('0x15')]=function(_0x2099ff){try{if(!_[_0x4901('0x22')](queues[_0x2099ff[_0x4901('0x5')]])){utils[_0x4901('0x2c')](util[_0x4901('0x3')](_0x4901('0x2d'),_0x2099ff[_0x4901('0x5')]),_0x2099ff);queues[_0x2099ff[_0x4901('0x5')]][_0x4901('0x16')]=![];queues[_0x2099ff[_0x4901('0x5')]][_0x4901('0x26')]=null;queues[_0x2099ff[_0x4901('0x5')]][_0x4901('0x15')]=!![];queues[_0x2099ff[_0x4901('0x5')]][_0x4901('0x29')]=utils[_0x4901('0x12')]();queues[_0x2099ff[_0x4901('0x5')]][_0x4901('0x18')]=_0x4901('0x2e');utils[_0x4901('0x2')](util[_0x4901('0x3')](_0x4901('0x2f'),_0x2099ff['uniqueid'],queues[_0x2099ff['uniqueid']][_0x4901('0x1b')],queues[_0x2099ff[_0x4901('0x5')]][_0x4901('0x18')]));}}catch(_0x20209a){utils['error'](util[_0x4901('0x3')](_0x4901('0x2d'),_0x2099ff['uniqueid']),_0x20209a);}};exports[_0x4901('0x30')]=function(_0x44d151){try{if(!_[_0x4901('0x22')](queues[_0x44d151[_0x4901('0x5')]])){utils[_0x4901('0x2c')](util[_0x4901('0x3')]('[%s][queues][queuecallerleave]',_0x44d151[_0x4901('0x5')]),_0x44d151);utils[_0x4901('0x2')](util[_0x4901('0x3')]('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x44d151['uniqueid'],queues[_0x44d151['uniqueid']][_0x4901('0x1b')],_0x44d151['connectedlinenum'],_0x44d151[_0x4901('0x31')]));queues[_0x44d151[_0x4901('0x5')]][_0x4901('0x30')]=!![];queues[_0x44d151[_0x4901('0x5')]][_0x4901('0x14')]=utils[_0x4901('0x12')]();queues[_0x44d151['uniqueid']][_0x4901('0x32')]=utils[_0x4901('0x33')](queues[_0x44d151[_0x4901('0x5')]][_0x4901('0x14')],queues[_0x44d151[_0x4901('0x5')]][_0x4901('0x34')]);queues[_0x44d151[_0x4901('0x5')]][_0x4901('0x11')]=_0x44d151[_0x4901('0x11')];queues[_0x44d151['uniqueid']][_0x4901('0x35')]=_0x44d151[_0x4901('0x35')];queues[_0x44d151[_0x4901('0x5')]]['connectedlinenum']=_0x44d151[_0x4901('0x36')];queues[_0x44d151[_0x4901('0x5')]][_0x4901('0x31')]=_0x44d151['connectedlinename'];}}catch(_0x5acbb4){utils['error'](util[_0x4901('0x3')](_0x4901('0x37'),_0x44d151['uniqueid']),_0x5acbb4);}};exports[_0x4901('0x38')]=function(_0x2e37a0){try{if(!_[_0x4901('0x22')](queues[_0x2e37a0[_0x4901('0x5')]])){utils[_0x4901('0x2c')](util[_0x4901('0x3')](_0x4901('0x39'),_0x2e37a0[_0x4901('0x5')]),_0x2e37a0);utils[_0x4901('0x2')](util['format'](_0x4901('0x3a'),_0x2e37a0[_0x4901('0x5')],queues[_0x2e37a0['uniqueid']][_0x4901('0x1b')],_0x2e37a0[_0x4901('0x3b')],_0x2e37a0[_0x4901('0x3c')]));queues[_0x2e37a0[_0x4901('0x5')]][_0x4901('0x15')]=![];queues[_0x2e37a0['uniqueid']][_0x4901('0x15')]=![];queues[_0x2e37a0[_0x4901('0x5')]][_0x4901('0x29')]=null;queues[_0x2e37a0[_0x4901('0x5')]][_0x4901('0x16')]=![];queues[_0x2e37a0['uniqueid']][_0x4901('0x18')]=null;queues[_0x2e37a0[_0x4901('0x5')]][_0x4901('0x26')]=null;queues[_0x2e37a0['uniqueid']][_0x4901('0x3d')]=!![];queues[_0x2e37a0['uniqueid']]['accountcode']=_0x2e37a0[_0x4901('0x3c')];queues[_0x2e37a0['uniqueid']][_0x4901('0x7')]=_0x2e37a0[_0x4901('0x3b')];}}catch(_0x859a45){utils[_0x4901('0x1f')](util['format'](_0x4901('0x39'),_0x2e37a0['uniqueid']),_0x859a45);}};exports[_0x4901('0x3e')]=function(_0x183579){try{if(!_[_0x4901('0x22')](queues[_0x183579[_0x4901('0x5')]])){if(queues[_0x183579[_0x4901('0x5')]][_0x4901('0x14')]){utils[_0x4901('0x2c')](util[_0x4901('0x3')]('[%s][queues][agentcomplete]',_0x183579[_0x4901('0x5')]),_0x183579);queues[_0x183579['uniqueid']]['queuecallerabandon']=![];queues[_0x183579[_0x4901('0x5')]]['queuecallerabandon']=![];queues[_0x183579['uniqueid']]['queuecallerabandonAt']=null;queues[_0x183579[_0x4901('0x5')]][_0x4901('0x16')]=![];queues[_0x183579[_0x4901('0x5')]][_0x4901('0x26')]=null;queues[_0x183579[_0x4901('0x5')]][_0x4901('0x3d')]=!![];queues[_0x183579[_0x4901('0x5')]][_0x4901('0x7')]=_0x183579[_0x4901('0x3b')];queues[_0x183579[_0x4901('0x5')]][_0x4901('0x17')]=!![];queues[_0x183579[_0x4901('0x5')]]['queuecallercompleteAt']=utils[_0x4901('0x12')]();if(_0x183579[_0x4901('0x3f')]==_0x4901('0x40')){if(!queues[_0x183579[_0x4901('0x5')]]['transfer']){queues[_0x183579['uniqueid']][_0x4901('0x18')]=_0x4901('0x41');}}else{queues[_0x183579[_0x4901('0x5')]][_0x4901('0x18')]=_0x4901('0x42')+_0x183579[_0x4901('0x3f')]['toUpperCase']();}utils[_0x4901('0x2')](util[_0x4901('0x3')](_0x4901('0x43'),_0x183579['uniqueid'],queues[_0x183579[_0x4901('0x5')]][_0x4901('0x1b')],_0x183579[_0x4901('0x3b')],queues[_0x183579[_0x4901('0x5')]]['queuecallerexitreason']));writeDB(queues[_0x183579['uniqueid']]);}}}catch(_0x5dff7b){utils['error'](util[_0x4901('0x3')](_0x4901('0x44'),_0x183579[_0x4901('0x5')]),_0x5dff7b);}};exports[_0x4901('0x45')]=function(_0x862463){try{if(!_['isNil'](queues[_0x862463[_0x4901('0x46')]])){utils[_0x4901('0x2c')](util['format'](_0x4901('0x47'),_0x862463[_0x4901('0x5')]),_0x862463);queues[_0x862463['transfereeuniqueid']][_0x4901('0x40')]=!![];queues[_0x862463['transfereeuniqueid']]['transfertype']=_0x4901('0x48');queues[_0x862463[_0x4901('0x46')]][_0x4901('0x49')]=_0x862463[_0x4901('0x4a')];queues[_0x862463[_0x4901('0x46')]][_0x4901('0x4b')]=_0x862463['transfereeuniqueid'];queues[_0x862463[_0x4901('0x46')]][_0x4901('0x18')]=_0x4901('0x4c');utils[_0x4901('0x2')](util[_0x4901('0x3')](_0x4901('0x4d'),_0x862463['uniqueid'],queues[_0x862463[_0x4901('0x46')]][_0x4901('0x1b')],_0x862463['transfereeuniqueid'],_0x862463[_0x4901('0x4a')]));}}catch(_0x42d9d5){utils[_0x4901('0x1f')](util[_0x4901('0x3')](_0x4901('0x47'),_0x862463[_0x4901('0x5')]),_0x42d9d5);}};exports[_0x4901('0x4e')]=function(_0x5d8411){try{utils[_0x4901('0x2c')](util['format']('[%s][queues][attendedtransfer]',_0x5d8411['origtransfereruniqueid']),_0x5d8411);if(_0x5d8411[_0x4901('0x4f')]==_0x5d8411[_0x4901('0x50')]){if(!_[_0x4901('0x22')](queues[_0x5d8411[_0x4901('0x51')]])){utils[_0x4901('0x2')](util['format'](_0x4901('0x52'),_0x5d8411['origtransfereruniqueid'],queues[_0x5d8411[_0x4901('0x51')]][_0x4901('0x1b')],_0x5d8411[_0x4901('0x53')]));queues[_0x5d8411[_0x4901('0x51')]][_0x4901('0x40')]=!![];queues[_0x5d8411['secondtransfererlinkedid']][_0x4901('0x54')]=_0x4901('0x55');queues[_0x5d8411[_0x4901('0x51')]][_0x4901('0x49')]=_0x5d8411[_0x4901('0x53')];queues[_0x5d8411[_0x4901('0x51')]]['transferuniqueid']=_0x5d8411['origtransfereruniqueid'];queues[_0x5d8411[_0x4901('0x51')]][_0x4901('0x18')]='ATTENDEDTRANSFER';}if(!_['isNil'](queues[_0x5d8411['origtransfererlinkedid']])){if(_0x5d8411['transfereelinkedid']&&queues[_0x5d8411[_0x4901('0x56')]]){queues[_0x5d8411[_0x4901('0x56')]][_0x4901('0x1e')]=0x1;queues[_0x5d8411[_0x4901('0x46')]]=_[_0x4901('0x57')](queues[_0x5d8411['transfereelinkedid']]);queues[_0x5d8411[_0x4901('0x46')]][_0x4901('0x1c')]=_0x5d8411[_0x4901('0x58')];queues[_0x5d8411[_0x4901('0x46')]][_0x4901('0x1e')]=0x2;queues[_0x5d8411[_0x4901('0x46')]]['calleridnum']=queues[_0x5d8411[_0x4901('0x51')]][_0x4901('0x8')];queues[_0x5d8411[_0x4901('0x46')]]['calleridname']=queues[_0x5d8411[_0x4901('0x51')]][_0x4901('0x59')];queues[_0x5d8411[_0x4901('0x46')]]['queuecallerjoinAt']=utils[_0x4901('0x12')]();queues[_0x5d8411[_0x4901('0x46')]][_0x4901('0x14')]=utils['now']();queues[_0x5d8411[_0x4901('0x46')]][_0x4901('0x32')]=0x0;queues[_0x5d8411['transfereeuniqueid']][_0x4901('0x5a')]=0x0;utils[_0x4901('0x2')](util[_0x4901('0x3')](_0x4901('0x5b'),_0x5d8411[_0x4901('0x4f')],queues[_0x5d8411[_0x4901('0x46')]][_0x4901('0x1b')],queues[_0x5d8411[_0x4901('0x46')]][_0x4901('0x8')],queues[_0x5d8411[_0x4901('0x46')]]['calleridname']));}else{utils[_0x4901('0x2')](util[_0x4901('0x3')](_0x4901('0x5c'),_0x5d8411[_0x4901('0x4f')],queues[_0x5d8411[_0x4901('0x50')]][_0x4901('0x1b')],_0x5d8411[_0x4901('0x51')]));queues[_0x5d8411[_0x4901('0x50')]][_0x4901('0x1c')]=_0x5d8411[_0x4901('0x51')];}}}else if(_0x5d8411[_0x4901('0x5d')]==_0x5d8411[_0x4901('0x51')]){if(!_[_0x4901('0x22')](queues[_0x5d8411[_0x4901('0x50')]])){utils['info'](util[_0x4901('0x3')](_0x4901('0x5e'),_0x5d8411[_0x4901('0x4f')],queues[_0x5d8411[_0x4901('0x50')]][_0x4901('0x1b')],_0x5d8411['secondtransfereruniqueid'],_0x5d8411[_0x4901('0x5f')]));queues[_0x5d8411[_0x4901('0x50')]][_0x4901('0x40')]=!![];queues[_0x5d8411[_0x4901('0x50')]][_0x4901('0x54')]=_0x4901('0x55');queues[_0x5d8411[_0x4901('0x50')]][_0x4901('0x49')]=_0x5d8411[_0x4901('0x5f')];queues[_0x5d8411[_0x4901('0x50')]]['transferuniqueid']=_0x5d8411[_0x4901('0x5d')];queues[_0x5d8411[_0x4901('0x50')]]['queuecallerexitreason']=_0x4901('0x60');}if(!_[_0x4901('0x22')](queues[_0x5d8411[_0x4901('0x51')]])){if(_0x5d8411[_0x4901('0x61')]&&queues[_0x5d8411[_0x4901('0x61')]]){queues[_0x5d8411['transfertargetlinkedid']]['queuecallerenterreason']=0x1;queues[_0x5d8411[_0x4901('0x58')]]=_[_0x4901('0x57')](queues[_0x5d8411[_0x4901('0x61')]]);queues[_0x5d8411[_0x4901('0x58')]][_0x4901('0x1c')]=_0x5d8411[_0x4901('0x58')];queues[_0x5d8411[_0x4901('0x58')]][_0x4901('0x1e')]=0x2;queues[_0x5d8411['transfertargetuniqueid']][_0x4901('0x8')]=queues[_0x5d8411[_0x4901('0x50')]][_0x4901('0x8')];queues[_0x5d8411[_0x4901('0x58')]]['calleridname']=queues[_0x5d8411[_0x4901('0x50')]]['calleridname'];queues[_0x5d8411['transfertargetuniqueid']][_0x4901('0x34')]=utils[_0x4901('0x12')]();queues[_0x5d8411[_0x4901('0x58')]]['queuecallerleaveAt']=utils[_0x4901('0x12')]();queues[_0x5d8411[_0x4901('0x58')]][_0x4901('0x32')]=0x0;queues[_0x5d8411[_0x4901('0x58')]]['mohtime']=0x0;utils[_0x4901('0x2')](util[_0x4901('0x3')](_0x4901('0x62'),_0x5d8411[_0x4901('0x4f')],queues[_0x5d8411[_0x4901('0x58')]]['name'],queues[_0x5d8411['transfertargetuniqueid']][_0x4901('0x1c')],queues[_0x5d8411[_0x4901('0x58')]][_0x4901('0x8')],queues[_0x5d8411['transfertargetuniqueid']][_0x4901('0x59')]));}else{utils['info'](util[_0x4901('0x3')](_0x4901('0x5c'),_0x5d8411['origtransfereruniqueid'],queues[_0x5d8411['secondtransfererlinkedid']]['name'],_0x5d8411[_0x4901('0x50')]));queues[_0x5d8411['secondtransfererlinkedid']][_0x4901('0x1c')]=_0x5d8411['origtransfererlinkedid'];}}}}catch(_0x3b998d){utils[_0x4901('0x1f')](util['format'](_0x4901('0x63'),_0x5d8411['origtransfereruniqueid']),_0x3b998d);}};exports[_0x4901('0x64')]=function(_0x5c52c6){try{if(!_[_0x4901('0x22')](queues[_0x5c52c6[_0x4901('0x5')]])){utils[_0x4901('0x2c')](util[_0x4901('0x3')](_0x4901('0x65'),_0x5c52c6[_0x4901('0x5')]),_0x5c52c6);queues[_0x5c52c6['uniqueid']][_0x4901('0x66')]=utils['now']();utils[_0x4901('0x2')](util[_0x4901('0x3')](_0x4901('0x67'),_0x5c52c6[_0x4901('0x5')],queues[_0x5c52c6[_0x4901('0x5')]][_0x4901('0x1b')],queues[_0x5c52c6['uniqueid']][_0x4901('0x66')]));}}catch(_0x95782){utils[_0x4901('0x1f')](util[_0x4901('0x3')](_0x4901('0x65'),_0x5c52c6[_0x4901('0x5')]),_0x95782);}};exports['musiconholdstop']=function(_0x2dafa7){try{if(!_[_0x4901('0x22')](queues[_0x2dafa7[_0x4901('0x5')]])){if(!_['isNil'](queues[_0x2dafa7[_0x4901('0x5')]][_0x4901('0x66')])){utils[_0x4901('0x2c')](util[_0x4901('0x3')](_0x4901('0x68'),_0x2dafa7['uniqueid']),_0x2dafa7);queues[_0x2dafa7[_0x4901('0x5')]][_0x4901('0x5a')]+=utils[_0x4901('0x33')](utils[_0x4901('0x12')](),queues[_0x2dafa7[_0x4901('0x5')]]['musiconholdstartAt']);utils['info'](util['format'](_0x4901('0x69'),_0x2dafa7[_0x4901('0x5')],queues[_0x2dafa7['uniqueid']]['name'],queues[_0x2dafa7[_0x4901('0x5')]][_0x4901('0x5a')]));delete queues[_0x2dafa7[_0x4901('0x5')]][_0x4901('0x66')];}}}catch(_0x2a698f){utils['error'](util[_0x4901('0x3')](_0x4901('0x68'),_0x2dafa7[_0x4901('0x5')]),_0x2a698f);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index ffd7a68..c815bea 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 _0x5361=['set','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','[%s][recordings][queuecallerjoin]','util','./utils','format','[%s][recordings][writeDB]','uniqueid','accountcode','getUserByInternal','then','name','UserId','request','CreateVoiceRecording','newchannel','[%s][recordings][newchannel]','linkedid','info','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','exten','context','channel','newstate','debug','[%s][recordings][newstate]','isNil','channelstate','transfer','error','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','replace','.WAV','find','monitors','push','hangup','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinename','type','outbound','connectedlinenum','forEach','clone','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','appdata','application','toLowerCase'];(function(_0x2ac388,_0xa35520){var _0x450e33=function(_0x56ba7a){while(--_0x56ba7a){_0x2ac388['push'](_0x2ac388['shift']());}};_0x450e33(++_0xa35520);}(_0x5361,0x148));var _0x1536=function(_0x411017,_0x4a8117){_0x411017=_0x411017-0x0;var _0x2adeea=_0x5361[_0x411017];return _0x2adeea;};'use strict';var _=require('lodash');var util=require(_0x1536('0x0'));var utils=require(_0x1536('0x1'));var recordings={};function writeDB(_0x2f013e){utils['info'](util[_0x1536('0x2')](_0x1536('0x3'),_0x2f013e[_0x1536('0x4')]));if(_0x2f013e[_0x1536('0x5')]){utils[_0x1536('0x6')](_0x2f013e['accountcode'])[_0x1536('0x7')](function(_0x5e8225){if(_0x5e8225){_0x2f013e['membername']=_0x5e8225[_0x1536('0x8')];_0x2f013e[_0x1536('0x9')]=_0x5e8225['id'];}utils[_0x1536('0xa')]('CreateVoiceRecording',_0x2f013e);});}else{utils[_0x1536('0xa')](_0x1536('0xb'),_0x2f013e);}}exports[_0x1536('0xc')]=function(_0x259f99){try{utils['debug'](util[_0x1536('0x2')](_0x1536('0xd'),_0x259f99[_0x1536('0x4')]),_0x259f99);if(_0x259f99['uniqueid']==_0x259f99[_0x1536('0xe')]){utils[_0x1536('0xf')](util[_0x1536('0x2')](_0x1536('0x10'),_0x259f99[_0x1536('0x4')],_0x259f99['context'],_0x259f99[_0x1536('0x11')]));recordings[_0x259f99['uniqueid']]={'uniqueid':_0x259f99['uniqueid'],'accountcode':_0x259f99[_0x1536('0x5')],'exten':_0x259f99[_0x1536('0x11')],'context':_0x259f99[_0x1536('0x12')],'channel':_0x259f99[_0x1536('0x13')],'monitors':[]};}}catch(_0x3d0da1){utils['error'](util[_0x1536('0x2')](_0x1536('0xd'),_0x259f99[_0x1536('0x4')]),_0x3d0da1);}};exports[_0x1536('0x14')]=function(_0x323b78){try{utils[_0x1536('0x15')](util[_0x1536('0x2')](_0x1536('0x16'),_0x323b78[_0x1536('0x4')]),_0x323b78);if(!_[_0x1536('0x17')](recordings[_0x323b78['uniqueid']])&&_0x323b78[_0x1536('0x18')]==0x6){utils['info'](util[_0x1536('0x2')]('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x323b78[_0x1536('0x4')],_0x323b78[_0x1536('0x12')],_0x323b78[_0x1536('0x13')]));}else if(!_['isNil'](recordings[_0x323b78[_0x1536('0xe')]])&&_0x323b78[_0x1536('0x18')]==0x6&&_0x323b78['context']!=_0x1536('0x19')){utils[_0x1536('0xf')](util['format']('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x323b78['uniqueid'],_0x323b78[_0x1536('0xe')],_0x323b78[_0x1536('0x12')],_0x323b78[_0x1536('0x13')]));recordings[_0x323b78[_0x1536('0xe')]]['accountcode']=_0x323b78[_0x1536('0x5')];}}catch(_0x5d1308){utils[_0x1536('0x1a')](util[_0x1536('0x2')]('[%s][recordings][newstate]',_0x323b78[_0x1536('0x4')]),_0x5d1308);}};exports['varset']=function(_0x1fe2ef){try{if(!_[_0x1536('0x17')](_0x1fe2ef[_0x1536('0x1b')])&&!_['isNil'](_0x1fe2ef['variable'][_0x1536('0x1c')])){utils[_0x1536('0x15')](util[_0x1536('0x2')](_0x1536('0x1d'),_0x1fe2ef[_0x1536('0x4')]),_0x1fe2ef);utils[_0x1536('0xf')](util[_0x1536('0x2')](_0x1536('0x1e'),_0x1fe2ef[_0x1536('0x4')],_0x1fe2ef[_0x1536('0x1b')],_0x1fe2ef[_0x1536('0x1f')]));if(_[_0x1536('0x20')](_0x1fe2ef[_0x1536('0x1f')],_0x1536('0x21'))){_0x1fe2ef[_0x1536('0x1f')]=_0x1fe2ef[_0x1536('0x1f')][_0x1536('0x22')](_0x1536('0x21'),_0x1536('0x23'));}if(recordings[_0x1fe2ef['linkedid']]){var _0x59b531=_[_0x1536('0x24')](recordings[_0x1fe2ef[_0x1536('0xe')]][_0x1536('0x25')],{'value':_0x1fe2ef[_0x1536('0x1f')]});if(_['isNil'](_0x59b531)){recordings[_0x1fe2ef[_0x1536('0xe')]][_0x1536('0x25')][_0x1536('0x26')]({'value':_0x1fe2ef[_0x1536('0x1f')]});}}}}catch(_0xb08256){utils[_0x1536('0x1a')](util[_0x1536('0x2')](_0x1536('0x1d'),_0x1fe2ef[_0x1536('0x4')]),_0xb08256);}};exports[_0x1536('0x27')]=function(_0x407089){try{if(!_[_0x1536('0x17')](recordings[_0x407089[_0x1536('0x4')]])){utils[_0x1536('0x15')](util[_0x1536('0x2')]('[%s][recordings][hangup]',_0x407089[_0x1536('0x4')]),_0x407089);utils[_0x1536('0xf')](util[_0x1536('0x2')](_0x1536('0x28'),_0x407089['uniqueid'],_0x407089[_0x1536('0x29')],_0x407089[_0x1536('0x2a')],_0x407089[_0x1536('0x2b')]));recordings[_0x407089[_0x1536('0x4')]][_0x1536('0x29')]=_0x407089[_0x1536('0x29')];recordings[_0x407089['uniqueid']][_0x1536('0x2a')]=_0x407089[_0x1536('0x2a')];recordings[_0x407089['uniqueid']]['connectedlinenum']=_0x407089['connectedlinenum'];recordings[_0x407089[_0x1536('0x4')]][_0x1536('0x2c')]=_0x407089[_0x1536('0x2c')];if(recordings[_0x407089['uniqueid']][_0x1536('0x2d')]==_0x1536('0x2e')&&recordings[_0x407089[_0x1536('0x4')]][_0x1536('0x5')]){recordings[_0x407089[_0x1536('0x4')]][_0x1536('0x2f')]=recordings[_0x407089[_0x1536('0x4')]][_0x1536('0x5')];recordings[_0x407089[_0x1536('0x4')]][_0x1536('0x2c')]='';}recordings[_0x407089['uniqueid']][_0x1536('0x25')][_0x1536('0x30')](function(_0xbde5b3){var _0x18d25c=_[_0x1536('0x31')](recordings[_0x407089[_0x1536('0x4')]]);_0x18d25c[_0x1536('0x1f')]=_0xbde5b3[_0x1536('0x1f')];writeDB(_0x18d25c);});delete recordings[_0x407089['uniqueid']];}}catch(_0x370c36){utils[_0x1536('0x1a')](util[_0x1536('0x2')]('[%s][recordings][hangup]',_0x407089[_0x1536('0x4')]),_0x370c36);}};exports[_0x1536('0x32')]=function(_0x1a753b){try{if(!_[_0x1536('0x17')](recordings[_0x1a753b[_0x1536('0x4')]])){utils[_0x1536('0x15')](util['format'](_0x1536('0x33'),_0x1a753b[_0x1536('0x4')]),_0x1a753b);utils['info'](util[_0x1536('0x2')](_0x1536('0x34'),_0x1a753b[_0x1536('0x4')],_0x1a753b['application'],_0x1a753b[_0x1536('0x35')]));if(_0x1a753b[_0x1536('0x36')][_0x1536('0x37')]()==_0x1536('0x38')&&_['startsWith'](_0x1a753b['appdata'][_0x1536('0x37')](),'cdr')){var _0xeb88d4=_0x1a753b['appdata'][_0x1536('0x39')]('=');var _0x442b8f=_0xeb88d4[0x0][_0x1536('0x3a')](_0xeb88d4[0x0][_0x1536('0x3b')]('(')+0x1,_0xeb88d4[0x0]['lastIndexOf'](')'));var _0x1e8a41=_0xeb88d4[0x1];recordings[_0x1a753b[_0x1536('0x4')]][_0x442b8f]=_0x1e8a41;}}}catch(_0x56360c){utils[_0x1536('0x1a')](util['format'](_0x1536('0x33'),_0x1a753b[_0x1536('0x4')]),_0x56360c);}};exports[_0x1536('0x3c')]=function(_0x261f90){try{if(!_[_0x1536('0x17')](recordings[_0x261f90[_0x1536('0x4')]])){utils[_0x1536('0x15')](util[_0x1536('0x2')]('[%s][recordings][queuecallerjoin]',_0x261f90[_0x1536('0x4')]),_0x261f90);utils[_0x1536('0xf')](util[_0x1536('0x2')](_0x1536('0x3d'),_0x261f90['uniqueid'],_0x261f90[_0x1536('0x3e')]));recordings[_0x261f90[_0x1536('0x4')]][_0x1536('0x3e')]=_0x261f90[_0x1536('0x3e')];}}catch(_0x5dee93){utils[_0x1536('0x1a')](util[_0x1536('0x2')](_0x1536('0x3f'),_0x261f90[_0x1536('0x4')]),_0x5dee93);}}; \ No newline at end of file +var _0x430f=['channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','variable','mixmonitor_filename','value','.wav49','replace','find','monitors','push','[%s][recordings][varset]','hangup','[%s][recordings][hangup]','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','type','outbound','forEach','clone','newexten','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','[%s][recordings][newexten]','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','lodash','util','info','format','[%s][recordings][writeDB]','uniqueid','accountcode','getUserByInternal','then','name','UserId','request','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','exten','context','channel','error','newstate','[%s][recordings][newstate]','isNil'];(function(_0xc78df3,_0xf1ca58){var _0x2893b7=function(_0x2483f5){while(--_0x2483f5){_0xc78df3['push'](_0xc78df3['shift']());}};_0x2893b7(++_0xf1ca58);}(_0x430f,0x131));var _0xf430=function(_0x50dbb5,_0x111e27){_0x50dbb5=_0x50dbb5-0x0;var _0x243c32=_0x430f[_0x50dbb5];return _0x243c32;};'use strict';var _=require(_0xf430('0x0'));var util=require(_0xf430('0x1'));var utils=require('./utils');var recordings={};function writeDB(_0x2877a7){utils[_0xf430('0x2')](util[_0xf430('0x3')](_0xf430('0x4'),_0x2877a7[_0xf430('0x5')]));if(_0x2877a7[_0xf430('0x6')]){utils[_0xf430('0x7')](_0x2877a7['accountcode'])[_0xf430('0x8')](function(_0xb04b97){if(_0xb04b97){_0x2877a7['membername']=_0xb04b97[_0xf430('0x9')];_0x2877a7[_0xf430('0xa')]=_0xb04b97['id'];}utils[_0xf430('0xb')](_0xf430('0xc'),_0x2877a7);});}else{utils[_0xf430('0xb')](_0xf430('0xc'),_0x2877a7);}}exports[_0xf430('0xd')]=function(_0x1608c3){try{utils[_0xf430('0xe')](util[_0xf430('0x3')](_0xf430('0xf'),_0x1608c3[_0xf430('0x5')]),_0x1608c3);if(_0x1608c3['uniqueid']==_0x1608c3[_0xf430('0x10')]){utils['info'](util['format'](_0xf430('0x11'),_0x1608c3['uniqueid'],_0x1608c3['context'],_0x1608c3[_0xf430('0x12')]));recordings[_0x1608c3['uniqueid']]={'uniqueid':_0x1608c3[_0xf430('0x5')],'accountcode':_0x1608c3[_0xf430('0x6')],'exten':_0x1608c3[_0xf430('0x12')],'context':_0x1608c3[_0xf430('0x13')],'channel':_0x1608c3[_0xf430('0x14')],'monitors':[]};}}catch(_0x2825f0){utils[_0xf430('0x15')](util[_0xf430('0x3')](_0xf430('0xf'),_0x1608c3[_0xf430('0x5')]),_0x2825f0);}};exports[_0xf430('0x16')]=function(_0x1254f2){try{utils['debug'](util['format'](_0xf430('0x17'),_0x1254f2[_0xf430('0x5')]),_0x1254f2);if(!_[_0xf430('0x18')](recordings[_0x1254f2[_0xf430('0x5')]])&&_0x1254f2[_0xf430('0x19')]==0x6){utils['info'](util['format'](_0xf430('0x1a'),_0x1254f2[_0xf430('0x5')],_0x1254f2[_0xf430('0x13')],_0x1254f2[_0xf430('0x14')]));}else if(!_[_0xf430('0x18')](recordings[_0x1254f2[_0xf430('0x10')]])&&_0x1254f2[_0xf430('0x19')]==0x6&&_0x1254f2[_0xf430('0x13')]!=_0xf430('0x1b')){utils[_0xf430('0x2')](util['format'](_0xf430('0x1c'),_0x1254f2[_0xf430('0x5')],_0x1254f2[_0xf430('0x10')],_0x1254f2[_0xf430('0x13')],_0x1254f2[_0xf430('0x14')]));recordings[_0x1254f2[_0xf430('0x10')]][_0xf430('0x6')]=_0x1254f2[_0xf430('0x6')];}}catch(_0x25d49f){utils[_0xf430('0x15')](util[_0xf430('0x3')]('[%s][recordings][newstate]',_0x1254f2[_0xf430('0x5')]),_0x25d49f);}};exports[_0xf430('0x1d')]=function(_0x44ad96){try{if(!_['isNil'](_0x44ad96[_0xf430('0x1e')])&&!_[_0xf430('0x18')](_0x44ad96[_0xf430('0x1e')][_0xf430('0x1f')])){utils[_0xf430('0xe')](util[_0xf430('0x3')]('[%s][recordings][varset]',_0x44ad96[_0xf430('0x5')]),_0x44ad96);utils[_0xf430('0x2')](util[_0xf430('0x3')]('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x44ad96['uniqueid'],_0x44ad96[_0xf430('0x1e')],_0x44ad96['value']));if(_['endsWith'](_0x44ad96[_0xf430('0x20')],_0xf430('0x21'))){_0x44ad96[_0xf430('0x20')]=_0x44ad96[_0xf430('0x20')][_0xf430('0x22')]('.wav49','.WAV');}if(recordings[_0x44ad96[_0xf430('0x10')]]){var _0x25d9f3=_[_0xf430('0x23')](recordings[_0x44ad96[_0xf430('0x10')]][_0xf430('0x24')],{'value':_0x44ad96['value']});if(_[_0xf430('0x18')](_0x25d9f3)){recordings[_0x44ad96[_0xf430('0x10')]][_0xf430('0x24')][_0xf430('0x25')]({'value':_0x44ad96[_0xf430('0x20')]});}}}}catch(_0x10c8df){utils[_0xf430('0x15')](util[_0xf430('0x3')](_0xf430('0x26'),_0x44ad96[_0xf430('0x5')]),_0x10c8df);}};exports[_0xf430('0x27')]=function(_0x39ce63){try{if(!_[_0xf430('0x18')](recordings[_0x39ce63[_0xf430('0x5')]])){utils['debug'](util[_0xf430('0x3')](_0xf430('0x28'),_0x39ce63['uniqueid']),_0x39ce63);utils[_0xf430('0x2')](util['format']('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x39ce63['uniqueid'],_0x39ce63[_0xf430('0x29')],_0x39ce63[_0xf430('0x2a')],_0x39ce63[_0xf430('0x2b')]));recordings[_0x39ce63[_0xf430('0x5')]][_0xf430('0x29')]=_0x39ce63[_0xf430('0x29')];recordings[_0x39ce63['uniqueid']][_0xf430('0x2a')]=_0x39ce63[_0xf430('0x2a')];recordings[_0x39ce63[_0xf430('0x5')]][_0xf430('0x2c')]=_0x39ce63[_0xf430('0x2c')];recordings[_0x39ce63[_0xf430('0x5')]][_0xf430('0x2d')]=_0x39ce63['connectedlinename'];if(recordings[_0x39ce63[_0xf430('0x5')]][_0xf430('0x2e')]==_0xf430('0x2f')&&recordings[_0x39ce63[_0xf430('0x5')]][_0xf430('0x6')]){recordings[_0x39ce63['uniqueid']][_0xf430('0x2c')]=recordings[_0x39ce63[_0xf430('0x5')]]['accountcode'];recordings[_0x39ce63['uniqueid']]['connectedlinename']='';}recordings[_0x39ce63[_0xf430('0x5')]][_0xf430('0x24')][_0xf430('0x30')](function(_0x58b058){var _0x5f52e0=_[_0xf430('0x31')](recordings[_0x39ce63[_0xf430('0x5')]]);_0x5f52e0[_0xf430('0x20')]=_0x58b058[_0xf430('0x20')];writeDB(_0x5f52e0);});delete recordings[_0x39ce63[_0xf430('0x5')]];}}catch(_0x275f8a){utils[_0xf430('0x15')](util[_0xf430('0x3')](_0xf430('0x28'),_0x39ce63[_0xf430('0x5')]),_0x275f8a);}};exports[_0xf430('0x32')]=function(_0x43b63c){try{if(!_['isNil'](recordings[_0x43b63c['uniqueid']])){utils[_0xf430('0xe')](util[_0xf430('0x3')]('[%s][recordings][newexten]',_0x43b63c['uniqueid']),_0x43b63c);utils[_0xf430('0x2')](util[_0xf430('0x3')](_0xf430('0x33'),_0x43b63c[_0xf430('0x5')],_0x43b63c[_0xf430('0x34')],_0x43b63c[_0xf430('0x35')]));if(_0x43b63c[_0xf430('0x34')][_0xf430('0x36')]()==_0xf430('0x37')&&_[_0xf430('0x38')](_0x43b63c['appdata'][_0xf430('0x36')](),_0xf430('0x39'))){var _0x1853aa=_0x43b63c[_0xf430('0x35')][_0xf430('0x3a')]('=');var _0x456741=_0x1853aa[0x0][_0xf430('0x3b')](_0x1853aa[0x0][_0xf430('0x3c')]('(')+0x1,_0x1853aa[0x0][_0xf430('0x3c')](')'));var _0x300efb=_0x1853aa[0x1];recordings[_0x43b63c[_0xf430('0x5')]][_0x456741]=_0x300efb;}}}catch(_0x3b6ec6){utils[_0xf430('0x15')](util[_0xf430('0x3')](_0xf430('0x3d'),_0x43b63c['uniqueid']),_0x3b6ec6);}};exports[_0xf430('0x3e')]=function(_0x2c5894){try{if(!_[_0xf430('0x18')](recordings[_0x2c5894[_0xf430('0x5')]])){utils[_0xf430('0xe')](util[_0xf430('0x3')](_0xf430('0x3f'),_0x2c5894[_0xf430('0x5')]),_0x2c5894);utils[_0xf430('0x2')](util[_0xf430('0x3')](_0xf430('0x40'),_0x2c5894['uniqueid'],_0x2c5894[_0xf430('0x41')]));recordings[_0x2c5894[_0xf430('0x5')]][_0xf430('0x41')]=_0x2c5894[_0xf430('0x41')];}}catch(_0x5dd95e){utils[_0xf430('0x15')](util[_0xf430('0x3')](_0xf430('0x3f'),_0x2c5894[_0xf430('0x5')]),_0x5dd95e);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 57ddf50..c5c853b 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 _0xfc44=['CreateVoiceTransferReport','debug','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridname','transfereecalleridnum','transfereecalleridname','error','attendedtransfer','[%s][transfers][attendedtransfer]','info','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','secondtransfererconnectedlinenum','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfereechannel','transfertargetchannel','transfertargetconnectedlinenum','transfertargetaccountcode','lodash','util','./utils','format','[%s][transfers][writeDB]\x20type:%s','attended','origtransfereruniqueid','uniqueid','type','request'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0xfc44,0x18d));var _0x4fc4=function(_0x11ee5d,_0x253ad5){_0x11ee5d=_0x11ee5d-0x0;var _0x34352e=_0xfc44[_0x11ee5d];return _0x34352e;};'use strict';var _=require(_0x4fc4('0x0'));var util=require(_0x4fc4('0x1'));var utils=require(_0x4fc4('0x2'));function writeDB(_0x50706){utils['info'](util[_0x4fc4('0x3')](_0x4fc4('0x4'),_0x50706['type']===_0x4fc4('0x5')?_0x50706[_0x4fc4('0x6')]:_0x50706[_0x4fc4('0x7')],_0x50706[_0x4fc4('0x8')]));utils[_0x4fc4('0x9')](_0x4fc4('0xa'),_0x50706);}exports['blindtransfer']=function(_0x4ba192){try{utils[_0x4fc4('0xb')](util[_0x4fc4('0x3')](_0x4fc4('0xc'),_0x4ba192['uniqueid']),_0x4ba192);utils['info'](util['format'](_0x4fc4('0xd'),_0x4ba192[_0x4fc4('0x7')],_0x4ba192['transferercalleridnum'],_0x4ba192[_0x4fc4('0xe')],_0x4ba192[_0x4fc4('0xf')],_0x4ba192[_0x4fc4('0x10')]));_0x4ba192['type']='blind';writeDB(_0x4ba192);}catch(_0x2b0127){utils[_0x4fc4('0x11')](util[_0x4fc4('0x3')](_0x4fc4('0xc'),_0x4ba192['uniqueid']),_0x2b0127);}};exports[_0x4fc4('0x12')]=function(_0x2d38dd){try{utils['debug'](util['format'](_0x4fc4('0x13'),_0x2d38dd['origtransfereruniqueid']),_0x2d38dd);utils[_0x4fc4('0x14')](util[_0x4fc4('0x3')](_0x4fc4('0x15'),_0x2d38dd[_0x4fc4('0x6')],_0x2d38dd[_0x4fc4('0x16')],_0x2d38dd[_0x4fc4('0x17')],_0x2d38dd[_0x4fc4('0x18')],_0x2d38dd[_0x4fc4('0x19')]));_0x2d38dd=_[_0x4fc4('0x1a')](_0x2d38dd,{'transfererchannel':_0x2d38dd[_0x4fc4('0x1b')],'transferercalleridnum':_0x2d38dd[_0x4fc4('0x16')],'transferercalleridname':_0x2d38dd['origtransferercalleridname'],'transfererconnectedlinenum':_0x2d38dd[_0x4fc4('0x1c')],'transfererconnectedlinename':_0x2d38dd['secondtransfererconnectedlinename'],'transfereraccountcode':_0x2d38dd['origtransfereraccountcode'],'transferercontext':_0x2d38dd['secondtransferercontext'],'transfererexten':_0x2d38dd['secondtransfererexten'],'transfererlinkedid':_0x2d38dd[_0x4fc4('0x1d')],'context':_0x2d38dd[_0x4fc4('0x1e')],'extension':_0x2d38dd[_0x4fc4('0x1f')],'type':'attended'});if(_[_0x4fc4('0x20')](_0x2d38dd[_0x4fc4('0x21')])){_0x2d38dd=_['assign'](_0x2d38dd,{'transfereechannel':_0x2d38dd[_0x4fc4('0x22')],'transfereecalleridnum':_0x2d38dd[_0x4fc4('0x18')],'transfereecalleridname':_0x2d38dd[_0x4fc4('0x19')],'transfereeconnectedlinenum':_0x2d38dd[_0x4fc4('0x23')],'transfereeconnectedlinename':_0x2d38dd['transfertargetconnectedlinename'],'transfereeaccountcode':_0x2d38dd[_0x4fc4('0x24')],'transfereecontext':_0x2d38dd['transfertargetcontext'],'transfereeexten':_0x2d38dd['transfertargetexten'],'transfereelinkedid':_0x2d38dd['transfertargetlinkedid']});}writeDB(_0x2d38dd);}catch(_0x4101d4){utils['error'](util['format'](_0x4fc4('0x13'),_0x2d38dd[_0x4fc4('0x6')]),_0x4101d4);}}; \ No newline at end of file +var _0xbcfd=['blind','error','attendedtransfer','[%s][transfers][attendedtransfer]','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransferercalleridname','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererexten','isNil','transfereechannel','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetlinkedid','util','./utils','info','format','attended','origtransfereruniqueid','uniqueid','type','request','debug','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridname'];(function(_0x1b0307,_0x4336b1){var _0x5c8d34=function(_0x5b1b61){while(--_0x5b1b61){_0x1b0307['push'](_0x1b0307['shift']());}};_0x5c8d34(++_0x4336b1);}(_0xbcfd,0xc9));var _0xdbcf=function(_0x713bd8,_0x2f3a74){_0x713bd8=_0x713bd8-0x0;var _0x5085ec=_0xbcfd[_0x713bd8];return _0x5085ec;};'use strict';var _=require('lodash');var util=require(_0xdbcf('0x0'));var utils=require(_0xdbcf('0x1'));function writeDB(_0x507aba){utils[_0xdbcf('0x2')](util[_0xdbcf('0x3')]('[%s][transfers][writeDB]\x20type:%s',_0x507aba['type']===_0xdbcf('0x4')?_0x507aba[_0xdbcf('0x5')]:_0x507aba[_0xdbcf('0x6')],_0x507aba[_0xdbcf('0x7')]));utils[_0xdbcf('0x8')]('CreateVoiceTransferReport',_0x507aba);}exports['blindtransfer']=function(_0x56cece){try{utils[_0xdbcf('0x9')](util[_0xdbcf('0x3')](_0xdbcf('0xa'),_0x56cece[_0xdbcf('0x6')]),_0x56cece);utils['info'](util[_0xdbcf('0x3')](_0xdbcf('0xb'),_0x56cece[_0xdbcf('0x6')],_0x56cece[_0xdbcf('0xc')],_0x56cece[_0xdbcf('0xd')],_0x56cece['transfereecalleridnum'],_0x56cece[_0xdbcf('0xe')]));_0x56cece[_0xdbcf('0x7')]=_0xdbcf('0xf');writeDB(_0x56cece);}catch(_0x5063ea){utils[_0xdbcf('0x10')](util['format'](_0xdbcf('0xa'),_0x56cece[_0xdbcf('0x6')]),_0x5063ea);}};exports[_0xdbcf('0x11')]=function(_0x137b58){try{utils['debug'](util['format'](_0xdbcf('0x12'),_0x137b58[_0xdbcf('0x5')]),_0x137b58);utils[_0xdbcf('0x2')](util[_0xdbcf('0x3')]('[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x137b58[_0xdbcf('0x5')],_0x137b58['origtransferercalleridnum'],_0x137b58['origtransferercalleridname'],_0x137b58[_0xdbcf('0x13')],_0x137b58[_0xdbcf('0x14')]));_0x137b58=_[_0xdbcf('0x15')](_0x137b58,{'transfererchannel':_0x137b58['origtransfererchannel'],'transferercalleridnum':_0x137b58['origtransferercalleridnum'],'transferercalleridname':_0x137b58[_0xdbcf('0x16')],'transfererconnectedlinenum':_0x137b58[_0xdbcf('0x17')],'transfererconnectedlinename':_0x137b58['secondtransfererconnectedlinename'],'transfereraccountcode':_0x137b58[_0xdbcf('0x18')],'transferercontext':_0x137b58[_0xdbcf('0x19')],'transfererexten':_0x137b58[_0xdbcf('0x1a')],'transfererlinkedid':_0x137b58['origtransfererlinkedid'],'context':_0x137b58['origtransferercontext'],'extension':_0x137b58[_0xdbcf('0x1b')],'type':'attended'});if(_[_0xdbcf('0x1c')](_0x137b58[_0xdbcf('0x1d')])){_0x137b58=_[_0xdbcf('0x15')](_0x137b58,{'transfereechannel':_0x137b58[_0xdbcf('0x1e')],'transfereecalleridnum':_0x137b58[_0xdbcf('0x13')],'transfereecalleridname':_0x137b58[_0xdbcf('0x14')],'transfereeconnectedlinenum':_0x137b58[_0xdbcf('0x1f')],'transfereeconnectedlinename':_0x137b58[_0xdbcf('0x20')],'transfereeaccountcode':_0x137b58[_0xdbcf('0x21')],'transfereecontext':_0x137b58[_0xdbcf('0x22')],'transfereeexten':_0x137b58['transfertargetexten'],'transfereelinkedid':_0x137b58[_0xdbcf('0x23')]});}writeDB(_0x137b58);}catch(_0x278437){utils[_0xdbcf('0x10')](util[_0xdbcf('0x3')](_0xdbcf('0x12'),_0x137b58[_0xdbcf('0x5')]),_0x278437);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index e5c93f1..dbc2542 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 _0x3a0b=['result','length','getUserByInternal','info','[utils][getUserByInternal]\x20internal:%s\x20%s','notfound','[utils][getUserByInternal]','getUserByInterface','found','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','add','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','seconds','diffTime','diff','sumTime','isAfter','isBefore','bluebird','jayson/promise','moment','util','client','inspect','debug','error','request','catch','[utils][request]\x20name:%s','internal','name','then','[utils][getUser]\x20where:%s','stringify'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x3a0b,0x7a));var _0xb3a0=function(_0x47a349,_0x4699d9){_0x47a349=_0x47a349-0x0;var _0x18ab75=_0x3a0b[_0x47a349];return _0x18ab75;};'use strict';var BPromise=require(_0xb3a0('0x0'));var jayson=require(_0xb3a0('0x1'));var moment=require(_0xb3a0('0x2'));var util=require(_0xb3a0('0x3'));var client=jayson[_0xb3a0('0x4')]['http']({'port':0x2329});var logger=require('../../config/logger')('xdr');exports['info']=function(_0x43ba7b,_0x332518){logger['info'](_0x43ba7b,_0x332518?util[_0xb3a0('0x5')](_0x332518,{'showHidden':![],'depth':null}):'');};exports[_0xb3a0('0x6')]=function(_0x2755e7,_0x33eb4c){logger[_0xb3a0('0x6')](_0x2755e7,_0x33eb4c?util[_0xb3a0('0x5')](_0x33eb4c,{'showHidden':![],'depth':null}):'');};exports[_0xb3a0('0x7')]=function(_0x220139,_0x4cff00){logger[_0xb3a0('0x7')](_0x220139,_0x4cff00?util[_0xb3a0('0x5')](_0x4cff00,{'showHidden':![],'depth':null}):'');};exports[_0xb3a0('0x8')]=function(_0x34504d,_0x14dd6d){return client[_0xb3a0('0x8')](_0x34504d,{'body':_0x14dd6d})['then'](function(_0x517e62){logger['debug']('[utils][request]\x20name:%s',_0x34504d,_0x517e62?util['inspect'](_0x517e62,{'showHidden':![],'depth':null}):'');})[_0xb3a0('0x9')](function(_0x3c7efb){logger[_0xb3a0('0x7')](_0xb3a0('0xa'),_0x34504d,_0x3c7efb?util['inspect'](_0x3c7efb,{'showHidden':![],'depth':null}):'');});};function getUser(_0x44b98f){return client[_0xb3a0('0x8')]('GetUser',{'options':{'raw':!![],'attributes':['id',_0xb3a0('0xb'),_0xb3a0('0xc'),'interface'],'where':_0x44b98f,'limit':0x1}})[_0xb3a0('0xd')](function(_0x81337){logger['debug'](_0xb3a0('0xe'),JSON[_0xb3a0('0xf')](_0x44b98f),_0x81337?util[_0xb3a0('0x5')](_0x81337,{'showHidden':![],'depth':null}):'');return _0x81337[_0xb3a0('0x10')][_0xb3a0('0x11')]?_0x81337['result'][0x0]:null;});}exports[_0xb3a0('0x12')]=function(_0x41baab){return new BPromise(function(_0x450229,_0x4f8d80){if(_0x41baab){return getUser({'internal':_0x41baab})['then'](function(_0x123ddf){logger[_0xb3a0('0x13')](_0xb3a0('0x14'),_0x41baab,_0x123ddf?'found':_0xb3a0('0x15'));return _0x450229(_0x123ddf);})[_0xb3a0('0x9')](function(_0x3dfbf0){logger['error'](_0xb3a0('0x16'),_0x3dfbf0?util[_0xb3a0('0x5')](_0x3dfbf0,{'showHidden':![],'depth':null}):'');return _0x450229(null);});}return _0x450229(null);});};exports[_0xb3a0('0x17')]=function(_0x271a4b){return new BPromise(function(_0x5ee160,_0x13b426){if(_0x271a4b){return getUser({'interface':_0x271a4b})[_0xb3a0('0xd')](function(_0x59f737){logger['info']('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x271a4b,_0x59f737?_0xb3a0('0x18'):_0xb3a0('0x15'));return _0x5ee160(_0x59f737);})['catch'](function(_0x3edfb0){logger[_0xb3a0('0x7')]('[utils][getUserByInterface]',_0x3edfb0?util[_0xb3a0('0x5')](_0x3edfb0,{'showHidden':![],'depth':null}):'');return _0x5ee160(null);});}return _0x5ee160(null);});};exports[_0xb3a0('0x19')]=function(_0x3f74de){return new BPromise(function(_0x17bbc2,_0x3c972f){if(_0x3f74de){return getUser({'name':_0x3f74de})['then'](function(_0x5e0203){logger[_0xb3a0('0x13')](_0xb3a0('0x1a'),_0x3f74de,_0x5e0203?_0xb3a0('0x18'):'notfound');return _0x17bbc2(_0x5e0203);})[_0xb3a0('0x9')](function(_0x31de05){logger[_0xb3a0('0x7')](_0xb3a0('0x1b'),_0x31de05?util['inspect'](_0x31de05,{'showHidden':![],'depth':null}):'');return _0x17bbc2(null);});}return _0x17bbc2(null);});};exports[_0xb3a0('0x1c')]=function(_0x2cfd7f){return new BPromise(function(_0x314ab1,_0x362dce){if(_0x2cfd7f){return client[_0xb3a0('0x8')]('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id','name',_0xb3a0('0x1d'),_0xb3a0('0x1e'),_0xb3a0('0x1f')],'where':{'name':_0x2cfd7f},'limit':0x1}})['then'](function(_0x3d59f4){logger['debug']('[utils][getVoiceQueueByName]\x20name:%s',_0x2cfd7f,_0x3d59f4?util[_0xb3a0('0x5')](_0x3d59f4,{'showHidden':![],'depth':null}):'');logger[_0xb3a0('0x13')](_0xb3a0('0x20'),_0x2cfd7f,_0x3d59f4?_0xb3a0('0x18'):_0xb3a0('0x15'));return _0x314ab1(_0x3d59f4[_0xb3a0('0x10')][_0xb3a0('0x11')]?_0x3d59f4[_0xb3a0('0x10')][0x0]:null);})[_0xb3a0('0x9')](function(_0xf93c2a){logger[_0xb3a0('0x7')](_0xb3a0('0x21'),_0xf93c2a?util[_0xb3a0('0x5')](_0xf93c2a,{'showHidden':![],'depth':null}):'');return _0x314ab1(null);});}return _0x314ab1(null);});};exports[_0xb3a0('0x22')]=function(_0x4e598c,_0x2cfc1f){return moment(_0x4e598c)[_0xb3a0('0x23')](_0x2cfc1f,'seconds')[_0xb3a0('0x24')](_0xb3a0('0x25'));};exports[_0xb3a0('0x26')]=function(_0x1f3788,_0x281da8){return moment(_0x1f3788)[_0xb3a0('0x27')](_0x281da8,_0xb3a0('0x28'))['format'](_0xb3a0('0x25'));};exports[_0xb3a0('0x29')]=function(_0x31b744,_0x246fc7){return moment(_0x31b744)[_0xb3a0('0x2a')](moment(_0x246fc7),_0xb3a0('0x28'));};exports[_0xb3a0('0x2b')]=function(_0x25fbd1,_0x4e0551){return parseInt(_0x25fbd1,0xa)+parseInt(_0x4e0551,0xa);};exports['now']=function(){return moment()[_0xb3a0('0x24')](_0xb3a0('0x25'));};exports[_0xb3a0('0x2c')]=function(_0x24ffff,_0x55c018){if(_0x55c018){return moment(_0x24ffff)['isAfter'](_0x55c018);}return!![];};exports['isBefore']=function(_0x42767e,_0x1a8d2e){if(_0x1a8d2e){return moment(_0x42767e)[_0xb3a0('0x2d')](_0x1a8d2e);}else if(_0x42767e){return!![];}return![];}; \ No newline at end of file +var _0x752c=['xdr','info','debug','inspect','error','request','then','[utils][request]\x20name:%s','GetUser','internal','name','[utils][getUser]\x20where:%s','stringify','result','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','catch','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]','GetVoiceQueue','type','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s\x20%s','length','[utils][getVoiceQueueByName]','add','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','seconds','format','diffTime','diff','sumTime','now','isAfter','isBefore','bluebird','jayson/promise','moment','client','http','../../config/logger'];(function(_0x45f951,_0x2750c8){var _0x24756c=function(_0x31c931){while(--_0x31c931){_0x45f951['push'](_0x45f951['shift']());}};_0x24756c(++_0x2750c8);}(_0x752c,0x10e));var _0xc752=function(_0x599718,_0x249dc4){_0x599718=_0x599718-0x0;var _0x58b842=_0x752c[_0x599718];return _0x58b842;};'use strict';var BPromise=require(_0xc752('0x0'));var jayson=require(_0xc752('0x1'));var moment=require(_0xc752('0x2'));var util=require('util');var client=jayson[_0xc752('0x3')][_0xc752('0x4')]({'port':0x2329});var logger=require(_0xc752('0x5'))(_0xc752('0x6'));exports[_0xc752('0x7')]=function(_0x30ab00,_0x18c3a4){logger['info'](_0x30ab00,_0x18c3a4?util['inspect'](_0x18c3a4,{'showHidden':![],'depth':null}):'');};exports[_0xc752('0x8')]=function(_0x317f37,_0x3e75d7){logger[_0xc752('0x8')](_0x317f37,_0x3e75d7?util[_0xc752('0x9')](_0x3e75d7,{'showHidden':![],'depth':null}):'');};exports[_0xc752('0xa')]=function(_0x101d54,_0x63be54){logger['error'](_0x101d54,_0x63be54?util[_0xc752('0x9')](_0x63be54,{'showHidden':![],'depth':null}):'');};exports[_0xc752('0xb')]=function(_0xd6c726,_0xbd0326){return client[_0xc752('0xb')](_0xd6c726,{'body':_0xbd0326})[_0xc752('0xc')](function(_0x35993f){logger[_0xc752('0x8')]('[utils][request]\x20name:%s',_0xd6c726,_0x35993f?util['inspect'](_0x35993f,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x52d75e){logger[_0xc752('0xa')](_0xc752('0xd'),_0xd6c726,_0x52d75e?util[_0xc752('0x9')](_0x52d75e,{'showHidden':![],'depth':null}):'');});};function getUser(_0x1c21ba){return client[_0xc752('0xb')](_0xc752('0xe'),{'options':{'raw':!![],'attributes':['id',_0xc752('0xf'),_0xc752('0x10'),'interface'],'where':_0x1c21ba,'limit':0x1}})[_0xc752('0xc')](function(_0x33a4b9){logger[_0xc752('0x8')](_0xc752('0x11'),JSON[_0xc752('0x12')](_0x1c21ba),_0x33a4b9?util[_0xc752('0x9')](_0x33a4b9,{'showHidden':![],'depth':null}):'');return _0x33a4b9[_0xc752('0x13')]['length']?_0x33a4b9[_0xc752('0x13')][0x0]:null;});}exports['getUserByInternal']=function(_0xd85890){return new BPromise(function(_0xb8accb,_0xdc262c){if(_0xd85890){return getUser({'internal':_0xd85890})[_0xc752('0xc')](function(_0x33ba53){logger[_0xc752('0x7')](_0xc752('0x14'),_0xd85890,_0x33ba53?_0xc752('0x15'):_0xc752('0x16'));return _0xb8accb(_0x33ba53);})[_0xc752('0x17')](function(_0x194b85){logger[_0xc752('0xa')]('[utils][getUserByInternal]',_0x194b85?util[_0xc752('0x9')](_0x194b85,{'showHidden':![],'depth':null}):'');return _0xb8accb(null);});}return _0xb8accb(null);});};exports['getUserByInterface']=function(_0x2d9cd4){return new BPromise(function(_0x4964dc,_0x1a4f0a){if(_0x2d9cd4){return getUser({'interface':_0x2d9cd4})['then'](function(_0x1cd01e){logger[_0xc752('0x7')](_0xc752('0x18'),_0x2d9cd4,_0x1cd01e?_0xc752('0x15'):'notfound');return _0x4964dc(_0x1cd01e);})[_0xc752('0x17')](function(_0x231b32){logger['error'](_0xc752('0x19'),_0x231b32?util['inspect'](_0x231b32,{'showHidden':![],'depth':null}):'');return _0x4964dc(null);});}return _0x4964dc(null);});};exports[_0xc752('0x1a')]=function(_0x124d3e){return new BPromise(function(_0x517282,_0x16b25f){if(_0x124d3e){return getUser({'name':_0x124d3e})['then'](function(_0x91ef54){logger[_0xc752('0x7')]('[utils][getUserByName]\x20name:%s\x20%s',_0x124d3e,_0x91ef54?_0xc752('0x15'):_0xc752('0x16'));return _0x517282(_0x91ef54);})['catch'](function(_0x63760d){logger[_0xc752('0xa')](_0xc752('0x1b'),_0x63760d?util[_0xc752('0x9')](_0x63760d,{'showHidden':![],'depth':null}):'');return _0x517282(null);});}return _0x517282(null);});};exports['getVoiceQueueByName']=function(_0x425844){return new BPromise(function(_0x16e78a,_0x17fa37){if(_0x425844){return client[_0xc752('0xb')](_0xc752('0x1c'),{'options':{'raw':!![],'attributes':['id',_0xc752('0x10'),_0xc752('0x1d'),'acw',_0xc752('0x1e')],'where':{'name':_0x425844},'limit':0x1}})[_0xc752('0xc')](function(_0x735dc4){logger['debug']('[utils][getVoiceQueueByName]\x20name:%s',_0x425844,_0x735dc4?util[_0xc752('0x9')](_0x735dc4,{'showHidden':![],'depth':null}):'');logger['info'](_0xc752('0x1f'),_0x425844,_0x735dc4?_0xc752('0x15'):_0xc752('0x16'));return _0x16e78a(_0x735dc4['result'][_0xc752('0x20')]?_0x735dc4['result'][0x0]:null);})[_0xc752('0x17')](function(_0x4a854c){logger[_0xc752('0xa')](_0xc752('0x21'),_0x4a854c?util[_0xc752('0x9')](_0x4a854c,{'showHidden':![],'depth':null}):'');return _0x16e78a(null);});}return _0x16e78a(null);});};exports['addTime']=function(_0x199ccd,_0x55465e){return moment(_0x199ccd)[_0xc752('0x22')](_0x55465e,'seconds')['format'](_0xc752('0x23'));};exports[_0xc752('0x24')]=function(_0x3f2aa8,_0x3e7993){return moment(_0x3f2aa8)[_0xc752('0x25')](_0x3e7993,_0xc752('0x26'))[_0xc752('0x27')](_0xc752('0x23'));};exports[_0xc752('0x28')]=function(_0x4dc76b,_0x4f916f){return moment(_0x4dc76b)[_0xc752('0x29')](moment(_0x4f916f),'seconds');};exports[_0xc752('0x2a')]=function(_0x402331,_0x12c137){return parseInt(_0x402331,0xa)+parseInt(_0x12c137,0xa);};exports[_0xc752('0x2b')]=function(){return moment()['format'](_0xc752('0x23'));};exports[_0xc752('0x2c')]=function(_0x529efa,_0x12edb4){if(_0x12edb4){return moment(_0x529efa)[_0xc752('0x2c')](_0x12edb4);}return!![];};exports[_0xc752('0x2d')]=function(_0x2fd2d1,_0xfe705){if(_0xfe705){return moment(_0x2fd2d1)[_0xc752('0x2d')](_0xfe705);}else if(_0x2fd2d1){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 ccfcd38..2553019 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 _0x4375=['remoteAddress','url','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','statusCode','responseTime','other','agent_id','agent_name','lodash','express-winston','path','./loggers','./safe-template','safeTemplate','./mask-sensitive-data','join','log','xcally','client','role','name','ensureDir','then','catch','user','no-user','data','error','api','set','client-side-logger','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','format','method','headers','x-forwarded-for'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x4375,0xb7));var _0x5437=function(_0xaa0348,_0x1c16c7){_0xaa0348=_0xaa0348-0x0;var _0xd0df87=_0x4375[_0xaa0348];return _0xd0df87;};var fs=require('fs-extra');var _=require(_0x5437('0x0'));var ewinston=require(_0x5437('0x1'));var path=require(_0x5437('0x2'));var util=require('util');var fileLogger=require(_0x5437('0x3'))['fileLogger'];var safeTemplate=require(_0x5437('0x4'))[_0x5437('0x5')];var maskSensitiveData=require(_0x5437('0x6'))['maskSensitiveData'];function ClientSideLogger(){function _0x46fbaf(_0x138b8d){var _0x3ce0de=path[_0x5437('0x7')]('/var',_0x5437('0x8'),_0x5437('0x9'));var _0x1d6a07=path[_0x5437('0x7')](_0x5437('0xa'),_0x138b8d[_0x5437('0xb')]+'-'+_0x138b8d[_0x5437('0xc')]);return fs[_0x5437('0xd')](path[_0x5437('0x7')](_0x3ce0de,_0x1d6a07))[_0x5437('0xe')](function(){var _0x582b24=fileLogger(_0x5437('0xa'),path[_0x5437('0x7')](_0x3ce0de,_0x1d6a07));return _0x582b24;})[_0x5437('0xf')](function(_0x634ee5){throw _0x634ee5;});}this[_0x5437('0x8')]=function(_0x44e827,_0x4a0f28,_0x242781,_0x51799b){return _0x46fbaf(_0x44e827[_0x5437('0x10')])[_0x5437('0xe')](function(_0x420b67){var _0x413e16=_0x420b67[_0x4a0f28];return _0x413e16;})['then'](function(_0x4bc4e1){var _0x393bb8=_0x44e827[_0x5437('0x10')]?_0x44e827[_0x5437('0x10')]['id']:_0x5437('0x11');var _0x32d756=_0x51799b[_0x5437('0x12')];var _0x35c0ef=_0x51799b['timestamp'];var _0x4b0f93=new Date(Number(_0x35c0ef));return _0x4bc4e1(_0x393bb8,_0x4b0f93,_0x242781,_0x32d756);})[_0x5437('0xf')](function(_0x4ee14d){fileLogger('client')[_0x5437('0x13')](_0x4ee14d);});};}function setupLoggers(_0x33d08a){return new Promise(function(_0x10010a){var _0x94ed1b=new ClientSideLogger();var _0x21c98e=fileLogger(_0x5437('0x14'));var _0x347550=fileLogger('auth');_0x33d08a[_0x5437('0x15')](_0x5437('0x16'),_0x94ed1b);_0x33d08a[_0x5437('0x17')](ewinston[_0x5437('0x18')]({'winstonInstance':_0x21c98e,'meta':![],'statusLevels':!![],'msg':function(_0x2d9946,_0x4a3d21){var _0x5b6e3f=_0x5437('0x19');if(!_[_0x5437('0x1a')](_0x2d9946[_0x5437('0x1b')])){_0x5b6e3f+='\x20body=%s';var _0xf4f04e=_0x2d9946[_0x5437('0x1b')];maskSensitiveData(_0xf4f04e);}return safeTemplate(util[_0x5437('0x1c')](_0x5b6e3f,_0x2d9946[_0x5437('0x1d')],_0x2d9946[_0x5437('0x1e')]['x-forwarded-for']?_0x2d9946['headers'][_0x5437('0x1f')]:_0x2d9946['connection'][_0x5437('0x20')]||_0x2d9946['ip'],_0x2d9946[_0x5437('0x21')],_0x4a3d21['statusCode'],_0x4a3d21['responseTime'],_0x2d9946['user']?_0x2d9946[_0x5437('0x10')]['id']:null,_0x2d9946[_0x5437('0x10')]?_0x2d9946[_0x5437('0x10')][_0x5437('0xc')]:null,_0x2d9946[_0x5437('0x10')]?_0x2d9946['user']['role']:null,_0xf4f04e?util[_0x5437('0x22')](_0xf4f04e,![],null):''));}}));_0x33d08a['use'](ewinston[_0x5437('0x18')]({'winstonInstance':_0x347550,'meta':![],'statusLevels':!![],'msg':function(_0x190819,_0x15222c){var _0x213e87=_0x5437('0x23');if(_0x190819['body']&&_0x190819[_0x5437('0x1b')][_0x5437('0x24')]&&_0x190819[_0x5437('0x1b')]['agent_id']){_0x213e87=_0x5437('0x25');}return util['format'](_0x213e87,_0x190819['method'],_0x190819[_0x5437('0x1e')][_0x5437('0x1f')]?_0x190819['headers']['x-forwarded-for']:_0x190819['connection'][_0x5437('0x20')]||_0x190819['ip'],_0x190819[_0x5437('0x21')],_0x15222c[_0x5437('0x26')],_0x15222c[_0x5437('0x27')],_0x190819[_0x5437('0x10')]?_0x190819[_0x5437('0x10')]['id']:null,_0x190819['user']?_0x190819[_0x5437('0x10')]['name']:null,_0x190819[_0x5437('0x10')]?_0x190819[_0x5437('0x10')][_0x5437('0xb')]:null,_0x190819[_0x5437('0x1b')]&&_0x190819['body'][_0x5437('0x24')]?_0x190819['body']['device']:_0x5437('0x28'),_0x190819['body']&&_0x190819[_0x5437('0x1b')]['agent_id']?_0x190819[_0x5437('0x1b')][_0x5437('0x29')]:'',_0x190819[_0x5437('0x1b')]&&_0x190819[_0x5437('0x1b')][_0x5437('0x2a')]?_0x190819[_0x5437('0x1b')][_0x5437('0x2a')]:'');},'ignoreRoute':function(_0x3ae361){var _0xa58ce=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0xa58ce['test'](_0x3ae361[_0x5437('0x21')]);}}));return _0x10010a();});}exports['setupLoggers']=setupLoggers; \ No newline at end of file +var _0x7770=['set','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','body','\x20body=%s','method','headers','x-forwarded-for','connection','url','statusCode','responseTime','name','role','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','format','remoteAddress','agent_name','test','lodash','express-winston','path','./loggers','./safe-template','safeTemplate','./mask-sensitive-data','maskSensitiveData','/var','log','xcally','join','client','then','user','no-user','data','timestamp','catch','api','auth'];(function(_0x1f7aad,_0x370587){var _0x3ffaf=function(_0x4430bf){while(--_0x4430bf){_0x1f7aad['push'](_0x1f7aad['shift']());}};_0x3ffaf(++_0x370587);}(_0x7770,0xc2));var _0x0777=function(_0x42e8d8,_0x1fee8d){_0x42e8d8=_0x42e8d8-0x0;var _0x11afe2=_0x7770[_0x42e8d8];return _0x11afe2;};var fs=require('fs-extra');var _=require(_0x0777('0x0'));var ewinston=require(_0x0777('0x1'));var path=require(_0x0777('0x2'));var util=require('util');var fileLogger=require(_0x0777('0x3'))['fileLogger'];var safeTemplate=require(_0x0777('0x4'))[_0x0777('0x5')];var maskSensitiveData=require(_0x0777('0x6'))[_0x0777('0x7')];function ClientSideLogger(){function _0x3af57b(_0x3dee3f){var _0x5bdaee=path['join'](_0x0777('0x8'),_0x0777('0x9'),_0x0777('0xa'));var _0x3eb4dc=path[_0x0777('0xb')](_0x0777('0xc'),_0x3dee3f['role']+'-'+_0x3dee3f['name']);return fs['ensureDir'](path['join'](_0x5bdaee,_0x3eb4dc))[_0x0777('0xd')](function(){var _0x485185=fileLogger(_0x0777('0xc'),path[_0x0777('0xb')](_0x5bdaee,_0x3eb4dc));return _0x485185;})['catch'](function(_0x54e93a){throw _0x54e93a;});}this[_0x0777('0x9')]=function(_0x247bb5,_0x19944c,_0x46df81,_0x225e66){return _0x3af57b(_0x247bb5[_0x0777('0xe')])[_0x0777('0xd')](function(_0x28e015){var _0x5a54bf=_0x28e015[_0x19944c];return _0x5a54bf;})[_0x0777('0xd')](function(_0x4d58b1){var _0x531bfa=_0x247bb5[_0x0777('0xe')]?_0x247bb5[_0x0777('0xe')]['id']:_0x0777('0xf');var _0x17fea0=_0x225e66[_0x0777('0x10')];var _0x3cc3e4=_0x225e66[_0x0777('0x11')];var _0x3004c5=new Date(Number(_0x3cc3e4));return _0x4d58b1(_0x531bfa,_0x3004c5,_0x46df81,_0x17fea0);})[_0x0777('0x12')](function(_0x9773d1){fileLogger(_0x0777('0xc'))['error'](_0x9773d1);});};}function setupLoggers(_0x12183f){return new Promise(function(_0x1379b6){var _0x4b76c4=new ClientSideLogger();var _0x497f34=fileLogger(_0x0777('0x13'));var _0x499a3b=fileLogger(_0x0777('0x14'));_0x12183f[_0x0777('0x15')]('client-side-logger',_0x4b76c4);_0x12183f[_0x0777('0x16')](ewinston[_0x0777('0x17')]({'winstonInstance':_0x497f34,'meta':![],'statusLevels':!![],'msg':function(_0x129108,_0x421b66){var _0x38daa9=_0x0777('0x18');if(!_['isEmpty'](_0x129108[_0x0777('0x19')])){_0x38daa9+=_0x0777('0x1a');var _0x3bf33c=_0x129108[_0x0777('0x19')];maskSensitiveData(_0x3bf33c);}return safeTemplate(util['format'](_0x38daa9,_0x129108[_0x0777('0x1b')],_0x129108[_0x0777('0x1c')]['x-forwarded-for']?_0x129108[_0x0777('0x1c')][_0x0777('0x1d')]:_0x129108[_0x0777('0x1e')]['remoteAddress']||_0x129108['ip'],_0x129108[_0x0777('0x1f')],_0x421b66[_0x0777('0x20')],_0x421b66[_0x0777('0x21')],_0x129108[_0x0777('0xe')]?_0x129108[_0x0777('0xe')]['id']:null,_0x129108[_0x0777('0xe')]?_0x129108['user'][_0x0777('0x22')]:null,_0x129108['user']?_0x129108[_0x0777('0xe')][_0x0777('0x23')]:null,_0x3bf33c?util['inspect'](_0x3bf33c,![],null):''));}}));_0x12183f[_0x0777('0x16')](ewinston[_0x0777('0x17')]({'winstonInstance':_0x499a3b,'meta':![],'statusLevels':!![],'msg':function(_0x497fcc,_0x3be665){var _0x141f00='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x497fcc[_0x0777('0x19')]&&_0x497fcc[_0x0777('0x19')][_0x0777('0x24')]&&_0x497fcc['body'][_0x0777('0x25')]){_0x141f00=_0x0777('0x26');}return util[_0x0777('0x27')](_0x141f00,_0x497fcc['method'],_0x497fcc[_0x0777('0x1c')][_0x0777('0x1d')]?_0x497fcc['headers'][_0x0777('0x1d')]:_0x497fcc[_0x0777('0x1e')][_0x0777('0x28')]||_0x497fcc['ip'],_0x497fcc[_0x0777('0x1f')],_0x3be665[_0x0777('0x20')],_0x3be665['responseTime'],_0x497fcc[_0x0777('0xe')]?_0x497fcc[_0x0777('0xe')]['id']:null,_0x497fcc[_0x0777('0xe')]?_0x497fcc[_0x0777('0xe')][_0x0777('0x22')]:null,_0x497fcc[_0x0777('0xe')]?_0x497fcc[_0x0777('0xe')][_0x0777('0x23')]:null,_0x497fcc['body']&&_0x497fcc['body'][_0x0777('0x24')]?_0x497fcc[_0x0777('0x19')][_0x0777('0x24')]:'other',_0x497fcc[_0x0777('0x19')]&&_0x497fcc['body'][_0x0777('0x25')]?_0x497fcc['body'][_0x0777('0x25')]:'',_0x497fcc['body']&&_0x497fcc[_0x0777('0x19')][_0x0777('0x29')]?_0x497fcc[_0x0777('0x19')][_0x0777('0x29')]:'');},'ignoreRoute':function(_0x4c897f){var _0x3c394d=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x3c394d[_0x0777('0x2a')](_0x4c897f[_0x0777('0x1f')]);}}));return _0x1379b6();});}exports['setupLoggers']=setupLoggers; \ No newline at end of file diff --git a/server/utils/iftime.js b/server/utils/iftime.js index 8e2a849..d671169 100644 --- a/server/utils/iftime.js +++ b/server/utils/iftime.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x66ac=['map','source','join','Interval\x20string\x20not\x20valid','split','locale','weekdaysShort','toLowerCase','indexOf','slice','concat','exports','circularDoWInterval','monthsShort','circularMonthInterval','clone','hours','minutes','isBefore','endOf','isBetween','timeCompare','format','ddd','includes','date','daysInMonth','max','min','MMM','monthCompare','guess','test','isMoment','length','padStart','lodash','moment-timezone'];(function(_0x4f5c57,_0x1099d3){var _0x5097b6=function(_0x2a7cd5){while(--_0x2a7cd5){_0x4f5c57['push'](_0x4f5c57['shift']());}};_0x5097b6(++_0x1099d3);}(_0x66ac,0x12e));var _0xc66a=function(_0x4b190d,_0x35ea8f){_0x4b190d=_0x4b190d-0x0;var _0x3be20d=_0x66ac[_0x4b190d];return _0x3be20d;};var _=require(_0xc66a('0x0'));var moment=require(_0xc66a('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][_0xc66a('0x2')](function(_0x3bc8d3){return _0x3bc8d3[_0xc66a('0x3')];})[_0xc66a('0x4')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0xc66a('0x5');var EINVALID_DATE='Date\x20not\x20valid';function throwIfDateNotValid(_0x35d775){if(!_0x35d775['isValid']()){throw new Error(EINVALID_DATE);}}function extractTime(_0x7f8e1){var _0x23263a=_0x7f8e1[_0xc66a('0x6')](':')[_0xc66a('0x2')](function(_0x5916a8){return parseInt(_0x5916a8,0xa);});var _0x4848c1=_0x23263a[0x0];var _0x3acd3d=_0x23263a[0x1];if(_0x4848c1<0x0||_0x4848c1>0x17||_0x3acd3d<0x0||_0x3acd3d>0x3b){throw new Error(EINVALID_DATE);}return[_0x4848c1,_0x3acd3d];}function circularDoWInterval(_0x25eaf9,_0x43d3f5){if(_0x25eaf9===_0x43d3f5){return[_0x25eaf9];}else{var _0x549bb1=moment[_0xc66a('0x7')]();moment[_0xc66a('0x7')]('en');var _0x2943cf=moment[_0xc66a('0x8')]()['map'](function(_0x3c422e){return _0x3c422e[_0xc66a('0x9')]();});moment[_0xc66a('0x7')](_0x549bb1);var _0x13e454=_0x2943cf[_0xc66a('0xa')](_0x25eaf9);var _0x3dd5a7=_0x2943cf[_0xc66a('0xa')](_0x43d3f5);if(_0x3dd5a7>_0x13e454){return _0x2943cf['slice'](_0x13e454,_0x3dd5a7+0x1);}else{var _0x1d2713=_0x2943cf[_0xc66a('0xb')](0x0,_0x3dd5a7+0x1);var _0x5d7a3a=_0x2943cf['slice'](_0x13e454);return _0x5d7a3a[_0xc66a('0xc')](_0x1d2713);}}}module[_0xc66a('0xd')][_0xc66a('0xe')]=circularDoWInterval;function circularMonthInterval(_0x1547ce,_0x1ff7b1){if(_0x1547ce===_0x1ff7b1){return[_0x1547ce];}else{var _0x256a39=moment['locale']();moment[_0xc66a('0x7')]('en');var _0x4fd717=moment[_0xc66a('0xf')]()['map'](function(_0x3b2b4a){return _0x3b2b4a[_0xc66a('0x9')]();});moment[_0xc66a('0x7')](_0x256a39);var _0x49112a=_0x4fd717[_0xc66a('0xa')](_0x1547ce);var _0x22b622=_0x4fd717[_0xc66a('0xa')](_0x1ff7b1);if(_0x22b622>_0x49112a){return _0x4fd717[_0xc66a('0xb')](_0x49112a,_0x22b622+0x1);}else{var _0x2cae05=_0x4fd717[_0xc66a('0xb')](0x0,_0x22b622+0x1);var _0xf50cf6=_0x4fd717[_0xc66a('0xb')](_0x49112a);return _0xf50cf6['concat'](_0x2cae05);}}}module[_0xc66a('0xd')][_0xc66a('0x10')]=circularMonthInterval;function parseDom(_0x350702){var _0x6c2bf=parseInt(_0x350702,0xa);if(_0x6c2bf<0x1||_0x6c2bf>0x1f){throw new Error(EINVALID_DATE);}return _0x6c2bf;}function timeCompare(_0x163601,_0x36688f,_0x5837fd){var _0x5c5cfc=_0x163601[_0xc66a('0x11')]();var _0x359951=extractTime(_0x36688f);var _0xc04c68=_0x359951[0x0];var _0x4993b9=_0x359951[0x1];var _0x223e4e=_0x163601[_0xc66a('0x11')]()[_0xc66a('0x12')](_0xc04c68)['minutes'](_0x4993b9);throwIfDateNotValid(_0x223e4e);var _0x4531c4=extractTime(_0x5837fd);var _0x3c17ac=_0x4531c4[0x0];var _0xc47b0=_0x4531c4[0x1];var _0x39b9f4=_0x163601[_0xc66a('0x11')]()['hours'](_0x3c17ac)[_0xc66a('0x13')](_0xc47b0);throwIfDateNotValid(_0x39b9f4);if(_0x39b9f4[_0xc66a('0x14')](_0x223e4e)){var _0x72c5a1=_0x5c5cfc[_0xc66a('0x11')]()['startOf']('day');var _0x19e788=_0x5c5cfc['clone']()[_0xc66a('0x15')]('day');return _0x5c5cfc[_0xc66a('0x16')](_0x223e4e,_0x19e788,undefined,'[]')||_0x5c5cfc['isBetween'](_0x72c5a1,_0x39b9f4,undefined,'[]');}else{return _0x5c5cfc['isBetween'](_0x223e4e,_0x39b9f4,undefined,'[]');}}module[_0xc66a('0xd')][_0xc66a('0x17')]=timeCompare;function dowCompare(_0x4ac8ae,_0x4aff89,_0x1e7f1b){var _0x15fe02=_0x4ac8ae[_0xc66a('0x7')]('en')[_0xc66a('0x18')](_0xc66a('0x19'))[_0xc66a('0x9')]();return circularDoWInterval(_0x4aff89,_0x1e7f1b)[_0xc66a('0x1a')](_0x15fe02);}module[_0xc66a('0xd')]['dowCompare']=dowCompare;function domCompare(_0x3069e4,_0x1ec403,_0x382fed){var _0x6f9a11=_0x3069e4[_0xc66a('0x1b')]();if(_0x1ec403===_0x382fed){return _0x6f9a11===_0x1ec403;}else{var _0x23821a=_0x3069e4[_0xc66a('0x1c')]();var _0x45a9ec=_0x1ec403<_0x382fed;let _0x552994=![];var _0x2a3bc0=0x0;var _0x5d90cb=0x0;if(_0x45a9ec){_0x2a3bc0=Math[_0xc66a('0x1d')](0x1,_0x1ec403);_0x5d90cb=Math[_0xc66a('0x1e')](_0x382fed,_0x23821a);_0x552994=_0x6f9a11>=_0x2a3bc0&&_0x6f9a11<=_0x5d90cb;}else{_0x2a3bc0=Math[_0xc66a('0x1e')](_0x1ec403,_0x23821a);_0x5d90cb=Math[_0xc66a('0x1d')](0x1,_0x382fed);_0x552994=_0x6f9a11>=_0x2a3bc0||_0x6f9a11<=_0x5d90cb;}return _0x552994;}}module[_0xc66a('0xd')]['domCompare']=domCompare;function monthCompare(_0x15d4d9,_0x3ec69a,_0x707fd0){var _0x4eb4c8=_0x15d4d9['locale']('en')[_0xc66a('0x18')](_0xc66a('0x1f'))[_0xc66a('0x9')]();return circularMonthInterval(_0x3ec69a,_0x707fd0)['includes'](_0x4eb4c8);}module[_0xc66a('0xd')][_0xc66a('0x20')]=monthCompare;function iftime(_0x47a18a,_0xc49850=moment['tz'][_0xc66a('0x21')](),_0x4ee3ea=moment()){if(!validateRx[_0xc66a('0x22')](_0x47a18a)){throw new Error(EINVALID_STRING);}else{var _0x5b95ac=(moment[_0xc66a('0x23')](_0x4ee3ea)?_0x4ee3ea[_0xc66a('0x11')]():moment(_0x4ee3ea))['tz'](_0xc49850)[_0xc66a('0x7')]('en');throwIfDateNotValid(_0x5b95ac);var _0x2fa73f=_0x47a18a['split'](',');var _0x11006b=_0x2fa73f[0x0];var _0x46772d=_0x2fa73f[0x1];var _0x1128fe=_0x2fa73f[0x2];var _0x4d6247=_0x2fa73f[0x3];let _0x21b7db=!![];if(_0x11006b!=='*'){var _0xbea4ac=_0x11006b[_0xc66a('0x6')]('-');var _0xbda123=_['padStart'](_0xbea4ac[0x0],0x5,'0');var _0x55a47d=_0xbea4ac[_0xc66a('0x24')]===0x2?_[_0xc66a('0x25')](_0xbea4ac[0x1],0x5,'0'):_0xbda123;_0x21b7db=timeCompare(_0x5b95ac,_0xbda123,_0x55a47d);}let _0x2b27a7=!![];if(_0x46772d!=='*'){var _0x5e6552=_0x46772d[_0xc66a('0x6')]('-');var _0x42a130=_0x5e6552[0x0];var _0x6a813b=_0x5e6552[_0xc66a('0x24')]===0x2?_0x5e6552[0x1]:_0x42a130;_0x2b27a7=dowCompare(_0x5b95ac,_0x42a130,_0x6a813b);}let _0x365454=!![];if(_0x1128fe!=='*'){var _0x22175a=_0x1128fe[_0xc66a('0x6')]('-');var _0x517adf=parseDom(_0x22175a[0x0]);var _0x4465fe=_0x22175a[_0xc66a('0x24')]===0x2?parseDom(_0x22175a[0x1]):_0x517adf;_0x365454=domCompare(_0x5b95ac,_0x517adf,_0x4465fe);}let _0x58b57e=!![];if(_0x4d6247!=='*'){var _0x163a01=_0x4d6247['split']('-');var _0x372ec7=_0x163a01[0x0];var _0x417d0b=_0x163a01['length']===0x2?_0x163a01[0x1]:_0x163a01[0x0];_0x58b57e=monthCompare(_0x5b95ac,_0x372ec7,_0x417d0b);}return _0x21b7db&&_0x2b27a7&&_0x365454&&_0x58b57e;}}module[_0xc66a('0xd')]['iftime']=iftime; \ No newline at end of file +var _0x3a34=['isMoment','padStart','length','iftime','lodash','moment-timezone','source','join','Interval\x20string\x20not\x20valid','Date\x20not\x20valid','isValid','split','map','locale','weekdaysShort','toLowerCase','indexOf','concat','exports','circularDoWInterval','slice','circularMonthInterval','clone','hours','minutes','startOf','day','isBetween','dowCompare','date','daysInMonth','min','max','domCompare','includes','monthCompare','guess'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0x3a34,0xbd));var _0x43a3=function(_0x44365d,_0x44e0cb){_0x44365d=_0x44365d-0x0;var _0x1a4a9e=_0x3a34[_0x44365d];return _0x1a4a9e;};var _=require(_0x43a3('0x0'));var moment=require(_0x43a3('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]['map'](function(_0x2abd19){return _0x2abd19[_0x43a3('0x2')];})[_0x43a3('0x3')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0x43a3('0x4');var EINVALID_DATE=_0x43a3('0x5');function throwIfDateNotValid(_0xa17552){if(!_0xa17552[_0x43a3('0x6')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0xdc0ca6){var _0x1561e9=_0xdc0ca6[_0x43a3('0x7')](':')[_0x43a3('0x8')](function(_0xb225db){return parseInt(_0xb225db,0xa);});var _0x5a0c0a=_0x1561e9[0x0];var _0xa31e8c=_0x1561e9[0x1];if(_0x5a0c0a<0x0||_0x5a0c0a>0x17||_0xa31e8c<0x0||_0xa31e8c>0x3b){throw new Error(EINVALID_DATE);}return[_0x5a0c0a,_0xa31e8c];}function circularDoWInterval(_0x6daec2,_0x1c54a5){if(_0x6daec2===_0x1c54a5){return[_0x6daec2];}else{var _0x186ee9=moment[_0x43a3('0x9')]();moment[_0x43a3('0x9')]('en');var _0x80469c=moment[_0x43a3('0xa')]()[_0x43a3('0x8')](function(_0x17185d){return _0x17185d[_0x43a3('0xb')]();});moment['locale'](_0x186ee9);var _0x1e5aa2=_0x80469c[_0x43a3('0xc')](_0x6daec2);var _0x1a6f4a=_0x80469c[_0x43a3('0xc')](_0x1c54a5);if(_0x1a6f4a>_0x1e5aa2){return _0x80469c['slice'](_0x1e5aa2,_0x1a6f4a+0x1);}else{var _0x4face8=_0x80469c['slice'](0x0,_0x1a6f4a+0x1);var _0x612ae0=_0x80469c['slice'](_0x1e5aa2);return _0x612ae0[_0x43a3('0xd')](_0x4face8);}}}module[_0x43a3('0xe')][_0x43a3('0xf')]=circularDoWInterval;function circularMonthInterval(_0x31567c,_0x5420d6){if(_0x31567c===_0x5420d6){return[_0x31567c];}else{var _0x4042b9=moment[_0x43a3('0x9')]();moment['locale']('en');var _0x41df54=moment['monthsShort']()[_0x43a3('0x8')](function(_0x43ea58){return _0x43ea58[_0x43a3('0xb')]();});moment['locale'](_0x4042b9);var _0xe0ed20=_0x41df54[_0x43a3('0xc')](_0x31567c);var _0x71e3cb=_0x41df54['indexOf'](_0x5420d6);if(_0x71e3cb>_0xe0ed20){return _0x41df54['slice'](_0xe0ed20,_0x71e3cb+0x1);}else{var _0x507134=_0x41df54[_0x43a3('0x10')](0x0,_0x71e3cb+0x1);var _0x64be04=_0x41df54[_0x43a3('0x10')](_0xe0ed20);return _0x64be04[_0x43a3('0xd')](_0x507134);}}}module[_0x43a3('0xe')][_0x43a3('0x11')]=circularMonthInterval;function parseDom(_0x1da7ff){var _0x347e77=parseInt(_0x1da7ff,0xa);if(_0x347e77<0x1||_0x347e77>0x1f){throw new Error(EINVALID_DATE);}return _0x347e77;}function timeCompare(_0x12f333,_0x2f2685,_0xa8f781){var _0x117731=_0x12f333[_0x43a3('0x12')]();var _0x5a1928=extractTime(_0x2f2685);var _0x283085=_0x5a1928[0x0];var _0x41ef21=_0x5a1928[0x1];var _0x4453cc=_0x12f333[_0x43a3('0x12')]()[_0x43a3('0x13')](_0x283085)[_0x43a3('0x14')](_0x41ef21);throwIfDateNotValid(_0x4453cc);var _0x74cf47=extractTime(_0xa8f781);var _0x4ae583=_0x74cf47[0x0];var _0x50a11c=_0x74cf47[0x1];var _0x3d53cf=_0x12f333[_0x43a3('0x12')]()[_0x43a3('0x13')](_0x4ae583)[_0x43a3('0x14')](_0x50a11c);throwIfDateNotValid(_0x3d53cf);if(_0x3d53cf['isBefore'](_0x4453cc)){var _0x2a8791=_0x117731['clone']()[_0x43a3('0x15')](_0x43a3('0x16'));var _0x56deac=_0x117731[_0x43a3('0x12')]()['endOf'](_0x43a3('0x16'));return _0x117731[_0x43a3('0x17')](_0x4453cc,_0x56deac,undefined,'[]')||_0x117731[_0x43a3('0x17')](_0x2a8791,_0x3d53cf,undefined,'[]');}else{return _0x117731[_0x43a3('0x17')](_0x4453cc,_0x3d53cf,undefined,'[]');}}module[_0x43a3('0xe')]['timeCompare']=timeCompare;function dowCompare(_0x14845e,_0x1c82ea,_0x211727){var _0x374cd7=_0x14845e[_0x43a3('0x9')]('en')['format']('ddd')[_0x43a3('0xb')]();return circularDoWInterval(_0x1c82ea,_0x211727)['includes'](_0x374cd7);}module['exports'][_0x43a3('0x18')]=dowCompare;function domCompare(_0x3045e3,_0x1d3c24,_0x58dacb){var _0x119027=_0x3045e3[_0x43a3('0x19')]();if(_0x1d3c24===_0x58dacb){return _0x119027===_0x1d3c24;}else{var _0x2aba69=_0x3045e3[_0x43a3('0x1a')]();var _0x3a9362=_0x1d3c24<_0x58dacb;let _0x22c18e=![];var _0x2dc0ab=0x0;var _0x1357df=0x0;if(_0x3a9362){_0x2dc0ab=Math['max'](0x1,_0x1d3c24);_0x1357df=Math[_0x43a3('0x1b')](_0x58dacb,_0x2aba69);_0x22c18e=_0x119027>=_0x2dc0ab&&_0x119027<=_0x1357df;}else{_0x2dc0ab=Math['min'](_0x1d3c24,_0x2aba69);_0x1357df=Math[_0x43a3('0x1c')](0x1,_0x58dacb);_0x22c18e=_0x119027>=_0x2dc0ab||_0x119027<=_0x1357df;}return _0x22c18e;}}module['exports'][_0x43a3('0x1d')]=domCompare;function monthCompare(_0x707f44,_0xee9af0,_0x1c2bb1){var _0x5aafe7=_0x707f44[_0x43a3('0x9')]('en')['format']('MMM')[_0x43a3('0xb')]();return circularMonthInterval(_0xee9af0,_0x1c2bb1)[_0x43a3('0x1e')](_0x5aafe7);}module['exports'][_0x43a3('0x1f')]=monthCompare;function iftime(_0x4e17a6,_0x386fb1=moment['tz'][_0x43a3('0x20')](),_0x5e59b6=moment()){if(!validateRx['test'](_0x4e17a6)){throw new Error(EINVALID_STRING);}else{var _0x519bbe=(moment[_0x43a3('0x21')](_0x5e59b6)?_0x5e59b6[_0x43a3('0x12')]():moment(_0x5e59b6))['tz'](_0x386fb1)[_0x43a3('0x9')]('en');throwIfDateNotValid(_0x519bbe);var _0x2305aa=_0x4e17a6['split'](',');var _0x1f070a=_0x2305aa[0x0];var _0x2246f5=_0x2305aa[0x1];var _0x377aea=_0x2305aa[0x2];var _0x1d0bf1=_0x2305aa[0x3];let _0x52130c=!![];if(_0x1f070a!=='*'){var _0x384e2c=_0x1f070a['split']('-');var _0x1ac1b5=_[_0x43a3('0x22')](_0x384e2c[0x0],0x5,'0');var _0x26598a=_0x384e2c['length']===0x2?_[_0x43a3('0x22')](_0x384e2c[0x1],0x5,'0'):_0x1ac1b5;_0x52130c=timeCompare(_0x519bbe,_0x1ac1b5,_0x26598a);}let _0x4c22d0=!![];if(_0x2246f5!=='*'){var _0x22c11d=_0x2246f5[_0x43a3('0x7')]('-');var _0x1ea077=_0x22c11d[0x0];var _0xdf8751=_0x22c11d[_0x43a3('0x23')]===0x2?_0x22c11d[0x1]:_0x1ea077;_0x4c22d0=dowCompare(_0x519bbe,_0x1ea077,_0xdf8751);}let _0x1a3117=!![];if(_0x377aea!=='*'){var _0x5ab68f=_0x377aea[_0x43a3('0x7')]('-');var _0x2e4365=parseDom(_0x5ab68f[0x0]);var _0x1e805a=_0x5ab68f[_0x43a3('0x23')]===0x2?parseDom(_0x5ab68f[0x1]):_0x2e4365;_0x1a3117=domCompare(_0x519bbe,_0x2e4365,_0x1e805a);}let _0x5406ba=!![];if(_0x1d0bf1!=='*'){var _0x12b5c9=_0x1d0bf1[_0x43a3('0x7')]('-');var _0x104af3=_0x12b5c9[0x0];var _0x151e85=_0x12b5c9[_0x43a3('0x23')]===0x2?_0x12b5c9[0x1]:_0x12b5c9[0x0];_0x5406ba=monthCompare(_0x519bbe,_0x104af3,_0x151e85);}return _0x52130c&&_0x4c22d0&&_0x1a3117&&_0x5406ba;}}module[_0x43a3('0xe')][_0x43a3('0x24')]=iftime; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index 658167d..5d23ab5 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf343=['transports','warn','Logger','File','%s-%s','error','Console','consoleLogger','fileLogger','path','util','moment','winston','../config/environment','debugLevel','toLowerCase','info','redBG\x20white','bold\x20yellow','white','bold\x20white','bold\x20green','gray','bold\x20blue','addColors','join','format','%s-%s.log','message','replace','{{{','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','meta','keys','length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','YYYY-MM-DD\x20HH:mm:ss','toUpperCase'];(function(_0x3b762a,_0x1e5882){var _0x1a787e=function(_0x4803f1){while(--_0x4803f1){_0x3b762a['push'](_0x3b762a['shift']());}};_0x1a787e(++_0x1e5882);}(_0xf343,0x149));var _0x3f34=function(_0x554c57,_0x28d642){_0x554c57=_0x554c57-0x0;var _0xce3912=_0xf343[_0x554c57];return _0xce3912;};'use strict';var path=require(_0x3f34('0x0'));var util=require(_0x3f34('0x1'));var moment=require(_0x3f34('0x2'));var winston=require(_0x3f34('0x3'));var config=require(_0x3f34('0x4'));var debugLevel=config[_0x3f34('0x5')]?config['debugLevel'][_0x3f34('0x6')]():_0x3f34('0x7');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':_0x3f34('0x8'),'error':'red','warn':_0x3f34('0x9'),'info':_0x3f34('0xa'),'print':_0x3f34('0xb'),'success':_0x3f34('0xc'),'http':_0x3f34('0xd'),'verbose':'bold\x20magenta','debug':_0x3f34('0xe'),'silly':'bold\x20cyan'};winston[_0x3f34('0xf')](XC_LOG_COLORS);function getLogFileName(_0x3f34d4,_0x2e1bd9,_0x3d6612){var _0x367f33=_0x3f34d4||'/var/log/xcally';return path[_0x3f34('0x10')](_0x367f33,util[_0x3f34('0x11')](_0x3f34('0x12'),_0x2e1bd9,_0x3d6612));}function formatter(_0x3021f8,_0x21e6e1){_0x21e6e1[_0x3f34('0x13')]=_0x21e6e1[_0x3f34('0x13')][_0x3f34('0x14')](/@@{/g,_0x3f34('0x15'))[_0x3f34('0x14')](/}@@/g,_0x3f34('0x16'))[_0x3f34('0x14')](/@{/g,'{{')[_0x3f34('0x14')](/}@/g,'}}');return util[_0x3f34('0x11')](_0x3f34('0x17'),moment()[_0x3f34('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),_0x21e6e1['level']['toUpperCase'](),_0x3021f8,_0x21e6e1['message']);}function fileFormat(_0x118b6e,_0x30f925){_0x30f925[_0x3f34('0x13')]=_0x30f925[_0x3f34('0x13')][_0x3f34('0x14')](/@@{/g,'{{{')['replace'](/}@@/g,_0x3f34('0x16'))[_0x3f34('0x14')](/@{/g,'{{')['replace'](/}@/g,'}}');var _0x5b8964=_0x30f925[_0x3f34('0x18')]&&Object[_0x3f34('0x19')](_0x30f925[_0x3f34('0x18')])[_0x3f34('0x1a')]?'\x0a\x09'+JSON[_0x3f34('0x1b')](_0x30f925[_0x3f34('0x18')]):'';return util['format'](_0x3f34('0x1c'),moment()[_0x3f34('0x11')](_0x3f34('0x1d')),_0x30f925['level'][_0x3f34('0x1e')](),_0x118b6e,_0x30f925[_0x3f34('0x13')],_0x5b8964);}function consoleLogger(){var _0x379be2=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x3f34('0x1f'))]['Console']({'level':_0x3f34('0x20'),'json':![],'formatter':function(_0x38ba7c){return formatter('',_0x38ba7c);}})]});return _0x379be2;}function fileLogger(_0x4b28d3,_0x2129cf){var _0x5a5206=new winston[(_0x3f34('0x21'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x3f34('0x1f'))][(_0x3f34('0x22'))]({'name':util['format'](_0x3f34('0x23'),_0x4b28d3,_0x3f34('0x24')),'filename':getLogFileName(_0x2129cf,_0x4b28d3,'error'),'level':_0x3f34('0x24'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x2a8fba){return fileFormat(_0x4b28d3,_0x2a8fba);}}),new winston['transports'][(_0x3f34('0x22'))]({'name':util[_0x3f34('0x11')](_0x3f34('0x23'),_0x4b28d3,debugLevel),'filename':getLogFileName(_0x2129cf,_0x4b28d3,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x258a4e){return fileFormat(_0x4b28d3,_0x258a4e);}}),new winston['transports'][(_0x3f34('0x25'))]({'level':'warn','json':![],'formatter':function(_0x155be6){return fileFormat(_0x4b28d3,_0x155be6);}})]});return _0x5a5206;}exports[_0x3f34('0x26')]=consoleLogger;exports[_0x3f34('0x27')]=fileLogger; \ No newline at end of file +var _0x777f=['bold\x20yellow','white','bold\x20green','gray','bold\x20magenta','bold\x20blue','bold\x20cyan','addColors','join','message','replace','{{{','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','meta','stringify','Logger','transports','Console','warn','File','%s-%s','error','consoleLogger','fileLogger','util','winston','../config/environment','debugLevel','toLowerCase','redBG\x20white','red'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x777f,0x89));var _0xf777=function(_0x254b22,_0x27159f){_0x254b22=_0x254b22-0x0;var _0x1279db=_0x777f[_0x254b22];return _0x1279db;};'use strict';var path=require('path');var util=require(_0xf777('0x0'));var moment=require('moment');var winston=require(_0xf777('0x1'));var config=require(_0xf777('0x2'));var debugLevel=config[_0xf777('0x3')]?config[_0xf777('0x3')][_0xf777('0x4')]():'info';var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':_0xf777('0x5'),'error':_0xf777('0x6'),'warn':_0xf777('0x7'),'info':_0xf777('0x8'),'print':'bold\x20white','success':_0xf777('0x9'),'http':_0xf777('0xa'),'verbose':_0xf777('0xb'),'debug':_0xf777('0xc'),'silly':_0xf777('0xd')};winston[_0xf777('0xe')](XC_LOG_COLORS);function getLogFileName(_0x187dd2,_0x2d1c28,_0x669fd4){var _0x431707=_0x187dd2||'/var/log/xcally';return path[_0xf777('0xf')](_0x431707,util['format']('%s-%s.log',_0x2d1c28,_0x669fd4));}function formatter(_0x3842f2,_0x1c3cfb){_0x1c3cfb[_0xf777('0x10')]=_0x1c3cfb[_0xf777('0x10')][_0xf777('0x11')](/@@{/g,_0xf777('0x12'))[_0xf777('0x11')](/}@@/g,_0xf777('0x13'))['replace'](/@{/g,'{{')[_0xf777('0x11')](/}@/g,'}}');return util['format'](_0xf777('0x14'),moment()[_0xf777('0x15')](_0xf777('0x16')),_0x1c3cfb[_0xf777('0x17')][_0xf777('0x18')](),_0x3842f2,_0x1c3cfb[_0xf777('0x10')]);}function fileFormat(_0x44e42d,_0x2c9505){_0x2c9505[_0xf777('0x10')]=_0x2c9505[_0xf777('0x10')][_0xf777('0x11')](/@@{/g,_0xf777('0x12'))['replace'](/}@@/g,_0xf777('0x13'))[_0xf777('0x11')](/@{/g,'{{')['replace'](/}@/g,'}}');var _0x11fe20=_0x2c9505[_0xf777('0x19')]&&Object['keys'](_0x2c9505[_0xf777('0x19')])['length']?'\x0a\x09'+JSON[_0xf777('0x1a')](_0x2c9505[_0xf777('0x19')]):'';return util[_0xf777('0x15')]('[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s',moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),_0x2c9505[_0xf777('0x17')][_0xf777('0x18')](),_0x44e42d,_0x2c9505['message'],_0x11fe20);}function consoleLogger(){var _0x1639a1=new winston[(_0xf777('0x1b'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xf777('0x1c'))][(_0xf777('0x1d'))]({'level':_0xf777('0x1e'),'json':![],'formatter':function(_0x47f718){return formatter('',_0x47f718);}})]});return _0x1639a1;}function fileLogger(_0x4fbf6c,_0x43e945){var _0x17e670=new winston[(_0xf777('0x1b'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xf777('0x1c'))][(_0xf777('0x1f'))]({'name':util[_0xf777('0x15')](_0xf777('0x20'),_0x4fbf6c,_0xf777('0x21')),'filename':getLogFileName(_0x43e945,_0x4fbf6c,_0xf777('0x21')),'level':_0xf777('0x21'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x574f91){return fileFormat(_0x4fbf6c,_0x574f91);}}),new winston[(_0xf777('0x1c'))][(_0xf777('0x1f'))]({'name':util['format']('%s-%s',_0x4fbf6c,debugLevel),'filename':getLogFileName(_0x43e945,_0x4fbf6c,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x231b15){return fileFormat(_0x4fbf6c,_0x231b15);}}),new winston['transports'][(_0xf777('0x1d'))]({'level':_0xf777('0x1e'),'json':![],'formatter':function(_0x239be1){return fileFormat(_0x4fbf6c,_0x239be1);}})]});return _0x17e670;}exports[_0xf777('0x22')]=consoleLogger;exports[_0xf777('0x23')]=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index f15daa5..9e90846 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 _0x66fa=['calleridnum','vidaooApiKey','privateKey','secretaccesskey','key','user','localstationid','oldPassword','isPlainObject','length','isString','replace','includes','exports','maskSensitiveData','lodash','username','newPassword','apiKey','firstName','lastName','street','phone','mobile','clientId','clientSecret','securityToken','code','accessKey','token','accessToken','authToken','calleridname'];(function(_0x3c85fe,_0x229ff0){var _0x19ff92=function(_0x2245a1){while(--_0x2245a1){_0x3c85fe['push'](_0x3c85fe['shift']());}};_0x19ff92(++_0x229ff0);}(_0x66fa,0x117));var _0xa66f=function(_0x37a896,_0x11f745){_0x37a896=_0x37a896-0x0;var _0x4bd6ef=_0x66fa[_0x37a896];return _0x4bd6ef;};var _=require(_0xa66f('0x0'));var sensitiveFields=[_0xa66f('0x1'),'password',_0xa66f('0x2'),_0xa66f('0x3'),_0xa66f('0x4'),_0xa66f('0x5'),_0xa66f('0x6'),_0xa66f('0x7'),_0xa66f('0x8'),'fax','email',_0xa66f('0x9'),_0xa66f('0xa'),_0xa66f('0xb'),_0xa66f('0xc'),_0xa66f('0xd'),'tenantId',_0xa66f('0xe'),'channelSecret',_0xa66f('0xf'),'accessTokenSecret',_0xa66f('0x10'),'consumerKey','consumerSecret','membername',_0xa66f('0x11'),_0xa66f('0x12'),'exten',_0xa66f('0x13'),'clientEmail',_0xa66f('0x14'),'accesskeyid',_0xa66f('0x15'),_0xa66f('0x16'),_0xa66f('0x17'),'pass','accountSid',_0xa66f('0x18'),'dsn','secret','registry',_0xa66f('0x19')];function maskSensitiveData(_0x452c37){const _0x267129=/(?!^)[\s\S](?!$)/g;if(_[_0xa66f('0x1a')](_0x452c37)){for(const _0xd348f9 in _0x452c37){if(_['isArray'](_0x452c37[_0xd348f9])){for(let _0x5510dc=0x0;_0x5510dc<_0x452c37[_0xd348f9][_0xa66f('0x1b')];_0x5510dc++){maskSensitiveData(_0x452c37[_0xd348f9][_0x5510dc]);}}else if(_[_0xa66f('0x1a')](_0x452c37[_0xd348f9])){maskSensitiveData(_0x452c37[_0xd348f9]);}else if(_[_0xa66f('0x1c')](_0x452c37[_0xd348f9])){_0x452c37[_0xd348f9]=_0x452c37[_0xd348f9][_0xa66f('0x1d')](/{{{/g,'@@{')[_0xa66f('0x1d')](/}}}/g,'}@@')['replace'](/{{/g,'@{')[_0xa66f('0x1d')](/}}/g,'}@');if(_[_0xa66f('0x1e')](sensitiveFields,_0xd348f9)){_0x452c37[_0xd348f9]=_0x452c37[_0xd348f9][_0xa66f('0x1d')](_0x267129,'*');}}}}}module[_0xa66f('0x1f')][_0xa66f('0x20')]=maskSensitiveData; \ No newline at end of file +var _0x7a54=['code','accessKey','token','authToken','consumerKey','membername','exten','vidaooApiKey','clientEmail','privateKey','accesskeyid','secretaccesskey','key','pass','accountSid','localstationid','dsn','secret','registry','oldPassword','isPlainObject','isArray','length','replace','}@@','includes','exports','maskSensitiveData','lodash','username','password','apiKey','firstName','street','phone','mobile','fax','email','clientSecret'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7a54,0x106));var _0x47a5=function(_0x521e57,_0x287dcd){_0x521e57=_0x521e57-0x0;var _0x5eaac6=_0x7a54[_0x521e57];return _0x5eaac6;};var _=require(_0x47a5('0x0'));var sensitiveFields=[_0x47a5('0x1'),_0x47a5('0x2'),'newPassword',_0x47a5('0x3'),_0x47a5('0x4'),'lastName',_0x47a5('0x5'),_0x47a5('0x6'),_0x47a5('0x7'),_0x47a5('0x8'),_0x47a5('0x9'),'clientId',_0x47a5('0xa'),'securityToken',_0x47a5('0xb'),_0x47a5('0xc'),'tenantId',_0x47a5('0xd'),'channelSecret','accessToken','accessTokenSecret',_0x47a5('0xe'),_0x47a5('0xf'),'consumerSecret',_0x47a5('0x10'),'calleridname','calleridnum',_0x47a5('0x11'),_0x47a5('0x12'),_0x47a5('0x13'),_0x47a5('0x14'),_0x47a5('0x15'),_0x47a5('0x16'),_0x47a5('0x17'),'user',_0x47a5('0x18'),_0x47a5('0x19'),_0x47a5('0x1a'),_0x47a5('0x1b'),_0x47a5('0x1c'),_0x47a5('0x1d'),_0x47a5('0x1e')];function maskSensitiveData(_0x190faa){const _0x4e99a8=/(?!^)[\s\S](?!$)/g;if(_[_0x47a5('0x1f')](_0x190faa)){for(const _0x11faf5 in _0x190faa){if(_[_0x47a5('0x20')](_0x190faa[_0x11faf5])){for(let _0x2a2cbb=0x0;_0x2a2cbb<_0x190faa[_0x11faf5][_0x47a5('0x21')];_0x2a2cbb++){maskSensitiveData(_0x190faa[_0x11faf5][_0x2a2cbb]);}}else if(_['isPlainObject'](_0x190faa[_0x11faf5])){maskSensitiveData(_0x190faa[_0x11faf5]);}else if(_['isString'](_0x190faa[_0x11faf5])){_0x190faa[_0x11faf5]=_0x190faa[_0x11faf5][_0x47a5('0x22')](/{{{/g,'@@{')['replace'](/}}}/g,_0x47a5('0x23'))[_0x47a5('0x22')](/{{/g,'@{')[_0x47a5('0x22')](/}}/g,'}@');if(_[_0x47a5('0x24')](sensitiveFields,_0x11faf5)){_0x190faa[_0x11faf5]=_0x190faa[_0x11faf5][_0x47a5('0x22')](_0x4e99a8,'*');}}}}}module[_0x47a5('0x25')][_0x47a5('0x26')]=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index 1d41578..ed5ce6a 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 _0xb688=['{\x20{\x20','\x20}\x20}','string','isArray','map','isPlainObject','reduce','exports','safeTemplate'];(function(_0x43939f,_0x3a6fbd){var _0x1e9510=function(_0x5a605f){while(--_0x5a605f){_0x43939f['push'](_0x43939f['shift']());}};_0x1e9510(++_0x3a6fbd);}(_0xb688,0xcf));var _0x8b68=function(_0x2a87a2,_0x485140){_0x2a87a2=_0x2a87a2-0x0;var _0x3a1534=_0xb688[_0x2a87a2];return _0x3a1534;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x39c8c5){return _0x39c8c5==='{{'?_0x8b68('0x0'):_0x8b68('0x1');}function safeTemplate(_0x1080e8){var _0x23bbaa=_0x1080e8;if(typeof _0x1080e8===_0x8b68('0x2')){_0x23bbaa=_0x1080e8['replace'](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x8b68('0x3')](_0x1080e8)){_0x23bbaa=_0x1080e8[_0x8b68('0x4')](function(_0x30f33d){return safeTemplate(_0x30f33d);});}else if(_[_0x8b68('0x5')](_0x1080e8)){_0x23bbaa=Object['keys'](_0x1080e8)[_0x8b68('0x6')](function(_0x57ee56,_0x37677d){_0x57ee56[_0x37677d]=safeTemplate(_0x1080e8[_0x37677d]);return _0x57ee56;},{});}return _0x23bbaa;}module[_0x8b68('0x7')][_0x8b68('0x8')]=safeTemplate; \ No newline at end of file +var _0x5f66=['\x20}\x20}','string','replace','map','isPlainObject','keys','exports','safeTemplate'];(function(_0x2b2b33,_0x56606f){var _0x229157=function(_0x52b63e){while(--_0x52b63e){_0x2b2b33['push'](_0x2b2b33['shift']());}};_0x229157(++_0x56606f);}(_0x5f66,0x1a0));var _0x65f6=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x5f66[_0x5d4607];return _0x5e4a86;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x61c60c){return _0x61c60c==='{{'?'{\x20{\x20':_0x65f6('0x0');}function safeTemplate(_0x2f06ae){var _0x3461cd=_0x2f06ae;if(typeof _0x2f06ae===_0x65f6('0x1')){_0x3461cd=_0x2f06ae[_0x65f6('0x2')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array['isArray'](_0x2f06ae)){_0x3461cd=_0x2f06ae[_0x65f6('0x3')](function(_0x5150c8){return safeTemplate(_0x5150c8);});}else if(_[_0x65f6('0x4')](_0x2f06ae)){_0x3461cd=Object[_0x65f6('0x5')](_0x2f06ae)['reduce'](function(_0x4ed98f,_0x1c0e12){_0x4ed98f[_0x1c0e12]=safeTemplate(_0x2f06ae[_0x1c0e12]);return _0x4ed98f;},{});}return _0x3461cd;}module[_0x65f6('0x6')][_0x65f6('0x7')]=safeTemplate; \ No newline at end of file diff --git a/server/utils/update-app-config.js b/server/utils/update-app-config.js index d8c9230..2784d4c 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 _0x2e78=['resolve','legacy-libs','isArray','apps','findIndex','name','motion2','env','NODE_PATH','string','then','readJSON','updated','info','Updating\x20app.json','writeJSON','exports','path','../config/environment'];(function(_0x60a45a,_0x4d17be){var _0x393090=function(_0x3e6472){while(--_0x3e6472){_0x60a45a['push'](_0x60a45a['shift']());}};_0x393090(++_0x4d17be);}(_0x2e78,0x1a0));var _0x82e7=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x2e78[_0x1ac595];return _0x455fff;};var fs=require('fs-extra');var path=require(_0x82e7('0x0'));var config=require(_0x82e7('0x1'));var root=config['root'];var APP_JSON_PATH=path[_0x82e7('0x2')](root,'server/app.json');var NODEPATH=path[_0x82e7('0x2')](root,_0x82e7('0x3'));function setLegacyLibsNodeEnvPath(_0x1d072d){let _0x5467ac=![];if(Array[_0x82e7('0x4')](_0x1d072d[_0x82e7('0x5')])){var _0x5ecb44=_0x1d072d['apps'][_0x82e7('0x6')](function(_0x41e6cb){return _0x41e6cb[_0x82e7('0x7')]===_0x82e7('0x8');});if(_0x5ecb44>-0x1){var _0x178bea=_0x1d072d[_0x82e7('0x5')][_0x5ecb44];if(typeof _0x178bea[_0x82e7('0x9')][_0x82e7('0xa')]!==_0x82e7('0xb')){_0x178bea[_0x82e7('0x9')]['NODE_PATH']=NODEPATH;_0x5467ac=!![];}}return{'appConfig':_0x1d072d,'updated':_0x5467ac};}}function updateAppConfig(_0x3607c4){return fs['pathExists'](APP_JSON_PATH)[_0x82e7('0xc')](function(_0x88265e){if(_0x88265e){return fs[_0x82e7('0xd')](APP_JSON_PATH)[_0x82e7('0xc')](function(_0x39299a){var _0x1cee97=setLegacyLibsNodeEnvPath(_0x39299a);if(_0x1cee97[_0x82e7('0xe')]){_0x3607c4[_0x82e7('0xf')](_0x82e7('0x10'));return fs[_0x82e7('0x11')](APP_JSON_PATH,_0x39299a,{'spaces':0x2});}else{return Promise[_0x82e7('0x2')]();}});}else{return Promise[_0x82e7('0x2')]();}});}module[_0x82e7('0x12')]=updateAppConfig; \ No newline at end of file +var _0x7171=['writeJSON','exports','fs-extra','../config/environment','root','resolve','server/app.json','legacy-libs','isArray','apps','name','motion2','string','env','NODE_PATH','pathExists','readJSON','then','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7171,0x158));var _0x1717=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x7171[_0x1caf6a];return _0x1bf493;};var fs=require(_0x1717('0x0'));var path=require('path');var config=require(_0x1717('0x1'));var root=config[_0x1717('0x2')];var APP_JSON_PATH=path[_0x1717('0x3')](root,_0x1717('0x4'));var NODEPATH=path[_0x1717('0x3')](root,_0x1717('0x5'));function setLegacyLibsNodeEnvPath(_0x29ee2f){let _0x36b16c=![];if(Array[_0x1717('0x6')](_0x29ee2f[_0x1717('0x7')])){var _0x21f769=_0x29ee2f[_0x1717('0x7')]['findIndex'](function(_0xc9d449){return _0xc9d449[_0x1717('0x8')]===_0x1717('0x9');});if(_0x21f769>-0x1){var _0x5e8e53=_0x29ee2f[_0x1717('0x7')][_0x21f769];if(typeof _0x5e8e53['env']['NODE_PATH']!==_0x1717('0xa')){_0x5e8e53[_0x1717('0xb')][_0x1717('0xc')]=NODEPATH;_0x36b16c=!![];}}return{'appConfig':_0x29ee2f,'updated':_0x36b16c};}}function updateAppConfig(_0x3dd1c5){return fs[_0x1717('0xd')](APP_JSON_PATH)['then'](function(_0x1f95ea){if(_0x1f95ea){return fs[_0x1717('0xe')](APP_JSON_PATH)[_0x1717('0xf')](function(_0x51a2b0){var _0x11485c=setLegacyLibsNodeEnvPath(_0x51a2b0);if(_0x11485c['updated']){_0x3dd1c5[_0x1717('0x10')]('Updating\x20app.json');return fs[_0x1717('0x11')](APP_JSON_PATH,_0x51a2b0,{'spaces':0x2});}else{return Promise[_0x1717('0x3')]();}});}else{return Promise[_0x1717('0x3')]();}});}module[_0x1717('0x12')]=updateAppConfig; \ No newline at end of file diff --git a/snippet/3.5.0/scripts/chat.js b/snippet/3.5.0/scripts/chat.js deleted file mode 100644 index 49ad0c7..0000000 --- a/snippet/3.5.0/scripts/chat.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! For license information please see chat.js.LICENSE.txt */ -(self.webpackChunkmotion_chat=self.webpackChunkmotion_chat||[]).push([["chat"],{"./node_modules/@flowjs/ng-flow/dist/ng-flow.js":(e,t,n)=>{var o=n("./node_modules/@flowjs/flow.js/src/flow.js");angular.module("flow.provider",[]).provider("flowFactory",(function(){"use strict";this.defaults={},this.factory=function(e){return new o(e)},this.events=[],this.on=function(e,t){this.events.push([e,t])},this.$get=function(){var e=this.factory,t=this.defaults,n=this.events;return{create:function(o){var r=e(angular.extend({},t,o));return angular.forEach(n,(function(e){r.on(e[0],e[1])})),r}}}})),angular.module("flow.init",["flow.provider"]).controller("flowCtrl",["$scope","$attrs","$parse","flowFactory",function(e,t,n,o){var r=angular.extend({},e.$eval(t.flowInit)),s=e.$eval(t.flowObject)||o.create(r),a=function(t){var n=Array.prototype.slice.call(arguments);n.shift();var o=e.$broadcast.apply(e,["flow::"+t,s].concat(n));if({progress:1,filesSubmitted:1,fileSuccess:1,fileError:1,complete:1}[t]&&e.$applyAsync(),o.defaultPrevented)return!1};s.on("catchAll",a),e.$on("$destroy",(function(){s.off("catchAll",a)})),e.$flow=s,t.hasOwnProperty("flowName")&&(n(t.flowName).assign(e,s),e.$on("$destroy",(function(){n(t.flowName).assign(e)})))}]).directive("flowInit",[function(){return{scope:!0,controller:"flowCtrl"}}]),angular.module("flow.btn",["flow.init"]).directive("flowBtn",[function(){return{restrict:"EA",scope:!1,require:"^flowInit",link:function(e,t,n){var o=n.hasOwnProperty("flowDirectory"),r=n.hasOwnProperty("flowSingleFile"),s=n.hasOwnProperty("flowAttrs")&&e.$eval(n.flowAttrs);e.$flow.assignBrowse(t,o,r,s)}}}]),angular.module("flow.dragEvents",["flow.init"]).directive("flowPreventDrop",(function(){return{scope:!1,link:function(e,t,n){t.bind("drop dragover",(function(e){e.preventDefault()}))}}})).directive("flowDragEnter",["$timeout",function(e){return{scope:!1,link:function(t,n,o){var r,s=!1;n.bind("dragover",(function(n){var a,i,d;i=!1,d=(a=n).dataTransfer||a.originalEvent.dataTransfer,angular.forEach(d&&d.types,(function(e){"Files"===e&&(i=!0)})),i&&(s||(t.$apply(o.flowDragEnter),s=!0),e.cancel(r),n.preventDefault())})),n.bind("dragleave drop",(function(n){e.cancel(r),r=e((function(){t.$eval(o.flowDragLeave),r=null,s=!1}),100)}))}}}]),angular.module("flow.drop",["flow.init"]).directive("flowDrop",(function(){return{scope:!1,require:"^flowInit",link:function(e,t,n){function o(){e.$flow.assignDrop(t)}n.flowDropEnabled?e.$watch(n.flowDropEnabled,(function(n){n?o():e.$flow.unAssignDrop(t)})):o()}}})),function(e){"use strict";var t=e.module("flow.events",["flow.init"]);e.forEach({fileSuccess:["$file","$message"],fileProgress:["$file"],fileAdded:["$file","$event"],filesAdded:["$files","$event"],filesSubmitted:["$files","$event"],fileRetry:["$file"],fileRemoved:["$file"],fileError:["$file","$message"],uploadStart:[],complete:[],progress:[],error:["$message","$file"]},(function(n,o){var r,s="flow"+((r=o).charAt(0).toUpperCase()+r.slice(1));"flowUploadStart"==s&&(s="flowUploadStarted"),t.directive(s,[function(){return{require:"^flowInit",controller:["$scope","$attrs",function(t,r){t.$on("flow::"+o,(function(){var o=Array.prototype.slice.call(arguments),a=o.shift();if(t.$flow===o.shift()){var i={};e.forEach(n,(function(e,t){i[e]=o[t]})),!1===t.$eval(r[s],i)&&a.preventDefault()}}))}]}}])}))}(angular),angular.module("flow.img",["flow.init"]).directive("flowImg",[function(){return{scope:!1,require:"^flowInit",link:function(e,t,n){var o=n.flowImg;e.$watch(o,(function(t){if(t){var o=new FileReader;o.readAsDataURL(t.file),o.onload=function(t){e.$apply((function(){n.$set("src",t.target.result)}))}}}))}}}]),angular.module("flow.transfers",["flow.init"]).directive("flowTransfers",[function(){return{scope:!0,require:"^flowInit",link:function(e){e.transfers=e.$flow.files}}}]),angular.module("flow",["flow.provider","flow.init","flow.events","flow.btn","flow.drop","flow.transfers","flow.img","flow.dragEvents"])},"./node_modules/@uirouter/angularjs/lib-esm/directives/viewDirective.js":(e,t,n)=>{"use strict";var o,r=n("./node_modules/@uirouter/core/lib-esm/index.js"),s=n("./node_modules/@uirouter/angularjs/lib-esm/angular.js"),a=n("./node_modules/@uirouter/angularjs/lib-esm/services.js"),i=n("./node_modules/@uirouter/angularjs/lib-esm/statebuilders/views.js");function d(e,t,n,o,i){var d=(0,r.parse)("viewDecl.controllerAs"),u=(0,r.parse)("viewDecl.resolveAs");return{restrict:"ECA",priority:-400,compile:function(o){var m=o.html();return o.empty(),function(o,_){var c=_.data("$uiView");if(!c)return _.html(m),void e(_.contents())(o);var h=c.$cfg||{viewDecl:{},getTemplate:r.noop},f=h.path&&new r.ResolveContext(h.path);_.html(h.getTemplate(_,f)||m),r.trace.traceUIViewFill(c.$uiView,_.html());var p=e(_.contents()),M=h.controller,y=d(h),L=u(h),g=f&&(0,a.D)(f);if(o[L]=g,M){var Y=t(M,(0,r.extend)({},g,{$scope:o,$element:_}));y&&(o[y]=Y,o[y][L]=g),_.data("$ngControllerController",Y),_.children().data("$ngControllerController",Y),l(i,n,Y,o,h)}if((0,r.isString)(h.component))var v=(0,r.kebobString)(h.component),k=new RegExp("^(x-|data-)?"+v+"$","i"),j=o.$watch((function(){var e=[].slice.call(_[0].children).filter((function(e){return e&&e.tagName&&k.exec(e.tagName)}));return e&&s.ng.element(e).data("$"+h.component+"Controller")}),(function(e){e&&(l(i,n,e,o,h),j())}));p(o)}}}}o=["$view","$animate","$uiViewScroll","$interpolate","$q",function(e,t,n,o,a){var d={$cfg:{viewDecl:{$context:e._pluginapi._rootViewContext()}},$uiView:{}},u={count:0,restrict:"ECA",terminal:!0,priority:400,transclude:"element",compile:function(m,l,_){return function(m,l,c){var h,f,p,M,y=c.onload||"",L=c.autoscroll,g=function(e,n,o){s.ng.version.minor>2?t.enter(e,null,n).then(o):t.enter(e,null,n,o)},Y=function(e,n){s.ng.version.minor>2?t.leave(e).then(n):t.leave(e,n)},v=l.inheritedData("$uiView")||d,k=o(c.uiView||c.name||"")(m)||"$default",j={$type:"ng1",id:u.count++,name:k,fqn:v.$uiView.fqn?v.$uiView.fqn+"."+k:k,config:null,configUpdated:function(e){(!e||e instanceof i.qO)&&(M!==e&&(r.trace.traceUIViewConfigUpdated(j,e&&e.viewDecl&&e.viewDecl.$context),M=e,b(e)))},get creationContext(){var e=(0,r.parse)("$cfg.viewDecl.$context")(v),t=(0,r.parse)("$uiView.creationContext")(v);return e||t}};r.trace.traceUIViewEvent("Linking",j),l.data("$uiView",{$uiView:j}),b();var w=e.registerUIView(j);function b(e){var t=m.$new(),o=a.defer(),s=a.defer(),i={$cfg:e,$uiView:j},d={$animEnter:o.promise,$animLeave:s.promise,$$animLeave:s};t.$emit("$viewContentLoading",k);var u=_(t,(function(e){e.data("$uiViewAnim",d),e.data("$uiView",i),g(e,l,(function(){o.resolve(),p&&p.$emit("$viewContentAnimationEnded"),((0,r.isDefined)(L)&&!L||m.$eval(L))&&n(e)})),function(){if(h&&(r.trace.traceUIViewEvent("Removing (previous) el",h.data("$uiView")),h.remove(),h=null),p&&(r.trace.traceUIViewEvent("Destroying scope",j),p.$destroy(),p=null),f){var e=f.data("$uiViewAnim");r.trace.traceUIViewEvent("Animate out",e),Y(f,(function(){e.$$animLeave.resolve(),h=null})),h=f,f=null}}()}));f=u,(p=t).$emit("$viewContentLoaded",e||M),p.$eval(y)}m.$on("$destroy",(function(){r.trace.traceUIViewEvent("Destroying/Unregistering",j),w()}))}}};return u}],d.$inject=["$compile","$controller","$transitions","$view","$q"];var u="function"==typeof s.ng.module("ui.router").component,m=0;function l(e,t,n,o,s){!(0,r.isFunction)(n.$onInit)||(s.viewDecl.component||s.viewDecl.componentProvider)&&u||n.$onInit();var a=(0,r.tail)(s.path).state.self,i={bind:n};if((0,r.isFunction)(n.uiOnParamsChanged)){var d=new r.ResolveContext(s.path).getResolvable("$transition$").data;o.$on("$destroy",t.onSuccess({},(function(e){if(e!==d&&-1===e.exiting().indexOf(a)){var t=e.params("to"),o=e.params("from"),s=function(e){return e.paramSchema},i=e.treeChanges("to").map(s).reduce(r.unnestR,[]),u=e.treeChanges("from").map(s).reduce(r.unnestR,[]),m=i.filter((function(e){var n=u.indexOf(e);return-1===n||!u[n].type.equals(t[e.id],o[e.id])}));if(m.length){var l=m.map((function(e){return e.id})),_=(0,r.filter)(t,(function(e,t){return-1!==l.indexOf(t)}));n.uiOnParamsChanged(_,e)}}}),i))}if((0,r.isFunction)(n.uiCanExit)){var l=m++,_="_uiCanExitIds",c=function(e){return!!e&&(e[_]&&!0===e[_][l]||c(e.redirectedFrom()))},h={exiting:a.name};o.$on("$destroy",t.onBefore(h,(function(t){var o,r=t[_]=t[_]||{};return c(t)||(o=e.when(n.uiCanExit(t))).then((function(e){return r[l]=!1!==e})),o}),i))}}s.ng.module("ui.router.state").directive("uiView",o),s.ng.module("ui.router.state").directive("uiView",d)},"./node_modules/@uirouter/angularjs/lib-esm/interface.js":()=>{},"./node_modules/@uirouter/angularjs/lib-esm/services.js":(e,t,n)=>{"use strict";n.d(t,{D:()=>k});var o=n("./node_modules/@uirouter/angularjs/lib-esm/angular.js"),r=n("./node_modules/@uirouter/core/lib-esm/index.js"),s=n("./node_modules/@uirouter/angularjs/lib-esm/statebuilders/views.js"),a=function(){function e(){var e=this;this._useHttp=o.ng.version.minor<3,this.$get=["$http","$templateCache","$injector",function(t,n,o){return e.$templateRequest=o.has&&o.has("$templateRequest")&&o.get("$templateRequest"),e.$http=t,e.$templateCache=n,e}]}return e.prototype.useHttpService=function(e){this._useHttp=e},e.prototype.fromConfig=function(e,t,n){var o=function(e){return r.services.$q.when(e).then((function(e){return{template:e}}))},s=function(e){return r.services.$q.when(e).then((function(e){return{component:e}}))};return(0,r.isDefined)(e.template)?o(this.fromString(e.template,t)):(0,r.isDefined)(e.templateUrl)?o(this.fromUrl(e.templateUrl,t)):(0,r.isDefined)(e.templateProvider)?o(this.fromProvider(e.templateProvider,t,n)):(0,r.isDefined)(e.component)?s(e.component):(0,r.isDefined)(e.componentProvider)?s(this.fromComponentProvider(e.componentProvider,t,n)):o("")},e.prototype.fromString=function(e,t){return(0,r.isFunction)(e)?e(t):e},e.prototype.fromUrl=function(e,t){return(0,r.isFunction)(e)&&(e=e(t)),null==e?null:this._useHttp?this.$http.get(e,{cache:this.$templateCache,headers:{Accept:"text/html"}}).then((function(e){return e.data})):this.$templateRequest(e)},e.prototype.fromProvider=function(e,t,n){var o=r.services.$injector.annotate(e),s=(0,r.isArray)(e)?(0,r.tail)(e):e;return new r.Resolvable("",s,o).get(n)},e.prototype.fromComponentProvider=function(e,t,n){var o=r.services.$injector.annotate(e),s=(0,r.isArray)(e)?(0,r.tail)(e):e;return new r.Resolvable("",s,o).get(n)},e.prototype.makeComponentTemplate=function(e,t,n,s){s=s||{};var a=o.ng.version.minor>=3?"::":"",d=function(e){var t=(0,r.kebobString)(e);return/^(x|data)-/.exec(t)?"x-"+t:t},u=function(e){var t=r.services.$injector.get(e+"Directive");if(!t||!t.length)throw new Error("Unable to find component named '"+e+"'");return t.map(i).reduce(r.unnestR,[])}(n).map((function(n){var o=n.name,i=n.type,u=d(o);if(e.attr(u)&&!s[o])return u+"='"+e.attr(u)+"'";var m=s[o]||o;if("@"===i)return u+"='{{"+a+"$resolve."+m+"}}'";if("&"===i){var l=t.getResolvable(m),_=l&&l.data,c=_&&r.services.$injector.annotate(_)||[];return u+"='$resolve."+m+((0,r.isArray)(_)?"["+(_.length-1)+"]":"")+"("+c.join(",")+")'"}return u+"='"+a+"$resolve."+m+"'"})).join(" "),m=d(n);return"<"+m+" "+u+">"},e}(),i=function(e){return(0,r.isObject)(e.bindToController)?d(e.bindToController):d(e.scope)},d=function(e){return Object.keys(e||{}).map((function(t){return[t,/^([=<@&])[?]?(.*)/.exec(e[t])]})).filter((function(e){return(0,r.isDefined)(e)&&(0,r.isArray)(e[1])})).map((function(e){return{name:e[1][2]||e[0],type:e[1][1]}}))},u=n("./node_modules/@uirouter/angularjs/lib-esm/stateProvider.js"),m=function(e){return function(t){var n=t[e],o="onExit"===e?"from":"to";return n?function(e,t){var s=new r.ResolveContext(e.treeChanges(o)).subContext(t.$$state()),a=(0,r.extend)(k(s),{$state$:t,$transition$:e});return r.services.$injector.invoke(n,this,a)}:void 0}},l=function(){function e(e){this._urlListeners=[],this.$locationProvider=e;var t=(0,r.val)(e);(0,r.createProxyFunctions)(t,this,t,["hashPrefix"])}return e.monkeyPatchPathParameterType=function(e){var t=e.urlMatcherFactory.type("path");t.encode=function(e){return null!=e?e.toString().replace(/(~|\/)/g,(function(e){return{"~":"~~","/":"~2F"}[e]})):e},t.decode=function(e){return null!=e?e.toString().replace(/(~~|~2F)/g,(function(e){return{"~~":"~","~2F":"/"}[e]})):e}},e.prototype.dispose=function(){},e.prototype.onChange=function(e){var t=this;return this._urlListeners.push(e),function(){return(0,r.removeFrom)(t._urlListeners)(e)}},e.prototype.html5Mode=function(){var e=this.$locationProvider.html5Mode();return(e=(0,r.isObject)(e)?e.enabled:e)&&this.$sniffer.history},e.prototype.baseHref=function(){return this._baseHref||(this._baseHref=this.$browser.baseHref()||this.$window.location.pathname)},e.prototype.url=function(e,t,n){return void 0===t&&(t=!1),(0,r.isDefined)(e)&&this.$location.url(e),t&&this.$location.replace(),n&&this.$location.state(n),this.$location.url()},e.prototype._runtimeServices=function(e,t,n,o,s){var a=this;this.$location=t,this.$sniffer=n,this.$browser=o,this.$window=s,e.$on("$locationChangeSuccess",(function(e){return a._urlListeners.forEach((function(t){return t(e)}))}));var i=(0,r.val)(t);(0,r.createProxyFunctions)(i,this,i,["replace","path","search","hash"]),(0,r.createProxyFunctions)(i,this,i,["port","protocol","host"])},e}(),_=n("./node_modules/@uirouter/angularjs/lib-esm/urlRouterProvider.js");o.ng.module("ui.router.angular1",[]);var c=o.ng.module("ui.router.init",["ng"]),h=o.ng.module("ui.router.util",["ui.router.init"]),f=o.ng.module("ui.router.router",["ui.router.util"]),p=o.ng.module("ui.router.state",["ui.router.router","ui.router.util","ui.router.angular1"]),M=o.ng.module("ui.router",["ui.router.init","ui.router.state","ui.router.angular1"]),y=(o.ng.module("ui.router.compat",["ui.router"]),null);function L(e){(y=this.router=new r.UIRouter).stateProvider=new u.X(y.stateRegistry,y.stateService),y.stateRegistry.decorator("views",s.LB),y.stateRegistry.decorator("onExit",m("onExit")),y.stateRegistry.decorator("onRetain",m("onRetain")),y.stateRegistry.decorator("onEnter",m("onEnter")),y.viewService._pluginapi._viewConfigFactory("ng1",(0,s.OB)()),y.urlService.config._decodeParams=!1;var t=y.locationService=y.locationConfig=new l(e);function n(e,n,o,r,s,a,i){return t._runtimeServices(s,e,r,n,o),delete y.router,delete y.$get,y}return l.monkeyPatchPathParameterType(y),y.router=y,y.$get=n,n.$inject=["$location","$browser","$window","$sniffer","$rootScope","$http","$templateCache"],y}L.$inject=["$locationProvider"];var g=function(e){return["$uiRouterProvider",function(t){var n=t.router[e];return n.$get=function(){return n},n}]};function Y(e,t,n){if(r.services.$injector=e,r.services.$q=t,!Object.prototype.hasOwnProperty.call(e,"strictDi"))try{e.invoke((function(e){}))}catch(t){e.strictDi=!!/strict mode/.exec(t&&t.toString())}n.stateRegistry.get().map((function(e){return e.$$state().resolvables})).reduce(r.unnestR,[]).filter((function(e){return"deferred"===e.deps})).forEach((function(t){return t.deps=e.annotate(t.resolveFn,e.strictDi)}))}function v(e){e.$watch((function(){r.trace.approximateDigests++}))}Y.$inject=["$injector","$q","$uiRouter"],v.$inject=["$rootScope"],c.provider("$uiRouter",L),f.provider("$urlRouter",["$uiRouterProvider",function(e){return e.urlRouterProvider=new _.L(e)}]),h.provider("$urlService",g("urlService")),h.provider("$urlMatcherFactory",["$uiRouterProvider",function(){return y.urlMatcherFactory}]),h.provider("$templateFactory",(function(){return new a})),p.provider("$stateRegistry",g("stateRegistry")),p.provider("$uiRouterGlobals",g("globals")),p.provider("$transitions",g("transitionService")),p.provider("$state",["$uiRouterProvider",function(){return(0,r.extend)(y.stateProvider,{$get:function(){return y.stateService}})}]),p.factory("$stateParams",["$uiRouter",function(e){return e.globals.params}]),M.factory("$view",(function(){return y.viewService})),M.service("$trace",(function(){return r.trace})),M.run(v),h.run(["$urlMatcherFactory",function(e){}]),p.run(["$state",function(e){}]),f.run(["$urlRouter",function(e){}]),c.run(Y);var k=function(e){return e.getTokens().filter(r.isString).map((function(t){var n=e.getResolvable(t);return[t,"NOWAIT"===e.getPolicy(n).async?n.promise:n.data]})).reduce(r.applyPairs,{})}},"./node_modules/@uirouter/angularjs/lib-esm/stateFilters.js":(e,t,n)=>{"use strict";var o=n("./node_modules/@uirouter/angularjs/lib-esm/angular.js");function r(e){var t=function(t,n,o){return e.is(t,n,o)};return t.$stateful=!0,t}function s(e){var t=function(t,n,o){return e.includes(t,n,o)};return t.$stateful=!0,t}r.$inject=["$state"],s.$inject=["$state"],o.ng.module("ui.router.state").filter("isState",r).filter("includedByState",s)},"./node_modules/@uirouter/angularjs/lib-esm/stateProvider.js":(e,t,n)=>{"use strict";n.d(t,{X:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/index.js"),r=function(){function e(t,n){this.stateRegistry=t,this.stateService=n,(0,o.createProxyFunctions)((0,o.val)(e.prototype),this,(0,o.val)(this))}return e.prototype.decorator=function(e,t){return this.stateRegistry.decorator(e,t)||this},e.prototype.state=function(e,t){return(0,o.isObject)(e)?t=e:t.name=e,this.stateRegistry.register(t),this},e.prototype.onInvalid=function(e){return this.stateService.onInvalid(e)},e}()},"./node_modules/@uirouter/angularjs/lib-esm/statebuilders/views.js":(e,t,n)=>{"use strict";n.d(t,{OB:()=>r,LB:()=>a,qO:()=>d});var o=n("./node_modules/@uirouter/core/lib-esm/index.js");function r(){var e=null;return function(t,n){return e=e||o.services.$injector.get("$templateFactory"),[new d(t,n,e)]}}var s=function(e,t){return e.reduce((function(e,n){return e||(0,o.isDefined)(t[n])}),!1)};function a(e){if(!e.parent)return{};var t=["component","bindings","componentProvider"],n=["templateProvider","templateUrl","template","notify","async"].concat(["controller","controllerProvider","controllerAs","resolveAs"]),r=t.concat(n);if((0,o.isDefined)(e.views)&&s(r,e))throw new Error("State '"+e.name+"' has a 'views' object. It cannot also have \"view properties\" at the state level. Move the following properties into a view (in the 'views' object): "+r.filter((function(t){return(0,o.isDefined)(e[t])})).join(", "));var a={},i=e.views||{$default:(0,o.pick)(e,r)};return(0,o.forEach)(i,(function(r,i){if(i=i||"$default",(0,o.isString)(r)&&(r={component:r}),r=(0,o.extend)({},r),s(t,r)&&s(n,r))throw new Error("Cannot combine: "+t.join("|")+" with: "+n.join("|")+" in stateview: '"+i+"@"+e.name+"'");r.resolveAs=r.resolveAs||"$resolve",r.$type="ng1",r.$context=e,r.$name=i;var d=o.ViewService.normalizeUIViewTarget(r.$context,r.$name);r.$uiViewName=d.uiViewName,r.$uiViewContextAnchor=d.uiViewContextAnchor,a[i]=r})),a}var i=0,d=function(){function e(e,t,n){var o=this;this.path=e,this.viewDecl=t,this.factory=n,this.$id=i++,this.loaded=!1,this.getTemplate=function(e,t){return o.component?o.factory.makeComponentTemplate(e,t,o.component,o.viewDecl.bindings):o.template}}return e.prototype.load=function(){var e=this,t=o.services.$q,n=new o.ResolveContext(this.path),r=this.path.reduce((function(e,t){return(0,o.extend)(e,t.paramValues)}),{}),s={template:t.when(this.factory.fromConfig(this.viewDecl,r,n)),controller:t.when(this.getController(n))};return t.all(s).then((function(t){return o.trace.traceViewServiceEvent("Loaded",e),e.controller=t.controller,(0,o.extend)(e,t.template),e}))},e.prototype.getController=function(e){var t=this.viewDecl.controllerProvider;if(!(0,o.isInjectable)(t))return this.viewDecl.controller;var n=o.services.$injector.annotate(t),r=(0,o.isArray)(t)?(0,o.tail)(t):t;return new o.Resolvable("",r,n).get(e)},e}()},"./node_modules/@uirouter/angularjs/lib-esm/urlRouterProvider.js":(e,t,n)=>{"use strict";n.d(t,{L:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/index.js"),r=function(){function e(e){this.router=e}return e.injectableHandler=function(e,t){return function(n){return o.services.$injector.invoke(t,null,{$match:n,$stateParams:e.globals.params})}},e.prototype.$get=function(){var e=this.router.urlService;return this.router.urlRouter.update(!0),e.interceptDeferred||e.listen(),this.router.urlRouter},e.prototype.rule=function(e){var t=this;if(!(0,o.isFunction)(e))throw new Error("'rule' must be a function");var n=new o.BaseUrlRule((function(){return e(o.services.$injector,t.router.locationService)}),o.identity);return this.router.urlService.rules.rule(n),this},e.prototype.otherwise=function(e){var t=this,n=this.router.urlService.rules;if((0,o.isString)(e))n.otherwise(e);else{if(!(0,o.isFunction)(e))throw new Error("'rule' must be a string or function");n.otherwise((function(){return e(o.services.$injector,t.router.locationService)}))}return this},e.prototype.when=function(t,n){return((0,o.isArray)(n)||(0,o.isFunction)(n))&&(n=e.injectableHandler(this.router,n)),this.router.urlService.rules.when(t,n),this},e.prototype.deferIntercept=function(e){this.router.urlService.deferIntercept(e)},e}()},"./node_modules/@uirouter/angularjs/lib-esm/viewScroll.js":(e,t,n)=>{"use strict";n("./node_modules/@uirouter/angularjs/lib-esm/angular.js").ng.module("ui.router.state").provider("$uiViewScroll",(function(){var e=!1;this.useAnchorScroll=function(){e=!0},this.$get=["$anchorScroll","$timeout",function(t,n){return e?t:function(e){return n((function(){e[0].scrollIntoView()}),0,!1)}}]}))},"./node_modules/@uirouter/core/lib-esm/common/common.js":(e,t,n)=>{"use strict";n.d(t,{Jz:()=>i,xZ:()=>u,Qs:()=>m,Ed:()=>l,l7:()=>_,fS:()=>c,yR:()=>h,ZT:()=>f,WR:()=>p,ED:()=>M,d3:()=>y,nA:()=>L,LH:()=>g,Wk:()=>Y,ce:()=>v,LQ:()=>k,mX:()=>j,ei:()=>w,CE:()=>b,hX:()=>D,sE:()=>T,js:()=>S,UI:()=>H,VO:()=>x,XC:()=>E,o8:()=>P,M7:()=>O,FN:()=>$,Ez:()=>A,v_:()=>R,UW:()=>F,sp:()=>W,ym:()=>C,bb:()=>I,Gb:()=>z,JG:()=>J,HX:()=>V,jv:()=>N});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),a=function(){for(var e=0,t=0,n=arguments.length;t=0&&e.splice(n,1),e})),g=(0,r.WA)((function(e,t){return e.push(t),t})),Y=function(e){return e.slice().forEach((function(t){"function"==typeof t&&t(),L(e,t)}))};function v(e){for(var t=[],n=1;n{"use strict";n.d(t,{H:()=>o,u:()=>r});var o=function(e,t){return t.reduce((function(t,n){return t[n]=(o=e+"."+n+"()",function(){throw new Error("No implementation for "+o+". The framework specific code did not implement this method.")}),t;var o}),{})},r={$q:void 0,$injector:void 0}},"./node_modules/@uirouter/core/lib-esm/common/glob.js":(e,t,n)=>{"use strict";n.d(t,{r:()=>o});var o=function(){function e(e){this.text=e,this.glob=e.split(".");var t=this.text.split(".").map((function(e){return"**"===e?"(?:|(?:\\.[^.]*)*)":"*"===e?"\\.[^.]*":"\\."+e})).join("");this.regexp=new RegExp("^"+t+"$")}return e.is=function(e){return!!/[!,*]+/.exec(e)},e.fromString=function(t){return e.is(t)?new e(t):null},e.prototype.matches=function(e){return this.regexp.test("."+e)},e}()},"./node_modules/@uirouter/core/lib-esm/common/hof.js":(e,t,n)=>{"use strict";n.d(t,{WA:()=>r,zG:()=>a,vg:()=>i,OH:()=>d,Qc:()=>u,ff:()=>m,xD:()=>l,or:()=>_,$6:()=>c,Yj:()=>h,is:()=>f,P0:()=>p,uj:()=>M});var o=function(){for(var e=0,t=0,n=arguments.length;t=e.length)return e.apply(this,arguments);var n=Array.prototype.slice.call(arguments);return t.bind.apply(t,o([this],n))}}function s(){var e=arguments,t=e.length-1;return function(){for(var n=t,o=e[t].apply(this,arguments);n--;)o=e[n].call(this,o);return o}}function a(){for(var e=[],t=0;t{"use strict";n.d(t,{o8:()=>a,$K:()=>i,Ft:()=>d,le:()=>u,mf:()=>m,hj:()=>l,HD:()=>_,Kn:()=>c,kJ:()=>h,J_:()=>f,Kj:()=>p,Qh:()=>M,tI:()=>y});var o=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),r=Object.prototype.toString,s=function(e){return function(t){return typeof t===e}},a=s("undefined"),i=(0,o.ff)(a),d=function(e){return null===e},u=(0,o.or)(d,a),m=s("function"),l=s("number"),_=s("string"),c=function(e){return null!==e&&"object"==typeof e},h=Array.isArray,f=function(e){return"[object Date]"===r.call(e)},p=function(e){return"[object RegExp]"===r.call(e)};function M(e){if(h(e)&&e.length){var t=e.slice(0,-1),n=e.slice(-1);return!(t.filter((0,o.ff)(_)).length||n.filter((0,o.ff)(m)).length)}return m(e)}var y=(0,o.xD)(c,(0,o.zG)((0,o.vg)("then"),m))},"./node_modules/@uirouter/core/lib-esm/common/queue.js":(e,t,n)=>{"use strict";n.d(t,{c:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=function(){function e(e,t){void 0===e&&(e=[]),void 0===t&&(t=null),this._items=e,this._limit=t,this._evictListeners=[],this.onEvict=(0,o.LH)(this._evictListeners)}return e.prototype.enqueue=function(e){var t=this._items;return t.push(e),this._limit&&t.length>this._limit&&this.evict(),e},e.prototype.evict=function(){var e=this._items.shift();return this._evictListeners.forEach((function(t){return t(e)})),e},e.prototype.dequeue=function(){if(this.size())return this._items.splice(0,1)[0]},e.prototype.clear=function(){var e=this._items;return this._items=[],e},e.prototype.size=function(){return this._items.length},e.prototype.remove=function(e){var t=this._items.indexOf(e);return t>-1&&this._items.splice(t,1)[0]},e.prototype.peekTail=function(){return this._items[this._items.length-1]},e.prototype.peekHead=function(){if(this.size())return this._items[0]},e}()},"./node_modules/@uirouter/core/lib-esm/common/safeConsole.js":(e,t,n)=>{"use strict";n.d(t,{L:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r={log:o.ZT,error:o.ZT,table:o.ZT},s="undefined"!=typeof document&&document.documentMode&&9===document.documentMode?window&&window.console?function(e){var t=function(t){return Function.prototype.bind.call(t,e)};return{log:t(e.log),error:t(e.log),table:t(e.log)}}(window.console):r:console.table&&console.error?console:function(e){var t=e.log.bind(e);return{log:t,error:e.error?e.error.bind(e):t,table:e.table?e.table.bind(e):t}}(console)},"./node_modules/@uirouter/core/lib-esm/common/strings.js":(e,t,n)=>{"use strict";n.d(t,{BS:()=>i,NE:()=>d,L$:()=>u,XF:()=>m,iC:()=>l,Pz:()=>h,Lb:()=>p,cW:()=>M,C7:()=>y,Fb:()=>L,HV:()=>g,PX:()=>Y,iV:()=>v});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=n("./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/hof.js");function i(e,t){return t.length<=e?t:t.substr(0,e-3)+"..."}function d(e,t){for(;t.length{"use strict";n.d(t,{g4:()=>c});var o,r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/safeConsole.js");function d(e){if(!e)return"ui-view (defunct)";var t=e.creationContext?e.creationContext.name||"(root)":"(none)";return"[ui-view#"+e.id+" "+e.$type+":"+e.fqn+" ("+e.name+"@"+t+")]"}function u(e){return(0,s.hj)(e)?o[e]:o[o[e]]}!function(e){e[e.RESOLVE=0]="RESOLVE",e[e.TRANSITION=1]="TRANSITION",e[e.HOOK=2]="HOOK",e[e.UIVIEW=3]="UIVIEW",e[e.VIEWCONFIG=4]="VIEWCONFIG"}(o||(o={}));var m=(0,r.Qc)("$id"),l=(0,r.Qc)("router.$id"),_=function(e){return"Transition #"+m(e)+"-"+l(e)},c=new(function(){function e(){this._enabled={},this.approximateDigests=0}return e.prototype._set=function(e,t){var n=this;t.length||(t=Object.keys(o).map((function(e){return parseInt(e,10)})).filter((function(e){return!isNaN(e)})).map((function(e){return o[e]}))),t.map(u).forEach((function(t){return n._enabled[t]=e}))},e.prototype.enable=function(){for(var e=[],t=0;t "+(0,a.Pz)(e))},e.prototype.traceTransitionIgnored=function(e){this.enabled(o.TRANSITION)&&i.L.log(_(e)+": Ignored <> "+(0,a.Pz)(e))},e.prototype.traceHookInvocation=function(e,t,n){if(this.enabled(o.HOOK)){var s=(0,r.Qc)("traceData.hookType")(n)||"internal",d=(0,r.Qc)("traceData.context.state.name")(n)||(0,r.Qc)("traceData.context")(n)||"unknown",u=(0,a.XF)(e.registeredHook.callback);i.L.log(_(t)+": Hook -> "+s+" context: "+d+", "+(0,a.BS)(200,u))}},e.prototype.traceHookResult=function(e,t,n){this.enabled(o.HOOK)&&i.L.log(_(t)+": <- Hook returned: "+(0,a.BS)(200,(0,a.Pz)(e)))},e.prototype.traceResolvePath=function(e,t,n){this.enabled(o.RESOLVE)&&i.L.log(_(n)+": Resolving "+e+" ("+t+")")},e.prototype.traceResolvableResolved=function(e,t){this.enabled(o.RESOLVE)&&i.L.log(_(t)+": <- Resolved "+e+" to: "+(0,a.BS)(200,(0,a.Pz)(e.data)))},e.prototype.traceError=function(e,t){this.enabled(o.TRANSITION)&&i.L.log(_(t)+": <- Rejected "+(0,a.Pz)(t)+", reason: "+e)},e.prototype.traceSuccess=function(e,t){this.enabled(o.TRANSITION)&&i.L.log(_(t)+": <- Success "+(0,a.Pz)(t)+", final state: "+e.name)},e.prototype.traceUIViewEvent=function(e,t,n){void 0===n&&(n=""),this.enabled(o.UIVIEW)&&i.L.log("ui-view: "+(0,a.NE)(30,e)+" "+d(t)+n)},e.prototype.traceUIViewConfigUpdated=function(e,t){this.enabled(o.UIVIEW)&&this.traceUIViewEvent("Updating",e," with ViewConfig from context='"+t+"'")},e.prototype.traceUIViewFill=function(e,t){this.enabled(o.UIVIEW)&&this.traceUIViewEvent("Fill",e," with: "+(0,a.BS)(200,t))},e.prototype.traceViewSync=function(e){if(this.enabled(o.VIEWCONFIG)){var t="uiview component fqn",n=e.map((function(e){var n,o=e.uiView,r=e.viewConfig,s=o&&o.fqn,a=r&&r.viewDecl.$context.name+": ("+r.viewDecl.$name+")";return(n={})[t]=s,n["view config state (view name)"]=a,n})).sort((function(e,n){return(e[t]||"").localeCompare(n[t]||"")}));i.L.table(n)}},e.prototype.traceViewServiceEvent=function(e,t){this.enabled(o.VIEWCONFIG)&&i.L.log("VIEWCONFIG: "+e+" "+function(e){var t=e.viewDecl,n=t.$context.name||"(root)";return"[View#"+e.$id+" from '"+n+"' state]: target ui-view: '"+t.$uiViewName+"@"+t.$uiViewContextAnchor+"'"}(t))},e.prototype.traceViewServiceUIViewEvent=function(e,t){this.enabled(o.VIEWCONFIG)&&i.L.log("VIEWCONFIG: "+e+" "+d(t))},e}())},"./node_modules/@uirouter/core/lib-esm/globals.js":(e,t,n)=>{"use strict";n.d(t,{k:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/params/stateParams.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/queue.js"),s=function(){function e(){this.params=new o.i,this.lastStartedTransitionId=-1,this.transitionHistory=new r.c([],1),this.successfulTransitions=new r.c([],1)}return e.prototype.dispose=function(){this.transitionHistory.clear(),this.successfulTransitions.clear(),this.transition=null},e}()},"./node_modules/@uirouter/core/lib-esm/hooks/lazyLoad.js":(e,t,n)=>{"use strict";n.d(t,{v:()=>s,A:()=>a});var o=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),r=function(e){var t=e.router,n=e.entering().filter((function(e){return!!e.$$state().lazyLoad})).map((function(t){return a(e,t)}));return o.u.$q.all(n).then((function(){if("url"!==e.originalTransition().options().source){var n=e.targetState();return t.stateService.target(n.identifier(),n.params(),n.options())}var o=t.urlService,r=o.match(o.parts()),s=r&&r.rule;if(s&&"STATE"===s.type){var a=s.state,i=r.match;return t.stateService.target(a,i,e.options())}t.urlService.sync()}))},s=function(e){return e.onBefore({entering:function(e){return!!e.lazyLoad}},r)};function a(e,t){var n=t.$$state().lazyLoad,r=n._promise;return r||(r=n._promise=o.u.$q.when(n(e,t)).then((function(t){return t&&Array.isArray(t.states)&&t.states.forEach((function(t){return e.router.stateRegistry.register(t)})),t})).then((function(e){return delete t.lazyLoad,delete t.$$state().lazyLoad,delete n._promise,e}),(function(e){return delete n._promise,o.u.$q.reject(e)}))),r}},"./node_modules/@uirouter/core/lib-esm/interface.js":(e,t,n)=>{},"./node_modules/@uirouter/core/lib-esm/params/interface.js":()=>{},"./node_modules/@uirouter/core/lib-esm/params/param.js":(e,t,n)=>{"use strict";n.d(t,{_:()=>o,d:()=>m});var o,r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),d=n("./node_modules/@uirouter/core/lib-esm/params/paramType.js"),u=Object.prototype.hasOwnProperty;!function(e){e[e.PATH=0]="PATH",e[e.SEARCH=1]="SEARCH",e[e.CONFIG=2]="CONFIG"}(o||(o={}));var m=function(){function e(e,t,n,i,m){var l=function(e,t,n){var s=!1===n.reloadOnSearch&&t===o.SEARCH||void 0,i=(0,r.sE)([n.dynamic,s],a.$K),d=(0,a.$K)(i)?{dynamic:i}:{},m=function(e){function t(){return e.value}e=function(e){return 0===["value","type","squash","array","dynamic"].filter(u.bind(e||{})).length}(e)?{value:e}:e,t.__cacheable=!0;var n=(0,a.Qh)(e.value)?e.value:t;return(0,r.l7)(e,{$$fn:n})}(n&&n.params&&n.params[e]);return(0,r.l7)(d,m)}(e,n,m);t=function(e,t,n,r,s){if(e.type&&t&&"string"!==t.name)throw new Error("Param '"+r+"' has two type configurations.");if(e.type&&t&&"string"===t.name&&s.type(e.type))return s.type(e.type);if(t)return t;if(!e.type){var a=n===o.CONFIG?"any":n===o.PATH?"path":n===o.SEARCH?"query":"string";return s.type(a)}return e.type instanceof d._?e.type:s.type(e.type)}(l,t,n,e,i.paramTypes);var _,c,h=(_={array:n===o.SEARCH&&"auto"},c=e.match(/\[\]$/)?{array:!0}:{},(0,r.l7)(_,c,l).array);t=h?t.$asArray(h,n===o.SEARCH):t;var f=void 0!==l.value||n===o.SEARCH,p=(0,a.$K)(l.dynamic)?!!l.dynamic:!!t.dynamic,M=(0,a.$K)(l.raw)?!!l.raw:!!t.raw,y=function(e,t,n){var o=e.squash;if(!t||!1===o)return!1;if(!(0,a.$K)(o)||null==o)return n;if(!0===o||(0,a.HD)(o))return o;throw new Error("Invalid squash policy: '"+o+"'. Valid policies: false, true, or arbitrary string")}(l,f,i.defaultSquashPolicy()),L=function(e,t,n,o){var i=[{from:"",to:n||t?void 0:""},{from:null,to:n||t?void 0:""}],d=(0,a.kJ)(e.replace)?e.replace:[];(0,a.HD)(o)&&d.push({from:o,to:void 0});var u=(0,r.UI)(d,(0,s.vg)("from"));return(0,r.hX)(i,(function(e){return-1===u.indexOf(e.from)})).concat(d)}(l,h,f,y),g=(0,a.$K)(l.inherit)?!!l.inherit:!!t.inherit;(0,r.l7)(this,{id:e,type:t,location:n,isOptional:f,dynamic:p,raw:M,squash:y,replace:L,inherit:g,array:h,config:l})}return e.values=function(e,t){void 0===t&&(t={});for(var n={},o=0,r=e;o{"use strict";n.d(t,{_:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),s=function(){function e(e){this.pattern=/.*/,this.inherit=!0,(0,o.l7)(this,e)}return e.prototype.is=function(e,t){return!0},e.prototype.encode=function(e,t){return e},e.prototype.decode=function(e,t){return e},e.prototype.equals=function(e,t){return e==t},e.prototype.$subPattern=function(){var e=this.pattern.toString();return e.substr(1,e.length-2)},e.prototype.toString=function(){return"{ParamType:"+this.name+"}"},e.prototype.$normalize=function(e){return this.is(e)?e:this.decode(e)},e.prototype.$asArray=function(e,t){if(!e)return this;if("auto"===e&&!t)throw new Error("'auto' array mode is for query parameters only");return new a(this,e)},e}();function a(e,t){var n=this;function s(e){return(0,r.kJ)(e)?e:(0,r.$K)(e)?[e]:[]}function a(e,n){return function(a){if((0,r.kJ)(a)&&0===a.length)return a;var i=s(a),d=(0,o.UI)(i,e);return!0===n?0===(0,o.hX)(d,(function(e){return!e})).length:function(e){switch(e.length){case 0:return;case 1:return"auto"===t?e[0]:e;default:return e}}(d)}}function i(e){return function(t,n){var o=s(t),r=s(n);if(o.length!==r.length)return!1;for(var a=0;a{"use strict";n.d(t,{p:()=>u});var o,r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),d=n("./node_modules/@uirouter/core/lib-esm/params/paramType.js"),u=function(){function e(){this.enqueue=!0,this.typeQueue=[],this.defaultTypes=(0,r.ei)(e.prototype,["hash","string","query","path","int","bool","date","json","any"]),this.types=(0,r.ED)((0,r.UI)(this.defaultTypes,(function(e,t){return new d._((0,r.l7)({name:t},e))})),{})}return e.prototype.dispose=function(){this.types={}},e.prototype.type=function(e,t,n){if(!(0,s.$K)(t))return this.types[e];if(this.types.hasOwnProperty(e))throw new Error("A type named '"+e+"' has already been defined.");return this.types[e]=new d._((0,r.l7)({name:e},t)),n&&(this.typeQueue.push({name:e,def:n}),this.enqueue||this._flushTypeQueue()),this},e.prototype._flushTypeQueue=function(){for(;this.typeQueue.length;){var e=this.typeQueue.shift();if(e.pattern)throw new Error("You cannot override a type's .pattern at runtime.");(0,r.l7)(this.types[e.name],i.u.$injector.invoke(e.def))}},e}();o=function(e){var t=function(e){return null!=e?e.toString():e},n={encode:t,decode:t,is:(0,a.is)(String),pattern:/.*/,equals:function(e,t){return e==t}};return(0,r.l7)({},n,e)},(0,r.l7)(u.prototype,{string:o({}),path:o({pattern:/[^/]*/}),query:o({}),hash:o({inherit:!1}),int:o({decode:function(e){return parseInt(e,10)},is:function(e){return!(0,s.le)(e)&&this.decode(e.toString())===e},pattern:/-?\d+/}),bool:o({encode:function(e){return e?1:0},decode:function(e){return 0!==parseInt(e,10)},is:(0,a.is)(Boolean),pattern:/0|1/}),date:o({encode:function(e){return this.is(e)?[e.getFullYear(),("0"+(e.getMonth()+1)).slice(-2),("0"+e.getDate()).slice(-2)].join("-"):void 0},decode:function(e){if(this.is(e))return e;var t=this.capture.exec(e);return t?new Date(t[1],t[2]-1,t[3]):void 0},is:function(e){return e instanceof Date&&!isNaN(e.valueOf())},equals:function(e,t){return["getFullYear","getMonth","getDate"].reduce((function(n,o){return n&&e[o]()===t[o]()}),!0)},pattern:/[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])/,capture:/([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/}),json:o({encode:r.Qs,decode:r.xZ,is:(0,a.is)(Object),equals:r.fS,pattern:/[^/]*/}),any:o({encode:r.yR,decode:r.yR,is:function(){return!0},equals:r.fS})})},"./node_modules/@uirouter/core/lib-esm/params/stateParams.js":(e,t,n)=>{"use strict";n.d(t,{i:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=function(){function e(e){void 0===e&&(e={}),(0,o.l7)(this,e)}return e.prototype.$inherit=function(e,t,n){var r,s=(0,o.mX)(t,n),a={},i=[];for(var d in s)if(s[d]&&s[d].params&&(r=Object.keys(s[d].params)).length)for(var u in r)i.indexOf(r[u])>=0||(i.push(r[u]),a[r[u]]=this[r[u]]);return(0,o.l7)({},a,e)},e}()},"./node_modules/@uirouter/core/lib-esm/path/pathNode.js":(e,t,n)=>{"use strict";n.d(t,{V:()=>a});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/params/param.js"),a=function(){function e(t){if(t instanceof e){var n=t;this.state=n.state,this.paramSchema=n.paramSchema.slice(),this.paramValues=(0,o.l7)({},n.paramValues),this.resolvables=n.resolvables.slice(),this.views=n.views&&n.views.slice()}else{var r=t;this.state=r,this.paramSchema=r.parameters({inherit:!1}),this.paramValues={},this.resolvables=r.resolvables.map((function(e){return e.clone()}))}}return e.prototype.clone=function(){return new e(this)},e.prototype.applyRawParams=function(e){return this.paramValues=this.paramSchema.reduce((function(t,n){return(0,o.bb)(t,[(r=n).id,r.value(e[r.id])]);var r}),{}),this},e.prototype.parameter=function(e){return(0,o.sE)(this.paramSchema,(0,r.OH)("id",e))},e.prototype.equals=function(e,t){var n=this.diff(e,t);return n&&0===n.length},e.prototype.diff=function(e,t){if(this.state!==e.state)return!1;var n=t?t(this):this.paramSchema;return s.d.changed(n,this.paramValues,e.paramValues)},e.clone=function(e){return e.clone()},e}()},"./node_modules/@uirouter/core/lib-esm/path/pathUtils.js":(e,t,n)=>{"use strict";n.d(t,{C:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/state/targetState.js"),a=n("./node_modules/@uirouter/core/lib-esm/path/pathNode.js"),i=function(){function e(){}return e.makeTargetState=function(e,t){var n=(0,o.Gb)(t).state;return new s.F(e,n,t.map((0,r.vg)("paramValues")).reduce(o.LQ,{}),{})},e.buildPath=function(e){var t=e.params();return e.$state().path.map((function(e){return new a.V(e).applyRawParams(t)}))},e.buildToPath=function(t,n){var o=e.buildPath(n);return n.options().inherit?e.inheritParams(t,o,Object.keys(n.params())):o},e.applyViewConfigs=function(t,n,r){n.filter((function(e){return(0,o.d3)(r,e.state)})).forEach((function(r){var s=(0,o.VO)(r.state.views||{}),a=e.subPath(n,(function(e){return e===r})),i=s.map((function(e){return t.createViewConfig(a,e)}));r.views=i.reduce(o.M7,[])}))},e.inheritParams=function(e,t,n){void 0===n&&(n=[]);var s=e.map((function(e){return e.paramSchema})).reduce(o.M7,[]).filter((function(e){return!e.inherit})).map((0,r.vg)("id"));return t.map((function(t){var i=(0,o.l7)({},t&&t.paramValues),d=(0,o.ei)(i,n);i=(0,o.CE)(i,n);var u,m,l,_=(0,o.CE)((u=e,m=t.state,l=(0,o.sE)(u,(0,r.OH)("state",m)),(0,o.l7)({},l&&l.paramValues)||{}),s),c=(0,o.l7)(i,_,d);return new a.V(t.state).applyRawParams(c)}))},e.treeChanges=function(t,n,o){for(var r,s,a,i,d,u,m=Math.min(t.length,n.length),l=0;l{"use strict";n.d(t,{u:()=>o});var o={when:{LAZY:"LAZY",EAGER:"EAGER"},async:{WAIT:"WAIT",NOWAIT:"NOWAIT"}}},"./node_modules/@uirouter/core/lib-esm/resolve/resolvable.js":(e,t,n)=>{"use strict";n.d(t,{X:()=>d});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),d=function(){function e(t,n,s,a,d){if(this.resolved=!1,this.promise=void 0,t instanceof e)(0,o.l7)(this,t);else if((0,i.mf)(n)){if((0,i.le)(t))throw new Error("new Resolvable(): token argument is required");if(!(0,i.mf)(n))throw new Error("new Resolvable(): resolveFn argument must be a function");this.token=t,this.policy=a,this.resolveFn=n,this.deps=s||[],this.data=d,this.resolved=void 0!==d,this.promise=this.resolved?r.u.$q.when(this.data):void 0}else if((0,i.Kn)(t)&&t.token&&(t.hasOwnProperty("resolveFn")||t.hasOwnProperty("data"))){var u=t;return new e(u.token,u.resolveFn,u.deps,u.policy,u.data)}}return e.prototype.getPolicy=function(e){var t=this.policy||{},n=e&&e.resolvePolicy||{};return{when:t.when||n.when||"LAZY",async:t.async||n.async||"WAIT"}},e.prototype.resolve=function(e,t){var n=this,a=r.u.$q,d=e.findNode(this),u=d&&d.state,m=this.getPolicy(u).async,l=(0,i.mf)(m)?m:o.yR;return this.promise=a.when().then((function(){return a.all(e.getDependencies(n).map((function(n){return n.get(e,t)})))})).then((function(e){return n.resolveFn.apply(null,e)})).then(l).then((function(e){return n.data=e,n.resolved=!0,n.resolveFn=null,s.g4.traceResolvableResolved(n,t),n.data}))},e.prototype.get=function(e,t){return this.promise||this.resolve(e,t)},e.prototype.toString=function(){return"Resolvable(token: "+(0,a.Pz)(this.token)+", requires: ["+this.deps.map(a.Pz)+"])"},e.prototype.clone=function(){return new e(this)},e.fromData=function(t,n){return new e(t,(function(){return n}),null,null,n)},e}()},"./node_modules/@uirouter/core/lib-esm/resolve/resolveContext.js":(e,t,n)=>{"use strict";n.d(t,{l:()=>f});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),i=n("./node_modules/@uirouter/core/lib-esm/resolve/interface.js"),d=n("./node_modules/@uirouter/core/lib-esm/resolve/resolvable.js"),u=n("./node_modules/@uirouter/core/lib-esm/path/pathUtils.js"),m=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),l=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),_=i.u.when,c=[_.EAGER,_.LAZY],h=[_.EAGER],f=function(){function e(e){this._path=e}return e.prototype.getTokens=function(){return this._path.reduce((function(e,t){return e.concat(t.resolvables.map((function(e){return e.token})))}),[]).reduce(o.v_,[])},e.prototype.getResolvable=function(e){var t=this._path.map((function(e){return e.resolvables})).reduce(o.M7,[]).filter((function(t){return t.token===e}));return(0,o.Gb)(t)},e.prototype.getPolicy=function(e){var t=this.findNode(e);return e.getPolicy(t.state)},e.prototype.subContext=function(t){return new e(u.C.subPath(this._path,(function(e){return e.state===t})))},e.prototype.addResolvables=function(e,t){var n=(0,o.sE)(this._path,(0,r.OH)("state",t)),s=e.map((function(e){return e.token}));n.resolvables=n.resolvables.filter((function(e){return-1===s.indexOf(e.token)})).concat(e)},e.prototype.resolvePath=function(e,t){var n=this;void 0===e&&(e="LAZY");var d=((0,o.d3)(c,e)?e:"LAZY")===i.u.when.EAGER?h:c;s.g4.traceResolvePath(this._path,e,t);var u=function(e,t){return function(r){return(0,o.d3)(e,n.getPolicy(r)[t])}},m=this._path.reduce((function(e,o){var s=o.resolvables.filter(u(d,"when")),a=s.filter(u(["NOWAIT"],"async")),i=s.filter((0,r.ff)(u(["NOWAIT"],"async"))),m=n.subContext(o.state),l=function(e){return e.get(m,t).then((function(t){return{token:e.token,value:t}}))};return a.forEach(l),e.concat(i.map(l))}),[]);return a.u.$q.all(m)},e.prototype.injector=function(){return this._injector||(this._injector=new p(this))},e.prototype.findNode=function(e){return(0,o.sE)(this._path,(function(t){return(0,o.d3)(t.resolvables,e)}))},e.prototype.getDependencies=function(e){var t=this,n=this.findNode(e),r=(u.C.subPath(this._path,(function(e){return e===n}))||this._path).reduce((function(e,t){return e.concat(t.resolvables)}),[]).filter((function(t){return t!==e}));return e.deps.map((function(e){var n=r.filter((function(t){return t.token===e}));if(n.length)return(0,o.Gb)(n);var s=t.injector().getNative(e);if((0,l.wV)(s))throw new Error("Could not find Dependency Injection token: "+(0,m.Pz)(e));return new d.X(e,(function(){return s}),[],s)}))},e}(),p=function(){function e(e){this.context=e,this.native=this.get("Native Injector")||a.u.$injector}return e.prototype.get=function(e){var t=this.context.getResolvable(e);if(t){if("NOWAIT"===this.context.getPolicy(t).async)return t.get(this.context);if(!t.resolved)throw new Error("Resolvable async .get() not complete:"+(0,m.Pz)(t.token));return t.data}return this.getNative(e)},e.prototype.getAsync=function(e){var t=this.context.getResolvable(e);return t?t.get(this.context):a.u.$q.when(this.native.get(e))},e.prototype.getNative=function(e){return this.native&&this.native.get(e)},e}()},"./node_modules/@uirouter/core/lib-esm/router.js":(e,t,n)=>{"use strict";n.d(t,{a:()=>y});var o=n("./node_modules/@uirouter/core/lib-esm/url/urlMatcherFactory.js"),r=n("./node_modules/@uirouter/core/lib-esm/url/urlRouter.js"),s=n("./node_modules/@uirouter/core/lib-esm/transition/transitionService.js"),a=n("./node_modules/@uirouter/core/lib-esm/view/view.js"),i=n("./node_modules/@uirouter/core/lib-esm/state/stateRegistry.js"),d=n("./node_modules/@uirouter/core/lib-esm/state/stateService.js"),u=n("./node_modules/@uirouter/core/lib-esm/globals.js"),m=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),l=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),_=n("./node_modules/@uirouter/core/lib-esm/url/urlService.js"),c=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),h=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),f=0,p=(0,h.HV)("LocationServices",["url","path","search","hash","onChange"]),M=(0,h.HV)("LocationConfig",["port","protocol","host","baseHref","html5Mode","hashPrefix"]),y=function(){function e(e,t){void 0===e&&(e=p),void 0===t&&(t=M),this.locationService=e,this.locationConfig=t,this.$id=f++,this._disposed=!1,this._disposables=[],this.trace=c.g4,this.viewService=new a.s(this),this.globals=new u.k,this.transitionService=new s.Z(this),this.urlMatcherFactory=new o.y(this),this.urlRouter=new r.g(this),this.urlService=new _.i(this),this.stateRegistry=new i.q(this),this.stateService=new d.b(this),this._plugins={},this.viewService._pluginapi._rootViewContext(this.stateRegistry.root()),this.globals.$current=this.stateRegistry.root(),this.globals.current=this.globals.$current.self,this.disposable(this.globals),this.disposable(this.stateService),this.disposable(this.stateRegistry),this.disposable(this.transitionService),this.disposable(this.urlService),this.disposable(e),this.disposable(t)}return e.prototype.disposable=function(e){this._disposables.push(e)},e.prototype.dispose=function(e){var t=this;e&&(0,l.mf)(e.dispose)?e.dispose(this):(this._disposed=!0,this._disposables.slice().forEach((function(e){try{"function"==typeof e.dispose&&e.dispose(t),(0,m.nA)(t._disposables,e)}catch(e){}})))},e.prototype.plugin=function(e,t){void 0===t&&(t={});var n=new e(this,t);if(!n.name)throw new Error("Required property `name` missing on plugin: "+n);return this._disposables.push(n),this._plugins[n.name]=n},e.prototype.getPlugin=function(e){return e?this._plugins[e]:(0,m.VO)(this._plugins)},e}()},"./node_modules/@uirouter/core/lib-esm/state/interface.js":()=>{},"./node_modules/@uirouter/core/lib-esm/state/stateBuilder.js":(e,t,n)=>{"use strict";n.d(t,{t:()=>M});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),i=n("./node_modules/@uirouter/core/lib-esm/resolve/resolvable.js"),d=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js");function u(e){return e.name}function m(e){return e.self.$$state=function(){return e},e.self}function l(e){return e.parent&&e.parent.data&&(e.data=e.self.data=(0,o.ED)(e.parent.data,e.data)),e.data}var _=function(e,t){return function(n){var s=n.self;if(s&&s.url&&s.name&&s.name.match(/\.\*\*$/)){var a={};(0,o.JG)(s,a),a.url+="{remainder:any}",s=a}var i=n.parent,d=function(e){if(!(0,r.HD)(e))return!1;var t="^"===e.charAt(0);return{val:t?e.substring(1):e,root:t}}(s.url),u=d?e.compile(d.val,{state:s}):s.url;if(!u)return null;if(!e.isMatcher(u))throw new Error("Invalid url '"+u+"' in state '"+n+"'");return d&&d.root?u:(i&&i.navigable||t()).url.append(u)}},c=function(e){return function(t){return!e(t)&&t.url?t:t.parent?t.parent.navigable:null}};function h(e){return e.parent?e.parent.path.concat(e):[e]}function f(e){var t=e.parent?(0,o.l7)({},e.parent.includes):{};return t[e.name]=!0,t}function p(e){var t,n,u=function(e){return e.provide||e.token},m=(0,a.uj)([[(0,a.vg)("resolveFn"),function(e){return new i.X(u(e),e.resolveFn,e.deps,e.policy)}],[(0,a.vg)("useFactory"),function(e){return new i.X(u(e),e.useFactory,e.deps||e.dependencies,e.policy)}],[(0,a.vg)("useClass"),function(e){return new i.X(u(e),(function(){return new e.useClass}),[],e.policy)}],[(0,a.vg)("useValue"),function(e){return new i.X(u(e),(function(){return e.useValue}),[],e.policy,e.useValue)}],[(0,a.vg)("useExisting"),function(e){return new i.X(u(e),o.yR,[e.useExisting],e.policy)}]]),l=(0,a.uj)([[(0,a.zG)((0,a.vg)("val"),r.HD),function(e){return new i.X(e.token,o.yR,[e.val],e.policy)}],[(0,a.zG)((0,a.vg)("val"),r.kJ),function(e){return new i.X(e.token,(0,o.Gb)(e.val),e.val.slice(0,-1),e.policy)}],[(0,a.zG)((0,a.vg)("val"),r.mf),function(e){return new i.X(e.token,e.val,(t=e.val,n=d.u.$injector,t.$inject||n&&n.annotate(t,n.strictDi)||"deferred"),e.policy);var t,n}]]),_=(0,a.uj)([[(0,a.is)(i.X),function(e){return e}],[function(e){return!(!e.token||!e.resolveFn)},m],[function(e){return!(!e.provide&&!e.token||!(e.useValue||e.useFactory||e.useExisting||e.useClass))},m],[function(e){return!!(e&&e.val&&((0,r.HD)(e.val)||(0,r.kJ)(e.val)||(0,r.mf)(e.val)))},l],[(0,a.P0)(!0),function(e){throw new Error("Invalid resolve value: "+(0,s.Pz)(e))}]]),c=e.resolve;return((0,r.kJ)(c)?c:(t=c,n=e.resolvePolicy||{},Object.keys(t||{}).map((function(e){return{token:e,val:t[e],deps:void 0,policy:n[e]}})))).map(_)}var M=function(){function e(e,t){this.matcher=e;var n,r=this,s=function(){return e.find("")},i=function(e){return""===e.name};this.builders={name:[u],self:[m],parent:[function(t){return i(t)?null:e.find(r.parentName(t))||s()}],data:[l],url:[_(t,s)],navigable:[c(i)],params:[(n=t.paramFactory,function(e){var t=e.url&&e.url.parameters({inherit:!1})||[],r=(0,o.VO)((0,o.js)((0,o.CE)(e.params||{},t.map((0,a.vg)("id"))),(function(t,o){return n.fromConfig(o,null,e.self)})));return t.concat(r).map((function(e){return[e.id,e]})).reduce(o.bb,{})})],views:[],path:[h],includes:[f],resolvables:[p]}}return e.prototype.builder=function(e,t){var n=this.builders,o=n[e]||[];return(0,r.HD)(e)&&!(0,r.$K)(t)?o.length>1?o:o[0]:(0,r.HD)(e)&&(0,r.mf)(t)?(n[e]=o,n[e].push(t),function(){return n[e].splice(n[e].indexOf(t,1))&&null}):void 0},e.prototype.build=function(e){var t=this.matcher,n=this.builders,r=this.parentName(e);if(r&&!t.find(r,void 0,!1))return null;for(var s in n)if(n.hasOwnProperty(s)){var a=n[s].reduce((function(e,t){return function(n){return t(n,e)}}),o.ZT);e[s]=a(e)}return e},e.prototype.parentName=function(e){var t=e.name||"",n=t.split(".");if("**"===n.pop()&&n.pop(),n.length){if(e.parent)throw new Error("States that specify the 'parent:' property should not have a '.' in their name ("+t+")");return n.join(".")}return e.parent?(0,r.HD)(e.parent)?e.parent:e.parent.name:""},e.prototype.name=function(e){var t=e.name;if(-1!==t.indexOf(".")||!e.parent)return t;var n=(0,r.HD)(e.parent)?e.parent:e.parent.name;return n?n+"."+t:t},e}()},"./node_modules/@uirouter/core/lib-esm/state/stateMatcher.js":(e,t,n)=>{"use strict";n.d(t,{Q:()=>a});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/safeConsole.js"),a=function(){function e(e){this._states=e}return e.prototype.isRelative=function(e){return 0===(e=e||"").indexOf(".")||0===e.indexOf("^")},e.prototype.find=function(e,t,n){if(void 0===n&&(n=!0),e||""===e){var a=(0,o.HD)(e),i=a?e:e.name;this.isRelative(i)&&(i=this.resolvePath(i,t));var d=this._states[i];if(d&&(a||!(a||d!==e&&d.self!==e)))return d;if(a&&n){var u=(0,r.VO)(this._states).filter((function(e){return e.__stateObjectCache.nameGlob&&e.__stateObjectCache.nameGlob.matches(i)}));return u.length>1&&s.L.error("stateMatcher.find: Found multiple matches for "+i+" using glob: ",u.map((function(e){return e.name}))),u[0]}}},e.prototype.resolvePath=function(e,t){if(!t)throw new Error("No reference point given for path '"+e+"'");for(var n=this.find(t),o=e.split("."),r=o.length,s=0,a=n;s{"use strict";n.d(t,{l:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/glob.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),i=function(){function e(t){return e.create(t||{})}return e.create=function(t){t=e.isStateClass(t)?new t:t;var n=(0,o.ED)((0,o.ED)(t,e.prototype));return t.$$state=function(){return n},n.self=t,n.__stateObjectCache={nameGlob:s.r.fromString(n.name)},n},e.prototype.is=function(e){return this===e||this.self===e||this.fqn()===e},e.prototype.fqn=function(){if(!(this.parent&&this.parent instanceof this.constructor))return this.name;var e=this.parent.fqn();return e?e+"."+this.name:this.name},e.prototype.root=function(){return this.parent&&this.parent.root()||this},e.prototype.parameters=function(e){return((e=(0,o.ce)(e,{inherit:!0,matchingKeys:null})).inherit&&this.parent&&this.parent.parameters()||[]).concat((0,o.VO)(this.params)).filter((function(t){return!e.matchingKeys||e.matchingKeys.hasOwnProperty(t.id)}))},e.prototype.parameter=function(e,t){return void 0===t&&(t={}),this.url&&this.url.parameter(e,t)||(0,o.sE)((0,o.VO)(this.params),(0,r.OH)("id",e))||t.inherit&&this.parent&&this.parent.parameter(e)},e.prototype.toString=function(){return this.fqn()},e.isStateClass=function(e){return(0,a.mf)(e)&&!0===e.__uiRouterState},e.isStateDeclaration=function(e){return(0,a.mf)(e.$$state)},e.isState=function(e){return(0,a.Kn)(e.__stateObjectCache)},e}()},"./node_modules/@uirouter/core/lib-esm/state/stateQueueManager.js":(e,t,n)=>{"use strict";n.d(t,{L:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/state/stateObject.js"),s=function(){function e(e,t,n,o){this.router=e,this.states=t,this.builder=n,this.listeners=o,this.queue=[]}return e.prototype.dispose=function(){this.queue=[]},e.prototype.register=function(e){var t=this.queue,n=r.l.create(e),s=n.name;if(!(0,o.HD)(s))throw new Error("State must have a valid name");if(this.states.hasOwnProperty(s)||(0,o.d3)(t.map((0,o.vg)("name")),s))throw new Error("State '"+s+"' is already defined");return t.push(n),this.flush(),n},e.prototype.flush=function(){for(var e=this,t=this,n=t.queue,o=t.states,r=t.builder,s=[],a=[],i={},d=function(t){return e.states.hasOwnProperty(t)&&e.states[t]},u=function(){s.length&&e.listeners.forEach((function(e){return e("registered",s.map((function(e){return e.self})))}))};n.length>0;){var m=n.shift(),l=m.name,_=r.build(m),c=a.indexOf(m);if(_){var h=d(l);if(h&&h.name===l)throw new Error("State '"+l+"' is already defined");var f=d(l+".**");f&&this.router.stateRegistry.deregister(f),o[l]=m,this.attachRoute(m),c>=0&&a.splice(c,1),s.push(m)}else{var p=i[l];if(i[l]=n.length,c>=0&&p===n.length)return n.push(m),u(),o;c<0&&a.push(m),n.push(m)}}return u(),o},e.prototype.attachRoute=function(e){if(!e.abstract&&e.url){var t=this.router.urlService.rules;t.rule(t.urlRuleFactory.create(e))}},e}()},"./node_modules/@uirouter/core/lib-esm/state/stateRegistry.js":(e,t,n)=>{"use strict";n.d(t,{q:()=>d});var o=n("./node_modules/@uirouter/core/lib-esm/state/stateMatcher.js"),r=n("./node_modules/@uirouter/core/lib-esm/state/stateBuilder.js"),s=n("./node_modules/@uirouter/core/lib-esm/state/stateQueueManager.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),d=function(){function e(e){this.router=e,this.states={},this.listeners=[],this.matcher=new o.Q(this.states),this.builder=new r.t(this.matcher,e.urlMatcherFactory),this.stateQueue=new s.L(e,this.states,this.builder,this.listeners),this._registerRoot()}return e.prototype._registerRoot=function(){(this._root=this.stateQueue.register({name:"",url:"^",views:null,params:{"#":{value:null,type:"hash",dynamic:!0}},abstract:!0})).navigable=null},e.prototype.dispose=function(){var e=this;this.stateQueue.dispose(),this.listeners=[],this.get().forEach((function(t){return e.get(t)&&e.deregister(t)}))},e.prototype.onStatesChanged=function(e){return this.listeners.push(e),function(){(0,a.nA)(this.listeners)(e)}.bind(this)},e.prototype.root=function(){return this._root},e.prototype.register=function(e){return this.stateQueue.register(e)},e.prototype._deregisterTree=function(e){var t=this,n=this.get().map((function(e){return e.$$state()})),o=function(e){var t=n.filter((function(t){return-1!==e.indexOf(t.parent)}));return 0===t.length?t:t.concat(o(t))},r=o([e]),s=[e].concat(r).reverse();return s.forEach((function(e){var n=t.router.urlService.rules;n.rules().filter((0,i.OH)("state",e)).forEach((function(e){return n.removeRule(e)})),delete t.states[e.name]})),s},e.prototype.deregister=function(e){var t=this.get(e);if(!t)throw new Error("Can't deregister state; not found: "+e);var n=this._deregisterTree(t.$$state());return this.listeners.forEach((function(e){return e("deregistered",n.map((function(e){return e.self})))})),n},e.prototype.get=function(e,t){var n=this;if(0===arguments.length)return Object.keys(this.states).map((function(e){return n.states[e].self}));var o=this.matcher.find(e,t);return o&&o.self||null},e.prototype.decorator=function(e,t){return this.builder.builder(e,t)},e}()},"./node_modules/@uirouter/core/lib-esm/state/targetState.js":(e,t,n)=>{"use strict";n.d(t,{F:()=>a});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),a=function(){function e(e,t,n,o){this._stateRegistry=e,this._identifier=t,this._identifier=t,this._params=(0,s.l7)({},n||{}),this._options=(0,s.l7)({},o||{}),this._definition=e.matcher.find(t,this._options.relative)}return e.prototype.name=function(){return this._definition&&this._definition.name||this._identifier},e.prototype.identifier=function(){return this._identifier},e.prototype.params=function(){return this._params},e.prototype.$state=function(){return this._definition},e.prototype.state=function(){return this._definition&&this._definition.self},e.prototype.options=function(){return this._options},e.prototype.exists=function(){return!(!this._definition||!this._definition.self)},e.prototype.valid=function(){return!this.error()},e.prototype.error=function(){var e=this.options().relative;if(!this._definition&&e){var t=e.name?e.name:e;return"Could not resolve '"+this.name()+"' from state '"+t+"'"}return this._definition?this._definition.self?void 0:"State '"+this.name()+"' has an invalid definition":"No such state '"+this.name()+"'"},e.prototype.toString=function(){return"'"+this.name()+"'"+(0,r.Pz)(this.params())},e.prototype.withState=function(t){return new e(this._stateRegistry,t,this._params,this._options)},e.prototype.withParams=function(t,n){void 0===n&&(n=!1);var o=n?t:(0,s.l7)({},this._params,t);return new e(this._stateRegistry,this._identifier,o,this._options)},e.prototype.withOptions=function(t,n){void 0===n&&(n=!1);var o=n?t:(0,s.l7)({},this._options,t);return new e(this._stateRegistry,this._identifier,this._params,o)},e.isDef=function(e){return e&&e.state&&((0,o.HD)(e.state)||(0,o.Kn)(e.state)&&(0,o.HD)(e.state.name))},e}()},"./node_modules/@uirouter/core/lib-esm/transition/hookBuilder.js":(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),s=n("./node_modules/@uirouter/core/lib-esm/transition/interface.js"),a=n("./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js"),i=function(){function e(e){this.transition=e}return e.prototype.buildHooksForPhase=function(e){var t=this;return this.transition.router.transitionService._pluginapi._getEvents(e).map((function(e){return t.buildHooks(e)})).reduce(o.M7,[]).filter(o.yR)},e.prototype.buildHooks=function(e){var t=this.transition,n=t.treeChanges(),r=this.getMatchingHooks(e,n,t);if(!r)return[];var i,d={transition:t,current:t.options().current};return r.map((function(r){return r.matches(n,t)[e.criteriaMatchPath.name].map((function(n){var i=(0,o.l7)({bind:r.bind,traceData:{hookType:e.name,context:n}},d),u=e.criteriaMatchPath.scope===s.c.STATE?n.state.self:null,m=new a.I(t,u,r,i);return{hook:r,node:n,transitionHook:m}}))})).reduce(o.M7,[]).sort((i=e.reverseSort,void 0===i&&(i=!1),function(e,t){var n=i?-1:1,o=(e.node.state.path.length-t.node.state.path.length)*n;return 0!==o?o:t.hook.priority-e.hook.priority})).map((function(e){return e.transitionHook}))},e.prototype.getMatchingHooks=function(e,t,n){var a=e.hookPhase===s.k.CREATE,i=this.transition.router.transitionService;return(a?[i]:[this.transition,i]).map((function(t){return t.getHooks(e.name)})).filter((0,o.sp)(r.kJ,"broken event named: "+e.name)).reduce(o.M7,[]).filter((function(e){return e.matches(t,n)}))},e}()},"./node_modules/@uirouter/core/lib-esm/transition/hookRegistry.js":(e,t,n)=>{"use strict";n.d(t,{cN:()=>s,BU:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/transition/interface.js");function s(e,t,n){var r=(0,o.HD)(t)?[t]:t;return!!((0,o.mf)(r)?r:function(e){for(var t=r,n=0;n{"use strict";var o,r;n.d(t,{k:()=>o,c:()=>r}),function(e){e[e.CREATE=0]="CREATE",e[e.BEFORE=1]="BEFORE",e[e.RUN=2]="RUN",e[e.SUCCESS=3]="SUCCESS",e[e.ERROR=4]="ERROR"}(o||(o={})),function(e){e[e.TRANSITION=0]="TRANSITION",e[e.STATE=1]="STATE"}(r||(r={}))},"./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js":(e,t,n)=>{"use strict";n.d(t,{K:()=>o,i:()=>d});var o,r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/hof.js");!function(e){e[e.SUPERSEDED=2]="SUPERSEDED",e[e.ABORTED=3]="ABORTED",e[e.INVALID=4]="INVALID",e[e.IGNORED=5]="IGNORED",e[e.ERROR=6]="ERROR"}(o||(o={}));var i=0,d=function(){function e(e,t,n){this.$id=i++,this.type=e,this.message=t,this.detail=n}return e.isRejectionPromise=function(t){return t&&"function"==typeof t.then&&(0,a.is)(e)(t._transitionRejection)},e.superseded=function(t,n){var r=new e(o.SUPERSEDED,"The transition has been superseded by a different transition",t);return n&&n.redirected&&(r.redirected=!0),r},e.redirected=function(t){return e.superseded(t,{redirected:!0})},e.invalid=function(t){return new e(o.INVALID,"This transition is invalid",t)},e.ignored=function(t){return new e(o.IGNORED,"The transition was ignored",t)},e.aborted=function(t){return new e(o.ABORTED,"The transition has been aborted",t)},e.errored=function(t){return new e(o.ERROR,"The transition errored",t)},e.normalize=function(t){return(0,a.is)(e)(t)?t:e.errored(t)},e.prototype.toString=function(){var e,t=(e=this.detail)&&e.toString!==Object.prototype.toString?e.toString():(0,s.Pz)(e),n=this;return"Transition Rejection($id: "+n.$id+" type: "+n.type+", message: "+n.message+", detail: "+t+")"},e.prototype.toPromise=function(){return(0,r.l7)((0,r.jv)(this),{_transitionRejection:this})},e}()},"./node_modules/@uirouter/core/lib-esm/transition/transitionEventType.js":(e,t,n)=>{"use strict";n.d(t,{t:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js"),r=function(e,t,n,r,s,a,i,d){void 0===s&&(s=!1),void 0===a&&(a=o.I.HANDLE_RESULT),void 0===i&&(i=o.I.REJECT_ERROR),void 0===d&&(d=!1),this.name=e,this.hookPhase=t,this.hookOrder=n,this.criteriaMatchPath=r,this.reverseSort=s,this.getResultHandler=a,this.getErrorHandler=i,this.synchronous=d}},"./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js":(e,t,n)=>{"use strict";n.d(t,{I:()=>c});var o=n("./node_modules/@uirouter/core/lib-esm/transition/interface.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),d=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),u=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),m=n("./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js"),l=n("./node_modules/@uirouter/core/lib-esm/state/targetState.js"),_={current:r.ZT,transition:null,traceData:{},bind:null},c=function(){function e(e,t,n,s){var a=this;this.transition=e,this.stateContext=t,this.registeredHook=n,this.options=s,this.isSuperseded=function(){return a.type.hookPhase===o.k.RUN&&!a.options.transition.isActive()},this.options=(0,r.ce)(s,_),this.type=n.eventType}return e.chain=function(e,t){return e.reduce((function(e,t){return e.then((function(){return t.invokeHook()}))}),t||u.u.$q.when())},e.invokeHooks=function(t,n){for(var o=0;o=t.invokeLimit&&t.deregister()}}},e.prototype.handleHookResult=function(e){var t=this;return this.getNotCurrentRejection()||((0,a.tI)(e)?e.then((function(e){return t.handleHookResult(e)})):(d.g4.traceHookResult(e,this.transition,this.options),!1===e?m.i.aborted("Hook aborted transition").toPromise():(0,i.is)(l.F)(e)?m.i.redirected(e).toPromise():void 0))},e.prototype.getNotCurrentRejection=function(){var e=this.transition.router;return e._disposed?m.i.aborted("UIRouter instance #"+e.$id+" has been stopped (disposed)").toPromise():this.transition._aborted?m.i.aborted().toPromise():this.isSuperseded()?m.i.superseded(this.options.current()).toPromise():void 0},e.prototype.toString=function(){var e=this.options,t=this.registeredHook,n=(0,i.Qc)("traceData.hookType")(e)||"internal",o=(0,i.Qc)("traceData.context.state.name")(e)||(0,i.Qc)("traceData.context")(e)||"unknown",r=(0,s.iC)(t.callback);return n+" context: "+o+", "+(0,s.BS)(200,r)},e.HANDLE_RESULT=function(e){return function(t){return e.handleHookResult(t)}},e.LOG_REJECTED_RESULT=function(e){return function(t){(0,a.tI)(t)&&t.catch((function(t){return e.logError(m.i.normalize(t))}))}},e.LOG_ERROR=function(e){return function(t){return e.logError(t)}},e.REJECT_ERROR=function(e){return function(e){return(0,r.jv)(e)}},e.THROW_ERROR=function(e){return function(e){throw e}},e}()},"./node_modules/@uirouter/core/lib-esm/transition/transitionService.js":(e,t,n)=>{"use strict";n.d(t,{Z:()=>C,q:()=>W});var o=n("./node_modules/@uirouter/core/lib-esm/transition/interface.js"),r=n("./node_modules/@uirouter/core/lib-esm/transition/transition.js"),s=n("./node_modules/@uirouter/core/lib-esm/transition/hookRegistry.js"),a=n("./node_modules/@uirouter/core/lib-esm/router.js"),i=n("./node_modules/@uirouter/core/lib-esm/resolve/index.js"),d=n("./node_modules/@uirouter/core/lib-esm/common/index.js");function u(e){e.addResolvable(i.XU.fromData(a.a,e.router),""),e.addResolvable(i.XU.fromData(r.u,e),""),e.addResolvable(i.XU.fromData("$transition$",e),""),e.addResolvable(i.XU.fromData("$stateParams",e.params()),""),e.entering().forEach((function(t){e.addResolvable(i.XU.fromData("$state$",t),t)}))}var m=["$transition$",r.u],l=(0,d.d3)(m),_=function(e){var t=(0,d.VO)(e.treeChanges()).reduce(d.M7,[]).reduce(d.v_,[]),n=function(e){return l(e.token)?i.XU.fromData(e.token,null):e};t.forEach((function(e){e.resolvables=e.resolvables.map(n)}))},c=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),h=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),f=n("./node_modules/@uirouter/core/lib-esm/state/targetState.js"),p=function(e){var t=e.to().redirectTo;if(t){var n=e.router.stateService;return(0,c.mf)(t)?h.u.$q.when(t(e)).then(o):o(t)}function o(t){if(t)return t instanceof f.F?t:(0,c.HD)(t)?n.target(t,e.params(),e.options()):t.state||t.params?n.target(t.state||e.to(),t.params||e.params(),e.options()):void 0}};function M(e){return function(t,n){return(0,n.$$state()[e])(t,n)}}var y=M("onExit"),L=M("onRetain"),g=M("onEnter"),Y=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),v=n("./node_modules/@uirouter/core/lib-esm/resolve/resolveContext.js"),k=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),j=1e3,w=function(e){return new v.l(e.treeChanges().to).resolvePath("EAGER",e).then(Y.ZT)},b=function(e,t){return new v.l(e.treeChanges().to).subContext(t.$$state()).resolvePath("LAZY",e).then(Y.ZT)},D=function(e){return new v.l(e.treeChanges().to).resolvePath("LAZY",e).then(Y.ZT)},T=function(e){var t=h.u.$q,n=e.views("entering");if(n.length)return t.all(n.map((function(e){return t.when(e.load())}))).then(Y.ZT)},S=function(e){var t=e.views("entering"),n=e.views("exiting");if(t.length||n.length){var o=e.router.viewService;n.forEach((function(e){return o.deactivateViewConfig(e)})),t.forEach((function(e){return o.activateViewConfig(e)})),o.sync()}},H=function(e){var t=e.router.globals,n=function(){t.transition===e&&(t.transition=null)};e.onSuccess({},(function(){t.successfulTransitions.enqueue(e),t.$current=e.$to(),t.current=t.$current.self,(0,Y.JG)(e.params(),t.params)}),{priority:1e4}),e.promise.then(n,n)},x=function(e){var t=e.options(),n=e.router.stateService,o=e.router.urlRouter;if("url"!==t.source&&t.location&&n.$current.navigable){var r={replace:"replace"===t.location};o.push(n.$current.navigable.url,n.params,r)}o.update(!0)},E=n("./node_modules/@uirouter/core/lib-esm/hooks/lazyLoad.js"),P=n("./node_modules/@uirouter/core/lib-esm/transition/transitionEventType.js"),O=n("./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js"),$=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),A=n("./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js");function R(e){var t=e._ignoredReason();if(t){$.g4.traceTransitionIgnored(e);var n=e.router.globals.transition;return"SameAsCurrent"===t&&n&&n.abort(),A.i.ignored().toPromise()}}function F(e){if(!e.valid())throw new Error(e.error().toString())}var W={location:!0,relative:null,inherit:!1,notify:!0,reload:!1,supercede:!0,custom:{},current:function(){return null},source:"unknown"},C=function(){function e(e){this._transitionCount=0,this._eventTypes=[],this._registeredHooks={},this._criteriaPaths={},this._router=e,this.$view=e.viewService,this._deregisterHookFns={},this._pluginapi=(0,Y.WR)((0,k.P0)(this),{},(0,k.P0)(this),["_definePathType","_defineEvent","_getPathTypes","_getEvents","getHooks"]),this._defineCorePaths(),this._defineCoreEvents(),this._registerCoreTransitionHooks(),e.globals.successfulTransitions.onEvict(_)}return e.prototype.onCreate=function(e,t,n){},e.prototype.onBefore=function(e,t,n){},e.prototype.onStart=function(e,t,n){},e.prototype.onExit=function(e,t,n){},e.prototype.onRetain=function(e,t,n){},e.prototype.onEnter=function(e,t,n){},e.prototype.onFinish=function(e,t,n){},e.prototype.onSuccess=function(e,t,n){},e.prototype.onError=function(e,t,n){},e.prototype.dispose=function(e){(0,Y.VO)(this._registeredHooks).forEach((function(e){return e.forEach((function(t){t._deregistered=!0,(0,Y.nA)(e,t)}))}))},e.prototype.create=function(e,t){return new r.u(e,t,this._router)},e.prototype._defineCoreEvents=function(){var e=o.k,t=O.I,n=this._criteriaPaths,r=!1,s=!0;this._defineEvent("onCreate",e.CREATE,0,n.to,r,t.LOG_REJECTED_RESULT,t.THROW_ERROR,s),this._defineEvent("onBefore",e.BEFORE,0,n.to),this._defineEvent("onStart",e.RUN,0,n.to),this._defineEvent("onExit",e.RUN,100,n.exiting,!0),this._defineEvent("onRetain",e.RUN,200,n.retained),this._defineEvent("onEnter",e.RUN,300,n.entering),this._defineEvent("onFinish",e.RUN,400,n.to),this._defineEvent("onSuccess",e.SUCCESS,0,n.to,r,t.LOG_REJECTED_RESULT,t.LOG_ERROR,s),this._defineEvent("onError",e.ERROR,0,n.to,r,t.LOG_REJECTED_RESULT,t.LOG_ERROR,s)},e.prototype._defineCorePaths=function(){var e=o.c.STATE,t=o.c.TRANSITION;this._definePathType("to",t),this._definePathType("from",t),this._definePathType("exiting",e),this._definePathType("retained",e),this._definePathType("entering",e)},e.prototype._defineEvent=function(e,t,n,o,r,a,i,d){void 0===r&&(r=!1),void 0===a&&(a=O.I.HANDLE_RESULT),void 0===i&&(i=O.I.REJECT_ERROR),void 0===d&&(d=!1);var u=new P.t(e,t,n,o,r,a,i,d);this._eventTypes.push(u),(0,s.BU)(this,this,u)},e.prototype._getEvents=function(e){return((0,c.$K)(e)?this._eventTypes.filter((function(t){return t.hookPhase===e})):this._eventTypes.slice()).sort((function(e,t){var n=e.hookPhase-t.hookPhase;return 0===n?e.hookOrder-t.hookOrder:n}))},e.prototype._definePathType=function(e,t){this._criteriaPaths[e]={name:e,scope:t}},e.prototype._getPathTypes=function(){return this._criteriaPaths},e.prototype.getHooks=function(e){return this._registeredHooks[e]},e.prototype._registerCoreTransitionHooks=function(){var e=this._deregisterHookFns;e.addCoreResolves=this.onCreate({},u),e.ignored=this.onBefore({},R,{priority:-9999}),e.invalid=function(e){return e.onBefore({},F,{priority:-1e4})}(this),e.redirectTo=function(e){return e.onStart({to:function(e){return!!e.redirectTo}},p)}(this),e.onExit=function(e){return e.onExit({exiting:function(e){return!!e.onExit}},y)}(this),e.onRetain=function(e){return e.onRetain({retained:function(e){return!!e.onRetain}},L)}(this),e.onEnter=function(e){return e.onEnter({entering:function(e){return!!e.onEnter}},g)}(this),e.eagerResolve=function(e){return e.onStart({},w,{priority:j})}(this),e.lazyResolve=function(e){return e.onEnter({entering:(0,k.P0)(!0)},b,{priority:j})}(this),e.resolveAll=function(e){return e.onFinish({},D,{priority:j})}(this),e.loadViews=function(e){return e.onFinish({},T)}(this),e.activateViews=function(e){return e.onSuccess({},S)}(this),e.updateGlobals=function(e){return e.onCreate({},H)}(this),e.updateUrl=function(e){return e.onSuccess({},x,{priority:9999})}(this),e.lazyLoad=(0,E.v)(this)},e}()},"./node_modules/@uirouter/core/lib-esm/url/interface.js":()=>{},"./node_modules/@uirouter/core/lib-esm/url/urlConfig.js":(e,t,n)=>{"use strict";n.d(t,{F:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/params/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),s=function(){function e(e){var t=this;this.router=e,this.paramTypes=new o.ParamTypes,this._decodeParams=!0,this._isCaseInsensitive=!1,this._isStrictMode=!0,this._defaultSquashPolicy=!1,this.dispose=function(){return t.paramTypes.dispose()},this.baseHref=function(){return t.router.locationConfig.baseHref()},this.hashPrefix=function(e){return t.router.locationConfig.hashPrefix(e)},this.host=function(){return t.router.locationConfig.host()},this.html5Mode=function(){return t.router.locationConfig.html5Mode()},this.port=function(){return t.router.locationConfig.port()},this.protocol=function(){return t.router.locationConfig.protocol()}}return e.prototype.caseInsensitive=function(e){return this._isCaseInsensitive=(0,r.$K)(e)?e:this._isCaseInsensitive},e.prototype.defaultSquashPolicy=function(e){if((0,r.$K)(e)&&!0!==e&&!1!==e&&!(0,r.HD)(e))throw new Error("Invalid squash policy: "+e+". Valid policies: false, true, arbitrary-string");return this._defaultSquashPolicy=(0,r.$K)(e)?e:this._defaultSquashPolicy},e.prototype.strictMode=function(e){return this._isStrictMode=(0,r.$K)(e)?e:this._isStrictMode},e.prototype.type=function(e,t,n){var o=this.paramTypes.type(e,t,n);return(0,r.$K)(t)?this:o},e}()},"./node_modules/@uirouter/core/lib-esm/url/urlMatcherFactory.js":(e,t,n)=>{"use strict";n.d(t,{y:()=>d});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/url/urlMatcher.js"),s=n("./node_modules/@uirouter/core/lib-esm/params/index.js"),a=function(){return(a=Object.assign||function(e){for(var t,n=1,o=arguments.length;n{"use strict";n.d(t,{g:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/url/urlRule.js"),s=function(){function e(e){var t=this;this.router=e,this.sync=function(e){return t.router.urlService.sync(e)},this.listen=function(e){return t.router.urlService.listen(e)},this.deferIntercept=function(e){return t.router.urlService.deferIntercept(e)},this.match=function(e){return t.router.urlService.match(e)},this.initial=function(e){return t.router.urlService.rules.initial(e)},this.otherwise=function(e){return t.router.urlService.rules.otherwise(e)},this.removeRule=function(e){return t.router.urlService.rules.removeRule(e)},this.rule=function(e){return t.router.urlService.rules.rule(e)},this.rules=function(){return t.router.urlService.rules.rules()},this.sort=function(e){return t.router.urlService.rules.sort(e)},this.when=function(e,n,o){return t.router.urlService.rules.when(e,n,o)},this.urlRuleFactory=new r.I(e)}return e.prototype.update=function(e){var t=this.router.locationService;e?this.location=t.url():t.url()!==this.location&&t.url(this.location,!0)},e.prototype.push=function(e,t,n){var o=n&&!!n.replace;this.router.urlService.url(e.format(t||{}),o)},e.prototype.href=function(e,t,n){var r=e.format(t);if(null==r)return null;n=n||{absolute:!1};var s=this.router.urlService.config,a=s.html5Mode();if(a||null===r||(r="#"+s.hashPrefix()+r),r=function(e,t,n,r){return"/"===r?e:t?(0,o.Lb)(r)+e:n?r.slice(1)+e:e}(r,a,n.absolute,s.baseHref()),!n.absolute||!r)return r;var i=!a&&r?"/":"",d=s.port(),u=80===d||443===d?"":":"+d;return[s.protocol(),"://",s.host(),u,i,r].join("")},Object.defineProperty(e.prototype,"interceptDeferred",{get:function(){return this.router.urlService.interceptDeferred},enumerable:!1,configurable:!0}),e}()},"./node_modules/@uirouter/core/lib-esm/url/urlRule.js":(e,t,n)=>{"use strict";n.d(t,{I:()=>d,n:()=>u});var o=n("./node_modules/@uirouter/core/lib-esm/url/urlMatcher.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),i=n("./node_modules/@uirouter/core/lib-esm/state/stateObject.js"),d=function(){function e(e){this.router=e}return e.prototype.compile=function(e){return this.router.urlMatcherFactory.compile(e)},e.prototype.create=function(e,t){var n=this,s=i.l.isState,d=i.l.isStateDeclaration,m=(0,a.uj)([[r.HD,function(e){return m(n.compile(e))}],[(0,a.is)(o.x),function(e){return n.fromUrlMatcher(e,t)}],[(0,a.or)(s,d),function(e){return n.fromState(e,n.router)}],[(0,a.is)(RegExp),function(e){return n.fromRegExp(e,t)}],[r.mf,function(e){return new u(e,t)}]]),l=m(e);if(!l)throw new Error("invalid 'what' in when()");return l},e.prototype.fromUrlMatcher=function(e,t){var n=t;(0,r.HD)(t)&&(t=this.router.urlMatcherFactory.compile(t)),(0,a.is)(o.x)(t)&&(n=function(e){return t.format(e)});var i={urlMatcher:e,matchPriority:function(t){var n=e.parameters().filter((function(e){return e.isOptional}));return n.length?n.filter((function(e){return t[e.id]})).length/n.length:1e-6},type:"URLMATCHER"};return(0,s.l7)(new u((function(t){var n=e.exec(t.path,t.search,t.hash);return e.validates(n)&&n}),n),i)},e.prototype.fromState=function(e,t){var n=i.l.isStateDeclaration(e)?e.$$state():e,o={state:n,type:"STATE"};return(0,s.l7)(this.fromUrlMatcher(n.url,(function(e){var o=t.stateService,r=t.globals;o.href(n,e)!==o.href(r.current,r.params)&&o.transitionTo(n,e,{inherit:!0,source:"url"})})),o)},e.prototype.fromRegExp=function(e,t){if(e.global||e.sticky)throw new Error("Rule RegExp must not be global or sticky");var n=(0,r.HD)(t)?function(e){return t.replace(/\$(\$|\d{1,2})/,(function(t,n){return e["$"===n?0:Number(n)]}))}:t,o={regexp:e,type:"REGEXP"};return(0,s.l7)(new u((function(t){return e.exec(t.path)}),n),o)},e.isUrlRule=function(e){return e&&["type","match","handler"].every((function(t){return(0,r.$K)(e[t])}))},e}(),u=function(e,t){var n=this;this.match=e,this.type="RAW",this.matchPriority=function(e){return 0-n.$id},this.handler=t||s.yR}},"./node_modules/@uirouter/core/lib-esm/url/urlRules.js":(e,t,n)=>{"use strict";n.d(t,{h:()=>u});var o,r=n("./node_modules/@uirouter/core/lib-esm/state/index.js"),s=n("./node_modules/@uirouter/core/lib-esm/url/urlMatcher.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),i=n("./node_modules/@uirouter/core/lib-esm/url/urlRule.js");function d(e){if(!((0,a.mf)(e)||(0,a.HD)(e)||(0,a.is)(r.TargetState)(e)||r.TargetState.isDef(e)))throw new Error("'handler' must be a string, function, TargetState, or have a state: 'newtarget' property");return(0,a.mf)(e)?e:(0,a.P0)(e)}o=function(e,t){var n=function(e,t){return(t.priority||0)-(e.priority||0)}(e,t);return 0!==n||0!==(n=function(e,t){var n={STATE:4,URLMATCHER:4,REGEXP:3,RAW:2,OTHER:1};return(n[e.type]||0)-(n[t.type]||0)}(e,t))||0!==(n=function(e,t){return e.urlMatcher&&t.urlMatcher?s.x.compare(e.urlMatcher,t.urlMatcher):0}(e,t))?n:function(e,t){var n={STATE:!0,URLMATCHER:!0};return n[e.type]&&n[t.type]?0:(e.$id||0)-(t.$id||0)}(e,t)};var u=function(){function e(e){this.router=e,this._sortFn=o,this._rules=[],this._id=0,this.urlRuleFactory=new i.I(e)}return e.prototype.dispose=function(e){this._rules=[],delete this._otherwiseFn},e.prototype.initial=function(e){var t=d(e);this.rule(this.urlRuleFactory.create((function(e,t){return 0===t.globals.transitionHistory.size()&&!!/^\/?$/.exec(e.path)}),t))},e.prototype.otherwise=function(e){var t=d(e);this._otherwiseFn=this.urlRuleFactory.create((0,a.P0)(!0),t),this._sorted=!1},e.prototype.removeRule=function(e){(0,a.nA)(this._rules,e)},e.prototype.rule=function(e){var t=this;if(!i.I.isUrlRule(e))throw new Error("invalid rule");return e.$id=this._id++,e.priority=e.priority||0,this._rules.push(e),this._sorted=!1,function(){return t.removeRule(e)}},e.prototype.rules=function(){return this.ensureSorted(),this._rules.concat(this._otherwiseFn?[this._otherwiseFn]:[])},e.prototype.sort=function(e){for(var t=this.stableSort(this._rules,this._sortFn=e||this._sortFn),n=0,o=0;o{"use strict";n.d(t,{i:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/url/urlRules.js"),s=n("./node_modules/@uirouter/core/lib-esm/url/urlConfig.js"),a=n("./node_modules/@uirouter/core/lib-esm/state/index.js"),i=function(){function e(e){var t=this;this.router=e,this.interceptDeferred=!1,this.rules=new r.h(this.router),this.config=new s.F(this.router),this.url=function(e,n,o){return t.router.locationService.url(e,n,o)},this.path=function(){return t.router.locationService.path()},this.search=function(){return t.router.locationService.search()},this.hash=function(){return t.router.locationService.hash()},this.onChange=function(e){return t.router.locationService.onChange(e)}}return e.prototype.dispose=function(){this.listen(!1),this.rules.dispose()},e.prototype.parts=function(){return{path:this.path(),search:this.search(),hash:this.hash()}},e.prototype.sync=function(e){if(!e||!e.defaultPrevented){var t=this.router,n=t.urlService,r=t.stateService,s={path:n.path(),search:n.search(),hash:n.hash()},i=this.match(s);(0,o.uj)([[o.HD,function(e){return n.url(e,!0)}],[a.TargetState.isDef,function(e){return r.go(e.state,e.params,e.options)}],[(0,o.is)(a.TargetState),function(e){return r.go(e.state(),e.params(),e.options())}]])(i&&i.rule.handler(i.match,s,this.router))}},e.prototype.listen=function(e){var t=this;if(!1!==e)return this._stopListeningFn=this._stopListeningFn||this.router.urlService.onChange((function(e){return t.sync(e)}));this._stopListeningFn&&this._stopListeningFn(),delete this._stopListeningFn},e.prototype.deferIntercept=function(e){void 0===e&&(e=!0),this.interceptDeferred=e},e.prototype.match=function(e){e=(0,o.l7)({path:"",search:{},hash:""},e);for(var t,n,r,s=this.rules.rules(),a=0;at.weight?i:t}return t},e}()},"./node_modules/@uirouter/core/lib-esm/vanilla.js":(e,t,n)=>{"use strict";n.d(t,{$q:()=>o.$q});var o=n("./node_modules/@uirouter/core/lib-esm/vanilla/index.js")},"./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js":(e,t,n)=>{"use strict";n.d(t,{U:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/vanilla/utils.js"),s=function(){function e(e,t){var n=this;this.fireAfterUpdate=t,this._listeners=[],this._listener=function(e){return n._listeners.forEach((function(t){return t(e)}))},this.hash=function(){return(0,r.en)(n._get()).hash},this.path=function(){return(0,r.en)(n._get()).path},this.search=function(){return(0,r.Qf)((0,r.en)(n._get()).search)},this._location=o.Jz.location,this._history=o.Jz.history}return e.prototype.url=function(e,t){return void 0===t&&(t=!0),(0,o.$K)(e)&&e!==this._get()&&(this._set(null,null,e,t),this.fireAfterUpdate&&this._listeners.forEach((function(t){return t({url:e})}))),(0,r.Q2)(this)},e.prototype.onChange=function(e){var t=this;return this._listeners.push(e),function(){return(0,o.nA)(t._listeners,e)}},e.prototype.dispose=function(e){(0,o.Wk)(this._listeners)},e}()},"./node_modules/@uirouter/core/lib-esm/vanilla/browserLocationConfig.js":(e,t,n)=>{"use strict";n.d(t,{u:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=function(){function e(e,t){void 0===t&&(t=!1),this._isHtml5=t,this._baseHref=void 0,this._hashPrefix=""}return e.prototype.port=function(){return location.port?Number(location.port):"https"===this.protocol()?443:80},e.prototype.protocol=function(){return location.protocol.replace(/:/g,"")},e.prototype.host=function(){return location.hostname},e.prototype.html5Mode=function(){return this._isHtml5},e.prototype.hashPrefix=function(e){return(0,o.$K)(e)?this._hashPrefix=e:this._hashPrefix},e.prototype.baseHref=function(e){return(0,o.$K)(e)&&(this._baseHref=e),(0,o.o8)(this._baseHref)&&(this._baseHref=this.getBaseHref()),this._baseHref},e.prototype.getBaseHref=function(){var e=document.getElementsByTagName("base")[0];return e&&e.href?e.href.replace(/^([^/:]*:)?\/\/[^/]*/,""):this._isHtml5?"/":location.pathname||"/"},e.prototype.dispose=function(){},e}()},"./node_modules/@uirouter/core/lib-esm/vanilla/hashLocationService.js":(e,t,n)=>{"use strict";n.d(t,{R:()=>i});var o,r=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),s=n("./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js"),a=(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=function(e){function t(t){var n=e.call(this,t,!1)||this;return r.Jz.addEventListener("hashchange",n._listener,!1),n}return a(t,e),t.prototype._get=function(){return(0,r.Ld)(this._location.hash)},t.prototype._set=function(e,t,n,o){this._location.hash=n},t.prototype.dispose=function(t){e.prototype.dispose.call(this,t),r.Jz.removeEventListener("hashchange",this._listener)},t}(s.U)},"./node_modules/@uirouter/core/lib-esm/vanilla/injector.js":(e,t,n)=>{"use strict";n("./node_modules/@uirouter/core/lib-esm/common/index.js")},"./node_modules/@uirouter/core/lib-esm/vanilla/interface.js":()=>{},"./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationConfig.js":(e,t,n)=>{"use strict";n.d(t,{W:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=function(){var e=this;this.dispose=r.ZT,this._baseHref="",this._port=80,this._protocol="http",this._host="localhost",this._hashPrefix="",this.port=function(){return e._port},this.protocol=function(){return e._protocol},this.host=function(){return e._host},this.baseHref=function(){return e._baseHref},this.html5Mode=function(){return!1},this.hashPrefix=function(t){return(0,o.$K)(t)?e._hashPrefix=t:e._hashPrefix}}},"./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationService.js":(e,t,n)=>{"use strict";n.d(t,{I:()=>a});var o,r=n("./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js"),s=(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),a=function(e){function t(t){return e.call(this,t,!0)||this}return s(t,e),t.prototype._get=function(){return this._url},t.prototype._set=function(e,t,n,o){this._url=n},t}(r.U)},"./node_modules/@uirouter/core/lib-esm/vanilla/plugins.js":(e,t,n)=>{"use strict";var o=n("./node_modules/@uirouter/core/lib-esm/vanilla/browserLocationConfig.js"),r=n("./node_modules/@uirouter/core/lib-esm/vanilla/hashLocationService.js"),s=n("./node_modules/@uirouter/core/lib-esm/vanilla/utils.js"),a=n("./node_modules/@uirouter/core/lib-esm/vanilla/pushStateLocationService.js"),i=n("./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationService.js"),d=n("./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationConfig.js");n("./node_modules/@uirouter/core/lib-esm/vanilla/injector.js"),n("./node_modules/@uirouter/core/lib-esm/vanilla/q.js"),n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),(0,s._D)("vanilla.hashBangLocation",!1,r.R,o.u),(0,s._D)("vanilla.pushStateLocation",!0,a.h,o.u),(0,s._D)("vanilla.memoryLocation",!1,i.I,d.W)},"./node_modules/@uirouter/core/lib-esm/vanilla/pushStateLocationService.js":(e,t,n)=>{"use strict";n.d(t,{h:()=>i});var o,r=n("./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),a=(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=function(e){function t(t){var n=e.call(this,t,!0)||this;return n._config=t.urlService.config,s.Jz.addEventListener("popstate",n._listener,!1),n}return a(t,e),t.prototype._getBasePrefix=function(){return(0,s.Lb)(this._config.baseHref())},t.prototype._get=function(){var e=this._location,t=e.pathname,n=e.hash,o=e.search;o=(0,s.C7)(o)[1],n=(0,s.cW)(n)[1];var r=this._getBasePrefix(),a=t===this._config.baseHref(),i=t.substr(0,r.length)===r;return(t=a?"/":i?t.substring(r.length):t)+(o?"?"+o:"")+(n?"#"+n:"")},t.prototype._set=function(e,t,n,o){var r=this._getBasePrefix(),s=n&&"/"!==n[0]?"/":"",a=""===n||"/"===n?this._config.baseHref():r+s+n;o?this._history.replaceState(e,t,a):this._history.pushState(e,t,a)},t.prototype.dispose=function(t){e.prototype.dispose.call(this,t),s.Jz.removeEventListener("popstate",this._listener)},t}(r.U)},"./node_modules/@uirouter/core/lib-esm/vanilla/q.js":(e,t,n)=>{"use strict";n.d(t,{$q:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r={when:function(e){return new Promise((function(t,n){return t(e)}))},reject:function(e){return new Promise((function(t,n){n(e)}))},defer:function(){var e={};return e.promise=new Promise((function(t,n){e.resolve=t,e.reject=n})),e},all:function(e){if((0,o.kJ)(e))return Promise.all(e);if((0,o.Kn)(e)){var t=Object.keys(e).map((function(t){return e[t].then((function(e){return{key:t,val:e}}))}));return r.all(t).then((function(e){return e.reduce((function(e,t){return e[t.key]=t.val,e}),{})}))}}}},"./node_modules/@uirouter/core/lib-esm/vanilla/utils.js":(e,t,n)=>{"use strict";n.d(t,{Qf:()=>s,en:()=>a,Q2:()=>i,_D:()=>d});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=function(e,t){var n=t[0],r=t[1];return e.hasOwnProperty(n)?(0,o.kJ)(e[n])?e[n].push(r):e[n]=[e[n],r]:e[n]=r,e},s=function(e){return e.split("&").filter(o.yR).map(o.Fb).reduce(r,{})};function a(e){var t=function(e){return e||""},n=(0,o.cW)(e).map(t),r=n[0],s=n[1],a=(0,o.C7)(r).map(t);return{path:a[0],search:a[1],hash:s,url:e}}var i=function(e){var t=e.path(),n=e.search(),r=e.hash(),s=Object.keys(n).map((function(e){var t=n[e];return((0,o.kJ)(t)?t:[t]).map((function(t){return e+"="+t}))})).reduce(o.M7,[]).join("&");return t+(s?"?"+s:"")+(r?"#"+r:"")};function d(e,t,n,o){return function(r){var s=r.locationService=new n(r),a=r.locationConfig=new o(r,t);return{name:e,service:s,configuration:a,dispose:function(e){e.dispose(s),e.dispose(a)}}}}},"./node_modules/@uirouter/core/lib-esm/view/interface.js":()=>{},"./node_modules/@uirouter/core/lib-esm/view/view.js":(e,t,n)=>{"use strict";n.d(t,{s:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),i=function(){function e(e){var t=this;this.router=e,this._uiViews=[],this._viewConfigs=[],this._viewConfigFactories={},this._listeners=[],this._pluginapi={_rootViewContext:this._rootViewContext.bind(this),_viewConfigFactory:this._viewConfigFactory.bind(this),_registeredUIView:function(e){return(0,o.sE)(t._uiViews,(function(n){return t.router.$id+"."+n.id===e}))},_registeredUIViews:function(){return t._uiViews},_activeViewConfigs:function(){return t._viewConfigs},_onSync:function(e){return t._listeners.push(e),function(){return(0,o.nA)(t._listeners,e)}}}}return e.normalizeUIViewTarget=function(e,t){void 0===t&&(t="");var n=t.split("@"),o=n[0]||"$default",r=(0,s.HD)(n[1])?n[1]:"^",a=/^(\^(?:\.\^)*)\.(.*$)/.exec(o);if(a&&(r=a[1],o=a[2]),"!"===o.charAt(0)&&(o=o.substr(1),r=""),/^(\^(?:\.\^)*)$/.exec(r)){var i=r.split(".").reduce((function(e,t){return e.parent}),e);r=i.name}else"."===r&&(r=e.name);return{uiViewName:o,uiViewContextAnchor:r}},e.prototype._rootViewContext=function(e){return this._rootContext=e||this._rootContext},e.prototype._viewConfigFactory=function(e,t){this._viewConfigFactories[e]=t},e.prototype.createViewConfig=function(e,t){var n=this._viewConfigFactories[t.$type];if(!n)throw new Error("ViewService: No view config factory registered for type "+t.$type);var o=n(e,t);return(0,s.kJ)(o)?o:[o]},e.prototype.deactivateViewConfig=function(e){a.g4.traceViewServiceEvent("<- Removing",e),(0,o.nA)(this._viewConfigs,e)},e.prototype.activateViewConfig=function(e){a.g4.traceViewServiceEvent("-> Registering",e),this._viewConfigs.push(e)},e.prototype.sync=function(){var t=this,n=this._uiViews.map((function(e){return[e.fqn,e]})).reduce(o.bb,{});function s(e){for(var t=e.viewDecl.$context,n=0;++n&&t.parent;)t=t.parent;return n}var i=(0,r.WA)((function(e,t,n,o){return t*(e(n)-e(o))})),d=this._uiViews.sort(i((function(e){var t=function(e){return e&&e.parent?t(e.parent)+1:1};return 1e4*e.fqn.split(".").length+t(e.creationContext)}),1)).map((function(o){var r=t._viewConfigs.filter(e.matches(n,o));return r.length>1&&r.sort(i(s,-1)),{uiView:o,viewConfig:r[0]}})),u=d.map((function(e){return e.viewConfig})),m=this._viewConfigs.filter((function(e){return!(0,o.d3)(u,e)})).map((function(e){return{uiView:void 0,viewConfig:e}}));d.forEach((function(e){-1!==t._uiViews.indexOf(e.uiView)&&e.uiView.configUpdated(e.viewConfig)}));var l=d.concat(m);this._listeners.forEach((function(e){return e(l)})),a.g4.traceViewSync(l)},e.prototype.registerUIView=function(e){a.g4.traceViewServiceUIViewEvent("-> Registering",e);var t=this._uiViews;return t.filter((function(t){return t.fqn===e.fqn&&t.$type===e.$type})).length&&a.g4.traceViewServiceUIViewEvent("!!!! duplicate uiView named:",e),t.push(e),this.sync(),function(){-1!==t.indexOf(e)?(a.g4.traceViewServiceUIViewEvent("<- Deregistering",e),(0,o.nA)(t)(e)):a.g4.traceViewServiceUIViewEvent("Tried removing non-registered uiView",e)}},e.prototype.available=function(){return this._uiViews.map((0,r.vg)("fqn"))},e.prototype.active=function(){return this._uiViews.filter((0,r.vg)("$config")).map((0,r.vg)("name"))},e.matches=function(e,t){return function(n){if(t.$type!==n.viewDecl.$type)return!1;var r=n.viewDecl,s=r.$uiViewName.split("."),a=t.fqn.split(".");if(!(0,o.fS)(s,a.slice(0-s.length)))return!1;var i=1-s.length||void 0,d=a.slice(0,i).join("."),u=e[d].creationContext;return r.$uiViewContextAnchor===(u&&u.name)}},e}()},"./node_modules/angular-aria/angular-aria.js":()=>{!function(e,t){"use strict";var n="ngAriaDisable",o=t.module("ngAria",["ng"]).info({angularVersion:"1.8.2"}).provider("$aria",(function(){var e={ariaHidden:!0,ariaChecked:!0,ariaReadonly:!0,ariaDisabled:!0,ariaRequired:!0,ariaInvalid:!0,ariaValue:!0,tabindex:!0,bindKeydown:!0,bindRoleForClick:!0};function o(t,o,r,a){return function(i,d,u){if(!u.hasOwnProperty(n)){var m=u.$normalize(o);!e[m]||s(d,r)||u[m]||i.$watch(u[t],(function(e){e=a?!e:!!e,d.attr(o,e)}))}}}this.config=function(n){e=t.extend(e,n)},this.$get=function(){return{config:function(t){return e[t]},$$watchExpr:o}}})),r=["BUTTON","A","INPUT","TEXTAREA","SELECT","DETAILS","SUMMARY"],s=function(e,t){if(-1!==t.indexOf(e[0].nodeName))return!0};o.directive("ngShow",["$aria",function(e){return e.$$watchExpr("ngShow","aria-hidden",[],!0)}]).directive("ngHide",["$aria",function(e){return e.$$watchExpr("ngHide","aria-hidden",[],!1)}]).directive("ngValue",["$aria",function(e){return e.$$watchExpr("ngValue","aria-checked",r,!1)}]).directive("ngChecked",["$aria",function(e){return e.$$watchExpr("ngChecked","aria-checked",r,!1)}]).directive("ngReadonly",["$aria",function(e){return e.$$watchExpr("ngReadonly","aria-readonly",r,!1)}]).directive("ngRequired",["$aria",function(e){return e.$$watchExpr("ngRequired","aria-required",r,!1)}]).directive("ngModel",["$aria",function(e){function t(t,n,o,a){return e.config(n)&&!o.attr(t)&&(a||!s(o,r))&&("hidden"!==o.attr("type")||"INPUT"!==o[0].nodeName)}function o(e,t){return!t.attr("role")&&t.attr("type")===e&&!s(t,r)}return{restrict:"A",require:"ngModel",priority:200,compile:function(r,s){if(!s.hasOwnProperty(n)){var a=function(e,t){var n=e.type,o=e.role;return"checkbox"===(n||o)||"menuitemcheckbox"===o?"checkbox":"radio"===(n||o)||"menuitemradio"===o?"radio":"range"===n||"progressbar"===o||"slider"===o?"range":""}(s);return{post:function(n,r,s,i){var d=t("tabindex","tabindex",r,!1);function u(){return i.$modelValue}switch(a){case"radio":case"checkbox":o(a,r)&&r.attr("role",a),t("aria-checked","ariaChecked",r,!1)&&n.$watch(u,"radio"===a?function(e){var t=s.value==i.$viewValue;r.attr("aria-checked",t)}:function(){r.attr("aria-checked",!i.$isEmpty(i.$viewValue))}),d&&r.attr("tabindex",0);break;case"range":if(o(a,r)&&r.attr("role","slider"),e.config("ariaValue")){var m=!r.attr("aria-valuemin")&&(s.hasOwnProperty("min")||s.hasOwnProperty("ngMin")),l=!r.attr("aria-valuemax")&&(s.hasOwnProperty("max")||s.hasOwnProperty("ngMax")),_=!r.attr("aria-valuenow");m&&s.$observe("min",(function(e){r.attr("aria-valuemin",e)})),l&&s.$observe("max",(function(e){r.attr("aria-valuemax",e)})),_&&n.$watch(u,(function(e){r.attr("aria-valuenow",e)}))}d&&r.attr("tabindex",0)}!s.hasOwnProperty("ngRequired")&&i.$validators.required&&t("aria-required","ariaRequired",r,!1)&&s.$observe("required",(function(){r.attr("aria-required",!!s.required)})),t("aria-invalid","ariaInvalid",r,!0)&&n.$watch((function(){return i.$invalid}),(function(e){r.attr("aria-invalid",!!e)}))}}}}}}]).directive("ngDisabled",["$aria",function(e){return e.$$watchExpr("ngDisabled","aria-disabled",r,!1)}]).directive("ngMessages",(function(){return{restrict:"A",require:"?ngMessages",link:function(e,t,o,r){o.hasOwnProperty(n)||t.attr("aria-live")||t.attr("aria-live","assertive")}}})).directive("ngClick",["$aria","$parse",function(e,t){return{restrict:"A",compile:function(o,a){if(!a.hasOwnProperty(n)){var i=t(a.ngClick);return function(t,n,o){s(n,r)||(e.config("bindRoleForClick")&&!n.attr("role")&&n.attr("role","button"),e.config("tabindex")&&!n.attr("tabindex")&&n.attr("tabindex",0),!e.config("bindKeydown")||o.ngKeydown||o.ngKeypress||o.ngKeyup||n.on("keydown",(function(e){var n=e.which||e.keyCode;13!==n&&32!==n||(-1!==r.indexOf(e.target.nodeName)||e.target.isContentEditable||e.preventDefault(),t.$apply((function(){i(t,{$event:e})})))})))}}}}}]).directive("ngDblclick",["$aria",function(e){return function(t,o,a){a.hasOwnProperty(n)||!e.config("tabindex")||o.attr("tabindex")||s(o,r)||o.attr("tabindex",0)}}])}(window,window.angular)},"./node_modules/angular-rateit/dist/ng-rateit.js":()=>{angular.module("ngRateIt",["ng"]).directive("ngRateIt",["$q",function(e){"use strict";return{scope:{ngModel:"=",min:"=?min",max:"=?max",step:"=?step",readOnly:"&?readOnly",pristine:"=?pristine",resetable:"&?resetable",starWidth:"=?starWidth",starHeight:"=?starHeight",canelWidth:"=?canelWidth",cancelHeight:"=?cancelHeight",rated:"&?rated",reset:"&?reset",beforeRated:"&?beforeRated",beforeReset:"&?beforeReset"},templateUrl:"ngRateIt/ng-rate-it.html",require:"ngModel",replace:!0,link:function(t,n,o){o.readOnly||(t.readOnly=function(){return!1}),o.resetable||(t.resetable=function(){return!0}),o.beforeRated||(t.beforeRated=function(){var t=e.defer();return t.resolve(),t.promise}),o.rated||(t.rated=function(){}),o.beforeReset||(t.beforeReset=function(){var t=e.defer();return t.resolve(),t.promise}),o.reset||(t.reset=function(){})},controller:"ngRateItController"}}]).controller("ngRateItController",["$scope","$timeout",function(e,t){"use strict";e.isTouch=!!window.hasOwnProperty("ontouchstart")||window.navigator.msMaxTouchPoints>0,e.orgValue=angular.copy(e.ngModel),e.min=e.min||0,e.max=e.max||5,e.step=e.step||.5,e.pristine=e.orgValue===e.ngModel,e.starWidth=e.starWidth||16,e.starPartWidth=e.starWidth*e.step,e.starHeight=e.starHeight||16,e.canelWidth=e.canelWidth||e.starWidth,e.cancelHeight=e.cancelHeight||e.starHeight;var n=e.max-e.min,o=n/e.step,r=e.$watch("ngModel",(function(){e.pristine=e.orgValue===e.ngModel})),s=function(e){return(e+1)/o*n};e.getStartParts=function(){return new Array(o)},e.getStarOffset=function(t){var n=1/e.step;return-e.starWidth/n*(t%n)},e.isSelected=function(t){return s(t)<=e.ngModel-e.min},e.removeRating=function(){e.resetable()&&!e.readOnly()&&e.beforeReset({rating:e.ngModel}).then((function(){e.ngModel=e.min,e.reset({rating:e.ngModel})}))},e.setValue=function(n){if(!e.readOnly()){var o=angular.copy(e.min+s(n));e.beforeRated({rating:o}).then((function(){e.ngModel=o,t((function(){e.rated({rating:e.ngModel})}))}))}},e.$on("$destroy",(function(){r()}))}]).run(["$templateCache",function(e){"use strict";e.put("ngRateIt/ng-rate-it.html",'
')}])},"./src/js/index.module.js":(e,t,n)=>{"use strict";n("./node_modules/angular-animate/index.js"),n("./node_modules/angular-aria/index.js"),n("./node_modules/angular-messages/index.js"),n("./node_modules/angular-material/index.js"),n("./node_modules/angular-resource/index.js"),n("./node_modules/angular-sanitize/index.js"),n("./node_modules/ng-csv/build/ng-csv.min.js"),n("./node_modules/ng-embed/src/ng-embed.js");var o=n("./node_modules/@uirouter/angularjs/lib-esm/index.js"),r=(n("./node_modules/angular-local-storage/index.js"),n("./node_modules/angular-rateit/dist/ng-rateit.js"),n("./node_modules/@flowjs/ng-flow/dist/ng-flow.js"),n("./node_modules/emojionearea/dist/emojionearea.js"),n("./node_modules/jquery-textcomplete/dist/jquery.textcomplete.js"),n("./node_modules/moment/moment.js")),s=n.n(r),a=n("./node_modules/lodash.map/index.js"),i=n.n(a);function d(e,t,n,o,r,a,d,u,m,l){const _=this;function c(n){a.updateStorage(u,{up:n}).then((o=>{var r;e.layout=o,r=!0===n?"show":"hide",t.parent.postMessage({cmd:r},"*"),l((()=>{e.$apply()}))})).catch(a.onStorageError)}_.$onInit=function(){console.debug("IndexController::onInit() VISITOR",e.visitor),e.status="init";const o=e.settings.color,s=e.settings.textColor,i=e.settings.textButtonColor||e.settings.textColor,d=e.settings.color_button,l=e.settings.backgroundColor,_=Math.max(document.documentElement.clientHeight,window.innerHeight||0),h=document.documentElement.clientWidth;document.documentElement.style.setProperty("--xc-ws-div-color",o),document.documentElement.style.setProperty("--xc-ws-text-color",s),document.documentElement.style.setProperty("--xc-ws-text-button-color",i),document.documentElement.style.setProperty("--xc-ws-button-color",d),document.documentElement.style.setProperty("--xc-ws-background-color",l),document.documentElement.style.setProperty("--xc-ws-client-height",_),document.documentElement.style.setProperty("--xc-ws-client-width",h);let f=!1;const p=t=>null!==t&&t[e.location]||{},M=a.getItem(m).then(p),y=a.getItem(u).then(p);r.all([M,y]).then((r=>{let[a,i]=r;e.visitor=a,e.layout=i,e.visitor.interaction&&e.layout.up?f=!0:e.layout.up=!0,"bottom_right"===e.settings.alignment&&c(f),n.go(function(){var t,n;const o=e.settings.online,r=!(null==e||null===(t=e.visitor)||void 0===t||null===(n=t.interaction)||void 0===n||!n.id),s=Number(e.settings.maxInteractions)&&Number(e.settings.openedInteractions)>=Number(e.settings.maxInteractions);return!!(r||!s&&o)}()?"app.online":"app.offline",null,{location:"replace"});let d="";d=e.settings.online||!e.settings.hideWhenOffline?"init":"offline",t.parent.postMessage({cmd:d,div_color:o,text_color:s,client_height:_,client_width:h},"*");const u=document.createElement("style");document.head.appendChild(u),u.sheet.insertRule(".mdi-send:before {color:"+e.settings.color+"!important}")})).catch(a.onStorageError)},_.close=function(){const t=e.visitor.interaction;if(t&&t.id){const r=o.confirm().parent(angular.element(document.querySelector("#chat-app"))).clickOutsideToClose(!0).title(e.settings.closingQuestion||"Do you want to close the interaction?").ok("Ok").cancel("Cancel");o.show(r).then((function(){return d.chatInteraction.customUpdate({id:t.id,closed:!0,closeReason:"contact"}).$promise})).then((function(){n.go("app.closing",null,{location:"replace"})})).catch((function(e){console.error("keep open",e)}))}},_.toggle=c,_.download=function(){const t=r.defer(),n=e.visitor.interaction;return n&&n.id&&d.chatInteraction.getMessages({intid:n.id,includeAll:!0}).$promise.then((function(n){t.resolve(i()(n.rows.slice(1),(function(t){let n;if("in"===t.direction&&(n=e.settings.customerAlias||e.visitor.from||"Visitor"+t.ContactId),"out"===t.direction)switch(e.settings.agentIdentifier){case"website_alias":n=t.UserId?e.settings.agentAlias+t.UserId:"System";break;case"agent_alias":n=t.UserId?t.User.alias||t.User.fullname:"System";break;case"agent_fullname":n=t.UserId?t.User.fullname:"System";break;default:n=t.UserId?e.settings.agentAlias+t.UserId:"System"}return{sender:n,message:t.body,createdAt:s()(t.createdAt).format("MM/DD/YYYY HH:mm:ss")}})))})).catch((function(e){console.error(e)})),t.promise},_.getHeaderShape=function(){return"rounded"===e.settings.header_shape?"15px":"0px"};const h={online:["online","chat","waiting","closing","unmanaged"],offline:["offline"]};Object.defineProperty(e,"actualTitle",{get(){let t=e.settings.defaultTitle;return h.online.includes(e.status)?t=e.settings.header_online:h.offline.includes(e.status)&&(t=e.settings.header_offline),t}}),window.addEventListener("message",(function(e){"show"===e.data.evt?c(!0):"hide"===e.data.evt&&c(!1)}),!1)}d.$inject=["$rootScope","$window","$state","$mdDialog","$q","RemoteStorageService","api","STORAGE_LAYOUT","STORAGE_VISITOR","$timeout"];var u=n("./node_modules/lodash.forin/index.js"),m=n.n(u),l=n("./node_modules/lodash.isnil/index.js"),_=n.n(l),c=n("./src/js/chat/chat.tpl.html"),h=n("./src/js/closing/closing.tpl.html"),f=n("./src/js/offline/offline.tpl.html"),p=n("./src/js/online/online.tpl.html"),M=n("./src/js/unmanaged/unmanaged.tpl.html"),y=n("./src/js/waiting/waiting.tpl.html");function L(e,t){const n=t.search();e.settings={cursor:"pointer",hide:!0},m()(n,(function(t,n){""===t||_()(t)||("true"===t&&(t=!0),"false"===t&&(t=!1),e.settings[n]=t)})),e.location=e.settings.location,e.layout={up:!1},e.visitor={}}function g(e,t,n,o,r){t.html5Mode(!0),n.defaults.headers.get||(n.defaults.headers.get={}),n.defaults.headers.get["If-Modified-Since"]="Mon, 26 Jul 1997 05:00:00 GMT",n.defaults.headers.get["Cache-Control"]="no-cache",n.defaults.headers.get.Pragma="no-cache",o.setPrefix(r),e.state("app",{abstract:!0}).state("app.waiting",{url:"/waiting",templateUrl:y,controller:"WaitingController as vm"}).state("app.online",{url:"/online",templateUrl:p,controller:"OnlineController as vm"}).state("app.offline",{url:"/offline",templateUrl:f,controller:"OfflineController as vm"}).state("app.chat",{url:"/chat",templateUrl:c,controller:"ChatController as vm"}).state("app.unmanaged",{url:"/unmanaged",templateUrl:M,controller:"UnmanagedController as vm"}).state("app.closing",{url:"/closing",templateUrl:h,controller:"ClosingController as vm"})}g.$inject=["$stateProvider","$locationProvider","$httpProvider","localStorageServiceProvider","STORAGE_PREFIX"],L.$inject=["$rootScope","$location"];var Y=n("./node_modules/lodash.merge/index.js"),v=n.n(Y);function k(e,t,n,o,r,s,a,i){const d=this;function u(t){return function(o){d.errors[t]=o.data;const r=n.simple().textContent(e.settings.formSubmitFailureMessage||"Form submission error").toastClass("md-failure-toast").position("top");n.show(r)}}function m(){e.loading=!1}function l(){e.settings.online?t.go("app.online",null,{location:"replace"}):t.go("app.offline",null,{location:"replace"})}function _(){d.form={},d.upColor=null,d.downColor=null,d.userForm.$setPristine(),d.userForm.$setUntouched(),delete e.visitor.interaction,e.enableDownload=!1}d.$onInit=function(){console.debug("ClosingController::onInit() VISITOR",e.visitor),e.status="closing",r.all([s.removeItem(a).then((()=>console.debug("STORAGE_VISITOR cleared"))).catch(s.onStorageError),s.removeItem(i).then((()=>console.debug("STORAGE_LAYOUT cleared"))).catch(s.onStorageError)]).then((()=>e.loading=!1))},d.submit=function(){e.loading=!0,e.visitor.interaction&&e.visitor.interaction.id?o.chatInteraction.close(v()({id:e.visitor.interaction.id,ratingType:e.settings.ratingType,customer:e.settings.customerAlias||e.visitor.from},d.form)).$promise.then((function(){delete d.errors.submit;const t=n.simple().textContent(e.settings.formSubmitSuccessMessage||"Form properly submitted").toastClass("md-success-toast").parent(angular.element(document.querySelector("#chat-toolbar")));n.show(t)})).then(_).then(l).catch(u("submit")).finally(m):(m(),u("submit"))},d.skip=function(){_(),l()},d.form={},d.errors={}}function j(e,t){const n={id:"@id",token:e.settings.token},o={};return o.baseUrl=e.settings.remote+"/api/",o.chatWebsite=t(o.baseUrl+"chat/websites/:id",n,{notify:{method:"POST",url:o.baseUrl+"chat/websites/:id/notify"},offline:{method:"POST",url:o.baseUrl+"chat/websites/:id/offline"},getFields:{method:"GET",url:o.baseUrl+"chat/websites/:id/fields"}}),o.chatInteraction=t(o.baseUrl+"chat/interactions/:id",n,{update:{method:"PUT",url:o.baseUrl+"chat/interactions/:id"},customUpdate:{method:"PUT",url:o.baseUrl+"chat/interactions/:id/custom_update"},close:{method:"PUT",url:o.baseUrl+"chat/interactions/:id/close"},getMessages:{method:"GET",url:o.baseUrl+"chat/interactions/:intid/my_messages"},uploadAttachment:{method:"POST",url:o.baseUrl+"chat/interactions/:id/attachment_upload",headers:{"Content-Type":void 0},transformRequest:angular.identity},downloadAttachment:{method:"GET",url:o.baseUrl+"chat/interactions/:id/attachment_download"},abandon:{method:"PUT",url:o.baseUrl+"chat/interactions/:id/abandon"}}),o.chatMessage=t(o.baseUrl+"chat/messages/:id",n,{update:{method:"PUT",url:o.baseUrl+"chat/messages/:id"}}),o}k.$inject=["$rootScope","$state","$mdToast","api","$q","RemoteStorageService","STORAGE_VISITOR","STORAGE_LAYOUT"],j.$inject=["$rootScope","$resource"];var w=n("./node_modules/lodash.find/index.js"),b=n.n(w),D=n("./node_modules/lodash.values/index.js"),T=n.n(D),S=n("./node_modules/jquery/dist/jquery.js");function H(e,t,n,r,s,a,i,d,u,m,l,c){const h=this;let f,p,M,y;function L(){o.$q.all([m.removeItem(l).then((()=>console.debug("STORAGE_VISITOR cleared"))).catch(m.onStorageError),m.removeItem(c).then((()=>console.debug("STORAGE_LAYOUT cleared"))).catch(m.onStorageError)]).then((()=>{t.settings.online?a.go("app.online",null,{location:"replace"}):a.go("app.offline",null,{location:"replace"})}))}function g(){n((function(){const e=s[0].getElementsByClassName("chat-messages")[0];e&&(e.scrollTop=e.scrollHeight)}))}function Y(){h.errors={},t.$emit("hide");const e=d.simple().textContent("FILE TOO BIG: The max allowed size is 16MB").toastClass("md-warning-toast size "+t.settings.header_shape).parent(angular.element(document.querySelector("#chat-toolbar")));d.show(e)}function k(e){return function(t){h.errors[e]=t.data,g()}}function j(e){u.chatWebsite.notify(e).$promise.then((function(e){h.errors={};let n=!1;_()(t.visitor.interaction)&&(t.visitor.interaction={id:e.interaction.id},n=!0),t.visitor.interactionStarted||(t.visitor.interactionStarted=!0,n=!0),n&&m.updateStorage(l,t.visitor).then((e=>{t.visitor=e})).catch(m.onStorageError),f[0].emojioneArea.setText(""),g()})).catch(k("chatMessageError"))}function w(){t.visitor&&t.visitor.interaction&&t.visitor.interaction.id&&u.chatInteraction.get({id:t.visitor.interaction.id}).$promise.then((function(e){delete h.errors.getInteraction,e.closed&&(t.visitor.interaction.closed=!0,m.updateStorage(l,t.visitor).then((e=>{t.visitor=e})).catch(m.onStorageError),"unmanaged"===e.disposition?a.go("app.unmanaged",null,{location:"replace"}):a.go("app.closing",null,{location:"replace"}))})).catch((function(e){switch(e.status){case 403:a.go("app.closing",null,{location:"replace"});break;case 404:L();break;case 405:a.go("app.unmanaged",null,{location:"replace"});break;default:console.error(e)}}))}function D(e){const n=f[0].emojioneArea.getText();e&&13===e.keyCode&&e.shiftKey||e&&13!==e.keyCode||""!==n&&j(v()({body:n},t.visitor))}function H(){var e,n;null!=t&&null!==(e=t.visitor)&&void 0!==e&&null!==(n=e.interaction)&&void 0!==n&&n.id&&u.chatInteraction.getMessages({intid:t.visitor.interaction.id,includeAgent:!0,id:y||void 0}).$promise.then((function(e){if(delete h.errors.interaction,e.count){let o=!1,r=0;for(r=0,o=!1;r{t.visitor=e}))}var n})).catch((function(e){switch(e.status){case 403:a.go("app.closing",null,{location:"replace"});break;case 405:a.go("app.unmanaged",null,{location:"replace"});break;default:console.error(e)}}))}h.errors={},t.messages=[],h.emojiOptions={watchEmbedData:!1,fontSmiley:!1,emoji:!0,link:!0,linkTarget:"_blank"},h.ngFlowOptions={allowDuplicateUploads:!0},h.$onInit=function(){console.debug("ChatController::onInit() VISITOR",t.visitor),t.status="chat",t.loading=!1,t.settings.showMenu=!0,h.replyMessage="",t.visitor.interaction&&t.visitor.interaction.closed?L():(w(),p=r(H,2e3),M=r(w,3e3)),f=S("#emojionearea").emojioneArea({placeholder:t.settings.placeholderMessage||"Type a message",events:{keyup:function(e,t){D(t)},ready:function(){this.setFocus()}}})},h.reply=D,h.reply_button=function(){const e=f[0].emojioneArea.getText();""!==e&&(j(v()({body:e},t.visitor)),f[0].emojioneArea.setFocus())},h.fileAdded=function(e){if(e.size>16777216)return void Y();const n=new FormData;n.append("file",e.file),i.post(t.settings.remote+"/api/chat/interactions/"+t.visitor.interaction.id+"/attachment_upload?token="+t.settings.token,n,{transformRequest:angular.identity,headers:{"Content-Type":void 0}}).then((function(e){(e=e.data).id?(h.errors={},j(v()({body:''+e.name+"",AttachmentId:e.id},t.visitor))):k("sendAttachment")}),k("sendAttachment"))},h.handleSizeError=Y,e.$on("$destroy",(function(){r.cancel(p),r.cancel(M),p=null,M=null})),t.$on("$download",(function(e,n){n&&n(T()(t.messages))}))}H.$inject=["$scope","$rootScope","$timeout","$interval","$document","$state","$http","$mdToast","api","RemoteStorageService","STORAGE_VISITOR","STORAGE_LAYOUT"];var x=n("./node_modules/lodash.random/index.js"),E=n.n(x),P=n("./node_modules/lodash.clonedeep/index.js"),O=n.n(P),$=n("./node_modules/json-form-data/src/jsonToFormData.js"),A=n.n($);function R(e,t,n,o,r,s,a){const i=this;let d=null,u=null;t.typeField="";const m={showLeafArrayIndexes:!0,includeNullValues:!1,mapping:function(e){return"boolean"==typeof e?+e?"1":"0":e}};function l(){delete i.errors.submit,t.$emit("hide"),i.fields=O()(u),i.form={},i.userForm.$setPristine(),i.userForm.$setUntouched();const e=r.simple().textContent(t.settings.formSubmitSuccessMessage||"Form properly submitted").toastClass("md-success-toast").parent(angular.element(document.querySelector("#chat-toolbar")));r.show(e)}i.trustAsHtml=function(e){return n.trustAsHtml(e)},i.initUploadButton=function(t){const n=i.fields[t],o=s.find(".upload-item");if(o.length){const t=angular.element(o[0].querySelector(".upload-button")),r=angular.element(o[0].querySelector("input[type=file]")),s=t.find("label");s.length&&s.css("display","none"),t.on("click",(()=>{s.css("display","none"),"function"==typeof r.trigger?r.trigger("click"):r[0].click()})),r.on("change",(t=>{e.$apply((function(){"string"==typeof n.props.error&&(n.props.error=null);const e=Array.from(t.target.files),o=1048576*n.config.size;e.some((e=>e.size>=o))?(n.options=[],n.props.error=n.config.sizeErrMessage):n.options=e.map((e=>{const{name:t,size:n,type:o}=e;return{name:t,size:n,type:o,file:e}})),i.form[n.props.title]=n.options}))}))}},i.removeFileItem=function(e,t){e.options.splice(t,1),i.form[e.props.title]=e.options},i.setupFileInput=function(e){console.log("form item setup",e);const t=s.find(".upload-item"),n=angular.element(t[0].querySelector("input[type=file]")),{multipleUpload:o,accept:r}=e.config;o&&n.attr("multiple","multiple"),r&&n[0].setAttribute("accept",r)},i.makeFileOptionsVisible=function(){const e=Array.from(s.find(".filename-label")),t=e[e.length-1];t&&t.scrollIntoView&&t.scrollIntoView()},i.$onInit=function(){console.debug("OfflineController::onInit() VISITOR",t.visitor),t.status="offline",i.visitor={id:t.settings.id,mapKeyOffline:"firstName",from:"Anonymous"+E()(1,1e6)},t.settings.showMenu=!1,t.loading=!1,o.chatWebsite.getFields({id:t.settings.id,online:!1}).$promise.then((function(e){e.count&&(d=e.fromKey,u=O()(e.rows),i.fields=O()(u))})).then((function(){for(let e=0;e]+)>)/i);i.checkHTML[e]=t(n.props.helpText)}}})).catch((function(e){console.error(e)}))},i.submit=function(){t.loading=!0;const e={...i.form};for(let n=0;ne.file))))}const n=Array.isArray(i.fields)?i.fields.filter((e=>"upload"===e.type)):[],s=v()({body:e},i.visitor),u=null!=e&&n.length>0,c=null!==e&&"{}"!==JSON.stringify(e);var h,f;(u?(h=s,a({url:`${o.baseUrl}chat/websites/${h.id}/offline`,headers:{"Content-Type":void 0},data:A()(h,{...m,initialFormData:new FormData}),method:"POST"})):c?o.chatWebsite.offline(s).$promise:Promise.reject("INVALID_FORM")).then(l).catch((f="submit",function(e){const n=r.simple().textContent(t.settings.formSubmitFailureMessage||"Form submission error").toastClass("md-failure-toast").parent(angular.element(document.querySelector("#chat-toolbar")));r.show(n),i.errors[f]=e.data})).finally((()=>{i.form.invalid||(i.form={}),t.loading=!1}))},i.toggle=function(e,t){i.form[e]||(i.form[e]=[]);const n=i.form[e].indexOf(t);n>-1?i.form[e].splice(n,1):i.form[e].push(t)},i.exists=function(e,t){return i.form[e]||(i.form[e]=[]),i.form[e].indexOf(t)>-1},i.checkHTML=[],i.form={},i.errors={},i.userForm={}}function F(e,t,n,o,r,s){const a=this;let i=null;function d(){return e.visitor={id:e.settings.id,mapKey:"firstName",from:"Anonymous"+E()(1,1e6)},e.settings.showMenu=!1,r.updateStorage(s,e.visitor).then((t=>(e.visitor=t,o.chatWebsite.getFields({id:e.settings.id,online:!0}).$promise.then((function(e){e.count&&(i=e.fromKey,a.fields=e.rows)})).then((function(){for(let e=0;e]+)>)/i);a.checkHTML[e]=n(t.props.helpText)}}})).catch((function(e){console.error(e)}))))).catch(r.onStorageError)}a.checkHTML=[],a.form={},a.errors={},a.userForm={},a.disableItem=!1,a.trustAsHtml=function(e){return n.trustAsHtml(e)},a.$onInit=function(){if(console.debug("OnlineController::onInit() VISITOR",e.visitor),e.status="online",e.visitor&&e.visitor.interaction)if(e.visitor.interaction.id)if(!0===e.visitor.interactionStarted)t.go("app.chat",null,{location:"replace"});else{var n,r;const t=e.visitor.interaction.id,s=null==e||null===(n=e.visitor)||void 0===n||null===(r=n.message)||void 0===r?void 0:r.id;if(s){const e={id:t,channel:"chat",interaction:{id:t},message:{id:s},disposition:"abandoned",closed:!0,closeReason:"contact"};o.chatInteraction.abandon(e).$promise.finally((()=>d()))}}else t.go("app.waiting",null,{location:"replace"});else d()},a.submit=function(){let n="New chat request \n";for(let t=0;t{e.visitor=t})).catch(r.onStorageError),a.disableItem=!1,e.settings.enableCustomerWriting?t.go("app.chat",null,{location:"replace"}):t.go("app.waiting",null,{location:"replace"})})).catch((function(e){a.disableItem=!1,console.error(e)}))},a.toggle=function(e,t){a.form[e]||(a.form[e]=[]);const n=a.form[e].indexOf(t);n>-1?a.form[e].splice(n,1):a.form[e].push(t)},a.exists=function(e,t){return a.form[e]||(a.form[e]=[]),a.form[e].indexOf(t)>-1}}function W(e,t,n,o,r,s,a,i){const d=this;function u(){e.settings.online?t.go("app.online",null,{location:"replace"}):t.go("app.offline",null,{location:"replace"})}function m(){d.form={},d.upColor=null,d.downColor=null,d.userForm.$setPristine(),d.userForm.$setUntouched(),e.visitor={},e.enableDownload=!1,e.$emit("hide")}function l(t){return function(o){d.errors[t]=o.data;const r=n.simple().textContent(e.settings.formSubmitFailureMessage||"Form submission error").toastClass("md-failure-toast").parent(angular.element(document.querySelector("#chat-toolbar")));n.show(r)}}function _(){e.loading=!1}d.form={},d.errors={},d.$onInit=function(){console.debug("UnmanagedController::onInit() VISITOR",e.visitor),e.status="unmanaged",r.all([s.removeItem(a).then((()=>console.debug("STORAGE_VISITOR cleared"))).catch(s.onStorageError),s.removeItem(i).then((()=>console.debug("STORAGE_LAYOUT cleared"))).catch(s.onStorageError)]).then((()=>e.loading=!1))},d.submit=function(){e.loading=!0,e.visitor.interaction&&e.visitor.interaction.id?o.chatInteraction.customUpdate({id:e.visitor.interaction.id,note:d.form.note}).$promise.then((function(){delete d.errors.submit;const t=n.simple().textContent(e.settings.formSubmitSuccessMessage||"Form properly submitted").toastClass("md-success-toast").parent(angular.element(document.querySelector("#chat-toolbar")));n.show(t)})).then(m).then(u).catch(l("submit")).finally(_):(_(),l("submit"))},d.skip=function(){m(),u()}}function C(e,t,n,o,r,s,a){let i=null;function d(){let t={},n=!1;r.chatInteraction.get({id:e.visitor.interaction.id}).$promise.then((function(n){return t=n,r.chatInteraction.getMessages({intid:e.visitor.interaction.id}).$promise})).then((function(r){n=r.rows.length>1,t.closed?(e.visitor.interaction.closed=!0,s.updateStorage(a,e.visitor).then((n=>{e.visitor=n,"unmanaged"===t.disposition&&o.go("app.unmanaged",null,{location:"replace"})})).catch(s.onStorageError)):(t.UserId||n)&&(t.UserId&&(e.visitor.interaction.UserId=t.UserId),s.updateStorage(a,{...e.visitor,interactionStarted:!0}).then((t=>{e.visitor=t,o.go("app.chat",null,{location:"replace"})})).catch(s.onStorageError))})).catch((function(e){switch(e.status){case 403:o.go("app.closing",null,{location:"replace"});break;case 405:o.go("app.unmanaged",null,{location:"replace"});break;default:console.error(e)}}))}this.$onInit=function(){console.debug("WaitingController::onInit() VISITOR",e.visitor),e.status="waiting",e.visitor&&e.visitor.interaction&&e.visitor.interaction.id&&(i=n(d,3e3))},t.$on("$destroy",(function(){n.cancel(i)}))}function I(e,t){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.add(e)}function z(e,t,n){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return n}R.$inject=["$scope","$rootScope","$sce","api","$mdToast","$element","$http"],F.$inject=["$rootScope","$state","$sce","api","RemoteStorageService","STORAGE_VISITOR"],W.$inject=["$rootScope","$state","$mdToast","api","$q","RemoteStorageService","STORAGE_VISITOR","STORAGE_LAYOUT"],C.$inject=["$rootScope","$scope","$interval","$state","api","RemoteStorageService","STORAGE_VISITOR"];var J=new WeakSet,V=new WeakSet;class N{constructor(e,t,n){I(this,V),I(this,J),this.remoteAddress=new URL(t.settings.address).origin,this.location=t.settings.location,this.$q=n,this.$window=e}setItem(e,t){const n="setItem";return this.$q((o=>{z(this,J,U).call(this,n,e,(()=>{o()})),this.$window.parent.postMessage({action:n,key:e,value:t},this.remoteAddress)}))}getItem(e){const t="getItem";return this.$q((n=>{z(this,J,U).call(this,t,e,((e,t)=>{n(t)})),this.$window.parent.postMessage({action:t,key:e},this.remoteAddress)}))}removeItem(e){const t="removeItem";return this.$q((n=>{z(this,J,U).call(this,t,e,(()=>{n()})),this.$window.parent.postMessage({action:t,key:e},this.remoteAddress)}))}updateStorage(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return this.getItem(e).then((o=>{const r=z(this,V,q).call(this,o)||{};return n?delete r[this.location]:r[this.location]=t,this.setItem(e,r).then((()=>r[this.location]))}))}onStorageError(e){console.error("Storage Error",e)}}function U(e,t,n){const o=r=>{const s=`${e}Result`;if(r.origin===this.remoteAddress&&t===r.data.key&&s===r.data.action){const{action:e,item:s}=r.data;switch(console.debug(`[Key = ${t}] Action "${e}" event from parent`,r),e){case"setItemResult":n(t);break;case"getItemResult":n(t,s);break;case"removeItemResult":n(t);break;default:console.debug("Unsupported action",e)}this.$window.removeEventListener("message",o,!1)}};this.$window.addEventListener("message",o,!1)}function q(e){let t=e;if("string"==typeof t)try{t=JSON.parse(e)}catch(n){console.warn(`Could not parse "${e}"`,n),t=e}return t}function G(e){return function(t){return e.trustAsHtml(t)}}N.$inject=["$window","$rootScope","$q"],G.$inject=["$sce"],angular.module("motion-chat",["ngAnimate","ngAria","ngMessages","ngMaterial","ngResource","ngSanitize","ngCsv","ngEmbed","ui.router","LocalStorageModule","ngRateIt","flow"]).filter("toTrusted",G).constant("STORAGE_PREFIX","motion_chat").constant("STORAGE_VISITOR","visitor").constant("STORAGE_LAYOUT","layout").service("RemoteStorageService",N).directive("ngEnter",(function(){return function(e,t,n){t.bind("keydown keypress",(function(t){13===t.which&&(e.$apply((function(){e.$eval(n.ngEnter)})),t.preventDefault())}))}})).directive("ngPrint",(function(){return{link:function(e,t){t.on("click",(function(){document.getElementById("chatContent1")&&function(e,t){const n=document.createElement("div"),o=t.visitor,r=t.settings;let a;for(let e=0;e"+document.title+""),i.document.write(""),i.document.write("

Website: "+r.referer+"

"),i.document.write("

Start Time: "+s()(a).format("YYYY-MM-DD HH:mm:ss")+"

"),i.document.write("

Print Time: "+s()().format("YYYY-MM-DD HH:mm:ss")+"

"),i.document.write(n.innerHTML),i.document.write(""),i.document.close(),i.focus(),i.print(),i.close()}(0,e)}))},restrict:"A"}})).controller("ChatController",H).controller("ClosingController",k).config(["$mdGestureProvider",function(e){e.skipClickHijack()}]).controller("IndexController",d).factory("api",j).config(g).run(L).controller("OfflineController",R).config(["$mdGestureProvider",function(e){e.skipClickHijack()}]).controller("OnlineController",F).controller("UnmanagedController",W).controller("WaitingController",C)},"./node_modules/expose-loader/dist/runtime/getGlobalThis.js":(e,t,n)=>{"use strict";e.exports=function(){if("object"==typeof globalThis)return globalThis;var e;try{e=this||new Function("return this")()}catch(e){if("object"==typeof window)return window;if("object"==typeof self)return self;if(void 0!==n.g)return n.g}return e}()},"./node_modules/json-form-data/src/jsonToFormData.js":function(e,t){var n,o;(o=this)||(o={}),void 0===(n=function(){return o.jsonToFormData=function(){function e(e){return"[object Array]"==={}.toString.call(e)}function t(t){return!(e(t)||"object"!=typeof t||!t||t instanceof Blob||t instanceof Date)}function n(){return"function"==typeof FormData}function o(){if(n())return new FormData}function r(n,o,s,a){var i=0;for(var d in n){if(n.hasOwnProperty(d)){var u=a||d,m=o.mapping(n[d]);if(a&&t(n)&&(u=a+"["+d+"]"),a&&e(n)&&(u=e(m)||o.showLeafArrayIndexes?a+"["+i+"]":a+"[]"),e(m)||t(m))r(m,o,s,u);else if(m instanceof FileList)for(var l=0;l=20?"ste":"de")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-dz.js":function(e,t,n){!function(e){"use strict";var t=function(e){return 0===e?0:1===e?1:2===e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},n={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية"],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة"],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة"],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم"],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر"],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام"]},o=function(e){return function(o,r,s,a){var i=t(o),d=n[e][t(o)];return 2===i&&(d=d[r?0:1]),d.replace(/%d/i,o)}},r=["جانفي","فيفري","مارس","أفريل","ماي","جوان","جويلية","أوت","سبتمبر","أكتوبر","نوفمبر","ديسمبر"];e.defineLocale("ar-dz",{months:r,monthsShort:r,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/‏M/‏YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,n){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:o("s"),ss:o("s"),m:o("m"),mm:o("m"),h:o("h"),hh:o("h"),d:o("d"),dd:o("d"),M:o("M"),MM:o("M"),y:o("y"),yy:o("y")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:0,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-kw.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ar-kw",{months:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekdays:"الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:0,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-ly.js":function(e,t,n){!function(e){"use strict";var t={1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",0:"0"},n=function(e){return 0===e?0:1===e?1:2===e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},o={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية"],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة"],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة"],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم"],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر"],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام"]},r=function(e){return function(t,r,s,a){var i=n(t),d=o[e][n(t)];return 2===i&&(d=d[r?0:1]),d.replace(/%d/i,t)}},s=["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر"];e.defineLocale("ar-ly",{months:s,monthsShort:s,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/‏M/‏YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,n){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:r("s"),ss:r("s"),m:r("m"),mm:r("m"),h:r("h"),hh:r("h"),d:r("d"),dd:r("d"),M:r("M"),MM:r("M"),y:r("y"),yy:r("y")},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-ma.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ar-ma",{months:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"احد_اثنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-sa.js":function(e,t,n){!function(e){"use strict";var t={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},n={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"};e.defineLocale("ar-sa",{months:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,n){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},preparse:function(e){return e.replace(/[١٢٣٤٥٦٧٨٩٠]/g,(function(e){return n[e]})).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-tn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ar-tn",{months:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),monthsShort:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar.js":function(e,t,n){!function(e){"use strict";var t={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},n={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},o=function(e){return 0===e?0:1===e?1:2===e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},r={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية"],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة"],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة"],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم"],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر"],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام"]},s=function(e){return function(t,n,s,a){var i=o(t),d=r[e][o(t)];return 2===i&&(d=d[n?0:1]),d.replace(/%d/i,t)}},a=["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر"];e.defineLocale("ar",{months:a,monthsShort:a,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/‏M/‏YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,n){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:s("s"),ss:s("s"),m:s("m"),mm:s("m"),h:s("h"),hh:s("h"),d:s("d"),dd:s("d"),M:s("M"),MM:s("M"),y:s("y"),yy:s("y")},preparse:function(e){return e.replace(/[١٢٣٤٥٦٧٨٩٠]/g,(function(e){return n[e]})).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/az.js":function(e,t,n){!function(e){"use strict";var t={1:"-inci",5:"-inci",8:"-inci",70:"-inci",80:"-inci",2:"-nci",7:"-nci",20:"-nci",50:"-nci",3:"-üncü",4:"-üncü",100:"-üncü",6:"-ncı",9:"-uncu",10:"-uncu",30:"-uncu",60:"-ıncı",90:"-ıncı"};e.defineLocale("az",{months:"yanvar_fevral_mart_aprel_may_iyun_iyul_avqust_sentyabr_oktyabr_noyabr_dekabr".split("_"),monthsShort:"yan_fev_mar_apr_may_iyn_iyl_avq_sen_okt_noy_dek".split("_"),weekdays:"Bazar_Bazar ertəsi_Çərşənbə axşamı_Çərşənbə_Cümə axşamı_Cümə_Şənbə".split("_"),weekdaysShort:"Baz_BzE_ÇAx_Çər_CAx_Cüm_Şən".split("_"),weekdaysMin:"Bz_BE_ÇA_Çə_CA_Cü_Şə".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[sabah saat] LT",nextWeek:"[gələn həftə] dddd [saat] LT",lastDay:"[dünən] LT",lastWeek:"[keçən həftə] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s əvvəl",s:"bir neçə saniyə",ss:"%d saniyə",m:"bir dəqiqə",mm:"%d dəqiqə",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir il",yy:"%d il"},meridiemParse:/gecə|səhər|gündüz|axşam/,isPM:function(e){return/^(gündüz|axşam)$/.test(e)},meridiem:function(e,t,n){return e<4?"gecə":e<12?"səhər":e<17?"gündüz":"axşam"},dayOfMonthOrdinalParse:/\d{1,2}-(ıncı|inci|nci|üncü|ncı|uncu)/,ordinal:function(e){if(0===e)return e+"-ıncı";var n=e%10;return e+(t[n]||t[e%100-n]||t[e>=100?100:null])},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/be.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){return"m"===n?t?"хвіліна":"хвіліну":"h"===n?t?"гадзіна":"гадзіну":e+" "+(o=+e,r={ss:t?"секунда_секунды_секунд":"секунду_секунды_секунд",mm:t?"хвіліна_хвіліны_хвілін":"хвіліну_хвіліны_хвілін",hh:t?"гадзіна_гадзіны_гадзін":"гадзіну_гадзіны_гадзін",dd:"дзень_дні_дзён",MM:"месяц_месяцы_месяцаў",yy:"год_гады_гадоў"}[n].split("_"),o%10==1&&o%100!=11?r[0]:o%10>=2&&o%10<=4&&(o%100<10||o%100>=20)?r[1]:r[2]);var o,r}e.defineLocale("be",{months:{format:"студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня".split("_"),standalone:"студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань".split("_")},monthsShort:"студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж".split("_"),weekdays:{format:"нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу".split("_"),standalone:"нядзеля_панядзелак_аўторак_серада_чацвер_пятніца_субота".split("_"),isFormat:/\[ ?[Ууў] ?(?:мінулую|наступную)? ?\] ?dddd/},weekdaysShort:"нд_пн_ат_ср_чц_пт_сб".split("_"),weekdaysMin:"нд_пн_ат_ср_чц_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., HH:mm",LLLL:"dddd, D MMMM YYYY г., HH:mm"},calendar:{sameDay:"[Сёння ў] LT",nextDay:"[Заўтра ў] LT",lastDay:"[Учора ў] LT",nextWeek:function(){return"[У] dddd [ў] LT"},lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return"[У мінулую] dddd [ў] LT";case 1:case 2:case 4:return"[У мінулы] dddd [ў] LT"}},sameElse:"L"},relativeTime:{future:"праз %s",past:"%s таму",s:"некалькі секунд",m:t,mm:t,h:t,hh:t,d:"дзень",dd:t,M:"месяц",MM:t,y:"год",yy:t},meridiemParse:/ночы|раніцы|дня|вечара/,isPM:function(e){return/^(дня|вечара)$/.test(e)},meridiem:function(e,t,n){return e<4?"ночы":e<12?"раніцы":e<17?"дня":"вечара"},dayOfMonthOrdinalParse:/\d{1,2}-(і|ы|га)/,ordinal:function(e,t){switch(t){case"M":case"d":case"DDD":case"w":case"W":return e%10!=2&&e%10!=3||e%100==12||e%100==13?e+"-ы":e+"-і";case"D":return e+"-га";default:return e}},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bg.js":function(e,t,n){!function(e){"use strict";e.defineLocale("bg",{months:"януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември".split("_"),monthsShort:"яну_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек".split("_"),weekdays:"неделя_понеделник_вторник_сряда_четвъртък_петък_събота".split("_"),weekdaysShort:"нед_пон_вто_сря_чет_пет_съб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[Днес в] LT",nextDay:"[Утре в] LT",nextWeek:"dddd [в] LT",lastDay:"[Вчера в] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[Миналата] dddd [в] LT";case 1:case 2:case 4:case 5:return"[Миналия] dddd [в] LT"}},sameElse:"L"},relativeTime:{future:"след %s",past:"преди %s",s:"няколко секунди",ss:"%d секунди",m:"минута",mm:"%d минути",h:"час",hh:"%d часа",d:"ден",dd:"%d дена",w:"седмица",ww:"%d седмици",M:"месец",MM:"%d месеца",y:"година",yy:"%d години"},dayOfMonthOrdinalParse:/\d{1,2}-(ев|ен|ти|ви|ри|ми)/,ordinal:function(e){var t=e%10,n=e%100;return 0===e?e+"-ев":0===n?e+"-ен":n>10&&n<20?e+"-ти":1===t?e+"-ви":2===t?e+"-ри":7===t||8===t?e+"-ми":e+"-ти"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bm.js":function(e,t,n){!function(e){"use strict";e.defineLocale("bm",{months:"Zanwuyekalo_Fewuruyekalo_Marisikalo_Awirilikalo_Mɛkalo_Zuwɛnkalo_Zuluyekalo_Utikalo_Sɛtanburukalo_ɔkutɔburukalo_Nowanburukalo_Desanburukalo".split("_"),monthsShort:"Zan_Few_Mar_Awi_Mɛ_Zuw_Zul_Uti_Sɛt_ɔku_Now_Des".split("_"),weekdays:"Kari_Ntɛnɛn_Tarata_Araba_Alamisa_Juma_Sibiri".split("_"),weekdaysShort:"Kar_Ntɛ_Tar_Ara_Ala_Jum_Sib".split("_"),weekdaysMin:"Ka_Nt_Ta_Ar_Al_Ju_Si".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"MMMM [tile] D [san] YYYY",LLL:"MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm",LLLL:"dddd MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm"},calendar:{sameDay:"[Bi lɛrɛ] LT",nextDay:"[Sini lɛrɛ] LT",nextWeek:"dddd [don lɛrɛ] LT",lastDay:"[Kunu lɛrɛ] LT",lastWeek:"dddd [tɛmɛnen lɛrɛ] LT",sameElse:"L"},relativeTime:{future:"%s kɔnɔ",past:"a bɛ %s bɔ",s:"sanga dama dama",ss:"sekondi %d",m:"miniti kelen",mm:"miniti %d",h:"lɛrɛ kelen",hh:"lɛrɛ %d",d:"tile kelen",dd:"tile %d",M:"kalo kelen",MM:"kalo %d",y:"san kelen",yy:"san %d"},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bn-bd.js":function(e,t,n){!function(e){"use strict";var t={1:"১",2:"২",3:"৩",4:"৪",5:"৫",6:"৬",7:"৭",8:"৮",9:"৯",0:"০"},n={"১":"1","২":"2","৩":"3","৪":"4","৫":"5","৬":"6","৭":"7","৮":"8","৯":"9","০":"0"};e.defineLocale("bn-bd",{months:"জানুয়ারি_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর".split("_"),monthsShort:"জানু_ফেব্রু_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্ট_অক্টো_নভে_ডিসে".split("_"),weekdays:"রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার".split("_"),weekdaysShort:"রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি".split("_"),weekdaysMin:"রবি_সোম_মঙ্গল_বুধ_বৃহ_শুক্র_শনি".split("_"),longDateFormat:{LT:"A h:mm সময়",LTS:"A h:mm:ss সময়",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm সময়",LLLL:"dddd, D MMMM YYYY, A h:mm সময়"},calendar:{sameDay:"[আজ] LT",nextDay:"[আগামীকাল] LT",nextWeek:"dddd, LT",lastDay:"[গতকাল] LT",lastWeek:"[গত] dddd, LT",sameElse:"L"},relativeTime:{future:"%s পরে",past:"%s আগে",s:"কয়েক সেকেন্ড",ss:"%d সেকেন্ড",m:"এক মিনিট",mm:"%d মিনিট",h:"এক ঘন্টা",hh:"%d ঘন্টা",d:"এক দিন",dd:"%d দিন",M:"এক মাস",MM:"%d মাস",y:"এক বছর",yy:"%d বছর"},preparse:function(e){return e.replace(/[১২৩৪৫৬৭৮৯০]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/রাত|ভোর|সকাল|দুপুর|বিকাল|সন্ধ্যা|রাত/,meridiemHour:function(e,t){return 12===e&&(e=0),"রাত"===t?e<4?e:e+12:"ভোর"===t||"সকাল"===t?e:"দুপুর"===t?e>=3?e:e+12:"বিকাল"===t||"সন্ধ্যা"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"রাত":e<6?"ভোর":e<12?"সকাল":e<15?"দুপুর":e<18?"বিকাল":e<20?"সন্ধ্যা":"রাত"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bn.js":function(e,t,n){!function(e){"use strict";var t={1:"১",2:"২",3:"৩",4:"৪",5:"৫",6:"৬",7:"৭",8:"৮",9:"৯",0:"০"},n={"১":"1","২":"2","৩":"3","৪":"4","৫":"5","৬":"6","৭":"7","৮":"8","৯":"9","০":"0"};e.defineLocale("bn",{months:"জানুয়ারি_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর".split("_"),monthsShort:"জানু_ফেব্রু_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্ট_অক্টো_নভে_ডিসে".split("_"),weekdays:"রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার".split("_"),weekdaysShort:"রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি".split("_"),weekdaysMin:"রবি_সোম_মঙ্গল_বুধ_বৃহ_শুক্র_শনি".split("_"),longDateFormat:{LT:"A h:mm সময়",LTS:"A h:mm:ss সময়",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm সময়",LLLL:"dddd, D MMMM YYYY, A h:mm সময়"},calendar:{sameDay:"[আজ] LT",nextDay:"[আগামীকাল] LT",nextWeek:"dddd, LT",lastDay:"[গতকাল] LT",lastWeek:"[গত] dddd, LT",sameElse:"L"},relativeTime:{future:"%s পরে",past:"%s আগে",s:"কয়েক সেকেন্ড",ss:"%d সেকেন্ড",m:"এক মিনিট",mm:"%d মিনিট",h:"এক ঘন্টা",hh:"%d ঘন্টা",d:"এক দিন",dd:"%d দিন",M:"এক মাস",MM:"%d মাস",y:"এক বছর",yy:"%d বছর"},preparse:function(e){return e.replace(/[১২৩৪৫৬৭৮৯০]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/রাত|সকাল|দুপুর|বিকাল|রাত/,meridiemHour:function(e,t){return 12===e&&(e=0),"রাত"===t&&e>=4||"দুপুর"===t&&e<5||"বিকাল"===t?e+12:e},meridiem:function(e,t,n){return e<4?"রাত":e<10?"সকাল":e<17?"দুপুর":e<20?"বিকাল":"রাত"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bo.js":function(e,t,n){!function(e){"use strict";var t={1:"༡",2:"༢",3:"༣",4:"༤",5:"༥",6:"༦",7:"༧",8:"༨",9:"༩",0:"༠"},n={"༡":"1","༢":"2","༣":"3","༤":"4","༥":"5","༦":"6","༧":"7","༨":"8","༩":"9","༠":"0"};e.defineLocale("bo",{months:"ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ".split("_"),monthsShort:"ཟླ་1_ཟླ་2_ཟླ་3_ཟླ་4_ཟླ་5_ཟླ་6_ཟླ་7_ཟླ་8_ཟླ་9_ཟླ་10_ཟླ་11_ཟླ་12".split("_"),monthsShortRegex:/^(ཟླ་\d{1,2})/,monthsParseExact:!0,weekdays:"གཟའ་ཉི་མ་_གཟའ་ཟླ་བ་_གཟའ་མིག་དམར་_གཟའ་ལྷག་པ་_གཟའ་ཕུར་བུ_གཟའ་པ་སངས་_གཟའ་སྤེན་པ་".split("_"),weekdaysShort:"ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་".split("_"),weekdaysMin:"ཉི_ཟླ_མིག_ལྷག_ཕུར_སངས_སྤེན".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[དི་རིང] LT",nextDay:"[སང་ཉིན] LT",nextWeek:"[བདུན་ཕྲག་རྗེས་མ], LT",lastDay:"[ཁ་སང] LT",lastWeek:"[བདུན་ཕྲག་མཐའ་མ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ལ་",past:"%s སྔན་ལ",s:"ལམ་སང",ss:"%d སྐར་ཆ།",m:"སྐར་མ་གཅིག",mm:"%d སྐར་མ",h:"ཆུ་ཚོད་གཅིག",hh:"%d ཆུ་ཚོད",d:"ཉིན་གཅིག",dd:"%d ཉིན་",M:"ཟླ་བ་གཅིག",MM:"%d ཟླ་བ",y:"ལོ་གཅིག",yy:"%d ལོ"},preparse:function(e){return e.replace(/[༡༢༣༤༥༦༧༨༩༠]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/མཚན་མོ|ཞོགས་ཀས|ཉིན་གུང|དགོང་དག|མཚན་མོ/,meridiemHour:function(e,t){return 12===e&&(e=0),"མཚན་མོ"===t&&e>=4||"ཉིན་གུང"===t&&e<5||"དགོང་དག"===t?e+12:e},meridiem:function(e,t,n){return e<4?"མཚན་མོ":e<10?"ཞོགས་ཀས":e<17?"ཉིན་གུང":e<20?"དགོང་དག":"མཚན་མོ"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/br.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){return e+" "+function(e,t){return 2===t?function(e){var t={m:"v",b:"v",d:"z"};return void 0===t[e.charAt(0)]?e:t[e.charAt(0)]+e.substring(1)}(e):e}({mm:"munutenn",MM:"miz",dd:"devezh"}[n],e)}function n(e){return e>9?n(e%10):e}var o=[/^gen/i,/^c[ʼ\']hwe/i,/^meu/i,/^ebr/i,/^mae/i,/^(mez|eve)/i,/^gou/i,/^eos/i,/^gwe/i,/^her/i,/^du/i,/^ker/i],r=/^(genver|c[ʼ\']hwevrer|meurzh|ebrel|mae|mezheven|gouere|eost|gwengolo|here|du|kerzu|gen|c[ʼ\']hwe|meu|ebr|mae|eve|gou|eos|gwe|her|du|ker)/i,s=[/^Su/i,/^Lu/i,/^Me([^r]|$)/i,/^Mer/i,/^Ya/i,/^Gw/i,/^Sa/i];e.defineLocale("br",{months:"Genver_Cʼhwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu".split("_"),monthsShort:"Gen_Cʼhwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker".split("_"),weekdays:"Sul_Lun_Meurzh_Mercʼher_Yaou_Gwener_Sadorn".split("_"),weekdaysShort:"Sul_Lun_Meu_Mer_Yao_Gwe_Sad".split("_"),weekdaysMin:"Su_Lu_Me_Mer_Ya_Gw_Sa".split("_"),weekdaysParse:s,fullWeekdaysParse:[/^sul/i,/^lun/i,/^meurzh/i,/^merc[ʼ\']her/i,/^yaou/i,/^gwener/i,/^sadorn/i],shortWeekdaysParse:[/^Sul/i,/^Lun/i,/^Meu/i,/^Mer/i,/^Yao/i,/^Gwe/i,/^Sad/i],minWeekdaysParse:s,monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(genver|c[ʼ\']hwevrer|meurzh|ebrel|mae|mezheven|gouere|eost|gwengolo|here|du|kerzu)/i,monthsShortStrictRegex:/^(gen|c[ʼ\']hwe|meu|ebr|mae|eve|gou|eos|gwe|her|du|ker)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [a viz] MMMM YYYY",LLL:"D [a viz] MMMM YYYY HH:mm",LLLL:"dddd, D [a viz] MMMM YYYY HH:mm"},calendar:{sameDay:"[Hiziv da] LT",nextDay:"[Warcʼhoazh da] LT",nextWeek:"dddd [da] LT",lastDay:"[Decʼh da] LT",lastWeek:"dddd [paset da] LT",sameElse:"L"},relativeTime:{future:"a-benn %s",past:"%s ʼzo",s:"un nebeud segondennoù",ss:"%d eilenn",m:"ur vunutenn",mm:t,h:"un eur",hh:"%d eur",d:"un devezh",dd:t,M:"ur miz",MM:t,y:"ur bloaz",yy:function(e){switch(n(e)){case 1:case 3:case 4:case 5:case 9:return e+" bloaz";default:return e+" vloaz"}}},dayOfMonthOrdinalParse:/\d{1,2}(añ|vet)/,ordinal:function(e){return e+(1===e?"añ":"vet")},week:{dow:1,doy:4},meridiemParse:/a.m.|g.m./,isPM:function(e){return"g.m."===e},meridiem:function(e,t,n){return e<12?"a.m.":"g.m."}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bs.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){var o=e+" ";switch(n){case"ss":return o+(1===e?"sekunda":2===e||3===e||4===e?"sekunde":"sekundi");case"m":return t?"jedna minuta":"jedne minute";case"mm":return o+(1===e?"minuta":2===e||3===e||4===e?"minute":"minuta");case"h":return t?"jedan sat":"jednog sata";case"hh":return o+(1===e?"sat":2===e||3===e||4===e?"sata":"sati");case"dd":return o+(1===e?"dan":"dana");case"MM":return o+(1===e?"mjesec":2===e||3===e||4===e?"mjeseca":"mjeseci");case"yy":return o+(1===e?"godina":2===e||3===e||4===e?"godine":"godina")}}e.defineLocale("bs",{months:"januar_februar_mart_april_maj_juni_juli_august_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[jučer u] LT",lastWeek:function(){switch(this.day()){case 0:case 3:return"[prošlu] dddd [u] LT";case 6:return"[prošle] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[prošli] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",ss:t,m:t,mm:t,h:t,hh:t,d:"dan",dd:t,M:"mjesec",MM:t,y:"godinu",yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ca.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ca",{months:{standalone:"gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre".split("_"),format:"de gener_de febrer_de març_d'abril_de maig_de juny_de juliol_d'agost_de setembre_d'octubre_de novembre_de desembre".split("_"),isFormat:/D[oD]?(\s)+MMMM/},monthsShort:"gen._febr._març_abr._maig_juny_jul._ag._set._oct._nov._des.".split("_"),monthsParseExact:!0,weekdays:"diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte".split("_"),weekdaysShort:"dg._dl._dt._dc._dj._dv._ds.".split("_"),weekdaysMin:"dg_dl_dt_dc_dj_dv_ds".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [de] YYYY",ll:"D MMM YYYY",LLL:"D MMMM [de] YYYY [a les] H:mm",lll:"D MMM YYYY, H:mm",LLLL:"dddd D MMMM [de] YYYY [a les] H:mm",llll:"ddd D MMM YYYY, H:mm"},calendar:{sameDay:function(){return"[avui a "+(1!==this.hours()?"les":"la")+"] LT"},nextDay:function(){return"[demà a "+(1!==this.hours()?"les":"la")+"] LT"},nextWeek:function(){return"dddd [a "+(1!==this.hours()?"les":"la")+"] LT"},lastDay:function(){return"[ahir a "+(1!==this.hours()?"les":"la")+"] LT"},lastWeek:function(){return"[el] dddd [passat a "+(1!==this.hours()?"les":"la")+"] LT"},sameElse:"L"},relativeTime:{future:"d'aquí %s",past:"fa %s",s:"uns segons",ss:"%d segons",m:"un minut",mm:"%d minuts",h:"una hora",hh:"%d hores",d:"un dia",dd:"%d dies",M:"un mes",MM:"%d mesos",y:"un any",yy:"%d anys"},dayOfMonthOrdinalParse:/\d{1,2}(r|n|t|è|a)/,ordinal:function(e,t){var n=1===e?"r":2===e?"n":3===e?"r":4===e?"t":"è";return"w"!==t&&"W"!==t||(n="a"),e+n},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/cs.js":function(e,t,n){!function(e){"use strict";var t="leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec".split("_"),n="led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro".split("_"),o=[/^led/i,/^úno/i,/^bře/i,/^dub/i,/^kvě/i,/^(čvn|červen$|června)/i,/^(čvc|červenec|července)/i,/^srp/i,/^zář/i,/^říj/i,/^lis/i,/^pro/i],r=/^(leden|únor|březen|duben|květen|červenec|července|červen|června|srpen|září|říjen|listopad|prosinec|led|úno|bře|dub|kvě|čvn|čvc|srp|zář|říj|lis|pro)/i;function s(e){return e>1&&e<5&&1!=~~(e/10)}function a(e,t,n,o){var r=e+" ";switch(n){case"s":return t||o?"pár sekund":"pár sekundami";case"ss":return t||o?r+(s(e)?"sekundy":"sekund"):r+"sekundami";case"m":return t?"minuta":o?"minutu":"minutou";case"mm":return t||o?r+(s(e)?"minuty":"minut"):r+"minutami";case"h":return t?"hodina":o?"hodinu":"hodinou";case"hh":return t||o?r+(s(e)?"hodiny":"hodin"):r+"hodinami";case"d":return t||o?"den":"dnem";case"dd":return t||o?r+(s(e)?"dny":"dní"):r+"dny";case"M":return t||o?"měsíc":"měsícem";case"MM":return t||o?r+(s(e)?"měsíce":"měsíců"):r+"měsíci";case"y":return t||o?"rok":"rokem";case"yy":return t||o?r+(s(e)?"roky":"let"):r+"lety"}}e.defineLocale("cs",{months:t,monthsShort:n,monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(leden|ledna|února|únor|březen|března|duben|dubna|květen|května|červenec|července|červen|června|srpen|srpna|září|říjen|října|listopadu|listopad|prosinec|prosince)/i,monthsShortStrictRegex:/^(led|úno|bře|dub|kvě|čvn|čvc|srp|zář|říj|lis|pro)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota".split("_"),weekdaysShort:"ne_po_út_st_čt_pá_so".split("_"),weekdaysMin:"ne_po_út_st_čt_pá_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm",l:"D. M. YYYY"},calendar:{sameDay:"[dnes v] LT",nextDay:"[zítra v] LT",nextWeek:function(){switch(this.day()){case 0:return"[v neděli v] LT";case 1:case 2:return"[v] dddd [v] LT";case 3:return"[ve středu v] LT";case 4:return"[ve čtvrtek v] LT";case 5:return"[v pátek v] LT";case 6:return"[v sobotu v] LT"}},lastDay:"[včera v] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulou neděli v] LT";case 1:case 2:return"[minulé] dddd [v] LT";case 3:return"[minulou středu v] LT";case 4:case 5:return"[minulý] dddd [v] LT";case 6:return"[minulou sobotu v] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"před %s",s:a,ss:a,m:a,mm:a,h:a,hh:a,d:a,dd:a,M:a,MM:a,y:a,yy:a},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/cv.js":function(e,t,n){!function(e){"use strict";e.defineLocale("cv",{months:"кӑрлач_нарӑс_пуш_ака_май_ҫӗртме_утӑ_ҫурла_авӑн_юпа_чӳк_раштав".split("_"),monthsShort:"кӑр_нар_пуш_ака_май_ҫӗр_утӑ_ҫур_авн_юпа_чӳк_раш".split("_"),weekdays:"вырсарникун_тунтикун_ытларикун_юнкун_кӗҫнерникун_эрнекун_шӑматкун".split("_"),weekdaysShort:"выр_тун_ытл_юн_кӗҫ_эрн_шӑм".split("_"),weekdaysMin:"вр_тн_ыт_юн_кҫ_эр_шм".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ]",LLL:"YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm",LLLL:"dddd, YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm"},calendar:{sameDay:"[Паян] LT [сехетре]",nextDay:"[Ыран] LT [сехетре]",lastDay:"[Ӗнер] LT [сехетре]",nextWeek:"[Ҫитес] dddd LT [сехетре]",lastWeek:"[Иртнӗ] dddd LT [сехетре]",sameElse:"L"},relativeTime:{future:function(e){return e+(/сехет$/i.exec(e)?"рен":/ҫул$/i.exec(e)?"тан":"ран")},past:"%s каялла",s:"пӗр-ик ҫеккунт",ss:"%d ҫеккунт",m:"пӗр минут",mm:"%d минут",h:"пӗр сехет",hh:"%d сехет",d:"пӗр кун",dd:"%d кун",M:"пӗр уйӑх",MM:"%d уйӑх",y:"пӗр ҫул",yy:"%d ҫул"},dayOfMonthOrdinalParse:/\d{1,2}-мӗш/,ordinal:"%d-мӗш",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/cy.js":function(e,t,n){!function(e){"use strict";e.defineLocale("cy",{months:"Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr".split("_"),monthsShort:"Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag".split("_"),weekdays:"Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn".split("_"),weekdaysShort:"Sul_Llun_Maw_Mer_Iau_Gwe_Sad".split("_"),weekdaysMin:"Su_Ll_Ma_Me_Ia_Gw_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Heddiw am] LT",nextDay:"[Yfory am] LT",nextWeek:"dddd [am] LT",lastDay:"[Ddoe am] LT",lastWeek:"dddd [diwethaf am] LT",sameElse:"L"},relativeTime:{future:"mewn %s",past:"%s yn ôl",s:"ychydig eiliadau",ss:"%d eiliad",m:"munud",mm:"%d munud",h:"awr",hh:"%d awr",d:"diwrnod",dd:"%d diwrnod",M:"mis",MM:"%d mis",y:"blwyddyn",yy:"%d flynedd"},dayOfMonthOrdinalParse:/\d{1,2}(fed|ain|af|il|ydd|ed|eg)/,ordinal:function(e){var t="";return e>20?t=40===e||50===e||60===e||80===e||100===e?"fed":"ain":e>0&&(t=["","af","il","ydd","ydd","ed","ed","ed","fed","fed","fed","eg","fed","eg","eg","fed","eg","eg","fed","eg","fed"][e]),e+t},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/da.js":function(e,t,n){!function(e){"use strict";e.defineLocale("da",{months:"januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"søn_man_tir_ons_tor_fre_lør".split("_"),weekdaysMin:"sø_ma_ti_on_to_fr_lø".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd [d.] D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[i dag kl.] LT",nextDay:"[i morgen kl.] LT",nextWeek:"på dddd [kl.] LT",lastDay:"[i går kl.] LT",lastWeek:"[i] dddd[s kl.] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s siden",s:"få sekunder",ss:"%d sekunder",m:"et minut",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dage",M:"en måned",MM:"%d måneder",y:"et år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/de-at.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?r[n][0]:r[n][1]}e.defineLocale("de-at",{months:"Jänner_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jän._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:t,mm:"%d Minuten",h:t,hh:"%d Stunden",d:t,dd:t,w:t,ww:"%d Wochen",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/de-ch.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?r[n][0]:r[n][1]}e.defineLocale("de-ch",{months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:t,mm:"%d Minuten",h:t,hh:"%d Stunden",d:t,dd:t,w:t,ww:"%d Wochen",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/de.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?r[n][0]:r[n][1]}e.defineLocale("de",{months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:t,mm:"%d Minuten",h:t,hh:"%d Stunden",d:t,dd:t,w:t,ww:"%d Wochen",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/dv.js":function(e,t,n){!function(e){"use strict";var t=["ޖެނުއަރީ","ފެބްރުއަރީ","މާރިޗު","އޭޕްރީލު","މޭ","ޖޫން","ޖުލައި","އޯގަސްޓު","ސެޕްޓެމްބަރު","އޮކްޓޯބަރު","ނޮވެމްބަރު","ޑިސެމްބަރު"],n=["އާދިއްތަ","ހޯމަ","އަންގާރަ","ބުދަ","ބުރާސްފަތި","ހުކުރު","ހޮނިހިރު"];e.defineLocale("dv",{months:t,monthsShort:t,weekdays:n,weekdaysShort:n,weekdaysMin:"އާދި_ހޯމަ_އަން_ބުދަ_ބުރާ_ހުކު_ހޮނި".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/M/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/މކ|މފ/,isPM:function(e){return"މފ"===e},meridiem:function(e,t,n){return e<12?"މކ":"މފ"},calendar:{sameDay:"[މިއަދު] LT",nextDay:"[މާދަމާ] LT",nextWeek:"dddd LT",lastDay:"[އިއްޔެ] LT",lastWeek:"[ފާއިތުވި] dddd LT",sameElse:"L"},relativeTime:{future:"ތެރޭގައި %s",past:"ކުރިން %s",s:"ސިކުންތުކޮޅެއް",ss:"d% ސިކުންތު",m:"މިނިޓެއް",mm:"މިނިޓު %d",h:"ގަޑިއިރެއް",hh:"ގަޑިއިރު %d",d:"ދުވަހެއް",dd:"ދުވަސް %d",M:"މަހެއް",MM:"މަސް %d",y:"އަހަރެއް",yy:"އަހަރު %d"},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:7,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/el.js":function(e,t,n){!function(e){"use strict";e.defineLocale("el",{monthsNominativeEl:"Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος".split("_"),monthsGenitiveEl:"Ιανουαρίου_Φεβρουαρίου_Μαρτίου_Απριλίου_Μαΐου_Ιουνίου_Ιουλίου_Αυγούστου_Σεπτεμβρίου_Οκτωβρίου_Νοεμβρίου_Δεκεμβρίου".split("_"),months:function(e,t){return e?"string"==typeof t&&/D/.test(t.substring(0,t.indexOf("MMMM")))?this._monthsGenitiveEl[e.month()]:this._monthsNominativeEl[e.month()]:this._monthsNominativeEl},monthsShort:"Ιαν_Φεβ_Μαρ_Απρ_Μαϊ_Ιουν_Ιουλ_Αυγ_Σεπ_Οκτ_Νοε_Δεκ".split("_"),weekdays:"Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο".split("_"),weekdaysShort:"Κυρ_Δευ_Τρι_Τετ_Πεμ_Παρ_Σαβ".split("_"),weekdaysMin:"Κυ_Δε_Τρ_Τε_Πε_Πα_Σα".split("_"),meridiem:function(e,t,n){return e>11?n?"μμ":"ΜΜ":n?"πμ":"ΠΜ"},isPM:function(e){return"μ"===(e+"").toLowerCase()[0]},meridiemParse:/[ΠΜ]\.?Μ?\.?/i,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendarEl:{sameDay:"[Σήμερα {}] LT",nextDay:"[Αύριο {}] LT",nextWeek:"dddd [{}] LT",lastDay:"[Χθες {}] LT",lastWeek:function(){switch(this.day()){case 6:return"[το προηγούμενο] dddd [{}] LT";default:return"[την προηγούμενη] dddd [{}] LT"}},sameElse:"L"},calendar:function(e,t){var n,o=this._calendarEl[e],r=t&&t.hours();return n=o,("undefined"!=typeof Function&&n instanceof Function||"[object Function]"===Object.prototype.toString.call(n))&&(o=o.apply(t)),o.replace("{}",r%12==1?"στη":"στις")},relativeTime:{future:"σε %s",past:"%s πριν",s:"λίγα δευτερόλεπτα",ss:"%d δευτερόλεπτα",m:"ένα λεπτό",mm:"%d λεπτά",h:"μία ώρα",hh:"%d ώρες",d:"μία μέρα",dd:"%d μέρες",M:"ένας μήνας",MM:"%d μήνες",y:"ένας χρόνος",yy:"%d χρόνια"},dayOfMonthOrdinalParse:/\d{1,2}η/,ordinal:"%dη",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-au.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-au",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:0,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-ca.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-ca",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"YYYY-MM-DD",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-gb.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-gb",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-ie.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-ie",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-il.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-il",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-in.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-in",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-nz.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-nz",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-sg.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-sg",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/eo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("eo",{months:"januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro".split("_"),monthsShort:"jan_feb_mart_apr_maj_jun_jul_aŭg_sept_okt_nov_dec".split("_"),weekdays:"dimanĉo_lundo_mardo_merkredo_ĵaŭdo_vendredo_sabato".split("_"),weekdaysShort:"dim_lun_mard_merk_ĵaŭ_ven_sab".split("_"),weekdaysMin:"di_lu_ma_me_ĵa_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"[la] D[-an de] MMMM, YYYY",LLL:"[la] D[-an de] MMMM, YYYY HH:mm",LLLL:"dddd[n], [la] D[-an de] MMMM, YYYY HH:mm",llll:"ddd, [la] D[-an de] MMM, YYYY HH:mm"},meridiemParse:/[ap]\.t\.m/i,isPM:function(e){return"p"===e.charAt(0).toLowerCase()},meridiem:function(e,t,n){return e>11?n?"p.t.m.":"P.T.M.":n?"a.t.m.":"A.T.M."},calendar:{sameDay:"[Hodiaŭ je] LT",nextDay:"[Morgaŭ je] LT",nextWeek:"dddd[n je] LT",lastDay:"[Hieraŭ je] LT",lastWeek:"[pasintan] dddd[n je] LT",sameElse:"L"},relativeTime:{future:"post %s",past:"antaŭ %s",s:"kelkaj sekundoj",ss:"%d sekundoj",m:"unu minuto",mm:"%d minutoj",h:"unu horo",hh:"%d horoj",d:"unu tago",dd:"%d tagoj",M:"unu monato",MM:"%d monatoj",y:"unu jaro",yy:"%d jaroj"},dayOfMonthOrdinalParse:/\d{1,2}a/,ordinal:"%da",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/es-do.js":function(e,t,n){!function(e){"use strict";var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),o=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],r=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es-do",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY h:mm A",LLLL:"dddd, D [de] MMMM [de] YYYY h:mm A"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/es-mx.js":function(e,t,n){!function(e){"use strict";var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),o=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],r=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es-mx",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:0,doy:4},invalidDate:"Fecha inválida"})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/es-us.js":function(e,t,n){!function(e){"use strict";var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),o=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],r=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es-us",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"MM/DD/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY h:mm A",LLLL:"dddd, D [de] MMMM [de] YYYY h:mm A"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/es.js":function(e,t,n){!function(e){"use strict";var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),o=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],r=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4},invalidDate:"Fecha inválida"})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/et.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={s:["mõne sekundi","mõni sekund","paar sekundit"],ss:[e+"sekundi",e+"sekundit"],m:["ühe minuti","üks minut"],mm:[e+" minuti",e+" minutit"],h:["ühe tunni","tund aega","üks tund"],hh:[e+" tunni",e+" tundi"],d:["ühe päeva","üks päev"],M:["kuu aja","kuu aega","üks kuu"],MM:[e+" kuu",e+" kuud"],y:["ühe aasta","aasta","üks aasta"],yy:[e+" aasta",e+" aastat"]};return t?r[n][2]?r[n][2]:r[n][1]:o?r[n][0]:r[n][1]}e.defineLocale("et",{months:"jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember".split("_"),monthsShort:"jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets".split("_"),weekdays:"pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev".split("_"),weekdaysShort:"P_E_T_K_N_R_L".split("_"),weekdaysMin:"P_E_T_K_N_R_L".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[Täna,] LT",nextDay:"[Homme,] LT",nextWeek:"[Järgmine] dddd LT",lastDay:"[Eile,] LT",lastWeek:"[Eelmine] dddd LT",sameElse:"L"},relativeTime:{future:"%s pärast",past:"%s tagasi",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:"%d päeva",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/eu.js":function(e,t,n){!function(e){"use strict";e.defineLocale("eu",{months:"urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua".split("_"),monthsShort:"urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.".split("_"),monthsParseExact:!0,weekdays:"igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata".split("_"),weekdaysShort:"ig._al._ar._az._og._ol._lr.".split("_"),weekdaysMin:"ig_al_ar_az_og_ol_lr".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY[ko] MMMM[ren] D[a]",LLL:"YYYY[ko] MMMM[ren] D[a] HH:mm",LLLL:"dddd, YYYY[ko] MMMM[ren] D[a] HH:mm",l:"YYYY-M-D",ll:"YYYY[ko] MMM D[a]",lll:"YYYY[ko] MMM D[a] HH:mm",llll:"ddd, YYYY[ko] MMM D[a] HH:mm"},calendar:{sameDay:"[gaur] LT[etan]",nextDay:"[bihar] LT[etan]",nextWeek:"dddd LT[etan]",lastDay:"[atzo] LT[etan]",lastWeek:"[aurreko] dddd LT[etan]",sameElse:"L"},relativeTime:{future:"%s barru",past:"duela %s",s:"segundo batzuk",ss:"%d segundo",m:"minutu bat",mm:"%d minutu",h:"ordu bat",hh:"%d ordu",d:"egun bat",dd:"%d egun",M:"hilabete bat",MM:"%d hilabete",y:"urte bat",yy:"%d urte"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fa.js":function(e,t,n){!function(e){"use strict";var t={1:"۱",2:"۲",3:"۳",4:"۴",5:"۵",6:"۶",7:"۷",8:"۸",9:"۹",0:"۰"},n={"۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9","۰":"0"};e.defineLocale("fa",{months:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),monthsShort:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),weekdays:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_"),weekdaysShort:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_"),weekdaysMin:"ی_د_س_چ_پ_ج_ش".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/قبل از ظهر|بعد از ظهر/,isPM:function(e){return/بعد از ظهر/.test(e)},meridiem:function(e,t,n){return e<12?"قبل از ظهر":"بعد از ظهر"},calendar:{sameDay:"[امروز ساعت] LT",nextDay:"[فردا ساعت] LT",nextWeek:"dddd [ساعت] LT",lastDay:"[دیروز ساعت] LT",lastWeek:"dddd [پیش] [ساعت] LT",sameElse:"L"},relativeTime:{future:"در %s",past:"%s پیش",s:"چند ثانیه",ss:"%d ثانیه",m:"یک دقیقه",mm:"%d دقیقه",h:"یک ساعت",hh:"%d ساعت",d:"یک روز",dd:"%d روز",M:"یک ماه",MM:"%d ماه",y:"یک سال",yy:"%d سال"},preparse:function(e){return e.replace(/[۰-۹]/g,(function(e){return n[e]})).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},dayOfMonthOrdinalParse:/\d{1,2}م/,ordinal:"%dم",week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fi.js":function(e,t,n){!function(e){"use strict";var t="nolla yksi kaksi kolme neljä viisi kuusi seitsemän kahdeksan yhdeksän".split(" "),n=["nolla","yhden","kahden","kolmen","neljän","viiden","kuuden",t[7],t[8],t[9]];function o(e,o,r,s){var a="";switch(r){case"s":return s?"muutaman sekunnin":"muutama sekunti";case"ss":a=s?"sekunnin":"sekuntia";break;case"m":return s?"minuutin":"minuutti";case"mm":a=s?"minuutin":"minuuttia";break;case"h":return s?"tunnin":"tunti";case"hh":a=s?"tunnin":"tuntia";break;case"d":return s?"päivän":"päivä";case"dd":a=s?"päivän":"päivää";break;case"M":return s?"kuukauden":"kuukausi";case"MM":a=s?"kuukauden":"kuukautta";break;case"y":return s?"vuoden":"vuosi";case"yy":a=s?"vuoden":"vuotta"}return function(e,o){return e<10?o?n[e]:t[e]:e}(e,s)+" "+a}e.defineLocale("fi",{months:"tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu".split("_"),monthsShort:"tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu".split("_"),weekdays:"sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai".split("_"),weekdaysShort:"su_ma_ti_ke_to_pe_la".split("_"),weekdaysMin:"su_ma_ti_ke_to_pe_la".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"Do MMMM[ta] YYYY",LLL:"Do MMMM[ta] YYYY, [klo] HH.mm",LLLL:"dddd, Do MMMM[ta] YYYY, [klo] HH.mm",l:"D.M.YYYY",ll:"Do MMM YYYY",lll:"Do MMM YYYY, [klo] HH.mm",llll:"ddd, Do MMM YYYY, [klo] HH.mm"},calendar:{sameDay:"[tänään] [klo] LT",nextDay:"[huomenna] [klo] LT",nextWeek:"dddd [klo] LT",lastDay:"[eilen] [klo] LT",lastWeek:"[viime] dddd[na] [klo] LT",sameElse:"L"},relativeTime:{future:"%s päästä",past:"%s sitten",s:o,ss:o,m:o,mm:o,h:o,hh:o,d:o,dd:o,M:o,MM:o,y:o,yy:o},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fil.js":function(e,t,n){!function(e){"use strict";e.defineLocale("fil",{months:"Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre".split("_"),monthsShort:"Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis".split("_"),weekdays:"Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado".split("_"),weekdaysShort:"Lin_Lun_Mar_Miy_Huw_Biy_Sab".split("_"),weekdaysMin:"Li_Lu_Ma_Mi_Hu_Bi_Sab".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"MM/D/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY HH:mm",LLLL:"dddd, MMMM DD, YYYY HH:mm"},calendar:{sameDay:"LT [ngayong araw]",nextDay:"[Bukas ng] LT",nextWeek:"LT [sa susunod na] dddd",lastDay:"LT [kahapon]",lastWeek:"LT [noong nakaraang] dddd",sameElse:"L"},relativeTime:{future:"sa loob ng %s",past:"%s ang nakalipas",s:"ilang segundo",ss:"%d segundo",m:"isang minuto",mm:"%d minuto",h:"isang oras",hh:"%d oras",d:"isang araw",dd:"%d araw",M:"isang buwan",MM:"%d buwan",y:"isang taon",yy:"%d taon"},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:function(e){return e},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("fo",{months:"januar_februar_mars_apríl_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),weekdays:"sunnudagur_mánadagur_týsdagur_mikudagur_hósdagur_fríggjadagur_leygardagur".split("_"),weekdaysShort:"sun_mán_týs_mik_hós_frí_ley".split("_"),weekdaysMin:"su_má_tý_mi_hó_fr_le".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D. MMMM, YYYY HH:mm"},calendar:{sameDay:"[Í dag kl.] LT",nextDay:"[Í morgin kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[Í gjár kl.] LT",lastWeek:"[síðstu] dddd [kl] LT",sameElse:"L"},relativeTime:{future:"um %s",past:"%s síðani",s:"fá sekund",ss:"%d sekundir",m:"ein minuttur",mm:"%d minuttir",h:"ein tími",hh:"%d tímar",d:"ein dagur",dd:"%d dagar",M:"ein mánaður",MM:"%d mánaðir",y:"eitt ár",yy:"%d ár"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fr-ca.js":function(e,t,n){!function(e){"use strict";e.defineLocale("fr-ca",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),monthsParseExact:!0,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd’hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|e)/,ordinal:function(e,t){switch(t){default:case"M":case"Q":case"D":case"DDD":case"d":return e+(1===e?"er":"e");case"w":case"W":return e+(1===e?"re":"e")}}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fr-ch.js":function(e,t,n){!function(e){"use strict";e.defineLocale("fr-ch",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),monthsParseExact:!0,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd’hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|e)/,ordinal:function(e,t){switch(t){default:case"M":case"Q":case"D":case"DDD":case"d":return e+(1===e?"er":"e");case"w":case"W":return e+(1===e?"re":"e")}},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fr.js":function(e,t,n){!function(e){"use strict";var t=/(janv\.?|févr\.?|mars|avr\.?|mai|juin|juil\.?|août|sept\.?|oct\.?|nov\.?|déc\.?|janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i,n=[/^janv/i,/^févr/i,/^mars/i,/^avr/i,/^mai/i,/^juin/i,/^juil/i,/^août/i,/^sept/i,/^oct/i,/^nov/i,/^déc/i];e.defineLocale("fr",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),monthsRegex:t,monthsShortRegex:t,monthsStrictRegex:/^(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i,monthsShortStrictRegex:/(janv\.?|févr\.?|mars|avr\.?|mai|juin|juil\.?|août|sept\.?|oct\.?|nov\.?|déc\.?)/i,monthsParse:n,longMonthsParse:n,shortMonthsParse:n,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd’hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",w:"une semaine",ww:"%d semaines",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|)/,ordinal:function(e,t){switch(t){case"D":return e+(1===e?"er":"");default:case"M":case"Q":case"DDD":case"d":return e+(1===e?"er":"e");case"w":case"W":return e+(1===e?"re":"e")}},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fy.js":function(e,t,n){!function(e){"use strict";var t="jan._feb._mrt._apr._mai_jun._jul._aug._sep._okt._nov._des.".split("_"),n="jan_feb_mrt_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_");e.defineLocale("fy",{months:"jannewaris_febrewaris_maart_april_maaie_juny_july_augustus_septimber_oktober_novimber_desimber".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsParseExact:!0,weekdays:"snein_moandei_tiisdei_woansdei_tongersdei_freed_sneon".split("_"),weekdaysShort:"si._mo._ti._wo._to._fr._so.".split("_"),weekdaysMin:"Si_Mo_Ti_Wo_To_Fr_So".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[hjoed om] LT",nextDay:"[moarn om] LT",nextWeek:"dddd [om] LT",lastDay:"[juster om] LT",lastWeek:"[ôfrûne] dddd [om] LT",sameElse:"L"},relativeTime:{future:"oer %s",past:"%s lyn",s:"in pear sekonden",ss:"%d sekonden",m:"ien minút",mm:"%d minuten",h:"ien oere",hh:"%d oeren",d:"ien dei",dd:"%d dagen",M:"ien moanne",MM:"%d moannen",y:"ien jier",yy:"%d jierren"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ga.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ga",{months:["Eanáir","Feabhra","Márta","Aibreán","Bealtaine","Meitheamh","Iúil","Lúnasa","Meán Fómhair","Deireadh Fómhair","Samhain","Nollaig"],monthsShort:["Ean","Feabh","Márt","Aib","Beal","Meith","Iúil","Lún","M.F.","D.F.","Samh","Noll"],monthsParseExact:!0,weekdays:["Dé Domhnaigh","Dé Luain","Dé Máirt","Dé Céadaoin","Déardaoin","Dé hAoine","Dé Sathairn"],weekdaysShort:["Domh","Luan","Máirt","Céad","Déar","Aoine","Sath"],weekdaysMin:["Do","Lu","Má","Cé","Dé","A","Sa"],longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Inniu ag] LT",nextDay:"[Amárach ag] LT",nextWeek:"dddd [ag] LT",lastDay:"[Inné ag] LT",lastWeek:"dddd [seo caite] [ag] LT",sameElse:"L"},relativeTime:{future:"i %s",past:"%s ó shin",s:"cúpla soicind",ss:"%d soicind",m:"nóiméad",mm:"%d nóiméad",h:"uair an chloig",hh:"%d uair an chloig",d:"lá",dd:"%d lá",M:"mí",MM:"%d míonna",y:"bliain",yy:"%d bliain"},dayOfMonthOrdinalParse:/\d{1,2}(d|na|mh)/,ordinal:function(e){return e+(1===e?"d":e%10==2?"na":"mh")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/gd.js":function(e,t,n){!function(e){"use strict";e.defineLocale("gd",{months:["Am Faoilleach","An Gearran","Am Màrt","An Giblean","An Cèitean","An t-Ògmhios","An t-Iuchar","An Lùnastal","An t-Sultain","An Dàmhair","An t-Samhain","An Dùbhlachd"],monthsShort:["Faoi","Gear","Màrt","Gibl","Cèit","Ògmh","Iuch","Lùn","Sult","Dàmh","Samh","Dùbh"],monthsParseExact:!0,weekdays:["Didòmhnaich","Diluain","Dimàirt","Diciadain","Diardaoin","Dihaoine","Disathairne"],weekdaysShort:["Did","Dil","Dim","Dic","Dia","Dih","Dis"],weekdaysMin:["Dò","Lu","Mà","Ci","Ar","Ha","Sa"],longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[An-diugh aig] LT",nextDay:"[A-màireach aig] LT",nextWeek:"dddd [aig] LT",lastDay:"[An-dè aig] LT",lastWeek:"dddd [seo chaidh] [aig] LT",sameElse:"L"},relativeTime:{future:"ann an %s",past:"bho chionn %s",s:"beagan diogan",ss:"%d diogan",m:"mionaid",mm:"%d mionaidean",h:"uair",hh:"%d uairean",d:"latha",dd:"%d latha",M:"mìos",MM:"%d mìosan",y:"bliadhna",yy:"%d bliadhna"},dayOfMonthOrdinalParse:/\d{1,2}(d|na|mh)/,ordinal:function(e){return e+(1===e?"d":e%10==2?"na":"mh")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/gl.js":function(e,t,n){!function(e){"use strict";e.defineLocale("gl",{months:"xaneiro_febreiro_marzo_abril_maio_xuño_xullo_agosto_setembro_outubro_novembro_decembro".split("_"),monthsShort:"xan._feb._mar._abr._mai._xuñ._xul._ago._set._out._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"domingo_luns_martes_mércores_xoves_venres_sábado".split("_"),weekdaysShort:"dom._lun._mar._mér._xov._ven._sáb.".split("_"),weekdaysMin:"do_lu_ma_mé_xo_ve_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoxe "+(1!==this.hours()?"ás":"á")+"] LT"},nextDay:function(){return"[mañá "+(1!==this.hours()?"ás":"á")+"] LT"},nextWeek:function(){return"dddd ["+(1!==this.hours()?"ás":"a")+"] LT"},lastDay:function(){return"[onte "+(1!==this.hours()?"á":"a")+"] LT"},lastWeek:function(){return"[o] dddd [pasado "+(1!==this.hours()?"ás":"a")+"] LT"},sameElse:"L"},relativeTime:{future:function(e){return 0===e.indexOf("un")?"n"+e:"en "+e},past:"hai %s",s:"uns segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"unha hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un ano",yy:"%d anos"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/gom-deva.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={s:["थोडया सॅकंडांनी","थोडे सॅकंड"],ss:[e+" सॅकंडांनी",e+" सॅकंड"],m:["एका मिणटान","एक मिनूट"],mm:[e+" मिणटांनी",e+" मिणटां"],h:["एका वरान","एक वर"],hh:[e+" वरांनी",e+" वरां"],d:["एका दिसान","एक दीस"],dd:[e+" दिसांनी",e+" दीस"],M:["एका म्हयन्यान","एक म्हयनो"],MM:[e+" म्हयन्यानी",e+" म्हयने"],y:["एका वर्सान","एक वर्स"],yy:[e+" वर्सांनी",e+" वर्सां"]};return o?r[n][0]:r[n][1]}e.defineLocale("gom-deva",{months:{standalone:"जानेवारी_फेब्रुवारी_मार्च_एप्रील_मे_जून_जुलय_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर".split("_"),format:"जानेवारीच्या_फेब्रुवारीच्या_मार्चाच्या_एप्रीलाच्या_मेयाच्या_जूनाच्या_जुलयाच्या_ऑगस्टाच्या_सप्टेंबराच्या_ऑक्टोबराच्या_नोव्हेंबराच्या_डिसेंबराच्या".split("_"),isFormat:/MMMM(\s)+D[oD]?/},monthsShort:"जाने._फेब्रु._मार्च_एप्री._मे_जून_जुल._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.".split("_"),monthsParseExact:!0,weekdays:"आयतार_सोमार_मंगळार_बुधवार_बिरेस्तार_सुक्रार_शेनवार".split("_"),weekdaysShort:"आयत._सोम._मंगळ._बुध._ब्रेस्त._सुक्र._शेन.".split("_"),weekdaysMin:"आ_सो_मं_बु_ब्रे_सु_शे".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"A h:mm [वाजतां]",LTS:"A h:mm:ss [वाजतां]",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY A h:mm [वाजतां]",LLLL:"dddd, MMMM Do, YYYY, A h:mm [वाजतां]",llll:"ddd, D MMM YYYY, A h:mm [वाजतां]"},calendar:{sameDay:"[आयज] LT",nextDay:"[फाल्यां] LT",nextWeek:"[फुडलो] dddd[,] LT",lastDay:"[काल] LT",lastWeek:"[फाटलो] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%s",past:"%s आदीं",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}(वेर)/,ordinal:function(e,t){switch(t){case"D":return e+"वेर";default:case"M":case"Q":case"DDD":case"d":case"w":case"W":return e}},week:{dow:0,doy:3},meridiemParse:/राती|सकाळीं|दनपारां|सांजे/,meridiemHour:function(e,t){return 12===e&&(e=0),"राती"===t?e<4?e:e+12:"सकाळीं"===t?e:"दनपारां"===t?e>12?e:e+12:"सांजे"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"राती":e<12?"सकाळीं":e<16?"दनपारां":e<20?"सांजे":"राती"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/gom-latn.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={s:["thoddea sekondamni","thodde sekond"],ss:[e+" sekondamni",e+" sekond"],m:["eka mintan","ek minut"],mm:[e+" mintamni",e+" mintam"],h:["eka voran","ek vor"],hh:[e+" voramni",e+" voram"],d:["eka disan","ek dis"],dd:[e+" disamni",e+" dis"],M:["eka mhoinean","ek mhoino"],MM:[e+" mhoineamni",e+" mhoine"],y:["eka vorsan","ek voros"],yy:[e+" vorsamni",e+" vorsam"]};return o?r[n][0]:r[n][1]}e.defineLocale("gom-latn",{months:{standalone:"Janer_Febrer_Mars_Abril_Mai_Jun_Julai_Agost_Setembr_Otubr_Novembr_Dezembr".split("_"),format:"Janerachea_Febrerachea_Marsachea_Abrilachea_Maiachea_Junachea_Julaiachea_Agostachea_Setembrachea_Otubrachea_Novembrachea_Dezembrachea".split("_"),isFormat:/MMMM(\s)+D[oD]?/},monthsShort:"Jan._Feb._Mars_Abr._Mai_Jun_Jul._Ago._Set._Otu._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Aitar_Somar_Mongllar_Budhvar_Birestar_Sukrar_Son'var".split("_"),weekdaysShort:"Ait._Som._Mon._Bud._Bre._Suk._Son.".split("_"),weekdaysMin:"Ai_Sm_Mo_Bu_Br_Su_Sn".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"A h:mm [vazta]",LTS:"A h:mm:ss [vazta]",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY A h:mm [vazta]",LLLL:"dddd, MMMM Do, YYYY, A h:mm [vazta]",llll:"ddd, D MMM YYYY, A h:mm [vazta]"},calendar:{sameDay:"[Aiz] LT",nextDay:"[Faleam] LT",nextWeek:"[Fuddlo] dddd[,] LT",lastDay:"[Kal] LT",lastWeek:"[Fattlo] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%s",past:"%s adim",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}(er)/,ordinal:function(e,t){switch(t){case"D":return e+"er";default:case"M":case"Q":case"DDD":case"d":case"w":case"W":return e}},week:{dow:0,doy:3},meridiemParse:/rati|sokallim|donparam|sanje/,meridiemHour:function(e,t){return 12===e&&(e=0),"rati"===t?e<4?e:e+12:"sokallim"===t?e:"donparam"===t?e>12?e:e+12:"sanje"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"rati":e<12?"sokallim":e<16?"donparam":e<20?"sanje":"rati"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/gu.js":function(e,t,n){!function(e){"use strict";var t={1:"૧",2:"૨",3:"૩",4:"૪",5:"૫",6:"૬",7:"૭",8:"૮",9:"૯",0:"૦"},n={"૧":"1","૨":"2","૩":"3","૪":"4","૫":"5","૬":"6","૭":"7","૮":"8","૯":"9","૦":"0"};e.defineLocale("gu",{months:"જાન્યુઆરી_ફેબ્રુઆરી_માર્ચ_એપ્રિલ_મે_જૂન_જુલાઈ_ઑગસ્ટ_સપ્ટેમ્બર_ઑક્ટ્બર_નવેમ્બર_ડિસેમ્બર".split("_"),monthsShort:"જાન્યુ._ફેબ્રુ._માર્ચ_એપ્રિ._મે_જૂન_જુલા._ઑગ._સપ્ટે._ઑક્ટ્._નવે._ડિસે.".split("_"),monthsParseExact:!0,weekdays:"રવિવાર_સોમવાર_મંગળવાર_બુધ્વાર_ગુરુવાર_શુક્રવાર_શનિવાર".split("_"),weekdaysShort:"રવિ_સોમ_મંગળ_બુધ્_ગુરુ_શુક્ર_શનિ".split("_"),weekdaysMin:"ર_સો_મં_બુ_ગુ_શુ_શ".split("_"),longDateFormat:{LT:"A h:mm વાગ્યે",LTS:"A h:mm:ss વાગ્યે",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm વાગ્યે",LLLL:"dddd, D MMMM YYYY, A h:mm વાગ્યે"},calendar:{sameDay:"[આજ] LT",nextDay:"[કાલે] LT",nextWeek:"dddd, LT",lastDay:"[ગઇકાલે] LT",lastWeek:"[પાછલા] dddd, LT",sameElse:"L"},relativeTime:{future:"%s મા",past:"%s પહેલા",s:"અમુક પળો",ss:"%d સેકંડ",m:"એક મિનિટ",mm:"%d મિનિટ",h:"એક કલાક",hh:"%d કલાક",d:"એક દિવસ",dd:"%d દિવસ",M:"એક મહિનો",MM:"%d મહિનો",y:"એક વર્ષ",yy:"%d વર્ષ"},preparse:function(e){return e.replace(/[૧૨૩૪૫૬૭૮૯૦]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/રાત|બપોર|સવાર|સાંજ/,meridiemHour:function(e,t){return 12===e&&(e=0),"રાત"===t?e<4?e:e+12:"સવાર"===t?e:"બપોર"===t?e>=10?e:e+12:"સાંજ"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"રાત":e<10?"સવાર":e<17?"બપોર":e<20?"સાંજ":"રાત"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/he.js":function(e,t,n){!function(e){"use strict";e.defineLocale("he",{months:"ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר".split("_"),monthsShort:"ינו׳_פבר׳_מרץ_אפר׳_מאי_יוני_יולי_אוג׳_ספט׳_אוק׳_נוב׳_דצמ׳".split("_"),weekdays:"ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת".split("_"),weekdaysShort:"א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳".split("_"),weekdaysMin:"א_ב_ג_ד_ה_ו_ש".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [ב]MMMM YYYY",LLL:"D [ב]MMMM YYYY HH:mm",LLLL:"dddd, D [ב]MMMM YYYY HH:mm",l:"D/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},calendar:{sameDay:"[היום ב־]LT",nextDay:"[מחר ב־]LT",nextWeek:"dddd [בשעה] LT",lastDay:"[אתמול ב־]LT",lastWeek:"[ביום] dddd [האחרון בשעה] LT",sameElse:"L"},relativeTime:{future:"בעוד %s",past:"לפני %s",s:"מספר שניות",ss:"%d שניות",m:"דקה",mm:"%d דקות",h:"שעה",hh:function(e){return 2===e?"שעתיים":e+" שעות"},d:"יום",dd:function(e){return 2===e?"יומיים":e+" ימים"},M:"חודש",MM:function(e){return 2===e?"חודשיים":e+" חודשים"},y:"שנה",yy:function(e){return 2===e?"שנתיים":e%10==0&&10!==e?e+" שנה":e+" שנים"}},meridiemParse:/אחה"צ|לפנה"צ|אחרי הצהריים|לפני הצהריים|לפנות בוקר|בבוקר|בערב/i,isPM:function(e){return/^(אחה"צ|אחרי הצהריים|בערב)$/.test(e)},meridiem:function(e,t,n){return e<5?"לפנות בוקר":e<10?"בבוקר":e<12?n?'לפנה"צ':"לפני הצהריים":e<18?n?'אחה"צ':"אחרי הצהריים":"בערב"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/hi.js":function(e,t,n){!function(e){"use strict";var t={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},n={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"},o=[/^जन/i,/^फ़र|फर/i,/^मार्च/i,/^अप्रै/i,/^मई/i,/^जून/i,/^जुल/i,/^अग/i,/^सितं|सित/i,/^अक्टू/i,/^नव|नवं/i,/^दिसं|दिस/i];e.defineLocale("hi",{months:{format:"जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर".split("_"),standalone:"जनवरी_फरवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितंबर_अक्टूबर_नवंबर_दिसंबर".split("_")},monthsShort:"जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.".split("_"),weekdays:"रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),weekdaysShort:"रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),longDateFormat:{LT:"A h:mm बजे",LTS:"A h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm बजे",LLLL:"dddd, D MMMM YYYY, A h:mm बजे"},monthsParse:o,longMonthsParse:o,shortMonthsParse:[/^जन/i,/^फ़र/i,/^मार्च/i,/^अप्रै/i,/^मई/i,/^जून/i,/^जुल/i,/^अग/i,/^सित/i,/^अक्टू/i,/^नव/i,/^दिस/i],monthsRegex:/^(जनवरी|जन\.?|फ़रवरी|फरवरी|फ़र\.?|मार्च?|अप्रैल|अप्रै\.?|मई?|जून?|जुलाई|जुल\.?|अगस्त|अग\.?|सितम्बर|सितंबर|सित\.?|अक्टूबर|अक्टू\.?|नवम्बर|नवंबर|नव\.?|दिसम्बर|दिसंबर|दिस\.?)/i,monthsShortRegex:/^(जनवरी|जन\.?|फ़रवरी|फरवरी|फ़र\.?|मार्च?|अप्रैल|अप्रै\.?|मई?|जून?|जुलाई|जुल\.?|अगस्त|अग\.?|सितम्बर|सितंबर|सित\.?|अक्टूबर|अक्टू\.?|नवम्बर|नवंबर|नव\.?|दिसम्बर|दिसंबर|दिस\.?)/i,monthsStrictRegex:/^(जनवरी?|फ़रवरी|फरवरी?|मार्च?|अप्रैल?|मई?|जून?|जुलाई?|अगस्त?|सितम्बर|सितंबर|सित?\.?|अक्टूबर|अक्टू\.?|नवम्बर|नवंबर?|दिसम्बर|दिसंबर?)/i,monthsShortStrictRegex:/^(जन\.?|फ़र\.?|मार्च?|अप्रै\.?|मई?|जून?|जुल\.?|अग\.?|सित\.?|अक्टू\.?|नव\.?|दिस\.?)/i,calendar:{sameDay:"[आज] LT",nextDay:"[कल] LT",nextWeek:"dddd, LT",lastDay:"[कल] LT",lastWeek:"[पिछले] dddd, LT",sameElse:"L"},relativeTime:{future:"%s में",past:"%s पहले",s:"कुछ ही क्षण",ss:"%d सेकंड",m:"एक मिनट",mm:"%d मिनट",h:"एक घंटा",hh:"%d घंटे",d:"एक दिन",dd:"%d दिन",M:"एक महीने",MM:"%d महीने",y:"एक वर्ष",yy:"%d वर्ष"},preparse:function(e){return e.replace(/[१२३४५६७८९०]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/रात|सुबह|दोपहर|शाम/,meridiemHour:function(e,t){return 12===e&&(e=0),"रात"===t?e<4?e:e+12:"सुबह"===t?e:"दोपहर"===t?e>=10?e:e+12:"शाम"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"रात":e<10?"सुबह":e<17?"दोपहर":e<20?"शाम":"रात"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/hr.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){var o=e+" ";switch(n){case"ss":return o+(1===e?"sekunda":2===e||3===e||4===e?"sekunde":"sekundi");case"m":return t?"jedna minuta":"jedne minute";case"mm":return o+(1===e?"minuta":2===e||3===e||4===e?"minute":"minuta");case"h":return t?"jedan sat":"jednog sata";case"hh":return o+(1===e?"sat":2===e||3===e||4===e?"sata":"sati");case"dd":return o+(1===e?"dan":"dana");case"MM":return o+(1===e?"mjesec":2===e||3===e||4===e?"mjeseca":"mjeseci");case"yy":return o+(1===e?"godina":2===e||3===e||4===e?"godine":"godina")}}e.defineLocale("hr",{months:{format:"siječnja_veljače_ožujka_travnja_svibnja_lipnja_srpnja_kolovoza_rujna_listopada_studenoga_prosinca".split("_"),standalone:"siječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac".split("_")},monthsShort:"sij._velj._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"Do MMMM YYYY",LLL:"Do MMMM YYYY H:mm",LLLL:"dddd, Do MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[jučer u] LT",lastWeek:function(){switch(this.day()){case 0:return"[prošlu] [nedjelju] [u] LT";case 3:return"[prošlu] [srijedu] [u] LT";case 6:return"[prošle] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[prošli] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",ss:t,m:t,mm:t,h:t,hh:t,d:"dan",dd:t,M:"mjesec",MM:t,y:"godinu",yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/hu.js":function(e,t,n){!function(e){"use strict";var t="vasárnap hétfőn kedden szerdán csütörtökön pénteken szombaton".split(" ");function n(e,t,n,o){var r=e;switch(n){case"s":return o||t?"néhány másodperc":"néhány másodperce";case"ss":return r+(o||t)?" másodperc":" másodperce";case"m":return"egy"+(o||t?" perc":" perce");case"mm":return r+(o||t?" perc":" perce");case"h":return"egy"+(o||t?" óra":" órája");case"hh":return r+(o||t?" óra":" órája");case"d":return"egy"+(o||t?" nap":" napja");case"dd":return r+(o||t?" nap":" napja");case"M":return"egy"+(o||t?" hónap":" hónapja");case"MM":return r+(o||t?" hónap":" hónapja");case"y":return"egy"+(o||t?" év":" éve");case"yy":return r+(o||t?" év":" éve")}return""}function o(e){return(e?"":"[múlt] ")+"["+t[this.day()]+"] LT[-kor]"}e.defineLocale("hu",{months:"január_február_március_április_május_június_július_augusztus_szeptember_október_november_december".split("_"),monthsShort:"jan._feb._márc._ápr._máj._jún._júl._aug._szept._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat".split("_"),weekdaysShort:"vas_hét_kedd_sze_csüt_pén_szo".split("_"),weekdaysMin:"v_h_k_sze_cs_p_szo".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY. MMMM D.",LLL:"YYYY. MMMM D. H:mm",LLLL:"YYYY. MMMM D., dddd H:mm"},meridiemParse:/de|du/i,isPM:function(e){return"u"===e.charAt(1).toLowerCase()},meridiem:function(e,t,n){return e<12?!0===n?"de":"DE":!0===n?"du":"DU"},calendar:{sameDay:"[ma] LT[-kor]",nextDay:"[holnap] LT[-kor]",nextWeek:function(){return o.call(this,!0)},lastDay:"[tegnap] LT[-kor]",lastWeek:function(){return o.call(this,!1)},sameElse:"L"},relativeTime:{future:"%s múlva",past:"%s",s:n,ss:n,m:n,mm:n,h:n,hh:n,d:n,dd:n,M:n,MM:n,y:n,yy:n},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/hy-am.js":function(e,t,n){!function(e){"use strict";e.defineLocale("hy-am",{months:{format:"հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի".split("_"),standalone:"հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր".split("_")},monthsShort:"հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ".split("_"),weekdays:"կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ".split("_"),weekdaysShort:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),weekdaysMin:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY թ.",LLL:"D MMMM YYYY թ., HH:mm",LLLL:"dddd, D MMMM YYYY թ., HH:mm"},calendar:{sameDay:"[այսօր] LT",nextDay:"[վաղը] LT",lastDay:"[երեկ] LT",nextWeek:function(){return"dddd [օրը ժամը] LT"},lastWeek:function(){return"[անցած] dddd [օրը ժամը] LT"},sameElse:"L"},relativeTime:{future:"%s հետո",past:"%s առաջ",s:"մի քանի վայրկյան",ss:"%d վայրկյան",m:"րոպե",mm:"%d րոպե",h:"ժամ",hh:"%d ժամ",d:"օր",dd:"%d օր",M:"ամիս",MM:"%d ամիս",y:"տարի",yy:"%d տարի"},meridiemParse:/գիշերվա|առավոտվա|ցերեկվա|երեկոյան/,isPM:function(e){return/^(ցերեկվա|երեկոյան)$/.test(e)},meridiem:function(e){return e<4?"գիշերվա":e<12?"առավոտվա":e<17?"ցերեկվա":"երեկոյան"},dayOfMonthOrdinalParse:/\d{1,2}|\d{1,2}-(ին|րդ)/,ordinal:function(e,t){switch(t){case"DDD":case"w":case"W":case"DDDo":return 1===e?e+"-ին":e+"-րդ";default:return e}},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/id.js":function(e,t,n){!function(e){"use strict";e.defineLocale("id",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Agt_Sep_Okt_Nov_Des".split("_"),weekdays:"Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu".split("_"),weekdaysShort:"Min_Sen_Sel_Rab_Kam_Jum_Sab".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|siang|sore|malam/,meridiemHour:function(e,t){return 12===e&&(e=0),"pagi"===t?e:"siang"===t?e>=11?e:e+12:"sore"===t||"malam"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"pagi":e<15?"siang":e<19?"sore":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Besok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kemarin pukul] LT",lastWeek:"dddd [lalu pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lalu",s:"beberapa detik",ss:"%d detik",m:"semenit",mm:"%d menit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/is.js":function(e,t,n){!function(e){"use strict";function t(e){return e%100==11||e%10!=1}function n(e,n,o,r){var s=e+" ";switch(o){case"s":return n||r?"nokkrar sekúndur":"nokkrum sekúndum";case"ss":return t(e)?s+(n||r?"sekúndur":"sekúndum"):s+"sekúnda";case"m":return n?"mínúta":"mínútu";case"mm":return t(e)?s+(n||r?"mínútur":"mínútum"):n?s+"mínúta":s+"mínútu";case"hh":return t(e)?s+(n||r?"klukkustundir":"klukkustundum"):s+"klukkustund";case"d":return n?"dagur":r?"dag":"degi";case"dd":return t(e)?n?s+"dagar":s+(r?"daga":"dögum"):n?s+"dagur":s+(r?"dag":"degi");case"M":return n?"mánuður":r?"mánuð":"mánuði";case"MM":return t(e)?n?s+"mánuðir":s+(r?"mánuði":"mánuðum"):n?s+"mánuður":s+(r?"mánuð":"mánuði");case"y":return n||r?"ár":"ári";case"yy":return t(e)?s+(n||r?"ár":"árum"):s+(n||r?"ár":"ári")}}e.defineLocale("is",{months:"janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember".split("_"),monthsShort:"jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des".split("_"),weekdays:"sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur".split("_"),weekdaysShort:"sun_mán_þri_mið_fim_fös_lau".split("_"),weekdaysMin:"Su_Má_Þr_Mi_Fi_Fö_La".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd, D. MMMM YYYY [kl.] H:mm"},calendar:{sameDay:"[í dag kl.] LT",nextDay:"[á morgun kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[í gær kl.] LT",lastWeek:"[síðasta] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"eftir %s",past:"fyrir %s síðan",s:n,ss:n,m:n,mm:n,h:"klukkustund",hh:n,d:n,dd:n,M:n,MM:n,y:n,yy:n},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/it-ch.js":function(e,t,n){!function(e){"use strict";e.defineLocale("it-ch",{months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Oggi alle] LT",nextDay:"[Domani alle] LT",nextWeek:"dddd [alle] LT",lastDay:"[Ieri alle] LT",lastWeek:function(){switch(this.day()){case 0:return"[la scorsa] dddd [alle] LT";default:return"[lo scorso] dddd [alle] LT"}},sameElse:"L"},relativeTime:{future:function(e){return(/^[0-9].+$/.test(e)?"tra":"in")+" "+e},past:"%s fa",s:"alcuni secondi",ss:"%d secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/it.js":function(e,t,n){!function(e){"use strict";e.defineLocale("it",{months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:function(){return"[Oggi a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},nextDay:function(){return"[Domani a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},nextWeek:function(){return"dddd [a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},lastDay:function(){return"[Ieri a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},lastWeek:function(){switch(this.day()){case 0:return"[La scorsa] dddd [a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT";default:return"[Lo scorso] dddd [a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"}},sameElse:"L"},relativeTime:{future:"tra %s",past:"%s fa",s:"alcuni secondi",ss:"%d secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",w:"una settimana",ww:"%d settimane",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ja.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ja",{eras:[{since:"2019-05-01",offset:1,name:"令和",narrow:"㋿",abbr:"R"},{since:"1989-01-08",until:"2019-04-30",offset:1,name:"平成",narrow:"㍻",abbr:"H"},{since:"1926-12-25",until:"1989-01-07",offset:1,name:"昭和",narrow:"㍼",abbr:"S"},{since:"1912-07-30",until:"1926-12-24",offset:1,name:"大正",narrow:"㍽",abbr:"T"},{since:"1873-01-01",until:"1912-07-29",offset:6,name:"明治",narrow:"㍾",abbr:"M"},{since:"0001-01-01",until:"1873-12-31",offset:1,name:"西暦",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"紀元前",narrow:"BC",abbr:"BC"}],eraYearOrdinalRegex:/(元|\d+)年/,eraYearOrdinalParse:function(e,t){return"元"===t[1]?1:parseInt(t[1]||e,10)},months:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日".split("_"),weekdaysShort:"日_月_火_水_木_金_土".split("_"),weekdaysMin:"日_月_火_水_木_金_土".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日 dddd HH:mm",l:"YYYY/MM/DD",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日(ddd) HH:mm"},meridiemParse:/午前|午後/i,isPM:function(e){return"午後"===e},meridiem:function(e,t,n){return e<12?"午前":"午後"},calendar:{sameDay:"[今日] LT",nextDay:"[明日] LT",nextWeek:function(e){return e.week()!==this.week()?"[来週]dddd LT":"dddd LT"},lastDay:"[昨日] LT",lastWeek:function(e){return this.week()!==e.week()?"[先週]dddd LT":"dddd LT"},sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}日/,ordinal:function(e,t){switch(t){case"y":return 1===e?"元年":e+"年";case"d":case"D":case"DDD":return e+"日";default:return e}},relativeTime:{future:"%s後",past:"%s前",s:"数秒",ss:"%d秒",m:"1分",mm:"%d分",h:"1時間",hh:"%d時間",d:"1日",dd:"%d日",M:"1ヶ月",MM:"%dヶ月",y:"1年",yy:"%d年"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/jv.js":function(e,t,n){!function(e){"use strict";e.defineLocale("jv",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_Nopember_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nop_Des".split("_"),weekdays:"Minggu_Senen_Seloso_Rebu_Kemis_Jemuwah_Septu".split("_"),weekdaysShort:"Min_Sen_Sel_Reb_Kem_Jem_Sep".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sp".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/enjing|siyang|sonten|ndalu/,meridiemHour:function(e,t){return 12===e&&(e=0),"enjing"===t?e:"siyang"===t?e>=11?e:e+12:"sonten"===t||"ndalu"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"enjing":e<15?"siyang":e<19?"sonten":"ndalu"},calendar:{sameDay:"[Dinten puniko pukul] LT",nextDay:"[Mbenjang pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kala wingi pukul] LT",lastWeek:"dddd [kepengker pukul] LT",sameElse:"L"},relativeTime:{future:"wonten ing %s",past:"%s ingkang kepengker",s:"sawetawis detik",ss:"%d detik",m:"setunggal menit",mm:"%d menit",h:"setunggal jam",hh:"%d jam",d:"sedinten",dd:"%d dinten",M:"sewulan",MM:"%d wulan",y:"setaun",yy:"%d taun"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ka.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ka",{months:"იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი".split("_"),monthsShort:"იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ".split("_"),weekdays:{standalone:"კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი".split("_"),format:"კვირას_ორშაბათს_სამშაბათს_ოთხშაბათს_ხუთშაბათს_პარასკევს_შაბათს".split("_"),isFormat:/(წინა|შემდეგ)/},weekdaysShort:"კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ".split("_"),weekdaysMin:"კვ_ორ_სა_ოთ_ხუ_პა_შა".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[დღეს] LT[-ზე]",nextDay:"[ხვალ] LT[-ზე]",lastDay:"[გუშინ] LT[-ზე]",nextWeek:"[შემდეგ] dddd LT[-ზე]",lastWeek:"[წინა] dddd LT-ზე",sameElse:"L"},relativeTime:{future:function(e){return e.replace(/(წამ|წუთ|საათ|წელ|დღ|თვ)(ი|ე)/,(function(e,t,n){return"ი"===n?t+"ში":t+n+"ში"}))},past:function(e){return/(წამი|წუთი|საათი|დღე|თვე)/.test(e)?e.replace(/(ი|ე)$/,"ის წინ"):/წელი/.test(e)?e.replace(/წელი$/,"წლის წინ"):e},s:"რამდენიმე წამი",ss:"%d წამი",m:"წუთი",mm:"%d წუთი",h:"საათი",hh:"%d საათი",d:"დღე",dd:"%d დღე",M:"თვე",MM:"%d თვე",y:"წელი",yy:"%d წელი"},dayOfMonthOrdinalParse:/0|1-ლი|მე-\d{1,2}|\d{1,2}-ე/,ordinal:function(e){return 0===e?e:1===e?e+"-ლი":e<20||e<=100&&e%20==0||e%100==0?"მე-"+e:e+"-ე"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/kk.js":function(e,t,n){!function(e){"use strict";var t={0:"-ші",1:"-ші",2:"-ші",3:"-ші",4:"-ші",5:"-ші",6:"-шы",7:"-ші",8:"-ші",9:"-шы",10:"-шы",20:"-шы",30:"-шы",40:"-шы",50:"-ші",60:"-шы",70:"-ші",80:"-ші",90:"-шы",100:"-ші"};e.defineLocale("kk",{months:"қаңтар_ақпан_наурыз_сәуір_мамыр_маусым_шілде_тамыз_қыркүйек_қазан_қараша_желтоқсан".split("_"),monthsShort:"қаң_ақп_нау_сәу_мам_мау_шіл_там_қыр_қаз_қар_жел".split("_"),weekdays:"жексенбі_дүйсенбі_сейсенбі_сәрсенбі_бейсенбі_жұма_сенбі".split("_"),weekdaysShort:"жек_дүй_сей_сәр_бей_жұм_сен".split("_"),weekdaysMin:"жк_дй_сй_ср_бй_жм_сн".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Бүгін сағат] LT",nextDay:"[Ертең сағат] LT",nextWeek:"dddd [сағат] LT",lastDay:"[Кеше сағат] LT",lastWeek:"[Өткен аптаның] dddd [сағат] LT",sameElse:"L"},relativeTime:{future:"%s ішінде",past:"%s бұрын",s:"бірнеше секунд",ss:"%d секунд",m:"бір минут",mm:"%d минут",h:"бір сағат",hh:"%d сағат",d:"бір күн",dd:"%d күн",M:"бір ай",MM:"%d ай",y:"бір жыл",yy:"%d жыл"},dayOfMonthOrdinalParse:/\d{1,2}-(ші|шы)/,ordinal:function(e){return e+(t[e]||t[e%10]||t[e>=100?100:null])},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/km.js":function(e,t,n){!function(e){"use strict";var t={1:"១",2:"២",3:"៣",4:"៤",5:"៥",6:"៦",7:"៧",8:"៨",9:"៩",0:"០"},n={"១":"1","២":"2","៣":"3","៤":"4","៥":"5","៦":"6","៧":"7","៨":"8","៩":"9","០":"0"};e.defineLocale("km",{months:"មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),monthsShort:"មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),weekdays:"អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"),weekdaysShort:"អា_ច_អ_ព_ព្រ_សុ_ស".split("_"),weekdaysMin:"អា_ច_អ_ព_ព្រ_សុ_ស".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/ព្រឹក|ល្ងាច/,isPM:function(e){return"ល្ងាច"===e},meridiem:function(e,t,n){return e<12?"ព្រឹក":"ល្ងាច"},calendar:{sameDay:"[ថ្ងៃនេះ ម៉ោង] LT",nextDay:"[ស្អែក ម៉ោង] LT",nextWeek:"dddd [ម៉ោង] LT",lastDay:"[ម្សិលមិញ ម៉ោង] LT",lastWeek:"dddd [សប្តាហ៍មុន] [ម៉ោង] LT",sameElse:"L"},relativeTime:{future:"%sទៀត",past:"%sមុន",s:"ប៉ុន្មានវិនាទី",ss:"%d វិនាទី",m:"មួយនាទី",mm:"%d នាទី",h:"មួយម៉ោង",hh:"%d ម៉ោង",d:"មួយថ្ងៃ",dd:"%d ថ្ងៃ",M:"មួយខែ",MM:"%d ខែ",y:"មួយឆ្នាំ",yy:"%d ឆ្នាំ"},dayOfMonthOrdinalParse:/ទី\d{1,2}/,ordinal:"ទី%d",preparse:function(e){return e.replace(/[១២៣៤៥៦៧៨៩០]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/kn.js":function(e,t,n){!function(e){"use strict";var t={1:"೧",2:"೨",3:"೩",4:"೪",5:"೫",6:"೬",7:"೭",8:"೮",9:"೯",0:"೦"},n={"೧":"1","೨":"2","೩":"3","೪":"4","೫":"5","೬":"6","೭":"7","೮":"8","೯":"9","೦":"0"};e.defineLocale("kn",{months:"ಜನವರಿ_ಫೆಬ್ರವರಿ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂಬರ್_ಅಕ್ಟೋಬರ್_ನವೆಂಬರ್_ಡಿಸೆಂಬರ್".split("_"),monthsShort:"ಜನ_ಫೆಬ್ರ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂ_ಅಕ್ಟೋ_ನವೆಂ_ಡಿಸೆಂ".split("_"),monthsParseExact:!0,weekdays:"ಭಾನುವಾರ_ಸೋಮವಾರ_ಮಂಗಳವಾರ_ಬುಧವಾರ_ಗುರುವಾರ_ಶುಕ್ರವಾರ_ಶನಿವಾರ".split("_"),weekdaysShort:"ಭಾನು_ಸೋಮ_ಮಂಗಳ_ಬುಧ_ಗುರು_ಶುಕ್ರ_ಶನಿ".split("_"),weekdaysMin:"ಭಾ_ಸೋ_ಮಂ_ಬು_ಗು_ಶು_ಶ".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[ಇಂದು] LT",nextDay:"[ನಾಳೆ] LT",nextWeek:"dddd, LT",lastDay:"[ನಿನ್ನೆ] LT",lastWeek:"[ಕೊನೆಯ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ನಂತರ",past:"%s ಹಿಂದೆ",s:"ಕೆಲವು ಕ್ಷಣಗಳು",ss:"%d ಸೆಕೆಂಡುಗಳು",m:"ಒಂದು ನಿಮಿಷ",mm:"%d ನಿಮಿಷ",h:"ಒಂದು ಗಂಟೆ",hh:"%d ಗಂಟೆ",d:"ಒಂದು ದಿನ",dd:"%d ದಿನ",M:"ಒಂದು ತಿಂಗಳು",MM:"%d ತಿಂಗಳು",y:"ಒಂದು ವರ್ಷ",yy:"%d ವರ್ಷ"},preparse:function(e){return e.replace(/[೧೨೩೪೫೬೭೮೯೦]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/ರಾತ್ರಿ|ಬೆಳಿಗ್ಗೆ|ಮಧ್ಯಾಹ್ನ|ಸಂಜೆ/,meridiemHour:function(e,t){return 12===e&&(e=0),"ರಾತ್ರಿ"===t?e<4?e:e+12:"ಬೆಳಿಗ್ಗೆ"===t?e:"ಮಧ್ಯಾಹ್ನ"===t?e>=10?e:e+12:"ಸಂಜೆ"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"ರಾತ್ರಿ":e<10?"ಬೆಳಿಗ್ಗೆ":e<17?"ಮಧ್ಯಾಹ್ನ":e<20?"ಸಂಜೆ":"ರಾತ್ರಿ"},dayOfMonthOrdinalParse:/\d{1,2}(ನೇ)/,ordinal:function(e){return e+"ನೇ"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ko.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ko",{months:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),monthsShort:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),weekdays:"일요일_월요일_화요일_수요일_목요일_금요일_토요일".split("_"),weekdaysShort:"일_월_화_수_목_금_토".split("_"),weekdaysMin:"일_월_화_수_목_금_토".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY년 MMMM D일",LLL:"YYYY년 MMMM D일 A h:mm",LLLL:"YYYY년 MMMM D일 dddd A h:mm",l:"YYYY.MM.DD.",ll:"YYYY년 MMMM D일",lll:"YYYY년 MMMM D일 A h:mm",llll:"YYYY년 MMMM D일 dddd A h:mm"},calendar:{sameDay:"오늘 LT",nextDay:"내일 LT",nextWeek:"dddd LT",lastDay:"어제 LT",lastWeek:"지난주 dddd LT",sameElse:"L"},relativeTime:{future:"%s 후",past:"%s 전",s:"몇 초",ss:"%d초",m:"1분",mm:"%d분",h:"한 시간",hh:"%d시간",d:"하루",dd:"%d일",M:"한 달",MM:"%d달",y:"일 년",yy:"%d년"},dayOfMonthOrdinalParse:/\d{1,2}(일|월|주)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"일";case"M":return e+"월";case"w":case"W":return e+"주";default:return e}},meridiemParse:/오전|오후/,isPM:function(e){return"오후"===e},meridiem:function(e,t,n){return e<12?"오전":"오후"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ku.js":function(e,t,n){!function(e){"use strict";var t={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},n={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},o=["کانونی دووەم","شوبات","ئازار","نیسان","ئایار","حوزەیران","تەمموز","ئاب","ئەیلوول","تشرینی یەكەم","تشرینی دووەم","كانونی یەکەم"];e.defineLocale("ku",{months:o,monthsShort:o,weekdays:"یه‌كشه‌ممه‌_دووشه‌ممه‌_سێشه‌ممه‌_چوارشه‌ممه‌_پێنجشه‌ممه‌_هه‌ینی_شه‌ممه‌".split("_"),weekdaysShort:"یه‌كشه‌م_دووشه‌م_سێشه‌م_چوارشه‌م_پێنجشه‌م_هه‌ینی_شه‌ممه‌".split("_"),weekdaysMin:"ی_د_س_چ_پ_ه_ش".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/ئێواره‌|به‌یانی/,isPM:function(e){return/ئێواره‌/.test(e)},meridiem:function(e,t,n){return e<12?"به‌یانی":"ئێواره‌"},calendar:{sameDay:"[ئه‌مرۆ كاتژمێر] LT",nextDay:"[به‌یانی كاتژمێر] LT",nextWeek:"dddd [كاتژمێر] LT",lastDay:"[دوێنێ كاتژمێر] LT",lastWeek:"dddd [كاتژمێر] LT",sameElse:"L"},relativeTime:{future:"له‌ %s",past:"%s",s:"چه‌ند چركه‌یه‌ك",ss:"چركه‌ %d",m:"یه‌ك خوله‌ك",mm:"%d خوله‌ك",h:"یه‌ك كاتژمێر",hh:"%d كاتژمێر",d:"یه‌ك ڕۆژ",dd:"%d ڕۆژ",M:"یه‌ك مانگ",MM:"%d مانگ",y:"یه‌ك ساڵ",yy:"%d ساڵ"},preparse:function(e){return e.replace(/[١٢٣٤٥٦٧٨٩٠]/g,(function(e){return n[e]})).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ky.js":function(e,t,n){!function(e){"use strict";var t={0:"-чү",1:"-чи",2:"-чи",3:"-чү",4:"-чү",5:"-чи",6:"-чы",7:"-чи",8:"-чи",9:"-чу",10:"-чу",20:"-чы",30:"-чу",40:"-чы",50:"-чү",60:"-чы",70:"-чи",80:"-чи",90:"-чу",100:"-чү"};e.defineLocale("ky",{months:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"),monthsShort:"янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек".split("_"),weekdays:"Жекшемби_Дүйшөмбү_Шейшемби_Шаршемби_Бейшемби_Жума_Ишемби".split("_"),weekdaysShort:"Жек_Дүй_Шей_Шар_Бей_Жум_Ише".split("_"),weekdaysMin:"Жк_Дй_Шй_Шр_Бй_Жм_Иш".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Бүгүн саат] LT",nextDay:"[Эртең саат] LT",nextWeek:"dddd [саат] LT",lastDay:"[Кечээ саат] LT",lastWeek:"[Өткөн аптанын] dddd [күнү] [саат] LT",sameElse:"L"},relativeTime:{future:"%s ичинде",past:"%s мурун",s:"бирнече секунд",ss:"%d секунд",m:"бир мүнөт",mm:"%d мүнөт",h:"бир саат",hh:"%d саат",d:"бир күн",dd:"%d күн",M:"бир ай",MM:"%d ай",y:"бир жыл",yy:"%d жыл"},dayOfMonthOrdinalParse:/\d{1,2}-(чи|чы|чү|чу)/,ordinal:function(e){return e+(t[e]||t[e%10]||t[e>=100?100:null])},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/lb.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={m:["eng Minutt","enger Minutt"],h:["eng Stonn","enger Stonn"],d:["een Dag","engem Dag"],M:["ee Mount","engem Mount"],y:["ee Joer","engem Joer"]};return t?r[n][0]:r[n][1]}function n(e){if(e=parseInt(e,10),isNaN(e))return!1;if(e<0)return!0;if(e<10)return 4<=e&&e<=7;if(e<100){var t=e%10;return n(0===t?e/10:t)}if(e<1e4){for(;e>=10;)e/=10;return n(e)}return n(e/=1e3)}e.defineLocale("lb",{months:"Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg".split("_"),weekdaysShort:"So._Mé._Dë._Më._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mé_Dë_Më_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm [Auer]",LTS:"H:mm:ss [Auer]",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm [Auer]",LLLL:"dddd, D. MMMM YYYY H:mm [Auer]"},calendar:{sameDay:"[Haut um] LT",sameElse:"L",nextDay:"[Muer um] LT",nextWeek:"dddd [um] LT",lastDay:"[Gëschter um] LT",lastWeek:function(){switch(this.day()){case 2:case 4:return"[Leschten] dddd [um] LT";default:return"[Leschte] dddd [um] LT"}}},relativeTime:{future:function(e){return n(e.substr(0,e.indexOf(" ")))?"a "+e:"an "+e},past:function(e){return n(e.substr(0,e.indexOf(" ")))?"viru "+e:"virun "+e},s:"e puer Sekonnen",ss:"%d Sekonnen",m:t,mm:"%d Minutten",h:t,hh:"%d Stonnen",d:t,dd:"%d Deeg",M:t,MM:"%d Méint",y:t,yy:"%d Joer"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/lo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("lo",{months:"ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ".split("_"),monthsShort:"ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ".split("_"),weekdays:"ອາທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ".split("_"),weekdaysShort:"ທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ".split("_"),weekdaysMin:"ທ_ຈ_ອຄ_ພ_ພຫ_ສກ_ສ".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"ວັນdddd D MMMM YYYY HH:mm"},meridiemParse:/ຕອນເຊົ້າ|ຕອນແລງ/,isPM:function(e){return"ຕອນແລງ"===e},meridiem:function(e,t,n){return e<12?"ຕອນເຊົ້າ":"ຕອນແລງ"},calendar:{sameDay:"[ມື້ນີ້ເວລາ] LT",nextDay:"[ມື້ອື່ນເວລາ] LT",nextWeek:"[ວັນ]dddd[ໜ້າເວລາ] LT",lastDay:"[ມື້ວານນີ້ເວລາ] LT",lastWeek:"[ວັນ]dddd[ແລ້ວນີ້ເວລາ] LT",sameElse:"L"},relativeTime:{future:"ອີກ %s",past:"%sຜ່ານມາ",s:"ບໍ່ເທົ່າໃດວິນາທີ",ss:"%d ວິນາທີ",m:"1 ນາທີ",mm:"%d ນາທີ",h:"1 ຊົ່ວໂມງ",hh:"%d ຊົ່ວໂມງ",d:"1 ມື້",dd:"%d ມື້",M:"1 ເດືອນ",MM:"%d ເດືອນ",y:"1 ປີ",yy:"%d ປີ"},dayOfMonthOrdinalParse:/(ທີ່)\d{1,2}/,ordinal:function(e){return"ທີ່"+e}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/lt.js":function(e,t,n){!function(e){"use strict";var t={ss:"sekundė_sekundžių_sekundes",m:"minutė_minutės_minutę",mm:"minutės_minučių_minutes",h:"valanda_valandos_valandą",hh:"valandos_valandų_valandas",d:"diena_dienos_dieną",dd:"dienos_dienų_dienas",M:"mėnuo_mėnesio_mėnesį",MM:"mėnesiai_mėnesių_mėnesius",y:"metai_metų_metus",yy:"metai_metų_metus"};function n(e,t,n,o){return t?r(n)[0]:o?r(n)[1]:r(n)[2]}function o(e){return e%10==0||e>10&&e<20}function r(e){return t[e].split("_")}function s(e,t,s,a){var i=e+" ";return 1===e?i+n(0,t,s[0],a):t?i+(o(e)?r(s)[1]:r(s)[0]):a?i+r(s)[1]:i+(o(e)?r(s)[1]:r(s)[2])}e.defineLocale("lt",{months:{format:"sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio".split("_"),standalone:"sausis_vasaris_kovas_balandis_gegužė_birželis_liepa_rugpjūtis_rugsėjis_spalis_lapkritis_gruodis".split("_"),isFormat:/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?|MMMM?(\[[^\[\]]*\]|\s)+D[oD]?/},monthsShort:"sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd".split("_"),weekdays:{format:"sekmadienį_pirmadienį_antradienį_trečiadienį_ketvirtadienį_penktadienį_šeštadienį".split("_"),standalone:"sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis".split("_"),isFormat:/dddd HH:mm/},weekdaysShort:"Sek_Pir_Ant_Tre_Ket_Pen_Šeš".split("_"),weekdaysMin:"S_P_A_T_K_Pn_Š".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY [m.] MMMM D [d.]",LLL:"YYYY [m.] MMMM D [d.], HH:mm [val.]",LLLL:"YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]",l:"YYYY-MM-DD",ll:"YYYY [m.] MMMM D [d.]",lll:"YYYY [m.] MMMM D [d.], HH:mm [val.]",llll:"YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]"},calendar:{sameDay:"[Šiandien] LT",nextDay:"[Rytoj] LT",nextWeek:"dddd LT",lastDay:"[Vakar] LT",lastWeek:"[Praėjusį] dddd LT",sameElse:"L"},relativeTime:{future:"po %s",past:"prieš %s",s:function(e,t,n,o){return t?"kelios sekundės":o?"kelių sekundžių":"kelias sekundes"},ss:s,m:n,mm:s,h:n,hh:s,d:n,dd:s,M:n,MM:s,y:n,yy:s},dayOfMonthOrdinalParse:/\d{1,2}-oji/,ordinal:function(e){return e+"-oji"},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/lv.js":function(e,t,n){!function(e){"use strict";var t={ss:"sekundes_sekundēm_sekunde_sekundes".split("_"),m:"minūtes_minūtēm_minūte_minūtes".split("_"),mm:"minūtes_minūtēm_minūte_minūtes".split("_"),h:"stundas_stundām_stunda_stundas".split("_"),hh:"stundas_stundām_stunda_stundas".split("_"),d:"dienas_dienām_diena_dienas".split("_"),dd:"dienas_dienām_diena_dienas".split("_"),M:"mēneša_mēnešiem_mēnesis_mēneši".split("_"),MM:"mēneša_mēnešiem_mēnesis_mēneši".split("_"),y:"gada_gadiem_gads_gadi".split("_"),yy:"gada_gadiem_gads_gadi".split("_")};function n(e,t,n){return n?t%10==1&&t%100!=11?e[2]:e[3]:t%10==1&&t%100!=11?e[0]:e[1]}function o(e,o,r){return e+" "+n(t[r],e,o)}function r(e,o,r){return n(t[r],e,o)}e.defineLocale("lv",{months:"janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris".split("_"),monthsShort:"jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec".split("_"),weekdays:"svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena".split("_"),weekdaysShort:"Sv_P_O_T_C_Pk_S".split("_"),weekdaysMin:"Sv_P_O_T_C_Pk_S".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY.",LL:"YYYY. [gada] D. MMMM",LLL:"YYYY. [gada] D. MMMM, HH:mm",LLLL:"YYYY. [gada] D. MMMM, dddd, HH:mm"},calendar:{sameDay:"[Šodien pulksten] LT",nextDay:"[Rīt pulksten] LT",nextWeek:"dddd [pulksten] LT",lastDay:"[Vakar pulksten] LT",lastWeek:"[Pagājušā] dddd [pulksten] LT",sameElse:"L"},relativeTime:{future:"pēc %s",past:"pirms %s",s:function(e,t){return t?"dažas sekundes":"dažām sekundēm"},ss:o,m:r,mm:o,h:r,hh:o,d:r,dd:o,M:r,MM:o,y:r,yy:o},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/me.js":function(e,t,n){!function(e){"use strict";var t={words:{ss:["sekund","sekunda","sekundi"],m:["jedan minut","jednog minuta"],mm:["minut","minuta","minuta"],h:["jedan sat","jednog sata"],hh:["sat","sata","sati"],dd:["dan","dana","dana"],MM:["mjesec","mjeseca","mjeseci"],yy:["godina","godine","godina"]},correctGrammaticalCase:function(e,t){return 1===e?t[0]:e>=2&&e<=4?t[1]:t[2]},translate:function(e,n,o){var r=t.words[o];return 1===o.length?n?r[0]:r[1]:e+" "+t.correctGrammaticalCase(e,r)}};e.defineLocale("me",{months:"januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sjutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[juče u] LT",lastWeek:function(){return["[prošle] [nedjelje] [u] LT","[prošlog] [ponedjeljka] [u] LT","[prošlog] [utorka] [u] LT","[prošle] [srijede] [u] LT","[prošlog] [četvrtka] [u] LT","[prošlog] [petka] [u] LT","[prošle] [subote] [u] LT"][this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"nekoliko sekundi",ss:t.translate,m:t.translate,mm:t.translate,h:t.translate,hh:t.translate,d:"dan",dd:t.translate,M:"mjesec",MM:t.translate,y:"godinu",yy:t.translate},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/mi.js":function(e,t,n){!function(e){"use strict";e.defineLocale("mi",{months:"Kohi-tāte_Hui-tanguru_Poutū-te-rangi_Paenga-whāwhā_Haratua_Pipiri_Hōngoingoi_Here-turi-kōkā_Mahuru_Whiringa-ā-nuku_Whiringa-ā-rangi_Hakihea".split("_"),monthsShort:"Kohi_Hui_Pou_Pae_Hara_Pipi_Hōngoi_Here_Mahu_Whi-nu_Whi-ra_Haki".split("_"),monthsRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsStrictRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsShortRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsShortStrictRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,2}/i,weekdays:"Rātapu_Mane_Tūrei_Wenerei_Tāite_Paraire_Hātarei".split("_"),weekdaysShort:"Ta_Ma_Tū_We_Tāi_Pa_Hā".split("_"),weekdaysMin:"Ta_Ma_Tū_We_Tāi_Pa_Hā".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [i] HH:mm",LLLL:"dddd, D MMMM YYYY [i] HH:mm"},calendar:{sameDay:"[i teie mahana, i] LT",nextDay:"[apopo i] LT",nextWeek:"dddd [i] LT",lastDay:"[inanahi i] LT",lastWeek:"dddd [whakamutunga i] LT",sameElse:"L"},relativeTime:{future:"i roto i %s",past:"%s i mua",s:"te hēkona ruarua",ss:"%d hēkona",m:"he meneti",mm:"%d meneti",h:"te haora",hh:"%d haora",d:"he ra",dd:"%d ra",M:"he marama",MM:"%d marama",y:"he tau",yy:"%d tau"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/mk.js":function(e,t,n){!function(e){"use strict";e.defineLocale("mk",{months:"јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември".split("_"),monthsShort:"јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек".split("_"),weekdays:"недела_понеделник_вторник_среда_четврток_петок_сабота".split("_"),weekdaysShort:"нед_пон_вто_сре_чет_пет_саб".split("_"),weekdaysMin:"нe_пo_вт_ср_че_пе_сa".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[Денес во] LT",nextDay:"[Утре во] LT",nextWeek:"[Во] dddd [во] LT",lastDay:"[Вчера во] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[Изминатата] dddd [во] LT";case 1:case 2:case 4:case 5:return"[Изминатиот] dddd [во] LT"}},sameElse:"L"},relativeTime:{future:"за %s",past:"пред %s",s:"неколку секунди",ss:"%d секунди",m:"една минута",mm:"%d минути",h:"еден час",hh:"%d часа",d:"еден ден",dd:"%d дена",M:"еден месец",MM:"%d месеци",y:"една година",yy:"%d години"},dayOfMonthOrdinalParse:/\d{1,2}-(ев|ен|ти|ви|ри|ми)/,ordinal:function(e){var t=e%10,n=e%100;return 0===e?e+"-ев":0===n?e+"-ен":n>10&&n<20?e+"-ти":1===t?e+"-ви":2===t?e+"-ри":7===t||8===t?e+"-ми":e+"-ти"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ml.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ml",{months:"ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ".split("_"),monthsShort:"ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.".split("_"),monthsParseExact:!0,weekdays:"ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച".split("_"),weekdaysShort:"ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി".split("_"),weekdaysMin:"ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ".split("_"),longDateFormat:{LT:"A h:mm -നു",LTS:"A h:mm:ss -നു",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm -നു",LLLL:"dddd, D MMMM YYYY, A h:mm -നു"},calendar:{sameDay:"[ഇന്ന്] LT",nextDay:"[നാളെ] LT",nextWeek:"dddd, LT",lastDay:"[ഇന്നലെ] LT",lastWeek:"[കഴിഞ്ഞ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s കഴിഞ്ഞ്",past:"%s മുൻപ്",s:"അൽപ നിമിഷങ്ങൾ",ss:"%d സെക്കൻഡ്",m:"ഒരു മിനിറ്റ്",mm:"%d മിനിറ്റ്",h:"ഒരു മണിക്കൂർ",hh:"%d മണിക്കൂർ",d:"ഒരു ദിവസം",dd:"%d ദിവസം",M:"ഒരു മാസം",MM:"%d മാസം",y:"ഒരു വർഷം",yy:"%d വർഷം"},meridiemParse:/രാത്രി|രാവിലെ|ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി/i,meridiemHour:function(e,t){return 12===e&&(e=0),"രാത്രി"===t&&e>=4||"ഉച്ച കഴിഞ്ഞ്"===t||"വൈകുന്നേരം"===t?e+12:e},meridiem:function(e,t,n){return e<4?"രാത്രി":e<12?"രാവിലെ":e<17?"ഉച്ച കഴിഞ്ഞ്":e<20?"വൈകുന്നേരം":"രാത്രി"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/mn.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){switch(n){case"s":return t?"хэдхэн секунд":"хэдхэн секундын";case"ss":return e+(t?" секунд":" секундын");case"m":case"mm":return e+(t?" минут":" минутын");case"h":case"hh":return e+(t?" цаг":" цагийн");case"d":case"dd":return e+(t?" өдөр":" өдрийн");case"M":case"MM":return e+(t?" сар":" сарын");case"y":case"yy":return e+(t?" жил":" жилийн");default:return e}}e.defineLocale("mn",{months:"Нэгдүгээр сар_Хоёрдугаар сар_Гуравдугаар сар_Дөрөвдүгээр сар_Тавдугаар сар_Зургадугаар сар_Долдугаар сар_Наймдугаар сар_Есдүгээр сар_Аравдугаар сар_Арван нэгдүгээр сар_Арван хоёрдугаар сар".split("_"),monthsShort:"1 сар_2 сар_3 сар_4 сар_5 сар_6 сар_7 сар_8 сар_9 сар_10 сар_11 сар_12 сар".split("_"),monthsParseExact:!0,weekdays:"Ням_Даваа_Мягмар_Лхагва_Пүрэв_Баасан_Бямба".split("_"),weekdaysShort:"Ням_Дав_Мяг_Лха_Пүр_Баа_Бям".split("_"),weekdaysMin:"Ня_Да_Мя_Лх_Пү_Ба_Бя".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY оны MMMMын D",LLL:"YYYY оны MMMMын D HH:mm",LLLL:"dddd, YYYY оны MMMMын D HH:mm"},meridiemParse:/ҮӨ|ҮХ/i,isPM:function(e){return"ҮХ"===e},meridiem:function(e,t,n){return e<12?"ҮӨ":"ҮХ"},calendar:{sameDay:"[Өнөөдөр] LT",nextDay:"[Маргааш] LT",nextWeek:"[Ирэх] dddd LT",lastDay:"[Өчигдөр] LT",lastWeek:"[Өнгөрсөн] dddd LT",sameElse:"L"},relativeTime:{future:"%s дараа",past:"%s өмнө",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2} өдөр/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+" өдөр";default:return e}}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/mr.js":function(e,t,n){!function(e){"use strict";var t={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},n={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"};function o(e,t,n,o){var r="";if(t)switch(n){case"s":r="काही सेकंद";break;case"ss":r="%d सेकंद";break;case"m":r="एक मिनिट";break;case"mm":r="%d मिनिटे";break;case"h":r="एक तास";break;case"hh":r="%d तास";break;case"d":r="एक दिवस";break;case"dd":r="%d दिवस";break;case"M":r="एक महिना";break;case"MM":r="%d महिने";break;case"y":r="एक वर्ष";break;case"yy":r="%d वर्षे"}else switch(n){case"s":r="काही सेकंदां";break;case"ss":r="%d सेकंदां";break;case"m":r="एका मिनिटा";break;case"mm":r="%d मिनिटां";break;case"h":r="एका तासा";break;case"hh":r="%d तासां";break;case"d":r="एका दिवसा";break;case"dd":r="%d दिवसां";break;case"M":r="एका महिन्या";break;case"MM":r="%d महिन्यां";break;case"y":r="एका वर्षा";break;case"yy":r="%d वर्षां"}return r.replace(/%d/i,e)}e.defineLocale("mr",{months:"जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर".split("_"),monthsShort:"जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.".split("_"),monthsParseExact:!0,weekdays:"रविवार_सोमवार_मंगळवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),weekdaysShort:"रवि_सोम_मंगळ_बुध_गुरू_शुक्र_शनि".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),longDateFormat:{LT:"A h:mm वाजता",LTS:"A h:mm:ss वाजता",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm वाजता",LLLL:"dddd, D MMMM YYYY, A h:mm वाजता"},calendar:{sameDay:"[आज] LT",nextDay:"[उद्या] LT",nextWeek:"dddd, LT",lastDay:"[काल] LT",lastWeek:"[मागील] dddd, LT",sameElse:"L"},relativeTime:{future:"%sमध्ये",past:"%sपूर्वी",s:o,ss:o,m:o,mm:o,h:o,hh:o,d:o,dd:o,M:o,MM:o,y:o,yy:o},preparse:function(e){return e.replace(/[१२३४५६७८९०]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/पहाटे|सकाळी|दुपारी|सायंकाळी|रात्री/,meridiemHour:function(e,t){return 12===e&&(e=0),"पहाटे"===t||"सकाळी"===t?e:"दुपारी"===t||"सायंकाळी"===t||"रात्री"===t?e>=12?e:e+12:void 0},meridiem:function(e,t,n){return e>=0&&e<6?"पहाटे":e<12?"सकाळी":e<17?"दुपारी":e<20?"सायंकाळी":"रात्री"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ms-my.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ms-my",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|tengahari|petang|malam/,meridiemHour:function(e,t){return 12===e&&(e=0),"pagi"===t?e:"tengahari"===t?e>=11?e:e+12:"petang"===t||"malam"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"pagi":e<15?"tengahari":e<19?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",ss:"%d saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ms.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ms",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|tengahari|petang|malam/,meridiemHour:function(e,t){return 12===e&&(e=0),"pagi"===t?e:"tengahari"===t?e>=11?e:e+12:"petang"===t||"malam"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"pagi":e<15?"tengahari":e<19?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",ss:"%d saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/mt.js":function(e,t,n){!function(e){"use strict";e.defineLocale("mt",{months:"Jannar_Frar_Marzu_April_Mejju_Ġunju_Lulju_Awwissu_Settembru_Ottubru_Novembru_Diċembru".split("_"),monthsShort:"Jan_Fra_Mar_Apr_Mej_Ġun_Lul_Aww_Set_Ott_Nov_Diċ".split("_"),weekdays:"Il-Ħadd_It-Tnejn_It-Tlieta_L-Erbgħa_Il-Ħamis_Il-Ġimgħa_Is-Sibt".split("_"),weekdaysShort:"Ħad_Tne_Tli_Erb_Ħam_Ġim_Sib".split("_"),weekdaysMin:"Ħa_Tn_Tl_Er_Ħa_Ġi_Si".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Illum fil-]LT",nextDay:"[Għada fil-]LT",nextWeek:"dddd [fil-]LT",lastDay:"[Il-bieraħ fil-]LT",lastWeek:"dddd [li għadda] [fil-]LT",sameElse:"L"},relativeTime:{future:"f’ %s",past:"%s ilu",s:"ftit sekondi",ss:"%d sekondi",m:"minuta",mm:"%d minuti",h:"siegħa",hh:"%d siegħat",d:"ġurnata",dd:"%d ġranet",M:"xahar",MM:"%d xhur",y:"sena",yy:"%d sni"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/my.js":function(e,t,n){!function(e){"use strict";var t={1:"၁",2:"၂",3:"၃",4:"၄",5:"၅",6:"၆",7:"၇",8:"၈",9:"၉",0:"၀"},n={"၁":"1","၂":"2","၃":"3","၄":"4","၅":"5","၆":"6","၇":"7","၈":"8","၉":"9","၀":"0"};e.defineLocale("my",{months:"ဇန်နဝါရီ_ဖေဖော်ဝါရီ_မတ်_ဧပြီ_မေ_ဇွန်_ဇူလိုင်_သြဂုတ်_စက်တင်ဘာ_အောက်တိုဘာ_နိုဝင်ဘာ_ဒီဇင်ဘာ".split("_"),monthsShort:"ဇန်_ဖေ_မတ်_ပြီ_မေ_ဇွန်_လိုင်_သြ_စက်_အောက်_နို_ဒီ".split("_"),weekdays:"တနင်္ဂနွေ_တနင်္လာ_အင်္ဂါ_ဗုဒ္ဓဟူး_ကြာသပတေး_သောကြာ_စနေ".split("_"),weekdaysShort:"နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),weekdaysMin:"နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[ယနေ.] LT [မှာ]",nextDay:"[မနက်ဖြန်] LT [မှာ]",nextWeek:"dddd LT [မှာ]",lastDay:"[မနေ.က] LT [မှာ]",lastWeek:"[ပြီးခဲ့သော] dddd LT [မှာ]",sameElse:"L"},relativeTime:{future:"လာမည့် %s မှာ",past:"လွန်ခဲ့သော %s က",s:"စက္ကန်.အနည်းငယ်",ss:"%d စက္ကန့်",m:"တစ်မိနစ်",mm:"%d မိနစ်",h:"တစ်နာရီ",hh:"%d နာရီ",d:"တစ်ရက်",dd:"%d ရက်",M:"တစ်လ",MM:"%d လ",y:"တစ်နှစ်",yy:"%d နှစ်"},preparse:function(e){return e.replace(/[၁၂၃၄၅၆၇၈၉၀]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/nb.js":function(e,t,n){!function(e){"use strict";e.defineLocale("nb",{months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan._feb._mars_apr._mai_juni_juli_aug._sep._okt._nov._des.".split("_"),monthsParseExact:!0,weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"sø._ma._ti._on._to._fr._lø.".split("_"),weekdaysMin:"sø_ma_ti_on_to_fr_lø".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] HH:mm",LLLL:"dddd D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[i dag kl.] LT",nextDay:"[i morgen kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[i går kl.] LT",lastWeek:"[forrige] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s siden",s:"noen sekunder",ss:"%d sekunder",m:"ett minutt",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dager",w:"en uke",ww:"%d uker",M:"en måned",MM:"%d måneder",y:"ett år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ne.js":function(e,t,n){!function(e){"use strict";var t={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},n={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"};e.defineLocale("ne",{months:"जनवरी_फेब्रुवरी_मार्च_अप्रिल_मई_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर".split("_"),monthsShort:"जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.".split("_"),monthsParseExact:!0,weekdays:"आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार".split("_"),weekdaysShort:"आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.".split("_"),weekdaysMin:"आ._सो._मं._बु._बि._शु._श.".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"Aको h:mm बजे",LTS:"Aको h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, Aको h:mm बजे",LLLL:"dddd, D MMMM YYYY, Aको h:mm बजे"},preparse:function(e){return e.replace(/[१२३४५६७८९०]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/राति|बिहान|दिउँसो|साँझ/,meridiemHour:function(e,t){return 12===e&&(e=0),"राति"===t?e<4?e:e+12:"बिहान"===t?e:"दिउँसो"===t?e>=10?e:e+12:"साँझ"===t?e+12:void 0},meridiem:function(e,t,n){return e<3?"राति":e<12?"बिहान":e<16?"दिउँसो":e<20?"साँझ":"राति"},calendar:{sameDay:"[आज] LT",nextDay:"[भोलि] LT",nextWeek:"[आउँदो] dddd[,] LT",lastDay:"[हिजो] LT",lastWeek:"[गएको] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%sमा",past:"%s अगाडि",s:"केही क्षण",ss:"%d सेकेण्ड",m:"एक मिनेट",mm:"%d मिनेट",h:"एक घण्टा",hh:"%d घण्टा",d:"एक दिन",dd:"%d दिन",M:"एक महिना",MM:"%d महिना",y:"एक बर्ष",yy:"%d बर्ष"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/nl-be.js":function(e,t,n){!function(e){"use strict";var t="jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_"),n="jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"),o=[/^jan/i,/^feb/i,/^maart|mrt.?$/i,/^apr/i,/^mei$/i,/^jun[i.]?$/i,/^jul[i.]?$/i,/^aug/i,/^sep/i,/^okt/i,/^nov/i,/^dec/i],r=/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i;e.defineLocale("nl-be",{months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december)/i,monthsShortStrictRegex:/^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"zo_ma_di_wo_do_vr_za".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[vandaag om] LT",nextDay:"[morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",ss:"%d seconden",m:"één minuut",mm:"%d minuten",h:"één uur",hh:"%d uur",d:"één dag",dd:"%d dagen",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaar"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/nl.js":function(e,t,n){!function(e){"use strict";var t="jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_"),n="jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"),o=[/^jan/i,/^feb/i,/^maart|mrt.?$/i,/^apr/i,/^mei$/i,/^jun[i.]?$/i,/^jul[i.]?$/i,/^aug/i,/^sep/i,/^okt/i,/^nov/i,/^dec/i],r=/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i;e.defineLocale("nl",{months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december)/i,monthsShortStrictRegex:/^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"zo_ma_di_wo_do_vr_za".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[vandaag om] LT",nextDay:"[morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",ss:"%d seconden",m:"één minuut",mm:"%d minuten",h:"één uur",hh:"%d uur",d:"één dag",dd:"%d dagen",w:"één week",ww:"%d weken",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaar"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/nn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("nn",{months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan._feb._mars_apr._mai_juni_juli_aug._sep._okt._nov._des.".split("_"),monthsParseExact:!0,weekdays:"sundag_måndag_tysdag_onsdag_torsdag_fredag_laurdag".split("_"),weekdaysShort:"su._må._ty._on._to._fr._lau.".split("_"),weekdaysMin:"su_må_ty_on_to_fr_la".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[I dag klokka] LT",nextDay:"[I morgon klokka] LT",nextWeek:"dddd [klokka] LT",lastDay:"[I går klokka] LT",lastWeek:"[Føregåande] dddd [klokka] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s sidan",s:"nokre sekund",ss:"%d sekund",m:"eit minutt",mm:"%d minutt",h:"ein time",hh:"%d timar",d:"ein dag",dd:"%d dagar",w:"ei veke",ww:"%d veker",M:"ein månad",MM:"%d månader",y:"eit år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/oc-lnc.js":function(e,t,n){!function(e){"use strict";e.defineLocale("oc-lnc",{months:{standalone:"genièr_febrièr_març_abril_mai_junh_julhet_agost_setembre_octòbre_novembre_decembre".split("_"),format:"de genièr_de febrièr_de març_d'abril_de mai_de junh_de julhet_d'agost_de setembre_d'octòbre_de novembre_de decembre".split("_"),isFormat:/D[oD]?(\s)+MMMM/},monthsShort:"gen._febr._març_abr._mai_junh_julh._ago._set._oct._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"dimenge_diluns_dimars_dimècres_dijòus_divendres_dissabte".split("_"),weekdaysShort:"dg._dl._dm._dc._dj._dv._ds.".split("_"),weekdaysMin:"dg_dl_dm_dc_dj_dv_ds".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [de] YYYY",ll:"D MMM YYYY",LLL:"D MMMM [de] YYYY [a] H:mm",lll:"D MMM YYYY, H:mm",LLLL:"dddd D MMMM [de] YYYY [a] H:mm",llll:"ddd D MMM YYYY, H:mm"},calendar:{sameDay:"[uèi a] LT",nextDay:"[deman a] LT",nextWeek:"dddd [a] LT",lastDay:"[ièr a] LT",lastWeek:"dddd [passat a] LT",sameElse:"L"},relativeTime:{future:"d'aquí %s",past:"fa %s",s:"unas segondas",ss:"%d segondas",m:"una minuta",mm:"%d minutas",h:"una ora",hh:"%d oras",d:"un jorn",dd:"%d jorns",M:"un mes",MM:"%d meses",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(r|n|t|è|a)/,ordinal:function(e,t){var n=1===e?"r":2===e?"n":3===e?"r":4===e?"t":"è";return"w"!==t&&"W"!==t||(n="a"),e+n},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/pa-in.js":function(e,t,n){!function(e){"use strict";var t={1:"੧",2:"੨",3:"੩",4:"੪",5:"੫",6:"੬",7:"੭",8:"੮",9:"੯",0:"੦"},n={"੧":"1","੨":"2","੩":"3","੪":"4","੫":"5","੬":"6","੭":"7","੮":"8","੯":"9","੦":"0"};e.defineLocale("pa-in",{months:"ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ".split("_"),monthsShort:"ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ".split("_"),weekdays:"ਐਤਵਾਰ_ਸੋਮਵਾਰ_ਮੰਗਲਵਾਰ_ਬੁਧਵਾਰ_ਵੀਰਵਾਰ_ਸ਼ੁੱਕਰਵਾਰ_ਸ਼ਨੀਚਰਵਾਰ".split("_"),weekdaysShort:"ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ".split("_"),weekdaysMin:"ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ".split("_"),longDateFormat:{LT:"A h:mm ਵਜੇ",LTS:"A h:mm:ss ਵਜੇ",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm ਵਜੇ",LLLL:"dddd, D MMMM YYYY, A h:mm ਵਜੇ"},calendar:{sameDay:"[ਅਜ] LT",nextDay:"[ਕਲ] LT",nextWeek:"[ਅਗਲਾ] dddd, LT",lastDay:"[ਕਲ] LT",lastWeek:"[ਪਿਛਲੇ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ਵਿੱਚ",past:"%s ਪਿਛਲੇ",s:"ਕੁਝ ਸਕਿੰਟ",ss:"%d ਸਕਿੰਟ",m:"ਇਕ ਮਿੰਟ",mm:"%d ਮਿੰਟ",h:"ਇੱਕ ਘੰਟਾ",hh:"%d ਘੰਟੇ",d:"ਇੱਕ ਦਿਨ",dd:"%d ਦਿਨ",M:"ਇੱਕ ਮਹੀਨਾ",MM:"%d ਮਹੀਨੇ",y:"ਇੱਕ ਸਾਲ",yy:"%d ਸਾਲ"},preparse:function(e){return e.replace(/[੧੨੩੪੫੬੭੮੯੦]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/ਰਾਤ|ਸਵੇਰ|ਦੁਪਹਿਰ|ਸ਼ਾਮ/,meridiemHour:function(e,t){return 12===e&&(e=0),"ਰਾਤ"===t?e<4?e:e+12:"ਸਵੇਰ"===t?e:"ਦੁਪਹਿਰ"===t?e>=10?e:e+12:"ਸ਼ਾਮ"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"ਰਾਤ":e<10?"ਸਵੇਰ":e<17?"ਦੁਪਹਿਰ":e<20?"ਸ਼ਾਮ":"ਰਾਤ"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/pl.js":function(e,t,n){!function(e){"use strict";var t="styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień".split("_"),n="stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia".split("_"),o=[/^sty/i,/^lut/i,/^mar/i,/^kwi/i,/^maj/i,/^cze/i,/^lip/i,/^sie/i,/^wrz/i,/^paź/i,/^lis/i,/^gru/i];function r(e){return e%10<5&&e%10>1&&~~(e/10)%10!=1}function s(e,t,n){var o=e+" ";switch(n){case"ss":return o+(r(e)?"sekundy":"sekund");case"m":return t?"minuta":"minutę";case"mm":return o+(r(e)?"minuty":"minut");case"h":return t?"godzina":"godzinę";case"hh":return o+(r(e)?"godziny":"godzin");case"ww":return o+(r(e)?"tygodnie":"tygodni");case"MM":return o+(r(e)?"miesiące":"miesięcy");case"yy":return o+(r(e)?"lata":"lat")}}e.defineLocale("pl",{months:function(e,o){return e?/D MMMM/.test(o)?n[e.month()]:t[e.month()]:t},monthsShort:"sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru".split("_"),monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota".split("_"),weekdaysShort:"ndz_pon_wt_śr_czw_pt_sob".split("_"),weekdaysMin:"Nd_Pn_Wt_Śr_Cz_Pt_So".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Dziś o] LT",nextDay:"[Jutro o] LT",nextWeek:function(){switch(this.day()){case 0:return"[W niedzielę o] LT";case 2:return"[We wtorek o] LT";case 3:return"[W środę o] LT";case 6:return"[W sobotę o] LT";default:return"[W] dddd [o] LT"}},lastDay:"[Wczoraj o] LT",lastWeek:function(){switch(this.day()){case 0:return"[W zeszłą niedzielę o] LT";case 3:return"[W zeszłą środę o] LT";case 6:return"[W zeszłą sobotę o] LT";default:return"[W zeszły] dddd [o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"%s temu",s:"kilka sekund",ss:s,m:s,mm:s,h:s,hh:s,d:"1 dzień",dd:"%d dni",w:"tydzień",ww:s,M:"miesiąc",MM:s,y:"rok",yy:s},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/pt-br.js":function(e,t,n){!function(e){"use strict";e.defineLocale("pt-br",{months:"janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),weekdays:"domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado".split("_"),weekdaysShort:"dom_seg_ter_qua_qui_sex_sáb".split("_"),weekdaysMin:"do_2ª_3ª_4ª_5ª_6ª_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY [às] HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY [às] HH:mm"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"há %s",s:"poucos segundos",ss:"%d segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",invalidDate:"Data inválida"})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/pt.js":function(e,t,n){!function(e){"use strict";e.defineLocale("pt",{months:"janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),weekdays:"Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado".split("_"),weekdaysShort:"Dom_Seg_Ter_Qua_Qui_Sex_Sáb".split("_"),weekdaysMin:"Do_2ª_3ª_4ª_5ª_6ª_Sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY HH:mm"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"há %s",s:"segundos",ss:"%d segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",w:"uma semana",ww:"%d semanas",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ro.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){var o=" ";return(e%100>=20||e>=100&&e%100==0)&&(o=" de "),e+o+{ss:"secunde",mm:"minute",hh:"ore",dd:"zile",ww:"săptămâni",MM:"luni",yy:"ani"}[n]}e.defineLocale("ro",{months:"ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie".split("_"),monthsShort:"ian._feb._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"duminică_luni_marți_miercuri_joi_vineri_sâmbătă".split("_"),weekdaysShort:"Dum_Lun_Mar_Mie_Joi_Vin_Sâm".split("_"),weekdaysMin:"Du_Lu_Ma_Mi_Jo_Vi_Sâ".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[azi la] LT",nextDay:"[mâine la] LT",nextWeek:"dddd [la] LT",lastDay:"[ieri la] LT",lastWeek:"[fosta] dddd [la] LT",sameElse:"L"},relativeTime:{future:"peste %s",past:"%s în urmă",s:"câteva secunde",ss:t,m:"un minut",mm:t,h:"o oră",hh:t,d:"o zi",dd:t,w:"o săptămână",ww:t,M:"o lună",MM:t,y:"un an",yy:t},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ru.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){return"m"===n?t?"минута":"минуту":e+" "+(o=+e,r={ss:t?"секунда_секунды_секунд":"секунду_секунды_секунд",mm:t?"минута_минуты_минут":"минуту_минуты_минут",hh:"час_часа_часов",dd:"день_дня_дней",ww:"неделя_недели_недель",MM:"месяц_месяца_месяцев",yy:"год_года_лет"}[n].split("_"),o%10==1&&o%100!=11?r[0]:o%10>=2&&o%10<=4&&(o%100<10||o%100>=20)?r[1]:r[2]);var o,r}var n=[/^янв/i,/^фев/i,/^мар/i,/^апр/i,/^ма[йя]/i,/^июн/i,/^июл/i,/^авг/i,/^сен/i,/^окт/i,/^ноя/i,/^дек/i];e.defineLocale("ru",{months:{format:"января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря".split("_"),standalone:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_")},monthsShort:{format:"янв._февр._мар._апр._мая_июня_июля_авг._сент._окт._нояб._дек.".split("_"),standalone:"янв._февр._март_апр._май_июнь_июль_авг._сент._окт._нояб._дек.".split("_")},weekdays:{standalone:"воскресенье_понедельник_вторник_среда_четверг_пятница_суббота".split("_"),format:"воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу".split("_"),isFormat:/\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?] ?dddd/},weekdaysShort:"вс_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"вс_пн_вт_ср_чт_пт_сб".split("_"),monthsParse:n,longMonthsParse:n,shortMonthsParse:n,monthsRegex:/^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,monthsShortRegex:/^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,monthsStrictRegex:/^(январ[яь]|феврал[яь]|марта?|апрел[яь]|ма[яй]|июн[яь]|июл[яь]|августа?|сентябр[яь]|октябр[яь]|ноябр[яь]|декабр[яь])/i,monthsShortStrictRegex:/^(янв\.|февр?\.|мар[т.]|апр\.|ма[яй]|июн[ья.]|июл[ья.]|авг\.|сент?\.|окт\.|нояб?\.|дек\.)/i,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., H:mm",LLLL:"dddd, D MMMM YYYY г., H:mm"},calendar:{sameDay:"[Сегодня, в] LT",nextDay:"[Завтра, в] LT",lastDay:"[Вчера, в] LT",nextWeek:function(e){if(e.week()===this.week())return 2===this.day()?"[Во] dddd, [в] LT":"[В] dddd, [в] LT";switch(this.day()){case 0:return"[В следующее] dddd, [в] LT";case 1:case 2:case 4:return"[В следующий] dddd, [в] LT";case 3:case 5:case 6:return"[В следующую] dddd, [в] LT"}},lastWeek:function(e){if(e.week()===this.week())return 2===this.day()?"[Во] dddd, [в] LT":"[В] dddd, [в] LT";switch(this.day()){case 0:return"[В прошлое] dddd, [в] LT";case 1:case 2:case 4:return"[В прошлый] dddd, [в] LT";case 3:case 5:case 6:return"[В прошлую] dddd, [в] LT"}},sameElse:"L"},relativeTime:{future:"через %s",past:"%s назад",s:"несколько секунд",ss:t,m:t,mm:t,h:"час",hh:t,d:"день",dd:t,w:"неделя",ww:t,M:"месяц",MM:t,y:"год",yy:t},meridiemParse:/ночи|утра|дня|вечера/i,isPM:function(e){return/^(дня|вечера)$/.test(e)},meridiem:function(e,t,n){return e<4?"ночи":e<12?"утра":e<17?"дня":"вечера"},dayOfMonthOrdinalParse:/\d{1,2}-(й|го|я)/,ordinal:function(e,t){switch(t){case"M":case"d":case"DDD":return e+"-й";case"D":return e+"-го";case"w":case"W":return e+"-я";default:return e}},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sd.js":function(e,t,n){!function(e){"use strict";var t=["جنوري","فيبروري","مارچ","اپريل","مئي","جون","جولاءِ","آگسٽ","سيپٽمبر","آڪٽوبر","نومبر","ڊسمبر"],n=["آچر","سومر","اڱارو","اربع","خميس","جمع","ڇنڇر"];e.defineLocale("sd",{months:t,monthsShort:t,weekdays:n,weekdaysShort:n,weekdaysMin:n,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd، D MMMM YYYY HH:mm"},meridiemParse:/صبح|شام/,isPM:function(e){return"شام"===e},meridiem:function(e,t,n){return e<12?"صبح":"شام"},calendar:{sameDay:"[اڄ] LT",nextDay:"[سڀاڻي] LT",nextWeek:"dddd [اڳين هفتي تي] LT",lastDay:"[ڪالهه] LT",lastWeek:"[گزريل هفتي] dddd [تي] LT",sameElse:"L"},relativeTime:{future:"%s پوء",past:"%s اڳ",s:"چند سيڪنڊ",ss:"%d سيڪنڊ",m:"هڪ منٽ",mm:"%d منٽ",h:"هڪ ڪلاڪ",hh:"%d ڪلاڪ",d:"هڪ ڏينهن",dd:"%d ڏينهن",M:"هڪ مهينو",MM:"%d مهينا",y:"هڪ سال",yy:"%d سال"},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/se.js":function(e,t,n){!function(e){"use strict";e.defineLocale("se",{months:"ođđajagemánnu_guovvamánnu_njukčamánnu_cuoŋománnu_miessemánnu_geassemánnu_suoidnemánnu_borgemánnu_čakčamánnu_golggotmánnu_skábmamánnu_juovlamánnu".split("_"),monthsShort:"ođđj_guov_njuk_cuo_mies_geas_suoi_borg_čakč_golg_skáb_juov".split("_"),weekdays:"sotnabeaivi_vuossárga_maŋŋebárga_gaskavahkku_duorastat_bearjadat_lávvardat".split("_"),weekdaysShort:"sotn_vuos_maŋ_gask_duor_bear_láv".split("_"),weekdaysMin:"s_v_m_g_d_b_L".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"MMMM D. [b.] YYYY",LLL:"MMMM D. [b.] YYYY [ti.] HH:mm",LLLL:"dddd, MMMM D. [b.] YYYY [ti.] HH:mm"},calendar:{sameDay:"[otne ti] LT",nextDay:"[ihttin ti] LT",nextWeek:"dddd [ti] LT",lastDay:"[ikte ti] LT",lastWeek:"[ovddit] dddd [ti] LT",sameElse:"L"},relativeTime:{future:"%s geažes",past:"maŋit %s",s:"moadde sekunddat",ss:"%d sekunddat",m:"okta minuhta",mm:"%d minuhtat",h:"okta diimmu",hh:"%d diimmut",d:"okta beaivi",dd:"%d beaivvit",M:"okta mánnu",MM:"%d mánut",y:"okta jahki",yy:"%d jagit"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/si.js":function(e,t,n){!function(e){"use strict";e.defineLocale("si",{months:"ජනවාරි_පෙබරවාරි_මාර්තු_අප්‍රේල්_මැයි_ජූනි_ජූලි_අගෝස්තු_සැප්තැම්බර්_ඔක්තෝබර්_නොවැම්බර්_දෙසැම්බර්".split("_"),monthsShort:"ජන_පෙබ_මාර්_අප්_මැයි_ජූනි_ජූලි_අගෝ_සැප්_ඔක්_නොවැ_දෙසැ".split("_"),weekdays:"ඉරිදා_සඳුදා_අඟහරුවාදා_බදාදා_බ්‍රහස්පතින්දා_සිකුරාදා_සෙනසුරාදා".split("_"),weekdaysShort:"ඉරි_සඳු_අඟ_බදා_බ්‍රහ_සිකු_සෙන".split("_"),weekdaysMin:"ඉ_ස_අ_බ_බ්‍ර_සි_සෙ".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"a h:mm",LTS:"a h:mm:ss",L:"YYYY/MM/DD",LL:"YYYY MMMM D",LLL:"YYYY MMMM D, a h:mm",LLLL:"YYYY MMMM D [වැනි] dddd, a h:mm:ss"},calendar:{sameDay:"[අද] LT[ට]",nextDay:"[හෙට] LT[ට]",nextWeek:"dddd LT[ට]",lastDay:"[ඊයේ] LT[ට]",lastWeek:"[පසුගිය] dddd LT[ට]",sameElse:"L"},relativeTime:{future:"%sකින්",past:"%sකට පෙර",s:"තත්පර කිහිපය",ss:"තත්පර %d",m:"මිනිත්තුව",mm:"මිනිත්තු %d",h:"පැය",hh:"පැය %d",d:"දිනය",dd:"දින %d",M:"මාසය",MM:"මාස %d",y:"වසර",yy:"වසර %d"},dayOfMonthOrdinalParse:/\d{1,2} වැනි/,ordinal:function(e){return e+" වැනි"},meridiemParse:/පෙර වරු|පස් වරු|පෙ.ව|ප.ව./,isPM:function(e){return"ප.ව."===e||"පස් වරු"===e},meridiem:function(e,t,n){return e>11?n?"ප.ව.":"පස් වරු":n?"පෙ.ව.":"පෙර වරු"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sk.js":function(e,t,n){!function(e){"use strict";var t="január_február_marec_apríl_máj_jún_júl_august_september_október_november_december".split("_"),n="jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec".split("_");function o(e){return e>1&&e<5}function r(e,t,n,r){var s=e+" ";switch(n){case"s":return t||r?"pár sekúnd":"pár sekundami";case"ss":return t||r?s+(o(e)?"sekundy":"sekúnd"):s+"sekundami";case"m":return t?"minúta":r?"minútu":"minútou";case"mm":return t||r?s+(o(e)?"minúty":"minút"):s+"minútami";case"h":return t?"hodina":r?"hodinu":"hodinou";case"hh":return t||r?s+(o(e)?"hodiny":"hodín"):s+"hodinami";case"d":return t||r?"deň":"dňom";case"dd":return t||r?s+(o(e)?"dni":"dní"):s+"dňami";case"M":return t||r?"mesiac":"mesiacom";case"MM":return t||r?s+(o(e)?"mesiace":"mesiacov"):s+"mesiacmi";case"y":return t||r?"rok":"rokom";case"yy":return t||r?s+(o(e)?"roky":"rokov"):s+"rokmi"}}e.defineLocale("sk",{months:t,monthsShort:n,weekdays:"nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota".split("_"),weekdaysShort:"ne_po_ut_st_št_pi_so".split("_"),weekdaysMin:"ne_po_ut_st_št_pi_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm"},calendar:{sameDay:"[dnes o] LT",nextDay:"[zajtra o] LT",nextWeek:function(){switch(this.day()){case 0:return"[v nedeľu o] LT";case 1:case 2:return"[v] dddd [o] LT";case 3:return"[v stredu o] LT";case 4:return"[vo štvrtok o] LT";case 5:return"[v piatok o] LT";case 6:return"[v sobotu o] LT"}},lastDay:"[včera o] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulú nedeľu o] LT";case 1:case 2:return"[minulý] dddd [o] LT";case 3:return"[minulú stredu o] LT";case 4:case 5:return"[minulý] dddd [o] LT";case 6:return"[minulú sobotu o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"pred %s",s:r,ss:r,m:r,mm:r,h:r,hh:r,d:r,dd:r,M:r,MM:r,y:r,yy:r},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sl.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r=e+" ";switch(n){case"s":return t||o?"nekaj sekund":"nekaj sekundami";case"ss":return r+(1===e?t?"sekundo":"sekundi":2===e?t||o?"sekundi":"sekundah":e<5?t||o?"sekunde":"sekundah":"sekund");case"m":return t?"ena minuta":"eno minuto";case"mm":return r+(1===e?t?"minuta":"minuto":2===e?t||o?"minuti":"minutama":e<5?t||o?"minute":"minutami":t||o?"minut":"minutami");case"h":return t?"ena ura":"eno uro";case"hh":return r+(1===e?t?"ura":"uro":2===e?t||o?"uri":"urama":e<5?t||o?"ure":"urami":t||o?"ur":"urami");case"d":return t||o?"en dan":"enim dnem";case"dd":return r+(1===e?t||o?"dan":"dnem":2===e?t||o?"dni":"dnevoma":t||o?"dni":"dnevi");case"M":return t||o?"en mesec":"enim mesecem";case"MM":return r+(1===e?t||o?"mesec":"mesecem":2===e?t||o?"meseca":"mesecema":e<5?t||o?"mesece":"meseci":t||o?"mesecev":"meseci");case"y":return t||o?"eno leto":"enim letom";case"yy":return r+(1===e?t||o?"leto":"letom":2===e?t||o?"leti":"letoma":e<5?t||o?"leta":"leti":t||o?"let":"leti")}}e.defineLocale("sl",{months:"januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota".split("_"),weekdaysShort:"ned._pon._tor._sre._čet._pet._sob.".split("_"),weekdaysMin:"ne_po_to_sr_če_pe_so".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danes ob] LT",nextDay:"[jutri ob] LT",nextWeek:function(){switch(this.day()){case 0:return"[v] [nedeljo] [ob] LT";case 3:return"[v] [sredo] [ob] LT";case 6:return"[v] [soboto] [ob] LT";case 1:case 2:case 4:case 5:return"[v] dddd [ob] LT"}},lastDay:"[včeraj ob] LT",lastWeek:function(){switch(this.day()){case 0:return"[prejšnjo] [nedeljo] [ob] LT";case 3:return"[prejšnjo] [sredo] [ob] LT";case 6:return"[prejšnjo] [soboto] [ob] LT";case 1:case 2:case 4:case 5:return"[prejšnji] dddd [ob] LT"}},sameElse:"L"},relativeTime:{future:"čez %s",past:"pred %s",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sq.js":function(e,t,n){!function(e){"use strict";e.defineLocale("sq",{months:"Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_Nëntor_Dhjetor".split("_"),monthsShort:"Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_Nën_Dhj".split("_"),weekdays:"E Diel_E Hënë_E Martë_E Mërkurë_E Enjte_E Premte_E Shtunë".split("_"),weekdaysShort:"Die_Hën_Mar_Mër_Enj_Pre_Sht".split("_"),weekdaysMin:"D_H_Ma_Më_E_P_Sh".split("_"),weekdaysParseExact:!0,meridiemParse:/PD|MD/,isPM:function(e){return"M"===e.charAt(0)},meridiem:function(e,t,n){return e<12?"PD":"MD"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Sot në] LT",nextDay:"[Nesër në] LT",nextWeek:"dddd [në] LT",lastDay:"[Dje në] LT",lastWeek:"dddd [e kaluar në] LT",sameElse:"L"},relativeTime:{future:"në %s",past:"%s më parë",s:"disa sekonda",ss:"%d sekonda",m:"një minutë",mm:"%d minuta",h:"një orë",hh:"%d orë",d:"një ditë",dd:"%d ditë",M:"një muaj",MM:"%d muaj",y:"një vit",yy:"%d vite"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sr-cyrl.js":function(e,t,n){!function(e){"use strict";var t={words:{ss:["секунда","секунде","секунди"],m:["један минут","једне минуте"],mm:["минут","минуте","минута"],h:["један сат","једног сата"],hh:["сат","сата","сати"],dd:["дан","дана","дана"],MM:["месец","месеца","месеци"],yy:["година","године","година"]},correctGrammaticalCase:function(e,t){return 1===e?t[0]:e>=2&&e<=4?t[1]:t[2]},translate:function(e,n,o){var r=t.words[o];return 1===o.length?n?r[0]:r[1]:e+" "+t.correctGrammaticalCase(e,r)}};e.defineLocale("sr-cyrl",{months:"јануар_фебруар_март_април_мај_јун_јул_август_септембар_октобар_новембар_децембар".split("_"),monthsShort:"јан._феб._мар._апр._мај_јун_јул_авг._сеп._окт._нов._дец.".split("_"),monthsParseExact:!0,weekdays:"недеља_понедељак_уторак_среда_четвртак_петак_субота".split("_"),weekdaysShort:"нед._пон._уто._сре._чет._пет._суб.".split("_"),weekdaysMin:"не_по_ут_ср_че_пе_су".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D. M. YYYY.",LL:"D. MMMM YYYY.",LLL:"D. MMMM YYYY. H:mm",LLLL:"dddd, D. MMMM YYYY. H:mm"},calendar:{sameDay:"[данас у] LT",nextDay:"[сутра у] LT",nextWeek:function(){switch(this.day()){case 0:return"[у] [недељу] [у] LT";case 3:return"[у] [среду] [у] LT";case 6:return"[у] [суботу] [у] LT";case 1:case 2:case 4:case 5:return"[у] dddd [у] LT"}},lastDay:"[јуче у] LT",lastWeek:function(){return["[прошле] [недеље] [у] LT","[прошлог] [понедељка] [у] LT","[прошлог] [уторка] [у] LT","[прошле] [среде] [у] LT","[прошлог] [четвртка] [у] LT","[прошлог] [петка] [у] LT","[прошле] [суботе] [у] LT"][this.day()]},sameElse:"L"},relativeTime:{future:"за %s",past:"пре %s",s:"неколико секунди",ss:t.translate,m:t.translate,mm:t.translate,h:t.translate,hh:t.translate,d:"дан",dd:t.translate,M:"месец",MM:t.translate,y:"годину",yy:t.translate},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sr.js":function(e,t,n){!function(e){"use strict";var t={words:{ss:["sekunda","sekunde","sekundi"],m:["jedan minut","jedne minute"],mm:["minut","minute","minuta"],h:["jedan sat","jednog sata"],hh:["sat","sata","sati"],dd:["dan","dana","dana"],MM:["mesec","meseca","meseci"],yy:["godina","godine","godina"]},correctGrammaticalCase:function(e,t){return 1===e?t[0]:e>=2&&e<=4?t[1]:t[2]},translate:function(e,n,o){var r=t.words[o];return 1===o.length?n?r[0]:r[1]:e+" "+t.correctGrammaticalCase(e,r)}};e.defineLocale("sr",{months:"januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedelja_ponedeljak_utorak_sreda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sre._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D. M. YYYY.",LL:"D. MMMM YYYY.",LLL:"D. MMMM YYYY. H:mm",LLLL:"dddd, D. MMMM YYYY. H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedelju] [u] LT";case 3:return"[u] [sredu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[juče u] LT",lastWeek:function(){return["[prošle] [nedelje] [u] LT","[prošlog] [ponedeljka] [u] LT","[prošlog] [utorka] [u] LT","[prošle] [srede] [u] LT","[prošlog] [četvrtka] [u] LT","[prošlog] [petka] [u] LT","[prošle] [subote] [u] LT"][this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"pre %s",s:"nekoliko sekundi",ss:t.translate,m:t.translate,mm:t.translate,h:t.translate,hh:t.translate,d:"dan",dd:t.translate,M:"mesec",MM:t.translate,y:"godinu",yy:t.translate},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ss.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ss",{months:"Bhimbidvwane_Indlovana_Indlov'lenkhulu_Mabasa_Inkhwekhweti_Inhlaba_Kholwane_Ingci_Inyoni_Imphala_Lweti_Ingongoni".split("_"),monthsShort:"Bhi_Ina_Inu_Mab_Ink_Inh_Kho_Igc_Iny_Imp_Lwe_Igo".split("_"),weekdays:"Lisontfo_Umsombuluko_Lesibili_Lesitsatfu_Lesine_Lesihlanu_Umgcibelo".split("_"),weekdaysShort:"Lis_Umb_Lsb_Les_Lsi_Lsh_Umg".split("_"),weekdaysMin:"Li_Us_Lb_Lt_Ls_Lh_Ug".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Namuhla nga] LT",nextDay:"[Kusasa nga] LT",nextWeek:"dddd [nga] LT",lastDay:"[Itolo nga] LT",lastWeek:"dddd [leliphelile] [nga] LT",sameElse:"L"},relativeTime:{future:"nga %s",past:"wenteka nga %s",s:"emizuzwana lomcane",ss:"%d mzuzwana",m:"umzuzu",mm:"%d emizuzu",h:"lihora",hh:"%d emahora",d:"lilanga",dd:"%d emalanga",M:"inyanga",MM:"%d tinyanga",y:"umnyaka",yy:"%d iminyaka"},meridiemParse:/ekuseni|emini|entsambama|ebusuku/,meridiem:function(e,t,n){return e<11?"ekuseni":e<15?"emini":e<19?"entsambama":"ebusuku"},meridiemHour:function(e,t){return 12===e&&(e=0),"ekuseni"===t?e:"emini"===t?e>=11?e:e+12:"entsambama"===t||"ebusuku"===t?0===e?0:e+12:void 0},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:"%d",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sv.js":function(e,t,n){!function(e){"use strict";e.defineLocale("sv",{months:"januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag".split("_"),weekdaysShort:"sön_mån_tis_ons_tor_fre_lör".split("_"),weekdaysMin:"sö_må_ti_on_to_fr_lö".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [kl.] HH:mm",LLLL:"dddd D MMMM YYYY [kl.] HH:mm",lll:"D MMM YYYY HH:mm",llll:"ddd D MMM YYYY HH:mm"},calendar:{sameDay:"[Idag] LT",nextDay:"[Imorgon] LT",lastDay:"[Igår] LT",nextWeek:"[På] dddd LT",lastWeek:"[I] dddd[s] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"för %s sedan",s:"några sekunder",ss:"%d sekunder",m:"en minut",mm:"%d minuter",h:"en timme",hh:"%d timmar",d:"en dag",dd:"%d dagar",M:"en månad",MM:"%d månader",y:"ett år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}(\:e|\:a)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?":e":1===t||2===t?":a":":e")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sw.js":function(e,t,n){!function(e){"use strict";e.defineLocale("sw",{months:"Januari_Februari_Machi_Aprili_Mei_Juni_Julai_Agosti_Septemba_Oktoba_Novemba_Desemba".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ago_Sep_Okt_Nov_Des".split("_"),weekdays:"Jumapili_Jumatatu_Jumanne_Jumatano_Alhamisi_Ijumaa_Jumamosi".split("_"),weekdaysShort:"Jpl_Jtat_Jnne_Jtan_Alh_Ijm_Jmos".split("_"),weekdaysMin:"J2_J3_J4_J5_Al_Ij_J1".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"hh:mm A",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[leo saa] LT",nextDay:"[kesho saa] LT",nextWeek:"[wiki ijayo] dddd [saat] LT",lastDay:"[jana] LT",lastWeek:"[wiki iliyopita] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s baadaye",past:"tokea %s",s:"hivi punde",ss:"sekunde %d",m:"dakika moja",mm:"dakika %d",h:"saa limoja",hh:"masaa %d",d:"siku moja",dd:"siku %d",M:"mwezi mmoja",MM:"miezi %d",y:"mwaka mmoja",yy:"miaka %d"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ta.js":function(e,t,n){!function(e){"use strict";var t={1:"௧",2:"௨",3:"௩",4:"௪",5:"௫",6:"௬",7:"௭",8:"௮",9:"௯",0:"௦"},n={"௧":"1","௨":"2","௩":"3","௪":"4","௫":"5","௬":"6","௭":"7","௮":"8","௯":"9","௦":"0"};e.defineLocale("ta",{months:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),monthsShort:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),weekdays:"ஞாயிற்றுக்கிழமை_திங்கட்கிழமை_செவ்வாய்கிழமை_புதன்கிழமை_வியாழக்கிழமை_வெள்ளிக்கிழமை_சனிக்கிழமை".split("_"),weekdaysShort:"ஞாயிறு_திங்கள்_செவ்வாய்_புதன்_வியாழன்_வெள்ளி_சனி".split("_"),weekdaysMin:"ஞா_தி_செ_பு_வி_வெ_ச".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, HH:mm",LLLL:"dddd, D MMMM YYYY, HH:mm"},calendar:{sameDay:"[இன்று] LT",nextDay:"[நாளை] LT",nextWeek:"dddd, LT",lastDay:"[நேற்று] LT",lastWeek:"[கடந்த வாரம்] dddd, LT",sameElse:"L"},relativeTime:{future:"%s இல்",past:"%s முன்",s:"ஒரு சில விநாடிகள்",ss:"%d விநாடிகள்",m:"ஒரு நிமிடம்",mm:"%d நிமிடங்கள்",h:"ஒரு மணி நேரம்",hh:"%d மணி நேரம்",d:"ஒரு நாள்",dd:"%d நாட்கள்",M:"ஒரு மாதம்",MM:"%d மாதங்கள்",y:"ஒரு வருடம்",yy:"%d ஆண்டுகள்"},dayOfMonthOrdinalParse:/\d{1,2}வது/,ordinal:function(e){return e+"வது"},preparse:function(e){return e.replace(/[௧௨௩௪௫௬௭௮௯௦]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/யாமம்|வைகறை|காலை|நண்பகல்|எற்பாடு|மாலை/,meridiem:function(e,t,n){return e<2?" யாமம்":e<6?" வைகறை":e<10?" காலை":e<14?" நண்பகல்":e<18?" எற்பாடு":e<22?" மாலை":" யாமம்"},meridiemHour:function(e,t){return 12===e&&(e=0),"யாமம்"===t?e<2?e:e+12:"வைகறை"===t||"காலை"===t||"நண்பகல்"===t&&e>=10?e:e+12},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/te.js":function(e,t,n){!function(e){"use strict";e.defineLocale("te",{months:"జనవరి_ఫిబ్రవరి_మార్చి_ఏప్రిల్_మే_జూన్_జులై_ఆగస్టు_సెప్టెంబర్_అక్టోబర్_నవంబర్_డిసెంబర్".split("_"),monthsShort:"జన._ఫిబ్ర._మార్చి_ఏప్రి._మే_జూన్_జులై_ఆగ._సెప్._అక్టో._నవ._డిసె.".split("_"),monthsParseExact:!0,weekdays:"ఆదివారం_సోమవారం_మంగళవారం_బుధవారం_గురువారం_శుక్రవారం_శనివారం".split("_"),weekdaysShort:"ఆది_సోమ_మంగళ_బుధ_గురు_శుక్ర_శని".split("_"),weekdaysMin:"ఆ_సో_మం_బు_గు_శు_శ".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[నేడు] LT",nextDay:"[రేపు] LT",nextWeek:"dddd, LT",lastDay:"[నిన్న] LT",lastWeek:"[గత] dddd, LT",sameElse:"L"},relativeTime:{future:"%s లో",past:"%s క్రితం",s:"కొన్ని క్షణాలు",ss:"%d సెకన్లు",m:"ఒక నిమిషం",mm:"%d నిమిషాలు",h:"ఒక గంట",hh:"%d గంటలు",d:"ఒక రోజు",dd:"%d రోజులు",M:"ఒక నెల",MM:"%d నెలలు",y:"ఒక సంవత్సరం",yy:"%d సంవత్సరాలు"},dayOfMonthOrdinalParse:/\d{1,2}వ/,ordinal:"%dవ",meridiemParse:/రాత్రి|ఉదయం|మధ్యాహ్నం|సాయంత్రం/,meridiemHour:function(e,t){return 12===e&&(e=0),"రాత్రి"===t?e<4?e:e+12:"ఉదయం"===t?e:"మధ్యాహ్నం"===t?e>=10?e:e+12:"సాయంత్రం"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"రాత్రి":e<10?"ఉదయం":e<17?"మధ్యాహ్నం":e<20?"సాయంత్రం":"రాత్రి"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tet.js":function(e,t,n){!function(e){"use strict";e.defineLocale("tet",{months:"Janeiru_Fevereiru_Marsu_Abril_Maiu_Juñu_Jullu_Agustu_Setembru_Outubru_Novembru_Dezembru".split("_"),monthsShort:"Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"),weekdays:"Domingu_Segunda_Tersa_Kuarta_Kinta_Sesta_Sabadu".split("_"),weekdaysShort:"Dom_Seg_Ters_Kua_Kint_Sest_Sab".split("_"),weekdaysMin:"Do_Seg_Te_Ku_Ki_Ses_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Ohin iha] LT",nextDay:"[Aban iha] LT",nextWeek:"dddd [iha] LT",lastDay:"[Horiseik iha] LT",lastWeek:"dddd [semana kotuk] [iha] LT",sameElse:"L"},relativeTime:{future:"iha %s",past:"%s liuba",s:"segundu balun",ss:"segundu %d",m:"minutu ida",mm:"minutu %d",h:"oras ida",hh:"oras %d",d:"loron ida",dd:"loron %d",M:"fulan ida",MM:"fulan %d",y:"tinan ida",yy:"tinan %d"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tg.js":function(e,t,n){!function(e){"use strict";var t={0:"-ум",1:"-ум",2:"-юм",3:"-юм",4:"-ум",5:"-ум",6:"-ум",7:"-ум",8:"-ум",9:"-ум",10:"-ум",12:"-ум",13:"-ум",20:"-ум",30:"-юм",40:"-ум",50:"-ум",60:"-ум",70:"-ум",80:"-ум",90:"-ум",100:"-ум"};e.defineLocale("tg",{months:{format:"январи_феврали_марти_апрели_майи_июни_июли_августи_сентябри_октябри_ноябри_декабри".split("_"),standalone:"январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр".split("_")},monthsShort:"янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"),weekdays:"якшанбе_душанбе_сешанбе_чоршанбе_панҷшанбе_ҷумъа_шанбе".split("_"),weekdaysShort:"яшб_дшб_сшб_чшб_пшб_ҷум_шнб".split("_"),weekdaysMin:"яш_дш_сш_чш_пш_ҷм_шб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Имрӯз соати] LT",nextDay:"[Фардо соати] LT",lastDay:"[Дирӯз соати] LT",nextWeek:"dddd[и] [ҳафтаи оянда соати] LT",lastWeek:"dddd[и] [ҳафтаи гузашта соати] LT",sameElse:"L"},relativeTime:{future:"баъди %s",past:"%s пеш",s:"якчанд сония",m:"як дақиқа",mm:"%d дақиқа",h:"як соат",hh:"%d соат",d:"як рӯз",dd:"%d рӯз",M:"як моҳ",MM:"%d моҳ",y:"як сол",yy:"%d сол"},meridiemParse:/шаб|субҳ|рӯз|бегоҳ/,meridiemHour:function(e,t){return 12===e&&(e=0),"шаб"===t?e<4?e:e+12:"субҳ"===t?e:"рӯз"===t?e>=11?e:e+12:"бегоҳ"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"шаб":e<11?"субҳ":e<16?"рӯз":e<19?"бегоҳ":"шаб"},dayOfMonthOrdinalParse:/\d{1,2}-(ум|юм)/,ordinal:function(e){return e+(t[e]||t[e%10]||t[e>=100?100:null])},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/th.js":function(e,t,n){!function(e){"use strict";e.defineLocale("th",{months:"มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม".split("_"),monthsShort:"ม.ค._ก.พ._มี.ค._เม.ย._พ.ค._มิ.ย._ก.ค._ส.ค._ก.ย._ต.ค._พ.ย._ธ.ค.".split("_"),monthsParseExact:!0,weekdays:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์".split("_"),weekdaysShort:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัส_ศุกร์_เสาร์".split("_"),weekdaysMin:"อา._จ._อ._พ._พฤ._ศ._ส.".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY เวลา H:mm",LLLL:"วันddddที่ D MMMM YYYY เวลา H:mm"},meridiemParse:/ก่อนเที่ยง|หลังเที่ยง/,isPM:function(e){return"หลังเที่ยง"===e},meridiem:function(e,t,n){return e<12?"ก่อนเที่ยง":"หลังเที่ยง"},calendar:{sameDay:"[วันนี้ เวลา] LT",nextDay:"[พรุ่งนี้ เวลา] LT",nextWeek:"dddd[หน้า เวลา] LT",lastDay:"[เมื่อวานนี้ เวลา] LT",lastWeek:"[วัน]dddd[ที่แล้ว เวลา] LT",sameElse:"L"},relativeTime:{future:"อีก %s",past:"%sที่แล้ว",s:"ไม่กี่วินาที",ss:"%d วินาที",m:"1 นาที",mm:"%d นาที",h:"1 ชั่วโมง",hh:"%d ชั่วโมง",d:"1 วัน",dd:"%d วัน",w:"1 สัปดาห์",ww:"%d สัปดาห์",M:"1 เดือน",MM:"%d เดือน",y:"1 ปี",yy:"%d ปี"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tk.js":function(e,t,n){!function(e){"use strict";var t={1:"'inji",5:"'inji",8:"'inji",70:"'inji",80:"'inji",2:"'nji",7:"'nji",20:"'nji",50:"'nji",3:"'ünji",4:"'ünji",100:"'ünji",6:"'njy",9:"'unjy",10:"'unjy",30:"'unjy",60:"'ynjy",90:"'ynjy"};e.defineLocale("tk",{months:"Ýanwar_Fewral_Mart_Aprel_Maý_Iýun_Iýul_Awgust_Sentýabr_Oktýabr_Noýabr_Dekabr".split("_"),monthsShort:"Ýan_Few_Mar_Apr_Maý_Iýn_Iýl_Awg_Sen_Okt_Noý_Dek".split("_"),weekdays:"Ýekşenbe_Duşenbe_Sişenbe_Çarşenbe_Penşenbe_Anna_Şenbe".split("_"),weekdaysShort:"Ýek_Duş_Siş_Çar_Pen_Ann_Şen".split("_"),weekdaysMin:"Ýk_Dş_Sş_Çr_Pn_An_Şn".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün sagat] LT",nextDay:"[ertir sagat] LT",nextWeek:"[indiki] dddd [sagat] LT",lastDay:"[düýn] LT",lastWeek:"[geçen] dddd [sagat] LT",sameElse:"L"},relativeTime:{future:"%s soň",past:"%s öň",s:"birnäçe sekunt",m:"bir minut",mm:"%d minut",h:"bir sagat",hh:"%d sagat",d:"bir gün",dd:"%d gün",M:"bir aý",MM:"%d aý",y:"bir ýyl",yy:"%d ýyl"},ordinal:function(e,n){switch(n){case"d":case"D":case"Do":case"DD":return e;default:if(0===e)return e+"'unjy";var o=e%10;return e+(t[o]||t[e%100-o]||t[e>=100?100:null])}},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tl-ph.js":function(e,t,n){!function(e){"use strict";e.defineLocale("tl-ph",{months:"Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre".split("_"),monthsShort:"Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis".split("_"),weekdays:"Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado".split("_"),weekdaysShort:"Lin_Lun_Mar_Miy_Huw_Biy_Sab".split("_"),weekdaysMin:"Li_Lu_Ma_Mi_Hu_Bi_Sab".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"MM/D/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY HH:mm",LLLL:"dddd, MMMM DD, YYYY HH:mm"},calendar:{sameDay:"LT [ngayong araw]",nextDay:"[Bukas ng] LT",nextWeek:"LT [sa susunod na] dddd",lastDay:"LT [kahapon]",lastWeek:"LT [noong nakaraang] dddd",sameElse:"L"},relativeTime:{future:"sa loob ng %s",past:"%s ang nakalipas",s:"ilang segundo",ss:"%d segundo",m:"isang minuto",mm:"%d minuto",h:"isang oras",hh:"%d oras",d:"isang araw",dd:"%d araw",M:"isang buwan",MM:"%d buwan",y:"isang taon",yy:"%d taon"},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:function(e){return e},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tlh.js":function(e,t,n){!function(e){"use strict";var t="pagh_wa’_cha’_wej_loS_vagh_jav_Soch_chorgh_Hut".split("_");function n(e,n,o,r){var s=function(e){var n=Math.floor(e%1e3/100),o=Math.floor(e%100/10),r=e%10,s="";return n>0&&(s+=t[n]+"vatlh"),o>0&&(s+=(""!==s?" ":"")+t[o]+"maH"),r>0&&(s+=(""!==s?" ":"")+t[r]),""===s?"pagh":s}(e);switch(o){case"ss":return s+" lup";case"mm":return s+" tup";case"hh":return s+" rep";case"dd":return s+" jaj";case"MM":return s+" jar";case"yy":return s+" DIS"}}e.defineLocale("tlh",{months:"tera’ jar wa’_tera’ jar cha’_tera’ jar wej_tera’ jar loS_tera’ jar vagh_tera’ jar jav_tera’ jar Soch_tera’ jar chorgh_tera’ jar Hut_tera’ jar wa’maH_tera’ jar wa’maH wa’_tera’ jar wa’maH cha’".split("_"),monthsShort:"jar wa’_jar cha’_jar wej_jar loS_jar vagh_jar jav_jar Soch_jar chorgh_jar Hut_jar wa’maH_jar wa’maH wa’_jar wa’maH cha’".split("_"),monthsParseExact:!0,weekdays:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),weekdaysShort:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),weekdaysMin:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[DaHjaj] LT",nextDay:"[wa’leS] LT",nextWeek:"LLL",lastDay:"[wa’Hu’] LT",lastWeek:"LLL",sameElse:"L"},relativeTime:{future:function(e){var t=e;return-1!==e.indexOf("jaj")?t.slice(0,-3)+"leS":-1!==e.indexOf("jar")?t.slice(0,-3)+"waQ":-1!==e.indexOf("DIS")?t.slice(0,-3)+"nem":t+" pIq"},past:function(e){var t=e;return-1!==e.indexOf("jaj")?t.slice(0,-3)+"Hu’":-1!==e.indexOf("jar")?t.slice(0,-3)+"wen":-1!==e.indexOf("DIS")?t.slice(0,-3)+"ben":t+" ret"},s:"puS lup",ss:n,m:"wa’ tup",mm:n,h:"wa’ rep",hh:n,d:"wa’ jaj",dd:n,M:"wa’ jar",MM:n,y:"wa’ DIS",yy:n},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tr.js":function(e,t,n){!function(e){"use strict";var t={1:"'inci",5:"'inci",8:"'inci",70:"'inci",80:"'inci",2:"'nci",7:"'nci",20:"'nci",50:"'nci",3:"'üncü",4:"'üncü",100:"'üncü",6:"'ncı",9:"'uncu",10:"'uncu",30:"'uncu",60:"'ıncı",90:"'ıncı"};e.defineLocale("tr",{months:"Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık".split("_"),monthsShort:"Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara".split("_"),weekdays:"Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi".split("_"),weekdaysShort:"Paz_Pts_Sal_Çar_Per_Cum_Cts".split("_"),weekdaysMin:"Pz_Pt_Sa_Ça_Pe_Cu_Ct".split("_"),meridiem:function(e,t,n){return e<12?n?"öö":"ÖÖ":n?"ös":"ÖS"},meridiemParse:/öö|ÖÖ|ös|ÖS/,isPM:function(e){return"ös"===e||"ÖS"===e},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[yarın saat] LT",nextWeek:"[gelecek] dddd [saat] LT",lastDay:"[dün] LT",lastWeek:"[geçen] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s önce",s:"birkaç saniye",ss:"%d saniye",m:"bir dakika",mm:"%d dakika",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",w:"bir hafta",ww:"%d hafta",M:"bir ay",MM:"%d ay",y:"bir yıl",yy:"%d yıl"},ordinal:function(e,n){switch(n){case"d":case"D":case"Do":case"DD":return e;default:if(0===e)return e+"'ıncı";var o=e%10;return e+(t[o]||t[e%100-o]||t[e>=100?100:null])}},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tzl.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={s:["viensas secunds","'iensas secunds"],ss:[e+" secunds",e+" secunds"],m:["'n míut","'iens míut"],mm:[e+" míuts",e+" míuts"],h:["'n þora","'iensa þora"],hh:[e+" þoras",e+" þoras"],d:["'n ziua","'iensa ziua"],dd:[e+" ziuas",e+" ziuas"],M:["'n mes","'iens mes"],MM:[e+" mesen",e+" mesen"],y:["'n ar","'iens ar"],yy:[e+" ars",e+" ars"]};return o||t?r[n][0]:r[n][1]}e.defineLocale("tzl",{months:"Januar_Fevraglh_Març_Avrïu_Mai_Gün_Julia_Guscht_Setemvar_Listopäts_Noemvar_Zecemvar".split("_"),monthsShort:"Jan_Fev_Mar_Avr_Mai_Gün_Jul_Gus_Set_Lis_Noe_Zec".split("_"),weekdays:"Súladi_Lúneçi_Maitzi_Márcuri_Xhúadi_Viénerçi_Sáturi".split("_"),weekdaysShort:"Súl_Lún_Mai_Már_Xhú_Vié_Sát".split("_"),weekdaysMin:"Sú_Lú_Ma_Má_Xh_Vi_Sá".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"D. MMMM [dallas] YYYY",LLL:"D. MMMM [dallas] YYYY HH.mm",LLLL:"dddd, [li] D. MMMM [dallas] YYYY HH.mm"},meridiemParse:/d\'o|d\'a/i,isPM:function(e){return"d'o"===e.toLowerCase()},meridiem:function(e,t,n){return e>11?n?"d'o":"D'O":n?"d'a":"D'A"},calendar:{sameDay:"[oxhi à] LT",nextDay:"[demà à] LT",nextWeek:"dddd [à] LT",lastDay:"[ieiri à] LT",lastWeek:"[sür el] dddd [lasteu à] LT",sameElse:"L"},relativeTime:{future:"osprei %s",past:"ja%s",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tzm-latn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("tzm-latn",{months:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),monthsShort:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),weekdays:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),weekdaysShort:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),weekdaysMin:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[asdkh g] LT",nextDay:"[aska g] LT",nextWeek:"dddd [g] LT",lastDay:"[assant g] LT",lastWeek:"dddd [g] LT",sameElse:"L"},relativeTime:{future:"dadkh s yan %s",past:"yan %s",s:"imik",ss:"%d imik",m:"minuḍ",mm:"%d minuḍ",h:"saɛa",hh:"%d tassaɛin",d:"ass",dd:"%d ossan",M:"ayowr",MM:"%d iyyirn",y:"asgas",yy:"%d isgasn"},week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tzm.js":function(e,t,n){!function(e){"use strict";e.defineLocale("tzm",{months:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),monthsShort:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),weekdays:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),weekdaysShort:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),weekdaysMin:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[ⴰⵙⴷⵅ ⴴ] LT",nextDay:"[ⴰⵙⴽⴰ ⴴ] LT",nextWeek:"dddd [ⴴ] LT",lastDay:"[ⴰⵚⴰⵏⵜ ⴴ] LT",lastWeek:"dddd [ⴴ] LT",sameElse:"L"},relativeTime:{future:"ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ %s",past:"ⵢⴰⵏ %s",s:"ⵉⵎⵉⴽ",ss:"%d ⵉⵎⵉⴽ",m:"ⵎⵉⵏⵓⴺ",mm:"%d ⵎⵉⵏⵓⴺ",h:"ⵙⴰⵄⴰ",hh:"%d ⵜⴰⵙⵙⴰⵄⵉⵏ",d:"ⴰⵙⵙ",dd:"%d oⵙⵙⴰⵏ",M:"ⴰⵢoⵓⵔ",MM:"%d ⵉⵢⵢⵉⵔⵏ",y:"ⴰⵙⴳⴰⵙ",yy:"%d ⵉⵙⴳⴰⵙⵏ"},week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ug-cn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ug-cn",{months:"يانۋار_فېۋرال_مارت_ئاپرېل_ماي_ئىيۇن_ئىيۇل_ئاۋغۇست_سېنتەبىر_ئۆكتەبىر_نويابىر_دېكابىر".split("_"),monthsShort:"يانۋار_فېۋرال_مارت_ئاپرېل_ماي_ئىيۇن_ئىيۇل_ئاۋغۇست_سېنتەبىر_ئۆكتەبىر_نويابىر_دېكابىر".split("_"),weekdays:"يەكشەنبە_دۈشەنبە_سەيشەنبە_چارشەنبە_پەيشەنبە_جۈمە_شەنبە".split("_"),weekdaysShort:"يە_دۈ_سە_چا_پە_جۈ_شە".split("_"),weekdaysMin:"يە_دۈ_سە_چا_پە_جۈ_شە".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY-يىلىM-ئاينىڭD-كۈنى",LLL:"YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm",LLLL:"dddd، YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm"},meridiemParse:/يېرىم كېچە|سەھەر|چۈشتىن بۇرۇن|چۈش|چۈشتىن كېيىن|كەچ/,meridiemHour:function(e,t){return 12===e&&(e=0),"يېرىم كېچە"===t||"سەھەر"===t||"چۈشتىن بۇرۇن"===t?e:"چۈشتىن كېيىن"===t||"كەچ"===t?e+12:e>=11?e:e+12},meridiem:function(e,t,n){var o=100*e+t;return o<600?"يېرىم كېچە":o<900?"سەھەر":o<1130?"چۈشتىن بۇرۇن":o<1230?"چۈش":o<1800?"چۈشتىن كېيىن":"كەچ"},calendar:{sameDay:"[بۈگۈن سائەت] LT",nextDay:"[ئەتە سائەت] LT",nextWeek:"[كېلەركى] dddd [سائەت] LT",lastDay:"[تۆنۈگۈن] LT",lastWeek:"[ئالدىنقى] dddd [سائەت] LT",sameElse:"L"},relativeTime:{future:"%s كېيىن",past:"%s بۇرۇن",s:"نەچچە سېكونت",ss:"%d سېكونت",m:"بىر مىنۇت",mm:"%d مىنۇت",h:"بىر سائەت",hh:"%d سائەت",d:"بىر كۈن",dd:"%d كۈن",M:"بىر ئاي",MM:"%d ئاي",y:"بىر يىل",yy:"%d يىل"},dayOfMonthOrdinalParse:/\d{1,2}(-كۈنى|-ئاي|-ھەپتە)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"-كۈنى";case"w":case"W":return e+"-ھەپتە";default:return e}},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/uk.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){return"m"===n?t?"хвилина":"хвилину":"h"===n?t?"година":"годину":e+" "+(o=+e,r={ss:t?"секунда_секунди_секунд":"секунду_секунди_секунд",mm:t?"хвилина_хвилини_хвилин":"хвилину_хвилини_хвилин",hh:t?"година_години_годин":"годину_години_годин",dd:"день_дні_днів",MM:"місяць_місяці_місяців",yy:"рік_роки_років"}[n].split("_"),o%10==1&&o%100!=11?r[0]:o%10>=2&&o%10<=4&&(o%100<10||o%100>=20)?r[1]:r[2]);var o,r}function n(e){return function(){return e+"о"+(11===this.hours()?"б":"")+"] LT"}}e.defineLocale("uk",{months:{format:"січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня".split("_"),standalone:"січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень".split("_")},monthsShort:"січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд".split("_"),weekdays:function(e,t){var n={nominative:"неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота".split("_"),accusative:"неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу".split("_"),genitive:"неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи".split("_")};return!0===e?n.nominative.slice(1,7).concat(n.nominative.slice(0,1)):e?n[/(\[[ВвУу]\]) ?dddd/.test(t)?"accusative":/\[?(?:минулої|наступної)? ?\] ?dddd/.test(t)?"genitive":"nominative"][e.day()]:n.nominative},weekdaysShort:"нд_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY р.",LLL:"D MMMM YYYY р., HH:mm",LLLL:"dddd, D MMMM YYYY р., HH:mm"},calendar:{sameDay:n("[Сьогодні "),nextDay:n("[Завтра "),lastDay:n("[Вчора "),nextWeek:n("[У] dddd ["),lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return n("[Минулої] dddd [").call(this);case 1:case 2:case 4:return n("[Минулого] dddd [").call(this)}},sameElse:"L"},relativeTime:{future:"за %s",past:"%s тому",s:"декілька секунд",ss:t,m:t,mm:t,h:"годину",hh:t,d:"день",dd:t,M:"місяць",MM:t,y:"рік",yy:t},meridiemParse:/ночі|ранку|дня|вечора/,isPM:function(e){return/^(дня|вечора)$/.test(e)},meridiem:function(e,t,n){return e<4?"ночі":e<12?"ранку":e<17?"дня":"вечора"},dayOfMonthOrdinalParse:/\d{1,2}-(й|го)/,ordinal:function(e,t){switch(t){case"M":case"d":case"DDD":case"w":case"W":return e+"-й";case"D":return e+"-го";default:return e}},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ur.js":function(e,t,n){!function(e){"use strict";var t=["جنوری","فروری","مارچ","اپریل","مئی","جون","جولائی","اگست","ستمبر","اکتوبر","نومبر","دسمبر"],n=["اتوار","پیر","منگل","بدھ","جمعرات","جمعہ","ہفتہ"];e.defineLocale("ur",{months:t,monthsShort:t,weekdays:n,weekdaysShort:n,weekdaysMin:n,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd، D MMMM YYYY HH:mm"},meridiemParse:/صبح|شام/,isPM:function(e){return"شام"===e},meridiem:function(e,t,n){return e<12?"صبح":"شام"},calendar:{sameDay:"[آج بوقت] LT",nextDay:"[کل بوقت] LT",nextWeek:"dddd [بوقت] LT",lastDay:"[گذشتہ روز بوقت] LT",lastWeek:"[گذشتہ] dddd [بوقت] LT",sameElse:"L"},relativeTime:{future:"%s بعد",past:"%s قبل",s:"چند سیکنڈ",ss:"%d سیکنڈ",m:"ایک منٹ",mm:"%d منٹ",h:"ایک گھنٹہ",hh:"%d گھنٹے",d:"ایک دن",dd:"%d دن",M:"ایک ماہ",MM:"%d ماہ",y:"ایک سال",yy:"%d سال"},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/uz-latn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("uz-latn",{months:"Yanvar_Fevral_Mart_Aprel_May_Iyun_Iyul_Avgust_Sentabr_Oktabr_Noyabr_Dekabr".split("_"),monthsShort:"Yan_Fev_Mar_Apr_May_Iyun_Iyul_Avg_Sen_Okt_Noy_Dek".split("_"),weekdays:"Yakshanba_Dushanba_Seshanba_Chorshanba_Payshanba_Juma_Shanba".split("_"),weekdaysShort:"Yak_Dush_Sesh_Chor_Pay_Jum_Shan".split("_"),weekdaysMin:"Ya_Du_Se_Cho_Pa_Ju_Sha".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"D MMMM YYYY, dddd HH:mm"},calendar:{sameDay:"[Bugun soat] LT [da]",nextDay:"[Ertaga] LT [da]",nextWeek:"dddd [kuni soat] LT [da]",lastDay:"[Kecha soat] LT [da]",lastWeek:"[O'tgan] dddd [kuni soat] LT [da]",sameElse:"L"},relativeTime:{future:"Yaqin %s ichida",past:"Bir necha %s oldin",s:"soniya",ss:"%d soniya",m:"bir daqiqa",mm:"%d daqiqa",h:"bir soat",hh:"%d soat",d:"bir kun",dd:"%d kun",M:"bir oy",MM:"%d oy",y:"bir yil",yy:"%d yil"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/uz.js":function(e,t,n){!function(e){"use strict";e.defineLocale("uz",{months:"январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр".split("_"),monthsShort:"янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"),weekdays:"Якшанба_Душанба_Сешанба_Чоршанба_Пайшанба_Жума_Шанба".split("_"),weekdaysShort:"Якш_Душ_Сеш_Чор_Пай_Жум_Шан".split("_"),weekdaysMin:"Як_Ду_Се_Чо_Па_Жу_Ша".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"D MMMM YYYY, dddd HH:mm"},calendar:{sameDay:"[Бугун соат] LT [да]",nextDay:"[Эртага] LT [да]",nextWeek:"dddd [куни соат] LT [да]",lastDay:"[Кеча соат] LT [да]",lastWeek:"[Утган] dddd [куни соат] LT [да]",sameElse:"L"},relativeTime:{future:"Якин %s ичида",past:"Бир неча %s олдин",s:"фурсат",ss:"%d фурсат",m:"бир дакика",mm:"%d дакика",h:"бир соат",hh:"%d соат",d:"бир кун",dd:"%d кун",M:"бир ой",MM:"%d ой",y:"бир йил",yy:"%d йил"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/vi.js":function(e,t,n){!function(e){"use strict";e.defineLocale("vi",{months:"tháng 1_tháng 2_tháng 3_tháng 4_tháng 5_tháng 6_tháng 7_tháng 8_tháng 9_tháng 10_tháng 11_tháng 12".split("_"),monthsShort:"Thg 01_Thg 02_Thg 03_Thg 04_Thg 05_Thg 06_Thg 07_Thg 08_Thg 09_Thg 10_Thg 11_Thg 12".split("_"),monthsParseExact:!0,weekdays:"chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy".split("_"),weekdaysShort:"CN_T2_T3_T4_T5_T6_T7".split("_"),weekdaysMin:"CN_T2_T3_T4_T5_T6_T7".split("_"),weekdaysParseExact:!0,meridiemParse:/sa|ch/i,isPM:function(e){return/^ch$/i.test(e)},meridiem:function(e,t,n){return e<12?n?"sa":"SA":n?"ch":"CH"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [năm] YYYY",LLL:"D MMMM [năm] YYYY HH:mm",LLLL:"dddd, D MMMM [năm] YYYY HH:mm",l:"DD/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},calendar:{sameDay:"[Hôm nay lúc] LT",nextDay:"[Ngày mai lúc] LT",nextWeek:"dddd [tuần tới lúc] LT",lastDay:"[Hôm qua lúc] LT",lastWeek:"dddd [tuần trước lúc] LT",sameElse:"L"},relativeTime:{future:"%s tới",past:"%s trước",s:"vài giây",ss:"%d giây",m:"một phút",mm:"%d phút",h:"một giờ",hh:"%d giờ",d:"một ngày",dd:"%d ngày",w:"một tuần",ww:"%d tuần",M:"một tháng",MM:"%d tháng",y:"một năm",yy:"%d năm"},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:function(e){return e},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/x-pseudo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("x-pseudo",{months:"J~áñúá~rý_F~ébrú~árý_~Márc~h_Áp~ríl_~Máý_~Júñé~_Júl~ý_Áú~gúst~_Sép~témb~ér_Ó~ctób~ér_Ñ~óvém~bér_~Décé~mbér".split("_"),monthsShort:"J~áñ_~Féb_~Már_~Ápr_~Máý_~Júñ_~Júl_~Áúg_~Sép_~Óct_~Ñóv_~Déc".split("_"),monthsParseExact:!0,weekdays:"S~úñdá~ý_Mó~ñdáý~_Túé~sdáý~_Wéd~ñésd~áý_T~húrs~dáý_~Fríd~áý_S~átúr~dáý".split("_"),weekdaysShort:"S~úñ_~Móñ_~Túé_~Wéd_~Thú_~Frí_~Sát".split("_"),weekdaysMin:"S~ú_Mó~_Tú_~Wé_T~h_Fr~_Sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[T~ódá~ý át] LT",nextDay:"[T~ómó~rró~w át] LT",nextWeek:"dddd [át] LT",lastDay:"[Ý~ést~érdá~ý át] LT",lastWeek:"[L~ást] dddd [át] LT",sameElse:"L"},relativeTime:{future:"í~ñ %s",past:"%s á~gó",s:"á ~féw ~sécó~ñds",ss:"%d s~écóñ~ds",m:"á ~míñ~úté",mm:"%d m~íñú~tés",h:"á~ñ hó~úr",hh:"%d h~óúrs",d:"á ~dáý",dd:"%d d~áýs",M:"á ~móñ~th",MM:"%d m~óñt~hs",y:"á ~ýéár",yy:"%d ý~éárs"},dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/yo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("yo",{months:"Sẹ́rẹ́_Èrèlè_Ẹrẹ̀nà_Ìgbé_Èbibi_Òkùdu_Agẹmo_Ògún_Owewe_Ọ̀wàrà_Bélú_Ọ̀pẹ̀̀".split("_"),monthsShort:"Sẹ́r_Èrl_Ẹrn_Ìgb_Èbi_Òkù_Agẹ_Ògú_Owe_Ọ̀wà_Bél_Ọ̀pẹ̀̀".split("_"),weekdays:"Àìkú_Ajé_Ìsẹ́gun_Ọjọ́rú_Ọjọ́bọ_Ẹtì_Àbámẹ́ta".split("_"),weekdaysShort:"Àìk_Ajé_Ìsẹ́_Ọjr_Ọjb_Ẹtì_Àbá".split("_"),weekdaysMin:"Àì_Aj_Ìs_Ọr_Ọb_Ẹt_Àb".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Ònì ni] LT",nextDay:"[Ọ̀la ni] LT",nextWeek:"dddd [Ọsẹ̀ tón'bọ] [ni] LT",lastDay:"[Àna ni] LT",lastWeek:"dddd [Ọsẹ̀ tólọ́] [ni] LT",sameElse:"L"},relativeTime:{future:"ní %s",past:"%s kọjá",s:"ìsẹjú aayá die",ss:"aayá %d",m:"ìsẹjú kan",mm:"ìsẹjú %d",h:"wákati kan",hh:"wákati %d",d:"ọjọ́ kan",dd:"ọjọ́ %d",M:"osù kan",MM:"osù %d",y:"ọdún kan",yy:"ọdún %d"},dayOfMonthOrdinalParse:/ọjọ́\s\d{1,2}/,ordinal:"ọjọ́ %d",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/zh-cn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("zh-cn",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"下午"===t||"晚上"===t?e+12:e>=11?e:e+12},meridiem:function(e,t,n){var o=100*e+t;return o<600?"凌晨":o<900?"早上":o<1130?"上午":o<1230?"中午":o<1800?"下午":"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:function(e){return e.week()!==this.week()?"[下]dddLT":"[本]dddLT"},lastDay:"[昨天]LT",lastWeek:function(e){return this.week()!==e.week()?"[上]dddLT":"[本]dddLT"},sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|周)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"周";default:return e}},relativeTime:{future:"%s后",past:"%s前",s:"几秒",ss:"%d 秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",w:"1 周",ww:"%d 周",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/zh-hk.js":function(e,t,n){!function(e){"use strict";e.defineLocale("zh-hk",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"中午"===t?e>=11?e:e+12:"下午"===t||"晚上"===t?e+12:void 0},meridiem:function(e,t,n){var o=100*e+t;return o<600?"凌晨":o<900?"早上":o<1200?"上午":1200===o?"中午":o<1800?"下午":"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:"[下]ddddLT",lastDay:"[昨天]LT",lastWeek:"[上]ddddLT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s後",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/zh-mo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("zh-mo",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"D/M/YYYY",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"中午"===t?e>=11?e:e+12:"下午"===t||"晚上"===t?e+12:void 0},meridiem:function(e,t,n){var o=100*e+t;return o<600?"凌晨":o<900?"早上":o<1130?"上午":o<1230?"中午":o<1800?"下午":"晚上"},calendar:{sameDay:"[今天] LT",nextDay:"[明天] LT",nextWeek:"[下]dddd LT",lastDay:"[昨天] LT",lastWeek:"[上]dddd LT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s內",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/zh-tw.js":function(e,t,n){!function(e){"use strict";e.defineLocale("zh-tw",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"中午"===t?e>=11?e:e+12:"下午"===t||"晚上"===t?e+12:void 0},meridiem:function(e,t,n){var o=100*e+t;return o<600?"凌晨":o<900?"早上":o<1130?"上午":o<1230?"中午":o<1800?"下午":"晚上"},calendar:{sameDay:"[今天] LT",nextDay:"[明天] LT",nextWeek:"[下]dddd LT",lastDay:"[昨天] LT",lastWeek:"[上]dddd LT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s後",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale sync recursive ^\\.\\/.*$":(e,t,n)=>{var o={"./af":"./node_modules/moment/locale/af.js","./af.js":"./node_modules/moment/locale/af.js","./ar":"./node_modules/moment/locale/ar.js","./ar-dz":"./node_modules/moment/locale/ar-dz.js","./ar-dz.js":"./node_modules/moment/locale/ar-dz.js","./ar-kw":"./node_modules/moment/locale/ar-kw.js","./ar-kw.js":"./node_modules/moment/locale/ar-kw.js","./ar-ly":"./node_modules/moment/locale/ar-ly.js","./ar-ly.js":"./node_modules/moment/locale/ar-ly.js","./ar-ma":"./node_modules/moment/locale/ar-ma.js","./ar-ma.js":"./node_modules/moment/locale/ar-ma.js","./ar-sa":"./node_modules/moment/locale/ar-sa.js","./ar-sa.js":"./node_modules/moment/locale/ar-sa.js","./ar-tn":"./node_modules/moment/locale/ar-tn.js","./ar-tn.js":"./node_modules/moment/locale/ar-tn.js","./ar.js":"./node_modules/moment/locale/ar.js","./az":"./node_modules/moment/locale/az.js","./az.js":"./node_modules/moment/locale/az.js","./be":"./node_modules/moment/locale/be.js","./be.js":"./node_modules/moment/locale/be.js","./bg":"./node_modules/moment/locale/bg.js","./bg.js":"./node_modules/moment/locale/bg.js","./bm":"./node_modules/moment/locale/bm.js","./bm.js":"./node_modules/moment/locale/bm.js","./bn":"./node_modules/moment/locale/bn.js","./bn-bd":"./node_modules/moment/locale/bn-bd.js","./bn-bd.js":"./node_modules/moment/locale/bn-bd.js","./bn.js":"./node_modules/moment/locale/bn.js","./bo":"./node_modules/moment/locale/bo.js","./bo.js":"./node_modules/moment/locale/bo.js","./br":"./node_modules/moment/locale/br.js","./br.js":"./node_modules/moment/locale/br.js","./bs":"./node_modules/moment/locale/bs.js","./bs.js":"./node_modules/moment/locale/bs.js","./ca":"./node_modules/moment/locale/ca.js","./ca.js":"./node_modules/moment/locale/ca.js","./cs":"./node_modules/moment/locale/cs.js","./cs.js":"./node_modules/moment/locale/cs.js","./cv":"./node_modules/moment/locale/cv.js","./cv.js":"./node_modules/moment/locale/cv.js","./cy":"./node_modules/moment/locale/cy.js","./cy.js":"./node_modules/moment/locale/cy.js","./da":"./node_modules/moment/locale/da.js","./da.js":"./node_modules/moment/locale/da.js","./de":"./node_modules/moment/locale/de.js","./de-at":"./node_modules/moment/locale/de-at.js","./de-at.js":"./node_modules/moment/locale/de-at.js","./de-ch":"./node_modules/moment/locale/de-ch.js","./de-ch.js":"./node_modules/moment/locale/de-ch.js","./de.js":"./node_modules/moment/locale/de.js","./dv":"./node_modules/moment/locale/dv.js","./dv.js":"./node_modules/moment/locale/dv.js","./el":"./node_modules/moment/locale/el.js","./el.js":"./node_modules/moment/locale/el.js","./en-au":"./node_modules/moment/locale/en-au.js","./en-au.js":"./node_modules/moment/locale/en-au.js","./en-ca":"./node_modules/moment/locale/en-ca.js","./en-ca.js":"./node_modules/moment/locale/en-ca.js","./en-gb":"./node_modules/moment/locale/en-gb.js","./en-gb.js":"./node_modules/moment/locale/en-gb.js","./en-ie":"./node_modules/moment/locale/en-ie.js","./en-ie.js":"./node_modules/moment/locale/en-ie.js","./en-il":"./node_modules/moment/locale/en-il.js","./en-il.js":"./node_modules/moment/locale/en-il.js","./en-in":"./node_modules/moment/locale/en-in.js","./en-in.js":"./node_modules/moment/locale/en-in.js","./en-nz":"./node_modules/moment/locale/en-nz.js","./en-nz.js":"./node_modules/moment/locale/en-nz.js","./en-sg":"./node_modules/moment/locale/en-sg.js","./en-sg.js":"./node_modules/moment/locale/en-sg.js","./eo":"./node_modules/moment/locale/eo.js","./eo.js":"./node_modules/moment/locale/eo.js","./es":"./node_modules/moment/locale/es.js","./es-do":"./node_modules/moment/locale/es-do.js","./es-do.js":"./node_modules/moment/locale/es-do.js","./es-mx":"./node_modules/moment/locale/es-mx.js","./es-mx.js":"./node_modules/moment/locale/es-mx.js","./es-us":"./node_modules/moment/locale/es-us.js","./es-us.js":"./node_modules/moment/locale/es-us.js","./es.js":"./node_modules/moment/locale/es.js","./et":"./node_modules/moment/locale/et.js","./et.js":"./node_modules/moment/locale/et.js","./eu":"./node_modules/moment/locale/eu.js","./eu.js":"./node_modules/moment/locale/eu.js","./fa":"./node_modules/moment/locale/fa.js","./fa.js":"./node_modules/moment/locale/fa.js","./fi":"./node_modules/moment/locale/fi.js","./fi.js":"./node_modules/moment/locale/fi.js","./fil":"./node_modules/moment/locale/fil.js","./fil.js":"./node_modules/moment/locale/fil.js","./fo":"./node_modules/moment/locale/fo.js","./fo.js":"./node_modules/moment/locale/fo.js","./fr":"./node_modules/moment/locale/fr.js","./fr-ca":"./node_modules/moment/locale/fr-ca.js","./fr-ca.js":"./node_modules/moment/locale/fr-ca.js","./fr-ch":"./node_modules/moment/locale/fr-ch.js","./fr-ch.js":"./node_modules/moment/locale/fr-ch.js","./fr.js":"./node_modules/moment/locale/fr.js","./fy":"./node_modules/moment/locale/fy.js","./fy.js":"./node_modules/moment/locale/fy.js","./ga":"./node_modules/moment/locale/ga.js","./ga.js":"./node_modules/moment/locale/ga.js","./gd":"./node_modules/moment/locale/gd.js","./gd.js":"./node_modules/moment/locale/gd.js","./gl":"./node_modules/moment/locale/gl.js","./gl.js":"./node_modules/moment/locale/gl.js","./gom-deva":"./node_modules/moment/locale/gom-deva.js","./gom-deva.js":"./node_modules/moment/locale/gom-deva.js","./gom-latn":"./node_modules/moment/locale/gom-latn.js","./gom-latn.js":"./node_modules/moment/locale/gom-latn.js","./gu":"./node_modules/moment/locale/gu.js","./gu.js":"./node_modules/moment/locale/gu.js","./he":"./node_modules/moment/locale/he.js","./he.js":"./node_modules/moment/locale/he.js","./hi":"./node_modules/moment/locale/hi.js","./hi.js":"./node_modules/moment/locale/hi.js","./hr":"./node_modules/moment/locale/hr.js","./hr.js":"./node_modules/moment/locale/hr.js","./hu":"./node_modules/moment/locale/hu.js","./hu.js":"./node_modules/moment/locale/hu.js","./hy-am":"./node_modules/moment/locale/hy-am.js","./hy-am.js":"./node_modules/moment/locale/hy-am.js","./id":"./node_modules/moment/locale/id.js","./id.js":"./node_modules/moment/locale/id.js","./is":"./node_modules/moment/locale/is.js","./is.js":"./node_modules/moment/locale/is.js","./it":"./node_modules/moment/locale/it.js","./it-ch":"./node_modules/moment/locale/it-ch.js","./it-ch.js":"./node_modules/moment/locale/it-ch.js","./it.js":"./node_modules/moment/locale/it.js","./ja":"./node_modules/moment/locale/ja.js","./ja.js":"./node_modules/moment/locale/ja.js","./jv":"./node_modules/moment/locale/jv.js","./jv.js":"./node_modules/moment/locale/jv.js","./ka":"./node_modules/moment/locale/ka.js","./ka.js":"./node_modules/moment/locale/ka.js","./kk":"./node_modules/moment/locale/kk.js","./kk.js":"./node_modules/moment/locale/kk.js","./km":"./node_modules/moment/locale/km.js","./km.js":"./node_modules/moment/locale/km.js","./kn":"./node_modules/moment/locale/kn.js","./kn.js":"./node_modules/moment/locale/kn.js","./ko":"./node_modules/moment/locale/ko.js","./ko.js":"./node_modules/moment/locale/ko.js","./ku":"./node_modules/moment/locale/ku.js","./ku.js":"./node_modules/moment/locale/ku.js","./ky":"./node_modules/moment/locale/ky.js","./ky.js":"./node_modules/moment/locale/ky.js","./lb":"./node_modules/moment/locale/lb.js","./lb.js":"./node_modules/moment/locale/lb.js","./lo":"./node_modules/moment/locale/lo.js","./lo.js":"./node_modules/moment/locale/lo.js","./lt":"./node_modules/moment/locale/lt.js","./lt.js":"./node_modules/moment/locale/lt.js","./lv":"./node_modules/moment/locale/lv.js","./lv.js":"./node_modules/moment/locale/lv.js","./me":"./node_modules/moment/locale/me.js","./me.js":"./node_modules/moment/locale/me.js","./mi":"./node_modules/moment/locale/mi.js","./mi.js":"./node_modules/moment/locale/mi.js","./mk":"./node_modules/moment/locale/mk.js","./mk.js":"./node_modules/moment/locale/mk.js","./ml":"./node_modules/moment/locale/ml.js","./ml.js":"./node_modules/moment/locale/ml.js","./mn":"./node_modules/moment/locale/mn.js","./mn.js":"./node_modules/moment/locale/mn.js","./mr":"./node_modules/moment/locale/mr.js","./mr.js":"./node_modules/moment/locale/mr.js","./ms":"./node_modules/moment/locale/ms.js","./ms-my":"./node_modules/moment/locale/ms-my.js","./ms-my.js":"./node_modules/moment/locale/ms-my.js","./ms.js":"./node_modules/moment/locale/ms.js","./mt":"./node_modules/moment/locale/mt.js","./mt.js":"./node_modules/moment/locale/mt.js","./my":"./node_modules/moment/locale/my.js","./my.js":"./node_modules/moment/locale/my.js","./nb":"./node_modules/moment/locale/nb.js","./nb.js":"./node_modules/moment/locale/nb.js","./ne":"./node_modules/moment/locale/ne.js","./ne.js":"./node_modules/moment/locale/ne.js","./nl":"./node_modules/moment/locale/nl.js","./nl-be":"./node_modules/moment/locale/nl-be.js","./nl-be.js":"./node_modules/moment/locale/nl-be.js","./nl.js":"./node_modules/moment/locale/nl.js","./nn":"./node_modules/moment/locale/nn.js","./nn.js":"./node_modules/moment/locale/nn.js","./oc-lnc":"./node_modules/moment/locale/oc-lnc.js","./oc-lnc.js":"./node_modules/moment/locale/oc-lnc.js","./pa-in":"./node_modules/moment/locale/pa-in.js","./pa-in.js":"./node_modules/moment/locale/pa-in.js","./pl":"./node_modules/moment/locale/pl.js","./pl.js":"./node_modules/moment/locale/pl.js","./pt":"./node_modules/moment/locale/pt.js","./pt-br":"./node_modules/moment/locale/pt-br.js","./pt-br.js":"./node_modules/moment/locale/pt-br.js","./pt.js":"./node_modules/moment/locale/pt.js","./ro":"./node_modules/moment/locale/ro.js","./ro.js":"./node_modules/moment/locale/ro.js","./ru":"./node_modules/moment/locale/ru.js","./ru.js":"./node_modules/moment/locale/ru.js","./sd":"./node_modules/moment/locale/sd.js","./sd.js":"./node_modules/moment/locale/sd.js","./se":"./node_modules/moment/locale/se.js","./se.js":"./node_modules/moment/locale/se.js","./si":"./node_modules/moment/locale/si.js","./si.js":"./node_modules/moment/locale/si.js","./sk":"./node_modules/moment/locale/sk.js","./sk.js":"./node_modules/moment/locale/sk.js","./sl":"./node_modules/moment/locale/sl.js","./sl.js":"./node_modules/moment/locale/sl.js","./sq":"./node_modules/moment/locale/sq.js","./sq.js":"./node_modules/moment/locale/sq.js","./sr":"./node_modules/moment/locale/sr.js","./sr-cyrl":"./node_modules/moment/locale/sr-cyrl.js","./sr-cyrl.js":"./node_modules/moment/locale/sr-cyrl.js","./sr.js":"./node_modules/moment/locale/sr.js","./ss":"./node_modules/moment/locale/ss.js","./ss.js":"./node_modules/moment/locale/ss.js","./sv":"./node_modules/moment/locale/sv.js","./sv.js":"./node_modules/moment/locale/sv.js","./sw":"./node_modules/moment/locale/sw.js","./sw.js":"./node_modules/moment/locale/sw.js","./ta":"./node_modules/moment/locale/ta.js","./ta.js":"./node_modules/moment/locale/ta.js","./te":"./node_modules/moment/locale/te.js","./te.js":"./node_modules/moment/locale/te.js","./tet":"./node_modules/moment/locale/tet.js","./tet.js":"./node_modules/moment/locale/tet.js","./tg":"./node_modules/moment/locale/tg.js","./tg.js":"./node_modules/moment/locale/tg.js","./th":"./node_modules/moment/locale/th.js","./th.js":"./node_modules/moment/locale/th.js","./tk":"./node_modules/moment/locale/tk.js","./tk.js":"./node_modules/moment/locale/tk.js","./tl-ph":"./node_modules/moment/locale/tl-ph.js","./tl-ph.js":"./node_modules/moment/locale/tl-ph.js","./tlh":"./node_modules/moment/locale/tlh.js","./tlh.js":"./node_modules/moment/locale/tlh.js","./tr":"./node_modules/moment/locale/tr.js","./tr.js":"./node_modules/moment/locale/tr.js","./tzl":"./node_modules/moment/locale/tzl.js","./tzl.js":"./node_modules/moment/locale/tzl.js","./tzm":"./node_modules/moment/locale/tzm.js","./tzm-latn":"./node_modules/moment/locale/tzm-latn.js","./tzm-latn.js":"./node_modules/moment/locale/tzm-latn.js","./tzm.js":"./node_modules/moment/locale/tzm.js","./ug-cn":"./node_modules/moment/locale/ug-cn.js","./ug-cn.js":"./node_modules/moment/locale/ug-cn.js","./uk":"./node_modules/moment/locale/uk.js","./uk.js":"./node_modules/moment/locale/uk.js","./ur":"./node_modules/moment/locale/ur.js","./ur.js":"./node_modules/moment/locale/ur.js","./uz":"./node_modules/moment/locale/uz.js","./uz-latn":"./node_modules/moment/locale/uz-latn.js","./uz-latn.js":"./node_modules/moment/locale/uz-latn.js","./uz.js":"./node_modules/moment/locale/uz.js","./vi":"./node_modules/moment/locale/vi.js","./vi.js":"./node_modules/moment/locale/vi.js","./x-pseudo":"./node_modules/moment/locale/x-pseudo.js","./x-pseudo.js":"./node_modules/moment/locale/x-pseudo.js","./yo":"./node_modules/moment/locale/yo.js","./yo.js":"./node_modules/moment/locale/yo.js","./zh-cn":"./node_modules/moment/locale/zh-cn.js","./zh-cn.js":"./node_modules/moment/locale/zh-cn.js","./zh-hk":"./node_modules/moment/locale/zh-hk.js","./zh-hk.js":"./node_modules/moment/locale/zh-hk.js","./zh-mo":"./node_modules/moment/locale/zh-mo.js","./zh-mo.js":"./node_modules/moment/locale/zh-mo.js","./zh-tw":"./node_modules/moment/locale/zh-tw.js","./zh-tw.js":"./node_modules/moment/locale/zh-tw.js"};function r(e){var t=s(e);return n(t)}function s(e){if(!n.o(o,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return o[e]}r.keys=function(){return Object.keys(o)},r.resolve=s,e.exports=r,r.id="./node_modules/moment/locale sync recursive ^\\.\\/.*$"},"./node_modules/ng-csv/build/ng-csv.min.js":(e,t)=>{var n;n=window,document,angular.module("ngCsv.config",[]).value("ngCsv.config",{debug:!0}).config(["$compileProvider",function(e){angular.isDefined(e.urlSanitizationWhitelist)?e.urlSanitizationWhitelist(/^\s*(https?|ftp|mailto|file|data):/):e.aHrefSanitizationWhitelist(/^\s*(https?|ftp|mailto|file|data):/)}]),angular.module("ngCsv.directives",["ngCsv.services"]),angular.module("ngCsv.services",[]),angular.module("ngCsv",["ngCsv.config","ngCsv.services","ngCsv.directives","ngSanitize"]),e.exports===t&&(e.exports="ngCsv"),angular.module("ngCsv.services").service("CSV",["$q",function(e){var t="\r\n",n={"\\t":"\t","\\b":"\b","\\v":"\v","\\f":"\f","\\r":"\r"};this.stringifyField=function(e,t){return"locale"===t.decimalSep&&this.isFloat(e)?e.toLocaleString():"."!==t.decimalSep&&this.isFloat(e)?e.toString().replace(".",t.decimalSep):"string"==typeof e?(e=e.replace(/"/g,'""'),(t.quoteStrings||e.indexOf(",")>-1||e.indexOf("\n")>-1||e.indexOf("\r")>-1)&&(e=t.txtDelim+e+t.txtDelim),e):"boolean"==typeof e?e?"TRUE":"FALSE":e},this.isFloat=function(e){return+e===e&&(!isFinite(e)||Boolean(e%1))},this.stringify=function(n,o){var r=e.defer(),s=this,a="",i="",d=e.when(n).then((function(e){var n,d;angular.isDefined(o.header)&&o.header&&(n=[],angular.forEach(o.header,(function(e){this.push(s.stringifyField(e,o))}),n),d=n.join(o.fieldSep?o.fieldSep:","),i+=d+t);var u,m,l=[];angular.isArray(e)?l=e:angular.isFunction(e)&&(l=e()),angular.isDefined(o.label)&&o.label&&"boolean"==typeof o.label&&(u=[],angular.forEach(l[0],(function(e,t){this.push(s.stringifyField(t,o))}),u),m=u.join(o.fieldSep?o.fieldSep:","),i+=m+t),angular.forEach(l,(function(e,n){var r,a,d=angular.copy(l[n]);a=[];var u=o.columnOrder?o.columnOrder:d;angular.forEach(u,(function(e){var t=o.columnOrder?d[e]:e;this.push(s.stringifyField(t,o))}),a),r=a.join(o.fieldSep?o.fieldSep:","),i+=n'),i=angular.element(a.children()[0]);i.attr("href",n.URL.createObjectURL(o)),i.attr("download",e.getFilename()),i.attr("target","_blank"),r.find("body").append(a),s((function(){i[0].click(),i.remove()}),null)}}()})),e.$apply()}))}}}])},"./src/js/chat/chat.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/dc49a9ba939f8c099868.html"},"./src/js/closing/closing.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/00860aee362cdeeb1080.html"},"./src/js/offline/offline.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/9962474df74f9405ac72.html"},"./src/js/online/online.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/caf0e553108b226443aa.html"},"./src/js/unmanaged/unmanaged.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/3f18dac5f545add792db.html"},"./src/js/waiting/waiting.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/6043a16afdb829ba5934.html"}},e=>{var t=t=>e(e.s=t);e.O(0,["vendor-index","vendor-angular-76f2ed34","vendor-angular-58d021f3","vendor-ng-embed","vendor-moment","vendor-jquery","vendor-jquery.textcomplete","vendor-emojionearea","vendor-emojione","vendor-angular-sanitize","vendor-angular-resource","vendor-angular-messages","vendor-angular-material","vendor-angular-local-storage","vendor-angular-animate","vendor-urlMatcher","vendor-transition","vendor-stateService","vendor-stateDirectives","vendor-flow"],(()=>(t("./node_modules/jquery/dist/jquery.js"),t("./node_modules/angular/index-exposed.js"),t("./node_modules/moment/moment.js"),t("./node_modules/@flowjs/flow.js/src/flow.js"),t("./node_modules/emojione/lib/js/emojione.js"),t("./src/js/index.module.js")))),e.O()}]); -//# sourceMappingURL=chat.js.map \ No newline at end of file diff --git a/snippet/3.5.0/scripts/chat.js.map b/snippet/3.5.0/scripts/chat.js.map deleted file mode 100644 index 1f082e3..0000000 --- a/snippet/3.5.0/scripts/chat.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"scripts/chat.js","mappings":";iMAOAA,QAAQC,OAAO,gBAAiB,IAC/BC,SAAS,eAAe,WACvB,aAMAC,KAAKC,SAAW,GAQhBD,KAAKE,QAAU,SAAUC,GACvB,OAAO,IAAIC,EAAKD,IASlBH,KAAKK,OAAS,GASdL,KAAKM,GAAK,SAAUC,EAAOC,GACzBR,KAAKK,OAAOI,KAAK,CAACF,EAAOC,KAG3BR,KAAKU,KAAO,WACV,IAAIC,EAAKX,KAAKE,QACVD,EAAWD,KAAKC,SAChBI,EAASL,KAAKK,OAClB,MAAO,CACL,OAAU,SAASO,GAEjB,IAAIC,EAAOF,EAAGd,QAAQiB,OAAO,GAAIb,EAAUW,IAI3C,OAHAf,QAAQkB,QAAQV,GAAQ,SAAUE,GAChCM,EAAKP,GAAGC,EAAM,GAAIA,EAAM,OAEnBM,QAKfhB,QAAQC,OAAO,YAAa,CAAC,kBAC1BkB,WAAW,WAAY,CAAC,SAAU,SAAU,SAAU,cACvD,SAAUC,EAAQC,EAAQC,EAAQC,GAEhC,IAAIjB,EAAUN,QAAQiB,OAAO,GAAIG,EAAOI,MAAMH,EAAOI,WAGjDT,EAAQI,EAAOI,MAAMH,EAAOK,aAAeH,EAAYI,OAAOrB,GAE9DsB,EAAkB,SAASC,GAC7B,IAAIC,EAAOC,MAAMC,UAAUC,MAAMC,KAAKC,WACtCL,EAAKM,QACL,IAAI1B,EAAQU,EAAOiB,WAAWC,MAAMlB,EAAQ,CAAC,SAAWS,EAAWb,GAAMuB,OAAOT,IAMhF,GALI,CACF,SAAW,EAAG,eAAiB,EAAG,YAAe,EAAG,UAAa,EAAG,SAAY,GAChFD,IACAT,EAAOoB,cAEL9B,EAAM+B,iBACR,OAAO,GAIXzB,EAAKP,GAAG,WAAYmB,GACpBR,EAAOsB,IAAI,YAAY,WACnB1B,EAAK2B,IAAI,WAAYf,MAGzBR,EAAOwB,MAAQ5B,EAEXK,EAAOwB,eAAe,cACxBvB,EAAOD,EAAOyB,UAAUC,OAAO3B,EAAQJ,GACvCI,EAAOsB,IAAI,YAAY,WACrBpB,EAAOD,EAAOyB,UAAUC,OAAO3B,UAIpC4B,UAAU,WAAY,CAAC,WACtB,MAAO,CACLC,OAAO,EACP9B,WAAY,eAGlBnB,QAAQC,OAAO,WAAY,CAAC,cAC3B+C,UAAU,UAAW,CAAC,WACrB,MAAO,CACL,SAAY,KACZ,OAAS,EACT,QAAW,YACX,KAAQ,SAASC,EAAOC,EAASC,GAC/B,IAAIC,EAAcD,EAAMN,eAAe,iBACnCQ,EAAeF,EAAMN,eAAe,kBACpCS,EAAaH,EAAMN,eAAe,cAAgBI,EAAMzB,MAAM2B,EAAMI,WACxEN,EAAML,MAAMY,aAAaN,EAASE,EAAaC,EAAcC,QAInEtD,QAAQC,OAAO,kBAAmB,CAAC,cAKhC+C,UAAU,mBAAmB,WAC5B,MAAO,CACL,OAAS,EACT,KAAQ,SAASC,EAAOC,EAASC,GAC/BD,EAAQO,KAAK,iBAAiB,SAAU/C,GACtCA,EAAMgD,yBASbV,UAAU,gBAAiB,CAAC,WAAY,SAASW,GAChD,MAAO,CACL,OAAS,EACT,KAAQ,SAASV,EAAOC,EAASC,GAC/B,IAAIS,EACAC,GAAQ,EACZX,EAAQO,KAAK,YAAY,SAAU/C,GAmBnC,IAAoBoD,EACdC,EACAC,EADAD,GAAW,EACXC,GAFcF,EAlBFpD,GAoBasD,cAAgBF,EAAUG,cAAcD,aACrEhE,QAAQkB,QAAQ8C,GAAgBA,EAAaE,OAAO,SAASC,GAC/C,UAARA,IACFJ,GAAW,MAGRA,IAvBFF,IACHZ,EAAMmB,OAAOjB,EAAMkB,eACnBR,GAAQ,GAEVF,EAASW,OAAOV,GAChBlD,EAAMgD,qBAERR,EAAQO,KAAK,kBAAkB,SAAU/C,GACvCiD,EAASW,OAAOV,GAChBA,EAAUD,GAAS,WACjBV,EAAMzB,MAAM2B,EAAMoB,eAClBX,EAAU,KACVC,GAAQ,IACP,aAgBb7D,QAAQC,OAAO,YAAa,CAAC,cAC5B+C,UAAU,YAAY,WACrB,MAAO,CACL,OAAS,EACT,QAAW,YACX,KAAQ,SAASC,EAAOC,EAASC,GAY/B,SAASqB,IACPvB,EAAML,MAAM4B,WAAWtB,GAZrBC,EAAMsB,gBACRxB,EAAMyB,OAAOvB,EAAMsB,iBAAiB,SAAUE,GACxCA,EACFH,IAYJvB,EAAML,MAAMgC,aAAa1B,MANzBsB,SAYP,SAAUxE,GAAU,aACnB,IAAIC,EAASD,EAAQC,OAAO,cAAe,CAAC,cAgB5CD,EAAQkB,QAfK,CACX2D,YAAa,CAAC,QAAS,YACvBC,aAAc,CAAC,SACfC,UAAW,CAAC,QAAS,UACrBC,WAAY,CAAC,SAAU,UACvBC,eAAgB,CAAC,SAAU,UAC3BC,UAAW,CAAC,SACZC,YAAa,CAAC,SACdC,UAAW,CAAC,QAAS,YACrBC,YAAa,GACbC,SAAU,GACVC,SAAU,GACVC,MAAO,CAAC,WAAY,WAGE,SAAUC,EAAW5D,GAC3C,IA4B6B6D,EA5BzBC,EAAO,SA4BkBD,EA5Ba7D,GA6B5B+D,OAAO,GAAGC,cAAgBH,EAAOzD,MAAM,IA5BzC,mBAAR0D,IACFA,EAAO,qBAET1F,EAAO+C,UAAU2C,EAAM,CAAC,WACtB,MAAO,CACLG,QAAS,YACT3E,WAAY,CAAC,SAAU,SAAU,SAAUC,EAAQC,GACjDD,EAAOsB,IAAI,SAAWb,GAAW,WAC/B,IAAIkE,EAAWhE,MAAMC,UAAUC,MAAMC,KAAKC,WACtCzB,EAAQqF,EAAS3D,QAErB,GAAIhB,EAAOwB,QAAUmD,EAAS3D,QAA9B,CAGA,IAAIN,EAAO,GACX9B,EAAQkB,QAAQuE,GAAW,SAASd,EAAOqB,GACzClE,EAAK6C,GAASoB,EAASC,OAEgB,IAArC5E,EAAOI,MAAMH,EAAOsE,GAAO7D,IAC7BpB,EAAMgD,8BAtCnB,CAiDC1D,SAEFA,QAAQC,OAAO,WAAY,CAAC,cAC3B+C,UAAU,UAAW,CAAC,WACrB,MAAO,CACL,OAAS,EACT,QAAW,YACX,KAAQ,SAASC,EAAOC,EAASC,GAC/B,IAAI8C,EAAO9C,EAAM+C,QACjBjD,EAAMyB,OAAOuB,GAAM,SAAUA,GAC3B,GAAKA,EAAL,CAGA,IAAIE,EAAa,IAAIC,WACrBD,EAAWE,cAAcJ,EAAKA,MAC9BE,EAAWG,OAAS,SAAU5F,GAC5BuC,EAAMmB,QAAO,WACXjB,EAAMoD,KAAK,MAAO7F,EAAM8F,OAAOC,qBAO3CzG,QAAQC,OAAO,iBAAkB,CAAC,cACjC+C,UAAU,gBAAiB,CAAC,WAC3B,MAAO,CACL,OAAS,EACT,QAAW,YACX,KAAQ,SAASC,GACfA,EAAMyD,UAAYzD,EAAML,MAAM+D,WAIpC3G,QAAQC,OAAO,OAAQ,CAAC,gBAAiB,YAAa,cAAe,WACnE,YAAa,iBAAkB,WAAY,yHC9JlC2G,4PAkKX,SAASC,EAAmBC,EAAUC,EAAaC,EAAcC,EAAOC,GACpE,IAAIC,GAAkB,IAAAC,OAAM,yBACxBC,GAAe,IAAAD,OAAM,sBACzB,MAAO,CACHE,SAAU,MACVC,UAAW,IACXC,QAAS,SAAUC,GACf,IAAIC,EAAUD,EAASE,OAEvB,OADAF,EAASG,QACF,SAAU3E,EAAO4E,GACpB,IAAIC,EAAOD,EAASC,KAAK,WACzB,IAAKA,EAGD,OAFAD,EAASF,KAAKD,QACdZ,EAASe,EAASE,WAAlBjB,CAA8B7D,GAGlC,IAAI+E,EAAMF,EAAKG,MAAQ,CAAEC,SAAU,GAAIC,YAAa,EAAAC,MAChDC,EAAaL,EAAIM,MAAQ,IAAI,EAAAC,eAAeP,EAAIM,MACpDT,EAASF,KAAKK,EAAIG,YAAYN,EAAUQ,IAAeX,GACvD,EAAAc,MAAA,gBAAsBV,EAAKW,QAASZ,EAASF,QAC7C,IAAIe,EAAO5B,EAASe,EAASE,YACzB5G,EAAa6G,EAAI7G,WACjBwH,EAAexB,EAAgBa,GAC/BY,EAAYvB,EAAaW,GACzBa,EAASR,IAAc,OAAUA,GAErC,GADApF,EAAM2F,GAAaC,EACf1H,EAAY,CACZ,IAAI2H,EAAsB/B,EAAY5F,GAAY,IAAAF,QAAO,GAAI4H,EAAQ,CAAEzH,OAAQ6B,EAAO4E,SAAUA,KAC5Fc,IACA1F,EAAM0F,GAAgBG,EACtB7F,EAAM0F,GAAcC,GAAaC,GAMrChB,EAASC,KAAK,0BAA2BgB,GACzCjB,EAASkB,WAAWjB,KAAK,0BAA2BgB,GACpDE,EAA4B9B,EAAIF,EAAc8B,EAAoB7F,EAAO+E,GAG7E,IAAI,IAAAiB,UAASjB,EAAIkB,WACb,IAAIC,GAAY,IAAAC,aAAYpB,EAAIkB,WAC5BG,EAAc,IAAIC,OAAO,eAAiBH,EAAY,IAAK,KAO3DI,EAAoBtG,EAAMyB,QAND,WACzB,IAAI8E,EAAc,GAAGvH,MAChBC,KAAK2F,EAAS,GAAGkB,UACjBU,QAAO,SAAUC,GAAM,OAAOA,GAAMA,EAAGC,SAAWN,EAAYO,KAAKF,EAAGC,YAC3E,OAAOH,GAAe,aAAgBA,GAAa1B,KAAK,IAAME,EAAIkB,UAAY,iBAErB,SAAUW,GAC9DA,IAELb,EAA4B9B,EAAIF,EAAc6C,EAAc5G,EAAO+E,GACnEuB,QAGRb,EAAKzF,MAzNrB2D,EAAS,CACL,QACA,WACA,gBACA,eACA,KACA,SAAwBK,EAAO6C,EAAUC,EAAeC,EAAc9C,GAwBlE,IAAI+C,EAAW,CACXhC,KAAM,CAAEC,SAAU,CAAEgC,SAAUjD,EAAMkD,WAAWC,qBAC/C3B,QAAS,IAETzF,EAAY,CACZqH,MAAO,EACP/C,SAAU,MACVgD,UAAU,EACV/C,SAAU,IACVgD,WAAY,UACZ/C,QAAS,SAAUC,EAAU+C,EAAQC,GACjC,OAAO,SAAUxH,EAAO4E,EAAU1E,GAC9B,IACIuH,EAAYC,EAAWC,EAAcC,EADrCC,EAAY3H,EAAc,QAAK,GAAI4H,EAAgB5H,EAAkB,WAAG6H,EAjCzE,SAAU9H,EAASsD,EAAQyE,GAC1B,mBAAwB,EACxBnB,EAASjG,MAAMX,EAAS,KAAMsD,GAAQ0E,KAAKD,GAG3CnB,EAASjG,MAAMX,EAAS,KAAMsD,EAAQyE,IA4BkCD,EAzBzE,SAAU9H,EAAS+H,GAClB,mBAAwB,EACxBnB,EAASqB,MAAMjI,GAASgI,KAAKD,GAG7BnB,EAASqB,MAAMjI,EAAS+H,IAoB0EG,EAAYvD,EAASwD,cAAc,YAAcpB,EAAUtE,EAAOqE,EAAa7G,EAAc,QAAKA,EAAY,MAAK,GAAjD6G,CAAqD/G,IAAU,WAEnOqI,EAAe,CACfC,MAAO,MACPC,GAAIxI,EAAUqH,QACd1E,KAAMA,EACN8F,IAAKL,EAAU3C,QAAQgD,IAAML,EAAU3C,QAAQgD,IAAM,IAAM9F,EAAOA,EAClE+F,OAAQ,KACRC,cAWJ,SAA+BD,KACvBA,GAAYA,aAAkB,QAEjBb,IAAYa,IAE7B,EAAAlD,MAAA,yBAA+B8C,EAAcI,GAAUA,EAAOxD,UAAYwD,EAAOxD,SAASgC,UAC1FW,EAAaa,EACbE,EAAWF,MAjBX,sBAEI,IAAIG,GAAsB,IAAAzE,OAAM,yBAAN,CAAgCgE,GAGtDU,GAAgB,IAAA1E,OAAM,0BAAN,CAAiCgE,GACrD,OAAOS,GAAuBC,IAGtC,EAAAtD,MAAA,iBAAuB,UAAW8C,GAUlCzD,EAASC,KAAK,UAAW,CAAEW,QAAS6C,IACpCM,IACA,IAAIG,EAAa9E,EAAM+E,eAAeV,GA2BtC,SAASM,EAAWF,GAChB,IAAIO,EAAWhJ,EAAMiJ,OACjBC,EAAYjF,EAAGkF,QAASC,EAAYnF,EAAGkF,QACvCE,EAAc,CACdrE,KAAMyD,EACNjD,QAAS6C,GAETiB,EAAc,CACdC,WAAYL,EAAUvI,QACtB6I,WAAYJ,EAAUzI,QACtB8I,YAAaL,GAcjBJ,EAASU,MAAM,sBAAuBhH,GACtC,IAAIiH,EAASnC,EAAYwB,GAAU,SAAUY,GACzCA,EAAM/E,KAAK,cAAeyE,GAC1BM,EAAM/E,KAAK,UAAWwE,GACtBtB,EAAe6B,EAAOhF,GAAU,WAC5BsE,EAAUW,UACNlC,GACAA,EAAa+B,MAAM,gCAClB,IAAAI,WAAUhC,KAAmBA,GAAkB9H,EAAMzB,MAAMuJ,KAC5DhB,EAAc8C,MAvD9B,WAWI,GAVInC,IACA,EAAAlC,MAAA,iBAAuB,yBAA0BkC,EAAW5C,KAAK,YACjE4C,EAAWsC,SACXtC,EAAa,MAEbE,IACA,EAAApC,MAAA,iBAAuB,mBAAoB8C,GAC3CV,EAAaqC,WACbrC,EAAe,MAEfD,EAAW,CACX,IAAIuC,EAAcvC,EAAU7C,KAAK,eACjC,EAAAU,MAAA,iBAAuB,cAAe0E,GACtClC,EAAeL,GAAW,WACtBuC,EAAYR,YAAYI,UACxBpC,EAAa,QAEjBA,EAAaC,EACbA,EAAY,MAuCZwC,MAEJxC,EAAYiC,GACZhC,EAAeqB,GAWFU,MAAM,qBAAsBjB,GAAUb,GACnDD,EAAapJ,MAAMsJ,GA7EvB7H,EAAMP,IAAI,YAAY,WAClB,EAAA8F,MAAA,iBAAuB,2BAA4B8C,GACnDS,UAgFhB,OAAO/I,IAGf6D,EAAmBuG,QAAU,CAAC,WAAY,cAAe,eAAgB,QAAS,MAiElF,IAAIC,EAAuE,mBAA7C,YAAe,aAAwB,UAEjEC,EAAe,EAEnB,SAAStE,EAA4B9B,EAAIF,EAAc8B,EAAoB1H,EAAQ4G,KAE3E,IAAAuF,YAAWzE,EAAmB0E,WAC3BxF,EAAIE,SAASgB,WAAalB,EAAIE,SAASuF,oBAAsBJ,GAChEvE,EAAmB0E,UAEvB,IAAIE,GAAY,IAAAC,MAAK3F,EAAIM,MAAMsF,MAAMC,KACjCC,EAAc,CAAErK,KAAMqF,GAE1B,IAAI,IAAAyE,YAAWzE,EAAmBiF,mBAAoB,CAClD,IACIC,EADiB,IAAI,EAAAzF,eAAeP,EAAIM,MACH2F,cAAc,gBAAgBnG,KAyBvE1G,EAAOsB,IAAI,WAAYsE,EAAakH,UAAU,IAvB1B,SAAUC,GAG1B,GAAIA,IAAiBH,IAAsE,IAA/CG,EAAaC,UAAUC,QAAQX,GAA3E,CAEA,IAAIY,EAAWH,EAAaI,OAAO,MAC/BC,EAAaL,EAAaI,OAAO,QACjCE,EAAgB,SAAUC,GAAQ,OAAOA,EAAKC,aAC9CC,EAAWT,EAAaU,YAAY,MAAMC,IAAIL,GAAeM,OAAO,EAAAC,QAAS,IAC7EC,EAAad,EAAaU,YAAY,QAAQC,IAAIL,GAAeM,OAAO,EAAAC,QAAS,IAEjFE,EAAkBN,EAASnF,QAAO,SAAU0F,GAC5C,IAAIC,EAAMH,EAAWZ,QAAQc,GAC7B,OAAgB,IAATC,IAAeH,EAAWG,GAAKC,KAAKC,OAAOhB,EAASa,EAAM3D,IAAKgD,EAAWW,EAAM3D,QAG3F,GAAI0D,EAAgBK,OAAQ,CACxB,IAAIC,EAAgBN,EAAgBJ,KAAI,SAAUW,GAAK,OAAOA,EAAEjE,MAE5DkE,GAAY,IAAAjG,QAAO6E,GAAU,SAAUnK,EAAK6B,GAAO,OAAuC,IAAhCwJ,EAAcnB,QAAQrI,MACpF8C,EAAmBiF,kBAAkB2B,EAAWvB,OAGSL,IAGrE,IAAI,IAAAP,YAAWzE,EAAmB6G,WAAY,CAC1C,IAAIC,EAAOtC,IACPuC,EAAc,gBAEdC,EAAqB,SAAUC,GAC/B,QAASA,IAAWA,EAAMF,KAA6C,IAA7BE,EAAMF,GAAaD,IAAmBE,EAAmBC,EAAMC,oBAYzGC,EAAW,CAAE7B,QAASV,EAAU/H,MACpCvE,EAAOsB,IAAI,WAAYsE,EAAakJ,SAASD,GAV3B,SAAUF,GACxB,IAAInM,EACAuM,EAAOJ,EAAMF,GAAeE,EAAMF,IAAgB,GAKtD,OAJKC,EAAmBC,KACpBnM,EAAUsD,EAAGkJ,KAAKtH,EAAmB6G,UAAUI,KACvC7E,MAAK,SAAU/G,GAAO,OAAQgM,EAAIP,IAAgB,IAARzL,KAE/CP,IAGyDkK,KAG5E,YAAe,mBAAmB9K,UAAU,SAAU4D,GACtD,YAAe,mBAAmB5D,UAAU,SAAU6D,sWC9ZlDwJ,EAAiC,WACjC,SAASA,IACL,IAAIC,EAAQnQ,KACGA,KAAKoQ,SAAWvQ,EAAQ,GAAR,cAAwB,EACxCG,KAAKU,KAAO,CACvB,QACA,iBACA,YACA,SAAU2P,EAAOC,EAAgBC,GAI7B,OAHAJ,EAAMK,iBAAmBD,EAAUE,KAAOF,EAAUE,IAAI,qBAAuBF,EAAUG,IAAI,oBAC7FP,EAAME,MAAQA,EACdF,EAAMG,eAAiBA,EAChBH,IAyJnB,OApJAD,EAAgBrO,UAAU8O,eAAiB,SAAUnM,GACjDxE,KAAKoQ,SAAW5L,GAepB0L,EAAgBrO,UAAU+O,WAAa,SAAUrF,EAAQ6C,EAAQyC,GAC7D,IACIC,EAAa,SAAUxK,GAAU,OAAO,EAAAyK,SAAA,QAAiBzK,GAAQyE,MAAK,SAAUiG,GAAO,MAAO,CAAGC,SAAUD,OAC3GE,EAAc,SAAU5K,GAAU,OAAO,EAAAyK,SAAA,QAAiBzK,GAAQyE,MAAK,SAAUiG,GAAO,MAAO,CAAGjI,UAAWiI,OACjH,OAAO,IAAApE,WAAUrB,EAAO0F,UAClBH,EAAW9Q,KAAKmR,WAAW5F,EAAO0F,SAAU7C,KAC5C,IAAAxB,WAAUrB,EAAO6F,aACbN,EAAW9Q,KAAKqR,QAAQ9F,EAAO6F,YAAahD,KAC5C,IAAAxB,WAAUrB,EAAO+F,kBACbR,EAAW9Q,KAAKuR,aAAahG,EAAO+F,iBAAkBlD,EAAQyC,KAC9D,IAAAjE,WAAUrB,EAAOxC,WACbmI,EAAY3F,EAAOxC,YACnB,IAAA6D,WAAUrB,EAAO+B,mBACb4D,EAAYlR,KAAKwR,sBAAsBjG,EAAO+B,kBAAmBc,EAAQyC,IACzEC,EAbA,wBAwB1BZ,EAAgBrO,UAAUsP,WAAa,SAAUF,EAAU7C,GACvD,OAAO,IAAAhB,YAAW6D,GAAYA,EAAS7C,GAAU6C,GAWrDf,EAAgBrO,UAAUwP,QAAU,SAAUI,EAAKrD,GAG/C,OAFI,IAAAhB,YAAWqE,KACXA,EAAMA,EAAIrD,IACH,MAAPqD,EACO,KACPzR,KAAKoQ,SACEpQ,KAAKqQ,MACPK,IAAIe,EAAK,CAAEC,MAAO1R,KAAKsQ,eAAgBqB,QAAS,CAAEC,OAAQ,eAC1D7G,MAAK,SAAU8G,GAChB,OAAOA,EAASlK,QAGjB3H,KAAKwQ,iBAAiBiB,IAUjCvB,EAAgBrO,UAAU0P,aAAe,SAAUxR,EAAUqO,EAAQyC,GACjE,IAAIiB,EAAO,EAAAf,SAAA,mBAA4BhR,GACnCgS,GAAa,IAAAC,SAAQjS,IAAY,IAAAyN,MAAKzN,GAAYA,EAEtD,OADiB,IAAI,EAAAkS,WAAW,GAAIF,EAAYD,GAC9BpB,IAAIG,IAS1BX,EAAgBrO,UAAU2P,sBAAwB,SAAUzR,EAAUqO,EAAQyC,GAC1E,IAAIiB,EAAO,EAAAf,SAAA,mBAA4BhR,GACnCgS,GAAa,IAAAC,SAAQjS,IAAY,IAAAyN,MAAKzN,GAAYA,EAEtD,OADiB,IAAI,EAAAkS,WAAW,GAAIF,EAAYD,GAC9BpB,IAAIG,IAgB1BX,EAAgBrO,UAAUqQ,sBAAwB,SAAUzL,EAAQoK,EAAS9H,EAAWoJ,GACpFA,EAAWA,GAAY,GAEvB,IAAIC,EAASvS,EAAQ,GAAR,eAAyB,EAAI,KAAO,GAE7CwS,EAAQ,SAAUC,GAClB,IAAIC,GAAU,IAAAtJ,aAAYqJ,GAC1B,MAAO,aAAa7I,KAAK8I,GAAW,KAAOA,EAAUA,GA6BrDvP,EAQZ,SAA8BwC,GAC1B,IAAIgN,EAAU,EAAAzB,SAAA,cAAuBvL,EAAO,aAC5C,IAAKgN,IAAYA,EAAQpD,OACrB,MAAM,IAAIqD,MAAM,mCAAqCjN,EAAO,KAChE,OAAOgN,EAAQ7D,IAAI+D,GAAa9D,OAAO,EAAAC,QAAS,IAZhC8D,CAAqB5J,GAAW4F,KA3BzB,SAAUiE,GACzB,IAAIpN,EAAOoN,EAAMpN,KAAM0J,EAAO0D,EAAM1D,KAChC2D,EAAWR,EAAM7M,GAIrB,GAAIiB,EAAOqM,KAAKD,KAAcV,EAAS3M,GACnC,OAAOqN,EAAW,KAAOpM,EAAOqM,KAAKD,GAAY,IACrD,IAAIE,EAAcZ,EAAS3M,IAASA,EAGpC,GAAa,MAAT0J,EACA,OAAO2D,EAAW,OAAST,EAAS,YAAcW,EAAc,MAIpE,GAAa,MAAT7D,EAAc,CACd,IAAI8D,EAAMnC,EAAQ/C,cAAciF,GAC5BpS,EAAKqS,GAAOA,EAAIrL,KAChBhG,EAAQhB,GAAM,EAAAoQ,SAAA,mBAA4BpQ,IAAQ,GAGtD,OAAOkS,EAAW,cAAgBE,IADhB,IAAAf,SAAQrR,GAAM,KAAOA,EAAGyO,OAAS,GAAK,IAAM,IACA,IAAMzN,EAAKsR,KAAK,KAAO,KAGzF,OAAOJ,EAAW,KAAOT,EAAS,YAAcW,EAAc,OAEJE,KAAK,KAC/DjK,EAAYqJ,EAAMtJ,GACtB,MAAO,IAAMC,EAAY,IAAMhG,EAAQ,MAAQgG,EAAY,KAExDkH,EArKyB,GAiLhCwC,EAAc,SAAUQ,GACxB,OAAI,IAAAC,UAASD,EAAIE,kBACNC,EAAcH,EAAIE,kBACtBC,EAAcH,EAAIpQ,QAIzBuQ,EAAgB,SAAUC,GAC1B,OAAOC,OAAOC,KAAKF,GAAe,IAE7B3E,KAAI,SAAU9I,GAAO,MAAO,CAACA,EAAK,oBAAoB4D,KAAK6J,EAAYzN,QAEvEyD,QAAO,SAAUmK,GAAS,OAAO,IAAA7G,WAAU6G,KAAU,IAAAzB,SAAQyB,EAAM,OAEnE9E,KAAI,SAAU8E,GAAS,MAAO,CAAGjO,KAAMiO,EAAM,GAAG,IAAMA,EAAM,GAAIvE,KAAMuE,EAAM,GAAG,2ECzL7EC,EAAsB,SAAUC,GACvC,OAAO,SAA0BC,GAC7B,IAAIC,EAAOD,EAAYD,GACnBG,EAAwB,WAAbH,EAAwB,OAAS,KAOhD,OAAOE,EANP,SAA0BjE,EAAOnC,GAC7B,IACIsG,EADiB,IAAI,EAAA3L,eAAewH,EAAMlB,YAAYoF,IAC1BC,WAAWtG,EAAMuG,WAC7CtL,GAAS,IAAA5H,QAAOmT,EAAUF,GAAa,CAAEG,QAASzG,EAAOO,aAAc4B,IAC3E,OAAO,EAAAmB,SAAA,iBAA0B8C,EAAM7T,KAAM0I,SAEhByL,ICfrCC,EAAqC,WACrC,SAASA,EAAoBC,GAEzBrU,KAAKsU,cAAgB,GACrBtU,KAAKqU,kBAAoBA,EACzB,IAAIE,GAAM,IAAAvQ,KAAIqQ,IACd,IAAAG,sBAAqBD,EAAKvU,KAAMuU,EAAK,CAAC,eA8D1C,OAhDAH,EAAoBK,6BAA+B,SAAUC,GACzD,IAAIC,EAAWD,EAAOE,kBAAkB1F,KAAK,QAC7CyF,EAASE,OAAS,SAAUvF,GACxB,OAAY,MAALA,EAAYA,EAAEwF,WAAWC,QAAQ,WAAW,SAAUC,GAAK,MAAQ,CAAE,IAAK,KAAM,IAAK,OAAQA,MAAU1F,GAElHqF,EAASM,OAAS,SAAU3F,GACxB,OAAY,MAALA,EAAYA,EAAEwF,WAAWC,QAAQ,aAAa,SAAUC,GAAK,MAAQ,CAAE,KAAM,IAAK,MAAO,KAAMA,MAAU1F,IAIxH8E,EAAoBvS,UAAUqT,QAAU,aACxCd,EAAoBvS,UAAUsT,SAAW,SAAU3U,GAC/C,IAAI2P,EAAQnQ,KAEZ,OADAA,KAAKsU,cAAc7T,KAAKD,GACjB,WAAc,OAAO,IAAA4U,YAAWjF,EAAMmE,cAAjB,CAAgC9T,KAEhE4T,EAAoBvS,UAAUwT,UAAY,WACtC,IAAIA,EAAYrV,KAAKqU,kBAAkBgB,YAEvC,OADAA,GAAY,IAAAlC,UAASkC,GAAaA,EAAUC,QAAUD,IAClCrV,KAAKuV,SAASC,SAEtCpB,EAAoBvS,UAAU4T,SAAW,WACrC,OAAOzV,KAAK0V,YAAc1V,KAAK0V,UAAY1V,KAAK2V,SAASF,YAAczV,KAAK4V,QAAQC,SAAS/B,WAEjGM,EAAoBvS,UAAU4P,IAAM,SAAUqE,EAAQf,EAAStH,GAQ3D,YAPgB,IAAZsH,IAAsBA,GAAU,IAChC,IAAAnI,WAAUkJ,IACV9V,KAAK+V,UAAUtE,IAAIqE,GACnBf,GACA/U,KAAK+V,UAAUhB,UACftH,GACAzN,KAAK+V,UAAUtI,MAAMA,GAClBzN,KAAK+V,UAAUtE,OAE1B2C,EAAoBvS,UAAUmU,iBAAmB,SAAUC,EAAYF,EAAWR,EAAUI,EAAUC,GAClG,IAAIzF,EAAQnQ,KACZA,KAAK+V,UAAYA,EACjB/V,KAAKuV,SAAWA,EAChBvV,KAAK2V,SAAWA,EAChB3V,KAAK4V,QAAUA,EAEfK,EAAW1T,IAAI,0BAA0B,SAAU2T,GAAO,OAAO/F,EAAMmE,cAAcvT,SAAQ,SAAUJ,GAAM,OAAOA,EAAGuV,SACvH,IAAIC,GAAO,IAAAnS,KAAI+R,IAEf,IAAAvB,sBAAqB2B,EAAMnW,KAAMmW,EAAM,CAAC,UAAW,OAAQ,SAAU,UAErE,IAAA3B,sBAAqB2B,EAAMnW,KAAMmW,EAAM,CAAC,OAAQ,WAAY,UAEzD/B,EApE6B,0ECaxCvU,EAAQ,GAAR,OAAe,qBAAsB,IACrC,IAAIuW,EAAWvW,EAAQ,GAAR,OAAe,iBAAkB,CAAC,OAC7CwW,EAAWxW,EAAQ,GAAR,OAAe,iBAAkB,CAAC,mBAC7CyW,EAAUzW,EAAQ,GAAR,OAAe,mBAAoB,CAAC,mBAC9C0W,EAAY1W,EAAQ,GAAR,OAAe,kBAAmB,CAAC,mBAAoB,iBAAkB,uBACrF2W,EAAW3W,EAAQ,GAAR,OAAe,YAAa,CAAC,iBAAkB,kBAAmB,uBAE7E6U,GADW7U,EAAQ,GAAR,OAAe,mBAAoB,CAAC,cACtC,MAGb,SAAS4W,EAAkBpC,IAEvBK,EAAS1U,KAAK0U,OAAS,IAAI,EAAAgC,UACpBC,cAAgB,IAAI,IAAcjC,EAAOkC,cAAelC,EAAOmC,cAEtEnC,EAAOkC,cAAcE,UAAU,QAAS,MACxCpC,EAAOkC,cAAcE,UAAU,SAAUpD,EAAoB,WAC7DgB,EAAOkC,cAAcE,UAAU,WAAYpD,EAAoB,aAC/DgB,EAAOkC,cAAcE,UAAU,UAAWpD,EAAoB,YAC9DgB,EAAOqC,YAAY/M,WAAWgN,mBAAmB,OAAO,WAExDtC,EAAOuC,WAAW1L,OAAO2L,eAAgB,EACzC,IAAIC,EAAsBzC,EAAO0C,gBAAkB1C,EAAO2C,eAAiB,IAAIjD,EAAoBC,GAMnG,SAAS3T,EAAKqV,EAAWJ,EAAUC,EAASL,EAAUU,EAAY5F,EAAOC,GAIrE,OAHA6G,EAAmBnB,iBAAiBC,EAAYF,EAAWR,EAAUI,EAAUC,UACxElB,EAAe,cACfA,EAAa,KACbA,EAEX,OAXAN,EAAoBK,6BAA6BC,GAEjDA,EAAe,OAAIA,EACnBA,EAAa,KAAIhU,EACjBA,EAAKuM,QAAU,CAAC,YAAa,WAAY,UAAW,WAAY,aAAc,QAAS,kBAOhFyH,EA1BX+B,EAAkBxJ,QAAU,CAAC,qBA4B7B,IAAIqK,EAAiB,SAAUC,GAAe,MAAO,CACjD,oBACA,SAAUC,GACN,IAAIC,EAAUD,EAAK9C,OAAO6C,GAE1B,OADAE,EAAc,KAAI,WAAc,OAAOA,GAChCA,KAKf,SAASC,EAASnH,EAAWxJ,EAAI4Q,GAI7B,GAHA,EAAA5G,SAAA,UAAqBR,EACrB,EAAAQ,SAAA,GAAchK,GAETwM,OAAO1R,UAAUa,eAAeX,KAAKwO,EAAW,YACjD,IACIA,EAAUqH,QAAO,SAAUC,OAE/B,MAAOxS,GACHkL,EAAUuH,WAAa,cAAcrO,KAAKpE,GAASA,EAAMyP,YAKjE6C,EAAUf,cACLlG,MACA/B,KAAI,SAAUW,GAAK,OAAOA,EAAE0E,UAAU+D,eACtCnJ,OAAO,EAAAC,QAAS,IAChBvF,QAAO,SAAUgG,GAAK,MAAkB,aAAXA,EAAEwC,QAC/B/Q,SAAQ,SAAUiX,GAAc,OAAQA,EAAWlG,KAAOvB,EAAU0H,SAASD,EAAWE,UAAW3H,EAAUuH,aAQ/G,SAASK,EAAalC,GACzBA,EAAW1R,QAAO,WACd,EAAA8D,MAAA,wBA9BRqP,EAASzK,QAAU,CAAC,YAAa,KAAM,aA2BvCkL,EAAalL,QAAU,CAAC,cAMxBmJ,EAASrW,SAAS,YAAa0W,GAC/BH,EAAQvW,SAAS,aAAc,CAAC,oBAXL,SAAUqY,GAAY,OAAQA,EAASC,kBAAoB,IAAI,IAAkBD,MAY5G/B,EAAStW,SAAS,cAAeuX,EAAe,eAChDjB,EAAStW,SAAS,qBAAsB,CAAC,oBAAqB,WAAc,OAAO2U,EAAOE,qBAC1FyB,EAAStW,SAAS,oBAAoB,WAAc,OAAO,IAAImQ,KAC/DqG,EAAUxW,SAAS,iBAAkBuX,EAAe,kBACpDf,EAAUxW,SAAS,mBAAoBuX,EAAe,YACtDf,EAAUxW,SAAS,eAAgBuX,EAAe,sBAClDf,EAAUxW,SAAS,SAAU,CAAC,oBAfP,WAAc,OAAO,IAAAe,QAAO4T,EAAOiC,cAAe,CAAEjW,KAAM,WAAc,OAAOgU,EAAOmC,mBAgB7GN,EAAUrW,QAAQ,eAAgB,CAAC,YAAa,SAAUyX,GAAa,OAAOA,EAAUW,QAAQlK,UAChGoI,EAAStW,QAAQ,SAAS,WAAc,OAAOwU,EAAOqC,eACtDP,EAASiB,QAAQ,UAAU,WAAc,OAAO,EAAApP,SAChDmO,EAAS+B,IAAIJ,GACb9B,EAASkC,IAAI,CAAC,qBAAsB,SAAUC,OAC9CjC,EAAUgC,IAAI,CAAC,SAAU,SAAUE,OACnCnC,EAAQiC,IAAI,CAAC,aAAc,SAAUG,OACrCtC,EAASmC,IAAIb,GAEN,IAAIzD,EAAY,SAAU0E,GAO7B,OANaA,EAAIC,YAAYtP,OAAO,EAAAR,UAChB6F,KAAI,SAAU9I,GAC9B,IAAImS,EAAaW,EAAI7K,cAAcjI,GAEnC,MAAO,CAACA,EAAoB,WADX8S,EAAIE,UAAUb,GAAYc,MACJd,EAAWvU,QAAUuU,EAAWrQ,SAE7DiH,OAAO,EAAAmK,WAAY,2JC9GrC,SAASC,EAAeP,GACpB,IAAIQ,EAAW,SAAUxL,EAAOW,EAAQjO,GACpC,OAAOsY,EAAOS,GAAGzL,EAAOW,EAAQjO,IAGpC,OADA8Y,EAASE,WAAY,EACdF,EAaX,SAASG,EAAuBX,GAC5B,IAAIY,EAAiB,SAAU5L,EAAOW,EAAQjO,GAC1C,OAAOsY,EAAOa,SAAS7L,EAAOW,EAAQjO,IAG1C,OADAkZ,EAAeF,WAAY,EACpBE,EAxBXL,EAAe/L,QAAU,CAAC,UAkB1BmM,EAAuBnM,QAAU,CAAC,UAQlC,YAAe,mBAAmB3D,OAAO,UAAW0P,GAAgB1P,OAAO,kBAAmB8P,oKCpB1FG,EAA+B,WAC/B,SAASA,EAAc3C,EAAeC,GAClC7W,KAAK4W,cAAgBA,EACrB5W,KAAK6W,aAAeA,GACpB,IAAArC,uBAAqB,IAAAxQ,KAAIuV,EAAc1X,WAAY7B,MAAM,IAAAgE,KAAIhE,OAgHjE,OArBAuZ,EAAc1X,UAAUiV,UAAY,SAAUtR,EAAMgU,GAChD,OAAOxZ,KAAK4W,cAAcE,UAAUtR,EAAMgU,IAASxZ,MAEvDuZ,EAAc1X,UAAU4L,MAAQ,SAAUjI,EAAMiU,GAQ5C,OAPI,IAAAtG,UAAS3N,GACTiU,EAAajU,EAGbiU,EAAWjU,KAAOA,EAEtBxF,KAAK4W,cAAc8C,SAASD,GACrBzZ,MAOXuZ,EAAc1X,UAAU8X,UAAY,SAAUnZ,GAC1C,OAAOR,KAAK6W,aAAa8C,UAAUnZ,IAEhC+Y,EApHuB,6LCf3B,SAASK,IACZ,IAAIC,EAAkB,KACtB,OAAO,SAAU1R,EAAM2R,GAEnB,OADAD,EAAkBA,GAAmB,EAAA9I,SAAA,cAAuB,oBACrD,CAAC,IAAIgJ,EAAc5R,EAAM2R,EAAMD,KAI9C,IAAIG,EAAY,SAAUxG,EAAMyG,GAAO,OAAOzG,EAAK5E,QAAO,SAAUsL,EAAKrU,GAAO,OAAOqU,IAAO,IAAAtN,WAAUqN,EAAIpU,OAAU,IAY/G,SAASsU,EAAgB1M,GAE5B,IAAKA,EAAM2M,OACP,MAAO,GACX,IAAgKC,EAAW,CAAC,YAAa,WAAY,qBAAsBC,EAA7M,CAAC,mBAAoB,cAAe,WAAY,SAAU,SAAyKlY,OAApJ,CAAC,aAAc,qBAAsB,eAAgB,cAAiHmY,EAAcF,EAASjY,OAAOkY,GAIjS,IAAI,IAAA1N,WAAUa,EAAM+M,QAAUR,EAAUO,EAAa9M,GACjD,MAAM,IAAIgF,MAAM,UAAYhF,EAAMjI,KAAlB,4JAGL+U,EAAYjR,QAAO,SAAUzD,GAAO,OAAO,IAAA+G,WAAUa,EAAM5H,OAAUoN,KAAK,OAEzF,IAAIuH,EAAQ,GAAIC,EAAchN,EAAM+M,OAAS,CAAEE,UAAU,IAAAC,MAAKlN,EAAO8M,IAsBrE,OArBA,IAAAxZ,SAAQ0Z,GAAa,SAAUlP,EAAQ/F,GASnC,GAPAA,EAAOA,GAAQ,YAEX,IAAAsD,UAASyC,KACTA,EAAS,CAAExC,UAAWwC,IAE1BA,GAAS,IAAAzK,QAAO,GAAIyK,GAEhByO,EAAUK,EAAU9O,IAAWyO,EAAUM,EAAa/O,GACtD,MAAM,IAAIkH,MAAM,mBAAqB4H,EAASpH,KAAK,KAAO,UAAYqH,EAAYrH,KAAK,KAAO,mBAAqBzN,EAAO,IAAMiI,EAAMjI,KAAO,KAEjJ+F,EAAO9C,UAAY8C,EAAO9C,WAAa,WACvC8C,EAAOH,MAAQ,MACfG,EAAOxB,SAAW0D,EAClBlC,EAAOqP,MAAQpV,EACf,IAAIqV,EAAa,EAAAC,YAAA,sBAAkCvP,EAAOxB,SAAUwB,EAAOqP,OAC3ErP,EAAOwP,YAAcF,EAAWG,WAChCzP,EAAO0P,qBAAuBJ,EAAWK,oBACzCV,EAAMhV,GAAQ+F,KAEXiP,EAGX,IAAInP,EAAK,EAEL0O,EAA+B,WAC/B,SAASA,EAAc5R,EAAMJ,EAAU7H,GACnC,IAAIiQ,EAAQnQ,KACZA,KAAKmI,KAAOA,EACZnI,KAAK+H,SAAWA,EAChB/H,KAAKE,QAAUA,EACfF,KAAKmb,IAAM9P,IACXrL,KAAKob,QAAS,EACdpb,KAAKgI,YAAc,SAAUvB,EAAQoK,GACjC,OAAOV,EAAMpH,UACPoH,EAAMjQ,QAAQgS,sBAAsBzL,EAAQoK,EAASV,EAAMpH,UAAWoH,EAAMpI,SAASoK,UACrFhC,EAAMc,UAiCpB,OA9BA8I,EAAclY,UAAUwZ,KAAO,WAC3B,IAAIlL,EAAQnQ,KACR+G,EAAK,EAAAgK,SAAA,GACLF,EAAU,IAAI,EAAAzI,eAAepI,KAAKmI,MAClCiG,EAASpO,KAAKmI,KAAKyG,QAAO,SAAUsL,EAAK3L,GAAQ,OAAO,IAAAzN,QAAOoZ,EAAK3L,EAAK+M,eAAiB,IAC1FC,EAAW,CACXtK,SAAUlK,EAAGkJ,KAAKjQ,KAAKE,QAAQ0Q,WAAW5Q,KAAK+H,SAAUqG,EAAQyC,IACjE7P,WAAY+F,EAAGkJ,KAAKjQ,KAAKwb,cAAc3K,KAE3C,OAAO9J,EAAG0U,IAAIF,GAAUxQ,MAAK,SAAU2Q,GAInC,OAHA,EAAArT,MAAA,sBAA4B,SAAU8H,GACtCA,EAAMnP,WAAa0a,EAAQ1a,YAC3B,IAAAF,QAAOqP,EAAOuL,EAAQzK,UACfd,MAQf4J,EAAclY,UAAU2Z,cAAgB,SAAU3K,GAC9C,IAAI9Q,EAAWC,KAAK+H,SAAS4T,mBAC7B,KAAK,IAAAC,cAAa7b,GACd,OAAOC,KAAK+H,SAAS/G,WACzB,IAAI8Q,EAAO,EAAAf,SAAA,mBAA4BhR,GACnCgS,GAAa,IAAAC,SAAQjS,IAAY,IAAAyN,MAAKzN,GAAYA,EAEtD,OADiB,IAAI,EAAAkS,WAAW,GAAIF,EAAYD,GAC9BpB,IAAIG,IAEnBkJ,EA5CuB,wKC9C9B8B,EAAmC,WAEnC,SAASA,EAAiCnH,GACtC1U,KAAK0U,OAASA,EA2KlB,OAzKAmH,EAAkBC,kBAAoB,SAAUpH,EAAQqH,GACpD,OAAO,SAAUC,GAAS,OAAO,EAAAjL,SAAA,iBAA0BgL,EAAS,KAAM,CAAEE,OAAQD,EAAOE,aAAcxH,EAAO4D,QAAQlK,WAG5HyN,EAAkBha,UAAUnB,KAAO,WAC/B,IAAIuW,EAAajX,KAAK0U,OAAOuC,WAI7B,OAHAjX,KAAK0U,OAAOyH,UAAUC,QAAO,GACxBnF,EAAWoF,mBACZpF,EAAWqF,SACRtc,KAAK0U,OAAOyH,WAiCvBN,EAAkBha,UAAU0a,KAAO,SAAUC,GACzC,IAAIrM,EAAQnQ,KACZ,KAAK,IAAAoN,YAAWoP,GACZ,MAAM,IAAI/J,MAAM,6BACpB,IACI8J,EAAO,IAAI,EAAAE,aADH,WAAc,OAAOD,EAAO,EAAAzL,SAAA,UAAoBZ,EAAMuE,OAAO0C,mBACvC,EAAAsF,UAElC,OADA1c,KAAK0U,OAAOuC,WAAW0F,MAAMJ,KAAKA,GAC3Bvc,MA4BX6b,EAAkBha,UAAU+a,UAAY,SAAUL,GAC9C,IAAIpM,EAAQnQ,KACR6c,EAAW7c,KAAK0U,OAAOuC,WAAW0F,MACtC,IAAI,IAAA7T,UAASyT,GACTM,EAASD,UAAUL,OAElB,MAAI,IAAAnP,YAAWmP,GAIhB,MAAM,IAAI9J,MAAM,uCAHhBoK,EAASD,WAAU,WAAc,OAAOL,EAAK,EAAAxL,SAAA,UAAoBZ,EAAMuE,OAAO0C,oBAKlF,OAAOpX,MAwCX6b,EAAkBha,UAAUoO,KAAO,SAAU6M,EAAMf,GAK/C,QAJI,IAAA/J,SAAQ+J,KAAY,IAAA3O,YAAW2O,MAC/BA,EAAUF,EAAkBC,kBAAkB9b,KAAK0U,OAAQqH,IAE/D/b,KAAK0U,OAAOuC,WAAW0F,MAAM1M,KAAK6M,EAAMf,GACjC/b,MAgCX6b,EAAkBha,UAAUkb,eAAiB,SAAU9Q,GACnDjM,KAAK0U,OAAOuC,WAAW8F,eAAe9Q,IAEnC4P,EA9K2B,iJCKtC,UAAe,mBAAmB9b,SAAS,iBApB3C,WACI,IAAIid,GAAkB,EACtBhd,KAAKgd,gBAAkB,WACnBA,GAAkB,GAEtBhd,KAAKU,KAAO,CACR,gBACA,WACA,SAAUuc,EAAezZ,GACrB,OAAIwZ,EACOC,EAEJ,SAAUvV,GACb,OAAOlE,GAAS,WACZkE,EAAS,GAAGwV,mBACb,GAAG,8nBClBlBC,EAAkD,WAClD,IAAK,IAAIC,EAAI,EAAGC,EAAI,EAAGC,EAAKtb,UAAUoN,OAAQiO,EAAIC,EAAID,IAAKD,GAAKpb,UAAUqb,GAAGjO,OACxE,IAAImO,EAAI3b,MAAMwb,GAAII,EAAI,EAA3B,IAA8BH,EAAI,EAAGA,EAAIC,EAAID,IACzC,IAAK,IAAII,EAAIzb,UAAUqb,GAAIK,EAAI,EAAGC,EAAKF,EAAErO,OAAQsO,EAAIC,EAAID,IAAKF,IAC1DD,EAAEC,GAAKC,EAAEC,GACjB,OAAOH,GAaAK,EAAwB,iBAATlQ,MAAqBA,KAAKA,OAASA,MAAQA,MAC9C,iBAAX,EAAAmQ,GAAuB,EAAAA,EAAOC,SAAW,EAAAD,GAAU,EAAAA,QAC3D,EACAhe,EAAU+d,EAAK/d,SAAW,GACnBke,EAAWle,EAAQke,UAAYC,KAAK/W,MAAM3D,KAAK0a,MAC/CC,EAASpe,EAAQoe,QAAUD,KAAKE,UAAU5a,KAAK0a,MAC/Cjd,EAAUlB,EAAQkB,SAqc7B,SAAkBkZ,EAAKnP,EAAIqF,GACvB,IAAI,QAAQ8J,GACR,OAAOA,EAAIlZ,QAAQ+J,EAAIqF,GAC3BoD,OAAOC,KAAKyG,GAAKlZ,SAAQ,SAAU8E,GAAO,OAAOiF,EAAGmP,EAAIpU,GAAMA,OAvcvD/E,EAASyS,OAAO3Q,QAycpB,SAAiBub,GACpB,IAAK,IAAId,EAAI,EAAGA,EAAIrb,UAAUoN,OAAQiO,IAAK,CACvC,IAAIpD,EAAMjY,UAAUqb,GACpB,GAAKpD,EAGL,IADA,IAAIzG,EAAOD,OAAOC,KAAKyG,GACdyD,EAAI,EAAGA,EAAIlK,EAAKpE,OAAQsO,IAC7BS,EAAM3K,EAAKkK,IAAMzD,EAAIzG,EAAKkK,IAGlC,OAAOS,GAldAhP,EAAStP,EAAQsP,QAod5B,SAASiP,EAAQC,EAAIC,GACjB,GAAID,IAAOC,EACP,OAAO,EACX,GAAW,OAAPD,GAAsB,OAAPC,EACf,OAAO,EACX,GAAID,GAAOA,GAAMC,GAAOA,EACpB,OAAO,EACX,IAAIC,SAAYF,EAChB,GAAIE,WAD4BD,GACR,WAAPC,EACb,OAAO,EACX,IAyBeC,EAAIC,EAzBfC,EAAM,CAACL,EAAIC,GACf,IAAI,QAAI,KAAJ,CAAaI,GACb,OAuBeD,EAvBMH,GAuBVE,EAvBMH,GAwBdjP,SAAWqP,EAAGrP,QAEduP,EAAYH,EAAIC,GAAI7P,QAAO,SAAUgQ,EAAGC,GAAK,OAAOD,GAAKR,EAAQS,EAAE,GAAIA,EAAE,OAAQ,GAzBxF,IAAI,QAAI,KAAJ,CAAYH,GACZ,OAAOL,EAAGS,YAAcR,EAAGQ,UAC/B,IAAI,QAAI,KAAJ,CAAcJ,GACd,OAAOL,EAAGvJ,aAAewJ,EAAGxJ,WAChC,IAAI,QAAI,KAAJ,CAAgB4J,GAChB,OAAO,EAEX,GADiB,CAAC,KAAY,KAAS,KAAQ,MAChC/P,IAAI,MAAKC,QAAO,SAAUgQ,EAAGje,GAAM,OAAOie,KAAOje,EAAG+d,MAAS,GACxE,OAAO,EACX,IAAIlL,EAAO,GAEX,IAAK,IAAI3N,KAAOwY,EAAI,CAChB,IAAKD,EAAQC,EAAGxY,GAAMyY,EAAGzY,IACrB,OAAO,EACX2N,EAAK3N,IAAO,EAEhB,IAAK,IAAIA,KAAOyY,EACZ,IAAK9K,EAAK3N,GACN,OAAO,EAEf,OAAO,GApfJ,SAAS6W,EAASpN,GACrB,OAAOA,EAEJ,SAASrH,KAyDT,SAASuM,EAAqBuK,EAAQ1Y,EAAQ/C,EAAM0b,EAASC,QAC/C,IAAbA,IAAuBA,GAAW,GACtC,IAAIC,EAAe,SAAUC,GAAU,OAAOJ,IAASI,GAAQ7b,KAAKA,MAQpE,OADA0b,EAAUA,GAAWzL,OAAOC,KAAKuL,MAClBnQ,QAAO,SAAUsL,EAAK1U,GAPd,IAAU2Z,EAS7B,OADAjF,EAAI1U,GAAQyZ,GARiBE,EAQW3Z,EAPjC,WAEH,OADAa,EAAO8Y,GAAUD,EAAaC,GACvB9Y,EAAO8Y,GAAQhd,MAAM,KAAMH,aAKUkd,EAAa1Z,GACtD0U,IACR7T,GAMA,IAAI+Y,EAAU,SAAUhF,EAAQiF,GAAS,OAAOve,EAAOyS,OAAO/R,OAAO4Y,GAASiF,IAE1EC,GAAU,SACd,SAAkBC,EAAOtF,GAC5B,OAA+B,IAAxBsF,EAAMrR,QAAQ+L,MAMd7E,GAAa,SACjB,SAAqBmK,EAAOtF,GAC/B,IAAIhL,EAAMsQ,EAAMrR,QAAQ+L,GAGxB,OAFIhL,GAAO,GACPsQ,EAAMC,OAAOvQ,EAAK,GACfsQ,KAGAE,GAAS,SACb,SAAiBC,EAAK1b,GACzB,OAAO0b,EAAIjf,KAAKuD,GAAMA,KAGf2b,EAAW,SAAUC,GAC5B,OAAOA,EAAU9d,QAAQf,SAAQ,SAAUJ,GACzB,mBAAPA,GAAqBA,IAC5ByU,EAAWwK,EAAWjf,OAQvB,SAASV,EAASW,GAErB,IADA,IAAIif,EAAe,GACVC,EAAK,EAAGA,EAAK9d,UAAUoN,OAAQ0Q,IACpCD,EAAaC,EAAK,GAAK9d,UAAU8d,GAErC,IAAIC,EAAcjf,EAAOqB,WAAM,EAAQgb,EAAe,CAAC,IAAK0C,EAAaG,YACzE,OAAOlf,EAAOif,EAAapF,EAAK/Z,GAAQ,GAAI2S,OAAOC,KAAKuM,KAGrD,IAAIE,EAAS,SAAUC,EAAMC,GAAQ,OAAOrf,EAAOof,EAAMC,IAQzD,SAASC,EAAUC,EAAOC,GAC7B,IAAInY,EAAO,GAEX,IAAK,IAAIoY,KAAKF,EAAMlY,KAAM,CACtB,GAAIkY,EAAMlY,KAAKoY,KAAOD,EAAOnY,KAAKoY,GAC9B,MACJpY,EAAK1H,KAAK4f,EAAMlY,KAAKoY,IAEzB,OAAOpY,EAaJ,SAASwS,EAAKV,EAAKuG,GACtB,IAAIC,EAAU,GACd,IAAK,IAAIC,KAASzG,GACoB,IAA9BuG,EAAUtS,QAAQwS,KAClBD,EAAQC,GAASzG,EAAIyG,IAG7B,OAAOD,EAcJ,SAASE,EAAK1G,EAAKuG,GACtB,OAAOjN,OAAOC,KAAKyG,GACd3Q,QAAO,QAAIgW,EAAQkB,KACnB5R,QAAO,SAAUsL,EAAKrU,GAAO,OAASqU,EAAIrU,GAAOoU,EAAIpU,GAAOqU,IAAS,IASvE,SAAS5Q,EAAOsX,EAAYpgB,GAC/B,IAAIkf,GAAM,QAAQkB,GAAata,EAASoZ,EAAM,GAAK,GAC/CmB,EAASnB,EAAM,SAAUpQ,GAAK,OAAOhJ,EAAO7F,KAAK6O,IAAQ,SAAUA,EAAGzJ,GAAO,OAAQS,EAAOT,GAAOyJ,GAKvG,OAJAvO,EAAQ6f,GAAY,SAAUT,EAAM9C,GAC5B7c,EAAS2f,EAAM9C,IACfwD,EAAOV,EAAM9C,MAEd/W,EAGJ,SAASwa,EAAKF,EAAYpgB,GAC7B,IAAI8F,EAOJ,OANAvF,EAAQ6f,GAAY,SAAUT,EAAM9C,GAC5B/W,GAEA9F,EAAS2f,EAAM9C,KACf/W,EAAS6Z,MAEV7Z,EAGJ,IAAIya,EAASpS,EAEb,SAASA,EAAIiS,EAAYpgB,EAAU6F,GAGtC,OAFAA,EAASA,KAAW,QAAQua,GAAc,GAAK,IAC/C7f,EAAQ6f,GAAY,SAAUT,EAAM9C,GAAK,OAAQhX,EAAOgX,GAAK7c,EAAS2f,EAAM9C,MACrEhX,EAYJ,IAAI2a,EAAS,SAAU/G,GAAO,OAAO1G,OAAOC,KAAKyG,GAAKtL,KAAI,SAAU9I,GAAO,OAAOoU,EAAIpU,OAclFob,EAAW,SAAUf,EAAMgB,GAAQ,OAAOhB,GAAQgB,GAclDC,EAAW,SAAUjB,EAAMgB,GAAQ,OAAOhB,GAAQgB,GAUlDrS,EAAU,SAAUqR,EAAMgB,GAAQ,OAAOhB,EAAK9d,OAAO8e,IAWrDE,EAAW,SAAUlB,EAAMgB,GAClC,OAAO,QAAQA,GAAQhB,EAAK9d,OAAO8e,EAAKtS,OAAOwS,EAAU,KAAOC,EAAMnB,EAAMgB,IAMzE,SAASG,EAAM3B,EAAKzF,GAEvB,OADAyF,EAAIjf,KAAKwZ,GACFyF,EAGJ,IAAI4B,EAAQ,SAAUpH,EAAKqH,GAAS,OAAQjC,EAAQpF,EAAKqH,GAASrH,EAAMmH,EAAMnH,EAAKqH,IAW/EC,EAAS,SAAU9B,GAAO,OAAOA,EAAI9Q,OAAOC,EAAS,KAyBrD4S,EAkBJ,SAAkBC,EAAgBC,GAErC,YADe,IAAXA,IAAqBA,EAAS,kBAC3B,SAAU1H,GACb,IAAI3T,EAASob,EAAezH,GAC5B,IAAK3T,EACD,MAAM,IAAImM,OAAM,QAAWkP,GAAUA,EAAO1H,GAAO0H,GAEvD,OAAOrb,IA2BR,SAASqY,IAEZ,IADA,IAAIhd,EAAO,GACFme,EAAK,EAAGA,EAAK9d,UAAUoN,OAAQ0Q,IACpCne,EAAKme,GAAM9d,UAAU8d,GAEzB,GAAoB,IAAhBne,EAAKyN,OACL,MAAO,GAwBX,IAvBA,IAAIwS,EAAcjgB,EAAKiN,QAAO,SAAUiT,EAAKnC,GAAO,OAAOoC,KAAKD,IAAInC,EAAItQ,OAAQyS,KAAS,kBACrFvb,EAAS,GACTyb,EAAU,SAAU1E,GAGpB,OAAQ1b,EAAKyN,QACT,KAAK,EACD9I,EAAO7F,KAAK,CAACkB,EAAK,GAAG0b,KACrB,MACJ,KAAK,EACD/W,EAAO7F,KAAK,CAACkB,EAAK,GAAG0b,GAAI1b,EAAK,GAAG0b,KACjC,MACJ,KAAK,EACD/W,EAAO7F,KAAK,CAACkB,EAAK,GAAG0b,GAAI1b,EAAK,GAAG0b,GAAI1b,EAAK,GAAG0b,KAC7C,MACJ,KAAK,EACD/W,EAAO7F,KAAK,CAACkB,EAAK,GAAG0b,GAAI1b,EAAK,GAAG0b,GAAI1b,EAAK,GAAG0b,GAAI1b,EAAK,GAAG0b,KACzD,MACJ,QACI/W,EAAO7F,KAAKkB,EAAKgN,KAAI,SAAU4Q,GAAS,OAAOA,EAAMlC,SAIxDA,EAAI,EAAGA,EAAIuE,EAAavE,IAC7B0E,EAAQ1E,GAEZ,OAAO/W,EAsBJ,SAASyS,EAAWmH,EAAM8B,GAC7B,IAAInc,EAAKrB,EAGT,IAFI,QAAQwd,KACRnc,EAAMmc,EAAY,GAAIxd,EAAQwd,EAAY,MACzC,QAASnc,GACV,MAAM,IAAI4M,MAAM,oCAEpB,OADAyN,EAAKra,GAAOrB,EACL0b,EAGJ,SAAS1S,EAAKkS,GACjB,OAAQA,EAAItQ,QAAUsQ,EAAIA,EAAItQ,OAAS,SAAO+E,EAK3C,SAAS8N,EAAKC,EAAKC,GAKtB,OAJIA,GACA5O,OAAOC,KAAK2O,GAAMphB,SAAQ,SAAU8E,GAAO,cAAcsc,EAAKtc,MAC7Dsc,IACDA,EAAO,IACJrhB,EAAOqhB,EAAMD,GA6DjB,IAAIE,EAA2B,SAAU3e,GAAW,OAAOA,EAAQ4e,OAAM,SAAUC,GAAK,OAAO,MAAS7e,GACpG8e,EAAkB,SAAUld,GAAS,OAAO+c,EAAyB,cAAmB/c,qHCxhBnG,IAGWmd,EAAW,SAAU/K,EAASgL,GACrC,OAAOA,EAAQ7T,QAAO,SAAUsL,EAAKrU,GAAO,OAASqU,EAAIrU,IAJtC6c,EAIoDjL,EAAU,IAAM5R,EAAM,KAJzD,WACpC,MAAM,IAAI4M,MAAM,yBAA2BiQ,EAAS,kEAGiDxI,EAJ5F,IAAUwI,IAI2F,KAE9G3R,EAAW,CACXhK,QAAIoN,EACJ5D,eAAW4D,mGCyCf,IAAIwO,EAAsB,WACtB,SAASA,EAAKC,GACV5iB,KAAK4iB,KAAOA,EACZ5iB,KAAK6iB,KAAOD,EAAKE,MAAM,KACvB,IAAIC,EAAe/iB,KAAK4iB,KACnBE,MAAM,KACNnU,KAAI,SAAUqU,GACf,MAAY,OAARA,EACO,qBACC,MAARA,EACO,WACJ,MAAQA,KAEd/P,KAAK,IACVjT,KAAKijB,OAAS,IAAI9Z,OAAO,IAAM4Z,EAAe,KAalD,OAVAJ,EAAKzJ,GAAK,SAAU0J,GAChB,QAAS,SAASnZ,KAAKmZ,IAG3BD,EAAKxR,WAAa,SAAUyR,GACxB,OAAOD,EAAKzJ,GAAG0J,GAAQ,IAAID,EAAKC,GAAQ,MAE5CD,EAAK9gB,UAAUqhB,QAAU,SAAU1d,GAC/B,OAAOxF,KAAKijB,OAAOE,KAAK,IAAM3d,IAE3Bmd,EA3Bc,+MC1CzB,IAAIxF,EAAkD,WAClD,IAAK,IAAIC,EAAI,EAAGC,EAAI,EAAGC,EAAKtb,UAAUoN,OAAQiO,EAAIC,EAAID,IAAKD,GAAKpb,UAAUqb,GAAGjO,OACxE,IAAImO,EAAI3b,MAAMwb,GAAII,EAAI,EAA3B,IAA8BH,EAAI,EAAGA,EAAIC,EAAID,IACzC,IAAK,IAAII,EAAIzb,UAAUqb,GAAIK,EAAI,EAAGC,EAAKF,EAAErO,OAAQsO,EAAIC,EAAID,IAAKF,IAC1DD,EAAEC,GAAKC,EAAEC,GACjB,OAAOH,GA2CJ,SAAS6F,EAAMziB,GAClB,OAAO,SAAS0iB,IACZ,GAAIrhB,UAAUoN,QAAUzO,EAAGyO,OACvB,OAAOzO,EAAGwB,MAAMnC,KAAMgC,WAE1B,IAAIL,EAAOC,MAAMC,UAAUC,MAAMC,KAAKC,WACtC,OAAOqhB,EAAQ/f,KAAKnB,MAAMkhB,EAASlG,EAAe,CAACnd,MAAO2B,KAS3D,SAAS2hB,IACZ,IAAI3hB,EAAOK,UACPuhB,EAAQ5hB,EAAKyN,OAAS,EAC1B,OAAO,WAEH,IADA,IAAIiO,EAAIkG,EAAOjd,EAAS3E,EAAK4hB,GAAOphB,MAAMnC,KAAMgC,WACzCqb,KACH/W,EAAS3E,EAAK0b,GAAGtb,KAAK/B,KAAMsG,GAChC,OAAOA,GASR,SAASkd,IAEZ,IADA,IAAIC,EAAQ,GACH3D,EAAK,EAAGA,EAAK9d,UAAUoN,OAAQ0Q,IACpC2D,EAAM3D,GAAM9d,UAAU8d,GAE1B,OAAOwD,EAAQnhB,MAAM,KAAM,GAAGL,MAAMC,KAAKC,WAAWge,WAQjD,IAAI0D,EAAO,SAAUle,GAAQ,OAAO,SAAUyU,GAAO,OAAOA,GAAOA,EAAIzU,KAQnEme,EAASP,GAAM,SAAU5d,EAAMoe,EAAM3J,GAAO,OAAOA,GAAOA,EAAIzU,KAAUoe,KASxE3c,EAAQ,SAAUzB,GAAQ,OAAOge,EAAKrhB,MAAM,KAAMqD,EAAKsd,MAAM,KAAKnU,IAAI+U,KAKtEG,EAAM,SAAUljB,GAAM,OAAO,WAEpC,IADA,IAAIgB,EAAO,GACFme,EAAK,EAAGA,EAAK9d,UAAUoN,OAAQ0Q,IACpCne,EAAKme,GAAM9d,UAAU8d,GAEzB,OAAQnf,EAAGwB,MAAM,KAAMR,KAMpB,SAASmiB,EAAIC,EAAKC,GACrB,OAAO,WAEH,IADA,IAAIriB,EAAO,GACFme,EAAK,EAAGA,EAAK9d,UAAUoN,OAAQ0Q,IACpCne,EAAKme,GAAM9d,UAAU8d,GAEzB,OAAOiE,EAAI5hB,MAAM,KAAMR,IAASqiB,EAAI7hB,MAAM,KAAMR,IAOjD,SAASsiB,EAAGF,EAAKC,GACpB,OAAO,WAEH,IADA,IAAIriB,EAAO,GACFme,EAAK,EAAGA,EAAK9d,UAAUoN,OAAQ0Q,IACpCne,EAAKme,GAAM9d,UAAU8d,GAEzB,OAAOiE,EAAI5hB,MAAM,KAAMR,IAASqiB,EAAI7hB,MAAM,KAAMR,IASjD,IAAI8Z,EAAM,SAAUsI,GAAO,OAAO,SAAUrE,GAAO,OAAOA,EAAI9Q,QAAO,SAAUgQ,EAAGtP,GAAK,OAAOsP,KAAOmF,EAAIzU,MAAO,KAE5G4U,EAAM,SAAUH,GAAO,OAAO,SAAUrE,GAAO,OAAOA,EAAI9Q,QAAO,SAAUgQ,EAAGtP,GAAK,OAAOsP,KAAOmF,EAAIzU,MAAO,KAE5G4J,EAAK,SAAUiL,GAAQ,OAAO,SAAUlK,GAC/C,OAAe,MAAPA,GAAeA,EAAImK,cAAgBD,GAASlK,aAAekK,IAK5DngB,EAAM,SAAUqgB,GAAK,OAAO,WAAc,OAAOA,IA4CrD,SAASC,EAAQC,GACpB,OAAO,SAAUjV,GACb,IAAK,IAAI+N,EAAI,EAAGA,EAAIkH,EAAOnV,OAAQiO,IAC/B,GAAIkH,EAAOlH,GAAG,GAAG/N,GACb,OAAOiV,EAAOlH,GAAG,GAAG/N,uRCjNhCkV,EAAQjR,OAAO1R,UAAUiT,SACzB2P,EAAM,SAAU5F,GAAK,OAAO,SAAUvP,GAAK,cAAcA,IAAMuP,IACxD6F,EAAcD,EAAI,aAClB7X,GAAY,QAAI8X,GAChBC,EAAS,SAAUC,GAAK,OAAa,OAANA,GAC/BC,GAAoB,IAAAZ,IAAGU,EAAQD,GAC/BtX,EAAaqX,EAAI,YACjBK,EAAWL,EAAI,UACf3b,EAAW2b,EAAI,UACftR,EAAW,SAAU7D,GAAK,OAAa,OAANA,GAA2B,iBAANA,GACtD0C,EAAUpQ,MAAMoQ,QAChB+S,EAAS,SAAWzV,GAAK,MAAyB,kBAAlBkV,EAAMziB,KAAKuN,IAC3C0V,EAAW,SAAW1V,GAAK,MAAyB,oBAAlBkV,EAAMziB,KAAKuN,IAOjD,SAASsM,EAAa5X,GACzB,GAAIgO,EAAQhO,IAAQA,EAAIoL,OAAQ,CAC5B,IAAI6V,EAAOjhB,EAAIlC,MAAM,GAAI,GAAI0L,EAAOxJ,EAAIlC,OAAO,GAC/C,QAASmjB,EAAK3b,QAAO,QAAIR,IAAWsG,QAAU5B,EAAKlE,QAAO,QAAI8D,IAAagC,QAE/E,OAAOhC,EAAWpJ,GAOf,IAAIkhB,GAAY,QAAI/R,GAAU,SAAK,QAAK,QAAS/F,uKCvCpD+X,EAAuB,WACvB,SAASA,EAAMC,EAAQC,QACJ,IAAXD,IAAqBA,EAAS,SACnB,IAAXC,IAAqBA,EAAS,MAClCrlB,KAAKolB,OAASA,EACdplB,KAAKqlB,OAASA,EACdrlB,KAAKslB,gBAAkB,GACvBtlB,KAAKulB,SAAU,QAAOvlB,KAAKslB,iBAqC/B,OAnCAH,EAAMtjB,UAAU2jB,QAAU,SAAUrF,GAChC,IAAIsF,EAAQzlB,KAAKolB,OAIjB,OAHAK,EAAMhlB,KAAK0f,GACPngB,KAAKqlB,QAAUI,EAAMrW,OAASpP,KAAKqlB,QACnCrlB,KAAK0lB,QACFvF,GAEXgF,EAAMtjB,UAAU6jB,MAAQ,WACpB,IAAIvF,EAAOngB,KAAKolB,OAAOnjB,QAEvB,OADAjC,KAAKslB,gBAAgBvkB,SAAQ,SAAUJ,GAAM,OAAOA,EAAGwf,MAChDA,GAEXgF,EAAMtjB,UAAU8jB,QAAU,WACtB,GAAI3lB,KAAK4lB,OACL,OAAO5lB,KAAKolB,OAAO5F,OAAO,EAAG,GAAG,IAExC2F,EAAMtjB,UAAUgkB,MAAQ,WACpB,IAAIC,EAAU9lB,KAAKolB,OAEnB,OADAplB,KAAKolB,OAAS,GACPU,GAEXX,EAAMtjB,UAAU+jB,KAAO,WACnB,OAAO5lB,KAAKolB,OAAOhW,QAEvB+V,EAAMtjB,UAAUgL,OAAS,SAAUsT,GAC/B,IAAIlR,EAAMjP,KAAKolB,OAAOlX,QAAQiS,GAC9B,OAAOlR,GAAO,GAAKjP,KAAKolB,OAAO5F,OAAOvQ,EAAK,GAAG,IAElDkW,EAAMtjB,UAAUkkB,SAAW,WACvB,OAAO/lB,KAAKolB,OAAOplB,KAAKolB,OAAOhW,OAAS,IAE5C+V,EAAMtjB,UAAUmkB,SAAW,WACvB,GAAIhmB,KAAK4lB,OACL,OAAO5lB,KAAKolB,OAAO,IAEpBD,EA5Ce,4KCKtBc,EAAkB,CAAEC,IAAK,KAAM7gB,MAAO,KAAM8gB,MAAO,MA4B5CC,EAXyB,oBAAbC,UAA4BA,SAASC,cAA0C,IAA1BD,SAASC,aAEtEC,QAAUA,OAAOC,QAlBhC,SAAoBA,GAChB,IAAIC,EAAQ,SAAU9lB,GAAM,OAAO+lB,SAAS7kB,UAAUyB,KAAKvB,KAAKpB,EAAI6lB,IACpE,MAAO,CACHN,IAAKO,EAAMD,EAAQN,KACnB7gB,MAAOohB,EAAMD,EAAQN,KACrBC,MAAOM,EAAMD,EAAQN,MAaaS,CAAWJ,OAAOC,SAAWP,EAEzDO,QAAQL,OAAUK,QAAQnhB,MAIzBmhB,QAhBf,SAAyBA,GACrB,IAAIN,EAAMM,EAAQN,IAAI5iB,KAAKkjB,GAG3B,MAAO,CAAEN,IAAKA,EAAK7gB,MAFPmhB,EAAQnhB,MAAQmhB,EAAQnhB,MAAM/B,KAAKkjB,GAAWN,EAEzBC,MADrBK,EAAQL,MAAQK,EAAQL,MAAM7iB,KAAKkjB,GAAWN,GAU/CU,CAAgBJ,ieCRxB,SAASK,EAAUC,EAAK9V,GAC3B,OAAIA,EAAI5B,QAAU0X,EACP9V,EACJA,EAAI+V,OAAO,EAAGD,EAAM,GAAK,MAW7B,SAASE,EAAU5X,EAAQ4B,GAC9B,KAAOA,EAAI5B,OAASA,GAChB4B,GAAO,IACX,OAAOA,EAEJ,SAAS/H,EAAYqJ,GACxB,OAAOA,EACFyC,QAAQ,YAAY,SAAUkS,GAAM,OAAOA,EAAGC,iBAC9CnS,QAAQ,YAAY,SAAUkS,GAAM,MAAO,IAAMA,EAAGC,iBAEtD,SAASC,EAAiBxmB,GAC7B,IAAIymB,EAAQC,EAAW1mB,GACnB2mB,EAAqBF,EAAMpL,MAAM,8BACjCwI,EAAQ8C,EAAqBA,EAAmB,GAAKF,EACrDjI,EAASxe,EAAS,MAAK,GAC3B,OAAIwe,GAAUqF,EAAMxI,MAAM,eACf,YAAcmD,EAASqF,EAAMuC,OAAO,GAExCvC,EAEJ,SAAS6C,EAAW1mB,GACvB,IAAI4mB,GAAM,QAAQ5mB,GAAMA,EAAGmB,OAAO,GAAG,GAAKnB,EAC1C,OAAQ4mB,GAAOA,EAAIzS,YAAe,YAEtC,IAAI0S,EAAc,uBAIdC,GAAmB,QAAQ,CAC3B,CAAC,MAAa,QAAI,cAClB,CAAC,MAAQ,QAAI,SACb,CAAC,MAAW,QAAI,cAChB,CAACD,EAAa,SAAUlY,GAAK,OAAOA,EAAEoY,qBAAqB5S,aAC3D,CARc,SAAUmF,GACxB,OAAO,QAASA,MAAS,QAAQA,IAAQA,EAAImK,cAAgB7Q,SAAU,QAAW0G,EAAInF,WAOxE,SAAUxF,GAAK,OAAOA,EAAEwF,aACtC,CAAC,KAAcqS,GACf,EAAC,SAAI,GAAO,QAET,SAASjJ,EAAU0G,GACtB,IAAI+C,EAAO,GACX,SAASC,EAAOpjB,GACZ,IAAI,QAASA,GAAQ,CACjB,IAA6B,IAAzBmjB,EAAKzZ,QAAQ1J,GACb,MAAO,iBACXmjB,EAAKlnB,KAAK+D,GAEd,OAAOijB,EAAiBjjB,GAE5B,OAAI,QAAYogB,GAILgD,EAAOhD,GAEX5G,KAAKE,UAAU0G,GAAG,SAAU/e,EAAKrB,GAAS,OAAOojB,EAAOpjB,MAAWuQ,QAAQ,OAAQ,KAGvF,IAAI8S,EAAoB,SAAUC,GAAQ,OAAO,SAAU9W,GAC9D,IAAKA,EACD,MAAO,CAAC,GAAI,IAChB,IAAI/B,EAAM+B,EAAI9C,QAAQ4Z,GACtB,OAAa,IAAT7Y,EACO,CAAC+B,EAAK,IACV,CAACA,EAAI+V,OAAO,EAAG9X,GAAM+B,EAAI+V,OAAO9X,EAAM,MAGtC8Y,EAAuB,SAAU/W,GAAO,OAAOA,EAAI+D,QAAQ,WAAY,KACvEiT,EAAYH,EAAkB,KAC9BI,EAAaJ,EAAkB,KAC/BK,EAAaL,EAAkB,KAC/BM,EAAc,SAAUnX,GAAO,OAAQA,EAAMA,EAAI+D,QAAQ,KAAM,IAAM,IAWzE,SAASqT,EAAaC,GACzB,IAAIC,EAAK,IAAInf,OAAO,IAAMkf,EAAQ,IAAK,KACvC,OAAO,SAAUrX,GAAO,OAAOA,EAAI8R,MAAMwF,GAAIhf,OAAO,OAcjD,SAASif,EAAerO,EAAK5K,GAChC,OAAI,SAAS,QAAK4K,MAAS,QAAS5K,GACzB4K,EAAIpY,MAAM,GAAI,GAAGM,QAAO,QAAK8X,GAAO5K,IACxC,QAAM4K,EAAK5K,0GCpElBkZ,iQA3BJ,SAASC,EAAaC,GAClB,IAAKA,EACD,MAAO,oBACX,IAAIjb,EAAQib,EAAOC,gBAAkBD,EAAOC,gBAAgBnjB,MAAQ,SAAW,SAC/E,MAAO,YAAckjB,EAAOrd,GAAK,IAAMqd,EAAOtd,MAAQ,IAAMsd,EAAOpd,IAAM,KAAOod,EAAOljB,KAAO,IAAMiI,EAAQ,KAOhH,SAASmb,EAAchW,GACnB,OAAO,QAASA,GAAS4V,EAAS5V,GAAS4V,EAASA,EAAS5V,KAgBjE,SAAW4V,GACPA,EAASA,EAAkB,QAAI,GAAK,UACpCA,EAASA,EAAqB,WAAI,GAAK,aACvCA,EAASA,EAAe,KAAI,GAAK,OACjCA,EAASA,EAAiB,OAAI,GAAK,SACnCA,EAASA,EAAqB,WAAI,GAAK,aAL3C,CAMGA,IAAaA,EAAW,KAE3B,IAAIK,GAAO,QAAM,OACbC,GAAO,QAAM,cACbC,EAAW,SAAUnZ,GAAS,MAAO,eAAiBiZ,EAAKjZ,GAAS,IAAMkZ,EAAKlZ,IA6J/EvH,EAAQ,IAzJe,WAEvB,SAAS2gB,IAELhpB,KAAKipB,SAAW,GAChBjpB,KAAKkpB,mBAAqB,EAwI9B,OArIAF,EAAMnnB,UAAUsnB,KAAO,SAAU7T,EAAS8T,GACtC,IAAIjZ,EAAQnQ,KACPopB,EAAWha,SACZga,EAAa7V,OAAOC,KAAKgV,GACpB7Z,KAAI,SAAU6O,GAAK,OAAO6L,SAAS7L,EAAG,OACtClU,QAAO,SAAUkU,GAAK,OAAQ8L,MAAM9L,MACpC7O,KAAI,SAAU9I,GAAO,OAAO2iB,EAAS3iB,OAE9CujB,EAAWza,IAAIia,GAAe7nB,SAAQ,SAAUwoB,GAAY,OAAQpZ,EAAM8Y,SAASM,GAAYjU,MAEnG0T,EAAMnnB,UAAU2nB,OAAS,WAErB,IADA,IAAIJ,EAAa,GACRtJ,EAAK,EAAGA,EAAK9d,UAAUoN,OAAQ0Q,IACpCsJ,EAAWtJ,GAAM9d,UAAU8d,GAE/B9f,KAAKmpB,MAAK,EAAMC,IAEpBJ,EAAMnnB,UAAU4nB,QAAU,WAEtB,IADA,IAAIL,EAAa,GACRtJ,EAAK,EAAGA,EAAK9d,UAAUoN,OAAQ0Q,IACpCsJ,EAAWtJ,GAAM9d,UAAU8d,GAE/B9f,KAAKmpB,MAAK,EAAOC,IAWrBJ,EAAMnnB,UAAUyT,QAAU,SAAUiU,GAChC,QAASvpB,KAAKipB,SAASL,EAAcW,KAGzCP,EAAMnnB,UAAU6nB,qBAAuB,SAAU9Z,GACxC5P,KAAKsV,QAAQkT,EAASmB,aAE3B,QAAgBZ,EAASnZ,GAAS,kBAAmB,QAAUA,KAGnEoZ,EAAMnnB,UAAU+nB,uBAAyB,SAAUha,GAC1C5P,KAAKsV,QAAQkT,EAASmB,aAE3B,QAAgBZ,EAASnZ,GAAS,kBAAmB,QAAUA,KAGnEoZ,EAAMnnB,UAAUgoB,oBAAsB,SAAUC,EAAMla,EAAOzP,GACzD,GAAKH,KAAKsV,QAAQkT,EAASuB,MAA3B,CAEA,IAAIxpB,GAAQ,QAAM,qBAAN,CAA4BJ,IAAY,WAAY0Q,GAAU,QAAM,+BAAN,CAAsC1Q,KAAY,QAAM,oBAAN,CAA2BA,IAAY,UAAWqF,GAAO,QAAiBskB,EAAKE,eAAexpB,UAC1N,QAAgBuoB,EAASnZ,GAAS,eAAiBrP,EAAQ,aAAesQ,EAAU,MAAO,QAAU,IAAKrL,MAG9GwjB,EAAMnnB,UAAUooB,gBAAkB,SAAUC,EAAYta,EAAOua,GACtDnqB,KAAKsV,QAAQkT,EAASuB,OAE3B,QAAgBhB,EAASnZ,GAAS,0BAA2B,QAAU,KAAK,QAAUsa,MAG1FlB,EAAMnnB,UAAUuoB,iBAAmB,SAAUjiB,EAAM8H,EAAML,GAChD5P,KAAKsV,QAAQkT,EAAS6B,UAE3B,QAAgBtB,EAASnZ,GAAS,uBAAyBzH,EAAO,KAAO8H,EAAO,MAGpF+Y,EAAMnnB,UAAUyoB,wBAA0B,SAAUtS,EAAYpI,GACvD5P,KAAKsV,QAAQkT,EAAS6B,UAE3B,QAAgBtB,EAASnZ,GAAS,gCAAkCoI,EAAa,SAAU,QAAU,KAAK,QAAUA,EAAWrQ,SAGnIqhB,EAAMnnB,UAAU0oB,WAAa,SAAUC,EAAQ5a,GACtC5P,KAAKsV,QAAQkT,EAASmB,aAE3B,QAAgBZ,EAASnZ,GAAS,kBAAmB,QAAUA,GAAS,aAAe4a,IAG3FxB,EAAMnnB,UAAU4oB,aAAe,SAAUC,EAAY9a,GAC5C5P,KAAKsV,QAAQkT,EAASmB,aAE3B,QAAgBZ,EAASnZ,GAAS,kBAAmB,QAAUA,GAAS,kBAAoB8a,EAAWllB,OAG3GwjB,EAAMnnB,UAAU8oB,iBAAmB,SAAUpqB,EAAOqqB,EAAUvL,QAC5C,IAAVA,IAAoBA,EAAQ,IAC3Brf,KAAKsV,QAAQkT,EAASqC,SAE3B,QAAgB,aAAc,QAAU,GAAItqB,GAAS,IAAMkoB,EAAamC,GAAYvL,IAGxF2J,EAAMnnB,UAAUipB,yBAA2B,SAAUF,EAAU/Z,GACtD7Q,KAAKsV,QAAQkT,EAASqC,SAE3B7qB,KAAK2qB,iBAAiB,WAAYC,EAAU,kCAAoC/Z,EAAU,MAG9FmY,EAAMnnB,UAAUkpB,gBAAkB,SAAUH,EAAUpjB,GAC7CxH,KAAKsV,QAAQkT,EAASqC,SAE3B7qB,KAAK2qB,iBAAiB,OAAQC,EAAU,WAAY,QAAU,IAAKpjB,KAGvEwhB,EAAMnnB,UAAUmpB,cAAgB,SAAUC,GACtC,GAAKjrB,KAAKsV,QAAQkT,EAAS0C,YAA3B,CAEA,IAAIC,EAAY,uBAEZC,EAAUH,EACTtc,KAAI,SAAU0c,GACf,IAAIC,EACA7kB,EAAS4kB,EAAG5kB,OAAQiE,EAAa2gB,EAAG3gB,WACpC6gB,EAAM9kB,GAAUA,EAAO6E,IACvBzD,EAAM6C,GAAcA,EAAW3C,SAASgC,SAASvE,KAAO,MAAQkF,EAAW3C,SAAS6S,MAAQ,IAChG,OAAO0Q,EAAK,IAAOH,GAAaI,EAAKD,EAPzB,iCAOyCzjB,EAAKyjB,KAEzDE,MAAK,SAAU/N,EAAGmB,GAAK,OAAQnB,EAAE0N,IAAc,IAAIM,cAAc7M,EAAEuM,IAAc,OACtF,UAAkBC,KAGtBpC,EAAMnnB,UAAU6pB,sBAAwB,SAAUnrB,EAAOmK,GAChD1K,KAAKsV,QAAQkT,EAAS0C,aAE3B,QAAgB,eAAiB3qB,EAAQ,IAzK1B,SAAUmK,GAC7B,IAAIoP,EAAOpP,EAAW3C,SAClB0F,EAAQqM,EAAK/P,SAASvE,MAAQ,SAClC,MAAO,SAAWkF,EAAWyQ,IAAM,UAAY1N,EAAQ,8BAAgCqM,EAAKiB,YAAc,IAAMjB,EAAKmB,qBAAuB,IAsKzF0Q,CAAiBjhB,KAGpEse,EAAMnnB,UAAU+pB,4BAA8B,SAAUrrB,EAAOqqB,GACtD5qB,KAAKsV,QAAQkT,EAAS0C,aAE3B,QAAgB,eAAiB3qB,EAAQ,IAAMkoB,EAAamC,KAEzD5B,EA7Ie,oOCxEtB6C,EAAiC,WACjC,SAASA,IAML7rB,KAAKoO,OAAS,IAAI,IAElBpO,KAAK8rB,yBAA2B,EAEhC9rB,KAAK+rB,kBAAoB,IAAI,IAAM,GAAI,GAEvC/rB,KAAKgsB,sBAAwB,IAAI,IAAM,GAAI,GAO/C,OALAH,EAAgBhqB,UAAUqT,QAAU,WAChClV,KAAK+rB,kBAAkBlG,QACvB7lB,KAAKgsB,sBAAsBnG,QAC3B7lB,KAAKisB,WAAa,MAEfJ,EApByB,sLCiBhCK,EAAe,SAAUD,GACzB,IAAIvX,EAASuX,EAAWvX,OAuBpB6G,EAAW0Q,EACVE,WACA7iB,QAAO,SAAUmE,GAAS,QAASA,EAAMuG,UAAUoY,YACnDzd,KAAI,SAAUlB,GAAS,OAAO4e,EAAcJ,EAAYxe,MAC7D,OAAO,WAAgB8N,GAAUxQ,MA1BjC,WACI,GAAyD,QAArDkhB,EAAWK,qBAAqBnsB,UAAU4e,OAAkB,CAG5D,IAAIwN,EAAON,EAAWO,cACtB,OAAO9X,EAAOmC,aAAaxQ,OAAOkmB,EAAKE,aAAcF,EAAKne,SAAUme,EAAKpsB,WAI7E,IAAIusB,EAAOhY,EAAOuC,WACd3Q,EAASomB,EAAK1Q,MAAM0Q,EAAKC,SACzBpQ,EAAOjW,GAAUA,EAAOiW,KAG5B,GAAIA,GAAsB,UAAdA,EAAKrN,KAAkB,CAC/B,IAAIzB,EAAQ8O,EAAK9O,MACbW,EAAS9H,EAAO0V,MACpB,OAAOtH,EAAOmC,aAAaxQ,OAAOoH,EAAOW,EAAQ6d,EAAW9rB,WAGhEuU,EAAOuC,WAAW2V,WAQfC,EAAuB,SAAUC,GACxC,OAAOA,EAAkB/c,SAAS,CAAEoc,SAAU,SAAU1e,GAAS,QAASA,EAAM2e,WAAeF,IAS5F,SAASG,EAAcJ,EAAYxe,GACtC,IAAIsf,EAAatf,EAAMuG,UAAUoY,SAE7B3oB,EAAUspB,EAAqB,SAwBnC,OAvBKtpB,IAWDA,EAAUspB,EAAqB,SAAI,YACzBA,EAAWd,EAAYxe,IAC5B1C,MAIT,SAA6BzE,GAIzB,OAHIA,GAAU1E,MAAMoQ,QAAQ1L,EAAO0mB,SAC/B1mB,EAAO0mB,OAAOjsB,SAAQ,SAAUksB,GAAU,OAAOhB,EAAWvX,OAAOkC,cAAc8C,SAASuT,MAEvF3mB,KAPFyE,MAbS,SAAUzE,GAIpB,cAHOmH,EAAM2e,gBACN3e,EAAMuG,UAAUoY,gBAChBW,EAAqB,SACrBzmB,KAEC,SAAU4mB,GAElB,cADOH,EAAqB,SACrB,cAAmBG,OAc3BzpB,oPCnFP0pB,kUAJAC,EAAS7Z,OAAO1R,UAAUa,gBAK9B,SAAWyqB,GACPA,EAAQA,EAAc,KAAI,GAAK,OAC/BA,EAAQA,EAAgB,OAAI,GAAK,SACjCA,EAAQA,EAAgB,OAAI,GAAK,SAHrC,CAIGA,IAAYA,EAAU,KA2DzB,IAAIE,EAAuB,WACvB,SAASA,EAAMhiB,EAAI6D,EAAM2G,EAAUyX,EAAW7f,GAC1C,IAAIlC,EA3DZ,SAA6BgiB,EAAW1X,EAAUpI,GAC9C,IAAI+f,GAA6C,IAAzB/f,EAAMggB,gBAA4B5X,IAAasX,EAAQO,aAAWvZ,EACtFwZ,GAAU,QAAK,CAAClgB,EAAMkgB,QAASH,GAAmB,MAClDI,GAAgB,QAAUD,GAAW,CAAEA,QAASA,GAAY,GAC5DE,EAGR,SAAyBhmB,GAGrB,SAASimB,IACL,OAAOjmB,EAAIrD,MAHfqD,EAlBc,SAAUA,GACxB,OAAiG,IAA1F,CAAC,QAAS,OAAQ,SAAU,QAAS,WAAWyB,OAAO8jB,EAAO9pB,KAAKuE,GAAO,KAAKuH,OAiBhF2e,CAAYlmB,GAAO,CAAErD,MAAOqD,GAAQA,EAC1CimB,EAAmC,aAAI,EAIvC,IAAIE,GAAO,QAAanmB,EAAIrD,OAASqD,EAAIrD,MAAQspB,EACjD,OAAO,QAAOjmB,EAAK,CAAEmmB,KAAMA,IAVTC,CAAgBxgB,GAASA,EAAMW,QAAUX,EAAMW,OAAOmf,IACxE,OAAO,QAAOK,EAAeC,GAsDZK,CAAoB7iB,EAAIwK,EAAUpI,GAC/CyB,EA5CR,SAAiBrH,EAAKsmB,EAAStY,EAAUxK,EAAI+iB,GACzC,GAAIvmB,EAAIqH,MAAQif,GAA4B,WAAjBA,EAAQ3oB,KAC/B,MAAM,IAAIiN,MAAM,UAAYpH,EAAK,kCACrC,GAAIxD,EAAIqH,MAAQif,GAA4B,WAAjBA,EAAQ3oB,MAAqB4oB,EAAWlf,KAAKrH,EAAIqH,MACxE,OAAOkf,EAAWlf,KAAKrH,EAAIqH,MAC/B,GAAIif,EACA,OAAOA,EACX,IAAKtmB,EAAIqH,KAAM,CACX,IAAIA,EAAO2G,IAAasX,EAAQkB,OAC1B,MACAxY,IAAasX,EAAQmB,KACjB,OACAzY,IAAasX,EAAQO,OACjB,QACA,SACd,OAAOU,EAAWlf,KAAKA,GAE3B,OAAOrH,EAAIqH,gBAAgB,IAAYrH,EAAIqH,KAAOkf,EAAWlf,KAAKrH,EAAIqH,MA2B3Dqf,CAAQhjB,EAAQ2D,EAAM2G,EAAUxK,EAAIiiB,EAAUc,YACrD,IAUQI,EACAC,EAXJC,GAUIF,EAAgB,CAAEjP,MAAO1J,IAAasX,EAAQO,QAAS,QACvDe,EAAyBpjB,EAAG2Q,MAAM,SAAW,CAAEuD,OAAO,GAAS,IAC5D,QAAOiP,EAAeC,EAAwBljB,GAAQgU,OAXjErQ,EAAOwf,EAAYxf,EAAKyf,SAASD,EAAW7Y,IAAasX,EAAQO,QAAUxe,EAC3E,IAAI0f,OAA8Bza,IAAjB5I,EAAO/G,OAAuBqR,IAAasX,EAAQO,OAChEC,GAAU,QAAUpiB,EAAOoiB,WAAapiB,EAAOoiB,UAAYze,EAAKye,QAChEkB,GAAM,QAAUtjB,EAAOsjB,OAAStjB,EAAOsjB,MAAQ3f,EAAK2f,IACpDC,EA9BZ,SAAyBvjB,EAAQqjB,EAAYG,GACzC,IAAID,EAASvjB,EAAOujB,OACpB,IAAKF,IAAyB,IAAXE,EACf,OAAO,EACX,KAAK,QAAUA,IAAqB,MAAVA,EACtB,OAAOC,EACX,IAAe,IAAXD,IAAmB,QAASA,GAC5B,OAAOA,EACX,MAAM,IAAIrc,MAAM,2BAA6Bqc,EAAS,uDAsBrCE,CAAgBzjB,EAAQqjB,EAAYtB,EAAU2B,uBACvDla,EArBZ,SAAoBxJ,EAAQmjB,EAAWE,EAAYE,GAC/C,IAAIC,EAAgB,CAChB,CAAEG,KAAM,GAAIC,GAAIP,GAAcF,OAAYva,EAAY,IACtD,CAAE+a,KAAM,KAAMC,GAAIP,GAAcF,OAAYva,EAAY,KAExDY,GAAU,QAAQxJ,EAAOwJ,SAAWxJ,EAAOwJ,QAAU,IACrD,QAAS+Z,IACT/Z,EAAQtU,KAAK,CAAEyuB,KAAMJ,EAAQK,QAAIhb,IACrC,IAAIib,GAAiB,QAAIra,GAAS,QAAK,SACvC,OAAO,QAAOga,GAAe,SAAU5O,GAAQ,OAA8C,IAAvCiP,EAAelhB,QAAQiS,EAAK+O,SAAiB9sB,OAAO2S,GAYxFsa,CAAW9jB,EAAQmjB,EAAWE,EAAYE,GACpD1P,GAAU,QAAU7T,EAAO6T,WAAa7T,EAAO6T,UAAYlQ,EAAKkQ,SAOpE,QAAOpf,KAAM,CAAEqL,GAAIA,EAAI6D,KAAMA,EAAM2G,SAAUA,EAAU+Y,WAAYA,EAAYjB,QAASA,EAASkB,IAAKA,EAAKC,OAAQA,EAAQ/Z,QAASA,EAASqK,QAASA,EAASG,MAAOmP,EAAWnjB,OAAQA,IAoG7L,OAlGA8hB,EAAMrM,OAAS,SAAU5S,EAAQ4S,QACd,IAAXA,IAAqBA,EAAS,IAElC,IADA,IAAI1F,EAAc,GACTwE,EAAK,EAAGwP,EAAWlhB,EAAQ0R,EAAKwP,EAASlgB,OAAQ0Q,IAAM,CAC5D,IAAI9Q,EAAQsgB,EAASxP,GACrBxE,EAAYtM,EAAM3D,IAAM2D,EAAMxK,MAAMwc,EAAOhS,EAAM3D,KAErD,OAAOiQ,GAaX+R,EAAMkC,QAAU,SAAUnhB,EAAQohB,EAASC,GAGvC,YAFgB,IAAZD,IAAsBA,EAAU,SACpB,IAAZC,IAAsBA,EAAU,IAC7BrhB,EAAO9E,QAAO,SAAU0F,GAAS,OAAQA,EAAME,KAAKC,OAAOqgB,EAAQxgB,EAAM3D,IAAKokB,EAAQzgB,EAAM3D,SAWvGgiB,EAAMle,OAAS,SAAUf,EAAQohB,EAASC,GAGtC,YAFgB,IAAZD,IAAsBA,EAAU,SACpB,IAAZC,IAAsBA,EAAU,IACsB,IAAnDpC,EAAMkC,QAAQnhB,EAAQohB,EAASC,GAASrgB,QAGnDie,EAAMqC,UAAY,SAAUthB,EAAQ4S,GAEhC,YADe,IAAXA,IAAqBA,EAAS,IAC3B5S,EAAOO,KAAI,SAAUK,GAAS,OAAOA,EAAM0gB,UAAU1O,EAAOhS,EAAM3D,QAASuD,OAAO,MAAU,IAEvGye,EAAMxrB,UAAU8tB,eAAiB,SAAUnrB,GACvC,OAAOxE,KAAK4uB,YAAc5uB,KAAKkP,KAAKC,OAAOnP,KAAKwE,QAASA,IAM7D6oB,EAAMxrB,UAAU2C,MAAQ,SAAUA,GAC9B,IAAI2L,EAAQnQ,KA0BZ,OADAwE,EAR2B,SAAUR,GACjC,IAAK,IAAI8b,EAAK,EAAGuL,EAAKlb,EAAM4E,QAAS+K,EAAKuL,EAAGjc,OAAQ0Q,IAAM,CACvD,IAAIrM,EAAQ4X,EAAGvL,GACf,GAAIrM,EAAMyb,OAASlrB,EACf,OAAOyP,EAAM0b,GAErB,OAAOnrB,EAEH4rB,CAAqBprB,IACtB,QAAYA,GAtBG,WAClB,GAAI2L,EAAM0f,mBACN,OAAO1f,EAAM0f,mBAAmBC,aACpC,IAAK,cACD,MAAM,IAAIrd,MAAM,+DACpB,IAAIqd,EAAe,qBAA0B3f,EAAM5E,OAAOyiB,MAC1D,GAAI8B,MAAAA,IAAwD3f,EAAMjB,KAAKgK,GAAG4W,GACtE,MAAM,IAAIrd,MAAM,kBAAoBqd,EAAe,oBAAsB3f,EAAM9E,GAAK,sCAAwC8E,EAAMjB,KAAK1J,KAAO,KAIlJ,OAHI2K,EAAM5E,OAAOyiB,KAAkB,cAC/B7d,EAAM0f,mBAAqB,CAAEC,aAAcA,IAExCA,EAWiBC,GAAoB/vB,KAAKkP,KAAK8gB,WAAWxrB,IAEzE6oB,EAAMxrB,UAAUouB,SAAW,WACvB,OAAOjwB,KAAK6V,WAAasX,EAAQO,QAErCL,EAAMxrB,UAAU6tB,UAAY,SAAUlrB,GAElC,KAAK,QAAYA,IAAoB,OAAVA,IAAmBxE,KAAK4uB,WAC/C,OAAO,EAEX,IAAI/T,EAAa7a,KAAKkP,KAAK8gB,WAAWxrB,GACtC,IAAKxE,KAAKkP,KAAKgK,GAAG2B,GACd,OAAO,EAEX,IAAIqV,EAAUlwB,KAAKkP,KAAK2F,OAAOgG,GAC/B,SAAS,QAASqV,KAAalwB,KAAKkP,KAAKoV,QAAQ7a,KAAKymB,KAE1D7C,EAAMxrB,UAAUiT,SAAW,WACvB,MAAO,UAAY9U,KAAKqL,GAAK,IAAMrL,KAAKkP,KAAO,aAAelP,KAAK8uB,OAAS,eAAiB9uB,KAAK4uB,WAAa,KAE5GvB,EAtHe,4OChDtB8C,EAA2B,WAM3B,SAASA,EAAUjd,GAEflT,KAAKskB,QAAU,KAEftkB,KAAKof,SAAU,GACf,QAAOpf,KAAMkT,GAgDjB,OA5CAid,EAAUtuB,UAAUqX,GAAK,SAAUlV,EAAK6B,GACpC,OAAO,GAGXsqB,EAAUtuB,UAAUgT,OAAS,SAAU7Q,EAAK6B,GACxC,OAAO7B,GAGXmsB,EAAUtuB,UAAUoT,OAAS,SAAUjR,EAAK6B,GACxC,OAAO7B,GAGXmsB,EAAUtuB,UAAUsN,OAAS,SAAUsO,EAAGmB,GAEtC,OAAOnB,GAAKmB,GAEhBuR,EAAUtuB,UAAUuuB,YAAc,WAC9B,IAAIC,EAAMrwB,KAAKskB,QAAQxP,WACvB,OAAOub,EAAItJ,OAAO,EAAGsJ,EAAIjhB,OAAS,IAEtC+gB,EAAUtuB,UAAUiT,SAAW,WAC3B,MAAO,cAAgB9U,KAAKwF,KAAO,KAGvC2qB,EAAUtuB,UAAUmuB,WAAa,SAAUhsB,GACvC,OAAOhE,KAAKkZ,GAAGlV,GAAOA,EAAMhE,KAAKiV,OAAOjR,IAY5CmsB,EAAUtuB,UAAU8sB,SAAW,SAAU2B,EAAML,GAC3C,IAAKK,EACD,OAAOtwB,KACX,GAAa,SAATswB,IAAoBL,EACpB,MAAM,IAAIxd,MAAM,kDACpB,OAAO,IAAI8d,EAAUvwB,KAAMswB,IAExBH,EA3DmB,GA+D9B,SAASI,EAAUrhB,EAAMohB,GACrB,IAAIngB,EAAQnQ,KAEZ,SAASwwB,EAAUxsB,GACf,OAAO,QAAQA,GAAOA,GAAM,QAAUA,GAAO,CAACA,GAAO,GAczD,SAASysB,EAAajwB,EAAUkwB,GAC5B,OAAO,SAAqB1sB,GACxB,IAAI,QAAQA,IAAuB,IAAfA,EAAIoL,OACpB,OAAOpL,EACX,IAAI0b,EAAM8Q,EAAUxsB,GAChBsC,GAAS,QAAIoZ,EAAKlf,GACtB,OAAyB,IAAlBkwB,EAAgF,KAAvD,QAAOpqB,GAAQ,SAAUgJ,GAAK,OAAQA,KAAMF,OAjBpF,SAAqBpL,GACjB,OAAQA,EAAIoL,QACR,KAAK,EACD,OACJ,KAAK,EACD,MAAgB,SAATkhB,EAAkBtsB,EAAI,GAAKA,EACtC,QACI,OAAOA,GAUgF2sB,CAAYrqB,IAI/G,SAASsqB,EAAmBpwB,GACxB,OAAO,SAAqBqwB,EAAMC,GAC9B,IAAIC,EAAOP,EAAUK,GAAOG,EAAQR,EAAUM,GAC9C,GAAIC,EAAK3hB,SAAW4hB,EAAM5hB,OACtB,OAAO,EACX,IAAK,IAAIiO,EAAI,EAAGA,EAAI0T,EAAK3hB,OAAQiO,IAC7B,IAAK7c,EAASuwB,EAAK1T,GAAI2T,EAAM3T,IACzB,OAAO,EAEf,OAAO,GAGf,CAAC,SAAU,SAAU,SAAU,cAActc,SAAQ,SAAUyE,GAC3D,IAAIyrB,EAAc/hB,EAAK1J,GAAMlC,KAAK4L,GAC9BgiB,EAAqB,WAAT1rB,EAAoBorB,EAAqBH,EACzDtgB,EAAM3K,GAAQ0rB,EAAUD,OAE5B,QAAOjxB,KAAM,CACT2tB,QAASze,EAAKye,QACdnoB,KAAM0J,EAAK1J,KACX8e,QAASpV,EAAKoV,QACdlF,QAASlQ,EAAKkQ,QACdyP,IAAK3f,EAAK2f,IACV3V,GAAIuX,EAAavhB,EAAKgK,GAAG5V,KAAK4L,IAAO,GACrCiiB,WAAYb,+GC5DZc,kUApDJC,EAA4B,WAC5B,SAASA,IACLrxB,KAAKwlB,SAAU,EACfxlB,KAAKsxB,UAAY,GACjBtxB,KAAKuxB,cAAe,QAAKF,EAAWxvB,UAAW,CAC3C,OACA,SACA,QACA,OACA,MACA,OACA,OACA,OACA,QAIJ7B,KAAK+D,OAAQ,SAAQ,QAAI/D,KAAKuxB,cADf,SAAU9X,EAAYjU,GAAQ,OAAO,IAAI,KAAU,QAAO,CAAEA,KAAMA,GAAQiU,OAClC,IA+B3D,OA7BA4X,EAAWxvB,UAAUqT,QAAU,WAC3BlV,KAAK+D,MAAQ,IAOjBstB,EAAWxvB,UAAUqN,KAAO,SAAU1J,EAAMiU,EAAY+X,GACpD,KAAK,QAAU/X,GACX,OAAOzZ,KAAK+D,MAAMyB,GACtB,GAAIxF,KAAK+D,MAAMrB,eAAe8C,GAC1B,MAAM,IAAIiN,MAAM,iBAAmBjN,EAAO,+BAO9C,OANAxF,KAAK+D,MAAMyB,GAAQ,IAAI,KAAU,QAAO,CAAEA,KAAMA,GAAQiU,IACpD+X,IACAxxB,KAAKsxB,UAAU7wB,KAAK,CAAE+E,KAAMA,EAAM0N,IAAKse,IAClCxxB,KAAKwlB,SACNxlB,KAAKyxB,mBAENzxB,MAEXqxB,EAAWxvB,UAAU4vB,gBAAkB,WACnC,KAAOzxB,KAAKsxB,UAAUliB,QAAQ,CAC1B,IAAIF,EAAOlP,KAAKsxB,UAAUrvB,QAC1B,GAAIiN,EAAKoV,QACL,MAAM,IAAI7R,MAAM,sDACpB,QAAOzS,KAAK+D,MAAMmL,EAAK1J,MAAO,qBAA0B0J,EAAKgE,QAG9Dme,EAhDoB,GAoDvBD,EAAkB,SAAUle,GAC5B,IAAIwe,EAAc,SAAU1tB,GAAO,OAAe,MAAPA,EAAcA,EAAI8Q,WAAa9Q,GACtE2tB,EAAkB,CAClB9c,OAAQ6c,EACRzc,OAAQyc,EACRxY,IAAI,IAAAA,IAAG0Y,QACPtN,QAAS,KAETnV,OAAQ,SAAUsO,EAAGmB,GAAK,OAAOnB,GAAKmB,IAE1C,OAAO,QAAO,GAAI+S,EAAiBze,KAGvC,QAAOme,EAAWxvB,UAAW,CACzB0D,OAAQ6rB,EAAgB,IACxBjpB,KAAMipB,EAAgB,CAClB9M,QAAS,UAEbuN,MAAOT,EAAgB,IACvBU,KAAMV,EAAgB,CAClBhS,SAAS,IAEb2S,IAAKX,EAAgB,CACjBnc,OAAQ,SAAUjR,GAAO,OAAOqlB,SAASrlB,EAAK,KAC9CkV,GAAI,SAAUlV,GACV,QAAQ,QAAkBA,IAAQhE,KAAKiV,OAAOjR,EAAI8Q,cAAgB9Q,GAEtEsgB,QAAS,UAEb0N,KAAMZ,EAAgB,CAClBvc,OAAQ,SAAU7Q,GAAO,OAAQA,EAAO,EAAM,GAC9CiR,OAAQ,SAAUjR,GAAO,OAA6B,IAAtBqlB,SAASrlB,EAAK,KAC9CkV,IAAI,IAAAA,IAAG+Y,SACP3N,QAAS,QAEb4N,KAAMd,EAAgB,CAClBvc,OAAQ,SAAU7Q,GACd,OAAQhE,KAAKkZ,GAAGlV,GAEV,CAACA,EAAImuB,eAAgB,KAAOnuB,EAAIouB,WAAa,IAAItwB,OAAO,IAAK,IAAMkC,EAAIquB,WAAWvwB,OAAO,IAAImR,KAAK,UADlGkB,GAGVc,OAAQ,SAAUjR,GACd,GAAIhE,KAAKkZ,GAAGlV,GACR,OAAOA,EACX,IAAIgY,EAAQhc,KAAKsyB,QAAQ7oB,KAAKzF,GAC9B,OAAOgY,EAAQ,IAAIuW,KAAKvW,EAAM,GAAIA,EAAM,GAAK,EAAGA,EAAM,SAAM7H,GAEhE+E,GAAI,SAAUlV,GAAO,OAAOA,aAAeuuB,OAASjJ,MAAMtlB,EAAIwuB,YAC9DrjB,OAAQ,SAAUsjB,EAAGlV,GACjB,MAAO,CAAC,cAAe,WAAY,WAAW3O,QAAO,SAAUsL,EAAKvZ,GAAM,OAAOuZ,GAAOuY,EAAE9xB,OAAU4c,EAAE5c,QAAU,IAEpH2jB,QAAS,0DACTgO,QAAS,0DAEbI,KAAMtB,EAAgB,CAClBvc,OAAQ,KACRI,OAAQ,KACRiE,IAAI,IAAAA,IAAG3F,QACPpE,OAAQ,KACRmV,QAAS,UAGbJ,IAAKkN,EAAgB,CACjBvc,OAAQ,KACRI,OAAQ,KACRiE,GAAI,WAAc,OAAO,GACzB/J,OAAQ,kLCjJhBwjB,EAA6B,WAC7B,SAASA,EAAYvkB,QACF,IAAXA,IAAqBA,EAAS,KAClC,QAAOpO,KAAMoO,GA4BjB,OAlBAukB,EAAY9wB,UAAU+wB,SAAW,SAAUC,EAAWC,EAAUC,GAC5D,IAAIC,EACAC,GAAU,QAAUH,EAAUC,GAAM9nB,EAAY,GAAIioB,EAAc,GACtE,IAAK,IAAI7V,KAAK4V,EACV,GAAKA,EAAQ5V,IAAO4V,EAAQ5V,GAAGjP,SAE/B4kB,EAAezf,OAAOC,KAAKyf,EAAQ5V,GAAGjP,SACpBgB,OAElB,IAAK,IAAIsO,KAAKsV,EACNE,EAAYhlB,QAAQ8kB,EAAatV,KAAO,IAE5CwV,EAAYzyB,KAAKuyB,EAAatV,IAC9BzS,EAAU+nB,EAAatV,IAAM1d,KAAKgzB,EAAatV,KAGvD,OAAO,QAAO,GAAIzS,EAAW4nB,IAE1BF,EA/BqB,+RCS5BQ,EAA0B,WAC1B,SAASA,EAASC,GACd,GAAIA,aAAuBD,EAAU,CACjC,IAAI5kB,EAAO6kB,EACXpzB,KAAKyN,MAAQc,EAAKd,MAClBzN,KAAKwO,YAAcD,EAAKC,YAAY1M,QACpC9B,KAAKsb,aAAc,QAAO,GAAI/M,EAAK+M,aACnCtb,KAAK+X,YAAcxJ,EAAKwJ,YAAYjW,QACpC9B,KAAKwa,MAAQjM,EAAKiM,OAASjM,EAAKiM,MAAM1Y,YAErC,CACD,IAAI2L,EAAQ2lB,EACZpzB,KAAKyN,MAAQA,EACbzN,KAAKwO,YAAcf,EAAM4lB,WAAW,CAAEjU,SAAS,IAC/Cpf,KAAKsb,YAAc,GACnBtb,KAAK+X,YAActK,EAAMsK,YAAYpJ,KAAI,SAAUqE,GAAO,OAAOA,EAAItG,YA+C7E,OA5CAymB,EAAStxB,UAAU6K,MAAQ,WACvB,OAAO,IAAIymB,EAASnzB,OAGxBmzB,EAAStxB,UAAUyxB,eAAiB,SAAUllB,GAG1C,OADApO,KAAKsb,YAActb,KAAKwO,YAAYI,QAAO,SAAUsR,EAAMqT,GAAQ,OAAO,QAAWrT,EADtC,EAAnBsT,EAC2ED,GAD9CloB,GAAImoB,EAAShvB,MAAM4J,EAAOolB,EAASnoB,OAA1E,IAAUmoB,IACsF,IAC3GxzB,MAGXmzB,EAAStxB,UAAU4xB,UAAY,SAAUjuB,GACrC,OAAO,QAAKxF,KAAKwO,aAAa,QAAO,KAAMhJ,KAM/C2tB,EAAStxB,UAAUsN,OAAS,SAAUZ,EAAMmlB,GACxC,IAAIC,EAAO3zB,KAAK2zB,KAAKplB,EAAMmlB,GAC3B,OAAOC,GAAwB,IAAhBA,EAAKvkB,QAcxB+jB,EAAStxB,UAAU8xB,KAAO,SAAUplB,EAAMmlB,GACtC,GAAI1zB,KAAKyN,QAAUc,EAAKd,MACpB,OAAO,EACX,IAAIW,EAASslB,EAAWA,EAAS1zB,MAAQA,KAAKwO,YAC9C,OAAO,YAAcJ,EAAQpO,KAAKsb,YAAa/M,EAAK+M,cAMxD6X,EAASzmB,MAAQ,SAAU6B,GAAQ,OAAOA,EAAK7B,SACxCymB,EA9DkB,mWCHzBS,EAA2B,WAC3B,SAASA,KA4JT,OAzJAA,EAAUC,gBAAkB,SAAUC,EAAU3rB,GAC5C,IAAIsF,GAAQ,QAAKtF,GAAMsF,MACvB,OAAO,IAAI,IAAYqmB,EAAUrmB,EAAOtF,EAAKwG,KAAI,QAAK,gBAAgBC,OAAO,KAAQ,IAAK,KAE9FglB,EAAUG,UAAY,SAAUvH,GAC5B,IAAIre,EAAWqe,EAAYpe,SAC3B,OAAOoe,EAAY/T,SAAStQ,KAAKwG,KAAI,SAAUlB,GAAS,OAAO,IAAI,IAASA,GAAO6lB,eAAenlB,OAGtGylB,EAAUI,YAAc,SAAUC,EAAUzH,GACxC,IAAI0H,EAASN,EAAUG,UAAUvH,GACjC,OAAIA,EAAYrsB,UAAUif,QACfwU,EAAUO,cAAcF,EAAUC,EAAQ3gB,OAAOC,KAAKgZ,EAAYpe,WAEtE8lB,GAOXN,EAAUQ,iBAAmB,SAAUttB,EAAOqB,EAAM6kB,GAEhD7kB,EACKmB,QAAO,SAAUiF,GAAQ,OAAO,QAAQye,EAAQze,EAAKd,UACrD1M,SAAQ,SAAUwN,GACnB,IAAI8lB,GAAY,QAAO9lB,EAAKd,MAAM+M,OAAS,IACvC8Z,EAAUV,EAAUU,QAAQnsB,GAAM,SAAUoY,GAAK,OAAOA,IAAMhS,KAC9DgmB,EAAcF,EAAU1lB,KAAI,SAAUmL,GAAQ,OAAOhT,EAAM0tB,iBAAiBF,EAASxa,MACzFvL,EAAKiM,MAAQ+Z,EAAY3lB,OAAO,KAAS,QAcjDglB,EAAUO,cAAgB,SAAUF,EAAUC,EAAQO,QACnC,IAAXA,IAAqBA,EAAS,IAKlC,IAAIC,EAAYT,EACXtlB,KAAI,SAAUJ,GAAQ,OAAOA,EAAKC,eAClCI,OAAO,KAAS,IAChBtF,QAAO,SAAU0F,GAAS,OAAQA,EAAMoQ,WACxCzQ,KAAI,QAAK,OAiBd,OAAOulB,EAAOvlB,KAZd,SAAiCgmB,GAE7B,IAAIC,GAAc,QAAO,GAAID,GAAUA,EAAOrZ,aAE1CuZ,GAAoB,QAAKD,EAAaH,GAC1CG,GAAc,QAAKA,EAAaH,GAChC,IAnBmBtsB,EAAMsF,EACrBc,EAkBAumB,GAAgB,SAnBD3sB,EAmBoB8rB,EAnBdxmB,EAmBwBknB,EAAOlnB,MAlBpDc,GAAO,QAAKpG,GAAM,QAAO,QAASsF,KAC/B,QAAO,GAAIc,GAAQA,EAAK+M,cAiBmC,IAAIoZ,GAElEK,GAAe,QAAOH,EAAaE,EAAeD,GACtD,OAAO,IAAI,IAASF,EAAOlnB,OAAO6lB,eAAeyB,OAQzDnB,EAAUllB,YAAc,SAAUulB,EAAUC,EAAQc,GAIhD,IAHA,IAE2BC,EAAOC,EAU9BhG,EAAMiG,EAAUlnB,EAASke,EAZzBrF,EAAMhF,KAAKD,IAAIoS,EAAS7kB,OAAQ8kB,EAAO9kB,QACvCgmB,EAAO,EAEJA,EAAOtO,GAAOmN,EAASmB,GAAM3nB,QAAUunB,IADnBC,EAC6ChB,EAASmB,GAD/CF,EACsDhB,EAAOkB,GAD7CH,EAAM9lB,OAAO+lB,EAAOtB,EAAUyB,oBAE5ED,IAUJD,GADAjG,EAAO+E,GACSnyB,MAAM,EAAGszB,GACzBnnB,EAAUihB,EAAKptB,MAAMszB,GAErB,IAAIE,EAAuBH,EAASxmB,KAVpC,SAAuB4mB,EAActmB,GACjC,IAAIxC,EAAS8oB,EAAa7oB,QAE1B,OADAD,EAAO6O,YAAc4Y,EAAOjlB,GAAKqM,YAC1B7O,KAUX,OAFA0f,EAAW+H,EAAOpyB,MAAMszB,GAEjB,CAAElG,KAAMA,EAAMC,GADhBmG,EAAqBlzB,OAAO+pB,GACJgJ,SAAUA,EAAUG,qBAAsBA,EAAsBrnB,QAASA,EAASke,SAAUA,IAiB7HyH,EAAU4B,SAAW,SAAUC,EAAOC,EAAOhC,GACzC,IAAIiC,GAAO,EAEX,OADa,QAAYF,EAAOC,GAClB9mB,QAAO,SAAU4mB,EAAUnK,GACrC,IAAIuK,EAAQvK,EAAG,GAAIwK,EAAQxK,EAAG,GAE9B,OADAsK,EAAOA,IAASC,EAAMzmB,OAAO0mB,EAAOnC,IACtB8B,EAAWA,EAASpzB,OAAOwzB,KAC1C,KAUPhC,EAAUzkB,OAAS,SAAUsmB,EAAOC,EAAOhC,GACvC,OAAO+B,EAAMrmB,SAAWsmB,EAAMtmB,QAAUwkB,EAAU4B,SAASC,EAAOC,EAAOhC,GAAUtkB,SAAWqmB,EAAMrmB,QAYxGwkB,EAAUU,QAAU,SAAUnsB,EAAM2tB,GAChC,IAAIvnB,GAAO,QAAKpG,EAAM2tB,GAClBC,EAAa5tB,EAAK+F,QAAQK,GAC9B,OAAuB,IAAhBwnB,OAAoB5hB,EAAYhM,EAAKrG,MAAM,EAAGi0B,EAAa,IAEtEnC,EAAUyB,iBAAmB,SAAU9mB,GACnC,OAAOA,EAAKd,MAAM4lB,WAAW,CAAEjU,SAAS,IAAS9V,QAAO,SAAU0F,GAAS,OAAQA,EAAM2e,YAG7FiG,EAAUtY,YAAc,SAAUnT,GAAQ,OAAOA,EAAKyG,QAAO,SAAUsL,EAAK3L,GAAQ,OAAO,QAAO2L,EAAK3L,EAAK+M,eAAiB,KACtHsY,EA7JmB,yGCPvB,IAAIoC,EAAkB,CACzB/lB,KAAM,CACFgmB,KAAM,OACNC,MAAO,SAEXpd,MAAO,CACHqd,KAAM,OACNC,OAAQ,sbCgBZnkB,EAA4B,WAC5B,SAASA,EAAWokB,EAAMne,EAAWpG,EAAMwkB,EAAQ3uB,GAG/C,GAFA3H,KAAKu2B,UAAW,EAChBv2B,KAAKyD,aAAU0Q,EACXkiB,aAAgBpkB,GAChB,QAAOjS,KAAMq2B,QAEZ,IAAI,QAAWne,GAAY,CAC5B,IAAI,QAAkBme,GAClB,MAAM,IAAI5jB,MAAM,gDACpB,KAAK,QAAWyF,GACZ,MAAM,IAAIzF,MAAM,2DACpBzS,KAAKuhB,MAAQ8U,EACbr2B,KAAKs2B,OAASA,EACdt2B,KAAKkY,UAAYA,EACjBlY,KAAK8R,KAAOA,GAAQ,GACpB9R,KAAK2H,KAAOA,EACZ3H,KAAKu2B,cAAoBpiB,IAATxM,EAChB3H,KAAKyD,QAAUzD,KAAKu2B,SAAW,YAAiBv2B,KAAK2H,WAAQwM,OAE5D,IAAI,QAASkiB,IAASA,EAAK9U,QAAU8U,EAAK3zB,eAAe,cAAgB2zB,EAAK3zB,eAAe,SAAU,CACxG,IAAI8zB,EAAUH,EACd,OAAO,IAAIpkB,EAAWukB,EAAQjV,MAAOiV,EAAQte,UAAWse,EAAQ1kB,KAAM0kB,EAAQF,OAAQE,EAAQ7uB,OA+DtG,OA5DAsK,EAAWpQ,UAAUgX,UAAY,SAAUpL,GACvC,IAAIgpB,EAAaz2B,KAAKs2B,QAAU,GAC5BI,EAAejpB,GAASA,EAAMkpB,eAAkB,GACpD,MAAO,CACH1mB,KAAMwmB,EAAWxmB,MAAQymB,EAAYzmB,MA5CvC,OA6CE6I,MAAO2d,EAAW3d,OAAS4d,EAAY5d,OA5CxC,SAsDP7G,EAAWpQ,UAAU8K,QAAU,SAAUiqB,EAAgBhnB,GACrD,IAAIO,EAAQnQ,KACR+G,EAAK,OAOLwH,EAAOqoB,EAAeC,SAAS72B,MAC/ByN,EAAQc,GAAQA,EAAKd,MACrBqpB,EAAc92B,KAAK6Y,UAAUpL,GAAOqL,MACpCie,GAAoB,QAAWD,GAAeA,EAAc,KAUhE,OAAQ92B,KAAKyD,QAAUsD,EAClBkJ,OACAlF,MApB2B,WAC5B,OAAOhE,EAAG0U,IAAImb,EAAeI,gBAAgB7mB,GAAOxB,KAAI,SAAUqJ,GAAc,OAAOA,EAAWtH,IAAIkmB,EAAgBhnB,UAoBrH7E,MAjBiB,SAAUksB,GAAgB,OAAO9mB,EAAM+H,UAAU/V,MAAM,KAAM80B,MAkB9ElsB,KAAKgsB,GACLhsB,MAboB,SAAUmsB,GAK/B,OAJA/mB,EAAMxI,KAAOuvB,EACb/mB,EAAMomB,UAAW,EACjBpmB,EAAM+H,UAAY,KAClB,6BAA8B/H,EAAOP,GAC9BO,EAAMxI,SAgBrBsK,EAAWpQ,UAAU6O,IAAM,SAAUkmB,EAAgBhnB,GACjD,OAAO5P,KAAKyD,SAAWzD,KAAK2M,QAAQiqB,EAAgBhnB,IAExDqC,EAAWpQ,UAAUiT,SAAW,WAC5B,MAAO,sBAAuB,QAAU9U,KAAKuhB,OAAS,gBAAkBvhB,KAAK8R,KAAKnD,IAAI,MAAa,MAEvGsD,EAAWpQ,UAAU6K,MAAQ,WACzB,OAAO,IAAIuF,EAAWjS,OAE1BiS,EAAWklB,SAAW,SAAU5V,EAAO5Z,GAAQ,OAAO,IAAIsK,EAAWsP,GAAO,WAAc,OAAO5Z,IAAS,KAAM,KAAMA,IAC/GsK,EArFoB,4qBCd3BmlB,EAAQ,SACRC,EAAY,CAACD,EAAMlB,MAAOkB,EAAMnB,MAChCqB,EAAc,CAACF,EAAMlB,OAarB9tB,EAAgC,WAChC,SAASA,EAAemvB,GACpBv3B,KAAKu3B,MAAQA,EA8IjB,OA3IAnvB,EAAevG,UAAU+W,UAAY,WACjC,OAAO5Y,KAAKu3B,MAAM3oB,QAAO,SAAUsL,EAAK3L,GAAQ,OAAO2L,EAAI9X,OAAOmM,EAAKwJ,YAAYpJ,KAAI,SAAU4O,GAAK,OAAOA,EAAEgE,YAAe,IAAI3S,OAAO,KAAO,KAQpJxG,EAAevG,UAAUiM,cAAgB,SAAUyT,GAC/C,IAAIiU,EAAWx1B,KAAKu3B,MACf5oB,KAAI,SAAUJ,GAAQ,OAAOA,EAAKwJ,eAClCnJ,OAAO,KAAS,IAChBtF,QAAO,SAAUiU,GAAK,OAAOA,EAAEgE,QAAUA,KAC9C,OAAO,QAAKiU,IAGhBptB,EAAevG,UAAUgX,UAAY,SAAUb,GAC3C,IAAIzJ,EAAOvO,KAAK62B,SAAS7e,GACzB,OAAOA,EAAWa,UAAUtK,EAAKd,QAyBrCrF,EAAevG,UAAUkS,WAAa,SAAUtG,GAC5C,OAAO,IAAIrF,EAAe,YAAkBpI,KAAKu3B,OAAO,SAAUhpB,GAAQ,OAAOA,EAAKd,QAAUA,OAiBpGrF,EAAevG,UAAU21B,eAAiB,SAAUC,EAAgBhqB,GAChE,IAAIc,GAAO,QAAKvO,KAAKu3B,OAAO,QAAO,QAAS9pB,IACxC+F,EAAOikB,EAAe9oB,KAAI,SAAU4O,GAAK,OAAOA,EAAEgE,SACtDhT,EAAKwJ,YAAcxJ,EAAKwJ,YAAYzO,QAAO,SAAUiU,GAAK,OAAkC,IAA3B/J,EAAKtF,QAAQqP,EAAEgE,UAAkBnf,OAAOq1B,IAS7GrvB,EAAevG,UAAU61B,YAAc,SAAUznB,EAAML,GACnD,IAAIO,EAAQnQ,UACC,IAATiQ,IAAmBA,EAAO,QAE9B,IAGI0nB,IAHa,QAAQN,EAAWpnB,GAAQA,EAAO,UAGjB,eAA6BqnB,EAAcD,EAE7E,sBAAuBr3B,KAAKu3B,MAAOtnB,EAAML,GACzC,IAAIgoB,EAAgB,SAAUC,EAAcC,GAAe,OAAO,SAAU9f,GACxE,OAAO,QAAQ6f,EAAc1nB,EAAM0I,UAAUb,GAAY8f,MAIzDvc,EAAWvb,KAAKu3B,MAAM3oB,QAAO,SAAUsL,EAAK3L,GAC5C,IAAIwpB,EAAkBxpB,EAAKwJ,YAAYzO,OAAOsuB,EAAcD,EAAc,SACtEK,EAASD,EAAgBzuB,OAAOsuB,EAAc,CAAC,UAAW,UAC1DK,EAAOF,EAAgBzuB,QAAO,QAAIsuB,EAAc,CAAC,UAAW,WAE5D7jB,EAAa5D,EAAM4D,WAAWxF,EAAKd,OACnCyqB,EAAY,SAAU3a,GACtB,OAAOA,EACF7M,IAAIqD,EAAYnE,GAEhB7E,MAAK,SAAUvG,GAAS,MAAO,CAAG+c,MAAOhE,EAAEgE,MAAO/c,MAAOA,OAGlE,OADAwzB,EAAOj3B,QAAQm3B,GACRhe,EAAI9X,OAAO61B,EAAKtpB,IAAIupB,MAC5B,IAEH,OAAO,WAAgB3c,IAE3BnT,EAAevG,UAAUs2B,SAAW,WAChC,OAAOn4B,KAAKo4B,YAAcp4B,KAAKo4B,UAAY,IAAIC,EAAer4B,QAElEoI,EAAevG,UAAUg1B,SAAW,SAAU7e,GAC1C,OAAO,QAAKhY,KAAKu3B,OAAO,SAAUhpB,GAAQ,OAAO,QAAQA,EAAKwJ,YAAaC,OAO/E5P,EAAevG,UAAUm1B,gBAAkB,SAAUhf,GACjD,IAAI7H,EAAQnQ,KACRuO,EAAOvO,KAAK62B,SAAS7e,GAIrBsgB,GADU,YAAkBt4B,KAAKu3B,OAAO,SAAUjoB,GAAK,OAAOA,IAAMf,MAAYvO,KAAKu3B,OAEpF3oB,QAAO,SAAUsL,EAAKqe,GAAS,OAAOre,EAAI9X,OAAOm2B,EAAMxgB,eAAiB,IACxEzO,QAAO,SAAU0J,GAAO,OAAOA,IAAQgF,KAW5C,OAAOA,EAAWlG,KAAKnD,KAVH,SAAU4S,GAC1B,IAAIiU,EAAW8C,EAAqBhvB,QAAO,SAAUiU,GAAK,OAAOA,EAAEgE,QAAUA,KAC7E,GAAIiU,EAASpmB,OACT,OAAO,QAAKomB,GAChB,IAAIgD,EAAeroB,EAAMgoB,WAAWM,UAAUlX,GAC9C,IAAI,QAAYiX,GACZ,MAAM,IAAI/lB,MAAM,+CAAgD,QAAU8O,IAE9E,OAAO,IAAI,IAAWA,GAAO,WAAc,OAAOiX,IAAiB,GAAIA,OAIxEpwB,EAhJwB,GAoJ/BiwB,EAAgC,WAChC,SAASA,EAAexnB,GACpB7Q,KAAK6Q,QAAUA,EACf7Q,KAAK04B,OAAS14B,KAAK0Q,IAlKQ,oBAkKsB,cAwBrD,OAtBA2nB,EAAex2B,UAAU6O,IAAM,SAAU6Q,GACrC,IAAIvJ,EAAahY,KAAK6Q,QAAQ/C,cAAcyT,GAC5C,GAAIvJ,EAAY,CACZ,GAAiD,WAA7ChY,KAAK6Q,QAAQgI,UAAUb,GAAYc,MACnC,OAAOd,EAAWtH,IAAI1Q,KAAK6Q,SAE/B,IAAKmH,EAAWue,SACZ,MAAM,IAAI9jB,MAAM,yCAA0C,QAAUuF,EAAWuJ,QAEnF,OAAOvJ,EAAWrQ,KAEtB,OAAO3H,KAAKy4B,UAAUlX,IAE1B8W,EAAex2B,UAAU82B,SAAW,SAAUpX,GAC1C,IAAIvJ,EAAahY,KAAK6Q,QAAQ/C,cAAcyT,GAC5C,OAAIvJ,EACOA,EAAWtH,IAAI1Q,KAAK6Q,SACxB,YAAiB7Q,KAAK04B,OAAOhoB,IAAI6Q,KAE5C8W,EAAex2B,UAAU42B,UAAY,SAAUlX,GAC3C,OAAOvhB,KAAK04B,QAAU14B,KAAK04B,OAAOhoB,IAAI6Q,IAEnC8W,EA3BwB,q2BC/J/BO,EAAkB,EAMlBC,GAAsB,QAAS,mBAJnB,CAAC,MAAO,OAAQ,SAAU,OAAQ,aAM9CC,GAAqB,QAAS,iBAJlB,CAAC,OAAQ,WAAY,OAAQ,WAAY,YAAa,eAUlEpiB,EAA0B,WAQ1B,SAASA,EAASU,EAAiBC,QACP,IAApBD,IAA8BA,EAAkByhB,QAC7B,IAAnBxhB,IAA6BA,EAAiByhB,GAClD94B,KAAKoX,gBAAkBA,EACvBpX,KAAKqX,eAAiBA,EACLrX,KAAKmb,IAAMyd,IACX54B,KAAK+4B,WAAY,EACjB/4B,KAAKg5B,aAAe,GAErCh5B,KAAKqI,MAAQ,KAEbrI,KAAK+W,YAAc,IAAI,IAAY/W,MAEnCA,KAAKsY,QAAU,IAAI,IAEnBtY,KAAK8sB,kBAAoB,IAAI,IAAkB9sB,MAK/CA,KAAK4U,kBAAoB,IAAI,IAAkB5U,MAK/CA,KAAKmc,UAAY,IAAI,IAAUnc,MAE/BA,KAAKiX,WAAa,IAAI,IAAWjX,MAEjCA,KAAK4W,cAAgB,IAAI,IAAc5W,MAEvCA,KAAK6W,aAAe,IAAI,IAAa7W,MAErCA,KAAKi5B,SAAW,GAChBj5B,KAAK+W,YAAY/M,WAAWC,iBAAiBjK,KAAK4W,cAAcgH,QAChE5d,KAAKsY,QAAQwa,SAAW9yB,KAAK4W,cAAcgH,OAC3C5d,KAAKsY,QAAQwN,QAAU9lB,KAAKsY,QAAQwa,SAASplB,KAC7C1N,KAAKk5B,WAAWl5B,KAAKsY,SACrBtY,KAAKk5B,WAAWl5B,KAAK6W,cACrB7W,KAAKk5B,WAAWl5B,KAAK4W,eACrB5W,KAAKk5B,WAAWl5B,KAAK8sB,mBACrB9sB,KAAKk5B,WAAWl5B,KAAKiX,YACrBjX,KAAKk5B,WAAW9hB,GAChBpX,KAAKk5B,WAAW7hB,GAgGpB,OA7FAX,EAAS7U,UAAUq3B,WAAa,SAAUA,GACtCl5B,KAAKg5B,aAAav4B,KAAKy4B,IAa3BxiB,EAAS7U,UAAUqT,QAAU,SAAUgkB,GACnC,IAAI/oB,EAAQnQ,KACRk5B,IAAc,QAAWA,EAAWhkB,SACpCgkB,EAAWhkB,QAAQlV,OAGvBA,KAAK+4B,WAAY,EACjB/4B,KAAKg5B,aAAal3B,QAAQf,SAAQ,SAAUo4B,GACxC,IACyB,mBAAdA,EAAEjkB,SAA0BikB,EAAEjkB,QAAQ/E,IAC7C,QAAWA,EAAM6oB,aAAcG,GAEnC,MAAOC,UAwDf1iB,EAAS7U,UAAUw3B,OAAS,SAAUA,EAAQl5B,QAC1B,IAAZA,IAAsBA,EAAU,IACpC,IAAIm5B,EAAiB,IAAID,EAAOr5B,KAAMG,GACtC,IAAKm5B,EAAe9zB,KAChB,MAAM,IAAIiN,MAAM,+CAAiD6mB,GAErE,OADAt5B,KAAKg5B,aAAav4B,KAAK64B,GACft5B,KAAKi5B,SAASK,EAAe9zB,MAAQ8zB,GAEjD5iB,EAAS7U,UAAU03B,UAAY,SAAUC,GACrC,OAAOA,EAAax5B,KAAKi5B,SAASO,IAAc,QAAOx5B,KAAKi5B,WAEzDviB,EAnJkB,ijBCf7B,SAAS+iB,EAAYhsB,GACjB,OAAOA,EAAMjI,KAEjB,SAASk0B,EAAYjsB,GAEjB,OADAA,EAAMC,KAAKsG,QAAU,WAAc,OAAOvG,GACnCA,EAAMC,KAEjB,SAASisB,EAAYlsB,GAIjB,OAHIA,EAAM2M,QAAU3M,EAAM2M,OAAOzS,OAC7B8F,EAAM9F,KAAO8F,EAAMC,KAAK/F,MAAO,QAAQ8F,EAAM2M,OAAOzS,KAAM8F,EAAM9F,OAE7D8F,EAAM9F,KAEjB,IAAIiyB,EAAgB,SAAUC,EAA4Bjc,GACtD,OAAO,SAAoBhK,GACvB,IAAIkmB,EAAWlmB,EAAYlG,KAG3B,GAAIosB,GAAYA,EAASroB,KAAOqoB,EAASt0B,MAAQs0B,EAASt0B,KAAKwW,MAAM,WAAY,CAC7E,IAAI+d,EAAc,IAClB,QAAKD,EAAUC,GACfA,EAAYtoB,KAAO,kBACnBqoB,EAAWC,EAEf,IAAI3f,EAASxG,EAAYwG,OACrB4f,EA/BG,SAAUvoB,GACrB,KAAK,QAASA,GACV,OAAO,EACX,IAAImM,EAAyB,MAAlBnM,EAAIhM,OAAO,GACtB,MAAO,CAAEzB,IAAK4Z,EAAOnM,EAAIwoB,UAAU,GAAKxoB,EAAKmM,KAAMA,GA2BlCsc,CAASJ,EAASroB,KAC3BA,EAAOuoB,EAAwBH,EAA2BxyB,QAAQ2yB,EAAOh2B,IAAK,CAAEyJ,MAAOqsB,IAAvEA,EAASroB,IAC7B,IAAKA,EACD,OAAO,KACX,IAAKooB,EAA2BM,UAAU1oB,GACtC,MAAM,IAAIgB,MAAM,gBAAkBhB,EAAM,eAAiBmC,EAAc,KAC3E,OAAOomB,GAAUA,EAAOpc,KAAOnM,GAAQ2I,GAAUA,EAAOggB,WAAcxc,KAAQnM,IAAI4oB,OAAO5oB,KAG7F6oB,EAAsB,SAAUC,GAChC,OAAO,SAA0B9sB,GAC7B,OAAQ8sB,EAAO9sB,IAAUA,EAAMgE,IAAMhE,EAAQA,EAAM2M,OAAS3M,EAAM2M,OAAOggB,UAAY,OAc7F,SAASI,EAAY/sB,GACjB,OAAOA,EAAM2M,OAAS3M,EAAM2M,OAAOjS,KAAK/F,OAAOqL,GAAkB,CAACA,GAEtE,SAASgtB,EAAgBhtB,GACrB,IAAI6L,EAAW7L,EAAM2M,QAAS,QAAO,GAAI3M,EAAM2M,OAAOd,UAAY,GAElE,OADAA,EAAS7L,EAAMjI,OAAQ,EAChB8T,EA2CJ,SAASohB,EAAmBjtB,GAE/B,IAA+BktB,EAAY3E,EA2BvC4E,EAAW,SAAUC,GAAK,OAAOA,EAAEC,SAAWD,EAAEtZ,OAEhDwZ,GAAqB,QAAQ,CAC7B,EAAC,QAAK,aAAc,SAAUF,GAAK,OAAO,IAAI,IAAWD,EAASC,GAAIA,EAAE3iB,UAAW2iB,EAAE/oB,KAAM+oB,EAAEvE,UAC7F,EAAC,QAAK,cAAe,SAAUuE,GAAK,OAAO,IAAI,IAAWD,EAASC,GAAIA,EAAEG,WAAYH,EAAE/oB,MAAQ+oB,EAAEI,aAAcJ,EAAEvE,UACjH,EAAC,QAAK,YAAa,SAAUuE,GAAK,OAAO,IAAI,IAAWD,EAASC,IAAI,WAAc,OAAO,IAAIA,EAAEK,WAAe,GAAIL,EAAEvE,UACrH,EAAC,QAAK,YAAa,SAAUuE,GAAK,OAAO,IAAI,IAAWD,EAASC,IAAI,WAAc,OAAOA,EAAEM,WAAa,GAAIN,EAAEvE,OAAQuE,EAAEM,YACzH,EAAC,QAAK,eAAgB,SAAUN,GAAK,OAAO,IAAI,IAAWD,EAASC,GAAI,KAAU,CAACA,EAAEO,aAAcP,EAAEvE,YAGrG+E,GAAmB,QAAQ,CAC3B,EAAC,SAAK,QAAK,OAAQ,MAAW,SAAU5nB,GAAS,OAAO,IAAI,IAAWA,EAAM8N,MAAO,KAAU,CAAC9N,EAAMzP,KAAMyP,EAAM6iB,UACjH,EAAC,SAAK,QAAK,OAAQ,MAAU,SAAU7iB,GAAS,OAAO,IAAI,IAAWA,EAAM8N,OAAO,QAAK9N,EAAMzP,KAAMyP,EAAMzP,IAAIlC,MAAM,GAAI,GAAI2R,EAAM6iB,UAClI,EAAC,SAAK,QAAK,OAAQ,MAAa,SAAU7iB,GAAS,OAAO,IAAI,IAAWA,EAAM8N,MAAO9N,EAAMzP,KA/BvErD,EA+BqF8S,EAAMzP,IA9B5GuM,EAAY,cAIT5P,EAAY,SAAM4P,GAAaA,EAAU0H,SAAStX,EAAI4P,EAAUuH,WAAc,YA0BiCrE,EAAM6iB,QA/BjH,IAAU31B,EACjB4P,MAiCJ+qB,GAAkB,QAAQ,CAC1B,EAAC,IAAApiB,IAAG,KAAa,SAAUqE,GAAK,OAAOA,IACvC,CA5BmB,SAAUtD,GAAO,SAAUA,EAAIsH,QAAStH,EAAI/B,YA4B5C6iB,GACnB,CA3BoB,SAAU9gB,GAC9B,SAAWA,EAAI6gB,UAAW7gB,EAAIsH,SAAWtH,EAAIkhB,UAAYlhB,EAAI+gB,YAAc/gB,EAAImhB,aAAenhB,EAAIihB,YA0B9EH,GACpB,CAxBiB,SAAU9gB,GAC3B,SAAUA,GAAOA,EAAIjW,OAAQ,QAASiW,EAAIjW,OAAQ,QAAQiW,EAAIjW,OAAQ,QAAWiW,EAAIjW,QAuBpEq3B,GACjB,EAAC,SAAI,GAAO,SAAUphB,GAAO,MAAM,IAAIxH,MAAM,2BAA4B,QAAUwH,QAInFshB,EAAO9tB,EAAMd,QAEjB,QADY,QAAQ4uB,GAAQA,GArDGZ,EAqDmBY,EArDPvF,EAqDavoB,EAAMkpB,eAAiB,GApDpEpjB,OAAOC,KAAKmnB,GAAc,IAAIhsB,KAAI,SAAU4S,GAAS,MAAO,CAC/DA,MAAOA,EACPvd,IAAK22B,EAAWpZ,GAChBzP,UAAMqC,EACNmiB,OAAQN,EAAgBzU,SAiDnB5S,IAAI2sB,GAcrB,IAAIE,EAA8B,WAC9B,SAASA,EAAaC,EAAS7mB,GAC3B5U,KAAKy7B,QAAUA,EACf,IArIyBC,EAqIrBhuB,EAAO1N,KACP4d,EAAO,WAAc,OAAO6d,EAAQ3a,KAAK,KACzCyZ,EAAS,SAAU9sB,GAAS,MAAsB,KAAfA,EAAMjI,MAM7CxF,KAAK27B,SAAW,CACZn2B,KAAM,CAACi0B,GACP/rB,KAAM,CAACgsB,GACPtf,OAAQ,CARZ,SAAuB3M,GACnB,OAAI8sB,EAAO9sB,GACA,KACJguB,EAAQ3a,KAAKpT,EAAKkuB,WAAWnuB,KAAWmQ,MAM/CjW,KAAM,CAACgyB,GAEPloB,IAAK,CAACmoB,EAAchlB,EAAmBgJ,IAEvCwc,UAAW,CAACE,EAAoBC,IAChCnsB,OAAQ,EAtJastB,EAsJK9mB,EAAkB8mB,aArJ7C,SAAuBjuB,GAC1B,IACIouB,EAAapuB,EAAMgE,KAAOhE,EAAMgE,IAAI4hB,WAAW,CAAEjU,SAAS,KAAa,GACvE0c,GAAe,SAAO,SAAO,QAAKruB,EAAMW,QAAU,GAAIytB,EAAUltB,KAAI,QAAK,SAFvD,SAAUpD,EAAQF,GAAM,OAAOqwB,EAAa9qB,WAAWvF,EAAI,KAAMoC,EAAMC,UAG7F,OAAOmuB,EACFz5B,OAAO05B,GACPntB,KAAI,SAAUksB,GAAK,MAAO,CAACA,EAAExvB,GAAIwvB,MACjCjsB,OAAO,KAAY,OAiJpB4L,MAAO,GAEPrS,KAAM,CAACqyB,GAEPlhB,SAAU,CAACmhB,GACX1iB,YAAa,CAAC2iB,IAgEtB,OA7DAc,EAAa35B,UAAUk6B,QAAU,SAAUv2B,EAAM7E,GAC7C,IAAIg7B,EAAW37B,KAAK27B,SAChBpc,EAAQoc,EAASn2B,IAAS,GAE9B,OAAI,QAASA,MAAU,QAAU7E,GACtB4e,EAAMnQ,OAAS,EAAImQ,EAAQA,EAAM,IACvC,QAAS/Z,KAAU,QAAW7E,IAEnCg7B,EAASn2B,GAAQ+Z,EACjBoc,EAASn2B,GAAM/E,KAAKE,GACb,WAAc,OAAOg7B,EAASn2B,GAAMga,OAAOmc,EAASn2B,GAAM0I,QAAQvN,EAAI,KAAO,YAJpF,GAaJ66B,EAAa35B,UAAUm6B,MAAQ,SAAUvuB,GACrC,IAAeguB,EAANz7B,KAAmBy7B,QAASE,EAA5B37B,KAA0C27B,SAC/CvhB,EAASpa,KAAK47B,WAAWnuB,GAC7B,GAAI2M,IAAWqhB,EAAQ3a,KAAK1G,OAAQjG,GAAW,GAC3C,OAAO,KAEX,IAAK,IAAItO,KAAO81B,EACZ,GAAKA,EAASj5B,eAAemD,GAA7B,CAEA,IAAIo2B,EAAQN,EAAS91B,GAAK+I,QAAO,SAAUstB,EAAUpS,GAAQ,OAAO,SAAUmD,GAAU,OAAOnD,EAAKmD,EAAQiP,MAAiB,MAC7HzuB,EAAM5H,GAAOo2B,EAAMxuB,GAEvB,OAAOA,GAEX+tB,EAAa35B,UAAU+5B,WAAa,SAAUnuB,GAE1C,IAAIjI,EAAOiI,EAAMjI,MAAQ,GAErB22B,EAAW32B,EAAKsd,MAAM,KAM1B,GAFoB,OAFFqZ,EAASC,OAGvBD,EAASC,MACTD,EAAS/sB,OAAQ,CACjB,GAAI3B,EAAM2M,OACN,MAAM,IAAI3H,MAAM,mFAAqFjN,EAAO,KAGhH,OAAO22B,EAASlpB,KAAK,KAEzB,OAAKxF,EAAM2M,QAEJ,QAAS3M,EAAM2M,QAAU3M,EAAM2M,OAAS3M,EAAM2M,OAAO5U,KADjD,IAGfg2B,EAAa35B,UAAU2D,KAAO,SAAUiI,GACpC,IAAIjI,EAAOiI,EAAMjI,KACjB,IAA2B,IAAvBA,EAAK0I,QAAQ,OAAgBT,EAAM2M,OACnC,OAAO5U,EACX,IAAIo2B,GAAa,QAASnuB,EAAM2M,QAAU3M,EAAM2M,OAAS3M,EAAM2M,OAAO5U,KACtE,OAAOo2B,EAAaA,EAAa,IAAMp2B,EAAOA,GAE3Cg2B,EA5FsB,iTClL7Ba,EAA8B,WAC9B,SAASA,EAAaC,GAClBt8B,KAAKs8B,QAAUA,EAmDnB,OAjDAD,EAAax6B,UAAU06B,WAAa,SAAUC,GAE1C,OAAkC,KADlCA,EAAYA,GAAa,IACRtuB,QAAQ,MAAyC,IAA3BsuB,EAAUtuB,QAAQ,MAE7DmuB,EAAax6B,UAAUif,KAAO,SAAU2b,EAAaC,EAAMC,GAEvD,QADkB,IAAdA,IAAwBA,GAAY,GACnCF,GAA+B,KAAhBA,EAApB,CAEA,IAAIG,GAAQ,QAASH,GACjBj3B,EAAOo3B,EAAQH,EAAcA,EAAYj3B,KACzCxF,KAAKu8B,WAAW/2B,KAChBA,EAAOxF,KAAK03B,YAAYlyB,EAAMk3B,IAClC,IAAIjvB,EAAQzN,KAAKs8B,QAAQ92B,GACzB,GAAIiI,IAAUmvB,KAAWA,GAAUnvB,IAAUgvB,GAAehvB,EAAMC,OAAS+uB,IACvE,OAAOhvB,EAEN,GAAImvB,GAASD,EAAW,CACzB,IACIzZ,GADU,QAAOljB,KAAKs8B,SACJhzB,QAAO,SAAU2jB,GAAU,OAAOA,EAAO4P,mBAAmBC,UAAY7P,EAAO4P,mBAAmBC,SAAS5Z,QAAQ1d,MAIzI,OAHI0d,EAAQ9T,OAAS,GACjB,UAAkB,iDAAmD5J,EAAO,gBAAiB0d,EAAQvU,KAAI,SAAUqN,GAAS,OAAOA,EAAMxW,SAEtI0d,EAAQ,MAIvBmZ,EAAax6B,UAAU61B,YAAc,SAAUlyB,EAAMk3B,GACjD,IAAKA,EACD,MAAM,IAAIjqB,MAAM,sCAAwCjN,EAAO,KAKnE,IAJA,IAAIu3B,EAAY/8B,KAAK8gB,KAAK4b,GACtBM,EAAYx3B,EAAKsd,MAAM,KACvBma,EAAaD,EAAU5tB,OACvBiO,EAAI,EAAGyI,EAAUiX,EACd1f,EAAI4f,EAAY5f,IACnB,GAAqB,KAAjB2f,EAAU3f,IAAmB,IAANA,EAA3B,CAIA,GAAqB,MAAjB2f,EAAU3f,GAMd,MALI,IAAKyI,EAAQ1L,OACT,MAAM,IAAI3H,MAAM,SAAWjN,EAAO,0BAA4Bu3B,EAAUv3B,KAAO,KACnFsgB,EAAUA,EAAQ1L,YANlB0L,EAAUiX,EAWlB,IAAIG,EAAUF,EAAUl7B,MAAMub,GAAGpK,KAAK,KACtC,OAAO6S,EAAQtgB,MAAQsgB,EAAQtgB,MAAQ03B,EAAU,IAAM,IAAMA,GAE1Db,EArDsB,oWCW7Bc,EAA6B,WAE7B,SAASA,EAAY5xB,GACjB,OAAO4xB,EAAY37B,OAAO+J,GAAU,IA4FxC,OAlFA4xB,EAAY37B,OAAS,SAAU47B,GAC3BA,EAAYD,EAAYE,aAAaD,GAAa,IAAIA,EAAcA,EACpE,IAAI3vB,GAAQ,SAAQ,QAAQ2vB,EAAWD,EAAYt7B,YAMnD,OALAu7B,EAAUppB,QAAU,WAAc,OAAOvG,GACzCA,EAAMC,KAAO0vB,EACb3vB,EAAMovB,mBAAqB,CACvBC,SAAU,eAAgBrvB,EAAMjI,OAE7BiI,GAaX0vB,EAAYt7B,UAAUqX,GAAK,SAAUokB,GACjC,OAAOt9B,OAASs9B,GAAOt9B,KAAK0N,OAAS4vB,GAAOt9B,KAAKsL,QAAUgyB,GAM/DH,EAAYt7B,UAAUyJ,IAAM,WACxB,KAAKtL,KAAKoa,QAAYpa,KAAKoa,kBAAkBpa,KAAKokB,aAC9C,OAAOpkB,KAAKwF,KAChB,IAAIA,EAAOxF,KAAKoa,OAAO9O,MACvB,OAAO9F,EAAOA,EAAO,IAAMxF,KAAKwF,KAAOxF,KAAKwF,MAOhD23B,EAAYt7B,UAAU+b,KAAO,WACzB,OAAQ5d,KAAKoa,QAAUpa,KAAKoa,OAAOwD,QAAW5d,MAWlDm9B,EAAYt7B,UAAUwxB,WAAa,SAAUzyB,GAGzC,QAFAA,GAAO,QAASA,EAAM,CAAEwe,SAAS,EAAMme,aAAc,QAC/Bne,SAAWpf,KAAKoa,QAAUpa,KAAKoa,OAAOiZ,cAAiB,IAExEjxB,QAAO,QAAOpC,KAAKoO,SACnB9E,QAAO,SAAU0F,GAAS,OAAQpO,EAAK28B,cAAgB38B,EAAK28B,aAAa76B,eAAesM,EAAM3D,QASvG8xB,EAAYt7B,UAAU4xB,UAAY,SAAUpoB,EAAIzK,GAE5C,YADa,IAATA,IAAmBA,EAAO,IACrBZ,KAAKyR,KAAOzR,KAAKyR,IAAIgiB,UAAUpoB,EAAIzK,KACxC,SAAK,QAAOZ,KAAKoO,SAAS,QAAO,KAAM/C,KACtCzK,EAAKwe,SAAWpf,KAAKoa,QAAUpa,KAAKoa,OAAOqZ,UAAUpoB,IAE9D8xB,EAAYt7B,UAAUiT,SAAW,WAC7B,OAAO9U,KAAKsL,OAGhB6xB,EAAYE,aAAe,SAAUD,GACjC,OAAO,QAAWA,KAA+C,IAAjCA,EAA2B,iBAG/DD,EAAYK,mBAAqB,SAAUvjB,GAAO,OAAO,QAAWA,EAAa,UAEjFkjB,EAAYM,QAAU,SAAUxjB,GAAO,OAAO,QAASA,EAAwB,qBACxEkjB,EA/FqB,kPCZ5BO,EAAmC,WACnC,SAASA,EAAkBhpB,EAAQsY,EAAQ+O,EAAS4B,GAChD39B,KAAK0U,OAASA,EACd1U,KAAKgtB,OAASA,EACdhtB,KAAK+7B,QAAUA,EACf/7B,KAAK29B,UAAYA,EACjB39B,KAAK49B,MAAQ,GA4EjB,OA1EAF,EAAkB77B,UAAUqT,QAAU,WAClClV,KAAK49B,MAAQ,IAEjBF,EAAkB77B,UAAU6X,SAAW,SAAU0jB,GAC7C,IAAIQ,EAAQ59B,KAAK49B,MACbnwB,EAAQ,WAAmB2vB,GAC3B53B,EAAOiI,EAAMjI,KACjB,KAAK,QAASA,GACV,MAAM,IAAIiN,MAAM,gCACpB,GAAIzS,KAAKgtB,OAAOtqB,eAAe8C,KAAS,QAAQo4B,EAAMjvB,KAAI,QAAK,SAAUnJ,GACrE,MAAM,IAAIiN,MAAM,UAAYjN,EAAO,wBAGvC,OAFAo4B,EAAMn9B,KAAKgN,GACXzN,KAAK69B,QACEpwB,GAEXiwB,EAAkB77B,UAAUg8B,MAAQ,WAchC,IAbA,IAAI1tB,EAAQnQ,KACRqrB,EAAKrrB,KAAM49B,EAAQvS,EAAGuS,MAAO5Q,EAAS3B,EAAG2B,OAAQ+O,EAAU1Q,EAAG0Q,QAC9D+B,EAAa,GACjBC,EAAU,GACVC,EAAsB,GAClBC,EAAW,SAAUz4B,GAAQ,OAAO2K,EAAM6c,OAAOtqB,eAAe8C,IAAS2K,EAAM6c,OAAOxnB,IACtF04B,EAAkB,WACdJ,EAAW1uB,QACXe,EAAMwtB,UAAU58B,SAAQ,SAAUo9B,GAC9B,OAAOA,EAAS,aAAcL,EAAWnvB,KAAI,SAAUyO,GAAK,OAAOA,EAAE1P,aAI1EkwB,EAAMxuB,OAAS,GAAG,CACrB,IAAI3B,EAAQmwB,EAAM37B,QACdm8B,EAAS3wB,EAAMjI,KACfc,EAASy1B,EAAQC,MAAMvuB,GACvB4wB,EAAYN,EAAQ7vB,QAAQT,GAChC,GAAInH,EAAJ,CACI,IAAIg4B,EAAgBL,EAASG,GAC7B,GAAIE,GAAiBA,EAAc94B,OAAS44B,EACxC,MAAM,IAAI3rB,MAAM,UAAY2rB,EAAS,wBAEzC,IAAIG,EAAsBN,EAASG,EAAS,OACxCG,GAEAv+B,KAAK0U,OAAOkC,cAAc4nB,WAAWD,GAEzCvR,EAAOoR,GAAU3wB,EACjBzN,KAAKy+B,YAAYhxB,GACb4wB,GAAa,GACbN,EAAQve,OAAO6e,EAAW,GAC9BP,EAAWr9B,KAAKgN,OAdpB,CAiBA,IAAIixB,EAAOV,EAAoBI,GAE/B,GADAJ,EAAoBI,GAAUR,EAAMxuB,OAChCivB,GAAa,GAAKK,IAASd,EAAMxuB,OAKjC,OAFAwuB,EAAMn9B,KAAKgN,GACXywB,IACOlR,EAEFqR,EAAY,GACjBN,EAAQt9B,KAAKgN,GAEjBmwB,EAAMn9B,KAAKgN,IAGf,OADAywB,IACOlR,GAEX0Q,EAAkB77B,UAAU48B,YAAc,SAAUhxB,GAChD,IAAIA,EAAMkxB,UAAalxB,EAAMgE,IAA7B,CAEA,IAAImtB,EAAW5+B,KAAK0U,OAAOuC,WAAW0F,MACtCiiB,EAASriB,KAAKqiB,EAASC,eAAer9B,OAAOiM,MAE1CiwB,EAlF2B,sbCQlCoB,EAA+B,WAE/B,SAASA,EAAcpqB,GACnB1U,KAAK0U,OAASA,EACd1U,KAAKgtB,OAAS,GAEdhtB,KAAK29B,UAAY,GACjB39B,KAAKy7B,QAAU,IAAI,IAAaz7B,KAAKgtB,QACrChtB,KAAK+7B,QAAU,IAAI,IAAa/7B,KAAKy7B,QAAS/mB,EAAOE,mBACrD5U,KAAK++B,WAAa,IAAI,IAAkBrqB,EAAQ1U,KAAKgtB,OAAQhtB,KAAK+7B,QAAS/7B,KAAK29B,WAChF39B,KAAKg/B,gBAmJT,OAhJAF,EAAcj9B,UAAUm9B,cAAgB,YAUvBh/B,KAAKi/B,MAAQj/B,KAAK++B,WAAWrlB,SATvB,CACflU,KAAM,GACNiM,IAAK,IACL+I,MAAO,KACPpM,OAAQ,CACJ,IAAK,CAAE5J,MAAO,KAAM0K,KAAM,OAAQye,SAAS,IAE/CgR,UAAU,KAGRvE,UAAY,MAGtB0E,EAAcj9B,UAAUqT,QAAU,WAC9B,IAAI/E,EAAQnQ,KACZA,KAAK++B,WAAW7pB,UAChBlV,KAAK29B,UAAY,GACjB39B,KAAK0Q,MAAM3P,SAAQ,SAAU0M,GAAS,OAAO0C,EAAMO,IAAIjD,IAAU0C,EAAMquB,WAAW/wB,OAgCtFqxB,EAAcj9B,UAAUq9B,gBAAkB,SAAUf,GAEhD,OADAn+B,KAAK29B,UAAUl9B,KAAK09B,GACb,YACH,QAAWn+B,KAAK29B,UAAhB,CAA2BQ,IAC7B76B,KAAKtD,OAWX8+B,EAAcj9B,UAAU+b,KAAO,WAC3B,OAAO5d,KAAKi/B,OAchBH,EAAcj9B,UAAU6X,SAAW,SAAUylB,GACzC,OAAOn/B,KAAK++B,WAAWrlB,SAASylB,IAGpCL,EAAcj9B,UAAUu9B,gBAAkB,SAAU3xB,GAChD,IAAI0C,EAAQnQ,KACRyb,EAAMzb,KAAK0Q,MAAM/B,KAAI,SAAUyO,GAAK,OAAOA,EAAEpJ,aAC7CqrB,EAAc,SAAUrS,GACxB,IAAIsS,EAAY7jB,EAAInS,QAAO,SAAU8T,GAAK,OAAqC,IAA9B4P,EAAO9e,QAAQkP,EAAEhD,WAClE,OAA4B,IAArBklB,EAAUlwB,OAAekwB,EAAYA,EAAUl9B,OAAOi9B,EAAYC,KAEzE12B,EAAWy2B,EAAY,CAAC5xB,IACxB8xB,EAAe,CAAC9xB,GAAOrL,OAAOwG,GAAUoX,UAW5C,OAVAuf,EAAax+B,SAAQ,SAAUksB,GAC3B,IAAI2R,EAAWzuB,EAAMuE,OAAOuC,WAAW0F,MAEvCiiB,EACKjiB,QACArT,QAAO,QAAO,QAAS2jB,IACvBlsB,SAAQ,SAAUwb,GAAQ,OAAOqiB,EAASY,WAAWjjB,aAEnDpM,EAAM6c,OAAOC,EAAOznB,SAExB+5B,GAWXT,EAAcj9B,UAAU28B,WAAa,SAAU/B,GAC3C,IAAIxP,EAASjtB,KAAK0Q,IAAI+rB,GACtB,IAAKxP,EACD,MAAM,IAAIxa,MAAM,sCAAwCgqB,GAC5D,IAAIgD,EAAqBz/B,KAAKo/B,gBAAgBnS,EAAOjZ,WAIrD,OAHAhU,KAAK29B,UAAU58B,SAAQ,SAAUo9B,GAC7B,OAAOA,EAAS,eAAgBsB,EAAmB9wB,KAAI,SAAUyO,GAAK,OAAOA,EAAE1P,YAE5E+xB,GAEXX,EAAcj9B,UAAU6O,IAAM,SAAU+rB,EAAaC,GACjD,IAAIvsB,EAAQnQ,KACZ,GAAyB,IAArBgC,UAAUoN,OACV,OAAOmE,OAAOC,KAAKxT,KAAKgtB,QAAQre,KAAI,SAAUnJ,GAAQ,OAAO2K,EAAM6c,OAAOxnB,GAAMkI,QACpF,IAAIgyB,EAAQ1/B,KAAKy7B,QAAQ3a,KAAK2b,EAAaC,GAC3C,OAAQgD,GAASA,EAAMhyB,MAAS,MAYpCoxB,EAAcj9B,UAAUiV,UAAY,SAAU6oB,EAAUC,GACpD,OAAO5/B,KAAK+7B,QAAQA,QAAQ4D,EAAUC,IAEnCd,EA7JuB,2SCsB9Be,EAA6B,WAe7B,SAASA,EAAYC,EAAgBC,EAAaC,EAASC,GACvDjgC,KAAK8/B,eAAiBA,EACtB9/B,KAAK+/B,YAAcA,EACnB//B,KAAK+/B,YAAcA,EACnB//B,KAAKggC,SAAU,QAAO,GAAIA,GAAW,IACrChgC,KAAKigC,UAAW,QAAO,GAAIA,GAAY,IACvCjgC,KAAKkgC,YAAcJ,EAAerE,QAAQ3a,KAAKif,EAAa//B,KAAKigC,SAASE,UAsF9E,OAnFAN,EAAYh+B,UAAU2D,KAAO,WACzB,OAAQxF,KAAKkgC,aAAelgC,KAAKkgC,YAAY16B,MAASxF,KAAK+/B,aAG/DF,EAAYh+B,UAAU4qB,WAAa,WAC/B,OAAOzsB,KAAK+/B,aAGhBF,EAAYh+B,UAAUuM,OAAS,WAC3B,OAAOpO,KAAKggC,SAGhBH,EAAYh+B,UAAU4W,OAAS,WAC3B,OAAOzY,KAAKkgC,aAGhBL,EAAYh+B,UAAU4L,MAAQ,WAC1B,OAAOzN,KAAKkgC,aAAelgC,KAAKkgC,YAAYxyB,MAGhDmyB,EAAYh+B,UAAU1B,QAAU,WAC5B,OAAOH,KAAKigC,UAGhBJ,EAAYh+B,UAAUu+B,OAAS,WAC3B,SAAUpgC,KAAKkgC,cAAelgC,KAAKkgC,YAAYxyB,OAGnDmyB,EAAYh+B,UAAUw+B,MAAQ,WAC1B,OAAQrgC,KAAKqF,SAGjBw6B,EAAYh+B,UAAUwD,MAAQ,WAC1B,IAAIq3B,EAAO18B,KAAKG,UAAUggC,SAC1B,IAAKngC,KAAKkgC,aAAiBxD,EAAM,CAC7B,IAAIF,EAAYE,EAAKl3B,KAAOk3B,EAAKl3B,KAAOk3B,EACxC,MAAO,sBAAwB18B,KAAKwF,OAAS,iBAAmBg3B,EAAY,IAEhF,OAAKx8B,KAAKkgC,YAELlgC,KAAKkgC,YAAYxyB,UAAtB,EACW,UAAY1N,KAAKwF,OAAS,8BAF1B,kBAAoBxF,KAAKwF,OAAS,KAIjDq6B,EAAYh+B,UAAUiT,SAAW,WAC7B,MAAO,IAAM9U,KAAKwF,OAAS,KAAM,QAAUxF,KAAKoO,WAQpDyxB,EAAYh+B,UAAUy+B,UAAY,SAAU7yB,GACxC,OAAO,IAAIoyB,EAAY7/B,KAAK8/B,eAAgBryB,EAAOzN,KAAKggC,QAAShgC,KAAKigC,WAS1EJ,EAAYh+B,UAAU0+B,WAAa,SAAUnyB,EAAQ2G,QACjC,IAAZA,IAAsBA,GAAU,GACpC,IAAI8d,EAAY9d,EAAU3G,GAAS,QAAO,GAAIpO,KAAKggC,QAAS5xB,GAC5D,OAAO,IAAIyxB,EAAY7/B,KAAK8/B,eAAgB9/B,KAAK+/B,YAAalN,EAAW7yB,KAAKigC,WASlFJ,EAAYh+B,UAAU2+B,YAAc,SAAUrgC,EAAS4U,QACnC,IAAZA,IAAsBA,GAAU,GACpC,IAAI0rB,EAAU1rB,EAAU5U,GAAU,QAAO,GAAIH,KAAKigC,SAAU9/B,GAC5D,OAAO,IAAI0/B,EAAY7/B,KAAK8/B,eAAgB9/B,KAAK+/B,YAAa//B,KAAKggC,QAASS,IAGhFZ,EAAYa,MAAQ,SAAUzmB,GAC1B,OAAOA,GAAOA,EAAIxM,SAAU,QAASwM,EAAIxM,SAAW,QAASwM,EAAIxM,SAAU,QAASwM,EAAIxM,MAAMjI,QAE3Fq6B,EA3GqB,iYCf5Bc,EAA6B,WAC7B,SAASA,EAAY1U,GACjBjsB,KAAKisB,WAAaA,EA2EtB,OAzEA0U,EAAY9+B,UAAU++B,mBAAqB,SAAUC,GACjD,IAAI1wB,EAAQnQ,KAEZ,OADmBA,KAAKisB,WAAWvX,OAAOoY,kBACtB9iB,WACf82B,WAAWD,GACXlyB,KAAI,SAAUO,GAAQ,OAAOiB,EAAM4wB,WAAW7xB,MAC9CN,OAAO,KAAS,IAChBtF,OAAO,OAWhBq3B,EAAY9+B,UAAUk/B,WAAa,SAAUC,GACzC,IAAI/U,EAAajsB,KAAKisB,WAClBvd,EAAcud,EAAWvd,cAEzBuyB,EAAgBjhC,KAAKkhC,iBAAiBF,EAAUtyB,EAAaud,GACjE,IAAKgV,EACD,MAAO,GACX,IA4DWE,EA5DPC,EAAkB,CAClBnV,WAAYA,EACZnG,QAASmG,EAAW9rB,UAAU2lB,SAkBlC,OAAOmb,EACFtyB,KAjBqB,SAAUkF,GAMhC,OAJcA,EAAKqP,QAAQxU,EAAaud,GAEZ+U,EAASK,kBAAkB77B,MAElCmJ,KAAI,SAAUJ,GAC/B,IAAI0xB,GAAW,QAAO,CAClB38B,KAAMuQ,EAAKvQ,KACXg+B,UAAW,CAAEN,SAAUA,EAASx7B,KAAMqL,QAAStC,IAChD6yB,GACC3zB,EAAQuzB,EAASK,kBAAkBv+B,QAAU,UAA4ByL,EAAKd,MAAMC,KAAO,KAC3F6zB,EAAiB,IAAI,IAAetV,EAAYxe,EAAOoG,EAAMosB,GACjE,MAAO,CAAEpsB,KAAMA,EAAMtF,KAAMA,EAAMgzB,eAAgBA,SAKpD3yB,OAAO,KAAS,IAChB4c,MAqCM2V,EArCSH,EAASQ,iBAsCR,IAArBL,IAA+BA,GAAmB,GAC/C,SAA+B1O,EAAGlV,GACrC,IAAIkkB,EAASN,GAAoB,EAAI,EACjCO,GAAcjP,EAAElkB,KAAKd,MAAMtF,KAAKiH,OAASmO,EAAEhP,KAAKd,MAAMtF,KAAKiH,QAAUqyB,EACzE,OAAsB,IAAfC,EAAmBA,EAAankB,EAAE1J,KAAKzM,SAAWqrB,EAAE5e,KAAKzM,YAzC3DuH,KAAI,SAAU8E,GAAS,OAAOA,EAAM8tB,mBAa7CZ,EAAY9+B,UAAUq/B,iBAAmB,SAAUF,EAAUtyB,EAAaud,GACtE,IAAI0V,EAAWX,EAASY,YAAc,WAElC/6B,EAAe7G,KAAKisB,WAAWvX,OAAOoY,kBAE1C,OADiB6U,EAAW,CAAC96B,GAAgB,CAAC7G,KAAKisB,WAAYplB,IAE1D8H,KAAI,SAAUkzB,GAAO,OAAOA,EAAIC,SAASd,EAASx7B,SAClD8D,QAAO,QAAgB,KAAS,uBAAyB03B,EAASx7B,OAClEoJ,OAAO,KAAS,IAChBtF,QAAO,SAAUuK,GAAQ,OAAOA,EAAKqP,QAAQxU,EAAaud,OAE5D0U,EA7EqB,+PCDzB,SAASoB,EAAWt0B,EAAOu0B,EAAW/V,GACzC,IAAIgW,GAAU,QAASD,GAAa,CAACA,GAAaA,EAYlD,UADe,QAAWC,GAAWA,EAVrC,SAAoBhV,GAEhB,IADA,IAAIiV,EAAcD,EACT5kB,EAAI,EAAGA,EAAI6kB,EAAY9yB,OAAQiO,IAAK,CACzC,IAAIwF,EAAO,IAAI,KAAKqf,EAAY7kB,IAChC,GAAKwF,GAAQA,EAAKK,QAAQ+J,EAAOznB,QAAYqd,GAAQqf,EAAY7kB,KAAO4P,EAAOznB,KAC3E,OAAO,EAGf,OAAO,IAGMiI,EAAOwe,GAK5B,IAAIkW,EAAgC,WAChC,SAASA,EAAeC,EAASC,EAAW7hC,EAAU8hC,EAAeC,EAAwBpiC,QACzE,IAAZA,IAAsBA,EAAU,IACpCH,KAAKoiC,QAAUA,EACfpiC,KAAKqiC,UAAYA,EACjBriC,KAAKQ,SAAWA,EAChBR,KAAKsiC,cAAgBA,EACrBtiC,KAAKuiC,uBAAyBA,EAC9BviC,KAAKwiC,YAAc,EACnBxiC,KAAKyiC,eAAgB,EACrBziC,KAAKoH,SAAWjH,EAAQiH,UAAY,EACpCpH,KAAKsD,KAAOnD,EAAQmD,MAAQ,KAC5BtD,KAAK0iC,YAAcviC,EAAQuiC,YAqF/B,OApEAP,EAAetgC,UAAU8gC,eAAiB,SAAUC,EAAOZ,EAAW/V,GAClE,IAAkB,IAAd+V,EACA,OAAOY,EACX,IAAIpN,EAAWoN,EAAMt5B,QAAO,SAAUiF,GAAQ,OAAOwzB,EAAWxzB,EAAKd,MAAOu0B,EAAW/V,MACvF,OAAOuJ,EAASpmB,OAASomB,EAAW,MAgBxC2M,EAAetgC,UAAUghC,yBAA2B,WAChD,OAAO,QAAO7iC,KAAKoiC,QAAQp4B,WAAW84B,iBAAiB,WAAc,OAAO,MAiBhFX,EAAetgC,UAAUkhC,kBAAoB,SAAUr0B,EAAaud,GAChE,IAAI9b,EAAQnQ,KACR8P,GAAW,QAAO9P,KAAK6iC,2BAA4B7iC,KAAKsiC,eAE5D,OADY,QAAOtiC,KAAKoiC,QAAQp4B,WAAW84B,iBAC9Bl0B,QAAO,SAAUo0B,EAAIC,GAG9B,IAAIC,EAAcD,EAASngC,QAAU,UACjCqF,EAAOuG,EAAYu0B,EAASz9B,OAAS,GACrCo9B,EAAQM,EAAc/6B,EAAO,EAAC,QAAKA,IAEvC,OADA66B,EAAGC,EAASz9B,MAAQ2K,EAAMwyB,eAAeC,EAAO9yB,EAASmzB,EAASz9B,MAAOymB,GAClE+W,IACR,KAQPb,EAAetgC,UAAUqhB,QAAU,SAAUxU,EAAaud,GACtD,IAAI/I,EAAUljB,KAAK+iC,kBAAkBr0B,EAAaud,GAGlD,OADiB,QAAO/I,GAASigB,MAAM,MACnBjgB,EAAU,MAElCif,EAAetgC,UAAU28B,WAAa,WAClCx+B,KAAKuiC,uBAAuBviC,MAC5BA,KAAKyiC,eAAgB,GAElBN,EAjGwB,GAqG5B,SAASiB,EAAUtP,EAAUhH,EAAmBuV,GAEnD,IACIgB,GADoBvP,EAASwP,iBAAmBxP,EAASwP,kBAAoB,IACnDjB,EAAU78B,MAAQ,GAC5C+9B,GAAe,QAAWF,GAG9B,SAASG,EAAmBC,EAAajjC,EAAUL,QAC/B,IAAZA,IAAsBA,EAAU,IACpC,IAAI6pB,EAAiB,IAAImY,EAAerV,EAAmBuV,EAAW7hC,EAAUijC,EAAaF,EAAcpjC,GAE3G,OADAkjC,EAAM5iC,KAAKupB,GACJA,EAAewU,WAAWl7B,KAAK0mB,GAE1C,OAPA8J,EAASuO,EAAU78B,MAAQg+B,EAOpBA,2FCpJX,IAAIE,EAQAC,2BAPJ,SAAWD,GACPA,EAAoBA,EAA4B,OAAI,GAAK,SACzDA,EAAoBA,EAA4B,OAAI,GAAK,SACzDA,EAAoBA,EAAyB,IAAI,GAAK,MACtDA,EAAoBA,EAA6B,QAAI,GAAK,UAC1DA,EAAoBA,EAA2B,MAAI,GAAK,QAL5D,CAMGA,IAAwBA,EAAsB,KAEjD,SAAWC,GACPA,EAAoBA,EAAgC,WAAI,GAAK,aAC7DA,EAAoBA,EAA2B,MAAI,GAAK,QAF5D,CAGGA,IAAwBA,EAAsB,8HCP7CC,2LACJ,SAAWA,GAOPA,EAAWA,EAAuB,WAAI,GAAK,aAM3CA,EAAWA,EAAoB,QAAI,GAAK,UAMxCA,EAAWA,EAAoB,QAAI,GAAK,UAWxCA,EAAWA,EAAoB,QAAI,GAAK,UAMxCA,EAAWA,EAAkB,MAAI,GAAK,QApC1C,CAqCGA,IAAeA,EAAa,KAG/B,IAAIv4B,EAAK,EACLw4B,EAA2B,WAC3B,SAASA,EAAU30B,EAAM40B,EAASC,GAE9B/jC,KAAKmb,IAAM9P,IACXrL,KAAKkP,KAAOA,EACZlP,KAAK8jC,QAAUA,EACf9jC,KAAK+jC,OAASA,EA4DlB,OAzDAF,EAAUG,mBAAqB,SAAU/pB,GACrC,OAAOA,GAA2B,mBAAbA,EAAIlP,OAAuB,IAAAmO,IAAG2qB,EAAH,CAAc5pB,EAAIyN,uBAGtEmc,EAAUI,WAAa,SAAUF,EAAQ5jC,GACrC,IACI+jC,EAAY,IAAIL,EAAUD,EAAWO,WAD3B,+DACgDJ,GAI9D,OAHI5jC,GAAWA,EAAQikC,aACnBF,EAAUE,YAAa,GAEpBF,GAGXL,EAAUO,WAAa,SAAUL,GAC7B,OAAOF,EAAUI,WAAWF,EAAQ,CAAEK,YAAY,KAGtDP,EAAUQ,QAAU,SAAUN,GAE1B,OAAO,IAAIF,EAAUD,EAAWU,QADlB,6BACoCP,IAGtDF,EAAUzK,QAAU,SAAU2K,GAE1B,OAAO,IAAIF,EAAUD,EAAWW,QADlB,6BACoCR,IAGtDF,EAAUW,QAAU,SAAUT,GAE1B,OAAO,IAAIF,EAAUD,EAAWa,QADlB,kCACoCV,IAGtDF,EAAUa,QAAU,SAAUX,GAE1B,OAAO,IAAIF,EAAUD,EAAWe,MADlB,yBACkCZ,IAWpDF,EAAUe,UAAY,SAAUb,GAC5B,OAAO,IAAA7qB,IAAG2qB,EAAH,CAAcE,GAAUA,EAASF,EAAUa,QAAQX,IAE9DF,EAAUhiC,UAAUiT,SAAW,WAC3B,IAA6BqkB,EACzB4K,GADyB5K,EACHn5B,KAAK+jC,SADgB5K,EAAErkB,WAAavB,OAAO1R,UAAUiT,SAAWqkB,EAAErkB,YAAa,QAAUqkB,GAE/G9N,EAAKrrB,KACT,MAAO,6BADcqrB,EAAGlQ,IACoB,UADRkQ,EAAGnc,KACwB,cADRmc,EAAGyY,QAC+B,aAAeC,EAAS,KAErHF,EAAUhiC,UAAUgjC,UAAY,WAC5B,OAAO,SAAO,QAAgB7kC,MAAO,CAAE0nB,qBAAsB1nB,QAE1D6jC,EAlEmB,oMC1C1BiB,EAEA,SAA6Bt/B,EAAMo8B,EAAWmD,EAAW1D,EAAmBG,EAAawD,EAAkBC,EAAiBC,QACpG,IAAhB1D,IAA0BA,GAAc,QACnB,IAArBwD,IAA+BA,EAAmB,wBAC9B,IAApBC,IAA8BA,EAAkB,uBAChC,IAAhBC,IAA0BA,GAAc,GAC5CllC,KAAKwF,KAAOA,EACZxF,KAAK4hC,UAAYA,EACjB5hC,KAAK+kC,UAAYA,EACjB/kC,KAAKqhC,kBAAoBA,EACzBrhC,KAAKwhC,YAAcA,EACnBxhC,KAAKglC,iBAAmBA,EACxBhlC,KAAKilC,gBAAkBA,EACvBjlC,KAAKklC,YAAcA,gsBCVvBC,EAAiB,CACjBrf,QAAS,KACTmG,WAAY,KACZqV,UAAW,GACXh+B,KAAM,MAEN8hC,EAAgC,WAChC,SAASA,EAAenZ,EAAYoZ,EAAcrb,EAAgB7pB,GAC9D,IAAIgQ,EAAQnQ,KACZA,KAAKisB,WAAaA,EAClBjsB,KAAKqlC,aAAeA,EACpBrlC,KAAKgqB,eAAiBA,EACtBhqB,KAAKG,QAAUA,EACfH,KAAKslC,aAAe,WAAc,OAAOn1B,EAAMjB,KAAK0yB,YAAc,UAA4BzxB,EAAMhQ,QAAQ8rB,WAAWsZ,YACvHvlC,KAAKG,SAAU,QAASA,EAASglC,GACjCnlC,KAAKkP,KAAO8a,EAAeqY,UAyK/B,OArJA+C,EAAenJ,MAAQ,SAAUoH,EAAOmC,GAGpC,OAAOnC,EAAMz0B,QADU,SAAU8vB,EAAM+G,GAAY,OAAO/G,EAAK3zB,MAAK,WAAc,OAAO06B,EAASC,kBAC5DF,GAAW,gBAarDJ,EAAeO,YAAc,SAAUtC,EAAOuC,GAC1C,IAAK,IAAI32B,EAAM,EAAGA,EAAMo0B,EAAMj0B,OAAQH,IAAO,CACzC,IAAIib,EAAamZ,EAAMp0B,GAAKy2B,aAC5B,IAAI,QAAUxb,GAAa,CACvB,IAAI2b,EAAiBxC,EAAMvhC,MAAMmN,EAAM,GACvC,OAAOm2B,EAAenJ,MAAM4J,EAAgB3b,GAAYnf,KAAK66B,IAGrE,OAAOA,KAKXR,EAAeU,YAAc,SAAUzC,GACnCA,EAAMtiC,SAAQ,SAAU8S,GAAQ,OAAOA,EAAK6xB,iBAEhDN,EAAevjC,UAAUkkC,SAAW,SAAU7Y,GAC1CltB,KAAKisB,WAAWvX,OAAOmC,aAAamvB,qBAApChmC,CAA0DktB,IAE9DkY,EAAevjC,UAAU6jC,WAAa,WAClC,IAAIv1B,EAAQnQ,KACR6T,EAAO7T,KAAKgqB,eAChB,IAAInW,EAAK4uB,cAAT,CAEA,IAAIwD,EAAajmC,KAAKkmC,yBACtB,GAAID,EACA,OAAOA,EACX,IAAI9lC,EAAUH,KAAKG,QACnB,yBAA0BH,KAAMA,KAAKisB,WAAY9rB,GACjD,IAEIgmC,EAAc,SAAUjZ,GAAO,OAAOrZ,EAAKwuB,UAAU4C,gBAAgB90B,EAA/B0D,CAAsCqZ,IAC5EkZ,EAAe,SAAU9/B,GAAU,OAAOuN,EAAKwuB,UAAU2C,iBAAiB70B,EAAhC0D,CAAuCvN,IACrF,IACI,IAAIA,EALkCuN,EAAKrT,SAASuB,KAAK5B,EAAQmD,KAAM6M,EAAM8b,WAAY9b,EAAMk1B,cAM/F,OAAKrlC,KAAKkP,KAAKg2B,cAAe,QAAU5+B,GAC7BA,EAAO+b,OANH,SAAU6K,GAAO,OAAO,cAAoBA,GAAK2X,eAM1B95B,KAAKq7B,EAAcD,GAG9CC,EAAa9/B,GAG5B,MAAO4mB,GAEH,OAAOiZ,EAAY,cAAoBjZ,IAE3C,QACQrZ,EAAK6uB,eAAiB7uB,EAAK2uB,aAAe3uB,EAAK6uB,aAC/C7uB,EAAK2qB,gBAajB4G,EAAevjC,UAAUwkC,iBAAmB,SAAU//B,GAClD,IAAI6J,EAAQnQ,KAEZ,OADiBA,KAAKkmC,4BAIlB,QAAU5/B,GAEHA,EAAOyE,MAAK,SAAU/G,GAAO,OAAOmM,EAAMk2B,iBAAiBriC,OAEtE,qBAAsBsC,EAAQtG,KAAKisB,WAAYjsB,KAAKG,UAErC,IAAXmG,EAEO,YAAkB,2BAA2Bu+B,aAEpC,IAAA3rB,IAAG,IAEnBotB,CAAchgC,GAEP,eAAqBA,GAAQu+B,iBAFxC,KASJO,EAAevjC,UAAUqkC,uBAAyB,WAC9C,IAAIxxB,EAAS1U,KAAKisB,WAAWvX,OAE7B,OAAIA,EAAOqkB,UACA,YAAkB,sBAAwBrkB,EAAOyG,IAAM,gCAAgC0pB,YAE9F7kC,KAAKisB,WAAWsa,SACT,cAAoB1B,YAI3B7kC,KAAKslC,eAEE,eAAqBtlC,KAAKG,QAAQ2lB,WAAW+e,iBAFxD,GAKJO,EAAevjC,UAAUiT,SAAW,WAChC,IAAe3U,EAANH,KAAmBG,QAAS6pB,EAA5BhqB,KAAgDgqB,eACrDzpB,GAAQ,QAAM,qBAAN,CAA4BJ,IAAY,WAAY0Q,GAAU,QAAM,+BAAN,CAAsC1Q,KAAY,QAAM,oBAAN,CAA2BA,IAAY,UAAWqF,GAAO,QAAWwkB,EAAexpB,UAC/M,OAAOD,EAAQ,aAAesQ,EAAU,MAAO,QAAU,IAAKrL,IAMlE4/B,EAAeoB,cAAgB,SAAU3yB,GAAQ,OAAO,SAAUvN,GAC9D,OAAOuN,EAAKwyB,iBAAiB//B,KAMjC8+B,EAAeqB,oBAAsB,SAAU5yB,GAAQ,OAAO,SAAUvN,IACpE,QAAUA,IAAWA,EAAO+b,OAAM,SAAU6K,GAAO,OAAOrZ,EAAKkyB,SAAS,cAAoB7Y,SAOhGkY,EAAesB,UAAY,SAAU7yB,GAAQ,OAAO,SAAUxO,GAAS,OAAOwO,EAAKkyB,SAAS1gC,KAC5F+/B,EAAeuB,aAAe,SAAU9yB,GAAQ,OAAO,SAAUxO,GAAS,OAAO,QAAgBA,KACjG+/B,EAAewB,YAAc,SAAU/yB,GAAQ,OAAO,SAAUxO,GAC5D,MAAMA,IAEH+/B,EAlLwB,qgBCXnC,SAASyB,EAAmBj3B,GACxBA,EAAMk3B,cAAc,cAAoB,IAAUl3B,EAAM8E,QAAS,IACjE9E,EAAMk3B,cAAc,cAAoB,IAAYl3B,GAAQ,IAC5DA,EAAMk3B,cAAc,cAAoB,eAAgBl3B,GAAQ,IAChEA,EAAMk3B,cAAc,cAAoB,eAAgBl3B,EAAMxB,UAAW,IACzEwB,EAAMuc,WAAWprB,SAAQ,SAAU0M,GAC/BmC,EAAMk3B,cAAc,cAAoB,UAAWr5B,GAAQA,MAG5D,IAGHs5B,EAAoB,CAAC,eAAgB,KACrCC,GAAe,QAAQD,GAKhBE,EAAqB,SAAUr3B,GACtC,IAAIgzB,GAAQ,QAAOhzB,EAAMlB,eAAeE,OAAO,KAAS,IAAIA,OAAO,KAAO,IAEtEs4B,EAA4B,SAAU3pB,GACtC,OAAOypB,EAAazpB,EAAEgE,OAAS,cAAoBhE,EAAEgE,MAAO,MAAQhE,GAExEqlB,EAAM7hC,SAAQ,SAAUwN,GACpBA,EAAKwJ,YAAcxJ,EAAKwJ,YAAYpJ,IAAIu4B,+MCnB5CC,EAAiB,SAAUv3B,GAC3B,IAAIw3B,EAAWx3B,EAAMuf,KAAKkY,WAC1B,GAAKD,EAAL,CAEA,IAAI3uB,EAAS7I,EAAM8E,OAAOmC,aAW1B,OAAI,QAAWuwB,GACJ,YAAiBA,EAASx3B,IAAQ7E,KAAKq7B,GAE3CA,EAAagB,GAbpB,SAAShB,EAAa9/B,GAClB,GAAKA,EAEL,OAAIA,aAAkB,IACXA,GACP,QAASA,GACFmS,EAAOpS,OAAOC,EAAQsJ,EAAMxB,SAAUwB,EAAMzP,WACnDmG,EAAc,OAAKA,EAAe,OAC3BmS,EAAOpS,OAAOC,EAAc,OAAKsJ,EAAMuf,KAAM7oB,EAAe,QAAKsJ,EAAMxB,SAAUwB,EAAMzP,gBADlG,IChBR,SAASmnC,EAAwB3zB,GAC7B,OAAO,SAAUsY,EAAYxe,GAGzB,OAAO85B,EAFM95B,EAAMuG,UACCL,IACNsY,EAAYxe,IAYlC,IAAI+5B,EAAaF,EAAwB,UAarCG,EAAeH,EAAwB,YAavCI,EAAcJ,EAAwB,2MC7C/BK,EAAwB,IAU/BC,EAAmB,SAAUh4B,GAC7B,OAAO,IAAI,IAAeA,EAAMlB,cAAcygB,IAAIuI,YAAY,QAAS9nB,GAAO7E,KAAK,OAcnF88B,EAAmB,SAAUj4B,EAAOnC,GACpC,OAAO,IAAI,IAAemC,EAAMlB,cAAcygB,IAAIpb,WAAWtG,EAAMuG,WAAW0jB,YAAY,OAAQ9nB,GAAO7E,KAAK,OAe9G+8B,EAAmB,SAAUl4B,GAC7B,OAAO,IAAI,IAAeA,EAAMlB,cAAcygB,IAAIuI,YAAY,OAAQ9nB,GAAO7E,KAAK,OCnClFg9B,EAAoB,SAAU9b,GAC9B,IAAIllB,EAAK,OACLihC,EAAgB/b,EAAWzR,MAAM,YACrC,GAAKwtB,EAAc54B,OAEnB,OAAOrI,EAAG0U,IAAIusB,EAAcr5B,KAAI,SAAUmL,GAAQ,OAAO/S,EAAGkJ,KAAK6J,EAAKuB,YAAatQ,KAAK,OAexFk9B,EAAgB,SAAUhc,GAC1B,IAAI+b,EAAgB/b,EAAWzR,MAAM,YACjC0tB,EAAejc,EAAWzR,MAAM,WACpC,GAAKwtB,EAAc54B,QAAW84B,EAAa94B,OAA3C,CAEA,IAAItI,EAAQmlB,EAAWvX,OAAOqC,YAC9BmxB,EAAannC,SAAQ,SAAUonC,GAAM,OAAOrhC,EAAMshC,qBAAqBD,MACvEH,EAAcjnC,SAAQ,SAAUonC,GAAM,OAAOrhC,EAAMuhC,mBAAmBF,MACtErhC,EAAM8lB,SCzBN0b,EAAoB,SAAU14B,GAC9B,IAAI0I,EAAU1I,EAAM8E,OAAO4D,QAOvBiwB,EAAyB,WAErBjwB,EAAQ2T,aAAerc,IACvB0I,EAAQ2T,WAAa,OAE7Brc,EAAM7B,UAAU,IAXW,WACvBuK,EAAQ0T,sBAAsBxG,QAAQ5V,GACtC0I,EAAQwa,SAAWljB,EAAMmjB,MACzBza,EAAQwN,QAAUxN,EAAQwa,SAASplB,MACnC,QAAKkC,EAAMxB,SAAUkK,EAAQlK,UAOS,CAAEhH,SAAU,MACtDwI,EAAMnM,QAAQsH,KAAKw9B,EAAwBA,ICtB3CC,EAAY,SAAUvc,GACtB,IAAI9rB,EAAU8rB,EAAW9rB,UACrBsY,EAASwT,EAAWvX,OAAOmC,aAC3B6B,EAAauT,EAAWvX,OAAOyH,UAKnC,GAAuB,QAAnBhc,EAAQ4e,QAAoB5e,EAAQ0V,UAAY4C,EAAOqa,SAASsH,UAAW,CAC3E,IAAIqO,EAAa,CAAE1zB,QAA8B,YAArB5U,EAAQ0V,UACpC6C,EAAWjY,KAAKgY,EAAOqa,SAASsH,UAAU3oB,IAAKgH,EAAOrK,OAAQq6B,GAElE/vB,EAAW0D,QAAO,kWCPtB,SAASssB,EAAY94B,GACjB,IAAI+4B,EAAgB/4B,EAAMg5B,iBAC1B,GAAKD,EAAL,CAEAtgC,EAAA,0BAA6BuH,GAC7B,IAAIi5B,EAAUj5B,EAAM8E,OAAO4D,QAAQ2T,WAOnC,MAHsB,kBAAlB0c,GAAqCE,GACrCA,EAAQC,QAEL,cAAoBjE,aCf/B,SAASkE,EAAsBn5B,GAC3B,IAAKA,EAAMywB,QACP,MAAM,IAAI5tB,MAAM7C,EAAMvK,QAAQyP,YAG/B,ICaIk0B,EAAmB,CAC1BnzB,UAAU,EACVsqB,SAAU,KACV/gB,SAAS,EACT6pB,QAAQ,EACRC,QAAQ,EACRC,WAAW,EACXC,OAAQ,GACRtjB,QAAS,WAAc,OAAO,MAC9B/G,OAAQ,WAaRsqB,EAAmC,WAEnC,SAASA,EAAkBC,GAEvBtpC,KAAKupC,iBAAmB,EAExBvpC,KAAKwpC,YAAc,GAEnBxpC,KAAKsjC,iBAAmB,GAExBtjC,KAAKypC,eAAiB,GACtBzpC,KAAKspC,QAAUA,EACftpC,KAAK8G,MAAQwiC,EAAQvyB,YACrB/W,KAAK0pC,mBAAqB,GAC1B1pC,KAAKgK,YAAc,SAAqB,QAAIhK,MAAO,IAAI,QAAIA,MAAO,CAC9D,kBACA,eACA,gBACA,aACA,aAEJA,KAAK2pC,mBACL3pC,KAAK4pC,oBACL5pC,KAAK6pC,+BACLP,EAAQhxB,QAAQ0T,sBAAsBzG,QAAQ0hB,GAuLlD,OA9JAoC,EAAkBxnC,UAAUioC,SAAW,SAAUh6B,EAAUtP,EAAUL,KAIrEkpC,EAAkBxnC,UAAUkO,SAAW,SAAUD,EAAUtP,EAAUL,KAIrEkpC,EAAkBxnC,UAAUkoC,QAAU,SAAUj6B,EAAUtP,EAAUL,KAIpEkpC,EAAkBxnC,UAAUmoC,OAAS,SAAUl6B,EAAUtP,EAAUL,KAInEkpC,EAAkBxnC,UAAUooC,SAAW,SAAUn6B,EAAUtP,EAAUL,KAIrEkpC,EAAkBxnC,UAAUqoC,QAAU,SAAUp6B,EAAUtP,EAAUL,KAIpEkpC,EAAkBxnC,UAAUsoC,SAAW,SAAUr6B,EAAUtP,EAAUL,KAIrEkpC,EAAkBxnC,UAAUkM,UAAY,SAAU+B,EAAUtP,EAAUL,KAItEkpC,EAAkBxnC,UAAUuoC,QAAU,SAAUt6B,EAAUtP,EAAUL,KAOpEkpC,EAAkBxnC,UAAUqT,QAAU,SAAUR,IAC5C,QAAO1U,KAAKsjC,kBAAkBviC,SAAQ,SAAUspC,GAC5C,OAAOA,EAAWtpC,SAAQ,SAAU8S,GAChCA,EAAK4uB,eAAgB,GACrB,QAAW4H,EAAYx2B,UAenCw1B,EAAkBxnC,UAAUL,OAAS,SAAUyyB,EAAUzH,GACrD,OAAO,IAAI,IAAWyH,EAAUzH,EAAaxsB,KAAKspC,UAGtDD,EAAkBxnC,UAAU+nC,kBAAoB,WAC5C,IAAIU,EAAQ,IACRC,EAAK,IACLC,EAAQxqC,KAAKypC,eACbgB,GAAc,EACdC,GAAc,EAClB1qC,KAAK2qC,aAAa,WAAYL,EAAMM,OAAQ,EAAGJ,EAAMrb,GAAIsb,EAAaF,EAAG9D,oBAAqB8D,EAAG3D,YAAa8D,GAC9G1qC,KAAK2qC,aAAa,WAAYL,EAAMO,OAAQ,EAAGL,EAAMrb,IACrDnvB,KAAK2qC,aAAa,UAAWL,EAAMQ,IAAK,EAAGN,EAAMrb,IACjDnvB,KAAK2qC,aAAa,SAAUL,EAAMQ,IAAK,IAAKN,EAAMv8B,SALV,GAMxCjO,KAAK2qC,aAAa,WAAYL,EAAMQ,IAAK,IAAKN,EAAMrV,UACpDn1B,KAAK2qC,aAAa,UAAWL,EAAMQ,IAAK,IAAKN,EAAMre,UACnDnsB,KAAK2qC,aAAa,WAAYL,EAAMQ,IAAK,IAAKN,EAAMrb,IACpDnvB,KAAK2qC,aAAa,YAAaL,EAAMS,QAAS,EAAGP,EAAMrb,GAAIsb,EAAaF,EAAG9D,oBAAqB8D,EAAG7D,UAAWgE,GAC9G1qC,KAAK2qC,aAAa,UAAWL,EAAM3F,MAAO,EAAG6F,EAAMrb,GAAIsb,EAAaF,EAAG9D,oBAAqB8D,EAAG7D,UAAWgE,IAG9GrB,EAAkBxnC,UAAU8nC,iBAAmB,WAC3C,IAAIqB,EAAQ,UAA2BrhB,EAAa,eACpD3pB,KAAKirC,gBAAgB,KAAMthB,GAC3B3pB,KAAKirC,gBAAgB,OAAQthB,GAC7B3pB,KAAKirC,gBAAgB,UAAWD,GAChChrC,KAAKirC,gBAAgB,WAAYD,GACjChrC,KAAKirC,gBAAgB,WAAYD,IAGrC3B,EAAkBxnC,UAAU8oC,aAAe,SAAUnlC,EAAMo8B,EAAWmD,EAAW1D,EAAmBG,EAAawD,EAAkBC,EAAiBC,QAC5H,IAAhB1D,IAA0BA,GAAc,QACnB,IAArBwD,IAA+BA,EAAmB,wBAC9B,IAApBC,IAA8BA,EAAkB,uBAChC,IAAhBC,IAA0BA,GAAc,GAC5C,IAAI7C,EAAY,IAAI,IAAoB78B,EAAMo8B,EAAWmD,EAAW1D,EAAmBG,EAAawD,EAAkBC,EAAiBC,GACvIllC,KAAKwpC,YAAY/oC,KAAK4hC,IACtB,QAAUriC,KAAMA,KAAMqiC,IAG1BgH,EAAkBxnC,UAAUi/B,WAAa,SAAUD,GAI/C,QAH0B,QAAUA,GAC9B7gC,KAAKwpC,YAAYlgC,QAAO,SAAU4F,GAAQ,OAAOA,EAAK0yB,YAAcf,KACpE7gC,KAAKwpC,YAAY1nC,SACI0pB,MAAK,SAAUiH,EAAGlV,GACzC,IAAI2tB,EAAazY,EAAEmP,UAAYrkB,EAAEqkB,UACjC,OAAsB,IAAfsJ,EAAmBzY,EAAEsS,UAAYxnB,EAAEwnB,UAAYmG,MAgB9D7B,EAAkBxnC,UAAUopC,gBAAkB,SAAUzlC,EAAM2lC,GAC1DnrC,KAAKypC,eAAejkC,GAAQ,CAAEA,KAAMA,EAAM1C,MAAOqoC,IAIrD9B,EAAkBxnC,UAAUihC,cAAgB,WACxC,OAAO9iC,KAAKypC,gBAGhBJ,EAAkBxnC,UAAUigC,SAAW,SAAUnuB,GAC7C,OAAO3T,KAAKsjC,iBAAiB3vB,IAGjC01B,EAAkBxnC,UAAUgoC,6BAA+B,WACvD,IAAIuB,EAAMprC,KAAK0pC,mBACf0B,EAAIC,gBAA6CrrC,KTzN5B8pC,SAAS,GAAIjD,GS0NlCuE,EAAIhS,QAAwCp5B,KF/MvB+P,SAAS,GAAI24B,EAAa,CAAEthC,UAAW,OEgN5DgkC,EAAI/G,QD7N+B,SAAUvX,GACjD,OAAOA,EAAkB/c,SAAS,GAAIg5B,EAAuB,CAAE3hC,UAAW,MC4NxDkkC,CAA8BtrC,MAE5CorC,EAAI/D,WR7MwB,SAAUva,GAC1C,OAAOA,EAAkBid,QAAQ,CAAE5a,GAAI,SAAU1hB,GAAS,QAASA,EAAM45B,aAAiBF,GQ4MrEoE,CAAuBvrC,MAExCorC,EAAIpB,OPtNoB,SAAUld,GACtC,OAAOA,EAAkBkd,OAAO,CAAE/7B,QAAS,SAAUR,GAAS,QAASA,EAAMu8B,SAAaxC,GOqNzEgE,CAAmBxrC,MAChCorC,EAAInB,SP1MsB,SAAUnd,GACxC,OAAOA,EAAkBmd,SAAS,CAAE9U,SAAU,SAAU1nB,GAAS,QAASA,EAAMw8B,WAAexC,GOyM5EgE,CAAqBzrC,MACpCorC,EAAIlB,QP9LqB,SAAUpd,GACvC,OAAOA,EAAkBod,QAAQ,CAAE/d,SAAU,SAAU1e,GAAS,QAASA,EAAMy8B,UAAcxC,GO6L3EgE,CAAoB1rC,MAElCorC,EAAIO,aNjO0B,SAAU7e,GAC5C,OAAOA,EAAkBid,QAAQ,GAAInC,EAAkB,CAAExgC,SAAUugC,IMgO5CiE,CAAyB5rC,MAC5CorC,EAAIS,YNnN0B,SAAU/e,GAC5C,OAAOA,EAAkBod,QAAQ,CAAE/d,UAAU,SAAI,IAAS0b,EAAkB,CAAEzgC,SAAUugC,IMkNlEmE,CAAyB9rC,MAC3CorC,EAAIW,WNpM0B,SAAUjf,GAC5C,OAAOA,EAAkBqd,SAAS,GAAIrC,EAAkB,CAAE1gC,SAAUugC,IMmM/CqE,CAAyBhsC,MAE1CorC,EAAIa,ULpO2B,SAAUnf,GAC7C,OAAOA,EAAkBqd,SAAS,GAAIpC,GKmOlBmE,CAA0BlsC,MAC1CorC,EAAInD,cL9MuB,SAAUnb,GACzC,OAAOA,EAAkB/e,UAAU,GAAIk6B,GK6MfkE,CAAsBnsC,MAE1CorC,EAAIgB,cJ3N2B,SAAUtf,GAC7C,OAAOA,EAAkBgd,SAAS,GAAIxB,GI0Nd+D,CAA0BrsC,MAE9CorC,EAAI5C,UHvOmB,SAAU1b,GACrC,OAAOA,EAAkB/e,UAAU,GAAIy6B,EAAW,CAAEphC,SAAU,OGsO1CklC,CAAkBtsC,MAElCorC,EAAIhf,UAAW,OAAqBpsB,OAEjCqpC,EA/M2B,mSChClCkD,EAA2B,WACV,SAASA,EAA2B73B,GACjD,IAAIvE,EAAQnQ,KACZA,KAAK0U,OAASA,EACG1U,KAAKouB,WAAa,IAAI,EAAAiD,WACtBrxB,KAAKkX,eAAgB,EACrBlX,KAAKwsC,oBAAqB,EAC1BxsC,KAAKysC,eAAgB,EACrBzsC,KAAK0sC,sBAAuB,EAC5B1sC,KAAKkV,QAAU,WAAc,OAAO/E,EAAMie,WAAWlZ,WAOtElV,KAAKyV,SAAW,WAAc,OAAOtF,EAAMuE,OAAO2C,eAAe5B,YAUjEzV,KAAK2sC,WAAa,SAAUC,GAAa,OAAOz8B,EAAMuE,OAAO2C,eAAes1B,WAAWC,IAMvF5sC,KAAK6sC,KAAO,WAAc,OAAO18B,EAAMuE,OAAO2C,eAAew1B,QAM7D7sC,KAAKqV,UAAY,WAAc,OAAOlF,EAAMuE,OAAO2C,eAAehC,aAMlErV,KAAK8sC,KAAO,WAAc,OAAO38B,EAAMuE,OAAO2C,eAAey1B,QAM7D9sC,KAAK+sC,SAAW,WAAc,OAAO58B,EAAMuE,OAAO2C,eAAe01B,YAwFrE,OA1EAR,EAAU1qC,UAAUmrC,gBAAkB,SAAUxoC,GAC5C,OAAQxE,KAAKwsC,oBAAqB,QAAUhoC,GAASA,EAAQxE,KAAKwsC,oBAmBtED,EAAU1qC,UAAUotB,oBAAsB,SAAUzqB,GAChD,IAAI,QAAUA,KAAoB,IAAVA,IAA4B,IAAVA,KAAoB,QAASA,GACnE,MAAM,IAAIiO,MAAM,0BAA4BjO,EAAQ,mDACxD,OAAQxE,KAAK0sC,sBAAuB,QAAUloC,GAASA,EAAQxE,KAAK0sC,sBAcxEH,EAAU1qC,UAAUorC,WAAa,SAAUzoC,GACvC,OAAQxE,KAAKysC,eAAgB,QAAUjoC,GAASA,EAAQxE,KAAKysC,eAgCjEF,EAAU1qC,UAAUqN,KAAO,SAAU1J,EAAMiU,EAAY+X,GACnD,IAAItiB,EAAOlP,KAAKouB,WAAWlf,KAAK1J,EAAMiU,EAAY+X,GAClD,OAAQ,QAAU/X,GAAqBzZ,KAAPkP,GAE7Bq9B,EA1ImB,0SCf1BW,EAAsC,WAStC,OARAA,EAAW35B,OAAO3Q,QAAU,SAASic,GACjC,IAAK,IAAIzB,EAAGC,EAAI,EAAGkD,EAAIve,UAAUoN,OAAQiO,EAAIkD,EAAGlD,IAE5C,IAAK,IAAIwd,KADTzd,EAAIpb,UAAUqb,GACO9J,OAAO1R,UAAUa,eAAeX,KAAKqb,EAAGyd,KACzDhc,EAAEgc,GAAKzd,EAAEyd,IAEjB,OAAOhc,IAEK1c,MAAMnC,KAAMgC,YAK5BmrC,EAA8B,WAC9B,SAASA,EAAaz4B,GAClB1U,KAAK0U,OAASA,EAWlB,OATAy4B,EAAatrC,UAAU+O,WAAa,SAAUvF,EAAI6D,EAAMzB,GACpD,OAAO,IAAI,EAAA4f,MAAMhiB,EAAI6D,EAAM,EAAAie,QAAA,OAAgBntB,KAAK0U,OAAOuC,WAAW1L,OAAQkC,IAE9E0/B,EAAatrC,UAAUoyB,SAAW,SAAU5oB,EAAI6D,EAAMzB,GAClD,OAAO,IAAI,EAAA4f,MAAMhiB,EAAI6D,EAAM,EAAAie,QAAA,KAAcntB,KAAK0U,OAAOuC,WAAW1L,OAAQkC,IAE5E0/B,EAAatrC,UAAUurC,WAAa,SAAU/hC,EAAI6D,EAAMzB,GACpD,OAAO,IAAI,EAAA4f,MAAMhiB,EAAI6D,EAAM,EAAAie,QAAA,OAAgBntB,KAAK0U,OAAOuC,WAAW1L,OAAQkC,IAEvE0/B,EAbsB,GAsB7BE,EAAmC,WAEnC,SAASA,EAAmC34B,GACxC,IAAIvE,EAAQnQ,KACZA,KAAK0U,OAASA,EAEd1U,KAAK07B,aAAe,IAAIyR,EAAantC,KAAK0U,QAE1C1U,KAAKstC,WAAa,IAClBttC,KAAKqtB,MAAQ,EAAAA,MAEbrtB,KAAKgtC,gBAAkB,SAAUxoC,GAAS,OAAO2L,EAAMuE,OAAOuC,WAAW1L,OAAOyhC,gBAAgBxoC,IAEhGxE,KAAKivB,oBAAsB,SAAUzqB,GAAS,OAAO2L,EAAMuE,OAAOuC,WAAW1L,OAAO0jB,oBAAoBzqB,IAExGxE,KAAKitC,WAAa,SAAUzoC,GAAS,OAAO2L,EAAMuE,OAAOuC,WAAW1L,OAAO0hC,WAAWzoC,IAEtFxE,KAAKkP,KAAO,SAAU1J,EAAMiU,EAAY+X,GACpC,OAAOrhB,EAAMuE,OAAOuC,WAAW1L,OAAO2D,KAAK1J,EAAMiU,EAAY+X,IAAiBrhB,GA+CtF,OArCAk9B,EAAkBxrC,UAAUwF,QAAU,SAAUid,EAAS/Y,GACrD,IAAI+hB,EAAYttB,KAAK0U,OAAOuC,WAAW1L,OAEnC6C,EAAS7C,IAAWA,EAAOkC,OAASlC,EAAO6C,OAC/C7C,EAAS6C,EAAS8+B,EAAS,CAAEz/B,MAAO,CAAEW,OAAQA,IAAY7C,GAAUA,EACpE,IAAIgiC,EAAe,CACfC,OAAQlgB,EAAUmf,cAClBO,gBAAiB1f,EAAUkf,mBAC3BiB,aAAcngB,EAAUpW,eAE5B,OAAO,IAAI,IAAWoN,EAASgJ,EAAUc,WAAYpuB,KAAK07B,cAAc,QAAO6R,EAAchiC,KASjG8hC,EAAkBxrC,UAAUs4B,UAAY,SAAUuT,GAE9C,KAAK,QAASA,GACV,OAAO,EACX,IAAIpnC,GAAS,EAKb,OAJA,QAAQ,eAAsB,SAAUtC,EAAKwB,IACrC,QAAWxB,KACXsC,EAASA,IAAU,QAAUonC,EAAOloC,MAAU,QAAWkoC,EAAOloC,QAEjEc,GAGX+mC,EAAkBxrC,UAAUnB,KAAO,WAC/B,IAAI4sB,EAAYttB,KAAK0U,OAAOuC,WAAW1L,OAGvC,OAFA+hB,EAAUc,WAAW5I,SAAU,EAC/B8H,EAAUc,WAAWqD,kBACdzxB,MAEJqtC,EAjE2B,kOCjBlCM,EAA2B,WAE3B,SAASA,EAA2Bj5B,GAChC,IAAIvE,EAAQnQ,KACZA,KAAK0U,OAASA,EAGd1U,KAAK4sB,KAAO,SAAU1W,GAAO,OAAO/F,EAAMuE,OAAOuC,WAAW2V,KAAK1W,IAEjElW,KAAKsc,OAAS,SAAUhH,GAAW,OAAOnF,EAAMuE,OAAOuC,WAAWqF,OAAOhH,IAEzEtV,KAAK+c,eAAiB,SAAU9Q,GAAS,OAAOkE,EAAMuE,OAAOuC,WAAW8F,eAAe9Q,IAEvFjM,KAAKgc,MAAQ,SAAU4xB,GAAY,OAAOz9B,EAAMuE,OAAOuC,WAAW+E,MAAM4xB,IAGxE5tC,KAAKuH,QAAU,SAAUwU,GACrB,OAAO5L,EAAMuE,OAAOuC,WAAW0F,MAAMpV,QAAQwU,IAGjD/b,KAAK4c,UAAY,SAAUb,GACvB,OAAO5L,EAAMuE,OAAOuC,WAAW0F,MAAMC,UAAUb,IAGnD/b,KAAKw/B,WAAa,SAAUjjB,GAAQ,OAAOpM,EAAMuE,OAAOuC,WAAW0F,MAAM6iB,WAAWjjB,IAEpFvc,KAAKuc,KAAO,SAAUA,GAAQ,OAAOpM,EAAMuE,OAAOuC,WAAW0F,MAAMJ,KAAKA,IAExEvc,KAAK2c,MAAQ,WAAc,OAAOxM,EAAMuE,OAAOuC,WAAW0F,MAAMA,SAEhE3c,KAAKwrB,KAAO,SAAUqiB,GAAa,OAAO19B,EAAMuE,OAAOuC,WAAW0F,MAAM6O,KAAKqiB,IAE7E7tC,KAAKiQ,KAAO,SAAUwrB,EAAS1f,EAAS5b,GAAW,OAAOgQ,EAAMuE,OAAOuC,WAAW0F,MAAM1M,KAAKwrB,EAAS1f,EAAS5b,IAC/GH,KAAK6+B,eAAiB,IAAI,IAAenqB,GAyE7C,OAtEAi5B,EAAU9rC,UAAUua,OAAS,SAAU0xB,GACnC,IAAIphB,EAAO1sB,KAAK0U,OAAO0C,gBACnB02B,EACA9tC,KAAK6V,SAAW6W,EAAKjb,MAGrBib,EAAKjb,QAAUzR,KAAK6V,UAExB6W,EAAKjb,IAAIzR,KAAK6V,UAAU,IAY5B83B,EAAU9rC,UAAUpB,KAAO,SAAUstC,EAAY3/B,EAAQjO,GACrD,IAAI4U,EAAU5U,KAAaA,EAAQ4U,QACnC/U,KAAK0U,OAAOuC,WAAWxF,IAAIs8B,EAAWnmB,OAAOxZ,GAAU,IAAK2G,IAqBhE44B,EAAU9rC,UAAUmsC,KAAO,SAAUD,EAAY3/B,EAAQjO,GACrD,IAAIsR,EAAMs8B,EAAWnmB,OAAOxZ,GAC5B,GAAW,MAAPqD,EACA,OAAO,KACXtR,EAAUA,GAAW,CAAE8tC,UAAU,GACjC,IAAIpmC,EAAM7H,KAAK0U,OAAOuC,WAAW1L,OAC7B2iC,EAAUrmC,EAAIwN,YAKlB,GAJK64B,GAAmB,OAARz8B,IACZA,EAAM,IAAM5J,EAAI8kC,aAAel7B,GAEnCA,EA1GR,SAAwBA,EAAKy8B,EAASD,EAAUx4B,GAC5C,MAAiB,MAAbA,EACOhE,EACPy8B,GACO,QAAqBz4B,GAAYhE,EACxCw8B,EACOx4B,EAAS3T,MAAM,GAAK2P,EACxBA,EAmGG08B,CAAe18B,EAAKy8B,EAAS/tC,EAAQ8tC,SAAUpmC,EAAI4N,aACpDtV,EAAQ8tC,WAAax8B,EACtB,OAAOA,EAEX,IAAI28B,GAASF,GAAWz8B,EAAM,IAAM,GAChC48B,EAAUxmC,EAAIilC,OACdA,EAAoB,KAAZuB,GAA8B,MAAZA,EAAkB,GAAK,IAAMA,EAC3D,MAAO,CAACxmC,EAAIklC,WAAY,MAAOllC,EAAIglC,OAAQC,EAAMsB,EAAO38B,GAAKwB,KAAK,KAEtEM,OAAO+6B,eAAeX,EAAU9rC,UAAW,oBAAqB,CAE5D6O,IAAK,WACD,OAAO1Q,KAAK0U,OAAOuC,WAAWoF,mBAElCkyB,YAAY,EACZC,cAAc,IAEXb,EA1GmB,2aCJ1Bc,EAAgC,WAChC,SAASA,EAAe/5B,GACpB1U,KAAK0U,OAASA,EAiKlB,OA/JA+5B,EAAe5sC,UAAUwF,QAAU,SAAU2J,GACzC,OAAOhR,KAAK0U,OAAOE,kBAAkBvN,QAAQ2J,IAEjDy9B,EAAe5sC,UAAUL,OAAS,SAAUsb,EAAMf,GAC9C,IAAI5L,EAAQnQ,KACRy9B,EAAU,YAAqBD,EAAqB,uBACpDkR,GAAW,QAAQ,CACnB,CAAC,KAAU,SAAUC,GAAS,OAAOD,EAASv+B,EAAM9I,QAAQsnC,MAC5D,EAAC,IAAAz1B,IAAG,KAAa,SAAUy1B,GAAS,OAAOx+B,EAAMy+B,eAAeD,EAAO5yB,KACvE,EAAC,IAAAkI,IAAGwZ,EAASD,GAAqB,SAAUmR,GAAS,OAAOx+B,EAAM0+B,UAAUF,EAAOx+B,EAAMuE,UACzF,EAAC,IAAAwE,IAAG/P,QAAS,SAAUwlC,GAAS,OAAOx+B,EAAM2+B,WAAWH,EAAO5yB,KAC/D,CAAC,KAAY,SAAU4yB,GAAS,OAAO,IAAIlyB,EAAYkyB,EAAO5yB,OAE9DQ,EAAOmyB,EAAS5xB,GACpB,IAAKP,EACD,MAAM,IAAI9J,MAAM,4BACpB,OAAO8J,GAsCXkyB,EAAe5sC,UAAU+sC,eAAiB,SAAUb,EAAYhyB,GAC5D,IAAIgzB,EAAWhzB,GACX,QAASA,KACTA,EAAU/b,KAAK0U,OAAOE,kBAAkBvN,QAAQ0U,KAChD,IAAA7C,IAAG,IAAH,CAAe6C,KACfgzB,EAAW,SAAU/yB,GAAS,OAAOD,EAAQ6L,OAAO5L,KAiBxD,IAAIgzB,EAAU,CAAEjB,WAAYA,EAAYkB,cAPxC,SAAuB7gC,GACnB,IAAI8gC,EAAWnB,EAAW1a,aAAa/pB,QAAO,SAAU0F,GAAS,OAAOA,EAAM4f,cAC9E,OAAKsgB,EAAS9/B,OAEA8/B,EAAS5lC,QAAO,SAAU0F,GAAS,OAAOZ,EAAOY,EAAM3D,OACtD+D,OAAS8/B,EAAS9/B,OAFtB,MAIuDF,KAAM,cAC5E,OAAO,QAAO,IAAIuN,GAjBlB,SAA2BhL,GACvB,IAAIrD,EAAS2/B,EAAWtkC,KAAKgI,EAAItJ,KAAMsJ,EAAI09B,OAAQ19B,EAAIqgB,MACvD,OAAOic,EAAWre,UAAUthB,IAAWA,IAeM2gC,GAAWC,IAahEP,EAAe5sC,UAAUgtC,UAAY,SAAUO,EAAa16B,GACxD,IAAIjH,EAAQ,uBAA+B2hC,GAAeA,EAAYp7B,UAAYo7B,EAe9EJ,EAAU,CAAEvhC,MAAOA,EAAOyB,KAAM,SACpC,OAAO,QAAOlP,KAAK4uC,eAAenhC,EAAMgE,KAR1B,SAAUuK,GACpB,IAAIvD,EAAS/D,EAAOmC,aAChByB,EAAU5D,EAAO4D,QACjBG,EAAOu1B,KAAKvgC,EAAOuO,KAAWvD,EAAOu1B,KAAK11B,EAAQwN,QAASxN,EAAQlK,SACnEqK,EAAO42B,aAAa5hC,EAAOuO,EAAO,CAAEoD,SAAS,EAAML,OAAQ,WAIZiwB,IAkC3DP,EAAe5sC,UAAUitC,WAAa,SAAU7rB,EAAQlH,GACpD,GAAIkH,EAAOnF,QAAUmF,EAAOqsB,OACxB,MAAM,IAAI78B,MAAM,4CAMpB,IAIIs8B,GAAW,QAAShzB,GAJJ,SAAUC,GAE1B,OAAOD,EAAQhH,QAAQ,kBAAkB,SAAUC,EAAG8H,GAAQ,OAAOd,EAAe,MAATc,EAAe,EAAIyyB,OAAOzyB,QAEtDf,EAE/CizB,EAAU,CAAE/rB,OAAQA,EAAQ/T,KAAM,UACtC,OAAO,QAAO,IAAIuN,GAFU,SAAUhL,GAAO,OAAOwR,EAAOxZ,KAAKgI,EAAItJ,QAEf4mC,GAAWC,IAEpEP,EAAee,UAAY,SAAUv1B,GAAO,OAAOA,GAAO,CAAC,OAAQ,QAAS,WAAWkpB,OAAM,SAAUt9B,GAAO,OAAO,QAAUoU,EAAIpU,QAC5H4oC,EAnKwB,GA4K/BhyB,EACA,SAAqBT,EAAOD,GACxB,IAAI5L,EAAQnQ,KACZA,KAAKgc,MAAQA,EACbhc,KAAKkP,KAAO,MACZlP,KAAKivC,cAAgB,SAAUjzB,GAAS,OAAO,EAAI7L,EAAMgL,KACzDnb,KAAK+b,QAAUA,GAAW,2GCnK9B0zB,sPAaJ,SAASC,EAAa3zB,GAClB,MAAK,QAAWA,KAAa,QAASA,KAAa,IAAA7C,IAAG,EAAA2mB,YAAH,CAAgB9jB,IAAa,EAAA8jB,YAAA,MAAkB9jB,IAC9F,MAAM,IAAItJ,MAAM,4FAEpB,OAAO,QAAWsJ,GAAWA,GAAU,QAAIA,GAhB/C0zB,EAAoB,SAAUhyB,EAAGmB,GAC7B,IAAI+wB,EA5BW,SAAUlyB,EAAGmB,GAAK,OAAQA,EAAExX,UAAY,IAAMqW,EAAErW,UAAY,GA4BjEwoC,CAAanyB,EAAGmB,GAC1B,OAAY,IAAR+wB,GAGQ,KADZA,EA9BW,SAAUlyB,EAAGmB,GACxB,IAAIixB,EAAU,CAAE7E,MAAO,EAAG8E,WAAY,EAAGC,OAAQ,EAAGC,IAAK,EAAGC,MAAO,GACnE,OAAQJ,EAAQpyB,EAAEvO,OAAS,IAAM2gC,EAAQjxB,EAAE1P,OAAS,GA4B9CghC,CAASzyB,EAAGmB,KAIN,KADZ+wB,EA7BiB,SAAUlyB,EAAGmB,GAC9B,OAAQnB,EAAEswB,YAAenvB,EAAEmvB,WAAiB,YAAmBtwB,EAAEswB,WAAYnvB,EAAEmvB,YAAvC,EA4BlCoC,CAAe1yB,EAAGmB,IAJb+wB,EAtBF,SAAUlyB,EAAGmB,GAEtB,IAAIwxB,EAAmB,CAAEpF,OAAO,EAAM8E,YAAY,GAElD,OADYM,EAAiB3yB,EAAEvO,OAASkhC,EAAiBxxB,EAAE1P,MAC5C,GAAKuO,EAAEtC,KAAO,IAAMyD,EAAEzD,KAAO,GAyBrCk1B,CAAO5yB,EAAGmB,IAkBrB,IAAI0xB,EAA0B,WAE1B,SAASA,EAA0B57B,GAC/B1U,KAAK0U,OAASA,EACG1U,KAAKuwC,QAAUd,EACfzvC,KAAKwwC,OAAS,GACdxwC,KAAKywC,IAAM,EAC5BzwC,KAAK6+B,eAAiB,IAAI,IAAenqB,GA8Q7C,OA3QA47B,EAASzuC,UAAUqT,QAAU,SAAUR,GACnC1U,KAAKwwC,OAAS,UACPxwC,KAAK0wC,cAqChBJ,EAASzuC,UAAU0F,QAAU,SAAUwU,GACnC,IAAI40B,EAAYjB,EAAa3zB,GAI7B/b,KAAKuc,KAAKvc,KAAK6+B,eAAer9B,QAHhB,SAAUosC,EAAUl5B,GAC9B,OAAmD,IAA5CA,EAAO4D,QAAQyT,kBAAkBnG,UAAkB,QAAQnc,KAAKmkC,EAASzlC,QAEtCwoC,KA6ClDL,EAASzuC,UAAU+a,UAAY,SAAUb,GACrC,IAAI40B,EAAYjB,EAAa3zB,GAC7B/b,KAAK0wC,aAAe1wC,KAAK6+B,eAAer9B,QAAO,SAAI,GAAOmvC,GAC1D3wC,KAAK4wC,SAAU,GAOnBN,EAASzuC,UAAU29B,WAAa,SAAUjjB,IACtC,QAAWvc,KAAKwwC,OAAQj0B,IAc5B+zB,EAASzuC,UAAU0a,KAAO,SAAUA,GAChC,IAAIpM,EAAQnQ,KACZ,IAAK,cAAyBuc,GAC1B,MAAM,IAAI9J,MAAM,gBAKpB,OAJA8J,EAAKpB,IAAMnb,KAAKywC,MAChBl0B,EAAKnV,SAAWmV,EAAKnV,UAAY,EACjCpH,KAAKwwC,OAAO/vC,KAAK8b,GACjBvc,KAAK4wC,SAAU,EACR,WAAc,OAAOzgC,EAAMqvB,WAAWjjB,KAOjD+zB,EAASzuC,UAAU8a,MAAQ,WAEvB,OADA3c,KAAK6wC,eACE7wC,KAAKwwC,OAAOpuC,OAAOpC,KAAK0wC,aAAe,CAAC1wC,KAAK0wC,cAAgB,KA4CxEJ,EAASzuC,UAAU2pB,KAAO,SAAUqiB,GAIhC,IAHA,IAAIiD,EAAS9wC,KAAK+wC,WAAW/wC,KAAKwwC,OAASxwC,KAAKuwC,QAAU1C,GAAa7tC,KAAKuwC,SAExES,EAAQ,EACH3zB,EAAI,EAAGA,EAAIyzB,EAAO1hC,OAAQiO,IAC/ByzB,EAAOzzB,GAAG4zB,OAASD,EACf3zB,EAAIyzB,EAAO1hC,OAAS,GAAgD,IAA3CpP,KAAKuwC,QAAQO,EAAOzzB,GAAIyzB,EAAOzzB,EAAI,KAC5D2zB,IAGRhxC,KAAKwwC,OAASM,EACd9wC,KAAK4wC,SAAU,GAGnBN,EAASzuC,UAAUgvC,aAAe,WAC9B7wC,KAAK4wC,SAAW5wC,KAAKwrB,QAGzB8kB,EAASzuC,UAAUkvC,WAAa,SAAUrxB,EAAKmuB,GAC3C,IAAIqD,EAAexxB,EAAI/Q,KAAI,SAAUuS,EAAMjS,GAAO,MAAO,CAAGiS,KAAMA,EAAMjS,IAAKA,MAK7E,OAJAiiC,EAAa1lB,MAAK,SAAU2lB,EAAUC,GAClC,IAAIC,EAAUxD,EAAUsD,EAASjwB,KAAMkwB,EAASlwB,MAChD,OAAmB,IAAZmwB,EAAgBF,EAASliC,IAAMmiC,EAASniC,IAAMoiC,KAElDH,EAAaviC,KAAI,SAAU2iC,GAAW,OAAOA,EAAQpwB,SA6DhEovB,EAASzuC,UAAUoO,KAAO,SAAUwrB,EAAS1f,EAAS5b,GAClD,IAAIoc,EAAOvc,KAAK6+B,eAAer9B,OAAOi6B,EAAS1f,GAI/C,OAHI,QAAU5b,GAAWA,EAAQiH,YAC7BmV,EAAKnV,SAAWjH,EAAQiH,UAC5BpH,KAAKuc,KAAKA,GACHA,GAEJ+zB,EArRkB,8VCpDzBiB,EAA4B,WAE5B,SAASA,EAA4B78B,GACjC,IAAIvE,EAAQnQ,KACZA,KAAK0U,OAASA,EACG1U,KAAKqc,mBAAoB,EAM1Crc,KAAK2c,MAAQ,IAAI,IAAS3c,KAAK0U,QAM/B1U,KAAKuL,OAAS,IAAI,IAAUvL,KAAK0U,QAsDjC1U,KAAKyR,IAAM,SAAU+/B,EAAQz8B,EAAStH,GAClC,OAAO0C,EAAMuE,OAAO0C,gBAAgB3F,IAAI+/B,EAAQz8B,EAAStH,IAS7DzN,KAAKmI,KAAO,WAAc,OAAOgI,EAAMuE,OAAO0C,gBAAgBjP,QAQ9DnI,KAAKmvC,OAAS,WAAc,OAAOh/B,EAAMuE,OAAO0C,gBAAgB+3B,UAQhEnvC,KAAK8xB,KAAO,WAAc,OAAO3hB,EAAMuE,OAAO0C,gBAAgB0a,QAgB9D9xB,KAAKmV,SAAW,SAAU3U,GAAY,OAAO2P,EAAMuE,OAAO0C,gBAAgBjC,SAAS3U,IA4IvF,OAzIA+wC,EAAW1vC,UAAUqT,QAAU,WAC3BlV,KAAKsc,QAAO,GACZtc,KAAK2c,MAAMzH,WAOfq8B,EAAW1vC,UAAU8qB,MAAQ,WACzB,MAAO,CAAExkB,KAAMnI,KAAKmI,OAAQgnC,OAAQnvC,KAAKmvC,SAAUrd,KAAM9xB,KAAK8xB,SAsBlEyf,EAAW1vC,UAAU+qB,KAAO,SAAU1W,GAClC,IAAIA,IAAOA,EAAI5T,iBAAf,CAEA,IAAI+oB,EAAKrrB,KAAK0U,OAAQuC,EAAaoU,EAAGpU,WAAYJ,EAAewU,EAAGxU,aAChEpF,EAAM,CAAEtJ,KAAM8O,EAAW9O,OAAQgnC,OAAQl4B,EAAWk4B,SAAUrd,KAAM7a,EAAW6a,QAC/E2f,EAAOzxC,KAAKgc,MAAMvK,IACJ,QAAQ,CACtB,CAAC,KAAU,SAAU+/B,GAAU,OAAOv6B,EAAWxF,IAAI+/B,GAAQ,KAC7D,CAAC,EAAA3R,YAAA,MAAmB,SAAU3sB,GAAO,OAAO2D,EAAa66B,GAAGx+B,EAAIzF,MAAOyF,EAAI9E,OAAQ8E,EAAI/S,WACvF,EAAC,IAAA+Y,IAAG,EAAA2mB,aAAc,SAAUx5B,GAAU,OAAOwQ,EAAa66B,GAAGrrC,EAAOoH,QAASpH,EAAO+H,SAAU/H,EAAOlG,cAEzGwxC,CAAYF,GAAQA,EAAKl1B,KAAKR,QAAQ01B,EAAKz1B,MAAOvK,EAAKzR,KAAK0U,WAwBhE68B,EAAW1vC,UAAUya,OAAS,SAAUhH,GACpC,IAAInF,EAAQnQ,KACZ,IAAgB,IAAZsV,EAKA,OAAQtV,KAAK4xC,iBACT5xC,KAAK4xC,kBAAoB5xC,KAAK0U,OAAOuC,WAAW9B,UAAS,SAAUe,GAAO,OAAO/F,EAAMyc,KAAK1W,MALhGlW,KAAK4xC,kBAAoB5xC,KAAK4xC,0BACvB5xC,KAAK4xC,kBA+BpBL,EAAW1vC,UAAUkb,eAAiB,SAAU9Q,QAC9BkI,IAAVlI,IACAA,GAAQ,GACZjM,KAAKqc,kBAAoBpQ,GAQ7BslC,EAAW1vC,UAAUma,MAAQ,SAAUvK,GAEnCA,GAAM,QAAO,CAAEtJ,KAAM,GAAIgnC,OAAQ,GAAIrd,KAAM,IAAMrgB,GAYjD,IAXA,IAUIggC,EARsBl1B,EAClBP,EAHJW,EAAQ3c,KAAK2c,MAAMA,QAWdU,EAAI,EAAGA,EAAIV,EAAMvN,UAElBqiC,GAAQA,EAAKl1B,KAAK00B,SAAWt0B,EAAMU,GAAG4zB,QAFZ5zB,IAAK,CAInC,IAAIyI,QAZA9J,GAAAA,GADkBO,EAaEI,EAAMU,IAZbrB,MAAMvK,EALfzR,KAK0B0U,UAClB,CAAEsH,MAAOA,EAAOO,KAAMA,EAAMs1B,OAAQt1B,EAAK0yB,cAAcjzB,KAavEy1B,GAAQA,GAAS3rB,GAAWA,EAAQ+rB,OAASJ,EAAKI,OAAU/rB,EAAU2rB,EAE1E,OAAOA,GAEJF,EA7PoB,oZCJ3BO,EAAsC,WACtC,SAASA,EAAqBp9B,EAAQq9B,GAClC,IAAI5hC,EAAQnQ,KACZA,KAAK+xC,gBAAkBA,EACvB/xC,KAAKgyC,WAAa,GAClBhyC,KAAKiyC,UAAY,SAAU/7B,GAAO,OAAO/F,EAAM6hC,WAAWjxC,SAAQ,SAAU+J,GAAM,OAAOA,EAAGoL,OAC5FlW,KAAK8xB,KAAO,WAAc,OAAO,QAAS3hB,EAAM+hC,QAAQpgB,MACxD9xB,KAAKmI,KAAO,WAAc,OAAO,QAASgI,EAAM+hC,QAAQ/pC,MACxDnI,KAAKmvC,OAAS,WAAc,OAAO,SAAU,QAASh/B,EAAM+hC,QAAQ/C,SACpEnvC,KAAKmyC,UAAY,cACjBnyC,KAAKoyC,SAAW,aAoBpB,OAlBAN,EAAqBjwC,UAAU4P,IAAM,SAAUA,EAAKsD,GAQhD,YAPgB,IAAZA,IAAsBA,GAAU,IAChC,QAAUtD,IAAQA,IAAQzR,KAAKkyC,SAC/BlyC,KAAKmpB,KAAK,KAAM,KAAM1X,EAAKsD,GACvB/U,KAAK+xC,iBACL/xC,KAAKgyC,WAAWjxC,SAAQ,SAAU+J,GAAM,OAAOA,EAAG,CAAE2G,IAAKA,SAG1D,QAASzR,OAEpB8xC,EAAqBjwC,UAAUsT,SAAW,SAAUrK,GAChD,IAAIqF,EAAQnQ,KAEZ,OADAA,KAAKgyC,WAAWvxC,KAAKqK,GACd,WAAc,OAAO,QAAWqF,EAAM6hC,WAAYlnC,KAE7DgnC,EAAqBjwC,UAAUqT,QAAU,SAAUR,IAC/C,QAAS1U,KAAKgyC,aAEXF,EA9B8B,2LCDrCO,EAAuC,WACvC,SAASA,EAAsB39B,EAAQ49B,QAClB,IAAbA,IAAuBA,GAAW,GACtCtyC,KAAKsyC,SAAWA,EAChBtyC,KAAK0V,eAAYvB,EACjBnU,KAAKuyC,YAAc,GAmCvB,OAjCAF,EAAsBxwC,UAAUirC,KAAO,WACnC,OAAIj3B,SAASi3B,KACFyC,OAAO15B,SAASi3B,MAEA,UAApB9sC,KAAK+sC,WAAyB,IAAM,IAE/CsF,EAAsBxwC,UAAUkrC,SAAW,WACvC,OAAOl3B,SAASk3B,SAASh4B,QAAQ,KAAM,KAE3Cs9B,EAAsBxwC,UAAUgrC,KAAO,WACnC,OAAOh3B,SAAS28B,UAEpBH,EAAsBxwC,UAAUwT,UAAY,WACxC,OAAOrV,KAAKsyC,UAEhBD,EAAsBxwC,UAAU8qC,WAAa,SAAUC,GACnD,OAAO,QAAUA,GAAc5sC,KAAKuyC,YAAc3F,EAAa5sC,KAAKuyC,aAExEF,EAAsBxwC,UAAU4T,SAAW,SAAUu4B,GAKjD,OAJI,QAAUA,KACVhuC,KAAK0V,UAAYs4B,IACjB,QAAYhuC,KAAK0V,aACjB1V,KAAK0V,UAAY1V,KAAKyyC,eACnBzyC,KAAK0V,WAEhB28B,EAAsBxwC,UAAU4wC,YAAc,WAC1C,IAAIC,EAAUrsB,SAASssB,qBAAqB,QAAQ,GACpD,OAAID,GAAWA,EAAQ1E,KACZ0E,EAAQ1E,KAAKj5B,QAAQ,uBAAwB,IAEjD/U,KAAKsyC,SAAW,IAAMz8B,SAAS/B,UAAY,KAEtDu+B,EAAsBxwC,UAAUqT,QAAU,aACnCm9B,EAxC+B,uHCDlCO,2IADJC,GACID,EAAgB,SAAUzZ,EAAGva,GAI7B,OAHAg0B,EAAgBr/B,OAAOu/B,gBAClB,CAAEC,UAAW,cAAgBnxC,OAAS,SAAUu3B,EAAGva,GAAKua,EAAE4Z,UAAYn0B,IACvE,SAAUua,EAAGva,GAAK,IAAK,IAAIic,KAAKjc,EAAOA,EAAElc,eAAem4B,KAAI1B,EAAE0B,GAAKjc,EAAEic,MACpD1B,EAAGva,IAErB,SAAUua,EAAGva,GAEhB,SAASo0B,IAAOhzC,KAAKokB,YAAc+U,EADnCyZ,EAAczZ,EAAGva,GAEjBua,EAAEt3B,UAAkB,OAAN+c,EAAarL,OAAO/R,OAAOod,IAAMo0B,EAAGnxC,UAAY+c,EAAE/c,UAAW,IAAImxC,KAMnFC,EAAqC,SAAUC,GAE/C,SAASD,EAAoBv+B,GACzB,IAAIvE,EAAQ+iC,EAAOnxC,KAAK/B,KAAM0U,GAAQ,IAAU1U,KAEhD,OADA,sBAAsB,aAAcmQ,EAAM8hC,WAAW,GAC9C9hC,EAYX,OAhBA0iC,EAAUI,EAAqBC,GAM/BD,EAAoBpxC,UAAUqwC,KAAO,WACjC,OAAO,QAAYlyC,KAAKmyC,UAAUrgB,OAEtCmhB,EAAoBpxC,UAAUsnB,KAAO,SAAU1b,EAAO0lC,EAAO1hC,EAAKsD,GAC9D/U,KAAKmyC,UAAUrgB,KAAOrgB,GAE1BwhC,EAAoBpxC,UAAUqT,QAAU,SAAUR,GAC9Cw+B,EAAOrxC,UAAUqT,QAAQnT,KAAK/B,KAAM0U,GACpC,yBAAyB,aAAc1U,KAAKiyC,YAEzCgB,EAjB6B,CAkBtC,6cC/BEG,EACA,WACI,IAAIjjC,EAAQnQ,KACZA,KAAKkV,QAAU,KACflV,KAAK0V,UAAY,GACjB1V,KAAKqzC,MAAQ,GACbrzC,KAAKszC,UAAY,OACjBtzC,KAAKuzC,MAAQ,YACbvzC,KAAKuyC,YAAc,GACnBvyC,KAAK8sC,KAAO,WAAc,OAAO38B,EAAMkjC,OACvCrzC,KAAK+sC,SAAW,WAAc,OAAO58B,EAAMmjC,WAC3CtzC,KAAK6sC,KAAO,WAAc,OAAO18B,EAAMojC,OACvCvzC,KAAKyV,SAAW,WAAc,OAAOtF,EAAMuF,WAC3C1V,KAAKqV,UAAY,WAAc,OAAO,GACtCrV,KAAK2sC,WAAa,SAAU6G,GAAU,OAAQ,QAAUA,GAAWrjC,EAAMoiC,YAAciB,EAAUrjC,EAAMoiC,oIChBvGK,8EADJC,GACID,EAAgB,SAAUzZ,EAAGva,GAI7B,OAHAg0B,EAAgBr/B,OAAOu/B,gBAClB,CAAEC,UAAW,cAAgBnxC,OAAS,SAAUu3B,EAAGva,GAAKua,EAAE4Z,UAAYn0B,IACvE,SAAUua,EAAGva,GAAK,IAAK,IAAIic,KAAKjc,EAAOA,EAAElc,eAAem4B,KAAI1B,EAAE0B,GAAKjc,EAAEic,MACpD1B,EAAGva,IAErB,SAAUua,EAAGva,GAEhB,SAASo0B,IAAOhzC,KAAKokB,YAAc+U,EADnCyZ,EAAczZ,EAAGva,GAEjBua,EAAEt3B,UAAkB,OAAN+c,EAAarL,OAAO/R,OAAOod,IAAMo0B,EAAGnxC,UAAY+c,EAAE/c,UAAW,IAAImxC,KAKnFS,EAAuC,SAAUP,GAEjD,SAASO,EAAsB/+B,GAC3B,OAAOw+B,EAAOnxC,KAAK/B,KAAM0U,GAAQ,IAAS1U,KAQ9C,OAVA6yC,EAAUY,EAAuBP,GAIjCO,EAAsB5xC,UAAUqwC,KAAO,WACnC,OAAOlyC,KAAK0zC,MAEhBD,EAAsB5xC,UAAUsnB,KAAO,SAAU1b,EAAO0lC,EAAO1hC,EAAKsD,GAChE/U,KAAK0zC,KAAOjiC,GAETgiC,EAX+B,CAYxC,0tBCZ8B,QAAsB,4BAA4B,EAAO,IAAqB,MAEzE,QAAsB,6BAA6B,EAAM,IAA0B,MAEtF,QAAsB,0BAA0B,EAAO,IAAuB,8HClBxGb,2IADJC,GACID,EAAgB,SAAUzZ,EAAGva,GAI7B,OAHAg0B,EAAgBr/B,OAAOu/B,gBAClB,CAAEC,UAAW,cAAgBnxC,OAAS,SAAUu3B,EAAGva,GAAKua,EAAE4Z,UAAYn0B,IACvE,SAAUua,EAAGva,GAAK,IAAK,IAAIic,KAAKjc,EAAOA,EAAElc,eAAem4B,KAAI1B,EAAE0B,GAAKjc,EAAEic,MACpD1B,EAAGva,IAErB,SAAUua,EAAGva,GAEhB,SAASo0B,IAAOhzC,KAAKokB,YAAc+U,EADnCyZ,EAAczZ,EAAGva,GAEjBua,EAAEt3B,UAAkB,OAAN+c,EAAarL,OAAO/R,OAAOod,IAAMo0B,EAAGnxC,UAAY+c,EAAE/c,UAAW,IAAImxC,KAUnFW,EAA0C,SAAUT,GAEpD,SAASS,EAAyBj/B,GAC9B,IAAIvE,EAAQ+iC,EAAOnxC,KAAK/B,KAAM0U,GAAQ,IAAS1U,KAG/C,OAFAmQ,EAAMyjC,QAAUl/B,EAAOuC,WAAW1L,OAClC,sBAAsB,WAAY4E,EAAM8hC,WAAW,GAC5C9hC,EA8CX,OAnDA0iC,EAAUc,EAA0BT,GAuBpCS,EAAyB9xC,UAAUgyC,eAAiB,WAChD,OAAO,QAAqB7zC,KAAK4zC,QAAQn+B,aAE7Ck+B,EAAyB9xC,UAAUqwC,KAAO,WACtC,IAAI7mB,EAAKrrB,KAAKmyC,UAAWr+B,EAAWuX,EAAGvX,SAAUge,EAAOzG,EAAGyG,KAAMqd,EAAS9jB,EAAG8jB,OAC7EA,GAAS,QAAWA,GAAQ,GAC5Brd,GAAO,QAAUA,GAAM,GACvB,IAAIgiB,EAAa9zC,KAAK6zC,iBAClBE,EAAqBjgC,IAAa9T,KAAK4zC,QAAQn+B,WAC/Cu+B,EAAiBlgC,EAASiT,OAAO,EAAG+sB,EAAW1kC,UAAY0kC,EAE/D,OADAhgC,EAAWigC,EAAqB,IAAMC,EAAiBlgC,EAASmmB,UAAU6Z,EAAW1kC,QAAU0E,IAC5Eq7B,EAAS,IAAMA,EAAS,KAAOrd,EAAO,IAAMA,EAAO,KAE1E6hB,EAAyB9xC,UAAUsnB,KAAO,SAAU1b,EAAO0lC,EAAO1hC,EAAKsD,GACnE,IAAI++B,EAAa9zC,KAAK6zC,iBAClBzF,EAAQ38B,GAAkB,MAAXA,EAAI,GAAa,IAAM,GACtCwiC,EAAkB,KAARxiC,GAAsB,MAARA,EAAczR,KAAK4zC,QAAQn+B,WAAaq+B,EAAa1F,EAAQ38B,EACrFsD,EACA/U,KAAKoyC,SAAS8B,aAAazmC,EAAO0lC,EAAOc,GAGzCj0C,KAAKoyC,SAAS+B,UAAU1mC,EAAO0lC,EAAOc,IAG9CN,EAAyB9xC,UAAUqT,QAAU,SAAUR,GACnDw+B,EAAOrxC,UAAUqT,QAAQnT,KAAK/B,KAAM0U,GACpC,yBAAyB,WAAY1U,KAAKiyC,YAEvC0B,EApDkC,CAqD3C,qKCzDS5sC,EAAK,CAEZkJ,KAAM,SAAUjM,GAAO,OAAO,IAAIowC,SAAQ,SAAUznC,EAAS0nC,GAAU,OAAO1nC,EAAQ3I,OAEtFqwC,OAAQ,SAAUrwC,GACd,OAAO,IAAIowC,SAAQ,SAAUznC,EAAS0nC,GAClCA,EAAOrwC,OAIfiI,MAAO,WACH,IAAIqoC,EAAW,GAKf,OAJAA,EAAS7wC,QAAU,IAAI2wC,SAAQ,SAAUznC,EAAS0nC,GAC9CC,EAAS3nC,QAAUA,EACnB2nC,EAASD,OAASA,KAEfC,GAGX74B,IAAK,SAAUF,GACX,IAAI,QAAQA,GACR,OAAO64B,QAAQ34B,IAAIF,GAEvB,IAAI,QAASA,GAAW,CAGpB,IAAI0gB,EAAQ1oB,OAAOC,KAAK+H,GAAU5M,KAAI,SAAU9I,GAAO,OAAO0V,EAAS1V,GAAKkF,MAAK,SAAU/G,GAAO,MAAO,CAAG6B,IAAKA,EAAK7B,IAAKA,SAE3H,OAAO+C,EAAG0U,IAAIwgB,GAAOlxB,MAAK,SAAUiW,GAChC,OAAOA,EAAOpS,QAAO,SAAUsL,EAAKzG,GAEhC,OADAyG,EAAIzG,EAAM5N,KAAO4N,EAAMzP,IAChBkW,IACR,yMC/CRq6B,EAAmB,SAAUC,EAAOnpB,GAC3C,IAAIxlB,EAAMwlB,EAAG,GAAIrnB,EAAMqnB,EAAG,GAU1B,OATKmpB,EAAM9xC,eAAemD,IAGjB,QAAQ2uC,EAAM3uC,IACnB2uC,EAAM3uC,GAAKpF,KAAKuD,GAGhBwwC,EAAM3uC,GAAO,CAAC2uC,EAAM3uC,GAAM7B,GAN1BwwC,EAAM3uC,GAAO7B,EAQVwwC,GAEAC,EAAY,SAAUC,GAC7B,OAAOA,EAAY5xB,MAAM,KAAKxZ,OAAO,MAAUqF,IAAI,MAAYC,OAAO2lC,EAAkB,KAErF,SAASra,EAASzoB,GACrB,IAAIkjC,EAAgB,SAAUrlC,GAAK,OAAOA,GAAK,IAC3C+b,GAAK,QAAU5Z,GAAK9C,IAAIgmC,GAAgBC,EAAavpB,EAAG,GAAIyG,EAAOzG,EAAG,GACtEC,GAAK,QAAWspB,GAAYjmC,IAAIgmC,GACpC,MAAO,CAAExsC,KADkDmjB,EAAG,GACzC6jB,OADsD7jB,EAAG,GACzCwG,KAAMA,EAAMrgB,IAAKA,GAEnD,IAAIojC,EAAW,SAAUC,GAC5B,IAAI3sC,EAAO2sC,EAAI3sC,OACX4sC,EAAeD,EAAI3F,SACnBrd,EAAOgjB,EAAIhjB,OACXqd,EAAS57B,OAAOC,KAAKuhC,GACpBpmC,KAAI,SAAU9I,GACf,IAAImJ,EAAQ+lC,EAAalvC,GAEzB,QADW,QAAQmJ,GAASA,EAAQ,CAACA,IACzBL,KAAI,SAAU3K,GAAO,OAAO6B,EAAM,IAAM7B,QAEnD4K,OAAO,KAAS,IAChBqE,KAAK,KACV,OAAO9K,GAAQgnC,EAAS,IAAMA,EAAS,KAAOrd,EAAO,IAAMA,EAAO,KAE/D,SAASkjB,EAAsBxvC,EAAM0oC,EAAS+G,EAAcC,GAC/D,OAAO,SAAU98B,GACb,IAAIX,EAAWW,EAAShB,gBAAkB,IAAI69B,EAAa78B,GACvD+8B,EAAiB/8B,EAASf,eAAiB,IAAI69B,EAAmB98B,EAAU81B,GAKhF,MAAO,CAAE1oC,KAAMA,EAAMiS,QAASA,EAAS09B,cAAeA,EAAejgC,QAJrE,SAAiBR,GACbA,EAAOQ,QAAQuC,GACf/C,EAAOQ,QAAQigC,kaCvBvBr6B,EAA6B,WAE7B,SAASA,EAA6BpG,GAClC,IAAIvE,EAAQnQ,KACZA,KAAK0U,OAASA,EACG1U,KAAKo1C,SAAW,GAChBp1C,KAAKq1C,aAAe,GACpBr1C,KAAKs1C,qBAAuB,GAC5Bt1C,KAAKgyC,WAAa,GAEnChyC,KAAKgK,WAAa,CACdC,iBAAkBjK,KAAKiK,iBAAiB3G,KAAKtD,MAC7CgX,mBAAoBhX,KAAKgX,mBAAmB1T,KAAKtD,MACjDu1C,kBAAmB,SAAUlqC,GAAM,OAAO,QAAK8E,EAAMilC,UAAU,SAAUt7B,GAAQ,OAAO3J,EAAMuE,OAAOyG,IAAM,IAAMrB,EAAKzO,KAAOA,MAC7HmqC,mBAAoB,WAAc,OAAOrlC,EAAMilC,UAC/CK,mBAAoB,WAAc,OAAOtlC,EAAMklC,cAC/CK,QAAS,SAAUvX,GAEf,OADAhuB,EAAM6hC,WAAWvxC,KAAK09B,GACf,WAAc,OAAO,QAAWhuB,EAAM6hC,WAAY7T,MAwPrE,OAzOArjB,EAAY66B,sBAAwB,SAAU9kC,EAAS+kC,QAC/B,IAAhBA,IAA0BA,EAAc,IAI5C,IAAIC,EAAgBD,EAAY9yB,MAAM,KAClC9H,EAAa66B,EAAc,IAAM,WACjC36B,GAAsB,QAAS26B,EAAc,IAAMA,EAAc,GAAK,IAGtEC,EAAwB,wBAAwBrsC,KAAKuR,GAYzD,GAXI86B,IAEA56B,EAAsB46B,EAAsB,GAC5C96B,EAAa86B,EAAsB,IAEV,MAAzB96B,EAAWvV,OAAO,KAClBuV,EAAaA,EAAW+L,OAAO,GAC/B7L,EAAsB,IAGN,kBACFzR,KAAKyR,GAAsB,CACzC,IAAI66B,EAAc76B,EAAoB4H,MAAM,KAAKlU,QAAO,SAAUonC,EAAQ1mC,GAAK,OAAO0mC,EAAO57B,SAAWvJ,GACxGqK,EAAsB66B,EAAYvwC,SAEL,MAAxB0V,IACLA,EAAsBrK,EAAQrL,MAElC,MAAO,CAAEwV,WAAYA,EAAYE,oBAAqBA,IAG1DJ,EAAYjZ,UAAUoI,iBAAmB,SAAU4G,GAC/C,OAAQ7Q,KAAKi2C,aAAeplC,GAAW7Q,KAAKi2C,cAGhDn7B,EAAYjZ,UAAUmV,mBAAqB,SAAUk/B,EAAUh2C,GAC3DF,KAAKs1C,qBAAqBY,GAAYh2C,GAE1C4a,EAAYjZ,UAAU2yB,iBAAmB,SAAUrsB,EAAMozB,GACrD,IAAI4a,EAAan2C,KAAKs1C,qBAAqB/Z,EAAKnwB,OAChD,IAAK+qC,EACD,MAAM,IAAI1jC,MAAM,2DAA6D8oB,EAAKnwB,OACtF,IAAIgrC,EAAOD,EAAWhuC,EAAMozB,GAC5B,OAAO,QAAQ6a,GAAQA,EAAO,CAACA,IAUnCt7B,EAAYjZ,UAAUumC,qBAAuB,SAAU19B,GACnD,2BAA4B,cAAeA,IAC3C,QAAW1K,KAAKq1C,aAAc3qC,IAElCoQ,EAAYjZ,UAAUwmC,mBAAqB,SAAU39B,GACjD,2BAA4B,iBAAkBA,GAC9C1K,KAAKq1C,aAAa50C,KAAKiK,IAE3BoQ,EAAYjZ,UAAU+qB,KAAO,WACzB,IAAIzc,EAAQnQ,KACRq2C,EAAer2C,KAAKo1C,SAASzmC,KAAI,SAAU4c,GAAO,MAAO,CAACA,EAAIjgB,IAAKigB,MAAS3c,OAAO,KAAY,IASnG,SAAS0nC,EAAgB/qC,GAErB,IADA,IAAIsF,EAAUtF,EAAOxD,SAASgC,SAAUG,EAAQ,IACvCA,GAAS2G,EAAQuJ,QACtBvJ,EAAUA,EAAQuJ,OACtB,OAAOlQ,EAGX,IAAIqsC,GAAe,SAAM,SAAUC,EAASC,EAAQ1lB,EAAMC,GAAS,OAAOylB,GAAUD,EAAQzlB,GAAQylB,EAAQxlB,OAkBxG0lB,EAAe12C,KAAKo1C,SAAS5pB,KAAK+qB,GA9BtC,SAAqB9vC,GACjB,IAAIkwC,EAAa,SAAU9lC,GAAW,OAAQA,GAAWA,EAAQuJ,OAASu8B,EAAW9lC,EAAQuJ,QAAU,EAAI,GAC3G,OAAsC,IAA/B3T,EAAO6E,IAAIwX,MAAM,KAAK1T,OAAiBunC,EAAWlwC,EAAOkiB,mBA4BJ,IAAIha,KAjB3C,SAAUlI,GAC/B,IAAImwC,EAAkBzmC,EAAMklC,aAAa/rC,OAAOwR,EAAYoI,QAAQmzB,EAAc5vC,IAOlF,OANImwC,EAAgBxnC,OAAS,GAIzBwnC,EAAgBprB,KAAK+qB,EAAaD,GAAkB,IAEjD,CAAE7vC,OAAQA,EAAQiE,WAAYksC,EAAgB,OAUrDC,EAAqBH,EAAa/nC,KAAI,SAAU8E,GAAS,OAAOA,EAAM/I,cACtEosC,EAAwB92C,KAAKq1C,aAC5B/rC,QAAO,SAAUiC,GAAU,QAAQ,QAAQsrC,EAAoBtrC,MAC/DoD,KAAI,SAAUjE,GAAc,MAAO,CAAGjE,YAAQ0N,EAAWzJ,WAAYA,MAC1EgsC,EAAa31C,SAZS,SAAU0S,IAGkB,IAA1CtD,EAAMilC,SAASlnC,QAAQuF,EAAMhN,SAC7BgN,EAAMhN,OAAO+E,cAAciI,EAAM/I,eASzC,IAAIqsC,EAAYL,EAAat0C,OAAO00C,GACpC92C,KAAKgyC,WAAWjxC,SAAQ,SAAU+J,GAAM,OAAOA,EAAGisC,MAClD,mBAAoBA,IAiBxBj8B,EAAYjZ,UAAUgK,eAAiB,SAAUpF,GAC7C,iCAAkC,iBAAkBA,GACpD,IAAIuwC,EAAUh3C,KAAKo1C,SAMnB,OAJI4B,EAAQ1tC,QADY,SAAUiiB,GAAO,OAAOA,EAAIjgB,MAAQ7E,EAAO6E,KAAOigB,EAAIngB,QAAU3E,EAAO2E,SACzDgE,QAClC,iCAAkC,+BAAgC3I,GACtEuwC,EAAQv2C,KAAKgG,GACbzG,KAAK4sB,OACE,YAEU,IADHoqB,EAAQ9oC,QAAQzH,IAK1B,iCAAkC,mBAAoBA,IACtD,QAAWuwC,EAAX,CAAoBvwC,IAJhB,iCAAkC,uCAAwCA,KAYtFqU,EAAYjZ,UAAUo1C,UAAY,WAC9B,OAAOj3C,KAAKo1C,SAASzmC,KAAI,QAAK,SAOlCmM,EAAYjZ,UAAUq1C,OAAS,WAC3B,OAAOl3C,KAAKo1C,SAAS9rC,QAAO,QAAK,YAAYqF,KAAI,QAAK,UA2D1DmM,EAAYoI,QAAU,SAAUmzB,EAAc5vC,GAAU,OAAO,SAAUiE,GAErE,GAAIjE,EAAO2E,QAAUV,EAAW3C,SAASqD,MACrC,OAAO,EAEX,IAAI+8B,EAAKz9B,EAAW3C,SAChBovC,EAAahP,EAAGptB,YAAY+H,MAAM,KAClCs0B,EAAc3wC,EAAO6E,IAAIwX,MAAM,KAGnC,KAAK,QAAOq0B,EAAYC,EAAYt1C,MAAM,EAAIq1C,EAAW/nC,SACrD,OAAO,EAGX,IAAIioC,EAAY,EAAIF,EAAW/nC,aAAU+E,EACrCmjC,EAAoBF,EAAYt1C,MAAM,EAAGu1C,GAAWpkC,KAAK,KACzDskC,EAAgBlB,EAAaiB,GAAmB3uB,gBACpD,OAAOwf,EAAGltB,wBAA0Bs8B,GAAiBA,EAAc/xC,QAEhEsV,EA1QqB,wDCfhC,SAAUyL,EAAQ1mB,GAAU,aAyD5B,IAAI23C,EAAoB,gBAEpBC,EAAe53C,EAAQC,OAAO,SAAU,CAAC,OACrB43C,KAAK,CAAEC,eAAgB,UACvB53C,SAAS,SAkCjC,WACE,IAAIwL,EAAS,CACXqsC,YAAY,EACZC,aAAa,EACbC,cAAc,EACdC,cAAc,EACdC,cAAc,EACdC,aAAa,EACbC,WAAW,EACXC,UAAU,EACVC,aAAa,EACbC,kBAAkB,GAgCpB,SAASC,EAAUzlC,EAAU0lC,EAAUC,EAAqBC,GAC1D,OAAO,SAAS31C,EAAOoe,EAAMpO,GAC3B,IAAIA,EAAKpQ,eAAe80C,GAAxB,CAEA,IAAIkB,EAAgB5lC,EAAKkd,WAAWuoB,IAChChtC,EAAOmtC,IAAmBC,EAAYz3B,EAAMs3B,IAAyB1lC,EAAK4lC,IAC5E51C,EAAMyB,OAAOuO,EAAKD,IAAW,SAAS+lC,GAEpCA,EAAUH,GAAUG,IAAYA,EAChC13B,EAAKpO,KAAKylC,EAAUK,QAb5B54C,KAAKuL,OAAS,SAASstC,GACrBttC,EAAS1L,EAAQiB,OAAOyK,EAAQstC,IAkElC74C,KAAKU,KAAO,WACV,MAAO,CACL6K,OAAQ,SAAS1F,GACf,OAAO0F,EAAO1F,IAEhBizC,YAAaR,OA5IfE,EAAsB,CAAC,SAAU,IAAK,QAAS,WAAY,SAAU,UAAW,WAEhFG,EAAc,SAASz3B,EAAM63B,GAC/B,IAAiD,IAA7CA,EAAc7qC,QAAQgT,EAAK,GAAG83B,UAChC,OAAO,GA8IXvB,EAAa50C,UAAU,SAAU,CAAC,QAAS,SAASo2C,GAClD,OAAOA,EAAMH,YAAY,SAAU,cAAe,IAAI,MAEvDj2C,UAAU,SAAU,CAAC,QAAS,SAASo2C,GACtC,OAAOA,EAAMH,YAAY,SAAU,cAAe,IAAI,MAEvDj2C,UAAU,UAAW,CAAC,QAAS,SAASo2C,GACvC,OAAOA,EAAMH,YAAY,UAAW,eAAgBN,GAAqB,MAE1E31C,UAAU,YAAa,CAAC,QAAS,SAASo2C,GACzC,OAAOA,EAAMH,YAAY,YAAa,eAAgBN,GAAqB,MAE5E31C,UAAU,aAAc,CAAC,QAAS,SAASo2C,GAC1C,OAAOA,EAAMH,YAAY,aAAc,gBAAiBN,GAAqB,MAE9E31C,UAAU,aAAc,CAAC,QAAS,SAASo2C,GAC1C,OAAOA,EAAMH,YAAY,aAAc,gBAAiBN,GAAqB,MAE9E31C,UAAU,UAAW,CAAC,QAAS,SAASo2C,GAEvC,SAASC,EAAiBpmC,EAAMqmC,EAAgBj4B,EAAMk4B,GACpD,OAAOH,EAAM1tC,OAAO4tC,KACjBj4B,EAAKpO,KAAKA,KACVsmC,IAAsBT,EAAYz3B,EAAMs3B,MAClB,WAAtBt3B,EAAKpO,KAAK,SAA6C,UAArBoO,EAAK,GAAG83B,UAG/C,SAASK,EAAiBC,EAAMp4B,GAI9B,OAAQA,EAAKpO,KAAK,SAAYoO,EAAKpO,KAAK,UAAYwmC,IAAUX,EAAYz3B,EAAMs3B,GAYlF,MAAO,CACLrxC,SAAU,IACVxB,QAAS,UACTyB,SAAU,IACVC,QAAS,SAAS6Z,EAAMpO,GACtB,IAAIA,EAAKpQ,eAAe80C,GAAxB,CAEA,IAAI+B,EAhBR,SAAkBzmC,EAAMoO,GACtB,IAAIhS,EAAO4D,EAAK5D,KACZoqC,EAAOxmC,EAAKwmC,KAEhB,MAA2B,cAAlBpqC,GAAQoqC,IAAiC,qBAATA,EAA+B,WAC7C,WAAlBpqC,GAAQoqC,IAAiC,kBAATA,EAA4B,QACpD,UAATpqC,GAA0C,gBAAToqC,GAAmC,WAATA,EAAqB,QAAU,GAUpFE,CAAS1mC,GAErB,MAAO,CACL2mC,KAAM,SAAS32C,EAAOoe,EAAMpO,EAAM4mC,GAChC,IAAIC,EAAgBT,EAAiB,WAAY,WAAYh4B,GAAM,GAEnE,SAAS04B,IACP,OAAOF,EAAQG,YAcjB,OAAQN,GACN,IAAK,QACL,IAAK,WACCF,EAAiBE,EAAOr4B,IAC1BA,EAAKpO,KAAK,OAAQymC,GAEhBL,EAAiB,eAAgB,cAAeh4B,GAAM,IACxDpe,EAAMyB,OAAOq1C,EAAiC,UAAVL,EAlB1C,SAA0BO,GAGxB,IAAIlB,EAAW9lC,EAAKtO,OAASk1C,EAAQK,WACrC74B,EAAKpO,KAAK,eAAgB8lC,IAG5B,WACE13B,EAAKpO,KAAK,gBAAiB4mC,EAAQM,SAASN,EAAQK,eAa9CJ,GACFz4B,EAAKpO,KAAK,WAAY,GAExB,MACF,IAAK,QAIH,GAHIumC,EAAiBE,EAAOr4B,IAC1BA,EAAKpO,KAAK,OAAQ,UAEhBmmC,EAAM1tC,OAAO,aAAc,CAC7B,IAAI0uC,GAAqB/4B,EAAKpO,KAAK,mBAC9BA,EAAKpQ,eAAe,QAAUoQ,EAAKpQ,eAAe,UACnDw3C,GAAqBh5B,EAAKpO,KAAK,mBAC9BA,EAAKpQ,eAAe,QAAUoQ,EAAKpQ,eAAe,UACnDy3C,GAAqBj5B,EAAKpO,KAAK,iBAE/BmnC,GACFnnC,EAAKsnC,SAAS,OAAO,SAAgCN,GACnD54B,EAAKpO,KAAK,gBAAiBgnC,MAG3BI,GACFpnC,EAAKsnC,SAAS,OAAO,SAAgCN,GACnD54B,EAAKpO,KAAK,gBAAiBgnC,MAG3BK,GACFr3C,EAAMyB,OAAOq1C,GAAuB,SAAgCE,GAClE54B,EAAKpO,KAAK,gBAAiBgnC,MAI7BH,GACFz4B,EAAKpO,KAAK,WAAY,IAKvBA,EAAKpQ,eAAe,eAAiBg3C,EAAQW,YAAYC,UACzDpB,EAAiB,gBAAiB,eAAgBh4B,GAAM,IAE3DpO,EAAKsnC,SAAS,YAAY,WACxBl5B,EAAKpO,KAAK,kBAAmBA,EAAe,aAI5ComC,EAAiB,eAAgB,cAAeh4B,GAAM,IACxDpe,EAAMyB,QAAO,WACX,OAAOm1C,EAAQa,YACd,SAA+BT,GAChC54B,EAAKpO,KAAK,iBAAkBgnC,cAQzCj3C,UAAU,aAAc,CAAC,QAAS,SAASo2C,GAC1C,OAAOA,EAAMH,YAAY,aAAc,gBAAiBN,GAAqB,MAE9E31C,UAAU,cAAc,WACvB,MAAO,CACLsE,SAAU,IACVxB,QAAS,cACT4C,KAAM,SAASzF,EAAOoe,EAAMpO,EAAM0nC,GAC5B1nC,EAAKpQ,eAAe80C,IAEnBt2B,EAAKpO,KAAK,cACboO,EAAKpO,KAAK,YAAa,kBAK9BjQ,UAAU,UAAU,CAAC,QAAS,SAAU,SAASo2C,EAAO93C,GACvD,MAAO,CACLgG,SAAU,IACVE,QAAS,SAAS6Z,EAAMpO,GACtB,IAAIA,EAAKpQ,eAAe80C,GAAxB,CAEA,IAAI72C,EAAKQ,EAAO2R,EAAK2nC,SACrB,OAAO,SAAS33C,EAAOoe,EAAMpO,GAEtB6lC,EAAYz3B,EAAMs3B,KAEjBS,EAAM1tC,OAAO,sBAAwB2V,EAAKpO,KAAK,SACjDoO,EAAKpO,KAAK,OAAQ,UAGhBmmC,EAAM1tC,OAAO,cAAgB2V,EAAKpO,KAAK,aACzCoO,EAAKpO,KAAK,WAAY,IAGpBmmC,EAAM1tC,OAAO,gBAAmBuH,EAAK4nC,WAAc5nC,EAAK6nC,YAAe7nC,EAAK8nC,SAC9E15B,EAAK5gB,GAAG,WAAW,SAASC,GAC1B,IAAIs6C,EAAUt6C,EAAMu6C,OAASv6C,EAAMs6C,QAEnB,KAAZA,GAA8B,KAAZA,KAEwC,IAAxDrC,EAAoBtqC,QAAQ3N,EAAM8F,OAAO2yC,WAAqBz4C,EAAM8F,OAAO00C,mBAG7Ex6C,EAAMgD,iBAERT,EAAMmB,QAGR,WACEtD,EAAGmC,EAAO,CAAEk4C,OAAQz6C,mBASnCsC,UAAU,aAAc,CAAC,QAAS,SAASo2C,GAC1C,OAAO,SAASn2C,EAAOoe,EAAMpO,GACvBA,EAAKpQ,eAAe80C,KAEpByB,EAAM1tC,OAAO,aAAgB2V,EAAKpO,KAAK,aAAgB6lC,EAAYz3B,EAAMs3B,IAC3Et3B,EAAKpO,KAAK,WAAY,OA9Z5B,CAoaGyT,OAAQA,OAAO1mB,iECzalBA,QAAQC,OAAO,WAAY,CAAC,OAC3B+C,UAAU,WAAY,CAAC,KAAM,SAAUkE,GACvC,aAgCA,MAAO,CACNjE,MAAM,CACL42C,QAAe,IACf73B,IAAe,QACfiF,IAAe,QACfgD,KAAe,SACfmxB,SAAe,aACfC,SAAe,aACfC,UAAe,cACfC,UAAe,cACfC,WAAe,eACfC,WAAe,eACfC,aAAe,iBACfC,MAAe,UACfC,MAAe,UACfC,YAAe,gBACfC,YAAe,iBAEhBvqC,YAAa,2BACPzL,QAAS,UACToP,SAAS,EACTxM,KAlDI,SAAUtH,EAAQyG,EAAUxG,GAElCA,EAAO+5C,WACVh6C,EAAOg6C,SAAW,WAAW,OAAO,IAGjC/5C,EAAOi6C,YACVl6C,EAAOk6C,UAAY,WAAW,OAAO,IAGlCj6C,EAAOw6C,cACVz6C,EAAOy6C,YAAc,WAAW,IAAIviB,EAAIpyB,EAAGkF,QAAsB,OAAbktB,EAAExsB,UAAkBwsB,EAAE11B,UAGvEvC,EAAOs6C,QACVv6C,EAAOu6C,MAAQ,cAGZt6C,EAAOy6C,cACV16C,EAAO06C,YAAc,WAAW,IAAIxiB,EAAIpyB,EAAGkF,QAAsB,OAAbktB,EAAExsB,UAAkBwsB,EAAE11B,UAGvEvC,EAAOu6C,QACVx6C,EAAOw6C,MAAQ,eA4BVz6C,WAAY,yBAInBA,WAAW,qBAAsB,CAAC,SAAU,WAAY,SAAWC,EAAQuC,GAC3E,aAEAvC,EAAO26C,UAAar1B,OAAO7jB,eAAe,iBAAmB6jB,OAAOs1B,UAAUC,iBAAmB,EACjG76C,EAAO86C,SAAWl8C,QAAQoiB,KAAKhhB,EAAOy4C,SAEtCz4C,EAAO4gB,IAAM5gB,EAAO4gB,KAAO,EAC3B5gB,EAAO6lB,IAAM7lB,EAAO6lB,KAAO,EAC3B7lB,EAAO6oB,KAAO7oB,EAAO6oB,MAAQ,GAE7B7oB,EAAOi6C,SAAWj6C,EAAO86C,WAAa96C,EAAOy4C,QAE7Cz4C,EAAOm6C,UAAYn6C,EAAOm6C,WAAa,GACvCn6C,EAAO+6C,cAAgB/6C,EAAOm6C,UAAYn6C,EAAO6oB,KACjD7oB,EAAOo6C,WAAap6C,EAAOo6C,YAAc,GACzCp6C,EAAOq6C,WAAar6C,EAAOq6C,YAAcr6C,EAAOm6C,UAChDn6C,EAAOs6C,aAAet6C,EAAOs6C,cAAgBt6C,EAAOo6C,WAEpD,IAAI1nB,EAAO1yB,EAAO6lB,IAAM7lB,EAAO4gB,IAC/Bo6B,EAAQtoB,EAAO1yB,EAAO6oB,KACtBoyB,EAAUj7C,EAAOsD,OAAO,WAAW,WAClCtD,EAAOi6C,SAAWj6C,EAAO86C,WAAa96C,EAAOy4C,WAG9CyC,EAAW,SAAUC,GACpB,OAAQA,EAAM,GAAKH,EAAQtoB,GAG5B1yB,EAAOo7C,cAAgB,WACtB,OAAO,IAAIz6C,MAAMq6C,IAGlBh7C,EAAOq7C,cAAgB,SAAUF,GAChC,IAAIG,EAAQ,EAAEt7C,EAAO6oB,KAErB,OADW7oB,EAAOm6C,UAAUmB,GAAQH,EAAMG,IAI3Ct7C,EAAOu7C,WAAa,SAAUJ,GAC7B,OAAOD,EAASC,IAAUn7C,EAAOy4C,QAAQz4C,EAAO4gB,KAGjD5gB,EAAOw7C,aAAe,WACjBx7C,EAAOk6C,cAAgBl6C,EAAOg6C,YACjCh6C,EAAO06C,YAAY,CAACe,OAAOz7C,EAAOy4C,UAAU3uC,MAAK,WAChD9J,EAAOy4C,QAAUz4C,EAAO4gB,IACxB5gB,EAAOw6C,MAAM,CAACiB,OAAOz7C,EAAOy4C,cAK/Bz4C,EAAO07C,SAAW,SAAUP,GAC3B,IAAKn7C,EAAOg6C,WAAY,CACvB,IAAI2B,EAAW/8C,QAAQoiB,KAAKhhB,EAAO4gB,IAAMs6B,EAASC,IAElDn7C,EAAOy6C,YAAY,CAACgB,OAAOE,IAAW7xC,MAAK,WAC1C9J,EAAOy4C,QAAUkD,EACjBp5C,GAAS,WACRvC,EAAOu6C,MAAM,CAACkB,OAAOz7C,EAAOy4C,kBAMhCz4C,EAAOsB,IAAI,YAAY,WACtB25C,UAID3jC,IAAI,CAAC,iBAAkB,SAAUjI,GACjC,aAEAA,EAAeusC,IAAI,2BAElB,0iDCtHF,SAASC,EACP7mC,EACAL,EACA6C,EACAskC,EACAh2C,EACAi2C,EACAC,EACAC,EACAC,EACA35C,GAEA,MAAM45C,EAAKp9C,KA4CX,SAASq9C,EAAOC,GAEdN,EAAqBO,cAAcL,EAAgB,CAAEI,GAAAA,IAClDvyC,MAAMvG,IAhBX,IAAqBg5C,EAiBfvnC,EAAWwnC,OAASj5C,EAjBLg5C,GAkBI,IAAPF,EAAc,OAAS,OAjBvC1nC,EAAQwE,OAAOsjC,YACb,CACEF,IAAAA,GAEF,KAcEh6C,GAAS,KACPyS,EAAWhS,eAGdoe,MAAM26B,EAAqBW,gBA6MhCP,EAAG/vC,QArGH,WACEmZ,QAAQo3B,MAAM,oCAAqC3nC,EAAW4nC,SAC9D5nC,EAAW6nC,OAAS,OAEpB,MAAMC,EAAY9nC,EAAW+nC,SAASC,MAChCC,EAAajoC,EAAW+nC,SAASG,UACjCC,EACJnoC,EAAW+nC,SAASK,iBAAmBpoC,EAAW+nC,SAASG,UACvDG,EAAeroC,EAAW+nC,SAASO,aACnCC,EAAmBvoC,EAAW+nC,SAASS,gBACvCC,EAAgB58B,KAAKgF,IACzBT,SAASs4B,gBAAgBC,aACzBr4B,OAAOs4B,aAAe,GAElBC,EAAez4B,SAASs4B,gBAAgBI,YAG9C14B,SAASs4B,gBAAgBK,MAAMC,YAAY,oBAAqBlB,GAChE13B,SAASs4B,gBAAgBK,MAAMC,YAAY,qBAAsBf,GACjE73B,SAASs4B,gBAAgBK,MAAMC,YAC7B,4BACAb,GAEF/3B,SAASs4B,gBAAgBK,MAAMC,YAC7B,uBACAX,GAEFj4B,SAASs4B,gBAAgBK,MAAMC,YAC7B,2BACAT,GAEFn4B,SAASs4B,gBAAgBK,MAAMC,YAC7B,wBACAP,GAEFr4B,SAASs4B,gBAAgBK,MAAMC,YAC7B,uBACAH,GAGF,IAAII,GAAK,EAET,MAAMC,EAA8B36C,GAChB,OAAVA,GAAkBA,EAAMyR,EAAWJ,WAAc,GAGrDupC,EAAwBpC,EAAqBqC,QACjDlC,GACApyC,KAAKo0C,GACDG,EAAuBtC,EAAqBqC,QAChDnC,GACAnyC,KAAKo0C,GACPp4C,EAAG0U,IAAI,CAAC2jC,EAAuBE,IAC5Bv0C,MAAK,IAAiC,IAA/Bw0C,EAAcC,GAAiB,EACrCvpC,EAAW4nC,QAAU0B,EACrBtpC,EAAWwnC,OAAS+B,EAEhBvpC,EAAW4nC,QAAQ4B,aAAexpC,EAAWwnC,OAAOH,GACtD4B,GAAK,EAELjpC,EAAWwnC,OAAOH,IAAK,EAGa,iBAAlCrnC,EAAW+nC,SAAS0B,WACtBrC,EAAO6B,GAxMbzmC,EAAOi5B,GAjBT,WAAoB,QAClB,MAAMiO,EAAS1pC,EAAW+nC,SAAS2B,OAC7B9B,IAAU5nC,MAAAA,GAAA,UAAAA,EAAY4nC,eAAZ,mBAAqB4B,mBAArB,UAAkCp0C,IAE5Cu0C,EACJrQ,OAAOt5B,EAAW+nC,SAAS6B,kBAC3BtQ,OAAOt5B,EAAW+nC,SAAS8B,qBACzBvQ,OAAOt5B,EAAW+nC,SAAS6B,iBAE/B,SAAMhC,IAAa+B,GAAYD,GAQrBI,GAAa,aAAe,cAAe,KAAM,CACzDlqC,SAAU,YA6MR,IAAI2nC,EAAM,GAKRA,EAHAvnC,EAAW+nC,SAAS2B,SACnB1pC,EAAW+nC,SAASgC,gBAEf,OAEA,UAGRpqC,EAAQwE,OAAOsjC,YACb,CACEF,IAAAA,EACAO,UAAAA,EACAG,WAAAA,EACAQ,cAAAA,EACAI,aAAAA,GAEF,KAGF,MAAME,EAAQ34B,SAAS45B,cAAc,SACrC55B,SAASpB,KAAKi7B,YAAYlB,GAC1BA,EAAMmB,MAAMC,WACV,2BAA6BnqC,EAAW+nC,SAASC,MAAQ,kBAG5D57B,MAAM26B,EAAqBW,iBAKhCP,EAAGiD,MA3MH,WACE,MAAMZ,EAAcxpC,EAAW4nC,QAAQ4B,YAEvC,GAAIA,GAAeA,EAAYp0C,GAAI,CAEjC,MAAMi1C,EAAUvD,EACbuD,UACAlmC,OAAOva,QAAQkD,QAAQsjB,SAASk6B,cAAc,eAC9CC,qBAAoB,GACpBrN,MACCl9B,EAAW+nC,SAASyC,iBAClB,yCAEHC,GAAG,MACHv8C,OAAO,UAEV44C,EACG4D,KAAKL,GACLv1C,MAAK,WACJ,OAAOkyC,EAAI2D,gBAAgBC,aAAa,CACtCx1C,GAAIo0C,EAAYp0C,GAChBy1C,QAAQ,EACRC,YAAa,YAEZC,YAEJj2C,MAAK,WACJ0N,EAAOi5B,GAAG,cAAe,KAAM,CAC7B77B,SAAU,eAGbwM,OAAM,SAAU6K,GACf1G,QAAQnhB,MAAM,YAAa6nB,QA4KnCkwB,EAAGC,OAASA,EACZD,EAAG6D,SAxKH,WACE,MAAM3M,EAAWvtC,EAAGkF,QACdwzC,EAAcxpC,EAAW4nC,QAAQ4B,YA2DvC,OAzDIA,GAAeA,EAAYp0C,IAC7B4xC,EAAI2D,gBACDM,YAAY,CACXC,MAAO1B,EAAYp0C,GACnB+1C,YAAY,IAEbJ,SAASj2C,MAAK,SAAUpD,GACvB2sC,EAAS3nC,QACP00C,GAAAA,CAAK15C,EAAK25C,KAAKx/C,MAAM,IAAI,SAAUy/C,GACjC,IAAIC,EASJ,GAPsB,OAAlBD,EAAIE,YACND,EACEvrC,EAAW+nC,SAAS0D,eACpBzrC,EAAW4nC,QAAQ3uB,MACnB,UAAYqyB,EAAII,WAGE,QAAlBJ,EAAIE,UACN,OAAQxrC,EAAW+nC,SAAS4D,iBAC1B,IAAK,gBACHJ,EAASD,EAAIM,OACT5rC,EAAW+nC,SAAS8D,WAAaP,EAAIM,OACrC,SACJ,MAEF,IAAK,cACHL,EAASD,EAAIM,OACTN,EAAIQ,KAAKC,OAAST,EAAIQ,KAAKE,SAC3B,SACJ,MAEF,IAAK,iBACHT,EAASD,EAAIM,OAASN,EAAIQ,KAAKE,SAAW,SAC1C,MAEF,QACET,EAASD,EAAIM,OACT5rC,EAAW+nC,SAAS8D,WAAaP,EAAIM,OACrC,SAKV,MAAO,CACLL,OAAQA,EACR1d,QAASyd,EAAIW,KACbC,UAAWC,GAAAA,CAAOb,EAAIY,WAAWv6B,OAAO,+BAK/CvF,OAAM,SAAU6K,GACf1G,QAAQnhB,MAAM6nB,MAIbonB,EAAS7wC,SA4GlB25C,EAAGiF,eA5OH,WACE,MAA4C,YAArCpsC,EAAW+nC,SAASsE,aAA6B,OAAS,OA4OnE,MAAMC,EAAgB,CACpB5C,OAAQ,CAAC,SAAU,OAAQ,UAAW,UAAW,aACjD6C,QAAS,CAAC,YAKZjvC,OAAO+6B,eAAer4B,EAAY,cAAe,CAC/CvF,MACE,IAAIpK,EAAS2P,EAAW+nC,SAASyE,aAMjC,OALIF,EAAc5C,OAAOrmC,SAASrD,EAAW6nC,QAC3Cx3C,EAAS2P,EAAW+nC,SAAS0E,cACpBH,EAAcC,QAAQlpC,SAASrD,EAAW6nC,UACnDx3C,EAAS2P,EAAW+nC,SAAS2E,gBAExBr8C,KAIXigB,OAAOq8B,iBACL,WACA,SAAU1sC,GACa,SAAjBA,EAAIvO,KAAKuO,IACXmnC,GAAO,GACmB,SAAjBnnC,EAAIvO,KAAKuO,KAClBmnC,GAAO,MAGX,2eCtTJ,SAASwF,EAAS5sC,EAAYF,GAE5B,MAAM3H,EAAS2H,EAAUo5B,SAGzBl5B,EAAW+nC,SAAW,CACpB8E,OAAQ,UACRC,MAAM,GAGRC,GAAAA,CAAO50C,GAAQ,SAAU5J,EAAOqB,GAChB,KAAVrB,GAAiBy+C,GAAAA,CAAOz+C,KACZ,SAAVA,IACFA,GAAQ,GAGI,UAAVA,IACFA,GAAQ,GAGVyR,EAAW+nC,SAASn4C,GAAOrB,MAI/ByR,EAAWJ,SAAWI,EAAW+nC,SAASnoC,SAC1CI,EAAWwnC,OAAS,CAAEH,IAAI,GAC1BrnC,EAAW4nC,QAAU,GAWvB,SAASqF,EACPC,EACA9uC,EACA+uC,EACAC,EACAC,GAEAjvC,EAAkBgB,WAAU,GAGvB+tC,EAAcnjD,SAAS0R,QAAQjB,MAClC0yC,EAAcnjD,SAAS0R,QAAQjB,IAAM,IAIvC0yC,EAAcnjD,SAAS0R,QAAQjB,IAAI,qBACjC,gCAEF0yC,EAAcnjD,SAAS0R,QAAQjB,IAAI,iBAAmB,WACtD0yC,EAAcnjD,SAAS0R,QAAQjB,IAAI6yC,OAAS,WAG5CF,EAA4BG,UAAUF,GAGtCH,EACG11C,MAAM,MAAO,CACZkxB,UAAU,IAEXlxB,MAAM,cAAe,CACpBgE,IAAK,WACLL,YAAaqyC,EACbziD,WAAY,4BAEbyM,MAAM,aAAc,CACnBgE,IAAK,UACLL,YAAasyC,EACb1iD,WAAY,2BAEbyM,MAAM,cAAe,CACpBgE,IAAK,WACLL,YAAauyC,EACb3iD,WAAY,4BAEbyM,MAAM,WAAY,CACjBgE,IAAK,QACLL,YAAawyC,EACb5iD,WAAY,yBAEbyM,MAAM,gBAAiB,CACtBgE,IAAK,aACLL,YAAayyC,EACb7iD,WAAY,8BAEbyM,MAAM,cAAe,CACpBgE,IAAK,WACLL,YAAa0yC,EACb9iD,WAAY,0OC3FlB,SAAS+iD,EACP9tC,EACAwC,EACAurC,EACA/G,EACAl2C,EACAi2C,EACAG,EACAD,GAEA,MAAME,EAAKp9C,KAIX,SAASmmC,EAAY3gC,GACnB,OAAO,SAAU0nB,GACfkwB,EAAG6G,OAAOz+C,GAAQ0nB,EAAIvlB,KAEtB,MAAMu8C,EAAQF,EACXG,SACAC,YACCnuC,EAAW+nC,SAASqG,0BAClB,yBAEHC,WAAW,oBACXC,SAAS,OAEZP,EAASrD,KAAKuD,IAIlB,SAASM,IACPvuC,EAAWwuC,SAAU,EAkBvB,SAASC,IACHzuC,EAAW+nC,SAAS2B,OACtBlnC,EAAOi5B,GAAG,aAAc,KAAM,CAAE77B,SAAU,YAE1C4C,EAAOi5B,GAAG,cAAe,KAAM,CAAE77B,SAAU,YAI/C,SAAS4lC,IACP2B,EAAGuH,KAAO,GACVvH,EAAGwH,QAAU,KACbxH,EAAGyH,UAAY,KACfzH,EAAG0H,SAASC,eACZ3H,EAAG0H,SAASE,uBAEL/uC,EAAW4nC,QAAQ4B,YAE1BxpC,EAAWgvC,gBAAiB,EAiD9B7H,EAAG/vC,QAjFH,WACEmZ,QAAQo3B,MAAM,sCAAuC3nC,EAAW4nC,SAChE5nC,EAAW6nC,OAAS,UAGpB/2C,EAAG0U,IAAI,CACLuhC,EAAqBkI,WAAW/H,GAC7BpyC,MAAK,IAAMyb,QAAQo3B,MAAM,6BACzBv7B,MAAM26B,EAAqBW,gBAC9BX,EAAqBkI,WAAWhI,GAC7BnyC,MAAK,IAAMyb,QAAQo3B,MAAM,4BACzBv7B,MAAM26B,EAAqBW,kBAC7B5yC,MAAK,IAAOkL,EAAWwuC,SAAU,KAsEtCrH,EAAG+H,OA1CH,WACElvC,EAAWwuC,SAAU,EAEjBxuC,EAAW4nC,QAAQ4B,aAAexpC,EAAW4nC,QAAQ4B,YAAYp0C,GACnE4xC,EAAI2D,gBACDP,MACC+E,GAAAA,CACE,CACE/5C,GAAI4K,EAAW4nC,QAAQ4B,YAAYp0C,GACnCg6C,WAAYpvC,EAAW+nC,SAASqH,WAChCC,SACErvC,EAAW+nC,SAAS0D,eAAiBzrC,EAAW4nC,QAAQ3uB,MAE5DkuB,EAAGuH,OAGN3D,SAASj2C,MAAK,kBACNqyC,EAAG6G,OAAOkB,OAEjB,MAAMjB,EAAQF,EACXG,SACAC,YACCnuC,EAAW+nC,SAASuH,0BAClB,2BAEHjB,WAAW,oBACXlqC,OAAOva,QAAQkD,QAAQsjB,SAASk6B,cAAc,mBAEjDyD,EAASrD,KAAKuD,MAEfn5C,KAAK0wC,GACL1wC,KAAK25C,GACLriC,MAAM8jB,EAAY,WAClBqf,QAAQhB,IAEXA,IACAre,EAAY,YAOhBiX,EAAGqI,KAhDH,WACEhK,IACAiJ,KAgDFtH,EAAGuH,KAAO,GACVvH,EAAG6G,OAAS,GCjId,SAASyB,EAAWzvC,EAAY0vC,GAC9B,MAAMC,EAAgB,CACpBv6C,GAAI,MACJkW,MAAOtL,EAAW+nC,SAASz8B,OAGvB07B,EAAM,GAyEZ,OAvEAA,EAAI4I,QAAU5vC,EAAW+nC,SAAS8H,OAAS,QAE3C7I,EAAI8I,YAAcJ,EAChB1I,EAAI4I,QAAU,oBACdD,EACA,CACE3c,OAAQ,CACN+c,OAAQ,OACRv0C,IAAKwrC,EAAI4I,QAAU,4BAErBrD,QAAS,CACPwD,OAAQ,OACRv0C,IAAKwrC,EAAI4I,QAAU,6BAErBI,UAAW,CACTD,OAAQ,MACRv0C,IAAKwrC,EAAI4I,QAAU,8BAKzB5I,EAAI2D,gBAAkB+E,EACpB1I,EAAI4I,QAAU,wBACdD,EACA,CACExpC,OAAQ,CACN4pC,OAAQ,MACRv0C,IAAKwrC,EAAI4I,QAAU,yBAErBhF,aAAc,CACZmF,OAAQ,MACRv0C,IAAKwrC,EAAI4I,QAAU,uCAErBxF,MAAO,CACL2F,OAAQ,MACRv0C,IAAKwrC,EAAI4I,QAAU,+BAErB3E,YAAa,CACX8E,OAAQ,MACRv0C,IAAKwrC,EAAI4I,QAAU,wCAErBK,iBAAkB,CAChBF,OAAQ,OACRv0C,IAAKwrC,EAAI4I,QAAU,0CACnBl0C,QAAS,CACP,oBAAgBwC,GAElBgyC,iBAAkBtmD,QAAQ6c,UAE5B0pC,mBAAoB,CAClBJ,OAAQ,MACRv0C,IAAKwrC,EAAI4I,QAAU,6CAErBQ,QAAS,CACPL,OAAQ,MACRv0C,IAAKwrC,EAAI4I,QAAU,mCAKzB5I,EAAIqJ,YAAcX,EAChB1I,EAAI4I,QAAU,oBACdD,EACA,CACExpC,OAAQ,CACN4pC,OAAQ,MACRv0C,IAAKwrC,EAAI4I,QAAU,uBAKlB5I,mTChET,SAASsJ,EACPtlD,EACAgV,EACAzS,EACAgjD,EACAC,EACAhuC,EACApI,EACA2zC,EACA/G,EACAD,EACAG,EACAD,GAEA,MAAME,EAAKp9C,KACX,IAAI0mD,EACAC,EACAC,EACAC,EA4BJ,SAASC,IAEP//C,EAAAA,GAAAA,IAAO,CACLi2C,EAAqBkI,WAAW/H,GAC7BpyC,MAAK,IAAMyb,QAAQo3B,MAAM,6BACzBv7B,MAAM26B,EAAqBW,gBAC9BX,EAAqBkI,WAAWhI,GAC7BnyC,MAAK,IAAMyb,QAAQo3B,MAAM,4BACzBv7B,MAAM26B,EAAqBW,kBAC7B5yC,MAAK,KAhBJkL,EAAW+nC,SAAS2B,OACtBlnC,EAAOi5B,GAAG,aAAc,KAAM,CAAE77B,SAAU,YAE1C4C,EAAOi5B,GAAG,cAAe,KAAM,CAAE77B,SAAU,eAoB/C,SAASkxC,IACPvjD,GAAS,WACP,MAAMT,EAAU0jD,EAAU,GAAGO,uBAAuB,iBAAiB,GAEjEjkD,IACFA,EAAQkkD,UAAYlkD,EAAQmkD,iBAKlC,SAASC,IACP/J,EAAG6G,OAAS,GACZhuC,EAAWzJ,MAAM,QAEjB,MAAM03C,EAAQF,EACXG,SACAC,YACC,8CAEDE,WAAW,yBAA2BruC,EAAW+nC,SAASsE,cAC1DloC,OAAOva,QAAQkD,QAAQsjB,SAASk6B,cAAc,mBAEjDyD,EAASrD,KAAKuD,GAIhB,SAAS/d,EAAY3gC,GACnB,OAAO,SAAU0nB,GACfkwB,EAAG6G,OAAOz+C,GAAQ0nB,EAAIvlB,KAEtBo/C,KAIJ,SAASK,EAAYtjB,GACnBmZ,EAAI8I,YACD9c,OAAOnF,GACPkd,SAASj2C,MAAK,SAAUpD,GACvBy1C,EAAG6G,OAAS,GACZ,IAAIoD,GAAkB,EAClBpE,GAAAA,CAAOhtC,EAAW4nC,QAAQ4B,eAC5BxpC,EAAW4nC,QAAQ4B,YAAc,CAC/Bp0C,GAAI1D,EAAK83C,YAAYp0C,IAEvBg8C,GAAkB,GAEfpxC,EAAW4nC,QAAQyJ,qBACtBrxC,EAAW4nC,QAAQyJ,oBAAqB,EACxCD,GAAkB,GAGhBA,GACFrK,EAAqBO,cACnBJ,EACAlnC,EAAW4nC,SAEV9yC,MAAMvG,IACLyR,EAAW4nC,QAAUr5C,KAEtB6d,MAAM26B,EAAqBW,gBAEhC+I,EAAU,GAAGa,aAAaC,QAAQ,IAElCT,OAED1kC,MAAM8jB,EAAY,qBA0EvB,SAASshB,IAELxxC,EAAW4nC,SACX5nC,EAAW4nC,QAAQ4B,aACnBxpC,EAAW4nC,QAAQ4B,YAAYp0C,IAE/B4xC,EAAI2D,gBACDlwC,IAAI,CACHrF,GAAI4K,EAAW4nC,QAAQ4B,YAAYp0C,KAEpC21C,SAASj2C,MAAK,SAAUpD,UAChBy1C,EAAG6G,OAAOwD,eAGb9/C,EAAKm5C,SACP7qC,EAAW4nC,QAAQ4B,YAAYqB,QAAS,EACxC9D,EAAqBO,cACnBJ,EACAlnC,EAAW4nC,SAEV9yC,MAAMvG,IACLyR,EAAW4nC,QAAUr5C,KAEtB6d,MAAM26B,EAAqBW,gBAEL,cAArBh2C,EAAK+/C,YACPjvC,EAAOi5B,GAAG,gBAAiB,KAAM,CAAE77B,SAAU,YAE7C4C,EAAOi5B,GAAG,cAAe,KAAM,CAAE77B,SAAU,gBAIhDwM,OAAM,SAAU6K,GACf,OAAQA,EAAI4wB,QACV,KAAK,IACHrlC,EAAOi5B,GAAG,cAAe,KAAM,CAAE77B,SAAU,YAC3C,MACF,KAAK,IACHixC,IACA,MACF,KAAK,IACHruC,EAAOi5B,GAAG,gBAAiB,KAAM,CAAE77B,SAAU,YAC7C,MACF,QACE2Q,QAAQnhB,MAAM6nB,OAQ1B,SAASy6B,EAAM3M,GACb,MAAMkH,EAAOwE,EAAU,GAAGa,aAAaK,UAEnC5M,GAA6B,KAAnBA,EAAOH,SAAkBG,EAAO6M,UAK1C7M,GAA6B,KAAnBA,EAAOH,SAKR,KAATqH,GAKJkF,EACEhC,GAAAA,CACE,CACElD,KAAMA,GAERjsC,EAAW4nC,UAqCjB,SAASqD,IAAc,QACjBjrC,MAAAA,GAAJ,UAAIA,EAAY4nC,eAAhB,iBAAI,EAAqB4B,mBAAzB,OAAI,EAAkCp0C,IACpC4xC,EAAI2D,gBACDM,YAAY,CACXC,MAAOlrC,EAAW4nC,QAAQ4B,YAAYp0C,GACtCy8C,cAAc,EACdz8C,GAAIw7C,QAAiB1yC,IAEtB6sC,SAASj2C,MAAK,SAAUpD,GAIvB,UAHOy1C,EAAG6G,OAAOxE,YAGb93C,EAAKuC,MAAO,CACd,IAAI69C,GAAQ,EACR1qC,EAAI,EACR,IAAKA,EAAI,EAAG0qC,GAAQ,EAAO1qC,EAAI1V,EAAK25C,KAAKlyC,OAAQiO,IAAK,CACpD,MAAMrI,EAAIgzC,GAAAA,CAAM/xC,EAAWgyC,SAAU,CACnC58C,GAAI1D,EAAK25C,KAAKjkC,GAAGhS,KAEd2J,EAGMrN,EAAK25C,KAAKjkC,GAAGywB,OACtB94B,EAAE84B,MAAO,IAHTia,GAAQ,EACR9xC,EAAWgyC,SAASxnD,KAAKkH,EAAK25C,KAAKjkC,KAMN,QAA3B1V,EAAK25C,KAAKjkC,GAAGokC,WAAwB95C,EAAK25C,KAAKjkC,GAAGywB,OAtC3CziC,EAuCK1D,EAAK25C,KAAKjkC,GAAGhS,GAtChC4xC,EAAIqJ,YACRlqC,OAAO,CACN/Q,GAAIA,EACJyiC,MAAM,IAEPkT,SAAS3+B,OAAM,SAAU6K,GACxB1G,QAAQnhB,MAAM6nB,OAoCN66B,GAEFhB,IAGEp/C,EAAK25C,KAAKjkC,EAAI,GAAGywB,OACnB+Y,EAAgBl/C,EAAK25C,KAAKjkC,EAAI,GAAGhS,IAG/Bw7C,IAAkB5wC,EAAW4nC,QAAQyJ,oBACvCtK,EAAqBO,cAAcJ,EAAiB,IAC/ClnC,EAAW4nC,QACdyJ,oBAAoB,IACnBv8C,MAAMvG,IACPyR,EAAW4nC,QAAUr5C,KAzDnC,IAAuB6G,KA8DhBgX,OAAM,SAAU6K,GACf,OAAQA,EAAI4wB,QACV,KAAK,IACHrlC,EAAOi5B,GAAG,cAAe,KAAM,CAAE77B,SAAU,YAC3C,MACF,KAAK,IACH4C,EAAOi5B,GAAG,gBAAiB,KAAM,CAAE77B,SAAU,YAC7C,MACF,QACE2Q,QAAQnhB,MAAM6nB,OA7V1BkwB,EAAG6G,OAAS,GACZhuC,EAAWgyC,SAAW,GACtB7K,EAAG8K,aAAe,CAChBC,gBAAgB,EAChBC,YAAY,EACZC,OAAO,EACP9/C,MAAM,EACN+/C,WAAY,UAGdlL,EAAGmL,cAAgB,CACjBC,uBAAuB,GA6XzBpL,EAAG/vC,QArCH,WACEmZ,QAAQo3B,MAAM,mCAAoC3nC,EAAW4nC,SAC7D5nC,EAAW6nC,OAAS,OACpB7nC,EAAWwuC,SAAU,EACrBxuC,EAAW+nC,SAASyK,UAAW,EAE/BrL,EAAGsL,aAAe,GAGhBzyC,EAAW4nC,QAAQ4B,aACnBxpC,EAAW4nC,QAAQ4B,YAAYqB,OAG/BgG,KAGAW,IAGAd,EAAsBH,EAAUtF,EAAa,KAC7C0F,EAAyBJ,EAAUiB,EAAgB,MAGrDf,EAAYiC,EAAE,iBAAiBpB,aAAa,CAC1CqB,YAAa3yC,EAAW+nC,SAAS6K,oBAAsB,iBACvDxoD,OAAQ,CACNyoD,MAAO,SAAUC,EAAQ/N,GACvB2M,EAAM3M,IAERgO,MAAO,WACLhpD,KAAKipD,gBAQb7L,EAAGuK,MAAQA,EACXvK,EAAG8L,aAzIH,WACE,MAAMhH,EAAOwE,EAAU,GAAGa,aAAaK,UAG1B,KAAT1F,IAKJkF,EACEhC,GAAAA,CACE,CACElD,KAAMA,GAERjsC,EAAW4nC,UAIf6I,EAAU,GAAGa,aAAa0B,aAwH5B7L,EAAGx4C,UAjSH,SAAmB+C,GACjB,GAAIA,EAAKie,KA9GSujC,SAgHhB,YADAhC,IAIF,MAAMiC,EAAK,IAAIC,SAEfD,EAAG/uB,OAAO,OAAQ1yB,EAAK7B,MAEvBuK,EACGopC,KACCxjC,EAAW+nC,SAAS8H,OAClB,0BACA7vC,EAAW4nC,QAAQ4B,YAAYp0C,GAC/B,4BACA4K,EAAW+nC,SAASz8B,MACtB6nC,EACA,CACEjD,iBAAkBtmD,QAAQ6c,SAC1B/K,QAAS,CACP,oBAAgBwC,KAIrBpJ,MAAK,SAAUpD,IACdA,EAAOA,EAAKA,MAEH0D,IACP+xC,EAAG6G,OAAS,GAEZmD,EACEhC,GAAAA,CACE,CACElD,KACE,YACAjsC,EAAW+nC,SAAS8H,OACpB,0BACA7vC,EAAW4nC,QAAQ4B,YAAYp0C,GAC/B,iCACA1D,EAAK0D,GACL,UACA4K,EAAW+nC,SAASz8B,MACpB,qBACA5Z,EAAKnC,KACL,OACF8jD,aAAc3hD,EAAK0D,IAErB4K,EAAW4nC,WAIf1X,EAAY,oBAEbA,EAAY,oBA4OnBiX,EAAG+J,gBAAkBA,EAGrBlmD,EAAOsB,IAAI,YA5OX,WACEikD,EAAUriD,OAAOwiD,GACjBH,EAAUriD,OAAOyiD,GAEjBD,EAAsB,KACtBC,EAAyB,QAwO3B3wC,EAAW1T,IAAI,aArOf,SAAoBoF,EAAMnH,GACpBA,GACFA,EAAS+oD,GAAAA,CAAQtzC,EAAWgyC,sWCvMlC,SAASuB,EACPvoD,EACAgV,EACAwzC,EACAxM,EACA+G,EACAt8C,EACA2I,GAEA,MAAM+sC,EAAKp9C,KACX,IAAI0pD,EAAU,KACVC,EAAgB,KACpB1zC,EAAW2zC,UAAY,GAEvB,MAAMC,EAAkB,CACtBC,sBAAsB,EACtBC,mBAAmB,EACnB3+B,QAAS,SAAU5mB,GACjB,MAAqB,kBAAVA,GACDA,EAAQ,IAAM,IAEjBA,IA6GX,SAASwlD,WACA5M,EAAG6G,OAAOkB,OACjBlvC,EAAWzJ,MAAM,QAGjB4wC,EAAG6M,OAASC,GAAAA,CAAWP,GAEvBvM,EAAGuH,KAAO,GACVvH,EAAG0H,SAASC,eACZ3H,EAAG0H,SAASE,gBAEZ,MAAMd,EAAQF,EACXG,SACAC,YACCnuC,EAAW+nC,SAASuH,0BAClB,2BAEHjB,WAAW,oBACXlqC,OAAOva,QAAQkD,QAAQsjB,SAASk6B,cAAc,mBAEjDyD,EAASrD,KAAKuD,GA7HhB9G,EAAG+M,YAAc,SAAU5kD,GACzB,OAAOkkD,EAAKU,YAAY5kD,IA+Q1B63C,EAAGgN,iBArDH,SAA0BhO,GAExB,MAAMiO,EAAWjN,EAAG6M,OAAO7N,GACrBkO,EAAa5iD,EAASoZ,KAAK,gBACjC,GAAIwpC,EAAWl7C,OAAQ,CACrB,MAAMm7C,EAAS1qD,QAAQkD,QACrBunD,EAAW,GAAG/J,cAAc,mBAExB3tC,EAAQ/S,QAAQkD,QACpBunD,EAAW,GAAG/J,cAAc,qBAExBiK,EAAQD,EAAOzpC,KAAK,SAEtB0pC,EAAMp7C,QACRo7C,EAAMC,IAAI,UAAW,QAGvBF,EAAOjqD,GAAG,SAAS,KACjBkqD,EAAMC,IAAI,UAAW,QACI,mBAAlB73C,EAAM83C,QACT93C,EAAM83C,QAAQ,SACd93C,EAAM,GAAG+3C,WAGf/3C,EAAMtS,GAAG,UAAWgiB,IAClBrhB,EAAOgD,QAAO,WACwB,iBAAzBomD,EAASO,MAAMvlD,QACxBglD,EAASO,MAAMvlD,MAAQ,MAKzB,MAAMmB,EAAQ5E,MAAMstB,KAAK5M,EAAEjc,OAAOG,OAE5BqkD,EAjSL,QAiSiBR,EAAS9+C,OAAOqa,KACdpf,EAAMskD,MAAMhlD,GAASA,EAAK8f,MAAQilC,KAKpDR,EAASlqD,QAAU,GACnBkqD,EAASO,MAAMvlD,MAAQglD,EAAS9+C,OAAOw/C,gBAEvCV,EAASlqD,QAAUqG,EAAMmI,KAAK7I,IAC5B,MAAM,KAAEN,EAAF,KAAQogB,EAAR,KAAc1W,GAASpJ,EAC7B,MAAO,CAAEN,KAAAA,EAAMogB,KAAAA,EAAM1W,KAAAA,EAAMpJ,KAAAA,MAG/Bs3C,EAAGuH,KAAK0F,EAASO,MAAMzX,OAASkX,EAASlqD,gBAkBjDi9C,EAAG4N,eANH,SAAwBX,EAAUjO,GAGhCiO,EAASlqD,QAAQqf,OAAO48B,EAAO,GAC/BgB,EAAGuH,KAAK0F,EAASO,MAAMzX,OAASkX,EAASlqD,SAuB3Ci9C,EAAG6N,eAfH,SAAwBZ,GACtB7jC,QAAQN,IAAI,kBAAmBmkC,GAC/B,MAAMC,EAAa5iD,EAASoZ,KAAK,gBAC3BlO,EAAQ/S,QAAQkD,QACpBunD,EAAW,GAAG/J,cAAc,sBAExB,eAAE2K,EAAF,OAAkBrqC,GAAWwpC,EAAS9+C,OACxC2/C,GACFt4C,EAAME,KAAK,WAAY,YAErB+N,GACFjO,EAAM,GAAGu4C,aAAa,SAAUtqC,IAapCu8B,EAAGgO,uBAPH,WACE,MAAMC,EAAWzpD,MAAMstB,KAAKxnB,EAASoZ,KAAK,oBACpCwqC,EAAUD,EAASA,EAASj8C,OAAS,GACvCk8C,GAAWA,EAAQpuC,gBACrBouC,EAAQpuC,kBAMZkgC,EAAG/vC,QAjTH,WACEmZ,QAAQo3B,MAAM,sCAAuC3nC,EAAW4nC,SAChE5nC,EAAW6nC,OAAS,UAGpBV,EAAGS,QAAU,CACXxyC,GAAI4K,EAAW+nC,SAAS3yC,GACxBkgD,cAAe,YACfr8B,KAhBK,YAAcs8B,GAAAA,CAAQ,EAAG,MAmBhCv1C,EAAW+nC,SAASyK,UAAW,EAC/BxyC,EAAWwuC,SAAU,EAErBxH,EAAI8I,YACDE,UAAU,CACT56C,GAAI4K,EAAW+nC,SAAS3yC,GACxBs0C,QAAQ,IAETqB,SAASj2C,MAAK,SAAUpD,GACnBA,EAAKuC,QACPw/C,EAAU/hD,EAAK+hD,QACfC,EAAgBO,GAAAA,CAAWviD,EAAK25C,MAChClE,EAAG6M,OAASC,GAAAA,CAAWP,OAG1B5+C,MAAK,WACJ,IAAK,IAAIsS,EAAI,EAAGA,EAAI+/B,EAAG6M,OAAO76C,OAAQiO,IAAK,CACzC,MAAMouC,EAAQrO,EAAG6M,OAAO5sC,GAExB,GADApH,EAAW2zC,WAAa6B,EAAMv8C,UACH,IAAhBu8C,EAAMb,OACXa,EAAMb,MAAMc,SAAU,CACxB,MAAMC,EAASxiD,OAAOtH,UAAUshB,KAAK7f,KAAK,gBAC1C85C,EAAGwO,UAAUvuC,GAAKsuC,EAAOF,EAAMb,MAAMc,eAK5CrpC,OAAM,SAAU6K,GACf1G,QAAQnhB,MAAM6nB,OA2QpBkwB,EAAG+H,OA5LH,WAEElvC,EAAWwuC,SAAU,EAErB,MAAM98C,EAAO,IAAKy1C,EAAGuH,MAErB,IAAK,IAAItnC,EAAI,EAAGA,EAAI+/B,EAAG6M,OAAO76C,OAAQiO,IAAK,CACzC,MAAMouC,EAAQrO,EAAG6M,OAAO5sC,GACpBouC,EAAMb,YAA4C,IAA5BjjD,EAAK8jD,EAAMb,MAAMzX,SAEpC8P,GAAAA,CAAOwI,EAAMI,WAChBzO,EAAGS,QAAQ4N,EAAMI,SAAWjqD,MAAMoQ,QAAQrK,EAAK8jD,EAAMb,MAAMzX,QACvDxrC,EAAK8jD,EAAMb,MAAMzX,OAAOlgC,OACxBtL,EAAK8jD,EAAMb,MAAMzX,QAGnB91B,IAAMqsC,IACHzG,GAAAA,CAAOhtC,EAAW+nC,SAASuN,iBAC9BnO,EAAGS,QAAQ0N,cAAgBt1C,EAAW+nC,SAASuN,cAC/CnO,EAAGS,QAAQ3uB,KAAOttB,MAAMoQ,QAAQrK,EAAK8jD,EAAMb,MAAMzX,QAC7CxrC,EAAK8jD,EAAMb,MAAMzX,OAAOlgC,OACxBtL,EAAK8jD,EAAMb,MAAMzX,SAIN,WAAfsY,EAAMv8C,OACRvH,EAAK8jD,EAAMb,MAAMzX,OAASxrC,EAAK8jD,EAAMb,MAAMzX,OAAOxkC,KAC/C+U,GAASA,EAAK5d,SAMvB,MAAMgmD,EAAelqD,MAAMoQ,QAAQorC,EAAG6M,QAClC7M,EAAG6M,OAAO3gD,QAAQmiD,GAAyB,WAAfA,EAAMv8C,OAClC,GAEE68C,EAAU3G,GAAAA,CACd,CACElD,KAAMv6C,GAERy1C,EAAGS,SAGCmO,EAA4B,MAARrkD,GAAgBmkD,EAAa18C,OAAS,EAC1D68C,EAAyB,OAATtkD,GAA0C,OAAzBqW,KAAKE,UAAUvW,GAnFxD,IAAgBukD,EApCK1mD,GAwHGwmD,GApFRE,EAqFHH,EApFJ17C,EAAM,CACXoB,IAAM,GAAEwrC,EAAI4I,wBAAwBqG,EAAQ7gD,aAC5CsG,QAAS,CAAE,oBAAgBwC,GAC3BxM,KAAMwkD,GAAAA,CAAeD,EAAS,IACzBrC,EACHuC,gBAAiB,IAAI/C,WAEvBrD,OAAQ,UA8ENiG,EACAhP,EAAI8I,YAAYvD,QAAQuJ,GAAS/K,SACjC5M,QAAQC,OAAO,iBAGhBtpC,KAAKi/C,GACL3nC,OAhIgB7c,EAgIE,SAjHZ,SAAU0nB,GACf,MAAMg3B,EAAQF,EACXG,SACAC,YACCnuC,EAAW+nC,SAASqG,0BAClB,yBAEHC,WAAW,oBACXlqC,OAAOva,QAAQkD,QAAQsjB,SAASk6B,cAAc,mBAEjDyD,EAASrD,KAAKuD,GAEd9G,EAAG6G,OAAOz+C,GAAQ0nB,EAAIvlB,QAsGvB69C,SAAQ,KACFpI,EAAGuH,KAAKtgB,UACX+Y,EAAGuH,KAAO,IAlLhB1uC,EAAWwuC,SAAU,MAsTvBrH,EAAGC,OA9HH,SAAgB73C,EAAM2a,GACfi9B,EAAGuH,KAAKn/C,KACX43C,EAAGuH,KAAKn/C,GAAQ,IAGlB,MAAMyJ,EAAMmuC,EAAGuH,KAAKn/C,GAAM0I,QAAQiS,GAC9BlR,GAAO,EACTmuC,EAAGuH,KAAKn/C,GAAMga,OAAOvQ,EAAK,GAE1BmuC,EAAGuH,KAAKn/C,GAAM/E,KAAK0f,IAsHvBi9B,EAAGhd,OAlHH,SAAgB56B,EAAM2a,GAKpB,OAJKi9B,EAAGuH,KAAKn/C,KACX43C,EAAGuH,KAAKn/C,GAAQ,IAGX43C,EAAGuH,KAAKn/C,GAAM0I,QAAQiS,IAAS,GA8GxCi9B,EAAGwO,UAAY,GAEfxO,EAAGuH,KAAO,GACVvH,EAAG6G,OAAS,GACZ7G,EAAG0H,SAAW,GCnWhB,SAASuH,EACPp2C,EACAwC,EACAgxC,EACAxM,EACAD,EACAG,GAEA,MAAMC,EAAKp9C,KACX,IAAI0pD,EAAU,KAmJd,SAAS4C,IASP,OARAr2C,EAAW4nC,QAAU,CACnBxyC,GAAI4K,EAAW+nC,SAAS3yC,GACxBkhD,OAAQ,YACRr9B,KAhCK,YAAcs8B,GAAAA,CAAQ,EAAG,MAmChCv1C,EAAW+nC,SAASyK,UAAW,EAExBzL,EAAqBO,cAC1BJ,EACAlnC,EAAW4nC,SAEV9yC,MAAMvG,IACLyR,EAAW4nC,QAAUr5C,EACdy4C,EAAI8I,YACRE,UAAU,CACT56C,GAAI4K,EAAW+nC,SAAS3yC,GACxBs0C,QAAQ,IAETqB,SAASj2C,MAAK,SAAUpD,GACnBA,EAAKuC,QACPw/C,EAAU/hD,EAAK+hD,QACftM,EAAG6M,OAAStiD,EAAK25C,SAGpBv2C,MAAK,WACJ,IAAK,IAAIsS,EAAI,EAAGA,EAAI+/B,EAAG6M,OAAO76C,OAAQiO,IAAK,CACzC,MAAMouC,EAAQrO,EAAG6M,OAAO5sC,GACxB,GAAIouC,EAAMb,MAAMc,SAAU,CACxB,MAAMC,EAASxiD,OAAOtH,UAAUshB,KAAK7f,KAAK,gBAC1C85C,EAAGwO,UAAUvuC,GAAKsuC,EAAOF,EAAMb,MAAMc,eAI1CrpC,OAAM,SAAU6K,GACf1G,QAAQnhB,MAAM6nB,SAGnB7K,MAAM26B,EAAqBW,gBAzLhCP,EAAGwO,UAAY,GAGfxO,EAAGuH,KAAO,GACVvH,EAAG6G,OAAS,GACZ7G,EAAG0H,SAAW,GACd1H,EAAGoP,aAAc,EAEjBpP,EAAG+M,YAAc,SAAU5kD,GACzB,OAAOkkD,EAAKU,YAAY5kD,IAmO1B63C,EAAG/vC,QAhDH,WAKE,GAJAmZ,QAAQo3B,MAAM,qCAAsC3nC,EAAW4nC,SAE/D5nC,EAAW6nC,OAAS,SAEhB7nC,EAAW4nC,SAAW5nC,EAAW4nC,QAAQ4B,YAC3C,GAAIxpC,EAAW4nC,QAAQ4B,YAAYp0C,GACjC,IAA8C,IAA1C4K,EAAW4nC,QAAQyJ,mBAErB7uC,EAAOi5B,GAAG,WAAY,KAAM,CAC1B77B,SAAU,gBAEP,SACL,MAAM42C,EAAoBx2C,EAAW4nC,QAAQ4B,YAAYp0C,GACnDqhD,EAAYz2C,MAAAA,GAAH,UAAGA,EAAY4nC,eAAf,iBAAG,EAAqB/Z,eAAxB,aAAG,EAA8Bz4B,GAChD,GAAIqhD,EAAW,CACb,MAAM/kD,EAAO,CACX0D,GAAIohD,EACJE,QAAS,OACTlN,YAAa,CACXp0C,GAAIohD,GAEN3oB,QAAS,CACPz4B,GAAIqhD,GAENhF,YAAa,YACb5G,QAAQ,EACRC,YAAa,WAIf9D,EAAI2D,gBAAgByF,QAAQ1+C,GAAMq5C,SAASwE,SAAQ,IAC1C8G,YAMb7zC,EAAOi5B,GAAG,cAAe,KAAM,CAC7B77B,SAAU,iBAIdy2C,KAMJlP,EAAG+H,OA5KH,WACE,IAAIjD,EAAO,sBAEX,IAAK,IAAI7kC,EAAI,EAAGA,EAAI+/B,EAAG6M,OAAO76C,OAAQiO,IAAK,CACzC,MAAMouC,EAAQrO,EAAG6M,OAAO5sC,GAEpBouC,EAAMb,YAA+C,IAA/BxN,EAAGuH,KAAK8G,EAAMb,MAAMzX,SAEvC8P,GAAAA,CAAOwI,EAAMmB,YAChB32C,EAAW4nC,QAAQ4N,EAAMmB,UAAYhrD,MAAMoQ,QACzCorC,EAAGuH,KAAK8G,EAAMb,MAAMzX,QAElBiK,EAAGuH,KAAK8G,EAAMb,MAAMzX,OAAOlgC,OAC3BmqC,EAAGuH,KAAK8G,EAAMb,MAAMzX,QAGrB8P,GAAAA,CAAOwI,EAAMI,WAChB51C,EAAW4nC,QAAQ4N,EAAMI,SAAWjqD,MAAMoQ,QACxCorC,EAAGuH,KAAK8G,EAAMb,MAAMzX,QAElBiK,EAAGuH,KAAK8G,EAAMb,MAAMzX,OAAOlgC,OAC3BmqC,EAAGuH,KAAK8G,EAAMb,MAAMzX,QAGtB91B,IAAMqsC,IACHzG,GAAAA,CAAOhtC,EAAW+nC,SAASuO,UAC9Bt2C,EAAW4nC,QAAQ0O,OAASt2C,EAAW+nC,SAASuO,OAChDt2C,EAAW4nC,QAAQ3uB,KAAOttB,MAAMoQ,QAAQorC,EAAGuH,KAAK8G,EAAMb,MAAMzX,QACxDiK,EAAGuH,KAAK8G,EAAMb,MAAMzX,OAAOlgC,OAC3BmqC,EAAGuH,KAAK8G,EAAMb,MAAMzX,SAIxBiK,EAAGuH,KAAK8G,EAAMb,MAAMzX,SACtB+O,GAAQuJ,EAAMb,MAAMzX,MAAQ,KAAOiK,EAAGuH,KAAK8G,EAAMb,MAAMzX,OAAS,OAvExE,IAAqBrP,EAAAA,EA8EjBshB,GAAAA,CACE,CACElD,KAAMA,EACN2K,QAAS52C,EAAW+nC,SAAS6O,QAC7BC,WAAY72C,EAAW+nC,SAAS8O,YAElC72C,EAAW4nC,SAnFfT,EAAGoP,aAAc,EAEjBvP,EAAI8I,YACD9c,OAAOnF,GACPkd,SAASj2C,MAAK,SAAUpD,UAChBy1C,EAAG6G,OAAO8I,iBAEjB92C,EAAW4nC,QAAQ/Z,QAAU,CAC3Bz4B,GAAI1D,EAAKm8B,QAAQz4B,IAGnB4K,EAAW4nC,QAAQ4B,YAAc,CAC/Bp0C,GAAI1D,EAAK83C,YAAYp0C,IAIvB2xC,EAAqBO,cAAcJ,EAAiBlnC,EAAW4nC,SAC5D9yC,MAAMvG,IACLyR,EAAW4nC,QAAUr5C,KAEtB6d,MAAM26B,EAAqBW,gBAG9BP,EAAGoP,aAAc,EArChBv2C,EAAW+nC,SAASgP,sBAOvBv0C,EAAOi5B,GAAG,WAAY,KAAM,CAC1B77B,SAAU,YANZ4C,EAAOi5B,GAAG,cAAe,KAAM,CAC7B77B,SAAU,eAuCXwM,OAAM,SAAU6K,GAEfkwB,EAAGoP,aAAc,EAEjBhmC,QAAQnhB,MAAM6nB,OAiLpBkwB,EAAGC,OArHH,SAAgB73C,EAAM2a,GACfi9B,EAAGuH,KAAKn/C,KACX43C,EAAGuH,KAAKn/C,GAAQ,IAGlB,MAAMyJ,EAAMmuC,EAAGuH,KAAKn/C,GAAM0I,QAAQiS,GAC9BlR,GAAO,EACTmuC,EAAGuH,KAAKn/C,GAAMga,OAAOvQ,EAAK,GAE1BmuC,EAAGuH,KAAKn/C,GAAM/E,KAAK0f,IA6GvBi9B,EAAGhd,OAzGH,SAAgB56B,EAAM2a,GAKpB,OAJKi9B,EAAGuH,KAAKn/C,KACX43C,EAAGuH,KAAKn/C,GAAQ,IAGX43C,EAAGuH,KAAKn/C,GAAM0I,QAAQiS,IAAS,GCxJ1C,SAAS8sC,EACPh3C,EACAwC,EACAurC,EACA/G,EACAl2C,EACAi2C,EACAG,EACAD,GAEA,MAAME,EAAKp9C,KAQX,SAAS0kD,IACHzuC,EAAW+nC,SAAS2B,OACtBlnC,EAAOi5B,GAAG,aAAc,KAAM,CAAE77B,SAAU,YAE1C4C,EAAOi5B,GAAG,cAAe,KAAM,CAAE77B,SAAU,YAI/C,SAAS4lC,IACP2B,EAAGuH,KAAO,GACVvH,EAAGwH,QAAU,KACbxH,EAAGyH,UAAY,KACfzH,EAAG0H,SAASC,eACZ3H,EAAG0H,SAASE,gBAEZ/uC,EAAW4nC,QAAU,GAErB5nC,EAAWgvC,gBAAiB,EAC5BhvC,EAAWzJ,MAAM,QAQnB,SAAS25B,EAAY3gC,GACnB,OAAO,SAAU0nB,GACfkwB,EAAG6G,OAAOz+C,GAAQ0nB,EAAIvlB,KAEtB,MAAMu8C,EAAQF,EACXG,SACAC,YACCnuC,EAAW+nC,SAASqG,0BAClB,yBAEHC,WAAW,oBACXlqC,OAAOva,QAAQkD,QAAQsjB,SAASk6B,cAAc,mBAEjDyD,EAASrD,KAAKuD,IAIlB,SAASM,IACPvuC,EAAWwuC,SAAU,EAjDvBrH,EAAGuH,KAAO,GACVvH,EAAG6G,OAAS,GAoGZ7G,EAAG/vC,QAhBH,WACEmZ,QAAQo3B,MAAM,wCAAyC3nC,EAAW4nC,SAClE5nC,EAAW6nC,OAAS,YAGpB/2C,EAAG0U,IAAI,CACLuhC,EAAqBkI,WAAW/H,GAC7BpyC,MAAK,IAAMyb,QAAQo3B,MAAM,6BACzBv7B,MAAM26B,EAAqBW,gBAC9BX,EAAqBkI,WAAWhI,GAC7BnyC,MAAK,IAAMyb,QAAQo3B,MAAM,4BACzBv7B,MAAM26B,EAAqBW,kBAC7B5yC,MAAK,IAAOkL,EAAWwuC,SAAU,KAKtCrH,EAAG+H,OAlDH,WACElvC,EAAWwuC,SAAU,EAEjBxuC,EAAW4nC,QAAQ4B,aAAexpC,EAAW4nC,QAAQ4B,YAAYp0C,GACnE4xC,EAAI2D,gBACDC,aAAa,CACZx1C,GAAI4K,EAAW4nC,QAAQ4B,YAAYp0C,GACnC6hD,KAAM9P,EAAGuH,KAAKuI,OAEflM,SAASj2C,MAAK,kBACNqyC,EAAG6G,OAAOkB,OAEjB,MAAMjB,EAAQF,EACXG,SACAC,YACCnuC,EAAW+nC,SAASuH,0BAClB,2BAEHjB,WAAW,oBACXlqC,OAAOva,QAAQkD,QAAQsjB,SAASk6B,cAAc,mBAEjDyD,EAASrD,KAAKuD,MAEfn5C,KAAK0wC,GACL1wC,KAAK25C,GACLriC,MAAM8jB,EAAY,WAClBqf,QAAQhB,IAEXA,IACAre,EAAY,YAsBhBiX,EAAGqI,KA7EH,WACEhK,IACAiJ,KCxCJ,SAASyI,EACPl3C,EACAhV,EACAulD,EACA/tC,EACAwkC,EACAD,EACAG,GAGA,IAAIiQ,EAA+B,KAGnC,SAAS3F,IACP,IAAIhI,EAAc,GACd4N,GAAO,EAEXpQ,EAAI2D,gBACDlwC,IAAI,CACHrF,GAAI4K,EAAW4nC,QAAQ4B,YAAYp0C,KAEpC21C,SAASj2C,MAAK,SAAUpD,GAGvB,OAFA83C,EAAc93C,EAEPs1C,EAAI2D,gBAAgBM,YAAY,CACrCC,MAAOlrC,EAAW4nC,QAAQ4B,YAAYp0C,KACrC21C,YAEJj2C,MAAK,SAAUpD,GACd0lD,EAAO1lD,EAAK25C,KAAKlyC,OAAS,EAEtBqwC,EAAYqB,QACd7qC,EAAW4nC,QAAQ4B,YAAYqB,QAAS,EACxC9D,EAAqBO,cACnBJ,EACAlnC,EAAW4nC,SAEV9yC,MAAMvG,IACLyR,EAAW4nC,QAAUr5C,EACW,cAA5Bi7C,EAAYiI,aACdjvC,EAAOi5B,GAAG,gBAAiB,KAAM,CAAE77B,SAAU,eAGhDwM,MAAM26B,EAAqBW,kBACrB8B,EAAYoC,QAAUwL,KAE3B5N,EAAYoC,SACd5rC,EAAW4nC,QAAQ4B,YAAYoC,OAASpC,EAAYoC,QAEtD7E,EAAqBO,cAAcJ,EAAiB,IAC/ClnC,EAAW4nC,QACdyJ,oBAAoB,IAEnBv8C,MAAMvG,IACLyR,EAAW4nC,QAAUr5C,EACrBiU,EAAOi5B,GAAG,WAAY,KAAM,CAAE77B,SAAU,eAEzCwM,MAAM26B,EAAqBW,oBAKjCt7B,OAAM,SAAU6K,GACf,OAAQA,EAAI4wB,QACV,KAAK,IACHrlC,EAAOi5B,GAAG,cAAe,KAAM,CAAE77B,SAAU,YAC3C,MACF,KAAK,IACH4C,EAAOi5B,GAAG,gBAAiB,KAAM,CAAE77B,SAAU,YAC7C,MACF,QACE2Q,QAAQnhB,MAAM6nB,OA9DbltB,KAqFRqN,QAdH,WACEmZ,QAAQo3B,MAAM,sCAAuC3nC,EAAW4nC,SAChE5nC,EAAW6nC,OAAS,UAGlB7nC,EAAW4nC,SACX5nC,EAAW4nC,QAAQ4B,aACnBxpC,EAAW4nC,QAAQ4B,YAAYp0C,KAG/B+hD,EAA+B5G,EAAUiB,EAAgB,OAQ7DxmD,EAAOsB,IAAI,YAtBX,WACEikD,EAAUriD,OAAOipD,iqBCzFrB,MAAMpQ,EAOJ54B,YAAYxO,EAASK,EAAYlP,GAAI,oBACnC/G,KAAKstD,cAAgB,IAAIC,IAAIt3C,EAAW+nC,SAASwP,SAASC,OAC1DztD,KAAK6V,SAAWI,EAAW+nC,SAASnoC,SACpC7V,KAAK+G,GAAKA,EACV/G,KAAK4V,QAAUA,EA4CjB83C,QAAQ7nD,EAAKrB,GACX,MAAMmpD,EAAS,UACf,OAAO3tD,KAAK+G,IAAI4F,IACd,EAAA3M,KAAA,UAAAA,KAAwB2tD,EAAQ9nD,GAAK,KACnC8G,OAEF3M,KAAK4V,QAAQwE,OAAOsjC,YAClB,CAAEiQ,OAAAA,EAAQ9nD,IAAAA,EAAKrB,MAAAA,GACfxE,KAAKstD,kBASXjO,QAAQx5C,GACN,MAAM8nD,EAAS,UACf,OAAO3tD,KAAK+G,IAAI4F,IACd,EAAA3M,KAAA,UAAAA,KAAwB2tD,EAAQ9nD,GAAK,CAAC2X,EAAG2C,KACvCxT,EAAQwT,MAEVngB,KAAK4V,QAAQwE,OAAOsjC,YAAY,CAAEiQ,OAAAA,EAAQ9nD,IAAAA,GAAO7F,KAAKstD,kBAQ1DpI,WAAWr/C,GACT,MAAM8nD,EAAS,aACf,OAAO3tD,KAAK+G,IAAI4F,IACd,EAAA3M,KAAA,UAAAA,KAAwB2tD,EAAQ9nD,GAAK,KACnC8G,OAEF3M,KAAK4V,QAAQwE,OAAOsjC,YAAY,CAAEiQ,OAAAA,EAAQ9nD,IAAAA,GAAO7F,KAAKstD,kBAuB1D/P,cAAc13C,EAAK8B,GAAsB,IAAhBkF,EAAgB,wDAEvC,OAAO7M,KAAKq/C,QAAQx5C,GAAKkF,MAAMoV,IAC7B,MAAMytC,EAAU,EAAA5tD,KAAA,UAAAA,KAAgBmgB,IAAS,GAMzC,OALItT,SACK+gD,EAAQ5tD,KAAK6V,UAEpB+3C,EAAQ5tD,KAAK6V,UAAYlO,EAEpB3H,KAAK0tD,QAAQ7nD,EAAK+nD,GAAS7iD,MAAK,IAAM6iD,EAAQ5tD,KAAK6V,eAQ9D8nC,eAAezwB,GACb1G,QAAQnhB,MAAM,gBAAiB6nB,eAnHdygC,EAAQ9nD,EAAKrF,GAE9B,MAAM29B,EAAY7b,IAChB,MAAMurC,EAAkB,GAAEF,UAC1B,GACErrC,EAAEmrC,SAAWztD,KAAKstD,eAClBznD,IAAQyc,EAAE3a,KAAK9B,KACfgoD,IAAmBvrC,EAAE3a,KAAKgmD,OAC1B,CACA,MAAM,OAAEA,EAAF,KAAUxtC,GAASmC,EAAE3a,KAE3B,OADA6e,QAAQo3B,MAAO,UAAS/3C,cAAgB8nD,uBAA6BrrC,GAC7DqrC,GACN,IAAK,gBACHntD,EAASqF,GACT,MACF,IAAK,gBACHrF,EAASqF,EAAKsa,GACd,MACF,IAAK,mBACH3f,EAASqF,GACT,MACF,QACE2gB,QAAQo3B,MAAM,qBAAsB+P,GAIxC3tD,KAAK4V,QAAQk4C,oBAAoB,UAAW3vB,GAAU,KAG1Dn+B,KAAK4V,QAAQgtC,iBAAiB,UAAWzkB,GAAU,cAiD1C4vB,GACT,IAAI/zB,EAAS+zB,EACb,GAAsB,iBAAX/zB,EACT,IACEA,EAAShc,KAAK/W,MAAM8mD,GACpB,MAAO1oD,GACPmhB,QAAQwnC,KAAM,oBAAmBD,KAAe1oD,GAChD20B,EAAS+zB,EAGb,OAAO/zB,EC3EX,SAASi0B,EAAgBxE,GACvB,OAAO,SAAUjlD,GACf,OAAOilD,EAAKU,YAAY3lD,+DAqI5B3E,QACGC,OAFiB,cAEG,CACnB,YACA,SACA,aACA,aACA,aACA,aACA,QACA,UACA,YACA,qBACA,WACA,SAEDwJ,OAAO,YAAa2kD,GACpBC,SAAS,iBAAkB,eAC3BA,SAAS,kBAAmB,WAC5BA,SAAS,iBAAkB,UAC3Bz2C,QAAQ,uBAAwBulC,GAChCn6C,UAAU,WAnCb,WACE,OAAO,SAAUC,EAAOC,EAASC,GAC/BD,EAAQO,KAAK,oBAAoB,SAAU/C,GACrB,KAAhBA,EAAMu6C,QACRh4C,EAAMmB,QAAO,WACXnB,EAAMzB,MAAM2B,EAAMmrD,YAEpB5tD,EAAMgD,yBA6BXV,UAAU,WArJb,WA0GE,MAAO,CACL0F,KAVF,SAAczF,EAAOC,GACnBA,EAAQzC,GAAG,SAAS,WACE+lB,SAAS+nC,eAAe,iBAlGhD,SAAsBltC,EAAMpe,GAE1B,MAAMurD,EAAMhoC,SAAS45B,cAAc,OAC7BpC,EAAU/6C,EAAM+6C,QAChBG,EAAWl7C,EAAMk7C,SACvB,IAAIsQ,EAEJ,IAAK,IAAIjxC,EAAI,EAAGA,EAAIva,EAAMmlD,SAAS74C,OAAQiO,IAAK,CAC9C,MAAMymB,EAAUhhC,EAAMmlD,SAAS5qC,GAC/B,IAAImkC,EAAS,WACb,MAAMU,EAAO,YAAcpe,EAAQoe,KAC7BqM,EACJ,YAAcnM,GAAAA,CAAOte,EAAQqe,WAAWv6B,OAAO,uBAEjD,GAAU,IAANvK,EAAJ,CAKA,OAAQva,EAAMk7C,SAAS4D,iBACrB,IAAK,gBACHJ,GACwB,QAAtB1d,EAAQ2d,UACJ3d,EAAQ+d,OACN7D,EAAS8D,WAAahe,EAAQ+d,OAC9B,SACF7D,EAAS0D,eACT7D,EAAQ3uB,MACR,UAAY4U,EAAQ6d,UAC1B,MAEF,IAAK,cACHH,GACwB,QAAtB1d,EAAQ2d,UACJ3d,EAAQ+d,OACN/d,EAAQie,KAAKC,OAASle,EAAQie,KAAKE,SACnC,SACFjE,EAAS0D,eACT7D,EAAQ3uB,MACR,UAAY4U,EAAQ6d,UAC1B,MAEF,IAAK,iBACHH,GACwB,QAAtB1d,EAAQ2d,UACJ3d,EAAQ+d,OACN/d,EAAQie,KAAKE,SACb,SACFjE,EAAS0D,eACT7D,EAAQ3uB,MACR,UAAY4U,EAAQ6d,UAC1B,MAEF,QACEH,GACwB,QAAtB1d,EAAQ2d,UACJ3d,EAAQ+d,QACL7D,EAAS8D,YAAc,SAAWhe,EAAQ+d,OAC3C,SACF7D,EAAS0D,eACT7D,EAAQ3uB,MACR,UAAY4U,EAAQ6d,UAG9B0M,EAAInO,YAAY75B,SAASmoC,eAAehN,IACxC6M,EAAInO,YAAY75B,SAAS45B,cAAc,OACvCoO,EAAInO,YAAY75B,SAASmoC,eAAetM,IACxCmM,EAAInO,YAAY75B,SAAS45B,cAAc,OACvCoO,EAAInO,YAAY75B,SAASmoC,eAAeD,IACxCF,EAAInO,YAAY75B,SAAS45B,cAAc,OACvCoO,EAAInO,YAAY75B,SAAS45B,cAAc,YAvDrCqO,EAAYxqB,EAAQqe,UA0DxB,MAAMsM,EAAWloC,OAAO8mC,OAExBoB,EAASpoC,SAASqoC,MAAM,sBAAwBroC,SAAS8sB,MAAQ,YACjEsb,EAASpoC,SAASqoC,MAAM,kBACxBD,EAASpoC,SAASqoC,MAAM,iBAAmB1Q,EAAS6O,QAAU,SAC9D4B,EAASpoC,SAASqoC,MAChB,oBACEtM,GAAAA,CAAOkM,GAAW1mC,OAAO,uBACzB,SAEJ6mC,EAASpoC,SAASqoC,MAChB,oBAAsBtM,GAAAA,GAASx6B,OAAO,uBAAyB,SAEjE6mC,EAASpoC,SAASqoC,MAAML,EAAIM,WAC5BF,EAASpoC,SAASqoC,MAAM,kBAExBD,EAASpoC,SAASg6B,QAClBoO,EAASG,QAETH,EAASI,QACTJ,EAASpO,QAOLyO,CAAaC,EAAajsD,OAO9BqE,SAAU,QA2CXnG,WAAW,iBAAkBulD,GAE7BvlD,WAAW,oBAAqB+iD,GAEhCx4C,OA3BH,sBA2BU,SAAUyjD,GAChBA,EAAmBC,qBAEpBjuD,WAAW,kBAAmB87C,GAE9B58C,QAAQ,MAAOwlD,GAEfn6C,OAAO23C,GACP3qC,IAAIsqC,GAEJ7hD,WAAW,oBAAqBwoD,GAEhCj+C,OAvCH,sBAuCU,SAAUyjD,GAChBA,EAAmBC,qBAEpBjuD,WAAW,mBAAoBqrD,GAE/BrrD,WAAW,sBAAuBisD,GAElCjsD,WAAW,oBAAqBmsD,wFCjNnCrtD,EAAOovD,QAAU,WACf,GAA0B,iBAAfC,WACT,OAAOA,WAGT,IAAItxC,EAEJ,IAGEA,EAAI7d,MAAQ,IAAI0mB,SAAS,cAAb,GACZ,MAAOpE,GAEP,GAAsB,iBAAXiE,OACT,OAAOA,OAIT,GAAoB,iBAAT7Y,KACT,OAAOA,KAIT,QAAsB,IAAX,EAAAmQ,EACT,OAAO,EAAAA,EAIX,OAAOA,EA5BQ,wECHjB,WAoBE7d,QAjBM4d,EAAO,SAON,KAFU,EAAF,WACL,OAAQA,EAAKuuC,eAWjB,WAWJ,SAASn6C,EAAQhO,GAEb,MAAmC,mBAA5B,GAAK8Q,SAAS/S,KAAKiC,GAG9B,SAASorD,EAAaprD,GAElB,QAAQgO,EAAQhO,IAAuB,iBAARA,IAAsBA,GAASA,aAAeqrD,MAAWrrD,aAAeuuB,MAQ3G,SAAS+8B,IAEL,MAA2B,mBAAbjG,SAGlB,SAASkG,IAEL,GAAID,IACA,OAAO,IAAIjG,SAkCnB,SAASmG,EAAmBC,EAAYtvD,EAASuvD,EAAUC,GAEvD,IAAIvT,EAAQ,EAEZ,IAAK,IAAIv2C,KAAO4pD,EAAY,CAExB,GAAIA,EAAW/sD,eAAemD,GAAM,CAEhC,IAAI+pD,EAAWD,GAAa9pD,EACxBrB,EAAQrE,EAAQirB,QAAQqkC,EAAW5pD,IAevC,GAbI8pD,GAAaP,EAAaK,KAC1BG,EAAWD,EAAY,IAAM9pD,EAAM,KAGnC8pD,GAAa39C,EAAQy9C,KAGjBG,EADA59C,EAAQxN,IAAUrE,EAAQ2pD,qBACf6F,EAAY,IAAMvT,EAAQ,IAE1BuT,EAAY,MAI3B39C,EAAQxN,IAAU4qD,EAAa5qD,GAE/BgrD,EAAmBhrD,EAAOrE,EAASuvD,EAAUE,QAE1C,GAAIprD,aAAiBqrD,SAExB,IAAK,IAAInyC,EAAI,EAAGA,EAAIlZ,EAAM4K,OAAQsO,IAC9BgyC,EAASr1B,OAAOu1B,EAAW,IAAMlyC,EAAI,IAAKlZ,EAAM2b,KAAKzC,SAElDlZ,aAAiB6qD,KAExBK,EAASr1B,OAAOu1B,EAAUprD,EAAOA,EAAMgB,MAEhChB,aAAiB+tB,KAExBm9B,EAASr1B,OAAOu1B,EAAUprD,EAAMsrD,gBAEb,OAAVtrD,GAAkBrE,EAAQ4pD,mBAAgC,OAAVvlD,SAA6B2P,IAAV3P,GAE5EkrD,EAASr1B,OAAOu1B,EAAUprD,GAGlC43C,IAEJ,OAAOsT,EAEX,OAhFA,SAAiBD,EAAYtvD,GAEzB,GAAIA,GAAWA,EAAQisD,iBAEnB,GAnB8B,mBAmBDjsD,EAAQisD,gBAnBlB/xB,OAqBf,KAAM,qDAEP,IAAKi1B,IAER,KAAM,8FA3Bd,IA0CQS,EA5DG,CAgDc,CACjB3D,gBAAiBmD,IACjBzF,sBAAsB,EACtBC,mBAAmB,EACnB3+B,QAAS,SAAS5mB,GACd,MAAqB,kBAAVA,GACCA,EAAQ,IAAK,IAElBA,IAIkCrE,GAAW,IA5DlCyO,QAAO,SAAUohD,EAAOC,GAI9C,OAHA18C,OAAOC,KAAKy8C,GAAelvD,SAAQ,SAAUmvD,GACzCF,EAAME,GAAaD,EAAcC,MAE9BF,IACR,IAyDH,OAAOR,EAAmBC,EAAYM,EAAeA,EAAc3D,kBA5EjClsD,IACjC,QAFM,OAEN,oECDD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,8FAA8FttC,MAClG,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,4DAA4DxtC,MAClE,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1C2tC,cAAe,SACfC,KAAM,SAAU99C,GACZ,MAAO,QAAQuQ,KAAKvQ,IAExB+9C,SAAU,SAAUC,EAAOC,EAASC,GAChC,OAAIF,EAAQ,GACDE,EAAU,KAAO,KAEjBA,EAAU,KAAO,MAGhCC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,iBACTC,QAAS,eACTC,SAAU,eACVC,QAAS,iBACTC,SAAU,sBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,YACN30C,EAAG,mBACH40C,GAAI,cACJh9C,EAAG,YACHi9C,GAAI,YACJC,EAAG,SACHC,GAAI,SACJh5B,EAAG,SACHi5B,GAAI,SACJC,EAAG,WACHC,GAAI,YACJC,EAAG,UACHC,GAAI,WAERC,uBAAwB,kBACxBC,QAAS,SAAUC,GACf,OACIA,GACY,IAAXA,GAA2B,IAAXA,GAAgBA,GAAU,GAAK,MAAQ,OAGhEC,KAAM,CACFC,IAAK,EACLC,IAAK,KArEyB5yD,CAAQ,EAAQ,8FCOlD,SAAWkiD,GAAU,aAIzB,IAAI2Q,EAAa,SAAUxyC,GACnB,OAAa,IAANA,EACD,EACM,IAANA,EACA,EACM,IAANA,EACA,EACAA,EAAI,KAAO,GAAKA,EAAI,KAAO,GAC3B,EACAA,EAAI,KAAO,GACX,EACA,GAEVyyC,EAAU,CACN51C,EAAG,CACC,eACA,cACA,CAAC,UAAW,WACZ,UACA,WACA,YAEJpI,EAAG,CACC,eACA,cACA,CAAC,UAAW,WACZ,WACA,WACA,YAEJk9C,EAAG,CACC,cACA,aACA,CAAC,SAAU,UACX,WACA,UACA,WAEJ/4B,EAAG,CACC,aACA,WACA,CAAC,QAAS,SACV,UACA,WACA,UAEJk5B,EAAG,CACC,aACA,WACA,CAAC,QAAS,SACV,UACA,UACA,UAEJE,EAAG,CACC,aACA,WACA,CAAC,QAAS,SACV,WACA,WACA,WAGRU,EAAY,SAAUC,GAClB,OAAO,SAAUP,EAAQQ,EAAe5tD,EAAQ6tD,GAC5C,IAAIC,EAAIN,EAAWJ,GACf3hD,EAAMgiD,EAAQE,GAAGH,EAAWJ,IAIhC,OAHU,IAANU,IACAriD,EAAMA,EAAImiD,EAAgB,EAAI,IAE3BniD,EAAI+D,QAAQ,MAAO49C,KAGlCvC,EAAS,CACL,QACA,QACA,OACA,QACA,MACA,OACA,SACA,MACA,SACA,SACA,SACA,UAGGhO,EAAO+N,aAAa,QAAS,CACpCC,OAAQA,EACRC,YAAaD,EACbE,SAAU,sDAAsDxtC,MAAM,KACtEytC,cAAe,wCAAwCztC,MAAM,KAC7D0tC,YAAa,gBAAgB1tC,MAAM,KACnCwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVZ,cAAe,MACfC,KAAM,SAAU99C,GACZ,MAAO,MAAQA,GAEnB+9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,GACA,IAEA,KAGfjC,SAAU,CACNC,QAAS,wBACTC,QAAS,uBACTC,SAAU,uBACVC,QAAS,sBACTC,SAAU,uBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,SACN30C,EAAG61C,EAAU,KACbjB,GAAIiB,EAAU,KACdj+C,EAAGi+C,EAAU,KACbhB,GAAIgB,EAAU,KACdf,EAAGe,EAAU,KACbd,GAAIc,EAAU,KACd95B,EAAG85B,EAAU,KACbb,GAAIa,EAAU,KACdZ,EAAGY,EAAU,KACbX,GAAIW,EAAU,KACdV,EAAGU,EAAU,KACbT,GAAIS,EAAU,MAElBQ,WAAY,SAAUluD,GAClB,OAAOA,EAAOwP,QAAQ,KAAM,MAEhC69C,KAAM,CACFC,IAAK,EACLC,IAAK,KAtJyB5yD,CAAQ,EAAQ,8FCDlD,SAAWkiD,GAAU,aAIdA,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,wEAAwEttC,MAC5E,KAEJutC,YAAa,wEAAwEvtC,MACjF,KAEJwtC,SAAU,sDAAsDxtC,MAAM,KACtEytC,cAAe,wCAAwCztC,MAAM,KAC7D0tC,YAAa,gBAAgB1tC,MAAM,KACnCwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,wBACTC,QAAS,sBACTC,SAAU,uBACVC,QAAS,sBACTC,SAAU,uBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN30C,EAAG,OACH40C,GAAI,WACJh9C,EAAG,QACHi9C,GAAI,WACJC,EAAG,OACHC,GAAI,WACJh5B,EAAG,MACHi5B,GAAI,UACJC,EAAG,MACHC,GAAI,UACJC,EAAG,MACHC,GAAI,YAERI,KAAM,CACFC,IAAK,EACLC,IAAK,MApDyB5yD,CAAQ,EAAQ,8FCGlD,SAAWkiD,GAAU,aAIzB,IAAIsR,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPX,EAAa,SAAUxyC,GACnB,OAAa,IAANA,EACD,EACM,IAANA,EACA,EACM,IAANA,EACA,EACAA,EAAI,KAAO,GAAKA,EAAI,KAAO,GAC3B,EACAA,EAAI,KAAO,GACX,EACA,GAEVyyC,EAAU,CACN51C,EAAG,CACC,eACA,cACA,CAAC,UAAW,WACZ,UACA,WACA,YAEJpI,EAAG,CACC,eACA,cACA,CAAC,UAAW,WACZ,WACA,WACA,YAEJk9C,EAAG,CACC,cACA,aACA,CAAC,SAAU,UACX,WACA,UACA,WAEJ/4B,EAAG,CACC,aACA,WACA,CAAC,QAAS,SACV,UACA,WACA,UAEJk5B,EAAG,CACC,aACA,WACA,CAAC,QAAS,SACV,UACA,UACA,UAEJE,EAAG,CACC,aACA,WACA,CAAC,QAAS,SACV,WACA,WACA,WAGRU,EAAY,SAAUC,GAClB,OAAO,SAAUP,EAAQQ,EAAe5tD,EAAQ6tD,GAC5C,IAAIC,EAAIN,EAAWJ,GACf3hD,EAAMgiD,EAAQE,GAAGH,EAAWJ,IAIhC,OAHU,IAANU,IACAriD,EAAMA,EAAImiD,EAAgB,EAAI,IAE3BniD,EAAI+D,QAAQ,MAAO49C,KAGlCvC,EAAS,CACL,QACA,SACA,OACA,QACA,OACA,QACA,QACA,QACA,SACA,SACA,SACA,UAGGhO,EAAO+N,aAAa,QAAS,CACpCC,OAAQA,EACRC,YAAaD,EACbE,SAAU,sDAAsDxtC,MAAM,KACtEytC,cAAe,wCAAwCztC,MAAM,KAC7D0tC,YAAa,gBAAgB1tC,MAAM,KACnCwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVZ,cAAe,MACfC,KAAM,SAAU99C,GACZ,MAAO,MAAQA,GAEnB+9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,GACA,IAEA,KAGfjC,SAAU,CACNC,QAAS,wBACTC,QAAS,uBACTC,SAAU,uBACVC,QAAS,sBACTC,SAAU,uBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,SACN30C,EAAG61C,EAAU,KACbjB,GAAIiB,EAAU,KACdj+C,EAAGi+C,EAAU,KACbhB,GAAIgB,EAAU,KACdf,EAAGe,EAAU,KACbd,GAAIc,EAAU,KACd95B,EAAG85B,EAAU,KACbb,GAAIa,EAAU,KACdZ,EAAGY,EAAU,KACbX,GAAIW,EAAU,KACdV,EAAGU,EAAU,KACbT,GAAIS,EAAU,MAElBU,SAAU,SAAUpuD,GAChB,OAAOA,EAAOwP,QAAQ,KAAM,MAEhC0+C,WAAY,SAAUluD,GAClB,OAAOA,EACFwP,QAAQ,OAAO,SAAUiH,GACtB,OAAO03C,EAAU13C,MAEpBjH,QAAQ,KAAM,MAEvB69C,KAAM,CACFC,IAAK,EACLC,IAAK,MAzKyB5yD,CAAQ,EAAQ,8FCIlD,SAAWkiD,GAAU,aAIdA,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,wEAAwEttC,MAC5E,KAEJutC,YAAa,wEAAwEvtC,MACjF,KAEJwtC,SAAU,sDAAsDxtC,MAAM,KACtEytC,cAAe,wCAAwCztC,MAAM,KAC7D0tC,YAAa,gBAAgB1tC,MAAM,KACnCwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,wBACTC,QAAS,sBACTC,SAAU,uBACVC,QAAS,sBACTC,SAAU,uBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN30C,EAAG,OACH40C,GAAI,WACJh9C,EAAG,QACHi9C,GAAI,WACJC,EAAG,OACHC,GAAI,WACJh5B,EAAG,MACHi5B,GAAI,UACJC,EAAG,MACHC,GAAI,UACJC,EAAG,MACHC,GAAI,YAERI,KAAM,CACFC,IAAK,EACLC,IAAK,KApDyB5yD,CAAQ,EAAQ,8FCElD,SAAWkiD,GAAU,aAIzB,IAAIsR,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAGFxR,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,6EAA6EttC,MACjF,KAEJutC,YAAa,6EAA6EvtC,MACtF,KAEJwtC,SAAU,sDAAsDxtC,MAAM,KACtEytC,cAAe,wCAAwCztC,MAAM,KAC7D0tC,YAAa,gBAAgB1tC,MAAM,KACnCwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVZ,cAAe,MACfC,KAAM,SAAU99C,GACZ,MAAO,MAAQA,GAEnB+9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,GACA,IAEA,KAGfjC,SAAU,CACNC,QAAS,wBACTC,QAAS,sBACTC,SAAU,uBACVC,QAAS,sBACTC,SAAU,uBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN30C,EAAG,OACH40C,GAAI,WACJh9C,EAAG,QACHi9C,GAAI,WACJC,EAAG,OACHC,GAAI,WACJh5B,EAAG,MACHi5B,GAAI,UACJC,EAAG,MACHC,GAAI,UACJC,EAAG,MACHC,GAAI,YAERmB,SAAU,SAAUpuD,GAChB,OAAOA,EACFwP,QAAQ,iBAAiB,SAAUiH,GAChC,OAAO43C,EAAU53C,MAEpBjH,QAAQ,KAAM,MAEvB0+C,WAAY,SAAUluD,GAClB,OAAOA,EACFwP,QAAQ,OAAO,SAAUiH,GACtB,OAAO03C,EAAU13C,MAEpBjH,QAAQ,KAAM,MAEvB69C,KAAM,CACFC,IAAK,EACLC,IAAK,KAtGyB5yD,CAAQ,EAAQ,8FCGlD,SAAWkiD,GAAU,aAIdA,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,yEAAyEttC,MAC7E,KAEJutC,YAAa,yEAAyEvtC,MAClF,KAEJwtC,SAAU,sDAAsDxtC,MAAM,KACtEytC,cAAe,wCAAwCztC,MAAM,KAC7D0tC,YAAa,gBAAgB1tC,MAAM,KACnCwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,wBACTC,QAAS,sBACTC,SAAU,uBACVC,QAAS,sBACTC,SAAU,uBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN30C,EAAG,OACH40C,GAAI,WACJh9C,EAAG,QACHi9C,GAAI,WACJC,EAAG,OACHC,GAAI,WACJh5B,EAAG,MACHi5B,GAAI,UACJC,EAAG,MACHC,GAAI,UACJC,EAAG,MACHC,GAAI,YAERI,KAAM,CACFC,IAAK,EACLC,IAAK,KApDyB5yD,CAAQ,EAAQ,2FCKlD,SAAWkiD,GAAU,aAIzB,IAAIsR,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAETb,EAAa,SAAUxyC,GACnB,OAAa,IAANA,EACD,EACM,IAANA,EACA,EACM,IAANA,EACA,EACAA,EAAI,KAAO,GAAKA,EAAI,KAAO,GAC3B,EACAA,EAAI,KAAO,GACX,EACA,GAEVyyC,EAAU,CACN51C,EAAG,CACC,eACA,cACA,CAAC,UAAW,WACZ,UACA,WACA,YAEJpI,EAAG,CACC,eACA,cACA,CAAC,UAAW,WACZ,WACA,WACA,YAEJk9C,EAAG,CACC,cACA,aACA,CAAC,SAAU,UACX,WACA,UACA,WAEJ/4B,EAAG,CACC,aACA,WACA,CAAC,QAAS,SACV,UACA,WACA,UAEJk5B,EAAG,CACC,aACA,WACA,CAAC,QAAS,SACV,UACA,UACA,UAEJE,EAAG,CACC,aACA,WACA,CAAC,QAAS,SACV,WACA,WACA,WAGRU,EAAY,SAAUC,GAClB,OAAO,SAAUP,EAAQQ,EAAe5tD,EAAQ6tD,GAC5C,IAAIC,EAAIN,EAAWJ,GACf3hD,EAAMgiD,EAAQE,GAAGH,EAAWJ,IAIhC,OAHU,IAANU,IACAriD,EAAMA,EAAImiD,EAAgB,EAAI,IAE3BniD,EAAI+D,QAAQ,MAAO49C,KAGlCvC,EAAS,CACL,QACA,SACA,OACA,QACA,OACA,QACA,QACA,QACA,SACA,SACA,SACA,UAGChO,EAAO+N,aAAa,KAAM,CAC/BC,OAAQA,EACRC,YAAaD,EACbE,SAAU,sDAAsDxtC,MAAM,KACtEytC,cAAe,wCAAwCztC,MAAM,KAC7D0tC,YAAa,gBAAgB1tC,MAAM,KACnCwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVZ,cAAe,MACfC,KAAM,SAAU99C,GACZ,MAAO,MAAQA,GAEnB+9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,GACA,IAEA,KAGfjC,SAAU,CACNC,QAAS,wBACTC,QAAS,uBACTC,SAAU,uBACVC,QAAS,sBACTC,SAAU,uBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,SACN30C,EAAG61C,EAAU,KACbjB,GAAIiB,EAAU,KACdj+C,EAAGi+C,EAAU,KACbhB,GAAIgB,EAAU,KACdf,EAAGe,EAAU,KACbd,GAAIc,EAAU,KACd95B,EAAG85B,EAAU,KACbb,GAAIa,EAAU,KACdZ,EAAGY,EAAU,KACbX,GAAIW,EAAU,KACdV,EAAGU,EAAU,KACbT,GAAIS,EAAU,MAElBU,SAAU,SAAUpuD,GAChB,OAAOA,EACFwP,QAAQ,iBAAiB,SAAUiH,GAChC,OAAO43C,EAAU53C,MAEpBjH,QAAQ,KAAM,MAEvB0+C,WAAY,SAAUluD,GAClB,OAAOA,EACFwP,QAAQ,OAAO,SAAUiH,GACtB,OAAO03C,EAAU13C,MAEpBjH,QAAQ,KAAM,MAEvB69C,KAAM,CACFC,IAAK,EACLC,IAAK,MAzLyB5yD,CAAQ,EAAQ,2FCClD,SAAWkiD,GAAU,aAIzB,IAAIyR,EAAW,CACX,EAAG,QACH,EAAG,QACH,EAAG,QACH,GAAI,QACJ,GAAI,QACJ,EAAG,OACH,EAAG,OACH,GAAI,OACJ,GAAI,OACJ,EAAG,QACH,EAAG,QACH,IAAK,QACL,EAAG,OACH,EAAG,QACH,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,SAGCzR,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,+EAA+EttC,MACnF,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,qEAAqExtC,MAC3E,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,kBACTC,QAAS,kBACTC,SAAU,+BACVC,QAAS,aACTC,SAAU,+BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,WACRC,KAAM,WACN30C,EAAG,kBACH40C,GAAI,YACJh9C,EAAG,aACHi9C,GAAI,YACJC,EAAG,WACHC,GAAI,UACJh5B,EAAG,UACHi5B,GAAI,SACJC,EAAG,SACHC,GAAI,QACJC,EAAG,SACHC,GAAI,SAER/B,cAAe,0BACfC,KAAM,SAAU99C,GACZ,MAAO,mBAAmBuQ,KAAKvQ,IAEnC+9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,OACAA,EAAO,GACP,QACAA,EAAO,GACP,SAEA,SAGfd,uBAAwB,wCACxBC,QAAS,SAAUC,GACf,GAAe,IAAXA,EAEA,OAAOA,EAAS,QAEpB,IAAIl1C,EAAIk1C,EAAS,GAGjB,OAAOA,GAAUkB,EAASp2C,IAAMo2C,EAFvBlB,EAAS,IAAOl1C,IAEsBo2C,EADvClB,GAAU,IAAM,IAAM,QAGlCC,KAAM,CACFC,IAAK,EACLC,IAAK,KAnGyB5yD,CAAQ,EAAQ,2FCKlD,SAAWkiD,GAAU,aAYzB,SAAS0R,EAAuBnB,EAAQQ,EAAettD,GASnD,MAAY,MAARA,EACOstD,EAAgB,UAAY,UACpB,MAARttD,EACAstD,EAAgB,UAAY,UAE5BR,EAAS,KAtBFoB,GAsB6BpB,EArB3CqB,EAQS,CACThC,GAAImB,EAAgB,yBAA2B,yBAC/ClB,GAAIkB,EAAgB,yBAA2B,yBAC/ChB,GAAIgB,EAAgB,yBAA2B,yBAC/Cf,GAAI,iBACJE,GAAI,uBACJE,GAAI,kBAOgC3sD,GArBvBid,MAAM,KAChBixC,EAAM,IAAO,GAAKA,EAAM,KAAQ,GACjCC,EAAM,GACND,EAAM,IAAM,GAAKA,EAAM,IAAM,IAAMA,EAAM,IAAM,IAAMA,EAAM,KAAO,IAClEC,EAAM,GACNA,EAAM,IANhB,IAAsBD,EACdC,EAyBC5R,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,CACJxoC,OAAQ,uGAAuG9E,MAC3G,KAEJmxC,WAAY,qGAAqGnxC,MAC7G,MAGRutC,YAAa,0DAA0DvtC,MACnE,KAEJwtC,SAAU,CACN1oC,OAAQ,0DAA0D9E,MAC9D,KAEJmxC,WAAY,0DAA0DnxC,MAClE,KAEJoxC,SAAU,+CAEd3D,cAAe,uBAAuBztC,MAAM,KAC5C0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,iBACJC,IAAK,wBACLC,KAAM,+BAEVC,SAAU,CACNC,QAAS,eACTC,QAAS,gBACTE,QAAS,eACTD,SAAU,WACN,MAAO,mBAEXE,SAAU,WACN,OAAQ3xD,KAAKm0D,OACT,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,0BACX,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,2BAGnBvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,UACRC,KAAM,UACN30C,EAAG,kBACHpI,EAAG8+C,EACH7B,GAAI6B,EACJ5B,EAAG4B,EACH3B,GAAI2B,EACJ36B,EAAG,QACHi5B,GAAI0B,EACJzB,EAAG,QACHC,GAAIwB,EACJvB,EAAG,MACHC,GAAIsB,GAERrD,cAAe,yBACfC,KAAM,SAAU99C,GACZ,MAAO,iBAAiBuQ,KAAKvQ,IAEjC+9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,OACAA,EAAO,GACP,SACAA,EAAO,GACP,MAEA,UAGfd,uBAAwB,mBACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GACJ,IAAK,IACL,IAAK,IACL,IAAK,MACL,IAAK,IACL,IAAK,IACD,OAAQzB,EAAS,IAAO,GAAKA,EAAS,IAAO,GACzCA,EAAS,KAAQ,IACjBA,EAAS,KAAQ,GAEfA,EAAS,KADTA,EAAS,KAEnB,IAAK,IACD,OAAOA,EAAS,MACpB,QACI,OAAOA,IAGnBC,KAAM,CACFC,IAAK,EACLC,IAAK,KAzIyB5yD,CAAQ,EAAQ,2FCClD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,oFAAoFttC,MACxF,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,yDAAyDxtC,MAC/D,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,YACHC,GAAI,cACJC,IAAK,mBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,cACTC,QAAS,cACTC,SAAU,cACVC,QAAS,eACTC,SAAU,WACN,OAAQ3xD,KAAKm0D,OACT,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,yBACX,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,0BAGnBvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,UACRC,KAAM,WACN30C,EAAG,kBACH40C,GAAI,aACJh9C,EAAG,SACHi9C,GAAI,YACJC,EAAG,MACHC,GAAI,UACJh5B,EAAG,MACHi5B,GAAI,UACJiC,EAAG,UACHC,GAAI,aACJjC,EAAG,QACHC,GAAI,YACJC,EAAG,SACHC,GAAI,aAERC,uBAAwB,8BACxBC,QAAS,SAAUC,GACf,IAAI4B,EAAY5B,EAAS,GACrB6B,EAAc7B,EAAS,IAC3B,OAAe,IAAXA,EACOA,EAAS,MACO,IAAhB6B,EACA7B,EAAS,MACT6B,EAAc,IAAMA,EAAc,GAClC7B,EAAS,MACK,IAAd4B,EACA5B,EAAS,MACK,IAAd4B,EACA5B,EAAS,MACK,IAAd4B,GAAiC,IAAdA,EACnB5B,EAAS,MAETA,EAAS,OAGxBC,KAAM,CACFC,IAAK,EACLC,IAAK,KArFyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,8IAA8IttC,MAClJ,KAEJutC,YAAa,iDAAiDvtC,MAAM,KACpEwtC,SAAU,+CAA+CxtC,MAAM,KAC/DytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,2BACJC,IAAK,wCACLC,KAAM,8CAEVC,SAAU,CACNC,QAAS,eACTC,QAAS,iBACTC,SAAU,qBACVC,QAAS,iBACTC,SAAU,yBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,UACRC,KAAM,aACN30C,EAAG,kBACH40C,GAAI,aACJh9C,EAAG,eACHi9C,GAAI,YACJC,EAAG,aACHC,GAAI,UACJh5B,EAAG,aACHi5B,GAAI,UACJC,EAAG,aACHC,GAAI,UACJC,EAAG,YACHC,GAAI,UAERI,KAAM,CACFC,IAAK,EACLC,IAAK,KAjDyB5yD,CAAQ,EAAQ,8FCGlD,SAAWkiD,GAAU,aAIzB,IAAIsR,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAGFxR,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,0FAA0FttC,MAC9F,KAEJutC,YAAa,mEAAmEvtC,MAC5E,KAEJwtC,SAAU,4DAA4DxtC,MAClE,KAEJytC,cAAe,uCAAuCztC,MAAM,KAC5D0tC,YAAa,kCAAkC1tC,MAAM,KACrDiuC,eAAgB,CACZC,GAAI,aACJC,IAAK,gBACLC,EAAG,aACHC,GAAI,cACJC,IAAK,0BACLC,KAAM,iCAEVC,SAAU,CACNC,QAAS,UACTC,QAAS,gBACTC,SAAU,WACVC,QAAS,aACTC,SAAU,gBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,SACN30C,EAAG,eACH40C,GAAI,aACJh9C,EAAG,WACHi9C,GAAI,WACJC,EAAG,WACHC,GAAI,WACJh5B,EAAG,SACHi5B,GAAI,SACJC,EAAG,SACHC,GAAI,SACJC,EAAG,SACHC,GAAI,UAERmB,SAAU,SAAUpuD,GAChB,OAAOA,EAAOwP,QAAQ,iBAAiB,SAAUiH,GAC7C,OAAO43C,EAAU53C,OAGzBy3C,WAAY,SAAUluD,GAClB,OAAOA,EAAOwP,QAAQ,OAAO,SAAUiH,GACnC,OAAO03C,EAAU13C,OAIzBy0C,cAAe,uCACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,QAAb5C,EACO4C,EAAO,EAAIA,EAAOA,EAAO,GACZ,QAAb5C,GAEa,SAAbA,EADA4C,EAGa,UAAb5C,EACA4C,GAAQ,EAAIA,EAAOA,EAAO,GACb,UAAb5C,GAEa,YAAbA,EADA4C,EAAO,QACX,GAKX5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,MACAA,EAAO,EACP,MACAA,EAAO,GACP,OACAA,EAAO,GACP,QACAA,EAAO,GACP,QACAA,EAAO,GACP,UAEA,OAGfX,KAAM,CACFC,IAAK,EACLC,IAAK,KA9HyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIzB,IAAIsR,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAGJxR,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,0FAA0FttC,MAC9F,KAEJutC,YAAa,mEAAmEvtC,MAC5E,KAEJwtC,SAAU,4DAA4DxtC,MAClE,KAEJytC,cAAe,uCAAuCztC,MAAM,KAC5D0tC,YAAa,kCAAkC1tC,MAAM,KACrDiuC,eAAgB,CACZC,GAAI,aACJC,IAAK,gBACLC,EAAG,aACHC,GAAI,cACJC,IAAK,0BACLC,KAAM,iCAEVC,SAAU,CACNC,QAAS,UACTC,QAAS,gBACTC,SAAU,WACVC,QAAS,aACTC,SAAU,gBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,SACN30C,EAAG,eACH40C,GAAI,aACJh9C,EAAG,WACHi9C,GAAI,WACJC,EAAG,WACHC,GAAI,WACJh5B,EAAG,SACHi5B,GAAI,SACJC,EAAG,SACHC,GAAI,SACJC,EAAG,SACHC,GAAI,UAERmB,SAAU,SAAUpuD,GAChB,OAAOA,EAAOwP,QAAQ,iBAAiB,SAAUiH,GAC7C,OAAO43C,EAAU53C,OAGzBy3C,WAAY,SAAUluD,GAClB,OAAOA,EAAOwP,QAAQ,OAAO,SAAUiH,GACnC,OAAO03C,EAAU13C,OAGzBy0C,cAAe,2BACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAGO,QAAb5C,GAAsB4C,GAAQ,GACjB,UAAb5C,GAAwB4C,EAAO,GACnB,UAAb5C,EAEO4C,EAAO,GAEPA,GAGf5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,MACAA,EAAO,GACP,OACAA,EAAO,GACP,QACAA,EAAO,GACP,QAEA,OAGfX,KAAM,CACFC,IAAK,EACLC,IAAK,KApHyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIzB,IAAIsR,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAGJxR,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,qJAAqJttC,MACzJ,KAEJutC,YAAa,iEAAiEvtC,MAC1E,KAEJ4xC,iBAAkB,gBAClBC,kBAAkB,EAClBrE,SAAU,gFAAgFxtC,MACtF,KAEJytC,cAAe,oDAAoDztC,MAC/D,KAEJ0tC,YAAa,6BAA6B1tC,MAAM,KAChDiuC,eAAgB,CACZC,GAAI,SACJC,IAAK,YACLC,EAAG,aACHC,GAAI,cACJC,IAAK,sBACLC,KAAM,6BAEVC,SAAU,CACNC,QAAS,cACTC,QAAS,cACTC,SAAU,wBACVC,QAAS,YACTC,SAAU,4BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,WACN30C,EAAG,QACH40C,GAAI,YACJh9C,EAAG,aACHi9C,GAAI,WACJC,EAAG,cACHC,GAAI,YACJh5B,EAAG,WACHi5B,GAAI,UACJC,EAAG,YACHC,GAAI,UACJC,EAAG,UACHC,GAAI,SAERmB,SAAU,SAAUpuD,GAChB,OAAOA,EAAOwP,QAAQ,iBAAiB,SAAUiH,GAC7C,OAAO43C,EAAU53C,OAGzBy3C,WAAY,SAAUluD,GAClB,OAAOA,EAAOwP,QAAQ,OAAO,SAAUiH,GACnC,OAAO03C,EAAU13C,OAGzBy0C,cAAe,wCACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAGO,WAAb5C,GAAyB4C,GAAQ,GACpB,YAAb5C,GAA0B4C,EAAO,GACrB,YAAb5C,EAEO4C,EAAO,GAEPA,GAGf5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,SACAA,EAAO,GACP,UACAA,EAAO,GACP,UACAA,EAAO,GACP,UAEA,UAGfX,KAAM,CACFC,IAAK,EACLC,IAAK,KAxHyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIzB,SAASwS,EAAyBjC,EAAQQ,EAAettD,GAMrD,OAAO8sD,EAAS,IAoBpB,SAAkB/vC,EAAM+vC,GACpB,OAAe,IAAXA,EAKR,SAAsB/vC,GAClB,IAAIiyC,EAAgB,CAChB7/C,EAAG,IACH4J,EAAG,IACHua,EAAG,KAEP,YAAsChlB,IAAlC0gD,EAAcjyC,EAAKnd,OAAO,IACnBmd,EAEJiyC,EAAcjyC,EAAKnd,OAAO,IAAMmd,EAAKqX,UAAU,GAb3C66B,CAAalyC,GAEjBA,EAxBemyC,CALT,CACT9C,GAAI,WACJK,GAAI,MACJF,GAAI,UAE8BvsD,GAAM8sD,GAchD,SAASqC,EAAWrC,GAChB,OAAIA,EAAS,EACFqC,EAAWrC,EAAS,IAExBA,EAoBX,IAAIsC,EAAc,CACV,QACA,cACA,QACA,QACA,QACA,cACA,QACA,QACA,QACA,QACA,OACA,SAEJC,EAAc,6IAqBdC,EAAmB,CACf,OACA,OACA,eACA,QACA,OACA,OACA,QAGC/S,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,gFAAgFttC,MACpF,KAEJutC,YAAa,mDAAmDvtC,MAAM,KACtEwtC,SAAU,6CAA6CxtC,MAAM,KAC7DytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,wBAAwB1tC,MAAM,KAC3CsyC,cAAeD,EACfE,kBArCoB,CAChB,QACA,QACA,WACA,iBACA,SACA,WACA,YA+BJC,mBA7BqB,CACjB,QACA,QACA,QACA,QACA,QACA,QACA,SAuBJH,iBAAkBA,EAElBD,YAAaA,EACbR,iBAAkBQ,EAClBK,kBA7CoB,wFA8CpBC,uBA7CyB,2DA8CzBP,YAAaA,EACbQ,gBAAiBR,EACjBS,iBAAkBT,EAElBlE,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,sBACJC,IAAK,4BACLC,KAAM,mCAEVC,SAAU,CACNC,QAAS,gBACTC,QAAS,qBACTC,SAAU,eACVC,QAAS,gBACTC,SAAU,qBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,YACRC,KAAM,SACN30C,EAAG,wBACH40C,GAAI,YACJh9C,EAAG,cACHi9C,GAAI2C,EACJ1C,EAAG,SACHC,GAAI,SACJh5B,EAAG,YACHi5B,GAAIwC,EACJvC,EAAG,SACHC,GAAIsC,EACJrC,EAAG,WACHC,GApIR,SAAiCG,GAC7B,OAAQqC,EAAWrC,IACf,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACD,OAAOA,EAAS,SACpB,QACI,OAAOA,EAAS,YA6HxBF,uBAAwB,kBACxBC,QAAS,SAAUC,GAEf,OAAOA,GADiB,IAAXA,EAAe,KAAO,QAGvCC,KAAM,CACFC,IAAK,EACLC,IAAK,GAETrC,cAAe,YACfC,KAAM,SAAUnvC,GACZ,MAAiB,SAAVA,GAEXovC,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAOyC,EAAO,GAAK,OAAS,UAnKErzD,CAAQ,EAAQ,2FCIlD,SAAWkiD,GAAU,aAIzB,SAASuT,EAAUhD,EAAQQ,EAAettD,GACtC,IAAIS,EAASqsD,EAAS,IACtB,OAAQ9sD,GACJ,IAAK,KAQD,OANIS,GADW,IAAXqsD,EACU,UACQ,IAAXA,GAA2B,IAAXA,GAA2B,IAAXA,EAC7B,UAEA,WAGlB,IAAK,IACD,OAAOQ,EAAgB,eAAiB,eAC5C,IAAK,KAQD,OANI7sD,GADW,IAAXqsD,EACU,SACQ,IAAXA,GAA2B,IAAXA,GAA2B,IAAXA,EAC7B,SAEA,UAGlB,IAAK,IACD,OAAOQ,EAAgB,YAAc,cACzC,IAAK,KAQD,OANI7sD,GADW,IAAXqsD,EACU,MACQ,IAAXA,GAA2B,IAAXA,GAA2B,IAAXA,EAC7B,OAEA,QAGlB,IAAK,KAMD,OAJIrsD,GADW,IAAXqsD,EACU,MAEA,QAGlB,IAAK,KAQD,OANIrsD,GADW,IAAXqsD,EACU,SACQ,IAAXA,GAA2B,IAAXA,GAA2B,IAAXA,EAC7B,UAEA,WAGlB,IAAK,KAQD,OANIrsD,GADW,IAAXqsD,EACU,SACQ,IAAXA,GAA2B,IAAXA,GAA2B,IAAXA,EAC7B,SAEA,WAMjBvQ,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,qFAAqFttC,MACzF,KAEJutC,YAAa,8DAA8DvtC,MACvE,KAEJ6xC,kBAAkB,EAClBrE,SAAU,4DAA4DxtC,MAClE,KAEJytC,cAAe,qCAAqCztC,MAAM,KAC1D0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,eACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,eACTC,QAAS,eACTC,SAAU,WACN,OAAQzxD,KAAKm0D,OACT,KAAK,EACD,MAAO,wBACX,KAAK,EACD,MAAO,uBACX,KAAK,EACD,MAAO,sBACX,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,oBAGnBzC,QAAS,eACTC,SAAU,WACN,OAAQ3xD,KAAKm0D,OACT,KAAK,EACL,KAAK,EACD,MAAO,uBACX,KAAK,EACD,MAAO,2BACX,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,yBAGnBvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,WACN30C,EAAG,cACH40C,GAAI2D,EACJ3gD,EAAG2gD,EACH1D,GAAI0D,EACJzD,EAAGyD,EACHxD,GAAIwD,EACJx8B,EAAG,MACHi5B,GAAIuD,EACJtD,EAAG,SACHC,GAAIqD,EACJpD,EAAG,SACHC,GAAImD,GAERlD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAlJyB5yD,CAAQ,EAAQ,2FCElD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,CACJ6D,WAAY,oFAAoFnxC,MAC5F,KAEJ8E,OAAQ,qHAAqH9E,MACzH,KAEJoxC,SAAU,mBAEd7D,YAAa,8DAA8DvtC,MACvE,KAEJ6xC,kBAAkB,EAClBrE,SAAU,8DAA8DxtC,MACpE,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,mBACJyE,GAAI,aACJxE,IAAK,gCACLyE,IAAK,mBACLxE,KAAM,qCACNyE,KAAM,wBAEVxE,SAAU,CACNC,QAAS,WACL,MAAO,YAA+B,IAAjBvxD,KAAK4wD,QAAgB,MAAQ,MAAQ,QAE9DY,QAAS,WACL,MAAO,YAA+B,IAAjBxxD,KAAK4wD,QAAgB,MAAQ,MAAQ,QAE9Da,SAAU,WACN,MAAO,YAA+B,IAAjBzxD,KAAK4wD,QAAgB,MAAQ,MAAQ,QAE9Dc,QAAS,WACL,MAAO,YAA+B,IAAjB1xD,KAAK4wD,QAAgB,MAAQ,MAAQ,QAE9De,SAAU,WACN,MACI,wBACkB,IAAjB3xD,KAAK4wD,QAAgB,MAAQ,MAC9B,QAGRgB,SAAU,KAEdC,aAAc,CACVC,OAAQ,YACRC,KAAM,QACN30C,EAAG,aACH40C,GAAI,YACJh9C,EAAG,WACHi9C,GAAI,YACJC,EAAG,WACHC,GAAI,WACJh5B,EAAG,SACHi5B,GAAI,UACJC,EAAG,SACHC,GAAI,WACJC,EAAG,SACHC,GAAI,WAERC,uBAAwB,qBACxBC,QAAS,SAAUC,EAAQyB,GACvB,IAAI2B,EACW,IAAXpD,EACM,IACW,IAAXA,EACA,IACW,IAAXA,EACA,IACW,IAAXA,EACA,IACA,IAIV,MAHe,MAAXyB,GAA6B,MAAXA,IAClB2B,EAAS,KAENpD,EAASoD,GAEpBnD,KAAM,CACFC,IAAK,EACLC,IAAK,KA/FyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIzB,IAAIgO,EAAS,oFAAoFttC,MACzF,KAEJutC,EAAc,kDAAkDvtC,MAAM,KACtEmyC,EAAc,CACV,QACA,QACA,QACA,QACA,QACA,yBACA,4BACA,QACA,QACA,QACA,QACA,SAIJC,EAAc,wJAElB,SAASc,EAAOz1C,GACZ,OAAOA,EAAI,GAAKA,EAAI,GAAoB,MAAZA,EAAI,IAEpC,SAASo1C,EAAUhD,EAAQQ,EAAettD,EAAKutD,GAC3C,IAAI9sD,EAASqsD,EAAS,IACtB,OAAQ9sD,GACJ,IAAK,IACD,OAAOstD,GAAiBC,EAAW,aAAe,gBACtD,IAAK,KACD,OAAID,GAAiBC,EACV9sD,GAAU0vD,EAAOrD,GAAU,UAAY,UAEvCrsD,EAAS,YAExB,IAAK,IACD,OAAO6sD,EAAgB,SAAWC,EAAW,SAAW,UAC5D,IAAK,KACD,OAAID,GAAiBC,EACV9sD,GAAU0vD,EAAOrD,GAAU,SAAW,SAEtCrsD,EAAS,WAExB,IAAK,IACD,OAAO6sD,EAAgB,SAAWC,EAAW,SAAW,UAC5D,IAAK,KACD,OAAID,GAAiBC,EACV9sD,GAAU0vD,EAAOrD,GAAU,SAAW,SAEtCrsD,EAAS,WAExB,IAAK,IACD,OAAO6sD,GAAiBC,EAAW,MAAQ,OAC/C,IAAK,KACD,OAAID,GAAiBC,EACV9sD,GAAU0vD,EAAOrD,GAAU,MAAQ,OAEnCrsD,EAAS,MAExB,IAAK,IACD,OAAO6sD,GAAiBC,EAAW,QAAU,UACjD,IAAK,KACD,OAAID,GAAiBC,EACV9sD,GAAU0vD,EAAOrD,GAAU,SAAW,UAEtCrsD,EAAS,SAExB,IAAK,IACD,OAAO6sD,GAAiBC,EAAW,MAAQ,QAC/C,IAAK,KACD,OAAID,GAAiBC,EACV9sD,GAAU0vD,EAAOrD,GAAU,OAAS,OAEpCrsD,EAAS,QAKvB87C,EAAO+N,aAAa,KAAM,CAC/BC,OAAQA,EACRC,YAAaA,EACb6E,YAAaA,EACbR,iBAAkBQ,EAGlBK,kBAAmB,uKACnBC,uBAAwB,sDACxBP,YAAaA,EACbQ,gBAAiBR,EACjBS,iBAAkBT,EAClB3E,SAAU,mDAAmDxtC,MAAM,KACnEytC,cAAe,uBAAuBztC,MAAM,KAC5C0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,eACJC,IAAK,oBACLC,KAAM,yBACN5+B,EAAG,cAEP6+B,SAAU,CACNC,QAAS,cACTC,QAAS,eACTC,SAAU,WACN,OAAQzxD,KAAKm0D,OACT,KAAK,EACD,MAAO,kBACX,KAAK,EACL,KAAK,EACD,MAAO,kBACX,KAAK,EACD,MAAO,mBACX,KAAK,EACD,MAAO,oBACX,KAAK,EACD,MAAO,iBACX,KAAK,EACD,MAAO,oBAGnBzC,QAAS,eACTC,SAAU,WACN,OAAQ3xD,KAAKm0D,OACT,KAAK,EACD,MAAO,wBACX,KAAK,EACL,KAAK,EACD,MAAO,uBACX,KAAK,EACD,MAAO,wBACX,KAAK,EACL,KAAK,EACD,MAAO,uBACX,KAAK,EACD,MAAO,0BAGnBvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,UACN30C,EAAGu4C,EACH3D,GAAI2D,EACJ3gD,EAAG2gD,EACH1D,GAAI0D,EACJzD,EAAGyD,EACHxD,GAAIwD,EACJx8B,EAAGw8B,EACHvD,GAAIuD,EACJtD,EAAGsD,EACHrD,GAAIqD,EACJpD,EAAGoD,EACHnD,GAAImD,GAERlD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAzKyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,gEAAgEttC,MACpE,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,oEAAoExtC,MAC1E,KAEJytC,cAAe,6BAA6BztC,MAAM,KAClD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,sCACJC,IAAK,6CACLC,KAAM,oDAEVC,SAAU,CACNC,QAAS,sBACTC,QAAS,sBACTE,QAAS,sBACTD,SAAU,4BACVE,SAAU,4BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SAAUiE,GAMd,OAAOA,GALK,UAAUtsD,KAAKssD,GACrB,MACA,QAAQtsD,KAAKssD,GACb,MACA,QAGVhE,KAAM,YACN30C,EAAG,iBACH40C,GAAI,aACJh9C,EAAG,YACHi9C,GAAI,WACJC,EAAG,YACHC,GAAI,WACJh5B,EAAG,UACHi5B,GAAI,SACJC,EAAG,WACHC,GAAI,UACJC,EAAG,UACHC,GAAI,UAERC,uBAAwB,cACxBC,QAAS,SACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA5DyB5yD,CAAQ,EAAQ,2FCIlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,yFAAyFttC,MAC7F,KAEJutC,YAAa,qDAAqDvtC,MAC9D,KAEJwtC,SAAU,+EAA+ExtC,MACrF,KAEJytC,cAAe,+BAA+BztC,MAAM,KACpD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EAEpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,iBACTC,QAAS,gBACTC,SAAU,eACVC,QAAS,eACTC,SAAU,wBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,UACRC,KAAM,WACN30C,EAAG,mBACH40C,GAAI,YACJh9C,EAAG,QACHi9C,GAAI,WACJC,EAAG,MACHC,GAAI,SACJh5B,EAAG,UACHi5B,GAAI,aACJC,EAAG,MACHC,GAAI,SACJC,EAAG,WACHC,GAAI,cAERC,uBAAwB,mCAExBC,QAAS,SAAUC,GACf,IACIoD,EAAS,GAiCb,OAlCQpD,EAyBA,GAEAoD,EADM,KA1BNpD,GA0BkB,KA1BlBA,GA0B8B,KA1B9BA,GA0B0C,KA1B1CA,GA0BsD,MA1BtDA,EA2BS,MAEA,MA7BTA,EA+BO,IACXoD,EA9BS,CACL,GACA,KACA,KACA,MACA,MACA,KACA,KACA,KACA,MACA,MACA,MACA,KACA,MACA,KACA,KACA,MACA,KACA,KACA,MACA,KACA,OAvBApD,IAkCDA,EAASoD,GAEpBnD,KAAM,CACFC,IAAK,EACLC,IAAK,KA9FyB5yD,CAAQ,EAAQ,2FCElD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,sFAAsFttC,MAC1F,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,qDAAqDxtC,MAAM,KACrEytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,eACJC,IAAK,qBACLC,KAAM,sCAEVC,SAAU,CACNC,QAAS,iBACTC,QAAS,oBACTC,SAAU,mBACVC,QAAS,iBACTC,SAAU,qBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,WACN30C,EAAG,cACH40C,GAAI,cACJh9C,EAAG,WACHi9C,GAAI,cACJC,EAAG,UACHC,GAAI,WACJh5B,EAAG,SACHi5B,GAAI,UACJC,EAAG,WACHC,GAAI,aACJC,EAAG,QACHC,GAAI,SAERC,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAnDyB5yD,CAAQ,EAAQ,8FCMlD,SAAWkiD,GAAU,aAIzB,SAAS6T,EAAoBtD,EAAQQ,EAAettD,EAAKutD,GACrD,IAAIxrC,EAAS,CACT5S,EAAG,CAAC,cAAe,gBACnBk9C,EAAG,CAAC,cAAe,gBACnB/4B,EAAG,CAAC,UAAW,aACfi5B,GAAI,CAACO,EAAS,QAASA,EAAS,UAChC0B,EAAG,CAAC,aAAc,eAClBhC,EAAG,CAAC,YAAa,eACjBC,GAAI,CAACK,EAAS,UAAWA,EAAS,YAClCJ,EAAG,CAAC,WAAY,cAChBC,GAAI,CAACG,EAAS,SAAUA,EAAS,YAErC,OAAOQ,EAAgBvrC,EAAO/hB,GAAK,GAAK+hB,EAAO/hB,GAAK,GAG7Cu8C,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,qFAAqFttC,MACzF,KAEJutC,YAAa,6DAA6DvtC,MACtE,KAEJ6xC,kBAAkB,EAClBrE,SAAU,8DAA8DxtC,MACpE,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,eACJC,IAAK,qBACLC,KAAM,4BAEVC,SAAU,CACNC,QAAS,sBACTK,SAAU,IACVJ,QAAS,uBACTC,SAAU,qBACVC,QAAS,wBACTC,SAAU,gCAEdE,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN30C,EAAG,oBACH40C,GAAI,cACJh9C,EAAGihD,EACHhE,GAAI,aACJC,EAAG+D,EACH9D,GAAI,aACJh5B,EAAG88B,EACH7D,GAAI6D,EACJ5B,EAAG4B,EACH3B,GAAI,YACJjC,EAAG4D,EACH3D,GAAI2D,EACJ1D,EAAG0D,EACHzD,GAAIyD,GAERxD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA1EyB5yD,CAAQ,EAAQ,8FCAlD,SAAWkiD,GAAU,aAIzB,SAAS6T,EAAoBtD,EAAQQ,EAAettD,EAAKutD,GACrD,IAAIxrC,EAAS,CACT5S,EAAG,CAAC,cAAe,gBACnBk9C,EAAG,CAAC,cAAe,gBACnB/4B,EAAG,CAAC,UAAW,aACfi5B,GAAI,CAACO,EAAS,QAASA,EAAS,UAChC0B,EAAG,CAAC,aAAc,eAClBhC,EAAG,CAAC,YAAa,eACjBC,GAAI,CAACK,EAAS,UAAWA,EAAS,YAClCJ,EAAG,CAAC,WAAY,cAChBC,GAAI,CAACG,EAAS,SAAUA,EAAS,YAErC,OAAOQ,EAAgBvrC,EAAO/hB,GAAK,GAAK+hB,EAAO/hB,GAAK,GAG7Cu8C,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,qFAAqFttC,MACzF,KAEJutC,YAAa,6DAA6DvtC,MACtE,KAEJ6xC,kBAAkB,EAClBrE,SAAU,8DAA8DxtC,MACpE,KAEJytC,cAAe,uBAAuBztC,MAAM,KAC5C0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,eACJC,IAAK,qBACLC,KAAM,4BAEVC,SAAU,CACNC,QAAS,sBACTK,SAAU,IACVJ,QAAS,uBACTC,SAAU,qBACVC,QAAS,wBACTC,SAAU,gCAEdE,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN30C,EAAG,oBACH40C,GAAI,cACJh9C,EAAGihD,EACHhE,GAAI,aACJC,EAAG+D,EACH9D,GAAI,aACJh5B,EAAG88B,EACH7D,GAAI6D,EACJ5B,EAAG4B,EACH3B,GAAI,YACJjC,EAAG4D,EACH3D,GAAI2D,EACJ1D,EAAG0D,EACHzD,GAAIyD,GAERxD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA1EyB5yD,CAAQ,EAAQ,2FCKlD,SAAWkiD,GAAU,aAIzB,SAAS6T,EAAoBtD,EAAQQ,EAAettD,EAAKutD,GACrD,IAAIxrC,EAAS,CACT5S,EAAG,CAAC,cAAe,gBACnBk9C,EAAG,CAAC,cAAe,gBACnB/4B,EAAG,CAAC,UAAW,aACfi5B,GAAI,CAACO,EAAS,QAASA,EAAS,UAChC0B,EAAG,CAAC,aAAc,eAClBhC,EAAG,CAAC,YAAa,eACjBC,GAAI,CAACK,EAAS,UAAWA,EAAS,YAClCJ,EAAG,CAAC,WAAY,cAChBC,GAAI,CAACG,EAAS,SAAUA,EAAS,YAErC,OAAOQ,EAAgBvrC,EAAO/hB,GAAK,GAAK+hB,EAAO/hB,GAAK,GAG/Cu8C,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,qFAAqFttC,MACzF,KAEJutC,YAAa,6DAA6DvtC,MACtE,KAEJ6xC,kBAAkB,EAClBrE,SAAU,8DAA8DxtC,MACpE,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,eACJC,IAAK,qBACLC,KAAM,4BAEVC,SAAU,CACNC,QAAS,sBACTK,SAAU,IACVJ,QAAS,uBACTC,SAAU,qBACVC,QAAS,wBACTC,SAAU,gCAEdE,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN30C,EAAG,oBACH40C,GAAI,cACJh9C,EAAGihD,EACHhE,GAAI,aACJC,EAAG+D,EACH9D,GAAI,aACJh5B,EAAG88B,EACH7D,GAAI6D,EACJ5B,EAAG4B,EACH3B,GAAI,YACJjC,EAAG4D,EACH3D,GAAI2D,EACJ1D,EAAG0D,EACHzD,GAAIyD,GAERxD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA1EyB5yD,CAAQ,EAAQ,2FCClD,SAAWkiD,GAAU,aAIzB,IAAIgO,EAAS,CACL,WACA,aACA,SACA,WACA,KACA,OACA,SACA,WACA,eACA,aACA,aACA,cAEJE,EAAW,CACP,WACA,OACA,WACA,OACA,aACA,SACA,YAGClO,EAAO+N,aAAa,KAAM,CAC/BC,OAAQA,EACRC,YAAaD,EACbE,SAAUA,EACVC,cAAeD,EACfE,YAAa,qCAAqC1tC,MAAM,KACxDiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,WACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVZ,cAAe,QACfC,KAAM,SAAU99C,GACZ,MAAO,OAASA,GAEpB+9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,GACA,KAEA,MAGfjC,SAAU,CACNC,QAAS,cACTC,QAAS,cACTC,SAAU,UACVC,QAAS,cACTC,SAAU,qBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,cACRC,KAAM,YACN30C,EAAG,iBACH40C,GAAI,cACJh9C,EAAG,WACHi9C,GAAI,YACJC,EAAG,aACHC,GAAI,cACJh5B,EAAG,WACHi5B,GAAI,YACJC,EAAG,SACHC,GAAI,UACJC,EAAG,WACHC,GAAI,aAERmB,SAAU,SAAUpuD,GAChB,OAAOA,EAAOwP,QAAQ,KAAM,MAEhC0+C,WAAY,SAAUluD,GAClB,OAAOA,EAAOwP,QAAQ,KAAM,MAEhC69C,KAAM,CACFC,IAAK,EACLC,IAAK,MAxFyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAWhBA,EAAO+N,aAAa,KAAM,CAC/B+F,mBAAoB,qHAAqHpzC,MACrI,KAEJqzC,iBAAkB,qHAAqHrzC,MACnI,KAEJstC,OAAQ,SAAUgG,EAAgBxuC,GAC9B,OAAKwuC,EAGiB,iBAAXxuC,GACP,IAAIzE,KAAKyE,EAAOqS,UAAU,EAAGrS,EAAO1Z,QAAQ,UAGrClO,KAAKq2D,kBAAkBD,EAAeE,SAEtCt2D,KAAKu2D,oBAAoBH,EAAeE,SARxCt2D,KAAKu2D,qBAWpBlG,YAAa,oDAAoDvtC,MAAM,KACvEwtC,SAAU,yDAAyDxtC,MAC/D,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1C6tC,SAAU,SAAUC,EAAOC,EAASC,GAChC,OAAIF,EAAQ,GACDE,EAAU,KAAO,KAEjBA,EAAU,KAAO,MAGhCJ,KAAM,SAAU99C,GACZ,MAAyC,OAAjCA,EAAQ,IAAIsU,cAAc,IAEtCupC,cAAe,gBACfM,eAAgB,CACZC,GAAI,SACJC,IAAK,YACLC,EAAG,aACHC,GAAI,cACJC,IAAK,qBACLC,KAAM,4BAEVmF,WAAY,CACRjF,QAAS,iBACTC,QAAS,gBACTC,SAAU,eACVC,QAAS,eACTC,SAAU,WACN,OAAQ3xD,KAAKm0D,OACT,KAAK,EACD,MAAO,gCACX,QACI,MAAO,mCAGnBvC,SAAU,KAEdN,SAAU,SAAUzrD,EAAK4wD,GACrB,IApEY7jD,EAoERmjD,EAAS/1D,KAAK02D,YAAY7wD,GAC1B+qD,EAAQ6F,GAAOA,EAAI7F,QAIvB,OAzEYh+C,EAsEGmjD,GApEM,oBAAbrvC,UAA4B9T,aAAiB8T,UACX,sBAA1CnT,OAAO1R,UAAUiT,SAAS/S,KAAK6Q,MAoE3BmjD,EAASA,EAAO5zD,MAAMs0D,IAEnBV,EAAOhhD,QAAQ,KAAM67C,EAAQ,IAAO,EAAI,MAAQ,SAE3DiB,aAAc,CACVC,OAAQ,QACRC,KAAM,UACN30C,EAAG,oBACH40C,GAAI,kBACJh9C,EAAG,YACHi9C,GAAI,WACJC,EAAG,UACHC,GAAI,UACJh5B,EAAG,WACHi5B,GAAI,WACJC,EAAG,aACHC,GAAI,WACJC,EAAG,cACHC,GAAI,aAERC,uBAAwB,WACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAtGyB5yD,CAAQ,EAAQ,8FCGlD,SAAWkiD,GAAU,aAIdA,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,wFAAwFttC,MAC5F,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,2DAA2DxtC,MACjE,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,SACJC,IAAK,YACLC,EAAG,aACHC,GAAI,cACJC,IAAK,qBACLC,KAAM,4BAEVC,SAAU,CACNC,QAAS,gBACTC,QAAS,mBACTC,SAAU,eACVC,QAAS,oBACTC,SAAU,sBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN30C,EAAG,gBACH40C,GAAI,aACJh9C,EAAG,WACHi9C,GAAI,aACJC,EAAG,UACHC,GAAI,WACJh5B,EAAG,QACHi5B,GAAI,UACJC,EAAG,UACHC,GAAI,YACJC,EAAG,SACHC,GAAI,YAERC,uBAAwB,uBACxBC,QAAS,SAAUC,GACf,IAAI/zC,EAAI+zC,EAAS,GAWjB,OAAOA,GAT6B,MAAxBA,EAAS,IAAO,IACd,KACM,IAAN/zC,EACA,KACM,IAANA,EACA,KACM,IAANA,EACA,KACA,OAGlBg0C,KAAM,CACFC,IAAK,EACLC,IAAK,KAlEyB5yD,CAAQ,EAAQ,8FCGlD,SAAWkiD,GAAU,aAIdA,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,wFAAwFttC,MAC5F,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,2DAA2DxtC,MACjE,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,SACJC,IAAK,YACLC,EAAG,aACHC,GAAI,eACJC,IAAK,sBACLC,KAAM,6BAEVC,SAAU,CACNC,QAAS,gBACTC,QAAS,mBACTC,SAAU,eACVC,QAAS,oBACTC,SAAU,sBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN30C,EAAG,gBACH40C,GAAI,aACJh9C,EAAG,WACHi9C,GAAI,aACJC,EAAG,UACHC,GAAI,WACJh5B,EAAG,QACHi5B,GAAI,UACJC,EAAG,UACHC,GAAI,YACJC,EAAG,SACHC,GAAI,YAERC,uBAAwB,uBACxBC,QAAS,SAAUC,GACf,IAAI/zC,EAAI+zC,EAAS,GAWjB,OAAOA,GAT6B,MAAxBA,EAAS,IAAO,IACd,KACM,IAAN/zC,EACA,KACM,IAANA,EACA,KACM,IAANA,EACA,KACA,SA7DgB1e,CAAQ,EAAQ,8FCGlD,SAAWkiD,GAAU,aAIdA,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,wFAAwFttC,MAC5F,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,2DAA2DxtC,MACjE,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,gBACTC,QAAS,mBACTC,SAAU,eACVC,QAAS,oBACTC,SAAU,sBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN30C,EAAG,gBACH40C,GAAI,aACJh9C,EAAG,WACHi9C,GAAI,aACJC,EAAG,UACHC,GAAI,WACJh5B,EAAG,QACHi5B,GAAI,UACJC,EAAG,UACHC,GAAI,YACJC,EAAG,SACHC,GAAI,YAERC,uBAAwB,uBACxBC,QAAS,SAAUC,GACf,IAAI/zC,EAAI+zC,EAAS,GAWjB,OAAOA,GAT6B,MAAxBA,EAAS,IAAO,IACd,KACM,IAAN/zC,EACA,KACM,IAANA,EACA,KACM,IAANA,EACA,KACA,OAGlBg0C,KAAM,CACFC,IAAK,EACLC,IAAK,KAlEyB5yD,CAAQ,EAAQ,8FCGlD,SAAWkiD,GAAU,aAIdA,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,wFAAwFttC,MAC5F,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,2DAA2DxtC,MACjE,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,gBACTC,QAAS,mBACTC,SAAU,eACVC,QAAS,oBACTC,SAAU,sBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN30C,EAAG,gBACH40C,GAAI,aACJh9C,EAAG,WACHi9C,GAAI,aACJC,EAAG,UACHC,GAAI,WACJh5B,EAAG,QACHi5B,GAAI,UACJC,EAAG,UACHC,GAAI,YACJC,EAAG,SACHC,GAAI,YAERC,uBAAwB,uBACxBC,QAAS,SAAUC,GACf,IAAI/zC,EAAI+zC,EAAS,GAWjB,OAAOA,GAT6B,MAAxBA,EAAS,IAAO,IACd,KACM,IAAN/zC,EACA,KACM,IAANA,EACA,KACM,IAANA,EACA,KACA,OAGlBg0C,KAAM,CACFC,IAAK,EACLC,IAAK,KAlEyB5yD,CAAQ,EAAQ,8FCGlD,SAAWkiD,GAAU,aAIdA,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,wFAAwFttC,MAC5F,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,2DAA2DxtC,MACjE,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,gBACTC,QAAS,mBACTC,SAAU,eACVC,QAAS,oBACTC,SAAU,sBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN30C,EAAG,gBACH40C,GAAI,aACJh9C,EAAG,WACHi9C,GAAI,aACJC,EAAG,UACHC,GAAI,WACJh5B,EAAG,QACHi5B,GAAI,UACJC,EAAG,UACHC,GAAI,YACJC,EAAG,SACHC,GAAI,YAERC,uBAAwB,uBACxBC,QAAS,SAAUC,GACf,IAAI/zC,EAAI+zC,EAAS,GAWjB,OAAOA,GAT6B,MAAxBA,EAAS,IAAO,IACd,KACM,IAAN/zC,EACA,KACM,IAANA,EACA,KACM,IAANA,EACA,KACA,SA7DgB1e,CAAQ,EAAQ,8FCGlD,SAAWkiD,GAAU,aAIdA,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,wFAAwFttC,MAC5F,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,2DAA2DxtC,MACjE,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,SACJC,IAAK,YACLC,EAAG,aACHC,GAAI,cACJC,IAAK,qBACLC,KAAM,4BAEVC,SAAU,CACNC,QAAS,gBACTC,QAAS,mBACTC,SAAU,eACVC,QAAS,oBACTC,SAAU,sBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN30C,EAAG,gBACH40C,GAAI,aACJh9C,EAAG,WACHi9C,GAAI,aACJC,EAAG,UACHC,GAAI,WACJh5B,EAAG,QACHi5B,GAAI,UACJC,EAAG,UACHC,GAAI,YACJC,EAAG,SACHC,GAAI,YAERC,uBAAwB,uBACxBC,QAAS,SAAUC,GACf,IAAI/zC,EAAI+zC,EAAS,GAWjB,OAAOA,GAT6B,MAAxBA,EAAS,IAAO,IACd,KACM,IAAN/zC,EACA,KACM,IAANA,EACA,KACM,IAANA,EACA,KACA,OAGlBg0C,KAAM,CACFC,IAAK,EACLC,IAAK,KAlEyB5yD,CAAQ,EAAQ,8FCGlD,SAAWkiD,GAAU,aAIdA,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,wFAAwFttC,MAC5F,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,2DAA2DxtC,MACjE,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,SACJC,IAAK,YACLC,EAAG,aACHC,GAAI,cACJC,IAAK,qBACLC,KAAM,4BAEVC,SAAU,CACNC,QAAS,gBACTC,QAAS,mBACTC,SAAU,eACVC,QAAS,oBACTC,SAAU,sBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN30C,EAAG,gBACH40C,GAAI,aACJh9C,EAAG,WACHi9C,GAAI,aACJC,EAAG,UACHC,GAAI,WACJh5B,EAAG,QACHi5B,GAAI,UACJC,EAAG,UACHC,GAAI,YACJC,EAAG,SACHC,GAAI,YAERC,uBAAwB,uBACxBC,QAAS,SAAUC,GACf,IAAI/zC,EAAI+zC,EAAS,GAWjB,OAAOA,GAT6B,MAAxBA,EAAS,IAAO,IACd,KACM,IAAN/zC,EACA,KACM,IAANA,EACA,KACM,IAANA,EACA,KACA,OAGlBg0C,KAAM,CACFC,IAAK,EACLC,IAAK,KAlEyB5yD,CAAQ,EAAQ,8FCGlD,SAAWkiD,GAAU,aAIdA,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,wFAAwFttC,MAC5F,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,2DAA2DxtC,MACjE,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,gBACTC,QAAS,mBACTC,SAAU,eACVC,QAAS,oBACTC,SAAU,sBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN30C,EAAG,gBACH40C,GAAI,aACJh9C,EAAG,WACHi9C,GAAI,aACJC,EAAG,UACHC,GAAI,WACJh5B,EAAG,QACHi5B,GAAI,UACJC,EAAG,UACHC,GAAI,YACJC,EAAG,SACHC,GAAI,YAERC,uBAAwB,uBACxBC,QAAS,SAAUC,GACf,IAAI/zC,EAAI+zC,EAAS,GAWjB,OAAOA,GAT6B,MAAxBA,EAAS,IAAO,IACd,KACM,IAAN/zC,EACA,KACM,IAANA,EACA,KACM,IAANA,EACA,KACA,OAGlBg0C,KAAM,CACFC,IAAK,EACLC,IAAK,KAlEyB5yD,CAAQ,EAAQ,2FCMlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,6FAA6FttC,MACjG,KAEJutC,YAAa,oDAAoDvtC,MAAM,KACvEwtC,SAAU,qDAAqDxtC,MAAM,KACrEytC,cAAe,gCAAgCztC,MAAM,KACrD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,4BACJC,IAAK,kCACLC,KAAM,2CACNyE,KAAM,uCAEVrF,cAAe,cACfC,KAAM,SAAU99C,GACZ,MAAyC,MAAlCA,EAAMnN,OAAO,GAAGyhB,eAE3BypC,SAAU,SAAUC,EAAOC,EAASC,GAChC,OAAIF,EAAQ,GACDE,EAAU,SAAW,SAErBA,EAAU,SAAW,UAGpCQ,SAAU,CACNC,QAAS,iBACTC,QAAS,iBACTC,SAAU,gBACVC,QAAS,iBACTC,SAAU,2BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,UACRC,KAAM,WACN30C,EAAG,kBACH40C,GAAI,cACJh9C,EAAG,aACHi9C,GAAI,aACJC,EAAG,WACHC,GAAI,WACJh5B,EAAG,WACHi5B,GAAI,WACJC,EAAG,aACHC,GAAI,aACJC,EAAG,WACHC,GAAI,YAERC,uBAAwB,WACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA/DyB5yD,CAAQ,EAAQ,8FCDlD,SAAWkiD,GAAU,aAIzB,IAAIuU,EAAiB,8DAA8D7zC,MAC3E,KAEJutC,EAAc,kDAAkDvtC,MAAM,KACtEmyC,EAAc,CACV,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,SAEJC,EAAc,mLAEP9S,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,2FAA2FttC,MAC/F,KAEJutC,YAAa,SAAUr7C,EAAG4S,GACtB,OAAK5S,EAEM,QAAQmO,KAAKyE,GACbyoC,EAAYr7C,EAAEshD,SAEdK,EAAe3hD,EAAEshD,SAJjBK,GAOfzB,YAAaA,EACbR,iBAAkBQ,EAClBK,kBAAmB,+FACnBC,uBAAwB,0FACxBP,YAAaA,EACbQ,gBAAiBR,EACjBS,iBAAkBT,EAClB3E,SAAU,uDAAuDxtC,MAAM,KACvEytC,cAAe,qCAAqCztC,MAAM,KAC1D0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,SACJC,IAAK,YACLC,EAAG,aACHC,GAAI,wBACJC,IAAK,+BACLC,KAAM,sCAEVC,SAAU,CACNC,QAAS,WACL,MAAO,aAAgC,IAAjBvxD,KAAK4wD,QAAgB,IAAM,IAAM,QAE3DY,QAAS,WACL,MAAO,gBAAmC,IAAjBxxD,KAAK4wD,QAAgB,IAAM,IAAM,QAE9Da,SAAU,WACN,MAAO,cAAiC,IAAjBzxD,KAAK4wD,QAAgB,IAAM,IAAM,QAE5Dc,QAAS,WACL,MAAO,cAAiC,IAAjB1xD,KAAK4wD,QAAgB,IAAM,IAAM,QAE5De,SAAU,WACN,MACI,0BACkB,IAAjB3xD,KAAK4wD,QAAgB,IAAM,IAC5B,QAGRgB,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,UACN30C,EAAG,gBACH40C,GAAI,cACJh9C,EAAG,YACHi9C,GAAI,aACJC,EAAG,WACHC,GAAI,WACJh5B,EAAG,SACHi5B,GAAI,UACJiC,EAAG,aACHC,GAAI,aACJjC,EAAG,SACHC,GAAI,WACJC,EAAG,SACHC,GAAI,WAERC,uBAAwB,WACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAvGyB5yD,CAAQ,EAAQ,8FCIlD,SAAWkiD,GAAU,aAIzB,IAAIuU,EAAiB,8DAA8D7zC,MAC3E,KAEJutC,EAAc,kDAAkDvtC,MAAM,KACtEmyC,EAAc,CACV,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,SAEJC,EAAc,mLAEP9S,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,2FAA2FttC,MAC/F,KAEJutC,YAAa,SAAUr7C,EAAG4S,GACtB,OAAK5S,EAEM,QAAQmO,KAAKyE,GACbyoC,EAAYr7C,EAAEshD,SAEdK,EAAe3hD,EAAEshD,SAJjBK,GAOfzB,YAAaA,EACbR,iBAAkBQ,EAClBK,kBAAmB,+FACnBC,uBAAwB,0FACxBP,YAAaA,EACbQ,gBAAiBR,EACjBS,iBAAkBT,EAClB3E,SAAU,uDAAuDxtC,MAAM,KACvEytC,cAAe,qCAAqCztC,MAAM,KAC1D0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,wBACJC,IAAK,6BACLC,KAAM,oCAEVC,SAAU,CACNC,QAAS,WACL,MAAO,aAAgC,IAAjBvxD,KAAK4wD,QAAgB,IAAM,IAAM,QAE3DY,QAAS,WACL,MAAO,gBAAmC,IAAjBxxD,KAAK4wD,QAAgB,IAAM,IAAM,QAE9Da,SAAU,WACN,MAAO,cAAiC,IAAjBzxD,KAAK4wD,QAAgB,IAAM,IAAM,QAE5Dc,QAAS,WACL,MAAO,cAAiC,IAAjB1xD,KAAK4wD,QAAgB,IAAM,IAAM,QAE5De,SAAU,WACN,MACI,0BACkB,IAAjB3xD,KAAK4wD,QAAgB,IAAM,IAC5B,QAGRgB,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,UACN30C,EAAG,gBACH40C,GAAI,cACJh9C,EAAG,YACHi9C,GAAI,aACJC,EAAG,WACHC,GAAI,WACJh5B,EAAG,SACHi5B,GAAI,UACJiC,EAAG,aACHC,GAAI,aACJjC,EAAG,SACHC,GAAI,WACJC,EAAG,SACHC,GAAI,WAERC,uBAAwB,WACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,GAET8D,YAAa,mBAzGqB12D,CAAQ,EAAQ,8FCIlD,SAAWkiD,GAAU,aAIzB,IAAIuU,EAAiB,8DAA8D7zC,MAC3E,KAEJutC,EAAc,kDAAkDvtC,MAAM,KACtEmyC,EAAc,CACV,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,SAEJC,EAAc,mLAEP9S,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,2FAA2FttC,MAC/F,KAEJutC,YAAa,SAAUr7C,EAAG4S,GACtB,OAAK5S,EAEM,QAAQmO,KAAKyE,GACbyoC,EAAYr7C,EAAEshD,SAEdK,EAAe3hD,EAAEshD,SAJjBK,GAOfzB,YAAaA,EACbR,iBAAkBQ,EAClBK,kBAAmB,+FACnBC,uBAAwB,0FACxBP,YAAaA,EACbQ,gBAAiBR,EACjBS,iBAAkBT,EAClB3E,SAAU,uDAAuDxtC,MAAM,KACvEytC,cAAe,qCAAqCztC,MAAM,KAC1D0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,SACJC,IAAK,YACLC,EAAG,aACHC,GAAI,wBACJC,IAAK,+BACLC,KAAM,sCAEVC,SAAU,CACNC,QAAS,WACL,MAAO,aAAgC,IAAjBvxD,KAAK4wD,QAAgB,IAAM,IAAM,QAE3DY,QAAS,WACL,MAAO,gBAAmC,IAAjBxxD,KAAK4wD,QAAgB,IAAM,IAAM,QAE9Da,SAAU,WACN,MAAO,cAAiC,IAAjBzxD,KAAK4wD,QAAgB,IAAM,IAAM,QAE5Dc,QAAS,WACL,MAAO,cAAiC,IAAjB1xD,KAAK4wD,QAAgB,IAAM,IAAM,QAE5De,SAAU,WACN,MACI,0BACkB,IAAjB3xD,KAAK4wD,QAAgB,IAAM,IAC5B,QAGRgB,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,UACN30C,EAAG,gBACH40C,GAAI,cACJh9C,EAAG,YACHi9C,GAAI,aACJC,EAAG,WACHC,GAAI,WACJh5B,EAAG,SACHi5B,GAAI,UACJiC,EAAG,aACHC,GAAI,aACJjC,EAAG,SACHC,GAAI,WACJC,EAAG,SACHC,GAAI,WAERC,uBAAwB,WACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAvGyB5yD,CAAQ,EAAQ,2FCElD,SAAWkiD,GAAU,aAIzB,IAAIuU,EAAiB,8DAA8D7zC,MAC3E,KAEJutC,EAAc,kDAAkDvtC,MAAM,KACtEmyC,EAAc,CACV,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,SAEJC,EAAc,mLAET9S,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,2FAA2FttC,MAC/F,KAEJutC,YAAa,SAAUr7C,EAAG4S,GACtB,OAAK5S,EAEM,QAAQmO,KAAKyE,GACbyoC,EAAYr7C,EAAEshD,SAEdK,EAAe3hD,EAAEshD,SAJjBK,GAOfzB,YAAaA,EACbR,iBAAkBQ,EAClBK,kBAAmB,+FACnBC,uBAAwB,0FACxBP,YAAaA,EACbQ,gBAAiBR,EACjBS,iBAAkBT,EAClB3E,SAAU,uDAAuDxtC,MAAM,KACvEytC,cAAe,qCAAqCztC,MAAM,KAC1D0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,wBACJC,IAAK,6BACLC,KAAM,oCAEVC,SAAU,CACNC,QAAS,WACL,MAAO,aAAgC,IAAjBvxD,KAAK4wD,QAAgB,IAAM,IAAM,QAE3DY,QAAS,WACL,MAAO,gBAAmC,IAAjBxxD,KAAK4wD,QAAgB,IAAM,IAAM,QAE9Da,SAAU,WACN,MAAO,cAAiC,IAAjBzxD,KAAK4wD,QAAgB,IAAM,IAAM,QAE5Dc,QAAS,WACL,MAAO,cAAiC,IAAjB1xD,KAAK4wD,QAAgB,IAAM,IAAM,QAE5De,SAAU,WACN,MACI,0BACkB,IAAjB3xD,KAAK4wD,QAAgB,IAAM,IAC5B,QAGRgB,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,UACN30C,EAAG,gBACH40C,GAAI,cACJh9C,EAAG,YACHi9C,GAAI,aACJC,EAAG,WACHC,GAAI,WACJh5B,EAAG,SACHi5B,GAAI,UACJiC,EAAG,aACHC,GAAI,aACJjC,EAAG,SACHC,GAAI,WACJC,EAAG,SACHC,GAAI,WAERC,uBAAwB,WACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,GAET8D,YAAa,mBAzGqB12D,CAAQ,EAAQ,2FCIlD,SAAWkiD,GAAU,aAIzB,SAAS6T,EAAoBtD,EAAQQ,EAAettD,EAAKutD,GACrD,IAAIxrC,EAAS,CACTxK,EAAG,CAAC,eAAgB,cAAe,iBACnC40C,GAAI,CAACW,EAAS,UAAWA,EAAS,YAClC39C,EAAG,CAAC,aAAc,aAClBi9C,GAAI,CAACU,EAAS,UAAWA,EAAS,YAClCT,EAAG,CAAC,YAAa,YAAa,YAC9BC,GAAI,CAACQ,EAAS,SAAUA,EAAS,UACjCx5B,EAAG,CAAC,YAAa,YACjBk5B,EAAG,CAAC,UAAW,WAAY,WAC3BC,GAAI,CAACK,EAAS,OAAQA,EAAS,SAC/BJ,EAAG,CAAC,YAAa,QAAS,aAC1BC,GAAI,CAACG,EAAS,SAAUA,EAAS,YAErC,OAAIQ,EACOvrC,EAAO/hB,GAAK,GAAK+hB,EAAO/hB,GAAK,GAAK+hB,EAAO/hB,GAAK,GAElDutD,EAAWxrC,EAAO/hB,GAAK,GAAK+hB,EAAO/hB,GAAK,GAG1Cu8C,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,6FAA6FttC,MACjG,KAEJutC,YAAa,6DAA6DvtC,MACtE,KAEJwtC,SAAU,iEAAiExtC,MACvE,KAEJytC,cAAe,gBAAgBztC,MAAM,KACrC0tC,YAAa,gBAAgB1tC,MAAM,KACnCiuC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,eACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,aACTC,QAAS,cACTC,SAAU,qBACVC,QAAS,aACTC,SAAU,oBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,YACRC,KAAM,YACN30C,EAAG64C,EACHjE,GAAIiE,EACJjhD,EAAGihD,EACHhE,GAAIgE,EACJ/D,EAAG+D,EACH9D,GAAI8D,EACJ98B,EAAG88B,EACH7D,GAAI,WACJC,EAAG4D,EACH3D,GAAI2D,EACJ1D,EAAG0D,EACHzD,GAAIyD,GAERxD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA3EyB5yD,CAAQ,EAAQ,2FCElD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,+FAA+FttC,MACnG,KAEJutC,YAAa,8DAA8DvtC,MACvE,KAEJ6xC,kBAAkB,EAClBrE,SAAU,sEAAsExtC,MAC5E,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,0BACJC,IAAK,gCACLC,KAAM,sCACN5+B,EAAG,WACHmjC,GAAI,oBACJC,IAAK,0BACLC,KAAM,gCAEVxE,SAAU,CACNC,QAAS,kBACTC,QAAS,mBACTC,SAAU,gBACVC,QAAS,kBACTC,SAAU,0BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,WACRC,KAAM,WACN30C,EAAG,iBACH40C,GAAI,aACJh9C,EAAG,aACHi9C,GAAI,YACJC,EAAG,WACHC,GAAI,UACJh5B,EAAG,WACHi5B,GAAI,UACJC,EAAG,eACHC,GAAI,cACJC,EAAG,WACHC,GAAI,WAERC,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA7DyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIzB,IAAIsR,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAGJxR,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,wEAAwEttC,MAC5E,KAEJutC,YAAa,wEAAwEvtC,MACjF,KAEJwtC,SAAU,qDAAoExtC,MAC1E,KAEJytC,cAAe,qDAAoEztC,MAC/E,KAEJ0tC,YAAa,gBAAgB1tC,MAAM,KACnCwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVZ,cAAe,wBACfC,KAAM,SAAU99C,GACZ,MAAO,aAAauQ,KAAKvQ,IAE7B+9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,GACA,aAEA,cAGfjC,SAAU,CACNC,QAAS,kBACTC,QAAS,iBACTC,SAAU,iBACVC,QAAS,kBACTC,SAAU,uBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN30C,EAAG,YACH40C,GAAI,WACJh9C,EAAG,WACHi9C,GAAI,WACJC,EAAG,UACHC,GAAI,UACJh5B,EAAG,SACHi5B,GAAI,SACJC,EAAG,SACHC,GAAI,SACJC,EAAG,SACHC,GAAI,UAERmB,SAAU,SAAUpuD,GAChB,OAAOA,EACFwP,QAAQ,UAAU,SAAUiH,GACzB,OAAO43C,EAAU53C,MAEpBjH,QAAQ,KAAM,MAEvB0+C,WAAY,SAAUluD,GAClB,OAAOA,EACFwP,QAAQ,OAAO,SAAUiH,GACtB,OAAO03C,EAAU13C,MAEpBjH,QAAQ,KAAM,MAEvB09C,uBAAwB,WACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,MA5GyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIzB,IAAIyU,EAAc,wEAAwE/zC,MAClF,KAEJg0C,EAAgB,CACZ,QACA,QACA,SACA,SACA,SACA,SACA,SACAD,EAAY,GACZA,EAAY,GACZA,EAAY,IAEpB,SAASlB,EAAUhD,EAAQQ,EAAettD,EAAKutD,GAC3C,IAAI9sD,EAAS,GACb,OAAQT,GACJ,IAAK,IACD,OAAOutD,EAAW,oBAAsB,kBAC5C,IAAK,KACD9sD,EAAS8sD,EAAW,WAAa,WACjC,MACJ,IAAK,IACD,OAAOA,EAAW,WAAa,WACnC,IAAK,KACD9sD,EAAS8sD,EAAW,WAAa,YACjC,MACJ,IAAK,IACD,OAAOA,EAAW,SAAW,QACjC,IAAK,KACD9sD,EAAS8sD,EAAW,SAAW,SAC/B,MACJ,IAAK,IACD,OAAOA,EAAW,SAAW,QACjC,IAAK,KACD9sD,EAAS8sD,EAAW,SAAW,SAC/B,MACJ,IAAK,IACD,OAAOA,EAAW,YAAc,WACpC,IAAK,KACD9sD,EAAS8sD,EAAW,YAAc,YAClC,MACJ,IAAK,IACD,OAAOA,EAAW,SAAW,QACjC,IAAK,KACD9sD,EAAS8sD,EAAW,SAAW,SAIvC,OAEJ,SAAsBT,EAAQS,GAC1B,OAAOT,EAAS,GACVS,EACI0D,EAAcnE,GACdkE,EAAYlE,GAChBA,EARGoE,CAAapE,EAAQS,GAAY,IAAM9sD,EAW3C87C,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,2GAA2GttC,MAC/G,KAEJutC,YAAa,uEAAuEvtC,MAChF,KAEJwtC,SAAU,qEAAqExtC,MAC3E,KAEJytC,cAAe,uBAAuBztC,MAAM,KAC5C0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,mBACJC,IAAK,gCACLC,KAAM,sCACN5+B,EAAG,WACHmjC,GAAI,cACJC,IAAK,2BACLC,KAAM,iCAEVxE,SAAU,CACNC,QAAS,oBACTC,QAAS,sBACTC,SAAU,gBACVC,QAAS,mBACTC,SAAU,4BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,YACRC,KAAM,YACN30C,EAAGu4C,EACH3D,GAAI2D,EACJ3gD,EAAG2gD,EACH1D,GAAI0D,EACJzD,EAAGyD,EACHxD,GAAIwD,EACJx8B,EAAGw8B,EACHvD,GAAIuD,EACJtD,EAAGsD,EACHrD,GAAIqD,EACJpD,EAAGoD,EACHnD,GAAImD,GAERlD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAvHyB5yD,CAAQ,EAAQ,4FCIlD,SAAWkiD,GAAU,aAIfA,EAAO+N,aAAa,MAAO,CACjCC,OAAQ,0FAA0FttC,MAC9F,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,yDAAyDxtC,MAC/D,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,wBAAwB1tC,MAAM,KAC3CiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,YACHC,GAAI,eACJC,IAAK,qBACLC,KAAM,6BAEVC,SAAU,CACNC,QAAS,oBACTC,QAAS,gBACTC,SAAU,0BACVC,QAAS,eACTC,SAAU,4BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,gBACRC,KAAM,mBACN30C,EAAG,gBACH40C,GAAI,aACJh9C,EAAG,eACHi9C,GAAI,YACJC,EAAG,aACHC,GAAI,UACJh5B,EAAG,aACHi5B,GAAI,UACJC,EAAG,cACHC,GAAI,WACJC,EAAG,aACHC,GAAI,WAERC,uBAAwB,UACxBC,QAAS,SAAUC,GACf,OAAOA,GAEXC,KAAM,CACFC,IAAK,EACLC,IAAK,KAvDyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,qFAAqFttC,MACzF,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,4EAA4ExtC,MAClF,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,4BAEVC,SAAU,CACNC,QAAS,iBACTC,QAAS,oBACTC,SAAU,gBACVC,QAAS,kBACTC,SAAU,wBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,YACN30C,EAAG,YACH40C,GAAI,cACJh9C,EAAG,eACHi9C,GAAI,cACJC,EAAG,WACHC,GAAI,WACJh5B,EAAG,YACHi5B,GAAI,WACJC,EAAG,cACHC,GAAI,aACJC,EAAG,UACHC,GAAI,SAERC,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KArDyB5yD,CAAQ,EAAQ,8FCElD,SAAWkiD,GAAU,aAIdA,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,uFAAuFttC,MAC3F,KAEJutC,YAAa,iEAAiEvtC,MAC1E,KAEJ6xC,kBAAkB,EAClBrE,SAAU,sDAAsDxtC,MAAM,KACtEytC,cAAe,qCAAqCztC,MAAM,KAC1D0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,qBACTC,QAAS,gBACTC,SAAU,cACVC,QAAS,cACTC,SAAU,sBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,UACRC,KAAM,YACN30C,EAAG,oBACH40C,GAAI,cACJh9C,EAAG,aACHi9C,GAAI,aACJC,EAAG,YACHC,GAAI,YACJh5B,EAAG,UACHi5B,GAAI,WACJC,EAAG,UACHC,GAAI,UACJC,EAAG,QACHC,GAAI,UAERC,uBAAwB,gBACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GAEJ,QACA,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,MACL,IAAK,IACD,OAAOzB,GAAqB,IAAXA,EAAe,KAAO,KAG3C,IAAK,IACL,IAAK,IACD,OAAOA,GAAqB,IAAXA,EAAe,KAAO,SAlEjBzyD,CAAQ,EAAQ,8FCGlD,SAAWkiD,GAAU,aAIdA,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,uFAAuFttC,MAC3F,KAEJutC,YAAa,iEAAiEvtC,MAC1E,KAEJ6xC,kBAAkB,EAClBrE,SAAU,sDAAsDxtC,MAAM,KACtEytC,cAAe,qCAAqCztC,MAAM,KAC1D0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,qBACTC,QAAS,gBACTC,SAAU,cACVC,QAAS,cACTC,SAAU,sBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,UACRC,KAAM,YACN30C,EAAG,oBACH40C,GAAI,cACJh9C,EAAG,aACHi9C,GAAI,aACJC,EAAG,YACHC,GAAI,YACJh5B,EAAG,UACHi5B,GAAI,WACJC,EAAG,UACHC,GAAI,UACJC,EAAG,QACHC,GAAI,UAERC,uBAAwB,gBACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GAEJ,QACA,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,MACL,IAAK,IACD,OAAOzB,GAAqB,IAAXA,EAAe,KAAO,KAG3C,IAAK,IACL,IAAK,IACD,OAAOA,GAAqB,IAAXA,EAAe,KAAO,OAGnDC,KAAM,CACFC,IAAK,EACLC,IAAK,KAvEyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIzB,IAEI8S,EAAc,yKACdD,EAAc,CACV,SACA,SACA,SACA,QACA,QACA,SACA,SACA,SACA,SACA,QACA,QACA,SAGC7S,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,uFAAuFttC,MAC3F,KAEJutC,YAAa,iEAAiEvtC,MAC1E,KAEJoyC,YAAaA,EACbR,iBAAkBQ,EAClBK,kBA3BoB,2FA4BpBC,uBA3ByB,oFA4BzBP,YAAaA,EACbQ,gBAAiBR,EACjBS,iBAAkBT,EAClB3E,SAAU,sDAAsDxtC,MAAM,KACtEytC,cAAe,qCAAqCztC,MAAM,KAC1D0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,qBACTC,QAAS,gBACTC,SAAU,cACVC,QAAS,cACTC,SAAU,sBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,UACRC,KAAM,YACN30C,EAAG,oBACH40C,GAAI,cACJh9C,EAAG,aACHi9C,GAAI,aACJC,EAAG,YACHC,GAAI,YACJh5B,EAAG,UACHi5B,GAAI,WACJiC,EAAG,cACHC,GAAI,cACJjC,EAAG,UACHC,GAAI,UACJC,EAAG,QACHC,GAAI,UAERC,uBAAwB,eACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GAIJ,IAAK,IACD,OAAOzB,GAAqB,IAAXA,EAAe,KAAO,IAG3C,QACA,IAAK,IACL,IAAK,IACL,IAAK,MACL,IAAK,IACD,OAAOA,GAAqB,IAAXA,EAAe,KAAO,KAG3C,IAAK,IACL,IAAK,IACD,OAAOA,GAAqB,IAAXA,EAAe,KAAO,OAGnDC,KAAM,CACFC,IAAK,EACLC,IAAK,KAtGyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIzB,IAAI4U,EAAsB,6DAA6Dl0C,MAC/E,KAEJm0C,EAAyB,kDAAkDn0C,MACvE,KAGCs/B,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,iGAAiGttC,MACrG,KAEJutC,YAAa,SAAUr7C,EAAG4S,GACtB,OAAK5S,EAEM,QAAQmO,KAAKyE,GACbqvC,EAAuBjiD,EAAEshD,SAEzBU,EAAoBhiD,EAAEshD,SAJtBU,GAOfrC,kBAAkB,EAClBrE,SAAU,wDAAwDxtC,MAC9D,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,gBACTC,QAAS,gBACTC,SAAU,eACVC,QAAS,iBACTC,SAAU,wBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,SACN30C,EAAG,mBACH40C,GAAI,cACJh9C,EAAG,YACHi9C,GAAI,aACJC,EAAG,WACHC,GAAI,WACJh5B,EAAG,UACHi5B,GAAI,WACJC,EAAG,aACHC,GAAI,aACJC,EAAG,WACHC,GAAI,cAERC,uBAAwB,kBACxBC,QAAS,SAAUC,GACf,OACIA,GACY,IAAXA,GAA2B,IAAXA,GAAgBA,GAAU,GAAK,MAAQ,OAGhEC,KAAM,CACFC,IAAK,EACLC,IAAK,KA3EyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aA4ChBA,EAAO+N,aAAa,KAAM,CAC/BC,OAzCS,CACL,SACA,UACA,QACA,UACA,YACA,YACA,OACA,SACA,eACA,mBACA,UACA,WA8BJC,YA5Bc,CACV,MACA,QACA,OACA,MACA,OACA,QACA,OACA,MACA,OACA,OACA,OACA,QAiBJsE,kBAAkB,EAClBrE,SAhBW,CACP,eACA,WACA,WACA,cACA,YACA,YACA,eAUJC,cARgB,CAAC,OAAQ,OAAQ,QAAS,OAAQ,OAAQ,QAAS,QASnEC,YARc,CAAC,KAAM,KAAM,KAAM,KAAM,KAAM,IAAK,MASlDO,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,gBACTC,QAAS,kBACTC,SAAU,eACVC,QAAS,eACTC,SAAU,2BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,OACRC,KAAM,YACN30C,EAAG,gBACH40C,GAAI,aACJh9C,EAAG,UACHi9C,GAAI,aACJC,EAAG,iBACHC,GAAI,oBACJh5B,EAAG,KACHi5B,GAAI,QACJC,EAAG,KACHC,GAAI,YACJC,EAAG,SACHC,GAAI,aAERC,uBAAwB,mBACxBC,QAAS,SAAUC,GAEf,OAAOA,GADiB,IAAXA,EAAe,IAAMA,EAAS,IAAO,EAAI,KAAO,OAGjEC,KAAM,CACFC,IAAK,EACLC,IAAK,KA7FyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aA4ChBA,EAAO+N,aAAa,KAAM,CAC/BC,OAzCS,CACL,gBACA,aACA,UACA,aACA,aACA,eACA,cACA,cACA,eACA,aACA,eACA,gBA8BJC,YA5Bc,CACV,OACA,OACA,OACA,OACA,OACA,OACA,OACA,MACA,OACA,OACA,OACA,QAiBJsE,kBAAkB,EAClBrE,SAhBW,CACP,cACA,UACA,UACA,YACA,YACA,WACA,eAUJC,cARgB,CAAC,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,OAS3DC,YARc,CAAC,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,MASnDO,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,oBACTC,QAAS,sBACTC,SAAU,gBACVC,QAAS,iBACTC,SAAU,6BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,YACRC,KAAM,gBACN30C,EAAG,gBACH40C,GAAI,YACJh9C,EAAG,UACHi9C,GAAI,gBACJC,EAAG,OACHC,GAAI,aACJh5B,EAAG,QACHi5B,GAAI,WACJC,EAAG,OACHC,GAAI,YACJC,EAAG,WACHC,GAAI,eAERC,uBAAwB,mBACxBC,QAAS,SAAUC,GAEf,OAAOA,GADiB,IAAXA,EAAe,IAAMA,EAAS,IAAO,EAAI,KAAO,OAGjEC,KAAM,CACFC,IAAK,EACLC,IAAK,KA7FyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,yFAAyFttC,MAC7F,KAEJutC,YAAa,8DAA8DvtC,MACvE,KAEJ6xC,kBAAkB,EAClBrE,SAAU,mDAAmDxtC,MAAM,KACnEytC,cAAe,qCAAqCztC,MAAM,KAC1D0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,wBACJC,IAAK,6BACLC,KAAM,oCAEVC,SAAU,CACNC,QAAS,WACL,MAAO,UAA6B,IAAjBvxD,KAAK4wD,QAAgB,KAAO,KAAO,QAE1DY,QAAS,WACL,MAAO,UAA6B,IAAjBxxD,KAAK4wD,QAAgB,KAAO,KAAO,QAE1Da,SAAU,WACN,MAAO,UAA6B,IAAjBzxD,KAAK4wD,QAAgB,KAAO,KAAO,QAE1Dc,QAAS,WACL,MAAO,UAA6B,IAAjB1xD,KAAK4wD,QAAgB,IAAM,KAAO,QAEzDe,SAAU,WACN,MACI,qBAAwC,IAAjB3xD,KAAK4wD,QAAgB,KAAO,KAAO,QAGlEgB,SAAU,KAEdC,aAAc,CACVC,OAAQ,SAAU9gD,GACd,OAA0B,IAAtBA,EAAI9C,QAAQ,MACL,IAAM8C,EAEV,MAAQA,GAEnB+gD,KAAM,SACN30C,EAAG,eACH40C,GAAI,cACJh9C,EAAG,YACHi9C,GAAI,aACJC,EAAG,YACHC,GAAI,WACJh5B,EAAG,SACHi5B,GAAI,UACJC,EAAG,SACHC,GAAI,WACJC,EAAG,SACHC,GAAI,WAERC,uBAAwB,WACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAxEyB5yD,CAAQ,EAAQ,iGCGlD,SAAWkiD,GAAU,aAIzB,SAAS6T,EAAoBtD,EAAQQ,EAAettD,EAAKutD,GACrD,IAAIxrC,EAAS,CACTxK,EAAG,CAAC,kBAAmB,cACvB40C,GAAI,CAACW,EAAS,aAAcA,EAAS,UACrC39C,EAAG,CAAC,aAAc,YAClBi9C,GAAI,CAACU,EAAS,YAAaA,EAAS,WACpCT,EAAG,CAAC,WAAY,SAChBC,GAAI,CAACQ,EAAS,UAAWA,EAAS,SAClCx5B,EAAG,CAAC,YAAa,UACjBi5B,GAAI,CAACO,EAAS,WAAYA,EAAS,QACnCN,EAAG,CAAC,gBAAiB,aACrBC,GAAI,CAACK,EAAS,cAAeA,EAAS,WACtCJ,EAAG,CAAC,aAAc,WAClBC,GAAI,CAACG,EAAS,YAAaA,EAAS,YAExC,OAAOS,EAAWxrC,EAAO/hB,GAAK,GAAK+hB,EAAO/hB,GAAK,GAGrCu8C,EAAO+N,aAAa,WAAY,CAC1CC,OAAQ,CACJ6D,WAAY,wFAAwFnxC,MAChG,KAEJ8E,OAAQ,mJAAmJ9E,MACvJ,KAEJoxC,SAAU,mBAEd7D,YAAa,4EAA4EvtC,MACrF,KAEJ6xC,kBAAkB,EAClBrE,SAAU,qDAAqDxtC,MAAM,KACrEytC,cAAe,4CAA4CztC,MAAM,KACjE0tC,YAAa,wBAAwB1tC,MAAM,KAC3CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,kBACJC,IAAK,qBACLC,EAAG,aACHC,GAAI,cACJC,IAAK,8BACLC,KAAM,uCACNyE,KAAM,oCAEVxE,SAAU,CACNC,QAAS,WACTC,QAAS,eACTC,SAAU,qBACVC,QAAS,WACTC,SAAU,qBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,KACRC,KAAM,UACN30C,EAAG64C,EACHjE,GAAIiE,EACJjhD,EAAGihD,EACHhE,GAAIgE,EACJ/D,EAAG+D,EACH9D,GAAI8D,EACJ98B,EAAG88B,EACH7D,GAAI6D,EACJ5D,EAAG4D,EACH3D,GAAI2D,EACJ1D,EAAG0D,EACHzD,GAAIyD,GAERxD,uBAAwB,eACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GAEJ,IAAK,IACD,OAAOzB,EAAS,MACpB,QACA,IAAK,IACL,IAAK,IACL,IAAK,MACL,IAAK,IACL,IAAK,IACL,IAAK,IACD,OAAOA,IAGnBC,KAAM,CACFC,IAAK,EACLC,IAAK,GAETrC,cAAe,4BACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,SAAb5C,EACO4C,EAAO,EAAIA,EAAOA,EAAO,GACZ,WAAb5C,EACA4C,EACa,YAAb5C,EACA4C,EAAO,GAAKA,EAAOA,EAAO,GACb,UAAb5C,EACA4C,EAAO,QADX,GAIX5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,OACAA,EAAO,GACP,SACAA,EAAO,GACP,UACAA,EAAO,GACP,QAEA,UAzHmBrzD,CAAQ,EAAQ,iGCGlD,SAAWkiD,GAAU,aAIzB,SAAS6T,EAAoBtD,EAAQQ,EAAettD,EAAKutD,GACrD,IAAIxrC,EAAS,CACTxK,EAAG,CAAC,qBAAsB,iBAC1B40C,GAAI,CAACW,EAAS,cAAeA,EAAS,WACtC39C,EAAG,CAAC,aAAc,YAClBi9C,GAAI,CAACU,EAAS,YAAaA,EAAS,WACpCT,EAAG,CAAC,YAAa,UACjBC,GAAI,CAACQ,EAAS,WAAYA,EAAS,UACnCx5B,EAAG,CAAC,YAAa,UACjBi5B,GAAI,CAACO,EAAS,WAAYA,EAAS,QACnCN,EAAG,CAAC,eAAgB,aACpBC,GAAI,CAACK,EAAS,cAAeA,EAAS,WACtCJ,EAAG,CAAC,aAAc,YAClBC,GAAI,CAACG,EAAS,YAAaA,EAAS,YAExC,OAAOS,EAAWxrC,EAAO/hB,GAAK,GAAK+hB,EAAO/hB,GAAK,GAGrCu8C,EAAO+N,aAAa,WAAY,CAC1CC,OAAQ,CACJ6D,WAAY,4EAA4EnxC,MACpF,KAEJ8E,OAAQ,wIAAwI9E,MAC5I,KAEJoxC,SAAU,mBAEd7D,YAAa,4DAA4DvtC,MACrE,KAEJ6xC,kBAAkB,EAClBrE,SAAU,uDAAuDxtC,MAAM,KACvEytC,cAAe,qCAAqCztC,MAAM,KAC1D0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,iBACJC,IAAK,oBACLC,EAAG,aACHC,GAAI,cACJC,IAAK,6BACLC,KAAM,sCACNyE,KAAM,mCAEVxE,SAAU,CACNC,QAAS,WACTC,QAAS,cACTC,SAAU,sBACVC,QAAS,WACTC,SAAU,sBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,KACRC,KAAM,UACN30C,EAAG64C,EACHjE,GAAIiE,EACJjhD,EAAGihD,EACHhE,GAAIgE,EACJ/D,EAAG+D,EACH9D,GAAI8D,EACJ98B,EAAG88B,EACH7D,GAAI6D,EACJ5D,EAAG4D,EACH3D,GAAI2D,EACJ1D,EAAG0D,EACHzD,GAAIyD,GAERxD,uBAAwB,cACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GAEJ,IAAK,IACD,OAAOzB,EAAS,KACpB,QACA,IAAK,IACL,IAAK,IACL,IAAK,MACL,IAAK,IACL,IAAK,IACL,IAAK,IACD,OAAOA,IAGnBC,KAAM,CACFC,IAAK,EACLC,IAAK,GAETrC,cAAe,+BACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,SAAb5C,EACO4C,EAAO,EAAIA,EAAOA,EAAO,GACZ,aAAb5C,EACA4C,EACa,aAAb5C,EACA4C,EAAO,GAAKA,EAAOA,EAAO,GACb,UAAb5C,EACA4C,EAAO,QADX,GAIX5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,OACAA,EAAO,GACP,WACAA,EAAO,GACP,WACAA,EAAO,GACP,QAEA,UAzHmBrzD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIzB,IAAIsR,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAGJxR,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,yFAAyFttC,MAC7F,KAEJutC,YAAa,yEAAyEvtC,MAClF,KAEJ6xC,kBAAkB,EAClBrE,SAAU,wDAAwDxtC,MAC9D,KAEJytC,cAAe,mCAAmCztC,MAAM,KACxD0tC,YAAa,qBAAqB1tC,MAAM,KACxCiuC,eAAgB,CACZC,GAAI,gBACJC,IAAK,mBACLC,EAAG,aACHC,GAAI,cACJC,IAAK,6BACLC,KAAM,oCAEVC,SAAU,CACNC,QAAS,UACTC,QAAS,YACTC,SAAU,WACVC,QAAS,cACTC,SAAU,mBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,WACN30C,EAAG,WACH40C,GAAI,WACJh9C,EAAG,WACHi9C,GAAI,WACJC,EAAG,UACHC,GAAI,UACJh5B,EAAG,UACHi5B,GAAI,UACJC,EAAG,WACHC,GAAI,WACJC,EAAG,UACHC,GAAI,WAERmB,SAAU,SAAUpuD,GAChB,OAAOA,EAAOwP,QAAQ,iBAAiB,SAAUiH,GAC7C,OAAO43C,EAAU53C,OAGzBy3C,WAAY,SAAUluD,GAClB,OAAOA,EAAOwP,QAAQ,OAAO,SAAUiH,GACnC,OAAO03C,EAAU13C,OAKzBy0C,cAAe,qBACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,QAAb5C,EACO4C,EAAO,EAAIA,EAAOA,EAAO,GACZ,SAAb5C,EACA4C,EACa,SAAb5C,EACA4C,GAAQ,GAAKA,EAAOA,EAAO,GACd,SAAb5C,EACA4C,EAAO,QADX,GAIX5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,MACAA,EAAO,GACP,OACAA,EAAO,GACP,OACAA,EAAO,GACP,OAEA,OAGfX,KAAM,CACFC,IAAK,EACLC,IAAK,KAvHyB5yD,CAAQ,EAAQ,2FCKlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,0EAA0EttC,MAC9E,KAEJutC,YAAa,4DAA4DvtC,MACrE,KAEJwtC,SAAU,uCAAuCxtC,MAAM,KACvDytC,cAAe,uBAAuBztC,MAAM,KAC5C0tC,YAAa,gBAAgB1tC,MAAM,KACnCiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,iBACJC,IAAK,uBACLC,KAAM,6BACN5+B,EAAG,WACHmjC,GAAI,aACJC,IAAK,mBACLC,KAAM,yBAEVxE,SAAU,CACNC,QAAS,cACTC,QAAS,aACTC,SAAU,iBACVC,QAAS,eACTC,SAAU,+BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,UACRC,KAAM,UACN30C,EAAG,aACH40C,GAAI,WACJh9C,EAAG,MACHi9C,GAAI,UACJC,EAAG,MACHC,GAAI,SAAUQ,GACV,OAAe,IAAXA,EACO,SAEJA,EAAS,SAEpBx5B,EAAG,MACHi5B,GAAI,SAAUO,GACV,OAAe,IAAXA,EACO,SAEJA,EAAS,SAEpBN,EAAG,OACHC,GAAI,SAAUK,GACV,OAAe,IAAXA,EACO,UAEJA,EAAS,WAEpBJ,EAAG,MACHC,GAAI,SAAUG,GACV,OAAe,IAAXA,EACO,SACAA,EAAS,IAAO,GAAgB,KAAXA,EACrBA,EAAS,OAEbA,EAAS,UAGxBlC,cAAe,gEACfC,KAAM,SAAU99C,GACZ,MAAO,8BAA8BuQ,KAAKvQ,IAE9C+9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,aACAA,EAAO,GACP,QACAA,EAAO,GACPzC,EAAU,SAAW,eACrByC,EAAO,GACPzC,EAAU,QAAU,eAEpB,UAzFmB5wD,CAAQ,EAAQ,2FCClD,SAAWkiD,GAAU,aAIzB,IAAIsR,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAETqB,EAAc,CACV,OACA,WACA,UACA,UACA,OACA,QACA,QACA,OACA,aACA,UACA,WACA,cAiBC7S,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,CACJxoC,OAAQ,8EAA8E9E,MAClF,KAEJmxC,WAAY,0EAA0EnxC,MAClF,MAGRutC,YAAa,6DAA6DvtC,MACtE,KAEJwtC,SAAU,uDAAuDxtC,MAAM,KACvEytC,cAAe,kCAAkCztC,MAAM,KACvD0tC,YAAa,qBAAqB1tC,MAAM,KACxCiuC,eAAgB,CACZC,GAAI,aACJC,IAAK,gBACLC,EAAG,aACHC,GAAI,cACJC,IAAK,0BACLC,KAAM,iCAGV4D,YAAaA,EACbQ,gBAAiBR,EACjBS,iBAzCmB,CACf,OACA,QACA,UACA,UACA,OACA,QACA,QACA,OACA,QACA,UACA,OACA,SA+BJR,YAAa,+KAEbR,iBAAkB,+KAElBa,kBAAmB,uIAEnBC,uBAAwB,sFAExBlE,SAAU,CACNC,QAAS,UACTC,QAAS,UACTC,SAAU,WACVC,QAAS,UACTC,SAAU,mBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,UACN30C,EAAG,cACH40C,GAAI,WACJh9C,EAAG,UACHi9C,GAAI,UACJC,EAAG,UACHC,GAAI,UACJh5B,EAAG,SACHi5B,GAAI,SACJC,EAAG,WACHC,GAAI,WACJC,EAAG,UACHC,GAAI,WAERmB,SAAU,SAAUpuD,GAChB,OAAOA,EAAOwP,QAAQ,iBAAiB,SAAUiH,GAC7C,OAAO43C,EAAU53C,OAGzBy3C,WAAY,SAAUluD,GAClB,OAAOA,EAAOwP,QAAQ,OAAO,SAAUiH,GACnC,OAAO03C,EAAU13C,OAKzBy0C,cAAe,qBACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,QAAb5C,EACO4C,EAAO,EAAIA,EAAOA,EAAO,GACZ,SAAb5C,EACA4C,EACa,UAAb5C,EACA4C,GAAQ,GAAKA,EAAOA,EAAO,GACd,QAAb5C,EACA4C,EAAO,QADX,GAIX5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,MACAA,EAAO,GACP,OACAA,EAAO,GACP,QACAA,EAAO,GACP,MAEA,OAGfX,KAAM,CACFC,IAAK,EACLC,IAAK,KAlKyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIzB,SAASuT,EAAUhD,EAAQQ,EAAettD,GACtC,IAAIS,EAASqsD,EAAS,IACtB,OAAQ9sD,GACJ,IAAK,KAQD,OANIS,GADW,IAAXqsD,EACU,UACQ,IAAXA,GAA2B,IAAXA,GAA2B,IAAXA,EAC7B,UAEA,WAGlB,IAAK,IACD,OAAOQ,EAAgB,eAAiB,eAC5C,IAAK,KAQD,OANI7sD,GADW,IAAXqsD,EACU,SACQ,IAAXA,GAA2B,IAAXA,GAA2B,IAAXA,EAC7B,SAEA,UAGlB,IAAK,IACD,OAAOQ,EAAgB,YAAc,cACzC,IAAK,KAQD,OANI7sD,GADW,IAAXqsD,EACU,MACQ,IAAXA,GAA2B,IAAXA,GAA2B,IAAXA,EAC7B,OAEA,QAGlB,IAAK,KAMD,OAJIrsD,GADW,IAAXqsD,EACU,MAEA,QAGlB,IAAK,KAQD,OANIrsD,GADW,IAAXqsD,EACU,SACQ,IAAXA,GAA2B,IAAXA,GAA2B,IAAXA,EAC7B,UAEA,WAGlB,IAAK,KAQD,OANIrsD,GADW,IAAXqsD,EACU,SACQ,IAAXA,GAA2B,IAAXA,GAA2B,IAAXA,EAC7B,SAEA,WAMjBvQ,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,CACJxoC,OAAQ,oGAAoG9E,MACxG,KAEJmxC,WAAY,gGAAgGnxC,MACxG,MAGRutC,YAAa,+DAA+DvtC,MACxE,KAEJ6xC,kBAAkB,EAClBrE,SAAU,4DAA4DxtC,MAClE,KAEJytC,cAAe,qCAAqCztC,MAAM,KAC1D0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,eACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,eACTC,QAAS,eACTC,SAAU,WACN,OAAQzxD,KAAKm0D,OACT,KAAK,EACD,MAAO,wBACX,KAAK,EACD,MAAO,uBACX,KAAK,EACD,MAAO,sBACX,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,oBAGnBzC,QAAS,eACTC,SAAU,WACN,OAAQ3xD,KAAKm0D,OACT,KAAK,EACD,MAAO,6BACX,KAAK,EACD,MAAO,4BACX,KAAK,EACD,MAAO,2BACX,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,yBAGnBvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,WACN30C,EAAG,cACH40C,GAAI2D,EACJ3gD,EAAG2gD,EACH1D,GAAI0D,EACJzD,EAAGyD,EACHxD,GAAIwD,EACJx8B,EAAG,MACHi5B,GAAIuD,EACJtD,EAAG,SACHC,GAAIqD,EACJpD,EAAG,SACHC,GAAImD,GAERlD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAxJyB5yD,CAAQ,EAAQ,2FCIlD,SAAWkiD,GAAU,aAIzB,IAAI8U,EAAc,gEAAgEp0C,MAC9E,KAEJ,SAAS6yC,EAAUhD,EAAQQ,EAAettD,EAAKutD,GAC3C,IAAIW,EAAMpB,EACV,OAAQ9sD,GACJ,IAAK,IACD,OAAOutD,GAAYD,EACb,mBACA,oBACV,IAAK,KACD,OAAOY,GAAOX,GAAYD,GACpB,aACA,cACV,IAAK,IACD,MAAO,OAASC,GAAYD,EAAgB,QAAU,UAC1D,IAAK,KACD,OAAOY,GAAOX,GAAYD,EAAgB,QAAU,UACxD,IAAK,IACD,MAAO,OAASC,GAAYD,EAAgB,OAAS,UACzD,IAAK,KACD,OAAOY,GAAOX,GAAYD,EAAgB,OAAS,UACvD,IAAK,IACD,MAAO,OAASC,GAAYD,EAAgB,OAAS,UACzD,IAAK,KACD,OAAOY,GAAOX,GAAYD,EAAgB,OAAS,UACvD,IAAK,IACD,MAAO,OAASC,GAAYD,EAAgB,SAAW,YAC3D,IAAK,KACD,OAAOY,GAAOX,GAAYD,EAAgB,SAAW,YACzD,IAAK,IACD,MAAO,OAASC,GAAYD,EAAgB,MAAQ,QACxD,IAAK,KACD,OAAOY,GAAOX,GAAYD,EAAgB,MAAQ,QAE1D,MAAO,GAEX,SAASP,EAAKQ,GACV,OACKA,EAAW,GAAK,WACjB,IACA8D,EAAYl3D,KAAKm0D,OACjB,aAIC/R,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,oGAAoGttC,MACxG,KAEJutC,YAAa,iEAAiEvtC,MAC1E,KAEJ6xC,kBAAkB,EAClBrE,SAAU,sDAAsDxtC,MAAM,KACtEytC,cAAe,gCAAgCztC,MAAM,KACrD0tC,YAAa,qBAAqB1tC,MAAM,KACxCiuC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,cACHC,GAAI,gBACJC,IAAK,qBACLC,KAAM,4BAEVZ,cAAe,SACfC,KAAM,SAAU99C,GACZ,MAAyC,MAAlCA,EAAMnN,OAAO,GAAGyhB,eAE3BypC,SAAU,SAAUC,EAAOC,EAASC,GAChC,OAAIF,EAAQ,IACW,IAAZE,EAAmB,KAAO,MAEd,IAAZA,EAAmB,KAAO,MAGzCQ,SAAU,CACNC,QAAS,gBACTC,QAAS,oBACTC,SAAU,WACN,OAAOmB,EAAK7wD,KAAK/B,MAAM,IAE3B0xD,QAAS,oBACTC,SAAU,WACN,OAAOiB,EAAK7wD,KAAK/B,MAAM,IAE3B4xD,SAAU,KAEdC,aAAc,CACVC,OAAQ,WACRC,KAAM,KACN30C,EAAGu4C,EACH3D,GAAI2D,EACJ3gD,EAAG2gD,EACH1D,GAAI0D,EACJzD,EAAGyD,EACHxD,GAAIwD,EACJx8B,EAAGw8B,EACHvD,GAAIuD,EACJtD,EAAGsD,EACHrD,GAAIqD,EACJpD,EAAGoD,EACHnD,GAAImD,GAERlD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAnHyB5yD,CAAQ,EAAQ,8FCElD,SAAWkiD,GAAU,aAIdA,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,CACJxoC,OAAQ,4GAA4G9E,MAChH,KAEJmxC,WAAY,gGAAgGnxC,MACxG,MAGRutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,gEAAgExtC,MACtE,KAEJytC,cAAe,+BAA+BztC,MAAM,KACpD0tC,YAAa,+BAA+B1tC,MAAM,KAClDiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,iBACJC,IAAK,wBACLC,KAAM,+BAEVC,SAAU,CACNC,QAAS,aACTC,QAAS,YACTE,QAAS,YACTD,SAAU,WACN,MAAO,sBAEXE,SAAU,WACN,MAAO,8BAEXC,SAAU,KAEdC,aAAc,CACVC,OAAQ,UACRC,KAAM,UACN30C,EAAG,mBACH40C,GAAI,cACJh9C,EAAG,OACHi9C,GAAI,UACJC,EAAG,MACHC,GAAI,SACJh5B,EAAG,KACHi5B,GAAI,QACJC,EAAG,OACHC,GAAI,UACJC,EAAG,OACHC,GAAI,WAER/B,cAAe,oCACfC,KAAM,SAAU99C,GACZ,MAAO,uBAAuBuQ,KAAKvQ,IAEvC+9C,SAAU,SAAU4C,GAChB,OAAIA,EAAO,EACA,UACAA,EAAO,GACP,WACAA,EAAO,GACP,UAEA,YAGfd,uBAAwB,0BACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GACJ,IAAK,MACL,IAAK,IACL,IAAK,IACL,IAAK,OACD,OAAe,IAAXzB,EACOA,EAAS,MAEbA,EAAS,MACpB,QACI,OAAOA,IAGnBC,KAAM,CACFC,IAAK,EACLC,IAAK,KA1FyB5yD,CAAQ,EAAQ,2FCIlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,yFAAyFttC,MAC7F,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,6CAA6CxtC,MAAM,KAC7DytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,4BACLC,KAAM,mCAEVZ,cAAe,wBACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,SAAb5C,EACO4C,EACa,UAAb5C,EACA4C,GAAQ,GAAKA,EAAOA,EAAO,GACd,SAAb5C,GAAoC,UAAbA,EACvB4C,EAAO,QADX,GAIX5C,SAAU,SAAUC,EAAOC,EAASC,GAChC,OAAIF,EAAQ,GACD,OACAA,EAAQ,GACR,QACAA,EAAQ,GACR,OAEA,SAGfU,SAAU,CACNC,QAAS,sBACTC,QAAS,mBACTC,SAAU,kBACVC,QAAS,qBACTC,SAAU,uBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,WACRC,KAAM,eACN30C,EAAG,iBACH40C,GAAI,WACJh9C,EAAG,UACHi9C,GAAI,WACJC,EAAG,QACHC,GAAI,SACJh5B,EAAG,SACHi5B,GAAI,UACJC,EAAG,UACHC,GAAI,WACJC,EAAG,UACHC,GAAI,YAERI,KAAM,CACFC,IAAK,EACLC,IAAK,KAzEyB5yD,CAAQ,EAAQ,2FCElD,SAAWkiD,GAAU,aAIzB,SAAS4T,EAAOz1C,GACZ,OAAIA,EAAI,KAAQ,IAELA,EAAI,IAAO,EAK1B,SAASo1C,EAAUhD,EAAQQ,EAAettD,EAAKutD,GAC3C,IAAI9sD,EAASqsD,EAAS,IACtB,OAAQ9sD,GACJ,IAAK,IACD,OAAOstD,GAAiBC,EAClB,mBACA,mBACV,IAAK,KACD,OAAI4C,EAAOrD,GAEHrsD,GACC6sD,GAAiBC,EAAW,WAAa,YAG3C9sD,EAAS,UACpB,IAAK,IACD,OAAO6sD,EAAgB,SAAW,SACtC,IAAK,KACD,OAAI6C,EAAOrD,GAEHrsD,GAAU6sD,GAAiBC,EAAW,UAAY,WAE/CD,EACA7sD,EAAS,SAEbA,EAAS,SACpB,IAAK,KACD,OAAI0vD,EAAOrD,GAEHrsD,GACC6sD,GAAiBC,EACZ,gBACA,iBAGP9sD,EAAS,cACpB,IAAK,IACD,OAAI6sD,EACO,QAEJC,EAAW,MAAQ,OAC9B,IAAK,KACD,OAAI4C,EAAOrD,GACHQ,EACO7sD,EAAS,QAEbA,GAAU8sD,EAAW,OAAS,SAC9BD,EACA7sD,EAAS,QAEbA,GAAU8sD,EAAW,MAAQ,QACxC,IAAK,IACD,OAAID,EACO,UAEJC,EAAW,QAAU,SAChC,IAAK,KACD,OAAI4C,EAAOrD,GACHQ,EACO7sD,EAAS,UAEbA,GAAU8sD,EAAW,SAAW,WAChCD,EACA7sD,EAAS,UAEbA,GAAU8sD,EAAW,QAAU,UAC1C,IAAK,IACD,OAAOD,GAAiBC,EAAW,KAAO,MAC9C,IAAK,KACD,OAAI4C,EAAOrD,GACArsD,GAAU6sD,GAAiBC,EAAW,KAAO,QAEjD9sD,GAAU6sD,GAAiBC,EAAW,KAAO,QAIvDhR,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,oFAAoFttC,MACxF,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,mFAAmFxtC,MACzF,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,eACJC,IAAK,0BACLC,KAAM,iCAEVC,SAAU,CACNC,QAAS,iBACTC,QAAS,oBACTC,SAAU,gBACVC,QAAS,iBACTC,SAAU,0BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,WACRC,KAAM,iBACN30C,EAAGu4C,EACH3D,GAAI2D,EACJ3gD,EAAG2gD,EACH1D,GAAI0D,EACJzD,EAAG,cACHC,GAAIwD,EACJx8B,EAAGw8B,EACHvD,GAAIuD,EACJtD,EAAGsD,EACHrD,GAAIqD,EACJpD,EAAGoD,EACHnD,GAAImD,GAERlD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAzIyB5yD,CAAQ,EAAQ,8FCGlD,SAAWkiD,GAAU,aAIdA,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,gGAAgGttC,MACpG,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,2DAA2DxtC,MACjE,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,iBACTC,QAAS,mBACTC,SAAU,iBACVC,QAAS,iBACTC,SAAU,WACN,OAAQ3xD,KAAKm0D,OACT,KAAK,EACD,MAAO,6BACX,QACI,MAAO,+BAGnBvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SAAU10C,GACd,OAAQ,YAAY+F,KAAK/F,GAAK,MAAQ,MAAQ,IAAMA,GAExD20C,KAAM,QACN30C,EAAG,iBACH40C,GAAI,aACJh9C,EAAG,YACHi9C,GAAI,YACJC,EAAG,SACHC,GAAI,SACJh5B,EAAG,YACHi5B,GAAI,YACJC,EAAG,UACHC,GAAI,UACJC,EAAG,UACHC,GAAI,WAERC,uBAAwB,WACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA9DyB5yD,CAAQ,EAAQ,2FCKlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,gGAAgGttC,MACpG,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,2DAA2DxtC,MACjE,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,WACL,MACI,WACCvxD,KAAK4wD,QAAU,EAAI,OAA0B,IAAjB5wD,KAAK4wD,QAAgB,IAAM,OACxD,OAGRY,QAAS,WACL,MACI,aACCxxD,KAAK4wD,QAAU,EAAI,OAA0B,IAAjB5wD,KAAK4wD,QAAgB,IAAM,OACxD,OAGRa,SAAU,WACN,MACI,WACCzxD,KAAK4wD,QAAU,EAAI,OAA0B,IAAjB5wD,KAAK4wD,QAAgB,IAAM,OACxD,OAGRc,QAAS,WACL,MACI,WACC1xD,KAAK4wD,QAAU,EAAI,OAA0B,IAAjB5wD,KAAK4wD,QAAgB,IAAM,OACxD,OAGRe,SAAU,WACN,OAAQ3xD,KAAKm0D,OACT,KAAK,EACD,MACI,uBACCn0D,KAAK4wD,QAAU,EACV,OACiB,IAAjB5wD,KAAK4wD,QACL,IACA,OACN,MAER,QACI,MACI,uBACC5wD,KAAK4wD,QAAU,EACV,OACiB,IAAjB5wD,KAAK4wD,QACL,IACA,OACN,QAIhBgB,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,QACN30C,EAAG,iBACH40C,GAAI,aACJh9C,EAAG,YACHi9C,GAAI,YACJC,EAAG,SACHC,GAAI,SACJh5B,EAAG,YACHi5B,GAAI,YACJiC,EAAG,gBACHC,GAAI,eACJjC,EAAG,UACHC,GAAI,UACJC,EAAG,UACHC,GAAI,WAERC,uBAAwB,WACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAtGyB5yD,CAAQ,EAAQ,2FCClD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BgH,KAAM,CACF,CACIC,MAAO,aACPC,OAAQ,EACR7xD,KAAM,KACN8xD,OAAQ,IACRC,KAAM,KAEV,CACIH,MAAO,aACPI,MAAO,aACPH,OAAQ,EACR7xD,KAAM,KACN8xD,OAAQ,IACRC,KAAM,KAEV,CACIH,MAAO,aACPI,MAAO,aACPH,OAAQ,EACR7xD,KAAM,KACN8xD,OAAQ,IACRC,KAAM,KAEV,CACIH,MAAO,aACPI,MAAO,aACPH,OAAQ,EACR7xD,KAAM,KACN8xD,OAAQ,IACRC,KAAM,KAEV,CACIH,MAAO,aACPI,MAAO,aACPH,OAAQ,EACR7xD,KAAM,KACN8xD,OAAQ,IACRC,KAAM,KAEV,CACIH,MAAO,aACPI,MAAO,aACPH,OAAQ,EACR7xD,KAAM,KACN8xD,OAAQ,KACRC,KAAM,MAEV,CACIH,MAAO,aACPI,OAAO,IACPH,OAAQ,EACR7xD,KAAM,MACN8xD,OAAQ,KACRC,KAAM,OAGdE,oBAAqB,WACrBC,oBAAqB,SAAU9kD,EAAOoJ,GAClC,MAAoB,MAAbA,EAAM,GAAa,EAAIqN,SAASrN,EAAM,IAAMpJ,EAAO,KAE9Dw9C,OAAQ,yCAAyCttC,MAAM,KACvDutC,YAAa,yCAAyCvtC,MAClD,KAEJwtC,SAAU,8BAA8BxtC,MAAM,KAC9CytC,cAAe,gBAAgBztC,MAAM,KACrC0tC,YAAa,gBAAgB1tC,MAAM,KACnCiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,YACJC,IAAK,kBACLC,KAAM,uBACN5+B,EAAG,aACHmjC,GAAI,YACJC,IAAK,kBACLC,KAAM,wBAEVrF,cAAe,SACfC,KAAM,SAAU99C,GACZ,MAAiB,OAAVA,GAEX+9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,GACA,KAEA,MAGfjC,SAAU,CACNC,QAAS,UACTC,QAAS,UACTC,SAAU,SAAUkG,GAChB,OAAIA,EAAI/E,SAAW5yD,KAAK4yD,OACb,cAEA,WAGflB,QAAS,UACTC,SAAU,SAAUgG,GAChB,OAAI33D,KAAK4yD,SAAW+E,EAAI/E,OACb,cAEA,WAGfhB,SAAU,KAEda,uBAAwB,WACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GACJ,IAAK,IACD,OAAkB,IAAXzB,EAAe,KAAOA,EAAS,IAC1C,IAAK,IACL,IAAK,IACL,IAAK,MACD,OAAOA,EAAS,IACpB,QACI,OAAOA,IAGnBd,aAAc,CACVC,OAAQ,MACRC,KAAM,MACN30C,EAAG,KACH40C,GAAI,MACJh9C,EAAG,KACHi9C,GAAI,MACJC,EAAG,MACHC,GAAI,OACJh5B,EAAG,KACHi5B,GAAI,MACJC,EAAG,MACHC,GAAI,OACJC,EAAG,KACHC,GAAI,SAlJ0BtyD,CAAQ,EAAQ,2FCIlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,yFAAyFttC,MAC7F,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,+CAA+CxtC,MAAM,KAC/DytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,4BACLC,KAAM,mCAEVZ,cAAe,6BACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,WAAb5C,EACO4C,EACa,WAAb5C,EACA4C,GAAQ,GAAKA,EAAOA,EAAO,GACd,WAAb5C,GAAsC,UAAbA,EACzB4C,EAAO,QADX,GAIX5C,SAAU,SAAUC,EAAOC,EAASC,GAChC,OAAIF,EAAQ,GACD,SACAA,EAAQ,GACR,SACAA,EAAQ,GACR,SAEA,SAGfU,SAAU,CACNC,QAAS,2BACTC,QAAS,sBACTC,SAAU,kBACVC,QAAS,wBACTC,SAAU,4BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,gBACRC,KAAM,uBACN30C,EAAG,kBACH40C,GAAI,WACJh9C,EAAG,kBACHi9C,GAAI,WACJC,EAAG,gBACHC,GAAI,SACJh5B,EAAG,WACHi5B,GAAI,YACJC,EAAG,UACHC,GAAI,WACJC,EAAG,SACHC,GAAI,WAERI,KAAM,CACFC,IAAK,EACLC,IAAK,KAzEyB5yD,CAAQ,EAAQ,2FCElD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,qGAAqGttC,MACzG,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,CACN2D,WAAY,gEAAgEnxC,MACxE,KAEJ8E,OAAQ,iEAAiE9E,MACrE,KAEJoxC,SAAU,iBAEd3D,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,iBACTC,QAAS,iBACTE,QAAS,kBACTD,SAAU,wBACVE,SAAU,oBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SAAU10C,GACd,OAAOA,EAAErI,QAAQ,iCAAiC,SAC9C6iD,EACA3wC,EACA4wC,GAEA,MAAc,MAAPA,EAAa5wC,EAAK,KAAOA,EAAK4wC,EAAK,SAGlD9F,KAAM,SAAU30C,GACZ,MAAI,4BAA4B+F,KAAK/F,GAC1BA,EAAErI,QAAQ,SAAU,UAE3B,OAAOoO,KAAK/F,GACLA,EAAErI,QAAQ,QAAS,YAEvBqI,GAEXA,EAAG,iBACH40C,GAAI,UACJh9C,EAAG,OACHi9C,GAAI,UACJC,EAAG,QACHC,GAAI,WACJh5B,EAAG,MACHi5B,GAAI,SACJC,EAAG,MACHC,GAAI,SACJC,EAAG,OACHC,GAAI,WAERC,uBAAwB,8BACxBC,QAAS,SAAUC,GACf,OAAe,IAAXA,EACOA,EAEI,IAAXA,EACOA,EAAS,MAGhBA,EAAS,IACRA,GAAU,KAAOA,EAAS,IAAO,GAClCA,EAAS,KAAQ,EAEV,MAAQA,EAEZA,EAAS,MAEpBC,KAAM,CACFC,IAAK,EACLC,IAAK,KA1FyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIzB,IAAIyR,EAAW,CACX,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,IAAK,OAGAzR,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,qFAAqFttC,MACzF,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,0DAA0DxtC,MAChE,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,mBACTC,QAAS,mBACTC,SAAU,kBACVC,QAAS,kBACTC,SAAU,kCACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,YACRC,KAAM,WACN30C,EAAG,iBACH40C,GAAI,YACJh9C,EAAG,YACHi9C,GAAI,WACJC,EAAG,YACHC,GAAI,WACJh5B,EAAG,UACHi5B,GAAI,SACJC,EAAG,SACHC,GAAI,QACJC,EAAG,UACHC,GAAI,UAERC,uBAAwB,kBACxBC,QAAS,SAAUC,GAGf,OAAOA,GAAUkB,EAASlB,IAAWkB,EAF7BlB,EAAS,KAEmCkB,EAD5ClB,GAAU,IAAM,IAAM,QAGlCC,KAAM,CACFC,IAAK,EACLC,IAAK,KAhFyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIzB,IAAIsR,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAGJxR,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,yEAAyEttC,MAC7E,KAEJutC,YAAa,yEAAyEvtC,MAClF,KAEJwtC,SAAU,iDAAiDxtC,MAAM,KACjEytC,cAAe,oBAAoBztC,MAAM,KACzC0tC,YAAa,oBAAoB1tC,MAAM,KACvCwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVZ,cAAe,cACfC,KAAM,SAAU99C,GACZ,MAAiB,UAAVA,GAEX+9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,GACA,QAEA,SAGfjC,SAAU,CACNC,QAAS,oBACTC,QAAS,kBACTC,SAAU,iBACVC,QAAS,qBACTC,SAAU,8BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,QACN30C,EAAG,iBACH40C,GAAI,YACJh9C,EAAG,UACHi9C,GAAI,UACJC,EAAG,UACHC,GAAI,UACJh5B,EAAG,UACHi5B,GAAI,UACJC,EAAG,QACHC,GAAI,QACJC,EAAG,WACHC,GAAI,YAERC,uBAAwB,YACxBC,QAAS,OACTiB,SAAU,SAAUpuD,GAChB,OAAOA,EAAOwP,QAAQ,iBAAiB,SAAUiH,GAC7C,OAAO43C,EAAU53C,OAGzBy3C,WAAY,SAAUluD,GAClB,OAAOA,EAAOwP,QAAQ,OAAO,SAAUiH,GACnC,OAAO03C,EAAU13C,OAGzB42C,KAAM,CACFC,IAAK,EACLC,IAAK,KApGyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIzB,IAAIsR,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAGJxR,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,6FAA6FttC,MACjG,KAEJutC,YAAa,2EAA2EvtC,MACpF,KAEJ6xC,kBAAkB,EAClBrE,SAAU,0DAA0DxtC,MAChE,KAEJytC,cAAe,qCAAqCztC,MAAM,KAC1D0tC,YAAa,wBAAwB1tC,MAAM,KAC3CiuC,eAAgB,CACZC,GAAI,SACJC,IAAK,YACLC,EAAG,aACHC,GAAI,cACJC,IAAK,sBACLC,KAAM,6BAEVC,SAAU,CACNC,QAAS,YACTC,QAAS,YACTC,SAAU,WACVC,QAAS,cACTC,SAAU,oBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,UACRC,KAAM,WACN30C,EAAG,gBACH40C,GAAI,gBACJh9C,EAAG,aACHi9C,GAAI,WACJC,EAAG,YACHC,GAAI,UACJh5B,EAAG,WACHi5B,GAAI,SACJC,EAAG,cACHC,GAAI,YACJC,EAAG,YACHC,GAAI,WAERmB,SAAU,SAAUpuD,GAChB,OAAOA,EAAOwP,QAAQ,iBAAiB,SAAUiH,GAC7C,OAAO43C,EAAU53C,OAGzBy3C,WAAY,SAAUluD,GAClB,OAAOA,EAAOwP,QAAQ,OAAO,SAAUiH,GACnC,OAAO03C,EAAU13C,OAGzBy0C,cAAe,gCACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,WAAb5C,EACO4C,EAAO,EAAIA,EAAOA,EAAO,GACZ,aAAb5C,EACA4C,EACa,aAAb5C,EACA4C,GAAQ,GAAKA,EAAOA,EAAO,GACd,SAAb5C,EACA4C,EAAO,QADX,GAIX5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,SACAA,EAAO,GACP,WACAA,EAAO,GACP,WACAA,EAAO,GACP,OAEA,UAGfd,uBAAwB,eACxBC,QAAS,SAAUC,GACf,OAAOA,EAAS,OAEpBC,KAAM,CACFC,IAAK,EACLC,IAAK,KAzHyB5yD,CAAQ,EAAQ,2FCIlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,yCAAyCttC,MAAM,KACvDutC,YAAa,yCAAyCvtC,MAClD,KAEJwtC,SAAU,8BAA8BxtC,MAAM,KAC9CytC,cAAe,gBAAgBztC,MAAM,KACrC0tC,YAAa,gBAAgB1tC,MAAM,KACnCiuC,eAAgB,CACZC,GAAI,SACJC,IAAK,YACLC,EAAG,cACHC,GAAI,gBACJC,IAAK,uBACLC,KAAM,4BACN5+B,EAAG,cACHmjC,GAAI,gBACJC,IAAK,uBACLC,KAAM,6BAEVxE,SAAU,CACNC,QAAS,QACTC,QAAS,QACTC,SAAU,UACVC,QAAS,QACTC,SAAU,cACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,OACRC,KAAM,OACN30C,EAAG,MACH40C,GAAI,MACJh9C,EAAG,KACHi9C,GAAI,MACJC,EAAG,OACHC,GAAI,OACJh5B,EAAG,KACHi5B,GAAI,MACJC,EAAG,MACHC,GAAI,MACJC,EAAG,MACHC,GAAI,OAERC,uBAAwB,iBACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GACJ,IAAK,IACL,IAAK,IACL,IAAK,MACD,OAAOzB,EAAS,IACpB,IAAK,IACD,OAAOA,EAAS,IACpB,IAAK,IACL,IAAK,IACD,OAAOA,EAAS,IACpB,QACI,OAAOA,IAGnBlC,cAAe,QACfC,KAAM,SAAUnvC,GACZ,MAAiB,OAAVA,GAEXovC,SAAU,SAAU4C,EAAMC,EAAQsE,GAC9B,OAAOvE,EAAO,GAAK,KAAO,QAxEIrzD,CAAQ,EAAQ,2FCElD,SAAWkiD,GAAU,aAIzB,IAAIsR,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAETxD,EAAS,CACL,eACA,QACA,QACA,QACA,QACA,WACA,SACA,MACA,UACA,eACA,eACA,gBAGChO,EAAO+N,aAAa,KAAM,CAC/BC,OAAQA,EACRC,YAAaD,EACbE,SAAU,0EAA0ExtC,MAChF,KAEJytC,cAAe,2DAA2DztC,MACtE,KAEJ0tC,YAAa,gBAAgB1tC,MAAM,KACnCwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVZ,cAAe,kBACfC,KAAM,SAAU99C,GACZ,MAAO,UAAUuQ,KAAKvQ,IAE1B+9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,GACA,UAEA,WAGfjC,SAAU,CACNC,QAAS,sBACTC,QAAS,uBACTC,SAAU,oBACVC,QAAS,qBACTC,SAAU,oBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,KACN30C,EAAG,kBACH40C,GAAI,WACJh9C,EAAG,cACHi9C,GAAI,YACJC,EAAG,eACHC,GAAI,aACJh5B,EAAG,WACHi5B,GAAI,SACJC,EAAG,YACHC,GAAI,UACJC,EAAG,WACHC,GAAI,UAERmB,SAAU,SAAUpuD,GAChB,OAAOA,EACFwP,QAAQ,iBAAiB,SAAUiH,GAChC,OAAO43C,EAAU53C,MAEpBjH,QAAQ,KAAM,MAEvB0+C,WAAY,SAAUluD,GAClB,OAAOA,EACFwP,QAAQ,OAAO,SAAUiH,GACtB,OAAO03C,EAAU13C,MAEpBjH,QAAQ,KAAM,MAEvB69C,KAAM,CACFC,IAAK,EACLC,IAAK,MApHyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIzB,IAAIyR,EAAW,CACX,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,IAAK,OAGAzR,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,kFAAkFttC,MACtF,KAEJutC,YAAa,qDAAqDvtC,MAC9D,KAEJwtC,SAAU,2DAA2DxtC,MACjE,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,kBACTC,QAAS,kBACTC,SAAU,iBACVC,QAAS,kBACTC,SAAU,wCACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,YACRC,KAAM,WACN30C,EAAG,iBACH40C,GAAI,YACJh9C,EAAG,YACHi9C,GAAI,WACJC,EAAG,WACHC,GAAI,UACJh5B,EAAG,UACHi5B,GAAI,SACJC,EAAG,SACHC,GAAI,QACJC,EAAG,UACHC,GAAI,UAERC,uBAAwB,wBACxBC,QAAS,SAAUC,GAGf,OAAOA,GAAUkB,EAASlB,IAAWkB,EAF7BlB,EAAS,KAEmCkB,EAD5ClB,GAAU,IAAM,IAAM,QAGlCC,KAAM,CACFC,IAAK,EACLC,IAAK,KAlFyB5yD,CAAQ,EAAQ,2FCIlD,SAAWkiD,GAAU,aAIzB,SAAS6T,EAAoBtD,EAAQQ,EAAettD,EAAKutD,GACrD,IAAIxrC,EAAS,CACT5S,EAAG,CAAC,aAAc,gBAClBk9C,EAAG,CAAC,YAAa,eACjB/4B,EAAG,CAAC,UAAW,aACfk5B,EAAG,CAAC,WAAY,eAChBE,EAAG,CAAC,UAAW,eAEnB,OAAOY,EAAgBvrC,EAAO/hB,GAAK,GAAK+hB,EAAO/hB,GAAK,GAuBxD,SAASkyD,EAA4BpF,GAEjC,GADAA,EAAStpC,SAASspC,EAAQ,IACtBrpC,MAAMqpC,GACN,OAAO,EAEX,GAAIA,EAAS,EAET,OAAO,EACJ,GAAIA,EAAS,GAEhB,OAAI,GAAKA,GAAUA,GAAU,EAI1B,GAAIA,EAAS,IAAK,CAErB,IAAI4B,EAAY5B,EAAS,GAEzB,OACWoF,EADO,IAAdxD,EADa5B,EAAS,GAIS4B,GAChC,GAAI5B,EAAS,IAAO,CAEvB,KAAOA,GAAU,IACbA,GAAkB,GAEtB,OAAOoF,EAA4BpF,GAInC,OAAOoF,EADPpF,GAAkB,KAKjBvQ,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,uFAAuFttC,MAC3F,KAEJutC,YAAa,+DAA+DvtC,MACxE,KAEJ6xC,kBAAkB,EAClBrE,SAAU,mEAAmExtC,MACzE,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,cACJC,IAAK,iBACLC,EAAG,aACHC,GAAI,eACJC,IAAK,2BACLC,KAAM,kCAEVC,SAAU,CACNC,QAAS,eACTK,SAAU,IACVJ,QAAS,eACTC,SAAU,eACVC,QAAS,mBACTC,SAAU,WAEN,OAAQ3xD,KAAKm0D,OACT,KAAK,EACL,KAAK,EACD,MAAO,0BACX,QACI,MAAO,4BAIvBtC,aAAc,CACVC,OAhGR,SAA2BvsD,GAEvB,OAAIwyD,EADSxyD,EAAOwhB,OAAO,EAAGxhB,EAAO2I,QAAQ,OAElC,KAAO3I,EAEX,MAAQA,GA4FXwsD,KA1FR,SAAyBxsD,GAErB,OAAIwyD,EADSxyD,EAAOwhB,OAAO,EAAGxhB,EAAO2I,QAAQ,OAElC,QAAU3I,EAEd,SAAWA,GAsFd6X,EAAG,kBACH40C,GAAI,cACJh9C,EAAGihD,EACHhE,GAAI,cACJC,EAAG+D,EACH9D,GAAI,aACJh5B,EAAG88B,EACH7D,GAAI,UACJC,EAAG4D,EACH3D,GAAI,WACJC,EAAG0D,EACHzD,GAAI,WAERC,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KApIyB5yD,CAAQ,EAAQ,2FCElD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,6EAA6EttC,MACjF,KAEJutC,YAAa,6EAA6EvtC,MACtF,KAEJwtC,SAAU,sCAAsCxtC,MAAM,KACtDytC,cAAe,oCAAoCztC,MAAM,KACzD0tC,YAAa,mBAAmB1tC,MAAM,KACtCwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,6BAEVZ,cAAe,kBACfC,KAAM,SAAU99C,GACZ,MAAiB,WAAVA,GAEX+9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,GACA,WAEA,UAGfjC,SAAU,CACNC,QAAS,kBACTC,QAAS,mBACTC,SAAU,wBACVC,QAAS,qBACTC,SAAU,4BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,WACN30C,EAAG,mBACH40C,GAAI,YACJh9C,EAAG,SACHi9C,GAAI,UACJC,EAAG,YACHC,GAAI,aACJh5B,EAAG,QACHi5B,GAAI,SACJC,EAAG,UACHC,GAAI,WACJC,EAAG,OACHC,GAAI,SAERC,uBAAwB,eACxBC,QAAS,SAAUC,GACf,MAAO,MAAQA,KA/DezyD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIzB,IAAI4V,EAAQ,CACRhG,GAAI,6BACJh9C,EAAG,wBACHi9C,GAAI,0BACJC,EAAG,2BACHC,GAAI,4BACJh5B,EAAG,qBACHi5B,GAAI,sBACJC,EAAG,uBACHC,GAAI,4BACJC,EAAG,mBACHC,GAAI,oBASR,SAASyF,EAAkBtF,EAAQQ,EAAettD,EAAKutD,GACnD,OAAOD,EACDa,EAAMnuD,GAAK,GACXutD,EACAY,EAAMnuD,GAAK,GACXmuD,EAAMnuD,GAAK,GAErB,SAASqyD,EAAQvF,GACb,OAAOA,EAAS,IAAO,GAAMA,EAAS,IAAMA,EAAS,GAEzD,SAASqB,EAAMnuD,GACX,OAAOmyD,EAAMnyD,GAAKid,MAAM,KAE5B,SAAS6yC,EAAUhD,EAAQQ,EAAettD,EAAKutD,GAC3C,IAAI9sD,EAASqsD,EAAS,IACtB,OAAe,IAAXA,EAEIrsD,EAAS2xD,EAAkBtF,EAAQQ,EAAettD,EAAI,GAAIutD,GAEvDD,EACA7sD,GAAU4xD,EAAQvF,GAAUqB,EAAMnuD,GAAK,GAAKmuD,EAAMnuD,GAAK,IAE1DutD,EACO9sD,EAAS0tD,EAAMnuD,GAAK,GAEpBS,GAAU4xD,EAAQvF,GAAUqB,EAAMnuD,GAAK,GAAKmuD,EAAMnuD,GAAK,IAIjEu8C,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,CACJxoC,OAAQ,oGAAoG9E,MACxG,KAEJmxC,WAAY,kGAAkGnxC,MAC1G,KAEJoxC,SAAU,+DAEd7D,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,CACN1oC,OAAQ,oFAAoF9E,MACxF,KAEJmxC,WAAY,2FAA2FnxC,MACnG,KAEJoxC,SAAU,cAEd3D,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,iBAAiB1tC,MAAM,KACpCwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,wBACJC,IAAK,sCACLC,KAAM,4CACN5+B,EAAG,aACHmjC,GAAI,wBACJC,IAAK,sCACLC,KAAM,4CAEVxE,SAAU,CACNC,QAAS,gBACTC,QAAS,aACTC,SAAU,UACVC,QAAS,aACTC,SAAU,qBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,WACN30C,EAlFR,SAA0Bu1C,EAAQQ,EAAettD,EAAKutD,GAClD,OAAID,EACO,kBAEAC,EAAW,kBAAoB,mBA+EtCpB,GAAI2D,EACJ3gD,EAAGijD,EACHhG,GAAI0D,EACJzD,EAAG+F,EACH9F,GAAIwD,EACJx8B,EAAG8+B,EACH7F,GAAIuD,EACJtD,EAAG4F,EACH3F,GAAIqD,EACJpD,EAAG0F,EACHzF,GAAImD,GAERlD,uBAAwB,cACxBC,QAAS,SAAUC,GACf,OAAOA,EAAS,QAEpBC,KAAM,CACFC,IAAK,EACLC,IAAK,KAzHyB5yD,CAAQ,EAAQ,2FCIlD,SAAWkiD,GAAU,aAIzB,IAAI4V,EAAQ,CACRhG,GAAI,qCAAqClvC,MAAM,KAC/C9N,EAAG,iCAAiC8N,MAAM,KAC1CmvC,GAAI,iCAAiCnvC,MAAM,KAC3CovC,EAAG,iCAAiCpvC,MAAM,KAC1CqvC,GAAI,iCAAiCrvC,MAAM,KAC3CqW,EAAG,6BAA6BrW,MAAM,KACtCsvC,GAAI,6BAA6BtvC,MAAM,KACvCuvC,EAAG,iCAAiCvvC,MAAM,KAC1CwvC,GAAI,iCAAiCxvC,MAAM,KAC3CyvC,EAAG,wBAAwBzvC,MAAM,KACjC0vC,GAAI,wBAAwB1vC,MAAM,MAKtC,SAAS8E,EAAOosC,EAAOrB,EAAQQ,GAC3B,OAAIA,EAEOR,EAAS,IAAO,GAAKA,EAAS,KAAQ,GAAKqB,EAAM,GAAKA,EAAM,GAI5DrB,EAAS,IAAO,GAAKA,EAAS,KAAQ,GAAKqB,EAAM,GAAKA,EAAM,GAG3E,SAASF,EAAuBnB,EAAQQ,EAAettD,GACnD,OAAO8sD,EAAS,IAAM/qC,EAAOowC,EAAMnyD,GAAM8sD,EAAQQ,GAErD,SAASgF,EAAyBxF,EAAQQ,EAAettD,GACrD,OAAO+hB,EAAOowC,EAAMnyD,GAAM8sD,EAAQQ,GAM7B/Q,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,uGAAuGttC,MAC3G,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,0EAA0ExtC,MAChF,KAEJytC,cAAe,kBAAkBztC,MAAM,KACvC0tC,YAAa,kBAAkB1tC,MAAM,KACrCwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,cACHC,GAAI,uBACJC,IAAK,8BACLC,KAAM,qCAEVC,SAAU,CACNC,QAAS,uBACTC,QAAS,oBACTC,SAAU,qBACVC,QAAS,sBACTC,SAAU,gCACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,WACN30C,EAlCR,SAAyBu1C,EAAQQ,GAC7B,OAAOA,EAAgB,iBAAmB,kBAkCtCnB,GAAI8B,EACJ9+C,EAAGmjD,EACHlG,GAAI6B,EACJ5B,EAAGiG,EACHhG,GAAI2B,EACJ36B,EAAGg/B,EACH/F,GAAI0B,EACJzB,EAAG8F,EACH7F,GAAIwB,EACJvB,EAAG4F,EACH3F,GAAIsB,GAERrB,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA1FyB5yD,CAAQ,EAAQ,2FCElD,SAAWkiD,GAAU,aAIzB,IAAIgW,EAAa,CACbC,MAAO,CAEHrG,GAAI,CAAC,SAAU,UAAW,WAC1Bh9C,EAAG,CAAC,cAAe,iBACnBi9C,GAAI,CAAC,QAAS,SAAU,UACxBC,EAAG,CAAC,YAAa,eACjBC,GAAI,CAAC,MAAO,OAAQ,QACpBC,GAAI,CAAC,MAAO,OAAQ,QACpBE,GAAI,CAAC,SAAU,UAAW,WAC1BE,GAAI,CAAC,SAAU,SAAU,WAE7B8F,uBAAwB,SAAU3F,EAAQ4F,GACtC,OAAkB,IAAX5F,EACD4F,EAAQ,GACR5F,GAAU,GAAKA,GAAU,EACzB4F,EAAQ,GACRA,EAAQ,IAElB5C,UAAW,SAAUhD,EAAQQ,EAAettD,GACxC,IAAI0yD,EAAUH,EAAWC,MAAMxyD,GAC/B,OAAmB,IAAfA,EAAIuJ,OACG+jD,EAAgBoF,EAAQ,GAAKA,EAAQ,GAGxC5F,EACA,IACAyF,EAAWE,uBAAuB3F,EAAQ4F,KAMjDnW,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,mFAAmFttC,MACvF,KAEJutC,YAAa,2DAA2DvtC,MACpE,KAEJ6xC,kBAAkB,EAClBrE,SAAU,4DAA4DxtC,MAClE,KAEJytC,cAAe,qCAAqCztC,MAAM,KAC1D0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,eACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,eACTC,QAAS,gBAETC,SAAU,WACN,OAAQzxD,KAAKm0D,OACT,KAAK,EACD,MAAO,wBACX,KAAK,EACD,MAAO,uBACX,KAAK,EACD,MAAO,sBACX,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,oBAGnBzC,QAAS,cACTC,SAAU,WAUN,MATmB,CACf,6BACA,iCACA,4BACA,4BACA,8BACA,2BACA,4BAEgB3xD,KAAKm0D,QAE7BvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,WACN30C,EAAG,mBACH40C,GAAIoG,EAAWzC,UACf3gD,EAAGojD,EAAWzC,UACd1D,GAAImG,EAAWzC,UACfzD,EAAGkG,EAAWzC,UACdxD,GAAIiG,EAAWzC,UACfx8B,EAAG,MACHi5B,GAAIgG,EAAWzC,UACftD,EAAG,SACHC,GAAI8F,EAAWzC,UACfpD,EAAG,SACHC,GAAI4F,EAAWzC,WAEnBlD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KApHyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,8IAA8IttC,MAClJ,KAEJutC,YAAa,iEAAiEvtC,MAC1E,KAEJoyC,YAAa,yCACbK,kBAAmB,yCACnBb,iBAAkB,yCAClBc,uBAAwB,yCACxBlF,SAAU,kDAAkDxtC,MAAM,KAClEytC,cAAe,wBAAwBztC,MAAM,KAC7C0tC,YAAa,wBAAwB1tC,MAAM,KAC3CiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,wBACLC,KAAM,+BAEVC,SAAU,CACNC,QAAS,wBACTC,QAAS,eACTC,SAAU,cACVC,QAAS,iBACTC,SAAU,2BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,cACRC,KAAM,WACN30C,EAAG,mBACH40C,GAAI,YACJh9C,EAAG,YACHi9C,GAAI,YACJC,EAAG,WACHC,GAAI,WACJh5B,EAAG,QACHi5B,GAAI,QACJC,EAAG,YACHC,GAAI,YACJC,EAAG,SACHC,GAAI,UAERC,uBAAwB,WACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAzDyB5yD,CAAQ,EAAQ,2FCIlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,uFAAuFttC,MAC3F,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,wDAAwDxtC,MAC9D,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,YACHC,GAAI,cACJC,IAAK,mBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,gBACTC,QAAS,eACTC,SAAU,oBACVC,QAAS,gBACTC,SAAU,WACN,OAAQ3xD,KAAKm0D,OACT,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,4BACX,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,8BAGnBvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,UACN30C,EAAG,kBACH40C,GAAI,aACJh9C,EAAG,cACHi9C,GAAI,YACJC,EAAG,WACHC,GAAI,UACJh5B,EAAG,WACHi5B,GAAI,UACJC,EAAG,aACHC,GAAI,YACJC,EAAG,cACHC,GAAI,aAERC,uBAAwB,8BACxBC,QAAS,SAAUC,GACf,IAAI4B,EAAY5B,EAAS,GACrB6B,EAAc7B,EAAS,IAC3B,OAAe,IAAXA,EACOA,EAAS,MACO,IAAhB6B,EACA7B,EAAS,MACT6B,EAAc,IAAMA,EAAc,GAClC7B,EAAS,MACK,IAAd4B,EACA5B,EAAS,MACK,IAAd4B,EACA5B,EAAS,MACK,IAAd4B,GAAiC,IAAdA,EACnB5B,EAAS,MAETA,EAAS,OAGxBC,KAAM,CACFC,IAAK,EACLC,IAAK,KAnFyB5yD,CAAQ,EAAQ,2FCElD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,yFAAyFttC,MAC7F,KAEJutC,YAAa,yEAAyEvtC,MAClF,KAEJ6xC,kBAAkB,EAClBrE,SAAU,wEAAwExtC,MAC9E,KAEJytC,cAAe,2CAA2CztC,MAAM,KAChE0tC,YAAa,wBAAwB1tC,MAAM,KAC3CiuC,eAAgB,CACZC,GAAI,aACJC,IAAK,gBACLC,EAAG,aACHC,GAAI,cACJC,IAAK,0BACLC,KAAM,iCAEVC,SAAU,CACNC,QAAS,aACTC,QAAS,YACTC,SAAU,WACVC,QAAS,cACTC,SAAU,oBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,aACRC,KAAM,WACN30C,EAAG,gBACH40C,GAAI,cACJh9C,EAAG,eACHi9C,GAAI,cACJC,EAAG,eACHC,GAAI,cACJh5B,EAAG,YACHi5B,GAAI,WACJC,EAAG,WACHC,GAAI,UACJC,EAAG,WACHC,GAAI,WAER/B,cAAe,gDACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAGO,WAAb5C,GAAyB4C,GAAQ,GACrB,iBAAb5C,GACa,eAAbA,EAEO4C,EAAO,GAEPA,GAGf5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,SACAA,EAAO,GACP,SACAA,EAAO,GACP,eACAA,EAAO,GACP,aAEA,YA7EmBrzD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIzB,SAASuT,EAAUhD,EAAQQ,EAAettD,EAAKutD,GAC3C,OAAQvtD,GACJ,IAAK,IACD,OAAOstD,EAAgB,gBAAkB,kBAC7C,IAAK,KACD,OAAOR,GAAUQ,EAAgB,UAAY,aACjD,IAAK,IACL,IAAK,KACD,OAAOR,GAAUQ,EAAgB,SAAW,YAChD,IAAK,IACL,IAAK,KACD,OAAOR,GAAUQ,EAAgB,OAAS,WAC9C,IAAK,IACL,IAAK,KACD,OAAOR,GAAUQ,EAAgB,QAAU,WAC/C,IAAK,IACL,IAAK,KACD,OAAOR,GAAUQ,EAAgB,OAAS,UAC9C,IAAK,IACL,IAAK,KACD,OAAOR,GAAUQ,EAAgB,OAAS,WAC9C,QACI,OAAOR,GAIVvQ,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,+LAA+LttC,MACnM,KAEJutC,YAAa,6EAA6EvtC,MACtF,KAEJ6xC,kBAAkB,EAClBrE,SAAU,6CAA6CxtC,MAAM,KAC7DytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,oBACJC,IAAK,0BACLC,KAAM,iCAEVZ,cAAe,SACfC,KAAM,SAAU99C,GACZ,MAAiB,OAAVA,GAEX+9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,GACA,KAEA,MAGfjC,SAAU,CACNC,QAAS,eACTC,QAAS,eACTC,SAAU,iBACVC,QAAS,eACTC,SAAU,qBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,WACRC,KAAM,UACN30C,EAAGu4C,EACH3D,GAAI2D,EACJ3gD,EAAG2gD,EACH1D,GAAI0D,EACJzD,EAAGyD,EACHxD,GAAIwD,EACJx8B,EAAGw8B,EACHvD,GAAIuD,EACJtD,EAAGsD,EACHrD,GAAIqD,EACJpD,EAAGoD,EACHnD,GAAImD,GAERlD,uBAAwB,eACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GACJ,IAAK,IACL,IAAK,IACL,IAAK,MACD,OAAOzB,EAAS,QACpB,QACI,OAAOA,MAhGezyD,CAAQ,EAAQ,2FCIlD,SAAWkiD,GAAU,aAIzB,IAAIsR,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAGb,SAAS4E,EAAe7F,EAAQQ,EAAe5tD,EAAQ6tD,GACnD,IAAI2C,EAAS,GACb,GAAI5C,EACA,OAAQ5tD,GACJ,IAAK,IACDwwD,EAAS,aACT,MACJ,IAAK,KACDA,EAAS,WACT,MACJ,IAAK,IACDA,EAAS,WACT,MACJ,IAAK,KACDA,EAAS,YACT,MACJ,IAAK,IACDA,EAAS,SACT,MACJ,IAAK,KACDA,EAAS,SACT,MACJ,IAAK,IACDA,EAAS,UACT,MACJ,IAAK,KACDA,EAAS,UACT,MACJ,IAAK,IACDA,EAAS,WACT,MACJ,IAAK,KACDA,EAAS,WACT,MACJ,IAAK,IACDA,EAAS,UACT,MACJ,IAAK,KACDA,EAAS,gBAIjB,OAAQxwD,GACJ,IAAK,IACDwwD,EAAS,eACT,MACJ,IAAK,KACDA,EAAS,aACT,MACJ,IAAK,IACDA,EAAS,aACT,MACJ,IAAK,KACDA,EAAS,aACT,MACJ,IAAK,IACDA,EAAS,WACT,MACJ,IAAK,KACDA,EAAS,WACT,MACJ,IAAK,IACDA,EAAS,YACT,MACJ,IAAK,KACDA,EAAS,YACT,MACJ,IAAK,IACDA,EAAS,cACT,MACJ,IAAK,KACDA,EAAS,cACT,MACJ,IAAK,IACDA,EAAS,YACT,MACJ,IAAK,KACDA,EAAS,YAIrB,OAAOA,EAAOhhD,QAAQ,MAAO49C,GAGxBvQ,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,wFAAwFttC,MAC5F,KAEJutC,YAAa,gFAAgFvtC,MACzF,KAEJ6xC,kBAAkB,EAClBrE,SAAU,uDAAuDxtC,MAAM,KACvEytC,cAAe,kCAAkCztC,MAAM,KACvD0tC,YAAa,qBAAqB1tC,MAAM,KACxCiuC,eAAgB,CACZC,GAAI,eACJC,IAAK,kBACLC,EAAG,aACHC,GAAI,cACJC,IAAK,4BACLC,KAAM,mCAEVC,SAAU,CACNC,QAAS,UACTC,QAAS,aACTC,SAAU,WACVC,QAAS,WACTC,SAAU,mBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,UACRC,KAAM,WACN30C,EAAGo7C,EACHxG,GAAIwG,EACJxjD,EAAGwjD,EACHvG,GAAIuG,EACJtG,EAAGsG,EACHrG,GAAIqG,EACJr/B,EAAGq/B,EACHpG,GAAIoG,EACJnG,EAAGmG,EACHlG,GAAIkG,EACJjG,EAAGiG,EACHhG,GAAIgG,GAER7E,SAAU,SAAUpuD,GAChB,OAAOA,EAAOwP,QAAQ,iBAAiB,SAAUiH,GAC7C,OAAO43C,EAAU53C,OAGzBy3C,WAAY,SAAUluD,GAClB,OAAOA,EAAOwP,QAAQ,OAAO,SAAUiH,GACnC,OAAO03C,EAAU13C,OAGzBy0C,cAAe,qCACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,UAAb5C,GAAqC,UAAbA,EACjB4C,EAEM,WAAb5C,GACa,aAAbA,GACa,WAAbA,EAEO4C,GAAQ,GAAKA,EAAOA,EAAO,QAL/B,GAQX5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,GAAQ,GAAKA,EAAO,EACb,QACAA,EAAO,GACP,QACAA,EAAO,GACP,SACAA,EAAO,GACP,WAEA,UAGfX,KAAM,CACFC,IAAK,EACLC,IAAK,KAvMyB5yD,CAAQ,EAAQ,8FCGlD,SAAWkiD,GAAU,aAIdA,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,oFAAoFttC,MACxF,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,6CAA6CxtC,MAAM,KAC7DytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,4BACLC,KAAM,mCAEVZ,cAAe,8BACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,SAAb5C,EACO4C,EACa,cAAb5C,EACA4C,GAAQ,GAAKA,EAAOA,EAAO,GACd,WAAb5C,GAAsC,UAAbA,EACzB4C,EAAO,QADX,GAIX5C,SAAU,SAAUC,EAAOC,EAASC,GAChC,OAAIF,EAAQ,GACD,OACAA,EAAQ,GACR,YACAA,EAAQ,GACR,SAEA,SAGfU,SAAU,CACNC,QAAS,sBACTC,QAAS,kBACTC,SAAU,kBACVC,QAAS,sBACTC,SAAU,wBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,WACRC,KAAM,gBACN30C,EAAG,gBACH40C,GAAI,UACJh9C,EAAG,UACHi9C,GAAI,WACJC,EAAG,QACHC,GAAI,SACJh5B,EAAG,SACHi5B,GAAI,UACJC,EAAG,UACHC,GAAI,WACJC,EAAG,UACHC,GAAI,YAERI,KAAM,CACFC,IAAK,EACLC,IAAK,KAzEyB5yD,CAAQ,EAAQ,2FCElD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,oFAAoFttC,MACxF,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,6CAA6CxtC,MAAM,KAC7DytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,4BACLC,KAAM,mCAEVZ,cAAe,8BACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,SAAb5C,EACO4C,EACa,cAAb5C,EACA4C,GAAQ,GAAKA,EAAOA,EAAO,GACd,WAAb5C,GAAsC,UAAbA,EACzB4C,EAAO,QADX,GAIX5C,SAAU,SAAUC,EAAOC,EAASC,GAChC,OAAIF,EAAQ,GACD,OACAA,EAAQ,GACR,YACAA,EAAQ,GACR,SAEA,SAGfU,SAAU,CACNC,QAAS,sBACTC,QAAS,kBACTC,SAAU,kBACVC,QAAS,sBACTC,SAAU,wBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,WACRC,KAAM,gBACN30C,EAAG,gBACH40C,GAAI,UACJh9C,EAAG,UACHi9C,GAAI,WACJC,EAAG,QACHC,GAAI,SACJh5B,EAAG,SACHi5B,GAAI,UACJC,EAAG,UACHC,GAAI,WACJC,EAAG,UACHC,GAAI,YAERI,KAAM,CACFC,IAAK,EACLC,IAAK,KAzEyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,wFAAwFttC,MAC5F,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,iEAAiExtC,MACvE,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,iBACTC,QAAS,iBACTC,SAAU,gBACVC,QAAS,qBACTC,SAAU,4BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN30C,EAAG,eACH40C,GAAI,aACJh9C,EAAG,SACHi9C,GAAI,YACJC,EAAG,SACHC,GAAI,aACJh5B,EAAG,UACHi5B,GAAI,YACJC,EAAG,QACHC,GAAI,UACJC,EAAG,OACHC,GAAI,UAERC,uBAAwB,WACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KArDyB5yD,CAAQ,EAAQ,2FCKlD,SAAWkiD,GAAU,aAIzB,IAAIsR,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAGJxR,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,2FAA2FttC,MAC/F,KAEJutC,YAAa,mDAAmDvtC,MAAM,KACtEwtC,SAAU,wDAAwDxtC,MAC9D,KAEJytC,cAAe,2BAA2BztC,MAAM,KAChD0tC,YAAa,2BAA2B1tC,MAAM,KAE9CiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,kBACTC,QAAS,sBACTC,SAAU,gBACVC,QAAS,mBACTC,SAAU,6BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,gBACRC,KAAM,kBACN30C,EAAG,kBACH40C,GAAI,aACJh9C,EAAG,WACHi9C,GAAI,WACJC,EAAG,UACHC,GAAI,UACJh5B,EAAG,SACHi5B,GAAI,SACJC,EAAG,OACHC,GAAI,OACJC,EAAG,UACHC,GAAI,WAERmB,SAAU,SAAUpuD,GAChB,OAAOA,EAAOwP,QAAQ,iBAAiB,SAAUiH,GAC7C,OAAO43C,EAAU53C,OAGzBy3C,WAAY,SAAUluD,GAClB,OAAOA,EAAOwP,QAAQ,OAAO,SAAUiH,GACnC,OAAO03C,EAAU13C,OAGzB42C,KAAM,CACFC,IAAK,EACLC,IAAK,KAvFyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,qFAAqFttC,MACzF,KAEJutC,YAAa,6DAA6DvtC,MACtE,KAEJ6xC,kBAAkB,EAClBrE,SAAU,qDAAqDxtC,MAAM,KACrEytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,eACJC,IAAK,2BACLC,KAAM,iCAEVC,SAAU,CACNC,QAAS,iBACTC,QAAS,oBACTC,SAAU,gBACVC,QAAS,iBACTC,SAAU,0BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,WACN30C,EAAG,gBACH40C,GAAI,cACJh9C,EAAG,aACHi9C,GAAI,cACJC,EAAG,UACHC,GAAI,WACJh5B,EAAG,SACHi5B,GAAI,WACJiC,EAAG,SACHC,GAAI,UACJjC,EAAG,WACHC,GAAI,aACJC,EAAG,SACHC,GAAI,SAERC,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAzDyB5yD,CAAQ,EAAQ,2FCClD,SAAWkiD,GAAU,aAIzB,IAAIsR,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAGJxR,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,uFAAuFttC,MAC3F,KAEJutC,YAAa,uEAAuEvtC,MAChF,KAEJ6xC,kBAAkB,EAClBrE,SAAU,wDAAwDxtC,MAC9D,KAEJytC,cAAe,0CAA0CztC,MAAM,KAC/D0tC,YAAa,4BAA4B1tC,MAAM,KAC/CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,eACJC,IAAK,kBACLC,EAAG,aACHC,GAAI,cACJC,IAAK,4BACLC,KAAM,mCAEVsC,SAAU,SAAUpuD,GAChB,OAAOA,EAAOwP,QAAQ,iBAAiB,SAAUiH,GAC7C,OAAO43C,EAAU53C,OAGzBy3C,WAAY,SAAUluD,GAClB,OAAOA,EAAOwP,QAAQ,OAAO,SAAUiH,GACnC,OAAO03C,EAAU13C,OAGzBy0C,cAAe,yBACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,SAAb5C,EACO4C,EAAO,EAAIA,EAAOA,EAAO,GACZ,UAAb5C,EACA4C,EACa,WAAb5C,EACA4C,GAAQ,GAAKA,EAAOA,EAAO,GACd,SAAb5C,EACA4C,EAAO,QADX,GAIX5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,OACAA,EAAO,GACP,QACAA,EAAO,GACP,SACAA,EAAO,GACP,OAEA,QAGfjC,SAAU,CACNC,QAAS,UACTC,QAAS,YACTC,SAAU,qBACVC,QAAS,YACTC,SAAU,oBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,OACRC,KAAM,WACN30C,EAAG,YACH40C,GAAI,aACJh9C,EAAG,WACHi9C,GAAI,WACJC,EAAG,WACHC,GAAI,WACJh5B,EAAG,SACHi5B,GAAI,SACJC,EAAG,WACHC,GAAI,WACJC,EAAG,UACHC,GAAI,WAERI,KAAM,CACFC,IAAK,EACLC,IAAK,KAtHyB5yD,CAAQ,EAAQ,8FCIlD,SAAWkiD,GAAU,aAIzB,IAAI4U,EAAsB,6DAA6Dl0C,MAC/E,KAEJm0C,EAAyB,kDAAkDn0C,MACvE,KAEJmyC,EAAc,CACV,QACA,QACA,iBACA,QACA,SACA,cACA,cACA,QACA,QACA,QACA,QACA,SAEJC,EAAc,qKAEP9S,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,0FAA0FttC,MAC9F,KAEJutC,YAAa,SAAUr7C,EAAG4S,GACtB,OAAK5S,EAEM,QAAQmO,KAAKyE,GACbqvC,EAAuBjiD,EAAEshD,SAEzBU,EAAoBhiD,EAAEshD,SAJtBU,GAQf9B,YAAaA,EACbR,iBAAkBQ,EAClBK,kBAAmB,4FACnBC,uBAAwB,mFAExBP,YAAaA,EACbQ,gBAAiBR,EACjBS,iBAAkBT,EAElB3E,SAAU,6DAA6DxtC,MACnE,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,kBACTC,QAAS,iBACTC,SAAU,eACVC,QAAS,mBACTC,SAAU,2BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,UACRC,KAAM,aACN30C,EAAG,oBACH40C,GAAI,cACJh9C,EAAG,aACHi9C,GAAI,aACJC,EAAG,UACHC,GAAI,SACJh5B,EAAG,UACHi5B,GAAI,WACJC,EAAG,YACHC,GAAI,aACJC,EAAG,WACHC,GAAI,WAERC,uBAAwB,kBACxBC,QAAS,SAAUC,GACf,OACIA,GACY,IAAXA,GAA2B,IAAXA,GAAgBA,GAAU,GAAK,MAAQ,OAGhEC,KAAM,CACFC,IAAK,EACLC,IAAK,KAnGyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIzB,IAAI4U,EAAsB,6DAA6Dl0C,MAC/E,KAEJm0C,EAAyB,kDAAkDn0C,MACvE,KAEJmyC,EAAc,CACV,QACA,QACA,iBACA,QACA,SACA,cACA,cACA,QACA,QACA,QACA,QACA,SAEJC,EAAc,qKAET9S,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,0FAA0FttC,MAC9F,KAEJutC,YAAa,SAAUr7C,EAAG4S,GACtB,OAAK5S,EAEM,QAAQmO,KAAKyE,GACbqvC,EAAuBjiD,EAAEshD,SAEzBU,EAAoBhiD,EAAEshD,SAJtBU,GAQf9B,YAAaA,EACbR,iBAAkBQ,EAClBK,kBAAmB,4FACnBC,uBAAwB,mFAExBP,YAAaA,EACbQ,gBAAiBR,EACjBS,iBAAkBT,EAElB3E,SAAU,6DAA6DxtC,MACnE,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,kBACTC,QAAS,iBACTC,SAAU,eACVC,QAAS,mBACTC,SAAU,2BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,UACRC,KAAM,aACN30C,EAAG,oBACH40C,GAAI,cACJh9C,EAAG,aACHi9C,GAAI,aACJC,EAAG,UACHC,GAAI,SACJh5B,EAAG,UACHi5B,GAAI,WACJiC,EAAG,WACHC,GAAI,WACJjC,EAAG,YACHC,GAAI,aACJC,EAAG,WACHC,GAAI,WAERC,uBAAwB,kBACxBC,QAAS,SAAUC,GACf,OACIA,GACY,IAAXA,GAA2B,IAAXA,GAAgBA,GAAU,GAAK,MAAQ,OAGhEC,KAAM,CACFC,IAAK,EACLC,IAAK,KArGyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,qFAAqFttC,MACzF,KAEJutC,YAAa,6DAA6DvtC,MACtE,KAEJ6xC,kBAAkB,EAClBrE,SAAU,qDAAqDxtC,MAAM,KACrEytC,cAAe,+BAA+BztC,MAAM,KACpD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,eACJC,IAAK,0BACLC,KAAM,iCAEVC,SAAU,CACNC,QAAS,oBACTC,QAAS,uBACTC,SAAU,mBACVC,QAAS,oBACTC,SAAU,gCACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,WACN30C,EAAG,eACH40C,GAAI,YACJh9C,EAAG,aACHi9C,GAAI,YACJC,EAAG,WACHC,GAAI,WACJh5B,EAAG,UACHi5B,GAAI,WACJiC,EAAG,UACHC,GAAI,WACJjC,EAAG,YACHC,GAAI,aACJC,EAAG,SACHC,GAAI,SAERC,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAzDyB5yD,CAAQ,EAAQ,+FCElD,SAAWkiD,GAAU,aAIbA,EAAO+N,aAAa,SAAU,CACtCC,OAAQ,CACJ6D,WAAY,qFAAqFnxC,MAC7F,KAEJ8E,OAAQ,sHAAsH9E,MAC1H,KAEJoxC,SAAU,mBAEd7D,YAAa,+DAA+DvtC,MACxE,KAEJ6xC,kBAAkB,EAClBrE,SAAU,2DAA2DxtC,MACjE,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,mBACJyE,GAAI,aACJxE,IAAK,4BACLyE,IAAK,mBACLxE,KAAM,iCACNyE,KAAM,wBAEVxE,SAAU,CACNC,QAAS,aACTC,QAAS,eACTC,SAAU,cACVC,QAAS,aACTC,SAAU,qBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,YACRC,KAAM,QACN30C,EAAG,gBACH40C,GAAI,cACJh9C,EAAG,aACHi9C,GAAI,aACJC,EAAG,UACHC,GAAI,UACJh5B,EAAG,UACHi5B,GAAI,WACJC,EAAG,SACHC,GAAI,WACJC,EAAG,QACHC,GAAI,UAERC,uBAAwB,qBACxBC,QAAS,SAAUC,EAAQyB,GACvB,IAAI2B,EACW,IAAXpD,EACM,IACW,IAAXA,EACA,IACW,IAAXA,EACA,IACW,IAAXA,EACA,IACA,IAIV,MAHe,MAAXyB,GAA6B,MAAXA,IAClB2B,EAAS,KAENpD,EAASoD,GAEpBnD,KAAM,CACFC,IAAK,EACLC,IAAK,KAjFyB5yD,CAAQ,EAAQ,8FCGlD,SAAWkiD,GAAU,aAIzB,IAAIsR,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAGFxR,EAAO+N,aAAa,QAAS,CAEpCC,OAAQ,sEAAsEttC,MAC1E,KAEJutC,YAAa,sEAAsEvtC,MAC/E,KAEJwtC,SAAU,yDAAyDxtC,MAC/D,KAEJytC,cAAe,iCAAiCztC,MAAM,KACtD0tC,YAAa,iCAAiC1tC,MAAM,KACpDiuC,eAAgB,CACZC,GAAI,aACJC,IAAK,gBACLC,EAAG,aACHC,GAAI,cACJC,IAAK,0BACLC,KAAM,iCAEVC,SAAU,CACNC,QAAS,UACTC,QAAS,UACTC,SAAU,kBACVC,QAAS,UACTC,SAAU,mBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,UACRC,KAAM,WACN30C,EAAG,YACH40C,GAAI,WACJh9C,EAAG,UACHi9C,GAAI,UACJC,EAAG,WACHC,GAAI,UACJh5B,EAAG,UACHi5B,GAAI,SACJC,EAAG,YACHC,GAAI,WACJC,EAAG,UACHC,GAAI,UAERmB,SAAU,SAAUpuD,GAChB,OAAOA,EAAOwP,QAAQ,iBAAiB,SAAUiH,GAC7C,OAAO43C,EAAU53C,OAGzBy3C,WAAY,SAAUluD,GAClB,OAAOA,EAAOwP,QAAQ,OAAO,SAAUiH,GACnC,OAAO03C,EAAU13C,OAKzBy0C,cAAe,uBACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,QAAb5C,EACO4C,EAAO,EAAIA,EAAOA,EAAO,GACZ,SAAb5C,EACA4C,EACa,WAAb5C,EACA4C,GAAQ,GAAKA,EAAOA,EAAO,GACd,SAAb5C,EACA4C,EAAO,QADX,GAIX5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,MACAA,EAAO,GACP,OACAA,EAAO,GACP,SACAA,EAAO,GACP,OAEA,OAGfX,KAAM,CACFC,IAAK,EACLC,IAAK,KAvHyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIzB,IAAIqW,EAAmB,mGAAmG31C,MAClH,KAEJ41C,EAAmB,qGAAqG51C,MACpH,KAEJmyC,EAAc,CACV,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,SAER,SAASe,EAAOz1C,GACZ,OAAOA,EAAI,GAAK,GAAKA,EAAI,GAAK,MAAQA,EAAI,IAAM,IAAO,EAE3D,SAASo1C,EAAUhD,EAAQQ,EAAettD,GACtC,IAAIS,EAASqsD,EAAS,IACtB,OAAQ9sD,GACJ,IAAK,KACD,OAAOS,GAAU0vD,EAAOrD,GAAU,UAAY,UAClD,IAAK,IACD,OAAOQ,EAAgB,SAAW,SACtC,IAAK,KACD,OAAO7sD,GAAU0vD,EAAOrD,GAAU,SAAW,SACjD,IAAK,IACD,OAAOQ,EAAgB,UAAY,UACvC,IAAK,KACD,OAAO7sD,GAAU0vD,EAAOrD,GAAU,UAAY,UAClD,IAAK,KACD,OAAOrsD,GAAU0vD,EAAOrD,GAAU,WAAa,WACnD,IAAK,KACD,OAAOrsD,GAAU0vD,EAAOrD,GAAU,WAAa,YACnD,IAAK,KACD,OAAOrsD,GAAU0vD,EAAOrD,GAAU,OAAS,QAI9CvQ,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,SAAUgG,EAAgBxuC,GAC9B,OAAKwuC,EAEM,SAASjzC,KAAKyE,GACd8wC,EAAiBtC,EAAeE,SAEhCmC,EAAiBrC,EAAeE,SAJhCmC,GAOfpI,YAAa,kDAAkDvtC,MAAM,KACrEmyC,YAAaA,EACbQ,gBAAiBR,EACjBS,iBAAkBT,EAClB3E,SAAU,6DAA6DxtC,MACnE,KAEJytC,cAAe,2BAA2BztC,MAAM,KAChD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,cACTC,QAAS,eACTC,SAAU,WACN,OAAQzxD,KAAKm0D,OACT,KAAK,EACD,MAAO,qBAEX,KAAK,EACD,MAAO,mBAEX,KAAK,EACD,MAAO,iBAEX,KAAK,EACD,MAAO,kBAEX,QACI,MAAO,oBAGnBzC,QAAS,iBACTC,SAAU,WACN,OAAQ3xD,KAAKm0D,OACT,KAAK,EACD,MAAO,4BACX,KAAK,EACD,MAAO,wBACX,KAAK,EACD,MAAO,yBACX,QACI,MAAO,2BAGnBvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,UACN30C,EAAG,eACH40C,GAAI2D,EACJ3gD,EAAG2gD,EACH1D,GAAI0D,EACJzD,EAAGyD,EACHxD,GAAIwD,EACJx8B,EAAG,UACHi5B,GAAI,SACJiC,EAAG,UACHC,GAAIqB,EACJtD,EAAG,UACHC,GAAIqD,EACJpD,EAAG,MACHC,GAAImD,GAERlD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAzIyB5yD,CAAQ,EAAQ,8FCGlD,SAAWkiD,GAAU,aAIdA,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,2FAA2FttC,MAC/F,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,iFAAiFxtC,MACvF,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,wBACJC,IAAK,mCACLC,KAAM,0CAEVC,SAAU,CACNC,QAAS,eACTC,QAAS,iBACTC,SAAU,eACVC,QAAS,gBACTC,SAAU,WACN,OAAsB,IAAf3xD,KAAKm0D,OAA8B,IAAfn0D,KAAKm0D,MAC1B,wBACA,yBAEVvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,QACN30C,EAAG,kBACH40C,GAAI,cACJh9C,EAAG,YACHi9C,GAAI,aACJC,EAAG,WACHC,GAAI,WACJh5B,EAAG,SACHi5B,GAAI,UACJC,EAAG,SACHC,GAAI,WACJC,EAAG,SACHC,GAAI,WAERC,uBAAwB,WACxBC,QAAS,MACTkE,YAAa,kBAxDqB12D,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,2FAA2FttC,MAC/F,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,iFAAiFxtC,MACvF,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,wBACJC,IAAK,8BACLC,KAAM,qCAEVC,SAAU,CACNC,QAAS,eACTC,QAAS,iBACTC,SAAU,eACVC,QAAS,gBACTC,SAAU,WACN,OAAsB,IAAf3xD,KAAKm0D,OAA8B,IAAfn0D,KAAKm0D,MAC1B,wBACA,yBAEVvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,QACN30C,EAAG,WACH40C,GAAI,cACJh9C,EAAG,YACHi9C,GAAI,aACJC,EAAG,WACHC,GAAI,WACJh5B,EAAG,SACHi5B,GAAI,UACJiC,EAAG,aACHC,GAAI,aACJjC,EAAG,SACHC,GAAI,WACJC,EAAG,SACHC,GAAI,WAERC,uBAAwB,WACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA5DyB5yD,CAAQ,EAAQ,2FCKlD,SAAWkiD,GAAU,aAIzB,SAAS0R,EAAuBnB,EAAQQ,EAAettD,GACnD,IASI8yD,EAAY,IAIhB,OAHIhG,EAAS,KAAO,IAAOA,GAAU,KAAOA,EAAS,KAAQ,KACzDgG,EAAY,QAEThG,EAASgG,EAbH,CACL3G,GAAI,UACJC,GAAI,SACJE,GAAI,MACJC,GAAI,OACJkC,GAAI,YACJhC,GAAI,OACJE,GAAI,OAMuB3sD,GAG9Bu8C,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,oGAAoGttC,MACxG,KAEJutC,YAAa,+DAA+DvtC,MACxE,KAEJ6xC,kBAAkB,EAClBrE,SAAU,kDAAkDxtC,MAAM,KAClEytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,cACJC,IAAK,mBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,cACTC,QAAS,gBACTC,SAAU,eACVC,QAAS,eACTC,SAAU,uBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,WACRC,KAAM,aACN30C,EAAG,iBACH40C,GAAI8B,EACJ9+C,EAAG,WACHi9C,GAAI6B,EACJ5B,EAAG,QACHC,GAAI2B,EACJ36B,EAAG,OACHi5B,GAAI0B,EACJO,EAAG,cACHC,GAAIR,EACJzB,EAAG,SACHC,GAAIwB,EACJvB,EAAG,QACHC,GAAIsB,GAERlB,KAAM,CACFC,IAAK,EACLC,IAAK,KAvEyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAYzB,SAAS0R,EAAuBnB,EAAQQ,EAAettD,GAUnD,MAAY,MAARA,EACOstD,EAAgB,SAAW,SAE3BR,EAAS,KArBFoB,GAqB6BpB,EApB3CqB,EAQS,CACThC,GAAImB,EAAgB,yBAA2B,yBAC/ClB,GAAIkB,EAAgB,sBAAwB,sBAC5ChB,GAAI,iBACJC,GAAI,gBACJkC,GAAI,uBACJhC,GAAI,uBACJE,GAAI,gBAKgC3sD,GApBvBid,MAAM,KAChBixC,EAAM,IAAO,GAAKA,EAAM,KAAQ,GACjCC,EAAM,GACND,EAAM,IAAM,GAAKA,EAAM,IAAM,IAAMA,EAAM,IAAM,IAAMA,EAAM,KAAO,IAClEC,EAAM,GACNA,EAAM,IANhB,IAAsBD,EACdC,EAuBR,IAAIiB,EAAc,CACd,QACA,QACA,QACA,QACA,WACA,QACA,QACA,QACA,QACA,QACA,QACA,SAMK7S,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,CACJxoC,OAAQ,oFAAoF9E,MACxF,KAEJmxC,WAAY,kFAAkFnxC,MAC1F,MAGRutC,YAAa,CAETzoC,OAAQ,gEAAgE9E,MACpE,KAEJmxC,WAAY,gEAAgEnxC,MACxE,MAGRwtC,SAAU,CACN2D,WAAY,gEAAgEnxC,MACxE,KAEJ8E,OAAQ,gEAAgE9E,MACpE,KAEJoxC,SAAU,iDAEd3D,cAAe,uBAAuBztC,MAAM,KAC5C0tC,YAAa,uBAAuB1tC,MAAM,KAC1CmyC,YAAaA,EACbQ,gBAAiBR,EACjBS,iBAAkBT,EAGlBC,YAAa,2MAGbR,iBAAkB,2MAGlBa,kBAAmB,wHAGnBC,uBAAwB,6FACxBzE,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,iBACJC,IAAK,uBACLC,KAAM,8BAEVC,SAAU,CACNC,QAAS,kBACTC,QAAS,iBACTE,QAAS,gBACTD,SAAU,SAAUkG,GAChB,GAAIA,EAAI/E,SAAW5yD,KAAK4yD,OAcpB,OAAmB,IAAf5yD,KAAKm0D,MACE,oBAEA,mBAhBX,OAAQn0D,KAAKm0D,OACT,KAAK,EACD,MAAO,6BACX,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,6BACX,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,+BAUvBxC,SAAU,SAAUgG,GAChB,GAAIA,EAAI/E,SAAW5yD,KAAK4yD,OAcpB,OAAmB,IAAf5yD,KAAKm0D,MACE,oBAEA,mBAhBX,OAAQn0D,KAAKm0D,OACT,KAAK,EACD,MAAO,2BACX,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,2BACX,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,6BAUvBvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,WACRC,KAAM,WACN30C,EAAG,mBACH40C,GAAI8B,EACJ9+C,EAAG8+C,EACH7B,GAAI6B,EACJ5B,EAAG,MACHC,GAAI2B,EACJ36B,EAAG,OACHi5B,GAAI0B,EACJO,EAAG,SACHC,GAAIR,EACJzB,EAAG,QACHC,GAAIwB,EACJvB,EAAG,MACHC,GAAIsB,GAERrD,cAAe,wBACfC,KAAM,SAAU99C,GACZ,MAAO,iBAAiBuQ,KAAKvQ,IAEjC+9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,OACAA,EAAO,GACP,OACAA,EAAO,GACP,MAEA,UAGfd,uBAAwB,mBACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GACJ,IAAK,IACL,IAAK,IACL,IAAK,MACD,OAAOzB,EAAS,KACpB,IAAK,IACD,OAAOA,EAAS,MACpB,IAAK,IACL,IAAK,IACD,OAAOA,EAAS,KACpB,QACI,OAAOA,IAGnBC,KAAM,CACFC,IAAK,EACLC,IAAK,KA1MyB5yD,CAAQ,EAAQ,2FCClD,SAAWkiD,GAAU,aAIzB,IAAIgO,EAAS,CACL,QACA,UACA,OACA,QACA,MACA,MACA,SACA,OACA,UACA,SACA,QACA,SAEJwI,EAAO,CAAC,MAAO,OAAQ,QAAS,OAAQ,OAAQ,MAAO,QAElDxW,EAAO+N,aAAa,KAAM,CAC/BC,OAAQA,EACRC,YAAaD,EACbE,SAAUsI,EACVrI,cAAeqI,EACfpI,YAAaoI,EACb7H,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVZ,cAAe,UACfC,KAAM,SAAU99C,GACZ,MAAO,QAAUA,GAErB+9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,GACA,MAEJ,OAEXjC,SAAU,CACNC,QAAS,UACTC,QAAS,aACTC,SAAU,yBACVC,QAAS,aACTC,SAAU,4BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,QACN30C,EAAG,YACH40C,GAAI,WACJh9C,EAAG,SACHi9C,GAAI,SACJC,EAAG,UACHC,GAAI,UACJh5B,EAAG,WACHi5B,GAAI,WACJC,EAAG,WACHC,GAAI,WACJC,EAAG,SACHC,GAAI,UAERmB,SAAU,SAAUpuD,GAChB,OAAOA,EAAOwP,QAAQ,KAAM,MAEhC0+C,WAAY,SAAUluD,GAClB,OAAOA,EAAOwP,QAAQ,KAAM,MAEhC69C,KAAM,CACFC,IAAK,EACLC,IAAK,KA/EyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,mJAAmJttC,MACvJ,KAEJutC,YAAa,6DAA6DvtC,MACtE,KAEJwtC,SAAU,6EAA6ExtC,MACnF,KAEJytC,cAAe,mCAAmCztC,MAAM,KACxD0tC,YAAa,gBAAgB1tC,MAAM,KACnCiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,oBACJC,IAAK,gCACLC,KAAM,uCAEVC,SAAU,CACNC,QAAS,eACTC,QAAS,iBACTC,SAAU,eACVC,QAAS,eACTC,SAAU,wBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,YACRC,KAAM,WACN30C,EAAG,mBACH40C,GAAI,eACJh9C,EAAG,eACHi9C,GAAI,cACJC,EAAG,cACHC,GAAI,aACJh5B,EAAG,cACHi5B,GAAI,cACJC,EAAG,aACHC,GAAI,WACJC,EAAG,aACHC,GAAI,YAERC,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAvDyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAKhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,kGAAkGttC,MACtG,KAEJutC,YAAa,wDAAwDvtC,MACjE,KAEJwtC,SAAU,gEAAgExtC,MACtE,KAEJytC,cAAe,gCAAgCztC,MAAM,KACrD0tC,YAAa,qBAAqB1tC,MAAM,KACxCwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,SACJC,IAAK,YACLC,EAAG,aACHC,GAAI,cACJC,IAAK,sBACLC,KAAM,sCAEVC,SAAU,CACNC,QAAS,aACTC,QAAS,cACTC,SAAU,aACVC,QAAS,cACTC,SAAU,sBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,WACN30C,EAAG,eACH40C,GAAI,WACJh9C,EAAG,YACHi9C,GAAI,cACJC,EAAG,MACHC,GAAI,SACJh5B,EAAG,OACHi5B,GAAI,SACJC,EAAG,OACHC,GAAI,SACJC,EAAG,MACHC,GAAI,UAERC,uBAAwB,eACxBC,QAAS,SAAUC,GACf,OAAOA,EAAS,SAEpBlC,cAAe,4BACfC,KAAM,SAAU99C,GACZ,MAAiB,SAAVA,GAA8B,YAAVA,GAE/B+9C,SAAU,SAAUC,EAAOC,EAASC,GAChC,OAAIF,EAAQ,GACDE,EAAU,OAAS,UAEnBA,EAAU,QAAU,aAjED5wD,CAAQ,EAAQ,2FCIlD,SAAWkiD,GAAU,aAIzB,IAAIgO,EAAS,oFAAoFttC,MACzF,KAEJutC,EAAc,kDAAkDvtC,MAAM,KAC1E,SAASkzC,EAAOz1C,GACZ,OAAOA,EAAI,GAAKA,EAAI,EAExB,SAASo1C,EAAUhD,EAAQQ,EAAettD,EAAKutD,GAC3C,IAAI9sD,EAASqsD,EAAS,IACtB,OAAQ9sD,GACJ,IAAK,IACD,OAAOstD,GAAiBC,EAAW,aAAe,gBACtD,IAAK,KACD,OAAID,GAAiBC,EACV9sD,GAAU0vD,EAAOrD,GAAU,UAAY,UAEvCrsD,EAAS,YAExB,IAAK,IACD,OAAO6sD,EAAgB,SAAWC,EAAW,SAAW,UAC5D,IAAK,KACD,OAAID,GAAiBC,EACV9sD,GAAU0vD,EAAOrD,GAAU,SAAW,SAEtCrsD,EAAS,WAExB,IAAK,IACD,OAAO6sD,EAAgB,SAAWC,EAAW,SAAW,UAC5D,IAAK,KACD,OAAID,GAAiBC,EACV9sD,GAAU0vD,EAAOrD,GAAU,SAAW,SAEtCrsD,EAAS,WAExB,IAAK,IACD,OAAO6sD,GAAiBC,EAAW,MAAQ,OAC/C,IAAK,KACD,OAAID,GAAiBC,EACV9sD,GAAU0vD,EAAOrD,GAAU,MAAQ,OAEnCrsD,EAAS,QAExB,IAAK,IACD,OAAO6sD,GAAiBC,EAAW,SAAW,WAClD,IAAK,KACD,OAAID,GAAiBC,EACV9sD,GAAU0vD,EAAOrD,GAAU,UAAY,YAEvCrsD,EAAS,WAExB,IAAK,IACD,OAAO6sD,GAAiBC,EAAW,MAAQ,QAC/C,IAAK,KACD,OAAID,GAAiBC,EACV9sD,GAAU0vD,EAAOrD,GAAU,OAAS,SAEpCrsD,EAAS,SAKvB87C,EAAO+N,aAAa,KAAM,CAC/BC,OAAQA,EACRC,YAAaA,EACbC,SAAU,sDAAsDxtC,MAAM,KACtEytC,cAAe,uBAAuBztC,MAAM,KAC5C0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,eACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,cACTC,QAAS,gBACTC,SAAU,WACN,OAAQzxD,KAAKm0D,OACT,KAAK,EACD,MAAO,kBACX,KAAK,EACL,KAAK,EACD,MAAO,kBACX,KAAK,EACD,MAAO,kBACX,KAAK,EACD,MAAO,oBACX,KAAK,EACD,MAAO,kBACX,KAAK,EACD,MAAO,oBAGnBzC,QAAS,eACTC,SAAU,WACN,OAAQ3xD,KAAKm0D,OACT,KAAK,EACD,MAAO,uBACX,KAAK,EACL,KAAK,EACD,MAAO,uBACX,KAAK,EACD,MAAO,uBACX,KAAK,EACL,KAAK,EACD,MAAO,uBACX,KAAK,EACD,MAAO,yBAGnBvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,UACN30C,EAAGu4C,EACH3D,GAAI2D,EACJ3gD,EAAG2gD,EACH1D,GAAI0D,EACJzD,EAAGyD,EACHxD,GAAIwD,EACJx8B,EAAGw8B,EACHvD,GAAIuD,EACJtD,EAAGsD,EACHrD,GAAIqD,EACJpD,EAAGoD,EACHnD,GAAImD,GAERlD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA7IyB5yD,CAAQ,EAAQ,2FCElD,SAAWkiD,GAAU,aAIzB,SAAS6T,EAAoBtD,EAAQQ,EAAettD,EAAKutD,GACrD,IAAI9sD,EAASqsD,EAAS,IACtB,OAAQ9sD,GACJ,IAAK,IACD,OAAOstD,GAAiBC,EAClB,eACA,kBACV,IAAK,KAUD,OARI9sD,GADW,IAAXqsD,EACUQ,EAAgB,UAAY,UACpB,IAAXR,EACGQ,GAAiBC,EAAW,UAAY,WAC3CT,EAAS,EACNQ,GAAiBC,EAAW,UAAY,WAExC,UAGlB,IAAK,IACD,OAAOD,EAAgB,aAAe,aAC1C,IAAK,KAUD,OARI7sD,GADW,IAAXqsD,EACUQ,EAAgB,SAAW,SACnB,IAAXR,EACGQ,GAAiBC,EAAW,SAAW,WAC1CT,EAAS,EACNQ,GAAiBC,EAAW,SAAW,WAEvCD,GAAiBC,EAAW,QAAU,YAGxD,IAAK,IACD,OAAOD,EAAgB,UAAY,UACvC,IAAK,KAUD,OARI7sD,GADW,IAAXqsD,EACUQ,EAAgB,MAAQ,MAChB,IAAXR,EACGQ,GAAiBC,EAAW,MAAQ,QACvCT,EAAS,EACNQ,GAAiBC,EAAW,MAAQ,QAEpCD,GAAiBC,EAAW,KAAO,SAGrD,IAAK,IACD,OAAOD,GAAiBC,EAAW,SAAW,YAClD,IAAK,KAQD,OANI9sD,GADW,IAAXqsD,EACUQ,GAAiBC,EAAW,MAAQ,OAC5B,IAAXT,EACGQ,GAAiBC,EAAW,MAAQ,UAEpCD,GAAiBC,EAAW,MAAQ,SAGtD,IAAK,IACD,OAAOD,GAAiBC,EAAW,WAAa,eACpD,IAAK,KAUD,OARI9sD,GADW,IAAXqsD,EACUQ,GAAiBC,EAAW,QAAU,UAC9B,IAAXT,EACGQ,GAAiBC,EAAW,SAAW,WAC1CT,EAAS,EACNQ,GAAiBC,EAAW,SAAW,SAEvCD,GAAiBC,EAAW,UAAY,UAG1D,IAAK,IACD,OAAOD,GAAiBC,EAAW,WAAa,aACpD,IAAK,KAUD,OARI9sD,GADW,IAAXqsD,EACUQ,GAAiBC,EAAW,OAAS,QAC7B,IAAXT,EACGQ,GAAiBC,EAAW,OAAS,SACxCT,EAAS,EACNQ,GAAiBC,EAAW,OAAS,OAErCD,GAAiBC,EAAW,MAAQ,SAMrDhR,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,wFAAwFttC,MAC5F,KAEJutC,YAAa,8DAA8DvtC,MACvE,KAEJ6xC,kBAAkB,EAClBrE,SAAU,sDAAsDxtC,MAAM,KACtEytC,cAAe,qCAAqCztC,MAAM,KAC1D0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,eACHC,GAAI,eACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,gBACTC,QAAS,gBAETC,SAAU,WACN,OAAQzxD,KAAKm0D,OACT,KAAK,EACD,MAAO,wBACX,KAAK,EACD,MAAO,sBACX,KAAK,EACD,MAAO,uBACX,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,qBAGnBzC,QAAS,iBACTC,SAAU,WACN,OAAQ3xD,KAAKm0D,OACT,KAAK,EACD,MAAO,+BACX,KAAK,EACD,MAAO,6BACX,KAAK,EACD,MAAO,8BACX,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,4BAGnBvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,UACN30C,EAAG64C,EACHjE,GAAIiE,EACJjhD,EAAGihD,EACHhE,GAAIgE,EACJ/D,EAAG+D,EACH9D,GAAI8D,EACJ98B,EAAG88B,EACH7D,GAAI6D,EACJ5D,EAAG4D,EACH3D,GAAI2D,EACJ1D,EAAG0D,EACHzD,GAAIyD,GAERxD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAxKyB5yD,CAAQ,EAAQ,2FCKlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,gFAAgFttC,MACpF,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,4DAA4DxtC,MAClE,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,mBAAmB1tC,MAAM,KACtCwwC,oBAAoB,EACpB7C,cAAe,QACfC,KAAM,SAAU99C,GACZ,MAA2B,MAApBA,EAAMnN,OAAO,IAExBkrD,SAAU,SAAUC,EAAOC,EAASC,GAChC,OAAOF,EAAQ,GAAK,KAAO,MAE/BG,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,cACTC,QAAS,gBACTC,SAAU,eACVC,QAAS,cACTC,SAAU,wBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,aACN30C,EAAG,eACH40C,GAAI,aACJh9C,EAAG,aACHi9C,GAAI,YACJC,EAAG,UACHC,GAAI,SACJh5B,EAAG,WACHi5B,GAAI,UACJC,EAAG,WACHC,GAAI,UACJC,EAAG,UACHC,GAAI,WAERC,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA7DyB5yD,CAAQ,EAAQ,gGCElD,SAAWkiD,GAAU,aAIzB,IAAIgW,EAAa,CACbC,MAAO,CAEHrG,GAAI,CAAC,UAAW,UAAW,WAC3Bh9C,EAAG,CAAC,cAAe,gBACnBi9C,GAAI,CAAC,QAAS,SAAU,UACxBC,EAAG,CAAC,YAAa,eACjBC,GAAI,CAAC,MAAO,OAAQ,QACpBC,GAAI,CAAC,MAAO,OAAQ,QACpBE,GAAI,CAAC,QAAS,SAAU,UACxBE,GAAI,CAAC,SAAU,SAAU,WAE7B8F,uBAAwB,SAAU3F,EAAQ4F,GACtC,OAAkB,IAAX5F,EACD4F,EAAQ,GACR5F,GAAU,GAAKA,GAAU,EACzB4F,EAAQ,GACRA,EAAQ,IAElB5C,UAAW,SAAUhD,EAAQQ,EAAettD,GACxC,IAAI0yD,EAAUH,EAAWC,MAAMxyD,GAC/B,OAAmB,IAAfA,EAAIuJ,OACG+jD,EAAgBoF,EAAQ,GAAKA,EAAQ,GAGxC5F,EACA,IACAyF,EAAWE,uBAAuB3F,EAAQ4F,KAM7CnW,EAAO+N,aAAa,UAAW,CACxCC,OAAQ,mFAAmFttC,MACvF,KAEJutC,YAAa,2DAA2DvtC,MACpE,KAEJ6xC,kBAAkB,EAClBrE,SAAU,sDAAsDxtC,MAAM,KACtEytC,cAAe,qCAAqCztC,MAAM,KAC1D0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,cACHC,GAAI,gBACJC,IAAK,qBACLC,KAAM,4BAEVC,SAAU,CACNC,QAAS,eACTC,QAAS,eACTC,SAAU,WACN,OAAQzxD,KAAKm0D,OACT,KAAK,EACD,MAAO,sBACX,KAAK,EACD,MAAO,qBACX,KAAK,EACD,MAAO,sBACX,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,oBAGnBzC,QAAS,cACTC,SAAU,WAUN,MATmB,CACf,2BACA,+BACA,4BACA,0BACA,8BACA,2BACA,4BAEgB3xD,KAAKm0D,QAE7BvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN30C,EAAG,mBACH40C,GAAIoG,EAAWzC,UACf3gD,EAAGojD,EAAWzC,UACd1D,GAAImG,EAAWzC,UACfzD,EAAGkG,EAAWzC,UACdxD,GAAIiG,EAAWzC,UACfx8B,EAAG,MACHi5B,GAAIgG,EAAWzC,UACftD,EAAG,QACHC,GAAI8F,EAAWzC,UACfpD,EAAG,SACHC,GAAI4F,EAAWzC,WAEnBlD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAjHyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIzB,IAAIgW,EAAa,CACbC,MAAO,CAEHrG,GAAI,CAAC,UAAW,UAAW,WAC3Bh9C,EAAG,CAAC,cAAe,gBACnBi9C,GAAI,CAAC,QAAS,SAAU,UACxBC,EAAG,CAAC,YAAa,eACjBC,GAAI,CAAC,MAAO,OAAQ,QACpBC,GAAI,CAAC,MAAO,OAAQ,QACpBE,GAAI,CAAC,QAAS,SAAU,UACxBE,GAAI,CAAC,SAAU,SAAU,WAE7B8F,uBAAwB,SAAU3F,EAAQ4F,GACtC,OAAkB,IAAX5F,EACD4F,EAAQ,GACR5F,GAAU,GAAKA,GAAU,EACzB4F,EAAQ,GACRA,EAAQ,IAElB5C,UAAW,SAAUhD,EAAQQ,EAAettD,GACxC,IAAI0yD,EAAUH,EAAWC,MAAMxyD,GAC/B,OAAmB,IAAfA,EAAIuJ,OACG+jD,EAAgBoF,EAAQ,GAAKA,EAAQ,GAGxC5F,EACA,IACAyF,EAAWE,uBAAuB3F,EAAQ4F,KAMjDnW,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,mFAAmFttC,MACvF,KAEJutC,YAAa,2DAA2DvtC,MACpE,KAEJ6xC,kBAAkB,EAClBrE,SAAU,wDAAwDxtC,MAC9D,KAEJytC,cAAe,qCAAqCztC,MAAM,KAC1D0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,cACHC,GAAI,gBACJC,IAAK,qBACLC,KAAM,4BAEVC,SAAU,CACNC,QAAS,eACTC,QAAS,eACTC,SAAU,WACN,OAAQzxD,KAAKm0D,OACT,KAAK,EACD,MAAO,uBACX,KAAK,EACD,MAAO,qBACX,KAAK,EACD,MAAO,sBACX,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACD,MAAO,oBAGnBzC,QAAS,cACTC,SAAU,WAUN,MATmB,CACf,4BACA,gCACA,4BACA,0BACA,8BACA,2BACA,4BAEgB3xD,KAAKm0D,QAE7BvC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,SACN30C,EAAG,mBACH40C,GAAIoG,EAAWzC,UACf3gD,EAAGojD,EAAWzC,UACd1D,GAAImG,EAAWzC,UACfzD,EAAGkG,EAAWzC,UACdxD,GAAIiG,EAAWzC,UACfx8B,EAAG,MACHi5B,GAAIgG,EAAWzC,UACftD,EAAG,QACHC,GAAI8F,EAAWzC,UACfpD,EAAG,SACHC,GAAI4F,EAAWzC,WAEnBlD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAnHyB5yD,CAAQ,EAAQ,2FCElD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,mHAAmHttC,MACvH,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,sEAAsExtC,MAC5E,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,SACJC,IAAK,YACLC,EAAG,aACHC,GAAI,cACJC,IAAK,qBACLC,KAAM,4BAEVC,SAAU,CACNC,QAAS,mBACTC,QAAS,kBACTC,SAAU,gBACVC,QAAS,iBACTC,SAAU,8BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,iBACN30C,EAAG,qBACH40C,GAAI,cACJh9C,EAAG,SACHi9C,GAAI,aACJC,EAAG,SACHC,GAAI,aACJh5B,EAAG,UACHi5B,GAAI,cACJC,EAAG,UACHC,GAAI,cACJC,EAAG,UACHC,GAAI,eAER/B,cAAe,mCACfE,SAAU,SAAUC,EAAOC,EAASC,GAChC,OAAIF,EAAQ,GACD,UACAA,EAAQ,GACR,QACAA,EAAQ,GACR,aAEA,WAGf6D,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,YAAb5C,EACO4C,EACa,UAAb5C,EACA4C,GAAQ,GAAKA,EAAOA,EAAO,GACd,eAAb5C,GAA0C,YAAbA,EACvB,IAAT4C,EACO,EAEJA,EAAO,QAJX,GAOXd,uBAAwB,UACxBC,QAAS,KACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAjFyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,wFAAwFttC,MAC5F,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,oDAAoDxtC,MAAM,KACpEytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,0BACLC,KAAM,+BACNwE,IAAK,mBACLC,KAAM,wBAEVxE,SAAU,CACNC,QAAS,YACTC,QAAS,eACTE,QAAS,YACTD,SAAU,eACVE,SAAU,iBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,eACN30C,EAAG,iBACH40C,GAAI,cACJh9C,EAAG,WACHi9C,GAAI,aACJC,EAAG,WACHC,GAAI,YACJh5B,EAAG,SACHi5B,GAAI,WACJC,EAAG,WACHC,GAAI,aACJC,EAAG,SACHC,GAAI,SAERC,uBAAwB,mBACxBC,QAAS,SAAUC,GACf,IAAI/zC,EAAI+zC,EAAS,GAWjB,OAAOA,GAT6B,MAAxBA,EAAS,IAAO,IACd,KACM,IAAN/zC,GAEM,IAANA,EADA,KAIA,OAIlBg0C,KAAM,CACFC,IAAK,EACLC,IAAK,KAlEyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,sFAAsFttC,MAC1F,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,8DAA8DxtC,MACpE,KAEJytC,cAAe,kCAAkCztC,MAAM,KACvD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,UACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,eACTC,QAAS,iBACTC,SAAU,8BACVC,QAAS,YACTC,SAAU,kCACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,aACRC,KAAM,WACN30C,EAAG,aACH40C,GAAI,aACJh9C,EAAG,cACHi9C,GAAI,YACJC,EAAG,aACHC,GAAI,WACJh5B,EAAG,YACHi5B,GAAI,UACJC,EAAG,cACHC,GAAI,WACJC,EAAG,cACHC,GAAI,YAERI,KAAM,CACFC,IAAK,EACLC,IAAK,KApDyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIzB,IAAIsR,EAAY,CACR,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,IACH,EAAG,KAEPE,EAAY,CACR,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,IACL,IAAK,KAGJxR,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,0FAA0FttC,MAC9F,KAEJutC,YAAa,0FAA0FvtC,MACnG,KAEJwtC,SAAU,8FAA8FxtC,MACpG,KAEJytC,cAAe,mDAAmDztC,MAC9D,KAEJ0tC,YAAa,sBAAsB1tC,MAAM,KACzCiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,qBACLC,KAAM,4BAEVC,SAAU,CACNC,QAAS,aACTC,QAAS,YACTC,SAAU,WACVC,QAAS,cACTC,SAAU,yBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,UACN30C,EAAG,oBACH40C,GAAI,eACJh9C,EAAG,cACHi9C,GAAI,gBACJC,EAAG,gBACHC,GAAI,eACJh5B,EAAG,WACHi5B,GAAI,aACJC,EAAG,YACHC,GAAI,cACJC,EAAG,aACHC,GAAI,eAERC,uBAAwB,aACxBC,QAAS,SAAUC,GACf,OAAOA,EAAS,OAEpBgB,SAAU,SAAUpuD,GAChB,OAAOA,EAAOwP,QAAQ,iBAAiB,SAAUiH,GAC7C,OAAO43C,EAAU53C,OAGzBy3C,WAAY,SAAUluD,GAClB,OAAOA,EAAOwP,QAAQ,OAAO,SAAUiH,GACnC,OAAO03C,EAAU13C,OAIzBy0C,cAAe,wCACfE,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,SACAA,EAAO,EACP,SACAA,EAAO,GACP,QACAA,EAAO,GACP,WACAA,EAAO,GACP,WACAA,EAAO,GACP,QAEA,UAGfkB,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,UAAb5C,EACO4C,EAAO,EAAIA,EAAOA,EAAO,GACZ,UAAb5C,GAAqC,SAAbA,GAEX,YAAbA,GACA4C,GAAQ,GAFRA,EAIAA,EAAO,IAGtBX,KAAM,CACFC,IAAK,EACLC,IAAK,KA/HyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,wFAAwFttC,MAC5F,KAEJutC,YAAa,mEAAmEvtC,MAC5E,KAEJ6xC,kBAAkB,EAClBrE,SAAU,8DAA8DxtC,MACpE,KAEJytC,cAAe,kCAAkCztC,MAAM,KACvD0tC,YAAa,qBAAqB1tC,MAAM,KACxCiuC,eAAgB,CACZC,GAAI,SACJC,IAAK,YACLC,EAAG,aACHC,GAAI,cACJC,IAAK,sBACLC,KAAM,6BAEVC,SAAU,CACNC,QAAS,YACTC,QAAS,YACTC,SAAU,WACVC,QAAS,aACTC,SAAU,gBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,YACN30C,EAAG,iBACH40C,GAAI,aACJh9C,EAAG,YACHi9C,GAAI,cACJC,EAAG,SACHC,GAAI,WACJh5B,EAAG,UACHi5B,GAAI,YACJC,EAAG,SACHC,GAAI,WACJC,EAAG,cACHC,GAAI,iBAERC,uBAAwB,WACxBC,QAAS,MACTjC,cAAe,iCACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,WAAb5C,EACO4C,EAAO,EAAIA,EAAOA,EAAO,GACZ,SAAb5C,EACA4C,EACa,cAAb5C,EACA4C,GAAQ,GAAKA,EAAOA,EAAO,GACd,aAAb5C,EACA4C,EAAO,QADX,GAIX5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,SACAA,EAAO,GACP,OACAA,EAAO,GACP,YACAA,EAAO,GACP,WAEA,UAGfX,KAAM,CACFC,IAAK,EACLC,IAAK,KApFyB5yD,CAAQ,EAAQ,4FCKlD,SAAWkiD,GAAU,aAIfA,EAAO+N,aAAa,MAAO,CACjCC,OAAQ,0FAA0FttC,MAC9F,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,kDAAkDxtC,MAAM,KAClEytC,cAAe,iCAAiCztC,MAAM,KACtD0tC,YAAa,yBAAyB1tC,MAAM,KAC5CiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,gBACTC,QAAS,gBACTC,SAAU,gBACVC,QAAS,oBACTC,SAAU,+BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,WACN30C,EAAG,gBACH40C,GAAI,aACJh9C,EAAG,aACHi9C,GAAI,YACJC,EAAG,WACHC,GAAI,UACJh5B,EAAG,YACHi5B,GAAI,WACJC,EAAG,YACHC,GAAI,WACJC,EAAG,YACHC,GAAI,YAERC,uBAAwB,uBACxBC,QAAS,SAAUC,GACf,IAAI/zC,EAAI+zC,EAAS,GAWjB,OAAOA,GAT6B,MAAxBA,EAAS,IAAO,IACd,KACM,IAAN/zC,EACA,KACM,IAANA,EACA,KACM,IAANA,EACA,KACA,OAGlBg0C,KAAM,CACFC,IAAK,EACLC,IAAK,KAhEyB5yD,CAAQ,EAAQ,2FCClD,SAAWkiD,GAAU,aAIzB,IAAIyR,EAAW,CACX,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,EAAG,MACH,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,GAAI,MACJ,IAAK,OAGAzR,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,CACJxoC,OAAQ,qFAAqF9E,MACzF,KAEJmxC,WAAY,yEAAyEnxC,MACjF,MAGRutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,yDAAyDxtC,MAC/D,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,mBACTC,QAAS,mBACTE,QAAS,mBACTD,SAAU,kCACVE,SAAU,oCACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,WACRC,KAAM,SACN30C,EAAG,eACHpI,EAAG,YACHi9C,GAAI,YACJC,EAAG,UACHC,GAAI,UACJh5B,EAAG,SACHi5B,GAAI,SACJC,EAAG,SACHC,GAAI,SACJC,EAAG,SACHC,GAAI,UAER/B,cAAe,qBACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,QAAb5C,EACO4C,EAAO,EAAIA,EAAOA,EAAO,GACZ,SAAb5C,EACA4C,EACa,QAAb5C,EACA4C,GAAQ,GAAKA,EAAOA,EAAO,GACd,UAAb5C,EACA4C,EAAO,QADX,GAIX5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,MACAA,EAAO,GACP,OACAA,EAAO,GACP,MACAA,EAAO,GACP,QAEA,OAGfd,uBAAwB,kBACxBC,QAAS,SAAUC,GAGf,OAAOA,GAAUkB,EAASlB,IAAWkB,EAF7BlB,EAAS,KAEmCkB,EAD5ClB,GAAU,IAAM,IAAM,QAGlCC,KAAM,CACFC,IAAK,EACLC,IAAK,KAlHyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,oGAAoGttC,MACxG,KAEJutC,YAAa,iEAAiEvtC,MAC1E,KAEJ6xC,kBAAkB,EAClBrE,SAAU,iDAAiDxtC,MAAM,KACjEytC,cAAe,8CAA8CztC,MAAM,KACnE0tC,YAAa,yBAAyB1tC,MAAM,KAC5CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,OACJC,IAAK,UACLC,EAAG,aACHC,GAAI,cACJC,IAAK,wBACLC,KAAM,oCAEVZ,cAAe,wBACfC,KAAM,SAAU99C,GACZ,MAAiB,eAAVA,GAEX+9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,GACA,aAEA,cAGfjC,SAAU,CACNC,QAAS,mBACTC,QAAS,qBACTC,SAAU,qBACVC,QAAS,wBACTC,SAAU,6BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,YACN30C,EAAG,eACH40C,GAAI,YACJh9C,EAAG,SACHi9C,GAAI,UACJC,EAAG,YACHC,GAAI,aACJh5B,EAAG,QACHi5B,GAAI,SACJiC,EAAG,YACHC,GAAI,aACJjC,EAAG,UACHC,GAAI,WACJC,EAAG,OACHC,GAAI,WA9D0BtyD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIzB,IAAIyR,EAAW,CACX,EAAG,QACH,EAAG,QACH,EAAG,QACH,GAAI,QACJ,GAAI,QACJ,EAAG,OACH,EAAG,OACH,GAAI,OACJ,GAAI,OACJ,EAAG,QACH,EAAG,QACH,IAAK,QACL,EAAG,OACH,EAAG,QACH,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,SAGCzR,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,+EAA+EttC,MACnF,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,wDAAwDxtC,MAC9D,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,mBACTC,QAAS,mBACTC,SAAU,2BACVC,QAAS,YACTC,SAAU,0BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,QACN30C,EAAG,iBACHpI,EAAG,YACHi9C,GAAI,WACJC,EAAG,YACHC,GAAI,WACJh5B,EAAG,UACHi5B,GAAI,SACJC,EAAG,SACHC,GAAI,QACJC,EAAG,UACHC,GAAI,UAERE,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GACJ,IAAK,IACL,IAAK,IACL,IAAK,KACL,IAAK,KACD,OAAOzB,EACX,QACI,GAAe,IAAXA,EAEA,OAAOA,EAAS,QAEpB,IAAIl1C,EAAIk1C,EAAS,GAGjB,OAAOA,GAAUkB,EAASp2C,IAAMo2C,EAFvBlB,EAAS,IAAOl1C,IAEsBo2C,EADvClB,GAAU,IAAM,IAAM,SAI1CC,KAAM,CACFC,IAAK,EACLC,IAAK,KAzFyB5yD,CAAQ,EAAQ,8FCGlD,SAAWkiD,GAAU,aAIdA,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,0FAA0FttC,MAC9F,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,yDAAyDxtC,MAC/D,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,wBAAwB1tC,MAAM,KAC3CiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,YACHC,GAAI,eACJC,IAAK,qBACLC,KAAM,6BAEVC,SAAU,CACNC,QAAS,oBACTC,QAAS,gBACTC,SAAU,0BACVC,QAAS,eACTC,SAAU,4BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,gBACRC,KAAM,mBACN30C,EAAG,gBACH40C,GAAI,aACJh9C,EAAG,eACHi9C,GAAI,YACJC,EAAG,aACHC,GAAI,UACJh5B,EAAG,aACHi5B,GAAI,UACJC,EAAG,cACHC,GAAI,WACJC,EAAG,aACHC,GAAI,WAERC,uBAAwB,UACxBC,QAAS,SAAUC,GACf,OAAOA,GAEXC,KAAM,CACFC,IAAK,EACLC,IAAK,KAvDyB5yD,CAAQ,EAAQ,4FCGlD,SAAWkiD,GAAU,aAIzB,IAAIyW,EAAe,iDAAiD/1C,MAAM,KA4B1E,SAAS6yC,EAAUhD,EAAQQ,EAAe5tD,EAAQ6tD,GAC9C,IAAI0F,EAiBR,SAAsBnG,GAClB,IAAIoG,EAAUj3C,KAAKk3C,MAAOrG,EAAS,IAAQ,KACvCsG,EAAMn3C,KAAKk3C,MAAOrG,EAAS,IAAO,IAClCuG,EAAMvG,EAAS,GACfwG,EAAO,GAUX,OATIJ,EAAU,IACVI,GAAQN,EAAaE,GAAW,SAEhCE,EAAM,IACNE,IAAkB,KAATA,EAAc,IAAM,IAAMN,EAAaI,GAAO,OAEvDC,EAAM,IACNC,IAAkB,KAATA,EAAc,IAAM,IAAMN,EAAaK,IAEpC,KAATC,EAAc,OAASA,EA/BbC,CAAazG,GAC9B,OAAQptD,GACJ,IAAK,KACD,OAAOuzD,EAAa,OACxB,IAAK,KACD,OAAOA,EAAa,OACxB,IAAK,KACD,OAAOA,EAAa,OACxB,IAAK,KACD,OAAOA,EAAa,OACxB,IAAK,KACD,OAAOA,EAAa,OACxB,IAAK,KACD,OAAOA,EAAa,QAqBtB1W,EAAO+N,aAAa,MAAO,CACjCC,OAAQ,kMAAkMttC,MACtM,KAEJutC,YAAa,0HAA0HvtC,MACnI,KAEJ6xC,kBAAkB,EAClBrE,SAAU,2DAA2DxtC,MACjE,KAEJytC,cAAe,2DAA2DztC,MACtE,KAEJ0tC,YAAa,2DAA2D1tC,MACpE,KAEJiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,cACTC,QAAS,cACTC,SAAU,MACVC,QAAS,cACTC,SAAU,MACVC,SAAU,KAEdC,aAAc,CACVC,OA/FR,SAAyBiE,GACrB,IAAIsD,EAAOtD,EASX,OAP+B,IAA3BA,EAAO7nD,QAAQ,OACTmrD,EAAKv3D,MAAM,GAAI,GAAK,OACO,IAA3Bi0D,EAAO7nD,QAAQ,OACfmrD,EAAKv3D,MAAM,GAAI,GAAK,OACO,IAA3Bi0D,EAAO7nD,QAAQ,OACfmrD,EAAKv3D,MAAM,GAAI,GAAK,MACpBu3D,EAAO,QAuFbtH,KAnFR,SAAuBgE,GACnB,IAAIsD,EAAOtD,EASX,OAP+B,IAA3BA,EAAO7nD,QAAQ,OACTmrD,EAAKv3D,MAAM,GAAI,GAAK,OACO,IAA3Bi0D,EAAO7nD,QAAQ,OACfmrD,EAAKv3D,MAAM,GAAI,GAAK,OACO,IAA3Bi0D,EAAO7nD,QAAQ,OACfmrD,EAAKv3D,MAAM,GAAI,GAAK,MACpBu3D,EAAO,QA2Ebj8C,EAAG,UACH40C,GAAI2D,EACJ3gD,EAAG,UACHi9C,GAAI0D,EACJzD,EAAG,UACHC,GAAIwD,EACJx8B,EAAG,UACHi5B,GAAIuD,EACJtD,EAAG,UACHC,GAAIqD,EACJpD,EAAG,UACHC,GAAImD,GAERlD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KA3HyB5yD,CAAQ,EAAQ,2FCIlD,SAAWkiD,GAAU,aAIzB,IAAIyR,EAAW,CACX,EAAG,QACH,EAAG,QACH,EAAG,QACH,GAAI,QACJ,GAAI,QACJ,EAAG,OACH,EAAG,OACH,GAAI,OACJ,GAAI,OACJ,EAAG,QACH,EAAG,QACH,IAAK,QACL,EAAG,OACH,EAAG,QACH,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,SAGCzR,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,6EAA6EttC,MACjF,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,wDAAwDxtC,MAC9D,KAEJytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1C6tC,SAAU,SAAUC,EAAOC,EAASC,GAChC,OAAIF,EAAQ,GACDE,EAAU,KAAO,KAEjBA,EAAU,KAAO,MAGhCL,cAAe,cACfC,KAAM,SAAU99C,GACZ,MAAiB,OAAVA,GAA4B,OAAVA,GAE7Bm+C,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,kBACTC,QAAS,kBACTC,SAAU,2BACVC,QAAS,WACTC,SAAU,yBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,WACRC,KAAM,UACN30C,EAAG,gBACH40C,GAAI,YACJh9C,EAAG,aACHi9C,GAAI,YACJC,EAAG,WACHC,GAAI,UACJh5B,EAAG,UACHi5B,GAAI,SACJiC,EAAG,YACHC,GAAI,WACJjC,EAAG,SACHC,GAAI,QACJC,EAAG,UACHC,GAAI,UAERE,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GACJ,IAAK,IACL,IAAK,IACL,IAAK,KACL,IAAK,KACD,OAAOzB,EACX,QACI,GAAe,IAAXA,EAEA,OAAOA,EAAS,QAEpB,IAAIl1C,EAAIk1C,EAAS,GAGjB,OAAOA,GAAUkB,EAASp2C,IAAMo2C,EAFvBlB,EAAS,IAAOl1C,IAEsBo2C,EADvClB,GAAU,IAAM,IAAM,SAI1CC,KAAM,CACFC,IAAK,EACLC,IAAK,KAvGyB5yD,CAAQ,EAAQ,4FCGlD,SAAWkiD,GAAU,aAiEzB,SAAS6T,EAAoBtD,EAAQQ,EAAettD,EAAKutD,GACrD,IAAIxrC,EAAS,CACTxK,EAAG,CAAC,kBAAmB,mBACvB40C,GAAI,CAACW,EAAS,WAAiBA,EAAS,YACxC39C,EAAG,CAAC,UAAW,cACfi9C,GAAI,CAACU,EAAS,SAAeA,EAAS,UACtCT,EAAG,CAAC,UAAW,eACfC,GAAI,CAACQ,EAAS,SAAeA,EAAS,UACtCx5B,EAAG,CAAC,UAAW,eACfi5B,GAAI,CAACO,EAAS,SAAeA,EAAS,UACtCN,EAAG,CAAC,SAAU,aACdC,GAAI,CAACK,EAAS,SAAeA,EAAS,UACtCJ,EAAG,CAAC,QAAS,YACbC,GAAI,CAACG,EAAS,OAAaA,EAAS,SAExC,OAAOS,GAEDD,EADAvrC,EAAO/hB,GAAK,GAGZ+hB,EAAO/hB,GAAK,GA9EZu8C,EAAO+N,aAAa,MAAO,CACjCC,OAAQ,sFAAsFttC,MAC1F,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,sDAAsDxtC,MAAM,KACtEytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,wBACJC,IAAK,8BACLC,KAAM,0CAEVZ,cAAe,aACfC,KAAM,SAAU99C,GACZ,MAAO,QAAUA,EAAMsU,eAE3BypC,SAAU,SAAUC,EAAOC,EAASC,GAChC,OAAIF,EAAQ,GACDE,EAAU,MAAQ,MAElBA,EAAU,MAAQ,OAGjCQ,SAAU,CACNC,QAAS,cACTC,QAAS,cACTC,SAAU,cACVC,QAAS,eACTC,SAAU,8BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,YACRC,KAAM,OACN30C,EAAG64C,EACHjE,GAAIiE,EACJjhD,EAAGihD,EACHhE,GAAIgE,EACJ/D,EAAG+D,EACH9D,GAAI8D,EACJ98B,EAAG88B,EACH7D,GAAI6D,EACJ5D,EAAG4D,EACH3D,GAAI2D,EACJ1D,EAAG0D,EACHzD,GAAIyD,GAERxD,uBAAwB,YACxBC,QAAS,MACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAhEyB5yD,CAAQ,EAAQ,iGCElD,SAAWkiD,GAAU,aAIXA,EAAO+N,aAAa,WAAY,CAC1CC,OAAQ,wFAAwFttC,MAC5F,KAEJutC,YAAa,wFAAwFvtC,MACjG,KAEJwtC,SAAU,kDAAkDxtC,MAAM,KAClEytC,cAAe,kDAAkDztC,MAAM,KACvE0tC,YAAa,kDAAkD1tC,MAAM,KACrEiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,eACTC,QAAS,cACTC,SAAU,cACVC,QAAS,gBACTC,SAAU,cACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,iBACRC,KAAM,SACN30C,EAAG,OACH40C,GAAI,UACJh9C,EAAG,QACHi9C,GAAI,WACJC,EAAG,OACHC,GAAI,cACJh5B,EAAG,MACHi5B,GAAI,WACJC,EAAG,QACHC,GAAI,YACJC,EAAG,QACHC,GAAI,aAERI,KAAM,CACFC,IAAK,EACLC,IAAK,MAnDyB5yD,CAAQ,EAAQ,4FCGlD,SAAWkiD,GAAU,aAIfA,EAAO+N,aAAa,MAAO,CACjCC,OAAQ,kFAAkFttC,MACtF,KAEJutC,YAAa,kFAAkFvtC,MAC3F,KAEJwtC,SAAU,kDAAkDxtC,MAAM,KAClEytC,cAAe,kDAAkDztC,MAAM,KACvE0tC,YAAa,kDAAkD1tC,MAAM,KACrEiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,0BAEVC,SAAU,CACNC,QAAS,cACTC,QAAS,cACTC,SAAU,cACVC,QAAS,eACTC,SAAU,cACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,gBACRC,KAAM,SACN30C,EAAG,OACH40C,GAAI,UACJh9C,EAAG,QACHi9C,GAAI,WACJC,EAAG,OACHC,GAAI,cACJh5B,EAAG,MACHi5B,GAAI,WACJC,EAAG,QACHC,GAAI,YACJC,EAAG,QACHC,GAAI,aAERI,KAAM,CACFC,IAAK,EACLC,IAAK,MAnDyB5yD,CAAQ,EAAQ,8FCGlD,SAAWkiD,GAAU,aAIdA,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,sFAAsFttC,MAC1F,KAEJutC,YAAa,sFAAsFvtC,MAC/F,KAEJwtC,SAAU,yDAAyDxtC,MAC/D,KAEJytC,cAAe,uBAAuBztC,MAAM,KAC5C0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,0BACJC,IAAK,iCACLC,KAAM,wCAEVZ,cAAe,qDACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAGM,eAAb5C,GACa,UAAbA,GACa,iBAAbA,EAEO4C,EACa,iBAAb5C,GAA4C,QAAbA,EAC/B4C,EAAO,GAEPA,GAAQ,GAAKA,EAAOA,EAAO,IAG1C5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,IAAIwI,EAAY,IAAP/F,EAAaC,EACtB,OAAI8F,EAAK,IACE,aACAA,EAAK,IACL,QACAA,EAAK,KACL,eACAA,EAAK,KACL,MACAA,EAAK,KACL,eAEA,OAGfhI,SAAU,CACNC,QAAS,mBACTC,QAAS,kBACTC,SAAU,4BACVC,QAAS,eACTC,SAAU,6BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,WACRC,KAAM,WACN30C,EAAG,eACH40C,GAAI,YACJh9C,EAAG,YACHi9C,GAAI,WACJC,EAAG,YACHC,GAAI,WACJh5B,EAAG,UACHi5B,GAAI,SACJC,EAAG,UACHC,GAAI,SACJC,EAAG,UACHC,GAAI,UAGRC,uBAAwB,6BACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GACJ,IAAK,IACL,IAAK,IACL,IAAK,MACD,OAAOzB,EAAS,QACpB,IAAK,IACL,IAAK,IACD,OAAOA,EAAS,SACpB,QACI,OAAOA,IAGnBgB,SAAU,SAAUpuD,GAChB,OAAOA,EAAOwP,QAAQ,KAAM,MAEhC0+C,WAAY,SAAUluD,GAClB,OAAOA,EAAOwP,QAAQ,KAAM,MAEhC69C,KAAM,CAEFC,IAAK,EACLC,IAAK,KA5GyB5yD,CAAQ,EAAQ,2FCIlD,SAAWkiD,GAAU,aAYzB,SAAS0R,EAAuBnB,EAAQQ,EAAettD,GASnD,MAAY,MAARA,EACOstD,EAAgB,UAAY,UACpB,MAARttD,EACAstD,EAAgB,SAAW,SAE3BR,EAAS,KAtBFoB,GAsB6BpB,EArB3CqB,EAQS,CACThC,GAAImB,EAAgB,yBAA2B,yBAC/ClB,GAAIkB,EAAgB,yBAA2B,yBAC/ChB,GAAIgB,EAAgB,sBAAwB,sBAC5Cf,GAAI,gBACJE,GAAI,wBACJE,GAAI,kBAOgC3sD,GArBvBid,MAAM,KAChBixC,EAAM,IAAO,GAAKA,EAAM,KAAQ,GACjCC,EAAM,GACND,EAAM,IAAM,GAAKA,EAAM,IAAM,IAAMA,EAAM,IAAM,IAAMA,EAAM,KAAO,IAClEC,EAAM,GACNA,EAAM,IANhB,IAAsBD,EACdC,EAsDR,SAASuF,EAAqBvoD,GAC1B,OAAO,WACH,OAAOA,EAAM,KAAwB,KAAjBhR,KAAK4wD,QAAiB,IAAM,IAAM,QAIrDxO,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,CACJxoC,OAAQ,yFAAyF9E,MAC7F,KAEJmxC,WAAY,iGAAiGnxC,MACzG,MAGRutC,YAAa,yDAAyDvtC,MAClE,KAEJwtC,SAhDJ,SAA6Bt7C,EAAG4S,GAC5B,IAAI0oC,EAAW,CACPkJ,WAAY,0DAA0D12C,MAClE,KAEJ22C,WAAY,0DAA0D32C,MAClE,KAEJ42C,SAAU,4DAA4D52C,MAClE,MAKZ,OAAU,IAAN9N,EACOs7C,EAAqB,WACvBxuD,MAAM,EAAG,GACTM,OAAOkuD,EAAqB,WAAExuD,MAAM,EAAG,IAE3CkT,EASEs7C,EALI,qBAAqBntC,KAAKyE,GAC/B,aACA,sCAAsCzE,KAAKyE,GAC3C,WACA,cACoB5S,EAAEm/C,OARjB7D,EAAqB,YA6BhCC,cAAe,uBAAuBztC,MAAM,KAC5C0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,iBACJC,IAAK,wBACLC,KAAM,+BAEVC,SAAU,CACNC,QAASgI,EAAqB,cAC9B/H,QAAS+H,EAAqB,YAC9B7H,QAAS6H,EAAqB,WAC9B9H,SAAU8H,EAAqB,cAC/B5H,SAAU,WACN,OAAQ3xD,KAAKm0D,OACT,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACD,OAAOoF,EAAqB,oBAAoBx3D,KAAK/B,MACzD,KAAK,EACL,KAAK,EACL,KAAK,EACD,OAAOu5D,EAAqB,qBAAqBx3D,KAAK/B,QAGlE4xD,SAAU,KAEdC,aAAc,CACVC,OAAQ,QACRC,KAAM,UACN30C,EAAG,kBACH40C,GAAI8B,EACJ9+C,EAAG8+C,EACH7B,GAAI6B,EACJ5B,EAAG,SACHC,GAAI2B,EACJ36B,EAAG,OACHi5B,GAAI0B,EACJzB,EAAG,SACHC,GAAIwB,EACJvB,EAAG,MACHC,GAAIsB,GAGRrD,cAAe,wBACfC,KAAM,SAAU99C,GACZ,MAAO,iBAAiBuQ,KAAKvQ,IAEjC+9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,EACA,OACAA,EAAO,GACP,QACAA,EAAO,GACP,MAEA,UAGfd,uBAAwB,iBACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GACJ,IAAK,IACL,IAAK,IACL,IAAK,MACL,IAAK,IACL,IAAK,IACD,OAAOzB,EAAS,KACpB,IAAK,IACD,OAAOA,EAAS,MACpB,QACI,OAAOA,IAGnBC,KAAM,CACFC,IAAK,EACLC,IAAK,KAhKyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIzB,IAAIgO,EAAS,CACL,QACA,QACA,OACA,QACA,MACA,MACA,SACA,OACA,QACA,SACA,QACA,SAEJwI,EAAO,CAAC,QAAS,MAAO,OAAQ,MAAO,SAAU,OAAQ,QAEpDxW,EAAO+N,aAAa,KAAM,CAC/BC,OAAQA,EACRC,YAAaD,EACbE,SAAUsI,EACVrI,cAAeqI,EACfpI,YAAaoI,EACb7H,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVZ,cAAe,UACfC,KAAM,SAAU99C,GACZ,MAAO,QAAUA,GAErB+9C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,OAAIyC,EAAO,GACA,MAEJ,OAEXjC,SAAU,CACNC,QAAS,eACTC,QAAS,eACTC,SAAU,iBACVC,QAAS,sBACTC,SAAU,yBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,SACN30C,EAAG,YACH40C,GAAI,WACJh9C,EAAG,UACHi9C,GAAI,SACJC,EAAG,YACHC,GAAI,WACJh5B,EAAG,SACHi5B,GAAI,QACJC,EAAG,UACHC,GAAI,SACJC,EAAG,UACHC,GAAI,UAERmB,SAAU,SAAUpuD,GAChB,OAAOA,EAAOwP,QAAQ,KAAM,MAEhC0+C,WAAY,SAAUluD,GAClB,OAAOA,EAAOwP,QAAQ,KAAM,MAEhC69C,KAAM,CACFC,IAAK,EACLC,IAAK,KA/EyB5yD,CAAQ,EAAQ,gGCElD,SAAWkiD,GAAU,aAIZA,EAAO+N,aAAa,UAAW,CACxCC,OAAQ,6EAA6EttC,MACjF,KAEJutC,YAAa,oDAAoDvtC,MAAM,KACvEwtC,SAAU,+DAA+DxtC,MACrE,KAEJytC,cAAe,kCAAkCztC,MAAM,KACvD0tC,YAAa,yBAAyB1tC,MAAM,KAC5CiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,uBACTC,QAAS,mBACTC,SAAU,2BACVC,QAAS,uBACTC,SAAU,oCACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,kBACRC,KAAM,qBACN30C,EAAG,SACH40C,GAAI,YACJh9C,EAAG,aACHi9C,GAAI,YACJC,EAAG,WACHC,GAAI,UACJh5B,EAAG,UACHi5B,GAAI,SACJC,EAAG,SACHC,GAAI,QACJC,EAAG,UACHC,GAAI,UAERI,KAAM,CACFC,IAAK,EACLC,IAAK,KAnDyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,yEAAyEttC,MAC7E,KAEJutC,YAAa,kDAAkDvtC,MAAM,KACrEwtC,SAAU,uDAAuDxtC,MAAM,KACvEytC,cAAe,8BAA8BztC,MAAM,KACnD0tC,YAAa,uBAAuB1tC,MAAM,KAC1CiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,uBACTC,QAAS,mBACTC,SAAU,2BACVC,QAAS,sBACTC,SAAU,mCACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,gBACRC,KAAM,oBACN30C,EAAG,SACH40C,GAAI,YACJh9C,EAAG,aACHi9C,GAAI,YACJC,EAAG,WACHC,GAAI,UACJh5B,EAAG,UACHi5B,GAAI,SACJC,EAAG,SACHC,GAAI,QACJC,EAAG,UACHC,GAAI,UAERI,KAAM,CACFC,IAAK,EACLC,IAAK,KAjDyB5yD,CAAQ,EAAQ,2FCIlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,qGAAqGttC,MACzG,KAEJutC,YAAa,sFAAsFvtC,MAC/F,KAEJ6xC,kBAAkB,EAClBrE,SAAU,yDAAyDxtC,MAC/D,KAEJytC,cAAe,uBAAuBztC,MAAM,KAC5C0tC,YAAa,uBAAuB1tC,MAAM,KAC1CwwC,oBAAoB,EACpB7C,cAAe,SACfC,KAAM,SAAU99C,GACZ,MAAO,QAAQuQ,KAAKvQ,IAExB+9C,SAAU,SAAUC,EAAOC,EAASC,GAChC,OAAIF,EAAQ,GACDE,EAAU,KAAO,KAEjBA,EAAU,KAAO,MAGhCC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,oBACJC,IAAK,0BACLC,KAAM,gCACN5+B,EAAG,YACHmjC,GAAI,aACJC,IAAK,mBACLC,KAAM,yBAEVxE,SAAU,CACNC,QAAS,mBACTC,QAAS,oBACTC,SAAU,yBACVC,QAAS,mBACTC,SAAU,2BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,WACN30C,EAAG,WACH40C,GAAI,UACJh9C,EAAG,WACHi9C,GAAI,UACJC,EAAG,UACHC,GAAI,SACJh5B,EAAG,WACHi5B,GAAI,UACJiC,EAAG,WACHC,GAAI,UACJjC,EAAG,YACHC,GAAI,WACJC,EAAG,UACHC,GAAI,UAERC,uBAAwB,UACxBC,QAAS,SAAUC,GACf,OAAOA,GAEXC,KAAM,CACFC,IAAK,EACLC,IAAK,KA5EyB5yD,CAAQ,EAAQ,iGCElD,SAAWkiD,GAAU,aAIXA,EAAO+N,aAAa,WAAY,CAC1CC,OAAQ,6GAA6GttC,MACjH,KAEJutC,YAAa,8DAA8DvtC,MACvE,KAEJ6xC,kBAAkB,EAClBrE,SAAU,yEAAyExtC,MAC/E,KAEJytC,cAAe,qCAAqCztC,MAAM,KAC1D0tC,YAAa,4BAA4B1tC,MAAM,KAC/CwwC,oBAAoB,EACpBvC,eAAgB,CACZC,GAAI,QACJE,EAAG,aACHC,GAAI,cACJC,IAAK,oBACLC,KAAM,2BAEVC,SAAU,CACNC,QAAS,kBACTC,QAAS,sBACTC,SAAU,eACVC,QAAS,uBACTC,SAAU,uBACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,UACN30C,EAAG,mBACH40C,GAAI,eACJh9C,EAAG,aACHi9C,GAAI,eACJC,EAAG,YACHC,GAAI,YACJh5B,EAAG,SACHi5B,GAAI,WACJC,EAAG,YACHC,GAAI,cACJC,EAAG,UACHC,GAAI,aAERC,uBAAwB,uBACxBC,QAAS,SAAUC,GACf,IAAI/zC,EAAI+zC,EAAS,GAWjB,OAAOA,GAT6B,MAAxBA,EAAS,IAAO,IACd,KACM,IAAN/zC,EACA,KACM,IAANA,EACA,KACM,IAANA,EACA,KACA,OAGlBg0C,KAAM,CACFC,IAAK,EACLC,IAAK,KArEyB5yD,CAAQ,EAAQ,2FCGlD,SAAWkiD,GAAU,aAIhBA,EAAO+N,aAAa,KAAM,CAC/BC,OAAQ,0FAA0FttC,MAC9F,KAEJutC,YAAa,gEAAgEvtC,MAAM,KACnFwtC,SAAU,uDAAuDxtC,MAAM,KACvEytC,cAAe,sCAAsCztC,MAAM,KAC3D0tC,YAAa,2BAA2B1tC,MAAM,KAC9CiuC,eAAgB,CACZC,GAAI,SACJC,IAAK,YACLC,EAAG,aACHC,GAAI,cACJC,IAAK,qBACLC,KAAM,4BAEVC,SAAU,CACNC,QAAS,gBACTC,QAAS,eACTC,SAAU,8BACVC,QAAS,eACTC,SAAU,6BACVC,SAAU,KAEdC,aAAc,CACVC,OAAQ,SACRC,KAAM,WACN30C,EAAG,oBACH40C,GAAI,WACJh9C,EAAG,cACHi9C,GAAI,aACJC,EAAG,cACHC,GAAI,aACJh5B,EAAG,WACHi5B,GAAI,UACJC,EAAG,WACHC,GAAI,UACJC,EAAG,YACHC,GAAI,YAERC,uBAAwB,gBACxBC,QAAS,UACTE,KAAM,CACFC,IAAK,EACLC,IAAK,KAnDyB5yD,CAAQ,EAAQ,8FCKlD,SAAWkiD,GAAU,aAIdA,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,wCAAwCttC,MAC5C,KAEJutC,YAAa,yCAAyCvtC,MAClD,KAEJwtC,SAAU,8BAA8BxtC,MAAM,KAC9CytC,cAAe,uBAAuBztC,MAAM,KAC5C0tC,YAAa,gBAAgB1tC,MAAM,KACnCiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,YACJC,IAAK,kBACLC,KAAM,sBACN5+B,EAAG,WACHmjC,GAAI,YACJC,IAAK,kBACLC,KAAM,uBAEVrF,cAAe,oBACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,OAAb5C,GAAkC,OAAbA,GAAkC,OAAbA,EACnC4C,EACa,OAAb5C,GAAkC,OAAbA,EACrB4C,EAAO,GAGPA,GAAQ,GAAKA,EAAOA,EAAO,IAG1C5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,IAAIwI,EAAY,IAAP/F,EAAaC,EACtB,OAAI8F,EAAK,IACE,KACAA,EAAK,IACL,KACAA,EAAK,KACL,KACAA,EAAK,KACL,KACAA,EAAK,KACL,KAEA,MAGfhI,SAAU,CACNC,QAAS,SACTC,QAAS,SACTC,SAAU,SAAUkG,GAChB,OAAIA,EAAI/E,SAAW5yD,KAAK4yD,OACb,WAEA,YAGflB,QAAS,SACTC,SAAU,SAAUgG,GAChB,OAAI33D,KAAK4yD,SAAW+E,EAAI/E,OACb,WAEA,YAGfhB,SAAU,KAEda,uBAAwB,iBACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GACJ,IAAK,IACL,IAAK,IACL,IAAK,MACD,OAAOzB,EAAS,IACpB,IAAK,IACD,OAAOA,EAAS,IACpB,IAAK,IACL,IAAK,IACD,OAAOA,EAAS,IACpB,QACI,OAAOA,IAGnBd,aAAc,CACVC,OAAQ,MACRC,KAAM,MACN30C,EAAG,KACH40C,GAAI,OACJh9C,EAAG,OACHi9C,GAAI,QACJC,EAAG,OACHC,GAAI,QACJh5B,EAAG,MACHi5B,GAAI,OACJiC,EAAG,MACHC,GAAI,OACJjC,EAAG,OACHC,GAAI,QACJC,EAAG,MACHC,GAAI,QAERI,KAAM,CAEFC,IAAK,EACLC,IAAK,KApHyB5yD,CAAQ,EAAQ,8FCIlD,SAAWkiD,GAAU,aAIdA,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,wCAAwCttC,MAC5C,KAEJutC,YAAa,yCAAyCvtC,MAClD,KAEJwtC,SAAU,8BAA8BxtC,MAAM,KAC9CytC,cAAe,uBAAuBztC,MAAM,KAC5C0tC,YAAa,gBAAgB1tC,MAAM,KACnCiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,YACJC,IAAK,kBACLC,KAAM,sBACN5+B,EAAG,WACHmjC,GAAI,YACJC,IAAK,kBACLC,KAAM,uBAEVrF,cAAe,oBACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,OAAb5C,GAAkC,OAAbA,GAAkC,OAAbA,EACnC4C,EACa,OAAb5C,EACA4C,GAAQ,GAAKA,EAAOA,EAAO,GACd,OAAb5C,GAAkC,OAAbA,EACrB4C,EAAO,QADX,GAIX5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,IAAIwI,EAAY,IAAP/F,EAAaC,EACtB,OAAI8F,EAAK,IACE,KACAA,EAAK,IACL,KACAA,EAAK,KACL,KACO,OAAPA,EACA,KACAA,EAAK,KACL,KAEA,MAGfhI,SAAU,CACNC,QAAS,SACTC,QAAS,SACTC,SAAU,YACVC,QAAS,SACTC,SAAU,YACVC,SAAU,KAEda,uBAAwB,iBACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GACJ,IAAK,IACL,IAAK,IACL,IAAK,MACD,OAAOzB,EAAS,IACpB,IAAK,IACD,OAAOA,EAAS,IACpB,IAAK,IACL,IAAK,IACD,OAAOA,EAAS,IACpB,QACI,OAAOA,IAGnBd,aAAc,CACVC,OAAQ,MACRC,KAAM,MACN30C,EAAG,KACH40C,GAAI,OACJh9C,EAAG,OACHi9C,GAAI,QACJC,EAAG,OACHC,GAAI,QACJh5B,EAAG,MACHi5B,GAAI,OACJC,EAAG,OACHC,GAAI,QACJC,EAAG,MACHC,GAAI,UAhG0BtyD,CAAQ,EAAQ,8FCElD,SAAWkiD,GAAU,aAIdA,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,wCAAwCttC,MAC5C,KAEJutC,YAAa,yCAAyCvtC,MAClD,KAEJwtC,SAAU,8BAA8BxtC,MAAM,KAC9CytC,cAAe,uBAAuBztC,MAAM,KAC5C0tC,YAAa,gBAAgB1tC,MAAM,KACnCiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,YACJC,IAAK,kBACLC,KAAM,sBACN5+B,EAAG,WACHmjC,GAAI,YACJC,IAAK,kBACLC,KAAM,uBAEVrF,cAAe,oBACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,OAAb5C,GAAkC,OAAbA,GAAkC,OAAbA,EACnC4C,EACa,OAAb5C,EACA4C,GAAQ,GAAKA,EAAOA,EAAO,GACd,OAAb5C,GAAkC,OAAbA,EACrB4C,EAAO,QADX,GAIX5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,IAAIwI,EAAY,IAAP/F,EAAaC,EACtB,OAAI8F,EAAK,IACE,KACAA,EAAK,IACL,KACAA,EAAK,KACL,KACAA,EAAK,KACL,KACAA,EAAK,KACL,KAEA,MAGfhI,SAAU,CACNC,QAAS,UACTC,QAAS,UACTC,SAAU,aACVC,QAAS,UACTC,SAAU,aACVC,SAAU,KAEda,uBAAwB,iBACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GACJ,IAAK,IACL,IAAK,IACL,IAAK,MACD,OAAOzB,EAAS,IACpB,IAAK,IACD,OAAOA,EAAS,IACpB,IAAK,IACL,IAAK,IACD,OAAOA,EAAS,IACpB,QACI,OAAOA,IAGnBd,aAAc,CACVC,OAAQ,MACRC,KAAM,MACN30C,EAAG,KACH40C,GAAI,OACJh9C,EAAG,OACHi9C,GAAI,QACJC,EAAG,OACHC,GAAI,QACJh5B,EAAG,MACHi5B,GAAI,OACJC,EAAG,OACHC,GAAI,QACJC,EAAG,MACHC,GAAI,UAhG0BtyD,CAAQ,EAAQ,8FCElD,SAAWkiD,GAAU,aAIdA,EAAO+N,aAAa,QAAS,CACpCC,OAAQ,wCAAwCttC,MAC5C,KAEJutC,YAAa,yCAAyCvtC,MAClD,KAEJwtC,SAAU,8BAA8BxtC,MAAM,KAC9CytC,cAAe,uBAAuBztC,MAAM,KAC5C0tC,YAAa,gBAAgB1tC,MAAM,KACnCiuC,eAAgB,CACZC,GAAI,QACJC,IAAK,WACLC,EAAG,aACHC,GAAI,YACJC,IAAK,kBACLC,KAAM,sBACN5+B,EAAG,WACHmjC,GAAI,YACJC,IAAK,kBACLC,KAAM,uBAEVrF,cAAe,oBACfgE,aAAc,SAAUlB,EAAM5C,GAI1B,OAHa,KAAT4C,IACAA,EAAO,GAEM,OAAb5C,GAAkC,OAAbA,GAAkC,OAAbA,EACnC4C,EACa,OAAb5C,EACA4C,GAAQ,GAAKA,EAAOA,EAAO,GACd,OAAb5C,GAAkC,OAAbA,EACrB4C,EAAO,QADX,GAIX5C,SAAU,SAAU4C,EAAMC,EAAQ1C,GAC9B,IAAIwI,EAAY,IAAP/F,EAAaC,EACtB,OAAI8F,EAAK,IACE,KACAA,EAAK,IACL,KACAA,EAAK,KACL,KACAA,EAAK,KACL,KACAA,EAAK,KACL,KAEA,MAGfhI,SAAU,CACNC,QAAS,UACTC,QAAS,UACTC,SAAU,aACVC,QAAS,UACTC,SAAU,aACVC,SAAU,KAEda,uBAAwB,iBACxBC,QAAS,SAAUC,EAAQyB,GACvB,OAAQA,GACJ,IAAK,IACL,IAAK,IACL,IAAK,MACD,OAAOzB,EAAS,IACpB,IAAK,IACD,OAAOA,EAAS,IACpB,IAAK,IACL,IAAK,IACD,OAAOA,EAAS,IACpB,QACI,OAAOA,IAGnBd,aAAc,CACVC,OAAQ,MACRC,KAAM,MACN30C,EAAG,KACH40C,GAAI,OACJh9C,EAAG,OACHi9C,GAAI,QACJC,EAAG,OACHC,GAAI,QACJh5B,EAAG,MACHi5B,GAAI,OACJC,EAAG,OACHC,GAAI,QACJC,EAAG,MACHC,GAAI,UAhG0BtyD,CAAQ,EAAQ,wGCP1D,IAAIyO,EAAM,CACT,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,wCACX,aAAc,wCACd,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,QAAS,sCACT,WAAY,sCACZ,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,aAAc,2CACd,gBAAiB,2CACjB,aAAc,2CACd,gBAAiB,2CACjB,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,UAAW,wCACX,aAAc,wCACd,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,wCACX,aAAc,wCACd,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,wCACX,aAAc,wCACd,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,wCACX,aAAc,wCACd,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,WAAY,yCACZ,cAAe,yCACf,UAAW,wCACX,aAAc,wCACd,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,wCACX,aAAc,wCACd,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,YAAa,0CACb,eAAgB,0CAChB,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,QAAS,sCACT,WAAY,sCACZ,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,UAAW,wCACX,aAAc,wCACd,QAAS,sCACT,WAAY,sCACZ,OAAQ,qCACR,UAAW,qCACX,QAAS,sCACT,WAAY,sCACZ,QAAS,sCACT,aAAc,2CACd,gBAAiB,2CACjB,WAAY,sCACZ,UAAW,wCACX,aAAc,wCACd,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,OAAQ,qCACR,YAAa,0CACb,eAAgB,0CAChB,UAAW,qCACX,OAAQ,qCACR,UAAW,qCACX,aAAc,2CACd,gBAAiB,2CACjB,OAAQ,qCACR,UAAW,qCACX,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,wCACd,UAAW,wCACX,aAAc,yCAIf,SAASgrD,EAAeC,GACvB,IAAIvuD,EAAKwuD,EAAsBD,GAC/B,OAAOE,EAAoBzuD,GAE5B,SAASwuD,EAAsBD,GAC9B,IAAIE,EAAoBl1C,EAAEjW,EAAKirD,GAAM,CACpC,IAAIt3C,EAAI,IAAI7P,MAAM,uBAAyBmnD,EAAM,KAEjD,MADAt3C,EAAEy3C,KAAO,mBACHz3C,EAEP,OAAO3T,EAAIirD,GAEZD,EAAenmD,KAAO,WACrB,OAAOD,OAAOC,KAAK7E,IAEpBgrD,EAAehtD,QAAUktD,EACzB/5D,EAAOovD,QAAUyK,EACjBA,EAAetuD,GAAK,8GClSnB,IAASoS,EAAAA,EAAqiI8I,OAAOF,SAAziIxmB,QAAQC,OAAO,eAAe,IAAI0E,MAAM,eAAe,CAACo5C,OAAM,IAAKryC,OAAO,CAAC,mBAAmB,SAASkS,GAAG5d,QAAQ+M,UAAU6Q,EAAEu8C,0BAA0Bv8C,EAAEu8C,yBAAyB,sCAAsCv8C,EAAEw8C,2BAA2B,yCAAyCp6D,QAAQC,OAAO,mBAAmB,CAAC,mBAAmBD,QAAQC,OAAO,iBAAiB,IAAID,QAAQC,OAAO,QAAQ,CAAC,eAAe,iBAAiB,mBAAmB,eAAwEA,EAAOovD,UAAUA,IAAUpvD,EAAOovD,QAAQ,SAASrvD,QAAQC,OAAO,kBAAkB2X,QAAQ,MAAM,CAAC,KAAK,SAASgG,GAAG,IAAImB,EAAE,OAAaua,EAAE,CAAC,MAAM,KAAI,MAAM,KAAK,MAAM,KAAI,MAAM,KAAK,MAAM,MAAMn5B,KAAKk6D,eAAe,SAASz8C,EAAEmB,GAAG,MAAM,WAAWA,EAAEu7C,YAAYn6D,KAAKo6D,QAAQ38C,GAAGA,EAAE48C,iBAAiB,MAAMz7C,EAAEu7C,YAAYn6D,KAAKo6D,QAAQ38C,GAAGA,EAAE3I,WAAWC,QAAQ,IAAI6J,EAAEu7C,YAAY,iBAAiB18C,GAAGA,EAAEA,EAAE1I,QAAQ,KAAK,OAAO6J,EAAE07C,cAAc78C,EAAEvP,QAAQ,MAAM,GAAGuP,EAAEvP,QAAQ,OAAO,GAAGuP,EAAEvP,QAAQ,OAAO,KAAKuP,EAAEmB,EAAE27C,SAAS98C,EAAEmB,EAAE27C,UAAU98C,GAAG,kBAAkBA,EAAEA,EAAE,OAAO,QAAQA,GAAGzd,KAAKo6D,QAAQ,SAAS38C,GAAG,OAAOA,IAAIA,KAAK+8C,SAAS/8C,IAAIwU,QAAQxU,EAAE,KAAKzd,KAAKke,UAAU,SAASib,EAAE7W,GAAG,IAAI+wC,EAAE51C,EAAExR,QAAQ4R,EAAE7d,KAAKkyD,EAAE,GAAG70C,EAAE,GAAGK,EAAED,EAAExN,KAAKkpB,GAAGpuB,MAAK,SAAS0S,GAA6C,IAAI0b,EAAEzb,EAA7C7d,QAAQ+M,UAAU0V,EAAEm4C,SAASn4C,EAAEm4C,SAAgBthC,EAAE,GAAGt5B,QAAQkB,QAAQuhB,EAAEm4C,QAAO,SAASh9C,GAAGzd,KAAKS,KAAKod,EAAEq8C,eAAez8C,EAAE6E,MAAK6W,GAAGzb,EAAEyb,EAAElmB,KAAKqP,EAAEo4C,SAASp4C,EAAEo4C,SAAS,KAAKr9C,GAAGK,EAAEkB,GAAE,IAAsI6T,EAAEzd,EAApIwI,EAAE,GAAM3d,QAAQmS,QAAQyL,GAAGD,EAAEC,EAAE5d,QAAQuN,WAAWqQ,KAAKD,EAAEC,KAAK5d,QAAQ+M,UAAU0V,EAAEkoC,QAAQloC,EAAEkoC,OAAO,kBAAkBloC,EAAEkoC,QAAe/3B,EAAE,GAAG5yB,QAAQkB,QAAQyc,EAAE,IAAG,SAASC,EAAEmB,GAAG5e,KAAKS,KAAKod,EAAEq8C,eAAet7C,EAAE0D,MAAKmQ,GAAGzd,EAAEyd,EAAExf,KAAKqP,EAAEo4C,SAASp4C,EAAEo4C,SAAS,KAAKr9C,GAAGrI,EAAE4J,GAAE/e,QAAQkB,QAAQyc,GAAE,SAASC,EAAEk9C,GAAG,IAAIxhC,EAAEk6B,EAAEnB,EAAEryD,QAAQoiB,KAAKzE,EAAEm9C,IAAItH,EAAE,GAAG,IAAI31C,EAAE4E,EAAEs4C,YAAYt4C,EAAEs4C,YAAY1I,EAAEryD,QAAQkB,QAAQ2c,GAAE,SAASD,GAAG,IAAImB,EAAE0D,EAAEs4C,YAAY1I,EAAEz0C,GAAGA,EAAEzd,KAAKS,KAAKod,EAAEq8C,eAAet7C,EAAE0D,MAAK+wC,GAAGl6B,EAAEk6B,EAAEpgD,KAAKqP,EAAEo4C,SAASp4C,EAAEo4C,SAAS,KAAKr9C,GAAGs9C,EAAEn9C,EAAEpO,OAAO+pB,EAAEva,EAAEua,KAAI7W,EAAEu4C,qBAAqB3I,GAA9wC,UAAoxCA,GAAG70C,EAAEg2C,EAAE1mD,QAAQulD,MAAK,MAAM,mBAAmBx0C,EAAS,OAAGA,EAAS,OAAE,SAASD,GAAG41C,EAAEhf,OAAO52B,MAAK41C,EAAE5vD,SAASzD,KAAK86D,cAAc,SAASr9C,GAAG,YAAO,IAAS0b,EAAE1b,IAAIzd,KAAK+6D,eAAe,SAASt9C,GAAG,OAAO0b,EAAE1b,OAAO5d,QAAQC,OAAO,oBAAoB+C,UAAU,QAAQ,CAAC,SAAS,KAAK,MAAM,YAAY,WAAW,SAAS+b,EAAE+7C,EAAExhC,EAAE7W,EAAE+wC,GAAG,MAAM,CAAClsD,SAAS,KAAKrE,MAAM,CAAC6E,KAAK,SAASqzD,SAAS,YAAYP,OAAO,aAAaG,YAAY,kBAAkBL,SAAS,iBAAiBJ,WAAW,oBAAoBG,aAAa,gBAAgBI,SAAS,kBAAkBtuC,SAAS,YAAYyuC,mBAAmB,UAAUpgB,QAAQ,IAAIwgB,QAAQ,WAAWzQ,MAAM,aAAaxpD,WAAW,CAAC,SAAS,WAAW,SAAS,cAAc,SAASyc,EAAEmB,EAAE0D,GAAwe7E,EAAEy9C,IAAI,GAAGr7D,QAAQ+M,UAAU6Q,EAAE2O,WAAW,QAAQ3O,EAAE2O,UAAUvsB,QAAQmS,QAAQyL,EAAE9V,OAAO8V,EAAElZ,OAAO,QAAO,WAAWkZ,EAAE09C,cAAY,GAAI19C,EAAE29C,YAAY,WAAW,OAAO39C,EAAEu9C,UAAU,gBAAgBv9C,EAAE09C,SAAS,WAAW,IAAIt9C,EAAE88C,EAAE1uD,QAAQ,OAAO2S,EAAEy8C,SAAS/4C,EAAEg5C,mBAAmB,kBAAkBniC,EAAEjb,UAAUT,EAAE9V,OAAhxB,WAAa,IAAIiX,EAAE,CAAC27C,SAAS98C,EAAE88C,SAAS98C,EAAE88C,SAAS,IAAIJ,WAAW18C,EAAE08C,WAAW18C,EAAE08C,WAAW,IAAIG,aAAa78C,EAAE68C,aAAaO,mBAAmBp9C,EAAEo9C,oBAAoB,OAAOh7D,QAAQ+M,UAAU0V,EAAEi5C,aAAa38C,EAAE67C,OAAOh9C,EAAEpc,MAAMoc,EAAEg9C,SAAS56D,QAAQ+M,UAAU0V,EAAEk5C,kBAAkB58C,EAAEg8C,YAAYn9C,EAAEpc,MAAMoc,EAAEm9C,cAAc/6D,QAAQ+M,UAAU0V,EAAEm5C,YAAY78C,EAAE4rC,MAAM/sC,EAAEpc,MAAMoc,EAAE+sC,QAAQ5rC,EAAE87C,SAASj9C,EAAEi9C,SAASj9C,EAAEi9C,SAAS,IAAI97C,EAAE87C,SAASvhC,EAAE2hC,cAAcl8C,EAAE87C,UAAUvhC,EAAE4hC,eAAen8C,EAAE87C,UAAU97C,EAAE87C,SAAS97C,EAAoTy0C,IAAKtoD,MAAK,SAAS4vD,GAAGl9C,EAAEy9C,IAAIP,EAAE/7C,EAAE88C,YAAYp5C,EAAEg5C,mBAAmB,kBAAkBz9C,EAAElR,QAAQguD,MAAKl9C,EAAExZ,SAAS4Z,EAAEpa,WAAW8E,KAAK,SAASqW,EAAE+7C,GAA8bA,EAAEr3D,KAAK,SAAQ,WAAWsb,EAAEu8C,WAAWpwD,MAAK,YAAve,WAAa,IAAI4vD,EAAE/7C,EAAEq8C,SAAS,QAAQ9hC,EAAE,IAAIk2B,KAAK,CAACzwC,EAAEs8C,KAAK,CAAChsD,KAAK,oBAAoByrD,EAAE,MAAM,GAAGl9C,EAAEo+B,UAAU8f,iBAAiB9f,UAAU+f,WAAWziC,EAAEva,EAAEw8C,mBAAmB,CAAC,IAAIv9C,EAAEhe,QAAQkD,QAAQ,+CAA+CmvD,EAAEryD,QAAQkD,QAAQ8a,EAAEjV,WAAW,IAAIspD,EAAEp/C,KAAK,OAAO2K,EAAE8vC,IAAIsO,gBAAgB1iC,IAAI+4B,EAAEp/C,KAAK,WAAW8L,EAAEw8C,eAAelJ,EAAEp/C,KAAK,SAAS,UAAUwP,EAAExB,KAAK,QAAQuZ,OAAOxc,GAAGw1C,GAAE,WAAWnB,EAAE,GAAGvH,QAAQuH,EAAErlD,WAAU,OAA8DssB,MAAMva,EAAE3a","sources":["webpack://motion-chat/./node_modules/@flowjs/ng-flow/dist/ng-flow.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/directives/viewDirective.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/templateFactory.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/statebuilders/onEnterExitRetain.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/locationServices.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/services.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/stateFilters.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/stateProvider.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/statebuilders/views.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/urlRouterProvider.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/viewScroll.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/common.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/coreservices.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/glob.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/hof.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/predicates.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/queue.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/safeConsole.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/strings.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/trace.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/globals.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/lazyLoad.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/params/param.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/params/paramType.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/params/paramTypes.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/params/stateParams.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/path/pathNode.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/path/pathUtils.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/resolve/interface.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/resolve/resolvable.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/resolve/resolveContext.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/router.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/state/stateBuilder.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/state/stateMatcher.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/state/stateObject.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/state/stateQueueManager.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/state/stateRegistry.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/state/targetState.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/hookBuilder.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/hookRegistry.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/interface.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/transitionEventType.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/coreResolvables.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/redirectTo.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/onEnterExitRetain.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/resolve.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/views.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/updateGlobals.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/url.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/ignoredTransition.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/invalidTransition.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/transitionService.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/url/urlConfig.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/url/urlMatcherFactory.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/url/urlRouter.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/url/urlRule.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/url/urlRules.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/url/urlService.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/browserLocationConfig.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/hashLocationService.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationConfig.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationService.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/plugins.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/pushStateLocationService.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/q.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/utils.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/view/view.js","webpack://motion-chat/./node_modules/angular-aria/angular-aria.js","webpack://motion-chat/./node_modules/angular-rateit/dist/ng-rateit.js","webpack://motion-chat/./src/js/index.controller.js","webpack://motion-chat/./src/js/index.route.js","webpack://motion-chat/./src/js/closing/closing.controller.js","webpack://motion-chat/./src/js/index.factory.js","webpack://motion-chat/./src/js/chat/chat.controller.js","webpack://motion-chat/./src/js/offline/offline.controller.js","webpack://motion-chat/./src/js/online/online.controller.js","webpack://motion-chat/./src/js/unmanaged/unmanaged.controller.js","webpack://motion-chat/./src/js/waiting/waiting.controller.js","webpack://motion-chat/./src/js/common/remote-storage.service.js","webpack://motion-chat/./src/js/index.module.js","webpack://motion-chat/./node_modules/expose-loader/dist/runtime/getGlobalThis.js","webpack://motion-chat/./node_modules/json-form-data/src/jsonToFormData.js","webpack://motion-chat/./node_modules/moment/locale/af.js","webpack://motion-chat/./node_modules/moment/locale/ar-dz.js","webpack://motion-chat/./node_modules/moment/locale/ar-kw.js","webpack://motion-chat/./node_modules/moment/locale/ar-ly.js","webpack://motion-chat/./node_modules/moment/locale/ar-ma.js","webpack://motion-chat/./node_modules/moment/locale/ar-sa.js","webpack://motion-chat/./node_modules/moment/locale/ar-tn.js","webpack://motion-chat/./node_modules/moment/locale/ar.js","webpack://motion-chat/./node_modules/moment/locale/az.js","webpack://motion-chat/./node_modules/moment/locale/be.js","webpack://motion-chat/./node_modules/moment/locale/bg.js","webpack://motion-chat/./node_modules/moment/locale/bm.js","webpack://motion-chat/./node_modules/moment/locale/bn-bd.js","webpack://motion-chat/./node_modules/moment/locale/bn.js","webpack://motion-chat/./node_modules/moment/locale/bo.js","webpack://motion-chat/./node_modules/moment/locale/br.js","webpack://motion-chat/./node_modules/moment/locale/bs.js","webpack://motion-chat/./node_modules/moment/locale/ca.js","webpack://motion-chat/./node_modules/moment/locale/cs.js","webpack://motion-chat/./node_modules/moment/locale/cv.js","webpack://motion-chat/./node_modules/moment/locale/cy.js","webpack://motion-chat/./node_modules/moment/locale/da.js","webpack://motion-chat/./node_modules/moment/locale/de-at.js","webpack://motion-chat/./node_modules/moment/locale/de-ch.js","webpack://motion-chat/./node_modules/moment/locale/de.js","webpack://motion-chat/./node_modules/moment/locale/dv.js","webpack://motion-chat/./node_modules/moment/locale/el.js","webpack://motion-chat/./node_modules/moment/locale/en-au.js","webpack://motion-chat/./node_modules/moment/locale/en-ca.js","webpack://motion-chat/./node_modules/moment/locale/en-gb.js","webpack://motion-chat/./node_modules/moment/locale/en-ie.js","webpack://motion-chat/./node_modules/moment/locale/en-il.js","webpack://motion-chat/./node_modules/moment/locale/en-in.js","webpack://motion-chat/./node_modules/moment/locale/en-nz.js","webpack://motion-chat/./node_modules/moment/locale/en-sg.js","webpack://motion-chat/./node_modules/moment/locale/eo.js","webpack://motion-chat/./node_modules/moment/locale/es-do.js","webpack://motion-chat/./node_modules/moment/locale/es-mx.js","webpack://motion-chat/./node_modules/moment/locale/es-us.js","webpack://motion-chat/./node_modules/moment/locale/es.js","webpack://motion-chat/./node_modules/moment/locale/et.js","webpack://motion-chat/./node_modules/moment/locale/eu.js","webpack://motion-chat/./node_modules/moment/locale/fa.js","webpack://motion-chat/./node_modules/moment/locale/fi.js","webpack://motion-chat/./node_modules/moment/locale/fil.js","webpack://motion-chat/./node_modules/moment/locale/fo.js","webpack://motion-chat/./node_modules/moment/locale/fr-ca.js","webpack://motion-chat/./node_modules/moment/locale/fr-ch.js","webpack://motion-chat/./node_modules/moment/locale/fr.js","webpack://motion-chat/./node_modules/moment/locale/fy.js","webpack://motion-chat/./node_modules/moment/locale/ga.js","webpack://motion-chat/./node_modules/moment/locale/gd.js","webpack://motion-chat/./node_modules/moment/locale/gl.js","webpack://motion-chat/./node_modules/moment/locale/gom-deva.js","webpack://motion-chat/./node_modules/moment/locale/gom-latn.js","webpack://motion-chat/./node_modules/moment/locale/gu.js","webpack://motion-chat/./node_modules/moment/locale/he.js","webpack://motion-chat/./node_modules/moment/locale/hi.js","webpack://motion-chat/./node_modules/moment/locale/hr.js","webpack://motion-chat/./node_modules/moment/locale/hu.js","webpack://motion-chat/./node_modules/moment/locale/hy-am.js","webpack://motion-chat/./node_modules/moment/locale/id.js","webpack://motion-chat/./node_modules/moment/locale/is.js","webpack://motion-chat/./node_modules/moment/locale/it-ch.js","webpack://motion-chat/./node_modules/moment/locale/it.js","webpack://motion-chat/./node_modules/moment/locale/ja.js","webpack://motion-chat/./node_modules/moment/locale/jv.js","webpack://motion-chat/./node_modules/moment/locale/ka.js","webpack://motion-chat/./node_modules/moment/locale/kk.js","webpack://motion-chat/./node_modules/moment/locale/km.js","webpack://motion-chat/./node_modules/moment/locale/kn.js","webpack://motion-chat/./node_modules/moment/locale/ko.js","webpack://motion-chat/./node_modules/moment/locale/ku.js","webpack://motion-chat/./node_modules/moment/locale/ky.js","webpack://motion-chat/./node_modules/moment/locale/lb.js","webpack://motion-chat/./node_modules/moment/locale/lo.js","webpack://motion-chat/./node_modules/moment/locale/lt.js","webpack://motion-chat/./node_modules/moment/locale/lv.js","webpack://motion-chat/./node_modules/moment/locale/me.js","webpack://motion-chat/./node_modules/moment/locale/mi.js","webpack://motion-chat/./node_modules/moment/locale/mk.js","webpack://motion-chat/./node_modules/moment/locale/ml.js","webpack://motion-chat/./node_modules/moment/locale/mn.js","webpack://motion-chat/./node_modules/moment/locale/mr.js","webpack://motion-chat/./node_modules/moment/locale/ms-my.js","webpack://motion-chat/./node_modules/moment/locale/ms.js","webpack://motion-chat/./node_modules/moment/locale/mt.js","webpack://motion-chat/./node_modules/moment/locale/my.js","webpack://motion-chat/./node_modules/moment/locale/nb.js","webpack://motion-chat/./node_modules/moment/locale/ne.js","webpack://motion-chat/./node_modules/moment/locale/nl-be.js","webpack://motion-chat/./node_modules/moment/locale/nl.js","webpack://motion-chat/./node_modules/moment/locale/nn.js","webpack://motion-chat/./node_modules/moment/locale/oc-lnc.js","webpack://motion-chat/./node_modules/moment/locale/pa-in.js","webpack://motion-chat/./node_modules/moment/locale/pl.js","webpack://motion-chat/./node_modules/moment/locale/pt-br.js","webpack://motion-chat/./node_modules/moment/locale/pt.js","webpack://motion-chat/./node_modules/moment/locale/ro.js","webpack://motion-chat/./node_modules/moment/locale/ru.js","webpack://motion-chat/./node_modules/moment/locale/sd.js","webpack://motion-chat/./node_modules/moment/locale/se.js","webpack://motion-chat/./node_modules/moment/locale/si.js","webpack://motion-chat/./node_modules/moment/locale/sk.js","webpack://motion-chat/./node_modules/moment/locale/sl.js","webpack://motion-chat/./node_modules/moment/locale/sq.js","webpack://motion-chat/./node_modules/moment/locale/sr-cyrl.js","webpack://motion-chat/./node_modules/moment/locale/sr.js","webpack://motion-chat/./node_modules/moment/locale/ss.js","webpack://motion-chat/./node_modules/moment/locale/sv.js","webpack://motion-chat/./node_modules/moment/locale/sw.js","webpack://motion-chat/./node_modules/moment/locale/ta.js","webpack://motion-chat/./node_modules/moment/locale/te.js","webpack://motion-chat/./node_modules/moment/locale/tet.js","webpack://motion-chat/./node_modules/moment/locale/tg.js","webpack://motion-chat/./node_modules/moment/locale/th.js","webpack://motion-chat/./node_modules/moment/locale/tk.js","webpack://motion-chat/./node_modules/moment/locale/tl-ph.js","webpack://motion-chat/./node_modules/moment/locale/tlh.js","webpack://motion-chat/./node_modules/moment/locale/tr.js","webpack://motion-chat/./node_modules/moment/locale/tzl.js","webpack://motion-chat/./node_modules/moment/locale/tzm-latn.js","webpack://motion-chat/./node_modules/moment/locale/tzm.js","webpack://motion-chat/./node_modules/moment/locale/ug-cn.js","webpack://motion-chat/./node_modules/moment/locale/uk.js","webpack://motion-chat/./node_modules/moment/locale/ur.js","webpack://motion-chat/./node_modules/moment/locale/uz-latn.js","webpack://motion-chat/./node_modules/moment/locale/uz.js","webpack://motion-chat/./node_modules/moment/locale/vi.js","webpack://motion-chat/./node_modules/moment/locale/x-pseudo.js","webpack://motion-chat/./node_modules/moment/locale/yo.js","webpack://motion-chat/./node_modules/moment/locale/zh-cn.js","webpack://motion-chat/./node_modules/moment/locale/zh-hk.js","webpack://motion-chat/./node_modules/moment/locale/zh-mo.js","webpack://motion-chat/./node_modules/moment/locale/zh-tw.js","webpack://motion-chat//home/vito/Development/MOTION_V3/motion-server/motion-chat/node_modules/moment/locale|sync|/^\\.\\/.*$/","webpack://motion-chat/./node_modules/ng-csv/build/ng-csv.min.js"],"names":["angular","module","provider","this","defaults","factory","options","Flow","events","on","event","callback","push","$get","fn","opts","flow","extend","forEach","controller","$scope","$attrs","$parse","flowFactory","$eval","flowInit","flowObject","create","catchAllHandler","eventName","args","Array","prototype","slice","call","arguments","shift","$broadcast","apply","concat","$applyAsync","defaultPrevented","$on","off","$flow","hasOwnProperty","flowName","assign","directive","scope","element","attrs","isDirectory","isSingleFile","inputAttrs","flowAttrs","assignBrowse","bind","preventDefault","$timeout","promise","enter","dragEvent","fileDrag","dataTransfer","originalEvent","types","val","$apply","flowDragEnter","cancel","flowDragLeave","assignDrop","flowDropEnabled","$watch","value","unAssignDrop","fileSuccess","fileProgress","fileAdded","filesAdded","filesSubmitted","fileRetry","fileRemoved","fileError","uploadStart","complete","progress","error","eventArgs","string","name","charAt","toUpperCase","require","funcArgs","key","file","flowImg","fileReader","FileReader","readAsDataURL","onload","$set","target","result","transfers","files","uiView","$ViewDirectiveFill","$compile","$controller","$transitions","$view","$q","getControllerAs","parse","getResolveAs","restrict","priority","compile","tElement","initial","html","empty","$element","data","contents","cfg","$cfg","viewDecl","getTemplate","noop","resolveCtx","path","ResolveContext","trace","$uiView","link","controllerAs","resolveAs","locals","controllerInstance","children","registerControllerCallbacks","isString","component","kebobName","kebobString","tagRegexp_1","RegExp","deregisterWatch_1","directiveEl","filter","el","tagName","exec","ctrlInstance","$animate","$uiViewScroll","$interpolate","rootData","$context","_pluginapi","_rootViewContext","count","terminal","transclude","tAttrs","$transclude","previousEl","currentEl","currentScope","viewConfig","onloadExp","autoScrollExp","renderer","cb","then","leave","inherited","inheritedData","activeUIView","$type","id","fqn","config","configUpdated","updateView","fromParentTagConfig","fromParentTag","unregister","registerUIView","newScope","$new","animEnter","defer","animLeave","$uiViewData","$uiViewAnim","$animEnter","$animLeave","$$animLeave","$emit","cloned","clone","resolve","isDefined","remove","$destroy","_viewData_1","cleanupLastView","$inject","hasComponentImpl","_uiCanExitId","isFunction","$onInit","componentProvider","viewState","tail","state","self","hookOptions","uiOnParamsChanged","viewCreationTrans_1","getResolvable","onSuccess","$transition$","exiting","indexOf","toParams","params","fromParams","getNodeSchema","node","paramSchema","toSchema","treeChanges","map","reduce","unnestR","fromSchema","changedToParams","param","idx","type","equals","length","changedKeys_1","x","newValues","uiCanExit","id_1","cacheProp_1","prevTruthyAnswer_1","trans","redirectedFrom","criteria","onBefore","ids","when","TemplateFactory","_this","_useHttp","$http","$templateCache","$injector","$templateRequest","has","get","useHttpService","fromConfig","context","asTemplate","services","str","template","asComponent","fromString","templateUrl","fromUrl","templateProvider","fromProvider","fromComponentProvider","url","cache","headers","Accept","response","deps","providerFn","isArray","Resolvable","makeComponentTemplate","bindings","prefix","kebob","camelCase","kebobed","cmpDefs","Error","getBindings","getComponentBindings","input","attrName","attr","resolveName","res","join","def","isObject","bindToController","scopeBindings","bindingsObj","Object","keys","tuple","getStateHookBuilder","hookName","stateObject","hook","pathname","subContext","$$state","getLocals","$state$","undefined","Ng1LocationServices","$locationProvider","_urlListeners","_lp","createProxyFunctions","monkeyPatchPathParameterType","router","pathType","urlMatcherFactory","encode","toString","replace","m","decode","dispose","onChange","removeFrom","html5Mode","enabled","$sniffer","history","baseHref","_baseHref","$browser","$window","location","newUrl","$location","_runtimeServices","$rootScope","evt","_loc","mod_init","mod_util","mod_rtr","mod_state","mod_main","$uiRouterProvider","UIRouter","stateProvider","stateRegistry","stateService","decorator","viewService","_viewConfigFactory","urlService","_decodeParams","ng1LocationService","locationService","locationConfig","getProviderFor","serviceName","$urp","service","runBlock","$uiRouter","invoke","checkStrictDi","strictDi","resolvables","resolvable","annotate","resolveFn","watchDigests","uiRouter","urlRouterProvider","globals","run","$urlMatcherFactory","$state","$urlRouter","ctx","getTokens","getPolicy","async","applyPairs","$IsStateFilter","isFilter","is","$stateful","$IncludedByStateFilter","includesFilter","includes","StateProvider","func","definition","register","onInvalid","getNg1ViewConfigFactory","templateFactory","view","Ng1ViewConfig","hasAnyKey","obj","acc","ng1ViewsBuilder","parent","compKeys","nonCompKeys","allViewKeys","views","viewsObject","$default","pick","$name","normalized","ViewService","$uiViewName","uiViewName","$uiViewContextAnchor","uiViewContextAnchor","$id","loaded","load","paramValues","promises","getController","all","results","controllerProvider","isInjectable","UrlRouterProvider","injectableHandler","handler","match","$match","$stateParams","urlRouter","update","interceptDeferred","listen","rule","ruleFn","BaseUrlRule","identity","rules","otherwise","urlRules","what","deferIntercept","useAnchorScroll","$anchorScroll","scrollIntoView","__spreadArrays","s","i","il","r","k","a","j","jl","root","g","global","fromJson","JSON","toJson","stringify","toObj","_equals","o1","o2","t1","a1","a2","tup","arrayTuples","b","t","getTime","source","fnNames","latebind","bindFunction","fnName","inherit","extra","inArray","array","splice","pushTo","arr","deregAll","functions","defaultsList","_i","defaultVals","reverse","mergeR","memo","item","ancestors","first","second","n","propNames","objCopy","_prop","omit","collection","accept","find","mapObj","values","allTrueR","elem","anyTrueR","flattenR","pushR","uniqR","token","unnest","assertPredicate","predicateOrMap","errMsg","maxArrayLen","min","Math","_loop_1","keyValTuple","copy","src","dest","silenceUncaughtInPromise","catch","e","silentRejection","makeStub","methods","fnname","Glob","text","glob","split","regexpString","seg","regexp","matches","test","curry","curried","compose","start","pipe","funcs","prop","propEq","_val","not","and","fn1","fn2","or","any","ctor","constructor","v","pattern","struct","toStr","tis","isUndefined","isNull","o","isNullOrUndefined","isNumber","isDate","isRegExp","head","isPromise","Queue","_items","_limit","_evictListeners","onEvict","enqueue","items","evict","dequeue","size","clear","current","peekTail","peekHead","noopConsoleStub","log","table","safeConsole","document","documentMode","window","console","bound","Function","ie9Console","fallbackConsole","maxLength","max","substr","padString","$1","toLowerCase","functionToString","fnStr","fnToString","namedFunctionMatch","_fn","isRejection","stringifyPattern","_transitionRejection","seen","format","beforeAfterSubstr","char","stripLastPathElement","splitHash","splitQuery","splitEqual","trimHashVal","splitOnDelim","delim","re","joinNeighborsR","Category","uiViewString","uiview","creationContext","normalizedCat","_tid","_rid","transLbl","Trace","_enabled","approximateDigests","_set","categories","parseInt","isNaN","category","enable","disable","traceTransitionStart","TRANSITION","traceTransitionIgnored","traceHookInvocation","step","HOOK","registeredHook","traceHookResult","hookResult","transitionOptions","traceResolvePath","RESOLVE","traceResolvableResolved","traceError","reason","traceSuccess","finalState","traceUIViewEvent","viewData","UIVIEW","traceUIViewConfigUpdated","traceUIViewFill","traceViewSync","pairs","VIEWCONFIG","uivheader","mapping","_a","_b","uiv","sort","localeCompare","traceViewServiceEvent","viewConfigString","traceViewServiceUIViewEvent","UIRouterGlobals","lastStartedTransitionId","transitionHistory","successfulTransitions","transition","lazyLoadHook","entering","lazyLoad","lazyLoadState","originalTransition","orig","targetState","identifier","$url","parts","sync","registerLazyLoadHook","transitionService","lazyLoadFn","states","_state","err","DefType","hasOwn","Param","urlConfig","paramName","noReloadOnSearch","reloadOnSearch","SEARCH","dynamic","defaultConfig","paramConfig","getStaticDefaultValue","isShorthand","$$fn","unwrapShorthand","getParamDeclaration","urlType","paramTypes","CONFIG","PATH","getType","arrayDefaults","arrayParamNomenclature","arrayMode","$asArray","isOptional","raw","squash","defaultPolicy","getSquashPolicy","defaultSquashPolicy","from","to","configuredKeys","getReplace","params_1","changed","values1","values2","validates","isDefaultValue","replaceSpecialValues","_defaultValueCache","defaultValue","getDefaultValue","$normalize","isSearch","encoded","ParamType","$subPattern","sub","mode","ArrayType","arrayWrap","arrayHandler","allTruthyMode","arrayUnwrap","arrayEqualsHandler","val1","val2","left","right","paramTypeFn","wrapperFn","$arrayMode","makeDefaultType","ParamTypes","typeQueue","defaultTypes","definitionFn","_flushTypeQueue","valToString","defaultTypeBase","String","query","hash","int","bool","Boolean","date","getFullYear","getMonth","getDate","capture","Date","valueOf","l","json","StateParams","$inherit","newParams","$current","$to","parentParams","parents","inheritList","PathNode","stateOrNode","parameters","applyRawParams","pDef","paramDef","parameter","paramsFn","diff","PathUtils","makeTargetState","registry","buildPath","buildToPath","fromPath","toPath","inheritParams","applyViewConfigs","viewDecls","subPath","viewConfigs","createViewConfig","toKeys","noInherit","toNode","toParamVals","incomingParamVals","fromParamVals","ownParamVals","reloadState","node1","node2","retained","keep","nonDynamicParams","retainedWithToParams","retainedNode","matching","pathA","pathB","done","nodeA","nodeB","predicate","elementIdx","resolvePolicies","LAZY","EAGER","WAIT","NOWAIT","arg1","policy","resolved","literal","thisPolicy","statePolicy","resolvePolicy","resolveContext","findNode","asyncPolicy","customAsyncPolicy","getDependencies","resolvedDeps","resolvedValue","fromData","whens","ALL_WHENS","EAGER_WHENS","_path","addResolvables","newResolvables","resolvePath","matchedWhens","matchesPolicy","acceptedVals","whenOrAsync","nodeResolvables","nowait","wait","getResult","injector","_injector","UIInjectorImpl","availableResolvables","_node","fromInjector","getNative","native","getAsync","_routerInstance","locationServiceStub","locationConfigStub","_disposed","_disposables","_plugins","disposable","d","ignored","plugin","pluginInstance","getPlugin","pluginName","nameBuilder","selfBuilder","dataBuilder","getUrlBuilder","$urlMatcherFactoryProvider","stateDec","newStateDec","parsed","substring","parseUrl","isMatcher","navigable","append","getNavigableBuilder","isRoot","pathBuilder","includesBuilder","resolvablesBuilder","resolveObj","getToken","p","provide","literal2Resolvable","useFactory","dependencies","useClass","useValue","useExisting","tuple2Resolvable","item2Resolvable","decl","StateBuilder","matcher","paramFactory","builders","parentName","urlParams","nonUrlParams","builder","build","chain","parentFn","segments","pop","StateMatcher","_states","isRelative","stateName","stateOrName","base","matchGlob","isStr","__stateObjectCache","nameGlob","baseState","splitName","pathLength","relName","StateObject","stateDecl","isStateClass","ref","matchingKeys","isStateDeclaration","isState","StateQueueManager","listeners","queue","flush","registered","orphans","previousQueueLength","getState","notifyListeners","listener","name_1","orphanIdx","existingState","existingFutureState","deregister","attachRoute","prev","abstract","rulesApi","urlRuleFactory","StateRegistry","stateQueue","_registerRoot","_root","onStatesChanged","stateDefinition","_deregisterTree","getChildren","_children","deregistered","removeRule","deregisteredStates","found","property","builderFunction","TargetState","_stateRegistry","_identifier","_params","_options","_definition","relative","exists","valid","withState","withParams","withOptions","newOpts","isDef","HookBuilder","buildHooksForPhase","phase","_getEvents","buildHooks","hookType","matchingHooks","getMatchingHooks","reverseDepthSort","baseHookOptions","criteriaMatchPath","traceData","transitionHook","reverseSort","factor","depthDelta","isCreate","hookPhase","reg","getHooks","matchState","criterion","toMatch","globStrings","RegisteredHook","tranSvc","eventType","matchCriteria","removeHookFromRegistry","invokeCount","_deregistered","invokeLimit","_matchingNodes","nodes","_getDefaultMatchCriteria","_getPathTypes","_getMatchingNodes","mn","pathtype","isStateHook","every","makeEvent","hooks","_registeredHooks","removeHookFn","hookRegistrationFn","matchObject","TransitionHookPhase","TransitionHookScope","RejectType","Rejection","message","detail","isRejectionPromise","superseded","rejection","SUPERSEDED","redirected","invalid","INVALID","IGNORED","aborted","ABORTED","errored","ERROR","normalize","toPromise","TransitionEventType","hookOrder","getResultHandler","getErrorHandler","synchronous","defaultOptions","TransitionHook","stateContext","isSuperseded","isActive","waitFor","nextHook","invokeHook","invokeHooks","doneCallback","remainingHooks","runAllHooks","logError","defaultErrorHandler","notCurrent","getNotCurrentRejection","handleError","handleResult","handleHookResult","isTargetState","_aborted","HANDLE_RESULT","LOG_REJECTED_RESULT","LOG_ERROR","REJECT_ERROR","THROW_ERROR","addCoreResolvables","addResolvable","TRANSITION_TOKENS","isTransition","treeChangesCleanup","replaceTransitionWithNull","redirectToHook","redirect","redirectTo","makeEnterExitRetainHook","hookFn","onExitHook","onRetainHook","onEnterHook","RESOLVE_HOOK_PRIORITY","eagerResolvePath","lazyResolveState","resolveRemaining","loadEnteringViews","enteringViews","activateViews","exitingViews","vc","deactivateViewConfig","activateViewConfig","updateGlobalState","clearCurrentTransition","updateUrl","urlOptions","ignoredHook","ignoredReason","_ignoredReason","pending","abort","invalidTransitionHook","defaultTransOpts","notify","reload","supercede","custom","TransitionService","_router","_transitionCount","_eventTypes","_criteriaPaths","_deregisterHookFns","_defineCorePaths","_defineCoreEvents","_registerCoreTransitionHooks","onCreate","onStart","onExit","onRetain","onEnter","onFinish","onError","hooksArray","Phase","TH","paths","NORMAL_SORT","SYNCHRONOUS","_defineEvent","CREATE","BEFORE","RUN","SUCCESS","STATE","_definePathType","cmpByPhase","hookScope","fns","addCoreResolves","registerInvalidTransitionHook","registerRedirectToHook","registerOnExitHook","registerOnRetainHook","registerOnEnterHook","eagerResolve","registerEagerResolvePath","lazyResolve","registerLazyResolveState","resolveAll","registerResolveRemaining","loadViews","registerLoadEnteringViews","registerActivateViews","updateGlobals","registerUpdateGlobalState","registerUpdateUrl","UrlConfig","_isCaseInsensitive","_isStrictMode","_defaultSquashPolicy","hashPrefix","newprefix","host","port","protocol","caseInsensitive","strictMode","__assign","ParamFactory","fromSearch","UrlMatcherFactory","UrlMatcher","globalConfig","strict","decodeParams","object","UrlRouter","urlParts","compareFn","read","urlMatcher","href","absolute","isHtml5","appendBasePath","slash","cfgPort","defineProperty","enumerable","configurable","UrlRuleFactory","makeRule","_what","fromUrlMatcher","fromState","fromRegExp","_handler","details","matchPriority","optional","search","stateOrDecl","transitionTo","sticky","Number","isUrlRule","defaultRuleSortFn","getHandlerFn","cmp","prioritySort","weights","URLMATCHER","REGEXP","RAW","OTHER","typeSort","urlMatcherSort","useMatchPriority","idSort","UrlRules","_sortFn","_rules","_id","_otherwiseFn","handlerFn","_sorted","ensureSorted","sorted","stableSort","group","_group","arrOfWrapper","wrapperA","wrapperB","cmpDiff","wrapper","UrlService","newurl","best","go","applyResult","_stopListeningFn","weight","BaseLocationServices","fireAfterUpdate","_listeners","_listener","_get","_location","_history","BrowserLocationConfig","_isHtml5","_hashPrefix","hostname","getBaseHref","baseTag","getElementsByTagName","extendStatics","__extends","setPrototypeOf","__proto__","__","HashLocationService","_super","title","MemoryLocationConfig","_port","_protocol","_host","newval","MemoryLocationService","_url","PushStateLocationService","_config","_getBasePrefix","basePrefix","exactBaseHrefMatch","startsWithBase","fullUrl","replaceState","pushState","Promise","reject","deferred","keyValsToObjectR","accum","getParams","queryString","orEmptyString","beforehash","buildUrl","loc","searchObject","locationPluginFactory","serviceClass","configurationClass","configuration","_uiViews","_viewConfigs","_viewConfigFactories","_registeredUIView","_registeredUIViews","_activeViewConfigs","_onSync","normalizeUIViewTarget","rawViewName","viewAtContext","relativeViewNameSugar","anchorState","anchor","_rootContext","viewType","cfgFactory","cfgs","uiViewsByFqn","viewConfigDepth","depthCompare","depthFn","posNeg","uiViewTuples","stateDepth","matchingConfigs","matchedViewConfigs","unmatchedConfigTuples","allTuples","uiViews","available","active","vcSegments","uivSegments","negOffset","fqnToFirstSegment","uiViewContext","ARIA_DISABLE_ATTR","ngAriaModule","info","angularVersion","ariaHidden","ariaChecked","ariaReadonly","ariaDisabled","ariaRequired","ariaInvalid","ariaValue","tabindex","bindKeydown","bindRoleForClick","watchExpr","ariaAttr","nativeAriaNodeNames","negate","ariaCamelName","isNodeOneOf","boolVal","newConfig","$$watchExpr","nodeTypeArray","nodeName","$aria","shouldAttachAttr","normalizedAttr","allowNonAriaNodes","shouldAttachRole","role","shape","getShape","post","ngModel","needsTabIndex","ngAriaWatchModelValue","$modelValue","newVal","$viewValue","$isEmpty","needsAriaValuemin","needsAriaValuemax","needsAriaValuenow","$observe","$validators","required","$invalid","ngMessages","ngClick","ngKeydown","ngKeypress","ngKeyup","keyCode","which","isContentEditable","$event","readOnly","pristine","resetable","starWidth","starHeight","canelWidth","cancelHeight","rated","reset","beforeRated","beforeReset","isTouch","navigator","msMaxTouchPoints","orgValue","starPartWidth","steps","garbage","getValue","index","getStartParts","getStarOffset","ratio","isSelected","removeRating","rating","setValue","tmpValue","put","IndexController","$mdDialog","RemoteStorageService","api","STORAGE_LAYOUT","STORAGE_VISITOR","vm","toggle","up","updateStorage","cmd","layout","postMessage","onStorageError","debug","visitor","status","div_color","settings","color","text_color","textColor","text_button_color","textButtonColor","button_color","color_button","background_color","backgroundColor","client_height","documentElement","clientHeight","innerHeight","client_width","clientWidth","style","setProperty","tg","getStoredValueWithLocation","visitorStoragePromise","getItem","layoutStoragePromise","visitorValue","layoutValue","interaction","alignment","online","exceeded","maxInteractions","openedInteractions","isOnline","hideWhenOffline","createElement","appendChild","sheet","insertRule","close","confirm","querySelector","clickOutsideToClose","closingQuestion","ok","show","chatInteraction","customUpdate","closed","closeReason","$promise","download","getMessages","intid","includeAll","_map","rows","row","sender","direction","customerAlias","ContactId","agentIdentifier","UserId","agentAlias","User","alias","fullname","body","createdAt","moment","getHeaderShape","header_shape","CHAT_STATUSES","offline","defaultTitle","header_online","header_offline","addEventListener","routeRun","cursor","hide","_forIn","_isNil","routeConfig","$stateProvider","$httpProvider","localStorageServiceProvider","STORAGE_PREFIX","Pragma","setPrefix","waitingTemplate","onlineTemplate","offlineTemplate","chatTemplate","unmanagedTemplate","closingTemplate","ClosingController","$mdToast","errors","toast","simple","textContent","formSubmitFailureMessage","toastClass","position","stopLoading","loading","goToIfTime","form","upColor","downColor","userForm","$setPristine","$setUntouched","enableDownload","removeItem","submit","_merge","ratingType","customer","formSubmitSuccessMessage","finally","skip","apiService","$resource","paramDefaults","baseUrl","remote","chatWebsite","method","getFields","uploadAttachment","transformRequest","downloadAttachment","abandon","chatMessage","ChatController","$interval","$document","emojiArea","getMessagesInterval","getInteractionInterval","lastMessageId","clearStorage","scrollToBottomOfChat","getElementsByClassName","scrollTop","scrollHeight","handleSizeError","sendMessage","updateRootscope","interactionStarted","emojioneArea","setText","getInteraction","disposition","reply","getText","shiftKey","includeAgent","added","_find","messages","emojiOptions","watchEmbedData","fontSmiley","emoji","linkTarget","ngFlowOptions","allowDuplicateUploads","showMenu","replyMessage","$","placeholder","placeholderMessage","keyup","editor","ready","setFocus","reply_button","maxFileSizeMb","fd","FormData","AttachmentId","_values","OfflineController","$sce","fromKey","initialFields","typeField","optJsonFormData","showLeafArrayIndexes","includeNullValues","onSubmitSuccess","fields","_cloneDeep","trustAsHtml","initUploadButton","formItem","uploadItem","button","label","css","trigger","click","props","maxSizeMB","some","sizeErrMessage","removeFileItem","setupFileInput","multipleUpload","setAttribute","makeFileOptionsVisible","fileOpts","lastOpt","mapKeyOffline","_random","field","helpText","isHTML","checkHTML","cmField","uploadFields","payLoad","isFormDataPayload","isJsonPayload","payload","jsonToFormData","initialFormData","OnlineController","initVisitorForm","mapKey","disableItem","chatInteractionId","messageId","channel","variable","referer","customerIp","chatMessageError","enableCustomerWriting","UnmanagedController","note","WaitingController","getInteractionIntervalHandle","open","remoteAddress","URL","address","origin","setItem","action","storage","expectedAction","removeEventListener","stringData","warn","toTrustedFilter","constant","ngEnter","getElementById","div","startTime","sentAt","createTextNode","myWindow","write","innerHTML","focus","print","printElement","elemToPrint","$mdGestureProvider","skipClickHijack","exports","globalThis","isJsonObject","Blob","isGlobalFormDataPresent","getDefaultFormData","convertRecursively","jsonObject","formData","parentKey","propName","FileList","toISOString","mergedOptions","carry","objectToMerge","objectKey","defineLocale","months","monthsShort","weekdays","weekdaysShort","weekdaysMin","meridiemParse","isPM","meridiem","hours","minutes","isLower","longDateFormat","LT","LTS","L","LL","LLL","LLLL","calendar","sameDay","nextDay","nextWeek","lastDay","lastWeek","sameElse","relativeTime","future","past","ss","mm","h","hh","dd","M","MM","y","yy","dayOfMonthOrdinalParse","ordinal","number","week","dow","doy","pluralForm","plurals","pluralize","u","withoutSuffix","isFuture","f","weekdaysParseExact","hour","minute","postformat","symbolMap","preparse","numberMap","suffixes","relativeTimeWithPlural","num","forms","standalone","isFormat","day","period","w","ww","lastDigit","last2Digits","meridiemHour","monthsShortRegex","monthsParseExact","relativeTimeWithMutation","mutationTable","softMutation","mutation","lastNumber","monthsParse","monthsRegex","minWeekdaysParse","weekdaysParse","fullWeekdaysParse","shortWeekdaysParse","monthsStrictRegex","monthsShortStrictRegex","longMonthsParse","shortMonthsParse","translate","ll","lll","llll","output","plural","processRelativeTime","monthsNominativeEl","monthsGenitiveEl","momentToFormat","_monthsGenitiveEl","month","_monthsNominativeEl","calendarEl","mom","_calendarEl","monthsShortDot","invalidDate","numbersPast","numbersFuture","verbalNumber","monthsShortWithDots","monthsShortWithoutDots","weekEndings","eras","since","offset","narrow","abbr","until","eraYearOrdinalRegex","eraYearOrdinalParse","now","$0","$2","isUpper","eifelerRegelAppliesToNumber","units","translateSingular","special","relativeTimeWithSingular","translator","words","correctGrammaticalCase","wordKey","relativeTimeMr","monthsNominative","monthsSubjective","separator","days","numbersNouns","numberNoun","hundred","floor","ten","one","word","numberAsNoun","time","hm","processHoursFunction","nominative","accusative","genitive","webpackContext","req","webpackContextResolve","__webpack_require__","code","urlSanitizationWhitelist","aHrefSanitizationWhitelist","stringifyField","decimalSep","isFloat","toLocaleString","quoteStrings","txtDelim","isFinite","header","fieldSep","c","columnOrder","addByteOrderMarker","isSpecialChar","getSpecialChar","filename","charset","csv","buildCSV","getFilename","addClass","ngCsvLoadingClass","csvHeader","csvColumnOrder","csvLabel","removeClass","msSaveOrOpenBlob","msSaveBlob","createObjectURL"],"sourceRoot":""} \ No newline at end of file diff --git a/snippet/3.5.0/assets/images/00fe515d7113c2841e5d.svg b/snippet/3.6.0/assets/images/00fe515d7113c2841e5d.svg similarity index 100% rename from snippet/3.5.0/assets/images/00fe515d7113c2841e5d.svg rename to snippet/3.6.0/assets/images/00fe515d7113c2841e5d.svg diff --git a/snippet/3.5.0/assets/images/3b24a6b94b2631f4d565.svg b/snippet/3.6.0/assets/images/3b24a6b94b2631f4d565.svg similarity index 100% rename from snippet/3.5.0/assets/images/3b24a6b94b2631f4d565.svg rename to snippet/3.6.0/assets/images/3b24a6b94b2631f4d565.svg diff --git a/snippet/3.5.0/assets/images/c9f502ad417b1b987198.svg b/snippet/3.6.0/assets/images/c9f502ad417b1b987198.svg similarity index 100% rename from snippet/3.5.0/assets/images/c9f502ad417b1b987198.svg rename to snippet/3.6.0/assets/images/c9f502ad417b1b987198.svg diff --git a/snippet/3.5.0/index.html b/snippet/3.6.0/index.html similarity index 94% rename from snippet/3.5.0/index.html rename to snippet/3.6.0/index.html index 28d2a15..ca26112 100644 --- a/snippet/3.5.0/index.html +++ b/snippet/3.6.0/index.html @@ -26,4 +26,4 @@ status != 'online' && status != 'offline' && status != 'unmanaged' - " ng-click="vm.close(); $event.stopPropagation();">
\ No newline at end of file + " ng-click="vm.close(); $event.stopPropagation();">
\ No newline at end of file diff --git a/snippet/3.5.0/scripts/app.js b/snippet/3.6.0/scripts/app.js similarity index 100% rename from snippet/3.5.0/scripts/app.js rename to snippet/3.6.0/scripts/app.js diff --git a/snippet/3.5.0/scripts/app.js.LICENSE.txt b/snippet/3.6.0/scripts/app.js.LICENSE.txt similarity index 100% rename from snippet/3.5.0/scripts/app.js.LICENSE.txt rename to snippet/3.6.0/scripts/app.js.LICENSE.txt diff --git a/snippet/3.6.0/scripts/chat.js b/snippet/3.6.0/scripts/chat.js new file mode 100644 index 0000000..f4af241 --- /dev/null +++ b/snippet/3.6.0/scripts/chat.js @@ -0,0 +1,3 @@ +/*! For license information please see chat.js.LICENSE.txt */ +(self.webpackChunkmotion_chat=self.webpackChunkmotion_chat||[]).push([["chat"],{"./node_modules/@flowjs/ng-flow/dist/ng-flow.js":(e,t,n)=>{var o=n("./node_modules/@flowjs/flow.js/src/flow.js");angular.module("flow.provider",[]).provider("flowFactory",(function(){"use strict";this.defaults={},this.factory=function(e){return new o(e)},this.events=[],this.on=function(e,t){this.events.push([e,t])},this.$get=function(){var e=this.factory,t=this.defaults,n=this.events;return{create:function(o){var r=e(angular.extend({},t,o));return angular.forEach(n,(function(e){r.on(e[0],e[1])})),r}}}})),angular.module("flow.init",["flow.provider"]).controller("flowCtrl",["$scope","$attrs","$parse","flowFactory",function(e,t,n,o){var r=angular.extend({},e.$eval(t.flowInit)),s=e.$eval(t.flowObject)||o.create(r),a=function(t){var n=Array.prototype.slice.call(arguments);n.shift();var o=e.$broadcast.apply(e,["flow::"+t,s].concat(n));if({progress:1,filesSubmitted:1,fileSuccess:1,fileError:1,complete:1}[t]&&e.$applyAsync(),o.defaultPrevented)return!1};s.on("catchAll",a),e.$on("$destroy",(function(){s.off("catchAll",a)})),e.$flow=s,t.hasOwnProperty("flowName")&&(n(t.flowName).assign(e,s),e.$on("$destroy",(function(){n(t.flowName).assign(e)})))}]).directive("flowInit",[function(){return{scope:!0,controller:"flowCtrl"}}]),angular.module("flow.btn",["flow.init"]).directive("flowBtn",[function(){return{restrict:"EA",scope:!1,require:"^flowInit",link:function(e,t,n){var o=n.hasOwnProperty("flowDirectory"),r=n.hasOwnProperty("flowSingleFile"),s=n.hasOwnProperty("flowAttrs")&&e.$eval(n.flowAttrs);e.$flow.assignBrowse(t,o,r,s)}}}]),angular.module("flow.dragEvents",["flow.init"]).directive("flowPreventDrop",(function(){return{scope:!1,link:function(e,t,n){t.bind("drop dragover",(function(e){e.preventDefault()}))}}})).directive("flowDragEnter",["$timeout",function(e){return{scope:!1,link:function(t,n,o){var r,s=!1;n.bind("dragover",(function(n){var a,i,d;i=!1,d=(a=n).dataTransfer||a.originalEvent.dataTransfer,angular.forEach(d&&d.types,(function(e){"Files"===e&&(i=!0)})),i&&(s||(t.$apply(o.flowDragEnter),s=!0),e.cancel(r),n.preventDefault())})),n.bind("dragleave drop",(function(n){e.cancel(r),r=e((function(){t.$eval(o.flowDragLeave),r=null,s=!1}),100)}))}}}]),angular.module("flow.drop",["flow.init"]).directive("flowDrop",(function(){return{scope:!1,require:"^flowInit",link:function(e,t,n){function o(){e.$flow.assignDrop(t)}n.flowDropEnabled?e.$watch(n.flowDropEnabled,(function(n){n?o():e.$flow.unAssignDrop(t)})):o()}}})),function(e){"use strict";var t=e.module("flow.events",["flow.init"]);e.forEach({fileSuccess:["$file","$message"],fileProgress:["$file"],fileAdded:["$file","$event"],filesAdded:["$files","$event"],filesSubmitted:["$files","$event"],fileRetry:["$file"],fileRemoved:["$file"],fileError:["$file","$message"],uploadStart:[],complete:[],progress:[],error:["$message","$file"]},(function(n,o){var r,s="flow"+((r=o).charAt(0).toUpperCase()+r.slice(1));"flowUploadStart"==s&&(s="flowUploadStarted"),t.directive(s,[function(){return{require:"^flowInit",controller:["$scope","$attrs",function(t,r){t.$on("flow::"+o,(function(){var o=Array.prototype.slice.call(arguments),a=o.shift();if(t.$flow===o.shift()){var i={};e.forEach(n,(function(e,t){i[e]=o[t]})),!1===t.$eval(r[s],i)&&a.preventDefault()}}))}]}}])}))}(angular),angular.module("flow.img",["flow.init"]).directive("flowImg",[function(){return{scope:!1,require:"^flowInit",link:function(e,t,n){var o=n.flowImg;e.$watch(o,(function(t){if(t){var o=new FileReader;o.readAsDataURL(t.file),o.onload=function(t){e.$apply((function(){n.$set("src",t.target.result)}))}}}))}}}]),angular.module("flow.transfers",["flow.init"]).directive("flowTransfers",[function(){return{scope:!0,require:"^flowInit",link:function(e){e.transfers=e.$flow.files}}}]),angular.module("flow",["flow.provider","flow.init","flow.events","flow.btn","flow.drop","flow.transfers","flow.img","flow.dragEvents"])},"./node_modules/@uirouter/angularjs/lib-esm/directives/viewDirective.js":(e,t,n)=>{"use strict";var o,r=n("./node_modules/@uirouter/core/lib-esm/index.js"),s=n("./node_modules/@uirouter/angularjs/lib-esm/angular.js"),a=n("./node_modules/@uirouter/angularjs/lib-esm/services.js"),i=n("./node_modules/@uirouter/angularjs/lib-esm/statebuilders/views.js");function d(e,t,n,o,i){var d=(0,r.parse)("viewDecl.controllerAs"),u=(0,r.parse)("viewDecl.resolveAs");return{restrict:"ECA",priority:-400,compile:function(o){var m=o.html();return o.empty(),function(o,_){var c=_.data("$uiView");if(!c)return _.html(m),void e(_.contents())(o);var h=c.$cfg||{viewDecl:{},getTemplate:r.noop},f=h.path&&new r.ResolveContext(h.path);_.html(h.getTemplate(_,f)||m),r.trace.traceUIViewFill(c.$uiView,_.html());var p=e(_.contents()),M=h.controller,y=d(h),L=u(h),g=f&&(0,a.D)(f);if(o[L]=g,M){var Y=t(M,(0,r.extend)({},g,{$scope:o,$element:_}));y&&(o[y]=Y,o[y][L]=g),_.data("$ngControllerController",Y),_.children().data("$ngControllerController",Y),l(i,n,Y,o,h)}if((0,r.isString)(h.component))var v=(0,r.kebobString)(h.component),k=new RegExp("^(x-|data-)?"+v+"$","i"),j=o.$watch((function(){var e=[].slice.call(_[0].children).filter((function(e){return e&&e.tagName&&k.exec(e.tagName)}));return e&&s.ng.element(e).data("$"+h.component+"Controller")}),(function(e){e&&(l(i,n,e,o,h),j())}));p(o)}}}}o=["$view","$animate","$uiViewScroll","$interpolate","$q",function(e,t,n,o,a){var d={$cfg:{viewDecl:{$context:e._pluginapi._rootViewContext()}},$uiView:{}},u={count:0,restrict:"ECA",terminal:!0,priority:400,transclude:"element",compile:function(m,l,_){return function(m,l,c){var h,f,p,M,y=c.onload||"",L=c.autoscroll,g=function(e,n,o){s.ng.version.minor>2?t.enter(e,null,n).then(o):t.enter(e,null,n,o)},Y=function(e,n){s.ng.version.minor>2?t.leave(e).then(n):t.leave(e,n)},v=l.inheritedData("$uiView")||d,k=o(c.uiView||c.name||"")(m)||"$default",j={$type:"ng1",id:u.count++,name:k,fqn:v.$uiView.fqn?v.$uiView.fqn+"."+k:k,config:null,configUpdated:function(e){(!e||e instanceof i.qO)&&(M!==e&&(r.trace.traceUIViewConfigUpdated(j,e&&e.viewDecl&&e.viewDecl.$context),M=e,b(e)))},get creationContext(){var e=(0,r.parse)("$cfg.viewDecl.$context")(v),t=(0,r.parse)("$uiView.creationContext")(v);return e||t}};r.trace.traceUIViewEvent("Linking",j),l.data("$uiView",{$uiView:j}),b();var w=e.registerUIView(j);function b(e){var t=m.$new(),o=a.defer(),s=a.defer(),i={$cfg:e,$uiView:j},d={$animEnter:o.promise,$animLeave:s.promise,$$animLeave:s};t.$emit("$viewContentLoading",k);var u=_(t,(function(e){e.data("$uiViewAnim",d),e.data("$uiView",i),g(e,l,(function(){o.resolve(),p&&p.$emit("$viewContentAnimationEnded"),((0,r.isDefined)(L)&&!L||m.$eval(L))&&n(e)})),function(){if(h&&(r.trace.traceUIViewEvent("Removing (previous) el",h.data("$uiView")),h.remove(),h=null),p&&(r.trace.traceUIViewEvent("Destroying scope",j),p.$destroy(),p=null),f){var e=f.data("$uiViewAnim");r.trace.traceUIViewEvent("Animate out",e),Y(f,(function(){e.$$animLeave.resolve(),h=null})),h=f,f=null}}()}));f=u,(p=t).$emit("$viewContentLoaded",e||M),p.$eval(y)}m.$on("$destroy",(function(){r.trace.traceUIViewEvent("Destroying/Unregistering",j),w()}))}}};return u}],d.$inject=["$compile","$controller","$transitions","$view","$q"];var u="function"==typeof s.ng.module("ui.router").component,m=0;function l(e,t,n,o,s){!(0,r.isFunction)(n.$onInit)||(s.viewDecl.component||s.viewDecl.componentProvider)&&u||n.$onInit();var a=(0,r.tail)(s.path).state.self,i={bind:n};if((0,r.isFunction)(n.uiOnParamsChanged)){var d=new r.ResolveContext(s.path).getResolvable("$transition$").data;o.$on("$destroy",t.onSuccess({},(function(e){if(e!==d&&-1===e.exiting().indexOf(a)){var t=e.params("to"),o=e.params("from"),s=function(e){return e.paramSchema},i=e.treeChanges("to").map(s).reduce(r.unnestR,[]),u=e.treeChanges("from").map(s).reduce(r.unnestR,[]),m=i.filter((function(e){var n=u.indexOf(e);return-1===n||!u[n].type.equals(t[e.id],o[e.id])}));if(m.length){var l=m.map((function(e){return e.id})),_=(0,r.filter)(t,(function(e,t){return-1!==l.indexOf(t)}));n.uiOnParamsChanged(_,e)}}}),i))}if((0,r.isFunction)(n.uiCanExit)){var l=m++,_="_uiCanExitIds",c=function(e){return!!e&&(e[_]&&!0===e[_][l]||c(e.redirectedFrom()))},h={exiting:a.name};o.$on("$destroy",t.onBefore(h,(function(t){var o,r=t[_]=t[_]||{};return c(t)||(o=e.when(n.uiCanExit(t))).then((function(e){return r[l]=!1!==e})),o}),i))}}s.ng.module("ui.router.state").directive("uiView",o),s.ng.module("ui.router.state").directive("uiView",d)},"./node_modules/@uirouter/angularjs/lib-esm/interface.js":()=>{},"./node_modules/@uirouter/angularjs/lib-esm/services.js":(e,t,n)=>{"use strict";n.d(t,{D:()=>k});var o=n("./node_modules/@uirouter/angularjs/lib-esm/angular.js"),r=n("./node_modules/@uirouter/core/lib-esm/index.js"),s=n("./node_modules/@uirouter/angularjs/lib-esm/statebuilders/views.js"),a=function(){function e(){var e=this;this._useHttp=o.ng.version.minor<3,this.$get=["$http","$templateCache","$injector",function(t,n,o){return e.$templateRequest=o.has&&o.has("$templateRequest")&&o.get("$templateRequest"),e.$http=t,e.$templateCache=n,e}]}return e.prototype.useHttpService=function(e){this._useHttp=e},e.prototype.fromConfig=function(e,t,n){var o=function(e){return r.services.$q.when(e).then((function(e){return{template:e}}))},s=function(e){return r.services.$q.when(e).then((function(e){return{component:e}}))};return(0,r.isDefined)(e.template)?o(this.fromString(e.template,t)):(0,r.isDefined)(e.templateUrl)?o(this.fromUrl(e.templateUrl,t)):(0,r.isDefined)(e.templateProvider)?o(this.fromProvider(e.templateProvider,t,n)):(0,r.isDefined)(e.component)?s(e.component):(0,r.isDefined)(e.componentProvider)?s(this.fromComponentProvider(e.componentProvider,t,n)):o("")},e.prototype.fromString=function(e,t){return(0,r.isFunction)(e)?e(t):e},e.prototype.fromUrl=function(e,t){return(0,r.isFunction)(e)&&(e=e(t)),null==e?null:this._useHttp?this.$http.get(e,{cache:this.$templateCache,headers:{Accept:"text/html"}}).then((function(e){return e.data})):this.$templateRequest(e)},e.prototype.fromProvider=function(e,t,n){var o=r.services.$injector.annotate(e),s=(0,r.isArray)(e)?(0,r.tail)(e):e;return new r.Resolvable("",s,o).get(n)},e.prototype.fromComponentProvider=function(e,t,n){var o=r.services.$injector.annotate(e),s=(0,r.isArray)(e)?(0,r.tail)(e):e;return new r.Resolvable("",s,o).get(n)},e.prototype.makeComponentTemplate=function(e,t,n,s){s=s||{};var a=o.ng.version.minor>=3?"::":"",d=function(e){var t=(0,r.kebobString)(e);return/^(x|data)-/.exec(t)?"x-"+t:t},u=function(e){var t=r.services.$injector.get(e+"Directive");if(!t||!t.length)throw new Error("Unable to find component named '"+e+"'");return t.map(i).reduce(r.unnestR,[])}(n).map((function(n){var o=n.name,i=n.type,u=d(o);if(e.attr(u)&&!s[o])return u+"='"+e.attr(u)+"'";var m=s[o]||o;if("@"===i)return u+"='{{"+a+"$resolve."+m+"}}'";if("&"===i){var l=t.getResolvable(m),_=l&&l.data,c=_&&r.services.$injector.annotate(_)||[];return u+"='$resolve."+m+((0,r.isArray)(_)?"["+(_.length-1)+"]":"")+"("+c.join(",")+")'"}return u+"='"+a+"$resolve."+m+"'"})).join(" "),m=d(n);return"<"+m+" "+u+">"},e}(),i=function(e){return(0,r.isObject)(e.bindToController)?d(e.bindToController):d(e.scope)},d=function(e){return Object.keys(e||{}).map((function(t){return[t,/^([=<@&])[?]?(.*)/.exec(e[t])]})).filter((function(e){return(0,r.isDefined)(e)&&(0,r.isArray)(e[1])})).map((function(e){return{name:e[1][2]||e[0],type:e[1][1]}}))},u=n("./node_modules/@uirouter/angularjs/lib-esm/stateProvider.js"),m=function(e){return function(t){var n=t[e],o="onExit"===e?"from":"to";return n?function(e,t){var s=new r.ResolveContext(e.treeChanges(o)).subContext(t.$$state()),a=(0,r.extend)(k(s),{$state$:t,$transition$:e});return r.services.$injector.invoke(n,this,a)}:void 0}},l=function(){function e(e){this._urlListeners=[],this.$locationProvider=e;var t=(0,r.val)(e);(0,r.createProxyFunctions)(t,this,t,["hashPrefix"])}return e.monkeyPatchPathParameterType=function(e){var t=e.urlMatcherFactory.type("path");t.encode=function(e){return null!=e?e.toString().replace(/(~|\/)/g,(function(e){return{"~":"~~","/":"~2F"}[e]})):e},t.decode=function(e){return null!=e?e.toString().replace(/(~~|~2F)/g,(function(e){return{"~~":"~","~2F":"/"}[e]})):e}},e.prototype.dispose=function(){},e.prototype.onChange=function(e){var t=this;return this._urlListeners.push(e),function(){return(0,r.removeFrom)(t._urlListeners)(e)}},e.prototype.html5Mode=function(){var e=this.$locationProvider.html5Mode();return(e=(0,r.isObject)(e)?e.enabled:e)&&this.$sniffer.history},e.prototype.baseHref=function(){return this._baseHref||(this._baseHref=this.$browser.baseHref()||this.$window.location.pathname)},e.prototype.url=function(e,t,n){return void 0===t&&(t=!1),(0,r.isDefined)(e)&&this.$location.url(e),t&&this.$location.replace(),n&&this.$location.state(n),this.$location.url()},e.prototype._runtimeServices=function(e,t,n,o,s){var a=this;this.$location=t,this.$sniffer=n,this.$browser=o,this.$window=s,e.$on("$locationChangeSuccess",(function(e){return a._urlListeners.forEach((function(t){return t(e)}))}));var i=(0,r.val)(t);(0,r.createProxyFunctions)(i,this,i,["replace","path","search","hash"]),(0,r.createProxyFunctions)(i,this,i,["port","protocol","host"])},e}(),_=n("./node_modules/@uirouter/angularjs/lib-esm/urlRouterProvider.js");o.ng.module("ui.router.angular1",[]);var c=o.ng.module("ui.router.init",["ng"]),h=o.ng.module("ui.router.util",["ui.router.init"]),f=o.ng.module("ui.router.router",["ui.router.util"]),p=o.ng.module("ui.router.state",["ui.router.router","ui.router.util","ui.router.angular1"]),M=o.ng.module("ui.router",["ui.router.init","ui.router.state","ui.router.angular1"]),y=(o.ng.module("ui.router.compat",["ui.router"]),null);function L(e){(y=this.router=new r.UIRouter).stateProvider=new u.X(y.stateRegistry,y.stateService),y.stateRegistry.decorator("views",s.LB),y.stateRegistry.decorator("onExit",m("onExit")),y.stateRegistry.decorator("onRetain",m("onRetain")),y.stateRegistry.decorator("onEnter",m("onEnter")),y.viewService._pluginapi._viewConfigFactory("ng1",(0,s.OB)()),y.urlService.config._decodeParams=!1;var t=y.locationService=y.locationConfig=new l(e);function n(e,n,o,r,s,a,i){return t._runtimeServices(s,e,r,n,o),delete y.router,delete y.$get,y}return l.monkeyPatchPathParameterType(y),y.router=y,y.$get=n,n.$inject=["$location","$browser","$window","$sniffer","$rootScope","$http","$templateCache"],y}L.$inject=["$locationProvider"];var g=function(e){return["$uiRouterProvider",function(t){var n=t.router[e];return n.$get=function(){return n},n}]};function Y(e,t,n){if(r.services.$injector=e,r.services.$q=t,!Object.prototype.hasOwnProperty.call(e,"strictDi"))try{e.invoke((function(e){}))}catch(t){e.strictDi=!!/strict mode/.exec(t&&t.toString())}n.stateRegistry.get().map((function(e){return e.$$state().resolvables})).reduce(r.unnestR,[]).filter((function(e){return"deferred"===e.deps})).forEach((function(t){return t.deps=e.annotate(t.resolveFn,e.strictDi)}))}function v(e){e.$watch((function(){r.trace.approximateDigests++}))}Y.$inject=["$injector","$q","$uiRouter"],v.$inject=["$rootScope"],c.provider("$uiRouter",L),f.provider("$urlRouter",["$uiRouterProvider",function(e){return e.urlRouterProvider=new _.L(e)}]),h.provider("$urlService",g("urlService")),h.provider("$urlMatcherFactory",["$uiRouterProvider",function(){return y.urlMatcherFactory}]),h.provider("$templateFactory",(function(){return new a})),p.provider("$stateRegistry",g("stateRegistry")),p.provider("$uiRouterGlobals",g("globals")),p.provider("$transitions",g("transitionService")),p.provider("$state",["$uiRouterProvider",function(){return(0,r.extend)(y.stateProvider,{$get:function(){return y.stateService}})}]),p.factory("$stateParams",["$uiRouter",function(e){return e.globals.params}]),M.factory("$view",(function(){return y.viewService})),M.service("$trace",(function(){return r.trace})),M.run(v),h.run(["$urlMatcherFactory",function(e){}]),p.run(["$state",function(e){}]),f.run(["$urlRouter",function(e){}]),c.run(Y);var k=function(e){return e.getTokens().filter(r.isString).map((function(t){var n=e.getResolvable(t);return[t,"NOWAIT"===e.getPolicy(n).async?n.promise:n.data]})).reduce(r.applyPairs,{})}},"./node_modules/@uirouter/angularjs/lib-esm/stateFilters.js":(e,t,n)=>{"use strict";var o=n("./node_modules/@uirouter/angularjs/lib-esm/angular.js");function r(e){var t=function(t,n,o){return e.is(t,n,o)};return t.$stateful=!0,t}function s(e){var t=function(t,n,o){return e.includes(t,n,o)};return t.$stateful=!0,t}r.$inject=["$state"],s.$inject=["$state"],o.ng.module("ui.router.state").filter("isState",r).filter("includedByState",s)},"./node_modules/@uirouter/angularjs/lib-esm/stateProvider.js":(e,t,n)=>{"use strict";n.d(t,{X:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/index.js"),r=function(){function e(t,n){this.stateRegistry=t,this.stateService=n,(0,o.createProxyFunctions)((0,o.val)(e.prototype),this,(0,o.val)(this))}return e.prototype.decorator=function(e,t){return this.stateRegistry.decorator(e,t)||this},e.prototype.state=function(e,t){return(0,o.isObject)(e)?t=e:t.name=e,this.stateRegistry.register(t),this},e.prototype.onInvalid=function(e){return this.stateService.onInvalid(e)},e}()},"./node_modules/@uirouter/angularjs/lib-esm/statebuilders/views.js":(e,t,n)=>{"use strict";n.d(t,{OB:()=>r,LB:()=>a,qO:()=>d});var o=n("./node_modules/@uirouter/core/lib-esm/index.js");function r(){var e=null;return function(t,n){return e=e||o.services.$injector.get("$templateFactory"),[new d(t,n,e)]}}var s=function(e,t){return e.reduce((function(e,n){return e||(0,o.isDefined)(t[n])}),!1)};function a(e){if(!e.parent)return{};var t=["component","bindings","componentProvider"],n=["templateProvider","templateUrl","template","notify","async"].concat(["controller","controllerProvider","controllerAs","resolveAs"]),r=t.concat(n);if((0,o.isDefined)(e.views)&&s(r,e))throw new Error("State '"+e.name+"' has a 'views' object. It cannot also have \"view properties\" at the state level. Move the following properties into a view (in the 'views' object): "+r.filter((function(t){return(0,o.isDefined)(e[t])})).join(", "));var a={},i=e.views||{$default:(0,o.pick)(e,r)};return(0,o.forEach)(i,(function(r,i){if(i=i||"$default",(0,o.isString)(r)&&(r={component:r}),r=(0,o.extend)({},r),s(t,r)&&s(n,r))throw new Error("Cannot combine: "+t.join("|")+" with: "+n.join("|")+" in stateview: '"+i+"@"+e.name+"'");r.resolveAs=r.resolveAs||"$resolve",r.$type="ng1",r.$context=e,r.$name=i;var d=o.ViewService.normalizeUIViewTarget(r.$context,r.$name);r.$uiViewName=d.uiViewName,r.$uiViewContextAnchor=d.uiViewContextAnchor,a[i]=r})),a}var i=0,d=function(){function e(e,t,n){var o=this;this.path=e,this.viewDecl=t,this.factory=n,this.$id=i++,this.loaded=!1,this.getTemplate=function(e,t){return o.component?o.factory.makeComponentTemplate(e,t,o.component,o.viewDecl.bindings):o.template}}return e.prototype.load=function(){var e=this,t=o.services.$q,n=new o.ResolveContext(this.path),r=this.path.reduce((function(e,t){return(0,o.extend)(e,t.paramValues)}),{}),s={template:t.when(this.factory.fromConfig(this.viewDecl,r,n)),controller:t.when(this.getController(n))};return t.all(s).then((function(t){return o.trace.traceViewServiceEvent("Loaded",e),e.controller=t.controller,(0,o.extend)(e,t.template),e}))},e.prototype.getController=function(e){var t=this.viewDecl.controllerProvider;if(!(0,o.isInjectable)(t))return this.viewDecl.controller;var n=o.services.$injector.annotate(t),r=(0,o.isArray)(t)?(0,o.tail)(t):t;return new o.Resolvable("",r,n).get(e)},e}()},"./node_modules/@uirouter/angularjs/lib-esm/urlRouterProvider.js":(e,t,n)=>{"use strict";n.d(t,{L:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/index.js"),r=function(){function e(e){this.router=e}return e.injectableHandler=function(e,t){return function(n){return o.services.$injector.invoke(t,null,{$match:n,$stateParams:e.globals.params})}},e.prototype.$get=function(){var e=this.router.urlService;return this.router.urlRouter.update(!0),e.interceptDeferred||e.listen(),this.router.urlRouter},e.prototype.rule=function(e){var t=this;if(!(0,o.isFunction)(e))throw new Error("'rule' must be a function");var n=new o.BaseUrlRule((function(){return e(o.services.$injector,t.router.locationService)}),o.identity);return this.router.urlService.rules.rule(n),this},e.prototype.otherwise=function(e){var t=this,n=this.router.urlService.rules;if((0,o.isString)(e))n.otherwise(e);else{if(!(0,o.isFunction)(e))throw new Error("'rule' must be a string or function");n.otherwise((function(){return e(o.services.$injector,t.router.locationService)}))}return this},e.prototype.when=function(t,n){return((0,o.isArray)(n)||(0,o.isFunction)(n))&&(n=e.injectableHandler(this.router,n)),this.router.urlService.rules.when(t,n),this},e.prototype.deferIntercept=function(e){this.router.urlService.deferIntercept(e)},e}()},"./node_modules/@uirouter/angularjs/lib-esm/viewScroll.js":(e,t,n)=>{"use strict";n("./node_modules/@uirouter/angularjs/lib-esm/angular.js").ng.module("ui.router.state").provider("$uiViewScroll",(function(){var e=!1;this.useAnchorScroll=function(){e=!0},this.$get=["$anchorScroll","$timeout",function(t,n){return e?t:function(e){return n((function(){e[0].scrollIntoView()}),0,!1)}}]}))},"./node_modules/@uirouter/core/lib-esm/common/common.js":(e,t,n)=>{"use strict";n.d(t,{Jz:()=>i,xZ:()=>u,Qs:()=>m,Ed:()=>l,l7:()=>_,fS:()=>c,yR:()=>h,ZT:()=>f,WR:()=>p,ED:()=>M,d3:()=>y,nA:()=>L,LH:()=>g,Wk:()=>Y,ce:()=>v,LQ:()=>k,mX:()=>j,ei:()=>w,CE:()=>b,hX:()=>D,sE:()=>T,js:()=>S,UI:()=>H,VO:()=>x,XC:()=>E,o8:()=>P,M7:()=>O,FN:()=>$,Ez:()=>A,v_:()=>R,UW:()=>F,sp:()=>W,ym:()=>C,bb:()=>I,Gb:()=>z,JG:()=>J,HX:()=>V,jv:()=>N});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),a=function(){for(var e=0,t=0,n=arguments.length;t=0&&e.splice(n,1),e})),g=(0,r.WA)((function(e,t){return e.push(t),t})),Y=function(e){return e.slice().forEach((function(t){"function"==typeof t&&t(),L(e,t)}))};function v(e){for(var t=[],n=1;n{"use strict";n.d(t,{H:()=>o,u:()=>r});var o=function(e,t){return t.reduce((function(t,n){return t[n]=(o=e+"."+n+"()",function(){throw new Error("No implementation for "+o+". The framework specific code did not implement this method.")}),t;var o}),{})},r={$q:void 0,$injector:void 0}},"./node_modules/@uirouter/core/lib-esm/common/glob.js":(e,t,n)=>{"use strict";n.d(t,{r:()=>o});var o=function(){function e(e){this.text=e,this.glob=e.split(".");var t=this.text.split(".").map((function(e){return"**"===e?"(?:|(?:\\.[^.]*)*)":"*"===e?"\\.[^.]*":"\\."+e})).join("");this.regexp=new RegExp("^"+t+"$")}return e.is=function(e){return!!/[!,*]+/.exec(e)},e.fromString=function(t){return e.is(t)?new e(t):null},e.prototype.matches=function(e){return this.regexp.test("."+e)},e}()},"./node_modules/@uirouter/core/lib-esm/common/hof.js":(e,t,n)=>{"use strict";n.d(t,{WA:()=>r,zG:()=>a,vg:()=>i,OH:()=>d,Qc:()=>u,ff:()=>m,xD:()=>l,or:()=>_,$6:()=>c,Yj:()=>h,is:()=>f,P0:()=>p,uj:()=>M});var o=function(){for(var e=0,t=0,n=arguments.length;t=e.length)return e.apply(this,arguments);var n=Array.prototype.slice.call(arguments);return t.bind.apply(t,o([this],n))}}function s(){var e=arguments,t=e.length-1;return function(){for(var n=t,o=e[t].apply(this,arguments);n--;)o=e[n].call(this,o);return o}}function a(){for(var e=[],t=0;t{"use strict";n.d(t,{o8:()=>a,$K:()=>i,Ft:()=>d,le:()=>u,mf:()=>m,hj:()=>l,HD:()=>_,Kn:()=>c,kJ:()=>h,J_:()=>f,Kj:()=>p,Qh:()=>M,tI:()=>y});var o=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),r=Object.prototype.toString,s=function(e){return function(t){return typeof t===e}},a=s("undefined"),i=(0,o.ff)(a),d=function(e){return null===e},u=(0,o.or)(d,a),m=s("function"),l=s("number"),_=s("string"),c=function(e){return null!==e&&"object"==typeof e},h=Array.isArray,f=function(e){return"[object Date]"===r.call(e)},p=function(e){return"[object RegExp]"===r.call(e)};function M(e){if(h(e)&&e.length){var t=e.slice(0,-1),n=e.slice(-1);return!(t.filter((0,o.ff)(_)).length||n.filter((0,o.ff)(m)).length)}return m(e)}var y=(0,o.xD)(c,(0,o.zG)((0,o.vg)("then"),m))},"./node_modules/@uirouter/core/lib-esm/common/queue.js":(e,t,n)=>{"use strict";n.d(t,{c:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=function(){function e(e,t){void 0===e&&(e=[]),void 0===t&&(t=null),this._items=e,this._limit=t,this._evictListeners=[],this.onEvict=(0,o.LH)(this._evictListeners)}return e.prototype.enqueue=function(e){var t=this._items;return t.push(e),this._limit&&t.length>this._limit&&this.evict(),e},e.prototype.evict=function(){var e=this._items.shift();return this._evictListeners.forEach((function(t){return t(e)})),e},e.prototype.dequeue=function(){if(this.size())return this._items.splice(0,1)[0]},e.prototype.clear=function(){var e=this._items;return this._items=[],e},e.prototype.size=function(){return this._items.length},e.prototype.remove=function(e){var t=this._items.indexOf(e);return t>-1&&this._items.splice(t,1)[0]},e.prototype.peekTail=function(){return this._items[this._items.length-1]},e.prototype.peekHead=function(){if(this.size())return this._items[0]},e}()},"./node_modules/@uirouter/core/lib-esm/common/safeConsole.js":(e,t,n)=>{"use strict";n.d(t,{L:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r={log:o.ZT,error:o.ZT,table:o.ZT},s="undefined"!=typeof document&&document.documentMode&&9===document.documentMode?window&&window.console?function(e){var t=function(t){return Function.prototype.bind.call(t,e)};return{log:t(e.log),error:t(e.log),table:t(e.log)}}(window.console):r:console.table&&console.error?console:function(e){var t=e.log.bind(e);return{log:t,error:e.error?e.error.bind(e):t,table:e.table?e.table.bind(e):t}}(console)},"./node_modules/@uirouter/core/lib-esm/common/strings.js":(e,t,n)=>{"use strict";n.d(t,{BS:()=>i,NE:()=>d,L$:()=>u,XF:()=>m,iC:()=>l,Pz:()=>h,Lb:()=>p,cW:()=>M,C7:()=>y,Fb:()=>L,HV:()=>g,PX:()=>Y,iV:()=>v});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=n("./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/hof.js");function i(e,t){return t.length<=e?t:t.substr(0,e-3)+"..."}function d(e,t){for(;t.length{"use strict";n.d(t,{g4:()=>c});var o,r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/safeConsole.js");function d(e){if(!e)return"ui-view (defunct)";var t=e.creationContext?e.creationContext.name||"(root)":"(none)";return"[ui-view#"+e.id+" "+e.$type+":"+e.fqn+" ("+e.name+"@"+t+")]"}function u(e){return(0,s.hj)(e)?o[e]:o[o[e]]}!function(e){e[e.RESOLVE=0]="RESOLVE",e[e.TRANSITION=1]="TRANSITION",e[e.HOOK=2]="HOOK",e[e.UIVIEW=3]="UIVIEW",e[e.VIEWCONFIG=4]="VIEWCONFIG"}(o||(o={}));var m=(0,r.Qc)("$id"),l=(0,r.Qc)("router.$id"),_=function(e){return"Transition #"+m(e)+"-"+l(e)},c=new(function(){function e(){this._enabled={},this.approximateDigests=0}return e.prototype._set=function(e,t){var n=this;t.length||(t=Object.keys(o).map((function(e){return parseInt(e,10)})).filter((function(e){return!isNaN(e)})).map((function(e){return o[e]}))),t.map(u).forEach((function(t){return n._enabled[t]=e}))},e.prototype.enable=function(){for(var e=[],t=0;t "+(0,a.Pz)(e))},e.prototype.traceTransitionIgnored=function(e){this.enabled(o.TRANSITION)&&i.L.log(_(e)+": Ignored <> "+(0,a.Pz)(e))},e.prototype.traceHookInvocation=function(e,t,n){if(this.enabled(o.HOOK)){var s=(0,r.Qc)("traceData.hookType")(n)||"internal",d=(0,r.Qc)("traceData.context.state.name")(n)||(0,r.Qc)("traceData.context")(n)||"unknown",u=(0,a.XF)(e.registeredHook.callback);i.L.log(_(t)+": Hook -> "+s+" context: "+d+", "+(0,a.BS)(200,u))}},e.prototype.traceHookResult=function(e,t,n){this.enabled(o.HOOK)&&i.L.log(_(t)+": <- Hook returned: "+(0,a.BS)(200,(0,a.Pz)(e)))},e.prototype.traceResolvePath=function(e,t,n){this.enabled(o.RESOLVE)&&i.L.log(_(n)+": Resolving "+e+" ("+t+")")},e.prototype.traceResolvableResolved=function(e,t){this.enabled(o.RESOLVE)&&i.L.log(_(t)+": <- Resolved "+e+" to: "+(0,a.BS)(200,(0,a.Pz)(e.data)))},e.prototype.traceError=function(e,t){this.enabled(o.TRANSITION)&&i.L.log(_(t)+": <- Rejected "+(0,a.Pz)(t)+", reason: "+e)},e.prototype.traceSuccess=function(e,t){this.enabled(o.TRANSITION)&&i.L.log(_(t)+": <- Success "+(0,a.Pz)(t)+", final state: "+e.name)},e.prototype.traceUIViewEvent=function(e,t,n){void 0===n&&(n=""),this.enabled(o.UIVIEW)&&i.L.log("ui-view: "+(0,a.NE)(30,e)+" "+d(t)+n)},e.prototype.traceUIViewConfigUpdated=function(e,t){this.enabled(o.UIVIEW)&&this.traceUIViewEvent("Updating",e," with ViewConfig from context='"+t+"'")},e.prototype.traceUIViewFill=function(e,t){this.enabled(o.UIVIEW)&&this.traceUIViewEvent("Fill",e," with: "+(0,a.BS)(200,t))},e.prototype.traceViewSync=function(e){if(this.enabled(o.VIEWCONFIG)){var t="uiview component fqn",n=e.map((function(e){var n,o=e.uiView,r=e.viewConfig,s=o&&o.fqn,a=r&&r.viewDecl.$context.name+": ("+r.viewDecl.$name+")";return(n={})[t]=s,n["view config state (view name)"]=a,n})).sort((function(e,n){return(e[t]||"").localeCompare(n[t]||"")}));i.L.table(n)}},e.prototype.traceViewServiceEvent=function(e,t){this.enabled(o.VIEWCONFIG)&&i.L.log("VIEWCONFIG: "+e+" "+function(e){var t=e.viewDecl,n=t.$context.name||"(root)";return"[View#"+e.$id+" from '"+n+"' state]: target ui-view: '"+t.$uiViewName+"@"+t.$uiViewContextAnchor+"'"}(t))},e.prototype.traceViewServiceUIViewEvent=function(e,t){this.enabled(o.VIEWCONFIG)&&i.L.log("VIEWCONFIG: "+e+" "+d(t))},e}())},"./node_modules/@uirouter/core/lib-esm/globals.js":(e,t,n)=>{"use strict";n.d(t,{k:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/params/stateParams.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/queue.js"),s=function(){function e(){this.params=new o.i,this.lastStartedTransitionId=-1,this.transitionHistory=new r.c([],1),this.successfulTransitions=new r.c([],1)}return e.prototype.dispose=function(){this.transitionHistory.clear(),this.successfulTransitions.clear(),this.transition=null},e}()},"./node_modules/@uirouter/core/lib-esm/hooks/lazyLoad.js":(e,t,n)=>{"use strict";n.d(t,{v:()=>s,A:()=>a});var o=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),r=function(e){var t=e.router,n=e.entering().filter((function(e){return!!e.$$state().lazyLoad})).map((function(t){return a(e,t)}));return o.u.$q.all(n).then((function(){if("url"!==e.originalTransition().options().source){var n=e.targetState();return t.stateService.target(n.identifier(),n.params(),n.options())}var o=t.urlService,r=o.match(o.parts()),s=r&&r.rule;if(s&&"STATE"===s.type){var a=s.state,i=r.match;return t.stateService.target(a,i,e.options())}t.urlService.sync()}))},s=function(e){return e.onBefore({entering:function(e){return!!e.lazyLoad}},r)};function a(e,t){var n=t.$$state().lazyLoad,r=n._promise;return r||(r=n._promise=o.u.$q.when(n(e,t)).then((function(t){return t&&Array.isArray(t.states)&&t.states.forEach((function(t){return e.router.stateRegistry.register(t)})),t})).then((function(e){return delete t.lazyLoad,delete t.$$state().lazyLoad,delete n._promise,e}),(function(e){return delete n._promise,o.u.$q.reject(e)}))),r}},"./node_modules/@uirouter/core/lib-esm/interface.js":(e,t,n)=>{},"./node_modules/@uirouter/core/lib-esm/params/interface.js":()=>{},"./node_modules/@uirouter/core/lib-esm/params/param.js":(e,t,n)=>{"use strict";n.d(t,{_:()=>o,d:()=>m});var o,r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),d=n("./node_modules/@uirouter/core/lib-esm/params/paramType.js"),u=Object.prototype.hasOwnProperty;!function(e){e[e.PATH=0]="PATH",e[e.SEARCH=1]="SEARCH",e[e.CONFIG=2]="CONFIG"}(o||(o={}));var m=function(){function e(e,t,n,i,m){var l=function(e,t,n){var s=!1===n.reloadOnSearch&&t===o.SEARCH||void 0,i=(0,r.sE)([n.dynamic,s],a.$K),d=(0,a.$K)(i)?{dynamic:i}:{},m=function(e){function t(){return e.value}e=function(e){return 0===["value","type","squash","array","dynamic"].filter(u.bind(e||{})).length}(e)?{value:e}:e,t.__cacheable=!0;var n=(0,a.Qh)(e.value)?e.value:t;return(0,r.l7)(e,{$$fn:n})}(n&&n.params&&n.params[e]);return(0,r.l7)(d,m)}(e,n,m);t=function(e,t,n,r,s){if(e.type&&t&&"string"!==t.name)throw new Error("Param '"+r+"' has two type configurations.");if(e.type&&t&&"string"===t.name&&s.type(e.type))return s.type(e.type);if(t)return t;if(!e.type){var a=n===o.CONFIG?"any":n===o.PATH?"path":n===o.SEARCH?"query":"string";return s.type(a)}return e.type instanceof d._?e.type:s.type(e.type)}(l,t,n,e,i.paramTypes);var _,c,h=(_={array:n===o.SEARCH&&"auto"},c=e.match(/\[\]$/)?{array:!0}:{},(0,r.l7)(_,c,l).array);t=h?t.$asArray(h,n===o.SEARCH):t;var f=void 0!==l.value||n===o.SEARCH,p=(0,a.$K)(l.dynamic)?!!l.dynamic:!!t.dynamic,M=(0,a.$K)(l.raw)?!!l.raw:!!t.raw,y=function(e,t,n){var o=e.squash;if(!t||!1===o)return!1;if(!(0,a.$K)(o)||null==o)return n;if(!0===o||(0,a.HD)(o))return o;throw new Error("Invalid squash policy: '"+o+"'. Valid policies: false, true, or arbitrary string")}(l,f,i.defaultSquashPolicy()),L=function(e,t,n,o){var i=[{from:"",to:n||t?void 0:""},{from:null,to:n||t?void 0:""}],d=(0,a.kJ)(e.replace)?e.replace:[];(0,a.HD)(o)&&d.push({from:o,to:void 0});var u=(0,r.UI)(d,(0,s.vg)("from"));return(0,r.hX)(i,(function(e){return-1===u.indexOf(e.from)})).concat(d)}(l,h,f,y),g=(0,a.$K)(l.inherit)?!!l.inherit:!!t.inherit;(0,r.l7)(this,{id:e,type:t,location:n,isOptional:f,dynamic:p,raw:M,squash:y,replace:L,inherit:g,array:h,config:l})}return e.values=function(e,t){void 0===t&&(t={});for(var n={},o=0,r=e;o{"use strict";n.d(t,{_:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),s=function(){function e(e){this.pattern=/.*/,this.inherit=!0,(0,o.l7)(this,e)}return e.prototype.is=function(e,t){return!0},e.prototype.encode=function(e,t){return e},e.prototype.decode=function(e,t){return e},e.prototype.equals=function(e,t){return e==t},e.prototype.$subPattern=function(){var e=this.pattern.toString();return e.substr(1,e.length-2)},e.prototype.toString=function(){return"{ParamType:"+this.name+"}"},e.prototype.$normalize=function(e){return this.is(e)?e:this.decode(e)},e.prototype.$asArray=function(e,t){if(!e)return this;if("auto"===e&&!t)throw new Error("'auto' array mode is for query parameters only");return new a(this,e)},e}();function a(e,t){var n=this;function s(e){return(0,r.kJ)(e)?e:(0,r.$K)(e)?[e]:[]}function a(e,n){return function(a){if((0,r.kJ)(a)&&0===a.length)return a;var i=s(a),d=(0,o.UI)(i,e);return!0===n?0===(0,o.hX)(d,(function(e){return!e})).length:function(e){switch(e.length){case 0:return;case 1:return"auto"===t?e[0]:e;default:return e}}(d)}}function i(e){return function(t,n){var o=s(t),r=s(n);if(o.length!==r.length)return!1;for(var a=0;a{"use strict";n.d(t,{p:()=>u});var o,r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),d=n("./node_modules/@uirouter/core/lib-esm/params/paramType.js"),u=function(){function e(){this.enqueue=!0,this.typeQueue=[],this.defaultTypes=(0,r.ei)(e.prototype,["hash","string","query","path","int","bool","date","json","any"]),this.types=(0,r.ED)((0,r.UI)(this.defaultTypes,(function(e,t){return new d._((0,r.l7)({name:t},e))})),{})}return e.prototype.dispose=function(){this.types={}},e.prototype.type=function(e,t,n){if(!(0,s.$K)(t))return this.types[e];if(this.types.hasOwnProperty(e))throw new Error("A type named '"+e+"' has already been defined.");return this.types[e]=new d._((0,r.l7)({name:e},t)),n&&(this.typeQueue.push({name:e,def:n}),this.enqueue||this._flushTypeQueue()),this},e.prototype._flushTypeQueue=function(){for(;this.typeQueue.length;){var e=this.typeQueue.shift();if(e.pattern)throw new Error("You cannot override a type's .pattern at runtime.");(0,r.l7)(this.types[e.name],i.u.$injector.invoke(e.def))}},e}();o=function(e){var t=function(e){return null!=e?e.toString():e},n={encode:t,decode:t,is:(0,a.is)(String),pattern:/.*/,equals:function(e,t){return e==t}};return(0,r.l7)({},n,e)},(0,r.l7)(u.prototype,{string:o({}),path:o({pattern:/[^/]*/}),query:o({}),hash:o({inherit:!1}),int:o({decode:function(e){return parseInt(e,10)},is:function(e){return!(0,s.le)(e)&&this.decode(e.toString())===e},pattern:/-?\d+/}),bool:o({encode:function(e){return e?1:0},decode:function(e){return 0!==parseInt(e,10)},is:(0,a.is)(Boolean),pattern:/0|1/}),date:o({encode:function(e){return this.is(e)?[e.getFullYear(),("0"+(e.getMonth()+1)).slice(-2),("0"+e.getDate()).slice(-2)].join("-"):void 0},decode:function(e){if(this.is(e))return e;var t=this.capture.exec(e);return t?new Date(t[1],t[2]-1,t[3]):void 0},is:function(e){return e instanceof Date&&!isNaN(e.valueOf())},equals:function(e,t){return["getFullYear","getMonth","getDate"].reduce((function(n,o){return n&&e[o]()===t[o]()}),!0)},pattern:/[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])/,capture:/([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/}),json:o({encode:r.Qs,decode:r.xZ,is:(0,a.is)(Object),equals:r.fS,pattern:/[^/]*/}),any:o({encode:r.yR,decode:r.yR,is:function(){return!0},equals:r.fS})})},"./node_modules/@uirouter/core/lib-esm/params/stateParams.js":(e,t,n)=>{"use strict";n.d(t,{i:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=function(){function e(e){void 0===e&&(e={}),(0,o.l7)(this,e)}return e.prototype.$inherit=function(e,t,n){var r,s=(0,o.mX)(t,n),a={},i=[];for(var d in s)if(s[d]&&s[d].params&&(r=Object.keys(s[d].params)).length)for(var u in r)i.indexOf(r[u])>=0||(i.push(r[u]),a[r[u]]=this[r[u]]);return(0,o.l7)({},a,e)},e}()},"./node_modules/@uirouter/core/lib-esm/path/pathNode.js":(e,t,n)=>{"use strict";n.d(t,{V:()=>a});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/params/param.js"),a=function(){function e(t){if(t instanceof e){var n=t;this.state=n.state,this.paramSchema=n.paramSchema.slice(),this.paramValues=(0,o.l7)({},n.paramValues),this.resolvables=n.resolvables.slice(),this.views=n.views&&n.views.slice()}else{var r=t;this.state=r,this.paramSchema=r.parameters({inherit:!1}),this.paramValues={},this.resolvables=r.resolvables.map((function(e){return e.clone()}))}}return e.prototype.clone=function(){return new e(this)},e.prototype.applyRawParams=function(e){return this.paramValues=this.paramSchema.reduce((function(t,n){return(0,o.bb)(t,[(r=n).id,r.value(e[r.id])]);var r}),{}),this},e.prototype.parameter=function(e){return(0,o.sE)(this.paramSchema,(0,r.OH)("id",e))},e.prototype.equals=function(e,t){var n=this.diff(e,t);return n&&0===n.length},e.prototype.diff=function(e,t){if(this.state!==e.state)return!1;var n=t?t(this):this.paramSchema;return s.d.changed(n,this.paramValues,e.paramValues)},e.clone=function(e){return e.clone()},e}()},"./node_modules/@uirouter/core/lib-esm/path/pathUtils.js":(e,t,n)=>{"use strict";n.d(t,{C:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/state/targetState.js"),a=n("./node_modules/@uirouter/core/lib-esm/path/pathNode.js"),i=function(){function e(){}return e.makeTargetState=function(e,t){var n=(0,o.Gb)(t).state;return new s.F(e,n,t.map((0,r.vg)("paramValues")).reduce(o.LQ,{}),{})},e.buildPath=function(e){var t=e.params();return e.$state().path.map((function(e){return new a.V(e).applyRawParams(t)}))},e.buildToPath=function(t,n){var o=e.buildPath(n);return n.options().inherit?e.inheritParams(t,o,Object.keys(n.params())):o},e.applyViewConfigs=function(t,n,r){n.filter((function(e){return(0,o.d3)(r,e.state)})).forEach((function(r){var s=(0,o.VO)(r.state.views||{}),a=e.subPath(n,(function(e){return e===r})),i=s.map((function(e){return t.createViewConfig(a,e)}));r.views=i.reduce(o.M7,[])}))},e.inheritParams=function(e,t,n){void 0===n&&(n=[]);var s=e.map((function(e){return e.paramSchema})).reduce(o.M7,[]).filter((function(e){return!e.inherit})).map((0,r.vg)("id"));return t.map((function(t){var i=(0,o.l7)({},t&&t.paramValues),d=(0,o.ei)(i,n);i=(0,o.CE)(i,n);var u,m,l,_=(0,o.CE)((u=e,m=t.state,l=(0,o.sE)(u,(0,r.OH)("state",m)),(0,o.l7)({},l&&l.paramValues)||{}),s),c=(0,o.l7)(i,_,d);return new a.V(t.state).applyRawParams(c)}))},e.treeChanges=function(t,n,o){for(var r,s,a,i,d,u,m=Math.min(t.length,n.length),l=0;l{"use strict";n.d(t,{u:()=>o});var o={when:{LAZY:"LAZY",EAGER:"EAGER"},async:{WAIT:"WAIT",NOWAIT:"NOWAIT"}}},"./node_modules/@uirouter/core/lib-esm/resolve/resolvable.js":(e,t,n)=>{"use strict";n.d(t,{X:()=>d});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),d=function(){function e(t,n,s,a,d){if(this.resolved=!1,this.promise=void 0,t instanceof e)(0,o.l7)(this,t);else if((0,i.mf)(n)){if((0,i.le)(t))throw new Error("new Resolvable(): token argument is required");if(!(0,i.mf)(n))throw new Error("new Resolvable(): resolveFn argument must be a function");this.token=t,this.policy=a,this.resolveFn=n,this.deps=s||[],this.data=d,this.resolved=void 0!==d,this.promise=this.resolved?r.u.$q.when(this.data):void 0}else if((0,i.Kn)(t)&&t.token&&(t.hasOwnProperty("resolveFn")||t.hasOwnProperty("data"))){var u=t;return new e(u.token,u.resolveFn,u.deps,u.policy,u.data)}}return e.prototype.getPolicy=function(e){var t=this.policy||{},n=e&&e.resolvePolicy||{};return{when:t.when||n.when||"LAZY",async:t.async||n.async||"WAIT"}},e.prototype.resolve=function(e,t){var n=this,a=r.u.$q,d=e.findNode(this),u=d&&d.state,m=this.getPolicy(u).async,l=(0,i.mf)(m)?m:o.yR;return this.promise=a.when().then((function(){return a.all(e.getDependencies(n).map((function(n){return n.get(e,t)})))})).then((function(e){return n.resolveFn.apply(null,e)})).then(l).then((function(e){return n.data=e,n.resolved=!0,n.resolveFn=null,s.g4.traceResolvableResolved(n,t),n.data}))},e.prototype.get=function(e,t){return this.promise||this.resolve(e,t)},e.prototype.toString=function(){return"Resolvable(token: "+(0,a.Pz)(this.token)+", requires: ["+this.deps.map(a.Pz)+"])"},e.prototype.clone=function(){return new e(this)},e.fromData=function(t,n){return new e(t,(function(){return n}),null,null,n)},e}()},"./node_modules/@uirouter/core/lib-esm/resolve/resolveContext.js":(e,t,n)=>{"use strict";n.d(t,{l:()=>f});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),i=n("./node_modules/@uirouter/core/lib-esm/resolve/interface.js"),d=n("./node_modules/@uirouter/core/lib-esm/resolve/resolvable.js"),u=n("./node_modules/@uirouter/core/lib-esm/path/pathUtils.js"),m=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),l=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),_=i.u.when,c=[_.EAGER,_.LAZY],h=[_.EAGER],f=function(){function e(e){this._path=e}return e.prototype.getTokens=function(){return this._path.reduce((function(e,t){return e.concat(t.resolvables.map((function(e){return e.token})))}),[]).reduce(o.v_,[])},e.prototype.getResolvable=function(e){var t=this._path.map((function(e){return e.resolvables})).reduce(o.M7,[]).filter((function(t){return t.token===e}));return(0,o.Gb)(t)},e.prototype.getPolicy=function(e){var t=this.findNode(e);return e.getPolicy(t.state)},e.prototype.subContext=function(t){return new e(u.C.subPath(this._path,(function(e){return e.state===t})))},e.prototype.addResolvables=function(e,t){var n=(0,o.sE)(this._path,(0,r.OH)("state",t)),s=e.map((function(e){return e.token}));n.resolvables=n.resolvables.filter((function(e){return-1===s.indexOf(e.token)})).concat(e)},e.prototype.resolvePath=function(e,t){var n=this;void 0===e&&(e="LAZY");var d=((0,o.d3)(c,e)?e:"LAZY")===i.u.when.EAGER?h:c;s.g4.traceResolvePath(this._path,e,t);var u=function(e,t){return function(r){return(0,o.d3)(e,n.getPolicy(r)[t])}},m=this._path.reduce((function(e,o){var s=o.resolvables.filter(u(d,"when")),a=s.filter(u(["NOWAIT"],"async")),i=s.filter((0,r.ff)(u(["NOWAIT"],"async"))),m=n.subContext(o.state),l=function(e){return e.get(m,t).then((function(t){return{token:e.token,value:t}}))};return a.forEach(l),e.concat(i.map(l))}),[]);return a.u.$q.all(m)},e.prototype.injector=function(){return this._injector||(this._injector=new p(this))},e.prototype.findNode=function(e){return(0,o.sE)(this._path,(function(t){return(0,o.d3)(t.resolvables,e)}))},e.prototype.getDependencies=function(e){var t=this,n=this.findNode(e),r=(u.C.subPath(this._path,(function(e){return e===n}))||this._path).reduce((function(e,t){return e.concat(t.resolvables)}),[]).filter((function(t){return t!==e}));return e.deps.map((function(e){var n=r.filter((function(t){return t.token===e}));if(n.length)return(0,o.Gb)(n);var s=t.injector().getNative(e);if((0,l.wV)(s))throw new Error("Could not find Dependency Injection token: "+(0,m.Pz)(e));return new d.X(e,(function(){return s}),[],s)}))},e}(),p=function(){function e(e){this.context=e,this.native=this.get("Native Injector")||a.u.$injector}return e.prototype.get=function(e){var t=this.context.getResolvable(e);if(t){if("NOWAIT"===this.context.getPolicy(t).async)return t.get(this.context);if(!t.resolved)throw new Error("Resolvable async .get() not complete:"+(0,m.Pz)(t.token));return t.data}return this.getNative(e)},e.prototype.getAsync=function(e){var t=this.context.getResolvable(e);return t?t.get(this.context):a.u.$q.when(this.native.get(e))},e.prototype.getNative=function(e){return this.native&&this.native.get(e)},e}()},"./node_modules/@uirouter/core/lib-esm/router.js":(e,t,n)=>{"use strict";n.d(t,{a:()=>y});var o=n("./node_modules/@uirouter/core/lib-esm/url/urlMatcherFactory.js"),r=n("./node_modules/@uirouter/core/lib-esm/url/urlRouter.js"),s=n("./node_modules/@uirouter/core/lib-esm/transition/transitionService.js"),a=n("./node_modules/@uirouter/core/lib-esm/view/view.js"),i=n("./node_modules/@uirouter/core/lib-esm/state/stateRegistry.js"),d=n("./node_modules/@uirouter/core/lib-esm/state/stateService.js"),u=n("./node_modules/@uirouter/core/lib-esm/globals.js"),m=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),l=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),_=n("./node_modules/@uirouter/core/lib-esm/url/urlService.js"),c=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),h=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),f=0,p=(0,h.HV)("LocationServices",["url","path","search","hash","onChange"]),M=(0,h.HV)("LocationConfig",["port","protocol","host","baseHref","html5Mode","hashPrefix"]),y=function(){function e(e,t){void 0===e&&(e=p),void 0===t&&(t=M),this.locationService=e,this.locationConfig=t,this.$id=f++,this._disposed=!1,this._disposables=[],this.trace=c.g4,this.viewService=new a.s(this),this.globals=new u.k,this.transitionService=new s.Z(this),this.urlMatcherFactory=new o.y(this),this.urlRouter=new r.g(this),this.urlService=new _.i(this),this.stateRegistry=new i.q(this),this.stateService=new d.b(this),this._plugins={},this.viewService._pluginapi._rootViewContext(this.stateRegistry.root()),this.globals.$current=this.stateRegistry.root(),this.globals.current=this.globals.$current.self,this.disposable(this.globals),this.disposable(this.stateService),this.disposable(this.stateRegistry),this.disposable(this.transitionService),this.disposable(this.urlService),this.disposable(e),this.disposable(t)}return e.prototype.disposable=function(e){this._disposables.push(e)},e.prototype.dispose=function(e){var t=this;e&&(0,l.mf)(e.dispose)?e.dispose(this):(this._disposed=!0,this._disposables.slice().forEach((function(e){try{"function"==typeof e.dispose&&e.dispose(t),(0,m.nA)(t._disposables,e)}catch(e){}})))},e.prototype.plugin=function(e,t){void 0===t&&(t={});var n=new e(this,t);if(!n.name)throw new Error("Required property `name` missing on plugin: "+n);return this._disposables.push(n),this._plugins[n.name]=n},e.prototype.getPlugin=function(e){return e?this._plugins[e]:(0,m.VO)(this._plugins)},e}()},"./node_modules/@uirouter/core/lib-esm/state/interface.js":()=>{},"./node_modules/@uirouter/core/lib-esm/state/stateBuilder.js":(e,t,n)=>{"use strict";n.d(t,{t:()=>M});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),i=n("./node_modules/@uirouter/core/lib-esm/resolve/resolvable.js"),d=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js");function u(e){return e.name}function m(e){return e.self.$$state=function(){return e},e.self}function l(e){return e.parent&&e.parent.data&&(e.data=e.self.data=(0,o.ED)(e.parent.data,e.data)),e.data}var _=function(e,t){return function(n){var s=n.self;if(s&&s.url&&s.name&&s.name.match(/\.\*\*$/)){var a={};(0,o.JG)(s,a),a.url+="{remainder:any}",s=a}var i=n.parent,d=function(e){if(!(0,r.HD)(e))return!1;var t="^"===e.charAt(0);return{val:t?e.substring(1):e,root:t}}(s.url),u=d?e.compile(d.val,{state:s}):s.url;if(!u)return null;if(!e.isMatcher(u))throw new Error("Invalid url '"+u+"' in state '"+n+"'");return d&&d.root?u:(i&&i.navigable||t()).url.append(u)}},c=function(e){return function(t){return!e(t)&&t.url?t:t.parent?t.parent.navigable:null}};function h(e){return e.parent?e.parent.path.concat(e):[e]}function f(e){var t=e.parent?(0,o.l7)({},e.parent.includes):{};return t[e.name]=!0,t}function p(e){var t,n,u=function(e){return e.provide||e.token},m=(0,a.uj)([[(0,a.vg)("resolveFn"),function(e){return new i.X(u(e),e.resolveFn,e.deps,e.policy)}],[(0,a.vg)("useFactory"),function(e){return new i.X(u(e),e.useFactory,e.deps||e.dependencies,e.policy)}],[(0,a.vg)("useClass"),function(e){return new i.X(u(e),(function(){return new e.useClass}),[],e.policy)}],[(0,a.vg)("useValue"),function(e){return new i.X(u(e),(function(){return e.useValue}),[],e.policy,e.useValue)}],[(0,a.vg)("useExisting"),function(e){return new i.X(u(e),o.yR,[e.useExisting],e.policy)}]]),l=(0,a.uj)([[(0,a.zG)((0,a.vg)("val"),r.HD),function(e){return new i.X(e.token,o.yR,[e.val],e.policy)}],[(0,a.zG)((0,a.vg)("val"),r.kJ),function(e){return new i.X(e.token,(0,o.Gb)(e.val),e.val.slice(0,-1),e.policy)}],[(0,a.zG)((0,a.vg)("val"),r.mf),function(e){return new i.X(e.token,e.val,(t=e.val,n=d.u.$injector,t.$inject||n&&n.annotate(t,n.strictDi)||"deferred"),e.policy);var t,n}]]),_=(0,a.uj)([[(0,a.is)(i.X),function(e){return e}],[function(e){return!(!e.token||!e.resolveFn)},m],[function(e){return!(!e.provide&&!e.token||!(e.useValue||e.useFactory||e.useExisting||e.useClass))},m],[function(e){return!!(e&&e.val&&((0,r.HD)(e.val)||(0,r.kJ)(e.val)||(0,r.mf)(e.val)))},l],[(0,a.P0)(!0),function(e){throw new Error("Invalid resolve value: "+(0,s.Pz)(e))}]]),c=e.resolve;return((0,r.kJ)(c)?c:(t=c,n=e.resolvePolicy||{},Object.keys(t||{}).map((function(e){return{token:e,val:t[e],deps:void 0,policy:n[e]}})))).map(_)}var M=function(){function e(e,t){this.matcher=e;var n,r=this,s=function(){return e.find("")},i=function(e){return""===e.name};this.builders={name:[u],self:[m],parent:[function(t){return i(t)?null:e.find(r.parentName(t))||s()}],data:[l],url:[_(t,s)],navigable:[c(i)],params:[(n=t.paramFactory,function(e){var t=e.url&&e.url.parameters({inherit:!1})||[],r=(0,o.VO)((0,o.js)((0,o.CE)(e.params||{},t.map((0,a.vg)("id"))),(function(t,o){return n.fromConfig(o,null,e.self)})));return t.concat(r).map((function(e){return[e.id,e]})).reduce(o.bb,{})})],views:[],path:[h],includes:[f],resolvables:[p]}}return e.prototype.builder=function(e,t){var n=this.builders,o=n[e]||[];return(0,r.HD)(e)&&!(0,r.$K)(t)?o.length>1?o:o[0]:(0,r.HD)(e)&&(0,r.mf)(t)?(n[e]=o,n[e].push(t),function(){return n[e].splice(n[e].indexOf(t,1))&&null}):void 0},e.prototype.build=function(e){var t=this.matcher,n=this.builders,r=this.parentName(e);if(r&&!t.find(r,void 0,!1))return null;for(var s in n)if(n.hasOwnProperty(s)){var a=n[s].reduce((function(e,t){return function(n){return t(n,e)}}),o.ZT);e[s]=a(e)}return e},e.prototype.parentName=function(e){var t=e.name||"",n=t.split(".");if("**"===n.pop()&&n.pop(),n.length){if(e.parent)throw new Error("States that specify the 'parent:' property should not have a '.' in their name ("+t+")");return n.join(".")}return e.parent?(0,r.HD)(e.parent)?e.parent:e.parent.name:""},e.prototype.name=function(e){var t=e.name;if(-1!==t.indexOf(".")||!e.parent)return t;var n=(0,r.HD)(e.parent)?e.parent:e.parent.name;return n?n+"."+t:t},e}()},"./node_modules/@uirouter/core/lib-esm/state/stateMatcher.js":(e,t,n)=>{"use strict";n.d(t,{Q:()=>a});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/safeConsole.js"),a=function(){function e(e){this._states=e}return e.prototype.isRelative=function(e){return 0===(e=e||"").indexOf(".")||0===e.indexOf("^")},e.prototype.find=function(e,t,n){if(void 0===n&&(n=!0),e||""===e){var a=(0,o.HD)(e),i=a?e:e.name;this.isRelative(i)&&(i=this.resolvePath(i,t));var d=this._states[i];if(d&&(a||!(a||d!==e&&d.self!==e)))return d;if(a&&n){var u=(0,r.VO)(this._states).filter((function(e){return e.__stateObjectCache.nameGlob&&e.__stateObjectCache.nameGlob.matches(i)}));return u.length>1&&s.L.error("stateMatcher.find: Found multiple matches for "+i+" using glob: ",u.map((function(e){return e.name}))),u[0]}}},e.prototype.resolvePath=function(e,t){if(!t)throw new Error("No reference point given for path '"+e+"'");for(var n=this.find(t),o=e.split("."),r=o.length,s=0,a=n;s{"use strict";n.d(t,{l:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/glob.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),i=function(){function e(t){return e.create(t||{})}return e.create=function(t){t=e.isStateClass(t)?new t:t;var n=(0,o.ED)((0,o.ED)(t,e.prototype));return t.$$state=function(){return n},n.self=t,n.__stateObjectCache={nameGlob:s.r.fromString(n.name)},n},e.prototype.is=function(e){return this===e||this.self===e||this.fqn()===e},e.prototype.fqn=function(){if(!(this.parent&&this.parent instanceof this.constructor))return this.name;var e=this.parent.fqn();return e?e+"."+this.name:this.name},e.prototype.root=function(){return this.parent&&this.parent.root()||this},e.prototype.parameters=function(e){return((e=(0,o.ce)(e,{inherit:!0,matchingKeys:null})).inherit&&this.parent&&this.parent.parameters()||[]).concat((0,o.VO)(this.params)).filter((function(t){return!e.matchingKeys||e.matchingKeys.hasOwnProperty(t.id)}))},e.prototype.parameter=function(e,t){return void 0===t&&(t={}),this.url&&this.url.parameter(e,t)||(0,o.sE)((0,o.VO)(this.params),(0,r.OH)("id",e))||t.inherit&&this.parent&&this.parent.parameter(e)},e.prototype.toString=function(){return this.fqn()},e.isStateClass=function(e){return(0,a.mf)(e)&&!0===e.__uiRouterState},e.isStateDeclaration=function(e){return(0,a.mf)(e.$$state)},e.isState=function(e){return(0,a.Kn)(e.__stateObjectCache)},e}()},"./node_modules/@uirouter/core/lib-esm/state/stateQueueManager.js":(e,t,n)=>{"use strict";n.d(t,{L:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/state/stateObject.js"),s=function(){function e(e,t,n,o){this.router=e,this.states=t,this.builder=n,this.listeners=o,this.queue=[]}return e.prototype.dispose=function(){this.queue=[]},e.prototype.register=function(e){var t=this.queue,n=r.l.create(e),s=n.name;if(!(0,o.HD)(s))throw new Error("State must have a valid name");if(this.states.hasOwnProperty(s)||(0,o.d3)(t.map((0,o.vg)("name")),s))throw new Error("State '"+s+"' is already defined");return t.push(n),this.flush(),n},e.prototype.flush=function(){for(var e=this,t=this,n=t.queue,o=t.states,r=t.builder,s=[],a=[],i={},d=function(t){return e.states.hasOwnProperty(t)&&e.states[t]},u=function(){s.length&&e.listeners.forEach((function(e){return e("registered",s.map((function(e){return e.self})))}))};n.length>0;){var m=n.shift(),l=m.name,_=r.build(m),c=a.indexOf(m);if(_){var h=d(l);if(h&&h.name===l)throw new Error("State '"+l+"' is already defined");var f=d(l+".**");f&&this.router.stateRegistry.deregister(f),o[l]=m,this.attachRoute(m),c>=0&&a.splice(c,1),s.push(m)}else{var p=i[l];if(i[l]=n.length,c>=0&&p===n.length)return n.push(m),u(),o;c<0&&a.push(m),n.push(m)}}return u(),o},e.prototype.attachRoute=function(e){if(!e.abstract&&e.url){var t=this.router.urlService.rules;t.rule(t.urlRuleFactory.create(e))}},e}()},"./node_modules/@uirouter/core/lib-esm/state/stateRegistry.js":(e,t,n)=>{"use strict";n.d(t,{q:()=>d});var o=n("./node_modules/@uirouter/core/lib-esm/state/stateMatcher.js"),r=n("./node_modules/@uirouter/core/lib-esm/state/stateBuilder.js"),s=n("./node_modules/@uirouter/core/lib-esm/state/stateQueueManager.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),d=function(){function e(e){this.router=e,this.states={},this.listeners=[],this.matcher=new o.Q(this.states),this.builder=new r.t(this.matcher,e.urlMatcherFactory),this.stateQueue=new s.L(e,this.states,this.builder,this.listeners),this._registerRoot()}return e.prototype._registerRoot=function(){(this._root=this.stateQueue.register({name:"",url:"^",views:null,params:{"#":{value:null,type:"hash",dynamic:!0}},abstract:!0})).navigable=null},e.prototype.dispose=function(){var e=this;this.stateQueue.dispose(),this.listeners=[],this.get().forEach((function(t){return e.get(t)&&e.deregister(t)}))},e.prototype.onStatesChanged=function(e){return this.listeners.push(e),function(){(0,a.nA)(this.listeners)(e)}.bind(this)},e.prototype.root=function(){return this._root},e.prototype.register=function(e){return this.stateQueue.register(e)},e.prototype._deregisterTree=function(e){var t=this,n=this.get().map((function(e){return e.$$state()})),o=function(e){var t=n.filter((function(t){return-1!==e.indexOf(t.parent)}));return 0===t.length?t:t.concat(o(t))},r=o([e]),s=[e].concat(r).reverse();return s.forEach((function(e){var n=t.router.urlService.rules;n.rules().filter((0,i.OH)("state",e)).forEach((function(e){return n.removeRule(e)})),delete t.states[e.name]})),s},e.prototype.deregister=function(e){var t=this.get(e);if(!t)throw new Error("Can't deregister state; not found: "+e);var n=this._deregisterTree(t.$$state());return this.listeners.forEach((function(e){return e("deregistered",n.map((function(e){return e.self})))})),n},e.prototype.get=function(e,t){var n=this;if(0===arguments.length)return Object.keys(this.states).map((function(e){return n.states[e].self}));var o=this.matcher.find(e,t);return o&&o.self||null},e.prototype.decorator=function(e,t){return this.builder.builder(e,t)},e}()},"./node_modules/@uirouter/core/lib-esm/state/targetState.js":(e,t,n)=>{"use strict";n.d(t,{F:()=>a});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),a=function(){function e(e,t,n,o){this._stateRegistry=e,this._identifier=t,this._identifier=t,this._params=(0,s.l7)({},n||{}),this._options=(0,s.l7)({},o||{}),this._definition=e.matcher.find(t,this._options.relative)}return e.prototype.name=function(){return this._definition&&this._definition.name||this._identifier},e.prototype.identifier=function(){return this._identifier},e.prototype.params=function(){return this._params},e.prototype.$state=function(){return this._definition},e.prototype.state=function(){return this._definition&&this._definition.self},e.prototype.options=function(){return this._options},e.prototype.exists=function(){return!(!this._definition||!this._definition.self)},e.prototype.valid=function(){return!this.error()},e.prototype.error=function(){var e=this.options().relative;if(!this._definition&&e){var t=e.name?e.name:e;return"Could not resolve '"+this.name()+"' from state '"+t+"'"}return this._definition?this._definition.self?void 0:"State '"+this.name()+"' has an invalid definition":"No such state '"+this.name()+"'"},e.prototype.toString=function(){return"'"+this.name()+"'"+(0,r.Pz)(this.params())},e.prototype.withState=function(t){return new e(this._stateRegistry,t,this._params,this._options)},e.prototype.withParams=function(t,n){void 0===n&&(n=!1);var o=n?t:(0,s.l7)({},this._params,t);return new e(this._stateRegistry,this._identifier,o,this._options)},e.prototype.withOptions=function(t,n){void 0===n&&(n=!1);var o=n?t:(0,s.l7)({},this._options,t);return new e(this._stateRegistry,this._identifier,this._params,o)},e.isDef=function(e){return e&&e.state&&((0,o.HD)(e.state)||(0,o.Kn)(e.state)&&(0,o.HD)(e.state.name))},e}()},"./node_modules/@uirouter/core/lib-esm/transition/hookBuilder.js":(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),s=n("./node_modules/@uirouter/core/lib-esm/transition/interface.js"),a=n("./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js"),i=function(){function e(e){this.transition=e}return e.prototype.buildHooksForPhase=function(e){var t=this;return this.transition.router.transitionService._pluginapi._getEvents(e).map((function(e){return t.buildHooks(e)})).reduce(o.M7,[]).filter(o.yR)},e.prototype.buildHooks=function(e){var t=this.transition,n=t.treeChanges(),r=this.getMatchingHooks(e,n,t);if(!r)return[];var i,d={transition:t,current:t.options().current};return r.map((function(r){return r.matches(n,t)[e.criteriaMatchPath.name].map((function(n){var i=(0,o.l7)({bind:r.bind,traceData:{hookType:e.name,context:n}},d),u=e.criteriaMatchPath.scope===s.c.STATE?n.state.self:null,m=new a.I(t,u,r,i);return{hook:r,node:n,transitionHook:m}}))})).reduce(o.M7,[]).sort((i=e.reverseSort,void 0===i&&(i=!1),function(e,t){var n=i?-1:1,o=(e.node.state.path.length-t.node.state.path.length)*n;return 0!==o?o:t.hook.priority-e.hook.priority})).map((function(e){return e.transitionHook}))},e.prototype.getMatchingHooks=function(e,t,n){var a=e.hookPhase===s.k.CREATE,i=this.transition.router.transitionService;return(a?[i]:[this.transition,i]).map((function(t){return t.getHooks(e.name)})).filter((0,o.sp)(r.kJ,"broken event named: "+e.name)).reduce(o.M7,[]).filter((function(e){return e.matches(t,n)}))},e}()},"./node_modules/@uirouter/core/lib-esm/transition/hookRegistry.js":(e,t,n)=>{"use strict";n.d(t,{cN:()=>s,BU:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/transition/interface.js");function s(e,t,n){var r=(0,o.HD)(t)?[t]:t;return!!((0,o.mf)(r)?r:function(e){for(var t=r,n=0;n{"use strict";var o,r;n.d(t,{k:()=>o,c:()=>r}),function(e){e[e.CREATE=0]="CREATE",e[e.BEFORE=1]="BEFORE",e[e.RUN=2]="RUN",e[e.SUCCESS=3]="SUCCESS",e[e.ERROR=4]="ERROR"}(o||(o={})),function(e){e[e.TRANSITION=0]="TRANSITION",e[e.STATE=1]="STATE"}(r||(r={}))},"./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js":(e,t,n)=>{"use strict";n.d(t,{K:()=>o,i:()=>d});var o,r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/hof.js");!function(e){e[e.SUPERSEDED=2]="SUPERSEDED",e[e.ABORTED=3]="ABORTED",e[e.INVALID=4]="INVALID",e[e.IGNORED=5]="IGNORED",e[e.ERROR=6]="ERROR"}(o||(o={}));var i=0,d=function(){function e(e,t,n){this.$id=i++,this.type=e,this.message=t,this.detail=n}return e.isRejectionPromise=function(t){return t&&"function"==typeof t.then&&(0,a.is)(e)(t._transitionRejection)},e.superseded=function(t,n){var r=new e(o.SUPERSEDED,"The transition has been superseded by a different transition",t);return n&&n.redirected&&(r.redirected=!0),r},e.redirected=function(t){return e.superseded(t,{redirected:!0})},e.invalid=function(t){return new e(o.INVALID,"This transition is invalid",t)},e.ignored=function(t){return new e(o.IGNORED,"The transition was ignored",t)},e.aborted=function(t){return new e(o.ABORTED,"The transition has been aborted",t)},e.errored=function(t){return new e(o.ERROR,"The transition errored",t)},e.normalize=function(t){return(0,a.is)(e)(t)?t:e.errored(t)},e.prototype.toString=function(){var e,t=(e=this.detail)&&e.toString!==Object.prototype.toString?e.toString():(0,s.Pz)(e),n=this;return"Transition Rejection($id: "+n.$id+" type: "+n.type+", message: "+n.message+", detail: "+t+")"},e.prototype.toPromise=function(){return(0,r.l7)((0,r.jv)(this),{_transitionRejection:this})},e}()},"./node_modules/@uirouter/core/lib-esm/transition/transitionEventType.js":(e,t,n)=>{"use strict";n.d(t,{t:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js"),r=function(e,t,n,r,s,a,i,d){void 0===s&&(s=!1),void 0===a&&(a=o.I.HANDLE_RESULT),void 0===i&&(i=o.I.REJECT_ERROR),void 0===d&&(d=!1),this.name=e,this.hookPhase=t,this.hookOrder=n,this.criteriaMatchPath=r,this.reverseSort=s,this.getResultHandler=a,this.getErrorHandler=i,this.synchronous=d}},"./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js":(e,t,n)=>{"use strict";n.d(t,{I:()=>c});var o=n("./node_modules/@uirouter/core/lib-esm/transition/interface.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/strings.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),i=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),d=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),u=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),m=n("./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js"),l=n("./node_modules/@uirouter/core/lib-esm/state/targetState.js"),_={current:r.ZT,transition:null,traceData:{},bind:null},c=function(){function e(e,t,n,s){var a=this;this.transition=e,this.stateContext=t,this.registeredHook=n,this.options=s,this.isSuperseded=function(){return a.type.hookPhase===o.k.RUN&&!a.options.transition.isActive()},this.options=(0,r.ce)(s,_),this.type=n.eventType}return e.chain=function(e,t){return e.reduce((function(e,t){return e.then((function(){return t.invokeHook()}))}),t||u.u.$q.when())},e.invokeHooks=function(t,n){for(var o=0;o=t.invokeLimit&&t.deregister()}}},e.prototype.handleHookResult=function(e){var t=this;return this.getNotCurrentRejection()||((0,a.tI)(e)?e.then((function(e){return t.handleHookResult(e)})):(d.g4.traceHookResult(e,this.transition,this.options),!1===e?m.i.aborted("Hook aborted transition").toPromise():(0,i.is)(l.F)(e)?m.i.redirected(e).toPromise():void 0))},e.prototype.getNotCurrentRejection=function(){var e=this.transition.router;return e._disposed?m.i.aborted("UIRouter instance #"+e.$id+" has been stopped (disposed)").toPromise():this.transition._aborted?m.i.aborted().toPromise():this.isSuperseded()?m.i.superseded(this.options.current()).toPromise():void 0},e.prototype.toString=function(){var e=this.options,t=this.registeredHook,n=(0,i.Qc)("traceData.hookType")(e)||"internal",o=(0,i.Qc)("traceData.context.state.name")(e)||(0,i.Qc)("traceData.context")(e)||"unknown",r=(0,s.iC)(t.callback);return n+" context: "+o+", "+(0,s.BS)(200,r)},e.HANDLE_RESULT=function(e){return function(t){return e.handleHookResult(t)}},e.LOG_REJECTED_RESULT=function(e){return function(t){(0,a.tI)(t)&&t.catch((function(t){return e.logError(m.i.normalize(t))}))}},e.LOG_ERROR=function(e){return function(t){return e.logError(t)}},e.REJECT_ERROR=function(e){return function(e){return(0,r.jv)(e)}},e.THROW_ERROR=function(e){return function(e){throw e}},e}()},"./node_modules/@uirouter/core/lib-esm/transition/transitionService.js":(e,t,n)=>{"use strict";n.d(t,{Z:()=>C,q:()=>W});var o=n("./node_modules/@uirouter/core/lib-esm/transition/interface.js"),r=n("./node_modules/@uirouter/core/lib-esm/transition/transition.js"),s=n("./node_modules/@uirouter/core/lib-esm/transition/hookRegistry.js"),a=n("./node_modules/@uirouter/core/lib-esm/router.js"),i=n("./node_modules/@uirouter/core/lib-esm/resolve/index.js"),d=n("./node_modules/@uirouter/core/lib-esm/common/index.js");function u(e){e.addResolvable(i.XU.fromData(a.a,e.router),""),e.addResolvable(i.XU.fromData(r.u,e),""),e.addResolvable(i.XU.fromData("$transition$",e),""),e.addResolvable(i.XU.fromData("$stateParams",e.params()),""),e.entering().forEach((function(t){e.addResolvable(i.XU.fromData("$state$",t),t)}))}var m=["$transition$",r.u],l=(0,d.d3)(m),_=function(e){var t=(0,d.VO)(e.treeChanges()).reduce(d.M7,[]).reduce(d.v_,[]),n=function(e){return l(e.token)?i.XU.fromData(e.token,null):e};t.forEach((function(e){e.resolvables=e.resolvables.map(n)}))},c=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),h=n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),f=n("./node_modules/@uirouter/core/lib-esm/state/targetState.js"),p=function(e){var t=e.to().redirectTo;if(t){var n=e.router.stateService;return(0,c.mf)(t)?h.u.$q.when(t(e)).then(o):o(t)}function o(t){if(t)return t instanceof f.F?t:(0,c.HD)(t)?n.target(t,e.params(),e.options()):t.state||t.params?n.target(t.state||e.to(),t.params||e.params(),e.options()):void 0}};function M(e){return function(t,n){return(0,n.$$state()[e])(t,n)}}var y=M("onExit"),L=M("onRetain"),g=M("onEnter"),Y=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),v=n("./node_modules/@uirouter/core/lib-esm/resolve/resolveContext.js"),k=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),j=1e3,w=function(e){return new v.l(e.treeChanges().to).resolvePath("EAGER",e).then(Y.ZT)},b=function(e,t){return new v.l(e.treeChanges().to).subContext(t.$$state()).resolvePath("LAZY",e).then(Y.ZT)},D=function(e){return new v.l(e.treeChanges().to).resolvePath("LAZY",e).then(Y.ZT)},T=function(e){var t=h.u.$q,n=e.views("entering");if(n.length)return t.all(n.map((function(e){return t.when(e.load())}))).then(Y.ZT)},S=function(e){var t=e.views("entering"),n=e.views("exiting");if(t.length||n.length){var o=e.router.viewService;n.forEach((function(e){return o.deactivateViewConfig(e)})),t.forEach((function(e){return o.activateViewConfig(e)})),o.sync()}},H=function(e){var t=e.router.globals,n=function(){t.transition===e&&(t.transition=null)};e.onSuccess({},(function(){t.successfulTransitions.enqueue(e),t.$current=e.$to(),t.current=t.$current.self,(0,Y.JG)(e.params(),t.params)}),{priority:1e4}),e.promise.then(n,n)},x=function(e){var t=e.options(),n=e.router.stateService,o=e.router.urlRouter;if("url"!==t.source&&t.location&&n.$current.navigable){var r={replace:"replace"===t.location};o.push(n.$current.navigable.url,n.params,r)}o.update(!0)},E=n("./node_modules/@uirouter/core/lib-esm/hooks/lazyLoad.js"),P=n("./node_modules/@uirouter/core/lib-esm/transition/transitionEventType.js"),O=n("./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js"),$=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),A=n("./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js");function R(e){var t=e._ignoredReason();if(t){$.g4.traceTransitionIgnored(e);var n=e.router.globals.transition;return"SameAsCurrent"===t&&n&&n.abort(),A.i.ignored().toPromise()}}function F(e){if(!e.valid())throw new Error(e.error().toString())}var W={location:!0,relative:null,inherit:!1,notify:!0,reload:!1,supercede:!0,custom:{},current:function(){return null},source:"unknown"},C=function(){function e(e){this._transitionCount=0,this._eventTypes=[],this._registeredHooks={},this._criteriaPaths={},this._router=e,this.$view=e.viewService,this._deregisterHookFns={},this._pluginapi=(0,Y.WR)((0,k.P0)(this),{},(0,k.P0)(this),["_definePathType","_defineEvent","_getPathTypes","_getEvents","getHooks"]),this._defineCorePaths(),this._defineCoreEvents(),this._registerCoreTransitionHooks(),e.globals.successfulTransitions.onEvict(_)}return e.prototype.onCreate=function(e,t,n){},e.prototype.onBefore=function(e,t,n){},e.prototype.onStart=function(e,t,n){},e.prototype.onExit=function(e,t,n){},e.prototype.onRetain=function(e,t,n){},e.prototype.onEnter=function(e,t,n){},e.prototype.onFinish=function(e,t,n){},e.prototype.onSuccess=function(e,t,n){},e.prototype.onError=function(e,t,n){},e.prototype.dispose=function(e){(0,Y.VO)(this._registeredHooks).forEach((function(e){return e.forEach((function(t){t._deregistered=!0,(0,Y.nA)(e,t)}))}))},e.prototype.create=function(e,t){return new r.u(e,t,this._router)},e.prototype._defineCoreEvents=function(){var e=o.k,t=O.I,n=this._criteriaPaths,r=!1,s=!0;this._defineEvent("onCreate",e.CREATE,0,n.to,r,t.LOG_REJECTED_RESULT,t.THROW_ERROR,s),this._defineEvent("onBefore",e.BEFORE,0,n.to),this._defineEvent("onStart",e.RUN,0,n.to),this._defineEvent("onExit",e.RUN,100,n.exiting,!0),this._defineEvent("onRetain",e.RUN,200,n.retained),this._defineEvent("onEnter",e.RUN,300,n.entering),this._defineEvent("onFinish",e.RUN,400,n.to),this._defineEvent("onSuccess",e.SUCCESS,0,n.to,r,t.LOG_REJECTED_RESULT,t.LOG_ERROR,s),this._defineEvent("onError",e.ERROR,0,n.to,r,t.LOG_REJECTED_RESULT,t.LOG_ERROR,s)},e.prototype._defineCorePaths=function(){var e=o.c.STATE,t=o.c.TRANSITION;this._definePathType("to",t),this._definePathType("from",t),this._definePathType("exiting",e),this._definePathType("retained",e),this._definePathType("entering",e)},e.prototype._defineEvent=function(e,t,n,o,r,a,i,d){void 0===r&&(r=!1),void 0===a&&(a=O.I.HANDLE_RESULT),void 0===i&&(i=O.I.REJECT_ERROR),void 0===d&&(d=!1);var u=new P.t(e,t,n,o,r,a,i,d);this._eventTypes.push(u),(0,s.BU)(this,this,u)},e.prototype._getEvents=function(e){return((0,c.$K)(e)?this._eventTypes.filter((function(t){return t.hookPhase===e})):this._eventTypes.slice()).sort((function(e,t){var n=e.hookPhase-t.hookPhase;return 0===n?e.hookOrder-t.hookOrder:n}))},e.prototype._definePathType=function(e,t){this._criteriaPaths[e]={name:e,scope:t}},e.prototype._getPathTypes=function(){return this._criteriaPaths},e.prototype.getHooks=function(e){return this._registeredHooks[e]},e.prototype._registerCoreTransitionHooks=function(){var e=this._deregisterHookFns;e.addCoreResolves=this.onCreate({},u),e.ignored=this.onBefore({},R,{priority:-9999}),e.invalid=function(e){return e.onBefore({},F,{priority:-1e4})}(this),e.redirectTo=function(e){return e.onStart({to:function(e){return!!e.redirectTo}},p)}(this),e.onExit=function(e){return e.onExit({exiting:function(e){return!!e.onExit}},y)}(this),e.onRetain=function(e){return e.onRetain({retained:function(e){return!!e.onRetain}},L)}(this),e.onEnter=function(e){return e.onEnter({entering:function(e){return!!e.onEnter}},g)}(this),e.eagerResolve=function(e){return e.onStart({},w,{priority:j})}(this),e.lazyResolve=function(e){return e.onEnter({entering:(0,k.P0)(!0)},b,{priority:j})}(this),e.resolveAll=function(e){return e.onFinish({},D,{priority:j})}(this),e.loadViews=function(e){return e.onFinish({},T)}(this),e.activateViews=function(e){return e.onSuccess({},S)}(this),e.updateGlobals=function(e){return e.onCreate({},H)}(this),e.updateUrl=function(e){return e.onSuccess({},x,{priority:9999})}(this),e.lazyLoad=(0,E.v)(this)},e}()},"./node_modules/@uirouter/core/lib-esm/url/interface.js":()=>{},"./node_modules/@uirouter/core/lib-esm/url/urlConfig.js":(e,t,n)=>{"use strict";n.d(t,{F:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/params/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),s=function(){function e(e){var t=this;this.router=e,this.paramTypes=new o.ParamTypes,this._decodeParams=!0,this._isCaseInsensitive=!1,this._isStrictMode=!0,this._defaultSquashPolicy=!1,this.dispose=function(){return t.paramTypes.dispose()},this.baseHref=function(){return t.router.locationConfig.baseHref()},this.hashPrefix=function(e){return t.router.locationConfig.hashPrefix(e)},this.host=function(){return t.router.locationConfig.host()},this.html5Mode=function(){return t.router.locationConfig.html5Mode()},this.port=function(){return t.router.locationConfig.port()},this.protocol=function(){return t.router.locationConfig.protocol()}}return e.prototype.caseInsensitive=function(e){return this._isCaseInsensitive=(0,r.$K)(e)?e:this._isCaseInsensitive},e.prototype.defaultSquashPolicy=function(e){if((0,r.$K)(e)&&!0!==e&&!1!==e&&!(0,r.HD)(e))throw new Error("Invalid squash policy: "+e+". Valid policies: false, true, arbitrary-string");return this._defaultSquashPolicy=(0,r.$K)(e)?e:this._defaultSquashPolicy},e.prototype.strictMode=function(e){return this._isStrictMode=(0,r.$K)(e)?e:this._isStrictMode},e.prototype.type=function(e,t,n){var o=this.paramTypes.type(e,t,n);return(0,r.$K)(t)?this:o},e}()},"./node_modules/@uirouter/core/lib-esm/url/urlMatcherFactory.js":(e,t,n)=>{"use strict";n.d(t,{y:()=>d});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/url/urlMatcher.js"),s=n("./node_modules/@uirouter/core/lib-esm/params/index.js"),a=function(){return(a=Object.assign||function(e){for(var t,n=1,o=arguments.length;n{"use strict";n.d(t,{g:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/url/urlRule.js"),s=function(){function e(e){var t=this;this.router=e,this.sync=function(e){return t.router.urlService.sync(e)},this.listen=function(e){return t.router.urlService.listen(e)},this.deferIntercept=function(e){return t.router.urlService.deferIntercept(e)},this.match=function(e){return t.router.urlService.match(e)},this.initial=function(e){return t.router.urlService.rules.initial(e)},this.otherwise=function(e){return t.router.urlService.rules.otherwise(e)},this.removeRule=function(e){return t.router.urlService.rules.removeRule(e)},this.rule=function(e){return t.router.urlService.rules.rule(e)},this.rules=function(){return t.router.urlService.rules.rules()},this.sort=function(e){return t.router.urlService.rules.sort(e)},this.when=function(e,n,o){return t.router.urlService.rules.when(e,n,o)},this.urlRuleFactory=new r.I(e)}return e.prototype.update=function(e){var t=this.router.locationService;e?this.location=t.url():t.url()!==this.location&&t.url(this.location,!0)},e.prototype.push=function(e,t,n){var o=n&&!!n.replace;this.router.urlService.url(e.format(t||{}),o)},e.prototype.href=function(e,t,n){var r=e.format(t);if(null==r)return null;n=n||{absolute:!1};var s=this.router.urlService.config,a=s.html5Mode();if(a||null===r||(r="#"+s.hashPrefix()+r),r=function(e,t,n,r){return"/"===r?e:t?(0,o.Lb)(r)+e:n?r.slice(1)+e:e}(r,a,n.absolute,s.baseHref()),!n.absolute||!r)return r;var i=!a&&r?"/":"",d=s.port(),u=80===d||443===d?"":":"+d;return[s.protocol(),"://",s.host(),u,i,r].join("")},Object.defineProperty(e.prototype,"interceptDeferred",{get:function(){return this.router.urlService.interceptDeferred},enumerable:!1,configurable:!0}),e}()},"./node_modules/@uirouter/core/lib-esm/url/urlRule.js":(e,t,n)=>{"use strict";n.d(t,{I:()=>d,n:()=>u});var o=n("./node_modules/@uirouter/core/lib-esm/url/urlMatcher.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),i=n("./node_modules/@uirouter/core/lib-esm/state/stateObject.js"),d=function(){function e(e){this.router=e}return e.prototype.compile=function(e){return this.router.urlMatcherFactory.compile(e)},e.prototype.create=function(e,t){var n=this,s=i.l.isState,d=i.l.isStateDeclaration,m=(0,a.uj)([[r.HD,function(e){return m(n.compile(e))}],[(0,a.is)(o.x),function(e){return n.fromUrlMatcher(e,t)}],[(0,a.or)(s,d),function(e){return n.fromState(e,n.router)}],[(0,a.is)(RegExp),function(e){return n.fromRegExp(e,t)}],[r.mf,function(e){return new u(e,t)}]]),l=m(e);if(!l)throw new Error("invalid 'what' in when()");return l},e.prototype.fromUrlMatcher=function(e,t){var n=t;(0,r.HD)(t)&&(t=this.router.urlMatcherFactory.compile(t)),(0,a.is)(o.x)(t)&&(n=function(e){return t.format(e)});var i={urlMatcher:e,matchPriority:function(t){var n=e.parameters().filter((function(e){return e.isOptional}));return n.length?n.filter((function(e){return t[e.id]})).length/n.length:1e-6},type:"URLMATCHER"};return(0,s.l7)(new u((function(t){var n=e.exec(t.path,t.search,t.hash);return e.validates(n)&&n}),n),i)},e.prototype.fromState=function(e,t){var n=i.l.isStateDeclaration(e)?e.$$state():e,o={state:n,type:"STATE"};return(0,s.l7)(this.fromUrlMatcher(n.url,(function(e){var o=t.stateService,r=t.globals;o.href(n,e)!==o.href(r.current,r.params)&&o.transitionTo(n,e,{inherit:!0,source:"url"})})),o)},e.prototype.fromRegExp=function(e,t){if(e.global||e.sticky)throw new Error("Rule RegExp must not be global or sticky");var n=(0,r.HD)(t)?function(e){return t.replace(/\$(\$|\d{1,2})/,(function(t,n){return e["$"===n?0:Number(n)]}))}:t,o={regexp:e,type:"REGEXP"};return(0,s.l7)(new u((function(t){return e.exec(t.path)}),n),o)},e.isUrlRule=function(e){return e&&["type","match","handler"].every((function(t){return(0,r.$K)(e[t])}))},e}(),u=function(e,t){var n=this;this.match=e,this.type="RAW",this.matchPriority=function(e){return 0-n.$id},this.handler=t||s.yR}},"./node_modules/@uirouter/core/lib-esm/url/urlRules.js":(e,t,n)=>{"use strict";n.d(t,{h:()=>u});var o,r=n("./node_modules/@uirouter/core/lib-esm/state/index.js"),s=n("./node_modules/@uirouter/core/lib-esm/url/urlMatcher.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),i=n("./node_modules/@uirouter/core/lib-esm/url/urlRule.js");function d(e){if(!((0,a.mf)(e)||(0,a.HD)(e)||(0,a.is)(r.TargetState)(e)||r.TargetState.isDef(e)))throw new Error("'handler' must be a string, function, TargetState, or have a state: 'newtarget' property");return(0,a.mf)(e)?e:(0,a.P0)(e)}o=function(e,t){var n=function(e,t){return(t.priority||0)-(e.priority||0)}(e,t);return 0!==n||0!==(n=function(e,t){var n={STATE:4,URLMATCHER:4,REGEXP:3,RAW:2,OTHER:1};return(n[e.type]||0)-(n[t.type]||0)}(e,t))||0!==(n=function(e,t){return e.urlMatcher&&t.urlMatcher?s.x.compare(e.urlMatcher,t.urlMatcher):0}(e,t))?n:function(e,t){var n={STATE:!0,URLMATCHER:!0};return n[e.type]&&n[t.type]?0:(e.$id||0)-(t.$id||0)}(e,t)};var u=function(){function e(e){this.router=e,this._sortFn=o,this._rules=[],this._id=0,this.urlRuleFactory=new i.I(e)}return e.prototype.dispose=function(e){this._rules=[],delete this._otherwiseFn},e.prototype.initial=function(e){var t=d(e);this.rule(this.urlRuleFactory.create((function(e,t){return 0===t.globals.transitionHistory.size()&&!!/^\/?$/.exec(e.path)}),t))},e.prototype.otherwise=function(e){var t=d(e);this._otherwiseFn=this.urlRuleFactory.create((0,a.P0)(!0),t),this._sorted=!1},e.prototype.removeRule=function(e){(0,a.nA)(this._rules,e)},e.prototype.rule=function(e){var t=this;if(!i.I.isUrlRule(e))throw new Error("invalid rule");return e.$id=this._id++,e.priority=e.priority||0,this._rules.push(e),this._sorted=!1,function(){return t.removeRule(e)}},e.prototype.rules=function(){return this.ensureSorted(),this._rules.concat(this._otherwiseFn?[this._otherwiseFn]:[])},e.prototype.sort=function(e){for(var t=this.stableSort(this._rules,this._sortFn=e||this._sortFn),n=0,o=0;o{"use strict";n.d(t,{i:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/url/urlRules.js"),s=n("./node_modules/@uirouter/core/lib-esm/url/urlConfig.js"),a=n("./node_modules/@uirouter/core/lib-esm/state/index.js"),i=function(){function e(e){var t=this;this.router=e,this.interceptDeferred=!1,this.rules=new r.h(this.router),this.config=new s.F(this.router),this.url=function(e,n,o){return t.router.locationService.url(e,n,o)},this.path=function(){return t.router.locationService.path()},this.search=function(){return t.router.locationService.search()},this.hash=function(){return t.router.locationService.hash()},this.onChange=function(e){return t.router.locationService.onChange(e)}}return e.prototype.dispose=function(){this.listen(!1),this.rules.dispose()},e.prototype.parts=function(){return{path:this.path(),search:this.search(),hash:this.hash()}},e.prototype.sync=function(e){if(!e||!e.defaultPrevented){var t=this.router,n=t.urlService,r=t.stateService,s={path:n.path(),search:n.search(),hash:n.hash()},i=this.match(s);(0,o.uj)([[o.HD,function(e){return n.url(e,!0)}],[a.TargetState.isDef,function(e){return r.go(e.state,e.params,e.options)}],[(0,o.is)(a.TargetState),function(e){return r.go(e.state(),e.params(),e.options())}]])(i&&i.rule.handler(i.match,s,this.router))}},e.prototype.listen=function(e){var t=this;if(!1!==e)return this._stopListeningFn=this._stopListeningFn||this.router.urlService.onChange((function(e){return t.sync(e)}));this._stopListeningFn&&this._stopListeningFn(),delete this._stopListeningFn},e.prototype.deferIntercept=function(e){void 0===e&&(e=!0),this.interceptDeferred=e},e.prototype.match=function(e){e=(0,o.l7)({path:"",search:{},hash:""},e);for(var t,n,r,s=this.rules.rules(),a=0;at.weight?i:t}return t},e}()},"./node_modules/@uirouter/core/lib-esm/vanilla.js":(e,t,n)=>{"use strict";n.d(t,{$q:()=>o.$q});var o=n("./node_modules/@uirouter/core/lib-esm/vanilla/index.js")},"./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js":(e,t,n)=>{"use strict";n.d(t,{U:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=n("./node_modules/@uirouter/core/lib-esm/vanilla/utils.js"),s=function(){function e(e,t){var n=this;this.fireAfterUpdate=t,this._listeners=[],this._listener=function(e){return n._listeners.forEach((function(t){return t(e)}))},this.hash=function(){return(0,r.en)(n._get()).hash},this.path=function(){return(0,r.en)(n._get()).path},this.search=function(){return(0,r.Qf)((0,r.en)(n._get()).search)},this._location=o.Jz.location,this._history=o.Jz.history}return e.prototype.url=function(e,t){return void 0===t&&(t=!0),(0,o.$K)(e)&&e!==this._get()&&(this._set(null,null,e,t),this.fireAfterUpdate&&this._listeners.forEach((function(t){return t({url:e})}))),(0,r.Q2)(this)},e.prototype.onChange=function(e){var t=this;return this._listeners.push(e),function(){return(0,o.nA)(t._listeners,e)}},e.prototype.dispose=function(e){(0,o.Wk)(this._listeners)},e}()},"./node_modules/@uirouter/core/lib-esm/vanilla/browserLocationConfig.js":(e,t,n)=>{"use strict";n.d(t,{u:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=function(){function e(e,t){void 0===t&&(t=!1),this._isHtml5=t,this._baseHref=void 0,this._hashPrefix=""}return e.prototype.port=function(){return location.port?Number(location.port):"https"===this.protocol()?443:80},e.prototype.protocol=function(){return location.protocol.replace(/:/g,"")},e.prototype.host=function(){return location.hostname},e.prototype.html5Mode=function(){return this._isHtml5},e.prototype.hashPrefix=function(e){return(0,o.$K)(e)?this._hashPrefix=e:this._hashPrefix},e.prototype.baseHref=function(e){return(0,o.$K)(e)&&(this._baseHref=e),(0,o.o8)(this._baseHref)&&(this._baseHref=this.getBaseHref()),this._baseHref},e.prototype.getBaseHref=function(){var e=document.getElementsByTagName("base")[0];return e&&e.href?e.href.replace(/^([^/:]*:)?\/\/[^/]*/,""):this._isHtml5?"/":location.pathname||"/"},e.prototype.dispose=function(){},e}()},"./node_modules/@uirouter/core/lib-esm/vanilla/hashLocationService.js":(e,t,n)=>{"use strict";n.d(t,{R:()=>i});var o,r=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),s=n("./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js"),a=(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=function(e){function t(t){var n=e.call(this,t,!1)||this;return r.Jz.addEventListener("hashchange",n._listener,!1),n}return a(t,e),t.prototype._get=function(){return(0,r.Ld)(this._location.hash)},t.prototype._set=function(e,t,n,o){this._location.hash=n},t.prototype.dispose=function(t){e.prototype.dispose.call(this,t),r.Jz.removeEventListener("hashchange",this._listener)},t}(s.U)},"./node_modules/@uirouter/core/lib-esm/vanilla/injector.js":(e,t,n)=>{"use strict";n("./node_modules/@uirouter/core/lib-esm/common/index.js")},"./node_modules/@uirouter/core/lib-esm/vanilla/interface.js":()=>{},"./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationConfig.js":(e,t,n)=>{"use strict";n.d(t,{W:()=>s});var o=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),s=function(){var e=this;this.dispose=r.ZT,this._baseHref="",this._port=80,this._protocol="http",this._host="localhost",this._hashPrefix="",this.port=function(){return e._port},this.protocol=function(){return e._protocol},this.host=function(){return e._host},this.baseHref=function(){return e._baseHref},this.html5Mode=function(){return!1},this.hashPrefix=function(t){return(0,o.$K)(t)?e._hashPrefix=t:e._hashPrefix}}},"./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationService.js":(e,t,n)=>{"use strict";n.d(t,{I:()=>a});var o,r=n("./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js"),s=(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),a=function(e){function t(t){return e.call(this,t,!0)||this}return s(t,e),t.prototype._get=function(){return this._url},t.prototype._set=function(e,t,n,o){this._url=n},t}(r.U)},"./node_modules/@uirouter/core/lib-esm/vanilla/plugins.js":(e,t,n)=>{"use strict";var o=n("./node_modules/@uirouter/core/lib-esm/vanilla/browserLocationConfig.js"),r=n("./node_modules/@uirouter/core/lib-esm/vanilla/hashLocationService.js"),s=n("./node_modules/@uirouter/core/lib-esm/vanilla/utils.js"),a=n("./node_modules/@uirouter/core/lib-esm/vanilla/pushStateLocationService.js"),i=n("./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationService.js"),d=n("./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationConfig.js");n("./node_modules/@uirouter/core/lib-esm/vanilla/injector.js"),n("./node_modules/@uirouter/core/lib-esm/vanilla/q.js"),n("./node_modules/@uirouter/core/lib-esm/common/coreservices.js"),(0,s._D)("vanilla.hashBangLocation",!1,r.R,o.u),(0,s._D)("vanilla.pushStateLocation",!0,a.h,o.u),(0,s._D)("vanilla.memoryLocation",!1,i.I,d.W)},"./node_modules/@uirouter/core/lib-esm/vanilla/pushStateLocationService.js":(e,t,n)=>{"use strict";n.d(t,{h:()=>i});var o,r=n("./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),a=(o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=function(e){function t(t){var n=e.call(this,t,!0)||this;return n._config=t.urlService.config,s.Jz.addEventListener("popstate",n._listener,!1),n}return a(t,e),t.prototype._getBasePrefix=function(){return(0,s.Lb)(this._config.baseHref())},t.prototype._get=function(){var e=this._location,t=e.pathname,n=e.hash,o=e.search;o=(0,s.C7)(o)[1],n=(0,s.cW)(n)[1];var r=this._getBasePrefix(),a=t===this._config.baseHref(),i=t.substr(0,r.length)===r;return(t=a?"/":i?t.substring(r.length):t)+(o?"?"+o:"")+(n?"#"+n:"")},t.prototype._set=function(e,t,n,o){var r=this._getBasePrefix(),s=n&&"/"!==n[0]?"/":"",a=""===n||"/"===n?this._config.baseHref():r+s+n;o?this._history.replaceState(e,t,a):this._history.pushState(e,t,a)},t.prototype.dispose=function(t){e.prototype.dispose.call(this,t),s.Jz.removeEventListener("popstate",this._listener)},t}(r.U)},"./node_modules/@uirouter/core/lib-esm/vanilla/q.js":(e,t,n)=>{"use strict";n.d(t,{$q:()=>r});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r={when:function(e){return new Promise((function(t,n){return t(e)}))},reject:function(e){return new Promise((function(t,n){n(e)}))},defer:function(){var e={};return e.promise=new Promise((function(t,n){e.resolve=t,e.reject=n})),e},all:function(e){if((0,o.kJ)(e))return Promise.all(e);if((0,o.Kn)(e)){var t=Object.keys(e).map((function(t){return e[t].then((function(e){return{key:t,val:e}}))}));return r.all(t).then((function(e){return e.reduce((function(e,t){return e[t.key]=t.val,e}),{})}))}}}},"./node_modules/@uirouter/core/lib-esm/vanilla/utils.js":(e,t,n)=>{"use strict";n.d(t,{Qf:()=>s,en:()=>a,Q2:()=>i,_D:()=>d});var o=n("./node_modules/@uirouter/core/lib-esm/common/index.js"),r=function(e,t){var n=t[0],r=t[1];return e.hasOwnProperty(n)?(0,o.kJ)(e[n])?e[n].push(r):e[n]=[e[n],r]:e[n]=r,e},s=function(e){return e.split("&").filter(o.yR).map(o.Fb).reduce(r,{})};function a(e){var t=function(e){return e||""},n=(0,o.cW)(e).map(t),r=n[0],s=n[1],a=(0,o.C7)(r).map(t);return{path:a[0],search:a[1],hash:s,url:e}}var i=function(e){var t=e.path(),n=e.search(),r=e.hash(),s=Object.keys(n).map((function(e){var t=n[e];return((0,o.kJ)(t)?t:[t]).map((function(t){return e+"="+t}))})).reduce(o.M7,[]).join("&");return t+(s?"?"+s:"")+(r?"#"+r:"")};function d(e,t,n,o){return function(r){var s=r.locationService=new n(r),a=r.locationConfig=new o(r,t);return{name:e,service:s,configuration:a,dispose:function(e){e.dispose(s),e.dispose(a)}}}}},"./node_modules/@uirouter/core/lib-esm/view/interface.js":()=>{},"./node_modules/@uirouter/core/lib-esm/view/view.js":(e,t,n)=>{"use strict";n.d(t,{s:()=>i});var o=n("./node_modules/@uirouter/core/lib-esm/common/common.js"),r=n("./node_modules/@uirouter/core/lib-esm/common/hof.js"),s=n("./node_modules/@uirouter/core/lib-esm/common/predicates.js"),a=n("./node_modules/@uirouter/core/lib-esm/common/trace.js"),i=function(){function e(e){var t=this;this.router=e,this._uiViews=[],this._viewConfigs=[],this._viewConfigFactories={},this._listeners=[],this._pluginapi={_rootViewContext:this._rootViewContext.bind(this),_viewConfigFactory:this._viewConfigFactory.bind(this),_registeredUIView:function(e){return(0,o.sE)(t._uiViews,(function(n){return t.router.$id+"."+n.id===e}))},_registeredUIViews:function(){return t._uiViews},_activeViewConfigs:function(){return t._viewConfigs},_onSync:function(e){return t._listeners.push(e),function(){return(0,o.nA)(t._listeners,e)}}}}return e.normalizeUIViewTarget=function(e,t){void 0===t&&(t="");var n=t.split("@"),o=n[0]||"$default",r=(0,s.HD)(n[1])?n[1]:"^",a=/^(\^(?:\.\^)*)\.(.*$)/.exec(o);if(a&&(r=a[1],o=a[2]),"!"===o.charAt(0)&&(o=o.substr(1),r=""),/^(\^(?:\.\^)*)$/.exec(r)){var i=r.split(".").reduce((function(e,t){return e.parent}),e);r=i.name}else"."===r&&(r=e.name);return{uiViewName:o,uiViewContextAnchor:r}},e.prototype._rootViewContext=function(e){return this._rootContext=e||this._rootContext},e.prototype._viewConfigFactory=function(e,t){this._viewConfigFactories[e]=t},e.prototype.createViewConfig=function(e,t){var n=this._viewConfigFactories[t.$type];if(!n)throw new Error("ViewService: No view config factory registered for type "+t.$type);var o=n(e,t);return(0,s.kJ)(o)?o:[o]},e.prototype.deactivateViewConfig=function(e){a.g4.traceViewServiceEvent("<- Removing",e),(0,o.nA)(this._viewConfigs,e)},e.prototype.activateViewConfig=function(e){a.g4.traceViewServiceEvent("-> Registering",e),this._viewConfigs.push(e)},e.prototype.sync=function(){var t=this,n=this._uiViews.map((function(e){return[e.fqn,e]})).reduce(o.bb,{});function s(e){for(var t=e.viewDecl.$context,n=0;++n&&t.parent;)t=t.parent;return n}var i=(0,r.WA)((function(e,t,n,o){return t*(e(n)-e(o))})),d=this._uiViews.sort(i((function(e){var t=function(e){return e&&e.parent?t(e.parent)+1:1};return 1e4*e.fqn.split(".").length+t(e.creationContext)}),1)).map((function(o){var r=t._viewConfigs.filter(e.matches(n,o));return r.length>1&&r.sort(i(s,-1)),{uiView:o,viewConfig:r[0]}})),u=d.map((function(e){return e.viewConfig})),m=this._viewConfigs.filter((function(e){return!(0,o.d3)(u,e)})).map((function(e){return{uiView:void 0,viewConfig:e}}));d.forEach((function(e){-1!==t._uiViews.indexOf(e.uiView)&&e.uiView.configUpdated(e.viewConfig)}));var l=d.concat(m);this._listeners.forEach((function(e){return e(l)})),a.g4.traceViewSync(l)},e.prototype.registerUIView=function(e){a.g4.traceViewServiceUIViewEvent("-> Registering",e);var t=this._uiViews;return t.filter((function(t){return t.fqn===e.fqn&&t.$type===e.$type})).length&&a.g4.traceViewServiceUIViewEvent("!!!! duplicate uiView named:",e),t.push(e),this.sync(),function(){-1!==t.indexOf(e)?(a.g4.traceViewServiceUIViewEvent("<- Deregistering",e),(0,o.nA)(t)(e)):a.g4.traceViewServiceUIViewEvent("Tried removing non-registered uiView",e)}},e.prototype.available=function(){return this._uiViews.map((0,r.vg)("fqn"))},e.prototype.active=function(){return this._uiViews.filter((0,r.vg)("$config")).map((0,r.vg)("name"))},e.matches=function(e,t){return function(n){if(t.$type!==n.viewDecl.$type)return!1;var r=n.viewDecl,s=r.$uiViewName.split("."),a=t.fqn.split(".");if(!(0,o.fS)(s,a.slice(0-s.length)))return!1;var i=1-s.length||void 0,d=a.slice(0,i).join("."),u=e[d].creationContext;return r.$uiViewContextAnchor===(u&&u.name)}},e}()},"./node_modules/angular-aria/angular-aria.js":()=>{!function(e,t){"use strict";var n="ngAriaDisable",o=t.module("ngAria",["ng"]).info({angularVersion:"1.8.2"}).provider("$aria",(function(){var e={ariaHidden:!0,ariaChecked:!0,ariaReadonly:!0,ariaDisabled:!0,ariaRequired:!0,ariaInvalid:!0,ariaValue:!0,tabindex:!0,bindKeydown:!0,bindRoleForClick:!0};function o(t,o,r,a){return function(i,d,u){if(!u.hasOwnProperty(n)){var m=u.$normalize(o);!e[m]||s(d,r)||u[m]||i.$watch(u[t],(function(e){e=a?!e:!!e,d.attr(o,e)}))}}}this.config=function(n){e=t.extend(e,n)},this.$get=function(){return{config:function(t){return e[t]},$$watchExpr:o}}})),r=["BUTTON","A","INPUT","TEXTAREA","SELECT","DETAILS","SUMMARY"],s=function(e,t){if(-1!==t.indexOf(e[0].nodeName))return!0};o.directive("ngShow",["$aria",function(e){return e.$$watchExpr("ngShow","aria-hidden",[],!0)}]).directive("ngHide",["$aria",function(e){return e.$$watchExpr("ngHide","aria-hidden",[],!1)}]).directive("ngValue",["$aria",function(e){return e.$$watchExpr("ngValue","aria-checked",r,!1)}]).directive("ngChecked",["$aria",function(e){return e.$$watchExpr("ngChecked","aria-checked",r,!1)}]).directive("ngReadonly",["$aria",function(e){return e.$$watchExpr("ngReadonly","aria-readonly",r,!1)}]).directive("ngRequired",["$aria",function(e){return e.$$watchExpr("ngRequired","aria-required",r,!1)}]).directive("ngModel",["$aria",function(e){function t(t,n,o,a){return e.config(n)&&!o.attr(t)&&(a||!s(o,r))&&("hidden"!==o.attr("type")||"INPUT"!==o[0].nodeName)}function o(e,t){return!t.attr("role")&&t.attr("type")===e&&!s(t,r)}return{restrict:"A",require:"ngModel",priority:200,compile:function(r,s){if(!s.hasOwnProperty(n)){var a=function(e,t){var n=e.type,o=e.role;return"checkbox"===(n||o)||"menuitemcheckbox"===o?"checkbox":"radio"===(n||o)||"menuitemradio"===o?"radio":"range"===n||"progressbar"===o||"slider"===o?"range":""}(s);return{post:function(n,r,s,i){var d=t("tabindex","tabindex",r,!1);function u(){return i.$modelValue}switch(a){case"radio":case"checkbox":o(a,r)&&r.attr("role",a),t("aria-checked","ariaChecked",r,!1)&&n.$watch(u,"radio"===a?function(e){var t=s.value==i.$viewValue;r.attr("aria-checked",t)}:function(){r.attr("aria-checked",!i.$isEmpty(i.$viewValue))}),d&&r.attr("tabindex",0);break;case"range":if(o(a,r)&&r.attr("role","slider"),e.config("ariaValue")){var m=!r.attr("aria-valuemin")&&(s.hasOwnProperty("min")||s.hasOwnProperty("ngMin")),l=!r.attr("aria-valuemax")&&(s.hasOwnProperty("max")||s.hasOwnProperty("ngMax")),_=!r.attr("aria-valuenow");m&&s.$observe("min",(function(e){r.attr("aria-valuemin",e)})),l&&s.$observe("max",(function(e){r.attr("aria-valuemax",e)})),_&&n.$watch(u,(function(e){r.attr("aria-valuenow",e)}))}d&&r.attr("tabindex",0)}!s.hasOwnProperty("ngRequired")&&i.$validators.required&&t("aria-required","ariaRequired",r,!1)&&s.$observe("required",(function(){r.attr("aria-required",!!s.required)})),t("aria-invalid","ariaInvalid",r,!0)&&n.$watch((function(){return i.$invalid}),(function(e){r.attr("aria-invalid",!!e)}))}}}}}}]).directive("ngDisabled",["$aria",function(e){return e.$$watchExpr("ngDisabled","aria-disabled",r,!1)}]).directive("ngMessages",(function(){return{restrict:"A",require:"?ngMessages",link:function(e,t,o,r){o.hasOwnProperty(n)||t.attr("aria-live")||t.attr("aria-live","assertive")}}})).directive("ngClick",["$aria","$parse",function(e,t){return{restrict:"A",compile:function(o,a){if(!a.hasOwnProperty(n)){var i=t(a.ngClick);return function(t,n,o){s(n,r)||(e.config("bindRoleForClick")&&!n.attr("role")&&n.attr("role","button"),e.config("tabindex")&&!n.attr("tabindex")&&n.attr("tabindex",0),!e.config("bindKeydown")||o.ngKeydown||o.ngKeypress||o.ngKeyup||n.on("keydown",(function(e){var n=e.which||e.keyCode;13!==n&&32!==n||(-1!==r.indexOf(e.target.nodeName)||e.target.isContentEditable||e.preventDefault(),t.$apply((function(){i(t,{$event:e})})))})))}}}}}]).directive("ngDblclick",["$aria",function(e){return function(t,o,a){a.hasOwnProperty(n)||!e.config("tabindex")||o.attr("tabindex")||s(o,r)||o.attr("tabindex",0)}}])}(window,window.angular)},"./node_modules/angular-rateit/dist/ng-rateit.js":()=>{angular.module("ngRateIt",["ng"]).directive("ngRateIt",["$q",function(e){"use strict";return{scope:{ngModel:"=",min:"=?min",max:"=?max",step:"=?step",readOnly:"&?readOnly",pristine:"=?pristine",resetable:"&?resetable",starWidth:"=?starWidth",starHeight:"=?starHeight",canelWidth:"=?canelWidth",cancelHeight:"=?cancelHeight",rated:"&?rated",reset:"&?reset",beforeRated:"&?beforeRated",beforeReset:"&?beforeReset"},templateUrl:"ngRateIt/ng-rate-it.html",require:"ngModel",replace:!0,link:function(t,n,o){o.readOnly||(t.readOnly=function(){return!1}),o.resetable||(t.resetable=function(){return!0}),o.beforeRated||(t.beforeRated=function(){var t=e.defer();return t.resolve(),t.promise}),o.rated||(t.rated=function(){}),o.beforeReset||(t.beforeReset=function(){var t=e.defer();return t.resolve(),t.promise}),o.reset||(t.reset=function(){})},controller:"ngRateItController"}}]).controller("ngRateItController",["$scope","$timeout",function(e,t){"use strict";e.isTouch=!!window.hasOwnProperty("ontouchstart")||window.navigator.msMaxTouchPoints>0,e.orgValue=angular.copy(e.ngModel),e.min=e.min||0,e.max=e.max||5,e.step=e.step||.5,e.pristine=e.orgValue===e.ngModel,e.starWidth=e.starWidth||16,e.starPartWidth=e.starWidth*e.step,e.starHeight=e.starHeight||16,e.canelWidth=e.canelWidth||e.starWidth,e.cancelHeight=e.cancelHeight||e.starHeight;var n=e.max-e.min,o=n/e.step,r=e.$watch("ngModel",(function(){e.pristine=e.orgValue===e.ngModel})),s=function(e){return(e+1)/o*n};e.getStartParts=function(){return new Array(o)},e.getStarOffset=function(t){var n=1/e.step;return-e.starWidth/n*(t%n)},e.isSelected=function(t){return s(t)<=e.ngModel-e.min},e.removeRating=function(){e.resetable()&&!e.readOnly()&&e.beforeReset({rating:e.ngModel}).then((function(){e.ngModel=e.min,e.reset({rating:e.ngModel})}))},e.setValue=function(n){if(!e.readOnly()){var o=angular.copy(e.min+s(n));e.beforeRated({rating:o}).then((function(){e.ngModel=o,t((function(){e.rated({rating:e.ngModel})}))}))}},e.$on("$destroy",(function(){r()}))}]).run(["$templateCache",function(e){"use strict";e.put("ngRateIt/ng-rate-it.html",'
')}])},"./src/js/index.module.js":(e,t,n)=>{"use strict";n("./node_modules/angular-animate/index.js"),n("./node_modules/angular-aria/index.js"),n("./node_modules/angular-messages/index.js"),n("./node_modules/angular-material/index.js"),n("./node_modules/angular-resource/index.js"),n("./node_modules/angular-sanitize/index.js"),n("./node_modules/ng-csv/build/ng-csv.min.js"),n("./node_modules/ng-embed/src/ng-embed.js");var o=n("./node_modules/@uirouter/angularjs/lib-esm/index.js"),r=(n("./node_modules/angular-local-storage/index.js"),n("./node_modules/angular-rateit/dist/ng-rateit.js"),n("./node_modules/@flowjs/ng-flow/dist/ng-flow.js"),n("./node_modules/emojionearea/dist/emojionearea.js"),n("./node_modules/jquery-textcomplete/dist/jquery.textcomplete.js"),n("./node_modules/moment/moment.js")),s=n.n(r),a=n("./node_modules/lodash.map/index.js"),i=n.n(a);function d(e,t,n,o,r,a,d,u,m,l){const _=this;function c(n){a.updateStorage(u,{up:n}).then((o=>{var r;e.layout=o,r=!0===n?"show":"hide",t.parent.postMessage({cmd:r},"*"),l((()=>{e.$apply()}))})).catch(a.onStorageError)}_.$onInit=function(){console.debug("IndexController::onInit() VISITOR",e.visitor),e.status="init";const o=e.settings.color,s=e.settings.textColor,i=e.settings.textButtonColor||e.settings.textColor,d=e.settings.color_button,l=e.settings.backgroundColor,_=Math.max(document.documentElement.clientHeight,window.innerHeight||0),h=document.documentElement.clientWidth;document.documentElement.style.setProperty("--xc-ws-div-color",o),document.documentElement.style.setProperty("--xc-ws-text-color",s),document.documentElement.style.setProperty("--xc-ws-text-button-color",i),document.documentElement.style.setProperty("--xc-ws-button-color",d),document.documentElement.style.setProperty("--xc-ws-background-color",l),document.documentElement.style.setProperty("--xc-ws-client-height",_),document.documentElement.style.setProperty("--xc-ws-client-width",h);let f=!1;const p=t=>null!==t&&t[e.location]||{},M=a.getItem(m).then(p),y=a.getItem(u).then(p);r.all([M,y]).then((r=>{let[a,i]=r;e.visitor=a,e.layout=i,e.visitor.interaction&&e.layout.up?f=!0:e.layout.up=!0,"bottom_right"===e.settings.alignment&&c(f),n.go(function(){var t,n;const o=e.settings.online,r=!(null==e||null===(t=e.visitor)||void 0===t||null===(n=t.interaction)||void 0===n||!n.id),s=Number(e.settings.maxInteractions)&&Number(e.settings.openedInteractions)>=Number(e.settings.maxInteractions);return!!(r||!s&&o)}()?"app.online":"app.offline",null,{location:"replace"});let d="";d=e.settings.online||!e.settings.hideWhenOffline?"init":"offline",t.parent.postMessage({cmd:d,div_color:o,text_color:s,client_height:_,client_width:h},"*");const u=document.createElement("style");document.head.appendChild(u),u.sheet.insertRule(".mdi-send:before {color:"+e.settings.color+"!important}")})).catch(a.onStorageError)},_.close=function(){const t=e.visitor.interaction;if(t&&t.id){const r=o.confirm().parent(angular.element(document.querySelector("#chat-app"))).clickOutsideToClose(!0).title(e.settings.closingQuestion||"Do you want to close the interaction?").ok("Ok").cancel("Cancel");o.show(r).then((function(){return d.chatInteraction.customUpdate({id:t.id,closed:!0,closeReason:"contact"}).$promise})).then((function(){n.go("app.closing",null,{location:"replace"})})).catch((function(e){console.error("keep open",e)}))}},_.toggle=c,_.download=function(){const t=r.defer(),n=e.visitor.interaction;return n&&n.id&&d.chatInteraction.getMessages({intid:n.id,includeAll:!0}).$promise.then((function(n){t.resolve(i()(n.rows.slice(1),(function(t){let n;if("in"===t.direction&&(n=e.settings.customerAlias||e.visitor.from||"Visitor"+t.ContactId),"out"===t.direction)switch(e.settings.agentIdentifier){case"website_alias":n=t.UserId?e.settings.agentAlias+t.UserId:"System";break;case"agent_alias":n=t.UserId?t.User.alias||t.User.fullname:"System";break;case"agent_fullname":n=t.UserId?t.User.fullname:"System";break;default:n=t.UserId?e.settings.agentAlias+t.UserId:"System"}return{sender:n,message:t.body,createdAt:s()(t.createdAt).format("MM/DD/YYYY HH:mm:ss")}})))})).catch((function(e){console.error(e)})),t.promise},_.getHeaderShape=function(){return"rounded"===e.settings.header_shape?"15px":"0px"};const h={online:["online","chat","waiting","closing","unmanaged"],offline:["offline"]};Object.defineProperty(e,"actualTitle",{get(){let t=e.settings.defaultTitle;return h.online.includes(e.status)?t=e.settings.header_online:h.offline.includes(e.status)&&(t=e.settings.header_offline),t}}),window.addEventListener("message",(function(e){"show"===e.data.evt?c(!0):"hide"===e.data.evt&&c(!1)}),!1)}d.$inject=["$rootScope","$window","$state","$mdDialog","$q","RemoteStorageService","api","STORAGE_LAYOUT","STORAGE_VISITOR","$timeout"];var u=n("./node_modules/lodash.forin/index.js"),m=n.n(u),l=n("./node_modules/lodash.isnil/index.js"),_=n.n(l),c=n("./src/js/chat/chat.tpl.html"),h=n("./src/js/closing/closing.tpl.html"),f=n("./src/js/offline/offline.tpl.html"),p=n("./src/js/online/online.tpl.html"),M=n("./src/js/unmanaged/unmanaged.tpl.html"),y=n("./src/js/waiting/waiting.tpl.html");function L(e,t){const n=t.search();e.settings={cursor:"pointer",hide:!0},m()(n,(function(t,n){""===t||_()(t)||("true"===t&&(t=!0),"false"===t&&(t=!1),e.settings[n]=t)})),e.location=e.settings.location,e.layout={up:!1},e.visitor={}}function g(e,t,n,o,r){t.html5Mode(!0),n.defaults.headers.get||(n.defaults.headers.get={}),n.defaults.headers.get["If-Modified-Since"]="Mon, 26 Jul 1997 05:00:00 GMT",n.defaults.headers.get["Cache-Control"]="no-cache",n.defaults.headers.get.Pragma="no-cache",o.setPrefix(r),e.state("app",{abstract:!0}).state("app.waiting",{url:"/waiting",templateUrl:y,controller:"WaitingController as vm"}).state("app.online",{url:"/online",templateUrl:p,controller:"OnlineController as vm"}).state("app.offline",{url:"/offline",templateUrl:f,controller:"OfflineController as vm"}).state("app.chat",{url:"/chat",templateUrl:c,controller:"ChatController as vm"}).state("app.unmanaged",{url:"/unmanaged",templateUrl:M,controller:"UnmanagedController as vm"}).state("app.closing",{url:"/closing",templateUrl:h,controller:"ClosingController as vm"})}g.$inject=["$stateProvider","$locationProvider","$httpProvider","localStorageServiceProvider","STORAGE_PREFIX"],L.$inject=["$rootScope","$location"];var Y=n("./node_modules/lodash.merge/index.js"),v=n.n(Y);function k(e,t,n,o,r,s,a,i){const d=this;function u(t){return function(o){d.errors[t]=o.data;const r=n.simple().textContent(e.settings.formSubmitFailureMessage||"Form submission error").toastClass("md-failure-toast").position("top");n.show(r)}}function m(){e.loading=!1}function l(){e.settings.online?t.go("app.online",null,{location:"replace"}):t.go("app.offline",null,{location:"replace"})}function _(){d.form={},d.upColor=null,d.downColor=null,d.userForm.$setPristine(),d.userForm.$setUntouched(),delete e.visitor.interaction,e.enableDownload=!1}d.$onInit=function(){console.debug("ClosingController::onInit() VISITOR",e.visitor),e.status="closing",r.all([s.removeItem(a).then((()=>console.debug("STORAGE_VISITOR cleared"))).catch(s.onStorageError),s.removeItem(i).then((()=>console.debug("STORAGE_LAYOUT cleared"))).catch(s.onStorageError)]).then((()=>e.loading=!1))},d.submit=function(){e.loading=!0,e.visitor.interaction&&e.visitor.interaction.id?o.chatInteraction.close(v()({id:e.visitor.interaction.id,ratingType:e.settings.ratingType,customer:e.settings.customerAlias||e.visitor.from},d.form)).$promise.then((function(){delete d.errors.submit;const t=n.simple().textContent(e.settings.formSubmitSuccessMessage||"Form properly submitted").toastClass("md-success-toast").parent(angular.element(document.querySelector("#chat-toolbar")));n.show(t)})).then(_).then(l).catch(u("submit")).finally(m):(m(),u("submit"))},d.skip=function(){_(),l()},d.form={},d.errors={}}function j(e,t){const n={id:"@id",token:e.settings.token},o={};return o.baseUrl=e.settings.remote+"/api/",o.chatWebsite=t(o.baseUrl+"chat/websites/:id",n,{notify:{method:"POST",url:o.baseUrl+"chat/websites/:id/notify"},offline:{method:"POST",url:o.baseUrl+"chat/websites/:id/offline"},getFields:{method:"GET",url:o.baseUrl+"chat/websites/:id/fields"}}),o.chatInteraction=t(o.baseUrl+"chat/interactions/:id",n,{update:{method:"PUT",url:o.baseUrl+"chat/interactions/:id"},customUpdate:{method:"PUT",url:o.baseUrl+"chat/interactions/:id/custom_update"},close:{method:"PUT",url:o.baseUrl+"chat/interactions/:id/close"},getMessages:{method:"GET",url:o.baseUrl+"chat/interactions/:intid/my_messages"},uploadAttachment:{method:"POST",url:o.baseUrl+"chat/interactions/:id/attachment_upload",headers:{"Content-Type":void 0},transformRequest:angular.identity},downloadAttachment:{method:"GET",url:o.baseUrl+"chat/interactions/:id/attachment_download"},abandon:{method:"PUT",url:o.baseUrl+"chat/interactions/:id/abandon"}}),o.chatMessage=t(o.baseUrl+"chat/messages/:id",n,{update:{method:"PUT",url:o.baseUrl+"chat/messages/:id"}}),o}k.$inject=["$rootScope","$state","$mdToast","api","$q","RemoteStorageService","STORAGE_VISITOR","STORAGE_LAYOUT"],j.$inject=["$rootScope","$resource"];var w=n("./node_modules/lodash.find/index.js"),b=n.n(w),D=n("./node_modules/lodash.values/index.js"),T=n.n(D),S=n("./node_modules/jquery/dist/jquery.js");function H(e,t,n,r,s,a,i,d,u,m,l,c){const h=this;let f,p,M,y;function L(){o.$q.all([m.removeItem(l).then((()=>console.debug("STORAGE_VISITOR cleared"))).catch(m.onStorageError),m.removeItem(c).then((()=>console.debug("STORAGE_LAYOUT cleared"))).catch(m.onStorageError)]).then((()=>{t.settings.online?a.go("app.online",null,{location:"replace"}):a.go("app.offline",null,{location:"replace"})}))}function g(){n((function(){const e=s[0].getElementsByClassName("chat-messages")[0];e&&(e.scrollTop=e.scrollHeight)}))}function Y(){h.errors={},t.$emit("hide");const e=d.simple().textContent("FILE TOO BIG: The max allowed size is 16MB").toastClass("md-warning-toast size "+t.settings.header_shape).parent(angular.element(document.querySelector("#chat-toolbar")));d.show(e)}function k(e){return function(t){h.errors[e]=t.data,g()}}function j(e){u.chatWebsite.notify(e).$promise.then((function(e){h.errors={};let n=!1;_()(t.visitor.interaction)&&(t.visitor.interaction={id:e.interaction.id},n=!0),t.visitor.interactionStarted||(t.visitor.interactionStarted=!0,n=!0),n&&m.updateStorage(l,t.visitor).then((e=>{t.visitor=e})).catch(m.onStorageError),f[0].emojioneArea.setText(""),g()})).catch(k("chatMessageError"))}function w(){t.visitor&&t.visitor.interaction&&t.visitor.interaction.id&&u.chatInteraction.get({id:t.visitor.interaction.id}).$promise.then((function(e){delete h.errors.getInteraction,e.closed&&(t.visitor.interaction.closed=!0,m.updateStorage(l,t.visitor).then((e=>{t.visitor=e})).catch(m.onStorageError),"unmanaged"===e.disposition?a.go("app.unmanaged",null,{location:"replace"}):a.go("app.closing",null,{location:"replace"}))})).catch((function(e){switch(e.status){case 403:a.go("app.closing",null,{location:"replace"});break;case 404:L();break;case 405:a.go("app.unmanaged",null,{location:"replace"});break;default:console.error(e)}}))}function D(e){const n=f[0].emojioneArea.getText();e&&13===e.keyCode&&e.shiftKey||e&&13!==e.keyCode||""!==n&&j(v()({body:n},t.visitor))}function H(){var e,n;null!=t&&null!==(e=t.visitor)&&void 0!==e&&null!==(n=e.interaction)&&void 0!==n&&n.id&&u.chatInteraction.getMessages({intid:t.visitor.interaction.id,includeAgent:!0,id:y||void 0}).$promise.then((function(e){if(delete h.errors.interaction,e.count){let o=!1,r=0;for(r=0,o=!1;r{t.visitor=e}))}var n})).catch((function(e){switch(e.status){case 403:a.go("app.closing",null,{location:"replace"});break;case 405:a.go("app.unmanaged",null,{location:"replace"});break;default:console.error(e)}}))}h.errors={},t.messages=[],h.emojiOptions={watchEmbedData:!1,fontSmiley:!1,emoji:!0,link:!0,linkTarget:"_blank"},h.ngFlowOptions={allowDuplicateUploads:!0},h.$onInit=function(){console.debug("ChatController::onInit() VISITOR",t.visitor),t.status="chat",t.loading=!1,t.settings.showMenu=!0,h.replyMessage="",t.visitor.interaction&&t.visitor.interaction.closed?L():(w(),p=r(H,2e3),M=r(w,3e3)),f=S("#emojionearea").emojioneArea({placeholder:t.settings.placeholderMessage||"Type a message",events:{keyup:function(e,t){D(t)},ready:function(){this.setFocus()}}})},h.reply=D,h.reply_button=function(){const e=f[0].emojioneArea.getText();""!==e&&(j(v()({body:e},t.visitor)),f[0].emojioneArea.setFocus())},h.fileAdded=function(e){if(e.size>16777216)return void Y();const n=new FormData;n.append("file",e.file),i.post(t.settings.remote+"/api/chat/interactions/"+t.visitor.interaction.id+"/attachment_upload?token="+t.settings.token,n,{transformRequest:angular.identity,headers:{"Content-Type":void 0}}).then((function(e){(e=e.data).id?(h.errors={},j(v()({body:''+e.name+"",AttachmentId:e.id},t.visitor))):k("sendAttachment")}),k("sendAttachment"))},h.handleSizeError=Y,e.$on("$destroy",(function(){r.cancel(p),r.cancel(M),p=null,M=null})),t.$on("$download",(function(e,n){n&&n(T()(t.messages))}))}H.$inject=["$scope","$rootScope","$timeout","$interval","$document","$state","$http","$mdToast","api","RemoteStorageService","STORAGE_VISITOR","STORAGE_LAYOUT"];var x=n("./node_modules/lodash.random/index.js"),E=n.n(x),P=n("./node_modules/lodash.clonedeep/index.js"),O=n.n(P),$=n("./node_modules/json-form-data/src/jsonToFormData.js"),A=n.n($);function R(e,t,n,o,r,s,a){const i=this;let d=null,u=null;t.typeField="";const m={showLeafArrayIndexes:!0,includeNullValues:!1,mapping:function(e){return"boolean"==typeof e?+e?"1":"0":e}};function l(){delete i.errors.submit,t.$emit("hide"),i.fields=O()(u),i.form={},i.userForm.$setPristine(),i.userForm.$setUntouched();const e=r.simple().textContent(t.settings.formSubmitSuccessMessage||"Form properly submitted").toastClass("md-success-toast size "+t.settings.header_shape).parent(angular.element(document.querySelector("#chat-toolbar")));r.show(e)}i.trustAsHtml=function(e){return n.trustAsHtml(e)},i.initUploadButton=function(n){const o=i.fields[n],a=s.find(".upload-item");if(a.length){const n=angular.element(a[0].querySelector(".upload-button")),s=angular.element(a[0].querySelector("input[type=file]")),d=n.find("label");d.length&&d.css("display","none"),n.on("click",(()=>{d.css("display","none"),"function"==typeof s.trigger?s.trigger("click"):s[0].click()})),s.on("change",(n=>{e.$apply((function(){"string"==typeof o.props.error&&(o.props.error=null);const e=Array.from(n.target.files),s=1048576*o.config.size;e.some((e=>e.size>=s))?(o.options=[],o.props.error=o.config.sizeErrMessage,function(e){i.errors={},t.$emit("hide");const n=r.simple().textContent("FILE TOO BIG: The max allowed size is "+e+"MB").toastClass("md-warning-toast size "+t.settings.header_shape).parent(angular.element(document.querySelector("#chat-toolbar")));r.show(n)}(o.config.size)):o.options=e.map((e=>{const{name:t,size:n,type:o}=e;return{name:t,size:n,type:o,file:e}})),i.form[o.props.title]=o.options}))}))}},i.removeFileItem=function(e,t){e.options.splice(t,1),i.form[e.props.title]=e.options},i.setupFileInput=function(e){console.log("form item setup",e);const t=s.find(".upload-item"),n=angular.element(t[0].querySelector("input[type=file]")),{multipleUpload:o,accept:r}=e.config;o&&n.attr("multiple","multiple"),r&&n[0].setAttribute("accept",r)},i.makeFileOptionsVisible=function(){const e=Array.from(s.find(".filename-label")),t=e[e.length-1];t&&t.scrollIntoView&&t.scrollIntoView()},i.$onInit=function(){console.debug("OfflineController::onInit() VISITOR",t.visitor),t.status="offline",i.visitor={id:t.settings.id,mapKeyOffline:"firstName",from:"Anonymous"+E()(1,1e6)},t.settings.showMenu=!1,t.loading=!1,o.chatWebsite.getFields({id:t.settings.id,online:!1}).$promise.then((function(e){e.count&&(d=e.fromKey,u=O()(e.rows),i.fields=O()(u))})).then((function(){for(let e=0;e]+)>)/i);i.checkHTML[e]=t(n.props.helpText)}}})).catch((function(e){console.error(e)}))},i.submit=function(){t.loading=!0;const e={...i.form};for(let n=0;ne.file))))}const n=Array.isArray(i.fields)?i.fields.filter((e=>"upload"===e.type)):[],s=v()({body:e},i.visitor),u=null!=e&&n.length>0,c=null!==e&&"{}"!==JSON.stringify(e);var h,f;(u?(h=s,a({url:`${o.baseUrl}chat/websites/${h.id}/offline`,headers:{"Content-Type":void 0},data:A()(h,{...m,initialFormData:new FormData}),method:"POST"})):c?o.chatWebsite.offline(s).$promise:Promise.reject("INVALID_FORM")).then(l).catch((f="submit",function(e){const n=r.simple().textContent(t.settings.formSubmitFailureMessage||"Form submission error").toastClass("md-failure-toast size "+t.settings.header_shape).parent(angular.element(document.querySelector("#chat-toolbar")));r.show(n),i.errors[f]=e.data})).finally((()=>{i.form.invalid||(i.form={}),t.loading=!1}))},i.toggle=function(e,t){i.form[e]||(i.form[e]=[]);const n=i.form[e].indexOf(t);n>-1?i.form[e].splice(n,1):i.form[e].push(t)},i.exists=function(e,t){return i.form[e]||(i.form[e]=[]),i.form[e].indexOf(t)>-1},i.checkHTML=[],i.form={},i.errors={},i.userForm={}}function F(e,t,n,o,r,s){const a=this;let i=null;function d(){return e.visitor={id:e.settings.id,mapKey:"firstName",from:"Anonymous"+E()(1,1e6)},e.settings.showMenu=!1,r.updateStorage(s,e.visitor).then((t=>(e.visitor=t,o.chatWebsite.getFields({id:e.settings.id,online:!0}).$promise.then((function(e){e.count&&(i=e.fromKey,a.fields=e.rows)})).then((function(){for(let e=0;e]+)>)/i);a.checkHTML[e]=n(t.props.helpText)}}})).catch((function(e){console.error(e)}))))).catch(r.onStorageError)}a.checkHTML=[],a.form={},a.errors={},a.userForm={},a.disableItem=!1,a.trustAsHtml=function(e){return n.trustAsHtml(e)},a.$onInit=function(){if(console.debug("OnlineController::onInit() VISITOR",e.visitor),e.status="online",e.visitor&&e.visitor.interaction)if(e.visitor.interaction.id)if(!0===e.visitor.interactionStarted)t.go("app.chat",null,{location:"replace"});else{var n,r;const t=e.visitor.interaction.id,s=null==e||null===(n=e.visitor)||void 0===n||null===(r=n.message)||void 0===r?void 0:r.id;if(s){const e={id:t,channel:"chat",interaction:{id:t},message:{id:s},disposition:"abandoned",closed:!0,closeReason:"contact"};o.chatInteraction.abandon(e).$promise.finally((()=>d()))}}else t.go("app.waiting",null,{location:"replace"});else d()},a.submit=function(){let n="New chat request \n";for(let t=0;t{e.visitor=t})).catch(r.onStorageError),a.disableItem=!1,e.settings.enableCustomerWriting?t.go("app.chat",null,{location:"replace"}):t.go("app.waiting",null,{location:"replace"})})).catch((function(e){a.disableItem=!1,console.error(e)}))},a.toggle=function(e,t){a.form[e]||(a.form[e]=[]);const n=a.form[e].indexOf(t);n>-1?a.form[e].splice(n,1):a.form[e].push(t)},a.exists=function(e,t){return a.form[e]||(a.form[e]=[]),a.form[e].indexOf(t)>-1}}function W(e,t,n,o,r,s,a,i){const d=this;function u(){e.settings.online?t.go("app.online",null,{location:"replace"}):t.go("app.offline",null,{location:"replace"})}function m(){d.form={},d.upColor=null,d.downColor=null,d.userForm.$setPristine(),d.userForm.$setUntouched(),e.visitor={},e.enableDownload=!1,e.$emit("hide")}function l(t){return function(o){d.errors[t]=o.data;const r=n.simple().textContent(e.settings.formSubmitFailureMessage||"Form submission error").toastClass("md-failure-toast").parent(angular.element(document.querySelector("#chat-toolbar")));n.show(r)}}function _(){e.loading=!1}d.form={},d.errors={},d.$onInit=function(){console.debug("UnmanagedController::onInit() VISITOR",e.visitor),e.status="unmanaged",r.all([s.removeItem(a).then((()=>console.debug("STORAGE_VISITOR cleared"))).catch(s.onStorageError),s.removeItem(i).then((()=>console.debug("STORAGE_LAYOUT cleared"))).catch(s.onStorageError)]).then((()=>e.loading=!1))},d.submit=function(){e.loading=!0,e.visitor.interaction&&e.visitor.interaction.id?o.chatInteraction.customUpdate({id:e.visitor.interaction.id,note:d.form.note}).$promise.then((function(){delete d.errors.submit;const t=n.simple().textContent(e.settings.formSubmitSuccessMessage||"Form properly submitted").toastClass("md-success-toast").parent(angular.element(document.querySelector("#chat-toolbar")));n.show(t)})).then(m).then(u).catch(l("submit")).finally(_):(_(),l("submit"))},d.skip=function(){m(),u()}}function C(e,t,n,o,r,s,a){let i=null;function d(){let t={},n=!1;r.chatInteraction.get({id:e.visitor.interaction.id}).$promise.then((function(n){return t=n,r.chatInteraction.getMessages({intid:e.visitor.interaction.id}).$promise})).then((function(r){n=r.rows.length>1,t.closed?(e.visitor.interaction.closed=!0,s.updateStorage(a,e.visitor).then((n=>{e.visitor=n,"unmanaged"===t.disposition&&o.go("app.unmanaged",null,{location:"replace"})})).catch(s.onStorageError)):(t.UserId||n)&&(t.UserId&&(e.visitor.interaction.UserId=t.UserId),s.updateStorage(a,{...e.visitor,interactionStarted:!0}).then((t=>{e.visitor=t,o.go("app.chat",null,{location:"replace"})})).catch(s.onStorageError))})).catch((function(e){switch(e.status){case 403:o.go("app.closing",null,{location:"replace"});break;case 405:o.go("app.unmanaged",null,{location:"replace"});break;default:console.error(e)}}))}this.$onInit=function(){console.debug("WaitingController::onInit() VISITOR",e.visitor),e.status="waiting",e.visitor&&e.visitor.interaction&&e.visitor.interaction.id&&(i=n(d,3e3))},t.$on("$destroy",(function(){n.cancel(i)}))}function I(e,t){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.add(e)}function z(e,t,n){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return n}R.$inject=["$scope","$rootScope","$sce","api","$mdToast","$element","$http"],F.$inject=["$rootScope","$state","$sce","api","RemoteStorageService","STORAGE_VISITOR"],W.$inject=["$rootScope","$state","$mdToast","api","$q","RemoteStorageService","STORAGE_VISITOR","STORAGE_LAYOUT"],C.$inject=["$rootScope","$scope","$interval","$state","api","RemoteStorageService","STORAGE_VISITOR"];var J=new WeakSet,V=new WeakSet;class N{constructor(e,t,n){I(this,V),I(this,J),this.remoteAddress=new URL(t.settings.address).origin,this.location=t.settings.location,this.$q=n,this.$window=e}setItem(e,t){const n="setItem";return this.$q((o=>{z(this,J,U).call(this,n,e,(()=>{o()})),this.$window.parent.postMessage({action:n,key:e,value:t},this.remoteAddress)}))}getItem(e){const t="getItem";return this.$q((n=>{z(this,J,U).call(this,t,e,((e,t)=>{n(t)})),this.$window.parent.postMessage({action:t,key:e},this.remoteAddress)}))}removeItem(e){const t="removeItem";return this.$q((n=>{z(this,J,U).call(this,t,e,(()=>{n()})),this.$window.parent.postMessage({action:t,key:e},this.remoteAddress)}))}updateStorage(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return this.getItem(e).then((o=>{const r=z(this,V,q).call(this,o)||{};return n?delete r[this.location]:r[this.location]=t,this.setItem(e,r).then((()=>r[this.location]))}))}onStorageError(e){console.error("Storage Error",e)}}function U(e,t,n){const o=r=>{const s=`${e}Result`;if(r.origin===this.remoteAddress&&t===r.data.key&&s===r.data.action){const{action:e,item:s}=r.data;switch(console.debug(`[Key = ${t}] Action "${e}" event from parent`,r),e){case"setItemResult":n(t);break;case"getItemResult":n(t,s);break;case"removeItemResult":n(t);break;default:console.debug("Unsupported action",e)}this.$window.removeEventListener("message",o,!1)}};this.$window.addEventListener("message",o,!1)}function q(e){let t=e;if("string"==typeof t)try{t=JSON.parse(e)}catch(n){console.warn(`Could not parse "${e}"`,n),t=e}return t}function G(e){return function(t){return e.trustAsHtml(t)}}N.$inject=["$window","$rootScope","$q"],G.$inject=["$sce"],angular.module("motion-chat",["ngAnimate","ngAria","ngMessages","ngMaterial","ngResource","ngSanitize","ngCsv","ngEmbed","ui.router","LocalStorageModule","ngRateIt","flow"]).filter("toTrusted",G).constant("STORAGE_PREFIX","motion_chat").constant("STORAGE_VISITOR","visitor").constant("STORAGE_LAYOUT","layout").service("RemoteStorageService",N).directive("ngEnter",(function(){return function(e,t,n){t.bind("keydown keypress",(function(t){13===t.which&&(e.$apply((function(){e.$eval(n.ngEnter)})),t.preventDefault())}))}})).directive("ngPrint",(function(){return{link:function(e,t){t.on("click",(function(){document.getElementById("chatContent1")&&function(e,t){const n=document.createElement("div"),o=t.visitor,r=t.settings;let a;for(let e=0;e"+document.title+""),i.document.write(""),i.document.write("

Website: "+r.referer+"

"),i.document.write("

Start Time: "+s()(a).format("YYYY-MM-DD HH:mm:ss")+"

"),i.document.write("

Print Time: "+s()().format("YYYY-MM-DD HH:mm:ss")+"

"),i.document.write(n.innerHTML),i.document.write(""),i.document.close(),i.focus(),i.print(),i.close()}(0,e)}))},restrict:"A"}})).controller("ChatController",H).controller("ClosingController",k).config(["$mdGestureProvider",function(e){e.skipClickHijack()}]).controller("IndexController",d).factory("api",j).config(g).run(L).controller("OfflineController",R).config(["$mdGestureProvider",function(e){e.skipClickHijack()}]).controller("OnlineController",F).controller("UnmanagedController",W).controller("WaitingController",C)},"./node_modules/expose-loader/dist/runtime/getGlobalThis.js":(e,t,n)=>{"use strict";e.exports=function(){if("object"==typeof globalThis)return globalThis;var e;try{e=this||new Function("return this")()}catch(e){if("object"==typeof window)return window;if("object"==typeof self)return self;if(void 0!==n.g)return n.g}return e}()},"./node_modules/json-form-data/src/jsonToFormData.js":function(e,t){var n,o;(o=this)||(o={}),void 0===(n=function(){return o.jsonToFormData=function(){function e(e){return"[object Array]"==={}.toString.call(e)}function t(t){return!(e(t)||"object"!=typeof t||!t||t instanceof Blob||t instanceof Date)}function n(){return"function"==typeof FormData}function o(){if(n())return new FormData}function r(n,o,s,a){var i=0;for(var d in n){if(n.hasOwnProperty(d)){var u=a||d,m=o.mapping(n[d]);if(a&&t(n)&&(u=a+"["+d+"]"),a&&e(n)&&(u=e(m)||o.showLeafArrayIndexes?a+"["+i+"]":a+"[]"),e(m)||t(m))r(m,o,s,u);else if(m instanceof FileList)for(var l=0;l=20?"ste":"de")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-dz.js":function(e,t,n){!function(e){"use strict";var t=function(e){return 0===e?0:1===e?1:2===e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},n={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية"],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة"],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة"],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم"],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر"],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام"]},o=function(e){return function(o,r,s,a){var i=t(o),d=n[e][t(o)];return 2===i&&(d=d[r?0:1]),d.replace(/%d/i,o)}},r=["جانفي","فيفري","مارس","أفريل","ماي","جوان","جويلية","أوت","سبتمبر","أكتوبر","نوفمبر","ديسمبر"];e.defineLocale("ar-dz",{months:r,monthsShort:r,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/‏M/‏YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,n){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:o("s"),ss:o("s"),m:o("m"),mm:o("m"),h:o("h"),hh:o("h"),d:o("d"),dd:o("d"),M:o("M"),MM:o("M"),y:o("y"),yy:o("y")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:0,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-kw.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ar-kw",{months:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekdays:"الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:0,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-ly.js":function(e,t,n){!function(e){"use strict";var t={1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",0:"0"},n=function(e){return 0===e?0:1===e?1:2===e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},o={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية"],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة"],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة"],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم"],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر"],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام"]},r=function(e){return function(t,r,s,a){var i=n(t),d=o[e][n(t)];return 2===i&&(d=d[r?0:1]),d.replace(/%d/i,t)}},s=["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر"];e.defineLocale("ar-ly",{months:s,monthsShort:s,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/‏M/‏YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,n){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:r("s"),ss:r("s"),m:r("m"),mm:r("m"),h:r("h"),hh:r("h"),d:r("d"),dd:r("d"),M:r("M"),MM:r("M"),y:r("y"),yy:r("y")},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-ma.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ar-ma",{months:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"احد_اثنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-sa.js":function(e,t,n){!function(e){"use strict";var t={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},n={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"};e.defineLocale("ar-sa",{months:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,n){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},preparse:function(e){return e.replace(/[١٢٣٤٥٦٧٨٩٠]/g,(function(e){return n[e]})).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar-tn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ar-tn",{months:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),monthsShort:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[اليوم على الساعة] LT",nextDay:"[غدا على الساعة] LT",nextWeek:"dddd [على الساعة] LT",lastDay:"[أمس على الساعة] LT",lastWeek:"dddd [على الساعة] LT",sameElse:"L"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",ss:"%d ثانية",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ar.js":function(e,t,n){!function(e){"use strict";var t={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},n={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},o=function(e){return 0===e?0:1===e?1:2===e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},r={s:["أقل من ثانية","ثانية واحدة",["ثانيتان","ثانيتين"],"%d ثوان","%d ثانية","%d ثانية"],m:["أقل من دقيقة","دقيقة واحدة",["دقيقتان","دقيقتين"],"%d دقائق","%d دقيقة","%d دقيقة"],h:["أقل من ساعة","ساعة واحدة",["ساعتان","ساعتين"],"%d ساعات","%d ساعة","%d ساعة"],d:["أقل من يوم","يوم واحد",["يومان","يومين"],"%d أيام","%d يومًا","%d يوم"],M:["أقل من شهر","شهر واحد",["شهران","شهرين"],"%d أشهر","%d شهرا","%d شهر"],y:["أقل من عام","عام واحد",["عامان","عامين"],"%d أعوام","%d عامًا","%d عام"]},s=function(e){return function(t,n,s,a){var i=o(t),d=r[e][o(t)];return 2===i&&(d=d[n?0:1]),d.replace(/%d/i,t)}},a=["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر"];e.defineLocale("ar",{months:a,monthsShort:a,weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/‏M/‏YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/ص|م/,isPM:function(e){return"م"===e},meridiem:function(e,t,n){return e<12?"ص":"م"},calendar:{sameDay:"[اليوم عند الساعة] LT",nextDay:"[غدًا عند الساعة] LT",nextWeek:"dddd [عند الساعة] LT",lastDay:"[أمس عند الساعة] LT",lastWeek:"dddd [عند الساعة] LT",sameElse:"L"},relativeTime:{future:"بعد %s",past:"منذ %s",s:s("s"),ss:s("s"),m:s("m"),mm:s("m"),h:s("h"),hh:s("h"),d:s("d"),dd:s("d"),M:s("M"),MM:s("M"),y:s("y"),yy:s("y")},preparse:function(e){return e.replace(/[١٢٣٤٥٦٧٨٩٠]/g,(function(e){return n[e]})).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/az.js":function(e,t,n){!function(e){"use strict";var t={1:"-inci",5:"-inci",8:"-inci",70:"-inci",80:"-inci",2:"-nci",7:"-nci",20:"-nci",50:"-nci",3:"-üncü",4:"-üncü",100:"-üncü",6:"-ncı",9:"-uncu",10:"-uncu",30:"-uncu",60:"-ıncı",90:"-ıncı"};e.defineLocale("az",{months:"yanvar_fevral_mart_aprel_may_iyun_iyul_avqust_sentyabr_oktyabr_noyabr_dekabr".split("_"),monthsShort:"yan_fev_mar_apr_may_iyn_iyl_avq_sen_okt_noy_dek".split("_"),weekdays:"Bazar_Bazar ertəsi_Çərşənbə axşamı_Çərşənbə_Cümə axşamı_Cümə_Şənbə".split("_"),weekdaysShort:"Baz_BzE_ÇAx_Çər_CAx_Cüm_Şən".split("_"),weekdaysMin:"Bz_BE_ÇA_Çə_CA_Cü_Şə".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[sabah saat] LT",nextWeek:"[gələn həftə] dddd [saat] LT",lastDay:"[dünən] LT",lastWeek:"[keçən həftə] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s əvvəl",s:"bir neçə saniyə",ss:"%d saniyə",m:"bir dəqiqə",mm:"%d dəqiqə",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir il",yy:"%d il"},meridiemParse:/gecə|səhər|gündüz|axşam/,isPM:function(e){return/^(gündüz|axşam)$/.test(e)},meridiem:function(e,t,n){return e<4?"gecə":e<12?"səhər":e<17?"gündüz":"axşam"},dayOfMonthOrdinalParse:/\d{1,2}-(ıncı|inci|nci|üncü|ncı|uncu)/,ordinal:function(e){if(0===e)return e+"-ıncı";var n=e%10;return e+(t[n]||t[e%100-n]||t[e>=100?100:null])},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/be.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){return"m"===n?t?"хвіліна":"хвіліну":"h"===n?t?"гадзіна":"гадзіну":e+" "+(o=+e,r={ss:t?"секунда_секунды_секунд":"секунду_секунды_секунд",mm:t?"хвіліна_хвіліны_хвілін":"хвіліну_хвіліны_хвілін",hh:t?"гадзіна_гадзіны_гадзін":"гадзіну_гадзіны_гадзін",dd:"дзень_дні_дзён",MM:"месяц_месяцы_месяцаў",yy:"год_гады_гадоў"}[n].split("_"),o%10==1&&o%100!=11?r[0]:o%10>=2&&o%10<=4&&(o%100<10||o%100>=20)?r[1]:r[2]);var o,r}e.defineLocale("be",{months:{format:"студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня".split("_"),standalone:"студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань".split("_")},monthsShort:"студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж".split("_"),weekdays:{format:"нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу".split("_"),standalone:"нядзеля_панядзелак_аўторак_серада_чацвер_пятніца_субота".split("_"),isFormat:/\[ ?[Ууў] ?(?:мінулую|наступную)? ?\] ?dddd/},weekdaysShort:"нд_пн_ат_ср_чц_пт_сб".split("_"),weekdaysMin:"нд_пн_ат_ср_чц_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., HH:mm",LLLL:"dddd, D MMMM YYYY г., HH:mm"},calendar:{sameDay:"[Сёння ў] LT",nextDay:"[Заўтра ў] LT",lastDay:"[Учора ў] LT",nextWeek:function(){return"[У] dddd [ў] LT"},lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return"[У мінулую] dddd [ў] LT";case 1:case 2:case 4:return"[У мінулы] dddd [ў] LT"}},sameElse:"L"},relativeTime:{future:"праз %s",past:"%s таму",s:"некалькі секунд",m:t,mm:t,h:t,hh:t,d:"дзень",dd:t,M:"месяц",MM:t,y:"год",yy:t},meridiemParse:/ночы|раніцы|дня|вечара/,isPM:function(e){return/^(дня|вечара)$/.test(e)},meridiem:function(e,t,n){return e<4?"ночы":e<12?"раніцы":e<17?"дня":"вечара"},dayOfMonthOrdinalParse:/\d{1,2}-(і|ы|га)/,ordinal:function(e,t){switch(t){case"M":case"d":case"DDD":case"w":case"W":return e%10!=2&&e%10!=3||e%100==12||e%100==13?e+"-ы":e+"-і";case"D":return e+"-га";default:return e}},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bg.js":function(e,t,n){!function(e){"use strict";e.defineLocale("bg",{months:"януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември".split("_"),monthsShort:"яну_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек".split("_"),weekdays:"неделя_понеделник_вторник_сряда_четвъртък_петък_събота".split("_"),weekdaysShort:"нед_пон_вто_сря_чет_пет_съб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[Днес в] LT",nextDay:"[Утре в] LT",nextWeek:"dddd [в] LT",lastDay:"[Вчера в] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[Миналата] dddd [в] LT";case 1:case 2:case 4:case 5:return"[Миналия] dddd [в] LT"}},sameElse:"L"},relativeTime:{future:"след %s",past:"преди %s",s:"няколко секунди",ss:"%d секунди",m:"минута",mm:"%d минути",h:"час",hh:"%d часа",d:"ден",dd:"%d дена",w:"седмица",ww:"%d седмици",M:"месец",MM:"%d месеца",y:"година",yy:"%d години"},dayOfMonthOrdinalParse:/\d{1,2}-(ев|ен|ти|ви|ри|ми)/,ordinal:function(e){var t=e%10,n=e%100;return 0===e?e+"-ев":0===n?e+"-ен":n>10&&n<20?e+"-ти":1===t?e+"-ви":2===t?e+"-ри":7===t||8===t?e+"-ми":e+"-ти"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bm.js":function(e,t,n){!function(e){"use strict";e.defineLocale("bm",{months:"Zanwuyekalo_Fewuruyekalo_Marisikalo_Awirilikalo_Mɛkalo_Zuwɛnkalo_Zuluyekalo_Utikalo_Sɛtanburukalo_ɔkutɔburukalo_Nowanburukalo_Desanburukalo".split("_"),monthsShort:"Zan_Few_Mar_Awi_Mɛ_Zuw_Zul_Uti_Sɛt_ɔku_Now_Des".split("_"),weekdays:"Kari_Ntɛnɛn_Tarata_Araba_Alamisa_Juma_Sibiri".split("_"),weekdaysShort:"Kar_Ntɛ_Tar_Ara_Ala_Jum_Sib".split("_"),weekdaysMin:"Ka_Nt_Ta_Ar_Al_Ju_Si".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"MMMM [tile] D [san] YYYY",LLL:"MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm",LLLL:"dddd MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm"},calendar:{sameDay:"[Bi lɛrɛ] LT",nextDay:"[Sini lɛrɛ] LT",nextWeek:"dddd [don lɛrɛ] LT",lastDay:"[Kunu lɛrɛ] LT",lastWeek:"dddd [tɛmɛnen lɛrɛ] LT",sameElse:"L"},relativeTime:{future:"%s kɔnɔ",past:"a bɛ %s bɔ",s:"sanga dama dama",ss:"sekondi %d",m:"miniti kelen",mm:"miniti %d",h:"lɛrɛ kelen",hh:"lɛrɛ %d",d:"tile kelen",dd:"tile %d",M:"kalo kelen",MM:"kalo %d",y:"san kelen",yy:"san %d"},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bn-bd.js":function(e,t,n){!function(e){"use strict";var t={1:"১",2:"২",3:"৩",4:"৪",5:"৫",6:"৬",7:"৭",8:"৮",9:"৯",0:"০"},n={"১":"1","২":"2","৩":"3","৪":"4","৫":"5","৬":"6","৭":"7","৮":"8","৯":"9","০":"0"};e.defineLocale("bn-bd",{months:"জানুয়ারি_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর".split("_"),monthsShort:"জানু_ফেব্রু_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্ট_অক্টো_নভে_ডিসে".split("_"),weekdays:"রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার".split("_"),weekdaysShort:"রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি".split("_"),weekdaysMin:"রবি_সোম_মঙ্গল_বুধ_বৃহ_শুক্র_শনি".split("_"),longDateFormat:{LT:"A h:mm সময়",LTS:"A h:mm:ss সময়",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm সময়",LLLL:"dddd, D MMMM YYYY, A h:mm সময়"},calendar:{sameDay:"[আজ] LT",nextDay:"[আগামীকাল] LT",nextWeek:"dddd, LT",lastDay:"[গতকাল] LT",lastWeek:"[গত] dddd, LT",sameElse:"L"},relativeTime:{future:"%s পরে",past:"%s আগে",s:"কয়েক সেকেন্ড",ss:"%d সেকেন্ড",m:"এক মিনিট",mm:"%d মিনিট",h:"এক ঘন্টা",hh:"%d ঘন্টা",d:"এক দিন",dd:"%d দিন",M:"এক মাস",MM:"%d মাস",y:"এক বছর",yy:"%d বছর"},preparse:function(e){return e.replace(/[১২৩৪৫৬৭৮৯০]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/রাত|ভোর|সকাল|দুপুর|বিকাল|সন্ধ্যা|রাত/,meridiemHour:function(e,t){return 12===e&&(e=0),"রাত"===t?e<4?e:e+12:"ভোর"===t||"সকাল"===t?e:"দুপুর"===t?e>=3?e:e+12:"বিকাল"===t||"সন্ধ্যা"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"রাত":e<6?"ভোর":e<12?"সকাল":e<15?"দুপুর":e<18?"বিকাল":e<20?"সন্ধ্যা":"রাত"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bn.js":function(e,t,n){!function(e){"use strict";var t={1:"১",2:"২",3:"৩",4:"৪",5:"৫",6:"৬",7:"৭",8:"৮",9:"৯",0:"০"},n={"১":"1","২":"2","৩":"3","৪":"4","৫":"5","৬":"6","৭":"7","৮":"8","৯":"9","০":"0"};e.defineLocale("bn",{months:"জানুয়ারি_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর".split("_"),monthsShort:"জানু_ফেব্রু_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্ট_অক্টো_নভে_ডিসে".split("_"),weekdays:"রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার".split("_"),weekdaysShort:"রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি".split("_"),weekdaysMin:"রবি_সোম_মঙ্গল_বুধ_বৃহ_শুক্র_শনি".split("_"),longDateFormat:{LT:"A h:mm সময়",LTS:"A h:mm:ss সময়",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm সময়",LLLL:"dddd, D MMMM YYYY, A h:mm সময়"},calendar:{sameDay:"[আজ] LT",nextDay:"[আগামীকাল] LT",nextWeek:"dddd, LT",lastDay:"[গতকাল] LT",lastWeek:"[গত] dddd, LT",sameElse:"L"},relativeTime:{future:"%s পরে",past:"%s আগে",s:"কয়েক সেকেন্ড",ss:"%d সেকেন্ড",m:"এক মিনিট",mm:"%d মিনিট",h:"এক ঘন্টা",hh:"%d ঘন্টা",d:"এক দিন",dd:"%d দিন",M:"এক মাস",MM:"%d মাস",y:"এক বছর",yy:"%d বছর"},preparse:function(e){return e.replace(/[১২৩৪৫৬৭৮৯০]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/রাত|সকাল|দুপুর|বিকাল|রাত/,meridiemHour:function(e,t){return 12===e&&(e=0),"রাত"===t&&e>=4||"দুপুর"===t&&e<5||"বিকাল"===t?e+12:e},meridiem:function(e,t,n){return e<4?"রাত":e<10?"সকাল":e<17?"দুপুর":e<20?"বিকাল":"রাত"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bo.js":function(e,t,n){!function(e){"use strict";var t={1:"༡",2:"༢",3:"༣",4:"༤",5:"༥",6:"༦",7:"༧",8:"༨",9:"༩",0:"༠"},n={"༡":"1","༢":"2","༣":"3","༤":"4","༥":"5","༦":"6","༧":"7","༨":"8","༩":"9","༠":"0"};e.defineLocale("bo",{months:"ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ".split("_"),monthsShort:"ཟླ་1_ཟླ་2_ཟླ་3_ཟླ་4_ཟླ་5_ཟླ་6_ཟླ་7_ཟླ་8_ཟླ་9_ཟླ་10_ཟླ་11_ཟླ་12".split("_"),monthsShortRegex:/^(ཟླ་\d{1,2})/,monthsParseExact:!0,weekdays:"གཟའ་ཉི་མ་_གཟའ་ཟླ་བ་_གཟའ་མིག་དམར་_གཟའ་ལྷག་པ་_གཟའ་ཕུར་བུ_གཟའ་པ་སངས་_གཟའ་སྤེན་པ་".split("_"),weekdaysShort:"ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་".split("_"),weekdaysMin:"ཉི_ཟླ_མིག_ལྷག_ཕུར_སངས_སྤེན".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[དི་རིང] LT",nextDay:"[སང་ཉིན] LT",nextWeek:"[བདུན་ཕྲག་རྗེས་མ], LT",lastDay:"[ཁ་སང] LT",lastWeek:"[བདུན་ཕྲག་མཐའ་མ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ལ་",past:"%s སྔན་ལ",s:"ལམ་སང",ss:"%d སྐར་ཆ།",m:"སྐར་མ་གཅིག",mm:"%d སྐར་མ",h:"ཆུ་ཚོད་གཅིག",hh:"%d ཆུ་ཚོད",d:"ཉིན་གཅིག",dd:"%d ཉིན་",M:"ཟླ་བ་གཅིག",MM:"%d ཟླ་བ",y:"ལོ་གཅིག",yy:"%d ལོ"},preparse:function(e){return e.replace(/[༡༢༣༤༥༦༧༨༩༠]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/མཚན་མོ|ཞོགས་ཀས|ཉིན་གུང|དགོང་དག|མཚན་མོ/,meridiemHour:function(e,t){return 12===e&&(e=0),"མཚན་མོ"===t&&e>=4||"ཉིན་གུང"===t&&e<5||"དགོང་དག"===t?e+12:e},meridiem:function(e,t,n){return e<4?"མཚན་མོ":e<10?"ཞོགས་ཀས":e<17?"ཉིན་གུང":e<20?"དགོང་དག":"མཚན་མོ"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/br.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){return e+" "+function(e,t){return 2===t?function(e){var t={m:"v",b:"v",d:"z"};return void 0===t[e.charAt(0)]?e:t[e.charAt(0)]+e.substring(1)}(e):e}({mm:"munutenn",MM:"miz",dd:"devezh"}[n],e)}function n(e){return e>9?n(e%10):e}var o=[/^gen/i,/^c[ʼ\']hwe/i,/^meu/i,/^ebr/i,/^mae/i,/^(mez|eve)/i,/^gou/i,/^eos/i,/^gwe/i,/^her/i,/^du/i,/^ker/i],r=/^(genver|c[ʼ\']hwevrer|meurzh|ebrel|mae|mezheven|gouere|eost|gwengolo|here|du|kerzu|gen|c[ʼ\']hwe|meu|ebr|mae|eve|gou|eos|gwe|her|du|ker)/i,s=[/^Su/i,/^Lu/i,/^Me([^r]|$)/i,/^Mer/i,/^Ya/i,/^Gw/i,/^Sa/i];e.defineLocale("br",{months:"Genver_Cʼhwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu".split("_"),monthsShort:"Gen_Cʼhwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker".split("_"),weekdays:"Sul_Lun_Meurzh_Mercʼher_Yaou_Gwener_Sadorn".split("_"),weekdaysShort:"Sul_Lun_Meu_Mer_Yao_Gwe_Sad".split("_"),weekdaysMin:"Su_Lu_Me_Mer_Ya_Gw_Sa".split("_"),weekdaysParse:s,fullWeekdaysParse:[/^sul/i,/^lun/i,/^meurzh/i,/^merc[ʼ\']her/i,/^yaou/i,/^gwener/i,/^sadorn/i],shortWeekdaysParse:[/^Sul/i,/^Lun/i,/^Meu/i,/^Mer/i,/^Yao/i,/^Gwe/i,/^Sad/i],minWeekdaysParse:s,monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(genver|c[ʼ\']hwevrer|meurzh|ebrel|mae|mezheven|gouere|eost|gwengolo|here|du|kerzu)/i,monthsShortStrictRegex:/^(gen|c[ʼ\']hwe|meu|ebr|mae|eve|gou|eos|gwe|her|du|ker)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [a viz] MMMM YYYY",LLL:"D [a viz] MMMM YYYY HH:mm",LLLL:"dddd, D [a viz] MMMM YYYY HH:mm"},calendar:{sameDay:"[Hiziv da] LT",nextDay:"[Warcʼhoazh da] LT",nextWeek:"dddd [da] LT",lastDay:"[Decʼh da] LT",lastWeek:"dddd [paset da] LT",sameElse:"L"},relativeTime:{future:"a-benn %s",past:"%s ʼzo",s:"un nebeud segondennoù",ss:"%d eilenn",m:"ur vunutenn",mm:t,h:"un eur",hh:"%d eur",d:"un devezh",dd:t,M:"ur miz",MM:t,y:"ur bloaz",yy:function(e){switch(n(e)){case 1:case 3:case 4:case 5:case 9:return e+" bloaz";default:return e+" vloaz"}}},dayOfMonthOrdinalParse:/\d{1,2}(añ|vet)/,ordinal:function(e){return e+(1===e?"añ":"vet")},week:{dow:1,doy:4},meridiemParse:/a.m.|g.m./,isPM:function(e){return"g.m."===e},meridiem:function(e,t,n){return e<12?"a.m.":"g.m."}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/bs.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){var o=e+" ";switch(n){case"ss":return o+(1===e?"sekunda":2===e||3===e||4===e?"sekunde":"sekundi");case"m":return t?"jedna minuta":"jedne minute";case"mm":return o+(1===e?"minuta":2===e||3===e||4===e?"minute":"minuta");case"h":return t?"jedan sat":"jednog sata";case"hh":return o+(1===e?"sat":2===e||3===e||4===e?"sata":"sati");case"dd":return o+(1===e?"dan":"dana");case"MM":return o+(1===e?"mjesec":2===e||3===e||4===e?"mjeseca":"mjeseci");case"yy":return o+(1===e?"godina":2===e||3===e||4===e?"godine":"godina")}}e.defineLocale("bs",{months:"januar_februar_mart_april_maj_juni_juli_august_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[jučer u] LT",lastWeek:function(){switch(this.day()){case 0:case 3:return"[prošlu] dddd [u] LT";case 6:return"[prošle] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[prošli] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",ss:t,m:t,mm:t,h:t,hh:t,d:"dan",dd:t,M:"mjesec",MM:t,y:"godinu",yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ca.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ca",{months:{standalone:"gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre".split("_"),format:"de gener_de febrer_de març_d'abril_de maig_de juny_de juliol_d'agost_de setembre_d'octubre_de novembre_de desembre".split("_"),isFormat:/D[oD]?(\s)+MMMM/},monthsShort:"gen._febr._març_abr._maig_juny_jul._ag._set._oct._nov._des.".split("_"),monthsParseExact:!0,weekdays:"diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte".split("_"),weekdaysShort:"dg._dl._dt._dc._dj._dv._ds.".split("_"),weekdaysMin:"dg_dl_dt_dc_dj_dv_ds".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [de] YYYY",ll:"D MMM YYYY",LLL:"D MMMM [de] YYYY [a les] H:mm",lll:"D MMM YYYY, H:mm",LLLL:"dddd D MMMM [de] YYYY [a les] H:mm",llll:"ddd D MMM YYYY, H:mm"},calendar:{sameDay:function(){return"[avui a "+(1!==this.hours()?"les":"la")+"] LT"},nextDay:function(){return"[demà a "+(1!==this.hours()?"les":"la")+"] LT"},nextWeek:function(){return"dddd [a "+(1!==this.hours()?"les":"la")+"] LT"},lastDay:function(){return"[ahir a "+(1!==this.hours()?"les":"la")+"] LT"},lastWeek:function(){return"[el] dddd [passat a "+(1!==this.hours()?"les":"la")+"] LT"},sameElse:"L"},relativeTime:{future:"d'aquí %s",past:"fa %s",s:"uns segons",ss:"%d segons",m:"un minut",mm:"%d minuts",h:"una hora",hh:"%d hores",d:"un dia",dd:"%d dies",M:"un mes",MM:"%d mesos",y:"un any",yy:"%d anys"},dayOfMonthOrdinalParse:/\d{1,2}(r|n|t|è|a)/,ordinal:function(e,t){var n=1===e?"r":2===e?"n":3===e?"r":4===e?"t":"è";return"w"!==t&&"W"!==t||(n="a"),e+n},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/cs.js":function(e,t,n){!function(e){"use strict";var t="leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec".split("_"),n="led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro".split("_"),o=[/^led/i,/^úno/i,/^bře/i,/^dub/i,/^kvě/i,/^(čvn|červen$|června)/i,/^(čvc|červenec|července)/i,/^srp/i,/^zář/i,/^říj/i,/^lis/i,/^pro/i],r=/^(leden|únor|březen|duben|květen|červenec|července|červen|června|srpen|září|říjen|listopad|prosinec|led|úno|bře|dub|kvě|čvn|čvc|srp|zář|říj|lis|pro)/i;function s(e){return e>1&&e<5&&1!=~~(e/10)}function a(e,t,n,o){var r=e+" ";switch(n){case"s":return t||o?"pár sekund":"pár sekundami";case"ss":return t||o?r+(s(e)?"sekundy":"sekund"):r+"sekundami";case"m":return t?"minuta":o?"minutu":"minutou";case"mm":return t||o?r+(s(e)?"minuty":"minut"):r+"minutami";case"h":return t?"hodina":o?"hodinu":"hodinou";case"hh":return t||o?r+(s(e)?"hodiny":"hodin"):r+"hodinami";case"d":return t||o?"den":"dnem";case"dd":return t||o?r+(s(e)?"dny":"dní"):r+"dny";case"M":return t||o?"měsíc":"měsícem";case"MM":return t||o?r+(s(e)?"měsíce":"měsíců"):r+"měsíci";case"y":return t||o?"rok":"rokem";case"yy":return t||o?r+(s(e)?"roky":"let"):r+"lety"}}e.defineLocale("cs",{months:t,monthsShort:n,monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(leden|ledna|února|únor|březen|března|duben|dubna|květen|května|červenec|července|červen|června|srpen|srpna|září|říjen|října|listopadu|listopad|prosinec|prosince)/i,monthsShortStrictRegex:/^(led|úno|bře|dub|kvě|čvn|čvc|srp|zář|říj|lis|pro)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota".split("_"),weekdaysShort:"ne_po_út_st_čt_pá_so".split("_"),weekdaysMin:"ne_po_út_st_čt_pá_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm",l:"D. M. YYYY"},calendar:{sameDay:"[dnes v] LT",nextDay:"[zítra v] LT",nextWeek:function(){switch(this.day()){case 0:return"[v neděli v] LT";case 1:case 2:return"[v] dddd [v] LT";case 3:return"[ve středu v] LT";case 4:return"[ve čtvrtek v] LT";case 5:return"[v pátek v] LT";case 6:return"[v sobotu v] LT"}},lastDay:"[včera v] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulou neděli v] LT";case 1:case 2:return"[minulé] dddd [v] LT";case 3:return"[minulou středu v] LT";case 4:case 5:return"[minulý] dddd [v] LT";case 6:return"[minulou sobotu v] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"před %s",s:a,ss:a,m:a,mm:a,h:a,hh:a,d:a,dd:a,M:a,MM:a,y:a,yy:a},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/cv.js":function(e,t,n){!function(e){"use strict";e.defineLocale("cv",{months:"кӑрлач_нарӑс_пуш_ака_май_ҫӗртме_утӑ_ҫурла_авӑн_юпа_чӳк_раштав".split("_"),monthsShort:"кӑр_нар_пуш_ака_май_ҫӗр_утӑ_ҫур_авн_юпа_чӳк_раш".split("_"),weekdays:"вырсарникун_тунтикун_ытларикун_юнкун_кӗҫнерникун_эрнекун_шӑматкун".split("_"),weekdaysShort:"выр_тун_ытл_юн_кӗҫ_эрн_шӑм".split("_"),weekdaysMin:"вр_тн_ыт_юн_кҫ_эр_шм".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ]",LLL:"YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm",LLLL:"dddd, YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm"},calendar:{sameDay:"[Паян] LT [сехетре]",nextDay:"[Ыран] LT [сехетре]",lastDay:"[Ӗнер] LT [сехетре]",nextWeek:"[Ҫитес] dddd LT [сехетре]",lastWeek:"[Иртнӗ] dddd LT [сехетре]",sameElse:"L"},relativeTime:{future:function(e){return e+(/сехет$/i.exec(e)?"рен":/ҫул$/i.exec(e)?"тан":"ран")},past:"%s каялла",s:"пӗр-ик ҫеккунт",ss:"%d ҫеккунт",m:"пӗр минут",mm:"%d минут",h:"пӗр сехет",hh:"%d сехет",d:"пӗр кун",dd:"%d кун",M:"пӗр уйӑх",MM:"%d уйӑх",y:"пӗр ҫул",yy:"%d ҫул"},dayOfMonthOrdinalParse:/\d{1,2}-мӗш/,ordinal:"%d-мӗш",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/cy.js":function(e,t,n){!function(e){"use strict";e.defineLocale("cy",{months:"Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr".split("_"),monthsShort:"Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag".split("_"),weekdays:"Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn".split("_"),weekdaysShort:"Sul_Llun_Maw_Mer_Iau_Gwe_Sad".split("_"),weekdaysMin:"Su_Ll_Ma_Me_Ia_Gw_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Heddiw am] LT",nextDay:"[Yfory am] LT",nextWeek:"dddd [am] LT",lastDay:"[Ddoe am] LT",lastWeek:"dddd [diwethaf am] LT",sameElse:"L"},relativeTime:{future:"mewn %s",past:"%s yn ôl",s:"ychydig eiliadau",ss:"%d eiliad",m:"munud",mm:"%d munud",h:"awr",hh:"%d awr",d:"diwrnod",dd:"%d diwrnod",M:"mis",MM:"%d mis",y:"blwyddyn",yy:"%d flynedd"},dayOfMonthOrdinalParse:/\d{1,2}(fed|ain|af|il|ydd|ed|eg)/,ordinal:function(e){var t="";return e>20?t=40===e||50===e||60===e||80===e||100===e?"fed":"ain":e>0&&(t=["","af","il","ydd","ydd","ed","ed","ed","fed","fed","fed","eg","fed","eg","eg","fed","eg","eg","fed","eg","fed"][e]),e+t},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/da.js":function(e,t,n){!function(e){"use strict";e.defineLocale("da",{months:"januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"søn_man_tir_ons_tor_fre_lør".split("_"),weekdaysMin:"sø_ma_ti_on_to_fr_lø".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd [d.] D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[i dag kl.] LT",nextDay:"[i morgen kl.] LT",nextWeek:"på dddd [kl.] LT",lastDay:"[i går kl.] LT",lastWeek:"[i] dddd[s kl.] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s siden",s:"få sekunder",ss:"%d sekunder",m:"et minut",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dage",M:"en måned",MM:"%d måneder",y:"et år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/de-at.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?r[n][0]:r[n][1]}e.defineLocale("de-at",{months:"Jänner_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jän._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:t,mm:"%d Minuten",h:t,hh:"%d Stunden",d:t,dd:t,w:t,ww:"%d Wochen",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/de-ch.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?r[n][0]:r[n][1]}e.defineLocale("de-ch",{months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:t,mm:"%d Minuten",h:t,hh:"%d Stunden",d:t,dd:t,w:t,ww:"%d Wochen",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/de.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?r[n][0]:r[n][1]}e.defineLocale("de",{months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:t,mm:"%d Minuten",h:t,hh:"%d Stunden",d:t,dd:t,w:t,ww:"%d Wochen",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/dv.js":function(e,t,n){!function(e){"use strict";var t=["ޖެނުއަރީ","ފެބްރުއަރީ","މާރިޗު","އޭޕްރީލު","މޭ","ޖޫން","ޖުލައި","އޯގަސްޓު","ސެޕްޓެމްބަރު","އޮކްޓޯބަރު","ނޮވެމްބަރު","ޑިސެމްބަރު"],n=["އާދިއްތަ","ހޯމަ","އަންގާރަ","ބުދަ","ބުރާސްފަތި","ހުކުރު","ހޮނިހިރު"];e.defineLocale("dv",{months:t,monthsShort:t,weekdays:n,weekdaysShort:n,weekdaysMin:"އާދި_ހޯމަ_އަން_ބުދަ_ބުރާ_ހުކު_ހޮނި".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/M/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/މކ|މފ/,isPM:function(e){return"މފ"===e},meridiem:function(e,t,n){return e<12?"މކ":"މފ"},calendar:{sameDay:"[މިއަދު] LT",nextDay:"[މާދަމާ] LT",nextWeek:"dddd LT",lastDay:"[އިއްޔެ] LT",lastWeek:"[ފާއިތުވި] dddd LT",sameElse:"L"},relativeTime:{future:"ތެރޭގައި %s",past:"ކުރިން %s",s:"ސިކުންތުކޮޅެއް",ss:"d% ސިކުންތު",m:"މިނިޓެއް",mm:"މިނިޓު %d",h:"ގަޑިއިރެއް",hh:"ގަޑިއިރު %d",d:"ދުވަހެއް",dd:"ދުވަސް %d",M:"މަހެއް",MM:"މަސް %d",y:"އަހަރެއް",yy:"އަހަރު %d"},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:7,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/el.js":function(e,t,n){!function(e){"use strict";e.defineLocale("el",{monthsNominativeEl:"Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος".split("_"),monthsGenitiveEl:"Ιανουαρίου_Φεβρουαρίου_Μαρτίου_Απριλίου_Μαΐου_Ιουνίου_Ιουλίου_Αυγούστου_Σεπτεμβρίου_Οκτωβρίου_Νοεμβρίου_Δεκεμβρίου".split("_"),months:function(e,t){return e?"string"==typeof t&&/D/.test(t.substring(0,t.indexOf("MMMM")))?this._monthsGenitiveEl[e.month()]:this._monthsNominativeEl[e.month()]:this._monthsNominativeEl},monthsShort:"Ιαν_Φεβ_Μαρ_Απρ_Μαϊ_Ιουν_Ιουλ_Αυγ_Σεπ_Οκτ_Νοε_Δεκ".split("_"),weekdays:"Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο".split("_"),weekdaysShort:"Κυρ_Δευ_Τρι_Τετ_Πεμ_Παρ_Σαβ".split("_"),weekdaysMin:"Κυ_Δε_Τρ_Τε_Πε_Πα_Σα".split("_"),meridiem:function(e,t,n){return e>11?n?"μμ":"ΜΜ":n?"πμ":"ΠΜ"},isPM:function(e){return"μ"===(e+"").toLowerCase()[0]},meridiemParse:/[ΠΜ]\.?Μ?\.?/i,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendarEl:{sameDay:"[Σήμερα {}] LT",nextDay:"[Αύριο {}] LT",nextWeek:"dddd [{}] LT",lastDay:"[Χθες {}] LT",lastWeek:function(){switch(this.day()){case 6:return"[το προηγούμενο] dddd [{}] LT";default:return"[την προηγούμενη] dddd [{}] LT"}},sameElse:"L"},calendar:function(e,t){var n,o=this._calendarEl[e],r=t&&t.hours();return n=o,("undefined"!=typeof Function&&n instanceof Function||"[object Function]"===Object.prototype.toString.call(n))&&(o=o.apply(t)),o.replace("{}",r%12==1?"στη":"στις")},relativeTime:{future:"σε %s",past:"%s πριν",s:"λίγα δευτερόλεπτα",ss:"%d δευτερόλεπτα",m:"ένα λεπτό",mm:"%d λεπτά",h:"μία ώρα",hh:"%d ώρες",d:"μία μέρα",dd:"%d μέρες",M:"ένας μήνας",MM:"%d μήνες",y:"ένας χρόνος",yy:"%d χρόνια"},dayOfMonthOrdinalParse:/\d{1,2}η/,ordinal:"%dη",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-au.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-au",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:0,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-ca.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-ca",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"YYYY-MM-DD",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-gb.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-gb",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-ie.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-ie",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-il.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-il",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-in.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-in",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-nz.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-nz",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/en-sg.js":function(e,t,n){!function(e){"use strict";e.defineLocale("en-sg",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/eo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("eo",{months:"januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro".split("_"),monthsShort:"jan_feb_mart_apr_maj_jun_jul_aŭg_sept_okt_nov_dec".split("_"),weekdays:"dimanĉo_lundo_mardo_merkredo_ĵaŭdo_vendredo_sabato".split("_"),weekdaysShort:"dim_lun_mard_merk_ĵaŭ_ven_sab".split("_"),weekdaysMin:"di_lu_ma_me_ĵa_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"[la] D[-an de] MMMM, YYYY",LLL:"[la] D[-an de] MMMM, YYYY HH:mm",LLLL:"dddd[n], [la] D[-an de] MMMM, YYYY HH:mm",llll:"ddd, [la] D[-an de] MMM, YYYY HH:mm"},meridiemParse:/[ap]\.t\.m/i,isPM:function(e){return"p"===e.charAt(0).toLowerCase()},meridiem:function(e,t,n){return e>11?n?"p.t.m.":"P.T.M.":n?"a.t.m.":"A.T.M."},calendar:{sameDay:"[Hodiaŭ je] LT",nextDay:"[Morgaŭ je] LT",nextWeek:"dddd[n je] LT",lastDay:"[Hieraŭ je] LT",lastWeek:"[pasintan] dddd[n je] LT",sameElse:"L"},relativeTime:{future:"post %s",past:"antaŭ %s",s:"kelkaj sekundoj",ss:"%d sekundoj",m:"unu minuto",mm:"%d minutoj",h:"unu horo",hh:"%d horoj",d:"unu tago",dd:"%d tagoj",M:"unu monato",MM:"%d monatoj",y:"unu jaro",yy:"%d jaroj"},dayOfMonthOrdinalParse:/\d{1,2}a/,ordinal:"%da",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/es-do.js":function(e,t,n){!function(e){"use strict";var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),o=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],r=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es-do",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY h:mm A",LLLL:"dddd, D [de] MMMM [de] YYYY h:mm A"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/es-mx.js":function(e,t,n){!function(e){"use strict";var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),o=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],r=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es-mx",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:0,doy:4},invalidDate:"Fecha inválida"})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/es-us.js":function(e,t,n){!function(e){"use strict";var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),o=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],r=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es-us",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"MM/DD/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY h:mm A",LLLL:"dddd, D [de] MMMM [de] YYYY h:mm A"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/es.js":function(e,t,n){!function(e){"use strict";var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),o=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],r=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4},invalidDate:"Fecha inválida"})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/et.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={s:["mõne sekundi","mõni sekund","paar sekundit"],ss:[e+"sekundi",e+"sekundit"],m:["ühe minuti","üks minut"],mm:[e+" minuti",e+" minutit"],h:["ühe tunni","tund aega","üks tund"],hh:[e+" tunni",e+" tundi"],d:["ühe päeva","üks päev"],M:["kuu aja","kuu aega","üks kuu"],MM:[e+" kuu",e+" kuud"],y:["ühe aasta","aasta","üks aasta"],yy:[e+" aasta",e+" aastat"]};return t?r[n][2]?r[n][2]:r[n][1]:o?r[n][0]:r[n][1]}e.defineLocale("et",{months:"jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember".split("_"),monthsShort:"jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets".split("_"),weekdays:"pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev".split("_"),weekdaysShort:"P_E_T_K_N_R_L".split("_"),weekdaysMin:"P_E_T_K_N_R_L".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[Täna,] LT",nextDay:"[Homme,] LT",nextWeek:"[Järgmine] dddd LT",lastDay:"[Eile,] LT",lastWeek:"[Eelmine] dddd LT",sameElse:"L"},relativeTime:{future:"%s pärast",past:"%s tagasi",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:"%d päeva",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/eu.js":function(e,t,n){!function(e){"use strict";e.defineLocale("eu",{months:"urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua".split("_"),monthsShort:"urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.".split("_"),monthsParseExact:!0,weekdays:"igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata".split("_"),weekdaysShort:"ig._al._ar._az._og._ol._lr.".split("_"),weekdaysMin:"ig_al_ar_az_og_ol_lr".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY[ko] MMMM[ren] D[a]",LLL:"YYYY[ko] MMMM[ren] D[a] HH:mm",LLLL:"dddd, YYYY[ko] MMMM[ren] D[a] HH:mm",l:"YYYY-M-D",ll:"YYYY[ko] MMM D[a]",lll:"YYYY[ko] MMM D[a] HH:mm",llll:"ddd, YYYY[ko] MMM D[a] HH:mm"},calendar:{sameDay:"[gaur] LT[etan]",nextDay:"[bihar] LT[etan]",nextWeek:"dddd LT[etan]",lastDay:"[atzo] LT[etan]",lastWeek:"[aurreko] dddd LT[etan]",sameElse:"L"},relativeTime:{future:"%s barru",past:"duela %s",s:"segundo batzuk",ss:"%d segundo",m:"minutu bat",mm:"%d minutu",h:"ordu bat",hh:"%d ordu",d:"egun bat",dd:"%d egun",M:"hilabete bat",MM:"%d hilabete",y:"urte bat",yy:"%d urte"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fa.js":function(e,t,n){!function(e){"use strict";var t={1:"۱",2:"۲",3:"۳",4:"۴",5:"۵",6:"۶",7:"۷",8:"۸",9:"۹",0:"۰"},n={"۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9","۰":"0"};e.defineLocale("fa",{months:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),monthsShort:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),weekdays:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_"),weekdaysShort:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_"),weekdaysMin:"ی_د_س_چ_پ_ج_ش".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/قبل از ظهر|بعد از ظهر/,isPM:function(e){return/بعد از ظهر/.test(e)},meridiem:function(e,t,n){return e<12?"قبل از ظهر":"بعد از ظهر"},calendar:{sameDay:"[امروز ساعت] LT",nextDay:"[فردا ساعت] LT",nextWeek:"dddd [ساعت] LT",lastDay:"[دیروز ساعت] LT",lastWeek:"dddd [پیش] [ساعت] LT",sameElse:"L"},relativeTime:{future:"در %s",past:"%s پیش",s:"چند ثانیه",ss:"%d ثانیه",m:"یک دقیقه",mm:"%d دقیقه",h:"یک ساعت",hh:"%d ساعت",d:"یک روز",dd:"%d روز",M:"یک ماه",MM:"%d ماه",y:"یک سال",yy:"%d سال"},preparse:function(e){return e.replace(/[۰-۹]/g,(function(e){return n[e]})).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},dayOfMonthOrdinalParse:/\d{1,2}م/,ordinal:"%dم",week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fi.js":function(e,t,n){!function(e){"use strict";var t="nolla yksi kaksi kolme neljä viisi kuusi seitsemän kahdeksan yhdeksän".split(" "),n=["nolla","yhden","kahden","kolmen","neljän","viiden","kuuden",t[7],t[8],t[9]];function o(e,o,r,s){var a="";switch(r){case"s":return s?"muutaman sekunnin":"muutama sekunti";case"ss":a=s?"sekunnin":"sekuntia";break;case"m":return s?"minuutin":"minuutti";case"mm":a=s?"minuutin":"minuuttia";break;case"h":return s?"tunnin":"tunti";case"hh":a=s?"tunnin":"tuntia";break;case"d":return s?"päivän":"päivä";case"dd":a=s?"päivän":"päivää";break;case"M":return s?"kuukauden":"kuukausi";case"MM":a=s?"kuukauden":"kuukautta";break;case"y":return s?"vuoden":"vuosi";case"yy":a=s?"vuoden":"vuotta"}return function(e,o){return e<10?o?n[e]:t[e]:e}(e,s)+" "+a}e.defineLocale("fi",{months:"tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu".split("_"),monthsShort:"tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu".split("_"),weekdays:"sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai".split("_"),weekdaysShort:"su_ma_ti_ke_to_pe_la".split("_"),weekdaysMin:"su_ma_ti_ke_to_pe_la".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"Do MMMM[ta] YYYY",LLL:"Do MMMM[ta] YYYY, [klo] HH.mm",LLLL:"dddd, Do MMMM[ta] YYYY, [klo] HH.mm",l:"D.M.YYYY",ll:"Do MMM YYYY",lll:"Do MMM YYYY, [klo] HH.mm",llll:"ddd, Do MMM YYYY, [klo] HH.mm"},calendar:{sameDay:"[tänään] [klo] LT",nextDay:"[huomenna] [klo] LT",nextWeek:"dddd [klo] LT",lastDay:"[eilen] [klo] LT",lastWeek:"[viime] dddd[na] [klo] LT",sameElse:"L"},relativeTime:{future:"%s päästä",past:"%s sitten",s:o,ss:o,m:o,mm:o,h:o,hh:o,d:o,dd:o,M:o,MM:o,y:o,yy:o},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fil.js":function(e,t,n){!function(e){"use strict";e.defineLocale("fil",{months:"Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre".split("_"),monthsShort:"Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis".split("_"),weekdays:"Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado".split("_"),weekdaysShort:"Lin_Lun_Mar_Miy_Huw_Biy_Sab".split("_"),weekdaysMin:"Li_Lu_Ma_Mi_Hu_Bi_Sab".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"MM/D/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY HH:mm",LLLL:"dddd, MMMM DD, YYYY HH:mm"},calendar:{sameDay:"LT [ngayong araw]",nextDay:"[Bukas ng] LT",nextWeek:"LT [sa susunod na] dddd",lastDay:"LT [kahapon]",lastWeek:"LT [noong nakaraang] dddd",sameElse:"L"},relativeTime:{future:"sa loob ng %s",past:"%s ang nakalipas",s:"ilang segundo",ss:"%d segundo",m:"isang minuto",mm:"%d minuto",h:"isang oras",hh:"%d oras",d:"isang araw",dd:"%d araw",M:"isang buwan",MM:"%d buwan",y:"isang taon",yy:"%d taon"},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:function(e){return e},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("fo",{months:"januar_februar_mars_apríl_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),weekdays:"sunnudagur_mánadagur_týsdagur_mikudagur_hósdagur_fríggjadagur_leygardagur".split("_"),weekdaysShort:"sun_mán_týs_mik_hós_frí_ley".split("_"),weekdaysMin:"su_má_tý_mi_hó_fr_le".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D. MMMM, YYYY HH:mm"},calendar:{sameDay:"[Í dag kl.] LT",nextDay:"[Í morgin kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[Í gjár kl.] LT",lastWeek:"[síðstu] dddd [kl] LT",sameElse:"L"},relativeTime:{future:"um %s",past:"%s síðani",s:"fá sekund",ss:"%d sekundir",m:"ein minuttur",mm:"%d minuttir",h:"ein tími",hh:"%d tímar",d:"ein dagur",dd:"%d dagar",M:"ein mánaður",MM:"%d mánaðir",y:"eitt ár",yy:"%d ár"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fr-ca.js":function(e,t,n){!function(e){"use strict";e.defineLocale("fr-ca",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),monthsParseExact:!0,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd’hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|e)/,ordinal:function(e,t){switch(t){default:case"M":case"Q":case"D":case"DDD":case"d":return e+(1===e?"er":"e");case"w":case"W":return e+(1===e?"re":"e")}}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fr-ch.js":function(e,t,n){!function(e){"use strict";e.defineLocale("fr-ch",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),monthsParseExact:!0,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd’hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|e)/,ordinal:function(e,t){switch(t){default:case"M":case"Q":case"D":case"DDD":case"d":return e+(1===e?"er":"e");case"w":case"W":return e+(1===e?"re":"e")}},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fr.js":function(e,t,n){!function(e){"use strict";var t=/(janv\.?|févr\.?|mars|avr\.?|mai|juin|juil\.?|août|sept\.?|oct\.?|nov\.?|déc\.?|janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i,n=[/^janv/i,/^févr/i,/^mars/i,/^avr/i,/^mai/i,/^juin/i,/^juil/i,/^août/i,/^sept/i,/^oct/i,/^nov/i,/^déc/i];e.defineLocale("fr",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),monthsRegex:t,monthsShortRegex:t,monthsStrictRegex:/^(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i,monthsShortStrictRegex:/(janv\.?|févr\.?|mars|avr\.?|mai|juin|juil\.?|août|sept\.?|oct\.?|nov\.?|déc\.?)/i,monthsParse:n,longMonthsParse:n,shortMonthsParse:n,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd’hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",w:"une semaine",ww:"%d semaines",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|)/,ordinal:function(e,t){switch(t){case"D":return e+(1===e?"er":"");default:case"M":case"Q":case"DDD":case"d":return e+(1===e?"er":"e");case"w":case"W":return e+(1===e?"re":"e")}},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/fy.js":function(e,t,n){!function(e){"use strict";var t="jan._feb._mrt._apr._mai_jun._jul._aug._sep._okt._nov._des.".split("_"),n="jan_feb_mrt_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_");e.defineLocale("fy",{months:"jannewaris_febrewaris_maart_april_maaie_juny_july_augustus_septimber_oktober_novimber_desimber".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsParseExact:!0,weekdays:"snein_moandei_tiisdei_woansdei_tongersdei_freed_sneon".split("_"),weekdaysShort:"si._mo._ti._wo._to._fr._so.".split("_"),weekdaysMin:"Si_Mo_Ti_Wo_To_Fr_So".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[hjoed om] LT",nextDay:"[moarn om] LT",nextWeek:"dddd [om] LT",lastDay:"[juster om] LT",lastWeek:"[ôfrûne] dddd [om] LT",sameElse:"L"},relativeTime:{future:"oer %s",past:"%s lyn",s:"in pear sekonden",ss:"%d sekonden",m:"ien minút",mm:"%d minuten",h:"ien oere",hh:"%d oeren",d:"ien dei",dd:"%d dagen",M:"ien moanne",MM:"%d moannen",y:"ien jier",yy:"%d jierren"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ga.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ga",{months:["Eanáir","Feabhra","Márta","Aibreán","Bealtaine","Meitheamh","Iúil","Lúnasa","Meán Fómhair","Deireadh Fómhair","Samhain","Nollaig"],monthsShort:["Ean","Feabh","Márt","Aib","Beal","Meith","Iúil","Lún","M.F.","D.F.","Samh","Noll"],monthsParseExact:!0,weekdays:["Dé Domhnaigh","Dé Luain","Dé Máirt","Dé Céadaoin","Déardaoin","Dé hAoine","Dé Sathairn"],weekdaysShort:["Domh","Luan","Máirt","Céad","Déar","Aoine","Sath"],weekdaysMin:["Do","Lu","Má","Cé","Dé","A","Sa"],longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Inniu ag] LT",nextDay:"[Amárach ag] LT",nextWeek:"dddd [ag] LT",lastDay:"[Inné ag] LT",lastWeek:"dddd [seo caite] [ag] LT",sameElse:"L"},relativeTime:{future:"i %s",past:"%s ó shin",s:"cúpla soicind",ss:"%d soicind",m:"nóiméad",mm:"%d nóiméad",h:"uair an chloig",hh:"%d uair an chloig",d:"lá",dd:"%d lá",M:"mí",MM:"%d míonna",y:"bliain",yy:"%d bliain"},dayOfMonthOrdinalParse:/\d{1,2}(d|na|mh)/,ordinal:function(e){return e+(1===e?"d":e%10==2?"na":"mh")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/gd.js":function(e,t,n){!function(e){"use strict";e.defineLocale("gd",{months:["Am Faoilleach","An Gearran","Am Màrt","An Giblean","An Cèitean","An t-Ògmhios","An t-Iuchar","An Lùnastal","An t-Sultain","An Dàmhair","An t-Samhain","An Dùbhlachd"],monthsShort:["Faoi","Gear","Màrt","Gibl","Cèit","Ògmh","Iuch","Lùn","Sult","Dàmh","Samh","Dùbh"],monthsParseExact:!0,weekdays:["Didòmhnaich","Diluain","Dimàirt","Diciadain","Diardaoin","Dihaoine","Disathairne"],weekdaysShort:["Did","Dil","Dim","Dic","Dia","Dih","Dis"],weekdaysMin:["Dò","Lu","Mà","Ci","Ar","Ha","Sa"],longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[An-diugh aig] LT",nextDay:"[A-màireach aig] LT",nextWeek:"dddd [aig] LT",lastDay:"[An-dè aig] LT",lastWeek:"dddd [seo chaidh] [aig] LT",sameElse:"L"},relativeTime:{future:"ann an %s",past:"bho chionn %s",s:"beagan diogan",ss:"%d diogan",m:"mionaid",mm:"%d mionaidean",h:"uair",hh:"%d uairean",d:"latha",dd:"%d latha",M:"mìos",MM:"%d mìosan",y:"bliadhna",yy:"%d bliadhna"},dayOfMonthOrdinalParse:/\d{1,2}(d|na|mh)/,ordinal:function(e){return e+(1===e?"d":e%10==2?"na":"mh")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/gl.js":function(e,t,n){!function(e){"use strict";e.defineLocale("gl",{months:"xaneiro_febreiro_marzo_abril_maio_xuño_xullo_agosto_setembro_outubro_novembro_decembro".split("_"),monthsShort:"xan._feb._mar._abr._mai._xuñ._xul._ago._set._out._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"domingo_luns_martes_mércores_xoves_venres_sábado".split("_"),weekdaysShort:"dom._lun._mar._mér._xov._ven._sáb.".split("_"),weekdaysMin:"do_lu_ma_mé_xo_ve_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoxe "+(1!==this.hours()?"ás":"á")+"] LT"},nextDay:function(){return"[mañá "+(1!==this.hours()?"ás":"á")+"] LT"},nextWeek:function(){return"dddd ["+(1!==this.hours()?"ás":"a")+"] LT"},lastDay:function(){return"[onte "+(1!==this.hours()?"á":"a")+"] LT"},lastWeek:function(){return"[o] dddd [pasado "+(1!==this.hours()?"ás":"a")+"] LT"},sameElse:"L"},relativeTime:{future:function(e){return 0===e.indexOf("un")?"n"+e:"en "+e},past:"hai %s",s:"uns segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"unha hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un ano",yy:"%d anos"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/gom-deva.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={s:["थोडया सॅकंडांनी","थोडे सॅकंड"],ss:[e+" सॅकंडांनी",e+" सॅकंड"],m:["एका मिणटान","एक मिनूट"],mm:[e+" मिणटांनी",e+" मिणटां"],h:["एका वरान","एक वर"],hh:[e+" वरांनी",e+" वरां"],d:["एका दिसान","एक दीस"],dd:[e+" दिसांनी",e+" दीस"],M:["एका म्हयन्यान","एक म्हयनो"],MM:[e+" म्हयन्यानी",e+" म्हयने"],y:["एका वर्सान","एक वर्स"],yy:[e+" वर्सांनी",e+" वर्सां"]};return o?r[n][0]:r[n][1]}e.defineLocale("gom-deva",{months:{standalone:"जानेवारी_फेब्रुवारी_मार्च_एप्रील_मे_जून_जुलय_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर".split("_"),format:"जानेवारीच्या_फेब्रुवारीच्या_मार्चाच्या_एप्रीलाच्या_मेयाच्या_जूनाच्या_जुलयाच्या_ऑगस्टाच्या_सप्टेंबराच्या_ऑक्टोबराच्या_नोव्हेंबराच्या_डिसेंबराच्या".split("_"),isFormat:/MMMM(\s)+D[oD]?/},monthsShort:"जाने._फेब्रु._मार्च_एप्री._मे_जून_जुल._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.".split("_"),monthsParseExact:!0,weekdays:"आयतार_सोमार_मंगळार_बुधवार_बिरेस्तार_सुक्रार_शेनवार".split("_"),weekdaysShort:"आयत._सोम._मंगळ._बुध._ब्रेस्त._सुक्र._शेन.".split("_"),weekdaysMin:"आ_सो_मं_बु_ब्रे_सु_शे".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"A h:mm [वाजतां]",LTS:"A h:mm:ss [वाजतां]",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY A h:mm [वाजतां]",LLLL:"dddd, MMMM Do, YYYY, A h:mm [वाजतां]",llll:"ddd, D MMM YYYY, A h:mm [वाजतां]"},calendar:{sameDay:"[आयज] LT",nextDay:"[फाल्यां] LT",nextWeek:"[फुडलो] dddd[,] LT",lastDay:"[काल] LT",lastWeek:"[फाटलो] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%s",past:"%s आदीं",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}(वेर)/,ordinal:function(e,t){switch(t){case"D":return e+"वेर";default:case"M":case"Q":case"DDD":case"d":case"w":case"W":return e}},week:{dow:0,doy:3},meridiemParse:/राती|सकाळीं|दनपारां|सांजे/,meridiemHour:function(e,t){return 12===e&&(e=0),"राती"===t?e<4?e:e+12:"सकाळीं"===t?e:"दनपारां"===t?e>12?e:e+12:"सांजे"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"राती":e<12?"सकाळीं":e<16?"दनपारां":e<20?"सांजे":"राती"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/gom-latn.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={s:["thoddea sekondamni","thodde sekond"],ss:[e+" sekondamni",e+" sekond"],m:["eka mintan","ek minut"],mm:[e+" mintamni",e+" mintam"],h:["eka voran","ek vor"],hh:[e+" voramni",e+" voram"],d:["eka disan","ek dis"],dd:[e+" disamni",e+" dis"],M:["eka mhoinean","ek mhoino"],MM:[e+" mhoineamni",e+" mhoine"],y:["eka vorsan","ek voros"],yy:[e+" vorsamni",e+" vorsam"]};return o?r[n][0]:r[n][1]}e.defineLocale("gom-latn",{months:{standalone:"Janer_Febrer_Mars_Abril_Mai_Jun_Julai_Agost_Setembr_Otubr_Novembr_Dezembr".split("_"),format:"Janerachea_Febrerachea_Marsachea_Abrilachea_Maiachea_Junachea_Julaiachea_Agostachea_Setembrachea_Otubrachea_Novembrachea_Dezembrachea".split("_"),isFormat:/MMMM(\s)+D[oD]?/},monthsShort:"Jan._Feb._Mars_Abr._Mai_Jun_Jul._Ago._Set._Otu._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Aitar_Somar_Mongllar_Budhvar_Birestar_Sukrar_Son'var".split("_"),weekdaysShort:"Ait._Som._Mon._Bud._Bre._Suk._Son.".split("_"),weekdaysMin:"Ai_Sm_Mo_Bu_Br_Su_Sn".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"A h:mm [vazta]",LTS:"A h:mm:ss [vazta]",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY A h:mm [vazta]",LLLL:"dddd, MMMM Do, YYYY, A h:mm [vazta]",llll:"ddd, D MMM YYYY, A h:mm [vazta]"},calendar:{sameDay:"[Aiz] LT",nextDay:"[Faleam] LT",nextWeek:"[Fuddlo] dddd[,] LT",lastDay:"[Kal] LT",lastWeek:"[Fattlo] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%s",past:"%s adim",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}(er)/,ordinal:function(e,t){switch(t){case"D":return e+"er";default:case"M":case"Q":case"DDD":case"d":case"w":case"W":return e}},week:{dow:0,doy:3},meridiemParse:/rati|sokallim|donparam|sanje/,meridiemHour:function(e,t){return 12===e&&(e=0),"rati"===t?e<4?e:e+12:"sokallim"===t?e:"donparam"===t?e>12?e:e+12:"sanje"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"rati":e<12?"sokallim":e<16?"donparam":e<20?"sanje":"rati"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/gu.js":function(e,t,n){!function(e){"use strict";var t={1:"૧",2:"૨",3:"૩",4:"૪",5:"૫",6:"૬",7:"૭",8:"૮",9:"૯",0:"૦"},n={"૧":"1","૨":"2","૩":"3","૪":"4","૫":"5","૬":"6","૭":"7","૮":"8","૯":"9","૦":"0"};e.defineLocale("gu",{months:"જાન્યુઆરી_ફેબ્રુઆરી_માર્ચ_એપ્રિલ_મે_જૂન_જુલાઈ_ઑગસ્ટ_સપ્ટેમ્બર_ઑક્ટ્બર_નવેમ્બર_ડિસેમ્બર".split("_"),monthsShort:"જાન્યુ._ફેબ્રુ._માર્ચ_એપ્રિ._મે_જૂન_જુલા._ઑગ._સપ્ટે._ઑક્ટ્._નવે._ડિસે.".split("_"),monthsParseExact:!0,weekdays:"રવિવાર_સોમવાર_મંગળવાર_બુધ્વાર_ગુરુવાર_શુક્રવાર_શનિવાર".split("_"),weekdaysShort:"રવિ_સોમ_મંગળ_બુધ્_ગુરુ_શુક્ર_શનિ".split("_"),weekdaysMin:"ર_સો_મં_બુ_ગુ_શુ_શ".split("_"),longDateFormat:{LT:"A h:mm વાગ્યે",LTS:"A h:mm:ss વાગ્યે",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm વાગ્યે",LLLL:"dddd, D MMMM YYYY, A h:mm વાગ્યે"},calendar:{sameDay:"[આજ] LT",nextDay:"[કાલે] LT",nextWeek:"dddd, LT",lastDay:"[ગઇકાલે] LT",lastWeek:"[પાછલા] dddd, LT",sameElse:"L"},relativeTime:{future:"%s મા",past:"%s પહેલા",s:"અમુક પળો",ss:"%d સેકંડ",m:"એક મિનિટ",mm:"%d મિનિટ",h:"એક કલાક",hh:"%d કલાક",d:"એક દિવસ",dd:"%d દિવસ",M:"એક મહિનો",MM:"%d મહિનો",y:"એક વર્ષ",yy:"%d વર્ષ"},preparse:function(e){return e.replace(/[૧૨૩૪૫૬૭૮૯૦]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/રાત|બપોર|સવાર|સાંજ/,meridiemHour:function(e,t){return 12===e&&(e=0),"રાત"===t?e<4?e:e+12:"સવાર"===t?e:"બપોર"===t?e>=10?e:e+12:"સાંજ"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"રાત":e<10?"સવાર":e<17?"બપોર":e<20?"સાંજ":"રાત"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/he.js":function(e,t,n){!function(e){"use strict";e.defineLocale("he",{months:"ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר".split("_"),monthsShort:"ינו׳_פבר׳_מרץ_אפר׳_מאי_יוני_יולי_אוג׳_ספט׳_אוק׳_נוב׳_דצמ׳".split("_"),weekdays:"ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת".split("_"),weekdaysShort:"א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳".split("_"),weekdaysMin:"א_ב_ג_ד_ה_ו_ש".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [ב]MMMM YYYY",LLL:"D [ב]MMMM YYYY HH:mm",LLLL:"dddd, D [ב]MMMM YYYY HH:mm",l:"D/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},calendar:{sameDay:"[היום ב־]LT",nextDay:"[מחר ב־]LT",nextWeek:"dddd [בשעה] LT",lastDay:"[אתמול ב־]LT",lastWeek:"[ביום] dddd [האחרון בשעה] LT",sameElse:"L"},relativeTime:{future:"בעוד %s",past:"לפני %s",s:"מספר שניות",ss:"%d שניות",m:"דקה",mm:"%d דקות",h:"שעה",hh:function(e){return 2===e?"שעתיים":e+" שעות"},d:"יום",dd:function(e){return 2===e?"יומיים":e+" ימים"},M:"חודש",MM:function(e){return 2===e?"חודשיים":e+" חודשים"},y:"שנה",yy:function(e){return 2===e?"שנתיים":e%10==0&&10!==e?e+" שנה":e+" שנים"}},meridiemParse:/אחה"צ|לפנה"צ|אחרי הצהריים|לפני הצהריים|לפנות בוקר|בבוקר|בערב/i,isPM:function(e){return/^(אחה"צ|אחרי הצהריים|בערב)$/.test(e)},meridiem:function(e,t,n){return e<5?"לפנות בוקר":e<10?"בבוקר":e<12?n?'לפנה"צ':"לפני הצהריים":e<18?n?'אחה"צ':"אחרי הצהריים":"בערב"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/hi.js":function(e,t,n){!function(e){"use strict";var t={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},n={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"},o=[/^जन/i,/^फ़र|फर/i,/^मार्च/i,/^अप्रै/i,/^मई/i,/^जून/i,/^जुल/i,/^अग/i,/^सितं|सित/i,/^अक्टू/i,/^नव|नवं/i,/^दिसं|दिस/i];e.defineLocale("hi",{months:{format:"जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर".split("_"),standalone:"जनवरी_फरवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितंबर_अक्टूबर_नवंबर_दिसंबर".split("_")},monthsShort:"जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.".split("_"),weekdays:"रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),weekdaysShort:"रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),longDateFormat:{LT:"A h:mm बजे",LTS:"A h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm बजे",LLLL:"dddd, D MMMM YYYY, A h:mm बजे"},monthsParse:o,longMonthsParse:o,shortMonthsParse:[/^जन/i,/^फ़र/i,/^मार्च/i,/^अप्रै/i,/^मई/i,/^जून/i,/^जुल/i,/^अग/i,/^सित/i,/^अक्टू/i,/^नव/i,/^दिस/i],monthsRegex:/^(जनवरी|जन\.?|फ़रवरी|फरवरी|फ़र\.?|मार्च?|अप्रैल|अप्रै\.?|मई?|जून?|जुलाई|जुल\.?|अगस्त|अग\.?|सितम्बर|सितंबर|सित\.?|अक्टूबर|अक्टू\.?|नवम्बर|नवंबर|नव\.?|दिसम्बर|दिसंबर|दिस\.?)/i,monthsShortRegex:/^(जनवरी|जन\.?|फ़रवरी|फरवरी|फ़र\.?|मार्च?|अप्रैल|अप्रै\.?|मई?|जून?|जुलाई|जुल\.?|अगस्त|अग\.?|सितम्बर|सितंबर|सित\.?|अक्टूबर|अक्टू\.?|नवम्बर|नवंबर|नव\.?|दिसम्बर|दिसंबर|दिस\.?)/i,monthsStrictRegex:/^(जनवरी?|फ़रवरी|फरवरी?|मार्च?|अप्रैल?|मई?|जून?|जुलाई?|अगस्त?|सितम्बर|सितंबर|सित?\.?|अक्टूबर|अक्टू\.?|नवम्बर|नवंबर?|दिसम्बर|दिसंबर?)/i,monthsShortStrictRegex:/^(जन\.?|फ़र\.?|मार्च?|अप्रै\.?|मई?|जून?|जुल\.?|अग\.?|सित\.?|अक्टू\.?|नव\.?|दिस\.?)/i,calendar:{sameDay:"[आज] LT",nextDay:"[कल] LT",nextWeek:"dddd, LT",lastDay:"[कल] LT",lastWeek:"[पिछले] dddd, LT",sameElse:"L"},relativeTime:{future:"%s में",past:"%s पहले",s:"कुछ ही क्षण",ss:"%d सेकंड",m:"एक मिनट",mm:"%d मिनट",h:"एक घंटा",hh:"%d घंटे",d:"एक दिन",dd:"%d दिन",M:"एक महीने",MM:"%d महीने",y:"एक वर्ष",yy:"%d वर्ष"},preparse:function(e){return e.replace(/[१२३४५६७८९०]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/रात|सुबह|दोपहर|शाम/,meridiemHour:function(e,t){return 12===e&&(e=0),"रात"===t?e<4?e:e+12:"सुबह"===t?e:"दोपहर"===t?e>=10?e:e+12:"शाम"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"रात":e<10?"सुबह":e<17?"दोपहर":e<20?"शाम":"रात"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/hr.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){var o=e+" ";switch(n){case"ss":return o+(1===e?"sekunda":2===e||3===e||4===e?"sekunde":"sekundi");case"m":return t?"jedna minuta":"jedne minute";case"mm":return o+(1===e?"minuta":2===e||3===e||4===e?"minute":"minuta");case"h":return t?"jedan sat":"jednog sata";case"hh":return o+(1===e?"sat":2===e||3===e||4===e?"sata":"sati");case"dd":return o+(1===e?"dan":"dana");case"MM":return o+(1===e?"mjesec":2===e||3===e||4===e?"mjeseca":"mjeseci");case"yy":return o+(1===e?"godina":2===e||3===e||4===e?"godine":"godina")}}e.defineLocale("hr",{months:{format:"siječnja_veljače_ožujka_travnja_svibnja_lipnja_srpnja_kolovoza_rujna_listopada_studenoga_prosinca".split("_"),standalone:"siječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac".split("_")},monthsShort:"sij._velj._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"Do MMMM YYYY",LLL:"Do MMMM YYYY H:mm",LLLL:"dddd, Do MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[jučer u] LT",lastWeek:function(){switch(this.day()){case 0:return"[prošlu] [nedjelju] [u] LT";case 3:return"[prošlu] [srijedu] [u] LT";case 6:return"[prošle] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[prošli] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",ss:t,m:t,mm:t,h:t,hh:t,d:"dan",dd:t,M:"mjesec",MM:t,y:"godinu",yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/hu.js":function(e,t,n){!function(e){"use strict";var t="vasárnap hétfőn kedden szerdán csütörtökön pénteken szombaton".split(" ");function n(e,t,n,o){var r=e;switch(n){case"s":return o||t?"néhány másodperc":"néhány másodperce";case"ss":return r+(o||t)?" másodperc":" másodperce";case"m":return"egy"+(o||t?" perc":" perce");case"mm":return r+(o||t?" perc":" perce");case"h":return"egy"+(o||t?" óra":" órája");case"hh":return r+(o||t?" óra":" órája");case"d":return"egy"+(o||t?" nap":" napja");case"dd":return r+(o||t?" nap":" napja");case"M":return"egy"+(o||t?" hónap":" hónapja");case"MM":return r+(o||t?" hónap":" hónapja");case"y":return"egy"+(o||t?" év":" éve");case"yy":return r+(o||t?" év":" éve")}return""}function o(e){return(e?"":"[múlt] ")+"["+t[this.day()]+"] LT[-kor]"}e.defineLocale("hu",{months:"január_február_március_április_május_június_július_augusztus_szeptember_október_november_december".split("_"),monthsShort:"jan._feb._márc._ápr._máj._jún._júl._aug._szept._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat".split("_"),weekdaysShort:"vas_hét_kedd_sze_csüt_pén_szo".split("_"),weekdaysMin:"v_h_k_sze_cs_p_szo".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY. MMMM D.",LLL:"YYYY. MMMM D. H:mm",LLLL:"YYYY. MMMM D., dddd H:mm"},meridiemParse:/de|du/i,isPM:function(e){return"u"===e.charAt(1).toLowerCase()},meridiem:function(e,t,n){return e<12?!0===n?"de":"DE":!0===n?"du":"DU"},calendar:{sameDay:"[ma] LT[-kor]",nextDay:"[holnap] LT[-kor]",nextWeek:function(){return o.call(this,!0)},lastDay:"[tegnap] LT[-kor]",lastWeek:function(){return o.call(this,!1)},sameElse:"L"},relativeTime:{future:"%s múlva",past:"%s",s:n,ss:n,m:n,mm:n,h:n,hh:n,d:n,dd:n,M:n,MM:n,y:n,yy:n},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/hy-am.js":function(e,t,n){!function(e){"use strict";e.defineLocale("hy-am",{months:{format:"հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի".split("_"),standalone:"հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր".split("_")},monthsShort:"հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ".split("_"),weekdays:"կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ".split("_"),weekdaysShort:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),weekdaysMin:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY թ.",LLL:"D MMMM YYYY թ., HH:mm",LLLL:"dddd, D MMMM YYYY թ., HH:mm"},calendar:{sameDay:"[այսօր] LT",nextDay:"[վաղը] LT",lastDay:"[երեկ] LT",nextWeek:function(){return"dddd [օրը ժամը] LT"},lastWeek:function(){return"[անցած] dddd [օրը ժամը] LT"},sameElse:"L"},relativeTime:{future:"%s հետո",past:"%s առաջ",s:"մի քանի վայրկյան",ss:"%d վայրկյան",m:"րոպե",mm:"%d րոպե",h:"ժամ",hh:"%d ժամ",d:"օր",dd:"%d օր",M:"ամիս",MM:"%d ամիս",y:"տարի",yy:"%d տարի"},meridiemParse:/գիշերվա|առավոտվա|ցերեկվա|երեկոյան/,isPM:function(e){return/^(ցերեկվա|երեկոյան)$/.test(e)},meridiem:function(e){return e<4?"գիշերվա":e<12?"առավոտվա":e<17?"ցերեկվա":"երեկոյան"},dayOfMonthOrdinalParse:/\d{1,2}|\d{1,2}-(ին|րդ)/,ordinal:function(e,t){switch(t){case"DDD":case"w":case"W":case"DDDo":return 1===e?e+"-ին":e+"-րդ";default:return e}},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/id.js":function(e,t,n){!function(e){"use strict";e.defineLocale("id",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Agt_Sep_Okt_Nov_Des".split("_"),weekdays:"Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu".split("_"),weekdaysShort:"Min_Sen_Sel_Rab_Kam_Jum_Sab".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|siang|sore|malam/,meridiemHour:function(e,t){return 12===e&&(e=0),"pagi"===t?e:"siang"===t?e>=11?e:e+12:"sore"===t||"malam"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"pagi":e<15?"siang":e<19?"sore":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Besok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kemarin pukul] LT",lastWeek:"dddd [lalu pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lalu",s:"beberapa detik",ss:"%d detik",m:"semenit",mm:"%d menit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/is.js":function(e,t,n){!function(e){"use strict";function t(e){return e%100==11||e%10!=1}function n(e,n,o,r){var s=e+" ";switch(o){case"s":return n||r?"nokkrar sekúndur":"nokkrum sekúndum";case"ss":return t(e)?s+(n||r?"sekúndur":"sekúndum"):s+"sekúnda";case"m":return n?"mínúta":"mínútu";case"mm":return t(e)?s+(n||r?"mínútur":"mínútum"):n?s+"mínúta":s+"mínútu";case"hh":return t(e)?s+(n||r?"klukkustundir":"klukkustundum"):s+"klukkustund";case"d":return n?"dagur":r?"dag":"degi";case"dd":return t(e)?n?s+"dagar":s+(r?"daga":"dögum"):n?s+"dagur":s+(r?"dag":"degi");case"M":return n?"mánuður":r?"mánuð":"mánuði";case"MM":return t(e)?n?s+"mánuðir":s+(r?"mánuði":"mánuðum"):n?s+"mánuður":s+(r?"mánuð":"mánuði");case"y":return n||r?"ár":"ári";case"yy":return t(e)?s+(n||r?"ár":"árum"):s+(n||r?"ár":"ári")}}e.defineLocale("is",{months:"janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember".split("_"),monthsShort:"jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des".split("_"),weekdays:"sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur".split("_"),weekdaysShort:"sun_mán_þri_mið_fim_fös_lau".split("_"),weekdaysMin:"Su_Má_Þr_Mi_Fi_Fö_La".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd, D. MMMM YYYY [kl.] H:mm"},calendar:{sameDay:"[í dag kl.] LT",nextDay:"[á morgun kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[í gær kl.] LT",lastWeek:"[síðasta] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"eftir %s",past:"fyrir %s síðan",s:n,ss:n,m:n,mm:n,h:"klukkustund",hh:n,d:n,dd:n,M:n,MM:n,y:n,yy:n},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/it-ch.js":function(e,t,n){!function(e){"use strict";e.defineLocale("it-ch",{months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Oggi alle] LT",nextDay:"[Domani alle] LT",nextWeek:"dddd [alle] LT",lastDay:"[Ieri alle] LT",lastWeek:function(){switch(this.day()){case 0:return"[la scorsa] dddd [alle] LT";default:return"[lo scorso] dddd [alle] LT"}},sameElse:"L"},relativeTime:{future:function(e){return(/^[0-9].+$/.test(e)?"tra":"in")+" "+e},past:"%s fa",s:"alcuni secondi",ss:"%d secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/it.js":function(e,t,n){!function(e){"use strict";e.defineLocale("it",{months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:function(){return"[Oggi a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},nextDay:function(){return"[Domani a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},nextWeek:function(){return"dddd [a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},lastDay:function(){return"[Ieri a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},lastWeek:function(){switch(this.day()){case 0:return"[La scorsa] dddd [a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT";default:return"[Lo scorso] dddd [a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"}},sameElse:"L"},relativeTime:{future:"tra %s",past:"%s fa",s:"alcuni secondi",ss:"%d secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",w:"una settimana",ww:"%d settimane",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ja.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ja",{eras:[{since:"2019-05-01",offset:1,name:"令和",narrow:"㋿",abbr:"R"},{since:"1989-01-08",until:"2019-04-30",offset:1,name:"平成",narrow:"㍻",abbr:"H"},{since:"1926-12-25",until:"1989-01-07",offset:1,name:"昭和",narrow:"㍼",abbr:"S"},{since:"1912-07-30",until:"1926-12-24",offset:1,name:"大正",narrow:"㍽",abbr:"T"},{since:"1873-01-01",until:"1912-07-29",offset:6,name:"明治",narrow:"㍾",abbr:"M"},{since:"0001-01-01",until:"1873-12-31",offset:1,name:"西暦",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"紀元前",narrow:"BC",abbr:"BC"}],eraYearOrdinalRegex:/(元|\d+)年/,eraYearOrdinalParse:function(e,t){return"元"===t[1]?1:parseInt(t[1]||e,10)},months:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日".split("_"),weekdaysShort:"日_月_火_水_木_金_土".split("_"),weekdaysMin:"日_月_火_水_木_金_土".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日 dddd HH:mm",l:"YYYY/MM/DD",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日(ddd) HH:mm"},meridiemParse:/午前|午後/i,isPM:function(e){return"午後"===e},meridiem:function(e,t,n){return e<12?"午前":"午後"},calendar:{sameDay:"[今日] LT",nextDay:"[明日] LT",nextWeek:function(e){return e.week()!==this.week()?"[来週]dddd LT":"dddd LT"},lastDay:"[昨日] LT",lastWeek:function(e){return this.week()!==e.week()?"[先週]dddd LT":"dddd LT"},sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}日/,ordinal:function(e,t){switch(t){case"y":return 1===e?"元年":e+"年";case"d":case"D":case"DDD":return e+"日";default:return e}},relativeTime:{future:"%s後",past:"%s前",s:"数秒",ss:"%d秒",m:"1分",mm:"%d分",h:"1時間",hh:"%d時間",d:"1日",dd:"%d日",M:"1ヶ月",MM:"%dヶ月",y:"1年",yy:"%d年"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/jv.js":function(e,t,n){!function(e){"use strict";e.defineLocale("jv",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_Nopember_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nop_Des".split("_"),weekdays:"Minggu_Senen_Seloso_Rebu_Kemis_Jemuwah_Septu".split("_"),weekdaysShort:"Min_Sen_Sel_Reb_Kem_Jem_Sep".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sp".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/enjing|siyang|sonten|ndalu/,meridiemHour:function(e,t){return 12===e&&(e=0),"enjing"===t?e:"siyang"===t?e>=11?e:e+12:"sonten"===t||"ndalu"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"enjing":e<15?"siyang":e<19?"sonten":"ndalu"},calendar:{sameDay:"[Dinten puniko pukul] LT",nextDay:"[Mbenjang pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kala wingi pukul] LT",lastWeek:"dddd [kepengker pukul] LT",sameElse:"L"},relativeTime:{future:"wonten ing %s",past:"%s ingkang kepengker",s:"sawetawis detik",ss:"%d detik",m:"setunggal menit",mm:"%d menit",h:"setunggal jam",hh:"%d jam",d:"sedinten",dd:"%d dinten",M:"sewulan",MM:"%d wulan",y:"setaun",yy:"%d taun"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ka.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ka",{months:"იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი".split("_"),monthsShort:"იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ".split("_"),weekdays:{standalone:"კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი".split("_"),format:"კვირას_ორშაბათს_სამშაბათს_ოთხშაბათს_ხუთშაბათს_პარასკევს_შაბათს".split("_"),isFormat:/(წინა|შემდეგ)/},weekdaysShort:"კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ".split("_"),weekdaysMin:"კვ_ორ_სა_ოთ_ხუ_პა_შა".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[დღეს] LT[-ზე]",nextDay:"[ხვალ] LT[-ზე]",lastDay:"[გუშინ] LT[-ზე]",nextWeek:"[შემდეგ] dddd LT[-ზე]",lastWeek:"[წინა] dddd LT-ზე",sameElse:"L"},relativeTime:{future:function(e){return e.replace(/(წამ|წუთ|საათ|წელ|დღ|თვ)(ი|ე)/,(function(e,t,n){return"ი"===n?t+"ში":t+n+"ში"}))},past:function(e){return/(წამი|წუთი|საათი|დღე|თვე)/.test(e)?e.replace(/(ი|ე)$/,"ის წინ"):/წელი/.test(e)?e.replace(/წელი$/,"წლის წინ"):e},s:"რამდენიმე წამი",ss:"%d წამი",m:"წუთი",mm:"%d წუთი",h:"საათი",hh:"%d საათი",d:"დღე",dd:"%d დღე",M:"თვე",MM:"%d თვე",y:"წელი",yy:"%d წელი"},dayOfMonthOrdinalParse:/0|1-ლი|მე-\d{1,2}|\d{1,2}-ე/,ordinal:function(e){return 0===e?e:1===e?e+"-ლი":e<20||e<=100&&e%20==0||e%100==0?"მე-"+e:e+"-ე"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/kk.js":function(e,t,n){!function(e){"use strict";var t={0:"-ші",1:"-ші",2:"-ші",3:"-ші",4:"-ші",5:"-ші",6:"-шы",7:"-ші",8:"-ші",9:"-шы",10:"-шы",20:"-шы",30:"-шы",40:"-шы",50:"-ші",60:"-шы",70:"-ші",80:"-ші",90:"-шы",100:"-ші"};e.defineLocale("kk",{months:"қаңтар_ақпан_наурыз_сәуір_мамыр_маусым_шілде_тамыз_қыркүйек_қазан_қараша_желтоқсан".split("_"),monthsShort:"қаң_ақп_нау_сәу_мам_мау_шіл_там_қыр_қаз_қар_жел".split("_"),weekdays:"жексенбі_дүйсенбі_сейсенбі_сәрсенбі_бейсенбі_жұма_сенбі".split("_"),weekdaysShort:"жек_дүй_сей_сәр_бей_жұм_сен".split("_"),weekdaysMin:"жк_дй_сй_ср_бй_жм_сн".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Бүгін сағат] LT",nextDay:"[Ертең сағат] LT",nextWeek:"dddd [сағат] LT",lastDay:"[Кеше сағат] LT",lastWeek:"[Өткен аптаның] dddd [сағат] LT",sameElse:"L"},relativeTime:{future:"%s ішінде",past:"%s бұрын",s:"бірнеше секунд",ss:"%d секунд",m:"бір минут",mm:"%d минут",h:"бір сағат",hh:"%d сағат",d:"бір күн",dd:"%d күн",M:"бір ай",MM:"%d ай",y:"бір жыл",yy:"%d жыл"},dayOfMonthOrdinalParse:/\d{1,2}-(ші|шы)/,ordinal:function(e){return e+(t[e]||t[e%10]||t[e>=100?100:null])},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/km.js":function(e,t,n){!function(e){"use strict";var t={1:"១",2:"២",3:"៣",4:"៤",5:"៥",6:"៦",7:"៧",8:"៨",9:"៩",0:"០"},n={"១":"1","២":"2","៣":"3","៤":"4","៥":"5","៦":"6","៧":"7","៨":"8","៩":"9","០":"0"};e.defineLocale("km",{months:"មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),monthsShort:"មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),weekdays:"អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"),weekdaysShort:"អា_ច_អ_ព_ព្រ_សុ_ស".split("_"),weekdaysMin:"អា_ច_អ_ព_ព្រ_សុ_ស".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/ព្រឹក|ល្ងាច/,isPM:function(e){return"ល្ងាច"===e},meridiem:function(e,t,n){return e<12?"ព្រឹក":"ល្ងាច"},calendar:{sameDay:"[ថ្ងៃនេះ ម៉ោង] LT",nextDay:"[ស្អែក ម៉ោង] LT",nextWeek:"dddd [ម៉ោង] LT",lastDay:"[ម្សិលមិញ ម៉ោង] LT",lastWeek:"dddd [សប្តាហ៍មុន] [ម៉ោង] LT",sameElse:"L"},relativeTime:{future:"%sទៀត",past:"%sមុន",s:"ប៉ុន្មានវិនាទី",ss:"%d វិនាទី",m:"មួយនាទី",mm:"%d នាទី",h:"មួយម៉ោង",hh:"%d ម៉ោង",d:"មួយថ្ងៃ",dd:"%d ថ្ងៃ",M:"មួយខែ",MM:"%d ខែ",y:"មួយឆ្នាំ",yy:"%d ឆ្នាំ"},dayOfMonthOrdinalParse:/ទី\d{1,2}/,ordinal:"ទី%d",preparse:function(e){return e.replace(/[១២៣៤៥៦៧៨៩០]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/kn.js":function(e,t,n){!function(e){"use strict";var t={1:"೧",2:"೨",3:"೩",4:"೪",5:"೫",6:"೬",7:"೭",8:"೮",9:"೯",0:"೦"},n={"೧":"1","೨":"2","೩":"3","೪":"4","೫":"5","೬":"6","೭":"7","೮":"8","೯":"9","೦":"0"};e.defineLocale("kn",{months:"ಜನವರಿ_ಫೆಬ್ರವರಿ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂಬರ್_ಅಕ್ಟೋಬರ್_ನವೆಂಬರ್_ಡಿಸೆಂಬರ್".split("_"),monthsShort:"ಜನ_ಫೆಬ್ರ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂ_ಅಕ್ಟೋ_ನವೆಂ_ಡಿಸೆಂ".split("_"),monthsParseExact:!0,weekdays:"ಭಾನುವಾರ_ಸೋಮವಾರ_ಮಂಗಳವಾರ_ಬುಧವಾರ_ಗುರುವಾರ_ಶುಕ್ರವಾರ_ಶನಿವಾರ".split("_"),weekdaysShort:"ಭಾನು_ಸೋಮ_ಮಂಗಳ_ಬುಧ_ಗುರು_ಶುಕ್ರ_ಶನಿ".split("_"),weekdaysMin:"ಭಾ_ಸೋ_ಮಂ_ಬು_ಗು_ಶು_ಶ".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[ಇಂದು] LT",nextDay:"[ನಾಳೆ] LT",nextWeek:"dddd, LT",lastDay:"[ನಿನ್ನೆ] LT",lastWeek:"[ಕೊನೆಯ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ನಂತರ",past:"%s ಹಿಂದೆ",s:"ಕೆಲವು ಕ್ಷಣಗಳು",ss:"%d ಸೆಕೆಂಡುಗಳು",m:"ಒಂದು ನಿಮಿಷ",mm:"%d ನಿಮಿಷ",h:"ಒಂದು ಗಂಟೆ",hh:"%d ಗಂಟೆ",d:"ಒಂದು ದಿನ",dd:"%d ದಿನ",M:"ಒಂದು ತಿಂಗಳು",MM:"%d ತಿಂಗಳು",y:"ಒಂದು ವರ್ಷ",yy:"%d ವರ್ಷ"},preparse:function(e){return e.replace(/[೧೨೩೪೫೬೭೮೯೦]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/ರಾತ್ರಿ|ಬೆಳಿಗ್ಗೆ|ಮಧ್ಯಾಹ್ನ|ಸಂಜೆ/,meridiemHour:function(e,t){return 12===e&&(e=0),"ರಾತ್ರಿ"===t?e<4?e:e+12:"ಬೆಳಿಗ್ಗೆ"===t?e:"ಮಧ್ಯಾಹ್ನ"===t?e>=10?e:e+12:"ಸಂಜೆ"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"ರಾತ್ರಿ":e<10?"ಬೆಳಿಗ್ಗೆ":e<17?"ಮಧ್ಯಾಹ್ನ":e<20?"ಸಂಜೆ":"ರಾತ್ರಿ"},dayOfMonthOrdinalParse:/\d{1,2}(ನೇ)/,ordinal:function(e){return e+"ನೇ"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ko.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ko",{months:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),monthsShort:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),weekdays:"일요일_월요일_화요일_수요일_목요일_금요일_토요일".split("_"),weekdaysShort:"일_월_화_수_목_금_토".split("_"),weekdaysMin:"일_월_화_수_목_금_토".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY년 MMMM D일",LLL:"YYYY년 MMMM D일 A h:mm",LLLL:"YYYY년 MMMM D일 dddd A h:mm",l:"YYYY.MM.DD.",ll:"YYYY년 MMMM D일",lll:"YYYY년 MMMM D일 A h:mm",llll:"YYYY년 MMMM D일 dddd A h:mm"},calendar:{sameDay:"오늘 LT",nextDay:"내일 LT",nextWeek:"dddd LT",lastDay:"어제 LT",lastWeek:"지난주 dddd LT",sameElse:"L"},relativeTime:{future:"%s 후",past:"%s 전",s:"몇 초",ss:"%d초",m:"1분",mm:"%d분",h:"한 시간",hh:"%d시간",d:"하루",dd:"%d일",M:"한 달",MM:"%d달",y:"일 년",yy:"%d년"},dayOfMonthOrdinalParse:/\d{1,2}(일|월|주)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"일";case"M":return e+"월";case"w":case"W":return e+"주";default:return e}},meridiemParse:/오전|오후/,isPM:function(e){return"오후"===e},meridiem:function(e,t,n){return e<12?"오전":"오후"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ku.js":function(e,t,n){!function(e){"use strict";var t={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},n={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},o=["کانونی دووەم","شوبات","ئازار","نیسان","ئایار","حوزەیران","تەمموز","ئاب","ئەیلوول","تشرینی یەكەم","تشرینی دووەم","كانونی یەکەم"];e.defineLocale("ku",{months:o,monthsShort:o,weekdays:"یه‌كشه‌ممه‌_دووشه‌ممه‌_سێشه‌ممه‌_چوارشه‌ممه‌_پێنجشه‌ممه‌_هه‌ینی_شه‌ممه‌".split("_"),weekdaysShort:"یه‌كشه‌م_دووشه‌م_سێشه‌م_چوارشه‌م_پێنجشه‌م_هه‌ینی_شه‌ممه‌".split("_"),weekdaysMin:"ی_د_س_چ_پ_ه_ش".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/ئێواره‌|به‌یانی/,isPM:function(e){return/ئێواره‌/.test(e)},meridiem:function(e,t,n){return e<12?"به‌یانی":"ئێواره‌"},calendar:{sameDay:"[ئه‌مرۆ كاتژمێر] LT",nextDay:"[به‌یانی كاتژمێر] LT",nextWeek:"dddd [كاتژمێر] LT",lastDay:"[دوێنێ كاتژمێر] LT",lastWeek:"dddd [كاتژمێر] LT",sameElse:"L"},relativeTime:{future:"له‌ %s",past:"%s",s:"چه‌ند چركه‌یه‌ك",ss:"چركه‌ %d",m:"یه‌ك خوله‌ك",mm:"%d خوله‌ك",h:"یه‌ك كاتژمێر",hh:"%d كاتژمێر",d:"یه‌ك ڕۆژ",dd:"%d ڕۆژ",M:"یه‌ك مانگ",MM:"%d مانگ",y:"یه‌ك ساڵ",yy:"%d ساڵ"},preparse:function(e){return e.replace(/[١٢٣٤٥٦٧٨٩٠]/g,(function(e){return n[e]})).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"،")},week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ky.js":function(e,t,n){!function(e){"use strict";var t={0:"-чү",1:"-чи",2:"-чи",3:"-чү",4:"-чү",5:"-чи",6:"-чы",7:"-чи",8:"-чи",9:"-чу",10:"-чу",20:"-чы",30:"-чу",40:"-чы",50:"-чү",60:"-чы",70:"-чи",80:"-чи",90:"-чу",100:"-чү"};e.defineLocale("ky",{months:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"),monthsShort:"янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек".split("_"),weekdays:"Жекшемби_Дүйшөмбү_Шейшемби_Шаршемби_Бейшемби_Жума_Ишемби".split("_"),weekdaysShort:"Жек_Дүй_Шей_Шар_Бей_Жум_Ише".split("_"),weekdaysMin:"Жк_Дй_Шй_Шр_Бй_Жм_Иш".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Бүгүн саат] LT",nextDay:"[Эртең саат] LT",nextWeek:"dddd [саат] LT",lastDay:"[Кечээ саат] LT",lastWeek:"[Өткөн аптанын] dddd [күнү] [саат] LT",sameElse:"L"},relativeTime:{future:"%s ичинде",past:"%s мурун",s:"бирнече секунд",ss:"%d секунд",m:"бир мүнөт",mm:"%d мүнөт",h:"бир саат",hh:"%d саат",d:"бир күн",dd:"%d күн",M:"бир ай",MM:"%d ай",y:"бир жыл",yy:"%d жыл"},dayOfMonthOrdinalParse:/\d{1,2}-(чи|чы|чү|чу)/,ordinal:function(e){return e+(t[e]||t[e%10]||t[e>=100?100:null])},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/lb.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={m:["eng Minutt","enger Minutt"],h:["eng Stonn","enger Stonn"],d:["een Dag","engem Dag"],M:["ee Mount","engem Mount"],y:["ee Joer","engem Joer"]};return t?r[n][0]:r[n][1]}function n(e){if(e=parseInt(e,10),isNaN(e))return!1;if(e<0)return!0;if(e<10)return 4<=e&&e<=7;if(e<100){var t=e%10;return n(0===t?e/10:t)}if(e<1e4){for(;e>=10;)e/=10;return n(e)}return n(e/=1e3)}e.defineLocale("lb",{months:"Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg".split("_"),weekdaysShort:"So._Mé._Dë._Më._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mé_Dë_Më_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm [Auer]",LTS:"H:mm:ss [Auer]",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm [Auer]",LLLL:"dddd, D. MMMM YYYY H:mm [Auer]"},calendar:{sameDay:"[Haut um] LT",sameElse:"L",nextDay:"[Muer um] LT",nextWeek:"dddd [um] LT",lastDay:"[Gëschter um] LT",lastWeek:function(){switch(this.day()){case 2:case 4:return"[Leschten] dddd [um] LT";default:return"[Leschte] dddd [um] LT"}}},relativeTime:{future:function(e){return n(e.substr(0,e.indexOf(" ")))?"a "+e:"an "+e},past:function(e){return n(e.substr(0,e.indexOf(" ")))?"viru "+e:"virun "+e},s:"e puer Sekonnen",ss:"%d Sekonnen",m:t,mm:"%d Minutten",h:t,hh:"%d Stonnen",d:t,dd:"%d Deeg",M:t,MM:"%d Méint",y:t,yy:"%d Joer"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/lo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("lo",{months:"ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ".split("_"),monthsShort:"ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ".split("_"),weekdays:"ອາທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ".split("_"),weekdaysShort:"ທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ".split("_"),weekdaysMin:"ທ_ຈ_ອຄ_ພ_ພຫ_ສກ_ສ".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"ວັນdddd D MMMM YYYY HH:mm"},meridiemParse:/ຕອນເຊົ້າ|ຕອນແລງ/,isPM:function(e){return"ຕອນແລງ"===e},meridiem:function(e,t,n){return e<12?"ຕອນເຊົ້າ":"ຕອນແລງ"},calendar:{sameDay:"[ມື້ນີ້ເວລາ] LT",nextDay:"[ມື້ອື່ນເວລາ] LT",nextWeek:"[ວັນ]dddd[ໜ້າເວລາ] LT",lastDay:"[ມື້ວານນີ້ເວລາ] LT",lastWeek:"[ວັນ]dddd[ແລ້ວນີ້ເວລາ] LT",sameElse:"L"},relativeTime:{future:"ອີກ %s",past:"%sຜ່ານມາ",s:"ບໍ່ເທົ່າໃດວິນາທີ",ss:"%d ວິນາທີ",m:"1 ນາທີ",mm:"%d ນາທີ",h:"1 ຊົ່ວໂມງ",hh:"%d ຊົ່ວໂມງ",d:"1 ມື້",dd:"%d ມື້",M:"1 ເດືອນ",MM:"%d ເດືອນ",y:"1 ປີ",yy:"%d ປີ"},dayOfMonthOrdinalParse:/(ທີ່)\d{1,2}/,ordinal:function(e){return"ທີ່"+e}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/lt.js":function(e,t,n){!function(e){"use strict";var t={ss:"sekundė_sekundžių_sekundes",m:"minutė_minutės_minutę",mm:"minutės_minučių_minutes",h:"valanda_valandos_valandą",hh:"valandos_valandų_valandas",d:"diena_dienos_dieną",dd:"dienos_dienų_dienas",M:"mėnuo_mėnesio_mėnesį",MM:"mėnesiai_mėnesių_mėnesius",y:"metai_metų_metus",yy:"metai_metų_metus"};function n(e,t,n,o){return t?r(n)[0]:o?r(n)[1]:r(n)[2]}function o(e){return e%10==0||e>10&&e<20}function r(e){return t[e].split("_")}function s(e,t,s,a){var i=e+" ";return 1===e?i+n(0,t,s[0],a):t?i+(o(e)?r(s)[1]:r(s)[0]):a?i+r(s)[1]:i+(o(e)?r(s)[1]:r(s)[2])}e.defineLocale("lt",{months:{format:"sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio".split("_"),standalone:"sausis_vasaris_kovas_balandis_gegužė_birželis_liepa_rugpjūtis_rugsėjis_spalis_lapkritis_gruodis".split("_"),isFormat:/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?|MMMM?(\[[^\[\]]*\]|\s)+D[oD]?/},monthsShort:"sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd".split("_"),weekdays:{format:"sekmadienį_pirmadienį_antradienį_trečiadienį_ketvirtadienį_penktadienį_šeštadienį".split("_"),standalone:"sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis".split("_"),isFormat:/dddd HH:mm/},weekdaysShort:"Sek_Pir_Ant_Tre_Ket_Pen_Šeš".split("_"),weekdaysMin:"S_P_A_T_K_Pn_Š".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY [m.] MMMM D [d.]",LLL:"YYYY [m.] MMMM D [d.], HH:mm [val.]",LLLL:"YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]",l:"YYYY-MM-DD",ll:"YYYY [m.] MMMM D [d.]",lll:"YYYY [m.] MMMM D [d.], HH:mm [val.]",llll:"YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]"},calendar:{sameDay:"[Šiandien] LT",nextDay:"[Rytoj] LT",nextWeek:"dddd LT",lastDay:"[Vakar] LT",lastWeek:"[Praėjusį] dddd LT",sameElse:"L"},relativeTime:{future:"po %s",past:"prieš %s",s:function(e,t,n,o){return t?"kelios sekundės":o?"kelių sekundžių":"kelias sekundes"},ss:s,m:n,mm:s,h:n,hh:s,d:n,dd:s,M:n,MM:s,y:n,yy:s},dayOfMonthOrdinalParse:/\d{1,2}-oji/,ordinal:function(e){return e+"-oji"},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/lv.js":function(e,t,n){!function(e){"use strict";var t={ss:"sekundes_sekundēm_sekunde_sekundes".split("_"),m:"minūtes_minūtēm_minūte_minūtes".split("_"),mm:"minūtes_minūtēm_minūte_minūtes".split("_"),h:"stundas_stundām_stunda_stundas".split("_"),hh:"stundas_stundām_stunda_stundas".split("_"),d:"dienas_dienām_diena_dienas".split("_"),dd:"dienas_dienām_diena_dienas".split("_"),M:"mēneša_mēnešiem_mēnesis_mēneši".split("_"),MM:"mēneša_mēnešiem_mēnesis_mēneši".split("_"),y:"gada_gadiem_gads_gadi".split("_"),yy:"gada_gadiem_gads_gadi".split("_")};function n(e,t,n){return n?t%10==1&&t%100!=11?e[2]:e[3]:t%10==1&&t%100!=11?e[0]:e[1]}function o(e,o,r){return e+" "+n(t[r],e,o)}function r(e,o,r){return n(t[r],e,o)}e.defineLocale("lv",{months:"janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris".split("_"),monthsShort:"jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec".split("_"),weekdays:"svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena".split("_"),weekdaysShort:"Sv_P_O_T_C_Pk_S".split("_"),weekdaysMin:"Sv_P_O_T_C_Pk_S".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY.",LL:"YYYY. [gada] D. MMMM",LLL:"YYYY. [gada] D. MMMM, HH:mm",LLLL:"YYYY. [gada] D. MMMM, dddd, HH:mm"},calendar:{sameDay:"[Šodien pulksten] LT",nextDay:"[Rīt pulksten] LT",nextWeek:"dddd [pulksten] LT",lastDay:"[Vakar pulksten] LT",lastWeek:"[Pagājušā] dddd [pulksten] LT",sameElse:"L"},relativeTime:{future:"pēc %s",past:"pirms %s",s:function(e,t){return t?"dažas sekundes":"dažām sekundēm"},ss:o,m:r,mm:o,h:r,hh:o,d:r,dd:o,M:r,MM:o,y:r,yy:o},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/me.js":function(e,t,n){!function(e){"use strict";var t={words:{ss:["sekund","sekunda","sekundi"],m:["jedan minut","jednog minuta"],mm:["minut","minuta","minuta"],h:["jedan sat","jednog sata"],hh:["sat","sata","sati"],dd:["dan","dana","dana"],MM:["mjesec","mjeseca","mjeseci"],yy:["godina","godine","godina"]},correctGrammaticalCase:function(e,t){return 1===e?t[0]:e>=2&&e<=4?t[1]:t[2]},translate:function(e,n,o){var r=t.words[o];return 1===o.length?n?r[0]:r[1]:e+" "+t.correctGrammaticalCase(e,r)}};e.defineLocale("me",{months:"januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sjutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[juče u] LT",lastWeek:function(){return["[prošle] [nedjelje] [u] LT","[prošlog] [ponedjeljka] [u] LT","[prošlog] [utorka] [u] LT","[prošle] [srijede] [u] LT","[prošlog] [četvrtka] [u] LT","[prošlog] [petka] [u] LT","[prošle] [subote] [u] LT"][this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"nekoliko sekundi",ss:t.translate,m:t.translate,mm:t.translate,h:t.translate,hh:t.translate,d:"dan",dd:t.translate,M:"mjesec",MM:t.translate,y:"godinu",yy:t.translate},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/mi.js":function(e,t,n){!function(e){"use strict";e.defineLocale("mi",{months:"Kohi-tāte_Hui-tanguru_Poutū-te-rangi_Paenga-whāwhā_Haratua_Pipiri_Hōngoingoi_Here-turi-kōkā_Mahuru_Whiringa-ā-nuku_Whiringa-ā-rangi_Hakihea".split("_"),monthsShort:"Kohi_Hui_Pou_Pae_Hara_Pipi_Hōngoi_Here_Mahu_Whi-nu_Whi-ra_Haki".split("_"),monthsRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsStrictRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsShortRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsShortStrictRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,2}/i,weekdays:"Rātapu_Mane_Tūrei_Wenerei_Tāite_Paraire_Hātarei".split("_"),weekdaysShort:"Ta_Ma_Tū_We_Tāi_Pa_Hā".split("_"),weekdaysMin:"Ta_Ma_Tū_We_Tāi_Pa_Hā".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [i] HH:mm",LLLL:"dddd, D MMMM YYYY [i] HH:mm"},calendar:{sameDay:"[i teie mahana, i] LT",nextDay:"[apopo i] LT",nextWeek:"dddd [i] LT",lastDay:"[inanahi i] LT",lastWeek:"dddd [whakamutunga i] LT",sameElse:"L"},relativeTime:{future:"i roto i %s",past:"%s i mua",s:"te hēkona ruarua",ss:"%d hēkona",m:"he meneti",mm:"%d meneti",h:"te haora",hh:"%d haora",d:"he ra",dd:"%d ra",M:"he marama",MM:"%d marama",y:"he tau",yy:"%d tau"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/mk.js":function(e,t,n){!function(e){"use strict";e.defineLocale("mk",{months:"јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември".split("_"),monthsShort:"јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек".split("_"),weekdays:"недела_понеделник_вторник_среда_четврток_петок_сабота".split("_"),weekdaysShort:"нед_пон_вто_сре_чет_пет_саб".split("_"),weekdaysMin:"нe_пo_вт_ср_че_пе_сa".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[Денес во] LT",nextDay:"[Утре во] LT",nextWeek:"[Во] dddd [во] LT",lastDay:"[Вчера во] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[Изминатата] dddd [во] LT";case 1:case 2:case 4:case 5:return"[Изминатиот] dddd [во] LT"}},sameElse:"L"},relativeTime:{future:"за %s",past:"пред %s",s:"неколку секунди",ss:"%d секунди",m:"една минута",mm:"%d минути",h:"еден час",hh:"%d часа",d:"еден ден",dd:"%d дена",M:"еден месец",MM:"%d месеци",y:"една година",yy:"%d години"},dayOfMonthOrdinalParse:/\d{1,2}-(ев|ен|ти|ви|ри|ми)/,ordinal:function(e){var t=e%10,n=e%100;return 0===e?e+"-ев":0===n?e+"-ен":n>10&&n<20?e+"-ти":1===t?e+"-ви":2===t?e+"-ри":7===t||8===t?e+"-ми":e+"-ти"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ml.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ml",{months:"ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ".split("_"),monthsShort:"ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.".split("_"),monthsParseExact:!0,weekdays:"ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച".split("_"),weekdaysShort:"ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി".split("_"),weekdaysMin:"ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ".split("_"),longDateFormat:{LT:"A h:mm -നു",LTS:"A h:mm:ss -നു",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm -നു",LLLL:"dddd, D MMMM YYYY, A h:mm -നു"},calendar:{sameDay:"[ഇന്ന്] LT",nextDay:"[നാളെ] LT",nextWeek:"dddd, LT",lastDay:"[ഇന്നലെ] LT",lastWeek:"[കഴിഞ്ഞ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s കഴിഞ്ഞ്",past:"%s മുൻപ്",s:"അൽപ നിമിഷങ്ങൾ",ss:"%d സെക്കൻഡ്",m:"ഒരു മിനിറ്റ്",mm:"%d മിനിറ്റ്",h:"ഒരു മണിക്കൂർ",hh:"%d മണിക്കൂർ",d:"ഒരു ദിവസം",dd:"%d ദിവസം",M:"ഒരു മാസം",MM:"%d മാസം",y:"ഒരു വർഷം",yy:"%d വർഷം"},meridiemParse:/രാത്രി|രാവിലെ|ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി/i,meridiemHour:function(e,t){return 12===e&&(e=0),"രാത്രി"===t&&e>=4||"ഉച്ച കഴിഞ്ഞ്"===t||"വൈകുന്നേരം"===t?e+12:e},meridiem:function(e,t,n){return e<4?"രാത്രി":e<12?"രാവിലെ":e<17?"ഉച്ച കഴിഞ്ഞ്":e<20?"വൈകുന്നേരം":"രാത്രി"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/mn.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){switch(n){case"s":return t?"хэдхэн секунд":"хэдхэн секундын";case"ss":return e+(t?" секунд":" секундын");case"m":case"mm":return e+(t?" минут":" минутын");case"h":case"hh":return e+(t?" цаг":" цагийн");case"d":case"dd":return e+(t?" өдөр":" өдрийн");case"M":case"MM":return e+(t?" сар":" сарын");case"y":case"yy":return e+(t?" жил":" жилийн");default:return e}}e.defineLocale("mn",{months:"Нэгдүгээр сар_Хоёрдугаар сар_Гуравдугаар сар_Дөрөвдүгээр сар_Тавдугаар сар_Зургадугаар сар_Долдугаар сар_Наймдугаар сар_Есдүгээр сар_Аравдугаар сар_Арван нэгдүгээр сар_Арван хоёрдугаар сар".split("_"),monthsShort:"1 сар_2 сар_3 сар_4 сар_5 сар_6 сар_7 сар_8 сар_9 сар_10 сар_11 сар_12 сар".split("_"),monthsParseExact:!0,weekdays:"Ням_Даваа_Мягмар_Лхагва_Пүрэв_Баасан_Бямба".split("_"),weekdaysShort:"Ням_Дав_Мяг_Лха_Пүр_Баа_Бям".split("_"),weekdaysMin:"Ня_Да_Мя_Лх_Пү_Ба_Бя".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY оны MMMMын D",LLL:"YYYY оны MMMMын D HH:mm",LLLL:"dddd, YYYY оны MMMMын D HH:mm"},meridiemParse:/ҮӨ|ҮХ/i,isPM:function(e){return"ҮХ"===e},meridiem:function(e,t,n){return e<12?"ҮӨ":"ҮХ"},calendar:{sameDay:"[Өнөөдөр] LT",nextDay:"[Маргааш] LT",nextWeek:"[Ирэх] dddd LT",lastDay:"[Өчигдөр] LT",lastWeek:"[Өнгөрсөн] dddd LT",sameElse:"L"},relativeTime:{future:"%s дараа",past:"%s өмнө",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2} өдөр/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+" өдөр";default:return e}}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/mr.js":function(e,t,n){!function(e){"use strict";var t={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},n={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"};function o(e,t,n,o){var r="";if(t)switch(n){case"s":r="काही सेकंद";break;case"ss":r="%d सेकंद";break;case"m":r="एक मिनिट";break;case"mm":r="%d मिनिटे";break;case"h":r="एक तास";break;case"hh":r="%d तास";break;case"d":r="एक दिवस";break;case"dd":r="%d दिवस";break;case"M":r="एक महिना";break;case"MM":r="%d महिने";break;case"y":r="एक वर्ष";break;case"yy":r="%d वर्षे"}else switch(n){case"s":r="काही सेकंदां";break;case"ss":r="%d सेकंदां";break;case"m":r="एका मिनिटा";break;case"mm":r="%d मिनिटां";break;case"h":r="एका तासा";break;case"hh":r="%d तासां";break;case"d":r="एका दिवसा";break;case"dd":r="%d दिवसां";break;case"M":r="एका महिन्या";break;case"MM":r="%d महिन्यां";break;case"y":r="एका वर्षा";break;case"yy":r="%d वर्षां"}return r.replace(/%d/i,e)}e.defineLocale("mr",{months:"जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर".split("_"),monthsShort:"जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.".split("_"),monthsParseExact:!0,weekdays:"रविवार_सोमवार_मंगळवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),weekdaysShort:"रवि_सोम_मंगळ_बुध_गुरू_शुक्र_शनि".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),longDateFormat:{LT:"A h:mm वाजता",LTS:"A h:mm:ss वाजता",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm वाजता",LLLL:"dddd, D MMMM YYYY, A h:mm वाजता"},calendar:{sameDay:"[आज] LT",nextDay:"[उद्या] LT",nextWeek:"dddd, LT",lastDay:"[काल] LT",lastWeek:"[मागील] dddd, LT",sameElse:"L"},relativeTime:{future:"%sमध्ये",past:"%sपूर्वी",s:o,ss:o,m:o,mm:o,h:o,hh:o,d:o,dd:o,M:o,MM:o,y:o,yy:o},preparse:function(e){return e.replace(/[१२३४५६७८९०]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/पहाटे|सकाळी|दुपारी|सायंकाळी|रात्री/,meridiemHour:function(e,t){return 12===e&&(e=0),"पहाटे"===t||"सकाळी"===t?e:"दुपारी"===t||"सायंकाळी"===t||"रात्री"===t?e>=12?e:e+12:void 0},meridiem:function(e,t,n){return e>=0&&e<6?"पहाटे":e<12?"सकाळी":e<17?"दुपारी":e<20?"सायंकाळी":"रात्री"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ms-my.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ms-my",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|tengahari|petang|malam/,meridiemHour:function(e,t){return 12===e&&(e=0),"pagi"===t?e:"tengahari"===t?e>=11?e:e+12:"petang"===t||"malam"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"pagi":e<15?"tengahari":e<19?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",ss:"%d saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ms.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ms",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|tengahari|petang|malam/,meridiemHour:function(e,t){return 12===e&&(e=0),"pagi"===t?e:"tengahari"===t?e>=11?e:e+12:"petang"===t||"malam"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"pagi":e<15?"tengahari":e<19?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",ss:"%d saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/mt.js":function(e,t,n){!function(e){"use strict";e.defineLocale("mt",{months:"Jannar_Frar_Marzu_April_Mejju_Ġunju_Lulju_Awwissu_Settembru_Ottubru_Novembru_Diċembru".split("_"),monthsShort:"Jan_Fra_Mar_Apr_Mej_Ġun_Lul_Aww_Set_Ott_Nov_Diċ".split("_"),weekdays:"Il-Ħadd_It-Tnejn_It-Tlieta_L-Erbgħa_Il-Ħamis_Il-Ġimgħa_Is-Sibt".split("_"),weekdaysShort:"Ħad_Tne_Tli_Erb_Ħam_Ġim_Sib".split("_"),weekdaysMin:"Ħa_Tn_Tl_Er_Ħa_Ġi_Si".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Illum fil-]LT",nextDay:"[Għada fil-]LT",nextWeek:"dddd [fil-]LT",lastDay:"[Il-bieraħ fil-]LT",lastWeek:"dddd [li għadda] [fil-]LT",sameElse:"L"},relativeTime:{future:"f’ %s",past:"%s ilu",s:"ftit sekondi",ss:"%d sekondi",m:"minuta",mm:"%d minuti",h:"siegħa",hh:"%d siegħat",d:"ġurnata",dd:"%d ġranet",M:"xahar",MM:"%d xhur",y:"sena",yy:"%d sni"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/my.js":function(e,t,n){!function(e){"use strict";var t={1:"၁",2:"၂",3:"၃",4:"၄",5:"၅",6:"၆",7:"၇",8:"၈",9:"၉",0:"၀"},n={"၁":"1","၂":"2","၃":"3","၄":"4","၅":"5","၆":"6","၇":"7","၈":"8","၉":"9","၀":"0"};e.defineLocale("my",{months:"ဇန်နဝါရီ_ဖေဖော်ဝါရီ_မတ်_ဧပြီ_မေ_ဇွန်_ဇူလိုင်_သြဂုတ်_စက်တင်ဘာ_အောက်တိုဘာ_နိုဝင်ဘာ_ဒီဇင်ဘာ".split("_"),monthsShort:"ဇန်_ဖေ_မတ်_ပြီ_မေ_ဇွန်_လိုင်_သြ_စက်_အောက်_နို_ဒီ".split("_"),weekdays:"တနင်္ဂနွေ_တနင်္လာ_အင်္ဂါ_ဗုဒ္ဓဟူး_ကြာသပတေး_သောကြာ_စနေ".split("_"),weekdaysShort:"နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),weekdaysMin:"နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[ယနေ.] LT [မှာ]",nextDay:"[မနက်ဖြန်] LT [မှာ]",nextWeek:"dddd LT [မှာ]",lastDay:"[မနေ.က] LT [မှာ]",lastWeek:"[ပြီးခဲ့သော] dddd LT [မှာ]",sameElse:"L"},relativeTime:{future:"လာမည့် %s မှာ",past:"လွန်ခဲ့သော %s က",s:"စက္ကန်.အနည်းငယ်",ss:"%d စက္ကန့်",m:"တစ်မိနစ်",mm:"%d မိနစ်",h:"တစ်နာရီ",hh:"%d နာရီ",d:"တစ်ရက်",dd:"%d ရက်",M:"တစ်လ",MM:"%d လ",y:"တစ်နှစ်",yy:"%d နှစ်"},preparse:function(e){return e.replace(/[၁၂၃၄၅၆၇၈၉၀]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/nb.js":function(e,t,n){!function(e){"use strict";e.defineLocale("nb",{months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan._feb._mars_apr._mai_juni_juli_aug._sep._okt._nov._des.".split("_"),monthsParseExact:!0,weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"sø._ma._ti._on._to._fr._lø.".split("_"),weekdaysMin:"sø_ma_ti_on_to_fr_lø".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] HH:mm",LLLL:"dddd D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[i dag kl.] LT",nextDay:"[i morgen kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[i går kl.] LT",lastWeek:"[forrige] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s siden",s:"noen sekunder",ss:"%d sekunder",m:"ett minutt",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dager",w:"en uke",ww:"%d uker",M:"en måned",MM:"%d måneder",y:"ett år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ne.js":function(e,t,n){!function(e){"use strict";var t={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},n={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"};e.defineLocale("ne",{months:"जनवरी_फेब्रुवरी_मार्च_अप्रिल_मई_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर".split("_"),monthsShort:"जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.".split("_"),monthsParseExact:!0,weekdays:"आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार".split("_"),weekdaysShort:"आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.".split("_"),weekdaysMin:"आ._सो._मं._बु._बि._शु._श.".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"Aको h:mm बजे",LTS:"Aको h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, Aको h:mm बजे",LLLL:"dddd, D MMMM YYYY, Aको h:mm बजे"},preparse:function(e){return e.replace(/[१२३४५६७८९०]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/राति|बिहान|दिउँसो|साँझ/,meridiemHour:function(e,t){return 12===e&&(e=0),"राति"===t?e<4?e:e+12:"बिहान"===t?e:"दिउँसो"===t?e>=10?e:e+12:"साँझ"===t?e+12:void 0},meridiem:function(e,t,n){return e<3?"राति":e<12?"बिहान":e<16?"दिउँसो":e<20?"साँझ":"राति"},calendar:{sameDay:"[आज] LT",nextDay:"[भोलि] LT",nextWeek:"[आउँदो] dddd[,] LT",lastDay:"[हिजो] LT",lastWeek:"[गएको] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%sमा",past:"%s अगाडि",s:"केही क्षण",ss:"%d सेकेण्ड",m:"एक मिनेट",mm:"%d मिनेट",h:"एक घण्टा",hh:"%d घण्टा",d:"एक दिन",dd:"%d दिन",M:"एक महिना",MM:"%d महिना",y:"एक बर्ष",yy:"%d बर्ष"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/nl-be.js":function(e,t,n){!function(e){"use strict";var t="jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_"),n="jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"),o=[/^jan/i,/^feb/i,/^maart|mrt.?$/i,/^apr/i,/^mei$/i,/^jun[i.]?$/i,/^jul[i.]?$/i,/^aug/i,/^sep/i,/^okt/i,/^nov/i,/^dec/i],r=/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i;e.defineLocale("nl-be",{months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december)/i,monthsShortStrictRegex:/^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"zo_ma_di_wo_do_vr_za".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[vandaag om] LT",nextDay:"[morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",ss:"%d seconden",m:"één minuut",mm:"%d minuten",h:"één uur",hh:"%d uur",d:"één dag",dd:"%d dagen",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaar"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/nl.js":function(e,t,n){!function(e){"use strict";var t="jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_"),n="jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"),o=[/^jan/i,/^feb/i,/^maart|mrt.?$/i,/^apr/i,/^mei$/i,/^jun[i.]?$/i,/^jul[i.]?$/i,/^aug/i,/^sep/i,/^okt/i,/^nov/i,/^dec/i],r=/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i;e.defineLocale("nl",{months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:function(e,o){return e?/-MMM-/.test(o)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december)/i,monthsShortStrictRegex:/^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"zo_ma_di_wo_do_vr_za".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[vandaag om] LT",nextDay:"[morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",ss:"%d seconden",m:"één minuut",mm:"%d minuten",h:"één uur",hh:"%d uur",d:"één dag",dd:"%d dagen",w:"één week",ww:"%d weken",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaar"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/nn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("nn",{months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan._feb._mars_apr._mai_juni_juli_aug._sep._okt._nov._des.".split("_"),monthsParseExact:!0,weekdays:"sundag_måndag_tysdag_onsdag_torsdag_fredag_laurdag".split("_"),weekdaysShort:"su._må._ty._on._to._fr._lau.".split("_"),weekdaysMin:"su_må_ty_on_to_fr_la".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[I dag klokka] LT",nextDay:"[I morgon klokka] LT",nextWeek:"dddd [klokka] LT",lastDay:"[I går klokka] LT",lastWeek:"[Føregåande] dddd [klokka] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s sidan",s:"nokre sekund",ss:"%d sekund",m:"eit minutt",mm:"%d minutt",h:"ein time",hh:"%d timar",d:"ein dag",dd:"%d dagar",w:"ei veke",ww:"%d veker",M:"ein månad",MM:"%d månader",y:"eit år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/oc-lnc.js":function(e,t,n){!function(e){"use strict";e.defineLocale("oc-lnc",{months:{standalone:"genièr_febrièr_març_abril_mai_junh_julhet_agost_setembre_octòbre_novembre_decembre".split("_"),format:"de genièr_de febrièr_de març_d'abril_de mai_de junh_de julhet_d'agost_de setembre_d'octòbre_de novembre_de decembre".split("_"),isFormat:/D[oD]?(\s)+MMMM/},monthsShort:"gen._febr._març_abr._mai_junh_julh._ago._set._oct._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"dimenge_diluns_dimars_dimècres_dijòus_divendres_dissabte".split("_"),weekdaysShort:"dg._dl._dm._dc._dj._dv._ds.".split("_"),weekdaysMin:"dg_dl_dm_dc_dj_dv_ds".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [de] YYYY",ll:"D MMM YYYY",LLL:"D MMMM [de] YYYY [a] H:mm",lll:"D MMM YYYY, H:mm",LLLL:"dddd D MMMM [de] YYYY [a] H:mm",llll:"ddd D MMM YYYY, H:mm"},calendar:{sameDay:"[uèi a] LT",nextDay:"[deman a] LT",nextWeek:"dddd [a] LT",lastDay:"[ièr a] LT",lastWeek:"dddd [passat a] LT",sameElse:"L"},relativeTime:{future:"d'aquí %s",past:"fa %s",s:"unas segondas",ss:"%d segondas",m:"una minuta",mm:"%d minutas",h:"una ora",hh:"%d oras",d:"un jorn",dd:"%d jorns",M:"un mes",MM:"%d meses",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(r|n|t|è|a)/,ordinal:function(e,t){var n=1===e?"r":2===e?"n":3===e?"r":4===e?"t":"è";return"w"!==t&&"W"!==t||(n="a"),e+n},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/pa-in.js":function(e,t,n){!function(e){"use strict";var t={1:"੧",2:"੨",3:"੩",4:"੪",5:"੫",6:"੬",7:"੭",8:"੮",9:"੯",0:"੦"},n={"੧":"1","੨":"2","੩":"3","੪":"4","੫":"5","੬":"6","੭":"7","੮":"8","੯":"9","੦":"0"};e.defineLocale("pa-in",{months:"ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ".split("_"),monthsShort:"ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ".split("_"),weekdays:"ਐਤਵਾਰ_ਸੋਮਵਾਰ_ਮੰਗਲਵਾਰ_ਬੁਧਵਾਰ_ਵੀਰਵਾਰ_ਸ਼ੁੱਕਰਵਾਰ_ਸ਼ਨੀਚਰਵਾਰ".split("_"),weekdaysShort:"ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ".split("_"),weekdaysMin:"ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ".split("_"),longDateFormat:{LT:"A h:mm ਵਜੇ",LTS:"A h:mm:ss ਵਜੇ",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm ਵਜੇ",LLLL:"dddd, D MMMM YYYY, A h:mm ਵਜੇ"},calendar:{sameDay:"[ਅਜ] LT",nextDay:"[ਕਲ] LT",nextWeek:"[ਅਗਲਾ] dddd, LT",lastDay:"[ਕਲ] LT",lastWeek:"[ਪਿਛਲੇ] dddd, LT",sameElse:"L"},relativeTime:{future:"%s ਵਿੱਚ",past:"%s ਪਿਛਲੇ",s:"ਕੁਝ ਸਕਿੰਟ",ss:"%d ਸਕਿੰਟ",m:"ਇਕ ਮਿੰਟ",mm:"%d ਮਿੰਟ",h:"ਇੱਕ ਘੰਟਾ",hh:"%d ਘੰਟੇ",d:"ਇੱਕ ਦਿਨ",dd:"%d ਦਿਨ",M:"ਇੱਕ ਮਹੀਨਾ",MM:"%d ਮਹੀਨੇ",y:"ਇੱਕ ਸਾਲ",yy:"%d ਸਾਲ"},preparse:function(e){return e.replace(/[੧੨੩੪੫੬੭੮੯੦]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/ਰਾਤ|ਸਵੇਰ|ਦੁਪਹਿਰ|ਸ਼ਾਮ/,meridiemHour:function(e,t){return 12===e&&(e=0),"ਰਾਤ"===t?e<4?e:e+12:"ਸਵੇਰ"===t?e:"ਦੁਪਹਿਰ"===t?e>=10?e:e+12:"ਸ਼ਾਮ"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"ਰਾਤ":e<10?"ਸਵੇਰ":e<17?"ਦੁਪਹਿਰ":e<20?"ਸ਼ਾਮ":"ਰਾਤ"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/pl.js":function(e,t,n){!function(e){"use strict";var t="styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień".split("_"),n="stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia".split("_"),o=[/^sty/i,/^lut/i,/^mar/i,/^kwi/i,/^maj/i,/^cze/i,/^lip/i,/^sie/i,/^wrz/i,/^paź/i,/^lis/i,/^gru/i];function r(e){return e%10<5&&e%10>1&&~~(e/10)%10!=1}function s(e,t,n){var o=e+" ";switch(n){case"ss":return o+(r(e)?"sekundy":"sekund");case"m":return t?"minuta":"minutę";case"mm":return o+(r(e)?"minuty":"minut");case"h":return t?"godzina":"godzinę";case"hh":return o+(r(e)?"godziny":"godzin");case"ww":return o+(r(e)?"tygodnie":"tygodni");case"MM":return o+(r(e)?"miesiące":"miesięcy");case"yy":return o+(r(e)?"lata":"lat")}}e.defineLocale("pl",{months:function(e,o){return e?/D MMMM/.test(o)?n[e.month()]:t[e.month()]:t},monthsShort:"sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru".split("_"),monthsParse:o,longMonthsParse:o,shortMonthsParse:o,weekdays:"niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota".split("_"),weekdaysShort:"ndz_pon_wt_śr_czw_pt_sob".split("_"),weekdaysMin:"Nd_Pn_Wt_Śr_Cz_Pt_So".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Dziś o] LT",nextDay:"[Jutro o] LT",nextWeek:function(){switch(this.day()){case 0:return"[W niedzielę o] LT";case 2:return"[We wtorek o] LT";case 3:return"[W środę o] LT";case 6:return"[W sobotę o] LT";default:return"[W] dddd [o] LT"}},lastDay:"[Wczoraj o] LT",lastWeek:function(){switch(this.day()){case 0:return"[W zeszłą niedzielę o] LT";case 3:return"[W zeszłą środę o] LT";case 6:return"[W zeszłą sobotę o] LT";default:return"[W zeszły] dddd [o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"%s temu",s:"kilka sekund",ss:s,m:s,mm:s,h:s,hh:s,d:"1 dzień",dd:"%d dni",w:"tydzień",ww:s,M:"miesiąc",MM:s,y:"rok",yy:s},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/pt-br.js":function(e,t,n){!function(e){"use strict";e.defineLocale("pt-br",{months:"janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),weekdays:"domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado".split("_"),weekdaysShort:"dom_seg_ter_qua_qui_sex_sáb".split("_"),weekdaysMin:"do_2ª_3ª_4ª_5ª_6ª_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY [às] HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY [às] HH:mm"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"há %s",s:"poucos segundos",ss:"%d segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",invalidDate:"Data inválida"})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/pt.js":function(e,t,n){!function(e){"use strict";e.defineLocale("pt",{months:"janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),weekdays:"Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado".split("_"),weekdaysShort:"Dom_Seg_Ter_Qua_Qui_Sex_Sáb".split("_"),weekdaysMin:"Do_2ª_3ª_4ª_5ª_6ª_Sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY HH:mm"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"há %s",s:"segundos",ss:"%d segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",w:"uma semana",ww:"%d semanas",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ro.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){var o=" ";return(e%100>=20||e>=100&&e%100==0)&&(o=" de "),e+o+{ss:"secunde",mm:"minute",hh:"ore",dd:"zile",ww:"săptămâni",MM:"luni",yy:"ani"}[n]}e.defineLocale("ro",{months:"ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie".split("_"),monthsShort:"ian._feb._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"duminică_luni_marți_miercuri_joi_vineri_sâmbătă".split("_"),weekdaysShort:"Dum_Lun_Mar_Mie_Joi_Vin_Sâm".split("_"),weekdaysMin:"Du_Lu_Ma_Mi_Jo_Vi_Sâ".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[azi la] LT",nextDay:"[mâine la] LT",nextWeek:"dddd [la] LT",lastDay:"[ieri la] LT",lastWeek:"[fosta] dddd [la] LT",sameElse:"L"},relativeTime:{future:"peste %s",past:"%s în urmă",s:"câteva secunde",ss:t,m:"un minut",mm:t,h:"o oră",hh:t,d:"o zi",dd:t,w:"o săptămână",ww:t,M:"o lună",MM:t,y:"un an",yy:t},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ru.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){return"m"===n?t?"минута":"минуту":e+" "+(o=+e,r={ss:t?"секунда_секунды_секунд":"секунду_секунды_секунд",mm:t?"минута_минуты_минут":"минуту_минуты_минут",hh:"час_часа_часов",dd:"день_дня_дней",ww:"неделя_недели_недель",MM:"месяц_месяца_месяцев",yy:"год_года_лет"}[n].split("_"),o%10==1&&o%100!=11?r[0]:o%10>=2&&o%10<=4&&(o%100<10||o%100>=20)?r[1]:r[2]);var o,r}var n=[/^янв/i,/^фев/i,/^мар/i,/^апр/i,/^ма[йя]/i,/^июн/i,/^июл/i,/^авг/i,/^сен/i,/^окт/i,/^ноя/i,/^дек/i];e.defineLocale("ru",{months:{format:"января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря".split("_"),standalone:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_")},monthsShort:{format:"янв._февр._мар._апр._мая_июня_июля_авг._сент._окт._нояб._дек.".split("_"),standalone:"янв._февр._март_апр._май_июнь_июль_авг._сент._окт._нояб._дек.".split("_")},weekdays:{standalone:"воскресенье_понедельник_вторник_среда_четверг_пятница_суббота".split("_"),format:"воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу".split("_"),isFormat:/\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?] ?dddd/},weekdaysShort:"вс_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"вс_пн_вт_ср_чт_пт_сб".split("_"),monthsParse:n,longMonthsParse:n,shortMonthsParse:n,monthsRegex:/^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,monthsShortRegex:/^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,monthsStrictRegex:/^(январ[яь]|феврал[яь]|марта?|апрел[яь]|ма[яй]|июн[яь]|июл[яь]|августа?|сентябр[яь]|октябр[яь]|ноябр[яь]|декабр[яь])/i,monthsShortStrictRegex:/^(янв\.|февр?\.|мар[т.]|апр\.|ма[яй]|июн[ья.]|июл[ья.]|авг\.|сент?\.|окт\.|нояб?\.|дек\.)/i,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., H:mm",LLLL:"dddd, D MMMM YYYY г., H:mm"},calendar:{sameDay:"[Сегодня, в] LT",nextDay:"[Завтра, в] LT",lastDay:"[Вчера, в] LT",nextWeek:function(e){if(e.week()===this.week())return 2===this.day()?"[Во] dddd, [в] LT":"[В] dddd, [в] LT";switch(this.day()){case 0:return"[В следующее] dddd, [в] LT";case 1:case 2:case 4:return"[В следующий] dddd, [в] LT";case 3:case 5:case 6:return"[В следующую] dddd, [в] LT"}},lastWeek:function(e){if(e.week()===this.week())return 2===this.day()?"[Во] dddd, [в] LT":"[В] dddd, [в] LT";switch(this.day()){case 0:return"[В прошлое] dddd, [в] LT";case 1:case 2:case 4:return"[В прошлый] dddd, [в] LT";case 3:case 5:case 6:return"[В прошлую] dddd, [в] LT"}},sameElse:"L"},relativeTime:{future:"через %s",past:"%s назад",s:"несколько секунд",ss:t,m:t,mm:t,h:"час",hh:t,d:"день",dd:t,w:"неделя",ww:t,M:"месяц",MM:t,y:"год",yy:t},meridiemParse:/ночи|утра|дня|вечера/i,isPM:function(e){return/^(дня|вечера)$/.test(e)},meridiem:function(e,t,n){return e<4?"ночи":e<12?"утра":e<17?"дня":"вечера"},dayOfMonthOrdinalParse:/\d{1,2}-(й|го|я)/,ordinal:function(e,t){switch(t){case"M":case"d":case"DDD":return e+"-й";case"D":return e+"-го";case"w":case"W":return e+"-я";default:return e}},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sd.js":function(e,t,n){!function(e){"use strict";var t=["جنوري","فيبروري","مارچ","اپريل","مئي","جون","جولاءِ","آگسٽ","سيپٽمبر","آڪٽوبر","نومبر","ڊسمبر"],n=["آچر","سومر","اڱارو","اربع","خميس","جمع","ڇنڇر"];e.defineLocale("sd",{months:t,monthsShort:t,weekdays:n,weekdaysShort:n,weekdaysMin:n,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd، D MMMM YYYY HH:mm"},meridiemParse:/صبح|شام/,isPM:function(e){return"شام"===e},meridiem:function(e,t,n){return e<12?"صبح":"شام"},calendar:{sameDay:"[اڄ] LT",nextDay:"[سڀاڻي] LT",nextWeek:"dddd [اڳين هفتي تي] LT",lastDay:"[ڪالهه] LT",lastWeek:"[گزريل هفتي] dddd [تي] LT",sameElse:"L"},relativeTime:{future:"%s پوء",past:"%s اڳ",s:"چند سيڪنڊ",ss:"%d سيڪنڊ",m:"هڪ منٽ",mm:"%d منٽ",h:"هڪ ڪلاڪ",hh:"%d ڪلاڪ",d:"هڪ ڏينهن",dd:"%d ڏينهن",M:"هڪ مهينو",MM:"%d مهينا",y:"هڪ سال",yy:"%d سال"},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/se.js":function(e,t,n){!function(e){"use strict";e.defineLocale("se",{months:"ođđajagemánnu_guovvamánnu_njukčamánnu_cuoŋománnu_miessemánnu_geassemánnu_suoidnemánnu_borgemánnu_čakčamánnu_golggotmánnu_skábmamánnu_juovlamánnu".split("_"),monthsShort:"ođđj_guov_njuk_cuo_mies_geas_suoi_borg_čakč_golg_skáb_juov".split("_"),weekdays:"sotnabeaivi_vuossárga_maŋŋebárga_gaskavahkku_duorastat_bearjadat_lávvardat".split("_"),weekdaysShort:"sotn_vuos_maŋ_gask_duor_bear_láv".split("_"),weekdaysMin:"s_v_m_g_d_b_L".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"MMMM D. [b.] YYYY",LLL:"MMMM D. [b.] YYYY [ti.] HH:mm",LLLL:"dddd, MMMM D. [b.] YYYY [ti.] HH:mm"},calendar:{sameDay:"[otne ti] LT",nextDay:"[ihttin ti] LT",nextWeek:"dddd [ti] LT",lastDay:"[ikte ti] LT",lastWeek:"[ovddit] dddd [ti] LT",sameElse:"L"},relativeTime:{future:"%s geažes",past:"maŋit %s",s:"moadde sekunddat",ss:"%d sekunddat",m:"okta minuhta",mm:"%d minuhtat",h:"okta diimmu",hh:"%d diimmut",d:"okta beaivi",dd:"%d beaivvit",M:"okta mánnu",MM:"%d mánut",y:"okta jahki",yy:"%d jagit"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/si.js":function(e,t,n){!function(e){"use strict";e.defineLocale("si",{months:"ජනවාරි_පෙබරවාරි_මාර්තු_අප්‍රේල්_මැයි_ජූනි_ජූලි_අගෝස්තු_සැප්තැම්බර්_ඔක්තෝබර්_නොවැම්බර්_දෙසැම්බර්".split("_"),monthsShort:"ජන_පෙබ_මාර්_අප්_මැයි_ජූනි_ජූලි_අගෝ_සැප්_ඔක්_නොවැ_දෙසැ".split("_"),weekdays:"ඉරිදා_සඳුදා_අඟහරුවාදා_බදාදා_බ්‍රහස්පතින්දා_සිකුරාදා_සෙනසුරාදා".split("_"),weekdaysShort:"ඉරි_සඳු_අඟ_බදා_බ්‍රහ_සිකු_සෙන".split("_"),weekdaysMin:"ඉ_ස_අ_බ_බ්‍ර_සි_සෙ".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"a h:mm",LTS:"a h:mm:ss",L:"YYYY/MM/DD",LL:"YYYY MMMM D",LLL:"YYYY MMMM D, a h:mm",LLLL:"YYYY MMMM D [වැනි] dddd, a h:mm:ss"},calendar:{sameDay:"[අද] LT[ට]",nextDay:"[හෙට] LT[ට]",nextWeek:"dddd LT[ට]",lastDay:"[ඊයේ] LT[ට]",lastWeek:"[පසුගිය] dddd LT[ට]",sameElse:"L"},relativeTime:{future:"%sකින්",past:"%sකට පෙර",s:"තත්පර කිහිපය",ss:"තත්පර %d",m:"මිනිත්තුව",mm:"මිනිත්තු %d",h:"පැය",hh:"පැය %d",d:"දිනය",dd:"දින %d",M:"මාසය",MM:"මාස %d",y:"වසර",yy:"වසර %d"},dayOfMonthOrdinalParse:/\d{1,2} වැනි/,ordinal:function(e){return e+" වැනි"},meridiemParse:/පෙර වරු|පස් වරු|පෙ.ව|ප.ව./,isPM:function(e){return"ප.ව."===e||"පස් වරු"===e},meridiem:function(e,t,n){return e>11?n?"ප.ව.":"පස් වරු":n?"පෙ.ව.":"පෙර වරු"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sk.js":function(e,t,n){!function(e){"use strict";var t="január_február_marec_apríl_máj_jún_júl_august_september_október_november_december".split("_"),n="jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec".split("_");function o(e){return e>1&&e<5}function r(e,t,n,r){var s=e+" ";switch(n){case"s":return t||r?"pár sekúnd":"pár sekundami";case"ss":return t||r?s+(o(e)?"sekundy":"sekúnd"):s+"sekundami";case"m":return t?"minúta":r?"minútu":"minútou";case"mm":return t||r?s+(o(e)?"minúty":"minút"):s+"minútami";case"h":return t?"hodina":r?"hodinu":"hodinou";case"hh":return t||r?s+(o(e)?"hodiny":"hodín"):s+"hodinami";case"d":return t||r?"deň":"dňom";case"dd":return t||r?s+(o(e)?"dni":"dní"):s+"dňami";case"M":return t||r?"mesiac":"mesiacom";case"MM":return t||r?s+(o(e)?"mesiace":"mesiacov"):s+"mesiacmi";case"y":return t||r?"rok":"rokom";case"yy":return t||r?s+(o(e)?"roky":"rokov"):s+"rokmi"}}e.defineLocale("sk",{months:t,monthsShort:n,weekdays:"nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota".split("_"),weekdaysShort:"ne_po_ut_st_št_pi_so".split("_"),weekdaysMin:"ne_po_ut_st_št_pi_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm"},calendar:{sameDay:"[dnes o] LT",nextDay:"[zajtra o] LT",nextWeek:function(){switch(this.day()){case 0:return"[v nedeľu o] LT";case 1:case 2:return"[v] dddd [o] LT";case 3:return"[v stredu o] LT";case 4:return"[vo štvrtok o] LT";case 5:return"[v piatok o] LT";case 6:return"[v sobotu o] LT"}},lastDay:"[včera o] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulú nedeľu o] LT";case 1:case 2:return"[minulý] dddd [o] LT";case 3:return"[minulú stredu o] LT";case 4:case 5:return"[minulý] dddd [o] LT";case 6:return"[minulú sobotu o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"pred %s",s:r,ss:r,m:r,mm:r,h:r,hh:r,d:r,dd:r,M:r,MM:r,y:r,yy:r},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sl.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r=e+" ";switch(n){case"s":return t||o?"nekaj sekund":"nekaj sekundami";case"ss":return r+(1===e?t?"sekundo":"sekundi":2===e?t||o?"sekundi":"sekundah":e<5?t||o?"sekunde":"sekundah":"sekund");case"m":return t?"ena minuta":"eno minuto";case"mm":return r+(1===e?t?"minuta":"minuto":2===e?t||o?"minuti":"minutama":e<5?t||o?"minute":"minutami":t||o?"minut":"minutami");case"h":return t?"ena ura":"eno uro";case"hh":return r+(1===e?t?"ura":"uro":2===e?t||o?"uri":"urama":e<5?t||o?"ure":"urami":t||o?"ur":"urami");case"d":return t||o?"en dan":"enim dnem";case"dd":return r+(1===e?t||o?"dan":"dnem":2===e?t||o?"dni":"dnevoma":t||o?"dni":"dnevi");case"M":return t||o?"en mesec":"enim mesecem";case"MM":return r+(1===e?t||o?"mesec":"mesecem":2===e?t||o?"meseca":"mesecema":e<5?t||o?"mesece":"meseci":t||o?"mesecev":"meseci");case"y":return t||o?"eno leto":"enim letom";case"yy":return r+(1===e?t||o?"leto":"letom":2===e?t||o?"leti":"letoma":e<5?t||o?"leta":"leti":t||o?"let":"leti")}}e.defineLocale("sl",{months:"januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota".split("_"),weekdaysShort:"ned._pon._tor._sre._čet._pet._sob.".split("_"),weekdaysMin:"ne_po_to_sr_če_pe_so".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danes ob] LT",nextDay:"[jutri ob] LT",nextWeek:function(){switch(this.day()){case 0:return"[v] [nedeljo] [ob] LT";case 3:return"[v] [sredo] [ob] LT";case 6:return"[v] [soboto] [ob] LT";case 1:case 2:case 4:case 5:return"[v] dddd [ob] LT"}},lastDay:"[včeraj ob] LT",lastWeek:function(){switch(this.day()){case 0:return"[prejšnjo] [nedeljo] [ob] LT";case 3:return"[prejšnjo] [sredo] [ob] LT";case 6:return"[prejšnjo] [soboto] [ob] LT";case 1:case 2:case 4:case 5:return"[prejšnji] dddd [ob] LT"}},sameElse:"L"},relativeTime:{future:"čez %s",past:"pred %s",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sq.js":function(e,t,n){!function(e){"use strict";e.defineLocale("sq",{months:"Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_Nëntor_Dhjetor".split("_"),monthsShort:"Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_Nën_Dhj".split("_"),weekdays:"E Diel_E Hënë_E Martë_E Mërkurë_E Enjte_E Premte_E Shtunë".split("_"),weekdaysShort:"Die_Hën_Mar_Mër_Enj_Pre_Sht".split("_"),weekdaysMin:"D_H_Ma_Më_E_P_Sh".split("_"),weekdaysParseExact:!0,meridiemParse:/PD|MD/,isPM:function(e){return"M"===e.charAt(0)},meridiem:function(e,t,n){return e<12?"PD":"MD"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Sot në] LT",nextDay:"[Nesër në] LT",nextWeek:"dddd [në] LT",lastDay:"[Dje në] LT",lastWeek:"dddd [e kaluar në] LT",sameElse:"L"},relativeTime:{future:"në %s",past:"%s më parë",s:"disa sekonda",ss:"%d sekonda",m:"një minutë",mm:"%d minuta",h:"një orë",hh:"%d orë",d:"një ditë",dd:"%d ditë",M:"një muaj",MM:"%d muaj",y:"një vit",yy:"%d vite"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sr-cyrl.js":function(e,t,n){!function(e){"use strict";var t={words:{ss:["секунда","секунде","секунди"],m:["један минут","једне минуте"],mm:["минут","минуте","минута"],h:["један сат","једног сата"],hh:["сат","сата","сати"],dd:["дан","дана","дана"],MM:["месец","месеца","месеци"],yy:["година","године","година"]},correctGrammaticalCase:function(e,t){return 1===e?t[0]:e>=2&&e<=4?t[1]:t[2]},translate:function(e,n,o){var r=t.words[o];return 1===o.length?n?r[0]:r[1]:e+" "+t.correctGrammaticalCase(e,r)}};e.defineLocale("sr-cyrl",{months:"јануар_фебруар_март_април_мај_јун_јул_август_септембар_октобар_новембар_децембар".split("_"),monthsShort:"јан._феб._мар._апр._мај_јун_јул_авг._сеп._окт._нов._дец.".split("_"),monthsParseExact:!0,weekdays:"недеља_понедељак_уторак_среда_четвртак_петак_субота".split("_"),weekdaysShort:"нед._пон._уто._сре._чет._пет._суб.".split("_"),weekdaysMin:"не_по_ут_ср_че_пе_су".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D. M. YYYY.",LL:"D. MMMM YYYY.",LLL:"D. MMMM YYYY. H:mm",LLLL:"dddd, D. MMMM YYYY. H:mm"},calendar:{sameDay:"[данас у] LT",nextDay:"[сутра у] LT",nextWeek:function(){switch(this.day()){case 0:return"[у] [недељу] [у] LT";case 3:return"[у] [среду] [у] LT";case 6:return"[у] [суботу] [у] LT";case 1:case 2:case 4:case 5:return"[у] dddd [у] LT"}},lastDay:"[јуче у] LT",lastWeek:function(){return["[прошле] [недеље] [у] LT","[прошлог] [понедељка] [у] LT","[прошлог] [уторка] [у] LT","[прошле] [среде] [у] LT","[прошлог] [четвртка] [у] LT","[прошлог] [петка] [у] LT","[прошле] [суботе] [у] LT"][this.day()]},sameElse:"L"},relativeTime:{future:"за %s",past:"пре %s",s:"неколико секунди",ss:t.translate,m:t.translate,mm:t.translate,h:t.translate,hh:t.translate,d:"дан",dd:t.translate,M:"месец",MM:t.translate,y:"годину",yy:t.translate},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sr.js":function(e,t,n){!function(e){"use strict";var t={words:{ss:["sekunda","sekunde","sekundi"],m:["jedan minut","jedne minute"],mm:["minut","minute","minuta"],h:["jedan sat","jednog sata"],hh:["sat","sata","sati"],dd:["dan","dana","dana"],MM:["mesec","meseca","meseci"],yy:["godina","godine","godina"]},correctGrammaticalCase:function(e,t){return 1===e?t[0]:e>=2&&e<=4?t[1]:t[2]},translate:function(e,n,o){var r=t.words[o];return 1===o.length?n?r[0]:r[1]:e+" "+t.correctGrammaticalCase(e,r)}};e.defineLocale("sr",{months:"januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedelja_ponedeljak_utorak_sreda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sre._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D. M. YYYY.",LL:"D. MMMM YYYY.",LLL:"D. MMMM YYYY. H:mm",LLLL:"dddd, D. MMMM YYYY. H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedelju] [u] LT";case 3:return"[u] [sredu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[juče u] LT",lastWeek:function(){return["[prošle] [nedelje] [u] LT","[prošlog] [ponedeljka] [u] LT","[prošlog] [utorka] [u] LT","[prošle] [srede] [u] LT","[prošlog] [četvrtka] [u] LT","[prošlog] [petka] [u] LT","[prošle] [subote] [u] LT"][this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"pre %s",s:"nekoliko sekundi",ss:t.translate,m:t.translate,mm:t.translate,h:t.translate,hh:t.translate,d:"dan",dd:t.translate,M:"mesec",MM:t.translate,y:"godinu",yy:t.translate},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ss.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ss",{months:"Bhimbidvwane_Indlovana_Indlov'lenkhulu_Mabasa_Inkhwekhweti_Inhlaba_Kholwane_Ingci_Inyoni_Imphala_Lweti_Ingongoni".split("_"),monthsShort:"Bhi_Ina_Inu_Mab_Ink_Inh_Kho_Igc_Iny_Imp_Lwe_Igo".split("_"),weekdays:"Lisontfo_Umsombuluko_Lesibili_Lesitsatfu_Lesine_Lesihlanu_Umgcibelo".split("_"),weekdaysShort:"Lis_Umb_Lsb_Les_Lsi_Lsh_Umg".split("_"),weekdaysMin:"Li_Us_Lb_Lt_Ls_Lh_Ug".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Namuhla nga] LT",nextDay:"[Kusasa nga] LT",nextWeek:"dddd [nga] LT",lastDay:"[Itolo nga] LT",lastWeek:"dddd [leliphelile] [nga] LT",sameElse:"L"},relativeTime:{future:"nga %s",past:"wenteka nga %s",s:"emizuzwana lomcane",ss:"%d mzuzwana",m:"umzuzu",mm:"%d emizuzu",h:"lihora",hh:"%d emahora",d:"lilanga",dd:"%d emalanga",M:"inyanga",MM:"%d tinyanga",y:"umnyaka",yy:"%d iminyaka"},meridiemParse:/ekuseni|emini|entsambama|ebusuku/,meridiem:function(e,t,n){return e<11?"ekuseni":e<15?"emini":e<19?"entsambama":"ebusuku"},meridiemHour:function(e,t){return 12===e&&(e=0),"ekuseni"===t?e:"emini"===t?e>=11?e:e+12:"entsambama"===t||"ebusuku"===t?0===e?0:e+12:void 0},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:"%d",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sv.js":function(e,t,n){!function(e){"use strict";e.defineLocale("sv",{months:"januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag".split("_"),weekdaysShort:"sön_mån_tis_ons_tor_fre_lör".split("_"),weekdaysMin:"sö_må_ti_on_to_fr_lö".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [kl.] HH:mm",LLLL:"dddd D MMMM YYYY [kl.] HH:mm",lll:"D MMM YYYY HH:mm",llll:"ddd D MMM YYYY HH:mm"},calendar:{sameDay:"[Idag] LT",nextDay:"[Imorgon] LT",lastDay:"[Igår] LT",nextWeek:"[På] dddd LT",lastWeek:"[I] dddd[s] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"för %s sedan",s:"några sekunder",ss:"%d sekunder",m:"en minut",mm:"%d minuter",h:"en timme",hh:"%d timmar",d:"en dag",dd:"%d dagar",M:"en månad",MM:"%d månader",y:"ett år",yy:"%d år"},dayOfMonthOrdinalParse:/\d{1,2}(\:e|\:a)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?":e":1===t||2===t?":a":":e")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/sw.js":function(e,t,n){!function(e){"use strict";e.defineLocale("sw",{months:"Januari_Februari_Machi_Aprili_Mei_Juni_Julai_Agosti_Septemba_Oktoba_Novemba_Desemba".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ago_Sep_Okt_Nov_Des".split("_"),weekdays:"Jumapili_Jumatatu_Jumanne_Jumatano_Alhamisi_Ijumaa_Jumamosi".split("_"),weekdaysShort:"Jpl_Jtat_Jnne_Jtan_Alh_Ijm_Jmos".split("_"),weekdaysMin:"J2_J3_J4_J5_Al_Ij_J1".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"hh:mm A",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[leo saa] LT",nextDay:"[kesho saa] LT",nextWeek:"[wiki ijayo] dddd [saat] LT",lastDay:"[jana] LT",lastWeek:"[wiki iliyopita] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s baadaye",past:"tokea %s",s:"hivi punde",ss:"sekunde %d",m:"dakika moja",mm:"dakika %d",h:"saa limoja",hh:"masaa %d",d:"siku moja",dd:"siku %d",M:"mwezi mmoja",MM:"miezi %d",y:"mwaka mmoja",yy:"miaka %d"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ta.js":function(e,t,n){!function(e){"use strict";var t={1:"௧",2:"௨",3:"௩",4:"௪",5:"௫",6:"௬",7:"௭",8:"௮",9:"௯",0:"௦"},n={"௧":"1","௨":"2","௩":"3","௪":"4","௫":"5","௬":"6","௭":"7","௮":"8","௯":"9","௦":"0"};e.defineLocale("ta",{months:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),monthsShort:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),weekdays:"ஞாயிற்றுக்கிழமை_திங்கட்கிழமை_செவ்வாய்கிழமை_புதன்கிழமை_வியாழக்கிழமை_வெள்ளிக்கிழமை_சனிக்கிழமை".split("_"),weekdaysShort:"ஞாயிறு_திங்கள்_செவ்வாய்_புதன்_வியாழன்_வெள்ளி_சனி".split("_"),weekdaysMin:"ஞா_தி_செ_பு_வி_வெ_ச".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, HH:mm",LLLL:"dddd, D MMMM YYYY, HH:mm"},calendar:{sameDay:"[இன்று] LT",nextDay:"[நாளை] LT",nextWeek:"dddd, LT",lastDay:"[நேற்று] LT",lastWeek:"[கடந்த வாரம்] dddd, LT",sameElse:"L"},relativeTime:{future:"%s இல்",past:"%s முன்",s:"ஒரு சில விநாடிகள்",ss:"%d விநாடிகள்",m:"ஒரு நிமிடம்",mm:"%d நிமிடங்கள்",h:"ஒரு மணி நேரம்",hh:"%d மணி நேரம்",d:"ஒரு நாள்",dd:"%d நாட்கள்",M:"ஒரு மாதம்",MM:"%d மாதங்கள்",y:"ஒரு வருடம்",yy:"%d ஆண்டுகள்"},dayOfMonthOrdinalParse:/\d{1,2}வது/,ordinal:function(e){return e+"வது"},preparse:function(e){return e.replace(/[௧௨௩௪௫௬௭௮௯௦]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/யாமம்|வைகறை|காலை|நண்பகல்|எற்பாடு|மாலை/,meridiem:function(e,t,n){return e<2?" யாமம்":e<6?" வைகறை":e<10?" காலை":e<14?" நண்பகல்":e<18?" எற்பாடு":e<22?" மாலை":" யாமம்"},meridiemHour:function(e,t){return 12===e&&(e=0),"யாமம்"===t?e<2?e:e+12:"வைகறை"===t||"காலை"===t||"நண்பகல்"===t&&e>=10?e:e+12},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/te.js":function(e,t,n){!function(e){"use strict";e.defineLocale("te",{months:"జనవరి_ఫిబ్రవరి_మార్చి_ఏప్రిల్_మే_జూన్_జులై_ఆగస్టు_సెప్టెంబర్_అక్టోబర్_నవంబర్_డిసెంబర్".split("_"),monthsShort:"జన._ఫిబ్ర._మార్చి_ఏప్రి._మే_జూన్_జులై_ఆగ._సెప్._అక్టో._నవ._డిసె.".split("_"),monthsParseExact:!0,weekdays:"ఆదివారం_సోమవారం_మంగళవారం_బుధవారం_గురువారం_శుక్రవారం_శనివారం".split("_"),weekdaysShort:"ఆది_సోమ_మంగళ_బుధ_గురు_శుక్ర_శని".split("_"),weekdaysMin:"ఆ_సో_మం_బు_గు_శు_శ".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[నేడు] LT",nextDay:"[రేపు] LT",nextWeek:"dddd, LT",lastDay:"[నిన్న] LT",lastWeek:"[గత] dddd, LT",sameElse:"L"},relativeTime:{future:"%s లో",past:"%s క్రితం",s:"కొన్ని క్షణాలు",ss:"%d సెకన్లు",m:"ఒక నిమిషం",mm:"%d నిమిషాలు",h:"ఒక గంట",hh:"%d గంటలు",d:"ఒక రోజు",dd:"%d రోజులు",M:"ఒక నెల",MM:"%d నెలలు",y:"ఒక సంవత్సరం",yy:"%d సంవత్సరాలు"},dayOfMonthOrdinalParse:/\d{1,2}వ/,ordinal:"%dవ",meridiemParse:/రాత్రి|ఉదయం|మధ్యాహ్నం|సాయంత్రం/,meridiemHour:function(e,t){return 12===e&&(e=0),"రాత్రి"===t?e<4?e:e+12:"ఉదయం"===t?e:"మధ్యాహ్నం"===t?e>=10?e:e+12:"సాయంత్రం"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"రాత్రి":e<10?"ఉదయం":e<17?"మధ్యాహ్నం":e<20?"సాయంత్రం":"రాత్రి"},week:{dow:0,doy:6}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tet.js":function(e,t,n){!function(e){"use strict";e.defineLocale("tet",{months:"Janeiru_Fevereiru_Marsu_Abril_Maiu_Juñu_Jullu_Agustu_Setembru_Outubru_Novembru_Dezembru".split("_"),monthsShort:"Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"),weekdays:"Domingu_Segunda_Tersa_Kuarta_Kinta_Sesta_Sabadu".split("_"),weekdaysShort:"Dom_Seg_Ters_Kua_Kint_Sest_Sab".split("_"),weekdaysMin:"Do_Seg_Te_Ku_Ki_Ses_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Ohin iha] LT",nextDay:"[Aban iha] LT",nextWeek:"dddd [iha] LT",lastDay:"[Horiseik iha] LT",lastWeek:"dddd [semana kotuk] [iha] LT",sameElse:"L"},relativeTime:{future:"iha %s",past:"%s liuba",s:"segundu balun",ss:"segundu %d",m:"minutu ida",mm:"minutu %d",h:"oras ida",hh:"oras %d",d:"loron ida",dd:"loron %d",M:"fulan ida",MM:"fulan %d",y:"tinan ida",yy:"tinan %d"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tg.js":function(e,t,n){!function(e){"use strict";var t={0:"-ум",1:"-ум",2:"-юм",3:"-юм",4:"-ум",5:"-ум",6:"-ум",7:"-ум",8:"-ум",9:"-ум",10:"-ум",12:"-ум",13:"-ум",20:"-ум",30:"-юм",40:"-ум",50:"-ум",60:"-ум",70:"-ум",80:"-ум",90:"-ум",100:"-ум"};e.defineLocale("tg",{months:{format:"январи_феврали_марти_апрели_майи_июни_июли_августи_сентябри_октябри_ноябри_декабри".split("_"),standalone:"январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр".split("_")},monthsShort:"янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"),weekdays:"якшанбе_душанбе_сешанбе_чоршанбе_панҷшанбе_ҷумъа_шанбе".split("_"),weekdaysShort:"яшб_дшб_сшб_чшб_пшб_ҷум_шнб".split("_"),weekdaysMin:"яш_дш_сш_чш_пш_ҷм_шб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Имрӯз соати] LT",nextDay:"[Фардо соати] LT",lastDay:"[Дирӯз соати] LT",nextWeek:"dddd[и] [ҳафтаи оянда соати] LT",lastWeek:"dddd[и] [ҳафтаи гузашта соати] LT",sameElse:"L"},relativeTime:{future:"баъди %s",past:"%s пеш",s:"якчанд сония",m:"як дақиқа",mm:"%d дақиқа",h:"як соат",hh:"%d соат",d:"як рӯз",dd:"%d рӯз",M:"як моҳ",MM:"%d моҳ",y:"як сол",yy:"%d сол"},meridiemParse:/шаб|субҳ|рӯз|бегоҳ/,meridiemHour:function(e,t){return 12===e&&(e=0),"шаб"===t?e<4?e:e+12:"субҳ"===t?e:"рӯз"===t?e>=11?e:e+12:"бегоҳ"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"шаб":e<11?"субҳ":e<16?"рӯз":e<19?"бегоҳ":"шаб"},dayOfMonthOrdinalParse:/\d{1,2}-(ум|юм)/,ordinal:function(e){return e+(t[e]||t[e%10]||t[e>=100?100:null])},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/th.js":function(e,t,n){!function(e){"use strict";e.defineLocale("th",{months:"มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม".split("_"),monthsShort:"ม.ค._ก.พ._มี.ค._เม.ย._พ.ค._มิ.ย._ก.ค._ส.ค._ก.ย._ต.ค._พ.ย._ธ.ค.".split("_"),monthsParseExact:!0,weekdays:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์".split("_"),weekdaysShort:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัส_ศุกร์_เสาร์".split("_"),weekdaysMin:"อา._จ._อ._พ._พฤ._ศ._ส.".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY เวลา H:mm",LLLL:"วันddddที่ D MMMM YYYY เวลา H:mm"},meridiemParse:/ก่อนเที่ยง|หลังเที่ยง/,isPM:function(e){return"หลังเที่ยง"===e},meridiem:function(e,t,n){return e<12?"ก่อนเที่ยง":"หลังเที่ยง"},calendar:{sameDay:"[วันนี้ เวลา] LT",nextDay:"[พรุ่งนี้ เวลา] LT",nextWeek:"dddd[หน้า เวลา] LT",lastDay:"[เมื่อวานนี้ เวลา] LT",lastWeek:"[วัน]dddd[ที่แล้ว เวลา] LT",sameElse:"L"},relativeTime:{future:"อีก %s",past:"%sที่แล้ว",s:"ไม่กี่วินาที",ss:"%d วินาที",m:"1 นาที",mm:"%d นาที",h:"1 ชั่วโมง",hh:"%d ชั่วโมง",d:"1 วัน",dd:"%d วัน",w:"1 สัปดาห์",ww:"%d สัปดาห์",M:"1 เดือน",MM:"%d เดือน",y:"1 ปี",yy:"%d ปี"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tk.js":function(e,t,n){!function(e){"use strict";var t={1:"'inji",5:"'inji",8:"'inji",70:"'inji",80:"'inji",2:"'nji",7:"'nji",20:"'nji",50:"'nji",3:"'ünji",4:"'ünji",100:"'ünji",6:"'njy",9:"'unjy",10:"'unjy",30:"'unjy",60:"'ynjy",90:"'ynjy"};e.defineLocale("tk",{months:"Ýanwar_Fewral_Mart_Aprel_Maý_Iýun_Iýul_Awgust_Sentýabr_Oktýabr_Noýabr_Dekabr".split("_"),monthsShort:"Ýan_Few_Mar_Apr_Maý_Iýn_Iýl_Awg_Sen_Okt_Noý_Dek".split("_"),weekdays:"Ýekşenbe_Duşenbe_Sişenbe_Çarşenbe_Penşenbe_Anna_Şenbe".split("_"),weekdaysShort:"Ýek_Duş_Siş_Çar_Pen_Ann_Şen".split("_"),weekdaysMin:"Ýk_Dş_Sş_Çr_Pn_An_Şn".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün sagat] LT",nextDay:"[ertir sagat] LT",nextWeek:"[indiki] dddd [sagat] LT",lastDay:"[düýn] LT",lastWeek:"[geçen] dddd [sagat] LT",sameElse:"L"},relativeTime:{future:"%s soň",past:"%s öň",s:"birnäçe sekunt",m:"bir minut",mm:"%d minut",h:"bir sagat",hh:"%d sagat",d:"bir gün",dd:"%d gün",M:"bir aý",MM:"%d aý",y:"bir ýyl",yy:"%d ýyl"},ordinal:function(e,n){switch(n){case"d":case"D":case"Do":case"DD":return e;default:if(0===e)return e+"'unjy";var o=e%10;return e+(t[o]||t[e%100-o]||t[e>=100?100:null])}},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tl-ph.js":function(e,t,n){!function(e){"use strict";e.defineLocale("tl-ph",{months:"Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre".split("_"),monthsShort:"Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis".split("_"),weekdays:"Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado".split("_"),weekdaysShort:"Lin_Lun_Mar_Miy_Huw_Biy_Sab".split("_"),weekdaysMin:"Li_Lu_Ma_Mi_Hu_Bi_Sab".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"MM/D/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY HH:mm",LLLL:"dddd, MMMM DD, YYYY HH:mm"},calendar:{sameDay:"LT [ngayong araw]",nextDay:"[Bukas ng] LT",nextWeek:"LT [sa susunod na] dddd",lastDay:"LT [kahapon]",lastWeek:"LT [noong nakaraang] dddd",sameElse:"L"},relativeTime:{future:"sa loob ng %s",past:"%s ang nakalipas",s:"ilang segundo",ss:"%d segundo",m:"isang minuto",mm:"%d minuto",h:"isang oras",hh:"%d oras",d:"isang araw",dd:"%d araw",M:"isang buwan",MM:"%d buwan",y:"isang taon",yy:"%d taon"},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:function(e){return e},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tlh.js":function(e,t,n){!function(e){"use strict";var t="pagh_wa’_cha’_wej_loS_vagh_jav_Soch_chorgh_Hut".split("_");function n(e,n,o,r){var s=function(e){var n=Math.floor(e%1e3/100),o=Math.floor(e%100/10),r=e%10,s="";return n>0&&(s+=t[n]+"vatlh"),o>0&&(s+=(""!==s?" ":"")+t[o]+"maH"),r>0&&(s+=(""!==s?" ":"")+t[r]),""===s?"pagh":s}(e);switch(o){case"ss":return s+" lup";case"mm":return s+" tup";case"hh":return s+" rep";case"dd":return s+" jaj";case"MM":return s+" jar";case"yy":return s+" DIS"}}e.defineLocale("tlh",{months:"tera’ jar wa’_tera’ jar cha’_tera’ jar wej_tera’ jar loS_tera’ jar vagh_tera’ jar jav_tera’ jar Soch_tera’ jar chorgh_tera’ jar Hut_tera’ jar wa’maH_tera’ jar wa’maH wa’_tera’ jar wa’maH cha’".split("_"),monthsShort:"jar wa’_jar cha’_jar wej_jar loS_jar vagh_jar jav_jar Soch_jar chorgh_jar Hut_jar wa’maH_jar wa’maH wa’_jar wa’maH cha’".split("_"),monthsParseExact:!0,weekdays:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),weekdaysShort:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),weekdaysMin:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[DaHjaj] LT",nextDay:"[wa’leS] LT",nextWeek:"LLL",lastDay:"[wa’Hu’] LT",lastWeek:"LLL",sameElse:"L"},relativeTime:{future:function(e){var t=e;return-1!==e.indexOf("jaj")?t.slice(0,-3)+"leS":-1!==e.indexOf("jar")?t.slice(0,-3)+"waQ":-1!==e.indexOf("DIS")?t.slice(0,-3)+"nem":t+" pIq"},past:function(e){var t=e;return-1!==e.indexOf("jaj")?t.slice(0,-3)+"Hu’":-1!==e.indexOf("jar")?t.slice(0,-3)+"wen":-1!==e.indexOf("DIS")?t.slice(0,-3)+"ben":t+" ret"},s:"puS lup",ss:n,m:"wa’ tup",mm:n,h:"wa’ rep",hh:n,d:"wa’ jaj",dd:n,M:"wa’ jar",MM:n,y:"wa’ DIS",yy:n},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tr.js":function(e,t,n){!function(e){"use strict";var t={1:"'inci",5:"'inci",8:"'inci",70:"'inci",80:"'inci",2:"'nci",7:"'nci",20:"'nci",50:"'nci",3:"'üncü",4:"'üncü",100:"'üncü",6:"'ncı",9:"'uncu",10:"'uncu",30:"'uncu",60:"'ıncı",90:"'ıncı"};e.defineLocale("tr",{months:"Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık".split("_"),monthsShort:"Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara".split("_"),weekdays:"Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi".split("_"),weekdaysShort:"Paz_Pts_Sal_Çar_Per_Cum_Cts".split("_"),weekdaysMin:"Pz_Pt_Sa_Ça_Pe_Cu_Ct".split("_"),meridiem:function(e,t,n){return e<12?n?"öö":"ÖÖ":n?"ös":"ÖS"},meridiemParse:/öö|ÖÖ|ös|ÖS/,isPM:function(e){return"ös"===e||"ÖS"===e},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[yarın saat] LT",nextWeek:"[gelecek] dddd [saat] LT",lastDay:"[dün] LT",lastWeek:"[geçen] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s önce",s:"birkaç saniye",ss:"%d saniye",m:"bir dakika",mm:"%d dakika",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",w:"bir hafta",ww:"%d hafta",M:"bir ay",MM:"%d ay",y:"bir yıl",yy:"%d yıl"},ordinal:function(e,n){switch(n){case"d":case"D":case"Do":case"DD":return e;default:if(0===e)return e+"'ıncı";var o=e%10;return e+(t[o]||t[e%100-o]||t[e>=100?100:null])}},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tzl.js":function(e,t,n){!function(e){"use strict";function t(e,t,n,o){var r={s:["viensas secunds","'iensas secunds"],ss:[e+" secunds",e+" secunds"],m:["'n míut","'iens míut"],mm:[e+" míuts",e+" míuts"],h:["'n þora","'iensa þora"],hh:[e+" þoras",e+" þoras"],d:["'n ziua","'iensa ziua"],dd:[e+" ziuas",e+" ziuas"],M:["'n mes","'iens mes"],MM:[e+" mesen",e+" mesen"],y:["'n ar","'iens ar"],yy:[e+" ars",e+" ars"]};return o||t?r[n][0]:r[n][1]}e.defineLocale("tzl",{months:"Januar_Fevraglh_Març_Avrïu_Mai_Gün_Julia_Guscht_Setemvar_Listopäts_Noemvar_Zecemvar".split("_"),monthsShort:"Jan_Fev_Mar_Avr_Mai_Gün_Jul_Gus_Set_Lis_Noe_Zec".split("_"),weekdays:"Súladi_Lúneçi_Maitzi_Márcuri_Xhúadi_Viénerçi_Sáturi".split("_"),weekdaysShort:"Súl_Lún_Mai_Már_Xhú_Vié_Sát".split("_"),weekdaysMin:"Sú_Lú_Ma_Má_Xh_Vi_Sá".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"D. MMMM [dallas] YYYY",LLL:"D. MMMM [dallas] YYYY HH.mm",LLLL:"dddd, [li] D. MMMM [dallas] YYYY HH.mm"},meridiemParse:/d\'o|d\'a/i,isPM:function(e){return"d'o"===e.toLowerCase()},meridiem:function(e,t,n){return e>11?n?"d'o":"D'O":n?"d'a":"D'A"},calendar:{sameDay:"[oxhi à] LT",nextDay:"[demà à] LT",nextWeek:"dddd [à] LT",lastDay:"[ieiri à] LT",lastWeek:"[sür el] dddd [lasteu à] LT",sameElse:"L"},relativeTime:{future:"osprei %s",past:"ja%s",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tzm-latn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("tzm-latn",{months:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),monthsShort:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),weekdays:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),weekdaysShort:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),weekdaysMin:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[asdkh g] LT",nextDay:"[aska g] LT",nextWeek:"dddd [g] LT",lastDay:"[assant g] LT",lastWeek:"dddd [g] LT",sameElse:"L"},relativeTime:{future:"dadkh s yan %s",past:"yan %s",s:"imik",ss:"%d imik",m:"minuḍ",mm:"%d minuḍ",h:"saɛa",hh:"%d tassaɛin",d:"ass",dd:"%d ossan",M:"ayowr",MM:"%d iyyirn",y:"asgas",yy:"%d isgasn"},week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/tzm.js":function(e,t,n){!function(e){"use strict";e.defineLocale("tzm",{months:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),monthsShort:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),weekdays:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),weekdaysShort:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),weekdaysMin:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[ⴰⵙⴷⵅ ⴴ] LT",nextDay:"[ⴰⵙⴽⴰ ⴴ] LT",nextWeek:"dddd [ⴴ] LT",lastDay:"[ⴰⵚⴰⵏⵜ ⴴ] LT",lastWeek:"dddd [ⴴ] LT",sameElse:"L"},relativeTime:{future:"ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ %s",past:"ⵢⴰⵏ %s",s:"ⵉⵎⵉⴽ",ss:"%d ⵉⵎⵉⴽ",m:"ⵎⵉⵏⵓⴺ",mm:"%d ⵎⵉⵏⵓⴺ",h:"ⵙⴰⵄⴰ",hh:"%d ⵜⴰⵙⵙⴰⵄⵉⵏ",d:"ⴰⵙⵙ",dd:"%d oⵙⵙⴰⵏ",M:"ⴰⵢoⵓⵔ",MM:"%d ⵉⵢⵢⵉⵔⵏ",y:"ⴰⵙⴳⴰⵙ",yy:"%d ⵉⵙⴳⴰⵙⵏ"},week:{dow:6,doy:12}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ug-cn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("ug-cn",{months:"يانۋار_فېۋرال_مارت_ئاپرېل_ماي_ئىيۇن_ئىيۇل_ئاۋغۇست_سېنتەبىر_ئۆكتەبىر_نويابىر_دېكابىر".split("_"),monthsShort:"يانۋار_فېۋرال_مارت_ئاپرېل_ماي_ئىيۇن_ئىيۇل_ئاۋغۇست_سېنتەبىر_ئۆكتەبىر_نويابىر_دېكابىر".split("_"),weekdays:"يەكشەنبە_دۈشەنبە_سەيشەنبە_چارشەنبە_پەيشەنبە_جۈمە_شەنبە".split("_"),weekdaysShort:"يە_دۈ_سە_چا_پە_جۈ_شە".split("_"),weekdaysMin:"يە_دۈ_سە_چا_پە_جۈ_شە".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY-يىلىM-ئاينىڭD-كۈنى",LLL:"YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm",LLLL:"dddd، YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm"},meridiemParse:/يېرىم كېچە|سەھەر|چۈشتىن بۇرۇن|چۈش|چۈشتىن كېيىن|كەچ/,meridiemHour:function(e,t){return 12===e&&(e=0),"يېرىم كېچە"===t||"سەھەر"===t||"چۈشتىن بۇرۇن"===t?e:"چۈشتىن كېيىن"===t||"كەچ"===t?e+12:e>=11?e:e+12},meridiem:function(e,t,n){var o=100*e+t;return o<600?"يېرىم كېچە":o<900?"سەھەر":o<1130?"چۈشتىن بۇرۇن":o<1230?"چۈش":o<1800?"چۈشتىن كېيىن":"كەچ"},calendar:{sameDay:"[بۈگۈن سائەت] LT",nextDay:"[ئەتە سائەت] LT",nextWeek:"[كېلەركى] dddd [سائەت] LT",lastDay:"[تۆنۈگۈن] LT",lastWeek:"[ئالدىنقى] dddd [سائەت] LT",sameElse:"L"},relativeTime:{future:"%s كېيىن",past:"%s بۇرۇن",s:"نەچچە سېكونت",ss:"%d سېكونت",m:"بىر مىنۇت",mm:"%d مىنۇت",h:"بىر سائەت",hh:"%d سائەت",d:"بىر كۈن",dd:"%d كۈن",M:"بىر ئاي",MM:"%d ئاي",y:"بىر يىل",yy:"%d يىل"},dayOfMonthOrdinalParse:/\d{1,2}(-كۈنى|-ئاي|-ھەپتە)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"-كۈنى";case"w":case"W":return e+"-ھەپتە";default:return e}},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/uk.js":function(e,t,n){!function(e){"use strict";function t(e,t,n){return"m"===n?t?"хвилина":"хвилину":"h"===n?t?"година":"годину":e+" "+(o=+e,r={ss:t?"секунда_секунди_секунд":"секунду_секунди_секунд",mm:t?"хвилина_хвилини_хвилин":"хвилину_хвилини_хвилин",hh:t?"година_години_годин":"годину_години_годин",dd:"день_дні_днів",MM:"місяць_місяці_місяців",yy:"рік_роки_років"}[n].split("_"),o%10==1&&o%100!=11?r[0]:o%10>=2&&o%10<=4&&(o%100<10||o%100>=20)?r[1]:r[2]);var o,r}function n(e){return function(){return e+"о"+(11===this.hours()?"б":"")+"] LT"}}e.defineLocale("uk",{months:{format:"січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня".split("_"),standalone:"січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень".split("_")},monthsShort:"січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд".split("_"),weekdays:function(e,t){var n={nominative:"неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота".split("_"),accusative:"неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу".split("_"),genitive:"неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи".split("_")};return!0===e?n.nominative.slice(1,7).concat(n.nominative.slice(0,1)):e?n[/(\[[ВвУу]\]) ?dddd/.test(t)?"accusative":/\[?(?:минулої|наступної)? ?\] ?dddd/.test(t)?"genitive":"nominative"][e.day()]:n.nominative},weekdaysShort:"нд_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY р.",LLL:"D MMMM YYYY р., HH:mm",LLLL:"dddd, D MMMM YYYY р., HH:mm"},calendar:{sameDay:n("[Сьогодні "),nextDay:n("[Завтра "),lastDay:n("[Вчора "),nextWeek:n("[У] dddd ["),lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return n("[Минулої] dddd [").call(this);case 1:case 2:case 4:return n("[Минулого] dddd [").call(this)}},sameElse:"L"},relativeTime:{future:"за %s",past:"%s тому",s:"декілька секунд",ss:t,m:t,mm:t,h:"годину",hh:t,d:"день",dd:t,M:"місяць",MM:t,y:"рік",yy:t},meridiemParse:/ночі|ранку|дня|вечора/,isPM:function(e){return/^(дня|вечора)$/.test(e)},meridiem:function(e,t,n){return e<4?"ночі":e<12?"ранку":e<17?"дня":"вечора"},dayOfMonthOrdinalParse:/\d{1,2}-(й|го)/,ordinal:function(e,t){switch(t){case"M":case"d":case"DDD":case"w":case"W":return e+"-й";case"D":return e+"-го";default:return e}},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/ur.js":function(e,t,n){!function(e){"use strict";var t=["جنوری","فروری","مارچ","اپریل","مئی","جون","جولائی","اگست","ستمبر","اکتوبر","نومبر","دسمبر"],n=["اتوار","پیر","منگل","بدھ","جمعرات","جمعہ","ہفتہ"];e.defineLocale("ur",{months:t,monthsShort:t,weekdays:n,weekdaysShort:n,weekdaysMin:n,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd، D MMMM YYYY HH:mm"},meridiemParse:/صبح|شام/,isPM:function(e){return"شام"===e},meridiem:function(e,t,n){return e<12?"صبح":"شام"},calendar:{sameDay:"[آج بوقت] LT",nextDay:"[کل بوقت] LT",nextWeek:"dddd [بوقت] LT",lastDay:"[گذشتہ روز بوقت] LT",lastWeek:"[گذشتہ] dddd [بوقت] LT",sameElse:"L"},relativeTime:{future:"%s بعد",past:"%s قبل",s:"چند سیکنڈ",ss:"%d سیکنڈ",m:"ایک منٹ",mm:"%d منٹ",h:"ایک گھنٹہ",hh:"%d گھنٹے",d:"ایک دن",dd:"%d دن",M:"ایک ماہ",MM:"%d ماہ",y:"ایک سال",yy:"%d سال"},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/uz-latn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("uz-latn",{months:"Yanvar_Fevral_Mart_Aprel_May_Iyun_Iyul_Avgust_Sentabr_Oktabr_Noyabr_Dekabr".split("_"),monthsShort:"Yan_Fev_Mar_Apr_May_Iyun_Iyul_Avg_Sen_Okt_Noy_Dek".split("_"),weekdays:"Yakshanba_Dushanba_Seshanba_Chorshanba_Payshanba_Juma_Shanba".split("_"),weekdaysShort:"Yak_Dush_Sesh_Chor_Pay_Jum_Shan".split("_"),weekdaysMin:"Ya_Du_Se_Cho_Pa_Ju_Sha".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"D MMMM YYYY, dddd HH:mm"},calendar:{sameDay:"[Bugun soat] LT [da]",nextDay:"[Ertaga] LT [da]",nextWeek:"dddd [kuni soat] LT [da]",lastDay:"[Kecha soat] LT [da]",lastWeek:"[O'tgan] dddd [kuni soat] LT [da]",sameElse:"L"},relativeTime:{future:"Yaqin %s ichida",past:"Bir necha %s oldin",s:"soniya",ss:"%d soniya",m:"bir daqiqa",mm:"%d daqiqa",h:"bir soat",hh:"%d soat",d:"bir kun",dd:"%d kun",M:"bir oy",MM:"%d oy",y:"bir yil",yy:"%d yil"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/uz.js":function(e,t,n){!function(e){"use strict";e.defineLocale("uz",{months:"январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр".split("_"),monthsShort:"янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"),weekdays:"Якшанба_Душанба_Сешанба_Чоршанба_Пайшанба_Жума_Шанба".split("_"),weekdaysShort:"Якш_Душ_Сеш_Чор_Пай_Жум_Шан".split("_"),weekdaysMin:"Як_Ду_Се_Чо_Па_Жу_Ша".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"D MMMM YYYY, dddd HH:mm"},calendar:{sameDay:"[Бугун соат] LT [да]",nextDay:"[Эртага] LT [да]",nextWeek:"dddd [куни соат] LT [да]",lastDay:"[Кеча соат] LT [да]",lastWeek:"[Утган] dddd [куни соат] LT [да]",sameElse:"L"},relativeTime:{future:"Якин %s ичида",past:"Бир неча %s олдин",s:"фурсат",ss:"%d фурсат",m:"бир дакика",mm:"%d дакика",h:"бир соат",hh:"%d соат",d:"бир кун",dd:"%d кун",M:"бир ой",MM:"%d ой",y:"бир йил",yy:"%d йил"},week:{dow:1,doy:7}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/vi.js":function(e,t,n){!function(e){"use strict";e.defineLocale("vi",{months:"tháng 1_tháng 2_tháng 3_tháng 4_tháng 5_tháng 6_tháng 7_tháng 8_tháng 9_tháng 10_tháng 11_tháng 12".split("_"),monthsShort:"Thg 01_Thg 02_Thg 03_Thg 04_Thg 05_Thg 06_Thg 07_Thg 08_Thg 09_Thg 10_Thg 11_Thg 12".split("_"),monthsParseExact:!0,weekdays:"chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy".split("_"),weekdaysShort:"CN_T2_T3_T4_T5_T6_T7".split("_"),weekdaysMin:"CN_T2_T3_T4_T5_T6_T7".split("_"),weekdaysParseExact:!0,meridiemParse:/sa|ch/i,isPM:function(e){return/^ch$/i.test(e)},meridiem:function(e,t,n){return e<12?n?"sa":"SA":n?"ch":"CH"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [năm] YYYY",LLL:"D MMMM [năm] YYYY HH:mm",LLLL:"dddd, D MMMM [năm] YYYY HH:mm",l:"DD/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},calendar:{sameDay:"[Hôm nay lúc] LT",nextDay:"[Ngày mai lúc] LT",nextWeek:"dddd [tuần tới lúc] LT",lastDay:"[Hôm qua lúc] LT",lastWeek:"dddd [tuần trước lúc] LT",sameElse:"L"},relativeTime:{future:"%s tới",past:"%s trước",s:"vài giây",ss:"%d giây",m:"một phút",mm:"%d phút",h:"một giờ",hh:"%d giờ",d:"một ngày",dd:"%d ngày",w:"một tuần",ww:"%d tuần",M:"một tháng",MM:"%d tháng",y:"một năm",yy:"%d năm"},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:function(e){return e},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/x-pseudo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("x-pseudo",{months:"J~áñúá~rý_F~ébrú~árý_~Márc~h_Áp~ríl_~Máý_~Júñé~_Júl~ý_Áú~gúst~_Sép~témb~ér_Ó~ctób~ér_Ñ~óvém~bér_~Décé~mbér".split("_"),monthsShort:"J~áñ_~Féb_~Már_~Ápr_~Máý_~Júñ_~Júl_~Áúg_~Sép_~Óct_~Ñóv_~Déc".split("_"),monthsParseExact:!0,weekdays:"S~úñdá~ý_Mó~ñdáý~_Túé~sdáý~_Wéd~ñésd~áý_T~húrs~dáý_~Fríd~áý_S~átúr~dáý".split("_"),weekdaysShort:"S~úñ_~Móñ_~Túé_~Wéd_~Thú_~Frí_~Sát".split("_"),weekdaysMin:"S~ú_Mó~_Tú_~Wé_T~h_Fr~_Sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[T~ódá~ý át] LT",nextDay:"[T~ómó~rró~w át] LT",nextWeek:"dddd [át] LT",lastDay:"[Ý~ést~érdá~ý át] LT",lastWeek:"[L~ást] dddd [át] LT",sameElse:"L"},relativeTime:{future:"í~ñ %s",past:"%s á~gó",s:"á ~féw ~sécó~ñds",ss:"%d s~écóñ~ds",m:"á ~míñ~úté",mm:"%d m~íñú~tés",h:"á~ñ hó~úr",hh:"%d h~óúrs",d:"á ~dáý",dd:"%d d~áýs",M:"á ~móñ~th",MM:"%d m~óñt~hs",y:"á ~ýéár",yy:"%d ý~éárs"},dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/yo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("yo",{months:"Sẹ́rẹ́_Èrèlè_Ẹrẹ̀nà_Ìgbé_Èbibi_Òkùdu_Agẹmo_Ògún_Owewe_Ọ̀wàrà_Bélú_Ọ̀pẹ̀̀".split("_"),monthsShort:"Sẹ́r_Èrl_Ẹrn_Ìgb_Èbi_Òkù_Agẹ_Ògú_Owe_Ọ̀wà_Bél_Ọ̀pẹ̀̀".split("_"),weekdays:"Àìkú_Ajé_Ìsẹ́gun_Ọjọ́rú_Ọjọ́bọ_Ẹtì_Àbámẹ́ta".split("_"),weekdaysShort:"Àìk_Ajé_Ìsẹ́_Ọjr_Ọjb_Ẹtì_Àbá".split("_"),weekdaysMin:"Àì_Aj_Ìs_Ọr_Ọb_Ẹt_Àb".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Ònì ni] LT",nextDay:"[Ọ̀la ni] LT",nextWeek:"dddd [Ọsẹ̀ tón'bọ] [ni] LT",lastDay:"[Àna ni] LT",lastWeek:"dddd [Ọsẹ̀ tólọ́] [ni] LT",sameElse:"L"},relativeTime:{future:"ní %s",past:"%s kọjá",s:"ìsẹjú aayá die",ss:"aayá %d",m:"ìsẹjú kan",mm:"ìsẹjú %d",h:"wákati kan",hh:"wákati %d",d:"ọjọ́ kan",dd:"ọjọ́ %d",M:"osù kan",MM:"osù %d",y:"ọdún kan",yy:"ọdún %d"},dayOfMonthOrdinalParse:/ọjọ́\s\d{1,2}/,ordinal:"ọjọ́ %d",week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/zh-cn.js":function(e,t,n){!function(e){"use strict";e.defineLocale("zh-cn",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"下午"===t||"晚上"===t?e+12:e>=11?e:e+12},meridiem:function(e,t,n){var o=100*e+t;return o<600?"凌晨":o<900?"早上":o<1130?"上午":o<1230?"中午":o<1800?"下午":"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:function(e){return e.week()!==this.week()?"[下]dddLT":"[本]dddLT"},lastDay:"[昨天]LT",lastWeek:function(e){return this.week()!==e.week()?"[上]dddLT":"[本]dddLT"},sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|周)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"周";default:return e}},relativeTime:{future:"%s后",past:"%s前",s:"几秒",ss:"%d 秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",w:"1 周",ww:"%d 周",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},week:{dow:1,doy:4}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/zh-hk.js":function(e,t,n){!function(e){"use strict";e.defineLocale("zh-hk",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"中午"===t?e>=11?e:e+12:"下午"===t||"晚上"===t?e+12:void 0},meridiem:function(e,t,n){var o=100*e+t;return o<600?"凌晨":o<900?"早上":o<1200?"上午":1200===o?"中午":o<1800?"下午":"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:"[下]ddddLT",lastDay:"[昨天]LT",lastWeek:"[上]ddddLT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s後",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/zh-mo.js":function(e,t,n){!function(e){"use strict";e.defineLocale("zh-mo",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"D/M/YYYY",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"中午"===t?e>=11?e:e+12:"下午"===t||"晚上"===t?e+12:void 0},meridiem:function(e,t,n){var o=100*e+t;return o<600?"凌晨":o<900?"早上":o<1130?"上午":o<1230?"中午":o<1800?"下午":"晚上"},calendar:{sameDay:"[今天] LT",nextDay:"[明天] LT",nextWeek:"[下]dddd LT",lastDay:"[昨天] LT",lastWeek:"[上]dddd LT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s內",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale/zh-tw.js":function(e,t,n){!function(e){"use strict";e.defineLocale("zh-tw",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"中午"===t?e>=11?e:e+12:"下午"===t||"晚上"===t?e+12:void 0},meridiem:function(e,t,n){var o=100*e+t;return o<600?"凌晨":o<900?"早上":o<1130?"上午":o<1230?"中午":o<1800?"下午":"晚上"},calendar:{sameDay:"[今天] LT",nextDay:"[明天] LT",nextWeek:"[下]dddd LT",lastDay:"[昨天] LT",lastWeek:"[上]dddd LT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s後",past:"%s前",s:"幾秒",ss:"%d 秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"}})}(n("./node_modules/moment/moment.js"))},"./node_modules/moment/locale sync recursive ^\\.\\/.*$":(e,t,n)=>{var o={"./af":"./node_modules/moment/locale/af.js","./af.js":"./node_modules/moment/locale/af.js","./ar":"./node_modules/moment/locale/ar.js","./ar-dz":"./node_modules/moment/locale/ar-dz.js","./ar-dz.js":"./node_modules/moment/locale/ar-dz.js","./ar-kw":"./node_modules/moment/locale/ar-kw.js","./ar-kw.js":"./node_modules/moment/locale/ar-kw.js","./ar-ly":"./node_modules/moment/locale/ar-ly.js","./ar-ly.js":"./node_modules/moment/locale/ar-ly.js","./ar-ma":"./node_modules/moment/locale/ar-ma.js","./ar-ma.js":"./node_modules/moment/locale/ar-ma.js","./ar-sa":"./node_modules/moment/locale/ar-sa.js","./ar-sa.js":"./node_modules/moment/locale/ar-sa.js","./ar-tn":"./node_modules/moment/locale/ar-tn.js","./ar-tn.js":"./node_modules/moment/locale/ar-tn.js","./ar.js":"./node_modules/moment/locale/ar.js","./az":"./node_modules/moment/locale/az.js","./az.js":"./node_modules/moment/locale/az.js","./be":"./node_modules/moment/locale/be.js","./be.js":"./node_modules/moment/locale/be.js","./bg":"./node_modules/moment/locale/bg.js","./bg.js":"./node_modules/moment/locale/bg.js","./bm":"./node_modules/moment/locale/bm.js","./bm.js":"./node_modules/moment/locale/bm.js","./bn":"./node_modules/moment/locale/bn.js","./bn-bd":"./node_modules/moment/locale/bn-bd.js","./bn-bd.js":"./node_modules/moment/locale/bn-bd.js","./bn.js":"./node_modules/moment/locale/bn.js","./bo":"./node_modules/moment/locale/bo.js","./bo.js":"./node_modules/moment/locale/bo.js","./br":"./node_modules/moment/locale/br.js","./br.js":"./node_modules/moment/locale/br.js","./bs":"./node_modules/moment/locale/bs.js","./bs.js":"./node_modules/moment/locale/bs.js","./ca":"./node_modules/moment/locale/ca.js","./ca.js":"./node_modules/moment/locale/ca.js","./cs":"./node_modules/moment/locale/cs.js","./cs.js":"./node_modules/moment/locale/cs.js","./cv":"./node_modules/moment/locale/cv.js","./cv.js":"./node_modules/moment/locale/cv.js","./cy":"./node_modules/moment/locale/cy.js","./cy.js":"./node_modules/moment/locale/cy.js","./da":"./node_modules/moment/locale/da.js","./da.js":"./node_modules/moment/locale/da.js","./de":"./node_modules/moment/locale/de.js","./de-at":"./node_modules/moment/locale/de-at.js","./de-at.js":"./node_modules/moment/locale/de-at.js","./de-ch":"./node_modules/moment/locale/de-ch.js","./de-ch.js":"./node_modules/moment/locale/de-ch.js","./de.js":"./node_modules/moment/locale/de.js","./dv":"./node_modules/moment/locale/dv.js","./dv.js":"./node_modules/moment/locale/dv.js","./el":"./node_modules/moment/locale/el.js","./el.js":"./node_modules/moment/locale/el.js","./en-au":"./node_modules/moment/locale/en-au.js","./en-au.js":"./node_modules/moment/locale/en-au.js","./en-ca":"./node_modules/moment/locale/en-ca.js","./en-ca.js":"./node_modules/moment/locale/en-ca.js","./en-gb":"./node_modules/moment/locale/en-gb.js","./en-gb.js":"./node_modules/moment/locale/en-gb.js","./en-ie":"./node_modules/moment/locale/en-ie.js","./en-ie.js":"./node_modules/moment/locale/en-ie.js","./en-il":"./node_modules/moment/locale/en-il.js","./en-il.js":"./node_modules/moment/locale/en-il.js","./en-in":"./node_modules/moment/locale/en-in.js","./en-in.js":"./node_modules/moment/locale/en-in.js","./en-nz":"./node_modules/moment/locale/en-nz.js","./en-nz.js":"./node_modules/moment/locale/en-nz.js","./en-sg":"./node_modules/moment/locale/en-sg.js","./en-sg.js":"./node_modules/moment/locale/en-sg.js","./eo":"./node_modules/moment/locale/eo.js","./eo.js":"./node_modules/moment/locale/eo.js","./es":"./node_modules/moment/locale/es.js","./es-do":"./node_modules/moment/locale/es-do.js","./es-do.js":"./node_modules/moment/locale/es-do.js","./es-mx":"./node_modules/moment/locale/es-mx.js","./es-mx.js":"./node_modules/moment/locale/es-mx.js","./es-us":"./node_modules/moment/locale/es-us.js","./es-us.js":"./node_modules/moment/locale/es-us.js","./es.js":"./node_modules/moment/locale/es.js","./et":"./node_modules/moment/locale/et.js","./et.js":"./node_modules/moment/locale/et.js","./eu":"./node_modules/moment/locale/eu.js","./eu.js":"./node_modules/moment/locale/eu.js","./fa":"./node_modules/moment/locale/fa.js","./fa.js":"./node_modules/moment/locale/fa.js","./fi":"./node_modules/moment/locale/fi.js","./fi.js":"./node_modules/moment/locale/fi.js","./fil":"./node_modules/moment/locale/fil.js","./fil.js":"./node_modules/moment/locale/fil.js","./fo":"./node_modules/moment/locale/fo.js","./fo.js":"./node_modules/moment/locale/fo.js","./fr":"./node_modules/moment/locale/fr.js","./fr-ca":"./node_modules/moment/locale/fr-ca.js","./fr-ca.js":"./node_modules/moment/locale/fr-ca.js","./fr-ch":"./node_modules/moment/locale/fr-ch.js","./fr-ch.js":"./node_modules/moment/locale/fr-ch.js","./fr.js":"./node_modules/moment/locale/fr.js","./fy":"./node_modules/moment/locale/fy.js","./fy.js":"./node_modules/moment/locale/fy.js","./ga":"./node_modules/moment/locale/ga.js","./ga.js":"./node_modules/moment/locale/ga.js","./gd":"./node_modules/moment/locale/gd.js","./gd.js":"./node_modules/moment/locale/gd.js","./gl":"./node_modules/moment/locale/gl.js","./gl.js":"./node_modules/moment/locale/gl.js","./gom-deva":"./node_modules/moment/locale/gom-deva.js","./gom-deva.js":"./node_modules/moment/locale/gom-deva.js","./gom-latn":"./node_modules/moment/locale/gom-latn.js","./gom-latn.js":"./node_modules/moment/locale/gom-latn.js","./gu":"./node_modules/moment/locale/gu.js","./gu.js":"./node_modules/moment/locale/gu.js","./he":"./node_modules/moment/locale/he.js","./he.js":"./node_modules/moment/locale/he.js","./hi":"./node_modules/moment/locale/hi.js","./hi.js":"./node_modules/moment/locale/hi.js","./hr":"./node_modules/moment/locale/hr.js","./hr.js":"./node_modules/moment/locale/hr.js","./hu":"./node_modules/moment/locale/hu.js","./hu.js":"./node_modules/moment/locale/hu.js","./hy-am":"./node_modules/moment/locale/hy-am.js","./hy-am.js":"./node_modules/moment/locale/hy-am.js","./id":"./node_modules/moment/locale/id.js","./id.js":"./node_modules/moment/locale/id.js","./is":"./node_modules/moment/locale/is.js","./is.js":"./node_modules/moment/locale/is.js","./it":"./node_modules/moment/locale/it.js","./it-ch":"./node_modules/moment/locale/it-ch.js","./it-ch.js":"./node_modules/moment/locale/it-ch.js","./it.js":"./node_modules/moment/locale/it.js","./ja":"./node_modules/moment/locale/ja.js","./ja.js":"./node_modules/moment/locale/ja.js","./jv":"./node_modules/moment/locale/jv.js","./jv.js":"./node_modules/moment/locale/jv.js","./ka":"./node_modules/moment/locale/ka.js","./ka.js":"./node_modules/moment/locale/ka.js","./kk":"./node_modules/moment/locale/kk.js","./kk.js":"./node_modules/moment/locale/kk.js","./km":"./node_modules/moment/locale/km.js","./km.js":"./node_modules/moment/locale/km.js","./kn":"./node_modules/moment/locale/kn.js","./kn.js":"./node_modules/moment/locale/kn.js","./ko":"./node_modules/moment/locale/ko.js","./ko.js":"./node_modules/moment/locale/ko.js","./ku":"./node_modules/moment/locale/ku.js","./ku.js":"./node_modules/moment/locale/ku.js","./ky":"./node_modules/moment/locale/ky.js","./ky.js":"./node_modules/moment/locale/ky.js","./lb":"./node_modules/moment/locale/lb.js","./lb.js":"./node_modules/moment/locale/lb.js","./lo":"./node_modules/moment/locale/lo.js","./lo.js":"./node_modules/moment/locale/lo.js","./lt":"./node_modules/moment/locale/lt.js","./lt.js":"./node_modules/moment/locale/lt.js","./lv":"./node_modules/moment/locale/lv.js","./lv.js":"./node_modules/moment/locale/lv.js","./me":"./node_modules/moment/locale/me.js","./me.js":"./node_modules/moment/locale/me.js","./mi":"./node_modules/moment/locale/mi.js","./mi.js":"./node_modules/moment/locale/mi.js","./mk":"./node_modules/moment/locale/mk.js","./mk.js":"./node_modules/moment/locale/mk.js","./ml":"./node_modules/moment/locale/ml.js","./ml.js":"./node_modules/moment/locale/ml.js","./mn":"./node_modules/moment/locale/mn.js","./mn.js":"./node_modules/moment/locale/mn.js","./mr":"./node_modules/moment/locale/mr.js","./mr.js":"./node_modules/moment/locale/mr.js","./ms":"./node_modules/moment/locale/ms.js","./ms-my":"./node_modules/moment/locale/ms-my.js","./ms-my.js":"./node_modules/moment/locale/ms-my.js","./ms.js":"./node_modules/moment/locale/ms.js","./mt":"./node_modules/moment/locale/mt.js","./mt.js":"./node_modules/moment/locale/mt.js","./my":"./node_modules/moment/locale/my.js","./my.js":"./node_modules/moment/locale/my.js","./nb":"./node_modules/moment/locale/nb.js","./nb.js":"./node_modules/moment/locale/nb.js","./ne":"./node_modules/moment/locale/ne.js","./ne.js":"./node_modules/moment/locale/ne.js","./nl":"./node_modules/moment/locale/nl.js","./nl-be":"./node_modules/moment/locale/nl-be.js","./nl-be.js":"./node_modules/moment/locale/nl-be.js","./nl.js":"./node_modules/moment/locale/nl.js","./nn":"./node_modules/moment/locale/nn.js","./nn.js":"./node_modules/moment/locale/nn.js","./oc-lnc":"./node_modules/moment/locale/oc-lnc.js","./oc-lnc.js":"./node_modules/moment/locale/oc-lnc.js","./pa-in":"./node_modules/moment/locale/pa-in.js","./pa-in.js":"./node_modules/moment/locale/pa-in.js","./pl":"./node_modules/moment/locale/pl.js","./pl.js":"./node_modules/moment/locale/pl.js","./pt":"./node_modules/moment/locale/pt.js","./pt-br":"./node_modules/moment/locale/pt-br.js","./pt-br.js":"./node_modules/moment/locale/pt-br.js","./pt.js":"./node_modules/moment/locale/pt.js","./ro":"./node_modules/moment/locale/ro.js","./ro.js":"./node_modules/moment/locale/ro.js","./ru":"./node_modules/moment/locale/ru.js","./ru.js":"./node_modules/moment/locale/ru.js","./sd":"./node_modules/moment/locale/sd.js","./sd.js":"./node_modules/moment/locale/sd.js","./se":"./node_modules/moment/locale/se.js","./se.js":"./node_modules/moment/locale/se.js","./si":"./node_modules/moment/locale/si.js","./si.js":"./node_modules/moment/locale/si.js","./sk":"./node_modules/moment/locale/sk.js","./sk.js":"./node_modules/moment/locale/sk.js","./sl":"./node_modules/moment/locale/sl.js","./sl.js":"./node_modules/moment/locale/sl.js","./sq":"./node_modules/moment/locale/sq.js","./sq.js":"./node_modules/moment/locale/sq.js","./sr":"./node_modules/moment/locale/sr.js","./sr-cyrl":"./node_modules/moment/locale/sr-cyrl.js","./sr-cyrl.js":"./node_modules/moment/locale/sr-cyrl.js","./sr.js":"./node_modules/moment/locale/sr.js","./ss":"./node_modules/moment/locale/ss.js","./ss.js":"./node_modules/moment/locale/ss.js","./sv":"./node_modules/moment/locale/sv.js","./sv.js":"./node_modules/moment/locale/sv.js","./sw":"./node_modules/moment/locale/sw.js","./sw.js":"./node_modules/moment/locale/sw.js","./ta":"./node_modules/moment/locale/ta.js","./ta.js":"./node_modules/moment/locale/ta.js","./te":"./node_modules/moment/locale/te.js","./te.js":"./node_modules/moment/locale/te.js","./tet":"./node_modules/moment/locale/tet.js","./tet.js":"./node_modules/moment/locale/tet.js","./tg":"./node_modules/moment/locale/tg.js","./tg.js":"./node_modules/moment/locale/tg.js","./th":"./node_modules/moment/locale/th.js","./th.js":"./node_modules/moment/locale/th.js","./tk":"./node_modules/moment/locale/tk.js","./tk.js":"./node_modules/moment/locale/tk.js","./tl-ph":"./node_modules/moment/locale/tl-ph.js","./tl-ph.js":"./node_modules/moment/locale/tl-ph.js","./tlh":"./node_modules/moment/locale/tlh.js","./tlh.js":"./node_modules/moment/locale/tlh.js","./tr":"./node_modules/moment/locale/tr.js","./tr.js":"./node_modules/moment/locale/tr.js","./tzl":"./node_modules/moment/locale/tzl.js","./tzl.js":"./node_modules/moment/locale/tzl.js","./tzm":"./node_modules/moment/locale/tzm.js","./tzm-latn":"./node_modules/moment/locale/tzm-latn.js","./tzm-latn.js":"./node_modules/moment/locale/tzm-latn.js","./tzm.js":"./node_modules/moment/locale/tzm.js","./ug-cn":"./node_modules/moment/locale/ug-cn.js","./ug-cn.js":"./node_modules/moment/locale/ug-cn.js","./uk":"./node_modules/moment/locale/uk.js","./uk.js":"./node_modules/moment/locale/uk.js","./ur":"./node_modules/moment/locale/ur.js","./ur.js":"./node_modules/moment/locale/ur.js","./uz":"./node_modules/moment/locale/uz.js","./uz-latn":"./node_modules/moment/locale/uz-latn.js","./uz-latn.js":"./node_modules/moment/locale/uz-latn.js","./uz.js":"./node_modules/moment/locale/uz.js","./vi":"./node_modules/moment/locale/vi.js","./vi.js":"./node_modules/moment/locale/vi.js","./x-pseudo":"./node_modules/moment/locale/x-pseudo.js","./x-pseudo.js":"./node_modules/moment/locale/x-pseudo.js","./yo":"./node_modules/moment/locale/yo.js","./yo.js":"./node_modules/moment/locale/yo.js","./zh-cn":"./node_modules/moment/locale/zh-cn.js","./zh-cn.js":"./node_modules/moment/locale/zh-cn.js","./zh-hk":"./node_modules/moment/locale/zh-hk.js","./zh-hk.js":"./node_modules/moment/locale/zh-hk.js","./zh-mo":"./node_modules/moment/locale/zh-mo.js","./zh-mo.js":"./node_modules/moment/locale/zh-mo.js","./zh-tw":"./node_modules/moment/locale/zh-tw.js","./zh-tw.js":"./node_modules/moment/locale/zh-tw.js"};function r(e){var t=s(e);return n(t)}function s(e){if(!n.o(o,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return o[e]}r.keys=function(){return Object.keys(o)},r.resolve=s,e.exports=r,r.id="./node_modules/moment/locale sync recursive ^\\.\\/.*$"},"./node_modules/ng-csv/build/ng-csv.min.js":(e,t)=>{var n;n=window,document,angular.module("ngCsv.config",[]).value("ngCsv.config",{debug:!0}).config(["$compileProvider",function(e){angular.isDefined(e.urlSanitizationWhitelist)?e.urlSanitizationWhitelist(/^\s*(https?|ftp|mailto|file|data):/):e.aHrefSanitizationWhitelist(/^\s*(https?|ftp|mailto|file|data):/)}]),angular.module("ngCsv.directives",["ngCsv.services"]),angular.module("ngCsv.services",[]),angular.module("ngCsv",["ngCsv.config","ngCsv.services","ngCsv.directives","ngSanitize"]),e.exports===t&&(e.exports="ngCsv"),angular.module("ngCsv.services").service("CSV",["$q",function(e){var t="\r\n",n={"\\t":"\t","\\b":"\b","\\v":"\v","\\f":"\f","\\r":"\r"};this.stringifyField=function(e,t){return"locale"===t.decimalSep&&this.isFloat(e)?e.toLocaleString():"."!==t.decimalSep&&this.isFloat(e)?e.toString().replace(".",t.decimalSep):"string"==typeof e?(e=e.replace(/"/g,'""'),(t.quoteStrings||e.indexOf(",")>-1||e.indexOf("\n")>-1||e.indexOf("\r")>-1)&&(e=t.txtDelim+e+t.txtDelim),e):"boolean"==typeof e?e?"TRUE":"FALSE":e},this.isFloat=function(e){return+e===e&&(!isFinite(e)||Boolean(e%1))},this.stringify=function(n,o){var r=e.defer(),s=this,a="",i="",d=e.when(n).then((function(e){var n,d;angular.isDefined(o.header)&&o.header&&(n=[],angular.forEach(o.header,(function(e){this.push(s.stringifyField(e,o))}),n),d=n.join(o.fieldSep?o.fieldSep:","),i+=d+t);var u,m,l=[];angular.isArray(e)?l=e:angular.isFunction(e)&&(l=e()),angular.isDefined(o.label)&&o.label&&"boolean"==typeof o.label&&(u=[],angular.forEach(l[0],(function(e,t){this.push(s.stringifyField(t,o))}),u),m=u.join(o.fieldSep?o.fieldSep:","),i+=m+t),angular.forEach(l,(function(e,n){var r,a,d=angular.copy(l[n]);a=[];var u=o.columnOrder?o.columnOrder:d;angular.forEach(u,(function(e){var t=o.columnOrder?d[e]:e;this.push(s.stringifyField(t,o))}),a),r=a.join(o.fieldSep?o.fieldSep:","),i+=n'),i=angular.element(a.children()[0]);i.attr("href",n.URL.createObjectURL(o)),i.attr("download",e.getFilename()),i.attr("target","_blank"),r.find("body").append(a),s((function(){i[0].click(),i.remove()}),null)}}()})),e.$apply()}))}}}])},"./src/js/chat/chat.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/dc49a9ba939f8c099868.html"},"./src/js/closing/closing.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/00860aee362cdeeb1080.html"},"./src/js/offline/offline.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/9962474df74f9405ac72.html"},"./src/js/online/online.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/caf0e553108b226443aa.html"},"./src/js/unmanaged/unmanaged.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/3f18dac5f545add792db.html"},"./src/js/waiting/waiting.tpl.html":(e,t,n)=>{"use strict";e.exports=n.p+"templates/6043a16afdb829ba5934.html"}},e=>{var t=t=>e(e.s=t);e.O(0,["vendor-index","vendor-angular-76f2ed34","vendor-angular-58d021f3","vendor-ng-embed","vendor-moment","vendor-jquery","vendor-jquery.textcomplete","vendor-emojionearea","vendor-emojione","vendor-angular-sanitize","vendor-angular-resource","vendor-angular-messages","vendor-angular-material","vendor-angular-local-storage","vendor-angular-animate","vendor-urlMatcher","vendor-transition","vendor-stateService","vendor-stateDirectives","vendor-flow"],(()=>(t("./node_modules/jquery/dist/jquery.js"),t("./node_modules/angular/index-exposed.js"),t("./node_modules/moment/moment.js"),t("./node_modules/@flowjs/flow.js/src/flow.js"),t("./node_modules/emojione/lib/js/emojione.js"),t("./src/js/index.module.js")))),e.O()}]); +//# sourceMappingURL=chat.js.map \ No newline at end of file diff --git a/snippet/3.5.0/scripts/chat.js.LICENSE.txt b/snippet/3.6.0/scripts/chat.js.LICENSE.txt similarity index 100% rename from snippet/3.5.0/scripts/chat.js.LICENSE.txt rename to snippet/3.6.0/scripts/chat.js.LICENSE.txt diff --git a/snippet/3.6.0/scripts/chat.js.map b/snippet/3.6.0/scripts/chat.js.map new file mode 100644 index 0000000..42a0b12 --- /dev/null +++ b/snippet/3.6.0/scripts/chat.js.map @@ -0,0 +1 @@ +{"version":3,"file":"scripts/chat.js","mappings":"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","sources":["webpack://motion-chat/./node_modules/@flowjs/ng-flow/dist/ng-flow.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/directives/viewDirective.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/templateFactory.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/statebuilders/onEnterExitRetain.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/locationServices.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/services.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/stateFilters.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/stateProvider.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/statebuilders/views.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/urlRouterProvider.js","webpack://motion-chat/./node_modules/@uirouter/angularjs/lib-esm/viewScroll.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/common.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/coreservices.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/glob.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/hof.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/predicates.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/queue.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/safeConsole.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/strings.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/common/trace.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/globals.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/lazyLoad.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/params/param.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/params/paramType.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/params/paramTypes.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/params/stateParams.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/path/pathNode.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/path/pathUtils.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/resolve/interface.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/resolve/resolvable.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/resolve/resolveContext.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/router.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/state/stateBuilder.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/state/stateMatcher.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/state/stateObject.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/state/stateQueueManager.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/state/stateRegistry.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/state/targetState.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/hookBuilder.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/hookRegistry.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/interface.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/rejectFactory.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/transitionEventType.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/transitionHook.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/coreResolvables.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/redirectTo.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/onEnterExitRetain.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/resolve.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/views.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/updateGlobals.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/url.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/ignoredTransition.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/hooks/invalidTransition.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/transition/transitionService.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/url/urlConfig.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/url/urlMatcherFactory.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/url/urlRouter.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/url/urlRule.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/url/urlRules.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/url/urlService.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/baseLocationService.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/browserLocationConfig.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/hashLocationService.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationConfig.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/memoryLocationService.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/plugins.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/pushStateLocationService.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/q.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/vanilla/utils.js","webpack://motion-chat/./node_modules/@uirouter/core/lib-esm/view/view.js","webpack://motion-chat/./node_modules/angular-aria/angular-aria.js","webpack://motion-chat/./node_modules/angular-rateit/dist/ng-rateit.js","webpack://motion-chat/./src/js/index.controller.js","webpack://motion-chat/./src/js/index.route.js","webpack://motion-chat/./src/js/closing/closing.controller.js","webpack://motion-chat/./src/js/index.factory.js","webpack://motion-chat/./src/js/chat/chat.controller.js","webpack://motion-chat/./src/js/offline/offline.controller.js","webpack://motion-chat/./src/js/online/online.controller.js","webpack://motion-chat/./src/js/unmanaged/unmanaged.controller.js","webpack://motion-chat/./src/js/waiting/waiting.controller.js","webpack://motion-chat/./src/js/common/remote-storage.service.js","webpack://motion-chat/./src/js/index.module.js","webpack://motion-chat/./node_modules/expose-loader/dist/runtime/getGlobalThis.js","webpack://motion-chat/./node_modules/json-form-data/src/jsonToFormData.js","webpack://motion-chat/./node_modules/moment/locale/af.js","webpack://motion-chat/./node_modules/moment/locale/ar-dz.js","webpack://motion-chat/./node_modules/moment/locale/ar-kw.js","webpack://motion-chat/./node_modules/moment/locale/ar-ly.js","webpack://motion-chat/./node_modules/moment/locale/ar-ma.js","webpack://motion-chat/./node_modules/moment/locale/ar-sa.js","webpack://motion-chat/./node_modules/moment/locale/ar-tn.js","webpack://motion-chat/./node_modules/moment/locale/ar.js","webpack://motion-chat/./node_modules/moment/locale/az.js","webpack://motion-chat/./node_modules/moment/locale/be.js","webpack://motion-chat/./node_modules/moment/locale/bg.js","webpack://motion-chat/./node_modules/moment/locale/bm.js","webpack://motion-chat/./node_modules/moment/locale/bn-bd.js","webpack://motion-chat/./node_modules/moment/locale/bn.js","webpack://motion-chat/./node_modules/moment/locale/bo.js","webpack://motion-chat/./node_modules/moment/locale/br.js","webpack://motion-chat/./node_modules/moment/locale/bs.js","webpack://motion-chat/./node_modules/moment/locale/ca.js","webpack://motion-chat/./node_modules/moment/locale/cs.js","webpack://motion-chat/./node_modules/moment/locale/cv.js","webpack://motion-chat/./node_modules/moment/locale/cy.js","webpack://motion-chat/./node_modules/moment/locale/da.js","webpack://motion-chat/./node_modules/moment/locale/de-at.js","webpack://motion-chat/./node_modules/moment/locale/de-ch.js","webpack://motion-chat/./node_modules/moment/locale/de.js","webpack://motion-chat/./node_modules/moment/locale/dv.js","webpack://motion-chat/./node_modules/moment/locale/el.js","webpack://motion-chat/./node_modules/moment/locale/en-au.js","webpack://motion-chat/./node_modules/moment/locale/en-ca.js","webpack://motion-chat/./node_modules/moment/locale/en-gb.js","webpack://motion-chat/./node_modules/moment/locale/en-ie.js","webpack://motion-chat/./node_modules/moment/locale/en-il.js","webpack://motion-chat/./node_modules/moment/locale/en-in.js","webpack://motion-chat/./node_modules/moment/locale/en-nz.js","webpack://motion-chat/./node_modules/moment/locale/en-sg.js","webpack://motion-chat/./node_modules/moment/locale/eo.js","webpack://motion-chat/./node_modules/moment/locale/es-do.js","webpack://motion-chat/./node_modules/moment/locale/es-mx.js","webpack://motion-chat/./node_modules/moment/locale/es-us.js","webpack://motion-chat/./node_modules/moment/locale/es.js","webpack://motion-chat/./node_modules/moment/locale/et.js","webpack://motion-chat/./node_modules/moment/locale/eu.js","webpack://motion-chat/./node_modules/moment/locale/fa.js","webpack://motion-chat/./node_modules/moment/locale/fi.js","webpack://motion-chat/./node_modules/moment/locale/fil.js","webpack://motion-chat/./node_modules/moment/locale/fo.js","webpack://motion-chat/./node_modules/moment/locale/fr-ca.js","webpack://motion-chat/./node_modules/moment/locale/fr-ch.js","webpack://motion-chat/./node_modules/moment/locale/fr.js","webpack://motion-chat/./node_modules/moment/locale/fy.js","webpack://motion-chat/./node_modules/moment/locale/ga.js","webpack://motion-chat/./node_modules/moment/locale/gd.js","webpack://motion-chat/./node_modules/moment/locale/gl.js","webpack://motion-chat/./node_modules/moment/locale/gom-deva.js","webpack://motion-chat/./node_modules/moment/locale/gom-latn.js","webpack://motion-chat/./node_modules/moment/locale/gu.js","webpack://motion-chat/./node_modules/moment/locale/he.js","webpack://motion-chat/./node_modules/moment/locale/hi.js","webpack://motion-chat/./node_modules/moment/locale/hr.js","webpack://motion-chat/./node_modules/moment/locale/hu.js","webpack://motion-chat/./node_modules/moment/locale/hy-am.js","webpack://motion-chat/./node_modules/moment/locale/id.js","webpack://motion-chat/./node_modules/moment/locale/is.js","webpack://motion-chat/./node_modules/moment/locale/it-ch.js","webpack://motion-chat/./node_modules/moment/locale/it.js","webpack://motion-chat/./node_modules/moment/locale/ja.js","webpack://motion-chat/./node_modules/moment/locale/jv.js","webpack://motion-chat/./node_modules/moment/locale/ka.js","webpack://motion-chat/./node_modules/moment/locale/kk.js","webpack://motion-chat/./node_modules/moment/locale/km.js","webpack://motion-chat/./node_modules/moment/locale/kn.js","webpack://motion-chat/./node_modules/moment/locale/ko.js","webpack://motion-chat/./node_modules/moment/locale/ku.js","webpack://motion-chat/./node_modules/moment/locale/ky.js","webpack://motion-chat/./node_modules/moment/locale/lb.js","webpack://motion-chat/./node_modules/moment/locale/lo.js","webpack://motion-chat/./node_modules/moment/locale/lt.js","webpack://motion-chat/./node_modules/moment/locale/lv.js","webpack://motion-chat/./node_modules/moment/locale/me.js","webpack://motion-chat/./node_modules/moment/locale/mi.js","webpack://motion-chat/./node_modules/moment/locale/mk.js","webpack://motion-chat/./node_modules/moment/locale/ml.js","webpack://motion-chat/./node_modules/moment/locale/mn.js","webpack://motion-chat/./node_modules/moment/locale/mr.js","webpack://motion-chat/./node_modules/moment/locale/ms-my.js","webpack://motion-chat/./node_modules/moment/locale/ms.js","webpack://motion-chat/./node_modules/moment/locale/mt.js","webpack://motion-chat/./node_modules/moment/locale/my.js","webpack://motion-chat/./node_modules/moment/locale/nb.js","webpack://motion-chat/./node_modules/moment/locale/ne.js","webpack://motion-chat/./node_modules/moment/locale/nl-be.js","webpack://motion-chat/./node_modules/moment/locale/nl.js","webpack://motion-chat/./node_modules/moment/locale/nn.js","webpack://motion-chat/./node_modules/moment/locale/oc-lnc.js","webpack://motion-chat/./node_modules/moment/locale/pa-in.js","webpack://motion-chat/./node_modules/moment/locale/pl.js","webpack://motion-chat/./node_modules/moment/locale/pt-br.js","webpack://motion-chat/./node_modules/moment/locale/pt.js","webpack://motion-chat/./node_modules/moment/locale/ro.js","webpack://motion-chat/./node_modules/moment/locale/ru.js","webpack://motion-chat/./node_modules/moment/locale/sd.js","webpack://motion-chat/./node_modules/moment/locale/se.js","webpack://motion-chat/./node_modules/moment/locale/si.js","webpack://motion-chat/./node_modules/moment/locale/sk.js","webpack://motion-chat/./node_modules/moment/locale/sl.js","webpack://motion-chat/./node_modules/moment/locale/sq.js","webpack://motion-chat/./node_modules/moment/locale/sr-cyrl.js","webpack://motion-chat/./node_modules/moment/locale/sr.js","webpack://motion-chat/./node_modules/moment/locale/ss.js","webpack://motion-chat/./node_modules/moment/locale/sv.js","webpack://motion-chat/./node_modules/moment/locale/sw.js","webpack://motion-chat/./node_modules/moment/locale/ta.js","webpack://motion-chat/./node_modules/moment/locale/te.js","webpack://motion-chat/./node_modules/moment/locale/tet.js","webpack://motion-chat/./node_modules/moment/locale/tg.js","webpack://motion-chat/./node_modules/moment/locale/th.js","webpack://motion-chat/./node_modules/moment/locale/tk.js","webpack://motion-chat/./node_modules/moment/locale/tl-ph.js","webpack://motion-chat/./node_modules/moment/locale/tlh.js","webpack://motion-chat/./node_modules/moment/locale/tr.js","webpack://motion-chat/./node_modules/moment/locale/tzl.js","webpack://motion-chat/./node_modules/moment/locale/tzm-latn.js","webpack://motion-chat/./node_modules/moment/locale/tzm.js","webpack://motion-chat/./node_modules/moment/locale/ug-cn.js","webpack://motion-chat/./node_modules/moment/locale/uk.js","webpack://motion-chat/./node_modules/moment/locale/ur.js","webpack://motion-chat/./node_modules/moment/locale/uz-latn.js","webpack://motion-chat/./node_modules/moment/locale/uz.js","webpack://motion-chat/./node_modules/moment/locale/vi.js","webpack://motion-chat/./node_modules/moment/locale/x-pseudo.js","webpack://motion-chat/./node_modules/moment/locale/yo.js","webpack://motion-chat/./node_modules/moment/locale/zh-cn.js","webpack://motion-chat/./node_modules/moment/locale/zh-hk.js","webpack://motion-chat/./node_modules/moment/locale/zh-mo.js","webpack://motion-chat/./node_modules/moment/locale/zh-tw.js","webpack://motion-chat//home/marco/projects/motion-server/motion-chat/node_modules/moment/locale|sync|/^\\.\\/.*$/","webpack://motion-chat/./node_modules/ng-csv/build/ng-csv.min.js"],"names":["angular","module","provider","this","defaults","factory","options","Flow","events","on","event","callback","push","$get","fn","opts","flow","extend","forEach","controller","$scope","$attrs","$parse","flowFactory","$eval","flowInit","flowObject","create","catchAllHandler","eventName","args","Array","prototype","slice","call","arguments","shift","$broadcast","apply","concat","$applyAsync","defaultPrevented","$on","off","$flow","hasOwnProperty","flowName","assign","directive","scope","element","attrs","isDirectory","isSingleFile","inputAttrs","flowAttrs","assignBrowse","bind","preventDefault","$timeout","promise","enter","dragEvent","fileDrag","dataTransfer","originalEvent","types","val","$apply","flowDragEnter","cancel","flowDragLeave","assignDrop","flowDropEnabled","$watch","value","unAssignDrop","fileSuccess","fileProgress","fileAdded","filesAdded","filesSubmitted","fileRetry","fileRemoved","fileError","uploadStart","complete","progress","error","eventArgs","string","name","charAt","toUpperCase","require","funcArgs","key","file","flowImg","fileReader","FileReader","readAsDataURL","onload","$set","target","result","transfers","files","uiView","$ViewDirectiveFill","$compile","$controller","$transitions","$view","$q","getControllerAs","parse","getResolveAs","restrict","priority","compile","tElement","initial","html","empty","$element","data","contents","cfg","$cfg","viewDecl","getTemplate","noop","resolveCtx","path","ResolveContext","trace","$uiView","link","controllerAs","resolveAs","locals","controllerInstance","children","registerControllerCallbacks","isString","component","kebobName","kebobString","tagRegexp_1","RegExp","deregisterWatch_1","directiveEl","filter","el","tagName","exec","ctrlInstance","$animate","$uiViewScroll","$interpolate","rootData","$context","_pluginapi","_rootViewContext","count","terminal","transclude","tAttrs","$transclude","previousEl","currentEl","currentScope","viewConfig","onloadExp","autoScrollExp","renderer","cb","then","leave","inherited","inheritedData","activeUIView","$type","id","fqn","config","configUpdated","updateView","fromParentTagConfig","fromParentTag","unregister","registerUIView","newScope","$new","animEnter","defer","animLeave","$uiViewData","$uiViewAnim","$animEnter","$animLeave","$$animLeave","$emit","cloned","clone","resolve","isDefined","remove","$destroy","_viewData_1","cleanupLastView","$inject","hasComponentImpl","_uiCanExitId","isFunction","$onInit","componentProvider","viewState","tail","state","self","hookOptions","uiOnParamsChanged","viewCreationTrans_1","getResolvable","onSuccess","$transition$","exiting","indexOf","toParams","params","fromParams","getNodeSchema","node","paramSchema","toSchema","treeChanges","map","reduce","unnestR","fromSchema","changedToParams","param","idx","type","equals","length","changedKeys_1","x","newValues","uiCanExit","id_1","cacheProp_1","prevTruthyAnswer_1","trans","redirectedFrom","criteria","onBefore","ids","when","TemplateFactory","_this","_useHttp","$http","$templateCache","$injector","$templateRequest","has","get","useHttpService","fromConfig","context","asTemplate","services","str","template","asComponent","fromString","templateUrl","fromUrl","templateProvider","fromProvider","fromComponentProvider","url","cache","headers","Accept","response","deps","providerFn","isArray","Resolvable","makeComponentTemplate","bindings","prefix","kebob","camelCase","kebobed","cmpDefs","Error","getBindings","getComponentBindings","input","attrName","attr","resolveName","res","join","def","isObject","bindToController","scopeBindings","bindingsObj","Object","keys","tuple","getStateHookBuilder","hookName","stateObject","hook","pathname","subContext","$$state","getLocals","$state$","undefined","Ng1LocationServices","$locationProvider","_urlListeners","_lp","createProxyFunctions","monkeyPatchPathParameterType","router","pathType","urlMatcherFactory","encode","toString","replace","m","decode","dispose","onChange","removeFrom","html5Mode","enabled","$sniffer","history","baseHref","_baseHref","$browser","$window","location","newUrl","$location","_runtimeServices","$rootScope","evt","_loc","mod_init","mod_util","mod_rtr","mod_state","mod_main","$uiRouterProvider","UIRouter","stateProvider","stateRegistry","stateService","decorator","viewService","_viewConfigFactory","urlService","_decodeParams","ng1LocationService","locationService","locationConfig","getProviderFor","serviceName","$urp","service","runBlock","$uiRouter","invoke","checkStrictDi","strictDi","resolvables","resolvable","annotate","resolveFn","watchDigests","uiRouter","urlRouterProvider","globals","run","$urlMatcherFactory","$state","$urlRouter","ctx","getTokens","getPolicy","async","applyPairs","$IsStateFilter","isFilter","is","$stateful","$IncludedByStateFilter","includesFilter","includes","StateProvider","func","definition","register","onInvalid","getNg1ViewConfigFactory","templateFactory","view","Ng1ViewConfig","hasAnyKey","obj","acc","ng1ViewsBuilder","parent","compKeys","nonCompKeys","allViewKeys","views","viewsObject","$default","pick","$name","normalized","ViewService","$uiViewName","uiViewName","$uiViewContextAnchor","uiViewContextAnchor","$id","loaded","load","paramValues","promises","getController","all","results","controllerProvider","isInjectable","UrlRouterProvider","injectableHandler","handler","match","$match","$stateParams","urlRouter","update","interceptDeferred","listen","rule","ruleFn","BaseUrlRule","identity","rules","otherwise","urlRules","what","deferIntercept","useAnchorScroll","$anchorScroll","scrollIntoView","__spreadArrays","s","i","il","r","k","a","j","jl","root","g","global","fromJson","JSON","toJson","stringify","toObj","_equals","o1","o2","t1","a1","a2","tup","arrayTuples","b","t","getTime","source","fnNames","latebind","bindFunction","fnName","inherit","extra","inArray","array","splice","pushTo","arr","deregAll","functions","defaultsList","_i","defaultVals","reverse","mergeR","memo","item","ancestors","first","second","n","propNames","objCopy","_prop","omit","collection","accept","find","mapObj","values","allTrueR","elem","anyTrueR","flattenR","pushR","uniqR","token","unnest","assertPredicate","predicateOrMap","errMsg","maxArrayLen","min","Math","_loop_1","keyValTuple","copy","src","dest","silenceUncaughtInPromise","catch","e","silentRejection","makeStub","methods","fnname","Glob","text","glob","split","regexpString","seg","regexp","matches","test","curry","curried","compose","start","pipe","funcs","prop","propEq","_val","not","and","fn1","fn2","or","any","ctor","constructor","v","pattern","struct","toStr","tis","isUndefined","isNull","o","isNullOrUndefined","isNumber","isDate","isRegExp","head","isPromise","Queue","_items","_limit","_evictListeners","onEvict","enqueue","items","evict","dequeue","size","clear","current","peekTail","peekHead","noopConsoleStub","log","table","safeConsole","document","documentMode","window","console","bound","Function","ie9Console","fallbackConsole","maxLength","max","substr","padString","$1","toLowerCase","functionToString","fnStr","fnToString","namedFunctionMatch","_fn","isRejection","stringifyPattern","_transitionRejection","seen","format","beforeAfterSubstr","char","stripLastPathElement","splitHash","splitQuery","splitEqual","trimHashVal","splitOnDelim","delim","re","joinNeighborsR","Category","uiViewString","uiview","creationContext","normalizedCat","_tid","_rid","transLbl","Trace","_enabled","approximateDigests","_set","categories","parseInt","isNaN","category","enable","disable","traceTransitionStart","TRANSITION","traceTransitionIgnored","traceHookInvocation","step","HOOK","registeredHook","traceHookResult","hookResult","transitionOptions","traceResolvePath","RESOLVE","traceResolvableResolved","traceError","reason","traceSuccess","finalState","traceUIViewEvent","viewData","UIVIEW","traceUIViewConfigUpdated","traceUIViewFill","traceViewSync","pairs","VIEWCONFIG","uivheader","mapping","_a","_b","uiv","sort","localeCompare","traceViewServiceEvent","viewConfigString","traceViewServiceUIViewEvent","UIRouterGlobals","lastStartedTransitionId","transitionHistory","successfulTransitions","transition","lazyLoadHook","entering","lazyLoad","lazyLoadState","originalTransition","orig","targetState","identifier","$url","parts","sync","registerLazyLoadHook","transitionService","lazyLoadFn","states","_state","err","DefType","hasOwn","Param","urlConfig","paramName","noReloadOnSearch","reloadOnSearch","SEARCH","dynamic","defaultConfig","paramConfig","getStaticDefaultValue","isShorthand","$$fn","unwrapShorthand","getParamDeclaration","urlType","paramTypes","CONFIG","PATH","getType","arrayDefaults","arrayParamNomenclature","arrayMode","$asArray","isOptional","raw","squash","defaultPolicy","getSquashPolicy","defaultSquashPolicy","from","to","configuredKeys","getReplace","params_1","changed","values1","values2","validates","isDefaultValue","replaceSpecialValues","_defaultValueCache","defaultValue","getDefaultValue","$normalize","isSearch","encoded","ParamType","$subPattern","sub","mode","ArrayType","arrayWrap","arrayHandler","allTruthyMode","arrayUnwrap","arrayEqualsHandler","val1","val2","left","right","paramTypeFn","wrapperFn","$arrayMode","makeDefaultType","ParamTypes","typeQueue","defaultTypes","definitionFn","_flushTypeQueue","valToString","defaultTypeBase","String","query","hash","int","bool","Boolean","date","getFullYear","getMonth","getDate","capture","Date","valueOf","l","json","StateParams","$inherit","newParams","$current","$to","parentParams","parents","inheritList","PathNode","stateOrNode","parameters","applyRawParams","pDef","paramDef","parameter","paramsFn","diff","PathUtils","makeTargetState","registry","buildPath","buildToPath","fromPath","toPath","inheritParams","applyViewConfigs","viewDecls","subPath","viewConfigs","createViewConfig","toKeys","noInherit","toNode","toParamVals","incomingParamVals","fromParamVals","ownParamVals","reloadState","node1","node2","retained","keep","nonDynamicParams","retainedWithToParams","retainedNode","matching","pathA","pathB","done","nodeA","nodeB","predicate","elementIdx","resolvePolicies","LAZY","EAGER","WAIT","NOWAIT","arg1","policy","resolved","literal","thisPolicy","statePolicy","resolvePolicy","resolveContext","findNode","asyncPolicy","customAsyncPolicy","getDependencies","resolvedDeps","resolvedValue","fromData","whens","ALL_WHENS","EAGER_WHENS","_path","addResolvables","newResolvables","resolvePath","matchedWhens","matchesPolicy","acceptedVals","whenOrAsync","nodeResolvables","nowait","wait","getResult","injector","_injector","UIInjectorImpl","availableResolvables","_node","fromInjector","getNative","native","getAsync","_routerInstance","locationServiceStub","locationConfigStub","_disposed","_disposables","_plugins","disposable","d","ignored","plugin","pluginInstance","getPlugin","pluginName","nameBuilder","selfBuilder","dataBuilder","getUrlBuilder","$urlMatcherFactoryProvider","stateDec","newStateDec","parsed","substring","parseUrl","isMatcher","navigable","append","getNavigableBuilder","isRoot","pathBuilder","includesBuilder","resolvablesBuilder","resolveObj","getToken","p","provide","literal2Resolvable","useFactory","dependencies","useClass","useValue","useExisting","tuple2Resolvable","item2Resolvable","decl","StateBuilder","matcher","paramFactory","builders","parentName","urlParams","nonUrlParams","builder","build","chain","parentFn","segments","pop","StateMatcher","_states","isRelative","stateName","stateOrName","base","matchGlob","isStr","__stateObjectCache","nameGlob","baseState","splitName","pathLength","relName","StateObject","stateDecl","isStateClass","ref","matchingKeys","isStateDeclaration","isState","StateQueueManager","listeners","queue","flush","registered","orphans","previousQueueLength","getState","notifyListeners","listener","name_1","orphanIdx","existingState","existingFutureState","deregister","attachRoute","prev","abstract","rulesApi","urlRuleFactory","StateRegistry","stateQueue","_registerRoot","_root","onStatesChanged","stateDefinition","_deregisterTree","getChildren","_children","deregistered","removeRule","deregisteredStates","found","property","builderFunction","TargetState","_stateRegistry","_identifier","_params","_options","_definition","relative","exists","valid","withState","withParams","withOptions","newOpts","isDef","HookBuilder","buildHooksForPhase","phase","_getEvents","buildHooks","hookType","matchingHooks","getMatchingHooks","reverseDepthSort","baseHookOptions","criteriaMatchPath","traceData","transitionHook","reverseSort","factor","depthDelta","isCreate","hookPhase","reg","getHooks","matchState","criterion","toMatch","globStrings","RegisteredHook","tranSvc","eventType","matchCriteria","removeHookFromRegistry","invokeCount","_deregistered","invokeLimit","_matchingNodes","nodes","_getDefaultMatchCriteria","_getPathTypes","_getMatchingNodes","mn","pathtype","isStateHook","every","makeEvent","hooks","_registeredHooks","removeHookFn","hookRegistrationFn","matchObject","TransitionHookPhase","TransitionHookScope","RejectType","Rejection","message","detail","isRejectionPromise","superseded","rejection","SUPERSEDED","redirected","invalid","INVALID","IGNORED","aborted","ABORTED","errored","ERROR","normalize","toPromise","TransitionEventType","hookOrder","getResultHandler","getErrorHandler","synchronous","defaultOptions","TransitionHook","stateContext","isSuperseded","isActive","waitFor","nextHook","invokeHook","invokeHooks","doneCallback","remainingHooks","runAllHooks","logError","defaultErrorHandler","notCurrent","getNotCurrentRejection","handleError","handleResult","handleHookResult","isTargetState","_aborted","HANDLE_RESULT","LOG_REJECTED_RESULT","LOG_ERROR","REJECT_ERROR","THROW_ERROR","addCoreResolvables","addResolvable","TRANSITION_TOKENS","isTransition","treeChangesCleanup","replaceTransitionWithNull","redirectToHook","redirect","redirectTo","makeEnterExitRetainHook","hookFn","onExitHook","onRetainHook","onEnterHook","RESOLVE_HOOK_PRIORITY","eagerResolvePath","lazyResolveState","resolveRemaining","loadEnteringViews","enteringViews","activateViews","exitingViews","vc","deactivateViewConfig","activateViewConfig","updateGlobalState","clearCurrentTransition","updateUrl","urlOptions","ignoredHook","ignoredReason","_ignoredReason","pending","abort","invalidTransitionHook","defaultTransOpts","notify","reload","supercede","custom","TransitionService","_router","_transitionCount","_eventTypes","_criteriaPaths","_deregisterHookFns","_defineCorePaths","_defineCoreEvents","_registerCoreTransitionHooks","onCreate","onStart","onExit","onRetain","onEnter","onFinish","onError","hooksArray","Phase","TH","paths","NORMAL_SORT","SYNCHRONOUS","_defineEvent","CREATE","BEFORE","RUN","SUCCESS","STATE","_definePathType","cmpByPhase","hookScope","fns","addCoreResolves","registerInvalidTransitionHook","registerRedirectToHook","registerOnExitHook","registerOnRetainHook","registerOnEnterHook","eagerResolve","registerEagerResolvePath","lazyResolve","registerLazyResolveState","resolveAll","registerResolveRemaining","loadViews","registerLoadEnteringViews","registerActivateViews","updateGlobals","registerUpdateGlobalState","registerUpdateUrl","UrlConfig","_isCaseInsensitive","_isStrictMode","_defaultSquashPolicy","hashPrefix","newprefix","host","port","protocol","caseInsensitive","strictMode","__assign","ParamFactory","fromSearch","UrlMatcherFactory","UrlMatcher","globalConfig","strict","decodeParams","object","UrlRouter","urlParts","compareFn","read","urlMatcher","href","absolute","isHtml5","appendBasePath","slash","cfgPort","defineProperty","enumerable","configurable","UrlRuleFactory","makeRule","_what","fromUrlMatcher","fromState","fromRegExp","_handler","details","matchPriority","optional","search","stateOrDecl","transitionTo","sticky","Number","isUrlRule","defaultRuleSortFn","getHandlerFn","cmp","prioritySort","weights","URLMATCHER","REGEXP","RAW","OTHER","typeSort","urlMatcherSort","useMatchPriority","idSort","UrlRules","_sortFn","_rules","_id","_otherwiseFn","handlerFn","_sorted","ensureSorted","sorted","stableSort","group","_group","arrOfWrapper","wrapperA","wrapperB","cmpDiff","wrapper","UrlService","newurl","best","go","applyResult","_stopListeningFn","weight","BaseLocationServices","fireAfterUpdate","_listeners","_listener","_get","_location","_history","BrowserLocationConfig","_isHtml5","_hashPrefix","hostname","getBaseHref","baseTag","getElementsByTagName","extendStatics","__extends","setPrototypeOf","__proto__","__","HashLocationService","_super","title","MemoryLocationConfig","_port","_protocol","_host","newval","MemoryLocationService","_url","PushStateLocationService","_config","_getBasePrefix","basePrefix","exactBaseHrefMatch","startsWithBase","fullUrl","replaceState","pushState","Promise","reject","deferred","keyValsToObjectR","accum","getParams","queryString","orEmptyString","beforehash","buildUrl","loc","searchObject","locationPluginFactory","serviceClass","configurationClass","configuration","_uiViews","_viewConfigs","_viewConfigFactories","_registeredUIView","_registeredUIViews","_activeViewConfigs","_onSync","normalizeUIViewTarget","rawViewName","viewAtContext","relativeViewNameSugar","anchorState","anchor","_rootContext","viewType","cfgFactory","cfgs","uiViewsByFqn","viewConfigDepth","depthCompare","depthFn","posNeg","uiViewTuples","stateDepth","matchingConfigs","matchedViewConfigs","unmatchedConfigTuples","allTuples","uiViews","available","active","vcSegments","uivSegments","negOffset","fqnToFirstSegment","uiViewContext","ARIA_DISABLE_ATTR","ngAriaModule","info","angularVersion","ariaHidden","ariaChecked","ariaReadonly","ariaDisabled","ariaRequired","ariaInvalid","ariaValue","tabindex","bindKeydown","bindRoleForClick","watchExpr","ariaAttr","nativeAriaNodeNames","negate","ariaCamelName","isNodeOneOf","boolVal","newConfig","$$watchExpr","nodeTypeArray","nodeName","$aria","shouldAttachAttr","normalizedAttr","allowNonAriaNodes","shouldAttachRole","role","shape","getShape","post","ngModel","needsTabIndex","ngAriaWatchModelValue","$modelValue","newVal","$viewValue","$isEmpty","needsAriaValuemin","needsAriaValuemax","needsAriaValuenow","$observe","$validators","required","$invalid","ngMessages","ngClick","ngKeydown","ngKeypress","ngKeyup","keyCode","which","isContentEditable","$event","readOnly","pristine","resetable","starWidth","starHeight","canelWidth","cancelHeight","rated","reset","beforeRated","beforeReset","isTouch","navigator","msMaxTouchPoints","orgValue","starPartWidth","steps","garbage","getValue","index","getStartParts","getStarOffset","ratio","isSelected","removeRating","rating","setValue","tmpValue","put","IndexController","$mdDialog","RemoteStorageService","api","STORAGE_LAYOUT","STORAGE_VISITOR","vm","toggle","up","updateStorage","cmd","layout","postMessage","onStorageError","debug","visitor","status","div_color","settings","color","text_color","textColor","text_button_color","textButtonColor","button_color","color_button","background_color","backgroundColor","client_height","documentElement","clientHeight","innerHeight","client_width","clientWidth","style","setProperty","tg","getStoredValueWithLocation","visitorStoragePromise","getItem","layoutStoragePromise","visitorValue","layoutValue","interaction","alignment","online","exceeded","maxInteractions","openedInteractions","isOnline","hideWhenOffline","createElement","appendChild","sheet","insertRule","close","confirm","querySelector","clickOutsideToClose","closingQuestion","ok","show","chatInteraction","customUpdate","closed","closeReason","$promise","download","getMessages","intid","includeAll","_map","rows","row","sender","direction","customerAlias","ContactId","agentIdentifier","UserId","agentAlias","User","alias","fullname","body","createdAt","moment","getHeaderShape","header_shape","CHAT_STATUSES","offline","defaultTitle","header_online","header_offline","addEventListener","routeRun","cursor","hide","_forIn","_isNil","routeConfig","$stateProvider","$httpProvider","localStorageServiceProvider","STORAGE_PREFIX","Pragma","setPrefix","waitingTemplate","onlineTemplate","offlineTemplate","chatTemplate","unmanagedTemplate","closingTemplate","ClosingController","$mdToast","errors","toast","simple","textContent","formSubmitFailureMessage","toastClass","position","stopLoading","loading","goToIfTime","form","upColor","downColor","userForm","$setPristine","$setUntouched","enableDownload","removeItem","submit","_merge","ratingType","customer","formSubmitSuccessMessage","finally","skip","apiService","$resource","paramDefaults","baseUrl","remote","chatWebsite","method","getFields","uploadAttachment","transformRequest","downloadAttachment","abandon","chatMessage","ChatController","$interval","$document","emojiArea","getMessagesInterval","getInteractionInterval","lastMessageId","clearStorage","scrollToBottomOfChat","getElementsByClassName","scrollTop","scrollHeight","handleSizeError","sendMessage","updateRootscope","interactionStarted","emojioneArea","setText","getInteraction","disposition","reply","getText","shiftKey","includeAgent","added","_find","messages","emojiOptions","watchEmbedData","fontSmiley","emoji","linkTarget","ngFlowOptions","allowDuplicateUploads","showMenu","replyMessage","$","placeholder","placeholderMessage","keyup","editor","ready","setFocus","reply_button","maxFileSizeMb","fd","FormData","AttachmentId","_values","OfflineController","$sce","fromKey","initialFields","typeField","optJsonFormData","showLeafArrayIndexes","includeNullValues","onSubmitSuccess","fields","_cloneDeep","trustAsHtml","initUploadButton","formItem","uploadItem","button","label","css","trigger","click","props","maxSizeMB","some","sizeErrMessage","removeFileItem","setupFileInput","multipleUpload","setAttribute","makeFileOptionsVisible","fileOpts","lastOpt","mapKeyOffline","_random","field","helpText","isHTML","checkHTML","cmField","uploadFields","payLoad","isFormDataPayload","isJsonPayload","payload","jsonToFormData","initialFormData","OnlineController","initVisitorForm","mapKey","disableItem","chatInteractionId","messageId","channel","variable","referer","customerIp","chatMessageError","enableCustomerWriting","UnmanagedController","note","WaitingController","getInteractionIntervalHandle","open","remoteAddress","URL","address","origin","setItem","action","storage","expectedAction","removeEventListener","stringData","warn","toTrustedFilter","constant","ngEnter","getElementById","div","startTime","sentAt","createTextNode","myWindow","write","innerHTML","focus","print","printElement","elemToPrint","$mdGestureProvider","skipClickHijack","exports","globalThis","isJsonObject","Blob","isGlobalFormDataPresent","getDefaultFormData","convertRecursively","jsonObject","formData","parentKey","propName","FileList","toISOString","mergedOptions","carry","objectToMerge","objectKey","defineLocale","months","monthsShort","weekdays","weekdaysShort","weekdaysMin","meridiemParse","isPM","meridiem","hours","minutes","isLower","longDateFormat","LT","LTS","L","LL","LLL","LLLL","calendar","sameDay","nextDay","nextWeek","lastDay","lastWeek","sameElse","relativeTime","future","past","ss","mm","h","hh","dd","M","MM","y","yy","dayOfMonthOrdinalParse","ordinal","number","week","dow","doy","pluralForm","plurals","pluralize","u","withoutSuffix","isFuture","f","weekdaysParseExact","hour","minute","postformat","symbolMap","preparse","numberMap","suffixes","relativeTimeWithPlural","num","forms","standalone","isFormat","day","period","w","ww","lastDigit","last2Digits","meridiemHour","monthsShortRegex","monthsParseExact","relativeTimeWithMutation","mutationTable","softMutation","mutation","lastNumber","monthsParse","monthsRegex","minWeekdaysParse","weekdaysParse","fullWeekdaysParse","shortWeekdaysParse","monthsStrictRegex","monthsShortStrictRegex","longMonthsParse","shortMonthsParse","translate","ll","lll","llll","output","plural","processRelativeTime","monthsNominativeEl","monthsGenitiveEl","momentToFormat","_monthsGenitiveEl","month","_monthsNominativeEl","calendarEl","mom","_calendarEl","monthsShortDot","invalidDate","numbersPast","numbersFuture","verbalNumber","monthsShortWithDots","monthsShortWithoutDots","weekEndings","eras","since","offset","narrow","abbr","until","eraYearOrdinalRegex","eraYearOrdinalParse","now","$0","$2","isUpper","eifelerRegelAppliesToNumber","units","translateSingular","special","relativeTimeWithSingular","translator","words","correctGrammaticalCase","wordKey","relativeTimeMr","monthsNominative","monthsSubjective","separator","days","numbersNouns","numberNoun","hundred","floor","ten","one","word","numberAsNoun","time","hm","processHoursFunction","nominative","accusative","genitive","webpackContext","req","webpackContextResolve","__webpack_require__","code","urlSanitizationWhitelist","aHrefSanitizationWhitelist","stringifyField","decimalSep","isFloat","toLocaleString","quoteStrings","txtDelim","isFinite","header","fieldSep","c","columnOrder","addByteOrderMarker","isSpecialChar","getSpecialChar","filename","charset","csv","buildCSV","getFilename","addClass","ngCsvLoadingClass","csvHeader","csvColumnOrder","csvLabel","removeClass","msSaveOrOpenBlob","msSaveBlob","createObjectURL"],"sourceRoot":""} \ No newline at end of file diff --git a/snippet/3.5.0/scripts/mobile.js b/snippet/3.6.0/scripts/mobile.js similarity index 100% rename from snippet/3.5.0/scripts/mobile.js rename to snippet/3.6.0/scripts/mobile.js diff --git a/snippet/3.5.0/scripts/runtime.js b/snippet/3.6.0/scripts/runtime.js similarity index 100% rename from snippet/3.5.0/scripts/runtime.js rename to snippet/3.6.0/scripts/runtime.js diff --git a/snippet/3.5.0/scripts/runtime.js.map b/snippet/3.6.0/scripts/runtime.js.map similarity index 100% rename from snippet/3.5.0/scripts/runtime.js.map rename to snippet/3.6.0/scripts/runtime.js.map diff --git a/snippet/3.5.0/scripts/vendor-angular-58d021f3.js b/snippet/3.6.0/scripts/vendor-angular-58d021f3.js similarity index 100% rename from snippet/3.5.0/scripts/vendor-angular-58d021f3.js rename to snippet/3.6.0/scripts/vendor-angular-58d021f3.js diff --git a/snippet/3.5.0/scripts/vendor-angular-58d021f3.js.map b/snippet/3.6.0/scripts/vendor-angular-58d021f3.js.map similarity index 100% rename from snippet/3.5.0/scripts/vendor-angular-58d021f3.js.map rename to snippet/3.6.0/scripts/vendor-angular-58d021f3.js.map diff --git a/snippet/3.5.0/scripts/vendor-angular-76f2ed34.js b/snippet/3.6.0/scripts/vendor-angular-76f2ed34.js similarity index 100% rename from snippet/3.5.0/scripts/vendor-angular-76f2ed34.js rename to snippet/3.6.0/scripts/vendor-angular-76f2ed34.js diff --git a/snippet/3.5.0/scripts/vendor-angular-76f2ed34.js.LICENSE.txt b/snippet/3.6.0/scripts/vendor-angular-76f2ed34.js.LICENSE.txt similarity index 100% rename from snippet/3.5.0/scripts/vendor-angular-76f2ed34.js.LICENSE.txt rename to snippet/3.6.0/scripts/vendor-angular-76f2ed34.js.LICENSE.txt diff --git a/snippet/3.5.0/scripts/vendor-angular-76f2ed34.js.map b/snippet/3.6.0/scripts/vendor-angular-76f2ed34.js.map similarity index 100% rename from snippet/3.5.0/scripts/vendor-angular-76f2ed34.js.map rename to snippet/3.6.0/scripts/vendor-angular-76f2ed34.js.map diff --git a/snippet/3.5.0/scripts/vendor-angular-animate.js b/snippet/3.6.0/scripts/vendor-angular-animate.js similarity index 100% rename from snippet/3.5.0/scripts/vendor-angular-animate.js rename to snippet/3.6.0/scripts/vendor-angular-animate.js diff --git a/snippet/3.5.0/scripts/vendor-angular-animate.js.LICENSE.txt b/snippet/3.6.0/scripts/vendor-angular-animate.js.LICENSE.txt similarity index 100% rename from snippet/3.5.0/scripts/vendor-angular-animate.js.LICENSE.txt rename to snippet/3.6.0/scripts/vendor-angular-animate.js.LICENSE.txt diff --git a/snippet/3.5.0/scripts/vendor-angular-animate.js.map b/snippet/3.6.0/scripts/vendor-angular-animate.js.map similarity index 100% rename from snippet/3.5.0/scripts/vendor-angular-animate.js.map rename to snippet/3.6.0/scripts/vendor-angular-animate.js.map diff --git a/snippet/3.5.0/scripts/vendor-angular-local-storage.js b/snippet/3.6.0/scripts/vendor-angular-local-storage.js similarity index 100% rename from snippet/3.5.0/scripts/vendor-angular-local-storage.js rename to snippet/3.6.0/scripts/vendor-angular-local-storage.js diff --git a/snippet/3.5.0/scripts/vendor-angular-local-storage.js.LICENSE.txt b/snippet/3.6.0/scripts/vendor-angular-local-storage.js.LICENSE.txt similarity index 100% rename from snippet/3.5.0/scripts/vendor-angular-local-storage.js.LICENSE.txt rename to snippet/3.6.0/scripts/vendor-angular-local-storage.js.LICENSE.txt diff --git a/snippet/3.5.0/scripts/vendor-angular-local-storage.js.map b/snippet/3.6.0/scripts/vendor-angular-local-storage.js.map similarity index 100% rename from snippet/3.5.0/scripts/vendor-angular-local-storage.js.map rename to snippet/3.6.0/scripts/vendor-angular-local-storage.js.map diff --git a/snippet/3.5.0/scripts/vendor-angular-material.js b/snippet/3.6.0/scripts/vendor-angular-material.js similarity index 100% rename from snippet/3.5.0/scripts/vendor-angular-material.js rename to snippet/3.6.0/scripts/vendor-angular-material.js diff --git a/snippet/3.5.0/scripts/vendor-angular-material.js.LICENSE.txt b/snippet/3.6.0/scripts/vendor-angular-material.js.LICENSE.txt similarity index 100% rename from snippet/3.5.0/scripts/vendor-angular-material.js.LICENSE.txt rename to snippet/3.6.0/scripts/vendor-angular-material.js.LICENSE.txt diff --git a/snippet/3.5.0/scripts/vendor-angular-material.js.map b/snippet/3.6.0/scripts/vendor-angular-material.js.map similarity index 100% rename from snippet/3.5.0/scripts/vendor-angular-material.js.map rename to snippet/3.6.0/scripts/vendor-angular-material.js.map diff --git a/snippet/3.5.0/scripts/vendor-angular-messages.js b/snippet/3.6.0/scripts/vendor-angular-messages.js similarity index 100% rename from snippet/3.5.0/scripts/vendor-angular-messages.js rename to snippet/3.6.0/scripts/vendor-angular-messages.js diff --git a/snippet/3.5.0/scripts/vendor-angular-messages.js.LICENSE.txt b/snippet/3.6.0/scripts/vendor-angular-messages.js.LICENSE.txt similarity index 100% rename from snippet/3.5.0/scripts/vendor-angular-messages.js.LICENSE.txt rename to snippet/3.6.0/scripts/vendor-angular-messages.js.LICENSE.txt diff --git a/snippet/3.5.0/scripts/vendor-angular-messages.js.map b/snippet/3.6.0/scripts/vendor-angular-messages.js.map similarity index 100% rename from snippet/3.5.0/scripts/vendor-angular-messages.js.map rename to snippet/3.6.0/scripts/vendor-angular-messages.js.map diff --git a/snippet/3.5.0/scripts/vendor-angular-resource.js b/snippet/3.6.0/scripts/vendor-angular-resource.js similarity index 100% rename from snippet/3.5.0/scripts/vendor-angular-resource.js rename to snippet/3.6.0/scripts/vendor-angular-resource.js diff --git a/snippet/3.5.0/scripts/vendor-angular-resource.js.LICENSE.txt b/snippet/3.6.0/scripts/vendor-angular-resource.js.LICENSE.txt similarity index 100% rename from snippet/3.5.0/scripts/vendor-angular-resource.js.LICENSE.txt rename to snippet/3.6.0/scripts/vendor-angular-resource.js.LICENSE.txt diff --git a/snippet/3.5.0/scripts/vendor-angular-resource.js.map b/snippet/3.6.0/scripts/vendor-angular-resource.js.map similarity index 100% rename from snippet/3.5.0/scripts/vendor-angular-resource.js.map rename to snippet/3.6.0/scripts/vendor-angular-resource.js.map diff --git a/snippet/3.5.0/scripts/vendor-angular-sanitize.js b/snippet/3.6.0/scripts/vendor-angular-sanitize.js similarity index 100% rename from snippet/3.5.0/scripts/vendor-angular-sanitize.js rename to snippet/3.6.0/scripts/vendor-angular-sanitize.js diff --git a/snippet/3.5.0/scripts/vendor-angular-sanitize.js.LICENSE.txt b/snippet/3.6.0/scripts/vendor-angular-sanitize.js.LICENSE.txt similarity index 100% rename from snippet/3.5.0/scripts/vendor-angular-sanitize.js.LICENSE.txt rename to snippet/3.6.0/scripts/vendor-angular-sanitize.js.LICENSE.txt diff --git a/snippet/3.5.0/scripts/vendor-angular-sanitize.js.map b/snippet/3.6.0/scripts/vendor-angular-sanitize.js.map similarity index 100% rename from snippet/3.5.0/scripts/vendor-angular-sanitize.js.map rename to snippet/3.6.0/scripts/vendor-angular-sanitize.js.map diff --git a/snippet/3.5.0/scripts/vendor-emojione.js b/snippet/3.6.0/scripts/vendor-emojione.js similarity index 100% rename from snippet/3.5.0/scripts/vendor-emojione.js rename to snippet/3.6.0/scripts/vendor-emojione.js diff --git a/snippet/3.5.0/scripts/vendor-emojione.js.map b/snippet/3.6.0/scripts/vendor-emojione.js.map similarity index 100% rename from snippet/3.5.0/scripts/vendor-emojione.js.map rename to snippet/3.6.0/scripts/vendor-emojione.js.map diff --git a/snippet/3.5.0/scripts/vendor-emojionearea.js b/snippet/3.6.0/scripts/vendor-emojionearea.js similarity index 100% rename from snippet/3.5.0/scripts/vendor-emojionearea.js rename to snippet/3.6.0/scripts/vendor-emojionearea.js diff --git a/snippet/3.5.0/scripts/vendor-emojionearea.js.LICENSE.txt b/snippet/3.6.0/scripts/vendor-emojionearea.js.LICENSE.txt similarity index 100% rename from snippet/3.5.0/scripts/vendor-emojionearea.js.LICENSE.txt rename to snippet/3.6.0/scripts/vendor-emojionearea.js.LICENSE.txt diff --git a/snippet/3.5.0/scripts/vendor-emojionearea.js.map b/snippet/3.6.0/scripts/vendor-emojionearea.js.map similarity index 100% rename from snippet/3.5.0/scripts/vendor-emojionearea.js.map rename to snippet/3.6.0/scripts/vendor-emojionearea.js.map diff --git a/snippet/3.5.0/scripts/vendor-flow.js b/snippet/3.6.0/scripts/vendor-flow.js similarity index 100% rename from snippet/3.5.0/scripts/vendor-flow.js rename to snippet/3.6.0/scripts/vendor-flow.js diff --git a/snippet/3.5.0/scripts/vendor-flow.js.LICENSE.txt b/snippet/3.6.0/scripts/vendor-flow.js.LICENSE.txt similarity index 100% rename from snippet/3.5.0/scripts/vendor-flow.js.LICENSE.txt rename to snippet/3.6.0/scripts/vendor-flow.js.LICENSE.txt diff --git a/snippet/3.5.0/scripts/vendor-flow.js.map b/snippet/3.6.0/scripts/vendor-flow.js.map similarity index 100% rename from snippet/3.5.0/scripts/vendor-flow.js.map rename to snippet/3.6.0/scripts/vendor-flow.js.map diff --git a/snippet/3.5.0/scripts/vendor-index.js b/snippet/3.6.0/scripts/vendor-index.js similarity index 100% rename from snippet/3.5.0/scripts/vendor-index.js rename to snippet/3.6.0/scripts/vendor-index.js diff --git a/snippet/3.5.0/scripts/vendor-index.js.map b/snippet/3.6.0/scripts/vendor-index.js.map similarity index 100% rename from snippet/3.5.0/scripts/vendor-index.js.map rename to snippet/3.6.0/scripts/vendor-index.js.map diff --git a/snippet/3.5.0/scripts/vendor-jquery.js b/snippet/3.6.0/scripts/vendor-jquery.js similarity index 100% rename from snippet/3.5.0/scripts/vendor-jquery.js rename to snippet/3.6.0/scripts/vendor-jquery.js diff --git a/snippet/3.5.0/scripts/vendor-jquery.js.LICENSE.txt b/snippet/3.6.0/scripts/vendor-jquery.js.LICENSE.txt similarity index 100% rename from snippet/3.5.0/scripts/vendor-jquery.js.LICENSE.txt rename to snippet/3.6.0/scripts/vendor-jquery.js.LICENSE.txt diff --git a/snippet/3.5.0/scripts/vendor-jquery.js.map b/snippet/3.6.0/scripts/vendor-jquery.js.map similarity index 100% rename from snippet/3.5.0/scripts/vendor-jquery.js.map rename to snippet/3.6.0/scripts/vendor-jquery.js.map diff --git a/snippet/3.5.0/scripts/vendor-jquery.textcomplete.js b/snippet/3.6.0/scripts/vendor-jquery.textcomplete.js similarity index 100% rename from snippet/3.5.0/scripts/vendor-jquery.textcomplete.js rename to snippet/3.6.0/scripts/vendor-jquery.textcomplete.js diff --git a/snippet/3.5.0/scripts/vendor-jquery.textcomplete.js.LICENSE.txt b/snippet/3.6.0/scripts/vendor-jquery.textcomplete.js.LICENSE.txt similarity index 100% rename from snippet/3.5.0/scripts/vendor-jquery.textcomplete.js.LICENSE.txt rename to snippet/3.6.0/scripts/vendor-jquery.textcomplete.js.LICENSE.txt diff --git a/snippet/3.5.0/scripts/vendor-jquery.textcomplete.js.map b/snippet/3.6.0/scripts/vendor-jquery.textcomplete.js.map similarity index 100% rename from snippet/3.5.0/scripts/vendor-jquery.textcomplete.js.map rename to snippet/3.6.0/scripts/vendor-jquery.textcomplete.js.map diff --git a/snippet/3.5.0/scripts/vendor-moment.js b/snippet/3.6.0/scripts/vendor-moment.js similarity index 100% rename from snippet/3.5.0/scripts/vendor-moment.js rename to snippet/3.6.0/scripts/vendor-moment.js diff --git a/snippet/3.5.0/scripts/vendor-moment.js.LICENSE.txt b/snippet/3.6.0/scripts/vendor-moment.js.LICENSE.txt similarity index 100% rename from snippet/3.5.0/scripts/vendor-moment.js.LICENSE.txt rename to snippet/3.6.0/scripts/vendor-moment.js.LICENSE.txt diff --git a/snippet/3.5.0/scripts/vendor-moment.js.map b/snippet/3.6.0/scripts/vendor-moment.js.map similarity index 100% rename from snippet/3.5.0/scripts/vendor-moment.js.map rename to snippet/3.6.0/scripts/vendor-moment.js.map diff --git a/snippet/3.5.0/scripts/vendor-ng-embed.js b/snippet/3.6.0/scripts/vendor-ng-embed.js similarity index 100% rename from snippet/3.5.0/scripts/vendor-ng-embed.js rename to snippet/3.6.0/scripts/vendor-ng-embed.js diff --git a/snippet/3.5.0/scripts/vendor-ng-embed.js.map b/snippet/3.6.0/scripts/vendor-ng-embed.js.map similarity index 100% rename from snippet/3.5.0/scripts/vendor-ng-embed.js.map rename to snippet/3.6.0/scripts/vendor-ng-embed.js.map diff --git a/snippet/3.5.0/scripts/vendor-stateDirectives.js b/snippet/3.6.0/scripts/vendor-stateDirectives.js similarity index 100% rename from snippet/3.5.0/scripts/vendor-stateDirectives.js rename to snippet/3.6.0/scripts/vendor-stateDirectives.js diff --git a/snippet/3.5.0/scripts/vendor-stateDirectives.js.map b/snippet/3.6.0/scripts/vendor-stateDirectives.js.map similarity index 100% rename from snippet/3.5.0/scripts/vendor-stateDirectives.js.map rename to snippet/3.6.0/scripts/vendor-stateDirectives.js.map diff --git a/snippet/3.5.0/scripts/vendor-stateService.js b/snippet/3.6.0/scripts/vendor-stateService.js similarity index 100% rename from snippet/3.5.0/scripts/vendor-stateService.js rename to snippet/3.6.0/scripts/vendor-stateService.js diff --git a/snippet/3.5.0/scripts/vendor-stateService.js.map b/snippet/3.6.0/scripts/vendor-stateService.js.map similarity index 100% rename from snippet/3.5.0/scripts/vendor-stateService.js.map rename to snippet/3.6.0/scripts/vendor-stateService.js.map diff --git a/snippet/3.5.0/scripts/vendor-transition.js b/snippet/3.6.0/scripts/vendor-transition.js similarity index 100% rename from snippet/3.5.0/scripts/vendor-transition.js rename to snippet/3.6.0/scripts/vendor-transition.js diff --git a/snippet/3.5.0/scripts/vendor-transition.js.map b/snippet/3.6.0/scripts/vendor-transition.js.map similarity index 100% rename from snippet/3.5.0/scripts/vendor-transition.js.map rename to snippet/3.6.0/scripts/vendor-transition.js.map diff --git a/snippet/3.5.0/scripts/vendor-urlMatcher.js b/snippet/3.6.0/scripts/vendor-urlMatcher.js similarity index 100% rename from snippet/3.5.0/scripts/vendor-urlMatcher.js rename to snippet/3.6.0/scripts/vendor-urlMatcher.js diff --git a/snippet/3.5.0/scripts/vendor-urlMatcher.js.map b/snippet/3.6.0/scripts/vendor-urlMatcher.js.map similarity index 100% rename from snippet/3.5.0/scripts/vendor-urlMatcher.js.map rename to snippet/3.6.0/scripts/vendor-urlMatcher.js.map diff --git a/snippet/3.5.0/styles/app.css b/snippet/3.6.0/styles/app.css similarity index 100% rename from snippet/3.5.0/styles/app.css rename to snippet/3.6.0/styles/app.css diff --git a/snippet/3.5.0/styles/app.css.map b/snippet/3.6.0/styles/app.css.map similarity index 100% rename from snippet/3.5.0/styles/app.css.map rename to snippet/3.6.0/styles/app.css.map diff --git a/snippet/3.5.0/styles/mobile.css b/snippet/3.6.0/styles/mobile.css similarity index 100% rename from snippet/3.5.0/styles/mobile.css rename to snippet/3.6.0/styles/mobile.css diff --git a/snippet/3.5.0/styles/mobile.css.map b/snippet/3.6.0/styles/mobile.css.map similarity index 100% rename from snippet/3.5.0/styles/mobile.css.map rename to snippet/3.6.0/styles/mobile.css.map diff --git a/snippet/3.5.0/styles/vendor.css b/snippet/3.6.0/styles/vendor.css similarity index 100% rename from snippet/3.5.0/styles/vendor.css rename to snippet/3.6.0/styles/vendor.css diff --git a/snippet/3.5.0/styles/vendor.css.map b/snippet/3.6.0/styles/vendor.css.map similarity index 100% rename from snippet/3.5.0/styles/vendor.css.map rename to snippet/3.6.0/styles/vendor.css.map diff --git a/snippet/3.5.0/templates/00860aee362cdeeb1080.html b/snippet/3.6.0/templates/00860aee362cdeeb1080.html similarity index 100% rename from snippet/3.5.0/templates/00860aee362cdeeb1080.html rename to snippet/3.6.0/templates/00860aee362cdeeb1080.html diff --git a/snippet/3.5.0/templates/3f18dac5f545add792db.html b/snippet/3.6.0/templates/3f18dac5f545add792db.html similarity index 100% rename from snippet/3.5.0/templates/3f18dac5f545add792db.html rename to snippet/3.6.0/templates/3f18dac5f545add792db.html diff --git a/snippet/3.5.0/templates/6043a16afdb829ba5934.html b/snippet/3.6.0/templates/6043a16afdb829ba5934.html similarity index 100% rename from snippet/3.5.0/templates/6043a16afdb829ba5934.html rename to snippet/3.6.0/templates/6043a16afdb829ba5934.html diff --git a/snippet/3.5.0/templates/9962474df74f9405ac72.html b/snippet/3.6.0/templates/9962474df74f9405ac72.html similarity index 100% rename from snippet/3.5.0/templates/9962474df74f9405ac72.html rename to snippet/3.6.0/templates/9962474df74f9405ac72.html diff --git a/snippet/3.5.0/templates/caf0e553108b226443aa.html b/snippet/3.6.0/templates/caf0e553108b226443aa.html similarity index 100% rename from snippet/3.5.0/templates/caf0e553108b226443aa.html rename to snippet/3.6.0/templates/caf0e553108b226443aa.html diff --git a/snippet/3.5.0/templates/dc49a9ba939f8c099868.html b/snippet/3.6.0/templates/dc49a9ba939f8c099868.html similarity index 100% rename from snippet/3.5.0/templates/dc49a9ba939f8c099868.html rename to snippet/3.6.0/templates/dc49a9ba939f8c099868.html